diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 6bb9cdd4ab4f..0a0bc901a99a 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -964,9 +964,6 @@ # ServiceLabel: %Mgmt # AzureSdkOwners: @weidongxu-microsoft -# PRLabel: %Mgmt -/sdk/resourcemanagerhybrid/ @weidongxu-microsoft @haolingdong-msft @XiaofeiCao @arthurma1978 @bganapa @Azure/azure-java-sdk - # ######## Eng Sys ######## /eng/ @raych1 @weshaggard @benbp diff --git a/eng/CredScanSuppression.json b/eng/CredScanSuppression.json index 503d55cc9a9e..2047be81adf5 100644 --- a/eng/CredScanSuppression.json +++ b/eng/CredScanSuppression.json @@ -28,13 +28,6 @@ ], "_justification": "Javadoc in azure-resourcemanager" }, - { - "placeholder": [ - "h2AllowImplicitFlow", - "h2Permissions" - ], - "_justification": "Javadoc in azure resourcemanagerhybrid" - }, { "file": [ "test-proxy.log" @@ -64,7 +57,6 @@ "file": [ "sdk/communication/azure-communication-common-perf/src/main/java/com.azure.communication.common.perf/FakeCredentialInTest.java", "sdk/keyvault/azure-security-keyvault-certificates/src/test/java/com/azure/security/keyvault/certificates/FakeCredentialInTest.java", - "sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/resources/session-records/AzureResourceManagerTests.testContainerRegistry.json", "sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/FakeCredentialInTest.java", "sdk/spring/spring-cloud-azure-service/src/test/java/com/azure/spring/cloud/service/implementation/storage/FakeCredentialInTest.java", "sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/FakeCredentialInTest.java", diff --git a/eng/scripts/Generate-ServiceDirectories-From-Project-List.ps1 b/eng/scripts/Generate-ServiceDirectories-From-Project-List.ps1 index 4e4734faa8ce..1541fc32845e 100644 --- a/eng/scripts/Generate-ServiceDirectories-From-Project-List.ps1 +++ b/eng/scripts/Generate-ServiceDirectories-From-Project-List.ps1 @@ -60,21 +60,17 @@ foreach($file in Get-ChildItem -Path $SourcesDirectory -Filter pom*.xml -Recurse $xmlPomFile.Load($file.FullName) $library = $xmlPomFile.project.groupId + ":" + $xmlPomFile.project.artifactId $serviceDirectory = (Get-Item $file).Directory.Parent - # This if check is only necessary because resourcemanager and resourcemanagerhybrid contain the - # exact same group/artifact ids - if ($file.FullName.Split([IO.Path]::DirectorySeparatorChar) -notcontains "resourcemanagerhybrid") { - # The directories for sparse checkout and ServiceDirectories need the $SourcesDirectory - # stripped off - $tempDir = $serviceDirectory.FullName.Replace("$SourcesDirectory", "") - $tempDir = $tempDir.Replace([IO.Path]::DirectorySeparatorChar, '/') - $sparseCheckoutDirHash.Add($library, $tempDir) - if ($tempDir.StartsWith("/sdk/")) { - # Strip off the "/sdk/" to get the service directory. A ServiceDirectory will always have - # the format of /SDK/. Whereas sparse checkout can have other directories - # outside of /SDK, eg. /common - $tempDir = $tempDir.Replace("/sdk/", "") - $serviceDirHash.Add($library, $tempDir) - } + # The directories for sparse checkout and ServiceDirectories need the $SourcesDirectory + # stripped off + $tempDir = $serviceDirectory.FullName.Replace("$SourcesDirectory", "") + $tempDir = $tempDir.Replace([IO.Path]::DirectorySeparatorChar, '/') + $sparseCheckoutDirHash.Add($library, $tempDir) + if ($tempDir.StartsWith("/sdk/")) { + # Strip off the "/sdk/" to get the service directory. A ServiceDirectory will always have + # the format of /SDK/. Whereas sparse checkout can have other directories + # outside of /SDK, eg. /common + $tempDir = $tempDir.Replace("/sdk/", "") + $serviceDirHash.Add($library, $tempDir) } } @@ -91,13 +87,7 @@ foreach ($project in $ProjectList) { } } -# This is sad. Because resourcemanager and resourcemanagerhybrid contain the some of the same -# artifacts and we don't know which one is actually needed, if resourcemanager is in the list -# then add resourcemanagerhybrid. Write-Host "sparseCheckoutDirectories=$sparseCheckoutDirectories" -if ($sparseCheckoutDirectories.Contains("/sdk/resourcemanager")) { - $sparseCheckoutDirectories += "/sdk/resourcemanagerhybrid" -} # Unreleased_ libraries are special. They're the only case, outside of FromSource runs where # libraries from other service directories, outside of the one we're building, need to get built. diff --git a/eng/scripts/Language-Settings.ps1 b/eng/scripts/Language-Settings.ps1 index 66e25b387c7a..0091725256f0 100644 --- a/eng/scripts/Language-Settings.ps1 +++ b/eng/scripts/Language-Settings.ps1 @@ -36,9 +36,7 @@ function Get-AllPackageInfoFromRepo([string]$serviceDirectory = $null) { # the service directory sits outside of the engineering system # 1. boms - BOMs are POM only releases. Also, their versions aren't version controlled. # 2. parents - parents are POM only releases which are version controlled - # 3. resourcemanagerhybrid - intermediate version of resourcemanager that was - # a one time release which sits outside of the engineering system - $excludeFolders = "boms", "resourcemanagerhybrid", "parents" + $excludeFolders = "boms", "parents" [array]$ymlFiles = Get-ChildItem -Path $sdkRoot -Include "ci*.yml" -Recurse -Depth 3 | Where-Object { $_.PSIsContainer -eq $false -and $_.DirectoryName -notmatch ($excludeFolders -join "|") } } diff --git a/eng/scripts/Update-Artifacts-List-For-Patch-Release.ps1 b/eng/scripts/Update-Artifacts-List-For-Patch-Release.ps1 index 319674db5da4..75d402da3976 100644 --- a/eng/scripts/Update-Artifacts-List-For-Patch-Release.ps1 +++ b/eng/scripts/Update-Artifacts-List-For-Patch-Release.ps1 @@ -29,8 +29,7 @@ $artifactsDict = [ordered]@{} $addModulesDict = [ordered]@{} $ymlFiles = Get-ChildItem -Path $SourcesDirectory -Recurse -Depth 3 -File -Filter "ci.yml" foreach ($ymlFile in $ymlFiles) { - if ($ymlFile.FullName.Split([IO.Path]::DirectorySeparatorChar) -contains "resourcemanagerhybrid" -or - $ymlFile.FullName -eq $YmlToUpdate) { + if ($ymlFile.FullName -eq $YmlToUpdate) { continue } $ymlContent = Get-Content $ymlFile.FullName -Raw diff --git a/eng/scripts/generate_aggregate_pom.py b/eng/scripts/generate_aggregate_pom.py index 4fb546a20f88..a5908d862089 100644 --- a/eng/scripts/generate_aggregate_pom.py +++ b/eng/scripts/generate_aggregate_pom.py @@ -239,11 +239,8 @@ def create_projects(project_list_identifiers: list, artifact_identifier_to_versi projects: Dict[str, Project] = {} for root, _, files in os.walk(root_path): - # Ignore sdk/resourcemanagerhybrid, sdk/e2e, sdk/template and azure-security-test-keyvault-jca - if 'resourcemanagerhybrid' in root \ - or 'e2e' in root \ - or 'azure-security-test-keyvault-jca' in root \ - or 'template' in root: + # Ignore sdk/e2e, sdk/template and azure-security-test-keyvault-jca + if 'e2e' in root or 'azure-security-test-keyvault-jca' in root or 'template' in root: continue for file_name in files: diff --git a/eng/scripts/generate_from_source_pom.py b/eng/scripts/generate_from_source_pom.py index 5b9113163acb..89e60945c04c 100644 --- a/eng/scripts/generate_from_source_pom.py +++ b/eng/scripts/generate_from_source_pom.py @@ -222,10 +222,6 @@ def create_projects(artifacts_list_identifiers: list, artifact_identifier_to_ver projects: Dict[str, Project] = {} for root, _, files in os.walk(root_path): - # Ignore sdk/resourcemanagerhybrid - if 'resourcemanagerhybrid' in root: - continue - # Also ignore sdk/e2e as this only creates noise during checkout as it uses many current dependencies but isn't an actual project we want to build. if 'e2e' in root: continue diff --git a/eng/versioning/pom_file_version_scanner.ps1 b/eng/versioning/pom_file_version_scanner.ps1 index 654188d7deb4..ad1e5a6740a1 100644 --- a/eng/versioning/pom_file_version_scanner.ps1 +++ b/eng/versioning/pom_file_version_scanner.ps1 @@ -164,8 +164,7 @@ function Get-ArtifactsList-Per-Service-Directory { } # The ci.cosmos.yml lives in spring and is used to test the cosmos spring library. Its exception # will be moved once things are corrected. - if ($ymlFile.FullName.Split([IO.Path]::DirectorySeparatorChar) -contains "resourcemanagerhybrid" -or - $ymlFile.Name -eq "ci.cosmos.yml") { + if ($ymlFile.Name -eq "ci.cosmos.yml") { continue } # The path is going to be the key. Since there can be multiple yml files for a single path, @@ -569,12 +568,6 @@ Get-ChildItem -Path $Path -Filter pom*.xml -Recurse -File | ForEach-Object { return } - # Packages under sdk/resourcemanagerhybrid has duplicate artifactId with that under sdk/resourcemanager - if ($_.FullName -like "*resourcemanagerhybrid*") - { - return - } - # Code customization packages should be excluded. if ($_.FullName -like "*swagger*") { @@ -728,7 +721,7 @@ Get-ChildItem -Path $Path -Filter pom*.xml -Recurse -File | ForEach-Object { { # skip version checks when they have been intentionally applied via variables } - else + else { if ($versionNode.NextSibling -and $versionNode.NextSibling.NodeType -eq "Comment") { @@ -738,7 +731,7 @@ Get-ChildItem -Path $Path -Filter pom*.xml -Recurse -File | ForEach-Object { { # skip version checks when they have been intentionally applied via variables } - else + else { if ($versionNode.NextSibling.Value.Trim() -notmatch "{x-version-update;(.+)?$($groupId):$($artifactId);\w+}") { @@ -762,7 +755,7 @@ Get-ChildItem -Path $Path -Filter pom*.xml -Recurse -File | ForEach-Object { $hasError = $true $potentialLogMessage = Join-With-NewLine $potentialLogMessage "Error: Missing dependency version update tag for groupId=$($groupId), artifactId=$($artifactId). The tag should be " } - } + } } # Verify every plugin has a group, artifact and version # Verify every dependency has a group, artifact and version @@ -897,7 +890,7 @@ Get-ChildItem -Path $Path -Filter pom*.xml -Recurse -File | ForEach-Object { $groupId = $split[0] $artifactId = $split[1] $version = $split[2] - + if ($version.StartsWith('[${')) { # skip version checks when they have been intentionally applied via variables } diff --git a/sdk/resourcemanager/api-specs.json b/sdk/resourcemanager/api-specs.json index f71a57eafabb..6ef93ae0e91f 100644 --- a/sdk/resourcemanager/api-specs.json +++ b/sdk/resourcemanager/api-specs.json @@ -11,25 +11,12 @@ "package": "com.azure.resourcemanager.appservice", "args": "--tag=package-2025-03 --add-inner=AppServiceCertificate --remove-inner=CsmDeploymentStatus --name-for-ungrouped-operations=ResourceProvider --enable-sync-stack=false" }, - "appservice-hybrid": { - "dir": "../resourcemanagerhybrid/azure-resourcemanager-appservice", - "source": "specification/web/resource-manager/readme.md", - "package": "com.azure.resourcemanager.appservice", - "args": "--tag=profile-hybrid-2020-09-01 --add-inner=AppServiceCertificate --name-for-ungrouped-operations=ResourceProvider --stream-style-serialization=false --enable-sync-stack=false", - "note": "Add status code '200' to 'syncFunctionTriggers'" - }, "authorization": { "dir": "../authorization/azure-resourcemanager-authorization", "source": "specification/authorization/resource-manager/readme.md", "package": "com.azure.resourcemanager.authorization", "args": "--tag=package-2022-04-01 --enable-sync-stack=false" }, - "authorization-hybrid": { - "dir": "../resourcemanagerhybrid/azure-resourcemanager-authorization", - "source": "specification/authorization/resource-manager/readme.md", - "package": "com.azure.resourcemanager.authorization", - "args": "--tag=profile-hybrid-2020-09-01 --stream-style-serialization=false --enable-sync-stack=false" - }, "cdn": { "dir": "../cdn/azure-resourcemanager-cdn", "source": "specification/cdn/resource-manager/readme.md", @@ -42,12 +29,6 @@ "package": "com.azure.resourcemanager.compute", "args": "--tag=package-2025-04-01 --modelerfour.lenient-model-deduplication=true --rename-model=UserAssignedIdentitiesValue:VirtualMachineIdentityUserAssignedIdentities,VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue:VirtualMachineScaleSetIdentityUserAssignedIdentities --preserve-model=AvailabilitySetSkuTypes --remove-inner=StorageProfile --enable-sync-stack=false" }, - "compute-hybrid": { - "dir": "../resourcemanagerhybrid/azure-resourcemanager-compute", - "source": "specification/compute/resource-manager/readme.md", - "package": "com.azure.resourcemanager.compute", - "args": "--tag=profile-hybrid-2020-09-01 --modelerfour.lenient-model-deduplication=true --rename-model=UserAssignedIdentitiesValue:VirtualMachineIdentityUserAssignedIdentities,VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue:VirtualMachineScaleSetIdentityUserAssignedIdentities --preserve-model=AvailabilitySetSkuTypes --stream-style-serialization=false --enable-sync-stack=false" - }, "containerinstance": { "dir": "../containerinstance/azure-resourcemanager-containerinstance", "source": "specification/containerinstance/resource-manager/readme.md", @@ -67,24 +48,12 @@ "args": "--tag=package-2019-06-preview --title=ContainerRegistryTasksManagementClient --rename-operation-group:Registries:RegistryTasks --rename-model=DockerBuildStep:DockerTaskStep --modelerfour.lenient-model-deduplication=true --metadata-suffix=registrytasks --enable-sync-stack=false", "note": "Use commit 09695f5a97dfcf201766ea2f2e7e3b53aec49144 for Swagger before TypeSpec migration" }, - "containerregistry-hybrid": { - "dir": "../resourcemanagerhybrid/azure-resourcemanager-containerregistry", - "source": "specification/containerregistry/resource-manager/readme.md", - "package": "com.azure.resourcemanager.containerregistry", - "args": "--tag=package-2019-05 --stream-style-serialization=false --enable-sync-stack=false" - }, "containerservice": { "dir": "../containerservice/azure-resourcemanager-containerservice", "source": "specification/containerservice/resource-manager/Microsoft.ContainerService/aks/readme.md", "package": "com.azure.resourcemanager.containerservice", "args": "--tag=package-2025-10 --modelerfour.lenient-model-deduplication --preserve-model=ContainerServiceVMSizeTypes --rename-model=Ossku:OSSku --enable-sync-stack=false" }, - "containerservice-hybrid": { - "dir": "../resourcemanagerhybrid/azure-resourcemanager-containerservice", - "source": "specification/containerservice/resource-manager/readme.md", - "package": "com.azure.resourcemanager.containerservice", - "args": "--tag=profile-hybrid-2020-09-01 --preserve-model=ContainerServiceVMSizeTypes --stream-style-serialization=false --enable-sync-stack=false" - }, "cosmos": { "dir": "../cosmos/azure-resourcemanager-cosmos", "source": "specification/cosmos-db/resource-manager/Microsoft.DocumentDB/DocumentDB/readme.md", @@ -97,36 +66,18 @@ "package": "com.azure.resourcemanager.dns", "args": "--tag=package-2018-05 --enable-sync-stack=false" }, - "dns-hybrid": { - "dir": "../resourcemanagerhybrid/azure-resourcemanager-dns", - "source": "specification/dns/resource-manager/readme.md", - "package": "com.azure.resourcemanager.dns", - "args": "--tag=package-2016-04 --stream-style-serialization=false --enable-sync-stack=false" - }, "eventhubs": { "dir": "../eventhubs/azure-resourcemanager-eventhubs", "source": "specification/eventhub/resource-manager/readme.md", "package": "com.azure.resourcemanager.eventhubs", "args": "--tag=package-2024-01 --enable-sync-stack=false" }, - "eventhubs-hybrid": { - "dir": "../resourcemanagerhybrid/azure-resourcemanager-eventhubs", - "source": "specification/eventhub/resource-manager/readme.md", - "package": "com.azure.resourcemanager.eventhubs", - "args": "--tag=profile-hybrid-2020-09-01 --stream-style-serialization=false --enable-sync-stack=false" - }, "features": { "dir": "../resources/azure-resourcemanager-resources", "source": "specification/resources/resource-manager/readme.md", "package": "com.azure.resourcemanager.resources", "args": "--tag=package-features-2021-07 --metadata-suffix=feature --enable-sync-stack=false" }, - "features-hybrid": { - "dir": "../resourcemanagerhybrid/azure-resourcemanager-resources", - "source": "specification/resources/resource-manager/readme.md", - "package": "com.azure.resourcemanager.resources", - "args": "--tag=package-features-2015-12 --enable-sync-stack=false" - }, "msgraph": { "spec": ".", "dir": "azure-resourcemanager-authorization", @@ -134,12 +85,6 @@ "package": "com.azure.resourcemanager.authorization", "args": "--tag=v1.0 --metadata-suffix=msgraph --title=MicrosoftGraphClient --models-subpackage=fluent.models --enable-sync-stack=false" }, - "msgraph-hybrid": { - "dir": "../resourcemanagerhybrid/azure-resourcemanager-authorization", - "source": "specification/graphrbac/data-plane/readme.md", - "package": "com.azure.resourcemanager.authorization", - "args": "--tag=1.6 --stream-style-serialization=false --enable-sync-stack=false" - }, "keyvault": { "dir": "../keyvault/azure-resourcemanager-keyvault", "source": "specification/keyvault/resource-manager/readme.md", @@ -147,36 +92,18 @@ "args": "--tag=package-2024-11-01 --enable-sync-stack=false", "note": "use local azure-rest-api-specs and remove keys.json, secrets.json and keysManagedHsm.json in README.md tag" }, - "keyvault-hybrid": { - "dir": "../resourcemanagerhybrid/azure-resourcemanager-keyvault", - "source": "specification/keyvault/resource-manager/readme.md", - "package": "com.azure.resourcemanager.keyvault", - "args": "--tag=package-2019-09 --stream-style-serialization=false --enable-sync-stack=false" - }, "locks": { "dir": "../resources/azure-resourcemanager-resources", "source": "specification/resources/resource-manager/readme.md", "package": "com.azure.resourcemanager.resources", "args": "--tag=package-locks-2017-04 --metadata-suffix=lock --enable-sync-stack=false" }, - "locks-hybrid": { - "dir": "../resourcemanagerhybrid/azure-resourcemanager-resources", - "source": "specification/resources/resource-manager/readme.md", - "package": "com.azure.resourcemanager.resources", - "args": "--tag=package-locks-2016-09 --stream-style-serialization=false --enable-sync-stack=false" - }, "monitor": { "dir": "../monitor/azure-resourcemanager-monitor", "source": "specification/monitor/resource-manager/readme.md", "package": "com.azure.resourcemanager.monitor", "args": "--tag=package-composite-v1-java --modelerfour.lenient-model-deduplication=true --add-inner=AutoscaleProfile,ScaleRule,LocalizableString,DiagnosticSettingsCategoryResourceCollection --rename-model=MetricUnit:Unit,IdentityAutoGenerated:Identity,UserIdentityPropertiesAutoGenerated:UserIdentityProperties --enable-sync-stack=false" }, - "monitor-hybrid": { - "dir": "../resourcemanagerhybrid/azure-resourcemanager-monitor", - "source": "specification/monitor/resource-manager/readme.md", - "package": "com.azure.resourcemanager.monitor", - "args": "--tag=package-2021-04 --add-inner=AutoscaleProfile,ScaleRule,LocalizableString --rename-model=MetricUnit:Unit --stream-style-serialization=false --enable-sync-stack=false" - }, "network": { "dir": "../network/azure-resourcemanager-network", "source": "specification/network/resource-manager/readme.md", @@ -184,12 +111,6 @@ "args": "--tag=package-2025-03-01 --add-inner=ApplicationGatewayIpConfiguration,ApplicationGatewayPathRule,ApplicationGatewayProbe,ApplicationGatewayRedirectConfiguration,ApplicationGatewayRequestRoutingRule,ApplicationGatewaySslCertificate,ApplicationGatewayUrlPathMap,ApplicationGatewayAuthenticationCertificate,VirtualNetworkGatewayIpConfiguration,ConnectionMonitor,PacketCapture,ApplicationGateway,ApplicationGatewayListener --enable-sync-stack=false", "note": "Run DeprecateApplicationGatewaySku to deprecate v1 sku/tier in ApplicationGatewaySku." }, - "network-hybrid": { - "dir": "../resourcemanagerhybrid/azure-resourcemanager-network", - "source": "specification/network/resource-manager/readme.md", - "package": "com.azure.resourcemanager.network", - "args": "--tag=profile-hybrid-2020-09-01 --add-inner=ApplicationGatewayIpConfiguration,ApplicationGatewayPathRule,ApplicationGatewayProbe,ApplicationGatewayRedirectConfiguration,ApplicationGatewayRequestRoutingRule,ApplicationGatewaySslCertificate,ApplicationGatewayUrlPathMap,ApplicationGatewayAuthenticationCertificate,VirtualNetworkGatewayIpConfiguration,ConnectionMonitor,PacketCapture --remove-inner=Ipv6ExpressRouteCircuitPeeringConfig --stream-style-serialization=false --enable-sync-stack=false" - }, "policy": { "dir": "../resources/azure-resourcemanager-resources", "source": "specification/resources/resource-manager/readme.md", @@ -197,12 +118,6 @@ "args": "--tag=package-policy-2023-04-java --metadata-suffix=policy --rename-model=UserAssignedIdentitiesValue:IdentityUserAssignedIdentitiesValue --enable-sync-stack=false", "note": "Remove policyVariables.json and policyVariableValues.json from tag, as they are still in preview." }, - "policy-hybrid": { - "dir": "../resourcemanagerhybrid/azure-resourcemanager-resources", - "source": "specification/resources/resource-manager/readme.md", - "package": "com.azure.resourcemanager.resources", - "args": "--tag=package-policy-2016-12 --stream-style-serialization=false --enable-sync-stack=false" - }, "privatedns": { "dir": "../privatedns/azure-resourcemanager-privatedns", "source": "specification/privatedns/resource-manager/readme.md", @@ -241,12 +156,6 @@ "package": "com.azure.resourcemanager.resources", "args": "--tag=package-2024-03 --metadata-suffix=deploymentstacks --enable-sync-stack=false" }, - "resources-hybrid": { - "dir": "../resourcemanagerhybrid/azure-resourcemanager-resources", - "source": "specification/resources/resource-manager/readme.md", - "package": "com.azure.resourcemanager.resources", - "args": "--tag=package-resources-2019-10 --add-inner=Deployment --stream-style-serialization=false --enable-sync-stack=false" - }, "search": { "dir": "../search/azure-resourcemanager-search", "source": "specification/search/resource-manager/readme.md", @@ -273,24 +182,12 @@ "package": "com.azure.resourcemanager.storage", "args": "--tag=package-2025-06 --modelerfour.lenient-model-deduplication --rename-model=AllowedMethods:CorsRuleAllowedMethodsItem,AccountType:ActiveDirectoryPropertiesAccountType --property-include-always=EncryptionIdentity.encryptionUserAssignedIdentity --enable-sync-stack=false" }, - "storage-hybrid": { - "dir": "../resourcemanagerhybrid/azure-resourcemanager-storage", - "source": "specification/storage/resource-manager/readme.md", - "package": "com.azure.resourcemanager.storage", - "args": "--tag=profile-hybrid-2020-09-01 --stream-style-serialization=false --enable-sync-stack=false" - }, "subscriptions": { "dir": "../resources/azure-resourcemanager-resources", "source": "specification/resources/resource-manager/readme.md", "package": "com.azure.resourcemanager.resources", "args": "--tag=package-subscriptions-2022-12 --metadata-suffix=subscription --modelerfour.lenient-model-deduplication --name-for-ungrouped-operations=ResourceName --remove-operation-group=Operations --enable-sync-stack=false" }, - "subscriptions-hybrid": { - "dir": "../resourcemanagerhybrid/azure-resourcemanager-resources", - "source": "specification/resources/resource-manager/readme.md", - "package": "com.azure.resourcemanager.resources", - "args": "--tag=package-subscriptions-2016-06 --name-for-ungrouped-operations=ResourceName --stream-style-serialization=false --enable-sync-stack=false" - }, "trafficmanager": { "dir": "../trafficmanager/azure-resourcemanager-trafficmanager", "source": "specification/trafficmanager/resource-manager/readme.md", diff --git a/sdk/resourcemanagerhybrid/README.md b/sdk/resourcemanagerhybrid/README.md deleted file mode 100644 index 6f807afbedac..000000000000 --- a/sdk/resourcemanagerhybrid/README.md +++ /dev/null @@ -1,343 +0,0 @@ -# Azure management client library for Java (Hybrid) - -The Azure Management Libraries for Java (Hybrid) is a higher-level, object-oriented API for *managing* Azure and Azure Stack Hub resources, -that is optimized for ease of use, succinctness and consistency. It uses [API Profiles][api_profile] to allow building hybrid cloud solutions -that target both Azure and Azure Stack Hub. - -## We'd love to hear your feedback - -We're always working on improving our products and the way we communicate with our users. So we'd love to learn what's working and how we can do better. - -If you haven't already, please take a few minutes to [complete this short survey](https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS) we have put together. - -Thank you in advance for your collaboration. We really appreciate your time! - -## Documentation - -Various documentation is available to help you get started - -- **[API reference documentation][docs]** -- **[Code snippets and samples][sample]** - -## Migration from older version of Azure management library - -If you are an existing user of the older version of Azure management library for Java (the namespace of old packages contains ``com.microsoft.azure.management.**``) and you are looking for a migration guide to the new version of the SDK, please refer to [this migration guide here](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/MIGRATION_GUIDE.md) - -## Getting started - -### Prerequisites - -- [Java Development Kit (JDK)][jdk] with version 8 or above -- [Azure Subscription][azure_subscription] - -### Include the package - -For you convenience, we have provided a multi-service package that includes services shared between Azure and Azure Stack Hub through a common API Profile. We recommend using this package when you are dealing with multiple services. - -```xml - - com.azure.resourcemanager - azure-resourcemanager - 1.0.0-hybrid - -``` - -The services available are listed as below: - -- App Services -- Authorization -- Compute -- Container Registry -- Container Services (AKS) -- DNS -- Event Hubs -- Insight (Monitor) -- Key Vault -- Network -- Resources -- Storage - -If you are only interested in using a subset of the services above, you can choose to use single-package services. These -packages follow the same naming patterns and design principals. For example, the Compute package can be used directly -with the following artifact information: - -```xml - - com.azure.resourcemanager - azure-resourcemanager-compute - 1.0.0-hybrid - -``` - -Note that some features included in service packages may not be available on Azure Stack Hub. For example, see -[Azure Stack Hub VM Considerations][vm_considerations] for a list of difference between Compute on Azure and Azure Stack Hub. - -### Include the recommended packages - -Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. - -`azure-identity` package and `azure-core-http-netty` package provide the default implementation. - -[Azure Identity][azure_identity] provides Azure Active Directory token authentication support across the Azure SDK. - -[//]: # ({x-version-update-start;com.azure:azure-identity;dependency}) -```xml - - com.azure - azure-identity - 1.18.1 - -``` -[//]: # ({x-version-update-end}) - -[Azure Core Netty HTTP client][azure_core_http_netty] is a plugin for [Azure Core][azure_core] HTTP client API. - -[//]: # ({x-version-update-start;com.azure:azure-core-http-netty;dependency}) -```xml - - com.azure - azure-core-http-netty - 1.15.10 - -``` -[//]: # ({x-version-update-end}) - -Alternatively, [Azure Core OkHttp HTTP client][azure_core_http_okhttp] is another plugin for HTTP client API. - -### Authentication - -By default, Azure Active Directory token authentication depends on configuration of the following environment variables. - -- `AZURE_CLIENT_ID` for Azure client ID. -- `AZURE_TENANT_ID` for Azure tenant ID. -- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. - -In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`. - -With above configuration, the manager class can be authenticated by following code: - -```java com.azure.resourcemanager.authenticate -String armEndpoint = "https://management.."; -AzureProfile profile = new AzureProfile(getAzureEnvironmentFromArmEndpoint(armEndpoint)); -TokenCredential credential = new DefaultAzureCredentialBuilder() - .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) - .build(); -AzureResourceManager azure = AzureResourceManager - .authenticate(credential, profile) - .withDefaultSubscription(); -``` - -Change `armEndpoint` to point to the Azure Resource Manager endpoint of your Azure Stack Hub. The azure environment's -properties above can be populated with the following example: - -```java com.azure.resourcemanager.getazureenvironment -private static AzureEnvironment getAzureEnvironmentFromArmEndpoint(String armEndpoint) { - // Create HTTP client and request - HttpClient httpClient = HttpClient.createDefault(); - - HttpRequest request = new HttpRequest(HttpMethod.GET, - String.format("%s/metadata/endpoints?api-version=2019-10-01", armEndpoint)) - .setHeader("accept", "application/json"); - - // Execute the request and read the response - HttpResponse response = httpClient.send(request).block(); - if (response.getStatusCode() != 200) { - throw new RuntimeException("Failed : HTTP error code : " + response.getStatusCode()); - } - String body = response.getBodyAsString().block(); - try { - ArrayNode metadataArray = JacksonAdapter.createDefaultSerializerAdapter() - .deserialize(body, ArrayNode.class, SerializerEncoding.JSON); - - if (metadataArray == null || metadataArray.isEmpty()) { - throw new RuntimeException("Failed to find metadata : " + body); - } - - JsonNode metadata = metadataArray.iterator().next(); - AzureEnvironment azureEnvironment = new AzureEnvironment(new HashMap() { - { - put("managementEndpointUrl", metadata.at("/authentication/audiences/0").asText()); - put("resourceManagerEndpointUrl", armEndpoint); - put("galleryEndpointUrl", metadata.at("/gallery").asText()); - put("activeDirectoryEndpointUrl", metadata.at("/authentication/loginEndpoint").asText()); - put("activeDirectoryResourceId", metadata.at("/authentication/audiences/0").asText()); - put("activeDirectoryGraphResourceId", metadata.at("/graph").asText()); - put("storageEndpointSuffix", "." + metadata.at("/suffixes/storage").asText()); - put("keyVaultDnsSuffix", "." + metadata.at("/suffixes/keyVaultDns").asText()); - } - }); - return azureEnvironment; - } catch (IOException ioe) { - ioe.printStackTrace(); - throw new RuntimeException(ioe); - } -} -``` - -When targeting a hybrid solution to global Azure instead of your Azure Stack Hub, `AzureEnvironment.AZURE` can be used instead. - -See [Authentication][authenticate] for more options. - -### Code snippets and samples - -See [Samples][sample] for code snippets and samples. - -## Key concepts - -The key concepts of Azure Management Libraries includes: - -- Fluent interface to manage Azure resources. -- Dependency across Azure resources. -- Batch Azure resource provisioning. -- Integration with [Azure role-based access control][rbac]. -- Asynchronous operations with [Reactor][reactor]. (Preview) -- Configurable client, e.g. configuring HTTP client, retries, logging, etc. -- [API design][design] -- [API design (Preview)][design_preview] - -## Examples - -See [Azure management client library for Java (Azure)][resourcemanager_azure] for examples on Azure. - -## Troubleshooting - -If you encounter any bugs, please file issues via [GitHub Issues](https://github.com/Azure/azure-sdk-for-java/issues/new/choose) -or checkout [StackOverflow for Azure Java SDK](https://stackoverflow.com/questions/tagged/azure-java-sdk). - -### HTTP client - -An `HttpClient` implementation must exist on the classpath. -See [Include optional packages](#include-optional-packages). - -Latest `azure-identity` package specifies dependency on `azure-core-http-netty` package for convenience. -If you would like to use a different `HttpClient`, please exclude `azure-core-http-netty` from `azure-identity`. - -### Enabling logging - -Azure SDKs for Java offer a consistent logging story to help aid in troubleshooting application errors and expedite -their resolution. The logs produced will capture the flow of an application before reaching the terminal state to help -locate the root issue. View the [logging][logging] wiki for guidance about enabling logging. - -Sample code to enable logging in Azure Management Libraries. - -```java com.azure.resourcemanager.logging -AzureResourceManager azure = AzureResourceManager - .configure() - .withLogLevel(HttpLogDetailLevel.BASIC) - .authenticate(credential, profile) - .withDefaultSubscription(); -``` - -### Dependency management - -[Azure Core][azure_core] (`azure-core`) is the shared library for all packages under `com.azure`. -It guarantees backward compatibility. - -However, if one accidentally uses an older version of it via transitive dependencies, it might cause problem in runtime. -This case could happen when one module depends on multiple Azure Java SDKs with different versions, which in turn depends on different versions of `azure-core`. - -Maven dependency plugin would help to diagnostic this problem. -Here is an artificial example. - -```shell -mvn dependency:tree -Dincludes=com.azure:azure-core - -[INFO] com.microsoft.azure:azure-sdk-test:jar:1.0-SNAPSHOT -[INFO] \- com.azure:azure-identity:jar:1.2.2:compile -[INFO] \- com.azure:azure-core:jar:1.12.0:compile -``` - -We can see the `azure-core` resolved as 1.12.0. - -```shell -mvn dependency:tree -Dverbose=true -Dincludes=com.azure:azure-core - -[INFO] com.microsoft.azure:azure-sdk-test:jar:1.0-SNAPSHOT -[INFO] +- com.azure:azure-identity:jar:1.2.2:compile -[INFO] | +- com.azure:azure-core:jar:1.12.0:compile -[INFO] | \- com.azure:azure-core-http-netty:jar:1.7.1:compile -[INFO] | \- (com.azure:azure-core:jar:1.12.0:compile - omitted for duplicate) -[INFO] +- com.azure.resourcemanager:azure-resourcemanager:jar:1.0.0:compile -[INFO] | +- com.azure.resourcemanager:azure-resourcemanager-resources:jar:1.0.0:compile -[INFO] | | +- (com.azure:azure-core:jar:1.13.0:compile - omitted for conflict with 1.12.0) -[INFO] | | \- com.azure:azure-core-management:jar:1.1.1:compile -[INFO] | | \- (com.azure:azure-core:jar:1.13.0:compile - omitted for conflict with 1.12.0) -[INFO] | \- com.azure.resourcemanager:azure-resourcemanager-keyvault:jar:1.0.0:compile -[INFO] | +- com.azure:azure-security-keyvault-keys:jar:4.2.5:compile -[INFO] | | \- (com.azure:azure-core:jar:1.13.0:compile - omitted for conflict with 1.12.0) -[INFO] | \- com.azure:azure-security-keyvault-secrets:jar:4.2.5:compile -[INFO] | \- (com.azure:azure-core:jar:1.13.0:compile - omitted for conflict with 1.12.0) -[INFO] \- com.azure:azure-storage-blob:jar:12.10.2:compile -[INFO] +- (com.azure:azure-core:jar:1.12.0:compile - omitted for duplicate) -[INFO] \- com.azure:azure-storage-common:jar:12.10.1:compile -[INFO] \- (com.azure:azure-core:jar:1.12.0:compile - omitted for duplicate) -``` - -From the module, we can see there is multiple SDKs depends on different versions of `azure-core`, and the latest would be 1.13.0. - -If we run the module, we will encounter this error in runtime. - -``` -java.lang.NoSuchMethodError: 'com.azure.core.http.HttpHeaders com.azure.core.http.HttpHeaders.set(java.lang.String, java.lang.String)' -``` - -The cause is that this method was not available in 1.12.0 `azure-core`, and now being used by some SDK that depends on 1.13.0 `azure-core`. - -In this example, apparently the problem is that we used an old version of `azure-identity`. After upgrade it to 1.2.3, problem solved. - -Better, one can explicitly put `azure-core` as the first dependency, and keep it up-to-date. - -Alternatively, maven dependency management will also help to control the version in transitive dependencies. -Here is a sample dependency management section in maven POM. - -```xml - - - - com.azure - azure-core - ${azure-core.version} - - - -``` - -To a lesser extent, similar problem could occur in runtime for `azure-core-management` library, when one module depends on multiple Azure Java management SDKs with different versions. -For example, `azure-resourcemanager` 1.0.0 would require `azure-core-management` 1.3.0 or above, relying on `ArmChallengeAuthenticationPolicy` class for continuous access evaluation support. - -### ARM throttling - -Azure Resource Manager applies throttling on the number of requests sent from client within certain span of time. -For details, please refer to [Guidance on ARM throttling][throttling]. - -## Next steps - -## Contributing - -For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). - -1. Fork it -2. Create your feature branch (`git checkout -b my-new-feature`) -3. Commit your changes (`git commit -am 'Add some feature'`) -4. Push to the branch (`git push origin my-new-feature`) -5. Create new Pull Request - - -[docs]: https://azure.github.io/azure-sdk-for-java/ -[jdk]: https://learn.microsoft.com/java/azure/jdk/ -[azure_subscription]: https://azure.microsoft.com/free/ -[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity -[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty -[azure_core_http_okhttp]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-okhttp -[azure_core]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core -[logging]: https://github.com/Azure/azure-sdk-for-java/wiki/Logging-in-Azure-SDK -[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md -[sample]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/SAMPLE.md -[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md -[design_preview]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN_PREVIEW.md -[throttling]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/THROTTLING.md -[reactor]: https://projectreactor.io/ -[rbac]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/RBAC.md -[api_profile]: https://learn.microsoft.com/azure-stack/user/azure-stack-version-profiles -[vm_considerations]: https://learn.microsoft.com/azure-stack/user/azure-stack-vm-considerations -[resourcemanager_azure]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/README.md diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/CHANGELOG.md b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/CHANGELOG.md deleted file mode 100644 index b537cc0c77f6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/CHANGELOG.md +++ /dev/null @@ -1,8 +0,0 @@ -# Release History - -## 1.0.0-hybrid (2022-01-12) - -- Azure Resource Manager App Service client library for Java (Hybrid) using API Profiles to allow building hybrid cloud solutions -that target both Azure and Azure Stack Hub. -- Supports api versions in the 2020-09-01-hybrid api profile -- Requires Azure Stack Update 2102+ diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/README.md b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/README.md deleted file mode 100644 index a7e7fa4861e0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/README.md +++ /dev/null @@ -1,135 +0,0 @@ -# Azure Resource Manager App Service client library for Java (Hybrid) - -Azure Resource Manager App Service client library for Java (Hybrid) using [API Profiles][api_profile] to allow building hybrid cloud solutions -that target both Azure and Azure Stack Hub. - -For documentation on how to use this package, please see [Azure Management Libraries for Java (Hybrid)][resourcemanagerhybrid_lib]. - -## Getting started - -### Prerequisites - -- [Java Development Kit (JDK)][jdk] with version 8 or above -- [Azure Subscription][azure_subscription] - -### Adding the package to your product - -```xml - - com.azure.resourcemanager - azure-resourcemanager-appservice - 1.0.0-hybrid - -``` - -### Include the recommended packages - -Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. - -[Azure Identity][azure_identity] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation. - -### Authentication - -By default, Azure Active Directory token authentication depends on correct configure of following environment variables. - -- `AZURE_CLIENT_ID` for Azure client ID. -- `AZURE_TENANT_ID` for Azure tenant ID. -- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. - -In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`. - -With above configuration, `azure` client can be authenticated by following code: - -```java com.azure.resourcemanager.appservice.authenticate -String armEndpoint = "https://management.."; -AzureProfile profile = new AzureProfile(getAzureEnvironmentFromArmEndpoint(armEndpoint)); -TokenCredential credential = new DefaultAzureCredentialBuilder() - .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) - .build(); -AppServiceManager manager = AppServiceManager - .authenticate(credential, profile); -``` - -Change `armEndpoint` to point to the Azure Resource Manager endpoint of your Azure Stack Hub. The azure environment's -properties above can be populated with the following example: - -```java com.azure.resourcemanager.appservice.getazureenvironment -private static AzureEnvironment getAzureEnvironmentFromArmEndpoint(String armEndpoint) { - // Create HTTP client and request - HttpClient httpClient = HttpClient.createDefault(); - - HttpRequest request = new HttpRequest(HttpMethod.GET, - String.format("%s/metadata/endpoints?api-version=2019-10-01", armEndpoint)) - .setHeader("accept", "application/json"); - - // Execute the request and read the response - HttpResponse response = httpClient.send(request).block(); - if (response.getStatusCode() != 200) { - throw new RuntimeException("Failed : HTTP error code : " + response.getStatusCode()); - } - String body = response.getBodyAsString().block(); - try { - ArrayNode metadataArray = JacksonAdapter.createDefaultSerializerAdapter() - .deserialize(body, ArrayNode.class, SerializerEncoding.JSON); - - if (metadataArray == null || metadataArray.isEmpty()) { - throw new RuntimeException("Failed to find metadata : " + body); - } - - JsonNode metadata = metadataArray.iterator().next(); - AzureEnvironment azureEnvironment = new AzureEnvironment(new HashMap() { - { - put("managementEndpointUrl", metadata.at("/authentication/audiences/0").asText()); - put("resourceManagerEndpointUrl", armEndpoint); - put("galleryEndpointUrl", metadata.at("/gallery").asText()); - put("activeDirectoryEndpointUrl", metadata.at("/authentication/loginEndpoint").asText()); - put("activeDirectoryResourceId", metadata.at("/authentication/audiences/0").asText()); - put("activeDirectoryGraphResourceId", metadata.at("/graph").asText()); - put("storageEndpointSuffix", "." + metadata.at("/suffixes/storage").asText()); - put("keyVaultDnsSuffix", "." + metadata.at("/suffixes/keyVaultDns").asText()); - } - }); - return azureEnvironment; - } catch (IOException ioe) { - ioe.printStackTrace(); - throw new RuntimeException(ioe); - } -} -``` - -When targeting a hybrid solution to global Azure instead of your Azure Stack Hub, `AzureEnvironment.AZURE` can be used instead. - -See [Authentication][authenticate] for more options. - -## Key concepts - -See [API design][design] for general introduction on design and key concepts on Azure Management Libraries. - -## Examples - -See [Samples][sample] for code snippets and samples. - -## Troubleshooting - -## Next steps - -## Contributing - -For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). - -1. Fork it -1. Create your feature branch (`git checkout -b my-new-feature`) -1. Commit your changes (`git commit -am 'Add some feature'`) -1. Push to the branch (`git push origin my-new-feature`) -1. Create new Pull Request - - -[jdk]: https://learn.microsoft.com/java/azure/jdk/ -[azure_subscription]: https://azure.microsoft.com/free/ -[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity -[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty -[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md -[sample]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/SAMPLE.md -[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md -[api_profile]: https://learn.microsoft.com/azure-stack/user/azure-stack-version-profiles -[resourcemanagerhybrid_lib]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanagerhybrid diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/pom.xml b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/pom.xml deleted file mode 100644 index 948326ee2279..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/pom.xml +++ /dev/null @@ -1,169 +0,0 @@ - - - 4.0.0 - - com.azure - azure-client-sdk-parent - 1.7.0 - ../../parents/azure-client-sdk-parent - - - com.azure.resourcemanager - azure-resourcemanager-appservice - 1.0.0-hybrid - jar - - Microsoft Azure SDK for App Service Management (Hybrid) - This package contains Microsoft Azure App Service Management Hybrid SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt - https://github.com/Azure/azure-sdk-for-java - - - - The MIT License (MIT) - http://opensource.org/licenses/MIT - repo - - - - - https://github.com/Azure/azure-sdk-for-java - scm:git:git@github.com:Azure/azure-sdk-for-java.git - HEAD - - - - - 0.10 - 0.10 - - - --add-opens com.azure.resourcemanager.appservice/com.azure.resourcemanager.appservice=ALL-UNNAMED - --add-opens com.azure.resourcemanager.authorization/com.azure.resourcemanager.authorization=ALL-UNNAMED - --add-opens com.azure.resourcemanager.keyvault/com.azure.resourcemanager.keyvault=ALL-UNNAMED - --add-opens com.azure.resourcemanager.msi/com.azure.resourcemanager.msi=ALL-UNNAMED - --add-opens com.azure.resourcemanager.resources/com.azure.resourcemanager.resources=ALL-UNNAMED - --add-opens com.azure.resourcemanager.resources/com.azure.resourcemanager.resources.fluentcore.arm=ALL-UNNAMED - --add-opens com.azure.resourcemanager.storage/com.azure.resourcemanager.storage=ALL-UNNAMED - --add-opens com.azure.core/com.azure.core.implementation.jackson=ALL-UNNAMED - - - - - - microsoft - Microsoft - - - - - - com.azure.resourcemanager - azure-resourcemanager-resources - 1.0.0-hybrid - - - com.azure.resourcemanager - azure-resourcemanager-storage - 1.0.0-hybrid - - - com.azure.resourcemanager - azure-resourcemanager-keyvault - 1.0.0-hybrid - - - com.azure.resourcemanager - azure-resourcemanager-dns - 1.0.0-hybrid - - - org.junit.jupiter - junit-jupiter-engine - 5.13.4 - test - - - org.junit.jupiter - junit-jupiter-api - 5.13.4 - test - - - commons-net - commons-net - 3.9.0 - test - - - com.azure - azure-core-http-netty - 1.16.2 - test - - - commons-io - commons-io - 2.17.0 - test - - - org.slf4j - slf4j-simple - 1.7.36 - test - - - - - azure-mgmt-sdk-test-jar - - - !maven.test.skip - - - - - com.azure.resourcemanager - azure-resourcemanager-test - 1.0.0-hybrid - test - - - - - - - - org.apache.maven.plugins - maven-jar-plugin - 3.4.2 - - - - true - true - - - - - - - org.jacoco - jacoco-maven-plugin - 0.8.13 - - - com/azure/resourcemanager/**/fluent/**/* - com/azure/resourcemanager/**/models/**/* - com/azure/resourcemanager/**/implementation/*ClientImpl* - com/azure/resourcemanager/**/implementation/*ClientBuilder* - - - - - - diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/AppServiceManager.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/AppServiceManager.java deleted file mode 100644 index 6f07efd43ad2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/AppServiceManager.java +++ /dev/null @@ -1,184 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice; - -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpPipeline; -import com.azure.resourcemanager.appservice.fluent.WebSiteManagementClient; -import com.azure.resourcemanager.appservice.implementation.WebSiteManagementClientBuilder; -import com.azure.resourcemanager.appservice.implementation.AppServiceCertificateOrdersImpl; -import com.azure.resourcemanager.appservice.implementation.AppServiceCertificatesImpl; -import com.azure.resourcemanager.appservice.implementation.AppServiceDomainsImpl; -import com.azure.resourcemanager.appservice.implementation.AppServicePlansImpl; -import com.azure.resourcemanager.appservice.implementation.FunctionAppsImpl; -import com.azure.resourcemanager.appservice.implementation.WebAppsImpl; -import com.azure.resourcemanager.appservice.models.AppServiceCertificateOrders; -import com.azure.resourcemanager.appservice.models.AppServiceCertificates; -import com.azure.resourcemanager.appservice.models.AppServiceDomains; -import com.azure.resourcemanager.appservice.models.AppServicePlans; -import com.azure.resourcemanager.appservice.models.FunctionApps; -import com.azure.resourcemanager.appservice.models.WebApps; -import com.azure.resourcemanager.authorization.AuthorizationManager; -import com.azure.resourcemanager.dns.DnsZoneManager; -import com.azure.resourcemanager.keyvault.KeyVaultManager; -import com.azure.resourcemanager.resources.fluentcore.arm.AzureConfigurable; -import com.azure.resourcemanager.resources.fluentcore.arm.implementation.AzureConfigurableImpl; -import com.azure.resourcemanager.resources.fluentcore.arm.Manager; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.resources.fluentcore.utils.HttpPipelineProvider; -import com.azure.resourcemanager.storage.StorageManager; - -import java.util.Objects; - -/** Entry point to Azure storage resource management. */ -public final class AppServiceManager extends Manager { - // Managers - private final AuthorizationManager authorizationManager; - private final KeyVaultManager keyVaultManager; - private final StorageManager storageManager; - private final DnsZoneManager dnsZoneManager; - // Collections - private WebApps webApps; - private AppServicePlans appServicePlans; - private AppServiceCertificateOrders appServiceCertificateOrders; - private AppServiceCertificates appServiceCertificates; - private AppServiceDomains appServiceDomains; - private FunctionApps functionApps; - - /** - * Get a Configurable instance that can be used to create StorageManager with optional configuration. - * - * @return the instance allowing configurations - */ - public static Configurable configure() { - return new AppServiceManager.ConfigurableImpl(); - } - - /** - * Creates an instance of StorageManager that exposes storage resource management API entry points. - * - * @param credential the credential to use - * @param profile the profile to use - * @return the StorageManager - */ - public static AppServiceManager authenticate(TokenCredential credential, AzureProfile profile) { - Objects.requireNonNull(credential, "'credential' cannot be null."); - Objects.requireNonNull(profile, "'profile' cannot be null."); - return authenticate(HttpPipelineProvider.buildHttpPipeline(credential, profile), profile); - } - - /** - * Creates an instance of StorageManager that exposes storage resource management API entry points. - * - * @param httpPipeline the HttpPipeline to be used for API calls. - * @param profile the profile to use - * @return the StorageManager - */ - public static AppServiceManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { - Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); - Objects.requireNonNull(profile, "'profile' cannot be null."); - return new AppServiceManager(httpPipeline, profile); - } - - /** The interface allowing configurations to be set. */ - public interface Configurable extends AzureConfigurable { - /** - * Creates an instance of StorageManager that exposes storage management API entry points. - * - * @param credential the credential to use - * @param profile the profile to use - * @return the interface exposing AppService management API entry points that work across subscriptions - */ - AppServiceManager authenticate(TokenCredential credential, AzureProfile profile); - } - - /** The implementation for Configurable interface. */ - private static final class ConfigurableImpl extends AzureConfigurableImpl implements Configurable { - public AppServiceManager authenticate(TokenCredential credential, AzureProfile profile) { - return AppServiceManager.authenticate(buildHttpPipeline(credential, profile), profile); - } - } - - private AppServiceManager(HttpPipeline httpPipeline, AzureProfile profile) { - super( - httpPipeline, - profile, - new WebSiteManagementClientBuilder() - .pipeline(httpPipeline) - .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) - .subscriptionId(profile.getSubscriptionId()) - .buildClient()); - keyVaultManager = KeyVaultManager.authenticate(httpPipeline, profile); - storageManager = StorageManager.authenticate(httpPipeline, profile); - authorizationManager = AuthorizationManager.authenticate(httpPipeline, profile); - dnsZoneManager = DnsZoneManager.authenticate(httpPipeline, profile); - } - - /** @return the authorization manager instance. */ - public AuthorizationManager authorizationManager() { - return authorizationManager; - } - - /** @return the key vault manager instance. */ - public KeyVaultManager keyVaultManager() { - return keyVaultManager; - } - - /** @return the storage manager instance. */ - public StorageManager storageManager() { - return storageManager; - } - - /** @return the DNS zone manager instance. */ - public DnsZoneManager dnsZoneManager() { - return dnsZoneManager; - } - - /** @return the web app management API entry point */ - public WebApps webApps() { - if (webApps == null) { - webApps = new WebAppsImpl(this); - } - return webApps; - } - - /** @return the app service plan management API entry point */ - public AppServicePlans appServicePlans() { - if (appServicePlans == null) { - appServicePlans = new AppServicePlansImpl(this); - } - return appServicePlans; - } - - /** @return the certificate order management API entry point */ - public AppServiceCertificateOrders certificateOrders() { - if (appServiceCertificateOrders == null) { - appServiceCertificateOrders = new AppServiceCertificateOrdersImpl(this); - } - return appServiceCertificateOrders; - } - - /** @return the certificate management API entry point */ - public AppServiceCertificates certificates() { - if (appServiceCertificates == null) { - appServiceCertificates = new AppServiceCertificatesImpl(this); - } - return appServiceCertificates; - } - - /** @return the app service plan management API entry point */ - public AppServiceDomains domains() { - if (appServiceDomains == null) { - appServiceDomains = new AppServiceDomainsImpl(this); - } - return appServiceDomains; - } - /** @return the web app management API entry point */ - public FunctionApps functionApps() { - if (functionApps == null) { - functionApps = new FunctionAppsImpl(this); - } - return functionApps; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/AppServiceCertificateOrdersClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/AppServiceCertificateOrdersClient.java deleted file mode 100644 index d7b122f1196f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/AppServiceCertificateOrdersClient.java +++ /dev/null @@ -1,1363 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.appservice.fluent.models.AppServiceCertificateOrderInner; -import com.azure.resourcemanager.appservice.fluent.models.AppServiceCertificatePatchResourceInner; -import com.azure.resourcemanager.appservice.fluent.models.AppServiceCertificateResourceInner; -import com.azure.resourcemanager.appservice.fluent.models.CertificateEmailInner; -import com.azure.resourcemanager.appservice.fluent.models.CertificateOrderActionInner; -import com.azure.resourcemanager.appservice.fluent.models.NameIdentifierInner; -import com.azure.resourcemanager.appservice.fluent.models.SiteSealInner; -import com.azure.resourcemanager.appservice.models.AppServiceCertificateOrderPatchResource; -import com.azure.resourcemanager.appservice.models.ReissueCertificateOrderRequest; -import com.azure.resourcemanager.appservice.models.RenewCertificateOrderRequest; -import com.azure.resourcemanager.appservice.models.SiteSealRequest; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import java.util.List; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in AppServiceCertificateOrdersClient. */ -public interface AppServiceCertificateOrdersClient - extends InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete { - /** - * List all certificate orders in a subscription. - * - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of certificate orders. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * List all certificate orders in a subscription. - * - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of certificate orders. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * List all certificate orders in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of certificate orders. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Validate information for a certificate order. - * - * @param appServiceCertificateOrder Information for a certificate order. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> validatePurchaseInformationWithResponseAsync( - AppServiceCertificateOrderInner appServiceCertificateOrder); - - /** - * Validate information for a certificate order. - * - * @param appServiceCertificateOrder Information for a certificate order. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono validatePurchaseInformationAsync(AppServiceCertificateOrderInner appServiceCertificateOrder); - - /** - * Validate information for a certificate order. - * - * @param appServiceCertificateOrder Information for a certificate order. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void validatePurchaseInformation(AppServiceCertificateOrderInner appServiceCertificateOrder); - - /** - * Validate information for a certificate order. - * - * @param appServiceCertificateOrder Information for a certificate order. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response validatePurchaseInformationWithResponse( - AppServiceCertificateOrderInner appServiceCertificateOrder, Context context); - - /** - * Get certificate orders in a resource group. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return certificate orders in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName); - - /** - * Get certificate orders in a resource group. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return certificate orders in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Get certificate orders in a resource group. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return certificate orders in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * Get a certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order.. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a certificate order. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String certificateOrderName); - - /** - * Get a certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order.. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a certificate order. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync( - String resourceGroupName, String certificateOrderName); - - /** - * Get a certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order.. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a certificate order. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AppServiceCertificateOrderInner getByResourceGroup(String resourceGroupName, String certificateOrderName); - - /** - * Get a certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order.. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a certificate order. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String certificateOrderName, Context context); - - /** - * Create or update a certificate purchase order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param certificateDistinguishedName Distinguished name to use for the certificate order. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sSL certificate purchase order. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String certificateOrderName, - AppServiceCertificateOrderInner certificateDistinguishedName); - - /** - * Create or update a certificate purchase order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param certificateDistinguishedName Distinguished name to use for the certificate order. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sSL certificate purchase order. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, AppServiceCertificateOrderInner> beginCreateOrUpdateAsync( - String resourceGroupName, - String certificateOrderName, - AppServiceCertificateOrderInner certificateDistinguishedName); - - /** - * Create or update a certificate purchase order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param certificateDistinguishedName Distinguished name to use for the certificate order. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sSL certificate purchase order. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, AppServiceCertificateOrderInner> beginCreateOrUpdate( - String resourceGroupName, - String certificateOrderName, - AppServiceCertificateOrderInner certificateDistinguishedName); - - /** - * Create or update a certificate purchase order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param certificateDistinguishedName Distinguished name to use for the certificate order. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sSL certificate purchase order. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, AppServiceCertificateOrderInner> beginCreateOrUpdate( - String resourceGroupName, - String certificateOrderName, - AppServiceCertificateOrderInner certificateDistinguishedName, - Context context); - - /** - * Create or update a certificate purchase order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param certificateDistinguishedName Distinguished name to use for the certificate order. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sSL certificate purchase order. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, - String certificateOrderName, - AppServiceCertificateOrderInner certificateDistinguishedName); - - /** - * Create or update a certificate purchase order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param certificateDistinguishedName Distinguished name to use for the certificate order. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sSL certificate purchase order. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AppServiceCertificateOrderInner createOrUpdate( - String resourceGroupName, - String certificateOrderName, - AppServiceCertificateOrderInner certificateDistinguishedName); - - /** - * Create or update a certificate purchase order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param certificateDistinguishedName Distinguished name to use for the certificate order. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sSL certificate purchase order. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AppServiceCertificateOrderInner createOrUpdate( - String resourceGroupName, - String certificateOrderName, - AppServiceCertificateOrderInner certificateDistinguishedName, - Context context); - - /** - * Delete an existing certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteWithResponseAsync(String resourceGroupName, String certificateOrderName); - - /** - * Delete an existing certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String certificateOrderName); - - /** - * Delete an existing certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String certificateOrderName); - - /** - * Delete an existing certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String certificateOrderName, Context context); - - /** - * Create or update a certificate purchase order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param certificateDistinguishedName Distinguished name to use for the certificate order. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sSL certificate purchase order. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateWithResponseAsync( - String resourceGroupName, - String certificateOrderName, - AppServiceCertificateOrderPatchResource certificateDistinguishedName); - - /** - * Create or update a certificate purchase order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param certificateDistinguishedName Distinguished name to use for the certificate order. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sSL certificate purchase order. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAsync( - String resourceGroupName, - String certificateOrderName, - AppServiceCertificateOrderPatchResource certificateDistinguishedName); - - /** - * Create or update a certificate purchase order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param certificateDistinguishedName Distinguished name to use for the certificate order. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sSL certificate purchase order. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AppServiceCertificateOrderInner update( - String resourceGroupName, - String certificateOrderName, - AppServiceCertificateOrderPatchResource certificateDistinguishedName); - - /** - * Create or update a certificate purchase order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param certificateDistinguishedName Distinguished name to use for the certificate order. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sSL certificate purchase order. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String resourceGroupName, - String certificateOrderName, - AppServiceCertificateOrderPatchResource certificateDistinguishedName, - Context context); - - /** - * List all certificates associated with a certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of certificate order certificates. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listCertificatesAsync( - String resourceGroupName, String certificateOrderName); - - /** - * List all certificates associated with a certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of certificate order certificates. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listCertificates( - String resourceGroupName, String certificateOrderName); - - /** - * List all certificates associated with a certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of certificate order certificates. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listCertificates( - String resourceGroupName, String certificateOrderName, Context context); - - /** - * Get the certificate associated with a certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param name Name of the certificate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the certificate associated with a certificate order. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getCertificateWithResponseAsync( - String resourceGroupName, String certificateOrderName, String name); - - /** - * Get the certificate associated with a certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param name Name of the certificate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the certificate associated with a certificate order. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getCertificateAsync( - String resourceGroupName, String certificateOrderName, String name); - - /** - * Get the certificate associated with a certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param name Name of the certificate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the certificate associated with a certificate order. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AppServiceCertificateResourceInner getCertificate( - String resourceGroupName, String certificateOrderName, String name); - - /** - * Get the certificate associated with a certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param name Name of the certificate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the certificate associated with a certificate order. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getCertificateWithResponse( - String resourceGroupName, String certificateOrderName, String name, Context context); - - /** - * Creates or updates a certificate and associates with key vault secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param name Name of the certificate. - * @param keyVaultCertificate Key vault certificate resource Id. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return key Vault container ARM resource for a certificate that is purchased through Azure. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateCertificateWithResponseAsync( - String resourceGroupName, - String certificateOrderName, - String name, - AppServiceCertificateResourceInner keyVaultCertificate); - - /** - * Creates or updates a certificate and associates with key vault secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param name Name of the certificate. - * @param keyVaultCertificate Key vault certificate resource Id. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return key Vault container ARM resource for a certificate that is purchased through Azure. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, AppServiceCertificateResourceInner> - beginCreateOrUpdateCertificateAsync( - String resourceGroupName, - String certificateOrderName, - String name, - AppServiceCertificateResourceInner keyVaultCertificate); - - /** - * Creates or updates a certificate and associates with key vault secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param name Name of the certificate. - * @param keyVaultCertificate Key vault certificate resource Id. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return key Vault container ARM resource for a certificate that is purchased through Azure. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, AppServiceCertificateResourceInner> - beginCreateOrUpdateCertificate( - String resourceGroupName, - String certificateOrderName, - String name, - AppServiceCertificateResourceInner keyVaultCertificate); - - /** - * Creates or updates a certificate and associates with key vault secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param name Name of the certificate. - * @param keyVaultCertificate Key vault certificate resource Id. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return key Vault container ARM resource for a certificate that is purchased through Azure. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, AppServiceCertificateResourceInner> - beginCreateOrUpdateCertificate( - String resourceGroupName, - String certificateOrderName, - String name, - AppServiceCertificateResourceInner keyVaultCertificate, - Context context); - - /** - * Creates or updates a certificate and associates with key vault secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param name Name of the certificate. - * @param keyVaultCertificate Key vault certificate resource Id. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return key Vault container ARM resource for a certificate that is purchased through Azure. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateCertificateAsync( - String resourceGroupName, - String certificateOrderName, - String name, - AppServiceCertificateResourceInner keyVaultCertificate); - - /** - * Creates or updates a certificate and associates with key vault secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param name Name of the certificate. - * @param keyVaultCertificate Key vault certificate resource Id. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return key Vault container ARM resource for a certificate that is purchased through Azure. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AppServiceCertificateResourceInner createOrUpdateCertificate( - String resourceGroupName, - String certificateOrderName, - String name, - AppServiceCertificateResourceInner keyVaultCertificate); - - /** - * Creates or updates a certificate and associates with key vault secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param name Name of the certificate. - * @param keyVaultCertificate Key vault certificate resource Id. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return key Vault container ARM resource for a certificate that is purchased through Azure. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AppServiceCertificateResourceInner createOrUpdateCertificate( - String resourceGroupName, - String certificateOrderName, - String name, - AppServiceCertificateResourceInner keyVaultCertificate, - Context context); - - /** - * Delete the certificate associated with a certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param name Name of the certificate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteCertificateWithResponseAsync( - String resourceGroupName, String certificateOrderName, String name); - - /** - * Delete the certificate associated with a certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param name Name of the certificate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteCertificateAsync(String resourceGroupName, String certificateOrderName, String name); - - /** - * Delete the certificate associated with a certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param name Name of the certificate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deleteCertificate(String resourceGroupName, String certificateOrderName, String name); - - /** - * Delete the certificate associated with a certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param name Name of the certificate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteCertificateWithResponse( - String resourceGroupName, String certificateOrderName, String name, Context context); - - /** - * Creates or updates a certificate and associates with key vault secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param name Name of the certificate. - * @param keyVaultCertificate Key vault certificate resource Id. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return key Vault container ARM resource for a certificate that is purchased through Azure. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateCertificateWithResponseAsync( - String resourceGroupName, - String certificateOrderName, - String name, - AppServiceCertificatePatchResourceInner keyVaultCertificate); - - /** - * Creates or updates a certificate and associates with key vault secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param name Name of the certificate. - * @param keyVaultCertificate Key vault certificate resource Id. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return key Vault container ARM resource for a certificate that is purchased through Azure. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateCertificateAsync( - String resourceGroupName, - String certificateOrderName, - String name, - AppServiceCertificatePatchResourceInner keyVaultCertificate); - - /** - * Creates or updates a certificate and associates with key vault secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param name Name of the certificate. - * @param keyVaultCertificate Key vault certificate resource Id. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return key Vault container ARM resource for a certificate that is purchased through Azure. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AppServiceCertificateResourceInner updateCertificate( - String resourceGroupName, - String certificateOrderName, - String name, - AppServiceCertificatePatchResourceInner keyVaultCertificate); - - /** - * Creates or updates a certificate and associates with key vault secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param name Name of the certificate. - * @param keyVaultCertificate Key vault certificate resource Id. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return key Vault container ARM resource for a certificate that is purchased through Azure. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateCertificateWithResponse( - String resourceGroupName, - String certificateOrderName, - String name, - AppServiceCertificatePatchResourceInner keyVaultCertificate, - Context context); - - /** - * Reissue an existing certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param reissueCertificateOrderRequest Parameters for the reissue. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> reissueWithResponseAsync( - String resourceGroupName, - String certificateOrderName, - ReissueCertificateOrderRequest reissueCertificateOrderRequest); - - /** - * Reissue an existing certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param reissueCertificateOrderRequest Parameters for the reissue. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono reissueAsync( - String resourceGroupName, - String certificateOrderName, - ReissueCertificateOrderRequest reissueCertificateOrderRequest); - - /** - * Reissue an existing certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param reissueCertificateOrderRequest Parameters for the reissue. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void reissue( - String resourceGroupName, - String certificateOrderName, - ReissueCertificateOrderRequest reissueCertificateOrderRequest); - - /** - * Reissue an existing certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param reissueCertificateOrderRequest Parameters for the reissue. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response reissueWithResponse( - String resourceGroupName, - String certificateOrderName, - ReissueCertificateOrderRequest reissueCertificateOrderRequest, - Context context); - - /** - * Renew an existing certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param renewCertificateOrderRequest Renew parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> renewWithResponseAsync( - String resourceGroupName, - String certificateOrderName, - RenewCertificateOrderRequest renewCertificateOrderRequest); - - /** - * Renew an existing certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param renewCertificateOrderRequest Renew parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono renewAsync( - String resourceGroupName, - String certificateOrderName, - RenewCertificateOrderRequest renewCertificateOrderRequest); - - /** - * Renew an existing certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param renewCertificateOrderRequest Renew parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void renew( - String resourceGroupName, - String certificateOrderName, - RenewCertificateOrderRequest renewCertificateOrderRequest); - - /** - * Renew an existing certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param renewCertificateOrderRequest Renew parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response renewWithResponse( - String resourceGroupName, - String certificateOrderName, - RenewCertificateOrderRequest renewCertificateOrderRequest, - Context context); - - /** - * Resend certificate email. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> resendEmailWithResponseAsync(String resourceGroupName, String certificateOrderName); - - /** - * Resend certificate email. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono resendEmailAsync(String resourceGroupName, String certificateOrderName); - - /** - * Resend certificate email. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void resendEmail(String resourceGroupName, String certificateOrderName); - - /** - * Resend certificate email. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response resendEmailWithResponse(String resourceGroupName, String certificateOrderName, Context context); - - /** - * Verify domain ownership for this certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param nameIdentifier Email address. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> resendRequestEmailsWithResponseAsync( - String resourceGroupName, String certificateOrderName, NameIdentifierInner nameIdentifier); - - /** - * Verify domain ownership for this certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param nameIdentifier Email address. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono resendRequestEmailsAsync( - String resourceGroupName, String certificateOrderName, NameIdentifierInner nameIdentifier); - - /** - * Verify domain ownership for this certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param nameIdentifier Email address. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void resendRequestEmails(String resourceGroupName, String certificateOrderName, NameIdentifierInner nameIdentifier); - - /** - * Verify domain ownership for this certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param nameIdentifier Email address. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response resendRequestEmailsWithResponse( - String resourceGroupName, String certificateOrderName, NameIdentifierInner nameIdentifier, Context context); - - /** - * Verify domain ownership for this certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param siteSealRequest Site seal request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site seal. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> retrieveSiteSealWithResponseAsync( - String resourceGroupName, String certificateOrderName, SiteSealRequest siteSealRequest); - - /** - * Verify domain ownership for this certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param siteSealRequest Site seal request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site seal. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono retrieveSiteSealAsync( - String resourceGroupName, String certificateOrderName, SiteSealRequest siteSealRequest); - - /** - * Verify domain ownership for this certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param siteSealRequest Site seal request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site seal. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SiteSealInner retrieveSiteSeal( - String resourceGroupName, String certificateOrderName, SiteSealRequest siteSealRequest); - - /** - * Verify domain ownership for this certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param siteSealRequest Site seal request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site seal. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response retrieveSiteSealWithResponse( - String resourceGroupName, String certificateOrderName, SiteSealRequest siteSealRequest, Context context); - - /** - * Verify domain ownership for this certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> verifyDomainOwnershipWithResponseAsync(String resourceGroupName, String certificateOrderName); - - /** - * Verify domain ownership for this certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono verifyDomainOwnershipAsync(String resourceGroupName, String certificateOrderName); - - /** - * Verify domain ownership for this certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void verifyDomainOwnership(String resourceGroupName, String certificateOrderName); - - /** - * Verify domain ownership for this certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response verifyDomainOwnershipWithResponse( - String resourceGroupName, String certificateOrderName, Context context); - - /** - * Retrieve the list of certificate actions. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the certificate order. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of CertificateOrderAction. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> retrieveCertificateActionsWithResponseAsync( - String resourceGroupName, String name); - - /** - * Retrieve the list of certificate actions. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the certificate order. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of CertificateOrderAction. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> retrieveCertificateActionsAsync(String resourceGroupName, String name); - - /** - * Retrieve the list of certificate actions. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the certificate order. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of CertificateOrderAction. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - List retrieveCertificateActions(String resourceGroupName, String name); - - /** - * Retrieve the list of certificate actions. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the certificate order. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of CertificateOrderAction. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response> retrieveCertificateActionsWithResponse( - String resourceGroupName, String name, Context context); - - /** - * Retrieve email history. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the certificate order. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of CertificateEmail. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> retrieveCertificateEmailHistoryWithResponseAsync( - String resourceGroupName, String name); - - /** - * Retrieve email history. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the certificate order. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of CertificateEmail. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> retrieveCertificateEmailHistoryAsync(String resourceGroupName, String name); - - /** - * Retrieve email history. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the certificate order. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of CertificateEmail. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - List retrieveCertificateEmailHistory(String resourceGroupName, String name); - - /** - * Retrieve email history. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the certificate order. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of CertificateEmail. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response> retrieveCertificateEmailHistoryWithResponse( - String resourceGroupName, String name, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/AppServiceEnvironmentsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/AppServiceEnvironmentsClient.java deleted file mode 100644 index f5b89c5fcdfc..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/AppServiceEnvironmentsClient.java +++ /dev/null @@ -1,2598 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.appservice.fluent.models.AddressResponseInner; -import com.azure.resourcemanager.appservice.fluent.models.AppServiceEnvironmentResourceInner; -import com.azure.resourcemanager.appservice.fluent.models.AppServicePlanInner; -import com.azure.resourcemanager.appservice.fluent.models.CsmUsageQuotaInner; -import com.azure.resourcemanager.appservice.fluent.models.HostingEnvironmentDiagnosticsInner; -import com.azure.resourcemanager.appservice.fluent.models.InboundEnvironmentEndpointInner; -import com.azure.resourcemanager.appservice.fluent.models.MetricDefinitionInner; -import com.azure.resourcemanager.appservice.fluent.models.OperationInner; -import com.azure.resourcemanager.appservice.fluent.models.OutboundEnvironmentEndpointInner; -import com.azure.resourcemanager.appservice.fluent.models.ResourceMetricDefinitionInner; -import com.azure.resourcemanager.appservice.fluent.models.ResourceMetricInner; -import com.azure.resourcemanager.appservice.fluent.models.SiteInner; -import com.azure.resourcemanager.appservice.fluent.models.SkuInfoInner; -import com.azure.resourcemanager.appservice.fluent.models.StampCapacityInner; -import com.azure.resourcemanager.appservice.fluent.models.UsageInner; -import com.azure.resourcemanager.appservice.fluent.models.WorkerPoolResourceInner; -import com.azure.resourcemanager.appservice.models.AppServiceEnvironmentPatchResource; -import com.azure.resourcemanager.appservice.models.VirtualNetworkProfile; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import java.util.List; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in AppServiceEnvironmentsClient. */ -public interface AppServiceEnvironmentsClient - extends InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete { - /** - * Get all App Service Environments for a subscription. - * - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all App Service Environments for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Get all App Service Environments for a subscription. - * - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all App Service Environments for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Get all App Service Environments for a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all App Service Environments for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Get all App Service Environments in a resource group. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all App Service Environments in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName); - - /** - * Get all App Service Environments in a resource group. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all App Service Environments in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Get all App Service Environments in a resource group. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all App Service Environments in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * Get the properties of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String name); - - /** - * Get the properties of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync(String resourceGroupName, String name); - - /** - * Get the properties of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AppServiceEnvironmentResourceInner getByResourceGroup(String resourceGroupName, String name); - - /** - * Get the properties of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String name, Context context); - - /** - * Create or update an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param hostingEnvironmentEnvelope Configuration details of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return app Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String name, AppServiceEnvironmentResourceInner hostingEnvironmentEnvelope); - - /** - * Create or update an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param hostingEnvironmentEnvelope Configuration details of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return app Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, AppServiceEnvironmentResourceInner> - beginCreateOrUpdateAsync( - String resourceGroupName, String name, AppServiceEnvironmentResourceInner hostingEnvironmentEnvelope); - - /** - * Create or update an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param hostingEnvironmentEnvelope Configuration details of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return app Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, AppServiceEnvironmentResourceInner> beginCreateOrUpdate( - String resourceGroupName, String name, AppServiceEnvironmentResourceInner hostingEnvironmentEnvelope); - - /** - * Create or update an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param hostingEnvironmentEnvelope Configuration details of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return app Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, AppServiceEnvironmentResourceInner> beginCreateOrUpdate( - String resourceGroupName, - String name, - AppServiceEnvironmentResourceInner hostingEnvironmentEnvelope, - Context context); - - /** - * Create or update an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param hostingEnvironmentEnvelope Configuration details of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return app Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, String name, AppServiceEnvironmentResourceInner hostingEnvironmentEnvelope); - - /** - * Create or update an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param hostingEnvironmentEnvelope Configuration details of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return app Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AppServiceEnvironmentResourceInner createOrUpdate( - String resourceGroupName, String name, AppServiceEnvironmentResourceInner hostingEnvironmentEnvelope); - - /** - * Create or update an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param hostingEnvironmentEnvelope Configuration details of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return app Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AppServiceEnvironmentResourceInner createOrUpdate( - String resourceGroupName, - String name, - AppServiceEnvironmentResourceInner hostingEnvironmentEnvelope, - Context context); - - /** - * Delete an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param forceDelete Specify <code>true</code> to force the deletion even if the App Service - * Environment contains resources. The default is <code>false</code>. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync( - String resourceGroupName, String name, Boolean forceDelete); - - /** - * Delete an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param forceDelete Specify <code>true</code> to force the deletion even if the App Service - * Environment contains resources. The default is <code>false</code>. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, Boolean forceDelete); - - /** - * Delete an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param forceDelete Specify <code>true</code> to force the deletion even if the App Service - * Environment contains resources. The default is <code>false</code>. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String name, Boolean forceDelete); - - /** - * Delete an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param forceDelete Specify <code>true</code> to force the deletion even if the App Service - * Environment contains resources. The default is <code>false</code>. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String name, Boolean forceDelete, Context context); - - /** - * Delete an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param forceDelete Specify <code>true</code> to force the deletion even if the App Service - * Environment contains resources. The default is <code>false</code>. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String name, Boolean forceDelete); - - /** - * Delete an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String name); - - /** - * Delete an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param forceDelete Specify <code>true</code> to force the deletion even if the App Service - * Environment contains resources. The default is <code>false</code>. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String name, Boolean forceDelete); - - /** - * Delete an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String name); - - /** - * Delete an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param forceDelete Specify <code>true</code> to force the deletion even if the App Service - * Environment contains resources. The default is <code>false</code>. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String name, Boolean forceDelete, Context context); - - /** - * Create or update an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param hostingEnvironmentEnvelope Configuration details of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return app Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateWithResponseAsync( - String resourceGroupName, String name, AppServiceEnvironmentPatchResource hostingEnvironmentEnvelope); - - /** - * Create or update an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param hostingEnvironmentEnvelope Configuration details of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return app Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAsync( - String resourceGroupName, String name, AppServiceEnvironmentPatchResource hostingEnvironmentEnvelope); - - /** - * Create or update an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param hostingEnvironmentEnvelope Configuration details of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return app Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AppServiceEnvironmentResourceInner update( - String resourceGroupName, String name, AppServiceEnvironmentPatchResource hostingEnvironmentEnvelope); - - /** - * Create or update an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param hostingEnvironmentEnvelope Configuration details of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return app Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String resourceGroupName, - String name, - AppServiceEnvironmentPatchResource hostingEnvironmentEnvelope, - Context context); - - /** - * Get the used, available, and total worker capacity an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the used, available, and total worker capacity an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listCapacitiesAsync(String resourceGroupName, String name); - - /** - * Get the used, available, and total worker capacity an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the used, available, and total worker capacity an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listCapacities(String resourceGroupName, String name); - - /** - * Get the used, available, and total worker capacity an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the used, available, and total worker capacity an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listCapacities(String resourceGroupName, String name, Context context); - - /** - * Get IP addresses assigned to an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return iP addresses assigned to an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listVipsWithResponseAsync(String resourceGroupName, String name); - - /** - * Get IP addresses assigned to an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return iP addresses assigned to an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listVipsAsync(String resourceGroupName, String name); - - /** - * Get IP addresses assigned to an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return iP addresses assigned to an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AddressResponseInner listVips(String resourceGroupName, String name); - - /** - * Get IP addresses assigned to an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return iP addresses assigned to an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listVipsWithResponse(String resourceGroupName, String name, Context context); - - /** - * Move an App Service Environment to a different VNET. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param vnetInfo Details for the new virtual network. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux changeVnetAsync(String resourceGroupName, String name, VirtualNetworkProfile vnetInfo); - - /** - * Move an App Service Environment to a different VNET. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param vnetInfo Details for the new virtual network. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable changeVnet(String resourceGroupName, String name, VirtualNetworkProfile vnetInfo); - - /** - * Move an App Service Environment to a different VNET. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param vnetInfo Details for the new virtual network. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable changeVnet( - String resourceGroupName, String name, VirtualNetworkProfile vnetInfo, Context context); - - /** - * Get diagnostic information for an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return diagnostic information for an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> listDiagnosticsWithResponseAsync( - String resourceGroupName, String name); - - /** - * Get diagnostic information for an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return diagnostic information for an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listDiagnosticsAsync(String resourceGroupName, String name); - - /** - * Get diagnostic information for an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return diagnostic information for an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - List listDiagnostics(String resourceGroupName, String name); - - /** - * Get diagnostic information for an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return diagnostic information for an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response> listDiagnosticsWithResponse( - String resourceGroupName, String name, Context context); - - /** - * Get a diagnostics item for an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param diagnosticsName Name of the diagnostics item. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a diagnostics item for an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getDiagnosticsItemWithResponseAsync( - String resourceGroupName, String name, String diagnosticsName); - - /** - * Get a diagnostics item for an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param diagnosticsName Name of the diagnostics item. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a diagnostics item for an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getDiagnosticsItemAsync( - String resourceGroupName, String name, String diagnosticsName); - - /** - * Get a diagnostics item for an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param diagnosticsName Name of the diagnostics item. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a diagnostics item for an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - HostingEnvironmentDiagnosticsInner getDiagnosticsItem( - String resourceGroupName, String name, String diagnosticsName); - - /** - * Get a diagnostics item for an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param diagnosticsName Name of the diagnostics item. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a diagnostics item for an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getDiagnosticsItemWithResponse( - String resourceGroupName, String name, String diagnosticsName, Context context); - - /** - * Get the network endpoints of all inbound dependencies of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the network endpoints of all inbound dependencies of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux getInboundNetworkDependenciesEndpointsAsync( - String resourceGroupName, String name); - - /** - * Get the network endpoints of all inbound dependencies of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the network endpoints of all inbound dependencies of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable getInboundNetworkDependenciesEndpoints( - String resourceGroupName, String name); - - /** - * Get the network endpoints of all inbound dependencies of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the network endpoints of all inbound dependencies of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable getInboundNetworkDependenciesEndpoints( - String resourceGroupName, String name, Context context); - - /** - * Get global metric definitions of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return global metric definitions of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listMetricDefinitionsWithResponseAsync(String resourceGroupName, String name); - - /** - * Get global metric definitions of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return global metric definitions of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listMetricDefinitionsAsync(String resourceGroupName, String name); - - /** - * Get global metric definitions of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return global metric definitions of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - MetricDefinitionInner listMetricDefinitions(String resourceGroupName, String name); - - /** - * Get global metric definitions of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return global metric definitions of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listMetricDefinitionsWithResponse( - String resourceGroupName, String name, Context context); - - /** - * Get global metrics of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param details Specify <code>true</code> to include instance details. The default is - * <code>false</code>. - * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: - * $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and - * endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return global metrics of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listMetricsAsync( - String resourceGroupName, String name, Boolean details, String filter); - - /** - * Get global metrics of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return global metrics of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listMetricsAsync(String resourceGroupName, String name); - - /** - * Get global metrics of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return global metrics of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listMetrics(String resourceGroupName, String name); - - /** - * Get global metrics of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param details Specify <code>true</code> to include instance details. The default is - * <code>false</code>. - * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: - * $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and - * endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return global metrics of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listMetrics( - String resourceGroupName, String name, Boolean details, String filter, Context context); - - /** - * Get all multi-role pools. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all multi-role pools. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listMultiRolePoolsAsync(String resourceGroupName, String name); - - /** - * Get all multi-role pools. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all multi-role pools. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listMultiRolePools(String resourceGroupName, String name); - - /** - * Get all multi-role pools. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all multi-role pools. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listMultiRolePools(String resourceGroupName, String name, Context context); - - /** - * Get properties of a multi-role pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of a multi-role pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getMultiRolePoolWithResponseAsync(String resourceGroupName, String name); - - /** - * Get properties of a multi-role pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of a multi-role pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getMultiRolePoolAsync(String resourceGroupName, String name); - - /** - * Get properties of a multi-role pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of a multi-role pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - WorkerPoolResourceInner getMultiRolePool(String resourceGroupName, String name); - - /** - * Get properties of a multi-role pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of a multi-role pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getMultiRolePoolWithResponse( - String resourceGroupName, String name, Context context); - - /** - * Create or update a multi-role pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param multiRolePoolEnvelope Properties of the multi-role pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return worker pool of an App Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateMultiRolePoolWithResponseAsync( - String resourceGroupName, String name, WorkerPoolResourceInner multiRolePoolEnvelope); - - /** - * Create or update a multi-role pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param multiRolePoolEnvelope Properties of the multi-role pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return worker pool of an App Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, WorkerPoolResourceInner> beginCreateOrUpdateMultiRolePoolAsync( - String resourceGroupName, String name, WorkerPoolResourceInner multiRolePoolEnvelope); - - /** - * Create or update a multi-role pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param multiRolePoolEnvelope Properties of the multi-role pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return worker pool of an App Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, WorkerPoolResourceInner> beginCreateOrUpdateMultiRolePool( - String resourceGroupName, String name, WorkerPoolResourceInner multiRolePoolEnvelope); - - /** - * Create or update a multi-role pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param multiRolePoolEnvelope Properties of the multi-role pool. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return worker pool of an App Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, WorkerPoolResourceInner> beginCreateOrUpdateMultiRolePool( - String resourceGroupName, String name, WorkerPoolResourceInner multiRolePoolEnvelope, Context context); - - /** - * Create or update a multi-role pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param multiRolePoolEnvelope Properties of the multi-role pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return worker pool of an App Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateMultiRolePoolAsync( - String resourceGroupName, String name, WorkerPoolResourceInner multiRolePoolEnvelope); - - /** - * Create or update a multi-role pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param multiRolePoolEnvelope Properties of the multi-role pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return worker pool of an App Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - WorkerPoolResourceInner createOrUpdateMultiRolePool( - String resourceGroupName, String name, WorkerPoolResourceInner multiRolePoolEnvelope); - - /** - * Create or update a multi-role pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param multiRolePoolEnvelope Properties of the multi-role pool. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return worker pool of an App Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - WorkerPoolResourceInner createOrUpdateMultiRolePool( - String resourceGroupName, String name, WorkerPoolResourceInner multiRolePoolEnvelope, Context context); - - /** - * Create or update a multi-role pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param multiRolePoolEnvelope Properties of the multi-role pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return worker pool of an App Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateMultiRolePoolWithResponseAsync( - String resourceGroupName, String name, WorkerPoolResourceInner multiRolePoolEnvelope); - - /** - * Create or update a multi-role pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param multiRolePoolEnvelope Properties of the multi-role pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return worker pool of an App Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateMultiRolePoolAsync( - String resourceGroupName, String name, WorkerPoolResourceInner multiRolePoolEnvelope); - - /** - * Create or update a multi-role pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param multiRolePoolEnvelope Properties of the multi-role pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return worker pool of an App Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - WorkerPoolResourceInner updateMultiRolePool( - String resourceGroupName, String name, WorkerPoolResourceInner multiRolePoolEnvelope); - - /** - * Create or update a multi-role pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param multiRolePoolEnvelope Properties of the multi-role pool. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return worker pool of an App Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateMultiRolePoolWithResponse( - String resourceGroupName, String name, WorkerPoolResourceInner multiRolePoolEnvelope, Context context); - - /** - * Get metric definitions for a specific instance of a multi-role pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param instance Name of the instance in the multi-role pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metric definitions for a specific instance of a multi-role pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listMultiRolePoolInstanceMetricDefinitionsAsync( - String resourceGroupName, String name, String instance); - - /** - * Get metric definitions for a specific instance of a multi-role pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param instance Name of the instance in the multi-role pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metric definitions for a specific instance of a multi-role pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listMultiRolePoolInstanceMetricDefinitions( - String resourceGroupName, String name, String instance); - - /** - * Get metric definitions for a specific instance of a multi-role pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param instance Name of the instance in the multi-role pool. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metric definitions for a specific instance of a multi-role pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listMultiRolePoolInstanceMetricDefinitions( - String resourceGroupName, String name, String instance, Context context); - - /** - * Get metrics for a specific instance of a multi-role pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param instance Name of the instance in the multi-role pool. - * @param details Specify <code>true</code> to include instance details. The default is - * <code>false</code>. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metrics for a specific instance of a multi-role pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listMultiRolePoolInstanceMetricsAsync( - String resourceGroupName, String name, String instance, Boolean details); - - /** - * Get metrics for a specific instance of a multi-role pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param instance Name of the instance in the multi-role pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metrics for a specific instance of a multi-role pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listMultiRolePoolInstanceMetricsAsync( - String resourceGroupName, String name, String instance); - - /** - * Get metrics for a specific instance of a multi-role pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param instance Name of the instance in the multi-role pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metrics for a specific instance of a multi-role pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listMultiRolePoolInstanceMetrics( - String resourceGroupName, String name, String instance); - - /** - * Get metrics for a specific instance of a multi-role pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param instance Name of the instance in the multi-role pool. - * @param details Specify <code>true</code> to include instance details. The default is - * <code>false</code>. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metrics for a specific instance of a multi-role pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listMultiRolePoolInstanceMetrics( - String resourceGroupName, String name, String instance, Boolean details, Context context); - - /** - * Get metric definitions for a multi-role pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metric definitions for a multi-role pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listMultiRoleMetricDefinitionsAsync(String resourceGroupName, String name); - - /** - * Get metric definitions for a multi-role pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metric definitions for a multi-role pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listMultiRoleMetricDefinitions(String resourceGroupName, String name); - - /** - * Get metric definitions for a multi-role pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metric definitions for a multi-role pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listMultiRoleMetricDefinitions( - String resourceGroupName, String name, Context context); - - /** - * Get metrics for a multi-role pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param startTime Beginning time of the metrics query. - * @param endTime End time of the metrics query. - * @param timeGrain Time granularity of the metrics query. - * @param details Specify <code>true</code> to include instance details. The default is - * <code>false</code>. - * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: - * $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and - * endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metrics for a multi-role pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listMultiRoleMetricsAsync( - String resourceGroupName, - String name, - String startTime, - String endTime, - String timeGrain, - Boolean details, - String filter); - - /** - * Get metrics for a multi-role pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metrics for a multi-role pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listMultiRoleMetricsAsync(String resourceGroupName, String name); - - /** - * Get metrics for a multi-role pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metrics for a multi-role pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listMultiRoleMetrics(String resourceGroupName, String name); - - /** - * Get metrics for a multi-role pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param startTime Beginning time of the metrics query. - * @param endTime End time of the metrics query. - * @param timeGrain Time granularity of the metrics query. - * @param details Specify <code>true</code> to include instance details. The default is - * <code>false</code>. - * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: - * $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and - * endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metrics for a multi-role pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listMultiRoleMetrics( - String resourceGroupName, - String name, - String startTime, - String endTime, - String timeGrain, - Boolean details, - String filter, - Context context); - - /** - * Get available SKUs for scaling a multi-role pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return available SKUs for scaling a multi-role pool. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listMultiRolePoolSkusAsync(String resourceGroupName, String name); - - /** - * Get available SKUs for scaling a multi-role pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return available SKUs for scaling a multi-role pool. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listMultiRolePoolSkus(String resourceGroupName, String name); - - /** - * Get available SKUs for scaling a multi-role pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return available SKUs for scaling a multi-role pool. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listMultiRolePoolSkus(String resourceGroupName, String name, Context context); - - /** - * Get usage metrics for a multi-role pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return usage metrics for a multi-role pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listMultiRoleUsagesAsync(String resourceGroupName, String name); - - /** - * Get usage metrics for a multi-role pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return usage metrics for a multi-role pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listMultiRoleUsages(String resourceGroupName, String name); - - /** - * Get usage metrics for a multi-role pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return usage metrics for a multi-role pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listMultiRoleUsages(String resourceGroupName, String name, Context context); - - /** - * List all currently running operations on the App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of Operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> listOperationsWithResponseAsync(String resourceGroupName, String name); - - /** - * List all currently running operations on the App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of Operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listOperationsAsync(String resourceGroupName, String name); - - /** - * List all currently running operations on the App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of Operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - List listOperations(String resourceGroupName, String name); - - /** - * List all currently running operations on the App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of Operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response> listOperationsWithResponse(String resourceGroupName, String name, Context context); - - /** - * Get the network endpoints of all outbound dependencies of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the network endpoints of all outbound dependencies of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux getOutboundNetworkDependenciesEndpointsAsync( - String resourceGroupName, String name); - - /** - * Get the network endpoints of all outbound dependencies of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the network endpoints of all outbound dependencies of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable getOutboundNetworkDependenciesEndpoints( - String resourceGroupName, String name); - - /** - * Get the network endpoints of all outbound dependencies of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the network endpoints of all outbound dependencies of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable getOutboundNetworkDependenciesEndpoints( - String resourceGroupName, String name, Context context); - - /** - * Reboot all machines in an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> rebootWithResponseAsync(String resourceGroupName, String name); - - /** - * Reboot all machines in an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono rebootAsync(String resourceGroupName, String name); - - /** - * Reboot all machines in an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void reboot(String resourceGroupName, String name); - - /** - * Reboot all machines in an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response rebootWithResponse(String resourceGroupName, String name, Context context); - - /** - * Resume an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux resumeAsync(String resourceGroupName, String name); - - /** - * Resume an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable resume(String resourceGroupName, String name); - - /** - * Resume an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable resume(String resourceGroupName, String name, Context context); - - /** - * Get all App Service plans in an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all App Service plans in an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAppServicePlansAsync(String resourceGroupName, String name); - - /** - * Get all App Service plans in an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all App Service plans in an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listAppServicePlans(String resourceGroupName, String name); - - /** - * Get all App Service plans in an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all App Service plans in an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listAppServicePlans(String resourceGroupName, String name, Context context); - - /** - * Get all apps in an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param propertiesToInclude Comma separated list of app properties to include. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all apps in an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listWebAppsAsync(String resourceGroupName, String name, String propertiesToInclude); - - /** - * Get all apps in an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all apps in an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listWebAppsAsync(String resourceGroupName, String name); - - /** - * Get all apps in an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all apps in an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listWebApps(String resourceGroupName, String name); - - /** - * Get all apps in an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param propertiesToInclude Comma separated list of app properties to include. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all apps in an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listWebApps( - String resourceGroupName, String name, String propertiesToInclude, Context context); - - /** - * Suspend an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux suspendAsync(String resourceGroupName, String name); - - /** - * Suspend an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable suspend(String resourceGroupName, String name); - - /** - * Suspend an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable suspend(String resourceGroupName, String name, Context context); - - /** - * Get global usage metrics of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: - * $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and - * endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return global usage metrics of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listUsagesAsync(String resourceGroupName, String name, String filter); - - /** - * Get global usage metrics of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return global usage metrics of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listUsagesAsync(String resourceGroupName, String name); - - /** - * Get global usage metrics of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return global usage metrics of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listUsages(String resourceGroupName, String name); - - /** - * Get global usage metrics of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: - * $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and - * endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return global usage metrics of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listUsages(String resourceGroupName, String name, String filter, Context context); - - /** - * Get all worker pools of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all worker pools of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listWorkerPoolsAsync(String resourceGroupName, String name); - - /** - * Get all worker pools of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all worker pools of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listWorkerPools(String resourceGroupName, String name); - - /** - * Get all worker pools of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all worker pools of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listWorkerPools(String resourceGroupName, String name, Context context); - - /** - * Get properties of a worker pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of a worker pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWorkerPoolWithResponseAsync( - String resourceGroupName, String name, String workerPoolName); - - /** - * Get properties of a worker pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of a worker pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getWorkerPoolAsync(String resourceGroupName, String name, String workerPoolName); - - /** - * Get properties of a worker pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of a worker pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - WorkerPoolResourceInner getWorkerPool(String resourceGroupName, String name, String workerPoolName); - - /** - * Get properties of a worker pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of a worker pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWorkerPoolWithResponse( - String resourceGroupName, String name, String workerPoolName, Context context); - - /** - * Create or update a worker pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @param workerPoolEnvelope Properties of the worker pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return worker pool of an App Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWorkerPoolWithResponseAsync( - String resourceGroupName, String name, String workerPoolName, WorkerPoolResourceInner workerPoolEnvelope); - - /** - * Create or update a worker pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @param workerPoolEnvelope Properties of the worker pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return worker pool of an App Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, WorkerPoolResourceInner> beginCreateOrUpdateWorkerPoolAsync( - String resourceGroupName, String name, String workerPoolName, WorkerPoolResourceInner workerPoolEnvelope); - - /** - * Create or update a worker pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @param workerPoolEnvelope Properties of the worker pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return worker pool of an App Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, WorkerPoolResourceInner> beginCreateOrUpdateWorkerPool( - String resourceGroupName, String name, String workerPoolName, WorkerPoolResourceInner workerPoolEnvelope); - - /** - * Create or update a worker pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @param workerPoolEnvelope Properties of the worker pool. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return worker pool of an App Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, WorkerPoolResourceInner> beginCreateOrUpdateWorkerPool( - String resourceGroupName, - String name, - String workerPoolName, - WorkerPoolResourceInner workerPoolEnvelope, - Context context); - - /** - * Create or update a worker pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @param workerPoolEnvelope Properties of the worker pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return worker pool of an App Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateWorkerPoolAsync( - String resourceGroupName, String name, String workerPoolName, WorkerPoolResourceInner workerPoolEnvelope); - - /** - * Create or update a worker pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @param workerPoolEnvelope Properties of the worker pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return worker pool of an App Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - WorkerPoolResourceInner createOrUpdateWorkerPool( - String resourceGroupName, String name, String workerPoolName, WorkerPoolResourceInner workerPoolEnvelope); - - /** - * Create or update a worker pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @param workerPoolEnvelope Properties of the worker pool. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return worker pool of an App Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - WorkerPoolResourceInner createOrUpdateWorkerPool( - String resourceGroupName, - String name, - String workerPoolName, - WorkerPoolResourceInner workerPoolEnvelope, - Context context); - - /** - * Create or update a worker pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @param workerPoolEnvelope Properties of the worker pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return worker pool of an App Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateWorkerPoolWithResponseAsync( - String resourceGroupName, String name, String workerPoolName, WorkerPoolResourceInner workerPoolEnvelope); - - /** - * Create or update a worker pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @param workerPoolEnvelope Properties of the worker pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return worker pool of an App Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateWorkerPoolAsync( - String resourceGroupName, String name, String workerPoolName, WorkerPoolResourceInner workerPoolEnvelope); - - /** - * Create or update a worker pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @param workerPoolEnvelope Properties of the worker pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return worker pool of an App Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - WorkerPoolResourceInner updateWorkerPool( - String resourceGroupName, String name, String workerPoolName, WorkerPoolResourceInner workerPoolEnvelope); - - /** - * Create or update a worker pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @param workerPoolEnvelope Properties of the worker pool. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return worker pool of an App Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWorkerPoolWithResponse( - String resourceGroupName, - String name, - String workerPoolName, - WorkerPoolResourceInner workerPoolEnvelope, - Context context); - - /** - * Get metric definitions for a specific instance of a worker pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @param instance Name of the instance in the worker pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metric definitions for a specific instance of a worker pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listWorkerPoolInstanceMetricDefinitionsAsync( - String resourceGroupName, String name, String workerPoolName, String instance); - - /** - * Get metric definitions for a specific instance of a worker pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @param instance Name of the instance in the worker pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metric definitions for a specific instance of a worker pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listWorkerPoolInstanceMetricDefinitions( - String resourceGroupName, String name, String workerPoolName, String instance); - - /** - * Get metric definitions for a specific instance of a worker pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @param instance Name of the instance in the worker pool. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metric definitions for a specific instance of a worker pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listWorkerPoolInstanceMetricDefinitions( - String resourceGroupName, String name, String workerPoolName, String instance, Context context); - - /** - * Get metrics for a specific instance of a worker pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @param instance Name of the instance in the worker pool. - * @param details Specify <code>true</code> to include instance details. The default is - * <code>false</code>. - * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: - * $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and - * endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metrics for a specific instance of a worker pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listWorkerPoolInstanceMetricsAsync( - String resourceGroupName, String name, String workerPoolName, String instance, Boolean details, String filter); - - /** - * Get metrics for a specific instance of a worker pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @param instance Name of the instance in the worker pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metrics for a specific instance of a worker pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listWorkerPoolInstanceMetricsAsync( - String resourceGroupName, String name, String workerPoolName, String instance); - - /** - * Get metrics for a specific instance of a worker pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @param instance Name of the instance in the worker pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metrics for a specific instance of a worker pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listWorkerPoolInstanceMetrics( - String resourceGroupName, String name, String workerPoolName, String instance); - - /** - * Get metrics for a specific instance of a worker pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @param instance Name of the instance in the worker pool. - * @param details Specify <code>true</code> to include instance details. The default is - * <code>false</code>. - * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: - * $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and - * endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metrics for a specific instance of a worker pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listWorkerPoolInstanceMetrics( - String resourceGroupName, - String name, - String workerPoolName, - String instance, - Boolean details, - String filter, - Context context); - - /** - * Get metric definitions for a worker pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metric definitions for a worker pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listWebWorkerMetricDefinitionsAsync( - String resourceGroupName, String name, String workerPoolName); - - /** - * Get metric definitions for a worker pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metric definitions for a worker pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listWebWorkerMetricDefinitions( - String resourceGroupName, String name, String workerPoolName); - - /** - * Get metric definitions for a worker pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metric definitions for a worker pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listWebWorkerMetricDefinitions( - String resourceGroupName, String name, String workerPoolName, Context context); - - /** - * Get metrics for a worker pool of a AppServiceEnvironment (App Service Environment). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of worker pool. - * @param details Specify <code>true</code> to include instance details. The default is - * <code>false</code>. - * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: - * $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and - * endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metrics for a worker pool of a AppServiceEnvironment (App Service Environment). - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listWebWorkerMetricsAsync( - String resourceGroupName, String name, String workerPoolName, Boolean details, String filter); - - /** - * Get metrics for a worker pool of a AppServiceEnvironment (App Service Environment). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of worker pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metrics for a worker pool of a AppServiceEnvironment (App Service Environment). - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listWebWorkerMetricsAsync( - String resourceGroupName, String name, String workerPoolName); - - /** - * Get metrics for a worker pool of a AppServiceEnvironment (App Service Environment). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of worker pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metrics for a worker pool of a AppServiceEnvironment (App Service Environment). - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listWebWorkerMetrics( - String resourceGroupName, String name, String workerPoolName); - - /** - * Get metrics for a worker pool of a AppServiceEnvironment (App Service Environment). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of worker pool. - * @param details Specify <code>true</code> to include instance details. The default is - * <code>false</code>. - * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: - * $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and - * endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metrics for a worker pool of a AppServiceEnvironment (App Service Environment). - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listWebWorkerMetrics( - String resourceGroupName, String name, String workerPoolName, Boolean details, String filter, Context context); - - /** - * Get available SKUs for scaling a worker pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return available SKUs for scaling a worker pool. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listWorkerPoolSkusAsync(String resourceGroupName, String name, String workerPoolName); - - /** - * Get available SKUs for scaling a worker pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return available SKUs for scaling a worker pool. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listWorkerPoolSkus(String resourceGroupName, String name, String workerPoolName); - - /** - * Get available SKUs for scaling a worker pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return available SKUs for scaling a worker pool. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listWorkerPoolSkus( - String resourceGroupName, String name, String workerPoolName, Context context); - - /** - * Get usage metrics for a worker pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return usage metrics for a worker pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listWebWorkerUsagesAsync(String resourceGroupName, String name, String workerPoolName); - - /** - * Get usage metrics for a worker pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return usage metrics for a worker pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listWebWorkerUsages(String resourceGroupName, String name, String workerPoolName); - - /** - * Get usage metrics for a worker pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return usage metrics for a worker pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listWebWorkerUsages( - String resourceGroupName, String name, String workerPoolName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/AppServicePlansClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/AppServicePlansClient.java deleted file mode 100644 index 00efb79b8a9c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/AppServicePlansClient.java +++ /dev/null @@ -1,1872 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.appservice.fluent.models.AppServicePlanInner; -import com.azure.resourcemanager.appservice.fluent.models.CapabilityInner; -import com.azure.resourcemanager.appservice.fluent.models.CsmUsageQuotaInner; -import com.azure.resourcemanager.appservice.fluent.models.HybridConnectionInner; -import com.azure.resourcemanager.appservice.fluent.models.HybridConnectionKeyInner; -import com.azure.resourcemanager.appservice.fluent.models.HybridConnectionLimitsInner; -import com.azure.resourcemanager.appservice.fluent.models.ResourceMetricDefinitionInner; -import com.azure.resourcemanager.appservice.fluent.models.ResourceMetricInner; -import com.azure.resourcemanager.appservice.fluent.models.SiteInner; -import com.azure.resourcemanager.appservice.fluent.models.VnetGatewayInner; -import com.azure.resourcemanager.appservice.fluent.models.VnetInfoInner; -import com.azure.resourcemanager.appservice.fluent.models.VnetRouteInner; -import com.azure.resourcemanager.appservice.models.AppServicePlanPatchResource; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import java.util.List; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in AppServicePlansClient. */ -public interface AppServicePlansClient - extends InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete { - /** - * Get all App Service plans for a subscription. - * - * @param detailed Specify <code>true</code> to return all App Service plan properties. The default is - * <code>false</code>, which returns a subset of the properties. Retrieval of all properties may - * increase the API latency. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all App Service plans for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(Boolean detailed); - - /** - * Get all App Service plans for a subscription. - * - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all App Service plans for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Get all App Service plans for a subscription. - * - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all App Service plans for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Get all App Service plans for a subscription. - * - * @param detailed Specify <code>true</code> to return all App Service plan properties. The default is - * <code>false</code>, which returns a subset of the properties. Retrieval of all properties may - * increase the API latency. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all App Service plans for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Boolean detailed, Context context); - - /** - * Get all App Service plans in a resource group. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all App Service plans in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName); - - /** - * Get all App Service plans in a resource group. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all App Service plans in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Get all App Service plans in a resource group. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all App Service plans in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * Get an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an App Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String name); - - /** - * Get an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an App Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync(String resourceGroupName, String name); - - /** - * Get an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an App Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AppServicePlanInner getByResourceGroup(String resourceGroupName, String name); - - /** - * Get an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an App Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String name, Context context); - - /** - * Creates or updates an App Service Plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param appServicePlan Details of the App Service plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return app Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String name, AppServicePlanInner appServicePlan); - - /** - * Creates or updates an App Service Plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param appServicePlan Details of the App Service plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return app Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, AppServicePlanInner> beginCreateOrUpdateAsync( - String resourceGroupName, String name, AppServicePlanInner appServicePlan); - - /** - * Creates or updates an App Service Plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param appServicePlan Details of the App Service plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return app Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, AppServicePlanInner> beginCreateOrUpdate( - String resourceGroupName, String name, AppServicePlanInner appServicePlan); - - /** - * Creates or updates an App Service Plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param appServicePlan Details of the App Service plan. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return app Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, AppServicePlanInner> beginCreateOrUpdate( - String resourceGroupName, String name, AppServicePlanInner appServicePlan, Context context); - - /** - * Creates or updates an App Service Plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param appServicePlan Details of the App Service plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return app Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, String name, AppServicePlanInner appServicePlan); - - /** - * Creates or updates an App Service Plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param appServicePlan Details of the App Service plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return app Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AppServicePlanInner createOrUpdate(String resourceGroupName, String name, AppServicePlanInner appServicePlan); - - /** - * Creates or updates an App Service Plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param appServicePlan Details of the App Service plan. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return app Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AppServicePlanInner createOrUpdate( - String resourceGroupName, String name, AppServicePlanInner appServicePlan, Context context); - - /** - * Delete an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteWithResponseAsync(String resourceGroupName, String name); - - /** - * Delete an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String name); - - /** - * Delete an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String name); - - /** - * Delete an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String name, Context context); - - /** - * Creates or updates an App Service Plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param appServicePlan Details of the App Service plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return app Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateWithResponseAsync( - String resourceGroupName, String name, AppServicePlanPatchResource appServicePlan); - - /** - * Creates or updates an App Service Plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param appServicePlan Details of the App Service plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return app Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAsync( - String resourceGroupName, String name, AppServicePlanPatchResource appServicePlan); - - /** - * Creates or updates an App Service Plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param appServicePlan Details of the App Service plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return app Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AppServicePlanInner update(String resourceGroupName, String name, AppServicePlanPatchResource appServicePlan); - - /** - * Creates or updates an App Service Plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param appServicePlan Details of the App Service plan. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return app Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String resourceGroupName, String name, AppServicePlanPatchResource appServicePlan, Context context); - - /** - * List all capabilities of an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of Capability. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> listCapabilitiesWithResponseAsync(String resourceGroupName, String name); - - /** - * List all capabilities of an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of Capability. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listCapabilitiesAsync(String resourceGroupName, String name); - - /** - * List all capabilities of an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of Capability. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - List listCapabilities(String resourceGroupName, String name); - - /** - * List all capabilities of an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of Capability. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response> listCapabilitiesWithResponse( - String resourceGroupName, String name, Context context); - - /** - * Retrieve a Hybrid Connection in use in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param namespaceName Name of the Service Bus namespace. - * @param relayName Name of the Service Bus relay. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getHybridConnectionWithResponseAsync( - String resourceGroupName, String name, String namespaceName, String relayName); - - /** - * Retrieve a Hybrid Connection in use in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param namespaceName Name of the Service Bus namespace. - * @param relayName Name of the Service Bus relay. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getHybridConnectionAsync( - String resourceGroupName, String name, String namespaceName, String relayName); - - /** - * Retrieve a Hybrid Connection in use in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param namespaceName Name of the Service Bus namespace. - * @param relayName Name of the Service Bus relay. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - HybridConnectionInner getHybridConnection( - String resourceGroupName, String name, String namespaceName, String relayName); - - /** - * Retrieve a Hybrid Connection in use in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param namespaceName Name of the Service Bus namespace. - * @param relayName Name of the Service Bus relay. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getHybridConnectionWithResponse( - String resourceGroupName, String name, String namespaceName, String relayName, Context context); - - /** - * Delete a Hybrid Connection in use in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param namespaceName Name of the Service Bus namespace. - * @param relayName Name of the Service Bus relay. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteHybridConnectionWithResponseAsync( - String resourceGroupName, String name, String namespaceName, String relayName); - - /** - * Delete a Hybrid Connection in use in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param namespaceName Name of the Service Bus namespace. - * @param relayName Name of the Service Bus relay. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteHybridConnectionAsync( - String resourceGroupName, String name, String namespaceName, String relayName); - - /** - * Delete a Hybrid Connection in use in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param namespaceName Name of the Service Bus namespace. - * @param relayName Name of the Service Bus relay. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deleteHybridConnection(String resourceGroupName, String name, String namespaceName, String relayName); - - /** - * Delete a Hybrid Connection in use in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param namespaceName Name of the Service Bus namespace. - * @param relayName Name of the Service Bus relay. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteHybridConnectionWithResponse( - String resourceGroupName, String name, String namespaceName, String relayName, Context context); - - /** - * Get the send key name and value of a Hybrid Connection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param namespaceName The name of the Service Bus namespace. - * @param relayName The name of the Service Bus relay. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the send key name and value of a Hybrid Connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listHybridConnectionKeysWithResponseAsync( - String resourceGroupName, String name, String namespaceName, String relayName); - - /** - * Get the send key name and value of a Hybrid Connection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param namespaceName The name of the Service Bus namespace. - * @param relayName The name of the Service Bus relay. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the send key name and value of a Hybrid Connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listHybridConnectionKeysAsync( - String resourceGroupName, String name, String namespaceName, String relayName); - - /** - * Get the send key name and value of a Hybrid Connection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param namespaceName The name of the Service Bus namespace. - * @param relayName The name of the Service Bus relay. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the send key name and value of a Hybrid Connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - HybridConnectionKeyInner listHybridConnectionKeys( - String resourceGroupName, String name, String namespaceName, String relayName); - - /** - * Get the send key name and value of a Hybrid Connection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param namespaceName The name of the Service Bus namespace. - * @param relayName The name of the Service Bus relay. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the send key name and value of a Hybrid Connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listHybridConnectionKeysWithResponse( - String resourceGroupName, String name, String namespaceName, String relayName, Context context); - - /** - * Get all apps that use a Hybrid Connection in an App Service Plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param namespaceName Name of the Hybrid Connection namespace. - * @param relayName Name of the Hybrid Connection relay. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all apps that use a Hybrid Connection in an App Service Plan. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listWebAppsByHybridConnectionAsync( - String resourceGroupName, String name, String namespaceName, String relayName); - - /** - * Get all apps that use a Hybrid Connection in an App Service Plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param namespaceName Name of the Hybrid Connection namespace. - * @param relayName Name of the Hybrid Connection relay. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all apps that use a Hybrid Connection in an App Service Plan. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listWebAppsByHybridConnection( - String resourceGroupName, String name, String namespaceName, String relayName); - - /** - * Get all apps that use a Hybrid Connection in an App Service Plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param namespaceName Name of the Hybrid Connection namespace. - * @param relayName Name of the Hybrid Connection relay. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all apps that use a Hybrid Connection in an App Service Plan. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listWebAppsByHybridConnection( - String resourceGroupName, String name, String namespaceName, String relayName, Context context); - - /** - * Get the maximum number of Hybrid Connections allowed in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the maximum number of Hybrid Connections allowed in an App Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getHybridConnectionPlanLimitWithResponseAsync( - String resourceGroupName, String name); - - /** - * Get the maximum number of Hybrid Connections allowed in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the maximum number of Hybrid Connections allowed in an App Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getHybridConnectionPlanLimitAsync(String resourceGroupName, String name); - - /** - * Get the maximum number of Hybrid Connections allowed in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the maximum number of Hybrid Connections allowed in an App Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - HybridConnectionLimitsInner getHybridConnectionPlanLimit(String resourceGroupName, String name); - - /** - * Get the maximum number of Hybrid Connections allowed in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the maximum number of Hybrid Connections allowed in an App Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getHybridConnectionPlanLimitWithResponse( - String resourceGroupName, String name, Context context); - - /** - * Retrieve all Hybrid Connections in use in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of hostname bindings. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listHybridConnectionsAsync(String resourceGroupName, String name); - - /** - * Retrieve all Hybrid Connections in use in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of hostname bindings. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listHybridConnections(String resourceGroupName, String name); - - /** - * Retrieve all Hybrid Connections in use in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of hostname bindings. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listHybridConnections(String resourceGroupName, String name, Context context); - - /** - * Get metrics that can be queried for an App Service plan, and their definitions. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metrics that can be queried for an App Service plan, and their definitions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listMetricDefintionsAsync(String resourceGroupName, String name); - - /** - * Get metrics that can be queried for an App Service plan, and their definitions. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metrics that can be queried for an App Service plan, and their definitions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listMetricDefintions(String resourceGroupName, String name); - - /** - * Get metrics that can be queried for an App Service plan, and their definitions. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metrics that can be queried for an App Service plan, and their definitions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listMetricDefintions( - String resourceGroupName, String name, Context context); - - /** - * Get metrics for an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param details Specify <code>true</code> to include instance details. The default is - * <code>false</code>. - * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: - * $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and - * endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metrics for an App Service plan. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listMetricsAsync( - String resourceGroupName, String name, Boolean details, String filter); - - /** - * Get metrics for an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metrics for an App Service plan. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listMetricsAsync(String resourceGroupName, String name); - - /** - * Get metrics for an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metrics for an App Service plan. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listMetrics(String resourceGroupName, String name); - - /** - * Get metrics for an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param details Specify <code>true</code> to include instance details. The default is - * <code>false</code>. - * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: - * $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and - * endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metrics for an App Service plan. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listMetrics( - String resourceGroupName, String name, Boolean details, String filter, Context context); - - /** - * Restart all apps in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param softRestart Specify <code>true</code> to perform a soft restart, applies the configuration - * settings and restarts the apps if necessary. The default is <code>false</code>, which always - * restarts and reprovisions the apps. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> restartWebAppsWithResponseAsync(String resourceGroupName, String name, Boolean softRestart); - - /** - * Restart all apps in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param softRestart Specify <code>true</code> to perform a soft restart, applies the configuration - * settings and restarts the apps if necessary. The default is <code>false</code>, which always - * restarts and reprovisions the apps. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono restartWebAppsAsync(String resourceGroupName, String name, Boolean softRestart); - - /** - * Restart all apps in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono restartWebAppsAsync(String resourceGroupName, String name); - - /** - * Restart all apps in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void restartWebApps(String resourceGroupName, String name); - - /** - * Restart all apps in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param softRestart Specify <code>true</code> to perform a soft restart, applies the configuration - * settings and restarts the apps if necessary. The default is <code>false</code>, which always - * restarts and reprovisions the apps. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response restartWebAppsWithResponse( - String resourceGroupName, String name, Boolean softRestart, Context context); - - /** - * Get all apps associated with an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param skipToken Skip to a web app in the list of webapps associated with app service plan. If specified, the - * resulting list will contain web apps starting from (including) the skipToken. Otherwise, the resulting list - * contains web apps from the start of the list. - * @param filter Supported filter: $filter=state eq running. Returns only web apps that are currently running. - * @param top List page size. If specified, results are paged. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all apps associated with an App Service plan. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listWebAppsAsync( - String resourceGroupName, String name, String skipToken, String filter, String top); - - /** - * Get all apps associated with an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all apps associated with an App Service plan. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listWebAppsAsync(String resourceGroupName, String name); - - /** - * Get all apps associated with an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all apps associated with an App Service plan. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listWebApps(String resourceGroupName, String name); - - /** - * Get all apps associated with an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param skipToken Skip to a web app in the list of webapps associated with app service plan. If specified, the - * resulting list will contain web apps starting from (including) the skipToken. Otherwise, the resulting list - * contains web apps from the start of the list. - * @param filter Supported filter: $filter=state eq running. Returns only web apps that are currently running. - * @param top List page size. If specified, results are paged. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all apps associated with an App Service plan. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listWebApps( - String resourceGroupName, String name, String skipToken, String filter, String top, Context context); - - /** - * Gets all selectable SKUs for a given App Service Plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of App Service Plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all selectable SKUs for a given App Service Plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getServerFarmSkusWithResponseAsync(String resourceGroupName, String name); - - /** - * Gets all selectable SKUs for a given App Service Plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of App Service Plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all selectable SKUs for a given App Service Plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getServerFarmSkusAsync(String resourceGroupName, String name); - - /** - * Gets all selectable SKUs for a given App Service Plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of App Service Plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all selectable SKUs for a given App Service Plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Object getServerFarmSkus(String resourceGroupName, String name); - - /** - * Gets all selectable SKUs for a given App Service Plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of App Service Plan. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all selectable SKUs for a given App Service Plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getServerFarmSkusWithResponse(String resourceGroupName, String name, Context context); - - /** - * Gets server farm usage information. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of App Service Plan. - * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: - * $filter=(name.value eq 'Metric1' or name.value eq 'Metric2'). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return server farm usage information. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listUsagesAsync(String resourceGroupName, String name, String filter); - - /** - * Gets server farm usage information. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of App Service Plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return server farm usage information. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listUsagesAsync(String resourceGroupName, String name); - - /** - * Gets server farm usage information. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of App Service Plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return server farm usage information. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listUsages(String resourceGroupName, String name); - - /** - * Gets server farm usage information. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of App Service Plan. - * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: - * $filter=(name.value eq 'Metric1' or name.value eq 'Metric2'). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return server farm usage information. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listUsages(String resourceGroupName, String name, String filter, Context context); - - /** - * Get all Virtual Networks associated with an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all Virtual Networks associated with an App Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> listVnetsWithResponseAsync(String resourceGroupName, String name); - - /** - * Get all Virtual Networks associated with an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all Virtual Networks associated with an App Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listVnetsAsync(String resourceGroupName, String name); - - /** - * Get all Virtual Networks associated with an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all Virtual Networks associated with an App Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - List listVnets(String resourceGroupName, String name); - - /** - * Get all Virtual Networks associated with an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all Virtual Networks associated with an App Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response> listVnetsWithResponse(String resourceGroupName, String name, Context context); - - /** - * Get a Virtual Network associated with an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param vnetName Name of the Virtual Network. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Virtual Network associated with an App Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getVnetFromServerFarmWithResponseAsync( - String resourceGroupName, String name, String vnetName); - - /** - * Get a Virtual Network associated with an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param vnetName Name of the Virtual Network. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Virtual Network associated with an App Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getVnetFromServerFarmAsync(String resourceGroupName, String name, String vnetName); - - /** - * Get a Virtual Network associated with an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param vnetName Name of the Virtual Network. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Virtual Network associated with an App Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VnetInfoInner getVnetFromServerFarm(String resourceGroupName, String name, String vnetName); - - /** - * Get a Virtual Network associated with an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param vnetName Name of the Virtual Network. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Virtual Network associated with an App Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getVnetFromServerFarmWithResponse( - String resourceGroupName, String name, String vnetName, Context context); - - /** - * Get a Virtual Network gateway. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param vnetName Name of the Virtual Network. - * @param gatewayName Name of the gateway. Only the 'primary' gateway is supported. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Virtual Network gateway. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getVnetGatewayWithResponseAsync( - String resourceGroupName, String name, String vnetName, String gatewayName); - - /** - * Get a Virtual Network gateway. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param vnetName Name of the Virtual Network. - * @param gatewayName Name of the gateway. Only the 'primary' gateway is supported. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Virtual Network gateway. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getVnetGatewayAsync( - String resourceGroupName, String name, String vnetName, String gatewayName); - - /** - * Get a Virtual Network gateway. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param vnetName Name of the Virtual Network. - * @param gatewayName Name of the gateway. Only the 'primary' gateway is supported. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Virtual Network gateway. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VnetGatewayInner getVnetGateway(String resourceGroupName, String name, String vnetName, String gatewayName); - - /** - * Get a Virtual Network gateway. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param vnetName Name of the Virtual Network. - * @param gatewayName Name of the gateway. Only the 'primary' gateway is supported. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Virtual Network gateway. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getVnetGatewayWithResponse( - String resourceGroupName, String name, String vnetName, String gatewayName, Context context); - - /** - * Update a Virtual Network gateway. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param vnetName Name of the Virtual Network. - * @param gatewayName Name of the gateway. Only the 'primary' gateway is supported. - * @param connectionEnvelope Definition of the gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Virtual Network gateway contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateVnetGatewayWithResponseAsync( - String resourceGroupName, - String name, - String vnetName, - String gatewayName, - VnetGatewayInner connectionEnvelope); - - /** - * Update a Virtual Network gateway. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param vnetName Name of the Virtual Network. - * @param gatewayName Name of the gateway. Only the 'primary' gateway is supported. - * @param connectionEnvelope Definition of the gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Virtual Network gateway contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateVnetGatewayAsync( - String resourceGroupName, - String name, - String vnetName, - String gatewayName, - VnetGatewayInner connectionEnvelope); - - /** - * Update a Virtual Network gateway. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param vnetName Name of the Virtual Network. - * @param gatewayName Name of the gateway. Only the 'primary' gateway is supported. - * @param connectionEnvelope Definition of the gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Virtual Network gateway contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VnetGatewayInner updateVnetGateway( - String resourceGroupName, - String name, - String vnetName, - String gatewayName, - VnetGatewayInner connectionEnvelope); - - /** - * Update a Virtual Network gateway. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param vnetName Name of the Virtual Network. - * @param gatewayName Name of the gateway. Only the 'primary' gateway is supported. - * @param connectionEnvelope Definition of the gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Virtual Network gateway contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateVnetGatewayWithResponse( - String resourceGroupName, - String name, - String vnetName, - String gatewayName, - VnetGatewayInner connectionEnvelope, - Context context); - - /** - * Get all routes that are associated with a Virtual Network in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param vnetName Name of the Virtual Network. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all routes that are associated with a Virtual Network in an App Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> listRoutesForVnetWithResponseAsync( - String resourceGroupName, String name, String vnetName); - - /** - * Get all routes that are associated with a Virtual Network in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param vnetName Name of the Virtual Network. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all routes that are associated with a Virtual Network in an App Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listRoutesForVnetAsync(String resourceGroupName, String name, String vnetName); - - /** - * Get all routes that are associated with a Virtual Network in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param vnetName Name of the Virtual Network. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all routes that are associated with a Virtual Network in an App Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - List listRoutesForVnet(String resourceGroupName, String name, String vnetName); - - /** - * Get all routes that are associated with a Virtual Network in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param vnetName Name of the Virtual Network. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all routes that are associated with a Virtual Network in an App Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response> listRoutesForVnetWithResponse( - String resourceGroupName, String name, String vnetName, Context context); - - /** - * Get a Virtual Network route in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param vnetName Name of the Virtual Network. - * @param routeName Name of the Virtual Network route. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Virtual Network route in an App Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> getRouteForVnetWithResponseAsync( - String resourceGroupName, String name, String vnetName, String routeName); - - /** - * Get a Virtual Network route in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param vnetName Name of the Virtual Network. - * @param routeName Name of the Virtual Network route. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Virtual Network route in an App Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getRouteForVnetAsync( - String resourceGroupName, String name, String vnetName, String routeName); - - /** - * Get a Virtual Network route in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param vnetName Name of the Virtual Network. - * @param routeName Name of the Virtual Network route. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Virtual Network route in an App Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - List getRouteForVnet(String resourceGroupName, String name, String vnetName, String routeName); - - /** - * Get a Virtual Network route in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param vnetName Name of the Virtual Network. - * @param routeName Name of the Virtual Network route. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Virtual Network route in an App Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response> getRouteForVnetWithResponse( - String resourceGroupName, String name, String vnetName, String routeName, Context context); - - /** - * Create or update a Virtual Network route in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param vnetName Name of the Virtual Network. - * @param routeName Name of the Virtual Network route. - * @param route Definition of the Virtual Network route. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network route contract used to pass routing information for a Virtual Network. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createOrUpdateVnetRouteWithResponseAsync( - String resourceGroupName, String name, String vnetName, String routeName, VnetRouteInner route); - - /** - * Create or update a Virtual Network route in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param vnetName Name of the Virtual Network. - * @param routeName Name of the Virtual Network route. - * @param route Definition of the Virtual Network route. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network route contract used to pass routing information for a Virtual Network. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateVnetRouteAsync( - String resourceGroupName, String name, String vnetName, String routeName, VnetRouteInner route); - - /** - * Create or update a Virtual Network route in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param vnetName Name of the Virtual Network. - * @param routeName Name of the Virtual Network route. - * @param route Definition of the Virtual Network route. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network route contract used to pass routing information for a Virtual Network. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VnetRouteInner createOrUpdateVnetRoute( - String resourceGroupName, String name, String vnetName, String routeName, VnetRouteInner route); - - /** - * Create or update a Virtual Network route in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param vnetName Name of the Virtual Network. - * @param routeName Name of the Virtual Network route. - * @param route Definition of the Virtual Network route. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network route contract used to pass routing information for a Virtual Network. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateVnetRouteWithResponse( - String resourceGroupName, - String name, - String vnetName, - String routeName, - VnetRouteInner route, - Context context); - - /** - * Delete a Virtual Network route in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param vnetName Name of the Virtual Network. - * @param routeName Name of the Virtual Network route. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteVnetRouteWithResponseAsync( - String resourceGroupName, String name, String vnetName, String routeName); - - /** - * Delete a Virtual Network route in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param vnetName Name of the Virtual Network. - * @param routeName Name of the Virtual Network route. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteVnetRouteAsync(String resourceGroupName, String name, String vnetName, String routeName); - - /** - * Delete a Virtual Network route in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param vnetName Name of the Virtual Network. - * @param routeName Name of the Virtual Network route. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deleteVnetRoute(String resourceGroupName, String name, String vnetName, String routeName); - - /** - * Delete a Virtual Network route in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param vnetName Name of the Virtual Network. - * @param routeName Name of the Virtual Network route. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteVnetRouteWithResponse( - String resourceGroupName, String name, String vnetName, String routeName, Context context); - - /** - * Create or update a Virtual Network route in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param vnetName Name of the Virtual Network. - * @param routeName Name of the Virtual Network route. - * @param route Definition of the Virtual Network route. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network route contract used to pass routing information for a Virtual Network. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateVnetRouteWithResponseAsync( - String resourceGroupName, String name, String vnetName, String routeName, VnetRouteInner route); - - /** - * Create or update a Virtual Network route in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param vnetName Name of the Virtual Network. - * @param routeName Name of the Virtual Network route. - * @param route Definition of the Virtual Network route. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network route contract used to pass routing information for a Virtual Network. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateVnetRouteAsync( - String resourceGroupName, String name, String vnetName, String routeName, VnetRouteInner route); - - /** - * Create or update a Virtual Network route in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param vnetName Name of the Virtual Network. - * @param routeName Name of the Virtual Network route. - * @param route Definition of the Virtual Network route. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network route contract used to pass routing information for a Virtual Network. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VnetRouteInner updateVnetRoute( - String resourceGroupName, String name, String vnetName, String routeName, VnetRouteInner route); - - /** - * Create or update a Virtual Network route in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param vnetName Name of the Virtual Network. - * @param routeName Name of the Virtual Network route. - * @param route Definition of the Virtual Network route. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network route contract used to pass routing information for a Virtual Network. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateVnetRouteWithResponse( - String resourceGroupName, - String name, - String vnetName, - String routeName, - VnetRouteInner route, - Context context); - - /** - * Reboot a worker machine in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param workerName Name of worker machine, which typically starts with RD. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> rebootWorkerWithResponseAsync(String resourceGroupName, String name, String workerName); - - /** - * Reboot a worker machine in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param workerName Name of worker machine, which typically starts with RD. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono rebootWorkerAsync(String resourceGroupName, String name, String workerName); - - /** - * Reboot a worker machine in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param workerName Name of worker machine, which typically starts with RD. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void rebootWorker(String resourceGroupName, String name, String workerName); - - /** - * Reboot a worker machine in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param workerName Name of worker machine, which typically starts with RD. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response rebootWorkerWithResponse(String resourceGroupName, String name, String workerName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/CertificateRegistrationProvidersClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/CertificateRegistrationProvidersClient.java deleted file mode 100644 index 0df12bba56ba..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/CertificateRegistrationProvidersClient.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.appservice.fluent.models.CsmOperationDescriptionInner; - -/** - * An instance of this class provides access to all the operations defined in CertificateRegistrationProvidersClient. - */ -public interface CertificateRegistrationProvidersClient { - /** - * Implements Csm operations Api to exposes the list of available Csm Apis under the resource provider. - * - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Azure resource manager operation metadata. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listOperationsAsync(); - - /** - * Implements Csm operations Api to exposes the list of available Csm Apis under the resource provider. - * - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Azure resource manager operation metadata. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listOperations(); - - /** - * Implements Csm operations Api to exposes the list of available Csm Apis under the resource provider. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Azure resource manager operation metadata. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listOperations(Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/CertificatesClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/CertificatesClient.java deleted file mode 100644 index 9fdbe4b97dd0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/CertificatesClient.java +++ /dev/null @@ -1,334 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.appservice.fluent.models.CertificateInner; -import com.azure.resourcemanager.appservice.models.CertificatePatchResource; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in CertificatesClient. */ -public interface CertificatesClient - extends InnerSupportsGet, InnerSupportsListing, InnerSupportsDelete { - /** - * Get all certificates for a subscription. - * - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all certificates for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Get all certificates for a subscription. - * - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all certificates for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Get all certificates for a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all certificates for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Get all certificates in a resource group. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all certificates in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName); - - /** - * Get all certificates in a resource group. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all certificates in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Get all certificates in a resource group. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all certificates in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * Get a certificate. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the certificate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a certificate. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String name); - - /** - * Get a certificate. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the certificate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a certificate. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync(String resourceGroupName, String name); - - /** - * Get a certificate. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the certificate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a certificate. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - CertificateInner getByResourceGroup(String resourceGroupName, String name); - - /** - * Get a certificate. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the certificate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a certificate. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); - - /** - * Create or update a certificate. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the certificate. - * @param certificateEnvelope Details of certificate, if it exists already. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sSL certificate for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String name, CertificateInner certificateEnvelope); - - /** - * Create or update a certificate. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the certificate. - * @param certificateEnvelope Details of certificate, if it exists already. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sSL certificate for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, String name, CertificateInner certificateEnvelope); - - /** - * Create or update a certificate. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the certificate. - * @param certificateEnvelope Details of certificate, if it exists already. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sSL certificate for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - CertificateInner createOrUpdate(String resourceGroupName, String name, CertificateInner certificateEnvelope); - - /** - * Create or update a certificate. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the certificate. - * @param certificateEnvelope Details of certificate, if it exists already. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sSL certificate for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, String name, CertificateInner certificateEnvelope, Context context); - - /** - * Delete a certificate. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the certificate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteWithResponseAsync(String resourceGroupName, String name); - - /** - * Delete a certificate. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the certificate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String name); - - /** - * Delete a certificate. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the certificate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String name); - - /** - * Delete a certificate. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the certificate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String name, Context context); - - /** - * Create or update a certificate. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the certificate. - * @param certificateEnvelope Details of certificate, if it exists already. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sSL certificate for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateWithResponseAsync( - String resourceGroupName, String name, CertificatePatchResource certificateEnvelope); - - /** - * Create or update a certificate. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the certificate. - * @param certificateEnvelope Details of certificate, if it exists already. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sSL certificate for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAsync( - String resourceGroupName, String name, CertificatePatchResource certificateEnvelope); - - /** - * Create or update a certificate. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the certificate. - * @param certificateEnvelope Details of certificate, if it exists already. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sSL certificate for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - CertificateInner update(String resourceGroupName, String name, CertificatePatchResource certificateEnvelope); - - /** - * Create or update a certificate. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the certificate. - * @param certificateEnvelope Details of certificate, if it exists already. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sSL certificate for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String resourceGroupName, String name, CertificatePatchResource certificateEnvelope, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/DeletedWebAppsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/DeletedWebAppsClient.java deleted file mode 100644 index bcac4bf0b2bb..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/DeletedWebAppsClient.java +++ /dev/null @@ -1,150 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.appservice.fluent.models.DeletedSiteInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in DeletedWebAppsClient. */ -public interface DeletedWebAppsClient { - /** - * Get all deleted apps for a subscription. - * - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deleted apps for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Get all deleted apps for a subscription. - * - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deleted apps for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Get all deleted apps for a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deleted apps for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Get all deleted apps for a subscription at location. - * - * @param location The location parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deleted apps for a subscription at location. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByLocationAsync(String location); - - /** - * Get all deleted apps for a subscription at location. - * - * @param location The location parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deleted apps for a subscription at location. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByLocation(String location); - - /** - * Get all deleted apps for a subscription at location. - * - * @param location The location parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deleted apps for a subscription at location. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByLocation(String location, Context context); - - /** - * Get deleted app for a subscription at location. - * - * @param location The location parameter. - * @param deletedSiteId The numeric ID of the deleted app, e.g. 12345. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deleted app for a subscription at location. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getDeletedWebAppByLocationWithResponseAsync(String location, String deletedSiteId); - - /** - * Get deleted app for a subscription at location. - * - * @param location The location parameter. - * @param deletedSiteId The numeric ID of the deleted app, e.g. 12345. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deleted app for a subscription at location. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getDeletedWebAppByLocationAsync(String location, String deletedSiteId); - - /** - * Get deleted app for a subscription at location. - * - * @param location The location parameter. - * @param deletedSiteId The numeric ID of the deleted app, e.g. 12345. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deleted app for a subscription at location. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DeletedSiteInner getDeletedWebAppByLocation(String location, String deletedSiteId); - - /** - * Get deleted app for a subscription at location. - * - * @param location The location parameter. - * @param deletedSiteId The numeric ID of the deleted app, e.g. 12345. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deleted app for a subscription at location. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getDeletedWebAppByLocationWithResponse( - String location, String deletedSiteId, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/DiagnosticsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/DiagnosticsClient.java deleted file mode 100644 index 9d88737e4785..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/DiagnosticsClient.java +++ /dev/null @@ -1,1646 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.appservice.fluent.models.AnalysisDefinitionInner; -import com.azure.resourcemanager.appservice.fluent.models.DetectorDefinitionInner; -import com.azure.resourcemanager.appservice.fluent.models.DetectorResponseInner; -import com.azure.resourcemanager.appservice.fluent.models.DiagnosticAnalysisInner; -import com.azure.resourcemanager.appservice.fluent.models.DiagnosticCategoryInner; -import com.azure.resourcemanager.appservice.fluent.models.DiagnosticDetectorResponseInner; -import java.time.OffsetDateTime; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in DiagnosticsClient. */ -public interface DiagnosticsClient { - /** - * List Hosting Environment Detector Responses. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of detector responses. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listHostingEnvironmentDetectorResponsesAsync( - String resourceGroupName, String name); - - /** - * List Hosting Environment Detector Responses. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of detector responses. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listHostingEnvironmentDetectorResponses(String resourceGroupName, String name); - - /** - * List Hosting Environment Detector Responses. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of detector responses. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listHostingEnvironmentDetectorResponses( - String resourceGroupName, String name, Context context); - - /** - * Get Hosting Environment Detector Response. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name App Service Environment Name. - * @param detectorName Detector Resource Name. - * @param startTime Start Time. - * @param endTime End Time. - * @param timeGrain Time Grain. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hosting Environment Detector Response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getHostingEnvironmentDetectorResponseWithResponseAsync( - String resourceGroupName, - String name, - String detectorName, - OffsetDateTime startTime, - OffsetDateTime endTime, - String timeGrain); - - /** - * Get Hosting Environment Detector Response. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name App Service Environment Name. - * @param detectorName Detector Resource Name. - * @param startTime Start Time. - * @param endTime End Time. - * @param timeGrain Time Grain. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hosting Environment Detector Response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getHostingEnvironmentDetectorResponseAsync( - String resourceGroupName, - String name, - String detectorName, - OffsetDateTime startTime, - OffsetDateTime endTime, - String timeGrain); - - /** - * Get Hosting Environment Detector Response. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name App Service Environment Name. - * @param detectorName Detector Resource Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hosting Environment Detector Response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getHostingEnvironmentDetectorResponseAsync( - String resourceGroupName, String name, String detectorName); - - /** - * Get Hosting Environment Detector Response. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name App Service Environment Name. - * @param detectorName Detector Resource Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hosting Environment Detector Response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DetectorResponseInner getHostingEnvironmentDetectorResponse( - String resourceGroupName, String name, String detectorName); - - /** - * Get Hosting Environment Detector Response. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name App Service Environment Name. - * @param detectorName Detector Resource Name. - * @param startTime Start Time. - * @param endTime End Time. - * @param timeGrain Time Grain. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hosting Environment Detector Response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getHostingEnvironmentDetectorResponseWithResponse( - String resourceGroupName, - String name, - String detectorName, - OffsetDateTime startTime, - OffsetDateTime endTime, - String timeGrain, - Context context); - - /** - * List Site Detector Responses. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of detector responses. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listSiteDetectorResponsesAsync(String resourceGroupName, String siteName); - - /** - * List Site Detector Responses. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of detector responses. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listSiteDetectorResponses(String resourceGroupName, String siteName); - - /** - * List Site Detector Responses. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of detector responses. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listSiteDetectorResponses( - String resourceGroupName, String siteName, Context context); - - /** - * Get site detector response. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param detectorName Detector Resource Name. - * @param startTime Start Time. - * @param endTime End Time. - * @param timeGrain Time Grain. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site detector response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getSiteDetectorResponseWithResponseAsync( - String resourceGroupName, - String siteName, - String detectorName, - OffsetDateTime startTime, - OffsetDateTime endTime, - String timeGrain); - - /** - * Get site detector response. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param detectorName Detector Resource Name. - * @param startTime Start Time. - * @param endTime End Time. - * @param timeGrain Time Grain. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site detector response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getSiteDetectorResponseAsync( - String resourceGroupName, - String siteName, - String detectorName, - OffsetDateTime startTime, - OffsetDateTime endTime, - String timeGrain); - - /** - * Get site detector response. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param detectorName Detector Resource Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site detector response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getSiteDetectorResponseAsync( - String resourceGroupName, String siteName, String detectorName); - - /** - * Get site detector response. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param detectorName Detector Resource Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site detector response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DetectorResponseInner getSiteDetectorResponse(String resourceGroupName, String siteName, String detectorName); - - /** - * Get site detector response. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param detectorName Detector Resource Name. - * @param startTime Start Time. - * @param endTime End Time. - * @param timeGrain Time Grain. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site detector response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getSiteDetectorResponseWithResponse( - String resourceGroupName, - String siteName, - String detectorName, - OffsetDateTime startTime, - OffsetDateTime endTime, - String timeGrain, - Context context); - - /** - * Get Diagnostics Categories. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return diagnostics Categories. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listSiteDiagnosticCategoriesAsync(String resourceGroupName, String siteName); - - /** - * Get Diagnostics Categories. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return diagnostics Categories. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listSiteDiagnosticCategories(String resourceGroupName, String siteName); - - /** - * Get Diagnostics Categories. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return diagnostics Categories. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listSiteDiagnosticCategories( - String resourceGroupName, String siteName, Context context); - - /** - * Get Diagnostics Category. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return diagnostics Category. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getSiteDiagnosticCategoryWithResponseAsync( - String resourceGroupName, String siteName, String diagnosticCategory); - - /** - * Get Diagnostics Category. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return diagnostics Category. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getSiteDiagnosticCategoryAsync( - String resourceGroupName, String siteName, String diagnosticCategory); - - /** - * Get Diagnostics Category. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return diagnostics Category. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DiagnosticCategoryInner getSiteDiagnosticCategory( - String resourceGroupName, String siteName, String diagnosticCategory); - - /** - * Get Diagnostics Category. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return diagnostics Category. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getSiteDiagnosticCategoryWithResponse( - String resourceGroupName, String siteName, String diagnosticCategory, Context context); - - /** - * Get Site Analyses. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Analyses. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listSiteAnalysesAsync( - String resourceGroupName, String siteName, String diagnosticCategory); - - /** - * Get Site Analyses. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Analyses. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listSiteAnalyses( - String resourceGroupName, String siteName, String diagnosticCategory); - - /** - * Get Site Analyses. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Analyses. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listSiteAnalyses( - String resourceGroupName, String siteName, String diagnosticCategory, Context context); - - /** - * Get Site Analysis. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @param analysisName Analysis Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Analysis. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getSiteAnalysisWithResponseAsync( - String resourceGroupName, String siteName, String diagnosticCategory, String analysisName); - - /** - * Get Site Analysis. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @param analysisName Analysis Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Analysis. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getSiteAnalysisAsync( - String resourceGroupName, String siteName, String diagnosticCategory, String analysisName); - - /** - * Get Site Analysis. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @param analysisName Analysis Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Analysis. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DiagnosticAnalysisInner getSiteAnalysis( - String resourceGroupName, String siteName, String diagnosticCategory, String analysisName); - - /** - * Get Site Analysis. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @param analysisName Analysis Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Analysis. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getSiteAnalysisWithResponse( - String resourceGroupName, String siteName, String diagnosticCategory, String analysisName, Context context); - - /** - * Execute Analysis. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Category Name. - * @param analysisName Analysis Resource Name. - * @param startTime Start Time. - * @param endTime End Time. - * @param timeGrain Time Grain. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class representing a diagnostic analysis done on an application. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> executeSiteAnalysisWithResponseAsync( - String resourceGroupName, - String siteName, - String diagnosticCategory, - String analysisName, - OffsetDateTime startTime, - OffsetDateTime endTime, - String timeGrain); - - /** - * Execute Analysis. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Category Name. - * @param analysisName Analysis Resource Name. - * @param startTime Start Time. - * @param endTime End Time. - * @param timeGrain Time Grain. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class representing a diagnostic analysis done on an application. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono executeSiteAnalysisAsync( - String resourceGroupName, - String siteName, - String diagnosticCategory, - String analysisName, - OffsetDateTime startTime, - OffsetDateTime endTime, - String timeGrain); - - /** - * Execute Analysis. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Category Name. - * @param analysisName Analysis Resource Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class representing a diagnostic analysis done on an application. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono executeSiteAnalysisAsync( - String resourceGroupName, String siteName, String diagnosticCategory, String analysisName); - - /** - * Execute Analysis. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Category Name. - * @param analysisName Analysis Resource Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class representing a diagnostic analysis done on an application. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DiagnosticAnalysisInner executeSiteAnalysis( - String resourceGroupName, String siteName, String diagnosticCategory, String analysisName); - - /** - * Execute Analysis. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Category Name. - * @param analysisName Analysis Resource Name. - * @param startTime Start Time. - * @param endTime End Time. - * @param timeGrain Time Grain. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class representing a diagnostic analysis done on an application. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response executeSiteAnalysisWithResponse( - String resourceGroupName, - String siteName, - String diagnosticCategory, - String analysisName, - OffsetDateTime startTime, - OffsetDateTime endTime, - String timeGrain, - Context context); - - /** - * Get Detectors. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return detectors. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listSiteDetectorsAsync( - String resourceGroupName, String siteName, String diagnosticCategory); - - /** - * Get Detectors. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return detectors. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listSiteDetectors( - String resourceGroupName, String siteName, String diagnosticCategory); - - /** - * Get Detectors. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return detectors. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listSiteDetectors( - String resourceGroupName, String siteName, String diagnosticCategory, Context context); - - /** - * Get Detector. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @param detectorName Detector Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return detector. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux getSiteDetectorAsync( - String resourceGroupName, String siteName, String diagnosticCategory, String detectorName); - - /** - * Get Detector. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @param detectorName Detector Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return detector. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable getSiteDetector( - String resourceGroupName, String siteName, String diagnosticCategory, String detectorName); - - /** - * Get Detector. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @param detectorName Detector Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return detector. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable getSiteDetector( - String resourceGroupName, String siteName, String diagnosticCategory, String detectorName, Context context); - - /** - * Execute Detector. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param detectorName Detector Resource Name. - * @param diagnosticCategory Category Name. - * @param startTime Start Time. - * @param endTime End Time. - * @param timeGrain Time Grain. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class representing Response from Diagnostic Detectors. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> executeSiteDetectorWithResponseAsync( - String resourceGroupName, - String siteName, - String detectorName, - String diagnosticCategory, - OffsetDateTime startTime, - OffsetDateTime endTime, - String timeGrain); - - /** - * Execute Detector. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param detectorName Detector Resource Name. - * @param diagnosticCategory Category Name. - * @param startTime Start Time. - * @param endTime End Time. - * @param timeGrain Time Grain. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class representing Response from Diagnostic Detectors. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono executeSiteDetectorAsync( - String resourceGroupName, - String siteName, - String detectorName, - String diagnosticCategory, - OffsetDateTime startTime, - OffsetDateTime endTime, - String timeGrain); - - /** - * Execute Detector. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param detectorName Detector Resource Name. - * @param diagnosticCategory Category Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class representing Response from Diagnostic Detectors. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono executeSiteDetectorAsync( - String resourceGroupName, String siteName, String detectorName, String diagnosticCategory); - - /** - * Execute Detector. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param detectorName Detector Resource Name. - * @param diagnosticCategory Category Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class representing Response from Diagnostic Detectors. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DiagnosticDetectorResponseInner executeSiteDetector( - String resourceGroupName, String siteName, String detectorName, String diagnosticCategory); - - /** - * Execute Detector. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param detectorName Detector Resource Name. - * @param diagnosticCategory Category Name. - * @param startTime Start Time. - * @param endTime End Time. - * @param timeGrain Time Grain. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class representing Response from Diagnostic Detectors. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response executeSiteDetectorWithResponse( - String resourceGroupName, - String siteName, - String detectorName, - String diagnosticCategory, - OffsetDateTime startTime, - OffsetDateTime endTime, - String timeGrain, - Context context); - - /** - * List Site Detector Responses. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param slot Slot Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of detector responses. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listSiteDetectorResponsesSlotAsync( - String resourceGroupName, String siteName, String slot); - - /** - * List Site Detector Responses. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param slot Slot Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of detector responses. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listSiteDetectorResponsesSlot( - String resourceGroupName, String siteName, String slot); - - /** - * List Site Detector Responses. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param slot Slot Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of detector responses. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listSiteDetectorResponsesSlot( - String resourceGroupName, String siteName, String slot, Context context); - - /** - * Get site detector response. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param detectorName Detector Resource Name. - * @param slot Slot Name. - * @param startTime Start Time. - * @param endTime End Time. - * @param timeGrain Time Grain. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site detector response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getSiteDetectorResponseSlotWithResponseAsync( - String resourceGroupName, - String siteName, - String detectorName, - String slot, - OffsetDateTime startTime, - OffsetDateTime endTime, - String timeGrain); - - /** - * Get site detector response. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param detectorName Detector Resource Name. - * @param slot Slot Name. - * @param startTime Start Time. - * @param endTime End Time. - * @param timeGrain Time Grain. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site detector response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getSiteDetectorResponseSlotAsync( - String resourceGroupName, - String siteName, - String detectorName, - String slot, - OffsetDateTime startTime, - OffsetDateTime endTime, - String timeGrain); - - /** - * Get site detector response. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param detectorName Detector Resource Name. - * @param slot Slot Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site detector response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getSiteDetectorResponseSlotAsync( - String resourceGroupName, String siteName, String detectorName, String slot); - - /** - * Get site detector response. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param detectorName Detector Resource Name. - * @param slot Slot Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site detector response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DetectorResponseInner getSiteDetectorResponseSlot( - String resourceGroupName, String siteName, String detectorName, String slot); - - /** - * Get site detector response. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param detectorName Detector Resource Name. - * @param slot Slot Name. - * @param startTime Start Time. - * @param endTime End Time. - * @param timeGrain Time Grain. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site detector response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getSiteDetectorResponseSlotWithResponse( - String resourceGroupName, - String siteName, - String detectorName, - String slot, - OffsetDateTime startTime, - OffsetDateTime endTime, - String timeGrain, - Context context); - - /** - * Get Diagnostics Categories. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param slot Slot Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return diagnostics Categories. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listSiteDiagnosticCategoriesSlotAsync( - String resourceGroupName, String siteName, String slot); - - /** - * Get Diagnostics Categories. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param slot Slot Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return diagnostics Categories. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listSiteDiagnosticCategoriesSlot( - String resourceGroupName, String siteName, String slot); - - /** - * Get Diagnostics Categories. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param slot Slot Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return diagnostics Categories. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listSiteDiagnosticCategoriesSlot( - String resourceGroupName, String siteName, String slot, Context context); - - /** - * Get Diagnostics Category. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @param slot Slot Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return diagnostics Category. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getSiteDiagnosticCategorySlotWithResponseAsync( - String resourceGroupName, String siteName, String diagnosticCategory, String slot); - - /** - * Get Diagnostics Category. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @param slot Slot Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return diagnostics Category. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getSiteDiagnosticCategorySlotAsync( - String resourceGroupName, String siteName, String diagnosticCategory, String slot); - - /** - * Get Diagnostics Category. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @param slot Slot Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return diagnostics Category. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DiagnosticCategoryInner getSiteDiagnosticCategorySlot( - String resourceGroupName, String siteName, String diagnosticCategory, String slot); - - /** - * Get Diagnostics Category. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @param slot Slot Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return diagnostics Category. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getSiteDiagnosticCategorySlotWithResponse( - String resourceGroupName, String siteName, String diagnosticCategory, String slot, Context context); - - /** - * Get Site Analyses. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @param slot Slot Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Analyses. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listSiteAnalysesSlotAsync( - String resourceGroupName, String siteName, String diagnosticCategory, String slot); - - /** - * Get Site Analyses. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @param slot Slot Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Analyses. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listSiteAnalysesSlot( - String resourceGroupName, String siteName, String diagnosticCategory, String slot); - - /** - * Get Site Analyses. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @param slot Slot Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Analyses. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listSiteAnalysesSlot( - String resourceGroupName, String siteName, String diagnosticCategory, String slot, Context context); - - /** - * Get Site Analysis. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @param analysisName Analysis Name. - * @param slot Slot - optional. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Analysis. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getSiteAnalysisSlotWithResponseAsync( - String resourceGroupName, String siteName, String diagnosticCategory, String analysisName, String slot); - - /** - * Get Site Analysis. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @param analysisName Analysis Name. - * @param slot Slot - optional. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Analysis. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getSiteAnalysisSlotAsync( - String resourceGroupName, String siteName, String diagnosticCategory, String analysisName, String slot); - - /** - * Get Site Analysis. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @param analysisName Analysis Name. - * @param slot Slot - optional. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Analysis. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DiagnosticAnalysisInner getSiteAnalysisSlot( - String resourceGroupName, String siteName, String diagnosticCategory, String analysisName, String slot); - - /** - * Get Site Analysis. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @param analysisName Analysis Name. - * @param slot Slot - optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Analysis. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getSiteAnalysisSlotWithResponse( - String resourceGroupName, - String siteName, - String diagnosticCategory, - String analysisName, - String slot, - Context context); - - /** - * Execute Analysis. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Category Name. - * @param analysisName Analysis Resource Name. - * @param slot Slot Name. - * @param startTime Start Time. - * @param endTime End Time. - * @param timeGrain Time Grain. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class representing a diagnostic analysis done on an application. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> executeSiteAnalysisSlotWithResponseAsync( - String resourceGroupName, - String siteName, - String diagnosticCategory, - String analysisName, - String slot, - OffsetDateTime startTime, - OffsetDateTime endTime, - String timeGrain); - - /** - * Execute Analysis. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Category Name. - * @param analysisName Analysis Resource Name. - * @param slot Slot Name. - * @param startTime Start Time. - * @param endTime End Time. - * @param timeGrain Time Grain. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class representing a diagnostic analysis done on an application. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono executeSiteAnalysisSlotAsync( - String resourceGroupName, - String siteName, - String diagnosticCategory, - String analysisName, - String slot, - OffsetDateTime startTime, - OffsetDateTime endTime, - String timeGrain); - - /** - * Execute Analysis. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Category Name. - * @param analysisName Analysis Resource Name. - * @param slot Slot Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class representing a diagnostic analysis done on an application. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono executeSiteAnalysisSlotAsync( - String resourceGroupName, String siteName, String diagnosticCategory, String analysisName, String slot); - - /** - * Execute Analysis. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Category Name. - * @param analysisName Analysis Resource Name. - * @param slot Slot Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class representing a diagnostic analysis done on an application. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DiagnosticAnalysisInner executeSiteAnalysisSlot( - String resourceGroupName, String siteName, String diagnosticCategory, String analysisName, String slot); - - /** - * Execute Analysis. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Category Name. - * @param analysisName Analysis Resource Name. - * @param slot Slot Name. - * @param startTime Start Time. - * @param endTime End Time. - * @param timeGrain Time Grain. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class representing a diagnostic analysis done on an application. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response executeSiteAnalysisSlotWithResponse( - String resourceGroupName, - String siteName, - String diagnosticCategory, - String analysisName, - String slot, - OffsetDateTime startTime, - OffsetDateTime endTime, - String timeGrain, - Context context); - - /** - * Get Detectors. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @param slot Slot Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return detectors. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listSiteDetectorsSlotAsync( - String resourceGroupName, String siteName, String diagnosticCategory, String slot); - - /** - * Get Detectors. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @param slot Slot Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return detectors. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listSiteDetectorsSlot( - String resourceGroupName, String siteName, String diagnosticCategory, String slot); - - /** - * Get Detectors. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @param slot Slot Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return detectors. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listSiteDetectorsSlot( - String resourceGroupName, String siteName, String diagnosticCategory, String slot, Context context); - - /** - * Get Detector. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @param detectorName Detector Name. - * @param slot Slot Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return detector. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux getSiteDetectorSlotAsync( - String resourceGroupName, String siteName, String diagnosticCategory, String detectorName, String slot); - - /** - * Get Detector. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @param detectorName Detector Name. - * @param slot Slot Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return detector. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable getSiteDetectorSlot( - String resourceGroupName, String siteName, String diagnosticCategory, String detectorName, String slot); - - /** - * Get Detector. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @param detectorName Detector Name. - * @param slot Slot Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return detector. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable getSiteDetectorSlot( - String resourceGroupName, - String siteName, - String diagnosticCategory, - String detectorName, - String slot, - Context context); - - /** - * Execute Detector. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param detectorName Detector Resource Name. - * @param diagnosticCategory Category Name. - * @param slot Slot Name. - * @param startTime Start Time. - * @param endTime End Time. - * @param timeGrain Time Grain. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class representing Response from Diagnostic Detectors. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> executeSiteDetectorSlotWithResponseAsync( - String resourceGroupName, - String siteName, - String detectorName, - String diagnosticCategory, - String slot, - OffsetDateTime startTime, - OffsetDateTime endTime, - String timeGrain); - - /** - * Execute Detector. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param detectorName Detector Resource Name. - * @param diagnosticCategory Category Name. - * @param slot Slot Name. - * @param startTime Start Time. - * @param endTime End Time. - * @param timeGrain Time Grain. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class representing Response from Diagnostic Detectors. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono executeSiteDetectorSlotAsync( - String resourceGroupName, - String siteName, - String detectorName, - String diagnosticCategory, - String slot, - OffsetDateTime startTime, - OffsetDateTime endTime, - String timeGrain); - - /** - * Execute Detector. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param detectorName Detector Resource Name. - * @param diagnosticCategory Category Name. - * @param slot Slot Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class representing Response from Diagnostic Detectors. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono executeSiteDetectorSlotAsync( - String resourceGroupName, String siteName, String detectorName, String diagnosticCategory, String slot); - - /** - * Execute Detector. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param detectorName Detector Resource Name. - * @param diagnosticCategory Category Name. - * @param slot Slot Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class representing Response from Diagnostic Detectors. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DiagnosticDetectorResponseInner executeSiteDetectorSlot( - String resourceGroupName, String siteName, String detectorName, String diagnosticCategory, String slot); - - /** - * Execute Detector. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param detectorName Detector Resource Name. - * @param diagnosticCategory Category Name. - * @param slot Slot Name. - * @param startTime Start Time. - * @param endTime End Time. - * @param timeGrain Time Grain. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class representing Response from Diagnostic Detectors. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response executeSiteDetectorSlotWithResponse( - String resourceGroupName, - String siteName, - String detectorName, - String diagnosticCategory, - String slot, - OffsetDateTime startTime, - OffsetDateTime endTime, - String timeGrain, - Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/DomainRegistrationProvidersClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/DomainRegistrationProvidersClient.java deleted file mode 100644 index 4c613d5ef321..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/DomainRegistrationProvidersClient.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.appservice.fluent.models.CsmOperationDescriptionInner; - -/** An instance of this class provides access to all the operations defined in DomainRegistrationProvidersClient. */ -public interface DomainRegistrationProvidersClient { - /** - * Implements Csm operations Api to exposes the list of available Csm Apis under the resource provider. - * - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Azure resource manager operation metadata. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listOperationsAsync(); - - /** - * Implements Csm operations Api to exposes the list of available Csm Apis under the resource provider. - * - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Azure resource manager operation metadata. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listOperations(); - - /** - * Implements Csm operations Api to exposes the list of available Csm Apis under the resource provider. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Azure resource manager operation metadata. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listOperations(Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/DomainsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/DomainsClient.java deleted file mode 100644 index c20248a5df5b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/DomainsClient.java +++ /dev/null @@ -1,936 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.appservice.fluent.models.DomainAvailablilityCheckResultInner; -import com.azure.resourcemanager.appservice.fluent.models.DomainControlCenterSsoRequestInner; -import com.azure.resourcemanager.appservice.fluent.models.DomainInner; -import com.azure.resourcemanager.appservice.fluent.models.DomainOwnershipIdentifierInner; -import com.azure.resourcemanager.appservice.fluent.models.NameIdentifierInner; -import com.azure.resourcemanager.appservice.models.DomainPatchResource; -import com.azure.resourcemanager.appservice.models.DomainRecommendationSearchParameters; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in DomainsClient. */ -public interface DomainsClient - extends InnerSupportsGet, InnerSupportsListing, InnerSupportsDelete { - /** - * Check if a domain is available for registration. - * - * @param identifier Name of the domain. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return domain availability check result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> checkAvailabilityWithResponseAsync( - NameIdentifierInner identifier); - - /** - * Check if a domain is available for registration. - * - * @param identifier Name of the domain. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return domain availability check result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono checkAvailabilityAsync(NameIdentifierInner identifier); - - /** - * Check if a domain is available for registration. - * - * @param identifier Name of the domain. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return domain availability check result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DomainAvailablilityCheckResultInner checkAvailability(NameIdentifierInner identifier); - - /** - * Check if a domain is available for registration. - * - * @param identifier Name of the domain. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return domain availability check result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response checkAvailabilityWithResponse( - NameIdentifierInner identifier, Context context); - - /** - * Get all domains in a subscription. - * - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all domains in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Get all domains in a subscription. - * - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all domains in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Get all domains in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all domains in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Generate a single sign-on request for the domain management portal. - * - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single sign-on request information for domain management. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getControlCenterSsoRequestWithResponseAsync(); - - /** - * Generate a single sign-on request for the domain management portal. - * - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single sign-on request information for domain management. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getControlCenterSsoRequestAsync(); - - /** - * Generate a single sign-on request for the domain management portal. - * - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single sign-on request information for domain management. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DomainControlCenterSsoRequestInner getControlCenterSsoRequest(); - - /** - * Generate a single sign-on request for the domain management portal. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single sign-on request information for domain management. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getControlCenterSsoRequestWithResponse(Context context); - - /** - * Get domain name recommendations based on keywords. - * - * @param parameters Search parameters for domain name recommendations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return domain name recommendations based on keywords. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listRecommendationsAsync(DomainRecommendationSearchParameters parameters); - - /** - * Get domain name recommendations based on keywords. - * - * @param parameters Search parameters for domain name recommendations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return domain name recommendations based on keywords. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listRecommendations(DomainRecommendationSearchParameters parameters); - - /** - * Get domain name recommendations based on keywords. - * - * @param parameters Search parameters for domain name recommendations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return domain name recommendations based on keywords. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listRecommendations( - DomainRecommendationSearchParameters parameters, Context context); - - /** - * Get all domains in a resource group. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all domains in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName); - - /** - * Get all domains in a resource group. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all domains in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Get all domains in a resource group. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all domains in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * Get a domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of the domain. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a domain. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String domainName); - - /** - * Get a domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of the domain. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a domain. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync(String resourceGroupName, String domainName); - - /** - * Get a domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of the domain. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a domain. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DomainInner getByResourceGroup(String resourceGroupName, String domainName); - - /** - * Get a domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of the domain. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a domain. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse(String resourceGroupName, String domainName, Context context); - - /** - * Creates or updates a domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of the domain. - * @param domain Domain registration information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a domain. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String domainName, DomainInner domain); - - /** - * Creates or updates a domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of the domain. - * @param domain Domain registration information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a domain. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, DomainInner> beginCreateOrUpdateAsync( - String resourceGroupName, String domainName, DomainInner domain); - - /** - * Creates or updates a domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of the domain. - * @param domain Domain registration information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a domain. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, DomainInner> beginCreateOrUpdate( - String resourceGroupName, String domainName, DomainInner domain); - - /** - * Creates or updates a domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of the domain. - * @param domain Domain registration information. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a domain. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, DomainInner> beginCreateOrUpdate( - String resourceGroupName, String domainName, DomainInner domain, Context context); - - /** - * Creates or updates a domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of the domain. - * @param domain Domain registration information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a domain. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync(String resourceGroupName, String domainName, DomainInner domain); - - /** - * Creates or updates a domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of the domain. - * @param domain Domain registration information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a domain. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DomainInner createOrUpdate(String resourceGroupName, String domainName, DomainInner domain); - - /** - * Creates or updates a domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of the domain. - * @param domain Domain registration information. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a domain. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DomainInner createOrUpdate(String resourceGroupName, String domainName, DomainInner domain, Context context); - - /** - * Delete a domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of the domain. - * @param forceHardDeleteDomain Specify <code>true</code> to delete the domain immediately. The default - * is <code>false</code> which deletes the domain after 24 hours. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteWithResponseAsync( - String resourceGroupName, String domainName, Boolean forceHardDeleteDomain); - - /** - * Delete a domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of the domain. - * @param forceHardDeleteDomain Specify <code>true</code> to delete the domain immediately. The default - * is <code>false</code> which deletes the domain after 24 hours. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String domainName, Boolean forceHardDeleteDomain); - - /** - * Delete a domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of the domain. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String domainName); - - /** - * Delete a domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of the domain. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String domainName); - - /** - * Delete a domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of the domain. - * @param forceHardDeleteDomain Specify <code>true</code> to delete the domain immediately. The default - * is <code>false</code> which deletes the domain after 24 hours. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse( - String resourceGroupName, String domainName, Boolean forceHardDeleteDomain, Context context); - - /** - * Creates or updates a domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of the domain. - * @param domain Domain registration information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a domain. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateWithResponseAsync( - String resourceGroupName, String domainName, DomainPatchResource domain); - - /** - * Creates or updates a domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of the domain. - * @param domain Domain registration information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a domain. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAsync(String resourceGroupName, String domainName, DomainPatchResource domain); - - /** - * Creates or updates a domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of the domain. - * @param domain Domain registration information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a domain. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DomainInner update(String resourceGroupName, String domainName, DomainPatchResource domain); - - /** - * Creates or updates a domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of the domain. - * @param domain Domain registration information. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a domain. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String resourceGroupName, String domainName, DomainPatchResource domain, Context context); - - /** - * Lists domain ownership identifiers. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of domain. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of domain ownership identifiers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listOwnershipIdentifiersAsync( - String resourceGroupName, String domainName); - - /** - * Lists domain ownership identifiers. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of domain. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of domain ownership identifiers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listOwnershipIdentifiers(String resourceGroupName, String domainName); - - /** - * Lists domain ownership identifiers. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of domain. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of domain ownership identifiers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listOwnershipIdentifiers( - String resourceGroupName, String domainName, Context context); - - /** - * Get ownership identifier for domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of domain. - * @param name Name of identifier. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ownership identifier for domain. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getOwnershipIdentifierWithResponseAsync( - String resourceGroupName, String domainName, String name); - - /** - * Get ownership identifier for domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of domain. - * @param name Name of identifier. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ownership identifier for domain. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getOwnershipIdentifierAsync( - String resourceGroupName, String domainName, String name); - - /** - * Get ownership identifier for domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of domain. - * @param name Name of identifier. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ownership identifier for domain. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DomainOwnershipIdentifierInner getOwnershipIdentifier(String resourceGroupName, String domainName, String name); - - /** - * Get ownership identifier for domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of domain. - * @param name Name of identifier. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ownership identifier for domain. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getOwnershipIdentifierWithResponse( - String resourceGroupName, String domainName, String name, Context context); - - /** - * Creates an ownership identifier for a domain or updates identifier details for an existing identifier. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of domain. - * @param name Name of identifier. - * @param domainOwnershipIdentifier A JSON representation of the domain ownership properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return domain ownership Identifier. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createOrUpdateOwnershipIdentifierWithResponseAsync( - String resourceGroupName, - String domainName, - String name, - DomainOwnershipIdentifierInner domainOwnershipIdentifier); - - /** - * Creates an ownership identifier for a domain or updates identifier details for an existing identifier. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of domain. - * @param name Name of identifier. - * @param domainOwnershipIdentifier A JSON representation of the domain ownership properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return domain ownership Identifier. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateOwnershipIdentifierAsync( - String resourceGroupName, - String domainName, - String name, - DomainOwnershipIdentifierInner domainOwnershipIdentifier); - - /** - * Creates an ownership identifier for a domain or updates identifier details for an existing identifier. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of domain. - * @param name Name of identifier. - * @param domainOwnershipIdentifier A JSON representation of the domain ownership properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return domain ownership Identifier. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DomainOwnershipIdentifierInner createOrUpdateOwnershipIdentifier( - String resourceGroupName, - String domainName, - String name, - DomainOwnershipIdentifierInner domainOwnershipIdentifier); - - /** - * Creates an ownership identifier for a domain or updates identifier details for an existing identifier. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of domain. - * @param name Name of identifier. - * @param domainOwnershipIdentifier A JSON representation of the domain ownership properties. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return domain ownership Identifier. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateOwnershipIdentifierWithResponse( - String resourceGroupName, - String domainName, - String name, - DomainOwnershipIdentifierInner domainOwnershipIdentifier, - Context context); - - /** - * Delete ownership identifier for domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of domain. - * @param name Name of identifier. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteOwnershipIdentifierWithResponseAsync( - String resourceGroupName, String domainName, String name); - - /** - * Delete ownership identifier for domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of domain. - * @param name Name of identifier. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteOwnershipIdentifierAsync(String resourceGroupName, String domainName, String name); - - /** - * Delete ownership identifier for domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of domain. - * @param name Name of identifier. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deleteOwnershipIdentifier(String resourceGroupName, String domainName, String name); - - /** - * Delete ownership identifier for domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of domain. - * @param name Name of identifier. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteOwnershipIdentifierWithResponse( - String resourceGroupName, String domainName, String name, Context context); - - /** - * Creates an ownership identifier for a domain or updates identifier details for an existing identifier. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of domain. - * @param name Name of identifier. - * @param domainOwnershipIdentifier A JSON representation of the domain ownership properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return domain ownership Identifier. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateOwnershipIdentifierWithResponseAsync( - String resourceGroupName, - String domainName, - String name, - DomainOwnershipIdentifierInner domainOwnershipIdentifier); - - /** - * Creates an ownership identifier for a domain or updates identifier details for an existing identifier. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of domain. - * @param name Name of identifier. - * @param domainOwnershipIdentifier A JSON representation of the domain ownership properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return domain ownership Identifier. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateOwnershipIdentifierAsync( - String resourceGroupName, - String domainName, - String name, - DomainOwnershipIdentifierInner domainOwnershipIdentifier); - - /** - * Creates an ownership identifier for a domain or updates identifier details for an existing identifier. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of domain. - * @param name Name of identifier. - * @param domainOwnershipIdentifier A JSON representation of the domain ownership properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return domain ownership Identifier. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DomainOwnershipIdentifierInner updateOwnershipIdentifier( - String resourceGroupName, - String domainName, - String name, - DomainOwnershipIdentifierInner domainOwnershipIdentifier); - - /** - * Creates an ownership identifier for a domain or updates identifier details for an existing identifier. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of domain. - * @param name Name of identifier. - * @param domainOwnershipIdentifier A JSON representation of the domain ownership properties. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return domain ownership Identifier. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateOwnershipIdentifierWithResponse( - String resourceGroupName, - String domainName, - String name, - DomainOwnershipIdentifierInner domainOwnershipIdentifier, - Context context); - - /** - * Renew a domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of the domain. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> renewWithResponseAsync(String resourceGroupName, String domainName); - - /** - * Renew a domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of the domain. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono renewAsync(String resourceGroupName, String domainName); - - /** - * Renew a domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of the domain. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void renew(String resourceGroupName, String domainName); - - /** - * Renew a domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of the domain. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response renewWithResponse(String resourceGroupName, String domainName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/ProvidersClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/ProvidersClient.java deleted file mode 100644 index 7e81cde08a15..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/ProvidersClient.java +++ /dev/null @@ -1,150 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.appservice.fluent.models.ApplicationStackInner; -import com.azure.resourcemanager.appservice.fluent.models.CsmOperationDescriptionInner; -import com.azure.resourcemanager.appservice.models.ProviderOsTypeSelected; - -/** An instance of this class provides access to all the operations defined in ProvidersClient. */ -public interface ProvidersClient { - /** - * Get available application frameworks and their versions. - * - * @param osTypeSelected The osTypeSelected parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return available application frameworks and their versions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux getAvailableStacksAsync(ProviderOsTypeSelected osTypeSelected); - - /** - * Get available application frameworks and their versions. - * - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return available application frameworks and their versions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux getAvailableStacksAsync(); - - /** - * Get available application frameworks and their versions. - * - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return available application frameworks and their versions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable getAvailableStacks(); - - /** - * Get available application frameworks and their versions. - * - * @param osTypeSelected The osTypeSelected parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return available application frameworks and their versions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable getAvailableStacks(ProviderOsTypeSelected osTypeSelected, Context context); - - /** - * Gets all available operations for the Microsoft.Web resource provider. Also exposes resource metric definitions. - * - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all available operations for the Microsoft.Web resource provider. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listOperationsAsync(); - - /** - * Gets all available operations for the Microsoft.Web resource provider. Also exposes resource metric definitions. - * - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all available operations for the Microsoft.Web resource provider. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listOperations(); - - /** - * Gets all available operations for the Microsoft.Web resource provider. Also exposes resource metric definitions. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all available operations for the Microsoft.Web resource provider. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listOperations(Context context); - - /** - * Get available application frameworks and their versions. - * - * @param osTypeSelected The osTypeSelected parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return available application frameworks and their versions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(ProviderOsTypeSelected osTypeSelected); - - /** - * Get available application frameworks and their versions. - * - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return available application frameworks and their versions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Get available application frameworks and their versions. - * - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return available application frameworks and their versions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Get available application frameworks and their versions. - * - * @param osTypeSelected The osTypeSelected parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return available application frameworks and their versions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(ProviderOsTypeSelected osTypeSelected, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/RecommendationsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/RecommendationsClient.java deleted file mode 100644 index 3e77b6fd8ec4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/RecommendationsClient.java +++ /dev/null @@ -1,988 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.appservice.fluent.models.RecommendationInner; -import com.azure.resourcemanager.appservice.fluent.models.RecommendationRuleInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in RecommendationsClient. */ -public interface RecommendationsClient { - /** - * List all recommendations for a subscription. - * - * @param featured Specify <code>true</code> to return only the most critical recommendations. The - * default is <code>false</code>, which returns all recommendations. - * @param filter Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or channel eq - * 'Notification' and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq - * duration'[PT1H|PT1M|P1D]. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of recommendations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(Boolean featured, String filter); - - /** - * List all recommendations for a subscription. - * - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of recommendations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * List all recommendations for a subscription. - * - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of recommendations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * List all recommendations for a subscription. - * - * @param featured Specify <code>true</code> to return only the most critical recommendations. The - * default is <code>false</code>, which returns all recommendations. - * @param filter Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or channel eq - * 'Notification' and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq - * duration'[PT1H|PT1M|P1D]. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of recommendations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Boolean featured, String filter, Context context); - - /** - * Reset all recommendation opt-out settings for a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> resetAllFiltersWithResponseAsync(); - - /** - * Reset all recommendation opt-out settings for a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono resetAllFiltersAsync(); - - /** - * Reset all recommendation opt-out settings for a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void resetAllFilters(); - - /** - * Reset all recommendation opt-out settings for a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response resetAllFiltersWithResponse(Context context); - - /** - * Disables the specified rule so it will not apply to a subscription in the future. - * - * @param name Rule name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> disableRecommendationForSubscriptionWithResponseAsync(String name); - - /** - * Disables the specified rule so it will not apply to a subscription in the future. - * - * @param name Rule name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono disableRecommendationForSubscriptionAsync(String name); - - /** - * Disables the specified rule so it will not apply to a subscription in the future. - * - * @param name Rule name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void disableRecommendationForSubscription(String name); - - /** - * Disables the specified rule so it will not apply to a subscription in the future. - * - * @param name Rule name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response disableRecommendationForSubscriptionWithResponse(String name, Context context); - - /** - * Get past recommendations for an app, optionally specified by the time range. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param hostingEnvironmentName Name of the hosting environment. - * @param expiredOnly Specify <code>false</code> to return all recommendations. The default is - * <code>true</code>, which returns only expired recommendations. - * @param filter Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or channel eq - * 'Notification' and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq - * duration'[PT1H|PT1M|P1D]. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return past recommendations for an app, optionally specified by the time range. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listHistoryForHostingEnvironmentAsync( - String resourceGroupName, String hostingEnvironmentName, Boolean expiredOnly, String filter); - - /** - * Get past recommendations for an app, optionally specified by the time range. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param hostingEnvironmentName Name of the hosting environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return past recommendations for an app, optionally specified by the time range. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listHistoryForHostingEnvironmentAsync( - String resourceGroupName, String hostingEnvironmentName); - - /** - * Get past recommendations for an app, optionally specified by the time range. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param hostingEnvironmentName Name of the hosting environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return past recommendations for an app, optionally specified by the time range. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listHistoryForHostingEnvironment( - String resourceGroupName, String hostingEnvironmentName); - - /** - * Get past recommendations for an app, optionally specified by the time range. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param hostingEnvironmentName Name of the hosting environment. - * @param expiredOnly Specify <code>false</code> to return all recommendations. The default is - * <code>true</code>, which returns only expired recommendations. - * @param filter Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or channel eq - * 'Notification' and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq - * duration'[PT1H|PT1M|P1D]. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return past recommendations for an app, optionally specified by the time range. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listHistoryForHostingEnvironment( - String resourceGroupName, String hostingEnvironmentName, Boolean expiredOnly, String filter, Context context); - - /** - * Get all recommendations for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param hostingEnvironmentName Name of the app. - * @param featured Specify <code>true</code> to return only the most critical recommendations. The - * default is <code>false</code>, which returns all recommendations. - * @param filter Return only channels specified in the filter. Filter is specified by using OData syntax. Example: - * $filter=channel eq 'Api' or channel eq 'Notification'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all recommendations for an app. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listRecommendedRulesForHostingEnvironmentAsync( - String resourceGroupName, String hostingEnvironmentName, Boolean featured, String filter); - - /** - * Get all recommendations for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param hostingEnvironmentName Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all recommendations for an app. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listRecommendedRulesForHostingEnvironmentAsync( - String resourceGroupName, String hostingEnvironmentName); - - /** - * Get all recommendations for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param hostingEnvironmentName Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all recommendations for an app. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listRecommendedRulesForHostingEnvironment( - String resourceGroupName, String hostingEnvironmentName); - - /** - * Get all recommendations for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param hostingEnvironmentName Name of the app. - * @param featured Specify <code>true</code> to return only the most critical recommendations. The - * default is <code>false</code>, which returns all recommendations. - * @param filter Return only channels specified in the filter. Filter is specified by using OData syntax. Example: - * $filter=channel eq 'Api' or channel eq 'Notification'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all recommendations for an app. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listRecommendedRulesForHostingEnvironment( - String resourceGroupName, String hostingEnvironmentName, Boolean featured, String filter, Context context); - - /** - * Disable all recommendations for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param environmentName Name of the app. - * @param hostingEnvironmentName The hostingEnvironmentName parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> disableAllForHostingEnvironmentWithResponseAsync( - String resourceGroupName, String environmentName, String hostingEnvironmentName); - - /** - * Disable all recommendations for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param environmentName Name of the app. - * @param hostingEnvironmentName The hostingEnvironmentName parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono disableAllForHostingEnvironmentAsync( - String resourceGroupName, String environmentName, String hostingEnvironmentName); - - /** - * Disable all recommendations for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param environmentName Name of the app. - * @param hostingEnvironmentName The hostingEnvironmentName parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void disableAllForHostingEnvironment( - String resourceGroupName, String environmentName, String hostingEnvironmentName); - - /** - * Disable all recommendations for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param environmentName Name of the app. - * @param hostingEnvironmentName The hostingEnvironmentName parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response disableAllForHostingEnvironmentWithResponse( - String resourceGroupName, String environmentName, String hostingEnvironmentName, Context context); - - /** - * Reset all recommendation opt-out settings for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param environmentName Name of the app. - * @param hostingEnvironmentName The hostingEnvironmentName parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> resetAllFiltersForHostingEnvironmentWithResponseAsync( - String resourceGroupName, String environmentName, String hostingEnvironmentName); - - /** - * Reset all recommendation opt-out settings for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param environmentName Name of the app. - * @param hostingEnvironmentName The hostingEnvironmentName parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono resetAllFiltersForHostingEnvironmentAsync( - String resourceGroupName, String environmentName, String hostingEnvironmentName); - - /** - * Reset all recommendation opt-out settings for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param environmentName Name of the app. - * @param hostingEnvironmentName The hostingEnvironmentName parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void resetAllFiltersForHostingEnvironment( - String resourceGroupName, String environmentName, String hostingEnvironmentName); - - /** - * Reset all recommendation opt-out settings for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param environmentName Name of the app. - * @param hostingEnvironmentName The hostingEnvironmentName parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response resetAllFiltersForHostingEnvironmentWithResponse( - String resourceGroupName, String environmentName, String hostingEnvironmentName, Context context); - - /** - * Get a recommendation rule for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param hostingEnvironmentName Name of the hosting environment. - * @param name Name of the recommendation. - * @param updateSeen Specify <code>true</code> to update the last-seen timestamp of the recommendation - * object. - * @param recommendationId The GUID of the recommendation object if you query an expired one. You don't need to - * specify it to query an active entry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a recommendation rule for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getRuleDetailsByHostingEnvironmentWithResponseAsync( - String resourceGroupName, - String hostingEnvironmentName, - String name, - Boolean updateSeen, - String recommendationId); - - /** - * Get a recommendation rule for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param hostingEnvironmentName Name of the hosting environment. - * @param name Name of the recommendation. - * @param updateSeen Specify <code>true</code> to update the last-seen timestamp of the recommendation - * object. - * @param recommendationId The GUID of the recommendation object if you query an expired one. You don't need to - * specify it to query an active entry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a recommendation rule for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getRuleDetailsByHostingEnvironmentAsync( - String resourceGroupName, - String hostingEnvironmentName, - String name, - Boolean updateSeen, - String recommendationId); - - /** - * Get a recommendation rule for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param hostingEnvironmentName Name of the hosting environment. - * @param name Name of the recommendation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a recommendation rule for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getRuleDetailsByHostingEnvironmentAsync( - String resourceGroupName, String hostingEnvironmentName, String name); - - /** - * Get a recommendation rule for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param hostingEnvironmentName Name of the hosting environment. - * @param name Name of the recommendation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a recommendation rule for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RecommendationRuleInner getRuleDetailsByHostingEnvironment( - String resourceGroupName, String hostingEnvironmentName, String name); - - /** - * Get a recommendation rule for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param hostingEnvironmentName Name of the hosting environment. - * @param name Name of the recommendation. - * @param updateSeen Specify <code>true</code> to update the last-seen timestamp of the recommendation - * object. - * @param recommendationId The GUID of the recommendation object if you query an expired one. You don't need to - * specify it to query an active entry. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a recommendation rule for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getRuleDetailsByHostingEnvironmentWithResponse( - String resourceGroupName, - String hostingEnvironmentName, - String name, - Boolean updateSeen, - String recommendationId, - Context context); - - /** - * Disables the specific rule for a web site permanently. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param environmentName Site name. - * @param name Rule name. - * @param hostingEnvironmentName The hostingEnvironmentName parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> disableRecommendationForHostingEnvironmentWithResponseAsync( - String resourceGroupName, String environmentName, String name, String hostingEnvironmentName); - - /** - * Disables the specific rule for a web site permanently. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param environmentName Site name. - * @param name Rule name. - * @param hostingEnvironmentName The hostingEnvironmentName parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono disableRecommendationForHostingEnvironmentAsync( - String resourceGroupName, String environmentName, String name, String hostingEnvironmentName); - - /** - * Disables the specific rule for a web site permanently. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param environmentName Site name. - * @param name Rule name. - * @param hostingEnvironmentName The hostingEnvironmentName parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void disableRecommendationForHostingEnvironment( - String resourceGroupName, String environmentName, String name, String hostingEnvironmentName); - - /** - * Disables the specific rule for a web site permanently. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param environmentName Site name. - * @param name Rule name. - * @param hostingEnvironmentName The hostingEnvironmentName parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response disableRecommendationForHostingEnvironmentWithResponse( - String resourceGroupName, String environmentName, String name, String hostingEnvironmentName, Context context); - - /** - * Get past recommendations for an app, optionally specified by the time range. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Name of the app. - * @param expiredOnly Specify <code>false</code> to return all recommendations. The default is - * <code>true</code>, which returns only expired recommendations. - * @param filter Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or channel eq - * 'Notification' and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq - * duration'[PT1H|PT1M|P1D]. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return past recommendations for an app, optionally specified by the time range. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listHistoryForWebAppAsync( - String resourceGroupName, String siteName, Boolean expiredOnly, String filter); - - /** - * Get past recommendations for an app, optionally specified by the time range. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return past recommendations for an app, optionally specified by the time range. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listHistoryForWebAppAsync(String resourceGroupName, String siteName); - - /** - * Get past recommendations for an app, optionally specified by the time range. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return past recommendations for an app, optionally specified by the time range. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listHistoryForWebApp(String resourceGroupName, String siteName); - - /** - * Get past recommendations for an app, optionally specified by the time range. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Name of the app. - * @param expiredOnly Specify <code>false</code> to return all recommendations. The default is - * <code>true</code>, which returns only expired recommendations. - * @param filter Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or channel eq - * 'Notification' and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq - * duration'[PT1H|PT1M|P1D]. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return past recommendations for an app, optionally specified by the time range. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listHistoryForWebApp( - String resourceGroupName, String siteName, Boolean expiredOnly, String filter, Context context); - - /** - * Get all recommendations for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Name of the app. - * @param featured Specify <code>true</code> to return only the most critical recommendations. The - * default is <code>false</code>, which returns all recommendations. - * @param filter Return only channels specified in the filter. Filter is specified by using OData syntax. Example: - * $filter=channel eq 'Api' or channel eq 'Notification'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all recommendations for an app. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listRecommendedRulesForWebAppAsync( - String resourceGroupName, String siteName, Boolean featured, String filter); - - /** - * Get all recommendations for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all recommendations for an app. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listRecommendedRulesForWebAppAsync(String resourceGroupName, String siteName); - - /** - * Get all recommendations for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all recommendations for an app. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listRecommendedRulesForWebApp(String resourceGroupName, String siteName); - - /** - * Get all recommendations for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Name of the app. - * @param featured Specify <code>true</code> to return only the most critical recommendations. The - * default is <code>false</code>, which returns all recommendations. - * @param filter Return only channels specified in the filter. Filter is specified by using OData syntax. Example: - * $filter=channel eq 'Api' or channel eq 'Notification'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all recommendations for an app. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listRecommendedRulesForWebApp( - String resourceGroupName, String siteName, Boolean featured, String filter, Context context); - - /** - * Disable all recommendations for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> disableAllForWebAppWithResponseAsync(String resourceGroupName, String siteName); - - /** - * Disable all recommendations for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono disableAllForWebAppAsync(String resourceGroupName, String siteName); - - /** - * Disable all recommendations for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void disableAllForWebApp(String resourceGroupName, String siteName); - - /** - * Disable all recommendations for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response disableAllForWebAppWithResponse(String resourceGroupName, String siteName, Context context); - - /** - * Reset all recommendation opt-out settings for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> resetAllFiltersForWebAppWithResponseAsync(String resourceGroupName, String siteName); - - /** - * Reset all recommendation opt-out settings for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono resetAllFiltersForWebAppAsync(String resourceGroupName, String siteName); - - /** - * Reset all recommendation opt-out settings for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void resetAllFiltersForWebApp(String resourceGroupName, String siteName); - - /** - * Reset all recommendation opt-out settings for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response resetAllFiltersForWebAppWithResponse(String resourceGroupName, String siteName, Context context); - - /** - * Get a recommendation rule for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Name of the app. - * @param name Name of the recommendation. - * @param updateSeen Specify <code>true</code> to update the last-seen timestamp of the recommendation - * object. - * @param recommendationId The GUID of the recommendation object if you query an expired one. You don't need to - * specify it to query an active entry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a recommendation rule for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getRuleDetailsByWebAppWithResponseAsync( - String resourceGroupName, String siteName, String name, Boolean updateSeen, String recommendationId); - - /** - * Get a recommendation rule for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Name of the app. - * @param name Name of the recommendation. - * @param updateSeen Specify <code>true</code> to update the last-seen timestamp of the recommendation - * object. - * @param recommendationId The GUID of the recommendation object if you query an expired one. You don't need to - * specify it to query an active entry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a recommendation rule for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getRuleDetailsByWebAppAsync( - String resourceGroupName, String siteName, String name, Boolean updateSeen, String recommendationId); - - /** - * Get a recommendation rule for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Name of the app. - * @param name Name of the recommendation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a recommendation rule for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getRuleDetailsByWebAppAsync(String resourceGroupName, String siteName, String name); - - /** - * Get a recommendation rule for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Name of the app. - * @param name Name of the recommendation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a recommendation rule for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RecommendationRuleInner getRuleDetailsByWebApp(String resourceGroupName, String siteName, String name); - - /** - * Get a recommendation rule for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Name of the app. - * @param name Name of the recommendation. - * @param updateSeen Specify <code>true</code> to update the last-seen timestamp of the recommendation - * object. - * @param recommendationId The GUID of the recommendation object if you query an expired one. You don't need to - * specify it to query an active entry. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a recommendation rule for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getRuleDetailsByWebAppWithResponse( - String resourceGroupName, - String siteName, - String name, - Boolean updateSeen, - String recommendationId, - Context context); - - /** - * Disables the specific rule for a web site permanently. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site name. - * @param name Rule name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> disableRecommendationForSiteWithResponseAsync( - String resourceGroupName, String siteName, String name); - - /** - * Disables the specific rule for a web site permanently. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site name. - * @param name Rule name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono disableRecommendationForSiteAsync(String resourceGroupName, String siteName, String name); - - /** - * Disables the specific rule for a web site permanently. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site name. - * @param name Rule name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void disableRecommendationForSite(String resourceGroupName, String siteName, String name); - - /** - * Disables the specific rule for a web site permanently. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site name. - * @param name Rule name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response disableRecommendationForSiteWithResponse( - String resourceGroupName, String siteName, String name, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/ResourceHealthMetadatasClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/ResourceHealthMetadatasClient.java deleted file mode 100644 index f60dd70a0b08..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/ResourceHealthMetadatasClient.java +++ /dev/null @@ -1,303 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.appservice.fluent.models.ResourceHealthMetadataInner; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ResourceHealthMetadatasClient. */ -public interface ResourceHealthMetadatasClient extends InnerSupportsListing { - /** - * List all ResourceHealthMetadata for all sites in the subscription. - * - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of resource health metadata. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * List all ResourceHealthMetadata for all sites in the subscription. - * - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of resource health metadata. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * List all ResourceHealthMetadata for all sites in the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of resource health metadata. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * List all ResourceHealthMetadata for all sites in the resource group in the subscription. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of resource health metadata. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName); - - /** - * List all ResourceHealthMetadata for all sites in the resource group in the subscription. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of resource health metadata. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * List all ResourceHealthMetadata for all sites in the resource group in the subscription. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of resource health metadata. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * Gets the category of ResourceHealthMetadata to use for the given site as a collection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the category of ResourceHealthMetadata to use for the given site as a collection. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listBySiteAsync(String resourceGroupName, String name); - - /** - * Gets the category of ResourceHealthMetadata to use for the given site as a collection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the category of ResourceHealthMetadata to use for the given site as a collection. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listBySite(String resourceGroupName, String name); - - /** - * Gets the category of ResourceHealthMetadata to use for the given site as a collection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the category of ResourceHealthMetadata to use for the given site as a collection. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listBySite(String resourceGroupName, String name, Context context); - - /** - * Gets the category of ResourceHealthMetadata to use for the given site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the category of ResourceHealthMetadata to use for the given site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getBySiteWithResponseAsync(String resourceGroupName, String name); - - /** - * Gets the category of ResourceHealthMetadata to use for the given site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the category of ResourceHealthMetadata to use for the given site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getBySiteAsync(String resourceGroupName, String name); - - /** - * Gets the category of ResourceHealthMetadata to use for the given site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the category of ResourceHealthMetadata to use for the given site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ResourceHealthMetadataInner getBySite(String resourceGroupName, String name); - - /** - * Gets the category of ResourceHealthMetadata to use for the given site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the category of ResourceHealthMetadata to use for the given site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getBySiteWithResponse(String resourceGroupName, String name, Context context); - - /** - * Gets the category of ResourceHealthMetadata to use for the given site as a collection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the category of ResourceHealthMetadata to use for the given site as a collection. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listBySiteSlotAsync(String resourceGroupName, String name, String slot); - - /** - * Gets the category of ResourceHealthMetadata to use for the given site as a collection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the category of ResourceHealthMetadata to use for the given site as a collection. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listBySiteSlot(String resourceGroupName, String name, String slot); - - /** - * Gets the category of ResourceHealthMetadata to use for the given site as a collection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the category of ResourceHealthMetadata to use for the given site as a collection. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listBySiteSlot( - String resourceGroupName, String name, String slot, Context context); - - /** - * Gets the category of ResourceHealthMetadata to use for the given site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the category of ResourceHealthMetadata to use for the given site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getBySiteSlotWithResponseAsync( - String resourceGroupName, String name, String slot); - - /** - * Gets the category of ResourceHealthMetadata to use for the given site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the category of ResourceHealthMetadata to use for the given site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getBySiteSlotAsync(String resourceGroupName, String name, String slot); - - /** - * Gets the category of ResourceHealthMetadata to use for the given site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the category of ResourceHealthMetadata to use for the given site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ResourceHealthMetadataInner getBySiteSlot(String resourceGroupName, String name, String slot); - - /** - * Gets the category of ResourceHealthMetadata to use for the given site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the category of ResourceHealthMetadata to use for the given site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getBySiteSlotWithResponse( - String resourceGroupName, String name, String slot, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/ResourceProvidersClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/ResourceProvidersClient.java deleted file mode 100644 index 801eb475ea73..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/ResourceProvidersClient.java +++ /dev/null @@ -1,907 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.appservice.fluent.models.BillingMeterInner; -import com.azure.resourcemanager.appservice.fluent.models.DeploymentLocationsInner; -import com.azure.resourcemanager.appservice.fluent.models.GeoRegionInner; -import com.azure.resourcemanager.appservice.fluent.models.IdentifierInner; -import com.azure.resourcemanager.appservice.fluent.models.NameIdentifierInner; -import com.azure.resourcemanager.appservice.fluent.models.PremierAddOnOfferInner; -import com.azure.resourcemanager.appservice.fluent.models.ResourceNameAvailabilityInner; -import com.azure.resourcemanager.appservice.fluent.models.SkuInfosInner; -import com.azure.resourcemanager.appservice.fluent.models.SourceControlInner; -import com.azure.resourcemanager.appservice.fluent.models.UserInner; -import com.azure.resourcemanager.appservice.fluent.models.ValidateResponseInner; -import com.azure.resourcemanager.appservice.fluent.models.VnetValidationFailureDetailsInner; -import com.azure.resourcemanager.appservice.models.CsmMoveResourceEnvelope; -import com.azure.resourcemanager.appservice.models.ResourceNameAvailabilityRequest; -import com.azure.resourcemanager.appservice.models.SkuName; -import com.azure.resourcemanager.appservice.models.ValidateContainerSettingsRequest; -import com.azure.resourcemanager.appservice.models.ValidateRequest; -import com.azure.resourcemanager.appservice.models.VnetParameters; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ResourceProvidersClient. */ -public interface ResourceProvidersClient { - /** - * Gets publishing user. - * - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return publishing user. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getPublishingUserWithResponseAsync(); - - /** - * Gets publishing user. - * - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return publishing user. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getPublishingUserAsync(); - - /** - * Gets publishing user. - * - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return publishing user. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - UserInner getPublishingUser(); - - /** - * Gets publishing user. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return publishing user. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getPublishingUserWithResponse(Context context); - - /** - * Updates publishing user. - * - * @param userDetails Details of publishing user. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user credentials used for publishing activity. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updatePublishingUserWithResponseAsync(UserInner userDetails); - - /** - * Updates publishing user. - * - * @param userDetails Details of publishing user. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user credentials used for publishing activity. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updatePublishingUserAsync(UserInner userDetails); - - /** - * Updates publishing user. - * - * @param userDetails Details of publishing user. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user credentials used for publishing activity. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - UserInner updatePublishingUser(UserInner userDetails); - - /** - * Updates publishing user. - * - * @param userDetails Details of publishing user. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user credentials used for publishing activity. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updatePublishingUserWithResponse(UserInner userDetails, Context context); - - /** - * Gets the source controls available for Azure websites. - * - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source controls available for Azure websites. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listSourceControlsAsync(); - - /** - * Gets the source controls available for Azure websites. - * - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source controls available for Azure websites. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listSourceControls(); - - /** - * Gets the source controls available for Azure websites. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source controls available for Azure websites. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listSourceControls(Context context); - - /** - * Gets source control token. - * - * @param sourceControlType Type of source control. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control token. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getSourceControlWithResponseAsync(String sourceControlType); - - /** - * Gets source control token. - * - * @param sourceControlType Type of source control. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control token. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getSourceControlAsync(String sourceControlType); - - /** - * Gets source control token. - * - * @param sourceControlType Type of source control. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control token. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SourceControlInner getSourceControl(String sourceControlType); - - /** - * Gets source control token. - * - * @param sourceControlType Type of source control. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control token. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getSourceControlWithResponse(String sourceControlType, Context context); - - /** - * Updates source control token. - * - * @param sourceControlType Type of source control. - * @param requestMessage Source control token information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source control OAuth token. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateSourceControlWithResponseAsync( - String sourceControlType, SourceControlInner requestMessage); - - /** - * Updates source control token. - * - * @param sourceControlType Type of source control. - * @param requestMessage Source control token information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source control OAuth token. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateSourceControlAsync(String sourceControlType, SourceControlInner requestMessage); - - /** - * Updates source control token. - * - * @param sourceControlType Type of source control. - * @param requestMessage Source control token information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source control OAuth token. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SourceControlInner updateSourceControl(String sourceControlType, SourceControlInner requestMessage); - - /** - * Updates source control token. - * - * @param sourceControlType Type of source control. - * @param requestMessage Source control token information. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source control OAuth token. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateSourceControlWithResponse( - String sourceControlType, SourceControlInner requestMessage, Context context); - - /** - * Gets a list of meters for a given location. - * - * @param billingLocation Azure Location of billable resource. - * @param osType App Service OS type meters used for. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of meters for a given location. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String billingLocation, String osType); - - /** - * Gets a list of meters for a given location. - * - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of meters for a given location. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Gets a list of meters for a given location. - * - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of meters for a given location. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Gets a list of meters for a given location. - * - * @param billingLocation Azure Location of billable resource. - * @param osType App Service OS type meters used for. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of meters for a given location. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String billingLocation, String osType, Context context); - - /** - * Check if a resource name is available. - * - * @param request Name availability request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information regarding availability of a resource name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> checkNameAvailabilityWithResponseAsync( - ResourceNameAvailabilityRequest request); - - /** - * Check if a resource name is available. - * - * @param request Name availability request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information regarding availability of a resource name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono checkNameAvailabilityAsync(ResourceNameAvailabilityRequest request); - - /** - * Check if a resource name is available. - * - * @param request Name availability request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information regarding availability of a resource name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ResourceNameAvailabilityInner checkNameAvailability(ResourceNameAvailabilityRequest request); - - /** - * Check if a resource name is available. - * - * @param request Name availability request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information regarding availability of a resource name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response checkNameAvailabilityWithResponse( - ResourceNameAvailabilityRequest request, Context context); - - /** - * Gets list of available geo regions plus ministamps. - * - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of available geo regions plus ministamps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getSubscriptionDeploymentLocationsWithResponseAsync(); - - /** - * Gets list of available geo regions plus ministamps. - * - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of available geo regions plus ministamps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getSubscriptionDeploymentLocationsAsync(); - - /** - * Gets list of available geo regions plus ministamps. - * - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of available geo regions plus ministamps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DeploymentLocationsInner getSubscriptionDeploymentLocations(); - - /** - * Gets list of available geo regions plus ministamps. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of available geo regions plus ministamps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getSubscriptionDeploymentLocationsWithResponse(Context context); - - /** - * Get a list of available geographical regions. - * - * @param sku Name of SKU used to filter the regions. - * @param linuxWorkersEnabled Specify <code>true</code> if you want to filter to only regions that - * support Linux workers. - * @param xenonWorkersEnabled Specify <code>true</code> if you want to filter to only regions that - * support Xenon workers. - * @param linuxDynamicWorkersEnabled Specify <code>true</code> if you want to filter to only regions - * that support Linux Consumption Workers. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of available geographical regions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listGeoRegionsAsync( - SkuName sku, Boolean linuxWorkersEnabled, Boolean xenonWorkersEnabled, Boolean linuxDynamicWorkersEnabled); - - /** - * Get a list of available geographical regions. - * - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of available geographical regions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listGeoRegionsAsync(); - - /** - * Get a list of available geographical regions. - * - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of available geographical regions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listGeoRegions(); - - /** - * Get a list of available geographical regions. - * - * @param sku Name of SKU used to filter the regions. - * @param linuxWorkersEnabled Specify <code>true</code> if you want to filter to only regions that - * support Linux workers. - * @param xenonWorkersEnabled Specify <code>true</code> if you want to filter to only regions that - * support Xenon workers. - * @param linuxDynamicWorkersEnabled Specify <code>true</code> if you want to filter to only regions - * that support Linux Consumption Workers. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of available geographical regions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listGeoRegions( - SkuName sku, - Boolean linuxWorkersEnabled, - Boolean xenonWorkersEnabled, - Boolean linuxDynamicWorkersEnabled, - Context context); - - /** - * List all apps that are assigned to a hostname. - * - * @param nameIdentifier Hostname information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of identifiers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listSiteIdentifiersAssignedToHostnameAsync(NameIdentifierInner nameIdentifier); - - /** - * List all apps that are assigned to a hostname. - * - * @param nameIdentifier Hostname information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of identifiers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listSiteIdentifiersAssignedToHostname(NameIdentifierInner nameIdentifier); - - /** - * List all apps that are assigned to a hostname. - * - * @param nameIdentifier Hostname information. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of identifiers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listSiteIdentifiersAssignedToHostname( - NameIdentifierInner nameIdentifier, Context context); - - /** - * List all premier add-on offers. - * - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of premier add-on offers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listPremierAddOnOffersAsync(); - - /** - * List all premier add-on offers. - * - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of premier add-on offers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listPremierAddOnOffers(); - - /** - * List all premier add-on offers. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of premier add-on offers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listPremierAddOnOffers(Context context); - - /** - * List all SKUs. - * - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of SKU information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listSkusWithResponseAsync(); - - /** - * List all SKUs. - * - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of SKU information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listSkusAsync(); - - /** - * List all SKUs. - * - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of SKU information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SkuInfosInner listSkus(); - - /** - * List all SKUs. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of SKU information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listSkusWithResponse(Context context); - - /** - * Verifies if this VNET is compatible with an App Service Environment by analyzing the Network Security Group - * rules. - * - * @param parameters VNET information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a class that describes the reason for a validation failure. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> verifyHostingEnvironmentVnetWithResponseAsync( - VnetParameters parameters); - - /** - * Verifies if this VNET is compatible with an App Service Environment by analyzing the Network Security Group - * rules. - * - * @param parameters VNET information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a class that describes the reason for a validation failure. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono verifyHostingEnvironmentVnetAsync(VnetParameters parameters); - - /** - * Verifies if this VNET is compatible with an App Service Environment by analyzing the Network Security Group - * rules. - * - * @param parameters VNET information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a class that describes the reason for a validation failure. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VnetValidationFailureDetailsInner verifyHostingEnvironmentVnet(VnetParameters parameters); - - /** - * Verifies if this VNET is compatible with an App Service Environment by analyzing the Network Security Group - * rules. - * - * @param parameters VNET information. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a class that describes the reason for a validation failure. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response verifyHostingEnvironmentVnetWithResponse( - VnetParameters parameters, Context context); - - /** - * Move resources between resource groups. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param moveResourceEnvelope Object that represents the resource to move. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> moveWithResponseAsync(String resourceGroupName, CsmMoveResourceEnvelope moveResourceEnvelope); - - /** - * Move resources between resource groups. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param moveResourceEnvelope Object that represents the resource to move. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono moveAsync(String resourceGroupName, CsmMoveResourceEnvelope moveResourceEnvelope); - - /** - * Move resources between resource groups. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param moveResourceEnvelope Object that represents the resource to move. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void move(String resourceGroupName, CsmMoveResourceEnvelope moveResourceEnvelope); - - /** - * Move resources between resource groups. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param moveResourceEnvelope Object that represents the resource to move. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response moveWithResponse( - String resourceGroupName, CsmMoveResourceEnvelope moveResourceEnvelope, Context context); - - /** - * Validate if a resource can be created. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param validateRequest Request with the resources to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the result of resource validation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> validateWithResponseAsync( - String resourceGroupName, ValidateRequest validateRequest); - - /** - * Validate if a resource can be created. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param validateRequest Request with the resources to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the result of resource validation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono validateAsync(String resourceGroupName, ValidateRequest validateRequest); - - /** - * Validate if a resource can be created. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param validateRequest Request with the resources to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the result of resource validation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ValidateResponseInner validate(String resourceGroupName, ValidateRequest validateRequest); - - /** - * Validate if a resource can be created. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param validateRequest Request with the resources to validate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the result of resource validation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response validateWithResponse( - String resourceGroupName, ValidateRequest validateRequest, Context context); - - /** - * Validate if the container settings are correct. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param validateContainerSettingsRequest Container settings validation request context. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return any object. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> validateContainerSettingsWithResponseAsync( - String resourceGroupName, ValidateContainerSettingsRequest validateContainerSettingsRequest); - - /** - * Validate if the container settings are correct. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param validateContainerSettingsRequest Container settings validation request context. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return any object. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono validateContainerSettingsAsync( - String resourceGroupName, ValidateContainerSettingsRequest validateContainerSettingsRequest); - - /** - * Validate if the container settings are correct. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param validateContainerSettingsRequest Container settings validation request context. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return any object. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Object validateContainerSettings( - String resourceGroupName, ValidateContainerSettingsRequest validateContainerSettingsRequest); - - /** - * Validate if the container settings are correct. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param validateContainerSettingsRequest Container settings validation request context. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return any object. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response validateContainerSettingsWithResponse( - String resourceGroupName, ValidateContainerSettingsRequest validateContainerSettingsRequest, Context context); - - /** - * Validate whether a resource can be moved. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param moveResourceEnvelope Object that represents the resource to move. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> validateMoveWithResponseAsync( - String resourceGroupName, CsmMoveResourceEnvelope moveResourceEnvelope); - - /** - * Validate whether a resource can be moved. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param moveResourceEnvelope Object that represents the resource to move. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono validateMoveAsync(String resourceGroupName, CsmMoveResourceEnvelope moveResourceEnvelope); - - /** - * Validate whether a resource can be moved. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param moveResourceEnvelope Object that represents the resource to move. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void validateMove(String resourceGroupName, CsmMoveResourceEnvelope moveResourceEnvelope); - - /** - * Validate whether a resource can be moved. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param moveResourceEnvelope Object that represents the resource to move. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response validateMoveWithResponse( - String resourceGroupName, CsmMoveResourceEnvelope moveResourceEnvelope, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/TopLevelDomainsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/TopLevelDomainsClient.java deleted file mode 100644 index 491651e132a9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/TopLevelDomainsClient.java +++ /dev/null @@ -1,151 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.appservice.fluent.models.TldLegalAgreementInner; -import com.azure.resourcemanager.appservice.fluent.models.TopLevelDomainInner; -import com.azure.resourcemanager.appservice.models.TopLevelDomainAgreementOption; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in TopLevelDomainsClient. */ -public interface TopLevelDomainsClient { - /** - * Get all top-level domains supported for registration. - * - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all top-level domains supported for registration. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Get all top-level domains supported for registration. - * - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all top-level domains supported for registration. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Get all top-level domains supported for registration. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all top-level domains supported for registration. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Get details of a top-level domain. - * - * @param name Name of the top-level domain. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return details of a top-level domain. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync(String name); - - /** - * Get details of a top-level domain. - * - * @param name Name of the top-level domain. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return details of a top-level domain. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync(String name); - - /** - * Get details of a top-level domain. - * - * @param name Name of the top-level domain. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return details of a top-level domain. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - TopLevelDomainInner get(String name); - - /** - * Get details of a top-level domain. - * - * @param name Name of the top-level domain. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return details of a top-level domain. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String name, Context context); - - /** - * Gets all legal agreements that user needs to accept before purchasing a domain. - * - * @param name Name of the top-level domain. - * @param agreementOption Domain agreement options. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all legal agreements that user needs to accept before purchasing a domain. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAgreementsAsync(String name, TopLevelDomainAgreementOption agreementOption); - - /** - * Gets all legal agreements that user needs to accept before purchasing a domain. - * - * @param name Name of the top-level domain. - * @param agreementOption Domain agreement options. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all legal agreements that user needs to accept before purchasing a domain. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listAgreements(String name, TopLevelDomainAgreementOption agreementOption); - - /** - * Gets all legal agreements that user needs to accept before purchasing a domain. - * - * @param name Name of the top-level domain. - * @param agreementOption Domain agreement options. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all legal agreements that user needs to accept before purchasing a domain. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listAgreements( - String name, TopLevelDomainAgreementOption agreementOption, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/WebAppsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/WebAppsClient.java deleted file mode 100644 index a1d5ddeaa12d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/WebAppsClient.java +++ /dev/null @@ -1,25521 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.StreamResponse; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.appservice.fluent.models.AzureStoragePropertyDictionaryResourceInner; -import com.azure.resourcemanager.appservice.fluent.models.BackupItemInner; -import com.azure.resourcemanager.appservice.fluent.models.BackupRequestInner; -import com.azure.resourcemanager.appservice.fluent.models.ConnectionStringDictionaryInner; -import com.azure.resourcemanager.appservice.fluent.models.ContinuousWebJobInner; -import com.azure.resourcemanager.appservice.fluent.models.CsmUsageQuotaInner; -import com.azure.resourcemanager.appservice.fluent.models.CustomHostnameAnalysisResultInner; -import com.azure.resourcemanager.appservice.fluent.models.DeploymentInner; -import com.azure.resourcemanager.appservice.fluent.models.FunctionEnvelopeInner; -import com.azure.resourcemanager.appservice.fluent.models.FunctionSecretsInner; -import com.azure.resourcemanager.appservice.fluent.models.HostKeysInner; -import com.azure.resourcemanager.appservice.fluent.models.HostnameBindingInner; -import com.azure.resourcemanager.appservice.fluent.models.HybridConnectionInner; -import com.azure.resourcemanager.appservice.fluent.models.HybridConnectionKeyInner; -import com.azure.resourcemanager.appservice.fluent.models.IdentifierInner; -import com.azure.resourcemanager.appservice.fluent.models.KeyInfoInner; -import com.azure.resourcemanager.appservice.fluent.models.MSDeployLogInner; -import com.azure.resourcemanager.appservice.fluent.models.MSDeployStatusInner; -import com.azure.resourcemanager.appservice.fluent.models.MigrateMySqlStatusInner; -import com.azure.resourcemanager.appservice.fluent.models.NetworkFeaturesInner; -import com.azure.resourcemanager.appservice.fluent.models.NetworkTraceInner; -import com.azure.resourcemanager.appservice.fluent.models.OperationInner; -import com.azure.resourcemanager.appservice.fluent.models.PerfMonResponseInner; -import com.azure.resourcemanager.appservice.fluent.models.PremierAddOnInner; -import com.azure.resourcemanager.appservice.fluent.models.PrivateAccessInner; -import com.azure.resourcemanager.appservice.fluent.models.ProcessInfoInner; -import com.azure.resourcemanager.appservice.fluent.models.ProcessModuleInfoInner; -import com.azure.resourcemanager.appservice.fluent.models.ProcessThreadInfoInner; -import com.azure.resourcemanager.appservice.fluent.models.PublicCertificateInner; -import com.azure.resourcemanager.appservice.fluent.models.PushSettingsInner; -import com.azure.resourcemanager.appservice.fluent.models.RelayServiceConnectionEntityInner; -import com.azure.resourcemanager.appservice.fluent.models.ResourceMetricDefinitionInner; -import com.azure.resourcemanager.appservice.fluent.models.ResourceMetricInner; -import com.azure.resourcemanager.appservice.fluent.models.RestoreRequestInner; -import com.azure.resourcemanager.appservice.fluent.models.SiteAuthSettingsInner; -import com.azure.resourcemanager.appservice.fluent.models.SiteCloneabilityInner; -import com.azure.resourcemanager.appservice.fluent.models.SiteConfigResourceInner; -import com.azure.resourcemanager.appservice.fluent.models.SiteConfigurationSnapshotInfoInner; -import com.azure.resourcemanager.appservice.fluent.models.SiteExtensionInfoInner; -import com.azure.resourcemanager.appservice.fluent.models.SiteInner; -import com.azure.resourcemanager.appservice.fluent.models.SiteInstanceInner; -import com.azure.resourcemanager.appservice.fluent.models.SiteLogsConfigInner; -import com.azure.resourcemanager.appservice.fluent.models.SitePatchResourceInner; -import com.azure.resourcemanager.appservice.fluent.models.SitePhpErrorLogFlagInner; -import com.azure.resourcemanager.appservice.fluent.models.SiteSourceControlInner; -import com.azure.resourcemanager.appservice.fluent.models.SlotConfigNamesResourceInner; -import com.azure.resourcemanager.appservice.fluent.models.SlotDifferenceInner; -import com.azure.resourcemanager.appservice.fluent.models.SnapshotInner; -import com.azure.resourcemanager.appservice.fluent.models.StorageMigrationResponseInner; -import com.azure.resourcemanager.appservice.fluent.models.StringDictionaryInner; -import com.azure.resourcemanager.appservice.fluent.models.SwiftVirtualNetworkInner; -import com.azure.resourcemanager.appservice.fluent.models.TriggeredJobHistoryInner; -import com.azure.resourcemanager.appservice.fluent.models.TriggeredWebJobInner; -import com.azure.resourcemanager.appservice.fluent.models.UserInner; -import com.azure.resourcemanager.appservice.fluent.models.VnetGatewayInner; -import com.azure.resourcemanager.appservice.fluent.models.VnetInfoInner; -import com.azure.resourcemanager.appservice.fluent.models.WebJobInner; -import com.azure.resourcemanager.appservice.models.CsmPublishingProfileOptions; -import com.azure.resourcemanager.appservice.models.CsmSlotEntity; -import com.azure.resourcemanager.appservice.models.DeletedAppRestoreRequest; -import com.azure.resourcemanager.appservice.models.MSDeploy; -import com.azure.resourcemanager.appservice.models.MigrateMySqlRequest; -import com.azure.resourcemanager.appservice.models.PremierAddOnPatchResource; -import com.azure.resourcemanager.appservice.models.SnapshotRestoreRequest; -import com.azure.resourcemanager.appservice.models.StorageMigrationOptions; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.io.InputStream; -import java.nio.ByteBuffer; -import java.util.List; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in WebAppsClient. */ -public interface WebAppsClient - extends InnerSupportsGet, InnerSupportsListing, InnerSupportsDelete { - /** - * Get all apps for a subscription. - * - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all apps for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Get all apps for a subscription. - * - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all apps for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Get all apps for a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all apps for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Gets all web, mobile, and API apps in the specified resource group. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param includeSlots Specify <strong>true</strong> to include deployment slots in results. The default - * is false, which only gives you the production slot of all apps. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all web, mobile, and API apps in the specified resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName, Boolean includeSlots); - - /** - * Gets all web, mobile, and API apps in the specified resource group. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all web, mobile, and API apps in the specified resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName); - - /** - * Gets all web, mobile, and API apps in the specified resource group. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all web, mobile, and API apps in the specified resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Gets all web, mobile, and API apps in the specified resource group. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param includeSlots Specify <strong>true</strong> to include deployment slots in results. The default - * is false, which only gives you the production slot of all apps. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all web, mobile, and API apps in the specified resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Boolean includeSlots, Context context); - - /** - * Gets the details of a web, mobile, or API app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of a web, mobile, or API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String name); - - /** - * Gets the details of a web, mobile, or API app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of a web, mobile, or API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync(String resourceGroupName, String name); - - /** - * Gets the details of a web, mobile, or API app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of a web, mobile, or API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SiteInner getByResourceGroup(String resourceGroupName, String name); - - /** - * Gets the details of a web, mobile, or API app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of a web, mobile, or API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); - - /** - * Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} - * parameter. - * @param siteEnvelope A JSON representation of the app properties. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a web app, a mobile app backend, or an API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String name, SiteInner siteEnvelope); - - /** - * Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} - * parameter. - * @param siteEnvelope A JSON representation of the app properties. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a web app, a mobile app backend, or an API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, SiteInner> beginCreateOrUpdateAsync( - String resourceGroupName, String name, SiteInner siteEnvelope); - - /** - * Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} - * parameter. - * @param siteEnvelope A JSON representation of the app properties. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a web app, a mobile app backend, or an API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, SiteInner> beginCreateOrUpdate( - String resourceGroupName, String name, SiteInner siteEnvelope); - - /** - * Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} - * parameter. - * @param siteEnvelope A JSON representation of the app properties. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a web app, a mobile app backend, or an API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, SiteInner> beginCreateOrUpdate( - String resourceGroupName, String name, SiteInner siteEnvelope, Context context); - - /** - * Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} - * parameter. - * @param siteEnvelope A JSON representation of the app properties. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a web app, a mobile app backend, or an API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync(String resourceGroupName, String name, SiteInner siteEnvelope); - - /** - * Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} - * parameter. - * @param siteEnvelope A JSON representation of the app properties. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a web app, a mobile app backend, or an API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SiteInner createOrUpdate(String resourceGroupName, String name, SiteInner siteEnvelope); - - /** - * Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} - * parameter. - * @param siteEnvelope A JSON representation of the app properties. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a web app, a mobile app backend, or an API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SiteInner createOrUpdate(String resourceGroupName, String name, SiteInner siteEnvelope, Context context); - - /** - * Deletes a web, mobile, or API app, or one of the deployment slots. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app to delete. - * @param deleteMetrics If true, web app metrics are also deleted. - * @param deleteEmptyServerFarm Specify false if you want to keep empty App Service plan. By default, empty App - * Service plan is deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteWithResponseAsync( - String resourceGroupName, String name, Boolean deleteMetrics, Boolean deleteEmptyServerFarm); - - /** - * Deletes a web, mobile, or API app, or one of the deployment slots. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app to delete. - * @param deleteMetrics If true, web app metrics are also deleted. - * @param deleteEmptyServerFarm Specify false if you want to keep empty App Service plan. By default, empty App - * Service plan is deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String name, Boolean deleteMetrics, Boolean deleteEmptyServerFarm); - - /** - * Deletes a web, mobile, or API app, or one of the deployment slots. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app to delete. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String name); - - /** - * Deletes a web, mobile, or API app, or one of the deployment slots. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app to delete. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String name); - - /** - * Deletes a web, mobile, or API app, or one of the deployment slots. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app to delete. - * @param deleteMetrics If true, web app metrics are also deleted. - * @param deleteEmptyServerFarm Specify false if you want to keep empty App Service plan. By default, empty App - * Service plan is deleted. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse( - String resourceGroupName, String name, Boolean deleteMetrics, Boolean deleteEmptyServerFarm, Context context); - - /** - * Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} - * parameter. - * @param siteEnvelope A JSON representation of the app properties. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a web app, a mobile app backend, or an API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateWithResponseAsync( - String resourceGroupName, String name, SitePatchResourceInner siteEnvelope); - - /** - * Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} - * parameter. - * @param siteEnvelope A JSON representation of the app properties. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a web app, a mobile app backend, or an API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAsync(String resourceGroupName, String name, SitePatchResourceInner siteEnvelope); - - /** - * Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} - * parameter. - * @param siteEnvelope A JSON representation of the app properties. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a web app, a mobile app backend, or an API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SiteInner update(String resourceGroupName, String name, SitePatchResourceInner siteEnvelope); - - /** - * Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} - * parameter. - * @param siteEnvelope A JSON representation of the app properties. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a web app, a mobile app backend, or an API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String resourceGroupName, String name, SitePatchResourceInner siteEnvelope, Context context); - - /** - * Analyze a custom hostname. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param hostname Custom hostname. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return custom domain analysis. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> analyzeCustomHostnameWithResponseAsync( - String resourceGroupName, String name, String hostname); - - /** - * Analyze a custom hostname. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param hostname Custom hostname. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return custom domain analysis. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono analyzeCustomHostnameAsync( - String resourceGroupName, String name, String hostname); - - /** - * Analyze a custom hostname. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return custom domain analysis. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono analyzeCustomHostnameAsync(String resourceGroupName, String name); - - /** - * Analyze a custom hostname. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return custom domain analysis. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - CustomHostnameAnalysisResultInner analyzeCustomHostname(String resourceGroupName, String name); - - /** - * Analyze a custom hostname. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param hostname Custom hostname. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return custom domain analysis. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response analyzeCustomHostnameWithResponse( - String resourceGroupName, String name, String hostname, Context context); - - /** - * Applies the configuration settings from the target slot onto the current slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slotSwapEntity JSON object that contains the target slot name. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> applySlotConfigToProductionWithResponseAsync( - String resourceGroupName, String name, CsmSlotEntity slotSwapEntity); - - /** - * Applies the configuration settings from the target slot onto the current slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slotSwapEntity JSON object that contains the target slot name. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono applySlotConfigToProductionAsync(String resourceGroupName, String name, CsmSlotEntity slotSwapEntity); - - /** - * Applies the configuration settings from the target slot onto the current slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slotSwapEntity JSON object that contains the target slot name. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void applySlotConfigToProduction(String resourceGroupName, String name, CsmSlotEntity slotSwapEntity); - - /** - * Applies the configuration settings from the target slot onto the current slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slotSwapEntity JSON object that contains the target slot name. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response applySlotConfigToProductionWithResponse( - String resourceGroupName, String name, CsmSlotEntity slotSwapEntity, Context context); - - /** - * Creates a backup of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param request Backup configuration. You can use the JSON response from the POST action as input here. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup description. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> backupWithResponseAsync( - String resourceGroupName, String name, BackupRequestInner request); - - /** - * Creates a backup of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param request Backup configuration. You can use the JSON response from the POST action as input here. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup description. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono backupAsync(String resourceGroupName, String name, BackupRequestInner request); - - /** - * Creates a backup of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param request Backup configuration. You can use the JSON response from the POST action as input here. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup description. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - BackupItemInner backup(String resourceGroupName, String name, BackupRequestInner request); - - /** - * Creates a backup of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param request Backup configuration. You can use the JSON response from the POST action as input here. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup description. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response backupWithResponse( - String resourceGroupName, String name, BackupRequestInner request, Context context); - - /** - * Gets existing backups of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return existing backups of an app. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listBackupsAsync(String resourceGroupName, String name); - - /** - * Gets existing backups of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return existing backups of an app. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listBackups(String resourceGroupName, String name); - - /** - * Gets existing backups of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return existing backups of an app. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listBackups(String resourceGroupName, String name, Context context); - - /** - * Gets a backup of an app by its ID. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a backup of an app by its ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getBackupStatusWithResponseAsync( - String resourceGroupName, String name, String backupId); - - /** - * Gets a backup of an app by its ID. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a backup of an app by its ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getBackupStatusAsync(String resourceGroupName, String name, String backupId); - - /** - * Gets a backup of an app by its ID. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a backup of an app by its ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - BackupItemInner getBackupStatus(String resourceGroupName, String name, String backupId); - - /** - * Gets a backup of an app by its ID. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a backup of an app by its ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getBackupStatusWithResponse( - String resourceGroupName, String name, String backupId, Context context); - - /** - * Deletes a backup of an app by its ID. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteBackupWithResponseAsync(String resourceGroupName, String name, String backupId); - - /** - * Deletes a backup of an app by its ID. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteBackupAsync(String resourceGroupName, String name, String backupId); - - /** - * Deletes a backup of an app by its ID. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deleteBackup(String resourceGroupName, String name, String backupId); - - /** - * Deletes a backup of an app by its ID. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteBackupWithResponse(String resourceGroupName, String name, String backupId, Context context); - - /** - * Gets status of a web app backup that may be in progress, including secrets associated with the backup, such as - * the Azure Storage SAS URL. Also can be used to update the SAS URL for the backup if a new URL is passed in the - * request body. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param backupId ID of backup. - * @param request Information on backup request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return status of a web app backup that may be in progress, including secrets associated with the backup, such as - * the Azure Storage SAS URL. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listBackupStatusSecretsWithResponseAsync( - String resourceGroupName, String name, String backupId, BackupRequestInner request); - - /** - * Gets status of a web app backup that may be in progress, including secrets associated with the backup, such as - * the Azure Storage SAS URL. Also can be used to update the SAS URL for the backup if a new URL is passed in the - * request body. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param backupId ID of backup. - * @param request Information on backup request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return status of a web app backup that may be in progress, including secrets associated with the backup, such as - * the Azure Storage SAS URL. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listBackupStatusSecretsAsync( - String resourceGroupName, String name, String backupId, BackupRequestInner request); - - /** - * Gets status of a web app backup that may be in progress, including secrets associated with the backup, such as - * the Azure Storage SAS URL. Also can be used to update the SAS URL for the backup if a new URL is passed in the - * request body. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param backupId ID of backup. - * @param request Information on backup request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return status of a web app backup that may be in progress, including secrets associated with the backup, such as - * the Azure Storage SAS URL. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - BackupItemInner listBackupStatusSecrets( - String resourceGroupName, String name, String backupId, BackupRequestInner request); - - /** - * Gets status of a web app backup that may be in progress, including secrets associated with the backup, such as - * the Azure Storage SAS URL. Also can be used to update the SAS URL for the backup if a new URL is passed in the - * request body. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param backupId ID of backup. - * @param request Information on backup request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return status of a web app backup that may be in progress, including secrets associated with the backup, such as - * the Azure Storage SAS URL. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listBackupStatusSecretsWithResponse( - String resourceGroupName, String name, String backupId, BackupRequestInner request, Context context); - - /** - * Restores a specific backup to another app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param request Information on restore request . - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> restoreWithResponseAsync( - String resourceGroupName, String name, String backupId, RestoreRequestInner request); - - /** - * Restores a specific backup to another app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param request Information on restore request . - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginRestoreAsync( - String resourceGroupName, String name, String backupId, RestoreRequestInner request); - - /** - * Restores a specific backup to another app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param request Information on restore request . - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginRestore( - String resourceGroupName, String name, String backupId, RestoreRequestInner request); - - /** - * Restores a specific backup to another app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param request Information on restore request . - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginRestore( - String resourceGroupName, String name, String backupId, RestoreRequestInner request, Context context); - - /** - * Restores a specific backup to another app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param request Information on restore request . - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono restoreAsync(String resourceGroupName, String name, String backupId, RestoreRequestInner request); - - /** - * Restores a specific backup to another app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param request Information on restore request . - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void restore(String resourceGroupName, String name, String backupId, RestoreRequestInner request); - - /** - * Restores a specific backup to another app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param request Information on restore request . - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void restore(String resourceGroupName, String name, String backupId, RestoreRequestInner request, Context context); - - /** - * List the configurations of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of site configurations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listConfigurationsAsync(String resourceGroupName, String name); - - /** - * List the configurations of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of site configurations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listConfigurations(String resourceGroupName, String name); - - /** - * List the configurations of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of site configurations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listConfigurations(String resourceGroupName, String name, Context context); - - /** - * Replaces the application settings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param appSettings Application settings of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return string dictionary resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateApplicationSettingsWithResponseAsync( - String resourceGroupName, String name, StringDictionaryInner appSettings); - - /** - * Replaces the application settings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param appSettings Application settings of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return string dictionary resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateApplicationSettingsAsync( - String resourceGroupName, String name, StringDictionaryInner appSettings); - - /** - * Replaces the application settings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param appSettings Application settings of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return string dictionary resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - StringDictionaryInner updateApplicationSettings( - String resourceGroupName, String name, StringDictionaryInner appSettings); - - /** - * Replaces the application settings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param appSettings Application settings of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return string dictionary resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateApplicationSettingsWithResponse( - String resourceGroupName, String name, StringDictionaryInner appSettings, Context context); - - /** - * Gets the application settings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the application settings of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listApplicationSettingsWithResponseAsync( - String resourceGroupName, String name); - - /** - * Gets the application settings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the application settings of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listApplicationSettingsAsync(String resourceGroupName, String name); - - /** - * Gets the application settings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the application settings of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - StringDictionaryInner listApplicationSettings(String resourceGroupName, String name); - - /** - * Gets the application settings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the application settings of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listApplicationSettingsWithResponse( - String resourceGroupName, String name, Context context); - - /** - * Updates the Authentication / Authorization settings associated with web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param siteAuthSettings Auth settings associated with web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration settings for the Azure App Service Authentication / Authorization feature. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateAuthSettingsWithResponseAsync( - String resourceGroupName, String name, SiteAuthSettingsInner siteAuthSettings); - - /** - * Updates the Authentication / Authorization settings associated with web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param siteAuthSettings Auth settings associated with web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration settings for the Azure App Service Authentication / Authorization feature. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAuthSettingsAsync( - String resourceGroupName, String name, SiteAuthSettingsInner siteAuthSettings); - - /** - * Updates the Authentication / Authorization settings associated with web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param siteAuthSettings Auth settings associated with web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration settings for the Azure App Service Authentication / Authorization feature. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SiteAuthSettingsInner updateAuthSettings( - String resourceGroupName, String name, SiteAuthSettingsInner siteAuthSettings); - - /** - * Updates the Authentication / Authorization settings associated with web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param siteAuthSettings Auth settings associated with web app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration settings for the Azure App Service Authentication / Authorization feature. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateAuthSettingsWithResponse( - String resourceGroupName, String name, SiteAuthSettingsInner siteAuthSettings, Context context); - - /** - * Gets the Authentication/Authorization settings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Authentication/Authorization settings of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getAuthSettingsWithResponseAsync(String resourceGroupName, String name); - - /** - * Gets the Authentication/Authorization settings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Authentication/Authorization settings of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAuthSettingsAsync(String resourceGroupName, String name); - - /** - * Gets the Authentication/Authorization settings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Authentication/Authorization settings of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SiteAuthSettingsInner getAuthSettings(String resourceGroupName, String name); - - /** - * Gets the Authentication/Authorization settings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Authentication/Authorization settings of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getAuthSettingsWithResponse(String resourceGroupName, String name, Context context); - - /** - * Updates the Azure storage account configurations of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param azureStorageAccounts Azure storage accounts of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azureStorageInfo dictionary resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateAzureStorageAccountsWithResponseAsync( - String resourceGroupName, String name, AzureStoragePropertyDictionaryResourceInner azureStorageAccounts); - - /** - * Updates the Azure storage account configurations of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param azureStorageAccounts Azure storage accounts of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azureStorageInfo dictionary resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAzureStorageAccountsAsync( - String resourceGroupName, String name, AzureStoragePropertyDictionaryResourceInner azureStorageAccounts); - - /** - * Updates the Azure storage account configurations of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param azureStorageAccounts Azure storage accounts of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azureStorageInfo dictionary resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AzureStoragePropertyDictionaryResourceInner updateAzureStorageAccounts( - String resourceGroupName, String name, AzureStoragePropertyDictionaryResourceInner azureStorageAccounts); - - /** - * Updates the Azure storage account configurations of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param azureStorageAccounts Azure storage accounts of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azureStorageInfo dictionary resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateAzureStorageAccountsWithResponse( - String resourceGroupName, - String name, - AzureStoragePropertyDictionaryResourceInner azureStorageAccounts, - Context context); - - /** - * Gets the Azure storage account configurations of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Azure storage account configurations of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listAzureStorageAccountsWithResponseAsync( - String resourceGroupName, String name); - - /** - * Gets the Azure storage account configurations of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Azure storage account configurations of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listAzureStorageAccountsAsync( - String resourceGroupName, String name); - - /** - * Gets the Azure storage account configurations of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Azure storage account configurations of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AzureStoragePropertyDictionaryResourceInner listAzureStorageAccounts(String resourceGroupName, String name); - - /** - * Gets the Azure storage account configurations of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Azure storage account configurations of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listAzureStorageAccountsWithResponse( - String resourceGroupName, String name, Context context); - - /** - * Updates the backup configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param request Edited backup configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a backup which will be performed. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateBackupConfigurationWithResponseAsync( - String resourceGroupName, String name, BackupRequestInner request); - - /** - * Updates the backup configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param request Edited backup configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a backup which will be performed. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateBackupConfigurationAsync( - String resourceGroupName, String name, BackupRequestInner request); - - /** - * Updates the backup configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param request Edited backup configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a backup which will be performed. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - BackupRequestInner updateBackupConfiguration(String resourceGroupName, String name, BackupRequestInner request); - - /** - * Updates the backup configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param request Edited backup configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a backup which will be performed. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateBackupConfigurationWithResponse( - String resourceGroupName, String name, BackupRequestInner request, Context context); - - /** - * Deletes the backup configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteBackupConfigurationWithResponseAsync(String resourceGroupName, String name); - - /** - * Deletes the backup configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteBackupConfigurationAsync(String resourceGroupName, String name); - - /** - * Deletes the backup configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deleteBackupConfiguration(String resourceGroupName, String name); - - /** - * Deletes the backup configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteBackupConfigurationWithResponse(String resourceGroupName, String name, Context context); - - /** - * Gets the backup configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the backup configuration of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getBackupConfigurationWithResponseAsync(String resourceGroupName, String name); - - /** - * Gets the backup configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the backup configuration of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getBackupConfigurationAsync(String resourceGroupName, String name); - - /** - * Gets the backup configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the backup configuration of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - BackupRequestInner getBackupConfiguration(String resourceGroupName, String name); - - /** - * Gets the backup configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the backup configuration of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getBackupConfigurationWithResponse( - String resourceGroupName, String name, Context context); - - /** - * Replaces the connection strings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param connectionStrings Connection strings of the app or deployment slot. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return string dictionary resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateConnectionStringsWithResponseAsync( - String resourceGroupName, String name, ConnectionStringDictionaryInner connectionStrings); - - /** - * Replaces the connection strings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param connectionStrings Connection strings of the app or deployment slot. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return string dictionary resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateConnectionStringsAsync( - String resourceGroupName, String name, ConnectionStringDictionaryInner connectionStrings); - - /** - * Replaces the connection strings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param connectionStrings Connection strings of the app or deployment slot. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return string dictionary resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ConnectionStringDictionaryInner updateConnectionStrings( - String resourceGroupName, String name, ConnectionStringDictionaryInner connectionStrings); - - /** - * Replaces the connection strings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param connectionStrings Connection strings of the app or deployment slot. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return string dictionary resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateConnectionStringsWithResponse( - String resourceGroupName, String name, ConnectionStringDictionaryInner connectionStrings, Context context); - - /** - * Gets the connection strings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the connection strings of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listConnectionStringsWithResponseAsync( - String resourceGroupName, String name); - - /** - * Gets the connection strings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the connection strings of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listConnectionStringsAsync(String resourceGroupName, String name); - - /** - * Gets the connection strings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the connection strings of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ConnectionStringDictionaryInner listConnectionStrings(String resourceGroupName, String name); - - /** - * Gets the connection strings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the connection strings of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listConnectionStringsWithResponse( - String resourceGroupName, String name, Context context); - - /** - * Gets the logging configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the logging configuration of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getDiagnosticLogsConfigurationWithResponseAsync( - String resourceGroupName, String name); - - /** - * Gets the logging configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the logging configuration of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getDiagnosticLogsConfigurationAsync(String resourceGroupName, String name); - - /** - * Gets the logging configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the logging configuration of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SiteLogsConfigInner getDiagnosticLogsConfiguration(String resourceGroupName, String name); - - /** - * Gets the logging configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the logging configuration of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getDiagnosticLogsConfigurationWithResponse( - String resourceGroupName, String name, Context context); - - /** - * Updates the logging configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param siteLogsConfig A SiteLogsConfig JSON object that contains the logging configuration to change in the - * "properties" property. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration of App Service site logs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateDiagnosticLogsConfigWithResponseAsync( - String resourceGroupName, String name, SiteLogsConfigInner siteLogsConfig); - - /** - * Updates the logging configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param siteLogsConfig A SiteLogsConfig JSON object that contains the logging configuration to change in the - * "properties" property. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration of App Service site logs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateDiagnosticLogsConfigAsync( - String resourceGroupName, String name, SiteLogsConfigInner siteLogsConfig); - - /** - * Updates the logging configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param siteLogsConfig A SiteLogsConfig JSON object that contains the logging configuration to change in the - * "properties" property. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration of App Service site logs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SiteLogsConfigInner updateDiagnosticLogsConfig( - String resourceGroupName, String name, SiteLogsConfigInner siteLogsConfig); - - /** - * Updates the logging configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param siteLogsConfig A SiteLogsConfig JSON object that contains the logging configuration to change in the - * "properties" property. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration of App Service site logs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateDiagnosticLogsConfigWithResponse( - String resourceGroupName, String name, SiteLogsConfigInner siteLogsConfig, Context context); - - /** - * Replaces the metadata of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param metadata Edited metadata of the app or deployment slot. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return string dictionary resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateMetadataWithResponseAsync( - String resourceGroupName, String name, StringDictionaryInner metadata); - - /** - * Replaces the metadata of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param metadata Edited metadata of the app or deployment slot. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return string dictionary resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateMetadataAsync( - String resourceGroupName, String name, StringDictionaryInner metadata); - - /** - * Replaces the metadata of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param metadata Edited metadata of the app or deployment slot. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return string dictionary resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - StringDictionaryInner updateMetadata(String resourceGroupName, String name, StringDictionaryInner metadata); - - /** - * Replaces the metadata of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param metadata Edited metadata of the app or deployment slot. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return string dictionary resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateMetadataWithResponse( - String resourceGroupName, String name, StringDictionaryInner metadata, Context context); - - /** - * Gets the metadata of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the metadata of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listMetadataWithResponseAsync(String resourceGroupName, String name); - - /** - * Gets the metadata of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the metadata of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listMetadataAsync(String resourceGroupName, String name); - - /** - * Gets the metadata of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the metadata of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - StringDictionaryInner listMetadata(String resourceGroupName, String name); - - /** - * Gets the metadata of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the metadata of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listMetadataWithResponse(String resourceGroupName, String name, Context context); - - /** - * Gets the Git/FTP publishing credentials of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Git/FTP publishing credentials of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> listPublishingCredentialsWithResponseAsync(String resourceGroupName, String name); - - /** - * Gets the Git/FTP publishing credentials of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Git/FTP publishing credentials of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, UserInner> beginListPublishingCredentialsAsync( - String resourceGroupName, String name); - - /** - * Gets the Git/FTP publishing credentials of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Git/FTP publishing credentials of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, UserInner> beginListPublishingCredentials(String resourceGroupName, String name); - - /** - * Gets the Git/FTP publishing credentials of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Git/FTP publishing credentials of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, UserInner> beginListPublishingCredentials( - String resourceGroupName, String name, Context context); - - /** - * Gets the Git/FTP publishing credentials of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Git/FTP publishing credentials of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listPublishingCredentialsAsync(String resourceGroupName, String name); - - /** - * Gets the Git/FTP publishing credentials of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Git/FTP publishing credentials of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - UserInner listPublishingCredentials(String resourceGroupName, String name); - - /** - * Gets the Git/FTP publishing credentials of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Git/FTP publishing credentials of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - UserInner listPublishingCredentials(String resourceGroupName, String name, Context context); - - /** - * Updates the Push settings associated with web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param pushSettings Push settings associated with web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return push settings for the App. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateSitePushSettingsWithResponseAsync( - String resourceGroupName, String name, PushSettingsInner pushSettings); - - /** - * Updates the Push settings associated with web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param pushSettings Push settings associated with web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return push settings for the App. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateSitePushSettingsAsync( - String resourceGroupName, String name, PushSettingsInner pushSettings); - - /** - * Updates the Push settings associated with web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param pushSettings Push settings associated with web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return push settings for the App. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PushSettingsInner updateSitePushSettings(String resourceGroupName, String name, PushSettingsInner pushSettings); - - /** - * Updates the Push settings associated with web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param pushSettings Push settings associated with web app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return push settings for the App. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateSitePushSettingsWithResponse( - String resourceGroupName, String name, PushSettingsInner pushSettings, Context context); - - /** - * Gets the Push settings associated with web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Push settings associated with web app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listSitePushSettingsWithResponseAsync(String resourceGroupName, String name); - - /** - * Gets the Push settings associated with web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Push settings associated with web app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listSitePushSettingsAsync(String resourceGroupName, String name); - - /** - * Gets the Push settings associated with web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Push settings associated with web app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PushSettingsInner listSitePushSettings(String resourceGroupName, String name); - - /** - * Gets the Push settings associated with web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Push settings associated with web app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listSitePushSettingsWithResponse( - String resourceGroupName, String name, Context context); - - /** - * Gets the names of app settings and connection strings that stick to the slot (not swapped). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the names of app settings and connection strings that stick to the slot (not swapped). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listSlotConfigurationNamesWithResponseAsync( - String resourceGroupName, String name); - - /** - * Gets the names of app settings and connection strings that stick to the slot (not swapped). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the names of app settings and connection strings that stick to the slot (not swapped). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listSlotConfigurationNamesAsync(String resourceGroupName, String name); - - /** - * Gets the names of app settings and connection strings that stick to the slot (not swapped). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the names of app settings and connection strings that stick to the slot (not swapped). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SlotConfigNamesResourceInner listSlotConfigurationNames(String resourceGroupName, String name); - - /** - * Gets the names of app settings and connection strings that stick to the slot (not swapped). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the names of app settings and connection strings that stick to the slot (not swapped). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listSlotConfigurationNamesWithResponse( - String resourceGroupName, String name, Context context); - - /** - * Updates the names of application settings and connection string that remain with the slot during swap operation. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slotConfigNames Names of application settings and connection strings. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return slot Config names azure resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateSlotConfigurationNamesWithResponseAsync( - String resourceGroupName, String name, SlotConfigNamesResourceInner slotConfigNames); - - /** - * Updates the names of application settings and connection string that remain with the slot during swap operation. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slotConfigNames Names of application settings and connection strings. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return slot Config names azure resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateSlotConfigurationNamesAsync( - String resourceGroupName, String name, SlotConfigNamesResourceInner slotConfigNames); - - /** - * Updates the names of application settings and connection string that remain with the slot during swap operation. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slotConfigNames Names of application settings and connection strings. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return slot Config names azure resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SlotConfigNamesResourceInner updateSlotConfigurationNames( - String resourceGroupName, String name, SlotConfigNamesResourceInner slotConfigNames); - - /** - * Updates the names of application settings and connection string that remain with the slot during swap operation. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slotConfigNames Names of application settings and connection strings. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return slot Config names azure resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateSlotConfigurationNamesWithResponse( - String resourceGroupName, String name, SlotConfigNamesResourceInner slotConfigNames, Context context); - - /** - * Gets the configuration of an app, such as platform version and bitness, default documents, virtual applications, - * Always On, etc. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the configuration of an app, such as platform version and bitness, default documents, virtual - * applications, Always On, etc. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getConfigurationWithResponseAsync(String resourceGroupName, String name); - - /** - * Gets the configuration of an app, such as platform version and bitness, default documents, virtual applications, - * Always On, etc. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the configuration of an app, such as platform version and bitness, default documents, virtual - * applications, Always On, etc. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getConfigurationAsync(String resourceGroupName, String name); - - /** - * Gets the configuration of an app, such as platform version and bitness, default documents, virtual applications, - * Always On, etc. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the configuration of an app, such as platform version and bitness, default documents, virtual - * applications, Always On, etc. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SiteConfigResourceInner getConfiguration(String resourceGroupName, String name); - - /** - * Gets the configuration of an app, such as platform version and bitness, default documents, virtual applications, - * Always On, etc. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the configuration of an app, such as platform version and bitness, default documents, virtual - * applications, Always On, etc. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getConfigurationWithResponse( - String resourceGroupName, String name, Context context); - - /** - * Updates the configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param siteConfig JSON representation of a SiteConfig object. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return web app configuration ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createOrUpdateConfigurationWithResponseAsync( - String resourceGroupName, String name, SiteConfigResourceInner siteConfig); - - /** - * Updates the configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param siteConfig JSON representation of a SiteConfig object. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return web app configuration ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateConfigurationAsync( - String resourceGroupName, String name, SiteConfigResourceInner siteConfig); - - /** - * Updates the configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param siteConfig JSON representation of a SiteConfig object. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return web app configuration ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SiteConfigResourceInner createOrUpdateConfiguration( - String resourceGroupName, String name, SiteConfigResourceInner siteConfig); - - /** - * Updates the configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param siteConfig JSON representation of a SiteConfig object. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return web app configuration ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateConfigurationWithResponse( - String resourceGroupName, String name, SiteConfigResourceInner siteConfig, Context context); - - /** - * Updates the configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param siteConfig JSON representation of a SiteConfig object. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return web app configuration ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateConfigurationWithResponseAsync( - String resourceGroupName, String name, SiteConfigResourceInner siteConfig); - - /** - * Updates the configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param siteConfig JSON representation of a SiteConfig object. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return web app configuration ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateConfigurationAsync( - String resourceGroupName, String name, SiteConfigResourceInner siteConfig); - - /** - * Updates the configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param siteConfig JSON representation of a SiteConfig object. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return web app configuration ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SiteConfigResourceInner updateConfiguration( - String resourceGroupName, String name, SiteConfigResourceInner siteConfig); - - /** - * Updates the configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param siteConfig JSON representation of a SiteConfig object. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return web app configuration ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateConfigurationWithResponse( - String resourceGroupName, String name, SiteConfigResourceInner siteConfig, Context context); - - /** - * Gets a list of web app configuration snapshots identifiers. Each element of the list contains a timestamp and the - * ID of the snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of web app configuration snapshots identifiers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listConfigurationSnapshotInfoAsync( - String resourceGroupName, String name); - - /** - * Gets a list of web app configuration snapshots identifiers. Each element of the list contains a timestamp and the - * ID of the snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of web app configuration snapshots identifiers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listConfigurationSnapshotInfo( - String resourceGroupName, String name); - - /** - * Gets a list of web app configuration snapshots identifiers. Each element of the list contains a timestamp and the - * ID of the snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of web app configuration snapshots identifiers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listConfigurationSnapshotInfo( - String resourceGroupName, String name, Context context); - - /** - * Gets a snapshot of the configuration of an app at a previous point in time. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param snapshotId The ID of the snapshot to read. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a snapshot of the configuration of an app at a previous point in time. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getConfigurationSnapshotWithResponseAsync( - String resourceGroupName, String name, String snapshotId); - - /** - * Gets a snapshot of the configuration of an app at a previous point in time. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param snapshotId The ID of the snapshot to read. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a snapshot of the configuration of an app at a previous point in time. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getConfigurationSnapshotAsync( - String resourceGroupName, String name, String snapshotId); - - /** - * Gets a snapshot of the configuration of an app at a previous point in time. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param snapshotId The ID of the snapshot to read. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a snapshot of the configuration of an app at a previous point in time. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SiteConfigResourceInner getConfigurationSnapshot(String resourceGroupName, String name, String snapshotId); - - /** - * Gets a snapshot of the configuration of an app at a previous point in time. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param snapshotId The ID of the snapshot to read. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a snapshot of the configuration of an app at a previous point in time. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getConfigurationSnapshotWithResponse( - String resourceGroupName, String name, String snapshotId, Context context); - - /** - * Reverts the configuration of an app to a previous snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param snapshotId The ID of the snapshot to read. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> recoverSiteConfigurationSnapshotWithResponseAsync( - String resourceGroupName, String name, String snapshotId); - - /** - * Reverts the configuration of an app to a previous snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param snapshotId The ID of the snapshot to read. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono recoverSiteConfigurationSnapshotAsync(String resourceGroupName, String name, String snapshotId); - - /** - * Reverts the configuration of an app to a previous snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param snapshotId The ID of the snapshot to read. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void recoverSiteConfigurationSnapshot(String resourceGroupName, String name, String snapshotId); - - /** - * Reverts the configuration of an app to a previous snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param snapshotId The ID of the snapshot to read. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response recoverSiteConfigurationSnapshotWithResponse( - String resourceGroupName, String name, String snapshotId, Context context); - - /** - * Gets the last lines of docker logs for the given site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the last lines of docker logs for the given site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getWebSiteContainerLogsWithResponseAsync(String resourceGroupName, String name); - - /** - * Gets the last lines of docker logs for the given site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the last lines of docker logs for the given site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Flux getWebSiteContainerLogsAsync(String resourceGroupName, String name); - - /** - * Gets the last lines of docker logs for the given site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the last lines of docker logs for the given site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - InputStream getWebSiteContainerLogs(String resourceGroupName, String name); - - /** - * Gets the last lines of docker logs for the given site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the last lines of docker logs for the given site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - StreamResponse getWebSiteContainerLogsWithResponse(String resourceGroupName, String name, Context context); - - /** - * Gets the ZIP archived docker log files for the given site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ZIP archived docker log files for the given site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getContainerLogsZipWithResponseAsync(String resourceGroupName, String name); - - /** - * Gets the ZIP archived docker log files for the given site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ZIP archived docker log files for the given site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Flux getContainerLogsZipAsync(String resourceGroupName, String name); - - /** - * Gets the ZIP archived docker log files for the given site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ZIP archived docker log files for the given site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - InputStream getContainerLogsZip(String resourceGroupName, String name); - - /** - * Gets the ZIP archived docker log files for the given site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ZIP archived docker log files for the given site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - StreamResponse getContainerLogsZipWithResponse(String resourceGroupName, String name, Context context); - - /** - * List continuous web jobs for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu continuous web job information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listContinuousWebJobsAsync(String resourceGroupName, String name); - - /** - * List continuous web jobs for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu continuous web job information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listContinuousWebJobs(String resourceGroupName, String name); - - /** - * List continuous web jobs for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu continuous web job information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listContinuousWebJobs(String resourceGroupName, String name, Context context); - - /** - * Gets a continuous web job by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a continuous web job by its ID for an app, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getContinuousWebJobWithResponseAsync( - String resourceGroupName, String name, String webJobName); - - /** - * Gets a continuous web job by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a continuous web job by its ID for an app, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getContinuousWebJobAsync(String resourceGroupName, String name, String webJobName); - - /** - * Gets a continuous web job by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a continuous web job by its ID for an app, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ContinuousWebJobInner getContinuousWebJob(String resourceGroupName, String name, String webJobName); - - /** - * Gets a continuous web job by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a continuous web job by its ID for an app, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getContinuousWebJobWithResponse( - String resourceGroupName, String name, String webJobName, Context context); - - /** - * Delete a continuous web job by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteContinuousWebJobWithResponseAsync( - String resourceGroupName, String name, String webJobName); - - /** - * Delete a continuous web job by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteContinuousWebJobAsync(String resourceGroupName, String name, String webJobName); - - /** - * Delete a continuous web job by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deleteContinuousWebJob(String resourceGroupName, String name, String webJobName); - - /** - * Delete a continuous web job by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteContinuousWebJobWithResponse( - String resourceGroupName, String name, String webJobName, Context context); - - /** - * Start a continuous web job for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> startContinuousWebJobWithResponseAsync( - String resourceGroupName, String name, String webJobName); - - /** - * Start a continuous web job for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono startContinuousWebJobAsync(String resourceGroupName, String name, String webJobName); - - /** - * Start a continuous web job for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void startContinuousWebJob(String resourceGroupName, String name, String webJobName); - - /** - * Start a continuous web job for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response startContinuousWebJobWithResponse( - String resourceGroupName, String name, String webJobName, Context context); - - /** - * Stop a continuous web job for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> stopContinuousWebJobWithResponseAsync( - String resourceGroupName, String name, String webJobName); - - /** - * Stop a continuous web job for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono stopContinuousWebJobAsync(String resourceGroupName, String name, String webJobName); - - /** - * Stop a continuous web job for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void stopContinuousWebJob(String resourceGroupName, String name, String webJobName); - - /** - * Stop a continuous web job for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response stopContinuousWebJobWithResponse( - String resourceGroupName, String name, String webJobName, Context context); - - /** - * List deployments for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of app deployments. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listDeploymentsAsync(String resourceGroupName, String name); - - /** - * List deployments for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of app deployments. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listDeployments(String resourceGroupName, String name); - - /** - * List deployments for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of app deployments. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listDeployments(String resourceGroupName, String name, Context context); - - /** - * Get a deployment by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param id Deployment ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment by its ID for an app, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getDeploymentWithResponseAsync(String resourceGroupName, String name, String id); - - /** - * Get a deployment by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param id Deployment ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment by its ID for an app, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getDeploymentAsync(String resourceGroupName, String name, String id); - - /** - * Get a deployment by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param id Deployment ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment by its ID for an app, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DeploymentInner getDeployment(String resourceGroupName, String name, String id); - - /** - * Get a deployment by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param id Deployment ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment by its ID for an app, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getDeploymentWithResponse( - String resourceGroupName, String name, String id, Context context); - - /** - * Create a deployment for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param id ID of an existing deployment. - * @param deployment Deployment details. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user credentials used for publishing activity. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createDeploymentWithResponseAsync( - String resourceGroupName, String name, String id, DeploymentInner deployment); - - /** - * Create a deployment for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param id ID of an existing deployment. - * @param deployment Deployment details. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user credentials used for publishing activity. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createDeploymentAsync( - String resourceGroupName, String name, String id, DeploymentInner deployment); - - /** - * Create a deployment for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param id ID of an existing deployment. - * @param deployment Deployment details. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user credentials used for publishing activity. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DeploymentInner createDeployment(String resourceGroupName, String name, String id, DeploymentInner deployment); - - /** - * Create a deployment for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param id ID of an existing deployment. - * @param deployment Deployment details. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user credentials used for publishing activity. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createDeploymentWithResponse( - String resourceGroupName, String name, String id, DeploymentInner deployment, Context context); - - /** - * Delete a deployment by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param id Deployment ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteDeploymentWithResponseAsync(String resourceGroupName, String name, String id); - - /** - * Delete a deployment by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param id Deployment ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteDeploymentAsync(String resourceGroupName, String name, String id); - - /** - * Delete a deployment by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param id Deployment ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deleteDeployment(String resourceGroupName, String name, String id); - - /** - * Delete a deployment by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param id Deployment ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteDeploymentWithResponse(String resourceGroupName, String name, String id, Context context); - - /** - * List deployment log for specific deployment for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param id The ID of a specific deployment. This is the value of the name property in the JSON response from "GET - * /api/sites/{siteName}/deployments". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user credentials used for publishing activity. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listDeploymentLogWithResponseAsync( - String resourceGroupName, String name, String id); - - /** - * List deployment log for specific deployment for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param id The ID of a specific deployment. This is the value of the name property in the JSON response from "GET - * /api/sites/{siteName}/deployments". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user credentials used for publishing activity. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listDeploymentLogAsync(String resourceGroupName, String name, String id); - - /** - * List deployment log for specific deployment for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param id The ID of a specific deployment. This is the value of the name property in the JSON response from "GET - * /api/sites/{siteName}/deployments". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user credentials used for publishing activity. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DeploymentInner listDeploymentLog(String resourceGroupName, String name, String id); - - /** - * List deployment log for specific deployment for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param id The ID of a specific deployment. This is the value of the name property in the JSON response from "GET - * /api/sites/{siteName}/deployments". - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user credentials used for publishing activity. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listDeploymentLogWithResponse( - String resourceGroupName, String name, String id, Context context); - - /** - * Discovers an existing app backup that can be restored from a blob in Azure storage. Use this to get information - * about the databases stored in a backup. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param request A RestoreRequest object that includes Azure storage URL and blog name for discovery of backup. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a restore request. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> discoverBackupWithResponseAsync( - String resourceGroupName, String name, RestoreRequestInner request); - - /** - * Discovers an existing app backup that can be restored from a blob in Azure storage. Use this to get information - * about the databases stored in a backup. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param request A RestoreRequest object that includes Azure storage URL and blog name for discovery of backup. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a restore request. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono discoverBackupAsync(String resourceGroupName, String name, RestoreRequestInner request); - - /** - * Discovers an existing app backup that can be restored from a blob in Azure storage. Use this to get information - * about the databases stored in a backup. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param request A RestoreRequest object that includes Azure storage URL and blog name for discovery of backup. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a restore request. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RestoreRequestInner discoverBackup(String resourceGroupName, String name, RestoreRequestInner request); - - /** - * Discovers an existing app backup that can be restored from a blob in Azure storage. Use this to get information - * about the databases stored in a backup. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param request A RestoreRequest object that includes Azure storage URL and blog name for discovery of backup. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a restore request. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response discoverBackupWithResponse( - String resourceGroupName, String name, RestoreRequestInner request, Context context); - - /** - * Lists ownership identifiers for domain associated with web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of identifiers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listDomainOwnershipIdentifiersAsync(String resourceGroupName, String name); - - /** - * Lists ownership identifiers for domain associated with web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of identifiers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listDomainOwnershipIdentifiers(String resourceGroupName, String name); - - /** - * Lists ownership identifiers for domain associated with web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of identifiers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listDomainOwnershipIdentifiers( - String resourceGroupName, String name, Context context); - - /** - * Get domain ownership identifier for web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param domainOwnershipIdentifierName Name of domain ownership identifier. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return domain ownership identifier for web app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getDomainOwnershipIdentifierWithResponseAsync( - String resourceGroupName, String name, String domainOwnershipIdentifierName); - - /** - * Get domain ownership identifier for web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param domainOwnershipIdentifierName Name of domain ownership identifier. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return domain ownership identifier for web app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getDomainOwnershipIdentifierAsync( - String resourceGroupName, String name, String domainOwnershipIdentifierName); - - /** - * Get domain ownership identifier for web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param domainOwnershipIdentifierName Name of domain ownership identifier. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return domain ownership identifier for web app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - IdentifierInner getDomainOwnershipIdentifier( - String resourceGroupName, String name, String domainOwnershipIdentifierName); - - /** - * Get domain ownership identifier for web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param domainOwnershipIdentifierName Name of domain ownership identifier. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return domain ownership identifier for web app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getDomainOwnershipIdentifierWithResponse( - String resourceGroupName, String name, String domainOwnershipIdentifierName, Context context); - - /** - * Creates a domain ownership identifier for web app, or updates an existing ownership identifier. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param domainOwnershipIdentifierName Name of domain ownership identifier. - * @param domainOwnershipIdentifier A JSON representation of the domain ownership properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a domain specific resource identifier. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createOrUpdateDomainOwnershipIdentifierWithResponseAsync( - String resourceGroupName, - String name, - String domainOwnershipIdentifierName, - IdentifierInner domainOwnershipIdentifier); - - /** - * Creates a domain ownership identifier for web app, or updates an existing ownership identifier. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param domainOwnershipIdentifierName Name of domain ownership identifier. - * @param domainOwnershipIdentifier A JSON representation of the domain ownership properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a domain specific resource identifier. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateDomainOwnershipIdentifierAsync( - String resourceGroupName, - String name, - String domainOwnershipIdentifierName, - IdentifierInner domainOwnershipIdentifier); - - /** - * Creates a domain ownership identifier for web app, or updates an existing ownership identifier. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param domainOwnershipIdentifierName Name of domain ownership identifier. - * @param domainOwnershipIdentifier A JSON representation of the domain ownership properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a domain specific resource identifier. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - IdentifierInner createOrUpdateDomainOwnershipIdentifier( - String resourceGroupName, - String name, - String domainOwnershipIdentifierName, - IdentifierInner domainOwnershipIdentifier); - - /** - * Creates a domain ownership identifier for web app, or updates an existing ownership identifier. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param domainOwnershipIdentifierName Name of domain ownership identifier. - * @param domainOwnershipIdentifier A JSON representation of the domain ownership properties. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a domain specific resource identifier. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateDomainOwnershipIdentifierWithResponse( - String resourceGroupName, - String name, - String domainOwnershipIdentifierName, - IdentifierInner domainOwnershipIdentifier, - Context context); - - /** - * Deletes a domain ownership identifier for a web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param domainOwnershipIdentifierName Name of domain ownership identifier. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteDomainOwnershipIdentifierWithResponseAsync( - String resourceGroupName, String name, String domainOwnershipIdentifierName); - - /** - * Deletes a domain ownership identifier for a web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param domainOwnershipIdentifierName Name of domain ownership identifier. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteDomainOwnershipIdentifierAsync( - String resourceGroupName, String name, String domainOwnershipIdentifierName); - - /** - * Deletes a domain ownership identifier for a web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param domainOwnershipIdentifierName Name of domain ownership identifier. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deleteDomainOwnershipIdentifier(String resourceGroupName, String name, String domainOwnershipIdentifierName); - - /** - * Deletes a domain ownership identifier for a web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param domainOwnershipIdentifierName Name of domain ownership identifier. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteDomainOwnershipIdentifierWithResponse( - String resourceGroupName, String name, String domainOwnershipIdentifierName, Context context); - - /** - * Creates a domain ownership identifier for web app, or updates an existing ownership identifier. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param domainOwnershipIdentifierName Name of domain ownership identifier. - * @param domainOwnershipIdentifier A JSON representation of the domain ownership properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a domain specific resource identifier. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateDomainOwnershipIdentifierWithResponseAsync( - String resourceGroupName, - String name, - String domainOwnershipIdentifierName, - IdentifierInner domainOwnershipIdentifier); - - /** - * Creates a domain ownership identifier for web app, or updates an existing ownership identifier. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param domainOwnershipIdentifierName Name of domain ownership identifier. - * @param domainOwnershipIdentifier A JSON representation of the domain ownership properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a domain specific resource identifier. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateDomainOwnershipIdentifierAsync( - String resourceGroupName, - String name, - String domainOwnershipIdentifierName, - IdentifierInner domainOwnershipIdentifier); - - /** - * Creates a domain ownership identifier for web app, or updates an existing ownership identifier. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param domainOwnershipIdentifierName Name of domain ownership identifier. - * @param domainOwnershipIdentifier A JSON representation of the domain ownership properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a domain specific resource identifier. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - IdentifierInner updateDomainOwnershipIdentifier( - String resourceGroupName, - String name, - String domainOwnershipIdentifierName, - IdentifierInner domainOwnershipIdentifier); - - /** - * Creates a domain ownership identifier for web app, or updates an existing ownership identifier. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param domainOwnershipIdentifierName Name of domain ownership identifier. - * @param domainOwnershipIdentifier A JSON representation of the domain ownership properties. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a domain specific resource identifier. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateDomainOwnershipIdentifierWithResponse( - String resourceGroupName, - String name, - String domainOwnershipIdentifierName, - IdentifierInner domainOwnershipIdentifier, - Context context); - - /** - * Get the status of the last MSDeploy operation. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of the last MSDeploy operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getMSDeployStatusWithResponseAsync(String resourceGroupName, String name); - - /** - * Get the status of the last MSDeploy operation. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of the last MSDeploy operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getMSDeployStatusAsync(String resourceGroupName, String name); - - /** - * Get the status of the last MSDeploy operation. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of the last MSDeploy operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - MSDeployStatusInner getMSDeployStatus(String resourceGroupName, String name); - - /** - * Get the status of the last MSDeploy operation. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of the last MSDeploy operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getMSDeployStatusWithResponse(String resourceGroupName, String name, Context context); - - /** - * Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param mSDeploy Details of MSDeploy operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createMSDeployOperationWithResponseAsync( - String resourceGroupName, String name, MSDeploy mSDeploy); - - /** - * Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param mSDeploy Details of MSDeploy operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, MSDeployStatusInner> beginCreateMSDeployOperationAsync( - String resourceGroupName, String name, MSDeploy mSDeploy); - - /** - * Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param mSDeploy Details of MSDeploy operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, MSDeployStatusInner> beginCreateMSDeployOperation( - String resourceGroupName, String name, MSDeploy mSDeploy); - - /** - * Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param mSDeploy Details of MSDeploy operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, MSDeployStatusInner> beginCreateMSDeployOperation( - String resourceGroupName, String name, MSDeploy mSDeploy, Context context); - - /** - * Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param mSDeploy Details of MSDeploy operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createMSDeployOperationAsync(String resourceGroupName, String name, MSDeploy mSDeploy); - - /** - * Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param mSDeploy Details of MSDeploy operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - MSDeployStatusInner createMSDeployOperation(String resourceGroupName, String name, MSDeploy mSDeploy); - - /** - * Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param mSDeploy Details of MSDeploy operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - MSDeployStatusInner createMSDeployOperation( - String resourceGroupName, String name, MSDeploy mSDeploy, Context context); - - /** - * Get the MSDeploy Log for the last MSDeploy operation. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the MSDeploy Log for the last MSDeploy operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getMSDeployLogWithResponseAsync(String resourceGroupName, String name); - - /** - * Get the MSDeploy Log for the last MSDeploy operation. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the MSDeploy Log for the last MSDeploy operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getMSDeployLogAsync(String resourceGroupName, String name); - - /** - * Get the MSDeploy Log for the last MSDeploy operation. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the MSDeploy Log for the last MSDeploy operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - MSDeployLogInner getMSDeployLog(String resourceGroupName, String name); - - /** - * Get the MSDeploy Log for the last MSDeploy operation. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the MSDeploy Log for the last MSDeploy operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getMSDeployLogWithResponse(String resourceGroupName, String name, Context context); - - /** - * List the functions for a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu function information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listFunctionsAsync(String resourceGroupName, String name); - - /** - * List the functions for a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu function information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listFunctions(String resourceGroupName, String name); - - /** - * List the functions for a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu function information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listFunctions(String resourceGroupName, String name, Context context); - - /** - * Fetch a short lived token that can be exchanged for a master key. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getFunctionsAdminTokenWithResponseAsync(String resourceGroupName, String name); - - /** - * Fetch a short lived token that can be exchanged for a master key. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getFunctionsAdminTokenAsync(String resourceGroupName, String name); - - /** - * Fetch a short lived token that can be exchanged for a master key. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - String getFunctionsAdminToken(String resourceGroupName, String name); - - /** - * Fetch a short lived token that can be exchanged for a master key. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getFunctionsAdminTokenWithResponse(String resourceGroupName, String name, Context context); - - /** - * Get function information by its ID for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function information by its ID for web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getFunctionWithResponseAsync( - String resourceGroupName, String name, String functionName); - - /** - * Get function information by its ID for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function information by its ID for web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getFunctionAsync(String resourceGroupName, String name, String functionName); - - /** - * Get function information by its ID for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function information by its ID for web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - FunctionEnvelopeInner getFunction(String resourceGroupName, String name, String functionName); - - /** - * Get function information by its ID for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function information by its ID for web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getFunctionWithResponse( - String resourceGroupName, String name, String functionName, Context context); - - /** - * Create function for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param functionEnvelope Function details. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createFunctionWithResponseAsync( - String resourceGroupName, String name, String functionName, FunctionEnvelopeInner functionEnvelope); - - /** - * Create function for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param functionEnvelope Function details. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, FunctionEnvelopeInner> beginCreateFunctionAsync( - String resourceGroupName, String name, String functionName, FunctionEnvelopeInner functionEnvelope); - - /** - * Create function for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param functionEnvelope Function details. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, FunctionEnvelopeInner> beginCreateFunction( - String resourceGroupName, String name, String functionName, FunctionEnvelopeInner functionEnvelope); - - /** - * Create function for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param functionEnvelope Function details. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, FunctionEnvelopeInner> beginCreateFunction( - String resourceGroupName, - String name, - String functionName, - FunctionEnvelopeInner functionEnvelope, - Context context); - - /** - * Create function for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param functionEnvelope Function details. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createFunctionAsync( - String resourceGroupName, String name, String functionName, FunctionEnvelopeInner functionEnvelope); - - /** - * Create function for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param functionEnvelope Function details. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - FunctionEnvelopeInner createFunction( - String resourceGroupName, String name, String functionName, FunctionEnvelopeInner functionEnvelope); - - /** - * Create function for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param functionEnvelope Function details. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - FunctionEnvelopeInner createFunction( - String resourceGroupName, - String name, - String functionName, - FunctionEnvelopeInner functionEnvelope, - Context context); - - /** - * Delete a function for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteFunctionWithResponseAsync(String resourceGroupName, String name, String functionName); - - /** - * Delete a function for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteFunctionAsync(String resourceGroupName, String name, String functionName); - - /** - * Delete a function for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deleteFunction(String resourceGroupName, String name, String functionName); - - /** - * Delete a function for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteFunctionWithResponse( - String resourceGroupName, String name, String functionName, Context context); - - /** - * Add or update a function secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName The name of the function. - * @param keyName The name of the key. - * @param key The key to create or update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function key info. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createOrUpdateFunctionSecretWithResponseAsync( - String resourceGroupName, String name, String functionName, String keyName, KeyInfoInner key); - - /** - * Add or update a function secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName The name of the function. - * @param keyName The name of the key. - * @param key The key to create or update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function key info. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateFunctionSecretAsync( - String resourceGroupName, String name, String functionName, String keyName, KeyInfoInner key); - - /** - * Add or update a function secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName The name of the function. - * @param keyName The name of the key. - * @param key The key to create or update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function key info. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - KeyInfoInner createOrUpdateFunctionSecret( - String resourceGroupName, String name, String functionName, String keyName, KeyInfoInner key); - - /** - * Add or update a function secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName The name of the function. - * @param keyName The name of the key. - * @param key The key to create or update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function key info. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateFunctionSecretWithResponse( - String resourceGroupName, String name, String functionName, String keyName, KeyInfoInner key, Context context); - - /** - * Delete a function secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName The name of the function. - * @param keyName The name of the key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteFunctionSecretWithResponseAsync( - String resourceGroupName, String name, String functionName, String keyName); - - /** - * Delete a function secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName The name of the function. - * @param keyName The name of the key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteFunctionSecretAsync(String resourceGroupName, String name, String functionName, String keyName); - - /** - * Delete a function secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName The name of the function. - * @param keyName The name of the key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deleteFunctionSecret(String resourceGroupName, String name, String functionName, String keyName); - - /** - * Delete a function secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName The name of the function. - * @param keyName The name of the key. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteFunctionSecretWithResponse( - String resourceGroupName, String name, String functionName, String keyName, Context context); - - /** - * Get function keys for a function in a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function keys for a function in a web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listFunctionKeysWithResponseAsync( - String resourceGroupName, String name, String functionName); - - /** - * Get function keys for a function in a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function keys for a function in a web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listFunctionKeysAsync(String resourceGroupName, String name, String functionName); - - /** - * Get function keys for a function in a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function keys for a function in a web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - StringDictionaryInner listFunctionKeys(String resourceGroupName, String name, String functionName); - - /** - * Get function keys for a function in a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function keys for a function in a web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listFunctionKeysWithResponse( - String resourceGroupName, String name, String functionName, Context context); - - /** - * Get function secrets for a function in a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function secrets for a function in a web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listFunctionSecretsWithResponseAsync( - String resourceGroupName, String name, String functionName); - - /** - * Get function secrets for a function in a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function secrets for a function in a web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listFunctionSecretsAsync(String resourceGroupName, String name, String functionName); - - /** - * Get function secrets for a function in a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function secrets for a function in a web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - FunctionSecretsInner listFunctionSecrets(String resourceGroupName, String name, String functionName); - - /** - * Get function secrets for a function in a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function secrets for a function in a web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listFunctionSecretsWithResponse( - String resourceGroupName, String name, String functionName, Context context); - - /** - * Get host secrets for a function app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return host secrets for a function app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listHostKeysWithResponseAsync(String resourceGroupName, String name); - - /** - * Get host secrets for a function app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return host secrets for a function app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listHostKeysAsync(String resourceGroupName, String name); - - /** - * Get host secrets for a function app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return host secrets for a function app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - HostKeysInner listHostKeys(String resourceGroupName, String name); - - /** - * Get host secrets for a function app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return host secrets for a function app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listHostKeysWithResponse(String resourceGroupName, String name, Context context); - - /** - * This is to allow calling via powershell and ARM template. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listSyncStatusWithResponseAsync(String resourceGroupName, String name); - - /** - * This is to allow calling via powershell and ARM template. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listSyncStatusAsync(String resourceGroupName, String name); - - /** - * This is to allow calling via powershell and ARM template. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void listSyncStatus(String resourceGroupName, String name); - - /** - * This is to allow calling via powershell and ARM template. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listSyncStatusWithResponse(String resourceGroupName, String name, Context context); - - /** - * Syncs function trigger metadata to the management database. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> syncFunctionsWithResponseAsync(String resourceGroupName, String name); - - /** - * Syncs function trigger metadata to the management database. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono syncFunctionsAsync(String resourceGroupName, String name); - - /** - * Syncs function trigger metadata to the management database. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void syncFunctions(String resourceGroupName, String name); - - /** - * Syncs function trigger metadata to the management database. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response syncFunctionsWithResponse(String resourceGroupName, String name, Context context); - - /** - * Add or update a host level secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param keyType The type of host key. - * @param keyName The name of the key. - * @param key The key to create or update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function key info. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createOrUpdateHostSecretWithResponseAsync( - String resourceGroupName, String name, String keyType, String keyName, KeyInfoInner key); - - /** - * Add or update a host level secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param keyType The type of host key. - * @param keyName The name of the key. - * @param key The key to create or update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function key info. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateHostSecretAsync( - String resourceGroupName, String name, String keyType, String keyName, KeyInfoInner key); - - /** - * Add or update a host level secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param keyType The type of host key. - * @param keyName The name of the key. - * @param key The key to create or update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function key info. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - KeyInfoInner createOrUpdateHostSecret( - String resourceGroupName, String name, String keyType, String keyName, KeyInfoInner key); - - /** - * Add or update a host level secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param keyType The type of host key. - * @param keyName The name of the key. - * @param key The key to create or update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function key info. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateHostSecretWithResponse( - String resourceGroupName, String name, String keyType, String keyName, KeyInfoInner key, Context context); - - /** - * Delete a host level secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param keyType The type of host key. - * @param keyName The name of the key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteHostSecretWithResponseAsync( - String resourceGroupName, String name, String keyType, String keyName); - - /** - * Delete a host level secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param keyType The type of host key. - * @param keyName The name of the key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteHostSecretAsync(String resourceGroupName, String name, String keyType, String keyName); - - /** - * Delete a host level secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param keyType The type of host key. - * @param keyName The name of the key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deleteHostSecret(String resourceGroupName, String name, String keyType, String keyName); - - /** - * Delete a host level secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param keyType The type of host key. - * @param keyName The name of the key. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteHostSecretWithResponse( - String resourceGroupName, String name, String keyType, String keyName, Context context); - - /** - * Get hostname bindings for an app or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hostname bindings for an app or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listHostnameBindingsAsync(String resourceGroupName, String name); - - /** - * Get hostname bindings for an app or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hostname bindings for an app or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listHostnameBindings(String resourceGroupName, String name); - - /** - * Get hostname bindings for an app or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hostname bindings for an app or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listHostnameBindings(String resourceGroupName, String name, Context context); - - /** - * Get the named hostname binding for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param hostname Hostname in the hostname binding. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the named hostname binding for an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getHostnameBindingWithResponseAsync( - String resourceGroupName, String name, String hostname); - - /** - * Get the named hostname binding for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param hostname Hostname in the hostname binding. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the named hostname binding for an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getHostnameBindingAsync(String resourceGroupName, String name, String hostname); - - /** - * Get the named hostname binding for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param hostname Hostname in the hostname binding. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the named hostname binding for an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - HostnameBindingInner getHostnameBinding(String resourceGroupName, String name, String hostname); - - /** - * Get the named hostname binding for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param hostname Hostname in the hostname binding. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the named hostname binding for an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getHostnameBindingWithResponse( - String resourceGroupName, String name, String hostname, Context context); - - /** - * Creates a hostname binding for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param hostname Hostname in the hostname binding. - * @param hostnameBinding Binding details. This is the JSON representation of a HostNameBinding object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a hostname binding object. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createOrUpdateHostnameBindingWithResponseAsync( - String resourceGroupName, String name, String hostname, HostnameBindingInner hostnameBinding); - - /** - * Creates a hostname binding for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param hostname Hostname in the hostname binding. - * @param hostnameBinding Binding details. This is the JSON representation of a HostNameBinding object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a hostname binding object. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateHostnameBindingAsync( - String resourceGroupName, String name, String hostname, HostnameBindingInner hostnameBinding); - - /** - * Creates a hostname binding for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param hostname Hostname in the hostname binding. - * @param hostnameBinding Binding details. This is the JSON representation of a HostNameBinding object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a hostname binding object. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - HostnameBindingInner createOrUpdateHostnameBinding( - String resourceGroupName, String name, String hostname, HostnameBindingInner hostnameBinding); - - /** - * Creates a hostname binding for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param hostname Hostname in the hostname binding. - * @param hostnameBinding Binding details. This is the JSON representation of a HostNameBinding object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a hostname binding object. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateHostnameBindingWithResponse( - String resourceGroupName, String name, String hostname, HostnameBindingInner hostnameBinding, Context context); - - /** - * Deletes a hostname binding for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param hostname Hostname in the hostname binding. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteHostnameBindingWithResponseAsync(String resourceGroupName, String name, String hostname); - - /** - * Deletes a hostname binding for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param hostname Hostname in the hostname binding. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteHostnameBindingAsync(String resourceGroupName, String name, String hostname); - - /** - * Deletes a hostname binding for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param hostname Hostname in the hostname binding. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deleteHostnameBinding(String resourceGroupName, String name, String hostname); - - /** - * Deletes a hostname binding for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param hostname Hostname in the hostname binding. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteHostnameBindingWithResponse( - String resourceGroupName, String name, String hostname, Context context); - - /** - * Retrieves a specific Service Bus Hybrid Connection used by this Web App. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getHybridConnectionWithResponseAsync( - String resourceGroupName, String name, String namespaceName, String relayName); - - /** - * Retrieves a specific Service Bus Hybrid Connection used by this Web App. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getHybridConnectionAsync( - String resourceGroupName, String name, String namespaceName, String relayName); - - /** - * Retrieves a specific Service Bus Hybrid Connection used by this Web App. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - HybridConnectionInner getHybridConnection( - String resourceGroupName, String name, String namespaceName, String relayName); - - /** - * Retrieves a specific Service Bus Hybrid Connection used by this Web App. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getHybridConnectionWithResponse( - String resourceGroupName, String name, String namespaceName, String relayName, Context context); - - /** - * Creates a new Hybrid Connection using a Service Bus relay. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @param connectionEnvelope The details of the hybrid connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createOrUpdateHybridConnectionWithResponseAsync( - String resourceGroupName, - String name, - String namespaceName, - String relayName, - HybridConnectionInner connectionEnvelope); - - /** - * Creates a new Hybrid Connection using a Service Bus relay. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @param connectionEnvelope The details of the hybrid connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateHybridConnectionAsync( - String resourceGroupName, - String name, - String namespaceName, - String relayName, - HybridConnectionInner connectionEnvelope); - - /** - * Creates a new Hybrid Connection using a Service Bus relay. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @param connectionEnvelope The details of the hybrid connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - HybridConnectionInner createOrUpdateHybridConnection( - String resourceGroupName, - String name, - String namespaceName, - String relayName, - HybridConnectionInner connectionEnvelope); - - /** - * Creates a new Hybrid Connection using a Service Bus relay. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @param connectionEnvelope The details of the hybrid connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateHybridConnectionWithResponse( - String resourceGroupName, - String name, - String namespaceName, - String relayName, - HybridConnectionInner connectionEnvelope, - Context context); - - /** - * Removes a Hybrid Connection from this site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteHybridConnectionWithResponseAsync( - String resourceGroupName, String name, String namespaceName, String relayName); - - /** - * Removes a Hybrid Connection from this site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteHybridConnectionAsync( - String resourceGroupName, String name, String namespaceName, String relayName); - - /** - * Removes a Hybrid Connection from this site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deleteHybridConnection(String resourceGroupName, String name, String namespaceName, String relayName); - - /** - * Removes a Hybrid Connection from this site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteHybridConnectionWithResponse( - String resourceGroupName, String name, String namespaceName, String relayName, Context context); - - /** - * Creates a new Hybrid Connection using a Service Bus relay. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @param connectionEnvelope The details of the hybrid connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateHybridConnectionWithResponseAsync( - String resourceGroupName, - String name, - String namespaceName, - String relayName, - HybridConnectionInner connectionEnvelope); - - /** - * Creates a new Hybrid Connection using a Service Bus relay. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @param connectionEnvelope The details of the hybrid connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateHybridConnectionAsync( - String resourceGroupName, - String name, - String namespaceName, - String relayName, - HybridConnectionInner connectionEnvelope); - - /** - * Creates a new Hybrid Connection using a Service Bus relay. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @param connectionEnvelope The details of the hybrid connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - HybridConnectionInner updateHybridConnection( - String resourceGroupName, - String name, - String namespaceName, - String relayName, - HybridConnectionInner connectionEnvelope); - - /** - * Creates a new Hybrid Connection using a Service Bus relay. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @param connectionEnvelope The details of the hybrid connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateHybridConnectionWithResponse( - String resourceGroupName, - String name, - String namespaceName, - String relayName, - HybridConnectionInner connectionEnvelope, - Context context); - - /** - * Gets the send key name and value for a Hybrid Connection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the send key name and value for a Hybrid Connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listHybridConnectionKeysWithResponseAsync( - String resourceGroupName, String name, String namespaceName, String relayName); - - /** - * Gets the send key name and value for a Hybrid Connection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the send key name and value for a Hybrid Connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listHybridConnectionKeysAsync( - String resourceGroupName, String name, String namespaceName, String relayName); - - /** - * Gets the send key name and value for a Hybrid Connection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the send key name and value for a Hybrid Connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - HybridConnectionKeyInner listHybridConnectionKeys( - String resourceGroupName, String name, String namespaceName, String relayName); - - /** - * Gets the send key name and value for a Hybrid Connection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the send key name and value for a Hybrid Connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listHybridConnectionKeysWithResponse( - String resourceGroupName, String name, String namespaceName, String relayName, Context context); - - /** - * Retrieves all Service Bus Hybrid Connections used by this Web App. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listHybridConnectionsWithResponseAsync(String resourceGroupName, String name); - - /** - * Retrieves all Service Bus Hybrid Connections used by this Web App. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listHybridConnectionsAsync(String resourceGroupName, String name); - - /** - * Retrieves all Service Bus Hybrid Connections used by this Web App. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - HybridConnectionInner listHybridConnections(String resourceGroupName, String name); - - /** - * Retrieves all Service Bus Hybrid Connections used by this Web App. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listHybridConnectionsWithResponse( - String resourceGroupName, String name, Context context); - - /** - * Gets hybrid connections configured for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid connections configured for an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listRelayServiceConnectionsWithResponseAsync( - String resourceGroupName, String name); - - /** - * Gets hybrid connections configured for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid connections configured for an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listRelayServiceConnectionsAsync(String resourceGroupName, String name); - - /** - * Gets hybrid connections configured for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid connections configured for an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RelayServiceConnectionEntityInner listRelayServiceConnections(String resourceGroupName, String name); - - /** - * Gets hybrid connections configured for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid connections configured for an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listRelayServiceConnectionsWithResponse( - String resourceGroupName, String name, Context context); - - /** - * Gets a hybrid connection configuration by its name. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param entityName Name of the hybrid connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a hybrid connection configuration by its name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getRelayServiceConnectionWithResponseAsync( - String resourceGroupName, String name, String entityName); - - /** - * Gets a hybrid connection configuration by its name. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param entityName Name of the hybrid connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a hybrid connection configuration by its name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getRelayServiceConnectionAsync( - String resourceGroupName, String name, String entityName); - - /** - * Gets a hybrid connection configuration by its name. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param entityName Name of the hybrid connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a hybrid connection configuration by its name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RelayServiceConnectionEntityInner getRelayServiceConnection( - String resourceGroupName, String name, String entityName); - - /** - * Gets a hybrid connection configuration by its name. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param entityName Name of the hybrid connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a hybrid connection configuration by its name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getRelayServiceConnectionWithResponse( - String resourceGroupName, String name, String entityName, Context context); - - /** - * Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param entityName Name of the hybrid connection configuration. - * @param connectionEnvelope Details of the hybrid connection configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection for an App Service app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createOrUpdateRelayServiceConnectionWithResponseAsync( - String resourceGroupName, String name, String entityName, RelayServiceConnectionEntityInner connectionEnvelope); - - /** - * Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param entityName Name of the hybrid connection configuration. - * @param connectionEnvelope Details of the hybrid connection configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection for an App Service app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateRelayServiceConnectionAsync( - String resourceGroupName, String name, String entityName, RelayServiceConnectionEntityInner connectionEnvelope); - - /** - * Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param entityName Name of the hybrid connection configuration. - * @param connectionEnvelope Details of the hybrid connection configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection for an App Service app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RelayServiceConnectionEntityInner createOrUpdateRelayServiceConnection( - String resourceGroupName, String name, String entityName, RelayServiceConnectionEntityInner connectionEnvelope); - - /** - * Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param entityName Name of the hybrid connection configuration. - * @param connectionEnvelope Details of the hybrid connection configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection for an App Service app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateRelayServiceConnectionWithResponse( - String resourceGroupName, - String name, - String entityName, - RelayServiceConnectionEntityInner connectionEnvelope, - Context context); - - /** - * Deletes a relay service connection by its name. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param entityName Name of the hybrid connection configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteRelayServiceConnectionWithResponseAsync( - String resourceGroupName, String name, String entityName); - - /** - * Deletes a relay service connection by its name. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param entityName Name of the hybrid connection configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteRelayServiceConnectionAsync(String resourceGroupName, String name, String entityName); - - /** - * Deletes a relay service connection by its name. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param entityName Name of the hybrid connection configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deleteRelayServiceConnection(String resourceGroupName, String name, String entityName); - - /** - * Deletes a relay service connection by its name. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param entityName Name of the hybrid connection configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteRelayServiceConnectionWithResponse( - String resourceGroupName, String name, String entityName, Context context); - - /** - * Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param entityName Name of the hybrid connection configuration. - * @param connectionEnvelope Details of the hybrid connection configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection for an App Service app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateRelayServiceConnectionWithResponseAsync( - String resourceGroupName, String name, String entityName, RelayServiceConnectionEntityInner connectionEnvelope); - - /** - * Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param entityName Name of the hybrid connection configuration. - * @param connectionEnvelope Details of the hybrid connection configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection for an App Service app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateRelayServiceConnectionAsync( - String resourceGroupName, String name, String entityName, RelayServiceConnectionEntityInner connectionEnvelope); - - /** - * Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param entityName Name of the hybrid connection configuration. - * @param connectionEnvelope Details of the hybrid connection configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection for an App Service app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RelayServiceConnectionEntityInner updateRelayServiceConnection( - String resourceGroupName, String name, String entityName, RelayServiceConnectionEntityInner connectionEnvelope); - - /** - * Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param entityName Name of the hybrid connection configuration. - * @param connectionEnvelope Details of the hybrid connection configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection for an App Service app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateRelayServiceConnectionWithResponse( - String resourceGroupName, - String name, - String entityName, - RelayServiceConnectionEntityInner connectionEnvelope, - Context context); - - /** - * Gets all scale-out instances of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all scale-out instances of an app. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listInstanceIdentifiersAsync(String resourceGroupName, String name); - - /** - * Gets all scale-out instances of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all scale-out instances of an app. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listInstanceIdentifiers(String resourceGroupName, String name); - - /** - * Gets all scale-out instances of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all scale-out instances of an app. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listInstanceIdentifiers(String resourceGroupName, String name, Context context); - - /** - * Get the status of the last MSDeploy operation. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param instanceId ID of web app instance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of the last MSDeploy operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getInstanceMsDeployStatusWithResponseAsync( - String resourceGroupName, String name, String instanceId); - - /** - * Get the status of the last MSDeploy operation. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param instanceId ID of web app instance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of the last MSDeploy operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getInstanceMsDeployStatusAsync(String resourceGroupName, String name, String instanceId); - - /** - * Get the status of the last MSDeploy operation. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param instanceId ID of web app instance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of the last MSDeploy operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - MSDeployStatusInner getInstanceMsDeployStatus(String resourceGroupName, String name, String instanceId); - - /** - * Get the status of the last MSDeploy operation. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param instanceId ID of web app instance. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of the last MSDeploy operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getInstanceMsDeployStatusWithResponse( - String resourceGroupName, String name, String instanceId, Context context); - - /** - * Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param instanceId ID of web app instance. - * @param mSDeploy Details of MSDeploy operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createInstanceMSDeployOperationWithResponseAsync( - String resourceGroupName, String name, String instanceId, MSDeploy mSDeploy); - - /** - * Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param instanceId ID of web app instance. - * @param mSDeploy Details of MSDeploy operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, MSDeployStatusInner> beginCreateInstanceMSDeployOperationAsync( - String resourceGroupName, String name, String instanceId, MSDeploy mSDeploy); - - /** - * Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param instanceId ID of web app instance. - * @param mSDeploy Details of MSDeploy operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, MSDeployStatusInner> beginCreateInstanceMSDeployOperation( - String resourceGroupName, String name, String instanceId, MSDeploy mSDeploy); - - /** - * Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param instanceId ID of web app instance. - * @param mSDeploy Details of MSDeploy operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, MSDeployStatusInner> beginCreateInstanceMSDeployOperation( - String resourceGroupName, String name, String instanceId, MSDeploy mSDeploy, Context context); - - /** - * Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param instanceId ID of web app instance. - * @param mSDeploy Details of MSDeploy operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createInstanceMSDeployOperationAsync( - String resourceGroupName, String name, String instanceId, MSDeploy mSDeploy); - - /** - * Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param instanceId ID of web app instance. - * @param mSDeploy Details of MSDeploy operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - MSDeployStatusInner createInstanceMSDeployOperation( - String resourceGroupName, String name, String instanceId, MSDeploy mSDeploy); - - /** - * Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param instanceId ID of web app instance. - * @param mSDeploy Details of MSDeploy operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - MSDeployStatusInner createInstanceMSDeployOperation( - String resourceGroupName, String name, String instanceId, MSDeploy mSDeploy, Context context); - - /** - * Get the MSDeploy Log for the last MSDeploy operation. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param instanceId ID of web app instance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the MSDeploy Log for the last MSDeploy operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getInstanceMSDeployLogWithResponseAsync( - String resourceGroupName, String name, String instanceId); - - /** - * Get the MSDeploy Log for the last MSDeploy operation. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param instanceId ID of web app instance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the MSDeploy Log for the last MSDeploy operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getInstanceMSDeployLogAsync(String resourceGroupName, String name, String instanceId); - - /** - * Get the MSDeploy Log for the last MSDeploy operation. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param instanceId ID of web app instance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the MSDeploy Log for the last MSDeploy operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - MSDeployLogInner getInstanceMSDeployLog(String resourceGroupName, String name, String instanceId); - - /** - * Get the MSDeploy Log for the last MSDeploy operation. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param instanceId ID of web app instance. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the MSDeploy Log for the last MSDeploy operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getInstanceMSDeployLogWithResponse( - String resourceGroupName, String name, String instanceId, Context context); - - /** - * Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web - * site. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listInstanceProcessesAsync(String resourceGroupName, String name, String instanceId); - - /** - * Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web - * site. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listInstanceProcesses(String resourceGroupName, String name, String instanceId); - - /** - * Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web - * site. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listInstanceProcesses( - String resourceGroupName, String name, String instanceId, Context context); - - /** - * Get process information by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return process information by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getInstanceProcessWithResponseAsync( - String resourceGroupName, String name, String processId, String instanceId); - - /** - * Get process information by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return process information by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getInstanceProcessAsync( - String resourceGroupName, String name, String processId, String instanceId); - - /** - * Get process information by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return process information by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ProcessInfoInner getInstanceProcess(String resourceGroupName, String name, String processId, String instanceId); - - /** - * Get process information by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return process information by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getInstanceProcessWithResponse( - String resourceGroupName, String name, String processId, String instanceId, Context context); - - /** - * Terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in a web - * site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteInstanceProcessWithResponseAsync( - String resourceGroupName, String name, String processId, String instanceId); - - /** - * Terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in a web - * site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteInstanceProcessAsync(String resourceGroupName, String name, String processId, String instanceId); - - /** - * Terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in a web - * site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deleteInstanceProcess(String resourceGroupName, String name, String processId, String instanceId); - - /** - * Terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in a web - * site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteInstanceProcessWithResponse( - String resourceGroupName, String name, String processId, String instanceId, Context context); - - /** - * Get a memory dump of a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a memory dump of a process by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getInstanceProcessDumpWithResponseAsync( - String resourceGroupName, String name, String processId, String instanceId); - - /** - * Get a memory dump of a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a memory dump of a process by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Flux getInstanceProcessDumpAsync( - String resourceGroupName, String name, String processId, String instanceId); - - /** - * Get a memory dump of a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a memory dump of a process by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - InputStream getInstanceProcessDump(String resourceGroupName, String name, String processId, String instanceId); - - /** - * Get a memory dump of a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a memory dump of a process by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - StreamResponse getInstanceProcessDumpWithResponse( - String resourceGroupName, String name, String processId, String instanceId, Context context); - - /** - * List module information for a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listInstanceProcessModulesAsync( - String resourceGroupName, String name, String processId, String instanceId); - - /** - * List module information for a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listInstanceProcessModules( - String resourceGroupName, String name, String processId, String instanceId); - - /** - * List module information for a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listInstanceProcessModules( - String resourceGroupName, String name, String processId, String instanceId, Context context); - - /** - * Get process information by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param baseAddress Module base address. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return process information by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getInstanceProcessModuleWithResponseAsync( - String resourceGroupName, String name, String processId, String baseAddress, String instanceId); - - /** - * Get process information by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param baseAddress Module base address. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return process information by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getInstanceProcessModuleAsync( - String resourceGroupName, String name, String processId, String baseAddress, String instanceId); - - /** - * Get process information by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param baseAddress Module base address. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return process information by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ProcessModuleInfoInner getInstanceProcessModule( - String resourceGroupName, String name, String processId, String baseAddress, String instanceId); - - /** - * Get process information by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param baseAddress Module base address. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return process information by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getInstanceProcessModuleWithResponse( - String resourceGroupName, - String name, - String processId, - String baseAddress, - String instanceId, - Context context); - - /** - * List the threads in a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listInstanceProcessThreadsAsync( - String resourceGroupName, String name, String processId, String instanceId); - - /** - * List the threads in a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listInstanceProcessThreads( - String resourceGroupName, String name, String processId, String instanceId); - - /** - * List the threads in a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listInstanceProcessThreads( - String resourceGroupName, String name, String processId, String instanceId, Context context); - - /** - * Get thread information by Thread ID for a specific process, in a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param threadId TID. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return thread information by Thread ID for a specific process, in a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getInstanceProcessThreadWithResponseAsync( - String resourceGroupName, String name, String processId, String threadId, String instanceId); - - /** - * Get thread information by Thread ID for a specific process, in a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param threadId TID. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return thread information by Thread ID for a specific process, in a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getInstanceProcessThreadAsync( - String resourceGroupName, String name, String processId, String threadId, String instanceId); - - /** - * Get thread information by Thread ID for a specific process, in a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param threadId TID. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return thread information by Thread ID for a specific process, in a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ProcessThreadInfoInner getInstanceProcessThread( - String resourceGroupName, String name, String processId, String threadId, String instanceId); - - /** - * Get thread information by Thread ID for a specific process, in a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param threadId TID. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return thread information by Thread ID for a specific process, in a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getInstanceProcessThreadWithResponse( - String resourceGroupName, String name, String processId, String threadId, String instanceId, Context context); - - /** - * Shows whether an app can be cloned to another resource group or subscription. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents whether or not an app is cloneable. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> isCloneableWithResponseAsync(String resourceGroupName, String name); - - /** - * Shows whether an app can be cloned to another resource group or subscription. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents whether or not an app is cloneable. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono isCloneableAsync(String resourceGroupName, String name); - - /** - * Shows whether an app can be cloned to another resource group or subscription. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents whether or not an app is cloneable. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SiteCloneabilityInner isCloneable(String resourceGroupName, String name); - - /** - * Shows whether an app can be cloned to another resource group or subscription. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents whether or not an app is cloneable. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response isCloneableWithResponse(String resourceGroupName, String name, Context context); - - /** - * This is to allow calling via powershell and ARM template. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function secrets. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listSyncFunctionTriggersWithResponseAsync( - String resourceGroupName, String name); - - /** - * This is to allow calling via powershell and ARM template. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function secrets. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listSyncFunctionTriggersAsync(String resourceGroupName, String name); - - /** - * This is to allow calling via powershell and ARM template. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function secrets. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - FunctionSecretsInner listSyncFunctionTriggers(String resourceGroupName, String name); - - /** - * This is to allow calling via powershell and ARM template. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function secrets. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listSyncFunctionTriggersWithResponse( - String resourceGroupName, String name, Context context); - - /** - * Gets all metric definitions of an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all metric definitions of an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listMetricDefinitionsAsync(String resourceGroupName, String name); - - /** - * Gets all metric definitions of an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all metric definitions of an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listMetricDefinitions(String resourceGroupName, String name); - - /** - * Gets all metric definitions of an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all metric definitions of an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listMetricDefinitions( - String resourceGroupName, String name, Context context); - - /** - * Gets performance metrics of an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param details Specify "true" to include metric details in the response. It is "false" by default. - * @param filter Return only metrics specified in the filter (using OData syntax). For example: $filter=(name.value - * eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and endTime eq - * 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return performance metrics of an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listMetricsAsync( - String resourceGroupName, String name, Boolean details, String filter); - - /** - * Gets performance metrics of an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return performance metrics of an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listMetricsAsync(String resourceGroupName, String name); - - /** - * Gets performance metrics of an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return performance metrics of an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listMetrics(String resourceGroupName, String name); - - /** - * Gets performance metrics of an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param details Specify "true" to include metric details in the response. It is "false" by default. - * @param filter Return only metrics specified in the filter (using OData syntax). For example: $filter=(name.value - * eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and endTime eq - * 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return performance metrics of an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listMetrics( - String resourceGroupName, String name, Boolean details, String filter, Context context); - - /** - * Restores a web app. - * - * @param subscriptionName Azure subscription. - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param migrationOptions Migration migrationOptions. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for a migration of app content request. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> migrateStorageWithResponseAsync( - String subscriptionName, String resourceGroupName, String name, StorageMigrationOptions migrationOptions); - - /** - * Restores a web app. - * - * @param subscriptionName Azure subscription. - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param migrationOptions Migration migrationOptions. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for a migration of app content request. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, StorageMigrationResponseInner> beginMigrateStorageAsync( - String subscriptionName, String resourceGroupName, String name, StorageMigrationOptions migrationOptions); - - /** - * Restores a web app. - * - * @param subscriptionName Azure subscription. - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param migrationOptions Migration migrationOptions. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for a migration of app content request. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, StorageMigrationResponseInner> beginMigrateStorage( - String subscriptionName, String resourceGroupName, String name, StorageMigrationOptions migrationOptions); - - /** - * Restores a web app. - * - * @param subscriptionName Azure subscription. - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param migrationOptions Migration migrationOptions. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for a migration of app content request. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, StorageMigrationResponseInner> beginMigrateStorage( - String subscriptionName, - String resourceGroupName, - String name, - StorageMigrationOptions migrationOptions, - Context context); - - /** - * Restores a web app. - * - * @param subscriptionName Azure subscription. - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param migrationOptions Migration migrationOptions. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for a migration of app content request. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono migrateStorageAsync( - String subscriptionName, String resourceGroupName, String name, StorageMigrationOptions migrationOptions); - - /** - * Restores a web app. - * - * @param subscriptionName Azure subscription. - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param migrationOptions Migration migrationOptions. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for a migration of app content request. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - StorageMigrationResponseInner migrateStorage( - String subscriptionName, String resourceGroupName, String name, StorageMigrationOptions migrationOptions); - - /** - * Restores a web app. - * - * @param subscriptionName Azure subscription. - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param migrationOptions Migration migrationOptions. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for a migration of app content request. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - StorageMigrationResponseInner migrateStorage( - String subscriptionName, - String resourceGroupName, - String name, - StorageMigrationOptions migrationOptions, - Context context); - - /** - * Migrates a local (in-app) MySql database to a remote MySql database. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param migrationRequestEnvelope MySql migration options. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an operation on a resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> migrateMySqlWithResponseAsync( - String resourceGroupName, String name, MigrateMySqlRequest migrationRequestEnvelope); - - /** - * Migrates a local (in-app) MySql database to a remote MySql database. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param migrationRequestEnvelope MySql migration options. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an operation on a resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, OperationInner> beginMigrateMySqlAsync( - String resourceGroupName, String name, MigrateMySqlRequest migrationRequestEnvelope); - - /** - * Migrates a local (in-app) MySql database to a remote MySql database. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param migrationRequestEnvelope MySql migration options. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an operation on a resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, OperationInner> beginMigrateMySql( - String resourceGroupName, String name, MigrateMySqlRequest migrationRequestEnvelope); - - /** - * Migrates a local (in-app) MySql database to a remote MySql database. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param migrationRequestEnvelope MySql migration options. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an operation on a resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, OperationInner> beginMigrateMySql( - String resourceGroupName, String name, MigrateMySqlRequest migrationRequestEnvelope, Context context); - - /** - * Migrates a local (in-app) MySql database to a remote MySql database. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param migrationRequestEnvelope MySql migration options. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an operation on a resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono migrateMySqlAsync( - String resourceGroupName, String name, MigrateMySqlRequest migrationRequestEnvelope); - - /** - * Migrates a local (in-app) MySql database to a remote MySql database. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param migrationRequestEnvelope MySql migration options. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an operation on a resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - OperationInner migrateMySql(String resourceGroupName, String name, MigrateMySqlRequest migrationRequestEnvelope); - - /** - * Migrates a local (in-app) MySql database to a remote MySql database. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param migrationRequestEnvelope MySql migration options. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an operation on a resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - OperationInner migrateMySql( - String resourceGroupName, String name, MigrateMySqlRequest migrationRequestEnvelope, Context context); - - /** - * Returns the status of MySql in app migration, if one is active, and whether or not MySql in app is enabled. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mySQL migration status. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getMigrateMySqlStatusWithResponseAsync( - String resourceGroupName, String name); - - /** - * Returns the status of MySql in app migration, if one is active, and whether or not MySql in app is enabled. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mySQL migration status. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getMigrateMySqlStatusAsync(String resourceGroupName, String name); - - /** - * Returns the status of MySql in app migration, if one is active, and whether or not MySql in app is enabled. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mySQL migration status. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - MigrateMySqlStatusInner getMigrateMySqlStatus(String resourceGroupName, String name); - - /** - * Returns the status of MySql in app migration, if one is active, and whether or not MySql in app is enabled. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mySQL migration status. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getMigrateMySqlStatusWithResponse( - String resourceGroupName, String name, Context context); - - /** - * Gets a Swift Virtual Network connection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Swift Virtual Network connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getSwiftVirtualNetworkConnectionWithResponseAsync( - String resourceGroupName, String name); - - /** - * Gets a Swift Virtual Network connection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Swift Virtual Network connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getSwiftVirtualNetworkConnectionAsync(String resourceGroupName, String name); - - /** - * Gets a Swift Virtual Network connection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Swift Virtual Network connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SwiftVirtualNetworkInner getSwiftVirtualNetworkConnection(String resourceGroupName, String name); - - /** - * Gets a Swift Virtual Network connection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Swift Virtual Network connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getSwiftVirtualNetworkConnectionWithResponse( - String resourceGroupName, String name, Context context); - - /** - * Integrates this Web App with a Virtual Network. This requires that 1) "swiftSupported" is true when doing a GET - * against this resource, and 2) that the target Subnet has already been delegated, and is not in use by another App - * Service Plan other than the one this App is in. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param connectionEnvelope Properties of the Virtual Network connection. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return swift Virtual Network Contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createOrUpdateSwiftVirtualNetworkConnectionWithResponseAsync( - String resourceGroupName, String name, SwiftVirtualNetworkInner connectionEnvelope); - - /** - * Integrates this Web App with a Virtual Network. This requires that 1) "swiftSupported" is true when doing a GET - * against this resource, and 2) that the target Subnet has already been delegated, and is not in use by another App - * Service Plan other than the one this App is in. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param connectionEnvelope Properties of the Virtual Network connection. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return swift Virtual Network Contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateSwiftVirtualNetworkConnectionAsync( - String resourceGroupName, String name, SwiftVirtualNetworkInner connectionEnvelope); - - /** - * Integrates this Web App with a Virtual Network. This requires that 1) "swiftSupported" is true when doing a GET - * against this resource, and 2) that the target Subnet has already been delegated, and is not in use by another App - * Service Plan other than the one this App is in. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param connectionEnvelope Properties of the Virtual Network connection. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return swift Virtual Network Contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SwiftVirtualNetworkInner createOrUpdateSwiftVirtualNetworkConnection( - String resourceGroupName, String name, SwiftVirtualNetworkInner connectionEnvelope); - - /** - * Integrates this Web App with a Virtual Network. This requires that 1) "swiftSupported" is true when doing a GET - * against this resource, and 2) that the target Subnet has already been delegated, and is not in use by another App - * Service Plan other than the one this App is in. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param connectionEnvelope Properties of the Virtual Network connection. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return swift Virtual Network Contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateSwiftVirtualNetworkConnectionWithResponse( - String resourceGroupName, String name, SwiftVirtualNetworkInner connectionEnvelope, Context context); - - /** - * Deletes a Swift Virtual Network connection from an app (or deployment slot). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteSwiftVirtualNetworkWithResponseAsync(String resourceGroupName, String name); - - /** - * Deletes a Swift Virtual Network connection from an app (or deployment slot). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteSwiftVirtualNetworkAsync(String resourceGroupName, String name); - - /** - * Deletes a Swift Virtual Network connection from an app (or deployment slot). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deleteSwiftVirtualNetwork(String resourceGroupName, String name); - - /** - * Deletes a Swift Virtual Network connection from an app (or deployment slot). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteSwiftVirtualNetworkWithResponse(String resourceGroupName, String name, Context context); - - /** - * Integrates this Web App with a Virtual Network. This requires that 1) "swiftSupported" is true when doing a GET - * against this resource, and 2) that the target Subnet has already been delegated, and is not in use by another App - * Service Plan other than the one this App is in. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param connectionEnvelope Properties of the Virtual Network connection. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return swift Virtual Network Contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateSwiftVirtualNetworkConnectionWithResponseAsync( - String resourceGroupName, String name, SwiftVirtualNetworkInner connectionEnvelope); - - /** - * Integrates this Web App with a Virtual Network. This requires that 1) "swiftSupported" is true when doing a GET - * against this resource, and 2) that the target Subnet has already been delegated, and is not in use by another App - * Service Plan other than the one this App is in. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param connectionEnvelope Properties of the Virtual Network connection. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return swift Virtual Network Contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateSwiftVirtualNetworkConnectionAsync( - String resourceGroupName, String name, SwiftVirtualNetworkInner connectionEnvelope); - - /** - * Integrates this Web App with a Virtual Network. This requires that 1) "swiftSupported" is true when doing a GET - * against this resource, and 2) that the target Subnet has already been delegated, and is not in use by another App - * Service Plan other than the one this App is in. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param connectionEnvelope Properties of the Virtual Network connection. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return swift Virtual Network Contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SwiftVirtualNetworkInner updateSwiftVirtualNetworkConnection( - String resourceGroupName, String name, SwiftVirtualNetworkInner connectionEnvelope); - - /** - * Integrates this Web App with a Virtual Network. This requires that 1) "swiftSupported" is true when doing a GET - * against this resource, and 2) that the target Subnet has already been delegated, and is not in use by another App - * Service Plan other than the one this App is in. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param connectionEnvelope Properties of the Virtual Network connection. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return swift Virtual Network Contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateSwiftVirtualNetworkConnectionWithResponse( - String resourceGroupName, String name, SwiftVirtualNetworkInner connectionEnvelope, Context context); - - /** - * Gets all network features used by the app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param view The type of view. This can either be "summary" or "detailed". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network features used by the app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listNetworkFeaturesWithResponseAsync( - String resourceGroupName, String name, String view); - - /** - * Gets all network features used by the app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param view The type of view. This can either be "summary" or "detailed". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network features used by the app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listNetworkFeaturesAsync(String resourceGroupName, String name, String view); - - /** - * Gets all network features used by the app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param view The type of view. This can either be "summary" or "detailed". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network features used by the app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - NetworkFeaturesInner listNetworkFeatures(String resourceGroupName, String name, String view); - - /** - * Gets all network features used by the app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param view The type of view. This can either be "summary" or "detailed". - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network features used by the app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listNetworkFeaturesWithResponse( - String resourceGroupName, String name, String view, Context context); - - /** - * Gets a named operation for a network trace capturing (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param operationId GUID of the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named operation for a network trace capturing (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getNetworkTraceOperationWithResponseAsync( - String resourceGroupName, String name, String operationId); - - /** - * Gets a named operation for a network trace capturing (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param operationId GUID of the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named operation for a network trace capturing (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getNetworkTraceOperationAsync(String resourceGroupName, String name, String operationId); - - /** - * Gets a named operation for a network trace capturing (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param operationId GUID of the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named operation for a network trace capturing (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Object getNetworkTraceOperation(String resourceGroupName, String name, String operationId); - - /** - * Gets a named operation for a network trace capturing (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param operationId GUID of the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named operation for a network trace capturing (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getNetworkTraceOperationWithResponse( - String resourceGroupName, String name, String operationId, Context context); - - /** - * Start capturing network packets for the site (To be deprecated). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> startWebSiteNetworkTraceWithResponseAsync( - String resourceGroupName, String name, Integer durationInSeconds, Integer maxFrameLength, String sasUrl); - - /** - * Start capturing network packets for the site (To be deprecated). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono startWebSiteNetworkTraceAsync( - String resourceGroupName, String name, Integer durationInSeconds, Integer maxFrameLength, String sasUrl); - - /** - * Start capturing network packets for the site (To be deprecated). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono startWebSiteNetworkTraceAsync(String resourceGroupName, String name); - - /** - * Start capturing network packets for the site (To be deprecated). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - String startWebSiteNetworkTrace(String resourceGroupName, String name); - - /** - * Start capturing network packets for the site (To be deprecated). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response startWebSiteNetworkTraceWithResponse( - String resourceGroupName, - String name, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl, - Context context); - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> startWebSiteNetworkTraceOperationWithResponseAsync( - String resourceGroupName, String name, Integer durationInSeconds, Integer maxFrameLength, String sasUrl); - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Object> beginStartWebSiteNetworkTraceOperationAsync( - String resourceGroupName, String name, Integer durationInSeconds, Integer maxFrameLength, String sasUrl); - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Object> beginStartWebSiteNetworkTraceOperation( - String resourceGroupName, String name, Integer durationInSeconds, Integer maxFrameLength, String sasUrl); - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Object> beginStartWebSiteNetworkTraceOperation( - String resourceGroupName, - String name, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl, - Context context); - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono startWebSiteNetworkTraceOperationAsync( - String resourceGroupName, String name, Integer durationInSeconds, Integer maxFrameLength, String sasUrl); - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono startWebSiteNetworkTraceOperationAsync(String resourceGroupName, String name); - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Object startWebSiteNetworkTraceOperation( - String resourceGroupName, String name, Integer durationInSeconds, Integer maxFrameLength, String sasUrl); - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Object startWebSiteNetworkTraceOperation(String resourceGroupName, String name); - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Object startWebSiteNetworkTraceOperation( - String resourceGroupName, - String name, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl, - Context context); - - /** - * Stop ongoing capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> stopWebSiteNetworkTraceWithResponseAsync(String resourceGroupName, String name); - - /** - * Stop ongoing capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono stopWebSiteNetworkTraceAsync(String resourceGroupName, String name); - - /** - * Stop ongoing capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void stopWebSiteNetworkTrace(String resourceGroupName, String name); - - /** - * Stop ongoing capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response stopWebSiteNetworkTraceWithResponse(String resourceGroupName, String name, Context context); - - /** - * Gets a named operation for a network trace capturing (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param operationId GUID of the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named operation for a network trace capturing (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> getNetworkTracesWithResponseAsync( - String resourceGroupName, String name, String operationId); - - /** - * Gets a named operation for a network trace capturing (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param operationId GUID of the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named operation for a network trace capturing (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getNetworkTracesAsync(String resourceGroupName, String name, String operationId); - - /** - * Gets a named operation for a network trace capturing (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param operationId GUID of the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named operation for a network trace capturing (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - List getNetworkTraces(String resourceGroupName, String name, String operationId); - - /** - * Gets a named operation for a network trace capturing (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param operationId GUID of the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named operation for a network trace capturing (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response> getNetworkTracesWithResponse( - String resourceGroupName, String name, String operationId, Context context); - - /** - * Gets a named operation for a network trace capturing (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param operationId GUID of the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named operation for a network trace capturing (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getNetworkTraceOperationV2WithResponseAsync( - String resourceGroupName, String name, String operationId); - - /** - * Gets a named operation for a network trace capturing (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param operationId GUID of the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named operation for a network trace capturing (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getNetworkTraceOperationV2Async(String resourceGroupName, String name, String operationId); - - /** - * Gets a named operation for a network trace capturing (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param operationId GUID of the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named operation for a network trace capturing (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Object getNetworkTraceOperationV2(String resourceGroupName, String name, String operationId); - - /** - * Gets a named operation for a network trace capturing (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param operationId GUID of the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named operation for a network trace capturing (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getNetworkTraceOperationV2WithResponse( - String resourceGroupName, String name, String operationId, Context context); - - /** - * Gets a named operation for a network trace capturing (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param operationId GUID of the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named operation for a network trace capturing (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> getNetworkTracesV2WithResponseAsync( - String resourceGroupName, String name, String operationId); - - /** - * Gets a named operation for a network trace capturing (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param operationId GUID of the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named operation for a network trace capturing (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getNetworkTracesV2Async(String resourceGroupName, String name, String operationId); - - /** - * Gets a named operation for a network trace capturing (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param operationId GUID of the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named operation for a network trace capturing (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - List getNetworkTracesV2(String resourceGroupName, String name, String operationId); - - /** - * Gets a named operation for a network trace capturing (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param operationId GUID of the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named operation for a network trace capturing (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response> getNetworkTracesV2WithResponse( - String resourceGroupName, String name, String operationId, Context context); - - /** - * Generates a new publishing password for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> generateNewSitePublishingPasswordWithResponseAsync(String resourceGroupName, String name); - - /** - * Generates a new publishing password for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono generateNewSitePublishingPasswordAsync(String resourceGroupName, String name); - - /** - * Generates a new publishing password for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void generateNewSitePublishingPassword(String resourceGroupName, String name); - - /** - * Generates a new publishing password for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response generateNewSitePublishingPasswordWithResponse( - String resourceGroupName, String name, Context context); - - /** - * Gets perfmon counters for web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: - * $filter=(startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq - * duration'[Hour|Minute|Day]'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return perfmon counters for web app. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listPerfMonCountersAsync(String resourceGroupName, String name, String filter); - - /** - * Gets perfmon counters for web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return perfmon counters for web app. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listPerfMonCountersAsync(String resourceGroupName, String name); - - /** - * Gets perfmon counters for web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return perfmon counters for web app. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listPerfMonCounters(String resourceGroupName, String name); - - /** - * Gets perfmon counters for web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: - * $filter=(startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq - * duration'[Hour|Minute|Day]'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return perfmon counters for web app. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listPerfMonCounters( - String resourceGroupName, String name, String filter, Context context); - - /** - * Gets web app's event logs. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return web app's event logs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getSitePhpErrorLogFlagWithResponseAsync( - String resourceGroupName, String name); - - /** - * Gets web app's event logs. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return web app's event logs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getSitePhpErrorLogFlagAsync(String resourceGroupName, String name); - - /** - * Gets web app's event logs. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return web app's event logs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SitePhpErrorLogFlagInner getSitePhpErrorLogFlag(String resourceGroupName, String name); - - /** - * Gets web app's event logs. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return web app's event logs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getSitePhpErrorLogFlagWithResponse( - String resourceGroupName, String name, Context context); - - /** - * Gets the premier add-ons of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the premier add-ons of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listPremierAddOnsWithResponseAsync(String resourceGroupName, String name); - - /** - * Gets the premier add-ons of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the premier add-ons of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listPremierAddOnsAsync(String resourceGroupName, String name); - - /** - * Gets the premier add-ons of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the premier add-ons of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PremierAddOnInner listPremierAddOns(String resourceGroupName, String name); - - /** - * Gets the premier add-ons of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the premier add-ons of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listPremierAddOnsWithResponse(String resourceGroupName, String name, Context context); - - /** - * Gets a named add-on of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param premierAddOnName Add-on name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named add-on of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getPremierAddOnWithResponseAsync( - String resourceGroupName, String name, String premierAddOnName); - - /** - * Gets a named add-on of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param premierAddOnName Add-on name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named add-on of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getPremierAddOnAsync(String resourceGroupName, String name, String premierAddOnName); - - /** - * Gets a named add-on of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param premierAddOnName Add-on name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named add-on of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PremierAddOnInner getPremierAddOn(String resourceGroupName, String name, String premierAddOnName); - - /** - * Gets a named add-on of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param premierAddOnName Add-on name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named add-on of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getPremierAddOnWithResponse( - String resourceGroupName, String name, String premierAddOnName, Context context); - - /** - * Updates a named add-on of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param premierAddOnName Add-on name. - * @param premierAddOn A JSON representation of the edited premier add-on. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return premier add-on. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> addPremierAddOnWithResponseAsync( - String resourceGroupName, String name, String premierAddOnName, PremierAddOnInner premierAddOn); - - /** - * Updates a named add-on of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param premierAddOnName Add-on name. - * @param premierAddOn A JSON representation of the edited premier add-on. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return premier add-on. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono addPremierAddOnAsync( - String resourceGroupName, String name, String premierAddOnName, PremierAddOnInner premierAddOn); - - /** - * Updates a named add-on of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param premierAddOnName Add-on name. - * @param premierAddOn A JSON representation of the edited premier add-on. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return premier add-on. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PremierAddOnInner addPremierAddOn( - String resourceGroupName, String name, String premierAddOnName, PremierAddOnInner premierAddOn); - - /** - * Updates a named add-on of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param premierAddOnName Add-on name. - * @param premierAddOn A JSON representation of the edited premier add-on. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return premier add-on. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response addPremierAddOnWithResponse( - String resourceGroupName, - String name, - String premierAddOnName, - PremierAddOnInner premierAddOn, - Context context); - - /** - * Delete a premier add-on from an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param premierAddOnName Add-on name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deletePremierAddOnWithResponseAsync( - String resourceGroupName, String name, String premierAddOnName); - - /** - * Delete a premier add-on from an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param premierAddOnName Add-on name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deletePremierAddOnAsync(String resourceGroupName, String name, String premierAddOnName); - - /** - * Delete a premier add-on from an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param premierAddOnName Add-on name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deletePremierAddOn(String resourceGroupName, String name, String premierAddOnName); - - /** - * Delete a premier add-on from an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param premierAddOnName Add-on name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deletePremierAddOnWithResponse( - String resourceGroupName, String name, String premierAddOnName, Context context); - - /** - * Updates a named add-on of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param premierAddOnName Add-on name. - * @param premierAddOn A JSON representation of the edited premier add-on. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return premier add-on. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updatePremierAddOnWithResponseAsync( - String resourceGroupName, String name, String premierAddOnName, PremierAddOnPatchResource premierAddOn); - - /** - * Updates a named add-on of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param premierAddOnName Add-on name. - * @param premierAddOn A JSON representation of the edited premier add-on. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return premier add-on. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updatePremierAddOnAsync( - String resourceGroupName, String name, String premierAddOnName, PremierAddOnPatchResource premierAddOn); - - /** - * Updates a named add-on of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param premierAddOnName Add-on name. - * @param premierAddOn A JSON representation of the edited premier add-on. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return premier add-on. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PremierAddOnInner updatePremierAddOn( - String resourceGroupName, String name, String premierAddOnName, PremierAddOnPatchResource premierAddOn); - - /** - * Updates a named add-on of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param premierAddOnName Add-on name. - * @param premierAddOn A JSON representation of the edited premier add-on. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return premier add-on. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updatePremierAddOnWithResponse( - String resourceGroupName, - String name, - String premierAddOnName, - PremierAddOnPatchResource premierAddOn, - Context context); - - /** - * Gets data around private site access enablement and authorized Virtual Networks that can access the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data around private site access enablement and authorized Virtual Networks that can access the site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getPrivateAccessWithResponseAsync(String resourceGroupName, String name); - - /** - * Gets data around private site access enablement and authorized Virtual Networks that can access the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data around private site access enablement and authorized Virtual Networks that can access the site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getPrivateAccessAsync(String resourceGroupName, String name); - - /** - * Gets data around private site access enablement and authorized Virtual Networks that can access the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data around private site access enablement and authorized Virtual Networks that can access the site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PrivateAccessInner getPrivateAccess(String resourceGroupName, String name); - - /** - * Gets data around private site access enablement and authorized Virtual Networks that can access the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data around private site access enablement and authorized Virtual Networks that can access the site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getPrivateAccessWithResponse(String resourceGroupName, String name, Context context); - - /** - * Sets data around private site access enablement and authorized Virtual Networks that can access the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param access The information for the private access. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of the parameters of Private Access for a Web Site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> putPrivateAccessVnetWithResponseAsync( - String resourceGroupName, String name, PrivateAccessInner access); - - /** - * Sets data around private site access enablement and authorized Virtual Networks that can access the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param access The information for the private access. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of the parameters of Private Access for a Web Site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono putPrivateAccessVnetAsync( - String resourceGroupName, String name, PrivateAccessInner access); - - /** - * Sets data around private site access enablement and authorized Virtual Networks that can access the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param access The information for the private access. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of the parameters of Private Access for a Web Site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PrivateAccessInner putPrivateAccessVnet(String resourceGroupName, String name, PrivateAccessInner access); - - /** - * Sets data around private site access enablement and authorized Virtual Networks that can access the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param access The information for the private access. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of the parameters of Private Access for a Web Site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response putPrivateAccessVnetWithResponse( - String resourceGroupName, String name, PrivateAccessInner access, Context context); - - /** - * Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web - * site. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listProcessesAsync(String resourceGroupName, String name); - - /** - * Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web - * site. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listProcesses(String resourceGroupName, String name); - - /** - * Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web - * site. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listProcesses(String resourceGroupName, String name, Context context); - - /** - * Get process information by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return process information by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getProcessWithResponseAsync( - String resourceGroupName, String name, String processId); - - /** - * Get process information by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return process information by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getProcessAsync(String resourceGroupName, String name, String processId); - - /** - * Get process information by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return process information by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ProcessInfoInner getProcess(String resourceGroupName, String name, String processId); - - /** - * Get process information by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return process information by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getProcessWithResponse( - String resourceGroupName, String name, String processId, Context context); - - /** - * Terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in a web - * site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteProcessWithResponseAsync(String resourceGroupName, String name, String processId); - - /** - * Terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in a web - * site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteProcessAsync(String resourceGroupName, String name, String processId); - - /** - * Terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in a web - * site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deleteProcess(String resourceGroupName, String name, String processId); - - /** - * Terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in a web - * site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteProcessWithResponse(String resourceGroupName, String name, String processId, Context context); - - /** - * Get a memory dump of a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a memory dump of a process by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getProcessDumpWithResponseAsync(String resourceGroupName, String name, String processId); - - /** - * Get a memory dump of a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a memory dump of a process by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Flux getProcessDumpAsync(String resourceGroupName, String name, String processId); - - /** - * Get a memory dump of a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a memory dump of a process by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - InputStream getProcessDump(String resourceGroupName, String name, String processId); - - /** - * Get a memory dump of a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a memory dump of a process by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - StreamResponse getProcessDumpWithResponse(String resourceGroupName, String name, String processId, Context context); - - /** - * List module information for a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listProcessModulesAsync(String resourceGroupName, String name, String processId); - - /** - * List module information for a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listProcessModules(String resourceGroupName, String name, String processId); - - /** - * List module information for a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listProcessModules( - String resourceGroupName, String name, String processId, Context context); - - /** - * Get process information by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param baseAddress Module base address. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return process information by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getProcessModuleWithResponseAsync( - String resourceGroupName, String name, String processId, String baseAddress); - - /** - * Get process information by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param baseAddress Module base address. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return process information by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getProcessModuleAsync( - String resourceGroupName, String name, String processId, String baseAddress); - - /** - * Get process information by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param baseAddress Module base address. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return process information by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ProcessModuleInfoInner getProcessModule( - String resourceGroupName, String name, String processId, String baseAddress); - - /** - * Get process information by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param baseAddress Module base address. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return process information by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getProcessModuleWithResponse( - String resourceGroupName, String name, String processId, String baseAddress, Context context); - - /** - * List the threads in a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listProcessThreadsAsync(String resourceGroupName, String name, String processId); - - /** - * List the threads in a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listProcessThreads(String resourceGroupName, String name, String processId); - - /** - * List the threads in a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listProcessThreads( - String resourceGroupName, String name, String processId, Context context); - - /** - * Get thread information by Thread ID for a specific process, in a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param threadId TID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return thread information by Thread ID for a specific process, in a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getProcessThreadWithResponseAsync( - String resourceGroupName, String name, String processId, String threadId); - - /** - * Get thread information by Thread ID for a specific process, in a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param threadId TID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return thread information by Thread ID for a specific process, in a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getProcessThreadAsync( - String resourceGroupName, String name, String processId, String threadId); - - /** - * Get thread information by Thread ID for a specific process, in a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param threadId TID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return thread information by Thread ID for a specific process, in a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ProcessThreadInfoInner getProcessThread(String resourceGroupName, String name, String processId, String threadId); - - /** - * Get thread information by Thread ID for a specific process, in a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param threadId TID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return thread information by Thread ID for a specific process, in a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getProcessThreadWithResponse( - String resourceGroupName, String name, String processId, String threadId, Context context); - - /** - * Get public certificates for an app or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public certificates for an app or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listPublicCertificatesAsync(String resourceGroupName, String name); - - /** - * Get public certificates for an app or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public certificates for an app or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listPublicCertificates(String resourceGroupName, String name); - - /** - * Get public certificates for an app or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public certificates for an app or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listPublicCertificates( - String resourceGroupName, String name, Context context); - - /** - * Get the named public certificate for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param publicCertificateName Public certificate name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the named public certificate for an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getPublicCertificateWithResponseAsync( - String resourceGroupName, String name, String publicCertificateName); - - /** - * Get the named public certificate for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param publicCertificateName Public certificate name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the named public certificate for an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getPublicCertificateAsync( - String resourceGroupName, String name, String publicCertificateName); - - /** - * Get the named public certificate for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param publicCertificateName Public certificate name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the named public certificate for an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PublicCertificateInner getPublicCertificate(String resourceGroupName, String name, String publicCertificateName); - - /** - * Get the named public certificate for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param publicCertificateName Public certificate name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the named public certificate for an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getPublicCertificateWithResponse( - String resourceGroupName, String name, String publicCertificateName, Context context); - - /** - * Creates a hostname binding for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param publicCertificateName Public certificate name. - * @param publicCertificate Public certificate details. This is the JSON representation of a PublicCertificate - * object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public certificate object. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createOrUpdatePublicCertificateWithResponseAsync( - String resourceGroupName, String name, String publicCertificateName, PublicCertificateInner publicCertificate); - - /** - * Creates a hostname binding for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param publicCertificateName Public certificate name. - * @param publicCertificate Public certificate details. This is the JSON representation of a PublicCertificate - * object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public certificate object. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdatePublicCertificateAsync( - String resourceGroupName, String name, String publicCertificateName, PublicCertificateInner publicCertificate); - - /** - * Creates a hostname binding for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param publicCertificateName Public certificate name. - * @param publicCertificate Public certificate details. This is the JSON representation of a PublicCertificate - * object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public certificate object. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PublicCertificateInner createOrUpdatePublicCertificate( - String resourceGroupName, String name, String publicCertificateName, PublicCertificateInner publicCertificate); - - /** - * Creates a hostname binding for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param publicCertificateName Public certificate name. - * @param publicCertificate Public certificate details. This is the JSON representation of a PublicCertificate - * object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public certificate object. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdatePublicCertificateWithResponse( - String resourceGroupName, - String name, - String publicCertificateName, - PublicCertificateInner publicCertificate, - Context context); - - /** - * Deletes a hostname binding for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param publicCertificateName Public certificate name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deletePublicCertificateWithResponseAsync( - String resourceGroupName, String name, String publicCertificateName); - - /** - * Deletes a hostname binding for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param publicCertificateName Public certificate name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deletePublicCertificateAsync(String resourceGroupName, String name, String publicCertificateName); - - /** - * Deletes a hostname binding for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param publicCertificateName Public certificate name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deletePublicCertificate(String resourceGroupName, String name, String publicCertificateName); - - /** - * Deletes a hostname binding for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param publicCertificateName Public certificate name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deletePublicCertificateWithResponse( - String resourceGroupName, String name, String publicCertificateName, Context context); - - /** - * Gets the publishing profile for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param publishingProfileOptions Specifies publishingProfileOptions for publishing profile. For example, use - * {"format": "FileZilla3"} to get a FileZilla publishing profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the publishing profile for an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listPublishingProfileXmlWithSecretsWithResponseAsync( - String resourceGroupName, String name, CsmPublishingProfileOptions publishingProfileOptions); - - /** - * Gets the publishing profile for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param publishingProfileOptions Specifies publishingProfileOptions for publishing profile. For example, use - * {"format": "FileZilla3"} to get a FileZilla publishing profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the publishing profile for an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Flux listPublishingProfileXmlWithSecretsAsync( - String resourceGroupName, String name, CsmPublishingProfileOptions publishingProfileOptions); - - /** - * Gets the publishing profile for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param publishingProfileOptions Specifies publishingProfileOptions for publishing profile. For example, use - * {"format": "FileZilla3"} to get a FileZilla publishing profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the publishing profile for an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - InputStream listPublishingProfileXmlWithSecrets( - String resourceGroupName, String name, CsmPublishingProfileOptions publishingProfileOptions); - - /** - * Gets the publishing profile for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param publishingProfileOptions Specifies publishingProfileOptions for publishing profile. For example, use - * {"format": "FileZilla3"} to get a FileZilla publishing profile. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the publishing profile for an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - StreamResponse listPublishingProfileXmlWithSecretsWithResponse( - String resourceGroupName, String name, CsmPublishingProfileOptions publishingProfileOptions, Context context); - - /** - * Resets the configuration settings of the current slot if they were previously modified by calling the API with - * POST. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> resetProductionSlotConfigWithResponseAsync(String resourceGroupName, String name); - - /** - * Resets the configuration settings of the current slot if they were previously modified by calling the API with - * POST. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono resetProductionSlotConfigAsync(String resourceGroupName, String name); - - /** - * Resets the configuration settings of the current slot if they were previously modified by calling the API with - * POST. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void resetProductionSlotConfig(String resourceGroupName, String name); - - /** - * Resets the configuration settings of the current slot if they were previously modified by calling the API with - * POST. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response resetProductionSlotConfigWithResponse(String resourceGroupName, String name, Context context); - - /** - * Restarts an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param softRestart Specify true to apply the configuration settings and restarts the app only if necessary. By - * default, the API always restarts and reprovisions the app. - * @param synchronous Specify true to block until the app is restarted. By default, it is set to false, and the API - * responds immediately (asynchronous). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> restartWithResponseAsync( - String resourceGroupName, String name, Boolean softRestart, Boolean synchronous); - - /** - * Restarts an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param softRestart Specify true to apply the configuration settings and restarts the app only if necessary. By - * default, the API always restarts and reprovisions the app. - * @param synchronous Specify true to block until the app is restarted. By default, it is set to false, and the API - * responds immediately (asynchronous). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono restartAsync(String resourceGroupName, String name, Boolean softRestart, Boolean synchronous); - - /** - * Restarts an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono restartAsync(String resourceGroupName, String name); - - /** - * Restarts an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void restart(String resourceGroupName, String name); - - /** - * Restarts an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param softRestart Specify true to apply the configuration settings and restarts the app only if necessary. By - * default, the API always restarts and reprovisions the app. - * @param synchronous Specify true to block until the app is restarted. By default, it is set to false, and the API - * responds immediately (asynchronous). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response restartWithResponse( - String resourceGroupName, String name, Boolean softRestart, Boolean synchronous, Context context); - - /** - * Restores an app from a backup blob in Azure Storage. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param request Information on restore request . - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> restoreFromBackupBlobWithResponseAsync( - String resourceGroupName, String name, RestoreRequestInner request); - - /** - * Restores an app from a backup blob in Azure Storage. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param request Information on restore request . - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginRestoreFromBackupBlobAsync( - String resourceGroupName, String name, RestoreRequestInner request); - - /** - * Restores an app from a backup blob in Azure Storage. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param request Information on restore request . - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginRestoreFromBackupBlob( - String resourceGroupName, String name, RestoreRequestInner request); - - /** - * Restores an app from a backup blob in Azure Storage. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param request Information on restore request . - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginRestoreFromBackupBlob( - String resourceGroupName, String name, RestoreRequestInner request, Context context); - - /** - * Restores an app from a backup blob in Azure Storage. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param request Information on restore request . - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono restoreFromBackupBlobAsync(String resourceGroupName, String name, RestoreRequestInner request); - - /** - * Restores an app from a backup blob in Azure Storage. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param request Information on restore request . - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void restoreFromBackupBlob(String resourceGroupName, String name, RestoreRequestInner request); - - /** - * Restores an app from a backup blob in Azure Storage. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param request Information on restore request . - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void restoreFromBackupBlob(String resourceGroupName, String name, RestoreRequestInner request, Context context); - - /** - * Restores a deleted web app to this web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param restoreRequest Deleted web app restore information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> restoreFromDeletedAppWithResponseAsync( - String resourceGroupName, String name, DeletedAppRestoreRequest restoreRequest); - - /** - * Restores a deleted web app to this web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param restoreRequest Deleted web app restore information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginRestoreFromDeletedAppAsync( - String resourceGroupName, String name, DeletedAppRestoreRequest restoreRequest); - - /** - * Restores a deleted web app to this web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param restoreRequest Deleted web app restore information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginRestoreFromDeletedApp( - String resourceGroupName, String name, DeletedAppRestoreRequest restoreRequest); - - /** - * Restores a deleted web app to this web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param restoreRequest Deleted web app restore information. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginRestoreFromDeletedApp( - String resourceGroupName, String name, DeletedAppRestoreRequest restoreRequest, Context context); - - /** - * Restores a deleted web app to this web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param restoreRequest Deleted web app restore information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono restoreFromDeletedAppAsync( - String resourceGroupName, String name, DeletedAppRestoreRequest restoreRequest); - - /** - * Restores a deleted web app to this web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param restoreRequest Deleted web app restore information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void restoreFromDeletedApp(String resourceGroupName, String name, DeletedAppRestoreRequest restoreRequest); - - /** - * Restores a deleted web app to this web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param restoreRequest Deleted web app restore information. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void restoreFromDeletedApp( - String resourceGroupName, String name, DeletedAppRestoreRequest restoreRequest, Context context); - - /** - * Restores a web app from a snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param restoreRequest Snapshot restore settings. Snapshot information can be obtained by calling GetDeletedSites - * or GetSiteSnapshots API. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> restoreSnapshotWithResponseAsync( - String resourceGroupName, String name, SnapshotRestoreRequest restoreRequest); - - /** - * Restores a web app from a snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param restoreRequest Snapshot restore settings. Snapshot information can be obtained by calling GetDeletedSites - * or GetSiteSnapshots API. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginRestoreSnapshotAsync( - String resourceGroupName, String name, SnapshotRestoreRequest restoreRequest); - - /** - * Restores a web app from a snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param restoreRequest Snapshot restore settings. Snapshot information can be obtained by calling GetDeletedSites - * or GetSiteSnapshots API. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginRestoreSnapshot( - String resourceGroupName, String name, SnapshotRestoreRequest restoreRequest); - - /** - * Restores a web app from a snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param restoreRequest Snapshot restore settings. Snapshot information can be obtained by calling GetDeletedSites - * or GetSiteSnapshots API. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginRestoreSnapshot( - String resourceGroupName, String name, SnapshotRestoreRequest restoreRequest, Context context); - - /** - * Restores a web app from a snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param restoreRequest Snapshot restore settings. Snapshot information can be obtained by calling GetDeletedSites - * or GetSiteSnapshots API. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono restoreSnapshotAsync(String resourceGroupName, String name, SnapshotRestoreRequest restoreRequest); - - /** - * Restores a web app from a snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param restoreRequest Snapshot restore settings. Snapshot information can be obtained by calling GetDeletedSites - * or GetSiteSnapshots API. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void restoreSnapshot(String resourceGroupName, String name, SnapshotRestoreRequest restoreRequest); - - /** - * Restores a web app from a snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param restoreRequest Snapshot restore settings. Snapshot information can be obtained by calling GetDeletedSites - * or GetSiteSnapshots API. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void restoreSnapshot(String resourceGroupName, String name, SnapshotRestoreRequest restoreRequest, Context context); - - /** - * Get list of siteextensions for a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of siteextensions for a web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listSiteExtensionsAsync(String resourceGroupName, String name); - - /** - * Get list of siteextensions for a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of siteextensions for a web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listSiteExtensions(String resourceGroupName, String name); - - /** - * Get list of siteextensions for a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of siteextensions for a web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listSiteExtensions(String resourceGroupName, String name, Context context); - - /** - * Get site extension information by its ID for a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site extension information by its ID for a web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getSiteExtensionWithResponseAsync( - String resourceGroupName, String name, String siteExtensionId); - - /** - * Get site extension information by its ID for a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site extension information by its ID for a web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getSiteExtensionAsync(String resourceGroupName, String name, String siteExtensionId); - - /** - * Get site extension information by its ID for a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site extension information by its ID for a web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SiteExtensionInfoInner getSiteExtension(String resourceGroupName, String name, String siteExtensionId); - - /** - * Get site extension information by its ID for a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site extension information by its ID for a web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getSiteExtensionWithResponse( - String resourceGroupName, String name, String siteExtensionId, Context context); - - /** - * Install site extension on a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Extension Information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> installSiteExtensionWithResponseAsync( - String resourceGroupName, String name, String siteExtensionId); - - /** - * Install site extension on a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Extension Information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, SiteExtensionInfoInner> beginInstallSiteExtensionAsync( - String resourceGroupName, String name, String siteExtensionId); - - /** - * Install site extension on a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Extension Information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, SiteExtensionInfoInner> beginInstallSiteExtension( - String resourceGroupName, String name, String siteExtensionId); - - /** - * Install site extension on a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Extension Information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, SiteExtensionInfoInner> beginInstallSiteExtension( - String resourceGroupName, String name, String siteExtensionId, Context context); - - /** - * Install site extension on a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Extension Information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono installSiteExtensionAsync( - String resourceGroupName, String name, String siteExtensionId); - - /** - * Install site extension on a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Extension Information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SiteExtensionInfoInner installSiteExtension(String resourceGroupName, String name, String siteExtensionId); - - /** - * Install site extension on a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Extension Information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SiteExtensionInfoInner installSiteExtension( - String resourceGroupName, String name, String siteExtensionId, Context context); - - /** - * Remove a site extension from a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteSiteExtensionWithResponseAsync( - String resourceGroupName, String name, String siteExtensionId); - - /** - * Remove a site extension from a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteSiteExtensionAsync(String resourceGroupName, String name, String siteExtensionId); - - /** - * Remove a site extension from a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deleteSiteExtension(String resourceGroupName, String name, String siteExtensionId); - - /** - * Remove a site extension from a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteSiteExtensionWithResponse( - String resourceGroupName, String name, String siteExtensionId, Context context); - - /** - * Gets an app's deployment slots. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an app's deployment slots. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listSlotsAsync(String resourceGroupName, String name); - - /** - * Gets an app's deployment slots. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an app's deployment slots. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listSlots(String resourceGroupName, String name); - - /** - * Gets an app's deployment slots. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an app's deployment slots. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listSlots(String resourceGroupName, String name, Context context); - - /** - * Gets the details of a web, mobile, or API app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. By default, this API returns the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of a web, mobile, or API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getSlotWithResponseAsync(String resourceGroupName, String name, String slot); - - /** - * Gets the details of a web, mobile, or API app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. By default, this API returns the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of a web, mobile, or API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getSlotAsync(String resourceGroupName, String name, String slot); - - /** - * Gets the details of a web, mobile, or API app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. By default, this API returns the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of a web, mobile, or API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SiteInner getSlot(String resourceGroupName, String name, String slot); - - /** - * Gets the details of a web, mobile, or API app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. By default, this API returns the production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of a web, mobile, or API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getSlotWithResponse(String resourceGroupName, String name, String slot, Context context); - - /** - * Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} - * parameter. - * @param slot Name of the deployment slot to create or update. By default, this API attempts to create or modify - * the production slot. - * @param siteEnvelope A JSON representation of the app properties. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a web app, a mobile app backend, or an API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateSlotWithResponseAsync( - String resourceGroupName, String name, String slot, SiteInner siteEnvelope); - - /** - * Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} - * parameter. - * @param slot Name of the deployment slot to create or update. By default, this API attempts to create or modify - * the production slot. - * @param siteEnvelope A JSON representation of the app properties. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a web app, a mobile app backend, or an API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, SiteInner> beginCreateOrUpdateSlotAsync( - String resourceGroupName, String name, String slot, SiteInner siteEnvelope); - - /** - * Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} - * parameter. - * @param slot Name of the deployment slot to create or update. By default, this API attempts to create or modify - * the production slot. - * @param siteEnvelope A JSON representation of the app properties. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a web app, a mobile app backend, or an API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, SiteInner> beginCreateOrUpdateSlot( - String resourceGroupName, String name, String slot, SiteInner siteEnvelope); - - /** - * Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} - * parameter. - * @param slot Name of the deployment slot to create or update. By default, this API attempts to create or modify - * the production slot. - * @param siteEnvelope A JSON representation of the app properties. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a web app, a mobile app backend, or an API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, SiteInner> beginCreateOrUpdateSlot( - String resourceGroupName, String name, String slot, SiteInner siteEnvelope, Context context); - - /** - * Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} - * parameter. - * @param slot Name of the deployment slot to create or update. By default, this API attempts to create or modify - * the production slot. - * @param siteEnvelope A JSON representation of the app properties. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a web app, a mobile app backend, or an API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateSlotAsync(String resourceGroupName, String name, String slot, SiteInner siteEnvelope); - - /** - * Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} - * parameter. - * @param slot Name of the deployment slot to create or update. By default, this API attempts to create or modify - * the production slot. - * @param siteEnvelope A JSON representation of the app properties. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a web app, a mobile app backend, or an API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SiteInner createOrUpdateSlot(String resourceGroupName, String name, String slot, SiteInner siteEnvelope); - - /** - * Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} - * parameter. - * @param slot Name of the deployment slot to create or update. By default, this API attempts to create or modify - * the production slot. - * @param siteEnvelope A JSON representation of the app properties. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a web app, a mobile app backend, or an API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SiteInner createOrUpdateSlot( - String resourceGroupName, String name, String slot, SiteInner siteEnvelope, Context context); - - /** - * Deletes a web, mobile, or API app, or one of the deployment slots. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app to delete. - * @param slot Name of the deployment slot to delete. By default, the API deletes the production slot. - * @param deleteMetrics If true, web app metrics are also deleted. - * @param deleteEmptyServerFarm Specify true if the App Service plan will be empty after app deletion and you want - * to delete the empty App Service plan. By default, the empty App Service plan is not deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteSlotWithResponseAsync( - String resourceGroupName, String name, String slot, Boolean deleteMetrics, Boolean deleteEmptyServerFarm); - - /** - * Deletes a web, mobile, or API app, or one of the deployment slots. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app to delete. - * @param slot Name of the deployment slot to delete. By default, the API deletes the production slot. - * @param deleteMetrics If true, web app metrics are also deleted. - * @param deleteEmptyServerFarm Specify true if the App Service plan will be empty after app deletion and you want - * to delete the empty App Service plan. By default, the empty App Service plan is not deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteSlotAsync( - String resourceGroupName, String name, String slot, Boolean deleteMetrics, Boolean deleteEmptyServerFarm); - - /** - * Deletes a web, mobile, or API app, or one of the deployment slots. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app to delete. - * @param slot Name of the deployment slot to delete. By default, the API deletes the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteSlotAsync(String resourceGroupName, String name, String slot); - - /** - * Deletes a web, mobile, or API app, or one of the deployment slots. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app to delete. - * @param slot Name of the deployment slot to delete. By default, the API deletes the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deleteSlot(String resourceGroupName, String name, String slot); - - /** - * Deletes a web, mobile, or API app, or one of the deployment slots. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app to delete. - * @param slot Name of the deployment slot to delete. By default, the API deletes the production slot. - * @param deleteMetrics If true, web app metrics are also deleted. - * @param deleteEmptyServerFarm Specify true if the App Service plan will be empty after app deletion and you want - * to delete the empty App Service plan. By default, the empty App Service plan is not deleted. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteSlotWithResponse( - String resourceGroupName, - String name, - String slot, - Boolean deleteMetrics, - Boolean deleteEmptyServerFarm, - Context context); - - /** - * Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} - * parameter. - * @param slot Name of the deployment slot to create or update. By default, this API attempts to create or modify - * the production slot. - * @param siteEnvelope A JSON representation of the app properties. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a web app, a mobile app backend, or an API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateSlotWithResponseAsync( - String resourceGroupName, String name, String slot, SitePatchResourceInner siteEnvelope); - - /** - * Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} - * parameter. - * @param slot Name of the deployment slot to create or update. By default, this API attempts to create or modify - * the production slot. - * @param siteEnvelope A JSON representation of the app properties. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a web app, a mobile app backend, or an API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateSlotAsync( - String resourceGroupName, String name, String slot, SitePatchResourceInner siteEnvelope); - - /** - * Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} - * parameter. - * @param slot Name of the deployment slot to create or update. By default, this API attempts to create or modify - * the production slot. - * @param siteEnvelope A JSON representation of the app properties. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a web app, a mobile app backend, or an API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SiteInner updateSlot(String resourceGroupName, String name, String slot, SitePatchResourceInner siteEnvelope); - - /** - * Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} - * parameter. - * @param slot Name of the deployment slot to create or update. By default, this API attempts to create or modify - * the production slot. - * @param siteEnvelope A JSON representation of the app properties. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a web app, a mobile app backend, or an API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateSlotWithResponse( - String resourceGroupName, String name, String slot, SitePatchResourceInner siteEnvelope, Context context); - - /** - * Analyze a custom hostname. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param hostname Custom hostname. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return custom domain analysis. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> analyzeCustomHostnameSlotWithResponseAsync( - String resourceGroupName, String name, String slot, String hostname); - - /** - * Analyze a custom hostname. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param hostname Custom hostname. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return custom domain analysis. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono analyzeCustomHostnameSlotAsync( - String resourceGroupName, String name, String slot, String hostname); - - /** - * Analyze a custom hostname. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return custom domain analysis. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono analyzeCustomHostnameSlotAsync( - String resourceGroupName, String name, String slot); - - /** - * Analyze a custom hostname. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return custom domain analysis. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - CustomHostnameAnalysisResultInner analyzeCustomHostnameSlot(String resourceGroupName, String name, String slot); - - /** - * Analyze a custom hostname. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param hostname Custom hostname. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return custom domain analysis. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response analyzeCustomHostnameSlotWithResponse( - String resourceGroupName, String name, String slot, String hostname, Context context); - - /** - * Applies the configuration settings from the target slot onto the current slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the source slot. If a slot is not specified, the production slot is used as the source slot. - * @param slotSwapEntity JSON object that contains the target slot name. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> applySlotConfigurationSlotWithResponseAsync( - String resourceGroupName, String name, String slot, CsmSlotEntity slotSwapEntity); - - /** - * Applies the configuration settings from the target slot onto the current slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the source slot. If a slot is not specified, the production slot is used as the source slot. - * @param slotSwapEntity JSON object that contains the target slot name. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono applySlotConfigurationSlotAsync( - String resourceGroupName, String name, String slot, CsmSlotEntity slotSwapEntity); - - /** - * Applies the configuration settings from the target slot onto the current slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the source slot. If a slot is not specified, the production slot is used as the source slot. - * @param slotSwapEntity JSON object that contains the target slot name. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void applySlotConfigurationSlot(String resourceGroupName, String name, String slot, CsmSlotEntity slotSwapEntity); - - /** - * Applies the configuration settings from the target slot onto the current slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the source slot. If a slot is not specified, the production slot is used as the source slot. - * @param slotSwapEntity JSON object that contains the target slot name. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response applySlotConfigurationSlotWithResponse( - String resourceGroupName, String name, String slot, CsmSlotEntity slotSwapEntity, Context context); - - /** - * Creates a backup of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will create a backup for the - * production slot. - * @param request Backup configuration. You can use the JSON response from the POST action as input here. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup description. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> backupSlotWithResponseAsync( - String resourceGroupName, String name, String slot, BackupRequestInner request); - - /** - * Creates a backup of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will create a backup for the - * production slot. - * @param request Backup configuration. You can use the JSON response from the POST action as input here. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup description. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono backupSlotAsync( - String resourceGroupName, String name, String slot, BackupRequestInner request); - - /** - * Creates a backup of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will create a backup for the - * production slot. - * @param request Backup configuration. You can use the JSON response from the POST action as input here. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup description. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - BackupItemInner backupSlot(String resourceGroupName, String name, String slot, BackupRequestInner request); - - /** - * Creates a backup of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will create a backup for the - * production slot. - * @param request Backup configuration. You can use the JSON response from the POST action as input here. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup description. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response backupSlotWithResponse( - String resourceGroupName, String name, String slot, BackupRequestInner request, Context context); - - /** - * Gets existing backups of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get backups of the production - * slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return existing backups of an app. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listBackupsSlotAsync(String resourceGroupName, String name, String slot); - - /** - * Gets existing backups of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get backups of the production - * slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return existing backups of an app. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listBackupsSlot(String resourceGroupName, String name, String slot); - - /** - * Gets existing backups of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get backups of the production - * slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return existing backups of an app. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listBackupsSlot(String resourceGroupName, String name, String slot, Context context); - - /** - * Gets a backup of an app by its ID. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get a backup of the production - * slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a backup of an app by its ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getBackupStatusSlotWithResponseAsync( - String resourceGroupName, String name, String backupId, String slot); - - /** - * Gets a backup of an app by its ID. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get a backup of the production - * slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a backup of an app by its ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getBackupStatusSlotAsync(String resourceGroupName, String name, String backupId, String slot); - - /** - * Gets a backup of an app by its ID. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get a backup of the production - * slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a backup of an app by its ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - BackupItemInner getBackupStatusSlot(String resourceGroupName, String name, String backupId, String slot); - - /** - * Gets a backup of an app by its ID. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get a backup of the production - * slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a backup of an app by its ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getBackupStatusSlotWithResponse( - String resourceGroupName, String name, String backupId, String slot, Context context); - - /** - * Deletes a backup of an app by its ID. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete a backup of the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteBackupSlotWithResponseAsync( - String resourceGroupName, String name, String backupId, String slot); - - /** - * Deletes a backup of an app by its ID. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete a backup of the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteBackupSlotAsync(String resourceGroupName, String name, String backupId, String slot); - - /** - * Deletes a backup of an app by its ID. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete a backup of the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deleteBackupSlot(String resourceGroupName, String name, String backupId, String slot); - - /** - * Deletes a backup of an app by its ID. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete a backup of the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteBackupSlotWithResponse( - String resourceGroupName, String name, String backupId, String slot, Context context); - - /** - * Gets status of a web app backup that may be in progress, including secrets associated with the backup, such as - * the Azure Storage SAS URL. Also can be used to update the SAS URL for the backup if a new URL is passed in the - * request body. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param backupId ID of backup. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param request Information on backup request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return status of a web app backup that may be in progress, including secrets associated with the backup, such as - * the Azure Storage SAS URL. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listBackupStatusSecretsSlotWithResponseAsync( - String resourceGroupName, String name, String backupId, String slot, BackupRequestInner request); - - /** - * Gets status of a web app backup that may be in progress, including secrets associated with the backup, such as - * the Azure Storage SAS URL. Also can be used to update the SAS URL for the backup if a new URL is passed in the - * request body. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param backupId ID of backup. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param request Information on backup request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return status of a web app backup that may be in progress, including secrets associated with the backup, such as - * the Azure Storage SAS URL. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listBackupStatusSecretsSlotAsync( - String resourceGroupName, String name, String backupId, String slot, BackupRequestInner request); - - /** - * Gets status of a web app backup that may be in progress, including secrets associated with the backup, such as - * the Azure Storage SAS URL. Also can be used to update the SAS URL for the backup if a new URL is passed in the - * request body. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param backupId ID of backup. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param request Information on backup request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return status of a web app backup that may be in progress, including secrets associated with the backup, such as - * the Azure Storage SAS URL. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - BackupItemInner listBackupStatusSecretsSlot( - String resourceGroupName, String name, String backupId, String slot, BackupRequestInner request); - - /** - * Gets status of a web app backup that may be in progress, including secrets associated with the backup, such as - * the Azure Storage SAS URL. Also can be used to update the SAS URL for the backup if a new URL is passed in the - * request body. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param backupId ID of backup. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param request Information on backup request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return status of a web app backup that may be in progress, including secrets associated with the backup, such as - * the Azure Storage SAS URL. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listBackupStatusSecretsSlotWithResponse( - String resourceGroupName, - String name, - String backupId, - String slot, - BackupRequestInner request, - Context context); - - /** - * Restores a specific backup to another app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param slot Name of the deployment slot. If a slot is not specified, the API will restore a backup of the - * production slot. - * @param request Information on restore request . - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> restoreSlotWithResponseAsync( - String resourceGroupName, String name, String backupId, String slot, RestoreRequestInner request); - - /** - * Restores a specific backup to another app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param slot Name of the deployment slot. If a slot is not specified, the API will restore a backup of the - * production slot. - * @param request Information on restore request . - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginRestoreSlotAsync( - String resourceGroupName, String name, String backupId, String slot, RestoreRequestInner request); - - /** - * Restores a specific backup to another app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param slot Name of the deployment slot. If a slot is not specified, the API will restore a backup of the - * production slot. - * @param request Information on restore request . - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginRestoreSlot( - String resourceGroupName, String name, String backupId, String slot, RestoreRequestInner request); - - /** - * Restores a specific backup to another app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param slot Name of the deployment slot. If a slot is not specified, the API will restore a backup of the - * production slot. - * @param request Information on restore request . - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginRestoreSlot( - String resourceGroupName, - String name, - String backupId, - String slot, - RestoreRequestInner request, - Context context); - - /** - * Restores a specific backup to another app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param slot Name of the deployment slot. If a slot is not specified, the API will restore a backup of the - * production slot. - * @param request Information on restore request . - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono restoreSlotAsync( - String resourceGroupName, String name, String backupId, String slot, RestoreRequestInner request); - - /** - * Restores a specific backup to another app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param slot Name of the deployment slot. If a slot is not specified, the API will restore a backup of the - * production slot. - * @param request Information on restore request . - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void restoreSlot(String resourceGroupName, String name, String backupId, String slot, RestoreRequestInner request); - - /** - * Restores a specific backup to another app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param slot Name of the deployment slot. If a slot is not specified, the API will restore a backup of the - * production slot. - * @param request Information on restore request . - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void restoreSlot( - String resourceGroupName, - String name, - String backupId, - String slot, - RestoreRequestInner request, - Context context); - - /** - * List the configurations of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will return configuration for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of site configurations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listConfigurationsSlotAsync(String resourceGroupName, String name, String slot); - - /** - * List the configurations of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will return configuration for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of site configurations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listConfigurationsSlot(String resourceGroupName, String name, String slot); - - /** - * List the configurations of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will return configuration for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of site configurations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listConfigurationsSlot( - String resourceGroupName, String name, String slot, Context context); - - /** - * Replaces the application settings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the application settings - * for the production slot. - * @param appSettings Application settings of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return string dictionary resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateApplicationSettingsSlotWithResponseAsync( - String resourceGroupName, String name, String slot, StringDictionaryInner appSettings); - - /** - * Replaces the application settings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the application settings - * for the production slot. - * @param appSettings Application settings of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return string dictionary resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateApplicationSettingsSlotAsync( - String resourceGroupName, String name, String slot, StringDictionaryInner appSettings); - - /** - * Replaces the application settings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the application settings - * for the production slot. - * @param appSettings Application settings of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return string dictionary resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - StringDictionaryInner updateApplicationSettingsSlot( - String resourceGroupName, String name, String slot, StringDictionaryInner appSettings); - - /** - * Replaces the application settings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the application settings - * for the production slot. - * @param appSettings Application settings of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return string dictionary resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateApplicationSettingsSlotWithResponse( - String resourceGroupName, String name, String slot, StringDictionaryInner appSettings, Context context); - - /** - * Gets the application settings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the application settings - * for the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the application settings of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listApplicationSettingsSlotWithResponseAsync( - String resourceGroupName, String name, String slot); - - /** - * Gets the application settings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the application settings - * for the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the application settings of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listApplicationSettingsSlotAsync(String resourceGroupName, String name, String slot); - - /** - * Gets the application settings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the application settings - * for the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the application settings of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - StringDictionaryInner listApplicationSettingsSlot(String resourceGroupName, String name, String slot); - - /** - * Gets the application settings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the application settings - * for the production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the application settings of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listApplicationSettingsSlotWithResponse( - String resourceGroupName, String name, String slot, Context context); - - /** - * Updates the Authentication / Authorization settings associated with web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param siteAuthSettings Auth settings associated with web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration settings for the Azure App Service Authentication / Authorization feature. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateAuthSettingsSlotWithResponseAsync( - String resourceGroupName, String name, String slot, SiteAuthSettingsInner siteAuthSettings); - - /** - * Updates the Authentication / Authorization settings associated with web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param siteAuthSettings Auth settings associated with web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration settings for the Azure App Service Authentication / Authorization feature. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAuthSettingsSlotAsync( - String resourceGroupName, String name, String slot, SiteAuthSettingsInner siteAuthSettings); - - /** - * Updates the Authentication / Authorization settings associated with web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param siteAuthSettings Auth settings associated with web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration settings for the Azure App Service Authentication / Authorization feature. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SiteAuthSettingsInner updateAuthSettingsSlot( - String resourceGroupName, String name, String slot, SiteAuthSettingsInner siteAuthSettings); - - /** - * Updates the Authentication / Authorization settings associated with web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param siteAuthSettings Auth settings associated with web app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration settings for the Azure App Service Authentication / Authorization feature. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateAuthSettingsSlotWithResponse( - String resourceGroupName, String name, String slot, SiteAuthSettingsInner siteAuthSettings, Context context); - - /** - * Gets the Authentication/Authorization settings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the settings for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Authentication/Authorization settings of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getAuthSettingsSlotWithResponseAsync( - String resourceGroupName, String name, String slot); - - /** - * Gets the Authentication/Authorization settings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the settings for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Authentication/Authorization settings of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAuthSettingsSlotAsync(String resourceGroupName, String name, String slot); - - /** - * Gets the Authentication/Authorization settings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the settings for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Authentication/Authorization settings of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SiteAuthSettingsInner getAuthSettingsSlot(String resourceGroupName, String name, String slot); - - /** - * Gets the Authentication/Authorization settings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the settings for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Authentication/Authorization settings of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getAuthSettingsSlotWithResponse( - String resourceGroupName, String name, String slot, Context context); - - /** - * Updates the Azure storage account configurations of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the Azure storage - * account configurations for the production slot. - * @param azureStorageAccounts Azure storage accounts of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azureStorageInfo dictionary resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateAzureStorageAccountsSlotWithResponseAsync( - String resourceGroupName, - String name, - String slot, - AzureStoragePropertyDictionaryResourceInner azureStorageAccounts); - - /** - * Updates the Azure storage account configurations of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the Azure storage - * account configurations for the production slot. - * @param azureStorageAccounts Azure storage accounts of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azureStorageInfo dictionary resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAzureStorageAccountsSlotAsync( - String resourceGroupName, - String name, - String slot, - AzureStoragePropertyDictionaryResourceInner azureStorageAccounts); - - /** - * Updates the Azure storage account configurations of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the Azure storage - * account configurations for the production slot. - * @param azureStorageAccounts Azure storage accounts of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azureStorageInfo dictionary resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AzureStoragePropertyDictionaryResourceInner updateAzureStorageAccountsSlot( - String resourceGroupName, - String name, - String slot, - AzureStoragePropertyDictionaryResourceInner azureStorageAccounts); - - /** - * Updates the Azure storage account configurations of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the Azure storage - * account configurations for the production slot. - * @param azureStorageAccounts Azure storage accounts of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azureStorageInfo dictionary resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateAzureStorageAccountsSlotWithResponse( - String resourceGroupName, - String name, - String slot, - AzureStoragePropertyDictionaryResourceInner azureStorageAccounts, - Context context); - - /** - * Gets the Azure storage account configurations of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the Azure storage - * account configurations for the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Azure storage account configurations of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listAzureStorageAccountsSlotWithResponseAsync( - String resourceGroupName, String name, String slot); - - /** - * Gets the Azure storage account configurations of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the Azure storage - * account configurations for the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Azure storage account configurations of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listAzureStorageAccountsSlotAsync( - String resourceGroupName, String name, String slot); - - /** - * Gets the Azure storage account configurations of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the Azure storage - * account configurations for the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Azure storage account configurations of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AzureStoragePropertyDictionaryResourceInner listAzureStorageAccountsSlot( - String resourceGroupName, String name, String slot); - - /** - * Gets the Azure storage account configurations of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the Azure storage - * account configurations for the production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Azure storage account configurations of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listAzureStorageAccountsSlotWithResponse( - String resourceGroupName, String name, String slot, Context context); - - /** - * Updates the backup configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the backup configuration - * for the production slot. - * @param request Edited backup configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a backup which will be performed. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateBackupConfigurationSlotWithResponseAsync( - String resourceGroupName, String name, String slot, BackupRequestInner request); - - /** - * Updates the backup configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the backup configuration - * for the production slot. - * @param request Edited backup configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a backup which will be performed. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateBackupConfigurationSlotAsync( - String resourceGroupName, String name, String slot, BackupRequestInner request); - - /** - * Updates the backup configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the backup configuration - * for the production slot. - * @param request Edited backup configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a backup which will be performed. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - BackupRequestInner updateBackupConfigurationSlot( - String resourceGroupName, String name, String slot, BackupRequestInner request); - - /** - * Updates the backup configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the backup configuration - * for the production slot. - * @param request Edited backup configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a backup which will be performed. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateBackupConfigurationSlotWithResponse( - String resourceGroupName, String name, String slot, BackupRequestInner request, Context context); - - /** - * Deletes the backup configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the backup configuration - * for the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteBackupConfigurationSlotWithResponseAsync( - String resourceGroupName, String name, String slot); - - /** - * Deletes the backup configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the backup configuration - * for the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteBackupConfigurationSlotAsync(String resourceGroupName, String name, String slot); - - /** - * Deletes the backup configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the backup configuration - * for the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deleteBackupConfigurationSlot(String resourceGroupName, String name, String slot); - - /** - * Deletes the backup configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the backup configuration - * for the production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteBackupConfigurationSlotWithResponse( - String resourceGroupName, String name, String slot, Context context); - - /** - * Gets the backup configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the backup configuration - * for the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the backup configuration of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getBackupConfigurationSlotWithResponseAsync( - String resourceGroupName, String name, String slot); - - /** - * Gets the backup configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the backup configuration - * for the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the backup configuration of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getBackupConfigurationSlotAsync(String resourceGroupName, String name, String slot); - - /** - * Gets the backup configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the backup configuration - * for the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the backup configuration of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - BackupRequestInner getBackupConfigurationSlot(String resourceGroupName, String name, String slot); - - /** - * Gets the backup configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the backup configuration - * for the production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the backup configuration of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getBackupConfigurationSlotWithResponse( - String resourceGroupName, String name, String slot, Context context); - - /** - * Replaces the connection strings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the connection settings - * for the production slot. - * @param connectionStrings Connection strings of the app or deployment slot. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return string dictionary resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateConnectionStringsSlotWithResponseAsync( - String resourceGroupName, String name, String slot, ConnectionStringDictionaryInner connectionStrings); - - /** - * Replaces the connection strings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the connection settings - * for the production slot. - * @param connectionStrings Connection strings of the app or deployment slot. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return string dictionary resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateConnectionStringsSlotAsync( - String resourceGroupName, String name, String slot, ConnectionStringDictionaryInner connectionStrings); - - /** - * Replaces the connection strings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the connection settings - * for the production slot. - * @param connectionStrings Connection strings of the app or deployment slot. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return string dictionary resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ConnectionStringDictionaryInner updateConnectionStringsSlot( - String resourceGroupName, String name, String slot, ConnectionStringDictionaryInner connectionStrings); - - /** - * Replaces the connection strings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the connection settings - * for the production slot. - * @param connectionStrings Connection strings of the app or deployment slot. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return string dictionary resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateConnectionStringsSlotWithResponse( - String resourceGroupName, - String name, - String slot, - ConnectionStringDictionaryInner connectionStrings, - Context context); - - /** - * Gets the connection strings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the connection settings for - * the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the connection strings of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listConnectionStringsSlotWithResponseAsync( - String resourceGroupName, String name, String slot); - - /** - * Gets the connection strings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the connection settings for - * the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the connection strings of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listConnectionStringsSlotAsync( - String resourceGroupName, String name, String slot); - - /** - * Gets the connection strings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the connection settings for - * the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the connection strings of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ConnectionStringDictionaryInner listConnectionStringsSlot(String resourceGroupName, String name, String slot); - - /** - * Gets the connection strings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the connection settings for - * the production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the connection strings of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listConnectionStringsSlotWithResponse( - String resourceGroupName, String name, String slot, Context context); - - /** - * Gets the logging configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the logging configuration - * for the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the logging configuration of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getDiagnosticLogsConfigurationSlotWithResponseAsync( - String resourceGroupName, String name, String slot); - - /** - * Gets the logging configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the logging configuration - * for the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the logging configuration of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getDiagnosticLogsConfigurationSlotAsync( - String resourceGroupName, String name, String slot); - - /** - * Gets the logging configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the logging configuration - * for the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the logging configuration of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SiteLogsConfigInner getDiagnosticLogsConfigurationSlot(String resourceGroupName, String name, String slot); - - /** - * Gets the logging configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the logging configuration - * for the production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the logging configuration of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getDiagnosticLogsConfigurationSlotWithResponse( - String resourceGroupName, String name, String slot, Context context); - - /** - * Updates the logging configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the logging - * configuration for the production slot. - * @param siteLogsConfig A SiteLogsConfig JSON object that contains the logging configuration to change in the - * "properties" property. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration of App Service site logs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateDiagnosticLogsConfigSlotWithResponseAsync( - String resourceGroupName, String name, String slot, SiteLogsConfigInner siteLogsConfig); - - /** - * Updates the logging configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the logging - * configuration for the production slot. - * @param siteLogsConfig A SiteLogsConfig JSON object that contains the logging configuration to change in the - * "properties" property. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration of App Service site logs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateDiagnosticLogsConfigSlotAsync( - String resourceGroupName, String name, String slot, SiteLogsConfigInner siteLogsConfig); - - /** - * Updates the logging configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the logging - * configuration for the production slot. - * @param siteLogsConfig A SiteLogsConfig JSON object that contains the logging configuration to change in the - * "properties" property. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration of App Service site logs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SiteLogsConfigInner updateDiagnosticLogsConfigSlot( - String resourceGroupName, String name, String slot, SiteLogsConfigInner siteLogsConfig); - - /** - * Updates the logging configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the logging - * configuration for the production slot. - * @param siteLogsConfig A SiteLogsConfig JSON object that contains the logging configuration to change in the - * "properties" property. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration of App Service site logs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateDiagnosticLogsConfigSlotWithResponse( - String resourceGroupName, String name, String slot, SiteLogsConfigInner siteLogsConfig, Context context); - - /** - * Replaces the metadata of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the metadata for the - * production slot. - * @param metadata Edited metadata of the app or deployment slot. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return string dictionary resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateMetadataSlotWithResponseAsync( - String resourceGroupName, String name, String slot, StringDictionaryInner metadata); - - /** - * Replaces the metadata of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the metadata for the - * production slot. - * @param metadata Edited metadata of the app or deployment slot. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return string dictionary resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateMetadataSlotAsync( - String resourceGroupName, String name, String slot, StringDictionaryInner metadata); - - /** - * Replaces the metadata of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the metadata for the - * production slot. - * @param metadata Edited metadata of the app or deployment slot. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return string dictionary resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - StringDictionaryInner updateMetadataSlot( - String resourceGroupName, String name, String slot, StringDictionaryInner metadata); - - /** - * Replaces the metadata of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the metadata for the - * production slot. - * @param metadata Edited metadata of the app or deployment slot. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return string dictionary resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateMetadataSlotWithResponse( - String resourceGroupName, String name, String slot, StringDictionaryInner metadata, Context context); - - /** - * Gets the metadata of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the metadata for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the metadata of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listMetadataSlotWithResponseAsync( - String resourceGroupName, String name, String slot); - - /** - * Gets the metadata of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the metadata for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the metadata of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listMetadataSlotAsync(String resourceGroupName, String name, String slot); - - /** - * Gets the metadata of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the metadata for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the metadata of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - StringDictionaryInner listMetadataSlot(String resourceGroupName, String name, String slot); - - /** - * Gets the metadata of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the metadata for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the metadata of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listMetadataSlotWithResponse( - String resourceGroupName, String name, String slot, Context context); - - /** - * Gets the Git/FTP publishing credentials of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the publishing credentials - * for the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Git/FTP publishing credentials of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> listPublishingCredentialsSlotWithResponseAsync( - String resourceGroupName, String name, String slot); - - /** - * Gets the Git/FTP publishing credentials of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the publishing credentials - * for the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Git/FTP publishing credentials of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, UserInner> beginListPublishingCredentialsSlotAsync( - String resourceGroupName, String name, String slot); - - /** - * Gets the Git/FTP publishing credentials of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the publishing credentials - * for the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Git/FTP publishing credentials of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, UserInner> beginListPublishingCredentialsSlot( - String resourceGroupName, String name, String slot); - - /** - * Gets the Git/FTP publishing credentials of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the publishing credentials - * for the production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Git/FTP publishing credentials of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, UserInner> beginListPublishingCredentialsSlot( - String resourceGroupName, String name, String slot, Context context); - - /** - * Gets the Git/FTP publishing credentials of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the publishing credentials - * for the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Git/FTP publishing credentials of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listPublishingCredentialsSlotAsync(String resourceGroupName, String name, String slot); - - /** - * Gets the Git/FTP publishing credentials of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the publishing credentials - * for the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Git/FTP publishing credentials of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - UserInner listPublishingCredentialsSlot(String resourceGroupName, String name, String slot); - - /** - * Gets the Git/FTP publishing credentials of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the publishing credentials - * for the production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Git/FTP publishing credentials of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - UserInner listPublishingCredentialsSlot(String resourceGroupName, String name, String slot, Context context); - - /** - * Updates the Push settings associated with web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param pushSettings Push settings associated with web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return push settings for the App. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateSitePushSettingsSlotWithResponseAsync( - String resourceGroupName, String name, String slot, PushSettingsInner pushSettings); - - /** - * Updates the Push settings associated with web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param pushSettings Push settings associated with web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return push settings for the App. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateSitePushSettingsSlotAsync( - String resourceGroupName, String name, String slot, PushSettingsInner pushSettings); - - /** - * Updates the Push settings associated with web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param pushSettings Push settings associated with web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return push settings for the App. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PushSettingsInner updateSitePushSettingsSlot( - String resourceGroupName, String name, String slot, PushSettingsInner pushSettings); - - /** - * Updates the Push settings associated with web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param pushSettings Push settings associated with web app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return push settings for the App. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateSitePushSettingsSlotWithResponse( - String resourceGroupName, String name, String slot, PushSettingsInner pushSettings, Context context); - - /** - * Gets the Push settings associated with web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Push settings associated with web app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listSitePushSettingsSlotWithResponseAsync( - String resourceGroupName, String name, String slot); - - /** - * Gets the Push settings associated with web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Push settings associated with web app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listSitePushSettingsSlotAsync(String resourceGroupName, String name, String slot); - - /** - * Gets the Push settings associated with web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Push settings associated with web app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PushSettingsInner listSitePushSettingsSlot(String resourceGroupName, String name, String slot); - - /** - * Gets the Push settings associated with web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Push settings associated with web app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listSitePushSettingsSlotWithResponse( - String resourceGroupName, String name, String slot, Context context); - - /** - * Gets the configuration of an app, such as platform version and bitness, default documents, virtual applications, - * Always On, etc. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will return configuration for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the configuration of an app, such as platform version and bitness, default documents, virtual - * applications, Always On, etc. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getConfigurationSlotWithResponseAsync( - String resourceGroupName, String name, String slot); - - /** - * Gets the configuration of an app, such as platform version and bitness, default documents, virtual applications, - * Always On, etc. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will return configuration for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the configuration of an app, such as platform version and bitness, default documents, virtual - * applications, Always On, etc. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getConfigurationSlotAsync(String resourceGroupName, String name, String slot); - - /** - * Gets the configuration of an app, such as platform version and bitness, default documents, virtual applications, - * Always On, etc. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will return configuration for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the configuration of an app, such as platform version and bitness, default documents, virtual - * applications, Always On, etc. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SiteConfigResourceInner getConfigurationSlot(String resourceGroupName, String name, String slot); - - /** - * Gets the configuration of an app, such as platform version and bitness, default documents, virtual applications, - * Always On, etc. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will return configuration for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the configuration of an app, such as platform version and bitness, default documents, virtual - * applications, Always On, etc. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getConfigurationSlotWithResponse( - String resourceGroupName, String name, String slot, Context context); - - /** - * Updates the configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update configuration for the - * production slot. - * @param siteConfig JSON representation of a SiteConfig object. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return web app configuration ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createOrUpdateConfigurationSlotWithResponseAsync( - String resourceGroupName, String name, String slot, SiteConfigResourceInner siteConfig); - - /** - * Updates the configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update configuration for the - * production slot. - * @param siteConfig JSON representation of a SiteConfig object. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return web app configuration ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateConfigurationSlotAsync( - String resourceGroupName, String name, String slot, SiteConfigResourceInner siteConfig); - - /** - * Updates the configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update configuration for the - * production slot. - * @param siteConfig JSON representation of a SiteConfig object. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return web app configuration ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SiteConfigResourceInner createOrUpdateConfigurationSlot( - String resourceGroupName, String name, String slot, SiteConfigResourceInner siteConfig); - - /** - * Updates the configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update configuration for the - * production slot. - * @param siteConfig JSON representation of a SiteConfig object. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return web app configuration ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateConfigurationSlotWithResponse( - String resourceGroupName, String name, String slot, SiteConfigResourceInner siteConfig, Context context); - - /** - * Updates the configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update configuration for the - * production slot. - * @param siteConfig JSON representation of a SiteConfig object. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return web app configuration ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateConfigurationSlotWithResponseAsync( - String resourceGroupName, String name, String slot, SiteConfigResourceInner siteConfig); - - /** - * Updates the configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update configuration for the - * production slot. - * @param siteConfig JSON representation of a SiteConfig object. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return web app configuration ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateConfigurationSlotAsync( - String resourceGroupName, String name, String slot, SiteConfigResourceInner siteConfig); - - /** - * Updates the configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update configuration for the - * production slot. - * @param siteConfig JSON representation of a SiteConfig object. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return web app configuration ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SiteConfigResourceInner updateConfigurationSlot( - String resourceGroupName, String name, String slot, SiteConfigResourceInner siteConfig); - - /** - * Updates the configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update configuration for the - * production slot. - * @param siteConfig JSON representation of a SiteConfig object. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return web app configuration ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateConfigurationSlotWithResponse( - String resourceGroupName, String name, String slot, SiteConfigResourceInner siteConfig, Context context); - - /** - * Gets a list of web app configuration snapshots identifiers. Each element of the list contains a timestamp and the - * ID of the snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will return configuration for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of web app configuration snapshots identifiers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listConfigurationSnapshotInfoSlotAsync( - String resourceGroupName, String name, String slot); - - /** - * Gets a list of web app configuration snapshots identifiers. Each element of the list contains a timestamp and the - * ID of the snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will return configuration for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of web app configuration snapshots identifiers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listConfigurationSnapshotInfoSlot( - String resourceGroupName, String name, String slot); - - /** - * Gets a list of web app configuration snapshots identifiers. Each element of the list contains a timestamp and the - * ID of the snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will return configuration for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of web app configuration snapshots identifiers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listConfigurationSnapshotInfoSlot( - String resourceGroupName, String name, String slot, Context context); - - /** - * Gets a snapshot of the configuration of an app at a previous point in time. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param snapshotId The ID of the snapshot to read. - * @param slot Name of the deployment slot. If a slot is not specified, the API will return configuration for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a snapshot of the configuration of an app at a previous point in time. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getConfigurationSnapshotSlotWithResponseAsync( - String resourceGroupName, String name, String snapshotId, String slot); - - /** - * Gets a snapshot of the configuration of an app at a previous point in time. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param snapshotId The ID of the snapshot to read. - * @param slot Name of the deployment slot. If a slot is not specified, the API will return configuration for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a snapshot of the configuration of an app at a previous point in time. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getConfigurationSnapshotSlotAsync( - String resourceGroupName, String name, String snapshotId, String slot); - - /** - * Gets a snapshot of the configuration of an app at a previous point in time. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param snapshotId The ID of the snapshot to read. - * @param slot Name of the deployment slot. If a slot is not specified, the API will return configuration for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a snapshot of the configuration of an app at a previous point in time. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SiteConfigResourceInner getConfigurationSnapshotSlot( - String resourceGroupName, String name, String snapshotId, String slot); - - /** - * Gets a snapshot of the configuration of an app at a previous point in time. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param snapshotId The ID of the snapshot to read. - * @param slot Name of the deployment slot. If a slot is not specified, the API will return configuration for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a snapshot of the configuration of an app at a previous point in time. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getConfigurationSnapshotSlotWithResponse( - String resourceGroupName, String name, String snapshotId, String slot, Context context); - - /** - * Reverts the configuration of an app to a previous snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param snapshotId The ID of the snapshot to read. - * @param slot Name of the deployment slot. If a slot is not specified, the API will return configuration for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> recoverSiteConfigurationSnapshotSlotWithResponseAsync( - String resourceGroupName, String name, String snapshotId, String slot); - - /** - * Reverts the configuration of an app to a previous snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param snapshotId The ID of the snapshot to read. - * @param slot Name of the deployment slot. If a slot is not specified, the API will return configuration for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono recoverSiteConfigurationSnapshotSlotAsync( - String resourceGroupName, String name, String snapshotId, String slot); - - /** - * Reverts the configuration of an app to a previous snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param snapshotId The ID of the snapshot to read. - * @param slot Name of the deployment slot. If a slot is not specified, the API will return configuration for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void recoverSiteConfigurationSnapshotSlot(String resourceGroupName, String name, String snapshotId, String slot); - - /** - * Reverts the configuration of an app to a previous snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param snapshotId The ID of the snapshot to read. - * @param slot Name of the deployment slot. If a slot is not specified, the API will return configuration for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response recoverSiteConfigurationSnapshotSlotWithResponse( - String resourceGroupName, String name, String snapshotId, String slot, Context context); - - /** - * Gets the last lines of docker logs for the given site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the last lines of docker logs for the given site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getWebSiteContainerLogsSlotWithResponseAsync( - String resourceGroupName, String name, String slot); - - /** - * Gets the last lines of docker logs for the given site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the last lines of docker logs for the given site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Flux getWebSiteContainerLogsSlotAsync(String resourceGroupName, String name, String slot); - - /** - * Gets the last lines of docker logs for the given site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the last lines of docker logs for the given site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - InputStream getWebSiteContainerLogsSlot(String resourceGroupName, String name, String slot); - - /** - * Gets the last lines of docker logs for the given site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the last lines of docker logs for the given site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - StreamResponse getWebSiteContainerLogsSlotWithResponse( - String resourceGroupName, String name, String slot, Context context); - - /** - * Gets the ZIP archived docker log files for the given site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ZIP archived docker log files for the given site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getContainerLogsZipSlotWithResponseAsync(String resourceGroupName, String name, String slot); - - /** - * Gets the ZIP archived docker log files for the given site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ZIP archived docker log files for the given site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Flux getContainerLogsZipSlotAsync(String resourceGroupName, String name, String slot); - - /** - * Gets the ZIP archived docker log files for the given site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ZIP archived docker log files for the given site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - InputStream getContainerLogsZipSlot(String resourceGroupName, String name, String slot); - - /** - * Gets the ZIP archived docker log files for the given site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ZIP archived docker log files for the given site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - StreamResponse getContainerLogsZipSlotWithResponse( - String resourceGroupName, String name, String slot, Context context); - - /** - * List continuous web jobs for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu continuous web job information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listContinuousWebJobsSlotAsync(String resourceGroupName, String name, String slot); - - /** - * List continuous web jobs for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu continuous web job information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listContinuousWebJobsSlot(String resourceGroupName, String name, String slot); - - /** - * List continuous web jobs for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu continuous web job information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listContinuousWebJobsSlot( - String resourceGroupName, String name, String slot, Context context); - - /** - * Gets a continuous web job by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a continuous web job by its ID for an app, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getContinuousWebJobSlotWithResponseAsync( - String resourceGroupName, String name, String webJobName, String slot); - - /** - * Gets a continuous web job by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a continuous web job by its ID for an app, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getContinuousWebJobSlotAsync( - String resourceGroupName, String name, String webJobName, String slot); - - /** - * Gets a continuous web job by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a continuous web job by its ID for an app, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ContinuousWebJobInner getContinuousWebJobSlot( - String resourceGroupName, String name, String webJobName, String slot); - - /** - * Gets a continuous web job by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a continuous web job by its ID for an app, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getContinuousWebJobSlotWithResponse( - String resourceGroupName, String name, String webJobName, String slot, Context context); - - /** - * Delete a continuous web job by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteContinuousWebJobSlotWithResponseAsync( - String resourceGroupName, String name, String webJobName, String slot); - - /** - * Delete a continuous web job by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteContinuousWebJobSlotAsync(String resourceGroupName, String name, String webJobName, String slot); - - /** - * Delete a continuous web job by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deleteContinuousWebJobSlot(String resourceGroupName, String name, String webJobName, String slot); - - /** - * Delete a continuous web job by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteContinuousWebJobSlotWithResponse( - String resourceGroupName, String name, String webJobName, String slot, Context context); - - /** - * Start a continuous web job for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> startContinuousWebJobSlotWithResponseAsync( - String resourceGroupName, String name, String webJobName, String slot); - - /** - * Start a continuous web job for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono startContinuousWebJobSlotAsync(String resourceGroupName, String name, String webJobName, String slot); - - /** - * Start a continuous web job for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void startContinuousWebJobSlot(String resourceGroupName, String name, String webJobName, String slot); - - /** - * Start a continuous web job for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response startContinuousWebJobSlotWithResponse( - String resourceGroupName, String name, String webJobName, String slot, Context context); - - /** - * Stop a continuous web job for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> stopContinuousWebJobSlotWithResponseAsync( - String resourceGroupName, String name, String webJobName, String slot); - - /** - * Stop a continuous web job for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono stopContinuousWebJobSlotAsync(String resourceGroupName, String name, String webJobName, String slot); - - /** - * Stop a continuous web job for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void stopContinuousWebJobSlot(String resourceGroupName, String name, String webJobName, String slot); - - /** - * Stop a continuous web job for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response stopContinuousWebJobSlotWithResponse( - String resourceGroupName, String name, String webJobName, String slot, Context context); - - /** - * List deployments for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of app deployments. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listDeploymentsSlotAsync(String resourceGroupName, String name, String slot); - - /** - * List deployments for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of app deployments. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listDeploymentsSlot(String resourceGroupName, String name, String slot); - - /** - * List deployments for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of app deployments. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listDeploymentsSlot( - String resourceGroupName, String name, String slot, Context context); - - /** - * Get a deployment by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param id Deployment ID. - * @param slot Name of the deployment slot. If a slot is not specified, the API gets a deployment for the production - * slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment by its ID for an app, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getDeploymentSlotWithResponseAsync( - String resourceGroupName, String name, String id, String slot); - - /** - * Get a deployment by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param id Deployment ID. - * @param slot Name of the deployment slot. If a slot is not specified, the API gets a deployment for the production - * slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment by its ID for an app, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getDeploymentSlotAsync(String resourceGroupName, String name, String id, String slot); - - /** - * Get a deployment by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param id Deployment ID. - * @param slot Name of the deployment slot. If a slot is not specified, the API gets a deployment for the production - * slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment by its ID for an app, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DeploymentInner getDeploymentSlot(String resourceGroupName, String name, String id, String slot); - - /** - * Get a deployment by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param id Deployment ID. - * @param slot Name of the deployment slot. If a slot is not specified, the API gets a deployment for the production - * slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment by its ID for an app, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getDeploymentSlotWithResponse( - String resourceGroupName, String name, String id, String slot, Context context); - - /** - * Create a deployment for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param id ID of an existing deployment. - * @param slot Name of the deployment slot. If a slot is not specified, the API creates a deployment for the - * production slot. - * @param deployment Deployment details. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user credentials used for publishing activity. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createDeploymentSlotWithResponseAsync( - String resourceGroupName, String name, String id, String slot, DeploymentInner deployment); - - /** - * Create a deployment for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param id ID of an existing deployment. - * @param slot Name of the deployment slot. If a slot is not specified, the API creates a deployment for the - * production slot. - * @param deployment Deployment details. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user credentials used for publishing activity. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createDeploymentSlotAsync( - String resourceGroupName, String name, String id, String slot, DeploymentInner deployment); - - /** - * Create a deployment for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param id ID of an existing deployment. - * @param slot Name of the deployment slot. If a slot is not specified, the API creates a deployment for the - * production slot. - * @param deployment Deployment details. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user credentials used for publishing activity. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DeploymentInner createDeploymentSlot( - String resourceGroupName, String name, String id, String slot, DeploymentInner deployment); - - /** - * Create a deployment for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param id ID of an existing deployment. - * @param slot Name of the deployment slot. If a slot is not specified, the API creates a deployment for the - * production slot. - * @param deployment Deployment details. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user credentials used for publishing activity. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createDeploymentSlotWithResponse( - String resourceGroupName, String name, String id, String slot, DeploymentInner deployment, Context context); - - /** - * Delete a deployment by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param id Deployment ID. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteDeploymentSlotWithResponseAsync( - String resourceGroupName, String name, String id, String slot); - - /** - * Delete a deployment by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param id Deployment ID. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteDeploymentSlotAsync(String resourceGroupName, String name, String id, String slot); - - /** - * Delete a deployment by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param id Deployment ID. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deleteDeploymentSlot(String resourceGroupName, String name, String id, String slot); - - /** - * Delete a deployment by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param id Deployment ID. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteDeploymentSlotWithResponse( - String resourceGroupName, String name, String id, String slot, Context context); - - /** - * List deployment log for specific deployment for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param id The ID of a specific deployment. This is the value of the name property in the JSON response from "GET - * /api/sites/{siteName}/deployments". - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user credentials used for publishing activity. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listDeploymentLogSlotWithResponseAsync( - String resourceGroupName, String name, String id, String slot); - - /** - * List deployment log for specific deployment for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param id The ID of a specific deployment. This is the value of the name property in the JSON response from "GET - * /api/sites/{siteName}/deployments". - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user credentials used for publishing activity. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listDeploymentLogSlotAsync(String resourceGroupName, String name, String id, String slot); - - /** - * List deployment log for specific deployment for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param id The ID of a specific deployment. This is the value of the name property in the JSON response from "GET - * /api/sites/{siteName}/deployments". - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user credentials used for publishing activity. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DeploymentInner listDeploymentLogSlot(String resourceGroupName, String name, String id, String slot); - - /** - * List deployment log for specific deployment for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param id The ID of a specific deployment. This is the value of the name property in the JSON response from "GET - * /api/sites/{siteName}/deployments". - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user credentials used for publishing activity. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listDeploymentLogSlotWithResponse( - String resourceGroupName, String name, String id, String slot, Context context); - - /** - * Discovers an existing app backup that can be restored from a blob in Azure storage. Use this to get information - * about the databases stored in a backup. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will perform discovery for the - * production slot. - * @param request A RestoreRequest object that includes Azure storage URL and blog name for discovery of backup. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a restore request. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> discoverBackupSlotWithResponseAsync( - String resourceGroupName, String name, String slot, RestoreRequestInner request); - - /** - * Discovers an existing app backup that can be restored from a blob in Azure storage. Use this to get information - * about the databases stored in a backup. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will perform discovery for the - * production slot. - * @param request A RestoreRequest object that includes Azure storage URL and blog name for discovery of backup. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a restore request. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono discoverBackupSlotAsync( - String resourceGroupName, String name, String slot, RestoreRequestInner request); - - /** - * Discovers an existing app backup that can be restored from a blob in Azure storage. Use this to get information - * about the databases stored in a backup. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will perform discovery for the - * production slot. - * @param request A RestoreRequest object that includes Azure storage URL and blog name for discovery of backup. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a restore request. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RestoreRequestInner discoverBackupSlot( - String resourceGroupName, String name, String slot, RestoreRequestInner request); - - /** - * Discovers an existing app backup that can be restored from a blob in Azure storage. Use this to get information - * about the databases stored in a backup. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will perform discovery for the - * production slot. - * @param request A RestoreRequest object that includes Azure storage URL and blog name for discovery of backup. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a restore request. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response discoverBackupSlotWithResponse( - String resourceGroupName, String name, String slot, RestoreRequestInner request, Context context); - - /** - * Lists ownership identifiers for domain associated with web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the binding for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of identifiers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listDomainOwnershipIdentifiersSlotAsync( - String resourceGroupName, String name, String slot); - - /** - * Lists ownership identifiers for domain associated with web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the binding for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of identifiers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listDomainOwnershipIdentifiersSlot( - String resourceGroupName, String name, String slot); - - /** - * Lists ownership identifiers for domain associated with web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the binding for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of identifiers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listDomainOwnershipIdentifiersSlot( - String resourceGroupName, String name, String slot, Context context); - - /** - * Get domain ownership identifier for web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param domainOwnershipIdentifierName Name of domain ownership identifier. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the binding for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return domain ownership identifier for web app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getDomainOwnershipIdentifierSlotWithResponseAsync( - String resourceGroupName, String name, String domainOwnershipIdentifierName, String slot); - - /** - * Get domain ownership identifier for web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param domainOwnershipIdentifierName Name of domain ownership identifier. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the binding for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return domain ownership identifier for web app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getDomainOwnershipIdentifierSlotAsync( - String resourceGroupName, String name, String domainOwnershipIdentifierName, String slot); - - /** - * Get domain ownership identifier for web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param domainOwnershipIdentifierName Name of domain ownership identifier. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the binding for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return domain ownership identifier for web app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - IdentifierInner getDomainOwnershipIdentifierSlot( - String resourceGroupName, String name, String domainOwnershipIdentifierName, String slot); - - /** - * Get domain ownership identifier for web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param domainOwnershipIdentifierName Name of domain ownership identifier. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the binding for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return domain ownership identifier for web app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getDomainOwnershipIdentifierSlotWithResponse( - String resourceGroupName, String name, String domainOwnershipIdentifierName, String slot, Context context); - - /** - * Creates a domain ownership identifier for web app, or updates an existing ownership identifier. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param domainOwnershipIdentifierName Name of domain ownership identifier. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the binding for the - * production slot. - * @param domainOwnershipIdentifier A JSON representation of the domain ownership properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a domain specific resource identifier. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createOrUpdateDomainOwnershipIdentifierSlotWithResponseAsync( - String resourceGroupName, - String name, - String domainOwnershipIdentifierName, - String slot, - IdentifierInner domainOwnershipIdentifier); - - /** - * Creates a domain ownership identifier for web app, or updates an existing ownership identifier. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param domainOwnershipIdentifierName Name of domain ownership identifier. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the binding for the - * production slot. - * @param domainOwnershipIdentifier A JSON representation of the domain ownership properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a domain specific resource identifier. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateDomainOwnershipIdentifierSlotAsync( - String resourceGroupName, - String name, - String domainOwnershipIdentifierName, - String slot, - IdentifierInner domainOwnershipIdentifier); - - /** - * Creates a domain ownership identifier for web app, or updates an existing ownership identifier. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param domainOwnershipIdentifierName Name of domain ownership identifier. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the binding for the - * production slot. - * @param domainOwnershipIdentifier A JSON representation of the domain ownership properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a domain specific resource identifier. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - IdentifierInner createOrUpdateDomainOwnershipIdentifierSlot( - String resourceGroupName, - String name, - String domainOwnershipIdentifierName, - String slot, - IdentifierInner domainOwnershipIdentifier); - - /** - * Creates a domain ownership identifier for web app, or updates an existing ownership identifier. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param domainOwnershipIdentifierName Name of domain ownership identifier. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the binding for the - * production slot. - * @param domainOwnershipIdentifier A JSON representation of the domain ownership properties. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a domain specific resource identifier. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateDomainOwnershipIdentifierSlotWithResponse( - String resourceGroupName, - String name, - String domainOwnershipIdentifierName, - String slot, - IdentifierInner domainOwnershipIdentifier, - Context context); - - /** - * Deletes a domain ownership identifier for a web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param domainOwnershipIdentifierName Name of domain ownership identifier. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the binding for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteDomainOwnershipIdentifierSlotWithResponseAsync( - String resourceGroupName, String name, String domainOwnershipIdentifierName, String slot); - - /** - * Deletes a domain ownership identifier for a web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param domainOwnershipIdentifierName Name of domain ownership identifier. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the binding for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteDomainOwnershipIdentifierSlotAsync( - String resourceGroupName, String name, String domainOwnershipIdentifierName, String slot); - - /** - * Deletes a domain ownership identifier for a web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param domainOwnershipIdentifierName Name of domain ownership identifier. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the binding for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deleteDomainOwnershipIdentifierSlot( - String resourceGroupName, String name, String domainOwnershipIdentifierName, String slot); - - /** - * Deletes a domain ownership identifier for a web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param domainOwnershipIdentifierName Name of domain ownership identifier. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the binding for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteDomainOwnershipIdentifierSlotWithResponse( - String resourceGroupName, String name, String domainOwnershipIdentifierName, String slot, Context context); - - /** - * Creates a domain ownership identifier for web app, or updates an existing ownership identifier. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param domainOwnershipIdentifierName Name of domain ownership identifier. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the binding for the - * production slot. - * @param domainOwnershipIdentifier A JSON representation of the domain ownership properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a domain specific resource identifier. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateDomainOwnershipIdentifierSlotWithResponseAsync( - String resourceGroupName, - String name, - String domainOwnershipIdentifierName, - String slot, - IdentifierInner domainOwnershipIdentifier); - - /** - * Creates a domain ownership identifier for web app, or updates an existing ownership identifier. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param domainOwnershipIdentifierName Name of domain ownership identifier. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the binding for the - * production slot. - * @param domainOwnershipIdentifier A JSON representation of the domain ownership properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a domain specific resource identifier. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateDomainOwnershipIdentifierSlotAsync( - String resourceGroupName, - String name, - String domainOwnershipIdentifierName, - String slot, - IdentifierInner domainOwnershipIdentifier); - - /** - * Creates a domain ownership identifier for web app, or updates an existing ownership identifier. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param domainOwnershipIdentifierName Name of domain ownership identifier. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the binding for the - * production slot. - * @param domainOwnershipIdentifier A JSON representation of the domain ownership properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a domain specific resource identifier. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - IdentifierInner updateDomainOwnershipIdentifierSlot( - String resourceGroupName, - String name, - String domainOwnershipIdentifierName, - String slot, - IdentifierInner domainOwnershipIdentifier); - - /** - * Creates a domain ownership identifier for web app, or updates an existing ownership identifier. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param domainOwnershipIdentifierName Name of domain ownership identifier. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the binding for the - * production slot. - * @param domainOwnershipIdentifier A JSON representation of the domain ownership properties. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a domain specific resource identifier. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateDomainOwnershipIdentifierSlotWithResponse( - String resourceGroupName, - String name, - String domainOwnershipIdentifierName, - String slot, - IdentifierInner domainOwnershipIdentifier, - Context context); - - /** - * Get the status of the last MSDeploy operation. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of the last MSDeploy operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getMSDeployStatusSlotWithResponseAsync( - String resourceGroupName, String name, String slot); - - /** - * Get the status of the last MSDeploy operation. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of the last MSDeploy operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getMSDeployStatusSlotAsync(String resourceGroupName, String name, String slot); - - /** - * Get the status of the last MSDeploy operation. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of the last MSDeploy operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - MSDeployStatusInner getMSDeployStatusSlot(String resourceGroupName, String name, String slot); - - /** - * Get the status of the last MSDeploy operation. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of the last MSDeploy operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getMSDeployStatusSlotWithResponse( - String resourceGroupName, String name, String slot, Context context); - - /** - * Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param mSDeploy Details of MSDeploy operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createMSDeployOperationSlotWithResponseAsync( - String resourceGroupName, String name, String slot, MSDeploy mSDeploy); - - /** - * Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param mSDeploy Details of MSDeploy operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, MSDeployStatusInner> beginCreateMSDeployOperationSlotAsync( - String resourceGroupName, String name, String slot, MSDeploy mSDeploy); - - /** - * Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param mSDeploy Details of MSDeploy operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, MSDeployStatusInner> beginCreateMSDeployOperationSlot( - String resourceGroupName, String name, String slot, MSDeploy mSDeploy); - - /** - * Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param mSDeploy Details of MSDeploy operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, MSDeployStatusInner> beginCreateMSDeployOperationSlot( - String resourceGroupName, String name, String slot, MSDeploy mSDeploy, Context context); - - /** - * Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param mSDeploy Details of MSDeploy operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createMSDeployOperationSlotAsync( - String resourceGroupName, String name, String slot, MSDeploy mSDeploy); - - /** - * Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param mSDeploy Details of MSDeploy operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - MSDeployStatusInner createMSDeployOperationSlot( - String resourceGroupName, String name, String slot, MSDeploy mSDeploy); - - /** - * Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param mSDeploy Details of MSDeploy operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - MSDeployStatusInner createMSDeployOperationSlot( - String resourceGroupName, String name, String slot, MSDeploy mSDeploy, Context context); - - /** - * Get the MSDeploy Log for the last MSDeploy operation. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the MSDeploy Log for the last MSDeploy operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getMSDeployLogSlotWithResponseAsync( - String resourceGroupName, String name, String slot); - - /** - * Get the MSDeploy Log for the last MSDeploy operation. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the MSDeploy Log for the last MSDeploy operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getMSDeployLogSlotAsync(String resourceGroupName, String name, String slot); - - /** - * Get the MSDeploy Log for the last MSDeploy operation. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the MSDeploy Log for the last MSDeploy operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - MSDeployLogInner getMSDeployLogSlot(String resourceGroupName, String name, String slot); - - /** - * Get the MSDeploy Log for the last MSDeploy operation. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the MSDeploy Log for the last MSDeploy operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getMSDeployLogSlotWithResponse( - String resourceGroupName, String name, String slot, Context context); - - /** - * List the functions for a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param slot Name of the deployment slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu function information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listInstanceFunctionsSlotAsync(String resourceGroupName, String name, String slot); - - /** - * List the functions for a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param slot Name of the deployment slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu function information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listInstanceFunctionsSlot(String resourceGroupName, String name, String slot); - - /** - * List the functions for a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param slot Name of the deployment slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu function information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listInstanceFunctionsSlot( - String resourceGroupName, String name, String slot, Context context); - - /** - * Fetch a short lived token that can be exchanged for a master key. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getFunctionsAdminTokenSlotWithResponseAsync( - String resourceGroupName, String name, String slot); - - /** - * Fetch a short lived token that can be exchanged for a master key. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getFunctionsAdminTokenSlotAsync(String resourceGroupName, String name, String slot); - - /** - * Fetch a short lived token that can be exchanged for a master key. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - String getFunctionsAdminTokenSlot(String resourceGroupName, String name, String slot); - - /** - * Fetch a short lived token that can be exchanged for a master key. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getFunctionsAdminTokenSlotWithResponse( - String resourceGroupName, String name, String slot, Context context); - - /** - * Get function information by its ID for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param slot Name of the deployment slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function information by its ID for web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getInstanceFunctionSlotWithResponseAsync( - String resourceGroupName, String name, String functionName, String slot); - - /** - * Get function information by its ID for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param slot Name of the deployment slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function information by its ID for web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getInstanceFunctionSlotAsync( - String resourceGroupName, String name, String functionName, String slot); - - /** - * Get function information by its ID for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param slot Name of the deployment slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function information by its ID for web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - FunctionEnvelopeInner getInstanceFunctionSlot( - String resourceGroupName, String name, String functionName, String slot); - - /** - * Get function information by its ID for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param slot Name of the deployment slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function information by its ID for web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getInstanceFunctionSlotWithResponse( - String resourceGroupName, String name, String functionName, String slot, Context context); - - /** - * Create function for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param slot Name of the deployment slot. - * @param functionEnvelope Function details. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createInstanceFunctionSlotWithResponseAsync( - String resourceGroupName, - String name, - String functionName, - String slot, - FunctionEnvelopeInner functionEnvelope); - - /** - * Create function for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param slot Name of the deployment slot. - * @param functionEnvelope Function details. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, FunctionEnvelopeInner> beginCreateInstanceFunctionSlotAsync( - String resourceGroupName, - String name, - String functionName, - String slot, - FunctionEnvelopeInner functionEnvelope); - - /** - * Create function for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param slot Name of the deployment slot. - * @param functionEnvelope Function details. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, FunctionEnvelopeInner> beginCreateInstanceFunctionSlot( - String resourceGroupName, - String name, - String functionName, - String slot, - FunctionEnvelopeInner functionEnvelope); - - /** - * Create function for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param slot Name of the deployment slot. - * @param functionEnvelope Function details. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, FunctionEnvelopeInner> beginCreateInstanceFunctionSlot( - String resourceGroupName, - String name, - String functionName, - String slot, - FunctionEnvelopeInner functionEnvelope, - Context context); - - /** - * Create function for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param slot Name of the deployment slot. - * @param functionEnvelope Function details. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createInstanceFunctionSlotAsync( - String resourceGroupName, - String name, - String functionName, - String slot, - FunctionEnvelopeInner functionEnvelope); - - /** - * Create function for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param slot Name of the deployment slot. - * @param functionEnvelope Function details. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - FunctionEnvelopeInner createInstanceFunctionSlot( - String resourceGroupName, - String name, - String functionName, - String slot, - FunctionEnvelopeInner functionEnvelope); - - /** - * Create function for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param slot Name of the deployment slot. - * @param functionEnvelope Function details. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - FunctionEnvelopeInner createInstanceFunctionSlot( - String resourceGroupName, - String name, - String functionName, - String slot, - FunctionEnvelopeInner functionEnvelope, - Context context); - - /** - * Delete a function for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param slot Name of the deployment slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteInstanceFunctionSlotWithResponseAsync( - String resourceGroupName, String name, String functionName, String slot); - - /** - * Delete a function for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param slot Name of the deployment slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteInstanceFunctionSlotAsync(String resourceGroupName, String name, String functionName, String slot); - - /** - * Delete a function for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param slot Name of the deployment slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deleteInstanceFunctionSlot(String resourceGroupName, String name, String functionName, String slot); - - /** - * Delete a function for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param slot Name of the deployment slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteInstanceFunctionSlotWithResponse( - String resourceGroupName, String name, String functionName, String slot, Context context); - - /** - * Add or update a function secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName The name of the function. - * @param keyName The name of the key. - * @param slot Name of the deployment slot. - * @param key The key to create or update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function key info. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createOrUpdateFunctionSecretSlotWithResponseAsync( - String resourceGroupName, String name, String functionName, String keyName, String slot, KeyInfoInner key); - - /** - * Add or update a function secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName The name of the function. - * @param keyName The name of the key. - * @param slot Name of the deployment slot. - * @param key The key to create or update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function key info. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateFunctionSecretSlotAsync( - String resourceGroupName, String name, String functionName, String keyName, String slot, KeyInfoInner key); - - /** - * Add or update a function secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName The name of the function. - * @param keyName The name of the key. - * @param slot Name of the deployment slot. - * @param key The key to create or update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function key info. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - KeyInfoInner createOrUpdateFunctionSecretSlot( - String resourceGroupName, String name, String functionName, String keyName, String slot, KeyInfoInner key); - - /** - * Add or update a function secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName The name of the function. - * @param keyName The name of the key. - * @param slot Name of the deployment slot. - * @param key The key to create or update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function key info. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateFunctionSecretSlotWithResponse( - String resourceGroupName, - String name, - String functionName, - String keyName, - String slot, - KeyInfoInner key, - Context context); - - /** - * Delete a function secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName The name of the function. - * @param keyName The name of the key. - * @param slot Name of the deployment slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteFunctionSecretSlotWithResponseAsync( - String resourceGroupName, String name, String functionName, String keyName, String slot); - - /** - * Delete a function secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName The name of the function. - * @param keyName The name of the key. - * @param slot Name of the deployment slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteFunctionSecretSlotAsync( - String resourceGroupName, String name, String functionName, String keyName, String slot); - - /** - * Delete a function secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName The name of the function. - * @param keyName The name of the key. - * @param slot Name of the deployment slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deleteFunctionSecretSlot( - String resourceGroupName, String name, String functionName, String keyName, String slot); - - /** - * Delete a function secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName The name of the function. - * @param keyName The name of the key. - * @param slot Name of the deployment slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteFunctionSecretSlotWithResponse( - String resourceGroupName, String name, String functionName, String keyName, String slot, Context context); - - /** - * Get function keys for a function in a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param slot Name of the deployment slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function keys for a function in a web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listFunctionKeysSlotWithResponseAsync( - String resourceGroupName, String name, String functionName, String slot); - - /** - * Get function keys for a function in a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param slot Name of the deployment slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function keys for a function in a web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listFunctionKeysSlotAsync( - String resourceGroupName, String name, String functionName, String slot); - - /** - * Get function keys for a function in a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param slot Name of the deployment slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function keys for a function in a web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - StringDictionaryInner listFunctionKeysSlot(String resourceGroupName, String name, String functionName, String slot); - - /** - * Get function keys for a function in a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param slot Name of the deployment slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function keys for a function in a web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listFunctionKeysSlotWithResponse( - String resourceGroupName, String name, String functionName, String slot, Context context); - - /** - * Get function secrets for a function in a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param slot Name of the deployment slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function secrets for a function in a web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listFunctionSecretsSlotWithResponseAsync( - String resourceGroupName, String name, String functionName, String slot); - - /** - * Get function secrets for a function in a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param slot Name of the deployment slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function secrets for a function in a web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listFunctionSecretsSlotAsync( - String resourceGroupName, String name, String functionName, String slot); - - /** - * Get function secrets for a function in a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param slot Name of the deployment slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function secrets for a function in a web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - FunctionSecretsInner listFunctionSecretsSlot( - String resourceGroupName, String name, String functionName, String slot); - - /** - * Get function secrets for a function in a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param slot Name of the deployment slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function secrets for a function in a web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listFunctionSecretsSlotWithResponse( - String resourceGroupName, String name, String functionName, String slot, Context context); - - /** - * Get host secrets for a function app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param slot Name of the deployment slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return host secrets for a function app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listHostKeysSlotWithResponseAsync(String resourceGroupName, String name, String slot); - - /** - * Get host secrets for a function app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param slot Name of the deployment slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return host secrets for a function app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listHostKeysSlotAsync(String resourceGroupName, String name, String slot); - - /** - * Get host secrets for a function app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param slot Name of the deployment slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return host secrets for a function app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - HostKeysInner listHostKeysSlot(String resourceGroupName, String name, String slot); - - /** - * Get host secrets for a function app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param slot Name of the deployment slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return host secrets for a function app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listHostKeysSlotWithResponse( - String resourceGroupName, String name, String slot, Context context); - - /** - * This is to allow calling via powershell and ARM template. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listSyncStatusSlotWithResponseAsync(String resourceGroupName, String name, String slot); - - /** - * This is to allow calling via powershell and ARM template. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listSyncStatusSlotAsync(String resourceGroupName, String name, String slot); - - /** - * This is to allow calling via powershell and ARM template. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void listSyncStatusSlot(String resourceGroupName, String name, String slot); - - /** - * This is to allow calling via powershell and ARM template. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listSyncStatusSlotWithResponse(String resourceGroupName, String name, String slot, Context context); - - /** - * Syncs function trigger metadata to the management database. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> syncFunctionsSlotWithResponseAsync(String resourceGroupName, String name, String slot); - - /** - * Syncs function trigger metadata to the management database. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono syncFunctionsSlotAsync(String resourceGroupName, String name, String slot); - - /** - * Syncs function trigger metadata to the management database. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void syncFunctionsSlot(String resourceGroupName, String name, String slot); - - /** - * Syncs function trigger metadata to the management database. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response syncFunctionsSlotWithResponse(String resourceGroupName, String name, String slot, Context context); - - /** - * Add or update a host level secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param keyType The type of host key. - * @param keyName The name of the key. - * @param slot Name of the deployment slot. - * @param key The key to create or update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function key info. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createOrUpdateHostSecretSlotWithResponseAsync( - String resourceGroupName, String name, String keyType, String keyName, String slot, KeyInfoInner key); - - /** - * Add or update a host level secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param keyType The type of host key. - * @param keyName The name of the key. - * @param slot Name of the deployment slot. - * @param key The key to create or update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function key info. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateHostSecretSlotAsync( - String resourceGroupName, String name, String keyType, String keyName, String slot, KeyInfoInner key); - - /** - * Add or update a host level secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param keyType The type of host key. - * @param keyName The name of the key. - * @param slot Name of the deployment slot. - * @param key The key to create or update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function key info. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - KeyInfoInner createOrUpdateHostSecretSlot( - String resourceGroupName, String name, String keyType, String keyName, String slot, KeyInfoInner key); - - /** - * Add or update a host level secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param keyType The type of host key. - * @param keyName The name of the key. - * @param slot Name of the deployment slot. - * @param key The key to create or update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function key info. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateHostSecretSlotWithResponse( - String resourceGroupName, - String name, - String keyType, - String keyName, - String slot, - KeyInfoInner key, - Context context); - - /** - * Delete a host level secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param keyType The type of host key. - * @param keyName The name of the key. - * @param slot Name of the deployment slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteHostSecretSlotWithResponseAsync( - String resourceGroupName, String name, String keyType, String keyName, String slot); - - /** - * Delete a host level secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param keyType The type of host key. - * @param keyName The name of the key. - * @param slot Name of the deployment slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteHostSecretSlotAsync( - String resourceGroupName, String name, String keyType, String keyName, String slot); - - /** - * Delete a host level secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param keyType The type of host key. - * @param keyName The name of the key. - * @param slot Name of the deployment slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deleteHostSecretSlot(String resourceGroupName, String name, String keyType, String keyName, String slot); - - /** - * Delete a host level secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param keyType The type of host key. - * @param keyName The name of the key. - * @param slot Name of the deployment slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteHostSecretSlotWithResponse( - String resourceGroupName, String name, String keyType, String keyName, String slot, Context context); - - /** - * Get hostname bindings for an app or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API gets hostname bindings for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hostname bindings for an app or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listHostnameBindingsSlotAsync(String resourceGroupName, String name, String slot); - - /** - * Get hostname bindings for an app or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API gets hostname bindings for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hostname bindings for an app or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listHostnameBindingsSlot(String resourceGroupName, String name, String slot); - - /** - * Get hostname bindings for an app or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API gets hostname bindings for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hostname bindings for an app or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listHostnameBindingsSlot( - String resourceGroupName, String name, String slot, Context context); - - /** - * Get the named hostname binding for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API the named binding for the production - * slot. - * @param hostname Hostname in the hostname binding. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the named hostname binding for an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getHostnameBindingSlotWithResponseAsync( - String resourceGroupName, String name, String slot, String hostname); - - /** - * Get the named hostname binding for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API the named binding for the production - * slot. - * @param hostname Hostname in the hostname binding. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the named hostname binding for an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getHostnameBindingSlotAsync( - String resourceGroupName, String name, String slot, String hostname); - - /** - * Get the named hostname binding for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API the named binding for the production - * slot. - * @param hostname Hostname in the hostname binding. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the named hostname binding for an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - HostnameBindingInner getHostnameBindingSlot(String resourceGroupName, String name, String slot, String hostname); - - /** - * Get the named hostname binding for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API the named binding for the production - * slot. - * @param hostname Hostname in the hostname binding. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the named hostname binding for an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getHostnameBindingSlotWithResponse( - String resourceGroupName, String name, String slot, String hostname, Context context); - - /** - * Creates a hostname binding for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param hostname Hostname in the hostname binding. - * @param slot Name of the deployment slot. If a slot is not specified, the API will create a binding for the - * production slot. - * @param hostnameBinding Binding details. This is the JSON representation of a HostNameBinding object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a hostname binding object. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createOrUpdateHostnameBindingSlotWithResponseAsync( - String resourceGroupName, String name, String hostname, String slot, HostnameBindingInner hostnameBinding); - - /** - * Creates a hostname binding for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param hostname Hostname in the hostname binding. - * @param slot Name of the deployment slot. If a slot is not specified, the API will create a binding for the - * production slot. - * @param hostnameBinding Binding details. This is the JSON representation of a HostNameBinding object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a hostname binding object. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateHostnameBindingSlotAsync( - String resourceGroupName, String name, String hostname, String slot, HostnameBindingInner hostnameBinding); - - /** - * Creates a hostname binding for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param hostname Hostname in the hostname binding. - * @param slot Name of the deployment slot. If a slot is not specified, the API will create a binding for the - * production slot. - * @param hostnameBinding Binding details. This is the JSON representation of a HostNameBinding object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a hostname binding object. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - HostnameBindingInner createOrUpdateHostnameBindingSlot( - String resourceGroupName, String name, String hostname, String slot, HostnameBindingInner hostnameBinding); - - /** - * Creates a hostname binding for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param hostname Hostname in the hostname binding. - * @param slot Name of the deployment slot. If a slot is not specified, the API will create a binding for the - * production slot. - * @param hostnameBinding Binding details. This is the JSON representation of a HostNameBinding object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a hostname binding object. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateHostnameBindingSlotWithResponse( - String resourceGroupName, - String name, - String hostname, - String slot, - HostnameBindingInner hostnameBinding, - Context context); - - /** - * Deletes a hostname binding for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the binding for the - * production slot. - * @param hostname Hostname in the hostname binding. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteHostnameBindingSlotWithResponseAsync( - String resourceGroupName, String name, String slot, String hostname); - - /** - * Deletes a hostname binding for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the binding for the - * production slot. - * @param hostname Hostname in the hostname binding. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteHostnameBindingSlotAsync(String resourceGroupName, String name, String slot, String hostname); - - /** - * Deletes a hostname binding for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the binding for the - * production slot. - * @param hostname Hostname in the hostname binding. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deleteHostnameBindingSlot(String resourceGroupName, String name, String slot, String hostname); - - /** - * Deletes a hostname binding for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the binding for the - * production slot. - * @param hostname Hostname in the hostname binding. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteHostnameBindingSlotWithResponse( - String resourceGroupName, String name, String slot, String hostname, Context context); - - /** - * Retrieves a specific Service Bus Hybrid Connection used by this Web App. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @param slot The name of the slot for the web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getHybridConnectionSlotWithResponseAsync( - String resourceGroupName, String name, String namespaceName, String relayName, String slot); - - /** - * Retrieves a specific Service Bus Hybrid Connection used by this Web App. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @param slot The name of the slot for the web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getHybridConnectionSlotAsync( - String resourceGroupName, String name, String namespaceName, String relayName, String slot); - - /** - * Retrieves a specific Service Bus Hybrid Connection used by this Web App. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @param slot The name of the slot for the web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - HybridConnectionInner getHybridConnectionSlot( - String resourceGroupName, String name, String namespaceName, String relayName, String slot); - - /** - * Retrieves a specific Service Bus Hybrid Connection used by this Web App. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @param slot The name of the slot for the web app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getHybridConnectionSlotWithResponse( - String resourceGroupName, String name, String namespaceName, String relayName, String slot, Context context); - - /** - * Creates a new Hybrid Connection using a Service Bus relay. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @param slot The name of the slot for the web app. - * @param connectionEnvelope The details of the hybrid connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createOrUpdateHybridConnectionSlotWithResponseAsync( - String resourceGroupName, - String name, - String namespaceName, - String relayName, - String slot, - HybridConnectionInner connectionEnvelope); - - /** - * Creates a new Hybrid Connection using a Service Bus relay. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @param slot The name of the slot for the web app. - * @param connectionEnvelope The details of the hybrid connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateHybridConnectionSlotAsync( - String resourceGroupName, - String name, - String namespaceName, - String relayName, - String slot, - HybridConnectionInner connectionEnvelope); - - /** - * Creates a new Hybrid Connection using a Service Bus relay. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @param slot The name of the slot for the web app. - * @param connectionEnvelope The details of the hybrid connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - HybridConnectionInner createOrUpdateHybridConnectionSlot( - String resourceGroupName, - String name, - String namespaceName, - String relayName, - String slot, - HybridConnectionInner connectionEnvelope); - - /** - * Creates a new Hybrid Connection using a Service Bus relay. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @param slot The name of the slot for the web app. - * @param connectionEnvelope The details of the hybrid connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateHybridConnectionSlotWithResponse( - String resourceGroupName, - String name, - String namespaceName, - String relayName, - String slot, - HybridConnectionInner connectionEnvelope, - Context context); - - /** - * Removes a Hybrid Connection from this site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @param slot The name of the slot for the web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteHybridConnectionSlotWithResponseAsync( - String resourceGroupName, String name, String namespaceName, String relayName, String slot); - - /** - * Removes a Hybrid Connection from this site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @param slot The name of the slot for the web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteHybridConnectionSlotAsync( - String resourceGroupName, String name, String namespaceName, String relayName, String slot); - - /** - * Removes a Hybrid Connection from this site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @param slot The name of the slot for the web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deleteHybridConnectionSlot( - String resourceGroupName, String name, String namespaceName, String relayName, String slot); - - /** - * Removes a Hybrid Connection from this site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @param slot The name of the slot for the web app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteHybridConnectionSlotWithResponse( - String resourceGroupName, String name, String namespaceName, String relayName, String slot, Context context); - - /** - * Creates a new Hybrid Connection using a Service Bus relay. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @param slot The name of the slot for the web app. - * @param connectionEnvelope The details of the hybrid connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateHybridConnectionSlotWithResponseAsync( - String resourceGroupName, - String name, - String namespaceName, - String relayName, - String slot, - HybridConnectionInner connectionEnvelope); - - /** - * Creates a new Hybrid Connection using a Service Bus relay. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @param slot The name of the slot for the web app. - * @param connectionEnvelope The details of the hybrid connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateHybridConnectionSlotAsync( - String resourceGroupName, - String name, - String namespaceName, - String relayName, - String slot, - HybridConnectionInner connectionEnvelope); - - /** - * Creates a new Hybrid Connection using a Service Bus relay. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @param slot The name of the slot for the web app. - * @param connectionEnvelope The details of the hybrid connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - HybridConnectionInner updateHybridConnectionSlot( - String resourceGroupName, - String name, - String namespaceName, - String relayName, - String slot, - HybridConnectionInner connectionEnvelope); - - /** - * Creates a new Hybrid Connection using a Service Bus relay. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @param slot The name of the slot for the web app. - * @param connectionEnvelope The details of the hybrid connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateHybridConnectionSlotWithResponse( - String resourceGroupName, - String name, - String namespaceName, - String relayName, - String slot, - HybridConnectionInner connectionEnvelope, - Context context); - - /** - * Gets the send key name and value for a Hybrid Connection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @param slot The name of the slot for the web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the send key name and value for a Hybrid Connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listHybridConnectionKeysSlotWithResponseAsync( - String resourceGroupName, String name, String namespaceName, String relayName, String slot); - - /** - * Gets the send key name and value for a Hybrid Connection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @param slot The name of the slot for the web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the send key name and value for a Hybrid Connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listHybridConnectionKeysSlotAsync( - String resourceGroupName, String name, String namespaceName, String relayName, String slot); - - /** - * Gets the send key name and value for a Hybrid Connection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @param slot The name of the slot for the web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the send key name and value for a Hybrid Connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - HybridConnectionKeyInner listHybridConnectionKeysSlot( - String resourceGroupName, String name, String namespaceName, String relayName, String slot); - - /** - * Gets the send key name and value for a Hybrid Connection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @param slot The name of the slot for the web app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the send key name and value for a Hybrid Connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listHybridConnectionKeysSlotWithResponse( - String resourceGroupName, String name, String namespaceName, String relayName, String slot, Context context); - - /** - * Retrieves all Service Bus Hybrid Connections used by this Web App. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for the web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listHybridConnectionsSlotWithResponseAsync( - String resourceGroupName, String name, String slot); - - /** - * Retrieves all Service Bus Hybrid Connections used by this Web App. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for the web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listHybridConnectionsSlotAsync(String resourceGroupName, String name, String slot); - - /** - * Retrieves all Service Bus Hybrid Connections used by this Web App. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for the web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - HybridConnectionInner listHybridConnectionsSlot(String resourceGroupName, String name, String slot); - - /** - * Retrieves all Service Bus Hybrid Connections used by this Web App. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for the web app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listHybridConnectionsSlotWithResponse( - String resourceGroupName, String name, String slot, Context context); - - /** - * Gets hybrid connections configured for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get hybrid connections for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid connections configured for an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listRelayServiceConnectionsSlotWithResponseAsync( - String resourceGroupName, String name, String slot); - - /** - * Gets hybrid connections configured for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get hybrid connections for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid connections configured for an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listRelayServiceConnectionsSlotAsync( - String resourceGroupName, String name, String slot); - - /** - * Gets hybrid connections configured for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get hybrid connections for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid connections configured for an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RelayServiceConnectionEntityInner listRelayServiceConnectionsSlot( - String resourceGroupName, String name, String slot); - - /** - * Gets hybrid connections configured for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get hybrid connections for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid connections configured for an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listRelayServiceConnectionsSlotWithResponse( - String resourceGroupName, String name, String slot, Context context); - - /** - * Gets a hybrid connection configuration by its name. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param entityName Name of the hybrid connection. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get a hybrid connection for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a hybrid connection configuration by its name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getRelayServiceConnectionSlotWithResponseAsync( - String resourceGroupName, String name, String entityName, String slot); - - /** - * Gets a hybrid connection configuration by its name. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param entityName Name of the hybrid connection. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get a hybrid connection for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a hybrid connection configuration by its name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getRelayServiceConnectionSlotAsync( - String resourceGroupName, String name, String entityName, String slot); - - /** - * Gets a hybrid connection configuration by its name. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param entityName Name of the hybrid connection. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get a hybrid connection for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a hybrid connection configuration by its name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RelayServiceConnectionEntityInner getRelayServiceConnectionSlot( - String resourceGroupName, String name, String entityName, String slot); - - /** - * Gets a hybrid connection configuration by its name. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param entityName Name of the hybrid connection. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get a hybrid connection for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a hybrid connection configuration by its name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getRelayServiceConnectionSlotWithResponse( - String resourceGroupName, String name, String entityName, String slot, Context context); - - /** - * Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param entityName Name of the hybrid connection configuration. - * @param slot Name of the deployment slot. If a slot is not specified, the API will create or update a hybrid - * connection for the production slot. - * @param connectionEnvelope Details of the hybrid connection configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection for an App Service app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createOrUpdateRelayServiceConnectionSlotWithResponseAsync( - String resourceGroupName, - String name, - String entityName, - String slot, - RelayServiceConnectionEntityInner connectionEnvelope); - - /** - * Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param entityName Name of the hybrid connection configuration. - * @param slot Name of the deployment slot. If a slot is not specified, the API will create or update a hybrid - * connection for the production slot. - * @param connectionEnvelope Details of the hybrid connection configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection for an App Service app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateRelayServiceConnectionSlotAsync( - String resourceGroupName, - String name, - String entityName, - String slot, - RelayServiceConnectionEntityInner connectionEnvelope); - - /** - * Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param entityName Name of the hybrid connection configuration. - * @param slot Name of the deployment slot. If a slot is not specified, the API will create or update a hybrid - * connection for the production slot. - * @param connectionEnvelope Details of the hybrid connection configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection for an App Service app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RelayServiceConnectionEntityInner createOrUpdateRelayServiceConnectionSlot( - String resourceGroupName, - String name, - String entityName, - String slot, - RelayServiceConnectionEntityInner connectionEnvelope); - - /** - * Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param entityName Name of the hybrid connection configuration. - * @param slot Name of the deployment slot. If a slot is not specified, the API will create or update a hybrid - * connection for the production slot. - * @param connectionEnvelope Details of the hybrid connection configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection for an App Service app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateRelayServiceConnectionSlotWithResponse( - String resourceGroupName, - String name, - String entityName, - String slot, - RelayServiceConnectionEntityInner connectionEnvelope, - Context context); - - /** - * Deletes a relay service connection by its name. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param entityName Name of the hybrid connection configuration. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete a hybrid connection for - * the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteRelayServiceConnectionSlotWithResponseAsync( - String resourceGroupName, String name, String entityName, String slot); - - /** - * Deletes a relay service connection by its name. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param entityName Name of the hybrid connection configuration. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete a hybrid connection for - * the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteRelayServiceConnectionSlotAsync( - String resourceGroupName, String name, String entityName, String slot); - - /** - * Deletes a relay service connection by its name. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param entityName Name of the hybrid connection configuration. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete a hybrid connection for - * the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deleteRelayServiceConnectionSlot(String resourceGroupName, String name, String entityName, String slot); - - /** - * Deletes a relay service connection by its name. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param entityName Name of the hybrid connection configuration. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete a hybrid connection for - * the production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteRelayServiceConnectionSlotWithResponse( - String resourceGroupName, String name, String entityName, String slot, Context context); - - /** - * Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param entityName Name of the hybrid connection configuration. - * @param slot Name of the deployment slot. If a slot is not specified, the API will create or update a hybrid - * connection for the production slot. - * @param connectionEnvelope Details of the hybrid connection configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection for an App Service app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateRelayServiceConnectionSlotWithResponseAsync( - String resourceGroupName, - String name, - String entityName, - String slot, - RelayServiceConnectionEntityInner connectionEnvelope); - - /** - * Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param entityName Name of the hybrid connection configuration. - * @param slot Name of the deployment slot. If a slot is not specified, the API will create or update a hybrid - * connection for the production slot. - * @param connectionEnvelope Details of the hybrid connection configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection for an App Service app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateRelayServiceConnectionSlotAsync( - String resourceGroupName, - String name, - String entityName, - String slot, - RelayServiceConnectionEntityInner connectionEnvelope); - - /** - * Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param entityName Name of the hybrid connection configuration. - * @param slot Name of the deployment slot. If a slot is not specified, the API will create or update a hybrid - * connection for the production slot. - * @param connectionEnvelope Details of the hybrid connection configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection for an App Service app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RelayServiceConnectionEntityInner updateRelayServiceConnectionSlot( - String resourceGroupName, - String name, - String entityName, - String slot, - RelayServiceConnectionEntityInner connectionEnvelope); - - /** - * Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param entityName Name of the hybrid connection configuration. - * @param slot Name of the deployment slot. If a slot is not specified, the API will create or update a hybrid - * connection for the production slot. - * @param connectionEnvelope Details of the hybrid connection configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection for an App Service app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateRelayServiceConnectionSlotWithResponse( - String resourceGroupName, - String name, - String entityName, - String slot, - RelayServiceConnectionEntityInner connectionEnvelope, - Context context); - - /** - * Gets all scale-out instances of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API gets the production slot instances. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all scale-out instances of an app. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listInstanceIdentifiersSlotAsync(String resourceGroupName, String name, String slot); - - /** - * Gets all scale-out instances of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API gets the production slot instances. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all scale-out instances of an app. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listInstanceIdentifiersSlot(String resourceGroupName, String name, String slot); - - /** - * Gets all scale-out instances of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API gets the production slot instances. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all scale-out instances of an app. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listInstanceIdentifiersSlot( - String resourceGroupName, String name, String slot, Context context); - - /** - * Get the status of the last MSDeploy operation. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param instanceId ID of web app instance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of the last MSDeploy operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getInstanceMsDeployStatusSlotWithResponseAsync( - String resourceGroupName, String name, String slot, String instanceId); - - /** - * Get the status of the last MSDeploy operation. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param instanceId ID of web app instance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of the last MSDeploy operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getInstanceMsDeployStatusSlotAsync( - String resourceGroupName, String name, String slot, String instanceId); - - /** - * Get the status of the last MSDeploy operation. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param instanceId ID of web app instance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of the last MSDeploy operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - MSDeployStatusInner getInstanceMsDeployStatusSlot( - String resourceGroupName, String name, String slot, String instanceId); - - /** - * Get the status of the last MSDeploy operation. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param instanceId ID of web app instance. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of the last MSDeploy operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getInstanceMsDeployStatusSlotWithResponse( - String resourceGroupName, String name, String slot, String instanceId, Context context); - - /** - * Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param instanceId ID of web app instance. - * @param mSDeploy Details of MSDeploy operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createInstanceMSDeployOperationSlotWithResponseAsync( - String resourceGroupName, String name, String slot, String instanceId, MSDeploy mSDeploy); - - /** - * Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param instanceId ID of web app instance. - * @param mSDeploy Details of MSDeploy operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, MSDeployStatusInner> beginCreateInstanceMSDeployOperationSlotAsync( - String resourceGroupName, String name, String slot, String instanceId, MSDeploy mSDeploy); - - /** - * Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param instanceId ID of web app instance. - * @param mSDeploy Details of MSDeploy operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, MSDeployStatusInner> beginCreateInstanceMSDeployOperationSlot( - String resourceGroupName, String name, String slot, String instanceId, MSDeploy mSDeploy); - - /** - * Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param instanceId ID of web app instance. - * @param mSDeploy Details of MSDeploy operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, MSDeployStatusInner> beginCreateInstanceMSDeployOperationSlot( - String resourceGroupName, String name, String slot, String instanceId, MSDeploy mSDeploy, Context context); - - /** - * Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param instanceId ID of web app instance. - * @param mSDeploy Details of MSDeploy operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createInstanceMSDeployOperationSlotAsync( - String resourceGroupName, String name, String slot, String instanceId, MSDeploy mSDeploy); - - /** - * Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param instanceId ID of web app instance. - * @param mSDeploy Details of MSDeploy operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - MSDeployStatusInner createInstanceMSDeployOperationSlot( - String resourceGroupName, String name, String slot, String instanceId, MSDeploy mSDeploy); - - /** - * Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param instanceId ID of web app instance. - * @param mSDeploy Details of MSDeploy operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - MSDeployStatusInner createInstanceMSDeployOperationSlot( - String resourceGroupName, String name, String slot, String instanceId, MSDeploy mSDeploy, Context context); - - /** - * Get the MSDeploy Log for the last MSDeploy operation. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param instanceId ID of web app instance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the MSDeploy Log for the last MSDeploy operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getInstanceMSDeployLogSlotWithResponseAsync( - String resourceGroupName, String name, String slot, String instanceId); - - /** - * Get the MSDeploy Log for the last MSDeploy operation. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param instanceId ID of web app instance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the MSDeploy Log for the last MSDeploy operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getInstanceMSDeployLogSlotAsync( - String resourceGroupName, String name, String slot, String instanceId); - - /** - * Get the MSDeploy Log for the last MSDeploy operation. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param instanceId ID of web app instance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the MSDeploy Log for the last MSDeploy operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - MSDeployLogInner getInstanceMSDeployLogSlot(String resourceGroupName, String name, String slot, String instanceId); - - /** - * Get the MSDeploy Log for the last MSDeploy operation. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param instanceId ID of web app instance. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the MSDeploy Log for the last MSDeploy operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getInstanceMSDeployLogSlotWithResponse( - String resourceGroupName, String name, String slot, String instanceId, Context context); - - /** - * Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web - * site. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listInstanceProcessesSlotAsync( - String resourceGroupName, String name, String slot, String instanceId); - - /** - * Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web - * site. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listInstanceProcessesSlot( - String resourceGroupName, String name, String slot, String instanceId); - - /** - * Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web - * site. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listInstanceProcessesSlot( - String resourceGroupName, String name, String slot, String instanceId, Context context); - - /** - * Get process information by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return process information by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getInstanceProcessSlotWithResponseAsync( - String resourceGroupName, String name, String processId, String slot, String instanceId); - - /** - * Get process information by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return process information by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getInstanceProcessSlotAsync( - String resourceGroupName, String name, String processId, String slot, String instanceId); - - /** - * Get process information by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return process information by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ProcessInfoInner getInstanceProcessSlot( - String resourceGroupName, String name, String processId, String slot, String instanceId); - - /** - * Get process information by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return process information by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getInstanceProcessSlotWithResponse( - String resourceGroupName, String name, String processId, String slot, String instanceId, Context context); - - /** - * Terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in a web - * site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteInstanceProcessSlotWithResponseAsync( - String resourceGroupName, String name, String processId, String slot, String instanceId); - - /** - * Terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in a web - * site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteInstanceProcessSlotAsync( - String resourceGroupName, String name, String processId, String slot, String instanceId); - - /** - * Terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in a web - * site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deleteInstanceProcessSlot( - String resourceGroupName, String name, String processId, String slot, String instanceId); - - /** - * Terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in a web - * site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteInstanceProcessSlotWithResponse( - String resourceGroupName, String name, String processId, String slot, String instanceId, Context context); - - /** - * Get a memory dump of a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a memory dump of a process by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getInstanceProcessDumpSlotWithResponseAsync( - String resourceGroupName, String name, String processId, String slot, String instanceId); - - /** - * Get a memory dump of a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a memory dump of a process by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Flux getInstanceProcessDumpSlotAsync( - String resourceGroupName, String name, String processId, String slot, String instanceId); - - /** - * Get a memory dump of a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a memory dump of a process by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - InputStream getInstanceProcessDumpSlot( - String resourceGroupName, String name, String processId, String slot, String instanceId); - - /** - * Get a memory dump of a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a memory dump of a process by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - StreamResponse getInstanceProcessDumpSlotWithResponse( - String resourceGroupName, String name, String processId, String slot, String instanceId, Context context); - - /** - * List module information for a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listInstanceProcessModulesSlotAsync( - String resourceGroupName, String name, String processId, String slot, String instanceId); - - /** - * List module information for a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listInstanceProcessModulesSlot( - String resourceGroupName, String name, String processId, String slot, String instanceId); - - /** - * List module information for a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listInstanceProcessModulesSlot( - String resourceGroupName, String name, String processId, String slot, String instanceId, Context context); - - /** - * Get process information by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param baseAddress Module base address. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return process information by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getInstanceProcessModuleSlotWithResponseAsync( - String resourceGroupName, String name, String processId, String baseAddress, String slot, String instanceId); - - /** - * Get process information by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param baseAddress Module base address. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return process information by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getInstanceProcessModuleSlotAsync( - String resourceGroupName, String name, String processId, String baseAddress, String slot, String instanceId); - - /** - * Get process information by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param baseAddress Module base address. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return process information by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ProcessModuleInfoInner getInstanceProcessModuleSlot( - String resourceGroupName, String name, String processId, String baseAddress, String slot, String instanceId); - - /** - * Get process information by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param baseAddress Module base address. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return process information by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getInstanceProcessModuleSlotWithResponse( - String resourceGroupName, - String name, - String processId, - String baseAddress, - String slot, - String instanceId, - Context context); - - /** - * List the threads in a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listInstanceProcessThreadsSlotAsync( - String resourceGroupName, String name, String processId, String slot, String instanceId); - - /** - * List the threads in a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listInstanceProcessThreadsSlot( - String resourceGroupName, String name, String processId, String slot, String instanceId); - - /** - * List the threads in a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listInstanceProcessThreadsSlot( - String resourceGroupName, String name, String processId, String slot, String instanceId, Context context); - - /** - * Get thread information by Thread ID for a specific process, in a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param threadId TID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return thread information by Thread ID for a specific process, in a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getInstanceProcessThreadSlotWithResponseAsync( - String resourceGroupName, String name, String processId, String threadId, String slot, String instanceId); - - /** - * Get thread information by Thread ID for a specific process, in a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param threadId TID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return thread information by Thread ID for a specific process, in a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getInstanceProcessThreadSlotAsync( - String resourceGroupName, String name, String processId, String threadId, String slot, String instanceId); - - /** - * Get thread information by Thread ID for a specific process, in a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param threadId TID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return thread information by Thread ID for a specific process, in a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ProcessThreadInfoInner getInstanceProcessThreadSlot( - String resourceGroupName, String name, String processId, String threadId, String slot, String instanceId); - - /** - * Get thread information by Thread ID for a specific process, in a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param threadId TID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return thread information by Thread ID for a specific process, in a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getInstanceProcessThreadSlotWithResponse( - String resourceGroupName, - String name, - String processId, - String threadId, - String slot, - String instanceId, - Context context); - - /** - * Shows whether an app can be cloned to another resource group or subscription. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. By default, this API returns information on the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents whether or not an app is cloneable. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> isCloneableSlotWithResponseAsync( - String resourceGroupName, String name, String slot); - - /** - * Shows whether an app can be cloned to another resource group or subscription. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. By default, this API returns information on the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents whether or not an app is cloneable. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono isCloneableSlotAsync(String resourceGroupName, String name, String slot); - - /** - * Shows whether an app can be cloned to another resource group or subscription. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. By default, this API returns information on the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents whether or not an app is cloneable. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SiteCloneabilityInner isCloneableSlot(String resourceGroupName, String name, String slot); - - /** - * Shows whether an app can be cloned to another resource group or subscription. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. By default, this API returns information on the production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents whether or not an app is cloneable. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response isCloneableSlotWithResponse( - String resourceGroupName, String name, String slot, Context context); - - /** - * This is to allow calling via powershell and ARM template. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function secrets. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listSyncFunctionTriggersSlotWithResponseAsync( - String resourceGroupName, String name, String slot); - - /** - * This is to allow calling via powershell and ARM template. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function secrets. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listSyncFunctionTriggersSlotAsync(String resourceGroupName, String name, String slot); - - /** - * This is to allow calling via powershell and ARM template. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function secrets. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - FunctionSecretsInner listSyncFunctionTriggersSlot(String resourceGroupName, String name, String slot); - - /** - * This is to allow calling via powershell and ARM template. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function secrets. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listSyncFunctionTriggersSlotWithResponse( - String resourceGroupName, String name, String slot, Context context); - - /** - * Gets all metric definitions of an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get metric definitions of the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all metric definitions of an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listMetricDefinitionsSlotAsync( - String resourceGroupName, String name, String slot); - - /** - * Gets all metric definitions of an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get metric definitions of the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all metric definitions of an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listMetricDefinitionsSlot( - String resourceGroupName, String name, String slot); - - /** - * Gets all metric definitions of an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get metric definitions of the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all metric definitions of an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listMetricDefinitionsSlot( - String resourceGroupName, String name, String slot, Context context); - - /** - * Gets performance metrics of an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get metrics of the production - * slot. - * @param details Specify "true" to include metric details in the response. It is "false" by default. - * @param filter Return only metrics specified in the filter (using OData syntax). For example: $filter=(name.value - * eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and endTime eq - * 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return performance metrics of an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listMetricsSlotAsync( - String resourceGroupName, String name, String slot, Boolean details, String filter); - - /** - * Gets performance metrics of an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get metrics of the production - * slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return performance metrics of an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listMetricsSlotAsync(String resourceGroupName, String name, String slot); - - /** - * Gets performance metrics of an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get metrics of the production - * slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return performance metrics of an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listMetricsSlot(String resourceGroupName, String name, String slot); - - /** - * Gets performance metrics of an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get metrics of the production - * slot. - * @param details Specify "true" to include metric details in the response. It is "false" by default. - * @param filter Return only metrics specified in the filter (using OData syntax). For example: $filter=(name.value - * eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and endTime eq - * 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return performance metrics of an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listMetricsSlot( - String resourceGroupName, String name, String slot, Boolean details, String filter, Context context); - - /** - * Returns the status of MySql in app migration, if one is active, and whether or not MySql in app is enabled. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of the deployment slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mySQL migration status. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getMigrateMySqlStatusSlotWithResponseAsync( - String resourceGroupName, String name, String slot); - - /** - * Returns the status of MySql in app migration, if one is active, and whether or not MySql in app is enabled. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of the deployment slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mySQL migration status. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getMigrateMySqlStatusSlotAsync(String resourceGroupName, String name, String slot); - - /** - * Returns the status of MySql in app migration, if one is active, and whether or not MySql in app is enabled. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of the deployment slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mySQL migration status. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - MigrateMySqlStatusInner getMigrateMySqlStatusSlot(String resourceGroupName, String name, String slot); - - /** - * Returns the status of MySql in app migration, if one is active, and whether or not MySql in app is enabled. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of the deployment slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mySQL migration status. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getMigrateMySqlStatusSlotWithResponse( - String resourceGroupName, String name, String slot, Context context); - - /** - * Gets a Swift Virtual Network connection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get a gateway for the - * production slot's Virtual Network. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Swift Virtual Network connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getSwiftVirtualNetworkConnectionSlotWithResponseAsync( - String resourceGroupName, String name, String slot); - - /** - * Gets a Swift Virtual Network connection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get a gateway for the - * production slot's Virtual Network. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Swift Virtual Network connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getSwiftVirtualNetworkConnectionSlotAsync( - String resourceGroupName, String name, String slot); - - /** - * Gets a Swift Virtual Network connection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get a gateway for the - * production slot's Virtual Network. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Swift Virtual Network connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SwiftVirtualNetworkInner getSwiftVirtualNetworkConnectionSlot(String resourceGroupName, String name, String slot); - - /** - * Gets a Swift Virtual Network connection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get a gateway for the - * production slot's Virtual Network. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Swift Virtual Network connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getSwiftVirtualNetworkConnectionSlotWithResponse( - String resourceGroupName, String name, String slot, Context context); - - /** - * Integrates this Web App with a Virtual Network. This requires that 1) "swiftSupported" is true when doing a GET - * against this resource, and 2) that the target Subnet has already been delegated, and is not in use by another App - * Service Plan other than the one this App is in. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will add or update connections for - * the production slot. - * @param connectionEnvelope Properties of the Virtual Network connection. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return swift Virtual Network Contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createOrUpdateSwiftVirtualNetworkConnectionSlotWithResponseAsync( - String resourceGroupName, String name, String slot, SwiftVirtualNetworkInner connectionEnvelope); - - /** - * Integrates this Web App with a Virtual Network. This requires that 1) "swiftSupported" is true when doing a GET - * against this resource, and 2) that the target Subnet has already been delegated, and is not in use by another App - * Service Plan other than the one this App is in. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will add or update connections for - * the production slot. - * @param connectionEnvelope Properties of the Virtual Network connection. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return swift Virtual Network Contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateSwiftVirtualNetworkConnectionSlotAsync( - String resourceGroupName, String name, String slot, SwiftVirtualNetworkInner connectionEnvelope); - - /** - * Integrates this Web App with a Virtual Network. This requires that 1) "swiftSupported" is true when doing a GET - * against this resource, and 2) that the target Subnet has already been delegated, and is not in use by another App - * Service Plan other than the one this App is in. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will add or update connections for - * the production slot. - * @param connectionEnvelope Properties of the Virtual Network connection. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return swift Virtual Network Contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SwiftVirtualNetworkInner createOrUpdateSwiftVirtualNetworkConnectionSlot( - String resourceGroupName, String name, String slot, SwiftVirtualNetworkInner connectionEnvelope); - - /** - * Integrates this Web App with a Virtual Network. This requires that 1) "swiftSupported" is true when doing a GET - * against this resource, and 2) that the target Subnet has already been delegated, and is not in use by another App - * Service Plan other than the one this App is in. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will add or update connections for - * the production slot. - * @param connectionEnvelope Properties of the Virtual Network connection. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return swift Virtual Network Contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateSwiftVirtualNetworkConnectionSlotWithResponse( - String resourceGroupName, - String name, - String slot, - SwiftVirtualNetworkInner connectionEnvelope, - Context context); - - /** - * Deletes a Swift Virtual Network connection from an app (or deployment slot). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the connection for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteSwiftVirtualNetworkSlotWithResponseAsync( - String resourceGroupName, String name, String slot); - - /** - * Deletes a Swift Virtual Network connection from an app (or deployment slot). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the connection for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteSwiftVirtualNetworkSlotAsync(String resourceGroupName, String name, String slot); - - /** - * Deletes a Swift Virtual Network connection from an app (or deployment slot). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the connection for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deleteSwiftVirtualNetworkSlot(String resourceGroupName, String name, String slot); - - /** - * Deletes a Swift Virtual Network connection from an app (or deployment slot). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the connection for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteSwiftVirtualNetworkSlotWithResponse( - String resourceGroupName, String name, String slot, Context context); - - /** - * Integrates this Web App with a Virtual Network. This requires that 1) "swiftSupported" is true when doing a GET - * against this resource, and 2) that the target Subnet has already been delegated, and is not in use by another App - * Service Plan other than the one this App is in. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will add or update connections for - * the production slot. - * @param connectionEnvelope Properties of the Virtual Network connection. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return swift Virtual Network Contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateSwiftVirtualNetworkConnectionSlotWithResponseAsync( - String resourceGroupName, String name, String slot, SwiftVirtualNetworkInner connectionEnvelope); - - /** - * Integrates this Web App with a Virtual Network. This requires that 1) "swiftSupported" is true when doing a GET - * against this resource, and 2) that the target Subnet has already been delegated, and is not in use by another App - * Service Plan other than the one this App is in. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will add or update connections for - * the production slot. - * @param connectionEnvelope Properties of the Virtual Network connection. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return swift Virtual Network Contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateSwiftVirtualNetworkConnectionSlotAsync( - String resourceGroupName, String name, String slot, SwiftVirtualNetworkInner connectionEnvelope); - - /** - * Integrates this Web App with a Virtual Network. This requires that 1) "swiftSupported" is true when doing a GET - * against this resource, and 2) that the target Subnet has already been delegated, and is not in use by another App - * Service Plan other than the one this App is in. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will add or update connections for - * the production slot. - * @param connectionEnvelope Properties of the Virtual Network connection. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return swift Virtual Network Contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SwiftVirtualNetworkInner updateSwiftVirtualNetworkConnectionSlot( - String resourceGroupName, String name, String slot, SwiftVirtualNetworkInner connectionEnvelope); - - /** - * Integrates this Web App with a Virtual Network. This requires that 1) "swiftSupported" is true when doing a GET - * against this resource, and 2) that the target Subnet has already been delegated, and is not in use by another App - * Service Plan other than the one this App is in. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will add or update connections for - * the production slot. - * @param connectionEnvelope Properties of the Virtual Network connection. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return swift Virtual Network Contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateSwiftVirtualNetworkConnectionSlotWithResponse( - String resourceGroupName, - String name, - String slot, - SwiftVirtualNetworkInner connectionEnvelope, - Context context); - - /** - * Gets all network features used by the app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param view The type of view. This can either be "summary" or "detailed". - * @param slot Name of the deployment slot. If a slot is not specified, the API will get network features for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network features used by the app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listNetworkFeaturesSlotWithResponseAsync( - String resourceGroupName, String name, String view, String slot); - - /** - * Gets all network features used by the app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param view The type of view. This can either be "summary" or "detailed". - * @param slot Name of the deployment slot. If a slot is not specified, the API will get network features for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network features used by the app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listNetworkFeaturesSlotAsync( - String resourceGroupName, String name, String view, String slot); - - /** - * Gets all network features used by the app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param view The type of view. This can either be "summary" or "detailed". - * @param slot Name of the deployment slot. If a slot is not specified, the API will get network features for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network features used by the app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - NetworkFeaturesInner listNetworkFeaturesSlot(String resourceGroupName, String name, String view, String slot); - - /** - * Gets all network features used by the app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param view The type of view. This can either be "summary" or "detailed". - * @param slot Name of the deployment slot. If a slot is not specified, the API will get network features for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network features used by the app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listNetworkFeaturesSlotWithResponse( - String resourceGroupName, String name, String view, String slot, Context context); - - /** - * Gets a named operation for a network trace capturing (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param operationId GUID of the operation. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get an operation for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named operation for a network trace capturing (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getNetworkTraceOperationSlotWithResponseAsync( - String resourceGroupName, String name, String operationId, String slot); - - /** - * Gets a named operation for a network trace capturing (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param operationId GUID of the operation. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get an operation for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named operation for a network trace capturing (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getNetworkTraceOperationSlotAsync( - String resourceGroupName, String name, String operationId, String slot); - - /** - * Gets a named operation for a network trace capturing (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param operationId GUID of the operation. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get an operation for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named operation for a network trace capturing (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Object getNetworkTraceOperationSlot(String resourceGroupName, String name, String operationId, String slot); - - /** - * Gets a named operation for a network trace capturing (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param operationId GUID of the operation. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get an operation for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named operation for a network trace capturing (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getNetworkTraceOperationSlotWithResponse( - String resourceGroupName, String name, String operationId, String slot, Context context); - - /** - * Start capturing network packets for the site (To be deprecated). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> startWebSiteNetworkTraceSlotWithResponseAsync( - String resourceGroupName, - String name, - String slot, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl); - - /** - * Start capturing network packets for the site (To be deprecated). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono startWebSiteNetworkTraceSlotAsync( - String resourceGroupName, - String name, - String slot, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl); - - /** - * Start capturing network packets for the site (To be deprecated). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono startWebSiteNetworkTraceSlotAsync(String resourceGroupName, String name, String slot); - - /** - * Start capturing network packets for the site (To be deprecated). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - String startWebSiteNetworkTraceSlot(String resourceGroupName, String name, String slot); - - /** - * Start capturing network packets for the site (To be deprecated). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response startWebSiteNetworkTraceSlotWithResponse( - String resourceGroupName, - String name, - String slot, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl, - Context context); - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> startWebSiteNetworkTraceOperationSlotWithResponseAsync( - String resourceGroupName, - String name, - String slot, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl); - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Object> beginStartWebSiteNetworkTraceOperationSlotAsync( - String resourceGroupName, - String name, - String slot, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl); - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Object> beginStartWebSiteNetworkTraceOperationSlot( - String resourceGroupName, - String name, - String slot, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl); - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Object> beginStartWebSiteNetworkTraceOperationSlot( - String resourceGroupName, - String name, - String slot, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl, - Context context); - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono startWebSiteNetworkTraceOperationSlotAsync( - String resourceGroupName, - String name, - String slot, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl); - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono startWebSiteNetworkTraceOperationSlotAsync(String resourceGroupName, String name, String slot); - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Object startWebSiteNetworkTraceOperationSlot( - String resourceGroupName, - String name, - String slot, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl); - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Object startWebSiteNetworkTraceOperationSlot(String resourceGroupName, String name, String slot); - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Object startWebSiteNetworkTraceOperationSlot( - String resourceGroupName, - String name, - String slot, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl, - Context context); - - /** - * Stop ongoing capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> stopWebSiteNetworkTraceSlotWithResponseAsync( - String resourceGroupName, String name, String slot); - - /** - * Stop ongoing capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono stopWebSiteNetworkTraceSlotAsync(String resourceGroupName, String name, String slot); - - /** - * Stop ongoing capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void stopWebSiteNetworkTraceSlot(String resourceGroupName, String name, String slot); - - /** - * Stop ongoing capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response stopWebSiteNetworkTraceSlotWithResponse( - String resourceGroupName, String name, String slot, Context context); - - /** - * Gets a named operation for a network trace capturing (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param operationId GUID of the operation. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get an operation for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named operation for a network trace capturing (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> getNetworkTracesSlotWithResponseAsync( - String resourceGroupName, String name, String operationId, String slot); - - /** - * Gets a named operation for a network trace capturing (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param operationId GUID of the operation. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get an operation for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named operation for a network trace capturing (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getNetworkTracesSlotAsync( - String resourceGroupName, String name, String operationId, String slot); - - /** - * Gets a named operation for a network trace capturing (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param operationId GUID of the operation. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get an operation for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named operation for a network trace capturing (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - List getNetworkTracesSlot( - String resourceGroupName, String name, String operationId, String slot); - - /** - * Gets a named operation for a network trace capturing (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param operationId GUID of the operation. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get an operation for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named operation for a network trace capturing (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response> getNetworkTracesSlotWithResponse( - String resourceGroupName, String name, String operationId, String slot, Context context); - - /** - * Gets a named operation for a network trace capturing (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param operationId GUID of the operation. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get an operation for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named operation for a network trace capturing (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getNetworkTraceOperationSlotV2WithResponseAsync( - String resourceGroupName, String name, String operationId, String slot); - - /** - * Gets a named operation for a network trace capturing (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param operationId GUID of the operation. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get an operation for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named operation for a network trace capturing (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getNetworkTraceOperationSlotV2Async( - String resourceGroupName, String name, String operationId, String slot); - - /** - * Gets a named operation for a network trace capturing (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param operationId GUID of the operation. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get an operation for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named operation for a network trace capturing (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Object getNetworkTraceOperationSlotV2(String resourceGroupName, String name, String operationId, String slot); - - /** - * Gets a named operation for a network trace capturing (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param operationId GUID of the operation. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get an operation for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named operation for a network trace capturing (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getNetworkTraceOperationSlotV2WithResponse( - String resourceGroupName, String name, String operationId, String slot, Context context); - - /** - * Gets a named operation for a network trace capturing (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param operationId GUID of the operation. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get an operation for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named operation for a network trace capturing (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> getNetworkTracesSlotV2WithResponseAsync( - String resourceGroupName, String name, String operationId, String slot); - - /** - * Gets a named operation for a network trace capturing (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param operationId GUID of the operation. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get an operation for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named operation for a network trace capturing (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getNetworkTracesSlotV2Async( - String resourceGroupName, String name, String operationId, String slot); - - /** - * Gets a named operation for a network trace capturing (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param operationId GUID of the operation. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get an operation for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named operation for a network trace capturing (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - List getNetworkTracesSlotV2( - String resourceGroupName, String name, String operationId, String slot); - - /** - * Gets a named operation for a network trace capturing (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param operationId GUID of the operation. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get an operation for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named operation for a network trace capturing (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response> getNetworkTracesSlotV2WithResponse( - String resourceGroupName, String name, String operationId, String slot, Context context); - - /** - * Generates a new publishing password for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API generate a new publishing password - * for the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> generateNewSitePublishingPasswordSlotWithResponseAsync( - String resourceGroupName, String name, String slot); - - /** - * Generates a new publishing password for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API generate a new publishing password - * for the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono generateNewSitePublishingPasswordSlotAsync(String resourceGroupName, String name, String slot); - - /** - * Generates a new publishing password for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API generate a new publishing password - * for the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void generateNewSitePublishingPasswordSlot(String resourceGroupName, String name, String slot); - - /** - * Generates a new publishing password for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API generate a new publishing password - * for the production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response generateNewSitePublishingPasswordSlotWithResponse( - String resourceGroupName, String name, String slot, Context context); - - /** - * Gets perfmon counters for web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: - * $filter=(startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq - * duration'[Hour|Minute|Day]'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return perfmon counters for web app. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listPerfMonCountersSlotAsync( - String resourceGroupName, String name, String slot, String filter); - - /** - * Gets perfmon counters for web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return perfmon counters for web app. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listPerfMonCountersSlotAsync(String resourceGroupName, String name, String slot); - - /** - * Gets perfmon counters for web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return perfmon counters for web app. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listPerfMonCountersSlot(String resourceGroupName, String name, String slot); - - /** - * Gets perfmon counters for web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: - * $filter=(startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq - * duration'[Hour|Minute|Day]'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return perfmon counters for web app. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listPerfMonCountersSlot( - String resourceGroupName, String name, String slot, String filter, Context context); - - /** - * Gets web app's event logs. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return web app's event logs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getSitePhpErrorLogFlagSlotWithResponseAsync( - String resourceGroupName, String name, String slot); - - /** - * Gets web app's event logs. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return web app's event logs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getSitePhpErrorLogFlagSlotAsync(String resourceGroupName, String name, String slot); - - /** - * Gets web app's event logs. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return web app's event logs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SitePhpErrorLogFlagInner getSitePhpErrorLogFlagSlot(String resourceGroupName, String name, String slot); - - /** - * Gets web app's event logs. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return web app's event logs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getSitePhpErrorLogFlagSlotWithResponse( - String resourceGroupName, String name, String slot, Context context); - - /** - * Gets the premier add-ons of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the premier add-ons for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the premier add-ons of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listPremierAddOnsSlotWithResponseAsync( - String resourceGroupName, String name, String slot); - - /** - * Gets the premier add-ons of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the premier add-ons for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the premier add-ons of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listPremierAddOnsSlotAsync(String resourceGroupName, String name, String slot); - - /** - * Gets the premier add-ons of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the premier add-ons for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the premier add-ons of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PremierAddOnInner listPremierAddOnsSlot(String resourceGroupName, String name, String slot); - - /** - * Gets the premier add-ons of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the premier add-ons for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the premier add-ons of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listPremierAddOnsSlotWithResponse( - String resourceGroupName, String name, String slot, Context context); - - /** - * Gets a named add-on of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param premierAddOnName Add-on name. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the named add-on for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named add-on of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getPremierAddOnSlotWithResponseAsync( - String resourceGroupName, String name, String premierAddOnName, String slot); - - /** - * Gets a named add-on of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param premierAddOnName Add-on name. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the named add-on for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named add-on of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getPremierAddOnSlotAsync( - String resourceGroupName, String name, String premierAddOnName, String slot); - - /** - * Gets a named add-on of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param premierAddOnName Add-on name. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the named add-on for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named add-on of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PremierAddOnInner getPremierAddOnSlot(String resourceGroupName, String name, String premierAddOnName, String slot); - - /** - * Gets a named add-on of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param premierAddOnName Add-on name. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the named add-on for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named add-on of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getPremierAddOnSlotWithResponse( - String resourceGroupName, String name, String premierAddOnName, String slot, Context context); - - /** - * Updates a named add-on of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param premierAddOnName Add-on name. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the named add-on for the - * production slot. - * @param premierAddOn A JSON representation of the edited premier add-on. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return premier add-on. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> addPremierAddOnSlotWithResponseAsync( - String resourceGroupName, String name, String premierAddOnName, String slot, PremierAddOnInner premierAddOn); - - /** - * Updates a named add-on of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param premierAddOnName Add-on name. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the named add-on for the - * production slot. - * @param premierAddOn A JSON representation of the edited premier add-on. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return premier add-on. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono addPremierAddOnSlotAsync( - String resourceGroupName, String name, String premierAddOnName, String slot, PremierAddOnInner premierAddOn); - - /** - * Updates a named add-on of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param premierAddOnName Add-on name. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the named add-on for the - * production slot. - * @param premierAddOn A JSON representation of the edited premier add-on. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return premier add-on. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PremierAddOnInner addPremierAddOnSlot( - String resourceGroupName, String name, String premierAddOnName, String slot, PremierAddOnInner premierAddOn); - - /** - * Updates a named add-on of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param premierAddOnName Add-on name. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the named add-on for the - * production slot. - * @param premierAddOn A JSON representation of the edited premier add-on. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return premier add-on. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response addPremierAddOnSlotWithResponse( - String resourceGroupName, - String name, - String premierAddOnName, - String slot, - PremierAddOnInner premierAddOn, - Context context); - - /** - * Delete a premier add-on from an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param premierAddOnName Add-on name. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the named add-on for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deletePremierAddOnSlotWithResponseAsync( - String resourceGroupName, String name, String premierAddOnName, String slot); - - /** - * Delete a premier add-on from an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param premierAddOnName Add-on name. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the named add-on for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deletePremierAddOnSlotAsync(String resourceGroupName, String name, String premierAddOnName, String slot); - - /** - * Delete a premier add-on from an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param premierAddOnName Add-on name. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the named add-on for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deletePremierAddOnSlot(String resourceGroupName, String name, String premierAddOnName, String slot); - - /** - * Delete a premier add-on from an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param premierAddOnName Add-on name. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the named add-on for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deletePremierAddOnSlotWithResponse( - String resourceGroupName, String name, String premierAddOnName, String slot, Context context); - - /** - * Updates a named add-on of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param premierAddOnName Add-on name. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the named add-on for the - * production slot. - * @param premierAddOn A JSON representation of the edited premier add-on. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return premier add-on. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updatePremierAddOnSlotWithResponseAsync( - String resourceGroupName, - String name, - String premierAddOnName, - String slot, - PremierAddOnPatchResource premierAddOn); - - /** - * Updates a named add-on of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param premierAddOnName Add-on name. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the named add-on for the - * production slot. - * @param premierAddOn A JSON representation of the edited premier add-on. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return premier add-on. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updatePremierAddOnSlotAsync( - String resourceGroupName, - String name, - String premierAddOnName, - String slot, - PremierAddOnPatchResource premierAddOn); - - /** - * Updates a named add-on of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param premierAddOnName Add-on name. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the named add-on for the - * production slot. - * @param premierAddOn A JSON representation of the edited premier add-on. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return premier add-on. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PremierAddOnInner updatePremierAddOnSlot( - String resourceGroupName, - String name, - String premierAddOnName, - String slot, - PremierAddOnPatchResource premierAddOn); - - /** - * Updates a named add-on of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param premierAddOnName Add-on name. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the named add-on for the - * production slot. - * @param premierAddOn A JSON representation of the edited premier add-on. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return premier add-on. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updatePremierAddOnSlotWithResponse( - String resourceGroupName, - String name, - String premierAddOnName, - String slot, - PremierAddOnPatchResource premierAddOn, - Context context); - - /** - * Gets data around private site access enablement and authorized Virtual Networks that can access the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for the web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data around private site access enablement and authorized Virtual Networks that can access the site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getPrivateAccessSlotWithResponseAsync( - String resourceGroupName, String name, String slot); - - /** - * Gets data around private site access enablement and authorized Virtual Networks that can access the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for the web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data around private site access enablement and authorized Virtual Networks that can access the site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getPrivateAccessSlotAsync(String resourceGroupName, String name, String slot); - - /** - * Gets data around private site access enablement and authorized Virtual Networks that can access the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for the web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data around private site access enablement and authorized Virtual Networks that can access the site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PrivateAccessInner getPrivateAccessSlot(String resourceGroupName, String name, String slot); - - /** - * Gets data around private site access enablement and authorized Virtual Networks that can access the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for the web app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data around private site access enablement and authorized Virtual Networks that can access the site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getPrivateAccessSlotWithResponse( - String resourceGroupName, String name, String slot, Context context); - - /** - * Sets data around private site access enablement and authorized Virtual Networks that can access the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for the web app. - * @param access The information for the private access. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of the parameters of Private Access for a Web Site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> putPrivateAccessVnetSlotWithResponseAsync( - String resourceGroupName, String name, String slot, PrivateAccessInner access); - - /** - * Sets data around private site access enablement and authorized Virtual Networks that can access the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for the web app. - * @param access The information for the private access. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of the parameters of Private Access for a Web Site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono putPrivateAccessVnetSlotAsync( - String resourceGroupName, String name, String slot, PrivateAccessInner access); - - /** - * Sets data around private site access enablement and authorized Virtual Networks that can access the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for the web app. - * @param access The information for the private access. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of the parameters of Private Access for a Web Site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PrivateAccessInner putPrivateAccessVnetSlot( - String resourceGroupName, String name, String slot, PrivateAccessInner access); - - /** - * Sets data around private site access enablement and authorized Virtual Networks that can access the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for the web app. - * @param access The information for the private access. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of the parameters of Private Access for a Web Site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response putPrivateAccessVnetSlotWithResponse( - String resourceGroupName, String name, String slot, PrivateAccessInner access, Context context); - - /** - * Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web - * site. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listProcessesSlotAsync(String resourceGroupName, String name, String slot); - - /** - * Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web - * site. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listProcessesSlot(String resourceGroupName, String name, String slot); - - /** - * Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web - * site. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listProcessesSlot( - String resourceGroupName, String name, String slot, Context context); - - /** - * Get process information by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return process information by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getProcessSlotWithResponseAsync( - String resourceGroupName, String name, String processId, String slot); - - /** - * Get process information by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return process information by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getProcessSlotAsync(String resourceGroupName, String name, String processId, String slot); - - /** - * Get process information by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return process information by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ProcessInfoInner getProcessSlot(String resourceGroupName, String name, String processId, String slot); - - /** - * Get process information by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return process information by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getProcessSlotWithResponse( - String resourceGroupName, String name, String processId, String slot, Context context); - - /** - * Terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in a web - * site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteProcessSlotWithResponseAsync( - String resourceGroupName, String name, String processId, String slot); - - /** - * Terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in a web - * site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteProcessSlotAsync(String resourceGroupName, String name, String processId, String slot); - - /** - * Terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in a web - * site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deleteProcessSlot(String resourceGroupName, String name, String processId, String slot); - - /** - * Terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in a web - * site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteProcessSlotWithResponse( - String resourceGroupName, String name, String processId, String slot, Context context); - - /** - * Get a memory dump of a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a memory dump of a process by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getProcessDumpSlotWithResponseAsync( - String resourceGroupName, String name, String processId, String slot); - - /** - * Get a memory dump of a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a memory dump of a process by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Flux getProcessDumpSlotAsync(String resourceGroupName, String name, String processId, String slot); - - /** - * Get a memory dump of a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a memory dump of a process by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - InputStream getProcessDumpSlot(String resourceGroupName, String name, String processId, String slot); - - /** - * Get a memory dump of a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a memory dump of a process by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - StreamResponse getProcessDumpSlotWithResponse( - String resourceGroupName, String name, String processId, String slot, Context context); - - /** - * List module information for a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listProcessModulesSlotAsync( - String resourceGroupName, String name, String processId, String slot); - - /** - * List module information for a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listProcessModulesSlot( - String resourceGroupName, String name, String processId, String slot); - - /** - * List module information for a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listProcessModulesSlot( - String resourceGroupName, String name, String processId, String slot, Context context); - - /** - * Get process information by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param baseAddress Module base address. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return process information by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getProcessModuleSlotWithResponseAsync( - String resourceGroupName, String name, String processId, String baseAddress, String slot); - - /** - * Get process information by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param baseAddress Module base address. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return process information by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getProcessModuleSlotAsync( - String resourceGroupName, String name, String processId, String baseAddress, String slot); - - /** - * Get process information by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param baseAddress Module base address. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return process information by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ProcessModuleInfoInner getProcessModuleSlot( - String resourceGroupName, String name, String processId, String baseAddress, String slot); - - /** - * Get process information by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param baseAddress Module base address. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return process information by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getProcessModuleSlotWithResponse( - String resourceGroupName, String name, String processId, String baseAddress, String slot, Context context); - - /** - * List the threads in a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listProcessThreadsSlotAsync( - String resourceGroupName, String name, String processId, String slot); - - /** - * List the threads in a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listProcessThreadsSlot( - String resourceGroupName, String name, String processId, String slot); - - /** - * List the threads in a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listProcessThreadsSlot( - String resourceGroupName, String name, String processId, String slot, Context context); - - /** - * Get thread information by Thread ID for a specific process, in a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param threadId TID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return thread information by Thread ID for a specific process, in a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getProcessThreadSlotWithResponseAsync( - String resourceGroupName, String name, String processId, String threadId, String slot); - - /** - * Get thread information by Thread ID for a specific process, in a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param threadId TID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return thread information by Thread ID for a specific process, in a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getProcessThreadSlotAsync( - String resourceGroupName, String name, String processId, String threadId, String slot); - - /** - * Get thread information by Thread ID for a specific process, in a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param threadId TID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return thread information by Thread ID for a specific process, in a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ProcessThreadInfoInner getProcessThreadSlot( - String resourceGroupName, String name, String processId, String threadId, String slot); - - /** - * Get thread information by Thread ID for a specific process, in a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param threadId TID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return thread information by Thread ID for a specific process, in a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getProcessThreadSlotWithResponse( - String resourceGroupName, String name, String processId, String threadId, String slot, Context context); - - /** - * Get public certificates for an app or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API gets hostname bindings for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public certificates for an app or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listPublicCertificatesSlotAsync( - String resourceGroupName, String name, String slot); - - /** - * Get public certificates for an app or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API gets hostname bindings for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public certificates for an app or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listPublicCertificatesSlot( - String resourceGroupName, String name, String slot); - - /** - * Get public certificates for an app or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API gets hostname bindings for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public certificates for an app or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listPublicCertificatesSlot( - String resourceGroupName, String name, String slot, Context context); - - /** - * Get the named public certificate for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API the named binding for the production - * slot. - * @param publicCertificateName Public certificate name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the named public certificate for an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getPublicCertificateSlotWithResponseAsync( - String resourceGroupName, String name, String slot, String publicCertificateName); - - /** - * Get the named public certificate for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API the named binding for the production - * slot. - * @param publicCertificateName Public certificate name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the named public certificate for an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getPublicCertificateSlotAsync( - String resourceGroupName, String name, String slot, String publicCertificateName); - - /** - * Get the named public certificate for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API the named binding for the production - * slot. - * @param publicCertificateName Public certificate name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the named public certificate for an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PublicCertificateInner getPublicCertificateSlot( - String resourceGroupName, String name, String slot, String publicCertificateName); - - /** - * Get the named public certificate for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API the named binding for the production - * slot. - * @param publicCertificateName Public certificate name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the named public certificate for an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getPublicCertificateSlotWithResponse( - String resourceGroupName, String name, String slot, String publicCertificateName, Context context); - - /** - * Creates a hostname binding for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param publicCertificateName Public certificate name. - * @param slot Name of the deployment slot. If a slot is not specified, the API will create a binding for the - * production slot. - * @param publicCertificate Public certificate details. This is the JSON representation of a PublicCertificate - * object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public certificate object. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createOrUpdatePublicCertificateSlotWithResponseAsync( - String resourceGroupName, - String name, - String publicCertificateName, - String slot, - PublicCertificateInner publicCertificate); - - /** - * Creates a hostname binding for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param publicCertificateName Public certificate name. - * @param slot Name of the deployment slot. If a slot is not specified, the API will create a binding for the - * production slot. - * @param publicCertificate Public certificate details. This is the JSON representation of a PublicCertificate - * object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public certificate object. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdatePublicCertificateSlotAsync( - String resourceGroupName, - String name, - String publicCertificateName, - String slot, - PublicCertificateInner publicCertificate); - - /** - * Creates a hostname binding for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param publicCertificateName Public certificate name. - * @param slot Name of the deployment slot. If a slot is not specified, the API will create a binding for the - * production slot. - * @param publicCertificate Public certificate details. This is the JSON representation of a PublicCertificate - * object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public certificate object. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PublicCertificateInner createOrUpdatePublicCertificateSlot( - String resourceGroupName, - String name, - String publicCertificateName, - String slot, - PublicCertificateInner publicCertificate); - - /** - * Creates a hostname binding for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param publicCertificateName Public certificate name. - * @param slot Name of the deployment slot. If a slot is not specified, the API will create a binding for the - * production slot. - * @param publicCertificate Public certificate details. This is the JSON representation of a PublicCertificate - * object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public certificate object. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdatePublicCertificateSlotWithResponse( - String resourceGroupName, - String name, - String publicCertificateName, - String slot, - PublicCertificateInner publicCertificate, - Context context); - - /** - * Deletes a hostname binding for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the binding for the - * production slot. - * @param publicCertificateName Public certificate name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deletePublicCertificateSlotWithResponseAsync( - String resourceGroupName, String name, String slot, String publicCertificateName); - - /** - * Deletes a hostname binding for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the binding for the - * production slot. - * @param publicCertificateName Public certificate name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deletePublicCertificateSlotAsync( - String resourceGroupName, String name, String slot, String publicCertificateName); - - /** - * Deletes a hostname binding for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the binding for the - * production slot. - * @param publicCertificateName Public certificate name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deletePublicCertificateSlot(String resourceGroupName, String name, String slot, String publicCertificateName); - - /** - * Deletes a hostname binding for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the binding for the - * production slot. - * @param publicCertificateName Public certificate name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deletePublicCertificateSlotWithResponse( - String resourceGroupName, String name, String slot, String publicCertificateName, Context context); - - /** - * Gets the publishing profile for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the publishing profile for - * the production slot. - * @param publishingProfileOptions Specifies publishingProfileOptions for publishing profile. For example, use - * {"format": "FileZilla3"} to get a FileZilla publishing profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the publishing profile for an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listPublishingProfileXmlWithSecretsSlotWithResponseAsync( - String resourceGroupName, String name, String slot, CsmPublishingProfileOptions publishingProfileOptions); - - /** - * Gets the publishing profile for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the publishing profile for - * the production slot. - * @param publishingProfileOptions Specifies publishingProfileOptions for publishing profile. For example, use - * {"format": "FileZilla3"} to get a FileZilla publishing profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the publishing profile for an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Flux listPublishingProfileXmlWithSecretsSlotAsync( - String resourceGroupName, String name, String slot, CsmPublishingProfileOptions publishingProfileOptions); - - /** - * Gets the publishing profile for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the publishing profile for - * the production slot. - * @param publishingProfileOptions Specifies publishingProfileOptions for publishing profile. For example, use - * {"format": "FileZilla3"} to get a FileZilla publishing profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the publishing profile for an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - InputStream listPublishingProfileXmlWithSecretsSlot( - String resourceGroupName, String name, String slot, CsmPublishingProfileOptions publishingProfileOptions); - - /** - * Gets the publishing profile for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the publishing profile for - * the production slot. - * @param publishingProfileOptions Specifies publishingProfileOptions for publishing profile. For example, use - * {"format": "FileZilla3"} to get a FileZilla publishing profile. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the publishing profile for an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - StreamResponse listPublishingProfileXmlWithSecretsSlotWithResponse( - String resourceGroupName, - String name, - String slot, - CsmPublishingProfileOptions publishingProfileOptions, - Context context); - - /** - * Resets the configuration settings of the current slot if they were previously modified by calling the API with - * POST. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API resets configuration settings for - * the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> resetSlotConfigurationSlotWithResponseAsync( - String resourceGroupName, String name, String slot); - - /** - * Resets the configuration settings of the current slot if they were previously modified by calling the API with - * POST. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API resets configuration settings for - * the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono resetSlotConfigurationSlotAsync(String resourceGroupName, String name, String slot); - - /** - * Resets the configuration settings of the current slot if they were previously modified by calling the API with - * POST. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API resets configuration settings for - * the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void resetSlotConfigurationSlot(String resourceGroupName, String name, String slot); - - /** - * Resets the configuration settings of the current slot if they were previously modified by calling the API with - * POST. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API resets configuration settings for - * the production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response resetSlotConfigurationSlotWithResponse( - String resourceGroupName, String name, String slot, Context context); - - /** - * Restarts an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will restart the production slot. - * @param softRestart Specify true to apply the configuration settings and restarts the app only if necessary. By - * default, the API always restarts and reprovisions the app. - * @param synchronous Specify true to block until the app is restarted. By default, it is set to false, and the API - * responds immediately (asynchronous). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> restartSlotWithResponseAsync( - String resourceGroupName, String name, String slot, Boolean softRestart, Boolean synchronous); - - /** - * Restarts an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will restart the production slot. - * @param softRestart Specify true to apply the configuration settings and restarts the app only if necessary. By - * default, the API always restarts and reprovisions the app. - * @param synchronous Specify true to block until the app is restarted. By default, it is set to false, and the API - * responds immediately (asynchronous). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono restartSlotAsync( - String resourceGroupName, String name, String slot, Boolean softRestart, Boolean synchronous); - - /** - * Restarts an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will restart the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono restartSlotAsync(String resourceGroupName, String name, String slot); - - /** - * Restarts an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will restart the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void restartSlot(String resourceGroupName, String name, String slot); - - /** - * Restarts an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will restart the production slot. - * @param softRestart Specify true to apply the configuration settings and restarts the app only if necessary. By - * default, the API always restarts and reprovisions the app. - * @param synchronous Specify true to block until the app is restarted. By default, it is set to false, and the API - * responds immediately (asynchronous). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response restartSlotWithResponse( - String resourceGroupName, String name, String slot, Boolean softRestart, Boolean synchronous, Context context); - - /** - * Restores an app from a backup blob in Azure Storage. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will restore a backup of the - * production slot. - * @param request Information on restore request . - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> restoreFromBackupBlobSlotWithResponseAsync( - String resourceGroupName, String name, String slot, RestoreRequestInner request); - - /** - * Restores an app from a backup blob in Azure Storage. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will restore a backup of the - * production slot. - * @param request Information on restore request . - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginRestoreFromBackupBlobSlotAsync( - String resourceGroupName, String name, String slot, RestoreRequestInner request); - - /** - * Restores an app from a backup blob in Azure Storage. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will restore a backup of the - * production slot. - * @param request Information on restore request . - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginRestoreFromBackupBlobSlot( - String resourceGroupName, String name, String slot, RestoreRequestInner request); - - /** - * Restores an app from a backup blob in Azure Storage. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will restore a backup of the - * production slot. - * @param request Information on restore request . - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginRestoreFromBackupBlobSlot( - String resourceGroupName, String name, String slot, RestoreRequestInner request, Context context); - - /** - * Restores an app from a backup blob in Azure Storage. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will restore a backup of the - * production slot. - * @param request Information on restore request . - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono restoreFromBackupBlobSlotAsync( - String resourceGroupName, String name, String slot, RestoreRequestInner request); - - /** - * Restores an app from a backup blob in Azure Storage. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will restore a backup of the - * production slot. - * @param request Information on restore request . - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void restoreFromBackupBlobSlot(String resourceGroupName, String name, String slot, RestoreRequestInner request); - - /** - * Restores an app from a backup blob in Azure Storage. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will restore a backup of the - * production slot. - * @param request Information on restore request . - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void restoreFromBackupBlobSlot( - String resourceGroupName, String name, String slot, RestoreRequestInner request, Context context); - - /** - * Restores a deleted web app to this web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param restoreRequest Deleted web app restore information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> restoreFromDeletedAppSlotWithResponseAsync( - String resourceGroupName, String name, String slot, DeletedAppRestoreRequest restoreRequest); - - /** - * Restores a deleted web app to this web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param restoreRequest Deleted web app restore information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginRestoreFromDeletedAppSlotAsync( - String resourceGroupName, String name, String slot, DeletedAppRestoreRequest restoreRequest); - - /** - * Restores a deleted web app to this web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param restoreRequest Deleted web app restore information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginRestoreFromDeletedAppSlot( - String resourceGroupName, String name, String slot, DeletedAppRestoreRequest restoreRequest); - - /** - * Restores a deleted web app to this web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param restoreRequest Deleted web app restore information. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginRestoreFromDeletedAppSlot( - String resourceGroupName, String name, String slot, DeletedAppRestoreRequest restoreRequest, Context context); - - /** - * Restores a deleted web app to this web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param restoreRequest Deleted web app restore information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono restoreFromDeletedAppSlotAsync( - String resourceGroupName, String name, String slot, DeletedAppRestoreRequest restoreRequest); - - /** - * Restores a deleted web app to this web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param restoreRequest Deleted web app restore information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void restoreFromDeletedAppSlot( - String resourceGroupName, String name, String slot, DeletedAppRestoreRequest restoreRequest); - - /** - * Restores a deleted web app to this web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param restoreRequest Deleted web app restore information. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void restoreFromDeletedAppSlot( - String resourceGroupName, String name, String slot, DeletedAppRestoreRequest restoreRequest, Context context); - - /** - * Restores a web app from a snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param restoreRequest Snapshot restore settings. Snapshot information can be obtained by calling GetDeletedSites - * or GetSiteSnapshots API. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> restoreSnapshotSlotWithResponseAsync( - String resourceGroupName, String name, String slot, SnapshotRestoreRequest restoreRequest); - - /** - * Restores a web app from a snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param restoreRequest Snapshot restore settings. Snapshot information can be obtained by calling GetDeletedSites - * or GetSiteSnapshots API. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginRestoreSnapshotSlotAsync( - String resourceGroupName, String name, String slot, SnapshotRestoreRequest restoreRequest); - - /** - * Restores a web app from a snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param restoreRequest Snapshot restore settings. Snapshot information can be obtained by calling GetDeletedSites - * or GetSiteSnapshots API. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginRestoreSnapshotSlot( - String resourceGroupName, String name, String slot, SnapshotRestoreRequest restoreRequest); - - /** - * Restores a web app from a snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param restoreRequest Snapshot restore settings. Snapshot information can be obtained by calling GetDeletedSites - * or GetSiteSnapshots API. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginRestoreSnapshotSlot( - String resourceGroupName, String name, String slot, SnapshotRestoreRequest restoreRequest, Context context); - - /** - * Restores a web app from a snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param restoreRequest Snapshot restore settings. Snapshot information can be obtained by calling GetDeletedSites - * or GetSiteSnapshots API. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono restoreSnapshotSlotAsync( - String resourceGroupName, String name, String slot, SnapshotRestoreRequest restoreRequest); - - /** - * Restores a web app from a snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param restoreRequest Snapshot restore settings. Snapshot information can be obtained by calling GetDeletedSites - * or GetSiteSnapshots API. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void restoreSnapshotSlot(String resourceGroupName, String name, String slot, SnapshotRestoreRequest restoreRequest); - - /** - * Restores a web app from a snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param restoreRequest Snapshot restore settings. Snapshot information can be obtained by calling GetDeletedSites - * or GetSiteSnapshots API. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void restoreSnapshotSlot( - String resourceGroupName, String name, String slot, SnapshotRestoreRequest restoreRequest, Context context); - - /** - * Get list of siteextensions for a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of siteextensions for a web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listSiteExtensionsSlotAsync(String resourceGroupName, String name, String slot); - - /** - * Get list of siteextensions for a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of siteextensions for a web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listSiteExtensionsSlot(String resourceGroupName, String name, String slot); - - /** - * Get list of siteextensions for a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of siteextensions for a web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listSiteExtensionsSlot( - String resourceGroupName, String name, String slot, Context context); - - /** - * Get site extension information by its ID for a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site extension information by its ID for a web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getSiteExtensionSlotWithResponseAsync( - String resourceGroupName, String name, String siteExtensionId, String slot); - - /** - * Get site extension information by its ID for a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site extension information by its ID for a web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getSiteExtensionSlotAsync( - String resourceGroupName, String name, String siteExtensionId, String slot); - - /** - * Get site extension information by its ID for a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site extension information by its ID for a web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SiteExtensionInfoInner getSiteExtensionSlot( - String resourceGroupName, String name, String siteExtensionId, String slot); - - /** - * Get site extension information by its ID for a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site extension information by its ID for a web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getSiteExtensionSlotWithResponse( - String resourceGroupName, String name, String siteExtensionId, String slot, Context context); - - /** - * Install site extension on a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Extension Information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> installSiteExtensionSlotWithResponseAsync( - String resourceGroupName, String name, String siteExtensionId, String slot); - - /** - * Install site extension on a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Extension Information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, SiteExtensionInfoInner> beginInstallSiteExtensionSlotAsync( - String resourceGroupName, String name, String siteExtensionId, String slot); - - /** - * Install site extension on a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Extension Information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, SiteExtensionInfoInner> beginInstallSiteExtensionSlot( - String resourceGroupName, String name, String siteExtensionId, String slot); - - /** - * Install site extension on a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Extension Information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, SiteExtensionInfoInner> beginInstallSiteExtensionSlot( - String resourceGroupName, String name, String siteExtensionId, String slot, Context context); - - /** - * Install site extension on a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Extension Information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono installSiteExtensionSlotAsync( - String resourceGroupName, String name, String siteExtensionId, String slot); - - /** - * Install site extension on a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Extension Information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SiteExtensionInfoInner installSiteExtensionSlot( - String resourceGroupName, String name, String siteExtensionId, String slot); - - /** - * Install site extension on a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Extension Information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SiteExtensionInfoInner installSiteExtensionSlot( - String resourceGroupName, String name, String siteExtensionId, String slot, Context context); - - /** - * Remove a site extension from a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteSiteExtensionSlotWithResponseAsync( - String resourceGroupName, String name, String siteExtensionId, String slot); - - /** - * Remove a site extension from a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteSiteExtensionSlotAsync(String resourceGroupName, String name, String siteExtensionId, String slot); - - /** - * Remove a site extension from a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deleteSiteExtensionSlot(String resourceGroupName, String name, String siteExtensionId, String slot); - - /** - * Remove a site extension from a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteSiteExtensionSlotWithResponse( - String resourceGroupName, String name, String siteExtensionId, String slot, Context context); - - /** - * Get the difference in configuration settings between two web app slots. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the source slot. If a slot is not specified, the production slot is used as the source slot. - * @param slotSwapEntity JSON object that contains the target slot name. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the difference in configuration settings between two web app slots. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listSlotDifferencesSlotAsync( - String resourceGroupName, String name, String slot, CsmSlotEntity slotSwapEntity); - - /** - * Get the difference in configuration settings between two web app slots. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the source slot. If a slot is not specified, the production slot is used as the source slot. - * @param slotSwapEntity JSON object that contains the target slot name. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the difference in configuration settings between two web app slots. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listSlotDifferencesSlot( - String resourceGroupName, String name, String slot, CsmSlotEntity slotSwapEntity); - - /** - * Get the difference in configuration settings between two web app slots. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the source slot. If a slot is not specified, the production slot is used as the source slot. - * @param slotSwapEntity JSON object that contains the target slot name. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the difference in configuration settings between two web app slots. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listSlotDifferencesSlot( - String resourceGroupName, String name, String slot, CsmSlotEntity slotSwapEntity, Context context); - - /** - * Swaps two deployment slots of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the source slot. If a slot is not specified, the production slot is used as the source slot. - * @param slotSwapEntity JSON object that contains the target slot name. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> swapSlotWithResponseAsync( - String resourceGroupName, String name, String slot, CsmSlotEntity slotSwapEntity); - - /** - * Swaps two deployment slots of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the source slot. If a slot is not specified, the production slot is used as the source slot. - * @param slotSwapEntity JSON object that contains the target slot name. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginSwapSlotAsync( - String resourceGroupName, String name, String slot, CsmSlotEntity slotSwapEntity); - - /** - * Swaps two deployment slots of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the source slot. If a slot is not specified, the production slot is used as the source slot. - * @param slotSwapEntity JSON object that contains the target slot name. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginSwapSlot( - String resourceGroupName, String name, String slot, CsmSlotEntity slotSwapEntity); - - /** - * Swaps two deployment slots of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the source slot. If a slot is not specified, the production slot is used as the source slot. - * @param slotSwapEntity JSON object that contains the target slot name. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginSwapSlot( - String resourceGroupName, String name, String slot, CsmSlotEntity slotSwapEntity, Context context); - - /** - * Swaps two deployment slots of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the source slot. If a slot is not specified, the production slot is used as the source slot. - * @param slotSwapEntity JSON object that contains the target slot name. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono swapSlotAsync(String resourceGroupName, String name, String slot, CsmSlotEntity slotSwapEntity); - - /** - * Swaps two deployment slots of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the source slot. If a slot is not specified, the production slot is used as the source slot. - * @param slotSwapEntity JSON object that contains the target slot name. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void swapSlot(String resourceGroupName, String name, String slot, CsmSlotEntity slotSwapEntity); - - /** - * Swaps two deployment slots of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the source slot. If a slot is not specified, the production slot is used as the source slot. - * @param slotSwapEntity JSON object that contains the target slot name. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void swapSlot(String resourceGroupName, String name, String slot, CsmSlotEntity slotSwapEntity, Context context); - - /** - * Returns all Snapshots to the user. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Website Name. - * @param slot Website Slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of snapshots which can be used to revert an app to a previous time. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listSnapshotsSlotAsync(String resourceGroupName, String name, String slot); - - /** - * Returns all Snapshots to the user. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Website Name. - * @param slot Website Slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of snapshots which can be used to revert an app to a previous time. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listSnapshotsSlot(String resourceGroupName, String name, String slot); - - /** - * Returns all Snapshots to the user. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Website Name. - * @param slot Website Slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of snapshots which can be used to revert an app to a previous time. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listSnapshotsSlot(String resourceGroupName, String name, String slot, Context context); - - /** - * Returns all Snapshots to the user from DRSecondary endpoint. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Website Name. - * @param slot Website Slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of snapshots which can be used to revert an app to a previous time. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listSnapshotsFromDRSecondarySlotAsync(String resourceGroupName, String name, String slot); - - /** - * Returns all Snapshots to the user from DRSecondary endpoint. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Website Name. - * @param slot Website Slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of snapshots which can be used to revert an app to a previous time. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listSnapshotsFromDRSecondarySlot(String resourceGroupName, String name, String slot); - - /** - * Returns all Snapshots to the user from DRSecondary endpoint. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Website Name. - * @param slot Website Slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of snapshots which can be used to revert an app to a previous time. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listSnapshotsFromDRSecondarySlot( - String resourceGroupName, String name, String slot, Context context); - - /** - * Gets the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the source control - * configuration for the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source control configuration of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getSourceControlSlotWithResponseAsync( - String resourceGroupName, String name, String slot); - - /** - * Gets the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the source control - * configuration for the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source control configuration of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getSourceControlSlotAsync(String resourceGroupName, String name, String slot); - - /** - * Gets the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the source control - * configuration for the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source control configuration of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SiteSourceControlInner getSourceControlSlot(String resourceGroupName, String name, String slot); - - /** - * Gets the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the source control - * configuration for the production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source control configuration of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getSourceControlSlotWithResponse( - String resourceGroupName, String name, String slot, Context context); - - /** - * Updates the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the source control - * configuration for the production slot. - * @param siteSourceControl JSON representation of a SiteSourceControl object. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control configuration for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateSourceControlSlotWithResponseAsync( - String resourceGroupName, String name, String slot, SiteSourceControlInner siteSourceControl); - - /** - * Updates the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the source control - * configuration for the production slot. - * @param siteSourceControl JSON representation of a SiteSourceControl object. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control configuration for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, SiteSourceControlInner> beginCreateOrUpdateSourceControlSlotAsync( - String resourceGroupName, String name, String slot, SiteSourceControlInner siteSourceControl); - - /** - * Updates the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the source control - * configuration for the production slot. - * @param siteSourceControl JSON representation of a SiteSourceControl object. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control configuration for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, SiteSourceControlInner> beginCreateOrUpdateSourceControlSlot( - String resourceGroupName, String name, String slot, SiteSourceControlInner siteSourceControl); - - /** - * Updates the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the source control - * configuration for the production slot. - * @param siteSourceControl JSON representation of a SiteSourceControl object. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control configuration for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, SiteSourceControlInner> beginCreateOrUpdateSourceControlSlot( - String resourceGroupName, String name, String slot, SiteSourceControlInner siteSourceControl, Context context); - - /** - * Updates the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the source control - * configuration for the production slot. - * @param siteSourceControl JSON representation of a SiteSourceControl object. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control configuration for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateSourceControlSlotAsync( - String resourceGroupName, String name, String slot, SiteSourceControlInner siteSourceControl); - - /** - * Updates the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the source control - * configuration for the production slot. - * @param siteSourceControl JSON representation of a SiteSourceControl object. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control configuration for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SiteSourceControlInner createOrUpdateSourceControlSlot( - String resourceGroupName, String name, String slot, SiteSourceControlInner siteSourceControl); - - /** - * Updates the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the source control - * configuration for the production slot. - * @param siteSourceControl JSON representation of a SiteSourceControl object. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control configuration for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SiteSourceControlInner createOrUpdateSourceControlSlot( - String resourceGroupName, String name, String slot, SiteSourceControlInner siteSourceControl, Context context); - - /** - * Deletes the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the source control - * configuration for the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteSourceControlSlotWithResponseAsync(String resourceGroupName, String name, String slot); - - /** - * Deletes the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the source control - * configuration for the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteSourceControlSlotAsync(String resourceGroupName, String name, String slot); - - /** - * Deletes the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the source control - * configuration for the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deleteSourceControlSlot(String resourceGroupName, String name, String slot); - - /** - * Deletes the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the source control - * configuration for the production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteSourceControlSlotWithResponse( - String resourceGroupName, String name, String slot, Context context); - - /** - * Updates the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the source control - * configuration for the production slot. - * @param siteSourceControl JSON representation of a SiteSourceControl object. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control configuration for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateSourceControlSlotWithResponseAsync( - String resourceGroupName, String name, String slot, SiteSourceControlInner siteSourceControl); - - /** - * Updates the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the source control - * configuration for the production slot. - * @param siteSourceControl JSON representation of a SiteSourceControl object. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control configuration for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateSourceControlSlotAsync( - String resourceGroupName, String name, String slot, SiteSourceControlInner siteSourceControl); - - /** - * Updates the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the source control - * configuration for the production slot. - * @param siteSourceControl JSON representation of a SiteSourceControl object. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control configuration for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SiteSourceControlInner updateSourceControlSlot( - String resourceGroupName, String name, String slot, SiteSourceControlInner siteSourceControl); - - /** - * Updates the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the source control - * configuration for the production slot. - * @param siteSourceControl JSON representation of a SiteSourceControl object. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control configuration for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateSourceControlSlotWithResponse( - String resourceGroupName, String name, String slot, SiteSourceControlInner siteSourceControl, Context context); - - /** - * Starts an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will start the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> startSlotWithResponseAsync(String resourceGroupName, String name, String slot); - - /** - * Starts an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will start the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono startSlotAsync(String resourceGroupName, String name, String slot); - - /** - * Starts an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will start the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void startSlot(String resourceGroupName, String name, String slot); - - /** - * Starts an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will start the production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response startSlotWithResponse(String resourceGroupName, String name, String slot, Context context); - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> startNetworkTraceSlotWithResponseAsync( - String resourceGroupName, - String name, - String slot, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl); - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Object> beginStartNetworkTraceSlotAsync( - String resourceGroupName, - String name, - String slot, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl); - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Object> beginStartNetworkTraceSlot( - String resourceGroupName, - String name, - String slot, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl); - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Object> beginStartNetworkTraceSlot( - String resourceGroupName, - String name, - String slot, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl, - Context context); - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono startNetworkTraceSlotAsync( - String resourceGroupName, - String name, - String slot, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl); - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono startNetworkTraceSlotAsync(String resourceGroupName, String name, String slot); - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Object startNetworkTraceSlot( - String resourceGroupName, - String name, - String slot, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl); - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Object startNetworkTraceSlot(String resourceGroupName, String name, String slot); - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Object startNetworkTraceSlot( - String resourceGroupName, - String name, - String slot, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl, - Context context); - - /** - * Stops an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will stop the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> stopSlotWithResponseAsync(String resourceGroupName, String name, String slot); - - /** - * Stops an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will stop the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono stopSlotAsync(String resourceGroupName, String name, String slot); - - /** - * Stops an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will stop the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void stopSlot(String resourceGroupName, String name, String slot); - - /** - * Stops an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will stop the production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response stopSlotWithResponse(String resourceGroupName, String name, String slot, Context context); - - /** - * Stop ongoing capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> stopNetworkTraceSlotWithResponseAsync(String resourceGroupName, String name, String slot); - - /** - * Stop ongoing capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono stopNetworkTraceSlotAsync(String resourceGroupName, String name, String slot); - - /** - * Stop ongoing capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void stopNetworkTraceSlot(String resourceGroupName, String name, String slot); - - /** - * Stop ongoing capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response stopNetworkTraceSlotWithResponse( - String resourceGroupName, String name, String slot, Context context); - - /** - * Sync web app repository. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> syncRepositorySlotWithResponseAsync(String resourceGroupName, String name, String slot); - - /** - * Sync web app repository. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono syncRepositorySlotAsync(String resourceGroupName, String name, String slot); - - /** - * Sync web app repository. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void syncRepositorySlot(String resourceGroupName, String name, String slot); - - /** - * Sync web app repository. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response syncRepositorySlotWithResponse(String resourceGroupName, String name, String slot, Context context); - - /** - * Syncs function trigger metadata to the management database. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> syncFunctionTriggersSlotWithResponseAsync(String resourceGroupName, String name, String slot); - - /** - * Syncs function trigger metadata to the management database. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono syncFunctionTriggersSlotAsync(String resourceGroupName, String name, String slot); - - /** - * Syncs function trigger metadata to the management database. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void syncFunctionTriggersSlot(String resourceGroupName, String name, String slot); - - /** - * Syncs function trigger metadata to the management database. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response syncFunctionTriggersSlotWithResponse( - String resourceGroupName, String name, String slot, Context context); - - /** - * List triggered web jobs for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu continuous web job information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listTriggeredWebJobsSlotAsync(String resourceGroupName, String name, String slot); - - /** - * List triggered web jobs for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu continuous web job information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listTriggeredWebJobsSlot(String resourceGroupName, String name, String slot); - - /** - * List triggered web jobs for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu continuous web job information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listTriggeredWebJobsSlot( - String resourceGroupName, String name, String slot, Context context); - - /** - * Gets a triggered web job by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a triggered web job by its ID for an app, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getTriggeredWebJobSlotWithResponseAsync( - String resourceGroupName, String name, String webJobName, String slot); - - /** - * Gets a triggered web job by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a triggered web job by its ID for an app, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getTriggeredWebJobSlotAsync( - String resourceGroupName, String name, String webJobName, String slot); - - /** - * Gets a triggered web job by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a triggered web job by its ID for an app, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - TriggeredWebJobInner getTriggeredWebJobSlot(String resourceGroupName, String name, String webJobName, String slot); - - /** - * Gets a triggered web job by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a triggered web job by its ID for an app, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getTriggeredWebJobSlotWithResponse( - String resourceGroupName, String name, String webJobName, String slot, Context context); - - /** - * Delete a triggered web job by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteTriggeredWebJobSlotWithResponseAsync( - String resourceGroupName, String name, String webJobName, String slot); - - /** - * Delete a triggered web job by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteTriggeredWebJobSlotAsync(String resourceGroupName, String name, String webJobName, String slot); - - /** - * Delete a triggered web job by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deleteTriggeredWebJobSlot(String resourceGroupName, String name, String webJobName, String slot); - - /** - * Delete a triggered web job by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteTriggeredWebJobSlotWithResponse( - String resourceGroupName, String name, String webJobName, String slot, Context context); - - /** - * List a triggered web job's history for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu continuous web job information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listTriggeredWebJobHistorySlotAsync( - String resourceGroupName, String name, String webJobName, String slot); - - /** - * List a triggered web job's history for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu continuous web job information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listTriggeredWebJobHistorySlot( - String resourceGroupName, String name, String webJobName, String slot); - - /** - * List a triggered web job's history for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu continuous web job information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listTriggeredWebJobHistorySlot( - String resourceGroupName, String name, String webJobName, String slot, Context context); - - /** - * Gets a triggered web job's history by its ID for an app, , or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param id History ID. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a triggered web job's history by its ID for an app, , or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getTriggeredWebJobHistorySlotWithResponseAsync( - String resourceGroupName, String name, String webJobName, String id, String slot); - - /** - * Gets a triggered web job's history by its ID for an app, , or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param id History ID. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a triggered web job's history by its ID for an app, , or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getTriggeredWebJobHistorySlotAsync( - String resourceGroupName, String name, String webJobName, String id, String slot); - - /** - * Gets a triggered web job's history by its ID for an app, , or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param id History ID. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a triggered web job's history by its ID for an app, , or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - TriggeredJobHistoryInner getTriggeredWebJobHistorySlot( - String resourceGroupName, String name, String webJobName, String id, String slot); - - /** - * Gets a triggered web job's history by its ID for an app, , or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param id History ID. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a triggered web job's history by its ID for an app, , or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getTriggeredWebJobHistorySlotWithResponse( - String resourceGroupName, String name, String webJobName, String id, String slot, Context context); - - /** - * Run a triggered web job for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> runTriggeredWebJobSlotWithResponseAsync( - String resourceGroupName, String name, String webJobName, String slot); - - /** - * Run a triggered web job for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono runTriggeredWebJobSlotAsync(String resourceGroupName, String name, String webJobName, String slot); - - /** - * Run a triggered web job for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void runTriggeredWebJobSlot(String resourceGroupName, String name, String webJobName, String slot); - - /** - * Run a triggered web job for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response runTriggeredWebJobSlotWithResponse( - String resourceGroupName, String name, String webJobName, String slot, Context context); - - /** - * Gets the quota usage information of an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get quota information of the - * production slot. - * @param filter Return only information specified in the filter (using OData syntax). For example: - * $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and - * endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the quota usage information of an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listUsagesSlotAsync( - String resourceGroupName, String name, String slot, String filter); - - /** - * Gets the quota usage information of an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get quota information of the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the quota usage information of an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listUsagesSlotAsync(String resourceGroupName, String name, String slot); - - /** - * Gets the quota usage information of an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get quota information of the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the quota usage information of an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listUsagesSlot(String resourceGroupName, String name, String slot); - - /** - * Gets the quota usage information of an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get quota information of the - * production slot. - * @param filter Return only information specified in the filter (using OData syntax). For example: - * $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and - * endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the quota usage information of an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listUsagesSlot( - String resourceGroupName, String name, String slot, String filter, Context context); - - /** - * Gets the virtual networks the app (or deployment slot) is connected to. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get virtual network connections - * for the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the virtual networks the app (or deployment slot) is connected to. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> listVnetConnectionsSlotWithResponseAsync( - String resourceGroupName, String name, String slot); - - /** - * Gets the virtual networks the app (or deployment slot) is connected to. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get virtual network connections - * for the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the virtual networks the app (or deployment slot) is connected to. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listVnetConnectionsSlotAsync(String resourceGroupName, String name, String slot); - - /** - * Gets the virtual networks the app (or deployment slot) is connected to. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get virtual network connections - * for the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the virtual networks the app (or deployment slot) is connected to. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - List listVnetConnectionsSlot(String resourceGroupName, String name, String slot); - - /** - * Gets the virtual networks the app (or deployment slot) is connected to. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get virtual network connections - * for the production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the virtual networks the app (or deployment slot) is connected to. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response> listVnetConnectionsSlotWithResponse( - String resourceGroupName, String name, String slot, Context context); - - /** - * Gets a virtual network the app (or deployment slot) is connected to by name. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the virtual network. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the named virtual network - * for the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual network the app (or deployment slot) is connected to by name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getVnetConnectionSlotWithResponseAsync( - String resourceGroupName, String name, String vnetName, String slot); - - /** - * Gets a virtual network the app (or deployment slot) is connected to by name. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the virtual network. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the named virtual network - * for the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual network the app (or deployment slot) is connected to by name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getVnetConnectionSlotAsync(String resourceGroupName, String name, String vnetName, String slot); - - /** - * Gets a virtual network the app (or deployment slot) is connected to by name. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the virtual network. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the named virtual network - * for the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual network the app (or deployment slot) is connected to by name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VnetInfoInner getVnetConnectionSlot(String resourceGroupName, String name, String vnetName, String slot); - - /** - * Gets a virtual network the app (or deployment slot) is connected to by name. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the virtual network. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the named virtual network - * for the production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual network the app (or deployment slot) is connected to by name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getVnetConnectionSlotWithResponse( - String resourceGroupName, String name, String vnetName, String slot, Context context); - - /** - * Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of an existing Virtual Network. - * @param slot Name of the deployment slot. If a slot is not specified, the API will add or update connections for - * the production slot. - * @param connectionEnvelope Properties of the Virtual Network connection. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network information contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createOrUpdateVnetConnectionSlotWithResponseAsync( - String resourceGroupName, String name, String vnetName, String slot, VnetInfoInner connectionEnvelope); - - /** - * Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of an existing Virtual Network. - * @param slot Name of the deployment slot. If a slot is not specified, the API will add or update connections for - * the production slot. - * @param connectionEnvelope Properties of the Virtual Network connection. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network information contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateVnetConnectionSlotAsync( - String resourceGroupName, String name, String vnetName, String slot, VnetInfoInner connectionEnvelope); - - /** - * Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of an existing Virtual Network. - * @param slot Name of the deployment slot. If a slot is not specified, the API will add or update connections for - * the production slot. - * @param connectionEnvelope Properties of the Virtual Network connection. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network information contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VnetInfoInner createOrUpdateVnetConnectionSlot( - String resourceGroupName, String name, String vnetName, String slot, VnetInfoInner connectionEnvelope); - - /** - * Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of an existing Virtual Network. - * @param slot Name of the deployment slot. If a slot is not specified, the API will add or update connections for - * the production slot. - * @param connectionEnvelope Properties of the Virtual Network connection. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network information contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateVnetConnectionSlotWithResponse( - String resourceGroupName, - String name, - String vnetName, - String slot, - VnetInfoInner connectionEnvelope, - Context context); - - /** - * Deletes a connection from an app (or deployment slot to a named virtual network. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the virtual network. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the connection for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteVnetConnectionSlotWithResponseAsync( - String resourceGroupName, String name, String vnetName, String slot); - - /** - * Deletes a connection from an app (or deployment slot to a named virtual network. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the virtual network. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the connection for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteVnetConnectionSlotAsync(String resourceGroupName, String name, String vnetName, String slot); - - /** - * Deletes a connection from an app (or deployment slot to a named virtual network. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the virtual network. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the connection for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deleteVnetConnectionSlot(String resourceGroupName, String name, String vnetName, String slot); - - /** - * Deletes a connection from an app (or deployment slot to a named virtual network. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the virtual network. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the connection for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteVnetConnectionSlotWithResponse( - String resourceGroupName, String name, String vnetName, String slot, Context context); - - /** - * Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of an existing Virtual Network. - * @param slot Name of the deployment slot. If a slot is not specified, the API will add or update connections for - * the production slot. - * @param connectionEnvelope Properties of the Virtual Network connection. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network information contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateVnetConnectionSlotWithResponseAsync( - String resourceGroupName, String name, String vnetName, String slot, VnetInfoInner connectionEnvelope); - - /** - * Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of an existing Virtual Network. - * @param slot Name of the deployment slot. If a slot is not specified, the API will add or update connections for - * the production slot. - * @param connectionEnvelope Properties of the Virtual Network connection. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network information contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateVnetConnectionSlotAsync( - String resourceGroupName, String name, String vnetName, String slot, VnetInfoInner connectionEnvelope); - - /** - * Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of an existing Virtual Network. - * @param slot Name of the deployment slot. If a slot is not specified, the API will add or update connections for - * the production slot. - * @param connectionEnvelope Properties of the Virtual Network connection. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network information contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VnetInfoInner updateVnetConnectionSlot( - String resourceGroupName, String name, String vnetName, String slot, VnetInfoInner connectionEnvelope); - - /** - * Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of an existing Virtual Network. - * @param slot Name of the deployment slot. If a slot is not specified, the API will add or update connections for - * the production slot. - * @param connectionEnvelope Properties of the Virtual Network connection. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network information contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateVnetConnectionSlotWithResponse( - String resourceGroupName, - String name, - String vnetName, - String slot, - VnetInfoInner connectionEnvelope, - Context context); - - /** - * Gets an app's Virtual Network gateway. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the Virtual Network. - * @param gatewayName Name of the gateway. Currently, the only supported string is "primary". - * @param slot Name of the deployment slot. If a slot is not specified, the API will get a gateway for the - * production slot's Virtual Network. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an app's Virtual Network gateway. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getVnetConnectionGatewaySlotWithResponseAsync( - String resourceGroupName, String name, String vnetName, String gatewayName, String slot); - - /** - * Gets an app's Virtual Network gateway. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the Virtual Network. - * @param gatewayName Name of the gateway. Currently, the only supported string is "primary". - * @param slot Name of the deployment slot. If a slot is not specified, the API will get a gateway for the - * production slot's Virtual Network. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an app's Virtual Network gateway. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getVnetConnectionGatewaySlotAsync( - String resourceGroupName, String name, String vnetName, String gatewayName, String slot); - - /** - * Gets an app's Virtual Network gateway. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the Virtual Network. - * @param gatewayName Name of the gateway. Currently, the only supported string is "primary". - * @param slot Name of the deployment slot. If a slot is not specified, the API will get a gateway for the - * production slot's Virtual Network. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an app's Virtual Network gateway. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VnetGatewayInner getVnetConnectionGatewaySlot( - String resourceGroupName, String name, String vnetName, String gatewayName, String slot); - - /** - * Gets an app's Virtual Network gateway. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the Virtual Network. - * @param gatewayName Name of the gateway. Currently, the only supported string is "primary". - * @param slot Name of the deployment slot. If a slot is not specified, the API will get a gateway for the - * production slot's Virtual Network. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an app's Virtual Network gateway. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getVnetConnectionGatewaySlotWithResponse( - String resourceGroupName, String name, String vnetName, String gatewayName, String slot, Context context); - - /** - * Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the Virtual Network. - * @param gatewayName Name of the gateway. Currently, the only supported string is "primary". - * @param slot Name of the deployment slot. If a slot is not specified, the API will add or update a gateway for the - * production slot's Virtual Network. - * @param connectionEnvelope The properties to update this gateway with. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Virtual Network gateway contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createOrUpdateVnetConnectionGatewaySlotWithResponseAsync( - String resourceGroupName, - String name, - String vnetName, - String gatewayName, - String slot, - VnetGatewayInner connectionEnvelope); - - /** - * Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the Virtual Network. - * @param gatewayName Name of the gateway. Currently, the only supported string is "primary". - * @param slot Name of the deployment slot. If a slot is not specified, the API will add or update a gateway for the - * production slot's Virtual Network. - * @param connectionEnvelope The properties to update this gateway with. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Virtual Network gateway contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateVnetConnectionGatewaySlotAsync( - String resourceGroupName, - String name, - String vnetName, - String gatewayName, - String slot, - VnetGatewayInner connectionEnvelope); - - /** - * Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the Virtual Network. - * @param gatewayName Name of the gateway. Currently, the only supported string is "primary". - * @param slot Name of the deployment slot. If a slot is not specified, the API will add or update a gateway for the - * production slot's Virtual Network. - * @param connectionEnvelope The properties to update this gateway with. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Virtual Network gateway contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VnetGatewayInner createOrUpdateVnetConnectionGatewaySlot( - String resourceGroupName, - String name, - String vnetName, - String gatewayName, - String slot, - VnetGatewayInner connectionEnvelope); - - /** - * Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the Virtual Network. - * @param gatewayName Name of the gateway. Currently, the only supported string is "primary". - * @param slot Name of the deployment slot. If a slot is not specified, the API will add or update a gateway for the - * production slot's Virtual Network. - * @param connectionEnvelope The properties to update this gateway with. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Virtual Network gateway contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateVnetConnectionGatewaySlotWithResponse( - String resourceGroupName, - String name, - String vnetName, - String gatewayName, - String slot, - VnetGatewayInner connectionEnvelope, - Context context); - - /** - * Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the Virtual Network. - * @param gatewayName Name of the gateway. Currently, the only supported string is "primary". - * @param slot Name of the deployment slot. If a slot is not specified, the API will add or update a gateway for the - * production slot's Virtual Network. - * @param connectionEnvelope The properties to update this gateway with. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Virtual Network gateway contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateVnetConnectionGatewaySlotWithResponseAsync( - String resourceGroupName, - String name, - String vnetName, - String gatewayName, - String slot, - VnetGatewayInner connectionEnvelope); - - /** - * Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the Virtual Network. - * @param gatewayName Name of the gateway. Currently, the only supported string is "primary". - * @param slot Name of the deployment slot. If a slot is not specified, the API will add or update a gateway for the - * production slot's Virtual Network. - * @param connectionEnvelope The properties to update this gateway with. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Virtual Network gateway contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateVnetConnectionGatewaySlotAsync( - String resourceGroupName, - String name, - String vnetName, - String gatewayName, - String slot, - VnetGatewayInner connectionEnvelope); - - /** - * Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the Virtual Network. - * @param gatewayName Name of the gateway. Currently, the only supported string is "primary". - * @param slot Name of the deployment slot. If a slot is not specified, the API will add or update a gateway for the - * production slot's Virtual Network. - * @param connectionEnvelope The properties to update this gateway with. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Virtual Network gateway contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VnetGatewayInner updateVnetConnectionGatewaySlot( - String resourceGroupName, - String name, - String vnetName, - String gatewayName, - String slot, - VnetGatewayInner connectionEnvelope); - - /** - * Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the Virtual Network. - * @param gatewayName Name of the gateway. Currently, the only supported string is "primary". - * @param slot Name of the deployment slot. If a slot is not specified, the API will add or update a gateway for the - * production slot's Virtual Network. - * @param connectionEnvelope The properties to update this gateway with. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Virtual Network gateway contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateVnetConnectionGatewaySlotWithResponse( - String resourceGroupName, - String name, - String vnetName, - String gatewayName, - String slot, - VnetGatewayInner connectionEnvelope, - Context context); - - /** - * List webjobs for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu web job information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listWebJobsSlotAsync(String resourceGroupName, String name, String slot); - - /** - * List webjobs for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu web job information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listWebJobsSlot(String resourceGroupName, String name, String slot); - - /** - * List webjobs for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu web job information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listWebJobsSlot(String resourceGroupName, String name, String slot, Context context); - - /** - * Get webjob information for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of the web job. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return webjob information for an app, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWebJobSlotWithResponseAsync( - String resourceGroupName, String name, String webJobName, String slot); - - /** - * Get webjob information for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of the web job. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return webjob information for an app, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getWebJobSlotAsync(String resourceGroupName, String name, String webJobName, String slot); - - /** - * Get webjob information for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of the web job. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return webjob information for an app, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - WebJobInner getWebJobSlot(String resourceGroupName, String name, String webJobName, String slot); - - /** - * Get webjob information for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of the web job. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return webjob information for an app, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWebJobSlotWithResponse( - String resourceGroupName, String name, String webJobName, String slot, Context context); - - /** - * Get the difference in configuration settings between two web app slots. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slotSwapEntity JSON object that contains the target slot name. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the difference in configuration settings between two web app slots. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listSlotDifferencesFromProductionAsync( - String resourceGroupName, String name, CsmSlotEntity slotSwapEntity); - - /** - * Get the difference in configuration settings between two web app slots. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slotSwapEntity JSON object that contains the target slot name. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the difference in configuration settings between two web app slots. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listSlotDifferencesFromProduction( - String resourceGroupName, String name, CsmSlotEntity slotSwapEntity); - - /** - * Get the difference in configuration settings between two web app slots. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slotSwapEntity JSON object that contains the target slot name. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the difference in configuration settings between two web app slots. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listSlotDifferencesFromProduction( - String resourceGroupName, String name, CsmSlotEntity slotSwapEntity, Context context); - - /** - * Swaps two deployment slots of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slotSwapEntity JSON object that contains the target slot name. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> swapSlotWithProductionWithResponseAsync( - String resourceGroupName, String name, CsmSlotEntity slotSwapEntity); - - /** - * Swaps two deployment slots of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slotSwapEntity JSON object that contains the target slot name. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginSwapSlotWithProductionAsync( - String resourceGroupName, String name, CsmSlotEntity slotSwapEntity); - - /** - * Swaps two deployment slots of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slotSwapEntity JSON object that contains the target slot name. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginSwapSlotWithProduction( - String resourceGroupName, String name, CsmSlotEntity slotSwapEntity); - - /** - * Swaps two deployment slots of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slotSwapEntity JSON object that contains the target slot name. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginSwapSlotWithProduction( - String resourceGroupName, String name, CsmSlotEntity slotSwapEntity, Context context); - - /** - * Swaps two deployment slots of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slotSwapEntity JSON object that contains the target slot name. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono swapSlotWithProductionAsync(String resourceGroupName, String name, CsmSlotEntity slotSwapEntity); - - /** - * Swaps two deployment slots of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slotSwapEntity JSON object that contains the target slot name. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void swapSlotWithProduction(String resourceGroupName, String name, CsmSlotEntity slotSwapEntity); - - /** - * Swaps two deployment slots of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slotSwapEntity JSON object that contains the target slot name. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void swapSlotWithProduction(String resourceGroupName, String name, CsmSlotEntity slotSwapEntity, Context context); - - /** - * Returns all Snapshots to the user. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Website Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of snapshots which can be used to revert an app to a previous time. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listSnapshotsAsync(String resourceGroupName, String name); - - /** - * Returns all Snapshots to the user. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Website Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of snapshots which can be used to revert an app to a previous time. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listSnapshots(String resourceGroupName, String name); - - /** - * Returns all Snapshots to the user. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Website Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of snapshots which can be used to revert an app to a previous time. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listSnapshots(String resourceGroupName, String name, Context context); - - /** - * Returns all Snapshots to the user from DRSecondary endpoint. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Website Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of snapshots which can be used to revert an app to a previous time. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listSnapshotsFromDRSecondaryAsync(String resourceGroupName, String name); - - /** - * Returns all Snapshots to the user from DRSecondary endpoint. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Website Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of snapshots which can be used to revert an app to a previous time. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listSnapshotsFromDRSecondary(String resourceGroupName, String name); - - /** - * Returns all Snapshots to the user from DRSecondary endpoint. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Website Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of snapshots which can be used to revert an app to a previous time. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listSnapshotsFromDRSecondary(String resourceGroupName, String name, Context context); - - /** - * Gets the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source control configuration of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getSourceControlWithResponseAsync(String resourceGroupName, String name); - - /** - * Gets the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source control configuration of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getSourceControlAsync(String resourceGroupName, String name); - - /** - * Gets the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source control configuration of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SiteSourceControlInner getSourceControl(String resourceGroupName, String name); - - /** - * Gets the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source control configuration of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getSourceControlWithResponse( - String resourceGroupName, String name, Context context); - - /** - * Updates the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param siteSourceControl JSON representation of a SiteSourceControl object. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control configuration for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateSourceControlWithResponseAsync( - String resourceGroupName, String name, SiteSourceControlInner siteSourceControl); - - /** - * Updates the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param siteSourceControl JSON representation of a SiteSourceControl object. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control configuration for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, SiteSourceControlInner> beginCreateOrUpdateSourceControlAsync( - String resourceGroupName, String name, SiteSourceControlInner siteSourceControl); - - /** - * Updates the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param siteSourceControl JSON representation of a SiteSourceControl object. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control configuration for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, SiteSourceControlInner> beginCreateOrUpdateSourceControl( - String resourceGroupName, String name, SiteSourceControlInner siteSourceControl); - - /** - * Updates the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param siteSourceControl JSON representation of a SiteSourceControl object. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control configuration for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, SiteSourceControlInner> beginCreateOrUpdateSourceControl( - String resourceGroupName, String name, SiteSourceControlInner siteSourceControl, Context context); - - /** - * Updates the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param siteSourceControl JSON representation of a SiteSourceControl object. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control configuration for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateSourceControlAsync( - String resourceGroupName, String name, SiteSourceControlInner siteSourceControl); - - /** - * Updates the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param siteSourceControl JSON representation of a SiteSourceControl object. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control configuration for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SiteSourceControlInner createOrUpdateSourceControl( - String resourceGroupName, String name, SiteSourceControlInner siteSourceControl); - - /** - * Updates the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param siteSourceControl JSON representation of a SiteSourceControl object. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control configuration for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SiteSourceControlInner createOrUpdateSourceControl( - String resourceGroupName, String name, SiteSourceControlInner siteSourceControl, Context context); - - /** - * Deletes the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteSourceControlWithResponseAsync(String resourceGroupName, String name); - - /** - * Deletes the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteSourceControlAsync(String resourceGroupName, String name); - - /** - * Deletes the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deleteSourceControl(String resourceGroupName, String name); - - /** - * Deletes the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteSourceControlWithResponse(String resourceGroupName, String name, Context context); - - /** - * Updates the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param siteSourceControl JSON representation of a SiteSourceControl object. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control configuration for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateSourceControlWithResponseAsync( - String resourceGroupName, String name, SiteSourceControlInner siteSourceControl); - - /** - * Updates the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param siteSourceControl JSON representation of a SiteSourceControl object. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control configuration for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateSourceControlAsync( - String resourceGroupName, String name, SiteSourceControlInner siteSourceControl); - - /** - * Updates the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param siteSourceControl JSON representation of a SiteSourceControl object. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control configuration for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SiteSourceControlInner updateSourceControl( - String resourceGroupName, String name, SiteSourceControlInner siteSourceControl); - - /** - * Updates the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param siteSourceControl JSON representation of a SiteSourceControl object. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control configuration for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateSourceControlWithResponse( - String resourceGroupName, String name, SiteSourceControlInner siteSourceControl, Context context); - - /** - * Starts an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> startWithResponseAsync(String resourceGroupName, String name); - - /** - * Starts an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono startAsync(String resourceGroupName, String name); - - /** - * Starts an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void start(String resourceGroupName, String name); - - /** - * Starts an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response startWithResponse(String resourceGroupName, String name, Context context); - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> startNetworkTraceWithResponseAsync( - String resourceGroupName, String name, Integer durationInSeconds, Integer maxFrameLength, String sasUrl); - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Object> beginStartNetworkTraceAsync( - String resourceGroupName, String name, Integer durationInSeconds, Integer maxFrameLength, String sasUrl); - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Object> beginStartNetworkTrace( - String resourceGroupName, String name, Integer durationInSeconds, Integer maxFrameLength, String sasUrl); - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Object> beginStartNetworkTrace( - String resourceGroupName, - String name, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl, - Context context); - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono startNetworkTraceAsync( - String resourceGroupName, String name, Integer durationInSeconds, Integer maxFrameLength, String sasUrl); - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono startNetworkTraceAsync(String resourceGroupName, String name); - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Object startNetworkTrace( - String resourceGroupName, String name, Integer durationInSeconds, Integer maxFrameLength, String sasUrl); - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Object startNetworkTrace(String resourceGroupName, String name); - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Object startNetworkTrace( - String resourceGroupName, - String name, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl, - Context context); - - /** - * Stops an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> stopWithResponseAsync(String resourceGroupName, String name); - - /** - * Stops an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono stopAsync(String resourceGroupName, String name); - - /** - * Stops an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void stop(String resourceGroupName, String name); - - /** - * Stops an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response stopWithResponse(String resourceGroupName, String name, Context context); - - /** - * Stop ongoing capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> stopNetworkTraceWithResponseAsync(String resourceGroupName, String name); - - /** - * Stop ongoing capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono stopNetworkTraceAsync(String resourceGroupName, String name); - - /** - * Stop ongoing capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void stopNetworkTrace(String resourceGroupName, String name); - - /** - * Stop ongoing capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response stopNetworkTraceWithResponse(String resourceGroupName, String name, Context context); - - /** - * Sync web app repository. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> syncRepositoryWithResponseAsync(String resourceGroupName, String name); - - /** - * Sync web app repository. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono syncRepositoryAsync(String resourceGroupName, String name); - - /** - * Sync web app repository. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void syncRepository(String resourceGroupName, String name); - - /** - * Sync web app repository. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response syncRepositoryWithResponse(String resourceGroupName, String name, Context context); - - /** - * Syncs function trigger metadata to the management database. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> syncFunctionTriggersWithResponseAsync(String resourceGroupName, String name); - - /** - * Syncs function trigger metadata to the management database. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono syncFunctionTriggersAsync(String resourceGroupName, String name); - - /** - * Syncs function trigger metadata to the management database. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void syncFunctionTriggers(String resourceGroupName, String name); - - /** - * Syncs function trigger metadata to the management database. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response syncFunctionTriggersWithResponse(String resourceGroupName, String name, Context context); - - /** - * List triggered web jobs for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu continuous web job information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listTriggeredWebJobsAsync(String resourceGroupName, String name); - - /** - * List triggered web jobs for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu continuous web job information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listTriggeredWebJobs(String resourceGroupName, String name); - - /** - * List triggered web jobs for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu continuous web job information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listTriggeredWebJobs(String resourceGroupName, String name, Context context); - - /** - * Gets a triggered web job by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a triggered web job by its ID for an app, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getTriggeredWebJobWithResponseAsync( - String resourceGroupName, String name, String webJobName); - - /** - * Gets a triggered web job by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a triggered web job by its ID for an app, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getTriggeredWebJobAsync(String resourceGroupName, String name, String webJobName); - - /** - * Gets a triggered web job by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a triggered web job by its ID for an app, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - TriggeredWebJobInner getTriggeredWebJob(String resourceGroupName, String name, String webJobName); - - /** - * Gets a triggered web job by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a triggered web job by its ID for an app, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getTriggeredWebJobWithResponse( - String resourceGroupName, String name, String webJobName, Context context); - - /** - * Delete a triggered web job by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteTriggeredWebJobWithResponseAsync( - String resourceGroupName, String name, String webJobName); - - /** - * Delete a triggered web job by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteTriggeredWebJobAsync(String resourceGroupName, String name, String webJobName); - - /** - * Delete a triggered web job by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deleteTriggeredWebJob(String resourceGroupName, String name, String webJobName); - - /** - * Delete a triggered web job by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteTriggeredWebJobWithResponse( - String resourceGroupName, String name, String webJobName, Context context); - - /** - * List a triggered web job's history for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu continuous web job information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listTriggeredWebJobHistoryAsync( - String resourceGroupName, String name, String webJobName); - - /** - * List a triggered web job's history for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu continuous web job information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listTriggeredWebJobHistory( - String resourceGroupName, String name, String webJobName); - - /** - * List a triggered web job's history for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu continuous web job information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listTriggeredWebJobHistory( - String resourceGroupName, String name, String webJobName, Context context); - - /** - * Gets a triggered web job's history by its ID for an app, , or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param id History ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a triggered web job's history by its ID for an app, , or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getTriggeredWebJobHistoryWithResponseAsync( - String resourceGroupName, String name, String webJobName, String id); - - /** - * Gets a triggered web job's history by its ID for an app, , or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param id History ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a triggered web job's history by its ID for an app, , or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getTriggeredWebJobHistoryAsync( - String resourceGroupName, String name, String webJobName, String id); - - /** - * Gets a triggered web job's history by its ID for an app, , or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param id History ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a triggered web job's history by its ID for an app, , or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - TriggeredJobHistoryInner getTriggeredWebJobHistory( - String resourceGroupName, String name, String webJobName, String id); - - /** - * Gets a triggered web job's history by its ID for an app, , or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param id History ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a triggered web job's history by its ID for an app, , or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getTriggeredWebJobHistoryWithResponse( - String resourceGroupName, String name, String webJobName, String id, Context context); - - /** - * Run a triggered web job for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> runTriggeredWebJobWithResponseAsync(String resourceGroupName, String name, String webJobName); - - /** - * Run a triggered web job for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono runTriggeredWebJobAsync(String resourceGroupName, String name, String webJobName); - - /** - * Run a triggered web job for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void runTriggeredWebJob(String resourceGroupName, String name, String webJobName); - - /** - * Run a triggered web job for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response runTriggeredWebJobWithResponse( - String resourceGroupName, String name, String webJobName, Context context); - - /** - * Gets the quota usage information of an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param filter Return only information specified in the filter (using OData syntax). For example: - * $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and - * endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the quota usage information of an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listUsagesAsync(String resourceGroupName, String name, String filter); - - /** - * Gets the quota usage information of an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the quota usage information of an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listUsagesAsync(String resourceGroupName, String name); - - /** - * Gets the quota usage information of an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the quota usage information of an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listUsages(String resourceGroupName, String name); - - /** - * Gets the quota usage information of an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param filter Return only information specified in the filter (using OData syntax). For example: - * $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and - * endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the quota usage information of an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listUsages(String resourceGroupName, String name, String filter, Context context); - - /** - * Gets the virtual networks the app (or deployment slot) is connected to. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the virtual networks the app (or deployment slot) is connected to. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> listVnetConnectionsWithResponseAsync(String resourceGroupName, String name); - - /** - * Gets the virtual networks the app (or deployment slot) is connected to. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the virtual networks the app (or deployment slot) is connected to. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listVnetConnectionsAsync(String resourceGroupName, String name); - - /** - * Gets the virtual networks the app (or deployment slot) is connected to. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the virtual networks the app (or deployment slot) is connected to. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - List listVnetConnections(String resourceGroupName, String name); - - /** - * Gets the virtual networks the app (or deployment slot) is connected to. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the virtual networks the app (or deployment slot) is connected to. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response> listVnetConnectionsWithResponse( - String resourceGroupName, String name, Context context); - - /** - * Gets a virtual network the app (or deployment slot) is connected to by name. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the virtual network. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual network the app (or deployment slot) is connected to by name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getVnetConnectionWithResponseAsync( - String resourceGroupName, String name, String vnetName); - - /** - * Gets a virtual network the app (or deployment slot) is connected to by name. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the virtual network. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual network the app (or deployment slot) is connected to by name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getVnetConnectionAsync(String resourceGroupName, String name, String vnetName); - - /** - * Gets a virtual network the app (or deployment slot) is connected to by name. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the virtual network. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual network the app (or deployment slot) is connected to by name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VnetInfoInner getVnetConnection(String resourceGroupName, String name, String vnetName); - - /** - * Gets a virtual network the app (or deployment slot) is connected to by name. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the virtual network. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual network the app (or deployment slot) is connected to by name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getVnetConnectionWithResponse( - String resourceGroupName, String name, String vnetName, Context context); - - /** - * Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of an existing Virtual Network. - * @param connectionEnvelope Properties of the Virtual Network connection. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network information contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createOrUpdateVnetConnectionWithResponseAsync( - String resourceGroupName, String name, String vnetName, VnetInfoInner connectionEnvelope); - - /** - * Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of an existing Virtual Network. - * @param connectionEnvelope Properties of the Virtual Network connection. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network information contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateVnetConnectionAsync( - String resourceGroupName, String name, String vnetName, VnetInfoInner connectionEnvelope); - - /** - * Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of an existing Virtual Network. - * @param connectionEnvelope Properties of the Virtual Network connection. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network information contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VnetInfoInner createOrUpdateVnetConnection( - String resourceGroupName, String name, String vnetName, VnetInfoInner connectionEnvelope); - - /** - * Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of an existing Virtual Network. - * @param connectionEnvelope Properties of the Virtual Network connection. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network information contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateVnetConnectionWithResponse( - String resourceGroupName, String name, String vnetName, VnetInfoInner connectionEnvelope, Context context); - - /** - * Deletes a connection from an app (or deployment slot to a named virtual network. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the virtual network. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteVnetConnectionWithResponseAsync(String resourceGroupName, String name, String vnetName); - - /** - * Deletes a connection from an app (or deployment slot to a named virtual network. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the virtual network. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteVnetConnectionAsync(String resourceGroupName, String name, String vnetName); - - /** - * Deletes a connection from an app (or deployment slot to a named virtual network. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the virtual network. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deleteVnetConnection(String resourceGroupName, String name, String vnetName); - - /** - * Deletes a connection from an app (or deployment slot to a named virtual network. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the virtual network. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteVnetConnectionWithResponse( - String resourceGroupName, String name, String vnetName, Context context); - - /** - * Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of an existing Virtual Network. - * @param connectionEnvelope Properties of the Virtual Network connection. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network information contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateVnetConnectionWithResponseAsync( - String resourceGroupName, String name, String vnetName, VnetInfoInner connectionEnvelope); - - /** - * Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of an existing Virtual Network. - * @param connectionEnvelope Properties of the Virtual Network connection. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network information contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateVnetConnectionAsync( - String resourceGroupName, String name, String vnetName, VnetInfoInner connectionEnvelope); - - /** - * Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of an existing Virtual Network. - * @param connectionEnvelope Properties of the Virtual Network connection. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network information contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VnetInfoInner updateVnetConnection( - String resourceGroupName, String name, String vnetName, VnetInfoInner connectionEnvelope); - - /** - * Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of an existing Virtual Network. - * @param connectionEnvelope Properties of the Virtual Network connection. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network information contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateVnetConnectionWithResponse( - String resourceGroupName, String name, String vnetName, VnetInfoInner connectionEnvelope, Context context); - - /** - * Gets an app's Virtual Network gateway. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the Virtual Network. - * @param gatewayName Name of the gateway. Currently, the only supported string is "primary". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an app's Virtual Network gateway. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getVnetConnectionGatewayWithResponseAsync( - String resourceGroupName, String name, String vnetName, String gatewayName); - - /** - * Gets an app's Virtual Network gateway. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the Virtual Network. - * @param gatewayName Name of the gateway. Currently, the only supported string is "primary". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an app's Virtual Network gateway. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getVnetConnectionGatewayAsync( - String resourceGroupName, String name, String vnetName, String gatewayName); - - /** - * Gets an app's Virtual Network gateway. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the Virtual Network. - * @param gatewayName Name of the gateway. Currently, the only supported string is "primary". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an app's Virtual Network gateway. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VnetGatewayInner getVnetConnectionGateway( - String resourceGroupName, String name, String vnetName, String gatewayName); - - /** - * Gets an app's Virtual Network gateway. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the Virtual Network. - * @param gatewayName Name of the gateway. Currently, the only supported string is "primary". - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an app's Virtual Network gateway. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getVnetConnectionGatewayWithResponse( - String resourceGroupName, String name, String vnetName, String gatewayName, Context context); - - /** - * Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the Virtual Network. - * @param gatewayName Name of the gateway. Currently, the only supported string is "primary". - * @param connectionEnvelope The properties to update this gateway with. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Virtual Network gateway contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createOrUpdateVnetConnectionGatewayWithResponseAsync( - String resourceGroupName, - String name, - String vnetName, - String gatewayName, - VnetGatewayInner connectionEnvelope); - - /** - * Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the Virtual Network. - * @param gatewayName Name of the gateway. Currently, the only supported string is "primary". - * @param connectionEnvelope The properties to update this gateway with. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Virtual Network gateway contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateVnetConnectionGatewayAsync( - String resourceGroupName, - String name, - String vnetName, - String gatewayName, - VnetGatewayInner connectionEnvelope); - - /** - * Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the Virtual Network. - * @param gatewayName Name of the gateway. Currently, the only supported string is "primary". - * @param connectionEnvelope The properties to update this gateway with. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Virtual Network gateway contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VnetGatewayInner createOrUpdateVnetConnectionGateway( - String resourceGroupName, - String name, - String vnetName, - String gatewayName, - VnetGatewayInner connectionEnvelope); - - /** - * Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the Virtual Network. - * @param gatewayName Name of the gateway. Currently, the only supported string is "primary". - * @param connectionEnvelope The properties to update this gateway with. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Virtual Network gateway contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateVnetConnectionGatewayWithResponse( - String resourceGroupName, - String name, - String vnetName, - String gatewayName, - VnetGatewayInner connectionEnvelope, - Context context); - - /** - * Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the Virtual Network. - * @param gatewayName Name of the gateway. Currently, the only supported string is "primary". - * @param connectionEnvelope The properties to update this gateway with. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Virtual Network gateway contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateVnetConnectionGatewayWithResponseAsync( - String resourceGroupName, - String name, - String vnetName, - String gatewayName, - VnetGatewayInner connectionEnvelope); - - /** - * Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the Virtual Network. - * @param gatewayName Name of the gateway. Currently, the only supported string is "primary". - * @param connectionEnvelope The properties to update this gateway with. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Virtual Network gateway contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateVnetConnectionGatewayAsync( - String resourceGroupName, - String name, - String vnetName, - String gatewayName, - VnetGatewayInner connectionEnvelope); - - /** - * Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the Virtual Network. - * @param gatewayName Name of the gateway. Currently, the only supported string is "primary". - * @param connectionEnvelope The properties to update this gateway with. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Virtual Network gateway contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VnetGatewayInner updateVnetConnectionGateway( - String resourceGroupName, - String name, - String vnetName, - String gatewayName, - VnetGatewayInner connectionEnvelope); - - /** - * Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the Virtual Network. - * @param gatewayName Name of the gateway. Currently, the only supported string is "primary". - * @param connectionEnvelope The properties to update this gateway with. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Virtual Network gateway contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateVnetConnectionGatewayWithResponse( - String resourceGroupName, - String name, - String vnetName, - String gatewayName, - VnetGatewayInner connectionEnvelope, - Context context); - - /** - * List webjobs for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu web job information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listWebJobsAsync(String resourceGroupName, String name); - - /** - * List webjobs for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu web job information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listWebJobs(String resourceGroupName, String name); - - /** - * List webjobs for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu web job information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listWebJobs(String resourceGroupName, String name, Context context); - - /** - * Get webjob information for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of the web job. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return webjob information for an app, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWebJobWithResponseAsync(String resourceGroupName, String name, String webJobName); - - /** - * Get webjob information for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of the web job. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return webjob information for an app, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getWebJobAsync(String resourceGroupName, String name, String webJobName); - - /** - * Get webjob information for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of the web job. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return webjob information for an app, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - WebJobInner getWebJob(String resourceGroupName, String name, String webJobName); - - /** - * Get webjob information for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of the web job. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return webjob information for an app, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWebJobWithResponse( - String resourceGroupName, String name, String webJobName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/WebSiteManagementClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/WebSiteManagementClient.java deleted file mode 100644 index 228bf1b73c46..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/WebSiteManagementClient.java +++ /dev/null @@ -1,151 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent; - -import com.azure.core.http.HttpPipeline; -import java.time.Duration; - -/** The interface for WebSiteManagementClient class. */ -public interface WebSiteManagementClient { - /** - * Gets Your Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). - * - * @return the subscriptionId value. - */ - String getSubscriptionId(); - - /** - * Gets server parameter. - * - * @return the endpoint value. - */ - String getEndpoint(); - - /** - * Gets Api Version. - * - * @return the apiVersion value. - */ - String getApiVersion(); - - /** - * Gets The HTTP pipeline to send requests through. - * - * @return the httpPipeline value. - */ - HttpPipeline getHttpPipeline(); - - /** - * Gets The default poll interval for long-running operation. - * - * @return the defaultPollInterval value. - */ - Duration getDefaultPollInterval(); - - /** - * Gets the AppServiceCertificateOrdersClient object to access its operations. - * - * @return the AppServiceCertificateOrdersClient object. - */ - AppServiceCertificateOrdersClient getAppServiceCertificateOrders(); - - /** - * Gets the CertificateRegistrationProvidersClient object to access its operations. - * - * @return the CertificateRegistrationProvidersClient object. - */ - CertificateRegistrationProvidersClient getCertificateRegistrationProviders(); - - /** - * Gets the DomainsClient object to access its operations. - * - * @return the DomainsClient object. - */ - DomainsClient getDomains(); - - /** - * Gets the TopLevelDomainsClient object to access its operations. - * - * @return the TopLevelDomainsClient object. - */ - TopLevelDomainsClient getTopLevelDomains(); - - /** - * Gets the DomainRegistrationProvidersClient object to access its operations. - * - * @return the DomainRegistrationProvidersClient object. - */ - DomainRegistrationProvidersClient getDomainRegistrationProviders(); - - /** - * Gets the CertificatesClient object to access its operations. - * - * @return the CertificatesClient object. - */ - CertificatesClient getCertificates(); - - /** - * Gets the DeletedWebAppsClient object to access its operations. - * - * @return the DeletedWebAppsClient object. - */ - DeletedWebAppsClient getDeletedWebApps(); - - /** - * Gets the DiagnosticsClient object to access its operations. - * - * @return the DiagnosticsClient object. - */ - DiagnosticsClient getDiagnostics(); - - /** - * Gets the ProvidersClient object to access its operations. - * - * @return the ProvidersClient object. - */ - ProvidersClient getProviders(); - - /** - * Gets the RecommendationsClient object to access its operations. - * - * @return the RecommendationsClient object. - */ - RecommendationsClient getRecommendations(); - - /** - * Gets the ResourceProvidersClient object to access its operations. - * - * @return the ResourceProvidersClient object. - */ - ResourceProvidersClient getResourceProviders(); - - /** - * Gets the WebAppsClient object to access its operations. - * - * @return the WebAppsClient object. - */ - WebAppsClient getWebApps(); - - /** - * Gets the AppServiceEnvironmentsClient object to access its operations. - * - * @return the AppServiceEnvironmentsClient object. - */ - AppServiceEnvironmentsClient getAppServiceEnvironments(); - - /** - * Gets the AppServicePlansClient object to access its operations. - * - * @return the AppServicePlansClient object. - */ - AppServicePlansClient getAppServicePlans(); - - /** - * Gets the ResourceHealthMetadatasClient object to access its operations. - * - * @return the ResourceHealthMetadatasClient object. - */ - ResourceHealthMetadatasClient getResourceHealthMetadatas(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/AddressResponseInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/AddressResponseInner.java deleted file mode 100644 index ac756a550f05..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/AddressResponseInner.java +++ /dev/null @@ -1,136 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.VirtualIpMapping; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Describes main public IP address and any extra virtual IPs. */ -@Fluent -public final class AddressResponseInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AddressResponseInner.class); - - /* - * Main public virtual IP. - */ - @JsonProperty(value = "serviceIpAddress") - private String serviceIpAddress; - - /* - * Virtual Network internal IP address of the App Service Environment if it - * is in internal load-balancing mode. - */ - @JsonProperty(value = "internalIpAddress") - private String internalIpAddress; - - /* - * IP addresses appearing on outbound connections. - */ - @JsonProperty(value = "outboundIpAddresses") - private List outboundIpAddresses; - - /* - * Additional virtual IPs. - */ - @JsonProperty(value = "vipMappings") - private List vipMappings; - - /** - * Get the serviceIpAddress property: Main public virtual IP. - * - * @return the serviceIpAddress value. - */ - public String serviceIpAddress() { - return this.serviceIpAddress; - } - - /** - * Set the serviceIpAddress property: Main public virtual IP. - * - * @param serviceIpAddress the serviceIpAddress value to set. - * @return the AddressResponseInner object itself. - */ - public AddressResponseInner withServiceIpAddress(String serviceIpAddress) { - this.serviceIpAddress = serviceIpAddress; - return this; - } - - /** - * Get the internalIpAddress property: Virtual Network internal IP address of the App Service Environment if it is - * in internal load-balancing mode. - * - * @return the internalIpAddress value. - */ - public String internalIpAddress() { - return this.internalIpAddress; - } - - /** - * Set the internalIpAddress property: Virtual Network internal IP address of the App Service Environment if it is - * in internal load-balancing mode. - * - * @param internalIpAddress the internalIpAddress value to set. - * @return the AddressResponseInner object itself. - */ - public AddressResponseInner withInternalIpAddress(String internalIpAddress) { - this.internalIpAddress = internalIpAddress; - return this; - } - - /** - * Get the outboundIpAddresses property: IP addresses appearing on outbound connections. - * - * @return the outboundIpAddresses value. - */ - public List outboundIpAddresses() { - return this.outboundIpAddresses; - } - - /** - * Set the outboundIpAddresses property: IP addresses appearing on outbound connections. - * - * @param outboundIpAddresses the outboundIpAddresses value to set. - * @return the AddressResponseInner object itself. - */ - public AddressResponseInner withOutboundIpAddresses(List outboundIpAddresses) { - this.outboundIpAddresses = outboundIpAddresses; - return this; - } - - /** - * Get the vipMappings property: Additional virtual IPs. - * - * @return the vipMappings value. - */ - public List vipMappings() { - return this.vipMappings; - } - - /** - * Set the vipMappings property: Additional virtual IPs. - * - * @param vipMappings the vipMappings value to set. - * @return the AddressResponseInner object itself. - */ - public AddressResponseInner withVipMappings(List vipMappings) { - this.vipMappings = vipMappings; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (vipMappings() != null) { - vipMappings().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/AnalysisDataInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/AnalysisDataInner.java deleted file mode 100644 index 01db9e15ff21..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/AnalysisDataInner.java +++ /dev/null @@ -1,170 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.DiagnosticMetricSet; -import com.azure.resourcemanager.appservice.models.NameValuePair; -import com.azure.resourcemanager.appservice.models.ResponseMetadata; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Class Representing Detector Evidence used for analysis. */ -@Fluent -public final class AnalysisDataInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AnalysisDataInner.class); - - /* - * Name of the Detector - */ - @JsonProperty(value = "source") - private String source; - - /* - * Detector Definition - */ - @JsonProperty(value = "detectorDefinition") - private DetectorDefinitionInner detectorDefinition; - - /* - * Source Metrics - */ - @JsonProperty(value = "metrics") - private List metrics; - - /* - * Additional Source Data - */ - @JsonProperty(value = "data") - private List> data; - - /* - * Detector Meta Data - */ - @JsonProperty(value = "detectorMetaData") - private ResponseMetadata detectorMetadata; - - /** - * Get the source property: Name of the Detector. - * - * @return the source value. - */ - public String source() { - return this.source; - } - - /** - * Set the source property: Name of the Detector. - * - * @param source the source value to set. - * @return the AnalysisDataInner object itself. - */ - public AnalysisDataInner withSource(String source) { - this.source = source; - return this; - } - - /** - * Get the detectorDefinition property: Detector Definition. - * - * @return the detectorDefinition value. - */ - public DetectorDefinitionInner detectorDefinition() { - return this.detectorDefinition; - } - - /** - * Set the detectorDefinition property: Detector Definition. - * - * @param detectorDefinition the detectorDefinition value to set. - * @return the AnalysisDataInner object itself. - */ - public AnalysisDataInner withDetectorDefinition(DetectorDefinitionInner detectorDefinition) { - this.detectorDefinition = detectorDefinition; - return this; - } - - /** - * Get the metrics property: Source Metrics. - * - * @return the metrics value. - */ - public List metrics() { - return this.metrics; - } - - /** - * Set the metrics property: Source Metrics. - * - * @param metrics the metrics value to set. - * @return the AnalysisDataInner object itself. - */ - public AnalysisDataInner withMetrics(List metrics) { - this.metrics = metrics; - return this; - } - - /** - * Get the data property: Additional Source Data. - * - * @return the data value. - */ - public List> data() { - return this.data; - } - - /** - * Set the data property: Additional Source Data. - * - * @param data the data value to set. - * @return the AnalysisDataInner object itself. - */ - public AnalysisDataInner withData(List> data) { - this.data = data; - return this; - } - - /** - * Get the detectorMetadata property: Detector Meta Data. - * - * @return the detectorMetadata value. - */ - public ResponseMetadata detectorMetadata() { - return this.detectorMetadata; - } - - /** - * Set the detectorMetadata property: Detector Meta Data. - * - * @param detectorMetadata the detectorMetadata value to set. - * @return the AnalysisDataInner object itself. - */ - public AnalysisDataInner withDetectorMetadata(ResponseMetadata detectorMetadata) { - this.detectorMetadata = detectorMetadata; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (detectorDefinition() != null) { - detectorDefinition().validate(); - } - if (metrics() != null) { - metrics().forEach(e -> e.validate()); - } - if (data() != null) { - data().forEach(e -> e.forEach(e1 -> e1.validate())); - } - if (detectorMetadata() != null) { - detectorMetadata().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/AnalysisDefinitionInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/AnalysisDefinitionInner.java deleted file mode 100644 index 3f57f69c4094..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/AnalysisDefinitionInner.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.ProxyOnlyResource; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Definition of Analysis. */ -@Fluent -public final class AnalysisDefinitionInner extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AnalysisDefinitionInner.class); - - /* - * AnalysisDefinition resource specific properties - */ - @JsonProperty(value = "properties") - private AnalysisDefinitionProperties innerProperties; - - /** - * Get the innerProperties property: AnalysisDefinition resource specific properties. - * - * @return the innerProperties value. - */ - private AnalysisDefinitionProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public AnalysisDefinitionInner withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the description property: Description of the Analysis. - * - * @return the description value. - */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/AnalysisDefinitionProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/AnalysisDefinitionProperties.java deleted file mode 100644 index c3c58a41ffec..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/AnalysisDefinitionProperties.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** AnalysisDefinition resource specific properties. */ -@Immutable -public final class AnalysisDefinitionProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AnalysisDefinitionProperties.class); - - /* - * Description of the Analysis - */ - @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) - private String description; - - /** - * Get the description property: Description of the Analysis. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/AppServiceCertificateInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/AppServiceCertificateInner.java deleted file mode 100644 index 9f60e736b065..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/AppServiceCertificateInner.java +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.KeyVaultSecretStatus; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Key Vault container for a certificate that is purchased through Azure. */ -@Fluent -public final class AppServiceCertificateInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AppServiceCertificateInner.class); - - /* - * Key Vault resource Id. - */ - @JsonProperty(value = "keyVaultId") - private String keyVaultId; - - /* - * Key Vault secret name. - */ - @JsonProperty(value = "keyVaultSecretName") - private String keyVaultSecretName; - - /* - * Status of the Key Vault secret. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private KeyVaultSecretStatus provisioningState; - - /** - * Get the keyVaultId property: Key Vault resource Id. - * - * @return the keyVaultId value. - */ - public String keyVaultId() { - return this.keyVaultId; - } - - /** - * Set the keyVaultId property: Key Vault resource Id. - * - * @param keyVaultId the keyVaultId value to set. - * @return the AppServiceCertificateInner object itself. - */ - public AppServiceCertificateInner withKeyVaultId(String keyVaultId) { - this.keyVaultId = keyVaultId; - return this; - } - - /** - * Get the keyVaultSecretName property: Key Vault secret name. - * - * @return the keyVaultSecretName value. - */ - public String keyVaultSecretName() { - return this.keyVaultSecretName; - } - - /** - * Set the keyVaultSecretName property: Key Vault secret name. - * - * @param keyVaultSecretName the keyVaultSecretName value to set. - * @return the AppServiceCertificateInner object itself. - */ - public AppServiceCertificateInner withKeyVaultSecretName(String keyVaultSecretName) { - this.keyVaultSecretName = keyVaultSecretName; - return this; - } - - /** - * Get the provisioningState property: Status of the Key Vault secret. - * - * @return the provisioningState value. - */ - public KeyVaultSecretStatus provisioningState() { - return this.provisioningState; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/AppServiceCertificateOrderInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/AppServiceCertificateOrderInner.java deleted file mode 100644 index 5e8b2a4ee595..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/AppServiceCertificateOrderInner.java +++ /dev/null @@ -1,367 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem; -import com.azure.resourcemanager.appservice.models.CertificateDetails; -import com.azure.resourcemanager.appservice.models.CertificateOrderStatus; -import com.azure.resourcemanager.appservice.models.CertificateProductType; -import com.azure.resourcemanager.appservice.models.ProvisioningState; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; -import java.util.Map; - -/** SSL certificate purchase order. */ -@Fluent -public final class AppServiceCertificateOrderInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AppServiceCertificateOrderInner.class); - - /* - * AppServiceCertificateOrder resource specific properties - */ - @JsonProperty(value = "properties") - private AppServiceCertificateOrderProperties innerProperties; - - /* - * Kind of resource. - */ - @JsonProperty(value = "kind") - private String kind; - - /** - * Get the innerProperties property: AppServiceCertificateOrder resource specific properties. - * - * @return the innerProperties value. - */ - private AppServiceCertificateOrderProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the kind property: Kind of resource. - * - * @return the kind value. - */ - public String kind() { - return this.kind; - } - - /** - * Set the kind property: Kind of resource. - * - * @param kind the kind value to set. - * @return the AppServiceCertificateOrderInner object itself. - */ - public AppServiceCertificateOrderInner withKind(String kind) { - this.kind = kind; - return this; - } - - /** {@inheritDoc} */ - @Override - public AppServiceCertificateOrderInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public AppServiceCertificateOrderInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the certificates property: State of the Key Vault secret. - * - * @return the certificates value. - */ - public Map certificates() { - return this.innerProperties() == null ? null : this.innerProperties().certificates(); - } - - /** - * Set the certificates property: State of the Key Vault secret. - * - * @param certificates the certificates value to set. - * @return the AppServiceCertificateOrderInner object itself. - */ - public AppServiceCertificateOrderInner withCertificates(Map certificates) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServiceCertificateOrderProperties(); - } - this.innerProperties().withCertificates(certificates); - return this; - } - - /** - * Get the distinguishedName property: Certificate distinguished name. - * - * @return the distinguishedName value. - */ - public String distinguishedName() { - return this.innerProperties() == null ? null : this.innerProperties().distinguishedName(); - } - - /** - * Set the distinguishedName property: Certificate distinguished name. - * - * @param distinguishedName the distinguishedName value to set. - * @return the AppServiceCertificateOrderInner object itself. - */ - public AppServiceCertificateOrderInner withDistinguishedName(String distinguishedName) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServiceCertificateOrderProperties(); - } - this.innerProperties().withDistinguishedName(distinguishedName); - return this; - } - - /** - * Get the domainVerificationToken property: Domain verification token. - * - * @return the domainVerificationToken value. - */ - public String domainVerificationToken() { - return this.innerProperties() == null ? null : this.innerProperties().domainVerificationToken(); - } - - /** - * Get the validityInYears property: Duration in years (must be between 1 and 3). - * - * @return the validityInYears value. - */ - public Integer validityInYears() { - return this.innerProperties() == null ? null : this.innerProperties().validityInYears(); - } - - /** - * Set the validityInYears property: Duration in years (must be between 1 and 3). - * - * @param validityInYears the validityInYears value to set. - * @return the AppServiceCertificateOrderInner object itself. - */ - public AppServiceCertificateOrderInner withValidityInYears(Integer validityInYears) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServiceCertificateOrderProperties(); - } - this.innerProperties().withValidityInYears(validityInYears); - return this; - } - - /** - * Get the keySize property: Certificate key size. - * - * @return the keySize value. - */ - public Integer keySize() { - return this.innerProperties() == null ? null : this.innerProperties().keySize(); - } - - /** - * Set the keySize property: Certificate key size. - * - * @param keySize the keySize value to set. - * @return the AppServiceCertificateOrderInner object itself. - */ - public AppServiceCertificateOrderInner withKeySize(Integer keySize) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServiceCertificateOrderProperties(); - } - this.innerProperties().withKeySize(keySize); - return this; - } - - /** - * Get the productType property: Certificate product type. - * - * @return the productType value. - */ - public CertificateProductType productType() { - return this.innerProperties() == null ? null : this.innerProperties().productType(); - } - - /** - * Set the productType property: Certificate product type. - * - * @param productType the productType value to set. - * @return the AppServiceCertificateOrderInner object itself. - */ - public AppServiceCertificateOrderInner withProductType(CertificateProductType productType) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServiceCertificateOrderProperties(); - } - this.innerProperties().withProductType(productType); - return this; - } - - /** - * Get the autoRenew property: <code>true</code> if the certificate should be automatically renewed when - * it expires; otherwise, <code>false</code>. - * - * @return the autoRenew value. - */ - public Boolean autoRenew() { - return this.innerProperties() == null ? null : this.innerProperties().autoRenew(); - } - - /** - * Set the autoRenew property: <code>true</code> if the certificate should be automatically renewed when - * it expires; otherwise, <code>false</code>. - * - * @param autoRenew the autoRenew value to set. - * @return the AppServiceCertificateOrderInner object itself. - */ - public AppServiceCertificateOrderInner withAutoRenew(Boolean autoRenew) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServiceCertificateOrderProperties(); - } - this.innerProperties().withAutoRenew(autoRenew); - return this; - } - - /** - * Get the provisioningState property: Status of certificate order. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the status property: Current order status. - * - * @return the status value. - */ - public CertificateOrderStatus status() { - return this.innerProperties() == null ? null : this.innerProperties().status(); - } - - /** - * Get the signedCertificate property: Signed certificate. - * - * @return the signedCertificate value. - */ - public CertificateDetails signedCertificate() { - return this.innerProperties() == null ? null : this.innerProperties().signedCertificate(); - } - - /** - * Get the csr property: Last CSR that was created for this order. - * - * @return the csr value. - */ - public String csr() { - return this.innerProperties() == null ? null : this.innerProperties().csr(); - } - - /** - * Set the csr property: Last CSR that was created for this order. - * - * @param csr the csr value to set. - * @return the AppServiceCertificateOrderInner object itself. - */ - public AppServiceCertificateOrderInner withCsr(String csr) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServiceCertificateOrderProperties(); - } - this.innerProperties().withCsr(csr); - return this; - } - - /** - * Get the intermediate property: Intermediate certificate. - * - * @return the intermediate value. - */ - public CertificateDetails intermediate() { - return this.innerProperties() == null ? null : this.innerProperties().intermediate(); - } - - /** - * Get the root property: Root certificate. - * - * @return the root value. - */ - public CertificateDetails root() { - return this.innerProperties() == null ? null : this.innerProperties().root(); - } - - /** - * Get the serialNumber property: Current serial number of the certificate. - * - * @return the serialNumber value. - */ - public String serialNumber() { - return this.innerProperties() == null ? null : this.innerProperties().serialNumber(); - } - - /** - * Get the lastCertificateIssuanceTime property: Certificate last issuance time. - * - * @return the lastCertificateIssuanceTime value. - */ - public OffsetDateTime lastCertificateIssuanceTime() { - return this.innerProperties() == null ? null : this.innerProperties().lastCertificateIssuanceTime(); - } - - /** - * Get the expirationTime property: Certificate expiration time. - * - * @return the expirationTime value. - */ - public OffsetDateTime expirationTime() { - return this.innerProperties() == null ? null : this.innerProperties().expirationTime(); - } - - /** - * Get the isPrivateKeyExternal property: <code>true</code> if private key is external; otherwise, - * <code>false</code>. - * - * @return the isPrivateKeyExternal value. - */ - public Boolean isPrivateKeyExternal() { - return this.innerProperties() == null ? null : this.innerProperties().isPrivateKeyExternal(); - } - - /** - * Get the appServiceCertificateNotRenewableReasons property: Reasons why App Service Certificate is not renewable - * at the current moment. - * - * @return the appServiceCertificateNotRenewableReasons value. - */ - public List - appServiceCertificateNotRenewableReasons() { - return this.innerProperties() == null - ? null - : this.innerProperties().appServiceCertificateNotRenewableReasons(); - } - - /** - * Get the nextAutoRenewalTimestamp property: Time stamp when the certificate would be auto renewed next. - * - * @return the nextAutoRenewalTimestamp value. - */ - public OffsetDateTime nextAutoRenewalTimestamp() { - return this.innerProperties() == null ? null : this.innerProperties().nextAutoRenewalTimestamp(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/AppServiceCertificateOrderPatchResourceProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/AppServiceCertificateOrderPatchResourceProperties.java deleted file mode 100644 index 46491f388ed6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/AppServiceCertificateOrderPatchResourceProperties.java +++ /dev/null @@ -1,433 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem; -import com.azure.resourcemanager.appservice.models.CertificateDetails; -import com.azure.resourcemanager.appservice.models.CertificateOrderStatus; -import com.azure.resourcemanager.appservice.models.CertificateProductType; -import com.azure.resourcemanager.appservice.models.ProvisioningState; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; -import java.util.Map; - -/** AppServiceCertificateOrderPatchResource resource specific properties. */ -@Fluent -public final class AppServiceCertificateOrderPatchResourceProperties { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(AppServiceCertificateOrderPatchResourceProperties.class); - - /* - * State of the Key Vault secret. - */ - @JsonProperty(value = "certificates") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map certificates; - - /* - * Certificate distinguished name. - */ - @JsonProperty(value = "distinguishedName") - private String distinguishedName; - - /* - * Domain verification token. - */ - @JsonProperty(value = "domainVerificationToken", access = JsonProperty.Access.WRITE_ONLY) - private String domainVerificationToken; - - /* - * Duration in years (must be between 1 and 3). - */ - @JsonProperty(value = "validityInYears") - private Integer validityInYears; - - /* - * Certificate key size. - */ - @JsonProperty(value = "keySize") - private Integer keySize; - - /* - * Certificate product type. - */ - @JsonProperty(value = "productType", required = true) - private CertificateProductType productType; - - /* - * true if the certificate should be automatically renewed - * when it expires; otherwise, false. - */ - @JsonProperty(value = "autoRenew") - private Boolean autoRenew; - - /* - * Status of certificate order. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private ProvisioningState provisioningState; - - /* - * Current order status. - */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) - private CertificateOrderStatus status; - - /* - * Signed certificate. - */ - @JsonProperty(value = "signedCertificate", access = JsonProperty.Access.WRITE_ONLY) - private CertificateDetails signedCertificate; - - /* - * Last CSR that was created for this order. - */ - @JsonProperty(value = "csr") - private String csr; - - /* - * Intermediate certificate. - */ - @JsonProperty(value = "intermediate", access = JsonProperty.Access.WRITE_ONLY) - private CertificateDetails intermediate; - - /* - * Root certificate. - */ - @JsonProperty(value = "root", access = JsonProperty.Access.WRITE_ONLY) - private CertificateDetails root; - - /* - * Current serial number of the certificate. - */ - @JsonProperty(value = "serialNumber", access = JsonProperty.Access.WRITE_ONLY) - private String serialNumber; - - /* - * Certificate last issuance time. - */ - @JsonProperty(value = "lastCertificateIssuanceTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime lastCertificateIssuanceTime; - - /* - * Certificate expiration time. - */ - @JsonProperty(value = "expirationTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime expirationTime; - - /* - * true if private key is external; otherwise, - * false. - */ - @JsonProperty(value = "isPrivateKeyExternal", access = JsonProperty.Access.WRITE_ONLY) - private Boolean isPrivateKeyExternal; - - /* - * Reasons why App Service Certificate is not renewable at the current - * moment. - */ - @JsonProperty(value = "appServiceCertificateNotRenewableReasons", access = JsonProperty.Access.WRITE_ONLY) - private List - appServiceCertificateNotRenewableReasons; - - /* - * Time stamp when the certificate would be auto renewed next - */ - @JsonProperty(value = "nextAutoRenewalTimeStamp", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime nextAutoRenewalTimestamp; - - /** - * Get the certificates property: State of the Key Vault secret. - * - * @return the certificates value. - */ - public Map certificates() { - return this.certificates; - } - - /** - * Set the certificates property: State of the Key Vault secret. - * - * @param certificates the certificates value to set. - * @return the AppServiceCertificateOrderPatchResourceProperties object itself. - */ - public AppServiceCertificateOrderPatchResourceProperties withCertificates( - Map certificates) { - this.certificates = certificates; - return this; - } - - /** - * Get the distinguishedName property: Certificate distinguished name. - * - * @return the distinguishedName value. - */ - public String distinguishedName() { - return this.distinguishedName; - } - - /** - * Set the distinguishedName property: Certificate distinguished name. - * - * @param distinguishedName the distinguishedName value to set. - * @return the AppServiceCertificateOrderPatchResourceProperties object itself. - */ - public AppServiceCertificateOrderPatchResourceProperties withDistinguishedName(String distinguishedName) { - this.distinguishedName = distinguishedName; - return this; - } - - /** - * Get the domainVerificationToken property: Domain verification token. - * - * @return the domainVerificationToken value. - */ - public String domainVerificationToken() { - return this.domainVerificationToken; - } - - /** - * Get the validityInYears property: Duration in years (must be between 1 and 3). - * - * @return the validityInYears value. - */ - public Integer validityInYears() { - return this.validityInYears; - } - - /** - * Set the validityInYears property: Duration in years (must be between 1 and 3). - * - * @param validityInYears the validityInYears value to set. - * @return the AppServiceCertificateOrderPatchResourceProperties object itself. - */ - public AppServiceCertificateOrderPatchResourceProperties withValidityInYears(Integer validityInYears) { - this.validityInYears = validityInYears; - return this; - } - - /** - * Get the keySize property: Certificate key size. - * - * @return the keySize value. - */ - public Integer keySize() { - return this.keySize; - } - - /** - * Set the keySize property: Certificate key size. - * - * @param keySize the keySize value to set. - * @return the AppServiceCertificateOrderPatchResourceProperties object itself. - */ - public AppServiceCertificateOrderPatchResourceProperties withKeySize(Integer keySize) { - this.keySize = keySize; - return this; - } - - /** - * Get the productType property: Certificate product type. - * - * @return the productType value. - */ - public CertificateProductType productType() { - return this.productType; - } - - /** - * Set the productType property: Certificate product type. - * - * @param productType the productType value to set. - * @return the AppServiceCertificateOrderPatchResourceProperties object itself. - */ - public AppServiceCertificateOrderPatchResourceProperties withProductType(CertificateProductType productType) { - this.productType = productType; - return this; - } - - /** - * Get the autoRenew property: <code>true</code> if the certificate should be automatically renewed when - * it expires; otherwise, <code>false</code>. - * - * @return the autoRenew value. - */ - public Boolean autoRenew() { - return this.autoRenew; - } - - /** - * Set the autoRenew property: <code>true</code> if the certificate should be automatically renewed when - * it expires; otherwise, <code>false</code>. - * - * @param autoRenew the autoRenew value to set. - * @return the AppServiceCertificateOrderPatchResourceProperties object itself. - */ - public AppServiceCertificateOrderPatchResourceProperties withAutoRenew(Boolean autoRenew) { - this.autoRenew = autoRenew; - return this; - } - - /** - * Get the provisioningState property: Status of certificate order. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Get the status property: Current order status. - * - * @return the status value. - */ - public CertificateOrderStatus status() { - return this.status; - } - - /** - * Get the signedCertificate property: Signed certificate. - * - * @return the signedCertificate value. - */ - public CertificateDetails signedCertificate() { - return this.signedCertificate; - } - - /** - * Get the csr property: Last CSR that was created for this order. - * - * @return the csr value. - */ - public String csr() { - return this.csr; - } - - /** - * Set the csr property: Last CSR that was created for this order. - * - * @param csr the csr value to set. - * @return the AppServiceCertificateOrderPatchResourceProperties object itself. - */ - public AppServiceCertificateOrderPatchResourceProperties withCsr(String csr) { - this.csr = csr; - return this; - } - - /** - * Get the intermediate property: Intermediate certificate. - * - * @return the intermediate value. - */ - public CertificateDetails intermediate() { - return this.intermediate; - } - - /** - * Get the root property: Root certificate. - * - * @return the root value. - */ - public CertificateDetails root() { - return this.root; - } - - /** - * Get the serialNumber property: Current serial number of the certificate. - * - * @return the serialNumber value. - */ - public String serialNumber() { - return this.serialNumber; - } - - /** - * Get the lastCertificateIssuanceTime property: Certificate last issuance time. - * - * @return the lastCertificateIssuanceTime value. - */ - public OffsetDateTime lastCertificateIssuanceTime() { - return this.lastCertificateIssuanceTime; - } - - /** - * Get the expirationTime property: Certificate expiration time. - * - * @return the expirationTime value. - */ - public OffsetDateTime expirationTime() { - return this.expirationTime; - } - - /** - * Get the isPrivateKeyExternal property: <code>true</code> if private key is external; otherwise, - * <code>false</code>. - * - * @return the isPrivateKeyExternal value. - */ - public Boolean isPrivateKeyExternal() { - return this.isPrivateKeyExternal; - } - - /** - * Get the appServiceCertificateNotRenewableReasons property: Reasons why App Service Certificate is not renewable - * at the current moment. - * - * @return the appServiceCertificateNotRenewableReasons value. - */ - public List - appServiceCertificateNotRenewableReasons() { - return this.appServiceCertificateNotRenewableReasons; - } - - /** - * Get the nextAutoRenewalTimestamp property: Time stamp when the certificate would be auto renewed next. - * - * @return the nextAutoRenewalTimestamp value. - */ - public OffsetDateTime nextAutoRenewalTimestamp() { - return this.nextAutoRenewalTimestamp; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (certificates() != null) { - certificates() - .values() - .forEach( - e -> { - if (e != null) { - e.validate(); - } - }); - } - if (productType() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property productType in model" - + " AppServiceCertificateOrderPatchResourceProperties")); - } - if (signedCertificate() != null) { - signedCertificate().validate(); - } - if (intermediate() != null) { - intermediate().validate(); - } - if (root() != null) { - root().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/AppServiceCertificateOrderProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/AppServiceCertificateOrderProperties.java deleted file mode 100644 index 9f3491949b0c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/AppServiceCertificateOrderProperties.java +++ /dev/null @@ -1,430 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem; -import com.azure.resourcemanager.appservice.models.CertificateDetails; -import com.azure.resourcemanager.appservice.models.CertificateOrderStatus; -import com.azure.resourcemanager.appservice.models.CertificateProductType; -import com.azure.resourcemanager.appservice.models.ProvisioningState; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; -import java.util.Map; - -/** AppServiceCertificateOrder resource specific properties. */ -@Fluent -public final class AppServiceCertificateOrderProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AppServiceCertificateOrderProperties.class); - - /* - * State of the Key Vault secret. - */ - @JsonProperty(value = "certificates") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map certificates; - - /* - * Certificate distinguished name. - */ - @JsonProperty(value = "distinguishedName") - private String distinguishedName; - - /* - * Domain verification token. - */ - @JsonProperty(value = "domainVerificationToken", access = JsonProperty.Access.WRITE_ONLY) - private String domainVerificationToken; - - /* - * Duration in years (must be between 1 and 3). - */ - @JsonProperty(value = "validityInYears") - private Integer validityInYears; - - /* - * Certificate key size. - */ - @JsonProperty(value = "keySize") - private Integer keySize; - - /* - * Certificate product type. - */ - @JsonProperty(value = "productType", required = true) - private CertificateProductType productType; - - /* - * true if the certificate should be automatically renewed - * when it expires; otherwise, false. - */ - @JsonProperty(value = "autoRenew") - private Boolean autoRenew; - - /* - * Status of certificate order. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private ProvisioningState provisioningState; - - /* - * Current order status. - */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) - private CertificateOrderStatus status; - - /* - * Signed certificate. - */ - @JsonProperty(value = "signedCertificate", access = JsonProperty.Access.WRITE_ONLY) - private CertificateDetails signedCertificate; - - /* - * Last CSR that was created for this order. - */ - @JsonProperty(value = "csr") - private String csr; - - /* - * Intermediate certificate. - */ - @JsonProperty(value = "intermediate", access = JsonProperty.Access.WRITE_ONLY) - private CertificateDetails intermediate; - - /* - * Root certificate. - */ - @JsonProperty(value = "root", access = JsonProperty.Access.WRITE_ONLY) - private CertificateDetails root; - - /* - * Current serial number of the certificate. - */ - @JsonProperty(value = "serialNumber", access = JsonProperty.Access.WRITE_ONLY) - private String serialNumber; - - /* - * Certificate last issuance time. - */ - @JsonProperty(value = "lastCertificateIssuanceTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime lastCertificateIssuanceTime; - - /* - * Certificate expiration time. - */ - @JsonProperty(value = "expirationTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime expirationTime; - - /* - * true if private key is external; otherwise, - * false. - */ - @JsonProperty(value = "isPrivateKeyExternal", access = JsonProperty.Access.WRITE_ONLY) - private Boolean isPrivateKeyExternal; - - /* - * Reasons why App Service Certificate is not renewable at the current - * moment. - */ - @JsonProperty(value = "appServiceCertificateNotRenewableReasons", access = JsonProperty.Access.WRITE_ONLY) - private List - appServiceCertificateNotRenewableReasons; - - /* - * Time stamp when the certificate would be auto renewed next - */ - @JsonProperty(value = "nextAutoRenewalTimeStamp", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime nextAutoRenewalTimestamp; - - /** - * Get the certificates property: State of the Key Vault secret. - * - * @return the certificates value. - */ - public Map certificates() { - return this.certificates; - } - - /** - * Set the certificates property: State of the Key Vault secret. - * - * @param certificates the certificates value to set. - * @return the AppServiceCertificateOrderProperties object itself. - */ - public AppServiceCertificateOrderProperties withCertificates(Map certificates) { - this.certificates = certificates; - return this; - } - - /** - * Get the distinguishedName property: Certificate distinguished name. - * - * @return the distinguishedName value. - */ - public String distinguishedName() { - return this.distinguishedName; - } - - /** - * Set the distinguishedName property: Certificate distinguished name. - * - * @param distinguishedName the distinguishedName value to set. - * @return the AppServiceCertificateOrderProperties object itself. - */ - public AppServiceCertificateOrderProperties withDistinguishedName(String distinguishedName) { - this.distinguishedName = distinguishedName; - return this; - } - - /** - * Get the domainVerificationToken property: Domain verification token. - * - * @return the domainVerificationToken value. - */ - public String domainVerificationToken() { - return this.domainVerificationToken; - } - - /** - * Get the validityInYears property: Duration in years (must be between 1 and 3). - * - * @return the validityInYears value. - */ - public Integer validityInYears() { - return this.validityInYears; - } - - /** - * Set the validityInYears property: Duration in years (must be between 1 and 3). - * - * @param validityInYears the validityInYears value to set. - * @return the AppServiceCertificateOrderProperties object itself. - */ - public AppServiceCertificateOrderProperties withValidityInYears(Integer validityInYears) { - this.validityInYears = validityInYears; - return this; - } - - /** - * Get the keySize property: Certificate key size. - * - * @return the keySize value. - */ - public Integer keySize() { - return this.keySize; - } - - /** - * Set the keySize property: Certificate key size. - * - * @param keySize the keySize value to set. - * @return the AppServiceCertificateOrderProperties object itself. - */ - public AppServiceCertificateOrderProperties withKeySize(Integer keySize) { - this.keySize = keySize; - return this; - } - - /** - * Get the productType property: Certificate product type. - * - * @return the productType value. - */ - public CertificateProductType productType() { - return this.productType; - } - - /** - * Set the productType property: Certificate product type. - * - * @param productType the productType value to set. - * @return the AppServiceCertificateOrderProperties object itself. - */ - public AppServiceCertificateOrderProperties withProductType(CertificateProductType productType) { - this.productType = productType; - return this; - } - - /** - * Get the autoRenew property: <code>true</code> if the certificate should be automatically renewed when - * it expires; otherwise, <code>false</code>. - * - * @return the autoRenew value. - */ - public Boolean autoRenew() { - return this.autoRenew; - } - - /** - * Set the autoRenew property: <code>true</code> if the certificate should be automatically renewed when - * it expires; otherwise, <code>false</code>. - * - * @param autoRenew the autoRenew value to set. - * @return the AppServiceCertificateOrderProperties object itself. - */ - public AppServiceCertificateOrderProperties withAutoRenew(Boolean autoRenew) { - this.autoRenew = autoRenew; - return this; - } - - /** - * Get the provisioningState property: Status of certificate order. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Get the status property: Current order status. - * - * @return the status value. - */ - public CertificateOrderStatus status() { - return this.status; - } - - /** - * Get the signedCertificate property: Signed certificate. - * - * @return the signedCertificate value. - */ - public CertificateDetails signedCertificate() { - return this.signedCertificate; - } - - /** - * Get the csr property: Last CSR that was created for this order. - * - * @return the csr value. - */ - public String csr() { - return this.csr; - } - - /** - * Set the csr property: Last CSR that was created for this order. - * - * @param csr the csr value to set. - * @return the AppServiceCertificateOrderProperties object itself. - */ - public AppServiceCertificateOrderProperties withCsr(String csr) { - this.csr = csr; - return this; - } - - /** - * Get the intermediate property: Intermediate certificate. - * - * @return the intermediate value. - */ - public CertificateDetails intermediate() { - return this.intermediate; - } - - /** - * Get the root property: Root certificate. - * - * @return the root value. - */ - public CertificateDetails root() { - return this.root; - } - - /** - * Get the serialNumber property: Current serial number of the certificate. - * - * @return the serialNumber value. - */ - public String serialNumber() { - return this.serialNumber; - } - - /** - * Get the lastCertificateIssuanceTime property: Certificate last issuance time. - * - * @return the lastCertificateIssuanceTime value. - */ - public OffsetDateTime lastCertificateIssuanceTime() { - return this.lastCertificateIssuanceTime; - } - - /** - * Get the expirationTime property: Certificate expiration time. - * - * @return the expirationTime value. - */ - public OffsetDateTime expirationTime() { - return this.expirationTime; - } - - /** - * Get the isPrivateKeyExternal property: <code>true</code> if private key is external; otherwise, - * <code>false</code>. - * - * @return the isPrivateKeyExternal value. - */ - public Boolean isPrivateKeyExternal() { - return this.isPrivateKeyExternal; - } - - /** - * Get the appServiceCertificateNotRenewableReasons property: Reasons why App Service Certificate is not renewable - * at the current moment. - * - * @return the appServiceCertificateNotRenewableReasons value. - */ - public List - appServiceCertificateNotRenewableReasons() { - return this.appServiceCertificateNotRenewableReasons; - } - - /** - * Get the nextAutoRenewalTimestamp property: Time stamp when the certificate would be auto renewed next. - * - * @return the nextAutoRenewalTimestamp value. - */ - public OffsetDateTime nextAutoRenewalTimestamp() { - return this.nextAutoRenewalTimestamp; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (certificates() != null) { - certificates() - .values() - .forEach( - e -> { - if (e != null) { - e.validate(); - } - }); - } - if (productType() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property productType in model AppServiceCertificateOrderProperties")); - } - if (signedCertificate() != null) { - signedCertificate().validate(); - } - if (intermediate() != null) { - intermediate().validate(); - } - if (root() != null) { - root().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/AppServiceCertificatePatchResourceInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/AppServiceCertificatePatchResourceInner.java deleted file mode 100644 index 800c4a62d2cf..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/AppServiceCertificatePatchResourceInner.java +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.KeyVaultSecretStatus; -import com.azure.resourcemanager.appservice.models.ProxyOnlyResource; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Key Vault container ARM resource for a certificate that is purchased through Azure. */ -@Fluent -public final class AppServiceCertificatePatchResourceInner extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AppServiceCertificatePatchResourceInner.class); - - /* - * Core resource properties - */ - @JsonProperty(value = "properties") - private AppServiceCertificateInner innerProperties; - - /** - * Get the innerProperties property: Core resource properties. - * - * @return the innerProperties value. - */ - private AppServiceCertificateInner innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public AppServiceCertificatePatchResourceInner withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the keyVaultId property: Key Vault resource Id. - * - * @return the keyVaultId value. - */ - public String keyVaultId() { - return this.innerProperties() == null ? null : this.innerProperties().keyVaultId(); - } - - /** - * Set the keyVaultId property: Key Vault resource Id. - * - * @param keyVaultId the keyVaultId value to set. - * @return the AppServiceCertificatePatchResourceInner object itself. - */ - public AppServiceCertificatePatchResourceInner withKeyVaultId(String keyVaultId) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServiceCertificateInner(); - } - this.innerProperties().withKeyVaultId(keyVaultId); - return this; - } - - /** - * Get the keyVaultSecretName property: Key Vault secret name. - * - * @return the keyVaultSecretName value. - */ - public String keyVaultSecretName() { - return this.innerProperties() == null ? null : this.innerProperties().keyVaultSecretName(); - } - - /** - * Set the keyVaultSecretName property: Key Vault secret name. - * - * @param keyVaultSecretName the keyVaultSecretName value to set. - * @return the AppServiceCertificatePatchResourceInner object itself. - */ - public AppServiceCertificatePatchResourceInner withKeyVaultSecretName(String keyVaultSecretName) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServiceCertificateInner(); - } - this.innerProperties().withKeyVaultSecretName(keyVaultSecretName); - return this; - } - - /** - * Get the provisioningState property: Status of the Key Vault secret. - * - * @return the provisioningState value. - */ - public KeyVaultSecretStatus provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/AppServiceCertificateResourceInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/AppServiceCertificateResourceInner.java deleted file mode 100644 index 94afa909ca78..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/AppServiceCertificateResourceInner.java +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.KeyVaultSecretStatus; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** Key Vault container ARM resource for a certificate that is purchased through Azure. */ -@Fluent -public final class AppServiceCertificateResourceInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AppServiceCertificateResourceInner.class); - - /* - * Core resource properties - */ - @JsonProperty(value = "properties") - private AppServiceCertificateInner innerProperties; - - /* - * Kind of resource. - */ - @JsonProperty(value = "kind") - private String kind; - - /** - * Get the innerProperties property: Core resource properties. - * - * @return the innerProperties value. - */ - private AppServiceCertificateInner innerProperties() { - return this.innerProperties; - } - - /** - * Get the kind property: Kind of resource. - * - * @return the kind value. - */ - public String kind() { - return this.kind; - } - - /** - * Set the kind property: Kind of resource. - * - * @param kind the kind value to set. - * @return the AppServiceCertificateResourceInner object itself. - */ - public AppServiceCertificateResourceInner withKind(String kind) { - this.kind = kind; - return this; - } - - /** {@inheritDoc} */ - @Override - public AppServiceCertificateResourceInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public AppServiceCertificateResourceInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the keyVaultId property: Key Vault resource Id. - * - * @return the keyVaultId value. - */ - public String keyVaultId() { - return this.innerProperties() == null ? null : this.innerProperties().keyVaultId(); - } - - /** - * Set the keyVaultId property: Key Vault resource Id. - * - * @param keyVaultId the keyVaultId value to set. - * @return the AppServiceCertificateResourceInner object itself. - */ - public AppServiceCertificateResourceInner withKeyVaultId(String keyVaultId) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServiceCertificateInner(); - } - this.innerProperties().withKeyVaultId(keyVaultId); - return this; - } - - /** - * Get the keyVaultSecretName property: Key Vault secret name. - * - * @return the keyVaultSecretName value. - */ - public String keyVaultSecretName() { - return this.innerProperties() == null ? null : this.innerProperties().keyVaultSecretName(); - } - - /** - * Set the keyVaultSecretName property: Key Vault secret name. - * - * @param keyVaultSecretName the keyVaultSecretName value to set. - * @return the AppServiceCertificateResourceInner object itself. - */ - public AppServiceCertificateResourceInner withKeyVaultSecretName(String keyVaultSecretName) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServiceCertificateInner(); - } - this.innerProperties().withKeyVaultSecretName(keyVaultSecretName); - return this; - } - - /** - * Get the provisioningState property: Status of the Key Vault secret. - * - * @return the provisioningState value. - */ - public KeyVaultSecretStatus provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/AppServiceEnvironment.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/AppServiceEnvironment.java deleted file mode 100644 index bdf8ef4b50c0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/AppServiceEnvironment.java +++ /dev/null @@ -1,935 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.HostingEnvironmentStatus; -import com.azure.resourcemanager.appservice.models.InternalLoadBalancingMode; -import com.azure.resourcemanager.appservice.models.NameValuePair; -import com.azure.resourcemanager.appservice.models.NetworkAccessControlEntry; -import com.azure.resourcemanager.appservice.models.ProvisioningState; -import com.azure.resourcemanager.appservice.models.VirtualIpMapping; -import com.azure.resourcemanager.appservice.models.VirtualNetworkProfile; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Description of an App Service Environment. */ -@Fluent -public final class AppServiceEnvironment { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AppServiceEnvironment.class); - - /* - * Name of the App Service Environment. - */ - @JsonProperty(value = "name", required = true) - private String name; - - /* - * Location of the App Service Environment, e.g. "West US". - */ - @JsonProperty(value = "location", required = true) - private String location; - - /* - * Provisioning state of the App Service Environment. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private ProvisioningState provisioningState; - - /* - * Current status of the App Service Environment. - */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) - private HostingEnvironmentStatus status; - - /* - * Name of the Virtual Network for the App Service Environment. - */ - @JsonProperty(value = "vnetName") - private String vnetName; - - /* - * Resource group of the Virtual Network. - */ - @JsonProperty(value = "vnetResourceGroupName") - private String vnetResourceGroupName; - - /* - * Subnet of the Virtual Network. - */ - @JsonProperty(value = "vnetSubnetName") - private String vnetSubnetName; - - /* - * Description of the Virtual Network. - */ - @JsonProperty(value = "virtualNetwork", required = true) - private VirtualNetworkProfile virtualNetwork; - - /* - * Specifies which endpoints to serve internally in the Virtual Network for - * the App Service Environment. - */ - @JsonProperty(value = "internalLoadBalancingMode") - private InternalLoadBalancingMode internalLoadBalancingMode; - - /* - * Front-end VM size, e.g. "Medium", "Large". - */ - @JsonProperty(value = "multiSize") - private String multiSize; - - /* - * Number of front-end instances. - */ - @JsonProperty(value = "multiRoleCount") - private Integer multiRoleCount; - - /* - * Description of worker pools with worker size IDs, VM sizes, and number - * of workers in each pool. - */ - @JsonProperty(value = "workerPools", required = true) - private List workerPools; - - /* - * Number of IP SSL addresses reserved for the App Service Environment. - */ - @JsonProperty(value = "ipsslAddressCount") - private Integer ipsslAddressCount; - - /* - * Edition of the metadata database for the App Service Environment, e.g. - * "Standard". - */ - @JsonProperty(value = "databaseEdition", access = JsonProperty.Access.WRITE_ONLY) - private String databaseEdition; - - /* - * Service objective of the metadata database for the App Service - * Environment, e.g. "S0". - */ - @JsonProperty(value = "databaseServiceObjective", access = JsonProperty.Access.WRITE_ONLY) - private String databaseServiceObjective; - - /* - * Number of upgrade domains of the App Service Environment. - */ - @JsonProperty(value = "upgradeDomains", access = JsonProperty.Access.WRITE_ONLY) - private Integer upgradeDomains; - - /* - * Subscription of the App Service Environment. - */ - @JsonProperty(value = "subscriptionId", access = JsonProperty.Access.WRITE_ONLY) - private String subscriptionId; - - /* - * DNS suffix of the App Service Environment. - */ - @JsonProperty(value = "dnsSuffix") - private String dnsSuffix; - - /* - * Last deployment action on the App Service Environment. - */ - @JsonProperty(value = "lastAction", access = JsonProperty.Access.WRITE_ONLY) - private String lastAction; - - /* - * Result of the last deployment action on the App Service Environment. - */ - @JsonProperty(value = "lastActionResult", access = JsonProperty.Access.WRITE_ONLY) - private String lastActionResult; - - /* - * List of comma separated strings describing which VM sizes are allowed - * for front-ends. - */ - @JsonProperty(value = "allowedMultiSizes", access = JsonProperty.Access.WRITE_ONLY) - private String allowedMultiSizes; - - /* - * List of comma separated strings describing which VM sizes are allowed - * for workers. - */ - @JsonProperty(value = "allowedWorkerSizes", access = JsonProperty.Access.WRITE_ONLY) - private String allowedWorkerSizes; - - /* - * Maximum number of VMs in the App Service Environment. - */ - @JsonProperty(value = "maximumNumberOfMachines", access = JsonProperty.Access.WRITE_ONLY) - private Integer maximumNumberOfMachines; - - /* - * Description of IP SSL mapping for the App Service Environment. - */ - @JsonProperty(value = "vipMappings", access = JsonProperty.Access.WRITE_ONLY) - private List vipMappings; - - /* - * Current total, used, and available worker capacities. - */ - @JsonProperty(value = "environmentCapacities", access = JsonProperty.Access.WRITE_ONLY) - private List environmentCapacities; - - /* - * Access control list for controlling traffic to the App Service - * Environment. - */ - @JsonProperty(value = "networkAccessControlList") - private List networkAccessControlList; - - /* - * True/false indicating whether the App Service Environment is healthy. - */ - @JsonProperty(value = "environmentIsHealthy", access = JsonProperty.Access.WRITE_ONLY) - private Boolean environmentIsHealthy; - - /* - * Detailed message about with results of the last check of the App Service - * Environment. - */ - @JsonProperty(value = "environmentStatus", access = JsonProperty.Access.WRITE_ONLY) - private String environmentStatus; - - /* - * Resource group of the App Service Environment. - */ - @JsonProperty(value = "resourceGroup", access = JsonProperty.Access.WRITE_ONLY) - private String resourceGroup; - - /* - * Scale factor for front-ends. - */ - @JsonProperty(value = "frontEndScaleFactor") - private Integer frontEndScaleFactor; - - /* - * Default Scale Factor for FrontEnds. - */ - @JsonProperty(value = "defaultFrontEndScaleFactor", access = JsonProperty.Access.WRITE_ONLY) - private Integer defaultFrontEndScaleFactor; - - /* - * API Management Account associated with the App Service Environment. - */ - @JsonProperty(value = "apiManagementAccountId") - private String apiManagementAccountId; - - /* - * true if the App Service Environment is suspended; - * otherwise, false. The environment can be suspended, e.g. - * when the management endpoint is no longer available - * (most likely because NSG blocked the incoming traffic). - */ - @JsonProperty(value = "suspended") - private Boolean suspended; - - /* - * True/false indicating whether the App Service Environment is suspended. - * The environment can be suspended e.g. when the management endpoint is no - * longer available - * (most likely because NSG blocked the incoming traffic). - */ - @JsonProperty(value = "dynamicCacheEnabled") - private Boolean dynamicCacheEnabled; - - /* - * Custom settings for changing the behavior of the App Service - * Environment. - */ - @JsonProperty(value = "clusterSettings") - private List clusterSettings; - - /* - * User added ip ranges to whitelist on ASE db - */ - @JsonProperty(value = "userWhitelistedIpRanges") - private List userWhitelistedIpRanges; - - /* - * Flag that displays whether an ASE has linux workers or not - */ - @JsonProperty(value = "hasLinuxWorkers") - private Boolean hasLinuxWorkers; - - /* - * Key Vault ID for ILB App Service Environment default SSL certificate - */ - @JsonProperty(value = "sslCertKeyVaultId") - private String sslCertKeyVaultId; - - /* - * Key Vault Secret Name for ILB App Service Environment default SSL - * certificate - */ - @JsonProperty(value = "sslCertKeyVaultSecretName") - private String sslCertKeyVaultSecretName; - - /** - * Get the name property: Name of the App Service Environment. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Name of the App Service Environment. - * - * @param name the name value to set. - * @return the AppServiceEnvironment object itself. - */ - public AppServiceEnvironment withName(String name) { - this.name = name; - return this; - } - - /** - * Get the location property: Location of the App Service Environment, e.g. "West US". - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Set the location property: Location of the App Service Environment, e.g. "West US". - * - * @param location the location value to set. - * @return the AppServiceEnvironment object itself. - */ - public AppServiceEnvironment withLocation(String location) { - this.location = location; - return this; - } - - /** - * Get the provisioningState property: Provisioning state of the App Service Environment. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Get the status property: Current status of the App Service Environment. - * - * @return the status value. - */ - public HostingEnvironmentStatus status() { - return this.status; - } - - /** - * Get the vnetName property: Name of the Virtual Network for the App Service Environment. - * - * @return the vnetName value. - */ - public String vnetName() { - return this.vnetName; - } - - /** - * Set the vnetName property: Name of the Virtual Network for the App Service Environment. - * - * @param vnetName the vnetName value to set. - * @return the AppServiceEnvironment object itself. - */ - public AppServiceEnvironment withVnetName(String vnetName) { - this.vnetName = vnetName; - return this; - } - - /** - * Get the vnetResourceGroupName property: Resource group of the Virtual Network. - * - * @return the vnetResourceGroupName value. - */ - public String vnetResourceGroupName() { - return this.vnetResourceGroupName; - } - - /** - * Set the vnetResourceGroupName property: Resource group of the Virtual Network. - * - * @param vnetResourceGroupName the vnetResourceGroupName value to set. - * @return the AppServiceEnvironment object itself. - */ - public AppServiceEnvironment withVnetResourceGroupName(String vnetResourceGroupName) { - this.vnetResourceGroupName = vnetResourceGroupName; - return this; - } - - /** - * Get the vnetSubnetName property: Subnet of the Virtual Network. - * - * @return the vnetSubnetName value. - */ - public String vnetSubnetName() { - return this.vnetSubnetName; - } - - /** - * Set the vnetSubnetName property: Subnet of the Virtual Network. - * - * @param vnetSubnetName the vnetSubnetName value to set. - * @return the AppServiceEnvironment object itself. - */ - public AppServiceEnvironment withVnetSubnetName(String vnetSubnetName) { - this.vnetSubnetName = vnetSubnetName; - return this; - } - - /** - * Get the virtualNetwork property: Description of the Virtual Network. - * - * @return the virtualNetwork value. - */ - public VirtualNetworkProfile virtualNetwork() { - return this.virtualNetwork; - } - - /** - * Set the virtualNetwork property: Description of the Virtual Network. - * - * @param virtualNetwork the virtualNetwork value to set. - * @return the AppServiceEnvironment object itself. - */ - public AppServiceEnvironment withVirtualNetwork(VirtualNetworkProfile virtualNetwork) { - this.virtualNetwork = virtualNetwork; - return this; - } - - /** - * Get the internalLoadBalancingMode property: Specifies which endpoints to serve internally in the Virtual Network - * for the App Service Environment. - * - * @return the internalLoadBalancingMode value. - */ - public InternalLoadBalancingMode internalLoadBalancingMode() { - return this.internalLoadBalancingMode; - } - - /** - * Set the internalLoadBalancingMode property: Specifies which endpoints to serve internally in the Virtual Network - * for the App Service Environment. - * - * @param internalLoadBalancingMode the internalLoadBalancingMode value to set. - * @return the AppServiceEnvironment object itself. - */ - public AppServiceEnvironment withInternalLoadBalancingMode(InternalLoadBalancingMode internalLoadBalancingMode) { - this.internalLoadBalancingMode = internalLoadBalancingMode; - return this; - } - - /** - * Get the multiSize property: Front-end VM size, e.g. "Medium", "Large". - * - * @return the multiSize value. - */ - public String multiSize() { - return this.multiSize; - } - - /** - * Set the multiSize property: Front-end VM size, e.g. "Medium", "Large". - * - * @param multiSize the multiSize value to set. - * @return the AppServiceEnvironment object itself. - */ - public AppServiceEnvironment withMultiSize(String multiSize) { - this.multiSize = multiSize; - return this; - } - - /** - * Get the multiRoleCount property: Number of front-end instances. - * - * @return the multiRoleCount value. - */ - public Integer multiRoleCount() { - return this.multiRoleCount; - } - - /** - * Set the multiRoleCount property: Number of front-end instances. - * - * @param multiRoleCount the multiRoleCount value to set. - * @return the AppServiceEnvironment object itself. - */ - public AppServiceEnvironment withMultiRoleCount(Integer multiRoleCount) { - this.multiRoleCount = multiRoleCount; - return this; - } - - /** - * Get the workerPools property: Description of worker pools with worker size IDs, VM sizes, and number of workers - * in each pool. - * - * @return the workerPools value. - */ - public List workerPools() { - return this.workerPools; - } - - /** - * Set the workerPools property: Description of worker pools with worker size IDs, VM sizes, and number of workers - * in each pool. - * - * @param workerPools the workerPools value to set. - * @return the AppServiceEnvironment object itself. - */ - public AppServiceEnvironment withWorkerPools(List workerPools) { - this.workerPools = workerPools; - return this; - } - - /** - * Get the ipsslAddressCount property: Number of IP SSL addresses reserved for the App Service Environment. - * - * @return the ipsslAddressCount value. - */ - public Integer ipsslAddressCount() { - return this.ipsslAddressCount; - } - - /** - * Set the ipsslAddressCount property: Number of IP SSL addresses reserved for the App Service Environment. - * - * @param ipsslAddressCount the ipsslAddressCount value to set. - * @return the AppServiceEnvironment object itself. - */ - public AppServiceEnvironment withIpsslAddressCount(Integer ipsslAddressCount) { - this.ipsslAddressCount = ipsslAddressCount; - return this; - } - - /** - * Get the databaseEdition property: Edition of the metadata database for the App Service Environment, e.g. - * "Standard". - * - * @return the databaseEdition value. - */ - public String databaseEdition() { - return this.databaseEdition; - } - - /** - * Get the databaseServiceObjective property: Service objective of the metadata database for the App Service - * Environment, e.g. "S0". - * - * @return the databaseServiceObjective value. - */ - public String databaseServiceObjective() { - return this.databaseServiceObjective; - } - - /** - * Get the upgradeDomains property: Number of upgrade domains of the App Service Environment. - * - * @return the upgradeDomains value. - */ - public Integer upgradeDomains() { - return this.upgradeDomains; - } - - /** - * Get the subscriptionId property: Subscription of the App Service Environment. - * - * @return the subscriptionId value. - */ - public String subscriptionId() { - return this.subscriptionId; - } - - /** - * Get the dnsSuffix property: DNS suffix of the App Service Environment. - * - * @return the dnsSuffix value. - */ - public String dnsSuffix() { - return this.dnsSuffix; - } - - /** - * Set the dnsSuffix property: DNS suffix of the App Service Environment. - * - * @param dnsSuffix the dnsSuffix value to set. - * @return the AppServiceEnvironment object itself. - */ - public AppServiceEnvironment withDnsSuffix(String dnsSuffix) { - this.dnsSuffix = dnsSuffix; - return this; - } - - /** - * Get the lastAction property: Last deployment action on the App Service Environment. - * - * @return the lastAction value. - */ - public String lastAction() { - return this.lastAction; - } - - /** - * Get the lastActionResult property: Result of the last deployment action on the App Service Environment. - * - * @return the lastActionResult value. - */ - public String lastActionResult() { - return this.lastActionResult; - } - - /** - * Get the allowedMultiSizes property: List of comma separated strings describing which VM sizes are allowed for - * front-ends. - * - * @return the allowedMultiSizes value. - */ - public String allowedMultiSizes() { - return this.allowedMultiSizes; - } - - /** - * Get the allowedWorkerSizes property: List of comma separated strings describing which VM sizes are allowed for - * workers. - * - * @return the allowedWorkerSizes value. - */ - public String allowedWorkerSizes() { - return this.allowedWorkerSizes; - } - - /** - * Get the maximumNumberOfMachines property: Maximum number of VMs in the App Service Environment. - * - * @return the maximumNumberOfMachines value. - */ - public Integer maximumNumberOfMachines() { - return this.maximumNumberOfMachines; - } - - /** - * Get the vipMappings property: Description of IP SSL mapping for the App Service Environment. - * - * @return the vipMappings value. - */ - public List vipMappings() { - return this.vipMappings; - } - - /** - * Get the environmentCapacities property: Current total, used, and available worker capacities. - * - * @return the environmentCapacities value. - */ - public List environmentCapacities() { - return this.environmentCapacities; - } - - /** - * Get the networkAccessControlList property: Access control list for controlling traffic to the App Service - * Environment. - * - * @return the networkAccessControlList value. - */ - public List networkAccessControlList() { - return this.networkAccessControlList; - } - - /** - * Set the networkAccessControlList property: Access control list for controlling traffic to the App Service - * Environment. - * - * @param networkAccessControlList the networkAccessControlList value to set. - * @return the AppServiceEnvironment object itself. - */ - public AppServiceEnvironment withNetworkAccessControlList( - List networkAccessControlList) { - this.networkAccessControlList = networkAccessControlList; - return this; - } - - /** - * Get the environmentIsHealthy property: True/false indicating whether the App Service Environment is healthy. - * - * @return the environmentIsHealthy value. - */ - public Boolean environmentIsHealthy() { - return this.environmentIsHealthy; - } - - /** - * Get the environmentStatus property: Detailed message about with results of the last check of the App Service - * Environment. - * - * @return the environmentStatus value. - */ - public String environmentStatus() { - return this.environmentStatus; - } - - /** - * Get the resourceGroup property: Resource group of the App Service Environment. - * - * @return the resourceGroup value. - */ - public String resourceGroup() { - return this.resourceGroup; - } - - /** - * Get the frontEndScaleFactor property: Scale factor for front-ends. - * - * @return the frontEndScaleFactor value. - */ - public Integer frontEndScaleFactor() { - return this.frontEndScaleFactor; - } - - /** - * Set the frontEndScaleFactor property: Scale factor for front-ends. - * - * @param frontEndScaleFactor the frontEndScaleFactor value to set. - * @return the AppServiceEnvironment object itself. - */ - public AppServiceEnvironment withFrontEndScaleFactor(Integer frontEndScaleFactor) { - this.frontEndScaleFactor = frontEndScaleFactor; - return this; - } - - /** - * Get the defaultFrontEndScaleFactor property: Default Scale Factor for FrontEnds. - * - * @return the defaultFrontEndScaleFactor value. - */ - public Integer defaultFrontEndScaleFactor() { - return this.defaultFrontEndScaleFactor; - } - - /** - * Get the apiManagementAccountId property: API Management Account associated with the App Service Environment. - * - * @return the apiManagementAccountId value. - */ - public String apiManagementAccountId() { - return this.apiManagementAccountId; - } - - /** - * Set the apiManagementAccountId property: API Management Account associated with the App Service Environment. - * - * @param apiManagementAccountId the apiManagementAccountId value to set. - * @return the AppServiceEnvironment object itself. - */ - public AppServiceEnvironment withApiManagementAccountId(String apiManagementAccountId) { - this.apiManagementAccountId = apiManagementAccountId; - return this; - } - - /** - * Get the suspended property: <code>true</code> if the App Service Environment is suspended; otherwise, - * <code>false</code>. The environment can be suspended, e.g. when the management endpoint is no longer - * available (most likely because NSG blocked the incoming traffic). - * - * @return the suspended value. - */ - public Boolean suspended() { - return this.suspended; - } - - /** - * Set the suspended property: <code>true</code> if the App Service Environment is suspended; otherwise, - * <code>false</code>. The environment can be suspended, e.g. when the management endpoint is no longer - * available (most likely because NSG blocked the incoming traffic). - * - * @param suspended the suspended value to set. - * @return the AppServiceEnvironment object itself. - */ - public AppServiceEnvironment withSuspended(Boolean suspended) { - this.suspended = suspended; - return this; - } - - /** - * Get the dynamicCacheEnabled property: True/false indicating whether the App Service Environment is suspended. The - * environment can be suspended e.g. when the management endpoint is no longer available (most likely because NSG - * blocked the incoming traffic). - * - * @return the dynamicCacheEnabled value. - */ - public Boolean dynamicCacheEnabled() { - return this.dynamicCacheEnabled; - } - - /** - * Set the dynamicCacheEnabled property: True/false indicating whether the App Service Environment is suspended. The - * environment can be suspended e.g. when the management endpoint is no longer available (most likely because NSG - * blocked the incoming traffic). - * - * @param dynamicCacheEnabled the dynamicCacheEnabled value to set. - * @return the AppServiceEnvironment object itself. - */ - public AppServiceEnvironment withDynamicCacheEnabled(Boolean dynamicCacheEnabled) { - this.dynamicCacheEnabled = dynamicCacheEnabled; - return this; - } - - /** - * Get the clusterSettings property: Custom settings for changing the behavior of the App Service Environment. - * - * @return the clusterSettings value. - */ - public List clusterSettings() { - return this.clusterSettings; - } - - /** - * Set the clusterSettings property: Custom settings for changing the behavior of the App Service Environment. - * - * @param clusterSettings the clusterSettings value to set. - * @return the AppServiceEnvironment object itself. - */ - public AppServiceEnvironment withClusterSettings(List clusterSettings) { - this.clusterSettings = clusterSettings; - return this; - } - - /** - * Get the userWhitelistedIpRanges property: User added ip ranges to whitelist on ASE db. - * - * @return the userWhitelistedIpRanges value. - */ - public List userWhitelistedIpRanges() { - return this.userWhitelistedIpRanges; - } - - /** - * Set the userWhitelistedIpRanges property: User added ip ranges to whitelist on ASE db. - * - * @param userWhitelistedIpRanges the userWhitelistedIpRanges value to set. - * @return the AppServiceEnvironment object itself. - */ - public AppServiceEnvironment withUserWhitelistedIpRanges(List userWhitelistedIpRanges) { - this.userWhitelistedIpRanges = userWhitelistedIpRanges; - return this; - } - - /** - * Get the hasLinuxWorkers property: Flag that displays whether an ASE has linux workers or not. - * - * @return the hasLinuxWorkers value. - */ - public Boolean hasLinuxWorkers() { - return this.hasLinuxWorkers; - } - - /** - * Set the hasLinuxWorkers property: Flag that displays whether an ASE has linux workers or not. - * - * @param hasLinuxWorkers the hasLinuxWorkers value to set. - * @return the AppServiceEnvironment object itself. - */ - public AppServiceEnvironment withHasLinuxWorkers(Boolean hasLinuxWorkers) { - this.hasLinuxWorkers = hasLinuxWorkers; - return this; - } - - /** - * Get the sslCertKeyVaultId property: Key Vault ID for ILB App Service Environment default SSL certificate. - * - * @return the sslCertKeyVaultId value. - */ - public String sslCertKeyVaultId() { - return this.sslCertKeyVaultId; - } - - /** - * Set the sslCertKeyVaultId property: Key Vault ID for ILB App Service Environment default SSL certificate. - * - * @param sslCertKeyVaultId the sslCertKeyVaultId value to set. - * @return the AppServiceEnvironment object itself. - */ - public AppServiceEnvironment withSslCertKeyVaultId(String sslCertKeyVaultId) { - this.sslCertKeyVaultId = sslCertKeyVaultId; - return this; - } - - /** - * Get the sslCertKeyVaultSecretName property: Key Vault Secret Name for ILB App Service Environment default SSL - * certificate. - * - * @return the sslCertKeyVaultSecretName value. - */ - public String sslCertKeyVaultSecretName() { - return this.sslCertKeyVaultSecretName; - } - - /** - * Set the sslCertKeyVaultSecretName property: Key Vault Secret Name for ILB App Service Environment default SSL - * certificate. - * - * @param sslCertKeyVaultSecretName the sslCertKeyVaultSecretName value to set. - * @return the AppServiceEnvironment object itself. - */ - public AppServiceEnvironment withSslCertKeyVaultSecretName(String sslCertKeyVaultSecretName) { - this.sslCertKeyVaultSecretName = sslCertKeyVaultSecretName; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property name in model AppServiceEnvironment")); - } - if (location() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property location in model AppServiceEnvironment")); - } - if (virtualNetwork() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property virtualNetwork in model AppServiceEnvironment")); - } else { - virtualNetwork().validate(); - } - if (workerPools() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property workerPools in model AppServiceEnvironment")); - } else { - workerPools().forEach(e -> e.validate()); - } - if (vipMappings() != null) { - vipMappings().forEach(e -> e.validate()); - } - if (environmentCapacities() != null) { - environmentCapacities().forEach(e -> e.validate()); - } - if (networkAccessControlList() != null) { - networkAccessControlList().forEach(e -> e.validate()); - } - if (clusterSettings() != null) { - clusterSettings().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/AppServiceEnvironmentResourceInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/AppServiceEnvironmentResourceInner.java deleted file mode 100644 index 43d2f2d38260..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/AppServiceEnvironmentResourceInner.java +++ /dev/null @@ -1,774 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.HostingEnvironmentStatus; -import com.azure.resourcemanager.appservice.models.InternalLoadBalancingMode; -import com.azure.resourcemanager.appservice.models.NameValuePair; -import com.azure.resourcemanager.appservice.models.NetworkAccessControlEntry; -import com.azure.resourcemanager.appservice.models.ProvisioningState; -import com.azure.resourcemanager.appservice.models.VirtualIpMapping; -import com.azure.resourcemanager.appservice.models.VirtualNetworkProfile; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** App Service Environment ARM resource. */ -@Fluent -public final class AppServiceEnvironmentResourceInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AppServiceEnvironmentResourceInner.class); - - /* - * Core resource properties - */ - @JsonProperty(value = "properties") - private AppServiceEnvironment innerProperties; - - /* - * Kind of resource. - */ - @JsonProperty(value = "kind") - private String kind; - - /** - * Get the innerProperties property: Core resource properties. - * - * @return the innerProperties value. - */ - private AppServiceEnvironment innerProperties() { - return this.innerProperties; - } - - /** - * Get the kind property: Kind of resource. - * - * @return the kind value. - */ - public String kind() { - return this.kind; - } - - /** - * Set the kind property: Kind of resource. - * - * @param kind the kind value to set. - * @return the AppServiceEnvironmentResourceInner object itself. - */ - public AppServiceEnvironmentResourceInner withKind(String kind) { - this.kind = kind; - return this; - } - - /** {@inheritDoc} */ - @Override - public AppServiceEnvironmentResourceInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public AppServiceEnvironmentResourceInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the name property: Name of the App Service Environment. - * - * @return the name value. - */ - public String namePropertiesName() { - return this.innerProperties() == null ? null : this.innerProperties().name(); - } - - /** - * Set the name property: Name of the App Service Environment. - * - * @param name the name value to set. - * @return the AppServiceEnvironmentResourceInner object itself. - */ - public AppServiceEnvironmentResourceInner withNamePropertiesName(String name) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServiceEnvironment(); - } - this.innerProperties().withName(name); - return this; - } - - /** - * Get the location property: Location of the App Service Environment, e.g. "West US". - * - * @return the location value. - */ - public String locationPropertiesLocation() { - return this.innerProperties() == null ? null : this.innerProperties().location(); - } - - /** - * Set the location property: Location of the App Service Environment, e.g. "West US". - * - * @param location the location value to set. - * @return the AppServiceEnvironmentResourceInner object itself. - */ - public AppServiceEnvironmentResourceInner withLocationPropertiesLocation(String location) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServiceEnvironment(); - } - this.innerProperties().withLocation(location); - return this; - } - - /** - * Get the provisioningState property: Provisioning state of the App Service Environment. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the status property: Current status of the App Service Environment. - * - * @return the status value. - */ - public HostingEnvironmentStatus status() { - return this.innerProperties() == null ? null : this.innerProperties().status(); - } - - /** - * Get the vnetName property: Name of the Virtual Network for the App Service Environment. - * - * @return the vnetName value. - */ - public String vnetName() { - return this.innerProperties() == null ? null : this.innerProperties().vnetName(); - } - - /** - * Set the vnetName property: Name of the Virtual Network for the App Service Environment. - * - * @param vnetName the vnetName value to set. - * @return the AppServiceEnvironmentResourceInner object itself. - */ - public AppServiceEnvironmentResourceInner withVnetName(String vnetName) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServiceEnvironment(); - } - this.innerProperties().withVnetName(vnetName); - return this; - } - - /** - * Get the vnetResourceGroupName property: Resource group of the Virtual Network. - * - * @return the vnetResourceGroupName value. - */ - public String vnetResourceGroupName() { - return this.innerProperties() == null ? null : this.innerProperties().vnetResourceGroupName(); - } - - /** - * Set the vnetResourceGroupName property: Resource group of the Virtual Network. - * - * @param vnetResourceGroupName the vnetResourceGroupName value to set. - * @return the AppServiceEnvironmentResourceInner object itself. - */ - public AppServiceEnvironmentResourceInner withVnetResourceGroupName(String vnetResourceGroupName) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServiceEnvironment(); - } - this.innerProperties().withVnetResourceGroupName(vnetResourceGroupName); - return this; - } - - /** - * Get the vnetSubnetName property: Subnet of the Virtual Network. - * - * @return the vnetSubnetName value. - */ - public String vnetSubnetName() { - return this.innerProperties() == null ? null : this.innerProperties().vnetSubnetName(); - } - - /** - * Set the vnetSubnetName property: Subnet of the Virtual Network. - * - * @param vnetSubnetName the vnetSubnetName value to set. - * @return the AppServiceEnvironmentResourceInner object itself. - */ - public AppServiceEnvironmentResourceInner withVnetSubnetName(String vnetSubnetName) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServiceEnvironment(); - } - this.innerProperties().withVnetSubnetName(vnetSubnetName); - return this; - } - - /** - * Get the virtualNetwork property: Description of the Virtual Network. - * - * @return the virtualNetwork value. - */ - public VirtualNetworkProfile virtualNetwork() { - return this.innerProperties() == null ? null : this.innerProperties().virtualNetwork(); - } - - /** - * Set the virtualNetwork property: Description of the Virtual Network. - * - * @param virtualNetwork the virtualNetwork value to set. - * @return the AppServiceEnvironmentResourceInner object itself. - */ - public AppServiceEnvironmentResourceInner withVirtualNetwork(VirtualNetworkProfile virtualNetwork) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServiceEnvironment(); - } - this.innerProperties().withVirtualNetwork(virtualNetwork); - return this; - } - - /** - * Get the internalLoadBalancingMode property: Specifies which endpoints to serve internally in the Virtual Network - * for the App Service Environment. - * - * @return the internalLoadBalancingMode value. - */ - public InternalLoadBalancingMode internalLoadBalancingMode() { - return this.innerProperties() == null ? null : this.innerProperties().internalLoadBalancingMode(); - } - - /** - * Set the internalLoadBalancingMode property: Specifies which endpoints to serve internally in the Virtual Network - * for the App Service Environment. - * - * @param internalLoadBalancingMode the internalLoadBalancingMode value to set. - * @return the AppServiceEnvironmentResourceInner object itself. - */ - public AppServiceEnvironmentResourceInner withInternalLoadBalancingMode( - InternalLoadBalancingMode internalLoadBalancingMode) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServiceEnvironment(); - } - this.innerProperties().withInternalLoadBalancingMode(internalLoadBalancingMode); - return this; - } - - /** - * Get the multiSize property: Front-end VM size, e.g. "Medium", "Large". - * - * @return the multiSize value. - */ - public String multiSize() { - return this.innerProperties() == null ? null : this.innerProperties().multiSize(); - } - - /** - * Set the multiSize property: Front-end VM size, e.g. "Medium", "Large". - * - * @param multiSize the multiSize value to set. - * @return the AppServiceEnvironmentResourceInner object itself. - */ - public AppServiceEnvironmentResourceInner withMultiSize(String multiSize) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServiceEnvironment(); - } - this.innerProperties().withMultiSize(multiSize); - return this; - } - - /** - * Get the multiRoleCount property: Number of front-end instances. - * - * @return the multiRoleCount value. - */ - public Integer multiRoleCount() { - return this.innerProperties() == null ? null : this.innerProperties().multiRoleCount(); - } - - /** - * Set the multiRoleCount property: Number of front-end instances. - * - * @param multiRoleCount the multiRoleCount value to set. - * @return the AppServiceEnvironmentResourceInner object itself. - */ - public AppServiceEnvironmentResourceInner withMultiRoleCount(Integer multiRoleCount) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServiceEnvironment(); - } - this.innerProperties().withMultiRoleCount(multiRoleCount); - return this; - } - - /** - * Get the workerPools property: Description of worker pools with worker size IDs, VM sizes, and number of workers - * in each pool. - * - * @return the workerPools value. - */ - public List workerPools() { - return this.innerProperties() == null ? null : this.innerProperties().workerPools(); - } - - /** - * Set the workerPools property: Description of worker pools with worker size IDs, VM sizes, and number of workers - * in each pool. - * - * @param workerPools the workerPools value to set. - * @return the AppServiceEnvironmentResourceInner object itself. - */ - public AppServiceEnvironmentResourceInner withWorkerPools(List workerPools) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServiceEnvironment(); - } - this.innerProperties().withWorkerPools(workerPools); - return this; - } - - /** - * Get the ipsslAddressCount property: Number of IP SSL addresses reserved for the App Service Environment. - * - * @return the ipsslAddressCount value. - */ - public Integer ipsslAddressCount() { - return this.innerProperties() == null ? null : this.innerProperties().ipsslAddressCount(); - } - - /** - * Set the ipsslAddressCount property: Number of IP SSL addresses reserved for the App Service Environment. - * - * @param ipsslAddressCount the ipsslAddressCount value to set. - * @return the AppServiceEnvironmentResourceInner object itself. - */ - public AppServiceEnvironmentResourceInner withIpsslAddressCount(Integer ipsslAddressCount) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServiceEnvironment(); - } - this.innerProperties().withIpsslAddressCount(ipsslAddressCount); - return this; - } - - /** - * Get the databaseEdition property: Edition of the metadata database for the App Service Environment, e.g. - * "Standard". - * - * @return the databaseEdition value. - */ - public String databaseEdition() { - return this.innerProperties() == null ? null : this.innerProperties().databaseEdition(); - } - - /** - * Get the databaseServiceObjective property: Service objective of the metadata database for the App Service - * Environment, e.g. "S0". - * - * @return the databaseServiceObjective value. - */ - public String databaseServiceObjective() { - return this.innerProperties() == null ? null : this.innerProperties().databaseServiceObjective(); - } - - /** - * Get the upgradeDomains property: Number of upgrade domains of the App Service Environment. - * - * @return the upgradeDomains value. - */ - public Integer upgradeDomains() { - return this.innerProperties() == null ? null : this.innerProperties().upgradeDomains(); - } - - /** - * Get the subscriptionId property: Subscription of the App Service Environment. - * - * @return the subscriptionId value. - */ - public String subscriptionId() { - return this.innerProperties() == null ? null : this.innerProperties().subscriptionId(); - } - - /** - * Get the dnsSuffix property: DNS suffix of the App Service Environment. - * - * @return the dnsSuffix value. - */ - public String dnsSuffix() { - return this.innerProperties() == null ? null : this.innerProperties().dnsSuffix(); - } - - /** - * Set the dnsSuffix property: DNS suffix of the App Service Environment. - * - * @param dnsSuffix the dnsSuffix value to set. - * @return the AppServiceEnvironmentResourceInner object itself. - */ - public AppServiceEnvironmentResourceInner withDnsSuffix(String dnsSuffix) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServiceEnvironment(); - } - this.innerProperties().withDnsSuffix(dnsSuffix); - return this; - } - - /** - * Get the lastAction property: Last deployment action on the App Service Environment. - * - * @return the lastAction value. - */ - public String lastAction() { - return this.innerProperties() == null ? null : this.innerProperties().lastAction(); - } - - /** - * Get the lastActionResult property: Result of the last deployment action on the App Service Environment. - * - * @return the lastActionResult value. - */ - public String lastActionResult() { - return this.innerProperties() == null ? null : this.innerProperties().lastActionResult(); - } - - /** - * Get the allowedMultiSizes property: List of comma separated strings describing which VM sizes are allowed for - * front-ends. - * - * @return the allowedMultiSizes value. - */ - public String allowedMultiSizes() { - return this.innerProperties() == null ? null : this.innerProperties().allowedMultiSizes(); - } - - /** - * Get the allowedWorkerSizes property: List of comma separated strings describing which VM sizes are allowed for - * workers. - * - * @return the allowedWorkerSizes value. - */ - public String allowedWorkerSizes() { - return this.innerProperties() == null ? null : this.innerProperties().allowedWorkerSizes(); - } - - /** - * Get the maximumNumberOfMachines property: Maximum number of VMs in the App Service Environment. - * - * @return the maximumNumberOfMachines value. - */ - public Integer maximumNumberOfMachines() { - return this.innerProperties() == null ? null : this.innerProperties().maximumNumberOfMachines(); - } - - /** - * Get the vipMappings property: Description of IP SSL mapping for the App Service Environment. - * - * @return the vipMappings value. - */ - public List vipMappings() { - return this.innerProperties() == null ? null : this.innerProperties().vipMappings(); - } - - /** - * Get the environmentCapacities property: Current total, used, and available worker capacities. - * - * @return the environmentCapacities value. - */ - public List environmentCapacities() { - return this.innerProperties() == null ? null : this.innerProperties().environmentCapacities(); - } - - /** - * Get the networkAccessControlList property: Access control list for controlling traffic to the App Service - * Environment. - * - * @return the networkAccessControlList value. - */ - public List networkAccessControlList() { - return this.innerProperties() == null ? null : this.innerProperties().networkAccessControlList(); - } - - /** - * Set the networkAccessControlList property: Access control list for controlling traffic to the App Service - * Environment. - * - * @param networkAccessControlList the networkAccessControlList value to set. - * @return the AppServiceEnvironmentResourceInner object itself. - */ - public AppServiceEnvironmentResourceInner withNetworkAccessControlList( - List networkAccessControlList) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServiceEnvironment(); - } - this.innerProperties().withNetworkAccessControlList(networkAccessControlList); - return this; - } - - /** - * Get the environmentIsHealthy property: True/false indicating whether the App Service Environment is healthy. - * - * @return the environmentIsHealthy value. - */ - public Boolean environmentIsHealthy() { - return this.innerProperties() == null ? null : this.innerProperties().environmentIsHealthy(); - } - - /** - * Get the environmentStatus property: Detailed message about with results of the last check of the App Service - * Environment. - * - * @return the environmentStatus value. - */ - public String environmentStatus() { - return this.innerProperties() == null ? null : this.innerProperties().environmentStatus(); - } - - /** - * Get the resourceGroup property: Resource group of the App Service Environment. - * - * @return the resourceGroup value. - */ - public String resourceGroup() { - return this.innerProperties() == null ? null : this.innerProperties().resourceGroup(); - } - - /** - * Get the frontEndScaleFactor property: Scale factor for front-ends. - * - * @return the frontEndScaleFactor value. - */ - public Integer frontEndScaleFactor() { - return this.innerProperties() == null ? null : this.innerProperties().frontEndScaleFactor(); - } - - /** - * Set the frontEndScaleFactor property: Scale factor for front-ends. - * - * @param frontEndScaleFactor the frontEndScaleFactor value to set. - * @return the AppServiceEnvironmentResourceInner object itself. - */ - public AppServiceEnvironmentResourceInner withFrontEndScaleFactor(Integer frontEndScaleFactor) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServiceEnvironment(); - } - this.innerProperties().withFrontEndScaleFactor(frontEndScaleFactor); - return this; - } - - /** - * Get the defaultFrontEndScaleFactor property: Default Scale Factor for FrontEnds. - * - * @return the defaultFrontEndScaleFactor value. - */ - public Integer defaultFrontEndScaleFactor() { - return this.innerProperties() == null ? null : this.innerProperties().defaultFrontEndScaleFactor(); - } - - /** - * Get the apiManagementAccountId property: API Management Account associated with the App Service Environment. - * - * @return the apiManagementAccountId value. - */ - public String apiManagementAccountId() { - return this.innerProperties() == null ? null : this.innerProperties().apiManagementAccountId(); - } - - /** - * Set the apiManagementAccountId property: API Management Account associated with the App Service Environment. - * - * @param apiManagementAccountId the apiManagementAccountId value to set. - * @return the AppServiceEnvironmentResourceInner object itself. - */ - public AppServiceEnvironmentResourceInner withApiManagementAccountId(String apiManagementAccountId) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServiceEnvironment(); - } - this.innerProperties().withApiManagementAccountId(apiManagementAccountId); - return this; - } - - /** - * Get the suspended property: <code>true</code> if the App Service Environment is suspended; otherwise, - * <code>false</code>. The environment can be suspended, e.g. when the management endpoint is no longer - * available (most likely because NSG blocked the incoming traffic). - * - * @return the suspended value. - */ - public Boolean suspended() { - return this.innerProperties() == null ? null : this.innerProperties().suspended(); - } - - /** - * Set the suspended property: <code>true</code> if the App Service Environment is suspended; otherwise, - * <code>false</code>. The environment can be suspended, e.g. when the management endpoint is no longer - * available (most likely because NSG blocked the incoming traffic). - * - * @param suspended the suspended value to set. - * @return the AppServiceEnvironmentResourceInner object itself. - */ - public AppServiceEnvironmentResourceInner withSuspended(Boolean suspended) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServiceEnvironment(); - } - this.innerProperties().withSuspended(suspended); - return this; - } - - /** - * Get the dynamicCacheEnabled property: True/false indicating whether the App Service Environment is suspended. The - * environment can be suspended e.g. when the management endpoint is no longer available (most likely because NSG - * blocked the incoming traffic). - * - * @return the dynamicCacheEnabled value. - */ - public Boolean dynamicCacheEnabled() { - return this.innerProperties() == null ? null : this.innerProperties().dynamicCacheEnabled(); - } - - /** - * Set the dynamicCacheEnabled property: True/false indicating whether the App Service Environment is suspended. The - * environment can be suspended e.g. when the management endpoint is no longer available (most likely because NSG - * blocked the incoming traffic). - * - * @param dynamicCacheEnabled the dynamicCacheEnabled value to set. - * @return the AppServiceEnvironmentResourceInner object itself. - */ - public AppServiceEnvironmentResourceInner withDynamicCacheEnabled(Boolean dynamicCacheEnabled) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServiceEnvironment(); - } - this.innerProperties().withDynamicCacheEnabled(dynamicCacheEnabled); - return this; - } - - /** - * Get the clusterSettings property: Custom settings for changing the behavior of the App Service Environment. - * - * @return the clusterSettings value. - */ - public List clusterSettings() { - return this.innerProperties() == null ? null : this.innerProperties().clusterSettings(); - } - - /** - * Set the clusterSettings property: Custom settings for changing the behavior of the App Service Environment. - * - * @param clusterSettings the clusterSettings value to set. - * @return the AppServiceEnvironmentResourceInner object itself. - */ - public AppServiceEnvironmentResourceInner withClusterSettings(List clusterSettings) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServiceEnvironment(); - } - this.innerProperties().withClusterSettings(clusterSettings); - return this; - } - - /** - * Get the userWhitelistedIpRanges property: User added ip ranges to whitelist on ASE db. - * - * @return the userWhitelistedIpRanges value. - */ - public List userWhitelistedIpRanges() { - return this.innerProperties() == null ? null : this.innerProperties().userWhitelistedIpRanges(); - } - - /** - * Set the userWhitelistedIpRanges property: User added ip ranges to whitelist on ASE db. - * - * @param userWhitelistedIpRanges the userWhitelistedIpRanges value to set. - * @return the AppServiceEnvironmentResourceInner object itself. - */ - public AppServiceEnvironmentResourceInner withUserWhitelistedIpRanges(List userWhitelistedIpRanges) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServiceEnvironment(); - } - this.innerProperties().withUserWhitelistedIpRanges(userWhitelistedIpRanges); - return this; - } - - /** - * Get the hasLinuxWorkers property: Flag that displays whether an ASE has linux workers or not. - * - * @return the hasLinuxWorkers value. - */ - public Boolean hasLinuxWorkers() { - return this.innerProperties() == null ? null : this.innerProperties().hasLinuxWorkers(); - } - - /** - * Set the hasLinuxWorkers property: Flag that displays whether an ASE has linux workers or not. - * - * @param hasLinuxWorkers the hasLinuxWorkers value to set. - * @return the AppServiceEnvironmentResourceInner object itself. - */ - public AppServiceEnvironmentResourceInner withHasLinuxWorkers(Boolean hasLinuxWorkers) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServiceEnvironment(); - } - this.innerProperties().withHasLinuxWorkers(hasLinuxWorkers); - return this; - } - - /** - * Get the sslCertKeyVaultId property: Key Vault ID for ILB App Service Environment default SSL certificate. - * - * @return the sslCertKeyVaultId value. - */ - public String sslCertKeyVaultId() { - return this.innerProperties() == null ? null : this.innerProperties().sslCertKeyVaultId(); - } - - /** - * Set the sslCertKeyVaultId property: Key Vault ID for ILB App Service Environment default SSL certificate. - * - * @param sslCertKeyVaultId the sslCertKeyVaultId value to set. - * @return the AppServiceEnvironmentResourceInner object itself. - */ - public AppServiceEnvironmentResourceInner withSslCertKeyVaultId(String sslCertKeyVaultId) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServiceEnvironment(); - } - this.innerProperties().withSslCertKeyVaultId(sslCertKeyVaultId); - return this; - } - - /** - * Get the sslCertKeyVaultSecretName property: Key Vault Secret Name for ILB App Service Environment default SSL - * certificate. - * - * @return the sslCertKeyVaultSecretName value. - */ - public String sslCertKeyVaultSecretName() { - return this.innerProperties() == null ? null : this.innerProperties().sslCertKeyVaultSecretName(); - } - - /** - * Set the sslCertKeyVaultSecretName property: Key Vault Secret Name for ILB App Service Environment default SSL - * certificate. - * - * @param sslCertKeyVaultSecretName the sslCertKeyVaultSecretName value to set. - * @return the AppServiceEnvironmentResourceInner object itself. - */ - public AppServiceEnvironmentResourceInner withSslCertKeyVaultSecretName(String sslCertKeyVaultSecretName) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServiceEnvironment(); - } - this.innerProperties().withSslCertKeyVaultSecretName(sslCertKeyVaultSecretName); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/AppServicePlanInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/AppServicePlanInner.java deleted file mode 100644 index a0297a57c7c2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/AppServicePlanInner.java +++ /dev/null @@ -1,474 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.HostingEnvironmentProfile; -import com.azure.resourcemanager.appservice.models.ProvisioningState; -import com.azure.resourcemanager.appservice.models.SkuDescription; -import com.azure.resourcemanager.appservice.models.StatusOptions; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.Map; - -/** App Service plan. */ -@Fluent -public final class AppServicePlanInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AppServicePlanInner.class); - - /* - * AppServicePlan resource specific properties - */ - @JsonProperty(value = "properties") - private AppServicePlanProperties innerProperties; - - /* - * Description of a SKU for a scalable resource. - */ - @JsonProperty(value = "sku") - private SkuDescription sku; - - /* - * Kind of resource. - */ - @JsonProperty(value = "kind") - private String kind; - - /** - * Get the innerProperties property: AppServicePlan resource specific properties. - * - * @return the innerProperties value. - */ - private AppServicePlanProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the sku property: Description of a SKU for a scalable resource. - * - * @return the sku value. - */ - public SkuDescription sku() { - return this.sku; - } - - /** - * Set the sku property: Description of a SKU for a scalable resource. - * - * @param sku the sku value to set. - * @return the AppServicePlanInner object itself. - */ - public AppServicePlanInner withSku(SkuDescription sku) { - this.sku = sku; - return this; - } - - /** - * Get the kind property: Kind of resource. - * - * @return the kind value. - */ - public String kind() { - return this.kind; - } - - /** - * Set the kind property: Kind of resource. - * - * @param kind the kind value to set. - * @return the AppServicePlanInner object itself. - */ - public AppServicePlanInner withKind(String kind) { - this.kind = kind; - return this; - } - - /** {@inheritDoc} */ - @Override - public AppServicePlanInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public AppServicePlanInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the workerTierName property: Target worker tier assigned to the App Service plan. - * - * @return the workerTierName value. - */ - public String workerTierName() { - return this.innerProperties() == null ? null : this.innerProperties().workerTierName(); - } - - /** - * Set the workerTierName property: Target worker tier assigned to the App Service plan. - * - * @param workerTierName the workerTierName value to set. - * @return the AppServicePlanInner object itself. - */ - public AppServicePlanInner withWorkerTierName(String workerTierName) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServicePlanProperties(); - } - this.innerProperties().withWorkerTierName(workerTierName); - return this; - } - - /** - * Get the status property: App Service plan status. - * - * @return the status value. - */ - public StatusOptions status() { - return this.innerProperties() == null ? null : this.innerProperties().status(); - } - - /** - * Get the subscription property: App Service plan subscription. - * - * @return the subscription value. - */ - public String subscription() { - return this.innerProperties() == null ? null : this.innerProperties().subscription(); - } - - /** - * Get the hostingEnvironmentProfile property: Specification for the App Service Environment to use for the App - * Service plan. - * - * @return the hostingEnvironmentProfile value. - */ - public HostingEnvironmentProfile hostingEnvironmentProfile() { - return this.innerProperties() == null ? null : this.innerProperties().hostingEnvironmentProfile(); - } - - /** - * Set the hostingEnvironmentProfile property: Specification for the App Service Environment to use for the App - * Service plan. - * - * @param hostingEnvironmentProfile the hostingEnvironmentProfile value to set. - * @return the AppServicePlanInner object itself. - */ - public AppServicePlanInner withHostingEnvironmentProfile(HostingEnvironmentProfile hostingEnvironmentProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServicePlanProperties(); - } - this.innerProperties().withHostingEnvironmentProfile(hostingEnvironmentProfile); - return this; - } - - /** - * Get the maximumNumberOfWorkers property: Maximum number of instances that can be assigned to this App Service - * plan. - * - * @return the maximumNumberOfWorkers value. - */ - public Integer maximumNumberOfWorkers() { - return this.innerProperties() == null ? null : this.innerProperties().maximumNumberOfWorkers(); - } - - /** - * Get the geoRegion property: Geographical location for the App Service plan. - * - * @return the geoRegion value. - */ - public String geoRegion() { - return this.innerProperties() == null ? null : this.innerProperties().geoRegion(); - } - - /** - * Get the perSiteScaling property: If <code>true</code>, apps assigned to this App Service plan can be - * scaled independently. If <code>false</code>, apps assigned to this App Service plan will scale to all - * instances of the plan. - * - * @return the perSiteScaling value. - */ - public Boolean perSiteScaling() { - return this.innerProperties() == null ? null : this.innerProperties().perSiteScaling(); - } - - /** - * Set the perSiteScaling property: If <code>true</code>, apps assigned to this App Service plan can be - * scaled independently. If <code>false</code>, apps assigned to this App Service plan will scale to all - * instances of the plan. - * - * @param perSiteScaling the perSiteScaling value to set. - * @return the AppServicePlanInner object itself. - */ - public AppServicePlanInner withPerSiteScaling(Boolean perSiteScaling) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServicePlanProperties(); - } - this.innerProperties().withPerSiteScaling(perSiteScaling); - return this; - } - - /** - * Get the maximumElasticWorkerCount property: Maximum number of total workers allowed for this ElasticScaleEnabled - * App Service Plan. - * - * @return the maximumElasticWorkerCount value. - */ - public Integer maximumElasticWorkerCount() { - return this.innerProperties() == null ? null : this.innerProperties().maximumElasticWorkerCount(); - } - - /** - * Set the maximumElasticWorkerCount property: Maximum number of total workers allowed for this ElasticScaleEnabled - * App Service Plan. - * - * @param maximumElasticWorkerCount the maximumElasticWorkerCount value to set. - * @return the AppServicePlanInner object itself. - */ - public AppServicePlanInner withMaximumElasticWorkerCount(Integer maximumElasticWorkerCount) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServicePlanProperties(); - } - this.innerProperties().withMaximumElasticWorkerCount(maximumElasticWorkerCount); - return this; - } - - /** - * Get the numberOfSites property: Number of apps assigned to this App Service plan. - * - * @return the numberOfSites value. - */ - public Integer numberOfSites() { - return this.innerProperties() == null ? null : this.innerProperties().numberOfSites(); - } - - /** - * Get the isSpot property: If <code>true</code>, this App Service Plan owns spot instances. - * - * @return the isSpot value. - */ - public Boolean isSpot() { - return this.innerProperties() == null ? null : this.innerProperties().isSpot(); - } - - /** - * Set the isSpot property: If <code>true</code>, this App Service Plan owns spot instances. - * - * @param isSpot the isSpot value to set. - * @return the AppServicePlanInner object itself. - */ - public AppServicePlanInner withIsSpot(Boolean isSpot) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServicePlanProperties(); - } - this.innerProperties().withIsSpot(isSpot); - return this; - } - - /** - * Get the spotExpirationTime property: The time when the server farm expires. Valid only if it is a spot server - * farm. - * - * @return the spotExpirationTime value. - */ - public OffsetDateTime spotExpirationTime() { - return this.innerProperties() == null ? null : this.innerProperties().spotExpirationTime(); - } - - /** - * Set the spotExpirationTime property: The time when the server farm expires. Valid only if it is a spot server - * farm. - * - * @param spotExpirationTime the spotExpirationTime value to set. - * @return the AppServicePlanInner object itself. - */ - public AppServicePlanInner withSpotExpirationTime(OffsetDateTime spotExpirationTime) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServicePlanProperties(); - } - this.innerProperties().withSpotExpirationTime(spotExpirationTime); - return this; - } - - /** - * Get the freeOfferExpirationTime property: The time when the server farm free offer expires. - * - * @return the freeOfferExpirationTime value. - */ - public OffsetDateTime freeOfferExpirationTime() { - return this.innerProperties() == null ? null : this.innerProperties().freeOfferExpirationTime(); - } - - /** - * Set the freeOfferExpirationTime property: The time when the server farm free offer expires. - * - * @param freeOfferExpirationTime the freeOfferExpirationTime value to set. - * @return the AppServicePlanInner object itself. - */ - public AppServicePlanInner withFreeOfferExpirationTime(OffsetDateTime freeOfferExpirationTime) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServicePlanProperties(); - } - this.innerProperties().withFreeOfferExpirationTime(freeOfferExpirationTime); - return this; - } - - /** - * Get the resourceGroup property: Resource group of the App Service plan. - * - * @return the resourceGroup value. - */ - public String resourceGroup() { - return this.innerProperties() == null ? null : this.innerProperties().resourceGroup(); - } - - /** - * Get the reserved property: If Linux app service plan <code>true</code>, - * <code>false</code> otherwise. - * - * @return the reserved value. - */ - public Boolean reserved() { - return this.innerProperties() == null ? null : this.innerProperties().reserved(); - } - - /** - * Set the reserved property: If Linux app service plan <code>true</code>, - * <code>false</code> otherwise. - * - * @param reserved the reserved value to set. - * @return the AppServicePlanInner object itself. - */ - public AppServicePlanInner withReserved(Boolean reserved) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServicePlanProperties(); - } - this.innerProperties().withReserved(reserved); - return this; - } - - /** - * Get the isXenon property: Obsolete: If Hyper-V container app service plan <code>true</code>, - * <code>false</code> otherwise. - * - * @return the isXenon value. - */ - public Boolean isXenon() { - return this.innerProperties() == null ? null : this.innerProperties().isXenon(); - } - - /** - * Set the isXenon property: Obsolete: If Hyper-V container app service plan <code>true</code>, - * <code>false</code> otherwise. - * - * @param isXenon the isXenon value to set. - * @return the AppServicePlanInner object itself. - */ - public AppServicePlanInner withIsXenon(Boolean isXenon) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServicePlanProperties(); - } - this.innerProperties().withIsXenon(isXenon); - return this; - } - - /** - * Get the hyperV property: If Hyper-V container app service plan <code>true</code>, - * <code>false</code> otherwise. - * - * @return the hyperV value. - */ - public Boolean hyperV() { - return this.innerProperties() == null ? null : this.innerProperties().hyperV(); - } - - /** - * Set the hyperV property: If Hyper-V container app service plan <code>true</code>, - * <code>false</code> otherwise. - * - * @param hyperV the hyperV value to set. - * @return the AppServicePlanInner object itself. - */ - public AppServicePlanInner withHyperV(Boolean hyperV) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServicePlanProperties(); - } - this.innerProperties().withHyperV(hyperV); - return this; - } - - /** - * Get the targetWorkerCount property: Scaling worker count. - * - * @return the targetWorkerCount value. - */ - public Integer targetWorkerCount() { - return this.innerProperties() == null ? null : this.innerProperties().targetWorkerCount(); - } - - /** - * Set the targetWorkerCount property: Scaling worker count. - * - * @param targetWorkerCount the targetWorkerCount value to set. - * @return the AppServicePlanInner object itself. - */ - public AppServicePlanInner withTargetWorkerCount(Integer targetWorkerCount) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServicePlanProperties(); - } - this.innerProperties().withTargetWorkerCount(targetWorkerCount); - return this; - } - - /** - * Get the targetWorkerSizeId property: Scaling worker size ID. - * - * @return the targetWorkerSizeId value. - */ - public Integer targetWorkerSizeId() { - return this.innerProperties() == null ? null : this.innerProperties().targetWorkerSizeId(); - } - - /** - * Set the targetWorkerSizeId property: Scaling worker size ID. - * - * @param targetWorkerSizeId the targetWorkerSizeId value to set. - * @return the AppServicePlanInner object itself. - */ - public AppServicePlanInner withTargetWorkerSizeId(Integer targetWorkerSizeId) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServicePlanProperties(); - } - this.innerProperties().withTargetWorkerSizeId(targetWorkerSizeId); - return this; - } - - /** - * Get the provisioningState property: Provisioning state of the App Service Environment. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - if (sku() != null) { - sku().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/AppServicePlanPatchResourceProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/AppServicePlanPatchResourceProperties.java deleted file mode 100644 index d3895bdd2707..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/AppServicePlanPatchResourceProperties.java +++ /dev/null @@ -1,476 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.HostingEnvironmentProfile; -import com.azure.resourcemanager.appservice.models.ProvisioningState; -import com.azure.resourcemanager.appservice.models.StatusOptions; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** AppServicePlanPatchResource resource specific properties. */ -@Fluent -public final class AppServicePlanPatchResourceProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AppServicePlanPatchResourceProperties.class); - - /* - * Target worker tier assigned to the App Service plan. - */ - @JsonProperty(value = "workerTierName") - private String workerTierName; - - /* - * App Service plan status. - */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) - private StatusOptions status; - - /* - * App Service plan subscription. - */ - @JsonProperty(value = "subscription", access = JsonProperty.Access.WRITE_ONLY) - private String subscription; - - /* - * Specification for the App Service Environment to use for the App Service - * plan. - */ - @JsonProperty(value = "hostingEnvironmentProfile") - private HostingEnvironmentProfile hostingEnvironmentProfile; - - /* - * Maximum number of instances that can be assigned to this App Service - * plan. - */ - @JsonProperty(value = "maximumNumberOfWorkers", access = JsonProperty.Access.WRITE_ONLY) - private Integer maximumNumberOfWorkers; - - /* - * Geographical location for the App Service plan. - */ - @JsonProperty(value = "geoRegion", access = JsonProperty.Access.WRITE_ONLY) - private String geoRegion; - - /* - * If true, apps assigned to this App Service plan can be - * scaled independently. - * If false, apps assigned to this App Service plan will scale - * to all instances of the plan. - */ - @JsonProperty(value = "perSiteScaling") - private Boolean perSiteScaling; - - /* - * Maximum number of total workers allowed for this ElasticScaleEnabled App - * Service Plan - */ - @JsonProperty(value = "maximumElasticWorkerCount") - private Integer maximumElasticWorkerCount; - - /* - * Number of apps assigned to this App Service plan. - */ - @JsonProperty(value = "numberOfSites", access = JsonProperty.Access.WRITE_ONLY) - private Integer numberOfSites; - - /* - * If true, this App Service Plan owns spot instances. - */ - @JsonProperty(value = "isSpot") - private Boolean isSpot; - - /* - * The time when the server farm expires. Valid only if it is a spot server - * farm. - */ - @JsonProperty(value = "spotExpirationTime") - private OffsetDateTime spotExpirationTime; - - /* - * The time when the server farm free offer expires. - */ - @JsonProperty(value = "freeOfferExpirationTime") - private OffsetDateTime freeOfferExpirationTime; - - /* - * Resource group of the App Service plan. - */ - @JsonProperty(value = "resourceGroup", access = JsonProperty.Access.WRITE_ONLY) - private String resourceGroup; - - /* - * If Linux app service plan true, false - * otherwise. - */ - @JsonProperty(value = "reserved") - private Boolean reserved; - - /* - * Obsolete: If Hyper-V container app service plan true, - * false otherwise. - */ - @JsonProperty(value = "isXenon") - private Boolean isXenon; - - /* - * If Hyper-V container app service plan true, - * false otherwise. - */ - @JsonProperty(value = "hyperV") - private Boolean hyperV; - - /* - * Scaling worker count. - */ - @JsonProperty(value = "targetWorkerCount") - private Integer targetWorkerCount; - - /* - * Scaling worker size ID. - */ - @JsonProperty(value = "targetWorkerSizeId") - private Integer targetWorkerSizeId; - - /* - * Provisioning state of the App Service Environment. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private ProvisioningState provisioningState; - - /** - * Get the workerTierName property: Target worker tier assigned to the App Service plan. - * - * @return the workerTierName value. - */ - public String workerTierName() { - return this.workerTierName; - } - - /** - * Set the workerTierName property: Target worker tier assigned to the App Service plan. - * - * @param workerTierName the workerTierName value to set. - * @return the AppServicePlanPatchResourceProperties object itself. - */ - public AppServicePlanPatchResourceProperties withWorkerTierName(String workerTierName) { - this.workerTierName = workerTierName; - return this; - } - - /** - * Get the status property: App Service plan status. - * - * @return the status value. - */ - public StatusOptions status() { - return this.status; - } - - /** - * Get the subscription property: App Service plan subscription. - * - * @return the subscription value. - */ - public String subscription() { - return this.subscription; - } - - /** - * Get the hostingEnvironmentProfile property: Specification for the App Service Environment to use for the App - * Service plan. - * - * @return the hostingEnvironmentProfile value. - */ - public HostingEnvironmentProfile hostingEnvironmentProfile() { - return this.hostingEnvironmentProfile; - } - - /** - * Set the hostingEnvironmentProfile property: Specification for the App Service Environment to use for the App - * Service plan. - * - * @param hostingEnvironmentProfile the hostingEnvironmentProfile value to set. - * @return the AppServicePlanPatchResourceProperties object itself. - */ - public AppServicePlanPatchResourceProperties withHostingEnvironmentProfile( - HostingEnvironmentProfile hostingEnvironmentProfile) { - this.hostingEnvironmentProfile = hostingEnvironmentProfile; - return this; - } - - /** - * Get the maximumNumberOfWorkers property: Maximum number of instances that can be assigned to this App Service - * plan. - * - * @return the maximumNumberOfWorkers value. - */ - public Integer maximumNumberOfWorkers() { - return this.maximumNumberOfWorkers; - } - - /** - * Get the geoRegion property: Geographical location for the App Service plan. - * - * @return the geoRegion value. - */ - public String geoRegion() { - return this.geoRegion; - } - - /** - * Get the perSiteScaling property: If <code>true</code>, apps assigned to this App Service plan can be - * scaled independently. If <code>false</code>, apps assigned to this App Service plan will scale to all - * instances of the plan. - * - * @return the perSiteScaling value. - */ - public Boolean perSiteScaling() { - return this.perSiteScaling; - } - - /** - * Set the perSiteScaling property: If <code>true</code>, apps assigned to this App Service plan can be - * scaled independently. If <code>false</code>, apps assigned to this App Service plan will scale to all - * instances of the plan. - * - * @param perSiteScaling the perSiteScaling value to set. - * @return the AppServicePlanPatchResourceProperties object itself. - */ - public AppServicePlanPatchResourceProperties withPerSiteScaling(Boolean perSiteScaling) { - this.perSiteScaling = perSiteScaling; - return this; - } - - /** - * Get the maximumElasticWorkerCount property: Maximum number of total workers allowed for this ElasticScaleEnabled - * App Service Plan. - * - * @return the maximumElasticWorkerCount value. - */ - public Integer maximumElasticWorkerCount() { - return this.maximumElasticWorkerCount; - } - - /** - * Set the maximumElasticWorkerCount property: Maximum number of total workers allowed for this ElasticScaleEnabled - * App Service Plan. - * - * @param maximumElasticWorkerCount the maximumElasticWorkerCount value to set. - * @return the AppServicePlanPatchResourceProperties object itself. - */ - public AppServicePlanPatchResourceProperties withMaximumElasticWorkerCount(Integer maximumElasticWorkerCount) { - this.maximumElasticWorkerCount = maximumElasticWorkerCount; - return this; - } - - /** - * Get the numberOfSites property: Number of apps assigned to this App Service plan. - * - * @return the numberOfSites value. - */ - public Integer numberOfSites() { - return this.numberOfSites; - } - - /** - * Get the isSpot property: If <code>true</code>, this App Service Plan owns spot instances. - * - * @return the isSpot value. - */ - public Boolean isSpot() { - return this.isSpot; - } - - /** - * Set the isSpot property: If <code>true</code>, this App Service Plan owns spot instances. - * - * @param isSpot the isSpot value to set. - * @return the AppServicePlanPatchResourceProperties object itself. - */ - public AppServicePlanPatchResourceProperties withIsSpot(Boolean isSpot) { - this.isSpot = isSpot; - return this; - } - - /** - * Get the spotExpirationTime property: The time when the server farm expires. Valid only if it is a spot server - * farm. - * - * @return the spotExpirationTime value. - */ - public OffsetDateTime spotExpirationTime() { - return this.spotExpirationTime; - } - - /** - * Set the spotExpirationTime property: The time when the server farm expires. Valid only if it is a spot server - * farm. - * - * @param spotExpirationTime the spotExpirationTime value to set. - * @return the AppServicePlanPatchResourceProperties object itself. - */ - public AppServicePlanPatchResourceProperties withSpotExpirationTime(OffsetDateTime spotExpirationTime) { - this.spotExpirationTime = spotExpirationTime; - return this; - } - - /** - * Get the freeOfferExpirationTime property: The time when the server farm free offer expires. - * - * @return the freeOfferExpirationTime value. - */ - public OffsetDateTime freeOfferExpirationTime() { - return this.freeOfferExpirationTime; - } - - /** - * Set the freeOfferExpirationTime property: The time when the server farm free offer expires. - * - * @param freeOfferExpirationTime the freeOfferExpirationTime value to set. - * @return the AppServicePlanPatchResourceProperties object itself. - */ - public AppServicePlanPatchResourceProperties withFreeOfferExpirationTime(OffsetDateTime freeOfferExpirationTime) { - this.freeOfferExpirationTime = freeOfferExpirationTime; - return this; - } - - /** - * Get the resourceGroup property: Resource group of the App Service plan. - * - * @return the resourceGroup value. - */ - public String resourceGroup() { - return this.resourceGroup; - } - - /** - * Get the reserved property: If Linux app service plan <code>true</code>, - * <code>false</code> otherwise. - * - * @return the reserved value. - */ - public Boolean reserved() { - return this.reserved; - } - - /** - * Set the reserved property: If Linux app service plan <code>true</code>, - * <code>false</code> otherwise. - * - * @param reserved the reserved value to set. - * @return the AppServicePlanPatchResourceProperties object itself. - */ - public AppServicePlanPatchResourceProperties withReserved(Boolean reserved) { - this.reserved = reserved; - return this; - } - - /** - * Get the isXenon property: Obsolete: If Hyper-V container app service plan <code>true</code>, - * <code>false</code> otherwise. - * - * @return the isXenon value. - */ - public Boolean isXenon() { - return this.isXenon; - } - - /** - * Set the isXenon property: Obsolete: If Hyper-V container app service plan <code>true</code>, - * <code>false</code> otherwise. - * - * @param isXenon the isXenon value to set. - * @return the AppServicePlanPatchResourceProperties object itself. - */ - public AppServicePlanPatchResourceProperties withIsXenon(Boolean isXenon) { - this.isXenon = isXenon; - return this; - } - - /** - * Get the hyperV property: If Hyper-V container app service plan <code>true</code>, - * <code>false</code> otherwise. - * - * @return the hyperV value. - */ - public Boolean hyperV() { - return this.hyperV; - } - - /** - * Set the hyperV property: If Hyper-V container app service plan <code>true</code>, - * <code>false</code> otherwise. - * - * @param hyperV the hyperV value to set. - * @return the AppServicePlanPatchResourceProperties object itself. - */ - public AppServicePlanPatchResourceProperties withHyperV(Boolean hyperV) { - this.hyperV = hyperV; - return this; - } - - /** - * Get the targetWorkerCount property: Scaling worker count. - * - * @return the targetWorkerCount value. - */ - public Integer targetWorkerCount() { - return this.targetWorkerCount; - } - - /** - * Set the targetWorkerCount property: Scaling worker count. - * - * @param targetWorkerCount the targetWorkerCount value to set. - * @return the AppServicePlanPatchResourceProperties object itself. - */ - public AppServicePlanPatchResourceProperties withTargetWorkerCount(Integer targetWorkerCount) { - this.targetWorkerCount = targetWorkerCount; - return this; - } - - /** - * Get the targetWorkerSizeId property: Scaling worker size ID. - * - * @return the targetWorkerSizeId value. - */ - public Integer targetWorkerSizeId() { - return this.targetWorkerSizeId; - } - - /** - * Set the targetWorkerSizeId property: Scaling worker size ID. - * - * @param targetWorkerSizeId the targetWorkerSizeId value to set. - * @return the AppServicePlanPatchResourceProperties object itself. - */ - public AppServicePlanPatchResourceProperties withTargetWorkerSizeId(Integer targetWorkerSizeId) { - this.targetWorkerSizeId = targetWorkerSizeId; - return this; - } - - /** - * Get the provisioningState property: Provisioning state of the App Service Environment. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (hostingEnvironmentProfile() != null) { - hostingEnvironmentProfile().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/AppServicePlanProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/AppServicePlanProperties.java deleted file mode 100644 index b8a81abfc372..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/AppServicePlanProperties.java +++ /dev/null @@ -1,475 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.HostingEnvironmentProfile; -import com.azure.resourcemanager.appservice.models.ProvisioningState; -import com.azure.resourcemanager.appservice.models.StatusOptions; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** AppServicePlan resource specific properties. */ -@Fluent -public final class AppServicePlanProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AppServicePlanProperties.class); - - /* - * Target worker tier assigned to the App Service plan. - */ - @JsonProperty(value = "workerTierName") - private String workerTierName; - - /* - * App Service plan status. - */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) - private StatusOptions status; - - /* - * App Service plan subscription. - */ - @JsonProperty(value = "subscription", access = JsonProperty.Access.WRITE_ONLY) - private String subscription; - - /* - * Specification for the App Service Environment to use for the App Service - * plan. - */ - @JsonProperty(value = "hostingEnvironmentProfile") - private HostingEnvironmentProfile hostingEnvironmentProfile; - - /* - * Maximum number of instances that can be assigned to this App Service - * plan. - */ - @JsonProperty(value = "maximumNumberOfWorkers", access = JsonProperty.Access.WRITE_ONLY) - private Integer maximumNumberOfWorkers; - - /* - * Geographical location for the App Service plan. - */ - @JsonProperty(value = "geoRegion", access = JsonProperty.Access.WRITE_ONLY) - private String geoRegion; - - /* - * If true, apps assigned to this App Service plan can be - * scaled independently. - * If false, apps assigned to this App Service plan will scale - * to all instances of the plan. - */ - @JsonProperty(value = "perSiteScaling") - private Boolean perSiteScaling; - - /* - * Maximum number of total workers allowed for this ElasticScaleEnabled App - * Service Plan - */ - @JsonProperty(value = "maximumElasticWorkerCount") - private Integer maximumElasticWorkerCount; - - /* - * Number of apps assigned to this App Service plan. - */ - @JsonProperty(value = "numberOfSites", access = JsonProperty.Access.WRITE_ONLY) - private Integer numberOfSites; - - /* - * If true, this App Service Plan owns spot instances. - */ - @JsonProperty(value = "isSpot") - private Boolean isSpot; - - /* - * The time when the server farm expires. Valid only if it is a spot server - * farm. - */ - @JsonProperty(value = "spotExpirationTime") - private OffsetDateTime spotExpirationTime; - - /* - * The time when the server farm free offer expires. - */ - @JsonProperty(value = "freeOfferExpirationTime") - private OffsetDateTime freeOfferExpirationTime; - - /* - * Resource group of the App Service plan. - */ - @JsonProperty(value = "resourceGroup", access = JsonProperty.Access.WRITE_ONLY) - private String resourceGroup; - - /* - * If Linux app service plan true, false - * otherwise. - */ - @JsonProperty(value = "reserved") - private Boolean reserved; - - /* - * Obsolete: If Hyper-V container app service plan true, - * false otherwise. - */ - @JsonProperty(value = "isXenon") - private Boolean isXenon; - - /* - * If Hyper-V container app service plan true, - * false otherwise. - */ - @JsonProperty(value = "hyperV") - private Boolean hyperV; - - /* - * Scaling worker count. - */ - @JsonProperty(value = "targetWorkerCount") - private Integer targetWorkerCount; - - /* - * Scaling worker size ID. - */ - @JsonProperty(value = "targetWorkerSizeId") - private Integer targetWorkerSizeId; - - /* - * Provisioning state of the App Service Environment. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private ProvisioningState provisioningState; - - /** - * Get the workerTierName property: Target worker tier assigned to the App Service plan. - * - * @return the workerTierName value. - */ - public String workerTierName() { - return this.workerTierName; - } - - /** - * Set the workerTierName property: Target worker tier assigned to the App Service plan. - * - * @param workerTierName the workerTierName value to set. - * @return the AppServicePlanProperties object itself. - */ - public AppServicePlanProperties withWorkerTierName(String workerTierName) { - this.workerTierName = workerTierName; - return this; - } - - /** - * Get the status property: App Service plan status. - * - * @return the status value. - */ - public StatusOptions status() { - return this.status; - } - - /** - * Get the subscription property: App Service plan subscription. - * - * @return the subscription value. - */ - public String subscription() { - return this.subscription; - } - - /** - * Get the hostingEnvironmentProfile property: Specification for the App Service Environment to use for the App - * Service plan. - * - * @return the hostingEnvironmentProfile value. - */ - public HostingEnvironmentProfile hostingEnvironmentProfile() { - return this.hostingEnvironmentProfile; - } - - /** - * Set the hostingEnvironmentProfile property: Specification for the App Service Environment to use for the App - * Service plan. - * - * @param hostingEnvironmentProfile the hostingEnvironmentProfile value to set. - * @return the AppServicePlanProperties object itself. - */ - public AppServicePlanProperties withHostingEnvironmentProfile(HostingEnvironmentProfile hostingEnvironmentProfile) { - this.hostingEnvironmentProfile = hostingEnvironmentProfile; - return this; - } - - /** - * Get the maximumNumberOfWorkers property: Maximum number of instances that can be assigned to this App Service - * plan. - * - * @return the maximumNumberOfWorkers value. - */ - public Integer maximumNumberOfWorkers() { - return this.maximumNumberOfWorkers; - } - - /** - * Get the geoRegion property: Geographical location for the App Service plan. - * - * @return the geoRegion value. - */ - public String geoRegion() { - return this.geoRegion; - } - - /** - * Get the perSiteScaling property: If <code>true</code>, apps assigned to this App Service plan can be - * scaled independently. If <code>false</code>, apps assigned to this App Service plan will scale to all - * instances of the plan. - * - * @return the perSiteScaling value. - */ - public Boolean perSiteScaling() { - return this.perSiteScaling; - } - - /** - * Set the perSiteScaling property: If <code>true</code>, apps assigned to this App Service plan can be - * scaled independently. If <code>false</code>, apps assigned to this App Service plan will scale to all - * instances of the plan. - * - * @param perSiteScaling the perSiteScaling value to set. - * @return the AppServicePlanProperties object itself. - */ - public AppServicePlanProperties withPerSiteScaling(Boolean perSiteScaling) { - this.perSiteScaling = perSiteScaling; - return this; - } - - /** - * Get the maximumElasticWorkerCount property: Maximum number of total workers allowed for this ElasticScaleEnabled - * App Service Plan. - * - * @return the maximumElasticWorkerCount value. - */ - public Integer maximumElasticWorkerCount() { - return this.maximumElasticWorkerCount; - } - - /** - * Set the maximumElasticWorkerCount property: Maximum number of total workers allowed for this ElasticScaleEnabled - * App Service Plan. - * - * @param maximumElasticWorkerCount the maximumElasticWorkerCount value to set. - * @return the AppServicePlanProperties object itself. - */ - public AppServicePlanProperties withMaximumElasticWorkerCount(Integer maximumElasticWorkerCount) { - this.maximumElasticWorkerCount = maximumElasticWorkerCount; - return this; - } - - /** - * Get the numberOfSites property: Number of apps assigned to this App Service plan. - * - * @return the numberOfSites value. - */ - public Integer numberOfSites() { - return this.numberOfSites; - } - - /** - * Get the isSpot property: If <code>true</code>, this App Service Plan owns spot instances. - * - * @return the isSpot value. - */ - public Boolean isSpot() { - return this.isSpot; - } - - /** - * Set the isSpot property: If <code>true</code>, this App Service Plan owns spot instances. - * - * @param isSpot the isSpot value to set. - * @return the AppServicePlanProperties object itself. - */ - public AppServicePlanProperties withIsSpot(Boolean isSpot) { - this.isSpot = isSpot; - return this; - } - - /** - * Get the spotExpirationTime property: The time when the server farm expires. Valid only if it is a spot server - * farm. - * - * @return the spotExpirationTime value. - */ - public OffsetDateTime spotExpirationTime() { - return this.spotExpirationTime; - } - - /** - * Set the spotExpirationTime property: The time when the server farm expires. Valid only if it is a spot server - * farm. - * - * @param spotExpirationTime the spotExpirationTime value to set. - * @return the AppServicePlanProperties object itself. - */ - public AppServicePlanProperties withSpotExpirationTime(OffsetDateTime spotExpirationTime) { - this.spotExpirationTime = spotExpirationTime; - return this; - } - - /** - * Get the freeOfferExpirationTime property: The time when the server farm free offer expires. - * - * @return the freeOfferExpirationTime value. - */ - public OffsetDateTime freeOfferExpirationTime() { - return this.freeOfferExpirationTime; - } - - /** - * Set the freeOfferExpirationTime property: The time when the server farm free offer expires. - * - * @param freeOfferExpirationTime the freeOfferExpirationTime value to set. - * @return the AppServicePlanProperties object itself. - */ - public AppServicePlanProperties withFreeOfferExpirationTime(OffsetDateTime freeOfferExpirationTime) { - this.freeOfferExpirationTime = freeOfferExpirationTime; - return this; - } - - /** - * Get the resourceGroup property: Resource group of the App Service plan. - * - * @return the resourceGroup value. - */ - public String resourceGroup() { - return this.resourceGroup; - } - - /** - * Get the reserved property: If Linux app service plan <code>true</code>, - * <code>false</code> otherwise. - * - * @return the reserved value. - */ - public Boolean reserved() { - return this.reserved; - } - - /** - * Set the reserved property: If Linux app service plan <code>true</code>, - * <code>false</code> otherwise. - * - * @param reserved the reserved value to set. - * @return the AppServicePlanProperties object itself. - */ - public AppServicePlanProperties withReserved(Boolean reserved) { - this.reserved = reserved; - return this; - } - - /** - * Get the isXenon property: Obsolete: If Hyper-V container app service plan <code>true</code>, - * <code>false</code> otherwise. - * - * @return the isXenon value. - */ - public Boolean isXenon() { - return this.isXenon; - } - - /** - * Set the isXenon property: Obsolete: If Hyper-V container app service plan <code>true</code>, - * <code>false</code> otherwise. - * - * @param isXenon the isXenon value to set. - * @return the AppServicePlanProperties object itself. - */ - public AppServicePlanProperties withIsXenon(Boolean isXenon) { - this.isXenon = isXenon; - return this; - } - - /** - * Get the hyperV property: If Hyper-V container app service plan <code>true</code>, - * <code>false</code> otherwise. - * - * @return the hyperV value. - */ - public Boolean hyperV() { - return this.hyperV; - } - - /** - * Set the hyperV property: If Hyper-V container app service plan <code>true</code>, - * <code>false</code> otherwise. - * - * @param hyperV the hyperV value to set. - * @return the AppServicePlanProperties object itself. - */ - public AppServicePlanProperties withHyperV(Boolean hyperV) { - this.hyperV = hyperV; - return this; - } - - /** - * Get the targetWorkerCount property: Scaling worker count. - * - * @return the targetWorkerCount value. - */ - public Integer targetWorkerCount() { - return this.targetWorkerCount; - } - - /** - * Set the targetWorkerCount property: Scaling worker count. - * - * @param targetWorkerCount the targetWorkerCount value to set. - * @return the AppServicePlanProperties object itself. - */ - public AppServicePlanProperties withTargetWorkerCount(Integer targetWorkerCount) { - this.targetWorkerCount = targetWorkerCount; - return this; - } - - /** - * Get the targetWorkerSizeId property: Scaling worker size ID. - * - * @return the targetWorkerSizeId value. - */ - public Integer targetWorkerSizeId() { - return this.targetWorkerSizeId; - } - - /** - * Set the targetWorkerSizeId property: Scaling worker size ID. - * - * @param targetWorkerSizeId the targetWorkerSizeId value to set. - * @return the AppServicePlanProperties object itself. - */ - public AppServicePlanProperties withTargetWorkerSizeId(Integer targetWorkerSizeId) { - this.targetWorkerSizeId = targetWorkerSizeId; - return this; - } - - /** - * Get the provisioningState property: Provisioning state of the App Service Environment. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (hostingEnvironmentProfile() != null) { - hostingEnvironmentProfile().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/ApplicationStackInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/ApplicationStackInner.java deleted file mode 100644 index 93e56bc48fb2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/ApplicationStackInner.java +++ /dev/null @@ -1,162 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.StackMajorVersion; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Application stack. */ -@Fluent -public final class ApplicationStackInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationStackInner.class); - - /* - * Application stack name. - */ - @JsonProperty(value = "name") - private String name; - - /* - * Application stack display name. - */ - @JsonProperty(value = "display") - private String display; - - /* - * Application stack dependency. - */ - @JsonProperty(value = "dependency") - private String dependency; - - /* - * List of major versions available. - */ - @JsonProperty(value = "majorVersions") - private List majorVersions; - - /* - * List of frameworks associated with application stack. - */ - @JsonProperty(value = "frameworks") - private List frameworks; - - /** - * Get the name property: Application stack name. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Application stack name. - * - * @param name the name value to set. - * @return the ApplicationStackInner object itself. - */ - public ApplicationStackInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the display property: Application stack display name. - * - * @return the display value. - */ - public String display() { - return this.display; - } - - /** - * Set the display property: Application stack display name. - * - * @param display the display value to set. - * @return the ApplicationStackInner object itself. - */ - public ApplicationStackInner withDisplay(String display) { - this.display = display; - return this; - } - - /** - * Get the dependency property: Application stack dependency. - * - * @return the dependency value. - */ - public String dependency() { - return this.dependency; - } - - /** - * Set the dependency property: Application stack dependency. - * - * @param dependency the dependency value to set. - * @return the ApplicationStackInner object itself. - */ - public ApplicationStackInner withDependency(String dependency) { - this.dependency = dependency; - return this; - } - - /** - * Get the majorVersions property: List of major versions available. - * - * @return the majorVersions value. - */ - public List majorVersions() { - return this.majorVersions; - } - - /** - * Set the majorVersions property: List of major versions available. - * - * @param majorVersions the majorVersions value to set. - * @return the ApplicationStackInner object itself. - */ - public ApplicationStackInner withMajorVersions(List majorVersions) { - this.majorVersions = majorVersions; - return this; - } - - /** - * Get the frameworks property: List of frameworks associated with application stack. - * - * @return the frameworks value. - */ - public List frameworks() { - return this.frameworks; - } - - /** - * Set the frameworks property: List of frameworks associated with application stack. - * - * @param frameworks the frameworks value to set. - * @return the ApplicationStackInner object itself. - */ - public ApplicationStackInner withFrameworks(List frameworks) { - this.frameworks = frameworks; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (majorVersions() != null) { - majorVersions().forEach(e -> e.validate()); - } - if (frameworks() != null) { - frameworks().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/AzureStoragePropertyDictionaryResourceInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/AzureStoragePropertyDictionaryResourceInner.java deleted file mode 100644 index cf2f317126bf..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/AzureStoragePropertyDictionaryResourceInner.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.AzureStorageInfoValue; -import com.azure.resourcemanager.appservice.models.ProxyOnlyResource; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** AzureStorageInfo dictionary resource. */ -@Fluent -public final class AzureStoragePropertyDictionaryResourceInner extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureStoragePropertyDictionaryResourceInner.class); - - /* - * Azure storage accounts. - */ - @JsonProperty(value = "properties") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map properties; - - /** - * Get the properties property: Azure storage accounts. - * - * @return the properties value. - */ - public Map properties() { - return this.properties; - } - - /** - * Set the properties property: Azure storage accounts. - * - * @param properties the properties value to set. - * @return the AzureStoragePropertyDictionaryResourceInner object itself. - */ - public AzureStoragePropertyDictionaryResourceInner withProperties(Map properties) { - this.properties = properties; - return this; - } - - /** {@inheritDoc} */ - @Override - public AzureStoragePropertyDictionaryResourceInner withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (properties() != null) { - properties() - .values() - .forEach( - e -> { - if (e != null) { - e.validate(); - } - }); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/BackupItemInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/BackupItemInner.java deleted file mode 100644 index 34914434aa41..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/BackupItemInner.java +++ /dev/null @@ -1,183 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.BackupItemStatus; -import com.azure.resourcemanager.appservice.models.DatabaseBackupSetting; -import com.azure.resourcemanager.appservice.models.ProxyOnlyResource; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; - -/** Backup description. */ -@Fluent -public final class BackupItemInner extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupItemInner.class); - - /* - * BackupItem resource specific properties - */ - @JsonProperty(value = "properties") - private BackupItemProperties innerProperties; - - /** - * Get the innerProperties property: BackupItem resource specific properties. - * - * @return the innerProperties value. - */ - private BackupItemProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public BackupItemInner withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the backupId property: Id of the backup. - * - * @return the backupId value. - */ - public Integer backupId() { - return this.innerProperties() == null ? null : this.innerProperties().backupId(); - } - - /** - * Get the storageAccountUrl property: SAS URL for the storage account container which contains this backup. - * - * @return the storageAccountUrl value. - */ - public String storageAccountUrl() { - return this.innerProperties() == null ? null : this.innerProperties().storageAccountUrl(); - } - - /** - * Get the blobName property: Name of the blob which contains data for this backup. - * - * @return the blobName value. - */ - public String blobName() { - return this.innerProperties() == null ? null : this.innerProperties().blobName(); - } - - /** - * Get the name property: Name of this backup. - * - * @return the name value. - */ - public String namePropertiesName() { - return this.innerProperties() == null ? null : this.innerProperties().name(); - } - - /** - * Get the status property: Backup status. - * - * @return the status value. - */ - public BackupItemStatus status() { - return this.innerProperties() == null ? null : this.innerProperties().status(); - } - - /** - * Get the sizeInBytes property: Size of the backup in bytes. - * - * @return the sizeInBytes value. - */ - public Long sizeInBytes() { - return this.innerProperties() == null ? null : this.innerProperties().sizeInBytes(); - } - - /** - * Get the created property: Timestamp of the backup creation. - * - * @return the created value. - */ - public OffsetDateTime created() { - return this.innerProperties() == null ? null : this.innerProperties().created(); - } - - /** - * Get the log property: Details regarding this backup. Might contain an error message. - * - * @return the log value. - */ - public String log() { - return this.innerProperties() == null ? null : this.innerProperties().log(); - } - - /** - * Get the databases property: List of databases included in the backup. - * - * @return the databases value. - */ - public List databases() { - return this.innerProperties() == null ? null : this.innerProperties().databases(); - } - - /** - * Get the scheduled property: True if this backup has been created due to a schedule being triggered. - * - * @return the scheduled value. - */ - public Boolean scheduled() { - return this.innerProperties() == null ? null : this.innerProperties().scheduled(); - } - - /** - * Get the lastRestoreTimestamp property: Timestamp of a last restore operation which used this backup. - * - * @return the lastRestoreTimestamp value. - */ - public OffsetDateTime lastRestoreTimestamp() { - return this.innerProperties() == null ? null : this.innerProperties().lastRestoreTimestamp(); - } - - /** - * Get the finishedTimestamp property: Timestamp when this backup finished. - * - * @return the finishedTimestamp value. - */ - public OffsetDateTime finishedTimestamp() { - return this.innerProperties() == null ? null : this.innerProperties().finishedTimestamp(); - } - - /** - * Get the correlationId property: Unique correlation identifier. Please use this along with the timestamp while - * communicating with Azure support. - * - * @return the correlationId value. - */ - public String correlationId() { - return this.innerProperties() == null ? null : this.innerProperties().correlationId(); - } - - /** - * Get the websiteSizeInBytes property: Size of the original web app which has been backed up. - * - * @return the websiteSizeInBytes value. - */ - public Long websiteSizeInBytes() { - return this.innerProperties() == null ? null : this.innerProperties().websiteSizeInBytes(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/BackupItemProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/BackupItemProperties.java deleted file mode 100644 index 490d185cde54..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/BackupItemProperties.java +++ /dev/null @@ -1,243 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.BackupItemStatus; -import com.azure.resourcemanager.appservice.models.DatabaseBackupSetting; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; - -/** BackupItem resource specific properties. */ -@Immutable -public final class BackupItemProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupItemProperties.class); - - /* - * Id of the backup. - */ - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) - private Integer backupId; - - /* - * SAS URL for the storage account container which contains this backup. - */ - @JsonProperty(value = "storageAccountUrl", access = JsonProperty.Access.WRITE_ONLY) - private String storageAccountUrl; - - /* - * Name of the blob which contains data for this backup. - */ - @JsonProperty(value = "blobName", access = JsonProperty.Access.WRITE_ONLY) - private String blobName; - - /* - * Name of this backup. - */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) - private String name; - - /* - * Backup status. - */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) - private BackupItemStatus status; - - /* - * Size of the backup in bytes. - */ - @JsonProperty(value = "sizeInBytes", access = JsonProperty.Access.WRITE_ONLY) - private Long sizeInBytes; - - /* - * Timestamp of the backup creation. - */ - @JsonProperty(value = "created", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime created; - - /* - * Details regarding this backup. Might contain an error message. - */ - @JsonProperty(value = "log", access = JsonProperty.Access.WRITE_ONLY) - private String log; - - /* - * List of databases included in the backup. - */ - @JsonProperty(value = "databases", access = JsonProperty.Access.WRITE_ONLY) - private List databases; - - /* - * True if this backup has been created due to a schedule being triggered. - */ - @JsonProperty(value = "scheduled", access = JsonProperty.Access.WRITE_ONLY) - private Boolean scheduled; - - /* - * Timestamp of a last restore operation which used this backup. - */ - @JsonProperty(value = "lastRestoreTimeStamp", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime lastRestoreTimestamp; - - /* - * Timestamp when this backup finished. - */ - @JsonProperty(value = "finishedTimeStamp", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime finishedTimestamp; - - /* - * Unique correlation identifier. Please use this along with the timestamp - * while communicating with Azure support. - */ - @JsonProperty(value = "correlationId", access = JsonProperty.Access.WRITE_ONLY) - private String correlationId; - - /* - * Size of the original web app which has been backed up. - */ - @JsonProperty(value = "websiteSizeInBytes", access = JsonProperty.Access.WRITE_ONLY) - private Long websiteSizeInBytes; - - /** - * Get the backupId property: Id of the backup. - * - * @return the backupId value. - */ - public Integer backupId() { - return this.backupId; - } - - /** - * Get the storageAccountUrl property: SAS URL for the storage account container which contains this backup. - * - * @return the storageAccountUrl value. - */ - public String storageAccountUrl() { - return this.storageAccountUrl; - } - - /** - * Get the blobName property: Name of the blob which contains data for this backup. - * - * @return the blobName value. - */ - public String blobName() { - return this.blobName; - } - - /** - * Get the name property: Name of this backup. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the status property: Backup status. - * - * @return the status value. - */ - public BackupItemStatus status() { - return this.status; - } - - /** - * Get the sizeInBytes property: Size of the backup in bytes. - * - * @return the sizeInBytes value. - */ - public Long sizeInBytes() { - return this.sizeInBytes; - } - - /** - * Get the created property: Timestamp of the backup creation. - * - * @return the created value. - */ - public OffsetDateTime created() { - return this.created; - } - - /** - * Get the log property: Details regarding this backup. Might contain an error message. - * - * @return the log value. - */ - public String log() { - return this.log; - } - - /** - * Get the databases property: List of databases included in the backup. - * - * @return the databases value. - */ - public List databases() { - return this.databases; - } - - /** - * Get the scheduled property: True if this backup has been created due to a schedule being triggered. - * - * @return the scheduled value. - */ - public Boolean scheduled() { - return this.scheduled; - } - - /** - * Get the lastRestoreTimestamp property: Timestamp of a last restore operation which used this backup. - * - * @return the lastRestoreTimestamp value. - */ - public OffsetDateTime lastRestoreTimestamp() { - return this.lastRestoreTimestamp; - } - - /** - * Get the finishedTimestamp property: Timestamp when this backup finished. - * - * @return the finishedTimestamp value. - */ - public OffsetDateTime finishedTimestamp() { - return this.finishedTimestamp; - } - - /** - * Get the correlationId property: Unique correlation identifier. Please use this along with the timestamp while - * communicating with Azure support. - * - * @return the correlationId value. - */ - public String correlationId() { - return this.correlationId; - } - - /** - * Get the websiteSizeInBytes property: Size of the original web app which has been backed up. - * - * @return the websiteSizeInBytes value. - */ - public Long websiteSizeInBytes() { - return this.websiteSizeInBytes; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (databases() != null) { - databases().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/BackupRequestInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/BackupRequestInner.java deleted file mode 100644 index fc4377e72aab..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/BackupRequestInner.java +++ /dev/null @@ -1,172 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.BackupSchedule; -import com.azure.resourcemanager.appservice.models.DatabaseBackupSetting; -import com.azure.resourcemanager.appservice.models.ProxyOnlyResource; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Description of a backup which will be performed. */ -@Fluent -public final class BackupRequestInner extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupRequestInner.class); - - /* - * BackupRequest resource specific properties - */ - @JsonProperty(value = "properties") - private BackupRequestProperties innerProperties; - - /** - * Get the innerProperties property: BackupRequest resource specific properties. - * - * @return the innerProperties value. - */ - private BackupRequestProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public BackupRequestInner withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the backupName property: Name of the backup. - * - * @return the backupName value. - */ - public String backupName() { - return this.innerProperties() == null ? null : this.innerProperties().backupName(); - } - - /** - * Set the backupName property: Name of the backup. - * - * @param backupName the backupName value to set. - * @return the BackupRequestInner object itself. - */ - public BackupRequestInner withBackupName(String backupName) { - if (this.innerProperties() == null) { - this.innerProperties = new BackupRequestProperties(); - } - this.innerProperties().withBackupName(backupName); - return this; - } - - /** - * Get the enabled property: True if the backup schedule is enabled (must be included in that case), false if the - * backup schedule should be disabled. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.innerProperties() == null ? null : this.innerProperties().enabled(); - } - - /** - * Set the enabled property: True if the backup schedule is enabled (must be included in that case), false if the - * backup schedule should be disabled. - * - * @param enabled the enabled value to set. - * @return the BackupRequestInner object itself. - */ - public BackupRequestInner withEnabled(Boolean enabled) { - if (this.innerProperties() == null) { - this.innerProperties = new BackupRequestProperties(); - } - this.innerProperties().withEnabled(enabled); - return this; - } - - /** - * Get the storageAccountUrl property: SAS URL to the container. - * - * @return the storageAccountUrl value. - */ - public String storageAccountUrl() { - return this.innerProperties() == null ? null : this.innerProperties().storageAccountUrl(); - } - - /** - * Set the storageAccountUrl property: SAS URL to the container. - * - * @param storageAccountUrl the storageAccountUrl value to set. - * @return the BackupRequestInner object itself. - */ - public BackupRequestInner withStorageAccountUrl(String storageAccountUrl) { - if (this.innerProperties() == null) { - this.innerProperties = new BackupRequestProperties(); - } - this.innerProperties().withStorageAccountUrl(storageAccountUrl); - return this; - } - - /** - * Get the backupSchedule property: Schedule for the backup if it is executed periodically. - * - * @return the backupSchedule value. - */ - public BackupSchedule backupSchedule() { - return this.innerProperties() == null ? null : this.innerProperties().backupSchedule(); - } - - /** - * Set the backupSchedule property: Schedule for the backup if it is executed periodically. - * - * @param backupSchedule the backupSchedule value to set. - * @return the BackupRequestInner object itself. - */ - public BackupRequestInner withBackupSchedule(BackupSchedule backupSchedule) { - if (this.innerProperties() == null) { - this.innerProperties = new BackupRequestProperties(); - } - this.innerProperties().withBackupSchedule(backupSchedule); - return this; - } - - /** - * Get the databases property: Databases included in the backup. - * - * @return the databases value. - */ - public List databases() { - return this.innerProperties() == null ? null : this.innerProperties().databases(); - } - - /** - * Set the databases property: Databases included in the backup. - * - * @param databases the databases value to set. - * @return the BackupRequestInner object itself. - */ - public BackupRequestInner withDatabases(List databases) { - if (this.innerProperties() == null) { - this.innerProperties = new BackupRequestProperties(); - } - this.innerProperties().withDatabases(databases); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/BackupRequestProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/BackupRequestProperties.java deleted file mode 100644 index fb3c23f1f26f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/BackupRequestProperties.java +++ /dev/null @@ -1,172 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.BackupSchedule; -import com.azure.resourcemanager.appservice.models.DatabaseBackupSetting; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** BackupRequest resource specific properties. */ -@Fluent -public final class BackupRequestProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupRequestProperties.class); - - /* - * Name of the backup. - */ - @JsonProperty(value = "backupName") - private String backupName; - - /* - * True if the backup schedule is enabled (must be included in that case), - * false if the backup schedule should be disabled. - */ - @JsonProperty(value = "enabled") - private Boolean enabled; - - /* - * SAS URL to the container. - */ - @JsonProperty(value = "storageAccountUrl", required = true) - private String storageAccountUrl; - - /* - * Schedule for the backup if it is executed periodically. - */ - @JsonProperty(value = "backupSchedule") - private BackupSchedule backupSchedule; - - /* - * Databases included in the backup. - */ - @JsonProperty(value = "databases") - private List databases; - - /** - * Get the backupName property: Name of the backup. - * - * @return the backupName value. - */ - public String backupName() { - return this.backupName; - } - - /** - * Set the backupName property: Name of the backup. - * - * @param backupName the backupName value to set. - * @return the BackupRequestProperties object itself. - */ - public BackupRequestProperties withBackupName(String backupName) { - this.backupName = backupName; - return this; - } - - /** - * Get the enabled property: True if the backup schedule is enabled (must be included in that case), false if the - * backup schedule should be disabled. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: True if the backup schedule is enabled (must be included in that case), false if the - * backup schedule should be disabled. - * - * @param enabled the enabled value to set. - * @return the BackupRequestProperties object itself. - */ - public BackupRequestProperties withEnabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the storageAccountUrl property: SAS URL to the container. - * - * @return the storageAccountUrl value. - */ - public String storageAccountUrl() { - return this.storageAccountUrl; - } - - /** - * Set the storageAccountUrl property: SAS URL to the container. - * - * @param storageAccountUrl the storageAccountUrl value to set. - * @return the BackupRequestProperties object itself. - */ - public BackupRequestProperties withStorageAccountUrl(String storageAccountUrl) { - this.storageAccountUrl = storageAccountUrl; - return this; - } - - /** - * Get the backupSchedule property: Schedule for the backup if it is executed periodically. - * - * @return the backupSchedule value. - */ - public BackupSchedule backupSchedule() { - return this.backupSchedule; - } - - /** - * Set the backupSchedule property: Schedule for the backup if it is executed periodically. - * - * @param backupSchedule the backupSchedule value to set. - * @return the BackupRequestProperties object itself. - */ - public BackupRequestProperties withBackupSchedule(BackupSchedule backupSchedule) { - this.backupSchedule = backupSchedule; - return this; - } - - /** - * Get the databases property: Databases included in the backup. - * - * @return the databases value. - */ - public List databases() { - return this.databases; - } - - /** - * Set the databases property: Databases included in the backup. - * - * @param databases the databases value to set. - * @return the BackupRequestProperties object itself. - */ - public BackupRequestProperties withDatabases(List databases) { - this.databases = databases; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (storageAccountUrl() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property storageAccountUrl in model BackupRequestProperties")); - } - if (backupSchedule() != null) { - backupSchedule().validate(); - } - if (databases() != null) { - databases().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/BillingMeterInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/BillingMeterInner.java deleted file mode 100644 index 741a42847f98..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/BillingMeterInner.java +++ /dev/null @@ -1,193 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.ProxyOnlyResource; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * App Service billing entity that contains information about meter which the Azure billing system utilizes to charge - * users for services. - */ -@Fluent -public final class BillingMeterInner extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BillingMeterInner.class); - - /* - * BillingMeter resource specific properties - */ - @JsonProperty(value = "properties") - private BillingMeterProperties innerProperties; - - /** - * Get the innerProperties property: BillingMeter resource specific properties. - * - * @return the innerProperties value. - */ - private BillingMeterProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public BillingMeterInner withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the meterId property: Meter GUID onboarded in Commerce. - * - * @return the meterId value. - */ - public String meterId() { - return this.innerProperties() == null ? null : this.innerProperties().meterId(); - } - - /** - * Set the meterId property: Meter GUID onboarded in Commerce. - * - * @param meterId the meterId value to set. - * @return the BillingMeterInner object itself. - */ - public BillingMeterInner withMeterId(String meterId) { - if (this.innerProperties() == null) { - this.innerProperties = new BillingMeterProperties(); - } - this.innerProperties().withMeterId(meterId); - return this; - } - - /** - * Get the billingLocation property: Azure Location of billable resource. - * - * @return the billingLocation value. - */ - public String billingLocation() { - return this.innerProperties() == null ? null : this.innerProperties().billingLocation(); - } - - /** - * Set the billingLocation property: Azure Location of billable resource. - * - * @param billingLocation the billingLocation value to set. - * @return the BillingMeterInner object itself. - */ - public BillingMeterInner withBillingLocation(String billingLocation) { - if (this.innerProperties() == null) { - this.innerProperties = new BillingMeterProperties(); - } - this.innerProperties().withBillingLocation(billingLocation); - return this; - } - - /** - * Get the shortName property: Short Name from App Service Azure pricing Page. - * - * @return the shortName value. - */ - public String shortName() { - return this.innerProperties() == null ? null : this.innerProperties().shortName(); - } - - /** - * Set the shortName property: Short Name from App Service Azure pricing Page. - * - * @param shortName the shortName value to set. - * @return the BillingMeterInner object itself. - */ - public BillingMeterInner withShortName(String shortName) { - if (this.innerProperties() == null) { - this.innerProperties = new BillingMeterProperties(); - } - this.innerProperties().withShortName(shortName); - return this; - } - - /** - * Get the friendlyName property: Friendly name of the meter. - * - * @return the friendlyName value. - */ - public String friendlyName() { - return this.innerProperties() == null ? null : this.innerProperties().friendlyName(); - } - - /** - * Set the friendlyName property: Friendly name of the meter. - * - * @param friendlyName the friendlyName value to set. - * @return the BillingMeterInner object itself. - */ - public BillingMeterInner withFriendlyName(String friendlyName) { - if (this.innerProperties() == null) { - this.innerProperties = new BillingMeterProperties(); - } - this.innerProperties().withFriendlyName(friendlyName); - return this; - } - - /** - * Get the resourceType property: App Service ResourceType meter used for. - * - * @return the resourceType value. - */ - public String resourceType() { - return this.innerProperties() == null ? null : this.innerProperties().resourceType(); - } - - /** - * Set the resourceType property: App Service ResourceType meter used for. - * - * @param resourceType the resourceType value to set. - * @return the BillingMeterInner object itself. - */ - public BillingMeterInner withResourceType(String resourceType) { - if (this.innerProperties() == null) { - this.innerProperties = new BillingMeterProperties(); - } - this.innerProperties().withResourceType(resourceType); - return this; - } - - /** - * Get the osType property: App Service OS type meter used for. - * - * @return the osType value. - */ - public String osType() { - return this.innerProperties() == null ? null : this.innerProperties().osType(); - } - - /** - * Set the osType property: App Service OS type meter used for. - * - * @param osType the osType value to set. - * @return the BillingMeterInner object itself. - */ - public BillingMeterInner withOsType(String osType) { - if (this.innerProperties() == null) { - this.innerProperties = new BillingMeterProperties(); - } - this.innerProperties().withOsType(osType); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/BillingMeterProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/BillingMeterProperties.java deleted file mode 100644 index 0228c5ca0fd6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/BillingMeterProperties.java +++ /dev/null @@ -1,180 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** BillingMeter resource specific properties. */ -@Fluent -public final class BillingMeterProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BillingMeterProperties.class); - - /* - * Meter GUID onboarded in Commerce - */ - @JsonProperty(value = "meterId") - private String meterId; - - /* - * Azure Location of billable resource - */ - @JsonProperty(value = "billingLocation") - private String billingLocation; - - /* - * Short Name from App Service Azure pricing Page - */ - @JsonProperty(value = "shortName") - private String shortName; - - /* - * Friendly name of the meter - */ - @JsonProperty(value = "friendlyName") - private String friendlyName; - - /* - * App Service ResourceType meter used for - */ - @JsonProperty(value = "resourceType") - private String resourceType; - - /* - * App Service OS type meter used for - */ - @JsonProperty(value = "osType") - private String osType; - - /** - * Get the meterId property: Meter GUID onboarded in Commerce. - * - * @return the meterId value. - */ - public String meterId() { - return this.meterId; - } - - /** - * Set the meterId property: Meter GUID onboarded in Commerce. - * - * @param meterId the meterId value to set. - * @return the BillingMeterProperties object itself. - */ - public BillingMeterProperties withMeterId(String meterId) { - this.meterId = meterId; - return this; - } - - /** - * Get the billingLocation property: Azure Location of billable resource. - * - * @return the billingLocation value. - */ - public String billingLocation() { - return this.billingLocation; - } - - /** - * Set the billingLocation property: Azure Location of billable resource. - * - * @param billingLocation the billingLocation value to set. - * @return the BillingMeterProperties object itself. - */ - public BillingMeterProperties withBillingLocation(String billingLocation) { - this.billingLocation = billingLocation; - return this; - } - - /** - * Get the shortName property: Short Name from App Service Azure pricing Page. - * - * @return the shortName value. - */ - public String shortName() { - return this.shortName; - } - - /** - * Set the shortName property: Short Name from App Service Azure pricing Page. - * - * @param shortName the shortName value to set. - * @return the BillingMeterProperties object itself. - */ - public BillingMeterProperties withShortName(String shortName) { - this.shortName = shortName; - return this; - } - - /** - * Get the friendlyName property: Friendly name of the meter. - * - * @return the friendlyName value. - */ - public String friendlyName() { - return this.friendlyName; - } - - /** - * Set the friendlyName property: Friendly name of the meter. - * - * @param friendlyName the friendlyName value to set. - * @return the BillingMeterProperties object itself. - */ - public BillingMeterProperties withFriendlyName(String friendlyName) { - this.friendlyName = friendlyName; - return this; - } - - /** - * Get the resourceType property: App Service ResourceType meter used for. - * - * @return the resourceType value. - */ - public String resourceType() { - return this.resourceType; - } - - /** - * Set the resourceType property: App Service ResourceType meter used for. - * - * @param resourceType the resourceType value to set. - * @return the BillingMeterProperties object itself. - */ - public BillingMeterProperties withResourceType(String resourceType) { - this.resourceType = resourceType; - return this; - } - - /** - * Get the osType property: App Service OS type meter used for. - * - * @return the osType value. - */ - public String osType() { - return this.osType; - } - - /** - * Set the osType property: App Service OS type meter used for. - * - * @param osType the osType value to set. - * @return the BillingMeterProperties object itself. - */ - public BillingMeterProperties withOsType(String osType) { - this.osType = osType; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/CapabilityInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/CapabilityInner.java deleted file mode 100644 index ccda4657975b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/CapabilityInner.java +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describes the capabilities/features allowed for a specific SKU. */ -@Fluent -public final class CapabilityInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CapabilityInner.class); - - /* - * Name of the SKU capability. - */ - @JsonProperty(value = "name") - private String name; - - /* - * Value of the SKU capability. - */ - @JsonProperty(value = "value") - private String value; - - /* - * Reason of the SKU capability. - */ - @JsonProperty(value = "reason") - private String reason; - - /** - * Get the name property: Name of the SKU capability. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Name of the SKU capability. - * - * @param name the name value to set. - * @return the CapabilityInner object itself. - */ - public CapabilityInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the value property: Value of the SKU capability. - * - * @return the value value. - */ - public String value() { - return this.value; - } - - /** - * Set the value property: Value of the SKU capability. - * - * @param value the value value to set. - * @return the CapabilityInner object itself. - */ - public CapabilityInner withValue(String value) { - this.value = value; - return this; - } - - /** - * Get the reason property: Reason of the SKU capability. - * - * @return the reason value. - */ - public String reason() { - return this.reason; - } - - /** - * Set the reason property: Reason of the SKU capability. - * - * @param reason the reason value to set. - * @return the CapabilityInner object itself. - */ - public CapabilityInner withReason(String reason) { - this.reason = reason; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/CertificateEmailInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/CertificateEmailInner.java deleted file mode 100644 index 959007118f85..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/CertificateEmailInner.java +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.ProxyOnlyResource; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** SSL certificate email. */ -@Fluent -public final class CertificateEmailInner extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CertificateEmailInner.class); - - /* - * CertificateEmail resource specific properties - */ - @JsonProperty(value = "properties") - private CertificateEmailProperties innerProperties; - - /** - * Get the innerProperties property: CertificateEmail resource specific properties. - * - * @return the innerProperties value. - */ - private CertificateEmailProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public CertificateEmailInner withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the emailId property: Email id. - * - * @return the emailId value. - */ - public String emailId() { - return this.innerProperties() == null ? null : this.innerProperties().emailId(); - } - - /** - * Set the emailId property: Email id. - * - * @param emailId the emailId value to set. - * @return the CertificateEmailInner object itself. - */ - public CertificateEmailInner withEmailId(String emailId) { - if (this.innerProperties() == null) { - this.innerProperties = new CertificateEmailProperties(); - } - this.innerProperties().withEmailId(emailId); - return this; - } - - /** - * Get the timestamp property: Time stamp. - * - * @return the timestamp value. - */ - public OffsetDateTime timestamp() { - return this.innerProperties() == null ? null : this.innerProperties().timestamp(); - } - - /** - * Set the timestamp property: Time stamp. - * - * @param timestamp the timestamp value to set. - * @return the CertificateEmailInner object itself. - */ - public CertificateEmailInner withTimestamp(OffsetDateTime timestamp) { - if (this.innerProperties() == null) { - this.innerProperties = new CertificateEmailProperties(); - } - this.innerProperties().withTimestamp(timestamp); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/CertificateEmailProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/CertificateEmailProperties.java deleted file mode 100644 index 96a5244b20c6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/CertificateEmailProperties.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** CertificateEmail resource specific properties. */ -@Fluent -public final class CertificateEmailProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CertificateEmailProperties.class); - - /* - * Email id. - */ - @JsonProperty(value = "emailId") - private String emailId; - - /* - * Time stamp. - */ - @JsonProperty(value = "timeStamp") - private OffsetDateTime timestamp; - - /** - * Get the emailId property: Email id. - * - * @return the emailId value. - */ - public String emailId() { - return this.emailId; - } - - /** - * Set the emailId property: Email id. - * - * @param emailId the emailId value to set. - * @return the CertificateEmailProperties object itself. - */ - public CertificateEmailProperties withEmailId(String emailId) { - this.emailId = emailId; - return this; - } - - /** - * Get the timestamp property: Time stamp. - * - * @return the timestamp value. - */ - public OffsetDateTime timestamp() { - return this.timestamp; - } - - /** - * Set the timestamp property: Time stamp. - * - * @param timestamp the timestamp value to set. - * @return the CertificateEmailProperties object itself. - */ - public CertificateEmailProperties withTimestamp(OffsetDateTime timestamp) { - this.timestamp = timestamp; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/CertificateInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/CertificateInner.java deleted file mode 100644 index 92d72f960fd6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/CertificateInner.java +++ /dev/null @@ -1,348 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.HostingEnvironmentProfile; -import com.azure.resourcemanager.appservice.models.KeyVaultSecretStatus; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; -import java.util.Map; - -/** SSL certificate for an app. */ -@Fluent -public final class CertificateInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CertificateInner.class); - - /* - * Certificate resource specific properties - */ - @JsonProperty(value = "properties") - private CertificateProperties innerProperties; - - /* - * Kind of resource. - */ - @JsonProperty(value = "kind") - private String kind; - - /** - * Get the innerProperties property: Certificate resource specific properties. - * - * @return the innerProperties value. - */ - private CertificateProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the kind property: Kind of resource. - * - * @return the kind value. - */ - public String kind() { - return this.kind; - } - - /** - * Set the kind property: Kind of resource. - * - * @param kind the kind value to set. - * @return the CertificateInner object itself. - */ - public CertificateInner withKind(String kind) { - this.kind = kind; - return this; - } - - /** {@inheritDoc} */ - @Override - public CertificateInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public CertificateInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the friendlyName property: Friendly name of the certificate. - * - * @return the friendlyName value. - */ - public String friendlyName() { - return this.innerProperties() == null ? null : this.innerProperties().friendlyName(); - } - - /** - * Get the subjectName property: Subject name of the certificate. - * - * @return the subjectName value. - */ - public String subjectName() { - return this.innerProperties() == null ? null : this.innerProperties().subjectName(); - } - - /** - * Get the hostNames property: Host names the certificate applies to. - * - * @return the hostNames value. - */ - public List hostNames() { - return this.innerProperties() == null ? null : this.innerProperties().hostNames(); - } - - /** - * Set the hostNames property: Host names the certificate applies to. - * - * @param hostNames the hostNames value to set. - * @return the CertificateInner object itself. - */ - public CertificateInner withHostNames(List hostNames) { - if (this.innerProperties() == null) { - this.innerProperties = new CertificateProperties(); - } - this.innerProperties().withHostNames(hostNames); - return this; - } - - /** - * Get the pfxBlob property: Pfx blob. - * - * @return the pfxBlob value. - */ - public byte[] pfxBlob() { - return this.innerProperties() == null ? null : this.innerProperties().pfxBlob(); - } - - /** - * Set the pfxBlob property: Pfx blob. - * - * @param pfxBlob the pfxBlob value to set. - * @return the CertificateInner object itself. - */ - public CertificateInner withPfxBlob(byte[] pfxBlob) { - if (this.innerProperties() == null) { - this.innerProperties = new CertificateProperties(); - } - this.innerProperties().withPfxBlob(pfxBlob); - return this; - } - - /** - * Get the siteName property: App name. - * - * @return the siteName value. - */ - public String siteName() { - return this.innerProperties() == null ? null : this.innerProperties().siteName(); - } - - /** - * Get the selfLink property: Self link. - * - * @return the selfLink value. - */ - public String selfLink() { - return this.innerProperties() == null ? null : this.innerProperties().selfLink(); - } - - /** - * Get the issuer property: Certificate issuer. - * - * @return the issuer value. - */ - public String issuer() { - return this.innerProperties() == null ? null : this.innerProperties().issuer(); - } - - /** - * Get the issueDate property: Certificate issue Date. - * - * @return the issueDate value. - */ - public OffsetDateTime issueDate() { - return this.innerProperties() == null ? null : this.innerProperties().issueDate(); - } - - /** - * Get the expirationDate property: Certificate expiration date. - * - * @return the expirationDate value. - */ - public OffsetDateTime expirationDate() { - return this.innerProperties() == null ? null : this.innerProperties().expirationDate(); - } - - /** - * Get the password property: Certificate password. - * - * @return the password value. - */ - public String password() { - return this.innerProperties() == null ? null : this.innerProperties().password(); - } - - /** - * Set the password property: Certificate password. - * - * @param password the password value to set. - * @return the CertificateInner object itself. - */ - public CertificateInner withPassword(String password) { - if (this.innerProperties() == null) { - this.innerProperties = new CertificateProperties(); - } - this.innerProperties().withPassword(password); - return this; - } - - /** - * Get the thumbprint property: Certificate thumbprint. - * - * @return the thumbprint value. - */ - public String thumbprint() { - return this.innerProperties() == null ? null : this.innerProperties().thumbprint(); - } - - /** - * Get the valid property: Is the certificate valid?. - * - * @return the valid value. - */ - public Boolean valid() { - return this.innerProperties() == null ? null : this.innerProperties().valid(); - } - - /** - * Get the cerBlob property: Raw bytes of .cer file. - * - * @return the cerBlob value. - */ - public byte[] cerBlob() { - return this.innerProperties() == null ? null : this.innerProperties().cerBlob(); - } - - /** - * Get the publicKeyHash property: Public key hash. - * - * @return the publicKeyHash value. - */ - public String publicKeyHash() { - return this.innerProperties() == null ? null : this.innerProperties().publicKeyHash(); - } - - /** - * Get the hostingEnvironmentProfile property: Specification for the App Service Environment to use for the - * certificate. - * - * @return the hostingEnvironmentProfile value. - */ - public HostingEnvironmentProfile hostingEnvironmentProfile() { - return this.innerProperties() == null ? null : this.innerProperties().hostingEnvironmentProfile(); - } - - /** - * Get the keyVaultId property: Key Vault Csm resource Id. - * - * @return the keyVaultId value. - */ - public String keyVaultId() { - return this.innerProperties() == null ? null : this.innerProperties().keyVaultId(); - } - - /** - * Set the keyVaultId property: Key Vault Csm resource Id. - * - * @param keyVaultId the keyVaultId value to set. - * @return the CertificateInner object itself. - */ - public CertificateInner withKeyVaultId(String keyVaultId) { - if (this.innerProperties() == null) { - this.innerProperties = new CertificateProperties(); - } - this.innerProperties().withKeyVaultId(keyVaultId); - return this; - } - - /** - * Get the keyVaultSecretName property: Key Vault secret name. - * - * @return the keyVaultSecretName value. - */ - public String keyVaultSecretName() { - return this.innerProperties() == null ? null : this.innerProperties().keyVaultSecretName(); - } - - /** - * Set the keyVaultSecretName property: Key Vault secret name. - * - * @param keyVaultSecretName the keyVaultSecretName value to set. - * @return the CertificateInner object itself. - */ - public CertificateInner withKeyVaultSecretName(String keyVaultSecretName) { - if (this.innerProperties() == null) { - this.innerProperties = new CertificateProperties(); - } - this.innerProperties().withKeyVaultSecretName(keyVaultSecretName); - return this; - } - - /** - * Get the keyVaultSecretStatus property: Status of the Key Vault secret. - * - * @return the keyVaultSecretStatus value. - */ - public KeyVaultSecretStatus keyVaultSecretStatus() { - return this.innerProperties() == null ? null : this.innerProperties().keyVaultSecretStatus(); - } - - /** - * Get the serverFarmId property: Resource ID of the associated App Service plan, formatted as: - * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms" - + "/{appServicePlanName}". - * - * @return the serverFarmId value. - */ - public String serverFarmId() { - return this.innerProperties() == null ? null : this.innerProperties().serverFarmId(); - } - - /** - * Set the serverFarmId property: Resource ID of the associated App Service plan, formatted as: - * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms" - + "/{appServicePlanName}". - * - * @param serverFarmId the serverFarmId value to set. - * @return the CertificateInner object itself. - */ - public CertificateInner withServerFarmId(String serverFarmId) { - if (this.innerProperties() == null) { - this.innerProperties = new CertificateProperties(); - } - this.innerProperties().withServerFarmId(serverFarmId); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/CertificateOrderActionInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/CertificateOrderActionInner.java deleted file mode 100644 index 2cf482632b8e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/CertificateOrderActionInner.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.CertificateOrderActionType; -import com.azure.resourcemanager.appservice.models.ProxyOnlyResource; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** Certificate order action. */ -@Fluent -public final class CertificateOrderActionInner extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CertificateOrderActionInner.class); - - /* - * CertificateOrderAction resource specific properties - */ - @JsonProperty(value = "properties") - private CertificateOrderActionProperties innerProperties; - - /** - * Get the innerProperties property: CertificateOrderAction resource specific properties. - * - * @return the innerProperties value. - */ - private CertificateOrderActionProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public CertificateOrderActionInner withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the actionType property: Action type. - * - * @return the actionType value. - */ - public CertificateOrderActionType actionType() { - return this.innerProperties() == null ? null : this.innerProperties().actionType(); - } - - /** - * Get the createdAt property: Time at which the certificate action was performed. - * - * @return the createdAt value. - */ - public OffsetDateTime createdAt() { - return this.innerProperties() == null ? null : this.innerProperties().createdAt(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/CertificateOrderActionProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/CertificateOrderActionProperties.java deleted file mode 100644 index e9a6070a5d82..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/CertificateOrderActionProperties.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.CertificateOrderActionType; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** CertificateOrderAction resource specific properties. */ -@Immutable -public final class CertificateOrderActionProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CertificateOrderActionProperties.class); - - /* - * Action type. - */ - @JsonProperty(value = "actionType", access = JsonProperty.Access.WRITE_ONLY) - private CertificateOrderActionType actionType; - - /* - * Time at which the certificate action was performed. - */ - @JsonProperty(value = "createdAt", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime createdAt; - - /** - * Get the actionType property: Action type. - * - * @return the actionType value. - */ - public CertificateOrderActionType actionType() { - return this.actionType; - } - - /** - * Get the createdAt property: Time at which the certificate action was performed. - * - * @return the createdAt value. - */ - public OffsetDateTime createdAt() { - return this.createdAt; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/CertificatePatchResourceProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/CertificatePatchResourceProperties.java deleted file mode 100644 index 28134bbaa495..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/CertificatePatchResourceProperties.java +++ /dev/null @@ -1,397 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.HostingEnvironmentProfile; -import com.azure.resourcemanager.appservice.models.KeyVaultSecretStatus; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; - -/** CertificatePatchResource resource specific properties. */ -@Fluent -public final class CertificatePatchResourceProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CertificatePatchResourceProperties.class); - - /* - * Friendly name of the certificate. - */ - @JsonProperty(value = "friendlyName", access = JsonProperty.Access.WRITE_ONLY) - private String friendlyName; - - /* - * Subject name of the certificate. - */ - @JsonProperty(value = "subjectName", access = JsonProperty.Access.WRITE_ONLY) - private String subjectName; - - /* - * Host names the certificate applies to. - */ - @JsonProperty(value = "hostNames") - private List hostNames; - - /* - * Pfx blob. - */ - @JsonProperty(value = "pfxBlob") - private byte[] pfxBlob; - - /* - * App name. - */ - @JsonProperty(value = "siteName", access = JsonProperty.Access.WRITE_ONLY) - private String siteName; - - /* - * Self link. - */ - @JsonProperty(value = "selfLink", access = JsonProperty.Access.WRITE_ONLY) - private String selfLink; - - /* - * Certificate issuer. - */ - @JsonProperty(value = "issuer", access = JsonProperty.Access.WRITE_ONLY) - private String issuer; - - /* - * Certificate issue Date. - */ - @JsonProperty(value = "issueDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime issueDate; - - /* - * Certificate expiration date. - */ - @JsonProperty(value = "expirationDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime expirationDate; - - /* - * Certificate password. - */ - @JsonProperty(value = "password", required = true) - private String password; - - /* - * Certificate thumbprint. - */ - @JsonProperty(value = "thumbprint", access = JsonProperty.Access.WRITE_ONLY) - private String thumbprint; - - /* - * Is the certificate valid?. - */ - @JsonProperty(value = "valid", access = JsonProperty.Access.WRITE_ONLY) - private Boolean valid; - - /* - * Raw bytes of .cer file - */ - @JsonProperty(value = "cerBlob", access = JsonProperty.Access.WRITE_ONLY) - private byte[] cerBlob; - - /* - * Public key hash. - */ - @JsonProperty(value = "publicKeyHash", access = JsonProperty.Access.WRITE_ONLY) - private String publicKeyHash; - - /* - * Specification for the App Service Environment to use for the - * certificate. - */ - @JsonProperty(value = "hostingEnvironmentProfile", access = JsonProperty.Access.WRITE_ONLY) - private HostingEnvironmentProfile hostingEnvironmentProfile; - - /* - * Key Vault Csm resource Id. - */ - @JsonProperty(value = "keyVaultId") - private String keyVaultId; - - /* - * Key Vault secret name. - */ - @JsonProperty(value = "keyVaultSecretName") - private String keyVaultSecretName; - - /* - * Status of the Key Vault secret. - */ - @JsonProperty(value = "keyVaultSecretStatus", access = JsonProperty.Access.WRITE_ONLY) - private KeyVaultSecretStatus keyVaultSecretStatus; - - /* - * Resource ID of the associated App Service plan, formatted as: - * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms" - + "/{appServicePlanName}". - */ - @JsonProperty(value = "serverFarmId") - private String serverFarmId; - - /** - * Get the friendlyName property: Friendly name of the certificate. - * - * @return the friendlyName value. - */ - public String friendlyName() { - return this.friendlyName; - } - - /** - * Get the subjectName property: Subject name of the certificate. - * - * @return the subjectName value. - */ - public String subjectName() { - return this.subjectName; - } - - /** - * Get the hostNames property: Host names the certificate applies to. - * - * @return the hostNames value. - */ - public List hostNames() { - return this.hostNames; - } - - /** - * Set the hostNames property: Host names the certificate applies to. - * - * @param hostNames the hostNames value to set. - * @return the CertificatePatchResourceProperties object itself. - */ - public CertificatePatchResourceProperties withHostNames(List hostNames) { - this.hostNames = hostNames; - return this; - } - - /** - * Get the pfxBlob property: Pfx blob. - * - * @return the pfxBlob value. - */ - public byte[] pfxBlob() { - return CoreUtils.clone(this.pfxBlob); - } - - /** - * Set the pfxBlob property: Pfx blob. - * - * @param pfxBlob the pfxBlob value to set. - * @return the CertificatePatchResourceProperties object itself. - */ - public CertificatePatchResourceProperties withPfxBlob(byte[] pfxBlob) { - this.pfxBlob = CoreUtils.clone(pfxBlob); - return this; - } - - /** - * Get the siteName property: App name. - * - * @return the siteName value. - */ - public String siteName() { - return this.siteName; - } - - /** - * Get the selfLink property: Self link. - * - * @return the selfLink value. - */ - public String selfLink() { - return this.selfLink; - } - - /** - * Get the issuer property: Certificate issuer. - * - * @return the issuer value. - */ - public String issuer() { - return this.issuer; - } - - /** - * Get the issueDate property: Certificate issue Date. - * - * @return the issueDate value. - */ - public OffsetDateTime issueDate() { - return this.issueDate; - } - - /** - * Get the expirationDate property: Certificate expiration date. - * - * @return the expirationDate value. - */ - public OffsetDateTime expirationDate() { - return this.expirationDate; - } - - /** - * Get the password property: Certificate password. - * - * @return the password value. - */ - public String password() { - return this.password; - } - - /** - * Set the password property: Certificate password. - * - * @param password the password value to set. - * @return the CertificatePatchResourceProperties object itself. - */ - public CertificatePatchResourceProperties withPassword(String password) { - this.password = password; - return this; - } - - /** - * Get the thumbprint property: Certificate thumbprint. - * - * @return the thumbprint value. - */ - public String thumbprint() { - return this.thumbprint; - } - - /** - * Get the valid property: Is the certificate valid?. - * - * @return the valid value. - */ - public Boolean valid() { - return this.valid; - } - - /** - * Get the cerBlob property: Raw bytes of .cer file. - * - * @return the cerBlob value. - */ - public byte[] cerBlob() { - return CoreUtils.clone(this.cerBlob); - } - - /** - * Get the publicKeyHash property: Public key hash. - * - * @return the publicKeyHash value. - */ - public String publicKeyHash() { - return this.publicKeyHash; - } - - /** - * Get the hostingEnvironmentProfile property: Specification for the App Service Environment to use for the - * certificate. - * - * @return the hostingEnvironmentProfile value. - */ - public HostingEnvironmentProfile hostingEnvironmentProfile() { - return this.hostingEnvironmentProfile; - } - - /** - * Get the keyVaultId property: Key Vault Csm resource Id. - * - * @return the keyVaultId value. - */ - public String keyVaultId() { - return this.keyVaultId; - } - - /** - * Set the keyVaultId property: Key Vault Csm resource Id. - * - * @param keyVaultId the keyVaultId value to set. - * @return the CertificatePatchResourceProperties object itself. - */ - public CertificatePatchResourceProperties withKeyVaultId(String keyVaultId) { - this.keyVaultId = keyVaultId; - return this; - } - - /** - * Get the keyVaultSecretName property: Key Vault secret name. - * - * @return the keyVaultSecretName value. - */ - public String keyVaultSecretName() { - return this.keyVaultSecretName; - } - - /** - * Set the keyVaultSecretName property: Key Vault secret name. - * - * @param keyVaultSecretName the keyVaultSecretName value to set. - * @return the CertificatePatchResourceProperties object itself. - */ - public CertificatePatchResourceProperties withKeyVaultSecretName(String keyVaultSecretName) { - this.keyVaultSecretName = keyVaultSecretName; - return this; - } - - /** - * Get the keyVaultSecretStatus property: Status of the Key Vault secret. - * - * @return the keyVaultSecretStatus value. - */ - public KeyVaultSecretStatus keyVaultSecretStatus() { - return this.keyVaultSecretStatus; - } - - /** - * Get the serverFarmId property: Resource ID of the associated App Service plan, formatted as: - * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms" - + "/{appServicePlanName}". - * - * @return the serverFarmId value. - */ - public String serverFarmId() { - return this.serverFarmId; - } - - /** - * Set the serverFarmId property: Resource ID of the associated App Service plan, formatted as: - * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms" - + "/{appServicePlanName}". - * - * @param serverFarmId the serverFarmId value to set. - * @return the CertificatePatchResourceProperties object itself. - */ - public CertificatePatchResourceProperties withServerFarmId(String serverFarmId) { - this.serverFarmId = serverFarmId; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (password() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property password in model CertificatePatchResourceProperties")); - } - if (hostingEnvironmentProfile() != null) { - hostingEnvironmentProfile().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/CertificateProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/CertificateProperties.java deleted file mode 100644 index 579464d52292..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/CertificateProperties.java +++ /dev/null @@ -1,396 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.HostingEnvironmentProfile; -import com.azure.resourcemanager.appservice.models.KeyVaultSecretStatus; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; - -/** Certificate resource specific properties. */ -@Fluent -public final class CertificateProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CertificateProperties.class); - - /* - * Friendly name of the certificate. - */ - @JsonProperty(value = "friendlyName", access = JsonProperty.Access.WRITE_ONLY) - private String friendlyName; - - /* - * Subject name of the certificate. - */ - @JsonProperty(value = "subjectName", access = JsonProperty.Access.WRITE_ONLY) - private String subjectName; - - /* - * Host names the certificate applies to. - */ - @JsonProperty(value = "hostNames") - private List hostNames; - - /* - * Pfx blob. - */ - @JsonProperty(value = "pfxBlob") - private byte[] pfxBlob; - - /* - * App name. - */ - @JsonProperty(value = "siteName", access = JsonProperty.Access.WRITE_ONLY) - private String siteName; - - /* - * Self link. - */ - @JsonProperty(value = "selfLink", access = JsonProperty.Access.WRITE_ONLY) - private String selfLink; - - /* - * Certificate issuer. - */ - @JsonProperty(value = "issuer", access = JsonProperty.Access.WRITE_ONLY) - private String issuer; - - /* - * Certificate issue Date. - */ - @JsonProperty(value = "issueDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime issueDate; - - /* - * Certificate expiration date. - */ - @JsonProperty(value = "expirationDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime expirationDate; - - /* - * Certificate password. - */ - @JsonProperty(value = "password", required = true) - private String password; - - /* - * Certificate thumbprint. - */ - @JsonProperty(value = "thumbprint", access = JsonProperty.Access.WRITE_ONLY) - private String thumbprint; - - /* - * Is the certificate valid?. - */ - @JsonProperty(value = "valid", access = JsonProperty.Access.WRITE_ONLY) - private Boolean valid; - - /* - * Raw bytes of .cer file - */ - @JsonProperty(value = "cerBlob", access = JsonProperty.Access.WRITE_ONLY) - private byte[] cerBlob; - - /* - * Public key hash. - */ - @JsonProperty(value = "publicKeyHash", access = JsonProperty.Access.WRITE_ONLY) - private String publicKeyHash; - - /* - * Specification for the App Service Environment to use for the - * certificate. - */ - @JsonProperty(value = "hostingEnvironmentProfile", access = JsonProperty.Access.WRITE_ONLY) - private HostingEnvironmentProfile hostingEnvironmentProfile; - - /* - * Key Vault Csm resource Id. - */ - @JsonProperty(value = "keyVaultId") - private String keyVaultId; - - /* - * Key Vault secret name. - */ - @JsonProperty(value = "keyVaultSecretName") - private String keyVaultSecretName; - - /* - * Status of the Key Vault secret. - */ - @JsonProperty(value = "keyVaultSecretStatus", access = JsonProperty.Access.WRITE_ONLY) - private KeyVaultSecretStatus keyVaultSecretStatus; - - /* - * Resource ID of the associated App Service plan, formatted as: - * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms" - + "/{appServicePlanName}". - */ - @JsonProperty(value = "serverFarmId") - private String serverFarmId; - - /** - * Get the friendlyName property: Friendly name of the certificate. - * - * @return the friendlyName value. - */ - public String friendlyName() { - return this.friendlyName; - } - - /** - * Get the subjectName property: Subject name of the certificate. - * - * @return the subjectName value. - */ - public String subjectName() { - return this.subjectName; - } - - /** - * Get the hostNames property: Host names the certificate applies to. - * - * @return the hostNames value. - */ - public List hostNames() { - return this.hostNames; - } - - /** - * Set the hostNames property: Host names the certificate applies to. - * - * @param hostNames the hostNames value to set. - * @return the CertificateProperties object itself. - */ - public CertificateProperties withHostNames(List hostNames) { - this.hostNames = hostNames; - return this; - } - - /** - * Get the pfxBlob property: Pfx blob. - * - * @return the pfxBlob value. - */ - public byte[] pfxBlob() { - return CoreUtils.clone(this.pfxBlob); - } - - /** - * Set the pfxBlob property: Pfx blob. - * - * @param pfxBlob the pfxBlob value to set. - * @return the CertificateProperties object itself. - */ - public CertificateProperties withPfxBlob(byte[] pfxBlob) { - this.pfxBlob = CoreUtils.clone(pfxBlob); - return this; - } - - /** - * Get the siteName property: App name. - * - * @return the siteName value. - */ - public String siteName() { - return this.siteName; - } - - /** - * Get the selfLink property: Self link. - * - * @return the selfLink value. - */ - public String selfLink() { - return this.selfLink; - } - - /** - * Get the issuer property: Certificate issuer. - * - * @return the issuer value. - */ - public String issuer() { - return this.issuer; - } - - /** - * Get the issueDate property: Certificate issue Date. - * - * @return the issueDate value. - */ - public OffsetDateTime issueDate() { - return this.issueDate; - } - - /** - * Get the expirationDate property: Certificate expiration date. - * - * @return the expirationDate value. - */ - public OffsetDateTime expirationDate() { - return this.expirationDate; - } - - /** - * Get the password property: Certificate password. - * - * @return the password value. - */ - public String password() { - return this.password; - } - - /** - * Set the password property: Certificate password. - * - * @param password the password value to set. - * @return the CertificateProperties object itself. - */ - public CertificateProperties withPassword(String password) { - this.password = password; - return this; - } - - /** - * Get the thumbprint property: Certificate thumbprint. - * - * @return the thumbprint value. - */ - public String thumbprint() { - return this.thumbprint; - } - - /** - * Get the valid property: Is the certificate valid?. - * - * @return the valid value. - */ - public Boolean valid() { - return this.valid; - } - - /** - * Get the cerBlob property: Raw bytes of .cer file. - * - * @return the cerBlob value. - */ - public byte[] cerBlob() { - return CoreUtils.clone(this.cerBlob); - } - - /** - * Get the publicKeyHash property: Public key hash. - * - * @return the publicKeyHash value. - */ - public String publicKeyHash() { - return this.publicKeyHash; - } - - /** - * Get the hostingEnvironmentProfile property: Specification for the App Service Environment to use for the - * certificate. - * - * @return the hostingEnvironmentProfile value. - */ - public HostingEnvironmentProfile hostingEnvironmentProfile() { - return this.hostingEnvironmentProfile; - } - - /** - * Get the keyVaultId property: Key Vault Csm resource Id. - * - * @return the keyVaultId value. - */ - public String keyVaultId() { - return this.keyVaultId; - } - - /** - * Set the keyVaultId property: Key Vault Csm resource Id. - * - * @param keyVaultId the keyVaultId value to set. - * @return the CertificateProperties object itself. - */ - public CertificateProperties withKeyVaultId(String keyVaultId) { - this.keyVaultId = keyVaultId; - return this; - } - - /** - * Get the keyVaultSecretName property: Key Vault secret name. - * - * @return the keyVaultSecretName value. - */ - public String keyVaultSecretName() { - return this.keyVaultSecretName; - } - - /** - * Set the keyVaultSecretName property: Key Vault secret name. - * - * @param keyVaultSecretName the keyVaultSecretName value to set. - * @return the CertificateProperties object itself. - */ - public CertificateProperties withKeyVaultSecretName(String keyVaultSecretName) { - this.keyVaultSecretName = keyVaultSecretName; - return this; - } - - /** - * Get the keyVaultSecretStatus property: Status of the Key Vault secret. - * - * @return the keyVaultSecretStatus value. - */ - public KeyVaultSecretStatus keyVaultSecretStatus() { - return this.keyVaultSecretStatus; - } - - /** - * Get the serverFarmId property: Resource ID of the associated App Service plan, formatted as: - * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms" - + "/{appServicePlanName}". - * - * @return the serverFarmId value. - */ - public String serverFarmId() { - return this.serverFarmId; - } - - /** - * Set the serverFarmId property: Resource ID of the associated App Service plan, formatted as: - * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms" - + "/{appServicePlanName}". - * - * @param serverFarmId the serverFarmId value to set. - * @return the CertificateProperties object itself. - */ - public CertificateProperties withServerFarmId(String serverFarmId) { - this.serverFarmId = serverFarmId; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (password() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property password in model CertificateProperties")); - } - if (hostingEnvironmentProfile() != null) { - hostingEnvironmentProfile().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/ConnectionStringDictionaryInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/ConnectionStringDictionaryInner.java deleted file mode 100644 index 9ee4ca0243d8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/ConnectionStringDictionaryInner.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.ConnStringValueTypePair; -import com.azure.resourcemanager.appservice.models.ProxyOnlyResource; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** String dictionary resource. */ -@Fluent -public final class ConnectionStringDictionaryInner extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectionStringDictionaryInner.class); - - /* - * Connection strings. - */ - @JsonProperty(value = "properties") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map properties; - - /** - * Get the properties property: Connection strings. - * - * @return the properties value. - */ - public Map properties() { - return this.properties; - } - - /** - * Set the properties property: Connection strings. - * - * @param properties the properties value to set. - * @return the ConnectionStringDictionaryInner object itself. - */ - public ConnectionStringDictionaryInner withProperties(Map properties) { - this.properties = properties; - return this; - } - - /** {@inheritDoc} */ - @Override - public ConnectionStringDictionaryInner withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (properties() != null) { - properties() - .values() - .forEach( - e -> { - if (e != null) { - e.validate(); - } - }); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/ContinuousWebJobInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/ContinuousWebJobInner.java deleted file mode 100644 index edcaa26d6fb6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/ContinuousWebJobInner.java +++ /dev/null @@ -1,285 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.ContinuousWebJobStatus; -import com.azure.resourcemanager.appservice.models.ProxyOnlyResource; -import com.azure.resourcemanager.appservice.models.WebJobType; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** Continuous Web Job Information. */ -@Fluent -public final class ContinuousWebJobInner extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ContinuousWebJobInner.class); - - /* - * ContinuousWebJob resource specific properties - */ - @JsonProperty(value = "properties") - private ContinuousWebJobProperties innerProperties; - - /** - * Get the innerProperties property: ContinuousWebJob resource specific properties. - * - * @return the innerProperties value. - */ - private ContinuousWebJobProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public ContinuousWebJobInner withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the status property: Job status. - * - * @return the status value. - */ - public ContinuousWebJobStatus status() { - return this.innerProperties() == null ? null : this.innerProperties().status(); - } - - /** - * Set the status property: Job status. - * - * @param status the status value to set. - * @return the ContinuousWebJobInner object itself. - */ - public ContinuousWebJobInner withStatus(ContinuousWebJobStatus status) { - if (this.innerProperties() == null) { - this.innerProperties = new ContinuousWebJobProperties(); - } - this.innerProperties().withStatus(status); - return this; - } - - /** - * Get the detailedStatus property: Detailed status. - * - * @return the detailedStatus value. - */ - public String detailedStatus() { - return this.innerProperties() == null ? null : this.innerProperties().detailedStatus(); - } - - /** - * Set the detailedStatus property: Detailed status. - * - * @param detailedStatus the detailedStatus value to set. - * @return the ContinuousWebJobInner object itself. - */ - public ContinuousWebJobInner withDetailedStatus(String detailedStatus) { - if (this.innerProperties() == null) { - this.innerProperties = new ContinuousWebJobProperties(); - } - this.innerProperties().withDetailedStatus(detailedStatus); - return this; - } - - /** - * Get the logUrl property: Log URL. - * - * @return the logUrl value. - */ - public String logUrl() { - return this.innerProperties() == null ? null : this.innerProperties().logUrl(); - } - - /** - * Set the logUrl property: Log URL. - * - * @param logUrl the logUrl value to set. - * @return the ContinuousWebJobInner object itself. - */ - public ContinuousWebJobInner withLogUrl(String logUrl) { - if (this.innerProperties() == null) { - this.innerProperties = new ContinuousWebJobProperties(); - } - this.innerProperties().withLogUrl(logUrl); - return this; - } - - /** - * Get the runCommand property: Run command. - * - * @return the runCommand value. - */ - public String runCommand() { - return this.innerProperties() == null ? null : this.innerProperties().runCommand(); - } - - /** - * Set the runCommand property: Run command. - * - * @param runCommand the runCommand value to set. - * @return the ContinuousWebJobInner object itself. - */ - public ContinuousWebJobInner withRunCommand(String runCommand) { - if (this.innerProperties() == null) { - this.innerProperties = new ContinuousWebJobProperties(); - } - this.innerProperties().withRunCommand(runCommand); - return this; - } - - /** - * Get the url property: Job URL. - * - * @return the url value. - */ - public String url() { - return this.innerProperties() == null ? null : this.innerProperties().url(); - } - - /** - * Set the url property: Job URL. - * - * @param url the url value to set. - * @return the ContinuousWebJobInner object itself. - */ - public ContinuousWebJobInner withUrl(String url) { - if (this.innerProperties() == null) { - this.innerProperties = new ContinuousWebJobProperties(); - } - this.innerProperties().withUrl(url); - return this; - } - - /** - * Get the extraInfoUrl property: Extra Info URL. - * - * @return the extraInfoUrl value. - */ - public String extraInfoUrl() { - return this.innerProperties() == null ? null : this.innerProperties().extraInfoUrl(); - } - - /** - * Set the extraInfoUrl property: Extra Info URL. - * - * @param extraInfoUrl the extraInfoUrl value to set. - * @return the ContinuousWebJobInner object itself. - */ - public ContinuousWebJobInner withExtraInfoUrl(String extraInfoUrl) { - if (this.innerProperties() == null) { - this.innerProperties = new ContinuousWebJobProperties(); - } - this.innerProperties().withExtraInfoUrl(extraInfoUrl); - return this; - } - - /** - * Get the webJobType property: Job type. - * - * @return the webJobType value. - */ - public WebJobType webJobType() { - return this.innerProperties() == null ? null : this.innerProperties().webJobType(); - } - - /** - * Set the webJobType property: Job type. - * - * @param webJobType the webJobType value to set. - * @return the ContinuousWebJobInner object itself. - */ - public ContinuousWebJobInner withWebJobType(WebJobType webJobType) { - if (this.innerProperties() == null) { - this.innerProperties = new ContinuousWebJobProperties(); - } - this.innerProperties().withWebJobType(webJobType); - return this; - } - - /** - * Get the error property: Error information. - * - * @return the error value. - */ - public String error() { - return this.innerProperties() == null ? null : this.innerProperties().error(); - } - - /** - * Set the error property: Error information. - * - * @param error the error value to set. - * @return the ContinuousWebJobInner object itself. - */ - public ContinuousWebJobInner withError(String error) { - if (this.innerProperties() == null) { - this.innerProperties = new ContinuousWebJobProperties(); - } - this.innerProperties().withError(error); - return this; - } - - /** - * Get the usingSdk property: Using SDK?. - * - * @return the usingSdk value. - */ - public Boolean usingSdk() { - return this.innerProperties() == null ? null : this.innerProperties().usingSdk(); - } - - /** - * Set the usingSdk property: Using SDK?. - * - * @param usingSdk the usingSdk value to set. - * @return the ContinuousWebJobInner object itself. - */ - public ContinuousWebJobInner withUsingSdk(Boolean usingSdk) { - if (this.innerProperties() == null) { - this.innerProperties = new ContinuousWebJobProperties(); - } - this.innerProperties().withUsingSdk(usingSdk); - return this; - } - - /** - * Get the settings property: Job settings. - * - * @return the settings value. - */ - public Map settings() { - return this.innerProperties() == null ? null : this.innerProperties().settings(); - } - - /** - * Set the settings property: Job settings. - * - * @param settings the settings value to set. - * @return the ContinuousWebJobInner object itself. - */ - public ContinuousWebJobInner withSettings(Map settings) { - if (this.innerProperties() == null) { - this.innerProperties = new ContinuousWebJobProperties(); - } - this.innerProperties().withSettings(settings); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/ContinuousWebJobProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/ContinuousWebJobProperties.java deleted file mode 100644 index 78afdf366c06..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/ContinuousWebJobProperties.java +++ /dev/null @@ -1,289 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.ContinuousWebJobStatus; -import com.azure.resourcemanager.appservice.models.WebJobType; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** ContinuousWebJob resource specific properties. */ -@Fluent -public final class ContinuousWebJobProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ContinuousWebJobProperties.class); - - /* - * Job status. - */ - @JsonProperty(value = "status") - private ContinuousWebJobStatus status; - - /* - * Detailed status. - */ - @JsonProperty(value = "detailed_status") - private String detailedStatus; - - /* - * Log URL. - */ - @JsonProperty(value = "log_url") - private String logUrl; - - /* - * Run command. - */ - @JsonProperty(value = "run_command") - private String runCommand; - - /* - * Job URL. - */ - @JsonProperty(value = "url") - private String url; - - /* - * Extra Info URL. - */ - @JsonProperty(value = "extra_info_url") - private String extraInfoUrl; - - /* - * Job type. - */ - @JsonProperty(value = "web_job_type") - private WebJobType webJobType; - - /* - * Error information. - */ - @JsonProperty(value = "error") - private String error; - - /* - * Using SDK? - */ - @JsonProperty(value = "using_sdk") - private Boolean usingSdk; - - /* - * Job settings. - */ - @JsonProperty(value = "settings") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map settings; - - /** - * Get the status property: Job status. - * - * @return the status value. - */ - public ContinuousWebJobStatus status() { - return this.status; - } - - /** - * Set the status property: Job status. - * - * @param status the status value to set. - * @return the ContinuousWebJobProperties object itself. - */ - public ContinuousWebJobProperties withStatus(ContinuousWebJobStatus status) { - this.status = status; - return this; - } - - /** - * Get the detailedStatus property: Detailed status. - * - * @return the detailedStatus value. - */ - public String detailedStatus() { - return this.detailedStatus; - } - - /** - * Set the detailedStatus property: Detailed status. - * - * @param detailedStatus the detailedStatus value to set. - * @return the ContinuousWebJobProperties object itself. - */ - public ContinuousWebJobProperties withDetailedStatus(String detailedStatus) { - this.detailedStatus = detailedStatus; - return this; - } - - /** - * Get the logUrl property: Log URL. - * - * @return the logUrl value. - */ - public String logUrl() { - return this.logUrl; - } - - /** - * Set the logUrl property: Log URL. - * - * @param logUrl the logUrl value to set. - * @return the ContinuousWebJobProperties object itself. - */ - public ContinuousWebJobProperties withLogUrl(String logUrl) { - this.logUrl = logUrl; - return this; - } - - /** - * Get the runCommand property: Run command. - * - * @return the runCommand value. - */ - public String runCommand() { - return this.runCommand; - } - - /** - * Set the runCommand property: Run command. - * - * @param runCommand the runCommand value to set. - * @return the ContinuousWebJobProperties object itself. - */ - public ContinuousWebJobProperties withRunCommand(String runCommand) { - this.runCommand = runCommand; - return this; - } - - /** - * Get the url property: Job URL. - * - * @return the url value. - */ - public String url() { - return this.url; - } - - /** - * Set the url property: Job URL. - * - * @param url the url value to set. - * @return the ContinuousWebJobProperties object itself. - */ - public ContinuousWebJobProperties withUrl(String url) { - this.url = url; - return this; - } - - /** - * Get the extraInfoUrl property: Extra Info URL. - * - * @return the extraInfoUrl value. - */ - public String extraInfoUrl() { - return this.extraInfoUrl; - } - - /** - * Set the extraInfoUrl property: Extra Info URL. - * - * @param extraInfoUrl the extraInfoUrl value to set. - * @return the ContinuousWebJobProperties object itself. - */ - public ContinuousWebJobProperties withExtraInfoUrl(String extraInfoUrl) { - this.extraInfoUrl = extraInfoUrl; - return this; - } - - /** - * Get the webJobType property: Job type. - * - * @return the webJobType value. - */ - public WebJobType webJobType() { - return this.webJobType; - } - - /** - * Set the webJobType property: Job type. - * - * @param webJobType the webJobType value to set. - * @return the ContinuousWebJobProperties object itself. - */ - public ContinuousWebJobProperties withWebJobType(WebJobType webJobType) { - this.webJobType = webJobType; - return this; - } - - /** - * Get the error property: Error information. - * - * @return the error value. - */ - public String error() { - return this.error; - } - - /** - * Set the error property: Error information. - * - * @param error the error value to set. - * @return the ContinuousWebJobProperties object itself. - */ - public ContinuousWebJobProperties withError(String error) { - this.error = error; - return this; - } - - /** - * Get the usingSdk property: Using SDK?. - * - * @return the usingSdk value. - */ - public Boolean usingSdk() { - return this.usingSdk; - } - - /** - * Set the usingSdk property: Using SDK?. - * - * @param usingSdk the usingSdk value to set. - * @return the ContinuousWebJobProperties object itself. - */ - public ContinuousWebJobProperties withUsingSdk(Boolean usingSdk) { - this.usingSdk = usingSdk; - return this; - } - - /** - * Get the settings property: Job settings. - * - * @return the settings value. - */ - public Map settings() { - return this.settings; - } - - /** - * Set the settings property: Job settings. - * - * @param settings the settings value to set. - * @return the ContinuousWebJobProperties object itself. - */ - public ContinuousWebJobProperties withSettings(Map settings) { - this.settings = settings; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/CsmOperationDescriptionInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/CsmOperationDescriptionInner.java deleted file mode 100644 index e3cab8d6f2e9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/CsmOperationDescriptionInner.java +++ /dev/null @@ -1,136 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.CsmOperationDescriptionProperties; -import com.azure.resourcemanager.appservice.models.CsmOperationDisplay; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Description of an operation available for Microsoft.Web resource provider. */ -@Fluent -public final class CsmOperationDescriptionInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CsmOperationDescriptionInner.class); - - /* - * The name property. - */ - @JsonProperty(value = "name") - private String name; - - /* - * Meta data about operation used for display in portal. - */ - @JsonProperty(value = "display") - private CsmOperationDisplay display; - - /* - * The origin property. - */ - @JsonProperty(value = "origin") - private String origin; - - /* - * Properties available for a Microsoft.Web resource provider operation. - */ - @JsonProperty(value = "properties") - private CsmOperationDescriptionProperties properties; - - /** - * Get the name property: The name property. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name property. - * - * @param name the name value to set. - * @return the CsmOperationDescriptionInner object itself. - */ - public CsmOperationDescriptionInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the display property: Meta data about operation used for display in portal. - * - * @return the display value. - */ - public CsmOperationDisplay display() { - return this.display; - } - - /** - * Set the display property: Meta data about operation used for display in portal. - * - * @param display the display value to set. - * @return the CsmOperationDescriptionInner object itself. - */ - public CsmOperationDescriptionInner withDisplay(CsmOperationDisplay display) { - this.display = display; - return this; - } - - /** - * Get the origin property: The origin property. - * - * @return the origin value. - */ - public String origin() { - return this.origin; - } - - /** - * Set the origin property: The origin property. - * - * @param origin the origin value to set. - * @return the CsmOperationDescriptionInner object itself. - */ - public CsmOperationDescriptionInner withOrigin(String origin) { - this.origin = origin; - return this; - } - - /** - * Get the properties property: Properties available for a Microsoft.Web resource provider operation. - * - * @return the properties value. - */ - public CsmOperationDescriptionProperties properties() { - return this.properties; - } - - /** - * Set the properties property: Properties available for a Microsoft.Web resource provider operation. - * - * @param properties the properties value to set. - * @return the CsmOperationDescriptionInner object itself. - */ - public CsmOperationDescriptionInner withProperties(CsmOperationDescriptionProperties properties) { - this.properties = properties; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (display() != null) { - display().validate(); - } - if (properties() != null) { - properties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/CsmUsageQuotaInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/CsmUsageQuotaInner.java deleted file mode 100644 index 18680f6f8aba..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/CsmUsageQuotaInner.java +++ /dev/null @@ -1,159 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.LocalizableString; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** Usage of the quota resource. */ -@Fluent -public final class CsmUsageQuotaInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CsmUsageQuotaInner.class); - - /* - * Units of measurement for the quota resource. - */ - @JsonProperty(value = "unit") - private String unit; - - /* - * Next reset time for the resource counter. - */ - @JsonProperty(value = "nextResetTime") - private OffsetDateTime nextResetTime; - - /* - * The current value of the resource counter. - */ - @JsonProperty(value = "currentValue") - private Long currentValue; - - /* - * The resource limit. - */ - @JsonProperty(value = "limit") - private Long limit; - - /* - * Quota name. - */ - @JsonProperty(value = "name") - private LocalizableString name; - - /** - * Get the unit property: Units of measurement for the quota resource. - * - * @return the unit value. - */ - public String unit() { - return this.unit; - } - - /** - * Set the unit property: Units of measurement for the quota resource. - * - * @param unit the unit value to set. - * @return the CsmUsageQuotaInner object itself. - */ - public CsmUsageQuotaInner withUnit(String unit) { - this.unit = unit; - return this; - } - - /** - * Get the nextResetTime property: Next reset time for the resource counter. - * - * @return the nextResetTime value. - */ - public OffsetDateTime nextResetTime() { - return this.nextResetTime; - } - - /** - * Set the nextResetTime property: Next reset time for the resource counter. - * - * @param nextResetTime the nextResetTime value to set. - * @return the CsmUsageQuotaInner object itself. - */ - public CsmUsageQuotaInner withNextResetTime(OffsetDateTime nextResetTime) { - this.nextResetTime = nextResetTime; - return this; - } - - /** - * Get the currentValue property: The current value of the resource counter. - * - * @return the currentValue value. - */ - public Long currentValue() { - return this.currentValue; - } - - /** - * Set the currentValue property: The current value of the resource counter. - * - * @param currentValue the currentValue value to set. - * @return the CsmUsageQuotaInner object itself. - */ - public CsmUsageQuotaInner withCurrentValue(Long currentValue) { - this.currentValue = currentValue; - return this; - } - - /** - * Get the limit property: The resource limit. - * - * @return the limit value. - */ - public Long limit() { - return this.limit; - } - - /** - * Set the limit property: The resource limit. - * - * @param limit the limit value to set. - * @return the CsmUsageQuotaInner object itself. - */ - public CsmUsageQuotaInner withLimit(Long limit) { - this.limit = limit; - return this; - } - - /** - * Get the name property: Quota name. - * - * @return the name value. - */ - public LocalizableString name() { - return this.name; - } - - /** - * Set the name property: Quota name. - * - * @param name the name value to set. - * @return the CsmUsageQuotaInner object itself. - */ - public CsmUsageQuotaInner withName(LocalizableString name) { - this.name = name; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() != null) { - name().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/CustomHostnameAnalysisResultInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/CustomHostnameAnalysisResultInner.java deleted file mode 100644 index e84b853c65fd..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/CustomHostnameAnalysisResultInner.java +++ /dev/null @@ -1,228 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.DnsVerificationTestResult; -import com.azure.resourcemanager.appservice.models.ErrorEntity; -import com.azure.resourcemanager.appservice.models.ProxyOnlyResource; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Custom domain analysis. */ -@Fluent -public final class CustomHostnameAnalysisResultInner extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomHostnameAnalysisResultInner.class); - - /* - * CustomHostnameAnalysisResult resource specific properties - */ - @JsonProperty(value = "properties") - private CustomHostnameAnalysisResultProperties innerProperties; - - /** - * Get the innerProperties property: CustomHostnameAnalysisResult resource specific properties. - * - * @return the innerProperties value. - */ - private CustomHostnameAnalysisResultProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public CustomHostnameAnalysisResultInner withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the isHostnameAlreadyVerified property: <code>true</code> if hostname is already verified; - * otherwise, <code>false</code>. - * - * @return the isHostnameAlreadyVerified value. - */ - public Boolean isHostnameAlreadyVerified() { - return this.innerProperties() == null ? null : this.innerProperties().isHostnameAlreadyVerified(); - } - - /** - * Get the customDomainVerificationTest property: DNS verification test result. - * - * @return the customDomainVerificationTest value. - */ - public DnsVerificationTestResult customDomainVerificationTest() { - return this.innerProperties() == null ? null : this.innerProperties().customDomainVerificationTest(); - } - - /** - * Get the customDomainVerificationFailureInfo property: Raw failure information if DNS verification fails. - * - * @return the customDomainVerificationFailureInfo value. - */ - public ErrorEntity customDomainVerificationFailureInfo() { - return this.innerProperties() == null ? null : this.innerProperties().customDomainVerificationFailureInfo(); - } - - /** - * Get the hasConflictOnScaleUnit property: <code>true</code> if there is a conflict on a scale unit; - * otherwise, <code>false</code>. - * - * @return the hasConflictOnScaleUnit value. - */ - public Boolean hasConflictOnScaleUnit() { - return this.innerProperties() == null ? null : this.innerProperties().hasConflictOnScaleUnit(); - } - - /** - * Get the hasConflictAcrossSubscription property: <code>true</code> if there is a conflict across - * subscriptions; otherwise, <code>false</code>. - * - * @return the hasConflictAcrossSubscription value. - */ - public Boolean hasConflictAcrossSubscription() { - return this.innerProperties() == null ? null : this.innerProperties().hasConflictAcrossSubscription(); - } - - /** - * Get the conflictingAppResourceId property: Name of the conflicting app on scale unit if it's within the same - * subscription. - * - * @return the conflictingAppResourceId value. - */ - public String conflictingAppResourceId() { - return this.innerProperties() == null ? null : this.innerProperties().conflictingAppResourceId(); - } - - /** - * Get the cNameRecords property: CName records controller can see for this hostname. - * - * @return the cNameRecords value. - */ - public List cNameRecords() { - return this.innerProperties() == null ? null : this.innerProperties().cNameRecords(); - } - - /** - * Set the cNameRecords property: CName records controller can see for this hostname. - * - * @param cNameRecords the cNameRecords value to set. - * @return the CustomHostnameAnalysisResultInner object itself. - */ - public CustomHostnameAnalysisResultInner withCNameRecords(List cNameRecords) { - if (this.innerProperties() == null) { - this.innerProperties = new CustomHostnameAnalysisResultProperties(); - } - this.innerProperties().withCNameRecords(cNameRecords); - return this; - } - - /** - * Get the txtRecords property: TXT records controller can see for this hostname. - * - * @return the txtRecords value. - */ - public List txtRecords() { - return this.innerProperties() == null ? null : this.innerProperties().txtRecords(); - } - - /** - * Set the txtRecords property: TXT records controller can see for this hostname. - * - * @param txtRecords the txtRecords value to set. - * @return the CustomHostnameAnalysisResultInner object itself. - */ - public CustomHostnameAnalysisResultInner withTxtRecords(List txtRecords) { - if (this.innerProperties() == null) { - this.innerProperties = new CustomHostnameAnalysisResultProperties(); - } - this.innerProperties().withTxtRecords(txtRecords); - return this; - } - - /** - * Get the aRecords property: A records controller can see for this hostname. - * - * @return the aRecords value. - */ - public List aRecords() { - return this.innerProperties() == null ? null : this.innerProperties().aRecords(); - } - - /** - * Set the aRecords property: A records controller can see for this hostname. - * - * @param aRecords the aRecords value to set. - * @return the CustomHostnameAnalysisResultInner object itself. - */ - public CustomHostnameAnalysisResultInner withARecords(List aRecords) { - if (this.innerProperties() == null) { - this.innerProperties = new CustomHostnameAnalysisResultProperties(); - } - this.innerProperties().withARecords(aRecords); - return this; - } - - /** - * Get the alternateCNameRecords property: Alternate CName records controller can see for this hostname. - * - * @return the alternateCNameRecords value. - */ - public List alternateCNameRecords() { - return this.innerProperties() == null ? null : this.innerProperties().alternateCNameRecords(); - } - - /** - * Set the alternateCNameRecords property: Alternate CName records controller can see for this hostname. - * - * @param alternateCNameRecords the alternateCNameRecords value to set. - * @return the CustomHostnameAnalysisResultInner object itself. - */ - public CustomHostnameAnalysisResultInner withAlternateCNameRecords(List alternateCNameRecords) { - if (this.innerProperties() == null) { - this.innerProperties = new CustomHostnameAnalysisResultProperties(); - } - this.innerProperties().withAlternateCNameRecords(alternateCNameRecords); - return this; - } - - /** - * Get the alternateTxtRecords property: Alternate TXT records controller can see for this hostname. - * - * @return the alternateTxtRecords value. - */ - public List alternateTxtRecords() { - return this.innerProperties() == null ? null : this.innerProperties().alternateTxtRecords(); - } - - /** - * Set the alternateTxtRecords property: Alternate TXT records controller can see for this hostname. - * - * @param alternateTxtRecords the alternateTxtRecords value to set. - * @return the CustomHostnameAnalysisResultInner object itself. - */ - public CustomHostnameAnalysisResultInner withAlternateTxtRecords(List alternateTxtRecords) { - if (this.innerProperties() == null) { - this.innerProperties = new CustomHostnameAnalysisResultProperties(); - } - this.innerProperties().withAlternateTxtRecords(alternateTxtRecords); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/CustomHostnameAnalysisResultProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/CustomHostnameAnalysisResultProperties.java deleted file mode 100644 index 9e393f117ab2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/CustomHostnameAnalysisResultProperties.java +++ /dev/null @@ -1,258 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.DnsVerificationTestResult; -import com.azure.resourcemanager.appservice.models.ErrorEntity; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** CustomHostnameAnalysisResult resource specific properties. */ -@Fluent -public final class CustomHostnameAnalysisResultProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomHostnameAnalysisResultProperties.class); - - /* - * true if hostname is already verified; otherwise, - * false. - */ - @JsonProperty(value = "isHostnameAlreadyVerified", access = JsonProperty.Access.WRITE_ONLY) - private Boolean isHostnameAlreadyVerified; - - /* - * DNS verification test result. - */ - @JsonProperty(value = "customDomainVerificationTest", access = JsonProperty.Access.WRITE_ONLY) - private DnsVerificationTestResult customDomainVerificationTest; - - /* - * Raw failure information if DNS verification fails. - */ - @JsonProperty(value = "customDomainVerificationFailureInfo", access = JsonProperty.Access.WRITE_ONLY) - private ErrorEntity customDomainVerificationFailureInfo; - - /* - * true if there is a conflict on a scale unit; otherwise, - * false. - */ - @JsonProperty(value = "hasConflictOnScaleUnit", access = JsonProperty.Access.WRITE_ONLY) - private Boolean hasConflictOnScaleUnit; - - /* - * true if there is a conflict across subscriptions; - * otherwise, false. - */ - @JsonProperty(value = "hasConflictAcrossSubscription", access = JsonProperty.Access.WRITE_ONLY) - private Boolean hasConflictAcrossSubscription; - - /* - * Name of the conflicting app on scale unit if it's within the same - * subscription. - */ - @JsonProperty(value = "conflictingAppResourceId", access = JsonProperty.Access.WRITE_ONLY) - private String conflictingAppResourceId; - - /* - * CName records controller can see for this hostname. - */ - @JsonProperty(value = "cNameRecords") - private List cNameRecords; - - /* - * TXT records controller can see for this hostname. - */ - @JsonProperty(value = "txtRecords") - private List txtRecords; - - /* - * A records controller can see for this hostname. - */ - @JsonProperty(value = "aRecords") - private List aRecords; - - /* - * Alternate CName records controller can see for this hostname. - */ - @JsonProperty(value = "alternateCNameRecords") - private List alternateCNameRecords; - - /* - * Alternate TXT records controller can see for this hostname. - */ - @JsonProperty(value = "alternateTxtRecords") - private List alternateTxtRecords; - - /** - * Get the isHostnameAlreadyVerified property: <code>true</code> if hostname is already verified; - * otherwise, <code>false</code>. - * - * @return the isHostnameAlreadyVerified value. - */ - public Boolean isHostnameAlreadyVerified() { - return this.isHostnameAlreadyVerified; - } - - /** - * Get the customDomainVerificationTest property: DNS verification test result. - * - * @return the customDomainVerificationTest value. - */ - public DnsVerificationTestResult customDomainVerificationTest() { - return this.customDomainVerificationTest; - } - - /** - * Get the customDomainVerificationFailureInfo property: Raw failure information if DNS verification fails. - * - * @return the customDomainVerificationFailureInfo value. - */ - public ErrorEntity customDomainVerificationFailureInfo() { - return this.customDomainVerificationFailureInfo; - } - - /** - * Get the hasConflictOnScaleUnit property: <code>true</code> if there is a conflict on a scale unit; - * otherwise, <code>false</code>. - * - * @return the hasConflictOnScaleUnit value. - */ - public Boolean hasConflictOnScaleUnit() { - return this.hasConflictOnScaleUnit; - } - - /** - * Get the hasConflictAcrossSubscription property: <code>true</code> if there is a conflict across - * subscriptions; otherwise, <code>false</code>. - * - * @return the hasConflictAcrossSubscription value. - */ - public Boolean hasConflictAcrossSubscription() { - return this.hasConflictAcrossSubscription; - } - - /** - * Get the conflictingAppResourceId property: Name of the conflicting app on scale unit if it's within the same - * subscription. - * - * @return the conflictingAppResourceId value. - */ - public String conflictingAppResourceId() { - return this.conflictingAppResourceId; - } - - /** - * Get the cNameRecords property: CName records controller can see for this hostname. - * - * @return the cNameRecords value. - */ - public List cNameRecords() { - return this.cNameRecords; - } - - /** - * Set the cNameRecords property: CName records controller can see for this hostname. - * - * @param cNameRecords the cNameRecords value to set. - * @return the CustomHostnameAnalysisResultProperties object itself. - */ - public CustomHostnameAnalysisResultProperties withCNameRecords(List cNameRecords) { - this.cNameRecords = cNameRecords; - return this; - } - - /** - * Get the txtRecords property: TXT records controller can see for this hostname. - * - * @return the txtRecords value. - */ - public List txtRecords() { - return this.txtRecords; - } - - /** - * Set the txtRecords property: TXT records controller can see for this hostname. - * - * @param txtRecords the txtRecords value to set. - * @return the CustomHostnameAnalysisResultProperties object itself. - */ - public CustomHostnameAnalysisResultProperties withTxtRecords(List txtRecords) { - this.txtRecords = txtRecords; - return this; - } - - /** - * Get the aRecords property: A records controller can see for this hostname. - * - * @return the aRecords value. - */ - public List aRecords() { - return this.aRecords; - } - - /** - * Set the aRecords property: A records controller can see for this hostname. - * - * @param aRecords the aRecords value to set. - * @return the CustomHostnameAnalysisResultProperties object itself. - */ - public CustomHostnameAnalysisResultProperties withARecords(List aRecords) { - this.aRecords = aRecords; - return this; - } - - /** - * Get the alternateCNameRecords property: Alternate CName records controller can see for this hostname. - * - * @return the alternateCNameRecords value. - */ - public List alternateCNameRecords() { - return this.alternateCNameRecords; - } - - /** - * Set the alternateCNameRecords property: Alternate CName records controller can see for this hostname. - * - * @param alternateCNameRecords the alternateCNameRecords value to set. - * @return the CustomHostnameAnalysisResultProperties object itself. - */ - public CustomHostnameAnalysisResultProperties withAlternateCNameRecords(List alternateCNameRecords) { - this.alternateCNameRecords = alternateCNameRecords; - return this; - } - - /** - * Get the alternateTxtRecords property: Alternate TXT records controller can see for this hostname. - * - * @return the alternateTxtRecords value. - */ - public List alternateTxtRecords() { - return this.alternateTxtRecords; - } - - /** - * Set the alternateTxtRecords property: Alternate TXT records controller can see for this hostname. - * - * @param alternateTxtRecords the alternateTxtRecords value to set. - * @return the CustomHostnameAnalysisResultProperties object itself. - */ - public CustomHostnameAnalysisResultProperties withAlternateTxtRecords(List alternateTxtRecords) { - this.alternateTxtRecords = alternateTxtRecords; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (customDomainVerificationFailureInfo() != null) { - customDomainVerificationFailureInfo().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/DeletedAppRestoreRequestProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/DeletedAppRestoreRequestProperties.java deleted file mode 100644 index 81ae17ac647e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/DeletedAppRestoreRequestProperties.java +++ /dev/null @@ -1,138 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** DeletedAppRestoreRequest resource specific properties. */ -@Fluent -public final class DeletedAppRestoreRequestProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DeletedAppRestoreRequestProperties.class); - - /* - * ARM resource ID of the deleted app. Example: - * /subscriptions/{subId}/providers/Microsoft.Web/deletedSites/{deletedSiteId} - */ - @JsonProperty(value = "deletedSiteId") - private String deletedSiteId; - - /* - * If true, deleted site configuration, in addition to content, will be - * restored. - */ - @JsonProperty(value = "recoverConfiguration") - private Boolean recoverConfiguration; - - /* - * Point in time to restore the deleted app from, formatted as a DateTime - * string. - * If unspecified, default value is the time that the app was deleted. - */ - @JsonProperty(value = "snapshotTime") - private String snapshotTime; - - /* - * If true, the snapshot is retrieved from DRSecondary endpoint. - */ - @JsonProperty(value = "useDRSecondary") - private Boolean useDRSecondary; - - /** - * Get the deletedSiteId property: ARM resource ID of the deleted app. Example: - * /subscriptions/{subId}/providers/Microsoft.Web/deletedSites/{deletedSiteId}. - * - * @return the deletedSiteId value. - */ - public String deletedSiteId() { - return this.deletedSiteId; - } - - /** - * Set the deletedSiteId property: ARM resource ID of the deleted app. Example: - * /subscriptions/{subId}/providers/Microsoft.Web/deletedSites/{deletedSiteId}. - * - * @param deletedSiteId the deletedSiteId value to set. - * @return the DeletedAppRestoreRequestProperties object itself. - */ - public DeletedAppRestoreRequestProperties withDeletedSiteId(String deletedSiteId) { - this.deletedSiteId = deletedSiteId; - return this; - } - - /** - * Get the recoverConfiguration property: If true, deleted site configuration, in addition to content, will be - * restored. - * - * @return the recoverConfiguration value. - */ - public Boolean recoverConfiguration() { - return this.recoverConfiguration; - } - - /** - * Set the recoverConfiguration property: If true, deleted site configuration, in addition to content, will be - * restored. - * - * @param recoverConfiguration the recoverConfiguration value to set. - * @return the DeletedAppRestoreRequestProperties object itself. - */ - public DeletedAppRestoreRequestProperties withRecoverConfiguration(Boolean recoverConfiguration) { - this.recoverConfiguration = recoverConfiguration; - return this; - } - - /** - * Get the snapshotTime property: Point in time to restore the deleted app from, formatted as a DateTime string. If - * unspecified, default value is the time that the app was deleted. - * - * @return the snapshotTime value. - */ - public String snapshotTime() { - return this.snapshotTime; - } - - /** - * Set the snapshotTime property: Point in time to restore the deleted app from, formatted as a DateTime string. If - * unspecified, default value is the time that the app was deleted. - * - * @param snapshotTime the snapshotTime value to set. - * @return the DeletedAppRestoreRequestProperties object itself. - */ - public DeletedAppRestoreRequestProperties withSnapshotTime(String snapshotTime) { - this.snapshotTime = snapshotTime; - return this; - } - - /** - * Get the useDRSecondary property: If true, the snapshot is retrieved from DRSecondary endpoint. - * - * @return the useDRSecondary value. - */ - public Boolean useDRSecondary() { - return this.useDRSecondary; - } - - /** - * Set the useDRSecondary property: If true, the snapshot is retrieved from DRSecondary endpoint. - * - * @param useDRSecondary the useDRSecondary value to set. - * @return the DeletedAppRestoreRequestProperties object itself. - */ - public DeletedAppRestoreRequestProperties withUseDRSecondary(Boolean useDRSecondary) { - this.useDRSecondary = useDRSecondary; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/DeletedSiteInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/DeletedSiteInner.java deleted file mode 100644 index 2ffdef407f99..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/DeletedSiteInner.java +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.ProxyOnlyResource; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** A deleted app. */ -@Fluent -public final class DeletedSiteInner extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DeletedSiteInner.class); - - /* - * DeletedSite resource specific properties - */ - @JsonProperty(value = "properties") - private DeletedSiteProperties innerProperties; - - /** - * Get the innerProperties property: DeletedSite resource specific properties. - * - * @return the innerProperties value. - */ - private DeletedSiteProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public DeletedSiteInner withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the deletedSiteId property: Numeric id for the deleted site. - * - * @return the deletedSiteId value. - */ - public Integer deletedSiteId() { - return this.innerProperties() == null ? null : this.innerProperties().deletedSiteId(); - } - - /** - * Get the deletedTimestamp property: Time in UTC when the app was deleted. - * - * @return the deletedTimestamp value. - */ - public String deletedTimestamp() { - return this.innerProperties() == null ? null : this.innerProperties().deletedTimestamp(); - } - - /** - * Get the subscription property: Subscription containing the deleted site. - * - * @return the subscription value. - */ - public String subscription() { - return this.innerProperties() == null ? null : this.innerProperties().subscription(); - } - - /** - * Get the resourceGroup property: ResourceGroup that contained the deleted site. - * - * @return the resourceGroup value. - */ - public String resourceGroup() { - return this.innerProperties() == null ? null : this.innerProperties().resourceGroup(); - } - - /** - * Get the deletedSiteName property: Name of the deleted site. - * - * @return the deletedSiteName value. - */ - public String deletedSiteName() { - return this.innerProperties() == null ? null : this.innerProperties().deletedSiteName(); - } - - /** - * Get the slot property: Slot of the deleted site. - * - * @return the slot value. - */ - public String slot() { - return this.innerProperties() == null ? null : this.innerProperties().slot(); - } - - /** - * Get the kind property: Kind of site that was deleted. - * - * @return the kind value. - */ - public String kindPropertiesKind() { - return this.innerProperties() == null ? null : this.innerProperties().kind(); - } - - /** - * Get the geoRegionName property: Geo Region of the deleted site. - * - * @return the geoRegionName value. - */ - public String geoRegionName() { - return this.innerProperties() == null ? null : this.innerProperties().geoRegionName(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/DeletedSiteProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/DeletedSiteProperties.java deleted file mode 100644 index dbcd67cc905e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/DeletedSiteProperties.java +++ /dev/null @@ -1,144 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** DeletedSite resource specific properties. */ -@Immutable -public final class DeletedSiteProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DeletedSiteProperties.class); - - /* - * Numeric id for the deleted site - */ - @JsonProperty(value = "deletedSiteId", access = JsonProperty.Access.WRITE_ONLY) - private Integer deletedSiteId; - - /* - * Time in UTC when the app was deleted. - */ - @JsonProperty(value = "deletedTimestamp", access = JsonProperty.Access.WRITE_ONLY) - private String deletedTimestamp; - - /* - * Subscription containing the deleted site - */ - @JsonProperty(value = "subscription", access = JsonProperty.Access.WRITE_ONLY) - private String subscription; - - /* - * ResourceGroup that contained the deleted site - */ - @JsonProperty(value = "resourceGroup", access = JsonProperty.Access.WRITE_ONLY) - private String resourceGroup; - - /* - * Name of the deleted site - */ - @JsonProperty(value = "deletedSiteName", access = JsonProperty.Access.WRITE_ONLY) - private String deletedSiteName; - - /* - * Slot of the deleted site - */ - @JsonProperty(value = "slot", access = JsonProperty.Access.WRITE_ONLY) - private String slot; - - /* - * Kind of site that was deleted - */ - @JsonProperty(value = "kind", access = JsonProperty.Access.WRITE_ONLY) - private String kind; - - /* - * Geo Region of the deleted site - */ - @JsonProperty(value = "geoRegionName", access = JsonProperty.Access.WRITE_ONLY) - private String geoRegionName; - - /** - * Get the deletedSiteId property: Numeric id for the deleted site. - * - * @return the deletedSiteId value. - */ - public Integer deletedSiteId() { - return this.deletedSiteId; - } - - /** - * Get the deletedTimestamp property: Time in UTC when the app was deleted. - * - * @return the deletedTimestamp value. - */ - public String deletedTimestamp() { - return this.deletedTimestamp; - } - - /** - * Get the subscription property: Subscription containing the deleted site. - * - * @return the subscription value. - */ - public String subscription() { - return this.subscription; - } - - /** - * Get the resourceGroup property: ResourceGroup that contained the deleted site. - * - * @return the resourceGroup value. - */ - public String resourceGroup() { - return this.resourceGroup; - } - - /** - * Get the deletedSiteName property: Name of the deleted site. - * - * @return the deletedSiteName value. - */ - public String deletedSiteName() { - return this.deletedSiteName; - } - - /** - * Get the slot property: Slot of the deleted site. - * - * @return the slot value. - */ - public String slot() { - return this.slot; - } - - /** - * Get the kind property: Kind of site that was deleted. - * - * @return the kind value. - */ - public String kind() { - return this.kind; - } - - /** - * Get the geoRegionName property: Geo Region of the deleted site. - * - * @return the geoRegionName value. - */ - public String geoRegionName() { - return this.geoRegionName; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/DeploymentInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/DeploymentInner.java deleted file mode 100644 index ed30e87ab00c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/DeploymentInner.java +++ /dev/null @@ -1,260 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.ProxyOnlyResource; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** User credentials used for publishing activity. */ -@Fluent -public final class DeploymentInner extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DeploymentInner.class); - - /* - * Deployment resource specific properties - */ - @JsonProperty(value = "properties") - private DeploymentProperties innerProperties; - - /** - * Get the innerProperties property: Deployment resource specific properties. - * - * @return the innerProperties value. - */ - private DeploymentProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public DeploymentInner withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the status property: Deployment status. - * - * @return the status value. - */ - public Integer status() { - return this.innerProperties() == null ? null : this.innerProperties().status(); - } - - /** - * Set the status property: Deployment status. - * - * @param status the status value to set. - * @return the DeploymentInner object itself. - */ - public DeploymentInner withStatus(Integer status) { - if (this.innerProperties() == null) { - this.innerProperties = new DeploymentProperties(); - } - this.innerProperties().withStatus(status); - return this; - } - - /** - * Get the message property: Details about deployment status. - * - * @return the message value. - */ - public String message() { - return this.innerProperties() == null ? null : this.innerProperties().message(); - } - - /** - * Set the message property: Details about deployment status. - * - * @param message the message value to set. - * @return the DeploymentInner object itself. - */ - public DeploymentInner withMessage(String message) { - if (this.innerProperties() == null) { - this.innerProperties = new DeploymentProperties(); - } - this.innerProperties().withMessage(message); - return this; - } - - /** - * Get the author property: Who authored the deployment. - * - * @return the author value. - */ - public String author() { - return this.innerProperties() == null ? null : this.innerProperties().author(); - } - - /** - * Set the author property: Who authored the deployment. - * - * @param author the author value to set. - * @return the DeploymentInner object itself. - */ - public DeploymentInner withAuthor(String author) { - if (this.innerProperties() == null) { - this.innerProperties = new DeploymentProperties(); - } - this.innerProperties().withAuthor(author); - return this; - } - - /** - * Get the deployer property: Who performed the deployment. - * - * @return the deployer value. - */ - public String deployer() { - return this.innerProperties() == null ? null : this.innerProperties().deployer(); - } - - /** - * Set the deployer property: Who performed the deployment. - * - * @param deployer the deployer value to set. - * @return the DeploymentInner object itself. - */ - public DeploymentInner withDeployer(String deployer) { - if (this.innerProperties() == null) { - this.innerProperties = new DeploymentProperties(); - } - this.innerProperties().withDeployer(deployer); - return this; - } - - /** - * Get the authorEmail property: Author email. - * - * @return the authorEmail value. - */ - public String authorEmail() { - return this.innerProperties() == null ? null : this.innerProperties().authorEmail(); - } - - /** - * Set the authorEmail property: Author email. - * - * @param authorEmail the authorEmail value to set. - * @return the DeploymentInner object itself. - */ - public DeploymentInner withAuthorEmail(String authorEmail) { - if (this.innerProperties() == null) { - this.innerProperties = new DeploymentProperties(); - } - this.innerProperties().withAuthorEmail(authorEmail); - return this; - } - - /** - * Get the startTime property: Start time. - * - * @return the startTime value. - */ - public OffsetDateTime startTime() { - return this.innerProperties() == null ? null : this.innerProperties().startTime(); - } - - /** - * Set the startTime property: Start time. - * - * @param startTime the startTime value to set. - * @return the DeploymentInner object itself. - */ - public DeploymentInner withStartTime(OffsetDateTime startTime) { - if (this.innerProperties() == null) { - this.innerProperties = new DeploymentProperties(); - } - this.innerProperties().withStartTime(startTime); - return this; - } - - /** - * Get the endTime property: End time. - * - * @return the endTime value. - */ - public OffsetDateTime endTime() { - return this.innerProperties() == null ? null : this.innerProperties().endTime(); - } - - /** - * Set the endTime property: End time. - * - * @param endTime the endTime value to set. - * @return the DeploymentInner object itself. - */ - public DeploymentInner withEndTime(OffsetDateTime endTime) { - if (this.innerProperties() == null) { - this.innerProperties = new DeploymentProperties(); - } - this.innerProperties().withEndTime(endTime); - return this; - } - - /** - * Get the active property: True if deployment is currently active, false if completed and null if not started. - * - * @return the active value. - */ - public Boolean active() { - return this.innerProperties() == null ? null : this.innerProperties().active(); - } - - /** - * Set the active property: True if deployment is currently active, false if completed and null if not started. - * - * @param active the active value to set. - * @return the DeploymentInner object itself. - */ - public DeploymentInner withActive(Boolean active) { - if (this.innerProperties() == null) { - this.innerProperties = new DeploymentProperties(); - } - this.innerProperties().withActive(active); - return this; - } - - /** - * Get the details property: Details on deployment. - * - * @return the details value. - */ - public String details() { - return this.innerProperties() == null ? null : this.innerProperties().details(); - } - - /** - * Set the details property: Details on deployment. - * - * @param details the details value to set. - * @return the DeploymentInner object itself. - */ - public DeploymentInner withDetails(String details) { - if (this.innerProperties() == null) { - this.innerProperties = new DeploymentProperties(); - } - this.innerProperties().withDetails(details); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/DeploymentLocationsInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/DeploymentLocationsInner.java deleted file mode 100644 index 149e619b3ac5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/DeploymentLocationsInner.java +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.HostingEnvironmentDeploymentInfo; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** List of available locations (regions or App Service Environments) for deployment of App Service resources. */ -@Fluent -public final class DeploymentLocationsInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DeploymentLocationsInner.class); - - /* - * Available regions. - */ - @JsonProperty(value = "locations") - private List locations; - - /* - * Available App Service Environments with full descriptions of the - * environments. - */ - @JsonProperty(value = "hostingEnvironments") - private List hostingEnvironments; - - /* - * Available App Service Environments with basic information. - */ - @JsonProperty(value = "hostingEnvironmentDeploymentInfos") - private List hostingEnvironmentDeploymentInfos; - - /** - * Get the locations property: Available regions. - * - * @return the locations value. - */ - public List locations() { - return this.locations; - } - - /** - * Set the locations property: Available regions. - * - * @param locations the locations value to set. - * @return the DeploymentLocationsInner object itself. - */ - public DeploymentLocationsInner withLocations(List locations) { - this.locations = locations; - return this; - } - - /** - * Get the hostingEnvironments property: Available App Service Environments with full descriptions of the - * environments. - * - * @return the hostingEnvironments value. - */ - public List hostingEnvironments() { - return this.hostingEnvironments; - } - - /** - * Set the hostingEnvironments property: Available App Service Environments with full descriptions of the - * environments. - * - * @param hostingEnvironments the hostingEnvironments value to set. - * @return the DeploymentLocationsInner object itself. - */ - public DeploymentLocationsInner withHostingEnvironments(List hostingEnvironments) { - this.hostingEnvironments = hostingEnvironments; - return this; - } - - /** - * Get the hostingEnvironmentDeploymentInfos property: Available App Service Environments with basic information. - * - * @return the hostingEnvironmentDeploymentInfos value. - */ - public List hostingEnvironmentDeploymentInfos() { - return this.hostingEnvironmentDeploymentInfos; - } - - /** - * Set the hostingEnvironmentDeploymentInfos property: Available App Service Environments with basic information. - * - * @param hostingEnvironmentDeploymentInfos the hostingEnvironmentDeploymentInfos value to set. - * @return the DeploymentLocationsInner object itself. - */ - public DeploymentLocationsInner withHostingEnvironmentDeploymentInfos( - List hostingEnvironmentDeploymentInfos) { - this.hostingEnvironmentDeploymentInfos = hostingEnvironmentDeploymentInfos; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (locations() != null) { - locations().forEach(e -> e.validate()); - } - if (hostingEnvironments() != null) { - hostingEnvironments().forEach(e -> e.validate()); - } - if (hostingEnvironmentDeploymentInfos() != null) { - hostingEnvironmentDeploymentInfos().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/DeploymentProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/DeploymentProperties.java deleted file mode 100644 index 5974ad62d746..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/DeploymentProperties.java +++ /dev/null @@ -1,260 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** Deployment resource specific properties. */ -@Fluent -public final class DeploymentProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DeploymentProperties.class); - - /* - * Deployment status. - */ - @JsonProperty(value = "status") - private Integer status; - - /* - * Details about deployment status. - */ - @JsonProperty(value = "message") - private String message; - - /* - * Who authored the deployment. - */ - @JsonProperty(value = "author") - private String author; - - /* - * Who performed the deployment. - */ - @JsonProperty(value = "deployer") - private String deployer; - - /* - * Author email. - */ - @JsonProperty(value = "author_email") - private String authorEmail; - - /* - * Start time. - */ - @JsonProperty(value = "start_time") - private OffsetDateTime startTime; - - /* - * End time. - */ - @JsonProperty(value = "end_time") - private OffsetDateTime endTime; - - /* - * True if deployment is currently active, false if completed and null if - * not started. - */ - @JsonProperty(value = "active") - private Boolean active; - - /* - * Details on deployment. - */ - @JsonProperty(value = "details") - private String details; - - /** - * Get the status property: Deployment status. - * - * @return the status value. - */ - public Integer status() { - return this.status; - } - - /** - * Set the status property: Deployment status. - * - * @param status the status value to set. - * @return the DeploymentProperties object itself. - */ - public DeploymentProperties withStatus(Integer status) { - this.status = status; - return this; - } - - /** - * Get the message property: Details about deployment status. - * - * @return the message value. - */ - public String message() { - return this.message; - } - - /** - * Set the message property: Details about deployment status. - * - * @param message the message value to set. - * @return the DeploymentProperties object itself. - */ - public DeploymentProperties withMessage(String message) { - this.message = message; - return this; - } - - /** - * Get the author property: Who authored the deployment. - * - * @return the author value. - */ - public String author() { - return this.author; - } - - /** - * Set the author property: Who authored the deployment. - * - * @param author the author value to set. - * @return the DeploymentProperties object itself. - */ - public DeploymentProperties withAuthor(String author) { - this.author = author; - return this; - } - - /** - * Get the deployer property: Who performed the deployment. - * - * @return the deployer value. - */ - public String deployer() { - return this.deployer; - } - - /** - * Set the deployer property: Who performed the deployment. - * - * @param deployer the deployer value to set. - * @return the DeploymentProperties object itself. - */ - public DeploymentProperties withDeployer(String deployer) { - this.deployer = deployer; - return this; - } - - /** - * Get the authorEmail property: Author email. - * - * @return the authorEmail value. - */ - public String authorEmail() { - return this.authorEmail; - } - - /** - * Set the authorEmail property: Author email. - * - * @param authorEmail the authorEmail value to set. - * @return the DeploymentProperties object itself. - */ - public DeploymentProperties withAuthorEmail(String authorEmail) { - this.authorEmail = authorEmail; - return this; - } - - /** - * Get the startTime property: Start time. - * - * @return the startTime value. - */ - public OffsetDateTime startTime() { - return this.startTime; - } - - /** - * Set the startTime property: Start time. - * - * @param startTime the startTime value to set. - * @return the DeploymentProperties object itself. - */ - public DeploymentProperties withStartTime(OffsetDateTime startTime) { - this.startTime = startTime; - return this; - } - - /** - * Get the endTime property: End time. - * - * @return the endTime value. - */ - public OffsetDateTime endTime() { - return this.endTime; - } - - /** - * Set the endTime property: End time. - * - * @param endTime the endTime value to set. - * @return the DeploymentProperties object itself. - */ - public DeploymentProperties withEndTime(OffsetDateTime endTime) { - this.endTime = endTime; - return this; - } - - /** - * Get the active property: True if deployment is currently active, false if completed and null if not started. - * - * @return the active value. - */ - public Boolean active() { - return this.active; - } - - /** - * Set the active property: True if deployment is currently active, false if completed and null if not started. - * - * @param active the active value to set. - * @return the DeploymentProperties object itself. - */ - public DeploymentProperties withActive(Boolean active) { - this.active = active; - return this; - } - - /** - * Get the details property: Details on deployment. - * - * @return the details value. - */ - public String details() { - return this.details; - } - - /** - * Set the details property: Details on deployment. - * - * @param details the details value to set. - * @return the DeploymentProperties object itself. - */ - public DeploymentProperties withDetails(String details) { - this.details = details; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/DetectorDefinitionInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/DetectorDefinitionInner.java deleted file mode 100644 index 22ecd8752430..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/DetectorDefinitionInner.java +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.ProxyOnlyResource; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Class representing detector definition. */ -@Fluent -public final class DetectorDefinitionInner extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DetectorDefinitionInner.class); - - /* - * DetectorDefinition resource specific properties - */ - @JsonProperty(value = "properties") - private DetectorDefinitionProperties innerProperties; - - /** - * Get the innerProperties property: DetectorDefinition resource specific properties. - * - * @return the innerProperties value. - */ - private DetectorDefinitionProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public DetectorDefinitionInner withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the displayName property: Display name of the detector. - * - * @return the displayName value. - */ - public String displayName() { - return this.innerProperties() == null ? null : this.innerProperties().displayName(); - } - - /** - * Get the description property: Description of the detector. - * - * @return the description value. - */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); - } - - /** - * Get the rank property: Detector Rank. - * - * @return the rank value. - */ - public Double rank() { - return this.innerProperties() == null ? null : this.innerProperties().rank(); - } - - /** - * Get the isEnabled property: Flag representing whether detector is enabled or not. - * - * @return the isEnabled value. - */ - public Boolean isEnabled() { - return this.innerProperties() == null ? null : this.innerProperties().isEnabled(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/DetectorDefinitionProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/DetectorDefinitionProperties.java deleted file mode 100644 index 36207aded390..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/DetectorDefinitionProperties.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** DetectorDefinition resource specific properties. */ -@Immutable -public final class DetectorDefinitionProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DetectorDefinitionProperties.class); - - /* - * Display name of the detector - */ - @JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY) - private String displayName; - - /* - * Description of the detector - */ - @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) - private String description; - - /* - * Detector Rank - */ - @JsonProperty(value = "rank", access = JsonProperty.Access.WRITE_ONLY) - private Double rank; - - /* - * Flag representing whether detector is enabled or not. - */ - @JsonProperty(value = "isEnabled", access = JsonProperty.Access.WRITE_ONLY) - private Boolean isEnabled; - - /** - * Get the displayName property: Display name of the detector. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Get the description property: Description of the detector. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Get the rank property: Detector Rank. - * - * @return the rank value. - */ - public Double rank() { - return this.rank; - } - - /** - * Get the isEnabled property: Flag representing whether detector is enabled or not. - * - * @return the isEnabled value. - */ - public Boolean isEnabled() { - return this.isEnabled; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/DetectorResponseInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/DetectorResponseInner.java deleted file mode 100644 index 4b50538c26a3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/DetectorResponseInner.java +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.DetectorInfo; -import com.azure.resourcemanager.appservice.models.DiagnosticData; -import com.azure.resourcemanager.appservice.models.ProxyOnlyResource; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Class representing Response from Detector. */ -@Fluent -public final class DetectorResponseInner extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DetectorResponseInner.class); - - /* - * DetectorResponse resource specific properties - */ - @JsonProperty(value = "properties") - private DetectorResponseProperties innerProperties; - - /** - * Get the innerProperties property: DetectorResponse resource specific properties. - * - * @return the innerProperties value. - */ - private DetectorResponseProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public DetectorResponseInner withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the metadata property: metadata for the detector. - * - * @return the metadata value. - */ - public DetectorInfo metadata() { - return this.innerProperties() == null ? null : this.innerProperties().metadata(); - } - - /** - * Set the metadata property: metadata for the detector. - * - * @param metadata the metadata value to set. - * @return the DetectorResponseInner object itself. - */ - public DetectorResponseInner withMetadata(DetectorInfo metadata) { - if (this.innerProperties() == null) { - this.innerProperties = new DetectorResponseProperties(); - } - this.innerProperties().withMetadata(metadata); - return this; - } - - /** - * Get the dataset property: Data Set. - * - * @return the dataset value. - */ - public List dataset() { - return this.innerProperties() == null ? null : this.innerProperties().dataset(); - } - - /** - * Set the dataset property: Data Set. - * - * @param dataset the dataset value to set. - * @return the DetectorResponseInner object itself. - */ - public DetectorResponseInner withDataset(List dataset) { - if (this.innerProperties() == null) { - this.innerProperties = new DetectorResponseProperties(); - } - this.innerProperties().withDataset(dataset); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/DetectorResponseProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/DetectorResponseProperties.java deleted file mode 100644 index b322e7521d84..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/DetectorResponseProperties.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.DetectorInfo; -import com.azure.resourcemanager.appservice.models.DiagnosticData; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** DetectorResponse resource specific properties. */ -@Fluent -public final class DetectorResponseProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DetectorResponseProperties.class); - - /* - * metadata for the detector - */ - @JsonProperty(value = "metadata") - private DetectorInfo metadata; - - /* - * Data Set - */ - @JsonProperty(value = "dataset") - private List dataset; - - /** - * Get the metadata property: metadata for the detector. - * - * @return the metadata value. - */ - public DetectorInfo metadata() { - return this.metadata; - } - - /** - * Set the metadata property: metadata for the detector. - * - * @param metadata the metadata value to set. - * @return the DetectorResponseProperties object itself. - */ - public DetectorResponseProperties withMetadata(DetectorInfo metadata) { - this.metadata = metadata; - return this; - } - - /** - * Get the dataset property: Data Set. - * - * @return the dataset value. - */ - public List dataset() { - return this.dataset; - } - - /** - * Set the dataset property: Data Set. - * - * @param dataset the dataset value to set. - * @return the DetectorResponseProperties object itself. - */ - public DetectorResponseProperties withDataset(List dataset) { - this.dataset = dataset; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (metadata() != null) { - metadata().validate(); - } - if (dataset() != null) { - dataset().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/DiagnosticAnalysisInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/DiagnosticAnalysisInner.java deleted file mode 100644 index 14b35a5472aa..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/DiagnosticAnalysisInner.java +++ /dev/null @@ -1,170 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.AbnormalTimePeriod; -import com.azure.resourcemanager.appservice.models.ProxyOnlyResource; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; - -/** Class representing a diagnostic analysis done on an application. */ -@Fluent -public final class DiagnosticAnalysisInner extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DiagnosticAnalysisInner.class); - - /* - * DiagnosticAnalysis resource specific properties - */ - @JsonProperty(value = "properties") - private DiagnosticAnalysisProperties innerProperties; - - /** - * Get the innerProperties property: DiagnosticAnalysis resource specific properties. - * - * @return the innerProperties value. - */ - private DiagnosticAnalysisProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public DiagnosticAnalysisInner withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the startTime property: Start time of the period. - * - * @return the startTime value. - */ - public OffsetDateTime startTime() { - return this.innerProperties() == null ? null : this.innerProperties().startTime(); - } - - /** - * Set the startTime property: Start time of the period. - * - * @param startTime the startTime value to set. - * @return the DiagnosticAnalysisInner object itself. - */ - public DiagnosticAnalysisInner withStartTime(OffsetDateTime startTime) { - if (this.innerProperties() == null) { - this.innerProperties = new DiagnosticAnalysisProperties(); - } - this.innerProperties().withStartTime(startTime); - return this; - } - - /** - * Get the endTime property: End time of the period. - * - * @return the endTime value. - */ - public OffsetDateTime endTime() { - return this.innerProperties() == null ? null : this.innerProperties().endTime(); - } - - /** - * Set the endTime property: End time of the period. - * - * @param endTime the endTime value to set. - * @return the DiagnosticAnalysisInner object itself. - */ - public DiagnosticAnalysisInner withEndTime(OffsetDateTime endTime) { - if (this.innerProperties() == null) { - this.innerProperties = new DiagnosticAnalysisProperties(); - } - this.innerProperties().withEndTime(endTime); - return this; - } - - /** - * Get the abnormalTimePeriods property: List of time periods. - * - * @return the abnormalTimePeriods value. - */ - public List abnormalTimePeriods() { - return this.innerProperties() == null ? null : this.innerProperties().abnormalTimePeriods(); - } - - /** - * Set the abnormalTimePeriods property: List of time periods. - * - * @param abnormalTimePeriods the abnormalTimePeriods value to set. - * @return the DiagnosticAnalysisInner object itself. - */ - public DiagnosticAnalysisInner withAbnormalTimePeriods(List abnormalTimePeriods) { - if (this.innerProperties() == null) { - this.innerProperties = new DiagnosticAnalysisProperties(); - } - this.innerProperties().withAbnormalTimePeriods(abnormalTimePeriods); - return this; - } - - /** - * Get the payload property: Data by each detector. - * - * @return the payload value. - */ - public List payload() { - return this.innerProperties() == null ? null : this.innerProperties().payload(); - } - - /** - * Set the payload property: Data by each detector. - * - * @param payload the payload value to set. - * @return the DiagnosticAnalysisInner object itself. - */ - public DiagnosticAnalysisInner withPayload(List payload) { - if (this.innerProperties() == null) { - this.innerProperties = new DiagnosticAnalysisProperties(); - } - this.innerProperties().withPayload(payload); - return this; - } - - /** - * Get the nonCorrelatedDetectors property: Data by each detector for detectors that did not corelate. - * - * @return the nonCorrelatedDetectors value. - */ - public List nonCorrelatedDetectors() { - return this.innerProperties() == null ? null : this.innerProperties().nonCorrelatedDetectors(); - } - - /** - * Set the nonCorrelatedDetectors property: Data by each detector for detectors that did not corelate. - * - * @param nonCorrelatedDetectors the nonCorrelatedDetectors value to set. - * @return the DiagnosticAnalysisInner object itself. - */ - public DiagnosticAnalysisInner withNonCorrelatedDetectors(List nonCorrelatedDetectors) { - if (this.innerProperties() == null) { - this.innerProperties = new DiagnosticAnalysisProperties(); - } - this.innerProperties().withNonCorrelatedDetectors(nonCorrelatedDetectors); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/DiagnosticAnalysisProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/DiagnosticAnalysisProperties.java deleted file mode 100644 index fada20819066..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/DiagnosticAnalysisProperties.java +++ /dev/null @@ -1,167 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.AbnormalTimePeriod; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; - -/** DiagnosticAnalysis resource specific properties. */ -@Fluent -public final class DiagnosticAnalysisProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DiagnosticAnalysisProperties.class); - - /* - * Start time of the period - */ - @JsonProperty(value = "startTime") - private OffsetDateTime startTime; - - /* - * End time of the period - */ - @JsonProperty(value = "endTime") - private OffsetDateTime endTime; - - /* - * List of time periods. - */ - @JsonProperty(value = "abnormalTimePeriods") - private List abnormalTimePeriods; - - /* - * Data by each detector - */ - @JsonProperty(value = "payload") - private List payload; - - /* - * Data by each detector for detectors that did not corelate - */ - @JsonProperty(value = "nonCorrelatedDetectors") - private List nonCorrelatedDetectors; - - /** - * Get the startTime property: Start time of the period. - * - * @return the startTime value. - */ - public OffsetDateTime startTime() { - return this.startTime; - } - - /** - * Set the startTime property: Start time of the period. - * - * @param startTime the startTime value to set. - * @return the DiagnosticAnalysisProperties object itself. - */ - public DiagnosticAnalysisProperties withStartTime(OffsetDateTime startTime) { - this.startTime = startTime; - return this; - } - - /** - * Get the endTime property: End time of the period. - * - * @return the endTime value. - */ - public OffsetDateTime endTime() { - return this.endTime; - } - - /** - * Set the endTime property: End time of the period. - * - * @param endTime the endTime value to set. - * @return the DiagnosticAnalysisProperties object itself. - */ - public DiagnosticAnalysisProperties withEndTime(OffsetDateTime endTime) { - this.endTime = endTime; - return this; - } - - /** - * Get the abnormalTimePeriods property: List of time periods. - * - * @return the abnormalTimePeriods value. - */ - public List abnormalTimePeriods() { - return this.abnormalTimePeriods; - } - - /** - * Set the abnormalTimePeriods property: List of time periods. - * - * @param abnormalTimePeriods the abnormalTimePeriods value to set. - * @return the DiagnosticAnalysisProperties object itself. - */ - public DiagnosticAnalysisProperties withAbnormalTimePeriods(List abnormalTimePeriods) { - this.abnormalTimePeriods = abnormalTimePeriods; - return this; - } - - /** - * Get the payload property: Data by each detector. - * - * @return the payload value. - */ - public List payload() { - return this.payload; - } - - /** - * Set the payload property: Data by each detector. - * - * @param payload the payload value to set. - * @return the DiagnosticAnalysisProperties object itself. - */ - public DiagnosticAnalysisProperties withPayload(List payload) { - this.payload = payload; - return this; - } - - /** - * Get the nonCorrelatedDetectors property: Data by each detector for detectors that did not corelate. - * - * @return the nonCorrelatedDetectors value. - */ - public List nonCorrelatedDetectors() { - return this.nonCorrelatedDetectors; - } - - /** - * Set the nonCorrelatedDetectors property: Data by each detector for detectors that did not corelate. - * - * @param nonCorrelatedDetectors the nonCorrelatedDetectors value to set. - * @return the DiagnosticAnalysisProperties object itself. - */ - public DiagnosticAnalysisProperties withNonCorrelatedDetectors( - List nonCorrelatedDetectors) { - this.nonCorrelatedDetectors = nonCorrelatedDetectors; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (abnormalTimePeriods() != null) { - abnormalTimePeriods().forEach(e -> e.validate()); - } - if (payload() != null) { - payload().forEach(e -> e.validate()); - } - if (nonCorrelatedDetectors() != null) { - nonCorrelatedDetectors().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/DiagnosticCategoryInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/DiagnosticCategoryInner.java deleted file mode 100644 index 32ca78b67d66..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/DiagnosticCategoryInner.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.ProxyOnlyResource; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Class representing detector definition. */ -@Fluent -public final class DiagnosticCategoryInner extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DiagnosticCategoryInner.class); - - /* - * DiagnosticCategory resource specific properties - */ - @JsonProperty(value = "properties") - private DiagnosticCategoryProperties innerProperties; - - /** - * Get the innerProperties property: DiagnosticCategory resource specific properties. - * - * @return the innerProperties value. - */ - private DiagnosticCategoryProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public DiagnosticCategoryInner withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the description property: Description of the diagnostic category. - * - * @return the description value. - */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/DiagnosticCategoryProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/DiagnosticCategoryProperties.java deleted file mode 100644 index 2bf9ddab23dc..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/DiagnosticCategoryProperties.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** DiagnosticCategory resource specific properties. */ -@Immutable -public final class DiagnosticCategoryProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DiagnosticCategoryProperties.class); - - /* - * Description of the diagnostic category - */ - @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) - private String description; - - /** - * Get the description property: Description of the diagnostic category. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/DiagnosticDetectorResponseInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/DiagnosticDetectorResponseInner.java deleted file mode 100644 index 9269e82fef36..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/DiagnosticDetectorResponseInner.java +++ /dev/null @@ -1,243 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.DetectorAbnormalTimePeriod; -import com.azure.resourcemanager.appservice.models.DiagnosticMetricSet; -import com.azure.resourcemanager.appservice.models.NameValuePair; -import com.azure.resourcemanager.appservice.models.ProxyOnlyResource; -import com.azure.resourcemanager.appservice.models.ResponseMetadata; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; - -/** Class representing Response from Diagnostic Detectors. */ -@Fluent -public final class DiagnosticDetectorResponseInner extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DiagnosticDetectorResponseInner.class); - - /* - * DiagnosticDetectorResponse resource specific properties - */ - @JsonProperty(value = "properties") - private DiagnosticDetectorResponsePropertiesInner innerProperties; - - /** - * Get the innerProperties property: DiagnosticDetectorResponse resource specific properties. - * - * @return the innerProperties value. - */ - private DiagnosticDetectorResponsePropertiesInner innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public DiagnosticDetectorResponseInner withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the startTime property: Start time of the period. - * - * @return the startTime value. - */ - public OffsetDateTime startTime() { - return this.innerProperties() == null ? null : this.innerProperties().startTime(); - } - - /** - * Set the startTime property: Start time of the period. - * - * @param startTime the startTime value to set. - * @return the DiagnosticDetectorResponseInner object itself. - */ - public DiagnosticDetectorResponseInner withStartTime(OffsetDateTime startTime) { - if (this.innerProperties() == null) { - this.innerProperties = new DiagnosticDetectorResponsePropertiesInner(); - } - this.innerProperties().withStartTime(startTime); - return this; - } - - /** - * Get the endTime property: End time of the period. - * - * @return the endTime value. - */ - public OffsetDateTime endTime() { - return this.innerProperties() == null ? null : this.innerProperties().endTime(); - } - - /** - * Set the endTime property: End time of the period. - * - * @param endTime the endTime value to set. - * @return the DiagnosticDetectorResponseInner object itself. - */ - public DiagnosticDetectorResponseInner withEndTime(OffsetDateTime endTime) { - if (this.innerProperties() == null) { - this.innerProperties = new DiagnosticDetectorResponsePropertiesInner(); - } - this.innerProperties().withEndTime(endTime); - return this; - } - - /** - * Get the issueDetected property: Flag representing Issue was detected. - * - * @return the issueDetected value. - */ - public Boolean issueDetected() { - return this.innerProperties() == null ? null : this.innerProperties().issueDetected(); - } - - /** - * Set the issueDetected property: Flag representing Issue was detected. - * - * @param issueDetected the issueDetected value to set. - * @return the DiagnosticDetectorResponseInner object itself. - */ - public DiagnosticDetectorResponseInner withIssueDetected(Boolean issueDetected) { - if (this.innerProperties() == null) { - this.innerProperties = new DiagnosticDetectorResponsePropertiesInner(); - } - this.innerProperties().withIssueDetected(issueDetected); - return this; - } - - /** - * Get the detectorDefinition property: Detector's definition. - * - * @return the detectorDefinition value. - */ - public DetectorDefinitionInner detectorDefinition() { - return this.innerProperties() == null ? null : this.innerProperties().detectorDefinition(); - } - - /** - * Set the detectorDefinition property: Detector's definition. - * - * @param detectorDefinition the detectorDefinition value to set. - * @return the DiagnosticDetectorResponseInner object itself. - */ - public DiagnosticDetectorResponseInner withDetectorDefinition(DetectorDefinitionInner detectorDefinition) { - if (this.innerProperties() == null) { - this.innerProperties = new DiagnosticDetectorResponsePropertiesInner(); - } - this.innerProperties().withDetectorDefinition(detectorDefinition); - return this; - } - - /** - * Get the metrics property: Metrics provided by the detector. - * - * @return the metrics value. - */ - public List metrics() { - return this.innerProperties() == null ? null : this.innerProperties().metrics(); - } - - /** - * Set the metrics property: Metrics provided by the detector. - * - * @param metrics the metrics value to set. - * @return the DiagnosticDetectorResponseInner object itself. - */ - public DiagnosticDetectorResponseInner withMetrics(List metrics) { - if (this.innerProperties() == null) { - this.innerProperties = new DiagnosticDetectorResponsePropertiesInner(); - } - this.innerProperties().withMetrics(metrics); - return this; - } - - /** - * Get the abnormalTimePeriods property: List of Correlated events found by the detector. - * - * @return the abnormalTimePeriods value. - */ - public List abnormalTimePeriods() { - return this.innerProperties() == null ? null : this.innerProperties().abnormalTimePeriods(); - } - - /** - * Set the abnormalTimePeriods property: List of Correlated events found by the detector. - * - * @param abnormalTimePeriods the abnormalTimePeriods value to set. - * @return the DiagnosticDetectorResponseInner object itself. - */ - public DiagnosticDetectorResponseInner withAbnormalTimePeriods( - List abnormalTimePeriods) { - if (this.innerProperties() == null) { - this.innerProperties = new DiagnosticDetectorResponsePropertiesInner(); - } - this.innerProperties().withAbnormalTimePeriods(abnormalTimePeriods); - return this; - } - - /** - * Get the data property: Additional Data that detector wants to send. - * - * @return the data value. - */ - public List> data() { - return this.innerProperties() == null ? null : this.innerProperties().data(); - } - - /** - * Set the data property: Additional Data that detector wants to send. - * - * @param data the data value to set. - * @return the DiagnosticDetectorResponseInner object itself. - */ - public DiagnosticDetectorResponseInner withData(List> data) { - if (this.innerProperties() == null) { - this.innerProperties = new DiagnosticDetectorResponsePropertiesInner(); - } - this.innerProperties().withData(data); - return this; - } - - /** - * Get the responseMetadata property: Meta Data. - * - * @return the responseMetadata value. - */ - public ResponseMetadata responseMetadata() { - return this.innerProperties() == null ? null : this.innerProperties().responseMetadata(); - } - - /** - * Set the responseMetadata property: Meta Data. - * - * @param responseMetadata the responseMetadata value to set. - * @return the DiagnosticDetectorResponseInner object itself. - */ - public DiagnosticDetectorResponseInner withResponseMetadata(ResponseMetadata responseMetadata) { - if (this.innerProperties() == null) { - this.innerProperties = new DiagnosticDetectorResponsePropertiesInner(); - } - this.innerProperties().withResponseMetadata(responseMetadata); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/DiagnosticDetectorResponsePropertiesInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/DiagnosticDetectorResponsePropertiesInner.java deleted file mode 100644 index d5a68b966bc4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/DiagnosticDetectorResponsePropertiesInner.java +++ /dev/null @@ -1,255 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.DetectorAbnormalTimePeriod; -import com.azure.resourcemanager.appservice.models.DiagnosticMetricSet; -import com.azure.resourcemanager.appservice.models.NameValuePair; -import com.azure.resourcemanager.appservice.models.ResponseMetadata; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; - -/** DiagnosticDetectorResponse resource specific properties. */ -@Fluent -public final class DiagnosticDetectorResponsePropertiesInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DiagnosticDetectorResponsePropertiesInner.class); - - /* - * Start time of the period - */ - @JsonProperty(value = "startTime") - private OffsetDateTime startTime; - - /* - * End time of the period - */ - @JsonProperty(value = "endTime") - private OffsetDateTime endTime; - - /* - * Flag representing Issue was detected. - */ - @JsonProperty(value = "issueDetected") - private Boolean issueDetected; - - /* - * Detector's definition - */ - @JsonProperty(value = "detectorDefinition") - private DetectorDefinitionInner detectorDefinition; - - /* - * Metrics provided by the detector - */ - @JsonProperty(value = "metrics") - private List metrics; - - /* - * List of Correlated events found by the detector - */ - @JsonProperty(value = "abnormalTimePeriods") - private List abnormalTimePeriods; - - /* - * Additional Data that detector wants to send. - */ - @JsonProperty(value = "data") - private List> data; - - /* - * Meta Data - */ - @JsonProperty(value = "responseMetaData") - private ResponseMetadata responseMetadata; - - /** - * Get the startTime property: Start time of the period. - * - * @return the startTime value. - */ - public OffsetDateTime startTime() { - return this.startTime; - } - - /** - * Set the startTime property: Start time of the period. - * - * @param startTime the startTime value to set. - * @return the DiagnosticDetectorResponsePropertiesInner object itself. - */ - public DiagnosticDetectorResponsePropertiesInner withStartTime(OffsetDateTime startTime) { - this.startTime = startTime; - return this; - } - - /** - * Get the endTime property: End time of the period. - * - * @return the endTime value. - */ - public OffsetDateTime endTime() { - return this.endTime; - } - - /** - * Set the endTime property: End time of the period. - * - * @param endTime the endTime value to set. - * @return the DiagnosticDetectorResponsePropertiesInner object itself. - */ - public DiagnosticDetectorResponsePropertiesInner withEndTime(OffsetDateTime endTime) { - this.endTime = endTime; - return this; - } - - /** - * Get the issueDetected property: Flag representing Issue was detected. - * - * @return the issueDetected value. - */ - public Boolean issueDetected() { - return this.issueDetected; - } - - /** - * Set the issueDetected property: Flag representing Issue was detected. - * - * @param issueDetected the issueDetected value to set. - * @return the DiagnosticDetectorResponsePropertiesInner object itself. - */ - public DiagnosticDetectorResponsePropertiesInner withIssueDetected(Boolean issueDetected) { - this.issueDetected = issueDetected; - return this; - } - - /** - * Get the detectorDefinition property: Detector's definition. - * - * @return the detectorDefinition value. - */ - public DetectorDefinitionInner detectorDefinition() { - return this.detectorDefinition; - } - - /** - * Set the detectorDefinition property: Detector's definition. - * - * @param detectorDefinition the detectorDefinition value to set. - * @return the DiagnosticDetectorResponsePropertiesInner object itself. - */ - public DiagnosticDetectorResponsePropertiesInner withDetectorDefinition( - DetectorDefinitionInner detectorDefinition) { - this.detectorDefinition = detectorDefinition; - return this; - } - - /** - * Get the metrics property: Metrics provided by the detector. - * - * @return the metrics value. - */ - public List metrics() { - return this.metrics; - } - - /** - * Set the metrics property: Metrics provided by the detector. - * - * @param metrics the metrics value to set. - * @return the DiagnosticDetectorResponsePropertiesInner object itself. - */ - public DiagnosticDetectorResponsePropertiesInner withMetrics(List metrics) { - this.metrics = metrics; - return this; - } - - /** - * Get the abnormalTimePeriods property: List of Correlated events found by the detector. - * - * @return the abnormalTimePeriods value. - */ - public List abnormalTimePeriods() { - return this.abnormalTimePeriods; - } - - /** - * Set the abnormalTimePeriods property: List of Correlated events found by the detector. - * - * @param abnormalTimePeriods the abnormalTimePeriods value to set. - * @return the DiagnosticDetectorResponsePropertiesInner object itself. - */ - public DiagnosticDetectorResponsePropertiesInner withAbnormalTimePeriods( - List abnormalTimePeriods) { - this.abnormalTimePeriods = abnormalTimePeriods; - return this; - } - - /** - * Get the data property: Additional Data that detector wants to send. - * - * @return the data value. - */ - public List> data() { - return this.data; - } - - /** - * Set the data property: Additional Data that detector wants to send. - * - * @param data the data value to set. - * @return the DiagnosticDetectorResponsePropertiesInner object itself. - */ - public DiagnosticDetectorResponsePropertiesInner withData(List> data) { - this.data = data; - return this; - } - - /** - * Get the responseMetadata property: Meta Data. - * - * @return the responseMetadata value. - */ - public ResponseMetadata responseMetadata() { - return this.responseMetadata; - } - - /** - * Set the responseMetadata property: Meta Data. - * - * @param responseMetadata the responseMetadata value to set. - * @return the DiagnosticDetectorResponsePropertiesInner object itself. - */ - public DiagnosticDetectorResponsePropertiesInner withResponseMetadata(ResponseMetadata responseMetadata) { - this.responseMetadata = responseMetadata; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (detectorDefinition() != null) { - detectorDefinition().validate(); - } - if (metrics() != null) { - metrics().forEach(e -> e.validate()); - } - if (abnormalTimePeriods() != null) { - abnormalTimePeriods().forEach(e -> e.validate()); - } - if (data() != null) { - data().forEach(e -> e.forEach(e1 -> e1.validate())); - } - if (responseMetadata() != null) { - responseMetadata().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/DomainAvailablilityCheckResultInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/DomainAvailablilityCheckResultInner.java deleted file mode 100644 index b59ccd504dcc..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/DomainAvailablilityCheckResultInner.java +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.DomainType; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Domain availability check result. */ -@Fluent -public final class DomainAvailablilityCheckResultInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DomainAvailablilityCheckResultInner.class); - - /* - * Name of the domain. - */ - @JsonProperty(value = "name") - private String name; - - /* - * true if domain can be purchased using CreateDomain API; - * otherwise, false. - */ - @JsonProperty(value = "available") - private Boolean available; - - /* - * Valid values are Regular domain: Azure will charge the full price of - * domain registration, SoftDeleted: Purchasing this domain will simply - * restore it and this operation will not cost anything. - */ - @JsonProperty(value = "domainType") - private DomainType domainType; - - /** - * Get the name property: Name of the domain. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Name of the domain. - * - * @param name the name value to set. - * @return the DomainAvailablilityCheckResultInner object itself. - */ - public DomainAvailablilityCheckResultInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the available property: <code>true</code> if domain can be purchased using CreateDomain API; - * otherwise, <code>false</code>. - * - * @return the available value. - */ - public Boolean available() { - return this.available; - } - - /** - * Set the available property: <code>true</code> if domain can be purchased using CreateDomain API; - * otherwise, <code>false</code>. - * - * @param available the available value to set. - * @return the DomainAvailablilityCheckResultInner object itself. - */ - public DomainAvailablilityCheckResultInner withAvailable(Boolean available) { - this.available = available; - return this; - } - - /** - * Get the domainType property: Valid values are Regular domain: Azure will charge the full price of domain - * registration, SoftDeleted: Purchasing this domain will simply restore it and this operation will not cost - * anything. - * - * @return the domainType value. - */ - public DomainType domainType() { - return this.domainType; - } - - /** - * Set the domainType property: Valid values are Regular domain: Azure will charge the full price of domain - * registration, SoftDeleted: Purchasing this domain will simply restore it and this operation will not cost - * anything. - * - * @param domainType the domainType value to set. - * @return the DomainAvailablilityCheckResultInner object itself. - */ - public DomainAvailablilityCheckResultInner withDomainType(DomainType domainType) { - this.domainType = domainType; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/DomainControlCenterSsoRequestInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/DomainControlCenterSsoRequestInner.java deleted file mode 100644 index 95d462f303e7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/DomainControlCenterSsoRequestInner.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Single sign-on request information for domain management. */ -@Immutable -public final class DomainControlCenterSsoRequestInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DomainControlCenterSsoRequestInner.class); - - /* - * URL where the single sign-on request is to be made. - */ - @JsonProperty(value = "url", access = JsonProperty.Access.WRITE_ONLY) - private String url; - - /* - * Post parameter key. - */ - @JsonProperty(value = "postParameterKey", access = JsonProperty.Access.WRITE_ONLY) - private String postParameterKey; - - /* - * Post parameter value. Client should use - * 'application/x-www-form-urlencoded' encoding for this value. - */ - @JsonProperty(value = "postParameterValue", access = JsonProperty.Access.WRITE_ONLY) - private String postParameterValue; - - /** - * Get the url property: URL where the single sign-on request is to be made. - * - * @return the url value. - */ - public String url() { - return this.url; - } - - /** - * Get the postParameterKey property: Post parameter key. - * - * @return the postParameterKey value. - */ - public String postParameterKey() { - return this.postParameterKey; - } - - /** - * Get the postParameterValue property: Post parameter value. Client should use 'application/x-www-form-urlencoded' - * encoding for this value. - * - * @return the postParameterValue value. - */ - public String postParameterValue() { - return this.postParameterValue; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/DomainInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/DomainInner.java deleted file mode 100644 index 5f42392ff398..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/DomainInner.java +++ /dev/null @@ -1,433 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.Contact; -import com.azure.resourcemanager.appservice.models.DnsType; -import com.azure.resourcemanager.appservice.models.DomainPropertiesDomainNotRenewableReasonsItem; -import com.azure.resourcemanager.appservice.models.DomainPurchaseConsent; -import com.azure.resourcemanager.appservice.models.DomainStatus; -import com.azure.resourcemanager.appservice.models.Hostname; -import com.azure.resourcemanager.appservice.models.ProvisioningState; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; -import java.util.Map; - -/** Information about a domain. */ -@Fluent -public final class DomainInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DomainInner.class); - - /* - * Domain resource specific properties - */ - @JsonProperty(value = "properties") - private DomainProperties innerProperties; - - /* - * Kind of resource. - */ - @JsonProperty(value = "kind") - private String kind; - - /** - * Get the innerProperties property: Domain resource specific properties. - * - * @return the innerProperties value. - */ - private DomainProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the kind property: Kind of resource. - * - * @return the kind value. - */ - public String kind() { - return this.kind; - } - - /** - * Set the kind property: Kind of resource. - * - * @param kind the kind value to set. - * @return the DomainInner object itself. - */ - public DomainInner withKind(String kind) { - this.kind = kind; - return this; - } - - /** {@inheritDoc} */ - @Override - public DomainInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public DomainInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the contactAdmin property: Administrative contact. - * - * @return the contactAdmin value. - */ - public Contact contactAdmin() { - return this.innerProperties() == null ? null : this.innerProperties().contactAdmin(); - } - - /** - * Set the contactAdmin property: Administrative contact. - * - * @param contactAdmin the contactAdmin value to set. - * @return the DomainInner object itself. - */ - public DomainInner withContactAdmin(Contact contactAdmin) { - if (this.innerProperties() == null) { - this.innerProperties = new DomainProperties(); - } - this.innerProperties().withContactAdmin(contactAdmin); - return this; - } - - /** - * Get the contactBilling property: Billing contact. - * - * @return the contactBilling value. - */ - public Contact contactBilling() { - return this.innerProperties() == null ? null : this.innerProperties().contactBilling(); - } - - /** - * Set the contactBilling property: Billing contact. - * - * @param contactBilling the contactBilling value to set. - * @return the DomainInner object itself. - */ - public DomainInner withContactBilling(Contact contactBilling) { - if (this.innerProperties() == null) { - this.innerProperties = new DomainProperties(); - } - this.innerProperties().withContactBilling(contactBilling); - return this; - } - - /** - * Get the contactRegistrant property: Registrant contact. - * - * @return the contactRegistrant value. - */ - public Contact contactRegistrant() { - return this.innerProperties() == null ? null : this.innerProperties().contactRegistrant(); - } - - /** - * Set the contactRegistrant property: Registrant contact. - * - * @param contactRegistrant the contactRegistrant value to set. - * @return the DomainInner object itself. - */ - public DomainInner withContactRegistrant(Contact contactRegistrant) { - if (this.innerProperties() == null) { - this.innerProperties = new DomainProperties(); - } - this.innerProperties().withContactRegistrant(contactRegistrant); - return this; - } - - /** - * Get the contactTech property: Technical contact. - * - * @return the contactTech value. - */ - public Contact contactTech() { - return this.innerProperties() == null ? null : this.innerProperties().contactTech(); - } - - /** - * Set the contactTech property: Technical contact. - * - * @param contactTech the contactTech value to set. - * @return the DomainInner object itself. - */ - public DomainInner withContactTech(Contact contactTech) { - if (this.innerProperties() == null) { - this.innerProperties = new DomainProperties(); - } - this.innerProperties().withContactTech(contactTech); - return this; - } - - /** - * Get the registrationStatus property: Domain registration status. - * - * @return the registrationStatus value. - */ - public DomainStatus registrationStatus() { - return this.innerProperties() == null ? null : this.innerProperties().registrationStatus(); - } - - /** - * Get the provisioningState property: Domain provisioning state. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the nameServers property: Name servers. - * - * @return the nameServers value. - */ - public List nameServers() { - return this.innerProperties() == null ? null : this.innerProperties().nameServers(); - } - - /** - * Get the privacy property: <code>true</code> if domain privacy is enabled for this domain; otherwise, - * <code>false</code>. - * - * @return the privacy value. - */ - public Boolean privacy() { - return this.innerProperties() == null ? null : this.innerProperties().privacy(); - } - - /** - * Set the privacy property: <code>true</code> if domain privacy is enabled for this domain; otherwise, - * <code>false</code>. - * - * @param privacy the privacy value to set. - * @return the DomainInner object itself. - */ - public DomainInner withPrivacy(Boolean privacy) { - if (this.innerProperties() == null) { - this.innerProperties = new DomainProperties(); - } - this.innerProperties().withPrivacy(privacy); - return this; - } - - /** - * Get the createdTime property: Domain creation timestamp. - * - * @return the createdTime value. - */ - public OffsetDateTime createdTime() { - return this.innerProperties() == null ? null : this.innerProperties().createdTime(); - } - - /** - * Get the expirationTime property: Domain expiration timestamp. - * - * @return the expirationTime value. - */ - public OffsetDateTime expirationTime() { - return this.innerProperties() == null ? null : this.innerProperties().expirationTime(); - } - - /** - * Get the lastRenewedTime property: Timestamp when the domain was renewed last time. - * - * @return the lastRenewedTime value. - */ - public OffsetDateTime lastRenewedTime() { - return this.innerProperties() == null ? null : this.innerProperties().lastRenewedTime(); - } - - /** - * Get the autoRenew property: <code>true</code> if the domain should be automatically renewed; - * otherwise, <code>false</code>. - * - * @return the autoRenew value. - */ - public Boolean autoRenew() { - return this.innerProperties() == null ? null : this.innerProperties().autoRenew(); - } - - /** - * Set the autoRenew property: <code>true</code> if the domain should be automatically renewed; - * otherwise, <code>false</code>. - * - * @param autoRenew the autoRenew value to set. - * @return the DomainInner object itself. - */ - public DomainInner withAutoRenew(Boolean autoRenew) { - if (this.innerProperties() == null) { - this.innerProperties = new DomainProperties(); - } - this.innerProperties().withAutoRenew(autoRenew); - return this; - } - - /** - * Get the readyForDnsRecordManagement property: <code>true</code> if Azure can assign this domain to - * App Service apps; otherwise, <code>false</code>. This value will be <code>true</code> if - * domain registration status is active and it is hosted on name servers Azure has programmatic access to. - * - * @return the readyForDnsRecordManagement value. - */ - public Boolean readyForDnsRecordManagement() { - return this.innerProperties() == null ? null : this.innerProperties().readyForDnsRecordManagement(); - } - - /** - * Get the managedHostNames property: All hostnames derived from the domain and assigned to Azure resources. - * - * @return the managedHostNames value. - */ - public List managedHostNames() { - return this.innerProperties() == null ? null : this.innerProperties().managedHostNames(); - } - - /** - * Get the consent property: Legal agreement consent. - * - * @return the consent value. - */ - public DomainPurchaseConsent consent() { - return this.innerProperties() == null ? null : this.innerProperties().consent(); - } - - /** - * Set the consent property: Legal agreement consent. - * - * @param consent the consent value to set. - * @return the DomainInner object itself. - */ - public DomainInner withConsent(DomainPurchaseConsent consent) { - if (this.innerProperties() == null) { - this.innerProperties = new DomainProperties(); - } - this.innerProperties().withConsent(consent); - return this; - } - - /** - * Get the domainNotRenewableReasons property: Reasons why domain is not renewable. - * - * @return the domainNotRenewableReasons value. - */ - public List domainNotRenewableReasons() { - return this.innerProperties() == null ? null : this.innerProperties().domainNotRenewableReasons(); - } - - /** - * Get the dnsType property: Current DNS type. - * - * @return the dnsType value. - */ - public DnsType dnsType() { - return this.innerProperties() == null ? null : this.innerProperties().dnsType(); - } - - /** - * Set the dnsType property: Current DNS type. - * - * @param dnsType the dnsType value to set. - * @return the DomainInner object itself. - */ - public DomainInner withDnsType(DnsType dnsType) { - if (this.innerProperties() == null) { - this.innerProperties = new DomainProperties(); - } - this.innerProperties().withDnsType(dnsType); - return this; - } - - /** - * Get the dnsZoneId property: Azure DNS Zone to use. - * - * @return the dnsZoneId value. - */ - public String dnsZoneId() { - return this.innerProperties() == null ? null : this.innerProperties().dnsZoneId(); - } - - /** - * Set the dnsZoneId property: Azure DNS Zone to use. - * - * @param dnsZoneId the dnsZoneId value to set. - * @return the DomainInner object itself. - */ - public DomainInner withDnsZoneId(String dnsZoneId) { - if (this.innerProperties() == null) { - this.innerProperties = new DomainProperties(); - } - this.innerProperties().withDnsZoneId(dnsZoneId); - return this; - } - - /** - * Get the targetDnsType property: Target DNS type (would be used for migration). - * - * @return the targetDnsType value. - */ - public DnsType targetDnsType() { - return this.innerProperties() == null ? null : this.innerProperties().targetDnsType(); - } - - /** - * Set the targetDnsType property: Target DNS type (would be used for migration). - * - * @param targetDnsType the targetDnsType value to set. - * @return the DomainInner object itself. - */ - public DomainInner withTargetDnsType(DnsType targetDnsType) { - if (this.innerProperties() == null) { - this.innerProperties = new DomainProperties(); - } - this.innerProperties().withTargetDnsType(targetDnsType); - return this; - } - - /** - * Get the authCode property: The authCode property. - * - * @return the authCode value. - */ - public String authCode() { - return this.innerProperties() == null ? null : this.innerProperties().authCode(); - } - - /** - * Set the authCode property: The authCode property. - * - * @param authCode the authCode value to set. - * @return the DomainInner object itself. - */ - public DomainInner withAuthCode(String authCode) { - if (this.innerProperties() == null) { - this.innerProperties = new DomainProperties(); - } - this.innerProperties().withAuthCode(authCode); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/DomainOwnershipIdentifierInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/DomainOwnershipIdentifierInner.java deleted file mode 100644 index 0cf9fd3058ae..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/DomainOwnershipIdentifierInner.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.ProxyOnlyResource; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Domain ownership Identifier. */ -@Fluent -public final class DomainOwnershipIdentifierInner extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DomainOwnershipIdentifierInner.class); - - /* - * DomainOwnershipIdentifier resource specific properties - */ - @JsonProperty(value = "properties") - private DomainOwnershipIdentifierProperties innerProperties; - - /** - * Get the innerProperties property: DomainOwnershipIdentifier resource specific properties. - * - * @return the innerProperties value. - */ - private DomainOwnershipIdentifierProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public DomainOwnershipIdentifierInner withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the ownershipId property: Ownership Id. - * - * @return the ownershipId value. - */ - public String ownershipId() { - return this.innerProperties() == null ? null : this.innerProperties().ownershipId(); - } - - /** - * Set the ownershipId property: Ownership Id. - * - * @param ownershipId the ownershipId value to set. - * @return the DomainOwnershipIdentifierInner object itself. - */ - public DomainOwnershipIdentifierInner withOwnershipId(String ownershipId) { - if (this.innerProperties() == null) { - this.innerProperties = new DomainOwnershipIdentifierProperties(); - } - this.innerProperties().withOwnershipId(ownershipId); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/DomainOwnershipIdentifierProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/DomainOwnershipIdentifierProperties.java deleted file mode 100644 index b6d9ce07cea6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/DomainOwnershipIdentifierProperties.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** DomainOwnershipIdentifier resource specific properties. */ -@Fluent -public final class DomainOwnershipIdentifierProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DomainOwnershipIdentifierProperties.class); - - /* - * Ownership Id. - */ - @JsonProperty(value = "ownershipId") - private String ownershipId; - - /** - * Get the ownershipId property: Ownership Id. - * - * @return the ownershipId value. - */ - public String ownershipId() { - return this.ownershipId; - } - - /** - * Set the ownershipId property: Ownership Id. - * - * @param ownershipId the ownershipId value to set. - * @return the DomainOwnershipIdentifierProperties object itself. - */ - public DomainOwnershipIdentifierProperties withOwnershipId(String ownershipId) { - this.ownershipId = ownershipId; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/DomainPatchResourceProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/DomainPatchResourceProperties.java deleted file mode 100644 index 3f864de752ed..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/DomainPatchResourceProperties.java +++ /dev/null @@ -1,508 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.Contact; -import com.azure.resourcemanager.appservice.models.DnsType; -import com.azure.resourcemanager.appservice.models.DomainPatchResourcePropertiesDomainNotRenewableReasonsItem; -import com.azure.resourcemanager.appservice.models.DomainPurchaseConsent; -import com.azure.resourcemanager.appservice.models.DomainStatus; -import com.azure.resourcemanager.appservice.models.Hostname; -import com.azure.resourcemanager.appservice.models.ProvisioningState; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; - -/** DomainPatchResource resource specific properties. */ -@Fluent -public final class DomainPatchResourceProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DomainPatchResourceProperties.class); - - /* - * Administrative contact. - */ - @JsonProperty(value = "contactAdmin", required = true) - private Contact contactAdmin; - - /* - * Billing contact. - */ - @JsonProperty(value = "contactBilling", required = true) - private Contact contactBilling; - - /* - * Registrant contact. - */ - @JsonProperty(value = "contactRegistrant", required = true) - private Contact contactRegistrant; - - /* - * Technical contact. - */ - @JsonProperty(value = "contactTech", required = true) - private Contact contactTech; - - /* - * Domain registration status. - */ - @JsonProperty(value = "registrationStatus", access = JsonProperty.Access.WRITE_ONLY) - private DomainStatus registrationStatus; - - /* - * Domain provisioning state. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private ProvisioningState provisioningState; - - /* - * Name servers. - */ - @JsonProperty(value = "nameServers", access = JsonProperty.Access.WRITE_ONLY) - private List nameServers; - - /* - * true if domain privacy is enabled for this domain; - * otherwise, false. - */ - @JsonProperty(value = "privacy") - private Boolean privacy; - - /* - * Domain creation timestamp. - */ - @JsonProperty(value = "createdTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime createdTime; - - /* - * Domain expiration timestamp. - */ - @JsonProperty(value = "expirationTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime expirationTime; - - /* - * Timestamp when the domain was renewed last time. - */ - @JsonProperty(value = "lastRenewedTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime lastRenewedTime; - - /* - * true if the domain should be automatically renewed; - * otherwise, false. - */ - @JsonProperty(value = "autoRenew") - private Boolean autoRenew; - - /* - * true if Azure can assign this domain to App Service apps; - * otherwise, false. This value will be true if - * domain registration status is active and - * it is hosted on name servers Azure has programmatic access to. - */ - @JsonProperty(value = "readyForDnsRecordManagement", access = JsonProperty.Access.WRITE_ONLY) - private Boolean readyForDnsRecordManagement; - - /* - * All hostnames derived from the domain and assigned to Azure resources. - */ - @JsonProperty(value = "managedHostNames", access = JsonProperty.Access.WRITE_ONLY) - private List managedHostNames; - - /* - * Legal agreement consent. - */ - @JsonProperty(value = "consent", required = true) - private DomainPurchaseConsent consent; - - /* - * Reasons why domain is not renewable. - */ - @JsonProperty(value = "domainNotRenewableReasons", access = JsonProperty.Access.WRITE_ONLY) - private List domainNotRenewableReasons; - - /* - * Current DNS type - */ - @JsonProperty(value = "dnsType") - private DnsType dnsType; - - /* - * Azure DNS Zone to use - */ - @JsonProperty(value = "dnsZoneId") - private String dnsZoneId; - - /* - * Target DNS type (would be used for migration) - */ - @JsonProperty(value = "targetDnsType") - private DnsType targetDnsType; - - /* - * The authCode property. - */ - @JsonProperty(value = "authCode") - private String authCode; - - /** - * Get the contactAdmin property: Administrative contact. - * - * @return the contactAdmin value. - */ - public Contact contactAdmin() { - return this.contactAdmin; - } - - /** - * Set the contactAdmin property: Administrative contact. - * - * @param contactAdmin the contactAdmin value to set. - * @return the DomainPatchResourceProperties object itself. - */ - public DomainPatchResourceProperties withContactAdmin(Contact contactAdmin) { - this.contactAdmin = contactAdmin; - return this; - } - - /** - * Get the contactBilling property: Billing contact. - * - * @return the contactBilling value. - */ - public Contact contactBilling() { - return this.contactBilling; - } - - /** - * Set the contactBilling property: Billing contact. - * - * @param contactBilling the contactBilling value to set. - * @return the DomainPatchResourceProperties object itself. - */ - public DomainPatchResourceProperties withContactBilling(Contact contactBilling) { - this.contactBilling = contactBilling; - return this; - } - - /** - * Get the contactRegistrant property: Registrant contact. - * - * @return the contactRegistrant value. - */ - public Contact contactRegistrant() { - return this.contactRegistrant; - } - - /** - * Set the contactRegistrant property: Registrant contact. - * - * @param contactRegistrant the contactRegistrant value to set. - * @return the DomainPatchResourceProperties object itself. - */ - public DomainPatchResourceProperties withContactRegistrant(Contact contactRegistrant) { - this.contactRegistrant = contactRegistrant; - return this; - } - - /** - * Get the contactTech property: Technical contact. - * - * @return the contactTech value. - */ - public Contact contactTech() { - return this.contactTech; - } - - /** - * Set the contactTech property: Technical contact. - * - * @param contactTech the contactTech value to set. - * @return the DomainPatchResourceProperties object itself. - */ - public DomainPatchResourceProperties withContactTech(Contact contactTech) { - this.contactTech = contactTech; - return this; - } - - /** - * Get the registrationStatus property: Domain registration status. - * - * @return the registrationStatus value. - */ - public DomainStatus registrationStatus() { - return this.registrationStatus; - } - - /** - * Get the provisioningState property: Domain provisioning state. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Get the nameServers property: Name servers. - * - * @return the nameServers value. - */ - public List nameServers() { - return this.nameServers; - } - - /** - * Get the privacy property: <code>true</code> if domain privacy is enabled for this domain; otherwise, - * <code>false</code>. - * - * @return the privacy value. - */ - public Boolean privacy() { - return this.privacy; - } - - /** - * Set the privacy property: <code>true</code> if domain privacy is enabled for this domain; otherwise, - * <code>false</code>. - * - * @param privacy the privacy value to set. - * @return the DomainPatchResourceProperties object itself. - */ - public DomainPatchResourceProperties withPrivacy(Boolean privacy) { - this.privacy = privacy; - return this; - } - - /** - * Get the createdTime property: Domain creation timestamp. - * - * @return the createdTime value. - */ - public OffsetDateTime createdTime() { - return this.createdTime; - } - - /** - * Get the expirationTime property: Domain expiration timestamp. - * - * @return the expirationTime value. - */ - public OffsetDateTime expirationTime() { - return this.expirationTime; - } - - /** - * Get the lastRenewedTime property: Timestamp when the domain was renewed last time. - * - * @return the lastRenewedTime value. - */ - public OffsetDateTime lastRenewedTime() { - return this.lastRenewedTime; - } - - /** - * Get the autoRenew property: <code>true</code> if the domain should be automatically renewed; - * otherwise, <code>false</code>. - * - * @return the autoRenew value. - */ - public Boolean autoRenew() { - return this.autoRenew; - } - - /** - * Set the autoRenew property: <code>true</code> if the domain should be automatically renewed; - * otherwise, <code>false</code>. - * - * @param autoRenew the autoRenew value to set. - * @return the DomainPatchResourceProperties object itself. - */ - public DomainPatchResourceProperties withAutoRenew(Boolean autoRenew) { - this.autoRenew = autoRenew; - return this; - } - - /** - * Get the readyForDnsRecordManagement property: <code>true</code> if Azure can assign this domain to - * App Service apps; otherwise, <code>false</code>. This value will be <code>true</code> if - * domain registration status is active and it is hosted on name servers Azure has programmatic access to. - * - * @return the readyForDnsRecordManagement value. - */ - public Boolean readyForDnsRecordManagement() { - return this.readyForDnsRecordManagement; - } - - /** - * Get the managedHostNames property: All hostnames derived from the domain and assigned to Azure resources. - * - * @return the managedHostNames value. - */ - public List managedHostNames() { - return this.managedHostNames; - } - - /** - * Get the consent property: Legal agreement consent. - * - * @return the consent value. - */ - public DomainPurchaseConsent consent() { - return this.consent; - } - - /** - * Set the consent property: Legal agreement consent. - * - * @param consent the consent value to set. - * @return the DomainPatchResourceProperties object itself. - */ - public DomainPatchResourceProperties withConsent(DomainPurchaseConsent consent) { - this.consent = consent; - return this; - } - - /** - * Get the domainNotRenewableReasons property: Reasons why domain is not renewable. - * - * @return the domainNotRenewableReasons value. - */ - public List domainNotRenewableReasons() { - return this.domainNotRenewableReasons; - } - - /** - * Get the dnsType property: Current DNS type. - * - * @return the dnsType value. - */ - public DnsType dnsType() { - return this.dnsType; - } - - /** - * Set the dnsType property: Current DNS type. - * - * @param dnsType the dnsType value to set. - * @return the DomainPatchResourceProperties object itself. - */ - public DomainPatchResourceProperties withDnsType(DnsType dnsType) { - this.dnsType = dnsType; - return this; - } - - /** - * Get the dnsZoneId property: Azure DNS Zone to use. - * - * @return the dnsZoneId value. - */ - public String dnsZoneId() { - return this.dnsZoneId; - } - - /** - * Set the dnsZoneId property: Azure DNS Zone to use. - * - * @param dnsZoneId the dnsZoneId value to set. - * @return the DomainPatchResourceProperties object itself. - */ - public DomainPatchResourceProperties withDnsZoneId(String dnsZoneId) { - this.dnsZoneId = dnsZoneId; - return this; - } - - /** - * Get the targetDnsType property: Target DNS type (would be used for migration). - * - * @return the targetDnsType value. - */ - public DnsType targetDnsType() { - return this.targetDnsType; - } - - /** - * Set the targetDnsType property: Target DNS type (would be used for migration). - * - * @param targetDnsType the targetDnsType value to set. - * @return the DomainPatchResourceProperties object itself. - */ - public DomainPatchResourceProperties withTargetDnsType(DnsType targetDnsType) { - this.targetDnsType = targetDnsType; - return this; - } - - /** - * Get the authCode property: The authCode property. - * - * @return the authCode value. - */ - public String authCode() { - return this.authCode; - } - - /** - * Set the authCode property: The authCode property. - * - * @param authCode the authCode value to set. - * @return the DomainPatchResourceProperties object itself. - */ - public DomainPatchResourceProperties withAuthCode(String authCode) { - this.authCode = authCode; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (contactAdmin() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property contactAdmin in model DomainPatchResourceProperties")); - } else { - contactAdmin().validate(); - } - if (contactBilling() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property contactBilling in model DomainPatchResourceProperties")); - } else { - contactBilling().validate(); - } - if (contactRegistrant() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property contactRegistrant in model DomainPatchResourceProperties")); - } else { - contactRegistrant().validate(); - } - if (contactTech() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property contactTech in model DomainPatchResourceProperties")); - } else { - contactTech().validate(); - } - if (managedHostNames() != null) { - managedHostNames().forEach(e -> e.validate()); - } - if (consent() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property consent in model DomainPatchResourceProperties")); - } else { - consent().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/DomainProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/DomainProperties.java deleted file mode 100644 index 2291fa13f0ff..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/DomainProperties.java +++ /dev/null @@ -1,504 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.Contact; -import com.azure.resourcemanager.appservice.models.DnsType; -import com.azure.resourcemanager.appservice.models.DomainPropertiesDomainNotRenewableReasonsItem; -import com.azure.resourcemanager.appservice.models.DomainPurchaseConsent; -import com.azure.resourcemanager.appservice.models.DomainStatus; -import com.azure.resourcemanager.appservice.models.Hostname; -import com.azure.resourcemanager.appservice.models.ProvisioningState; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; - -/** Domain resource specific properties. */ -@Fluent -public final class DomainProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DomainProperties.class); - - /* - * Administrative contact. - */ - @JsonProperty(value = "contactAdmin", required = true) - private Contact contactAdmin; - - /* - * Billing contact. - */ - @JsonProperty(value = "contactBilling", required = true) - private Contact contactBilling; - - /* - * Registrant contact. - */ - @JsonProperty(value = "contactRegistrant", required = true) - private Contact contactRegistrant; - - /* - * Technical contact. - */ - @JsonProperty(value = "contactTech", required = true) - private Contact contactTech; - - /* - * Domain registration status. - */ - @JsonProperty(value = "registrationStatus", access = JsonProperty.Access.WRITE_ONLY) - private DomainStatus registrationStatus; - - /* - * Domain provisioning state. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private ProvisioningState provisioningState; - - /* - * Name servers. - */ - @JsonProperty(value = "nameServers", access = JsonProperty.Access.WRITE_ONLY) - private List nameServers; - - /* - * true if domain privacy is enabled for this domain; - * otherwise, false. - */ - @JsonProperty(value = "privacy") - private Boolean privacy; - - /* - * Domain creation timestamp. - */ - @JsonProperty(value = "createdTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime createdTime; - - /* - * Domain expiration timestamp. - */ - @JsonProperty(value = "expirationTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime expirationTime; - - /* - * Timestamp when the domain was renewed last time. - */ - @JsonProperty(value = "lastRenewedTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime lastRenewedTime; - - /* - * true if the domain should be automatically renewed; - * otherwise, false. - */ - @JsonProperty(value = "autoRenew") - private Boolean autoRenew; - - /* - * true if Azure can assign this domain to App Service apps; - * otherwise, false. This value will be true if - * domain registration status is active and - * it is hosted on name servers Azure has programmatic access to. - */ - @JsonProperty(value = "readyForDnsRecordManagement", access = JsonProperty.Access.WRITE_ONLY) - private Boolean readyForDnsRecordManagement; - - /* - * All hostnames derived from the domain and assigned to Azure resources. - */ - @JsonProperty(value = "managedHostNames", access = JsonProperty.Access.WRITE_ONLY) - private List managedHostNames; - - /* - * Legal agreement consent. - */ - @JsonProperty(value = "consent", required = true) - private DomainPurchaseConsent consent; - - /* - * Reasons why domain is not renewable. - */ - @JsonProperty(value = "domainNotRenewableReasons", access = JsonProperty.Access.WRITE_ONLY) - private List domainNotRenewableReasons; - - /* - * Current DNS type - */ - @JsonProperty(value = "dnsType") - private DnsType dnsType; - - /* - * Azure DNS Zone to use - */ - @JsonProperty(value = "dnsZoneId") - private String dnsZoneId; - - /* - * Target DNS type (would be used for migration) - */ - @JsonProperty(value = "targetDnsType") - private DnsType targetDnsType; - - /* - * The authCode property. - */ - @JsonProperty(value = "authCode") - private String authCode; - - /** - * Get the contactAdmin property: Administrative contact. - * - * @return the contactAdmin value. - */ - public Contact contactAdmin() { - return this.contactAdmin; - } - - /** - * Set the contactAdmin property: Administrative contact. - * - * @param contactAdmin the contactAdmin value to set. - * @return the DomainProperties object itself. - */ - public DomainProperties withContactAdmin(Contact contactAdmin) { - this.contactAdmin = contactAdmin; - return this; - } - - /** - * Get the contactBilling property: Billing contact. - * - * @return the contactBilling value. - */ - public Contact contactBilling() { - return this.contactBilling; - } - - /** - * Set the contactBilling property: Billing contact. - * - * @param contactBilling the contactBilling value to set. - * @return the DomainProperties object itself. - */ - public DomainProperties withContactBilling(Contact contactBilling) { - this.contactBilling = contactBilling; - return this; - } - - /** - * Get the contactRegistrant property: Registrant contact. - * - * @return the contactRegistrant value. - */ - public Contact contactRegistrant() { - return this.contactRegistrant; - } - - /** - * Set the contactRegistrant property: Registrant contact. - * - * @param contactRegistrant the contactRegistrant value to set. - * @return the DomainProperties object itself. - */ - public DomainProperties withContactRegistrant(Contact contactRegistrant) { - this.contactRegistrant = contactRegistrant; - return this; - } - - /** - * Get the contactTech property: Technical contact. - * - * @return the contactTech value. - */ - public Contact contactTech() { - return this.contactTech; - } - - /** - * Set the contactTech property: Technical contact. - * - * @param contactTech the contactTech value to set. - * @return the DomainProperties object itself. - */ - public DomainProperties withContactTech(Contact contactTech) { - this.contactTech = contactTech; - return this; - } - - /** - * Get the registrationStatus property: Domain registration status. - * - * @return the registrationStatus value. - */ - public DomainStatus registrationStatus() { - return this.registrationStatus; - } - - /** - * Get the provisioningState property: Domain provisioning state. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Get the nameServers property: Name servers. - * - * @return the nameServers value. - */ - public List nameServers() { - return this.nameServers; - } - - /** - * Get the privacy property: <code>true</code> if domain privacy is enabled for this domain; otherwise, - * <code>false</code>. - * - * @return the privacy value. - */ - public Boolean privacy() { - return this.privacy; - } - - /** - * Set the privacy property: <code>true</code> if domain privacy is enabled for this domain; otherwise, - * <code>false</code>. - * - * @param privacy the privacy value to set. - * @return the DomainProperties object itself. - */ - public DomainProperties withPrivacy(Boolean privacy) { - this.privacy = privacy; - return this; - } - - /** - * Get the createdTime property: Domain creation timestamp. - * - * @return the createdTime value. - */ - public OffsetDateTime createdTime() { - return this.createdTime; - } - - /** - * Get the expirationTime property: Domain expiration timestamp. - * - * @return the expirationTime value. - */ - public OffsetDateTime expirationTime() { - return this.expirationTime; - } - - /** - * Get the lastRenewedTime property: Timestamp when the domain was renewed last time. - * - * @return the lastRenewedTime value. - */ - public OffsetDateTime lastRenewedTime() { - return this.lastRenewedTime; - } - - /** - * Get the autoRenew property: <code>true</code> if the domain should be automatically renewed; - * otherwise, <code>false</code>. - * - * @return the autoRenew value. - */ - public Boolean autoRenew() { - return this.autoRenew; - } - - /** - * Set the autoRenew property: <code>true</code> if the domain should be automatically renewed; - * otherwise, <code>false</code>. - * - * @param autoRenew the autoRenew value to set. - * @return the DomainProperties object itself. - */ - public DomainProperties withAutoRenew(Boolean autoRenew) { - this.autoRenew = autoRenew; - return this; - } - - /** - * Get the readyForDnsRecordManagement property: <code>true</code> if Azure can assign this domain to - * App Service apps; otherwise, <code>false</code>. This value will be <code>true</code> if - * domain registration status is active and it is hosted on name servers Azure has programmatic access to. - * - * @return the readyForDnsRecordManagement value. - */ - public Boolean readyForDnsRecordManagement() { - return this.readyForDnsRecordManagement; - } - - /** - * Get the managedHostNames property: All hostnames derived from the domain and assigned to Azure resources. - * - * @return the managedHostNames value. - */ - public List managedHostNames() { - return this.managedHostNames; - } - - /** - * Get the consent property: Legal agreement consent. - * - * @return the consent value. - */ - public DomainPurchaseConsent consent() { - return this.consent; - } - - /** - * Set the consent property: Legal agreement consent. - * - * @param consent the consent value to set. - * @return the DomainProperties object itself. - */ - public DomainProperties withConsent(DomainPurchaseConsent consent) { - this.consent = consent; - return this; - } - - /** - * Get the domainNotRenewableReasons property: Reasons why domain is not renewable. - * - * @return the domainNotRenewableReasons value. - */ - public List domainNotRenewableReasons() { - return this.domainNotRenewableReasons; - } - - /** - * Get the dnsType property: Current DNS type. - * - * @return the dnsType value. - */ - public DnsType dnsType() { - return this.dnsType; - } - - /** - * Set the dnsType property: Current DNS type. - * - * @param dnsType the dnsType value to set. - * @return the DomainProperties object itself. - */ - public DomainProperties withDnsType(DnsType dnsType) { - this.dnsType = dnsType; - return this; - } - - /** - * Get the dnsZoneId property: Azure DNS Zone to use. - * - * @return the dnsZoneId value. - */ - public String dnsZoneId() { - return this.dnsZoneId; - } - - /** - * Set the dnsZoneId property: Azure DNS Zone to use. - * - * @param dnsZoneId the dnsZoneId value to set. - * @return the DomainProperties object itself. - */ - public DomainProperties withDnsZoneId(String dnsZoneId) { - this.dnsZoneId = dnsZoneId; - return this; - } - - /** - * Get the targetDnsType property: Target DNS type (would be used for migration). - * - * @return the targetDnsType value. - */ - public DnsType targetDnsType() { - return this.targetDnsType; - } - - /** - * Set the targetDnsType property: Target DNS type (would be used for migration). - * - * @param targetDnsType the targetDnsType value to set. - * @return the DomainProperties object itself. - */ - public DomainProperties withTargetDnsType(DnsType targetDnsType) { - this.targetDnsType = targetDnsType; - return this; - } - - /** - * Get the authCode property: The authCode property. - * - * @return the authCode value. - */ - public String authCode() { - return this.authCode; - } - - /** - * Set the authCode property: The authCode property. - * - * @param authCode the authCode value to set. - * @return the DomainProperties object itself. - */ - public DomainProperties withAuthCode(String authCode) { - this.authCode = authCode; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (contactAdmin() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property contactAdmin in model DomainProperties")); - } else { - contactAdmin().validate(); - } - if (contactBilling() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property contactBilling in model DomainProperties")); - } else { - contactBilling().validate(); - } - if (contactRegistrant() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property contactRegistrant in model DomainProperties")); - } else { - contactRegistrant().validate(); - } - if (contactTech() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property contactTech in model DomainProperties")); - } else { - contactTech().validate(); - } - if (managedHostNames() != null) { - managedHostNames().forEach(e -> e.validate()); - } - if (consent() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property consent in model DomainProperties")); - } else { - consent().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/FunctionEnvelopeInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/FunctionEnvelopeInner.java deleted file mode 100644 index 981a6e3d19dc..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/FunctionEnvelopeInner.java +++ /dev/null @@ -1,352 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.ProxyOnlyResource; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** Function information. */ -@Fluent -public final class FunctionEnvelopeInner extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(FunctionEnvelopeInner.class); - - /* - * FunctionEnvelope resource specific properties - */ - @JsonProperty(value = "properties") - private FunctionEnvelopeProperties innerProperties; - - /** - * Get the innerProperties property: FunctionEnvelope resource specific properties. - * - * @return the innerProperties value. - */ - private FunctionEnvelopeProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public FunctionEnvelopeInner withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the functionAppId property: Function App ID. - * - * @return the functionAppId value. - */ - public String functionAppId() { - return this.innerProperties() == null ? null : this.innerProperties().functionAppId(); - } - - /** - * Set the functionAppId property: Function App ID. - * - * @param functionAppId the functionAppId value to set. - * @return the FunctionEnvelopeInner object itself. - */ - public FunctionEnvelopeInner withFunctionAppId(String functionAppId) { - if (this.innerProperties() == null) { - this.innerProperties = new FunctionEnvelopeProperties(); - } - this.innerProperties().withFunctionAppId(functionAppId); - return this; - } - - /** - * Get the scriptRootPathHref property: Script root path URI. - * - * @return the scriptRootPathHref value. - */ - public String scriptRootPathHref() { - return this.innerProperties() == null ? null : this.innerProperties().scriptRootPathHref(); - } - - /** - * Set the scriptRootPathHref property: Script root path URI. - * - * @param scriptRootPathHref the scriptRootPathHref value to set. - * @return the FunctionEnvelopeInner object itself. - */ - public FunctionEnvelopeInner withScriptRootPathHref(String scriptRootPathHref) { - if (this.innerProperties() == null) { - this.innerProperties = new FunctionEnvelopeProperties(); - } - this.innerProperties().withScriptRootPathHref(scriptRootPathHref); - return this; - } - - /** - * Get the scriptHref property: Script URI. - * - * @return the scriptHref value. - */ - public String scriptHref() { - return this.innerProperties() == null ? null : this.innerProperties().scriptHref(); - } - - /** - * Set the scriptHref property: Script URI. - * - * @param scriptHref the scriptHref value to set. - * @return the FunctionEnvelopeInner object itself. - */ - public FunctionEnvelopeInner withScriptHref(String scriptHref) { - if (this.innerProperties() == null) { - this.innerProperties = new FunctionEnvelopeProperties(); - } - this.innerProperties().withScriptHref(scriptHref); - return this; - } - - /** - * Get the configHref property: Config URI. - * - * @return the configHref value. - */ - public String configHref() { - return this.innerProperties() == null ? null : this.innerProperties().configHref(); - } - - /** - * Set the configHref property: Config URI. - * - * @param configHref the configHref value to set. - * @return the FunctionEnvelopeInner object itself. - */ - public FunctionEnvelopeInner withConfigHref(String configHref) { - if (this.innerProperties() == null) { - this.innerProperties = new FunctionEnvelopeProperties(); - } - this.innerProperties().withConfigHref(configHref); - return this; - } - - /** - * Get the testDataHref property: Test data URI. - * - * @return the testDataHref value. - */ - public String testDataHref() { - return this.innerProperties() == null ? null : this.innerProperties().testDataHref(); - } - - /** - * Set the testDataHref property: Test data URI. - * - * @param testDataHref the testDataHref value to set. - * @return the FunctionEnvelopeInner object itself. - */ - public FunctionEnvelopeInner withTestDataHref(String testDataHref) { - if (this.innerProperties() == null) { - this.innerProperties = new FunctionEnvelopeProperties(); - } - this.innerProperties().withTestDataHref(testDataHref); - return this; - } - - /** - * Get the secretsFileHref property: Secrets file URI. - * - * @return the secretsFileHref value. - */ - public String secretsFileHref() { - return this.innerProperties() == null ? null : this.innerProperties().secretsFileHref(); - } - - /** - * Set the secretsFileHref property: Secrets file URI. - * - * @param secretsFileHref the secretsFileHref value to set. - * @return the FunctionEnvelopeInner object itself. - */ - public FunctionEnvelopeInner withSecretsFileHref(String secretsFileHref) { - if (this.innerProperties() == null) { - this.innerProperties = new FunctionEnvelopeProperties(); - } - this.innerProperties().withSecretsFileHref(secretsFileHref); - return this; - } - - /** - * Get the href property: Function URI. - * - * @return the href value. - */ - public String href() { - return this.innerProperties() == null ? null : this.innerProperties().href(); - } - - /** - * Set the href property: Function URI. - * - * @param href the href value to set. - * @return the FunctionEnvelopeInner object itself. - */ - public FunctionEnvelopeInner withHref(String href) { - if (this.innerProperties() == null) { - this.innerProperties = new FunctionEnvelopeProperties(); - } - this.innerProperties().withHref(href); - return this; - } - - /** - * Get the config property: Config information. - * - * @return the config value. - */ - public Object config() { - return this.innerProperties() == null ? null : this.innerProperties().config(); - } - - /** - * Set the config property: Config information. - * - * @param config the config value to set. - * @return the FunctionEnvelopeInner object itself. - */ - public FunctionEnvelopeInner withConfig(Object config) { - if (this.innerProperties() == null) { - this.innerProperties = new FunctionEnvelopeProperties(); - } - this.innerProperties().withConfig(config); - return this; - } - - /** - * Get the files property: File list. - * - * @return the files value. - */ - public Map files() { - return this.innerProperties() == null ? null : this.innerProperties().files(); - } - - /** - * Set the files property: File list. - * - * @param files the files value to set. - * @return the FunctionEnvelopeInner object itself. - */ - public FunctionEnvelopeInner withFiles(Map files) { - if (this.innerProperties() == null) { - this.innerProperties = new FunctionEnvelopeProperties(); - } - this.innerProperties().withFiles(files); - return this; - } - - /** - * Get the testData property: Test data used when testing via the Azure Portal. - * - * @return the testData value. - */ - public String testData() { - return this.innerProperties() == null ? null : this.innerProperties().testData(); - } - - /** - * Set the testData property: Test data used when testing via the Azure Portal. - * - * @param testData the testData value to set. - * @return the FunctionEnvelopeInner object itself. - */ - public FunctionEnvelopeInner withTestData(String testData) { - if (this.innerProperties() == null) { - this.innerProperties = new FunctionEnvelopeProperties(); - } - this.innerProperties().withTestData(testData); - return this; - } - - /** - * Get the invokeUrlTemplate property: The invocation URL. - * - * @return the invokeUrlTemplate value. - */ - public String invokeUrlTemplate() { - return this.innerProperties() == null ? null : this.innerProperties().invokeUrlTemplate(); - } - - /** - * Set the invokeUrlTemplate property: The invocation URL. - * - * @param invokeUrlTemplate the invokeUrlTemplate value to set. - * @return the FunctionEnvelopeInner object itself. - */ - public FunctionEnvelopeInner withInvokeUrlTemplate(String invokeUrlTemplate) { - if (this.innerProperties() == null) { - this.innerProperties = new FunctionEnvelopeProperties(); - } - this.innerProperties().withInvokeUrlTemplate(invokeUrlTemplate); - return this; - } - - /** - * Get the language property: The function language. - * - * @return the language value. - */ - public String language() { - return this.innerProperties() == null ? null : this.innerProperties().language(); - } - - /** - * Set the language property: The function language. - * - * @param language the language value to set. - * @return the FunctionEnvelopeInner object itself. - */ - public FunctionEnvelopeInner withLanguage(String language) { - if (this.innerProperties() == null) { - this.innerProperties = new FunctionEnvelopeProperties(); - } - this.innerProperties().withLanguage(language); - return this; - } - - /** - * Get the isDisabled property: Value indicating whether the function is disabled. - * - * @return the isDisabled value. - */ - public Boolean isDisabled() { - return this.innerProperties() == null ? null : this.innerProperties().isDisabled(); - } - - /** - * Set the isDisabled property: Value indicating whether the function is disabled. - * - * @param isDisabled the isDisabled value to set. - * @return the FunctionEnvelopeInner object itself. - */ - public FunctionEnvelopeInner withIsDisabled(Boolean isDisabled) { - if (this.innerProperties() == null) { - this.innerProperties = new FunctionEnvelopeProperties(); - } - this.innerProperties().withIsDisabled(isDisabled); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/FunctionEnvelopeProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/FunctionEnvelopeProperties.java deleted file mode 100644 index 9ca50871c1eb..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/FunctionEnvelopeProperties.java +++ /dev/null @@ -1,365 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** FunctionEnvelope resource specific properties. */ -@Fluent -public final class FunctionEnvelopeProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(FunctionEnvelopeProperties.class); - - /* - * Function App ID. - */ - @JsonProperty(value = "function_app_id") - private String functionAppId; - - /* - * Script root path URI. - */ - @JsonProperty(value = "script_root_path_href") - private String scriptRootPathHref; - - /* - * Script URI. - */ - @JsonProperty(value = "script_href") - private String scriptHref; - - /* - * Config URI. - */ - @JsonProperty(value = "config_href") - private String configHref; - - /* - * Test data URI. - */ - @JsonProperty(value = "test_data_href") - private String testDataHref; - - /* - * Secrets file URI. - */ - @JsonProperty(value = "secrets_file_href") - private String secretsFileHref; - - /* - * Function URI. - */ - @JsonProperty(value = "href") - private String href; - - /* - * Config information. - */ - @JsonProperty(value = "config") - private Object config; - - /* - * File list. - */ - @JsonProperty(value = "files") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map files; - - /* - * Test data used when testing via the Azure Portal. - */ - @JsonProperty(value = "test_data") - private String testData; - - /* - * The invocation URL - */ - @JsonProperty(value = "invoke_url_template") - private String invokeUrlTemplate; - - /* - * The function language - */ - @JsonProperty(value = "language") - private String language; - - /* - * Value indicating whether the function is disabled - */ - @JsonProperty(value = "isDisabled") - private Boolean isDisabled; - - /** - * Get the functionAppId property: Function App ID. - * - * @return the functionAppId value. - */ - public String functionAppId() { - return this.functionAppId; - } - - /** - * Set the functionAppId property: Function App ID. - * - * @param functionAppId the functionAppId value to set. - * @return the FunctionEnvelopeProperties object itself. - */ - public FunctionEnvelopeProperties withFunctionAppId(String functionAppId) { - this.functionAppId = functionAppId; - return this; - } - - /** - * Get the scriptRootPathHref property: Script root path URI. - * - * @return the scriptRootPathHref value. - */ - public String scriptRootPathHref() { - return this.scriptRootPathHref; - } - - /** - * Set the scriptRootPathHref property: Script root path URI. - * - * @param scriptRootPathHref the scriptRootPathHref value to set. - * @return the FunctionEnvelopeProperties object itself. - */ - public FunctionEnvelopeProperties withScriptRootPathHref(String scriptRootPathHref) { - this.scriptRootPathHref = scriptRootPathHref; - return this; - } - - /** - * Get the scriptHref property: Script URI. - * - * @return the scriptHref value. - */ - public String scriptHref() { - return this.scriptHref; - } - - /** - * Set the scriptHref property: Script URI. - * - * @param scriptHref the scriptHref value to set. - * @return the FunctionEnvelopeProperties object itself. - */ - public FunctionEnvelopeProperties withScriptHref(String scriptHref) { - this.scriptHref = scriptHref; - return this; - } - - /** - * Get the configHref property: Config URI. - * - * @return the configHref value. - */ - public String configHref() { - return this.configHref; - } - - /** - * Set the configHref property: Config URI. - * - * @param configHref the configHref value to set. - * @return the FunctionEnvelopeProperties object itself. - */ - public FunctionEnvelopeProperties withConfigHref(String configHref) { - this.configHref = configHref; - return this; - } - - /** - * Get the testDataHref property: Test data URI. - * - * @return the testDataHref value. - */ - public String testDataHref() { - return this.testDataHref; - } - - /** - * Set the testDataHref property: Test data URI. - * - * @param testDataHref the testDataHref value to set. - * @return the FunctionEnvelopeProperties object itself. - */ - public FunctionEnvelopeProperties withTestDataHref(String testDataHref) { - this.testDataHref = testDataHref; - return this; - } - - /** - * Get the secretsFileHref property: Secrets file URI. - * - * @return the secretsFileHref value. - */ - public String secretsFileHref() { - return this.secretsFileHref; - } - - /** - * Set the secretsFileHref property: Secrets file URI. - * - * @param secretsFileHref the secretsFileHref value to set. - * @return the FunctionEnvelopeProperties object itself. - */ - public FunctionEnvelopeProperties withSecretsFileHref(String secretsFileHref) { - this.secretsFileHref = secretsFileHref; - return this; - } - - /** - * Get the href property: Function URI. - * - * @return the href value. - */ - public String href() { - return this.href; - } - - /** - * Set the href property: Function URI. - * - * @param href the href value to set. - * @return the FunctionEnvelopeProperties object itself. - */ - public FunctionEnvelopeProperties withHref(String href) { - this.href = href; - return this; - } - - /** - * Get the config property: Config information. - * - * @return the config value. - */ - public Object config() { - return this.config; - } - - /** - * Set the config property: Config information. - * - * @param config the config value to set. - * @return the FunctionEnvelopeProperties object itself. - */ - public FunctionEnvelopeProperties withConfig(Object config) { - this.config = config; - return this; - } - - /** - * Get the files property: File list. - * - * @return the files value. - */ - public Map files() { - return this.files; - } - - /** - * Set the files property: File list. - * - * @param files the files value to set. - * @return the FunctionEnvelopeProperties object itself. - */ - public FunctionEnvelopeProperties withFiles(Map files) { - this.files = files; - return this; - } - - /** - * Get the testData property: Test data used when testing via the Azure Portal. - * - * @return the testData value. - */ - public String testData() { - return this.testData; - } - - /** - * Set the testData property: Test data used when testing via the Azure Portal. - * - * @param testData the testData value to set. - * @return the FunctionEnvelopeProperties object itself. - */ - public FunctionEnvelopeProperties withTestData(String testData) { - this.testData = testData; - return this; - } - - /** - * Get the invokeUrlTemplate property: The invocation URL. - * - * @return the invokeUrlTemplate value. - */ - public String invokeUrlTemplate() { - return this.invokeUrlTemplate; - } - - /** - * Set the invokeUrlTemplate property: The invocation URL. - * - * @param invokeUrlTemplate the invokeUrlTemplate value to set. - * @return the FunctionEnvelopeProperties object itself. - */ - public FunctionEnvelopeProperties withInvokeUrlTemplate(String invokeUrlTemplate) { - this.invokeUrlTemplate = invokeUrlTemplate; - return this; - } - - /** - * Get the language property: The function language. - * - * @return the language value. - */ - public String language() { - return this.language; - } - - /** - * Set the language property: The function language. - * - * @param language the language value to set. - * @return the FunctionEnvelopeProperties object itself. - */ - public FunctionEnvelopeProperties withLanguage(String language) { - this.language = language; - return this; - } - - /** - * Get the isDisabled property: Value indicating whether the function is disabled. - * - * @return the isDisabled value. - */ - public Boolean isDisabled() { - return this.isDisabled; - } - - /** - * Set the isDisabled property: Value indicating whether the function is disabled. - * - * @param isDisabled the isDisabled value to set. - * @return the FunctionEnvelopeProperties object itself. - */ - public FunctionEnvelopeProperties withIsDisabled(Boolean isDisabled) { - this.isDisabled = isDisabled; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/FunctionSecretsInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/FunctionSecretsInner.java deleted file mode 100644 index 03199aedc377..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/FunctionSecretsInner.java +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.ProxyOnlyResource; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Function secrets. */ -@Fluent -public final class FunctionSecretsInner extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(FunctionSecretsInner.class); - - /* - * FunctionSecrets resource specific properties - */ - @JsonProperty(value = "properties") - private FunctionSecretsProperties innerProperties; - - /** - * Get the innerProperties property: FunctionSecrets resource specific properties. - * - * @return the innerProperties value. - */ - private FunctionSecretsProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public FunctionSecretsInner withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the key property: Secret key. - * - * @return the key value. - */ - public String key() { - return this.innerProperties() == null ? null : this.innerProperties().key(); - } - - /** - * Set the key property: Secret key. - * - * @param key the key value to set. - * @return the FunctionSecretsInner object itself. - */ - public FunctionSecretsInner withKey(String key) { - if (this.innerProperties() == null) { - this.innerProperties = new FunctionSecretsProperties(); - } - this.innerProperties().withKey(key); - return this; - } - - /** - * Get the triggerUrl property: Trigger URL. - * - * @return the triggerUrl value. - */ - public String triggerUrl() { - return this.innerProperties() == null ? null : this.innerProperties().triggerUrl(); - } - - /** - * Set the triggerUrl property: Trigger URL. - * - * @param triggerUrl the triggerUrl value to set. - * @return the FunctionSecretsInner object itself. - */ - public FunctionSecretsInner withTriggerUrl(String triggerUrl) { - if (this.innerProperties() == null) { - this.innerProperties = new FunctionSecretsProperties(); - } - this.innerProperties().withTriggerUrl(triggerUrl); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/FunctionSecretsProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/FunctionSecretsProperties.java deleted file mode 100644 index bfe4535833ce..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/FunctionSecretsProperties.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** FunctionSecrets resource specific properties. */ -@Fluent -public final class FunctionSecretsProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(FunctionSecretsProperties.class); - - /* - * Secret key. - */ - @JsonProperty(value = "key") - private String key; - - /* - * Trigger URL. - */ - @JsonProperty(value = "trigger_url") - private String triggerUrl; - - /** - * Get the key property: Secret key. - * - * @return the key value. - */ - public String key() { - return this.key; - } - - /** - * Set the key property: Secret key. - * - * @param key the key value to set. - * @return the FunctionSecretsProperties object itself. - */ - public FunctionSecretsProperties withKey(String key) { - this.key = key; - return this; - } - - /** - * Get the triggerUrl property: Trigger URL. - * - * @return the triggerUrl value. - */ - public String triggerUrl() { - return this.triggerUrl; - } - - /** - * Set the triggerUrl property: Trigger URL. - * - * @param triggerUrl the triggerUrl value to set. - * @return the FunctionSecretsProperties object itself. - */ - public FunctionSecretsProperties withTriggerUrl(String triggerUrl) { - this.triggerUrl = triggerUrl; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/GeoRegionInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/GeoRegionInner.java deleted file mode 100644 index 957db4fca321..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/GeoRegionInner.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.ProxyOnlyResource; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Geographical region. */ -@Fluent -public final class GeoRegionInner extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(GeoRegionInner.class); - - /* - * GeoRegion resource specific properties - */ - @JsonProperty(value = "properties") - private GeoRegionProperties innerProperties; - - /** - * Get the innerProperties property: GeoRegion resource specific properties. - * - * @return the innerProperties value. - */ - private GeoRegionProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public GeoRegionInner withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the description property: Region description. - * - * @return the description value. - */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); - } - - /** - * Get the displayName property: Display name for region. - * - * @return the displayName value. - */ - public String displayName() { - return this.innerProperties() == null ? null : this.innerProperties().displayName(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/GeoRegionProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/GeoRegionProperties.java deleted file mode 100644 index b0b189813ee0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/GeoRegionProperties.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** GeoRegion resource specific properties. */ -@Immutable -public final class GeoRegionProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(GeoRegionProperties.class); - - /* - * Region description. - */ - @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) - private String description; - - /* - * Display name for region. - */ - @JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY) - private String displayName; - - /** - * Get the description property: Region description. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Get the displayName property: Display name for region. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/HostKeysInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/HostKeysInner.java deleted file mode 100644 index bbd5a4cc5529..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/HostKeysInner.java +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** Functions host level keys. */ -@Fluent -public final class HostKeysInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(HostKeysInner.class); - - /* - * Secret key. - */ - @JsonProperty(value = "masterKey") - private String masterKey; - - /* - * Host level function keys. - */ - @JsonProperty(value = "functionKeys") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map functionKeys; - - /* - * System keys. - */ - @JsonProperty(value = "systemKeys") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map systemKeys; - - /** - * Get the masterKey property: Secret key. - * - * @return the masterKey value. - */ - public String masterKey() { - return this.masterKey; - } - - /** - * Set the masterKey property: Secret key. - * - * @param masterKey the masterKey value to set. - * @return the HostKeysInner object itself. - */ - public HostKeysInner withMasterKey(String masterKey) { - this.masterKey = masterKey; - return this; - } - - /** - * Get the functionKeys property: Host level function keys. - * - * @return the functionKeys value. - */ - public Map functionKeys() { - return this.functionKeys; - } - - /** - * Set the functionKeys property: Host level function keys. - * - * @param functionKeys the functionKeys value to set. - * @return the HostKeysInner object itself. - */ - public HostKeysInner withFunctionKeys(Map functionKeys) { - this.functionKeys = functionKeys; - return this; - } - - /** - * Get the systemKeys property: System keys. - * - * @return the systemKeys value. - */ - public Map systemKeys() { - return this.systemKeys; - } - - /** - * Set the systemKeys property: System keys. - * - * @param systemKeys the systemKeys value to set. - * @return the HostKeysInner object itself. - */ - public HostKeysInner withSystemKeys(Map systemKeys) { - this.systemKeys = systemKeys; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/HostingEnvironmentDiagnosticsInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/HostingEnvironmentDiagnosticsInner.java deleted file mode 100644 index 67efd39296c5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/HostingEnvironmentDiagnosticsInner.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Diagnostics for an App Service Environment. */ -@Fluent -public final class HostingEnvironmentDiagnosticsInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(HostingEnvironmentDiagnosticsInner.class); - - /* - * Name/identifier of the diagnostics. - */ - @JsonProperty(value = "name") - private String name; - - /* - * Diagnostics output. - */ - @JsonProperty(value = "diagnosicsOutput") - private String diagnosicsOutput; - - /** - * Get the name property: Name/identifier of the diagnostics. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Name/identifier of the diagnostics. - * - * @param name the name value to set. - * @return the HostingEnvironmentDiagnosticsInner object itself. - */ - public HostingEnvironmentDiagnosticsInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the diagnosicsOutput property: Diagnostics output. - * - * @return the diagnosicsOutput value. - */ - public String diagnosicsOutput() { - return this.diagnosicsOutput; - } - - /** - * Set the diagnosicsOutput property: Diagnostics output. - * - * @param diagnosicsOutput the diagnosicsOutput value to set. - * @return the HostingEnvironmentDiagnosticsInner object itself. - */ - public HostingEnvironmentDiagnosticsInner withDiagnosicsOutput(String diagnosicsOutput) { - this.diagnosicsOutput = diagnosicsOutput; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/HostnameBindingInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/HostnameBindingInner.java deleted file mode 100644 index 01c194e56bf5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/HostnameBindingInner.java +++ /dev/null @@ -1,250 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.AzureResourceType; -import com.azure.resourcemanager.appservice.models.CustomHostnameDnsRecordType; -import com.azure.resourcemanager.appservice.models.HostnameType; -import com.azure.resourcemanager.appservice.models.ProxyOnlyResource; -import com.azure.resourcemanager.appservice.models.SslState; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** A hostname binding object. */ -@Fluent -public final class HostnameBindingInner extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(HostnameBindingInner.class); - - /* - * HostNameBinding resource specific properties - */ - @JsonProperty(value = "properties") - private HostnameBindingProperties innerProperties; - - /** - * Get the innerProperties property: HostNameBinding resource specific properties. - * - * @return the innerProperties value. - */ - private HostnameBindingProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public HostnameBindingInner withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the siteName property: App Service app name. - * - * @return the siteName value. - */ - public String siteName() { - return this.innerProperties() == null ? null : this.innerProperties().siteName(); - } - - /** - * Set the siteName property: App Service app name. - * - * @param siteName the siteName value to set. - * @return the HostnameBindingInner object itself. - */ - public HostnameBindingInner withSiteName(String siteName) { - if (this.innerProperties() == null) { - this.innerProperties = new HostnameBindingProperties(); - } - this.innerProperties().withSiteName(siteName); - return this; - } - - /** - * Get the domainId property: Fully qualified ARM domain resource URI. - * - * @return the domainId value. - */ - public String domainId() { - return this.innerProperties() == null ? null : this.innerProperties().domainId(); - } - - /** - * Set the domainId property: Fully qualified ARM domain resource URI. - * - * @param domainId the domainId value to set. - * @return the HostnameBindingInner object itself. - */ - public HostnameBindingInner withDomainId(String domainId) { - if (this.innerProperties() == null) { - this.innerProperties = new HostnameBindingProperties(); - } - this.innerProperties().withDomainId(domainId); - return this; - } - - /** - * Get the azureResourceName property: Azure resource name. - * - * @return the azureResourceName value. - */ - public String azureResourceName() { - return this.innerProperties() == null ? null : this.innerProperties().azureResourceName(); - } - - /** - * Set the azureResourceName property: Azure resource name. - * - * @param azureResourceName the azureResourceName value to set. - * @return the HostnameBindingInner object itself. - */ - public HostnameBindingInner withAzureResourceName(String azureResourceName) { - if (this.innerProperties() == null) { - this.innerProperties = new HostnameBindingProperties(); - } - this.innerProperties().withAzureResourceName(azureResourceName); - return this; - } - - /** - * Get the azureResourceType property: Azure resource type. - * - * @return the azureResourceType value. - */ - public AzureResourceType azureResourceType() { - return this.innerProperties() == null ? null : this.innerProperties().azureResourceType(); - } - - /** - * Set the azureResourceType property: Azure resource type. - * - * @param azureResourceType the azureResourceType value to set. - * @return the HostnameBindingInner object itself. - */ - public HostnameBindingInner withAzureResourceType(AzureResourceType azureResourceType) { - if (this.innerProperties() == null) { - this.innerProperties = new HostnameBindingProperties(); - } - this.innerProperties().withAzureResourceType(azureResourceType); - return this; - } - - /** - * Get the customHostnameDnsRecordType property: Custom DNS record type. - * - * @return the customHostnameDnsRecordType value. - */ - public CustomHostnameDnsRecordType customHostnameDnsRecordType() { - return this.innerProperties() == null ? null : this.innerProperties().customHostnameDnsRecordType(); - } - - /** - * Set the customHostnameDnsRecordType property: Custom DNS record type. - * - * @param customHostnameDnsRecordType the customHostnameDnsRecordType value to set. - * @return the HostnameBindingInner object itself. - */ - public HostnameBindingInner withCustomHostnameDnsRecordType( - CustomHostnameDnsRecordType customHostnameDnsRecordType) { - if (this.innerProperties() == null) { - this.innerProperties = new HostnameBindingProperties(); - } - this.innerProperties().withCustomHostnameDnsRecordType(customHostnameDnsRecordType); - return this; - } - - /** - * Get the hostnameType property: Hostname type. - * - * @return the hostnameType value. - */ - public HostnameType hostnameType() { - return this.innerProperties() == null ? null : this.innerProperties().hostnameType(); - } - - /** - * Set the hostnameType property: Hostname type. - * - * @param hostnameType the hostnameType value to set. - * @return the HostnameBindingInner object itself. - */ - public HostnameBindingInner withHostnameType(HostnameType hostnameType) { - if (this.innerProperties() == null) { - this.innerProperties = new HostnameBindingProperties(); - } - this.innerProperties().withHostnameType(hostnameType); - return this; - } - - /** - * Get the sslState property: SSL type. - * - * @return the sslState value. - */ - public SslState sslState() { - return this.innerProperties() == null ? null : this.innerProperties().sslState(); - } - - /** - * Set the sslState property: SSL type. - * - * @param sslState the sslState value to set. - * @return the HostnameBindingInner object itself. - */ - public HostnameBindingInner withSslState(SslState sslState) { - if (this.innerProperties() == null) { - this.innerProperties = new HostnameBindingProperties(); - } - this.innerProperties().withSslState(sslState); - return this; - } - - /** - * Get the thumbprint property: SSL certificate thumbprint. - * - * @return the thumbprint value. - */ - public String thumbprint() { - return this.innerProperties() == null ? null : this.innerProperties().thumbprint(); - } - - /** - * Set the thumbprint property: SSL certificate thumbprint. - * - * @param thumbprint the thumbprint value to set. - * @return the HostnameBindingInner object itself. - */ - public HostnameBindingInner withThumbprint(String thumbprint) { - if (this.innerProperties() == null) { - this.innerProperties = new HostnameBindingProperties(); - } - this.innerProperties().withThumbprint(thumbprint); - return this; - } - - /** - * Get the virtualIp property: Virtual IP address assigned to the hostname if IP based SSL is enabled. - * - * @return the virtualIp value. - */ - public String virtualIp() { - return this.innerProperties() == null ? null : this.innerProperties().virtualIp(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/HostnameBindingProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/HostnameBindingProperties.java deleted file mode 100644 index 95cbe146b944..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/HostnameBindingProperties.java +++ /dev/null @@ -1,252 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.AzureResourceType; -import com.azure.resourcemanager.appservice.models.CustomHostnameDnsRecordType; -import com.azure.resourcemanager.appservice.models.HostnameType; -import com.azure.resourcemanager.appservice.models.SslState; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** HostNameBinding resource specific properties. */ -@Fluent -public final class HostnameBindingProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(HostnameBindingProperties.class); - - /* - * App Service app name. - */ - @JsonProperty(value = "siteName") - private String siteName; - - /* - * Fully qualified ARM domain resource URI. - */ - @JsonProperty(value = "domainId") - private String domainId; - - /* - * Azure resource name. - */ - @JsonProperty(value = "azureResourceName") - private String azureResourceName; - - /* - * Azure resource type. - */ - @JsonProperty(value = "azureResourceType") - private AzureResourceType azureResourceType; - - /* - * Custom DNS record type. - */ - @JsonProperty(value = "customHostNameDnsRecordType") - private CustomHostnameDnsRecordType customHostnameDnsRecordType; - - /* - * Hostname type. - */ - @JsonProperty(value = "hostNameType") - private HostnameType hostnameType; - - /* - * SSL type - */ - @JsonProperty(value = "sslState") - private SslState sslState; - - /* - * SSL certificate thumbprint - */ - @JsonProperty(value = "thumbprint") - private String thumbprint; - - /* - * Virtual IP address assigned to the hostname if IP based SSL is enabled. - */ - @JsonProperty(value = "virtualIP", access = JsonProperty.Access.WRITE_ONLY) - private String virtualIp; - - /** - * Get the siteName property: App Service app name. - * - * @return the siteName value. - */ - public String siteName() { - return this.siteName; - } - - /** - * Set the siteName property: App Service app name. - * - * @param siteName the siteName value to set. - * @return the HostnameBindingProperties object itself. - */ - public HostnameBindingProperties withSiteName(String siteName) { - this.siteName = siteName; - return this; - } - - /** - * Get the domainId property: Fully qualified ARM domain resource URI. - * - * @return the domainId value. - */ - public String domainId() { - return this.domainId; - } - - /** - * Set the domainId property: Fully qualified ARM domain resource URI. - * - * @param domainId the domainId value to set. - * @return the HostnameBindingProperties object itself. - */ - public HostnameBindingProperties withDomainId(String domainId) { - this.domainId = domainId; - return this; - } - - /** - * Get the azureResourceName property: Azure resource name. - * - * @return the azureResourceName value. - */ - public String azureResourceName() { - return this.azureResourceName; - } - - /** - * Set the azureResourceName property: Azure resource name. - * - * @param azureResourceName the azureResourceName value to set. - * @return the HostnameBindingProperties object itself. - */ - public HostnameBindingProperties withAzureResourceName(String azureResourceName) { - this.azureResourceName = azureResourceName; - return this; - } - - /** - * Get the azureResourceType property: Azure resource type. - * - * @return the azureResourceType value. - */ - public AzureResourceType azureResourceType() { - return this.azureResourceType; - } - - /** - * Set the azureResourceType property: Azure resource type. - * - * @param azureResourceType the azureResourceType value to set. - * @return the HostnameBindingProperties object itself. - */ - public HostnameBindingProperties withAzureResourceType(AzureResourceType azureResourceType) { - this.azureResourceType = azureResourceType; - return this; - } - - /** - * Get the customHostnameDnsRecordType property: Custom DNS record type. - * - * @return the customHostnameDnsRecordType value. - */ - public CustomHostnameDnsRecordType customHostnameDnsRecordType() { - return this.customHostnameDnsRecordType; - } - - /** - * Set the customHostnameDnsRecordType property: Custom DNS record type. - * - * @param customHostnameDnsRecordType the customHostnameDnsRecordType value to set. - * @return the HostnameBindingProperties object itself. - */ - public HostnameBindingProperties withCustomHostnameDnsRecordType( - CustomHostnameDnsRecordType customHostnameDnsRecordType) { - this.customHostnameDnsRecordType = customHostnameDnsRecordType; - return this; - } - - /** - * Get the hostnameType property: Hostname type. - * - * @return the hostnameType value. - */ - public HostnameType hostnameType() { - return this.hostnameType; - } - - /** - * Set the hostnameType property: Hostname type. - * - * @param hostnameType the hostnameType value to set. - * @return the HostnameBindingProperties object itself. - */ - public HostnameBindingProperties withHostnameType(HostnameType hostnameType) { - this.hostnameType = hostnameType; - return this; - } - - /** - * Get the sslState property: SSL type. - * - * @return the sslState value. - */ - public SslState sslState() { - return this.sslState; - } - - /** - * Set the sslState property: SSL type. - * - * @param sslState the sslState value to set. - * @return the HostnameBindingProperties object itself. - */ - public HostnameBindingProperties withSslState(SslState sslState) { - this.sslState = sslState; - return this; - } - - /** - * Get the thumbprint property: SSL certificate thumbprint. - * - * @return the thumbprint value. - */ - public String thumbprint() { - return this.thumbprint; - } - - /** - * Set the thumbprint property: SSL certificate thumbprint. - * - * @param thumbprint the thumbprint value to set. - * @return the HostnameBindingProperties object itself. - */ - public HostnameBindingProperties withThumbprint(String thumbprint) { - this.thumbprint = thumbprint; - return this; - } - - /** - * Get the virtualIp property: Virtual IP address assigned to the hostname if IP based SSL is enabled. - * - * @return the virtualIp value. - */ - public String virtualIp() { - return this.virtualIp; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/HybridConnectionInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/HybridConnectionInner.java deleted file mode 100644 index 75f1f7185474..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/HybridConnectionInner.java +++ /dev/null @@ -1,242 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.ProxyOnlyResource; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Hybrid Connection contract. This is used to configure a Hybrid Connection. */ -@Fluent -public final class HybridConnectionInner extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(HybridConnectionInner.class); - - /* - * HybridConnection resource specific properties - */ - @JsonProperty(value = "properties") - private HybridConnectionProperties innerProperties; - - /** - * Get the innerProperties property: HybridConnection resource specific properties. - * - * @return the innerProperties value. - */ - private HybridConnectionProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public HybridConnectionInner withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the serviceBusNamespace property: The name of the Service Bus namespace. - * - * @return the serviceBusNamespace value. - */ - public String serviceBusNamespace() { - return this.innerProperties() == null ? null : this.innerProperties().serviceBusNamespace(); - } - - /** - * Set the serviceBusNamespace property: The name of the Service Bus namespace. - * - * @param serviceBusNamespace the serviceBusNamespace value to set. - * @return the HybridConnectionInner object itself. - */ - public HybridConnectionInner withServiceBusNamespace(String serviceBusNamespace) { - if (this.innerProperties() == null) { - this.innerProperties = new HybridConnectionProperties(); - } - this.innerProperties().withServiceBusNamespace(serviceBusNamespace); - return this; - } - - /** - * Get the relayName property: The name of the Service Bus relay. - * - * @return the relayName value. - */ - public String relayName() { - return this.innerProperties() == null ? null : this.innerProperties().relayName(); - } - - /** - * Set the relayName property: The name of the Service Bus relay. - * - * @param relayName the relayName value to set. - * @return the HybridConnectionInner object itself. - */ - public HybridConnectionInner withRelayName(String relayName) { - if (this.innerProperties() == null) { - this.innerProperties = new HybridConnectionProperties(); - } - this.innerProperties().withRelayName(relayName); - return this; - } - - /** - * Get the relayArmUri property: The ARM URI to the Service Bus relay. - * - * @return the relayArmUri value. - */ - public String relayArmUri() { - return this.innerProperties() == null ? null : this.innerProperties().relayArmUri(); - } - - /** - * Set the relayArmUri property: The ARM URI to the Service Bus relay. - * - * @param relayArmUri the relayArmUri value to set. - * @return the HybridConnectionInner object itself. - */ - public HybridConnectionInner withRelayArmUri(String relayArmUri) { - if (this.innerProperties() == null) { - this.innerProperties = new HybridConnectionProperties(); - } - this.innerProperties().withRelayArmUri(relayArmUri); - return this; - } - - /** - * Get the hostname property: The hostname of the endpoint. - * - * @return the hostname value. - */ - public String hostname() { - return this.innerProperties() == null ? null : this.innerProperties().hostname(); - } - - /** - * Set the hostname property: The hostname of the endpoint. - * - * @param hostname the hostname value to set. - * @return the HybridConnectionInner object itself. - */ - public HybridConnectionInner withHostname(String hostname) { - if (this.innerProperties() == null) { - this.innerProperties = new HybridConnectionProperties(); - } - this.innerProperties().withHostname(hostname); - return this; - } - - /** - * Get the port property: The port of the endpoint. - * - * @return the port value. - */ - public Integer port() { - return this.innerProperties() == null ? null : this.innerProperties().port(); - } - - /** - * Set the port property: The port of the endpoint. - * - * @param port the port value to set. - * @return the HybridConnectionInner object itself. - */ - public HybridConnectionInner withPort(Integer port) { - if (this.innerProperties() == null) { - this.innerProperties = new HybridConnectionProperties(); - } - this.innerProperties().withPort(port); - return this; - } - - /** - * Get the sendKeyName property: The name of the Service Bus key which has Send permissions. This is used to - * authenticate to Service Bus. - * - * @return the sendKeyName value. - */ - public String sendKeyName() { - return this.innerProperties() == null ? null : this.innerProperties().sendKeyName(); - } - - /** - * Set the sendKeyName property: The name of the Service Bus key which has Send permissions. This is used to - * authenticate to Service Bus. - * - * @param sendKeyName the sendKeyName value to set. - * @return the HybridConnectionInner object itself. - */ - public HybridConnectionInner withSendKeyName(String sendKeyName) { - if (this.innerProperties() == null) { - this.innerProperties = new HybridConnectionProperties(); - } - this.innerProperties().withSendKeyName(sendKeyName); - return this; - } - - /** - * Get the sendKeyValue property: The value of the Service Bus key. This is used to authenticate to Service Bus. In - * ARM this key will not be returned normally, use the POST /listKeys API instead. - * - * @return the sendKeyValue value. - */ - public String sendKeyValue() { - return this.innerProperties() == null ? null : this.innerProperties().sendKeyValue(); - } - - /** - * Set the sendKeyValue property: The value of the Service Bus key. This is used to authenticate to Service Bus. In - * ARM this key will not be returned normally, use the POST /listKeys API instead. - * - * @param sendKeyValue the sendKeyValue value to set. - * @return the HybridConnectionInner object itself. - */ - public HybridConnectionInner withSendKeyValue(String sendKeyValue) { - if (this.innerProperties() == null) { - this.innerProperties = new HybridConnectionProperties(); - } - this.innerProperties().withSendKeyValue(sendKeyValue); - return this; - } - - /** - * Get the serviceBusSuffix property: The suffix for the service bus endpoint. By default this is - * .servicebus.windows.net. - * - * @return the serviceBusSuffix value. - */ - public String serviceBusSuffix() { - return this.innerProperties() == null ? null : this.innerProperties().serviceBusSuffix(); - } - - /** - * Set the serviceBusSuffix property: The suffix for the service bus endpoint. By default this is - * .servicebus.windows.net. - * - * @param serviceBusSuffix the serviceBusSuffix value to set. - * @return the HybridConnectionInner object itself. - */ - public HybridConnectionInner withServiceBusSuffix(String serviceBusSuffix) { - if (this.innerProperties() == null) { - this.innerProperties = new HybridConnectionProperties(); - } - this.innerProperties().withServiceBusSuffix(serviceBusSuffix); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/HybridConnectionKeyInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/HybridConnectionKeyInner.java deleted file mode 100644 index 64ecb8708378..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/HybridConnectionKeyInner.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.ProxyOnlyResource; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Hybrid Connection key contract. This has the send key name and value for a Hybrid Connection. */ -@Fluent -public final class HybridConnectionKeyInner extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(HybridConnectionKeyInner.class); - - /* - * HybridConnectionKey resource specific properties - */ - @JsonProperty(value = "properties") - private HybridConnectionKeyProperties innerProperties; - - /** - * Get the innerProperties property: HybridConnectionKey resource specific properties. - * - * @return the innerProperties value. - */ - private HybridConnectionKeyProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public HybridConnectionKeyInner withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the sendKeyName property: The name of the send key. - * - * @return the sendKeyName value. - */ - public String sendKeyName() { - return this.innerProperties() == null ? null : this.innerProperties().sendKeyName(); - } - - /** - * Get the sendKeyValue property: The value of the send key. - * - * @return the sendKeyValue value. - */ - public String sendKeyValue() { - return this.innerProperties() == null ? null : this.innerProperties().sendKeyValue(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/HybridConnectionKeyProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/HybridConnectionKeyProperties.java deleted file mode 100644 index 5e64c9e87109..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/HybridConnectionKeyProperties.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** HybridConnectionKey resource specific properties. */ -@Immutable -public final class HybridConnectionKeyProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(HybridConnectionKeyProperties.class); - - /* - * The name of the send key. - */ - @JsonProperty(value = "sendKeyName", access = JsonProperty.Access.WRITE_ONLY) - private String sendKeyName; - - /* - * The value of the send key. - */ - @JsonProperty(value = "sendKeyValue", access = JsonProperty.Access.WRITE_ONLY) - private String sendKeyValue; - - /** - * Get the sendKeyName property: The name of the send key. - * - * @return the sendKeyName value. - */ - public String sendKeyName() { - return this.sendKeyName; - } - - /** - * Get the sendKeyValue property: The value of the send key. - * - * @return the sendKeyValue value. - */ - public String sendKeyValue() { - return this.sendKeyValue; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/HybridConnectionLimitsInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/HybridConnectionLimitsInner.java deleted file mode 100644 index 90eba5eb1a0a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/HybridConnectionLimitsInner.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.ProxyOnlyResource; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Hybrid Connection limits contract. This is used to return the plan limits of Hybrid Connections. */ -@Fluent -public final class HybridConnectionLimitsInner extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(HybridConnectionLimitsInner.class); - - /* - * HybridConnectionLimits resource specific properties - */ - @JsonProperty(value = "properties") - private HybridConnectionLimitsProperties innerProperties; - - /** - * Get the innerProperties property: HybridConnectionLimits resource specific properties. - * - * @return the innerProperties value. - */ - private HybridConnectionLimitsProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public HybridConnectionLimitsInner withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the current property: The current number of Hybrid Connections. - * - * @return the current value. - */ - public Integer current() { - return this.innerProperties() == null ? null : this.innerProperties().current(); - } - - /** - * Get the maximum property: The maximum number of Hybrid Connections allowed. - * - * @return the maximum value. - */ - public Integer maximum() { - return this.innerProperties() == null ? null : this.innerProperties().maximum(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/HybridConnectionLimitsProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/HybridConnectionLimitsProperties.java deleted file mode 100644 index fde0c4b27567..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/HybridConnectionLimitsProperties.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** HybridConnectionLimits resource specific properties. */ -@Immutable -public final class HybridConnectionLimitsProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(HybridConnectionLimitsProperties.class); - - /* - * The current number of Hybrid Connections. - */ - @JsonProperty(value = "current", access = JsonProperty.Access.WRITE_ONLY) - private Integer current; - - /* - * The maximum number of Hybrid Connections allowed. - */ - @JsonProperty(value = "maximum", access = JsonProperty.Access.WRITE_ONLY) - private Integer maximum; - - /** - * Get the current property: The current number of Hybrid Connections. - * - * @return the current value. - */ - public Integer current() { - return this.current; - } - - /** - * Get the maximum property: The maximum number of Hybrid Connections allowed. - * - * @return the maximum value. - */ - public Integer maximum() { - return this.maximum; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/HybridConnectionProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/HybridConnectionProperties.java deleted file mode 100644 index d42693ba75c5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/HybridConnectionProperties.java +++ /dev/null @@ -1,242 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** HybridConnection resource specific properties. */ -@Fluent -public final class HybridConnectionProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(HybridConnectionProperties.class); - - /* - * The name of the Service Bus namespace. - */ - @JsonProperty(value = "serviceBusNamespace") - private String serviceBusNamespace; - - /* - * The name of the Service Bus relay. - */ - @JsonProperty(value = "relayName") - private String relayName; - - /* - * The ARM URI to the Service Bus relay. - */ - @JsonProperty(value = "relayArmUri") - private String relayArmUri; - - /* - * The hostname of the endpoint. - */ - @JsonProperty(value = "hostname") - private String hostname; - - /* - * The port of the endpoint. - */ - @JsonProperty(value = "port") - private Integer port; - - /* - * The name of the Service Bus key which has Send permissions. This is used - * to authenticate to Service Bus. - */ - @JsonProperty(value = "sendKeyName") - private String sendKeyName; - - /* - * The value of the Service Bus key. This is used to authenticate to - * Service Bus. In ARM this key will not be returned - * normally, use the POST /listKeys API instead. - */ - @JsonProperty(value = "sendKeyValue") - private String sendKeyValue; - - /* - * The suffix for the service bus endpoint. By default this is - * .servicebus.windows.net - */ - @JsonProperty(value = "serviceBusSuffix") - private String serviceBusSuffix; - - /** - * Get the serviceBusNamespace property: The name of the Service Bus namespace. - * - * @return the serviceBusNamespace value. - */ - public String serviceBusNamespace() { - return this.serviceBusNamespace; - } - - /** - * Set the serviceBusNamespace property: The name of the Service Bus namespace. - * - * @param serviceBusNamespace the serviceBusNamespace value to set. - * @return the HybridConnectionProperties object itself. - */ - public HybridConnectionProperties withServiceBusNamespace(String serviceBusNamespace) { - this.serviceBusNamespace = serviceBusNamespace; - return this; - } - - /** - * Get the relayName property: The name of the Service Bus relay. - * - * @return the relayName value. - */ - public String relayName() { - return this.relayName; - } - - /** - * Set the relayName property: The name of the Service Bus relay. - * - * @param relayName the relayName value to set. - * @return the HybridConnectionProperties object itself. - */ - public HybridConnectionProperties withRelayName(String relayName) { - this.relayName = relayName; - return this; - } - - /** - * Get the relayArmUri property: The ARM URI to the Service Bus relay. - * - * @return the relayArmUri value. - */ - public String relayArmUri() { - return this.relayArmUri; - } - - /** - * Set the relayArmUri property: The ARM URI to the Service Bus relay. - * - * @param relayArmUri the relayArmUri value to set. - * @return the HybridConnectionProperties object itself. - */ - public HybridConnectionProperties withRelayArmUri(String relayArmUri) { - this.relayArmUri = relayArmUri; - return this; - } - - /** - * Get the hostname property: The hostname of the endpoint. - * - * @return the hostname value. - */ - public String hostname() { - return this.hostname; - } - - /** - * Set the hostname property: The hostname of the endpoint. - * - * @param hostname the hostname value to set. - * @return the HybridConnectionProperties object itself. - */ - public HybridConnectionProperties withHostname(String hostname) { - this.hostname = hostname; - return this; - } - - /** - * Get the port property: The port of the endpoint. - * - * @return the port value. - */ - public Integer port() { - return this.port; - } - - /** - * Set the port property: The port of the endpoint. - * - * @param port the port value to set. - * @return the HybridConnectionProperties object itself. - */ - public HybridConnectionProperties withPort(Integer port) { - this.port = port; - return this; - } - - /** - * Get the sendKeyName property: The name of the Service Bus key which has Send permissions. This is used to - * authenticate to Service Bus. - * - * @return the sendKeyName value. - */ - public String sendKeyName() { - return this.sendKeyName; - } - - /** - * Set the sendKeyName property: The name of the Service Bus key which has Send permissions. This is used to - * authenticate to Service Bus. - * - * @param sendKeyName the sendKeyName value to set. - * @return the HybridConnectionProperties object itself. - */ - public HybridConnectionProperties withSendKeyName(String sendKeyName) { - this.sendKeyName = sendKeyName; - return this; - } - - /** - * Get the sendKeyValue property: The value of the Service Bus key. This is used to authenticate to Service Bus. In - * ARM this key will not be returned normally, use the POST /listKeys API instead. - * - * @return the sendKeyValue value. - */ - public String sendKeyValue() { - return this.sendKeyValue; - } - - /** - * Set the sendKeyValue property: The value of the Service Bus key. This is used to authenticate to Service Bus. In - * ARM this key will not be returned normally, use the POST /listKeys API instead. - * - * @param sendKeyValue the sendKeyValue value to set. - * @return the HybridConnectionProperties object itself. - */ - public HybridConnectionProperties withSendKeyValue(String sendKeyValue) { - this.sendKeyValue = sendKeyValue; - return this; - } - - /** - * Get the serviceBusSuffix property: The suffix for the service bus endpoint. By default this is - * .servicebus.windows.net. - * - * @return the serviceBusSuffix value. - */ - public String serviceBusSuffix() { - return this.serviceBusSuffix; - } - - /** - * Set the serviceBusSuffix property: The suffix for the service bus endpoint. By default this is - * .servicebus.windows.net. - * - * @param serviceBusSuffix the serviceBusSuffix value to set. - * @return the HybridConnectionProperties object itself. - */ - public HybridConnectionProperties withServiceBusSuffix(String serviceBusSuffix) { - this.serviceBusSuffix = serviceBusSuffix; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/IdentifierInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/IdentifierInner.java deleted file mode 100644 index d54ef7319d35..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/IdentifierInner.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.ProxyOnlyResource; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** A domain specific resource identifier. */ -@Fluent -public final class IdentifierInner extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(IdentifierInner.class); - - /* - * Identifier resource specific properties - */ - @JsonProperty(value = "properties") - private IdentifierProperties innerProperties; - - /** - * Get the innerProperties property: Identifier resource specific properties. - * - * @return the innerProperties value. - */ - private IdentifierProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public IdentifierInner withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the value property: String representation of the identity. - * - * @return the value value. - */ - public String value() { - return this.innerProperties() == null ? null : this.innerProperties().value(); - } - - /** - * Set the value property: String representation of the identity. - * - * @param value the value value to set. - * @return the IdentifierInner object itself. - */ - public IdentifierInner withValue(String value) { - if (this.innerProperties() == null) { - this.innerProperties = new IdentifierProperties(); - } - this.innerProperties().withValue(value); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/IdentifierProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/IdentifierProperties.java deleted file mode 100644 index f3027b33a091..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/IdentifierProperties.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Identifier resource specific properties. */ -@Fluent -public final class IdentifierProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(IdentifierProperties.class); - - /* - * String representation of the identity. - */ - @JsonProperty(value = "id") - private String value; - - /** - * Get the value property: String representation of the identity. - * - * @return the value value. - */ - public String value() { - return this.value; - } - - /** - * Set the value property: String representation of the identity. - * - * @param value the value value to set. - * @return the IdentifierProperties object itself. - */ - public IdentifierProperties withValue(String value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/InboundEnvironmentEndpointInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/InboundEnvironmentEndpointInner.java deleted file mode 100644 index 91a78f804058..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/InboundEnvironmentEndpointInner.java +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** - * The IP Addresses and Ports that require inbound network access to and within the subnet of the App Service - * Environment. - */ -@Fluent -public final class InboundEnvironmentEndpointInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(InboundEnvironmentEndpointInner.class); - - /* - * Short text describing the purpose of the network traffic. - */ - @JsonProperty(value = "description") - private String description; - - /* - * The IP addresses that network traffic will originate from in cidr - * notation. - */ - @JsonProperty(value = "endpoints") - private List endpoints; - - /* - * The ports that network traffic will arrive to the App Service - * Environment at. - */ - @JsonProperty(value = "ports") - private List ports; - - /** - * Get the description property: Short text describing the purpose of the network traffic. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: Short text describing the purpose of the network traffic. - * - * @param description the description value to set. - * @return the InboundEnvironmentEndpointInner object itself. - */ - public InboundEnvironmentEndpointInner withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the endpoints property: The IP addresses that network traffic will originate from in cidr notation. - * - * @return the endpoints value. - */ - public List endpoints() { - return this.endpoints; - } - - /** - * Set the endpoints property: The IP addresses that network traffic will originate from in cidr notation. - * - * @param endpoints the endpoints value to set. - * @return the InboundEnvironmentEndpointInner object itself. - */ - public InboundEnvironmentEndpointInner withEndpoints(List endpoints) { - this.endpoints = endpoints; - return this; - } - - /** - * Get the ports property: The ports that network traffic will arrive to the App Service Environment at. - * - * @return the ports value. - */ - public List ports() { - return this.ports; - } - - /** - * Set the ports property: The ports that network traffic will arrive to the App Service Environment at. - * - * @param ports the ports value to set. - * @return the InboundEnvironmentEndpointInner object itself. - */ - public InboundEnvironmentEndpointInner withPorts(List ports) { - this.ports = ports; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/KeyInfoInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/KeyInfoInner.java deleted file mode 100644 index d623df2aafa4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/KeyInfoInner.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Function key info. */ -@Fluent -public final class KeyInfoInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(KeyInfoInner.class); - - /* - * Key name - */ - @JsonProperty(value = "name") - private String name; - - /* - * Key value - */ - @JsonProperty(value = "value") - private String value; - - /** - * Get the name property: Key name. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Key name. - * - * @param name the name value to set. - * @return the KeyInfoInner object itself. - */ - public KeyInfoInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the value property: Key value. - * - * @return the value value. - */ - public String value() { - return this.value; - } - - /** - * Set the value property: Key value. - * - * @param value the value value to set. - * @return the KeyInfoInner object itself. - */ - public KeyInfoInner withValue(String value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/MSDeployLogInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/MSDeployLogInner.java deleted file mode 100644 index 633ae8b49659..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/MSDeployLogInner.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.MSDeployLogEntry; -import com.azure.resourcemanager.appservice.models.ProxyOnlyResource; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** MSDeploy log. */ -@Fluent -public final class MSDeployLogInner extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MSDeployLogInner.class); - - /* - * MSDeployLog resource specific properties - */ - @JsonProperty(value = "properties") - private MSDeployLogProperties innerProperties; - - /** - * Get the innerProperties property: MSDeployLog resource specific properties. - * - * @return the innerProperties value. - */ - private MSDeployLogProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public MSDeployLogInner withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the entries property: List of log entry messages. - * - * @return the entries value. - */ - public List entries() { - return this.innerProperties() == null ? null : this.innerProperties().entries(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/MSDeployLogProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/MSDeployLogProperties.java deleted file mode 100644 index b2e28ade9a49..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/MSDeployLogProperties.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.MSDeployLogEntry; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** MSDeployLog resource specific properties. */ -@Immutable -public final class MSDeployLogProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MSDeployLogProperties.class); - - /* - * List of log entry messages - */ - @JsonProperty(value = "entries", access = JsonProperty.Access.WRITE_ONLY) - private List entries; - - /** - * Get the entries property: List of log entry messages. - * - * @return the entries value. - */ - public List entries() { - return this.entries; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (entries() != null) { - entries().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/MSDeployProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/MSDeployProperties.java deleted file mode 100644 index c695835a5596..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/MSDeployProperties.java +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.MSDeployCore; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** Core resource properties. */ -@Fluent -public final class MSDeployProperties extends MSDeployCore { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MSDeployProperties.class); - - /* - * List of Add-On packages. Add-On packages implicitly enable the Do Not - * Delete MSDeploy rule. - */ - @JsonProperty(value = "addOnPackages") - private List addOnPackages; - - /** - * Get the addOnPackages property: List of Add-On packages. Add-On packages implicitly enable the Do Not Delete - * MSDeploy rule. - * - * @return the addOnPackages value. - */ - public List addOnPackages() { - return this.addOnPackages; - } - - /** - * Set the addOnPackages property: List of Add-On packages. Add-On packages implicitly enable the Do Not Delete - * MSDeploy rule. - * - * @param addOnPackages the addOnPackages value to set. - * @return the MSDeployProperties object itself. - */ - public MSDeployProperties withAddOnPackages(List addOnPackages) { - this.addOnPackages = addOnPackages; - return this; - } - - /** {@inheritDoc} */ - @Override - public MSDeployProperties withPackageUri(String packageUri) { - super.withPackageUri(packageUri); - return this; - } - - /** {@inheritDoc} */ - @Override - public MSDeployProperties withConnectionString(String connectionString) { - super.withConnectionString(connectionString); - return this; - } - - /** {@inheritDoc} */ - @Override - public MSDeployProperties withDbType(String dbType) { - super.withDbType(dbType); - return this; - } - - /** {@inheritDoc} */ - @Override - public MSDeployProperties withSetParametersXmlFileUri(String setParametersXmlFileUri) { - super.withSetParametersXmlFileUri(setParametersXmlFileUri); - return this; - } - - /** {@inheritDoc} */ - @Override - public MSDeployProperties withSetParameters(Map setParameters) { - super.withSetParameters(setParameters); - return this; - } - - /** {@inheritDoc} */ - @Override - public MSDeployProperties withSkipAppData(Boolean skipAppData) { - super.withSkipAppData(skipAppData); - return this; - } - - /** {@inheritDoc} */ - @Override - public MSDeployProperties withAppOffline(Boolean appOffline) { - super.withAppOffline(appOffline); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (addOnPackages() != null) { - addOnPackages().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/MSDeployStatusInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/MSDeployStatusInner.java deleted file mode 100644 index 9b4ab82f0072..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/MSDeployStatusInner.java +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.MSDeployProvisioningState; -import com.azure.resourcemanager.appservice.models.ProxyOnlyResource; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** MSDeploy ARM response. */ -@Fluent -public final class MSDeployStatusInner extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MSDeployStatusInner.class); - - /* - * MSDeployStatus resource specific properties - */ - @JsonProperty(value = "properties") - private MSDeployStatusProperties innerProperties; - - /** - * Get the innerProperties property: MSDeployStatus resource specific properties. - * - * @return the innerProperties value. - */ - private MSDeployStatusProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public MSDeployStatusInner withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the deployer property: Username of deployer. - * - * @return the deployer value. - */ - public String deployer() { - return this.innerProperties() == null ? null : this.innerProperties().deployer(); - } - - /** - * Get the provisioningState property: Provisioning state. - * - * @return the provisioningState value. - */ - public MSDeployProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the startTime property: Start time of deploy operation. - * - * @return the startTime value. - */ - public OffsetDateTime startTime() { - return this.innerProperties() == null ? null : this.innerProperties().startTime(); - } - - /** - * Get the endTime property: End time of deploy operation. - * - * @return the endTime value. - */ - public OffsetDateTime endTime() { - return this.innerProperties() == null ? null : this.innerProperties().endTime(); - } - - /** - * Get the complete property: Whether the deployment operation has completed. - * - * @return the complete value. - */ - public Boolean complete() { - return this.innerProperties() == null ? null : this.innerProperties().complete(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/MSDeployStatusProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/MSDeployStatusProperties.java deleted file mode 100644 index 51d03fdb74cb..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/MSDeployStatusProperties.java +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.MSDeployProvisioningState; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** MSDeployStatus resource specific properties. */ -@Immutable -public final class MSDeployStatusProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MSDeployStatusProperties.class); - - /* - * Username of deployer - */ - @JsonProperty(value = "deployer", access = JsonProperty.Access.WRITE_ONLY) - private String deployer; - - /* - * Provisioning state - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private MSDeployProvisioningState provisioningState; - - /* - * Start time of deploy operation - */ - @JsonProperty(value = "startTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime startTime; - - /* - * End time of deploy operation - */ - @JsonProperty(value = "endTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime endTime; - - /* - * Whether the deployment operation has completed - */ - @JsonProperty(value = "complete", access = JsonProperty.Access.WRITE_ONLY) - private Boolean complete; - - /** - * Get the deployer property: Username of deployer. - * - * @return the deployer value. - */ - public String deployer() { - return this.deployer; - } - - /** - * Get the provisioningState property: Provisioning state. - * - * @return the provisioningState value. - */ - public MSDeployProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Get the startTime property: Start time of deploy operation. - * - * @return the startTime value. - */ - public OffsetDateTime startTime() { - return this.startTime; - } - - /** - * Get the endTime property: End time of deploy operation. - * - * @return the endTime value. - */ - public OffsetDateTime endTime() { - return this.endTime; - } - - /** - * Get the complete property: Whether the deployment operation has completed. - * - * @return the complete value. - */ - public Boolean complete() { - return this.complete; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/MetricDefinitionInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/MetricDefinitionInner.java deleted file mode 100644 index ed570fbca4f0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/MetricDefinitionInner.java +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.MetricAvailabilily; -import com.azure.resourcemanager.appservice.models.ProxyOnlyResource; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Metadata for a metric. */ -@Fluent -public final class MetricDefinitionInner extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MetricDefinitionInner.class); - - /* - * MetricDefinition resource specific properties - */ - @JsonProperty(value = "properties") - private MetricDefinitionProperties innerProperties; - - /** - * Get the innerProperties property: MetricDefinition resource specific properties. - * - * @return the innerProperties value. - */ - private MetricDefinitionProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public MetricDefinitionInner withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the unit property: Unit of the metric. - * - * @return the unit value. - */ - public String unit() { - return this.innerProperties() == null ? null : this.innerProperties().unit(); - } - - /** - * Get the primaryAggregationType property: Primary aggregation type. - * - * @return the primaryAggregationType value. - */ - public String primaryAggregationType() { - return this.innerProperties() == null ? null : this.innerProperties().primaryAggregationType(); - } - - /** - * Get the metricAvailabilities property: List of time grains supported for the metric together with retention - * period. - * - * @return the metricAvailabilities value. - */ - public List metricAvailabilities() { - return this.innerProperties() == null ? null : this.innerProperties().metricAvailabilities(); - } - - /** - * Get the displayName property: Friendly name shown in the UI. - * - * @return the displayName value. - */ - public String displayName() { - return this.innerProperties() == null ? null : this.innerProperties().displayName(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/MetricDefinitionProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/MetricDefinitionProperties.java deleted file mode 100644 index 1ded53ff8d86..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/MetricDefinitionProperties.java +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.MetricAvailabilily; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** MetricDefinition resource specific properties. */ -@Immutable -public final class MetricDefinitionProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MetricDefinitionProperties.class); - - /* - * Unit of the metric. - */ - @JsonProperty(value = "unit", access = JsonProperty.Access.WRITE_ONLY) - private String unit; - - /* - * Primary aggregation type. - */ - @JsonProperty(value = "primaryAggregationType", access = JsonProperty.Access.WRITE_ONLY) - private String primaryAggregationType; - - /* - * List of time grains supported for the metric together with retention - * period. - */ - @JsonProperty(value = "metricAvailabilities", access = JsonProperty.Access.WRITE_ONLY) - private List metricAvailabilities; - - /* - * Friendly name shown in the UI. - */ - @JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY) - private String displayName; - - /** - * Get the unit property: Unit of the metric. - * - * @return the unit value. - */ - public String unit() { - return this.unit; - } - - /** - * Get the primaryAggregationType property: Primary aggregation type. - * - * @return the primaryAggregationType value. - */ - public String primaryAggregationType() { - return this.primaryAggregationType; - } - - /** - * Get the metricAvailabilities property: List of time grains supported for the metric together with retention - * period. - * - * @return the metricAvailabilities value. - */ - public List metricAvailabilities() { - return this.metricAvailabilities; - } - - /** - * Get the displayName property: Friendly name shown in the UI. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (metricAvailabilities() != null) { - metricAvailabilities().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/MigrateMySqlRequestProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/MigrateMySqlRequestProperties.java deleted file mode 100644 index 9a93fd59e8ab..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/MigrateMySqlRequestProperties.java +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.MySqlMigrationType; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** MigrateMySqlRequest resource specific properties. */ -@Fluent -public final class MigrateMySqlRequestProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateMySqlRequestProperties.class); - - /* - * Connection string to the remote MySQL database. - */ - @JsonProperty(value = "connectionString", required = true) - private String connectionString; - - /* - * The type of migration operation to be done - */ - @JsonProperty(value = "migrationType", required = true) - private MySqlMigrationType migrationType; - - /** - * Get the connectionString property: Connection string to the remote MySQL database. - * - * @return the connectionString value. - */ - public String connectionString() { - return this.connectionString; - } - - /** - * Set the connectionString property: Connection string to the remote MySQL database. - * - * @param connectionString the connectionString value to set. - * @return the MigrateMySqlRequestProperties object itself. - */ - public MigrateMySqlRequestProperties withConnectionString(String connectionString) { - this.connectionString = connectionString; - return this; - } - - /** - * Get the migrationType property: The type of migration operation to be done. - * - * @return the migrationType value. - */ - public MySqlMigrationType migrationType() { - return this.migrationType; - } - - /** - * Set the migrationType property: The type of migration operation to be done. - * - * @param migrationType the migrationType value to set. - * @return the MigrateMySqlRequestProperties object itself. - */ - public MigrateMySqlRequestProperties withMigrationType(MySqlMigrationType migrationType) { - this.migrationType = migrationType; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (connectionString() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property connectionString in model MigrateMySqlRequestProperties")); - } - if (migrationType() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property migrationType in model MigrateMySqlRequestProperties")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/MigrateMySqlStatusInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/MigrateMySqlStatusInner.java deleted file mode 100644 index a28cfaef9d8b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/MigrateMySqlStatusInner.java +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.OperationStatus; -import com.azure.resourcemanager.appservice.models.ProxyOnlyResource; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** MySQL migration status. */ -@Fluent -public final class MigrateMySqlStatusInner extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateMySqlStatusInner.class); - - /* - * MigrateMySqlStatus resource specific properties - */ - @JsonProperty(value = "properties") - private MigrateMySqlStatusProperties innerProperties; - - /** - * Get the innerProperties property: MigrateMySqlStatus resource specific properties. - * - * @return the innerProperties value. - */ - private MigrateMySqlStatusProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public MigrateMySqlStatusInner withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the migrationOperationStatus property: Status of the migration task. - * - * @return the migrationOperationStatus value. - */ - public OperationStatus migrationOperationStatus() { - return this.innerProperties() == null ? null : this.innerProperties().migrationOperationStatus(); - } - - /** - * Get the operationId property: Operation ID for the migration task. - * - * @return the operationId value. - */ - public String operationId() { - return this.innerProperties() == null ? null : this.innerProperties().operationId(); - } - - /** - * Get the localMySqlEnabled property: True if the web app has in app MySql enabled. - * - * @return the localMySqlEnabled value. - */ - public Boolean localMySqlEnabled() { - return this.innerProperties() == null ? null : this.innerProperties().localMySqlEnabled(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/MigrateMySqlStatusProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/MigrateMySqlStatusProperties.java deleted file mode 100644 index 853b2bc56278..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/MigrateMySqlStatusProperties.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.OperationStatus; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** MigrateMySqlStatus resource specific properties. */ -@Immutable -public final class MigrateMySqlStatusProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateMySqlStatusProperties.class); - - /* - * Status of the migration task. - */ - @JsonProperty(value = "migrationOperationStatus", access = JsonProperty.Access.WRITE_ONLY) - private OperationStatus migrationOperationStatus; - - /* - * Operation ID for the migration task. - */ - @JsonProperty(value = "operationId", access = JsonProperty.Access.WRITE_ONLY) - private String operationId; - - /* - * True if the web app has in app MySql enabled - */ - @JsonProperty(value = "localMySqlEnabled", access = JsonProperty.Access.WRITE_ONLY) - private Boolean localMySqlEnabled; - - /** - * Get the migrationOperationStatus property: Status of the migration task. - * - * @return the migrationOperationStatus value. - */ - public OperationStatus migrationOperationStatus() { - return this.migrationOperationStatus; - } - - /** - * Get the operationId property: Operation ID for the migration task. - * - * @return the operationId value. - */ - public String operationId() { - return this.operationId; - } - - /** - * Get the localMySqlEnabled property: True if the web app has in app MySql enabled. - * - * @return the localMySqlEnabled value. - */ - public Boolean localMySqlEnabled() { - return this.localMySqlEnabled; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/NameIdentifierInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/NameIdentifierInner.java deleted file mode 100644 index f3d2c43f3eae..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/NameIdentifierInner.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Identifies an object. */ -@Fluent -public final class NameIdentifierInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(NameIdentifierInner.class); - - /* - * Name of the object. - */ - @JsonProperty(value = "name") - private String name; - - /** - * Get the name property: Name of the object. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Name of the object. - * - * @param name the name value to set. - * @return the NameIdentifierInner object itself. - */ - public NameIdentifierInner withName(String name) { - this.name = name; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/NetworkFeaturesInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/NetworkFeaturesInner.java deleted file mode 100644 index 44fe7775b31a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/NetworkFeaturesInner.java +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.ProxyOnlyResource; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Full view of network features for an app (presently VNET integration and Hybrid Connections). */ -@Fluent -public final class NetworkFeaturesInner extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkFeaturesInner.class); - - /* - * NetworkFeatures resource specific properties - */ - @JsonProperty(value = "properties") - private NetworkFeaturesPropertiesInner innerProperties; - - /** - * Get the innerProperties property: NetworkFeatures resource specific properties. - * - * @return the innerProperties value. - */ - private NetworkFeaturesPropertiesInner innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public NetworkFeaturesInner withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the virtualNetworkName property: The Virtual Network name. - * - * @return the virtualNetworkName value. - */ - public String virtualNetworkName() { - return this.innerProperties() == null ? null : this.innerProperties().virtualNetworkName(); - } - - /** - * Get the virtualNetworkConnection property: The Virtual Network summary view. - * - * @return the virtualNetworkConnection value. - */ - public VnetInfoInner virtualNetworkConnection() { - return this.innerProperties() == null ? null : this.innerProperties().virtualNetworkConnection(); - } - - /** - * Get the hybridConnections property: The Hybrid Connections summary view. - * - * @return the hybridConnections value. - */ - public List hybridConnections() { - return this.innerProperties() == null ? null : this.innerProperties().hybridConnections(); - } - - /** - * Get the hybridConnectionsV2 property: The Hybrid Connection V2 (Service Bus) view. - * - * @return the hybridConnectionsV2 value. - */ - public List hybridConnectionsV2() { - return this.innerProperties() == null ? null : this.innerProperties().hybridConnectionsV2(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/NetworkFeaturesPropertiesInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/NetworkFeaturesPropertiesInner.java deleted file mode 100644 index 499a043b9c77..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/NetworkFeaturesPropertiesInner.java +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** NetworkFeatures resource specific properties. */ -@Immutable -public final class NetworkFeaturesPropertiesInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkFeaturesPropertiesInner.class); - - /* - * The Virtual Network name. - */ - @JsonProperty(value = "virtualNetworkName", access = JsonProperty.Access.WRITE_ONLY) - private String virtualNetworkName; - - /* - * The Virtual Network summary view. - */ - @JsonProperty(value = "virtualNetworkConnection", access = JsonProperty.Access.WRITE_ONLY) - private VnetInfoInner virtualNetworkConnection; - - /* - * The Hybrid Connections summary view. - */ - @JsonProperty(value = "hybridConnections", access = JsonProperty.Access.WRITE_ONLY) - private List hybridConnections; - - /* - * The Hybrid Connection V2 (Service Bus) view. - */ - @JsonProperty(value = "hybridConnectionsV2", access = JsonProperty.Access.WRITE_ONLY) - private List hybridConnectionsV2; - - /** - * Get the virtualNetworkName property: The Virtual Network name. - * - * @return the virtualNetworkName value. - */ - public String virtualNetworkName() { - return this.virtualNetworkName; - } - - /** - * Get the virtualNetworkConnection property: The Virtual Network summary view. - * - * @return the virtualNetworkConnection value. - */ - public VnetInfoInner virtualNetworkConnection() { - return this.virtualNetworkConnection; - } - - /** - * Get the hybridConnections property: The Hybrid Connections summary view. - * - * @return the hybridConnections value. - */ - public List hybridConnections() { - return this.hybridConnections; - } - - /** - * Get the hybridConnectionsV2 property: The Hybrid Connection V2 (Service Bus) view. - * - * @return the hybridConnectionsV2 value. - */ - public List hybridConnectionsV2() { - return this.hybridConnectionsV2; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (virtualNetworkConnection() != null) { - virtualNetworkConnection().validate(); - } - if (hybridConnections() != null) { - hybridConnections().forEach(e -> e.validate()); - } - if (hybridConnectionsV2() != null) { - hybridConnectionsV2().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/NetworkTraceInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/NetworkTraceInner.java deleted file mode 100644 index 4330a3f3fd12..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/NetworkTraceInner.java +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Network trace. */ -@Fluent -public final class NetworkTraceInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkTraceInner.class); - - /* - * Local file path for the captured network trace file. - */ - @JsonProperty(value = "path") - private String path; - - /* - * Current status of the network trace operation, same as Operation.Status - * (InProgress/Succeeded/Failed). - */ - @JsonProperty(value = "status") - private String status; - - /* - * Detailed message of a network trace operation, e.g. error message in - * case of failure. - */ - @JsonProperty(value = "message") - private String message; - - /** - * Get the path property: Local file path for the captured network trace file. - * - * @return the path value. - */ - public String path() { - return this.path; - } - - /** - * Set the path property: Local file path for the captured network trace file. - * - * @param path the path value to set. - * @return the NetworkTraceInner object itself. - */ - public NetworkTraceInner withPath(String path) { - this.path = path; - return this; - } - - /** - * Get the status property: Current status of the network trace operation, same as Operation.Status - * (InProgress/Succeeded/Failed). - * - * @return the status value. - */ - public String status() { - return this.status; - } - - /** - * Set the status property: Current status of the network trace operation, same as Operation.Status - * (InProgress/Succeeded/Failed). - * - * @param status the status value to set. - * @return the NetworkTraceInner object itself. - */ - public NetworkTraceInner withStatus(String status) { - this.status = status; - return this; - } - - /** - * Get the message property: Detailed message of a network trace operation, e.g. error message in case of failure. - * - * @return the message value. - */ - public String message() { - return this.message; - } - - /** - * Set the message property: Detailed message of a network trace operation, e.g. error message in case of failure. - * - * @param message the message value to set. - * @return the NetworkTraceInner object itself. - */ - public NetworkTraceInner withMessage(String message) { - this.message = message; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/OperationInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/OperationInner.java deleted file mode 100644 index b03ee50a9d89..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/OperationInner.java +++ /dev/null @@ -1,240 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.ErrorEntity; -import com.azure.resourcemanager.appservice.models.OperationStatus; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; -import java.util.UUID; - -/** An operation on a resource. */ -@Fluent -public final class OperationInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationInner.class); - - /* - * Operation ID. - */ - @JsonProperty(value = "id") - private String id; - - /* - * Operation name. - */ - @JsonProperty(value = "name") - private String name; - - /* - * The current status of the operation. - */ - @JsonProperty(value = "status") - private OperationStatus status; - - /* - * Any errors associate with the operation. - */ - @JsonProperty(value = "errors") - private List errors; - - /* - * Time when operation has started. - */ - @JsonProperty(value = "createdTime") - private OffsetDateTime createdTime; - - /* - * Time when operation has been updated. - */ - @JsonProperty(value = "modifiedTime") - private OffsetDateTime modifiedTime; - - /* - * Time when operation will expire. - */ - @JsonProperty(value = "expirationTime") - private OffsetDateTime expirationTime; - - /* - * Applicable only for stamp operation ids. - */ - @JsonProperty(value = "geoMasterOperationId") - private UUID geoMasterOperationId; - - /** - * Get the id property: Operation ID. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: Operation ID. - * - * @param id the id value to set. - * @return the OperationInner object itself. - */ - public OperationInner withId(String id) { - this.id = id; - return this; - } - - /** - * Get the name property: Operation name. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Operation name. - * - * @param name the name value to set. - * @return the OperationInner object itself. - */ - public OperationInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the status property: The current status of the operation. - * - * @return the status value. - */ - public OperationStatus status() { - return this.status; - } - - /** - * Set the status property: The current status of the operation. - * - * @param status the status value to set. - * @return the OperationInner object itself. - */ - public OperationInner withStatus(OperationStatus status) { - this.status = status; - return this; - } - - /** - * Get the errors property: Any errors associate with the operation. - * - * @return the errors value. - */ - public List errors() { - return this.errors; - } - - /** - * Set the errors property: Any errors associate with the operation. - * - * @param errors the errors value to set. - * @return the OperationInner object itself. - */ - public OperationInner withErrors(List errors) { - this.errors = errors; - return this; - } - - /** - * Get the createdTime property: Time when operation has started. - * - * @return the createdTime value. - */ - public OffsetDateTime createdTime() { - return this.createdTime; - } - - /** - * Set the createdTime property: Time when operation has started. - * - * @param createdTime the createdTime value to set. - * @return the OperationInner object itself. - */ - public OperationInner withCreatedTime(OffsetDateTime createdTime) { - this.createdTime = createdTime; - return this; - } - - /** - * Get the modifiedTime property: Time when operation has been updated. - * - * @return the modifiedTime value. - */ - public OffsetDateTime modifiedTime() { - return this.modifiedTime; - } - - /** - * Set the modifiedTime property: Time when operation has been updated. - * - * @param modifiedTime the modifiedTime value to set. - * @return the OperationInner object itself. - */ - public OperationInner withModifiedTime(OffsetDateTime modifiedTime) { - this.modifiedTime = modifiedTime; - return this; - } - - /** - * Get the expirationTime property: Time when operation will expire. - * - * @return the expirationTime value. - */ - public OffsetDateTime expirationTime() { - return this.expirationTime; - } - - /** - * Set the expirationTime property: Time when operation will expire. - * - * @param expirationTime the expirationTime value to set. - * @return the OperationInner object itself. - */ - public OperationInner withExpirationTime(OffsetDateTime expirationTime) { - this.expirationTime = expirationTime; - return this; - } - - /** - * Get the geoMasterOperationId property: Applicable only for stamp operation ids. - * - * @return the geoMasterOperationId value. - */ - public UUID geoMasterOperationId() { - return this.geoMasterOperationId; - } - - /** - * Set the geoMasterOperationId property: Applicable only for stamp operation ids. - * - * @param geoMasterOperationId the geoMasterOperationId value to set. - * @return the OperationInner object itself. - */ - public OperationInner withGeoMasterOperationId(UUID geoMasterOperationId) { - this.geoMasterOperationId = geoMasterOperationId; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (errors() != null) { - errors().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/OutboundEnvironmentEndpointInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/OutboundEnvironmentEndpointInner.java deleted file mode 100644 index a4774f28c7f1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/OutboundEnvironmentEndpointInner.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.EndpointDependency; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Endpoints accessed for a common purpose that the App Service Environment requires outbound network access to. */ -@Fluent -public final class OutboundEnvironmentEndpointInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OutboundEnvironmentEndpointInner.class); - - /* - * The type of service accessed by the App Service Environment, e.g., Azure - * Storage, Azure SQL Database, and Azure Active Directory. - */ - @JsonProperty(value = "category") - private String category; - - /* - * The endpoints that the App Service Environment reaches the service at. - */ - @JsonProperty(value = "endpoints") - private List endpoints; - - /** - * Get the category property: The type of service accessed by the App Service Environment, e.g., Azure Storage, - * Azure SQL Database, and Azure Active Directory. - * - * @return the category value. - */ - public String category() { - return this.category; - } - - /** - * Set the category property: The type of service accessed by the App Service Environment, e.g., Azure Storage, - * Azure SQL Database, and Azure Active Directory. - * - * @param category the category value to set. - * @return the OutboundEnvironmentEndpointInner object itself. - */ - public OutboundEnvironmentEndpointInner withCategory(String category) { - this.category = category; - return this; - } - - /** - * Get the endpoints property: The endpoints that the App Service Environment reaches the service at. - * - * @return the endpoints value. - */ - public List endpoints() { - return this.endpoints; - } - - /** - * Set the endpoints property: The endpoints that the App Service Environment reaches the service at. - * - * @param endpoints the endpoints value to set. - * @return the OutboundEnvironmentEndpointInner object itself. - */ - public OutboundEnvironmentEndpointInner withEndpoints(List endpoints) { - this.endpoints = endpoints; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (endpoints() != null) { - endpoints().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/PerfMonResponseInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/PerfMonResponseInner.java deleted file mode 100644 index a3ffcf42f343..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/PerfMonResponseInner.java +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.PerfMonSet; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Performance monitor API response. */ -@Fluent -public final class PerfMonResponseInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PerfMonResponseInner.class); - - /* - * The response code. - */ - @JsonProperty(value = "code") - private String code; - - /* - * The message. - */ - @JsonProperty(value = "message") - private String message; - - /* - * The performance monitor counters. - */ - @JsonProperty(value = "data") - private PerfMonSet data; - - /** - * Get the code property: The response code. - * - * @return the code value. - */ - public String code() { - return this.code; - } - - /** - * Set the code property: The response code. - * - * @param code the code value to set. - * @return the PerfMonResponseInner object itself. - */ - public PerfMonResponseInner withCode(String code) { - this.code = code; - return this; - } - - /** - * Get the message property: The message. - * - * @return the message value. - */ - public String message() { - return this.message; - } - - /** - * Set the message property: The message. - * - * @param message the message value to set. - * @return the PerfMonResponseInner object itself. - */ - public PerfMonResponseInner withMessage(String message) { - this.message = message; - return this; - } - - /** - * Get the data property: The performance monitor counters. - * - * @return the data value. - */ - public PerfMonSet data() { - return this.data; - } - - /** - * Set the data property: The performance monitor counters. - * - * @param data the data value to set. - * @return the PerfMonResponseInner object itself. - */ - public PerfMonResponseInner withData(PerfMonSet data) { - this.data = data; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (data() != null) { - data().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/PremierAddOnInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/PremierAddOnInner.java deleted file mode 100644 index a90f53f03641..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/PremierAddOnInner.java +++ /dev/null @@ -1,199 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** Premier add-on. */ -@Fluent -public final class PremierAddOnInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PremierAddOnInner.class); - - /* - * PremierAddOn resource specific properties - */ - @JsonProperty(value = "properties") - private PremierAddOnProperties innerProperties; - - /* - * Kind of resource. - */ - @JsonProperty(value = "kind") - private String kind; - - /** - * Get the innerProperties property: PremierAddOn resource specific properties. - * - * @return the innerProperties value. - */ - private PremierAddOnProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the kind property: Kind of resource. - * - * @return the kind value. - */ - public String kind() { - return this.kind; - } - - /** - * Set the kind property: Kind of resource. - * - * @param kind the kind value to set. - * @return the PremierAddOnInner object itself. - */ - public PremierAddOnInner withKind(String kind) { - this.kind = kind; - return this; - } - - /** {@inheritDoc} */ - @Override - public PremierAddOnInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public PremierAddOnInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the sku property: Premier add on SKU. - * - * @return the sku value. - */ - public String sku() { - return this.innerProperties() == null ? null : this.innerProperties().sku(); - } - - /** - * Set the sku property: Premier add on SKU. - * - * @param sku the sku value to set. - * @return the PremierAddOnInner object itself. - */ - public PremierAddOnInner withSku(String sku) { - if (this.innerProperties() == null) { - this.innerProperties = new PremierAddOnProperties(); - } - this.innerProperties().withSku(sku); - return this; - } - - /** - * Get the product property: Premier add on Product. - * - * @return the product value. - */ - public String product() { - return this.innerProperties() == null ? null : this.innerProperties().product(); - } - - /** - * Set the product property: Premier add on Product. - * - * @param product the product value to set. - * @return the PremierAddOnInner object itself. - */ - public PremierAddOnInner withProduct(String product) { - if (this.innerProperties() == null) { - this.innerProperties = new PremierAddOnProperties(); - } - this.innerProperties().withProduct(product); - return this; - } - - /** - * Get the vendor property: Premier add on Vendor. - * - * @return the vendor value. - */ - public String vendor() { - return this.innerProperties() == null ? null : this.innerProperties().vendor(); - } - - /** - * Set the vendor property: Premier add on Vendor. - * - * @param vendor the vendor value to set. - * @return the PremierAddOnInner object itself. - */ - public PremierAddOnInner withVendor(String vendor) { - if (this.innerProperties() == null) { - this.innerProperties = new PremierAddOnProperties(); - } - this.innerProperties().withVendor(vendor); - return this; - } - - /** - * Get the marketplacePublisher property: Premier add on Marketplace publisher. - * - * @return the marketplacePublisher value. - */ - public String marketplacePublisher() { - return this.innerProperties() == null ? null : this.innerProperties().marketplacePublisher(); - } - - /** - * Set the marketplacePublisher property: Premier add on Marketplace publisher. - * - * @param marketplacePublisher the marketplacePublisher value to set. - * @return the PremierAddOnInner object itself. - */ - public PremierAddOnInner withMarketplacePublisher(String marketplacePublisher) { - if (this.innerProperties() == null) { - this.innerProperties = new PremierAddOnProperties(); - } - this.innerProperties().withMarketplacePublisher(marketplacePublisher); - return this; - } - - /** - * Get the marketplaceOffer property: Premier add on Marketplace offer. - * - * @return the marketplaceOffer value. - */ - public String marketplaceOffer() { - return this.innerProperties() == null ? null : this.innerProperties().marketplaceOffer(); - } - - /** - * Set the marketplaceOffer property: Premier add on Marketplace offer. - * - * @param marketplaceOffer the marketplaceOffer value to set. - * @return the PremierAddOnInner object itself. - */ - public PremierAddOnInner withMarketplaceOffer(String marketplaceOffer) { - if (this.innerProperties() == null) { - this.innerProperties = new PremierAddOnProperties(); - } - this.innerProperties().withMarketplaceOffer(marketplaceOffer); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/PremierAddOnOfferInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/PremierAddOnOfferInner.java deleted file mode 100644 index 35205b05bef3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/PremierAddOnOfferInner.java +++ /dev/null @@ -1,286 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.AppServicePlanRestrictions; -import com.azure.resourcemanager.appservice.models.ProxyOnlyResource; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Premier add-on offer. */ -@Fluent -public final class PremierAddOnOfferInner extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PremierAddOnOfferInner.class); - - /* - * PremierAddOnOffer resource specific properties - */ - @JsonProperty(value = "properties") - private PremierAddOnOfferProperties innerProperties; - - /** - * Get the innerProperties property: PremierAddOnOffer resource specific properties. - * - * @return the innerProperties value. - */ - private PremierAddOnOfferProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public PremierAddOnOfferInner withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the sku property: Premier add on SKU. - * - * @return the sku value. - */ - public String sku() { - return this.innerProperties() == null ? null : this.innerProperties().sku(); - } - - /** - * Set the sku property: Premier add on SKU. - * - * @param sku the sku value to set. - * @return the PremierAddOnOfferInner object itself. - */ - public PremierAddOnOfferInner withSku(String sku) { - if (this.innerProperties() == null) { - this.innerProperties = new PremierAddOnOfferProperties(); - } - this.innerProperties().withSku(sku); - return this; - } - - /** - * Get the product property: Premier add on offer Product. - * - * @return the product value. - */ - public String product() { - return this.innerProperties() == null ? null : this.innerProperties().product(); - } - - /** - * Set the product property: Premier add on offer Product. - * - * @param product the product value to set. - * @return the PremierAddOnOfferInner object itself. - */ - public PremierAddOnOfferInner withProduct(String product) { - if (this.innerProperties() == null) { - this.innerProperties = new PremierAddOnOfferProperties(); - } - this.innerProperties().withProduct(product); - return this; - } - - /** - * Get the vendor property: Premier add on offer Vendor. - * - * @return the vendor value. - */ - public String vendor() { - return this.innerProperties() == null ? null : this.innerProperties().vendor(); - } - - /** - * Set the vendor property: Premier add on offer Vendor. - * - * @param vendor the vendor value to set. - * @return the PremierAddOnOfferInner object itself. - */ - public PremierAddOnOfferInner withVendor(String vendor) { - if (this.innerProperties() == null) { - this.innerProperties = new PremierAddOnOfferProperties(); - } - this.innerProperties().withVendor(vendor); - return this; - } - - /** - * Get the promoCodeRequired property: <code>true</code> if promotion code is required; otherwise, - * <code>false</code>. - * - * @return the promoCodeRequired value. - */ - public Boolean promoCodeRequired() { - return this.innerProperties() == null ? null : this.innerProperties().promoCodeRequired(); - } - - /** - * Set the promoCodeRequired property: <code>true</code> if promotion code is required; otherwise, - * <code>false</code>. - * - * @param promoCodeRequired the promoCodeRequired value to set. - * @return the PremierAddOnOfferInner object itself. - */ - public PremierAddOnOfferInner withPromoCodeRequired(Boolean promoCodeRequired) { - if (this.innerProperties() == null) { - this.innerProperties = new PremierAddOnOfferProperties(); - } - this.innerProperties().withPromoCodeRequired(promoCodeRequired); - return this; - } - - /** - * Get the quota property: Premier add on offer Quota. - * - * @return the quota value. - */ - public Integer quota() { - return this.innerProperties() == null ? null : this.innerProperties().quota(); - } - - /** - * Set the quota property: Premier add on offer Quota. - * - * @param quota the quota value to set. - * @return the PremierAddOnOfferInner object itself. - */ - public PremierAddOnOfferInner withQuota(Integer quota) { - if (this.innerProperties() == null) { - this.innerProperties = new PremierAddOnOfferProperties(); - } - this.innerProperties().withQuota(quota); - return this; - } - - /** - * Get the webHostingPlanRestrictions property: App Service plans this offer is restricted to. - * - * @return the webHostingPlanRestrictions value. - */ - public AppServicePlanRestrictions webHostingPlanRestrictions() { - return this.innerProperties() == null ? null : this.innerProperties().webHostingPlanRestrictions(); - } - - /** - * Set the webHostingPlanRestrictions property: App Service plans this offer is restricted to. - * - * @param webHostingPlanRestrictions the webHostingPlanRestrictions value to set. - * @return the PremierAddOnOfferInner object itself. - */ - public PremierAddOnOfferInner withWebHostingPlanRestrictions( - AppServicePlanRestrictions webHostingPlanRestrictions) { - if (this.innerProperties() == null) { - this.innerProperties = new PremierAddOnOfferProperties(); - } - this.innerProperties().withWebHostingPlanRestrictions(webHostingPlanRestrictions); - return this; - } - - /** - * Get the privacyPolicyUrl property: Privacy policy URL. - * - * @return the privacyPolicyUrl value. - */ - public String privacyPolicyUrl() { - return this.innerProperties() == null ? null : this.innerProperties().privacyPolicyUrl(); - } - - /** - * Set the privacyPolicyUrl property: Privacy policy URL. - * - * @param privacyPolicyUrl the privacyPolicyUrl value to set. - * @return the PremierAddOnOfferInner object itself. - */ - public PremierAddOnOfferInner withPrivacyPolicyUrl(String privacyPolicyUrl) { - if (this.innerProperties() == null) { - this.innerProperties = new PremierAddOnOfferProperties(); - } - this.innerProperties().withPrivacyPolicyUrl(privacyPolicyUrl); - return this; - } - - /** - * Get the legalTermsUrl property: Legal terms URL. - * - * @return the legalTermsUrl value. - */ - public String legalTermsUrl() { - return this.innerProperties() == null ? null : this.innerProperties().legalTermsUrl(); - } - - /** - * Set the legalTermsUrl property: Legal terms URL. - * - * @param legalTermsUrl the legalTermsUrl value to set. - * @return the PremierAddOnOfferInner object itself. - */ - public PremierAddOnOfferInner withLegalTermsUrl(String legalTermsUrl) { - if (this.innerProperties() == null) { - this.innerProperties = new PremierAddOnOfferProperties(); - } - this.innerProperties().withLegalTermsUrl(legalTermsUrl); - return this; - } - - /** - * Get the marketplacePublisher property: Marketplace publisher. - * - * @return the marketplacePublisher value. - */ - public String marketplacePublisher() { - return this.innerProperties() == null ? null : this.innerProperties().marketplacePublisher(); - } - - /** - * Set the marketplacePublisher property: Marketplace publisher. - * - * @param marketplacePublisher the marketplacePublisher value to set. - * @return the PremierAddOnOfferInner object itself. - */ - public PremierAddOnOfferInner withMarketplacePublisher(String marketplacePublisher) { - if (this.innerProperties() == null) { - this.innerProperties = new PremierAddOnOfferProperties(); - } - this.innerProperties().withMarketplacePublisher(marketplacePublisher); - return this; - } - - /** - * Get the marketplaceOffer property: Marketplace offer. - * - * @return the marketplaceOffer value. - */ - public String marketplaceOffer() { - return this.innerProperties() == null ? null : this.innerProperties().marketplaceOffer(); - } - - /** - * Set the marketplaceOffer property: Marketplace offer. - * - * @param marketplaceOffer the marketplaceOffer value to set. - * @return the PremierAddOnOfferInner object itself. - */ - public PremierAddOnOfferInner withMarketplaceOffer(String marketplaceOffer) { - if (this.innerProperties() == null) { - this.innerProperties = new PremierAddOnOfferProperties(); - } - this.innerProperties().withMarketplaceOffer(marketplaceOffer); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/PremierAddOnOfferProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/PremierAddOnOfferProperties.java deleted file mode 100644 index 7d2071aec764..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/PremierAddOnOfferProperties.java +++ /dev/null @@ -1,289 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.AppServicePlanRestrictions; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** PremierAddOnOffer resource specific properties. */ -@Fluent -public final class PremierAddOnOfferProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PremierAddOnOfferProperties.class); - - /* - * Premier add on SKU. - */ - @JsonProperty(value = "sku") - private String sku; - - /* - * Premier add on offer Product. - */ - @JsonProperty(value = "product") - private String product; - - /* - * Premier add on offer Vendor. - */ - @JsonProperty(value = "vendor") - private String vendor; - - /* - * true if promotion code is required; otherwise, - * false. - */ - @JsonProperty(value = "promoCodeRequired") - private Boolean promoCodeRequired; - - /* - * Premier add on offer Quota. - */ - @JsonProperty(value = "quota") - private Integer quota; - - /* - * App Service plans this offer is restricted to. - */ - @JsonProperty(value = "webHostingPlanRestrictions") - private AppServicePlanRestrictions webHostingPlanRestrictions; - - /* - * Privacy policy URL. - */ - @JsonProperty(value = "privacyPolicyUrl") - private String privacyPolicyUrl; - - /* - * Legal terms URL. - */ - @JsonProperty(value = "legalTermsUrl") - private String legalTermsUrl; - - /* - * Marketplace publisher. - */ - @JsonProperty(value = "marketplacePublisher") - private String marketplacePublisher; - - /* - * Marketplace offer. - */ - @JsonProperty(value = "marketplaceOffer") - private String marketplaceOffer; - - /** - * Get the sku property: Premier add on SKU. - * - * @return the sku value. - */ - public String sku() { - return this.sku; - } - - /** - * Set the sku property: Premier add on SKU. - * - * @param sku the sku value to set. - * @return the PremierAddOnOfferProperties object itself. - */ - public PremierAddOnOfferProperties withSku(String sku) { - this.sku = sku; - return this; - } - - /** - * Get the product property: Premier add on offer Product. - * - * @return the product value. - */ - public String product() { - return this.product; - } - - /** - * Set the product property: Premier add on offer Product. - * - * @param product the product value to set. - * @return the PremierAddOnOfferProperties object itself. - */ - public PremierAddOnOfferProperties withProduct(String product) { - this.product = product; - return this; - } - - /** - * Get the vendor property: Premier add on offer Vendor. - * - * @return the vendor value. - */ - public String vendor() { - return this.vendor; - } - - /** - * Set the vendor property: Premier add on offer Vendor. - * - * @param vendor the vendor value to set. - * @return the PremierAddOnOfferProperties object itself. - */ - public PremierAddOnOfferProperties withVendor(String vendor) { - this.vendor = vendor; - return this; - } - - /** - * Get the promoCodeRequired property: <code>true</code> if promotion code is required; otherwise, - * <code>false</code>. - * - * @return the promoCodeRequired value. - */ - public Boolean promoCodeRequired() { - return this.promoCodeRequired; - } - - /** - * Set the promoCodeRequired property: <code>true</code> if promotion code is required; otherwise, - * <code>false</code>. - * - * @param promoCodeRequired the promoCodeRequired value to set. - * @return the PremierAddOnOfferProperties object itself. - */ - public PremierAddOnOfferProperties withPromoCodeRequired(Boolean promoCodeRequired) { - this.promoCodeRequired = promoCodeRequired; - return this; - } - - /** - * Get the quota property: Premier add on offer Quota. - * - * @return the quota value. - */ - public Integer quota() { - return this.quota; - } - - /** - * Set the quota property: Premier add on offer Quota. - * - * @param quota the quota value to set. - * @return the PremierAddOnOfferProperties object itself. - */ - public PremierAddOnOfferProperties withQuota(Integer quota) { - this.quota = quota; - return this; - } - - /** - * Get the webHostingPlanRestrictions property: App Service plans this offer is restricted to. - * - * @return the webHostingPlanRestrictions value. - */ - public AppServicePlanRestrictions webHostingPlanRestrictions() { - return this.webHostingPlanRestrictions; - } - - /** - * Set the webHostingPlanRestrictions property: App Service plans this offer is restricted to. - * - * @param webHostingPlanRestrictions the webHostingPlanRestrictions value to set. - * @return the PremierAddOnOfferProperties object itself. - */ - public PremierAddOnOfferProperties withWebHostingPlanRestrictions( - AppServicePlanRestrictions webHostingPlanRestrictions) { - this.webHostingPlanRestrictions = webHostingPlanRestrictions; - return this; - } - - /** - * Get the privacyPolicyUrl property: Privacy policy URL. - * - * @return the privacyPolicyUrl value. - */ - public String privacyPolicyUrl() { - return this.privacyPolicyUrl; - } - - /** - * Set the privacyPolicyUrl property: Privacy policy URL. - * - * @param privacyPolicyUrl the privacyPolicyUrl value to set. - * @return the PremierAddOnOfferProperties object itself. - */ - public PremierAddOnOfferProperties withPrivacyPolicyUrl(String privacyPolicyUrl) { - this.privacyPolicyUrl = privacyPolicyUrl; - return this; - } - - /** - * Get the legalTermsUrl property: Legal terms URL. - * - * @return the legalTermsUrl value. - */ - public String legalTermsUrl() { - return this.legalTermsUrl; - } - - /** - * Set the legalTermsUrl property: Legal terms URL. - * - * @param legalTermsUrl the legalTermsUrl value to set. - * @return the PremierAddOnOfferProperties object itself. - */ - public PremierAddOnOfferProperties withLegalTermsUrl(String legalTermsUrl) { - this.legalTermsUrl = legalTermsUrl; - return this; - } - - /** - * Get the marketplacePublisher property: Marketplace publisher. - * - * @return the marketplacePublisher value. - */ - public String marketplacePublisher() { - return this.marketplacePublisher; - } - - /** - * Set the marketplacePublisher property: Marketplace publisher. - * - * @param marketplacePublisher the marketplacePublisher value to set. - * @return the PremierAddOnOfferProperties object itself. - */ - public PremierAddOnOfferProperties withMarketplacePublisher(String marketplacePublisher) { - this.marketplacePublisher = marketplacePublisher; - return this; - } - - /** - * Get the marketplaceOffer property: Marketplace offer. - * - * @return the marketplaceOffer value. - */ - public String marketplaceOffer() { - return this.marketplaceOffer; - } - - /** - * Set the marketplaceOffer property: Marketplace offer. - * - * @param marketplaceOffer the marketplaceOffer value to set. - * @return the PremierAddOnOfferProperties object itself. - */ - public PremierAddOnOfferProperties withMarketplaceOffer(String marketplaceOffer) { - this.marketplaceOffer = marketplaceOffer; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/PremierAddOnPatchResourceProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/PremierAddOnPatchResourceProperties.java deleted file mode 100644 index ce8d07f090bb..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/PremierAddOnPatchResourceProperties.java +++ /dev/null @@ -1,154 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** PremierAddOnPatchResource resource specific properties. */ -@Fluent -public final class PremierAddOnPatchResourceProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PremierAddOnPatchResourceProperties.class); - - /* - * Premier add on SKU. - */ - @JsonProperty(value = "sku") - private String sku; - - /* - * Premier add on Product. - */ - @JsonProperty(value = "product") - private String product; - - /* - * Premier add on Vendor. - */ - @JsonProperty(value = "vendor") - private String vendor; - - /* - * Premier add on Marketplace publisher. - */ - @JsonProperty(value = "marketplacePublisher") - private String marketplacePublisher; - - /* - * Premier add on Marketplace offer. - */ - @JsonProperty(value = "marketplaceOffer") - private String marketplaceOffer; - - /** - * Get the sku property: Premier add on SKU. - * - * @return the sku value. - */ - public String sku() { - return this.sku; - } - - /** - * Set the sku property: Premier add on SKU. - * - * @param sku the sku value to set. - * @return the PremierAddOnPatchResourceProperties object itself. - */ - public PremierAddOnPatchResourceProperties withSku(String sku) { - this.sku = sku; - return this; - } - - /** - * Get the product property: Premier add on Product. - * - * @return the product value. - */ - public String product() { - return this.product; - } - - /** - * Set the product property: Premier add on Product. - * - * @param product the product value to set. - * @return the PremierAddOnPatchResourceProperties object itself. - */ - public PremierAddOnPatchResourceProperties withProduct(String product) { - this.product = product; - return this; - } - - /** - * Get the vendor property: Premier add on Vendor. - * - * @return the vendor value. - */ - public String vendor() { - return this.vendor; - } - - /** - * Set the vendor property: Premier add on Vendor. - * - * @param vendor the vendor value to set. - * @return the PremierAddOnPatchResourceProperties object itself. - */ - public PremierAddOnPatchResourceProperties withVendor(String vendor) { - this.vendor = vendor; - return this; - } - - /** - * Get the marketplacePublisher property: Premier add on Marketplace publisher. - * - * @return the marketplacePublisher value. - */ - public String marketplacePublisher() { - return this.marketplacePublisher; - } - - /** - * Set the marketplacePublisher property: Premier add on Marketplace publisher. - * - * @param marketplacePublisher the marketplacePublisher value to set. - * @return the PremierAddOnPatchResourceProperties object itself. - */ - public PremierAddOnPatchResourceProperties withMarketplacePublisher(String marketplacePublisher) { - this.marketplacePublisher = marketplacePublisher; - return this; - } - - /** - * Get the marketplaceOffer property: Premier add on Marketplace offer. - * - * @return the marketplaceOffer value. - */ - public String marketplaceOffer() { - return this.marketplaceOffer; - } - - /** - * Set the marketplaceOffer property: Premier add on Marketplace offer. - * - * @param marketplaceOffer the marketplaceOffer value to set. - * @return the PremierAddOnPatchResourceProperties object itself. - */ - public PremierAddOnPatchResourceProperties withMarketplaceOffer(String marketplaceOffer) { - this.marketplaceOffer = marketplaceOffer; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/PremierAddOnProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/PremierAddOnProperties.java deleted file mode 100644 index 5d9be4f9f6af..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/PremierAddOnProperties.java +++ /dev/null @@ -1,154 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** PremierAddOn resource specific properties. */ -@Fluent -public final class PremierAddOnProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PremierAddOnProperties.class); - - /* - * Premier add on SKU. - */ - @JsonProperty(value = "sku") - private String sku; - - /* - * Premier add on Product. - */ - @JsonProperty(value = "product") - private String product; - - /* - * Premier add on Vendor. - */ - @JsonProperty(value = "vendor") - private String vendor; - - /* - * Premier add on Marketplace publisher. - */ - @JsonProperty(value = "marketplacePublisher") - private String marketplacePublisher; - - /* - * Premier add on Marketplace offer. - */ - @JsonProperty(value = "marketplaceOffer") - private String marketplaceOffer; - - /** - * Get the sku property: Premier add on SKU. - * - * @return the sku value. - */ - public String sku() { - return this.sku; - } - - /** - * Set the sku property: Premier add on SKU. - * - * @param sku the sku value to set. - * @return the PremierAddOnProperties object itself. - */ - public PremierAddOnProperties withSku(String sku) { - this.sku = sku; - return this; - } - - /** - * Get the product property: Premier add on Product. - * - * @return the product value. - */ - public String product() { - return this.product; - } - - /** - * Set the product property: Premier add on Product. - * - * @param product the product value to set. - * @return the PremierAddOnProperties object itself. - */ - public PremierAddOnProperties withProduct(String product) { - this.product = product; - return this; - } - - /** - * Get the vendor property: Premier add on Vendor. - * - * @return the vendor value. - */ - public String vendor() { - return this.vendor; - } - - /** - * Set the vendor property: Premier add on Vendor. - * - * @param vendor the vendor value to set. - * @return the PremierAddOnProperties object itself. - */ - public PremierAddOnProperties withVendor(String vendor) { - this.vendor = vendor; - return this; - } - - /** - * Get the marketplacePublisher property: Premier add on Marketplace publisher. - * - * @return the marketplacePublisher value. - */ - public String marketplacePublisher() { - return this.marketplacePublisher; - } - - /** - * Set the marketplacePublisher property: Premier add on Marketplace publisher. - * - * @param marketplacePublisher the marketplacePublisher value to set. - * @return the PremierAddOnProperties object itself. - */ - public PremierAddOnProperties withMarketplacePublisher(String marketplacePublisher) { - this.marketplacePublisher = marketplacePublisher; - return this; - } - - /** - * Get the marketplaceOffer property: Premier add on Marketplace offer. - * - * @return the marketplaceOffer value. - */ - public String marketplaceOffer() { - return this.marketplaceOffer; - } - - /** - * Set the marketplaceOffer property: Premier add on Marketplace offer. - * - * @param marketplaceOffer the marketplaceOffer value to set. - * @return the PremierAddOnProperties object itself. - */ - public PremierAddOnProperties withMarketplaceOffer(String marketplaceOffer) { - this.marketplaceOffer = marketplaceOffer; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/PrivateAccessInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/PrivateAccessInner.java deleted file mode 100644 index d51fabb5c645..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/PrivateAccessInner.java +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.PrivateAccessVirtualNetwork; -import com.azure.resourcemanager.appservice.models.ProxyOnlyResource; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Description of the parameters of Private Access for a Web Site. */ -@Fluent -public final class PrivateAccessInner extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateAccessInner.class); - - /* - * PrivateAccess resource specific properties - */ - @JsonProperty(value = "properties") - private PrivateAccessProperties innerProperties; - - /** - * Get the innerProperties property: PrivateAccess resource specific properties. - * - * @return the innerProperties value. - */ - private PrivateAccessProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public PrivateAccessInner withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the enabled property: Whether private access is enabled or not. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.innerProperties() == null ? null : this.innerProperties().enabled(); - } - - /** - * Set the enabled property: Whether private access is enabled or not. - * - * @param enabled the enabled value to set. - * @return the PrivateAccessInner object itself. - */ - public PrivateAccessInner withEnabled(Boolean enabled) { - if (this.innerProperties() == null) { - this.innerProperties = new PrivateAccessProperties(); - } - this.innerProperties().withEnabled(enabled); - return this; - } - - /** - * Get the virtualNetworks property: The Virtual Networks (and subnets) allowed to access the site privately. - * - * @return the virtualNetworks value. - */ - public List virtualNetworks() { - return this.innerProperties() == null ? null : this.innerProperties().virtualNetworks(); - } - - /** - * Set the virtualNetworks property: The Virtual Networks (and subnets) allowed to access the site privately. - * - * @param virtualNetworks the virtualNetworks value to set. - * @return the PrivateAccessInner object itself. - */ - public PrivateAccessInner withVirtualNetworks(List virtualNetworks) { - if (this.innerProperties() == null) { - this.innerProperties = new PrivateAccessProperties(); - } - this.innerProperties().withVirtualNetworks(virtualNetworks); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/PrivateAccessProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/PrivateAccessProperties.java deleted file mode 100644 index e13eead07952..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/PrivateAccessProperties.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.PrivateAccessVirtualNetwork; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** PrivateAccess resource specific properties. */ -@Fluent -public final class PrivateAccessProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateAccessProperties.class); - - /* - * Whether private access is enabled or not. - */ - @JsonProperty(value = "enabled") - private Boolean enabled; - - /* - * The Virtual Networks (and subnets) allowed to access the site privately. - */ - @JsonProperty(value = "virtualNetworks") - private List virtualNetworks; - - /** - * Get the enabled property: Whether private access is enabled or not. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Whether private access is enabled or not. - * - * @param enabled the enabled value to set. - * @return the PrivateAccessProperties object itself. - */ - public PrivateAccessProperties withEnabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the virtualNetworks property: The Virtual Networks (and subnets) allowed to access the site privately. - * - * @return the virtualNetworks value. - */ - public List virtualNetworks() { - return this.virtualNetworks; - } - - /** - * Set the virtualNetworks property: The Virtual Networks (and subnets) allowed to access the site privately. - * - * @param virtualNetworks the virtualNetworks value to set. - * @return the PrivateAccessProperties object itself. - */ - public PrivateAccessProperties withVirtualNetworks(List virtualNetworks) { - this.virtualNetworks = virtualNetworks; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (virtualNetworks() != null) { - virtualNetworks().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/ProcessInfoInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/ProcessInfoInner.java deleted file mode 100644 index aad4a3f43b03..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/ProcessInfoInner.java +++ /dev/null @@ -1,869 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.ProxyOnlyResource; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; -import java.util.Map; - -/** Process Information. */ -@Fluent -public final class ProcessInfoInner extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ProcessInfoInner.class); - - /* - * ProcessInfo resource specific properties - */ - @JsonProperty(value = "properties") - private ProcessInfoProperties innerProperties; - - /** - * Get the innerProperties property: ProcessInfo resource specific properties. - * - * @return the innerProperties value. - */ - private ProcessInfoProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public ProcessInfoInner withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the identifier property: ARM Identifier for deployment. - * - * @return the identifier value. - */ - public Integer identifier() { - return this.innerProperties() == null ? null : this.innerProperties().identifier(); - } - - /** - * Get the deploymentName property: Deployment name. - * - * @return the deploymentName value. - */ - public String deploymentName() { - return this.innerProperties() == null ? null : this.innerProperties().deploymentName(); - } - - /** - * Set the deploymentName property: Deployment name. - * - * @param deploymentName the deploymentName value to set. - * @return the ProcessInfoInner object itself. - */ - public ProcessInfoInner withDeploymentName(String deploymentName) { - if (this.innerProperties() == null) { - this.innerProperties = new ProcessInfoProperties(); - } - this.innerProperties().withDeploymentName(deploymentName); - return this; - } - - /** - * Get the href property: HRef URI. - * - * @return the href value. - */ - public String href() { - return this.innerProperties() == null ? null : this.innerProperties().href(); - } - - /** - * Set the href property: HRef URI. - * - * @param href the href value to set. - * @return the ProcessInfoInner object itself. - */ - public ProcessInfoInner withHref(String href) { - if (this.innerProperties() == null) { - this.innerProperties = new ProcessInfoProperties(); - } - this.innerProperties().withHref(href); - return this; - } - - /** - * Get the minidump property: Minidump URI. - * - * @return the minidump value. - */ - public String minidump() { - return this.innerProperties() == null ? null : this.innerProperties().minidump(); - } - - /** - * Set the minidump property: Minidump URI. - * - * @param minidump the minidump value to set. - * @return the ProcessInfoInner object itself. - */ - public ProcessInfoInner withMinidump(String minidump) { - if (this.innerProperties() == null) { - this.innerProperties = new ProcessInfoProperties(); - } - this.innerProperties().withMinidump(minidump); - return this; - } - - /** - * Get the isProfileRunning property: Is profile running?. - * - * @return the isProfileRunning value. - */ - public Boolean isProfileRunning() { - return this.innerProperties() == null ? null : this.innerProperties().isProfileRunning(); - } - - /** - * Set the isProfileRunning property: Is profile running?. - * - * @param isProfileRunning the isProfileRunning value to set. - * @return the ProcessInfoInner object itself. - */ - public ProcessInfoInner withIsProfileRunning(Boolean isProfileRunning) { - if (this.innerProperties() == null) { - this.innerProperties = new ProcessInfoProperties(); - } - this.innerProperties().withIsProfileRunning(isProfileRunning); - return this; - } - - /** - * Get the isIisProfileRunning property: Is the IIS Profile running?. - * - * @return the isIisProfileRunning value. - */ - public Boolean isIisProfileRunning() { - return this.innerProperties() == null ? null : this.innerProperties().isIisProfileRunning(); - } - - /** - * Set the isIisProfileRunning property: Is the IIS Profile running?. - * - * @param isIisProfileRunning the isIisProfileRunning value to set. - * @return the ProcessInfoInner object itself. - */ - public ProcessInfoInner withIsIisProfileRunning(Boolean isIisProfileRunning) { - if (this.innerProperties() == null) { - this.innerProperties = new ProcessInfoProperties(); - } - this.innerProperties().withIsIisProfileRunning(isIisProfileRunning); - return this; - } - - /** - * Get the iisProfileTimeoutInSeconds property: IIS Profile timeout (seconds). - * - * @return the iisProfileTimeoutInSeconds value. - */ - public Double iisProfileTimeoutInSeconds() { - return this.innerProperties() == null ? null : this.innerProperties().iisProfileTimeoutInSeconds(); - } - - /** - * Set the iisProfileTimeoutInSeconds property: IIS Profile timeout (seconds). - * - * @param iisProfileTimeoutInSeconds the iisProfileTimeoutInSeconds value to set. - * @return the ProcessInfoInner object itself. - */ - public ProcessInfoInner withIisProfileTimeoutInSeconds(Double iisProfileTimeoutInSeconds) { - if (this.innerProperties() == null) { - this.innerProperties = new ProcessInfoProperties(); - } - this.innerProperties().withIisProfileTimeoutInSeconds(iisProfileTimeoutInSeconds); - return this; - } - - /** - * Get the parent property: Parent process. - * - * @return the parent value. - */ - public String parent() { - return this.innerProperties() == null ? null : this.innerProperties().parent(); - } - - /** - * Set the parent property: Parent process. - * - * @param parent the parent value to set. - * @return the ProcessInfoInner object itself. - */ - public ProcessInfoInner withParent(String parent) { - if (this.innerProperties() == null) { - this.innerProperties = new ProcessInfoProperties(); - } - this.innerProperties().withParent(parent); - return this; - } - - /** - * Get the children property: Child process list. - * - * @return the children value. - */ - public List children() { - return this.innerProperties() == null ? null : this.innerProperties().children(); - } - - /** - * Set the children property: Child process list. - * - * @param children the children value to set. - * @return the ProcessInfoInner object itself. - */ - public ProcessInfoInner withChildren(List children) { - if (this.innerProperties() == null) { - this.innerProperties = new ProcessInfoProperties(); - } - this.innerProperties().withChildren(children); - return this; - } - - /** - * Get the threads property: Thread list. - * - * @return the threads value. - */ - public List threads() { - return this.innerProperties() == null ? null : this.innerProperties().threads(); - } - - /** - * Set the threads property: Thread list. - * - * @param threads the threads value to set. - * @return the ProcessInfoInner object itself. - */ - public ProcessInfoInner withThreads(List threads) { - if (this.innerProperties() == null) { - this.innerProperties = new ProcessInfoProperties(); - } - this.innerProperties().withThreads(threads); - return this; - } - - /** - * Get the openFileHandles property: List of open files. - * - * @return the openFileHandles value. - */ - public List openFileHandles() { - return this.innerProperties() == null ? null : this.innerProperties().openFileHandles(); - } - - /** - * Set the openFileHandles property: List of open files. - * - * @param openFileHandles the openFileHandles value to set. - * @return the ProcessInfoInner object itself. - */ - public ProcessInfoInner withOpenFileHandles(List openFileHandles) { - if (this.innerProperties() == null) { - this.innerProperties = new ProcessInfoProperties(); - } - this.innerProperties().withOpenFileHandles(openFileHandles); - return this; - } - - /** - * Get the modules property: List of modules. - * - * @return the modules value. - */ - public List modules() { - return this.innerProperties() == null ? null : this.innerProperties().modules(); - } - - /** - * Set the modules property: List of modules. - * - * @param modules the modules value to set. - * @return the ProcessInfoInner object itself. - */ - public ProcessInfoInner withModules(List modules) { - if (this.innerProperties() == null) { - this.innerProperties = new ProcessInfoProperties(); - } - this.innerProperties().withModules(modules); - return this; - } - - /** - * Get the fileName property: File name of this process. - * - * @return the fileName value. - */ - public String fileName() { - return this.innerProperties() == null ? null : this.innerProperties().fileName(); - } - - /** - * Set the fileName property: File name of this process. - * - * @param fileName the fileName value to set. - * @return the ProcessInfoInner object itself. - */ - public ProcessInfoInner withFileName(String fileName) { - if (this.innerProperties() == null) { - this.innerProperties = new ProcessInfoProperties(); - } - this.innerProperties().withFileName(fileName); - return this; - } - - /** - * Get the commandLine property: Command line. - * - * @return the commandLine value. - */ - public String commandLine() { - return this.innerProperties() == null ? null : this.innerProperties().commandLine(); - } - - /** - * Set the commandLine property: Command line. - * - * @param commandLine the commandLine value to set. - * @return the ProcessInfoInner object itself. - */ - public ProcessInfoInner withCommandLine(String commandLine) { - if (this.innerProperties() == null) { - this.innerProperties = new ProcessInfoProperties(); - } - this.innerProperties().withCommandLine(commandLine); - return this; - } - - /** - * Get the username property: User name. - * - * @return the username value. - */ - public String username() { - return this.innerProperties() == null ? null : this.innerProperties().username(); - } - - /** - * Set the username property: User name. - * - * @param username the username value to set. - * @return the ProcessInfoInner object itself. - */ - public ProcessInfoInner withUsername(String username) { - if (this.innerProperties() == null) { - this.innerProperties = new ProcessInfoProperties(); - } - this.innerProperties().withUsername(username); - return this; - } - - /** - * Get the handleCount property: Handle count. - * - * @return the handleCount value. - */ - public Integer handleCount() { - return this.innerProperties() == null ? null : this.innerProperties().handleCount(); - } - - /** - * Set the handleCount property: Handle count. - * - * @param handleCount the handleCount value to set. - * @return the ProcessInfoInner object itself. - */ - public ProcessInfoInner withHandleCount(Integer handleCount) { - if (this.innerProperties() == null) { - this.innerProperties = new ProcessInfoProperties(); - } - this.innerProperties().withHandleCount(handleCount); - return this; - } - - /** - * Get the moduleCount property: Module count. - * - * @return the moduleCount value. - */ - public Integer moduleCount() { - return this.innerProperties() == null ? null : this.innerProperties().moduleCount(); - } - - /** - * Set the moduleCount property: Module count. - * - * @param moduleCount the moduleCount value to set. - * @return the ProcessInfoInner object itself. - */ - public ProcessInfoInner withModuleCount(Integer moduleCount) { - if (this.innerProperties() == null) { - this.innerProperties = new ProcessInfoProperties(); - } - this.innerProperties().withModuleCount(moduleCount); - return this; - } - - /** - * Get the threadCount property: Thread count. - * - * @return the threadCount value. - */ - public Integer threadCount() { - return this.innerProperties() == null ? null : this.innerProperties().threadCount(); - } - - /** - * Set the threadCount property: Thread count. - * - * @param threadCount the threadCount value to set. - * @return the ProcessInfoInner object itself. - */ - public ProcessInfoInner withThreadCount(Integer threadCount) { - if (this.innerProperties() == null) { - this.innerProperties = new ProcessInfoProperties(); - } - this.innerProperties().withThreadCount(threadCount); - return this; - } - - /** - * Get the startTime property: Start time. - * - * @return the startTime value. - */ - public OffsetDateTime startTime() { - return this.innerProperties() == null ? null : this.innerProperties().startTime(); - } - - /** - * Set the startTime property: Start time. - * - * @param startTime the startTime value to set. - * @return the ProcessInfoInner object itself. - */ - public ProcessInfoInner withStartTime(OffsetDateTime startTime) { - if (this.innerProperties() == null) { - this.innerProperties = new ProcessInfoProperties(); - } - this.innerProperties().withStartTime(startTime); - return this; - } - - /** - * Get the totalCpuTime property: Total CPU time. - * - * @return the totalCpuTime value. - */ - public String totalCpuTime() { - return this.innerProperties() == null ? null : this.innerProperties().totalCpuTime(); - } - - /** - * Set the totalCpuTime property: Total CPU time. - * - * @param totalCpuTime the totalCpuTime value to set. - * @return the ProcessInfoInner object itself. - */ - public ProcessInfoInner withTotalCpuTime(String totalCpuTime) { - if (this.innerProperties() == null) { - this.innerProperties = new ProcessInfoProperties(); - } - this.innerProperties().withTotalCpuTime(totalCpuTime); - return this; - } - - /** - * Get the userCpuTime property: User CPU time. - * - * @return the userCpuTime value. - */ - public String userCpuTime() { - return this.innerProperties() == null ? null : this.innerProperties().userCpuTime(); - } - - /** - * Set the userCpuTime property: User CPU time. - * - * @param userCpuTime the userCpuTime value to set. - * @return the ProcessInfoInner object itself. - */ - public ProcessInfoInner withUserCpuTime(String userCpuTime) { - if (this.innerProperties() == null) { - this.innerProperties = new ProcessInfoProperties(); - } - this.innerProperties().withUserCpuTime(userCpuTime); - return this; - } - - /** - * Get the privilegedCpuTime property: Privileged CPU time. - * - * @return the privilegedCpuTime value. - */ - public String privilegedCpuTime() { - return this.innerProperties() == null ? null : this.innerProperties().privilegedCpuTime(); - } - - /** - * Set the privilegedCpuTime property: Privileged CPU time. - * - * @param privilegedCpuTime the privilegedCpuTime value to set. - * @return the ProcessInfoInner object itself. - */ - public ProcessInfoInner withPrivilegedCpuTime(String privilegedCpuTime) { - if (this.innerProperties() == null) { - this.innerProperties = new ProcessInfoProperties(); - } - this.innerProperties().withPrivilegedCpuTime(privilegedCpuTime); - return this; - } - - /** - * Get the workingSet property: Working set. - * - * @return the workingSet value. - */ - public Long workingSet() { - return this.innerProperties() == null ? null : this.innerProperties().workingSet(); - } - - /** - * Set the workingSet property: Working set. - * - * @param workingSet the workingSet value to set. - * @return the ProcessInfoInner object itself. - */ - public ProcessInfoInner withWorkingSet(Long workingSet) { - if (this.innerProperties() == null) { - this.innerProperties = new ProcessInfoProperties(); - } - this.innerProperties().withWorkingSet(workingSet); - return this; - } - - /** - * Get the peakWorkingSet property: Peak working set. - * - * @return the peakWorkingSet value. - */ - public Long peakWorkingSet() { - return this.innerProperties() == null ? null : this.innerProperties().peakWorkingSet(); - } - - /** - * Set the peakWorkingSet property: Peak working set. - * - * @param peakWorkingSet the peakWorkingSet value to set. - * @return the ProcessInfoInner object itself. - */ - public ProcessInfoInner withPeakWorkingSet(Long peakWorkingSet) { - if (this.innerProperties() == null) { - this.innerProperties = new ProcessInfoProperties(); - } - this.innerProperties().withPeakWorkingSet(peakWorkingSet); - return this; - } - - /** - * Get the privateMemory property: Private memory size. - * - * @return the privateMemory value. - */ - public Long privateMemory() { - return this.innerProperties() == null ? null : this.innerProperties().privateMemory(); - } - - /** - * Set the privateMemory property: Private memory size. - * - * @param privateMemory the privateMemory value to set. - * @return the ProcessInfoInner object itself. - */ - public ProcessInfoInner withPrivateMemory(Long privateMemory) { - if (this.innerProperties() == null) { - this.innerProperties = new ProcessInfoProperties(); - } - this.innerProperties().withPrivateMemory(privateMemory); - return this; - } - - /** - * Get the virtualMemory property: Virtual memory size. - * - * @return the virtualMemory value. - */ - public Long virtualMemory() { - return this.innerProperties() == null ? null : this.innerProperties().virtualMemory(); - } - - /** - * Set the virtualMemory property: Virtual memory size. - * - * @param virtualMemory the virtualMemory value to set. - * @return the ProcessInfoInner object itself. - */ - public ProcessInfoInner withVirtualMemory(Long virtualMemory) { - if (this.innerProperties() == null) { - this.innerProperties = new ProcessInfoProperties(); - } - this.innerProperties().withVirtualMemory(virtualMemory); - return this; - } - - /** - * Get the peakVirtualMemory property: Peak virtual memory usage. - * - * @return the peakVirtualMemory value. - */ - public Long peakVirtualMemory() { - return this.innerProperties() == null ? null : this.innerProperties().peakVirtualMemory(); - } - - /** - * Set the peakVirtualMemory property: Peak virtual memory usage. - * - * @param peakVirtualMemory the peakVirtualMemory value to set. - * @return the ProcessInfoInner object itself. - */ - public ProcessInfoInner withPeakVirtualMemory(Long peakVirtualMemory) { - if (this.innerProperties() == null) { - this.innerProperties = new ProcessInfoProperties(); - } - this.innerProperties().withPeakVirtualMemory(peakVirtualMemory); - return this; - } - - /** - * Get the pagedSystemMemory property: Paged system memory. - * - * @return the pagedSystemMemory value. - */ - public Long pagedSystemMemory() { - return this.innerProperties() == null ? null : this.innerProperties().pagedSystemMemory(); - } - - /** - * Set the pagedSystemMemory property: Paged system memory. - * - * @param pagedSystemMemory the pagedSystemMemory value to set. - * @return the ProcessInfoInner object itself. - */ - public ProcessInfoInner withPagedSystemMemory(Long pagedSystemMemory) { - if (this.innerProperties() == null) { - this.innerProperties = new ProcessInfoProperties(); - } - this.innerProperties().withPagedSystemMemory(pagedSystemMemory); - return this; - } - - /** - * Get the nonPagedSystemMemory property: Non-paged system memory. - * - * @return the nonPagedSystemMemory value. - */ - public Long nonPagedSystemMemory() { - return this.innerProperties() == null ? null : this.innerProperties().nonPagedSystemMemory(); - } - - /** - * Set the nonPagedSystemMemory property: Non-paged system memory. - * - * @param nonPagedSystemMemory the nonPagedSystemMemory value to set. - * @return the ProcessInfoInner object itself. - */ - public ProcessInfoInner withNonPagedSystemMemory(Long nonPagedSystemMemory) { - if (this.innerProperties() == null) { - this.innerProperties = new ProcessInfoProperties(); - } - this.innerProperties().withNonPagedSystemMemory(nonPagedSystemMemory); - return this; - } - - /** - * Get the pagedMemory property: Paged memory. - * - * @return the pagedMemory value. - */ - public Long pagedMemory() { - return this.innerProperties() == null ? null : this.innerProperties().pagedMemory(); - } - - /** - * Set the pagedMemory property: Paged memory. - * - * @param pagedMemory the pagedMemory value to set. - * @return the ProcessInfoInner object itself. - */ - public ProcessInfoInner withPagedMemory(Long pagedMemory) { - if (this.innerProperties() == null) { - this.innerProperties = new ProcessInfoProperties(); - } - this.innerProperties().withPagedMemory(pagedMemory); - return this; - } - - /** - * Get the peakPagedMemory property: Peak paged memory. - * - * @return the peakPagedMemory value. - */ - public Long peakPagedMemory() { - return this.innerProperties() == null ? null : this.innerProperties().peakPagedMemory(); - } - - /** - * Set the peakPagedMemory property: Peak paged memory. - * - * @param peakPagedMemory the peakPagedMemory value to set. - * @return the ProcessInfoInner object itself. - */ - public ProcessInfoInner withPeakPagedMemory(Long peakPagedMemory) { - if (this.innerProperties() == null) { - this.innerProperties = new ProcessInfoProperties(); - } - this.innerProperties().withPeakPagedMemory(peakPagedMemory); - return this; - } - - /** - * Get the timestamp property: Time stamp. - * - * @return the timestamp value. - */ - public OffsetDateTime timestamp() { - return this.innerProperties() == null ? null : this.innerProperties().timestamp(); - } - - /** - * Set the timestamp property: Time stamp. - * - * @param timestamp the timestamp value to set. - * @return the ProcessInfoInner object itself. - */ - public ProcessInfoInner withTimestamp(OffsetDateTime timestamp) { - if (this.innerProperties() == null) { - this.innerProperties = new ProcessInfoProperties(); - } - this.innerProperties().withTimestamp(timestamp); - return this; - } - - /** - * Get the environmentVariables property: List of environment variables. - * - * @return the environmentVariables value. - */ - public Map environmentVariables() { - return this.innerProperties() == null ? null : this.innerProperties().environmentVariables(); - } - - /** - * Set the environmentVariables property: List of environment variables. - * - * @param environmentVariables the environmentVariables value to set. - * @return the ProcessInfoInner object itself. - */ - public ProcessInfoInner withEnvironmentVariables(Map environmentVariables) { - if (this.innerProperties() == null) { - this.innerProperties = new ProcessInfoProperties(); - } - this.innerProperties().withEnvironmentVariables(environmentVariables); - return this; - } - - /** - * Get the isScmSite property: Is this the SCM site?. - * - * @return the isScmSite value. - */ - public Boolean isScmSite() { - return this.innerProperties() == null ? null : this.innerProperties().isScmSite(); - } - - /** - * Set the isScmSite property: Is this the SCM site?. - * - * @param isScmSite the isScmSite value to set. - * @return the ProcessInfoInner object itself. - */ - public ProcessInfoInner withIsScmSite(Boolean isScmSite) { - if (this.innerProperties() == null) { - this.innerProperties = new ProcessInfoProperties(); - } - this.innerProperties().withIsScmSite(isScmSite); - return this; - } - - /** - * Get the isWebjob property: Is this a Web Job?. - * - * @return the isWebjob value. - */ - public Boolean isWebjob() { - return this.innerProperties() == null ? null : this.innerProperties().isWebjob(); - } - - /** - * Set the isWebjob property: Is this a Web Job?. - * - * @param isWebjob the isWebjob value to set. - * @return the ProcessInfoInner object itself. - */ - public ProcessInfoInner withIsWebjob(Boolean isWebjob) { - if (this.innerProperties() == null) { - this.innerProperties = new ProcessInfoProperties(); - } - this.innerProperties().withIsWebjob(isWebjob); - return this; - } - - /** - * Get the description property: Description of process. - * - * @return the description value. - */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); - } - - /** - * Set the description property: Description of process. - * - * @param description the description value to set. - * @return the ProcessInfoInner object itself. - */ - public ProcessInfoInner withDescription(String description) { - if (this.innerProperties() == null) { - this.innerProperties = new ProcessInfoProperties(); - } - this.innerProperties().withDescription(description); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/ProcessInfoProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/ProcessInfoProperties.java deleted file mode 100644 index 38c4a85b2e54..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/ProcessInfoProperties.java +++ /dev/null @@ -1,960 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; -import java.util.Map; - -/** ProcessInfo resource specific properties. */ -@Fluent -public final class ProcessInfoProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ProcessInfoProperties.class); - - /* - * ARM Identifier for deployment. - */ - @JsonProperty(value = "identifier", access = JsonProperty.Access.WRITE_ONLY) - private Integer identifier; - - /* - * Deployment name. - */ - @JsonProperty(value = "deployment_name") - private String deploymentName; - - /* - * HRef URI. - */ - @JsonProperty(value = "href") - private String href; - - /* - * Minidump URI. - */ - @JsonProperty(value = "minidump") - private String minidump; - - /* - * Is profile running? - */ - @JsonProperty(value = "is_profile_running") - private Boolean isProfileRunning; - - /* - * Is the IIS Profile running? - */ - @JsonProperty(value = "is_iis_profile_running") - private Boolean isIisProfileRunning; - - /* - * IIS Profile timeout (seconds). - */ - @JsonProperty(value = "iis_profile_timeout_in_seconds") - private Double iisProfileTimeoutInSeconds; - - /* - * Parent process. - */ - @JsonProperty(value = "parent") - private String parent; - - /* - * Child process list. - */ - @JsonProperty(value = "children") - private List children; - - /* - * Thread list. - */ - @JsonProperty(value = "threads") - private List threads; - - /* - * List of open files. - */ - @JsonProperty(value = "open_file_handles") - private List openFileHandles; - - /* - * List of modules. - */ - @JsonProperty(value = "modules") - private List modules; - - /* - * File name of this process. - */ - @JsonProperty(value = "file_name") - private String fileName; - - /* - * Command line. - */ - @JsonProperty(value = "command_line") - private String commandLine; - - /* - * User name. - */ - @JsonProperty(value = "user_name") - private String username; - - /* - * Handle count. - */ - @JsonProperty(value = "handle_count") - private Integer handleCount; - - /* - * Module count. - */ - @JsonProperty(value = "module_count") - private Integer moduleCount; - - /* - * Thread count. - */ - @JsonProperty(value = "thread_count") - private Integer threadCount; - - /* - * Start time. - */ - @JsonProperty(value = "start_time") - private OffsetDateTime startTime; - - /* - * Total CPU time. - */ - @JsonProperty(value = "total_cpu_time") - private String totalCpuTime; - - /* - * User CPU time. - */ - @JsonProperty(value = "user_cpu_time") - private String userCpuTime; - - /* - * Privileged CPU time. - */ - @JsonProperty(value = "privileged_cpu_time") - private String privilegedCpuTime; - - /* - * Working set. - */ - @JsonProperty(value = "working_set") - private Long workingSet; - - /* - * Peak working set. - */ - @JsonProperty(value = "peak_working_set") - private Long peakWorkingSet; - - /* - * Private memory size. - */ - @JsonProperty(value = "private_memory") - private Long privateMemory; - - /* - * Virtual memory size. - */ - @JsonProperty(value = "virtual_memory") - private Long virtualMemory; - - /* - * Peak virtual memory usage. - */ - @JsonProperty(value = "peak_virtual_memory") - private Long peakVirtualMemory; - - /* - * Paged system memory. - */ - @JsonProperty(value = "paged_system_memory") - private Long pagedSystemMemory; - - /* - * Non-paged system memory. - */ - @JsonProperty(value = "non_paged_system_memory") - private Long nonPagedSystemMemory; - - /* - * Paged memory. - */ - @JsonProperty(value = "paged_memory") - private Long pagedMemory; - - /* - * Peak paged memory. - */ - @JsonProperty(value = "peak_paged_memory") - private Long peakPagedMemory; - - /* - * Time stamp. - */ - @JsonProperty(value = "time_stamp") - private OffsetDateTime timestamp; - - /* - * List of environment variables. - */ - @JsonProperty(value = "environment_variables") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map environmentVariables; - - /* - * Is this the SCM site? - */ - @JsonProperty(value = "is_scm_site") - private Boolean isScmSite; - - /* - * Is this a Web Job? - */ - @JsonProperty(value = "is_webjob") - private Boolean isWebjob; - - /* - * Description of process. - */ - @JsonProperty(value = "description") - private String description; - - /** - * Get the identifier property: ARM Identifier for deployment. - * - * @return the identifier value. - */ - public Integer identifier() { - return this.identifier; - } - - /** - * Get the deploymentName property: Deployment name. - * - * @return the deploymentName value. - */ - public String deploymentName() { - return this.deploymentName; - } - - /** - * Set the deploymentName property: Deployment name. - * - * @param deploymentName the deploymentName value to set. - * @return the ProcessInfoProperties object itself. - */ - public ProcessInfoProperties withDeploymentName(String deploymentName) { - this.deploymentName = deploymentName; - return this; - } - - /** - * Get the href property: HRef URI. - * - * @return the href value. - */ - public String href() { - return this.href; - } - - /** - * Set the href property: HRef URI. - * - * @param href the href value to set. - * @return the ProcessInfoProperties object itself. - */ - public ProcessInfoProperties withHref(String href) { - this.href = href; - return this; - } - - /** - * Get the minidump property: Minidump URI. - * - * @return the minidump value. - */ - public String minidump() { - return this.minidump; - } - - /** - * Set the minidump property: Minidump URI. - * - * @param minidump the minidump value to set. - * @return the ProcessInfoProperties object itself. - */ - public ProcessInfoProperties withMinidump(String minidump) { - this.minidump = minidump; - return this; - } - - /** - * Get the isProfileRunning property: Is profile running?. - * - * @return the isProfileRunning value. - */ - public Boolean isProfileRunning() { - return this.isProfileRunning; - } - - /** - * Set the isProfileRunning property: Is profile running?. - * - * @param isProfileRunning the isProfileRunning value to set. - * @return the ProcessInfoProperties object itself. - */ - public ProcessInfoProperties withIsProfileRunning(Boolean isProfileRunning) { - this.isProfileRunning = isProfileRunning; - return this; - } - - /** - * Get the isIisProfileRunning property: Is the IIS Profile running?. - * - * @return the isIisProfileRunning value. - */ - public Boolean isIisProfileRunning() { - return this.isIisProfileRunning; - } - - /** - * Set the isIisProfileRunning property: Is the IIS Profile running?. - * - * @param isIisProfileRunning the isIisProfileRunning value to set. - * @return the ProcessInfoProperties object itself. - */ - public ProcessInfoProperties withIsIisProfileRunning(Boolean isIisProfileRunning) { - this.isIisProfileRunning = isIisProfileRunning; - return this; - } - - /** - * Get the iisProfileTimeoutInSeconds property: IIS Profile timeout (seconds). - * - * @return the iisProfileTimeoutInSeconds value. - */ - public Double iisProfileTimeoutInSeconds() { - return this.iisProfileTimeoutInSeconds; - } - - /** - * Set the iisProfileTimeoutInSeconds property: IIS Profile timeout (seconds). - * - * @param iisProfileTimeoutInSeconds the iisProfileTimeoutInSeconds value to set. - * @return the ProcessInfoProperties object itself. - */ - public ProcessInfoProperties withIisProfileTimeoutInSeconds(Double iisProfileTimeoutInSeconds) { - this.iisProfileTimeoutInSeconds = iisProfileTimeoutInSeconds; - return this; - } - - /** - * Get the parent property: Parent process. - * - * @return the parent value. - */ - public String parent() { - return this.parent; - } - - /** - * Set the parent property: Parent process. - * - * @param parent the parent value to set. - * @return the ProcessInfoProperties object itself. - */ - public ProcessInfoProperties withParent(String parent) { - this.parent = parent; - return this; - } - - /** - * Get the children property: Child process list. - * - * @return the children value. - */ - public List children() { - return this.children; - } - - /** - * Set the children property: Child process list. - * - * @param children the children value to set. - * @return the ProcessInfoProperties object itself. - */ - public ProcessInfoProperties withChildren(List children) { - this.children = children; - return this; - } - - /** - * Get the threads property: Thread list. - * - * @return the threads value. - */ - public List threads() { - return this.threads; - } - - /** - * Set the threads property: Thread list. - * - * @param threads the threads value to set. - * @return the ProcessInfoProperties object itself. - */ - public ProcessInfoProperties withThreads(List threads) { - this.threads = threads; - return this; - } - - /** - * Get the openFileHandles property: List of open files. - * - * @return the openFileHandles value. - */ - public List openFileHandles() { - return this.openFileHandles; - } - - /** - * Set the openFileHandles property: List of open files. - * - * @param openFileHandles the openFileHandles value to set. - * @return the ProcessInfoProperties object itself. - */ - public ProcessInfoProperties withOpenFileHandles(List openFileHandles) { - this.openFileHandles = openFileHandles; - return this; - } - - /** - * Get the modules property: List of modules. - * - * @return the modules value. - */ - public List modules() { - return this.modules; - } - - /** - * Set the modules property: List of modules. - * - * @param modules the modules value to set. - * @return the ProcessInfoProperties object itself. - */ - public ProcessInfoProperties withModules(List modules) { - this.modules = modules; - return this; - } - - /** - * Get the fileName property: File name of this process. - * - * @return the fileName value. - */ - public String fileName() { - return this.fileName; - } - - /** - * Set the fileName property: File name of this process. - * - * @param fileName the fileName value to set. - * @return the ProcessInfoProperties object itself. - */ - public ProcessInfoProperties withFileName(String fileName) { - this.fileName = fileName; - return this; - } - - /** - * Get the commandLine property: Command line. - * - * @return the commandLine value. - */ - public String commandLine() { - return this.commandLine; - } - - /** - * Set the commandLine property: Command line. - * - * @param commandLine the commandLine value to set. - * @return the ProcessInfoProperties object itself. - */ - public ProcessInfoProperties withCommandLine(String commandLine) { - this.commandLine = commandLine; - return this; - } - - /** - * Get the username property: User name. - * - * @return the username value. - */ - public String username() { - return this.username; - } - - /** - * Set the username property: User name. - * - * @param username the username value to set. - * @return the ProcessInfoProperties object itself. - */ - public ProcessInfoProperties withUsername(String username) { - this.username = username; - return this; - } - - /** - * Get the handleCount property: Handle count. - * - * @return the handleCount value. - */ - public Integer handleCount() { - return this.handleCount; - } - - /** - * Set the handleCount property: Handle count. - * - * @param handleCount the handleCount value to set. - * @return the ProcessInfoProperties object itself. - */ - public ProcessInfoProperties withHandleCount(Integer handleCount) { - this.handleCount = handleCount; - return this; - } - - /** - * Get the moduleCount property: Module count. - * - * @return the moduleCount value. - */ - public Integer moduleCount() { - return this.moduleCount; - } - - /** - * Set the moduleCount property: Module count. - * - * @param moduleCount the moduleCount value to set. - * @return the ProcessInfoProperties object itself. - */ - public ProcessInfoProperties withModuleCount(Integer moduleCount) { - this.moduleCount = moduleCount; - return this; - } - - /** - * Get the threadCount property: Thread count. - * - * @return the threadCount value. - */ - public Integer threadCount() { - return this.threadCount; - } - - /** - * Set the threadCount property: Thread count. - * - * @param threadCount the threadCount value to set. - * @return the ProcessInfoProperties object itself. - */ - public ProcessInfoProperties withThreadCount(Integer threadCount) { - this.threadCount = threadCount; - return this; - } - - /** - * Get the startTime property: Start time. - * - * @return the startTime value. - */ - public OffsetDateTime startTime() { - return this.startTime; - } - - /** - * Set the startTime property: Start time. - * - * @param startTime the startTime value to set. - * @return the ProcessInfoProperties object itself. - */ - public ProcessInfoProperties withStartTime(OffsetDateTime startTime) { - this.startTime = startTime; - return this; - } - - /** - * Get the totalCpuTime property: Total CPU time. - * - * @return the totalCpuTime value. - */ - public String totalCpuTime() { - return this.totalCpuTime; - } - - /** - * Set the totalCpuTime property: Total CPU time. - * - * @param totalCpuTime the totalCpuTime value to set. - * @return the ProcessInfoProperties object itself. - */ - public ProcessInfoProperties withTotalCpuTime(String totalCpuTime) { - this.totalCpuTime = totalCpuTime; - return this; - } - - /** - * Get the userCpuTime property: User CPU time. - * - * @return the userCpuTime value. - */ - public String userCpuTime() { - return this.userCpuTime; - } - - /** - * Set the userCpuTime property: User CPU time. - * - * @param userCpuTime the userCpuTime value to set. - * @return the ProcessInfoProperties object itself. - */ - public ProcessInfoProperties withUserCpuTime(String userCpuTime) { - this.userCpuTime = userCpuTime; - return this; - } - - /** - * Get the privilegedCpuTime property: Privileged CPU time. - * - * @return the privilegedCpuTime value. - */ - public String privilegedCpuTime() { - return this.privilegedCpuTime; - } - - /** - * Set the privilegedCpuTime property: Privileged CPU time. - * - * @param privilegedCpuTime the privilegedCpuTime value to set. - * @return the ProcessInfoProperties object itself. - */ - public ProcessInfoProperties withPrivilegedCpuTime(String privilegedCpuTime) { - this.privilegedCpuTime = privilegedCpuTime; - return this; - } - - /** - * Get the workingSet property: Working set. - * - * @return the workingSet value. - */ - public Long workingSet() { - return this.workingSet; - } - - /** - * Set the workingSet property: Working set. - * - * @param workingSet the workingSet value to set. - * @return the ProcessInfoProperties object itself. - */ - public ProcessInfoProperties withWorkingSet(Long workingSet) { - this.workingSet = workingSet; - return this; - } - - /** - * Get the peakWorkingSet property: Peak working set. - * - * @return the peakWorkingSet value. - */ - public Long peakWorkingSet() { - return this.peakWorkingSet; - } - - /** - * Set the peakWorkingSet property: Peak working set. - * - * @param peakWorkingSet the peakWorkingSet value to set. - * @return the ProcessInfoProperties object itself. - */ - public ProcessInfoProperties withPeakWorkingSet(Long peakWorkingSet) { - this.peakWorkingSet = peakWorkingSet; - return this; - } - - /** - * Get the privateMemory property: Private memory size. - * - * @return the privateMemory value. - */ - public Long privateMemory() { - return this.privateMemory; - } - - /** - * Set the privateMemory property: Private memory size. - * - * @param privateMemory the privateMemory value to set. - * @return the ProcessInfoProperties object itself. - */ - public ProcessInfoProperties withPrivateMemory(Long privateMemory) { - this.privateMemory = privateMemory; - return this; - } - - /** - * Get the virtualMemory property: Virtual memory size. - * - * @return the virtualMemory value. - */ - public Long virtualMemory() { - return this.virtualMemory; - } - - /** - * Set the virtualMemory property: Virtual memory size. - * - * @param virtualMemory the virtualMemory value to set. - * @return the ProcessInfoProperties object itself. - */ - public ProcessInfoProperties withVirtualMemory(Long virtualMemory) { - this.virtualMemory = virtualMemory; - return this; - } - - /** - * Get the peakVirtualMemory property: Peak virtual memory usage. - * - * @return the peakVirtualMemory value. - */ - public Long peakVirtualMemory() { - return this.peakVirtualMemory; - } - - /** - * Set the peakVirtualMemory property: Peak virtual memory usage. - * - * @param peakVirtualMemory the peakVirtualMemory value to set. - * @return the ProcessInfoProperties object itself. - */ - public ProcessInfoProperties withPeakVirtualMemory(Long peakVirtualMemory) { - this.peakVirtualMemory = peakVirtualMemory; - return this; - } - - /** - * Get the pagedSystemMemory property: Paged system memory. - * - * @return the pagedSystemMemory value. - */ - public Long pagedSystemMemory() { - return this.pagedSystemMemory; - } - - /** - * Set the pagedSystemMemory property: Paged system memory. - * - * @param pagedSystemMemory the pagedSystemMemory value to set. - * @return the ProcessInfoProperties object itself. - */ - public ProcessInfoProperties withPagedSystemMemory(Long pagedSystemMemory) { - this.pagedSystemMemory = pagedSystemMemory; - return this; - } - - /** - * Get the nonPagedSystemMemory property: Non-paged system memory. - * - * @return the nonPagedSystemMemory value. - */ - public Long nonPagedSystemMemory() { - return this.nonPagedSystemMemory; - } - - /** - * Set the nonPagedSystemMemory property: Non-paged system memory. - * - * @param nonPagedSystemMemory the nonPagedSystemMemory value to set. - * @return the ProcessInfoProperties object itself. - */ - public ProcessInfoProperties withNonPagedSystemMemory(Long nonPagedSystemMemory) { - this.nonPagedSystemMemory = nonPagedSystemMemory; - return this; - } - - /** - * Get the pagedMemory property: Paged memory. - * - * @return the pagedMemory value. - */ - public Long pagedMemory() { - return this.pagedMemory; - } - - /** - * Set the pagedMemory property: Paged memory. - * - * @param pagedMemory the pagedMemory value to set. - * @return the ProcessInfoProperties object itself. - */ - public ProcessInfoProperties withPagedMemory(Long pagedMemory) { - this.pagedMemory = pagedMemory; - return this; - } - - /** - * Get the peakPagedMemory property: Peak paged memory. - * - * @return the peakPagedMemory value. - */ - public Long peakPagedMemory() { - return this.peakPagedMemory; - } - - /** - * Set the peakPagedMemory property: Peak paged memory. - * - * @param peakPagedMemory the peakPagedMemory value to set. - * @return the ProcessInfoProperties object itself. - */ - public ProcessInfoProperties withPeakPagedMemory(Long peakPagedMemory) { - this.peakPagedMemory = peakPagedMemory; - return this; - } - - /** - * Get the timestamp property: Time stamp. - * - * @return the timestamp value. - */ - public OffsetDateTime timestamp() { - return this.timestamp; - } - - /** - * Set the timestamp property: Time stamp. - * - * @param timestamp the timestamp value to set. - * @return the ProcessInfoProperties object itself. - */ - public ProcessInfoProperties withTimestamp(OffsetDateTime timestamp) { - this.timestamp = timestamp; - return this; - } - - /** - * Get the environmentVariables property: List of environment variables. - * - * @return the environmentVariables value. - */ - public Map environmentVariables() { - return this.environmentVariables; - } - - /** - * Set the environmentVariables property: List of environment variables. - * - * @param environmentVariables the environmentVariables value to set. - * @return the ProcessInfoProperties object itself. - */ - public ProcessInfoProperties withEnvironmentVariables(Map environmentVariables) { - this.environmentVariables = environmentVariables; - return this; - } - - /** - * Get the isScmSite property: Is this the SCM site?. - * - * @return the isScmSite value. - */ - public Boolean isScmSite() { - return this.isScmSite; - } - - /** - * Set the isScmSite property: Is this the SCM site?. - * - * @param isScmSite the isScmSite value to set. - * @return the ProcessInfoProperties object itself. - */ - public ProcessInfoProperties withIsScmSite(Boolean isScmSite) { - this.isScmSite = isScmSite; - return this; - } - - /** - * Get the isWebjob property: Is this a Web Job?. - * - * @return the isWebjob value. - */ - public Boolean isWebjob() { - return this.isWebjob; - } - - /** - * Set the isWebjob property: Is this a Web Job?. - * - * @param isWebjob the isWebjob value to set. - * @return the ProcessInfoProperties object itself. - */ - public ProcessInfoProperties withIsWebjob(Boolean isWebjob) { - this.isWebjob = isWebjob; - return this; - } - - /** - * Get the description property: Description of process. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: Description of process. - * - * @param description the description value to set. - * @return the ProcessInfoProperties object itself. - */ - public ProcessInfoProperties withDescription(String description) { - this.description = description; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (threads() != null) { - threads().forEach(e -> e.validate()); - } - if (modules() != null) { - modules().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/ProcessModuleInfoInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/ProcessModuleInfoInner.java deleted file mode 100644 index 069a0a73563c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/ProcessModuleInfoInner.java +++ /dev/null @@ -1,305 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.ProxyOnlyResource; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Process Module Information. */ -@Fluent -public final class ProcessModuleInfoInner extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ProcessModuleInfoInner.class); - - /* - * ProcessModuleInfo resource specific properties - */ - @JsonProperty(value = "properties") - private ProcessModuleInfoProperties innerProperties; - - /** - * Get the innerProperties property: ProcessModuleInfo resource specific properties. - * - * @return the innerProperties value. - */ - private ProcessModuleInfoProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public ProcessModuleInfoInner withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the baseAddress property: Base address. Used as module identifier in ARM resource URI. - * - * @return the baseAddress value. - */ - public String baseAddress() { - return this.innerProperties() == null ? null : this.innerProperties().baseAddress(); - } - - /** - * Set the baseAddress property: Base address. Used as module identifier in ARM resource URI. - * - * @param baseAddress the baseAddress value to set. - * @return the ProcessModuleInfoInner object itself. - */ - public ProcessModuleInfoInner withBaseAddress(String baseAddress) { - if (this.innerProperties() == null) { - this.innerProperties = new ProcessModuleInfoProperties(); - } - this.innerProperties().withBaseAddress(baseAddress); - return this; - } - - /** - * Get the fileName property: File name. - * - * @return the fileName value. - */ - public String fileName() { - return this.innerProperties() == null ? null : this.innerProperties().fileName(); - } - - /** - * Set the fileName property: File name. - * - * @param fileName the fileName value to set. - * @return the ProcessModuleInfoInner object itself. - */ - public ProcessModuleInfoInner withFileName(String fileName) { - if (this.innerProperties() == null) { - this.innerProperties = new ProcessModuleInfoProperties(); - } - this.innerProperties().withFileName(fileName); - return this; - } - - /** - * Get the href property: HRef URI. - * - * @return the href value. - */ - public String href() { - return this.innerProperties() == null ? null : this.innerProperties().href(); - } - - /** - * Set the href property: HRef URI. - * - * @param href the href value to set. - * @return the ProcessModuleInfoInner object itself. - */ - public ProcessModuleInfoInner withHref(String href) { - if (this.innerProperties() == null) { - this.innerProperties = new ProcessModuleInfoProperties(); - } - this.innerProperties().withHref(href); - return this; - } - - /** - * Get the filePath property: File path. - * - * @return the filePath value. - */ - public String filePath() { - return this.innerProperties() == null ? null : this.innerProperties().filePath(); - } - - /** - * Set the filePath property: File path. - * - * @param filePath the filePath value to set. - * @return the ProcessModuleInfoInner object itself. - */ - public ProcessModuleInfoInner withFilePath(String filePath) { - if (this.innerProperties() == null) { - this.innerProperties = new ProcessModuleInfoProperties(); - } - this.innerProperties().withFilePath(filePath); - return this; - } - - /** - * Get the moduleMemorySize property: Module memory size. - * - * @return the moduleMemorySize value. - */ - public Integer moduleMemorySize() { - return this.innerProperties() == null ? null : this.innerProperties().moduleMemorySize(); - } - - /** - * Set the moduleMemorySize property: Module memory size. - * - * @param moduleMemorySize the moduleMemorySize value to set. - * @return the ProcessModuleInfoInner object itself. - */ - public ProcessModuleInfoInner withModuleMemorySize(Integer moduleMemorySize) { - if (this.innerProperties() == null) { - this.innerProperties = new ProcessModuleInfoProperties(); - } - this.innerProperties().withModuleMemorySize(moduleMemorySize); - return this; - } - - /** - * Get the fileVersion property: File version. - * - * @return the fileVersion value. - */ - public String fileVersion() { - return this.innerProperties() == null ? null : this.innerProperties().fileVersion(); - } - - /** - * Set the fileVersion property: File version. - * - * @param fileVersion the fileVersion value to set. - * @return the ProcessModuleInfoInner object itself. - */ - public ProcessModuleInfoInner withFileVersion(String fileVersion) { - if (this.innerProperties() == null) { - this.innerProperties = new ProcessModuleInfoProperties(); - } - this.innerProperties().withFileVersion(fileVersion); - return this; - } - - /** - * Get the fileDescription property: File description. - * - * @return the fileDescription value. - */ - public String fileDescription() { - return this.innerProperties() == null ? null : this.innerProperties().fileDescription(); - } - - /** - * Set the fileDescription property: File description. - * - * @param fileDescription the fileDescription value to set. - * @return the ProcessModuleInfoInner object itself. - */ - public ProcessModuleInfoInner withFileDescription(String fileDescription) { - if (this.innerProperties() == null) { - this.innerProperties = new ProcessModuleInfoProperties(); - } - this.innerProperties().withFileDescription(fileDescription); - return this; - } - - /** - * Get the product property: Product name. - * - * @return the product value. - */ - public String product() { - return this.innerProperties() == null ? null : this.innerProperties().product(); - } - - /** - * Set the product property: Product name. - * - * @param product the product value to set. - * @return the ProcessModuleInfoInner object itself. - */ - public ProcessModuleInfoInner withProduct(String product) { - if (this.innerProperties() == null) { - this.innerProperties = new ProcessModuleInfoProperties(); - } - this.innerProperties().withProduct(product); - return this; - } - - /** - * Get the productVersion property: Product version. - * - * @return the productVersion value. - */ - public String productVersion() { - return this.innerProperties() == null ? null : this.innerProperties().productVersion(); - } - - /** - * Set the productVersion property: Product version. - * - * @param productVersion the productVersion value to set. - * @return the ProcessModuleInfoInner object itself. - */ - public ProcessModuleInfoInner withProductVersion(String productVersion) { - if (this.innerProperties() == null) { - this.innerProperties = new ProcessModuleInfoProperties(); - } - this.innerProperties().withProductVersion(productVersion); - return this; - } - - /** - * Get the isDebug property: Is debug?. - * - * @return the isDebug value. - */ - public Boolean isDebug() { - return this.innerProperties() == null ? null : this.innerProperties().isDebug(); - } - - /** - * Set the isDebug property: Is debug?. - * - * @param isDebug the isDebug value to set. - * @return the ProcessModuleInfoInner object itself. - */ - public ProcessModuleInfoInner withIsDebug(Boolean isDebug) { - if (this.innerProperties() == null) { - this.innerProperties = new ProcessModuleInfoProperties(); - } - this.innerProperties().withIsDebug(isDebug); - return this; - } - - /** - * Get the language property: Module language (locale). - * - * @return the language value. - */ - public String language() { - return this.innerProperties() == null ? null : this.innerProperties().language(); - } - - /** - * Set the language property: Module language (locale). - * - * @param language the language value to set. - * @return the ProcessModuleInfoInner object itself. - */ - public ProcessModuleInfoInner withLanguage(String language) { - if (this.innerProperties() == null) { - this.innerProperties = new ProcessModuleInfoProperties(); - } - this.innerProperties().withLanguage(language); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/ProcessModuleInfoProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/ProcessModuleInfoProperties.java deleted file mode 100644 index 2212eb2bde4b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/ProcessModuleInfoProperties.java +++ /dev/null @@ -1,310 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** ProcessModuleInfo resource specific properties. */ -@Fluent -public final class ProcessModuleInfoProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ProcessModuleInfoProperties.class); - - /* - * Base address. Used as module identifier in ARM resource URI. - */ - @JsonProperty(value = "base_address") - private String baseAddress; - - /* - * File name. - */ - @JsonProperty(value = "file_name") - private String fileName; - - /* - * HRef URI. - */ - @JsonProperty(value = "href") - private String href; - - /* - * File path. - */ - @JsonProperty(value = "file_path") - private String filePath; - - /* - * Module memory size. - */ - @JsonProperty(value = "module_memory_size") - private Integer moduleMemorySize; - - /* - * File version. - */ - @JsonProperty(value = "file_version") - private String fileVersion; - - /* - * File description. - */ - @JsonProperty(value = "file_description") - private String fileDescription; - - /* - * Product name. - */ - @JsonProperty(value = "product") - private String product; - - /* - * Product version. - */ - @JsonProperty(value = "product_version") - private String productVersion; - - /* - * Is debug? - */ - @JsonProperty(value = "is_debug") - private Boolean isDebug; - - /* - * Module language (locale). - */ - @JsonProperty(value = "language") - private String language; - - /** - * Get the baseAddress property: Base address. Used as module identifier in ARM resource URI. - * - * @return the baseAddress value. - */ - public String baseAddress() { - return this.baseAddress; - } - - /** - * Set the baseAddress property: Base address. Used as module identifier in ARM resource URI. - * - * @param baseAddress the baseAddress value to set. - * @return the ProcessModuleInfoProperties object itself. - */ - public ProcessModuleInfoProperties withBaseAddress(String baseAddress) { - this.baseAddress = baseAddress; - return this; - } - - /** - * Get the fileName property: File name. - * - * @return the fileName value. - */ - public String fileName() { - return this.fileName; - } - - /** - * Set the fileName property: File name. - * - * @param fileName the fileName value to set. - * @return the ProcessModuleInfoProperties object itself. - */ - public ProcessModuleInfoProperties withFileName(String fileName) { - this.fileName = fileName; - return this; - } - - /** - * Get the href property: HRef URI. - * - * @return the href value. - */ - public String href() { - return this.href; - } - - /** - * Set the href property: HRef URI. - * - * @param href the href value to set. - * @return the ProcessModuleInfoProperties object itself. - */ - public ProcessModuleInfoProperties withHref(String href) { - this.href = href; - return this; - } - - /** - * Get the filePath property: File path. - * - * @return the filePath value. - */ - public String filePath() { - return this.filePath; - } - - /** - * Set the filePath property: File path. - * - * @param filePath the filePath value to set. - * @return the ProcessModuleInfoProperties object itself. - */ - public ProcessModuleInfoProperties withFilePath(String filePath) { - this.filePath = filePath; - return this; - } - - /** - * Get the moduleMemorySize property: Module memory size. - * - * @return the moduleMemorySize value. - */ - public Integer moduleMemorySize() { - return this.moduleMemorySize; - } - - /** - * Set the moduleMemorySize property: Module memory size. - * - * @param moduleMemorySize the moduleMemorySize value to set. - * @return the ProcessModuleInfoProperties object itself. - */ - public ProcessModuleInfoProperties withModuleMemorySize(Integer moduleMemorySize) { - this.moduleMemorySize = moduleMemorySize; - return this; - } - - /** - * Get the fileVersion property: File version. - * - * @return the fileVersion value. - */ - public String fileVersion() { - return this.fileVersion; - } - - /** - * Set the fileVersion property: File version. - * - * @param fileVersion the fileVersion value to set. - * @return the ProcessModuleInfoProperties object itself. - */ - public ProcessModuleInfoProperties withFileVersion(String fileVersion) { - this.fileVersion = fileVersion; - return this; - } - - /** - * Get the fileDescription property: File description. - * - * @return the fileDescription value. - */ - public String fileDescription() { - return this.fileDescription; - } - - /** - * Set the fileDescription property: File description. - * - * @param fileDescription the fileDescription value to set. - * @return the ProcessModuleInfoProperties object itself. - */ - public ProcessModuleInfoProperties withFileDescription(String fileDescription) { - this.fileDescription = fileDescription; - return this; - } - - /** - * Get the product property: Product name. - * - * @return the product value. - */ - public String product() { - return this.product; - } - - /** - * Set the product property: Product name. - * - * @param product the product value to set. - * @return the ProcessModuleInfoProperties object itself. - */ - public ProcessModuleInfoProperties withProduct(String product) { - this.product = product; - return this; - } - - /** - * Get the productVersion property: Product version. - * - * @return the productVersion value. - */ - public String productVersion() { - return this.productVersion; - } - - /** - * Set the productVersion property: Product version. - * - * @param productVersion the productVersion value to set. - * @return the ProcessModuleInfoProperties object itself. - */ - public ProcessModuleInfoProperties withProductVersion(String productVersion) { - this.productVersion = productVersion; - return this; - } - - /** - * Get the isDebug property: Is debug?. - * - * @return the isDebug value. - */ - public Boolean isDebug() { - return this.isDebug; - } - - /** - * Set the isDebug property: Is debug?. - * - * @param isDebug the isDebug value to set. - * @return the ProcessModuleInfoProperties object itself. - */ - public ProcessModuleInfoProperties withIsDebug(Boolean isDebug) { - this.isDebug = isDebug; - return this; - } - - /** - * Get the language property: Module language (locale). - * - * @return the language value. - */ - public String language() { - return this.language; - } - - /** - * Set the language property: Module language (locale). - * - * @param language the language value to set. - * @return the ProcessModuleInfoProperties object itself. - */ - public ProcessModuleInfoProperties withLanguage(String language) { - this.language = language; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/ProcessThreadInfoInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/ProcessThreadInfoInner.java deleted file mode 100644 index a1fc6558f2da..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/ProcessThreadInfoInner.java +++ /dev/null @@ -1,338 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.ProxyOnlyResource; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** Process Thread Information. */ -@Fluent -public final class ProcessThreadInfoInner extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ProcessThreadInfoInner.class); - - /* - * ProcessThreadInfo resource specific properties - */ - @JsonProperty(value = "properties") - private ProcessThreadInfoProperties innerProperties; - - /** - * Get the innerProperties property: ProcessThreadInfo resource specific properties. - * - * @return the innerProperties value. - */ - private ProcessThreadInfoProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public ProcessThreadInfoInner withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the identifier property: Site extension ID. - * - * @return the identifier value. - */ - public Integer identifier() { - return this.innerProperties() == null ? null : this.innerProperties().identifier(); - } - - /** - * Get the href property: HRef URI. - * - * @return the href value. - */ - public String href() { - return this.innerProperties() == null ? null : this.innerProperties().href(); - } - - /** - * Set the href property: HRef URI. - * - * @param href the href value to set. - * @return the ProcessThreadInfoInner object itself. - */ - public ProcessThreadInfoInner withHref(String href) { - if (this.innerProperties() == null) { - this.innerProperties = new ProcessThreadInfoProperties(); - } - this.innerProperties().withHref(href); - return this; - } - - /** - * Get the process property: Process URI. - * - * @return the process value. - */ - public String process() { - return this.innerProperties() == null ? null : this.innerProperties().process(); - } - - /** - * Set the process property: Process URI. - * - * @param process the process value to set. - * @return the ProcessThreadInfoInner object itself. - */ - public ProcessThreadInfoInner withProcess(String process) { - if (this.innerProperties() == null) { - this.innerProperties = new ProcessThreadInfoProperties(); - } - this.innerProperties().withProcess(process); - return this; - } - - /** - * Get the startAddress property: Start address. - * - * @return the startAddress value. - */ - public String startAddress() { - return this.innerProperties() == null ? null : this.innerProperties().startAddress(); - } - - /** - * Set the startAddress property: Start address. - * - * @param startAddress the startAddress value to set. - * @return the ProcessThreadInfoInner object itself. - */ - public ProcessThreadInfoInner withStartAddress(String startAddress) { - if (this.innerProperties() == null) { - this.innerProperties = new ProcessThreadInfoProperties(); - } - this.innerProperties().withStartAddress(startAddress); - return this; - } - - /** - * Get the currentPriority property: Current thread priority. - * - * @return the currentPriority value. - */ - public Integer currentPriority() { - return this.innerProperties() == null ? null : this.innerProperties().currentPriority(); - } - - /** - * Set the currentPriority property: Current thread priority. - * - * @param currentPriority the currentPriority value to set. - * @return the ProcessThreadInfoInner object itself. - */ - public ProcessThreadInfoInner withCurrentPriority(Integer currentPriority) { - if (this.innerProperties() == null) { - this.innerProperties = new ProcessThreadInfoProperties(); - } - this.innerProperties().withCurrentPriority(currentPriority); - return this; - } - - /** - * Get the priorityLevel property: Thread priority level. - * - * @return the priorityLevel value. - */ - public String priorityLevel() { - return this.innerProperties() == null ? null : this.innerProperties().priorityLevel(); - } - - /** - * Set the priorityLevel property: Thread priority level. - * - * @param priorityLevel the priorityLevel value to set. - * @return the ProcessThreadInfoInner object itself. - */ - public ProcessThreadInfoInner withPriorityLevel(String priorityLevel) { - if (this.innerProperties() == null) { - this.innerProperties = new ProcessThreadInfoProperties(); - } - this.innerProperties().withPriorityLevel(priorityLevel); - return this; - } - - /** - * Get the basePriority property: Base priority. - * - * @return the basePriority value. - */ - public Integer basePriority() { - return this.innerProperties() == null ? null : this.innerProperties().basePriority(); - } - - /** - * Set the basePriority property: Base priority. - * - * @param basePriority the basePriority value to set. - * @return the ProcessThreadInfoInner object itself. - */ - public ProcessThreadInfoInner withBasePriority(Integer basePriority) { - if (this.innerProperties() == null) { - this.innerProperties = new ProcessThreadInfoProperties(); - } - this.innerProperties().withBasePriority(basePriority); - return this; - } - - /** - * Get the startTime property: Start time. - * - * @return the startTime value. - */ - public OffsetDateTime startTime() { - return this.innerProperties() == null ? null : this.innerProperties().startTime(); - } - - /** - * Set the startTime property: Start time. - * - * @param startTime the startTime value to set. - * @return the ProcessThreadInfoInner object itself. - */ - public ProcessThreadInfoInner withStartTime(OffsetDateTime startTime) { - if (this.innerProperties() == null) { - this.innerProperties = new ProcessThreadInfoProperties(); - } - this.innerProperties().withStartTime(startTime); - return this; - } - - /** - * Get the totalProcessorTime property: Total processor time. - * - * @return the totalProcessorTime value. - */ - public String totalProcessorTime() { - return this.innerProperties() == null ? null : this.innerProperties().totalProcessorTime(); - } - - /** - * Set the totalProcessorTime property: Total processor time. - * - * @param totalProcessorTime the totalProcessorTime value to set. - * @return the ProcessThreadInfoInner object itself. - */ - public ProcessThreadInfoInner withTotalProcessorTime(String totalProcessorTime) { - if (this.innerProperties() == null) { - this.innerProperties = new ProcessThreadInfoProperties(); - } - this.innerProperties().withTotalProcessorTime(totalProcessorTime); - return this; - } - - /** - * Get the userProcessorTime property: User processor time. - * - * @return the userProcessorTime value. - */ - public String userProcessorTime() { - return this.innerProperties() == null ? null : this.innerProperties().userProcessorTime(); - } - - /** - * Set the userProcessorTime property: User processor time. - * - * @param userProcessorTime the userProcessorTime value to set. - * @return the ProcessThreadInfoInner object itself. - */ - public ProcessThreadInfoInner withUserProcessorTime(String userProcessorTime) { - if (this.innerProperties() == null) { - this.innerProperties = new ProcessThreadInfoProperties(); - } - this.innerProperties().withUserProcessorTime(userProcessorTime); - return this; - } - - /** - * Get the priviledgedProcessorTime property: Privileged processor time. - * - * @return the priviledgedProcessorTime value. - */ - public String priviledgedProcessorTime() { - return this.innerProperties() == null ? null : this.innerProperties().priviledgedProcessorTime(); - } - - /** - * Set the priviledgedProcessorTime property: Privileged processor time. - * - * @param priviledgedProcessorTime the priviledgedProcessorTime value to set. - * @return the ProcessThreadInfoInner object itself. - */ - public ProcessThreadInfoInner withPriviledgedProcessorTime(String priviledgedProcessorTime) { - if (this.innerProperties() == null) { - this.innerProperties = new ProcessThreadInfoProperties(); - } - this.innerProperties().withPriviledgedProcessorTime(priviledgedProcessorTime); - return this; - } - - /** - * Get the state property: Thread state. - * - * @return the state value. - */ - public String state() { - return this.innerProperties() == null ? null : this.innerProperties().state(); - } - - /** - * Set the state property: Thread state. - * - * @param state the state value to set. - * @return the ProcessThreadInfoInner object itself. - */ - public ProcessThreadInfoInner withState(String state) { - if (this.innerProperties() == null) { - this.innerProperties = new ProcessThreadInfoProperties(); - } - this.innerProperties().withState(state); - return this; - } - - /** - * Get the waitReason property: Wait reason. - * - * @return the waitReason value. - */ - public String waitReason() { - return this.innerProperties() == null ? null : this.innerProperties().waitReason(); - } - - /** - * Set the waitReason property: Wait reason. - * - * @param waitReason the waitReason value to set. - * @return the ProcessThreadInfoInner object itself. - */ - public ProcessThreadInfoInner withWaitReason(String waitReason) { - if (this.innerProperties() == null) { - this.innerProperties = new ProcessThreadInfoProperties(); - } - this.innerProperties().withWaitReason(waitReason); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/ProcessThreadInfoProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/ProcessThreadInfoProperties.java deleted file mode 100644 index 331fef3979e5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/ProcessThreadInfoProperties.java +++ /dev/null @@ -1,352 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** ProcessThreadInfo resource specific properties. */ -@Fluent -public final class ProcessThreadInfoProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ProcessThreadInfoProperties.class); - - /* - * Site extension ID. - */ - @JsonProperty(value = "identifier", access = JsonProperty.Access.WRITE_ONLY) - private Integer identifier; - - /* - * HRef URI. - */ - @JsonProperty(value = "href") - private String href; - - /* - * Process URI. - */ - @JsonProperty(value = "process") - private String process; - - /* - * Start address. - */ - @JsonProperty(value = "start_address") - private String startAddress; - - /* - * Current thread priority. - */ - @JsonProperty(value = "current_priority") - private Integer currentPriority; - - /* - * Thread priority level. - */ - @JsonProperty(value = "priority_level") - private String priorityLevel; - - /* - * Base priority. - */ - @JsonProperty(value = "base_priority") - private Integer basePriority; - - /* - * Start time. - */ - @JsonProperty(value = "start_time") - private OffsetDateTime startTime; - - /* - * Total processor time. - */ - @JsonProperty(value = "total_processor_time") - private String totalProcessorTime; - - /* - * User processor time. - */ - @JsonProperty(value = "user_processor_time") - private String userProcessorTime; - - /* - * Privileged processor time. - */ - @JsonProperty(value = "priviledged_processor_time") - private String priviledgedProcessorTime; - - /* - * Thread state. - */ - @JsonProperty(value = "state") - private String state; - - /* - * Wait reason. - */ - @JsonProperty(value = "wait_reason") - private String waitReason; - - /** - * Get the identifier property: Site extension ID. - * - * @return the identifier value. - */ - public Integer identifier() { - return this.identifier; - } - - /** - * Get the href property: HRef URI. - * - * @return the href value. - */ - public String href() { - return this.href; - } - - /** - * Set the href property: HRef URI. - * - * @param href the href value to set. - * @return the ProcessThreadInfoProperties object itself. - */ - public ProcessThreadInfoProperties withHref(String href) { - this.href = href; - return this; - } - - /** - * Get the process property: Process URI. - * - * @return the process value. - */ - public String process() { - return this.process; - } - - /** - * Set the process property: Process URI. - * - * @param process the process value to set. - * @return the ProcessThreadInfoProperties object itself. - */ - public ProcessThreadInfoProperties withProcess(String process) { - this.process = process; - return this; - } - - /** - * Get the startAddress property: Start address. - * - * @return the startAddress value. - */ - public String startAddress() { - return this.startAddress; - } - - /** - * Set the startAddress property: Start address. - * - * @param startAddress the startAddress value to set. - * @return the ProcessThreadInfoProperties object itself. - */ - public ProcessThreadInfoProperties withStartAddress(String startAddress) { - this.startAddress = startAddress; - return this; - } - - /** - * Get the currentPriority property: Current thread priority. - * - * @return the currentPriority value. - */ - public Integer currentPriority() { - return this.currentPriority; - } - - /** - * Set the currentPriority property: Current thread priority. - * - * @param currentPriority the currentPriority value to set. - * @return the ProcessThreadInfoProperties object itself. - */ - public ProcessThreadInfoProperties withCurrentPriority(Integer currentPriority) { - this.currentPriority = currentPriority; - return this; - } - - /** - * Get the priorityLevel property: Thread priority level. - * - * @return the priorityLevel value. - */ - public String priorityLevel() { - return this.priorityLevel; - } - - /** - * Set the priorityLevel property: Thread priority level. - * - * @param priorityLevel the priorityLevel value to set. - * @return the ProcessThreadInfoProperties object itself. - */ - public ProcessThreadInfoProperties withPriorityLevel(String priorityLevel) { - this.priorityLevel = priorityLevel; - return this; - } - - /** - * Get the basePriority property: Base priority. - * - * @return the basePriority value. - */ - public Integer basePriority() { - return this.basePriority; - } - - /** - * Set the basePriority property: Base priority. - * - * @param basePriority the basePriority value to set. - * @return the ProcessThreadInfoProperties object itself. - */ - public ProcessThreadInfoProperties withBasePriority(Integer basePriority) { - this.basePriority = basePriority; - return this; - } - - /** - * Get the startTime property: Start time. - * - * @return the startTime value. - */ - public OffsetDateTime startTime() { - return this.startTime; - } - - /** - * Set the startTime property: Start time. - * - * @param startTime the startTime value to set. - * @return the ProcessThreadInfoProperties object itself. - */ - public ProcessThreadInfoProperties withStartTime(OffsetDateTime startTime) { - this.startTime = startTime; - return this; - } - - /** - * Get the totalProcessorTime property: Total processor time. - * - * @return the totalProcessorTime value. - */ - public String totalProcessorTime() { - return this.totalProcessorTime; - } - - /** - * Set the totalProcessorTime property: Total processor time. - * - * @param totalProcessorTime the totalProcessorTime value to set. - * @return the ProcessThreadInfoProperties object itself. - */ - public ProcessThreadInfoProperties withTotalProcessorTime(String totalProcessorTime) { - this.totalProcessorTime = totalProcessorTime; - return this; - } - - /** - * Get the userProcessorTime property: User processor time. - * - * @return the userProcessorTime value. - */ - public String userProcessorTime() { - return this.userProcessorTime; - } - - /** - * Set the userProcessorTime property: User processor time. - * - * @param userProcessorTime the userProcessorTime value to set. - * @return the ProcessThreadInfoProperties object itself. - */ - public ProcessThreadInfoProperties withUserProcessorTime(String userProcessorTime) { - this.userProcessorTime = userProcessorTime; - return this; - } - - /** - * Get the priviledgedProcessorTime property: Privileged processor time. - * - * @return the priviledgedProcessorTime value. - */ - public String priviledgedProcessorTime() { - return this.priviledgedProcessorTime; - } - - /** - * Set the priviledgedProcessorTime property: Privileged processor time. - * - * @param priviledgedProcessorTime the priviledgedProcessorTime value to set. - * @return the ProcessThreadInfoProperties object itself. - */ - public ProcessThreadInfoProperties withPriviledgedProcessorTime(String priviledgedProcessorTime) { - this.priviledgedProcessorTime = priviledgedProcessorTime; - return this; - } - - /** - * Get the state property: Thread state. - * - * @return the state value. - */ - public String state() { - return this.state; - } - - /** - * Set the state property: Thread state. - * - * @param state the state value to set. - * @return the ProcessThreadInfoProperties object itself. - */ - public ProcessThreadInfoProperties withState(String state) { - this.state = state; - return this; - } - - /** - * Get the waitReason property: Wait reason. - * - * @return the waitReason value. - */ - public String waitReason() { - return this.waitReason; - } - - /** - * Set the waitReason property: Wait reason. - * - * @param waitReason the waitReason value to set. - * @return the ProcessThreadInfoProperties object itself. - */ - public ProcessThreadInfoProperties withWaitReason(String waitReason) { - this.waitReason = waitReason; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/PublicCertificateInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/PublicCertificateInner.java deleted file mode 100644 index 1ec5e7730975..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/PublicCertificateInner.java +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.ProxyOnlyResource; -import com.azure.resourcemanager.appservice.models.PublicCertificateLocation; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Public certificate object. */ -@Fluent -public final class PublicCertificateInner extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PublicCertificateInner.class); - - /* - * PublicCertificate resource specific properties - */ - @JsonProperty(value = "properties") - private PublicCertificateProperties innerProperties; - - /** - * Get the innerProperties property: PublicCertificate resource specific properties. - * - * @return the innerProperties value. - */ - private PublicCertificateProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public PublicCertificateInner withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the blob property: Public Certificate byte array. - * - * @return the blob value. - */ - public byte[] blob() { - return this.innerProperties() == null ? null : this.innerProperties().blob(); - } - - /** - * Set the blob property: Public Certificate byte array. - * - * @param blob the blob value to set. - * @return the PublicCertificateInner object itself. - */ - public PublicCertificateInner withBlob(byte[] blob) { - if (this.innerProperties() == null) { - this.innerProperties = new PublicCertificateProperties(); - } - this.innerProperties().withBlob(blob); - return this; - } - - /** - * Get the publicCertificateLocation property: Public Certificate Location. - * - * @return the publicCertificateLocation value. - */ - public PublicCertificateLocation publicCertificateLocation() { - return this.innerProperties() == null ? null : this.innerProperties().publicCertificateLocation(); - } - - /** - * Set the publicCertificateLocation property: Public Certificate Location. - * - * @param publicCertificateLocation the publicCertificateLocation value to set. - * @return the PublicCertificateInner object itself. - */ - public PublicCertificateInner withPublicCertificateLocation(PublicCertificateLocation publicCertificateLocation) { - if (this.innerProperties() == null) { - this.innerProperties = new PublicCertificateProperties(); - } - this.innerProperties().withPublicCertificateLocation(publicCertificateLocation); - return this; - } - - /** - * Get the thumbprint property: Certificate Thumbprint. - * - * @return the thumbprint value. - */ - public String thumbprint() { - return this.innerProperties() == null ? null : this.innerProperties().thumbprint(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/PublicCertificateProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/PublicCertificateProperties.java deleted file mode 100644 index e61631513dd7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/PublicCertificateProperties.java +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.PublicCertificateLocation; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** PublicCertificate resource specific properties. */ -@Fluent -public final class PublicCertificateProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PublicCertificateProperties.class); - - /* - * Public Certificate byte array - */ - @JsonProperty(value = "blob") - private byte[] blob; - - /* - * Public Certificate Location - */ - @JsonProperty(value = "publicCertificateLocation") - private PublicCertificateLocation publicCertificateLocation; - - /* - * Certificate Thumbprint - */ - @JsonProperty(value = "thumbprint", access = JsonProperty.Access.WRITE_ONLY) - private String thumbprint; - - /** - * Get the blob property: Public Certificate byte array. - * - * @return the blob value. - */ - public byte[] blob() { - return CoreUtils.clone(this.blob); - } - - /** - * Set the blob property: Public Certificate byte array. - * - * @param blob the blob value to set. - * @return the PublicCertificateProperties object itself. - */ - public PublicCertificateProperties withBlob(byte[] blob) { - this.blob = CoreUtils.clone(blob); - return this; - } - - /** - * Get the publicCertificateLocation property: Public Certificate Location. - * - * @return the publicCertificateLocation value. - */ - public PublicCertificateLocation publicCertificateLocation() { - return this.publicCertificateLocation; - } - - /** - * Set the publicCertificateLocation property: Public Certificate Location. - * - * @param publicCertificateLocation the publicCertificateLocation value to set. - * @return the PublicCertificateProperties object itself. - */ - public PublicCertificateProperties withPublicCertificateLocation( - PublicCertificateLocation publicCertificateLocation) { - this.publicCertificateLocation = publicCertificateLocation; - return this; - } - - /** - * Get the thumbprint property: Certificate Thumbprint. - * - * @return the thumbprint value. - */ - public String thumbprint() { - return this.thumbprint; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/PushSettingsInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/PushSettingsInner.java deleted file mode 100644 index 464504e94fb3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/PushSettingsInner.java +++ /dev/null @@ -1,152 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.ProxyOnlyResource; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Push settings for the App. */ -@Fluent -public final class PushSettingsInner extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PushSettingsInner.class); - - /* - * PushSettings resource specific properties - */ - @JsonProperty(value = "properties") - private PushSettingsProperties innerProperties; - - /** - * Get the innerProperties property: PushSettings resource specific properties. - * - * @return the innerProperties value. - */ - private PushSettingsProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public PushSettingsInner withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the isPushEnabled property: Gets or sets a flag indicating whether the Push endpoint is enabled. - * - * @return the isPushEnabled value. - */ - public Boolean isPushEnabled() { - return this.innerProperties() == null ? null : this.innerProperties().isPushEnabled(); - } - - /** - * Set the isPushEnabled property: Gets or sets a flag indicating whether the Push endpoint is enabled. - * - * @param isPushEnabled the isPushEnabled value to set. - * @return the PushSettingsInner object itself. - */ - public PushSettingsInner withIsPushEnabled(Boolean isPushEnabled) { - if (this.innerProperties() == null) { - this.innerProperties = new PushSettingsProperties(); - } - this.innerProperties().withIsPushEnabled(isPushEnabled); - return this; - } - - /** - * Get the tagWhitelistJson property: Gets or sets a JSON string containing a list of tags that are whitelisted for - * use by the push registration endpoint. - * - * @return the tagWhitelistJson value. - */ - public String tagWhitelistJson() { - return this.innerProperties() == null ? null : this.innerProperties().tagWhitelistJson(); - } - - /** - * Set the tagWhitelistJson property: Gets or sets a JSON string containing a list of tags that are whitelisted for - * use by the push registration endpoint. - * - * @param tagWhitelistJson the tagWhitelistJson value to set. - * @return the PushSettingsInner object itself. - */ - public PushSettingsInner withTagWhitelistJson(String tagWhitelistJson) { - if (this.innerProperties() == null) { - this.innerProperties = new PushSettingsProperties(); - } - this.innerProperties().withTagWhitelistJson(tagWhitelistJson); - return this; - } - - /** - * Get the tagsRequiringAuth property: Gets or sets a JSON string containing a list of tags that require user - * authentication to be used in the push registration endpoint. Tags can consist of alphanumeric characters and the - * following: '_', '@', '#', '.', ':', '-'. Validation should be performed at the PushRequestHandler. - * - * @return the tagsRequiringAuth value. - */ - public String tagsRequiringAuth() { - return this.innerProperties() == null ? null : this.innerProperties().tagsRequiringAuth(); - } - - /** - * Set the tagsRequiringAuth property: Gets or sets a JSON string containing a list of tags that require user - * authentication to be used in the push registration endpoint. Tags can consist of alphanumeric characters and the - * following: '_', '@', '#', '.', ':', '-'. Validation should be performed at the PushRequestHandler. - * - * @param tagsRequiringAuth the tagsRequiringAuth value to set. - * @return the PushSettingsInner object itself. - */ - public PushSettingsInner withTagsRequiringAuth(String tagsRequiringAuth) { - if (this.innerProperties() == null) { - this.innerProperties = new PushSettingsProperties(); - } - this.innerProperties().withTagsRequiringAuth(tagsRequiringAuth); - return this; - } - - /** - * Get the dynamicTagsJson property: Gets or sets a JSON string containing a list of dynamic tags that will be - * evaluated from user claims in the push registration endpoint. - * - * @return the dynamicTagsJson value. - */ - public String dynamicTagsJson() { - return this.innerProperties() == null ? null : this.innerProperties().dynamicTagsJson(); - } - - /** - * Set the dynamicTagsJson property: Gets or sets a JSON string containing a list of dynamic tags that will be - * evaluated from user claims in the push registration endpoint. - * - * @param dynamicTagsJson the dynamicTagsJson value to set. - * @return the PushSettingsInner object itself. - */ - public PushSettingsInner withDynamicTagsJson(String dynamicTagsJson) { - if (this.innerProperties() == null) { - this.innerProperties = new PushSettingsProperties(); - } - this.innerProperties().withDynamicTagsJson(dynamicTagsJson); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/PushSettingsProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/PushSettingsProperties.java deleted file mode 100644 index c270b42cc019..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/PushSettingsProperties.java +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** PushSettings resource specific properties. */ -@Fluent -public final class PushSettingsProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PushSettingsProperties.class); - - /* - * Gets or sets a flag indicating whether the Push endpoint is enabled. - */ - @JsonProperty(value = "isPushEnabled", required = true) - private boolean isPushEnabled; - - /* - * Gets or sets a JSON string containing a list of tags that are - * whitelisted for use by the push registration endpoint. - */ - @JsonProperty(value = "tagWhitelistJson") - private String tagWhitelistJson; - - /* - * Gets or sets a JSON string containing a list of tags that require user - * authentication to be used in the push registration endpoint. - * Tags can consist of alphanumeric characters and the following: - * '_', '@', '#', '.', ':', '-'. - * Validation should be performed at the PushRequestHandler. - */ - @JsonProperty(value = "tagsRequiringAuth") - private String tagsRequiringAuth; - - /* - * Gets or sets a JSON string containing a list of dynamic tags that will - * be evaluated from user claims in the push registration endpoint. - */ - @JsonProperty(value = "dynamicTagsJson") - private String dynamicTagsJson; - - /** - * Get the isPushEnabled property: Gets or sets a flag indicating whether the Push endpoint is enabled. - * - * @return the isPushEnabled value. - */ - public boolean isPushEnabled() { - return this.isPushEnabled; - } - - /** - * Set the isPushEnabled property: Gets or sets a flag indicating whether the Push endpoint is enabled. - * - * @param isPushEnabled the isPushEnabled value to set. - * @return the PushSettingsProperties object itself. - */ - public PushSettingsProperties withIsPushEnabled(boolean isPushEnabled) { - this.isPushEnabled = isPushEnabled; - return this; - } - - /** - * Get the tagWhitelistJson property: Gets or sets a JSON string containing a list of tags that are whitelisted for - * use by the push registration endpoint. - * - * @return the tagWhitelistJson value. - */ - public String tagWhitelistJson() { - return this.tagWhitelistJson; - } - - /** - * Set the tagWhitelistJson property: Gets or sets a JSON string containing a list of tags that are whitelisted for - * use by the push registration endpoint. - * - * @param tagWhitelistJson the tagWhitelistJson value to set. - * @return the PushSettingsProperties object itself. - */ - public PushSettingsProperties withTagWhitelistJson(String tagWhitelistJson) { - this.tagWhitelistJson = tagWhitelistJson; - return this; - } - - /** - * Get the tagsRequiringAuth property: Gets or sets a JSON string containing a list of tags that require user - * authentication to be used in the push registration endpoint. Tags can consist of alphanumeric characters and the - * following: '_', '@', '#', '.', ':', '-'. Validation should be performed at the PushRequestHandler. - * - * @return the tagsRequiringAuth value. - */ - public String tagsRequiringAuth() { - return this.tagsRequiringAuth; - } - - /** - * Set the tagsRequiringAuth property: Gets or sets a JSON string containing a list of tags that require user - * authentication to be used in the push registration endpoint. Tags can consist of alphanumeric characters and the - * following: '_', '@', '#', '.', ':', '-'. Validation should be performed at the PushRequestHandler. - * - * @param tagsRequiringAuth the tagsRequiringAuth value to set. - * @return the PushSettingsProperties object itself. - */ - public PushSettingsProperties withTagsRequiringAuth(String tagsRequiringAuth) { - this.tagsRequiringAuth = tagsRequiringAuth; - return this; - } - - /** - * Get the dynamicTagsJson property: Gets or sets a JSON string containing a list of dynamic tags that will be - * evaluated from user claims in the push registration endpoint. - * - * @return the dynamicTagsJson value. - */ - public String dynamicTagsJson() { - return this.dynamicTagsJson; - } - - /** - * Set the dynamicTagsJson property: Gets or sets a JSON string containing a list of dynamic tags that will be - * evaluated from user claims in the push registration endpoint. - * - * @param dynamicTagsJson the dynamicTagsJson value to set. - * @return the PushSettingsProperties object itself. - */ - public PushSettingsProperties withDynamicTagsJson(String dynamicTagsJson) { - this.dynamicTagsJson = dynamicTagsJson; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/RecommendationInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/RecommendationInner.java deleted file mode 100644 index b61680db4eda..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/RecommendationInner.java +++ /dev/null @@ -1,581 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.Channels; -import com.azure.resourcemanager.appservice.models.NotificationLevel; -import com.azure.resourcemanager.appservice.models.ProxyOnlyResource; -import com.azure.resourcemanager.appservice.models.ResourceScopeType; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; -import java.util.UUID; - -/** Represents a recommendation result generated by the recommendation engine. */ -@Fluent -public final class RecommendationInner extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RecommendationInner.class); - - /* - * Recommendation resource specific properties - */ - @JsonProperty(value = "properties") - private RecommendationProperties innerProperties; - - /** - * Get the innerProperties property: Recommendation resource specific properties. - * - * @return the innerProperties value. - */ - private RecommendationProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public RecommendationInner withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the creationTime property: Timestamp when this instance was created. - * - * @return the creationTime value. - */ - public OffsetDateTime creationTime() { - return this.innerProperties() == null ? null : this.innerProperties().creationTime(); - } - - /** - * Set the creationTime property: Timestamp when this instance was created. - * - * @param creationTime the creationTime value to set. - * @return the RecommendationInner object itself. - */ - public RecommendationInner withCreationTime(OffsetDateTime creationTime) { - if (this.innerProperties() == null) { - this.innerProperties = new RecommendationProperties(); - } - this.innerProperties().withCreationTime(creationTime); - return this; - } - - /** - * Get the recommendationId property: A GUID value that each recommendation object is associated with. - * - * @return the recommendationId value. - */ - public UUID recommendationId() { - return this.innerProperties() == null ? null : this.innerProperties().recommendationId(); - } - - /** - * Set the recommendationId property: A GUID value that each recommendation object is associated with. - * - * @param recommendationId the recommendationId value to set. - * @return the RecommendationInner object itself. - */ - public RecommendationInner withRecommendationId(UUID recommendationId) { - if (this.innerProperties() == null) { - this.innerProperties = new RecommendationProperties(); - } - this.innerProperties().withRecommendationId(recommendationId); - return this; - } - - /** - * Get the resourceId property: Full ARM resource ID string that this recommendation object is associated with. - * - * @return the resourceId value. - */ - public String resourceId() { - return this.innerProperties() == null ? null : this.innerProperties().resourceId(); - } - - /** - * Set the resourceId property: Full ARM resource ID string that this recommendation object is associated with. - * - * @param resourceId the resourceId value to set. - * @return the RecommendationInner object itself. - */ - public RecommendationInner withResourceId(String resourceId) { - if (this.innerProperties() == null) { - this.innerProperties = new RecommendationProperties(); - } - this.innerProperties().withResourceId(resourceId); - return this; - } - - /** - * Get the resourceScope property: Name of a resource type this recommendation applies, e.g. Subscription, - * ServerFarm, Site. - * - * @return the resourceScope value. - */ - public ResourceScopeType resourceScope() { - return this.innerProperties() == null ? null : this.innerProperties().resourceScope(); - } - - /** - * Set the resourceScope property: Name of a resource type this recommendation applies, e.g. Subscription, - * ServerFarm, Site. - * - * @param resourceScope the resourceScope value to set. - * @return the RecommendationInner object itself. - */ - public RecommendationInner withResourceScope(ResourceScopeType resourceScope) { - if (this.innerProperties() == null) { - this.innerProperties = new RecommendationProperties(); - } - this.innerProperties().withResourceScope(resourceScope); - return this; - } - - /** - * Get the ruleName property: Unique name of the rule. - * - * @return the ruleName value. - */ - public String ruleName() { - return this.innerProperties() == null ? null : this.innerProperties().ruleName(); - } - - /** - * Set the ruleName property: Unique name of the rule. - * - * @param ruleName the ruleName value to set. - * @return the RecommendationInner object itself. - */ - public RecommendationInner withRuleName(String ruleName) { - if (this.innerProperties() == null) { - this.innerProperties = new RecommendationProperties(); - } - this.innerProperties().withRuleName(ruleName); - return this; - } - - /** - * Get the displayName property: UI friendly name of the rule (may not be unique). - * - * @return the displayName value. - */ - public String displayName() { - return this.innerProperties() == null ? null : this.innerProperties().displayName(); - } - - /** - * Set the displayName property: UI friendly name of the rule (may not be unique). - * - * @param displayName the displayName value to set. - * @return the RecommendationInner object itself. - */ - public RecommendationInner withDisplayName(String displayName) { - if (this.innerProperties() == null) { - this.innerProperties = new RecommendationProperties(); - } - this.innerProperties().withDisplayName(displayName); - return this; - } - - /** - * Get the message property: Recommendation text. - * - * @return the message value. - */ - public String message() { - return this.innerProperties() == null ? null : this.innerProperties().message(); - } - - /** - * Set the message property: Recommendation text. - * - * @param message the message value to set. - * @return the RecommendationInner object itself. - */ - public RecommendationInner withMessage(String message) { - if (this.innerProperties() == null) { - this.innerProperties = new RecommendationProperties(); - } - this.innerProperties().withMessage(message); - return this; - } - - /** - * Get the level property: Level indicating how critical this recommendation can impact. - * - * @return the level value. - */ - public NotificationLevel level() { - return this.innerProperties() == null ? null : this.innerProperties().level(); - } - - /** - * Set the level property: Level indicating how critical this recommendation can impact. - * - * @param level the level value to set. - * @return the RecommendationInner object itself. - */ - public RecommendationInner withLevel(NotificationLevel level) { - if (this.innerProperties() == null) { - this.innerProperties = new RecommendationProperties(); - } - this.innerProperties().withLevel(level); - return this; - } - - /** - * Get the channels property: List of channels that this recommendation can apply. - * - * @return the channels value. - */ - public Channels channels() { - return this.innerProperties() == null ? null : this.innerProperties().channels(); - } - - /** - * Set the channels property: List of channels that this recommendation can apply. - * - * @param channels the channels value to set. - * @return the RecommendationInner object itself. - */ - public RecommendationInner withChannels(Channels channels) { - if (this.innerProperties() == null) { - this.innerProperties = new RecommendationProperties(); - } - this.innerProperties().withChannels(channels); - return this; - } - - /** - * Get the categoryTags property: The list of category tags that this recommendation belongs to. - * - * @return the categoryTags value. - */ - public List categoryTags() { - return this.innerProperties() == null ? null : this.innerProperties().categoryTags(); - } - - /** - * Get the actionName property: Name of action recommended by this object. - * - * @return the actionName value. - */ - public String actionName() { - return this.innerProperties() == null ? null : this.innerProperties().actionName(); - } - - /** - * Set the actionName property: Name of action recommended by this object. - * - * @param actionName the actionName value to set. - * @return the RecommendationInner object itself. - */ - public RecommendationInner withActionName(String actionName) { - if (this.innerProperties() == null) { - this.innerProperties = new RecommendationProperties(); - } - this.innerProperties().withActionName(actionName); - return this; - } - - /** - * Get the enabled property: True if this recommendation is still valid (i.e. "actionable"). False if it is invalid. - * - * @return the enabled value. - */ - public Integer enabled() { - return this.innerProperties() == null ? null : this.innerProperties().enabled(); - } - - /** - * Set the enabled property: True if this recommendation is still valid (i.e. "actionable"). False if it is invalid. - * - * @param enabled the enabled value to set. - * @return the RecommendationInner object itself. - */ - public RecommendationInner withEnabled(Integer enabled) { - if (this.innerProperties() == null) { - this.innerProperties = new RecommendationProperties(); - } - this.innerProperties().withEnabled(enabled); - return this; - } - - /** - * Get the states property: The list of states of this recommendation. If it's null then it should be considered - * "Active". - * - * @return the states value. - */ - public List states() { - return this.innerProperties() == null ? null : this.innerProperties().states(); - } - - /** - * Set the states property: The list of states of this recommendation. If it's null then it should be considered - * "Active". - * - * @param states the states value to set. - * @return the RecommendationInner object itself. - */ - public RecommendationInner withStates(List states) { - if (this.innerProperties() == null) { - this.innerProperties = new RecommendationProperties(); - } - this.innerProperties().withStates(states); - return this; - } - - /** - * Get the startTime property: The beginning time in UTC of a range that the recommendation refers to. - * - * @return the startTime value. - */ - public OffsetDateTime startTime() { - return this.innerProperties() == null ? null : this.innerProperties().startTime(); - } - - /** - * Set the startTime property: The beginning time in UTC of a range that the recommendation refers to. - * - * @param startTime the startTime value to set. - * @return the RecommendationInner object itself. - */ - public RecommendationInner withStartTime(OffsetDateTime startTime) { - if (this.innerProperties() == null) { - this.innerProperties = new RecommendationProperties(); - } - this.innerProperties().withStartTime(startTime); - return this; - } - - /** - * Get the endTime property: The end time in UTC of a range that the recommendation refers to. - * - * @return the endTime value. - */ - public OffsetDateTime endTime() { - return this.innerProperties() == null ? null : this.innerProperties().endTime(); - } - - /** - * Set the endTime property: The end time in UTC of a range that the recommendation refers to. - * - * @param endTime the endTime value to set. - * @return the RecommendationInner object itself. - */ - public RecommendationInner withEndTime(OffsetDateTime endTime) { - if (this.innerProperties() == null) { - this.innerProperties = new RecommendationProperties(); - } - this.innerProperties().withEndTime(endTime); - return this; - } - - /** - * Get the nextNotificationTime property: When to notify this recommendation next in UTC. Null means that this will - * never be notified anymore. - * - * @return the nextNotificationTime value. - */ - public OffsetDateTime nextNotificationTime() { - return this.innerProperties() == null ? null : this.innerProperties().nextNotificationTime(); - } - - /** - * Set the nextNotificationTime property: When to notify this recommendation next in UTC. Null means that this will - * never be notified anymore. - * - * @param nextNotificationTime the nextNotificationTime value to set. - * @return the RecommendationInner object itself. - */ - public RecommendationInner withNextNotificationTime(OffsetDateTime nextNotificationTime) { - if (this.innerProperties() == null) { - this.innerProperties = new RecommendationProperties(); - } - this.innerProperties().withNextNotificationTime(nextNotificationTime); - return this; - } - - /** - * Get the notificationExpirationTime property: Date and time in UTC when this notification expires. - * - * @return the notificationExpirationTime value. - */ - public OffsetDateTime notificationExpirationTime() { - return this.innerProperties() == null ? null : this.innerProperties().notificationExpirationTime(); - } - - /** - * Set the notificationExpirationTime property: Date and time in UTC when this notification expires. - * - * @param notificationExpirationTime the notificationExpirationTime value to set. - * @return the RecommendationInner object itself. - */ - public RecommendationInner withNotificationExpirationTime(OffsetDateTime notificationExpirationTime) { - if (this.innerProperties() == null) { - this.innerProperties = new RecommendationProperties(); - } - this.innerProperties().withNotificationExpirationTime(notificationExpirationTime); - return this; - } - - /** - * Get the notifiedTime property: Last timestamp in UTC this instance was actually notified. Null means that this - * recommendation hasn't been notified yet. - * - * @return the notifiedTime value. - */ - public OffsetDateTime notifiedTime() { - return this.innerProperties() == null ? null : this.innerProperties().notifiedTime(); - } - - /** - * Set the notifiedTime property: Last timestamp in UTC this instance was actually notified. Null means that this - * recommendation hasn't been notified yet. - * - * @param notifiedTime the notifiedTime value to set. - * @return the RecommendationInner object itself. - */ - public RecommendationInner withNotifiedTime(OffsetDateTime notifiedTime) { - if (this.innerProperties() == null) { - this.innerProperties = new RecommendationProperties(); - } - this.innerProperties().withNotifiedTime(notifiedTime); - return this; - } - - /** - * Get the score property: A metric value measured by the rule. - * - * @return the score value. - */ - public Double score() { - return this.innerProperties() == null ? null : this.innerProperties().score(); - } - - /** - * Set the score property: A metric value measured by the rule. - * - * @param score the score value to set. - * @return the RecommendationInner object itself. - */ - public RecommendationInner withScore(Double score) { - if (this.innerProperties() == null) { - this.innerProperties = new RecommendationProperties(); - } - this.innerProperties().withScore(score); - return this; - } - - /** - * Get the isDynamic property: True if this is associated with a dynamically added rule. - * - * @return the isDynamic value. - */ - public Boolean isDynamic() { - return this.innerProperties() == null ? null : this.innerProperties().isDynamic(); - } - - /** - * Set the isDynamic property: True if this is associated with a dynamically added rule. - * - * @param isDynamic the isDynamic value to set. - * @return the RecommendationInner object itself. - */ - public RecommendationInner withIsDynamic(Boolean isDynamic) { - if (this.innerProperties() == null) { - this.innerProperties = new RecommendationProperties(); - } - this.innerProperties().withIsDynamic(isDynamic); - return this; - } - - /** - * Get the extensionName property: Extension name of the portal if exists. - * - * @return the extensionName value. - */ - public String extensionName() { - return this.innerProperties() == null ? null : this.innerProperties().extensionName(); - } - - /** - * Set the extensionName property: Extension name of the portal if exists. - * - * @param extensionName the extensionName value to set. - * @return the RecommendationInner object itself. - */ - public RecommendationInner withExtensionName(String extensionName) { - if (this.innerProperties() == null) { - this.innerProperties = new RecommendationProperties(); - } - this.innerProperties().withExtensionName(extensionName); - return this; - } - - /** - * Get the bladeName property: Deep link to a blade on the portal. - * - * @return the bladeName value. - */ - public String bladeName() { - return this.innerProperties() == null ? null : this.innerProperties().bladeName(); - } - - /** - * Set the bladeName property: Deep link to a blade on the portal. - * - * @param bladeName the bladeName value to set. - * @return the RecommendationInner object itself. - */ - public RecommendationInner withBladeName(String bladeName) { - if (this.innerProperties() == null) { - this.innerProperties = new RecommendationProperties(); - } - this.innerProperties().withBladeName(bladeName); - return this; - } - - /** - * Get the forwardLink property: Forward link to an external document associated with the rule. - * - * @return the forwardLink value. - */ - public String forwardLink() { - return this.innerProperties() == null ? null : this.innerProperties().forwardLink(); - } - - /** - * Set the forwardLink property: Forward link to an external document associated with the rule. - * - * @param forwardLink the forwardLink value to set. - * @return the RecommendationInner object itself. - */ - public RecommendationInner withForwardLink(String forwardLink) { - if (this.innerProperties() == null) { - this.innerProperties = new RecommendationProperties(); - } - this.innerProperties().withForwardLink(forwardLink); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/RecommendationProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/RecommendationProperties.java deleted file mode 100644 index 7932c0864c35..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/RecommendationProperties.java +++ /dev/null @@ -1,631 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.Channels; -import com.azure.resourcemanager.appservice.models.NotificationLevel; -import com.azure.resourcemanager.appservice.models.ResourceScopeType; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; -import java.util.UUID; - -/** Recommendation resource specific properties. */ -@Fluent -public final class RecommendationProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RecommendationProperties.class); - - /* - * Timestamp when this instance was created. - */ - @JsonProperty(value = "creationTime") - private OffsetDateTime creationTime; - - /* - * A GUID value that each recommendation object is associated with. - */ - @JsonProperty(value = "recommendationId") - private UUID recommendationId; - - /* - * Full ARM resource ID string that this recommendation object is - * associated with. - */ - @JsonProperty(value = "resourceId") - private String resourceId; - - /* - * Name of a resource type this recommendation applies, e.g. Subscription, - * ServerFarm, Site. - */ - @JsonProperty(value = "resourceScope") - private ResourceScopeType resourceScope; - - /* - * Unique name of the rule. - */ - @JsonProperty(value = "ruleName") - private String ruleName; - - /* - * UI friendly name of the rule (may not be unique). - */ - @JsonProperty(value = "displayName") - private String displayName; - - /* - * Recommendation text. - */ - @JsonProperty(value = "message") - private String message; - - /* - * Level indicating how critical this recommendation can impact. - */ - @JsonProperty(value = "level") - private NotificationLevel level; - - /* - * List of channels that this recommendation can apply. - */ - @JsonProperty(value = "channels") - private Channels channels; - - /* - * The list of category tags that this recommendation belongs to. - */ - @JsonProperty(value = "categoryTags", access = JsonProperty.Access.WRITE_ONLY) - private List categoryTags; - - /* - * Name of action recommended by this object. - */ - @JsonProperty(value = "actionName") - private String actionName; - - /* - * True if this recommendation is still valid (i.e. "actionable"). False if - * it is invalid. - */ - @JsonProperty(value = "enabled") - private Integer enabled; - - /* - * The list of states of this recommendation. If it's null then it should - * be considered "Active". - */ - @JsonProperty(value = "states") - private List states; - - /* - * The beginning time in UTC of a range that the recommendation refers to. - */ - @JsonProperty(value = "startTime") - private OffsetDateTime startTime; - - /* - * The end time in UTC of a range that the recommendation refers to. - */ - @JsonProperty(value = "endTime") - private OffsetDateTime endTime; - - /* - * When to notify this recommendation next in UTC. Null means that this - * will never be notified anymore. - */ - @JsonProperty(value = "nextNotificationTime") - private OffsetDateTime nextNotificationTime; - - /* - * Date and time in UTC when this notification expires. - */ - @JsonProperty(value = "notificationExpirationTime") - private OffsetDateTime notificationExpirationTime; - - /* - * Last timestamp in UTC this instance was actually notified. Null means - * that this recommendation hasn't been notified yet. - */ - @JsonProperty(value = "notifiedTime") - private OffsetDateTime notifiedTime; - - /* - * A metric value measured by the rule. - */ - @JsonProperty(value = "score") - private Double score; - - /* - * True if this is associated with a dynamically added rule - */ - @JsonProperty(value = "isDynamic") - private Boolean isDynamic; - - /* - * Extension name of the portal if exists. - */ - @JsonProperty(value = "extensionName") - private String extensionName; - - /* - * Deep link to a blade on the portal. - */ - @JsonProperty(value = "bladeName") - private String bladeName; - - /* - * Forward link to an external document associated with the rule. - */ - @JsonProperty(value = "forwardLink") - private String forwardLink; - - /** - * Get the creationTime property: Timestamp when this instance was created. - * - * @return the creationTime value. - */ - public OffsetDateTime creationTime() { - return this.creationTime; - } - - /** - * Set the creationTime property: Timestamp when this instance was created. - * - * @param creationTime the creationTime value to set. - * @return the RecommendationProperties object itself. - */ - public RecommendationProperties withCreationTime(OffsetDateTime creationTime) { - this.creationTime = creationTime; - return this; - } - - /** - * Get the recommendationId property: A GUID value that each recommendation object is associated with. - * - * @return the recommendationId value. - */ - public UUID recommendationId() { - return this.recommendationId; - } - - /** - * Set the recommendationId property: A GUID value that each recommendation object is associated with. - * - * @param recommendationId the recommendationId value to set. - * @return the RecommendationProperties object itself. - */ - public RecommendationProperties withRecommendationId(UUID recommendationId) { - this.recommendationId = recommendationId; - return this; - } - - /** - * Get the resourceId property: Full ARM resource ID string that this recommendation object is associated with. - * - * @return the resourceId value. - */ - public String resourceId() { - return this.resourceId; - } - - /** - * Set the resourceId property: Full ARM resource ID string that this recommendation object is associated with. - * - * @param resourceId the resourceId value to set. - * @return the RecommendationProperties object itself. - */ - public RecommendationProperties withResourceId(String resourceId) { - this.resourceId = resourceId; - return this; - } - - /** - * Get the resourceScope property: Name of a resource type this recommendation applies, e.g. Subscription, - * ServerFarm, Site. - * - * @return the resourceScope value. - */ - public ResourceScopeType resourceScope() { - return this.resourceScope; - } - - /** - * Set the resourceScope property: Name of a resource type this recommendation applies, e.g. Subscription, - * ServerFarm, Site. - * - * @param resourceScope the resourceScope value to set. - * @return the RecommendationProperties object itself. - */ - public RecommendationProperties withResourceScope(ResourceScopeType resourceScope) { - this.resourceScope = resourceScope; - return this; - } - - /** - * Get the ruleName property: Unique name of the rule. - * - * @return the ruleName value. - */ - public String ruleName() { - return this.ruleName; - } - - /** - * Set the ruleName property: Unique name of the rule. - * - * @param ruleName the ruleName value to set. - * @return the RecommendationProperties object itself. - */ - public RecommendationProperties withRuleName(String ruleName) { - this.ruleName = ruleName; - return this; - } - - /** - * Get the displayName property: UI friendly name of the rule (may not be unique). - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Set the displayName property: UI friendly name of the rule (may not be unique). - * - * @param displayName the displayName value to set. - * @return the RecommendationProperties object itself. - */ - public RecommendationProperties withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - - /** - * Get the message property: Recommendation text. - * - * @return the message value. - */ - public String message() { - return this.message; - } - - /** - * Set the message property: Recommendation text. - * - * @param message the message value to set. - * @return the RecommendationProperties object itself. - */ - public RecommendationProperties withMessage(String message) { - this.message = message; - return this; - } - - /** - * Get the level property: Level indicating how critical this recommendation can impact. - * - * @return the level value. - */ - public NotificationLevel level() { - return this.level; - } - - /** - * Set the level property: Level indicating how critical this recommendation can impact. - * - * @param level the level value to set. - * @return the RecommendationProperties object itself. - */ - public RecommendationProperties withLevel(NotificationLevel level) { - this.level = level; - return this; - } - - /** - * Get the channels property: List of channels that this recommendation can apply. - * - * @return the channels value. - */ - public Channels channels() { - return this.channels; - } - - /** - * Set the channels property: List of channels that this recommendation can apply. - * - * @param channels the channels value to set. - * @return the RecommendationProperties object itself. - */ - public RecommendationProperties withChannels(Channels channels) { - this.channels = channels; - return this; - } - - /** - * Get the categoryTags property: The list of category tags that this recommendation belongs to. - * - * @return the categoryTags value. - */ - public List categoryTags() { - return this.categoryTags; - } - - /** - * Get the actionName property: Name of action recommended by this object. - * - * @return the actionName value. - */ - public String actionName() { - return this.actionName; - } - - /** - * Set the actionName property: Name of action recommended by this object. - * - * @param actionName the actionName value to set. - * @return the RecommendationProperties object itself. - */ - public RecommendationProperties withActionName(String actionName) { - this.actionName = actionName; - return this; - } - - /** - * Get the enabled property: True if this recommendation is still valid (i.e. "actionable"). False if it is invalid. - * - * @return the enabled value. - */ - public Integer enabled() { - return this.enabled; - } - - /** - * Set the enabled property: True if this recommendation is still valid (i.e. "actionable"). False if it is invalid. - * - * @param enabled the enabled value to set. - * @return the RecommendationProperties object itself. - */ - public RecommendationProperties withEnabled(Integer enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the states property: The list of states of this recommendation. If it's null then it should be considered - * "Active". - * - * @return the states value. - */ - public List states() { - return this.states; - } - - /** - * Set the states property: The list of states of this recommendation. If it's null then it should be considered - * "Active". - * - * @param states the states value to set. - * @return the RecommendationProperties object itself. - */ - public RecommendationProperties withStates(List states) { - this.states = states; - return this; - } - - /** - * Get the startTime property: The beginning time in UTC of a range that the recommendation refers to. - * - * @return the startTime value. - */ - public OffsetDateTime startTime() { - return this.startTime; - } - - /** - * Set the startTime property: The beginning time in UTC of a range that the recommendation refers to. - * - * @param startTime the startTime value to set. - * @return the RecommendationProperties object itself. - */ - public RecommendationProperties withStartTime(OffsetDateTime startTime) { - this.startTime = startTime; - return this; - } - - /** - * Get the endTime property: The end time in UTC of a range that the recommendation refers to. - * - * @return the endTime value. - */ - public OffsetDateTime endTime() { - return this.endTime; - } - - /** - * Set the endTime property: The end time in UTC of a range that the recommendation refers to. - * - * @param endTime the endTime value to set. - * @return the RecommendationProperties object itself. - */ - public RecommendationProperties withEndTime(OffsetDateTime endTime) { - this.endTime = endTime; - return this; - } - - /** - * Get the nextNotificationTime property: When to notify this recommendation next in UTC. Null means that this will - * never be notified anymore. - * - * @return the nextNotificationTime value. - */ - public OffsetDateTime nextNotificationTime() { - return this.nextNotificationTime; - } - - /** - * Set the nextNotificationTime property: When to notify this recommendation next in UTC. Null means that this will - * never be notified anymore. - * - * @param nextNotificationTime the nextNotificationTime value to set. - * @return the RecommendationProperties object itself. - */ - public RecommendationProperties withNextNotificationTime(OffsetDateTime nextNotificationTime) { - this.nextNotificationTime = nextNotificationTime; - return this; - } - - /** - * Get the notificationExpirationTime property: Date and time in UTC when this notification expires. - * - * @return the notificationExpirationTime value. - */ - public OffsetDateTime notificationExpirationTime() { - return this.notificationExpirationTime; - } - - /** - * Set the notificationExpirationTime property: Date and time in UTC when this notification expires. - * - * @param notificationExpirationTime the notificationExpirationTime value to set. - * @return the RecommendationProperties object itself. - */ - public RecommendationProperties withNotificationExpirationTime(OffsetDateTime notificationExpirationTime) { - this.notificationExpirationTime = notificationExpirationTime; - return this; - } - - /** - * Get the notifiedTime property: Last timestamp in UTC this instance was actually notified. Null means that this - * recommendation hasn't been notified yet. - * - * @return the notifiedTime value. - */ - public OffsetDateTime notifiedTime() { - return this.notifiedTime; - } - - /** - * Set the notifiedTime property: Last timestamp in UTC this instance was actually notified. Null means that this - * recommendation hasn't been notified yet. - * - * @param notifiedTime the notifiedTime value to set. - * @return the RecommendationProperties object itself. - */ - public RecommendationProperties withNotifiedTime(OffsetDateTime notifiedTime) { - this.notifiedTime = notifiedTime; - return this; - } - - /** - * Get the score property: A metric value measured by the rule. - * - * @return the score value. - */ - public Double score() { - return this.score; - } - - /** - * Set the score property: A metric value measured by the rule. - * - * @param score the score value to set. - * @return the RecommendationProperties object itself. - */ - public RecommendationProperties withScore(Double score) { - this.score = score; - return this; - } - - /** - * Get the isDynamic property: True if this is associated with a dynamically added rule. - * - * @return the isDynamic value. - */ - public Boolean isDynamic() { - return this.isDynamic; - } - - /** - * Set the isDynamic property: True if this is associated with a dynamically added rule. - * - * @param isDynamic the isDynamic value to set. - * @return the RecommendationProperties object itself. - */ - public RecommendationProperties withIsDynamic(Boolean isDynamic) { - this.isDynamic = isDynamic; - return this; - } - - /** - * Get the extensionName property: Extension name of the portal if exists. - * - * @return the extensionName value. - */ - public String extensionName() { - return this.extensionName; - } - - /** - * Set the extensionName property: Extension name of the portal if exists. - * - * @param extensionName the extensionName value to set. - * @return the RecommendationProperties object itself. - */ - public RecommendationProperties withExtensionName(String extensionName) { - this.extensionName = extensionName; - return this; - } - - /** - * Get the bladeName property: Deep link to a blade on the portal. - * - * @return the bladeName value. - */ - public String bladeName() { - return this.bladeName; - } - - /** - * Set the bladeName property: Deep link to a blade on the portal. - * - * @param bladeName the bladeName value to set. - * @return the RecommendationProperties object itself. - */ - public RecommendationProperties withBladeName(String bladeName) { - this.bladeName = bladeName; - return this; - } - - /** - * Get the forwardLink property: Forward link to an external document associated with the rule. - * - * @return the forwardLink value. - */ - public String forwardLink() { - return this.forwardLink; - } - - /** - * Set the forwardLink property: Forward link to an external document associated with the rule. - * - * @param forwardLink the forwardLink value to set. - * @return the RecommendationProperties object itself. - */ - public RecommendationProperties withForwardLink(String forwardLink) { - this.forwardLink = forwardLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/RecommendationRuleInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/RecommendationRuleInner.java deleted file mode 100644 index fcfc3ab6e536..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/RecommendationRuleInner.java +++ /dev/null @@ -1,345 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.Channels; -import com.azure.resourcemanager.appservice.models.NotificationLevel; -import com.azure.resourcemanager.appservice.models.ProxyOnlyResource; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.UUID; - -/** Represents a recommendation rule that the recommendation engine can perform. */ -@Fluent -public final class RecommendationRuleInner extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RecommendationRuleInner.class); - - /* - * RecommendationRule resource specific properties - */ - @JsonProperty(value = "properties") - private RecommendationRuleProperties innerProperties; - - /** - * Get the innerProperties property: RecommendationRule resource specific properties. - * - * @return the innerProperties value. - */ - private RecommendationRuleProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public RecommendationRuleInner withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the recommendationName property: Unique name of the rule. - * - * @return the recommendationName value. - */ - public String recommendationName() { - return this.innerProperties() == null ? null : this.innerProperties().recommendationName(); - } - - /** - * Set the recommendationName property: Unique name of the rule. - * - * @param recommendationName the recommendationName value to set. - * @return the RecommendationRuleInner object itself. - */ - public RecommendationRuleInner withRecommendationName(String recommendationName) { - if (this.innerProperties() == null) { - this.innerProperties = new RecommendationRuleProperties(); - } - this.innerProperties().withRecommendationName(recommendationName); - return this; - } - - /** - * Get the displayName property: UI friendly name of the rule. - * - * @return the displayName value. - */ - public String displayName() { - return this.innerProperties() == null ? null : this.innerProperties().displayName(); - } - - /** - * Set the displayName property: UI friendly name of the rule. - * - * @param displayName the displayName value to set. - * @return the RecommendationRuleInner object itself. - */ - public RecommendationRuleInner withDisplayName(String displayName) { - if (this.innerProperties() == null) { - this.innerProperties = new RecommendationRuleProperties(); - } - this.innerProperties().withDisplayName(displayName); - return this; - } - - /** - * Get the message property: Localized name of the rule (Good for UI). - * - * @return the message value. - */ - public String message() { - return this.innerProperties() == null ? null : this.innerProperties().message(); - } - - /** - * Set the message property: Localized name of the rule (Good for UI). - * - * @param message the message value to set. - * @return the RecommendationRuleInner object itself. - */ - public RecommendationRuleInner withMessage(String message) { - if (this.innerProperties() == null) { - this.innerProperties = new RecommendationRuleProperties(); - } - this.innerProperties().withMessage(message); - return this; - } - - /** - * Get the recommendationId property: Recommendation ID of an associated recommendation object tied to the rule, if - * exists. If such an object doesn't exist, it is set to null. - * - * @return the recommendationId value. - */ - public UUID recommendationId() { - return this.innerProperties() == null ? null : this.innerProperties().recommendationId(); - } - - /** - * Set the recommendationId property: Recommendation ID of an associated recommendation object tied to the rule, if - * exists. If such an object doesn't exist, it is set to null. - * - * @param recommendationId the recommendationId value to set. - * @return the RecommendationRuleInner object itself. - */ - public RecommendationRuleInner withRecommendationId(UUID recommendationId) { - if (this.innerProperties() == null) { - this.innerProperties = new RecommendationRuleProperties(); - } - this.innerProperties().withRecommendationId(recommendationId); - return this; - } - - /** - * Get the description property: Localized detailed description of the rule. - * - * @return the description value. - */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); - } - - /** - * Set the description property: Localized detailed description of the rule. - * - * @param description the description value to set. - * @return the RecommendationRuleInner object itself. - */ - public RecommendationRuleInner withDescription(String description) { - if (this.innerProperties() == null) { - this.innerProperties = new RecommendationRuleProperties(); - } - this.innerProperties().withDescription(description); - return this; - } - - /** - * Get the actionName property: Name of action that is recommended by this rule in string. - * - * @return the actionName value. - */ - public String actionName() { - return this.innerProperties() == null ? null : this.innerProperties().actionName(); - } - - /** - * Set the actionName property: Name of action that is recommended by this rule in string. - * - * @param actionName the actionName value to set. - * @return the RecommendationRuleInner object itself. - */ - public RecommendationRuleInner withActionName(String actionName) { - if (this.innerProperties() == null) { - this.innerProperties = new RecommendationRuleProperties(); - } - this.innerProperties().withActionName(actionName); - return this; - } - - /** - * Get the level property: Level of impact indicating how critical this rule is. - * - * @return the level value. - */ - public NotificationLevel level() { - return this.innerProperties() == null ? null : this.innerProperties().level(); - } - - /** - * Set the level property: Level of impact indicating how critical this rule is. - * - * @param level the level value to set. - * @return the RecommendationRuleInner object itself. - */ - public RecommendationRuleInner withLevel(NotificationLevel level) { - if (this.innerProperties() == null) { - this.innerProperties = new RecommendationRuleProperties(); - } - this.innerProperties().withLevel(level); - return this; - } - - /** - * Get the channels property: List of available channels that this rule applies. - * - * @return the channels value. - */ - public Channels channels() { - return this.innerProperties() == null ? null : this.innerProperties().channels(); - } - - /** - * Set the channels property: List of available channels that this rule applies. - * - * @param channels the channels value to set. - * @return the RecommendationRuleInner object itself. - */ - public RecommendationRuleInner withChannels(Channels channels) { - if (this.innerProperties() == null) { - this.innerProperties = new RecommendationRuleProperties(); - } - this.innerProperties().withChannels(channels); - return this; - } - - /** - * Get the categoryTags property: The list of category tags that this recommendation rule belongs to. - * - * @return the categoryTags value. - */ - public List categoryTags() { - return this.innerProperties() == null ? null : this.innerProperties().categoryTags(); - } - - /** - * Get the isDynamic property: True if this is associated with a dynamically added rule. - * - * @return the isDynamic value. - */ - public Boolean isDynamic() { - return this.innerProperties() == null ? null : this.innerProperties().isDynamic(); - } - - /** - * Set the isDynamic property: True if this is associated with a dynamically added rule. - * - * @param isDynamic the isDynamic value to set. - * @return the RecommendationRuleInner object itself. - */ - public RecommendationRuleInner withIsDynamic(Boolean isDynamic) { - if (this.innerProperties() == null) { - this.innerProperties = new RecommendationRuleProperties(); - } - this.innerProperties().withIsDynamic(isDynamic); - return this; - } - - /** - * Get the extensionName property: Extension name of the portal if exists. Applicable to dynamic rule only. - * - * @return the extensionName value. - */ - public String extensionName() { - return this.innerProperties() == null ? null : this.innerProperties().extensionName(); - } - - /** - * Set the extensionName property: Extension name of the portal if exists. Applicable to dynamic rule only. - * - * @param extensionName the extensionName value to set. - * @return the RecommendationRuleInner object itself. - */ - public RecommendationRuleInner withExtensionName(String extensionName) { - if (this.innerProperties() == null) { - this.innerProperties = new RecommendationRuleProperties(); - } - this.innerProperties().withExtensionName(extensionName); - return this; - } - - /** - * Get the bladeName property: Deep link to a blade on the portal. Applicable to dynamic rule only. - * - * @return the bladeName value. - */ - public String bladeName() { - return this.innerProperties() == null ? null : this.innerProperties().bladeName(); - } - - /** - * Set the bladeName property: Deep link to a blade on the portal. Applicable to dynamic rule only. - * - * @param bladeName the bladeName value to set. - * @return the RecommendationRuleInner object itself. - */ - public RecommendationRuleInner withBladeName(String bladeName) { - if (this.innerProperties() == null) { - this.innerProperties = new RecommendationRuleProperties(); - } - this.innerProperties().withBladeName(bladeName); - return this; - } - - /** - * Get the forwardLink property: Forward link to an external document associated with the rule. Applicable to - * dynamic rule only. - * - * @return the forwardLink value. - */ - public String forwardLink() { - return this.innerProperties() == null ? null : this.innerProperties().forwardLink(); - } - - /** - * Set the forwardLink property: Forward link to an external document associated with the rule. Applicable to - * dynamic rule only. - * - * @param forwardLink the forwardLink value to set. - * @return the RecommendationRuleInner object itself. - */ - public RecommendationRuleInner withForwardLink(String forwardLink) { - if (this.innerProperties() == null) { - this.innerProperties = new RecommendationRuleProperties(); - } - this.innerProperties().withForwardLink(forwardLink); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/RecommendationRuleProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/RecommendationRuleProperties.java deleted file mode 100644 index 1038ce84f71e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/RecommendationRuleProperties.java +++ /dev/null @@ -1,362 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.Channels; -import com.azure.resourcemanager.appservice.models.NotificationLevel; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.UUID; - -/** RecommendationRule resource specific properties. */ -@Fluent -public final class RecommendationRuleProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RecommendationRuleProperties.class); - - /* - * Unique name of the rule. - */ - @JsonProperty(value = "recommendationName") - private String recommendationName; - - /* - * UI friendly name of the rule. - */ - @JsonProperty(value = "displayName") - private String displayName; - - /* - * Localized name of the rule (Good for UI). - */ - @JsonProperty(value = "message") - private String message; - - /* - * Recommendation ID of an associated recommendation object tied to the - * rule, if exists. - * If such an object doesn't exist, it is set to null. - */ - @JsonProperty(value = "recommendationId") - private UUID recommendationId; - - /* - * Localized detailed description of the rule. - */ - @JsonProperty(value = "description") - private String description; - - /* - * Name of action that is recommended by this rule in string. - */ - @JsonProperty(value = "actionName") - private String actionName; - - /* - * Level of impact indicating how critical this rule is. - */ - @JsonProperty(value = "level") - private NotificationLevel level; - - /* - * List of available channels that this rule applies. - */ - @JsonProperty(value = "channels") - private Channels channels; - - /* - * The list of category tags that this recommendation rule belongs to. - */ - @JsonProperty(value = "categoryTags", access = JsonProperty.Access.WRITE_ONLY) - private List categoryTags; - - /* - * True if this is associated with a dynamically added rule - */ - @JsonProperty(value = "isDynamic") - private Boolean isDynamic; - - /* - * Extension name of the portal if exists. Applicable to dynamic rule only. - */ - @JsonProperty(value = "extensionName") - private String extensionName; - - /* - * Deep link to a blade on the portal. Applicable to dynamic rule only. - */ - @JsonProperty(value = "bladeName") - private String bladeName; - - /* - * Forward link to an external document associated with the rule. - * Applicable to dynamic rule only. - */ - @JsonProperty(value = "forwardLink") - private String forwardLink; - - /** - * Get the recommendationName property: Unique name of the rule. - * - * @return the recommendationName value. - */ - public String recommendationName() { - return this.recommendationName; - } - - /** - * Set the recommendationName property: Unique name of the rule. - * - * @param recommendationName the recommendationName value to set. - * @return the RecommendationRuleProperties object itself. - */ - public RecommendationRuleProperties withRecommendationName(String recommendationName) { - this.recommendationName = recommendationName; - return this; - } - - /** - * Get the displayName property: UI friendly name of the rule. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Set the displayName property: UI friendly name of the rule. - * - * @param displayName the displayName value to set. - * @return the RecommendationRuleProperties object itself. - */ - public RecommendationRuleProperties withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - - /** - * Get the message property: Localized name of the rule (Good for UI). - * - * @return the message value. - */ - public String message() { - return this.message; - } - - /** - * Set the message property: Localized name of the rule (Good for UI). - * - * @param message the message value to set. - * @return the RecommendationRuleProperties object itself. - */ - public RecommendationRuleProperties withMessage(String message) { - this.message = message; - return this; - } - - /** - * Get the recommendationId property: Recommendation ID of an associated recommendation object tied to the rule, if - * exists. If such an object doesn't exist, it is set to null. - * - * @return the recommendationId value. - */ - public UUID recommendationId() { - return this.recommendationId; - } - - /** - * Set the recommendationId property: Recommendation ID of an associated recommendation object tied to the rule, if - * exists. If such an object doesn't exist, it is set to null. - * - * @param recommendationId the recommendationId value to set. - * @return the RecommendationRuleProperties object itself. - */ - public RecommendationRuleProperties withRecommendationId(UUID recommendationId) { - this.recommendationId = recommendationId; - return this; - } - - /** - * Get the description property: Localized detailed description of the rule. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: Localized detailed description of the rule. - * - * @param description the description value to set. - * @return the RecommendationRuleProperties object itself. - */ - public RecommendationRuleProperties withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the actionName property: Name of action that is recommended by this rule in string. - * - * @return the actionName value. - */ - public String actionName() { - return this.actionName; - } - - /** - * Set the actionName property: Name of action that is recommended by this rule in string. - * - * @param actionName the actionName value to set. - * @return the RecommendationRuleProperties object itself. - */ - public RecommendationRuleProperties withActionName(String actionName) { - this.actionName = actionName; - return this; - } - - /** - * Get the level property: Level of impact indicating how critical this rule is. - * - * @return the level value. - */ - public NotificationLevel level() { - return this.level; - } - - /** - * Set the level property: Level of impact indicating how critical this rule is. - * - * @param level the level value to set. - * @return the RecommendationRuleProperties object itself. - */ - public RecommendationRuleProperties withLevel(NotificationLevel level) { - this.level = level; - return this; - } - - /** - * Get the channels property: List of available channels that this rule applies. - * - * @return the channels value. - */ - public Channels channels() { - return this.channels; - } - - /** - * Set the channels property: List of available channels that this rule applies. - * - * @param channels the channels value to set. - * @return the RecommendationRuleProperties object itself. - */ - public RecommendationRuleProperties withChannels(Channels channels) { - this.channels = channels; - return this; - } - - /** - * Get the categoryTags property: The list of category tags that this recommendation rule belongs to. - * - * @return the categoryTags value. - */ - public List categoryTags() { - return this.categoryTags; - } - - /** - * Get the isDynamic property: True if this is associated with a dynamically added rule. - * - * @return the isDynamic value. - */ - public Boolean isDynamic() { - return this.isDynamic; - } - - /** - * Set the isDynamic property: True if this is associated with a dynamically added rule. - * - * @param isDynamic the isDynamic value to set. - * @return the RecommendationRuleProperties object itself. - */ - public RecommendationRuleProperties withIsDynamic(Boolean isDynamic) { - this.isDynamic = isDynamic; - return this; - } - - /** - * Get the extensionName property: Extension name of the portal if exists. Applicable to dynamic rule only. - * - * @return the extensionName value. - */ - public String extensionName() { - return this.extensionName; - } - - /** - * Set the extensionName property: Extension name of the portal if exists. Applicable to dynamic rule only. - * - * @param extensionName the extensionName value to set. - * @return the RecommendationRuleProperties object itself. - */ - public RecommendationRuleProperties withExtensionName(String extensionName) { - this.extensionName = extensionName; - return this; - } - - /** - * Get the bladeName property: Deep link to a blade on the portal. Applicable to dynamic rule only. - * - * @return the bladeName value. - */ - public String bladeName() { - return this.bladeName; - } - - /** - * Set the bladeName property: Deep link to a blade on the portal. Applicable to dynamic rule only. - * - * @param bladeName the bladeName value to set. - * @return the RecommendationRuleProperties object itself. - */ - public RecommendationRuleProperties withBladeName(String bladeName) { - this.bladeName = bladeName; - return this; - } - - /** - * Get the forwardLink property: Forward link to an external document associated with the rule. Applicable to - * dynamic rule only. - * - * @return the forwardLink value. - */ - public String forwardLink() { - return this.forwardLink; - } - - /** - * Set the forwardLink property: Forward link to an external document associated with the rule. Applicable to - * dynamic rule only. - * - * @param forwardLink the forwardLink value to set. - * @return the RecommendationRuleProperties object itself. - */ - public RecommendationRuleProperties withForwardLink(String forwardLink) { - this.forwardLink = forwardLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/ReissueCertificateOrderRequestProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/ReissueCertificateOrderRequestProperties.java deleted file mode 100644 index 46f02eff0293..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/ReissueCertificateOrderRequestProperties.java +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** ReissueCertificateOrderRequest resource specific properties. */ -@Fluent -public final class ReissueCertificateOrderRequestProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ReissueCertificateOrderRequestProperties.class); - - /* - * Certificate Key Size. - */ - @JsonProperty(value = "keySize") - private Integer keySize; - - /* - * Delay in hours to revoke existing certificate after the new certificate - * is issued. - */ - @JsonProperty(value = "delayExistingRevokeInHours") - private Integer delayExistingRevokeInHours; - - /* - * Csr to be used for re-key operation. - */ - @JsonProperty(value = "csr") - private String csr; - - /* - * Should we change the ASC type (from managed private key to external - * private key and vice versa). - */ - @JsonProperty(value = "isPrivateKeyExternal") - private Boolean isPrivateKeyExternal; - - /** - * Get the keySize property: Certificate Key Size. - * - * @return the keySize value. - */ - public Integer keySize() { - return this.keySize; - } - - /** - * Set the keySize property: Certificate Key Size. - * - * @param keySize the keySize value to set. - * @return the ReissueCertificateOrderRequestProperties object itself. - */ - public ReissueCertificateOrderRequestProperties withKeySize(Integer keySize) { - this.keySize = keySize; - return this; - } - - /** - * Get the delayExistingRevokeInHours property: Delay in hours to revoke existing certificate after the new - * certificate is issued. - * - * @return the delayExistingRevokeInHours value. - */ - public Integer delayExistingRevokeInHours() { - return this.delayExistingRevokeInHours; - } - - /** - * Set the delayExistingRevokeInHours property: Delay in hours to revoke existing certificate after the new - * certificate is issued. - * - * @param delayExistingRevokeInHours the delayExistingRevokeInHours value to set. - * @return the ReissueCertificateOrderRequestProperties object itself. - */ - public ReissueCertificateOrderRequestProperties withDelayExistingRevokeInHours(Integer delayExistingRevokeInHours) { - this.delayExistingRevokeInHours = delayExistingRevokeInHours; - return this; - } - - /** - * Get the csr property: Csr to be used for re-key operation. - * - * @return the csr value. - */ - public String csr() { - return this.csr; - } - - /** - * Set the csr property: Csr to be used for re-key operation. - * - * @param csr the csr value to set. - * @return the ReissueCertificateOrderRequestProperties object itself. - */ - public ReissueCertificateOrderRequestProperties withCsr(String csr) { - this.csr = csr; - return this; - } - - /** - * Get the isPrivateKeyExternal property: Should we change the ASC type (from managed private key to external - * private key and vice versa). - * - * @return the isPrivateKeyExternal value. - */ - public Boolean isPrivateKeyExternal() { - return this.isPrivateKeyExternal; - } - - /** - * Set the isPrivateKeyExternal property: Should we change the ASC type (from managed private key to external - * private key and vice versa). - * - * @param isPrivateKeyExternal the isPrivateKeyExternal value to set. - * @return the ReissueCertificateOrderRequestProperties object itself. - */ - public ReissueCertificateOrderRequestProperties withIsPrivateKeyExternal(Boolean isPrivateKeyExternal) { - this.isPrivateKeyExternal = isPrivateKeyExternal; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/RelayServiceConnectionEntityInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/RelayServiceConnectionEntityInner.java deleted file mode 100644 index 7d2e2c47566e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/RelayServiceConnectionEntityInner.java +++ /dev/null @@ -1,213 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.ProxyOnlyResource; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Hybrid Connection for an App Service app. */ -@Fluent -public final class RelayServiceConnectionEntityInner extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RelayServiceConnectionEntityInner.class); - - /* - * RelayServiceConnectionEntity resource specific properties - */ - @JsonProperty(value = "properties") - private RelayServiceConnectionEntityProperties innerProperties; - - /** - * Get the innerProperties property: RelayServiceConnectionEntity resource specific properties. - * - * @return the innerProperties value. - */ - private RelayServiceConnectionEntityProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public RelayServiceConnectionEntityInner withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the entityName property: The entityName property. - * - * @return the entityName value. - */ - public String entityName() { - return this.innerProperties() == null ? null : this.innerProperties().entityName(); - } - - /** - * Set the entityName property: The entityName property. - * - * @param entityName the entityName value to set. - * @return the RelayServiceConnectionEntityInner object itself. - */ - public RelayServiceConnectionEntityInner withEntityName(String entityName) { - if (this.innerProperties() == null) { - this.innerProperties = new RelayServiceConnectionEntityProperties(); - } - this.innerProperties().withEntityName(entityName); - return this; - } - - /** - * Get the entityConnectionString property: The entityConnectionString property. - * - * @return the entityConnectionString value. - */ - public String entityConnectionString() { - return this.innerProperties() == null ? null : this.innerProperties().entityConnectionString(); - } - - /** - * Set the entityConnectionString property: The entityConnectionString property. - * - * @param entityConnectionString the entityConnectionString value to set. - * @return the RelayServiceConnectionEntityInner object itself. - */ - public RelayServiceConnectionEntityInner withEntityConnectionString(String entityConnectionString) { - if (this.innerProperties() == null) { - this.innerProperties = new RelayServiceConnectionEntityProperties(); - } - this.innerProperties().withEntityConnectionString(entityConnectionString); - return this; - } - - /** - * Get the resourceType property: The resourceType property. - * - * @return the resourceType value. - */ - public String resourceType() { - return this.innerProperties() == null ? null : this.innerProperties().resourceType(); - } - - /** - * Set the resourceType property: The resourceType property. - * - * @param resourceType the resourceType value to set. - * @return the RelayServiceConnectionEntityInner object itself. - */ - public RelayServiceConnectionEntityInner withResourceType(String resourceType) { - if (this.innerProperties() == null) { - this.innerProperties = new RelayServiceConnectionEntityProperties(); - } - this.innerProperties().withResourceType(resourceType); - return this; - } - - /** - * Get the resourceConnectionString property: The resourceConnectionString property. - * - * @return the resourceConnectionString value. - */ - public String resourceConnectionString() { - return this.innerProperties() == null ? null : this.innerProperties().resourceConnectionString(); - } - - /** - * Set the resourceConnectionString property: The resourceConnectionString property. - * - * @param resourceConnectionString the resourceConnectionString value to set. - * @return the RelayServiceConnectionEntityInner object itself. - */ - public RelayServiceConnectionEntityInner withResourceConnectionString(String resourceConnectionString) { - if (this.innerProperties() == null) { - this.innerProperties = new RelayServiceConnectionEntityProperties(); - } - this.innerProperties().withResourceConnectionString(resourceConnectionString); - return this; - } - - /** - * Get the hostname property: The hostname property. - * - * @return the hostname value. - */ - public String hostname() { - return this.innerProperties() == null ? null : this.innerProperties().hostname(); - } - - /** - * Set the hostname property: The hostname property. - * - * @param hostname the hostname value to set. - * @return the RelayServiceConnectionEntityInner object itself. - */ - public RelayServiceConnectionEntityInner withHostname(String hostname) { - if (this.innerProperties() == null) { - this.innerProperties = new RelayServiceConnectionEntityProperties(); - } - this.innerProperties().withHostname(hostname); - return this; - } - - /** - * Get the port property: The port property. - * - * @return the port value. - */ - public Integer port() { - return this.innerProperties() == null ? null : this.innerProperties().port(); - } - - /** - * Set the port property: The port property. - * - * @param port the port value to set. - * @return the RelayServiceConnectionEntityInner object itself. - */ - public RelayServiceConnectionEntityInner withPort(Integer port) { - if (this.innerProperties() == null) { - this.innerProperties = new RelayServiceConnectionEntityProperties(); - } - this.innerProperties().withPort(port); - return this; - } - - /** - * Get the biztalkUri property: The biztalkUri property. - * - * @return the biztalkUri value. - */ - public String biztalkUri() { - return this.innerProperties() == null ? null : this.innerProperties().biztalkUri(); - } - - /** - * Set the biztalkUri property: The biztalkUri property. - * - * @param biztalkUri the biztalkUri value to set. - * @return the RelayServiceConnectionEntityInner object itself. - */ - public RelayServiceConnectionEntityInner withBiztalkUri(String biztalkUri) { - if (this.innerProperties() == null) { - this.innerProperties = new RelayServiceConnectionEntityProperties(); - } - this.innerProperties().withBiztalkUri(biztalkUri); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/RelayServiceConnectionEntityProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/RelayServiceConnectionEntityProperties.java deleted file mode 100644 index d394475b4602..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/RelayServiceConnectionEntityProperties.java +++ /dev/null @@ -1,206 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** RelayServiceConnectionEntity resource specific properties. */ -@Fluent -public final class RelayServiceConnectionEntityProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RelayServiceConnectionEntityProperties.class); - - /* - * The entityName property. - */ - @JsonProperty(value = "entityName") - private String entityName; - - /* - * The entityConnectionString property. - */ - @JsonProperty(value = "entityConnectionString") - private String entityConnectionString; - - /* - * The resourceType property. - */ - @JsonProperty(value = "resourceType") - private String resourceType; - - /* - * The resourceConnectionString property. - */ - @JsonProperty(value = "resourceConnectionString") - private String resourceConnectionString; - - /* - * The hostname property. - */ - @JsonProperty(value = "hostname") - private String hostname; - - /* - * The port property. - */ - @JsonProperty(value = "port") - private Integer port; - - /* - * The biztalkUri property. - */ - @JsonProperty(value = "biztalkUri") - private String biztalkUri; - - /** - * Get the entityName property: The entityName property. - * - * @return the entityName value. - */ - public String entityName() { - return this.entityName; - } - - /** - * Set the entityName property: The entityName property. - * - * @param entityName the entityName value to set. - * @return the RelayServiceConnectionEntityProperties object itself. - */ - public RelayServiceConnectionEntityProperties withEntityName(String entityName) { - this.entityName = entityName; - return this; - } - - /** - * Get the entityConnectionString property: The entityConnectionString property. - * - * @return the entityConnectionString value. - */ - public String entityConnectionString() { - return this.entityConnectionString; - } - - /** - * Set the entityConnectionString property: The entityConnectionString property. - * - * @param entityConnectionString the entityConnectionString value to set. - * @return the RelayServiceConnectionEntityProperties object itself. - */ - public RelayServiceConnectionEntityProperties withEntityConnectionString(String entityConnectionString) { - this.entityConnectionString = entityConnectionString; - return this; - } - - /** - * Get the resourceType property: The resourceType property. - * - * @return the resourceType value. - */ - public String resourceType() { - return this.resourceType; - } - - /** - * Set the resourceType property: The resourceType property. - * - * @param resourceType the resourceType value to set. - * @return the RelayServiceConnectionEntityProperties object itself. - */ - public RelayServiceConnectionEntityProperties withResourceType(String resourceType) { - this.resourceType = resourceType; - return this; - } - - /** - * Get the resourceConnectionString property: The resourceConnectionString property. - * - * @return the resourceConnectionString value. - */ - public String resourceConnectionString() { - return this.resourceConnectionString; - } - - /** - * Set the resourceConnectionString property: The resourceConnectionString property. - * - * @param resourceConnectionString the resourceConnectionString value to set. - * @return the RelayServiceConnectionEntityProperties object itself. - */ - public RelayServiceConnectionEntityProperties withResourceConnectionString(String resourceConnectionString) { - this.resourceConnectionString = resourceConnectionString; - return this; - } - - /** - * Get the hostname property: The hostname property. - * - * @return the hostname value. - */ - public String hostname() { - return this.hostname; - } - - /** - * Set the hostname property: The hostname property. - * - * @param hostname the hostname value to set. - * @return the RelayServiceConnectionEntityProperties object itself. - */ - public RelayServiceConnectionEntityProperties withHostname(String hostname) { - this.hostname = hostname; - return this; - } - - /** - * Get the port property: The port property. - * - * @return the port value. - */ - public Integer port() { - return this.port; - } - - /** - * Set the port property: The port property. - * - * @param port the port value to set. - * @return the RelayServiceConnectionEntityProperties object itself. - */ - public RelayServiceConnectionEntityProperties withPort(Integer port) { - this.port = port; - return this; - } - - /** - * Get the biztalkUri property: The biztalkUri property. - * - * @return the biztalkUri value. - */ - public String biztalkUri() { - return this.biztalkUri; - } - - /** - * Set the biztalkUri property: The biztalkUri property. - * - * @param biztalkUri the biztalkUri value to set. - * @return the RelayServiceConnectionEntityProperties object itself. - */ - public RelayServiceConnectionEntityProperties withBiztalkUri(String biztalkUri) { - this.biztalkUri = biztalkUri; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/RenewCertificateOrderRequestProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/RenewCertificateOrderRequestProperties.java deleted file mode 100644 index 14c1bd06e46a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/RenewCertificateOrderRequestProperties.java +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** RenewCertificateOrderRequest resource specific properties. */ -@Fluent -public final class RenewCertificateOrderRequestProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RenewCertificateOrderRequestProperties.class); - - /* - * Certificate Key Size. - */ - @JsonProperty(value = "keySize") - private Integer keySize; - - /* - * Csr to be used for re-key operation. - */ - @JsonProperty(value = "csr") - private String csr; - - /* - * Should we change the ASC type (from managed private key to external - * private key and vice versa). - */ - @JsonProperty(value = "isPrivateKeyExternal") - private Boolean isPrivateKeyExternal; - - /** - * Get the keySize property: Certificate Key Size. - * - * @return the keySize value. - */ - public Integer keySize() { - return this.keySize; - } - - /** - * Set the keySize property: Certificate Key Size. - * - * @param keySize the keySize value to set. - * @return the RenewCertificateOrderRequestProperties object itself. - */ - public RenewCertificateOrderRequestProperties withKeySize(Integer keySize) { - this.keySize = keySize; - return this; - } - - /** - * Get the csr property: Csr to be used for re-key operation. - * - * @return the csr value. - */ - public String csr() { - return this.csr; - } - - /** - * Set the csr property: Csr to be used for re-key operation. - * - * @param csr the csr value to set. - * @return the RenewCertificateOrderRequestProperties object itself. - */ - public RenewCertificateOrderRequestProperties withCsr(String csr) { - this.csr = csr; - return this; - } - - /** - * Get the isPrivateKeyExternal property: Should we change the ASC type (from managed private key to external - * private key and vice versa). - * - * @return the isPrivateKeyExternal value. - */ - public Boolean isPrivateKeyExternal() { - return this.isPrivateKeyExternal; - } - - /** - * Set the isPrivateKeyExternal property: Should we change the ASC type (from managed private key to external - * private key and vice versa). - * - * @param isPrivateKeyExternal the isPrivateKeyExternal value to set. - * @return the RenewCertificateOrderRequestProperties object itself. - */ - public RenewCertificateOrderRequestProperties withIsPrivateKeyExternal(Boolean isPrivateKeyExternal) { - this.isPrivateKeyExternal = isPrivateKeyExternal; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/ResourceHealthMetadataInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/ResourceHealthMetadataInner.java deleted file mode 100644 index 570fa468b49d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/ResourceHealthMetadataInner.java +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.ProxyOnlyResource; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Used for getting ResourceHealthCheck settings. */ -@Fluent -public final class ResourceHealthMetadataInner extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceHealthMetadataInner.class); - - /* - * ResourceHealthMetadata resource specific properties - */ - @JsonProperty(value = "properties") - private ResourceHealthMetadataProperties innerProperties; - - /** - * Get the innerProperties property: ResourceHealthMetadata resource specific properties. - * - * @return the innerProperties value. - */ - private ResourceHealthMetadataProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public ResourceHealthMetadataInner withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the category property: The category that the resource matches in the RHC Policy File. - * - * @return the category value. - */ - public String category() { - return this.innerProperties() == null ? null : this.innerProperties().category(); - } - - /** - * Set the category property: The category that the resource matches in the RHC Policy File. - * - * @param category the category value to set. - * @return the ResourceHealthMetadataInner object itself. - */ - public ResourceHealthMetadataInner withCategory(String category) { - if (this.innerProperties() == null) { - this.innerProperties = new ResourceHealthMetadataProperties(); - } - this.innerProperties().withCategory(category); - return this; - } - - /** - * Get the signalAvailability property: Is there a health signal for the resource. - * - * @return the signalAvailability value. - */ - public Boolean signalAvailability() { - return this.innerProperties() == null ? null : this.innerProperties().signalAvailability(); - } - - /** - * Set the signalAvailability property: Is there a health signal for the resource. - * - * @param signalAvailability the signalAvailability value to set. - * @return the ResourceHealthMetadataInner object itself. - */ - public ResourceHealthMetadataInner withSignalAvailability(Boolean signalAvailability) { - if (this.innerProperties() == null) { - this.innerProperties = new ResourceHealthMetadataProperties(); - } - this.innerProperties().withSignalAvailability(signalAvailability); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/ResourceHealthMetadataProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/ResourceHealthMetadataProperties.java deleted file mode 100644 index ff7dc3d57777..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/ResourceHealthMetadataProperties.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** ResourceHealthMetadata resource specific properties. */ -@Fluent -public final class ResourceHealthMetadataProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceHealthMetadataProperties.class); - - /* - * The category that the resource matches in the RHC Policy File - */ - @JsonProperty(value = "category") - private String category; - - /* - * Is there a health signal for the resource - */ - @JsonProperty(value = "signalAvailability") - private Boolean signalAvailability; - - /** - * Get the category property: The category that the resource matches in the RHC Policy File. - * - * @return the category value. - */ - public String category() { - return this.category; - } - - /** - * Set the category property: The category that the resource matches in the RHC Policy File. - * - * @param category the category value to set. - * @return the ResourceHealthMetadataProperties object itself. - */ - public ResourceHealthMetadataProperties withCategory(String category) { - this.category = category; - return this; - } - - /** - * Get the signalAvailability property: Is there a health signal for the resource. - * - * @return the signalAvailability value. - */ - public Boolean signalAvailability() { - return this.signalAvailability; - } - - /** - * Set the signalAvailability property: Is there a health signal for the resource. - * - * @param signalAvailability the signalAvailability value to set. - * @return the ResourceHealthMetadataProperties object itself. - */ - public ResourceHealthMetadataProperties withSignalAvailability(Boolean signalAvailability) { - this.signalAvailability = signalAvailability; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/ResourceMetricDefinitionInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/ResourceMetricDefinitionInner.java deleted file mode 100644 index 95e41d40145f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/ResourceMetricDefinitionInner.java +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.ProxyOnlyResource; -import com.azure.resourcemanager.appservice.models.ResourceMetricAvailability; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** Metadata for the metrics. */ -@Fluent -public final class ResourceMetricDefinitionInner extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceMetricDefinitionInner.class); - - /* - * ResourceMetricDefinition resource specific properties - */ - @JsonProperty(value = "properties") - private ResourceMetricDefinitionProperties innerProperties; - - /** - * Get the innerProperties property: ResourceMetricDefinition resource specific properties. - * - * @return the innerProperties value. - */ - private ResourceMetricDefinitionProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public ResourceMetricDefinitionInner withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the unit property: Unit of the metric. - * - * @return the unit value. - */ - public String unit() { - return this.innerProperties() == null ? null : this.innerProperties().unit(); - } - - /** - * Get the primaryAggregationType property: Primary aggregation type. - * - * @return the primaryAggregationType value. - */ - public String primaryAggregationType() { - return this.innerProperties() == null ? null : this.innerProperties().primaryAggregationType(); - } - - /** - * Get the metricAvailabilities property: List of time grains supported for the metric together with retention - * period. - * - * @return the metricAvailabilities value. - */ - public List metricAvailabilities() { - return this.innerProperties() == null ? null : this.innerProperties().metricAvailabilities(); - } - - /** - * Get the resourceUri property: Resource URI. - * - * @return the resourceUri value. - */ - public String resourceUri() { - return this.innerProperties() == null ? null : this.innerProperties().resourceUri(); - } - - /** - * Get the properties property: Resource metric definition properties. - * - * @return the properties value. - */ - public Map properties() { - return this.innerProperties() == null ? null : this.innerProperties().properties(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/ResourceMetricDefinitionProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/ResourceMetricDefinitionProperties.java deleted file mode 100644 index 6852481497a3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/ResourceMetricDefinitionProperties.java +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.ResourceMetricAvailability; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** ResourceMetricDefinition resource specific properties. */ -@Immutable -public final class ResourceMetricDefinitionProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceMetricDefinitionProperties.class); - - /* - * Unit of the metric. - */ - @JsonProperty(value = "unit", access = JsonProperty.Access.WRITE_ONLY) - private String unit; - - /* - * Primary aggregation type. - */ - @JsonProperty(value = "primaryAggregationType", access = JsonProperty.Access.WRITE_ONLY) - private String primaryAggregationType; - - /* - * List of time grains supported for the metric together with retention - * period. - */ - @JsonProperty(value = "metricAvailabilities", access = JsonProperty.Access.WRITE_ONLY) - private List metricAvailabilities; - - /* - * Resource URI. - */ - @JsonProperty(value = "resourceUri", access = JsonProperty.Access.WRITE_ONLY) - private String resourceUri; - - /* - * Resource metric definition properties. - */ - @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY) - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map properties; - - /** - * Get the unit property: Unit of the metric. - * - * @return the unit value. - */ - public String unit() { - return this.unit; - } - - /** - * Get the primaryAggregationType property: Primary aggregation type. - * - * @return the primaryAggregationType value. - */ - public String primaryAggregationType() { - return this.primaryAggregationType; - } - - /** - * Get the metricAvailabilities property: List of time grains supported for the metric together with retention - * period. - * - * @return the metricAvailabilities value. - */ - public List metricAvailabilities() { - return this.metricAvailabilities; - } - - /** - * Get the resourceUri property: Resource URI. - * - * @return the resourceUri value. - */ - public String resourceUri() { - return this.resourceUri; - } - - /** - * Get the properties property: Resource metric definition properties. - * - * @return the properties value. - */ - public Map properties() { - return this.properties; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (metricAvailabilities() != null) { - metricAvailabilities().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/ResourceMetricInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/ResourceMetricInner.java deleted file mode 100644 index 1352f8fe7937..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/ResourceMetricInner.java +++ /dev/null @@ -1,173 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.ResourceMetricName; -import com.azure.resourcemanager.appservice.models.ResourceMetricProperty; -import com.azure.resourcemanager.appservice.models.ResourceMetricValue; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; - -/** Object representing a metric for any resource . */ -@Immutable -public final class ResourceMetricInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceMetricInner.class); - - /* - * Name of metric. - */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) - private ResourceMetricName name; - - /* - * Metric unit. - */ - @JsonProperty(value = "unit", access = JsonProperty.Access.WRITE_ONLY) - private String unit; - - /* - * Metric granularity. E.g PT1H, PT5M, P1D - */ - @JsonProperty(value = "timeGrain", access = JsonProperty.Access.WRITE_ONLY) - private String timeGrain; - - /* - * Metric start time. - */ - @JsonProperty(value = "startTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime startTime; - - /* - * Metric end time. - */ - @JsonProperty(value = "endTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime endTime; - - /* - * Metric resource Id. - */ - @JsonProperty(value = "resourceId", access = JsonProperty.Access.WRITE_ONLY) - private String resourceId; - - /* - * Resource Id. - */ - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) - private String id; - - /* - * Metric values. - */ - @JsonProperty(value = "metricValues", access = JsonProperty.Access.WRITE_ONLY) - private List metricValues; - - /* - * Resource metric properties collection. - */ - @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY) - private List properties; - - /** - * Get the name property: Name of metric. - * - * @return the name value. - */ - public ResourceMetricName name() { - return this.name; - } - - /** - * Get the unit property: Metric unit. - * - * @return the unit value. - */ - public String unit() { - return this.unit; - } - - /** - * Get the timeGrain property: Metric granularity. E.g PT1H, PT5M, P1D. - * - * @return the timeGrain value. - */ - public String timeGrain() { - return this.timeGrain; - } - - /** - * Get the startTime property: Metric start time. - * - * @return the startTime value. - */ - public OffsetDateTime startTime() { - return this.startTime; - } - - /** - * Get the endTime property: Metric end time. - * - * @return the endTime value. - */ - public OffsetDateTime endTime() { - return this.endTime; - } - - /** - * Get the resourceId property: Metric resource Id. - * - * @return the resourceId value. - */ - public String resourceId() { - return this.resourceId; - } - - /** - * Get the id property: Resource Id. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Get the metricValues property: Metric values. - * - * @return the metricValues value. - */ - public List metricValues() { - return this.metricValues; - } - - /** - * Get the properties property: Resource metric properties collection. - * - * @return the properties value. - */ - public List properties() { - return this.properties; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() != null) { - name().validate(); - } - if (metricValues() != null) { - metricValues().forEach(e -> e.validate()); - } - if (properties() != null) { - properties().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/ResourceNameAvailabilityInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/ResourceNameAvailabilityInner.java deleted file mode 100644 index 9f3d3868ef58..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/ResourceNameAvailabilityInner.java +++ /dev/null @@ -1,120 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.InAvailabilityReasonType; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Information regarding availability of a resource name. */ -@Fluent -public final class ResourceNameAvailabilityInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceNameAvailabilityInner.class); - - /* - * true indicates name is valid and available. - * false indicates the name is invalid, unavailable, or both. - */ - @JsonProperty(value = "nameAvailable") - private Boolean nameAvailable; - - /* - * Invalid indicates the name provided does not match Azure - * App Service naming requirements. AlreadyExists indicates - * that the name is already in use and is therefore unavailable. - */ - @JsonProperty(value = "reason") - private InAvailabilityReasonType reason; - - /* - * If reason == invalid, provide the user with the reason why the given - * name is invalid, and provide the resource naming requirements so that - * the user can select a valid name. If reason == AlreadyExists, explain - * that resource name is already in use, and direct them to select a - * different name. - */ - @JsonProperty(value = "message") - private String message; - - /** - * Get the nameAvailable property: <code>true</code> indicates name is valid and available. - * <code>false</code> indicates the name is invalid, unavailable, or both. - * - * @return the nameAvailable value. - */ - public Boolean nameAvailable() { - return this.nameAvailable; - } - - /** - * Set the nameAvailable property: <code>true</code> indicates name is valid and available. - * <code>false</code> indicates the name is invalid, unavailable, or both. - * - * @param nameAvailable the nameAvailable value to set. - * @return the ResourceNameAvailabilityInner object itself. - */ - public ResourceNameAvailabilityInner withNameAvailable(Boolean nameAvailable) { - this.nameAvailable = nameAvailable; - return this; - } - - /** - * Get the reason property: <code>Invalid</code> indicates the name provided does not match Azure App - * Service naming requirements. <code>AlreadyExists</code> indicates that the name is already in use and - * is therefore unavailable. - * - * @return the reason value. - */ - public InAvailabilityReasonType reason() { - return this.reason; - } - - /** - * Set the reason property: <code>Invalid</code> indicates the name provided does not match Azure App - * Service naming requirements. <code>AlreadyExists</code> indicates that the name is already in use and - * is therefore unavailable. - * - * @param reason the reason value to set. - * @return the ResourceNameAvailabilityInner object itself. - */ - public ResourceNameAvailabilityInner withReason(InAvailabilityReasonType reason) { - this.reason = reason; - return this; - } - - /** - * Get the message property: If reason == invalid, provide the user with the reason why the given name is invalid, - * and provide the resource naming requirements so that the user can select a valid name. If reason == - * AlreadyExists, explain that resource name is already in use, and direct them to select a different name. - * - * @return the message value. - */ - public String message() { - return this.message; - } - - /** - * Set the message property: If reason == invalid, provide the user with the reason why the given name is invalid, - * and provide the resource naming requirements so that the user can select a valid name. If reason == - * AlreadyExists, explain that resource name is already in use, and direct them to select a different name. - * - * @param message the message value to set. - * @return the ResourceNameAvailabilityInner object itself. - */ - public ResourceNameAvailabilityInner withMessage(String message) { - this.message = message; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/RestoreRequestInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/RestoreRequestInner.java deleted file mode 100644 index fa3fcb5b929c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/RestoreRequestInner.java +++ /dev/null @@ -1,324 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.BackupRestoreOperationType; -import com.azure.resourcemanager.appservice.models.DatabaseBackupSetting; -import com.azure.resourcemanager.appservice.models.ProxyOnlyResource; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Description of a restore request. */ -@Fluent -public final class RestoreRequestInner extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RestoreRequestInner.class); - - /* - * RestoreRequest resource specific properties - */ - @JsonProperty(value = "properties") - private RestoreRequestProperties innerProperties; - - /** - * Get the innerProperties property: RestoreRequest resource specific properties. - * - * @return the innerProperties value. - */ - private RestoreRequestProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public RestoreRequestInner withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the storageAccountUrl property: SAS URL to the container. - * - * @return the storageAccountUrl value. - */ - public String storageAccountUrl() { - return this.innerProperties() == null ? null : this.innerProperties().storageAccountUrl(); - } - - /** - * Set the storageAccountUrl property: SAS URL to the container. - * - * @param storageAccountUrl the storageAccountUrl value to set. - * @return the RestoreRequestInner object itself. - */ - public RestoreRequestInner withStorageAccountUrl(String storageAccountUrl) { - if (this.innerProperties() == null) { - this.innerProperties = new RestoreRequestProperties(); - } - this.innerProperties().withStorageAccountUrl(storageAccountUrl); - return this; - } - - /** - * Get the blobName property: Name of a blob which contains the backup. - * - * @return the blobName value. - */ - public String blobName() { - return this.innerProperties() == null ? null : this.innerProperties().blobName(); - } - - /** - * Set the blobName property: Name of a blob which contains the backup. - * - * @param blobName the blobName value to set. - * @return the RestoreRequestInner object itself. - */ - public RestoreRequestInner withBlobName(String blobName) { - if (this.innerProperties() == null) { - this.innerProperties = new RestoreRequestProperties(); - } - this.innerProperties().withBlobName(blobName); - return this; - } - - /** - * Get the overwrite property: <code>true</code> if the restore operation can overwrite target app; - * otherwise, <code>false</code>. <code>true</code> is needed if trying to restore over an - * existing app. - * - * @return the overwrite value. - */ - public Boolean overwrite() { - return this.innerProperties() == null ? null : this.innerProperties().overwrite(); - } - - /** - * Set the overwrite property: <code>true</code> if the restore operation can overwrite target app; - * otherwise, <code>false</code>. <code>true</code> is needed if trying to restore over an - * existing app. - * - * @param overwrite the overwrite value to set. - * @return the RestoreRequestInner object itself. - */ - public RestoreRequestInner withOverwrite(Boolean overwrite) { - if (this.innerProperties() == null) { - this.innerProperties = new RestoreRequestProperties(); - } - this.innerProperties().withOverwrite(overwrite); - return this; - } - - /** - * Get the siteName property: Name of an app. - * - * @return the siteName value. - */ - public String siteName() { - return this.innerProperties() == null ? null : this.innerProperties().siteName(); - } - - /** - * Set the siteName property: Name of an app. - * - * @param siteName the siteName value to set. - * @return the RestoreRequestInner object itself. - */ - public RestoreRequestInner withSiteName(String siteName) { - if (this.innerProperties() == null) { - this.innerProperties = new RestoreRequestProperties(); - } - this.innerProperties().withSiteName(siteName); - return this; - } - - /** - * Get the databases property: Collection of databases which should be restored. This list has to match the list of - * databases included in the backup. - * - * @return the databases value. - */ - public List databases() { - return this.innerProperties() == null ? null : this.innerProperties().databases(); - } - - /** - * Set the databases property: Collection of databases which should be restored. This list has to match the list of - * databases included in the backup. - * - * @param databases the databases value to set. - * @return the RestoreRequestInner object itself. - */ - public RestoreRequestInner withDatabases(List databases) { - if (this.innerProperties() == null) { - this.innerProperties = new RestoreRequestProperties(); - } - this.innerProperties().withDatabases(databases); - return this; - } - - /** - * Get the ignoreConflictingHostNames property: Changes a logic when restoring an app with custom domains. - * <code>true</code> to remove custom domains automatically. If <code>false</code>, custom - * domains are added to the app's object when it is being restored, but that might fail due to conflicts during the - * operation. - * - * @return the ignoreConflictingHostNames value. - */ - public Boolean ignoreConflictingHostNames() { - return this.innerProperties() == null ? null : this.innerProperties().ignoreConflictingHostNames(); - } - - /** - * Set the ignoreConflictingHostNames property: Changes a logic when restoring an app with custom domains. - * <code>true</code> to remove custom domains automatically. If <code>false</code>, custom - * domains are added to the app's object when it is being restored, but that might fail due to conflicts during the - * operation. - * - * @param ignoreConflictingHostNames the ignoreConflictingHostNames value to set. - * @return the RestoreRequestInner object itself. - */ - public RestoreRequestInner withIgnoreConflictingHostNames(Boolean ignoreConflictingHostNames) { - if (this.innerProperties() == null) { - this.innerProperties = new RestoreRequestProperties(); - } - this.innerProperties().withIgnoreConflictingHostNames(ignoreConflictingHostNames); - return this; - } - - /** - * Get the ignoreDatabases property: Ignore the databases and only restore the site content. - * - * @return the ignoreDatabases value. - */ - public Boolean ignoreDatabases() { - return this.innerProperties() == null ? null : this.innerProperties().ignoreDatabases(); - } - - /** - * Set the ignoreDatabases property: Ignore the databases and only restore the site content. - * - * @param ignoreDatabases the ignoreDatabases value to set. - * @return the RestoreRequestInner object itself. - */ - public RestoreRequestInner withIgnoreDatabases(Boolean ignoreDatabases) { - if (this.innerProperties() == null) { - this.innerProperties = new RestoreRequestProperties(); - } - this.innerProperties().withIgnoreDatabases(ignoreDatabases); - return this; - } - - /** - * Get the appServicePlan property: Specify app service plan that will own restored site. - * - * @return the appServicePlan value. - */ - public String appServicePlan() { - return this.innerProperties() == null ? null : this.innerProperties().appServicePlan(); - } - - /** - * Set the appServicePlan property: Specify app service plan that will own restored site. - * - * @param appServicePlan the appServicePlan value to set. - * @return the RestoreRequestInner object itself. - */ - public RestoreRequestInner withAppServicePlan(String appServicePlan) { - if (this.innerProperties() == null) { - this.innerProperties = new RestoreRequestProperties(); - } - this.innerProperties().withAppServicePlan(appServicePlan); - return this; - } - - /** - * Get the operationType property: Operation type. - * - * @return the operationType value. - */ - public BackupRestoreOperationType operationType() { - return this.innerProperties() == null ? null : this.innerProperties().operationType(); - } - - /** - * Set the operationType property: Operation type. - * - * @param operationType the operationType value to set. - * @return the RestoreRequestInner object itself. - */ - public RestoreRequestInner withOperationType(BackupRestoreOperationType operationType) { - if (this.innerProperties() == null) { - this.innerProperties = new RestoreRequestProperties(); - } - this.innerProperties().withOperationType(operationType); - return this; - } - - /** - * Get the adjustConnectionStrings property: <code>true</code> if SiteConfig.ConnectionStrings should be - * set in new app; otherwise, <code>false</code>. - * - * @return the adjustConnectionStrings value. - */ - public Boolean adjustConnectionStrings() { - return this.innerProperties() == null ? null : this.innerProperties().adjustConnectionStrings(); - } - - /** - * Set the adjustConnectionStrings property: <code>true</code> if SiteConfig.ConnectionStrings should be - * set in new app; otherwise, <code>false</code>. - * - * @param adjustConnectionStrings the adjustConnectionStrings value to set. - * @return the RestoreRequestInner object itself. - */ - public RestoreRequestInner withAdjustConnectionStrings(Boolean adjustConnectionStrings) { - if (this.innerProperties() == null) { - this.innerProperties = new RestoreRequestProperties(); - } - this.innerProperties().withAdjustConnectionStrings(adjustConnectionStrings); - return this; - } - - /** - * Get the hostingEnvironment property: App Service Environment name, if needed (only when restoring an app to an - * App Service Environment). - * - * @return the hostingEnvironment value. - */ - public String hostingEnvironment() { - return this.innerProperties() == null ? null : this.innerProperties().hostingEnvironment(); - } - - /** - * Set the hostingEnvironment property: App Service Environment name, if needed (only when restoring an app to an - * App Service Environment). - * - * @param hostingEnvironment the hostingEnvironment value to set. - * @return the RestoreRequestInner object itself. - */ - public RestoreRequestInner withHostingEnvironment(String hostingEnvironment) { - if (this.innerProperties() == null) { - this.innerProperties = new RestoreRequestProperties(); - } - this.innerProperties().withHostingEnvironment(hostingEnvironment); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/RestoreRequestProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/RestoreRequestProperties.java deleted file mode 100644 index 81a5ac859d74..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/RestoreRequestProperties.java +++ /dev/null @@ -1,347 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.BackupRestoreOperationType; -import com.azure.resourcemanager.appservice.models.DatabaseBackupSetting; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** RestoreRequest resource specific properties. */ -@Fluent -public final class RestoreRequestProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RestoreRequestProperties.class); - - /* - * SAS URL to the container. - */ - @JsonProperty(value = "storageAccountUrl", required = true) - private String storageAccountUrl; - - /* - * Name of a blob which contains the backup. - */ - @JsonProperty(value = "blobName") - private String blobName; - - /* - * true if the restore operation can overwrite target app; - * otherwise, false. true is needed if trying to - * restore over an existing app. - */ - @JsonProperty(value = "overwrite", required = true) - private boolean overwrite; - - /* - * Name of an app. - */ - @JsonProperty(value = "siteName") - private String siteName; - - /* - * Collection of databases which should be restored. This list has to match - * the list of databases included in the backup. - */ - @JsonProperty(value = "databases") - private List databases; - - /* - * Changes a logic when restoring an app with custom domains. - * true to remove custom domains automatically. If - * false, custom domains are added to - * the app's object when it is being restored, but that might fail due to - * conflicts during the operation. - */ - @JsonProperty(value = "ignoreConflictingHostNames") - private Boolean ignoreConflictingHostNames; - - /* - * Ignore the databases and only restore the site content - */ - @JsonProperty(value = "ignoreDatabases") - private Boolean ignoreDatabases; - - /* - * Specify app service plan that will own restored site. - */ - @JsonProperty(value = "appServicePlan") - private String appServicePlan; - - /* - * Operation type. - */ - @JsonProperty(value = "operationType") - private BackupRestoreOperationType operationType; - - /* - * true if SiteConfig.ConnectionStrings should be set in new - * app; otherwise, false. - */ - @JsonProperty(value = "adjustConnectionStrings") - private Boolean adjustConnectionStrings; - - /* - * App Service Environment name, if needed (only when restoring an app to - * an App Service Environment). - */ - @JsonProperty(value = "hostingEnvironment") - private String hostingEnvironment; - - /** - * Get the storageAccountUrl property: SAS URL to the container. - * - * @return the storageAccountUrl value. - */ - public String storageAccountUrl() { - return this.storageAccountUrl; - } - - /** - * Set the storageAccountUrl property: SAS URL to the container. - * - * @param storageAccountUrl the storageAccountUrl value to set. - * @return the RestoreRequestProperties object itself. - */ - public RestoreRequestProperties withStorageAccountUrl(String storageAccountUrl) { - this.storageAccountUrl = storageAccountUrl; - return this; - } - - /** - * Get the blobName property: Name of a blob which contains the backup. - * - * @return the blobName value. - */ - public String blobName() { - return this.blobName; - } - - /** - * Set the blobName property: Name of a blob which contains the backup. - * - * @param blobName the blobName value to set. - * @return the RestoreRequestProperties object itself. - */ - public RestoreRequestProperties withBlobName(String blobName) { - this.blobName = blobName; - return this; - } - - /** - * Get the overwrite property: <code>true</code> if the restore operation can overwrite target app; - * otherwise, <code>false</code>. <code>true</code> is needed if trying to restore over an - * existing app. - * - * @return the overwrite value. - */ - public boolean overwrite() { - return this.overwrite; - } - - /** - * Set the overwrite property: <code>true</code> if the restore operation can overwrite target app; - * otherwise, <code>false</code>. <code>true</code> is needed if trying to restore over an - * existing app. - * - * @param overwrite the overwrite value to set. - * @return the RestoreRequestProperties object itself. - */ - public RestoreRequestProperties withOverwrite(boolean overwrite) { - this.overwrite = overwrite; - return this; - } - - /** - * Get the siteName property: Name of an app. - * - * @return the siteName value. - */ - public String siteName() { - return this.siteName; - } - - /** - * Set the siteName property: Name of an app. - * - * @param siteName the siteName value to set. - * @return the RestoreRequestProperties object itself. - */ - public RestoreRequestProperties withSiteName(String siteName) { - this.siteName = siteName; - return this; - } - - /** - * Get the databases property: Collection of databases which should be restored. This list has to match the list of - * databases included in the backup. - * - * @return the databases value. - */ - public List databases() { - return this.databases; - } - - /** - * Set the databases property: Collection of databases which should be restored. This list has to match the list of - * databases included in the backup. - * - * @param databases the databases value to set. - * @return the RestoreRequestProperties object itself. - */ - public RestoreRequestProperties withDatabases(List databases) { - this.databases = databases; - return this; - } - - /** - * Get the ignoreConflictingHostNames property: Changes a logic when restoring an app with custom domains. - * <code>true</code> to remove custom domains automatically. If <code>false</code>, custom - * domains are added to the app's object when it is being restored, but that might fail due to conflicts during the - * operation. - * - * @return the ignoreConflictingHostNames value. - */ - public Boolean ignoreConflictingHostNames() { - return this.ignoreConflictingHostNames; - } - - /** - * Set the ignoreConflictingHostNames property: Changes a logic when restoring an app with custom domains. - * <code>true</code> to remove custom domains automatically. If <code>false</code>, custom - * domains are added to the app's object when it is being restored, but that might fail due to conflicts during the - * operation. - * - * @param ignoreConflictingHostNames the ignoreConflictingHostNames value to set. - * @return the RestoreRequestProperties object itself. - */ - public RestoreRequestProperties withIgnoreConflictingHostNames(Boolean ignoreConflictingHostNames) { - this.ignoreConflictingHostNames = ignoreConflictingHostNames; - return this; - } - - /** - * Get the ignoreDatabases property: Ignore the databases and only restore the site content. - * - * @return the ignoreDatabases value. - */ - public Boolean ignoreDatabases() { - return this.ignoreDatabases; - } - - /** - * Set the ignoreDatabases property: Ignore the databases and only restore the site content. - * - * @param ignoreDatabases the ignoreDatabases value to set. - * @return the RestoreRequestProperties object itself. - */ - public RestoreRequestProperties withIgnoreDatabases(Boolean ignoreDatabases) { - this.ignoreDatabases = ignoreDatabases; - return this; - } - - /** - * Get the appServicePlan property: Specify app service plan that will own restored site. - * - * @return the appServicePlan value. - */ - public String appServicePlan() { - return this.appServicePlan; - } - - /** - * Set the appServicePlan property: Specify app service plan that will own restored site. - * - * @param appServicePlan the appServicePlan value to set. - * @return the RestoreRequestProperties object itself. - */ - public RestoreRequestProperties withAppServicePlan(String appServicePlan) { - this.appServicePlan = appServicePlan; - return this; - } - - /** - * Get the operationType property: Operation type. - * - * @return the operationType value. - */ - public BackupRestoreOperationType operationType() { - return this.operationType; - } - - /** - * Set the operationType property: Operation type. - * - * @param operationType the operationType value to set. - * @return the RestoreRequestProperties object itself. - */ - public RestoreRequestProperties withOperationType(BackupRestoreOperationType operationType) { - this.operationType = operationType; - return this; - } - - /** - * Get the adjustConnectionStrings property: <code>true</code> if SiteConfig.ConnectionStrings should be - * set in new app; otherwise, <code>false</code>. - * - * @return the adjustConnectionStrings value. - */ - public Boolean adjustConnectionStrings() { - return this.adjustConnectionStrings; - } - - /** - * Set the adjustConnectionStrings property: <code>true</code> if SiteConfig.ConnectionStrings should be - * set in new app; otherwise, <code>false</code>. - * - * @param adjustConnectionStrings the adjustConnectionStrings value to set. - * @return the RestoreRequestProperties object itself. - */ - public RestoreRequestProperties withAdjustConnectionStrings(Boolean adjustConnectionStrings) { - this.adjustConnectionStrings = adjustConnectionStrings; - return this; - } - - /** - * Get the hostingEnvironment property: App Service Environment name, if needed (only when restoring an app to an - * App Service Environment). - * - * @return the hostingEnvironment value. - */ - public String hostingEnvironment() { - return this.hostingEnvironment; - } - - /** - * Set the hostingEnvironment property: App Service Environment name, if needed (only when restoring an app to an - * App Service Environment). - * - * @param hostingEnvironment the hostingEnvironment value to set. - * @return the RestoreRequestProperties object itself. - */ - public RestoreRequestProperties withHostingEnvironment(String hostingEnvironment) { - this.hostingEnvironment = hostingEnvironment; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (storageAccountUrl() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property storageAccountUrl in model RestoreRequestProperties")); - } - if (databases() != null) { - databases().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SiteAuthSettingsInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SiteAuthSettingsInner.java deleted file mode 100644 index 668887e9802c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SiteAuthSettingsInner.java +++ /dev/null @@ -1,727 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.BuiltInAuthenticationProvider; -import com.azure.resourcemanager.appservice.models.ProxyOnlyResource; -import com.azure.resourcemanager.appservice.models.UnauthenticatedClientAction; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Configuration settings for the Azure App Service Authentication / Authorization feature. */ -@Fluent -public final class SiteAuthSettingsInner extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SiteAuthSettingsInner.class); - - /* - * SiteAuthSettings resource specific properties - */ - @JsonProperty(value = "properties") - private SiteAuthSettingsProperties innerProperties; - - /** - * Get the innerProperties property: SiteAuthSettings resource specific properties. - * - * @return the innerProperties value. - */ - private SiteAuthSettingsProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public SiteAuthSettingsInner withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the enabled property: <code>true</code> if the Authentication / Authorization feature is enabled - * for the current app; otherwise, <code>false</code>. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.innerProperties() == null ? null : this.innerProperties().enabled(); - } - - /** - * Set the enabled property: <code>true</code> if the Authentication / Authorization feature is enabled - * for the current app; otherwise, <code>false</code>. - * - * @param enabled the enabled value to set. - * @return the SiteAuthSettingsInner object itself. - */ - public SiteAuthSettingsInner withEnabled(Boolean enabled) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteAuthSettingsProperties(); - } - this.innerProperties().withEnabled(enabled); - return this; - } - - /** - * Get the runtimeVersion property: The RuntimeVersion of the Authentication / Authorization feature in use for the - * current app. The setting in this value can control the behavior of certain features in the Authentication / - * Authorization module. - * - * @return the runtimeVersion value. - */ - public String runtimeVersion() { - return this.innerProperties() == null ? null : this.innerProperties().runtimeVersion(); - } - - /** - * Set the runtimeVersion property: The RuntimeVersion of the Authentication / Authorization feature in use for the - * current app. The setting in this value can control the behavior of certain features in the Authentication / - * Authorization module. - * - * @param runtimeVersion the runtimeVersion value to set. - * @return the SiteAuthSettingsInner object itself. - */ - public SiteAuthSettingsInner withRuntimeVersion(String runtimeVersion) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteAuthSettingsProperties(); - } - this.innerProperties().withRuntimeVersion(runtimeVersion); - return this; - } - - /** - * Get the unauthenticatedClientAction property: The action to take when an unauthenticated client attempts to - * access the app. - * - * @return the unauthenticatedClientAction value. - */ - public UnauthenticatedClientAction unauthenticatedClientAction() { - return this.innerProperties() == null ? null : this.innerProperties().unauthenticatedClientAction(); - } - - /** - * Set the unauthenticatedClientAction property: The action to take when an unauthenticated client attempts to - * access the app. - * - * @param unauthenticatedClientAction the unauthenticatedClientAction value to set. - * @return the SiteAuthSettingsInner object itself. - */ - public SiteAuthSettingsInner withUnauthenticatedClientAction( - UnauthenticatedClientAction unauthenticatedClientAction) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteAuthSettingsProperties(); - } - this.innerProperties().withUnauthenticatedClientAction(unauthenticatedClientAction); - return this; - } - - /** - * Get the tokenStoreEnabled property: <code>true</code> to durably store platform-specific security - * tokens that are obtained during login flows; otherwise, <code>false</code>. The default is - * <code>false</code>. - * - * @return the tokenStoreEnabled value. - */ - public Boolean tokenStoreEnabled() { - return this.innerProperties() == null ? null : this.innerProperties().tokenStoreEnabled(); - } - - /** - * Set the tokenStoreEnabled property: <code>true</code> to durably store platform-specific security - * tokens that are obtained during login flows; otherwise, <code>false</code>. The default is - * <code>false</code>. - * - * @param tokenStoreEnabled the tokenStoreEnabled value to set. - * @return the SiteAuthSettingsInner object itself. - */ - public SiteAuthSettingsInner withTokenStoreEnabled(Boolean tokenStoreEnabled) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteAuthSettingsProperties(); - } - this.innerProperties().withTokenStoreEnabled(tokenStoreEnabled); - return this; - } - - /** - * Get the allowedExternalRedirectUrls property: External URLs that can be redirected to as part of logging in or - * logging out of the app. Note that the query string part of the URL is ignored. This is an advanced setting - * typically only needed by Windows Store application backends. Note that URLs within the current domain are always - * implicitly allowed. - * - * @return the allowedExternalRedirectUrls value. - */ - public List allowedExternalRedirectUrls() { - return this.innerProperties() == null ? null : this.innerProperties().allowedExternalRedirectUrls(); - } - - /** - * Set the allowedExternalRedirectUrls property: External URLs that can be redirected to as part of logging in or - * logging out of the app. Note that the query string part of the URL is ignored. This is an advanced setting - * typically only needed by Windows Store application backends. Note that URLs within the current domain are always - * implicitly allowed. - * - * @param allowedExternalRedirectUrls the allowedExternalRedirectUrls value to set. - * @return the SiteAuthSettingsInner object itself. - */ - public SiteAuthSettingsInner withAllowedExternalRedirectUrls(List allowedExternalRedirectUrls) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteAuthSettingsProperties(); - } - this.innerProperties().withAllowedExternalRedirectUrls(allowedExternalRedirectUrls); - return this; - } - - /** - * Get the defaultProvider property: The default authentication provider to use when multiple providers are - * configured. This setting is only needed if multiple providers are configured and the unauthenticated client - * action is set to "RedirectToLoginPage". - * - * @return the defaultProvider value. - */ - public BuiltInAuthenticationProvider defaultProvider() { - return this.innerProperties() == null ? null : this.innerProperties().defaultProvider(); - } - - /** - * Set the defaultProvider property: The default authentication provider to use when multiple providers are - * configured. This setting is only needed if multiple providers are configured and the unauthenticated client - * action is set to "RedirectToLoginPage". - * - * @param defaultProvider the defaultProvider value to set. - * @return the SiteAuthSettingsInner object itself. - */ - public SiteAuthSettingsInner withDefaultProvider(BuiltInAuthenticationProvider defaultProvider) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteAuthSettingsProperties(); - } - this.innerProperties().withDefaultProvider(defaultProvider); - return this; - } - - /** - * Get the tokenRefreshExtensionHours property: The number of hours after session token expiration that a session - * token can be used to call the token refresh API. The default is 72 hours. - * - * @return the tokenRefreshExtensionHours value. - */ - public Double tokenRefreshExtensionHours() { - return this.innerProperties() == null ? null : this.innerProperties().tokenRefreshExtensionHours(); - } - - /** - * Set the tokenRefreshExtensionHours property: The number of hours after session token expiration that a session - * token can be used to call the token refresh API. The default is 72 hours. - * - * @param tokenRefreshExtensionHours the tokenRefreshExtensionHours value to set. - * @return the SiteAuthSettingsInner object itself. - */ - public SiteAuthSettingsInner withTokenRefreshExtensionHours(Double tokenRefreshExtensionHours) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteAuthSettingsProperties(); - } - this.innerProperties().withTokenRefreshExtensionHours(tokenRefreshExtensionHours); - return this; - } - - /** - * Get the clientId property: The Client ID of this relying party application, known as the client_id. This setting - * is required for enabling OpenID Connection authentication with Azure Active Directory or other 3rd party OpenID - * Connect providers. More information on OpenID Connect: http://openid.net/specs/openid-connect-core-1_0.html. - * - * @return the clientId value. - */ - public String clientId() { - return this.innerProperties() == null ? null : this.innerProperties().clientId(); - } - - /** - * Set the clientId property: The Client ID of this relying party application, known as the client_id. This setting - * is required for enabling OpenID Connection authentication with Azure Active Directory or other 3rd party OpenID - * Connect providers. More information on OpenID Connect: http://openid.net/specs/openid-connect-core-1_0.html. - * - * @param clientId the clientId value to set. - * @return the SiteAuthSettingsInner object itself. - */ - public SiteAuthSettingsInner withClientId(String clientId) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteAuthSettingsProperties(); - } - this.innerProperties().withClientId(clientId); - return this; - } - - /** - * Get the clientSecret property: The Client Secret of this relying party application (in Azure Active Directory, - * this is also referred to as the Key). This setting is optional. If no client secret is configured, the OpenID - * Connect implicit auth flow is used to authenticate end users. Otherwise, the OpenID Connect Authorization Code - * Flow is used to authenticate end users. More information on OpenID Connect: - * http://openid.net/specs/openid-connect-core-1_0.html. - * - * @return the clientSecret value. - */ - public String clientSecret() { - return this.innerProperties() == null ? null : this.innerProperties().clientSecret(); - } - - /** - * Set the clientSecret property: The Client Secret of this relying party application (in Azure Active Directory, - * this is also referred to as the Key). This setting is optional. If no client secret is configured, the OpenID - * Connect implicit auth flow is used to authenticate end users. Otherwise, the OpenID Connect Authorization Code - * Flow is used to authenticate end users. More information on OpenID Connect: - * http://openid.net/specs/openid-connect-core-1_0.html. - * - * @param clientSecret the clientSecret value to set. - * @return the SiteAuthSettingsInner object itself. - */ - public SiteAuthSettingsInner withClientSecret(String clientSecret) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteAuthSettingsProperties(); - } - this.innerProperties().withClientSecret(clientSecret); - return this; - } - - /** - * Get the clientSecretCertificateThumbprint property: An alternative to the client secret, that is the thumbprint - * of a certificate used for signing purposes. This property acts as a replacement for the Client Secret. It is also - * optional. - * - * @return the clientSecretCertificateThumbprint value. - */ - public String clientSecretCertificateThumbprint() { - return this.innerProperties() == null ? null : this.innerProperties().clientSecretCertificateThumbprint(); - } - - /** - * Set the clientSecretCertificateThumbprint property: An alternative to the client secret, that is the thumbprint - * of a certificate used for signing purposes. This property acts as a replacement for the Client Secret. It is also - * optional. - * - * @param clientSecretCertificateThumbprint the clientSecretCertificateThumbprint value to set. - * @return the SiteAuthSettingsInner object itself. - */ - public SiteAuthSettingsInner withClientSecretCertificateThumbprint(String clientSecretCertificateThumbprint) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteAuthSettingsProperties(); - } - this.innerProperties().withClientSecretCertificateThumbprint(clientSecretCertificateThumbprint); - return this; - } - - /** - * Get the issuer property: The OpenID Connect Issuer URI that represents the entity which issues access tokens for - * this application. When using Azure Active Directory, this value is the URI of the directory tenant, e.g. - * https://sts.windows.net/{tenant-guid}/. This URI is a case-sensitive identifier for the token issuer. More - * information on OpenID Connect Discovery: http://openid.net/specs/openid-connect-discovery-1_0.html. - * - * @return the issuer value. - */ - public String issuer() { - return this.innerProperties() == null ? null : this.innerProperties().issuer(); - } - - /** - * Set the issuer property: The OpenID Connect Issuer URI that represents the entity which issues access tokens for - * this application. When using Azure Active Directory, this value is the URI of the directory tenant, e.g. - * https://sts.windows.net/{tenant-guid}/. This URI is a case-sensitive identifier for the token issuer. More - * information on OpenID Connect Discovery: http://openid.net/specs/openid-connect-discovery-1_0.html. - * - * @param issuer the issuer value to set. - * @return the SiteAuthSettingsInner object itself. - */ - public SiteAuthSettingsInner withIssuer(String issuer) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteAuthSettingsProperties(); - } - this.innerProperties().withIssuer(issuer); - return this; - } - - /** - * Get the validateIssuer property: Gets a value indicating whether the issuer should be a valid HTTPS url and be - * validated as such. - * - * @return the validateIssuer value. - */ - public Boolean validateIssuer() { - return this.innerProperties() == null ? null : this.innerProperties().validateIssuer(); - } - - /** - * Set the validateIssuer property: Gets a value indicating whether the issuer should be a valid HTTPS url and be - * validated as such. - * - * @param validateIssuer the validateIssuer value to set. - * @return the SiteAuthSettingsInner object itself. - */ - public SiteAuthSettingsInner withValidateIssuer(Boolean validateIssuer) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteAuthSettingsProperties(); - } - this.innerProperties().withValidateIssuer(validateIssuer); - return this; - } - - /** - * Get the allowedAudiences property: Allowed audience values to consider when validating JWTs issued by Azure - * Active Directory. Note that the <code>ClientID</code> value is always considered an allowed audience, - * regardless of this setting. - * - * @return the allowedAudiences value. - */ - public List allowedAudiences() { - return this.innerProperties() == null ? null : this.innerProperties().allowedAudiences(); - } - - /** - * Set the allowedAudiences property: Allowed audience values to consider when validating JWTs issued by Azure - * Active Directory. Note that the <code>ClientID</code> value is always considered an allowed audience, - * regardless of this setting. - * - * @param allowedAudiences the allowedAudiences value to set. - * @return the SiteAuthSettingsInner object itself. - */ - public SiteAuthSettingsInner withAllowedAudiences(List allowedAudiences) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteAuthSettingsProperties(); - } - this.innerProperties().withAllowedAudiences(allowedAudiences); - return this; - } - - /** - * Get the additionalLoginParams property: Login parameters to send to the OpenID Connect authorization endpoint - * when a user logs in. Each parameter must be in the form "key=value". - * - * @return the additionalLoginParams value. - */ - public List additionalLoginParams() { - return this.innerProperties() == null ? null : this.innerProperties().additionalLoginParams(); - } - - /** - * Set the additionalLoginParams property: Login parameters to send to the OpenID Connect authorization endpoint - * when a user logs in. Each parameter must be in the form "key=value". - * - * @param additionalLoginParams the additionalLoginParams value to set. - * @return the SiteAuthSettingsInner object itself. - */ - public SiteAuthSettingsInner withAdditionalLoginParams(List additionalLoginParams) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteAuthSettingsProperties(); - } - this.innerProperties().withAdditionalLoginParams(additionalLoginParams); - return this; - } - - /** - * Get the googleClientId property: The OpenID Connect Client ID for the Google web application. This setting is - * required for enabling Google Sign-In. Google Sign-In documentation: - * https://developers.google.com/identity/sign-in/web/. - * - * @return the googleClientId value. - */ - public String googleClientId() { - return this.innerProperties() == null ? null : this.innerProperties().googleClientId(); - } - - /** - * Set the googleClientId property: The OpenID Connect Client ID for the Google web application. This setting is - * required for enabling Google Sign-In. Google Sign-In documentation: - * https://developers.google.com/identity/sign-in/web/. - * - * @param googleClientId the googleClientId value to set. - * @return the SiteAuthSettingsInner object itself. - */ - public SiteAuthSettingsInner withGoogleClientId(String googleClientId) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteAuthSettingsProperties(); - } - this.innerProperties().withGoogleClientId(googleClientId); - return this; - } - - /** - * Get the googleClientSecret property: The client secret associated with the Google web application. This setting - * is required for enabling Google Sign-In. Google Sign-In documentation: - * https://developers.google.com/identity/sign-in/web/. - * - * @return the googleClientSecret value. - */ - public String googleClientSecret() { - return this.innerProperties() == null ? null : this.innerProperties().googleClientSecret(); - } - - /** - * Set the googleClientSecret property: The client secret associated with the Google web application. This setting - * is required for enabling Google Sign-In. Google Sign-In documentation: - * https://developers.google.com/identity/sign-in/web/. - * - * @param googleClientSecret the googleClientSecret value to set. - * @return the SiteAuthSettingsInner object itself. - */ - public SiteAuthSettingsInner withGoogleClientSecret(String googleClientSecret) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteAuthSettingsProperties(); - } - this.innerProperties().withGoogleClientSecret(googleClientSecret); - return this; - } - - /** - * Get the googleOAuthScopes property: The OAuth 2.0 scopes that will be requested as part of Google Sign-In - * authentication. This setting is optional. If not specified, "openid", "profile", and "email" are used as default - * scopes. Google Sign-In documentation: https://developers.google.com/identity/sign-in/web/. - * - * @return the googleOAuthScopes value. - */ - public List googleOAuthScopes() { - return this.innerProperties() == null ? null : this.innerProperties().googleOAuthScopes(); - } - - /** - * Set the googleOAuthScopes property: The OAuth 2.0 scopes that will be requested as part of Google Sign-In - * authentication. This setting is optional. If not specified, "openid", "profile", and "email" are used as default - * scopes. Google Sign-In documentation: https://developers.google.com/identity/sign-in/web/. - * - * @param googleOAuthScopes the googleOAuthScopes value to set. - * @return the SiteAuthSettingsInner object itself. - */ - public SiteAuthSettingsInner withGoogleOAuthScopes(List googleOAuthScopes) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteAuthSettingsProperties(); - } - this.innerProperties().withGoogleOAuthScopes(googleOAuthScopes); - return this; - } - - /** - * Get the facebookAppId property: The App ID of the Facebook app used for login. This setting is required for - * enabling Facebook Login. Facebook Login documentation: https://developers.facebook.com/docs/facebook-login. - * - * @return the facebookAppId value. - */ - public String facebookAppId() { - return this.innerProperties() == null ? null : this.innerProperties().facebookAppId(); - } - - /** - * Set the facebookAppId property: The App ID of the Facebook app used for login. This setting is required for - * enabling Facebook Login. Facebook Login documentation: https://developers.facebook.com/docs/facebook-login. - * - * @param facebookAppId the facebookAppId value to set. - * @return the SiteAuthSettingsInner object itself. - */ - public SiteAuthSettingsInner withFacebookAppId(String facebookAppId) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteAuthSettingsProperties(); - } - this.innerProperties().withFacebookAppId(facebookAppId); - return this; - } - - /** - * Get the facebookAppSecret property: The App Secret of the Facebook app used for Facebook Login. This setting is - * required for enabling Facebook Login. Facebook Login documentation: - * https://developers.facebook.com/docs/facebook-login. - * - * @return the facebookAppSecret value. - */ - public String facebookAppSecret() { - return this.innerProperties() == null ? null : this.innerProperties().facebookAppSecret(); - } - - /** - * Set the facebookAppSecret property: The App Secret of the Facebook app used for Facebook Login. This setting is - * required for enabling Facebook Login. Facebook Login documentation: - * https://developers.facebook.com/docs/facebook-login. - * - * @param facebookAppSecret the facebookAppSecret value to set. - * @return the SiteAuthSettingsInner object itself. - */ - public SiteAuthSettingsInner withFacebookAppSecret(String facebookAppSecret) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteAuthSettingsProperties(); - } - this.innerProperties().withFacebookAppSecret(facebookAppSecret); - return this; - } - - /** - * Get the facebookOAuthScopes property: The OAuth 2.0 scopes that will be requested as part of Facebook Login - * authentication. This setting is optional. Facebook Login documentation: - * https://developers.facebook.com/docs/facebook-login. - * - * @return the facebookOAuthScopes value. - */ - public List facebookOAuthScopes() { - return this.innerProperties() == null ? null : this.innerProperties().facebookOAuthScopes(); - } - - /** - * Set the facebookOAuthScopes property: The OAuth 2.0 scopes that will be requested as part of Facebook Login - * authentication. This setting is optional. Facebook Login documentation: - * https://developers.facebook.com/docs/facebook-login. - * - * @param facebookOAuthScopes the facebookOAuthScopes value to set. - * @return the SiteAuthSettingsInner object itself. - */ - public SiteAuthSettingsInner withFacebookOAuthScopes(List facebookOAuthScopes) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteAuthSettingsProperties(); - } - this.innerProperties().withFacebookOAuthScopes(facebookOAuthScopes); - return this; - } - - /** - * Get the twitterConsumerKey property: The OAuth 1.0a consumer key of the Twitter application used for sign-in. - * This setting is required for enabling Twitter Sign-In. Twitter Sign-In documentation: - * https://dev.twitter.com/web/sign-in. - * - * @return the twitterConsumerKey value. - */ - public String twitterConsumerKey() { - return this.innerProperties() == null ? null : this.innerProperties().twitterConsumerKey(); - } - - /** - * Set the twitterConsumerKey property: The OAuth 1.0a consumer key of the Twitter application used for sign-in. - * This setting is required for enabling Twitter Sign-In. Twitter Sign-In documentation: - * https://dev.twitter.com/web/sign-in. - * - * @param twitterConsumerKey the twitterConsumerKey value to set. - * @return the SiteAuthSettingsInner object itself. - */ - public SiteAuthSettingsInner withTwitterConsumerKey(String twitterConsumerKey) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteAuthSettingsProperties(); - } - this.innerProperties().withTwitterConsumerKey(twitterConsumerKey); - return this; - } - - /** - * Get the twitterConsumerSecret property: The OAuth 1.0a consumer secret of the Twitter application used for - * sign-in. This setting is required for enabling Twitter Sign-In. Twitter Sign-In documentation: - * https://dev.twitter.com/web/sign-in. - * - * @return the twitterConsumerSecret value. - */ - public String twitterConsumerSecret() { - return this.innerProperties() == null ? null : this.innerProperties().twitterConsumerSecret(); - } - - /** - * Set the twitterConsumerSecret property: The OAuth 1.0a consumer secret of the Twitter application used for - * sign-in. This setting is required for enabling Twitter Sign-In. Twitter Sign-In documentation: - * https://dev.twitter.com/web/sign-in. - * - * @param twitterConsumerSecret the twitterConsumerSecret value to set. - * @return the SiteAuthSettingsInner object itself. - */ - public SiteAuthSettingsInner withTwitterConsumerSecret(String twitterConsumerSecret) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteAuthSettingsProperties(); - } - this.innerProperties().withTwitterConsumerSecret(twitterConsumerSecret); - return this; - } - - /** - * Get the microsoftAccountClientId property: The OAuth 2.0 client ID that was created for the app used for - * authentication. This setting is required for enabling Microsoft Account authentication. Microsoft Account OAuth - * documentation: https://dev.onedrive.com/auth/msa_oauth.htm. - * - * @return the microsoftAccountClientId value. - */ - public String microsoftAccountClientId() { - return this.innerProperties() == null ? null : this.innerProperties().microsoftAccountClientId(); - } - - /** - * Set the microsoftAccountClientId property: The OAuth 2.0 client ID that was created for the app used for - * authentication. This setting is required for enabling Microsoft Account authentication. Microsoft Account OAuth - * documentation: https://dev.onedrive.com/auth/msa_oauth.htm. - * - * @param microsoftAccountClientId the microsoftAccountClientId value to set. - * @return the SiteAuthSettingsInner object itself. - */ - public SiteAuthSettingsInner withMicrosoftAccountClientId(String microsoftAccountClientId) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteAuthSettingsProperties(); - } - this.innerProperties().withMicrosoftAccountClientId(microsoftAccountClientId); - return this; - } - - /** - * Get the microsoftAccountClientSecret property: The OAuth 2.0 client secret that was created for the app used for - * authentication. This setting is required for enabling Microsoft Account authentication. Microsoft Account OAuth - * documentation: https://dev.onedrive.com/auth/msa_oauth.htm. - * - * @return the microsoftAccountClientSecret value. - */ - public String microsoftAccountClientSecret() { - return this.innerProperties() == null ? null : this.innerProperties().microsoftAccountClientSecret(); - } - - /** - * Set the microsoftAccountClientSecret property: The OAuth 2.0 client secret that was created for the app used for - * authentication. This setting is required for enabling Microsoft Account authentication. Microsoft Account OAuth - * documentation: https://dev.onedrive.com/auth/msa_oauth.htm. - * - * @param microsoftAccountClientSecret the microsoftAccountClientSecret value to set. - * @return the SiteAuthSettingsInner object itself. - */ - public SiteAuthSettingsInner withMicrosoftAccountClientSecret(String microsoftAccountClientSecret) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteAuthSettingsProperties(); - } - this.innerProperties().withMicrosoftAccountClientSecret(microsoftAccountClientSecret); - return this; - } - - /** - * Get the microsoftAccountOAuthScopes property: The OAuth 2.0 scopes that will be requested as part of Microsoft - * Account authentication. This setting is optional. If not specified, "wl.basic" is used as the default scope. - * Microsoft Account Scopes and permissions documentation: https://msdn.microsoft.com/en-us/library/dn631845.aspx. - * - * @return the microsoftAccountOAuthScopes value. - */ - public List microsoftAccountOAuthScopes() { - return this.innerProperties() == null ? null : this.innerProperties().microsoftAccountOAuthScopes(); - } - - /** - * Set the microsoftAccountOAuthScopes property: The OAuth 2.0 scopes that will be requested as part of Microsoft - * Account authentication. This setting is optional. If not specified, "wl.basic" is used as the default scope. - * Microsoft Account Scopes and permissions documentation: https://msdn.microsoft.com/en-us/library/dn631845.aspx. - * - * @param microsoftAccountOAuthScopes the microsoftAccountOAuthScopes value to set. - * @return the SiteAuthSettingsInner object itself. - */ - public SiteAuthSettingsInner withMicrosoftAccountOAuthScopes(List microsoftAccountOAuthScopes) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteAuthSettingsProperties(); - } - this.innerProperties().withMicrosoftAccountOAuthScopes(microsoftAccountOAuthScopes); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SiteAuthSettingsProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SiteAuthSettingsProperties.java deleted file mode 100644 index c0d4d1ac6022..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SiteAuthSettingsProperties.java +++ /dev/null @@ -1,856 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.BuiltInAuthenticationProvider; -import com.azure.resourcemanager.appservice.models.UnauthenticatedClientAction; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** SiteAuthSettings resource specific properties. */ -@Fluent -public final class SiteAuthSettingsProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SiteAuthSettingsProperties.class); - - /* - * true if the Authentication / Authorization feature is - * enabled for the current app; otherwise, false. - */ - @JsonProperty(value = "enabled") - private Boolean enabled; - - /* - * The RuntimeVersion of the Authentication / Authorization feature in use - * for the current app. - * The setting in this value can control the behavior of certain features - * in the Authentication / Authorization module. - */ - @JsonProperty(value = "runtimeVersion") - private String runtimeVersion; - - /* - * The action to take when an unauthenticated client attempts to access the - * app. - */ - @JsonProperty(value = "unauthenticatedClientAction") - private UnauthenticatedClientAction unauthenticatedClientAction; - - /* - * true to durably store platform-specific security tokens - * that are obtained during login flows; otherwise, false. - * The default is false. - */ - @JsonProperty(value = "tokenStoreEnabled") - private Boolean tokenStoreEnabled; - - /* - * External URLs that can be redirected to as part of logging in or logging - * out of the app. Note that the query string part of the URL is ignored. - * This is an advanced setting typically only needed by Windows Store - * application backends. - * Note that URLs within the current domain are always implicitly allowed. - */ - @JsonProperty(value = "allowedExternalRedirectUrls") - private List allowedExternalRedirectUrls; - - /* - * The default authentication provider to use when multiple providers are - * configured. - * This setting is only needed if multiple providers are configured and the - * unauthenticated client - * action is set to "RedirectToLoginPage". - */ - @JsonProperty(value = "defaultProvider") - private BuiltInAuthenticationProvider defaultProvider; - - /* - * The number of hours after session token expiration that a session token - * can be used to - * call the token refresh API. The default is 72 hours. - */ - @JsonProperty(value = "tokenRefreshExtensionHours") - private Double tokenRefreshExtensionHours; - - /* - * The Client ID of this relying party application, known as the client_id. - * This setting is required for enabling OpenID Connection authentication - * with Azure Active Directory or - * other 3rd party OpenID Connect providers. - * More information on OpenID Connect: - * http://openid.net/specs/openid-connect-core-1_0.html - */ - @JsonProperty(value = "clientId") - private String clientId; - - /* - * The Client Secret of this relying party application (in Azure Active - * Directory, this is also referred to as the Key). - * This setting is optional. If no client secret is configured, the OpenID - * Connect implicit auth flow is used to authenticate end users. - * Otherwise, the OpenID Connect Authorization Code Flow is used to - * authenticate end users. - * More information on OpenID Connect: - * http://openid.net/specs/openid-connect-core-1_0.html - */ - @JsonProperty(value = "clientSecret") - private String clientSecret; - - /* - * An alternative to the client secret, that is the thumbprint of a - * certificate used for signing purposes. This property acts as - * a replacement for the Client Secret. It is also optional. - */ - @JsonProperty(value = "clientSecretCertificateThumbprint") - private String clientSecretCertificateThumbprint; - - /* - * The OpenID Connect Issuer URI that represents the entity which issues - * access tokens for this application. - * When using Azure Active Directory, this value is the URI of the - * directory tenant, e.g. https://sts.windows.net/{tenant-guid}/. - * This URI is a case-sensitive identifier for the token issuer. - * More information on OpenID Connect Discovery: - * http://openid.net/specs/openid-connect-discovery-1_0.html - */ - @JsonProperty(value = "issuer") - private String issuer; - - /* - * Gets a value indicating whether the issuer should be a valid HTTPS url - * and be validated as such. - */ - @JsonProperty(value = "validateIssuer") - private Boolean validateIssuer; - - /* - * Allowed audience values to consider when validating JWTs issued by - * Azure Active Directory. Note that the ClientID value is - * always considered an - * allowed audience, regardless of this setting. - */ - @JsonProperty(value = "allowedAudiences") - private List allowedAudiences; - - /* - * Login parameters to send to the OpenID Connect authorization endpoint - * when - * a user logs in. Each parameter must be in the form "key=value". - */ - @JsonProperty(value = "additionalLoginParams") - private List additionalLoginParams; - - /* - * The OpenID Connect Client ID for the Google web application. - * This setting is required for enabling Google Sign-In. - * Google Sign-In documentation: - * https://developers.google.com/identity/sign-in/web/ - */ - @JsonProperty(value = "googleClientId") - private String googleClientId; - - /* - * The client secret associated with the Google web application. - * This setting is required for enabling Google Sign-In. - * Google Sign-In documentation: - * https://developers.google.com/identity/sign-in/web/ - */ - @JsonProperty(value = "googleClientSecret") - private String googleClientSecret; - - /* - * The OAuth 2.0 scopes that will be requested as part of Google Sign-In - * authentication. - * This setting is optional. If not specified, "openid", "profile", and - * "email" are used as default scopes. - * Google Sign-In documentation: - * https://developers.google.com/identity/sign-in/web/ - */ - @JsonProperty(value = "googleOAuthScopes") - private List googleOAuthScopes; - - /* - * The App ID of the Facebook app used for login. - * This setting is required for enabling Facebook Login. - * Facebook Login documentation: - * https://developers.facebook.com/docs/facebook-login - */ - @JsonProperty(value = "facebookAppId") - private String facebookAppId; - - /* - * The App Secret of the Facebook app used for Facebook Login. - * This setting is required for enabling Facebook Login. - * Facebook Login documentation: - * https://developers.facebook.com/docs/facebook-login - */ - @JsonProperty(value = "facebookAppSecret") - private String facebookAppSecret; - - /* - * The OAuth 2.0 scopes that will be requested as part of Facebook Login - * authentication. - * This setting is optional. - * Facebook Login documentation: - * https://developers.facebook.com/docs/facebook-login - */ - @JsonProperty(value = "facebookOAuthScopes") - private List facebookOAuthScopes; - - /* - * The OAuth 1.0a consumer key of the Twitter application used for sign-in. - * This setting is required for enabling Twitter Sign-In. - * Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in - */ - @JsonProperty(value = "twitterConsumerKey") - private String twitterConsumerKey; - - /* - * The OAuth 1.0a consumer secret of the Twitter application used for - * sign-in. - * This setting is required for enabling Twitter Sign-In. - * Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in - */ - @JsonProperty(value = "twitterConsumerSecret") - private String twitterConsumerSecret; - - /* - * The OAuth 2.0 client ID that was created for the app used for - * authentication. - * This setting is required for enabling Microsoft Account authentication. - * Microsoft Account OAuth documentation: - * https://dev.onedrive.com/auth/msa_oauth.htm - */ - @JsonProperty(value = "microsoftAccountClientId") - private String microsoftAccountClientId; - - /* - * The OAuth 2.0 client secret that was created for the app used for - * authentication. - * This setting is required for enabling Microsoft Account authentication. - * Microsoft Account OAuth documentation: - * https://dev.onedrive.com/auth/msa_oauth.htm - */ - @JsonProperty(value = "microsoftAccountClientSecret") - private String microsoftAccountClientSecret; - - /* - * The OAuth 2.0 scopes that will be requested as part of Microsoft Account - * authentication. - * This setting is optional. If not specified, "wl.basic" is used as the - * default scope. - * Microsoft Account Scopes and permissions documentation: - * https://msdn.microsoft.com/en-us/library/dn631845.aspx - */ - @JsonProperty(value = "microsoftAccountOAuthScopes") - private List microsoftAccountOAuthScopes; - - /** - * Get the enabled property: <code>true</code> if the Authentication / Authorization feature is enabled - * for the current app; otherwise, <code>false</code>. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: <code>true</code> if the Authentication / Authorization feature is enabled - * for the current app; otherwise, <code>false</code>. - * - * @param enabled the enabled value to set. - * @return the SiteAuthSettingsProperties object itself. - */ - public SiteAuthSettingsProperties withEnabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the runtimeVersion property: The RuntimeVersion of the Authentication / Authorization feature in use for the - * current app. The setting in this value can control the behavior of certain features in the Authentication / - * Authorization module. - * - * @return the runtimeVersion value. - */ - public String runtimeVersion() { - return this.runtimeVersion; - } - - /** - * Set the runtimeVersion property: The RuntimeVersion of the Authentication / Authorization feature in use for the - * current app. The setting in this value can control the behavior of certain features in the Authentication / - * Authorization module. - * - * @param runtimeVersion the runtimeVersion value to set. - * @return the SiteAuthSettingsProperties object itself. - */ - public SiteAuthSettingsProperties withRuntimeVersion(String runtimeVersion) { - this.runtimeVersion = runtimeVersion; - return this; - } - - /** - * Get the unauthenticatedClientAction property: The action to take when an unauthenticated client attempts to - * access the app. - * - * @return the unauthenticatedClientAction value. - */ - public UnauthenticatedClientAction unauthenticatedClientAction() { - return this.unauthenticatedClientAction; - } - - /** - * Set the unauthenticatedClientAction property: The action to take when an unauthenticated client attempts to - * access the app. - * - * @param unauthenticatedClientAction the unauthenticatedClientAction value to set. - * @return the SiteAuthSettingsProperties object itself. - */ - public SiteAuthSettingsProperties withUnauthenticatedClientAction( - UnauthenticatedClientAction unauthenticatedClientAction) { - this.unauthenticatedClientAction = unauthenticatedClientAction; - return this; - } - - /** - * Get the tokenStoreEnabled property: <code>true</code> to durably store platform-specific security - * tokens that are obtained during login flows; otherwise, <code>false</code>. The default is - * <code>false</code>. - * - * @return the tokenStoreEnabled value. - */ - public Boolean tokenStoreEnabled() { - return this.tokenStoreEnabled; - } - - /** - * Set the tokenStoreEnabled property: <code>true</code> to durably store platform-specific security - * tokens that are obtained during login flows; otherwise, <code>false</code>. The default is - * <code>false</code>. - * - * @param tokenStoreEnabled the tokenStoreEnabled value to set. - * @return the SiteAuthSettingsProperties object itself. - */ - public SiteAuthSettingsProperties withTokenStoreEnabled(Boolean tokenStoreEnabled) { - this.tokenStoreEnabled = tokenStoreEnabled; - return this; - } - - /** - * Get the allowedExternalRedirectUrls property: External URLs that can be redirected to as part of logging in or - * logging out of the app. Note that the query string part of the URL is ignored. This is an advanced setting - * typically only needed by Windows Store application backends. Note that URLs within the current domain are always - * implicitly allowed. - * - * @return the allowedExternalRedirectUrls value. - */ - public List allowedExternalRedirectUrls() { - return this.allowedExternalRedirectUrls; - } - - /** - * Set the allowedExternalRedirectUrls property: External URLs that can be redirected to as part of logging in or - * logging out of the app. Note that the query string part of the URL is ignored. This is an advanced setting - * typically only needed by Windows Store application backends. Note that URLs within the current domain are always - * implicitly allowed. - * - * @param allowedExternalRedirectUrls the allowedExternalRedirectUrls value to set. - * @return the SiteAuthSettingsProperties object itself. - */ - public SiteAuthSettingsProperties withAllowedExternalRedirectUrls(List allowedExternalRedirectUrls) { - this.allowedExternalRedirectUrls = allowedExternalRedirectUrls; - return this; - } - - /** - * Get the defaultProvider property: The default authentication provider to use when multiple providers are - * configured. This setting is only needed if multiple providers are configured and the unauthenticated client - * action is set to "RedirectToLoginPage". - * - * @return the defaultProvider value. - */ - public BuiltInAuthenticationProvider defaultProvider() { - return this.defaultProvider; - } - - /** - * Set the defaultProvider property: The default authentication provider to use when multiple providers are - * configured. This setting is only needed if multiple providers are configured and the unauthenticated client - * action is set to "RedirectToLoginPage". - * - * @param defaultProvider the defaultProvider value to set. - * @return the SiteAuthSettingsProperties object itself. - */ - public SiteAuthSettingsProperties withDefaultProvider(BuiltInAuthenticationProvider defaultProvider) { - this.defaultProvider = defaultProvider; - return this; - } - - /** - * Get the tokenRefreshExtensionHours property: The number of hours after session token expiration that a session - * token can be used to call the token refresh API. The default is 72 hours. - * - * @return the tokenRefreshExtensionHours value. - */ - public Double tokenRefreshExtensionHours() { - return this.tokenRefreshExtensionHours; - } - - /** - * Set the tokenRefreshExtensionHours property: The number of hours after session token expiration that a session - * token can be used to call the token refresh API. The default is 72 hours. - * - * @param tokenRefreshExtensionHours the tokenRefreshExtensionHours value to set. - * @return the SiteAuthSettingsProperties object itself. - */ - public SiteAuthSettingsProperties withTokenRefreshExtensionHours(Double tokenRefreshExtensionHours) { - this.tokenRefreshExtensionHours = tokenRefreshExtensionHours; - return this; - } - - /** - * Get the clientId property: The Client ID of this relying party application, known as the client_id. This setting - * is required for enabling OpenID Connection authentication with Azure Active Directory or other 3rd party OpenID - * Connect providers. More information on OpenID Connect: http://openid.net/specs/openid-connect-core-1_0.html. - * - * @return the clientId value. - */ - public String clientId() { - return this.clientId; - } - - /** - * Set the clientId property: The Client ID of this relying party application, known as the client_id. This setting - * is required for enabling OpenID Connection authentication with Azure Active Directory or other 3rd party OpenID - * Connect providers. More information on OpenID Connect: http://openid.net/specs/openid-connect-core-1_0.html. - * - * @param clientId the clientId value to set. - * @return the SiteAuthSettingsProperties object itself. - */ - public SiteAuthSettingsProperties withClientId(String clientId) { - this.clientId = clientId; - return this; - } - - /** - * Get the clientSecret property: The Client Secret of this relying party application (in Azure Active Directory, - * this is also referred to as the Key). This setting is optional. If no client secret is configured, the OpenID - * Connect implicit auth flow is used to authenticate end users. Otherwise, the OpenID Connect Authorization Code - * Flow is used to authenticate end users. More information on OpenID Connect: - * http://openid.net/specs/openid-connect-core-1_0.html. - * - * @return the clientSecret value. - */ - public String clientSecret() { - return this.clientSecret; - } - - /** - * Set the clientSecret property: The Client Secret of this relying party application (in Azure Active Directory, - * this is also referred to as the Key). This setting is optional. If no client secret is configured, the OpenID - * Connect implicit auth flow is used to authenticate end users. Otherwise, the OpenID Connect Authorization Code - * Flow is used to authenticate end users. More information on OpenID Connect: - * http://openid.net/specs/openid-connect-core-1_0.html. - * - * @param clientSecret the clientSecret value to set. - * @return the SiteAuthSettingsProperties object itself. - */ - public SiteAuthSettingsProperties withClientSecret(String clientSecret) { - this.clientSecret = clientSecret; - return this; - } - - /** - * Get the clientSecretCertificateThumbprint property: An alternative to the client secret, that is the thumbprint - * of a certificate used for signing purposes. This property acts as a replacement for the Client Secret. It is also - * optional. - * - * @return the clientSecretCertificateThumbprint value. - */ - public String clientSecretCertificateThumbprint() { - return this.clientSecretCertificateThumbprint; - } - - /** - * Set the clientSecretCertificateThumbprint property: An alternative to the client secret, that is the thumbprint - * of a certificate used for signing purposes. This property acts as a replacement for the Client Secret. It is also - * optional. - * - * @param clientSecretCertificateThumbprint the clientSecretCertificateThumbprint value to set. - * @return the SiteAuthSettingsProperties object itself. - */ - public SiteAuthSettingsProperties withClientSecretCertificateThumbprint(String clientSecretCertificateThumbprint) { - this.clientSecretCertificateThumbprint = clientSecretCertificateThumbprint; - return this; - } - - /** - * Get the issuer property: The OpenID Connect Issuer URI that represents the entity which issues access tokens for - * this application. When using Azure Active Directory, this value is the URI of the directory tenant, e.g. - * https://sts.windows.net/{tenant-guid}/. This URI is a case-sensitive identifier for the token issuer. More - * information on OpenID Connect Discovery: http://openid.net/specs/openid-connect-discovery-1_0.html. - * - * @return the issuer value. - */ - public String issuer() { - return this.issuer; - } - - /** - * Set the issuer property: The OpenID Connect Issuer URI that represents the entity which issues access tokens for - * this application. When using Azure Active Directory, this value is the URI of the directory tenant, e.g. - * https://sts.windows.net/{tenant-guid}/. This URI is a case-sensitive identifier for the token issuer. More - * information on OpenID Connect Discovery: http://openid.net/specs/openid-connect-discovery-1_0.html. - * - * @param issuer the issuer value to set. - * @return the SiteAuthSettingsProperties object itself. - */ - public SiteAuthSettingsProperties withIssuer(String issuer) { - this.issuer = issuer; - return this; - } - - /** - * Get the validateIssuer property: Gets a value indicating whether the issuer should be a valid HTTPS url and be - * validated as such. - * - * @return the validateIssuer value. - */ - public Boolean validateIssuer() { - return this.validateIssuer; - } - - /** - * Set the validateIssuer property: Gets a value indicating whether the issuer should be a valid HTTPS url and be - * validated as such. - * - * @param validateIssuer the validateIssuer value to set. - * @return the SiteAuthSettingsProperties object itself. - */ - public SiteAuthSettingsProperties withValidateIssuer(Boolean validateIssuer) { - this.validateIssuer = validateIssuer; - return this; - } - - /** - * Get the allowedAudiences property: Allowed audience values to consider when validating JWTs issued by Azure - * Active Directory. Note that the <code>ClientID</code> value is always considered an allowed audience, - * regardless of this setting. - * - * @return the allowedAudiences value. - */ - public List allowedAudiences() { - return this.allowedAudiences; - } - - /** - * Set the allowedAudiences property: Allowed audience values to consider when validating JWTs issued by Azure - * Active Directory. Note that the <code>ClientID</code> value is always considered an allowed audience, - * regardless of this setting. - * - * @param allowedAudiences the allowedAudiences value to set. - * @return the SiteAuthSettingsProperties object itself. - */ - public SiteAuthSettingsProperties withAllowedAudiences(List allowedAudiences) { - this.allowedAudiences = allowedAudiences; - return this; - } - - /** - * Get the additionalLoginParams property: Login parameters to send to the OpenID Connect authorization endpoint - * when a user logs in. Each parameter must be in the form "key=value". - * - * @return the additionalLoginParams value. - */ - public List additionalLoginParams() { - return this.additionalLoginParams; - } - - /** - * Set the additionalLoginParams property: Login parameters to send to the OpenID Connect authorization endpoint - * when a user logs in. Each parameter must be in the form "key=value". - * - * @param additionalLoginParams the additionalLoginParams value to set. - * @return the SiteAuthSettingsProperties object itself. - */ - public SiteAuthSettingsProperties withAdditionalLoginParams(List additionalLoginParams) { - this.additionalLoginParams = additionalLoginParams; - return this; - } - - /** - * Get the googleClientId property: The OpenID Connect Client ID for the Google web application. This setting is - * required for enabling Google Sign-In. Google Sign-In documentation: - * https://developers.google.com/identity/sign-in/web/. - * - * @return the googleClientId value. - */ - public String googleClientId() { - return this.googleClientId; - } - - /** - * Set the googleClientId property: The OpenID Connect Client ID for the Google web application. This setting is - * required for enabling Google Sign-In. Google Sign-In documentation: - * https://developers.google.com/identity/sign-in/web/. - * - * @param googleClientId the googleClientId value to set. - * @return the SiteAuthSettingsProperties object itself. - */ - public SiteAuthSettingsProperties withGoogleClientId(String googleClientId) { - this.googleClientId = googleClientId; - return this; - } - - /** - * Get the googleClientSecret property: The client secret associated with the Google web application. This setting - * is required for enabling Google Sign-In. Google Sign-In documentation: - * https://developers.google.com/identity/sign-in/web/. - * - * @return the googleClientSecret value. - */ - public String googleClientSecret() { - return this.googleClientSecret; - } - - /** - * Set the googleClientSecret property: The client secret associated with the Google web application. This setting - * is required for enabling Google Sign-In. Google Sign-In documentation: - * https://developers.google.com/identity/sign-in/web/. - * - * @param googleClientSecret the googleClientSecret value to set. - * @return the SiteAuthSettingsProperties object itself. - */ - public SiteAuthSettingsProperties withGoogleClientSecret(String googleClientSecret) { - this.googleClientSecret = googleClientSecret; - return this; - } - - /** - * Get the googleOAuthScopes property: The OAuth 2.0 scopes that will be requested as part of Google Sign-In - * authentication. This setting is optional. If not specified, "openid", "profile", and "email" are used as default - * scopes. Google Sign-In documentation: https://developers.google.com/identity/sign-in/web/. - * - * @return the googleOAuthScopes value. - */ - public List googleOAuthScopes() { - return this.googleOAuthScopes; - } - - /** - * Set the googleOAuthScopes property: The OAuth 2.0 scopes that will be requested as part of Google Sign-In - * authentication. This setting is optional. If not specified, "openid", "profile", and "email" are used as default - * scopes. Google Sign-In documentation: https://developers.google.com/identity/sign-in/web/. - * - * @param googleOAuthScopes the googleOAuthScopes value to set. - * @return the SiteAuthSettingsProperties object itself. - */ - public SiteAuthSettingsProperties withGoogleOAuthScopes(List googleOAuthScopes) { - this.googleOAuthScopes = googleOAuthScopes; - return this; - } - - /** - * Get the facebookAppId property: The App ID of the Facebook app used for login. This setting is required for - * enabling Facebook Login. Facebook Login documentation: https://developers.facebook.com/docs/facebook-login. - * - * @return the facebookAppId value. - */ - public String facebookAppId() { - return this.facebookAppId; - } - - /** - * Set the facebookAppId property: The App ID of the Facebook app used for login. This setting is required for - * enabling Facebook Login. Facebook Login documentation: https://developers.facebook.com/docs/facebook-login. - * - * @param facebookAppId the facebookAppId value to set. - * @return the SiteAuthSettingsProperties object itself. - */ - public SiteAuthSettingsProperties withFacebookAppId(String facebookAppId) { - this.facebookAppId = facebookAppId; - return this; - } - - /** - * Get the facebookAppSecret property: The App Secret of the Facebook app used for Facebook Login. This setting is - * required for enabling Facebook Login. Facebook Login documentation: - * https://developers.facebook.com/docs/facebook-login. - * - * @return the facebookAppSecret value. - */ - public String facebookAppSecret() { - return this.facebookAppSecret; - } - - /** - * Set the facebookAppSecret property: The App Secret of the Facebook app used for Facebook Login. This setting is - * required for enabling Facebook Login. Facebook Login documentation: - * https://developers.facebook.com/docs/facebook-login. - * - * @param facebookAppSecret the facebookAppSecret value to set. - * @return the SiteAuthSettingsProperties object itself. - */ - public SiteAuthSettingsProperties withFacebookAppSecret(String facebookAppSecret) { - this.facebookAppSecret = facebookAppSecret; - return this; - } - - /** - * Get the facebookOAuthScopes property: The OAuth 2.0 scopes that will be requested as part of Facebook Login - * authentication. This setting is optional. Facebook Login documentation: - * https://developers.facebook.com/docs/facebook-login. - * - * @return the facebookOAuthScopes value. - */ - public List facebookOAuthScopes() { - return this.facebookOAuthScopes; - } - - /** - * Set the facebookOAuthScopes property: The OAuth 2.0 scopes that will be requested as part of Facebook Login - * authentication. This setting is optional. Facebook Login documentation: - * https://developers.facebook.com/docs/facebook-login. - * - * @param facebookOAuthScopes the facebookOAuthScopes value to set. - * @return the SiteAuthSettingsProperties object itself. - */ - public SiteAuthSettingsProperties withFacebookOAuthScopes(List facebookOAuthScopes) { - this.facebookOAuthScopes = facebookOAuthScopes; - return this; - } - - /** - * Get the twitterConsumerKey property: The OAuth 1.0a consumer key of the Twitter application used for sign-in. - * This setting is required for enabling Twitter Sign-In. Twitter Sign-In documentation: - * https://dev.twitter.com/web/sign-in. - * - * @return the twitterConsumerKey value. - */ - public String twitterConsumerKey() { - return this.twitterConsumerKey; - } - - /** - * Set the twitterConsumerKey property: The OAuth 1.0a consumer key of the Twitter application used for sign-in. - * This setting is required for enabling Twitter Sign-In. Twitter Sign-In documentation: - * https://dev.twitter.com/web/sign-in. - * - * @param twitterConsumerKey the twitterConsumerKey value to set. - * @return the SiteAuthSettingsProperties object itself. - */ - public SiteAuthSettingsProperties withTwitterConsumerKey(String twitterConsumerKey) { - this.twitterConsumerKey = twitterConsumerKey; - return this; - } - - /** - * Get the twitterConsumerSecret property: The OAuth 1.0a consumer secret of the Twitter application used for - * sign-in. This setting is required for enabling Twitter Sign-In. Twitter Sign-In documentation: - * https://dev.twitter.com/web/sign-in. - * - * @return the twitterConsumerSecret value. - */ - public String twitterConsumerSecret() { - return this.twitterConsumerSecret; - } - - /** - * Set the twitterConsumerSecret property: The OAuth 1.0a consumer secret of the Twitter application used for - * sign-in. This setting is required for enabling Twitter Sign-In. Twitter Sign-In documentation: - * https://dev.twitter.com/web/sign-in. - * - * @param twitterConsumerSecret the twitterConsumerSecret value to set. - * @return the SiteAuthSettingsProperties object itself. - */ - public SiteAuthSettingsProperties withTwitterConsumerSecret(String twitterConsumerSecret) { - this.twitterConsumerSecret = twitterConsumerSecret; - return this; - } - - /** - * Get the microsoftAccountClientId property: The OAuth 2.0 client ID that was created for the app used for - * authentication. This setting is required for enabling Microsoft Account authentication. Microsoft Account OAuth - * documentation: https://dev.onedrive.com/auth/msa_oauth.htm. - * - * @return the microsoftAccountClientId value. - */ - public String microsoftAccountClientId() { - return this.microsoftAccountClientId; - } - - /** - * Set the microsoftAccountClientId property: The OAuth 2.0 client ID that was created for the app used for - * authentication. This setting is required for enabling Microsoft Account authentication. Microsoft Account OAuth - * documentation: https://dev.onedrive.com/auth/msa_oauth.htm. - * - * @param microsoftAccountClientId the microsoftAccountClientId value to set. - * @return the SiteAuthSettingsProperties object itself. - */ - public SiteAuthSettingsProperties withMicrosoftAccountClientId(String microsoftAccountClientId) { - this.microsoftAccountClientId = microsoftAccountClientId; - return this; - } - - /** - * Get the microsoftAccountClientSecret property: The OAuth 2.0 client secret that was created for the app used for - * authentication. This setting is required for enabling Microsoft Account authentication. Microsoft Account OAuth - * documentation: https://dev.onedrive.com/auth/msa_oauth.htm. - * - * @return the microsoftAccountClientSecret value. - */ - public String microsoftAccountClientSecret() { - return this.microsoftAccountClientSecret; - } - - /** - * Set the microsoftAccountClientSecret property: The OAuth 2.0 client secret that was created for the app used for - * authentication. This setting is required for enabling Microsoft Account authentication. Microsoft Account OAuth - * documentation: https://dev.onedrive.com/auth/msa_oauth.htm. - * - * @param microsoftAccountClientSecret the microsoftAccountClientSecret value to set. - * @return the SiteAuthSettingsProperties object itself. - */ - public SiteAuthSettingsProperties withMicrosoftAccountClientSecret(String microsoftAccountClientSecret) { - this.microsoftAccountClientSecret = microsoftAccountClientSecret; - return this; - } - - /** - * Get the microsoftAccountOAuthScopes property: The OAuth 2.0 scopes that will be requested as part of Microsoft - * Account authentication. This setting is optional. If not specified, "wl.basic" is used as the default scope. - * Microsoft Account Scopes and permissions documentation: https://msdn.microsoft.com/en-us/library/dn631845.aspx. - * - * @return the microsoftAccountOAuthScopes value. - */ - public List microsoftAccountOAuthScopes() { - return this.microsoftAccountOAuthScopes; - } - - /** - * Set the microsoftAccountOAuthScopes property: The OAuth 2.0 scopes that will be requested as part of Microsoft - * Account authentication. This setting is optional. If not specified, "wl.basic" is used as the default scope. - * Microsoft Account Scopes and permissions documentation: https://msdn.microsoft.com/en-us/library/dn631845.aspx. - * - * @param microsoftAccountOAuthScopes the microsoftAccountOAuthScopes value to set. - * @return the SiteAuthSettingsProperties object itself. - */ - public SiteAuthSettingsProperties withMicrosoftAccountOAuthScopes(List microsoftAccountOAuthScopes) { - this.microsoftAccountOAuthScopes = microsoftAccountOAuthScopes; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SiteCloneabilityInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SiteCloneabilityInner.java deleted file mode 100644 index 8a13f9d74b95..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SiteCloneabilityInner.java +++ /dev/null @@ -1,144 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.CloneAbilityResult; -import com.azure.resourcemanager.appservice.models.SiteCloneabilityCriterion; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Represents whether or not an app is cloneable. */ -@Fluent -public final class SiteCloneabilityInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SiteCloneabilityInner.class); - - /* - * Name of app. - */ - @JsonProperty(value = "result") - private CloneAbilityResult result; - - /* - * List of features enabled on app that prevent cloning. - */ - @JsonProperty(value = "blockingFeatures") - private List blockingFeatures; - - /* - * List of features enabled on app that are non-blocking but cannot be - * cloned. The app can still be cloned - * but the features in this list will not be set up on cloned app. - */ - @JsonProperty(value = "unsupportedFeatures") - private List unsupportedFeatures; - - /* - * List of blocking application characteristics. - */ - @JsonProperty(value = "blockingCharacteristics") - private List blockingCharacteristics; - - /** - * Get the result property: Name of app. - * - * @return the result value. - */ - public CloneAbilityResult result() { - return this.result; - } - - /** - * Set the result property: Name of app. - * - * @param result the result value to set. - * @return the SiteCloneabilityInner object itself. - */ - public SiteCloneabilityInner withResult(CloneAbilityResult result) { - this.result = result; - return this; - } - - /** - * Get the blockingFeatures property: List of features enabled on app that prevent cloning. - * - * @return the blockingFeatures value. - */ - public List blockingFeatures() { - return this.blockingFeatures; - } - - /** - * Set the blockingFeatures property: List of features enabled on app that prevent cloning. - * - * @param blockingFeatures the blockingFeatures value to set. - * @return the SiteCloneabilityInner object itself. - */ - public SiteCloneabilityInner withBlockingFeatures(List blockingFeatures) { - this.blockingFeatures = blockingFeatures; - return this; - } - - /** - * Get the unsupportedFeatures property: List of features enabled on app that are non-blocking but cannot be cloned. - * The app can still be cloned but the features in this list will not be set up on cloned app. - * - * @return the unsupportedFeatures value. - */ - public List unsupportedFeatures() { - return this.unsupportedFeatures; - } - - /** - * Set the unsupportedFeatures property: List of features enabled on app that are non-blocking but cannot be cloned. - * The app can still be cloned but the features in this list will not be set up on cloned app. - * - * @param unsupportedFeatures the unsupportedFeatures value to set. - * @return the SiteCloneabilityInner object itself. - */ - public SiteCloneabilityInner withUnsupportedFeatures(List unsupportedFeatures) { - this.unsupportedFeatures = unsupportedFeatures; - return this; - } - - /** - * Get the blockingCharacteristics property: List of blocking application characteristics. - * - * @return the blockingCharacteristics value. - */ - public List blockingCharacteristics() { - return this.blockingCharacteristics; - } - - /** - * Set the blockingCharacteristics property: List of blocking application characteristics. - * - * @param blockingCharacteristics the blockingCharacteristics value to set. - * @return the SiteCloneabilityInner object itself. - */ - public SiteCloneabilityInner withBlockingCharacteristics(List blockingCharacteristics) { - this.blockingCharacteristics = blockingCharacteristics; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (blockingFeatures() != null) { - blockingFeatures().forEach(e -> e.validate()); - } - if (unsupportedFeatures() != null) { - unsupportedFeatures().forEach(e -> e.validate()); - } - if (blockingCharacteristics() != null) { - blockingCharacteristics().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SiteConfigInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SiteConfigInner.java deleted file mode 100644 index fca03fe13bbb..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SiteConfigInner.java +++ /dev/null @@ -1,1493 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.ApiDefinitionInfo; -import com.azure.resourcemanager.appservice.models.AutoHealRules; -import com.azure.resourcemanager.appservice.models.AzureStorageInfoValue; -import com.azure.resourcemanager.appservice.models.ConnStringInfo; -import com.azure.resourcemanager.appservice.models.CorsSettings; -import com.azure.resourcemanager.appservice.models.Experiments; -import com.azure.resourcemanager.appservice.models.FtpsState; -import com.azure.resourcemanager.appservice.models.HandlerMapping; -import com.azure.resourcemanager.appservice.models.IpSecurityRestriction; -import com.azure.resourcemanager.appservice.models.ManagedPipelineMode; -import com.azure.resourcemanager.appservice.models.NameValuePair; -import com.azure.resourcemanager.appservice.models.ScmType; -import com.azure.resourcemanager.appservice.models.SiteLimits; -import com.azure.resourcemanager.appservice.models.SiteLoadBalancing; -import com.azure.resourcemanager.appservice.models.SiteMachineKey; -import com.azure.resourcemanager.appservice.models.SupportedTlsVersions; -import com.azure.resourcemanager.appservice.models.VirtualApplication; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; -import java.util.Map; - -/** Configuration of an App Service app. */ -@Fluent -public final class SiteConfigInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SiteConfigInner.class); - - /* - * Number of workers. - */ - @JsonProperty(value = "numberOfWorkers") - private Integer numberOfWorkers; - - /* - * Default documents. - */ - @JsonProperty(value = "defaultDocuments") - private List defaultDocuments; - - /* - * .NET Framework version. - */ - @JsonProperty(value = "netFrameworkVersion") - private String netFrameworkVersion; - - /* - * Version of PHP. - */ - @JsonProperty(value = "phpVersion") - private String phpVersion; - - /* - * Version of Python. - */ - @JsonProperty(value = "pythonVersion") - private String pythonVersion; - - /* - * Version of Node.js. - */ - @JsonProperty(value = "nodeVersion") - private String nodeVersion; - - /* - * Linux App Framework and version - */ - @JsonProperty(value = "linuxFxVersion") - private String linuxFxVersion; - - /* - * Xenon App Framework and version - */ - @JsonProperty(value = "windowsFxVersion") - private String windowsFxVersion; - - /* - * true if request tracing is enabled; otherwise, - * false. - */ - @JsonProperty(value = "requestTracingEnabled") - private Boolean requestTracingEnabled; - - /* - * Request tracing expiration time. - */ - @JsonProperty(value = "requestTracingExpirationTime") - private OffsetDateTime requestTracingExpirationTime; - - /* - * true if remote debugging is enabled; otherwise, - * false. - */ - @JsonProperty(value = "remoteDebuggingEnabled") - private Boolean remoteDebuggingEnabled; - - /* - * Remote debugging version. - */ - @JsonProperty(value = "remoteDebuggingVersion") - private String remoteDebuggingVersion; - - /* - * true if HTTP logging is enabled; otherwise, - * false. - */ - @JsonProperty(value = "httpLoggingEnabled") - private Boolean httpLoggingEnabled; - - /* - * HTTP logs directory size limit. - */ - @JsonProperty(value = "logsDirectorySizeLimit") - private Integer logsDirectorySizeLimit; - - /* - * true if detailed error logging is enabled; otherwise, - * false. - */ - @JsonProperty(value = "detailedErrorLoggingEnabled") - private Boolean detailedErrorLoggingEnabled; - - /* - * Publishing user name. - */ - @JsonProperty(value = "publishingUsername") - private String publishingUsername; - - /* - * Application settings. - */ - @JsonProperty(value = "appSettings") - private List appSettings; - - /* - * User-provided Azure storage accounts. - */ - @JsonProperty(value = "azureStorageAccounts") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map azureStorageAccounts; - - /* - * Connection strings. - */ - @JsonProperty(value = "connectionStrings") - private List connectionStrings; - - /* - * Site MachineKey. - */ - @JsonProperty(value = "machineKey", access = JsonProperty.Access.WRITE_ONLY) - private SiteMachineKey machineKey; - - /* - * Handler mappings. - */ - @JsonProperty(value = "handlerMappings") - private List handlerMappings; - - /* - * Document root. - */ - @JsonProperty(value = "documentRoot") - private String documentRoot; - - /* - * SCM type. - */ - @JsonProperty(value = "scmType") - private ScmType scmType; - - /* - * true to use 32-bit worker process; otherwise, - * false. - */ - @JsonProperty(value = "use32BitWorkerProcess") - private Boolean use32BitWorkerProcess; - - /* - * true if WebSocket is enabled; otherwise, - * false. - */ - @JsonProperty(value = "webSocketsEnabled") - private Boolean webSocketsEnabled; - - /* - * true if Always On is enabled; otherwise, - * false. - */ - @JsonProperty(value = "alwaysOn") - private Boolean alwaysOn; - - /* - * Java version. - */ - @JsonProperty(value = "javaVersion") - private String javaVersion; - - /* - * Java container. - */ - @JsonProperty(value = "javaContainer") - private String javaContainer; - - /* - * Java container version. - */ - @JsonProperty(value = "javaContainerVersion") - private String javaContainerVersion; - - /* - * App command line to launch. - */ - @JsonProperty(value = "appCommandLine") - private String appCommandLine; - - /* - * Managed pipeline mode. - */ - @JsonProperty(value = "managedPipelineMode") - private ManagedPipelineMode managedPipelineMode; - - /* - * Virtual applications. - */ - @JsonProperty(value = "virtualApplications") - private List virtualApplications; - - /* - * Site load balancing. - */ - @JsonProperty(value = "loadBalancing") - private SiteLoadBalancing loadBalancing; - - /* - * This is work around for polymorphic types. - */ - @JsonProperty(value = "experiments") - private Experiments experiments; - - /* - * Site limits. - */ - @JsonProperty(value = "limits") - private SiteLimits limits; - - /* - * true if Auto Heal is enabled; otherwise, - * false. - */ - @JsonProperty(value = "autoHealEnabled") - private Boolean autoHealEnabled; - - /* - * Auto Heal rules. - */ - @JsonProperty(value = "autoHealRules") - private AutoHealRules autoHealRules; - - /* - * Tracing options. - */ - @JsonProperty(value = "tracingOptions") - private String tracingOptions; - - /* - * Virtual Network name. - */ - @JsonProperty(value = "vnetName") - private String vnetName; - - /* - * Cross-Origin Resource Sharing (CORS) settings. - */ - @JsonProperty(value = "cors") - private CorsSettings cors; - - /* - * Push endpoint settings. - */ - @JsonProperty(value = "push") - private PushSettingsInner push; - - /* - * Information about the formal API definition for the app. - */ - @JsonProperty(value = "apiDefinition") - private ApiDefinitionInfo apiDefinition; - - /* - * Auto-swap slot name. - */ - @JsonProperty(value = "autoSwapSlotName") - private String autoSwapSlotName; - - /* - * true to enable local MySQL; otherwise, false. - */ - @JsonProperty(value = "localMySqlEnabled") - private Boolean localMySqlEnabled; - - /* - * Managed Service Identity Id - */ - @JsonProperty(value = "managedServiceIdentityId") - private Integer managedServiceIdentityId; - - /* - * Explicit Managed Service Identity Id - */ - @JsonProperty(value = "xManagedServiceIdentityId") - private Integer xManagedServiceIdentityId; - - /* - * IP security restrictions for main. - */ - @JsonProperty(value = "ipSecurityRestrictions") - private List ipSecurityRestrictions; - - /* - * IP security restrictions for scm. - */ - @JsonProperty(value = "scmIpSecurityRestrictions") - private List scmIpSecurityRestrictions; - - /* - * IP security restrictions for scm to use main. - */ - @JsonProperty(value = "scmIpSecurityRestrictionsUseMain") - private Boolean scmIpSecurityRestrictionsUseMain; - - /* - * Http20Enabled: configures a web site to allow clients to connect over - * http2.0 - */ - @JsonProperty(value = "http20Enabled") - private Boolean http20Enabled; - - /* - * MinTlsVersion: configures the minimum version of TLS required for SSL - * requests - */ - @JsonProperty(value = "minTlsVersion") - private SupportedTlsVersions minTlsVersion; - - /* - * State of FTP / FTPS service - */ - @JsonProperty(value = "ftpsState") - private FtpsState ftpsState; - - /* - * Number of reserved instances. - * This setting only applies to the Consumption Plan - */ - @JsonProperty(value = "reservedInstanceCount") - private Integer reservedInstanceCount; - - /** - * Get the numberOfWorkers property: Number of workers. - * - * @return the numberOfWorkers value. - */ - public Integer numberOfWorkers() { - return this.numberOfWorkers; - } - - /** - * Set the numberOfWorkers property: Number of workers. - * - * @param numberOfWorkers the numberOfWorkers value to set. - * @return the SiteConfigInner object itself. - */ - public SiteConfigInner withNumberOfWorkers(Integer numberOfWorkers) { - this.numberOfWorkers = numberOfWorkers; - return this; - } - - /** - * Get the defaultDocuments property: Default documents. - * - * @return the defaultDocuments value. - */ - public List defaultDocuments() { - return this.defaultDocuments; - } - - /** - * Set the defaultDocuments property: Default documents. - * - * @param defaultDocuments the defaultDocuments value to set. - * @return the SiteConfigInner object itself. - */ - public SiteConfigInner withDefaultDocuments(List defaultDocuments) { - this.defaultDocuments = defaultDocuments; - return this; - } - - /** - * Get the netFrameworkVersion property: .NET Framework version. - * - * @return the netFrameworkVersion value. - */ - public String netFrameworkVersion() { - return this.netFrameworkVersion; - } - - /** - * Set the netFrameworkVersion property: .NET Framework version. - * - * @param netFrameworkVersion the netFrameworkVersion value to set. - * @return the SiteConfigInner object itself. - */ - public SiteConfigInner withNetFrameworkVersion(String netFrameworkVersion) { - this.netFrameworkVersion = netFrameworkVersion; - return this; - } - - /** - * Get the phpVersion property: Version of PHP. - * - * @return the phpVersion value. - */ - public String phpVersion() { - return this.phpVersion; - } - - /** - * Set the phpVersion property: Version of PHP. - * - * @param phpVersion the phpVersion value to set. - * @return the SiteConfigInner object itself. - */ - public SiteConfigInner withPhpVersion(String phpVersion) { - this.phpVersion = phpVersion; - return this; - } - - /** - * Get the pythonVersion property: Version of Python. - * - * @return the pythonVersion value. - */ - public String pythonVersion() { - return this.pythonVersion; - } - - /** - * Set the pythonVersion property: Version of Python. - * - * @param pythonVersion the pythonVersion value to set. - * @return the SiteConfigInner object itself. - */ - public SiteConfigInner withPythonVersion(String pythonVersion) { - this.pythonVersion = pythonVersion; - return this; - } - - /** - * Get the nodeVersion property: Version of Node.js. - * - * @return the nodeVersion value. - */ - public String nodeVersion() { - return this.nodeVersion; - } - - /** - * Set the nodeVersion property: Version of Node.js. - * - * @param nodeVersion the nodeVersion value to set. - * @return the SiteConfigInner object itself. - */ - public SiteConfigInner withNodeVersion(String nodeVersion) { - this.nodeVersion = nodeVersion; - return this; - } - - /** - * Get the linuxFxVersion property: Linux App Framework and version. - * - * @return the linuxFxVersion value. - */ - public String linuxFxVersion() { - return this.linuxFxVersion; - } - - /** - * Set the linuxFxVersion property: Linux App Framework and version. - * - * @param linuxFxVersion the linuxFxVersion value to set. - * @return the SiteConfigInner object itself. - */ - public SiteConfigInner withLinuxFxVersion(String linuxFxVersion) { - this.linuxFxVersion = linuxFxVersion; - return this; - } - - /** - * Get the windowsFxVersion property: Xenon App Framework and version. - * - * @return the windowsFxVersion value. - */ - public String windowsFxVersion() { - return this.windowsFxVersion; - } - - /** - * Set the windowsFxVersion property: Xenon App Framework and version. - * - * @param windowsFxVersion the windowsFxVersion value to set. - * @return the SiteConfigInner object itself. - */ - public SiteConfigInner withWindowsFxVersion(String windowsFxVersion) { - this.windowsFxVersion = windowsFxVersion; - return this; - } - - /** - * Get the requestTracingEnabled property: <code>true</code> if request tracing is enabled; otherwise, - * <code>false</code>. - * - * @return the requestTracingEnabled value. - */ - public Boolean requestTracingEnabled() { - return this.requestTracingEnabled; - } - - /** - * Set the requestTracingEnabled property: <code>true</code> if request tracing is enabled; otherwise, - * <code>false</code>. - * - * @param requestTracingEnabled the requestTracingEnabled value to set. - * @return the SiteConfigInner object itself. - */ - public SiteConfigInner withRequestTracingEnabled(Boolean requestTracingEnabled) { - this.requestTracingEnabled = requestTracingEnabled; - return this; - } - - /** - * Get the requestTracingExpirationTime property: Request tracing expiration time. - * - * @return the requestTracingExpirationTime value. - */ - public OffsetDateTime requestTracingExpirationTime() { - return this.requestTracingExpirationTime; - } - - /** - * Set the requestTracingExpirationTime property: Request tracing expiration time. - * - * @param requestTracingExpirationTime the requestTracingExpirationTime value to set. - * @return the SiteConfigInner object itself. - */ - public SiteConfigInner withRequestTracingExpirationTime(OffsetDateTime requestTracingExpirationTime) { - this.requestTracingExpirationTime = requestTracingExpirationTime; - return this; - } - - /** - * Get the remoteDebuggingEnabled property: <code>true</code> if remote debugging is enabled; otherwise, - * <code>false</code>. - * - * @return the remoteDebuggingEnabled value. - */ - public Boolean remoteDebuggingEnabled() { - return this.remoteDebuggingEnabled; - } - - /** - * Set the remoteDebuggingEnabled property: <code>true</code> if remote debugging is enabled; otherwise, - * <code>false</code>. - * - * @param remoteDebuggingEnabled the remoteDebuggingEnabled value to set. - * @return the SiteConfigInner object itself. - */ - public SiteConfigInner withRemoteDebuggingEnabled(Boolean remoteDebuggingEnabled) { - this.remoteDebuggingEnabled = remoteDebuggingEnabled; - return this; - } - - /** - * Get the remoteDebuggingVersion property: Remote debugging version. - * - * @return the remoteDebuggingVersion value. - */ - public String remoteDebuggingVersion() { - return this.remoteDebuggingVersion; - } - - /** - * Set the remoteDebuggingVersion property: Remote debugging version. - * - * @param remoteDebuggingVersion the remoteDebuggingVersion value to set. - * @return the SiteConfigInner object itself. - */ - public SiteConfigInner withRemoteDebuggingVersion(String remoteDebuggingVersion) { - this.remoteDebuggingVersion = remoteDebuggingVersion; - return this; - } - - /** - * Get the httpLoggingEnabled property: <code>true</code> if HTTP logging is enabled; otherwise, - * <code>false</code>. - * - * @return the httpLoggingEnabled value. - */ - public Boolean httpLoggingEnabled() { - return this.httpLoggingEnabled; - } - - /** - * Set the httpLoggingEnabled property: <code>true</code> if HTTP logging is enabled; otherwise, - * <code>false</code>. - * - * @param httpLoggingEnabled the httpLoggingEnabled value to set. - * @return the SiteConfigInner object itself. - */ - public SiteConfigInner withHttpLoggingEnabled(Boolean httpLoggingEnabled) { - this.httpLoggingEnabled = httpLoggingEnabled; - return this; - } - - /** - * Get the logsDirectorySizeLimit property: HTTP logs directory size limit. - * - * @return the logsDirectorySizeLimit value. - */ - public Integer logsDirectorySizeLimit() { - return this.logsDirectorySizeLimit; - } - - /** - * Set the logsDirectorySizeLimit property: HTTP logs directory size limit. - * - * @param logsDirectorySizeLimit the logsDirectorySizeLimit value to set. - * @return the SiteConfigInner object itself. - */ - public SiteConfigInner withLogsDirectorySizeLimit(Integer logsDirectorySizeLimit) { - this.logsDirectorySizeLimit = logsDirectorySizeLimit; - return this; - } - - /** - * Get the detailedErrorLoggingEnabled property: <code>true</code> if detailed error logging is enabled; - * otherwise, <code>false</code>. - * - * @return the detailedErrorLoggingEnabled value. - */ - public Boolean detailedErrorLoggingEnabled() { - return this.detailedErrorLoggingEnabled; - } - - /** - * Set the detailedErrorLoggingEnabled property: <code>true</code> if detailed error logging is enabled; - * otherwise, <code>false</code>. - * - * @param detailedErrorLoggingEnabled the detailedErrorLoggingEnabled value to set. - * @return the SiteConfigInner object itself. - */ - public SiteConfigInner withDetailedErrorLoggingEnabled(Boolean detailedErrorLoggingEnabled) { - this.detailedErrorLoggingEnabled = detailedErrorLoggingEnabled; - return this; - } - - /** - * Get the publishingUsername property: Publishing user name. - * - * @return the publishingUsername value. - */ - public String publishingUsername() { - return this.publishingUsername; - } - - /** - * Set the publishingUsername property: Publishing user name. - * - * @param publishingUsername the publishingUsername value to set. - * @return the SiteConfigInner object itself. - */ - public SiteConfigInner withPublishingUsername(String publishingUsername) { - this.publishingUsername = publishingUsername; - return this; - } - - /** - * Get the appSettings property: Application settings. - * - * @return the appSettings value. - */ - public List appSettings() { - return this.appSettings; - } - - /** - * Set the appSettings property: Application settings. - * - * @param appSettings the appSettings value to set. - * @return the SiteConfigInner object itself. - */ - public SiteConfigInner withAppSettings(List appSettings) { - this.appSettings = appSettings; - return this; - } - - /** - * Get the azureStorageAccounts property: User-provided Azure storage accounts. - * - * @return the azureStorageAccounts value. - */ - public Map azureStorageAccounts() { - return this.azureStorageAccounts; - } - - /** - * Set the azureStorageAccounts property: User-provided Azure storage accounts. - * - * @param azureStorageAccounts the azureStorageAccounts value to set. - * @return the SiteConfigInner object itself. - */ - public SiteConfigInner withAzureStorageAccounts(Map azureStorageAccounts) { - this.azureStorageAccounts = azureStorageAccounts; - return this; - } - - /** - * Get the connectionStrings property: Connection strings. - * - * @return the connectionStrings value. - */ - public List connectionStrings() { - return this.connectionStrings; - } - - /** - * Set the connectionStrings property: Connection strings. - * - * @param connectionStrings the connectionStrings value to set. - * @return the SiteConfigInner object itself. - */ - public SiteConfigInner withConnectionStrings(List connectionStrings) { - this.connectionStrings = connectionStrings; - return this; - } - - /** - * Get the machineKey property: Site MachineKey. - * - * @return the machineKey value. - */ - public SiteMachineKey machineKey() { - return this.machineKey; - } - - /** - * Get the handlerMappings property: Handler mappings. - * - * @return the handlerMappings value. - */ - public List handlerMappings() { - return this.handlerMappings; - } - - /** - * Set the handlerMappings property: Handler mappings. - * - * @param handlerMappings the handlerMappings value to set. - * @return the SiteConfigInner object itself. - */ - public SiteConfigInner withHandlerMappings(List handlerMappings) { - this.handlerMappings = handlerMappings; - return this; - } - - /** - * Get the documentRoot property: Document root. - * - * @return the documentRoot value. - */ - public String documentRoot() { - return this.documentRoot; - } - - /** - * Set the documentRoot property: Document root. - * - * @param documentRoot the documentRoot value to set. - * @return the SiteConfigInner object itself. - */ - public SiteConfigInner withDocumentRoot(String documentRoot) { - this.documentRoot = documentRoot; - return this; - } - - /** - * Get the scmType property: SCM type. - * - * @return the scmType value. - */ - public ScmType scmType() { - return this.scmType; - } - - /** - * Set the scmType property: SCM type. - * - * @param scmType the scmType value to set. - * @return the SiteConfigInner object itself. - */ - public SiteConfigInner withScmType(ScmType scmType) { - this.scmType = scmType; - return this; - } - - /** - * Get the use32BitWorkerProcess property: <code>true</code> to use 32-bit worker process; otherwise, - * <code>false</code>. - * - * @return the use32BitWorkerProcess value. - */ - public Boolean use32BitWorkerProcess() { - return this.use32BitWorkerProcess; - } - - /** - * Set the use32BitWorkerProcess property: <code>true</code> to use 32-bit worker process; otherwise, - * <code>false</code>. - * - * @param use32BitWorkerProcess the use32BitWorkerProcess value to set. - * @return the SiteConfigInner object itself. - */ - public SiteConfigInner withUse32BitWorkerProcess(Boolean use32BitWorkerProcess) { - this.use32BitWorkerProcess = use32BitWorkerProcess; - return this; - } - - /** - * Get the webSocketsEnabled property: <code>true</code> if WebSocket is enabled; otherwise, - * <code>false</code>. - * - * @return the webSocketsEnabled value. - */ - public Boolean webSocketsEnabled() { - return this.webSocketsEnabled; - } - - /** - * Set the webSocketsEnabled property: <code>true</code> if WebSocket is enabled; otherwise, - * <code>false</code>. - * - * @param webSocketsEnabled the webSocketsEnabled value to set. - * @return the SiteConfigInner object itself. - */ - public SiteConfigInner withWebSocketsEnabled(Boolean webSocketsEnabled) { - this.webSocketsEnabled = webSocketsEnabled; - return this; - } - - /** - * Get the alwaysOn property: <code>true</code> if Always On is enabled; otherwise, - * <code>false</code>. - * - * @return the alwaysOn value. - */ - public Boolean alwaysOn() { - return this.alwaysOn; - } - - /** - * Set the alwaysOn property: <code>true</code> if Always On is enabled; otherwise, - * <code>false</code>. - * - * @param alwaysOn the alwaysOn value to set. - * @return the SiteConfigInner object itself. - */ - public SiteConfigInner withAlwaysOn(Boolean alwaysOn) { - this.alwaysOn = alwaysOn; - return this; - } - - /** - * Get the javaVersion property: Java version. - * - * @return the javaVersion value. - */ - public String javaVersion() { - return this.javaVersion; - } - - /** - * Set the javaVersion property: Java version. - * - * @param javaVersion the javaVersion value to set. - * @return the SiteConfigInner object itself. - */ - public SiteConfigInner withJavaVersion(String javaVersion) { - this.javaVersion = javaVersion; - return this; - } - - /** - * Get the javaContainer property: Java container. - * - * @return the javaContainer value. - */ - public String javaContainer() { - return this.javaContainer; - } - - /** - * Set the javaContainer property: Java container. - * - * @param javaContainer the javaContainer value to set. - * @return the SiteConfigInner object itself. - */ - public SiteConfigInner withJavaContainer(String javaContainer) { - this.javaContainer = javaContainer; - return this; - } - - /** - * Get the javaContainerVersion property: Java container version. - * - * @return the javaContainerVersion value. - */ - public String javaContainerVersion() { - return this.javaContainerVersion; - } - - /** - * Set the javaContainerVersion property: Java container version. - * - * @param javaContainerVersion the javaContainerVersion value to set. - * @return the SiteConfigInner object itself. - */ - public SiteConfigInner withJavaContainerVersion(String javaContainerVersion) { - this.javaContainerVersion = javaContainerVersion; - return this; - } - - /** - * Get the appCommandLine property: App command line to launch. - * - * @return the appCommandLine value. - */ - public String appCommandLine() { - return this.appCommandLine; - } - - /** - * Set the appCommandLine property: App command line to launch. - * - * @param appCommandLine the appCommandLine value to set. - * @return the SiteConfigInner object itself. - */ - public SiteConfigInner withAppCommandLine(String appCommandLine) { - this.appCommandLine = appCommandLine; - return this; - } - - /** - * Get the managedPipelineMode property: Managed pipeline mode. - * - * @return the managedPipelineMode value. - */ - public ManagedPipelineMode managedPipelineMode() { - return this.managedPipelineMode; - } - - /** - * Set the managedPipelineMode property: Managed pipeline mode. - * - * @param managedPipelineMode the managedPipelineMode value to set. - * @return the SiteConfigInner object itself. - */ - public SiteConfigInner withManagedPipelineMode(ManagedPipelineMode managedPipelineMode) { - this.managedPipelineMode = managedPipelineMode; - return this; - } - - /** - * Get the virtualApplications property: Virtual applications. - * - * @return the virtualApplications value. - */ - public List virtualApplications() { - return this.virtualApplications; - } - - /** - * Set the virtualApplications property: Virtual applications. - * - * @param virtualApplications the virtualApplications value to set. - * @return the SiteConfigInner object itself. - */ - public SiteConfigInner withVirtualApplications(List virtualApplications) { - this.virtualApplications = virtualApplications; - return this; - } - - /** - * Get the loadBalancing property: Site load balancing. - * - * @return the loadBalancing value. - */ - public SiteLoadBalancing loadBalancing() { - return this.loadBalancing; - } - - /** - * Set the loadBalancing property: Site load balancing. - * - * @param loadBalancing the loadBalancing value to set. - * @return the SiteConfigInner object itself. - */ - public SiteConfigInner withLoadBalancing(SiteLoadBalancing loadBalancing) { - this.loadBalancing = loadBalancing; - return this; - } - - /** - * Get the experiments property: This is work around for polymorphic types. - * - * @return the experiments value. - */ - public Experiments experiments() { - return this.experiments; - } - - /** - * Set the experiments property: This is work around for polymorphic types. - * - * @param experiments the experiments value to set. - * @return the SiteConfigInner object itself. - */ - public SiteConfigInner withExperiments(Experiments experiments) { - this.experiments = experiments; - return this; - } - - /** - * Get the limits property: Site limits. - * - * @return the limits value. - */ - public SiteLimits limits() { - return this.limits; - } - - /** - * Set the limits property: Site limits. - * - * @param limits the limits value to set. - * @return the SiteConfigInner object itself. - */ - public SiteConfigInner withLimits(SiteLimits limits) { - this.limits = limits; - return this; - } - - /** - * Get the autoHealEnabled property: <code>true</code> if Auto Heal is enabled; otherwise, - * <code>false</code>. - * - * @return the autoHealEnabled value. - */ - public Boolean autoHealEnabled() { - return this.autoHealEnabled; - } - - /** - * Set the autoHealEnabled property: <code>true</code> if Auto Heal is enabled; otherwise, - * <code>false</code>. - * - * @param autoHealEnabled the autoHealEnabled value to set. - * @return the SiteConfigInner object itself. - */ - public SiteConfigInner withAutoHealEnabled(Boolean autoHealEnabled) { - this.autoHealEnabled = autoHealEnabled; - return this; - } - - /** - * Get the autoHealRules property: Auto Heal rules. - * - * @return the autoHealRules value. - */ - public AutoHealRules autoHealRules() { - return this.autoHealRules; - } - - /** - * Set the autoHealRules property: Auto Heal rules. - * - * @param autoHealRules the autoHealRules value to set. - * @return the SiteConfigInner object itself. - */ - public SiteConfigInner withAutoHealRules(AutoHealRules autoHealRules) { - this.autoHealRules = autoHealRules; - return this; - } - - /** - * Get the tracingOptions property: Tracing options. - * - * @return the tracingOptions value. - */ - public String tracingOptions() { - return this.tracingOptions; - } - - /** - * Set the tracingOptions property: Tracing options. - * - * @param tracingOptions the tracingOptions value to set. - * @return the SiteConfigInner object itself. - */ - public SiteConfigInner withTracingOptions(String tracingOptions) { - this.tracingOptions = tracingOptions; - return this; - } - - /** - * Get the vnetName property: Virtual Network name. - * - * @return the vnetName value. - */ - public String vnetName() { - return this.vnetName; - } - - /** - * Set the vnetName property: Virtual Network name. - * - * @param vnetName the vnetName value to set. - * @return the SiteConfigInner object itself. - */ - public SiteConfigInner withVnetName(String vnetName) { - this.vnetName = vnetName; - return this; - } - - /** - * Get the cors property: Cross-Origin Resource Sharing (CORS) settings. - * - * @return the cors value. - */ - public CorsSettings cors() { - return this.cors; - } - - /** - * Set the cors property: Cross-Origin Resource Sharing (CORS) settings. - * - * @param cors the cors value to set. - * @return the SiteConfigInner object itself. - */ - public SiteConfigInner withCors(CorsSettings cors) { - this.cors = cors; - return this; - } - - /** - * Get the push property: Push endpoint settings. - * - * @return the push value. - */ - public PushSettingsInner push() { - return this.push; - } - - /** - * Set the push property: Push endpoint settings. - * - * @param push the push value to set. - * @return the SiteConfigInner object itself. - */ - public SiteConfigInner withPush(PushSettingsInner push) { - this.push = push; - return this; - } - - /** - * Get the apiDefinition property: Information about the formal API definition for the app. - * - * @return the apiDefinition value. - */ - public ApiDefinitionInfo apiDefinition() { - return this.apiDefinition; - } - - /** - * Set the apiDefinition property: Information about the formal API definition for the app. - * - * @param apiDefinition the apiDefinition value to set. - * @return the SiteConfigInner object itself. - */ - public SiteConfigInner withApiDefinition(ApiDefinitionInfo apiDefinition) { - this.apiDefinition = apiDefinition; - return this; - } - - /** - * Get the autoSwapSlotName property: Auto-swap slot name. - * - * @return the autoSwapSlotName value. - */ - public String autoSwapSlotName() { - return this.autoSwapSlotName; - } - - /** - * Set the autoSwapSlotName property: Auto-swap slot name. - * - * @param autoSwapSlotName the autoSwapSlotName value to set. - * @return the SiteConfigInner object itself. - */ - public SiteConfigInner withAutoSwapSlotName(String autoSwapSlotName) { - this.autoSwapSlotName = autoSwapSlotName; - return this; - } - - /** - * Get the localMySqlEnabled property: <code>true</code> to enable local MySQL; otherwise, - * <code>false</code>. - * - * @return the localMySqlEnabled value. - */ - public Boolean localMySqlEnabled() { - return this.localMySqlEnabled; - } - - /** - * Set the localMySqlEnabled property: <code>true</code> to enable local MySQL; otherwise, - * <code>false</code>. - * - * @param localMySqlEnabled the localMySqlEnabled value to set. - * @return the SiteConfigInner object itself. - */ - public SiteConfigInner withLocalMySqlEnabled(Boolean localMySqlEnabled) { - this.localMySqlEnabled = localMySqlEnabled; - return this; - } - - /** - * Get the managedServiceIdentityId property: Managed Service Identity Id. - * - * @return the managedServiceIdentityId value. - */ - public Integer managedServiceIdentityId() { - return this.managedServiceIdentityId; - } - - /** - * Set the managedServiceIdentityId property: Managed Service Identity Id. - * - * @param managedServiceIdentityId the managedServiceIdentityId value to set. - * @return the SiteConfigInner object itself. - */ - public SiteConfigInner withManagedServiceIdentityId(Integer managedServiceIdentityId) { - this.managedServiceIdentityId = managedServiceIdentityId; - return this; - } - - /** - * Get the xManagedServiceIdentityId property: Explicit Managed Service Identity Id. - * - * @return the xManagedServiceIdentityId value. - */ - public Integer xManagedServiceIdentityId() { - return this.xManagedServiceIdentityId; - } - - /** - * Set the xManagedServiceIdentityId property: Explicit Managed Service Identity Id. - * - * @param xManagedServiceIdentityId the xManagedServiceIdentityId value to set. - * @return the SiteConfigInner object itself. - */ - public SiteConfigInner withXManagedServiceIdentityId(Integer xManagedServiceIdentityId) { - this.xManagedServiceIdentityId = xManagedServiceIdentityId; - return this; - } - - /** - * Get the ipSecurityRestrictions property: IP security restrictions for main. - * - * @return the ipSecurityRestrictions value. - */ - public List ipSecurityRestrictions() { - return this.ipSecurityRestrictions; - } - - /** - * Set the ipSecurityRestrictions property: IP security restrictions for main. - * - * @param ipSecurityRestrictions the ipSecurityRestrictions value to set. - * @return the SiteConfigInner object itself. - */ - public SiteConfigInner withIpSecurityRestrictions(List ipSecurityRestrictions) { - this.ipSecurityRestrictions = ipSecurityRestrictions; - return this; - } - - /** - * Get the scmIpSecurityRestrictions property: IP security restrictions for scm. - * - * @return the scmIpSecurityRestrictions value. - */ - public List scmIpSecurityRestrictions() { - return this.scmIpSecurityRestrictions; - } - - /** - * Set the scmIpSecurityRestrictions property: IP security restrictions for scm. - * - * @param scmIpSecurityRestrictions the scmIpSecurityRestrictions value to set. - * @return the SiteConfigInner object itself. - */ - public SiteConfigInner withScmIpSecurityRestrictions(List scmIpSecurityRestrictions) { - this.scmIpSecurityRestrictions = scmIpSecurityRestrictions; - return this; - } - - /** - * Get the scmIpSecurityRestrictionsUseMain property: IP security restrictions for scm to use main. - * - * @return the scmIpSecurityRestrictionsUseMain value. - */ - public Boolean scmIpSecurityRestrictionsUseMain() { - return this.scmIpSecurityRestrictionsUseMain; - } - - /** - * Set the scmIpSecurityRestrictionsUseMain property: IP security restrictions for scm to use main. - * - * @param scmIpSecurityRestrictionsUseMain the scmIpSecurityRestrictionsUseMain value to set. - * @return the SiteConfigInner object itself. - */ - public SiteConfigInner withScmIpSecurityRestrictionsUseMain(Boolean scmIpSecurityRestrictionsUseMain) { - this.scmIpSecurityRestrictionsUseMain = scmIpSecurityRestrictionsUseMain; - return this; - } - - /** - * Get the http20Enabled property: Http20Enabled: configures a web site to allow clients to connect over http2.0. - * - * @return the http20Enabled value. - */ - public Boolean http20Enabled() { - return this.http20Enabled; - } - - /** - * Set the http20Enabled property: Http20Enabled: configures a web site to allow clients to connect over http2.0. - * - * @param http20Enabled the http20Enabled value to set. - * @return the SiteConfigInner object itself. - */ - public SiteConfigInner withHttp20Enabled(Boolean http20Enabled) { - this.http20Enabled = http20Enabled; - return this; - } - - /** - * Get the minTlsVersion property: MinTlsVersion: configures the minimum version of TLS required for SSL requests. - * - * @return the minTlsVersion value. - */ - public SupportedTlsVersions minTlsVersion() { - return this.minTlsVersion; - } - - /** - * Set the minTlsVersion property: MinTlsVersion: configures the minimum version of TLS required for SSL requests. - * - * @param minTlsVersion the minTlsVersion value to set. - * @return the SiteConfigInner object itself. - */ - public SiteConfigInner withMinTlsVersion(SupportedTlsVersions minTlsVersion) { - this.minTlsVersion = minTlsVersion; - return this; - } - - /** - * Get the ftpsState property: State of FTP / FTPS service. - * - * @return the ftpsState value. - */ - public FtpsState ftpsState() { - return this.ftpsState; - } - - /** - * Set the ftpsState property: State of FTP / FTPS service. - * - * @param ftpsState the ftpsState value to set. - * @return the SiteConfigInner object itself. - */ - public SiteConfigInner withFtpsState(FtpsState ftpsState) { - this.ftpsState = ftpsState; - return this; - } - - /** - * Get the reservedInstanceCount property: Number of reserved instances. This setting only applies to the - * Consumption Plan. - * - * @return the reservedInstanceCount value. - */ - public Integer reservedInstanceCount() { - return this.reservedInstanceCount; - } - - /** - * Set the reservedInstanceCount property: Number of reserved instances. This setting only applies to the - * Consumption Plan. - * - * @param reservedInstanceCount the reservedInstanceCount value to set. - * @return the SiteConfigInner object itself. - */ - public SiteConfigInner withReservedInstanceCount(Integer reservedInstanceCount) { - this.reservedInstanceCount = reservedInstanceCount; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (appSettings() != null) { - appSettings().forEach(e -> e.validate()); - } - if (azureStorageAccounts() != null) { - azureStorageAccounts() - .values() - .forEach( - e -> { - if (e != null) { - e.validate(); - } - }); - } - if (connectionStrings() != null) { - connectionStrings().forEach(e -> e.validate()); - } - if (machineKey() != null) { - machineKey().validate(); - } - if (handlerMappings() != null) { - handlerMappings().forEach(e -> e.validate()); - } - if (virtualApplications() != null) { - virtualApplications().forEach(e -> e.validate()); - } - if (experiments() != null) { - experiments().validate(); - } - if (limits() != null) { - limits().validate(); - } - if (autoHealRules() != null) { - autoHealRules().validate(); - } - if (cors() != null) { - cors().validate(); - } - if (push() != null) { - push().validate(); - } - if (apiDefinition() != null) { - apiDefinition().validate(); - } - if (ipSecurityRestrictions() != null) { - ipSecurityRestrictions().forEach(e -> e.validate()); - } - if (scmIpSecurityRestrictions() != null) { - scmIpSecurityRestrictions().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SiteConfigResourceInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SiteConfigResourceInner.java deleted file mode 100644 index 6566b0957dd5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SiteConfigResourceInner.java +++ /dev/null @@ -1,1298 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.ApiDefinitionInfo; -import com.azure.resourcemanager.appservice.models.AutoHealRules; -import com.azure.resourcemanager.appservice.models.AzureStorageInfoValue; -import com.azure.resourcemanager.appservice.models.ConnStringInfo; -import com.azure.resourcemanager.appservice.models.CorsSettings; -import com.azure.resourcemanager.appservice.models.Experiments; -import com.azure.resourcemanager.appservice.models.FtpsState; -import com.azure.resourcemanager.appservice.models.HandlerMapping; -import com.azure.resourcemanager.appservice.models.IpSecurityRestriction; -import com.azure.resourcemanager.appservice.models.ManagedPipelineMode; -import com.azure.resourcemanager.appservice.models.NameValuePair; -import com.azure.resourcemanager.appservice.models.ProxyOnlyResource; -import com.azure.resourcemanager.appservice.models.ScmType; -import com.azure.resourcemanager.appservice.models.SiteLimits; -import com.azure.resourcemanager.appservice.models.SiteLoadBalancing; -import com.azure.resourcemanager.appservice.models.SiteMachineKey; -import com.azure.resourcemanager.appservice.models.SupportedTlsVersions; -import com.azure.resourcemanager.appservice.models.VirtualApplication; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; -import java.util.Map; - -/** Web app configuration ARM resource. */ -@Fluent -public final class SiteConfigResourceInner extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SiteConfigResourceInner.class); - - /* - * Core resource properties - */ - @JsonProperty(value = "properties") - private SiteConfigInner innerProperties; - - /** - * Get the innerProperties property: Core resource properties. - * - * @return the innerProperties value. - */ - private SiteConfigInner innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public SiteConfigResourceInner withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the numberOfWorkers property: Number of workers. - * - * @return the numberOfWorkers value. - */ - public Integer numberOfWorkers() { - return this.innerProperties() == null ? null : this.innerProperties().numberOfWorkers(); - } - - /** - * Set the numberOfWorkers property: Number of workers. - * - * @param numberOfWorkers the numberOfWorkers value to set. - * @return the SiteConfigResourceInner object itself. - */ - public SiteConfigResourceInner withNumberOfWorkers(Integer numberOfWorkers) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteConfigInner(); - } - this.innerProperties().withNumberOfWorkers(numberOfWorkers); - return this; - } - - /** - * Get the defaultDocuments property: Default documents. - * - * @return the defaultDocuments value. - */ - public List defaultDocuments() { - return this.innerProperties() == null ? null : this.innerProperties().defaultDocuments(); - } - - /** - * Set the defaultDocuments property: Default documents. - * - * @param defaultDocuments the defaultDocuments value to set. - * @return the SiteConfigResourceInner object itself. - */ - public SiteConfigResourceInner withDefaultDocuments(List defaultDocuments) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteConfigInner(); - } - this.innerProperties().withDefaultDocuments(defaultDocuments); - return this; - } - - /** - * Get the netFrameworkVersion property: .NET Framework version. - * - * @return the netFrameworkVersion value. - */ - public String netFrameworkVersion() { - return this.innerProperties() == null ? null : this.innerProperties().netFrameworkVersion(); - } - - /** - * Set the netFrameworkVersion property: .NET Framework version. - * - * @param netFrameworkVersion the netFrameworkVersion value to set. - * @return the SiteConfigResourceInner object itself. - */ - public SiteConfigResourceInner withNetFrameworkVersion(String netFrameworkVersion) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteConfigInner(); - } - this.innerProperties().withNetFrameworkVersion(netFrameworkVersion); - return this; - } - - /** - * Get the phpVersion property: Version of PHP. - * - * @return the phpVersion value. - */ - public String phpVersion() { - return this.innerProperties() == null ? null : this.innerProperties().phpVersion(); - } - - /** - * Set the phpVersion property: Version of PHP. - * - * @param phpVersion the phpVersion value to set. - * @return the SiteConfigResourceInner object itself. - */ - public SiteConfigResourceInner withPhpVersion(String phpVersion) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteConfigInner(); - } - this.innerProperties().withPhpVersion(phpVersion); - return this; - } - - /** - * Get the pythonVersion property: Version of Python. - * - * @return the pythonVersion value. - */ - public String pythonVersion() { - return this.innerProperties() == null ? null : this.innerProperties().pythonVersion(); - } - - /** - * Set the pythonVersion property: Version of Python. - * - * @param pythonVersion the pythonVersion value to set. - * @return the SiteConfigResourceInner object itself. - */ - public SiteConfigResourceInner withPythonVersion(String pythonVersion) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteConfigInner(); - } - this.innerProperties().withPythonVersion(pythonVersion); - return this; - } - - /** - * Get the nodeVersion property: Version of Node.js. - * - * @return the nodeVersion value. - */ - public String nodeVersion() { - return this.innerProperties() == null ? null : this.innerProperties().nodeVersion(); - } - - /** - * Set the nodeVersion property: Version of Node.js. - * - * @param nodeVersion the nodeVersion value to set. - * @return the SiteConfigResourceInner object itself. - */ - public SiteConfigResourceInner withNodeVersion(String nodeVersion) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteConfigInner(); - } - this.innerProperties().withNodeVersion(nodeVersion); - return this; - } - - /** - * Get the linuxFxVersion property: Linux App Framework and version. - * - * @return the linuxFxVersion value. - */ - public String linuxFxVersion() { - return this.innerProperties() == null ? null : this.innerProperties().linuxFxVersion(); - } - - /** - * Set the linuxFxVersion property: Linux App Framework and version. - * - * @param linuxFxVersion the linuxFxVersion value to set. - * @return the SiteConfigResourceInner object itself. - */ - public SiteConfigResourceInner withLinuxFxVersion(String linuxFxVersion) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteConfigInner(); - } - this.innerProperties().withLinuxFxVersion(linuxFxVersion); - return this; - } - - /** - * Get the windowsFxVersion property: Xenon App Framework and version. - * - * @return the windowsFxVersion value. - */ - public String windowsFxVersion() { - return this.innerProperties() == null ? null : this.innerProperties().windowsFxVersion(); - } - - /** - * Set the windowsFxVersion property: Xenon App Framework and version. - * - * @param windowsFxVersion the windowsFxVersion value to set. - * @return the SiteConfigResourceInner object itself. - */ - public SiteConfigResourceInner withWindowsFxVersion(String windowsFxVersion) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteConfigInner(); - } - this.innerProperties().withWindowsFxVersion(windowsFxVersion); - return this; - } - - /** - * Get the requestTracingEnabled property: <code>true</code> if request tracing is enabled; otherwise, - * <code>false</code>. - * - * @return the requestTracingEnabled value. - */ - public Boolean requestTracingEnabled() { - return this.innerProperties() == null ? null : this.innerProperties().requestTracingEnabled(); - } - - /** - * Set the requestTracingEnabled property: <code>true</code> if request tracing is enabled; otherwise, - * <code>false</code>. - * - * @param requestTracingEnabled the requestTracingEnabled value to set. - * @return the SiteConfigResourceInner object itself. - */ - public SiteConfigResourceInner withRequestTracingEnabled(Boolean requestTracingEnabled) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteConfigInner(); - } - this.innerProperties().withRequestTracingEnabled(requestTracingEnabled); - return this; - } - - /** - * Get the requestTracingExpirationTime property: Request tracing expiration time. - * - * @return the requestTracingExpirationTime value. - */ - public OffsetDateTime requestTracingExpirationTime() { - return this.innerProperties() == null ? null : this.innerProperties().requestTracingExpirationTime(); - } - - /** - * Set the requestTracingExpirationTime property: Request tracing expiration time. - * - * @param requestTracingExpirationTime the requestTracingExpirationTime value to set. - * @return the SiteConfigResourceInner object itself. - */ - public SiteConfigResourceInner withRequestTracingExpirationTime(OffsetDateTime requestTracingExpirationTime) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteConfigInner(); - } - this.innerProperties().withRequestTracingExpirationTime(requestTracingExpirationTime); - return this; - } - - /** - * Get the remoteDebuggingEnabled property: <code>true</code> if remote debugging is enabled; otherwise, - * <code>false</code>. - * - * @return the remoteDebuggingEnabled value. - */ - public Boolean remoteDebuggingEnabled() { - return this.innerProperties() == null ? null : this.innerProperties().remoteDebuggingEnabled(); - } - - /** - * Set the remoteDebuggingEnabled property: <code>true</code> if remote debugging is enabled; otherwise, - * <code>false</code>. - * - * @param remoteDebuggingEnabled the remoteDebuggingEnabled value to set. - * @return the SiteConfigResourceInner object itself. - */ - public SiteConfigResourceInner withRemoteDebuggingEnabled(Boolean remoteDebuggingEnabled) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteConfigInner(); - } - this.innerProperties().withRemoteDebuggingEnabled(remoteDebuggingEnabled); - return this; - } - - /** - * Get the remoteDebuggingVersion property: Remote debugging version. - * - * @return the remoteDebuggingVersion value. - */ - public String remoteDebuggingVersion() { - return this.innerProperties() == null ? null : this.innerProperties().remoteDebuggingVersion(); - } - - /** - * Set the remoteDebuggingVersion property: Remote debugging version. - * - * @param remoteDebuggingVersion the remoteDebuggingVersion value to set. - * @return the SiteConfigResourceInner object itself. - */ - public SiteConfigResourceInner withRemoteDebuggingVersion(String remoteDebuggingVersion) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteConfigInner(); - } - this.innerProperties().withRemoteDebuggingVersion(remoteDebuggingVersion); - return this; - } - - /** - * Get the httpLoggingEnabled property: <code>true</code> if HTTP logging is enabled; otherwise, - * <code>false</code>. - * - * @return the httpLoggingEnabled value. - */ - public Boolean httpLoggingEnabled() { - return this.innerProperties() == null ? null : this.innerProperties().httpLoggingEnabled(); - } - - /** - * Set the httpLoggingEnabled property: <code>true</code> if HTTP logging is enabled; otherwise, - * <code>false</code>. - * - * @param httpLoggingEnabled the httpLoggingEnabled value to set. - * @return the SiteConfigResourceInner object itself. - */ - public SiteConfigResourceInner withHttpLoggingEnabled(Boolean httpLoggingEnabled) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteConfigInner(); - } - this.innerProperties().withHttpLoggingEnabled(httpLoggingEnabled); - return this; - } - - /** - * Get the logsDirectorySizeLimit property: HTTP logs directory size limit. - * - * @return the logsDirectorySizeLimit value. - */ - public Integer logsDirectorySizeLimit() { - return this.innerProperties() == null ? null : this.innerProperties().logsDirectorySizeLimit(); - } - - /** - * Set the logsDirectorySizeLimit property: HTTP logs directory size limit. - * - * @param logsDirectorySizeLimit the logsDirectorySizeLimit value to set. - * @return the SiteConfigResourceInner object itself. - */ - public SiteConfigResourceInner withLogsDirectorySizeLimit(Integer logsDirectorySizeLimit) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteConfigInner(); - } - this.innerProperties().withLogsDirectorySizeLimit(logsDirectorySizeLimit); - return this; - } - - /** - * Get the detailedErrorLoggingEnabled property: <code>true</code> if detailed error logging is enabled; - * otherwise, <code>false</code>. - * - * @return the detailedErrorLoggingEnabled value. - */ - public Boolean detailedErrorLoggingEnabled() { - return this.innerProperties() == null ? null : this.innerProperties().detailedErrorLoggingEnabled(); - } - - /** - * Set the detailedErrorLoggingEnabled property: <code>true</code> if detailed error logging is enabled; - * otherwise, <code>false</code>. - * - * @param detailedErrorLoggingEnabled the detailedErrorLoggingEnabled value to set. - * @return the SiteConfigResourceInner object itself. - */ - public SiteConfigResourceInner withDetailedErrorLoggingEnabled(Boolean detailedErrorLoggingEnabled) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteConfigInner(); - } - this.innerProperties().withDetailedErrorLoggingEnabled(detailedErrorLoggingEnabled); - return this; - } - - /** - * Get the publishingUsername property: Publishing user name. - * - * @return the publishingUsername value. - */ - public String publishingUsername() { - return this.innerProperties() == null ? null : this.innerProperties().publishingUsername(); - } - - /** - * Set the publishingUsername property: Publishing user name. - * - * @param publishingUsername the publishingUsername value to set. - * @return the SiteConfigResourceInner object itself. - */ - public SiteConfigResourceInner withPublishingUsername(String publishingUsername) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteConfigInner(); - } - this.innerProperties().withPublishingUsername(publishingUsername); - return this; - } - - /** - * Get the appSettings property: Application settings. - * - * @return the appSettings value. - */ - public List appSettings() { - return this.innerProperties() == null ? null : this.innerProperties().appSettings(); - } - - /** - * Set the appSettings property: Application settings. - * - * @param appSettings the appSettings value to set. - * @return the SiteConfigResourceInner object itself. - */ - public SiteConfigResourceInner withAppSettings(List appSettings) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteConfigInner(); - } - this.innerProperties().withAppSettings(appSettings); - return this; - } - - /** - * Get the azureStorageAccounts property: User-provided Azure storage accounts. - * - * @return the azureStorageAccounts value. - */ - public Map azureStorageAccounts() { - return this.innerProperties() == null ? null : this.innerProperties().azureStorageAccounts(); - } - - /** - * Set the azureStorageAccounts property: User-provided Azure storage accounts. - * - * @param azureStorageAccounts the azureStorageAccounts value to set. - * @return the SiteConfigResourceInner object itself. - */ - public SiteConfigResourceInner withAzureStorageAccounts(Map azureStorageAccounts) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteConfigInner(); - } - this.innerProperties().withAzureStorageAccounts(azureStorageAccounts); - return this; - } - - /** - * Get the connectionStrings property: Connection strings. - * - * @return the connectionStrings value. - */ - public List connectionStrings() { - return this.innerProperties() == null ? null : this.innerProperties().connectionStrings(); - } - - /** - * Set the connectionStrings property: Connection strings. - * - * @param connectionStrings the connectionStrings value to set. - * @return the SiteConfigResourceInner object itself. - */ - public SiteConfigResourceInner withConnectionStrings(List connectionStrings) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteConfigInner(); - } - this.innerProperties().withConnectionStrings(connectionStrings); - return this; - } - - /** - * Get the machineKey property: Site MachineKey. - * - * @return the machineKey value. - */ - public SiteMachineKey machineKey() { - return this.innerProperties() == null ? null : this.innerProperties().machineKey(); - } - - /** - * Get the handlerMappings property: Handler mappings. - * - * @return the handlerMappings value. - */ - public List handlerMappings() { - return this.innerProperties() == null ? null : this.innerProperties().handlerMappings(); - } - - /** - * Set the handlerMappings property: Handler mappings. - * - * @param handlerMappings the handlerMappings value to set. - * @return the SiteConfigResourceInner object itself. - */ - public SiteConfigResourceInner withHandlerMappings(List handlerMappings) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteConfigInner(); - } - this.innerProperties().withHandlerMappings(handlerMappings); - return this; - } - - /** - * Get the documentRoot property: Document root. - * - * @return the documentRoot value. - */ - public String documentRoot() { - return this.innerProperties() == null ? null : this.innerProperties().documentRoot(); - } - - /** - * Set the documentRoot property: Document root. - * - * @param documentRoot the documentRoot value to set. - * @return the SiteConfigResourceInner object itself. - */ - public SiteConfigResourceInner withDocumentRoot(String documentRoot) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteConfigInner(); - } - this.innerProperties().withDocumentRoot(documentRoot); - return this; - } - - /** - * Get the scmType property: SCM type. - * - * @return the scmType value. - */ - public ScmType scmType() { - return this.innerProperties() == null ? null : this.innerProperties().scmType(); - } - - /** - * Set the scmType property: SCM type. - * - * @param scmType the scmType value to set. - * @return the SiteConfigResourceInner object itself. - */ - public SiteConfigResourceInner withScmType(ScmType scmType) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteConfigInner(); - } - this.innerProperties().withScmType(scmType); - return this; - } - - /** - * Get the use32BitWorkerProcess property: <code>true</code> to use 32-bit worker process; otherwise, - * <code>false</code>. - * - * @return the use32BitWorkerProcess value. - */ - public Boolean use32BitWorkerProcess() { - return this.innerProperties() == null ? null : this.innerProperties().use32BitWorkerProcess(); - } - - /** - * Set the use32BitWorkerProcess property: <code>true</code> to use 32-bit worker process; otherwise, - * <code>false</code>. - * - * @param use32BitWorkerProcess the use32BitWorkerProcess value to set. - * @return the SiteConfigResourceInner object itself. - */ - public SiteConfigResourceInner withUse32BitWorkerProcess(Boolean use32BitWorkerProcess) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteConfigInner(); - } - this.innerProperties().withUse32BitWorkerProcess(use32BitWorkerProcess); - return this; - } - - /** - * Get the webSocketsEnabled property: <code>true</code> if WebSocket is enabled; otherwise, - * <code>false</code>. - * - * @return the webSocketsEnabled value. - */ - public Boolean webSocketsEnabled() { - return this.innerProperties() == null ? null : this.innerProperties().webSocketsEnabled(); - } - - /** - * Set the webSocketsEnabled property: <code>true</code> if WebSocket is enabled; otherwise, - * <code>false</code>. - * - * @param webSocketsEnabled the webSocketsEnabled value to set. - * @return the SiteConfigResourceInner object itself. - */ - public SiteConfigResourceInner withWebSocketsEnabled(Boolean webSocketsEnabled) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteConfigInner(); - } - this.innerProperties().withWebSocketsEnabled(webSocketsEnabled); - return this; - } - - /** - * Get the alwaysOn property: <code>true</code> if Always On is enabled; otherwise, - * <code>false</code>. - * - * @return the alwaysOn value. - */ - public Boolean alwaysOn() { - return this.innerProperties() == null ? null : this.innerProperties().alwaysOn(); - } - - /** - * Set the alwaysOn property: <code>true</code> if Always On is enabled; otherwise, - * <code>false</code>. - * - * @param alwaysOn the alwaysOn value to set. - * @return the SiteConfigResourceInner object itself. - */ - public SiteConfigResourceInner withAlwaysOn(Boolean alwaysOn) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteConfigInner(); - } - this.innerProperties().withAlwaysOn(alwaysOn); - return this; - } - - /** - * Get the javaVersion property: Java version. - * - * @return the javaVersion value. - */ - public String javaVersion() { - return this.innerProperties() == null ? null : this.innerProperties().javaVersion(); - } - - /** - * Set the javaVersion property: Java version. - * - * @param javaVersion the javaVersion value to set. - * @return the SiteConfigResourceInner object itself. - */ - public SiteConfigResourceInner withJavaVersion(String javaVersion) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteConfigInner(); - } - this.innerProperties().withJavaVersion(javaVersion); - return this; - } - - /** - * Get the javaContainer property: Java container. - * - * @return the javaContainer value. - */ - public String javaContainer() { - return this.innerProperties() == null ? null : this.innerProperties().javaContainer(); - } - - /** - * Set the javaContainer property: Java container. - * - * @param javaContainer the javaContainer value to set. - * @return the SiteConfigResourceInner object itself. - */ - public SiteConfigResourceInner withJavaContainer(String javaContainer) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteConfigInner(); - } - this.innerProperties().withJavaContainer(javaContainer); - return this; - } - - /** - * Get the javaContainerVersion property: Java container version. - * - * @return the javaContainerVersion value. - */ - public String javaContainerVersion() { - return this.innerProperties() == null ? null : this.innerProperties().javaContainerVersion(); - } - - /** - * Set the javaContainerVersion property: Java container version. - * - * @param javaContainerVersion the javaContainerVersion value to set. - * @return the SiteConfigResourceInner object itself. - */ - public SiteConfigResourceInner withJavaContainerVersion(String javaContainerVersion) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteConfigInner(); - } - this.innerProperties().withJavaContainerVersion(javaContainerVersion); - return this; - } - - /** - * Get the appCommandLine property: App command line to launch. - * - * @return the appCommandLine value. - */ - public String appCommandLine() { - return this.innerProperties() == null ? null : this.innerProperties().appCommandLine(); - } - - /** - * Set the appCommandLine property: App command line to launch. - * - * @param appCommandLine the appCommandLine value to set. - * @return the SiteConfigResourceInner object itself. - */ - public SiteConfigResourceInner withAppCommandLine(String appCommandLine) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteConfigInner(); - } - this.innerProperties().withAppCommandLine(appCommandLine); - return this; - } - - /** - * Get the managedPipelineMode property: Managed pipeline mode. - * - * @return the managedPipelineMode value. - */ - public ManagedPipelineMode managedPipelineMode() { - return this.innerProperties() == null ? null : this.innerProperties().managedPipelineMode(); - } - - /** - * Set the managedPipelineMode property: Managed pipeline mode. - * - * @param managedPipelineMode the managedPipelineMode value to set. - * @return the SiteConfigResourceInner object itself. - */ - public SiteConfigResourceInner withManagedPipelineMode(ManagedPipelineMode managedPipelineMode) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteConfigInner(); - } - this.innerProperties().withManagedPipelineMode(managedPipelineMode); - return this; - } - - /** - * Get the virtualApplications property: Virtual applications. - * - * @return the virtualApplications value. - */ - public List virtualApplications() { - return this.innerProperties() == null ? null : this.innerProperties().virtualApplications(); - } - - /** - * Set the virtualApplications property: Virtual applications. - * - * @param virtualApplications the virtualApplications value to set. - * @return the SiteConfigResourceInner object itself. - */ - public SiteConfigResourceInner withVirtualApplications(List virtualApplications) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteConfigInner(); - } - this.innerProperties().withVirtualApplications(virtualApplications); - return this; - } - - /** - * Get the loadBalancing property: Site load balancing. - * - * @return the loadBalancing value. - */ - public SiteLoadBalancing loadBalancing() { - return this.innerProperties() == null ? null : this.innerProperties().loadBalancing(); - } - - /** - * Set the loadBalancing property: Site load balancing. - * - * @param loadBalancing the loadBalancing value to set. - * @return the SiteConfigResourceInner object itself. - */ - public SiteConfigResourceInner withLoadBalancing(SiteLoadBalancing loadBalancing) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteConfigInner(); - } - this.innerProperties().withLoadBalancing(loadBalancing); - return this; - } - - /** - * Get the experiments property: This is work around for polymorphic types. - * - * @return the experiments value. - */ - public Experiments experiments() { - return this.innerProperties() == null ? null : this.innerProperties().experiments(); - } - - /** - * Set the experiments property: This is work around for polymorphic types. - * - * @param experiments the experiments value to set. - * @return the SiteConfigResourceInner object itself. - */ - public SiteConfigResourceInner withExperiments(Experiments experiments) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteConfigInner(); - } - this.innerProperties().withExperiments(experiments); - return this; - } - - /** - * Get the limits property: Site limits. - * - * @return the limits value. - */ - public SiteLimits limits() { - return this.innerProperties() == null ? null : this.innerProperties().limits(); - } - - /** - * Set the limits property: Site limits. - * - * @param limits the limits value to set. - * @return the SiteConfigResourceInner object itself. - */ - public SiteConfigResourceInner withLimits(SiteLimits limits) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteConfigInner(); - } - this.innerProperties().withLimits(limits); - return this; - } - - /** - * Get the autoHealEnabled property: <code>true</code> if Auto Heal is enabled; otherwise, - * <code>false</code>. - * - * @return the autoHealEnabled value. - */ - public Boolean autoHealEnabled() { - return this.innerProperties() == null ? null : this.innerProperties().autoHealEnabled(); - } - - /** - * Set the autoHealEnabled property: <code>true</code> if Auto Heal is enabled; otherwise, - * <code>false</code>. - * - * @param autoHealEnabled the autoHealEnabled value to set. - * @return the SiteConfigResourceInner object itself. - */ - public SiteConfigResourceInner withAutoHealEnabled(Boolean autoHealEnabled) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteConfigInner(); - } - this.innerProperties().withAutoHealEnabled(autoHealEnabled); - return this; - } - - /** - * Get the autoHealRules property: Auto Heal rules. - * - * @return the autoHealRules value. - */ - public AutoHealRules autoHealRules() { - return this.innerProperties() == null ? null : this.innerProperties().autoHealRules(); - } - - /** - * Set the autoHealRules property: Auto Heal rules. - * - * @param autoHealRules the autoHealRules value to set. - * @return the SiteConfigResourceInner object itself. - */ - public SiteConfigResourceInner withAutoHealRules(AutoHealRules autoHealRules) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteConfigInner(); - } - this.innerProperties().withAutoHealRules(autoHealRules); - return this; - } - - /** - * Get the tracingOptions property: Tracing options. - * - * @return the tracingOptions value. - */ - public String tracingOptions() { - return this.innerProperties() == null ? null : this.innerProperties().tracingOptions(); - } - - /** - * Set the tracingOptions property: Tracing options. - * - * @param tracingOptions the tracingOptions value to set. - * @return the SiteConfigResourceInner object itself. - */ - public SiteConfigResourceInner withTracingOptions(String tracingOptions) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteConfigInner(); - } - this.innerProperties().withTracingOptions(tracingOptions); - return this; - } - - /** - * Get the vnetName property: Virtual Network name. - * - * @return the vnetName value. - */ - public String vnetName() { - return this.innerProperties() == null ? null : this.innerProperties().vnetName(); - } - - /** - * Set the vnetName property: Virtual Network name. - * - * @param vnetName the vnetName value to set. - * @return the SiteConfigResourceInner object itself. - */ - public SiteConfigResourceInner withVnetName(String vnetName) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteConfigInner(); - } - this.innerProperties().withVnetName(vnetName); - return this; - } - - /** - * Get the cors property: Cross-Origin Resource Sharing (CORS) settings. - * - * @return the cors value. - */ - public CorsSettings cors() { - return this.innerProperties() == null ? null : this.innerProperties().cors(); - } - - /** - * Set the cors property: Cross-Origin Resource Sharing (CORS) settings. - * - * @param cors the cors value to set. - * @return the SiteConfigResourceInner object itself. - */ - public SiteConfigResourceInner withCors(CorsSettings cors) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteConfigInner(); - } - this.innerProperties().withCors(cors); - return this; - } - - /** - * Get the push property: Push endpoint settings. - * - * @return the push value. - */ - public PushSettingsInner push() { - return this.innerProperties() == null ? null : this.innerProperties().push(); - } - - /** - * Set the push property: Push endpoint settings. - * - * @param push the push value to set. - * @return the SiteConfigResourceInner object itself. - */ - public SiteConfigResourceInner withPush(PushSettingsInner push) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteConfigInner(); - } - this.innerProperties().withPush(push); - return this; - } - - /** - * Get the apiDefinition property: Information about the formal API definition for the app. - * - * @return the apiDefinition value. - */ - public ApiDefinitionInfo apiDefinition() { - return this.innerProperties() == null ? null : this.innerProperties().apiDefinition(); - } - - /** - * Set the apiDefinition property: Information about the formal API definition for the app. - * - * @param apiDefinition the apiDefinition value to set. - * @return the SiteConfigResourceInner object itself. - */ - public SiteConfigResourceInner withApiDefinition(ApiDefinitionInfo apiDefinition) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteConfigInner(); - } - this.innerProperties().withApiDefinition(apiDefinition); - return this; - } - - /** - * Get the autoSwapSlotName property: Auto-swap slot name. - * - * @return the autoSwapSlotName value. - */ - public String autoSwapSlotName() { - return this.innerProperties() == null ? null : this.innerProperties().autoSwapSlotName(); - } - - /** - * Set the autoSwapSlotName property: Auto-swap slot name. - * - * @param autoSwapSlotName the autoSwapSlotName value to set. - * @return the SiteConfigResourceInner object itself. - */ - public SiteConfigResourceInner withAutoSwapSlotName(String autoSwapSlotName) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteConfigInner(); - } - this.innerProperties().withAutoSwapSlotName(autoSwapSlotName); - return this; - } - - /** - * Get the localMySqlEnabled property: <code>true</code> to enable local MySQL; otherwise, - * <code>false</code>. - * - * @return the localMySqlEnabled value. - */ - public Boolean localMySqlEnabled() { - return this.innerProperties() == null ? null : this.innerProperties().localMySqlEnabled(); - } - - /** - * Set the localMySqlEnabled property: <code>true</code> to enable local MySQL; otherwise, - * <code>false</code>. - * - * @param localMySqlEnabled the localMySqlEnabled value to set. - * @return the SiteConfigResourceInner object itself. - */ - public SiteConfigResourceInner withLocalMySqlEnabled(Boolean localMySqlEnabled) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteConfigInner(); - } - this.innerProperties().withLocalMySqlEnabled(localMySqlEnabled); - return this; - } - - /** - * Get the managedServiceIdentityId property: Managed Service Identity Id. - * - * @return the managedServiceIdentityId value. - */ - public Integer managedServiceIdentityId() { - return this.innerProperties() == null ? null : this.innerProperties().managedServiceIdentityId(); - } - - /** - * Set the managedServiceIdentityId property: Managed Service Identity Id. - * - * @param managedServiceIdentityId the managedServiceIdentityId value to set. - * @return the SiteConfigResourceInner object itself. - */ - public SiteConfigResourceInner withManagedServiceIdentityId(Integer managedServiceIdentityId) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteConfigInner(); - } - this.innerProperties().withManagedServiceIdentityId(managedServiceIdentityId); - return this; - } - - /** - * Get the xManagedServiceIdentityId property: Explicit Managed Service Identity Id. - * - * @return the xManagedServiceIdentityId value. - */ - public Integer xManagedServiceIdentityId() { - return this.innerProperties() == null ? null : this.innerProperties().xManagedServiceIdentityId(); - } - - /** - * Set the xManagedServiceIdentityId property: Explicit Managed Service Identity Id. - * - * @param xManagedServiceIdentityId the xManagedServiceIdentityId value to set. - * @return the SiteConfigResourceInner object itself. - */ - public SiteConfigResourceInner withXManagedServiceIdentityId(Integer xManagedServiceIdentityId) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteConfigInner(); - } - this.innerProperties().withXManagedServiceIdentityId(xManagedServiceIdentityId); - return this; - } - - /** - * Get the ipSecurityRestrictions property: IP security restrictions for main. - * - * @return the ipSecurityRestrictions value. - */ - public List ipSecurityRestrictions() { - return this.innerProperties() == null ? null : this.innerProperties().ipSecurityRestrictions(); - } - - /** - * Set the ipSecurityRestrictions property: IP security restrictions for main. - * - * @param ipSecurityRestrictions the ipSecurityRestrictions value to set. - * @return the SiteConfigResourceInner object itself. - */ - public SiteConfigResourceInner withIpSecurityRestrictions(List ipSecurityRestrictions) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteConfigInner(); - } - this.innerProperties().withIpSecurityRestrictions(ipSecurityRestrictions); - return this; - } - - /** - * Get the scmIpSecurityRestrictions property: IP security restrictions for scm. - * - * @return the scmIpSecurityRestrictions value. - */ - public List scmIpSecurityRestrictions() { - return this.innerProperties() == null ? null : this.innerProperties().scmIpSecurityRestrictions(); - } - - /** - * Set the scmIpSecurityRestrictions property: IP security restrictions for scm. - * - * @param scmIpSecurityRestrictions the scmIpSecurityRestrictions value to set. - * @return the SiteConfigResourceInner object itself. - */ - public SiteConfigResourceInner withScmIpSecurityRestrictions( - List scmIpSecurityRestrictions) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteConfigInner(); - } - this.innerProperties().withScmIpSecurityRestrictions(scmIpSecurityRestrictions); - return this; - } - - /** - * Get the scmIpSecurityRestrictionsUseMain property: IP security restrictions for scm to use main. - * - * @return the scmIpSecurityRestrictionsUseMain value. - */ - public Boolean scmIpSecurityRestrictionsUseMain() { - return this.innerProperties() == null ? null : this.innerProperties().scmIpSecurityRestrictionsUseMain(); - } - - /** - * Set the scmIpSecurityRestrictionsUseMain property: IP security restrictions for scm to use main. - * - * @param scmIpSecurityRestrictionsUseMain the scmIpSecurityRestrictionsUseMain value to set. - * @return the SiteConfigResourceInner object itself. - */ - public SiteConfigResourceInner withScmIpSecurityRestrictionsUseMain(Boolean scmIpSecurityRestrictionsUseMain) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteConfigInner(); - } - this.innerProperties().withScmIpSecurityRestrictionsUseMain(scmIpSecurityRestrictionsUseMain); - return this; - } - - /** - * Get the http20Enabled property: Http20Enabled: configures a web site to allow clients to connect over http2.0. - * - * @return the http20Enabled value. - */ - public Boolean http20Enabled() { - return this.innerProperties() == null ? null : this.innerProperties().http20Enabled(); - } - - /** - * Set the http20Enabled property: Http20Enabled: configures a web site to allow clients to connect over http2.0. - * - * @param http20Enabled the http20Enabled value to set. - * @return the SiteConfigResourceInner object itself. - */ - public SiteConfigResourceInner withHttp20Enabled(Boolean http20Enabled) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteConfigInner(); - } - this.innerProperties().withHttp20Enabled(http20Enabled); - return this; - } - - /** - * Get the minTlsVersion property: MinTlsVersion: configures the minimum version of TLS required for SSL requests. - * - * @return the minTlsVersion value. - */ - public SupportedTlsVersions minTlsVersion() { - return this.innerProperties() == null ? null : this.innerProperties().minTlsVersion(); - } - - /** - * Set the minTlsVersion property: MinTlsVersion: configures the minimum version of TLS required for SSL requests. - * - * @param minTlsVersion the minTlsVersion value to set. - * @return the SiteConfigResourceInner object itself. - */ - public SiteConfigResourceInner withMinTlsVersion(SupportedTlsVersions minTlsVersion) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteConfigInner(); - } - this.innerProperties().withMinTlsVersion(minTlsVersion); - return this; - } - - /** - * Get the ftpsState property: State of FTP / FTPS service. - * - * @return the ftpsState value. - */ - public FtpsState ftpsState() { - return this.innerProperties() == null ? null : this.innerProperties().ftpsState(); - } - - /** - * Set the ftpsState property: State of FTP / FTPS service. - * - * @param ftpsState the ftpsState value to set. - * @return the SiteConfigResourceInner object itself. - */ - public SiteConfigResourceInner withFtpsState(FtpsState ftpsState) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteConfigInner(); - } - this.innerProperties().withFtpsState(ftpsState); - return this; - } - - /** - * Get the reservedInstanceCount property: Number of reserved instances. This setting only applies to the - * Consumption Plan. - * - * @return the reservedInstanceCount value. - */ - public Integer reservedInstanceCount() { - return this.innerProperties() == null ? null : this.innerProperties().reservedInstanceCount(); - } - - /** - * Set the reservedInstanceCount property: Number of reserved instances. This setting only applies to the - * Consumption Plan. - * - * @param reservedInstanceCount the reservedInstanceCount value to set. - * @return the SiteConfigResourceInner object itself. - */ - public SiteConfigResourceInner withReservedInstanceCount(Integer reservedInstanceCount) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteConfigInner(); - } - this.innerProperties().withReservedInstanceCount(reservedInstanceCount); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SiteConfigurationSnapshotInfoInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SiteConfigurationSnapshotInfoInner.java deleted file mode 100644 index 18a54ec0eaeb..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SiteConfigurationSnapshotInfoInner.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.ProxyOnlyResource; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** A snapshot of a web app configuration. */ -@Fluent -public final class SiteConfigurationSnapshotInfoInner extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SiteConfigurationSnapshotInfoInner.class); - - /* - * SiteConfigurationSnapshotInfo resource specific properties - */ - @JsonProperty(value = "properties") - private SiteConfigurationSnapshotInfoProperties innerProperties; - - /** - * Get the innerProperties property: SiteConfigurationSnapshotInfo resource specific properties. - * - * @return the innerProperties value. - */ - private SiteConfigurationSnapshotInfoProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public SiteConfigurationSnapshotInfoInner withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the time property: The time the snapshot was taken. - * - * @return the time value. - */ - public OffsetDateTime time() { - return this.innerProperties() == null ? null : this.innerProperties().time(); - } - - /** - * Get the snapshotId property: The id of the snapshot. - * - * @return the snapshotId value. - */ - public Integer snapshotId() { - return this.innerProperties() == null ? null : this.innerProperties().snapshotId(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SiteConfigurationSnapshotInfoProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SiteConfigurationSnapshotInfoProperties.java deleted file mode 100644 index d2dfa39974d7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SiteConfigurationSnapshotInfoProperties.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** SiteConfigurationSnapshotInfo resource specific properties. */ -@Immutable -public final class SiteConfigurationSnapshotInfoProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SiteConfigurationSnapshotInfoProperties.class); - - /* - * The time the snapshot was taken. - */ - @JsonProperty(value = "time", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime time; - - /* - * The id of the snapshot - */ - @JsonProperty(value = "snapshotId", access = JsonProperty.Access.WRITE_ONLY) - private Integer snapshotId; - - /** - * Get the time property: The time the snapshot was taken. - * - * @return the time value. - */ - public OffsetDateTime time() { - return this.time; - } - - /** - * Get the snapshotId property: The id of the snapshot. - * - * @return the snapshotId value. - */ - public Integer snapshotId() { - return this.snapshotId; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SiteExtensionInfoInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SiteExtensionInfoInner.java deleted file mode 100644 index 712c2b318d1f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SiteExtensionInfoInner.java +++ /dev/null @@ -1,517 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.ProxyOnlyResource; -import com.azure.resourcemanager.appservice.models.SiteExtensionType; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; - -/** Site Extension Information. */ -@Fluent -public final class SiteExtensionInfoInner extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SiteExtensionInfoInner.class); - - /* - * SiteExtensionInfo resource specific properties - */ - @JsonProperty(value = "properties") - private SiteExtensionInfoProperties innerProperties; - - /** - * Get the innerProperties property: SiteExtensionInfo resource specific properties. - * - * @return the innerProperties value. - */ - private SiteExtensionInfoProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public SiteExtensionInfoInner withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the extensionId property: Site extension ID. - * - * @return the extensionId value. - */ - public String extensionId() { - return this.innerProperties() == null ? null : this.innerProperties().extensionId(); - } - - /** - * Set the extensionId property: Site extension ID. - * - * @param extensionId the extensionId value to set. - * @return the SiteExtensionInfoInner object itself. - */ - public SiteExtensionInfoInner withExtensionId(String extensionId) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteExtensionInfoProperties(); - } - this.innerProperties().withExtensionId(extensionId); - return this; - } - - /** - * Get the title property: The title property. - * - * @return the title value. - */ - public String title() { - return this.innerProperties() == null ? null : this.innerProperties().title(); - } - - /** - * Set the title property: The title property. - * - * @param title the title value to set. - * @return the SiteExtensionInfoInner object itself. - */ - public SiteExtensionInfoInner withTitle(String title) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteExtensionInfoProperties(); - } - this.innerProperties().withTitle(title); - return this; - } - - /** - * Get the extensionType property: Site extension type. - * - * @return the extensionType value. - */ - public SiteExtensionType extensionType() { - return this.innerProperties() == null ? null : this.innerProperties().extensionType(); - } - - /** - * Set the extensionType property: Site extension type. - * - * @param extensionType the extensionType value to set. - * @return the SiteExtensionInfoInner object itself. - */ - public SiteExtensionInfoInner withExtensionType(SiteExtensionType extensionType) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteExtensionInfoProperties(); - } - this.innerProperties().withExtensionType(extensionType); - return this; - } - - /** - * Get the summary property: Summary description. - * - * @return the summary value. - */ - public String summary() { - return this.innerProperties() == null ? null : this.innerProperties().summary(); - } - - /** - * Set the summary property: Summary description. - * - * @param summary the summary value to set. - * @return the SiteExtensionInfoInner object itself. - */ - public SiteExtensionInfoInner withSummary(String summary) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteExtensionInfoProperties(); - } - this.innerProperties().withSummary(summary); - return this; - } - - /** - * Get the description property: Detailed description. - * - * @return the description value. - */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); - } - - /** - * Set the description property: Detailed description. - * - * @param description the description value to set. - * @return the SiteExtensionInfoInner object itself. - */ - public SiteExtensionInfoInner withDescription(String description) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteExtensionInfoProperties(); - } - this.innerProperties().withDescription(description); - return this; - } - - /** - * Get the version property: Version information. - * - * @return the version value. - */ - public String version() { - return this.innerProperties() == null ? null : this.innerProperties().version(); - } - - /** - * Set the version property: Version information. - * - * @param version the version value to set. - * @return the SiteExtensionInfoInner object itself. - */ - public SiteExtensionInfoInner withVersion(String version) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteExtensionInfoProperties(); - } - this.innerProperties().withVersion(version); - return this; - } - - /** - * Get the extensionUrl property: Extension URL. - * - * @return the extensionUrl value. - */ - public String extensionUrl() { - return this.innerProperties() == null ? null : this.innerProperties().extensionUrl(); - } - - /** - * Set the extensionUrl property: Extension URL. - * - * @param extensionUrl the extensionUrl value to set. - * @return the SiteExtensionInfoInner object itself. - */ - public SiteExtensionInfoInner withExtensionUrl(String extensionUrl) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteExtensionInfoProperties(); - } - this.innerProperties().withExtensionUrl(extensionUrl); - return this; - } - - /** - * Get the projectUrl property: Project URL. - * - * @return the projectUrl value. - */ - public String projectUrl() { - return this.innerProperties() == null ? null : this.innerProperties().projectUrl(); - } - - /** - * Set the projectUrl property: Project URL. - * - * @param projectUrl the projectUrl value to set. - * @return the SiteExtensionInfoInner object itself. - */ - public SiteExtensionInfoInner withProjectUrl(String projectUrl) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteExtensionInfoProperties(); - } - this.innerProperties().withProjectUrl(projectUrl); - return this; - } - - /** - * Get the iconUrl property: Icon URL. - * - * @return the iconUrl value. - */ - public String iconUrl() { - return this.innerProperties() == null ? null : this.innerProperties().iconUrl(); - } - - /** - * Set the iconUrl property: Icon URL. - * - * @param iconUrl the iconUrl value to set. - * @return the SiteExtensionInfoInner object itself. - */ - public SiteExtensionInfoInner withIconUrl(String iconUrl) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteExtensionInfoProperties(); - } - this.innerProperties().withIconUrl(iconUrl); - return this; - } - - /** - * Get the licenseUrl property: License URL. - * - * @return the licenseUrl value. - */ - public String licenseUrl() { - return this.innerProperties() == null ? null : this.innerProperties().licenseUrl(); - } - - /** - * Set the licenseUrl property: License URL. - * - * @param licenseUrl the licenseUrl value to set. - * @return the SiteExtensionInfoInner object itself. - */ - public SiteExtensionInfoInner withLicenseUrl(String licenseUrl) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteExtensionInfoProperties(); - } - this.innerProperties().withLicenseUrl(licenseUrl); - return this; - } - - /** - * Get the feedUrl property: Feed URL. - * - * @return the feedUrl value. - */ - public String feedUrl() { - return this.innerProperties() == null ? null : this.innerProperties().feedUrl(); - } - - /** - * Set the feedUrl property: Feed URL. - * - * @param feedUrl the feedUrl value to set. - * @return the SiteExtensionInfoInner object itself. - */ - public SiteExtensionInfoInner withFeedUrl(String feedUrl) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteExtensionInfoProperties(); - } - this.innerProperties().withFeedUrl(feedUrl); - return this; - } - - /** - * Get the authors property: List of authors. - * - * @return the authors value. - */ - public List authors() { - return this.innerProperties() == null ? null : this.innerProperties().authors(); - } - - /** - * Set the authors property: List of authors. - * - * @param authors the authors value to set. - * @return the SiteExtensionInfoInner object itself. - */ - public SiteExtensionInfoInner withAuthors(List authors) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteExtensionInfoProperties(); - } - this.innerProperties().withAuthors(authors); - return this; - } - - /** - * Get the installerCommandLineParams property: Installer command line parameters. - * - * @return the installerCommandLineParams value. - */ - public String installerCommandLineParams() { - return this.innerProperties() == null ? null : this.innerProperties().installerCommandLineParams(); - } - - /** - * Set the installerCommandLineParams property: Installer command line parameters. - * - * @param installerCommandLineParams the installerCommandLineParams value to set. - * @return the SiteExtensionInfoInner object itself. - */ - public SiteExtensionInfoInner withInstallerCommandLineParams(String installerCommandLineParams) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteExtensionInfoProperties(); - } - this.innerProperties().withInstallerCommandLineParams(installerCommandLineParams); - return this; - } - - /** - * Get the publishedDateTime property: Published timestamp. - * - * @return the publishedDateTime value. - */ - public OffsetDateTime publishedDateTime() { - return this.innerProperties() == null ? null : this.innerProperties().publishedDateTime(); - } - - /** - * Set the publishedDateTime property: Published timestamp. - * - * @param publishedDateTime the publishedDateTime value to set. - * @return the SiteExtensionInfoInner object itself. - */ - public SiteExtensionInfoInner withPublishedDateTime(OffsetDateTime publishedDateTime) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteExtensionInfoProperties(); - } - this.innerProperties().withPublishedDateTime(publishedDateTime); - return this; - } - - /** - * Get the downloadCount property: Count of downloads. - * - * @return the downloadCount value. - */ - public Integer downloadCount() { - return this.innerProperties() == null ? null : this.innerProperties().downloadCount(); - } - - /** - * Set the downloadCount property: Count of downloads. - * - * @param downloadCount the downloadCount value to set. - * @return the SiteExtensionInfoInner object itself. - */ - public SiteExtensionInfoInner withDownloadCount(Integer downloadCount) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteExtensionInfoProperties(); - } - this.innerProperties().withDownloadCount(downloadCount); - return this; - } - - /** - * Get the localIsLatestVersion property: <code>true</code> if the local version is the latest version; - * <code>false</code> otherwise. - * - * @return the localIsLatestVersion value. - */ - public Boolean localIsLatestVersion() { - return this.innerProperties() == null ? null : this.innerProperties().localIsLatestVersion(); - } - - /** - * Set the localIsLatestVersion property: <code>true</code> if the local version is the latest version; - * <code>false</code> otherwise. - * - * @param localIsLatestVersion the localIsLatestVersion value to set. - * @return the SiteExtensionInfoInner object itself. - */ - public SiteExtensionInfoInner withLocalIsLatestVersion(Boolean localIsLatestVersion) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteExtensionInfoProperties(); - } - this.innerProperties().withLocalIsLatestVersion(localIsLatestVersion); - return this; - } - - /** - * Get the localPath property: Local path. - * - * @return the localPath value. - */ - public String localPath() { - return this.innerProperties() == null ? null : this.innerProperties().localPath(); - } - - /** - * Set the localPath property: Local path. - * - * @param localPath the localPath value to set. - * @return the SiteExtensionInfoInner object itself. - */ - public SiteExtensionInfoInner withLocalPath(String localPath) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteExtensionInfoProperties(); - } - this.innerProperties().withLocalPath(localPath); - return this; - } - - /** - * Get the installedDateTime property: Installed timestamp. - * - * @return the installedDateTime value. - */ - public OffsetDateTime installedDateTime() { - return this.innerProperties() == null ? null : this.innerProperties().installedDateTime(); - } - - /** - * Set the installedDateTime property: Installed timestamp. - * - * @param installedDateTime the installedDateTime value to set. - * @return the SiteExtensionInfoInner object itself. - */ - public SiteExtensionInfoInner withInstalledDateTime(OffsetDateTime installedDateTime) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteExtensionInfoProperties(); - } - this.innerProperties().withInstalledDateTime(installedDateTime); - return this; - } - - /** - * Get the provisioningState property: Provisioning state. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Set the provisioningState property: Provisioning state. - * - * @param provisioningState the provisioningState value to set. - * @return the SiteExtensionInfoInner object itself. - */ - public SiteExtensionInfoInner withProvisioningState(String provisioningState) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteExtensionInfoProperties(); - } - this.innerProperties().withProvisioningState(provisioningState); - return this; - } - - /** - * Get the comment property: Site Extension comment. - * - * @return the comment value. - */ - public String comment() { - return this.innerProperties() == null ? null : this.innerProperties().comment(); - } - - /** - * Set the comment property: Site Extension comment. - * - * @param comment the comment value to set. - * @return the SiteExtensionInfoInner object itself. - */ - public SiteExtensionInfoInner withComment(String comment) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteExtensionInfoProperties(); - } - this.innerProperties().withComment(comment); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SiteExtensionInfoProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SiteExtensionInfoProperties.java deleted file mode 100644 index 04149d284dae..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SiteExtensionInfoProperties.java +++ /dev/null @@ -1,550 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.SiteExtensionType; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; - -/** SiteExtensionInfo resource specific properties. */ -@Fluent -public final class SiteExtensionInfoProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SiteExtensionInfoProperties.class); - - /* - * Site extension ID. - */ - @JsonProperty(value = "extension_id") - private String extensionId; - - /* - * The title property. - */ - @JsonProperty(value = "title") - private String title; - - /* - * Site extension type. - */ - @JsonProperty(value = "extension_type") - private SiteExtensionType extensionType; - - /* - * Summary description. - */ - @JsonProperty(value = "summary") - private String summary; - - /* - * Detailed description. - */ - @JsonProperty(value = "description") - private String description; - - /* - * Version information. - */ - @JsonProperty(value = "version") - private String version; - - /* - * Extension URL. - */ - @JsonProperty(value = "extension_url") - private String extensionUrl; - - /* - * Project URL. - */ - @JsonProperty(value = "project_url") - private String projectUrl; - - /* - * Icon URL. - */ - @JsonProperty(value = "icon_url") - private String iconUrl; - - /* - * License URL. - */ - @JsonProperty(value = "license_url") - private String licenseUrl; - - /* - * Feed URL. - */ - @JsonProperty(value = "feed_url") - private String feedUrl; - - /* - * List of authors. - */ - @JsonProperty(value = "authors") - private List authors; - - /* - * Installer command line parameters. - */ - @JsonProperty(value = "installer_command_line_params") - private String installerCommandLineParams; - - /* - * Published timestamp. - */ - @JsonProperty(value = "published_date_time") - private OffsetDateTime publishedDateTime; - - /* - * Count of downloads. - */ - @JsonProperty(value = "download_count") - private Integer downloadCount; - - /* - * true if the local version is the latest version; - * false otherwise. - */ - @JsonProperty(value = "local_is_latest_version") - private Boolean localIsLatestVersion; - - /* - * Local path. - */ - @JsonProperty(value = "local_path") - private String localPath; - - /* - * Installed timestamp. - */ - @JsonProperty(value = "installed_date_time") - private OffsetDateTime installedDateTime; - - /* - * Provisioning state. - */ - @JsonProperty(value = "provisioningState") - private String provisioningState; - - /* - * Site Extension comment. - */ - @JsonProperty(value = "comment") - private String comment; - - /** - * Get the extensionId property: Site extension ID. - * - * @return the extensionId value. - */ - public String extensionId() { - return this.extensionId; - } - - /** - * Set the extensionId property: Site extension ID. - * - * @param extensionId the extensionId value to set. - * @return the SiteExtensionInfoProperties object itself. - */ - public SiteExtensionInfoProperties withExtensionId(String extensionId) { - this.extensionId = extensionId; - return this; - } - - /** - * Get the title property: The title property. - * - * @return the title value. - */ - public String title() { - return this.title; - } - - /** - * Set the title property: The title property. - * - * @param title the title value to set. - * @return the SiteExtensionInfoProperties object itself. - */ - public SiteExtensionInfoProperties withTitle(String title) { - this.title = title; - return this; - } - - /** - * Get the extensionType property: Site extension type. - * - * @return the extensionType value. - */ - public SiteExtensionType extensionType() { - return this.extensionType; - } - - /** - * Set the extensionType property: Site extension type. - * - * @param extensionType the extensionType value to set. - * @return the SiteExtensionInfoProperties object itself. - */ - public SiteExtensionInfoProperties withExtensionType(SiteExtensionType extensionType) { - this.extensionType = extensionType; - return this; - } - - /** - * Get the summary property: Summary description. - * - * @return the summary value. - */ - public String summary() { - return this.summary; - } - - /** - * Set the summary property: Summary description. - * - * @param summary the summary value to set. - * @return the SiteExtensionInfoProperties object itself. - */ - public SiteExtensionInfoProperties withSummary(String summary) { - this.summary = summary; - return this; - } - - /** - * Get the description property: Detailed description. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: Detailed description. - * - * @param description the description value to set. - * @return the SiteExtensionInfoProperties object itself. - */ - public SiteExtensionInfoProperties withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the version property: Version information. - * - * @return the version value. - */ - public String version() { - return this.version; - } - - /** - * Set the version property: Version information. - * - * @param version the version value to set. - * @return the SiteExtensionInfoProperties object itself. - */ - public SiteExtensionInfoProperties withVersion(String version) { - this.version = version; - return this; - } - - /** - * Get the extensionUrl property: Extension URL. - * - * @return the extensionUrl value. - */ - public String extensionUrl() { - return this.extensionUrl; - } - - /** - * Set the extensionUrl property: Extension URL. - * - * @param extensionUrl the extensionUrl value to set. - * @return the SiteExtensionInfoProperties object itself. - */ - public SiteExtensionInfoProperties withExtensionUrl(String extensionUrl) { - this.extensionUrl = extensionUrl; - return this; - } - - /** - * Get the projectUrl property: Project URL. - * - * @return the projectUrl value. - */ - public String projectUrl() { - return this.projectUrl; - } - - /** - * Set the projectUrl property: Project URL. - * - * @param projectUrl the projectUrl value to set. - * @return the SiteExtensionInfoProperties object itself. - */ - public SiteExtensionInfoProperties withProjectUrl(String projectUrl) { - this.projectUrl = projectUrl; - return this; - } - - /** - * Get the iconUrl property: Icon URL. - * - * @return the iconUrl value. - */ - public String iconUrl() { - return this.iconUrl; - } - - /** - * Set the iconUrl property: Icon URL. - * - * @param iconUrl the iconUrl value to set. - * @return the SiteExtensionInfoProperties object itself. - */ - public SiteExtensionInfoProperties withIconUrl(String iconUrl) { - this.iconUrl = iconUrl; - return this; - } - - /** - * Get the licenseUrl property: License URL. - * - * @return the licenseUrl value. - */ - public String licenseUrl() { - return this.licenseUrl; - } - - /** - * Set the licenseUrl property: License URL. - * - * @param licenseUrl the licenseUrl value to set. - * @return the SiteExtensionInfoProperties object itself. - */ - public SiteExtensionInfoProperties withLicenseUrl(String licenseUrl) { - this.licenseUrl = licenseUrl; - return this; - } - - /** - * Get the feedUrl property: Feed URL. - * - * @return the feedUrl value. - */ - public String feedUrl() { - return this.feedUrl; - } - - /** - * Set the feedUrl property: Feed URL. - * - * @param feedUrl the feedUrl value to set. - * @return the SiteExtensionInfoProperties object itself. - */ - public SiteExtensionInfoProperties withFeedUrl(String feedUrl) { - this.feedUrl = feedUrl; - return this; - } - - /** - * Get the authors property: List of authors. - * - * @return the authors value. - */ - public List authors() { - return this.authors; - } - - /** - * Set the authors property: List of authors. - * - * @param authors the authors value to set. - * @return the SiteExtensionInfoProperties object itself. - */ - public SiteExtensionInfoProperties withAuthors(List authors) { - this.authors = authors; - return this; - } - - /** - * Get the installerCommandLineParams property: Installer command line parameters. - * - * @return the installerCommandLineParams value. - */ - public String installerCommandLineParams() { - return this.installerCommandLineParams; - } - - /** - * Set the installerCommandLineParams property: Installer command line parameters. - * - * @param installerCommandLineParams the installerCommandLineParams value to set. - * @return the SiteExtensionInfoProperties object itself. - */ - public SiteExtensionInfoProperties withInstallerCommandLineParams(String installerCommandLineParams) { - this.installerCommandLineParams = installerCommandLineParams; - return this; - } - - /** - * Get the publishedDateTime property: Published timestamp. - * - * @return the publishedDateTime value. - */ - public OffsetDateTime publishedDateTime() { - return this.publishedDateTime; - } - - /** - * Set the publishedDateTime property: Published timestamp. - * - * @param publishedDateTime the publishedDateTime value to set. - * @return the SiteExtensionInfoProperties object itself. - */ - public SiteExtensionInfoProperties withPublishedDateTime(OffsetDateTime publishedDateTime) { - this.publishedDateTime = publishedDateTime; - return this; - } - - /** - * Get the downloadCount property: Count of downloads. - * - * @return the downloadCount value. - */ - public Integer downloadCount() { - return this.downloadCount; - } - - /** - * Set the downloadCount property: Count of downloads. - * - * @param downloadCount the downloadCount value to set. - * @return the SiteExtensionInfoProperties object itself. - */ - public SiteExtensionInfoProperties withDownloadCount(Integer downloadCount) { - this.downloadCount = downloadCount; - return this; - } - - /** - * Get the localIsLatestVersion property: <code>true</code> if the local version is the latest version; - * <code>false</code> otherwise. - * - * @return the localIsLatestVersion value. - */ - public Boolean localIsLatestVersion() { - return this.localIsLatestVersion; - } - - /** - * Set the localIsLatestVersion property: <code>true</code> if the local version is the latest version; - * <code>false</code> otherwise. - * - * @param localIsLatestVersion the localIsLatestVersion value to set. - * @return the SiteExtensionInfoProperties object itself. - */ - public SiteExtensionInfoProperties withLocalIsLatestVersion(Boolean localIsLatestVersion) { - this.localIsLatestVersion = localIsLatestVersion; - return this; - } - - /** - * Get the localPath property: Local path. - * - * @return the localPath value. - */ - public String localPath() { - return this.localPath; - } - - /** - * Set the localPath property: Local path. - * - * @param localPath the localPath value to set. - * @return the SiteExtensionInfoProperties object itself. - */ - public SiteExtensionInfoProperties withLocalPath(String localPath) { - this.localPath = localPath; - return this; - } - - /** - * Get the installedDateTime property: Installed timestamp. - * - * @return the installedDateTime value. - */ - public OffsetDateTime installedDateTime() { - return this.installedDateTime; - } - - /** - * Set the installedDateTime property: Installed timestamp. - * - * @param installedDateTime the installedDateTime value to set. - * @return the SiteExtensionInfoProperties object itself. - */ - public SiteExtensionInfoProperties withInstalledDateTime(OffsetDateTime installedDateTime) { - this.installedDateTime = installedDateTime; - return this; - } - - /** - * Get the provisioningState property: Provisioning state. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Set the provisioningState property: Provisioning state. - * - * @param provisioningState the provisioningState value to set. - * @return the SiteExtensionInfoProperties object itself. - */ - public SiteExtensionInfoProperties withProvisioningState(String provisioningState) { - this.provisioningState = provisioningState; - return this; - } - - /** - * Get the comment property: Site Extension comment. - * - * @return the comment value. - */ - public String comment() { - return this.comment; - } - - /** - * Set the comment property: Site Extension comment. - * - * @param comment the comment value to set. - * @return the SiteExtensionInfoProperties object itself. - */ - public SiteExtensionInfoProperties withComment(String comment) { - this.comment = comment; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SiteInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SiteInner.java deleted file mode 100644 index b714117fd298..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SiteInner.java +++ /dev/null @@ -1,750 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.CloningInfo; -import com.azure.resourcemanager.appservice.models.GeoDistribution; -import com.azure.resourcemanager.appservice.models.HostingEnvironmentProfile; -import com.azure.resourcemanager.appservice.models.HostnameSslState; -import com.azure.resourcemanager.appservice.models.ManagedServiceIdentity; -import com.azure.resourcemanager.appservice.models.RedundancyMode; -import com.azure.resourcemanager.appservice.models.SiteAvailabilityState; -import com.azure.resourcemanager.appservice.models.SlotSwapStatus; -import com.azure.resourcemanager.appservice.models.UsageState; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; -import java.util.Map; -import java.util.UUID; - -/** A web app, a mobile app backend, or an API app. */ -@Fluent -public final class SiteInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SiteInner.class); - - /* - * Site resource specific properties - */ - @JsonProperty(value = "properties") - private SitePropertiesInner innerProperties; - - /* - * Managed service identity. - */ - @JsonProperty(value = "identity") - private ManagedServiceIdentity identity; - - /* - * Kind of resource. - */ - @JsonProperty(value = "kind") - private String kind; - - /** - * Get the innerProperties property: Site resource specific properties. - * - * @return the innerProperties value. - */ - private SitePropertiesInner innerProperties() { - return this.innerProperties; - } - - /** - * Get the identity property: Managed service identity. - * - * @return the identity value. - */ - public ManagedServiceIdentity identity() { - return this.identity; - } - - /** - * Set the identity property: Managed service identity. - * - * @param identity the identity value to set. - * @return the SiteInner object itself. - */ - public SiteInner withIdentity(ManagedServiceIdentity identity) { - this.identity = identity; - return this; - } - - /** - * Get the kind property: Kind of resource. - * - * @return the kind value. - */ - public String kind() { - return this.kind; - } - - /** - * Set the kind property: Kind of resource. - * - * @param kind the kind value to set. - * @return the SiteInner object itself. - */ - public SiteInner withKind(String kind) { - this.kind = kind; - return this; - } - - /** {@inheritDoc} */ - @Override - public SiteInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public SiteInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the state property: Current state of the app. - * - * @return the state value. - */ - public String state() { - return this.innerProperties() == null ? null : this.innerProperties().state(); - } - - /** - * Get the hostNames property: Hostnames associated with the app. - * - * @return the hostNames value. - */ - public List hostNames() { - return this.innerProperties() == null ? null : this.innerProperties().hostNames(); - } - - /** - * Get the repositorySiteName property: Name of the repository site. - * - * @return the repositorySiteName value. - */ - public String repositorySiteName() { - return this.innerProperties() == null ? null : this.innerProperties().repositorySiteName(); - } - - /** - * Get the usageState property: State indicating whether the app has exceeded its quota usage. Read-only. - * - * @return the usageState value. - */ - public UsageState usageState() { - return this.innerProperties() == null ? null : this.innerProperties().usageState(); - } - - /** - * Get the enabled property: <code>true</code> if the app is enabled; otherwise, - * <code>false</code>. Setting this value to false disables the app (takes the app offline). - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.innerProperties() == null ? null : this.innerProperties().enabled(); - } - - /** - * Set the enabled property: <code>true</code> if the app is enabled; otherwise, - * <code>false</code>. Setting this value to false disables the app (takes the app offline). - * - * @param enabled the enabled value to set. - * @return the SiteInner object itself. - */ - public SiteInner withEnabled(Boolean enabled) { - if (this.innerProperties() == null) { - this.innerProperties = new SitePropertiesInner(); - } - this.innerProperties().withEnabled(enabled); - return this; - } - - /** - * Get the enabledHostNames property: Enabled hostnames for the app.Hostnames need to be assigned (see HostNames) - * AND enabled. Otherwise, the app is not served on those hostnames. - * - * @return the enabledHostNames value. - */ - public List enabledHostNames() { - return this.innerProperties() == null ? null : this.innerProperties().enabledHostNames(); - } - - /** - * Get the availabilityState property: Management information availability state for the app. - * - * @return the availabilityState value. - */ - public SiteAvailabilityState availabilityState() { - return this.innerProperties() == null ? null : this.innerProperties().availabilityState(); - } - - /** - * Get the hostnameSslStates property: Hostname SSL states are used to manage the SSL bindings for app's hostnames. - * - * @return the hostnameSslStates value. - */ - public List hostnameSslStates() { - return this.innerProperties() == null ? null : this.innerProperties().hostnameSslStates(); - } - - /** - * Set the hostnameSslStates property: Hostname SSL states are used to manage the SSL bindings for app's hostnames. - * - * @param hostnameSslStates the hostnameSslStates value to set. - * @return the SiteInner object itself. - */ - public SiteInner withHostnameSslStates(List hostnameSslStates) { - if (this.innerProperties() == null) { - this.innerProperties = new SitePropertiesInner(); - } - this.innerProperties().withHostnameSslStates(hostnameSslStates); - return this; - } - - /** - * Get the serverFarmId property: Resource ID of the associated App Service plan, formatted as: - * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms" - + "/{appServicePlanName}". - * - * @return the serverFarmId value. - */ - public String serverFarmId() { - return this.innerProperties() == null ? null : this.innerProperties().serverFarmId(); - } - - /** - * Set the serverFarmId property: Resource ID of the associated App Service plan, formatted as: - * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms" - + "/{appServicePlanName}". - * - * @param serverFarmId the serverFarmId value to set. - * @return the SiteInner object itself. - */ - public SiteInner withServerFarmId(String serverFarmId) { - if (this.innerProperties() == null) { - this.innerProperties = new SitePropertiesInner(); - } - this.innerProperties().withServerFarmId(serverFarmId); - return this; - } - - /** - * Get the reserved property: <code>true</code> if reserved; otherwise, <code>false</code>. - * - * @return the reserved value. - */ - public Boolean reserved() { - return this.innerProperties() == null ? null : this.innerProperties().reserved(); - } - - /** - * Set the reserved property: <code>true</code> if reserved; otherwise, <code>false</code>. - * - * @param reserved the reserved value to set. - * @return the SiteInner object itself. - */ - public SiteInner withReserved(Boolean reserved) { - if (this.innerProperties() == null) { - this.innerProperties = new SitePropertiesInner(); - } - this.innerProperties().withReserved(reserved); - return this; - } - - /** - * Get the isXenon property: Obsolete: Hyper-V sandbox. - * - * @return the isXenon value. - */ - public Boolean isXenon() { - return this.innerProperties() == null ? null : this.innerProperties().isXenon(); - } - - /** - * Set the isXenon property: Obsolete: Hyper-V sandbox. - * - * @param isXenon the isXenon value to set. - * @return the SiteInner object itself. - */ - public SiteInner withIsXenon(Boolean isXenon) { - if (this.innerProperties() == null) { - this.innerProperties = new SitePropertiesInner(); - } - this.innerProperties().withIsXenon(isXenon); - return this; - } - - /** - * Get the hyperV property: Hyper-V sandbox. - * - * @return the hyperV value. - */ - public Boolean hyperV() { - return this.innerProperties() == null ? null : this.innerProperties().hyperV(); - } - - /** - * Set the hyperV property: Hyper-V sandbox. - * - * @param hyperV the hyperV value to set. - * @return the SiteInner object itself. - */ - public SiteInner withHyperV(Boolean hyperV) { - if (this.innerProperties() == null) { - this.innerProperties = new SitePropertiesInner(); - } - this.innerProperties().withHyperV(hyperV); - return this; - } - - /** - * Get the lastModifiedTimeUtc property: Last time the app was modified, in UTC. Read-only. - * - * @return the lastModifiedTimeUtc value. - */ - public OffsetDateTime lastModifiedTimeUtc() { - return this.innerProperties() == null ? null : this.innerProperties().lastModifiedTimeUtc(); - } - - /** - * Get the siteConfig property: Configuration of the app. - * - * @return the siteConfig value. - */ - public SiteConfigInner siteConfig() { - return this.innerProperties() == null ? null : this.innerProperties().siteConfig(); - } - - /** - * Set the siteConfig property: Configuration of the app. - * - * @param siteConfig the siteConfig value to set. - * @return the SiteInner object itself. - */ - public SiteInner withSiteConfig(SiteConfigInner siteConfig) { - if (this.innerProperties() == null) { - this.innerProperties = new SitePropertiesInner(); - } - this.innerProperties().withSiteConfig(siteConfig); - return this; - } - - /** - * Get the trafficManagerHostNames property: Azure Traffic Manager hostnames associated with the app. Read-only. - * - * @return the trafficManagerHostNames value. - */ - public List trafficManagerHostNames() { - return this.innerProperties() == null ? null : this.innerProperties().trafficManagerHostNames(); - } - - /** - * Get the scmSiteAlsoStopped property: <code>true</code> to stop SCM (KUDU) site when the app is - * stopped; otherwise, <code>false</code>. The default is <code>false</code>. - * - * @return the scmSiteAlsoStopped value. - */ - public Boolean scmSiteAlsoStopped() { - return this.innerProperties() == null ? null : this.innerProperties().scmSiteAlsoStopped(); - } - - /** - * Set the scmSiteAlsoStopped property: <code>true</code> to stop SCM (KUDU) site when the app is - * stopped; otherwise, <code>false</code>. The default is <code>false</code>. - * - * @param scmSiteAlsoStopped the scmSiteAlsoStopped value to set. - * @return the SiteInner object itself. - */ - public SiteInner withScmSiteAlsoStopped(Boolean scmSiteAlsoStopped) { - if (this.innerProperties() == null) { - this.innerProperties = new SitePropertiesInner(); - } - this.innerProperties().withScmSiteAlsoStopped(scmSiteAlsoStopped); - return this; - } - - /** - * Get the targetSwapSlot property: Specifies which deployment slot this app will swap into. Read-only. - * - * @return the targetSwapSlot value. - */ - public String targetSwapSlot() { - return this.innerProperties() == null ? null : this.innerProperties().targetSwapSlot(); - } - - /** - * Get the hostingEnvironmentProfile property: App Service Environment to use for the app. - * - * @return the hostingEnvironmentProfile value. - */ - public HostingEnvironmentProfile hostingEnvironmentProfile() { - return this.innerProperties() == null ? null : this.innerProperties().hostingEnvironmentProfile(); - } - - /** - * Set the hostingEnvironmentProfile property: App Service Environment to use for the app. - * - * @param hostingEnvironmentProfile the hostingEnvironmentProfile value to set. - * @return the SiteInner object itself. - */ - public SiteInner withHostingEnvironmentProfile(HostingEnvironmentProfile hostingEnvironmentProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new SitePropertiesInner(); - } - this.innerProperties().withHostingEnvironmentProfile(hostingEnvironmentProfile); - return this; - } - - /** - * Get the clientAffinityEnabled property: <code>true</code> to enable client affinity; - * <code>false</code> to stop sending session affinity cookies, which route client requests in the same - * session to the same instance. Default is <code>true</code>. - * - * @return the clientAffinityEnabled value. - */ - public Boolean clientAffinityEnabled() { - return this.innerProperties() == null ? null : this.innerProperties().clientAffinityEnabled(); - } - - /** - * Set the clientAffinityEnabled property: <code>true</code> to enable client affinity; - * <code>false</code> to stop sending session affinity cookies, which route client requests in the same - * session to the same instance. Default is <code>true</code>. - * - * @param clientAffinityEnabled the clientAffinityEnabled value to set. - * @return the SiteInner object itself. - */ - public SiteInner withClientAffinityEnabled(Boolean clientAffinityEnabled) { - if (this.innerProperties() == null) { - this.innerProperties = new SitePropertiesInner(); - } - this.innerProperties().withClientAffinityEnabled(clientAffinityEnabled); - return this; - } - - /** - * Get the clientCertEnabled property: <code>true</code> to enable client certificate authentication - * (TLS mutual authentication); otherwise, <code>false</code>. Default is - * <code>false</code>. - * - * @return the clientCertEnabled value. - */ - public Boolean clientCertEnabled() { - return this.innerProperties() == null ? null : this.innerProperties().clientCertEnabled(); - } - - /** - * Set the clientCertEnabled property: <code>true</code> to enable client certificate authentication - * (TLS mutual authentication); otherwise, <code>false</code>. Default is - * <code>false</code>. - * - * @param clientCertEnabled the clientCertEnabled value to set. - * @return the SiteInner object itself. - */ - public SiteInner withClientCertEnabled(Boolean clientCertEnabled) { - if (this.innerProperties() == null) { - this.innerProperties = new SitePropertiesInner(); - } - this.innerProperties().withClientCertEnabled(clientCertEnabled); - return this; - } - - /** - * Get the clientCertExclusionPaths property: client certificate authentication comma-separated exclusion paths. - * - * @return the clientCertExclusionPaths value. - */ - public String clientCertExclusionPaths() { - return this.innerProperties() == null ? null : this.innerProperties().clientCertExclusionPaths(); - } - - /** - * Set the clientCertExclusionPaths property: client certificate authentication comma-separated exclusion paths. - * - * @param clientCertExclusionPaths the clientCertExclusionPaths value to set. - * @return the SiteInner object itself. - */ - public SiteInner withClientCertExclusionPaths(String clientCertExclusionPaths) { - if (this.innerProperties() == null) { - this.innerProperties = new SitePropertiesInner(); - } - this.innerProperties().withClientCertExclusionPaths(clientCertExclusionPaths); - return this; - } - - /** - * Get the hostNamesDisabled property: <code>true</code> to disable the public hostnames of the app; - * otherwise, <code>false</code>. If <code>true</code>, the app is only accessible via API - * management process. - * - * @return the hostNamesDisabled value. - */ - public Boolean hostNamesDisabled() { - return this.innerProperties() == null ? null : this.innerProperties().hostNamesDisabled(); - } - - /** - * Set the hostNamesDisabled property: <code>true</code> to disable the public hostnames of the app; - * otherwise, <code>false</code>. If <code>true</code>, the app is only accessible via API - * management process. - * - * @param hostNamesDisabled the hostNamesDisabled value to set. - * @return the SiteInner object itself. - */ - public SiteInner withHostNamesDisabled(Boolean hostNamesDisabled) { - if (this.innerProperties() == null) { - this.innerProperties = new SitePropertiesInner(); - } - this.innerProperties().withHostNamesDisabled(hostNamesDisabled); - return this; - } - - /** - * Get the outboundIpAddresses property: List of IP addresses that the app uses for outbound connections (e.g. - * database access). Includes VIPs from tenants that site can be hosted with current settings. Read-only. - * - * @return the outboundIpAddresses value. - */ - public String outboundIpAddresses() { - return this.innerProperties() == null ? null : this.innerProperties().outboundIpAddresses(); - } - - /** - * Get the possibleOutboundIpAddresses property: List of IP addresses that the app uses for outbound connections - * (e.g. database access). Includes VIPs from all tenants. Read-only. - * - * @return the possibleOutboundIpAddresses value. - */ - public String possibleOutboundIpAddresses() { - return this.innerProperties() == null ? null : this.innerProperties().possibleOutboundIpAddresses(); - } - - /** - * Get the containerSize property: Size of the function container. - * - * @return the containerSize value. - */ - public Integer containerSize() { - return this.innerProperties() == null ? null : this.innerProperties().containerSize(); - } - - /** - * Set the containerSize property: Size of the function container. - * - * @param containerSize the containerSize value to set. - * @return the SiteInner object itself. - */ - public SiteInner withContainerSize(Integer containerSize) { - if (this.innerProperties() == null) { - this.innerProperties = new SitePropertiesInner(); - } - this.innerProperties().withContainerSize(containerSize); - return this; - } - - /** - * Get the dailyMemoryTimeQuota property: Maximum allowed daily memory-time quota (applicable on dynamic apps only). - * - * @return the dailyMemoryTimeQuota value. - */ - public Integer dailyMemoryTimeQuota() { - return this.innerProperties() == null ? null : this.innerProperties().dailyMemoryTimeQuota(); - } - - /** - * Set the dailyMemoryTimeQuota property: Maximum allowed daily memory-time quota (applicable on dynamic apps only). - * - * @param dailyMemoryTimeQuota the dailyMemoryTimeQuota value to set. - * @return the SiteInner object itself. - */ - public SiteInner withDailyMemoryTimeQuota(Integer dailyMemoryTimeQuota) { - if (this.innerProperties() == null) { - this.innerProperties = new SitePropertiesInner(); - } - this.innerProperties().withDailyMemoryTimeQuota(dailyMemoryTimeQuota); - return this; - } - - /** - * Get the suspendedTill property: App suspended till in case memory-time quota is exceeded. - * - * @return the suspendedTill value. - */ - public OffsetDateTime suspendedTill() { - return this.innerProperties() == null ? null : this.innerProperties().suspendedTill(); - } - - /** - * Get the maxNumberOfWorkers property: Maximum number of workers. This only applies to Functions container. - * - * @return the maxNumberOfWorkers value. - */ - public Integer maxNumberOfWorkers() { - return this.innerProperties() == null ? null : this.innerProperties().maxNumberOfWorkers(); - } - - /** - * Get the cloningInfo property: If specified during app creation, the app is cloned from a source app. - * - * @return the cloningInfo value. - */ - public CloningInfo cloningInfo() { - return this.innerProperties() == null ? null : this.innerProperties().cloningInfo(); - } - - /** - * Set the cloningInfo property: If specified during app creation, the app is cloned from a source app. - * - * @param cloningInfo the cloningInfo value to set. - * @return the SiteInner object itself. - */ - public SiteInner withCloningInfo(CloningInfo cloningInfo) { - if (this.innerProperties() == null) { - this.innerProperties = new SitePropertiesInner(); - } - this.innerProperties().withCloningInfo(cloningInfo); - return this; - } - - /** - * Get the resourceGroup property: Name of the resource group the app belongs to. Read-only. - * - * @return the resourceGroup value. - */ - public String resourceGroup() { - return this.innerProperties() == null ? null : this.innerProperties().resourceGroup(); - } - - /** - * Get the isDefaultContainer property: <code>true</code> if the app is a default container; otherwise, - * <code>false</code>. - * - * @return the isDefaultContainer value. - */ - public Boolean isDefaultContainer() { - return this.innerProperties() == null ? null : this.innerProperties().isDefaultContainer(); - } - - /** - * Get the defaultHostname property: Default hostname of the app. Read-only. - * - * @return the defaultHostname value. - */ - public String defaultHostname() { - return this.innerProperties() == null ? null : this.innerProperties().defaultHostname(); - } - - /** - * Get the slotSwapStatus property: Status of the last deployment slot swap operation. - * - * @return the slotSwapStatus value. - */ - public SlotSwapStatus slotSwapStatus() { - return this.innerProperties() == null ? null : this.innerProperties().slotSwapStatus(); - } - - /** - * Get the httpsOnly property: HttpsOnly: configures a web site to accept only https requests. Issues redirect for - * http requests. - * - * @return the httpsOnly value. - */ - public Boolean httpsOnly() { - return this.innerProperties() == null ? null : this.innerProperties().httpsOnly(); - } - - /** - * Set the httpsOnly property: HttpsOnly: configures a web site to accept only https requests. Issues redirect for - * http requests. - * - * @param httpsOnly the httpsOnly value to set. - * @return the SiteInner object itself. - */ - public SiteInner withHttpsOnly(Boolean httpsOnly) { - if (this.innerProperties() == null) { - this.innerProperties = new SitePropertiesInner(); - } - this.innerProperties().withHttpsOnly(httpsOnly); - return this; - } - - /** - * Get the redundancyMode property: Site redundancy mode. - * - * @return the redundancyMode value. - */ - public RedundancyMode redundancyMode() { - return this.innerProperties() == null ? null : this.innerProperties().redundancyMode(); - } - - /** - * Set the redundancyMode property: Site redundancy mode. - * - * @param redundancyMode the redundancyMode value to set. - * @return the SiteInner object itself. - */ - public SiteInner withRedundancyMode(RedundancyMode redundancyMode) { - if (this.innerProperties() == null) { - this.innerProperties = new SitePropertiesInner(); - } - this.innerProperties().withRedundancyMode(redundancyMode); - return this; - } - - /** - * Get the inProgressOperationId property: Specifies an operation id if this site has a pending operation. - * - * @return the inProgressOperationId value. - */ - public UUID inProgressOperationId() { - return this.innerProperties() == null ? null : this.innerProperties().inProgressOperationId(); - } - - /** - * Get the geoDistributions property: GeoDistributions for this site. - * - * @return the geoDistributions value. - */ - public List geoDistributions() { - return this.innerProperties() == null ? null : this.innerProperties().geoDistributions(); - } - - /** - * Set the geoDistributions property: GeoDistributions for this site. - * - * @param geoDistributions the geoDistributions value to set. - * @return the SiteInner object itself. - */ - public SiteInner withGeoDistributions(List geoDistributions) { - if (this.innerProperties() == null) { - this.innerProperties = new SitePropertiesInner(); - } - this.innerProperties().withGeoDistributions(geoDistributions); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - if (identity() != null) { - identity().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SiteInstanceInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SiteInstanceInner.java deleted file mode 100644 index 654d0d7d3ffc..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SiteInstanceInner.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.ProxyOnlyResource; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Instance of an app. */ -@Fluent -public final class SiteInstanceInner extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SiteInstanceInner.class); - - /* - * SiteInstance resource specific properties - */ - @JsonProperty(value = "properties") - private SiteInstanceProperties innerProperties; - - /** - * Get the innerProperties property: SiteInstance resource specific properties. - * - * @return the innerProperties value. - */ - private SiteInstanceProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public SiteInstanceInner withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the siteInstanceName property: Name of instance. - * - * @return the siteInstanceName value. - */ - public String siteInstanceName() { - return this.innerProperties() == null ? null : this.innerProperties().siteInstanceName(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SiteInstanceProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SiteInstanceProperties.java deleted file mode 100644 index 5959bbcc63ca..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SiteInstanceProperties.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** SiteInstance resource specific properties. */ -@Immutable -public final class SiteInstanceProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SiteInstanceProperties.class); - - /* - * Name of instance. - */ - @JsonProperty(value = "siteInstanceName", access = JsonProperty.Access.WRITE_ONLY) - private String siteInstanceName; - - /** - * Get the siteInstanceName property: Name of instance. - * - * @return the siteInstanceName value. - */ - public String siteInstanceName() { - return this.siteInstanceName; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SiteLogsConfigInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SiteLogsConfigInner.java deleted file mode 100644 index b317952b562c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SiteLogsConfigInner.java +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.ApplicationLogsConfig; -import com.azure.resourcemanager.appservice.models.EnabledConfig; -import com.azure.resourcemanager.appservice.models.HttpLogsConfig; -import com.azure.resourcemanager.appservice.models.ProxyOnlyResource; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Configuration of App Service site logs. */ -@Fluent -public final class SiteLogsConfigInner extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SiteLogsConfigInner.class); - - /* - * SiteLogsConfig resource specific properties - */ - @JsonProperty(value = "properties") - private SiteLogsConfigProperties innerProperties; - - /** - * Get the innerProperties property: SiteLogsConfig resource specific properties. - * - * @return the innerProperties value. - */ - private SiteLogsConfigProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public SiteLogsConfigInner withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the applicationLogs property: Application logs configuration. - * - * @return the applicationLogs value. - */ - public ApplicationLogsConfig applicationLogs() { - return this.innerProperties() == null ? null : this.innerProperties().applicationLogs(); - } - - /** - * Set the applicationLogs property: Application logs configuration. - * - * @param applicationLogs the applicationLogs value to set. - * @return the SiteLogsConfigInner object itself. - */ - public SiteLogsConfigInner withApplicationLogs(ApplicationLogsConfig applicationLogs) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteLogsConfigProperties(); - } - this.innerProperties().withApplicationLogs(applicationLogs); - return this; - } - - /** - * Get the httpLogs property: HTTP logs configuration. - * - * @return the httpLogs value. - */ - public HttpLogsConfig httpLogs() { - return this.innerProperties() == null ? null : this.innerProperties().httpLogs(); - } - - /** - * Set the httpLogs property: HTTP logs configuration. - * - * @param httpLogs the httpLogs value to set. - * @return the SiteLogsConfigInner object itself. - */ - public SiteLogsConfigInner withHttpLogs(HttpLogsConfig httpLogs) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteLogsConfigProperties(); - } - this.innerProperties().withHttpLogs(httpLogs); - return this; - } - - /** - * Get the failedRequestsTracing property: Failed requests tracing configuration. - * - * @return the failedRequestsTracing value. - */ - public EnabledConfig failedRequestsTracing() { - return this.innerProperties() == null ? null : this.innerProperties().failedRequestsTracing(); - } - - /** - * Set the failedRequestsTracing property: Failed requests tracing configuration. - * - * @param failedRequestsTracing the failedRequestsTracing value to set. - * @return the SiteLogsConfigInner object itself. - */ - public SiteLogsConfigInner withFailedRequestsTracing(EnabledConfig failedRequestsTracing) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteLogsConfigProperties(); - } - this.innerProperties().withFailedRequestsTracing(failedRequestsTracing); - return this; - } - - /** - * Get the detailedErrorMessages property: Detailed error messages configuration. - * - * @return the detailedErrorMessages value. - */ - public EnabledConfig detailedErrorMessages() { - return this.innerProperties() == null ? null : this.innerProperties().detailedErrorMessages(); - } - - /** - * Set the detailedErrorMessages property: Detailed error messages configuration. - * - * @param detailedErrorMessages the detailedErrorMessages value to set. - * @return the SiteLogsConfigInner object itself. - */ - public SiteLogsConfigInner withDetailedErrorMessages(EnabledConfig detailedErrorMessages) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteLogsConfigProperties(); - } - this.innerProperties().withDetailedErrorMessages(detailedErrorMessages); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SiteLogsConfigProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SiteLogsConfigProperties.java deleted file mode 100644 index f776a9316222..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SiteLogsConfigProperties.java +++ /dev/null @@ -1,143 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.ApplicationLogsConfig; -import com.azure.resourcemanager.appservice.models.EnabledConfig; -import com.azure.resourcemanager.appservice.models.HttpLogsConfig; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** SiteLogsConfig resource specific properties. */ -@Fluent -public final class SiteLogsConfigProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SiteLogsConfigProperties.class); - - /* - * Application logs configuration. - */ - @JsonProperty(value = "applicationLogs") - private ApplicationLogsConfig applicationLogs; - - /* - * HTTP logs configuration. - */ - @JsonProperty(value = "httpLogs") - private HttpLogsConfig httpLogs; - - /* - * Failed requests tracing configuration. - */ - @JsonProperty(value = "failedRequestsTracing") - private EnabledConfig failedRequestsTracing; - - /* - * Detailed error messages configuration. - */ - @JsonProperty(value = "detailedErrorMessages") - private EnabledConfig detailedErrorMessages; - - /** - * Get the applicationLogs property: Application logs configuration. - * - * @return the applicationLogs value. - */ - public ApplicationLogsConfig applicationLogs() { - return this.applicationLogs; - } - - /** - * Set the applicationLogs property: Application logs configuration. - * - * @param applicationLogs the applicationLogs value to set. - * @return the SiteLogsConfigProperties object itself. - */ - public SiteLogsConfigProperties withApplicationLogs(ApplicationLogsConfig applicationLogs) { - this.applicationLogs = applicationLogs; - return this; - } - - /** - * Get the httpLogs property: HTTP logs configuration. - * - * @return the httpLogs value. - */ - public HttpLogsConfig httpLogs() { - return this.httpLogs; - } - - /** - * Set the httpLogs property: HTTP logs configuration. - * - * @param httpLogs the httpLogs value to set. - * @return the SiteLogsConfigProperties object itself. - */ - public SiteLogsConfigProperties withHttpLogs(HttpLogsConfig httpLogs) { - this.httpLogs = httpLogs; - return this; - } - - /** - * Get the failedRequestsTracing property: Failed requests tracing configuration. - * - * @return the failedRequestsTracing value. - */ - public EnabledConfig failedRequestsTracing() { - return this.failedRequestsTracing; - } - - /** - * Set the failedRequestsTracing property: Failed requests tracing configuration. - * - * @param failedRequestsTracing the failedRequestsTracing value to set. - * @return the SiteLogsConfigProperties object itself. - */ - public SiteLogsConfigProperties withFailedRequestsTracing(EnabledConfig failedRequestsTracing) { - this.failedRequestsTracing = failedRequestsTracing; - return this; - } - - /** - * Get the detailedErrorMessages property: Detailed error messages configuration. - * - * @return the detailedErrorMessages value. - */ - public EnabledConfig detailedErrorMessages() { - return this.detailedErrorMessages; - } - - /** - * Set the detailedErrorMessages property: Detailed error messages configuration. - * - * @param detailedErrorMessages the detailedErrorMessages value to set. - * @return the SiteLogsConfigProperties object itself. - */ - public SiteLogsConfigProperties withDetailedErrorMessages(EnabledConfig detailedErrorMessages) { - this.detailedErrorMessages = detailedErrorMessages; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (applicationLogs() != null) { - applicationLogs().validate(); - } - if (httpLogs() != null) { - httpLogs().validate(); - } - if (failedRequestsTracing() != null) { - failedRequestsTracing().validate(); - } - if (detailedErrorMessages() != null) { - detailedErrorMessages().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SitePatchResourceInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SitePatchResourceInner.java deleted file mode 100644 index 93699d546439..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SitePatchResourceInner.java +++ /dev/null @@ -1,718 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.CloningInfo; -import com.azure.resourcemanager.appservice.models.GeoDistribution; -import com.azure.resourcemanager.appservice.models.HostingEnvironmentProfile; -import com.azure.resourcemanager.appservice.models.HostnameSslState; -import com.azure.resourcemanager.appservice.models.ManagedServiceIdentity; -import com.azure.resourcemanager.appservice.models.ProxyOnlyResource; -import com.azure.resourcemanager.appservice.models.RedundancyMode; -import com.azure.resourcemanager.appservice.models.SiteAvailabilityState; -import com.azure.resourcemanager.appservice.models.SlotSwapStatus; -import com.azure.resourcemanager.appservice.models.UsageState; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; -import java.util.UUID; - -/** ARM resource for a site. */ -@Fluent -public final class SitePatchResourceInner extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SitePatchResourceInner.class); - - /* - * SitePatchResource resource specific properties - */ - @JsonProperty(value = "properties") - private SitePatchResourcePropertiesInner innerProperties; - - /* - * Managed service identity. - */ - @JsonProperty(value = "identity") - private ManagedServiceIdentity identity; - - /** - * Get the innerProperties property: SitePatchResource resource specific properties. - * - * @return the innerProperties value. - */ - private SitePatchResourcePropertiesInner innerProperties() { - return this.innerProperties; - } - - /** - * Get the identity property: Managed service identity. - * - * @return the identity value. - */ - public ManagedServiceIdentity identity() { - return this.identity; - } - - /** - * Set the identity property: Managed service identity. - * - * @param identity the identity value to set. - * @return the SitePatchResourceInner object itself. - */ - public SitePatchResourceInner withIdentity(ManagedServiceIdentity identity) { - this.identity = identity; - return this; - } - - /** {@inheritDoc} */ - @Override - public SitePatchResourceInner withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the state property: Current state of the app. - * - * @return the state value. - */ - public String state() { - return this.innerProperties() == null ? null : this.innerProperties().state(); - } - - /** - * Get the hostNames property: Hostnames associated with the app. - * - * @return the hostNames value. - */ - public List hostNames() { - return this.innerProperties() == null ? null : this.innerProperties().hostNames(); - } - - /** - * Get the repositorySiteName property: Name of the repository site. - * - * @return the repositorySiteName value. - */ - public String repositorySiteName() { - return this.innerProperties() == null ? null : this.innerProperties().repositorySiteName(); - } - - /** - * Get the usageState property: State indicating whether the app has exceeded its quota usage. Read-only. - * - * @return the usageState value. - */ - public UsageState usageState() { - return this.innerProperties() == null ? null : this.innerProperties().usageState(); - } - - /** - * Get the enabled property: <code>true</code> if the app is enabled; otherwise, - * <code>false</code>. Setting this value to false disables the app (takes the app offline). - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.innerProperties() == null ? null : this.innerProperties().enabled(); - } - - /** - * Set the enabled property: <code>true</code> if the app is enabled; otherwise, - * <code>false</code>. Setting this value to false disables the app (takes the app offline). - * - * @param enabled the enabled value to set. - * @return the SitePatchResourceInner object itself. - */ - public SitePatchResourceInner withEnabled(Boolean enabled) { - if (this.innerProperties() == null) { - this.innerProperties = new SitePatchResourcePropertiesInner(); - } - this.innerProperties().withEnabled(enabled); - return this; - } - - /** - * Get the enabledHostNames property: Enabled hostnames for the app.Hostnames need to be assigned (see HostNames) - * AND enabled. Otherwise, the app is not served on those hostnames. - * - * @return the enabledHostNames value. - */ - public List enabledHostNames() { - return this.innerProperties() == null ? null : this.innerProperties().enabledHostNames(); - } - - /** - * Get the availabilityState property: Management information availability state for the app. - * - * @return the availabilityState value. - */ - public SiteAvailabilityState availabilityState() { - return this.innerProperties() == null ? null : this.innerProperties().availabilityState(); - } - - /** - * Get the hostnameSslStates property: Hostname SSL states are used to manage the SSL bindings for app's hostnames. - * - * @return the hostnameSslStates value. - */ - public List hostnameSslStates() { - return this.innerProperties() == null ? null : this.innerProperties().hostnameSslStates(); - } - - /** - * Set the hostnameSslStates property: Hostname SSL states are used to manage the SSL bindings for app's hostnames. - * - * @param hostnameSslStates the hostnameSslStates value to set. - * @return the SitePatchResourceInner object itself. - */ - public SitePatchResourceInner withHostnameSslStates(List hostnameSslStates) { - if (this.innerProperties() == null) { - this.innerProperties = new SitePatchResourcePropertiesInner(); - } - this.innerProperties().withHostnameSslStates(hostnameSslStates); - return this; - } - - /** - * Get the serverFarmId property: Resource ID of the associated App Service plan, formatted as: - * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms" - + "/{appServicePlanName}". - * - * @return the serverFarmId value. - */ - public String serverFarmId() { - return this.innerProperties() == null ? null : this.innerProperties().serverFarmId(); - } - - /** - * Set the serverFarmId property: Resource ID of the associated App Service plan, formatted as: - * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms" - + "/{appServicePlanName}". - * - * @param serverFarmId the serverFarmId value to set. - * @return the SitePatchResourceInner object itself. - */ - public SitePatchResourceInner withServerFarmId(String serverFarmId) { - if (this.innerProperties() == null) { - this.innerProperties = new SitePatchResourcePropertiesInner(); - } - this.innerProperties().withServerFarmId(serverFarmId); - return this; - } - - /** - * Get the reserved property: <code>true</code> if reserved; otherwise, <code>false</code>. - * - * @return the reserved value. - */ - public Boolean reserved() { - return this.innerProperties() == null ? null : this.innerProperties().reserved(); - } - - /** - * Set the reserved property: <code>true</code> if reserved; otherwise, <code>false</code>. - * - * @param reserved the reserved value to set. - * @return the SitePatchResourceInner object itself. - */ - public SitePatchResourceInner withReserved(Boolean reserved) { - if (this.innerProperties() == null) { - this.innerProperties = new SitePatchResourcePropertiesInner(); - } - this.innerProperties().withReserved(reserved); - return this; - } - - /** - * Get the isXenon property: Obsolete: Hyper-V sandbox. - * - * @return the isXenon value. - */ - public Boolean isXenon() { - return this.innerProperties() == null ? null : this.innerProperties().isXenon(); - } - - /** - * Set the isXenon property: Obsolete: Hyper-V sandbox. - * - * @param isXenon the isXenon value to set. - * @return the SitePatchResourceInner object itself. - */ - public SitePatchResourceInner withIsXenon(Boolean isXenon) { - if (this.innerProperties() == null) { - this.innerProperties = new SitePatchResourcePropertiesInner(); - } - this.innerProperties().withIsXenon(isXenon); - return this; - } - - /** - * Get the hyperV property: Hyper-V sandbox. - * - * @return the hyperV value. - */ - public Boolean hyperV() { - return this.innerProperties() == null ? null : this.innerProperties().hyperV(); - } - - /** - * Set the hyperV property: Hyper-V sandbox. - * - * @param hyperV the hyperV value to set. - * @return the SitePatchResourceInner object itself. - */ - public SitePatchResourceInner withHyperV(Boolean hyperV) { - if (this.innerProperties() == null) { - this.innerProperties = new SitePatchResourcePropertiesInner(); - } - this.innerProperties().withHyperV(hyperV); - return this; - } - - /** - * Get the lastModifiedTimeUtc property: Last time the app was modified, in UTC. Read-only. - * - * @return the lastModifiedTimeUtc value. - */ - public OffsetDateTime lastModifiedTimeUtc() { - return this.innerProperties() == null ? null : this.innerProperties().lastModifiedTimeUtc(); - } - - /** - * Get the siteConfig property: Configuration of the app. - * - * @return the siteConfig value. - */ - public SiteConfigInner siteConfig() { - return this.innerProperties() == null ? null : this.innerProperties().siteConfig(); - } - - /** - * Set the siteConfig property: Configuration of the app. - * - * @param siteConfig the siteConfig value to set. - * @return the SitePatchResourceInner object itself. - */ - public SitePatchResourceInner withSiteConfig(SiteConfigInner siteConfig) { - if (this.innerProperties() == null) { - this.innerProperties = new SitePatchResourcePropertiesInner(); - } - this.innerProperties().withSiteConfig(siteConfig); - return this; - } - - /** - * Get the trafficManagerHostNames property: Azure Traffic Manager hostnames associated with the app. Read-only. - * - * @return the trafficManagerHostNames value. - */ - public List trafficManagerHostNames() { - return this.innerProperties() == null ? null : this.innerProperties().trafficManagerHostNames(); - } - - /** - * Get the scmSiteAlsoStopped property: <code>true</code> to stop SCM (KUDU) site when the app is - * stopped; otherwise, <code>false</code>. The default is <code>false</code>. - * - * @return the scmSiteAlsoStopped value. - */ - public Boolean scmSiteAlsoStopped() { - return this.innerProperties() == null ? null : this.innerProperties().scmSiteAlsoStopped(); - } - - /** - * Set the scmSiteAlsoStopped property: <code>true</code> to stop SCM (KUDU) site when the app is - * stopped; otherwise, <code>false</code>. The default is <code>false</code>. - * - * @param scmSiteAlsoStopped the scmSiteAlsoStopped value to set. - * @return the SitePatchResourceInner object itself. - */ - public SitePatchResourceInner withScmSiteAlsoStopped(Boolean scmSiteAlsoStopped) { - if (this.innerProperties() == null) { - this.innerProperties = new SitePatchResourcePropertiesInner(); - } - this.innerProperties().withScmSiteAlsoStopped(scmSiteAlsoStopped); - return this; - } - - /** - * Get the targetSwapSlot property: Specifies which deployment slot this app will swap into. Read-only. - * - * @return the targetSwapSlot value. - */ - public String targetSwapSlot() { - return this.innerProperties() == null ? null : this.innerProperties().targetSwapSlot(); - } - - /** - * Get the hostingEnvironmentProfile property: App Service Environment to use for the app. - * - * @return the hostingEnvironmentProfile value. - */ - public HostingEnvironmentProfile hostingEnvironmentProfile() { - return this.innerProperties() == null ? null : this.innerProperties().hostingEnvironmentProfile(); - } - - /** - * Set the hostingEnvironmentProfile property: App Service Environment to use for the app. - * - * @param hostingEnvironmentProfile the hostingEnvironmentProfile value to set. - * @return the SitePatchResourceInner object itself. - */ - public SitePatchResourceInner withHostingEnvironmentProfile(HostingEnvironmentProfile hostingEnvironmentProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new SitePatchResourcePropertiesInner(); - } - this.innerProperties().withHostingEnvironmentProfile(hostingEnvironmentProfile); - return this; - } - - /** - * Get the clientAffinityEnabled property: <code>true</code> to enable client affinity; - * <code>false</code> to stop sending session affinity cookies, which route client requests in the same - * session to the same instance. Default is <code>true</code>. - * - * @return the clientAffinityEnabled value. - */ - public Boolean clientAffinityEnabled() { - return this.innerProperties() == null ? null : this.innerProperties().clientAffinityEnabled(); - } - - /** - * Set the clientAffinityEnabled property: <code>true</code> to enable client affinity; - * <code>false</code> to stop sending session affinity cookies, which route client requests in the same - * session to the same instance. Default is <code>true</code>. - * - * @param clientAffinityEnabled the clientAffinityEnabled value to set. - * @return the SitePatchResourceInner object itself. - */ - public SitePatchResourceInner withClientAffinityEnabled(Boolean clientAffinityEnabled) { - if (this.innerProperties() == null) { - this.innerProperties = new SitePatchResourcePropertiesInner(); - } - this.innerProperties().withClientAffinityEnabled(clientAffinityEnabled); - return this; - } - - /** - * Get the clientCertEnabled property: <code>true</code> to enable client certificate authentication - * (TLS mutual authentication); otherwise, <code>false</code>. Default is - * <code>false</code>. - * - * @return the clientCertEnabled value. - */ - public Boolean clientCertEnabled() { - return this.innerProperties() == null ? null : this.innerProperties().clientCertEnabled(); - } - - /** - * Set the clientCertEnabled property: <code>true</code> to enable client certificate authentication - * (TLS mutual authentication); otherwise, <code>false</code>. Default is - * <code>false</code>. - * - * @param clientCertEnabled the clientCertEnabled value to set. - * @return the SitePatchResourceInner object itself. - */ - public SitePatchResourceInner withClientCertEnabled(Boolean clientCertEnabled) { - if (this.innerProperties() == null) { - this.innerProperties = new SitePatchResourcePropertiesInner(); - } - this.innerProperties().withClientCertEnabled(clientCertEnabled); - return this; - } - - /** - * Get the clientCertExclusionPaths property: client certificate authentication comma-separated exclusion paths. - * - * @return the clientCertExclusionPaths value. - */ - public String clientCertExclusionPaths() { - return this.innerProperties() == null ? null : this.innerProperties().clientCertExclusionPaths(); - } - - /** - * Set the clientCertExclusionPaths property: client certificate authentication comma-separated exclusion paths. - * - * @param clientCertExclusionPaths the clientCertExclusionPaths value to set. - * @return the SitePatchResourceInner object itself. - */ - public SitePatchResourceInner withClientCertExclusionPaths(String clientCertExclusionPaths) { - if (this.innerProperties() == null) { - this.innerProperties = new SitePatchResourcePropertiesInner(); - } - this.innerProperties().withClientCertExclusionPaths(clientCertExclusionPaths); - return this; - } - - /** - * Get the hostNamesDisabled property: <code>true</code> to disable the public hostnames of the app; - * otherwise, <code>false</code>. If <code>true</code>, the app is only accessible via API - * management process. - * - * @return the hostNamesDisabled value. - */ - public Boolean hostNamesDisabled() { - return this.innerProperties() == null ? null : this.innerProperties().hostNamesDisabled(); - } - - /** - * Set the hostNamesDisabled property: <code>true</code> to disable the public hostnames of the app; - * otherwise, <code>false</code>. If <code>true</code>, the app is only accessible via API - * management process. - * - * @param hostNamesDisabled the hostNamesDisabled value to set. - * @return the SitePatchResourceInner object itself. - */ - public SitePatchResourceInner withHostNamesDisabled(Boolean hostNamesDisabled) { - if (this.innerProperties() == null) { - this.innerProperties = new SitePatchResourcePropertiesInner(); - } - this.innerProperties().withHostNamesDisabled(hostNamesDisabled); - return this; - } - - /** - * Get the outboundIpAddresses property: List of IP addresses that the app uses for outbound connections (e.g. - * database access). Includes VIPs from tenants that site can be hosted with current settings. Read-only. - * - * @return the outboundIpAddresses value. - */ - public String outboundIpAddresses() { - return this.innerProperties() == null ? null : this.innerProperties().outboundIpAddresses(); - } - - /** - * Get the possibleOutboundIpAddresses property: List of IP addresses that the app uses for outbound connections - * (e.g. database access). Includes VIPs from all tenants. Read-only. - * - * @return the possibleOutboundIpAddresses value. - */ - public String possibleOutboundIpAddresses() { - return this.innerProperties() == null ? null : this.innerProperties().possibleOutboundIpAddresses(); - } - - /** - * Get the containerSize property: Size of the function container. - * - * @return the containerSize value. - */ - public Integer containerSize() { - return this.innerProperties() == null ? null : this.innerProperties().containerSize(); - } - - /** - * Set the containerSize property: Size of the function container. - * - * @param containerSize the containerSize value to set. - * @return the SitePatchResourceInner object itself. - */ - public SitePatchResourceInner withContainerSize(Integer containerSize) { - if (this.innerProperties() == null) { - this.innerProperties = new SitePatchResourcePropertiesInner(); - } - this.innerProperties().withContainerSize(containerSize); - return this; - } - - /** - * Get the dailyMemoryTimeQuota property: Maximum allowed daily memory-time quota (applicable on dynamic apps only). - * - * @return the dailyMemoryTimeQuota value. - */ - public Integer dailyMemoryTimeQuota() { - return this.innerProperties() == null ? null : this.innerProperties().dailyMemoryTimeQuota(); - } - - /** - * Set the dailyMemoryTimeQuota property: Maximum allowed daily memory-time quota (applicable on dynamic apps only). - * - * @param dailyMemoryTimeQuota the dailyMemoryTimeQuota value to set. - * @return the SitePatchResourceInner object itself. - */ - public SitePatchResourceInner withDailyMemoryTimeQuota(Integer dailyMemoryTimeQuota) { - if (this.innerProperties() == null) { - this.innerProperties = new SitePatchResourcePropertiesInner(); - } - this.innerProperties().withDailyMemoryTimeQuota(dailyMemoryTimeQuota); - return this; - } - - /** - * Get the suspendedTill property: App suspended till in case memory-time quota is exceeded. - * - * @return the suspendedTill value. - */ - public OffsetDateTime suspendedTill() { - return this.innerProperties() == null ? null : this.innerProperties().suspendedTill(); - } - - /** - * Get the maxNumberOfWorkers property: Maximum number of workers. This only applies to Functions container. - * - * @return the maxNumberOfWorkers value. - */ - public Integer maxNumberOfWorkers() { - return this.innerProperties() == null ? null : this.innerProperties().maxNumberOfWorkers(); - } - - /** - * Get the cloningInfo property: If specified during app creation, the app is cloned from a source app. - * - * @return the cloningInfo value. - */ - public CloningInfo cloningInfo() { - return this.innerProperties() == null ? null : this.innerProperties().cloningInfo(); - } - - /** - * Set the cloningInfo property: If specified during app creation, the app is cloned from a source app. - * - * @param cloningInfo the cloningInfo value to set. - * @return the SitePatchResourceInner object itself. - */ - public SitePatchResourceInner withCloningInfo(CloningInfo cloningInfo) { - if (this.innerProperties() == null) { - this.innerProperties = new SitePatchResourcePropertiesInner(); - } - this.innerProperties().withCloningInfo(cloningInfo); - return this; - } - - /** - * Get the resourceGroup property: Name of the resource group the app belongs to. Read-only. - * - * @return the resourceGroup value. - */ - public String resourceGroup() { - return this.innerProperties() == null ? null : this.innerProperties().resourceGroup(); - } - - /** - * Get the isDefaultContainer property: <code>true</code> if the app is a default container; otherwise, - * <code>false</code>. - * - * @return the isDefaultContainer value. - */ - public Boolean isDefaultContainer() { - return this.innerProperties() == null ? null : this.innerProperties().isDefaultContainer(); - } - - /** - * Get the defaultHostname property: Default hostname of the app. Read-only. - * - * @return the defaultHostname value. - */ - public String defaultHostname() { - return this.innerProperties() == null ? null : this.innerProperties().defaultHostname(); - } - - /** - * Get the slotSwapStatus property: Status of the last deployment slot swap operation. - * - * @return the slotSwapStatus value. - */ - public SlotSwapStatus slotSwapStatus() { - return this.innerProperties() == null ? null : this.innerProperties().slotSwapStatus(); - } - - /** - * Get the httpsOnly property: HttpsOnly: configures a web site to accept only https requests. Issues redirect for - * http requests. - * - * @return the httpsOnly value. - */ - public Boolean httpsOnly() { - return this.innerProperties() == null ? null : this.innerProperties().httpsOnly(); - } - - /** - * Set the httpsOnly property: HttpsOnly: configures a web site to accept only https requests. Issues redirect for - * http requests. - * - * @param httpsOnly the httpsOnly value to set. - * @return the SitePatchResourceInner object itself. - */ - public SitePatchResourceInner withHttpsOnly(Boolean httpsOnly) { - if (this.innerProperties() == null) { - this.innerProperties = new SitePatchResourcePropertiesInner(); - } - this.innerProperties().withHttpsOnly(httpsOnly); - return this; - } - - /** - * Get the redundancyMode property: Site redundancy mode. - * - * @return the redundancyMode value. - */ - public RedundancyMode redundancyMode() { - return this.innerProperties() == null ? null : this.innerProperties().redundancyMode(); - } - - /** - * Set the redundancyMode property: Site redundancy mode. - * - * @param redundancyMode the redundancyMode value to set. - * @return the SitePatchResourceInner object itself. - */ - public SitePatchResourceInner withRedundancyMode(RedundancyMode redundancyMode) { - if (this.innerProperties() == null) { - this.innerProperties = new SitePatchResourcePropertiesInner(); - } - this.innerProperties().withRedundancyMode(redundancyMode); - return this; - } - - /** - * Get the inProgressOperationId property: Specifies an operation id if this site has a pending operation. - * - * @return the inProgressOperationId value. - */ - public UUID inProgressOperationId() { - return this.innerProperties() == null ? null : this.innerProperties().inProgressOperationId(); - } - - /** - * Get the geoDistributions property: GeoDistributions for this site. - * - * @return the geoDistributions value. - */ - public List geoDistributions() { - return this.innerProperties() == null ? null : this.innerProperties().geoDistributions(); - } - - /** - * Set the geoDistributions property: GeoDistributions for this site. - * - * @param geoDistributions the geoDistributions value to set. - * @return the SitePatchResourceInner object itself. - */ - public SitePatchResourceInner withGeoDistributions(List geoDistributions) { - if (this.innerProperties() == null) { - this.innerProperties = new SitePatchResourcePropertiesInner(); - } - this.innerProperties().withGeoDistributions(geoDistributions); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - if (identity() != null) { - identity().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SitePatchResourcePropertiesInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SitePatchResourcePropertiesInner.java deleted file mode 100644 index a410cd8d2671..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SitePatchResourcePropertiesInner.java +++ /dev/null @@ -1,867 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.CloningInfo; -import com.azure.resourcemanager.appservice.models.GeoDistribution; -import com.azure.resourcemanager.appservice.models.HostingEnvironmentProfile; -import com.azure.resourcemanager.appservice.models.HostnameSslState; -import com.azure.resourcemanager.appservice.models.RedundancyMode; -import com.azure.resourcemanager.appservice.models.SiteAvailabilityState; -import com.azure.resourcemanager.appservice.models.SlotSwapStatus; -import com.azure.resourcemanager.appservice.models.UsageState; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; -import java.util.UUID; - -/** SitePatchResource resource specific properties. */ -@Fluent -public final class SitePatchResourcePropertiesInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SitePatchResourcePropertiesInner.class); - - /* - * Current state of the app. - */ - @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) - private String state; - - /* - * Hostnames associated with the app. - */ - @JsonProperty(value = "hostNames", access = JsonProperty.Access.WRITE_ONLY) - private List hostNames; - - /* - * Name of the repository site. - */ - @JsonProperty(value = "repositorySiteName", access = JsonProperty.Access.WRITE_ONLY) - private String repositorySiteName; - - /* - * State indicating whether the app has exceeded its quota usage. - * Read-only. - */ - @JsonProperty(value = "usageState", access = JsonProperty.Access.WRITE_ONLY) - private UsageState usageState; - - /* - * true if the app is enabled; otherwise, false. - * Setting this value to false disables the app (takes the app offline). - */ - @JsonProperty(value = "enabled") - private Boolean enabled; - - /* - * Enabled hostnames for the app.Hostnames need to be assigned (see - * HostNames) AND enabled. Otherwise, - * the app is not served on those hostnames. - */ - @JsonProperty(value = "enabledHostNames", access = JsonProperty.Access.WRITE_ONLY) - private List enabledHostNames; - - /* - * Management information availability state for the app. - */ - @JsonProperty(value = "availabilityState", access = JsonProperty.Access.WRITE_ONLY) - private SiteAvailabilityState availabilityState; - - /* - * Hostname SSL states are used to manage the SSL bindings for app's - * hostnames. - */ - @JsonProperty(value = "hostNameSslStates") - private List hostnameSslStates; - - /* - * Resource ID of the associated App Service plan, formatted as: - * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms" - + "/{appServicePlanName}". - */ - @JsonProperty(value = "serverFarmId") - private String serverFarmId; - - /* - * true if reserved; otherwise, false. - */ - @JsonProperty(value = "reserved") - private Boolean reserved; - - /* - * Obsolete: Hyper-V sandbox. - */ - @JsonProperty(value = "isXenon") - private Boolean isXenon; - - /* - * Hyper-V sandbox. - */ - @JsonProperty(value = "hyperV") - private Boolean hyperV; - - /* - * Last time the app was modified, in UTC. Read-only. - */ - @JsonProperty(value = "lastModifiedTimeUtc", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime lastModifiedTimeUtc; - - /* - * Configuration of the app. - */ - @JsonProperty(value = "siteConfig") - private SiteConfigInner siteConfig; - - /* - * Azure Traffic Manager hostnames associated with the app. Read-only. - */ - @JsonProperty(value = "trafficManagerHostNames", access = JsonProperty.Access.WRITE_ONLY) - private List trafficManagerHostNames; - - /* - * true to stop SCM (KUDU) site when the app is stopped; - * otherwise, false. The default is false. - */ - @JsonProperty(value = "scmSiteAlsoStopped") - private Boolean scmSiteAlsoStopped; - - /* - * Specifies which deployment slot this app will swap into. Read-only. - */ - @JsonProperty(value = "targetSwapSlot", access = JsonProperty.Access.WRITE_ONLY) - private String targetSwapSlot; - - /* - * App Service Environment to use for the app. - */ - @JsonProperty(value = "hostingEnvironmentProfile") - private HostingEnvironmentProfile hostingEnvironmentProfile; - - /* - * true to enable client affinity; false to stop - * sending session affinity cookies, which route client requests in the - * same session to the same instance. Default is true. - */ - @JsonProperty(value = "clientAffinityEnabled") - private Boolean clientAffinityEnabled; - - /* - * true to enable client certificate authentication (TLS - * mutual authentication); otherwise, false. Default is - * false. - */ - @JsonProperty(value = "clientCertEnabled") - private Boolean clientCertEnabled; - - /* - * client certificate authentication comma-separated exclusion paths - */ - @JsonProperty(value = "clientCertExclusionPaths") - private String clientCertExclusionPaths; - - /* - * true to disable the public hostnames of the app; otherwise, - * false. - * If true, the app is only accessible via API management - * process. - */ - @JsonProperty(value = "hostNamesDisabled") - private Boolean hostNamesDisabled; - - /* - * List of IP addresses that the app uses for outbound connections (e.g. - * database access). Includes VIPs from tenants that site can be hosted - * with current settings. Read-only. - */ - @JsonProperty(value = "outboundIpAddresses", access = JsonProperty.Access.WRITE_ONLY) - private String outboundIpAddresses; - - /* - * List of IP addresses that the app uses for outbound connections (e.g. - * database access). Includes VIPs from all tenants. Read-only. - */ - @JsonProperty(value = "possibleOutboundIpAddresses", access = JsonProperty.Access.WRITE_ONLY) - private String possibleOutboundIpAddresses; - - /* - * Size of the function container. - */ - @JsonProperty(value = "containerSize") - private Integer containerSize; - - /* - * Maximum allowed daily memory-time quota (applicable on dynamic apps - * only). - */ - @JsonProperty(value = "dailyMemoryTimeQuota") - private Integer dailyMemoryTimeQuota; - - /* - * App suspended till in case memory-time quota is exceeded. - */ - @JsonProperty(value = "suspendedTill", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime suspendedTill; - - /* - * Maximum number of workers. - * This only applies to Functions container. - */ - @JsonProperty(value = "maxNumberOfWorkers", access = JsonProperty.Access.WRITE_ONLY) - private Integer maxNumberOfWorkers; - - /* - * If specified during app creation, the app is cloned from a source app. - */ - @JsonProperty(value = "cloningInfo") - private CloningInfo cloningInfo; - - /* - * Name of the resource group the app belongs to. Read-only. - */ - @JsonProperty(value = "resourceGroup", access = JsonProperty.Access.WRITE_ONLY) - private String resourceGroup; - - /* - * true if the app is a default container; otherwise, - * false. - */ - @JsonProperty(value = "isDefaultContainer", access = JsonProperty.Access.WRITE_ONLY) - private Boolean isDefaultContainer; - - /* - * Default hostname of the app. Read-only. - */ - @JsonProperty(value = "defaultHostName", access = JsonProperty.Access.WRITE_ONLY) - private String defaultHostname; - - /* - * Status of the last deployment slot swap operation. - */ - @JsonProperty(value = "slotSwapStatus", access = JsonProperty.Access.WRITE_ONLY) - private SlotSwapStatus slotSwapStatus; - - /* - * HttpsOnly: configures a web site to accept only https requests. Issues - * redirect for - * http requests - */ - @JsonProperty(value = "httpsOnly") - private Boolean httpsOnly; - - /* - * Site redundancy mode - */ - @JsonProperty(value = "redundancyMode") - private RedundancyMode redundancyMode; - - /* - * Specifies an operation id if this site has a pending operation. - */ - @JsonProperty(value = "inProgressOperationId", access = JsonProperty.Access.WRITE_ONLY) - private UUID inProgressOperationId; - - /* - * GeoDistributions for this site - */ - @JsonProperty(value = "geoDistributions") - private List geoDistributions; - - /** - * Get the state property: Current state of the app. - * - * @return the state value. - */ - public String state() { - return this.state; - } - - /** - * Get the hostNames property: Hostnames associated with the app. - * - * @return the hostNames value. - */ - public List hostNames() { - return this.hostNames; - } - - /** - * Get the repositorySiteName property: Name of the repository site. - * - * @return the repositorySiteName value. - */ - public String repositorySiteName() { - return this.repositorySiteName; - } - - /** - * Get the usageState property: State indicating whether the app has exceeded its quota usage. Read-only. - * - * @return the usageState value. - */ - public UsageState usageState() { - return this.usageState; - } - - /** - * Get the enabled property: <code>true</code> if the app is enabled; otherwise, - * <code>false</code>. Setting this value to false disables the app (takes the app offline). - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: <code>true</code> if the app is enabled; otherwise, - * <code>false</code>. Setting this value to false disables the app (takes the app offline). - * - * @param enabled the enabled value to set. - * @return the SitePatchResourcePropertiesInner object itself. - */ - public SitePatchResourcePropertiesInner withEnabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the enabledHostNames property: Enabled hostnames for the app.Hostnames need to be assigned (see HostNames) - * AND enabled. Otherwise, the app is not served on those hostnames. - * - * @return the enabledHostNames value. - */ - public List enabledHostNames() { - return this.enabledHostNames; - } - - /** - * Get the availabilityState property: Management information availability state for the app. - * - * @return the availabilityState value. - */ - public SiteAvailabilityState availabilityState() { - return this.availabilityState; - } - - /** - * Get the hostnameSslStates property: Hostname SSL states are used to manage the SSL bindings for app's hostnames. - * - * @return the hostnameSslStates value. - */ - public List hostnameSslStates() { - return this.hostnameSslStates; - } - - /** - * Set the hostnameSslStates property: Hostname SSL states are used to manage the SSL bindings for app's hostnames. - * - * @param hostnameSslStates the hostnameSslStates value to set. - * @return the SitePatchResourcePropertiesInner object itself. - */ - public SitePatchResourcePropertiesInner withHostnameSslStates(List hostnameSslStates) { - this.hostnameSslStates = hostnameSslStates; - return this; - } - - /** - * Get the serverFarmId property: Resource ID of the associated App Service plan, formatted as: - * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms" - + "/{appServicePlanName}". - * - * @return the serverFarmId value. - */ - public String serverFarmId() { - return this.serverFarmId; - } - - /** - * Set the serverFarmId property: Resource ID of the associated App Service plan, formatted as: - * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms" - + "/{appServicePlanName}". - * - * @param serverFarmId the serverFarmId value to set. - * @return the SitePatchResourcePropertiesInner object itself. - */ - public SitePatchResourcePropertiesInner withServerFarmId(String serverFarmId) { - this.serverFarmId = serverFarmId; - return this; - } - - /** - * Get the reserved property: <code>true</code> if reserved; otherwise, <code>false</code>. - * - * @return the reserved value. - */ - public Boolean reserved() { - return this.reserved; - } - - /** - * Set the reserved property: <code>true</code> if reserved; otherwise, <code>false</code>. - * - * @param reserved the reserved value to set. - * @return the SitePatchResourcePropertiesInner object itself. - */ - public SitePatchResourcePropertiesInner withReserved(Boolean reserved) { - this.reserved = reserved; - return this; - } - - /** - * Get the isXenon property: Obsolete: Hyper-V sandbox. - * - * @return the isXenon value. - */ - public Boolean isXenon() { - return this.isXenon; - } - - /** - * Set the isXenon property: Obsolete: Hyper-V sandbox. - * - * @param isXenon the isXenon value to set. - * @return the SitePatchResourcePropertiesInner object itself. - */ - public SitePatchResourcePropertiesInner withIsXenon(Boolean isXenon) { - this.isXenon = isXenon; - return this; - } - - /** - * Get the hyperV property: Hyper-V sandbox. - * - * @return the hyperV value. - */ - public Boolean hyperV() { - return this.hyperV; - } - - /** - * Set the hyperV property: Hyper-V sandbox. - * - * @param hyperV the hyperV value to set. - * @return the SitePatchResourcePropertiesInner object itself. - */ - public SitePatchResourcePropertiesInner withHyperV(Boolean hyperV) { - this.hyperV = hyperV; - return this; - } - - /** - * Get the lastModifiedTimeUtc property: Last time the app was modified, in UTC. Read-only. - * - * @return the lastModifiedTimeUtc value. - */ - public OffsetDateTime lastModifiedTimeUtc() { - return this.lastModifiedTimeUtc; - } - - /** - * Get the siteConfig property: Configuration of the app. - * - * @return the siteConfig value. - */ - public SiteConfigInner siteConfig() { - return this.siteConfig; - } - - /** - * Set the siteConfig property: Configuration of the app. - * - * @param siteConfig the siteConfig value to set. - * @return the SitePatchResourcePropertiesInner object itself. - */ - public SitePatchResourcePropertiesInner withSiteConfig(SiteConfigInner siteConfig) { - this.siteConfig = siteConfig; - return this; - } - - /** - * Get the trafficManagerHostNames property: Azure Traffic Manager hostnames associated with the app. Read-only. - * - * @return the trafficManagerHostNames value. - */ - public List trafficManagerHostNames() { - return this.trafficManagerHostNames; - } - - /** - * Get the scmSiteAlsoStopped property: <code>true</code> to stop SCM (KUDU) site when the app is - * stopped; otherwise, <code>false</code>. The default is <code>false</code>. - * - * @return the scmSiteAlsoStopped value. - */ - public Boolean scmSiteAlsoStopped() { - return this.scmSiteAlsoStopped; - } - - /** - * Set the scmSiteAlsoStopped property: <code>true</code> to stop SCM (KUDU) site when the app is - * stopped; otherwise, <code>false</code>. The default is <code>false</code>. - * - * @param scmSiteAlsoStopped the scmSiteAlsoStopped value to set. - * @return the SitePatchResourcePropertiesInner object itself. - */ - public SitePatchResourcePropertiesInner withScmSiteAlsoStopped(Boolean scmSiteAlsoStopped) { - this.scmSiteAlsoStopped = scmSiteAlsoStopped; - return this; - } - - /** - * Get the targetSwapSlot property: Specifies which deployment slot this app will swap into. Read-only. - * - * @return the targetSwapSlot value. - */ - public String targetSwapSlot() { - return this.targetSwapSlot; - } - - /** - * Get the hostingEnvironmentProfile property: App Service Environment to use for the app. - * - * @return the hostingEnvironmentProfile value. - */ - public HostingEnvironmentProfile hostingEnvironmentProfile() { - return this.hostingEnvironmentProfile; - } - - /** - * Set the hostingEnvironmentProfile property: App Service Environment to use for the app. - * - * @param hostingEnvironmentProfile the hostingEnvironmentProfile value to set. - * @return the SitePatchResourcePropertiesInner object itself. - */ - public SitePatchResourcePropertiesInner withHostingEnvironmentProfile( - HostingEnvironmentProfile hostingEnvironmentProfile) { - this.hostingEnvironmentProfile = hostingEnvironmentProfile; - return this; - } - - /** - * Get the clientAffinityEnabled property: <code>true</code> to enable client affinity; - * <code>false</code> to stop sending session affinity cookies, which route client requests in the same - * session to the same instance. Default is <code>true</code>. - * - * @return the clientAffinityEnabled value. - */ - public Boolean clientAffinityEnabled() { - return this.clientAffinityEnabled; - } - - /** - * Set the clientAffinityEnabled property: <code>true</code> to enable client affinity; - * <code>false</code> to stop sending session affinity cookies, which route client requests in the same - * session to the same instance. Default is <code>true</code>. - * - * @param clientAffinityEnabled the clientAffinityEnabled value to set. - * @return the SitePatchResourcePropertiesInner object itself. - */ - public SitePatchResourcePropertiesInner withClientAffinityEnabled(Boolean clientAffinityEnabled) { - this.clientAffinityEnabled = clientAffinityEnabled; - return this; - } - - /** - * Get the clientCertEnabled property: <code>true</code> to enable client certificate authentication - * (TLS mutual authentication); otherwise, <code>false</code>. Default is - * <code>false</code>. - * - * @return the clientCertEnabled value. - */ - public Boolean clientCertEnabled() { - return this.clientCertEnabled; - } - - /** - * Set the clientCertEnabled property: <code>true</code> to enable client certificate authentication - * (TLS mutual authentication); otherwise, <code>false</code>. Default is - * <code>false</code>. - * - * @param clientCertEnabled the clientCertEnabled value to set. - * @return the SitePatchResourcePropertiesInner object itself. - */ - public SitePatchResourcePropertiesInner withClientCertEnabled(Boolean clientCertEnabled) { - this.clientCertEnabled = clientCertEnabled; - return this; - } - - /** - * Get the clientCertExclusionPaths property: client certificate authentication comma-separated exclusion paths. - * - * @return the clientCertExclusionPaths value. - */ - public String clientCertExclusionPaths() { - return this.clientCertExclusionPaths; - } - - /** - * Set the clientCertExclusionPaths property: client certificate authentication comma-separated exclusion paths. - * - * @param clientCertExclusionPaths the clientCertExclusionPaths value to set. - * @return the SitePatchResourcePropertiesInner object itself. - */ - public SitePatchResourcePropertiesInner withClientCertExclusionPaths(String clientCertExclusionPaths) { - this.clientCertExclusionPaths = clientCertExclusionPaths; - return this; - } - - /** - * Get the hostNamesDisabled property: <code>true</code> to disable the public hostnames of the app; - * otherwise, <code>false</code>. If <code>true</code>, the app is only accessible via API - * management process. - * - * @return the hostNamesDisabled value. - */ - public Boolean hostNamesDisabled() { - return this.hostNamesDisabled; - } - - /** - * Set the hostNamesDisabled property: <code>true</code> to disable the public hostnames of the app; - * otherwise, <code>false</code>. If <code>true</code>, the app is only accessible via API - * management process. - * - * @param hostNamesDisabled the hostNamesDisabled value to set. - * @return the SitePatchResourcePropertiesInner object itself. - */ - public SitePatchResourcePropertiesInner withHostNamesDisabled(Boolean hostNamesDisabled) { - this.hostNamesDisabled = hostNamesDisabled; - return this; - } - - /** - * Get the outboundIpAddresses property: List of IP addresses that the app uses for outbound connections (e.g. - * database access). Includes VIPs from tenants that site can be hosted with current settings. Read-only. - * - * @return the outboundIpAddresses value. - */ - public String outboundIpAddresses() { - return this.outboundIpAddresses; - } - - /** - * Get the possibleOutboundIpAddresses property: List of IP addresses that the app uses for outbound connections - * (e.g. database access). Includes VIPs from all tenants. Read-only. - * - * @return the possibleOutboundIpAddresses value. - */ - public String possibleOutboundIpAddresses() { - return this.possibleOutboundIpAddresses; - } - - /** - * Get the containerSize property: Size of the function container. - * - * @return the containerSize value. - */ - public Integer containerSize() { - return this.containerSize; - } - - /** - * Set the containerSize property: Size of the function container. - * - * @param containerSize the containerSize value to set. - * @return the SitePatchResourcePropertiesInner object itself. - */ - public SitePatchResourcePropertiesInner withContainerSize(Integer containerSize) { - this.containerSize = containerSize; - return this; - } - - /** - * Get the dailyMemoryTimeQuota property: Maximum allowed daily memory-time quota (applicable on dynamic apps only). - * - * @return the dailyMemoryTimeQuota value. - */ - public Integer dailyMemoryTimeQuota() { - return this.dailyMemoryTimeQuota; - } - - /** - * Set the dailyMemoryTimeQuota property: Maximum allowed daily memory-time quota (applicable on dynamic apps only). - * - * @param dailyMemoryTimeQuota the dailyMemoryTimeQuota value to set. - * @return the SitePatchResourcePropertiesInner object itself. - */ - public SitePatchResourcePropertiesInner withDailyMemoryTimeQuota(Integer dailyMemoryTimeQuota) { - this.dailyMemoryTimeQuota = dailyMemoryTimeQuota; - return this; - } - - /** - * Get the suspendedTill property: App suspended till in case memory-time quota is exceeded. - * - * @return the suspendedTill value. - */ - public OffsetDateTime suspendedTill() { - return this.suspendedTill; - } - - /** - * Get the maxNumberOfWorkers property: Maximum number of workers. This only applies to Functions container. - * - * @return the maxNumberOfWorkers value. - */ - public Integer maxNumberOfWorkers() { - return this.maxNumberOfWorkers; - } - - /** - * Get the cloningInfo property: If specified during app creation, the app is cloned from a source app. - * - * @return the cloningInfo value. - */ - public CloningInfo cloningInfo() { - return this.cloningInfo; - } - - /** - * Set the cloningInfo property: If specified during app creation, the app is cloned from a source app. - * - * @param cloningInfo the cloningInfo value to set. - * @return the SitePatchResourcePropertiesInner object itself. - */ - public SitePatchResourcePropertiesInner withCloningInfo(CloningInfo cloningInfo) { - this.cloningInfo = cloningInfo; - return this; - } - - /** - * Get the resourceGroup property: Name of the resource group the app belongs to. Read-only. - * - * @return the resourceGroup value. - */ - public String resourceGroup() { - return this.resourceGroup; - } - - /** - * Get the isDefaultContainer property: <code>true</code> if the app is a default container; otherwise, - * <code>false</code>. - * - * @return the isDefaultContainer value. - */ - public Boolean isDefaultContainer() { - return this.isDefaultContainer; - } - - /** - * Get the defaultHostname property: Default hostname of the app. Read-only. - * - * @return the defaultHostname value. - */ - public String defaultHostname() { - return this.defaultHostname; - } - - /** - * Get the slotSwapStatus property: Status of the last deployment slot swap operation. - * - * @return the slotSwapStatus value. - */ - public SlotSwapStatus slotSwapStatus() { - return this.slotSwapStatus; - } - - /** - * Get the httpsOnly property: HttpsOnly: configures a web site to accept only https requests. Issues redirect for - * http requests. - * - * @return the httpsOnly value. - */ - public Boolean httpsOnly() { - return this.httpsOnly; - } - - /** - * Set the httpsOnly property: HttpsOnly: configures a web site to accept only https requests. Issues redirect for - * http requests. - * - * @param httpsOnly the httpsOnly value to set. - * @return the SitePatchResourcePropertiesInner object itself. - */ - public SitePatchResourcePropertiesInner withHttpsOnly(Boolean httpsOnly) { - this.httpsOnly = httpsOnly; - return this; - } - - /** - * Get the redundancyMode property: Site redundancy mode. - * - * @return the redundancyMode value. - */ - public RedundancyMode redundancyMode() { - return this.redundancyMode; - } - - /** - * Set the redundancyMode property: Site redundancy mode. - * - * @param redundancyMode the redundancyMode value to set. - * @return the SitePatchResourcePropertiesInner object itself. - */ - public SitePatchResourcePropertiesInner withRedundancyMode(RedundancyMode redundancyMode) { - this.redundancyMode = redundancyMode; - return this; - } - - /** - * Get the inProgressOperationId property: Specifies an operation id if this site has a pending operation. - * - * @return the inProgressOperationId value. - */ - public UUID inProgressOperationId() { - return this.inProgressOperationId; - } - - /** - * Get the geoDistributions property: GeoDistributions for this site. - * - * @return the geoDistributions value. - */ - public List geoDistributions() { - return this.geoDistributions; - } - - /** - * Set the geoDistributions property: GeoDistributions for this site. - * - * @param geoDistributions the geoDistributions value to set. - * @return the SitePatchResourcePropertiesInner object itself. - */ - public SitePatchResourcePropertiesInner withGeoDistributions(List geoDistributions) { - this.geoDistributions = geoDistributions; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (hostnameSslStates() != null) { - hostnameSslStates().forEach(e -> e.validate()); - } - if (siteConfig() != null) { - siteConfig().validate(); - } - if (hostingEnvironmentProfile() != null) { - hostingEnvironmentProfile().validate(); - } - if (cloningInfo() != null) { - cloningInfo().validate(); - } - if (slotSwapStatus() != null) { - slotSwapStatus().validate(); - } - if (geoDistributions() != null) { - geoDistributions().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SitePhpErrorLogFlagInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SitePhpErrorLogFlagInner.java deleted file mode 100644 index 1bdf0746c660..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SitePhpErrorLogFlagInner.java +++ /dev/null @@ -1,144 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.ProxyOnlyResource; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Used for getting PHP error logging flag. */ -@Fluent -public final class SitePhpErrorLogFlagInner extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SitePhpErrorLogFlagInner.class); - - /* - * SitePhpErrorLogFlag resource specific properties - */ - @JsonProperty(value = "properties") - private SitePhpErrorLogFlagProperties innerProperties; - - /** - * Get the innerProperties property: SitePhpErrorLogFlag resource specific properties. - * - * @return the innerProperties value. - */ - private SitePhpErrorLogFlagProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public SitePhpErrorLogFlagInner withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the localLogErrors property: Local log_errors setting. - * - * @return the localLogErrors value. - */ - public String localLogErrors() { - return this.innerProperties() == null ? null : this.innerProperties().localLogErrors(); - } - - /** - * Set the localLogErrors property: Local log_errors setting. - * - * @param localLogErrors the localLogErrors value to set. - * @return the SitePhpErrorLogFlagInner object itself. - */ - public SitePhpErrorLogFlagInner withLocalLogErrors(String localLogErrors) { - if (this.innerProperties() == null) { - this.innerProperties = new SitePhpErrorLogFlagProperties(); - } - this.innerProperties().withLocalLogErrors(localLogErrors); - return this; - } - - /** - * Get the masterLogErrors property: Master log_errors setting. - * - * @return the masterLogErrors value. - */ - public String masterLogErrors() { - return this.innerProperties() == null ? null : this.innerProperties().masterLogErrors(); - } - - /** - * Set the masterLogErrors property: Master log_errors setting. - * - * @param masterLogErrors the masterLogErrors value to set. - * @return the SitePhpErrorLogFlagInner object itself. - */ - public SitePhpErrorLogFlagInner withMasterLogErrors(String masterLogErrors) { - if (this.innerProperties() == null) { - this.innerProperties = new SitePhpErrorLogFlagProperties(); - } - this.innerProperties().withMasterLogErrors(masterLogErrors); - return this; - } - - /** - * Get the localLogErrorsMaxLength property: Local log_errors_max_len setting. - * - * @return the localLogErrorsMaxLength value. - */ - public String localLogErrorsMaxLength() { - return this.innerProperties() == null ? null : this.innerProperties().localLogErrorsMaxLength(); - } - - /** - * Set the localLogErrorsMaxLength property: Local log_errors_max_len setting. - * - * @param localLogErrorsMaxLength the localLogErrorsMaxLength value to set. - * @return the SitePhpErrorLogFlagInner object itself. - */ - public SitePhpErrorLogFlagInner withLocalLogErrorsMaxLength(String localLogErrorsMaxLength) { - if (this.innerProperties() == null) { - this.innerProperties = new SitePhpErrorLogFlagProperties(); - } - this.innerProperties().withLocalLogErrorsMaxLength(localLogErrorsMaxLength); - return this; - } - - /** - * Get the masterLogErrorsMaxLength property: Master log_errors_max_len setting. - * - * @return the masterLogErrorsMaxLength value. - */ - public String masterLogErrorsMaxLength() { - return this.innerProperties() == null ? null : this.innerProperties().masterLogErrorsMaxLength(); - } - - /** - * Set the masterLogErrorsMaxLength property: Master log_errors_max_len setting. - * - * @param masterLogErrorsMaxLength the masterLogErrorsMaxLength value to set. - * @return the SitePhpErrorLogFlagInner object itself. - */ - public SitePhpErrorLogFlagInner withMasterLogErrorsMaxLength(String masterLogErrorsMaxLength) { - if (this.innerProperties() == null) { - this.innerProperties = new SitePhpErrorLogFlagProperties(); - } - this.innerProperties().withMasterLogErrorsMaxLength(masterLogErrorsMaxLength); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SitePhpErrorLogFlagProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SitePhpErrorLogFlagProperties.java deleted file mode 100644 index 5ed05d341857..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SitePhpErrorLogFlagProperties.java +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** SitePhpErrorLogFlag resource specific properties. */ -@Fluent -public final class SitePhpErrorLogFlagProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SitePhpErrorLogFlagProperties.class); - - /* - * Local log_errors setting. - */ - @JsonProperty(value = "localLogErrors") - private String localLogErrors; - - /* - * Master log_errors setting. - */ - @JsonProperty(value = "masterLogErrors") - private String masterLogErrors; - - /* - * Local log_errors_max_len setting. - */ - @JsonProperty(value = "localLogErrorsMaxLength") - private String localLogErrorsMaxLength; - - /* - * Master log_errors_max_len setting. - */ - @JsonProperty(value = "masterLogErrorsMaxLength") - private String masterLogErrorsMaxLength; - - /** - * Get the localLogErrors property: Local log_errors setting. - * - * @return the localLogErrors value. - */ - public String localLogErrors() { - return this.localLogErrors; - } - - /** - * Set the localLogErrors property: Local log_errors setting. - * - * @param localLogErrors the localLogErrors value to set. - * @return the SitePhpErrorLogFlagProperties object itself. - */ - public SitePhpErrorLogFlagProperties withLocalLogErrors(String localLogErrors) { - this.localLogErrors = localLogErrors; - return this; - } - - /** - * Get the masterLogErrors property: Master log_errors setting. - * - * @return the masterLogErrors value. - */ - public String masterLogErrors() { - return this.masterLogErrors; - } - - /** - * Set the masterLogErrors property: Master log_errors setting. - * - * @param masterLogErrors the masterLogErrors value to set. - * @return the SitePhpErrorLogFlagProperties object itself. - */ - public SitePhpErrorLogFlagProperties withMasterLogErrors(String masterLogErrors) { - this.masterLogErrors = masterLogErrors; - return this; - } - - /** - * Get the localLogErrorsMaxLength property: Local log_errors_max_len setting. - * - * @return the localLogErrorsMaxLength value. - */ - public String localLogErrorsMaxLength() { - return this.localLogErrorsMaxLength; - } - - /** - * Set the localLogErrorsMaxLength property: Local log_errors_max_len setting. - * - * @param localLogErrorsMaxLength the localLogErrorsMaxLength value to set. - * @return the SitePhpErrorLogFlagProperties object itself. - */ - public SitePhpErrorLogFlagProperties withLocalLogErrorsMaxLength(String localLogErrorsMaxLength) { - this.localLogErrorsMaxLength = localLogErrorsMaxLength; - return this; - } - - /** - * Get the masterLogErrorsMaxLength property: Master log_errors_max_len setting. - * - * @return the masterLogErrorsMaxLength value. - */ - public String masterLogErrorsMaxLength() { - return this.masterLogErrorsMaxLength; - } - - /** - * Set the masterLogErrorsMaxLength property: Master log_errors_max_len setting. - * - * @param masterLogErrorsMaxLength the masterLogErrorsMaxLength value to set. - * @return the SitePhpErrorLogFlagProperties object itself. - */ - public SitePhpErrorLogFlagProperties withMasterLogErrorsMaxLength(String masterLogErrorsMaxLength) { - this.masterLogErrorsMaxLength = masterLogErrorsMaxLength; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SitePropertiesInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SitePropertiesInner.java deleted file mode 100644 index 976b00c12d0e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SitePropertiesInner.java +++ /dev/null @@ -1,866 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.CloningInfo; -import com.azure.resourcemanager.appservice.models.GeoDistribution; -import com.azure.resourcemanager.appservice.models.HostingEnvironmentProfile; -import com.azure.resourcemanager.appservice.models.HostnameSslState; -import com.azure.resourcemanager.appservice.models.RedundancyMode; -import com.azure.resourcemanager.appservice.models.SiteAvailabilityState; -import com.azure.resourcemanager.appservice.models.SlotSwapStatus; -import com.azure.resourcemanager.appservice.models.UsageState; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; -import java.util.UUID; - -/** Site resource specific properties. */ -@Fluent -public final class SitePropertiesInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SitePropertiesInner.class); - - /* - * Current state of the app. - */ - @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) - private String state; - - /* - * Hostnames associated with the app. - */ - @JsonProperty(value = "hostNames", access = JsonProperty.Access.WRITE_ONLY) - private List hostNames; - - /* - * Name of the repository site. - */ - @JsonProperty(value = "repositorySiteName", access = JsonProperty.Access.WRITE_ONLY) - private String repositorySiteName; - - /* - * State indicating whether the app has exceeded its quota usage. - * Read-only. - */ - @JsonProperty(value = "usageState", access = JsonProperty.Access.WRITE_ONLY) - private UsageState usageState; - - /* - * true if the app is enabled; otherwise, false. - * Setting this value to false disables the app (takes the app offline). - */ - @JsonProperty(value = "enabled") - private Boolean enabled; - - /* - * Enabled hostnames for the app.Hostnames need to be assigned (see - * HostNames) AND enabled. Otherwise, - * the app is not served on those hostnames. - */ - @JsonProperty(value = "enabledHostNames", access = JsonProperty.Access.WRITE_ONLY) - private List enabledHostNames; - - /* - * Management information availability state for the app. - */ - @JsonProperty(value = "availabilityState", access = JsonProperty.Access.WRITE_ONLY) - private SiteAvailabilityState availabilityState; - - /* - * Hostname SSL states are used to manage the SSL bindings for app's - * hostnames. - */ - @JsonProperty(value = "hostNameSslStates") - private List hostnameSslStates; - - /* - * Resource ID of the associated App Service plan, formatted as: - * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms" - + "/{appServicePlanName}". - */ - @JsonProperty(value = "serverFarmId") - private String serverFarmId; - - /* - * true if reserved; otherwise, false. - */ - @JsonProperty(value = "reserved") - private Boolean reserved; - - /* - * Obsolete: Hyper-V sandbox. - */ - @JsonProperty(value = "isXenon") - private Boolean isXenon; - - /* - * Hyper-V sandbox. - */ - @JsonProperty(value = "hyperV") - private Boolean hyperV; - - /* - * Last time the app was modified, in UTC. Read-only. - */ - @JsonProperty(value = "lastModifiedTimeUtc", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime lastModifiedTimeUtc; - - /* - * Configuration of the app. - */ - @JsonProperty(value = "siteConfig") - private SiteConfigInner siteConfig; - - /* - * Azure Traffic Manager hostnames associated with the app. Read-only. - */ - @JsonProperty(value = "trafficManagerHostNames", access = JsonProperty.Access.WRITE_ONLY) - private List trafficManagerHostNames; - - /* - * true to stop SCM (KUDU) site when the app is stopped; - * otherwise, false. The default is false. - */ - @JsonProperty(value = "scmSiteAlsoStopped") - private Boolean scmSiteAlsoStopped; - - /* - * Specifies which deployment slot this app will swap into. Read-only. - */ - @JsonProperty(value = "targetSwapSlot", access = JsonProperty.Access.WRITE_ONLY) - private String targetSwapSlot; - - /* - * App Service Environment to use for the app. - */ - @JsonProperty(value = "hostingEnvironmentProfile") - private HostingEnvironmentProfile hostingEnvironmentProfile; - - /* - * true to enable client affinity; false to stop - * sending session affinity cookies, which route client requests in the - * same session to the same instance. Default is true. - */ - @JsonProperty(value = "clientAffinityEnabled") - private Boolean clientAffinityEnabled; - - /* - * true to enable client certificate authentication (TLS - * mutual authentication); otherwise, false. Default is - * false. - */ - @JsonProperty(value = "clientCertEnabled") - private Boolean clientCertEnabled; - - /* - * client certificate authentication comma-separated exclusion paths - */ - @JsonProperty(value = "clientCertExclusionPaths") - private String clientCertExclusionPaths; - - /* - * true to disable the public hostnames of the app; otherwise, - * false. - * If true, the app is only accessible via API management - * process. - */ - @JsonProperty(value = "hostNamesDisabled") - private Boolean hostNamesDisabled; - - /* - * List of IP addresses that the app uses for outbound connections (e.g. - * database access). Includes VIPs from tenants that site can be hosted - * with current settings. Read-only. - */ - @JsonProperty(value = "outboundIpAddresses", access = JsonProperty.Access.WRITE_ONLY) - private String outboundIpAddresses; - - /* - * List of IP addresses that the app uses for outbound connections (e.g. - * database access). Includes VIPs from all tenants. Read-only. - */ - @JsonProperty(value = "possibleOutboundIpAddresses", access = JsonProperty.Access.WRITE_ONLY) - private String possibleOutboundIpAddresses; - - /* - * Size of the function container. - */ - @JsonProperty(value = "containerSize") - private Integer containerSize; - - /* - * Maximum allowed daily memory-time quota (applicable on dynamic apps - * only). - */ - @JsonProperty(value = "dailyMemoryTimeQuota") - private Integer dailyMemoryTimeQuota; - - /* - * App suspended till in case memory-time quota is exceeded. - */ - @JsonProperty(value = "suspendedTill", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime suspendedTill; - - /* - * Maximum number of workers. - * This only applies to Functions container. - */ - @JsonProperty(value = "maxNumberOfWorkers", access = JsonProperty.Access.WRITE_ONLY) - private Integer maxNumberOfWorkers; - - /* - * If specified during app creation, the app is cloned from a source app. - */ - @JsonProperty(value = "cloningInfo") - private CloningInfo cloningInfo; - - /* - * Name of the resource group the app belongs to. Read-only. - */ - @JsonProperty(value = "resourceGroup", access = JsonProperty.Access.WRITE_ONLY) - private String resourceGroup; - - /* - * true if the app is a default container; otherwise, - * false. - */ - @JsonProperty(value = "isDefaultContainer", access = JsonProperty.Access.WRITE_ONLY) - private Boolean isDefaultContainer; - - /* - * Default hostname of the app. Read-only. - */ - @JsonProperty(value = "defaultHostName", access = JsonProperty.Access.WRITE_ONLY) - private String defaultHostname; - - /* - * Status of the last deployment slot swap operation. - */ - @JsonProperty(value = "slotSwapStatus", access = JsonProperty.Access.WRITE_ONLY) - private SlotSwapStatus slotSwapStatus; - - /* - * HttpsOnly: configures a web site to accept only https requests. Issues - * redirect for - * http requests - */ - @JsonProperty(value = "httpsOnly") - private Boolean httpsOnly; - - /* - * Site redundancy mode - */ - @JsonProperty(value = "redundancyMode") - private RedundancyMode redundancyMode; - - /* - * Specifies an operation id if this site has a pending operation. - */ - @JsonProperty(value = "inProgressOperationId", access = JsonProperty.Access.WRITE_ONLY) - private UUID inProgressOperationId; - - /* - * GeoDistributions for this site - */ - @JsonProperty(value = "geoDistributions") - private List geoDistributions; - - /** - * Get the state property: Current state of the app. - * - * @return the state value. - */ - public String state() { - return this.state; - } - - /** - * Get the hostNames property: Hostnames associated with the app. - * - * @return the hostNames value. - */ - public List hostNames() { - return this.hostNames; - } - - /** - * Get the repositorySiteName property: Name of the repository site. - * - * @return the repositorySiteName value. - */ - public String repositorySiteName() { - return this.repositorySiteName; - } - - /** - * Get the usageState property: State indicating whether the app has exceeded its quota usage. Read-only. - * - * @return the usageState value. - */ - public UsageState usageState() { - return this.usageState; - } - - /** - * Get the enabled property: <code>true</code> if the app is enabled; otherwise, - * <code>false</code>. Setting this value to false disables the app (takes the app offline). - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: <code>true</code> if the app is enabled; otherwise, - * <code>false</code>. Setting this value to false disables the app (takes the app offline). - * - * @param enabled the enabled value to set. - * @return the SitePropertiesInner object itself. - */ - public SitePropertiesInner withEnabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the enabledHostNames property: Enabled hostnames for the app.Hostnames need to be assigned (see HostNames) - * AND enabled. Otherwise, the app is not served on those hostnames. - * - * @return the enabledHostNames value. - */ - public List enabledHostNames() { - return this.enabledHostNames; - } - - /** - * Get the availabilityState property: Management information availability state for the app. - * - * @return the availabilityState value. - */ - public SiteAvailabilityState availabilityState() { - return this.availabilityState; - } - - /** - * Get the hostnameSslStates property: Hostname SSL states are used to manage the SSL bindings for app's hostnames. - * - * @return the hostnameSslStates value. - */ - public List hostnameSslStates() { - return this.hostnameSslStates; - } - - /** - * Set the hostnameSslStates property: Hostname SSL states are used to manage the SSL bindings for app's hostnames. - * - * @param hostnameSslStates the hostnameSslStates value to set. - * @return the SitePropertiesInner object itself. - */ - public SitePropertiesInner withHostnameSslStates(List hostnameSslStates) { - this.hostnameSslStates = hostnameSslStates; - return this; - } - - /** - * Get the serverFarmId property: Resource ID of the associated App Service plan, formatted as: - * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms" - + "/{appServicePlanName}". - * - * @return the serverFarmId value. - */ - public String serverFarmId() { - return this.serverFarmId; - } - - /** - * Set the serverFarmId property: Resource ID of the associated App Service plan, formatted as: - * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms" - + "/{appServicePlanName}". - * - * @param serverFarmId the serverFarmId value to set. - * @return the SitePropertiesInner object itself. - */ - public SitePropertiesInner withServerFarmId(String serverFarmId) { - this.serverFarmId = serverFarmId; - return this; - } - - /** - * Get the reserved property: <code>true</code> if reserved; otherwise, <code>false</code>. - * - * @return the reserved value. - */ - public Boolean reserved() { - return this.reserved; - } - - /** - * Set the reserved property: <code>true</code> if reserved; otherwise, <code>false</code>. - * - * @param reserved the reserved value to set. - * @return the SitePropertiesInner object itself. - */ - public SitePropertiesInner withReserved(Boolean reserved) { - this.reserved = reserved; - return this; - } - - /** - * Get the isXenon property: Obsolete: Hyper-V sandbox. - * - * @return the isXenon value. - */ - public Boolean isXenon() { - return this.isXenon; - } - - /** - * Set the isXenon property: Obsolete: Hyper-V sandbox. - * - * @param isXenon the isXenon value to set. - * @return the SitePropertiesInner object itself. - */ - public SitePropertiesInner withIsXenon(Boolean isXenon) { - this.isXenon = isXenon; - return this; - } - - /** - * Get the hyperV property: Hyper-V sandbox. - * - * @return the hyperV value. - */ - public Boolean hyperV() { - return this.hyperV; - } - - /** - * Set the hyperV property: Hyper-V sandbox. - * - * @param hyperV the hyperV value to set. - * @return the SitePropertiesInner object itself. - */ - public SitePropertiesInner withHyperV(Boolean hyperV) { - this.hyperV = hyperV; - return this; - } - - /** - * Get the lastModifiedTimeUtc property: Last time the app was modified, in UTC. Read-only. - * - * @return the lastModifiedTimeUtc value. - */ - public OffsetDateTime lastModifiedTimeUtc() { - return this.lastModifiedTimeUtc; - } - - /** - * Get the siteConfig property: Configuration of the app. - * - * @return the siteConfig value. - */ - public SiteConfigInner siteConfig() { - return this.siteConfig; - } - - /** - * Set the siteConfig property: Configuration of the app. - * - * @param siteConfig the siteConfig value to set. - * @return the SitePropertiesInner object itself. - */ - public SitePropertiesInner withSiteConfig(SiteConfigInner siteConfig) { - this.siteConfig = siteConfig; - return this; - } - - /** - * Get the trafficManagerHostNames property: Azure Traffic Manager hostnames associated with the app. Read-only. - * - * @return the trafficManagerHostNames value. - */ - public List trafficManagerHostNames() { - return this.trafficManagerHostNames; - } - - /** - * Get the scmSiteAlsoStopped property: <code>true</code> to stop SCM (KUDU) site when the app is - * stopped; otherwise, <code>false</code>. The default is <code>false</code>. - * - * @return the scmSiteAlsoStopped value. - */ - public Boolean scmSiteAlsoStopped() { - return this.scmSiteAlsoStopped; - } - - /** - * Set the scmSiteAlsoStopped property: <code>true</code> to stop SCM (KUDU) site when the app is - * stopped; otherwise, <code>false</code>. The default is <code>false</code>. - * - * @param scmSiteAlsoStopped the scmSiteAlsoStopped value to set. - * @return the SitePropertiesInner object itself. - */ - public SitePropertiesInner withScmSiteAlsoStopped(Boolean scmSiteAlsoStopped) { - this.scmSiteAlsoStopped = scmSiteAlsoStopped; - return this; - } - - /** - * Get the targetSwapSlot property: Specifies which deployment slot this app will swap into. Read-only. - * - * @return the targetSwapSlot value. - */ - public String targetSwapSlot() { - return this.targetSwapSlot; - } - - /** - * Get the hostingEnvironmentProfile property: App Service Environment to use for the app. - * - * @return the hostingEnvironmentProfile value. - */ - public HostingEnvironmentProfile hostingEnvironmentProfile() { - return this.hostingEnvironmentProfile; - } - - /** - * Set the hostingEnvironmentProfile property: App Service Environment to use for the app. - * - * @param hostingEnvironmentProfile the hostingEnvironmentProfile value to set. - * @return the SitePropertiesInner object itself. - */ - public SitePropertiesInner withHostingEnvironmentProfile(HostingEnvironmentProfile hostingEnvironmentProfile) { - this.hostingEnvironmentProfile = hostingEnvironmentProfile; - return this; - } - - /** - * Get the clientAffinityEnabled property: <code>true</code> to enable client affinity; - * <code>false</code> to stop sending session affinity cookies, which route client requests in the same - * session to the same instance. Default is <code>true</code>. - * - * @return the clientAffinityEnabled value. - */ - public Boolean clientAffinityEnabled() { - return this.clientAffinityEnabled; - } - - /** - * Set the clientAffinityEnabled property: <code>true</code> to enable client affinity; - * <code>false</code> to stop sending session affinity cookies, which route client requests in the same - * session to the same instance. Default is <code>true</code>. - * - * @param clientAffinityEnabled the clientAffinityEnabled value to set. - * @return the SitePropertiesInner object itself. - */ - public SitePropertiesInner withClientAffinityEnabled(Boolean clientAffinityEnabled) { - this.clientAffinityEnabled = clientAffinityEnabled; - return this; - } - - /** - * Get the clientCertEnabled property: <code>true</code> to enable client certificate authentication - * (TLS mutual authentication); otherwise, <code>false</code>. Default is - * <code>false</code>. - * - * @return the clientCertEnabled value. - */ - public Boolean clientCertEnabled() { - return this.clientCertEnabled; - } - - /** - * Set the clientCertEnabled property: <code>true</code> to enable client certificate authentication - * (TLS mutual authentication); otherwise, <code>false</code>. Default is - * <code>false</code>. - * - * @param clientCertEnabled the clientCertEnabled value to set. - * @return the SitePropertiesInner object itself. - */ - public SitePropertiesInner withClientCertEnabled(Boolean clientCertEnabled) { - this.clientCertEnabled = clientCertEnabled; - return this; - } - - /** - * Get the clientCertExclusionPaths property: client certificate authentication comma-separated exclusion paths. - * - * @return the clientCertExclusionPaths value. - */ - public String clientCertExclusionPaths() { - return this.clientCertExclusionPaths; - } - - /** - * Set the clientCertExclusionPaths property: client certificate authentication comma-separated exclusion paths. - * - * @param clientCertExclusionPaths the clientCertExclusionPaths value to set. - * @return the SitePropertiesInner object itself. - */ - public SitePropertiesInner withClientCertExclusionPaths(String clientCertExclusionPaths) { - this.clientCertExclusionPaths = clientCertExclusionPaths; - return this; - } - - /** - * Get the hostNamesDisabled property: <code>true</code> to disable the public hostnames of the app; - * otherwise, <code>false</code>. If <code>true</code>, the app is only accessible via API - * management process. - * - * @return the hostNamesDisabled value. - */ - public Boolean hostNamesDisabled() { - return this.hostNamesDisabled; - } - - /** - * Set the hostNamesDisabled property: <code>true</code> to disable the public hostnames of the app; - * otherwise, <code>false</code>. If <code>true</code>, the app is only accessible via API - * management process. - * - * @param hostNamesDisabled the hostNamesDisabled value to set. - * @return the SitePropertiesInner object itself. - */ - public SitePropertiesInner withHostNamesDisabled(Boolean hostNamesDisabled) { - this.hostNamesDisabled = hostNamesDisabled; - return this; - } - - /** - * Get the outboundIpAddresses property: List of IP addresses that the app uses for outbound connections (e.g. - * database access). Includes VIPs from tenants that site can be hosted with current settings. Read-only. - * - * @return the outboundIpAddresses value. - */ - public String outboundIpAddresses() { - return this.outboundIpAddresses; - } - - /** - * Get the possibleOutboundIpAddresses property: List of IP addresses that the app uses for outbound connections - * (e.g. database access). Includes VIPs from all tenants. Read-only. - * - * @return the possibleOutboundIpAddresses value. - */ - public String possibleOutboundIpAddresses() { - return this.possibleOutboundIpAddresses; - } - - /** - * Get the containerSize property: Size of the function container. - * - * @return the containerSize value. - */ - public Integer containerSize() { - return this.containerSize; - } - - /** - * Set the containerSize property: Size of the function container. - * - * @param containerSize the containerSize value to set. - * @return the SitePropertiesInner object itself. - */ - public SitePropertiesInner withContainerSize(Integer containerSize) { - this.containerSize = containerSize; - return this; - } - - /** - * Get the dailyMemoryTimeQuota property: Maximum allowed daily memory-time quota (applicable on dynamic apps only). - * - * @return the dailyMemoryTimeQuota value. - */ - public Integer dailyMemoryTimeQuota() { - return this.dailyMemoryTimeQuota; - } - - /** - * Set the dailyMemoryTimeQuota property: Maximum allowed daily memory-time quota (applicable on dynamic apps only). - * - * @param dailyMemoryTimeQuota the dailyMemoryTimeQuota value to set. - * @return the SitePropertiesInner object itself. - */ - public SitePropertiesInner withDailyMemoryTimeQuota(Integer dailyMemoryTimeQuota) { - this.dailyMemoryTimeQuota = dailyMemoryTimeQuota; - return this; - } - - /** - * Get the suspendedTill property: App suspended till in case memory-time quota is exceeded. - * - * @return the suspendedTill value. - */ - public OffsetDateTime suspendedTill() { - return this.suspendedTill; - } - - /** - * Get the maxNumberOfWorkers property: Maximum number of workers. This only applies to Functions container. - * - * @return the maxNumberOfWorkers value. - */ - public Integer maxNumberOfWorkers() { - return this.maxNumberOfWorkers; - } - - /** - * Get the cloningInfo property: If specified during app creation, the app is cloned from a source app. - * - * @return the cloningInfo value. - */ - public CloningInfo cloningInfo() { - return this.cloningInfo; - } - - /** - * Set the cloningInfo property: If specified during app creation, the app is cloned from a source app. - * - * @param cloningInfo the cloningInfo value to set. - * @return the SitePropertiesInner object itself. - */ - public SitePropertiesInner withCloningInfo(CloningInfo cloningInfo) { - this.cloningInfo = cloningInfo; - return this; - } - - /** - * Get the resourceGroup property: Name of the resource group the app belongs to. Read-only. - * - * @return the resourceGroup value. - */ - public String resourceGroup() { - return this.resourceGroup; - } - - /** - * Get the isDefaultContainer property: <code>true</code> if the app is a default container; otherwise, - * <code>false</code>. - * - * @return the isDefaultContainer value. - */ - public Boolean isDefaultContainer() { - return this.isDefaultContainer; - } - - /** - * Get the defaultHostname property: Default hostname of the app. Read-only. - * - * @return the defaultHostname value. - */ - public String defaultHostname() { - return this.defaultHostname; - } - - /** - * Get the slotSwapStatus property: Status of the last deployment slot swap operation. - * - * @return the slotSwapStatus value. - */ - public SlotSwapStatus slotSwapStatus() { - return this.slotSwapStatus; - } - - /** - * Get the httpsOnly property: HttpsOnly: configures a web site to accept only https requests. Issues redirect for - * http requests. - * - * @return the httpsOnly value. - */ - public Boolean httpsOnly() { - return this.httpsOnly; - } - - /** - * Set the httpsOnly property: HttpsOnly: configures a web site to accept only https requests. Issues redirect for - * http requests. - * - * @param httpsOnly the httpsOnly value to set. - * @return the SitePropertiesInner object itself. - */ - public SitePropertiesInner withHttpsOnly(Boolean httpsOnly) { - this.httpsOnly = httpsOnly; - return this; - } - - /** - * Get the redundancyMode property: Site redundancy mode. - * - * @return the redundancyMode value. - */ - public RedundancyMode redundancyMode() { - return this.redundancyMode; - } - - /** - * Set the redundancyMode property: Site redundancy mode. - * - * @param redundancyMode the redundancyMode value to set. - * @return the SitePropertiesInner object itself. - */ - public SitePropertiesInner withRedundancyMode(RedundancyMode redundancyMode) { - this.redundancyMode = redundancyMode; - return this; - } - - /** - * Get the inProgressOperationId property: Specifies an operation id if this site has a pending operation. - * - * @return the inProgressOperationId value. - */ - public UUID inProgressOperationId() { - return this.inProgressOperationId; - } - - /** - * Get the geoDistributions property: GeoDistributions for this site. - * - * @return the geoDistributions value. - */ - public List geoDistributions() { - return this.geoDistributions; - } - - /** - * Set the geoDistributions property: GeoDistributions for this site. - * - * @param geoDistributions the geoDistributions value to set. - * @return the SitePropertiesInner object itself. - */ - public SitePropertiesInner withGeoDistributions(List geoDistributions) { - this.geoDistributions = geoDistributions; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (hostnameSslStates() != null) { - hostnameSslStates().forEach(e -> e.validate()); - } - if (siteConfig() != null) { - siteConfig().validate(); - } - if (hostingEnvironmentProfile() != null) { - hostingEnvironmentProfile().validate(); - } - if (cloningInfo() != null) { - cloningInfo().validate(); - } - if (slotSwapStatus() != null) { - slotSwapStatus().validate(); - } - if (geoDistributions() != null) { - geoDistributions().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SiteSealInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SiteSealInner.java deleted file mode 100644 index 696232b2e1d2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SiteSealInner.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Site seal. */ -@Fluent -public final class SiteSealInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SiteSealInner.class); - - /* - * HTML snippet - */ - @JsonProperty(value = "html", required = true) - private String html; - - /** - * Get the html property: HTML snippet. - * - * @return the html value. - */ - public String html() { - return this.html; - } - - /** - * Set the html property: HTML snippet. - * - * @param html the html value to set. - * @return the SiteSealInner object itself. - */ - public SiteSealInner withHtml(String html) { - this.html = html; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (html() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property html in model SiteSealInner")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SiteSourceControlInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SiteSourceControlInner.java deleted file mode 100644 index 1ce2bb191e43..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SiteSourceControlInner.java +++ /dev/null @@ -1,175 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.ProxyOnlyResource; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Source control configuration for an app. */ -@Fluent -public final class SiteSourceControlInner extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SiteSourceControlInner.class); - - /* - * SiteSourceControl resource specific properties - */ - @JsonProperty(value = "properties") - private SiteSourceControlProperties innerProperties; - - /** - * Get the innerProperties property: SiteSourceControl resource specific properties. - * - * @return the innerProperties value. - */ - private SiteSourceControlProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public SiteSourceControlInner withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the repoUrl property: Repository or source control URL. - * - * @return the repoUrl value. - */ - public String repoUrl() { - return this.innerProperties() == null ? null : this.innerProperties().repoUrl(); - } - - /** - * Set the repoUrl property: Repository or source control URL. - * - * @param repoUrl the repoUrl value to set. - * @return the SiteSourceControlInner object itself. - */ - public SiteSourceControlInner withRepoUrl(String repoUrl) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteSourceControlProperties(); - } - this.innerProperties().withRepoUrl(repoUrl); - return this; - } - - /** - * Get the branch property: Name of branch to use for deployment. - * - * @return the branch value. - */ - public String branch() { - return this.innerProperties() == null ? null : this.innerProperties().branch(); - } - - /** - * Set the branch property: Name of branch to use for deployment. - * - * @param branch the branch value to set. - * @return the SiteSourceControlInner object itself. - */ - public SiteSourceControlInner withBranch(String branch) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteSourceControlProperties(); - } - this.innerProperties().withBranch(branch); - return this; - } - - /** - * Get the isManualIntegration property: <code>true</code> to limit to manual integration; - * <code>false</code> to enable continuous integration (which configures webhooks into online repos like - * GitHub). - * - * @return the isManualIntegration value. - */ - public Boolean isManualIntegration() { - return this.innerProperties() == null ? null : this.innerProperties().isManualIntegration(); - } - - /** - * Set the isManualIntegration property: <code>true</code> to limit to manual integration; - * <code>false</code> to enable continuous integration (which configures webhooks into online repos like - * GitHub). - * - * @param isManualIntegration the isManualIntegration value to set. - * @return the SiteSourceControlInner object itself. - */ - public SiteSourceControlInner withIsManualIntegration(Boolean isManualIntegration) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteSourceControlProperties(); - } - this.innerProperties().withIsManualIntegration(isManualIntegration); - return this; - } - - /** - * Get the deploymentRollbackEnabled property: <code>true</code> to enable deployment rollback; - * otherwise, <code>false</code>. - * - * @return the deploymentRollbackEnabled value. - */ - public Boolean deploymentRollbackEnabled() { - return this.innerProperties() == null ? null : this.innerProperties().deploymentRollbackEnabled(); - } - - /** - * Set the deploymentRollbackEnabled property: <code>true</code> to enable deployment rollback; - * otherwise, <code>false</code>. - * - * @param deploymentRollbackEnabled the deploymentRollbackEnabled value to set. - * @return the SiteSourceControlInner object itself. - */ - public SiteSourceControlInner withDeploymentRollbackEnabled(Boolean deploymentRollbackEnabled) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteSourceControlProperties(); - } - this.innerProperties().withDeploymentRollbackEnabled(deploymentRollbackEnabled); - return this; - } - - /** - * Get the isMercurial property: <code>true</code> for a Mercurial repository; - * <code>false</code> for a Git repository. - * - * @return the isMercurial value. - */ - public Boolean isMercurial() { - return this.innerProperties() == null ? null : this.innerProperties().isMercurial(); - } - - /** - * Set the isMercurial property: <code>true</code> for a Mercurial repository; - * <code>false</code> for a Git repository. - * - * @param isMercurial the isMercurial value to set. - * @return the SiteSourceControlInner object itself. - */ - public SiteSourceControlInner withIsMercurial(Boolean isMercurial) { - if (this.innerProperties() == null) { - this.innerProperties = new SiteSourceControlProperties(); - } - this.innerProperties().withIsMercurial(isMercurial); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SiteSourceControlProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SiteSourceControlProperties.java deleted file mode 100644 index 413c4c6e5663..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SiteSourceControlProperties.java +++ /dev/null @@ -1,166 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** SiteSourceControl resource specific properties. */ -@Fluent -public final class SiteSourceControlProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SiteSourceControlProperties.class); - - /* - * Repository or source control URL. - */ - @JsonProperty(value = "repoUrl") - private String repoUrl; - - /* - * Name of branch to use for deployment. - */ - @JsonProperty(value = "branch") - private String branch; - - /* - * true to limit to manual integration; false to - * enable continuous integration (which configures webhooks into online - * repos like GitHub). - */ - @JsonProperty(value = "isManualIntegration") - private Boolean isManualIntegration; - - /* - * true to enable deployment rollback; otherwise, - * false. - */ - @JsonProperty(value = "deploymentRollbackEnabled") - private Boolean deploymentRollbackEnabled; - - /* - * true for a Mercurial repository; false for a - * Git repository. - */ - @JsonProperty(value = "isMercurial") - private Boolean isMercurial; - - /** - * Get the repoUrl property: Repository or source control URL. - * - * @return the repoUrl value. - */ - public String repoUrl() { - return this.repoUrl; - } - - /** - * Set the repoUrl property: Repository or source control URL. - * - * @param repoUrl the repoUrl value to set. - * @return the SiteSourceControlProperties object itself. - */ - public SiteSourceControlProperties withRepoUrl(String repoUrl) { - this.repoUrl = repoUrl; - return this; - } - - /** - * Get the branch property: Name of branch to use for deployment. - * - * @return the branch value. - */ - public String branch() { - return this.branch; - } - - /** - * Set the branch property: Name of branch to use for deployment. - * - * @param branch the branch value to set. - * @return the SiteSourceControlProperties object itself. - */ - public SiteSourceControlProperties withBranch(String branch) { - this.branch = branch; - return this; - } - - /** - * Get the isManualIntegration property: <code>true</code> to limit to manual integration; - * <code>false</code> to enable continuous integration (which configures webhooks into online repos like - * GitHub). - * - * @return the isManualIntegration value. - */ - public Boolean isManualIntegration() { - return this.isManualIntegration; - } - - /** - * Set the isManualIntegration property: <code>true</code> to limit to manual integration; - * <code>false</code> to enable continuous integration (which configures webhooks into online repos like - * GitHub). - * - * @param isManualIntegration the isManualIntegration value to set. - * @return the SiteSourceControlProperties object itself. - */ - public SiteSourceControlProperties withIsManualIntegration(Boolean isManualIntegration) { - this.isManualIntegration = isManualIntegration; - return this; - } - - /** - * Get the deploymentRollbackEnabled property: <code>true</code> to enable deployment rollback; - * otherwise, <code>false</code>. - * - * @return the deploymentRollbackEnabled value. - */ - public Boolean deploymentRollbackEnabled() { - return this.deploymentRollbackEnabled; - } - - /** - * Set the deploymentRollbackEnabled property: <code>true</code> to enable deployment rollback; - * otherwise, <code>false</code>. - * - * @param deploymentRollbackEnabled the deploymentRollbackEnabled value to set. - * @return the SiteSourceControlProperties object itself. - */ - public SiteSourceControlProperties withDeploymentRollbackEnabled(Boolean deploymentRollbackEnabled) { - this.deploymentRollbackEnabled = deploymentRollbackEnabled; - return this; - } - - /** - * Get the isMercurial property: <code>true</code> for a Mercurial repository; - * <code>false</code> for a Git repository. - * - * @return the isMercurial value. - */ - public Boolean isMercurial() { - return this.isMercurial; - } - - /** - * Set the isMercurial property: <code>true</code> for a Mercurial repository; - * <code>false</code> for a Git repository. - * - * @param isMercurial the isMercurial value to set. - * @return the SiteSourceControlProperties object itself. - */ - public SiteSourceControlProperties withIsMercurial(Boolean isMercurial) { - this.isMercurial = isMercurial; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SkuInfoInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SkuInfoInner.java deleted file mode 100644 index ed2586e8f8e8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SkuInfoInner.java +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.SkuCapacity; -import com.azure.resourcemanager.appservice.models.SkuDescription; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** SKU discovery information. */ -@Fluent -public final class SkuInfoInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SkuInfoInner.class); - - /* - * Resource type that this SKU applies to. - */ - @JsonProperty(value = "resourceType") - private String resourceType; - - /* - * Name and tier of the SKU. - */ - @JsonProperty(value = "sku") - private SkuDescription sku; - - /* - * Min, max, and default scale values of the SKU. - */ - @JsonProperty(value = "capacity") - private SkuCapacity capacity; - - /** - * Get the resourceType property: Resource type that this SKU applies to. - * - * @return the resourceType value. - */ - public String resourceType() { - return this.resourceType; - } - - /** - * Set the resourceType property: Resource type that this SKU applies to. - * - * @param resourceType the resourceType value to set. - * @return the SkuInfoInner object itself. - */ - public SkuInfoInner withResourceType(String resourceType) { - this.resourceType = resourceType; - return this; - } - - /** - * Get the sku property: Name and tier of the SKU. - * - * @return the sku value. - */ - public SkuDescription sku() { - return this.sku; - } - - /** - * Set the sku property: Name and tier of the SKU. - * - * @param sku the sku value to set. - * @return the SkuInfoInner object itself. - */ - public SkuInfoInner withSku(SkuDescription sku) { - this.sku = sku; - return this; - } - - /** - * Get the capacity property: Min, max, and default scale values of the SKU. - * - * @return the capacity value. - */ - public SkuCapacity capacity() { - return this.capacity; - } - - /** - * Set the capacity property: Min, max, and default scale values of the SKU. - * - * @param capacity the capacity value to set. - * @return the SkuInfoInner object itself. - */ - public SkuInfoInner withCapacity(SkuCapacity capacity) { - this.capacity = capacity; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (sku() != null) { - sku().validate(); - } - if (capacity() != null) { - capacity().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SkuInfosInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SkuInfosInner.java deleted file mode 100644 index d1a739872a19..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SkuInfosInner.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.GlobalCsmSkuDescription; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Collection of SKU information. */ -@Fluent -public final class SkuInfosInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SkuInfosInner.class); - - /* - * Resource type that this SKU applies to. - */ - @JsonProperty(value = "resourceType") - private String resourceType; - - /* - * List of SKUs the subscription is able to use. - */ - @JsonProperty(value = "skus") - private List skus; - - /** - * Get the resourceType property: Resource type that this SKU applies to. - * - * @return the resourceType value. - */ - public String resourceType() { - return this.resourceType; - } - - /** - * Set the resourceType property: Resource type that this SKU applies to. - * - * @param resourceType the resourceType value to set. - * @return the SkuInfosInner object itself. - */ - public SkuInfosInner withResourceType(String resourceType) { - this.resourceType = resourceType; - return this; - } - - /** - * Get the skus property: List of SKUs the subscription is able to use. - * - * @return the skus value. - */ - public List skus() { - return this.skus; - } - - /** - * Set the skus property: List of SKUs the subscription is able to use. - * - * @param skus the skus value to set. - * @return the SkuInfosInner object itself. - */ - public SkuInfosInner withSkus(List skus) { - this.skus = skus; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (skus() != null) { - skus().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SlotConfigNames.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SlotConfigNames.java deleted file mode 100644 index 6cfa9332c2bd..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SlotConfigNames.java +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** - * Names for connection strings, application settings, and external Azure storage account configuration identifiers to - * be marked as sticky to the deployment slot and not moved during a swap operation. This is valid for all deployment - * slots in an app. - */ -@Fluent -public final class SlotConfigNames { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SlotConfigNames.class); - - /* - * List of connection string names. - */ - @JsonProperty(value = "connectionStringNames") - private List connectionStringNames; - - /* - * List of application settings names. - */ - @JsonProperty(value = "appSettingNames") - private List appSettingNames; - - /* - * List of external Azure storage account identifiers. - */ - @JsonProperty(value = "azureStorageConfigNames") - private List azureStorageConfigNames; - - /** - * Get the connectionStringNames property: List of connection string names. - * - * @return the connectionStringNames value. - */ - public List connectionStringNames() { - return this.connectionStringNames; - } - - /** - * Set the connectionStringNames property: List of connection string names. - * - * @param connectionStringNames the connectionStringNames value to set. - * @return the SlotConfigNames object itself. - */ - public SlotConfigNames withConnectionStringNames(List connectionStringNames) { - this.connectionStringNames = connectionStringNames; - return this; - } - - /** - * Get the appSettingNames property: List of application settings names. - * - * @return the appSettingNames value. - */ - public List appSettingNames() { - return this.appSettingNames; - } - - /** - * Set the appSettingNames property: List of application settings names. - * - * @param appSettingNames the appSettingNames value to set. - * @return the SlotConfigNames object itself. - */ - public SlotConfigNames withAppSettingNames(List appSettingNames) { - this.appSettingNames = appSettingNames; - return this; - } - - /** - * Get the azureStorageConfigNames property: List of external Azure storage account identifiers. - * - * @return the azureStorageConfigNames value. - */ - public List azureStorageConfigNames() { - return this.azureStorageConfigNames; - } - - /** - * Set the azureStorageConfigNames property: List of external Azure storage account identifiers. - * - * @param azureStorageConfigNames the azureStorageConfigNames value to set. - * @return the SlotConfigNames object itself. - */ - public SlotConfigNames withAzureStorageConfigNames(List azureStorageConfigNames) { - this.azureStorageConfigNames = azureStorageConfigNames; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SlotConfigNamesResourceInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SlotConfigNamesResourceInner.java deleted file mode 100644 index a65eea5e764e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SlotConfigNamesResourceInner.java +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.ProxyOnlyResource; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Slot Config names azure resource. */ -@Fluent -public final class SlotConfigNamesResourceInner extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SlotConfigNamesResourceInner.class); - - /* - * Core resource properties - */ - @JsonProperty(value = "properties") - private SlotConfigNames innerProperties; - - /** - * Get the innerProperties property: Core resource properties. - * - * @return the innerProperties value. - */ - private SlotConfigNames innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public SlotConfigNamesResourceInner withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the connectionStringNames property: List of connection string names. - * - * @return the connectionStringNames value. - */ - public List connectionStringNames() { - return this.innerProperties() == null ? null : this.innerProperties().connectionStringNames(); - } - - /** - * Set the connectionStringNames property: List of connection string names. - * - * @param connectionStringNames the connectionStringNames value to set. - * @return the SlotConfigNamesResourceInner object itself. - */ - public SlotConfigNamesResourceInner withConnectionStringNames(List connectionStringNames) { - if (this.innerProperties() == null) { - this.innerProperties = new SlotConfigNames(); - } - this.innerProperties().withConnectionStringNames(connectionStringNames); - return this; - } - - /** - * Get the appSettingNames property: List of application settings names. - * - * @return the appSettingNames value. - */ - public List appSettingNames() { - return this.innerProperties() == null ? null : this.innerProperties().appSettingNames(); - } - - /** - * Set the appSettingNames property: List of application settings names. - * - * @param appSettingNames the appSettingNames value to set. - * @return the SlotConfigNamesResourceInner object itself. - */ - public SlotConfigNamesResourceInner withAppSettingNames(List appSettingNames) { - if (this.innerProperties() == null) { - this.innerProperties = new SlotConfigNames(); - } - this.innerProperties().withAppSettingNames(appSettingNames); - return this; - } - - /** - * Get the azureStorageConfigNames property: List of external Azure storage account identifiers. - * - * @return the azureStorageConfigNames value. - */ - public List azureStorageConfigNames() { - return this.innerProperties() == null ? null : this.innerProperties().azureStorageConfigNames(); - } - - /** - * Set the azureStorageConfigNames property: List of external Azure storage account identifiers. - * - * @param azureStorageConfigNames the azureStorageConfigNames value to set. - * @return the SlotConfigNamesResourceInner object itself. - */ - public SlotConfigNamesResourceInner withAzureStorageConfigNames(List azureStorageConfigNames) { - if (this.innerProperties() == null) { - this.innerProperties = new SlotConfigNames(); - } - this.innerProperties().withAzureStorageConfigNames(azureStorageConfigNames); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SlotDifferenceInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SlotDifferenceInner.java deleted file mode 100644 index ef8d4a3a0ea0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SlotDifferenceInner.java +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.ProxyOnlyResource; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** A setting difference between two deployment slots of an app. */ -@Fluent -public final class SlotDifferenceInner extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SlotDifferenceInner.class); - - /* - * SlotDifference resource specific properties - */ - @JsonProperty(value = "properties") - private SlotDifferenceProperties innerProperties; - - /** - * Get the innerProperties property: SlotDifference resource specific properties. - * - * @return the innerProperties value. - */ - private SlotDifferenceProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public SlotDifferenceInner withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the level property: Level of the difference: Information, Warning or Error. - * - * @return the level value. - */ - public String level() { - return this.innerProperties() == null ? null : this.innerProperties().level(); - } - - /** - * Get the settingType property: The type of the setting: General, AppSetting or ConnectionString. - * - * @return the settingType value. - */ - public String settingType() { - return this.innerProperties() == null ? null : this.innerProperties().settingType(); - } - - /** - * Get the diffRule property: Rule that describes how to process the setting difference during a slot swap. - * - * @return the diffRule value. - */ - public String diffRule() { - return this.innerProperties() == null ? null : this.innerProperties().diffRule(); - } - - /** - * Get the settingName property: Name of the setting. - * - * @return the settingName value. - */ - public String settingName() { - return this.innerProperties() == null ? null : this.innerProperties().settingName(); - } - - /** - * Get the valueInCurrentSlot property: Value of the setting in the current slot. - * - * @return the valueInCurrentSlot value. - */ - public String valueInCurrentSlot() { - return this.innerProperties() == null ? null : this.innerProperties().valueInCurrentSlot(); - } - - /** - * Get the valueInTargetSlot property: Value of the setting in the target slot. - * - * @return the valueInTargetSlot value. - */ - public String valueInTargetSlot() { - return this.innerProperties() == null ? null : this.innerProperties().valueInTargetSlot(); - } - - /** - * Get the description property: Description of the setting difference. - * - * @return the description value. - */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SlotDifferenceProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SlotDifferenceProperties.java deleted file mode 100644 index b5dc26c21d89..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SlotDifferenceProperties.java +++ /dev/null @@ -1,130 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** SlotDifference resource specific properties. */ -@Immutable -public final class SlotDifferenceProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SlotDifferenceProperties.class); - - /* - * Level of the difference: Information, Warning or Error. - */ - @JsonProperty(value = "level", access = JsonProperty.Access.WRITE_ONLY) - private String level; - - /* - * The type of the setting: General, AppSetting or ConnectionString. - */ - @JsonProperty(value = "settingType", access = JsonProperty.Access.WRITE_ONLY) - private String settingType; - - /* - * Rule that describes how to process the setting difference during a slot - * swap. - */ - @JsonProperty(value = "diffRule", access = JsonProperty.Access.WRITE_ONLY) - private String diffRule; - - /* - * Name of the setting. - */ - @JsonProperty(value = "settingName", access = JsonProperty.Access.WRITE_ONLY) - private String settingName; - - /* - * Value of the setting in the current slot. - */ - @JsonProperty(value = "valueInCurrentSlot", access = JsonProperty.Access.WRITE_ONLY) - private String valueInCurrentSlot; - - /* - * Value of the setting in the target slot. - */ - @JsonProperty(value = "valueInTargetSlot", access = JsonProperty.Access.WRITE_ONLY) - private String valueInTargetSlot; - - /* - * Description of the setting difference. - */ - @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) - private String description; - - /** - * Get the level property: Level of the difference: Information, Warning or Error. - * - * @return the level value. - */ - public String level() { - return this.level; - } - - /** - * Get the settingType property: The type of the setting: General, AppSetting or ConnectionString. - * - * @return the settingType value. - */ - public String settingType() { - return this.settingType; - } - - /** - * Get the diffRule property: Rule that describes how to process the setting difference during a slot swap. - * - * @return the diffRule value. - */ - public String diffRule() { - return this.diffRule; - } - - /** - * Get the settingName property: Name of the setting. - * - * @return the settingName value. - */ - public String settingName() { - return this.settingName; - } - - /** - * Get the valueInCurrentSlot property: Value of the setting in the current slot. - * - * @return the valueInCurrentSlot value. - */ - public String valueInCurrentSlot() { - return this.valueInCurrentSlot; - } - - /** - * Get the valueInTargetSlot property: Value of the setting in the target slot. - * - * @return the valueInTargetSlot value. - */ - public String valueInTargetSlot() { - return this.valueInTargetSlot; - } - - /** - * Get the description property: Description of the setting difference. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SnapshotInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SnapshotInner.java deleted file mode 100644 index 001907c9a683..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SnapshotInner.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.ProxyOnlyResource; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** A snapshot of an app. */ -@Fluent -public final class SnapshotInner extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SnapshotInner.class); - - /* - * Snapshot resource specific properties - */ - @JsonProperty(value = "properties") - private SnapshotProperties innerProperties; - - /** - * Get the innerProperties property: Snapshot resource specific properties. - * - * @return the innerProperties value. - */ - private SnapshotProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public SnapshotInner withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the time property: The time the snapshot was taken. - * - * @return the time value. - */ - public String time() { - return this.innerProperties() == null ? null : this.innerProperties().time(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SnapshotProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SnapshotProperties.java deleted file mode 100644 index 3ddb4dd76d40..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SnapshotProperties.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Snapshot resource specific properties. */ -@Immutable -public final class SnapshotProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SnapshotProperties.class); - - /* - * The time the snapshot was taken. - */ - @JsonProperty(value = "time", access = JsonProperty.Access.WRITE_ONLY) - private String time; - - /** - * Get the time property: The time the snapshot was taken. - * - * @return the time value. - */ - public String time() { - return this.time; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SnapshotRestoreRequestProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SnapshotRestoreRequestProperties.java deleted file mode 100644 index bf6afe86a3ae..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SnapshotRestoreRequestProperties.java +++ /dev/null @@ -1,198 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.SnapshotRecoverySource; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** SnapshotRestoreRequest resource specific properties. */ -@Fluent -public final class SnapshotRestoreRequestProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SnapshotRestoreRequestProperties.class); - - /* - * Point in time in which the app restore should be done, formatted as a - * DateTime string. - */ - @JsonProperty(value = "snapshotTime") - private String snapshotTime; - - /* - * Optional. Specifies the web app that snapshot contents will be retrieved - * from. - * If empty, the targeted web app will be used as the source. - */ - @JsonProperty(value = "recoverySource") - private SnapshotRecoverySource recoverySource; - - /* - * If true the restore operation can overwrite source app; - * otherwise, false. - */ - @JsonProperty(value = "overwrite", required = true) - private boolean overwrite; - - /* - * If true, site configuration, in addition to content, will be reverted. - */ - @JsonProperty(value = "recoverConfiguration") - private Boolean recoverConfiguration; - - /* - * If true, custom hostname conflicts will be ignored when recovering to a - * target web app. - * This setting is only necessary when RecoverConfiguration is enabled. - */ - @JsonProperty(value = "ignoreConflictingHostNames") - private Boolean ignoreConflictingHostNames; - - /* - * If true, the snapshot is retrieved from DRSecondary endpoint. - */ - @JsonProperty(value = "useDRSecondary") - private Boolean useDRSecondary; - - /** - * Get the snapshotTime property: Point in time in which the app restore should be done, formatted as a DateTime - * string. - * - * @return the snapshotTime value. - */ - public String snapshotTime() { - return this.snapshotTime; - } - - /** - * Set the snapshotTime property: Point in time in which the app restore should be done, formatted as a DateTime - * string. - * - * @param snapshotTime the snapshotTime value to set. - * @return the SnapshotRestoreRequestProperties object itself. - */ - public SnapshotRestoreRequestProperties withSnapshotTime(String snapshotTime) { - this.snapshotTime = snapshotTime; - return this; - } - - /** - * Get the recoverySource property: Optional. Specifies the web app that snapshot contents will be retrieved from. - * If empty, the targeted web app will be used as the source. - * - * @return the recoverySource value. - */ - public SnapshotRecoverySource recoverySource() { - return this.recoverySource; - } - - /** - * Set the recoverySource property: Optional. Specifies the web app that snapshot contents will be retrieved from. - * If empty, the targeted web app will be used as the source. - * - * @param recoverySource the recoverySource value to set. - * @return the SnapshotRestoreRequestProperties object itself. - */ - public SnapshotRestoreRequestProperties withRecoverySource(SnapshotRecoverySource recoverySource) { - this.recoverySource = recoverySource; - return this; - } - - /** - * Get the overwrite property: If <code>true</code> the restore operation can overwrite source app; - * otherwise, <code>false</code>. - * - * @return the overwrite value. - */ - public boolean overwrite() { - return this.overwrite; - } - - /** - * Set the overwrite property: If <code>true</code> the restore operation can overwrite source app; - * otherwise, <code>false</code>. - * - * @param overwrite the overwrite value to set. - * @return the SnapshotRestoreRequestProperties object itself. - */ - public SnapshotRestoreRequestProperties withOverwrite(boolean overwrite) { - this.overwrite = overwrite; - return this; - } - - /** - * Get the recoverConfiguration property: If true, site configuration, in addition to content, will be reverted. - * - * @return the recoverConfiguration value. - */ - public Boolean recoverConfiguration() { - return this.recoverConfiguration; - } - - /** - * Set the recoverConfiguration property: If true, site configuration, in addition to content, will be reverted. - * - * @param recoverConfiguration the recoverConfiguration value to set. - * @return the SnapshotRestoreRequestProperties object itself. - */ - public SnapshotRestoreRequestProperties withRecoverConfiguration(Boolean recoverConfiguration) { - this.recoverConfiguration = recoverConfiguration; - return this; - } - - /** - * Get the ignoreConflictingHostNames property: If true, custom hostname conflicts will be ignored when recovering - * to a target web app. This setting is only necessary when RecoverConfiguration is enabled. - * - * @return the ignoreConflictingHostNames value. - */ - public Boolean ignoreConflictingHostNames() { - return this.ignoreConflictingHostNames; - } - - /** - * Set the ignoreConflictingHostNames property: If true, custom hostname conflicts will be ignored when recovering - * to a target web app. This setting is only necessary when RecoverConfiguration is enabled. - * - * @param ignoreConflictingHostNames the ignoreConflictingHostNames value to set. - * @return the SnapshotRestoreRequestProperties object itself. - */ - public SnapshotRestoreRequestProperties withIgnoreConflictingHostNames(Boolean ignoreConflictingHostNames) { - this.ignoreConflictingHostNames = ignoreConflictingHostNames; - return this; - } - - /** - * Get the useDRSecondary property: If true, the snapshot is retrieved from DRSecondary endpoint. - * - * @return the useDRSecondary value. - */ - public Boolean useDRSecondary() { - return this.useDRSecondary; - } - - /** - * Set the useDRSecondary property: If true, the snapshot is retrieved from DRSecondary endpoint. - * - * @param useDRSecondary the useDRSecondary value to set. - * @return the SnapshotRestoreRequestProperties object itself. - */ - public SnapshotRestoreRequestProperties withUseDRSecondary(Boolean useDRSecondary) { - this.useDRSecondary = useDRSecondary; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (recoverySource() != null) { - recoverySource().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SourceControlInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SourceControlInner.java deleted file mode 100644 index 5d4c38c9e47d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SourceControlInner.java +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.ProxyOnlyResource; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** The source control OAuth token. */ -@Fluent -public final class SourceControlInner extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SourceControlInner.class); - - /* - * SourceControl resource specific properties - */ - @JsonProperty(value = "properties") - private SourceControlProperties innerProperties; - - /** - * Get the innerProperties property: SourceControl resource specific properties. - * - * @return the innerProperties value. - */ - private SourceControlProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public SourceControlInner withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the token property: OAuth access token. - * - * @return the token value. - */ - public String token() { - return this.innerProperties() == null ? null : this.innerProperties().token(); - } - - /** - * Set the token property: OAuth access token. - * - * @param token the token value to set. - * @return the SourceControlInner object itself. - */ - public SourceControlInner withToken(String token) { - if (this.innerProperties() == null) { - this.innerProperties = new SourceControlProperties(); - } - this.innerProperties().withToken(token); - return this; - } - - /** - * Get the tokenSecret property: OAuth access token secret. - * - * @return the tokenSecret value. - */ - public String tokenSecret() { - return this.innerProperties() == null ? null : this.innerProperties().tokenSecret(); - } - - /** - * Set the tokenSecret property: OAuth access token secret. - * - * @param tokenSecret the tokenSecret value to set. - * @return the SourceControlInner object itself. - */ - public SourceControlInner withTokenSecret(String tokenSecret) { - if (this.innerProperties() == null) { - this.innerProperties = new SourceControlProperties(); - } - this.innerProperties().withTokenSecret(tokenSecret); - return this; - } - - /** - * Get the refreshToken property: OAuth refresh token. - * - * @return the refreshToken value. - */ - public String refreshToken() { - return this.innerProperties() == null ? null : this.innerProperties().refreshToken(); - } - - /** - * Set the refreshToken property: OAuth refresh token. - * - * @param refreshToken the refreshToken value to set. - * @return the SourceControlInner object itself. - */ - public SourceControlInner withRefreshToken(String refreshToken) { - if (this.innerProperties() == null) { - this.innerProperties = new SourceControlProperties(); - } - this.innerProperties().withRefreshToken(refreshToken); - return this; - } - - /** - * Get the expirationTime property: OAuth token expiration. - * - * @return the expirationTime value. - */ - public OffsetDateTime expirationTime() { - return this.innerProperties() == null ? null : this.innerProperties().expirationTime(); - } - - /** - * Set the expirationTime property: OAuth token expiration. - * - * @param expirationTime the expirationTime value to set. - * @return the SourceControlInner object itself. - */ - public SourceControlInner withExpirationTime(OffsetDateTime expirationTime) { - if (this.innerProperties() == null) { - this.innerProperties = new SourceControlProperties(); - } - this.innerProperties().withExpirationTime(expirationTime); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SourceControlProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SourceControlProperties.java deleted file mode 100644 index 2899cd08fafe..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SourceControlProperties.java +++ /dev/null @@ -1,129 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** SourceControl resource specific properties. */ -@Fluent -public final class SourceControlProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SourceControlProperties.class); - - /* - * OAuth access token. - */ - @JsonProperty(value = "token") - private String token; - - /* - * OAuth access token secret. - */ - @JsonProperty(value = "tokenSecret") - private String tokenSecret; - - /* - * OAuth refresh token. - */ - @JsonProperty(value = "refreshToken") - private String refreshToken; - - /* - * OAuth token expiration. - */ - @JsonProperty(value = "expirationTime") - private OffsetDateTime expirationTime; - - /** - * Get the token property: OAuth access token. - * - * @return the token value. - */ - public String token() { - return this.token; - } - - /** - * Set the token property: OAuth access token. - * - * @param token the token value to set. - * @return the SourceControlProperties object itself. - */ - public SourceControlProperties withToken(String token) { - this.token = token; - return this; - } - - /** - * Get the tokenSecret property: OAuth access token secret. - * - * @return the tokenSecret value. - */ - public String tokenSecret() { - return this.tokenSecret; - } - - /** - * Set the tokenSecret property: OAuth access token secret. - * - * @param tokenSecret the tokenSecret value to set. - * @return the SourceControlProperties object itself. - */ - public SourceControlProperties withTokenSecret(String tokenSecret) { - this.tokenSecret = tokenSecret; - return this; - } - - /** - * Get the refreshToken property: OAuth refresh token. - * - * @return the refreshToken value. - */ - public String refreshToken() { - return this.refreshToken; - } - - /** - * Set the refreshToken property: OAuth refresh token. - * - * @param refreshToken the refreshToken value to set. - * @return the SourceControlProperties object itself. - */ - public SourceControlProperties withRefreshToken(String refreshToken) { - this.refreshToken = refreshToken; - return this; - } - - /** - * Get the expirationTime property: OAuth token expiration. - * - * @return the expirationTime value. - */ - public OffsetDateTime expirationTime() { - return this.expirationTime; - } - - /** - * Set the expirationTime property: OAuth token expiration. - * - * @param expirationTime the expirationTime value to set. - * @return the SourceControlProperties object itself. - */ - public SourceControlProperties withExpirationTime(OffsetDateTime expirationTime) { - this.expirationTime = expirationTime; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/StampCapacityInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/StampCapacityInner.java deleted file mode 100644 index f4af2914df24..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/StampCapacityInner.java +++ /dev/null @@ -1,321 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.ComputeModeOptions; -import com.azure.resourcemanager.appservice.models.WorkerSizeOptions; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Stamp capacity information. */ -@Fluent -public final class StampCapacityInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(StampCapacityInner.class); - - /* - * Name of the stamp. - */ - @JsonProperty(value = "name") - private String name; - - /* - * Available capacity (# of machines, bytes of storage etc...). - */ - @JsonProperty(value = "availableCapacity") - private Long availableCapacity; - - /* - * Total capacity (# of machines, bytes of storage etc...). - */ - @JsonProperty(value = "totalCapacity") - private Long totalCapacity; - - /* - * Name of the unit. - */ - @JsonProperty(value = "unit") - private String unit; - - /* - * Shared/dedicated workers. - */ - @JsonProperty(value = "computeMode") - private ComputeModeOptions computeMode; - - /* - * Size of the machines. - */ - @JsonProperty(value = "workerSize") - private WorkerSizeOptions workerSize; - - /* - * Size ID of machines: - * 0 - Small - * 1 - Medium - * 2 - Large - */ - @JsonProperty(value = "workerSizeId") - private Integer workerSizeId; - - /* - * If true, it includes basic apps. - * Basic apps are not used for capacity allocation. - */ - @JsonProperty(value = "excludeFromCapacityAllocation") - private Boolean excludeFromCapacityAllocation; - - /* - * true if capacity is applicable for all apps; otherwise, - * false. - */ - @JsonProperty(value = "isApplicableForAllComputeModes") - private Boolean isApplicableForAllComputeModes; - - /* - * Shared or Dedicated. - */ - @JsonProperty(value = "siteMode") - private String siteMode; - - /* - * Is this a linux stamp capacity - */ - @JsonProperty(value = "isLinux") - private Boolean isLinux; - - /** - * Get the name property: Name of the stamp. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Name of the stamp. - * - * @param name the name value to set. - * @return the StampCapacityInner object itself. - */ - public StampCapacityInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the availableCapacity property: Available capacity (# of machines, bytes of storage etc...). - * - * @return the availableCapacity value. - */ - public Long availableCapacity() { - return this.availableCapacity; - } - - /** - * Set the availableCapacity property: Available capacity (# of machines, bytes of storage etc...). - * - * @param availableCapacity the availableCapacity value to set. - * @return the StampCapacityInner object itself. - */ - public StampCapacityInner withAvailableCapacity(Long availableCapacity) { - this.availableCapacity = availableCapacity; - return this; - } - - /** - * Get the totalCapacity property: Total capacity (# of machines, bytes of storage etc...). - * - * @return the totalCapacity value. - */ - public Long totalCapacity() { - return this.totalCapacity; - } - - /** - * Set the totalCapacity property: Total capacity (# of machines, bytes of storage etc...). - * - * @param totalCapacity the totalCapacity value to set. - * @return the StampCapacityInner object itself. - */ - public StampCapacityInner withTotalCapacity(Long totalCapacity) { - this.totalCapacity = totalCapacity; - return this; - } - - /** - * Get the unit property: Name of the unit. - * - * @return the unit value. - */ - public String unit() { - return this.unit; - } - - /** - * Set the unit property: Name of the unit. - * - * @param unit the unit value to set. - * @return the StampCapacityInner object itself. - */ - public StampCapacityInner withUnit(String unit) { - this.unit = unit; - return this; - } - - /** - * Get the computeMode property: Shared/dedicated workers. - * - * @return the computeMode value. - */ - public ComputeModeOptions computeMode() { - return this.computeMode; - } - - /** - * Set the computeMode property: Shared/dedicated workers. - * - * @param computeMode the computeMode value to set. - * @return the StampCapacityInner object itself. - */ - public StampCapacityInner withComputeMode(ComputeModeOptions computeMode) { - this.computeMode = computeMode; - return this; - } - - /** - * Get the workerSize property: Size of the machines. - * - * @return the workerSize value. - */ - public WorkerSizeOptions workerSize() { - return this.workerSize; - } - - /** - * Set the workerSize property: Size of the machines. - * - * @param workerSize the workerSize value to set. - * @return the StampCapacityInner object itself. - */ - public StampCapacityInner withWorkerSize(WorkerSizeOptions workerSize) { - this.workerSize = workerSize; - return this; - } - - /** - * Get the workerSizeId property: Size ID of machines: 0 - Small 1 - Medium 2 - Large. - * - * @return the workerSizeId value. - */ - public Integer workerSizeId() { - return this.workerSizeId; - } - - /** - * Set the workerSizeId property: Size ID of machines: 0 - Small 1 - Medium 2 - Large. - * - * @param workerSizeId the workerSizeId value to set. - * @return the StampCapacityInner object itself. - */ - public StampCapacityInner withWorkerSizeId(Integer workerSizeId) { - this.workerSizeId = workerSizeId; - return this; - } - - /** - * Get the excludeFromCapacityAllocation property: If <code>true</code>, it includes basic apps. Basic - * apps are not used for capacity allocation. - * - * @return the excludeFromCapacityAllocation value. - */ - public Boolean excludeFromCapacityAllocation() { - return this.excludeFromCapacityAllocation; - } - - /** - * Set the excludeFromCapacityAllocation property: If <code>true</code>, it includes basic apps. Basic - * apps are not used for capacity allocation. - * - * @param excludeFromCapacityAllocation the excludeFromCapacityAllocation value to set. - * @return the StampCapacityInner object itself. - */ - public StampCapacityInner withExcludeFromCapacityAllocation(Boolean excludeFromCapacityAllocation) { - this.excludeFromCapacityAllocation = excludeFromCapacityAllocation; - return this; - } - - /** - * Get the isApplicableForAllComputeModes property: <code>true</code> if capacity is applicable for all - * apps; otherwise, <code>false</code>. - * - * @return the isApplicableForAllComputeModes value. - */ - public Boolean isApplicableForAllComputeModes() { - return this.isApplicableForAllComputeModes; - } - - /** - * Set the isApplicableForAllComputeModes property: <code>true</code> if capacity is applicable for all - * apps; otherwise, <code>false</code>. - * - * @param isApplicableForAllComputeModes the isApplicableForAllComputeModes value to set. - * @return the StampCapacityInner object itself. - */ - public StampCapacityInner withIsApplicableForAllComputeModes(Boolean isApplicableForAllComputeModes) { - this.isApplicableForAllComputeModes = isApplicableForAllComputeModes; - return this; - } - - /** - * Get the siteMode property: Shared or Dedicated. - * - * @return the siteMode value. - */ - public String siteMode() { - return this.siteMode; - } - - /** - * Set the siteMode property: Shared or Dedicated. - * - * @param siteMode the siteMode value to set. - * @return the StampCapacityInner object itself. - */ - public StampCapacityInner withSiteMode(String siteMode) { - this.siteMode = siteMode; - return this; - } - - /** - * Get the isLinux property: Is this a linux stamp capacity. - * - * @return the isLinux value. - */ - public Boolean isLinux() { - return this.isLinux; - } - - /** - * Set the isLinux property: Is this a linux stamp capacity. - * - * @param isLinux the isLinux value to set. - * @return the StampCapacityInner object itself. - */ - public StampCapacityInner withIsLinux(Boolean isLinux) { - this.isLinux = isLinux; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/StorageMigrationOptionsProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/StorageMigrationOptionsProperties.java deleted file mode 100644 index d8a7d2266e39..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/StorageMigrationOptionsProperties.java +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** StorageMigrationOptions resource specific properties. */ -@Fluent -public final class StorageMigrationOptionsProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageMigrationOptionsProperties.class); - - /* - * AzureFiles connection string. - */ - @JsonProperty(value = "azurefilesConnectionString", required = true) - private String azurefilesConnectionString; - - /* - * AzureFiles share. - */ - @JsonProperty(value = "azurefilesShare", required = true) - private String azurefilesShare; - - /* - * trueif the app should be switched over; otherwise, - * false. - */ - @JsonProperty(value = "switchSiteAfterMigration") - private Boolean switchSiteAfterMigration; - - /* - * true if the app should be read only during copy operation; - * otherwise, false. - */ - @JsonProperty(value = "blockWriteAccessToSite") - private Boolean blockWriteAccessToSite; - - /** - * Get the azurefilesConnectionString property: AzureFiles connection string. - * - * @return the azurefilesConnectionString value. - */ - public String azurefilesConnectionString() { - return this.azurefilesConnectionString; - } - - /** - * Set the azurefilesConnectionString property: AzureFiles connection string. - * - * @param azurefilesConnectionString the azurefilesConnectionString value to set. - * @return the StorageMigrationOptionsProperties object itself. - */ - public StorageMigrationOptionsProperties withAzurefilesConnectionString(String azurefilesConnectionString) { - this.azurefilesConnectionString = azurefilesConnectionString; - return this; - } - - /** - * Get the azurefilesShare property: AzureFiles share. - * - * @return the azurefilesShare value. - */ - public String azurefilesShare() { - return this.azurefilesShare; - } - - /** - * Set the azurefilesShare property: AzureFiles share. - * - * @param azurefilesShare the azurefilesShare value to set. - * @return the StorageMigrationOptionsProperties object itself. - */ - public StorageMigrationOptionsProperties withAzurefilesShare(String azurefilesShare) { - this.azurefilesShare = azurefilesShare; - return this; - } - - /** - * Get the switchSiteAfterMigration property: <code>true</code>if the app should be switched over; - * otherwise, <code>false</code>. - * - * @return the switchSiteAfterMigration value. - */ - public Boolean switchSiteAfterMigration() { - return this.switchSiteAfterMigration; - } - - /** - * Set the switchSiteAfterMigration property: <code>true</code>if the app should be switched over; - * otherwise, <code>false</code>. - * - * @param switchSiteAfterMigration the switchSiteAfterMigration value to set. - * @return the StorageMigrationOptionsProperties object itself. - */ - public StorageMigrationOptionsProperties withSwitchSiteAfterMigration(Boolean switchSiteAfterMigration) { - this.switchSiteAfterMigration = switchSiteAfterMigration; - return this; - } - - /** - * Get the blockWriteAccessToSite property: <code>true</code> if the app should be read only during copy - * operation; otherwise, <code>false</code>. - * - * @return the blockWriteAccessToSite value. - */ - public Boolean blockWriteAccessToSite() { - return this.blockWriteAccessToSite; - } - - /** - * Set the blockWriteAccessToSite property: <code>true</code> if the app should be read only during copy - * operation; otherwise, <code>false</code>. - * - * @param blockWriteAccessToSite the blockWriteAccessToSite value to set. - * @return the StorageMigrationOptionsProperties object itself. - */ - public StorageMigrationOptionsProperties withBlockWriteAccessToSite(Boolean blockWriteAccessToSite) { - this.blockWriteAccessToSite = blockWriteAccessToSite; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (azurefilesConnectionString() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property azurefilesConnectionString in model" - + " StorageMigrationOptionsProperties")); - } - if (azurefilesShare() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property azurefilesShare in model StorageMigrationOptionsProperties")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/StorageMigrationResponseInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/StorageMigrationResponseInner.java deleted file mode 100644 index bf30d8254430..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/StorageMigrationResponseInner.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.ProxyOnlyResource; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Response for a migration of app content request. */ -@Fluent -public final class StorageMigrationResponseInner extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageMigrationResponseInner.class); - - /* - * StorageMigrationResponse resource specific properties - */ - @JsonProperty(value = "properties") - private StorageMigrationResponseProperties innerProperties; - - /** - * Get the innerProperties property: StorageMigrationResponse resource specific properties. - * - * @return the innerProperties value. - */ - private StorageMigrationResponseProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public StorageMigrationResponseInner withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the operationId property: When server starts the migration process, it will return an operation ID - * identifying that particular migration operation. - * - * @return the operationId value. - */ - public String operationId() { - return this.innerProperties() == null ? null : this.innerProperties().operationId(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/StorageMigrationResponseProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/StorageMigrationResponseProperties.java deleted file mode 100644 index 072013422342..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/StorageMigrationResponseProperties.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** StorageMigrationResponse resource specific properties. */ -@Immutable -public final class StorageMigrationResponseProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageMigrationResponseProperties.class); - - /* - * When server starts the migration process, it will return an operation ID - * identifying that particular migration operation. - */ - @JsonProperty(value = "operationId", access = JsonProperty.Access.WRITE_ONLY) - private String operationId; - - /** - * Get the operationId property: When server starts the migration process, it will return an operation ID - * identifying that particular migration operation. - * - * @return the operationId value. - */ - public String operationId() { - return this.operationId; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/StringDictionaryInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/StringDictionaryInner.java deleted file mode 100644 index 147441e52fd2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/StringDictionaryInner.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.ProxyOnlyResource; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** String dictionary resource. */ -@Fluent -public final class StringDictionaryInner extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(StringDictionaryInner.class); - - /* - * Settings. - */ - @JsonProperty(value = "properties") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map properties; - - /** - * Get the properties property: Settings. - * - * @return the properties value. - */ - public Map properties() { - return this.properties; - } - - /** - * Set the properties property: Settings. - * - * @param properties the properties value to set. - * @return the StringDictionaryInner object itself. - */ - public StringDictionaryInner withProperties(Map properties) { - this.properties = properties; - return this; - } - - /** {@inheritDoc} */ - @Override - public StringDictionaryInner withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SwiftVirtualNetworkInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SwiftVirtualNetworkInner.java deleted file mode 100644 index 4d91e582fa65..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SwiftVirtualNetworkInner.java +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.ProxyOnlyResource; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Swift Virtual Network Contract. This is used to enable the new Swift way of doing virtual network integration. */ -@Fluent -public final class SwiftVirtualNetworkInner extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SwiftVirtualNetworkInner.class); - - /* - * SwiftVirtualNetwork resource specific properties - */ - @JsonProperty(value = "properties") - private SwiftVirtualNetworkProperties innerProperties; - - /** - * Get the innerProperties property: SwiftVirtualNetwork resource specific properties. - * - * @return the innerProperties value. - */ - private SwiftVirtualNetworkProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public SwiftVirtualNetworkInner withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the subnetResourceId property: The Virtual Network subnet's resource ID. This is the subnet that this Web App - * will join. This subnet must have a delegation to Microsoft.Web/serverFarms defined first. - * - * @return the subnetResourceId value. - */ - public String subnetResourceId() { - return this.innerProperties() == null ? null : this.innerProperties().subnetResourceId(); - } - - /** - * Set the subnetResourceId property: The Virtual Network subnet's resource ID. This is the subnet that this Web App - * will join. This subnet must have a delegation to Microsoft.Web/serverFarms defined first. - * - * @param subnetResourceId the subnetResourceId value to set. - * @return the SwiftVirtualNetworkInner object itself. - */ - public SwiftVirtualNetworkInner withSubnetResourceId(String subnetResourceId) { - if (this.innerProperties() == null) { - this.innerProperties = new SwiftVirtualNetworkProperties(); - } - this.innerProperties().withSubnetResourceId(subnetResourceId); - return this; - } - - /** - * Get the swiftSupported property: A flag that specifies if the scale unit this Web App is on supports Swift - * integration. - * - * @return the swiftSupported value. - */ - public Boolean swiftSupported() { - return this.innerProperties() == null ? null : this.innerProperties().swiftSupported(); - } - - /** - * Set the swiftSupported property: A flag that specifies if the scale unit this Web App is on supports Swift - * integration. - * - * @param swiftSupported the swiftSupported value to set. - * @return the SwiftVirtualNetworkInner object itself. - */ - public SwiftVirtualNetworkInner withSwiftSupported(Boolean swiftSupported) { - if (this.innerProperties() == null) { - this.innerProperties = new SwiftVirtualNetworkProperties(); - } - this.innerProperties().withSwiftSupported(swiftSupported); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SwiftVirtualNetworkProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SwiftVirtualNetworkProperties.java deleted file mode 100644 index f355ca1ec4d1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SwiftVirtualNetworkProperties.java +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** SwiftVirtualNetwork resource specific properties. */ -@Fluent -public final class SwiftVirtualNetworkProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SwiftVirtualNetworkProperties.class); - - /* - * The Virtual Network subnet's resource ID. This is the subnet that this - * Web App will join. This subnet must have a delegation to - * Microsoft.Web/serverFarms defined first. - */ - @JsonProperty(value = "subnetResourceId") - private String subnetResourceId; - - /* - * A flag that specifies if the scale unit this Web App is on supports - * Swift integration. - */ - @JsonProperty(value = "swiftSupported") - private Boolean swiftSupported; - - /** - * Get the subnetResourceId property: The Virtual Network subnet's resource ID. This is the subnet that this Web App - * will join. This subnet must have a delegation to Microsoft.Web/serverFarms defined first. - * - * @return the subnetResourceId value. - */ - public String subnetResourceId() { - return this.subnetResourceId; - } - - /** - * Set the subnetResourceId property: The Virtual Network subnet's resource ID. This is the subnet that this Web App - * will join. This subnet must have a delegation to Microsoft.Web/serverFarms defined first. - * - * @param subnetResourceId the subnetResourceId value to set. - * @return the SwiftVirtualNetworkProperties object itself. - */ - public SwiftVirtualNetworkProperties withSubnetResourceId(String subnetResourceId) { - this.subnetResourceId = subnetResourceId; - return this; - } - - /** - * Get the swiftSupported property: A flag that specifies if the scale unit this Web App is on supports Swift - * integration. - * - * @return the swiftSupported value. - */ - public Boolean swiftSupported() { - return this.swiftSupported; - } - - /** - * Set the swiftSupported property: A flag that specifies if the scale unit this Web App is on supports Swift - * integration. - * - * @param swiftSupported the swiftSupported value to set. - * @return the SwiftVirtualNetworkProperties object itself. - */ - public SwiftVirtualNetworkProperties withSwiftSupported(Boolean swiftSupported) { - this.swiftSupported = swiftSupported; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/TldLegalAgreementInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/TldLegalAgreementInner.java deleted file mode 100644 index f68e581a2206..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/TldLegalAgreementInner.java +++ /dev/null @@ -1,144 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Legal agreement for a top level domain. */ -@Fluent -public final class TldLegalAgreementInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TldLegalAgreementInner.class); - - /* - * Unique identifier for the agreement. - */ - @JsonProperty(value = "agreementKey", required = true) - private String agreementKey; - - /* - * Agreement title. - */ - @JsonProperty(value = "title", required = true) - private String title; - - /* - * Agreement details. - */ - @JsonProperty(value = "content", required = true) - private String content; - - /* - * URL where a copy of the agreement details is hosted. - */ - @JsonProperty(value = "url") - private String url; - - /** - * Get the agreementKey property: Unique identifier for the agreement. - * - * @return the agreementKey value. - */ - public String agreementKey() { - return this.agreementKey; - } - - /** - * Set the agreementKey property: Unique identifier for the agreement. - * - * @param agreementKey the agreementKey value to set. - * @return the TldLegalAgreementInner object itself. - */ - public TldLegalAgreementInner withAgreementKey(String agreementKey) { - this.agreementKey = agreementKey; - return this; - } - - /** - * Get the title property: Agreement title. - * - * @return the title value. - */ - public String title() { - return this.title; - } - - /** - * Set the title property: Agreement title. - * - * @param title the title value to set. - * @return the TldLegalAgreementInner object itself. - */ - public TldLegalAgreementInner withTitle(String title) { - this.title = title; - return this; - } - - /** - * Get the content property: Agreement details. - * - * @return the content value. - */ - public String content() { - return this.content; - } - - /** - * Set the content property: Agreement details. - * - * @param content the content value to set. - * @return the TldLegalAgreementInner object itself. - */ - public TldLegalAgreementInner withContent(String content) { - this.content = content; - return this; - } - - /** - * Get the url property: URL where a copy of the agreement details is hosted. - * - * @return the url value. - */ - public String url() { - return this.url; - } - - /** - * Set the url property: URL where a copy of the agreement details is hosted. - * - * @param url the url value to set. - * @return the TldLegalAgreementInner object itself. - */ - public TldLegalAgreementInner withUrl(String url) { - this.url = url; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (agreementKey() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property agreementKey in model TldLegalAgreementInner")); - } - if (title() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property title in model TldLegalAgreementInner")); - } - if (content() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property content in model TldLegalAgreementInner")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/TopLevelDomainInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/TopLevelDomainInner.java deleted file mode 100644 index d74cc4f3e41c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/TopLevelDomainInner.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.ProxyOnlyResource; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** A top level domain object. */ -@Fluent -public final class TopLevelDomainInner extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TopLevelDomainInner.class); - - /* - * TopLevelDomain resource specific properties - */ - @JsonProperty(value = "properties") - private TopLevelDomainProperties innerProperties; - - /** - * Get the innerProperties property: TopLevelDomain resource specific properties. - * - * @return the innerProperties value. - */ - private TopLevelDomainProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public TopLevelDomainInner withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the privacy property: If <code>true</code>, then the top level domain supports domain privacy; - * otherwise, <code>false</code>. - * - * @return the privacy value. - */ - public Boolean privacy() { - return this.innerProperties() == null ? null : this.innerProperties().privacy(); - } - - /** - * Set the privacy property: If <code>true</code>, then the top level domain supports domain privacy; - * otherwise, <code>false</code>. - * - * @param privacy the privacy value to set. - * @return the TopLevelDomainInner object itself. - */ - public TopLevelDomainInner withPrivacy(Boolean privacy) { - if (this.innerProperties() == null) { - this.innerProperties = new TopLevelDomainProperties(); - } - this.innerProperties().withPrivacy(privacy); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/TopLevelDomainProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/TopLevelDomainProperties.java deleted file mode 100644 index 3f3f311109c5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/TopLevelDomainProperties.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** TopLevelDomain resource specific properties. */ -@Fluent -public final class TopLevelDomainProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TopLevelDomainProperties.class); - - /* - * If true, then the top level domain supports domain privacy; - * otherwise, false. - */ - @JsonProperty(value = "privacy") - private Boolean privacy; - - /** - * Get the privacy property: If <code>true</code>, then the top level domain supports domain privacy; - * otherwise, <code>false</code>. - * - * @return the privacy value. - */ - public Boolean privacy() { - return this.privacy; - } - - /** - * Set the privacy property: If <code>true</code>, then the top level domain supports domain privacy; - * otherwise, <code>false</code>. - * - * @param privacy the privacy value to set. - * @return the TopLevelDomainProperties object itself. - */ - public TopLevelDomainProperties withPrivacy(Boolean privacy) { - this.privacy = privacy; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/TriggeredJobHistoryInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/TriggeredJobHistoryInner.java deleted file mode 100644 index 6abeb6bc9811..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/TriggeredJobHistoryInner.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.ProxyOnlyResource; -import com.azure.resourcemanager.appservice.models.TriggeredJobRun; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Triggered Web Job History. List of Triggered Web Job Run Information elements. */ -@Fluent -public final class TriggeredJobHistoryInner extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TriggeredJobHistoryInner.class); - - /* - * TriggeredJobHistory resource specific properties - */ - @JsonProperty(value = "properties") - private TriggeredJobHistoryProperties innerProperties; - - /** - * Get the innerProperties property: TriggeredJobHistory resource specific properties. - * - * @return the innerProperties value. - */ - private TriggeredJobHistoryProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public TriggeredJobHistoryInner withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the runs property: List of triggered web job runs. - * - * @return the runs value. - */ - public List runs() { - return this.innerProperties() == null ? null : this.innerProperties().runs(); - } - - /** - * Set the runs property: List of triggered web job runs. - * - * @param runs the runs value to set. - * @return the TriggeredJobHistoryInner object itself. - */ - public TriggeredJobHistoryInner withRuns(List runs) { - if (this.innerProperties() == null) { - this.innerProperties = new TriggeredJobHistoryProperties(); - } - this.innerProperties().withRuns(runs); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/TriggeredJobHistoryProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/TriggeredJobHistoryProperties.java deleted file mode 100644 index 7bec7f0405a1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/TriggeredJobHistoryProperties.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.TriggeredJobRun; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** TriggeredJobHistory resource specific properties. */ -@Fluent -public final class TriggeredJobHistoryProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TriggeredJobHistoryProperties.class); - - /* - * List of triggered web job runs. - */ - @JsonProperty(value = "runs") - private List runs; - - /** - * Get the runs property: List of triggered web job runs. - * - * @return the runs value. - */ - public List runs() { - return this.runs; - } - - /** - * Set the runs property: List of triggered web job runs. - * - * @param runs the runs value to set. - * @return the TriggeredJobHistoryProperties object itself. - */ - public TriggeredJobHistoryProperties withRuns(List runs) { - this.runs = runs; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (runs() != null) { - runs().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/TriggeredJobRunProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/TriggeredJobRunProperties.java deleted file mode 100644 index 623293191979..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/TriggeredJobRunProperties.java +++ /dev/null @@ -1,312 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.TriggeredWebJobStatus; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** TriggeredJobRun resource specific properties. */ -@Fluent -public final class TriggeredJobRunProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TriggeredJobRunProperties.class); - - /* - * Job ID. - */ - @JsonProperty(value = "web_job_id") - private String webJobId; - - /* - * Job name. - */ - @JsonProperty(value = "web_job_name") - private String webJobName; - - /* - * Job status. - */ - @JsonProperty(value = "status") - private TriggeredWebJobStatus status; - - /* - * Start time. - */ - @JsonProperty(value = "start_time") - private OffsetDateTime startTime; - - /* - * End time. - */ - @JsonProperty(value = "end_time") - private OffsetDateTime endTime; - - /* - * Job duration. - */ - @JsonProperty(value = "duration") - private String duration; - - /* - * Output URL. - */ - @JsonProperty(value = "output_url") - private String outputUrl; - - /* - * Error URL. - */ - @JsonProperty(value = "error_url") - private String errorUrl; - - /* - * Job URL. - */ - @JsonProperty(value = "url") - private String url; - - /* - * Job name. - */ - @JsonProperty(value = "job_name") - private String jobName; - - /* - * Job trigger. - */ - @JsonProperty(value = "trigger") - private String trigger; - - /** - * Get the webJobId property: Job ID. - * - * @return the webJobId value. - */ - public String webJobId() { - return this.webJobId; - } - - /** - * Set the webJobId property: Job ID. - * - * @param webJobId the webJobId value to set. - * @return the TriggeredJobRunProperties object itself. - */ - public TriggeredJobRunProperties withWebJobId(String webJobId) { - this.webJobId = webJobId; - return this; - } - - /** - * Get the webJobName property: Job name. - * - * @return the webJobName value. - */ - public String webJobName() { - return this.webJobName; - } - - /** - * Set the webJobName property: Job name. - * - * @param webJobName the webJobName value to set. - * @return the TriggeredJobRunProperties object itself. - */ - public TriggeredJobRunProperties withWebJobName(String webJobName) { - this.webJobName = webJobName; - return this; - } - - /** - * Get the status property: Job status. - * - * @return the status value. - */ - public TriggeredWebJobStatus status() { - return this.status; - } - - /** - * Set the status property: Job status. - * - * @param status the status value to set. - * @return the TriggeredJobRunProperties object itself. - */ - public TriggeredJobRunProperties withStatus(TriggeredWebJobStatus status) { - this.status = status; - return this; - } - - /** - * Get the startTime property: Start time. - * - * @return the startTime value. - */ - public OffsetDateTime startTime() { - return this.startTime; - } - - /** - * Set the startTime property: Start time. - * - * @param startTime the startTime value to set. - * @return the TriggeredJobRunProperties object itself. - */ - public TriggeredJobRunProperties withStartTime(OffsetDateTime startTime) { - this.startTime = startTime; - return this; - } - - /** - * Get the endTime property: End time. - * - * @return the endTime value. - */ - public OffsetDateTime endTime() { - return this.endTime; - } - - /** - * Set the endTime property: End time. - * - * @param endTime the endTime value to set. - * @return the TriggeredJobRunProperties object itself. - */ - public TriggeredJobRunProperties withEndTime(OffsetDateTime endTime) { - this.endTime = endTime; - return this; - } - - /** - * Get the duration property: Job duration. - * - * @return the duration value. - */ - public String duration() { - return this.duration; - } - - /** - * Set the duration property: Job duration. - * - * @param duration the duration value to set. - * @return the TriggeredJobRunProperties object itself. - */ - public TriggeredJobRunProperties withDuration(String duration) { - this.duration = duration; - return this; - } - - /** - * Get the outputUrl property: Output URL. - * - * @return the outputUrl value. - */ - public String outputUrl() { - return this.outputUrl; - } - - /** - * Set the outputUrl property: Output URL. - * - * @param outputUrl the outputUrl value to set. - * @return the TriggeredJobRunProperties object itself. - */ - public TriggeredJobRunProperties withOutputUrl(String outputUrl) { - this.outputUrl = outputUrl; - return this; - } - - /** - * Get the errorUrl property: Error URL. - * - * @return the errorUrl value. - */ - public String errorUrl() { - return this.errorUrl; - } - - /** - * Set the errorUrl property: Error URL. - * - * @param errorUrl the errorUrl value to set. - * @return the TriggeredJobRunProperties object itself. - */ - public TriggeredJobRunProperties withErrorUrl(String errorUrl) { - this.errorUrl = errorUrl; - return this; - } - - /** - * Get the url property: Job URL. - * - * @return the url value. - */ - public String url() { - return this.url; - } - - /** - * Set the url property: Job URL. - * - * @param url the url value to set. - * @return the TriggeredJobRunProperties object itself. - */ - public TriggeredJobRunProperties withUrl(String url) { - this.url = url; - return this; - } - - /** - * Get the jobName property: Job name. - * - * @return the jobName value. - */ - public String jobName() { - return this.jobName; - } - - /** - * Set the jobName property: Job name. - * - * @param jobName the jobName value to set. - * @return the TriggeredJobRunProperties object itself. - */ - public TriggeredJobRunProperties withJobName(String jobName) { - this.jobName = jobName; - return this; - } - - /** - * Get the trigger property: Job trigger. - * - * @return the trigger value. - */ - public String trigger() { - return this.trigger; - } - - /** - * Set the trigger property: Job trigger. - * - * @param trigger the trigger value to set. - * @return the TriggeredJobRunProperties object itself. - */ - public TriggeredJobRunProperties withTrigger(String trigger) { - this.trigger = trigger; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/TriggeredWebJobInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/TriggeredWebJobInner.java deleted file mode 100644 index 2028e042b565..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/TriggeredWebJobInner.java +++ /dev/null @@ -1,285 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.ProxyOnlyResource; -import com.azure.resourcemanager.appservice.models.TriggeredJobRun; -import com.azure.resourcemanager.appservice.models.WebJobType; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** Triggered Web Job Information. */ -@Fluent -public final class TriggeredWebJobInner extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TriggeredWebJobInner.class); - - /* - * TriggeredWebJob resource specific properties - */ - @JsonProperty(value = "properties") - private TriggeredWebJobProperties innerProperties; - - /** - * Get the innerProperties property: TriggeredWebJob resource specific properties. - * - * @return the innerProperties value. - */ - private TriggeredWebJobProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public TriggeredWebJobInner withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the latestRun property: Latest job run information. - * - * @return the latestRun value. - */ - public TriggeredJobRun latestRun() { - return this.innerProperties() == null ? null : this.innerProperties().latestRun(); - } - - /** - * Set the latestRun property: Latest job run information. - * - * @param latestRun the latestRun value to set. - * @return the TriggeredWebJobInner object itself. - */ - public TriggeredWebJobInner withLatestRun(TriggeredJobRun latestRun) { - if (this.innerProperties() == null) { - this.innerProperties = new TriggeredWebJobProperties(); - } - this.innerProperties().withLatestRun(latestRun); - return this; - } - - /** - * Get the historyUrl property: History URL. - * - * @return the historyUrl value. - */ - public String historyUrl() { - return this.innerProperties() == null ? null : this.innerProperties().historyUrl(); - } - - /** - * Set the historyUrl property: History URL. - * - * @param historyUrl the historyUrl value to set. - * @return the TriggeredWebJobInner object itself. - */ - public TriggeredWebJobInner withHistoryUrl(String historyUrl) { - if (this.innerProperties() == null) { - this.innerProperties = new TriggeredWebJobProperties(); - } - this.innerProperties().withHistoryUrl(historyUrl); - return this; - } - - /** - * Get the schedulerLogsUrl property: Scheduler Logs URL. - * - * @return the schedulerLogsUrl value. - */ - public String schedulerLogsUrl() { - return this.innerProperties() == null ? null : this.innerProperties().schedulerLogsUrl(); - } - - /** - * Set the schedulerLogsUrl property: Scheduler Logs URL. - * - * @param schedulerLogsUrl the schedulerLogsUrl value to set. - * @return the TriggeredWebJobInner object itself. - */ - public TriggeredWebJobInner withSchedulerLogsUrl(String schedulerLogsUrl) { - if (this.innerProperties() == null) { - this.innerProperties = new TriggeredWebJobProperties(); - } - this.innerProperties().withSchedulerLogsUrl(schedulerLogsUrl); - return this; - } - - /** - * Get the runCommand property: Run command. - * - * @return the runCommand value. - */ - public String runCommand() { - return this.innerProperties() == null ? null : this.innerProperties().runCommand(); - } - - /** - * Set the runCommand property: Run command. - * - * @param runCommand the runCommand value to set. - * @return the TriggeredWebJobInner object itself. - */ - public TriggeredWebJobInner withRunCommand(String runCommand) { - if (this.innerProperties() == null) { - this.innerProperties = new TriggeredWebJobProperties(); - } - this.innerProperties().withRunCommand(runCommand); - return this; - } - - /** - * Get the url property: Job URL. - * - * @return the url value. - */ - public String url() { - return this.innerProperties() == null ? null : this.innerProperties().url(); - } - - /** - * Set the url property: Job URL. - * - * @param url the url value to set. - * @return the TriggeredWebJobInner object itself. - */ - public TriggeredWebJobInner withUrl(String url) { - if (this.innerProperties() == null) { - this.innerProperties = new TriggeredWebJobProperties(); - } - this.innerProperties().withUrl(url); - return this; - } - - /** - * Get the extraInfoUrl property: Extra Info URL. - * - * @return the extraInfoUrl value. - */ - public String extraInfoUrl() { - return this.innerProperties() == null ? null : this.innerProperties().extraInfoUrl(); - } - - /** - * Set the extraInfoUrl property: Extra Info URL. - * - * @param extraInfoUrl the extraInfoUrl value to set. - * @return the TriggeredWebJobInner object itself. - */ - public TriggeredWebJobInner withExtraInfoUrl(String extraInfoUrl) { - if (this.innerProperties() == null) { - this.innerProperties = new TriggeredWebJobProperties(); - } - this.innerProperties().withExtraInfoUrl(extraInfoUrl); - return this; - } - - /** - * Get the webJobType property: Job type. - * - * @return the webJobType value. - */ - public WebJobType webJobType() { - return this.innerProperties() == null ? null : this.innerProperties().webJobType(); - } - - /** - * Set the webJobType property: Job type. - * - * @param webJobType the webJobType value to set. - * @return the TriggeredWebJobInner object itself. - */ - public TriggeredWebJobInner withWebJobType(WebJobType webJobType) { - if (this.innerProperties() == null) { - this.innerProperties = new TriggeredWebJobProperties(); - } - this.innerProperties().withWebJobType(webJobType); - return this; - } - - /** - * Get the error property: Error information. - * - * @return the error value. - */ - public String error() { - return this.innerProperties() == null ? null : this.innerProperties().error(); - } - - /** - * Set the error property: Error information. - * - * @param error the error value to set. - * @return the TriggeredWebJobInner object itself. - */ - public TriggeredWebJobInner withError(String error) { - if (this.innerProperties() == null) { - this.innerProperties = new TriggeredWebJobProperties(); - } - this.innerProperties().withError(error); - return this; - } - - /** - * Get the usingSdk property: Using SDK?. - * - * @return the usingSdk value. - */ - public Boolean usingSdk() { - return this.innerProperties() == null ? null : this.innerProperties().usingSdk(); - } - - /** - * Set the usingSdk property: Using SDK?. - * - * @param usingSdk the usingSdk value to set. - * @return the TriggeredWebJobInner object itself. - */ - public TriggeredWebJobInner withUsingSdk(Boolean usingSdk) { - if (this.innerProperties() == null) { - this.innerProperties = new TriggeredWebJobProperties(); - } - this.innerProperties().withUsingSdk(usingSdk); - return this; - } - - /** - * Get the settings property: Job settings. - * - * @return the settings value. - */ - public Map settings() { - return this.innerProperties() == null ? null : this.innerProperties().settings(); - } - - /** - * Set the settings property: Job settings. - * - * @param settings the settings value to set. - * @return the TriggeredWebJobInner object itself. - */ - public TriggeredWebJobInner withSettings(Map settings) { - if (this.innerProperties() == null) { - this.innerProperties = new TriggeredWebJobProperties(); - } - this.innerProperties().withSettings(settings); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/TriggeredWebJobProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/TriggeredWebJobProperties.java deleted file mode 100644 index c1a552cb2a0b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/TriggeredWebJobProperties.java +++ /dev/null @@ -1,292 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.TriggeredJobRun; -import com.azure.resourcemanager.appservice.models.WebJobType; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** TriggeredWebJob resource specific properties. */ -@Fluent -public final class TriggeredWebJobProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TriggeredWebJobProperties.class); - - /* - * Latest job run information. - */ - @JsonProperty(value = "latest_run") - private TriggeredJobRun latestRun; - - /* - * History URL. - */ - @JsonProperty(value = "history_url") - private String historyUrl; - - /* - * Scheduler Logs URL. - */ - @JsonProperty(value = "scheduler_logs_url") - private String schedulerLogsUrl; - - /* - * Run command. - */ - @JsonProperty(value = "run_command") - private String runCommand; - - /* - * Job URL. - */ - @JsonProperty(value = "url") - private String url; - - /* - * Extra Info URL. - */ - @JsonProperty(value = "extra_info_url") - private String extraInfoUrl; - - /* - * Job type. - */ - @JsonProperty(value = "web_job_type") - private WebJobType webJobType; - - /* - * Error information. - */ - @JsonProperty(value = "error") - private String error; - - /* - * Using SDK? - */ - @JsonProperty(value = "using_sdk") - private Boolean usingSdk; - - /* - * Job settings. - */ - @JsonProperty(value = "settings") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map settings; - - /** - * Get the latestRun property: Latest job run information. - * - * @return the latestRun value. - */ - public TriggeredJobRun latestRun() { - return this.latestRun; - } - - /** - * Set the latestRun property: Latest job run information. - * - * @param latestRun the latestRun value to set. - * @return the TriggeredWebJobProperties object itself. - */ - public TriggeredWebJobProperties withLatestRun(TriggeredJobRun latestRun) { - this.latestRun = latestRun; - return this; - } - - /** - * Get the historyUrl property: History URL. - * - * @return the historyUrl value. - */ - public String historyUrl() { - return this.historyUrl; - } - - /** - * Set the historyUrl property: History URL. - * - * @param historyUrl the historyUrl value to set. - * @return the TriggeredWebJobProperties object itself. - */ - public TriggeredWebJobProperties withHistoryUrl(String historyUrl) { - this.historyUrl = historyUrl; - return this; - } - - /** - * Get the schedulerLogsUrl property: Scheduler Logs URL. - * - * @return the schedulerLogsUrl value. - */ - public String schedulerLogsUrl() { - return this.schedulerLogsUrl; - } - - /** - * Set the schedulerLogsUrl property: Scheduler Logs URL. - * - * @param schedulerLogsUrl the schedulerLogsUrl value to set. - * @return the TriggeredWebJobProperties object itself. - */ - public TriggeredWebJobProperties withSchedulerLogsUrl(String schedulerLogsUrl) { - this.schedulerLogsUrl = schedulerLogsUrl; - return this; - } - - /** - * Get the runCommand property: Run command. - * - * @return the runCommand value. - */ - public String runCommand() { - return this.runCommand; - } - - /** - * Set the runCommand property: Run command. - * - * @param runCommand the runCommand value to set. - * @return the TriggeredWebJobProperties object itself. - */ - public TriggeredWebJobProperties withRunCommand(String runCommand) { - this.runCommand = runCommand; - return this; - } - - /** - * Get the url property: Job URL. - * - * @return the url value. - */ - public String url() { - return this.url; - } - - /** - * Set the url property: Job URL. - * - * @param url the url value to set. - * @return the TriggeredWebJobProperties object itself. - */ - public TriggeredWebJobProperties withUrl(String url) { - this.url = url; - return this; - } - - /** - * Get the extraInfoUrl property: Extra Info URL. - * - * @return the extraInfoUrl value. - */ - public String extraInfoUrl() { - return this.extraInfoUrl; - } - - /** - * Set the extraInfoUrl property: Extra Info URL. - * - * @param extraInfoUrl the extraInfoUrl value to set. - * @return the TriggeredWebJobProperties object itself. - */ - public TriggeredWebJobProperties withExtraInfoUrl(String extraInfoUrl) { - this.extraInfoUrl = extraInfoUrl; - return this; - } - - /** - * Get the webJobType property: Job type. - * - * @return the webJobType value. - */ - public WebJobType webJobType() { - return this.webJobType; - } - - /** - * Set the webJobType property: Job type. - * - * @param webJobType the webJobType value to set. - * @return the TriggeredWebJobProperties object itself. - */ - public TriggeredWebJobProperties withWebJobType(WebJobType webJobType) { - this.webJobType = webJobType; - return this; - } - - /** - * Get the error property: Error information. - * - * @return the error value. - */ - public String error() { - return this.error; - } - - /** - * Set the error property: Error information. - * - * @param error the error value to set. - * @return the TriggeredWebJobProperties object itself. - */ - public TriggeredWebJobProperties withError(String error) { - this.error = error; - return this; - } - - /** - * Get the usingSdk property: Using SDK?. - * - * @return the usingSdk value. - */ - public Boolean usingSdk() { - return this.usingSdk; - } - - /** - * Set the usingSdk property: Using SDK?. - * - * @param usingSdk the usingSdk value to set. - * @return the TriggeredWebJobProperties object itself. - */ - public TriggeredWebJobProperties withUsingSdk(Boolean usingSdk) { - this.usingSdk = usingSdk; - return this; - } - - /** - * Get the settings property: Job settings. - * - * @return the settings value. - */ - public Map settings() { - return this.settings; - } - - /** - * Set the settings property: Job settings. - * - * @param settings the settings value to set. - * @return the TriggeredWebJobProperties object itself. - */ - public TriggeredWebJobProperties withSettings(Map settings) { - this.settings = settings; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (latestRun() != null) { - latestRun().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/UsageInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/UsageInner.java deleted file mode 100644 index fba9d3d13c38..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/UsageInner.java +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.ComputeModeOptions; -import com.azure.resourcemanager.appservice.models.ProxyOnlyResource; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** Usage of the quota resource. */ -@Fluent -public final class UsageInner extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(UsageInner.class); - - /* - * Usage resource specific properties - */ - @JsonProperty(value = "properties") - private UsageProperties innerProperties; - - /** - * Get the innerProperties property: Usage resource specific properties. - * - * @return the innerProperties value. - */ - private UsageProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public UsageInner withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the displayName property: Friendly name shown in the UI. - * - * @return the displayName value. - */ - public String displayName() { - return this.innerProperties() == null ? null : this.innerProperties().displayName(); - } - - /** - * Get the resourceName property: Name of the quota resource. - * - * @return the resourceName value. - */ - public String resourceName() { - return this.innerProperties() == null ? null : this.innerProperties().resourceName(); - } - - /** - * Get the unit property: Units of measurement for the quota resource. - * - * @return the unit value. - */ - public String unit() { - return this.innerProperties() == null ? null : this.innerProperties().unit(); - } - - /** - * Get the currentValue property: The current value of the resource counter. - * - * @return the currentValue value. - */ - public Long currentValue() { - return this.innerProperties() == null ? null : this.innerProperties().currentValue(); - } - - /** - * Get the limit property: The resource limit. - * - * @return the limit value. - */ - public Long limit() { - return this.innerProperties() == null ? null : this.innerProperties().limit(); - } - - /** - * Get the nextResetTime property: Next reset time for the resource counter. - * - * @return the nextResetTime value. - */ - public OffsetDateTime nextResetTime() { - return this.innerProperties() == null ? null : this.innerProperties().nextResetTime(); - } - - /** - * Get the computeMode property: Compute mode used for this usage. - * - * @return the computeMode value. - */ - public ComputeModeOptions computeMode() { - return this.innerProperties() == null ? null : this.innerProperties().computeMode(); - } - - /** - * Get the siteMode property: Site mode used for this usage. - * - * @return the siteMode value. - */ - public String siteMode() { - return this.innerProperties() == null ? null : this.innerProperties().siteMode(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/UsageProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/UsageProperties.java deleted file mode 100644 index b3ad1e9ea4a5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/UsageProperties.java +++ /dev/null @@ -1,146 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.ComputeModeOptions; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** Usage resource specific properties. */ -@Immutable -public final class UsageProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(UsageProperties.class); - - /* - * Friendly name shown in the UI. - */ - @JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY) - private String displayName; - - /* - * Name of the quota resource. - */ - @JsonProperty(value = "resourceName", access = JsonProperty.Access.WRITE_ONLY) - private String resourceName; - - /* - * Units of measurement for the quota resource. - */ - @JsonProperty(value = "unit", access = JsonProperty.Access.WRITE_ONLY) - private String unit; - - /* - * The current value of the resource counter. - */ - @JsonProperty(value = "currentValue", access = JsonProperty.Access.WRITE_ONLY) - private Long currentValue; - - /* - * The resource limit. - */ - @JsonProperty(value = "limit", access = JsonProperty.Access.WRITE_ONLY) - private Long limit; - - /* - * Next reset time for the resource counter. - */ - @JsonProperty(value = "nextResetTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime nextResetTime; - - /* - * Compute mode used for this usage. - */ - @JsonProperty(value = "computeMode", access = JsonProperty.Access.WRITE_ONLY) - private ComputeModeOptions computeMode; - - /* - * Site mode used for this usage. - */ - @JsonProperty(value = "siteMode", access = JsonProperty.Access.WRITE_ONLY) - private String siteMode; - - /** - * Get the displayName property: Friendly name shown in the UI. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Get the resourceName property: Name of the quota resource. - * - * @return the resourceName value. - */ - public String resourceName() { - return this.resourceName; - } - - /** - * Get the unit property: Units of measurement for the quota resource. - * - * @return the unit value. - */ - public String unit() { - return this.unit; - } - - /** - * Get the currentValue property: The current value of the resource counter. - * - * @return the currentValue value. - */ - public Long currentValue() { - return this.currentValue; - } - - /** - * Get the limit property: The resource limit. - * - * @return the limit value. - */ - public Long limit() { - return this.limit; - } - - /** - * Get the nextResetTime property: Next reset time for the resource counter. - * - * @return the nextResetTime value. - */ - public OffsetDateTime nextResetTime() { - return this.nextResetTime; - } - - /** - * Get the computeMode property: Compute mode used for this usage. - * - * @return the computeMode value. - */ - public ComputeModeOptions computeMode() { - return this.computeMode; - } - - /** - * Get the siteMode property: Site mode used for this usage. - * - * @return the siteMode value. - */ - public String siteMode() { - return this.siteMode; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/UserInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/UserInner.java deleted file mode 100644 index 4f6929bddee3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/UserInner.java +++ /dev/null @@ -1,167 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.ProxyOnlyResource; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** User credentials used for publishing activity. */ -@Fluent -public final class UserInner extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(UserInner.class); - - /* - * User resource specific properties - */ - @JsonProperty(value = "properties") - private UserProperties innerProperties; - - /** - * Get the innerProperties property: User resource specific properties. - * - * @return the innerProperties value. - */ - private UserProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public UserInner withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the publishingUsername property: Username used for publishing. - * - * @return the publishingUsername value. - */ - public String publishingUsername() { - return this.innerProperties() == null ? null : this.innerProperties().publishingUsername(); - } - - /** - * Set the publishingUsername property: Username used for publishing. - * - * @param publishingUsername the publishingUsername value to set. - * @return the UserInner object itself. - */ - public UserInner withPublishingUsername(String publishingUsername) { - if (this.innerProperties() == null) { - this.innerProperties = new UserProperties(); - } - this.innerProperties().withPublishingUsername(publishingUsername); - return this; - } - - /** - * Get the publishingPassword property: Password used for publishing. - * - * @return the publishingPassword value. - */ - public String publishingPassword() { - return this.innerProperties() == null ? null : this.innerProperties().publishingPassword(); - } - - /** - * Set the publishingPassword property: Password used for publishing. - * - * @param publishingPassword the publishingPassword value to set. - * @return the UserInner object itself. - */ - public UserInner withPublishingPassword(String publishingPassword) { - if (this.innerProperties() == null) { - this.innerProperties = new UserProperties(); - } - this.innerProperties().withPublishingPassword(publishingPassword); - return this; - } - - /** - * Get the publishingPasswordHash property: Password hash used for publishing. - * - * @return the publishingPasswordHash value. - */ - public String publishingPasswordHash() { - return this.innerProperties() == null ? null : this.innerProperties().publishingPasswordHash(); - } - - /** - * Set the publishingPasswordHash property: Password hash used for publishing. - * - * @param publishingPasswordHash the publishingPasswordHash value to set. - * @return the UserInner object itself. - */ - public UserInner withPublishingPasswordHash(String publishingPasswordHash) { - if (this.innerProperties() == null) { - this.innerProperties = new UserProperties(); - } - this.innerProperties().withPublishingPasswordHash(publishingPasswordHash); - return this; - } - - /** - * Get the publishingPasswordHashSalt property: Password hash salt used for publishing. - * - * @return the publishingPasswordHashSalt value. - */ - public String publishingPasswordHashSalt() { - return this.innerProperties() == null ? null : this.innerProperties().publishingPasswordHashSalt(); - } - - /** - * Set the publishingPasswordHashSalt property: Password hash salt used for publishing. - * - * @param publishingPasswordHashSalt the publishingPasswordHashSalt value to set. - * @return the UserInner object itself. - */ - public UserInner withPublishingPasswordHashSalt(String publishingPasswordHashSalt) { - if (this.innerProperties() == null) { - this.innerProperties = new UserProperties(); - } - this.innerProperties().withPublishingPasswordHashSalt(publishingPasswordHashSalt); - return this; - } - - /** - * Get the scmUri property: Url of SCM site. - * - * @return the scmUri value. - */ - public String scmUri() { - return this.innerProperties() == null ? null : this.innerProperties().scmUri(); - } - - /** - * Set the scmUri property: Url of SCM site. - * - * @param scmUri the scmUri value to set. - * @return the UserInner object itself. - */ - public UserInner withScmUri(String scmUri) { - if (this.innerProperties() == null) { - this.innerProperties = new UserProperties(); - } - this.innerProperties().withScmUri(scmUri); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/UserProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/UserProperties.java deleted file mode 100644 index d6bea8f74c8a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/UserProperties.java +++ /dev/null @@ -1,160 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** User resource specific properties. */ -@Fluent -public final class UserProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(UserProperties.class); - - /* - * Username used for publishing. - */ - @JsonProperty(value = "publishingUserName", required = true) - private String publishingUsername; - - /* - * Password used for publishing. - */ - @JsonProperty(value = "publishingPassword") - private String publishingPassword; - - /* - * Password hash used for publishing. - */ - @JsonProperty(value = "publishingPasswordHash") - private String publishingPasswordHash; - - /* - * Password hash salt used for publishing. - */ - @JsonProperty(value = "publishingPasswordHashSalt") - private String publishingPasswordHashSalt; - - /* - * Url of SCM site. - */ - @JsonProperty(value = "scmUri") - private String scmUri; - - /** - * Get the publishingUsername property: Username used for publishing. - * - * @return the publishingUsername value. - */ - public String publishingUsername() { - return this.publishingUsername; - } - - /** - * Set the publishingUsername property: Username used for publishing. - * - * @param publishingUsername the publishingUsername value to set. - * @return the UserProperties object itself. - */ - public UserProperties withPublishingUsername(String publishingUsername) { - this.publishingUsername = publishingUsername; - return this; - } - - /** - * Get the publishingPassword property: Password used for publishing. - * - * @return the publishingPassword value. - */ - public String publishingPassword() { - return this.publishingPassword; - } - - /** - * Set the publishingPassword property: Password used for publishing. - * - * @param publishingPassword the publishingPassword value to set. - * @return the UserProperties object itself. - */ - public UserProperties withPublishingPassword(String publishingPassword) { - this.publishingPassword = publishingPassword; - return this; - } - - /** - * Get the publishingPasswordHash property: Password hash used for publishing. - * - * @return the publishingPasswordHash value. - */ - public String publishingPasswordHash() { - return this.publishingPasswordHash; - } - - /** - * Set the publishingPasswordHash property: Password hash used for publishing. - * - * @param publishingPasswordHash the publishingPasswordHash value to set. - * @return the UserProperties object itself. - */ - public UserProperties withPublishingPasswordHash(String publishingPasswordHash) { - this.publishingPasswordHash = publishingPasswordHash; - return this; - } - - /** - * Get the publishingPasswordHashSalt property: Password hash salt used for publishing. - * - * @return the publishingPasswordHashSalt value. - */ - public String publishingPasswordHashSalt() { - return this.publishingPasswordHashSalt; - } - - /** - * Set the publishingPasswordHashSalt property: Password hash salt used for publishing. - * - * @param publishingPasswordHashSalt the publishingPasswordHashSalt value to set. - * @return the UserProperties object itself. - */ - public UserProperties withPublishingPasswordHashSalt(String publishingPasswordHashSalt) { - this.publishingPasswordHashSalt = publishingPasswordHashSalt; - return this; - } - - /** - * Get the scmUri property: Url of SCM site. - * - * @return the scmUri value. - */ - public String scmUri() { - return this.scmUri; - } - - /** - * Set the scmUri property: Url of SCM site. - * - * @param scmUri the scmUri value to set. - * @return the UserProperties object itself. - */ - public UserProperties withScmUri(String scmUri) { - this.scmUri = scmUri; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (publishingUsername() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property publishingUsername in model UserProperties")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/ValidateProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/ValidateProperties.java deleted file mode 100644 index 556c9814479d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/ValidateProperties.java +++ /dev/null @@ -1,215 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** App properties used for validation. */ -@Fluent -public final class ValidateProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ValidateProperties.class); - - /* - * ARM resource ID of an App Service plan that would host the app. - */ - @JsonProperty(value = "serverFarmId") - private String serverFarmId; - - /* - * Name of the target SKU for the App Service plan. - */ - @JsonProperty(value = "skuName") - private String skuName; - - /* - * true if App Service plan is for Linux workers; otherwise, - * false. - */ - @JsonProperty(value = "needLinuxWorkers") - private Boolean needLinuxWorkers; - - /* - * true if App Service plan is for Spot instances; otherwise, - * false. - */ - @JsonProperty(value = "isSpot") - private Boolean isSpot; - - /* - * Target capacity of the App Service plan (number of VMs). - */ - @JsonProperty(value = "capacity") - private Integer capacity; - - /* - * Name of App Service Environment where app or App Service plan should be - * created. - */ - @JsonProperty(value = "hostingEnvironment") - private String hostingEnvironment; - - /* - * true if App Service plan is running as a windows container - */ - @JsonProperty(value = "isXenon") - private Boolean isXenon; - - /** - * Get the serverFarmId property: ARM resource ID of an App Service plan that would host the app. - * - * @return the serverFarmId value. - */ - public String serverFarmId() { - return this.serverFarmId; - } - - /** - * Set the serverFarmId property: ARM resource ID of an App Service plan that would host the app. - * - * @param serverFarmId the serverFarmId value to set. - * @return the ValidateProperties object itself. - */ - public ValidateProperties withServerFarmId(String serverFarmId) { - this.serverFarmId = serverFarmId; - return this; - } - - /** - * Get the skuName property: Name of the target SKU for the App Service plan. - * - * @return the skuName value. - */ - public String skuName() { - return this.skuName; - } - - /** - * Set the skuName property: Name of the target SKU for the App Service plan. - * - * @param skuName the skuName value to set. - * @return the ValidateProperties object itself. - */ - public ValidateProperties withSkuName(String skuName) { - this.skuName = skuName; - return this; - } - - /** - * Get the needLinuxWorkers property: <code>true</code> if App Service plan is for Linux workers; - * otherwise, <code>false</code>. - * - * @return the needLinuxWorkers value. - */ - public Boolean needLinuxWorkers() { - return this.needLinuxWorkers; - } - - /** - * Set the needLinuxWorkers property: <code>true</code> if App Service plan is for Linux workers; - * otherwise, <code>false</code>. - * - * @param needLinuxWorkers the needLinuxWorkers value to set. - * @return the ValidateProperties object itself. - */ - public ValidateProperties withNeedLinuxWorkers(Boolean needLinuxWorkers) { - this.needLinuxWorkers = needLinuxWorkers; - return this; - } - - /** - * Get the isSpot property: <code>true</code> if App Service plan is for Spot instances; otherwise, - * <code>false</code>. - * - * @return the isSpot value. - */ - public Boolean isSpot() { - return this.isSpot; - } - - /** - * Set the isSpot property: <code>true</code> if App Service plan is for Spot instances; otherwise, - * <code>false</code>. - * - * @param isSpot the isSpot value to set. - * @return the ValidateProperties object itself. - */ - public ValidateProperties withIsSpot(Boolean isSpot) { - this.isSpot = isSpot; - return this; - } - - /** - * Get the capacity property: Target capacity of the App Service plan (number of VMs). - * - * @return the capacity value. - */ - public Integer capacity() { - return this.capacity; - } - - /** - * Set the capacity property: Target capacity of the App Service plan (number of VMs). - * - * @param capacity the capacity value to set. - * @return the ValidateProperties object itself. - */ - public ValidateProperties withCapacity(Integer capacity) { - this.capacity = capacity; - return this; - } - - /** - * Get the hostingEnvironment property: Name of App Service Environment where app or App Service plan should be - * created. - * - * @return the hostingEnvironment value. - */ - public String hostingEnvironment() { - return this.hostingEnvironment; - } - - /** - * Set the hostingEnvironment property: Name of App Service Environment where app or App Service plan should be - * created. - * - * @param hostingEnvironment the hostingEnvironment value to set. - * @return the ValidateProperties object itself. - */ - public ValidateProperties withHostingEnvironment(String hostingEnvironment) { - this.hostingEnvironment = hostingEnvironment; - return this; - } - - /** - * Get the isXenon property: <code>true</code> if App Service plan is running as a windows container. - * - * @return the isXenon value. - */ - public Boolean isXenon() { - return this.isXenon; - } - - /** - * Set the isXenon property: <code>true</code> if App Service plan is running as a windows container. - * - * @param isXenon the isXenon value to set. - * @return the ValidateProperties object itself. - */ - public ValidateProperties withIsXenon(Boolean isXenon) { - this.isXenon = isXenon; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/ValidateResponseInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/ValidateResponseInner.java deleted file mode 100644 index ecfe9ea8daeb..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/ValidateResponseInner.java +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.ValidateResponseError; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describes the result of resource validation. */ -@Fluent -public final class ValidateResponseInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ValidateResponseInner.class); - - /* - * Result of validation. - */ - @JsonProperty(value = "status") - private String status; - - /* - * Error details for the case when validation fails. - */ - @JsonProperty(value = "error") - private ValidateResponseError error; - - /** - * Get the status property: Result of validation. - * - * @return the status value. - */ - public String status() { - return this.status; - } - - /** - * Set the status property: Result of validation. - * - * @param status the status value to set. - * @return the ValidateResponseInner object itself. - */ - public ValidateResponseInner withStatus(String status) { - this.status = status; - return this; - } - - /** - * Get the error property: Error details for the case when validation fails. - * - * @return the error value. - */ - public ValidateResponseError error() { - return this.error; - } - - /** - * Set the error property: Error details for the case when validation fails. - * - * @param error the error value to set. - * @return the ValidateResponseInner object itself. - */ - public ValidateResponseInner withError(ValidateResponseError error) { - this.error = error; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (error() != null) { - error().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/VnetGatewayInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/VnetGatewayInner.java deleted file mode 100644 index 61b3040282c5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/VnetGatewayInner.java +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.ProxyOnlyResource; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The Virtual Network gateway contract. This is used to give the Virtual Network gateway access to the VPN package. */ -@Fluent -public final class VnetGatewayInner extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VnetGatewayInner.class); - - /* - * VnetGateway resource specific properties - */ - @JsonProperty(value = "properties") - private VnetGatewayProperties innerProperties; - - /** - * Get the innerProperties property: VnetGateway resource specific properties. - * - * @return the innerProperties value. - */ - private VnetGatewayProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public VnetGatewayInner withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the vnetName property: The Virtual Network name. - * - * @return the vnetName value. - */ - public String vnetName() { - return this.innerProperties() == null ? null : this.innerProperties().vnetName(); - } - - /** - * Set the vnetName property: The Virtual Network name. - * - * @param vnetName the vnetName value to set. - * @return the VnetGatewayInner object itself. - */ - public VnetGatewayInner withVnetName(String vnetName) { - if (this.innerProperties() == null) { - this.innerProperties = new VnetGatewayProperties(); - } - this.innerProperties().withVnetName(vnetName); - return this; - } - - /** - * Get the vpnPackageUri property: The URI where the VPN package can be downloaded. - * - * @return the vpnPackageUri value. - */ - public String vpnPackageUri() { - return this.innerProperties() == null ? null : this.innerProperties().vpnPackageUri(); - } - - /** - * Set the vpnPackageUri property: The URI where the VPN package can be downloaded. - * - * @param vpnPackageUri the vpnPackageUri value to set. - * @return the VnetGatewayInner object itself. - */ - public VnetGatewayInner withVpnPackageUri(String vpnPackageUri) { - if (this.innerProperties() == null) { - this.innerProperties = new VnetGatewayProperties(); - } - this.innerProperties().withVpnPackageUri(vpnPackageUri); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/VnetGatewayProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/VnetGatewayProperties.java deleted file mode 100644 index 85570228a6f7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/VnetGatewayProperties.java +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** VnetGateway resource specific properties. */ -@Fluent -public final class VnetGatewayProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VnetGatewayProperties.class); - - /* - * The Virtual Network name. - */ - @JsonProperty(value = "vnetName") - private String vnetName; - - /* - * The URI where the VPN package can be downloaded. - */ - @JsonProperty(value = "vpnPackageUri", required = true) - private String vpnPackageUri; - - /** - * Get the vnetName property: The Virtual Network name. - * - * @return the vnetName value. - */ - public String vnetName() { - return this.vnetName; - } - - /** - * Set the vnetName property: The Virtual Network name. - * - * @param vnetName the vnetName value to set. - * @return the VnetGatewayProperties object itself. - */ - public VnetGatewayProperties withVnetName(String vnetName) { - this.vnetName = vnetName; - return this; - } - - /** - * Get the vpnPackageUri property: The URI where the VPN package can be downloaded. - * - * @return the vpnPackageUri value. - */ - public String vpnPackageUri() { - return this.vpnPackageUri; - } - - /** - * Set the vpnPackageUri property: The URI where the VPN package can be downloaded. - * - * @param vpnPackageUri the vpnPackageUri value to set. - * @return the VnetGatewayProperties object itself. - */ - public VnetGatewayProperties withVpnPackageUri(String vpnPackageUri) { - this.vpnPackageUri = vpnPackageUri; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (vpnPackageUri() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property vpnPackageUri in model VnetGatewayProperties")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/VnetInfoInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/VnetInfoInner.java deleted file mode 100644 index 4d0e1ffd1210..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/VnetInfoInner.java +++ /dev/null @@ -1,177 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.ProxyOnlyResource; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Virtual Network information contract. */ -@Fluent -public final class VnetInfoInner extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VnetInfoInner.class); - - /* - * VnetInfo resource specific properties - */ - @JsonProperty(value = "properties") - private VnetInfoProperties innerProperties; - - /** - * Get the innerProperties property: VnetInfo resource specific properties. - * - * @return the innerProperties value. - */ - private VnetInfoProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public VnetInfoInner withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the vnetResourceId property: The Virtual Network's resource ID. - * - * @return the vnetResourceId value. - */ - public String vnetResourceId() { - return this.innerProperties() == null ? null : this.innerProperties().vnetResourceId(); - } - - /** - * Set the vnetResourceId property: The Virtual Network's resource ID. - * - * @param vnetResourceId the vnetResourceId value to set. - * @return the VnetInfoInner object itself. - */ - public VnetInfoInner withVnetResourceId(String vnetResourceId) { - if (this.innerProperties() == null) { - this.innerProperties = new VnetInfoProperties(); - } - this.innerProperties().withVnetResourceId(vnetResourceId); - return this; - } - - /** - * Get the certThumbprint property: The client certificate thumbprint. - * - * @return the certThumbprint value. - */ - public String certThumbprint() { - return this.innerProperties() == null ? null : this.innerProperties().certThumbprint(); - } - - /** - * Get the certBlob property: A certificate file (.cer) blob containing the public key of the private key used to - * authenticate a Point-To-Site VPN connection. - * - * @return the certBlob value. - */ - public String certBlob() { - return this.innerProperties() == null ? null : this.innerProperties().certBlob(); - } - - /** - * Set the certBlob property: A certificate file (.cer) blob containing the public key of the private key used to - * authenticate a Point-To-Site VPN connection. - * - * @param certBlob the certBlob value to set. - * @return the VnetInfoInner object itself. - */ - public VnetInfoInner withCertBlob(String certBlob) { - if (this.innerProperties() == null) { - this.innerProperties = new VnetInfoProperties(); - } - this.innerProperties().withCertBlob(certBlob); - return this; - } - - /** - * Get the routes property: The routes that this Virtual Network connection uses. - * - * @return the routes value. - */ - public List routes() { - return this.innerProperties() == null ? null : this.innerProperties().routes(); - } - - /** - * Get the resyncRequired property: <code>true</code> if a resync is required; otherwise, - * <code>false</code>. - * - * @return the resyncRequired value. - */ - public Boolean resyncRequired() { - return this.innerProperties() == null ? null : this.innerProperties().resyncRequired(); - } - - /** - * Get the dnsServers property: DNS servers to be used by this Virtual Network. This should be a comma-separated - * list of IP addresses. - * - * @return the dnsServers value. - */ - public String dnsServers() { - return this.innerProperties() == null ? null : this.innerProperties().dnsServers(); - } - - /** - * Set the dnsServers property: DNS servers to be used by this Virtual Network. This should be a comma-separated - * list of IP addresses. - * - * @param dnsServers the dnsServers value to set. - * @return the VnetInfoInner object itself. - */ - public VnetInfoInner withDnsServers(String dnsServers) { - if (this.innerProperties() == null) { - this.innerProperties = new VnetInfoProperties(); - } - this.innerProperties().withDnsServers(dnsServers); - return this; - } - - /** - * Get the isSwift property: Flag that is used to denote if this is VNET injection. - * - * @return the isSwift value. - */ - public Boolean isSwift() { - return this.innerProperties() == null ? null : this.innerProperties().isSwift(); - } - - /** - * Set the isSwift property: Flag that is used to denote if this is VNET injection. - * - * @param isSwift the isSwift value to set. - * @return the VnetInfoInner object itself. - */ - public VnetInfoInner withIsSwift(Boolean isSwift) { - if (this.innerProperties() == null) { - this.innerProperties = new VnetInfoProperties(); - } - this.innerProperties().withIsSwift(isSwift); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/VnetInfoProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/VnetInfoProperties.java deleted file mode 100644 index 7c5a1ee731f7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/VnetInfoProperties.java +++ /dev/null @@ -1,186 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** VnetInfo resource specific properties. */ -@Fluent -public final class VnetInfoProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VnetInfoProperties.class); - - /* - * The Virtual Network's resource ID. - */ - @JsonProperty(value = "vnetResourceId") - private String vnetResourceId; - - /* - * The client certificate thumbprint. - */ - @JsonProperty(value = "certThumbprint", access = JsonProperty.Access.WRITE_ONLY) - private String certThumbprint; - - /* - * A certificate file (.cer) blob containing the public key of the private - * key used to authenticate a - * Point-To-Site VPN connection. - */ - @JsonProperty(value = "certBlob") - private String certBlob; - - /* - * The routes that this Virtual Network connection uses. - */ - @JsonProperty(value = "routes", access = JsonProperty.Access.WRITE_ONLY) - private List routes; - - /* - * true if a resync is required; otherwise, - * false. - */ - @JsonProperty(value = "resyncRequired", access = JsonProperty.Access.WRITE_ONLY) - private Boolean resyncRequired; - - /* - * DNS servers to be used by this Virtual Network. This should be a - * comma-separated list of IP addresses. - */ - @JsonProperty(value = "dnsServers") - private String dnsServers; - - /* - * Flag that is used to denote if this is VNET injection - */ - @JsonProperty(value = "isSwift") - private Boolean isSwift; - - /** - * Get the vnetResourceId property: The Virtual Network's resource ID. - * - * @return the vnetResourceId value. - */ - public String vnetResourceId() { - return this.vnetResourceId; - } - - /** - * Set the vnetResourceId property: The Virtual Network's resource ID. - * - * @param vnetResourceId the vnetResourceId value to set. - * @return the VnetInfoProperties object itself. - */ - public VnetInfoProperties withVnetResourceId(String vnetResourceId) { - this.vnetResourceId = vnetResourceId; - return this; - } - - /** - * Get the certThumbprint property: The client certificate thumbprint. - * - * @return the certThumbprint value. - */ - public String certThumbprint() { - return this.certThumbprint; - } - - /** - * Get the certBlob property: A certificate file (.cer) blob containing the public key of the private key used to - * authenticate a Point-To-Site VPN connection. - * - * @return the certBlob value. - */ - public String certBlob() { - return this.certBlob; - } - - /** - * Set the certBlob property: A certificate file (.cer) blob containing the public key of the private key used to - * authenticate a Point-To-Site VPN connection. - * - * @param certBlob the certBlob value to set. - * @return the VnetInfoProperties object itself. - */ - public VnetInfoProperties withCertBlob(String certBlob) { - this.certBlob = certBlob; - return this; - } - - /** - * Get the routes property: The routes that this Virtual Network connection uses. - * - * @return the routes value. - */ - public List routes() { - return this.routes; - } - - /** - * Get the resyncRequired property: <code>true</code> if a resync is required; otherwise, - * <code>false</code>. - * - * @return the resyncRequired value. - */ - public Boolean resyncRequired() { - return this.resyncRequired; - } - - /** - * Get the dnsServers property: DNS servers to be used by this Virtual Network. This should be a comma-separated - * list of IP addresses. - * - * @return the dnsServers value. - */ - public String dnsServers() { - return this.dnsServers; - } - - /** - * Set the dnsServers property: DNS servers to be used by this Virtual Network. This should be a comma-separated - * list of IP addresses. - * - * @param dnsServers the dnsServers value to set. - * @return the VnetInfoProperties object itself. - */ - public VnetInfoProperties withDnsServers(String dnsServers) { - this.dnsServers = dnsServers; - return this; - } - - /** - * Get the isSwift property: Flag that is used to denote if this is VNET injection. - * - * @return the isSwift value. - */ - public Boolean isSwift() { - return this.isSwift; - } - - /** - * Set the isSwift property: Flag that is used to denote if this is VNET injection. - * - * @param isSwift the isSwift value to set. - * @return the VnetInfoProperties object itself. - */ - public VnetInfoProperties withIsSwift(Boolean isSwift) { - this.isSwift = isSwift; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (routes() != null) { - routes().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/VnetParametersProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/VnetParametersProperties.java deleted file mode 100644 index 202197913b10..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/VnetParametersProperties.java +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** VnetParameters resource specific properties. */ -@Fluent -public final class VnetParametersProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VnetParametersProperties.class); - - /* - * The Resource Group of the VNET to be validated - */ - @JsonProperty(value = "vnetResourceGroup") - private String vnetResourceGroup; - - /* - * The name of the VNET to be validated - */ - @JsonProperty(value = "vnetName") - private String vnetName; - - /* - * The subnet name to be validated - */ - @JsonProperty(value = "vnetSubnetName") - private String vnetSubnetName; - - /** - * Get the vnetResourceGroup property: The Resource Group of the VNET to be validated. - * - * @return the vnetResourceGroup value. - */ - public String vnetResourceGroup() { - return this.vnetResourceGroup; - } - - /** - * Set the vnetResourceGroup property: The Resource Group of the VNET to be validated. - * - * @param vnetResourceGroup the vnetResourceGroup value to set. - * @return the VnetParametersProperties object itself. - */ - public VnetParametersProperties withVnetResourceGroup(String vnetResourceGroup) { - this.vnetResourceGroup = vnetResourceGroup; - return this; - } - - /** - * Get the vnetName property: The name of the VNET to be validated. - * - * @return the vnetName value. - */ - public String vnetName() { - return this.vnetName; - } - - /** - * Set the vnetName property: The name of the VNET to be validated. - * - * @param vnetName the vnetName value to set. - * @return the VnetParametersProperties object itself. - */ - public VnetParametersProperties withVnetName(String vnetName) { - this.vnetName = vnetName; - return this; - } - - /** - * Get the vnetSubnetName property: The subnet name to be validated. - * - * @return the vnetSubnetName value. - */ - public String vnetSubnetName() { - return this.vnetSubnetName; - } - - /** - * Set the vnetSubnetName property: The subnet name to be validated. - * - * @param vnetSubnetName the vnetSubnetName value to set. - * @return the VnetParametersProperties object itself. - */ - public VnetParametersProperties withVnetSubnetName(String vnetSubnetName) { - this.vnetSubnetName = vnetSubnetName; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/VnetRouteInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/VnetRouteInner.java deleted file mode 100644 index c2d7984d3f28..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/VnetRouteInner.java +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.ProxyOnlyResource; -import com.azure.resourcemanager.appservice.models.RouteType; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Virtual Network route contract used to pass routing information for a Virtual Network. */ -@Fluent -public final class VnetRouteInner extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VnetRouteInner.class); - - /* - * VnetRoute resource specific properties - */ - @JsonProperty(value = "properties") - private VnetRouteProperties innerProperties; - - /** - * Get the innerProperties property: VnetRoute resource specific properties. - * - * @return the innerProperties value. - */ - private VnetRouteProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public VnetRouteInner withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the startAddress property: The starting address for this route. This may also include a CIDR notation, in - * which case the end address must not be specified. - * - * @return the startAddress value. - */ - public String startAddress() { - return this.innerProperties() == null ? null : this.innerProperties().startAddress(); - } - - /** - * Set the startAddress property: The starting address for this route. This may also include a CIDR notation, in - * which case the end address must not be specified. - * - * @param startAddress the startAddress value to set. - * @return the VnetRouteInner object itself. - */ - public VnetRouteInner withStartAddress(String startAddress) { - if (this.innerProperties() == null) { - this.innerProperties = new VnetRouteProperties(); - } - this.innerProperties().withStartAddress(startAddress); - return this; - } - - /** - * Get the endAddress property: The ending address for this route. If the start address is specified in CIDR - * notation, this must be omitted. - * - * @return the endAddress value. - */ - public String endAddress() { - return this.innerProperties() == null ? null : this.innerProperties().endAddress(); - } - - /** - * Set the endAddress property: The ending address for this route. If the start address is specified in CIDR - * notation, this must be omitted. - * - * @param endAddress the endAddress value to set. - * @return the VnetRouteInner object itself. - */ - public VnetRouteInner withEndAddress(String endAddress) { - if (this.innerProperties() == null) { - this.innerProperties = new VnetRouteProperties(); - } - this.innerProperties().withEndAddress(endAddress); - return this; - } - - /** - * Get the routeType property: The type of route this is: DEFAULT - By default, every app has routes to the local - * address ranges specified by RFC1918 INHERITED - Routes inherited from the real Virtual Network routes STATIC - - * Static route set on the app only - * - *

These values will be used for syncing an app's routes with those from a Virtual Network. - * - * @return the routeType value. - */ - public RouteType routeType() { - return this.innerProperties() == null ? null : this.innerProperties().routeType(); - } - - /** - * Set the routeType property: The type of route this is: DEFAULT - By default, every app has routes to the local - * address ranges specified by RFC1918 INHERITED - Routes inherited from the real Virtual Network routes STATIC - - * Static route set on the app only - * - *

These values will be used for syncing an app's routes with those from a Virtual Network. - * - * @param routeType the routeType value to set. - * @return the VnetRouteInner object itself. - */ - public VnetRouteInner withRouteType(RouteType routeType) { - if (this.innerProperties() == null) { - this.innerProperties = new VnetRouteProperties(); - } - this.innerProperties().withRouteType(routeType); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/VnetRouteProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/VnetRouteProperties.java deleted file mode 100644 index d35207c937b7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/VnetRouteProperties.java +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.RouteType; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** VnetRoute resource specific properties. */ -@Fluent -public final class VnetRouteProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VnetRouteProperties.class); - - /* - * The starting address for this route. This may also include a CIDR - * notation, in which case the end address must not be specified. - */ - @JsonProperty(value = "startAddress") - private String startAddress; - - /* - * The ending address for this route. If the start address is specified in - * CIDR notation, this must be omitted. - */ - @JsonProperty(value = "endAddress") - private String endAddress; - - /* - * The type of route this is: - * DEFAULT - By default, every app has routes to the local address ranges - * specified by RFC1918 - * INHERITED - Routes inherited from the real Virtual Network routes - * STATIC - Static route set on the app only - * - * These values will be used for syncing an app's routes with those from a - * Virtual Network. - */ - @JsonProperty(value = "routeType") - private RouteType routeType; - - /** - * Get the startAddress property: The starting address for this route. This may also include a CIDR notation, in - * which case the end address must not be specified. - * - * @return the startAddress value. - */ - public String startAddress() { - return this.startAddress; - } - - /** - * Set the startAddress property: The starting address for this route. This may also include a CIDR notation, in - * which case the end address must not be specified. - * - * @param startAddress the startAddress value to set. - * @return the VnetRouteProperties object itself. - */ - public VnetRouteProperties withStartAddress(String startAddress) { - this.startAddress = startAddress; - return this; - } - - /** - * Get the endAddress property: The ending address for this route. If the start address is specified in CIDR - * notation, this must be omitted. - * - * @return the endAddress value. - */ - public String endAddress() { - return this.endAddress; - } - - /** - * Set the endAddress property: The ending address for this route. If the start address is specified in CIDR - * notation, this must be omitted. - * - * @param endAddress the endAddress value to set. - * @return the VnetRouteProperties object itself. - */ - public VnetRouteProperties withEndAddress(String endAddress) { - this.endAddress = endAddress; - return this; - } - - /** - * Get the routeType property: The type of route this is: DEFAULT - By default, every app has routes to the local - * address ranges specified by RFC1918 INHERITED - Routes inherited from the real Virtual Network routes STATIC - - * Static route set on the app only - * - *

These values will be used for syncing an app's routes with those from a Virtual Network. - * - * @return the routeType value. - */ - public RouteType routeType() { - return this.routeType; - } - - /** - * Set the routeType property: The type of route this is: DEFAULT - By default, every app has routes to the local - * address ranges specified by RFC1918 INHERITED - Routes inherited from the real Virtual Network routes STATIC - - * Static route set on the app only - * - *

These values will be used for syncing an app's routes with those from a Virtual Network. - * - * @param routeType the routeType value to set. - * @return the VnetRouteProperties object itself. - */ - public VnetRouteProperties withRouteType(RouteType routeType) { - this.routeType = routeType; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/VnetValidationFailureDetailsInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/VnetValidationFailureDetailsInner.java deleted file mode 100644 index a3a7f443136e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/VnetValidationFailureDetailsInner.java +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.ProxyOnlyResource; -import com.azure.resourcemanager.appservice.models.VnetValidationTestFailure; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** A class that describes the reason for a validation failure. */ -@Fluent -public final class VnetValidationFailureDetailsInner extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VnetValidationFailureDetailsInner.class); - - /* - * VnetValidationFailureDetails resource specific properties - */ - @JsonProperty(value = "properties") - private VnetValidationFailureDetailsProperties innerProperties; - - /** - * Get the innerProperties property: VnetValidationFailureDetails resource specific properties. - * - * @return the innerProperties value. - */ - private VnetValidationFailureDetailsProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public VnetValidationFailureDetailsInner withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the failed property: A flag describing whether or not validation failed. - * - * @return the failed value. - */ - public Boolean failed() { - return this.innerProperties() == null ? null : this.innerProperties().failed(); - } - - /** - * Set the failed property: A flag describing whether or not validation failed. - * - * @param failed the failed value to set. - * @return the VnetValidationFailureDetailsInner object itself. - */ - public VnetValidationFailureDetailsInner withFailed(Boolean failed) { - if (this.innerProperties() == null) { - this.innerProperties = new VnetValidationFailureDetailsProperties(); - } - this.innerProperties().withFailed(failed); - return this; - } - - /** - * Get the failedTests property: A list of tests that failed in the validation. - * - * @return the failedTests value. - */ - public List failedTests() { - return this.innerProperties() == null ? null : this.innerProperties().failedTests(); - } - - /** - * Set the failedTests property: A list of tests that failed in the validation. - * - * @param failedTests the failedTests value to set. - * @return the VnetValidationFailureDetailsInner object itself. - */ - public VnetValidationFailureDetailsInner withFailedTests(List failedTests) { - if (this.innerProperties() == null) { - this.innerProperties = new VnetValidationFailureDetailsProperties(); - } - this.innerProperties().withFailedTests(failedTests); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/VnetValidationFailureDetailsProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/VnetValidationFailureDetailsProperties.java deleted file mode 100644 index d9987cba947b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/VnetValidationFailureDetailsProperties.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.VnetValidationTestFailure; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** VnetValidationFailureDetails resource specific properties. */ -@Fluent -public final class VnetValidationFailureDetailsProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VnetValidationFailureDetailsProperties.class); - - /* - * A flag describing whether or not validation failed. - */ - @JsonProperty(value = "failed") - private Boolean failed; - - /* - * A list of tests that failed in the validation. - */ - @JsonProperty(value = "failedTests") - private List failedTests; - - /** - * Get the failed property: A flag describing whether or not validation failed. - * - * @return the failed value. - */ - public Boolean failed() { - return this.failed; - } - - /** - * Set the failed property: A flag describing whether or not validation failed. - * - * @param failed the failed value to set. - * @return the VnetValidationFailureDetailsProperties object itself. - */ - public VnetValidationFailureDetailsProperties withFailed(Boolean failed) { - this.failed = failed; - return this; - } - - /** - * Get the failedTests property: A list of tests that failed in the validation. - * - * @return the failedTests value. - */ - public List failedTests() { - return this.failedTests; - } - - /** - * Set the failedTests property: A list of tests that failed in the validation. - * - * @param failedTests the failedTests value to set. - * @return the VnetValidationFailureDetailsProperties object itself. - */ - public VnetValidationFailureDetailsProperties withFailedTests(List failedTests) { - this.failedTests = failedTests; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (failedTests() != null) { - failedTests().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/VnetValidationTestFailureProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/VnetValidationTestFailureProperties.java deleted file mode 100644 index a033292e63ca..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/VnetValidationTestFailureProperties.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** VnetValidationTestFailure resource specific properties. */ -@Fluent -public final class VnetValidationTestFailureProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VnetValidationTestFailureProperties.class); - - /* - * The name of the test that failed. - */ - @JsonProperty(value = "testName") - private String testName; - - /* - * The details of what caused the failure, e.g. the blocking rule name, - * etc. - */ - @JsonProperty(value = "details") - private String details; - - /** - * Get the testName property: The name of the test that failed. - * - * @return the testName value. - */ - public String testName() { - return this.testName; - } - - /** - * Set the testName property: The name of the test that failed. - * - * @param testName the testName value to set. - * @return the VnetValidationTestFailureProperties object itself. - */ - public VnetValidationTestFailureProperties withTestName(String testName) { - this.testName = testName; - return this; - } - - /** - * Get the details property: The details of what caused the failure, e.g. the blocking rule name, etc. - * - * @return the details value. - */ - public String details() { - return this.details; - } - - /** - * Set the details property: The details of what caused the failure, e.g. the blocking rule name, etc. - * - * @param details the details value to set. - * @return the VnetValidationTestFailureProperties object itself. - */ - public VnetValidationTestFailureProperties withDetails(String details) { - this.details = details; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/WebJobInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/WebJobInner.java deleted file mode 100644 index 1858bafb5b86..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/WebJobInner.java +++ /dev/null @@ -1,215 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.ProxyOnlyResource; -import com.azure.resourcemanager.appservice.models.WebJobType; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** Web Job Information. */ -@Fluent -public final class WebJobInner extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(WebJobInner.class); - - /* - * WebJob resource specific properties - */ - @JsonProperty(value = "properties") - private WebJobProperties innerProperties; - - /** - * Get the innerProperties property: WebJob resource specific properties. - * - * @return the innerProperties value. - */ - private WebJobProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public WebJobInner withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the runCommand property: Run command. - * - * @return the runCommand value. - */ - public String runCommand() { - return this.innerProperties() == null ? null : this.innerProperties().runCommand(); - } - - /** - * Set the runCommand property: Run command. - * - * @param runCommand the runCommand value to set. - * @return the WebJobInner object itself. - */ - public WebJobInner withRunCommand(String runCommand) { - if (this.innerProperties() == null) { - this.innerProperties = new WebJobProperties(); - } - this.innerProperties().withRunCommand(runCommand); - return this; - } - - /** - * Get the url property: Job URL. - * - * @return the url value. - */ - public String url() { - return this.innerProperties() == null ? null : this.innerProperties().url(); - } - - /** - * Set the url property: Job URL. - * - * @param url the url value to set. - * @return the WebJobInner object itself. - */ - public WebJobInner withUrl(String url) { - if (this.innerProperties() == null) { - this.innerProperties = new WebJobProperties(); - } - this.innerProperties().withUrl(url); - return this; - } - - /** - * Get the extraInfoUrl property: Extra Info URL. - * - * @return the extraInfoUrl value. - */ - public String extraInfoUrl() { - return this.innerProperties() == null ? null : this.innerProperties().extraInfoUrl(); - } - - /** - * Set the extraInfoUrl property: Extra Info URL. - * - * @param extraInfoUrl the extraInfoUrl value to set. - * @return the WebJobInner object itself. - */ - public WebJobInner withExtraInfoUrl(String extraInfoUrl) { - if (this.innerProperties() == null) { - this.innerProperties = new WebJobProperties(); - } - this.innerProperties().withExtraInfoUrl(extraInfoUrl); - return this; - } - - /** - * Get the webJobType property: Job type. - * - * @return the webJobType value. - */ - public WebJobType webJobType() { - return this.innerProperties() == null ? null : this.innerProperties().webJobType(); - } - - /** - * Set the webJobType property: Job type. - * - * @param webJobType the webJobType value to set. - * @return the WebJobInner object itself. - */ - public WebJobInner withWebJobType(WebJobType webJobType) { - if (this.innerProperties() == null) { - this.innerProperties = new WebJobProperties(); - } - this.innerProperties().withWebJobType(webJobType); - return this; - } - - /** - * Get the error property: Error information. - * - * @return the error value. - */ - public String error() { - return this.innerProperties() == null ? null : this.innerProperties().error(); - } - - /** - * Set the error property: Error information. - * - * @param error the error value to set. - * @return the WebJobInner object itself. - */ - public WebJobInner withError(String error) { - if (this.innerProperties() == null) { - this.innerProperties = new WebJobProperties(); - } - this.innerProperties().withError(error); - return this; - } - - /** - * Get the usingSdk property: Using SDK?. - * - * @return the usingSdk value. - */ - public Boolean usingSdk() { - return this.innerProperties() == null ? null : this.innerProperties().usingSdk(); - } - - /** - * Set the usingSdk property: Using SDK?. - * - * @param usingSdk the usingSdk value to set. - * @return the WebJobInner object itself. - */ - public WebJobInner withUsingSdk(Boolean usingSdk) { - if (this.innerProperties() == null) { - this.innerProperties = new WebJobProperties(); - } - this.innerProperties().withUsingSdk(usingSdk); - return this; - } - - /** - * Get the settings property: Job settings. - * - * @return the settings value. - */ - public Map settings() { - return this.innerProperties() == null ? null : this.innerProperties().settings(); - } - - /** - * Set the settings property: Job settings. - * - * @param settings the settings value to set. - * @return the WebJobInner object itself. - */ - public WebJobInner withSettings(Map settings) { - if (this.innerProperties() == null) { - this.innerProperties = new WebJobProperties(); - } - this.innerProperties().withSettings(settings); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/WebJobProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/WebJobProperties.java deleted file mode 100644 index b4c9fc91654b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/WebJobProperties.java +++ /dev/null @@ -1,210 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.WebJobType; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** WebJob resource specific properties. */ -@Fluent -public final class WebJobProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(WebJobProperties.class); - - /* - * Run command. - */ - @JsonProperty(value = "run_command") - private String runCommand; - - /* - * Job URL. - */ - @JsonProperty(value = "url") - private String url; - - /* - * Extra Info URL. - */ - @JsonProperty(value = "extra_info_url") - private String extraInfoUrl; - - /* - * Job type. - */ - @JsonProperty(value = "web_job_type") - private WebJobType webJobType; - - /* - * Error information. - */ - @JsonProperty(value = "error") - private String error; - - /* - * Using SDK? - */ - @JsonProperty(value = "using_sdk") - private Boolean usingSdk; - - /* - * Job settings. - */ - @JsonProperty(value = "settings") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map settings; - - /** - * Get the runCommand property: Run command. - * - * @return the runCommand value. - */ - public String runCommand() { - return this.runCommand; - } - - /** - * Set the runCommand property: Run command. - * - * @param runCommand the runCommand value to set. - * @return the WebJobProperties object itself. - */ - public WebJobProperties withRunCommand(String runCommand) { - this.runCommand = runCommand; - return this; - } - - /** - * Get the url property: Job URL. - * - * @return the url value. - */ - public String url() { - return this.url; - } - - /** - * Set the url property: Job URL. - * - * @param url the url value to set. - * @return the WebJobProperties object itself. - */ - public WebJobProperties withUrl(String url) { - this.url = url; - return this; - } - - /** - * Get the extraInfoUrl property: Extra Info URL. - * - * @return the extraInfoUrl value. - */ - public String extraInfoUrl() { - return this.extraInfoUrl; - } - - /** - * Set the extraInfoUrl property: Extra Info URL. - * - * @param extraInfoUrl the extraInfoUrl value to set. - * @return the WebJobProperties object itself. - */ - public WebJobProperties withExtraInfoUrl(String extraInfoUrl) { - this.extraInfoUrl = extraInfoUrl; - return this; - } - - /** - * Get the webJobType property: Job type. - * - * @return the webJobType value. - */ - public WebJobType webJobType() { - return this.webJobType; - } - - /** - * Set the webJobType property: Job type. - * - * @param webJobType the webJobType value to set. - * @return the WebJobProperties object itself. - */ - public WebJobProperties withWebJobType(WebJobType webJobType) { - this.webJobType = webJobType; - return this; - } - - /** - * Get the error property: Error information. - * - * @return the error value. - */ - public String error() { - return this.error; - } - - /** - * Set the error property: Error information. - * - * @param error the error value to set. - * @return the WebJobProperties object itself. - */ - public WebJobProperties withError(String error) { - this.error = error; - return this; - } - - /** - * Get the usingSdk property: Using SDK?. - * - * @return the usingSdk value. - */ - public Boolean usingSdk() { - return this.usingSdk; - } - - /** - * Set the usingSdk property: Using SDK?. - * - * @param usingSdk the usingSdk value to set. - * @return the WebJobProperties object itself. - */ - public WebJobProperties withUsingSdk(Boolean usingSdk) { - this.usingSdk = usingSdk; - return this; - } - - /** - * Get the settings property: Job settings. - * - * @return the settings value. - */ - public Map settings() { - return this.settings; - } - - /** - * Set the settings property: Job settings. - * - * @param settings the settings value to set. - * @return the WebJobProperties object itself. - */ - public WebJobProperties withSettings(Map settings) { - this.settings = settings; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/WorkerPool.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/WorkerPool.java deleted file mode 100644 index 1929b80b8592..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/WorkerPool.java +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.ComputeModeOptions; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Worker pool of an App Service Environment. */ -@Fluent -public final class WorkerPool { - @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkerPool.class); - - /* - * Worker size ID for referencing this worker pool. - */ - @JsonProperty(value = "workerSizeId") - private Integer workerSizeId; - - /* - * Shared or dedicated app hosting. - */ - @JsonProperty(value = "computeMode") - private ComputeModeOptions computeMode; - - /* - * VM size of the worker pool instances. - */ - @JsonProperty(value = "workerSize") - private String workerSize; - - /* - * Number of instances in the worker pool. - */ - @JsonProperty(value = "workerCount") - private Integer workerCount; - - /* - * Names of all instances in the worker pool (read only). - */ - @JsonProperty(value = "instanceNames", access = JsonProperty.Access.WRITE_ONLY) - private List instanceNames; - - /** - * Get the workerSizeId property: Worker size ID for referencing this worker pool. - * - * @return the workerSizeId value. - */ - public Integer workerSizeId() { - return this.workerSizeId; - } - - /** - * Set the workerSizeId property: Worker size ID for referencing this worker pool. - * - * @param workerSizeId the workerSizeId value to set. - * @return the WorkerPool object itself. - */ - public WorkerPool withWorkerSizeId(Integer workerSizeId) { - this.workerSizeId = workerSizeId; - return this; - } - - /** - * Get the computeMode property: Shared or dedicated app hosting. - * - * @return the computeMode value. - */ - public ComputeModeOptions computeMode() { - return this.computeMode; - } - - /** - * Set the computeMode property: Shared or dedicated app hosting. - * - * @param computeMode the computeMode value to set. - * @return the WorkerPool object itself. - */ - public WorkerPool withComputeMode(ComputeModeOptions computeMode) { - this.computeMode = computeMode; - return this; - } - - /** - * Get the workerSize property: VM size of the worker pool instances. - * - * @return the workerSize value. - */ - public String workerSize() { - return this.workerSize; - } - - /** - * Set the workerSize property: VM size of the worker pool instances. - * - * @param workerSize the workerSize value to set. - * @return the WorkerPool object itself. - */ - public WorkerPool withWorkerSize(String workerSize) { - this.workerSize = workerSize; - return this; - } - - /** - * Get the workerCount property: Number of instances in the worker pool. - * - * @return the workerCount value. - */ - public Integer workerCount() { - return this.workerCount; - } - - /** - * Set the workerCount property: Number of instances in the worker pool. - * - * @param workerCount the workerCount value to set. - * @return the WorkerPool object itself. - */ - public WorkerPool withWorkerCount(Integer workerCount) { - this.workerCount = workerCount; - return this; - } - - /** - * Get the instanceNames property: Names of all instances in the worker pool (read only). - * - * @return the instanceNames value. - */ - public List instanceNames() { - return this.instanceNames; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/WorkerPoolResourceInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/WorkerPoolResourceInner.java deleted file mode 100644 index a46c51cadb51..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/WorkerPoolResourceInner.java +++ /dev/null @@ -1,185 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.ComputeModeOptions; -import com.azure.resourcemanager.appservice.models.ProxyOnlyResource; -import com.azure.resourcemanager.appservice.models.SkuDescription; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Worker pool of an App Service Environment ARM resource. */ -@Fluent -public final class WorkerPoolResourceInner extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkerPoolResourceInner.class); - - /* - * Core resource properties - */ - @JsonProperty(value = "properties") - private WorkerPool innerProperties; - - /* - * Description of a SKU for a scalable resource. - */ - @JsonProperty(value = "sku") - private SkuDescription sku; - - /** - * Get the innerProperties property: Core resource properties. - * - * @return the innerProperties value. - */ - private WorkerPool innerProperties() { - return this.innerProperties; - } - - /** - * Get the sku property: Description of a SKU for a scalable resource. - * - * @return the sku value. - */ - public SkuDescription sku() { - return this.sku; - } - - /** - * Set the sku property: Description of a SKU for a scalable resource. - * - * @param sku the sku value to set. - * @return the WorkerPoolResourceInner object itself. - */ - public WorkerPoolResourceInner withSku(SkuDescription sku) { - this.sku = sku; - return this; - } - - /** {@inheritDoc} */ - @Override - public WorkerPoolResourceInner withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the workerSizeId property: Worker size ID for referencing this worker pool. - * - * @return the workerSizeId value. - */ - public Integer workerSizeId() { - return this.innerProperties() == null ? null : this.innerProperties().workerSizeId(); - } - - /** - * Set the workerSizeId property: Worker size ID for referencing this worker pool. - * - * @param workerSizeId the workerSizeId value to set. - * @return the WorkerPoolResourceInner object itself. - */ - public WorkerPoolResourceInner withWorkerSizeId(Integer workerSizeId) { - if (this.innerProperties() == null) { - this.innerProperties = new WorkerPool(); - } - this.innerProperties().withWorkerSizeId(workerSizeId); - return this; - } - - /** - * Get the computeMode property: Shared or dedicated app hosting. - * - * @return the computeMode value. - */ - public ComputeModeOptions computeMode() { - return this.innerProperties() == null ? null : this.innerProperties().computeMode(); - } - - /** - * Set the computeMode property: Shared or dedicated app hosting. - * - * @param computeMode the computeMode value to set. - * @return the WorkerPoolResourceInner object itself. - */ - public WorkerPoolResourceInner withComputeMode(ComputeModeOptions computeMode) { - if (this.innerProperties() == null) { - this.innerProperties = new WorkerPool(); - } - this.innerProperties().withComputeMode(computeMode); - return this; - } - - /** - * Get the workerSize property: VM size of the worker pool instances. - * - * @return the workerSize value. - */ - public String workerSize() { - return this.innerProperties() == null ? null : this.innerProperties().workerSize(); - } - - /** - * Set the workerSize property: VM size of the worker pool instances. - * - * @param workerSize the workerSize value to set. - * @return the WorkerPoolResourceInner object itself. - */ - public WorkerPoolResourceInner withWorkerSize(String workerSize) { - if (this.innerProperties() == null) { - this.innerProperties = new WorkerPool(); - } - this.innerProperties().withWorkerSize(workerSize); - return this; - } - - /** - * Get the workerCount property: Number of instances in the worker pool. - * - * @return the workerCount value. - */ - public Integer workerCount() { - return this.innerProperties() == null ? null : this.innerProperties().workerCount(); - } - - /** - * Set the workerCount property: Number of instances in the worker pool. - * - * @param workerCount the workerCount value to set. - * @return the WorkerPoolResourceInner object itself. - */ - public WorkerPoolResourceInner withWorkerCount(Integer workerCount) { - if (this.innerProperties() == null) { - this.innerProperties = new WorkerPool(); - } - this.innerProperties().withWorkerCount(workerCount); - return this; - } - - /** - * Get the instanceNames property: Names of all instances in the worker pool (read only). - * - * @return the instanceNames value. - */ - public List instanceNames() { - return this.innerProperties() == null ? null : this.innerProperties().instanceNames(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - if (sku() != null) { - sku().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/package-info.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/package-info.java deleted file mode 100644 index abf92ecbe9b7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** Package containing the inner data models for WebSiteManagementClient. WebSite Management Client. */ -package com.azure.resourcemanager.appservice.fluent.models; diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/package-info.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/package-info.java deleted file mode 100644 index 90090b053af2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** Package containing the service clients for WebSiteManagementClient. WebSite Management Client. */ -package com.azure.resourcemanager.appservice.fluent; diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/AppServiceBaseImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/AppServiceBaseImpl.java deleted file mode 100644 index d8562a985d51..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/AppServiceBaseImpl.java +++ /dev/null @@ -1,491 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.implementation; - -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.AppServiceManager; -import com.azure.resourcemanager.appservice.models.AppServicePlan; -import com.azure.resourcemanager.appservice.models.CsmPublishingProfileOptions; -import com.azure.resourcemanager.appservice.models.CsmSlotEntity; -import com.azure.resourcemanager.appservice.models.HostnameBinding; -import com.azure.resourcemanager.appservice.models.MSDeploy; -import com.azure.resourcemanager.appservice.models.OperatingSystem; -import com.azure.resourcemanager.appservice.models.PricingTier; -import com.azure.resourcemanager.appservice.models.PublishingProfile; -import com.azure.resourcemanager.appservice.models.WebAppBase; -import com.azure.resourcemanager.appservice.models.WebAppSourceControl; -import com.azure.resourcemanager.appservice.fluent.models.ConnectionStringDictionaryInner; -import com.azure.resourcemanager.appservice.fluent.models.IdentifierInner; -import com.azure.resourcemanager.appservice.fluent.models.MSDeployStatusInner; -import com.azure.resourcemanager.appservice.fluent.models.SiteAuthSettingsInner; -import com.azure.resourcemanager.appservice.fluent.models.SiteConfigResourceInner; -import com.azure.resourcemanager.appservice.fluent.models.SiteInner; -import com.azure.resourcemanager.appservice.fluent.models.SiteLogsConfigInner; -import com.azure.resourcemanager.appservice.fluent.models.SitePatchResourceInner; -import com.azure.resourcemanager.appservice.fluent.models.SiteSourceControlInner; -import com.azure.resourcemanager.appservice.fluent.models.SlotConfigNamesResourceInner; -import com.azure.resourcemanager.appservice.fluent.models.StringDictionaryInner; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import java.nio.charset.StandardCharsets; -import java.util.Collections; -import java.util.Map; -import java.util.function.Function; -import java.util.stream.Collectors; - -import reactor.core.publisher.Mono; -import com.azure.resourcemanager.resources.fluentcore.utils.PagedConverter; - -/** - * The base implementation for web apps and function apps. - * - * @param the fluent interface, WebApp or FunctionApp - * @param the implementation class for FluentT - * @param the definition stage that derives from Creatable - * @param The definition stage that derives from Appliable - */ -abstract class AppServiceBaseImpl< - FluentT extends WebAppBase, - FluentImplT extends AppServiceBaseImpl, - FluentWithCreateT, - FluentUpdateT> - extends WebAppBaseImpl { - - private final ClientLogger logger = new ClientLogger(getClass()); - - AppServiceBaseImpl( - String name, - SiteInner innerObject, - SiteConfigResourceInner siteConfig, - SiteLogsConfigInner logConfig, - AppServiceManager manager) { - super(name, innerObject, siteConfig, logConfig, manager); - } - - @Override - Mono createOrUpdateInner(SiteInner site) { - return this.manager().serviceClient().getWebApps().createOrUpdateAsync(resourceGroupName(), name(), site); - } - - @Override - Mono updateInner(SitePatchResourceInner siteUpdate) { - return this.manager().serviceClient().getWebApps().updateAsync(resourceGroupName(), name(), siteUpdate); - } - - @Override - Mono getInner() { - return this.manager().serviceClient().getWebApps().getByResourceGroupAsync(resourceGroupName(), name()); - } - - @Override - Mono getConfigInner() { - return this.manager().serviceClient().getWebApps().getConfigurationAsync(resourceGroupName(), name()); - } - - @Override - Mono createOrUpdateSiteConfig(SiteConfigResourceInner siteConfig) { - return this - .manager() - .serviceClient() - .getWebApps() - .createOrUpdateConfigurationAsync(resourceGroupName(), name(), siteConfig); - } - - @Override - Mono deleteHostnameBinding(String hostname) { - return this.manager().serviceClient().getWebApps() - .deleteHostnameBindingAsync(resourceGroupName(), name(), hostname); - } - - @Override - Mono listAppSettings() { - return this.manager().serviceClient().getWebApps().listApplicationSettingsAsync(resourceGroupName(), name()); - } - - @Override - Mono updateAppSettings(StringDictionaryInner inner) { - return this.manager().serviceClient().getWebApps() - .updateApplicationSettingsAsync(resourceGroupName(), name(), inner); - } - - @Override - Mono listConnectionStrings() { - return this.manager().serviceClient().getWebApps().listConnectionStringsAsync(resourceGroupName(), name()); - } - - @Override - Mono updateConnectionStrings(ConnectionStringDictionaryInner inner) { - return this.manager().serviceClient().getWebApps() - .updateConnectionStringsAsync(resourceGroupName(), name(), inner); - } - - @Override - Mono listSlotConfigurations() { - return this.manager().serviceClient().getWebApps().listSlotConfigurationNamesAsync(resourceGroupName(), name()); - } - - @Override - Mono updateSlotConfigurations(SlotConfigNamesResourceInner inner) { - return this.manager().serviceClient().getWebApps() - .updateSlotConfigurationNamesAsync(resourceGroupName(), name(), inner); - } - - @Override - Mono createOrUpdateSourceControl(SiteSourceControlInner inner) { - return this.manager().serviceClient().getWebApps() - .createOrUpdateSourceControlAsync(resourceGroupName(), name(), inner); - } - - @Override - Mono deleteSourceControl() { - return this.manager().serviceClient().getWebApps().deleteSourceControlAsync(resourceGroupName(), name()); - } - - @Override - Mono updateAuthentication(SiteAuthSettingsInner inner) { - return manager().serviceClient().getWebApps().updateAuthSettingsAsync(resourceGroupName(), name(), inner); - } - - @Override - Mono getAuthentication() { - return manager().serviceClient().getWebApps().getAuthSettingsAsync(resourceGroupName(), name()); - } - - @Override - public Map getHostnameBindings() { - return getHostnameBindingsAsync().block(); - } - - @Override - @SuppressWarnings("unchecked") - public Mono> getHostnameBindingsAsync() { - return PagedConverter.mapPage(this - .manager() - .serviceClient() - .getWebApps() - .listHostnameBindingsAsync(resourceGroupName(), name()), - hostNameBindingInner -> - new HostnameBindingImpl<>(hostNameBindingInner, (FluentImplT) AppServiceBaseImpl.this)) - .collectList() - .map( - hostNameBindings -> - Collections - .unmodifiableMap( - hostNameBindings - .stream() - .collect( - Collectors - .toMap( - binding -> binding.name().replace(name() + "/", ""), - Function.identity())))); - } - - @Override - public PublishingProfile getPublishingProfile() { - return getPublishingProfileAsync().block(); - } - - public Mono getPublishingProfileAsync() { - return FluxUtil - .collectBytesInByteBufferStream( - manager() - .serviceClient() - .getWebApps() - .listPublishingProfileXmlWithSecretsAsync( - resourceGroupName(), name(), new CsmPublishingProfileOptions())) - .map( - bytes -> new PublishingProfileImpl(new String(bytes, StandardCharsets.UTF_8), AppServiceBaseImpl.this)); - } - - @Override - public WebAppSourceControl getSourceControl() { - return getSourceControlAsync().block(); - } - - @Override - public Mono getSourceControlAsync() { - return manager() - .serviceClient() - .getWebApps() - .getSourceControlAsync(resourceGroupName(), name()) - .map( - siteSourceControlInner -> - new WebAppSourceControlImpl<>(siteSourceControlInner, AppServiceBaseImpl.this)); - } - - @Override - Mono createMSDeploy(MSDeploy msDeployInner) { - return manager().serviceClient().getWebApps() - .createMSDeployOperationAsync(resourceGroupName(), name(), msDeployInner); - } - - @Override - public void verifyDomainOwnership(String certificateOrderName, String domainVerificationToken) { - verifyDomainOwnershipAsync(certificateOrderName, domainVerificationToken).block(); - } - - @Override - public Mono verifyDomainOwnershipAsync(String certificateOrderName, String domainVerificationToken) { - IdentifierInner identifierInner = new IdentifierInner().withValue(domainVerificationToken); - return this - .manager() - .serviceClient() - .getWebApps() - .createOrUpdateDomainOwnershipIdentifierAsync( - resourceGroupName(), name(), certificateOrderName, identifierInner) - .then(Mono.empty()); - } - - @Override - public void start() { - startAsync().block(); - } - - @Override - public Mono startAsync() { - return manager() - .serviceClient() - .getWebApps() - .startAsync(resourceGroupName(), name()) - .then(refreshAsync()) - .then(Mono.empty()); - } - - @Override - public void stop() { - stopAsync().block(); - } - - @Override - public Mono stopAsync() { - return manager() - .serviceClient() - .getWebApps() - .stopAsync(resourceGroupName(), name()) - .then(refreshAsync()) - .then(Mono.empty()); - } - - @Override - public void restart() { - restartAsync().block(); - } - - @Override - public Mono restartAsync() { - return manager() - .serviceClient() - .getWebApps() - .restartAsync(resourceGroupName(), name()) - .then(refreshAsync()) - .then(Mono.empty()); - } - - @Override - public void swap(String slotName) { - swapAsync(slotName).block(); - } - - @Override - public Mono swapAsync(String slotName) { - return manager() - .serviceClient() - .getWebApps() - .swapSlotWithProductionAsync(resourceGroupName(), name(), new CsmSlotEntity().withTargetSlot(slotName)) - .then(refreshAsync()) - .then(Mono.empty()); - } - - @Override - public void applySlotConfigurations(String slotName) { - applySlotConfigurationsAsync(slotName).block(); - } - - @Override - public Mono applySlotConfigurationsAsync(String slotName) { - return manager() - .serviceClient() - .getWebApps() - .applySlotConfigToProductionAsync(resourceGroupName(), name(), new CsmSlotEntity().withTargetSlot(slotName)) - .then(refreshAsync()) - .then(Mono.empty()); - } - - @Override - public void resetSlotConfigurations() { - resetSlotConfigurationsAsync().block(); - } - - @Override - public Mono resetSlotConfigurationsAsync() { - return manager() - .serviceClient() - .getWebApps() - .resetProductionSlotConfigAsync(resourceGroupName(), name()) - .then(refreshAsync()) - .then(Mono.empty()); - } - - @Override - public byte[] getContainerLogs() { - return getContainerLogsAsync().block(); - } - - @Override - public Mono getContainerLogsAsync() { - return FluxUtil - .collectBytesInByteBufferStream( - manager().serviceClient().getWebApps().getWebSiteContainerLogsAsync(resourceGroupName(), name())); - } - - @Override - public byte[] getContainerLogsZip() { - return getContainerLogsZipAsync().block(); - } - - @Override - public Mono getContainerLogsZipAsync() { - return FluxUtil - .collectBytesInByteBufferStream( - manager().serviceClient().getWebApps().getContainerLogsZipAsync(resourceGroupName(), name())); - } - - @Override - Mono updateDiagnosticLogsConfig(SiteLogsConfigInner siteLogsConfigInner) { - return manager() - .serviceClient() - .getWebApps() - .updateDiagnosticLogsConfigAsync(resourceGroupName(), name(), siteLogsConfigInner); - } - - private AppServicePlanImpl newDefaultAppServicePlan() { - String planName = this.manager().resourceManager().internalContext().randomResourceName(name() + "plan", 32); - return newDefaultAppServicePlan(planName); - } - - private AppServicePlanImpl newDefaultAppServicePlan(String appServicePlanName) { - AppServicePlanImpl appServicePlan = - (AppServicePlanImpl) (this.manager().appServicePlans().define(appServicePlanName)).withRegion(regionName()); - if (super.creatableGroup != null && isInCreateMode()) { - appServicePlan = appServicePlan.withNewResourceGroup(super.creatableGroup); - } else { - appServicePlan = appServicePlan.withExistingResourceGroup(resourceGroupName()); - } - return appServicePlan; - } - - public FluentImplT withNewFreeAppServicePlan() { - return withNewAppServicePlan(OperatingSystem.WINDOWS, PricingTier.FREE_F1); - } - - public FluentImplT withNewSharedAppServicePlan() { - return withNewAppServicePlan(OperatingSystem.WINDOWS, PricingTier.SHARED_D1); - } - - FluentImplT withNewAppServicePlan(OperatingSystem operatingSystem, PricingTier pricingTier) { - return withNewAppServicePlan( - newDefaultAppServicePlan().withOperatingSystem(operatingSystem).withPricingTier(pricingTier)); - } - - FluentImplT withNewAppServicePlan( - String appServicePlanName, OperatingSystem operatingSystem, PricingTier pricingTier) { - return withNewAppServicePlan( - newDefaultAppServicePlan(appServicePlanName) - .withOperatingSystem(operatingSystem) - .withPricingTier(pricingTier)); - } - - public FluentImplT withNewAppServicePlan(PricingTier pricingTier) { - return withNewAppServicePlan(operatingSystem(), pricingTier); - } - - public FluentImplT withNewAppServicePlan(String appServicePlanName, PricingTier pricingTier) { - return withNewAppServicePlan(appServicePlanName, operatingSystem(), pricingTier); - } - - public FluentImplT withNewAppServicePlan(Creatable appServicePlanCreatable) { - this.addDependency(appServicePlanCreatable); - String id = - ResourceUtils - .constructResourceId( - this.manager().subscriptionId(), - resourceGroupName(), - "Microsoft.Web", - "serverFarms", - appServicePlanCreatable.name(), - ""); - innerModel().withServerFarmId(id); - if (appServicePlanCreatable instanceof AppServicePlanImpl) { - return withOperatingSystem(((AppServicePlanImpl) appServicePlanCreatable).operatingSystem()); - } else { - throw logger.logExceptionAsError( - new IllegalStateException("Internal error, appServicePlanCreatable must be class AppServicePlanImpl")); - } - } - - @SuppressWarnings("unchecked") - private FluentImplT withOperatingSystem(OperatingSystem os) { - if (os == OperatingSystem.LINUX) { - innerModel().withReserved(true); - innerModel().withKind(innerModel().kind() + ",linux"); - } - return (FluentImplT) this; - } - - public FluentImplT withExistingAppServicePlan(AppServicePlan appServicePlan) { - innerModel().withServerFarmId(appServicePlan.id()); - this.withRegion(appServicePlan.regionName()); - return withOperatingSystem(appServicePlanOperatingSystem(appServicePlan)); - } - - @SuppressWarnings("unchecked") - public FluentImplT withPublicDockerHubImage(String imageAndTag) { - cleanUpContainerSettings(); - if (siteConfig == null) { - siteConfig = new SiteConfigResourceInner(); - } - setAppFrameworkVersion(String.format("DOCKER|%s", imageAndTag)); - withAppSetting(SETTING_DOCKER_IMAGE, imageAndTag); - return (FluentImplT) this; - } - - public FluentImplT withPrivateDockerHubImage(String imageAndTag) { - return withPublicDockerHubImage(imageAndTag); - } - - @SuppressWarnings("unchecked") - public FluentImplT withPrivateRegistryImage(String imageAndTag, String serverUrl) { - imageAndTag = Utils.smartCompletionPrivateRegistryImage(imageAndTag, serverUrl); - - cleanUpContainerSettings(); - if (siteConfig == null) { - siteConfig = new SiteConfigResourceInner(); - } - setAppFrameworkVersion(String.format("DOCKER|%s", imageAndTag)); - withAppSetting(SETTING_DOCKER_IMAGE, imageAndTag); - withAppSetting(SETTING_REGISTRY_SERVER, serverUrl); - return (FluentImplT) this; - } - - @SuppressWarnings("unchecked") - public FluentImplT withCredentials(String username, String password) { - withAppSetting(SETTING_REGISTRY_USERNAME, username); - withAppSetting(SETTING_REGISTRY_PASSWORD, password); - return (FluentImplT) this; - } - - protected abstract void cleanUpContainerSettings(); - - protected void ensureLinuxPlan() { - if (OperatingSystem.WINDOWS.equals(operatingSystem())) { - throw logger.logExceptionAsError( - new IllegalArgumentException("Docker container settings only apply to Linux app service plans.")); - } - } - - protected OperatingSystem appServicePlanOperatingSystem(AppServicePlan appServicePlan) { - return appServicePlan.operatingSystem(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/AppServiceCertificateImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/AppServiceCertificateImpl.java deleted file mode 100644 index 4860a6185da7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/AppServiceCertificateImpl.java +++ /dev/null @@ -1,183 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.implementation; - -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.AppServiceManager; -import com.azure.resourcemanager.appservice.models.AppServiceCertificate; -import com.azure.resourcemanager.appservice.models.AppServiceCertificateOrder; -import com.azure.resourcemanager.appservice.models.HostingEnvironmentProfile; -import com.azure.resourcemanager.appservice.fluent.models.CertificateInner; -import com.azure.resourcemanager.appservice.fluent.CertificatesClient; -import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.GroupableResourceImpl; - -import java.io.File; -import java.io.IOException; -import java.nio.file.Files; -import java.time.OffsetDateTime; -import java.util.Collections; -import java.util.List; -import reactor.core.publisher.Mono; - -/** The implementation for AppServiceCertificate. */ -class AppServiceCertificateImpl - extends GroupableResourceImpl - implements AppServiceCertificate, AppServiceCertificate.Definition { - - private final ClientLogger logger = new ClientLogger(getClass()); - - private String pfxFileUrl; - private AppServiceCertificateOrder certificateOrder; - - AppServiceCertificateImpl(String name, CertificateInner innerObject, AppServiceManager manager) { - super(name, innerObject, manager); - } - - @Override - public String friendlyName() { - return innerModel().friendlyName(); - } - - @Override - public String subjectName() { - return innerModel().subjectName(); - } - - @Override - public List hostNames() { - return Collections.unmodifiableList(innerModel().hostNames()); - } - - @Override - public byte[] pfxBlob() { - return innerModel().pfxBlob(); - } - - @Override - public String siteName() { - return innerModel().siteName(); - } - - @Override - public String selfLink() { - return innerModel().selfLink(); - } - - @Override - public String issuer() { - return innerModel().issuer(); - } - - @Override - public OffsetDateTime issueDate() { - return innerModel().issueDate(); - } - - @Override - public OffsetDateTime expirationDate() { - return innerModel().expirationDate(); - } - - @Override - public String password() { - return innerModel().password(); - } - - @Override - public String thumbprint() { - return innerModel().thumbprint(); - } - - @Override - public Boolean valid() { - return innerModel().valid(); - } - - @Override - public byte[] certificateBlob() { - return innerModel().cerBlob(); - } - - @Override - public String publicKeyHash() { - return innerModel().publicKeyHash(); - } - - @Override - public HostingEnvironmentProfile hostingEnvironmentProfile() { - return innerModel().hostingEnvironmentProfile(); - } - - @Override - protected Mono getInnerAsync() { - return this.manager().serviceClient().getCertificates().getByResourceGroupAsync(resourceGroupName(), name()); - } - - @Override - public Mono createResourceAsync() { - Mono pfxBytes = Mono.empty(); - if (pfxFileUrl != null) { - pfxBytes = - Utils - .downloadFileAsync(pfxFileUrl, this.manager().httpPipeline()) - .map( - bytes -> { - innerModel().withPfxBlob(bytes); - return null; - }); - } - Mono keyVaultBinding = Mono.empty(); - if (certificateOrder != null) { - keyVaultBinding = - certificateOrder - .getKeyVaultBindingAsync() - .map( - keyVaultBinding1 -> { - innerModel() - .withKeyVaultId(keyVaultBinding1.keyVaultId()) - .withKeyVaultSecretName(keyVaultBinding1.keyVaultSecretName()); - return null; - }); - } - final CertificatesClient client = this.manager().serviceClient().getCertificates(); - return pfxBytes - .then(keyVaultBinding) - .then(client.createOrUpdateAsync(resourceGroupName(), name(), innerModel())) - .map(innerToFluentMap(this)); - } - - @Override - public AppServiceCertificateImpl withPfxFile(File file) { - try { - byte[] fileContent = Files.readAllBytes(file.toPath()); - return withPfxByteArray(fileContent); - } catch (IOException e) { - throw logger.logExceptionAsError(new RuntimeException(e)); - } - } - - @Override - public AppServiceCertificateImpl withPfxByteArray(byte[] pfxByteArray) { - innerModel().withPfxBlob(pfxByteArray); - return this; - } - - @Override - public AppServiceCertificateImpl withPfxFileFromUrl(String url) { - this.pfxFileUrl = url; - return this; - } - - @Override - public AppServiceCertificateImpl withExistingCertificateOrder(AppServiceCertificateOrder certificateOrder) { - this.certificateOrder = certificateOrder; - return this; - } - - @Override - public AppServiceCertificateImpl withPfxPassword(String password) { - innerModel().withPassword(password); - return this; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/AppServiceCertificateKeyVaultBindingImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/AppServiceCertificateKeyVaultBindingImpl.java deleted file mode 100644 index 22824a756187..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/AppServiceCertificateKeyVaultBindingImpl.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.implementation; - -import com.azure.resourcemanager.appservice.AppServiceManager; -import com.azure.resourcemanager.appservice.models.AppServiceCertificateKeyVaultBinding; -import com.azure.resourcemanager.appservice.models.AppServiceCertificateOrder; -import com.azure.resourcemanager.appservice.models.AppServicePlan; -import com.azure.resourcemanager.appservice.models.KeyVaultSecretStatus; -import com.azure.resourcemanager.appservice.fluent.models.AppServiceCertificateResourceInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.IndependentChildResourceImpl; -import reactor.core.publisher.Mono; - -/** The implementation for {@link AppServicePlan}. */ -class AppServiceCertificateKeyVaultBindingImpl - extends IndependentChildResourceImpl< - AppServiceCertificateKeyVaultBinding, - AppServiceCertificateOrder, - AppServiceCertificateResourceInner, - AppServiceCertificateKeyVaultBindingImpl, - AppServiceManager> - implements AppServiceCertificateKeyVaultBinding { - - private final AppServiceCertificateOrderImpl parent; - - AppServiceCertificateKeyVaultBindingImpl( - AppServiceCertificateResourceInner innerObject, AppServiceCertificateOrderImpl parent) { - super(innerObject.name(), innerObject, (parent != null) ? parent.manager() : null); - this.parent = parent; - } - - @Override - public String id() { - return innerModel().id(); - } - - @Override - public Mono createChildResourceAsync() { - final AppServiceCertificateKeyVaultBinding self = this; - return parent - .manager() - .serviceClient() - .getAppServiceCertificateOrders() - .createOrUpdateCertificateAsync(parent.resourceGroupName(), parent.name(), name(), innerModel()) - .map( - appServiceCertificateInner -> { - setInner(appServiceCertificateInner); - return self; - }); - } - - @Override - public String keyVaultId() { - return innerModel().keyVaultId(); - } - - @Override - public String keyVaultSecretName() { - return innerModel().keyVaultSecretName(); - } - - @Override - public KeyVaultSecretStatus provisioningState() { - return innerModel().provisioningState(); - } - - @Override - protected Mono getInnerAsync() { - return parent - .manager() - .serviceClient() - .getAppServiceCertificateOrders() - .getCertificateAsync(parent.resourceGroupName(), parent.name(), name()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/AppServiceCertificateOrderImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/AppServiceCertificateOrderImpl.java deleted file mode 100644 index 5fc13f5a9087..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/AppServiceCertificateOrderImpl.java +++ /dev/null @@ -1,266 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.implementation; - -import com.azure.resourcemanager.appservice.AppServiceManager; -import com.azure.resourcemanager.appservice.fluent.models.AppServiceCertificateOrderInner; -import com.azure.resourcemanager.appservice.fluent.models.AppServiceCertificateResourceInner; -import com.azure.resourcemanager.appservice.models.AppServiceCertificateKeyVaultBinding; -import com.azure.resourcemanager.appservice.models.AppServiceCertificateOrder; -import com.azure.resourcemanager.appservice.models.AppServiceDomain; -import com.azure.resourcemanager.appservice.models.AppServicePlan; -import com.azure.resourcemanager.appservice.models.CertificateDetails; -import com.azure.resourcemanager.appservice.models.CertificateOrderStatus; -import com.azure.resourcemanager.appservice.models.CertificateProductType; -import com.azure.resourcemanager.appservice.models.WebAppBase; -import com.azure.resourcemanager.keyvault.models.SecretPermissions; -import com.azure.resourcemanager.keyvault.models.Vault; -import com.azure.core.management.Region; -import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.GroupableResourceImpl; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import reactor.core.publisher.Mono; - -import java.time.OffsetDateTime; - -/** The implementation for {@link AppServicePlan}. */ -class AppServiceCertificateOrderImpl - extends GroupableResourceImpl< - AppServiceCertificateOrder, AppServiceCertificateOrderInner, AppServiceCertificateOrderImpl, AppServiceManager> - implements AppServiceCertificateOrder, AppServiceCertificateOrder.Definition, AppServiceCertificateOrder.Update { - - private WebAppBase domainVerifyWebApp; - private AppServiceDomain domainVerifyDomain; - private Mono bindingVault; - - AppServiceCertificateOrderImpl(String key, AppServiceCertificateOrderInner innerObject, AppServiceManager manager) { - super(key, innerObject, manager); - this.withRegion("global").withValidYears(1); - } - - @Override - protected Mono getInnerAsync() { - return this - .manager() - .serviceClient() - .getAppServiceCertificateOrders() - .getByResourceGroupAsync(resourceGroupName(), name()); - } - - @Override - public AppServiceCertificateKeyVaultBinding getKeyVaultBinding() { - return getKeyVaultBindingAsync().block(); - } - - @Override - public Mono getKeyVaultBindingAsync() { - return this - .manager() - .serviceClient() - .getAppServiceCertificateOrders() - .listCertificatesAsync(resourceGroupName(), name()) - .switchIfEmpty(Mono.empty()) - .take(1) - .singleOrEmpty() - .map(inner -> new AppServiceCertificateKeyVaultBindingImpl(inner, this)); - } - - @Override - public void verifyDomainOwnership(AppServiceDomain domain) { - verifyDomainOwnershipAsync(domain).block(); - } - - @Override - public Mono verifyDomainOwnershipAsync(AppServiceDomain domain) { - return domain.verifyDomainOwnershipAsync(name(), domainVerificationToken()); - } - - @Override - public String distinguishedName() { - return innerModel().distinguishedName(); - } - - @Override - public String domainVerificationToken() { - return innerModel().domainVerificationToken(); - } - - @Override - public int validityInYears() { - return ResourceManagerUtils.toPrimitiveInt(innerModel().validityInYears()); - } - - @Override - public int keySize() { - return ResourceManagerUtils.toPrimitiveInt(innerModel().keySize()); - } - - @Override - public CertificateProductType productType() { - return innerModel().productType(); - } - - @Override - public boolean autoRenew() { - return ResourceManagerUtils.toPrimitiveBoolean(innerModel().autoRenew()); - } - - @Override - public CertificateOrderStatus status() { - return innerModel().status(); - } - - @Override - public CertificateDetails signedCertificate() { - return innerModel().signedCertificate(); - } - - @Override - public String certificateSigningRequest() { - return innerModel().csr(); - } - - @Override - public CertificateDetails intermediate() { - return innerModel().intermediate(); - } - - @Override - public CertificateDetails root() { - return innerModel().root(); - } - - @Override - public String serialNumber() { - return innerModel().serialNumber(); - } - - @Override - public OffsetDateTime lastCertificateIssuanceTime() { - return innerModel().lastCertificateIssuanceTime(); - } - - @Override - public OffsetDateTime expirationTime() { - return innerModel().expirationTime(); - } - - @Override - public AppServiceCertificateKeyVaultBinding createKeyVaultBinding(String certificateName, Vault vault) { - return createKeyVaultBindingAsync(certificateName, vault).block(); - } - - @Override - public Mono createKeyVaultBindingAsync(String certificateName, Vault vault) { - AppServiceCertificateResourceInner certInner = new AppServiceCertificateResourceInner(); - certInner.withLocation(vault.regionName()); - certInner.withKeyVaultId(vault.id()); - certInner.withKeyVaultSecretName(certificateName); - return this - .manager() - .serviceClient() - .getAppServiceCertificateOrders() - .createOrUpdateCertificateAsync(resourceGroupName(), name(), certificateName, certInner) - .map( - appServiceCertificateInner -> - new AppServiceCertificateKeyVaultBindingImpl(appServiceCertificateInner, this)); - } - - @Override - public AppServiceCertificateOrderImpl withHostName(String hostName) { - innerModel().withDistinguishedName("CN=" + hostName); - return this; - } - - @Override - public AppServiceCertificateOrderImpl withStandardSku() { - innerModel().withProductType(CertificateProductType.STANDARD_DOMAIN_VALIDATED_SSL); - return this; - } - - @Override - public AppServiceCertificateOrderImpl withWildcardSku() { - innerModel().withProductType(CertificateProductType.STANDARD_DOMAIN_VALIDATED_WILD_CARD_SSL); - return this; - } - - @Override - public AppServiceCertificateOrderImpl withValidYears(int years) { - innerModel().withValidityInYears(years); - return this; - } - - @Override - public Mono createResourceAsync() { - return this - .manager() - .serviceClient() - .getAppServiceCertificateOrders() - .createOrUpdateAsync(resourceGroupName(), name(), innerModel()) - .map(innerToFluentMap(this)) - .then( - Mono - .defer( - () -> { - if (domainVerifyWebApp != null) { - return domainVerifyWebApp.verifyDomainOwnershipAsync(name(), domainVerificationToken()); - } else if (domainVerifyDomain != null) { - return domainVerifyDomain.verifyDomainOwnershipAsync(name(), domainVerificationToken()); - } else { - return Mono - .error( - new IllegalArgumentException( - "Please specify a non-null web app or domain to verify the domain" - + " ownership for hostname " - + distinguishedName())); - } - })) - .then(bindingVault.flatMap(vault -> createKeyVaultBindingAsync(name(), vault))) - .then(Mono.just(this)); - } - - @Override - public AppServiceCertificateOrderImpl withAutoRenew(boolean enabled) { - innerModel().withAutoRenew(enabled); - return this; - } - - @Override - public AppServiceCertificateOrderImpl withDomainVerification(AppServiceDomain domain) { - this.domainVerifyDomain = domain; - return this; - } - - @Override - public AppServiceCertificateOrderImpl withWebAppVerification(WebAppBase webApp) { - this.domainVerifyWebApp = webApp; - return this; - } - - @Override - public AppServiceCertificateOrderImpl withExistingKeyVault(Vault vault) { - this.bindingVault = Mono.just(vault); - return this; - } - - @Override - public AppServiceCertificateOrderImpl withNewKeyVault(String vaultName, Region region) { - this.bindingVault = - myManager - .keyVaultManager() - .vaults() - .define(vaultName) - .withRegion(region) - .withExistingResourceGroup(resourceGroupName()) - .defineAccessPolicy() - .forServicePrincipal("f3c21649-0979-4721-ac85-b0216b2cf413") - .allowSecretPermissions(SecretPermissions.GET, SecretPermissions.SET, SecretPermissions.DELETE) - .attach() - .defineAccessPolicy() - .forServicePrincipal("abfa0a7c-a6b6-4736-8310-5855508787cd") - .allowSecretPermissions(SecretPermissions.GET) - .attach() - .createAsync(); - return this; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/AppServiceCertificateOrdersClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/AppServiceCertificateOrdersClientImpl.java deleted file mode 100644 index 0ef60304c22f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/AppServiceCertificateOrdersClientImpl.java +++ /dev/null @@ -1,4178 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.appservice.fluent.AppServiceCertificateOrdersClient; -import com.azure.resourcemanager.appservice.fluent.models.AppServiceCertificateOrderInner; -import com.azure.resourcemanager.appservice.fluent.models.AppServiceCertificatePatchResourceInner; -import com.azure.resourcemanager.appservice.fluent.models.AppServiceCertificateResourceInner; -import com.azure.resourcemanager.appservice.fluent.models.CertificateEmailInner; -import com.azure.resourcemanager.appservice.fluent.models.CertificateOrderActionInner; -import com.azure.resourcemanager.appservice.fluent.models.NameIdentifierInner; -import com.azure.resourcemanager.appservice.fluent.models.SiteSealInner; -import com.azure.resourcemanager.appservice.models.AppServiceCertificateCollection; -import com.azure.resourcemanager.appservice.models.AppServiceCertificateOrderCollection; -import com.azure.resourcemanager.appservice.models.AppServiceCertificateOrderPatchResource; -import com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException; -import com.azure.resourcemanager.appservice.models.ReissueCertificateOrderRequest; -import com.azure.resourcemanager.appservice.models.RenewCertificateOrderRequest; -import com.azure.resourcemanager.appservice.models.SiteSealRequest; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import java.util.List; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in AppServiceCertificateOrdersClient. */ -public final class AppServiceCertificateOrdersClientImpl - implements InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete, - AppServiceCertificateOrdersClient { - private final ClientLogger logger = new ClientLogger(AppServiceCertificateOrdersClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final AppServiceCertificateOrdersService service; - - /** The service client containing this operation class. */ - private final WebSiteManagementClientImpl client; - - /** - * Initializes an instance of AppServiceCertificateOrdersClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - AppServiceCertificateOrdersClientImpl(WebSiteManagementClientImpl client) { - this.service = - RestProxy - .create( - AppServiceCertificateOrdersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for WebSiteManagementClientAppServiceCertificateOrders to be used by the - * proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "WebSiteManagementCli") - private interface AppServiceCertificateOrdersService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CertificateRegistration/certificateOrders") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/providers/Microsoft.CertificateRegistration" - + "/validateCertificateRegistrationInformation") - @ExpectedResponses({204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> validatePurchaseInformation( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") AppServiceCertificateOrderInner appServiceCertificateOrder, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.CertificateRegistration/certificateOrders") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("certificateOrderName") String certificateOrderName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("certificateOrderName") String certificateOrderName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") AppServiceCertificateOrderInner certificateDistinguishedName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("certificateOrderName") String certificateOrderName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> update( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("certificateOrderName") String certificateOrderName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") AppServiceCertificateOrderPatchResource certificateDistinguishedName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/certificates") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listCertificates( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("certificateOrderName") String certificateOrderName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/certificates/{name}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getCertificate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("certificateOrderName") String certificateOrderName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/certificates/{name}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono>> createOrUpdateCertificate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("certificateOrderName") String certificateOrderName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") AppServiceCertificateResourceInner keyVaultCertificate, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/certificates/{name}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteCertificate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("certificateOrderName") String certificateOrderName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/certificates/{name}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> updateCertificate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("certificateOrderName") String certificateOrderName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") AppServiceCertificatePatchResourceInner keyVaultCertificate, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/reissue") - @ExpectedResponses({204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> reissue( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("certificateOrderName") String certificateOrderName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ReissueCertificateOrderRequest reissueCertificateOrderRequest, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/renew") - @ExpectedResponses({204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> renew( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("certificateOrderName") String certificateOrderName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") RenewCertificateOrderRequest renewCertificateOrderRequest, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/resendEmail") - @ExpectedResponses({204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> resendEmail( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("certificateOrderName") String certificateOrderName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/resendRequestEmails") - @ExpectedResponses({204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> resendRequestEmails( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("certificateOrderName") String certificateOrderName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") NameIdentifierInner nameIdentifier, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/retrieveSiteSeal") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> retrieveSiteSeal( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("certificateOrderName") String certificateOrderName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") SiteSealRequest siteSealRequest, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/verifyDomainOwnership") - @ExpectedResponses({204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> verifyDomainOwnership( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("certificateOrderName") String certificateOrderName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.CertificateRegistration/certificateOrders/{name}/retrieveCertificateActions") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono>> retrieveCertificateActions( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.CertificateRegistration/certificateOrders/{name}/retrieveEmailHistory") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono>> retrieveCertificateEmailHistory( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listCertificatesNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * List all certificate orders in a subscription. - * - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of certificate orders. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List all certificate orders in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of certificate orders. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * List all certificate orders in a subscription. - * - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of certificate orders. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List all certificate orders in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of certificate orders. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * List all certificate orders in a subscription. - * - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of certificate orders. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * List all certificate orders in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of certificate orders. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Validate information for a certificate order. - * - * @param appServiceCertificateOrder Information for a certificate order. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> validatePurchaseInformationWithResponseAsync( - AppServiceCertificateOrderInner appServiceCertificateOrder) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (appServiceCertificateOrder == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter appServiceCertificateOrder is required and cannot be null.")); - } else { - appServiceCertificateOrder.validate(); - } - return FluxUtil - .withContext( - context -> - service - .validatePurchaseInformation( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - this.client.getApiVersion(), - appServiceCertificateOrder, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Validate information for a certificate order. - * - * @param appServiceCertificateOrder Information for a certificate order. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> validatePurchaseInformationWithResponseAsync( - AppServiceCertificateOrderInner appServiceCertificateOrder, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (appServiceCertificateOrder == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter appServiceCertificateOrder is required and cannot be null.")); - } else { - appServiceCertificateOrder.validate(); - } - context = this.client.mergeContext(context); - return service - .validatePurchaseInformation( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - this.client.getApiVersion(), - appServiceCertificateOrder, - context); - } - - /** - * Validate information for a certificate order. - * - * @param appServiceCertificateOrder Information for a certificate order. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono validatePurchaseInformationAsync(AppServiceCertificateOrderInner appServiceCertificateOrder) { - return validatePurchaseInformationWithResponseAsync(appServiceCertificateOrder) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Validate information for a certificate order. - * - * @param appServiceCertificateOrder Information for a certificate order. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void validatePurchaseInformation(AppServiceCertificateOrderInner appServiceCertificateOrder) { - validatePurchaseInformationAsync(appServiceCertificateOrder).block(); - } - - /** - * Validate information for a certificate order. - * - * @param appServiceCertificateOrder Information for a certificate order. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response validatePurchaseInformationWithResponse( - AppServiceCertificateOrderInner appServiceCertificateOrder, Context context) { - return validatePurchaseInformationWithResponseAsync(appServiceCertificateOrder, context).block(); - } - - /** - * Get certificate orders in a resource group. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return certificate orders in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get certificate orders in a resource group. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return certificate orders in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get certificate orders in a resource group. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return certificate orders in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * Get certificate orders in a resource group. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return certificate orders in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync( - String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * Get certificate orders in a resource group. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return certificate orders in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * Get certificate orders in a resource group. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return certificate orders in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup( - String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * Get a certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order.. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a certificate order. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String certificateOrderName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (certificateOrderName == null) { - return Mono - .error(new IllegalArgumentException("Parameter certificateOrderName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - certificateOrderName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order.. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a certificate order. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String certificateOrderName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (certificateOrderName == null) { - return Mono - .error(new IllegalArgumentException("Parameter certificateOrderName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - certificateOrderName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Get a certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order.. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a certificate order. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync( - String resourceGroupName, String certificateOrderName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, certificateOrderName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get a certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order.. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a certificate order. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AppServiceCertificateOrderInner getByResourceGroup(String resourceGroupName, String certificateOrderName) { - return getByResourceGroupAsync(resourceGroupName, certificateOrderName).block(); - } - - /** - * Get a certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order.. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a certificate order. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String certificateOrderName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, certificateOrderName, context).block(); - } - - /** - * Create or update a certificate purchase order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param certificateDistinguishedName Distinguished name to use for the certificate order. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sSL certificate purchase order. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String certificateOrderName, - AppServiceCertificateOrderInner certificateDistinguishedName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (certificateOrderName == null) { - return Mono - .error(new IllegalArgumentException("Parameter certificateOrderName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (certificateDistinguishedName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter certificateDistinguishedName is required and cannot be null.")); - } else { - certificateDistinguishedName.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - certificateOrderName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - certificateDistinguishedName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create or update a certificate purchase order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param certificateDistinguishedName Distinguished name to use for the certificate order. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sSL certificate purchase order. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String certificateOrderName, - AppServiceCertificateOrderInner certificateDistinguishedName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (certificateOrderName == null) { - return Mono - .error(new IllegalArgumentException("Parameter certificateOrderName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (certificateDistinguishedName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter certificateDistinguishedName is required and cannot be null.")); - } else { - certificateDistinguishedName.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - certificateOrderName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - certificateDistinguishedName, - accept, - context); - } - - /** - * Create or update a certificate purchase order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param certificateDistinguishedName Distinguished name to use for the certificate order. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sSL certificate purchase order. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, AppServiceCertificateOrderInner> - beginCreateOrUpdateAsync( - String resourceGroupName, - String certificateOrderName, - AppServiceCertificateOrderInner certificateDistinguishedName) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, certificateOrderName, certificateDistinguishedName); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - AppServiceCertificateOrderInner.class, - AppServiceCertificateOrderInner.class, - Context.NONE); - } - - /** - * Create or update a certificate purchase order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param certificateDistinguishedName Distinguished name to use for the certificate order. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sSL certificate purchase order. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, AppServiceCertificateOrderInner> - beginCreateOrUpdateAsync( - String resourceGroupName, - String certificateOrderName, - AppServiceCertificateOrderInner certificateDistinguishedName, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync( - resourceGroupName, certificateOrderName, certificateDistinguishedName, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - AppServiceCertificateOrderInner.class, - AppServiceCertificateOrderInner.class, - context); - } - - /** - * Create or update a certificate purchase order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param certificateDistinguishedName Distinguished name to use for the certificate order. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sSL certificate purchase order. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, AppServiceCertificateOrderInner> beginCreateOrUpdate( - String resourceGroupName, - String certificateOrderName, - AppServiceCertificateOrderInner certificateDistinguishedName) { - return beginCreateOrUpdateAsync(resourceGroupName, certificateOrderName, certificateDistinguishedName) - .getSyncPoller(); - } - - /** - * Create or update a certificate purchase order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param certificateDistinguishedName Distinguished name to use for the certificate order. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sSL certificate purchase order. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, AppServiceCertificateOrderInner> beginCreateOrUpdate( - String resourceGroupName, - String certificateOrderName, - AppServiceCertificateOrderInner certificateDistinguishedName, - Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, certificateOrderName, certificateDistinguishedName, context) - .getSyncPoller(); - } - - /** - * Create or update a certificate purchase order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param certificateDistinguishedName Distinguished name to use for the certificate order. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sSL certificate purchase order. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, - String certificateOrderName, - AppServiceCertificateOrderInner certificateDistinguishedName) { - return beginCreateOrUpdateAsync(resourceGroupName, certificateOrderName, certificateDistinguishedName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create or update a certificate purchase order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param certificateDistinguishedName Distinguished name to use for the certificate order. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sSL certificate purchase order. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, - String certificateOrderName, - AppServiceCertificateOrderInner certificateDistinguishedName, - Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, certificateOrderName, certificateDistinguishedName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create or update a certificate purchase order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param certificateDistinguishedName Distinguished name to use for the certificate order. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sSL certificate purchase order. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AppServiceCertificateOrderInner createOrUpdate( - String resourceGroupName, - String certificateOrderName, - AppServiceCertificateOrderInner certificateDistinguishedName) { - return createOrUpdateAsync(resourceGroupName, certificateOrderName, certificateDistinguishedName).block(); - } - - /** - * Create or update a certificate purchase order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param certificateDistinguishedName Distinguished name to use for the certificate order. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sSL certificate purchase order. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AppServiceCertificateOrderInner createOrUpdate( - String resourceGroupName, - String certificateOrderName, - AppServiceCertificateOrderInner certificateDistinguishedName, - Context context) { - return createOrUpdateAsync(resourceGroupName, certificateOrderName, certificateDistinguishedName, context) - .block(); - } - - /** - * Delete an existing certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String resourceGroupName, String certificateOrderName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (certificateOrderName == null) { - return Mono - .error(new IllegalArgumentException("Parameter certificateOrderName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - certificateOrderName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete an existing certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String certificateOrderName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (certificateOrderName == null) { - return Mono - .error(new IllegalArgumentException("Parameter certificateOrderName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - certificateOrderName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Delete an existing certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String certificateOrderName) { - return deleteWithResponseAsync(resourceGroupName, certificateOrderName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Delete an existing certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String certificateOrderName) { - deleteAsync(resourceGroupName, certificateOrderName).block(); - } - - /** - * Delete an existing certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String certificateOrderName, Context context) { - return deleteWithResponseAsync(resourceGroupName, certificateOrderName, context).block(); - } - - /** - * Create or update a certificate purchase order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param certificateDistinguishedName Distinguished name to use for the certificate order. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sSL certificate purchase order. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateWithResponseAsync( - String resourceGroupName, - String certificateOrderName, - AppServiceCertificateOrderPatchResource certificateDistinguishedName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (certificateOrderName == null) { - return Mono - .error(new IllegalArgumentException("Parameter certificateOrderName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (certificateDistinguishedName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter certificateDistinguishedName is required and cannot be null.")); - } else { - certificateDistinguishedName.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - resourceGroupName, - certificateOrderName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - certificateDistinguishedName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create or update a certificate purchase order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param certificateDistinguishedName Distinguished name to use for the certificate order. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sSL certificate purchase order. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, - String certificateOrderName, - AppServiceCertificateOrderPatchResource certificateDistinguishedName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (certificateOrderName == null) { - return Mono - .error(new IllegalArgumentException("Parameter certificateOrderName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (certificateDistinguishedName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter certificateDistinguishedName is required and cannot be null.")); - } else { - certificateDistinguishedName.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - resourceGroupName, - certificateOrderName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - certificateDistinguishedName, - accept, - context); - } - - /** - * Create or update a certificate purchase order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param certificateDistinguishedName Distinguished name to use for the certificate order. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sSL certificate purchase order. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync( - String resourceGroupName, - String certificateOrderName, - AppServiceCertificateOrderPatchResource certificateDistinguishedName) { - return updateWithResponseAsync(resourceGroupName, certificateOrderName, certificateDistinguishedName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Create or update a certificate purchase order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param certificateDistinguishedName Distinguished name to use for the certificate order. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sSL certificate purchase order. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AppServiceCertificateOrderInner update( - String resourceGroupName, - String certificateOrderName, - AppServiceCertificateOrderPatchResource certificateDistinguishedName) { - return updateAsync(resourceGroupName, certificateOrderName, certificateDistinguishedName).block(); - } - - /** - * Create or update a certificate purchase order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param certificateDistinguishedName Distinguished name to use for the certificate order. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sSL certificate purchase order. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, - String certificateOrderName, - AppServiceCertificateOrderPatchResource certificateDistinguishedName, - Context context) { - return updateWithResponseAsync(resourceGroupName, certificateOrderName, certificateDistinguishedName, context) - .block(); - } - - /** - * List all certificates associated with a certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of certificate order certificates. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listCertificatesSinglePageAsync( - String resourceGroupName, String certificateOrderName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (certificateOrderName == null) { - return Mono - .error(new IllegalArgumentException("Parameter certificateOrderName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listCertificates( - this.client.getEndpoint(), - resourceGroupName, - certificateOrderName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List all certificates associated with a certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of certificate order certificates. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listCertificatesSinglePageAsync( - String resourceGroupName, String certificateOrderName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (certificateOrderName == null) { - return Mono - .error(new IllegalArgumentException("Parameter certificateOrderName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listCertificates( - this.client.getEndpoint(), - resourceGroupName, - certificateOrderName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * List all certificates associated with a certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of certificate order certificates. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listCertificatesAsync( - String resourceGroupName, String certificateOrderName) { - return new PagedFlux<>( - () -> listCertificatesSinglePageAsync(resourceGroupName, certificateOrderName), - nextLink -> listCertificatesNextSinglePageAsync(nextLink)); - } - - /** - * List all certificates associated with a certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of certificate order certificates. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listCertificatesAsync( - String resourceGroupName, String certificateOrderName, Context context) { - return new PagedFlux<>( - () -> listCertificatesSinglePageAsync(resourceGroupName, certificateOrderName, context), - nextLink -> listCertificatesNextSinglePageAsync(nextLink, context)); - } - - /** - * List all certificates associated with a certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of certificate order certificates. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listCertificates( - String resourceGroupName, String certificateOrderName) { - return new PagedIterable<>(listCertificatesAsync(resourceGroupName, certificateOrderName)); - } - - /** - * List all certificates associated with a certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of certificate order certificates. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listCertificates( - String resourceGroupName, String certificateOrderName, Context context) { - return new PagedIterable<>(listCertificatesAsync(resourceGroupName, certificateOrderName, context)); - } - - /** - * Get the certificate associated with a certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param name Name of the certificate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the certificate associated with a certificate order. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getCertificateWithResponseAsync( - String resourceGroupName, String certificateOrderName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (certificateOrderName == null) { - return Mono - .error(new IllegalArgumentException("Parameter certificateOrderName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getCertificate( - this.client.getEndpoint(), - resourceGroupName, - certificateOrderName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the certificate associated with a certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param name Name of the certificate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the certificate associated with a certificate order. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getCertificateWithResponseAsync( - String resourceGroupName, String certificateOrderName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (certificateOrderName == null) { - return Mono - .error(new IllegalArgumentException("Parameter certificateOrderName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getCertificate( - this.client.getEndpoint(), - resourceGroupName, - certificateOrderName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Get the certificate associated with a certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param name Name of the certificate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the certificate associated with a certificate order. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getCertificateAsync( - String resourceGroupName, String certificateOrderName, String name) { - return getCertificateWithResponseAsync(resourceGroupName, certificateOrderName, name) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get the certificate associated with a certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param name Name of the certificate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the certificate associated with a certificate order. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AppServiceCertificateResourceInner getCertificate( - String resourceGroupName, String certificateOrderName, String name) { - return getCertificateAsync(resourceGroupName, certificateOrderName, name).block(); - } - - /** - * Get the certificate associated with a certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param name Name of the certificate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the certificate associated with a certificate order. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getCertificateWithResponse( - String resourceGroupName, String certificateOrderName, String name, Context context) { - return getCertificateWithResponseAsync(resourceGroupName, certificateOrderName, name, context).block(); - } - - /** - * Creates or updates a certificate and associates with key vault secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param name Name of the certificate. - * @param keyVaultCertificate Key vault certificate resource Id. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return key Vault container ARM resource for a certificate that is purchased through Azure. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateCertificateWithResponseAsync( - String resourceGroupName, - String certificateOrderName, - String name, - AppServiceCertificateResourceInner keyVaultCertificate) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (certificateOrderName == null) { - return Mono - .error(new IllegalArgumentException("Parameter certificateOrderName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (keyVaultCertificate == null) { - return Mono - .error(new IllegalArgumentException("Parameter keyVaultCertificate is required and cannot be null.")); - } else { - keyVaultCertificate.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdateCertificate( - this.client.getEndpoint(), - resourceGroupName, - certificateOrderName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - keyVaultCertificate, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a certificate and associates with key vault secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param name Name of the certificate. - * @param keyVaultCertificate Key vault certificate resource Id. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return key Vault container ARM resource for a certificate that is purchased through Azure. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateCertificateWithResponseAsync( - String resourceGroupName, - String certificateOrderName, - String name, - AppServiceCertificateResourceInner keyVaultCertificate, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (certificateOrderName == null) { - return Mono - .error(new IllegalArgumentException("Parameter certificateOrderName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (keyVaultCertificate == null) { - return Mono - .error(new IllegalArgumentException("Parameter keyVaultCertificate is required and cannot be null.")); - } else { - keyVaultCertificate.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdateCertificate( - this.client.getEndpoint(), - resourceGroupName, - certificateOrderName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - keyVaultCertificate, - accept, - context); - } - - /** - * Creates or updates a certificate and associates with key vault secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param name Name of the certificate. - * @param keyVaultCertificate Key vault certificate resource Id. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return key Vault container ARM resource for a certificate that is purchased through Azure. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, AppServiceCertificateResourceInner> - beginCreateOrUpdateCertificateAsync( - String resourceGroupName, - String certificateOrderName, - String name, - AppServiceCertificateResourceInner keyVaultCertificate) { - Mono>> mono = - createOrUpdateCertificateWithResponseAsync( - resourceGroupName, certificateOrderName, name, keyVaultCertificate); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - AppServiceCertificateResourceInner.class, - AppServiceCertificateResourceInner.class, - Context.NONE); - } - - /** - * Creates or updates a certificate and associates with key vault secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param name Name of the certificate. - * @param keyVaultCertificate Key vault certificate resource Id. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return key Vault container ARM resource for a certificate that is purchased through Azure. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, AppServiceCertificateResourceInner> - beginCreateOrUpdateCertificateAsync( - String resourceGroupName, - String certificateOrderName, - String name, - AppServiceCertificateResourceInner keyVaultCertificate, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateCertificateWithResponseAsync( - resourceGroupName, certificateOrderName, name, keyVaultCertificate, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - AppServiceCertificateResourceInner.class, - AppServiceCertificateResourceInner.class, - context); - } - - /** - * Creates or updates a certificate and associates with key vault secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param name Name of the certificate. - * @param keyVaultCertificate Key vault certificate resource Id. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return key Vault container ARM resource for a certificate that is purchased through Azure. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, AppServiceCertificateResourceInner> - beginCreateOrUpdateCertificate( - String resourceGroupName, - String certificateOrderName, - String name, - AppServiceCertificateResourceInner keyVaultCertificate) { - return beginCreateOrUpdateCertificateAsync(resourceGroupName, certificateOrderName, name, keyVaultCertificate) - .getSyncPoller(); - } - - /** - * Creates or updates a certificate and associates with key vault secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param name Name of the certificate. - * @param keyVaultCertificate Key vault certificate resource Id. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return key Vault container ARM resource for a certificate that is purchased through Azure. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, AppServiceCertificateResourceInner> - beginCreateOrUpdateCertificate( - String resourceGroupName, - String certificateOrderName, - String name, - AppServiceCertificateResourceInner keyVaultCertificate, - Context context) { - return beginCreateOrUpdateCertificateAsync( - resourceGroupName, certificateOrderName, name, keyVaultCertificate, context) - .getSyncPoller(); - } - - /** - * Creates or updates a certificate and associates with key vault secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param name Name of the certificate. - * @param keyVaultCertificate Key vault certificate resource Id. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return key Vault container ARM resource for a certificate that is purchased through Azure. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateCertificateAsync( - String resourceGroupName, - String certificateOrderName, - String name, - AppServiceCertificateResourceInner keyVaultCertificate) { - return beginCreateOrUpdateCertificateAsync(resourceGroupName, certificateOrderName, name, keyVaultCertificate) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a certificate and associates with key vault secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param name Name of the certificate. - * @param keyVaultCertificate Key vault certificate resource Id. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return key Vault container ARM resource for a certificate that is purchased through Azure. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateCertificateAsync( - String resourceGroupName, - String certificateOrderName, - String name, - AppServiceCertificateResourceInner keyVaultCertificate, - Context context) { - return beginCreateOrUpdateCertificateAsync( - resourceGroupName, certificateOrderName, name, keyVaultCertificate, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a certificate and associates with key vault secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param name Name of the certificate. - * @param keyVaultCertificate Key vault certificate resource Id. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return key Vault container ARM resource for a certificate that is purchased through Azure. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AppServiceCertificateResourceInner createOrUpdateCertificate( - String resourceGroupName, - String certificateOrderName, - String name, - AppServiceCertificateResourceInner keyVaultCertificate) { - return createOrUpdateCertificateAsync(resourceGroupName, certificateOrderName, name, keyVaultCertificate) - .block(); - } - - /** - * Creates or updates a certificate and associates with key vault secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param name Name of the certificate. - * @param keyVaultCertificate Key vault certificate resource Id. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return key Vault container ARM resource for a certificate that is purchased through Azure. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AppServiceCertificateResourceInner createOrUpdateCertificate( - String resourceGroupName, - String certificateOrderName, - String name, - AppServiceCertificateResourceInner keyVaultCertificate, - Context context) { - return createOrUpdateCertificateAsync( - resourceGroupName, certificateOrderName, name, keyVaultCertificate, context) - .block(); - } - - /** - * Delete the certificate associated with a certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param name Name of the certificate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteCertificateWithResponseAsync( - String resourceGroupName, String certificateOrderName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (certificateOrderName == null) { - return Mono - .error(new IllegalArgumentException("Parameter certificateOrderName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .deleteCertificate( - this.client.getEndpoint(), - resourceGroupName, - certificateOrderName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete the certificate associated with a certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param name Name of the certificate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteCertificateWithResponseAsync( - String resourceGroupName, String certificateOrderName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (certificateOrderName == null) { - return Mono - .error(new IllegalArgumentException("Parameter certificateOrderName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .deleteCertificate( - this.client.getEndpoint(), - resourceGroupName, - certificateOrderName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Delete the certificate associated with a certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param name Name of the certificate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteCertificateAsync(String resourceGroupName, String certificateOrderName, String name) { - return deleteCertificateWithResponseAsync(resourceGroupName, certificateOrderName, name) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Delete the certificate associated with a certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param name Name of the certificate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteCertificate(String resourceGroupName, String certificateOrderName, String name) { - deleteCertificateAsync(resourceGroupName, certificateOrderName, name).block(); - } - - /** - * Delete the certificate associated with a certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param name Name of the certificate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteCertificateWithResponse( - String resourceGroupName, String certificateOrderName, String name, Context context) { - return deleteCertificateWithResponseAsync(resourceGroupName, certificateOrderName, name, context).block(); - } - - /** - * Creates or updates a certificate and associates with key vault secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param name Name of the certificate. - * @param keyVaultCertificate Key vault certificate resource Id. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return key Vault container ARM resource for a certificate that is purchased through Azure. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateCertificateWithResponseAsync( - String resourceGroupName, - String certificateOrderName, - String name, - AppServiceCertificatePatchResourceInner keyVaultCertificate) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (certificateOrderName == null) { - return Mono - .error(new IllegalArgumentException("Parameter certificateOrderName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (keyVaultCertificate == null) { - return Mono - .error(new IllegalArgumentException("Parameter keyVaultCertificate is required and cannot be null.")); - } else { - keyVaultCertificate.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updateCertificate( - this.client.getEndpoint(), - resourceGroupName, - certificateOrderName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - keyVaultCertificate, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a certificate and associates with key vault secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param name Name of the certificate. - * @param keyVaultCertificate Key vault certificate resource Id. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return key Vault container ARM resource for a certificate that is purchased through Azure. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateCertificateWithResponseAsync( - String resourceGroupName, - String certificateOrderName, - String name, - AppServiceCertificatePatchResourceInner keyVaultCertificate, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (certificateOrderName == null) { - return Mono - .error(new IllegalArgumentException("Parameter certificateOrderName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (keyVaultCertificate == null) { - return Mono - .error(new IllegalArgumentException("Parameter keyVaultCertificate is required and cannot be null.")); - } else { - keyVaultCertificate.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updateCertificate( - this.client.getEndpoint(), - resourceGroupName, - certificateOrderName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - keyVaultCertificate, - accept, - context); - } - - /** - * Creates or updates a certificate and associates with key vault secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param name Name of the certificate. - * @param keyVaultCertificate Key vault certificate resource Id. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return key Vault container ARM resource for a certificate that is purchased through Azure. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateCertificateAsync( - String resourceGroupName, - String certificateOrderName, - String name, - AppServiceCertificatePatchResourceInner keyVaultCertificate) { - return updateCertificateWithResponseAsync(resourceGroupName, certificateOrderName, name, keyVaultCertificate) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates or updates a certificate and associates with key vault secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param name Name of the certificate. - * @param keyVaultCertificate Key vault certificate resource Id. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return key Vault container ARM resource for a certificate that is purchased through Azure. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AppServiceCertificateResourceInner updateCertificate( - String resourceGroupName, - String certificateOrderName, - String name, - AppServiceCertificatePatchResourceInner keyVaultCertificate) { - return updateCertificateAsync(resourceGroupName, certificateOrderName, name, keyVaultCertificate).block(); - } - - /** - * Creates or updates a certificate and associates with key vault secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param name Name of the certificate. - * @param keyVaultCertificate Key vault certificate resource Id. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return key Vault container ARM resource for a certificate that is purchased through Azure. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateCertificateWithResponse( - String resourceGroupName, - String certificateOrderName, - String name, - AppServiceCertificatePatchResourceInner keyVaultCertificate, - Context context) { - return updateCertificateWithResponseAsync( - resourceGroupName, certificateOrderName, name, keyVaultCertificate, context) - .block(); - } - - /** - * Reissue an existing certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param reissueCertificateOrderRequest Parameters for the reissue. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> reissueWithResponseAsync( - String resourceGroupName, - String certificateOrderName, - ReissueCertificateOrderRequest reissueCertificateOrderRequest) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (certificateOrderName == null) { - return Mono - .error(new IllegalArgumentException("Parameter certificateOrderName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (reissueCertificateOrderRequest == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter reissueCertificateOrderRequest is required and cannot be null.")); - } else { - reissueCertificateOrderRequest.validate(); - } - return FluxUtil - .withContext( - context -> - service - .reissue( - this.client.getEndpoint(), - resourceGroupName, - certificateOrderName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - reissueCertificateOrderRequest, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Reissue an existing certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param reissueCertificateOrderRequest Parameters for the reissue. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> reissueWithResponseAsync( - String resourceGroupName, - String certificateOrderName, - ReissueCertificateOrderRequest reissueCertificateOrderRequest, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (certificateOrderName == null) { - return Mono - .error(new IllegalArgumentException("Parameter certificateOrderName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (reissueCertificateOrderRequest == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter reissueCertificateOrderRequest is required and cannot be null.")); - } else { - reissueCertificateOrderRequest.validate(); - } - context = this.client.mergeContext(context); - return service - .reissue( - this.client.getEndpoint(), - resourceGroupName, - certificateOrderName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - reissueCertificateOrderRequest, - context); - } - - /** - * Reissue an existing certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param reissueCertificateOrderRequest Parameters for the reissue. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono reissueAsync( - String resourceGroupName, - String certificateOrderName, - ReissueCertificateOrderRequest reissueCertificateOrderRequest) { - return reissueWithResponseAsync(resourceGroupName, certificateOrderName, reissueCertificateOrderRequest) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Reissue an existing certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param reissueCertificateOrderRequest Parameters for the reissue. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void reissue( - String resourceGroupName, - String certificateOrderName, - ReissueCertificateOrderRequest reissueCertificateOrderRequest) { - reissueAsync(resourceGroupName, certificateOrderName, reissueCertificateOrderRequest).block(); - } - - /** - * Reissue an existing certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param reissueCertificateOrderRequest Parameters for the reissue. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response reissueWithResponse( - String resourceGroupName, - String certificateOrderName, - ReissueCertificateOrderRequest reissueCertificateOrderRequest, - Context context) { - return reissueWithResponseAsync( - resourceGroupName, certificateOrderName, reissueCertificateOrderRequest, context) - .block(); - } - - /** - * Renew an existing certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param renewCertificateOrderRequest Renew parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> renewWithResponseAsync( - String resourceGroupName, - String certificateOrderName, - RenewCertificateOrderRequest renewCertificateOrderRequest) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (certificateOrderName == null) { - return Mono - .error(new IllegalArgumentException("Parameter certificateOrderName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (renewCertificateOrderRequest == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter renewCertificateOrderRequest is required and cannot be null.")); - } else { - renewCertificateOrderRequest.validate(); - } - return FluxUtil - .withContext( - context -> - service - .renew( - this.client.getEndpoint(), - resourceGroupName, - certificateOrderName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - renewCertificateOrderRequest, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Renew an existing certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param renewCertificateOrderRequest Renew parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> renewWithResponseAsync( - String resourceGroupName, - String certificateOrderName, - RenewCertificateOrderRequest renewCertificateOrderRequest, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (certificateOrderName == null) { - return Mono - .error(new IllegalArgumentException("Parameter certificateOrderName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (renewCertificateOrderRequest == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter renewCertificateOrderRequest is required and cannot be null.")); - } else { - renewCertificateOrderRequest.validate(); - } - context = this.client.mergeContext(context); - return service - .renew( - this.client.getEndpoint(), - resourceGroupName, - certificateOrderName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - renewCertificateOrderRequest, - context); - } - - /** - * Renew an existing certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param renewCertificateOrderRequest Renew parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono renewAsync( - String resourceGroupName, - String certificateOrderName, - RenewCertificateOrderRequest renewCertificateOrderRequest) { - return renewWithResponseAsync(resourceGroupName, certificateOrderName, renewCertificateOrderRequest) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Renew an existing certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param renewCertificateOrderRequest Renew parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void renew( - String resourceGroupName, - String certificateOrderName, - RenewCertificateOrderRequest renewCertificateOrderRequest) { - renewAsync(resourceGroupName, certificateOrderName, renewCertificateOrderRequest).block(); - } - - /** - * Renew an existing certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param renewCertificateOrderRequest Renew parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response renewWithResponse( - String resourceGroupName, - String certificateOrderName, - RenewCertificateOrderRequest renewCertificateOrderRequest, - Context context) { - return renewWithResponseAsync(resourceGroupName, certificateOrderName, renewCertificateOrderRequest, context) - .block(); - } - - /** - * Resend certificate email. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> resendEmailWithResponseAsync(String resourceGroupName, String certificateOrderName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (certificateOrderName == null) { - return Mono - .error(new IllegalArgumentException("Parameter certificateOrderName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .resendEmail( - this.client.getEndpoint(), - resourceGroupName, - certificateOrderName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Resend certificate email. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> resendEmailWithResponseAsync( - String resourceGroupName, String certificateOrderName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (certificateOrderName == null) { - return Mono - .error(new IllegalArgumentException("Parameter certificateOrderName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .resendEmail( - this.client.getEndpoint(), - resourceGroupName, - certificateOrderName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Resend certificate email. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono resendEmailAsync(String resourceGroupName, String certificateOrderName) { - return resendEmailWithResponseAsync(resourceGroupName, certificateOrderName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Resend certificate email. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void resendEmail(String resourceGroupName, String certificateOrderName) { - resendEmailAsync(resourceGroupName, certificateOrderName).block(); - } - - /** - * Resend certificate email. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response resendEmailWithResponse( - String resourceGroupName, String certificateOrderName, Context context) { - return resendEmailWithResponseAsync(resourceGroupName, certificateOrderName, context).block(); - } - - /** - * Verify domain ownership for this certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param nameIdentifier Email address. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> resendRequestEmailsWithResponseAsync( - String resourceGroupName, String certificateOrderName, NameIdentifierInner nameIdentifier) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (certificateOrderName == null) { - return Mono - .error(new IllegalArgumentException("Parameter certificateOrderName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (nameIdentifier == null) { - return Mono.error(new IllegalArgumentException("Parameter nameIdentifier is required and cannot be null.")); - } else { - nameIdentifier.validate(); - } - return FluxUtil - .withContext( - context -> - service - .resendRequestEmails( - this.client.getEndpoint(), - resourceGroupName, - certificateOrderName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - nameIdentifier, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Verify domain ownership for this certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param nameIdentifier Email address. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> resendRequestEmailsWithResponseAsync( - String resourceGroupName, String certificateOrderName, NameIdentifierInner nameIdentifier, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (certificateOrderName == null) { - return Mono - .error(new IllegalArgumentException("Parameter certificateOrderName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (nameIdentifier == null) { - return Mono.error(new IllegalArgumentException("Parameter nameIdentifier is required and cannot be null.")); - } else { - nameIdentifier.validate(); - } - context = this.client.mergeContext(context); - return service - .resendRequestEmails( - this.client.getEndpoint(), - resourceGroupName, - certificateOrderName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - nameIdentifier, - context); - } - - /** - * Verify domain ownership for this certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param nameIdentifier Email address. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono resendRequestEmailsAsync( - String resourceGroupName, String certificateOrderName, NameIdentifierInner nameIdentifier) { - return resendRequestEmailsWithResponseAsync(resourceGroupName, certificateOrderName, nameIdentifier) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Verify domain ownership for this certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param nameIdentifier Email address. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void resendRequestEmails( - String resourceGroupName, String certificateOrderName, NameIdentifierInner nameIdentifier) { - resendRequestEmailsAsync(resourceGroupName, certificateOrderName, nameIdentifier).block(); - } - - /** - * Verify domain ownership for this certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param nameIdentifier Email address. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response resendRequestEmailsWithResponse( - String resourceGroupName, String certificateOrderName, NameIdentifierInner nameIdentifier, Context context) { - return resendRequestEmailsWithResponseAsync(resourceGroupName, certificateOrderName, nameIdentifier, context) - .block(); - } - - /** - * Verify domain ownership for this certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param siteSealRequest Site seal request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site seal. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> retrieveSiteSealWithResponseAsync( - String resourceGroupName, String certificateOrderName, SiteSealRequest siteSealRequest) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (certificateOrderName == null) { - return Mono - .error(new IllegalArgumentException("Parameter certificateOrderName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (siteSealRequest == null) { - return Mono - .error(new IllegalArgumentException("Parameter siteSealRequest is required and cannot be null.")); - } else { - siteSealRequest.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .retrieveSiteSeal( - this.client.getEndpoint(), - resourceGroupName, - certificateOrderName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - siteSealRequest, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Verify domain ownership for this certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param siteSealRequest Site seal request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site seal. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> retrieveSiteSealWithResponseAsync( - String resourceGroupName, String certificateOrderName, SiteSealRequest siteSealRequest, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (certificateOrderName == null) { - return Mono - .error(new IllegalArgumentException("Parameter certificateOrderName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (siteSealRequest == null) { - return Mono - .error(new IllegalArgumentException("Parameter siteSealRequest is required and cannot be null.")); - } else { - siteSealRequest.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .retrieveSiteSeal( - this.client.getEndpoint(), - resourceGroupName, - certificateOrderName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - siteSealRequest, - accept, - context); - } - - /** - * Verify domain ownership for this certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param siteSealRequest Site seal request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site seal. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono retrieveSiteSealAsync( - String resourceGroupName, String certificateOrderName, SiteSealRequest siteSealRequest) { - return retrieveSiteSealWithResponseAsync(resourceGroupName, certificateOrderName, siteSealRequest) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Verify domain ownership for this certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param siteSealRequest Site seal request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site seal. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SiteSealInner retrieveSiteSeal( - String resourceGroupName, String certificateOrderName, SiteSealRequest siteSealRequest) { - return retrieveSiteSealAsync(resourceGroupName, certificateOrderName, siteSealRequest).block(); - } - - /** - * Verify domain ownership for this certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param siteSealRequest Site seal request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site seal. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response retrieveSiteSealWithResponse( - String resourceGroupName, String certificateOrderName, SiteSealRequest siteSealRequest, Context context) { - return retrieveSiteSealWithResponseAsync(resourceGroupName, certificateOrderName, siteSealRequest, context) - .block(); - } - - /** - * Verify domain ownership for this certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> verifyDomainOwnershipWithResponseAsync( - String resourceGroupName, String certificateOrderName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (certificateOrderName == null) { - return Mono - .error(new IllegalArgumentException("Parameter certificateOrderName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .verifyDomainOwnership( - this.client.getEndpoint(), - resourceGroupName, - certificateOrderName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Verify domain ownership for this certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> verifyDomainOwnershipWithResponseAsync( - String resourceGroupName, String certificateOrderName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (certificateOrderName == null) { - return Mono - .error(new IllegalArgumentException("Parameter certificateOrderName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .verifyDomainOwnership( - this.client.getEndpoint(), - resourceGroupName, - certificateOrderName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Verify domain ownership for this certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono verifyDomainOwnershipAsync(String resourceGroupName, String certificateOrderName) { - return verifyDomainOwnershipWithResponseAsync(resourceGroupName, certificateOrderName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Verify domain ownership for this certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void verifyDomainOwnership(String resourceGroupName, String certificateOrderName) { - verifyDomainOwnershipAsync(resourceGroupName, certificateOrderName).block(); - } - - /** - * Verify domain ownership for this certificate order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response verifyDomainOwnershipWithResponse( - String resourceGroupName, String certificateOrderName, Context context) { - return verifyDomainOwnershipWithResponseAsync(resourceGroupName, certificateOrderName, context).block(); - } - - /** - * Retrieve the list of certificate actions. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the certificate order. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of CertificateOrderAction. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> retrieveCertificateActionsWithResponseAsync( - String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .retrieveCertificateActions( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Retrieve the list of certificate actions. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the certificate order. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of CertificateOrderAction. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> retrieveCertificateActionsWithResponseAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .retrieveCertificateActions( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Retrieve the list of certificate actions. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the certificate order. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of CertificateOrderAction. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> retrieveCertificateActionsAsync( - String resourceGroupName, String name) { - return retrieveCertificateActionsWithResponseAsync(resourceGroupName, name) - .flatMap( - (Response> res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Retrieve the list of certificate actions. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the certificate order. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of CertificateOrderAction. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public List retrieveCertificateActions(String resourceGroupName, String name) { - return retrieveCertificateActionsAsync(resourceGroupName, name).block(); - } - - /** - * Retrieve the list of certificate actions. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the certificate order. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of CertificateOrderAction. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response> retrieveCertificateActionsWithResponse( - String resourceGroupName, String name, Context context) { - return retrieveCertificateActionsWithResponseAsync(resourceGroupName, name, context).block(); - } - - /** - * Retrieve email history. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the certificate order. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of CertificateEmail. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> retrieveCertificateEmailHistoryWithResponseAsync( - String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .retrieveCertificateEmailHistory( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Retrieve email history. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the certificate order. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of CertificateEmail. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> retrieveCertificateEmailHistoryWithResponseAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .retrieveCertificateEmailHistory( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Retrieve email history. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the certificate order. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of CertificateEmail. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> retrieveCertificateEmailHistoryAsync( - String resourceGroupName, String name) { - return retrieveCertificateEmailHistoryWithResponseAsync(resourceGroupName, name) - .flatMap( - (Response> res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Retrieve email history. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the certificate order. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of CertificateEmail. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public List retrieveCertificateEmailHistory(String resourceGroupName, String name) { - return retrieveCertificateEmailHistoryAsync(resourceGroupName, name).block(); - } - - /** - * Retrieve email history. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the certificate order. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of CertificateEmail. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response> retrieveCertificateEmailHistoryWithResponse( - String resourceGroupName, String name, Context context) { - return retrieveCertificateEmailHistoryWithResponseAsync(resourceGroupName, name, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of certificate orders. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of certificate orders. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of certificate orders. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync( - String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of certificate orders. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of certificate order certificates. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listCertificatesNextSinglePageAsync( - String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listCertificatesNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of certificate order certificates. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listCertificatesNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listCertificatesNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/AppServiceCertificateOrdersImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/AppServiceCertificateOrdersImpl.java deleted file mode 100644 index 1a3aeaecad64..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/AppServiceCertificateOrdersImpl.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.implementation; - -import com.azure.resourcemanager.appservice.AppServiceManager; -import com.azure.resourcemanager.appservice.models.AppServiceCertificateOrder; -import com.azure.resourcemanager.appservice.models.AppServiceCertificateOrders; -import com.azure.resourcemanager.appservice.models.AppServicePlans; -import com.azure.resourcemanager.appservice.fluent.models.AppServiceCertificateOrderInner; -import com.azure.resourcemanager.appservice.fluent.AppServiceCertificateOrdersClient; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.TopLevelModifiableResourcesImpl; - -/** The implementation for {@link AppServicePlans}. */ -public class AppServiceCertificateOrdersImpl - extends TopLevelModifiableResourcesImpl< - AppServiceCertificateOrder, - AppServiceCertificateOrderImpl, - AppServiceCertificateOrderInner, - AppServiceCertificateOrdersClient, - AppServiceManager> - implements AppServiceCertificateOrders { - - public AppServiceCertificateOrdersImpl(AppServiceManager manager) { - super(manager.serviceClient().getAppServiceCertificateOrders(), manager); - } - - @Override - protected AppServiceCertificateOrderImpl wrapModel(String name) { - return new AppServiceCertificateOrderImpl(name, new AppServiceCertificateOrderInner(), this.manager()); - } - - @Override - protected AppServiceCertificateOrderImpl wrapModel(AppServiceCertificateOrderInner inner) { - if (inner == null) { - return null; - } - return new AppServiceCertificateOrderImpl(inner.name(), inner, this.manager()); - } - - @Override - public AppServiceCertificateOrderImpl define(String name) { - return wrapModel(name); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/AppServiceCertificatesImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/AppServiceCertificatesImpl.java deleted file mode 100644 index 4c2ea84165e5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/AppServiceCertificatesImpl.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.CoreUtils; -import com.azure.resourcemanager.appservice.AppServiceManager; -import com.azure.resourcemanager.appservice.models.AppServiceCertificate; -import com.azure.resourcemanager.appservice.models.AppServiceCertificates; -import com.azure.resourcemanager.appservice.fluent.models.CertificateInner; -import com.azure.resourcemanager.appservice.fluent.CertificatesClient; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.GroupableResourcesImpl; -import reactor.core.publisher.Mono; - -/** The implementation for AppServiceCertificates. */ -public class AppServiceCertificatesImpl - extends GroupableResourcesImpl< - AppServiceCertificate, AppServiceCertificateImpl, CertificateInner, CertificatesClient, AppServiceManager> - implements AppServiceCertificates { - - public AppServiceCertificatesImpl(AppServiceManager manager) { - super(manager.serviceClient().getCertificates(), manager); - } - - @Override - protected Mono getInnerAsync(String resourceGroupName, String name) { - return this.inner().getByResourceGroupAsync(resourceGroupName, name); - } - - @Override - protected Mono deleteInnerAsync(String resourceGroupName, String name) { - return this.inner().deleteAsync(resourceGroupName, name); - } - - @Override - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(this.listByResourceGroupAsync(resourceGroupName)); - } - - @Override - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - if (CoreUtils.isNullOrEmpty(resourceGroupName)) { - return new PagedFlux<>(() -> Mono.error( - new IllegalArgumentException("Parameter 'resourceGroupName' is required and cannot be null."))); - } - return wrapPageAsync(inner().listByResourceGroupAsync(resourceGroupName)); - } - - @Override - protected AppServiceCertificateImpl wrapModel(String name) { - return new AppServiceCertificateImpl(name, new CertificateInner(), this.manager()); - } - - @Override - protected AppServiceCertificateImpl wrapModel(CertificateInner inner) { - if (inner == null) { - return null; - } - return new AppServiceCertificateImpl(inner.name(), inner, this.manager()); - } - - @Override - public AppServiceCertificateImpl define(String name) { - return wrapModel(name); - } - - @Override - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - @Override - public PagedFlux listAsync() { - return wrapPageAsync(inner().listAsync()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/AppServiceDomainImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/AppServiceDomainImpl.java deleted file mode 100644 index 965d7abc1cd6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/AppServiceDomainImpl.java +++ /dev/null @@ -1,283 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.implementation; - -import com.azure.resourcemanager.appservice.AppServiceManager; -import com.azure.resourcemanager.appservice.fluent.DomainsClient; -import com.azure.resourcemanager.appservice.fluent.models.DomainInner; -import com.azure.resourcemanager.appservice.fluent.models.DomainOwnershipIdentifierInner; -import com.azure.resourcemanager.appservice.fluent.models.TldLegalAgreementInner; -import com.azure.resourcemanager.appservice.models.AppServiceDomain; -import com.azure.resourcemanager.appservice.models.Contact; -import com.azure.resourcemanager.appservice.models.DnsType; -import com.azure.resourcemanager.appservice.models.DomainPurchaseConsent; -import com.azure.resourcemanager.appservice.models.DomainStatus; -import com.azure.resourcemanager.appservice.models.Hostname; -import com.azure.resourcemanager.appservice.models.TopLevelDomainAgreementOption; -import com.azure.resourcemanager.dns.models.DnsZone; -import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.GroupableResourceImpl; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import reactor.core.publisher.Mono; - -import java.net.Inet4Address; -import java.net.UnknownHostException; -import java.time.OffsetDateTime; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.function.Function; -import java.util.stream.Collectors; - -/** The implementation for AppServiceDomain. */ -class AppServiceDomainImpl - extends GroupableResourceImpl - implements AppServiceDomain, AppServiceDomain.Definition, AppServiceDomain.Update { - - private Map hostNameMap; - - private Creatable dnsZoneCreatable; - - AppServiceDomainImpl(String name, DomainInner innerObject, AppServiceManager manager) { - super(name, innerObject, manager); - innerModel().withLocation("global"); - if (innerModel().managedHostNames() != null) { - this.hostNameMap = - innerModel().managedHostNames().stream().collect(Collectors.toMap(Hostname::name, Function.identity())); - } - } - - @Override - public Mono createAsync() { - if (this.isInCreateMode()) { - // create a default DNS zone, if not specified - if (this.innerModel().dnsZoneId() == null && dnsZoneCreatable == null) { - this.withNewDnsZone(name()); - } - } - return super.createAsync(); - } - @Override - public Mono createResourceAsync() { - if (this.dnsZoneCreatable != null) { - DnsZone dnsZone = this.taskResult(dnsZoneCreatable.key()); - innerModel().withDnsZoneId(dnsZone.id()); - } - - String[] domainParts = this.name().split("\\."); - String topLevel = domainParts[domainParts.length - 1]; - final DomainsClient client = this.manager().serviceClient().getDomains(); - return this - .manager() - .serviceClient() - .getTopLevelDomains() - .listAgreementsAsync(topLevel, new TopLevelDomainAgreementOption()) - // Step 1: Consent to agreements, - .map(TldLegalAgreementInner::agreementKey) - .collectList() - // Step 2: Create domain - .flatMap( - keys -> { - try { - innerModel() - .withConsent( - new DomainPurchaseConsent() - .withAgreedAt(OffsetDateTime.now()) - .withAgreedBy(Inet4Address.getLocalHost().getHostAddress()) - .withAgreementKeys(keys)); - } catch (UnknownHostException e) { - return Mono.error(e); - } - return client.createOrUpdateAsync(resourceGroupName(), name(), innerModel()); - }) - .map(innerToFluentMap(this)) - .doOnSuccess(ignored -> dnsZoneCreatable = null); - } - - @Override - protected Mono getInnerAsync() { - return this.manager().serviceClient().getDomains().getByResourceGroupAsync(resourceGroupName(), name()); - } - - @Override - public Contact adminContact() { - return innerModel().contactAdmin(); - } - - @Override - public Contact billingContact() { - return innerModel().contactBilling(); - } - - @Override - public Contact registrantContact() { - return innerModel().contactRegistrant(); - } - - @Override - public Contact techContact() { - return innerModel().contactTech(); - } - - @Override - public DomainStatus registrationStatus() { - return innerModel().registrationStatus(); - } - - @Override - public List nameServers() { - return Collections.unmodifiableList(innerModel().nameServers()); - } - - @Override - public boolean privacy() { - return ResourceManagerUtils.toPrimitiveBoolean(innerModel().privacy()); - } - - @Override - public OffsetDateTime createdTime() { - return innerModel().createdTime(); - } - - @Override - public OffsetDateTime expirationTime() { - return innerModel().expirationTime(); - } - - @Override - public OffsetDateTime lastRenewedTime() { - return innerModel().lastRenewedTime(); - } - - @Override - public boolean autoRenew() { - return ResourceManagerUtils.toPrimitiveBoolean(innerModel().autoRenew()); - } - - @Override - public boolean readyForDnsRecordManagement() { - return ResourceManagerUtils.toPrimitiveBoolean(innerModel().readyForDnsRecordManagement()); - } - - @Override - public Map managedHostNames() { - if (hostNameMap == null) { - return null; - } - return Collections.unmodifiableMap(hostNameMap); - } - - @Override - public DomainPurchaseConsent consent() { - return innerModel().consent(); - } - - @Override - public DnsType dnsType() { - return innerModel().dnsType(); - } - - @Override - public String dnsZoneId() { - return innerModel().dnsZoneId(); - } - - @Override - public void verifyDomainOwnership(String certificateOrderName, String domainVerificationToken) { - verifyDomainOwnershipAsync(certificateOrderName, domainVerificationToken).block(); - } - - @Override - public Mono verifyDomainOwnershipAsync(String certificateOrderName, String domainVerificationToken) { - DomainOwnershipIdentifierInner identifierInner = - new DomainOwnershipIdentifierInner().withOwnershipId(domainVerificationToken); - return this - .manager() - .serviceClient() - .getDomains() - .createOrUpdateOwnershipIdentifierAsync(resourceGroupName(), name(), certificateOrderName, identifierInner) - .then(Mono.empty()); - } - - @Override - public AppServiceDomainImpl withAdminContact(Contact contact) { - innerModel().withContactAdmin(contact); - return this; - } - - @Override - public AppServiceDomainImpl withBillingContact(Contact contact) { - innerModel().withContactBilling(contact); - return this; - } - - @Override - public AppServiceDomainImpl withRegistrantContact(Contact contact) { - innerModel().withContactAdmin(contact); - innerModel().withContactBilling(contact); - innerModel().withContactRegistrant(contact); - innerModel().withContactTech(contact); - return this; - } - - @Override - public DomainContactImpl defineRegistrantContact() { - return new DomainContactImpl(new Contact(), this); - } - - @Override - public AppServiceDomainImpl withTechContact(Contact contact) { - innerModel().withContactTech(contact); - return this; - } - - @Override - public AppServiceDomainImpl withDomainPrivacyEnabled(boolean domainPrivacy) { - innerModel().withPrivacy(domainPrivacy); - return this; - } - - @Override - public AppServiceDomainImpl withAutoRenewEnabled(boolean autoRenew) { - innerModel().withAutoRenew(autoRenew); - return this; - } - - @Override - public AppServiceDomainImpl withNewDnsZone(String dnsZoneName) { - Creatable dnsZone; - if (creatableGroup != null && isInCreateMode()) { - dnsZone = manager().dnsZoneManager().zones() - .define(dnsZoneName) - .withNewResourceGroup(creatableGroup) - .withETagCheck(); - } else { - dnsZone = manager().dnsZoneManager().zones() - .define(dnsZoneName) - .withExistingResourceGroup(resourceGroupName()) - .withETagCheck(); - } - return this.withNewDnsZone(dnsZone); - } - - @Override - public AppServiceDomainImpl withNewDnsZone(Creatable dnsZone) { - innerModel().withDnsType(DnsType.AZURE_DNS); - dnsZoneCreatable = dnsZone; - this.addDependency(dnsZoneCreatable); - return this; - } - - @Override - public AppServiceDomainImpl withExistingDnsZone(String dnsZoneId) { - innerModel().withDnsType(DnsType.AZURE_DNS); - innerModel().withDnsZoneId(dnsZoneId); - return this; - } - - @Override - public AppServiceDomainImpl withExistingDnsZone(DnsZone dnsZone) { - return withExistingDnsZone(dnsZone.id()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/AppServiceDomainsImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/AppServiceDomainsImpl.java deleted file mode 100644 index 4a44c762a5cb..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/AppServiceDomainsImpl.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.appservice.AppServiceManager; -import com.azure.resourcemanager.appservice.models.AppServiceDomain; -import com.azure.resourcemanager.appservice.models.AppServiceDomains; -import com.azure.resourcemanager.appservice.models.DomainLegalAgreement; -import com.azure.resourcemanager.appservice.models.TopLevelDomainAgreementOption; -import com.azure.resourcemanager.appservice.fluent.models.DomainInner; -import com.azure.resourcemanager.appservice.fluent.DomainsClient; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.TopLevelModifiableResourcesImpl; -import com.azure.resourcemanager.resources.fluentcore.utils.PagedConverter; - -/** The implementation for AppServiceDomains. */ -public class AppServiceDomainsImpl - extends TopLevelModifiableResourcesImpl< - AppServiceDomain, AppServiceDomainImpl, DomainInner, DomainsClient, AppServiceManager> - implements AppServiceDomains { - - public AppServiceDomainsImpl(AppServiceManager manager) { - super(manager.serviceClient().getDomains(), manager); - } - - @Override - protected AppServiceDomainImpl wrapModel(String name) { - return new AppServiceDomainImpl(name, new DomainInner(), this.manager()); - } - - @Override - protected AppServiceDomainImpl wrapModel(DomainInner inner) { - if (inner == null) { - return null; - } - return new AppServiceDomainImpl(inner.name(), inner, this.manager()); - } - - @Override - public AppServiceDomainImpl define(String name) { - return wrapModel(name); - } - - @Override - public PagedIterable listAgreements(String topLevelExtension) { - return PagedConverter.mapPage(this - .manager() - .serviceClient() - .getTopLevelDomains() - .listAgreements(topLevelExtension, new TopLevelDomainAgreementOption()), - DomainLegalAgreementImpl::new); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/AppServiceEnvironmentsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/AppServiceEnvironmentsClientImpl.java deleted file mode 100644 index 052ee44b6113..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/AppServiceEnvironmentsClientImpl.java +++ /dev/null @@ -1,11279 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.appservice.fluent.AppServiceEnvironmentsClient; -import com.azure.resourcemanager.appservice.fluent.models.AddressResponseInner; -import com.azure.resourcemanager.appservice.fluent.models.AppServiceEnvironmentResourceInner; -import com.azure.resourcemanager.appservice.fluent.models.AppServicePlanInner; -import com.azure.resourcemanager.appservice.fluent.models.CsmUsageQuotaInner; -import com.azure.resourcemanager.appservice.fluent.models.HostingEnvironmentDiagnosticsInner; -import com.azure.resourcemanager.appservice.fluent.models.InboundEnvironmentEndpointInner; -import com.azure.resourcemanager.appservice.fluent.models.MetricDefinitionInner; -import com.azure.resourcemanager.appservice.fluent.models.OperationInner; -import com.azure.resourcemanager.appservice.fluent.models.OutboundEnvironmentEndpointInner; -import com.azure.resourcemanager.appservice.fluent.models.ResourceMetricDefinitionInner; -import com.azure.resourcemanager.appservice.fluent.models.ResourceMetricInner; -import com.azure.resourcemanager.appservice.fluent.models.SiteInner; -import com.azure.resourcemanager.appservice.fluent.models.SkuInfoInner; -import com.azure.resourcemanager.appservice.fluent.models.StampCapacityInner; -import com.azure.resourcemanager.appservice.fluent.models.UsageInner; -import com.azure.resourcemanager.appservice.fluent.models.WorkerPoolResourceInner; -import com.azure.resourcemanager.appservice.models.AppServiceEnvironmentCollection; -import com.azure.resourcemanager.appservice.models.AppServiceEnvironmentPatchResource; -import com.azure.resourcemanager.appservice.models.AppServicePlanCollection; -import com.azure.resourcemanager.appservice.models.CsmUsageQuotaCollection; -import com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException; -import com.azure.resourcemanager.appservice.models.InboundEnvironmentEndpointCollection; -import com.azure.resourcemanager.appservice.models.OutboundEnvironmentEndpointCollection; -import com.azure.resourcemanager.appservice.models.ResourceMetricCollection; -import com.azure.resourcemanager.appservice.models.ResourceMetricDefinitionCollection; -import com.azure.resourcemanager.appservice.models.SkuInfoCollection; -import com.azure.resourcemanager.appservice.models.StampCapacityCollection; -import com.azure.resourcemanager.appservice.models.UsageCollection; -import com.azure.resourcemanager.appservice.models.VirtualNetworkProfile; -import com.azure.resourcemanager.appservice.models.WebAppCollection; -import com.azure.resourcemanager.appservice.models.WorkerPoolCollection; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import java.util.List; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in AppServiceEnvironmentsClient. */ -public final class AppServiceEnvironmentsClientImpl - implements InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete, - AppServiceEnvironmentsClient { - private final ClientLogger logger = new ClientLogger(AppServiceEnvironmentsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final AppServiceEnvironmentsService service; - - /** The service client containing this operation class. */ - private final WebSiteManagementClientImpl client; - - /** - * Initializes an instance of AppServiceEnvironmentsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - AppServiceEnvironmentsClientImpl(WebSiteManagementClientImpl client) { - this.service = - RestProxy - .create(AppServiceEnvironmentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for WebSiteManagementClientAppServiceEnvironments to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "WebSiteManagementCli") - private interface AppServiceEnvironmentsService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Web/hostingEnvironments") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web" - + "/hostingEnvironments") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web" - + "/hostingEnvironments/{name}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web" - + "/hostingEnvironments/{name}") - @ExpectedResponses({200, 202, 400, 404, 409}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") AppServiceEnvironmentResourceInner hostingEnvironmentEnvelope, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web" - + "/hostingEnvironments/{name}") - @ExpectedResponses({202, 204, 400, 404, 409}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @QueryParam("forceDelete") Boolean forceDelete, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web" - + "/hostingEnvironments/{name}") - @ExpectedResponses({200, 202, 400, 404, 409}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") AppServiceEnvironmentPatchResource hostingEnvironmentEnvelope, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web" - + "/hostingEnvironments/{name}/capacities/compute") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listCapacities( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web" - + "/hostingEnvironments/{name}/capacities/virtualip") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listVips( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web" - + "/hostingEnvironments/{name}/changeVirtualNetwork") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono>> changeVnet( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") VirtualNetworkProfile vnetInfo, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web" - + "/hostingEnvironments/{name}/diagnostics") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono>> listDiagnostics( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web" - + "/hostingEnvironments/{name}/diagnostics/{diagnosticsName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getDiagnosticsItem( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("diagnosticsName") String diagnosticsName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web" - + "/hostingEnvironments/{name}/inboundNetworkDependenciesEndpoints") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getInboundNetworkDependenciesEndpoints( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web" - + "/hostingEnvironments/{name}/metricdefinitions") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listMetricDefinitions( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web" - + "/hostingEnvironments/{name}/metrics") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listMetrics( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @QueryParam("details") Boolean details, - @QueryParam(value = "$filter", encoded = true) String filter, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web" - + "/hostingEnvironments/{name}/multiRolePools") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listMultiRolePools( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web" - + "/hostingEnvironments/{name}/multiRolePools/default") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getMultiRolePool( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web" - + "/hostingEnvironments/{name}/multiRolePools/default") - @ExpectedResponses({200, 202, 400, 404, 409}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdateMultiRolePool( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") WorkerPoolResourceInner multiRolePoolEnvelope, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web" - + "/hostingEnvironments/{name}/multiRolePools/default") - @ExpectedResponses({200, 202, 400, 404, 409}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> updateMultiRolePool( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") WorkerPoolResourceInner multiRolePoolEnvelope, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web" - + "/hostingEnvironments/{name}/multiRolePools/default/instances/{instance}/metricdefinitions") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listMultiRolePoolInstanceMetricDefinitions( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("instance") String instance, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web" - + "/hostingEnvironments/{name}/multiRolePools/default/instances/{instance}/metrics") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listMultiRolePoolInstanceMetrics( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("instance") String instance, - @QueryParam("details") Boolean details, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web" - + "/hostingEnvironments/{name}/multiRolePools/default/metricdefinitions") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listMultiRoleMetricDefinitions( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web" - + "/hostingEnvironments/{name}/multiRolePools/default/metrics") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listMultiRoleMetrics( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @QueryParam("startTime") String startTime, - @QueryParam("endTime") String endTime, - @QueryParam("timeGrain") String timeGrain, - @QueryParam("details") Boolean details, - @QueryParam(value = "$filter", encoded = true) String filter, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web" - + "/hostingEnvironments/{name}/multiRolePools/default/skus") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listMultiRolePoolSkus( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web" - + "/hostingEnvironments/{name}/multiRolePools/default/usages") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listMultiRoleUsages( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web" - + "/hostingEnvironments/{name}/operations") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono>> listOperations( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web" - + "/hostingEnvironments/{name}/outboundNetworkDependenciesEndpoints") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getOutboundNetworkDependenciesEndpoints( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web" - + "/hostingEnvironments/{name}/reboot") - @ExpectedResponses({202, 400, 404, 409}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> reboot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web" - + "/hostingEnvironments/{name}/resume") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono>> resume( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web" - + "/hostingEnvironments/{name}/serverfarms") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listAppServicePlans( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web" - + "/hostingEnvironments/{name}/sites") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listWebApps( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @QueryParam("propertiesToInclude") String propertiesToInclude, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web" - + "/hostingEnvironments/{name}/suspend") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono>> suspend( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web" - + "/hostingEnvironments/{name}/usages") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listUsages( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @QueryParam(value = "$filter", encoded = true) String filter, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web" - + "/hostingEnvironments/{name}/workerPools") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listWorkerPools( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web" - + "/hostingEnvironments/{name}/workerPools/{workerPoolName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getWorkerPool( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("workerPoolName") String workerPoolName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web" - + "/hostingEnvironments/{name}/workerPools/{workerPoolName}") - @ExpectedResponses({200, 202, 400, 404, 409}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdateWorkerPool( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("workerPoolName") String workerPoolName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") WorkerPoolResourceInner workerPoolEnvelope, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web" - + "/hostingEnvironments/{name}/workerPools/{workerPoolName}") - @ExpectedResponses({200, 202, 400, 404, 409}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> updateWorkerPool( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("workerPoolName") String workerPoolName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") WorkerPoolResourceInner workerPoolEnvelope, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web" - + "/hostingEnvironments/{name}/workerPools/{workerPoolName}/instances/{instance}/metricdefinitions") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listWorkerPoolInstanceMetricDefinitions( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("workerPoolName") String workerPoolName, - @PathParam("instance") String instance, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web" - + "/hostingEnvironments/{name}/workerPools/{workerPoolName}/instances/{instance}/metrics") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listWorkerPoolInstanceMetrics( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("workerPoolName") String workerPoolName, - @PathParam("instance") String instance, - @QueryParam("details") Boolean details, - @QueryParam(value = "$filter", encoded = true) String filter, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web" - + "/hostingEnvironments/{name}/workerPools/{workerPoolName}/metricdefinitions") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listWebWorkerMetricDefinitions( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("workerPoolName") String workerPoolName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web" - + "/hostingEnvironments/{name}/workerPools/{workerPoolName}/metrics") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listWebWorkerMetrics( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("workerPoolName") String workerPoolName, - @QueryParam("details") Boolean details, - @QueryParam(value = "$filter", encoded = true) String filter, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web" - + "/hostingEnvironments/{name}/workerPools/{workerPoolName}/skus") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listWorkerPoolSkus( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("workerPoolName") String workerPoolName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web" - + "/hostingEnvironments/{name}/workerPools/{workerPoolName}/usages") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listWebWorkerUsages( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("workerPoolName") String workerPoolName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listCapacitiesNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> changeVnetNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getInboundNetworkDependenciesEndpointsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listMetricsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listMultiRolePoolsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listMultiRolePoolInstanceMetricDefinitionsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listMultiRolePoolInstanceMetricsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listMultiRoleMetricDefinitionsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listMultiRoleMetricsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listMultiRolePoolSkusNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listMultiRoleUsagesNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getOutboundNetworkDependenciesEndpointsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> resumeNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listAppServicePlansNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listWebAppsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> suspendNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listUsagesNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listWorkerPoolsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listWorkerPoolInstanceMetricDefinitionsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listWorkerPoolInstanceMetricsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listWebWorkerMetricDefinitionsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listWebWorkerMetricsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listWorkerPoolSkusNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listWebWorkerUsagesNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Get all App Service Environments for a subscription. - * - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all App Service Environments for a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get all App Service Environments for a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all App Service Environments for a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get all App Service Environments for a subscription. - * - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all App Service Environments for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Get all App Service Environments for a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all App Service Environments for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Get all App Service Environments for a subscription. - * - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all App Service Environments for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Get all App Service Environments for a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all App Service Environments for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Get all App Service Environments in a resource group. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all App Service Environments in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get all App Service Environments in a resource group. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all App Service Environments in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get all App Service Environments in a resource group. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all App Service Environments in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * Get all App Service Environments in a resource group. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all App Service Environments in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync( - String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * Get all App Service Environments in a resource group. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all App Service Environments in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * Get all App Service Environments in a resource group. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all App Service Environments in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup( - String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * Get the properties of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the properties of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Get the properties of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync(String resourceGroupName, String name) { - return getByResourceGroupWithResponseAsync(resourceGroupName, name) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get the properties of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AppServiceEnvironmentResourceInner getByResourceGroup(String resourceGroupName, String name) { - return getByResourceGroupAsync(resourceGroupName, name).block(); - } - - /** - * Get the properties of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String name, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); - } - - /** - * Create or update an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param hostingEnvironmentEnvelope Configuration details of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return app Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String name, AppServiceEnvironmentResourceInner hostingEnvironmentEnvelope) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (hostingEnvironmentEnvelope == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter hostingEnvironmentEnvelope is required and cannot be null.")); - } else { - hostingEnvironmentEnvelope.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - hostingEnvironmentEnvelope, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create or update an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param hostingEnvironmentEnvelope Configuration details of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return app Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String name, - AppServiceEnvironmentResourceInner hostingEnvironmentEnvelope, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (hostingEnvironmentEnvelope == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter hostingEnvironmentEnvelope is required and cannot be null.")); - } else { - hostingEnvironmentEnvelope.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - hostingEnvironmentEnvelope, - accept, - context); - } - - /** - * Create or update an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param hostingEnvironmentEnvelope Configuration details of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return app Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, AppServiceEnvironmentResourceInner> - beginCreateOrUpdateAsync( - String resourceGroupName, String name, AppServiceEnvironmentResourceInner hostingEnvironmentEnvelope) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, name, hostingEnvironmentEnvelope); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - AppServiceEnvironmentResourceInner.class, - AppServiceEnvironmentResourceInner.class, - Context.NONE); - } - - /** - * Create or update an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param hostingEnvironmentEnvelope Configuration details of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return app Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, AppServiceEnvironmentResourceInner> - beginCreateOrUpdateAsync( - String resourceGroupName, - String name, - AppServiceEnvironmentResourceInner hostingEnvironmentEnvelope, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, name, hostingEnvironmentEnvelope, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - AppServiceEnvironmentResourceInner.class, - AppServiceEnvironmentResourceInner.class, - context); - } - - /** - * Create or update an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param hostingEnvironmentEnvelope Configuration details of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return app Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, AppServiceEnvironmentResourceInner> - beginCreateOrUpdate( - String resourceGroupName, String name, AppServiceEnvironmentResourceInner hostingEnvironmentEnvelope) { - return beginCreateOrUpdateAsync(resourceGroupName, name, hostingEnvironmentEnvelope).getSyncPoller(); - } - - /** - * Create or update an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param hostingEnvironmentEnvelope Configuration details of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return app Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, AppServiceEnvironmentResourceInner> - beginCreateOrUpdate( - String resourceGroupName, - String name, - AppServiceEnvironmentResourceInner hostingEnvironmentEnvelope, - Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, name, hostingEnvironmentEnvelope, context).getSyncPoller(); - } - - /** - * Create or update an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param hostingEnvironmentEnvelope Configuration details of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return app Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, String name, AppServiceEnvironmentResourceInner hostingEnvironmentEnvelope) { - return beginCreateOrUpdateAsync(resourceGroupName, name, hostingEnvironmentEnvelope) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create or update an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param hostingEnvironmentEnvelope Configuration details of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return app Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, - String name, - AppServiceEnvironmentResourceInner hostingEnvironmentEnvelope, - Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, name, hostingEnvironmentEnvelope, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create or update an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param hostingEnvironmentEnvelope Configuration details of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return app Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AppServiceEnvironmentResourceInner createOrUpdate( - String resourceGroupName, String name, AppServiceEnvironmentResourceInner hostingEnvironmentEnvelope) { - return createOrUpdateAsync(resourceGroupName, name, hostingEnvironmentEnvelope).block(); - } - - /** - * Create or update an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param hostingEnvironmentEnvelope Configuration details of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return app Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AppServiceEnvironmentResourceInner createOrUpdate( - String resourceGroupName, - String name, - AppServiceEnvironmentResourceInner hostingEnvironmentEnvelope, - Context context) { - return createOrUpdateAsync(resourceGroupName, name, hostingEnvironmentEnvelope, context).block(); - } - - /** - * Delete an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param forceDelete Specify <code>true</code> to force the deletion even if the App Service - * Environment contains resources. The default is <code>false</code>. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync( - String resourceGroupName, String name, Boolean forceDelete) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - name, - forceDelete, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param forceDelete Specify <code>true</code> to force the deletion even if the App Service - * Environment contains resources. The default is <code>false</code>. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String name, Boolean forceDelete, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - name, - forceDelete, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Delete an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param forceDelete Specify <code>true</code> to force the deletion even if the App Service - * Environment contains resources. The default is <code>false</code>. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String name, Boolean forceDelete) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, forceDelete); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Delete an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param forceDelete Specify <code>true</code> to force the deletion even if the App Service - * Environment contains resources. The default is <code>false</code>. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String name, Boolean forceDelete, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, forceDelete, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Delete an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param forceDelete Specify <code>true</code> to force the deletion even if the App Service - * Environment contains resources. The default is <code>false</code>. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Boolean forceDelete) { - return beginDeleteAsync(resourceGroupName, name, forceDelete).getSyncPoller(); - } - - /** - * Delete an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param forceDelete Specify <code>true</code> to force the deletion even if the App Service - * Environment contains resources. The default is <code>false</code>. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String name, Boolean forceDelete, Context context) { - return beginDeleteAsync(resourceGroupName, name, forceDelete, context).getSyncPoller(); - } - - /** - * Delete an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param forceDelete Specify <code>true</code> to force the deletion even if the App Service - * Environment contains resources. The default is <code>false</code>. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String name, Boolean forceDelete) { - return beginDeleteAsync(resourceGroupName, name, forceDelete) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Delete an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String name) { - final Boolean forceDelete = null; - return beginDeleteAsync(resourceGroupName, name, forceDelete) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Delete an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param forceDelete Specify <code>true</code> to force the deletion even if the App Service - * Environment contains resources. The default is <code>false</code>. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String name, Boolean forceDelete, Context context) { - return beginDeleteAsync(resourceGroupName, name, forceDelete, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Delete an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param forceDelete Specify <code>true</code> to force the deletion even if the App Service - * Environment contains resources. The default is <code>false</code>. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String name, Boolean forceDelete) { - deleteAsync(resourceGroupName, name, forceDelete).block(); - } - - /** - * Delete an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String name) { - final Boolean forceDelete = null; - deleteAsync(resourceGroupName, name, forceDelete).block(); - } - - /** - * Delete an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param forceDelete Specify <code>true</code> to force the deletion even if the App Service - * Environment contains resources. The default is <code>false</code>. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String name, Boolean forceDelete, Context context) { - deleteAsync(resourceGroupName, name, forceDelete, context).block(); - } - - /** - * Create or update an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param hostingEnvironmentEnvelope Configuration details of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return app Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateWithResponseAsync( - String resourceGroupName, String name, AppServiceEnvironmentPatchResource hostingEnvironmentEnvelope) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (hostingEnvironmentEnvelope == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter hostingEnvironmentEnvelope is required and cannot be null.")); - } else { - hostingEnvironmentEnvelope.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - hostingEnvironmentEnvelope, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create or update an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param hostingEnvironmentEnvelope Configuration details of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return app Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, - String name, - AppServiceEnvironmentPatchResource hostingEnvironmentEnvelope, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (hostingEnvironmentEnvelope == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter hostingEnvironmentEnvelope is required and cannot be null.")); - } else { - hostingEnvironmentEnvelope.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - hostingEnvironmentEnvelope, - accept, - context); - } - - /** - * Create or update an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param hostingEnvironmentEnvelope Configuration details of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return app Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync( - String resourceGroupName, String name, AppServiceEnvironmentPatchResource hostingEnvironmentEnvelope) { - return updateWithResponseAsync(resourceGroupName, name, hostingEnvironmentEnvelope) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Create or update an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param hostingEnvironmentEnvelope Configuration details of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return app Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AppServiceEnvironmentResourceInner update( - String resourceGroupName, String name, AppServiceEnvironmentPatchResource hostingEnvironmentEnvelope) { - return updateAsync(resourceGroupName, name, hostingEnvironmentEnvelope).block(); - } - - /** - * Create or update an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param hostingEnvironmentEnvelope Configuration details of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return app Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, - String name, - AppServiceEnvironmentPatchResource hostingEnvironmentEnvelope, - Context context) { - return updateWithResponseAsync(resourceGroupName, name, hostingEnvironmentEnvelope, context).block(); - } - - /** - * Get the used, available, and total worker capacity an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the used, available, and total worker capacity an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listCapacitiesSinglePageAsync( - String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listCapacities( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the used, available, and total worker capacity an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the used, available, and total worker capacity an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listCapacitiesSinglePageAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listCapacities( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the used, available, and total worker capacity an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the used, available, and total worker capacity an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listCapacitiesAsync(String resourceGroupName, String name) { - return new PagedFlux<>( - () -> listCapacitiesSinglePageAsync(resourceGroupName, name), - nextLink -> listCapacitiesNextSinglePageAsync(nextLink)); - } - - /** - * Get the used, available, and total worker capacity an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the used, available, and total worker capacity an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listCapacitiesAsync(String resourceGroupName, String name, Context context) { - return new PagedFlux<>( - () -> listCapacitiesSinglePageAsync(resourceGroupName, name, context), - nextLink -> listCapacitiesNextSinglePageAsync(nextLink, context)); - } - - /** - * Get the used, available, and total worker capacity an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the used, available, and total worker capacity an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listCapacities(String resourceGroupName, String name) { - return new PagedIterable<>(listCapacitiesAsync(resourceGroupName, name)); - } - - /** - * Get the used, available, and total worker capacity an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the used, available, and total worker capacity an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listCapacities(String resourceGroupName, String name, Context context) { - return new PagedIterable<>(listCapacitiesAsync(resourceGroupName, name, context)); - } - - /** - * Get IP addresses assigned to an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return iP addresses assigned to an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listVipsWithResponseAsync(String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listVips( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get IP addresses assigned to an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return iP addresses assigned to an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listVipsWithResponseAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listVips( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Get IP addresses assigned to an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return iP addresses assigned to an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listVipsAsync(String resourceGroupName, String name) { - return listVipsWithResponseAsync(resourceGroupName, name) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get IP addresses assigned to an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return iP addresses assigned to an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AddressResponseInner listVips(String resourceGroupName, String name) { - return listVipsAsync(resourceGroupName, name).block(); - } - - /** - * Get IP addresses assigned to an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return iP addresses assigned to an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listVipsWithResponse(String resourceGroupName, String name, Context context) { - return listVipsWithResponseAsync(resourceGroupName, name, context).block(); - } - - /** - * Move an App Service Environment to a different VNET. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param vnetInfo Details for the new virtual network. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> changeVnetSinglePageAsync( - String resourceGroupName, String name, VirtualNetworkProfile vnetInfo) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (vnetInfo == null) { - return Mono.error(new IllegalArgumentException("Parameter vnetInfo is required and cannot be null.")); - } else { - vnetInfo.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> { - Mono>> mono = - service - .changeVnet( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - vnetInfo, - accept, - context) - .cache(); - return Mono - .zip( - mono, - this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - WebAppCollection.class, - WebAppCollection.class, - Context.NONE) - .last() - .flatMap(this.client::getLroFinalResultOrError)); - }) - .>map( - res -> - new PagedResponseBase<>( - res.getT1().getRequest(), - res.getT1().getStatusCode(), - res.getT1().getHeaders(), - res.getT2().value(), - res.getT2().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Move an App Service Environment to a different VNET. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param vnetInfo Details for the new virtual network. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> changeVnetSinglePageAsync( - String resourceGroupName, String name, VirtualNetworkProfile vnetInfo, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (vnetInfo == null) { - return Mono.error(new IllegalArgumentException("Parameter vnetInfo is required and cannot be null.")); - } else { - vnetInfo.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - Mono>> mono = - service - .changeVnet( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - vnetInfo, - accept, - context) - .cache(); - return Mono - .zip( - mono, - this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), WebAppCollection.class, WebAppCollection.class, context) - .last() - .flatMap(this.client::getLroFinalResultOrError)) - .map( - res -> - new PagedResponseBase<>( - res.getT1().getRequest(), - res.getT1().getStatusCode(), - res.getT1().getHeaders(), - res.getT2().value(), - res.getT2().nextLink(), - null)); - } - - /** - * Move an App Service Environment to a different VNET. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param vnetInfo Details for the new virtual network. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux changeVnetAsync(String resourceGroupName, String name, VirtualNetworkProfile vnetInfo) { - return new PagedFlux<>( - () -> changeVnetSinglePageAsync(resourceGroupName, name, vnetInfo), - nextLink -> changeVnetNextSinglePageAsync(nextLink)); - } - - /** - * Move an App Service Environment to a different VNET. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param vnetInfo Details for the new virtual network. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux changeVnetAsync( - String resourceGroupName, String name, VirtualNetworkProfile vnetInfo, Context context) { - return new PagedFlux<>( - () -> changeVnetSinglePageAsync(resourceGroupName, name, vnetInfo, context), - nextLink -> changeVnetNextSinglePageAsync(nextLink, context)); - } - - /** - * Move an App Service Environment to a different VNET. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param vnetInfo Details for the new virtual network. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable changeVnet(String resourceGroupName, String name, VirtualNetworkProfile vnetInfo) { - return new PagedIterable<>(changeVnetAsync(resourceGroupName, name, vnetInfo)); - } - - /** - * Move an App Service Environment to a different VNET. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param vnetInfo Details for the new virtual network. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable changeVnet( - String resourceGroupName, String name, VirtualNetworkProfile vnetInfo, Context context) { - return new PagedIterable<>(changeVnetAsync(resourceGroupName, name, vnetInfo, context)); - } - - /** - * Get diagnostic information for an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return diagnostic information for an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> listDiagnosticsWithResponseAsync( - String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listDiagnostics( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get diagnostic information for an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return diagnostic information for an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> listDiagnosticsWithResponseAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listDiagnostics( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Get diagnostic information for an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return diagnostic information for an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listDiagnosticsAsync(String resourceGroupName, String name) { - return listDiagnosticsWithResponseAsync(resourceGroupName, name) - .flatMap( - (Response> res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get diagnostic information for an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return diagnostic information for an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public List listDiagnostics(String resourceGroupName, String name) { - return listDiagnosticsAsync(resourceGroupName, name).block(); - } - - /** - * Get diagnostic information for an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return diagnostic information for an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response> listDiagnosticsWithResponse( - String resourceGroupName, String name, Context context) { - return listDiagnosticsWithResponseAsync(resourceGroupName, name, context).block(); - } - - /** - * Get a diagnostics item for an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param diagnosticsName Name of the diagnostics item. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a diagnostics item for an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getDiagnosticsItemWithResponseAsync( - String resourceGroupName, String name, String diagnosticsName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (diagnosticsName == null) { - return Mono - .error(new IllegalArgumentException("Parameter diagnosticsName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getDiagnosticsItem( - this.client.getEndpoint(), - resourceGroupName, - name, - diagnosticsName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a diagnostics item for an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param diagnosticsName Name of the diagnostics item. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a diagnostics item for an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getDiagnosticsItemWithResponseAsync( - String resourceGroupName, String name, String diagnosticsName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (diagnosticsName == null) { - return Mono - .error(new IllegalArgumentException("Parameter diagnosticsName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getDiagnosticsItem( - this.client.getEndpoint(), - resourceGroupName, - name, - diagnosticsName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Get a diagnostics item for an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param diagnosticsName Name of the diagnostics item. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a diagnostics item for an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getDiagnosticsItemAsync( - String resourceGroupName, String name, String diagnosticsName) { - return getDiagnosticsItemWithResponseAsync(resourceGroupName, name, diagnosticsName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get a diagnostics item for an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param diagnosticsName Name of the diagnostics item. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a diagnostics item for an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public HostingEnvironmentDiagnosticsInner getDiagnosticsItem( - String resourceGroupName, String name, String diagnosticsName) { - return getDiagnosticsItemAsync(resourceGroupName, name, diagnosticsName).block(); - } - - /** - * Get a diagnostics item for an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param diagnosticsName Name of the diagnostics item. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a diagnostics item for an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getDiagnosticsItemWithResponse( - String resourceGroupName, String name, String diagnosticsName, Context context) { - return getDiagnosticsItemWithResponseAsync(resourceGroupName, name, diagnosticsName, context).block(); - } - - /** - * Get the network endpoints of all inbound dependencies of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the network endpoints of all inbound dependencies of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getInboundNetworkDependenciesEndpointsSinglePageAsync( - String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getInboundNetworkDependenciesEndpoints( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the network endpoints of all inbound dependencies of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the network endpoints of all inbound dependencies of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getInboundNetworkDependenciesEndpointsSinglePageAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getInboundNetworkDependenciesEndpoints( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the network endpoints of all inbound dependencies of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the network endpoints of all inbound dependencies of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux getInboundNetworkDependenciesEndpointsAsync( - String resourceGroupName, String name) { - return new PagedFlux<>( - () -> getInboundNetworkDependenciesEndpointsSinglePageAsync(resourceGroupName, name), - nextLink -> getInboundNetworkDependenciesEndpointsNextSinglePageAsync(nextLink)); - } - - /** - * Get the network endpoints of all inbound dependencies of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the network endpoints of all inbound dependencies of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux getInboundNetworkDependenciesEndpointsAsync( - String resourceGroupName, String name, Context context) { - return new PagedFlux<>( - () -> getInboundNetworkDependenciesEndpointsSinglePageAsync(resourceGroupName, name, context), - nextLink -> getInboundNetworkDependenciesEndpointsNextSinglePageAsync(nextLink, context)); - } - - /** - * Get the network endpoints of all inbound dependencies of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the network endpoints of all inbound dependencies of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable getInboundNetworkDependenciesEndpoints( - String resourceGroupName, String name) { - return new PagedIterable<>(getInboundNetworkDependenciesEndpointsAsync(resourceGroupName, name)); - } - - /** - * Get the network endpoints of all inbound dependencies of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the network endpoints of all inbound dependencies of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable getInboundNetworkDependenciesEndpoints( - String resourceGroupName, String name, Context context) { - return new PagedIterable<>(getInboundNetworkDependenciesEndpointsAsync(resourceGroupName, name, context)); - } - - /** - * Get global metric definitions of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return global metric definitions of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listMetricDefinitionsWithResponseAsync( - String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listMetricDefinitions( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get global metric definitions of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return global metric definitions of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listMetricDefinitionsWithResponseAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listMetricDefinitions( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Get global metric definitions of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return global metric definitions of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listMetricDefinitionsAsync(String resourceGroupName, String name) { - return listMetricDefinitionsWithResponseAsync(resourceGroupName, name) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get global metric definitions of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return global metric definitions of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public MetricDefinitionInner listMetricDefinitions(String resourceGroupName, String name) { - return listMetricDefinitionsAsync(resourceGroupName, name).block(); - } - - /** - * Get global metric definitions of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return global metric definitions of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listMetricDefinitionsWithResponse( - String resourceGroupName, String name, Context context) { - return listMetricDefinitionsWithResponseAsync(resourceGroupName, name, context).block(); - } - - /** - * Get global metrics of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param details Specify <code>true</code> to include instance details. The default is - * <code>false</code>. - * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: - * $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and - * endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return global metrics of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listMetricsSinglePageAsync( - String resourceGroupName, String name, Boolean details, String filter) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listMetrics( - this.client.getEndpoint(), - resourceGroupName, - name, - details, - filter, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get global metrics of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param details Specify <code>true</code> to include instance details. The default is - * <code>false</code>. - * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: - * $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and - * endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return global metrics of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listMetricsSinglePageAsync( - String resourceGroupName, String name, Boolean details, String filter, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listMetrics( - this.client.getEndpoint(), - resourceGroupName, - name, - details, - filter, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get global metrics of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param details Specify <code>true</code> to include instance details. The default is - * <code>false</code>. - * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: - * $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and - * endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return global metrics of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listMetricsAsync( - String resourceGroupName, String name, Boolean details, String filter) { - return new PagedFlux<>( - () -> listMetricsSinglePageAsync(resourceGroupName, name, details, filter), - nextLink -> listMetricsNextSinglePageAsync(nextLink)); - } - - /** - * Get global metrics of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return global metrics of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listMetricsAsync(String resourceGroupName, String name) { - final Boolean details = null; - final String filter = null; - return new PagedFlux<>( - () -> listMetricsSinglePageAsync(resourceGroupName, name, details, filter), - nextLink -> listMetricsNextSinglePageAsync(nextLink)); - } - - /** - * Get global metrics of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param details Specify <code>true</code> to include instance details. The default is - * <code>false</code>. - * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: - * $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and - * endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return global metrics of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listMetricsAsync( - String resourceGroupName, String name, Boolean details, String filter, Context context) { - return new PagedFlux<>( - () -> listMetricsSinglePageAsync(resourceGroupName, name, details, filter, context), - nextLink -> listMetricsNextSinglePageAsync(nextLink, context)); - } - - /** - * Get global metrics of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return global metrics of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listMetrics(String resourceGroupName, String name) { - final Boolean details = null; - final String filter = null; - return new PagedIterable<>(listMetricsAsync(resourceGroupName, name, details, filter)); - } - - /** - * Get global metrics of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param details Specify <code>true</code> to include instance details. The default is - * <code>false</code>. - * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: - * $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and - * endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return global metrics of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listMetrics( - String resourceGroupName, String name, Boolean details, String filter, Context context) { - return new PagedIterable<>(listMetricsAsync(resourceGroupName, name, details, filter, context)); - } - - /** - * Get all multi-role pools. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all multi-role pools. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listMultiRolePoolsSinglePageAsync( - String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listMultiRolePools( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get all multi-role pools. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all multi-role pools. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listMultiRolePoolsSinglePageAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listMultiRolePools( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get all multi-role pools. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all multi-role pools. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listMultiRolePoolsAsync(String resourceGroupName, String name) { - return new PagedFlux<>( - () -> listMultiRolePoolsSinglePageAsync(resourceGroupName, name), - nextLink -> listMultiRolePoolsNextSinglePageAsync(nextLink)); - } - - /** - * Get all multi-role pools. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all multi-role pools. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listMultiRolePoolsAsync( - String resourceGroupName, String name, Context context) { - return new PagedFlux<>( - () -> listMultiRolePoolsSinglePageAsync(resourceGroupName, name, context), - nextLink -> listMultiRolePoolsNextSinglePageAsync(nextLink, context)); - } - - /** - * Get all multi-role pools. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all multi-role pools. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listMultiRolePools(String resourceGroupName, String name) { - return new PagedIterable<>(listMultiRolePoolsAsync(resourceGroupName, name)); - } - - /** - * Get all multi-role pools. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all multi-role pools. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listMultiRolePools( - String resourceGroupName, String name, Context context) { - return new PagedIterable<>(listMultiRolePoolsAsync(resourceGroupName, name, context)); - } - - /** - * Get properties of a multi-role pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of a multi-role pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getMultiRolePoolWithResponseAsync( - String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getMultiRolePool( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get properties of a multi-role pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of a multi-role pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getMultiRolePoolWithResponseAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getMultiRolePool( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Get properties of a multi-role pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of a multi-role pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getMultiRolePoolAsync(String resourceGroupName, String name) { - return getMultiRolePoolWithResponseAsync(resourceGroupName, name) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get properties of a multi-role pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of a multi-role pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public WorkerPoolResourceInner getMultiRolePool(String resourceGroupName, String name) { - return getMultiRolePoolAsync(resourceGroupName, name).block(); - } - - /** - * Get properties of a multi-role pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of a multi-role pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getMultiRolePoolWithResponse( - String resourceGroupName, String name, Context context) { - return getMultiRolePoolWithResponseAsync(resourceGroupName, name, context).block(); - } - - /** - * Create or update a multi-role pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param multiRolePoolEnvelope Properties of the multi-role pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return worker pool of an App Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateMultiRolePoolWithResponseAsync( - String resourceGroupName, String name, WorkerPoolResourceInner multiRolePoolEnvelope) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (multiRolePoolEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter multiRolePoolEnvelope is required and cannot be null.")); - } else { - multiRolePoolEnvelope.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdateMultiRolePool( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - multiRolePoolEnvelope, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create or update a multi-role pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param multiRolePoolEnvelope Properties of the multi-role pool. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return worker pool of an App Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateMultiRolePoolWithResponseAsync( - String resourceGroupName, String name, WorkerPoolResourceInner multiRolePoolEnvelope, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (multiRolePoolEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter multiRolePoolEnvelope is required and cannot be null.")); - } else { - multiRolePoolEnvelope.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdateMultiRolePool( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - multiRolePoolEnvelope, - accept, - context); - } - - /** - * Create or update a multi-role pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param multiRolePoolEnvelope Properties of the multi-role pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return worker pool of an App Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, WorkerPoolResourceInner> - beginCreateOrUpdateMultiRolePoolAsync( - String resourceGroupName, String name, WorkerPoolResourceInner multiRolePoolEnvelope) { - Mono>> mono = - createOrUpdateMultiRolePoolWithResponseAsync(resourceGroupName, name, multiRolePoolEnvelope); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - WorkerPoolResourceInner.class, - WorkerPoolResourceInner.class, - Context.NONE); - } - - /** - * Create or update a multi-role pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param multiRolePoolEnvelope Properties of the multi-role pool. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return worker pool of an App Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, WorkerPoolResourceInner> - beginCreateOrUpdateMultiRolePoolAsync( - String resourceGroupName, String name, WorkerPoolResourceInner multiRolePoolEnvelope, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateMultiRolePoolWithResponseAsync(resourceGroupName, name, multiRolePoolEnvelope, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - WorkerPoolResourceInner.class, - WorkerPoolResourceInner.class, - context); - } - - /** - * Create or update a multi-role pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param multiRolePoolEnvelope Properties of the multi-role pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return worker pool of an App Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, WorkerPoolResourceInner> beginCreateOrUpdateMultiRolePool( - String resourceGroupName, String name, WorkerPoolResourceInner multiRolePoolEnvelope) { - return beginCreateOrUpdateMultiRolePoolAsync(resourceGroupName, name, multiRolePoolEnvelope).getSyncPoller(); - } - - /** - * Create or update a multi-role pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param multiRolePoolEnvelope Properties of the multi-role pool. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return worker pool of an App Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, WorkerPoolResourceInner> beginCreateOrUpdateMultiRolePool( - String resourceGroupName, String name, WorkerPoolResourceInner multiRolePoolEnvelope, Context context) { - return beginCreateOrUpdateMultiRolePoolAsync(resourceGroupName, name, multiRolePoolEnvelope, context) - .getSyncPoller(); - } - - /** - * Create or update a multi-role pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param multiRolePoolEnvelope Properties of the multi-role pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return worker pool of an App Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateMultiRolePoolAsync( - String resourceGroupName, String name, WorkerPoolResourceInner multiRolePoolEnvelope) { - return beginCreateOrUpdateMultiRolePoolAsync(resourceGroupName, name, multiRolePoolEnvelope) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create or update a multi-role pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param multiRolePoolEnvelope Properties of the multi-role pool. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return worker pool of an App Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateMultiRolePoolAsync( - String resourceGroupName, String name, WorkerPoolResourceInner multiRolePoolEnvelope, Context context) { - return beginCreateOrUpdateMultiRolePoolAsync(resourceGroupName, name, multiRolePoolEnvelope, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create or update a multi-role pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param multiRolePoolEnvelope Properties of the multi-role pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return worker pool of an App Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public WorkerPoolResourceInner createOrUpdateMultiRolePool( - String resourceGroupName, String name, WorkerPoolResourceInner multiRolePoolEnvelope) { - return createOrUpdateMultiRolePoolAsync(resourceGroupName, name, multiRolePoolEnvelope).block(); - } - - /** - * Create or update a multi-role pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param multiRolePoolEnvelope Properties of the multi-role pool. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return worker pool of an App Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public WorkerPoolResourceInner createOrUpdateMultiRolePool( - String resourceGroupName, String name, WorkerPoolResourceInner multiRolePoolEnvelope, Context context) { - return createOrUpdateMultiRolePoolAsync(resourceGroupName, name, multiRolePoolEnvelope, context).block(); - } - - /** - * Create or update a multi-role pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param multiRolePoolEnvelope Properties of the multi-role pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return worker pool of an App Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateMultiRolePoolWithResponseAsync( - String resourceGroupName, String name, WorkerPoolResourceInner multiRolePoolEnvelope) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (multiRolePoolEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter multiRolePoolEnvelope is required and cannot be null.")); - } else { - multiRolePoolEnvelope.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updateMultiRolePool( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - multiRolePoolEnvelope, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create or update a multi-role pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param multiRolePoolEnvelope Properties of the multi-role pool. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return worker pool of an App Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateMultiRolePoolWithResponseAsync( - String resourceGroupName, String name, WorkerPoolResourceInner multiRolePoolEnvelope, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (multiRolePoolEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter multiRolePoolEnvelope is required and cannot be null.")); - } else { - multiRolePoolEnvelope.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updateMultiRolePool( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - multiRolePoolEnvelope, - accept, - context); - } - - /** - * Create or update a multi-role pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param multiRolePoolEnvelope Properties of the multi-role pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return worker pool of an App Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateMultiRolePoolAsync( - String resourceGroupName, String name, WorkerPoolResourceInner multiRolePoolEnvelope) { - return updateMultiRolePoolWithResponseAsync(resourceGroupName, name, multiRolePoolEnvelope) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Create or update a multi-role pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param multiRolePoolEnvelope Properties of the multi-role pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return worker pool of an App Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public WorkerPoolResourceInner updateMultiRolePool( - String resourceGroupName, String name, WorkerPoolResourceInner multiRolePoolEnvelope) { - return updateMultiRolePoolAsync(resourceGroupName, name, multiRolePoolEnvelope).block(); - } - - /** - * Create or update a multi-role pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param multiRolePoolEnvelope Properties of the multi-role pool. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return worker pool of an App Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateMultiRolePoolWithResponse( - String resourceGroupName, String name, WorkerPoolResourceInner multiRolePoolEnvelope, Context context) { - return updateMultiRolePoolWithResponseAsync(resourceGroupName, name, multiRolePoolEnvelope, context).block(); - } - - /** - * Get metric definitions for a specific instance of a multi-role pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param instance Name of the instance in the multi-role pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metric definitions for a specific instance of a multi-role pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listMultiRolePoolInstanceMetricDefinitionsSinglePageAsync( - String resourceGroupName, String name, String instance) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (instance == null) { - return Mono.error(new IllegalArgumentException("Parameter instance is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listMultiRolePoolInstanceMetricDefinitions( - this.client.getEndpoint(), - resourceGroupName, - name, - instance, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get metric definitions for a specific instance of a multi-role pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param instance Name of the instance in the multi-role pool. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metric definitions for a specific instance of a multi-role pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listMultiRolePoolInstanceMetricDefinitionsSinglePageAsync( - String resourceGroupName, String name, String instance, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (instance == null) { - return Mono.error(new IllegalArgumentException("Parameter instance is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listMultiRolePoolInstanceMetricDefinitions( - this.client.getEndpoint(), - resourceGroupName, - name, - instance, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get metric definitions for a specific instance of a multi-role pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param instance Name of the instance in the multi-role pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metric definitions for a specific instance of a multi-role pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listMultiRolePoolInstanceMetricDefinitionsAsync( - String resourceGroupName, String name, String instance) { - return new PagedFlux<>( - () -> listMultiRolePoolInstanceMetricDefinitionsSinglePageAsync(resourceGroupName, name, instance), - nextLink -> listMultiRolePoolInstanceMetricDefinitionsNextSinglePageAsync(nextLink)); - } - - /** - * Get metric definitions for a specific instance of a multi-role pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param instance Name of the instance in the multi-role pool. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metric definitions for a specific instance of a multi-role pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listMultiRolePoolInstanceMetricDefinitionsAsync( - String resourceGroupName, String name, String instance, Context context) { - return new PagedFlux<>( - () -> listMultiRolePoolInstanceMetricDefinitionsSinglePageAsync(resourceGroupName, name, instance, context), - nextLink -> listMultiRolePoolInstanceMetricDefinitionsNextSinglePageAsync(nextLink, context)); - } - - /** - * Get metric definitions for a specific instance of a multi-role pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param instance Name of the instance in the multi-role pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metric definitions for a specific instance of a multi-role pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listMultiRolePoolInstanceMetricDefinitions( - String resourceGroupName, String name, String instance) { - return new PagedIterable<>(listMultiRolePoolInstanceMetricDefinitionsAsync(resourceGroupName, name, instance)); - } - - /** - * Get metric definitions for a specific instance of a multi-role pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param instance Name of the instance in the multi-role pool. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metric definitions for a specific instance of a multi-role pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listMultiRolePoolInstanceMetricDefinitions( - String resourceGroupName, String name, String instance, Context context) { - return new PagedIterable<>( - listMultiRolePoolInstanceMetricDefinitionsAsync(resourceGroupName, name, instance, context)); - } - - /** - * Get metrics for a specific instance of a multi-role pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param instance Name of the instance in the multi-role pool. - * @param details Specify <code>true</code> to include instance details. The default is - * <code>false</code>. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metrics for a specific instance of a multi-role pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listMultiRolePoolInstanceMetricsSinglePageAsync( - String resourceGroupName, String name, String instance, Boolean details) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (instance == null) { - return Mono.error(new IllegalArgumentException("Parameter instance is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listMultiRolePoolInstanceMetrics( - this.client.getEndpoint(), - resourceGroupName, - name, - instance, - details, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get metrics for a specific instance of a multi-role pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param instance Name of the instance in the multi-role pool. - * @param details Specify <code>true</code> to include instance details. The default is - * <code>false</code>. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metrics for a specific instance of a multi-role pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listMultiRolePoolInstanceMetricsSinglePageAsync( - String resourceGroupName, String name, String instance, Boolean details, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (instance == null) { - return Mono.error(new IllegalArgumentException("Parameter instance is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listMultiRolePoolInstanceMetrics( - this.client.getEndpoint(), - resourceGroupName, - name, - instance, - details, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get metrics for a specific instance of a multi-role pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param instance Name of the instance in the multi-role pool. - * @param details Specify <code>true</code> to include instance details. The default is - * <code>false</code>. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metrics for a specific instance of a multi-role pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listMultiRolePoolInstanceMetricsAsync( - String resourceGroupName, String name, String instance, Boolean details) { - return new PagedFlux<>( - () -> listMultiRolePoolInstanceMetricsSinglePageAsync(resourceGroupName, name, instance, details), - nextLink -> listMultiRolePoolInstanceMetricsNextSinglePageAsync(nextLink)); - } - - /** - * Get metrics for a specific instance of a multi-role pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param instance Name of the instance in the multi-role pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metrics for a specific instance of a multi-role pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listMultiRolePoolInstanceMetricsAsync( - String resourceGroupName, String name, String instance) { - final Boolean details = null; - return new PagedFlux<>( - () -> listMultiRolePoolInstanceMetricsSinglePageAsync(resourceGroupName, name, instance, details), - nextLink -> listMultiRolePoolInstanceMetricsNextSinglePageAsync(nextLink)); - } - - /** - * Get metrics for a specific instance of a multi-role pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param instance Name of the instance in the multi-role pool. - * @param details Specify <code>true</code> to include instance details. The default is - * <code>false</code>. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metrics for a specific instance of a multi-role pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listMultiRolePoolInstanceMetricsAsync( - String resourceGroupName, String name, String instance, Boolean details, Context context) { - return new PagedFlux<>( - () -> listMultiRolePoolInstanceMetricsSinglePageAsync(resourceGroupName, name, instance, details, context), - nextLink -> listMultiRolePoolInstanceMetricsNextSinglePageAsync(nextLink, context)); - } - - /** - * Get metrics for a specific instance of a multi-role pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param instance Name of the instance in the multi-role pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metrics for a specific instance of a multi-role pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listMultiRolePoolInstanceMetrics( - String resourceGroupName, String name, String instance) { - final Boolean details = null; - return new PagedIterable<>(listMultiRolePoolInstanceMetricsAsync(resourceGroupName, name, instance, details)); - } - - /** - * Get metrics for a specific instance of a multi-role pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param instance Name of the instance in the multi-role pool. - * @param details Specify <code>true</code> to include instance details. The default is - * <code>false</code>. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metrics for a specific instance of a multi-role pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listMultiRolePoolInstanceMetrics( - String resourceGroupName, String name, String instance, Boolean details, Context context) { - return new PagedIterable<>( - listMultiRolePoolInstanceMetricsAsync(resourceGroupName, name, instance, details, context)); - } - - /** - * Get metric definitions for a multi-role pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metric definitions for a multi-role pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listMultiRoleMetricDefinitionsSinglePageAsync( - String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listMultiRoleMetricDefinitions( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get metric definitions for a multi-role pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metric definitions for a multi-role pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listMultiRoleMetricDefinitionsSinglePageAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listMultiRoleMetricDefinitions( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get metric definitions for a multi-role pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metric definitions for a multi-role pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listMultiRoleMetricDefinitionsAsync( - String resourceGroupName, String name) { - return new PagedFlux<>( - () -> listMultiRoleMetricDefinitionsSinglePageAsync(resourceGroupName, name), - nextLink -> listMultiRoleMetricDefinitionsNextSinglePageAsync(nextLink)); - } - - /** - * Get metric definitions for a multi-role pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metric definitions for a multi-role pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listMultiRoleMetricDefinitionsAsync( - String resourceGroupName, String name, Context context) { - return new PagedFlux<>( - () -> listMultiRoleMetricDefinitionsSinglePageAsync(resourceGroupName, name, context), - nextLink -> listMultiRoleMetricDefinitionsNextSinglePageAsync(nextLink, context)); - } - - /** - * Get metric definitions for a multi-role pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metric definitions for a multi-role pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listMultiRoleMetricDefinitions( - String resourceGroupName, String name) { - return new PagedIterable<>(listMultiRoleMetricDefinitionsAsync(resourceGroupName, name)); - } - - /** - * Get metric definitions for a multi-role pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metric definitions for a multi-role pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listMultiRoleMetricDefinitions( - String resourceGroupName, String name, Context context) { - return new PagedIterable<>(listMultiRoleMetricDefinitionsAsync(resourceGroupName, name, context)); - } - - /** - * Get metrics for a multi-role pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param startTime Beginning time of the metrics query. - * @param endTime End time of the metrics query. - * @param timeGrain Time granularity of the metrics query. - * @param details Specify <code>true</code> to include instance details. The default is - * <code>false</code>. - * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: - * $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and - * endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metrics for a multi-role pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listMultiRoleMetricsSinglePageAsync( - String resourceGroupName, - String name, - String startTime, - String endTime, - String timeGrain, - Boolean details, - String filter) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listMultiRoleMetrics( - this.client.getEndpoint(), - resourceGroupName, - name, - startTime, - endTime, - timeGrain, - details, - filter, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get metrics for a multi-role pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param startTime Beginning time of the metrics query. - * @param endTime End time of the metrics query. - * @param timeGrain Time granularity of the metrics query. - * @param details Specify <code>true</code> to include instance details. The default is - * <code>false</code>. - * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: - * $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and - * endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metrics for a multi-role pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listMultiRoleMetricsSinglePageAsync( - String resourceGroupName, - String name, - String startTime, - String endTime, - String timeGrain, - Boolean details, - String filter, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listMultiRoleMetrics( - this.client.getEndpoint(), - resourceGroupName, - name, - startTime, - endTime, - timeGrain, - details, - filter, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get metrics for a multi-role pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param startTime Beginning time of the metrics query. - * @param endTime End time of the metrics query. - * @param timeGrain Time granularity of the metrics query. - * @param details Specify <code>true</code> to include instance details. The default is - * <code>false</code>. - * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: - * $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and - * endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metrics for a multi-role pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listMultiRoleMetricsAsync( - String resourceGroupName, - String name, - String startTime, - String endTime, - String timeGrain, - Boolean details, - String filter) { - return new PagedFlux<>( - () -> - listMultiRoleMetricsSinglePageAsync( - resourceGroupName, name, startTime, endTime, timeGrain, details, filter), - nextLink -> listMultiRoleMetricsNextSinglePageAsync(nextLink)); - } - - /** - * Get metrics for a multi-role pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metrics for a multi-role pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listMultiRoleMetricsAsync(String resourceGroupName, String name) { - final String startTime = null; - final String endTime = null; - final String timeGrain = null; - final Boolean details = null; - final String filter = null; - return new PagedFlux<>( - () -> - listMultiRoleMetricsSinglePageAsync( - resourceGroupName, name, startTime, endTime, timeGrain, details, filter), - nextLink -> listMultiRoleMetricsNextSinglePageAsync(nextLink)); - } - - /** - * Get metrics for a multi-role pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param startTime Beginning time of the metrics query. - * @param endTime End time of the metrics query. - * @param timeGrain Time granularity of the metrics query. - * @param details Specify <code>true</code> to include instance details. The default is - * <code>false</code>. - * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: - * $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and - * endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metrics for a multi-role pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listMultiRoleMetricsAsync( - String resourceGroupName, - String name, - String startTime, - String endTime, - String timeGrain, - Boolean details, - String filter, - Context context) { - return new PagedFlux<>( - () -> - listMultiRoleMetricsSinglePageAsync( - resourceGroupName, name, startTime, endTime, timeGrain, details, filter, context), - nextLink -> listMultiRoleMetricsNextSinglePageAsync(nextLink, context)); - } - - /** - * Get metrics for a multi-role pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metrics for a multi-role pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listMultiRoleMetrics(String resourceGroupName, String name) { - final String startTime = null; - final String endTime = null; - final String timeGrain = null; - final Boolean details = null; - final String filter = null; - return new PagedIterable<>( - listMultiRoleMetricsAsync(resourceGroupName, name, startTime, endTime, timeGrain, details, filter)); - } - - /** - * Get metrics for a multi-role pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param startTime Beginning time of the metrics query. - * @param endTime End time of the metrics query. - * @param timeGrain Time granularity of the metrics query. - * @param details Specify <code>true</code> to include instance details. The default is - * <code>false</code>. - * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: - * $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and - * endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metrics for a multi-role pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listMultiRoleMetrics( - String resourceGroupName, - String name, - String startTime, - String endTime, - String timeGrain, - Boolean details, - String filter, - Context context) { - return new PagedIterable<>( - listMultiRoleMetricsAsync( - resourceGroupName, name, startTime, endTime, timeGrain, details, filter, context)); - } - - /** - * Get available SKUs for scaling a multi-role pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return available SKUs for scaling a multi-role pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listMultiRolePoolSkusSinglePageAsync( - String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listMultiRolePoolSkus( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get available SKUs for scaling a multi-role pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return available SKUs for scaling a multi-role pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listMultiRolePoolSkusSinglePageAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listMultiRolePoolSkus( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get available SKUs for scaling a multi-role pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return available SKUs for scaling a multi-role pool. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listMultiRolePoolSkusAsync(String resourceGroupName, String name) { - return new PagedFlux<>( - () -> listMultiRolePoolSkusSinglePageAsync(resourceGroupName, name), - nextLink -> listMultiRolePoolSkusNextSinglePageAsync(nextLink)); - } - - /** - * Get available SKUs for scaling a multi-role pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return available SKUs for scaling a multi-role pool. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listMultiRolePoolSkusAsync(String resourceGroupName, String name, Context context) { - return new PagedFlux<>( - () -> listMultiRolePoolSkusSinglePageAsync(resourceGroupName, name, context), - nextLink -> listMultiRolePoolSkusNextSinglePageAsync(nextLink, context)); - } - - /** - * Get available SKUs for scaling a multi-role pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return available SKUs for scaling a multi-role pool. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listMultiRolePoolSkus(String resourceGroupName, String name) { - return new PagedIterable<>(listMultiRolePoolSkusAsync(resourceGroupName, name)); - } - - /** - * Get available SKUs for scaling a multi-role pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return available SKUs for scaling a multi-role pool. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listMultiRolePoolSkus(String resourceGroupName, String name, Context context) { - return new PagedIterable<>(listMultiRolePoolSkusAsync(resourceGroupName, name, context)); - } - - /** - * Get usage metrics for a multi-role pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return usage metrics for a multi-role pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listMultiRoleUsagesSinglePageAsync(String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listMultiRoleUsages( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get usage metrics for a multi-role pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return usage metrics for a multi-role pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listMultiRoleUsagesSinglePageAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listMultiRoleUsages( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get usage metrics for a multi-role pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return usage metrics for a multi-role pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listMultiRoleUsagesAsync(String resourceGroupName, String name) { - return new PagedFlux<>( - () -> listMultiRoleUsagesSinglePageAsync(resourceGroupName, name), - nextLink -> listMultiRoleUsagesNextSinglePageAsync(nextLink)); - } - - /** - * Get usage metrics for a multi-role pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return usage metrics for a multi-role pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listMultiRoleUsagesAsync(String resourceGroupName, String name, Context context) { - return new PagedFlux<>( - () -> listMultiRoleUsagesSinglePageAsync(resourceGroupName, name, context), - nextLink -> listMultiRoleUsagesNextSinglePageAsync(nextLink, context)); - } - - /** - * Get usage metrics for a multi-role pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return usage metrics for a multi-role pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listMultiRoleUsages(String resourceGroupName, String name) { - return new PagedIterable<>(listMultiRoleUsagesAsync(resourceGroupName, name)); - } - - /** - * Get usage metrics for a multi-role pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return usage metrics for a multi-role pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listMultiRoleUsages(String resourceGroupName, String name, Context context) { - return new PagedIterable<>(listMultiRoleUsagesAsync(resourceGroupName, name, context)); - } - - /** - * List all currently running operations on the App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of Operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> listOperationsWithResponseAsync(String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listOperations( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List all currently running operations on the App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of Operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> listOperationsWithResponseAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listOperations( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * List all currently running operations on the App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of Operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listOperationsAsync(String resourceGroupName, String name) { - return listOperationsWithResponseAsync(resourceGroupName, name) - .flatMap( - (Response> res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * List all currently running operations on the App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of Operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public List listOperations(String resourceGroupName, String name) { - return listOperationsAsync(resourceGroupName, name).block(); - } - - /** - * List all currently running operations on the App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of Operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response> listOperationsWithResponse( - String resourceGroupName, String name, Context context) { - return listOperationsWithResponseAsync(resourceGroupName, name, context).block(); - } - - /** - * Get the network endpoints of all outbound dependencies of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the network endpoints of all outbound dependencies of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - getOutboundNetworkDependenciesEndpointsSinglePageAsync(String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getOutboundNetworkDependenciesEndpoints( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the network endpoints of all outbound dependencies of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the network endpoints of all outbound dependencies of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - getOutboundNetworkDependenciesEndpointsSinglePageAsync(String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getOutboundNetworkDependenciesEndpoints( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the network endpoints of all outbound dependencies of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the network endpoints of all outbound dependencies of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux getOutboundNetworkDependenciesEndpointsAsync( - String resourceGroupName, String name) { - return new PagedFlux<>( - () -> getOutboundNetworkDependenciesEndpointsSinglePageAsync(resourceGroupName, name), - nextLink -> getOutboundNetworkDependenciesEndpointsNextSinglePageAsync(nextLink)); - } - - /** - * Get the network endpoints of all outbound dependencies of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the network endpoints of all outbound dependencies of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux getOutboundNetworkDependenciesEndpointsAsync( - String resourceGroupName, String name, Context context) { - return new PagedFlux<>( - () -> getOutboundNetworkDependenciesEndpointsSinglePageAsync(resourceGroupName, name, context), - nextLink -> getOutboundNetworkDependenciesEndpointsNextSinglePageAsync(nextLink, context)); - } - - /** - * Get the network endpoints of all outbound dependencies of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the network endpoints of all outbound dependencies of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable getOutboundNetworkDependenciesEndpoints( - String resourceGroupName, String name) { - return new PagedIterable<>(getOutboundNetworkDependenciesEndpointsAsync(resourceGroupName, name)); - } - - /** - * Get the network endpoints of all outbound dependencies of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the network endpoints of all outbound dependencies of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable getOutboundNetworkDependenciesEndpoints( - String resourceGroupName, String name, Context context) { - return new PagedIterable<>(getOutboundNetworkDependenciesEndpointsAsync(resourceGroupName, name, context)); - } - - /** - * Reboot all machines in an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> rebootWithResponseAsync(String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .reboot( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Reboot all machines in an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> rebootWithResponseAsync(String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .reboot( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Reboot all machines in an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono rebootAsync(String resourceGroupName, String name) { - return rebootWithResponseAsync(resourceGroupName, name).flatMap((Response res) -> Mono.empty()); - } - - /** - * Reboot all machines in an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void reboot(String resourceGroupName, String name) { - rebootAsync(resourceGroupName, name).block(); - } - - /** - * Reboot all machines in an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response rebootWithResponse(String resourceGroupName, String name, Context context) { - return rebootWithResponseAsync(resourceGroupName, name, context).block(); - } - - /** - * Resume an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> resumeSinglePageAsync(String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> { - Mono>> mono = - service - .resume( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .cache(); - return Mono - .zip( - mono, - this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - WebAppCollection.class, - WebAppCollection.class, - Context.NONE) - .last() - .flatMap(this.client::getLroFinalResultOrError)); - }) - .>map( - res -> - new PagedResponseBase<>( - res.getT1().getRequest(), - res.getT1().getStatusCode(), - res.getT1().getHeaders(), - res.getT2().value(), - res.getT2().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Resume an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> resumeSinglePageAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - Mono>> mono = - service - .resume( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .cache(); - return Mono - .zip( - mono, - this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), WebAppCollection.class, WebAppCollection.class, context) - .last() - .flatMap(this.client::getLroFinalResultOrError)) - .map( - res -> - new PagedResponseBase<>( - res.getT1().getRequest(), - res.getT1().getStatusCode(), - res.getT1().getHeaders(), - res.getT2().value(), - res.getT2().nextLink(), - null)); - } - - /** - * Resume an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux resumeAsync(String resourceGroupName, String name) { - return new PagedFlux<>( - () -> resumeSinglePageAsync(resourceGroupName, name), nextLink -> resumeNextSinglePageAsync(nextLink)); - } - - /** - * Resume an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux resumeAsync(String resourceGroupName, String name, Context context) { - return new PagedFlux<>( - () -> resumeSinglePageAsync(resourceGroupName, name, context), - nextLink -> resumeNextSinglePageAsync(nextLink, context)); - } - - /** - * Resume an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable resume(String resourceGroupName, String name) { - return new PagedIterable<>(resumeAsync(resourceGroupName, name)); - } - - /** - * Resume an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable resume(String resourceGroupName, String name, Context context) { - return new PagedIterable<>(resumeAsync(resourceGroupName, name, context)); - } - - /** - * Get all App Service plans in an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all App Service plans in an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAppServicePlansSinglePageAsync( - String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listAppServicePlans( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get all App Service plans in an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all App Service plans in an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAppServicePlansSinglePageAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listAppServicePlans( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get all App Service plans in an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all App Service plans in an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAppServicePlansAsync(String resourceGroupName, String name) { - return new PagedFlux<>( - () -> listAppServicePlansSinglePageAsync(resourceGroupName, name), - nextLink -> listAppServicePlansNextSinglePageAsync(nextLink)); - } - - /** - * Get all App Service plans in an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all App Service plans in an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAppServicePlansAsync( - String resourceGroupName, String name, Context context) { - return new PagedFlux<>( - () -> listAppServicePlansSinglePageAsync(resourceGroupName, name, context), - nextLink -> listAppServicePlansNextSinglePageAsync(nextLink, context)); - } - - /** - * Get all App Service plans in an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all App Service plans in an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAppServicePlans(String resourceGroupName, String name) { - return new PagedIterable<>(listAppServicePlansAsync(resourceGroupName, name)); - } - - /** - * Get all App Service plans in an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all App Service plans in an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAppServicePlans( - String resourceGroupName, String name, Context context) { - return new PagedIterable<>(listAppServicePlansAsync(resourceGroupName, name, context)); - } - - /** - * Get all apps in an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param propertiesToInclude Comma separated list of app properties to include. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all apps in an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWebAppsSinglePageAsync( - String resourceGroupName, String name, String propertiesToInclude) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listWebApps( - this.client.getEndpoint(), - resourceGroupName, - name, - propertiesToInclude, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get all apps in an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param propertiesToInclude Comma separated list of app properties to include. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all apps in an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWebAppsSinglePageAsync( - String resourceGroupName, String name, String propertiesToInclude, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listWebApps( - this.client.getEndpoint(), - resourceGroupName, - name, - propertiesToInclude, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get all apps in an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param propertiesToInclude Comma separated list of app properties to include. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all apps in an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listWebAppsAsync(String resourceGroupName, String name, String propertiesToInclude) { - return new PagedFlux<>( - () -> listWebAppsSinglePageAsync(resourceGroupName, name, propertiesToInclude), - nextLink -> listWebAppsNextSinglePageAsync(nextLink)); - } - - /** - * Get all apps in an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all apps in an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listWebAppsAsync(String resourceGroupName, String name) { - final String propertiesToInclude = null; - return new PagedFlux<>( - () -> listWebAppsSinglePageAsync(resourceGroupName, name, propertiesToInclude), - nextLink -> listWebAppsNextSinglePageAsync(nextLink)); - } - - /** - * Get all apps in an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param propertiesToInclude Comma separated list of app properties to include. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all apps in an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listWebAppsAsync( - String resourceGroupName, String name, String propertiesToInclude, Context context) { - return new PagedFlux<>( - () -> listWebAppsSinglePageAsync(resourceGroupName, name, propertiesToInclude, context), - nextLink -> listWebAppsNextSinglePageAsync(nextLink, context)); - } - - /** - * Get all apps in an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all apps in an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listWebApps(String resourceGroupName, String name) { - final String propertiesToInclude = null; - return new PagedIterable<>(listWebAppsAsync(resourceGroupName, name, propertiesToInclude)); - } - - /** - * Get all apps in an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param propertiesToInclude Comma separated list of app properties to include. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all apps in an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listWebApps( - String resourceGroupName, String name, String propertiesToInclude, Context context) { - return new PagedIterable<>(listWebAppsAsync(resourceGroupName, name, propertiesToInclude, context)); - } - - /** - * Suspend an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> suspendSinglePageAsync(String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> { - Mono>> mono = - service - .suspend( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .cache(); - return Mono - .zip( - mono, - this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - WebAppCollection.class, - WebAppCollection.class, - Context.NONE) - .last() - .flatMap(this.client::getLroFinalResultOrError)); - }) - .>map( - res -> - new PagedResponseBase<>( - res.getT1().getRequest(), - res.getT1().getStatusCode(), - res.getT1().getHeaders(), - res.getT2().value(), - res.getT2().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Suspend an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> suspendSinglePageAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - Mono>> mono = - service - .suspend( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .cache(); - return Mono - .zip( - mono, - this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), WebAppCollection.class, WebAppCollection.class, context) - .last() - .flatMap(this.client::getLroFinalResultOrError)) - .map( - res -> - new PagedResponseBase<>( - res.getT1().getRequest(), - res.getT1().getStatusCode(), - res.getT1().getHeaders(), - res.getT2().value(), - res.getT2().nextLink(), - null)); - } - - /** - * Suspend an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux suspendAsync(String resourceGroupName, String name) { - return new PagedFlux<>( - () -> suspendSinglePageAsync(resourceGroupName, name), nextLink -> suspendNextSinglePageAsync(nextLink)); - } - - /** - * Suspend an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux suspendAsync(String resourceGroupName, String name, Context context) { - return new PagedFlux<>( - () -> suspendSinglePageAsync(resourceGroupName, name, context), - nextLink -> suspendNextSinglePageAsync(nextLink, context)); - } - - /** - * Suspend an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable suspend(String resourceGroupName, String name) { - return new PagedIterable<>(suspendAsync(resourceGroupName, name)); - } - - /** - * Suspend an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable suspend(String resourceGroupName, String name, Context context) { - return new PagedIterable<>(suspendAsync(resourceGroupName, name, context)); - } - - /** - * Get global usage metrics of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: - * $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and - * endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return global usage metrics of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listUsagesSinglePageAsync( - String resourceGroupName, String name, String filter) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listUsages( - this.client.getEndpoint(), - resourceGroupName, - name, - filter, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get global usage metrics of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: - * $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and - * endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return global usage metrics of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listUsagesSinglePageAsync( - String resourceGroupName, String name, String filter, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listUsages( - this.client.getEndpoint(), - resourceGroupName, - name, - filter, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get global usage metrics of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: - * $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and - * endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return global usage metrics of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listUsagesAsync(String resourceGroupName, String name, String filter) { - return new PagedFlux<>( - () -> listUsagesSinglePageAsync(resourceGroupName, name, filter), - nextLink -> listUsagesNextSinglePageAsync(nextLink)); - } - - /** - * Get global usage metrics of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return global usage metrics of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listUsagesAsync(String resourceGroupName, String name) { - final String filter = null; - return new PagedFlux<>( - () -> listUsagesSinglePageAsync(resourceGroupName, name, filter), - nextLink -> listUsagesNextSinglePageAsync(nextLink)); - } - - /** - * Get global usage metrics of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: - * $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and - * endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return global usage metrics of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listUsagesAsync( - String resourceGroupName, String name, String filter, Context context) { - return new PagedFlux<>( - () -> listUsagesSinglePageAsync(resourceGroupName, name, filter, context), - nextLink -> listUsagesNextSinglePageAsync(nextLink, context)); - } - - /** - * Get global usage metrics of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return global usage metrics of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listUsages(String resourceGroupName, String name) { - final String filter = null; - return new PagedIterable<>(listUsagesAsync(resourceGroupName, name, filter)); - } - - /** - * Get global usage metrics of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: - * $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and - * endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return global usage metrics of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listUsages( - String resourceGroupName, String name, String filter, Context context) { - return new PagedIterable<>(listUsagesAsync(resourceGroupName, name, filter, context)); - } - - /** - * Get all worker pools of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all worker pools of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWorkerPoolsSinglePageAsync( - String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listWorkerPools( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get all worker pools of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all worker pools of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWorkerPoolsSinglePageAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listWorkerPools( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get all worker pools of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all worker pools of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listWorkerPoolsAsync(String resourceGroupName, String name) { - return new PagedFlux<>( - () -> listWorkerPoolsSinglePageAsync(resourceGroupName, name), - nextLink -> listWorkerPoolsNextSinglePageAsync(nextLink)); - } - - /** - * Get all worker pools of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all worker pools of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listWorkerPoolsAsync( - String resourceGroupName, String name, Context context) { - return new PagedFlux<>( - () -> listWorkerPoolsSinglePageAsync(resourceGroupName, name, context), - nextLink -> listWorkerPoolsNextSinglePageAsync(nextLink, context)); - } - - /** - * Get all worker pools of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all worker pools of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listWorkerPools(String resourceGroupName, String name) { - return new PagedIterable<>(listWorkerPoolsAsync(resourceGroupName, name)); - } - - /** - * Get all worker pools of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all worker pools of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listWorkerPools( - String resourceGroupName, String name, Context context) { - return new PagedIterable<>(listWorkerPoolsAsync(resourceGroupName, name, context)); - } - - /** - * Get properties of a worker pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of a worker pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWorkerPoolWithResponseAsync( - String resourceGroupName, String name, String workerPoolName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (workerPoolName == null) { - return Mono.error(new IllegalArgumentException("Parameter workerPoolName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getWorkerPool( - this.client.getEndpoint(), - resourceGroupName, - name, - workerPoolName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get properties of a worker pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of a worker pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWorkerPoolWithResponseAsync( - String resourceGroupName, String name, String workerPoolName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (workerPoolName == null) { - return Mono.error(new IllegalArgumentException("Parameter workerPoolName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getWorkerPool( - this.client.getEndpoint(), - resourceGroupName, - name, - workerPoolName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Get properties of a worker pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of a worker pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getWorkerPoolAsync( - String resourceGroupName, String name, String workerPoolName) { - return getWorkerPoolWithResponseAsync(resourceGroupName, name, workerPoolName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get properties of a worker pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of a worker pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public WorkerPoolResourceInner getWorkerPool(String resourceGroupName, String name, String workerPoolName) { - return getWorkerPoolAsync(resourceGroupName, name, workerPoolName).block(); - } - - /** - * Get properties of a worker pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of a worker pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWorkerPoolWithResponse( - String resourceGroupName, String name, String workerPoolName, Context context) { - return getWorkerPoolWithResponseAsync(resourceGroupName, name, workerPoolName, context).block(); - } - - /** - * Create or update a worker pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @param workerPoolEnvelope Properties of the worker pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return worker pool of an App Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWorkerPoolWithResponseAsync( - String resourceGroupName, String name, String workerPoolName, WorkerPoolResourceInner workerPoolEnvelope) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (workerPoolName == null) { - return Mono.error(new IllegalArgumentException("Parameter workerPoolName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (workerPoolEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter workerPoolEnvelope is required and cannot be null.")); - } else { - workerPoolEnvelope.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdateWorkerPool( - this.client.getEndpoint(), - resourceGroupName, - name, - workerPoolName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - workerPoolEnvelope, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create or update a worker pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @param workerPoolEnvelope Properties of the worker pool. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return worker pool of an App Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWorkerPoolWithResponseAsync( - String resourceGroupName, - String name, - String workerPoolName, - WorkerPoolResourceInner workerPoolEnvelope, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (workerPoolName == null) { - return Mono.error(new IllegalArgumentException("Parameter workerPoolName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (workerPoolEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter workerPoolEnvelope is required and cannot be null.")); - } else { - workerPoolEnvelope.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdateWorkerPool( - this.client.getEndpoint(), - resourceGroupName, - name, - workerPoolName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - workerPoolEnvelope, - accept, - context); - } - - /** - * Create or update a worker pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @param workerPoolEnvelope Properties of the worker pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return worker pool of an App Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, WorkerPoolResourceInner> beginCreateOrUpdateWorkerPoolAsync( - String resourceGroupName, String name, String workerPoolName, WorkerPoolResourceInner workerPoolEnvelope) { - Mono>> mono = - createOrUpdateWorkerPoolWithResponseAsync(resourceGroupName, name, workerPoolName, workerPoolEnvelope); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - WorkerPoolResourceInner.class, - WorkerPoolResourceInner.class, - Context.NONE); - } - - /** - * Create or update a worker pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @param workerPoolEnvelope Properties of the worker pool. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return worker pool of an App Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, WorkerPoolResourceInner> beginCreateOrUpdateWorkerPoolAsync( - String resourceGroupName, - String name, - String workerPoolName, - WorkerPoolResourceInner workerPoolEnvelope, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWorkerPoolWithResponseAsync( - resourceGroupName, name, workerPoolName, workerPoolEnvelope, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - WorkerPoolResourceInner.class, - WorkerPoolResourceInner.class, - context); - } - - /** - * Create or update a worker pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @param workerPoolEnvelope Properties of the worker pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return worker pool of an App Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, WorkerPoolResourceInner> beginCreateOrUpdateWorkerPool( - String resourceGroupName, String name, String workerPoolName, WorkerPoolResourceInner workerPoolEnvelope) { - return beginCreateOrUpdateWorkerPoolAsync(resourceGroupName, name, workerPoolName, workerPoolEnvelope) - .getSyncPoller(); - } - - /** - * Create or update a worker pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @param workerPoolEnvelope Properties of the worker pool. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return worker pool of an App Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, WorkerPoolResourceInner> beginCreateOrUpdateWorkerPool( - String resourceGroupName, - String name, - String workerPoolName, - WorkerPoolResourceInner workerPoolEnvelope, - Context context) { - return beginCreateOrUpdateWorkerPoolAsync(resourceGroupName, name, workerPoolName, workerPoolEnvelope, context) - .getSyncPoller(); - } - - /** - * Create or update a worker pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @param workerPoolEnvelope Properties of the worker pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return worker pool of an App Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateWorkerPoolAsync( - String resourceGroupName, String name, String workerPoolName, WorkerPoolResourceInner workerPoolEnvelope) { - return beginCreateOrUpdateWorkerPoolAsync(resourceGroupName, name, workerPoolName, workerPoolEnvelope) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create or update a worker pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @param workerPoolEnvelope Properties of the worker pool. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return worker pool of an App Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateWorkerPoolAsync( - String resourceGroupName, - String name, - String workerPoolName, - WorkerPoolResourceInner workerPoolEnvelope, - Context context) { - return beginCreateOrUpdateWorkerPoolAsync(resourceGroupName, name, workerPoolName, workerPoolEnvelope, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create or update a worker pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @param workerPoolEnvelope Properties of the worker pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return worker pool of an App Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public WorkerPoolResourceInner createOrUpdateWorkerPool( - String resourceGroupName, String name, String workerPoolName, WorkerPoolResourceInner workerPoolEnvelope) { - return createOrUpdateWorkerPoolAsync(resourceGroupName, name, workerPoolName, workerPoolEnvelope).block(); - } - - /** - * Create or update a worker pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @param workerPoolEnvelope Properties of the worker pool. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return worker pool of an App Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public WorkerPoolResourceInner createOrUpdateWorkerPool( - String resourceGroupName, - String name, - String workerPoolName, - WorkerPoolResourceInner workerPoolEnvelope, - Context context) { - return createOrUpdateWorkerPoolAsync(resourceGroupName, name, workerPoolName, workerPoolEnvelope, context) - .block(); - } - - /** - * Create or update a worker pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @param workerPoolEnvelope Properties of the worker pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return worker pool of an App Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateWorkerPoolWithResponseAsync( - String resourceGroupName, String name, String workerPoolName, WorkerPoolResourceInner workerPoolEnvelope) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (workerPoolName == null) { - return Mono.error(new IllegalArgumentException("Parameter workerPoolName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (workerPoolEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter workerPoolEnvelope is required and cannot be null.")); - } else { - workerPoolEnvelope.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updateWorkerPool( - this.client.getEndpoint(), - resourceGroupName, - name, - workerPoolName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - workerPoolEnvelope, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create or update a worker pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @param workerPoolEnvelope Properties of the worker pool. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return worker pool of an App Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWorkerPoolWithResponseAsync( - String resourceGroupName, - String name, - String workerPoolName, - WorkerPoolResourceInner workerPoolEnvelope, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (workerPoolName == null) { - return Mono.error(new IllegalArgumentException("Parameter workerPoolName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (workerPoolEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter workerPoolEnvelope is required and cannot be null.")); - } else { - workerPoolEnvelope.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updateWorkerPool( - this.client.getEndpoint(), - resourceGroupName, - name, - workerPoolName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - workerPoolEnvelope, - accept, - context); - } - - /** - * Create or update a worker pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @param workerPoolEnvelope Properties of the worker pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return worker pool of an App Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateWorkerPoolAsync( - String resourceGroupName, String name, String workerPoolName, WorkerPoolResourceInner workerPoolEnvelope) { - return updateWorkerPoolWithResponseAsync(resourceGroupName, name, workerPoolName, workerPoolEnvelope) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Create or update a worker pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @param workerPoolEnvelope Properties of the worker pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return worker pool of an App Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public WorkerPoolResourceInner updateWorkerPool( - String resourceGroupName, String name, String workerPoolName, WorkerPoolResourceInner workerPoolEnvelope) { - return updateWorkerPoolAsync(resourceGroupName, name, workerPoolName, workerPoolEnvelope).block(); - } - - /** - * Create or update a worker pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @param workerPoolEnvelope Properties of the worker pool. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return worker pool of an App Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWorkerPoolWithResponse( - String resourceGroupName, - String name, - String workerPoolName, - WorkerPoolResourceInner workerPoolEnvelope, - Context context) { - return updateWorkerPoolWithResponseAsync(resourceGroupName, name, workerPoolName, workerPoolEnvelope, context) - .block(); - } - - /** - * Get metric definitions for a specific instance of a worker pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @param instance Name of the instance in the worker pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metric definitions for a specific instance of a worker pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWorkerPoolInstanceMetricDefinitionsSinglePageAsync( - String resourceGroupName, String name, String workerPoolName, String instance) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (workerPoolName == null) { - return Mono.error(new IllegalArgumentException("Parameter workerPoolName is required and cannot be null.")); - } - if (instance == null) { - return Mono.error(new IllegalArgumentException("Parameter instance is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listWorkerPoolInstanceMetricDefinitions( - this.client.getEndpoint(), - resourceGroupName, - name, - workerPoolName, - instance, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get metric definitions for a specific instance of a worker pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @param instance Name of the instance in the worker pool. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metric definitions for a specific instance of a worker pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWorkerPoolInstanceMetricDefinitionsSinglePageAsync( - String resourceGroupName, String name, String workerPoolName, String instance, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (workerPoolName == null) { - return Mono.error(new IllegalArgumentException("Parameter workerPoolName is required and cannot be null.")); - } - if (instance == null) { - return Mono.error(new IllegalArgumentException("Parameter instance is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listWorkerPoolInstanceMetricDefinitions( - this.client.getEndpoint(), - resourceGroupName, - name, - workerPoolName, - instance, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get metric definitions for a specific instance of a worker pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @param instance Name of the instance in the worker pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metric definitions for a specific instance of a worker pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listWorkerPoolInstanceMetricDefinitionsAsync( - String resourceGroupName, String name, String workerPoolName, String instance) { - return new PagedFlux<>( - () -> - listWorkerPoolInstanceMetricDefinitionsSinglePageAsync( - resourceGroupName, name, workerPoolName, instance), - nextLink -> listWorkerPoolInstanceMetricDefinitionsNextSinglePageAsync(nextLink)); - } - - /** - * Get metric definitions for a specific instance of a worker pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @param instance Name of the instance in the worker pool. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metric definitions for a specific instance of a worker pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listWorkerPoolInstanceMetricDefinitionsAsync( - String resourceGroupName, String name, String workerPoolName, String instance, Context context) { - return new PagedFlux<>( - () -> - listWorkerPoolInstanceMetricDefinitionsSinglePageAsync( - resourceGroupName, name, workerPoolName, instance, context), - nextLink -> listWorkerPoolInstanceMetricDefinitionsNextSinglePageAsync(nextLink, context)); - } - - /** - * Get metric definitions for a specific instance of a worker pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @param instance Name of the instance in the worker pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metric definitions for a specific instance of a worker pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listWorkerPoolInstanceMetricDefinitions( - String resourceGroupName, String name, String workerPoolName, String instance) { - return new PagedIterable<>( - listWorkerPoolInstanceMetricDefinitionsAsync(resourceGroupName, name, workerPoolName, instance)); - } - - /** - * Get metric definitions for a specific instance of a worker pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @param instance Name of the instance in the worker pool. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metric definitions for a specific instance of a worker pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listWorkerPoolInstanceMetricDefinitions( - String resourceGroupName, String name, String workerPoolName, String instance, Context context) { - return new PagedIterable<>( - listWorkerPoolInstanceMetricDefinitionsAsync(resourceGroupName, name, workerPoolName, instance, context)); - } - - /** - * Get metrics for a specific instance of a worker pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @param instance Name of the instance in the worker pool. - * @param details Specify <code>true</code> to include instance details. The default is - * <code>false</code>. - * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: - * $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and - * endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metrics for a specific instance of a worker pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWorkerPoolInstanceMetricsSinglePageAsync( - String resourceGroupName, String name, String workerPoolName, String instance, Boolean details, String filter) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (workerPoolName == null) { - return Mono.error(new IllegalArgumentException("Parameter workerPoolName is required and cannot be null.")); - } - if (instance == null) { - return Mono.error(new IllegalArgumentException("Parameter instance is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listWorkerPoolInstanceMetrics( - this.client.getEndpoint(), - resourceGroupName, - name, - workerPoolName, - instance, - details, - filter, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get metrics for a specific instance of a worker pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @param instance Name of the instance in the worker pool. - * @param details Specify <code>true</code> to include instance details. The default is - * <code>false</code>. - * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: - * $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and - * endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metrics for a specific instance of a worker pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWorkerPoolInstanceMetricsSinglePageAsync( - String resourceGroupName, - String name, - String workerPoolName, - String instance, - Boolean details, - String filter, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (workerPoolName == null) { - return Mono.error(new IllegalArgumentException("Parameter workerPoolName is required and cannot be null.")); - } - if (instance == null) { - return Mono.error(new IllegalArgumentException("Parameter instance is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listWorkerPoolInstanceMetrics( - this.client.getEndpoint(), - resourceGroupName, - name, - workerPoolName, - instance, - details, - filter, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get metrics for a specific instance of a worker pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @param instance Name of the instance in the worker pool. - * @param details Specify <code>true</code> to include instance details. The default is - * <code>false</code>. - * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: - * $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and - * endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metrics for a specific instance of a worker pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listWorkerPoolInstanceMetricsAsync( - String resourceGroupName, String name, String workerPoolName, String instance, Boolean details, String filter) { - return new PagedFlux<>( - () -> - listWorkerPoolInstanceMetricsSinglePageAsync( - resourceGroupName, name, workerPoolName, instance, details, filter), - nextLink -> listWorkerPoolInstanceMetricsNextSinglePageAsync(nextLink)); - } - - /** - * Get metrics for a specific instance of a worker pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @param instance Name of the instance in the worker pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metrics for a specific instance of a worker pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listWorkerPoolInstanceMetricsAsync( - String resourceGroupName, String name, String workerPoolName, String instance) { - final Boolean details = null; - final String filter = null; - return new PagedFlux<>( - () -> - listWorkerPoolInstanceMetricsSinglePageAsync( - resourceGroupName, name, workerPoolName, instance, details, filter), - nextLink -> listWorkerPoolInstanceMetricsNextSinglePageAsync(nextLink)); - } - - /** - * Get metrics for a specific instance of a worker pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @param instance Name of the instance in the worker pool. - * @param details Specify <code>true</code> to include instance details. The default is - * <code>false</code>. - * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: - * $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and - * endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metrics for a specific instance of a worker pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listWorkerPoolInstanceMetricsAsync( - String resourceGroupName, - String name, - String workerPoolName, - String instance, - Boolean details, - String filter, - Context context) { - return new PagedFlux<>( - () -> - listWorkerPoolInstanceMetricsSinglePageAsync( - resourceGroupName, name, workerPoolName, instance, details, filter, context), - nextLink -> listWorkerPoolInstanceMetricsNextSinglePageAsync(nextLink, context)); - } - - /** - * Get metrics for a specific instance of a worker pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @param instance Name of the instance in the worker pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metrics for a specific instance of a worker pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listWorkerPoolInstanceMetrics( - String resourceGroupName, String name, String workerPoolName, String instance) { - final Boolean details = null; - final String filter = null; - return new PagedIterable<>( - listWorkerPoolInstanceMetricsAsync(resourceGroupName, name, workerPoolName, instance, details, filter)); - } - - /** - * Get metrics for a specific instance of a worker pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @param instance Name of the instance in the worker pool. - * @param details Specify <code>true</code> to include instance details. The default is - * <code>false</code>. - * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: - * $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and - * endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metrics for a specific instance of a worker pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listWorkerPoolInstanceMetrics( - String resourceGroupName, - String name, - String workerPoolName, - String instance, - Boolean details, - String filter, - Context context) { - return new PagedIterable<>( - listWorkerPoolInstanceMetricsAsync( - resourceGroupName, name, workerPoolName, instance, details, filter, context)); - } - - /** - * Get metric definitions for a worker pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metric definitions for a worker pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWebWorkerMetricDefinitionsSinglePageAsync( - String resourceGroupName, String name, String workerPoolName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (workerPoolName == null) { - return Mono.error(new IllegalArgumentException("Parameter workerPoolName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listWebWorkerMetricDefinitions( - this.client.getEndpoint(), - resourceGroupName, - name, - workerPoolName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get metric definitions for a worker pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metric definitions for a worker pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWebWorkerMetricDefinitionsSinglePageAsync( - String resourceGroupName, String name, String workerPoolName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (workerPoolName == null) { - return Mono.error(new IllegalArgumentException("Parameter workerPoolName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listWebWorkerMetricDefinitions( - this.client.getEndpoint(), - resourceGroupName, - name, - workerPoolName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get metric definitions for a worker pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metric definitions for a worker pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listWebWorkerMetricDefinitionsAsync( - String resourceGroupName, String name, String workerPoolName) { - return new PagedFlux<>( - () -> listWebWorkerMetricDefinitionsSinglePageAsync(resourceGroupName, name, workerPoolName), - nextLink -> listWebWorkerMetricDefinitionsNextSinglePageAsync(nextLink)); - } - - /** - * Get metric definitions for a worker pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metric definitions for a worker pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listWebWorkerMetricDefinitionsAsync( - String resourceGroupName, String name, String workerPoolName, Context context) { - return new PagedFlux<>( - () -> listWebWorkerMetricDefinitionsSinglePageAsync(resourceGroupName, name, workerPoolName, context), - nextLink -> listWebWorkerMetricDefinitionsNextSinglePageAsync(nextLink, context)); - } - - /** - * Get metric definitions for a worker pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metric definitions for a worker pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listWebWorkerMetricDefinitions( - String resourceGroupName, String name, String workerPoolName) { - return new PagedIterable<>(listWebWorkerMetricDefinitionsAsync(resourceGroupName, name, workerPoolName)); - } - - /** - * Get metric definitions for a worker pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metric definitions for a worker pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listWebWorkerMetricDefinitions( - String resourceGroupName, String name, String workerPoolName, Context context) { - return new PagedIterable<>( - listWebWorkerMetricDefinitionsAsync(resourceGroupName, name, workerPoolName, context)); - } - - /** - * Get metrics for a worker pool of a AppServiceEnvironment (App Service Environment). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of worker pool. - * @param details Specify <code>true</code> to include instance details. The default is - * <code>false</code>. - * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: - * $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and - * endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metrics for a worker pool of a AppServiceEnvironment (App Service Environment). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWebWorkerMetricsSinglePageAsync( - String resourceGroupName, String name, String workerPoolName, Boolean details, String filter) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (workerPoolName == null) { - return Mono.error(new IllegalArgumentException("Parameter workerPoolName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listWebWorkerMetrics( - this.client.getEndpoint(), - resourceGroupName, - name, - workerPoolName, - details, - filter, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get metrics for a worker pool of a AppServiceEnvironment (App Service Environment). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of worker pool. - * @param details Specify <code>true</code> to include instance details. The default is - * <code>false</code>. - * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: - * $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and - * endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metrics for a worker pool of a AppServiceEnvironment (App Service Environment). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWebWorkerMetricsSinglePageAsync( - String resourceGroupName, String name, String workerPoolName, Boolean details, String filter, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (workerPoolName == null) { - return Mono.error(new IllegalArgumentException("Parameter workerPoolName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listWebWorkerMetrics( - this.client.getEndpoint(), - resourceGroupName, - name, - workerPoolName, - details, - filter, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get metrics for a worker pool of a AppServiceEnvironment (App Service Environment). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of worker pool. - * @param details Specify <code>true</code> to include instance details. The default is - * <code>false</code>. - * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: - * $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and - * endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metrics for a worker pool of a AppServiceEnvironment (App Service Environment). - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listWebWorkerMetricsAsync( - String resourceGroupName, String name, String workerPoolName, Boolean details, String filter) { - return new PagedFlux<>( - () -> listWebWorkerMetricsSinglePageAsync(resourceGroupName, name, workerPoolName, details, filter), - nextLink -> listWebWorkerMetricsNextSinglePageAsync(nextLink)); - } - - /** - * Get metrics for a worker pool of a AppServiceEnvironment (App Service Environment). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of worker pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metrics for a worker pool of a AppServiceEnvironment (App Service Environment). - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listWebWorkerMetricsAsync( - String resourceGroupName, String name, String workerPoolName) { - final Boolean details = null; - final String filter = null; - return new PagedFlux<>( - () -> listWebWorkerMetricsSinglePageAsync(resourceGroupName, name, workerPoolName, details, filter), - nextLink -> listWebWorkerMetricsNextSinglePageAsync(nextLink)); - } - - /** - * Get metrics for a worker pool of a AppServiceEnvironment (App Service Environment). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of worker pool. - * @param details Specify <code>true</code> to include instance details. The default is - * <code>false</code>. - * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: - * $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and - * endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metrics for a worker pool of a AppServiceEnvironment (App Service Environment). - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listWebWorkerMetricsAsync( - String resourceGroupName, String name, String workerPoolName, Boolean details, String filter, Context context) { - return new PagedFlux<>( - () -> - listWebWorkerMetricsSinglePageAsync(resourceGroupName, name, workerPoolName, details, filter, context), - nextLink -> listWebWorkerMetricsNextSinglePageAsync(nextLink, context)); - } - - /** - * Get metrics for a worker pool of a AppServiceEnvironment (App Service Environment). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of worker pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metrics for a worker pool of a AppServiceEnvironment (App Service Environment). - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listWebWorkerMetrics( - String resourceGroupName, String name, String workerPoolName) { - final Boolean details = null; - final String filter = null; - return new PagedIterable<>(listWebWorkerMetricsAsync(resourceGroupName, name, workerPoolName, details, filter)); - } - - /** - * Get metrics for a worker pool of a AppServiceEnvironment (App Service Environment). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of worker pool. - * @param details Specify <code>true</code> to include instance details. The default is - * <code>false</code>. - * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: - * $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and - * endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metrics for a worker pool of a AppServiceEnvironment (App Service Environment). - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listWebWorkerMetrics( - String resourceGroupName, String name, String workerPoolName, Boolean details, String filter, Context context) { - return new PagedIterable<>( - listWebWorkerMetricsAsync(resourceGroupName, name, workerPoolName, details, filter, context)); - } - - /** - * Get available SKUs for scaling a worker pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return available SKUs for scaling a worker pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWorkerPoolSkusSinglePageAsync( - String resourceGroupName, String name, String workerPoolName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (workerPoolName == null) { - return Mono.error(new IllegalArgumentException("Parameter workerPoolName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listWorkerPoolSkus( - this.client.getEndpoint(), - resourceGroupName, - name, - workerPoolName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get available SKUs for scaling a worker pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return available SKUs for scaling a worker pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWorkerPoolSkusSinglePageAsync( - String resourceGroupName, String name, String workerPoolName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (workerPoolName == null) { - return Mono.error(new IllegalArgumentException("Parameter workerPoolName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listWorkerPoolSkus( - this.client.getEndpoint(), - resourceGroupName, - name, - workerPoolName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get available SKUs for scaling a worker pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return available SKUs for scaling a worker pool. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listWorkerPoolSkusAsync( - String resourceGroupName, String name, String workerPoolName) { - return new PagedFlux<>( - () -> listWorkerPoolSkusSinglePageAsync(resourceGroupName, name, workerPoolName), - nextLink -> listWorkerPoolSkusNextSinglePageAsync(nextLink)); - } - - /** - * Get available SKUs for scaling a worker pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return available SKUs for scaling a worker pool. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listWorkerPoolSkusAsync( - String resourceGroupName, String name, String workerPoolName, Context context) { - return new PagedFlux<>( - () -> listWorkerPoolSkusSinglePageAsync(resourceGroupName, name, workerPoolName, context), - nextLink -> listWorkerPoolSkusNextSinglePageAsync(nextLink, context)); - } - - /** - * Get available SKUs for scaling a worker pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return available SKUs for scaling a worker pool. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listWorkerPoolSkus( - String resourceGroupName, String name, String workerPoolName) { - return new PagedIterable<>(listWorkerPoolSkusAsync(resourceGroupName, name, workerPoolName)); - } - - /** - * Get available SKUs for scaling a worker pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return available SKUs for scaling a worker pool. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listWorkerPoolSkus( - String resourceGroupName, String name, String workerPoolName, Context context) { - return new PagedIterable<>(listWorkerPoolSkusAsync(resourceGroupName, name, workerPoolName, context)); - } - - /** - * Get usage metrics for a worker pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return usage metrics for a worker pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWebWorkerUsagesSinglePageAsync( - String resourceGroupName, String name, String workerPoolName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (workerPoolName == null) { - return Mono.error(new IllegalArgumentException("Parameter workerPoolName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listWebWorkerUsages( - this.client.getEndpoint(), - resourceGroupName, - name, - workerPoolName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get usage metrics for a worker pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return usage metrics for a worker pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWebWorkerUsagesSinglePageAsync( - String resourceGroupName, String name, String workerPoolName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (workerPoolName == null) { - return Mono.error(new IllegalArgumentException("Parameter workerPoolName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listWebWorkerUsages( - this.client.getEndpoint(), - resourceGroupName, - name, - workerPoolName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get usage metrics for a worker pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return usage metrics for a worker pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listWebWorkerUsagesAsync( - String resourceGroupName, String name, String workerPoolName) { - return new PagedFlux<>( - () -> listWebWorkerUsagesSinglePageAsync(resourceGroupName, name, workerPoolName), - nextLink -> listWebWorkerUsagesNextSinglePageAsync(nextLink)); - } - - /** - * Get usage metrics for a worker pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return usage metrics for a worker pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listWebWorkerUsagesAsync( - String resourceGroupName, String name, String workerPoolName, Context context) { - return new PagedFlux<>( - () -> listWebWorkerUsagesSinglePageAsync(resourceGroupName, name, workerPoolName, context), - nextLink -> listWebWorkerUsagesNextSinglePageAsync(nextLink, context)); - } - - /** - * Get usage metrics for a worker pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return usage metrics for a worker pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listWebWorkerUsages(String resourceGroupName, String name, String workerPoolName) { - return new PagedIterable<>(listWebWorkerUsagesAsync(resourceGroupName, name, workerPoolName)); - } - - /** - * Get usage metrics for a worker pool of an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return usage metrics for a worker pool of an App Service Environment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listWebWorkerUsages( - String resourceGroupName, String name, String workerPoolName, Context context) { - return new PagedIterable<>(listWebWorkerUsagesAsync(resourceGroupName, name, workerPoolName, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service Environments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service Environments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service Environments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync( - String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service Environments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of stamp capacities. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listCapacitiesNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listCapacitiesNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of stamp capacities. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listCapacitiesNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listCapacitiesNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> changeVnetNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.changeVnetNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> changeVnetNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .changeVnetNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Inbound Environment Endpoints. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - getInboundNetworkDependenciesEndpointsNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getInboundNetworkDependenciesEndpointsNext( - nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Inbound Environment Endpoints. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - getInboundNetworkDependenciesEndpointsNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getInboundNetworkDependenciesEndpointsNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of metric responses. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listMetricsNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listMetricsNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of metric responses. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listMetricsNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listMetricsNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of worker pools. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listMultiRolePoolsNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listMultiRolePoolsNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of worker pools. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listMultiRolePoolsNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listMultiRolePoolsNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of metric definitions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listMultiRolePoolInstanceMetricDefinitionsNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listMultiRolePoolInstanceMetricDefinitionsNext( - nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of metric definitions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listMultiRolePoolInstanceMetricDefinitionsNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listMultiRolePoolInstanceMetricDefinitionsNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of metric responses. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listMultiRolePoolInstanceMetricsNextSinglePageAsync( - String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service.listMultiRolePoolInstanceMetricsNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of metric responses. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listMultiRolePoolInstanceMetricsNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listMultiRolePoolInstanceMetricsNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of metric definitions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listMultiRoleMetricDefinitionsNextSinglePageAsync( - String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service.listMultiRoleMetricDefinitionsNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of metric definitions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listMultiRoleMetricDefinitionsNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listMultiRoleMetricDefinitionsNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of metric responses. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listMultiRoleMetricsNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listMultiRoleMetricsNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of metric responses. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listMultiRoleMetricsNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listMultiRoleMetricsNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of SKU information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listMultiRolePoolSkusNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listMultiRolePoolSkusNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of SKU information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listMultiRolePoolSkusNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listMultiRolePoolSkusNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of usages. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listMultiRoleUsagesNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listMultiRoleUsagesNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of usages. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listMultiRoleUsagesNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listMultiRoleUsagesNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Outbound Environment Endpoints. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - getOutboundNetworkDependenciesEndpointsNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getOutboundNetworkDependenciesEndpointsNext( - nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Outbound Environment Endpoints. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - getOutboundNetworkDependenciesEndpointsNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getOutboundNetworkDependenciesEndpointsNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> resumeNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.resumeNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> resumeNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .resumeNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service plans. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAppServicePlansNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listAppServicePlansNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service plans. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAppServicePlansNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listAppServicePlansNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWebAppsNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listWebAppsNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWebAppsNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listWebAppsNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> suspendNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.suspendNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> suspendNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .suspendNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of CSM usage quotas. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listUsagesNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listUsagesNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of CSM usage quotas. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listUsagesNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listUsagesNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of worker pools. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWorkerPoolsNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listWorkerPoolsNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of worker pools. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWorkerPoolsNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listWorkerPoolsNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of metric definitions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listWorkerPoolInstanceMetricDefinitionsNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listWorkerPoolInstanceMetricDefinitionsNext( - nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of metric definitions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listWorkerPoolInstanceMetricDefinitionsNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listWorkerPoolInstanceMetricDefinitionsNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of metric responses. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWorkerPoolInstanceMetricsNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service.listWorkerPoolInstanceMetricsNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of metric responses. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWorkerPoolInstanceMetricsNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listWorkerPoolInstanceMetricsNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of metric definitions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWebWorkerMetricDefinitionsNextSinglePageAsync( - String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service.listWebWorkerMetricDefinitionsNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of metric definitions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWebWorkerMetricDefinitionsNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listWebWorkerMetricDefinitionsNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of metric responses. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWebWorkerMetricsNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listWebWorkerMetricsNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of metric responses. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWebWorkerMetricsNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listWebWorkerMetricsNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of SKU information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWorkerPoolSkusNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listWorkerPoolSkusNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of SKU information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWorkerPoolSkusNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listWorkerPoolSkusNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of usages. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWebWorkerUsagesNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listWebWorkerUsagesNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of usages. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWebWorkerUsagesNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listWebWorkerUsagesNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/AppServicePlanImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/AppServicePlanImpl.java deleted file mode 100644 index eae2e2fe41ba..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/AppServicePlanImpl.java +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.implementation; - -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.AppServiceManager; -import com.azure.resourcemanager.appservice.models.AppServicePlan; -import com.azure.resourcemanager.appservice.models.OperatingSystem; -import com.azure.resourcemanager.appservice.models.PricingTier; -import com.azure.resourcemanager.appservice.fluent.models.AppServicePlanInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.GroupableResourceImpl; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import reactor.core.publisher.Mono; - -/** The implementation for AppServicePlan. */ -class AppServicePlanImpl - extends GroupableResourceImpl - implements AppServicePlan, AppServicePlan.Definition, AppServicePlan.Update { - - private final ClientLogger logger = new ClientLogger(getClass()); - - AppServicePlanImpl(String name, AppServicePlanInner innerObject, AppServiceManager manager) { - super(name, innerObject, manager); - } - - @Override - public Mono createResourceAsync() { - return this - .manager() - .serviceClient() - .getAppServicePlans() - .createOrUpdateAsync(resourceGroupName(), name(), innerModel()) - .map(innerToFluentMap(this)); - } - - @Override - protected Mono getInnerAsync() { - return this.manager().serviceClient().getAppServicePlans().getByResourceGroupAsync(resourceGroupName(), name()); - } - - @Override - public int maxInstances() { - return ResourceManagerUtils.toPrimitiveInt(innerModel().maximumNumberOfWorkers()); - } - - @Override - public int capacity() { - return ResourceManagerUtils.toPrimitiveInt(innerModel().sku().capacity()); - } - - @Override - public boolean perSiteScaling() { - return innerModel().perSiteScaling(); - } - - @Override - public int numberOfWebApps() { - return ResourceManagerUtils.toPrimitiveInt(innerModel().numberOfSites()); - } - - @Override - public PricingTier pricingTier() { - return PricingTier.fromSkuDescription(innerModel().sku()); - } - - @Override - public OperatingSystem operatingSystem() { - return (innerModel().reserved() == null || !innerModel().reserved()) - ? OperatingSystem.WINDOWS - : OperatingSystem.LINUX; - } - - @Override - public AppServicePlanImpl withFreePricingTier() { - return withPricingTier(PricingTier.FREE_F1); - } - - @Override - public AppServicePlanImpl withSharedPricingTier() { - return withPricingTier(PricingTier.SHARED_D1); - } - - @Override - public AppServicePlanImpl withPricingTier(PricingTier pricingTier) { - if (pricingTier == null) { - throw logger.logExceptionAsError(new IllegalArgumentException("pricingTier == null")); - } - innerModel().withSku(pricingTier.toSkuDescription()); - return this; - } - - @Override - public AppServicePlanImpl withPerSiteScaling(boolean perSiteScaling) { - innerModel().withPerSiteScaling(perSiteScaling); - return this; - } - - @Override - public AppServicePlanImpl withCapacity(int capacity) { - if (capacity < 1) { - throw logger.logExceptionAsError(new IllegalArgumentException("Capacity is at least 1.")); - } - innerModel().sku().withCapacity(capacity); - return this; - } - - @Override - public AppServicePlanImpl withOperatingSystem(OperatingSystem operatingSystem) { - if (OperatingSystem.LINUX.equals(operatingSystem)) { - innerModel().withReserved(true); - innerModel().withKind("linux"); - } else { - innerModel().withKind("app"); - } - return this; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/AppServicePlansClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/AppServicePlansClientImpl.java deleted file mode 100644 index f76bbb7861b4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/AppServicePlansClientImpl.java +++ /dev/null @@ -1,6420 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.appservice.fluent.AppServicePlansClient; -import com.azure.resourcemanager.appservice.fluent.models.AppServicePlanInner; -import com.azure.resourcemanager.appservice.fluent.models.CapabilityInner; -import com.azure.resourcemanager.appservice.fluent.models.CsmUsageQuotaInner; -import com.azure.resourcemanager.appservice.fluent.models.HybridConnectionInner; -import com.azure.resourcemanager.appservice.fluent.models.HybridConnectionKeyInner; -import com.azure.resourcemanager.appservice.fluent.models.HybridConnectionLimitsInner; -import com.azure.resourcemanager.appservice.fluent.models.ResourceMetricDefinitionInner; -import com.azure.resourcemanager.appservice.fluent.models.ResourceMetricInner; -import com.azure.resourcemanager.appservice.fluent.models.SiteInner; -import com.azure.resourcemanager.appservice.fluent.models.VnetGatewayInner; -import com.azure.resourcemanager.appservice.fluent.models.VnetInfoInner; -import com.azure.resourcemanager.appservice.fluent.models.VnetRouteInner; -import com.azure.resourcemanager.appservice.models.AppServicePlanCollection; -import com.azure.resourcemanager.appservice.models.AppServicePlanPatchResource; -import com.azure.resourcemanager.appservice.models.CsmUsageQuotaCollection; -import com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException; -import com.azure.resourcemanager.appservice.models.HybridConnectionCollection; -import com.azure.resourcemanager.appservice.models.ResourceCollection; -import com.azure.resourcemanager.appservice.models.ResourceMetricCollection; -import com.azure.resourcemanager.appservice.models.ResourceMetricDefinitionCollection; -import com.azure.resourcemanager.appservice.models.WebAppCollection; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import java.util.List; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in AppServicePlansClient. */ -public final class AppServicePlansClientImpl - implements InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete, - AppServicePlansClient { - private final ClientLogger logger = new ClientLogger(AppServicePlansClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final AppServicePlansService service; - - /** The service client containing this operation class. */ - private final WebSiteManagementClientImpl client; - - /** - * Initializes an instance of AppServicePlansClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - AppServicePlansClientImpl(WebSiteManagementClientImpl client) { - this.service = - RestProxy.create(AppServicePlansService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for WebSiteManagementClientAppServicePlans to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "WebSiteManagementCli") - private interface AppServicePlansService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Web/serverfarms") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("detailed") Boolean detailed, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms" - + "/{name}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms" - + "/{name}") - @ExpectedResponses({200, 201, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") AppServicePlanInner appServicePlan, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms" - + "/{name}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms" - + "/{name}") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> update( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") AppServicePlanPatchResource appServicePlan, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms" - + "/{name}/capabilities") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono>> listCapabilities( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms" - + "/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getHybridConnection( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("namespaceName") String namespaceName, - @PathParam("relayName") String relayName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms" - + "/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteHybridConnection( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("namespaceName") String namespaceName, - @PathParam("relayName") String relayName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms" - + "/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}/listKeys") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listHybridConnectionKeys( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("namespaceName") String namespaceName, - @PathParam("relayName") String relayName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms" - + "/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}/sites") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listWebAppsByHybridConnection( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("namespaceName") String namespaceName, - @PathParam("relayName") String relayName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms" - + "/{name}/hybridConnectionPlanLimits/limit") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getHybridConnectionPlanLimit( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms" - + "/{name}/hybridConnectionRelays") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listHybridConnections( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms" - + "/{name}/metricdefinitions") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listMetricDefintions( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms" - + "/{name}/metrics") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listMetrics( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @QueryParam("details") Boolean details, - @QueryParam(value = "$filter", encoded = true) String filter, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms" - + "/{name}/restartSites") - @ExpectedResponses({204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> restartWebApps( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @QueryParam("softRestart") Boolean softRestart, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms" - + "/{name}/sites") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listWebApps( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @QueryParam("$skipToken") String skipToken, - @QueryParam(value = "$filter", encoded = true) String filter, - @QueryParam("$top") String top, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms" - + "/{name}/skus") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getServerFarmSkus( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms" - + "/{name}/usages") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listUsages( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @QueryParam(value = "$filter", encoded = true) String filter, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms" - + "/{name}/virtualNetworkConnections") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono>> listVnets( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms" - + "/{name}/virtualNetworkConnections/{vnetName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getVnetFromServerFarm( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("vnetName") String vnetName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms" - + "/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getVnetGateway( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("vnetName") String vnetName, - @PathParam("gatewayName") String gatewayName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms" - + "/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> updateVnetGateway( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("vnetName") String vnetName, - @PathParam("gatewayName") String gatewayName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") VnetGatewayInner connectionEnvelope, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms" - + "/{name}/virtualNetworkConnections/{vnetName}/routes") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono>> listRoutesForVnet( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("vnetName") String vnetName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms" - + "/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> getRouteForVnet( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("vnetName") String vnetName, - @PathParam("routeName") String routeName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms" - + "/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}") - @ExpectedResponses({200, 400, 404}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdateVnetRoute( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("vnetName") String vnetName, - @PathParam("routeName") String routeName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") VnetRouteInner route, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms" - + "/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}") - @ExpectedResponses({200, 404}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteVnetRoute( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("vnetName") String vnetName, - @PathParam("routeName") String routeName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms" - + "/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}") - @ExpectedResponses({200, 400, 404}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> updateVnetRoute( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("vnetName") String vnetName, - @PathParam("routeName") String routeName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") VnetRouteInner route, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms" - + "/{name}/workers/{workerName}/reboot") - @ExpectedResponses({204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> rebootWorker( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("workerName") String workerName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listWebAppsByHybridConnectionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listHybridConnectionsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listMetricDefintionsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listMetricsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listWebAppsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listUsagesNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Get all App Service plans for a subscription. - * - * @param detailed Specify <code>true</code> to return all App Service plan properties. The default is - * <code>false</code>, which returns a subset of the properties. Retrieval of all properties may - * increase the API latency. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all App Service plans for a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Boolean detailed) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - detailed, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get all App Service plans for a subscription. - * - * @param detailed Specify <code>true</code> to return all App Service plan properties. The default is - * <code>false</code>, which returns a subset of the properties. Retrieval of all properties may - * increase the API latency. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all App Service plans for a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Boolean detailed, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - detailed, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get all App Service plans for a subscription. - * - * @param detailed Specify <code>true</code> to return all App Service plan properties. The default is - * <code>false</code>, which returns a subset of the properties. Retrieval of all properties may - * increase the API latency. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all App Service plans for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(Boolean detailed) { - return new PagedFlux<>(() -> listSinglePageAsync(detailed), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Get all App Service plans for a subscription. - * - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all App Service plans for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - final Boolean detailed = null; - return new PagedFlux<>(() -> listSinglePageAsync(detailed), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Get all App Service plans for a subscription. - * - * @param detailed Specify <code>true</code> to return all App Service plan properties. The default is - * <code>false</code>, which returns a subset of the properties. Retrieval of all properties may - * increase the API latency. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all App Service plans for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Boolean detailed, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(detailed, context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Get all App Service plans for a subscription. - * - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all App Service plans for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - final Boolean detailed = null; - return new PagedIterable<>(listAsync(detailed)); - } - - /** - * Get all App Service plans for a subscription. - * - * @param detailed Specify <code>true</code> to return all App Service plan properties. The default is - * <code>false</code>, which returns a subset of the properties. Retrieval of all properties may - * increase the API latency. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all App Service plans for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Boolean detailed, Context context) { - return new PagedIterable<>(listAsync(detailed, context)); - } - - /** - * Get all App Service plans in a resource group. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all App Service plans in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get all App Service plans in a resource group. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all App Service plans in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get all App Service plans in a resource group. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all App Service plans in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * Get all App Service plans in a resource group. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all App Service plans in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * Get all App Service plans in a resource group. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all App Service plans in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * Get all App Service plans in a resource group. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all App Service plans in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * Get an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an App Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an App Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Get an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an App Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync(String resourceGroupName, String name) { - return getByResourceGroupWithResponseAsync(resourceGroupName, name) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an App Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AppServicePlanInner getByResourceGroup(String resourceGroupName, String name) { - return getByResourceGroupAsync(resourceGroupName, name).block(); - } - - /** - * Get an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an App Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String name, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); - } - - /** - * Creates or updates an App Service Plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param appServicePlan Details of the App Service plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return app Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String name, AppServicePlanInner appServicePlan) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (appServicePlan == null) { - return Mono.error(new IllegalArgumentException("Parameter appServicePlan is required and cannot be null.")); - } else { - appServicePlan.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - appServicePlan, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates an App Service Plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param appServicePlan Details of the App Service plan. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return app Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String name, AppServicePlanInner appServicePlan, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (appServicePlan == null) { - return Mono.error(new IllegalArgumentException("Parameter appServicePlan is required and cannot be null.")); - } else { - appServicePlan.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - appServicePlan, - accept, - context); - } - - /** - * Creates or updates an App Service Plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param appServicePlan Details of the App Service plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return app Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, AppServicePlanInner> beginCreateOrUpdateAsync( - String resourceGroupName, String name, AppServicePlanInner appServicePlan) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, name, appServicePlan); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - AppServicePlanInner.class, - AppServicePlanInner.class, - Context.NONE); - } - - /** - * Creates or updates an App Service Plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param appServicePlan Details of the App Service plan. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return app Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, AppServicePlanInner> beginCreateOrUpdateAsync( - String resourceGroupName, String name, AppServicePlanInner appServicePlan, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, name, appServicePlan, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), AppServicePlanInner.class, AppServicePlanInner.class, context); - } - - /** - * Creates or updates an App Service Plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param appServicePlan Details of the App Service plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return app Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, AppServicePlanInner> beginCreateOrUpdate( - String resourceGroupName, String name, AppServicePlanInner appServicePlan) { - return beginCreateOrUpdateAsync(resourceGroupName, name, appServicePlan).getSyncPoller(); - } - - /** - * Creates or updates an App Service Plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param appServicePlan Details of the App Service plan. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return app Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, AppServicePlanInner> beginCreateOrUpdate( - String resourceGroupName, String name, AppServicePlanInner appServicePlan, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, name, appServicePlan, context).getSyncPoller(); - } - - /** - * Creates or updates an App Service Plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param appServicePlan Details of the App Service plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return app Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, String name, AppServicePlanInner appServicePlan) { - return beginCreateOrUpdateAsync(resourceGroupName, name, appServicePlan) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates an App Service Plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param appServicePlan Details of the App Service plan. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return app Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String name, AppServicePlanInner appServicePlan, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, name, appServicePlan, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates an App Service Plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param appServicePlan Details of the App Service plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return app Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AppServicePlanInner createOrUpdate( - String resourceGroupName, String name, AppServicePlanInner appServicePlan) { - return createOrUpdateAsync(resourceGroupName, name, appServicePlan).block(); - } - - /** - * Creates or updates an App Service Plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param appServicePlan Details of the App Service plan. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return app Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AppServicePlanInner createOrUpdate( - String resourceGroupName, String name, AppServicePlanInner appServicePlan, Context context) { - return createOrUpdateAsync(resourceGroupName, name, appServicePlan, context).block(); - } - - /** - * Delete an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Delete an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String name) { - return deleteWithResponseAsync(resourceGroupName, name).flatMap((Response res) -> Mono.empty()); - } - - /** - * Delete an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String name) { - deleteAsync(resourceGroupName, name).block(); - } - - /** - * Delete an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String name, Context context) { - return deleteWithResponseAsync(resourceGroupName, name, context).block(); - } - - /** - * Creates or updates an App Service Plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param appServicePlan Details of the App Service plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return app Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateWithResponseAsync( - String resourceGroupName, String name, AppServicePlanPatchResource appServicePlan) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (appServicePlan == null) { - return Mono.error(new IllegalArgumentException("Parameter appServicePlan is required and cannot be null.")); - } else { - appServicePlan.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - appServicePlan, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates an App Service Plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param appServicePlan Details of the App Service plan. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return app Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, String name, AppServicePlanPatchResource appServicePlan, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (appServicePlan == null) { - return Mono.error(new IllegalArgumentException("Parameter appServicePlan is required and cannot be null.")); - } else { - appServicePlan.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - appServicePlan, - accept, - context); - } - - /** - * Creates or updates an App Service Plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param appServicePlan Details of the App Service plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return app Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync( - String resourceGroupName, String name, AppServicePlanPatchResource appServicePlan) { - return updateWithResponseAsync(resourceGroupName, name, appServicePlan) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates or updates an App Service Plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param appServicePlan Details of the App Service plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return app Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AppServicePlanInner update( - String resourceGroupName, String name, AppServicePlanPatchResource appServicePlan) { - return updateAsync(resourceGroupName, name, appServicePlan).block(); - } - - /** - * Creates or updates an App Service Plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param appServicePlan Details of the App Service plan. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return app Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, String name, AppServicePlanPatchResource appServicePlan, Context context) { - return updateWithResponseAsync(resourceGroupName, name, appServicePlan, context).block(); - } - - /** - * List all capabilities of an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of Capability. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> listCapabilitiesWithResponseAsync( - String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listCapabilities( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List all capabilities of an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of Capability. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> listCapabilitiesWithResponseAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listCapabilities( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * List all capabilities of an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of Capability. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listCapabilitiesAsync(String resourceGroupName, String name) { - return listCapabilitiesWithResponseAsync(resourceGroupName, name) - .flatMap( - (Response> res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * List all capabilities of an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of Capability. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public List listCapabilities(String resourceGroupName, String name) { - return listCapabilitiesAsync(resourceGroupName, name).block(); - } - - /** - * List all capabilities of an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of Capability. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response> listCapabilitiesWithResponse( - String resourceGroupName, String name, Context context) { - return listCapabilitiesWithResponseAsync(resourceGroupName, name, context).block(); - } - - /** - * Retrieve a Hybrid Connection in use in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param namespaceName Name of the Service Bus namespace. - * @param relayName Name of the Service Bus relay. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getHybridConnectionWithResponseAsync( - String resourceGroupName, String name, String namespaceName, String relayName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (relayName == null) { - return Mono.error(new IllegalArgumentException("Parameter relayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getHybridConnection( - this.client.getEndpoint(), - resourceGroupName, - name, - namespaceName, - relayName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Retrieve a Hybrid Connection in use in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param namespaceName Name of the Service Bus namespace. - * @param relayName Name of the Service Bus relay. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getHybridConnectionWithResponseAsync( - String resourceGroupName, String name, String namespaceName, String relayName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (relayName == null) { - return Mono.error(new IllegalArgumentException("Parameter relayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getHybridConnection( - this.client.getEndpoint(), - resourceGroupName, - name, - namespaceName, - relayName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Retrieve a Hybrid Connection in use in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param namespaceName Name of the Service Bus namespace. - * @param relayName Name of the Service Bus relay. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getHybridConnectionAsync( - String resourceGroupName, String name, String namespaceName, String relayName) { - return getHybridConnectionWithResponseAsync(resourceGroupName, name, namespaceName, relayName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Retrieve a Hybrid Connection in use in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param namespaceName Name of the Service Bus namespace. - * @param relayName Name of the Service Bus relay. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public HybridConnectionInner getHybridConnection( - String resourceGroupName, String name, String namespaceName, String relayName) { - return getHybridConnectionAsync(resourceGroupName, name, namespaceName, relayName).block(); - } - - /** - * Retrieve a Hybrid Connection in use in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param namespaceName Name of the Service Bus namespace. - * @param relayName Name of the Service Bus relay. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getHybridConnectionWithResponse( - String resourceGroupName, String name, String namespaceName, String relayName, Context context) { - return getHybridConnectionWithResponseAsync(resourceGroupName, name, namespaceName, relayName, context).block(); - } - - /** - * Delete a Hybrid Connection in use in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param namespaceName Name of the Service Bus namespace. - * @param relayName Name of the Service Bus relay. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteHybridConnectionWithResponseAsync( - String resourceGroupName, String name, String namespaceName, String relayName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (relayName == null) { - return Mono.error(new IllegalArgumentException("Parameter relayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .deleteHybridConnection( - this.client.getEndpoint(), - resourceGroupName, - name, - namespaceName, - relayName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete a Hybrid Connection in use in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param namespaceName Name of the Service Bus namespace. - * @param relayName Name of the Service Bus relay. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteHybridConnectionWithResponseAsync( - String resourceGroupName, String name, String namespaceName, String relayName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (relayName == null) { - return Mono.error(new IllegalArgumentException("Parameter relayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .deleteHybridConnection( - this.client.getEndpoint(), - resourceGroupName, - name, - namespaceName, - relayName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Delete a Hybrid Connection in use in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param namespaceName Name of the Service Bus namespace. - * @param relayName Name of the Service Bus relay. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteHybridConnectionAsync( - String resourceGroupName, String name, String namespaceName, String relayName) { - return deleteHybridConnectionWithResponseAsync(resourceGroupName, name, namespaceName, relayName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Delete a Hybrid Connection in use in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param namespaceName Name of the Service Bus namespace. - * @param relayName Name of the Service Bus relay. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteHybridConnection(String resourceGroupName, String name, String namespaceName, String relayName) { - deleteHybridConnectionAsync(resourceGroupName, name, namespaceName, relayName).block(); - } - - /** - * Delete a Hybrid Connection in use in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param namespaceName Name of the Service Bus namespace. - * @param relayName Name of the Service Bus relay. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteHybridConnectionWithResponse( - String resourceGroupName, String name, String namespaceName, String relayName, Context context) { - return deleteHybridConnectionWithResponseAsync(resourceGroupName, name, namespaceName, relayName, context) - .block(); - } - - /** - * Get the send key name and value of a Hybrid Connection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param namespaceName The name of the Service Bus namespace. - * @param relayName The name of the Service Bus relay. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the send key name and value of a Hybrid Connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listHybridConnectionKeysWithResponseAsync( - String resourceGroupName, String name, String namespaceName, String relayName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (relayName == null) { - return Mono.error(new IllegalArgumentException("Parameter relayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listHybridConnectionKeys( - this.client.getEndpoint(), - resourceGroupName, - name, - namespaceName, - relayName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the send key name and value of a Hybrid Connection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param namespaceName The name of the Service Bus namespace. - * @param relayName The name of the Service Bus relay. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the send key name and value of a Hybrid Connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listHybridConnectionKeysWithResponseAsync( - String resourceGroupName, String name, String namespaceName, String relayName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (relayName == null) { - return Mono.error(new IllegalArgumentException("Parameter relayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listHybridConnectionKeys( - this.client.getEndpoint(), - resourceGroupName, - name, - namespaceName, - relayName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Get the send key name and value of a Hybrid Connection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param namespaceName The name of the Service Bus namespace. - * @param relayName The name of the Service Bus relay. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the send key name and value of a Hybrid Connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listHybridConnectionKeysAsync( - String resourceGroupName, String name, String namespaceName, String relayName) { - return listHybridConnectionKeysWithResponseAsync(resourceGroupName, name, namespaceName, relayName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get the send key name and value of a Hybrid Connection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param namespaceName The name of the Service Bus namespace. - * @param relayName The name of the Service Bus relay. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the send key name and value of a Hybrid Connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public HybridConnectionKeyInner listHybridConnectionKeys( - String resourceGroupName, String name, String namespaceName, String relayName) { - return listHybridConnectionKeysAsync(resourceGroupName, name, namespaceName, relayName).block(); - } - - /** - * Get the send key name and value of a Hybrid Connection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param namespaceName The name of the Service Bus namespace. - * @param relayName The name of the Service Bus relay. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the send key name and value of a Hybrid Connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listHybridConnectionKeysWithResponse( - String resourceGroupName, String name, String namespaceName, String relayName, Context context) { - return listHybridConnectionKeysWithResponseAsync(resourceGroupName, name, namespaceName, relayName, context) - .block(); - } - - /** - * Get all apps that use a Hybrid Connection in an App Service Plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param namespaceName Name of the Hybrid Connection namespace. - * @param relayName Name of the Hybrid Connection relay. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all apps that use a Hybrid Connection in an App Service Plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWebAppsByHybridConnectionSinglePageAsync( - String resourceGroupName, String name, String namespaceName, String relayName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (relayName == null) { - return Mono.error(new IllegalArgumentException("Parameter relayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listWebAppsByHybridConnection( - this.client.getEndpoint(), - resourceGroupName, - name, - namespaceName, - relayName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get all apps that use a Hybrid Connection in an App Service Plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param namespaceName Name of the Hybrid Connection namespace. - * @param relayName Name of the Hybrid Connection relay. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all apps that use a Hybrid Connection in an App Service Plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWebAppsByHybridConnectionSinglePageAsync( - String resourceGroupName, String name, String namespaceName, String relayName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (relayName == null) { - return Mono.error(new IllegalArgumentException("Parameter relayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listWebAppsByHybridConnection( - this.client.getEndpoint(), - resourceGroupName, - name, - namespaceName, - relayName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get all apps that use a Hybrid Connection in an App Service Plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param namespaceName Name of the Hybrid Connection namespace. - * @param relayName Name of the Hybrid Connection relay. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all apps that use a Hybrid Connection in an App Service Plan. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listWebAppsByHybridConnectionAsync( - String resourceGroupName, String name, String namespaceName, String relayName) { - return new PagedFlux<>( - () -> listWebAppsByHybridConnectionSinglePageAsync(resourceGroupName, name, namespaceName, relayName), - nextLink -> listWebAppsByHybridConnectionNextSinglePageAsync(nextLink)); - } - - /** - * Get all apps that use a Hybrid Connection in an App Service Plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param namespaceName Name of the Hybrid Connection namespace. - * @param relayName Name of the Hybrid Connection relay. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all apps that use a Hybrid Connection in an App Service Plan. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listWebAppsByHybridConnectionAsync( - String resourceGroupName, String name, String namespaceName, String relayName, Context context) { - return new PagedFlux<>( - () -> - listWebAppsByHybridConnectionSinglePageAsync( - resourceGroupName, name, namespaceName, relayName, context), - nextLink -> listWebAppsByHybridConnectionNextSinglePageAsync(nextLink, context)); - } - - /** - * Get all apps that use a Hybrid Connection in an App Service Plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param namespaceName Name of the Hybrid Connection namespace. - * @param relayName Name of the Hybrid Connection relay. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all apps that use a Hybrid Connection in an App Service Plan. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listWebAppsByHybridConnection( - String resourceGroupName, String name, String namespaceName, String relayName) { - return new PagedIterable<>( - listWebAppsByHybridConnectionAsync(resourceGroupName, name, namespaceName, relayName)); - } - - /** - * Get all apps that use a Hybrid Connection in an App Service Plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param namespaceName Name of the Hybrid Connection namespace. - * @param relayName Name of the Hybrid Connection relay. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all apps that use a Hybrid Connection in an App Service Plan. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listWebAppsByHybridConnection( - String resourceGroupName, String name, String namespaceName, String relayName, Context context) { - return new PagedIterable<>( - listWebAppsByHybridConnectionAsync(resourceGroupName, name, namespaceName, relayName, context)); - } - - /** - * Get the maximum number of Hybrid Connections allowed in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the maximum number of Hybrid Connections allowed in an App Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getHybridConnectionPlanLimitWithResponseAsync( - String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getHybridConnectionPlanLimit( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the maximum number of Hybrid Connections allowed in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the maximum number of Hybrid Connections allowed in an App Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getHybridConnectionPlanLimitWithResponseAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getHybridConnectionPlanLimit( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Get the maximum number of Hybrid Connections allowed in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the maximum number of Hybrid Connections allowed in an App Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getHybridConnectionPlanLimitAsync(String resourceGroupName, String name) { - return getHybridConnectionPlanLimitWithResponseAsync(resourceGroupName, name) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get the maximum number of Hybrid Connections allowed in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the maximum number of Hybrid Connections allowed in an App Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public HybridConnectionLimitsInner getHybridConnectionPlanLimit(String resourceGroupName, String name) { - return getHybridConnectionPlanLimitAsync(resourceGroupName, name).block(); - } - - /** - * Get the maximum number of Hybrid Connections allowed in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the maximum number of Hybrid Connections allowed in an App Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getHybridConnectionPlanLimitWithResponse( - String resourceGroupName, String name, Context context) { - return getHybridConnectionPlanLimitWithResponseAsync(resourceGroupName, name, context).block(); - } - - /** - * Retrieve all Hybrid Connections in use in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of hostname bindings. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listHybridConnectionsSinglePageAsync( - String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listHybridConnections( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Retrieve all Hybrid Connections in use in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of hostname bindings. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listHybridConnectionsSinglePageAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listHybridConnections( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Retrieve all Hybrid Connections in use in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of hostname bindings. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listHybridConnectionsAsync(String resourceGroupName, String name) { - return new PagedFlux<>( - () -> listHybridConnectionsSinglePageAsync(resourceGroupName, name), - nextLink -> listHybridConnectionsNextSinglePageAsync(nextLink)); - } - - /** - * Retrieve all Hybrid Connections in use in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of hostname bindings. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listHybridConnectionsAsync( - String resourceGroupName, String name, Context context) { - return new PagedFlux<>( - () -> listHybridConnectionsSinglePageAsync(resourceGroupName, name, context), - nextLink -> listHybridConnectionsNextSinglePageAsync(nextLink, context)); - } - - /** - * Retrieve all Hybrid Connections in use in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of hostname bindings. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listHybridConnections(String resourceGroupName, String name) { - return new PagedIterable<>(listHybridConnectionsAsync(resourceGroupName, name)); - } - - /** - * Retrieve all Hybrid Connections in use in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of hostname bindings. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listHybridConnections( - String resourceGroupName, String name, Context context) { - return new PagedIterable<>(listHybridConnectionsAsync(resourceGroupName, name, context)); - } - - /** - * Get metrics that can be queried for an App Service plan, and their definitions. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metrics that can be queried for an App Service plan, and their definitions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listMetricDefintionsSinglePageAsync( - String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listMetricDefintions( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get metrics that can be queried for an App Service plan, and their definitions. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metrics that can be queried for an App Service plan, and their definitions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listMetricDefintionsSinglePageAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listMetricDefintions( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get metrics that can be queried for an App Service plan, and their definitions. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metrics that can be queried for an App Service plan, and their definitions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listMetricDefintionsAsync(String resourceGroupName, String name) { - return new PagedFlux<>( - () -> listMetricDefintionsSinglePageAsync(resourceGroupName, name), - nextLink -> listMetricDefintionsNextSinglePageAsync(nextLink)); - } - - /** - * Get metrics that can be queried for an App Service plan, and their definitions. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metrics that can be queried for an App Service plan, and their definitions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listMetricDefintionsAsync( - String resourceGroupName, String name, Context context) { - return new PagedFlux<>( - () -> listMetricDefintionsSinglePageAsync(resourceGroupName, name, context), - nextLink -> listMetricDefintionsNextSinglePageAsync(nextLink, context)); - } - - /** - * Get metrics that can be queried for an App Service plan, and their definitions. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metrics that can be queried for an App Service plan, and their definitions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listMetricDefintions(String resourceGroupName, String name) { - return new PagedIterable<>(listMetricDefintionsAsync(resourceGroupName, name)); - } - - /** - * Get metrics that can be queried for an App Service plan, and their definitions. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metrics that can be queried for an App Service plan, and their definitions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listMetricDefintions( - String resourceGroupName, String name, Context context) { - return new PagedIterable<>(listMetricDefintionsAsync(resourceGroupName, name, context)); - } - - /** - * Get metrics for an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param details Specify <code>true</code> to include instance details. The default is - * <code>false</code>. - * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: - * $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and - * endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metrics for an App Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listMetricsSinglePageAsync( - String resourceGroupName, String name, Boolean details, String filter) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listMetrics( - this.client.getEndpoint(), - resourceGroupName, - name, - details, - filter, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get metrics for an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param details Specify <code>true</code> to include instance details. The default is - * <code>false</code>. - * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: - * $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and - * endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metrics for an App Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listMetricsSinglePageAsync( - String resourceGroupName, String name, Boolean details, String filter, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listMetrics( - this.client.getEndpoint(), - resourceGroupName, - name, - details, - filter, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get metrics for an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param details Specify <code>true</code> to include instance details. The default is - * <code>false</code>. - * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: - * $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and - * endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metrics for an App Service plan. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listMetricsAsync( - String resourceGroupName, String name, Boolean details, String filter) { - return new PagedFlux<>( - () -> listMetricsSinglePageAsync(resourceGroupName, name, details, filter), - nextLink -> listMetricsNextSinglePageAsync(nextLink)); - } - - /** - * Get metrics for an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metrics for an App Service plan. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listMetricsAsync(String resourceGroupName, String name) { - final Boolean details = null; - final String filter = null; - return new PagedFlux<>( - () -> listMetricsSinglePageAsync(resourceGroupName, name, details, filter), - nextLink -> listMetricsNextSinglePageAsync(nextLink)); - } - - /** - * Get metrics for an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param details Specify <code>true</code> to include instance details. The default is - * <code>false</code>. - * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: - * $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and - * endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metrics for an App Service plan. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listMetricsAsync( - String resourceGroupName, String name, Boolean details, String filter, Context context) { - return new PagedFlux<>( - () -> listMetricsSinglePageAsync(resourceGroupName, name, details, filter, context), - nextLink -> listMetricsNextSinglePageAsync(nextLink, context)); - } - - /** - * Get metrics for an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metrics for an App Service plan. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listMetrics(String resourceGroupName, String name) { - final Boolean details = null; - final String filter = null; - return new PagedIterable<>(listMetricsAsync(resourceGroupName, name, details, filter)); - } - - /** - * Get metrics for an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param details Specify <code>true</code> to include instance details. The default is - * <code>false</code>. - * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: - * $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and - * endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metrics for an App Service plan. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listMetrics( - String resourceGroupName, String name, Boolean details, String filter, Context context) { - return new PagedIterable<>(listMetricsAsync(resourceGroupName, name, details, filter, context)); - } - - /** - * Restart all apps in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param softRestart Specify <code>true</code> to perform a soft restart, applies the configuration - * settings and restarts the apps if necessary. The default is <code>false</code>, which always - * restarts and reprovisions the apps. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> restartWebAppsWithResponseAsync( - String resourceGroupName, String name, Boolean softRestart) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .restartWebApps( - this.client.getEndpoint(), - resourceGroupName, - name, - softRestart, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Restart all apps in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param softRestart Specify <code>true</code> to perform a soft restart, applies the configuration - * settings and restarts the apps if necessary. The default is <code>false</code>, which always - * restarts and reprovisions the apps. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> restartWebAppsWithResponseAsync( - String resourceGroupName, String name, Boolean softRestart, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .restartWebApps( - this.client.getEndpoint(), - resourceGroupName, - name, - softRestart, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Restart all apps in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param softRestart Specify <code>true</code> to perform a soft restart, applies the configuration - * settings and restarts the apps if necessary. The default is <code>false</code>, which always - * restarts and reprovisions the apps. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono restartWebAppsAsync(String resourceGroupName, String name, Boolean softRestart) { - return restartWebAppsWithResponseAsync(resourceGroupName, name, softRestart) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Restart all apps in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono restartWebAppsAsync(String resourceGroupName, String name) { - final Boolean softRestart = null; - return restartWebAppsWithResponseAsync(resourceGroupName, name, softRestart) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Restart all apps in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void restartWebApps(String resourceGroupName, String name) { - final Boolean softRestart = null; - restartWebAppsAsync(resourceGroupName, name, softRestart).block(); - } - - /** - * Restart all apps in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param softRestart Specify <code>true</code> to perform a soft restart, applies the configuration - * settings and restarts the apps if necessary. The default is <code>false</code>, which always - * restarts and reprovisions the apps. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response restartWebAppsWithResponse( - String resourceGroupName, String name, Boolean softRestart, Context context) { - return restartWebAppsWithResponseAsync(resourceGroupName, name, softRestart, context).block(); - } - - /** - * Get all apps associated with an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param skipToken Skip to a web app in the list of webapps associated with app service plan. If specified, the - * resulting list will contain web apps starting from (including) the skipToken. Otherwise, the resulting list - * contains web apps from the start of the list. - * @param filter Supported filter: $filter=state eq running. Returns only web apps that are currently running. - * @param top List page size. If specified, results are paged. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all apps associated with an App Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWebAppsSinglePageAsync( - String resourceGroupName, String name, String skipToken, String filter, String top) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listWebApps( - this.client.getEndpoint(), - resourceGroupName, - name, - skipToken, - filter, - top, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get all apps associated with an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param skipToken Skip to a web app in the list of webapps associated with app service plan. If specified, the - * resulting list will contain web apps starting from (including) the skipToken. Otherwise, the resulting list - * contains web apps from the start of the list. - * @param filter Supported filter: $filter=state eq running. Returns only web apps that are currently running. - * @param top List page size. If specified, results are paged. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all apps associated with an App Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWebAppsSinglePageAsync( - String resourceGroupName, String name, String skipToken, String filter, String top, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listWebApps( - this.client.getEndpoint(), - resourceGroupName, - name, - skipToken, - filter, - top, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get all apps associated with an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param skipToken Skip to a web app in the list of webapps associated with app service plan. If specified, the - * resulting list will contain web apps starting from (including) the skipToken. Otherwise, the resulting list - * contains web apps from the start of the list. - * @param filter Supported filter: $filter=state eq running. Returns only web apps that are currently running. - * @param top List page size. If specified, results are paged. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all apps associated with an App Service plan. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listWebAppsAsync( - String resourceGroupName, String name, String skipToken, String filter, String top) { - return new PagedFlux<>( - () -> listWebAppsSinglePageAsync(resourceGroupName, name, skipToken, filter, top), - nextLink -> listWebAppsNextSinglePageAsync(nextLink)); - } - - /** - * Get all apps associated with an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all apps associated with an App Service plan. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listWebAppsAsync(String resourceGroupName, String name) { - final String skipToken = null; - final String filter = null; - final String top = null; - return new PagedFlux<>( - () -> listWebAppsSinglePageAsync(resourceGroupName, name, skipToken, filter, top), - nextLink -> listWebAppsNextSinglePageAsync(nextLink)); - } - - /** - * Get all apps associated with an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param skipToken Skip to a web app in the list of webapps associated with app service plan. If specified, the - * resulting list will contain web apps starting from (including) the skipToken. Otherwise, the resulting list - * contains web apps from the start of the list. - * @param filter Supported filter: $filter=state eq running. Returns only web apps that are currently running. - * @param top List page size. If specified, results are paged. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all apps associated with an App Service plan. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listWebAppsAsync( - String resourceGroupName, String name, String skipToken, String filter, String top, Context context) { - return new PagedFlux<>( - () -> listWebAppsSinglePageAsync(resourceGroupName, name, skipToken, filter, top, context), - nextLink -> listWebAppsNextSinglePageAsync(nextLink, context)); - } - - /** - * Get all apps associated with an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all apps associated with an App Service plan. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listWebApps(String resourceGroupName, String name) { - final String skipToken = null; - final String filter = null; - final String top = null; - return new PagedIterable<>(listWebAppsAsync(resourceGroupName, name, skipToken, filter, top)); - } - - /** - * Get all apps associated with an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param skipToken Skip to a web app in the list of webapps associated with app service plan. If specified, the - * resulting list will contain web apps starting from (including) the skipToken. Otherwise, the resulting list - * contains web apps from the start of the list. - * @param filter Supported filter: $filter=state eq running. Returns only web apps that are currently running. - * @param top List page size. If specified, results are paged. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all apps associated with an App Service plan. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listWebApps( - String resourceGroupName, String name, String skipToken, String filter, String top, Context context) { - return new PagedIterable<>(listWebAppsAsync(resourceGroupName, name, skipToken, filter, top, context)); - } - - /** - * Gets all selectable SKUs for a given App Service Plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of App Service Plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all selectable SKUs for a given App Service Plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getServerFarmSkusWithResponseAsync(String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getServerFarmSkus( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all selectable SKUs for a given App Service Plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of App Service Plan. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all selectable SKUs for a given App Service Plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getServerFarmSkusWithResponseAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getServerFarmSkus( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets all selectable SKUs for a given App Service Plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of App Service Plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all selectable SKUs for a given App Service Plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getServerFarmSkusAsync(String resourceGroupName, String name) { - return getServerFarmSkusWithResponseAsync(resourceGroupName, name) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets all selectable SKUs for a given App Service Plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of App Service Plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all selectable SKUs for a given App Service Plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Object getServerFarmSkus(String resourceGroupName, String name) { - return getServerFarmSkusAsync(resourceGroupName, name).block(); - } - - /** - * Gets all selectable SKUs for a given App Service Plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of App Service Plan. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all selectable SKUs for a given App Service Plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getServerFarmSkusWithResponse(String resourceGroupName, String name, Context context) { - return getServerFarmSkusWithResponseAsync(resourceGroupName, name, context).block(); - } - - /** - * Gets server farm usage information. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of App Service Plan. - * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: - * $filter=(name.value eq 'Metric1' or name.value eq 'Metric2'). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return server farm usage information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listUsagesSinglePageAsync( - String resourceGroupName, String name, String filter) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listUsages( - this.client.getEndpoint(), - resourceGroupName, - name, - filter, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets server farm usage information. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of App Service Plan. - * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: - * $filter=(name.value eq 'Metric1' or name.value eq 'Metric2'). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return server farm usage information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listUsagesSinglePageAsync( - String resourceGroupName, String name, String filter, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listUsages( - this.client.getEndpoint(), - resourceGroupName, - name, - filter, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets server farm usage information. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of App Service Plan. - * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: - * $filter=(name.value eq 'Metric1' or name.value eq 'Metric2'). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return server farm usage information. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listUsagesAsync(String resourceGroupName, String name, String filter) { - return new PagedFlux<>( - () -> listUsagesSinglePageAsync(resourceGroupName, name, filter), - nextLink -> listUsagesNextSinglePageAsync(nextLink)); - } - - /** - * Gets server farm usage information. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of App Service Plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return server farm usage information. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listUsagesAsync(String resourceGroupName, String name) { - final String filter = null; - return new PagedFlux<>( - () -> listUsagesSinglePageAsync(resourceGroupName, name, filter), - nextLink -> listUsagesNextSinglePageAsync(nextLink)); - } - - /** - * Gets server farm usage information. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of App Service Plan. - * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: - * $filter=(name.value eq 'Metric1' or name.value eq 'Metric2'). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return server farm usage information. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listUsagesAsync( - String resourceGroupName, String name, String filter, Context context) { - return new PagedFlux<>( - () -> listUsagesSinglePageAsync(resourceGroupName, name, filter, context), - nextLink -> listUsagesNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets server farm usage information. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of App Service Plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return server farm usage information. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listUsages(String resourceGroupName, String name) { - final String filter = null; - return new PagedIterable<>(listUsagesAsync(resourceGroupName, name, filter)); - } - - /** - * Gets server farm usage information. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of App Service Plan. - * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: - * $filter=(name.value eq 'Metric1' or name.value eq 'Metric2'). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return server farm usage information. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listUsages( - String resourceGroupName, String name, String filter, Context context) { - return new PagedIterable<>(listUsagesAsync(resourceGroupName, name, filter, context)); - } - - /** - * Get all Virtual Networks associated with an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all Virtual Networks associated with an App Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> listVnetsWithResponseAsync(String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listVnets( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get all Virtual Networks associated with an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all Virtual Networks associated with an App Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> listVnetsWithResponseAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listVnets( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Get all Virtual Networks associated with an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all Virtual Networks associated with an App Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listVnetsAsync(String resourceGroupName, String name) { - return listVnetsWithResponseAsync(resourceGroupName, name) - .flatMap( - (Response> res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get all Virtual Networks associated with an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all Virtual Networks associated with an App Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public List listVnets(String resourceGroupName, String name) { - return listVnetsAsync(resourceGroupName, name).block(); - } - - /** - * Get all Virtual Networks associated with an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all Virtual Networks associated with an App Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response> listVnetsWithResponse(String resourceGroupName, String name, Context context) { - return listVnetsWithResponseAsync(resourceGroupName, name, context).block(); - } - - /** - * Get a Virtual Network associated with an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param vnetName Name of the Virtual Network. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Virtual Network associated with an App Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getVnetFromServerFarmWithResponseAsync( - String resourceGroupName, String name, String vnetName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (vnetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vnetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getVnetFromServerFarm( - this.client.getEndpoint(), - resourceGroupName, - name, - vnetName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a Virtual Network associated with an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param vnetName Name of the Virtual Network. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Virtual Network associated with an App Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getVnetFromServerFarmWithResponseAsync( - String resourceGroupName, String name, String vnetName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (vnetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vnetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getVnetFromServerFarm( - this.client.getEndpoint(), - resourceGroupName, - name, - vnetName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Get a Virtual Network associated with an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param vnetName Name of the Virtual Network. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Virtual Network associated with an App Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getVnetFromServerFarmAsync(String resourceGroupName, String name, String vnetName) { - return getVnetFromServerFarmWithResponseAsync(resourceGroupName, name, vnetName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get a Virtual Network associated with an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param vnetName Name of the Virtual Network. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Virtual Network associated with an App Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VnetInfoInner getVnetFromServerFarm(String resourceGroupName, String name, String vnetName) { - return getVnetFromServerFarmAsync(resourceGroupName, name, vnetName).block(); - } - - /** - * Get a Virtual Network associated with an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param vnetName Name of the Virtual Network. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Virtual Network associated with an App Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getVnetFromServerFarmWithResponse( - String resourceGroupName, String name, String vnetName, Context context) { - return getVnetFromServerFarmWithResponseAsync(resourceGroupName, name, vnetName, context).block(); - } - - /** - * Get a Virtual Network gateway. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param vnetName Name of the Virtual Network. - * @param gatewayName Name of the gateway. Only the 'primary' gateway is supported. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Virtual Network gateway. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getVnetGatewayWithResponseAsync( - String resourceGroupName, String name, String vnetName, String gatewayName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (vnetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vnetName is required and cannot be null.")); - } - if (gatewayName == null) { - return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getVnetGateway( - this.client.getEndpoint(), - resourceGroupName, - name, - vnetName, - gatewayName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a Virtual Network gateway. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param vnetName Name of the Virtual Network. - * @param gatewayName Name of the gateway. Only the 'primary' gateway is supported. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Virtual Network gateway. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getVnetGatewayWithResponseAsync( - String resourceGroupName, String name, String vnetName, String gatewayName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (vnetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vnetName is required and cannot be null.")); - } - if (gatewayName == null) { - return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getVnetGateway( - this.client.getEndpoint(), - resourceGroupName, - name, - vnetName, - gatewayName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Get a Virtual Network gateway. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param vnetName Name of the Virtual Network. - * @param gatewayName Name of the gateway. Only the 'primary' gateway is supported. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Virtual Network gateway. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getVnetGatewayAsync( - String resourceGroupName, String name, String vnetName, String gatewayName) { - return getVnetGatewayWithResponseAsync(resourceGroupName, name, vnetName, gatewayName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get a Virtual Network gateway. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param vnetName Name of the Virtual Network. - * @param gatewayName Name of the gateway. Only the 'primary' gateway is supported. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Virtual Network gateway. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VnetGatewayInner getVnetGateway(String resourceGroupName, String name, String vnetName, String gatewayName) { - return getVnetGatewayAsync(resourceGroupName, name, vnetName, gatewayName).block(); - } - - /** - * Get a Virtual Network gateway. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param vnetName Name of the Virtual Network. - * @param gatewayName Name of the gateway. Only the 'primary' gateway is supported. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Virtual Network gateway. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getVnetGatewayWithResponse( - String resourceGroupName, String name, String vnetName, String gatewayName, Context context) { - return getVnetGatewayWithResponseAsync(resourceGroupName, name, vnetName, gatewayName, context).block(); - } - - /** - * Update a Virtual Network gateway. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param vnetName Name of the Virtual Network. - * @param gatewayName Name of the gateway. Only the 'primary' gateway is supported. - * @param connectionEnvelope Definition of the gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Virtual Network gateway contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateVnetGatewayWithResponseAsync( - String resourceGroupName, - String name, - String vnetName, - String gatewayName, - VnetGatewayInner connectionEnvelope) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (vnetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vnetName is required and cannot be null.")); - } - if (gatewayName == null) { - return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (connectionEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter connectionEnvelope is required and cannot be null.")); - } else { - connectionEnvelope.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updateVnetGateway( - this.client.getEndpoint(), - resourceGroupName, - name, - vnetName, - gatewayName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - connectionEnvelope, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Update a Virtual Network gateway. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param vnetName Name of the Virtual Network. - * @param gatewayName Name of the gateway. Only the 'primary' gateway is supported. - * @param connectionEnvelope Definition of the gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Virtual Network gateway contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateVnetGatewayWithResponseAsync( - String resourceGroupName, - String name, - String vnetName, - String gatewayName, - VnetGatewayInner connectionEnvelope, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (vnetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vnetName is required and cannot be null.")); - } - if (gatewayName == null) { - return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (connectionEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter connectionEnvelope is required and cannot be null.")); - } else { - connectionEnvelope.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updateVnetGateway( - this.client.getEndpoint(), - resourceGroupName, - name, - vnetName, - gatewayName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - connectionEnvelope, - accept, - context); - } - - /** - * Update a Virtual Network gateway. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param vnetName Name of the Virtual Network. - * @param gatewayName Name of the gateway. Only the 'primary' gateway is supported. - * @param connectionEnvelope Definition of the gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Virtual Network gateway contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateVnetGatewayAsync( - String resourceGroupName, - String name, - String vnetName, - String gatewayName, - VnetGatewayInner connectionEnvelope) { - return updateVnetGatewayWithResponseAsync(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Update a Virtual Network gateway. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param vnetName Name of the Virtual Network. - * @param gatewayName Name of the gateway. Only the 'primary' gateway is supported. - * @param connectionEnvelope Definition of the gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Virtual Network gateway contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VnetGatewayInner updateVnetGateway( - String resourceGroupName, - String name, - String vnetName, - String gatewayName, - VnetGatewayInner connectionEnvelope) { - return updateVnetGatewayAsync(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope).block(); - } - - /** - * Update a Virtual Network gateway. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param vnetName Name of the Virtual Network. - * @param gatewayName Name of the gateway. Only the 'primary' gateway is supported. - * @param connectionEnvelope Definition of the gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Virtual Network gateway contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateVnetGatewayWithResponse( - String resourceGroupName, - String name, - String vnetName, - String gatewayName, - VnetGatewayInner connectionEnvelope, - Context context) { - return updateVnetGatewayWithResponseAsync( - resourceGroupName, name, vnetName, gatewayName, connectionEnvelope, context) - .block(); - } - - /** - * Get all routes that are associated with a Virtual Network in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param vnetName Name of the Virtual Network. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all routes that are associated with a Virtual Network in an App Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> listRoutesForVnetWithResponseAsync( - String resourceGroupName, String name, String vnetName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (vnetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vnetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listRoutesForVnet( - this.client.getEndpoint(), - resourceGroupName, - name, - vnetName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get all routes that are associated with a Virtual Network in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param vnetName Name of the Virtual Network. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all routes that are associated with a Virtual Network in an App Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> listRoutesForVnetWithResponseAsync( - String resourceGroupName, String name, String vnetName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (vnetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vnetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listRoutesForVnet( - this.client.getEndpoint(), - resourceGroupName, - name, - vnetName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Get all routes that are associated with a Virtual Network in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param vnetName Name of the Virtual Network. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all routes that are associated with a Virtual Network in an App Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listRoutesForVnetAsync(String resourceGroupName, String name, String vnetName) { - return listRoutesForVnetWithResponseAsync(resourceGroupName, name, vnetName) - .flatMap( - (Response> res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get all routes that are associated with a Virtual Network in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param vnetName Name of the Virtual Network. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all routes that are associated with a Virtual Network in an App Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public List listRoutesForVnet(String resourceGroupName, String name, String vnetName) { - return listRoutesForVnetAsync(resourceGroupName, name, vnetName).block(); - } - - /** - * Get all routes that are associated with a Virtual Network in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param vnetName Name of the Virtual Network. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all routes that are associated with a Virtual Network in an App Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response> listRoutesForVnetWithResponse( - String resourceGroupName, String name, String vnetName, Context context) { - return listRoutesForVnetWithResponseAsync(resourceGroupName, name, vnetName, context).block(); - } - - /** - * Get a Virtual Network route in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param vnetName Name of the Virtual Network. - * @param routeName Name of the Virtual Network route. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Virtual Network route in an App Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> getRouteForVnetWithResponseAsync( - String resourceGroupName, String name, String vnetName, String routeName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (vnetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vnetName is required and cannot be null.")); - } - if (routeName == null) { - return Mono.error(new IllegalArgumentException("Parameter routeName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getRouteForVnet( - this.client.getEndpoint(), - resourceGroupName, - name, - vnetName, - routeName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a Virtual Network route in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param vnetName Name of the Virtual Network. - * @param routeName Name of the Virtual Network route. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Virtual Network route in an App Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> getRouteForVnetWithResponseAsync( - String resourceGroupName, String name, String vnetName, String routeName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (vnetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vnetName is required and cannot be null.")); - } - if (routeName == null) { - return Mono.error(new IllegalArgumentException("Parameter routeName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getRouteForVnet( - this.client.getEndpoint(), - resourceGroupName, - name, - vnetName, - routeName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Get a Virtual Network route in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param vnetName Name of the Virtual Network. - * @param routeName Name of the Virtual Network route. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Virtual Network route in an App Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getRouteForVnetAsync( - String resourceGroupName, String name, String vnetName, String routeName) { - return getRouteForVnetWithResponseAsync(resourceGroupName, name, vnetName, routeName) - .flatMap( - (Response> res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get a Virtual Network route in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param vnetName Name of the Virtual Network. - * @param routeName Name of the Virtual Network route. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Virtual Network route in an App Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public List getRouteForVnet( - String resourceGroupName, String name, String vnetName, String routeName) { - return getRouteForVnetAsync(resourceGroupName, name, vnetName, routeName).block(); - } - - /** - * Get a Virtual Network route in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param vnetName Name of the Virtual Network. - * @param routeName Name of the Virtual Network route. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Virtual Network route in an App Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response> getRouteForVnetWithResponse( - String resourceGroupName, String name, String vnetName, String routeName, Context context) { - return getRouteForVnetWithResponseAsync(resourceGroupName, name, vnetName, routeName, context).block(); - } - - /** - * Create or update a Virtual Network route in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param vnetName Name of the Virtual Network. - * @param routeName Name of the Virtual Network route. - * @param route Definition of the Virtual Network route. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network route contract used to pass routing information for a Virtual Network. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateVnetRouteWithResponseAsync( - String resourceGroupName, String name, String vnetName, String routeName, VnetRouteInner route) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (vnetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vnetName is required and cannot be null.")); - } - if (routeName == null) { - return Mono.error(new IllegalArgumentException("Parameter routeName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (route == null) { - return Mono.error(new IllegalArgumentException("Parameter route is required and cannot be null.")); - } else { - route.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdateVnetRoute( - this.client.getEndpoint(), - resourceGroupName, - name, - vnetName, - routeName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - route, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create or update a Virtual Network route in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param vnetName Name of the Virtual Network. - * @param routeName Name of the Virtual Network route. - * @param route Definition of the Virtual Network route. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network route contract used to pass routing information for a Virtual Network. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateVnetRouteWithResponseAsync( - String resourceGroupName, - String name, - String vnetName, - String routeName, - VnetRouteInner route, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (vnetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vnetName is required and cannot be null.")); - } - if (routeName == null) { - return Mono.error(new IllegalArgumentException("Parameter routeName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (route == null) { - return Mono.error(new IllegalArgumentException("Parameter route is required and cannot be null.")); - } else { - route.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdateVnetRoute( - this.client.getEndpoint(), - resourceGroupName, - name, - vnetName, - routeName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - route, - accept, - context); - } - - /** - * Create or update a Virtual Network route in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param vnetName Name of the Virtual Network. - * @param routeName Name of the Virtual Network route. - * @param route Definition of the Virtual Network route. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network route contract used to pass routing information for a Virtual Network. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateVnetRouteAsync( - String resourceGroupName, String name, String vnetName, String routeName, VnetRouteInner route) { - return createOrUpdateVnetRouteWithResponseAsync(resourceGroupName, name, vnetName, routeName, route) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Create or update a Virtual Network route in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param vnetName Name of the Virtual Network. - * @param routeName Name of the Virtual Network route. - * @param route Definition of the Virtual Network route. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network route contract used to pass routing information for a Virtual Network. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VnetRouteInner createOrUpdateVnetRoute( - String resourceGroupName, String name, String vnetName, String routeName, VnetRouteInner route) { - return createOrUpdateVnetRouteAsync(resourceGroupName, name, vnetName, routeName, route).block(); - } - - /** - * Create or update a Virtual Network route in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param vnetName Name of the Virtual Network. - * @param routeName Name of the Virtual Network route. - * @param route Definition of the Virtual Network route. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network route contract used to pass routing information for a Virtual Network. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateVnetRouteWithResponse( - String resourceGroupName, - String name, - String vnetName, - String routeName, - VnetRouteInner route, - Context context) { - return createOrUpdateVnetRouteWithResponseAsync(resourceGroupName, name, vnetName, routeName, route, context) - .block(); - } - - /** - * Delete a Virtual Network route in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param vnetName Name of the Virtual Network. - * @param routeName Name of the Virtual Network route. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteVnetRouteWithResponseAsync( - String resourceGroupName, String name, String vnetName, String routeName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (vnetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vnetName is required and cannot be null.")); - } - if (routeName == null) { - return Mono.error(new IllegalArgumentException("Parameter routeName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .deleteVnetRoute( - this.client.getEndpoint(), - resourceGroupName, - name, - vnetName, - routeName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete a Virtual Network route in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param vnetName Name of the Virtual Network. - * @param routeName Name of the Virtual Network route. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteVnetRouteWithResponseAsync( - String resourceGroupName, String name, String vnetName, String routeName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (vnetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vnetName is required and cannot be null.")); - } - if (routeName == null) { - return Mono.error(new IllegalArgumentException("Parameter routeName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .deleteVnetRoute( - this.client.getEndpoint(), - resourceGroupName, - name, - vnetName, - routeName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Delete a Virtual Network route in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param vnetName Name of the Virtual Network. - * @param routeName Name of the Virtual Network route. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteVnetRouteAsync(String resourceGroupName, String name, String vnetName, String routeName) { - return deleteVnetRouteWithResponseAsync(resourceGroupName, name, vnetName, routeName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Delete a Virtual Network route in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param vnetName Name of the Virtual Network. - * @param routeName Name of the Virtual Network route. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteVnetRoute(String resourceGroupName, String name, String vnetName, String routeName) { - deleteVnetRouteAsync(resourceGroupName, name, vnetName, routeName).block(); - } - - /** - * Delete a Virtual Network route in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param vnetName Name of the Virtual Network. - * @param routeName Name of the Virtual Network route. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteVnetRouteWithResponse( - String resourceGroupName, String name, String vnetName, String routeName, Context context) { - return deleteVnetRouteWithResponseAsync(resourceGroupName, name, vnetName, routeName, context).block(); - } - - /** - * Create or update a Virtual Network route in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param vnetName Name of the Virtual Network. - * @param routeName Name of the Virtual Network route. - * @param route Definition of the Virtual Network route. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network route contract used to pass routing information for a Virtual Network. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateVnetRouteWithResponseAsync( - String resourceGroupName, String name, String vnetName, String routeName, VnetRouteInner route) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (vnetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vnetName is required and cannot be null.")); - } - if (routeName == null) { - return Mono.error(new IllegalArgumentException("Parameter routeName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (route == null) { - return Mono.error(new IllegalArgumentException("Parameter route is required and cannot be null.")); - } else { - route.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updateVnetRoute( - this.client.getEndpoint(), - resourceGroupName, - name, - vnetName, - routeName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - route, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create or update a Virtual Network route in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param vnetName Name of the Virtual Network. - * @param routeName Name of the Virtual Network route. - * @param route Definition of the Virtual Network route. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network route contract used to pass routing information for a Virtual Network. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateVnetRouteWithResponseAsync( - String resourceGroupName, - String name, - String vnetName, - String routeName, - VnetRouteInner route, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (vnetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vnetName is required and cannot be null.")); - } - if (routeName == null) { - return Mono.error(new IllegalArgumentException("Parameter routeName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (route == null) { - return Mono.error(new IllegalArgumentException("Parameter route is required and cannot be null.")); - } else { - route.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updateVnetRoute( - this.client.getEndpoint(), - resourceGroupName, - name, - vnetName, - routeName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - route, - accept, - context); - } - - /** - * Create or update a Virtual Network route in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param vnetName Name of the Virtual Network. - * @param routeName Name of the Virtual Network route. - * @param route Definition of the Virtual Network route. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network route contract used to pass routing information for a Virtual Network. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateVnetRouteAsync( - String resourceGroupName, String name, String vnetName, String routeName, VnetRouteInner route) { - return updateVnetRouteWithResponseAsync(resourceGroupName, name, vnetName, routeName, route) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Create or update a Virtual Network route in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param vnetName Name of the Virtual Network. - * @param routeName Name of the Virtual Network route. - * @param route Definition of the Virtual Network route. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network route contract used to pass routing information for a Virtual Network. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VnetRouteInner updateVnetRoute( - String resourceGroupName, String name, String vnetName, String routeName, VnetRouteInner route) { - return updateVnetRouteAsync(resourceGroupName, name, vnetName, routeName, route).block(); - } - - /** - * Create or update a Virtual Network route in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param vnetName Name of the Virtual Network. - * @param routeName Name of the Virtual Network route. - * @param route Definition of the Virtual Network route. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network route contract used to pass routing information for a Virtual Network. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateVnetRouteWithResponse( - String resourceGroupName, - String name, - String vnetName, - String routeName, - VnetRouteInner route, - Context context) { - return updateVnetRouteWithResponseAsync(resourceGroupName, name, vnetName, routeName, route, context).block(); - } - - /** - * Reboot a worker machine in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param workerName Name of worker machine, which typically starts with RD. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> rebootWorkerWithResponseAsync( - String resourceGroupName, String name, String workerName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (workerName == null) { - return Mono.error(new IllegalArgumentException("Parameter workerName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .rebootWorker( - this.client.getEndpoint(), - resourceGroupName, - name, - workerName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Reboot a worker machine in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param workerName Name of worker machine, which typically starts with RD. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> rebootWorkerWithResponseAsync( - String resourceGroupName, String name, String workerName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (workerName == null) { - return Mono.error(new IllegalArgumentException("Parameter workerName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .rebootWorker( - this.client.getEndpoint(), - resourceGroupName, - name, - workerName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Reboot a worker machine in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param workerName Name of worker machine, which typically starts with RD. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono rebootWorkerAsync(String resourceGroupName, String name, String workerName) { - return rebootWorkerWithResponseAsync(resourceGroupName, name, workerName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Reboot a worker machine in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param workerName Name of worker machine, which typically starts with RD. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void rebootWorker(String resourceGroupName, String name, String workerName) { - rebootWorkerAsync(resourceGroupName, name, workerName).block(); - } - - /** - * Reboot a worker machine in an App Service plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param workerName Name of worker machine, which typically starts with RD. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response rebootWorkerWithResponse( - String resourceGroupName, String name, String workerName, Context context) { - return rebootWorkerWithResponseAsync(resourceGroupName, name, workerName, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service plans. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service plans. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service plans. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service plans. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWebAppsByHybridConnectionNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service.listWebAppsByHybridConnectionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWebAppsByHybridConnectionNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listWebAppsByHybridConnectionNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of hostname bindings. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listHybridConnectionsNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listHybridConnectionsNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of hostname bindings. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listHybridConnectionsNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listHybridConnectionsNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of metric definitions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listMetricDefintionsNextSinglePageAsync( - String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listMetricDefintionsNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of metric definitions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listMetricDefintionsNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listMetricDefintionsNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of metric responses. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listMetricsNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listMetricsNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of metric responses. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listMetricsNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listMetricsNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWebAppsNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listWebAppsNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWebAppsNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listWebAppsNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of CSM usage quotas. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listUsagesNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listUsagesNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of CSM usage quotas. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listUsagesNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listUsagesNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/AppServicePlansImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/AppServicePlansImpl.java deleted file mode 100644 index e410dde60865..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/AppServicePlansImpl.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.resourcemanager.appservice.AppServiceManager; -import com.azure.resourcemanager.appservice.models.AppServicePlan; -import com.azure.resourcemanager.appservice.models.AppServicePlans; -import com.azure.resourcemanager.appservice.fluent.models.AppServicePlanInner; -import com.azure.resourcemanager.appservice.fluent.AppServicePlansClient; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.TopLevelModifiableResourcesImpl; - -/** The implementation for AppServicePlans. */ -public class AppServicePlansImpl - extends TopLevelModifiableResourcesImpl< - AppServicePlan, AppServicePlanImpl, AppServicePlanInner, AppServicePlansClient, AppServiceManager> - implements AppServicePlans { - - public AppServicePlansImpl(AppServiceManager manager) { - super(manager.serviceClient().getAppServicePlans(), manager); - } - - @Override - protected AppServicePlanImpl wrapModel(String name) { - return new AppServicePlanImpl(name, new AppServicePlanInner(), this.manager()); - } - - @Override - protected AppServicePlanImpl wrapModel(AppServicePlanInner inner) { - if (inner == null) { - return null; - } - return new AppServicePlanImpl(inner.name(), inner, this.manager()); - } - - @Override - public AppServicePlanImpl define(String name) { - return wrapModel(name); - } - - @Override - public PagedFlux listAsync() { - return wrapPageAsync(inner().listAsync(true)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/AppSettingImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/AppSettingImpl.java deleted file mode 100644 index d9f1371aa56d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/AppSettingImpl.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.implementation; - -import com.azure.resourcemanager.appservice.models.AppSetting; - -/** An immutable client-side representation of an app setting on a web app. */ -class AppSettingImpl implements AppSetting { - private String key; - private String value; - private boolean sticky; - - AppSettingImpl(String key, String value, boolean sticky) { - this.key = key; - this.value = value; - this.sticky = sticky; - } - - @Override - public String key() { - return key; - } - - @Override - public String value() { - return value; - } - - @Override - public boolean sticky() { - return sticky; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/CertificateRegistrationProvidersClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/CertificateRegistrationProvidersClientImpl.java deleted file mode 100644 index 85f115ea3b5c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/CertificateRegistrationProvidersClientImpl.java +++ /dev/null @@ -1,279 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.CertificateRegistrationProvidersClient; -import com.azure.resourcemanager.appservice.fluent.models.CsmOperationDescriptionInner; -import com.azure.resourcemanager.appservice.models.CsmOperationCollection; -import com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in CertificateRegistrationProvidersClient. - */ -public final class CertificateRegistrationProvidersClientImpl implements CertificateRegistrationProvidersClient { - private final ClientLogger logger = new ClientLogger(CertificateRegistrationProvidersClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final CertificateRegistrationProvidersService service; - - /** The service client containing this operation class. */ - private final WebSiteManagementClientImpl client; - - /** - * Initializes an instance of CertificateRegistrationProvidersClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - CertificateRegistrationProvidersClientImpl(WebSiteManagementClientImpl client) { - this.service = - RestProxy - .create( - CertificateRegistrationProvidersService.class, - client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for WebSiteManagementClientCertificateRegistrationProviders to be used by - * the proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "WebSiteManagementCli") - private interface CertificateRegistrationProvidersService { - @Headers({"Content-Type: application/json"}) - @Get("/providers/Microsoft.CertificateRegistration/operations") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listOperations( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listOperationsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Implements Csm operations Api to exposes the list of available Csm Apis under the resource provider. - * - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Azure resource manager operation metadata. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listOperationsSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service.listOperations(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Implements Csm operations Api to exposes the list of available Csm Apis under the resource provider. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Azure resource manager operation metadata. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listOperationsSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listOperations(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Implements Csm operations Api to exposes the list of available Csm Apis under the resource provider. - * - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Azure resource manager operation metadata. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listOperationsAsync() { - return new PagedFlux<>( - () -> listOperationsSinglePageAsync(), nextLink -> listOperationsNextSinglePageAsync(nextLink)); - } - - /** - * Implements Csm operations Api to exposes the list of available Csm Apis under the resource provider. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Azure resource manager operation metadata. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listOperationsAsync(Context context) { - return new PagedFlux<>( - () -> listOperationsSinglePageAsync(context), - nextLink -> listOperationsNextSinglePageAsync(nextLink, context)); - } - - /** - * Implements Csm operations Api to exposes the list of available Csm Apis under the resource provider. - * - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Azure resource manager operation metadata. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listOperations() { - return new PagedIterable<>(listOperationsAsync()); - } - - /** - * Implements Csm operations Api to exposes the list of available Csm Apis under the resource provider. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Azure resource manager operation metadata. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listOperations(Context context) { - return new PagedIterable<>(listOperationsAsync(context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Azure resource manager operation metadata. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listOperationsNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listOperationsNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Azure resource manager operation metadata. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listOperationsNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listOperationsNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/CertificatesClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/CertificatesClientImpl.java deleted file mode 100644 index 0144ff1a4005..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/CertificatesClientImpl.java +++ /dev/null @@ -1,1247 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.CertificatesClient; -import com.azure.resourcemanager.appservice.fluent.models.CertificateInner; -import com.azure.resourcemanager.appservice.models.CertificateCollection; -import com.azure.resourcemanager.appservice.models.CertificatePatchResource; -import com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in CertificatesClient. */ -public final class CertificatesClientImpl - implements InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete, - CertificatesClient { - private final ClientLogger logger = new ClientLogger(CertificatesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final CertificatesService service; - - /** The service client containing this operation class. */ - private final WebSiteManagementClientImpl client; - - /** - * Initializes an instance of CertificatesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - CertificatesClientImpl(WebSiteManagementClientImpl client) { - this.service = - RestProxy.create(CertificatesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for WebSiteManagementClientCertificates to be used by the proxy service - * to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "WebSiteManagementCli") - private interface CertificatesService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Web/certificates") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/certificates") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/certificates" - + "/{name}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/certificates" - + "/{name}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") CertificateInner certificateEnvelope, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/certificates" - + "/{name}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/certificates" - + "/{name}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> update( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") CertificatePatchResource certificateEnvelope, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Get all certificates for a subscription. - * - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all certificates for a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get all certificates for a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all certificates for a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get all certificates for a subscription. - * - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all certificates for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Get all certificates for a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all certificates for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Get all certificates for a subscription. - * - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all certificates for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Get all certificates for a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all certificates for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Get all certificates in a resource group. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all certificates in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get all certificates in a resource group. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all certificates in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get all certificates in a resource group. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all certificates in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * Get all certificates in a resource group. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all certificates in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * Get all certificates in a resource group. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all certificates in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * Get all certificates in a resource group. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all certificates in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * Get a certificate. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the certificate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a certificate. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a certificate. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the certificate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a certificate. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Get a certificate. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the certificate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a certificate. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync(String resourceGroupName, String name) { - return getByResourceGroupWithResponseAsync(resourceGroupName, name) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get a certificate. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the certificate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a certificate. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CertificateInner getByResourceGroup(String resourceGroupName, String name) { - return getByResourceGroupAsync(resourceGroupName, name).block(); - } - - /** - * Get a certificate. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the certificate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a certificate. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String name, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); - } - - /** - * Create or update a certificate. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the certificate. - * @param certificateEnvelope Details of certificate, if it exists already. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sSL certificate for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String name, CertificateInner certificateEnvelope) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (certificateEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter certificateEnvelope is required and cannot be null.")); - } else { - certificateEnvelope.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - certificateEnvelope, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create or update a certificate. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the certificate. - * @param certificateEnvelope Details of certificate, if it exists already. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sSL certificate for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String name, CertificateInner certificateEnvelope, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (certificateEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter certificateEnvelope is required and cannot be null.")); - } else { - certificateEnvelope.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - certificateEnvelope, - accept, - context); - } - - /** - * Create or update a certificate. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the certificate. - * @param certificateEnvelope Details of certificate, if it exists already. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sSL certificate for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, String name, CertificateInner certificateEnvelope) { - return createOrUpdateWithResponseAsync(resourceGroupName, name, certificateEnvelope) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Create or update a certificate. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the certificate. - * @param certificateEnvelope Details of certificate, if it exists already. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sSL certificate for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CertificateInner createOrUpdate( - String resourceGroupName, String name, CertificateInner certificateEnvelope) { - return createOrUpdateAsync(resourceGroupName, name, certificateEnvelope).block(); - } - - /** - * Create or update a certificate. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the certificate. - * @param certificateEnvelope Details of certificate, if it exists already. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sSL certificate for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceGroupName, String name, CertificateInner certificateEnvelope, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, name, certificateEnvelope, context).block(); - } - - /** - * Delete a certificate. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the certificate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete a certificate. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the certificate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Delete a certificate. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the certificate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String name) { - return deleteWithResponseAsync(resourceGroupName, name).flatMap((Response res) -> Mono.empty()); - } - - /** - * Delete a certificate. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the certificate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String name) { - deleteAsync(resourceGroupName, name).block(); - } - - /** - * Delete a certificate. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the certificate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String name, Context context) { - return deleteWithResponseAsync(resourceGroupName, name, context).block(); - } - - /** - * Create or update a certificate. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the certificate. - * @param certificateEnvelope Details of certificate, if it exists already. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sSL certificate for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateWithResponseAsync( - String resourceGroupName, String name, CertificatePatchResource certificateEnvelope) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (certificateEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter certificateEnvelope is required and cannot be null.")); - } else { - certificateEnvelope.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - certificateEnvelope, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create or update a certificate. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the certificate. - * @param certificateEnvelope Details of certificate, if it exists already. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sSL certificate for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, String name, CertificatePatchResource certificateEnvelope, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (certificateEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter certificateEnvelope is required and cannot be null.")); - } else { - certificateEnvelope.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - certificateEnvelope, - accept, - context); - } - - /** - * Create or update a certificate. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the certificate. - * @param certificateEnvelope Details of certificate, if it exists already. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sSL certificate for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync( - String resourceGroupName, String name, CertificatePatchResource certificateEnvelope) { - return updateWithResponseAsync(resourceGroupName, name, certificateEnvelope) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Create or update a certificate. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the certificate. - * @param certificateEnvelope Details of certificate, if it exists already. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sSL certificate for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CertificateInner update( - String resourceGroupName, String name, CertificatePatchResource certificateEnvelope) { - return updateAsync(resourceGroupName, name, certificateEnvelope).block(); - } - - /** - * Create or update a certificate. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the certificate. - * @param certificateEnvelope Details of certificate, if it exists already. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sSL certificate for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, String name, CertificatePatchResource certificateEnvelope, Context context) { - return updateWithResponseAsync(resourceGroupName, name, certificateEnvelope, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of certificates. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of certificates. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of certificates. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of certificates. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/ConnectionStringImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/ConnectionStringImpl.java deleted file mode 100644 index e2986709ac0f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/ConnectionStringImpl.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.implementation; - -import com.azure.resourcemanager.appservice.models.ConnStringValueTypePair; -import com.azure.resourcemanager.appservice.models.ConnectionString; -import com.azure.resourcemanager.appservice.models.ConnectionStringType; - -/** An immutable client-side representation of a connection string on a web app. */ -public class ConnectionStringImpl implements ConnectionString { - private String name; - private ConnStringValueTypePair valueTypePair; - private boolean sticky; - - ConnectionStringImpl(String name, ConnStringValueTypePair valueTypePair, boolean sticky) { - this.name = name; - this.valueTypePair = valueTypePair; - this.sticky = sticky; - } - - @Override - public String name() { - return name; - } - - @Override - public String value() { - return valueTypePair.value(); - } - - @Override - public ConnectionStringType type() { - return valueTypePair.type(); - } - - @Override - public boolean sticky() { - return sticky; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/DeletedWebAppsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/DeletedWebAppsClientImpl.java deleted file mode 100644 index 4fcc3f09ca65..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/DeletedWebAppsClientImpl.java +++ /dev/null @@ -1,707 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.DeletedWebAppsClient; -import com.azure.resourcemanager.appservice.fluent.models.DeletedSiteInner; -import com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException; -import com.azure.resourcemanager.appservice.models.DeletedWebAppCollection; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in DeletedWebAppsClient. */ -public final class DeletedWebAppsClientImpl implements DeletedWebAppsClient { - private final ClientLogger logger = new ClientLogger(DeletedWebAppsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final DeletedWebAppsService service; - - /** The service client containing this operation class. */ - private final WebSiteManagementClientImpl client; - - /** - * Initializes an instance of DeletedWebAppsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - DeletedWebAppsClientImpl(WebSiteManagementClientImpl client) { - this.service = - RestProxy.create(DeletedWebAppsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for WebSiteManagementClientDeletedWebApps to be used by the proxy service - * to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "WebSiteManagementCli") - private interface DeletedWebAppsService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Web/deletedSites") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Web/locations/{location}/deletedSites") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listByLocation( - @HostParam("$host") String endpoint, - @PathParam("location") String location, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/providers/Microsoft.Web/locations/{location}/deletedSites/{deletedSiteId}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getDeletedWebAppByLocation( - @HostParam("$host") String endpoint, - @PathParam("location") String location, - @PathParam("deletedSiteId") String deletedSiteId, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listByLocationNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Get all deleted apps for a subscription. - * - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deleted apps for a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get all deleted apps for a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deleted apps for a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get all deleted apps for a subscription. - * - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deleted apps for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Get all deleted apps for a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deleted apps for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Get all deleted apps for a subscription. - * - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deleted apps for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Get all deleted apps for a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deleted apps for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Get all deleted apps for a subscription at location. - * - * @param location The location parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deleted apps for a subscription at location. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByLocationSinglePageAsync(String location) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByLocation( - this.client.getEndpoint(), - location, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get all deleted apps for a subscription at location. - * - * @param location The location parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deleted apps for a subscription at location. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByLocationSinglePageAsync(String location, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByLocation( - this.client.getEndpoint(), - location, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get all deleted apps for a subscription at location. - * - * @param location The location parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deleted apps for a subscription at location. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByLocationAsync(String location) { - return new PagedFlux<>( - () -> listByLocationSinglePageAsync(location), nextLink -> listByLocationNextSinglePageAsync(nextLink)); - } - - /** - * Get all deleted apps for a subscription at location. - * - * @param location The location parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deleted apps for a subscription at location. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByLocationAsync(String location, Context context) { - return new PagedFlux<>( - () -> listByLocationSinglePageAsync(location, context), - nextLink -> listByLocationNextSinglePageAsync(nextLink, context)); - } - - /** - * Get all deleted apps for a subscription at location. - * - * @param location The location parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deleted apps for a subscription at location. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByLocation(String location) { - return new PagedIterable<>(listByLocationAsync(location)); - } - - /** - * Get all deleted apps for a subscription at location. - * - * @param location The location parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deleted apps for a subscription at location. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByLocation(String location, Context context) { - return new PagedIterable<>(listByLocationAsync(location, context)); - } - - /** - * Get deleted app for a subscription at location. - * - * @param location The location parameter. - * @param deletedSiteId The numeric ID of the deleted app, e.g. 12345. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deleted app for a subscription at location. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getDeletedWebAppByLocationWithResponseAsync( - String location, String deletedSiteId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (deletedSiteId == null) { - return Mono.error(new IllegalArgumentException("Parameter deletedSiteId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getDeletedWebAppByLocation( - this.client.getEndpoint(), - location, - deletedSiteId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get deleted app for a subscription at location. - * - * @param location The location parameter. - * @param deletedSiteId The numeric ID of the deleted app, e.g. 12345. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deleted app for a subscription at location. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getDeletedWebAppByLocationWithResponseAsync( - String location, String deletedSiteId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (deletedSiteId == null) { - return Mono.error(new IllegalArgumentException("Parameter deletedSiteId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getDeletedWebAppByLocation( - this.client.getEndpoint(), - location, - deletedSiteId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Get deleted app for a subscription at location. - * - * @param location The location parameter. - * @param deletedSiteId The numeric ID of the deleted app, e.g. 12345. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deleted app for a subscription at location. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getDeletedWebAppByLocationAsync(String location, String deletedSiteId) { - return getDeletedWebAppByLocationWithResponseAsync(location, deletedSiteId) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get deleted app for a subscription at location. - * - * @param location The location parameter. - * @param deletedSiteId The numeric ID of the deleted app, e.g. 12345. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deleted app for a subscription at location. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DeletedSiteInner getDeletedWebAppByLocation(String location, String deletedSiteId) { - return getDeletedWebAppByLocationAsync(location, deletedSiteId).block(); - } - - /** - * Get deleted app for a subscription at location. - * - * @param location The location parameter. - * @param deletedSiteId The numeric ID of the deleted app, e.g. 12345. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deleted app for a subscription at location. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getDeletedWebAppByLocationWithResponse( - String location, String deletedSiteId, Context context) { - return getDeletedWebAppByLocationWithResponseAsync(location, deletedSiteId, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of deleted apps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of deleted apps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of deleted apps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByLocationNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByLocationNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of deleted apps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByLocationNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByLocationNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/DeploymentSlotBaseImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/DeploymentSlotBaseImpl.java deleted file mode 100644 index 22fe5393877b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/DeploymentSlotBaseImpl.java +++ /dev/null @@ -1,546 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.implementation; - -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.appservice.models.AppSetting; -import com.azure.resourcemanager.appservice.models.ConnectionString; -import com.azure.resourcemanager.appservice.models.CsmPublishingProfileOptions; -import com.azure.resourcemanager.appservice.models.CsmSlotEntity; -import com.azure.resourcemanager.appservice.models.DeploymentSlotBase; -import com.azure.resourcemanager.appservice.models.HostnameBinding; -import com.azure.resourcemanager.appservice.models.MSDeploy; -import com.azure.resourcemanager.appservice.models.PublishingProfile; -import com.azure.resourcemanager.appservice.models.WebAppBase; -import com.azure.resourcemanager.appservice.models.WebAppSourceControl; -import com.azure.resourcemanager.appservice.fluent.models.ConnectionStringDictionaryInner; -import com.azure.resourcemanager.appservice.fluent.models.IdentifierInner; -import com.azure.resourcemanager.appservice.fluent.models.MSDeployStatusInner; -import com.azure.resourcemanager.appservice.fluent.models.SiteAuthSettingsInner; -import com.azure.resourcemanager.appservice.fluent.models.SiteConfigResourceInner; -import com.azure.resourcemanager.appservice.fluent.models.SiteInner; -import com.azure.resourcemanager.appservice.fluent.models.SiteLogsConfigInner; -import com.azure.resourcemanager.appservice.fluent.models.SitePatchResourceInner; -import com.azure.resourcemanager.appservice.fluent.models.SiteSourceControlInner; -import com.azure.resourcemanager.appservice.fluent.models.SlotConfigNamesResourceInner; -import com.azure.resourcemanager.appservice.fluent.models.StringDictionaryInner; -import com.azure.resourcemanager.resources.fluentcore.model.Indexable; -import java.nio.charset.StandardCharsets; -import java.util.Collections; -import java.util.Map; -import java.util.function.Function; -import java.util.stream.Collectors; - -import reactor.core.publisher.Mono; -import com.azure.resourcemanager.resources.fluentcore.utils.PagedConverter; - -/** The implementation for DeploymentSlot. */ -abstract class DeploymentSlotBaseImpl< - FluentT extends WebAppBase, - FluentImplT extends DeploymentSlotBaseImpl, - ParentImplT extends AppServiceBaseImpl, - FluentWithCreateT, - FluentUpdateT> - extends WebAppBaseImpl - implements DeploymentSlotBase, DeploymentSlotBase.Update { - private final ParentImplT parent; - private final String name; - WebAppBase configurationSource; - - DeploymentSlotBaseImpl( - String name, - SiteInner innerObject, - SiteConfigResourceInner siteConfig, - SiteLogsConfigInner logConfig, - final ParentImplT parent) { - super(name.replaceAll(".*/", ""), innerObject, siteConfig, logConfig, parent.manager()); - this.name = name.replaceAll(".*/", ""); - this.parent = parent; - innerModel().withServerFarmId(parent.appServicePlanId()); - innerModel().withLocation(regionName()); - } - - @Override - public String name() { - return name; - } - - @Override - public Map getHostnameBindings() { - return getHostnameBindingsAsync().block(); - } - - @Override - @SuppressWarnings("unchecked") - public Mono> getHostnameBindingsAsync() { - return PagedConverter.mapPage(this - .manager() - .serviceClient() - .getWebApps() - .listHostnameBindingsSlotAsync(resourceGroupName(), parent().name(), name()), - hostNameBindingInner -> - new HostnameBindingImpl( - hostNameBindingInner, (FluentImplT) DeploymentSlotBaseImpl.this)) - .collectList() - .map( - hostNameBindings -> - Collections - .unmodifiableMap( - hostNameBindings - .stream() - .collect( - Collectors - .toMap( - binding -> binding.name().replace(name() + "/", ""), - Function.identity())))); - } - - @Override - public PublishingProfile getPublishingProfile() { - return getPublishingProfileAsync().block(); - } - - public Mono getPublishingProfileAsync() { - return FluxUtil - .collectBytesInByteBufferStream( - manager() - .serviceClient() - .getWebApps() - .listPublishingProfileXmlWithSecretsSlotAsync( - resourceGroupName(), this.parent().name(), name(), new CsmPublishingProfileOptions())) - .map(bytes -> new PublishingProfileImpl(new String(bytes, StandardCharsets.UTF_8), this)); - } - - @Override - public void start() { - startAsync().block(); - } - - @Override - public Mono startAsync() { - return manager() - .serviceClient() - .getWebApps() - .startSlotAsync(resourceGroupName(), this.parent().name(), name()) - .then(refreshAsync()) - .then(Mono.empty()); - } - - @Override - public void stop() { - stopAsync().block(); - } - - @Override - public Mono stopAsync() { - return manager() - .serviceClient() - .getWebApps() - .stopSlotAsync(resourceGroupName(), this.parent().name(), name()) - .then(refreshAsync()) - .then(Mono.empty()); - } - - @Override - public void restart() { - restartAsync().block(); - } - - @Override - public Mono restartAsync() { - return manager() - .serviceClient() - .getWebApps() - .restartSlotAsync(resourceGroupName(), this.parent().name(), name()) - .then(refreshAsync()) - .then(Mono.empty()); - } - - @SuppressWarnings("unchecked") - public FluentImplT withBrandNewConfiguration() { - this.siteConfig = null; - return (FluentImplT) this; - } - - @SuppressWarnings("unchecked") - public FluentImplT withConfigurationFromDeploymentSlot(FluentT slot) { - this.siteConfig = ((WebAppBaseImpl) slot).siteConfig; - configurationSource = slot; - return (FluentImplT) this; - } - - Mono submitAppSettings() { - return Mono - .justOrEmpty(configurationSource) - .flatMap( - webAppBase -> { - if (!isInCreateMode()) { - return DeploymentSlotBaseImpl.super.submitAppSettings(); - } - return webAppBase - .getAppSettingsAsync() - .flatMap( - stringAppSettingMap -> { - for (AppSetting appSetting : stringAppSettingMap.values()) { - if (appSetting.sticky()) { - withStickyAppSetting(appSetting.key(), appSetting.value()); - } else { - withAppSetting(appSetting.key(), appSetting.value()); - } - } - return DeploymentSlotBaseImpl.super.submitAppSettings(); - }); - }) - .switchIfEmpty(DeploymentSlotBaseImpl.super.submitAppSettings()); - } - - Mono submitConnectionStrings() { - return Mono - .justOrEmpty(configurationSource) - .flatMap( - webAppBase -> { - if (!isInCreateMode()) { - return DeploymentSlotBaseImpl.super.submitConnectionStrings(); - } - return webAppBase - .getConnectionStringsAsync() - .flatMap( - stringConnectionStringMap -> { - for (ConnectionString connectionString : stringConnectionStringMap.values()) { - if (connectionString.sticky()) { - withStickyConnectionString( - connectionString.name(), connectionString.value(), - connectionString.type()); - } else { - withConnectionString( - connectionString.name(), connectionString.value(), - connectionString.type()); - } - } - return DeploymentSlotBaseImpl.super.submitConnectionStrings(); - }); - }) - .switchIfEmpty(DeploymentSlotBaseImpl.super.submitConnectionStrings()); - } - - public ParentImplT parent() { - return this.parent; - } - - @Override - Mono createOrUpdateInner(SiteInner site) { - return manager() - .serviceClient() - .getWebApps() - .createOrUpdateSlotAsync(resourceGroupName(), this.parent().name(), name(), site); - } - - @Override - Mono updateInner(SitePatchResourceInner siteUpdate) { - return manager() - .serviceClient() - .getWebApps() - .updateSlotAsync(resourceGroupName(), this.parent().name(), name(), siteUpdate); - } - - @Override - Mono getInner() { - return manager().serviceClient().getWebApps().getSlotAsync(resourceGroupName(), this.parent().name(), name()); - } - - @Override - Mono getConfigInner() { - return manager().serviceClient().getWebApps() - .getConfigurationSlotAsync(resourceGroupName(), parent().name(), name()); - } - - @Override - Mono createOrUpdateSiteConfig(SiteConfigResourceInner siteConfig) { - return manager() - .serviceClient() - .getWebApps() - .createOrUpdateConfigurationSlotAsync(resourceGroupName(), this.parent().name(), name(), siteConfig); - } - - @Override - Mono deleteHostnameBinding(String hostname) { - return manager() - .serviceClient() - .getWebApps() - .deleteHostnameBindingSlotAsync(resourceGroupName(), parent().name(), name(), hostname); - } - - @Override - Mono listAppSettings() { - return manager() - .serviceClient() - .getWebApps() - .listApplicationSettingsSlotAsync(resourceGroupName(), parent().name(), name()); - } - - @Override - Mono updateAppSettings(StringDictionaryInner inner) { - return manager() - .serviceClient() - .getWebApps() - .updateApplicationSettingsSlotAsync(resourceGroupName(), parent().name(), name(), inner); - } - - @Override - Mono listConnectionStrings() { - return manager().serviceClient().getWebApps() - .listConnectionStringsSlotAsync(resourceGroupName(), parent().name(), name()); - } - - @Override - Mono updateConnectionStrings(ConnectionStringDictionaryInner inner) { - return manager() - .serviceClient() - .getWebApps() - .updateConnectionStringsSlotAsync(resourceGroupName(), parent().name(), name(), inner); - } - - @Override - Mono listSlotConfigurations() { - return manager().serviceClient().getWebApps() - .listSlotConfigurationNamesAsync(resourceGroupName(), parent().name()); - } - - @Override - Mono updateSlotConfigurations(SlotConfigNamesResourceInner inner) { - return manager() - .serviceClient() - .getWebApps() - .updateSlotConfigurationNamesAsync(resourceGroupName(), parent().name(), inner); - } - - @Override - Mono createOrUpdateSourceControl(SiteSourceControlInner inner) { - return manager() - .serviceClient() - .getWebApps() - .createOrUpdateSourceControlSlotAsync(resourceGroupName(), parent().name(), name(), inner); - } - - @Override - public void swap(String slotName) { - swapAsync(slotName).block(); - } - - @Override - public Mono swapAsync(String slotName) { - return manager() - .serviceClient() - .getWebApps() - .swapSlotAsync( - resourceGroupName(), this.parent().name(), name(), new CsmSlotEntity().withTargetSlot(slotName)) - .then(refreshAsync()) - .then(Mono.empty()); - } - - @Override - public void applySlotConfigurations(String slotName) { - applySlotConfigurationsAsync(slotName).block(); - } - - @Override - public Mono applySlotConfigurationsAsync(String slotName) { - return manager() - .serviceClient() - .getWebApps() - .applySlotConfigurationSlotAsync( - resourceGroupName(), this.parent().name(), name(), new CsmSlotEntity().withTargetSlot(slotName)) - .then(refreshAsync()) - .then(Mono.empty()); - } - - @Override - public void resetSlotConfigurations() { - resetSlotConfigurationsAsync().block(); - } - - @Override - public Mono resetSlotConfigurationsAsync() { - return manager() - .serviceClient() - .getWebApps() - .resetSlotConfigurationSlotAsync(resourceGroupName(), this.parent().name(), name()) - .then(refreshAsync()) - .then(Mono.empty()); - } - - @Override - Mono deleteSourceControl() { - return manager() - .serviceClient() - .getWebApps() - .deleteSourceControlSlotAsync(resourceGroupName(), parent().name(), name()) - .then(refreshAsync()) - .then(Mono.empty()); - } - - @Override - Mono updateAuthentication(SiteAuthSettingsInner inner) { - return manager() - .serviceClient() - .getWebApps() - .updateAuthSettingsSlotAsync(resourceGroupName(), parent().name(), name(), inner); - } - - @Override - Mono getAuthentication() { - return manager().serviceClient().getWebApps() - .getAuthSettingsSlotAsync(resourceGroupName(), parent().name(), name()); - } - - @Override - Mono createMSDeploy(MSDeploy msDeployInner) { - return parent() - .manager() - .serviceClient() - .getWebApps() - .createMSDeployOperationAsync(parent().resourceGroupName(), parent().name(), msDeployInner); - } - - @Override - public WebAppSourceControl getSourceControl() { - return getSourceControlAsync().block(); - } - - @Override - public Mono getSourceControlAsync() { - return manager() - .serviceClient() - .getWebApps() - .getSourceControlSlotAsync(resourceGroupName(), parent().name(), name()) - .map( - siteSourceControlInner -> - new WebAppSourceControlImpl<>(siteSourceControlInner, DeploymentSlotBaseImpl.this)); - } - - @Override - public byte[] getContainerLogs() { - return getContainerLogsAsync().block(); - } - - @Override - public Mono getContainerLogsAsync() { - return FluxUtil - .collectBytesInByteBufferStream( - manager() - .serviceClient() - .getWebApps() - .getWebSiteContainerLogsSlotAsync(resourceGroupName(), parent().name(), name())); - } - - @Override - public byte[] getContainerLogsZip() { - return getContainerLogsZipAsync().block(); - } - - @Override - public Mono getContainerLogsZipAsync() { - return FluxUtil - .collectBytesInByteBufferStream( - manager().serviceClient().getWebApps() - .getContainerLogsZipSlotAsync(resourceGroupName(), parent().name(), name())); - } - - @Override - Mono updateDiagnosticLogsConfig(SiteLogsConfigInner siteLogsConfigInner) { - return manager() - .serviceClient() - .getWebApps() - .updateDiagnosticLogsConfigSlotAsync(resourceGroupName(), parent().name(), name(), siteLogsConfigInner); - } - - @Override - public void verifyDomainOwnership(String certificateOrderName, String domainVerificationToken) { - verifyDomainOwnershipAsync(certificateOrderName, domainVerificationToken).block(); - } - - @Override - public Mono verifyDomainOwnershipAsync(String certificateOrderName, String domainVerificationToken) { - IdentifierInner identifierInner = new IdentifierInner().withValue(domainVerificationToken); - return manager() - .serviceClient() - .getWebApps() - .createOrUpdateDomainOwnershipIdentifierSlotAsync( - resourceGroupName(), parent().name(), name(), certificateOrderName, identifierInner) - .then(Mono.empty()); - } - - @Override - public FluentImplT withRuntime(String runtime) { - return withAppSetting(SETTING_FUNCTIONS_WORKER_RUNTIME, runtime); - } - - @Override - public FluentImplT withRuntimeVersion(String version) { - return withAppSetting(SETTING_FUNCTIONS_EXTENSION_VERSION, version.startsWith("~") ? version : "~" + version); - } - - @Override - public FluentImplT withLatestRuntimeVersion() { - return withRuntimeVersion("latest"); - } - - @Override - public FluentImplT withPublicDockerHubImage(String imageAndTag) { - cleanUpContainerSettings(); - if (siteConfig == null) { - siteConfig = new SiteConfigResourceInner(); - } - setAppFrameworkVersion(String.format("DOCKER|%s", imageAndTag)); - return withAppSetting(SETTING_DOCKER_IMAGE, imageAndTag); - } - - @Override - public FluentImplT withPrivateDockerHubImage(String imageAndTag) { - return withPublicDockerHubImage(imageAndTag); - } - - @Override - public FluentImplT withPrivateRegistryImage(String imageAndTag, String serverUrl) { - imageAndTag = Utils.smartCompletionPrivateRegistryImage(imageAndTag, serverUrl); - - cleanUpContainerSettings(); - if (siteConfig == null) { - siteConfig = new SiteConfigResourceInner(); - } - setAppFrameworkVersion(String.format("DOCKER|%s", imageAndTag)); - withAppSetting(SETTING_DOCKER_IMAGE, imageAndTag); - return withAppSetting(SETTING_REGISTRY_SERVER, serverUrl); - } - - @Override - public FluentImplT withCredentials(String username, String password) { - withAppSetting(SETTING_REGISTRY_USERNAME, username); - return withAppSetting(SETTING_REGISTRY_PASSWORD, password); - } - - @Override - @SuppressWarnings("unchecked") - public FluentImplT withStartUpCommand(String startUpCommand) { - if (siteConfig == null) { - siteConfig = new SiteConfigResourceInner(); - } - siteConfig.withAppCommandLine(startUpCommand); - return (FluentImplT) this; - } - - protected void cleanUpContainerSettings() { - if (siteConfig != null && siteConfig.linuxFxVersion() != null) { - siteConfig.withLinuxFxVersion(null); - } - if (siteConfig != null && siteConfig.windowsFxVersion() != null) { - siteConfig.withWindowsFxVersion(null); - } - // Docker Hub - withoutAppSetting(SETTING_DOCKER_IMAGE); - withoutAppSetting(SETTING_REGISTRY_SERVER); - withoutAppSetting(SETTING_REGISTRY_USERNAME); - withoutAppSetting(SETTING_REGISTRY_PASSWORD); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/DeploymentSlotImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/DeploymentSlotImpl.java deleted file mode 100644 index ad82bb6ac690..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/DeploymentSlotImpl.java +++ /dev/null @@ -1,175 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.implementation; - -import com.azure.resourcemanager.appservice.models.DeployOptions; -import com.azure.resourcemanager.appservice.models.DeployType; -import com.azure.resourcemanager.appservice.models.DeploymentSlot; -import com.azure.resourcemanager.appservice.models.DeploymentSlotBase; -import com.azure.resourcemanager.appservice.models.WebApp; -import com.azure.resourcemanager.appservice.fluent.models.SiteConfigResourceInner; -import com.azure.resourcemanager.appservice.fluent.models.SiteInner; -import com.azure.resourcemanager.appservice.fluent.models.SiteLogsConfigInner; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.util.Objects; - -import reactor.core.publisher.Mono; - -/** The implementation for DeploymentSlot. */ -class DeploymentSlotImpl - extends DeploymentSlotBaseImpl< - DeploymentSlot, - DeploymentSlotImpl, - WebAppImpl, - DeploymentSlot.DefinitionStages.WithCreate, - DeploymentSlotBase.Update> - implements DeploymentSlot, DeploymentSlot.Definition { - - DeploymentSlotImpl( - String name, - SiteInner innerObject, - SiteConfigResourceInner siteConfig, - SiteLogsConfigInner logConfig, - WebAppImpl parent) { - super(name, innerObject, siteConfig, logConfig, parent); - } - - @Override - public DeploymentSlotImpl withConfigurationFromParent() { - return withConfigurationFromWebApp(this.parent()); - } - - @Override - public DeploymentSlotImpl withConfigurationFromWebApp(WebApp webApp) { - this.siteConfig = ((WebAppBaseImpl) webApp).siteConfig; - configurationSource = webApp; - return this; - } - - @Override - public Mono warDeployAsync(File warFile) { - return warDeployAsync(warFile, null); - } - - @Override - public void warDeploy(File warFile) { - warDeployAsync(warFile).block(); - } - - @Override - public Mono warDeployAsync(InputStream warFile, long length) { - return warDeployAsync(warFile, length, null); - } - - @Override - public void warDeploy(InputStream warFile, long length) { - warDeployAsync(warFile, length).block(); - } - - @Override - public Mono warDeployAsync(File warFile, String appName) { - try { - return kuduClient.warDeployAsync(warFile, appName); - } catch (IOException e) { - return Mono.error(e); - } - } - - @Override - public void warDeploy(File warFile, String appName) { - warDeployAsync(warFile, appName).block(); - } - - @Override - public Mono warDeployAsync(InputStream warFile, long length, String appName) { - return kuduClient.warDeployAsync(warFile, length, appName); - } - - @Override - public void warDeploy(InputStream warFile, long length, String appName) { - warDeployAsync(warFile, length, appName).block(); - } - - @Override - public void zipDeploy(File zipFile) { - zipDeployAsync(zipFile).block(); - } - - @Override - public void zipDeploy(InputStream zipFile, long length) { - zipDeployAsync(zipFile, length).block(); - } - - @Override - public Mono zipDeployAsync(InputStream zipFile, long length) { - return kuduClient.zipDeployAsync(zipFile, length).then(stopAsync()).then(startAsync()); - } - - @Override - public Mono zipDeployAsync(File zipFile) { - try { - return kuduClient.zipDeployAsync(zipFile); - } catch (IOException e) { - return Mono.error(e); - } - } - - @Override - public void deploy(DeployType type, File file) { - deployAsync(type, file).block(); - } - - @Override - public Mono deployAsync(DeployType type, File file) { - return deployAsync(type, file, new DeployOptions()); - } - - @Override - public void deploy(DeployType type, File file, DeployOptions deployOptions) { - deployAsync(type, file, deployOptions).block(); - } - - @Override - public Mono deployAsync(DeployType type, File file, DeployOptions deployOptions) { - Objects.requireNonNull(type); - Objects.requireNonNull(file); - if (deployOptions == null) { - deployOptions = new DeployOptions(); - } - try { - return kuduClient.deployAsync(type, file, - deployOptions.path(), deployOptions.restartSite(), deployOptions.cleanDeployment()); - } catch (IOException e) { - return Mono.error(e); - } - } - - @Override - public void deploy(DeployType type, InputStream file, long length) { - deployAsync(type, file, length).block(); - } - - @Override - public Mono deployAsync(DeployType type, InputStream file, long length) { - return deployAsync(type, file, length, new DeployOptions()); - } - - @Override - public void deploy(DeployType type, InputStream file, long length, DeployOptions deployOptions) { - deployAsync(type, file, length, deployOptions).block(); - } - - @Override - public Mono deployAsync(DeployType type, InputStream file, long length, DeployOptions deployOptions) { - Objects.requireNonNull(type); - Objects.requireNonNull(file); - if (deployOptions == null) { - deployOptions = new DeployOptions(); - } - return kuduClient.deployAsync(type, file, length, - deployOptions.path(), deployOptions.restartSite(), deployOptions.cleanDeployment()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/DeploymentSlotsImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/DeploymentSlotsImpl.java deleted file mode 100644 index be6667dfebfe..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/DeploymentSlotsImpl.java +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.appservice.AppServiceManager; -import com.azure.resourcemanager.appservice.fluent.WebAppsClient; -import com.azure.resourcemanager.appservice.fluent.models.SiteConfigResourceInner; -import com.azure.resourcemanager.appservice.fluent.models.SiteInner; -import com.azure.resourcemanager.appservice.fluent.models.SiteLogsConfigInner; -import com.azure.resourcemanager.appservice.models.DeploymentSlot; -import com.azure.resourcemanager.appservice.models.DeploymentSlots; -import com.azure.resourcemanager.appservice.models.WebApp; -import com.azure.resourcemanager.appservice.models.WebDeploymentSlotBasic; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.IndependentChildResourcesImpl; -import reactor.core.publisher.Mono; -import com.azure.resourcemanager.resources.fluentcore.utils.PagedConverter; - -/** The implementation DeploymentSlots. */ -class DeploymentSlotsImpl - extends IndependentChildResourcesImpl< - DeploymentSlot, DeploymentSlotImpl, SiteInner, WebAppsClient, AppServiceManager, WebApp> - implements DeploymentSlots { - - private final WebAppImpl parent; - - DeploymentSlotsImpl(final WebAppImpl parent) { - super(parent.manager().serviceClient().getWebApps(), parent.manager()); - - this.parent = parent; - } - - @Override - protected DeploymentSlotImpl wrapModel(String name) { - return new DeploymentSlotImpl(name, new SiteInner(), null, null, parent) - .withRegion(parent.regionName()) - .withExistingResourceGroup(parent.resourceGroupName()); - } - - @Override - protected DeploymentSlotImpl wrapModel(SiteInner inner) { - return wrapModel(inner, null, null); - } - - @Override - public DeploymentSlotImpl define(String name) { - return wrapModel(name); - } - - @Override - public Mono getByParentAsync( - final String resourceGroup, final String parentName, final String name) { - return innerCollection - .getSlotAsync(resourceGroup, parentName, name) - .flatMap( - siteInner -> - Mono - .zip( - innerCollection.getConfigurationSlotAsync(resourceGroup, parentName, - name.replaceAll(".*/", "")), - innerCollection.getDiagnosticLogsConfigurationSlotAsync(resourceGroup, parentName, - name.replaceAll(".*/", "")), - (SiteConfigResourceInner siteConfigResourceInner, SiteLogsConfigInner logsConfigInner) -> - wrapModel(siteInner, siteConfigResourceInner, logsConfigInner))); - } - - @Override - public PagedIterable listByParent(String resourceGroupName, String parentName) { - return new PagedIterable<>(wrapPageAsync(innerCollection.listSlotsAsync(resourceGroupName, parentName))); - } - - @Override - public Mono deleteByParentAsync(String groupName, String parentName, String name) { - return innerCollection.deleteSlotAsync(groupName, parentName, name); - } - - @Override - public void deleteByName(String name) { - deleteByParent(parent.resourceGroupName(), parent.name(), name); - } - - @Override - public Mono deleteByNameAsync(String name) { - return deleteByParentAsync(parent.resourceGroupName(), parent.name(), name); - } - - @Override - public PagedIterable list() { - return new PagedIterable<>(this.listAsync()); - } - - @Override - public DeploymentSlot getByName(String name) { - return getByParent(parent.resourceGroupName(), parent.name(), name); - } - - @Override - public Mono getByNameAsync(String name) { - return getByParentAsync(parent.resourceGroupName(), parent.name(), name); - } - - @Override - public WebApp parent() { - return this.parent; - } - - @Override - public PagedFlux listAsync() { - return PagedConverter.mapPage(innerCollection.listSlotsAsync(parent.resourceGroupName(), parent.name()), - inner -> new WebDeploymentSlotBasicImpl(inner, parent)); - } - - private DeploymentSlotImpl wrapModel( - SiteInner inner, SiteConfigResourceInner siteConfig, SiteLogsConfigInner logConfig) { - if (inner == null) { - return null; - } - return new DeploymentSlotImpl(inner.name(), inner, siteConfig, logConfig, parent); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/DiagnosticsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/DiagnosticsClientImpl.java deleted file mode 100644 index 5c51f5f878a8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/DiagnosticsClientImpl.java +++ /dev/null @@ -1,6164 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.DiagnosticsClient; -import com.azure.resourcemanager.appservice.fluent.models.AnalysisDefinitionInner; -import com.azure.resourcemanager.appservice.fluent.models.DetectorDefinitionInner; -import com.azure.resourcemanager.appservice.fluent.models.DetectorResponseInner; -import com.azure.resourcemanager.appservice.fluent.models.DiagnosticAnalysisInner; -import com.azure.resourcemanager.appservice.fluent.models.DiagnosticCategoryInner; -import com.azure.resourcemanager.appservice.fluent.models.DiagnosticDetectorResponseInner; -import com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException; -import com.azure.resourcemanager.appservice.models.DetectorResponseCollection; -import com.azure.resourcemanager.appservice.models.DiagnosticAnalysisCollection; -import com.azure.resourcemanager.appservice.models.DiagnosticCategoryCollection; -import com.azure.resourcemanager.appservice.models.DiagnosticDetectorCollection; -import java.time.OffsetDateTime; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in DiagnosticsClient. */ -public final class DiagnosticsClientImpl implements DiagnosticsClient { - private final ClientLogger logger = new ClientLogger(DiagnosticsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final DiagnosticsService service; - - /** The service client containing this operation class. */ - private final WebSiteManagementClientImpl client; - - /** - * Initializes an instance of DiagnosticsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - DiagnosticsClientImpl(WebSiteManagementClientImpl client) { - this.service = - RestProxy.create(DiagnosticsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for WebSiteManagementClientDiagnostics to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "WebSiteManagementCli") - private interface DiagnosticsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web" - + "/hostingEnvironments/{name}/detectors") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listHostingEnvironmentDetectorResponses( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web" - + "/hostingEnvironments/{name}/detectors/{detectorName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getHostingEnvironmentDetectorResponse( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("detectorName") String detectorName, - @QueryParam("startTime") OffsetDateTime startTime, - @QueryParam("endTime") OffsetDateTime endTime, - @QueryParam("timeGrain") String timeGrain, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites" - + "/{siteName}/detectors") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listSiteDetectorResponses( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("siteName") String siteName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites" - + "/{siteName}/detectors/{detectorName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getSiteDetectorResponse( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("siteName") String siteName, - @PathParam("detectorName") String detectorName, - @QueryParam("startTime") OffsetDateTime startTime, - @QueryParam("endTime") OffsetDateTime endTime, - @QueryParam("timeGrain") String timeGrain, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites" - + "/{siteName}/diagnostics") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listSiteDiagnosticCategories( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("siteName") String siteName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites" - + "/{siteName}/diagnostics/{diagnosticCategory}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getSiteDiagnosticCategory( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("siteName") String siteName, - @PathParam("diagnosticCategory") String diagnosticCategory, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites" - + "/{siteName}/diagnostics/{diagnosticCategory}/analyses") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listSiteAnalyses( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("siteName") String siteName, - @PathParam("diagnosticCategory") String diagnosticCategory, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites" - + "/{siteName}/diagnostics/{diagnosticCategory}/analyses/{analysisName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getSiteAnalysis( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("siteName") String siteName, - @PathParam("diagnosticCategory") String diagnosticCategory, - @PathParam("analysisName") String analysisName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites" - + "/{siteName}/diagnostics/{diagnosticCategory}/analyses/{analysisName}/execute") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> executeSiteAnalysis( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("siteName") String siteName, - @PathParam("diagnosticCategory") String diagnosticCategory, - @PathParam("analysisName") String analysisName, - @QueryParam("startTime") OffsetDateTime startTime, - @QueryParam("endTime") OffsetDateTime endTime, - @QueryParam("timeGrain") String timeGrain, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites" - + "/{siteName}/diagnostics/{diagnosticCategory}/detectors") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listSiteDetectors( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("siteName") String siteName, - @PathParam("diagnosticCategory") String diagnosticCategory, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites" - + "/{siteName}/diagnostics/{diagnosticCategory}/detectors/{detectorName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getSiteDetector( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("siteName") String siteName, - @PathParam("diagnosticCategory") String diagnosticCategory, - @PathParam("detectorName") String detectorName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites" - + "/{siteName}/diagnostics/{diagnosticCategory}/detectors/{detectorName}/execute") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> executeSiteDetector( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("siteName") String siteName, - @PathParam("detectorName") String detectorName, - @PathParam("diagnosticCategory") String diagnosticCategory, - @QueryParam("startTime") OffsetDateTime startTime, - @QueryParam("endTime") OffsetDateTime endTime, - @QueryParam("timeGrain") String timeGrain, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites" - + "/{siteName}/slots/{slot}/detectors") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listSiteDetectorResponsesSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("siteName") String siteName, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites" - + "/{siteName}/slots/{slot}/detectors/{detectorName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getSiteDetectorResponseSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("siteName") String siteName, - @PathParam("detectorName") String detectorName, - @PathParam("slot") String slot, - @QueryParam("startTime") OffsetDateTime startTime, - @QueryParam("endTime") OffsetDateTime endTime, - @QueryParam("timeGrain") String timeGrain, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites" - + "/{siteName}/slots/{slot}/diagnostics") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listSiteDiagnosticCategoriesSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("siteName") String siteName, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites" - + "/{siteName}/slots/{slot}/diagnostics/{diagnosticCategory}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getSiteDiagnosticCategorySlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("siteName") String siteName, - @PathParam("diagnosticCategory") String diagnosticCategory, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites" - + "/{siteName}/slots/{slot}/diagnostics/{diagnosticCategory}/analyses") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listSiteAnalysesSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("siteName") String siteName, - @PathParam("diagnosticCategory") String diagnosticCategory, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites" - + "/{siteName}/slots/{slot}/diagnostics/{diagnosticCategory}/analyses/{analysisName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getSiteAnalysisSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("siteName") String siteName, - @PathParam("diagnosticCategory") String diagnosticCategory, - @PathParam("analysisName") String analysisName, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites" - + "/{siteName}/slots/{slot}/diagnostics/{diagnosticCategory}/analyses/{analysisName}/execute") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> executeSiteAnalysisSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("siteName") String siteName, - @PathParam("diagnosticCategory") String diagnosticCategory, - @PathParam("analysisName") String analysisName, - @PathParam("slot") String slot, - @QueryParam("startTime") OffsetDateTime startTime, - @QueryParam("endTime") OffsetDateTime endTime, - @QueryParam("timeGrain") String timeGrain, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites" - + "/{siteName}/slots/{slot}/diagnostics/{diagnosticCategory}/detectors") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listSiteDetectorsSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("siteName") String siteName, - @PathParam("diagnosticCategory") String diagnosticCategory, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites" - + "/{siteName}/slots/{slot}/diagnostics/{diagnosticCategory}/detectors/{detectorName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getSiteDetectorSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("siteName") String siteName, - @PathParam("diagnosticCategory") String diagnosticCategory, - @PathParam("detectorName") String detectorName, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites" - + "/{siteName}/slots/{slot}/diagnostics/{diagnosticCategory}/detectors/{detectorName}/execute") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> executeSiteDetectorSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("siteName") String siteName, - @PathParam("detectorName") String detectorName, - @PathParam("diagnosticCategory") String diagnosticCategory, - @PathParam("slot") String slot, - @QueryParam("startTime") OffsetDateTime startTime, - @QueryParam("endTime") OffsetDateTime endTime, - @QueryParam("timeGrain") String timeGrain, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listHostingEnvironmentDetectorResponsesNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listSiteDetectorResponsesNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listSiteDiagnosticCategoriesNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listSiteAnalysesNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listSiteDetectorsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getSiteDetectorNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listSiteDetectorResponsesSlotNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listSiteDiagnosticCategoriesSlotNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listSiteAnalysesSlotNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listSiteDetectorsSlotNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getSiteDetectorSlotNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * List Hosting Environment Detector Responses. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of detector responses. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listHostingEnvironmentDetectorResponsesSinglePageAsync( - String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listHostingEnvironmentDetectorResponses( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List Hosting Environment Detector Responses. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of detector responses. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listHostingEnvironmentDetectorResponsesSinglePageAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listHostingEnvironmentDetectorResponses( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * List Hosting Environment Detector Responses. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of detector responses. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listHostingEnvironmentDetectorResponsesAsync( - String resourceGroupName, String name) { - return new PagedFlux<>( - () -> listHostingEnvironmentDetectorResponsesSinglePageAsync(resourceGroupName, name), - nextLink -> listHostingEnvironmentDetectorResponsesNextSinglePageAsync(nextLink)); - } - - /** - * List Hosting Environment Detector Responses. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of detector responses. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listHostingEnvironmentDetectorResponsesAsync( - String resourceGroupName, String name, Context context) { - return new PagedFlux<>( - () -> listHostingEnvironmentDetectorResponsesSinglePageAsync(resourceGroupName, name, context), - nextLink -> listHostingEnvironmentDetectorResponsesNextSinglePageAsync(nextLink, context)); - } - - /** - * List Hosting Environment Detector Responses. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of detector responses. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listHostingEnvironmentDetectorResponses( - String resourceGroupName, String name) { - return new PagedIterable<>(listHostingEnvironmentDetectorResponsesAsync(resourceGroupName, name)); - } - - /** - * List Hosting Environment Detector Responses. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of detector responses. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listHostingEnvironmentDetectorResponses( - String resourceGroupName, String name, Context context) { - return new PagedIterable<>(listHostingEnvironmentDetectorResponsesAsync(resourceGroupName, name, context)); - } - - /** - * Get Hosting Environment Detector Response. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name App Service Environment Name. - * @param detectorName Detector Resource Name. - * @param startTime Start Time. - * @param endTime End Time. - * @param timeGrain Time Grain. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hosting Environment Detector Response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getHostingEnvironmentDetectorResponseWithResponseAsync( - String resourceGroupName, - String name, - String detectorName, - OffsetDateTime startTime, - OffsetDateTime endTime, - String timeGrain) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (detectorName == null) { - return Mono.error(new IllegalArgumentException("Parameter detectorName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getHostingEnvironmentDetectorResponse( - this.client.getEndpoint(), - resourceGroupName, - name, - detectorName, - startTime, - endTime, - timeGrain, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get Hosting Environment Detector Response. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name App Service Environment Name. - * @param detectorName Detector Resource Name. - * @param startTime Start Time. - * @param endTime End Time. - * @param timeGrain Time Grain. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hosting Environment Detector Response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getHostingEnvironmentDetectorResponseWithResponseAsync( - String resourceGroupName, - String name, - String detectorName, - OffsetDateTime startTime, - OffsetDateTime endTime, - String timeGrain, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (detectorName == null) { - return Mono.error(new IllegalArgumentException("Parameter detectorName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getHostingEnvironmentDetectorResponse( - this.client.getEndpoint(), - resourceGroupName, - name, - detectorName, - startTime, - endTime, - timeGrain, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Get Hosting Environment Detector Response. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name App Service Environment Name. - * @param detectorName Detector Resource Name. - * @param startTime Start Time. - * @param endTime End Time. - * @param timeGrain Time Grain. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hosting Environment Detector Response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getHostingEnvironmentDetectorResponseAsync( - String resourceGroupName, - String name, - String detectorName, - OffsetDateTime startTime, - OffsetDateTime endTime, - String timeGrain) { - return getHostingEnvironmentDetectorResponseWithResponseAsync( - resourceGroupName, name, detectorName, startTime, endTime, timeGrain) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get Hosting Environment Detector Response. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name App Service Environment Name. - * @param detectorName Detector Resource Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hosting Environment Detector Response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getHostingEnvironmentDetectorResponseAsync( - String resourceGroupName, String name, String detectorName) { - final OffsetDateTime startTime = null; - final OffsetDateTime endTime = null; - final String timeGrain = null; - return getHostingEnvironmentDetectorResponseWithResponseAsync( - resourceGroupName, name, detectorName, startTime, endTime, timeGrain) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get Hosting Environment Detector Response. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name App Service Environment Name. - * @param detectorName Detector Resource Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hosting Environment Detector Response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DetectorResponseInner getHostingEnvironmentDetectorResponse( - String resourceGroupName, String name, String detectorName) { - final OffsetDateTime startTime = null; - final OffsetDateTime endTime = null; - final String timeGrain = null; - return getHostingEnvironmentDetectorResponseAsync( - resourceGroupName, name, detectorName, startTime, endTime, timeGrain) - .block(); - } - - /** - * Get Hosting Environment Detector Response. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name App Service Environment Name. - * @param detectorName Detector Resource Name. - * @param startTime Start Time. - * @param endTime End Time. - * @param timeGrain Time Grain. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hosting Environment Detector Response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getHostingEnvironmentDetectorResponseWithResponse( - String resourceGroupName, - String name, - String detectorName, - OffsetDateTime startTime, - OffsetDateTime endTime, - String timeGrain, - Context context) { - return getHostingEnvironmentDetectorResponseWithResponseAsync( - resourceGroupName, name, detectorName, startTime, endTime, timeGrain, context) - .block(); - } - - /** - * List Site Detector Responses. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of detector responses. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSiteDetectorResponsesSinglePageAsync( - String resourceGroupName, String siteName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (siteName == null) { - return Mono.error(new IllegalArgumentException("Parameter siteName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listSiteDetectorResponses( - this.client.getEndpoint(), - resourceGroupName, - siteName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List Site Detector Responses. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of detector responses. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSiteDetectorResponsesSinglePageAsync( - String resourceGroupName, String siteName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (siteName == null) { - return Mono.error(new IllegalArgumentException("Parameter siteName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listSiteDetectorResponses( - this.client.getEndpoint(), - resourceGroupName, - siteName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * List Site Detector Responses. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of detector responses. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listSiteDetectorResponsesAsync(String resourceGroupName, String siteName) { - return new PagedFlux<>( - () -> listSiteDetectorResponsesSinglePageAsync(resourceGroupName, siteName), - nextLink -> listSiteDetectorResponsesNextSinglePageAsync(nextLink)); - } - - /** - * List Site Detector Responses. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of detector responses. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listSiteDetectorResponsesAsync( - String resourceGroupName, String siteName, Context context) { - return new PagedFlux<>( - () -> listSiteDetectorResponsesSinglePageAsync(resourceGroupName, siteName, context), - nextLink -> listSiteDetectorResponsesNextSinglePageAsync(nextLink, context)); - } - - /** - * List Site Detector Responses. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of detector responses. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listSiteDetectorResponses(String resourceGroupName, String siteName) { - return new PagedIterable<>(listSiteDetectorResponsesAsync(resourceGroupName, siteName)); - } - - /** - * List Site Detector Responses. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of detector responses. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listSiteDetectorResponses( - String resourceGroupName, String siteName, Context context) { - return new PagedIterable<>(listSiteDetectorResponsesAsync(resourceGroupName, siteName, context)); - } - - /** - * Get site detector response. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param detectorName Detector Resource Name. - * @param startTime Start Time. - * @param endTime End Time. - * @param timeGrain Time Grain. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site detector response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getSiteDetectorResponseWithResponseAsync( - String resourceGroupName, - String siteName, - String detectorName, - OffsetDateTime startTime, - OffsetDateTime endTime, - String timeGrain) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (siteName == null) { - return Mono.error(new IllegalArgumentException("Parameter siteName is required and cannot be null.")); - } - if (detectorName == null) { - return Mono.error(new IllegalArgumentException("Parameter detectorName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getSiteDetectorResponse( - this.client.getEndpoint(), - resourceGroupName, - siteName, - detectorName, - startTime, - endTime, - timeGrain, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get site detector response. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param detectorName Detector Resource Name. - * @param startTime Start Time. - * @param endTime End Time. - * @param timeGrain Time Grain. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site detector response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getSiteDetectorResponseWithResponseAsync( - String resourceGroupName, - String siteName, - String detectorName, - OffsetDateTime startTime, - OffsetDateTime endTime, - String timeGrain, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (siteName == null) { - return Mono.error(new IllegalArgumentException("Parameter siteName is required and cannot be null.")); - } - if (detectorName == null) { - return Mono.error(new IllegalArgumentException("Parameter detectorName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getSiteDetectorResponse( - this.client.getEndpoint(), - resourceGroupName, - siteName, - detectorName, - startTime, - endTime, - timeGrain, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Get site detector response. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param detectorName Detector Resource Name. - * @param startTime Start Time. - * @param endTime End Time. - * @param timeGrain Time Grain. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site detector response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getSiteDetectorResponseAsync( - String resourceGroupName, - String siteName, - String detectorName, - OffsetDateTime startTime, - OffsetDateTime endTime, - String timeGrain) { - return getSiteDetectorResponseWithResponseAsync( - resourceGroupName, siteName, detectorName, startTime, endTime, timeGrain) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get site detector response. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param detectorName Detector Resource Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site detector response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getSiteDetectorResponseAsync( - String resourceGroupName, String siteName, String detectorName) { - final OffsetDateTime startTime = null; - final OffsetDateTime endTime = null; - final String timeGrain = null; - return getSiteDetectorResponseWithResponseAsync( - resourceGroupName, siteName, detectorName, startTime, endTime, timeGrain) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get site detector response. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param detectorName Detector Resource Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site detector response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DetectorResponseInner getSiteDetectorResponse( - String resourceGroupName, String siteName, String detectorName) { - final OffsetDateTime startTime = null; - final OffsetDateTime endTime = null; - final String timeGrain = null; - return getSiteDetectorResponseAsync(resourceGroupName, siteName, detectorName, startTime, endTime, timeGrain) - .block(); - } - - /** - * Get site detector response. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param detectorName Detector Resource Name. - * @param startTime Start Time. - * @param endTime End Time. - * @param timeGrain Time Grain. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site detector response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getSiteDetectorResponseWithResponse( - String resourceGroupName, - String siteName, - String detectorName, - OffsetDateTime startTime, - OffsetDateTime endTime, - String timeGrain, - Context context) { - return getSiteDetectorResponseWithResponseAsync( - resourceGroupName, siteName, detectorName, startTime, endTime, timeGrain, context) - .block(); - } - - /** - * Get Diagnostics Categories. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return diagnostics Categories. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSiteDiagnosticCategoriesSinglePageAsync( - String resourceGroupName, String siteName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (siteName == null) { - return Mono.error(new IllegalArgumentException("Parameter siteName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listSiteDiagnosticCategories( - this.client.getEndpoint(), - resourceGroupName, - siteName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get Diagnostics Categories. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return diagnostics Categories. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSiteDiagnosticCategoriesSinglePageAsync( - String resourceGroupName, String siteName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (siteName == null) { - return Mono.error(new IllegalArgumentException("Parameter siteName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listSiteDiagnosticCategories( - this.client.getEndpoint(), - resourceGroupName, - siteName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get Diagnostics Categories. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return diagnostics Categories. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listSiteDiagnosticCategoriesAsync( - String resourceGroupName, String siteName) { - return new PagedFlux<>( - () -> listSiteDiagnosticCategoriesSinglePageAsync(resourceGroupName, siteName), - nextLink -> listSiteDiagnosticCategoriesNextSinglePageAsync(nextLink)); - } - - /** - * Get Diagnostics Categories. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return diagnostics Categories. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listSiteDiagnosticCategoriesAsync( - String resourceGroupName, String siteName, Context context) { - return new PagedFlux<>( - () -> listSiteDiagnosticCategoriesSinglePageAsync(resourceGroupName, siteName, context), - nextLink -> listSiteDiagnosticCategoriesNextSinglePageAsync(nextLink, context)); - } - - /** - * Get Diagnostics Categories. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return diagnostics Categories. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listSiteDiagnosticCategories( - String resourceGroupName, String siteName) { - return new PagedIterable<>(listSiteDiagnosticCategoriesAsync(resourceGroupName, siteName)); - } - - /** - * Get Diagnostics Categories. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return diagnostics Categories. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listSiteDiagnosticCategories( - String resourceGroupName, String siteName, Context context) { - return new PagedIterable<>(listSiteDiagnosticCategoriesAsync(resourceGroupName, siteName, context)); - } - - /** - * Get Diagnostics Category. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return diagnostics Category. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getSiteDiagnosticCategoryWithResponseAsync( - String resourceGroupName, String siteName, String diagnosticCategory) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (siteName == null) { - return Mono.error(new IllegalArgumentException("Parameter siteName is required and cannot be null.")); - } - if (diagnosticCategory == null) { - return Mono - .error(new IllegalArgumentException("Parameter diagnosticCategory is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getSiteDiagnosticCategory( - this.client.getEndpoint(), - resourceGroupName, - siteName, - diagnosticCategory, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get Diagnostics Category. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return diagnostics Category. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getSiteDiagnosticCategoryWithResponseAsync( - String resourceGroupName, String siteName, String diagnosticCategory, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (siteName == null) { - return Mono.error(new IllegalArgumentException("Parameter siteName is required and cannot be null.")); - } - if (diagnosticCategory == null) { - return Mono - .error(new IllegalArgumentException("Parameter diagnosticCategory is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getSiteDiagnosticCategory( - this.client.getEndpoint(), - resourceGroupName, - siteName, - diagnosticCategory, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Get Diagnostics Category. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return diagnostics Category. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getSiteDiagnosticCategoryAsync( - String resourceGroupName, String siteName, String diagnosticCategory) { - return getSiteDiagnosticCategoryWithResponseAsync(resourceGroupName, siteName, diagnosticCategory) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get Diagnostics Category. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return diagnostics Category. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DiagnosticCategoryInner getSiteDiagnosticCategory( - String resourceGroupName, String siteName, String diagnosticCategory) { - return getSiteDiagnosticCategoryAsync(resourceGroupName, siteName, diagnosticCategory).block(); - } - - /** - * Get Diagnostics Category. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return diagnostics Category. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getSiteDiagnosticCategoryWithResponse( - String resourceGroupName, String siteName, String diagnosticCategory, Context context) { - return getSiteDiagnosticCategoryWithResponseAsync(resourceGroupName, siteName, diagnosticCategory, context) - .block(); - } - - /** - * Get Site Analyses. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Analyses. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSiteAnalysesSinglePageAsync( - String resourceGroupName, String siteName, String diagnosticCategory) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (siteName == null) { - return Mono.error(new IllegalArgumentException("Parameter siteName is required and cannot be null.")); - } - if (diagnosticCategory == null) { - return Mono - .error(new IllegalArgumentException("Parameter diagnosticCategory is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listSiteAnalyses( - this.client.getEndpoint(), - resourceGroupName, - siteName, - diagnosticCategory, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get Site Analyses. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Analyses. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSiteAnalysesSinglePageAsync( - String resourceGroupName, String siteName, String diagnosticCategory, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (siteName == null) { - return Mono.error(new IllegalArgumentException("Parameter siteName is required and cannot be null.")); - } - if (diagnosticCategory == null) { - return Mono - .error(new IllegalArgumentException("Parameter diagnosticCategory is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listSiteAnalyses( - this.client.getEndpoint(), - resourceGroupName, - siteName, - diagnosticCategory, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get Site Analyses. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Analyses. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listSiteAnalysesAsync( - String resourceGroupName, String siteName, String diagnosticCategory) { - return new PagedFlux<>( - () -> listSiteAnalysesSinglePageAsync(resourceGroupName, siteName, diagnosticCategory), - nextLink -> listSiteAnalysesNextSinglePageAsync(nextLink)); - } - - /** - * Get Site Analyses. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Analyses. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listSiteAnalysesAsync( - String resourceGroupName, String siteName, String diagnosticCategory, Context context) { - return new PagedFlux<>( - () -> listSiteAnalysesSinglePageAsync(resourceGroupName, siteName, diagnosticCategory, context), - nextLink -> listSiteAnalysesNextSinglePageAsync(nextLink, context)); - } - - /** - * Get Site Analyses. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Analyses. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listSiteAnalyses( - String resourceGroupName, String siteName, String diagnosticCategory) { - return new PagedIterable<>(listSiteAnalysesAsync(resourceGroupName, siteName, diagnosticCategory)); - } - - /** - * Get Site Analyses. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Analyses. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listSiteAnalyses( - String resourceGroupName, String siteName, String diagnosticCategory, Context context) { - return new PagedIterable<>(listSiteAnalysesAsync(resourceGroupName, siteName, diagnosticCategory, context)); - } - - /** - * Get Site Analysis. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @param analysisName Analysis Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Analysis. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getSiteAnalysisWithResponseAsync( - String resourceGroupName, String siteName, String diagnosticCategory, String analysisName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (siteName == null) { - return Mono.error(new IllegalArgumentException("Parameter siteName is required and cannot be null.")); - } - if (diagnosticCategory == null) { - return Mono - .error(new IllegalArgumentException("Parameter diagnosticCategory is required and cannot be null.")); - } - if (analysisName == null) { - return Mono.error(new IllegalArgumentException("Parameter analysisName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getSiteAnalysis( - this.client.getEndpoint(), - resourceGroupName, - siteName, - diagnosticCategory, - analysisName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get Site Analysis. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @param analysisName Analysis Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Analysis. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getSiteAnalysisWithResponseAsync( - String resourceGroupName, String siteName, String diagnosticCategory, String analysisName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (siteName == null) { - return Mono.error(new IllegalArgumentException("Parameter siteName is required and cannot be null.")); - } - if (diagnosticCategory == null) { - return Mono - .error(new IllegalArgumentException("Parameter diagnosticCategory is required and cannot be null.")); - } - if (analysisName == null) { - return Mono.error(new IllegalArgumentException("Parameter analysisName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getSiteAnalysis( - this.client.getEndpoint(), - resourceGroupName, - siteName, - diagnosticCategory, - analysisName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Get Site Analysis. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @param analysisName Analysis Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Analysis. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getSiteAnalysisAsync( - String resourceGroupName, String siteName, String diagnosticCategory, String analysisName) { - return getSiteAnalysisWithResponseAsync(resourceGroupName, siteName, diagnosticCategory, analysisName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get Site Analysis. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @param analysisName Analysis Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Analysis. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DiagnosticAnalysisInner getSiteAnalysis( - String resourceGroupName, String siteName, String diagnosticCategory, String analysisName) { - return getSiteAnalysisAsync(resourceGroupName, siteName, diagnosticCategory, analysisName).block(); - } - - /** - * Get Site Analysis. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @param analysisName Analysis Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Analysis. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getSiteAnalysisWithResponse( - String resourceGroupName, String siteName, String diagnosticCategory, String analysisName, Context context) { - return getSiteAnalysisWithResponseAsync(resourceGroupName, siteName, diagnosticCategory, analysisName, context) - .block(); - } - - /** - * Execute Analysis. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Category Name. - * @param analysisName Analysis Resource Name. - * @param startTime Start Time. - * @param endTime End Time. - * @param timeGrain Time Grain. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class representing a diagnostic analysis done on an application. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> executeSiteAnalysisWithResponseAsync( - String resourceGroupName, - String siteName, - String diagnosticCategory, - String analysisName, - OffsetDateTime startTime, - OffsetDateTime endTime, - String timeGrain) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (siteName == null) { - return Mono.error(new IllegalArgumentException("Parameter siteName is required and cannot be null.")); - } - if (diagnosticCategory == null) { - return Mono - .error(new IllegalArgumentException("Parameter diagnosticCategory is required and cannot be null.")); - } - if (analysisName == null) { - return Mono.error(new IllegalArgumentException("Parameter analysisName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .executeSiteAnalysis( - this.client.getEndpoint(), - resourceGroupName, - siteName, - diagnosticCategory, - analysisName, - startTime, - endTime, - timeGrain, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Execute Analysis. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Category Name. - * @param analysisName Analysis Resource Name. - * @param startTime Start Time. - * @param endTime End Time. - * @param timeGrain Time Grain. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class representing a diagnostic analysis done on an application. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> executeSiteAnalysisWithResponseAsync( - String resourceGroupName, - String siteName, - String diagnosticCategory, - String analysisName, - OffsetDateTime startTime, - OffsetDateTime endTime, - String timeGrain, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (siteName == null) { - return Mono.error(new IllegalArgumentException("Parameter siteName is required and cannot be null.")); - } - if (diagnosticCategory == null) { - return Mono - .error(new IllegalArgumentException("Parameter diagnosticCategory is required and cannot be null.")); - } - if (analysisName == null) { - return Mono.error(new IllegalArgumentException("Parameter analysisName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .executeSiteAnalysis( - this.client.getEndpoint(), - resourceGroupName, - siteName, - diagnosticCategory, - analysisName, - startTime, - endTime, - timeGrain, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Execute Analysis. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Category Name. - * @param analysisName Analysis Resource Name. - * @param startTime Start Time. - * @param endTime End Time. - * @param timeGrain Time Grain. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class representing a diagnostic analysis done on an application. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono executeSiteAnalysisAsync( - String resourceGroupName, - String siteName, - String diagnosticCategory, - String analysisName, - OffsetDateTime startTime, - OffsetDateTime endTime, - String timeGrain) { - return executeSiteAnalysisWithResponseAsync( - resourceGroupName, siteName, diagnosticCategory, analysisName, startTime, endTime, timeGrain) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Execute Analysis. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Category Name. - * @param analysisName Analysis Resource Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class representing a diagnostic analysis done on an application. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono executeSiteAnalysisAsync( - String resourceGroupName, String siteName, String diagnosticCategory, String analysisName) { - final OffsetDateTime startTime = null; - final OffsetDateTime endTime = null; - final String timeGrain = null; - return executeSiteAnalysisWithResponseAsync( - resourceGroupName, siteName, diagnosticCategory, analysisName, startTime, endTime, timeGrain) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Execute Analysis. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Category Name. - * @param analysisName Analysis Resource Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class representing a diagnostic analysis done on an application. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DiagnosticAnalysisInner executeSiteAnalysis( - String resourceGroupName, String siteName, String diagnosticCategory, String analysisName) { - final OffsetDateTime startTime = null; - final OffsetDateTime endTime = null; - final String timeGrain = null; - return executeSiteAnalysisAsync( - resourceGroupName, siteName, diagnosticCategory, analysisName, startTime, endTime, timeGrain) - .block(); - } - - /** - * Execute Analysis. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Category Name. - * @param analysisName Analysis Resource Name. - * @param startTime Start Time. - * @param endTime End Time. - * @param timeGrain Time Grain. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class representing a diagnostic analysis done on an application. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response executeSiteAnalysisWithResponse( - String resourceGroupName, - String siteName, - String diagnosticCategory, - String analysisName, - OffsetDateTime startTime, - OffsetDateTime endTime, - String timeGrain, - Context context) { - return executeSiteAnalysisWithResponseAsync( - resourceGroupName, siteName, diagnosticCategory, analysisName, startTime, endTime, timeGrain, context) - .block(); - } - - /** - * Get Detectors. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return detectors. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSiteDetectorsSinglePageAsync( - String resourceGroupName, String siteName, String diagnosticCategory) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (siteName == null) { - return Mono.error(new IllegalArgumentException("Parameter siteName is required and cannot be null.")); - } - if (diagnosticCategory == null) { - return Mono - .error(new IllegalArgumentException("Parameter diagnosticCategory is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listSiteDetectors( - this.client.getEndpoint(), - resourceGroupName, - siteName, - diagnosticCategory, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get Detectors. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return detectors. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSiteDetectorsSinglePageAsync( - String resourceGroupName, String siteName, String diagnosticCategory, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (siteName == null) { - return Mono.error(new IllegalArgumentException("Parameter siteName is required and cannot be null.")); - } - if (diagnosticCategory == null) { - return Mono - .error(new IllegalArgumentException("Parameter diagnosticCategory is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listSiteDetectors( - this.client.getEndpoint(), - resourceGroupName, - siteName, - diagnosticCategory, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get Detectors. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return detectors. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listSiteDetectorsAsync( - String resourceGroupName, String siteName, String diagnosticCategory) { - return new PagedFlux<>( - () -> listSiteDetectorsSinglePageAsync(resourceGroupName, siteName, diagnosticCategory), - nextLink -> listSiteDetectorsNextSinglePageAsync(nextLink)); - } - - /** - * Get Detectors. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return detectors. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listSiteDetectorsAsync( - String resourceGroupName, String siteName, String diagnosticCategory, Context context) { - return new PagedFlux<>( - () -> listSiteDetectorsSinglePageAsync(resourceGroupName, siteName, diagnosticCategory, context), - nextLink -> listSiteDetectorsNextSinglePageAsync(nextLink, context)); - } - - /** - * Get Detectors. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return detectors. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listSiteDetectors( - String resourceGroupName, String siteName, String diagnosticCategory) { - return new PagedIterable<>(listSiteDetectorsAsync(resourceGroupName, siteName, diagnosticCategory)); - } - - /** - * Get Detectors. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return detectors. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listSiteDetectors( - String resourceGroupName, String siteName, String diagnosticCategory, Context context) { - return new PagedIterable<>(listSiteDetectorsAsync(resourceGroupName, siteName, diagnosticCategory, context)); - } - - /** - * Get Detector. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @param detectorName Detector Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return detector. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getSiteDetectorSinglePageAsync( - String resourceGroupName, String siteName, String diagnosticCategory, String detectorName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (siteName == null) { - return Mono.error(new IllegalArgumentException("Parameter siteName is required and cannot be null.")); - } - if (diagnosticCategory == null) { - return Mono - .error(new IllegalArgumentException("Parameter diagnosticCategory is required and cannot be null.")); - } - if (detectorName == null) { - return Mono.error(new IllegalArgumentException("Parameter detectorName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getSiteDetector( - this.client.getEndpoint(), - resourceGroupName, - siteName, - diagnosticCategory, - detectorName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get Detector. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @param detectorName Detector Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return detector. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getSiteDetectorSinglePageAsync( - String resourceGroupName, String siteName, String diagnosticCategory, String detectorName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (siteName == null) { - return Mono.error(new IllegalArgumentException("Parameter siteName is required and cannot be null.")); - } - if (diagnosticCategory == null) { - return Mono - .error(new IllegalArgumentException("Parameter diagnosticCategory is required and cannot be null.")); - } - if (detectorName == null) { - return Mono.error(new IllegalArgumentException("Parameter detectorName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getSiteDetector( - this.client.getEndpoint(), - resourceGroupName, - siteName, - diagnosticCategory, - detectorName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get Detector. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @param detectorName Detector Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return detector. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux getSiteDetectorAsync( - String resourceGroupName, String siteName, String diagnosticCategory, String detectorName) { - return new PagedFlux<>( - () -> getSiteDetectorSinglePageAsync(resourceGroupName, siteName, diagnosticCategory, detectorName), - nextLink -> getSiteDetectorNextSinglePageAsync(nextLink)); - } - - /** - * Get Detector. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @param detectorName Detector Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return detector. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux getSiteDetectorAsync( - String resourceGroupName, String siteName, String diagnosticCategory, String detectorName, Context context) { - return new PagedFlux<>( - () -> - getSiteDetectorSinglePageAsync(resourceGroupName, siteName, diagnosticCategory, detectorName, context), - nextLink -> getSiteDetectorNextSinglePageAsync(nextLink, context)); - } - - /** - * Get Detector. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @param detectorName Detector Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return detector. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable getSiteDetector( - String resourceGroupName, String siteName, String diagnosticCategory, String detectorName) { - return new PagedIterable<>(getSiteDetectorAsync(resourceGroupName, siteName, diagnosticCategory, detectorName)); - } - - /** - * Get Detector. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @param detectorName Detector Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return detector. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable getSiteDetector( - String resourceGroupName, String siteName, String diagnosticCategory, String detectorName, Context context) { - return new PagedIterable<>( - getSiteDetectorAsync(resourceGroupName, siteName, diagnosticCategory, detectorName, context)); - } - - /** - * Execute Detector. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param detectorName Detector Resource Name. - * @param diagnosticCategory Category Name. - * @param startTime Start Time. - * @param endTime End Time. - * @param timeGrain Time Grain. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class representing Response from Diagnostic Detectors. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> executeSiteDetectorWithResponseAsync( - String resourceGroupName, - String siteName, - String detectorName, - String diagnosticCategory, - OffsetDateTime startTime, - OffsetDateTime endTime, - String timeGrain) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (siteName == null) { - return Mono.error(new IllegalArgumentException("Parameter siteName is required and cannot be null.")); - } - if (detectorName == null) { - return Mono.error(new IllegalArgumentException("Parameter detectorName is required and cannot be null.")); - } - if (diagnosticCategory == null) { - return Mono - .error(new IllegalArgumentException("Parameter diagnosticCategory is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .executeSiteDetector( - this.client.getEndpoint(), - resourceGroupName, - siteName, - detectorName, - diagnosticCategory, - startTime, - endTime, - timeGrain, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Execute Detector. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param detectorName Detector Resource Name. - * @param diagnosticCategory Category Name. - * @param startTime Start Time. - * @param endTime End Time. - * @param timeGrain Time Grain. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class representing Response from Diagnostic Detectors. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> executeSiteDetectorWithResponseAsync( - String resourceGroupName, - String siteName, - String detectorName, - String diagnosticCategory, - OffsetDateTime startTime, - OffsetDateTime endTime, - String timeGrain, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (siteName == null) { - return Mono.error(new IllegalArgumentException("Parameter siteName is required and cannot be null.")); - } - if (detectorName == null) { - return Mono.error(new IllegalArgumentException("Parameter detectorName is required and cannot be null.")); - } - if (diagnosticCategory == null) { - return Mono - .error(new IllegalArgumentException("Parameter diagnosticCategory is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .executeSiteDetector( - this.client.getEndpoint(), - resourceGroupName, - siteName, - detectorName, - diagnosticCategory, - startTime, - endTime, - timeGrain, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Execute Detector. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param detectorName Detector Resource Name. - * @param diagnosticCategory Category Name. - * @param startTime Start Time. - * @param endTime End Time. - * @param timeGrain Time Grain. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class representing Response from Diagnostic Detectors. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono executeSiteDetectorAsync( - String resourceGroupName, - String siteName, - String detectorName, - String diagnosticCategory, - OffsetDateTime startTime, - OffsetDateTime endTime, - String timeGrain) { - return executeSiteDetectorWithResponseAsync( - resourceGroupName, siteName, detectorName, diagnosticCategory, startTime, endTime, timeGrain) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Execute Detector. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param detectorName Detector Resource Name. - * @param diagnosticCategory Category Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class representing Response from Diagnostic Detectors. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono executeSiteDetectorAsync( - String resourceGroupName, String siteName, String detectorName, String diagnosticCategory) { - final OffsetDateTime startTime = null; - final OffsetDateTime endTime = null; - final String timeGrain = null; - return executeSiteDetectorWithResponseAsync( - resourceGroupName, siteName, detectorName, diagnosticCategory, startTime, endTime, timeGrain) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Execute Detector. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param detectorName Detector Resource Name. - * @param diagnosticCategory Category Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class representing Response from Diagnostic Detectors. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DiagnosticDetectorResponseInner executeSiteDetector( - String resourceGroupName, String siteName, String detectorName, String diagnosticCategory) { - final OffsetDateTime startTime = null; - final OffsetDateTime endTime = null; - final String timeGrain = null; - return executeSiteDetectorAsync( - resourceGroupName, siteName, detectorName, diagnosticCategory, startTime, endTime, timeGrain) - .block(); - } - - /** - * Execute Detector. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param detectorName Detector Resource Name. - * @param diagnosticCategory Category Name. - * @param startTime Start Time. - * @param endTime End Time. - * @param timeGrain Time Grain. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class representing Response from Diagnostic Detectors. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response executeSiteDetectorWithResponse( - String resourceGroupName, - String siteName, - String detectorName, - String diagnosticCategory, - OffsetDateTime startTime, - OffsetDateTime endTime, - String timeGrain, - Context context) { - return executeSiteDetectorWithResponseAsync( - resourceGroupName, siteName, detectorName, diagnosticCategory, startTime, endTime, timeGrain, context) - .block(); - } - - /** - * List Site Detector Responses. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param slot Slot Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of detector responses. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSiteDetectorResponsesSlotSinglePageAsync( - String resourceGroupName, String siteName, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (siteName == null) { - return Mono.error(new IllegalArgumentException("Parameter siteName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listSiteDetectorResponsesSlot( - this.client.getEndpoint(), - resourceGroupName, - siteName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List Site Detector Responses. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param slot Slot Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of detector responses. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSiteDetectorResponsesSlotSinglePageAsync( - String resourceGroupName, String siteName, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (siteName == null) { - return Mono.error(new IllegalArgumentException("Parameter siteName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listSiteDetectorResponsesSlot( - this.client.getEndpoint(), - resourceGroupName, - siteName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * List Site Detector Responses. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param slot Slot Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of detector responses. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listSiteDetectorResponsesSlotAsync( - String resourceGroupName, String siteName, String slot) { - return new PagedFlux<>( - () -> listSiteDetectorResponsesSlotSinglePageAsync(resourceGroupName, siteName, slot), - nextLink -> listSiteDetectorResponsesSlotNextSinglePageAsync(nextLink)); - } - - /** - * List Site Detector Responses. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param slot Slot Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of detector responses. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listSiteDetectorResponsesSlotAsync( - String resourceGroupName, String siteName, String slot, Context context) { - return new PagedFlux<>( - () -> listSiteDetectorResponsesSlotSinglePageAsync(resourceGroupName, siteName, slot, context), - nextLink -> listSiteDetectorResponsesSlotNextSinglePageAsync(nextLink, context)); - } - - /** - * List Site Detector Responses. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param slot Slot Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of detector responses. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listSiteDetectorResponsesSlot( - String resourceGroupName, String siteName, String slot) { - return new PagedIterable<>(listSiteDetectorResponsesSlotAsync(resourceGroupName, siteName, slot)); - } - - /** - * List Site Detector Responses. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param slot Slot Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of detector responses. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listSiteDetectorResponsesSlot( - String resourceGroupName, String siteName, String slot, Context context) { - return new PagedIterable<>(listSiteDetectorResponsesSlotAsync(resourceGroupName, siteName, slot, context)); - } - - /** - * Get site detector response. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param detectorName Detector Resource Name. - * @param slot Slot Name. - * @param startTime Start Time. - * @param endTime End Time. - * @param timeGrain Time Grain. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site detector response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getSiteDetectorResponseSlotWithResponseAsync( - String resourceGroupName, - String siteName, - String detectorName, - String slot, - OffsetDateTime startTime, - OffsetDateTime endTime, - String timeGrain) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (siteName == null) { - return Mono.error(new IllegalArgumentException("Parameter siteName is required and cannot be null.")); - } - if (detectorName == null) { - return Mono.error(new IllegalArgumentException("Parameter detectorName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getSiteDetectorResponseSlot( - this.client.getEndpoint(), - resourceGroupName, - siteName, - detectorName, - slot, - startTime, - endTime, - timeGrain, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get site detector response. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param detectorName Detector Resource Name. - * @param slot Slot Name. - * @param startTime Start Time. - * @param endTime End Time. - * @param timeGrain Time Grain. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site detector response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getSiteDetectorResponseSlotWithResponseAsync( - String resourceGroupName, - String siteName, - String detectorName, - String slot, - OffsetDateTime startTime, - OffsetDateTime endTime, - String timeGrain, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (siteName == null) { - return Mono.error(new IllegalArgumentException("Parameter siteName is required and cannot be null.")); - } - if (detectorName == null) { - return Mono.error(new IllegalArgumentException("Parameter detectorName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getSiteDetectorResponseSlot( - this.client.getEndpoint(), - resourceGroupName, - siteName, - detectorName, - slot, - startTime, - endTime, - timeGrain, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Get site detector response. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param detectorName Detector Resource Name. - * @param slot Slot Name. - * @param startTime Start Time. - * @param endTime End Time. - * @param timeGrain Time Grain. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site detector response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getSiteDetectorResponseSlotAsync( - String resourceGroupName, - String siteName, - String detectorName, - String slot, - OffsetDateTime startTime, - OffsetDateTime endTime, - String timeGrain) { - return getSiteDetectorResponseSlotWithResponseAsync( - resourceGroupName, siteName, detectorName, slot, startTime, endTime, timeGrain) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get site detector response. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param detectorName Detector Resource Name. - * @param slot Slot Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site detector response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getSiteDetectorResponseSlotAsync( - String resourceGroupName, String siteName, String detectorName, String slot) { - final OffsetDateTime startTime = null; - final OffsetDateTime endTime = null; - final String timeGrain = null; - return getSiteDetectorResponseSlotWithResponseAsync( - resourceGroupName, siteName, detectorName, slot, startTime, endTime, timeGrain) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get site detector response. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param detectorName Detector Resource Name. - * @param slot Slot Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site detector response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DetectorResponseInner getSiteDetectorResponseSlot( - String resourceGroupName, String siteName, String detectorName, String slot) { - final OffsetDateTime startTime = null; - final OffsetDateTime endTime = null; - final String timeGrain = null; - return getSiteDetectorResponseSlotAsync( - resourceGroupName, siteName, detectorName, slot, startTime, endTime, timeGrain) - .block(); - } - - /** - * Get site detector response. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param detectorName Detector Resource Name. - * @param slot Slot Name. - * @param startTime Start Time. - * @param endTime End Time. - * @param timeGrain Time Grain. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site detector response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getSiteDetectorResponseSlotWithResponse( - String resourceGroupName, - String siteName, - String detectorName, - String slot, - OffsetDateTime startTime, - OffsetDateTime endTime, - String timeGrain, - Context context) { - return getSiteDetectorResponseSlotWithResponseAsync( - resourceGroupName, siteName, detectorName, slot, startTime, endTime, timeGrain, context) - .block(); - } - - /** - * Get Diagnostics Categories. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param slot Slot Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return diagnostics Categories. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSiteDiagnosticCategoriesSlotSinglePageAsync( - String resourceGroupName, String siteName, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (siteName == null) { - return Mono.error(new IllegalArgumentException("Parameter siteName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listSiteDiagnosticCategoriesSlot( - this.client.getEndpoint(), - resourceGroupName, - siteName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get Diagnostics Categories. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param slot Slot Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return diagnostics Categories. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSiteDiagnosticCategoriesSlotSinglePageAsync( - String resourceGroupName, String siteName, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (siteName == null) { - return Mono.error(new IllegalArgumentException("Parameter siteName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listSiteDiagnosticCategoriesSlot( - this.client.getEndpoint(), - resourceGroupName, - siteName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get Diagnostics Categories. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param slot Slot Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return diagnostics Categories. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listSiteDiagnosticCategoriesSlotAsync( - String resourceGroupName, String siteName, String slot) { - return new PagedFlux<>( - () -> listSiteDiagnosticCategoriesSlotSinglePageAsync(resourceGroupName, siteName, slot), - nextLink -> listSiteDiagnosticCategoriesSlotNextSinglePageAsync(nextLink)); - } - - /** - * Get Diagnostics Categories. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param slot Slot Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return diagnostics Categories. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listSiteDiagnosticCategoriesSlotAsync( - String resourceGroupName, String siteName, String slot, Context context) { - return new PagedFlux<>( - () -> listSiteDiagnosticCategoriesSlotSinglePageAsync(resourceGroupName, siteName, slot, context), - nextLink -> listSiteDiagnosticCategoriesSlotNextSinglePageAsync(nextLink, context)); - } - - /** - * Get Diagnostics Categories. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param slot Slot Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return diagnostics Categories. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listSiteDiagnosticCategoriesSlot( - String resourceGroupName, String siteName, String slot) { - return new PagedIterable<>(listSiteDiagnosticCategoriesSlotAsync(resourceGroupName, siteName, slot)); - } - - /** - * Get Diagnostics Categories. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param slot Slot Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return diagnostics Categories. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listSiteDiagnosticCategoriesSlot( - String resourceGroupName, String siteName, String slot, Context context) { - return new PagedIterable<>(listSiteDiagnosticCategoriesSlotAsync(resourceGroupName, siteName, slot, context)); - } - - /** - * Get Diagnostics Category. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @param slot Slot Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return diagnostics Category. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getSiteDiagnosticCategorySlotWithResponseAsync( - String resourceGroupName, String siteName, String diagnosticCategory, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (siteName == null) { - return Mono.error(new IllegalArgumentException("Parameter siteName is required and cannot be null.")); - } - if (diagnosticCategory == null) { - return Mono - .error(new IllegalArgumentException("Parameter diagnosticCategory is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getSiteDiagnosticCategorySlot( - this.client.getEndpoint(), - resourceGroupName, - siteName, - diagnosticCategory, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get Diagnostics Category. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @param slot Slot Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return diagnostics Category. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getSiteDiagnosticCategorySlotWithResponseAsync( - String resourceGroupName, String siteName, String diagnosticCategory, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (siteName == null) { - return Mono.error(new IllegalArgumentException("Parameter siteName is required and cannot be null.")); - } - if (diagnosticCategory == null) { - return Mono - .error(new IllegalArgumentException("Parameter diagnosticCategory is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getSiteDiagnosticCategorySlot( - this.client.getEndpoint(), - resourceGroupName, - siteName, - diagnosticCategory, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Get Diagnostics Category. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @param slot Slot Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return diagnostics Category. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getSiteDiagnosticCategorySlotAsync( - String resourceGroupName, String siteName, String diagnosticCategory, String slot) { - return getSiteDiagnosticCategorySlotWithResponseAsync(resourceGroupName, siteName, diagnosticCategory, slot) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get Diagnostics Category. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @param slot Slot Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return diagnostics Category. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DiagnosticCategoryInner getSiteDiagnosticCategorySlot( - String resourceGroupName, String siteName, String diagnosticCategory, String slot) { - return getSiteDiagnosticCategorySlotAsync(resourceGroupName, siteName, diagnosticCategory, slot).block(); - } - - /** - * Get Diagnostics Category. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @param slot Slot Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return diagnostics Category. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getSiteDiagnosticCategorySlotWithResponse( - String resourceGroupName, String siteName, String diagnosticCategory, String slot, Context context) { - return getSiteDiagnosticCategorySlotWithResponseAsync( - resourceGroupName, siteName, diagnosticCategory, slot, context) - .block(); - } - - /** - * Get Site Analyses. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @param slot Slot Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Analyses. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSiteAnalysesSlotSinglePageAsync( - String resourceGroupName, String siteName, String diagnosticCategory, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (siteName == null) { - return Mono.error(new IllegalArgumentException("Parameter siteName is required and cannot be null.")); - } - if (diagnosticCategory == null) { - return Mono - .error(new IllegalArgumentException("Parameter diagnosticCategory is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listSiteAnalysesSlot( - this.client.getEndpoint(), - resourceGroupName, - siteName, - diagnosticCategory, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get Site Analyses. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @param slot Slot Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Analyses. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSiteAnalysesSlotSinglePageAsync( - String resourceGroupName, String siteName, String diagnosticCategory, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (siteName == null) { - return Mono.error(new IllegalArgumentException("Parameter siteName is required and cannot be null.")); - } - if (diagnosticCategory == null) { - return Mono - .error(new IllegalArgumentException("Parameter diagnosticCategory is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listSiteAnalysesSlot( - this.client.getEndpoint(), - resourceGroupName, - siteName, - diagnosticCategory, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get Site Analyses. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @param slot Slot Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Analyses. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listSiteAnalysesSlotAsync( - String resourceGroupName, String siteName, String diagnosticCategory, String slot) { - return new PagedFlux<>( - () -> listSiteAnalysesSlotSinglePageAsync(resourceGroupName, siteName, diagnosticCategory, slot), - nextLink -> listSiteAnalysesSlotNextSinglePageAsync(nextLink)); - } - - /** - * Get Site Analyses. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @param slot Slot Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Analyses. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listSiteAnalysesSlotAsync( - String resourceGroupName, String siteName, String diagnosticCategory, String slot, Context context) { - return new PagedFlux<>( - () -> listSiteAnalysesSlotSinglePageAsync(resourceGroupName, siteName, diagnosticCategory, slot, context), - nextLink -> listSiteAnalysesSlotNextSinglePageAsync(nextLink, context)); - } - - /** - * Get Site Analyses. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @param slot Slot Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Analyses. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listSiteAnalysesSlot( - String resourceGroupName, String siteName, String diagnosticCategory, String slot) { - return new PagedIterable<>(listSiteAnalysesSlotAsync(resourceGroupName, siteName, diagnosticCategory, slot)); - } - - /** - * Get Site Analyses. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @param slot Slot Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Analyses. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listSiteAnalysesSlot( - String resourceGroupName, String siteName, String diagnosticCategory, String slot, Context context) { - return new PagedIterable<>( - listSiteAnalysesSlotAsync(resourceGroupName, siteName, diagnosticCategory, slot, context)); - } - - /** - * Get Site Analysis. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @param analysisName Analysis Name. - * @param slot Slot - optional. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Analysis. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getSiteAnalysisSlotWithResponseAsync( - String resourceGroupName, String siteName, String diagnosticCategory, String analysisName, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (siteName == null) { - return Mono.error(new IllegalArgumentException("Parameter siteName is required and cannot be null.")); - } - if (diagnosticCategory == null) { - return Mono - .error(new IllegalArgumentException("Parameter diagnosticCategory is required and cannot be null.")); - } - if (analysisName == null) { - return Mono.error(new IllegalArgumentException("Parameter analysisName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getSiteAnalysisSlot( - this.client.getEndpoint(), - resourceGroupName, - siteName, - diagnosticCategory, - analysisName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get Site Analysis. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @param analysisName Analysis Name. - * @param slot Slot - optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Analysis. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getSiteAnalysisSlotWithResponseAsync( - String resourceGroupName, - String siteName, - String diagnosticCategory, - String analysisName, - String slot, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (siteName == null) { - return Mono.error(new IllegalArgumentException("Parameter siteName is required and cannot be null.")); - } - if (diagnosticCategory == null) { - return Mono - .error(new IllegalArgumentException("Parameter diagnosticCategory is required and cannot be null.")); - } - if (analysisName == null) { - return Mono.error(new IllegalArgumentException("Parameter analysisName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getSiteAnalysisSlot( - this.client.getEndpoint(), - resourceGroupName, - siteName, - diagnosticCategory, - analysisName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Get Site Analysis. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @param analysisName Analysis Name. - * @param slot Slot - optional. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Analysis. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getSiteAnalysisSlotAsync( - String resourceGroupName, String siteName, String diagnosticCategory, String analysisName, String slot) { - return getSiteAnalysisSlotWithResponseAsync(resourceGroupName, siteName, diagnosticCategory, analysisName, slot) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get Site Analysis. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @param analysisName Analysis Name. - * @param slot Slot - optional. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Analysis. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DiagnosticAnalysisInner getSiteAnalysisSlot( - String resourceGroupName, String siteName, String diagnosticCategory, String analysisName, String slot) { - return getSiteAnalysisSlotAsync(resourceGroupName, siteName, diagnosticCategory, analysisName, slot).block(); - } - - /** - * Get Site Analysis. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @param analysisName Analysis Name. - * @param slot Slot - optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Analysis. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getSiteAnalysisSlotWithResponse( - String resourceGroupName, - String siteName, - String diagnosticCategory, - String analysisName, - String slot, - Context context) { - return getSiteAnalysisSlotWithResponseAsync( - resourceGroupName, siteName, diagnosticCategory, analysisName, slot, context) - .block(); - } - - /** - * Execute Analysis. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Category Name. - * @param analysisName Analysis Resource Name. - * @param slot Slot Name. - * @param startTime Start Time. - * @param endTime End Time. - * @param timeGrain Time Grain. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class representing a diagnostic analysis done on an application. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> executeSiteAnalysisSlotWithResponseAsync( - String resourceGroupName, - String siteName, - String diagnosticCategory, - String analysisName, - String slot, - OffsetDateTime startTime, - OffsetDateTime endTime, - String timeGrain) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (siteName == null) { - return Mono.error(new IllegalArgumentException("Parameter siteName is required and cannot be null.")); - } - if (diagnosticCategory == null) { - return Mono - .error(new IllegalArgumentException("Parameter diagnosticCategory is required and cannot be null.")); - } - if (analysisName == null) { - return Mono.error(new IllegalArgumentException("Parameter analysisName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .executeSiteAnalysisSlot( - this.client.getEndpoint(), - resourceGroupName, - siteName, - diagnosticCategory, - analysisName, - slot, - startTime, - endTime, - timeGrain, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Execute Analysis. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Category Name. - * @param analysisName Analysis Resource Name. - * @param slot Slot Name. - * @param startTime Start Time. - * @param endTime End Time. - * @param timeGrain Time Grain. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class representing a diagnostic analysis done on an application. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> executeSiteAnalysisSlotWithResponseAsync( - String resourceGroupName, - String siteName, - String diagnosticCategory, - String analysisName, - String slot, - OffsetDateTime startTime, - OffsetDateTime endTime, - String timeGrain, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (siteName == null) { - return Mono.error(new IllegalArgumentException("Parameter siteName is required and cannot be null.")); - } - if (diagnosticCategory == null) { - return Mono - .error(new IllegalArgumentException("Parameter diagnosticCategory is required and cannot be null.")); - } - if (analysisName == null) { - return Mono.error(new IllegalArgumentException("Parameter analysisName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .executeSiteAnalysisSlot( - this.client.getEndpoint(), - resourceGroupName, - siteName, - diagnosticCategory, - analysisName, - slot, - startTime, - endTime, - timeGrain, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Execute Analysis. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Category Name. - * @param analysisName Analysis Resource Name. - * @param slot Slot Name. - * @param startTime Start Time. - * @param endTime End Time. - * @param timeGrain Time Grain. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class representing a diagnostic analysis done on an application. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono executeSiteAnalysisSlotAsync( - String resourceGroupName, - String siteName, - String diagnosticCategory, - String analysisName, - String slot, - OffsetDateTime startTime, - OffsetDateTime endTime, - String timeGrain) { - return executeSiteAnalysisSlotWithResponseAsync( - resourceGroupName, siteName, diagnosticCategory, analysisName, slot, startTime, endTime, timeGrain) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Execute Analysis. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Category Name. - * @param analysisName Analysis Resource Name. - * @param slot Slot Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class representing a diagnostic analysis done on an application. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono executeSiteAnalysisSlotAsync( - String resourceGroupName, String siteName, String diagnosticCategory, String analysisName, String slot) { - final OffsetDateTime startTime = null; - final OffsetDateTime endTime = null; - final String timeGrain = null; - return executeSiteAnalysisSlotWithResponseAsync( - resourceGroupName, siteName, diagnosticCategory, analysisName, slot, startTime, endTime, timeGrain) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Execute Analysis. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Category Name. - * @param analysisName Analysis Resource Name. - * @param slot Slot Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class representing a diagnostic analysis done on an application. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DiagnosticAnalysisInner executeSiteAnalysisSlot( - String resourceGroupName, String siteName, String diagnosticCategory, String analysisName, String slot) { - final OffsetDateTime startTime = null; - final OffsetDateTime endTime = null; - final String timeGrain = null; - return executeSiteAnalysisSlotAsync( - resourceGroupName, siteName, diagnosticCategory, analysisName, slot, startTime, endTime, timeGrain) - .block(); - } - - /** - * Execute Analysis. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Category Name. - * @param analysisName Analysis Resource Name. - * @param slot Slot Name. - * @param startTime Start Time. - * @param endTime End Time. - * @param timeGrain Time Grain. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class representing a diagnostic analysis done on an application. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response executeSiteAnalysisSlotWithResponse( - String resourceGroupName, - String siteName, - String diagnosticCategory, - String analysisName, - String slot, - OffsetDateTime startTime, - OffsetDateTime endTime, - String timeGrain, - Context context) { - return executeSiteAnalysisSlotWithResponseAsync( - resourceGroupName, - siteName, - diagnosticCategory, - analysisName, - slot, - startTime, - endTime, - timeGrain, - context) - .block(); - } - - /** - * Get Detectors. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @param slot Slot Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return detectors. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSiteDetectorsSlotSinglePageAsync( - String resourceGroupName, String siteName, String diagnosticCategory, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (siteName == null) { - return Mono.error(new IllegalArgumentException("Parameter siteName is required and cannot be null.")); - } - if (diagnosticCategory == null) { - return Mono - .error(new IllegalArgumentException("Parameter diagnosticCategory is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listSiteDetectorsSlot( - this.client.getEndpoint(), - resourceGroupName, - siteName, - diagnosticCategory, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get Detectors. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @param slot Slot Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return detectors. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSiteDetectorsSlotSinglePageAsync( - String resourceGroupName, String siteName, String diagnosticCategory, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (siteName == null) { - return Mono.error(new IllegalArgumentException("Parameter siteName is required and cannot be null.")); - } - if (diagnosticCategory == null) { - return Mono - .error(new IllegalArgumentException("Parameter diagnosticCategory is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listSiteDetectorsSlot( - this.client.getEndpoint(), - resourceGroupName, - siteName, - diagnosticCategory, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get Detectors. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @param slot Slot Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return detectors. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listSiteDetectorsSlotAsync( - String resourceGroupName, String siteName, String diagnosticCategory, String slot) { - return new PagedFlux<>( - () -> listSiteDetectorsSlotSinglePageAsync(resourceGroupName, siteName, diagnosticCategory, slot), - nextLink -> listSiteDetectorsSlotNextSinglePageAsync(nextLink)); - } - - /** - * Get Detectors. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @param slot Slot Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return detectors. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listSiteDetectorsSlotAsync( - String resourceGroupName, String siteName, String diagnosticCategory, String slot, Context context) { - return new PagedFlux<>( - () -> listSiteDetectorsSlotSinglePageAsync(resourceGroupName, siteName, diagnosticCategory, slot, context), - nextLink -> listSiteDetectorsSlotNextSinglePageAsync(nextLink, context)); - } - - /** - * Get Detectors. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @param slot Slot Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return detectors. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listSiteDetectorsSlot( - String resourceGroupName, String siteName, String diagnosticCategory, String slot) { - return new PagedIterable<>(listSiteDetectorsSlotAsync(resourceGroupName, siteName, diagnosticCategory, slot)); - } - - /** - * Get Detectors. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @param slot Slot Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return detectors. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listSiteDetectorsSlot( - String resourceGroupName, String siteName, String diagnosticCategory, String slot, Context context) { - return new PagedIterable<>( - listSiteDetectorsSlotAsync(resourceGroupName, siteName, diagnosticCategory, slot, context)); - } - - /** - * Get Detector. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @param detectorName Detector Name. - * @param slot Slot Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return detector. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getSiteDetectorSlotSinglePageAsync( - String resourceGroupName, String siteName, String diagnosticCategory, String detectorName, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (siteName == null) { - return Mono.error(new IllegalArgumentException("Parameter siteName is required and cannot be null.")); - } - if (diagnosticCategory == null) { - return Mono - .error(new IllegalArgumentException("Parameter diagnosticCategory is required and cannot be null.")); - } - if (detectorName == null) { - return Mono.error(new IllegalArgumentException("Parameter detectorName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getSiteDetectorSlot( - this.client.getEndpoint(), - resourceGroupName, - siteName, - diagnosticCategory, - detectorName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get Detector. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @param detectorName Detector Name. - * @param slot Slot Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return detector. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getSiteDetectorSlotSinglePageAsync( - String resourceGroupName, - String siteName, - String diagnosticCategory, - String detectorName, - String slot, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (siteName == null) { - return Mono.error(new IllegalArgumentException("Parameter siteName is required and cannot be null.")); - } - if (diagnosticCategory == null) { - return Mono - .error(new IllegalArgumentException("Parameter diagnosticCategory is required and cannot be null.")); - } - if (detectorName == null) { - return Mono.error(new IllegalArgumentException("Parameter detectorName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getSiteDetectorSlot( - this.client.getEndpoint(), - resourceGroupName, - siteName, - diagnosticCategory, - detectorName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get Detector. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @param detectorName Detector Name. - * @param slot Slot Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return detector. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux getSiteDetectorSlotAsync( - String resourceGroupName, String siteName, String diagnosticCategory, String detectorName, String slot) { - return new PagedFlux<>( - () -> - getSiteDetectorSlotSinglePageAsync(resourceGroupName, siteName, diagnosticCategory, detectorName, slot), - nextLink -> getSiteDetectorSlotNextSinglePageAsync(nextLink)); - } - - /** - * Get Detector. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @param detectorName Detector Name. - * @param slot Slot Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return detector. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux getSiteDetectorSlotAsync( - String resourceGroupName, - String siteName, - String diagnosticCategory, - String detectorName, - String slot, - Context context) { - return new PagedFlux<>( - () -> - getSiteDetectorSlotSinglePageAsync( - resourceGroupName, siteName, diagnosticCategory, detectorName, slot, context), - nextLink -> getSiteDetectorSlotNextSinglePageAsync(nextLink, context)); - } - - /** - * Get Detector. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @param detectorName Detector Name. - * @param slot Slot Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return detector. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable getSiteDetectorSlot( - String resourceGroupName, String siteName, String diagnosticCategory, String detectorName, String slot) { - return new PagedIterable<>( - getSiteDetectorSlotAsync(resourceGroupName, siteName, diagnosticCategory, detectorName, slot)); - } - - /** - * Get Detector. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param diagnosticCategory Diagnostic Category. - * @param detectorName Detector Name. - * @param slot Slot Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return detector. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable getSiteDetectorSlot( - String resourceGroupName, - String siteName, - String diagnosticCategory, - String detectorName, - String slot, - Context context) { - return new PagedIterable<>( - getSiteDetectorSlotAsync(resourceGroupName, siteName, diagnosticCategory, detectorName, slot, context)); - } - - /** - * Execute Detector. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param detectorName Detector Resource Name. - * @param diagnosticCategory Category Name. - * @param slot Slot Name. - * @param startTime Start Time. - * @param endTime End Time. - * @param timeGrain Time Grain. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class representing Response from Diagnostic Detectors. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> executeSiteDetectorSlotWithResponseAsync( - String resourceGroupName, - String siteName, - String detectorName, - String diagnosticCategory, - String slot, - OffsetDateTime startTime, - OffsetDateTime endTime, - String timeGrain) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (siteName == null) { - return Mono.error(new IllegalArgumentException("Parameter siteName is required and cannot be null.")); - } - if (detectorName == null) { - return Mono.error(new IllegalArgumentException("Parameter detectorName is required and cannot be null.")); - } - if (diagnosticCategory == null) { - return Mono - .error(new IllegalArgumentException("Parameter diagnosticCategory is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .executeSiteDetectorSlot( - this.client.getEndpoint(), - resourceGroupName, - siteName, - detectorName, - diagnosticCategory, - slot, - startTime, - endTime, - timeGrain, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Execute Detector. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param detectorName Detector Resource Name. - * @param diagnosticCategory Category Name. - * @param slot Slot Name. - * @param startTime Start Time. - * @param endTime End Time. - * @param timeGrain Time Grain. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class representing Response from Diagnostic Detectors. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> executeSiteDetectorSlotWithResponseAsync( - String resourceGroupName, - String siteName, - String detectorName, - String diagnosticCategory, - String slot, - OffsetDateTime startTime, - OffsetDateTime endTime, - String timeGrain, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (siteName == null) { - return Mono.error(new IllegalArgumentException("Parameter siteName is required and cannot be null.")); - } - if (detectorName == null) { - return Mono.error(new IllegalArgumentException("Parameter detectorName is required and cannot be null.")); - } - if (diagnosticCategory == null) { - return Mono - .error(new IllegalArgumentException("Parameter diagnosticCategory is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .executeSiteDetectorSlot( - this.client.getEndpoint(), - resourceGroupName, - siteName, - detectorName, - diagnosticCategory, - slot, - startTime, - endTime, - timeGrain, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Execute Detector. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param detectorName Detector Resource Name. - * @param diagnosticCategory Category Name. - * @param slot Slot Name. - * @param startTime Start Time. - * @param endTime End Time. - * @param timeGrain Time Grain. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class representing Response from Diagnostic Detectors. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono executeSiteDetectorSlotAsync( - String resourceGroupName, - String siteName, - String detectorName, - String diagnosticCategory, - String slot, - OffsetDateTime startTime, - OffsetDateTime endTime, - String timeGrain) { - return executeSiteDetectorSlotWithResponseAsync( - resourceGroupName, siteName, detectorName, diagnosticCategory, slot, startTime, endTime, timeGrain) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Execute Detector. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param detectorName Detector Resource Name. - * @param diagnosticCategory Category Name. - * @param slot Slot Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class representing Response from Diagnostic Detectors. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono executeSiteDetectorSlotAsync( - String resourceGroupName, String siteName, String detectorName, String diagnosticCategory, String slot) { - final OffsetDateTime startTime = null; - final OffsetDateTime endTime = null; - final String timeGrain = null; - return executeSiteDetectorSlotWithResponseAsync( - resourceGroupName, siteName, detectorName, diagnosticCategory, slot, startTime, endTime, timeGrain) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Execute Detector. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param detectorName Detector Resource Name. - * @param diagnosticCategory Category Name. - * @param slot Slot Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class representing Response from Diagnostic Detectors. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DiagnosticDetectorResponseInner executeSiteDetectorSlot( - String resourceGroupName, String siteName, String detectorName, String diagnosticCategory, String slot) { - final OffsetDateTime startTime = null; - final OffsetDateTime endTime = null; - final String timeGrain = null; - return executeSiteDetectorSlotAsync( - resourceGroupName, siteName, detectorName, diagnosticCategory, slot, startTime, endTime, timeGrain) - .block(); - } - - /** - * Execute Detector. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name. - * @param detectorName Detector Resource Name. - * @param diagnosticCategory Category Name. - * @param slot Slot Name. - * @param startTime Start Time. - * @param endTime End Time. - * @param timeGrain Time Grain. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class representing Response from Diagnostic Detectors. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response executeSiteDetectorSlotWithResponse( - String resourceGroupName, - String siteName, - String detectorName, - String diagnosticCategory, - String slot, - OffsetDateTime startTime, - OffsetDateTime endTime, - String timeGrain, - Context context) { - return executeSiteDetectorSlotWithResponseAsync( - resourceGroupName, - siteName, - detectorName, - diagnosticCategory, - slot, - startTime, - endTime, - timeGrain, - context) - .block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of detector responses. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listHostingEnvironmentDetectorResponsesNextSinglePageAsync( - String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listHostingEnvironmentDetectorResponsesNext( - nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of detector responses. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listHostingEnvironmentDetectorResponsesNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listHostingEnvironmentDetectorResponsesNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of detector responses. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSiteDetectorResponsesNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listSiteDetectorResponsesNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of detector responses. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSiteDetectorResponsesNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listSiteDetectorResponsesNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Diagnostic Categories. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSiteDiagnosticCategoriesNextSinglePageAsync( - String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service.listSiteDiagnosticCategoriesNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Diagnostic Categories. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSiteDiagnosticCategoriesNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listSiteDiagnosticCategoriesNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Diagnostic Analyses. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSiteAnalysesNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listSiteAnalysesNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Diagnostic Analyses. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSiteAnalysesNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listSiteAnalysesNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Diagnostic Detectors. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSiteDetectorsNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listSiteDetectorsNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Diagnostic Detectors. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSiteDetectorsNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listSiteDetectorsNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Diagnostic Detectors. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getSiteDetectorNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getSiteDetectorNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Diagnostic Detectors. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getSiteDetectorNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getSiteDetectorNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of detector responses. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSiteDetectorResponsesSlotNextSinglePageAsync( - String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service.listSiteDetectorResponsesSlotNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of detector responses. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSiteDetectorResponsesSlotNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listSiteDetectorResponsesSlotNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Diagnostic Categories. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSiteDiagnosticCategoriesSlotNextSinglePageAsync( - String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service.listSiteDiagnosticCategoriesSlotNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Diagnostic Categories. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSiteDiagnosticCategoriesSlotNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listSiteDiagnosticCategoriesSlotNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Diagnostic Analyses. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSiteAnalysesSlotNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listSiteAnalysesSlotNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Diagnostic Analyses. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSiteAnalysesSlotNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listSiteAnalysesSlotNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Diagnostic Detectors. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSiteDetectorsSlotNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listSiteDetectorsSlotNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Diagnostic Detectors. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSiteDetectorsSlotNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listSiteDetectorsSlotNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Diagnostic Detectors. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getSiteDetectorSlotNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.getSiteDetectorSlotNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Diagnostic Detectors. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getSiteDetectorSlotNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getSiteDetectorSlotNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/DomainContactImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/DomainContactImpl.java deleted file mode 100644 index b2b9cba0e35d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/DomainContactImpl.java +++ /dev/null @@ -1,171 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.appservice.implementation; - -import com.azure.resourcemanager.appservice.models.Address; -import com.azure.resourcemanager.appservice.models.AppServiceDomain; -import com.azure.resourcemanager.appservice.models.Contact; -import com.azure.resourcemanager.appservice.models.DomainContact; -import com.azure.resourcemanager.resources.fluentcore.arm.CountryIsoCode; -import com.azure.resourcemanager.resources.fluentcore.arm.CountryPhoneCode; -import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.ChildResourceImpl; - -/** Implementation for {@link DomainContact} and its create and update interfaces. */ -class DomainContactImpl extends ChildResourceImpl - implements DomainContact, DomainContact.Definition { - - DomainContactImpl(Contact inner, AppServiceDomainImpl parent) { - super(inner, parent); - innerModel().withAddressMailing(new Address()); - } - - @Override - public String name() { - return firstName() + " " + lastName(); - } - - @Override - public Address addressMailing() { - return innerModel().addressMailing(); - } - - @Override - public String email() { - return innerModel().email(); - } - - @Override - public String fax() { - return innerModel().fax(); - } - - @Override - public String jobTitle() { - return innerModel().jobTitle(); - } - - @Override - public String firstName() { - return innerModel().nameFirst(); - } - - @Override - public String lastName() { - return innerModel().nameLast(); - } - - @Override - public String middleName() { - return innerModel().nameMiddle(); - } - - @Override - public String organization() { - return innerModel().organization(); - } - - @Override - public String phone() { - return innerModel().phone(); - } - - @Override - public AppServiceDomainImpl attach() { - return parent().withRegistrantContact(innerModel()); - } - - @Override - public DomainContactImpl withFirstName(String firstName) { - innerModel().withNameFirst(firstName); - return this; - } - - @Override - public DomainContactImpl withMiddleName(String middleName) { - innerModel().withNameMiddle(middleName); - return this; - } - - @Override - public DomainContactImpl withLastName(String lastName) { - innerModel().withNameLast(lastName); - return this; - } - - @Override - public DomainContactImpl withEmail(String email) { - innerModel().withEmail(email); - return this; - } - - @Override - public DomainContactImpl withAddressLine1(String addressLine1) { - innerModel().addressMailing().withAddress1(addressLine1); - return this; - } - - @Override - public DomainContactImpl withAddressLine2(String addressLine2) { - innerModel().addressMailing().withAddress2(addressLine2); - return this; - } - - @Override - public DomainContactImpl withCity(String city) { - innerModel().addressMailing().withCity(city); - return this; - } - - @Override - public DomainContactImpl withStateOrProvince(String stateOrProvince) { - innerModel().addressMailing().withState(stateOrProvince); - return this; - } - - @Override - public DomainContactImpl withCountry(CountryIsoCode country) { - innerModel().addressMailing().withCountry(country.toString()); - return this; - } - - @Override - public DomainContactImpl withPostalCode(String postalCode) { - innerModel().addressMailing().withPostalCode(postalCode); - return this; - } - - @Override - public DomainContactImpl withPhoneCountryCode(CountryPhoneCode code) { - innerModel().withPhone(code.toString() + "."); - return this; - } - - @Override - public DomainContactImpl withPhoneNumber(String phoneNumber) { - innerModel().withPhone(innerModel().phone() + phoneNumber); - return this; - } - - @Override - public DomainContactImpl withFaxNumber(String faxNumber) { - innerModel().withFax(faxNumber); - return this; - } - - @Override - public DomainContactImpl withOrganization(String organziation) { - innerModel().withOrganization(organziation); - return this; - } - - @Override - public DomainContactImpl withJobTitle(String jobTitle) { - innerModel().withJobTitle(jobTitle); - return this; - } - - @Override - public Contact build() { - return innerModel(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/DomainLegalAgreementImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/DomainLegalAgreementImpl.java deleted file mode 100644 index 5579d2a16737..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/DomainLegalAgreementImpl.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.implementation; - -import com.azure.resourcemanager.appservice.models.DomainLegalAgreement; -import com.azure.resourcemanager.appservice.fluent.models.TldLegalAgreementInner; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.WrapperImpl; - -/** Implementation for {@link DomainLegalAgreement}. */ -final class DomainLegalAgreementImpl extends WrapperImpl implements DomainLegalAgreement { - - DomainLegalAgreementImpl(TldLegalAgreementInner innerModel) { - super(innerModel); - } - - @Override - public String agreementKey() { - return innerModel().agreementKey(); - } - - @Override - public String title() { - return innerModel().title(); - } - - @Override - public String content() { - return innerModel().content(); - } - - @Override - public String url() { - return innerModel().url(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/DomainRegistrationProvidersClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/DomainRegistrationProvidersClientImpl.java deleted file mode 100644 index a5d59e22da1b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/DomainRegistrationProvidersClientImpl.java +++ /dev/null @@ -1,275 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.DomainRegistrationProvidersClient; -import com.azure.resourcemanager.appservice.fluent.models.CsmOperationDescriptionInner; -import com.azure.resourcemanager.appservice.models.CsmOperationCollection; -import com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in DomainRegistrationProvidersClient. */ -public final class DomainRegistrationProvidersClientImpl implements DomainRegistrationProvidersClient { - private final ClientLogger logger = new ClientLogger(DomainRegistrationProvidersClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final DomainRegistrationProvidersService service; - - /** The service client containing this operation class. */ - private final WebSiteManagementClientImpl client; - - /** - * Initializes an instance of DomainRegistrationProvidersClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - DomainRegistrationProvidersClientImpl(WebSiteManagementClientImpl client) { - this.service = - RestProxy - .create( - DomainRegistrationProvidersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for WebSiteManagementClientDomainRegistrationProviders to be used by the - * proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "WebSiteManagementCli") - private interface DomainRegistrationProvidersService { - @Headers({"Content-Type: application/json"}) - @Get("/providers/Microsoft.DomainRegistration/operations") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listOperations( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listOperationsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Implements Csm operations Api to exposes the list of available Csm Apis under the resource provider. - * - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Azure resource manager operation metadata. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listOperationsSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service.listOperations(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Implements Csm operations Api to exposes the list of available Csm Apis under the resource provider. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Azure resource manager operation metadata. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listOperationsSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listOperations(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Implements Csm operations Api to exposes the list of available Csm Apis under the resource provider. - * - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Azure resource manager operation metadata. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listOperationsAsync() { - return new PagedFlux<>( - () -> listOperationsSinglePageAsync(), nextLink -> listOperationsNextSinglePageAsync(nextLink)); - } - - /** - * Implements Csm operations Api to exposes the list of available Csm Apis under the resource provider. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Azure resource manager operation metadata. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listOperationsAsync(Context context) { - return new PagedFlux<>( - () -> listOperationsSinglePageAsync(context), - nextLink -> listOperationsNextSinglePageAsync(nextLink, context)); - } - - /** - * Implements Csm operations Api to exposes the list of available Csm Apis under the resource provider. - * - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Azure resource manager operation metadata. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listOperations() { - return new PagedIterable<>(listOperationsAsync()); - } - - /** - * Implements Csm operations Api to exposes the list of available Csm Apis under the resource provider. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Azure resource manager operation metadata. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listOperations(Context context) { - return new PagedIterable<>(listOperationsAsync(context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Azure resource manager operation metadata. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listOperationsNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listOperationsNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Azure resource manager operation metadata. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listOperationsNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listOperationsNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/DomainsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/DomainsClientImpl.java deleted file mode 100644 index 8bf5ba1c58d9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/DomainsClientImpl.java +++ /dev/null @@ -1,3142 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.appservice.fluent.DomainsClient; -import com.azure.resourcemanager.appservice.fluent.models.DomainAvailablilityCheckResultInner; -import com.azure.resourcemanager.appservice.fluent.models.DomainControlCenterSsoRequestInner; -import com.azure.resourcemanager.appservice.fluent.models.DomainInner; -import com.azure.resourcemanager.appservice.fluent.models.DomainOwnershipIdentifierInner; -import com.azure.resourcemanager.appservice.fluent.models.NameIdentifierInner; -import com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException; -import com.azure.resourcemanager.appservice.models.DomainCollection; -import com.azure.resourcemanager.appservice.models.DomainOwnershipIdentifierCollection; -import com.azure.resourcemanager.appservice.models.DomainPatchResource; -import com.azure.resourcemanager.appservice.models.DomainRecommendationSearchParameters; -import com.azure.resourcemanager.appservice.models.NameIdentifierCollection; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in DomainsClient. */ -public final class DomainsClientImpl - implements InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete, - DomainsClient { - private final ClientLogger logger = new ClientLogger(DomainsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final DomainsService service; - - /** The service client containing this operation class. */ - private final WebSiteManagementClientImpl client; - - /** - * Initializes an instance of DomainsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - DomainsClientImpl(WebSiteManagementClientImpl client) { - this.service = RestProxy.create(DomainsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for WebSiteManagementClientDomains to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "WebSiteManagementCli") - private interface DomainsService { - @Headers({"Content-Type: application/json"}) - @Post("/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/checkDomainAvailability") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> checkAvailability( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") NameIdentifierInner identifier, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/domains") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post("/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/generateSsoRequest") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getControlCenterSsoRequest( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post("/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/listDomainRecommendations") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listRecommendations( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") DomainRecommendationSearchParameters parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration" - + "/domains") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration" - + "/domains/{domainName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("domainName") String domainName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration" - + "/domains/{domainName}") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("domainName") String domainName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") DomainInner domain, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration" - + "/domains/{domainName}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("domainName") String domainName, - @QueryParam("forceHardDeleteDomain") Boolean forceHardDeleteDomain, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration" - + "/domains/{domainName}") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> update( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("domainName") String domainName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") DomainPatchResource domain, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration" - + "/domains/{domainName}/domainOwnershipIdentifiers") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listOwnershipIdentifiers( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("domainName") String domainName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration" - + "/domains/{domainName}/domainOwnershipIdentifiers/{name}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getOwnershipIdentifier( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("domainName") String domainName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration" - + "/domains/{domainName}/domainOwnershipIdentifiers/{name}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> createOrUpdateOwnershipIdentifier( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("domainName") String domainName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") DomainOwnershipIdentifierInner domainOwnershipIdentifier, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration" - + "/domains/{domainName}/domainOwnershipIdentifiers/{name}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteOwnershipIdentifier( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("domainName") String domainName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration" - + "/domains/{domainName}/domainOwnershipIdentifiers/{name}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> updateOwnershipIdentifier( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("domainName") String domainName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") DomainOwnershipIdentifierInner domainOwnershipIdentifier, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration" - + "/domains/{domainName}/renew") - @ExpectedResponses({200, 202, 204, 400, 500}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> renew( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("domainName") String domainName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listRecommendationsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listOwnershipIdentifiersNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Check if a domain is available for registration. - * - * @param identifier Name of the domain. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return domain availability check result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> checkAvailabilityWithResponseAsync( - NameIdentifierInner identifier) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (identifier == null) { - return Mono.error(new IllegalArgumentException("Parameter identifier is required and cannot be null.")); - } else { - identifier.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .checkAvailability( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - this.client.getApiVersion(), - identifier, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Check if a domain is available for registration. - * - * @param identifier Name of the domain. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return domain availability check result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> checkAvailabilityWithResponseAsync( - NameIdentifierInner identifier, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (identifier == null) { - return Mono.error(new IllegalArgumentException("Parameter identifier is required and cannot be null.")); - } else { - identifier.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .checkAvailability( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - this.client.getApiVersion(), - identifier, - accept, - context); - } - - /** - * Check if a domain is available for registration. - * - * @param identifier Name of the domain. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return domain availability check result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono checkAvailabilityAsync(NameIdentifierInner identifier) { - return checkAvailabilityWithResponseAsync(identifier) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Check if a domain is available for registration. - * - * @param identifier Name of the domain. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return domain availability check result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DomainAvailablilityCheckResultInner checkAvailability(NameIdentifierInner identifier) { - return checkAvailabilityAsync(identifier).block(); - } - - /** - * Check if a domain is available for registration. - * - * @param identifier Name of the domain. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return domain availability check result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response checkAvailabilityWithResponse( - NameIdentifierInner identifier, Context context) { - return checkAvailabilityWithResponseAsync(identifier, context).block(); - } - - /** - * Get all domains in a subscription. - * - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all domains in a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get all domains in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all domains in a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get all domains in a subscription. - * - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all domains in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Get all domains in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all domains in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Get all domains in a subscription. - * - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all domains in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Get all domains in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all domains in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Generate a single sign-on request for the domain management portal. - * - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single sign-on request information for domain management. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getControlCenterSsoRequestWithResponseAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getControlCenterSsoRequest( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Generate a single sign-on request for the domain management portal. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single sign-on request information for domain management. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getControlCenterSsoRequestWithResponseAsync( - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getControlCenterSsoRequest( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Generate a single sign-on request for the domain management portal. - * - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single sign-on request information for domain management. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getControlCenterSsoRequestAsync() { - return getControlCenterSsoRequestWithResponseAsync() - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Generate a single sign-on request for the domain management portal. - * - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single sign-on request information for domain management. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DomainControlCenterSsoRequestInner getControlCenterSsoRequest() { - return getControlCenterSsoRequestAsync().block(); - } - - /** - * Generate a single sign-on request for the domain management portal. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single sign-on request information for domain management. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getControlCenterSsoRequestWithResponse(Context context) { - return getControlCenterSsoRequestWithResponseAsync(context).block(); - } - - /** - * Get domain name recommendations based on keywords. - * - * @param parameters Search parameters for domain name recommendations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return domain name recommendations based on keywords. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listRecommendationsSinglePageAsync( - DomainRecommendationSearchParameters parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listRecommendations( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - this.client.getApiVersion(), - parameters, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get domain name recommendations based on keywords. - * - * @param parameters Search parameters for domain name recommendations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return domain name recommendations based on keywords. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listRecommendationsSinglePageAsync( - DomainRecommendationSearchParameters parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listRecommendations( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - this.client.getApiVersion(), - parameters, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get domain name recommendations based on keywords. - * - * @param parameters Search parameters for domain name recommendations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return domain name recommendations based on keywords. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listRecommendationsAsync(DomainRecommendationSearchParameters parameters) { - return new PagedFlux<>( - () -> listRecommendationsSinglePageAsync(parameters), - nextLink -> listRecommendationsNextSinglePageAsync(nextLink)); - } - - /** - * Get domain name recommendations based on keywords. - * - * @param parameters Search parameters for domain name recommendations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return domain name recommendations based on keywords. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listRecommendationsAsync( - DomainRecommendationSearchParameters parameters, Context context) { - return new PagedFlux<>( - () -> listRecommendationsSinglePageAsync(parameters, context), - nextLink -> listRecommendationsNextSinglePageAsync(nextLink, context)); - } - - /** - * Get domain name recommendations based on keywords. - * - * @param parameters Search parameters for domain name recommendations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return domain name recommendations based on keywords. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listRecommendations(DomainRecommendationSearchParameters parameters) { - return new PagedIterable<>(listRecommendationsAsync(parameters)); - } - - /** - * Get domain name recommendations based on keywords. - * - * @param parameters Search parameters for domain name recommendations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return domain name recommendations based on keywords. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listRecommendations( - DomainRecommendationSearchParameters parameters, Context context) { - return new PagedIterable<>(listRecommendationsAsync(parameters, context)); - } - - /** - * Get all domains in a resource group. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all domains in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get all domains in a resource group. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all domains in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get all domains in a resource group. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all domains in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * Get all domains in a resource group. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all domains in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * Get all domains in a resource group. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all domains in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * Get all domains in a resource group. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all domains in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * Get a domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of the domain. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a domain. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String domainName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (domainName == null) { - return Mono.error(new IllegalArgumentException("Parameter domainName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - domainName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of the domain. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a domain. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String domainName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (domainName == null) { - return Mono.error(new IllegalArgumentException("Parameter domainName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - domainName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Get a domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of the domain. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a domain. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync(String resourceGroupName, String domainName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, domainName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get a domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of the domain. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a domain. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DomainInner getByResourceGroup(String resourceGroupName, String domainName) { - return getByResourceGroupAsync(resourceGroupName, domainName).block(); - } - - /** - * Get a domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of the domain. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a domain. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String domainName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, domainName, context).block(); - } - - /** - * Creates or updates a domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of the domain. - * @param domain Domain registration information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a domain. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String domainName, DomainInner domain) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (domainName == null) { - return Mono.error(new IllegalArgumentException("Parameter domainName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (domain == null) { - return Mono.error(new IllegalArgumentException("Parameter domain is required and cannot be null.")); - } else { - domain.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - domainName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - domain, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of the domain. - * @param domain Domain registration information. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a domain. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String domainName, DomainInner domain, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (domainName == null) { - return Mono.error(new IllegalArgumentException("Parameter domainName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (domain == null) { - return Mono.error(new IllegalArgumentException("Parameter domain is required and cannot be null.")); - } else { - domain.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - domainName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - domain, - accept, - context); - } - - /** - * Creates or updates a domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of the domain. - * @param domain Domain registration information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a domain. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, DomainInner> beginCreateOrUpdateAsync( - String resourceGroupName, String domainName, DomainInner domain) { - Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, domainName, domain); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), DomainInner.class, DomainInner.class, this.client.getContext()); - } - - /** - * Creates or updates a domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of the domain. - * @param domain Domain registration information. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a domain. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, DomainInner> beginCreateOrUpdateAsync( - String resourceGroupName, String domainName, DomainInner domain, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, domainName, domain, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), DomainInner.class, DomainInner.class, context); - } - - /** - * Creates or updates a domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of the domain. - * @param domain Domain registration information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a domain. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, DomainInner> beginCreateOrUpdate( - String resourceGroupName, String domainName, DomainInner domain) { - return beginCreateOrUpdateAsync(resourceGroupName, domainName, domain).getSyncPoller(); - } - - /** - * Creates or updates a domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of the domain. - * @param domain Domain registration information. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a domain. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, DomainInner> beginCreateOrUpdate( - String resourceGroupName, String domainName, DomainInner domain, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, domainName, domain, context).getSyncPoller(); - } - - /** - * Creates or updates a domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of the domain. - * @param domain Domain registration information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a domain. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync(String resourceGroupName, String domainName, DomainInner domain) { - return beginCreateOrUpdateAsync(resourceGroupName, domainName, domain) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of the domain. - * @param domain Domain registration information. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a domain. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String domainName, DomainInner domain, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, domainName, domain, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of the domain. - * @param domain Domain registration information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a domain. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DomainInner createOrUpdate(String resourceGroupName, String domainName, DomainInner domain) { - return createOrUpdateAsync(resourceGroupName, domainName, domain).block(); - } - - /** - * Creates or updates a domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of the domain. - * @param domain Domain registration information. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a domain. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DomainInner createOrUpdate( - String resourceGroupName, String domainName, DomainInner domain, Context context) { - return createOrUpdateAsync(resourceGroupName, domainName, domain, context).block(); - } - - /** - * Delete a domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of the domain. - * @param forceHardDeleteDomain Specify <code>true</code> to delete the domain immediately. The default - * is <code>false</code> which deletes the domain after 24 hours. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync( - String resourceGroupName, String domainName, Boolean forceHardDeleteDomain) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (domainName == null) { - return Mono.error(new IllegalArgumentException("Parameter domainName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - domainName, - forceHardDeleteDomain, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete a domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of the domain. - * @param forceHardDeleteDomain Specify <code>true</code> to delete the domain immediately. The default - * is <code>false</code> which deletes the domain after 24 hours. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String domainName, Boolean forceHardDeleteDomain, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (domainName == null) { - return Mono.error(new IllegalArgumentException("Parameter domainName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - domainName, - forceHardDeleteDomain, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Delete a domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of the domain. - * @param forceHardDeleteDomain Specify <code>true</code> to delete the domain immediately. The default - * is <code>false</code> which deletes the domain after 24 hours. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String domainName, Boolean forceHardDeleteDomain) { - return deleteWithResponseAsync(resourceGroupName, domainName, forceHardDeleteDomain) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Delete a domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of the domain. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String domainName) { - final Boolean forceHardDeleteDomain = null; - return deleteWithResponseAsync(resourceGroupName, domainName, forceHardDeleteDomain) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Delete a domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of the domain. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String domainName) { - final Boolean forceHardDeleteDomain = null; - deleteAsync(resourceGroupName, domainName, forceHardDeleteDomain).block(); - } - - /** - * Delete a domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of the domain. - * @param forceHardDeleteDomain Specify <code>true</code> to delete the domain immediately. The default - * is <code>false</code> which deletes the domain after 24 hours. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse( - String resourceGroupName, String domainName, Boolean forceHardDeleteDomain, Context context) { - return deleteWithResponseAsync(resourceGroupName, domainName, forceHardDeleteDomain, context).block(); - } - - /** - * Creates or updates a domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of the domain. - * @param domain Domain registration information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a domain. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateWithResponseAsync( - String resourceGroupName, String domainName, DomainPatchResource domain) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (domainName == null) { - return Mono.error(new IllegalArgumentException("Parameter domainName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (domain == null) { - return Mono.error(new IllegalArgumentException("Parameter domain is required and cannot be null.")); - } else { - domain.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - resourceGroupName, - domainName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - domain, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of the domain. - * @param domain Domain registration information. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a domain. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, String domainName, DomainPatchResource domain, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (domainName == null) { - return Mono.error(new IllegalArgumentException("Parameter domainName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (domain == null) { - return Mono.error(new IllegalArgumentException("Parameter domain is required and cannot be null.")); - } else { - domain.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - resourceGroupName, - domainName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - domain, - accept, - context); - } - - /** - * Creates or updates a domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of the domain. - * @param domain Domain registration information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a domain. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync(String resourceGroupName, String domainName, DomainPatchResource domain) { - return updateWithResponseAsync(resourceGroupName, domainName, domain) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates or updates a domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of the domain. - * @param domain Domain registration information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a domain. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DomainInner update(String resourceGroupName, String domainName, DomainPatchResource domain) { - return updateAsync(resourceGroupName, domainName, domain).block(); - } - - /** - * Creates or updates a domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of the domain. - * @param domain Domain registration information. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a domain. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, String domainName, DomainPatchResource domain, Context context) { - return updateWithResponseAsync(resourceGroupName, domainName, domain, context).block(); - } - - /** - * Lists domain ownership identifiers. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of domain. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of domain ownership identifiers. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listOwnershipIdentifiersSinglePageAsync( - String resourceGroupName, String domainName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (domainName == null) { - return Mono.error(new IllegalArgumentException("Parameter domainName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listOwnershipIdentifiers( - this.client.getEndpoint(), - resourceGroupName, - domainName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists domain ownership identifiers. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of domain. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of domain ownership identifiers. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listOwnershipIdentifiersSinglePageAsync( - String resourceGroupName, String domainName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (domainName == null) { - return Mono.error(new IllegalArgumentException("Parameter domainName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listOwnershipIdentifiers( - this.client.getEndpoint(), - resourceGroupName, - domainName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists domain ownership identifiers. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of domain. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of domain ownership identifiers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listOwnershipIdentifiersAsync( - String resourceGroupName, String domainName) { - return new PagedFlux<>( - () -> listOwnershipIdentifiersSinglePageAsync(resourceGroupName, domainName), - nextLink -> listOwnershipIdentifiersNextSinglePageAsync(nextLink)); - } - - /** - * Lists domain ownership identifiers. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of domain. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of domain ownership identifiers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listOwnershipIdentifiersAsync( - String resourceGroupName, String domainName, Context context) { - return new PagedFlux<>( - () -> listOwnershipIdentifiersSinglePageAsync(resourceGroupName, domainName, context), - nextLink -> listOwnershipIdentifiersNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists domain ownership identifiers. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of domain. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of domain ownership identifiers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listOwnershipIdentifiers( - String resourceGroupName, String domainName) { - return new PagedIterable<>(listOwnershipIdentifiersAsync(resourceGroupName, domainName)); - } - - /** - * Lists domain ownership identifiers. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of domain. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of domain ownership identifiers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listOwnershipIdentifiers( - String resourceGroupName, String domainName, Context context) { - return new PagedIterable<>(listOwnershipIdentifiersAsync(resourceGroupName, domainName, context)); - } - - /** - * Get ownership identifier for domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of domain. - * @param name Name of identifier. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ownership identifier for domain. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getOwnershipIdentifierWithResponseAsync( - String resourceGroupName, String domainName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (domainName == null) { - return Mono.error(new IllegalArgumentException("Parameter domainName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getOwnershipIdentifier( - this.client.getEndpoint(), - resourceGroupName, - domainName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get ownership identifier for domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of domain. - * @param name Name of identifier. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ownership identifier for domain. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getOwnershipIdentifierWithResponseAsync( - String resourceGroupName, String domainName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (domainName == null) { - return Mono.error(new IllegalArgumentException("Parameter domainName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getOwnershipIdentifier( - this.client.getEndpoint(), - resourceGroupName, - domainName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Get ownership identifier for domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of domain. - * @param name Name of identifier. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ownership identifier for domain. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getOwnershipIdentifierAsync( - String resourceGroupName, String domainName, String name) { - return getOwnershipIdentifierWithResponseAsync(resourceGroupName, domainName, name) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get ownership identifier for domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of domain. - * @param name Name of identifier. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ownership identifier for domain. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DomainOwnershipIdentifierInner getOwnershipIdentifier( - String resourceGroupName, String domainName, String name) { - return getOwnershipIdentifierAsync(resourceGroupName, domainName, name).block(); - } - - /** - * Get ownership identifier for domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of domain. - * @param name Name of identifier. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ownership identifier for domain. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getOwnershipIdentifierWithResponse( - String resourceGroupName, String domainName, String name, Context context) { - return getOwnershipIdentifierWithResponseAsync(resourceGroupName, domainName, name, context).block(); - } - - /** - * Creates an ownership identifier for a domain or updates identifier details for an existing identifier. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of domain. - * @param name Name of identifier. - * @param domainOwnershipIdentifier A JSON representation of the domain ownership properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return domain ownership Identifier. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateOwnershipIdentifierWithResponseAsync( - String resourceGroupName, - String domainName, - String name, - DomainOwnershipIdentifierInner domainOwnershipIdentifier) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (domainName == null) { - return Mono.error(new IllegalArgumentException("Parameter domainName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (domainOwnershipIdentifier == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter domainOwnershipIdentifier is required and cannot be null.")); - } else { - domainOwnershipIdentifier.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdateOwnershipIdentifier( - this.client.getEndpoint(), - resourceGroupName, - domainName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - domainOwnershipIdentifier, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates an ownership identifier for a domain or updates identifier details for an existing identifier. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of domain. - * @param name Name of identifier. - * @param domainOwnershipIdentifier A JSON representation of the domain ownership properties. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return domain ownership Identifier. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateOwnershipIdentifierWithResponseAsync( - String resourceGroupName, - String domainName, - String name, - DomainOwnershipIdentifierInner domainOwnershipIdentifier, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (domainName == null) { - return Mono.error(new IllegalArgumentException("Parameter domainName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (domainOwnershipIdentifier == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter domainOwnershipIdentifier is required and cannot be null.")); - } else { - domainOwnershipIdentifier.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdateOwnershipIdentifier( - this.client.getEndpoint(), - resourceGroupName, - domainName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - domainOwnershipIdentifier, - accept, - context); - } - - /** - * Creates an ownership identifier for a domain or updates identifier details for an existing identifier. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of domain. - * @param name Name of identifier. - * @param domainOwnershipIdentifier A JSON representation of the domain ownership properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return domain ownership Identifier. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateOwnershipIdentifierAsync( - String resourceGroupName, - String domainName, - String name, - DomainOwnershipIdentifierInner domainOwnershipIdentifier) { - return createOrUpdateOwnershipIdentifierWithResponseAsync( - resourceGroupName, domainName, name, domainOwnershipIdentifier) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates an ownership identifier for a domain or updates identifier details for an existing identifier. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of domain. - * @param name Name of identifier. - * @param domainOwnershipIdentifier A JSON representation of the domain ownership properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return domain ownership Identifier. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DomainOwnershipIdentifierInner createOrUpdateOwnershipIdentifier( - String resourceGroupName, - String domainName, - String name, - DomainOwnershipIdentifierInner domainOwnershipIdentifier) { - return createOrUpdateOwnershipIdentifierAsync(resourceGroupName, domainName, name, domainOwnershipIdentifier) - .block(); - } - - /** - * Creates an ownership identifier for a domain or updates identifier details for an existing identifier. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of domain. - * @param name Name of identifier. - * @param domainOwnershipIdentifier A JSON representation of the domain ownership properties. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return domain ownership Identifier. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateOwnershipIdentifierWithResponse( - String resourceGroupName, - String domainName, - String name, - DomainOwnershipIdentifierInner domainOwnershipIdentifier, - Context context) { - return createOrUpdateOwnershipIdentifierWithResponseAsync( - resourceGroupName, domainName, name, domainOwnershipIdentifier, context) - .block(); - } - - /** - * Delete ownership identifier for domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of domain. - * @param name Name of identifier. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteOwnershipIdentifierWithResponseAsync( - String resourceGroupName, String domainName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (domainName == null) { - return Mono.error(new IllegalArgumentException("Parameter domainName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .deleteOwnershipIdentifier( - this.client.getEndpoint(), - resourceGroupName, - domainName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete ownership identifier for domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of domain. - * @param name Name of identifier. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteOwnershipIdentifierWithResponseAsync( - String resourceGroupName, String domainName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (domainName == null) { - return Mono.error(new IllegalArgumentException("Parameter domainName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .deleteOwnershipIdentifier( - this.client.getEndpoint(), - resourceGroupName, - domainName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Delete ownership identifier for domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of domain. - * @param name Name of identifier. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteOwnershipIdentifierAsync(String resourceGroupName, String domainName, String name) { - return deleteOwnershipIdentifierWithResponseAsync(resourceGroupName, domainName, name) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Delete ownership identifier for domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of domain. - * @param name Name of identifier. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteOwnershipIdentifier(String resourceGroupName, String domainName, String name) { - deleteOwnershipIdentifierAsync(resourceGroupName, domainName, name).block(); - } - - /** - * Delete ownership identifier for domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of domain. - * @param name Name of identifier. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteOwnershipIdentifierWithResponse( - String resourceGroupName, String domainName, String name, Context context) { - return deleteOwnershipIdentifierWithResponseAsync(resourceGroupName, domainName, name, context).block(); - } - - /** - * Creates an ownership identifier for a domain or updates identifier details for an existing identifier. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of domain. - * @param name Name of identifier. - * @param domainOwnershipIdentifier A JSON representation of the domain ownership properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return domain ownership Identifier. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateOwnershipIdentifierWithResponseAsync( - String resourceGroupName, - String domainName, - String name, - DomainOwnershipIdentifierInner domainOwnershipIdentifier) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (domainName == null) { - return Mono.error(new IllegalArgumentException("Parameter domainName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (domainOwnershipIdentifier == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter domainOwnershipIdentifier is required and cannot be null.")); - } else { - domainOwnershipIdentifier.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updateOwnershipIdentifier( - this.client.getEndpoint(), - resourceGroupName, - domainName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - domainOwnershipIdentifier, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates an ownership identifier for a domain or updates identifier details for an existing identifier. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of domain. - * @param name Name of identifier. - * @param domainOwnershipIdentifier A JSON representation of the domain ownership properties. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return domain ownership Identifier. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateOwnershipIdentifierWithResponseAsync( - String resourceGroupName, - String domainName, - String name, - DomainOwnershipIdentifierInner domainOwnershipIdentifier, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (domainName == null) { - return Mono.error(new IllegalArgumentException("Parameter domainName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (domainOwnershipIdentifier == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter domainOwnershipIdentifier is required and cannot be null.")); - } else { - domainOwnershipIdentifier.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updateOwnershipIdentifier( - this.client.getEndpoint(), - resourceGroupName, - domainName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - domainOwnershipIdentifier, - accept, - context); - } - - /** - * Creates an ownership identifier for a domain or updates identifier details for an existing identifier. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of domain. - * @param name Name of identifier. - * @param domainOwnershipIdentifier A JSON representation of the domain ownership properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return domain ownership Identifier. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateOwnershipIdentifierAsync( - String resourceGroupName, - String domainName, - String name, - DomainOwnershipIdentifierInner domainOwnershipIdentifier) { - return updateOwnershipIdentifierWithResponseAsync( - resourceGroupName, domainName, name, domainOwnershipIdentifier) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates an ownership identifier for a domain or updates identifier details for an existing identifier. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of domain. - * @param name Name of identifier. - * @param domainOwnershipIdentifier A JSON representation of the domain ownership properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return domain ownership Identifier. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DomainOwnershipIdentifierInner updateOwnershipIdentifier( - String resourceGroupName, - String domainName, - String name, - DomainOwnershipIdentifierInner domainOwnershipIdentifier) { - return updateOwnershipIdentifierAsync(resourceGroupName, domainName, name, domainOwnershipIdentifier).block(); - } - - /** - * Creates an ownership identifier for a domain or updates identifier details for an existing identifier. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of domain. - * @param name Name of identifier. - * @param domainOwnershipIdentifier A JSON representation of the domain ownership properties. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return domain ownership Identifier. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateOwnershipIdentifierWithResponse( - String resourceGroupName, - String domainName, - String name, - DomainOwnershipIdentifierInner domainOwnershipIdentifier, - Context context) { - return updateOwnershipIdentifierWithResponseAsync( - resourceGroupName, domainName, name, domainOwnershipIdentifier, context) - .block(); - } - - /** - * Renew a domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of the domain. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> renewWithResponseAsync(String resourceGroupName, String domainName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (domainName == null) { - return Mono.error(new IllegalArgumentException("Parameter domainName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .renew( - this.client.getEndpoint(), - resourceGroupName, - domainName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Renew a domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of the domain. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> renewWithResponseAsync(String resourceGroupName, String domainName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (domainName == null) { - return Mono.error(new IllegalArgumentException("Parameter domainName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .renew( - this.client.getEndpoint(), - resourceGroupName, - domainName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Renew a domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of the domain. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono renewAsync(String resourceGroupName, String domainName) { - return renewWithResponseAsync(resourceGroupName, domainName).flatMap((Response res) -> Mono.empty()); - } - - /** - * Renew a domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of the domain. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void renew(String resourceGroupName, String domainName) { - renewAsync(resourceGroupName, domainName).block(); - } - - /** - * Renew a domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of the domain. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response renewWithResponse(String resourceGroupName, String domainName, Context context) { - return renewWithResponseAsync(resourceGroupName, domainName, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of domains. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of domains. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of domain name identifiers. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listRecommendationsNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listRecommendationsNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of domain name identifiers. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listRecommendationsNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listRecommendationsNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of domains. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of domains. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of domain ownership identifiers. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listOwnershipIdentifiersNextSinglePageAsync( - String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listOwnershipIdentifiersNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of domain ownership identifiers. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listOwnershipIdentifiersNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listOwnershipIdentifiersNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/FunctionAppBasicImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/FunctionAppBasicImpl.java deleted file mode 100644 index 655c2185d370..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/FunctionAppBasicImpl.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.implementation; - -import com.azure.resourcemanager.appservice.AppServiceManager; -import com.azure.resourcemanager.appservice.fluent.models.SiteInner; -import com.azure.resourcemanager.appservice.models.FunctionApp; -import com.azure.resourcemanager.appservice.models.FunctionAppBasic; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import reactor.core.publisher.Mono; - -class FunctionAppBasicImpl extends WebSiteBaseImpl implements FunctionAppBasic, HasManager { - - private final AppServiceManager myManager; - - FunctionAppBasicImpl(SiteInner innerObject, AppServiceManager myManager) { - super(innerObject); - this.myManager = myManager; - } - - @Override - public FunctionApp refresh() { - return this.refreshAsync().block(); - } - - @Override - public Mono refreshAsync() { - return this.manager().functionApps().getByIdAsync(this.id()) - .doOnNext(site -> this.setInner(site.innerModel())); - } - - @Override - public AppServiceManager manager() { - return myManager; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/FunctionAppImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/FunctionAppImpl.java deleted file mode 100644 index 8930d390a340..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/FunctionAppImpl.java +++ /dev/null @@ -1,700 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.UrlBuilder; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.AppServiceManager; -import com.azure.resourcemanager.appservice.fluent.models.HostKeysInner; -import com.azure.resourcemanager.appservice.fluent.models.SiteConfigResourceInner; -import com.azure.resourcemanager.appservice.fluent.models.SiteInner; -import com.azure.resourcemanager.appservice.fluent.models.SiteLogsConfigInner; -import com.azure.resourcemanager.appservice.models.AppServicePlan; -import com.azure.resourcemanager.appservice.models.FunctionApp; -import com.azure.resourcemanager.appservice.models.FunctionAuthenticationPolicy; -import com.azure.resourcemanager.appservice.models.FunctionDeploymentSlots; -import com.azure.resourcemanager.appservice.models.FunctionEnvelope; -import com.azure.resourcemanager.appservice.models.FunctionRuntimeStack; -import com.azure.resourcemanager.appservice.models.NameValuePair; -import com.azure.resourcemanager.appservice.models.OperatingSystem; -import com.azure.resourcemanager.appservice.models.PricingTier; -import com.azure.resourcemanager.appservice.models.SkuDescription; -import com.azure.resourcemanager.appservice.models.SkuName; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.Indexable; -import com.azure.resourcemanager.resources.fluentcore.policy.AuthenticationPolicy; -import com.azure.resourcemanager.resources.fluentcore.policy.AuxiliaryAuthenticationPolicy; -import com.azure.resourcemanager.resources.fluentcore.policy.ProviderRegistrationPolicy; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import com.azure.resourcemanager.storage.models.StorageAccount; -import com.azure.resourcemanager.storage.models.StorageAccountKey; -import com.azure.resourcemanager.storage.models.StorageAccountSkuType; -import com.fasterxml.jackson.annotation.JsonProperty; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.net.MalformedURLException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** The implementation for FunctionApp. */ -class FunctionAppImpl - extends AppServiceBaseImpl< - FunctionApp, FunctionAppImpl, FunctionApp.DefinitionStages.WithCreate, FunctionApp.Update> - implements FunctionApp, - FunctionApp.Definition, - FunctionApp.DefinitionStages.NewAppServicePlanWithGroup, - FunctionApp.DefinitionStages.ExistingLinuxPlanWithGroup, - FunctionApp.Update { - - private final ClientLogger logger = new ClientLogger(getClass()); - - private static final String SETTING_WEBSITE_CONTENTAZUREFILECONNECTIONSTRING = - "WEBSITE_CONTENTAZUREFILECONNECTIONSTRING"; - private static final String SETTING_WEBSITE_CONTENTSHARE = "WEBSITE_CONTENTSHARE"; - private static final String SETTING_WEB_JOBS_STORAGE = "AzureWebJobsStorage"; - private static final String SETTING_WEB_JOBS_DASHBOARD = "AzureWebJobsDashboard"; - - private Creatable storageAccountCreatable; - private StorageAccount storageAccountToSet; - private StorageAccount currentStorageAccount; - private FunctionService functionService; - private FunctionDeploymentSlots deploymentSlots; - - private String functionServiceHost; - - FunctionAppImpl( - final String name, - SiteInner innerObject, - SiteConfigResourceInner siteConfig, - SiteLogsConfigInner logConfig, - AppServiceManager manager) { - super(name, innerObject, siteConfig, logConfig, manager); - if (!isInCreateMode()) { - initializeFunctionService(); - } - } - - private void initializeFunctionService() { - if (functionService == null) { - UrlBuilder urlBuilder = UrlBuilder.parse(this.defaultHostname()); - String baseUrl; - if (urlBuilder.getScheme() == null) { - urlBuilder.setScheme("https"); - } - try { - baseUrl = urlBuilder.toUrl().toString(); - } catch (MalformedURLException e) { - throw logger.logExceptionAsError(new IllegalStateException(e)); - } - - List policies = new ArrayList<>(); - for (int i = 0, count = manager().httpPipeline().getPolicyCount(); i < count; ++i) { - HttpPipelinePolicy policy = manager().httpPipeline().getPolicy(i); - if (!(policy instanceof AuthenticationPolicy) - && !(policy instanceof ProviderRegistrationPolicy) - && !(policy instanceof AuxiliaryAuthenticationPolicy)) { - policies.add(policy); - } - } - policies.add(new FunctionAuthenticationPolicy(this)); - HttpPipeline httpPipeline = new HttpPipelineBuilder() - .policies(policies.toArray(new HttpPipelinePolicy[0])) - .httpClient(manager().httpPipeline().getHttpClient()) - .build(); - functionServiceHost = baseUrl; - functionService = - RestProxy.create(FunctionService.class, httpPipeline, - SerializerFactory.createDefaultManagementSerializerAdapter()); - } - } - - @Override - public void setInner(SiteInner innerObject) { - super.setInner(innerObject); - } - - @Override - public FunctionDeploymentSlots deploymentSlots() { - if (deploymentSlots == null) { - deploymentSlots = new FunctionDeploymentSlotsImpl(this); - } - return deploymentSlots; - } - - @Override - public FunctionAppImpl withNewConsumptionPlan() { - return withNewAppServicePlan(OperatingSystem.WINDOWS, new PricingTier(SkuName.DYNAMIC.toString(), "Y1")); - } - - @Override - public FunctionAppImpl withNewConsumptionPlan(String appServicePlanName) { - return withNewAppServicePlan( - appServicePlanName, OperatingSystem.WINDOWS, new PricingTier(SkuName.DYNAMIC.toString(), "Y1")); - } - - @Override - public FunctionAppImpl withRuntime(String runtime) { - return withAppSetting(SETTING_FUNCTIONS_WORKER_RUNTIME, runtime); - } - - @Override - public FunctionAppImpl withRuntimeVersion(String version) { - return withAppSetting(SETTING_FUNCTIONS_EXTENSION_VERSION, version.startsWith("~") ? version : "~" + version); - } - - @Override - public FunctionAppImpl withLatestRuntimeVersion() { - return withRuntimeVersion("latest"); - } - - @Override - Mono submitAppSettings() { - if (storageAccountCreatable != null && this.taskResult(storageAccountCreatable.key()) != null) { - storageAccountToSet = this.taskResult(storageAccountCreatable.key()); - } - if (storageAccountToSet == null) { - return super.submitAppSettings(); - } else { - return Flux - .concat( - storageAccountToSet - .getKeysAsync() - .map(storageAccountKeys -> storageAccountKeys.get(0)) - .zipWith( - this.manager().appServicePlans().getByIdAsync(this.appServicePlanId()), - (StorageAccountKey storageAccountKey, AppServicePlan appServicePlan) -> { - String connectionString = ResourceManagerUtils - .getStorageConnectionString(storageAccountToSet.name(), storageAccountKey.value(), - manager().environment()); - addAppSettingIfNotModified(SETTING_WEB_JOBS_STORAGE, connectionString); - addAppSettingIfNotModified(SETTING_WEB_JOBS_DASHBOARD, connectionString); - if (OperatingSystem.WINDOWS.equals(operatingSystem()) - && // as Portal logic, only Windows plan would have following appSettings - (appServicePlan == null - || isConsumptionOrPremiumAppServicePlan(appServicePlan.pricingTier()))) { - addAppSettingIfNotModified( - SETTING_WEBSITE_CONTENTAZUREFILECONNECTIONSTRING, connectionString); - addAppSettingIfNotModified( - SETTING_WEBSITE_CONTENTSHARE, - this.manager().resourceManager().internalContext() - .randomResourceName(name(), 32)); - } - return FunctionAppImpl.super.submitAppSettings(); - })) - .last() - .then( - Mono - .fromCallable( - () -> { - currentStorageAccount = storageAccountToSet; - storageAccountToSet = null; - storageAccountCreatable = null; - return this; - })); - } - } - - @Override - public OperatingSystem operatingSystem() { - return (innerModel().reserved() == null || !innerModel().reserved()) - ? OperatingSystem.WINDOWS : OperatingSystem.LINUX; - } - - private void addAppSettingIfNotModified(String key, String value) { - if (!appSettingModified(key)) { - withAppSetting(key, value); - } - } - - private boolean appSettingModified(String key) { - return (appSettingsToAdd != null && appSettingsToAdd.containsKey(key)) - || (appSettingsToRemove != null && appSettingsToRemove.contains(key)); - } - - private static boolean isConsumptionOrPremiumAppServicePlan(PricingTier pricingTier) { - if (pricingTier == null || pricingTier.toSkuDescription() == null) { - return true; - } - SkuDescription description = pricingTier.toSkuDescription(); - return SkuName.DYNAMIC.toString().equalsIgnoreCase(description.tier()) - || SkuName.ELASTIC_PREMIUM.toString().equalsIgnoreCase(description.tier()); - } - - @Override - FunctionAppImpl withNewAppServicePlan(OperatingSystem operatingSystem, PricingTier pricingTier) { - return super.withNewAppServicePlan(operatingSystem, pricingTier).autoSetAlwaysOn(pricingTier); - } - - @Override - FunctionAppImpl withNewAppServicePlan( - String appServicePlan, OperatingSystem operatingSystem, PricingTier pricingTier) { - return super.withNewAppServicePlan(appServicePlan, operatingSystem, pricingTier).autoSetAlwaysOn(pricingTier); - } - - @Override - public FunctionAppImpl withExistingAppServicePlan(AppServicePlan appServicePlan) { - super.withExistingAppServicePlan(appServicePlan); - return autoSetAlwaysOn(appServicePlan.pricingTier()); - } - - private FunctionAppImpl autoSetAlwaysOn(PricingTier pricingTier) { - SkuDescription description = pricingTier.toSkuDescription(); - if (description.tier().equalsIgnoreCase(SkuName.BASIC.toString()) - || description.tier().equalsIgnoreCase(SkuName.STANDARD.toString()) - || description.tier().equalsIgnoreCase(SkuName.PREMIUM.toString()) - || description.tier().equalsIgnoreCase(SkuName.PREMIUM_V2.toString()) - || description.tier().equalsIgnoreCase(PricingTier.PREMIUM_P1V3.toSkuDescription().tier()) // PremiumV3 - ) { - return withWebAppAlwaysOn(true); - } else { - return withWebAppAlwaysOn(false); - } - } - - @Override - public FunctionAppImpl withNewStorageAccount(String name, StorageAccountSkuType sku) { - StorageAccount.DefinitionStages.WithGroup storageDefine = - manager().storageManager().storageAccounts().define(name).withRegion(regionName()); - if (super.creatableGroup != null && isInCreateMode()) { - storageAccountCreatable = - storageDefine - .withNewResourceGroup(super.creatableGroup) - .withGeneralPurposeAccountKindV2() - .withSku(sku); - } else { - storageAccountCreatable = - storageDefine - .withExistingResourceGroup(resourceGroupName()) - .withGeneralPurposeAccountKindV2() - .withSku(sku); - } - this.addDependency(storageAccountCreatable); - return this; - } - - @Override - public FunctionAppImpl withNewStorageAccount(Creatable storageAccount) { - storageAccountCreatable = storageAccount; - this.addDependency(storageAccountCreatable); - return this; - } - - @Override - public FunctionAppImpl withExistingStorageAccount(StorageAccount storageAccount) { - this.storageAccountToSet = storageAccount; - return this; - } - - @Override - public FunctionAppImpl withDailyUsageQuota(int quota) { - innerModel().withDailyMemoryTimeQuota(quota); - return this; - } - - @Override - public FunctionAppImpl withoutDailyUsageQuota() { - return withDailyUsageQuota(0); - } - - @Override - public FunctionAppImpl withNewLinuxConsumptionPlan() { - return withNewAppServicePlan(OperatingSystem.LINUX, new PricingTier(SkuName.DYNAMIC.toString(), "Y1")); - } - - @Override - public FunctionAppImpl withNewLinuxConsumptionPlan(String appServicePlanName) { - return withNewAppServicePlan( - appServicePlanName, OperatingSystem.LINUX, new PricingTier(SkuName.DYNAMIC.toString(), "Y1")); - } - - @Override - public FunctionAppImpl withNewLinuxAppServicePlan(PricingTier pricingTier) { - return super.withNewAppServicePlan(OperatingSystem.LINUX, pricingTier); - } - - @Override - public FunctionAppImpl withNewLinuxAppServicePlan(String appServicePlanName, PricingTier pricingTier) { - return super.withNewAppServicePlan(appServicePlanName, OperatingSystem.LINUX, pricingTier); - } - - @Override - public FunctionAppImpl withNewLinuxAppServicePlan(Creatable appServicePlanCreatable) { - super.withNewAppServicePlan(appServicePlanCreatable); - if (appServicePlanCreatable instanceof AppServicePlan) { - this.autoSetAlwaysOn(((AppServicePlan) appServicePlanCreatable).pricingTier()); - } - return this; - } - - @Override - public FunctionAppImpl withExistingLinuxAppServicePlan(AppServicePlan appServicePlan) { - return super.withExistingAppServicePlan(appServicePlan).autoSetAlwaysOn(appServicePlan.pricingTier()); - } - - @Override - public FunctionAppImpl withBuiltInImage(final FunctionRuntimeStack runtimeStack) { - ensureLinuxPlan(); - cleanUpContainerSettings(); - if (siteConfig == null) { - siteConfig = new SiteConfigResourceInner(); - } - withRuntime(runtimeStack.runtime()); - withRuntimeVersion(runtimeStack.version()); - siteConfig.withLinuxFxVersion(runtimeStack.getLinuxFxVersion()); - return this; - } - - @Override - public FunctionAppImpl withPublicDockerHubImage(String imageAndTag) { - ensureLinuxPlan(); - return super.withPublicDockerHubImage(imageAndTag); - } - - @Override - public FunctionAppImpl withPrivateDockerHubImage(String imageAndTag) { - ensureLinuxPlan(); - return super.withPublicDockerHubImage(imageAndTag); - } - - @Override - public FunctionAppImpl withPrivateRegistryImage(String imageAndTag, String serverUrl) { - ensureLinuxPlan(); - return super.withPrivateRegistryImage(imageAndTag, serverUrl); - } - - @Override - protected void cleanUpContainerSettings() { - if (siteConfig != null && siteConfig.linuxFxVersion() != null) { - siteConfig.withLinuxFxVersion(null); - } - if (siteConfig != null && siteConfig.windowsFxVersion() != null) { - siteConfig.withWindowsFxVersion(null); - } - // Docker Hub - withoutAppSetting(SETTING_DOCKER_IMAGE); - withoutAppSetting(SETTING_REGISTRY_SERVER); - withoutAppSetting(SETTING_REGISTRY_USERNAME); - withoutAppSetting(SETTING_REGISTRY_PASSWORD); - } - - @Override - protected OperatingSystem appServicePlanOperatingSystem(AppServicePlan appServicePlan) { - // Consumption plan or premium (elastic) plan would have "functionapp" or "elastic" in "kind" property, no - // "linux" in it. - return (appServicePlan.innerModel().reserved() == null || !appServicePlan.innerModel().reserved()) - ? OperatingSystem.WINDOWS - : OperatingSystem.LINUX; - } - - @Override - public StorageAccount storageAccount() { - return currentStorageAccount; - } - - @Override - public String getMasterKey() { - return getMasterKeyAsync().block(); - } - - @Override - public Mono getMasterKeyAsync() { - return this.manager().serviceClient().getWebApps().listHostKeysAsync(resourceGroupName(), name()) - .map(HostKeysInner::masterKey); - } - - @Override - public PagedIterable listFunctions() { - return this.manager().functionApps().listFunctions(resourceGroupName(), name()); - } - - @Override - public Map listFunctionKeys(String functionName) { - return listFunctionKeysAsync(functionName).block(); - } - - @Override - public Mono> listFunctionKeysAsync(final String functionName) { - return functionService - .listFunctionKeys(functionServiceHost, functionName) - .map( - result -> { - Map keys = new HashMap<>(); - if (result.keys != null) { - for (NameValuePair pair : result.keys) { - keys.put(pair.name(), pair.value()); - } - } - return keys; - }); - } - - @Override - public NameValuePair addFunctionKey(String functionName, String keyName, String keyValue) { - return addFunctionKeyAsync(functionName, keyName, keyValue).block(); - } - - @Override - public Mono addFunctionKeyAsync(String functionName, String keyName, String keyValue) { - if (keyValue != null) { - return functionService - .addFunctionKey( - functionServiceHost, - functionName, - keyName, - new NameValuePair().withName(keyName).withValue(keyValue)); - } else { - return functionService.generateFunctionKey(functionServiceHost, functionName, keyName); - } - } - - @Override - public void removeFunctionKey(String functionName, String keyName) { - removeFunctionKeyAsync(functionName, keyName).block(); - } - - @Override - public Mono removeFunctionKeyAsync(String functionName, String keyName) { - return functionService.deleteFunctionKey(functionServiceHost, functionName, keyName); - } - - @Override - public void triggerFunction(String functionName, Object payload) { - triggerFunctionAsync(functionName, payload).block(); - } - - @Override - public Mono triggerFunctionAsync(String functionName, Object payload) { - return functionService.triggerFunction(functionServiceHost, functionName, payload); - } - - @Override - public void syncTriggers() { - syncTriggersAsync().block(); - } - - @Override - public Mono syncTriggersAsync() { - return manager() - .serviceClient() - .getWebApps() - .syncFunctionTriggersAsync(resourceGroupName(), name()) - .onErrorResume( - throwable -> { - if (throwable instanceof ManagementException - && ((ManagementException) throwable).getResponse().getStatusCode() == 200) { - return Mono.empty(); - } else { - return Mono.error(throwable); - } - }); - } - - @Override - public Flux streamApplicationLogsAsync() { - return functionService - .ping(functionServiceHost) - .then(functionService.getHostStatus(functionServiceHost)) - .thenMany(FunctionAppImpl.super.streamApplicationLogsAsync()); - } - - @Override - public Flux streamHttpLogsAsync() { - return functionService - .ping(functionServiceHost) - .then(functionService.getHostStatus(functionServiceHost)) - .thenMany(FunctionAppImpl.super.streamHttpLogsAsync()); - } - - @Override - public Flux streamTraceLogsAsync() { - return functionService - .ping(functionServiceHost) - .then(functionService.getHostStatus(functionServiceHost)) - .thenMany(FunctionAppImpl.super.streamTraceLogsAsync()); - } - - @Override - public Flux streamDeploymentLogsAsync() { - return functionService - .ping(functionServiceHost) - .then(functionService.getHostStatus(functionServiceHost)) - .thenMany(FunctionAppImpl.super.streamDeploymentLogsAsync()); - } - - @Override - public Flux streamAllLogsAsync() { - return functionService - .ping(functionServiceHost) - .then(functionService.getHostStatus(functionServiceHost)) - .thenMany(FunctionAppImpl.super.streamAllLogsAsync()); - } - - @Override - public Mono zipDeployAsync(File zipFile) { - try { - return kuduClient.zipDeployAsync(zipFile); - } catch (IOException e) { - return Mono.error(e); - } - } - - @Override - public void zipDeploy(File zipFile) { - zipDeployAsync(zipFile).block(); - } - - @Override - public Mono zipDeployAsync(InputStream zipFile, long length) { - return kuduClient.zipDeployAsync(zipFile, length); - } - - @Override - public void zipDeploy(InputStream zipFile, long length) { - zipDeployAsync(zipFile, length).block(); - } - - @Override - public Mono createAsync() { - if (this.isInCreateMode()) { - if (innerModel().serverFarmId() == null) { - withNewConsumptionPlan(); - } - if (currentStorageAccount == null && storageAccountToSet == null && storageAccountCreatable == null) { - withNewStorageAccount( - this.manager().resourceManager().internalContext() - .randomResourceName(getStorageAccountName(), 20), - StorageAccountSkuType.STANDARD_LRS); - } - } - return super.createAsync(); - } - - @Override - public Mono afterPostRunAsync(final boolean isGroupFaulted) { - if (!isGroupFaulted) { - initializeFunctionService(); - } - return super.afterPostRunAsync(isGroupFaulted); - } - - @Host("{$host}") - @ServiceInterface(name = "FunctionService") - private interface FunctionService { - @Headers({ - "Accept: application/json", - "Content-Type: application/json; charset=utf-8" - }) - @Get("admin/functions/{name}/keys") - Mono listFunctionKeys( - @HostParam("$host") String host, @PathParam("name") String functionName); - - @Headers({ - "Accept: application/json", - "Content-Type: application/json; charset=utf-8" - }) - @Put("admin/functions/{name}/keys/{keyName}") - Mono addFunctionKey( - @HostParam("$host") String host, - @PathParam("name") String functionName, - @PathParam("keyName") String keyName, - @BodyParam("application/json") NameValuePair key); - - @Headers({ - "Accept: application/json", - "Content-Type: application/json; charset=utf-8" - }) - @Post("admin/functions/{name}/keys/{keyName}") - Mono generateFunctionKey( - @HostParam("$host") String host, - @PathParam("name") String functionName, - @PathParam("keyName") String keyName); - - @Headers({ - "Content-Type: application/json; charset=utf-8" - }) - @Delete("admin/functions/{name}/keys/{keyName}") - Mono deleteFunctionKey( - @HostParam("$host") String host, - @PathParam("name") String functionName, - @PathParam("keyName") String keyName); - - @Headers({ - "Content-Type: application/json; charset=utf-8" - }) - @Post("admin/host/ping") - Mono ping(@HostParam("$host") String host); - - @Headers({ - "Content-Type: application/json; charset=utf-8" - }) - @Get("admin/host/status") - Mono getHostStatus(@HostParam("$host") String host); - - @Headers({ - "Content-Type: application/json; charset=utf-8" - }) - @Post("admin/functions/{name}") - Mono triggerFunction( - @HostParam("$host") String host, - @PathParam("name") String functionName, - @BodyParam("application/json") Object payload); - } - - private static class FunctionKeyListResult { - @JsonProperty("keys") - private List keys; - } - - private String getStorageAccountName() { - return name().replaceAll("[^a-zA-Z0-9]", ""); - } - - /* - private static final class FunctionCredential implements TokenCredential { - private final FunctionAppImpl functionApp; - - private FunctionCredential(FunctionAppImpl functionApp) { - this.functionApp = functionApp; - } - - @Override - public Mono getToken(TokenRequestContext request) { - return functionApp.manager().inner().getWebApps() - .getFunctionsAdminTokenAsync(functionApp.resourceGroupName(), functionApp.name()) - .map(token -> { - String jwt = new String(Base64.getUrlDecoder().decode(token.split("\\.")[1])); - Pattern pattern = Pattern.compile("\"exp\": *([0-9]+),"); - Matcher matcher = pattern.matcher(jwt); - matcher.find(); - long expire = Long.parseLong(matcher.group(1)); - return new AccessToken(token, OffsetDateTime.ofInstant( - Instant.ofEpochMilli(expire), ZoneOffset.UTC)); - }); - } - } - */ -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/FunctionAppsImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/FunctionAppsImpl.java deleted file mode 100644 index 1e40c5388423..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/FunctionAppsImpl.java +++ /dev/null @@ -1,191 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.CoreUtils; -import com.azure.resourcemanager.appservice.AppServiceManager; -import com.azure.resourcemanager.appservice.fluent.WebAppsClient; -import com.azure.resourcemanager.appservice.fluent.models.SiteConfigResourceInner; -import com.azure.resourcemanager.appservice.fluent.models.SiteInner; -import com.azure.resourcemanager.appservice.fluent.models.SiteLogsConfigInner; -import com.azure.resourcemanager.appservice.models.FunctionApp; -import com.azure.resourcemanager.appservice.models.FunctionAppBasic; -import com.azure.resourcemanager.appservice.models.FunctionApps; -import com.azure.resourcemanager.appservice.models.FunctionEnvelope; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsBatchDeletion; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.BatchDeletionImpl; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.GroupableResourcesImpl; -import com.azure.resourcemanager.resources.fluentcore.utils.PagedConverter; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.List; -import java.util.regex.Pattern; - -/** The implementation for WebApps. */ -public class FunctionAppsImpl - extends GroupableResourcesImpl - implements FunctionApps, SupportsBatchDeletion { - - public FunctionAppsImpl(final AppServiceManager manager) { - super(manager.serviceClient().getWebApps(), manager); - } - - @Override - public FunctionApp getByResourceGroup(String groupName, String name) { - SiteInner siteInner = this.inner().getByResourceGroup(groupName, name); - if (siteInner == null) { - return null; - } - return wrapModel( - siteInner, - this.inner().getConfiguration(groupName, name), - this.inner().getDiagnosticLogsConfiguration(groupName, name)); - } - - @Override - public Mono getByResourceGroupAsync(final String resourceGroupName, final String name) { - if (CoreUtils.isNullOrEmpty(resourceGroupName)) { - return Mono.error( - new IllegalArgumentException("Parameter 'resourceGroupName' is required and cannot be null.")); - } - if (CoreUtils.isNullOrEmpty(name)) { - return Mono.error( - new IllegalArgumentException("Parameter 'name' is required and cannot be null.")); - } - return this - .getInnerAsync(resourceGroupName, name) - .flatMap( - siteInner -> - Mono - .zip( - this.inner().getConfigurationAsync(resourceGroupName, name), - this.inner().getDiagnosticLogsConfigurationAsync(resourceGroupName, name), - (SiteConfigResourceInner siteConfigResourceInner, SiteLogsConfigInner logsConfigInner) -> - wrapModel(siteInner, siteConfigResourceInner, logsConfigInner))); - } - - @Override - protected Mono getInnerAsync(String resourceGroupName, String name) { - return this.inner().getByResourceGroupAsync(resourceGroupName, name); - } - - @Override - public PagedIterable listFunctions(String resourceGroupName, String name) { - return PagedConverter.mapPage(this - .manager() - .serviceClient() - .getWebApps() - .listFunctions(resourceGroupName, name), - FunctionEnvelopeImpl::new); - } - - @Override - protected Mono deleteInnerAsync(String resourceGroupName, String name) { - return this.inner().deleteAsync(resourceGroupName, name); - } - - @Override - protected FunctionAppImpl wrapModel(String name) { - return new FunctionAppImpl(name, new SiteInner().withKind("functionapp"), null, null, this.manager()); - } - - @Override - protected FunctionAppImpl wrapModel(SiteInner inner) { - if (inner == null) { - return null; - } - return wrapModel(inner, null, null); - } - - private FunctionAppImpl wrapModel( - SiteInner inner, SiteConfigResourceInner siteConfig, SiteLogsConfigInner logConfig) { - if (inner == null) { - return null; - } - return new FunctionAppImpl(inner.name(), inner, siteConfig, logConfig, this.manager()); - } - - @Override - public FunctionAppImpl define(String name) { - return wrapModel(name); - } - - @Override - public Mono deleteByResourceGroupAsync(String resourceGroupName, String name) { - if (CoreUtils.isNullOrEmpty(resourceGroupName)) { - return Mono.error( - new IllegalArgumentException("Parameter 'resourceGroupName' is required and cannot be null.")); - } - if (CoreUtils.isNullOrEmpty(name)) { - return Mono.error( - new IllegalArgumentException("Parameter 'name' is required and cannot be null.")); - } - return this.inner().deleteAsync(resourceGroupName, name); - } - - @Override - public Flux deleteByIdsAsync(Collection ids) { - return BatchDeletionImpl.deleteByIdsAsync(ids, this::deleteInnerAsync); - } - - @Override - public Flux deleteByIdsAsync(String... ids) { - return this.deleteByIdsAsync(new ArrayList<>(Arrays.asList(ids))); - } - - @Override - public void deleteByIds(Collection ids) { - if (ids != null && !ids.isEmpty()) { - this.deleteByIdsAsync(ids).blockLast(); - } - } - - @Override - public void deleteByIds(String... ids) { - this.deleteByIds(new ArrayList<>(Arrays.asList(ids))); - } - - @Override - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(this.listByResourceGroupAsync(resourceGroupName)); - } - - @Override - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - if (CoreUtils.isNullOrEmpty(resourceGroupName)) { - return new PagedFlux<>(() -> Mono.error( - new IllegalArgumentException("Parameter 'resourceGroupName' is required and cannot be null."))); - } - return PagedConverter.flatMapPage(inner().listByResourceGroupAsync(resourceGroupName), - inner -> isFunctionApp(inner) ? Mono.just(new FunctionAppBasicImpl(inner, this.manager())) : Mono.empty()); - } - - @Override - public PagedIterable list() { - return new PagedIterable<>(this.listAsync()); - } - - @Override - public PagedFlux listAsync() { - return PagedConverter.flatMapPage(inner().listAsync(), - inner -> isFunctionApp(inner) ? Mono.just(new FunctionAppBasicImpl(inner, this.manager())) : Mono.empty()); - } - - private static boolean isFunctionApp(SiteInner inner) { - boolean ret = false; - if (inner.kind() != null) { - List kinds = Arrays.asList(inner.kind().split(Pattern.quote(","))); - if (kinds.contains("functionapp") && !kinds.contains("kubernetes")) { - ret = true; - } - } - return ret; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/FunctionDeploymentSlotBasicImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/FunctionDeploymentSlotBasicImpl.java deleted file mode 100644 index a3a6d28af848..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/FunctionDeploymentSlotBasicImpl.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.implementation; - -import com.azure.resourcemanager.appservice.fluent.models.SiteInner; -import com.azure.resourcemanager.appservice.models.FunctionApp; -import com.azure.resourcemanager.appservice.models.FunctionDeploymentSlot; -import com.azure.resourcemanager.appservice.models.FunctionDeploymentSlotBasic; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasParent; -import reactor.core.publisher.Mono; - -class FunctionDeploymentSlotBasicImpl extends WebSiteBaseImpl - implements FunctionDeploymentSlotBasic, HasParent { - - private final FunctionApp myParent; - - FunctionDeploymentSlotBasicImpl(SiteInner innerObject, FunctionApp myParent) { - super(innerObject); - this.myParent = myParent; - } - - @Override - public String name() { - return super.name().replaceAll(".*/", ""); - } - - @Override - public FunctionDeploymentSlot refresh() { - return this.refreshAsync().block(); - } - - @Override - public Mono refreshAsync() { - return this.parent().deploymentSlots().getByIdAsync(this.id()) - .doOnNext(site -> this.setInner(site.innerModel())); - } - - @Override - public FunctionApp parent() { - return myParent; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/FunctionDeploymentSlotImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/FunctionDeploymentSlotImpl.java deleted file mode 100644 index 8e4be1444653..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/FunctionDeploymentSlotImpl.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.implementation; - -import com.azure.resourcemanager.appservice.fluent.models.HostKeysInner; -import com.azure.resourcemanager.appservice.fluent.models.SitePatchResourceInner; -import com.azure.resourcemanager.appservice.models.DeploymentSlotBase; -import com.azure.resourcemanager.appservice.models.FunctionApp; -import com.azure.resourcemanager.appservice.models.FunctionDeploymentSlot; -import com.azure.resourcemanager.appservice.fluent.models.SiteConfigResourceInner; -import com.azure.resourcemanager.appservice.fluent.models.SiteInner; -import com.azure.resourcemanager.appservice.fluent.models.SiteLogsConfigInner; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import reactor.core.publisher.Mono; - -/** The implementation for FunctionDeploymentSlot. */ -class FunctionDeploymentSlotImpl - extends DeploymentSlotBaseImpl< - FunctionDeploymentSlot, - FunctionDeploymentSlotImpl, - FunctionAppImpl, - FunctionDeploymentSlot.DefinitionStages.WithCreate, - DeploymentSlotBase> - implements FunctionDeploymentSlot, FunctionDeploymentSlot.Definition { - - FunctionDeploymentSlotImpl( - String name, - SiteInner innerObject, - SiteConfigResourceInner siteConfig, - SiteLogsConfigInner logConfig, - FunctionAppImpl parent) { - super(name, innerObject, siteConfig, logConfig, parent); - } - - @Override - public FunctionDeploymentSlot.DefinitionStages.WithCreate withConfigurationFromParent() { - return withConfigurationFromFunctionApp(this.parent()); - } - - @Override - public FunctionDeploymentSlot.DefinitionStages.WithCreate withConfigurationFromFunctionApp(FunctionApp app) { - this.siteConfig = ((WebAppBaseImpl) app).siteConfig; - configurationSource = app; - return this; - } - - @Override - public void zipDeploy(File zipFile) { - zipDeployAsync(zipFile).block(); - } - - @Override - public void zipDeploy(InputStream zipFile, long length) { - zipDeployAsync(zipFile, length).block(); - } - - @Override - public Mono zipDeployAsync(InputStream zipFile, long length) { - return kuduClient.zipDeployAsync(zipFile, length); - } - - @Override - public Mono zipDeployAsync(File zipFile) { - try { - return kuduClient.zipDeployAsync(zipFile); - } catch (IOException e) { - return Mono.error(e); - } - } - - @Override - Mono submitSite(final SiteInner site) { - return submitSiteWithoutSiteConfig(site); - } - - @Override - Mono submitSite(final SitePatchResourceInner siteUpdate) { - // PATCH does not work for function app slot - return submitSiteWithoutSiteConfig(this.innerModel()); - } - - @Override - public String getMasterKey() { - return this.getMasterKeyAsync().block(); - } - - @Override - public Mono getMasterKeyAsync() { - return this.manager().serviceClient().getWebApps().listHostKeysSlotAsync( - this.resourceGroupName(), this.parent().name(), this.name()).map(HostKeysInner::masterKey); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/FunctionDeploymentSlotsImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/FunctionDeploymentSlotsImpl.java deleted file mode 100644 index 4775d111a578..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/FunctionDeploymentSlotsImpl.java +++ /dev/null @@ -1,125 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.appservice.AppServiceManager; -import com.azure.resourcemanager.appservice.fluent.WebAppsClient; -import com.azure.resourcemanager.appservice.fluent.models.SiteConfigResourceInner; -import com.azure.resourcemanager.appservice.fluent.models.SiteInner; -import com.azure.resourcemanager.appservice.fluent.models.SiteLogsConfigInner; -import com.azure.resourcemanager.appservice.models.FunctionApp; -import com.azure.resourcemanager.appservice.models.FunctionDeploymentSlot; -import com.azure.resourcemanager.appservice.models.FunctionDeploymentSlotBasic; -import com.azure.resourcemanager.appservice.models.FunctionDeploymentSlots; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.IndependentChildResourcesImpl; -import reactor.core.publisher.Mono; -import com.azure.resourcemanager.resources.fluentcore.utils.PagedConverter; - -/** The implementation DeploymentSlots. */ -class FunctionDeploymentSlotsImpl - extends IndependentChildResourcesImpl< - FunctionDeploymentSlot, FunctionDeploymentSlotImpl, SiteInner, WebAppsClient, AppServiceManager, FunctionApp> - implements FunctionDeploymentSlots { - - private final FunctionAppImpl parent; - - FunctionDeploymentSlotsImpl(final FunctionAppImpl parent) { - super(parent.manager().serviceClient().getWebApps(), parent.manager()); - - this.parent = parent; - } - - @Override - protected FunctionDeploymentSlotImpl wrapModel(String name) { - return new FunctionDeploymentSlotImpl(name, new SiteInner(), null, null, parent) - .withRegion(parent.regionName()) - .withExistingResourceGroup(parent.resourceGroupName()); - } - - @Override - protected FunctionDeploymentSlotImpl wrapModel(SiteInner inner) { - if (inner == null) { - return null; - } - return wrapModel(inner, null, null); - } - - @Override - public FunctionDeploymentSlotImpl define(String name) { - return wrapModel(name); - } - - @Override - public Mono getByParentAsync( - final String resourceGroup, final String parentName, final String name) { - return innerCollection - .getSlotAsync(resourceGroup, parentName, name) - .flatMap( - siteInner -> - Mono - .zip( - innerCollection.getConfigurationSlotAsync(resourceGroup, parentName, - name.replaceAll(".*/", "")), - innerCollection.getDiagnosticLogsConfigurationSlotAsync(resourceGroup, parentName, - name.replaceAll(".*/", "")), - (SiteConfigResourceInner siteConfigResourceInner, SiteLogsConfigInner logsConfigInner) -> - wrapModel(siteInner, siteConfigResourceInner, logsConfigInner))); - } - - @Override - public PagedIterable listByParent(String resourceGroupName, String parentName) { - return new PagedIterable<>(wrapPageAsync(innerCollection.listSlotsAsync(resourceGroupName, parentName))); - } - - @Override - public Mono deleteByParentAsync(String groupName, String parentName, String name) { - return innerCollection.deleteSlotAsync(groupName, parentName, name); - } - - @Override - public void deleteByName(String name) { - deleteByParent(parent.resourceGroupName(), parent.name(), name); - } - - @Override - public Mono deleteByNameAsync(String name) { - return deleteByParentAsync(parent.resourceGroupName(), parent.name(), name); - } - - @Override - public PagedIterable list() { - return new PagedIterable<>(this.listAsync()); - } - - @Override - public FunctionDeploymentSlot getByName(String name) { - return getByParent(parent.resourceGroupName(), parent.name(), name); - } - - @Override - public Mono getByNameAsync(String name) { - return getByParentAsync(parent.resourceGroupName(), parent.name(), name); - } - - @Override - public FunctionApp parent() { - return this.parent; - } - - @Override - public PagedFlux listAsync() { - return PagedConverter.mapPage(innerCollection.listSlotsAsync(parent.resourceGroupName(), parent.name()), - inner -> new FunctionDeploymentSlotBasicImpl(inner, parent)); - } - - private FunctionDeploymentSlotImpl wrapModel( - SiteInner inner, SiteConfigResourceInner siteConfig, SiteLogsConfigInner logConfig) { - if (inner == null) { - return null; - } - return new FunctionDeploymentSlotImpl(inner.name(), inner, siteConfig, logConfig, parent); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/FunctionEnvelopeImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/FunctionEnvelopeImpl.java deleted file mode 100644 index 7f82ac08e1a3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/FunctionEnvelopeImpl.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.implementation; - -import com.azure.resourcemanager.appservice.models.FunctionEnvelope; -import com.azure.resourcemanager.appservice.fluent.models.FunctionEnvelopeInner; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.WrapperImpl; -import java.util.Map; - -/** Implementation for {@link FunctionEnvelope}. */ -public class FunctionEnvelopeImpl extends WrapperImpl implements FunctionEnvelope { - - FunctionEnvelopeImpl(FunctionEnvelopeInner innerModel) { - super(innerModel); - } - - @Override - public String functionAppId() { - return this.innerModel().functionAppId(); - } - - @Override - public String scriptRootPathHref() { - return this.innerModel().scriptRootPathHref(); - } - - @Override - public String scriptHref() { - return this.innerModel().scriptHref(); - } - - @Override - public String configHref() { - return this.innerModel().configHref(); - } - - @Override - public String secretsFileHref() { - return this.innerModel().secretsFileHref(); - } - - @Override - public String href() { - return this.innerModel().href(); - } - - @Override - public Object config() { - return this.innerModel().config(); - } - - @Override - public Map files() { - return this.innerModel().files(); - } - - @Override - public String testData() { - return this.innerModel().testData(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/HostnameBindingImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/HostnameBindingImpl.java deleted file mode 100644 index ca1f5616ad50..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/HostnameBindingImpl.java +++ /dev/null @@ -1,277 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.implementation; - -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.models.HostnameBindingInner; -import com.azure.resourcemanager.appservice.models.AppServiceDomain; -import com.azure.resourcemanager.appservice.models.AzureResourceType; -import com.azure.resourcemanager.appservice.models.CustomHostnameDnsRecordType; -import com.azure.resourcemanager.appservice.models.DeploymentSlot; -import com.azure.resourcemanager.appservice.models.HostnameBinding; -import com.azure.resourcemanager.appservice.models.HostnameType; -import com.azure.resourcemanager.appservice.models.WebAppBase; -import com.azure.core.management.Region; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.IndexableWrapperImpl; -import reactor.core.publisher.Mono; - -import java.util.Map; -import java.util.function.Function; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -/** - * Implementation for {@link HostnameBinding} and its create and update interfaces. - * - * @param the fluent interface of the parent web app - * @param the fluent implementation of the parent web app - */ -class HostnameBindingImpl> - extends IndexableWrapperImpl - implements Creatable, - HostnameBinding, - HostnameBinding.Definition>, - HostnameBinding.UpdateDefinition> { - - private final ClientLogger logger = new ClientLogger(getClass()); - - private final FluentImplT parent; - private String domainName; - private String name; - - HostnameBindingImpl(HostnameBindingInner innerObject, FluentImplT parent) { - super(innerObject); - this.parent = parent; - this.name = innerObject.name(); - if (name != null && name.contains("/")) { - this.name = name.replace(parent.name() + "/", ""); - } - } - - @Override - public String id() { - return innerModel().id(); - } - - @Override - public String type() { - return innerModel().type(); - } - - @Override - public String regionName() { - return parent().regionName(); - } - - @Override - public Region region() { - return parent().region(); - } - - @Override - public Map tags() { - return parent().tags(); - } - - @Override - public String webAppName() { - return innerModel().siteName(); - } - - @Override - public String domainId() { - return innerModel().domainId(); - } - - @Override - public String azureResourceName() { - return innerModel().azureResourceName(); - } - - @Override - public AzureResourceType azureResourceType() { - return innerModel().azureResourceType(); - } - - @Override - public CustomHostnameDnsRecordType dnsRecordType() { - return innerModel().customHostnameDnsRecordType(); - } - - @Override - public HostnameType hostnameType() { - return innerModel().hostnameType(); - } - - @Override - public FluentImplT attach() { - parent.withHostNameBinding(this); - return parent; - } - - @Override - public HostnameBindingImpl withDnsRecordType( - CustomHostnameDnsRecordType hostnameDnsRecordType) { - Pattern pattern = Pattern.compile("([.\\w-]+|\\*)\\.([\\w-]+\\.\\w+)"); - Matcher matcher = pattern.matcher(name); - if (hostnameDnsRecordType == CustomHostnameDnsRecordType.CNAME && !matcher.matches()) { - throw logger.logExceptionAsError( - new IllegalArgumentException("root hostname cannot be assigned with a CName record")); - } - innerModel().withCustomHostnameDnsRecordType(hostnameDnsRecordType); - return this; - } - - @Override - public HostnameBindingImpl refresh() { - - return this; - } - - @Override - public Mono refreshAsync() { - final HostnameBindingImpl self = this; - Mono observable = null; - - if (parent instanceof DeploymentSlot) { - observable = - this - .parent() - .manager() - .serviceClient() - .getWebApps() - .getHostnameBindingSlotAsync( - parent().resourceGroupName(), - ((DeploymentSlot) parent).parent().name(), - parent().name(), - name()); - } else { - observable = - this - .parent() - .manager() - .serviceClient() - .getWebApps() - .getHostnameBindingAsync(parent().resourceGroupName(), parent().name(), name()); - } - - return observable - .map( - hostnameBindingInner -> { - self.setInner(hostnameBindingInner); - return self; - }); - } - - @Override - public HostnameBinding create() { - return createAsync().block(); - } - - @Override - public Mono createAsync() { - return createAsync(Context.NONE); - } - - @Override - public HostnameBinding create(Context context) { - return createAsync(context).block(); - } - - @Override - public Mono createAsync(Context context) { - final HostnameBinding self = this; - Function mapper = - hostnameBindingInner -> { - setInner(hostnameBindingInner); - return self; - }; - - Mono hostnameBindingObservable; - if (parent instanceof DeploymentSlot) { - hostnameBindingObservable = - this - .parent() - .manager() - .serviceClient() - .getWebApps() - .createOrUpdateHostnameBindingSlotAsync( - parent().resourceGroupName(), - ((DeploymentSlot) parent).parent().name(), - name, - parent().name(), - innerModel()) - .contextWrite(c -> c.putAll(FluxUtil.toReactorContext(context).readOnly())) - .map(mapper); - } else { - hostnameBindingObservable = - this - .parent() - .manager() - .serviceClient() - .getWebApps() - .createOrUpdateHostnameBindingAsync( - parent().resourceGroupName(), parent().name(), name, innerModel()) - .contextWrite(c -> c.putAll(FluxUtil.toReactorContext(context).readOnly())) - .map(mapper); - } - - return hostnameBindingObservable; - } - - private String normalizeHostNameBindingName(String hostname, String domainName) { - if (!hostname.endsWith(domainName)) { - hostname = hostname + "." + domainName; - } - if (hostname.startsWith("@")) { - hostname = hostname.replace("@.", ""); - } - return hostname; - } - - @Override - public HostnameBindingImpl withAzureManagedDomain(AppServiceDomain domain) { - innerModel().withDomainId(domain.id()); - innerModel().withHostnameType(HostnameType.MANAGED); - this.domainName = domain.name(); - return this; - } - - @Override - public HostnameBindingImpl withThirdPartyDomain(String domain) { - innerModel().withHostnameType(HostnameType.VERIFIED); - this.domainName = domain; - return this; - } - - @Override - public String toString() { - String suffix; - if (azureResourceType() == AzureResourceType.TRAFFIC_MANAGER) { - suffix = ".trafficmanager.net"; - } else { - suffix = ".azurewebsites.net"; - } - return name + ": " + dnsRecordType() + " " + azureResourceName() + suffix; - } - - @Override - public String name() { - return name; - } - - @Override - public WebAppBase parent() { - return parent; - } - - @Override - public HostnameBindingImpl withSubDomain(String subDomain) { - this.name = normalizeHostNameBindingName(subDomain, domainName); - return this; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/HostnameSslBindingImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/HostnameSslBindingImpl.java deleted file mode 100644 index 620cb181373c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/HostnameSslBindingImpl.java +++ /dev/null @@ -1,261 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.appservice.implementation; - -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.AppServiceManager; -import com.azure.resourcemanager.appservice.models.AppServiceCertificate; -import com.azure.resourcemanager.appservice.models.AppServiceCertificateOrder; -import com.azure.resourcemanager.appservice.models.HostnameSslBinding; -import com.azure.resourcemanager.appservice.models.HostnameSslState; -import com.azure.resourcemanager.appservice.models.SslState; -import com.azure.resourcemanager.appservice.models.WebAppBase; -import com.azure.resourcemanager.keyvault.models.Vault; -import com.azure.core.management.Region; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.IndexableWrapperImpl; -import reactor.core.publisher.Mono; - -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.security.KeyStore; -import java.security.KeyStoreException; -import java.security.MessageDigest; -import java.security.NoSuchAlgorithmException; -import java.security.cert.CertificateException; -import java.security.cert.X509Certificate; - -/** - * Implementation for {@link HostnameSslBinding} and its create and update interfaces. - * - * @param the fluent interface of the parent web app - * @param the fluent implementation of the parent web app - */ -class HostnameSslBindingImpl> - extends IndexableWrapperImpl - implements HostnameSslBinding, - HostnameSslBinding.Definition>, - HostnameSslBinding.UpdateDefinition> { - - private final ClientLogger logger = new ClientLogger(getClass()); - - private Mono newCertificate; - private AppServiceCertificateOrder.DefinitionStages.WithKeyVault certificateInDefinition; - - private final FluentImplT parent; - - HostnameSslBindingImpl(HostnameSslState inner, FluentImplT parent) { - super(inner); - this.parent = parent; - } - - @Override - public String name() { - return innerModel().name(); - } - - @Override - public SslState sslState() { - return innerModel().sslState(); - } - - @Override - public String virtualIp() { - return innerModel().virtualIp(); - } - - @Override - public String thumbprint() { - return innerModel().thumbprint(); - } - - @Override - public FluentImplT attach() { - parent.withNewHostNameSslBinding(this); - return parent; - } - - @Override - public HostnameSslBindingImpl withPfxCertificateToUpload( - final File pfxFile, final String password) { - String thumbprint = getCertificateThumbprint(pfxFile.getPath(), password); - newCertificate = - this - .parent() - .manager() - .certificates() - .define(getCertificateUniqueName(thumbprint, parent().region())) - .withRegion(parent().region()) - .withExistingResourceGroup(parent().resourceGroupName()) - .withPfxFile(pfxFile) - .withPfxPassword(password) - .createAsync(); - return this; - } - - @Override - public HostnameSslBindingImpl withExistingCertificate( - final String certificateNameOrThumbprint) { - newCertificate = - this - .parent() - .manager() - .certificates() - .listByResourceGroupAsync(parent().resourceGroupName()) - .collectList() - .map( - appServiceCertificates -> { - for (AppServiceCertificate certificate : appServiceCertificates) { - if (certificate.name().equals(certificateNameOrThumbprint) - || certificate.thumbprint().equalsIgnoreCase(certificateNameOrThumbprint)) { - return certificate; - } - } - return null; - }) - .map( - appServiceCertificate -> { - if (appServiceCertificate != null) { - withCertificateThumbprint(certificateNameOrThumbprint); - } - return appServiceCertificate; - }); - return this; - } - - @Override - public HostnameSslBindingImpl withNewStandardSslCertificateOrder( - final String certificateOrderName) { - this.certificateInDefinition = - this - .parent() - .manager() - .certificateOrders() - .define(certificateOrderName) - .withExistingResourceGroup(parent().resourceGroupName()) - .withHostName(name()) - .withStandardSku() - .withWebAppVerification(parent()); - return this; - } - - @Override - public HostnameSslBindingImpl withExistingAppServiceCertificateOrder( - final AppServiceCertificateOrder certificateOrder) { - newCertificate = - this - .parent() - .manager() - .certificates() - .define(getCertificateUniqueName(certificateOrder.signedCertificate().thumbprint(), parent().region())) - .withRegion(parent().region()) - .withExistingResourceGroup(parent().resourceGroupName()) - .withExistingCertificateOrder(certificateOrder) - .createAsync(); - return this; - } - - private HostnameSslBindingImpl withCertificateThumbprint(String thumbprint) { - innerModel().withThumbprint(thumbprint); - return this; - } - - @Override - public HostnameSslBindingImpl withSniBasedSsl() { - innerModel().withSslState(SslState.SNI_ENABLED); - return this; - } - - @Override - public HostnameSslBindingImpl withIpBasedSsl() { - innerModel().withSslState(SslState.IP_BASED_ENABLED); - return this; - } - - Mono newCertificate() { - return newCertificate - .doOnNext( - appServiceCertificate -> { - if (appServiceCertificate != null) { - withCertificateThumbprint(appServiceCertificate.thumbprint()); - } - }); - } - - @Override - public WebAppBase parent() { - return parent; - } - - @Override - public HostnameSslBindingImpl forHostname(String hostname) { - innerModel().withName(hostname); - return this; - } - - @Override - public HostnameSslBindingImpl withExistingKeyVault(final Vault vault) { - Mono appServiceCertificateOrderObservable = - certificateInDefinition.withExistingKeyVault(vault).createAsync(); - final AppServiceManager manager = this.parent().manager(); - this.newCertificate = - appServiceCertificateOrderObservable - .flatMap( - appServiceCertificateOrder -> - manager - .certificates() - .define(appServiceCertificateOrder.name()) - .withRegion(parent().regionName()) - .withExistingResourceGroup(parent().resourceGroupName()) - .withExistingCertificateOrder(appServiceCertificateOrder) - .createAsync()); - return this; - } - - @Override - public HostnameSslBindingImpl withNewKeyVault(String vaultName) { - Mono appServiceCertificateOrderObservable = - certificateInDefinition.withNewKeyVault(vaultName, parent().region()).createAsync(); - final AppServiceManager manager = this.parent().manager(); - this.newCertificate = - appServiceCertificateOrderObservable - .flatMap( - appServiceCertificateOrder -> - manager - .certificates() - .define(appServiceCertificateOrder.name()) - .withRegion(parent().regionName()) - .withExistingResourceGroup(parent().resourceGroupName()) - .withExistingCertificateOrder(appServiceCertificateOrder) - .createAsync()); - return this; - } - - private String getCertificateThumbprint(String pfxPath, String password) { - try { - InputStream inStream = new FileInputStream(pfxPath); - - KeyStore ks = KeyStore.getInstance("PKCS12"); - ks.load(inStream, password.toCharArray()); - - String alias = ks.aliases().nextElement(); - X509Certificate certificate = (X509Certificate) ks.getCertificate(alias); - inStream.close(); - MessageDigest sha = MessageDigest.getInstance("SHA-1"); - return com - .azure - .resourcemanager - .appservice - .implementation - .Utils - .base16Encode(sha.digest(certificate.getEncoded())); - } catch (KeyStoreException | CertificateException | NoSuchAlgorithmException | IOException ex) { - throw logger.logExceptionAsError(new RuntimeException(ex)); - } - } - - private String getCertificateUniqueName(String thumbprint, Region region) { - return String.format("%s##%s#", thumbprint, region.label()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/KuduClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/KuduClient.java deleted file mode 100644 index 2d7f79d4e348..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/KuduClient.java +++ /dev/null @@ -1,373 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.http.rest.StreamResponse; -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.DeployType; -import com.azure.resourcemanager.appservice.models.KuduAuthenticationPolicy; -import com.azure.resourcemanager.appservice.models.WebAppBase; -import com.azure.resourcemanager.resources.fluentcore.policy.AuthenticationPolicy; -import com.azure.resourcemanager.resources.fluentcore.policy.AuxiliaryAuthenticationPolicy; -import com.azure.resourcemanager.resources.fluentcore.policy.ProviderRegistrationPolicy; - -import java.io.ByteArrayOutputStream; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.net.SocketTimeoutException; -import java.nio.ByteBuffer; -import java.nio.channels.AsynchronousFileChannel; -import java.nio.charset.StandardCharsets; -import java.nio.file.StandardOpenOption; -import java.time.Duration; -import java.util.ArrayList; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.concurrent.TimeoutException; - -import reactor.core.Exceptions; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; -import reactor.util.retry.Retry; - -/** A client which interacts with Kudu service. */ -class KuduClient { - - private final ClientLogger logger = new ClientLogger(getClass()); - - private final String host; - private final KuduService service; - - KuduClient(WebAppBase webAppBase) { - if (webAppBase.defaultHostname() == null) { - throw logger.logExceptionAsError( - new UnsupportedOperationException("Cannot initialize kudu client before web app is created")); - } - String host = webAppBase.defaultHostname().toLowerCase(Locale.ROOT) - .replace("http://", "") - .replace("https://", ""); - String[] parts = host.split("\\.", 2); - host = parts[0] + ".scm." + parts[1]; - this.host = "https://" + host; - List policies = new ArrayList<>(); - for (int i = 0, count = webAppBase.manager().httpPipeline().getPolicyCount(); i < count; ++i) { - HttpPipelinePolicy policy = webAppBase.manager().httpPipeline().getPolicy(i); - if (!(policy instanceof AuthenticationPolicy) - && !(policy instanceof ProviderRegistrationPolicy) - && !(policy instanceof AuxiliaryAuthenticationPolicy)) { - policies.add(policy); - } - } - policies.add(new KuduAuthenticationPolicy(webAppBase)); - HttpPipeline httpPipeline = new HttpPipelineBuilder() - .policies(policies.toArray(new HttpPipelinePolicy[0])) - .httpClient(webAppBase.manager().httpPipeline().getHttpClient()) - .build(); - - service = RestProxy.create(KuduService.class, httpPipeline, - SerializerFactory.createDefaultManagementSerializerAdapter()); - } - - @Host("{$host}") - @ServiceInterface(name = "KuduService") - private interface KuduService { - @Get("api/logstream/application") - Mono streamApplicationLogs(@HostParam("$host") String host); - - @Get("api/logstream/http") - Mono streamHttpLogs(@HostParam("$host") String host); - - @Get("api/logstream/kudu/trace") - Mono streamTraceLogs(@HostParam("$host") String host); - - @Get("api/logstream/kudu/deployment") - Mono streamDeploymentLogs(@HostParam("$host") String host); - - @Get("api/logstream") - Mono streamAllLogs(@HostParam("$host") String host); - -// @Headers({ -// "Content-Type: application/octet-stream", -// "x-ms-logging-context: com.microsoft.azure.management.appservice.WebApps warDeploy", -// "x-ms-body-logging: false" -// }) -// @Post("api/wardeploy") -// Mono warDeploy( -// @HostParam("$host") String host, -// @BodyParam("application/octet-stream") byte[] warFile, -// @QueryParam("name") String appName); - - @Headers({"Content-Type: application/octet-stream"}) - @Post("api/wardeploy") - Mono warDeploy( - @HostParam("$host") String host, - @BodyParam("application/octet-stream") Flux warFile, - @HeaderParam("content-length") long size, - @QueryParam("name") String appName); - -// @Headers({ -// "Content-Type: application/octet-stream", -// "x-ms-logging-context: com.microsoft.azure.management.appservice.WebApps zipDeploy", -// "x-ms-body-logging: false" -// }) -// @Post("api/zipdeploy") -// Mono zipDeploy( -// @HostParam("$host") String host, -// @BodyParam("application/octet-stream") byte[] zipFile); - - @Headers({"Content-Type: application/octet-stream"}) - @Post("api/zipdeploy") - Mono zipDeploy( - @HostParam("$host") String host, - @BodyParam("application/octet-stream") Flux zipFile, - @HeaderParam("content-length") long size); - - @Headers({"Content-Type: application/octet-stream"}) - @Post("api/publish") - Mono deploy(@HostParam("$host") String host, - @BodyParam("application/octet-stream") Flux file, - @HeaderParam("content-length") long size, - @QueryParam("type") DeployType type, - @QueryParam("path") String path, - @QueryParam("restart") Boolean restart, - @QueryParam("clean") Boolean clean); - - @Get("api/settings") - Mono> settings(@HostParam("$host") String host); - } - - Flux streamApplicationLogsAsync() { - return streamFromFluxBytes(service.streamApplicationLogs(host).flatMapMany(StreamResponse::getValue)); - } - - Flux streamHttpLogsAsync() { - return streamFromFluxBytes(service.streamHttpLogs(host).flatMapMany(StreamResponse::getValue)); - } - - Flux streamTraceLogsAsync() { - return streamFromFluxBytes(service.streamTraceLogs(host).flatMapMany(StreamResponse::getValue)); - } - - Flux streamDeploymentLogsAsync() { - return streamFromFluxBytes(service.streamDeploymentLogs(host).flatMapMany(StreamResponse::getValue)); - } - - Flux streamAllLogsAsync() { - return streamFromFluxBytes(service.streamAllLogs(host).flatMapMany(StreamResponse::getValue)); - } - - static Flux streamFromFluxBytes(final Flux source) { - final byte newLine = '\n'; - final byte newLineR = '\r'; - - final ByteArrayOutputStream stream = new ByteArrayOutputStream(); - return source - .concatMap( - byteBuffer -> { - int index = findByte(byteBuffer, newLine); - if (index == -1) { - // no newLine byte found, not a line, put it into stream - try { - stream.write(FluxUtil.byteBufferToArray(byteBuffer)); - return Flux.empty(); - } catch (IOException e) { - return Flux.error(e); - } - } else { - // newLine byte found, at least 1 line - List lines = new ArrayList<>(); - while ((index = findByte(byteBuffer, newLine)) != -1) { - byte[] byteArray = new byte[index + 1]; - byteBuffer.get(byteArray); - try { - stream.write(byteArray); - String line = new String(stream.toByteArray(), StandardCharsets.UTF_8); - if (!line.isEmpty() && line.charAt(line.length() - 1) == newLine) { - // OK this is a line, end with newLine char - line = line.substring(0, line.length() - 1); - if (!line.isEmpty() && line.charAt(line.length() - 1) == newLineR) { - line = line.substring(0, line.length() - 1); - } - lines.add(line); - stream.reset(); - } - } catch (IOException e) { - return Flux.error(e); - } - } - if (byteBuffer.hasRemaining()) { - // put rest into stream - try { - stream.write(FluxUtil.byteBufferToArray(byteBuffer)); - } catch (IOException e) { - return Flux.error(e); - } - } - if (lines.isEmpty()) { - return Flux.empty(); - } else { - return Flux.fromIterable(lines); - } - } - }); - } - - private static int findByte(ByteBuffer byteBuffer, byte b) { - final int position = byteBuffer.position(); - int index = -1; - for (int i = 0; i < byteBuffer.remaining(); ++i) { - if (byteBuffer.get(position + i) == b) { - index = i; - break; - } - } - return index; - } - -// Mono warDeployAsync(InputStream warFile, String appName) { -// InputStreamFlux flux = fluxFromInputStream(warFile); -// if (flux.flux != null) { -// return withRetry(service.warDeploy(host, flux.flux, flux.size, appName)); -// } else { -// return withRetry(service.warDeploy(host, flux.bytes, appName)); -// } -// } - - Mono warDeployAsync(InputStream warFile, long length, String appName) { - Flux flux = FluxUtil.toFluxByteBuffer(warFile); - return retryOnError(service.warDeploy(host, flux, length, appName)); - } - - Mono warDeployAsync(File warFile, String appName) throws IOException { - AsynchronousFileChannel fileChannel = AsynchronousFileChannel.open(warFile.toPath(), StandardOpenOption.READ); - return retryOnError(service.warDeploy(host, FluxUtil.readFile(fileChannel), fileChannel.size(), appName)) - .doFinally(ignored -> { - try { - fileChannel.close(); - } catch (IOException e) { - logger.logThrowableAsError(e); - } - }); - } - -// Mono zipDeployAsync(InputStream zipFile) { -// InputStreamFlux flux = fluxFromInputStream(zipFile); -// if (flux.flux != null) { -// return withRetry(service.zipDeploy(host, flux.flux, flux.size)); -// } else { -// return withRetry(service.zipDeploy(host, flux.bytes)); -// } -// } - - Mono zipDeployAsync(InputStream zipFile, long length) { - Flux flux = FluxUtil.toFluxByteBuffer(zipFile); - return retryOnError(service.zipDeploy(host, flux, length)); - } - - Mono zipDeployAsync(File zipFile) throws IOException { - AsynchronousFileChannel fileChannel = AsynchronousFileChannel.open(zipFile.toPath(), StandardOpenOption.READ); - return retryOnError(service.zipDeploy(host, FluxUtil.readFile(fileChannel), fileChannel.size())) - .doFinally(ignored -> { - try { - fileChannel.close(); - } catch (IOException e) { - logger.logThrowableAsError(e); - } - }); - } - - Mono deployAsync(DeployType type, - InputStream file, long length, - String path, Boolean restart, Boolean clean) { - Flux flux = FluxUtil.toFluxByteBuffer(file); - return retryOnError(service.deploy(host, flux, length, type, path, restart, clean)); - } - - Mono deployAsync(DeployType type, - File file, - String path, Boolean restart, Boolean clean) throws IOException { - AsynchronousFileChannel fileChannel = AsynchronousFileChannel.open(file.toPath(), StandardOpenOption.READ); - return retryOnError(service.deploy(host, FluxUtil.readFile(fileChannel), fileChannel.size(), - type, path, restart, clean)) - .doFinally(ignored -> { - try { - fileChannel.close(); - } catch (IOException e) { - logger.logThrowableAsError(e); - } - }); - } - - Mono> settings() { - return retryOnError(service.settings(host)); - } - -// private InputStreamFlux fluxFromInputStream(InputStream inputStream) { -// try { -// InputStreamFlux inputStreamFlux = new InputStreamFlux(); -// if (inputStream instanceof FileInputStream) { -// inputStreamFlux.size = ((FileInputStream) inputStream).getChannel().size(); -// inputStreamFlux.flux = FluxUtil.toFluxByteBuffer(inputStream); -// } else if (inputStream instanceof ByteArrayInputStream) { -// inputStreamFlux.size = inputStream.available(); -// inputStreamFlux.flux = FluxUtil.toFluxByteBuffer(inputStream); -// } else { -// ByteArrayOutputStream buffer = new ByteArrayOutputStream(); -// int nRead; -// byte[] data = new byte[16384]; -// while ((nRead = inputStream.read(data, 0, data.length)) != -1) { -// buffer.write(data, 0, nRead); -// } -// inputStreamFlux.bytes = buffer.toByteArray(); -// inputStreamFlux.size = inputStreamFlux.bytes.length; -// } -// return inputStreamFlux; -// } catch (IOException e) { -// throw logger.logExceptionAsError(new IllegalStateException(e)); -// } -// } -// -// private static class InputStreamFlux { -// private Flux flux; -// private byte[] bytes; -// private long size; -// } - - private Mono retryOnError(Mono observable) { - final int retryCount = 5 + 1; // retryCount is 5, last 1 is guard - return observable - .retryWhen(Retry.withThrowable( - flux -> - flux - .zipWith( - Flux.range(1, retryCount), - (Throwable throwable, Integer count) -> { - if (count < retryCount - && (throwable instanceof TimeoutException - || throwable instanceof SocketTimeoutException)) { - return count; - } else { - throw logger.logExceptionAsError(Exceptions.propagate(throwable)); - } - }) - .flatMap(i -> Mono.delay(Duration.ofSeconds(((long) i) * 10))))); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/ProvidersClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/ProvidersClientImpl.java deleted file mode 100644 index 5b7eb8bb53bd..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/ProvidersClientImpl.java +++ /dev/null @@ -1,783 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.ProvidersClient; -import com.azure.resourcemanager.appservice.fluent.models.ApplicationStackInner; -import com.azure.resourcemanager.appservice.fluent.models.CsmOperationDescriptionInner; -import com.azure.resourcemanager.appservice.models.ApplicationStackCollection; -import com.azure.resourcemanager.appservice.models.CsmOperationCollection; -import com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException; -import com.azure.resourcemanager.appservice.models.ProviderOsTypeSelected; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ProvidersClient. */ -public final class ProvidersClientImpl implements ProvidersClient { - private final ClientLogger logger = new ClientLogger(ProvidersClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final ProvidersService service; - - /** The service client containing this operation class. */ - private final WebSiteManagementClientImpl client; - - /** - * Initializes an instance of ProvidersClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ProvidersClientImpl(WebSiteManagementClientImpl client) { - this.service = - RestProxy.create(ProvidersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for WebSiteManagementClientProviders to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "WebSiteManagementCli") - private interface ProvidersService { - @Headers({"Content-Type: application/json"}) - @Get("/providers/Microsoft.Web/availableStacks") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getAvailableStacks( - @HostParam("$host") String endpoint, - @QueryParam("osTypeSelected") ProviderOsTypeSelected osTypeSelected, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/providers/Microsoft.Web/operations") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listOperations( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Web/availableStacks") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("osTypeSelected") ProviderOsTypeSelected osTypeSelected, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getAvailableStacksNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listOperationsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getAvailableStacksOnPremNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Get available application frameworks and their versions. - * - * @param osTypeSelected The osTypeSelected parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return available application frameworks and their versions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getAvailableStacksSinglePageAsync( - ProviderOsTypeSelected osTypeSelected) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getAvailableStacks( - this.client.getEndpoint(), osTypeSelected, this.client.getApiVersion(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get available application frameworks and their versions. - * - * @param osTypeSelected The osTypeSelected parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return available application frameworks and their versions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getAvailableStacksSinglePageAsync( - ProviderOsTypeSelected osTypeSelected, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getAvailableStacks(this.client.getEndpoint(), osTypeSelected, this.client.getApiVersion(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get available application frameworks and their versions. - * - * @param osTypeSelected The osTypeSelected parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return available application frameworks and their versions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux getAvailableStacksAsync(ProviderOsTypeSelected osTypeSelected) { - return new PagedFlux<>( - () -> getAvailableStacksSinglePageAsync(osTypeSelected), - nextLink -> getAvailableStacksNextSinglePageAsync(nextLink)); - } - - /** - * Get available application frameworks and their versions. - * - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return available application frameworks and their versions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux getAvailableStacksAsync() { - final ProviderOsTypeSelected osTypeSelected = null; - return new PagedFlux<>( - () -> getAvailableStacksSinglePageAsync(osTypeSelected), - nextLink -> getAvailableStacksNextSinglePageAsync(nextLink)); - } - - /** - * Get available application frameworks and their versions. - * - * @param osTypeSelected The osTypeSelected parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return available application frameworks and their versions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux getAvailableStacksAsync( - ProviderOsTypeSelected osTypeSelected, Context context) { - return new PagedFlux<>( - () -> getAvailableStacksSinglePageAsync(osTypeSelected, context), - nextLink -> getAvailableStacksNextSinglePageAsync(nextLink, context)); - } - - /** - * Get available application frameworks and their versions. - * - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return available application frameworks and their versions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable getAvailableStacks() { - final ProviderOsTypeSelected osTypeSelected = null; - return new PagedIterable<>(getAvailableStacksAsync(osTypeSelected)); - } - - /** - * Get available application frameworks and their versions. - * - * @param osTypeSelected The osTypeSelected parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return available application frameworks and their versions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable getAvailableStacks( - ProviderOsTypeSelected osTypeSelected, Context context) { - return new PagedIterable<>(getAvailableStacksAsync(osTypeSelected, context)); - } - - /** - * Gets all available operations for the Microsoft.Web resource provider. Also exposes resource metric definitions. - * - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all available operations for the Microsoft.Web resource provider. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listOperationsSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service.listOperations(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all available operations for the Microsoft.Web resource provider. Also exposes resource metric definitions. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all available operations for the Microsoft.Web resource provider. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listOperationsSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listOperations(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all available operations for the Microsoft.Web resource provider. Also exposes resource metric definitions. - * - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all available operations for the Microsoft.Web resource provider. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listOperationsAsync() { - return new PagedFlux<>( - () -> listOperationsSinglePageAsync(), nextLink -> listOperationsNextSinglePageAsync(nextLink)); - } - - /** - * Gets all available operations for the Microsoft.Web resource provider. Also exposes resource metric definitions. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all available operations for the Microsoft.Web resource provider. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listOperationsAsync(Context context) { - return new PagedFlux<>( - () -> listOperationsSinglePageAsync(context), - nextLink -> listOperationsNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all available operations for the Microsoft.Web resource provider. Also exposes resource metric definitions. - * - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all available operations for the Microsoft.Web resource provider. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listOperations() { - return new PagedIterable<>(listOperationsAsync()); - } - - /** - * Gets all available operations for the Microsoft.Web resource provider. Also exposes resource metric definitions. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all available operations for the Microsoft.Web resource provider. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listOperations(Context context) { - return new PagedIterable<>(listOperationsAsync(context)); - } - - /** - * Get available application frameworks and their versions. - * - * @param osTypeSelected The osTypeSelected parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return available application frameworks and their versions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(ProviderOsTypeSelected osTypeSelected) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - osTypeSelected, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get available application frameworks and their versions. - * - * @param osTypeSelected The osTypeSelected parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return available application frameworks and their versions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - ProviderOsTypeSelected osTypeSelected, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - osTypeSelected, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get available application frameworks and their versions. - * - * @param osTypeSelected The osTypeSelected parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return available application frameworks and their versions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(ProviderOsTypeSelected osTypeSelected) { - return new PagedFlux<>( - () -> listSinglePageAsync(osTypeSelected), - nextLink -> getAvailableStacksOnPremNextSinglePageAsync(nextLink)); - } - - /** - * Get available application frameworks and their versions. - * - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return available application frameworks and their versions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - final ProviderOsTypeSelected osTypeSelected = null; - return new PagedFlux<>( - () -> listSinglePageAsync(osTypeSelected), - nextLink -> getAvailableStacksOnPremNextSinglePageAsync(nextLink)); - } - - /** - * Get available application frameworks and their versions. - * - * @param osTypeSelected The osTypeSelected parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return available application frameworks and their versions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(ProviderOsTypeSelected osTypeSelected, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(osTypeSelected, context), - nextLink -> getAvailableStacksOnPremNextSinglePageAsync(nextLink, context)); - } - - /** - * Get available application frameworks and their versions. - * - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return available application frameworks and their versions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - final ProviderOsTypeSelected osTypeSelected = null; - return new PagedIterable<>(listAsync(osTypeSelected)); - } - - /** - * Get available application frameworks and their versions. - * - * @param osTypeSelected The osTypeSelected parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return available application frameworks and their versions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(ProviderOsTypeSelected osTypeSelected, Context context) { - return new PagedIterable<>(listAsync(osTypeSelected, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Application Stacks. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getAvailableStacksNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.getAvailableStacksNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Application Stacks. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getAvailableStacksNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getAvailableStacksNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Azure resource manager operation metadata. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listOperationsNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listOperationsNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Azure resource manager operation metadata. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listOperationsNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listOperationsNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Application Stacks. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getAvailableStacksOnPremNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.getAvailableStacksOnPremNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Application Stacks. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getAvailableStacksOnPremNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getAvailableStacksOnPremNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/PublishingProfileImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/PublishingProfileImpl.java deleted file mode 100644 index 7a1299ddd1e2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/PublishingProfileImpl.java +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.appservice.implementation; - -import com.azure.resourcemanager.appservice.models.DeploymentSlot; -import com.azure.resourcemanager.appservice.models.PublishingProfile; -import com.azure.resourcemanager.appservice.models.WebAppBase; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -/** A credential for publishing to a web app. */ -class PublishingProfileImpl implements PublishingProfile { - - private String ftpUrl; - private String gitUrl; - private String ftpUsername; - private String gitUsername; - private String ftpPassword; - private String gitPassword; - - private final WebAppBase parent; - - private static final Pattern GIT_REGEX = - Pattern - .compile( - "publishMethod=\"MSDeploy\" publishUrl=\"([^\"]+)\".+userName=\"(\\$[^\"]+)\".+userPWD=\"([^\"]+)\""); - private static final Pattern FTP_REGEX = - Pattern - .compile( - "publishMethod=\"FTP\"" - + " publishUrl=\"ftp://([^\"]+).+userName=\"([^\"]+\\\\\\$[^\"]+)\".+userPWD=\"([^\"]+)\""); - - PublishingProfileImpl(String publishingProfileXml, WebAppBase parent) { - Matcher matcher = GIT_REGEX.matcher(publishingProfileXml); - if (matcher.find()) { - gitUrl = matcher.group(1); - gitUsername = matcher.group(2); - gitPassword = matcher.group(3); - } - matcher = FTP_REGEX.matcher(publishingProfileXml); - if (matcher.find()) { - ftpUrl = matcher.group(1); - ftpUsername = matcher.group(2); - ftpPassword = matcher.group(3); - } - this.parent = parent; - } - - @Override - public String ftpUrl() { - return ftpUrl; - } - - @Override - public String ftpUsername() { - return ftpUsername; - } - - @Override - public String gitUrl() { - String repoName; - if (parent instanceof DeploymentSlot) { - repoName = ((DeploymentSlot) parent).parent().name() + ".git"; - } else { - repoName = parent.name() + ".git"; - } - if (!gitUrl.startsWith("https://")) { - gitUrl = "https://" + gitUrl; - } - return gitUrl + "/" + repoName; - } - - @Override - public String gitUsername() { - return gitUsername; - } - - @Override - public String ftpPassword() { - return ftpPassword; - } - - @Override - public String gitPassword() { - return gitPassword; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/RecommendationsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/RecommendationsClientImpl.java deleted file mode 100644 index 2f5efe62411f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/RecommendationsClientImpl.java +++ /dev/null @@ -1,3449 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.RecommendationsClient; -import com.azure.resourcemanager.appservice.fluent.models.RecommendationInner; -import com.azure.resourcemanager.appservice.fluent.models.RecommendationRuleInner; -import com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException; -import com.azure.resourcemanager.appservice.models.RecommendationCollection; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in RecommendationsClient. */ -public final class RecommendationsClientImpl implements RecommendationsClient { - private final ClientLogger logger = new ClientLogger(RecommendationsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final RecommendationsService service; - - /** The service client containing this operation class. */ - private final WebSiteManagementClientImpl client; - - /** - * Initializes an instance of RecommendationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - RecommendationsClientImpl(WebSiteManagementClientImpl client) { - this.service = - RestProxy.create(RecommendationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for WebSiteManagementClientRecommendations to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "WebSiteManagementCli") - private interface RecommendationsService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Web/recommendations") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("featured") Boolean featured, - @QueryParam(value = "$filter", encoded = true) String filter, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Web/recommendations/reset") - @ExpectedResponses({204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> resetAllFilters( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Web/recommendations/{name}/disable") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> disableRecommendationForSubscription( - @HostParam("$host") String endpoint, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web" - + "/hostingEnvironments/{hostingEnvironmentName}/recommendationHistory") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listHistoryForHostingEnvironment( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("hostingEnvironmentName") String hostingEnvironmentName, - @QueryParam("expiredOnly") Boolean expiredOnly, - @QueryParam(value = "$filter", encoded = true) String filter, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web" - + "/hostingEnvironments/{hostingEnvironmentName}/recommendations") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listRecommendedRulesForHostingEnvironment( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("hostingEnvironmentName") String hostingEnvironmentName, - @QueryParam("featured") Boolean featured, - @QueryParam(value = "$filter", encoded = true) String filter, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web" - + "/hostingEnvironments/{hostingEnvironmentName}/recommendations/disable") - @ExpectedResponses({204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> disableAllForHostingEnvironment( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("environmentName") String environmentName, - @PathParam("hostingEnvironmentName") String hostingEnvironmentName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web" - + "/hostingEnvironments/{hostingEnvironmentName}/recommendations/reset") - @ExpectedResponses({204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> resetAllFiltersForHostingEnvironment( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("environmentName") String environmentName, - @PathParam("hostingEnvironmentName") String hostingEnvironmentName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web" - + "/hostingEnvironments/{hostingEnvironmentName}/recommendations/{name}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getRuleDetailsByHostingEnvironment( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("hostingEnvironmentName") String hostingEnvironmentName, - @PathParam("name") String name, - @QueryParam("updateSeen") Boolean updateSeen, - @QueryParam("recommendationId") String recommendationId, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web" - + "/hostingEnvironments/{hostingEnvironmentName}/recommendations/{name}/disable") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> disableRecommendationForHostingEnvironment( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("environmentName") String environmentName, - @PathParam("name") String name, - @PathParam("hostingEnvironmentName") String hostingEnvironmentName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites" - + "/{siteName}/recommendationHistory") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listHistoryForWebApp( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("siteName") String siteName, - @QueryParam("expiredOnly") Boolean expiredOnly, - @QueryParam(value = "$filter", encoded = true) String filter, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites" - + "/{siteName}/recommendations") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listRecommendedRulesForWebApp( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("siteName") String siteName, - @QueryParam("featured") Boolean featured, - @QueryParam(value = "$filter", encoded = true) String filter, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites" - + "/{siteName}/recommendations/disable") - @ExpectedResponses({204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> disableAllForWebApp( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("siteName") String siteName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites" - + "/{siteName}/recommendations/reset") - @ExpectedResponses({204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> resetAllFiltersForWebApp( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("siteName") String siteName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites" - + "/{siteName}/recommendations/{name}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getRuleDetailsByWebApp( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("siteName") String siteName, - @PathParam("name") String name, - @QueryParam("updateSeen") Boolean updateSeen, - @QueryParam("recommendationId") String recommendationId, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites" - + "/{siteName}/recommendations/{name}/disable") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> disableRecommendationForSite( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("siteName") String siteName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listHistoryForHostingEnvironmentNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listRecommendedRulesForHostingEnvironmentNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listHistoryForWebAppNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listRecommendedRulesForWebAppNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * List all recommendations for a subscription. - * - * @param featured Specify <code>true</code> to return only the most critical recommendations. The - * default is <code>false</code>, which returns all recommendations. - * @param filter Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or channel eq - * 'Notification' and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq - * duration'[PT1H|PT1M|P1D]. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of recommendations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Boolean featured, String filter) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - featured, - filter, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List all recommendations for a subscription. - * - * @param featured Specify <code>true</code> to return only the most critical recommendations. The - * default is <code>false</code>, which returns all recommendations. - * @param filter Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or channel eq - * 'Notification' and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq - * duration'[PT1H|PT1M|P1D]. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of recommendations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - Boolean featured, String filter, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - featured, - filter, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * List all recommendations for a subscription. - * - * @param featured Specify <code>true</code> to return only the most critical recommendations. The - * default is <code>false</code>, which returns all recommendations. - * @param filter Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or channel eq - * 'Notification' and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq - * duration'[PT1H|PT1M|P1D]. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of recommendations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(Boolean featured, String filter) { - return new PagedFlux<>( - () -> listSinglePageAsync(featured, filter), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List all recommendations for a subscription. - * - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of recommendations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - final Boolean featured = null; - final String filter = null; - return new PagedFlux<>( - () -> listSinglePageAsync(featured, filter), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List all recommendations for a subscription. - * - * @param featured Specify <code>true</code> to return only the most critical recommendations. The - * default is <code>false</code>, which returns all recommendations. - * @param filter Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or channel eq - * 'Notification' and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq - * duration'[PT1H|PT1M|P1D]. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of recommendations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Boolean featured, String filter, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(featured, filter, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * List all recommendations for a subscription. - * - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of recommendations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - final Boolean featured = null; - final String filter = null; - return new PagedIterable<>(listAsync(featured, filter)); - } - - /** - * List all recommendations for a subscription. - * - * @param featured Specify <code>true</code> to return only the most critical recommendations. The - * default is <code>false</code>, which returns all recommendations. - * @param filter Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or channel eq - * 'Notification' and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq - * duration'[PT1H|PT1M|P1D]. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of recommendations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Boolean featured, String filter, Context context) { - return new PagedIterable<>(listAsync(featured, filter, context)); - } - - /** - * Reset all recommendation opt-out settings for a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> resetAllFiltersWithResponseAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .resetAllFilters( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Reset all recommendation opt-out settings for a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> resetAllFiltersWithResponseAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .resetAllFilters( - this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), context); - } - - /** - * Reset all recommendation opt-out settings for a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono resetAllFiltersAsync() { - return resetAllFiltersWithResponseAsync().flatMap((Response res) -> Mono.empty()); - } - - /** - * Reset all recommendation opt-out settings for a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void resetAllFilters() { - resetAllFiltersAsync().block(); - } - - /** - * Reset all recommendation opt-out settings for a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response resetAllFiltersWithResponse(Context context) { - return resetAllFiltersWithResponseAsync(context).block(); - } - - /** - * Disables the specified rule so it will not apply to a subscription in the future. - * - * @param name Rule name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> disableRecommendationForSubscriptionWithResponseAsync(String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .disableRecommendationForSubscription( - this.client.getEndpoint(), - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Disables the specified rule so it will not apply to a subscription in the future. - * - * @param name Rule name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> disableRecommendationForSubscriptionWithResponseAsync(String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .disableRecommendationForSubscription( - this.client.getEndpoint(), name, this.client.getSubscriptionId(), this.client.getApiVersion(), context); - } - - /** - * Disables the specified rule so it will not apply to a subscription in the future. - * - * @param name Rule name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono disableRecommendationForSubscriptionAsync(String name) { - return disableRecommendationForSubscriptionWithResponseAsync(name) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Disables the specified rule so it will not apply to a subscription in the future. - * - * @param name Rule name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void disableRecommendationForSubscription(String name) { - disableRecommendationForSubscriptionAsync(name).block(); - } - - /** - * Disables the specified rule so it will not apply to a subscription in the future. - * - * @param name Rule name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response disableRecommendationForSubscriptionWithResponse(String name, Context context) { - return disableRecommendationForSubscriptionWithResponseAsync(name, context).block(); - } - - /** - * Get past recommendations for an app, optionally specified by the time range. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param hostingEnvironmentName Name of the hosting environment. - * @param expiredOnly Specify <code>false</code> to return all recommendations. The default is - * <code>true</code>, which returns only expired recommendations. - * @param filter Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or channel eq - * 'Notification' and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq - * duration'[PT1H|PT1M|P1D]. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return past recommendations for an app, optionally specified by the time range. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listHistoryForHostingEnvironmentSinglePageAsync( - String resourceGroupName, String hostingEnvironmentName, Boolean expiredOnly, String filter) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (hostingEnvironmentName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter hostingEnvironmentName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listHistoryForHostingEnvironment( - this.client.getEndpoint(), - resourceGroupName, - hostingEnvironmentName, - expiredOnly, - filter, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get past recommendations for an app, optionally specified by the time range. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param hostingEnvironmentName Name of the hosting environment. - * @param expiredOnly Specify <code>false</code> to return all recommendations. The default is - * <code>true</code>, which returns only expired recommendations. - * @param filter Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or channel eq - * 'Notification' and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq - * duration'[PT1H|PT1M|P1D]. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return past recommendations for an app, optionally specified by the time range. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listHistoryForHostingEnvironmentSinglePageAsync( - String resourceGroupName, String hostingEnvironmentName, Boolean expiredOnly, String filter, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (hostingEnvironmentName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter hostingEnvironmentName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listHistoryForHostingEnvironment( - this.client.getEndpoint(), - resourceGroupName, - hostingEnvironmentName, - expiredOnly, - filter, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get past recommendations for an app, optionally specified by the time range. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param hostingEnvironmentName Name of the hosting environment. - * @param expiredOnly Specify <code>false</code> to return all recommendations. The default is - * <code>true</code>, which returns only expired recommendations. - * @param filter Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or channel eq - * 'Notification' and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq - * duration'[PT1H|PT1M|P1D]. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return past recommendations for an app, optionally specified by the time range. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listHistoryForHostingEnvironmentAsync( - String resourceGroupName, String hostingEnvironmentName, Boolean expiredOnly, String filter) { - return new PagedFlux<>( - () -> - listHistoryForHostingEnvironmentSinglePageAsync( - resourceGroupName, hostingEnvironmentName, expiredOnly, filter), - nextLink -> listHistoryForHostingEnvironmentNextSinglePageAsync(nextLink)); - } - - /** - * Get past recommendations for an app, optionally specified by the time range. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param hostingEnvironmentName Name of the hosting environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return past recommendations for an app, optionally specified by the time range. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listHistoryForHostingEnvironmentAsync( - String resourceGroupName, String hostingEnvironmentName) { - final Boolean expiredOnly = null; - final String filter = null; - return new PagedFlux<>( - () -> - listHistoryForHostingEnvironmentSinglePageAsync( - resourceGroupName, hostingEnvironmentName, expiredOnly, filter), - nextLink -> listHistoryForHostingEnvironmentNextSinglePageAsync(nextLink)); - } - - /** - * Get past recommendations for an app, optionally specified by the time range. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param hostingEnvironmentName Name of the hosting environment. - * @param expiredOnly Specify <code>false</code> to return all recommendations. The default is - * <code>true</code>, which returns only expired recommendations. - * @param filter Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or channel eq - * 'Notification' and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq - * duration'[PT1H|PT1M|P1D]. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return past recommendations for an app, optionally specified by the time range. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listHistoryForHostingEnvironmentAsync( - String resourceGroupName, String hostingEnvironmentName, Boolean expiredOnly, String filter, Context context) { - return new PagedFlux<>( - () -> - listHistoryForHostingEnvironmentSinglePageAsync( - resourceGroupName, hostingEnvironmentName, expiredOnly, filter, context), - nextLink -> listHistoryForHostingEnvironmentNextSinglePageAsync(nextLink, context)); - } - - /** - * Get past recommendations for an app, optionally specified by the time range. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param hostingEnvironmentName Name of the hosting environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return past recommendations for an app, optionally specified by the time range. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listHistoryForHostingEnvironment( - String resourceGroupName, String hostingEnvironmentName) { - final Boolean expiredOnly = null; - final String filter = null; - return new PagedIterable<>( - listHistoryForHostingEnvironmentAsync(resourceGroupName, hostingEnvironmentName, expiredOnly, filter)); - } - - /** - * Get past recommendations for an app, optionally specified by the time range. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param hostingEnvironmentName Name of the hosting environment. - * @param expiredOnly Specify <code>false</code> to return all recommendations. The default is - * <code>true</code>, which returns only expired recommendations. - * @param filter Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or channel eq - * 'Notification' and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq - * duration'[PT1H|PT1M|P1D]. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return past recommendations for an app, optionally specified by the time range. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listHistoryForHostingEnvironment( - String resourceGroupName, String hostingEnvironmentName, Boolean expiredOnly, String filter, Context context) { - return new PagedIterable<>( - listHistoryForHostingEnvironmentAsync( - resourceGroupName, hostingEnvironmentName, expiredOnly, filter, context)); - } - - /** - * Get all recommendations for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param hostingEnvironmentName Name of the app. - * @param featured Specify <code>true</code> to return only the most critical recommendations. The - * default is <code>false</code>, which returns all recommendations. - * @param filter Return only channels specified in the filter. Filter is specified by using OData syntax. Example: - * $filter=channel eq 'Api' or channel eq 'Notification'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all recommendations for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listRecommendedRulesForHostingEnvironmentSinglePageAsync( - String resourceGroupName, String hostingEnvironmentName, Boolean featured, String filter) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (hostingEnvironmentName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter hostingEnvironmentName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listRecommendedRulesForHostingEnvironment( - this.client.getEndpoint(), - resourceGroupName, - hostingEnvironmentName, - featured, - filter, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get all recommendations for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param hostingEnvironmentName Name of the app. - * @param featured Specify <code>true</code> to return only the most critical recommendations. The - * default is <code>false</code>, which returns all recommendations. - * @param filter Return only channels specified in the filter. Filter is specified by using OData syntax. Example: - * $filter=channel eq 'Api' or channel eq 'Notification'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all recommendations for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listRecommendedRulesForHostingEnvironmentSinglePageAsync( - String resourceGroupName, String hostingEnvironmentName, Boolean featured, String filter, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (hostingEnvironmentName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter hostingEnvironmentName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listRecommendedRulesForHostingEnvironment( - this.client.getEndpoint(), - resourceGroupName, - hostingEnvironmentName, - featured, - filter, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get all recommendations for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param hostingEnvironmentName Name of the app. - * @param featured Specify <code>true</code> to return only the most critical recommendations. The - * default is <code>false</code>, which returns all recommendations. - * @param filter Return only channels specified in the filter. Filter is specified by using OData syntax. Example: - * $filter=channel eq 'Api' or channel eq 'Notification'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all recommendations for an app. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listRecommendedRulesForHostingEnvironmentAsync( - String resourceGroupName, String hostingEnvironmentName, Boolean featured, String filter) { - return new PagedFlux<>( - () -> - listRecommendedRulesForHostingEnvironmentSinglePageAsync( - resourceGroupName, hostingEnvironmentName, featured, filter), - nextLink -> listRecommendedRulesForHostingEnvironmentNextSinglePageAsync(nextLink)); - } - - /** - * Get all recommendations for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param hostingEnvironmentName Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all recommendations for an app. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listRecommendedRulesForHostingEnvironmentAsync( - String resourceGroupName, String hostingEnvironmentName) { - final Boolean featured = null; - final String filter = null; - return new PagedFlux<>( - () -> - listRecommendedRulesForHostingEnvironmentSinglePageAsync( - resourceGroupName, hostingEnvironmentName, featured, filter), - nextLink -> listRecommendedRulesForHostingEnvironmentNextSinglePageAsync(nextLink)); - } - - /** - * Get all recommendations for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param hostingEnvironmentName Name of the app. - * @param featured Specify <code>true</code> to return only the most critical recommendations. The - * default is <code>false</code>, which returns all recommendations. - * @param filter Return only channels specified in the filter. Filter is specified by using OData syntax. Example: - * $filter=channel eq 'Api' or channel eq 'Notification'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all recommendations for an app. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listRecommendedRulesForHostingEnvironmentAsync( - String resourceGroupName, String hostingEnvironmentName, Boolean featured, String filter, Context context) { - return new PagedFlux<>( - () -> - listRecommendedRulesForHostingEnvironmentSinglePageAsync( - resourceGroupName, hostingEnvironmentName, featured, filter, context), - nextLink -> listRecommendedRulesForHostingEnvironmentNextSinglePageAsync(nextLink, context)); - } - - /** - * Get all recommendations for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param hostingEnvironmentName Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all recommendations for an app. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listRecommendedRulesForHostingEnvironment( - String resourceGroupName, String hostingEnvironmentName) { - final Boolean featured = null; - final String filter = null; - return new PagedIterable<>( - listRecommendedRulesForHostingEnvironmentAsync( - resourceGroupName, hostingEnvironmentName, featured, filter)); - } - - /** - * Get all recommendations for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param hostingEnvironmentName Name of the app. - * @param featured Specify <code>true</code> to return only the most critical recommendations. The - * default is <code>false</code>, which returns all recommendations. - * @param filter Return only channels specified in the filter. Filter is specified by using OData syntax. Example: - * $filter=channel eq 'Api' or channel eq 'Notification'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all recommendations for an app. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listRecommendedRulesForHostingEnvironment( - String resourceGroupName, String hostingEnvironmentName, Boolean featured, String filter, Context context) { - return new PagedIterable<>( - listRecommendedRulesForHostingEnvironmentAsync( - resourceGroupName, hostingEnvironmentName, featured, filter, context)); - } - - /** - * Disable all recommendations for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param environmentName Name of the app. - * @param hostingEnvironmentName The hostingEnvironmentName parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> disableAllForHostingEnvironmentWithResponseAsync( - String resourceGroupName, String environmentName, String hostingEnvironmentName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (environmentName == null) { - return Mono - .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } - if (hostingEnvironmentName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter hostingEnvironmentName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .disableAllForHostingEnvironment( - this.client.getEndpoint(), - resourceGroupName, - environmentName, - hostingEnvironmentName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Disable all recommendations for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param environmentName Name of the app. - * @param hostingEnvironmentName The hostingEnvironmentName parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> disableAllForHostingEnvironmentWithResponseAsync( - String resourceGroupName, String environmentName, String hostingEnvironmentName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (environmentName == null) { - return Mono - .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } - if (hostingEnvironmentName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter hostingEnvironmentName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .disableAllForHostingEnvironment( - this.client.getEndpoint(), - resourceGroupName, - environmentName, - hostingEnvironmentName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Disable all recommendations for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param environmentName Name of the app. - * @param hostingEnvironmentName The hostingEnvironmentName parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono disableAllForHostingEnvironmentAsync( - String resourceGroupName, String environmentName, String hostingEnvironmentName) { - return disableAllForHostingEnvironmentWithResponseAsync( - resourceGroupName, environmentName, hostingEnvironmentName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Disable all recommendations for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param environmentName Name of the app. - * @param hostingEnvironmentName The hostingEnvironmentName parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void disableAllForHostingEnvironment( - String resourceGroupName, String environmentName, String hostingEnvironmentName) { - disableAllForHostingEnvironmentAsync(resourceGroupName, environmentName, hostingEnvironmentName).block(); - } - - /** - * Disable all recommendations for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param environmentName Name of the app. - * @param hostingEnvironmentName The hostingEnvironmentName parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response disableAllForHostingEnvironmentWithResponse( - String resourceGroupName, String environmentName, String hostingEnvironmentName, Context context) { - return disableAllForHostingEnvironmentWithResponseAsync( - resourceGroupName, environmentName, hostingEnvironmentName, context) - .block(); - } - - /** - * Reset all recommendation opt-out settings for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param environmentName Name of the app. - * @param hostingEnvironmentName The hostingEnvironmentName parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> resetAllFiltersForHostingEnvironmentWithResponseAsync( - String resourceGroupName, String environmentName, String hostingEnvironmentName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (environmentName == null) { - return Mono - .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } - if (hostingEnvironmentName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter hostingEnvironmentName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .resetAllFiltersForHostingEnvironment( - this.client.getEndpoint(), - resourceGroupName, - environmentName, - hostingEnvironmentName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Reset all recommendation opt-out settings for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param environmentName Name of the app. - * @param hostingEnvironmentName The hostingEnvironmentName parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> resetAllFiltersForHostingEnvironmentWithResponseAsync( - String resourceGroupName, String environmentName, String hostingEnvironmentName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (environmentName == null) { - return Mono - .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } - if (hostingEnvironmentName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter hostingEnvironmentName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .resetAllFiltersForHostingEnvironment( - this.client.getEndpoint(), - resourceGroupName, - environmentName, - hostingEnvironmentName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Reset all recommendation opt-out settings for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param environmentName Name of the app. - * @param hostingEnvironmentName The hostingEnvironmentName parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono resetAllFiltersForHostingEnvironmentAsync( - String resourceGroupName, String environmentName, String hostingEnvironmentName) { - return resetAllFiltersForHostingEnvironmentWithResponseAsync( - resourceGroupName, environmentName, hostingEnvironmentName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Reset all recommendation opt-out settings for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param environmentName Name of the app. - * @param hostingEnvironmentName The hostingEnvironmentName parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void resetAllFiltersForHostingEnvironment( - String resourceGroupName, String environmentName, String hostingEnvironmentName) { - resetAllFiltersForHostingEnvironmentAsync(resourceGroupName, environmentName, hostingEnvironmentName).block(); - } - - /** - * Reset all recommendation opt-out settings for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param environmentName Name of the app. - * @param hostingEnvironmentName The hostingEnvironmentName parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response resetAllFiltersForHostingEnvironmentWithResponse( - String resourceGroupName, String environmentName, String hostingEnvironmentName, Context context) { - return resetAllFiltersForHostingEnvironmentWithResponseAsync( - resourceGroupName, environmentName, hostingEnvironmentName, context) - .block(); - } - - /** - * Get a recommendation rule for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param hostingEnvironmentName Name of the hosting environment. - * @param name Name of the recommendation. - * @param updateSeen Specify <code>true</code> to update the last-seen timestamp of the recommendation - * object. - * @param recommendationId The GUID of the recommendation object if you query an expired one. You don't need to - * specify it to query an active entry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a recommendation rule for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getRuleDetailsByHostingEnvironmentWithResponseAsync( - String resourceGroupName, - String hostingEnvironmentName, - String name, - Boolean updateSeen, - String recommendationId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (hostingEnvironmentName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter hostingEnvironmentName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getRuleDetailsByHostingEnvironment( - this.client.getEndpoint(), - resourceGroupName, - hostingEnvironmentName, - name, - updateSeen, - recommendationId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a recommendation rule for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param hostingEnvironmentName Name of the hosting environment. - * @param name Name of the recommendation. - * @param updateSeen Specify <code>true</code> to update the last-seen timestamp of the recommendation - * object. - * @param recommendationId The GUID of the recommendation object if you query an expired one. You don't need to - * specify it to query an active entry. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a recommendation rule for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getRuleDetailsByHostingEnvironmentWithResponseAsync( - String resourceGroupName, - String hostingEnvironmentName, - String name, - Boolean updateSeen, - String recommendationId, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (hostingEnvironmentName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter hostingEnvironmentName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getRuleDetailsByHostingEnvironment( - this.client.getEndpoint(), - resourceGroupName, - hostingEnvironmentName, - name, - updateSeen, - recommendationId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Get a recommendation rule for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param hostingEnvironmentName Name of the hosting environment. - * @param name Name of the recommendation. - * @param updateSeen Specify <code>true</code> to update the last-seen timestamp of the recommendation - * object. - * @param recommendationId The GUID of the recommendation object if you query an expired one. You don't need to - * specify it to query an active entry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a recommendation rule for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getRuleDetailsByHostingEnvironmentAsync( - String resourceGroupName, - String hostingEnvironmentName, - String name, - Boolean updateSeen, - String recommendationId) { - return getRuleDetailsByHostingEnvironmentWithResponseAsync( - resourceGroupName, hostingEnvironmentName, name, updateSeen, recommendationId) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get a recommendation rule for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param hostingEnvironmentName Name of the hosting environment. - * @param name Name of the recommendation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a recommendation rule for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getRuleDetailsByHostingEnvironmentAsync( - String resourceGroupName, String hostingEnvironmentName, String name) { - final Boolean updateSeen = null; - final String recommendationId = null; - return getRuleDetailsByHostingEnvironmentWithResponseAsync( - resourceGroupName, hostingEnvironmentName, name, updateSeen, recommendationId) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get a recommendation rule for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param hostingEnvironmentName Name of the hosting environment. - * @param name Name of the recommendation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a recommendation rule for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RecommendationRuleInner getRuleDetailsByHostingEnvironment( - String resourceGroupName, String hostingEnvironmentName, String name) { - final Boolean updateSeen = null; - final String recommendationId = null; - return getRuleDetailsByHostingEnvironmentAsync( - resourceGroupName, hostingEnvironmentName, name, updateSeen, recommendationId) - .block(); - } - - /** - * Get a recommendation rule for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param hostingEnvironmentName Name of the hosting environment. - * @param name Name of the recommendation. - * @param updateSeen Specify <code>true</code> to update the last-seen timestamp of the recommendation - * object. - * @param recommendationId The GUID of the recommendation object if you query an expired one. You don't need to - * specify it to query an active entry. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a recommendation rule for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getRuleDetailsByHostingEnvironmentWithResponse( - String resourceGroupName, - String hostingEnvironmentName, - String name, - Boolean updateSeen, - String recommendationId, - Context context) { - return getRuleDetailsByHostingEnvironmentWithResponseAsync( - resourceGroupName, hostingEnvironmentName, name, updateSeen, recommendationId, context) - .block(); - } - - /** - * Disables the specific rule for a web site permanently. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param environmentName Site name. - * @param name Rule name. - * @param hostingEnvironmentName The hostingEnvironmentName parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> disableRecommendationForHostingEnvironmentWithResponseAsync( - String resourceGroupName, String environmentName, String name, String hostingEnvironmentName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (environmentName == null) { - return Mono - .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (hostingEnvironmentName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter hostingEnvironmentName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .disableRecommendationForHostingEnvironment( - this.client.getEndpoint(), - resourceGroupName, - environmentName, - name, - hostingEnvironmentName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Disables the specific rule for a web site permanently. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param environmentName Site name. - * @param name Rule name. - * @param hostingEnvironmentName The hostingEnvironmentName parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> disableRecommendationForHostingEnvironmentWithResponseAsync( - String resourceGroupName, String environmentName, String name, String hostingEnvironmentName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (environmentName == null) { - return Mono - .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (hostingEnvironmentName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter hostingEnvironmentName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .disableRecommendationForHostingEnvironment( - this.client.getEndpoint(), - resourceGroupName, - environmentName, - name, - hostingEnvironmentName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Disables the specific rule for a web site permanently. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param environmentName Site name. - * @param name Rule name. - * @param hostingEnvironmentName The hostingEnvironmentName parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono disableRecommendationForHostingEnvironmentAsync( - String resourceGroupName, String environmentName, String name, String hostingEnvironmentName) { - return disableRecommendationForHostingEnvironmentWithResponseAsync( - resourceGroupName, environmentName, name, hostingEnvironmentName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Disables the specific rule for a web site permanently. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param environmentName Site name. - * @param name Rule name. - * @param hostingEnvironmentName The hostingEnvironmentName parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void disableRecommendationForHostingEnvironment( - String resourceGroupName, String environmentName, String name, String hostingEnvironmentName) { - disableRecommendationForHostingEnvironmentAsync( - resourceGroupName, environmentName, name, hostingEnvironmentName) - .block(); - } - - /** - * Disables the specific rule for a web site permanently. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param environmentName Site name. - * @param name Rule name. - * @param hostingEnvironmentName The hostingEnvironmentName parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response disableRecommendationForHostingEnvironmentWithResponse( - String resourceGroupName, String environmentName, String name, String hostingEnvironmentName, Context context) { - return disableRecommendationForHostingEnvironmentWithResponseAsync( - resourceGroupName, environmentName, name, hostingEnvironmentName, context) - .block(); - } - - /** - * Get past recommendations for an app, optionally specified by the time range. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Name of the app. - * @param expiredOnly Specify <code>false</code> to return all recommendations. The default is - * <code>true</code>, which returns only expired recommendations. - * @param filter Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or channel eq - * 'Notification' and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq - * duration'[PT1H|PT1M|P1D]. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return past recommendations for an app, optionally specified by the time range. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listHistoryForWebAppSinglePageAsync( - String resourceGroupName, String siteName, Boolean expiredOnly, String filter) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (siteName == null) { - return Mono.error(new IllegalArgumentException("Parameter siteName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listHistoryForWebApp( - this.client.getEndpoint(), - resourceGroupName, - siteName, - expiredOnly, - filter, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get past recommendations for an app, optionally specified by the time range. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Name of the app. - * @param expiredOnly Specify <code>false</code> to return all recommendations. The default is - * <code>true</code>, which returns only expired recommendations. - * @param filter Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or channel eq - * 'Notification' and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq - * duration'[PT1H|PT1M|P1D]. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return past recommendations for an app, optionally specified by the time range. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listHistoryForWebAppSinglePageAsync( - String resourceGroupName, String siteName, Boolean expiredOnly, String filter, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (siteName == null) { - return Mono.error(new IllegalArgumentException("Parameter siteName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listHistoryForWebApp( - this.client.getEndpoint(), - resourceGroupName, - siteName, - expiredOnly, - filter, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get past recommendations for an app, optionally specified by the time range. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Name of the app. - * @param expiredOnly Specify <code>false</code> to return all recommendations. The default is - * <code>true</code>, which returns only expired recommendations. - * @param filter Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or channel eq - * 'Notification' and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq - * duration'[PT1H|PT1M|P1D]. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return past recommendations for an app, optionally specified by the time range. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listHistoryForWebAppAsync( - String resourceGroupName, String siteName, Boolean expiredOnly, String filter) { - return new PagedFlux<>( - () -> listHistoryForWebAppSinglePageAsync(resourceGroupName, siteName, expiredOnly, filter), - nextLink -> listHistoryForWebAppNextSinglePageAsync(nextLink)); - } - - /** - * Get past recommendations for an app, optionally specified by the time range. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return past recommendations for an app, optionally specified by the time range. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listHistoryForWebAppAsync(String resourceGroupName, String siteName) { - final Boolean expiredOnly = null; - final String filter = null; - return new PagedFlux<>( - () -> listHistoryForWebAppSinglePageAsync(resourceGroupName, siteName, expiredOnly, filter), - nextLink -> listHistoryForWebAppNextSinglePageAsync(nextLink)); - } - - /** - * Get past recommendations for an app, optionally specified by the time range. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Name of the app. - * @param expiredOnly Specify <code>false</code> to return all recommendations. The default is - * <code>true</code>, which returns only expired recommendations. - * @param filter Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or channel eq - * 'Notification' and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq - * duration'[PT1H|PT1M|P1D]. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return past recommendations for an app, optionally specified by the time range. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listHistoryForWebAppAsync( - String resourceGroupName, String siteName, Boolean expiredOnly, String filter, Context context) { - return new PagedFlux<>( - () -> listHistoryForWebAppSinglePageAsync(resourceGroupName, siteName, expiredOnly, filter, context), - nextLink -> listHistoryForWebAppNextSinglePageAsync(nextLink, context)); - } - - /** - * Get past recommendations for an app, optionally specified by the time range. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return past recommendations for an app, optionally specified by the time range. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listHistoryForWebApp(String resourceGroupName, String siteName) { - final Boolean expiredOnly = null; - final String filter = null; - return new PagedIterable<>(listHistoryForWebAppAsync(resourceGroupName, siteName, expiredOnly, filter)); - } - - /** - * Get past recommendations for an app, optionally specified by the time range. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Name of the app. - * @param expiredOnly Specify <code>false</code> to return all recommendations. The default is - * <code>true</code>, which returns only expired recommendations. - * @param filter Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or channel eq - * 'Notification' and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq - * duration'[PT1H|PT1M|P1D]. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return past recommendations for an app, optionally specified by the time range. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listHistoryForWebApp( - String resourceGroupName, String siteName, Boolean expiredOnly, String filter, Context context) { - return new PagedIterable<>( - listHistoryForWebAppAsync(resourceGroupName, siteName, expiredOnly, filter, context)); - } - - /** - * Get all recommendations for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Name of the app. - * @param featured Specify <code>true</code> to return only the most critical recommendations. The - * default is <code>false</code>, which returns all recommendations. - * @param filter Return only channels specified in the filter. Filter is specified by using OData syntax. Example: - * $filter=channel eq 'Api' or channel eq 'Notification'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all recommendations for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listRecommendedRulesForWebAppSinglePageAsync( - String resourceGroupName, String siteName, Boolean featured, String filter) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (siteName == null) { - return Mono.error(new IllegalArgumentException("Parameter siteName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listRecommendedRulesForWebApp( - this.client.getEndpoint(), - resourceGroupName, - siteName, - featured, - filter, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get all recommendations for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Name of the app. - * @param featured Specify <code>true</code> to return only the most critical recommendations. The - * default is <code>false</code>, which returns all recommendations. - * @param filter Return only channels specified in the filter. Filter is specified by using OData syntax. Example: - * $filter=channel eq 'Api' or channel eq 'Notification'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all recommendations for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listRecommendedRulesForWebAppSinglePageAsync( - String resourceGroupName, String siteName, Boolean featured, String filter, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (siteName == null) { - return Mono.error(new IllegalArgumentException("Parameter siteName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listRecommendedRulesForWebApp( - this.client.getEndpoint(), - resourceGroupName, - siteName, - featured, - filter, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get all recommendations for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Name of the app. - * @param featured Specify <code>true</code> to return only the most critical recommendations. The - * default is <code>false</code>, which returns all recommendations. - * @param filter Return only channels specified in the filter. Filter is specified by using OData syntax. Example: - * $filter=channel eq 'Api' or channel eq 'Notification'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all recommendations for an app. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listRecommendedRulesForWebAppAsync( - String resourceGroupName, String siteName, Boolean featured, String filter) { - return new PagedFlux<>( - () -> listRecommendedRulesForWebAppSinglePageAsync(resourceGroupName, siteName, featured, filter), - nextLink -> listRecommendedRulesForWebAppNextSinglePageAsync(nextLink)); - } - - /** - * Get all recommendations for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all recommendations for an app. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listRecommendedRulesForWebAppAsync( - String resourceGroupName, String siteName) { - final Boolean featured = null; - final String filter = null; - return new PagedFlux<>( - () -> listRecommendedRulesForWebAppSinglePageAsync(resourceGroupName, siteName, featured, filter), - nextLink -> listRecommendedRulesForWebAppNextSinglePageAsync(nextLink)); - } - - /** - * Get all recommendations for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Name of the app. - * @param featured Specify <code>true</code> to return only the most critical recommendations. The - * default is <code>false</code>, which returns all recommendations. - * @param filter Return only channels specified in the filter. Filter is specified by using OData syntax. Example: - * $filter=channel eq 'Api' or channel eq 'Notification'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all recommendations for an app. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listRecommendedRulesForWebAppAsync( - String resourceGroupName, String siteName, Boolean featured, String filter, Context context) { - return new PagedFlux<>( - () -> listRecommendedRulesForWebAppSinglePageAsync(resourceGroupName, siteName, featured, filter, context), - nextLink -> listRecommendedRulesForWebAppNextSinglePageAsync(nextLink, context)); - } - - /** - * Get all recommendations for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all recommendations for an app. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listRecommendedRulesForWebApp(String resourceGroupName, String siteName) { - final Boolean featured = null; - final String filter = null; - return new PagedIterable<>(listRecommendedRulesForWebAppAsync(resourceGroupName, siteName, featured, filter)); - } - - /** - * Get all recommendations for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Name of the app. - * @param featured Specify <code>true</code> to return only the most critical recommendations. The - * default is <code>false</code>, which returns all recommendations. - * @param filter Return only channels specified in the filter. Filter is specified by using OData syntax. Example: - * $filter=channel eq 'Api' or channel eq 'Notification'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all recommendations for an app. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listRecommendedRulesForWebApp( - String resourceGroupName, String siteName, Boolean featured, String filter, Context context) { - return new PagedIterable<>( - listRecommendedRulesForWebAppAsync(resourceGroupName, siteName, featured, filter, context)); - } - - /** - * Disable all recommendations for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> disableAllForWebAppWithResponseAsync(String resourceGroupName, String siteName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (siteName == null) { - return Mono.error(new IllegalArgumentException("Parameter siteName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .disableAllForWebApp( - this.client.getEndpoint(), - resourceGroupName, - siteName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Disable all recommendations for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> disableAllForWebAppWithResponseAsync( - String resourceGroupName, String siteName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (siteName == null) { - return Mono.error(new IllegalArgumentException("Parameter siteName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .disableAllForWebApp( - this.client.getEndpoint(), - resourceGroupName, - siteName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Disable all recommendations for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono disableAllForWebAppAsync(String resourceGroupName, String siteName) { - return disableAllForWebAppWithResponseAsync(resourceGroupName, siteName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Disable all recommendations for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void disableAllForWebApp(String resourceGroupName, String siteName) { - disableAllForWebAppAsync(resourceGroupName, siteName).block(); - } - - /** - * Disable all recommendations for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response disableAllForWebAppWithResponse(String resourceGroupName, String siteName, Context context) { - return disableAllForWebAppWithResponseAsync(resourceGroupName, siteName, context).block(); - } - - /** - * Reset all recommendation opt-out settings for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> resetAllFiltersForWebAppWithResponseAsync(String resourceGroupName, String siteName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (siteName == null) { - return Mono.error(new IllegalArgumentException("Parameter siteName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .resetAllFiltersForWebApp( - this.client.getEndpoint(), - resourceGroupName, - siteName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Reset all recommendation opt-out settings for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> resetAllFiltersForWebAppWithResponseAsync( - String resourceGroupName, String siteName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (siteName == null) { - return Mono.error(new IllegalArgumentException("Parameter siteName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .resetAllFiltersForWebApp( - this.client.getEndpoint(), - resourceGroupName, - siteName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Reset all recommendation opt-out settings for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono resetAllFiltersForWebAppAsync(String resourceGroupName, String siteName) { - return resetAllFiltersForWebAppWithResponseAsync(resourceGroupName, siteName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Reset all recommendation opt-out settings for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void resetAllFiltersForWebApp(String resourceGroupName, String siteName) { - resetAllFiltersForWebAppAsync(resourceGroupName, siteName).block(); - } - - /** - * Reset all recommendation opt-out settings for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response resetAllFiltersForWebAppWithResponse( - String resourceGroupName, String siteName, Context context) { - return resetAllFiltersForWebAppWithResponseAsync(resourceGroupName, siteName, context).block(); - } - - /** - * Get a recommendation rule for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Name of the app. - * @param name Name of the recommendation. - * @param updateSeen Specify <code>true</code> to update the last-seen timestamp of the recommendation - * object. - * @param recommendationId The GUID of the recommendation object if you query an expired one. You don't need to - * specify it to query an active entry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a recommendation rule for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getRuleDetailsByWebAppWithResponseAsync( - String resourceGroupName, String siteName, String name, Boolean updateSeen, String recommendationId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (siteName == null) { - return Mono.error(new IllegalArgumentException("Parameter siteName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getRuleDetailsByWebApp( - this.client.getEndpoint(), - resourceGroupName, - siteName, - name, - updateSeen, - recommendationId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a recommendation rule for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Name of the app. - * @param name Name of the recommendation. - * @param updateSeen Specify <code>true</code> to update the last-seen timestamp of the recommendation - * object. - * @param recommendationId The GUID of the recommendation object if you query an expired one. You don't need to - * specify it to query an active entry. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a recommendation rule for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getRuleDetailsByWebAppWithResponseAsync( - String resourceGroupName, - String siteName, - String name, - Boolean updateSeen, - String recommendationId, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (siteName == null) { - return Mono.error(new IllegalArgumentException("Parameter siteName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getRuleDetailsByWebApp( - this.client.getEndpoint(), - resourceGroupName, - siteName, - name, - updateSeen, - recommendationId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Get a recommendation rule for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Name of the app. - * @param name Name of the recommendation. - * @param updateSeen Specify <code>true</code> to update the last-seen timestamp of the recommendation - * object. - * @param recommendationId The GUID of the recommendation object if you query an expired one. You don't need to - * specify it to query an active entry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a recommendation rule for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getRuleDetailsByWebAppAsync( - String resourceGroupName, String siteName, String name, Boolean updateSeen, String recommendationId) { - return getRuleDetailsByWebAppWithResponseAsync(resourceGroupName, siteName, name, updateSeen, recommendationId) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get a recommendation rule for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Name of the app. - * @param name Name of the recommendation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a recommendation rule for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getRuleDetailsByWebAppAsync( - String resourceGroupName, String siteName, String name) { - final Boolean updateSeen = null; - final String recommendationId = null; - return getRuleDetailsByWebAppWithResponseAsync(resourceGroupName, siteName, name, updateSeen, recommendationId) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get a recommendation rule for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Name of the app. - * @param name Name of the recommendation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a recommendation rule for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RecommendationRuleInner getRuleDetailsByWebApp(String resourceGroupName, String siteName, String name) { - final Boolean updateSeen = null; - final String recommendationId = null; - return getRuleDetailsByWebAppAsync(resourceGroupName, siteName, name, updateSeen, recommendationId).block(); - } - - /** - * Get a recommendation rule for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Name of the app. - * @param name Name of the recommendation. - * @param updateSeen Specify <code>true</code> to update the last-seen timestamp of the recommendation - * object. - * @param recommendationId The GUID of the recommendation object if you query an expired one. You don't need to - * specify it to query an active entry. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a recommendation rule for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getRuleDetailsByWebAppWithResponse( - String resourceGroupName, - String siteName, - String name, - Boolean updateSeen, - String recommendationId, - Context context) { - return getRuleDetailsByWebAppWithResponseAsync( - resourceGroupName, siteName, name, updateSeen, recommendationId, context) - .block(); - } - - /** - * Disables the specific rule for a web site permanently. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site name. - * @param name Rule name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> disableRecommendationForSiteWithResponseAsync( - String resourceGroupName, String siteName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (siteName == null) { - return Mono.error(new IllegalArgumentException("Parameter siteName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .disableRecommendationForSite( - this.client.getEndpoint(), - resourceGroupName, - siteName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Disables the specific rule for a web site permanently. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site name. - * @param name Rule name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> disableRecommendationForSiteWithResponseAsync( - String resourceGroupName, String siteName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (siteName == null) { - return Mono.error(new IllegalArgumentException("Parameter siteName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .disableRecommendationForSite( - this.client.getEndpoint(), - resourceGroupName, - siteName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Disables the specific rule for a web site permanently. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site name. - * @param name Rule name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono disableRecommendationForSiteAsync(String resourceGroupName, String siteName, String name) { - return disableRecommendationForSiteWithResponseAsync(resourceGroupName, siteName, name) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Disables the specific rule for a web site permanently. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site name. - * @param name Rule name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void disableRecommendationForSite(String resourceGroupName, String siteName, String name) { - disableRecommendationForSiteAsync(resourceGroupName, siteName, name).block(); - } - - /** - * Disables the specific rule for a web site permanently. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site name. - * @param name Rule name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response disableRecommendationForSiteWithResponse( - String resourceGroupName, String siteName, String name, Context context) { - return disableRecommendationForSiteWithResponseAsync(resourceGroupName, siteName, name, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of recommendations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of recommendations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of recommendations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listHistoryForHostingEnvironmentNextSinglePageAsync( - String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service.listHistoryForHostingEnvironmentNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of recommendations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listHistoryForHostingEnvironmentNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listHistoryForHostingEnvironmentNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of recommendations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listRecommendedRulesForHostingEnvironmentNextSinglePageAsync( - String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listRecommendedRulesForHostingEnvironmentNext( - nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of recommendations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listRecommendedRulesForHostingEnvironmentNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listRecommendedRulesForHostingEnvironmentNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of recommendations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listHistoryForWebAppNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listHistoryForWebAppNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of recommendations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listHistoryForWebAppNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listHistoryForWebAppNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of recommendations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listRecommendedRulesForWebAppNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service.listRecommendedRulesForWebAppNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of recommendations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listRecommendedRulesForWebAppNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listRecommendedRulesForWebAppNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/ResourceHealthMetadatasClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/ResourceHealthMetadatasClientImpl.java deleted file mode 100644 index fb450962046d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/ResourceHealthMetadatasClientImpl.java +++ /dev/null @@ -1,1471 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.ResourceHealthMetadatasClient; -import com.azure.resourcemanager.appservice.fluent.models.ResourceHealthMetadataInner; -import com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException; -import com.azure.resourcemanager.appservice.models.ResourceHealthMetadataCollection; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ResourceHealthMetadatasClient. */ -public final class ResourceHealthMetadatasClientImpl - implements InnerSupportsListing, ResourceHealthMetadatasClient { - private final ClientLogger logger = new ClientLogger(ResourceHealthMetadatasClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final ResourceHealthMetadatasService service; - - /** The service client containing this operation class. */ - private final WebSiteManagementClientImpl client; - - /** - * Initializes an instance of ResourceHealthMetadatasClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ResourceHealthMetadatasClientImpl(WebSiteManagementClientImpl client) { - this.service = - RestProxy - .create(ResourceHealthMetadatasService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for WebSiteManagementClientResourceHealthMetadatas to be used by the - * proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "WebSiteManagementCli") - private interface ResourceHealthMetadatasService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Web/resourceHealthMetadata") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web" - + "/resourceHealthMetadata") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/resourceHealthMetadata") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listBySite( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/resourceHealthMetadata/default") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getBySite( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/resourceHealthMetadata") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listBySiteSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/resourceHealthMetadata/default") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getBySiteSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listBySiteNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listBySiteSlotNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * List all ResourceHealthMetadata for all sites in the subscription. - * - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of resource health metadata. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List all ResourceHealthMetadata for all sites in the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of resource health metadata. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * List all ResourceHealthMetadata for all sites in the subscription. - * - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of resource health metadata. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List all ResourceHealthMetadata for all sites in the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of resource health metadata. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * List all ResourceHealthMetadata for all sites in the subscription. - * - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of resource health metadata. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * List all ResourceHealthMetadata for all sites in the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of resource health metadata. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * List all ResourceHealthMetadata for all sites in the resource group in the subscription. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of resource health metadata. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List all ResourceHealthMetadata for all sites in the resource group in the subscription. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of resource health metadata. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * List all ResourceHealthMetadata for all sites in the resource group in the subscription. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of resource health metadata. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * List all ResourceHealthMetadata for all sites in the resource group in the subscription. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of resource health metadata. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * List all ResourceHealthMetadata for all sites in the resource group in the subscription. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of resource health metadata. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * List all ResourceHealthMetadata for all sites in the resource group in the subscription. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of resource health metadata. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * Gets the category of ResourceHealthMetadata to use for the given site as a collection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the category of ResourceHealthMetadata to use for the given site as a collection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySiteSinglePageAsync( - String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listBySite( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the category of ResourceHealthMetadata to use for the given site as a collection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the category of ResourceHealthMetadata to use for the given site as a collection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySiteSinglePageAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listBySite( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets the category of ResourceHealthMetadata to use for the given site as a collection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the category of ResourceHealthMetadata to use for the given site as a collection. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listBySiteAsync(String resourceGroupName, String name) { - return new PagedFlux<>( - () -> listBySiteSinglePageAsync(resourceGroupName, name), - nextLink -> listBySiteNextSinglePageAsync(nextLink)); - } - - /** - * Gets the category of ResourceHealthMetadata to use for the given site as a collection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the category of ResourceHealthMetadata to use for the given site as a collection. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listBySiteAsync( - String resourceGroupName, String name, Context context) { - return new PagedFlux<>( - () -> listBySiteSinglePageAsync(resourceGroupName, name, context), - nextLink -> listBySiteNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets the category of ResourceHealthMetadata to use for the given site as a collection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the category of ResourceHealthMetadata to use for the given site as a collection. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listBySite(String resourceGroupName, String name) { - return new PagedIterable<>(listBySiteAsync(resourceGroupName, name)); - } - - /** - * Gets the category of ResourceHealthMetadata to use for the given site as a collection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the category of ResourceHealthMetadata to use for the given site as a collection. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listBySite( - String resourceGroupName, String name, Context context) { - return new PagedIterable<>(listBySiteAsync(resourceGroupName, name, context)); - } - - /** - * Gets the category of ResourceHealthMetadata to use for the given site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the category of ResourceHealthMetadata to use for the given site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getBySiteWithResponseAsync( - String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getBySite( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the category of ResourceHealthMetadata to use for the given site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the category of ResourceHealthMetadata to use for the given site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getBySiteWithResponseAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getBySite( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets the category of ResourceHealthMetadata to use for the given site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the category of ResourceHealthMetadata to use for the given site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getBySiteAsync(String resourceGroupName, String name) { - return getBySiteWithResponseAsync(resourceGroupName, name) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the category of ResourceHealthMetadata to use for the given site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the category of ResourceHealthMetadata to use for the given site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResourceHealthMetadataInner getBySite(String resourceGroupName, String name) { - return getBySiteAsync(resourceGroupName, name).block(); - } - - /** - * Gets the category of ResourceHealthMetadata to use for the given site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the category of ResourceHealthMetadata to use for the given site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getBySiteWithResponse( - String resourceGroupName, String name, Context context) { - return getBySiteWithResponseAsync(resourceGroupName, name, context).block(); - } - - /** - * Gets the category of ResourceHealthMetadata to use for the given site as a collection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the category of ResourceHealthMetadata to use for the given site as a collection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySiteSlotSinglePageAsync( - String resourceGroupName, String name, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listBySiteSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the category of ResourceHealthMetadata to use for the given site as a collection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the category of ResourceHealthMetadata to use for the given site as a collection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySiteSlotSinglePageAsync( - String resourceGroupName, String name, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listBySiteSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets the category of ResourceHealthMetadata to use for the given site as a collection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the category of ResourceHealthMetadata to use for the given site as a collection. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listBySiteSlotAsync( - String resourceGroupName, String name, String slot) { - return new PagedFlux<>( - () -> listBySiteSlotSinglePageAsync(resourceGroupName, name, slot), - nextLink -> listBySiteSlotNextSinglePageAsync(nextLink)); - } - - /** - * Gets the category of ResourceHealthMetadata to use for the given site as a collection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the category of ResourceHealthMetadata to use for the given site as a collection. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listBySiteSlotAsync( - String resourceGroupName, String name, String slot, Context context) { - return new PagedFlux<>( - () -> listBySiteSlotSinglePageAsync(resourceGroupName, name, slot, context), - nextLink -> listBySiteSlotNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets the category of ResourceHealthMetadata to use for the given site as a collection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the category of ResourceHealthMetadata to use for the given site as a collection. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listBySiteSlot( - String resourceGroupName, String name, String slot) { - return new PagedIterable<>(listBySiteSlotAsync(resourceGroupName, name, slot)); - } - - /** - * Gets the category of ResourceHealthMetadata to use for the given site as a collection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the category of ResourceHealthMetadata to use for the given site as a collection. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listBySiteSlot( - String resourceGroupName, String name, String slot, Context context) { - return new PagedIterable<>(listBySiteSlotAsync(resourceGroupName, name, slot, context)); - } - - /** - * Gets the category of ResourceHealthMetadata to use for the given site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the category of ResourceHealthMetadata to use for the given site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getBySiteSlotWithResponseAsync( - String resourceGroupName, String name, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getBySiteSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the category of ResourceHealthMetadata to use for the given site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the category of ResourceHealthMetadata to use for the given site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getBySiteSlotWithResponseAsync( - String resourceGroupName, String name, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getBySiteSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets the category of ResourceHealthMetadata to use for the given site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the category of ResourceHealthMetadata to use for the given site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getBySiteSlotAsync(String resourceGroupName, String name, String slot) { - return getBySiteSlotWithResponseAsync(resourceGroupName, name, slot) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the category of ResourceHealthMetadata to use for the given site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the category of ResourceHealthMetadata to use for the given site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResourceHealthMetadataInner getBySiteSlot(String resourceGroupName, String name, String slot) { - return getBySiteSlotAsync(resourceGroupName, name, slot).block(); - } - - /** - * Gets the category of ResourceHealthMetadata to use for the given site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the category of ResourceHealthMetadata to use for the given site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getBySiteSlotWithResponse( - String resourceGroupName, String name, String slot, Context context) { - return getBySiteSlotWithResponseAsync(resourceGroupName, name, slot, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of resource health metadata. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of resource health metadata. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of resource health metadata. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of resource health metadata. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of resource health metadata. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySiteNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listBySiteNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of resource health metadata. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySiteNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listBySiteNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of resource health metadata. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySiteSlotNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listBySiteSlotNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of resource health metadata. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySiteSlotNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listBySiteSlotNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/ResourceProvidersClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/ResourceProvidersClientImpl.java deleted file mode 100644 index 8609a8a6e9f1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/ResourceProvidersClientImpl.java +++ /dev/null @@ -1,3119 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.ResourceProvidersClient; -import com.azure.resourcemanager.appservice.fluent.models.BillingMeterInner; -import com.azure.resourcemanager.appservice.fluent.models.DeploymentLocationsInner; -import com.azure.resourcemanager.appservice.fluent.models.GeoRegionInner; -import com.azure.resourcemanager.appservice.fluent.models.IdentifierInner; -import com.azure.resourcemanager.appservice.fluent.models.NameIdentifierInner; -import com.azure.resourcemanager.appservice.fluent.models.PremierAddOnOfferInner; -import com.azure.resourcemanager.appservice.fluent.models.ResourceNameAvailabilityInner; -import com.azure.resourcemanager.appservice.fluent.models.SkuInfosInner; -import com.azure.resourcemanager.appservice.fluent.models.SourceControlInner; -import com.azure.resourcemanager.appservice.fluent.models.UserInner; -import com.azure.resourcemanager.appservice.fluent.models.ValidateResponseInner; -import com.azure.resourcemanager.appservice.fluent.models.VnetValidationFailureDetailsInner; -import com.azure.resourcemanager.appservice.models.BillingMeterCollection; -import com.azure.resourcemanager.appservice.models.CsmMoveResourceEnvelope; -import com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException; -import com.azure.resourcemanager.appservice.models.GeoRegionCollection; -import com.azure.resourcemanager.appservice.models.IdentifierCollection; -import com.azure.resourcemanager.appservice.models.PremierAddOnOfferCollection; -import com.azure.resourcemanager.appservice.models.ResourceNameAvailabilityRequest; -import com.azure.resourcemanager.appservice.models.SkuName; -import com.azure.resourcemanager.appservice.models.SourceControlCollection; -import com.azure.resourcemanager.appservice.models.ValidateContainerSettingsRequest; -import com.azure.resourcemanager.appservice.models.ValidateRequest; -import com.azure.resourcemanager.appservice.models.VnetParameters; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ResourceProvidersClient. */ -public final class ResourceProvidersClientImpl implements ResourceProvidersClient { - private final ClientLogger logger = new ClientLogger(ResourceProvidersClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final ResourceProvidersService service; - - /** The service client containing this operation class. */ - private final WebSiteManagementClientImpl client; - - /** - * Initializes an instance of ResourceProvidersClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ResourceProvidersClientImpl(WebSiteManagementClientImpl client) { - this.service = - RestProxy.create(ResourceProvidersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for WebSiteManagementClientResourceProviders to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "WebSiteManagementCli") - private interface ResourceProvidersService { - @Headers({"Content-Type: application/json"}) - @Get("/providers/Microsoft.Web/publishingUsers/web") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getPublishingUser( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put("/providers/Microsoft.Web/publishingUsers/web") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> updatePublishingUser( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") UserInner userDetails, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/providers/Microsoft.Web/sourcecontrols") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listSourceControls( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/providers/Microsoft.Web/sourcecontrols/{sourceControlType}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getSourceControl( - @HostParam("$host") String endpoint, - @PathParam("sourceControlType") String sourceControlType, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put("/providers/Microsoft.Web/sourcecontrols/{sourceControlType}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> updateSourceControl( - @HostParam("$host") String endpoint, - @PathParam("sourceControlType") String sourceControlType, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") SourceControlInner requestMessage, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Web/billingMeters") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("billingLocation") String billingLocation, - @QueryParam("osType") String osType, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Web/checknameavailability") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> checkNameAvailability( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ResourceNameAvailabilityRequest request, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Web/deploymentLocations") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getSubscriptionDeploymentLocations( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Web/geoRegions") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listGeoRegions( - @HostParam("$host") String endpoint, - @QueryParam("sku") SkuName sku, - @QueryParam("linuxWorkersEnabled") Boolean linuxWorkersEnabled, - @QueryParam("xenonWorkersEnabled") Boolean xenonWorkersEnabled, - @QueryParam("linuxDynamicWorkersEnabled") Boolean linuxDynamicWorkersEnabled, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Web/listSitesAssignedToHostName") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listSiteIdentifiersAssignedToHostname( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") NameIdentifierInner nameIdentifier, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Web/premieraddonoffers") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listPremierAddOnOffers( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Web/skus") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listSkus( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Web/verifyHostingEnvironmentVnet") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> verifyHostingEnvironmentVnet( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") VnetParameters parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/moveResources") - @ExpectedResponses({204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> move( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") CsmMoveResourceEnvelope moveResourceEnvelope, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/validate") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> validate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ValidateRequest validateRequest, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web" - + "/validateContainerSettings") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> validateContainerSettings( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ValidateContainerSettingsRequest validateContainerSettingsRequest, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/validateMoveResources") - @ExpectedResponses({204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> validateMove( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") CsmMoveResourceEnvelope moveResourceEnvelope, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listSourceControlsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listBillingMetersNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listGeoRegionsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listSiteIdentifiersAssignedToHostnameNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listPremierAddOnOffersNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets publishing user. - * - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return publishing user. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getPublishingUserWithResponseAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service.getPublishingUser(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets publishing user. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return publishing user. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getPublishingUserWithResponseAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getPublishingUser(this.client.getEndpoint(), this.client.getApiVersion(), accept, context); - } - - /** - * Gets publishing user. - * - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return publishing user. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getPublishingUserAsync() { - return getPublishingUserWithResponseAsync() - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets publishing user. - * - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return publishing user. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public UserInner getPublishingUser() { - return getPublishingUserAsync().block(); - } - - /** - * Gets publishing user. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return publishing user. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getPublishingUserWithResponse(Context context) { - return getPublishingUserWithResponseAsync(context).block(); - } - - /** - * Updates publishing user. - * - * @param userDetails Details of publishing user. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user credentials used for publishing activity. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updatePublishingUserWithResponseAsync(UserInner userDetails) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (userDetails == null) { - return Mono.error(new IllegalArgumentException("Parameter userDetails is required and cannot be null.")); - } else { - userDetails.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updatePublishingUser( - this.client.getEndpoint(), this.client.getApiVersion(), userDetails, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates publishing user. - * - * @param userDetails Details of publishing user. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user credentials used for publishing activity. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updatePublishingUserWithResponseAsync(UserInner userDetails, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (userDetails == null) { - return Mono.error(new IllegalArgumentException("Parameter userDetails is required and cannot be null.")); - } else { - userDetails.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updatePublishingUser(this.client.getEndpoint(), this.client.getApiVersion(), userDetails, accept, context); - } - - /** - * Updates publishing user. - * - * @param userDetails Details of publishing user. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user credentials used for publishing activity. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updatePublishingUserAsync(UserInner userDetails) { - return updatePublishingUserWithResponseAsync(userDetails) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Updates publishing user. - * - * @param userDetails Details of publishing user. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user credentials used for publishing activity. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public UserInner updatePublishingUser(UserInner userDetails) { - return updatePublishingUserAsync(userDetails).block(); - } - - /** - * Updates publishing user. - * - * @param userDetails Details of publishing user. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user credentials used for publishing activity. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updatePublishingUserWithResponse(UserInner userDetails, Context context) { - return updatePublishingUserWithResponseAsync(userDetails, context).block(); - } - - /** - * Gets the source controls available for Azure websites. - * - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source controls available for Azure websites. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSourceControlsSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service.listSourceControls(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the source controls available for Azure websites. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source controls available for Azure websites. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSourceControlsSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listSourceControls(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets the source controls available for Azure websites. - * - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source controls available for Azure websites. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listSourceControlsAsync() { - return new PagedFlux<>( - () -> listSourceControlsSinglePageAsync(), nextLink -> listSourceControlsNextSinglePageAsync(nextLink)); - } - - /** - * Gets the source controls available for Azure websites. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source controls available for Azure websites. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listSourceControlsAsync(Context context) { - return new PagedFlux<>( - () -> listSourceControlsSinglePageAsync(context), - nextLink -> listSourceControlsNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets the source controls available for Azure websites. - * - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source controls available for Azure websites. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listSourceControls() { - return new PagedIterable<>(listSourceControlsAsync()); - } - - /** - * Gets the source controls available for Azure websites. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source controls available for Azure websites. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listSourceControls(Context context) { - return new PagedIterable<>(listSourceControlsAsync(context)); - } - - /** - * Gets source control token. - * - * @param sourceControlType Type of source control. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control token. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getSourceControlWithResponseAsync(String sourceControlType) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (sourceControlType == null) { - return Mono - .error(new IllegalArgumentException("Parameter sourceControlType is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getSourceControl( - this.client.getEndpoint(), sourceControlType, this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets source control token. - * - * @param sourceControlType Type of source control. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control token. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getSourceControlWithResponseAsync( - String sourceControlType, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (sourceControlType == null) { - return Mono - .error(new IllegalArgumentException("Parameter sourceControlType is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getSourceControl( - this.client.getEndpoint(), sourceControlType, this.client.getApiVersion(), accept, context); - } - - /** - * Gets source control token. - * - * @param sourceControlType Type of source control. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control token. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getSourceControlAsync(String sourceControlType) { - return getSourceControlWithResponseAsync(sourceControlType) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets source control token. - * - * @param sourceControlType Type of source control. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control token. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SourceControlInner getSourceControl(String sourceControlType) { - return getSourceControlAsync(sourceControlType).block(); - } - - /** - * Gets source control token. - * - * @param sourceControlType Type of source control. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control token. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getSourceControlWithResponse(String sourceControlType, Context context) { - return getSourceControlWithResponseAsync(sourceControlType, context).block(); - } - - /** - * Updates source control token. - * - * @param sourceControlType Type of source control. - * @param requestMessage Source control token information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source control OAuth token. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateSourceControlWithResponseAsync( - String sourceControlType, SourceControlInner requestMessage) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (sourceControlType == null) { - return Mono - .error(new IllegalArgumentException("Parameter sourceControlType is required and cannot be null.")); - } - if (requestMessage == null) { - return Mono.error(new IllegalArgumentException("Parameter requestMessage is required and cannot be null.")); - } else { - requestMessage.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updateSourceControl( - this.client.getEndpoint(), - sourceControlType, - this.client.getApiVersion(), - requestMessage, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates source control token. - * - * @param sourceControlType Type of source control. - * @param requestMessage Source control token information. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source control OAuth token. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateSourceControlWithResponseAsync( - String sourceControlType, SourceControlInner requestMessage, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (sourceControlType == null) { - return Mono - .error(new IllegalArgumentException("Parameter sourceControlType is required and cannot be null.")); - } - if (requestMessage == null) { - return Mono.error(new IllegalArgumentException("Parameter requestMessage is required and cannot be null.")); - } else { - requestMessage.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updateSourceControl( - this.client.getEndpoint(), - sourceControlType, - this.client.getApiVersion(), - requestMessage, - accept, - context); - } - - /** - * Updates source control token. - * - * @param sourceControlType Type of source control. - * @param requestMessage Source control token information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source control OAuth token. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateSourceControlAsync( - String sourceControlType, SourceControlInner requestMessage) { - return updateSourceControlWithResponseAsync(sourceControlType, requestMessage) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Updates source control token. - * - * @param sourceControlType Type of source control. - * @param requestMessage Source control token information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source control OAuth token. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SourceControlInner updateSourceControl(String sourceControlType, SourceControlInner requestMessage) { - return updateSourceControlAsync(sourceControlType, requestMessage).block(); - } - - /** - * Updates source control token. - * - * @param sourceControlType Type of source control. - * @param requestMessage Source control token information. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source control OAuth token. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateSourceControlWithResponse( - String sourceControlType, SourceControlInner requestMessage, Context context) { - return updateSourceControlWithResponseAsync(sourceControlType, requestMessage, context).block(); - } - - /** - * Gets a list of meters for a given location. - * - * @param billingLocation Azure Location of billable resource. - * @param osType App Service OS type meters used for. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of meters for a given location. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String billingLocation, String osType) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - billingLocation, - osType, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a list of meters for a given location. - * - * @param billingLocation Azure Location of billable resource. - * @param osType App Service OS type meters used for. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of meters for a given location. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String billingLocation, String osType, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - billingLocation, - osType, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets a list of meters for a given location. - * - * @param billingLocation Azure Location of billable resource. - * @param osType App Service OS type meters used for. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of meters for a given location. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String billingLocation, String osType) { - return new PagedFlux<>( - () -> listSinglePageAsync(billingLocation, osType), - nextLink -> listBillingMetersNextSinglePageAsync(nextLink)); - } - - /** - * Gets a list of meters for a given location. - * - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of meters for a given location. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - final String billingLocation = null; - final String osType = null; - return new PagedFlux<>( - () -> listSinglePageAsync(billingLocation, osType), - nextLink -> listBillingMetersNextSinglePageAsync(nextLink)); - } - - /** - * Gets a list of meters for a given location. - * - * @param billingLocation Azure Location of billable resource. - * @param osType App Service OS type meters used for. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of meters for a given location. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String billingLocation, String osType, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(billingLocation, osType, context), - nextLink -> listBillingMetersNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets a list of meters for a given location. - * - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of meters for a given location. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - final String billingLocation = null; - final String osType = null; - return new PagedIterable<>(listAsync(billingLocation, osType)); - } - - /** - * Gets a list of meters for a given location. - * - * @param billingLocation Azure Location of billable resource. - * @param osType App Service OS type meters used for. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of meters for a given location. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String billingLocation, String osType, Context context) { - return new PagedIterable<>(listAsync(billingLocation, osType, context)); - } - - /** - * Check if a resource name is available. - * - * @param request Name availability request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information regarding availability of a resource name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> checkNameAvailabilityWithResponseAsync( - ResourceNameAvailabilityRequest request) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (request == null) { - return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); - } else { - request.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .checkNameAvailability( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - this.client.getApiVersion(), - request, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Check if a resource name is available. - * - * @param request Name availability request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information regarding availability of a resource name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> checkNameAvailabilityWithResponseAsync( - ResourceNameAvailabilityRequest request, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (request == null) { - return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); - } else { - request.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .checkNameAvailability( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - this.client.getApiVersion(), - request, - accept, - context); - } - - /** - * Check if a resource name is available. - * - * @param request Name availability request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information regarding availability of a resource name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono checkNameAvailabilityAsync(ResourceNameAvailabilityRequest request) { - return checkNameAvailabilityWithResponseAsync(request) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Check if a resource name is available. - * - * @param request Name availability request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information regarding availability of a resource name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResourceNameAvailabilityInner checkNameAvailability(ResourceNameAvailabilityRequest request) { - return checkNameAvailabilityAsync(request).block(); - } - - /** - * Check if a resource name is available. - * - * @param request Name availability request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information regarding availability of a resource name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response checkNameAvailabilityWithResponse( - ResourceNameAvailabilityRequest request, Context context) { - return checkNameAvailabilityWithResponseAsync(request, context).block(); - } - - /** - * Gets list of available geo regions plus ministamps. - * - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of available geo regions plus ministamps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getSubscriptionDeploymentLocationsWithResponseAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getSubscriptionDeploymentLocations( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets list of available geo regions plus ministamps. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of available geo regions plus ministamps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getSubscriptionDeploymentLocationsWithResponseAsync( - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getSubscriptionDeploymentLocations( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets list of available geo regions plus ministamps. - * - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of available geo regions plus ministamps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getSubscriptionDeploymentLocationsAsync() { - return getSubscriptionDeploymentLocationsWithResponseAsync() - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets list of available geo regions plus ministamps. - * - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of available geo regions plus ministamps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentLocationsInner getSubscriptionDeploymentLocations() { - return getSubscriptionDeploymentLocationsAsync().block(); - } - - /** - * Gets list of available geo regions plus ministamps. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of available geo regions plus ministamps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getSubscriptionDeploymentLocationsWithResponse(Context context) { - return getSubscriptionDeploymentLocationsWithResponseAsync(context).block(); - } - - /** - * Get a list of available geographical regions. - * - * @param sku Name of SKU used to filter the regions. - * @param linuxWorkersEnabled Specify <code>true</code> if you want to filter to only regions that - * support Linux workers. - * @param xenonWorkersEnabled Specify <code>true</code> if you want to filter to only regions that - * support Xenon workers. - * @param linuxDynamicWorkersEnabled Specify <code>true</code> if you want to filter to only regions - * that support Linux Consumption Workers. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of available geographical regions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listGeoRegionsSinglePageAsync( - SkuName sku, Boolean linuxWorkersEnabled, Boolean xenonWorkersEnabled, Boolean linuxDynamicWorkersEnabled) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listGeoRegions( - this.client.getEndpoint(), - sku, - linuxWorkersEnabled, - xenonWorkersEnabled, - linuxDynamicWorkersEnabled, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a list of available geographical regions. - * - * @param sku Name of SKU used to filter the regions. - * @param linuxWorkersEnabled Specify <code>true</code> if you want to filter to only regions that - * support Linux workers. - * @param xenonWorkersEnabled Specify <code>true</code> if you want to filter to only regions that - * support Xenon workers. - * @param linuxDynamicWorkersEnabled Specify <code>true</code> if you want to filter to only regions - * that support Linux Consumption Workers. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of available geographical regions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listGeoRegionsSinglePageAsync( - SkuName sku, - Boolean linuxWorkersEnabled, - Boolean xenonWorkersEnabled, - Boolean linuxDynamicWorkersEnabled, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listGeoRegions( - this.client.getEndpoint(), - sku, - linuxWorkersEnabled, - xenonWorkersEnabled, - linuxDynamicWorkersEnabled, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get a list of available geographical regions. - * - * @param sku Name of SKU used to filter the regions. - * @param linuxWorkersEnabled Specify <code>true</code> if you want to filter to only regions that - * support Linux workers. - * @param xenonWorkersEnabled Specify <code>true</code> if you want to filter to only regions that - * support Xenon workers. - * @param linuxDynamicWorkersEnabled Specify <code>true</code> if you want to filter to only regions - * that support Linux Consumption Workers. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of available geographical regions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listGeoRegionsAsync( - SkuName sku, Boolean linuxWorkersEnabled, Boolean xenonWorkersEnabled, Boolean linuxDynamicWorkersEnabled) { - return new PagedFlux<>( - () -> - listGeoRegionsSinglePageAsync( - sku, linuxWorkersEnabled, xenonWorkersEnabled, linuxDynamicWorkersEnabled), - nextLink -> listGeoRegionsNextSinglePageAsync(nextLink)); - } - - /** - * Get a list of available geographical regions. - * - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of available geographical regions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listGeoRegionsAsync() { - final SkuName sku = null; - final Boolean linuxWorkersEnabled = null; - final Boolean xenonWorkersEnabled = null; - final Boolean linuxDynamicWorkersEnabled = null; - return new PagedFlux<>( - () -> - listGeoRegionsSinglePageAsync( - sku, linuxWorkersEnabled, xenonWorkersEnabled, linuxDynamicWorkersEnabled), - nextLink -> listGeoRegionsNextSinglePageAsync(nextLink)); - } - - /** - * Get a list of available geographical regions. - * - * @param sku Name of SKU used to filter the regions. - * @param linuxWorkersEnabled Specify <code>true</code> if you want to filter to only regions that - * support Linux workers. - * @param xenonWorkersEnabled Specify <code>true</code> if you want to filter to only regions that - * support Xenon workers. - * @param linuxDynamicWorkersEnabled Specify <code>true</code> if you want to filter to only regions - * that support Linux Consumption Workers. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of available geographical regions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listGeoRegionsAsync( - SkuName sku, - Boolean linuxWorkersEnabled, - Boolean xenonWorkersEnabled, - Boolean linuxDynamicWorkersEnabled, - Context context) { - return new PagedFlux<>( - () -> - listGeoRegionsSinglePageAsync( - sku, linuxWorkersEnabled, xenonWorkersEnabled, linuxDynamicWorkersEnabled, context), - nextLink -> listGeoRegionsNextSinglePageAsync(nextLink, context)); - } - - /** - * Get a list of available geographical regions. - * - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of available geographical regions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listGeoRegions() { - final SkuName sku = null; - final Boolean linuxWorkersEnabled = null; - final Boolean xenonWorkersEnabled = null; - final Boolean linuxDynamicWorkersEnabled = null; - return new PagedIterable<>( - listGeoRegionsAsync(sku, linuxWorkersEnabled, xenonWorkersEnabled, linuxDynamicWorkersEnabled)); - } - - /** - * Get a list of available geographical regions. - * - * @param sku Name of SKU used to filter the regions. - * @param linuxWorkersEnabled Specify <code>true</code> if you want to filter to only regions that - * support Linux workers. - * @param xenonWorkersEnabled Specify <code>true</code> if you want to filter to only regions that - * support Xenon workers. - * @param linuxDynamicWorkersEnabled Specify <code>true</code> if you want to filter to only regions - * that support Linux Consumption Workers. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of available geographical regions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listGeoRegions( - SkuName sku, - Boolean linuxWorkersEnabled, - Boolean xenonWorkersEnabled, - Boolean linuxDynamicWorkersEnabled, - Context context) { - return new PagedIterable<>( - listGeoRegionsAsync(sku, linuxWorkersEnabled, xenonWorkersEnabled, linuxDynamicWorkersEnabled, context)); - } - - /** - * List all apps that are assigned to a hostname. - * - * @param nameIdentifier Hostname information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of identifiers. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSiteIdentifiersAssignedToHostnameSinglePageAsync( - NameIdentifierInner nameIdentifier) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (nameIdentifier == null) { - return Mono.error(new IllegalArgumentException("Parameter nameIdentifier is required and cannot be null.")); - } else { - nameIdentifier.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listSiteIdentifiersAssignedToHostname( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - this.client.getApiVersion(), - nameIdentifier, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List all apps that are assigned to a hostname. - * - * @param nameIdentifier Hostname information. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of identifiers. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSiteIdentifiersAssignedToHostnameSinglePageAsync( - NameIdentifierInner nameIdentifier, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (nameIdentifier == null) { - return Mono.error(new IllegalArgumentException("Parameter nameIdentifier is required and cannot be null.")); - } else { - nameIdentifier.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listSiteIdentifiersAssignedToHostname( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - this.client.getApiVersion(), - nameIdentifier, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * List all apps that are assigned to a hostname. - * - * @param nameIdentifier Hostname information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of identifiers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listSiteIdentifiersAssignedToHostnameAsync(NameIdentifierInner nameIdentifier) { - return new PagedFlux<>( - () -> listSiteIdentifiersAssignedToHostnameSinglePageAsync(nameIdentifier), - nextLink -> listSiteIdentifiersAssignedToHostnameNextSinglePageAsync(nextLink)); - } - - /** - * List all apps that are assigned to a hostname. - * - * @param nameIdentifier Hostname information. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of identifiers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listSiteIdentifiersAssignedToHostnameAsync( - NameIdentifierInner nameIdentifier, Context context) { - return new PagedFlux<>( - () -> listSiteIdentifiersAssignedToHostnameSinglePageAsync(nameIdentifier, context), - nextLink -> listSiteIdentifiersAssignedToHostnameNextSinglePageAsync(nextLink, context)); - } - - /** - * List all apps that are assigned to a hostname. - * - * @param nameIdentifier Hostname information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of identifiers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listSiteIdentifiersAssignedToHostname(NameIdentifierInner nameIdentifier) { - return new PagedIterable<>(listSiteIdentifiersAssignedToHostnameAsync(nameIdentifier)); - } - - /** - * List all apps that are assigned to a hostname. - * - * @param nameIdentifier Hostname information. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of identifiers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listSiteIdentifiersAssignedToHostname( - NameIdentifierInner nameIdentifier, Context context) { - return new PagedIterable<>(listSiteIdentifiersAssignedToHostnameAsync(nameIdentifier, context)); - } - - /** - * List all premier add-on offers. - * - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of premier add-on offers. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listPremierAddOnOffersSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listPremierAddOnOffers( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List all premier add-on offers. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of premier add-on offers. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listPremierAddOnOffersSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listPremierAddOnOffers( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * List all premier add-on offers. - * - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of premier add-on offers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listPremierAddOnOffersAsync() { - return new PagedFlux<>( - () -> listPremierAddOnOffersSinglePageAsync(), - nextLink -> listPremierAddOnOffersNextSinglePageAsync(nextLink)); - } - - /** - * List all premier add-on offers. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of premier add-on offers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listPremierAddOnOffersAsync(Context context) { - return new PagedFlux<>( - () -> listPremierAddOnOffersSinglePageAsync(context), - nextLink -> listPremierAddOnOffersNextSinglePageAsync(nextLink, context)); - } - - /** - * List all premier add-on offers. - * - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of premier add-on offers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listPremierAddOnOffers() { - return new PagedIterable<>(listPremierAddOnOffersAsync()); - } - - /** - * List all premier add-on offers. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of premier add-on offers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listPremierAddOnOffers(Context context) { - return new PagedIterable<>(listPremierAddOnOffersAsync(context)); - } - - /** - * List all SKUs. - * - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of SKU information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listSkusWithResponseAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listSkus( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List all SKUs. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of SKU information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSkusWithResponseAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listSkus( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * List all SKUs. - * - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of SKU information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listSkusAsync() { - return listSkusWithResponseAsync() - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * List all SKUs. - * - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of SKU information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SkuInfosInner listSkus() { - return listSkusAsync().block(); - } - - /** - * List all SKUs. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of SKU information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listSkusWithResponse(Context context) { - return listSkusWithResponseAsync(context).block(); - } - - /** - * Verifies if this VNET is compatible with an App Service Environment by analyzing the Network Security Group - * rules. - * - * @param parameters VNET information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a class that describes the reason for a validation failure. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> verifyHostingEnvironmentVnetWithResponseAsync( - VnetParameters parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .verifyHostingEnvironmentVnet( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - this.client.getApiVersion(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Verifies if this VNET is compatible with an App Service Environment by analyzing the Network Security Group - * rules. - * - * @param parameters VNET information. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a class that describes the reason for a validation failure. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> verifyHostingEnvironmentVnetWithResponseAsync( - VnetParameters parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .verifyHostingEnvironmentVnet( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - this.client.getApiVersion(), - parameters, - accept, - context); - } - - /** - * Verifies if this VNET is compatible with an App Service Environment by analyzing the Network Security Group - * rules. - * - * @param parameters VNET information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a class that describes the reason for a validation failure. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono verifyHostingEnvironmentVnetAsync(VnetParameters parameters) { - return verifyHostingEnvironmentVnetWithResponseAsync(parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Verifies if this VNET is compatible with an App Service Environment by analyzing the Network Security Group - * rules. - * - * @param parameters VNET information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a class that describes the reason for a validation failure. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VnetValidationFailureDetailsInner verifyHostingEnvironmentVnet(VnetParameters parameters) { - return verifyHostingEnvironmentVnetAsync(parameters).block(); - } - - /** - * Verifies if this VNET is compatible with an App Service Environment by analyzing the Network Security Group - * rules. - * - * @param parameters VNET information. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a class that describes the reason for a validation failure. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response verifyHostingEnvironmentVnetWithResponse( - VnetParameters parameters, Context context) { - return verifyHostingEnvironmentVnetWithResponseAsync(parameters, context).block(); - } - - /** - * Move resources between resource groups. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param moveResourceEnvelope Object that represents the resource to move. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> moveWithResponseAsync( - String resourceGroupName, CsmMoveResourceEnvelope moveResourceEnvelope) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (moveResourceEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter moveResourceEnvelope is required and cannot be null.")); - } else { - moveResourceEnvelope.validate(); - } - return FluxUtil - .withContext( - context -> - service - .move( - this.client.getEndpoint(), - resourceGroupName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - moveResourceEnvelope, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Move resources between resource groups. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param moveResourceEnvelope Object that represents the resource to move. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> moveWithResponseAsync( - String resourceGroupName, CsmMoveResourceEnvelope moveResourceEnvelope, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (moveResourceEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter moveResourceEnvelope is required and cannot be null.")); - } else { - moveResourceEnvelope.validate(); - } - context = this.client.mergeContext(context); - return service - .move( - this.client.getEndpoint(), - resourceGroupName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - moveResourceEnvelope, - context); - } - - /** - * Move resources between resource groups. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param moveResourceEnvelope Object that represents the resource to move. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono moveAsync(String resourceGroupName, CsmMoveResourceEnvelope moveResourceEnvelope) { - return moveWithResponseAsync(resourceGroupName, moveResourceEnvelope) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Move resources between resource groups. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param moveResourceEnvelope Object that represents the resource to move. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void move(String resourceGroupName, CsmMoveResourceEnvelope moveResourceEnvelope) { - moveAsync(resourceGroupName, moveResourceEnvelope).block(); - } - - /** - * Move resources between resource groups. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param moveResourceEnvelope Object that represents the resource to move. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response moveWithResponse( - String resourceGroupName, CsmMoveResourceEnvelope moveResourceEnvelope, Context context) { - return moveWithResponseAsync(resourceGroupName, moveResourceEnvelope, context).block(); - } - - /** - * Validate if a resource can be created. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param validateRequest Request with the resources to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the result of resource validation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> validateWithResponseAsync( - String resourceGroupName, ValidateRequest validateRequest) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (validateRequest == null) { - return Mono - .error(new IllegalArgumentException("Parameter validateRequest is required and cannot be null.")); - } else { - validateRequest.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .validate( - this.client.getEndpoint(), - resourceGroupName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - validateRequest, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Validate if a resource can be created. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param validateRequest Request with the resources to validate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the result of resource validation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> validateWithResponseAsync( - String resourceGroupName, ValidateRequest validateRequest, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (validateRequest == null) { - return Mono - .error(new IllegalArgumentException("Parameter validateRequest is required and cannot be null.")); - } else { - validateRequest.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .validate( - this.client.getEndpoint(), - resourceGroupName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - validateRequest, - accept, - context); - } - - /** - * Validate if a resource can be created. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param validateRequest Request with the resources to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the result of resource validation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono validateAsync(String resourceGroupName, ValidateRequest validateRequest) { - return validateWithResponseAsync(resourceGroupName, validateRequest) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Validate if a resource can be created. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param validateRequest Request with the resources to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the result of resource validation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ValidateResponseInner validate(String resourceGroupName, ValidateRequest validateRequest) { - return validateAsync(resourceGroupName, validateRequest).block(); - } - - /** - * Validate if a resource can be created. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param validateRequest Request with the resources to validate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the result of resource validation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response validateWithResponse( - String resourceGroupName, ValidateRequest validateRequest, Context context) { - return validateWithResponseAsync(resourceGroupName, validateRequest, context).block(); - } - - /** - * Validate if the container settings are correct. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param validateContainerSettingsRequest Container settings validation request context. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return any object. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> validateContainerSettingsWithResponseAsync( - String resourceGroupName, ValidateContainerSettingsRequest validateContainerSettingsRequest) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (validateContainerSettingsRequest == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter validateContainerSettingsRequest is required and cannot be null.")); - } else { - validateContainerSettingsRequest.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .validateContainerSettings( - this.client.getEndpoint(), - resourceGroupName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - validateContainerSettingsRequest, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Validate if the container settings are correct. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param validateContainerSettingsRequest Container settings validation request context. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return any object. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> validateContainerSettingsWithResponseAsync( - String resourceGroupName, ValidateContainerSettingsRequest validateContainerSettingsRequest, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (validateContainerSettingsRequest == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter validateContainerSettingsRequest is required and cannot be null.")); - } else { - validateContainerSettingsRequest.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .validateContainerSettings( - this.client.getEndpoint(), - resourceGroupName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - validateContainerSettingsRequest, - accept, - context); - } - - /** - * Validate if the container settings are correct. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param validateContainerSettingsRequest Container settings validation request context. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return any object. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono validateContainerSettingsAsync( - String resourceGroupName, ValidateContainerSettingsRequest validateContainerSettingsRequest) { - return validateContainerSettingsWithResponseAsync(resourceGroupName, validateContainerSettingsRequest) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Validate if the container settings are correct. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param validateContainerSettingsRequest Container settings validation request context. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return any object. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Object validateContainerSettings( - String resourceGroupName, ValidateContainerSettingsRequest validateContainerSettingsRequest) { - return validateContainerSettingsAsync(resourceGroupName, validateContainerSettingsRequest).block(); - } - - /** - * Validate if the container settings are correct. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param validateContainerSettingsRequest Container settings validation request context. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return any object. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response validateContainerSettingsWithResponse( - String resourceGroupName, ValidateContainerSettingsRequest validateContainerSettingsRequest, Context context) { - return validateContainerSettingsWithResponseAsync(resourceGroupName, validateContainerSettingsRequest, context) - .block(); - } - - /** - * Validate whether a resource can be moved. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param moveResourceEnvelope Object that represents the resource to move. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> validateMoveWithResponseAsync( - String resourceGroupName, CsmMoveResourceEnvelope moveResourceEnvelope) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (moveResourceEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter moveResourceEnvelope is required and cannot be null.")); - } else { - moveResourceEnvelope.validate(); - } - return FluxUtil - .withContext( - context -> - service - .validateMove( - this.client.getEndpoint(), - resourceGroupName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - moveResourceEnvelope, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Validate whether a resource can be moved. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param moveResourceEnvelope Object that represents the resource to move. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> validateMoveWithResponseAsync( - String resourceGroupName, CsmMoveResourceEnvelope moveResourceEnvelope, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (moveResourceEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter moveResourceEnvelope is required and cannot be null.")); - } else { - moveResourceEnvelope.validate(); - } - context = this.client.mergeContext(context); - return service - .validateMove( - this.client.getEndpoint(), - resourceGroupName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - moveResourceEnvelope, - context); - } - - /** - * Validate whether a resource can be moved. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param moveResourceEnvelope Object that represents the resource to move. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono validateMoveAsync(String resourceGroupName, CsmMoveResourceEnvelope moveResourceEnvelope) { - return validateMoveWithResponseAsync(resourceGroupName, moveResourceEnvelope) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Validate whether a resource can be moved. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param moveResourceEnvelope Object that represents the resource to move. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void validateMove(String resourceGroupName, CsmMoveResourceEnvelope moveResourceEnvelope) { - validateMoveAsync(resourceGroupName, moveResourceEnvelope).block(); - } - - /** - * Validate whether a resource can be moved. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param moveResourceEnvelope Object that represents the resource to move. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response validateMoveWithResponse( - String resourceGroupName, CsmMoveResourceEnvelope moveResourceEnvelope, Context context) { - return validateMoveWithResponseAsync(resourceGroupName, moveResourceEnvelope, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of source controls. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSourceControlsNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listSourceControlsNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of source controls. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSourceControlsNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listSourceControlsNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Billing Meters. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBillingMetersNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listBillingMetersNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Billing Meters. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBillingMetersNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listBillingMetersNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of geographical regions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listGeoRegionsNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listGeoRegionsNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of geographical regions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listGeoRegionsNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listGeoRegionsNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of identifiers. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSiteIdentifiersAssignedToHostnameNextSinglePageAsync( - String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listSiteIdentifiersAssignedToHostnameNext( - nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of identifiers. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSiteIdentifiersAssignedToHostnameNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listSiteIdentifiersAssignedToHostnameNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of premier add-on offers. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listPremierAddOnOffersNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listPremierAddOnOffersNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of premier add-on offers. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listPremierAddOnOffersNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listPremierAddOnOffersNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/TopLevelDomainsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/TopLevelDomainsClientImpl.java deleted file mode 100644 index e7bb6e1e5f02..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/TopLevelDomainsClientImpl.java +++ /dev/null @@ -1,725 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.TopLevelDomainsClient; -import com.azure.resourcemanager.appservice.fluent.models.TldLegalAgreementInner; -import com.azure.resourcemanager.appservice.fluent.models.TopLevelDomainInner; -import com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException; -import com.azure.resourcemanager.appservice.models.TldLegalAgreementCollection; -import com.azure.resourcemanager.appservice.models.TopLevelDomainAgreementOption; -import com.azure.resourcemanager.appservice.models.TopLevelDomainCollection; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in TopLevelDomainsClient. */ -public final class TopLevelDomainsClientImpl implements TopLevelDomainsClient { - private final ClientLogger logger = new ClientLogger(TopLevelDomainsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final TopLevelDomainsService service; - - /** The service client containing this operation class. */ - private final WebSiteManagementClientImpl client; - - /** - * Initializes an instance of TopLevelDomainsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - TopLevelDomainsClientImpl(WebSiteManagementClientImpl client) { - this.service = - RestProxy.create(TopLevelDomainsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for WebSiteManagementClientTopLevelDomains to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "WebSiteManagementCli") - private interface TopLevelDomainsService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/topLevelDomains") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/topLevelDomains/{name}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/topLevelDomains/{name}" - + "/listAgreements") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listAgreements( - @HostParam("$host") String endpoint, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") TopLevelDomainAgreementOption agreementOption, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listAgreementsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Get all top-level domains supported for registration. - * - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all top-level domains supported for registration. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get all top-level domains supported for registration. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all top-level domains supported for registration. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get all top-level domains supported for registration. - * - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all top-level domains supported for registration. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Get all top-level domains supported for registration. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all top-level domains supported for registration. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Get all top-level domains supported for registration. - * - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all top-level domains supported for registration. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Get all top-level domains supported for registration. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all top-level domains supported for registration. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Get details of a top-level domain. - * - * @param name Name of the top-level domain. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return details of a top-level domain. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync(String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get details of a top-level domain. - * - * @param name Name of the top-level domain. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return details of a top-level domain. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Get details of a top-level domain. - * - * @param name Name of the top-level domain. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return details of a top-level domain. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync(String name) { - return getWithResponseAsync(name) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get details of a top-level domain. - * - * @param name Name of the top-level domain. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return details of a top-level domain. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public TopLevelDomainInner get(String name) { - return getAsync(name).block(); - } - - /** - * Get details of a top-level domain. - * - * @param name Name of the top-level domain. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return details of a top-level domain. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String name, Context context) { - return getWithResponseAsync(name, context).block(); - } - - /** - * Gets all legal agreements that user needs to accept before purchasing a domain. - * - * @param name Name of the top-level domain. - * @param agreementOption Domain agreement options. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all legal agreements that user needs to accept before purchasing a domain. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAgreementsSinglePageAsync( - String name, TopLevelDomainAgreementOption agreementOption) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (agreementOption == null) { - return Mono - .error(new IllegalArgumentException("Parameter agreementOption is required and cannot be null.")); - } else { - agreementOption.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listAgreements( - this.client.getEndpoint(), - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - agreementOption, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all legal agreements that user needs to accept before purchasing a domain. - * - * @param name Name of the top-level domain. - * @param agreementOption Domain agreement options. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all legal agreements that user needs to accept before purchasing a domain. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAgreementsSinglePageAsync( - String name, TopLevelDomainAgreementOption agreementOption, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (agreementOption == null) { - return Mono - .error(new IllegalArgumentException("Parameter agreementOption is required and cannot be null.")); - } else { - agreementOption.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listAgreements( - this.client.getEndpoint(), - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - agreementOption, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all legal agreements that user needs to accept before purchasing a domain. - * - * @param name Name of the top-level domain. - * @param agreementOption Domain agreement options. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all legal agreements that user needs to accept before purchasing a domain. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAgreementsAsync( - String name, TopLevelDomainAgreementOption agreementOption) { - return new PagedFlux<>( - () -> listAgreementsSinglePageAsync(name, agreementOption), - nextLink -> listAgreementsNextSinglePageAsync(nextLink)); - } - - /** - * Gets all legal agreements that user needs to accept before purchasing a domain. - * - * @param name Name of the top-level domain. - * @param agreementOption Domain agreement options. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all legal agreements that user needs to accept before purchasing a domain. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAgreementsAsync( - String name, TopLevelDomainAgreementOption agreementOption, Context context) { - return new PagedFlux<>( - () -> listAgreementsSinglePageAsync(name, agreementOption, context), - nextLink -> listAgreementsNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all legal agreements that user needs to accept before purchasing a domain. - * - * @param name Name of the top-level domain. - * @param agreementOption Domain agreement options. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all legal agreements that user needs to accept before purchasing a domain. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAgreements( - String name, TopLevelDomainAgreementOption agreementOption) { - return new PagedIterable<>(listAgreementsAsync(name, agreementOption)); - } - - /** - * Gets all legal agreements that user needs to accept before purchasing a domain. - * - * @param name Name of the top-level domain. - * @param agreementOption Domain agreement options. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all legal agreements that user needs to accept before purchasing a domain. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAgreements( - String name, TopLevelDomainAgreementOption agreementOption, Context context) { - return new PagedIterable<>(listAgreementsAsync(name, agreementOption, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Top-level domains. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Top-level domains. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of top-level domain legal agreements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAgreementsNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listAgreementsNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of top-level domain legal agreements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAgreementsNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listAgreementsNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/Utils.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/Utils.java deleted file mode 100644 index 66f2fcd5d340..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/Utils.java +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.implementation; - -import com.azure.core.exception.HttpResponseException; -import com.azure.core.http.HttpMethod; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import reactor.core.publisher.Mono; - -import java.net.MalformedURLException; -import java.net.URL; -import java.util.regex.Pattern; - -/** Utilities for AppService implementation. */ -class Utils { - - /** - * Encodes byte array to Base16 string. - * - * @param bytes byte array to be encoded. - * @return Base16 string - */ - static String base16Encode(byte[] bytes) { - StringBuilder stringBuilder = new StringBuilder(bytes.length * 2); - for (byte b : bytes) { - stringBuilder.append(String.format("%02X", b)); - } - return stringBuilder.toString(); - } - - /** - * Completes docker image and tag with registry server. - * - * @param imageAndTag docker image and tag - * @param serverUrl private registry server URL - * @return docker image and tag completed with registry server - */ - static String smartCompletionPrivateRegistryImage(String imageAndTag, String serverUrl) { - try { - URL url = new URL(serverUrl); - String registryServer = url.getAuthority(); - String path = url.getPath(); - if (!registryServer.isEmpty() && !imageAndTag.trim().startsWith(registryServer)) { - String[] segments = imageAndTag.split(Pattern.quote("/")); - if (segments.length == 1) { - // it appears that imageAndTag does not contain registry server, add registry server before it. - imageAndTag = completePrivateRegistryImage(imageAndTag, registryServer, path); - } - if (segments.length > 1) { - String segment = segments[0]; - if (!segment.isEmpty() - && !segment.contains(".") - && !segment.contains(":") - && !segment.equals(registryServer)) { - // it appears that first segment of imageAndTag is not registry server, add registry server - // before it. - imageAndTag = completePrivateRegistryImage(imageAndTag, registryServer, path); - } - } - } - } catch (MalformedURLException e) { - // serverUrl is probably incorrect, abort - } - return imageAndTag; - } - - private static String completePrivateRegistryImage(String imageAndTag, String registryServer, String path) { - path = removeLeadingChar(removeTrailingChar(path, '/'), '/'); - if (path.isEmpty()) { - imageAndTag = String.format("%s/%s", registryServer, imageAndTag.trim()); - } else { - imageAndTag = String.format("%s/%s/%s", registryServer, path, imageAndTag.trim()); - } - return imageAndTag; - } - - private static String removeLeadingChar(String s, char c) { - int index; - for (index = 0; index < s.length(); index++) { - if (s.charAt(index) != c) { - break; - } - } - return s.substring(index); - } - - private static String removeTrailingChar(String s, char c) { - int index; - for (index = s.length() - 1; index >= 0; index--) { - if (s.charAt(index) != c) { - break; - } - } - return s.substring(0, index + 1); - } - - /** - * Download a file asynchronously. - * - * @param url the URL pointing to the file - * @param httpPipeline the http pipeline - * @return an Observable pointing to the content of the file - */ - static Mono downloadFileAsync(String url, HttpPipeline httpPipeline) { - HttpRequest request = new HttpRequest(HttpMethod.GET, url); - return httpPipeline.send(request) - .flatMap(response1 -> { - int code = response1.getStatusCode(); - if (code == 200) { - return Mono.just(response1); - } else { - return Mono.error(new HttpResponseException(response1)); - } - }).flatMap(HttpResponse::getBodyAsByteArray); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/WebAppAuthenticationImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/WebAppAuthenticationImpl.java deleted file mode 100644 index ac0771a82cad..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/WebAppAuthenticationImpl.java +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.appservice.implementation; - -import com.azure.resourcemanager.appservice.models.BuiltInAuthenticationProvider; -import com.azure.resourcemanager.appservice.models.UnauthenticatedClientAction; -import com.azure.resourcemanager.appservice.models.WebAppAuthentication; -import com.azure.resourcemanager.appservice.models.WebAppBase; -import com.azure.resourcemanager.appservice.fluent.models.SiteAuthSettingsInner; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.IndexableWrapperImpl; -import java.util.ArrayList; - -/** - * Implementation for WebAppAuthentication and its create and update interfaces. - * - * @param the fluent interface of the parent web app - * @param the fluent implementation of the parent web app - */ -class WebAppAuthenticationImpl> - extends IndexableWrapperImpl - implements WebAppAuthentication, - WebAppAuthentication.Definition>, - WebAppAuthentication.UpdateDefinition> { - - private final WebAppBaseImpl parent; - - WebAppAuthenticationImpl(SiteAuthSettingsInner inner, WebAppBaseImpl parent) { - super(inner); - this.parent = parent; - inner.withTokenStoreEnabled(true); - } - - @Override - public FluentImplT attach() { - parent.withAuthentication(this); - return parent(); - } - - @Override - @SuppressWarnings("unchecked") - public FluentImplT parent() { - parent.withAuthentication(this); - return (FluentImplT) this.parent; - } - - @Override - public WebAppAuthenticationImpl withAnonymousAuthentication() { - innerModel().withUnauthenticatedClientAction(UnauthenticatedClientAction.ALLOW_ANONYMOUS); - return this; - } - - @Override - public WebAppAuthenticationImpl withDefaultAuthenticationProvider( - BuiltInAuthenticationProvider provider) { - innerModel() - .withUnauthenticatedClientAction(UnauthenticatedClientAction.REDIRECT_TO_LOGIN_PAGE) - .withDefaultProvider(provider); - return this; - } - - @Override - public WebAppAuthenticationImpl withActiveDirectory(String clientId, String issuerUrl) { - innerModel().withClientId(clientId).withIssuer(issuerUrl); - return this; - } - - @Override - public WebAppAuthenticationImpl withFacebook(String appId, String appSecret) { - innerModel().withFacebookAppId(appId).withFacebookAppSecret(appSecret); - return this; - } - - @Override - public WebAppAuthenticationImpl withGoogle(String clientId, String clientSecret) { - innerModel().withGoogleClientId(clientId).withGoogleClientSecret(clientSecret); - return this; - } - - @Override - public WebAppAuthenticationImpl withTwitter(String apiKey, String apiSecret) { - innerModel().withTwitterConsumerKey(apiKey).withTwitterConsumerSecret(apiSecret); - return this; - } - - @Override - public WebAppAuthenticationImpl withMicrosoft(String clientId, String clientSecret) { - innerModel().withMicrosoftAccountClientId(clientId).withMicrosoftAccountClientSecret(clientSecret); - return this; - } - - @Override - public WebAppAuthenticationImpl withTokenStore(boolean enabled) { - innerModel().withTokenStoreEnabled(enabled); - return this; - } - - @Override - public WebAppAuthenticationImpl withAllowedExternalRedirectUrl(String url) { - if (innerModel().allowedExternalRedirectUrls() == null) { - innerModel().withAllowedExternalRedirectUrls(new ArrayList()); - } - innerModel().allowedExternalRedirectUrls().add(url); - return this; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/WebAppBaseImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/WebAppBaseImpl.java deleted file mode 100644 index 065008fd8793..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/WebAppBaseImpl.java +++ /dev/null @@ -1,1831 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.implementation; - -import com.azure.core.exception.HttpResponseException; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.AppServiceManager; -import com.azure.resourcemanager.appservice.fluent.models.ConnectionStringDictionaryInner; -import com.azure.resourcemanager.appservice.fluent.models.HostnameBindingInner; -import com.azure.resourcemanager.appservice.fluent.models.MSDeployStatusInner; -import com.azure.resourcemanager.appservice.fluent.models.SiteAuthSettingsInner; -import com.azure.resourcemanager.appservice.fluent.models.SiteConfigInner; -import com.azure.resourcemanager.appservice.fluent.models.SiteConfigResourceInner; -import com.azure.resourcemanager.appservice.fluent.models.SiteInner; -import com.azure.resourcemanager.appservice.fluent.models.SiteLogsConfigInner; -import com.azure.resourcemanager.appservice.fluent.models.SitePatchResourceInner; -import com.azure.resourcemanager.appservice.fluent.models.SiteSourceControlInner; -import com.azure.resourcemanager.appservice.fluent.models.SlotConfigNamesResourceInner; -import com.azure.resourcemanager.appservice.fluent.models.StringDictionaryInner; -import com.azure.resourcemanager.appservice.models.AppServiceCertificate; -import com.azure.resourcemanager.appservice.models.AppServiceDomain; -import com.azure.resourcemanager.appservice.models.AppSetting; -import com.azure.resourcemanager.appservice.models.AzureResourceType; -import com.azure.resourcemanager.appservice.models.CloningInfo; -import com.azure.resourcemanager.appservice.models.ConnStringValueTypePair; -import com.azure.resourcemanager.appservice.models.ConnectionString; -import com.azure.resourcemanager.appservice.models.ConnectionStringType; -import com.azure.resourcemanager.appservice.models.CustomHostnameDnsRecordType; -import com.azure.resourcemanager.appservice.models.FtpsState; -import com.azure.resourcemanager.appservice.models.HostingEnvironmentProfile; -import com.azure.resourcemanager.appservice.models.HostnameBinding; -import com.azure.resourcemanager.appservice.models.HostnameSslState; -import com.azure.resourcemanager.appservice.models.HostnameType; -import com.azure.resourcemanager.appservice.models.IpFilterTag; -import com.azure.resourcemanager.appservice.models.IpSecurityRestriction; -import com.azure.resourcemanager.appservice.models.JavaVersion; -import com.azure.resourcemanager.appservice.models.MSDeploy; -import com.azure.resourcemanager.appservice.models.ManagedPipelineMode; -import com.azure.resourcemanager.appservice.models.ManagedServiceIdentity; -import com.azure.resourcemanager.appservice.models.NetFrameworkVersion; -import com.azure.resourcemanager.appservice.models.OperatingSystem; -import com.azure.resourcemanager.appservice.models.PhpVersion; -import com.azure.resourcemanager.appservice.models.PlatformArchitecture; -import com.azure.resourcemanager.appservice.models.PythonVersion; -import com.azure.resourcemanager.appservice.models.RedundancyMode; -import com.azure.resourcemanager.appservice.models.RemoteVisualStudioVersion; -import com.azure.resourcemanager.appservice.models.ScmType; -import com.azure.resourcemanager.appservice.models.SiteAvailabilityState; -import com.azure.resourcemanager.appservice.models.SlotSwapStatus; -import com.azure.resourcemanager.appservice.models.SslState; -import com.azure.resourcemanager.appservice.models.SupportedTlsVersions; -import com.azure.resourcemanager.appservice.models.UsageState; -import com.azure.resourcemanager.appservice.models.VirtualApplication; -import com.azure.resourcemanager.appservice.models.WebAppAuthentication; -import com.azure.resourcemanager.appservice.models.WebAppBase; -import com.azure.resourcemanager.appservice.models.WebContainer; -import com.azure.resourcemanager.appservice.models.WebSiteBase; -import com.azure.resourcemanager.authorization.models.BuiltInRole; -import com.azure.resourcemanager.authorization.utils.RoleAssignmentHelper; -import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.GroupableResourceImpl; -import com.azure.resourcemanager.resources.fluentcore.dag.FunctionalTaskItem; -import com.azure.resourcemanager.resources.fluentcore.dag.IndexableTaskItem; -import com.azure.resourcemanager.resources.fluentcore.model.Indexable; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import reactor.core.Disposable; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; -import reactor.core.scheduler.Schedulers; - -import java.io.IOException; -import java.io.InputStream; -import java.io.PipedInputStream; -import java.io.PipedOutputStream; -import java.nio.charset.StandardCharsets; -import java.time.Duration; -import java.time.OffsetDateTime; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import java.util.TreeMap; -import java.util.stream.Collectors; - -/** - * The implementation for WebAppBase. - * - * @param the fluent interface of the web app or deployment slot or function app - * @param the fluent implementation of the web app or deployment slot or function app - */ -abstract class WebAppBaseImpl> - extends GroupableResourceImpl - implements WebAppBase, - WebAppBase.Definition, - WebAppBase.Update, - WebAppBase.UpdateStages.WithWebContainer { - - private final ClientLogger logger = new ClientLogger(getClass()); - - protected static final String SETTING_DOCKER_IMAGE = "DOCKER_CUSTOM_IMAGE_NAME"; - protected static final String SETTING_REGISTRY_SERVER = "DOCKER_REGISTRY_SERVER_URL"; - protected static final String SETTING_REGISTRY_USERNAME = "DOCKER_REGISTRY_SERVER_USERNAME"; - protected static final String SETTING_REGISTRY_PASSWORD = "DOCKER_REGISTRY_SERVER_PASSWORD"; - - protected static final String SETTING_FUNCTIONS_WORKER_RUNTIME = "FUNCTIONS_WORKER_RUNTIME"; - protected static final String SETTING_FUNCTIONS_EXTENSION_VERSION = "FUNCTIONS_EXTENSION_VERSION"; - - protected static final String IP_RESTRICTION_ACTION_ALLOW = "Allow"; - protected static final String IP_RESTRICTION_ACTION_DENY = "Deny"; - - private static final Map DNS_MAP = - new HashMap() { - { - put(AzureEnvironment.AZURE, "azurewebsites.net"); - put(AzureEnvironment.AZURE_CHINA, "chinacloudsites.cn"); - put(AzureEnvironment.AZURE_GERMANY, "azurewebsites.de"); - put(AzureEnvironment.AZURE_US_GOVERNMENT, "azurewebsites.us"); - } - }; - - SiteConfigResourceInner siteConfig; - KuduClient kuduClient; - WebSiteBase webSiteBase; - - private Map hostNameSslStateMap; - private TreeMap> hostNameBindingsToCreate; - private List hostNameBindingsToDelete; - private TreeMap> sslBindingsToCreate; - - protected Map appSettingsToAdd; - protected List appSettingsToRemove; - private Map appSettingStickiness; - private Map connectionStringsToAdd; - private List connectionStringsToRemove; - private Map connectionStringStickiness; - private WebAppSourceControlImpl sourceControl; - private boolean sourceControlToDelete; - private WebAppAuthenticationImpl authentication; - private boolean authenticationToUpdate; - private WebAppDiagnosticLogsImpl diagnosticLogs; - private boolean diagnosticLogsToUpdate; - private FunctionalTaskItem msiHandler; - private boolean isInCreateMode; - private WebAppMsiHandler webAppMsiHandler; - - WebAppBaseImpl( - String name, - SiteInner innerObject, - SiteConfigResourceInner siteConfig, - SiteLogsConfigInner logConfig, - AppServiceManager manager) { - super(name, innerObject, manager); - if (innerObject != null && innerObject.kind() != null) { - innerObject.withKind(innerObject.kind().replace(";", ",")); - } - this.siteConfig = siteConfig; - if (logConfig != null) { - this.diagnosticLogs = new WebAppDiagnosticLogsImpl<>(logConfig, this); - } - - webAppMsiHandler = new WebAppMsiHandler<>(manager.authorizationManager(), this); - normalizeProperties(); - isInCreateMode = innerModel() == null || innerModel().id() == null; - if (!isInCreateMode) { - initializeKuduClient(); - } - } - - public boolean isInCreateMode() { - return isInCreateMode; - } - - private void initializeKuduClient() { - if (kuduClient == null) { - kuduClient = new KuduClient(this); - } - } - - @Override - public void setInner(SiteInner innerObject) { - if (innerObject.kind() != null) { - innerObject.withKind(innerObject.kind().replace(";", ",")); - } - super.setInner(innerObject); - } - - RoleAssignmentHelper.IdProvider idProvider() { - return new RoleAssignmentHelper.IdProvider() { - @Override - public String principalId() { - if (innerModel() != null && innerModel().identity() != null) { - return innerModel().identity().principalId(); - } else { - return null; - } - } - - @Override - public String resourceId() { - if (innerModel() != null) { - return innerModel().id(); - } else { - return null; - } - } - }; - } - - private void normalizeProperties() { - this.hostNameBindingsToCreate = new TreeMap<>(); - this.hostNameBindingsToDelete = new ArrayList<>(); - this.appSettingsToAdd = new HashMap<>(); - this.appSettingsToRemove = new ArrayList<>(); - this.appSettingStickiness = new HashMap<>(); - this.connectionStringsToAdd = new HashMap<>(); - this.connectionStringsToRemove = new ArrayList<>(); - this.connectionStringStickiness = new HashMap<>(); - this.sourceControl = null; - this.sourceControlToDelete = false; - this.authenticationToUpdate = false; - this.diagnosticLogsToUpdate = false; - this.sslBindingsToCreate = new TreeMap<>(); - this.msiHandler = null; - this.webSiteBase = new WebSiteBaseImpl(innerModel()); - this.hostNameSslStateMap = new HashMap<>(this.webSiteBase.hostnameSslStates()); - } - - @Override - public String state() { - return webSiteBase.state(); - } - - @Override - public Set hostnames() { - return webSiteBase.hostnames(); - } - - @Override - public String repositorySiteName() { - return webSiteBase.repositorySiteName(); - } - - @Override - public UsageState usageState() { - return webSiteBase.usageState(); - } - - @Override - public boolean enabled() { - return webSiteBase.enabled(); - } - - @Override - public Set enabledHostNames() { - return webSiteBase.enabledHostNames(); - } - - @Override - public SiteAvailabilityState availabilityState() { - return webSiteBase.availabilityState(); - } - - @Override - public Map hostnameSslStates() { - return Collections.unmodifiableMap(hostNameSslStateMap); - } - - @Override - public String appServicePlanId() { - return webSiteBase.appServicePlanId(); - } - - @Override - public OffsetDateTime lastModifiedTime() { - return webSiteBase.lastModifiedTime(); - } - - @Override - public Set trafficManagerHostNames() { - return webSiteBase.trafficManagerHostNames(); - } - - @Override - public boolean scmSiteAlsoStopped() { - return webSiteBase.scmSiteAlsoStopped(); - } - - @Override - public String targetSwapSlot() { - return webSiteBase.targetSwapSlot(); - } - - @Override - public boolean clientAffinityEnabled() { - return webSiteBase.clientAffinityEnabled(); - } - - @Override - public boolean clientCertEnabled() { - return webSiteBase.clientCertEnabled(); - } - - @Override - public boolean hostnamesDisabled() { - return webSiteBase.hostnamesDisabled(); - } - - @Override - public Set outboundIPAddresses() { - return webSiteBase.outboundIPAddresses(); - } - - @Override - public int containerSize() { - return webSiteBase.containerSize(); - } - - @Override - public CloningInfo cloningInfo() { - return webSiteBase.cloningInfo(); - } - - @Override - public boolean isDefaultContainer() { - return webSiteBase.isDefaultContainer(); - } - - @Override - public String defaultHostname() { - if (innerModel().defaultHostname() != null) { - return innerModel().defaultHostname(); - } else { - AzureEnvironment environment = manager().environment(); - String dns = DNS_MAP.get(environment); - String leaf = name(); - if (this instanceof DeploymentSlotBaseImpl) { - leaf = ((DeploymentSlotBaseImpl) this).parent().name() + "-" + leaf; - } - return leaf + "." + dns; - } - } - - @Override - public List defaultDocuments() { - if (siteConfig == null) { - return null; - } - return Collections.unmodifiableList(siteConfig.defaultDocuments()); - } - - @Override - public NetFrameworkVersion netFrameworkVersion() { - if (siteConfig == null) { - return null; - } - return NetFrameworkVersion.fromString(siteConfig.netFrameworkVersion()); - } - - @Override - public PhpVersion phpVersion() { - if (siteConfig == null || siteConfig.phpVersion() == null) { - return PhpVersion.OFF; - } - return PhpVersion.fromString(siteConfig.phpVersion()); - } - - @Override - public PythonVersion pythonVersion() { - if (siteConfig == null || siteConfig.pythonVersion() == null) { - return PythonVersion.OFF; - } - return PythonVersion.fromString(siteConfig.pythonVersion()); - } - - @Override - public String nodeVersion() { - if (siteConfig == null) { - return null; - } - return siteConfig.nodeVersion(); - } - - @Override - public boolean remoteDebuggingEnabled() { - if (siteConfig == null) { - return false; - } - return ResourceManagerUtils.toPrimitiveBoolean(siteConfig.remoteDebuggingEnabled()); - } - - @Override - public RemoteVisualStudioVersion remoteDebuggingVersion() { - if (siteConfig == null) { - return null; - } - return RemoteVisualStudioVersion.fromString(siteConfig.remoteDebuggingVersion()); - } - - @Override - public boolean webSocketsEnabled() { - if (siteConfig == null) { - return false; - } - return ResourceManagerUtils.toPrimitiveBoolean(siteConfig.webSocketsEnabled()); - } - - @Override - public boolean alwaysOn() { - if (siteConfig == null) { - return false; - } - return ResourceManagerUtils.toPrimitiveBoolean(siteConfig.alwaysOn()); - } - - @Override - public JavaVersion javaVersion() { - if (siteConfig == null || siteConfig.javaVersion() == null) { - return JavaVersion.OFF; - } - return JavaVersion.fromString(siteConfig.javaVersion()); - } - - @Override - public String javaContainer() { - if (siteConfig == null) { - return null; - } - return siteConfig.javaContainer(); - } - - @Override - public String javaContainerVersion() { - if (siteConfig == null) { - return null; - } - return siteConfig.javaContainerVersion(); - } - - @Override - public ManagedPipelineMode managedPipelineMode() { - if (siteConfig == null) { - return null; - } - return siteConfig.managedPipelineMode(); - } - - @Override - public PlatformArchitecture platformArchitecture() { - if (siteConfig.use32BitWorkerProcess()) { - return PlatformArchitecture.X86; - } else { - return PlatformArchitecture.X64; - } - } - - @Override - public String linuxFxVersion() { - if (siteConfig == null) { - return null; - } - return siteConfig.linuxFxVersion(); - } - - @Override - public String windowsFxVersion() { - if (siteConfig == null) { - return null; - } - return siteConfig.windowsFxVersion(); - } - - @Override - public String autoSwapSlotName() { - if (siteConfig == null) { - return null; - } - return siteConfig.autoSwapSlotName(); - } - - @Override - public boolean httpsOnly() { - return webSiteBase.httpsOnly(); - } - - @Override - public FtpsState ftpsState() { - if (siteConfig == null) { - return null; - } - return siteConfig.ftpsState(); - } - - @Override - public List virtualApplications() { - if (siteConfig == null) { - return null; - } - return siteConfig.virtualApplications(); - } - - @Override - public boolean http20Enabled() { - if (siteConfig == null) { - return false; - } - return ResourceManagerUtils.toPrimitiveBoolean(siteConfig.http20Enabled()); - } - - @Override - public boolean localMySqlEnabled() { - if (siteConfig == null) { - return false; - } - return ResourceManagerUtils.toPrimitiveBoolean(siteConfig.localMySqlEnabled()); - } - - @Override - public ScmType scmType() { - if (siteConfig == null) { - return null; - } - return siteConfig.scmType(); - } - - @Override - public String documentRoot() { - if (siteConfig == null) { - return null; - } - return siteConfig.documentRoot(); - } - - @Override - public SupportedTlsVersions minTlsVersion() { - if (siteConfig == null) { - return null; - } - return siteConfig.minTlsVersion(); - } - - @Override - public List ipSecurityRules() { - if (this.siteConfig == null || this.siteConfig.ipSecurityRestrictions() == null) { - return Collections.emptyList(); - } - return Collections.unmodifiableList(siteConfig.ipSecurityRestrictions()); - } - - @Override - public OperatingSystem operatingSystem() { - if (innerModel().kind() != null && innerModel().kind().toLowerCase(Locale.ROOT).contains("linux")) { - return OperatingSystem.LINUX; - } else { - return OperatingSystem.WINDOWS; - } - } - - @Override - public String systemAssignedManagedServiceIdentityTenantId() { - if (innerModel().identity() == null) { - return null; - } - return innerModel().identity().tenantId(); - } - - @Override - public String systemAssignedManagedServiceIdentityPrincipalId() { - if (innerModel().identity() == null) { - return null; - } - return innerModel().identity().principalId(); - } - - @Override - public Set userAssignedManagedServiceIdentityIds() { - if (innerModel().identity() == null) { - return null; - } - return innerModel().identity().userAssignedIdentities().keySet(); - } - - @Override - public WebAppDiagnosticLogsImpl diagnosticLogsConfig() { - return diagnosticLogs; - } - - @Override - public InputStream streamApplicationLogs() { - return pipeObservableToInputStream(streamApplicationLogsAsync()); - } - - @Override - public Flux streamApplicationLogsAsync() { - return kuduClient.streamApplicationLogsAsync(); - } - - @Override - public InputStream streamHttpLogs() { - return pipeObservableToInputStream(streamHttpLogsAsync()); - } - - @Override - public Flux streamHttpLogsAsync() { - return kuduClient.streamHttpLogsAsync(); - } - - @Override - public InputStream streamTraceLogs() { - return pipeObservableToInputStream(streamTraceLogsAsync()); - } - - @Override - public Flux streamTraceLogsAsync() { - return kuduClient.streamTraceLogsAsync(); - } - - @Override - public InputStream streamDeploymentLogs() { - return pipeObservableToInputStream(streamDeploymentLogsAsync()); - } - - @Override - public Flux streamDeploymentLogsAsync() { - return kuduClient.streamDeploymentLogsAsync(); - } - - @Override - public InputStream streamAllLogs() { - return pipeObservableToInputStream(streamAllLogsAsync()); - } - - @Override - public Flux streamAllLogsAsync() { - return kuduClient.streamAllLogsAsync(); - } - - private InputStream pipeObservableToInputStream(Flux observable) { - PipedInputStreamWithCallback in = new PipedInputStreamWithCallback(); - final PipedOutputStream out = new PipedOutputStream(); - try { - in.connect(out); - } catch (IOException e) { - throw logger.logExceptionAsError(new RuntimeException(e)); - } - final Disposable subscription = - observable - // Do not block current thread - .subscribeOn(Schedulers.boundedElastic()) - .subscribe( - s -> { - try { - out.write(s.getBytes(StandardCharsets.UTF_8)); - out.write('\n'); - out.flush(); - } catch (IOException e) { - throw logger.logExceptionAsError(new RuntimeException(e)); - } - }); - in - .addCallback( - () -> { - subscription.dispose(); - try { - out.close(); - } catch (IOException e) { - e.printStackTrace(); - } - }); - return in; - } - - @Override - public Map getAppSettings() { - return getAppSettingsAsync().block(); - } - - @Override - public Mono> getAppSettingsAsync() { - return Mono - .zip( - listAppSettings(), - listSlotConfigurations(), - (appSettingsInner, slotConfigs) -> - appSettingsInner - .properties() - .entrySet() - .stream() - .collect( - Collectors - .toMap( - Map.Entry::getKey, - entry -> - new AppSettingImpl( - entry.getKey(), - entry.getValue(), - slotConfigs.appSettingNames() != null - && slotConfigs.appSettingNames().contains(entry.getKey()))))); - } - - @Override - public Map getConnectionStrings() { - return getConnectionStringsAsync().block(); - } - - @Override - public Mono> getConnectionStringsAsync() { - return Mono - .zip( - listConnectionStrings(), - listSlotConfigurations(), - (connectionStringsInner, slotConfigs) -> - connectionStringsInner - .properties() - .entrySet() - .stream() - .collect( - Collectors - .toMap( - Map.Entry::getKey, - entry -> - new ConnectionStringImpl( - entry.getKey(), - entry.getValue(), - slotConfigs.connectionStringNames() != null - && slotConfigs.connectionStringNames().contains(entry.getKey()))))); - } - - @Override - public WebAppAuthentication getAuthenticationConfig() { - return getAuthenticationConfigAsync().block(); - } - - @Override - public Mono getAuthenticationConfigAsync() { - return getAuthentication() - .map(siteAuthSettingsInner -> new WebAppAuthenticationImpl<>(siteAuthSettingsInner, WebAppBaseImpl.this)); - } - - abstract Mono createOrUpdateInner(SiteInner site); - - abstract Mono updateInner(SitePatchResourceInner siteUpdate); - - abstract Mono getInner(); - - abstract Mono getConfigInner(); - - abstract Mono createOrUpdateSiteConfig(SiteConfigResourceInner siteConfig); - - abstract Mono deleteHostnameBinding(String hostname); - - abstract Mono listAppSettings(); - - abstract Mono updateAppSettings(StringDictionaryInner inner); - - abstract Mono listConnectionStrings(); - - abstract Mono updateConnectionStrings(ConnectionStringDictionaryInner inner); - - abstract Mono listSlotConfigurations(); - - abstract Mono updateSlotConfigurations(SlotConfigNamesResourceInner inner); - - abstract Mono createOrUpdateSourceControl(SiteSourceControlInner inner); - - abstract Mono deleteSourceControl(); - - abstract Mono updateAuthentication(SiteAuthSettingsInner inner); - - abstract Mono getAuthentication(); - - abstract Mono createMSDeploy(MSDeploy msDeployInner); - - abstract Mono updateDiagnosticLogsConfig(SiteLogsConfigInner siteLogsConfigInner); - - @Override - public void beforeGroupCreateOrUpdate() { - if (hostNameSslStateMap.size() > 0) { - innerModel().withHostnameSslStates(new ArrayList<>(hostNameSslStateMap.values())); - } - // Hostname and SSL bindings - IndexableTaskItem rootTaskItem = - wrapTask( - context -> { - // Submit hostname bindings - return submitHostNameBindings() - // Submit SSL bindings - .flatMap(fluentT -> submitSslBindings(fluentT.innerModel())); - }); - IndexableTaskItem lastTaskItem = rootTaskItem; - // Site config - lastTaskItem = sequentialTask(lastTaskItem, context -> submitSiteConfig()); - // Metadata, app settings, and connection strings - lastTaskItem = - sequentialTask( - lastTaskItem, - context -> - submitMetadata() - .flatMap(ignored -> submitAppSettings().mergeWith(submitConnectionStrings()).last()) - .flatMap(ignored -> submitStickiness())); - // Source control - lastTaskItem = - sequentialTask( - lastTaskItem, - context -> submitSourceControlToDelete().flatMap(ignored -> submitSourceControlToCreate())); - // Authentication - lastTaskItem = sequentialTask(lastTaskItem, context -> submitAuthentication()); - // Log configuration - lastTaskItem = sequentialTask(lastTaskItem, context -> submitLogConfiguration()); - // MSI roles - if (msiHandler != null) { - sequentialTask(lastTaskItem, msiHandler); - } - - addPostRunDependent(rootTaskItem); - } - - private static IndexableTaskItem wrapTask(FunctionalTaskItem taskItem) { - return IndexableTaskItem.create(taskItem); - } - - private static IndexableTaskItem sequentialTask(IndexableTaskItem taskItem1, FunctionalTaskItem taskItem2) { - IndexableTaskItem taskItem = IndexableTaskItem.create(taskItem2); - taskItem1.addPostRunDependent(taskItem); - return taskItem; - } - - @Override - @SuppressWarnings("unchecked") - public Mono createResourceAsync() { - return submitSite(innerModel()) - .map( - siteInner -> { - setInner(siteInner); - return (FluentT) WebAppBaseImpl.this; - }); - } - - @Override - @SuppressWarnings("unchecked") - public Mono updateResourceAsync() { - SiteInner siteInner = this.innerModel(); - SitePatchResourceInner siteUpdate = new SitePatchResourceInner(); - siteUpdate.withHostnameSslStates(siteInner.hostnameSslStates()); - siteUpdate.withKind(siteInner.kind()); - siteUpdate.withEnabled(siteInner.enabled()); - siteUpdate.withServerFarmId(siteInner.serverFarmId()); - siteUpdate.withReserved(siteInner.reserved()); - siteUpdate.withIsXenon(siteInner.isXenon()); - siteUpdate.withHyperV(siteInner.hyperV()); - siteUpdate.withScmSiteAlsoStopped(siteInner.scmSiteAlsoStopped()); - siteUpdate.withHostingEnvironmentProfile(siteInner.hostingEnvironmentProfile()); - siteUpdate.withClientAffinityEnabled(siteInner.clientAffinityEnabled()); - siteUpdate.withClientCertEnabled(siteInner.clientCertEnabled()); - siteUpdate.withClientCertExclusionPaths(siteInner.clientCertExclusionPaths()); - siteUpdate.withHostNamesDisabled(siteInner.hostNamesDisabled()); - siteUpdate.withContainerSize(siteInner.containerSize()); - siteUpdate.withDailyMemoryTimeQuota(siteInner.dailyMemoryTimeQuota()); - siteUpdate.withCloningInfo(siteInner.cloningInfo()); - siteUpdate.withHttpsOnly(siteInner.httpsOnly()); - siteUpdate.withRedundancyMode(siteInner.redundancyMode()); - - this.webAppMsiHandler.handleExternalIdentities(siteUpdate); - return submitSite(siteUpdate) - .map( - siteInner1 -> { - setInner(siteInner1); - return (FluentT) WebAppBaseImpl.this; - }); - } - - @Override - public Mono afterPostRunAsync(final boolean isGroupFaulted) { - if (!isGroupFaulted) { - isInCreateMode = false; - initializeKuduClient(); - } - return Mono - .fromCallable( - () -> { - normalizeProperties(); - return null; - }); - } - - Mono submitSite(final SiteInner site) { - site.withSiteConfig(new SiteConfigInner()); - return submitSiteWithoutSiteConfig(site); - } - - Mono submitSiteWithoutSiteConfig(final SiteInner site) { - // Construct web app observable - return createOrUpdateInner(site) - .map( - siteInner -> { - site.withSiteConfig(null); - return siteInner; - }); - } - - Mono submitSite(final SitePatchResourceInner siteUpdate) { - // Construct web app observable - return updateInner(siteUpdate) - .map( - siteInner -> { - siteInner.withSiteConfig(null); - return siteInner; - }); - } - - @SuppressWarnings("unchecked") - Mono submitHostNameBindings() { - final List> bindingObservables = new ArrayList<>(); - for (HostnameBindingImpl binding : hostNameBindingsToCreate.values()) { - bindingObservables.add(binding.createAsync()); - } - for (String binding : hostNameBindingsToDelete) { - bindingObservables.add(deleteHostnameBinding(binding).then(Mono.empty())); - } - if (bindingObservables.isEmpty()) { - return Mono.just((FluentT) this); - } else { - return Flux - .zip(bindingObservables, ignored -> WebAppBaseImpl.this) - .last() - .onErrorResume( - throwable -> { - if (throwable instanceof HttpResponseException - && ((HttpResponseException) throwable).getResponse().getStatusCode() == 400) { - return submitSite(innerModel()) - .flatMap( - ignored -> Flux.zip(bindingObservables, ignored1 -> WebAppBaseImpl.this).last()); - } else { - return Mono.error(throwable); - } - }) - .flatMap(WebAppBaseImpl::refreshAsync); - } - } - - Mono submitSslBindings(final SiteInner site) { - List> certs = new ArrayList<>(); - for (final HostnameSslBindingImpl binding : sslBindingsToCreate.values()) { - certs.add(binding.newCertificate()); - hostNameSslStateMap.put(binding.innerModel().name(), binding.innerModel().withToUpdate(true)); - } - if (certs.isEmpty()) { - return Mono.just((Indexable) this); - } else { - site.withHostnameSslStates(new ArrayList<>(hostNameSslStateMap.values())); - return Flux - .zip(certs, ignored -> site) - .last() - .flatMap(this::createOrUpdateInner) - .map( - siteInner -> { - setInner(siteInner); - return WebAppBaseImpl.this; - }); - } - } - - Mono submitSiteConfig() { - if (siteConfig == null) { - return Mono.just((Indexable) this); - } - return createOrUpdateSiteConfig(siteConfig) - .flatMap( - returnedSiteConfig -> { - siteConfig = returnedSiteConfig; - return Mono.just((Indexable) WebAppBaseImpl.this); - }); - } - - Mono submitAppSettings() { - Mono observable = Mono.just((Indexable) this); - if (!appSettingsToAdd.isEmpty() || !appSettingsToRemove.isEmpty()) { - observable = - listAppSettings() - .switchIfEmpty(Mono.just(new StringDictionaryInner())) - .flatMap( - stringDictionaryInner -> { - if (stringDictionaryInner.properties() == null) { - stringDictionaryInner.withProperties(new HashMap()); - } - for (String appSettingKey : appSettingsToRemove) { - stringDictionaryInner.properties().remove(appSettingKey); - } - stringDictionaryInner.properties().putAll(appSettingsToAdd); - return updateAppSettings(stringDictionaryInner); - }) - .map(ignored -> WebAppBaseImpl.this); - } - return observable; - } - - Mono submitMetadata() { - // NOOP - return Mono.just((Indexable) this); - } - - Mono submitConnectionStrings() { - Mono observable = Mono.just((Indexable) this); - if (!connectionStringsToAdd.isEmpty() || !connectionStringsToRemove.isEmpty()) { - observable = - listConnectionStrings() - .switchIfEmpty(Mono.just(new ConnectionStringDictionaryInner())) - .flatMap( - dictionaryInner -> { - if (dictionaryInner.properties() == null) { - dictionaryInner.withProperties(new HashMap()); - } - for (String connectionString : connectionStringsToRemove) { - dictionaryInner.properties().remove(connectionString); - } - dictionaryInner.properties().putAll(connectionStringsToAdd); - return updateConnectionStrings(dictionaryInner); - }) - .map(ignored -> WebAppBaseImpl.this); - } - return observable; - } - - Mono submitStickiness() { - Mono observable = Mono.just((Indexable) this); - if (!appSettingStickiness.isEmpty() || !connectionStringStickiness.isEmpty()) { - observable = - listSlotConfigurations() - .switchIfEmpty(Mono.just(new SlotConfigNamesResourceInner())) - .flatMap( - slotConfigNamesResourceInner -> { - if (slotConfigNamesResourceInner.appSettingNames() == null) { - slotConfigNamesResourceInner.withAppSettingNames(new ArrayList<>()); - } - if (slotConfigNamesResourceInner.connectionStringNames() == null) { - slotConfigNamesResourceInner.withConnectionStringNames(new ArrayList<>()); - } - Set stickyAppSettingKeys = - new HashSet<>(slotConfigNamesResourceInner.appSettingNames()); - Set stickyConnectionStringNames = - new HashSet<>(slotConfigNamesResourceInner.connectionStringNames()); - for (Map.Entry stickiness : appSettingStickiness.entrySet()) { - if (stickiness.getValue()) { - stickyAppSettingKeys.add(stickiness.getKey()); - } else { - stickyAppSettingKeys.remove(stickiness.getKey()); - } - } - for (Map.Entry stickiness : connectionStringStickiness.entrySet()) { - if (stickiness.getValue()) { - stickyConnectionStringNames.add(stickiness.getKey()); - } else { - stickyConnectionStringNames.remove(stickiness.getKey()); - } - } - slotConfigNamesResourceInner.withAppSettingNames(new ArrayList<>(stickyAppSettingKeys)); - slotConfigNamesResourceInner - .withConnectionStringNames(new ArrayList<>(stickyConnectionStringNames)); - return updateSlotConfigurations(slotConfigNamesResourceInner); - }) - .map(ignored -> WebAppBaseImpl.this); - } - return observable; - } - - Mono submitSourceControlToCreate() { - if (sourceControl == null || sourceControlToDelete) { - return Mono.just((Indexable) this); - } - return sourceControl - .registerGithubAccessToken() - .then(createOrUpdateSourceControl(sourceControl.innerModel())) - .delayElement(ResourceManagerUtils.InternalRuntimeContext.getDelayDuration(Duration.ofSeconds(30))) - .map(ignored -> WebAppBaseImpl.this); - } - - Mono submitSourceControlToDelete() { - if (!sourceControlToDelete) { - return Mono.just((Indexable) this); - } - return deleteSourceControl().map(ignored -> WebAppBaseImpl.this); - } - - Mono submitAuthentication() { - if (!authenticationToUpdate) { - return Mono.just((Indexable) this); - } - return updateAuthentication(authentication.innerModel()) - .map( - siteAuthSettingsInner -> { - WebAppBaseImpl.this.authentication = - new WebAppAuthenticationImpl<>(siteAuthSettingsInner, WebAppBaseImpl.this); - return WebAppBaseImpl.this; - }); - } - - Mono submitLogConfiguration() { - if (!diagnosticLogsToUpdate) { - return Mono.just((Indexable) this); - } - return updateDiagnosticLogsConfig(diagnosticLogs.innerModel()) - .map( - siteLogsConfigInner -> { - WebAppBaseImpl.this.diagnosticLogs = - new WebAppDiagnosticLogsImpl<>(siteLogsConfigInner, WebAppBaseImpl.this); - return WebAppBaseImpl.this; - }); - } - - @Override - public WebDeploymentImpl deploy() { - return new WebDeploymentImpl<>(this); - } - - WebAppBaseImpl withNewHostNameSslBinding( - final HostnameSslBindingImpl hostNameSslBinding) { - sslBindingsToCreate.put(hostNameSslBinding.name(), hostNameSslBinding); - return this; - } - - @SuppressWarnings("unchecked") - public FluentImplT withManagedHostnameBindings(AppServiceDomain domain, String... hostnames) { - for (String hostname : hostnames) { - if ("@".equals(hostname) || hostname.equalsIgnoreCase(domain.name())) { - defineHostnameBinding() - .withAzureManagedDomain(domain) - .withSubDomain(hostname) - .withDnsRecordType(CustomHostnameDnsRecordType.A) - .attach(); - } else { - defineHostnameBinding() - .withAzureManagedDomain(domain) - .withSubDomain(hostname) - .withDnsRecordType(CustomHostnameDnsRecordType.CNAME) - .attach(); - } - } - return (FluentImplT) this; - } - - @SuppressWarnings("unchecked") - public HostnameBindingImpl defineHostnameBinding() { - HostnameBindingInner inner = new HostnameBindingInner(); - inner.withSiteName(name()); - inner.withAzureResourceType(AzureResourceType.WEBSITE); - inner.withAzureResourceName(name()); - inner.withHostnameType(HostnameType.VERIFIED); - return new HostnameBindingImpl<>(inner, (FluentImplT) this); - } - - @SuppressWarnings("unchecked") - public FluentImplT withThirdPartyHostnameBinding(String domain, String... hostnames) { - for (String hostname : hostnames) { - defineHostnameBinding() - .withThirdPartyDomain(domain) - .withSubDomain(hostname) - .withDnsRecordType(CustomHostnameDnsRecordType.CNAME) - .attach(); - } - return (FluentImplT) this; - } - - @SuppressWarnings("unchecked") - public FluentImplT withoutHostnameBinding(String hostname) { - hostNameBindingsToDelete.add(hostname); - return (FluentImplT) this; - } - - @SuppressWarnings("unchecked") - public FluentImplT withoutSslBinding(String hostname) { - if (hostNameSslStateMap.containsKey(hostname)) { - hostNameSslStateMap.get(hostname).withSslState(SslState.DISABLED).withToUpdate(true); - } - return (FluentImplT) this; - } - - @SuppressWarnings("unchecked") - FluentImplT withHostNameBinding(final HostnameBindingImpl hostNameBinding) { - this.hostNameBindingsToCreate.put(hostNameBinding.name(), hostNameBinding); - return (FluentImplT) this; - } - - @SuppressWarnings("unchecked") - public FluentImplT withAppDisabledOnCreation() { - innerModel().withEnabled(false); - return (FluentImplT) this; - } - - @SuppressWarnings("unchecked") - public FluentImplT withScmSiteAlsoStopped(boolean scmSiteAlsoStopped) { - innerModel().withScmSiteAlsoStopped(scmSiteAlsoStopped); - return (FluentImplT) this; - } - - @SuppressWarnings("unchecked") - public FluentImplT withClientAffinityEnabled(boolean enabled) { - innerModel().withClientAffinityEnabled(enabled); - return (FluentImplT) this; - } - - @SuppressWarnings("unchecked") - public FluentImplT withClientCertEnabled(boolean enabled) { - innerModel().withClientCertEnabled(enabled); - return (FluentImplT) this; - } - - @SuppressWarnings("unchecked") - public HostnameSslBindingImpl defineSslBinding() { - return new HostnameSslBindingImpl<>(new HostnameSslState(), (FluentImplT) this); - } - - @SuppressWarnings("unchecked") - public FluentImplT withNetFrameworkVersion(NetFrameworkVersion version) { - if (siteConfig == null) { - siteConfig = new SiteConfigResourceInner(); - } - siteConfig.withNetFrameworkVersion(version.toString()); - return (FluentImplT) this; - } - - @SuppressWarnings("unchecked") - public FluentImplT withPhpVersion(PhpVersion version) { - if (siteConfig == null) { - siteConfig = new SiteConfigResourceInner(); - } - siteConfig.withPhpVersion(version.toString()); - return (FluentImplT) this; - } - - public FluentImplT withoutPhp() { - return withPhpVersion(PhpVersion.fromString("")); - } - - @SuppressWarnings("unchecked") - public FluentImplT withJavaVersion(JavaVersion version) { - if (siteConfig == null) { - siteConfig = new SiteConfigResourceInner(); - } - siteConfig.withJavaVersion(version.toString()); - return (FluentImplT) this; - } - - public FluentImplT withoutJava() { - return withJavaVersion(JavaVersion.fromString("")).withWebContainer(WebContainer.fromString("")); - } - - @SuppressWarnings("unchecked") - public FluentImplT withWebContainer(WebContainer webContainer) { - if (siteConfig == null) { - siteConfig = new SiteConfigResourceInner(); - } - if (webContainer == null) { - siteConfig.withJavaContainer(null); - siteConfig.withJavaContainerVersion(null); - } else if (webContainer.toString().isEmpty()) { - siteConfig.withJavaContainer(""); - siteConfig.withJavaContainerVersion(""); - } else { - String[] containerInfo = webContainer.toString().split(" "); - siteConfig.withJavaContainer(containerInfo[0]); - siteConfig.withJavaContainerVersion(containerInfo[1]); - } - return (FluentImplT) this; - } - - @SuppressWarnings("unchecked") - public FluentImplT withPythonVersion(PythonVersion version) { - if (siteConfig == null) { - siteConfig = new SiteConfigResourceInner(); - } - siteConfig.withPythonVersion(version.toString()); - return (FluentImplT) this; - } - - public FluentImplT withoutPython() { - return withPythonVersion(PythonVersion.fromString("")); - } - - @SuppressWarnings("unchecked") - public FluentImplT withPlatformArchitecture(PlatformArchitecture platform) { - if (siteConfig == null) { - siteConfig = new SiteConfigResourceInner(); - } - siteConfig.withUse32BitWorkerProcess(platform.equals(PlatformArchitecture.X86)); - return (FluentImplT) this; - } - - @SuppressWarnings("unchecked") - public FluentImplT withWebSocketsEnabled(boolean enabled) { - if (siteConfig == null) { - siteConfig = new SiteConfigResourceInner(); - } - siteConfig.withWebSocketsEnabled(enabled); - return (FluentImplT) this; - } - - @SuppressWarnings("unchecked") - public FluentImplT withWebAppAlwaysOn(boolean alwaysOn) { - if (siteConfig == null) { - siteConfig = new SiteConfigResourceInner(); - } - siteConfig.withAlwaysOn(alwaysOn); - return (FluentImplT) this; - } - - @SuppressWarnings("unchecked") - public FluentImplT withManagedPipelineMode(ManagedPipelineMode managedPipelineMode) { - if (siteConfig == null) { - siteConfig = new SiteConfigResourceInner(); - } - siteConfig.withManagedPipelineMode(managedPipelineMode); - return (FluentImplT) this; - } - - @SuppressWarnings("unchecked") - public FluentImplT withAutoSwapSlotName(String slotName) { - if (siteConfig == null) { - siteConfig = new SiteConfigResourceInner(); - } - siteConfig.withAutoSwapSlotName(slotName); - return (FluentImplT) this; - } - - @SuppressWarnings("unchecked") - public FluentImplT withRemoteDebuggingEnabled(RemoteVisualStudioVersion remoteVisualStudioVersion) { - if (siteConfig == null) { - siteConfig = new SiteConfigResourceInner(); - } - siteConfig.withRemoteDebuggingEnabled(true); - siteConfig.withRemoteDebuggingVersion(remoteVisualStudioVersion.toString()); - return (FluentImplT) this; - } - - @SuppressWarnings("unchecked") - public FluentImplT withRemoteDebuggingDisabled() { - if (siteConfig == null) { - siteConfig = new SiteConfigResourceInner(); - } - siteConfig.withRemoteDebuggingEnabled(false); - return (FluentImplT) this; - } - - @SuppressWarnings("unchecked") - public FluentImplT withDefaultDocument(String document) { - if (siteConfig == null) { - siteConfig = new SiteConfigResourceInner(); - } - if (siteConfig.defaultDocuments() == null) { - siteConfig.withDefaultDocuments(new ArrayList()); - } - siteConfig.defaultDocuments().add(document); - return (FluentImplT) this; - } - - @SuppressWarnings("unchecked") - public FluentImplT withDefaultDocuments(List documents) { - if (siteConfig == null) { - siteConfig = new SiteConfigResourceInner(); - } - if (siteConfig.defaultDocuments() == null) { - siteConfig.withDefaultDocuments(new ArrayList<>()); - } - siteConfig.defaultDocuments().addAll(documents); - return (FluentImplT) this; - } - - @SuppressWarnings("unchecked") - public FluentImplT withoutDefaultDocument(String document) { - if (siteConfig == null) { - siteConfig = new SiteConfigResourceInner(); - } - if (siteConfig.defaultDocuments() != null) { - siteConfig.defaultDocuments().remove(document); - } - return (FluentImplT) this; - } - - @SuppressWarnings("unchecked") - public FluentImplT withHttpsOnly(boolean httpsOnly) { - innerModel().withHttpsOnly(httpsOnly); - return (FluentImplT) this; - } - - @SuppressWarnings("unchecked") - public FluentImplT withHttp20Enabled(boolean http20Enabled) { - if (siteConfig == null) { - siteConfig = new SiteConfigResourceInner(); - } - siteConfig.withHttp20Enabled(http20Enabled); - return (FluentImplT) this; - } - - @SuppressWarnings("unchecked") - public FluentImplT withFtpsState(FtpsState ftpsState) { - if (siteConfig == null) { - siteConfig = new SiteConfigResourceInner(); - } - siteConfig.withFtpsState(ftpsState); - return (FluentImplT) this; - } - - @SuppressWarnings("unchecked") - public FluentImplT withVirtualApplications(List virtualApplications) { - if (siteConfig == null) { - siteConfig = new SiteConfigResourceInner(); - } - siteConfig.withVirtualApplications(virtualApplications); - return (FluentImplT) this; - } - - @Override - @SuppressWarnings("unchecked") - public FluentImplT withMinTlsVersion(SupportedTlsVersions minTlsVersion) { - if (siteConfig == null) { - siteConfig = new SiteConfigResourceInner(); - } - siteConfig.withMinTlsVersion(minTlsVersion); - return (FluentImplT) this; - } - - @SuppressWarnings("unchecked") - public FluentImplT withAppSetting(String key, String value) { - appSettingsToAdd.put(key, value); - return (FluentImplT) this; - } - - @SuppressWarnings("unchecked") - public FluentImplT withAppSettings(Map settings) { - appSettingsToAdd.putAll(settings); - return (FluentImplT) this; - } - - public FluentImplT withStickyAppSetting(String key, String value) { - withAppSetting(key, value); - return withAppSettingStickiness(key, true); - } - - @SuppressWarnings("unchecked") - public FluentImplT withStickyAppSettings(Map settings) { - withAppSettings(settings); - for (String key : settings.keySet()) { - appSettingStickiness.put(key, true); - } - return (FluentImplT) this; - } - - @SuppressWarnings("unchecked") - public FluentImplT withoutAppSetting(String key) { - appSettingsToRemove.add(key); - appSettingStickiness.remove(key); - return (FluentImplT) this; - } - - @SuppressWarnings("unchecked") - public FluentImplT withAppSettingStickiness(String key, boolean sticky) { - appSettingStickiness.put(key, sticky); - return (FluentImplT) this; - } - - @SuppressWarnings("unchecked") - public FluentImplT withConnectionString(String name, String value, ConnectionStringType type) { - connectionStringsToAdd.put(name, new ConnStringValueTypePair().withValue(value).withType(type)); - return (FluentImplT) this; - } - - @SuppressWarnings("unchecked") - public FluentImplT withStickyConnectionString(String name, String value, ConnectionStringType type) { - connectionStringsToAdd.put(name, new ConnStringValueTypePair().withValue(value).withType(type)); - connectionStringStickiness.put(name, true); - return (FluentImplT) this; - } - - @SuppressWarnings("unchecked") - public FluentImplT withoutConnectionString(String name) { - connectionStringsToRemove.add(name); - connectionStringStickiness.remove(name); - return (FluentImplT) this; - } - - @SuppressWarnings("unchecked") - public FluentImplT withConnectionStringStickiness(String name, boolean stickiness) { - connectionStringStickiness.put(name, stickiness); - return (FluentImplT) this; - } - - @SuppressWarnings("unchecked") - void withSourceControl(WebAppSourceControlImpl sourceControl) { - this.sourceControl = sourceControl; - } - - public WebAppSourceControlImpl defineSourceControl() { - SiteSourceControlInner sourceControlInner = new SiteSourceControlInner(); - return new WebAppSourceControlImpl<>(sourceControlInner, this); - } - - @SuppressWarnings("unchecked") - public FluentImplT withLocalGitSourceControl() { - if (siteConfig == null) { - siteConfig = new SiteConfigResourceInner(); - } - siteConfig.withScmType(ScmType.LOCAL_GIT); - return (FluentImplT) this; - } - - @SuppressWarnings("unchecked") - public FluentImplT withoutSourceControl() { - sourceControlToDelete = true; - return (FluentImplT) this; - } - - @SuppressWarnings("unchecked") - void withAuthentication(WebAppAuthenticationImpl authentication) { - this.authentication = authentication; - authenticationToUpdate = true; - } - - void withDiagnosticLogs(WebAppDiagnosticLogsImpl diagnosticLogs) { - this.diagnosticLogs = diagnosticLogs; - diagnosticLogsToUpdate = true; - } - - @Override - @SuppressWarnings("unchecked") - public Mono refreshAsync() { - return super - .refreshAsync() - .flatMap( - fluentT -> - getConfigInner() - .map( - returnedSiteConfig -> { - siteConfig = returnedSiteConfig; - return fluentT; - })); - } - - @Override - protected Mono getInnerAsync() { - return getInner(); - } - - @Override - public WebAppAuthenticationImpl defineAuthentication() { - return new WebAppAuthenticationImpl<>(new SiteAuthSettingsInner().withEnabled(true), this); - } - - @Override - @SuppressWarnings("unchecked") - public FluentImplT withoutAuthentication() { - this.authentication.innerModel().withEnabled(false); - authenticationToUpdate = true; - return (FluentImplT) this; - } - - @Override - @SuppressWarnings("unchecked") - public FluentImplT withContainerLoggingEnabled(int quotaInMB, int retentionDays) { - return updateDiagnosticLogsConfiguration() - .withWebServerLogging() - .withWebServerLogsStoredOnFileSystem() - .withWebServerFileSystemQuotaInMB(quotaInMB) - .withLogRetentionDays(retentionDays) - .attach(); - } - - @Override - public FluentImplT withContainerLoggingEnabled() { - return withContainerLoggingEnabled(35, 0); - } - - @Override - @SuppressWarnings("unchecked") - public FluentImplT withContainerLoggingDisabled() { - return updateDiagnosticLogsConfiguration().withoutWebServerLogging().attach(); - } - - @Override - @SuppressWarnings("unchecked") - public FluentImplT withSystemAssignedManagedServiceIdentity() { - this.webAppMsiHandler.withLocalManagedServiceIdentity(); - return (FluentImplT) this; - } - - @Override - @SuppressWarnings("unchecked") - public FluentImplT withoutSystemAssignedManagedServiceIdentity() { - this.webAppMsiHandler.withoutLocalManagedServiceIdentity(); - return (FluentImplT) this; - } - - @Override - @SuppressWarnings("unchecked") - public FluentImplT withUserAssignedManagedServiceIdentity() { - return (FluentImplT) this; - } - - @Override - @SuppressWarnings("unchecked") - public FluentImplT withSystemAssignedIdentityBasedAccessTo(final String resourceId, final BuiltInRole role) { - this.webAppMsiHandler.withAccessTo(resourceId, role); - return (FluentImplT) this; - } - - @Override - @SuppressWarnings("unchecked") - public FluentImplT withSystemAssignedIdentityBasedAccessToCurrentResourceGroup(final BuiltInRole role) { - this.webAppMsiHandler.withAccessToCurrentResourceGroup(role); - return (FluentImplT) this; - } - - @Override - @SuppressWarnings("unchecked") - public FluentImplT withSystemAssignedIdentityBasedAccessTo(final String resourceId, final String roleDefinitionId) { - this.webAppMsiHandler.withAccessTo(resourceId, roleDefinitionId); - return (FluentImplT) this; - } - - @Override - @SuppressWarnings("unchecked") - public FluentImplT withSystemAssignedIdentityBasedAccessToCurrentResourceGroup(final String roleDefinitionId) { - this.webAppMsiHandler.withAccessToCurrentResourceGroup(roleDefinitionId); - return (FluentImplT) this; - } - - @Override - public WebAppDiagnosticLogsImpl defineDiagnosticLogsConfiguration() { - if (diagnosticLogs == null) { - return new WebAppDiagnosticLogsImpl<>(new SiteLogsConfigInner(), this); - } else { - return diagnosticLogs; - } - } - - @Override - public WebAppDiagnosticLogsImpl updateDiagnosticLogsConfiguration() { - return defineDiagnosticLogsConfiguration(); - } - - - @Override - public ManagedServiceIdentity identity() { - return webSiteBase.identity(); - } - - @Override - public boolean hyperV() { - return webSiteBase.hyperV(); - } - - @Override - public HostingEnvironmentProfile hostingEnvironmentProfile() { - return webSiteBase.hostingEnvironmentProfile(); - } - - @Override - public Set clientCertExclusionPaths() { - return webSiteBase.clientCertExclusionPaths(); - } - - @Override - public Set possibleOutboundIpAddresses() { - return webSiteBase.possibleOutboundIpAddresses(); - } - - @Override - public int dailyMemoryTimeQuota() { - return webSiteBase.dailyMemoryTimeQuota(); - } - - @Override - public OffsetDateTime suspendedTill() { - return webSiteBase.suspendedTill(); - } - - @Override - public int maxNumberOfWorkers() { - return webSiteBase.maxNumberOfWorkers(); - } - - @Override - public SlotSwapStatus slotSwapStatus() { - return webSiteBase.slotSwapStatus(); - } - - @Override - public RedundancyMode redundancyMode() { - return webSiteBase.redundancyMode(); - } - - private static class PipedInputStreamWithCallback extends PipedInputStream { - private Runnable callback; - - private void addCallback(Runnable action) { - this.callback = action; - } - - @Override - public void close() throws IOException { - callback.run(); - super.close(); - } - } - - protected void setAppFrameworkVersion(String fxVersion) { - if (operatingSystem() == OperatingSystem.LINUX) { - siteConfig.withLinuxFxVersion(fxVersion); - } else { - siteConfig.withWindowsFxVersion(fxVersion); - } - } - - @Override - @SuppressWarnings("unchecked") - public FluentImplT withAccessFromAllNetworks() { - this.ensureIpSecurityRestrictions(); - this.siteConfig.withIpSecurityRestrictions(new ArrayList<>()); - return (FluentImplT) this; - } - - @Override - @SuppressWarnings("unchecked") - public FluentImplT withAccessFromNetworkSubnet(String subnetId, int priority) { - this.ensureIpSecurityRestrictions(); - this.siteConfig.ipSecurityRestrictions().add(new IpSecurityRestriction() - .withAction(IP_RESTRICTION_ACTION_ALLOW) - .withPriority(priority) - .withTag(IpFilterTag.DEFAULT) - .withVnetSubnetResourceId(subnetId)); - return (FluentImplT) this; - } - - @Override - public FluentImplT withAccessFromIpAddress(String ipAddress, int priority) { - String ipAddressCidr = ipAddress.contains("/") ? ipAddress : ipAddress + "/32"; - return withAccessFromIpAddressRange(ipAddressCidr, priority); - } - - @Override - @SuppressWarnings("unchecked") - public FluentImplT withAccessFromIpAddressRange(String ipAddressCidr, int priority) { - this.ensureIpSecurityRestrictions(); - this.siteConfig.ipSecurityRestrictions().add(new IpSecurityRestriction() - .withAction(IP_RESTRICTION_ACTION_ALLOW) - .withPriority(priority) - .withTag(IpFilterTag.DEFAULT) - .withIpAddress(ipAddressCidr)); - return (FluentImplT) this; - } - - @Override - @SuppressWarnings("unchecked") - public FluentImplT withAccessRule(IpSecurityRestriction ipSecurityRule) { - this.ensureIpSecurityRestrictions(); - this.siteConfig.ipSecurityRestrictions().add(ipSecurityRule); - return (FluentImplT) this; - } - - @Override - @SuppressWarnings("unchecked") - public FluentImplT withoutNetworkSubnetAccess(String subnetId) { - if (this.siteConfig != null && this.siteConfig.ipSecurityRestrictions() != null) { - this.siteConfig.withIpSecurityRestrictions(this.siteConfig.ipSecurityRestrictions().stream() - .filter(r -> !(IP_RESTRICTION_ACTION_ALLOW.equalsIgnoreCase(r.action()) - && IpFilterTag.DEFAULT == r.tag() - && subnetId.equalsIgnoreCase(r.vnetSubnetResourceId()))) - .collect(Collectors.toList()) - ); - } - return (FluentImplT) this; - } - - @Override - public FluentImplT withoutIpAddressAccess(String ipAddress) { - String ipAddressCidr = ipAddress.contains("/") ? ipAddress : ipAddress + "/32"; - return withoutIpAddressRangeAccess(ipAddressCidr); - } - - @Override - @SuppressWarnings("unchecked") - public FluentImplT withoutIpAddressRangeAccess(String ipAddressCidr) { - if (this.siteConfig != null && this.siteConfig.ipSecurityRestrictions() != null) { - this.siteConfig.withIpSecurityRestrictions(this.siteConfig.ipSecurityRestrictions().stream() - .filter(r -> !(IP_RESTRICTION_ACTION_ALLOW.equalsIgnoreCase(r.action()) - && IpFilterTag.DEFAULT == r.tag() - && Objects.equals(ipAddressCidr, r.ipAddress()))) - .collect(Collectors.toList()) - ); - } - return (FluentImplT) this; - } - - @Override - public Map getSiteAppSettings() { - return getSiteAppSettingsAsync().block(); - } - - @Override - public Mono> getSiteAppSettingsAsync() { - return kuduClient.settings(); - } - - @Override - @SuppressWarnings("unchecked") - public FluentImplT withoutAccessRule(IpSecurityRestriction ipSecurityRule) { - if (this.siteConfig != null && this.siteConfig.ipSecurityRestrictions() != null) { - this.siteConfig.withIpSecurityRestrictions(this.siteConfig.ipSecurityRestrictions().stream() - .filter(r -> !(Objects.equals(r.action(), ipSecurityRule.action()) - && Objects.equals(r.tag(), ipSecurityRule.tag()) - && (Objects.equals(r.ipAddress(), ipSecurityRule.ipAddress()) - || Objects.equals(r.vnetSubnetResourceId(), ipSecurityRule.vnetSubnetResourceId())))) - .collect(Collectors.toList()) - ); - } - return (FluentImplT) this; - } - - private void ensureIpSecurityRestrictions() { - if (this.siteConfig == null) { - this.siteConfig = new SiteConfigResourceInner(); - } - if (this.siteConfig.ipSecurityRestrictions() == null) { - this.siteConfig.withIpSecurityRestrictions(new ArrayList<>()); - } - } - -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/WebAppBasicImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/WebAppBasicImpl.java deleted file mode 100644 index f7307b180bac..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/WebAppBasicImpl.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.implementation; - -import com.azure.resourcemanager.appservice.AppServiceManager; -import com.azure.resourcemanager.appservice.fluent.models.SiteInner; -import com.azure.resourcemanager.appservice.models.WebApp; -import com.azure.resourcemanager.appservice.models.WebAppBasic; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import reactor.core.publisher.Mono; - -class WebAppBasicImpl extends WebSiteBaseImpl implements WebAppBasic, HasManager { - - private final AppServiceManager myManager; - - WebAppBasicImpl(SiteInner innerObject, AppServiceManager myManager) { - super(innerObject); - this.myManager = myManager; - } - - @Override - public WebApp refresh() { - return this.refreshAsync().block(); - } - - @Override - public Mono refreshAsync() { - return this.manager().webApps().getByIdAsync(this.id()) - .doOnNext(site -> this.setInner(site.innerModel())); - } - - @Override - public AppServiceManager manager() { - return myManager; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/WebAppDiagnosticLogsImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/WebAppDiagnosticLogsImpl.java deleted file mode 100644 index e8f1f6632a2d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/WebAppDiagnosticLogsImpl.java +++ /dev/null @@ -1,303 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.appservice.implementation; - -import com.azure.resourcemanager.appservice.models.ApplicationLogsConfig; -import com.azure.resourcemanager.appservice.models.AzureBlobStorageApplicationLogsConfig; -import com.azure.resourcemanager.appservice.models.AzureBlobStorageHttpLogsConfig; -import com.azure.resourcemanager.appservice.models.EnabledConfig; -import com.azure.resourcemanager.appservice.models.FileSystemApplicationLogsConfig; -import com.azure.resourcemanager.appservice.models.FileSystemHttpLogsConfig; -import com.azure.resourcemanager.appservice.models.HttpLogsConfig; -import com.azure.resourcemanager.appservice.models.LogLevel; -import com.azure.resourcemanager.appservice.models.WebAppBase; -import com.azure.resourcemanager.appservice.models.WebAppDiagnosticLogs; -import com.azure.resourcemanager.appservice.fluent.models.SiteLogsConfigInner; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.IndexableWrapperImpl; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; - -/** - * Implementation for WebAppDiagnosticLogs and its create and update interfaces. - * - * @param the fluent interface of the parent web app - * @param the fluent implementation of the parent web app - */ -class WebAppDiagnosticLogsImpl> - extends IndexableWrapperImpl - implements WebAppDiagnosticLogs, - WebAppDiagnosticLogs.Definition>, - WebAppDiagnosticLogs.UpdateDefinition> { - - private final WebAppBaseImpl parent; - - private LogLevel applicationLogLevel = null; - - WebAppDiagnosticLogsImpl(SiteLogsConfigInner inner, WebAppBaseImpl parent) { - super(inner); - if (inner.applicationLogs() != null) { - inner.applicationLogs().withAzureTableStorage(null); - } - this.parent = parent; - } - - @Override - public LogLevel applicationLoggingFileSystemLogLevel() { - if (innerModel().applicationLogs() == null - || innerModel().applicationLogs().fileSystem() == null - || innerModel().applicationLogs().fileSystem().level() == null) { - return LogLevel.OFF; - } else { - return innerModel().applicationLogs().fileSystem().level(); - } - } - - @Override - public String applicationLoggingStorageBlobContainer() { - if (innerModel().applicationLogs() == null || innerModel().applicationLogs().azureBlobStorage() == null) { - return null; - } else { - return innerModel().applicationLogs().azureBlobStorage().sasUrl(); - } - } - - @Override - public LogLevel applicationLoggingStorageBlobLogLevel() { - if (innerModel().applicationLogs() == null - || innerModel().applicationLogs().azureBlobStorage() == null - || innerModel().applicationLogs().azureBlobStorage().level() == null) { - return LogLevel.OFF; - } else { - return innerModel().applicationLogs().azureBlobStorage().level(); - } - } - - @Override - public int applicationLoggingStorageBlobRetentionDays() { - if (innerModel().applicationLogs() == null || innerModel().applicationLogs().azureBlobStorage() == null) { - return 0; - } else { - return ResourceManagerUtils.toPrimitiveInt( - innerModel().applicationLogs().azureBlobStorage().retentionInDays()); - } - } - - @Override - public int webServerLoggingFileSystemQuotaInMB() { - if (innerModel().httpLogs() == null || innerModel().httpLogs().fileSystem() == null) { - return 0; - } else { - return ResourceManagerUtils.toPrimitiveInt(innerModel().httpLogs().fileSystem().retentionInMb()); - } - } - - @Override - public int webServerLoggingFileSystemRetentionDays() { - if (innerModel().httpLogs() == null || innerModel().httpLogs().fileSystem() == null) { - return 0; - } else { - return ResourceManagerUtils.toPrimitiveInt(innerModel().httpLogs().fileSystem().retentionInDays()); - } - } - - @Override - public int webServerLoggingStorageBlobRetentionDays() { - if (innerModel().httpLogs() == null || innerModel().httpLogs().azureBlobStorage() == null) { - return 0; - } else { - return ResourceManagerUtils.toPrimitiveInt(innerModel().httpLogs().azureBlobStorage().retentionInDays()); - } - } - - @Override - public String webServerLoggingStorageBlobContainer() { - if (innerModel().httpLogs() == null || innerModel().httpLogs().azureBlobStorage() == null) { - return null; - } else { - return innerModel().httpLogs().azureBlobStorage().sasUrl(); - } - } - - @Override - public boolean failedRequestsTracing() { - return innerModel().failedRequestsTracing() != null - && ResourceManagerUtils.toPrimitiveBoolean(innerModel().failedRequestsTracing().enabled()); - } - - @Override - public boolean detailedErrorMessages() { - return innerModel().detailedErrorMessages() != null - && ResourceManagerUtils.toPrimitiveBoolean(innerModel().detailedErrorMessages().enabled()); - } - - @Override - public FluentImplT attach() { - parent.withDiagnosticLogs(this); - return parent(); - } - - @Override - @SuppressWarnings("unchecked") - public FluentImplT parent() { - parent.withDiagnosticLogs(this); - return (FluentImplT) this.parent; - } - - @Override - public WebAppDiagnosticLogsImpl withApplicationLogging() { - innerModel().withApplicationLogs(new ApplicationLogsConfig()); - return this; - } - - @Override - public WebAppDiagnosticLogsImpl withoutApplicationLogging() { - withoutApplicationLogsStoredOnFileSystem(); - withoutApplicationLogsStoredOnStorageBlob(); - return this; - } - - @Override - public WebAppDiagnosticLogsImpl withWebServerLogging() { - innerModel().withHttpLogs(new HttpLogsConfig()); - return this; - } - - @Override - public WebAppDiagnosticLogsImpl withoutWebServerLogging() { - withoutWebServerLogsStoredOnFileSystem(); - withoutWebServerLogsStoredOnStorageBlob(); - return this; - } - - @Override - public WebAppDiagnosticLogsImpl withDetailedErrorMessages(boolean enabled) { - innerModel().withDetailedErrorMessages(new EnabledConfig().withEnabled(enabled)); - return this; - } - - @Override - public WebAppDiagnosticLogsImpl withFailedRequestTracing(boolean enabled) { - innerModel().withFailedRequestsTracing(new EnabledConfig().withEnabled(enabled)); - return this; - } - - @Override - public WebAppDiagnosticLogsImpl withApplicationLogsStoredOnFileSystem() { - if (innerModel().applicationLogs() != null) { - innerModel() - .applicationLogs() - .withFileSystem(new FileSystemApplicationLogsConfig().withLevel(applicationLogLevel)); - } - return this; - } - - @Override - public WebAppDiagnosticLogsImpl withApplicationLogsStoredOnStorageBlob( - String containerSasUrl) { - if (innerModel().applicationLogs() != null) { - innerModel() - .applicationLogs() - .withAzureBlobStorage( - new AzureBlobStorageApplicationLogsConfig() - .withLevel(applicationLogLevel) - .withSasUrl(containerSasUrl)); - } - return this; - } - - @Override - public WebAppDiagnosticLogsImpl withWebServerLogsStoredOnFileSystem() { - if (innerModel().httpLogs() != null) { - innerModel().httpLogs().withFileSystem(new FileSystemHttpLogsConfig().withEnabled(true)); - } - return this; - } - - @Override - public WebAppDiagnosticLogsImpl withWebServerLogsStoredOnStorageBlob(String containerSasUrl) { - if (innerModel().httpLogs() != null) { - innerModel() - .httpLogs() - .withAzureBlobStorage( - new AzureBlobStorageHttpLogsConfig().withEnabled(true).withSasUrl(containerSasUrl)); - } - return this; - } - - @Override - public WebAppDiagnosticLogsImpl withoutWebServerLogsStoredOnFileSystem() { - if (innerModel().httpLogs() != null && innerModel().httpLogs().fileSystem() != null) { - innerModel().httpLogs().fileSystem().withEnabled(false); - } - return this; - } - - @Override - public WebAppDiagnosticLogsImpl withoutWebServerLogsStoredOnStorageBlob() { - if (innerModel().httpLogs() != null && innerModel().httpLogs().azureBlobStorage() != null) { - innerModel().httpLogs().azureBlobStorage().withEnabled(false); - } - return this; - } - - @Override - public WebAppDiagnosticLogsImpl withLogLevel(LogLevel logLevel) { - this.applicationLogLevel = logLevel; - return this; - } - - @Override - public WebAppDiagnosticLogsImpl withWebServerFileSystemQuotaInMB(int quotaInMB) { - if (innerModel().httpLogs() != null - && innerModel().httpLogs().fileSystem() != null - && innerModel().httpLogs().fileSystem().enabled()) { - innerModel().httpLogs().fileSystem().withRetentionInMb(quotaInMB); - } - return this; - } - - @Override - public WebAppDiagnosticLogsImpl withLogRetentionDays(int retentionDays) { - if (innerModel().httpLogs() != null - && innerModel().httpLogs().fileSystem() != null - && innerModel().httpLogs().fileSystem().enabled()) { - innerModel().httpLogs().fileSystem().withRetentionInDays(retentionDays); - } - if (innerModel().httpLogs() != null - && innerModel().httpLogs().azureBlobStorage() != null - && innerModel().httpLogs().azureBlobStorage().enabled()) { - innerModel().httpLogs().azureBlobStorage().withRetentionInDays(retentionDays); - } - return this; - } - - @Override - public WebAppDiagnosticLogsImpl withUnlimitedLogRetentionDays() { - if (innerModel().httpLogs() != null - && innerModel().httpLogs().fileSystem() != null - && innerModel().httpLogs().fileSystem().enabled()) { - innerModel().httpLogs().fileSystem().withRetentionInDays(0); - } - if (innerModel().httpLogs() != null - && innerModel().httpLogs().azureBlobStorage() != null - && innerModel().httpLogs().fileSystem().enabled()) { - innerModel().httpLogs().azureBlobStorage().withRetentionInDays(0); - } - return this; - } - - @Override - public WebAppDiagnosticLogsImpl withoutApplicationLogsStoredOnFileSystem() { - if (innerModel().applicationLogs() != null && innerModel().applicationLogs().fileSystem() != null) { - innerModel().applicationLogs().fileSystem().withLevel(LogLevel.OFF); - } - return this; - } - - @Override - public WebAppDiagnosticLogsImpl withoutApplicationLogsStoredOnStorageBlob() { - if (innerModel().applicationLogs() != null && innerModel().applicationLogs().azureBlobStorage() != null) { - innerModel().applicationLogs().azureBlobStorage().withLevel(LogLevel.OFF); - } - return this; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/WebAppImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/WebAppImpl.java deleted file mode 100644 index feab1b1619fd..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/WebAppImpl.java +++ /dev/null @@ -1,341 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.implementation; - -import com.azure.resourcemanager.appservice.AppServiceManager; -import com.azure.resourcemanager.appservice.models.AppServicePlan; -import com.azure.resourcemanager.appservice.models.DeployOptions; -import com.azure.resourcemanager.appservice.models.DeployType; -import com.azure.resourcemanager.appservice.models.DeploymentSlots; -import com.azure.resourcemanager.appservice.models.OperatingSystem; -import com.azure.resourcemanager.appservice.models.PricingTier; -import com.azure.resourcemanager.appservice.models.RuntimeStack; -import com.azure.resourcemanager.appservice.models.WebApp; -import com.azure.resourcemanager.appservice.models.WebAppRuntimeStack; -import com.azure.resourcemanager.appservice.fluent.models.SiteConfigResourceInner; -import com.azure.resourcemanager.appservice.fluent.models.SiteInner; -import com.azure.resourcemanager.appservice.fluent.models.SiteLogsConfigInner; -import com.azure.resourcemanager.appservice.fluent.models.StringDictionaryInner; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.Indexable; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.util.HashMap; -import java.util.Objects; - -import reactor.core.publisher.Mono; - -/** The implementation for WebApp. */ -class WebAppImpl extends AppServiceBaseImpl - implements WebApp, - WebApp.Definition, - WebApp.DefinitionStages.ExistingWindowsPlanWithGroup, - WebApp.DefinitionStages.ExistingLinuxPlanWithGroup, - WebApp.Update, - WebApp.UpdateStages.WithCredentials, - WebApp.UpdateStages.WithStartUpCommand { - - private DeploymentSlots deploymentSlots; - private WebAppRuntimeStack runtimeStackOnWindowsOSToUpdate; - - WebAppImpl( - String name, - SiteInner innerObject, - SiteConfigResourceInner siteConfig, - SiteLogsConfigInner logConfig, - AppServiceManager manager) { - super(name, innerObject, siteConfig, logConfig, manager); - } - - @Override - public WebAppImpl update() { - runtimeStackOnWindowsOSToUpdate = null; - return super.update(); - } - - @Override - public DeploymentSlots deploymentSlots() { - if (deploymentSlots == null) { - deploymentSlots = new DeploymentSlotsImpl(this); - } - return deploymentSlots; - } - - @Override - public WebAppImpl withBuiltInImage(RuntimeStack runtimeStack) { - ensureLinuxPlan(); - cleanUpContainerSettings(); - if (siteConfig == null) { - siteConfig = new SiteConfigResourceInner(); - } - siteConfig.withLinuxFxVersion(String.format("%s|%s", runtimeStack.stack(), runtimeStack.version())); - if (runtimeStack.stack().equals("NODE")) { - siteConfig.withNodeVersion(runtimeStack.version()); - } - if (runtimeStack.stack().equals("PHP")) { - siteConfig.withPhpVersion(runtimeStack.version()); - } - if (runtimeStack.stack().equals("DOTNETCORE")) { - siteConfig.withNetFrameworkVersion(runtimeStack.version()); - } - return this; - } - - @Override - protected void cleanUpContainerSettings() { - if (siteConfig != null && siteConfig.linuxFxVersion() != null) { - siteConfig.withLinuxFxVersion(null); - } - if (siteConfig != null && siteConfig.windowsFxVersion() != null) { - siteConfig.withWindowsFxVersion(null); - } - // PHP - if (siteConfig != null && siteConfig.phpVersion() != null) { - siteConfig.withPhpVersion(null); - } - // Node - if (siteConfig != null && siteConfig.nodeVersion() != null) { - siteConfig.withNodeVersion(null); - } - // Python - if (siteConfig != null && siteConfig.pythonVersion() != null) { - siteConfig.withPythonVersion(null); - } - // Java - if (siteConfig != null && siteConfig.javaVersion() != null) { - siteConfig.withJavaVersion(null); - } - // .NET - if (siteConfig != null && siteConfig.netFrameworkVersion() != null) { - siteConfig.withNetFrameworkVersion("v4.0"); - } - // Docker Hub - withoutAppSetting(SETTING_DOCKER_IMAGE); - withoutAppSetting(SETTING_REGISTRY_SERVER); - withoutAppSetting(SETTING_REGISTRY_USERNAME); - withoutAppSetting(SETTING_REGISTRY_PASSWORD); - } - - @Override - public WebAppImpl withStartUpCommand(String startUpCommand) { - if (siteConfig == null) { - siteConfig = new SiteConfigResourceInner(); - } - siteConfig.withAppCommandLine(startUpCommand); - return this; - } - - @Override - public WebAppImpl withExistingWindowsPlan(AppServicePlan appServicePlan) { - return super.withExistingAppServicePlan(appServicePlan); - } - - @Override - public WebAppImpl withExistingLinuxPlan(AppServicePlan appServicePlan) { - return super.withExistingAppServicePlan(appServicePlan); - } - - @Override - public WebAppImpl withNewWindowsPlan(PricingTier pricingTier) { - return super.withNewAppServicePlan(OperatingSystem.WINDOWS, pricingTier); - } - - @Override - public WebAppImpl withNewWindowsPlan(String appServicePlanName, PricingTier pricingTier) { - return super.withNewAppServicePlan(appServicePlanName, OperatingSystem.WINDOWS, pricingTier); - } - - @Override - public WebAppImpl withNewWindowsPlan(Creatable appServicePlanCreatable) { - return super.withNewAppServicePlan(appServicePlanCreatable); - } - - @Override - public WebAppImpl withNewLinuxPlan(PricingTier pricingTier) { - return super.withNewAppServicePlan(OperatingSystem.LINUX, pricingTier); - } - - @Override - public WebAppImpl withNewLinuxPlan(String appServicePlanName, PricingTier pricingTier) { - return super.withNewAppServicePlan(appServicePlanName, OperatingSystem.LINUX, pricingTier); - } - - @Override - public WebAppImpl withNewLinuxPlan(Creatable appServicePlanCreatable) { - return super.withNewAppServicePlan(appServicePlanCreatable); - } - - @Override - public WebAppImpl withRuntimeStack(WebAppRuntimeStack runtimeStack) { - runtimeStackOnWindowsOSToUpdate = runtimeStack; - return this; - } - - @Override - public Mono warDeployAsync(File warFile) { - return warDeployAsync(warFile, null); - } - - @Override - public void warDeploy(File warFile) { - warDeployAsync(warFile).block(); - } - - @Override - public Mono warDeployAsync(InputStream warFile, long length) { - return warDeployAsync(warFile, length, null); - } - - @Override - public void warDeploy(InputStream warFile, long length) { - warDeployAsync(warFile, length).block(); - } - - @Override - public Mono warDeployAsync(File warFile, String appName) { - try { - return kuduClient.warDeployAsync(warFile, appName); - } catch (IOException e) { - return Mono.error(e); - } - } - - @Override - public void warDeploy(File warFile, String appName) { - warDeployAsync(warFile, appName).block(); - } - - @Override - public void warDeploy(InputStream warFile, long length, String appName) { - warDeployAsync(warFile, length, appName).block(); - } - - @Override - public Mono warDeployAsync(InputStream warFile, long length, String appName) { - return kuduClient.warDeployAsync(warFile, length, appName); - } - - @Override - public Mono zipDeployAsync(File zipFile) { - try { - return kuduClient.zipDeployAsync(zipFile); - } catch (IOException e) { - return Mono.error(e); - } - } - - @Override - public void zipDeploy(File zipFile) { - zipDeployAsync(zipFile).block(); - } - - @Override - public Mono zipDeployAsync(InputStream zipFile, long length) { - return kuduClient.zipDeployAsync(zipFile, length) - .then(WebAppImpl.this.stopAsync()) - .then(WebAppImpl.this.startAsync()); - } - - @Override - public void zipDeploy(InputStream zipFile, long length) { - zipDeployAsync(zipFile, length).block(); - } - - @Override - Mono submitMetadata() { - Mono observable = super.submitMetadata(); - if (runtimeStackOnWindowsOSToUpdate != null) { - observable = - observable - // list metadata - .then(listMetadata()) - // merge with change, then update - .switchIfEmpty(Mono.just(new StringDictionaryInner())) - .flatMap( - stringDictionaryInner -> { - if (stringDictionaryInner.properties() == null) { - stringDictionaryInner.withProperties(new HashMap()); - } - stringDictionaryInner - .properties() - .put("CURRENT_STACK", runtimeStackOnWindowsOSToUpdate.runtime()); - return updateMetadata(stringDictionaryInner); - }) - // clean up - .then( - Mono - .fromCallable( - () -> { - runtimeStackOnWindowsOSToUpdate = null; - return WebAppImpl.this; - })); - } - return observable; - } - - Mono listMetadata() { - return this.manager().serviceClient().getWebApps().listMetadataAsync(resourceGroupName(), name()); - } - - Mono updateMetadata(StringDictionaryInner inner) { - return this.manager().serviceClient().getWebApps().updateMetadataAsync(resourceGroupName(), name(), inner); - } - - @Override - public void deploy(DeployType type, File file) { - deployAsync(type, file).block(); - } - - @Override - public Mono deployAsync(DeployType type, File file) { - return deployAsync(type, file, new DeployOptions()); - } - - @Override - public void deploy(DeployType type, File file, DeployOptions deployOptions) { - deployAsync(type, file, deployOptions).block(); - } - - @Override - public Mono deployAsync(DeployType type, File file, DeployOptions deployOptions) { - Objects.requireNonNull(type); - Objects.requireNonNull(file); - if (deployOptions == null) { - deployOptions = new DeployOptions(); - } - try { - return kuduClient.deployAsync(type, file, - deployOptions.path(), deployOptions.restartSite(), deployOptions.cleanDeployment()); - } catch (IOException e) { - return Mono.error(e); - } - } - - @Override - public void deploy(DeployType type, InputStream file, long length) { - deployAsync(type, file, length).block(); - } - - @Override - public Mono deployAsync(DeployType type, InputStream file, long length) { - return deployAsync(type, file, length, new DeployOptions()); - } - - @Override - public void deploy(DeployType type, InputStream file, long length, DeployOptions deployOptions) { - deployAsync(type, file, length, deployOptions).block(); - } - - @Override - public Mono deployAsync(DeployType type, InputStream file, long length, DeployOptions deployOptions) { - Objects.requireNonNull(type); - Objects.requireNonNull(file); - if (deployOptions == null) { - deployOptions = new DeployOptions(); - } - return kuduClient.deployAsync(type, file, length, - deployOptions.path(), deployOptions.restartSite(), deployOptions.cleanDeployment()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/WebAppMsiHandler.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/WebAppMsiHandler.java deleted file mode 100644 index 42561269423e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/WebAppMsiHandler.java +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.implementation; - -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.ManagedServiceIdentity; -import com.azure.resourcemanager.appservice.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.appservice.fluent.models.SiteInner; -import com.azure.resourcemanager.appservice.fluent.models.SitePatchResourceInner; -import com.azure.resourcemanager.appservice.models.WebAppBase; -import com.azure.resourcemanager.authorization.AuthorizationManager; -import com.azure.resourcemanager.authorization.utils.RoleAssignmentHelper; - -/** - * Utility class to set Managed Service Identity (MSI) property on a web app, install or update MSI extension and create - * role assignments for the service principal associated with the web app. - */ -public class WebAppMsiHandler> - extends RoleAssignmentHelper { - - private final ClientLogger logger = new ClientLogger(getClass()); - - private WebAppBaseImpl webAppBase; - - /** - * Creates VirtualMachineMsiHandler. - * - * @param authorizationManager the graph rbac manager - * @param webAppBase the web app to which MSI extension needs to be installed and for which role assignments needs - * to be created - */ - WebAppMsiHandler(final AuthorizationManager authorizationManager, WebAppBaseImpl webAppBase) { - super(authorizationManager, webAppBase.taskGroup(), webAppBase.idProvider()); - this.webAppBase = webAppBase; - } - - /** - * Specifies that Local Managed Service Identity needs to be enabled in the web app. If MSI extension is not already - * installed then it will be installed with access token port as 50342. - * - * @return WebAppMsiHandler - */ - WebAppMsiHandler withLocalManagedServiceIdentity() { - this.initSiteIdentity(ManagedServiceIdentityType.SYSTEM_ASSIGNED); - return this; - } - - /** - * Specifies that Local Managed Service Identity needs to be disabled in the web app. - * - * @return WebAppMsiHandler - */ - WebAppMsiHandler withoutLocalManagedServiceIdentity() { - SiteInner siteInner = this.webAppBase.innerModel(); - - if (siteInner.identity() == null - || siteInner.identity().type() == null - || siteInner.identity().type().equals(ManagedServiceIdentityType.NONE) - || siteInner.identity().type().equals(ManagedServiceIdentityType.USER_ASSIGNED)) { - return this; - } else if (siteInner.identity().type().equals(ManagedServiceIdentityType.SYSTEM_ASSIGNED)) { - siteInner.identity().withType(ManagedServiceIdentityType.NONE); - } else if (siteInner.identity().type().equals(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED)) { - siteInner.identity().withType(ManagedServiceIdentityType.USER_ASSIGNED); - } - return this; - } - - void handleExternalIdentities(SitePatchResourceInner siteUpdate) { - // At this point one of the following condition is met: - // - // 1. User don't want touch the 'Site.Identity.userAssignedIdentities' property - // [this.userAssignedIdentities.empty() == true] - // 2. User want to add some identities to 'Site.Identity.userAssignedIdentities' - // [this.userAssignedIdentities.empty() == false and this.webAppBase.inner().identity() != null] - // 3. User want to remove some (not all) identities in 'Site.Identity.userAssignedIdentities' - // [this.userAssignedIdentities.empty() == false and this.webAppBase.inner().identity() != null] - // Note: The scenario where this.webAppBase.inner().identity() is null in #3 is already handled in - // handleRemoveAllExternalIdentitiesCase method - // 4. User want to add and remove (all or subset) some identities in 'Site.Identity.userAssignedIdentities' - // [this.userAssignedIdentities.empty() == false and this.webAppBase.inner().identity() != null] - // - SiteInner siteInner = this.webAppBase.innerModel(); - ManagedServiceIdentity currentIdentity = siteInner.identity(); - siteUpdate.withIdentity(currentIdentity); - - // User don't want to touch 'VM.Identity.userAssignedIdentities' property - if (currentIdentity != null) { - // and currently there is identity exists or user want to manipulate some other properties of - // identity, set identities to null so that it won't send over wire. - currentIdentity.withUserAssignedIdentities(null); - } - } - - /** - * Initialize VM's identity property. - * - * @param identityType the identity type to set - */ - private void initSiteIdentity(ManagedServiceIdentityType identityType) { - if (!identityType.equals(ManagedServiceIdentityType.USER_ASSIGNED) - && !identityType.equals(ManagedServiceIdentityType.SYSTEM_ASSIGNED)) { - throw logger.logExceptionAsError(new IllegalArgumentException("Invalid argument: " + identityType)); - } - - SiteInner siteInner = this.webAppBase.innerModel(); - if (siteInner.identity() == null) { - siteInner.withIdentity(new ManagedServiceIdentity()); - } - if (siteInner.identity().type() == null - || siteInner.identity().type().equals(ManagedServiceIdentityType.NONE) - || siteInner.identity().type().equals(identityType)) { - siteInner.identity().withType(identityType); - } else { - siteInner.identity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/WebAppSourceControlImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/WebAppSourceControlImpl.java deleted file mode 100644 index ce275e08ba8b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/WebAppSourceControlImpl.java +++ /dev/null @@ -1,125 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.appservice.implementation; - -import com.azure.resourcemanager.appservice.models.RepositoryType; -import com.azure.resourcemanager.appservice.models.WebAppBase; -import com.azure.resourcemanager.appservice.models.WebAppSourceControl; -import com.azure.resourcemanager.appservice.fluent.models.SiteSourceControlInner; -import com.azure.resourcemanager.appservice.fluent.models.SourceControlInner; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.IndexableWrapperImpl; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import reactor.core.publisher.Mono; - -/** - * Implementation for WebAppSourceControl and its create and update interfaces. - * - * @param the fluent interface of the parent web app - * @param the fluent implementation of the parent web app - */ -class WebAppSourceControlImpl> - extends IndexableWrapperImpl - implements WebAppSourceControl, - WebAppSourceControl.Definition>, - WebAppSourceControl.UpdateDefinition> { - - private final WebAppBaseImpl parent; - private String githubAccessToken; - - WebAppSourceControlImpl(SiteSourceControlInner inner, WebAppBaseImpl parent) { - super(inner); - this.parent = parent; - } - - @Override - public String name() { - return innerModel().name(); - } - - @Override - public String repositoryUrl() { - return innerModel().repoUrl(); - } - - @Override - public String branch() { - return innerModel().branch(); - } - - @Override - public boolean isManualIntegration() { - return ResourceManagerUtils.toPrimitiveBoolean(innerModel().isManualIntegration()); - } - - @Override - public boolean deploymentRollbackEnabled() { - return ResourceManagerUtils.toPrimitiveBoolean(innerModel().deploymentRollbackEnabled()); - } - - @Override - public RepositoryType repositoryType() { - if (innerModel().isMercurial() == null) { - return null; - } else { - return innerModel().isMercurial() ? RepositoryType.MERCURIAL : RepositoryType.GIT; - } - } - - @Override - public FluentImplT attach() { - parent().withSourceControl(this); - return parent(); - } - - @Override - @SuppressWarnings("unchecked") - public FluentImplT parent() { - return (FluentImplT) this.parent; - } - - @Override - public WebAppSourceControlImpl withBranch(String branch) { - innerModel().withBranch(branch); - return this; - } - - @Override - public WebAppSourceControlImpl withPublicGitRepository(String url) { - innerModel().withIsManualIntegration(true).withIsMercurial(false).withRepoUrl(url); - return this; - } - - @Override - public WebAppSourceControlImpl withPublicMercurialRepository(String url) { - innerModel().withIsManualIntegration(true).withIsMercurial(true).withRepoUrl(url); - return this; - } - - @Override - public WebAppSourceControlImpl withContinuouslyIntegratedGitHubRepository( - String organization, String repository) { - return withContinuouslyIntegratedGitHubRepository( - String.format("https://github.com/%s/%s", organization, repository)); - } - - @Override - public WebAppSourceControlImpl withContinuouslyIntegratedGitHubRepository(String url) { - innerModel().withRepoUrl(url).withIsMercurial(false).withIsManualIntegration(false); - return this; - } - - @Override - public WebAppSourceControlImpl withGitHubAccessToken(String personalAccessToken) { - this.githubAccessToken = personalAccessToken; - return this; - } - - Mono registerGithubAccessToken() { - if (githubAccessToken == null) { - return Mono.empty(); - } - SourceControlInner sourceControlInner = new SourceControlInner().withToken(githubAccessToken); - return this.parent().manager().serviceClient().getResourceProviders() - .updateSourceControlAsync("Github", sourceControlInner); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/WebAppsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/WebAppsClientImpl.java deleted file mode 100644 index 3c669c1a0bdc..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/WebAppsClientImpl.java +++ /dev/null @@ -1,79542 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.http.rest.StreamResponse; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.appservice.fluent.WebAppsClient; -import com.azure.resourcemanager.appservice.fluent.models.AzureStoragePropertyDictionaryResourceInner; -import com.azure.resourcemanager.appservice.fluent.models.BackupItemInner; -import com.azure.resourcemanager.appservice.fluent.models.BackupRequestInner; -import com.azure.resourcemanager.appservice.fluent.models.ConnectionStringDictionaryInner; -import com.azure.resourcemanager.appservice.fluent.models.ContinuousWebJobInner; -import com.azure.resourcemanager.appservice.fluent.models.CsmUsageQuotaInner; -import com.azure.resourcemanager.appservice.fluent.models.CustomHostnameAnalysisResultInner; -import com.azure.resourcemanager.appservice.fluent.models.DeploymentInner; -import com.azure.resourcemanager.appservice.fluent.models.FunctionEnvelopeInner; -import com.azure.resourcemanager.appservice.fluent.models.FunctionSecretsInner; -import com.azure.resourcemanager.appservice.fluent.models.HostKeysInner; -import com.azure.resourcemanager.appservice.fluent.models.HostnameBindingInner; -import com.azure.resourcemanager.appservice.fluent.models.HybridConnectionInner; -import com.azure.resourcemanager.appservice.fluent.models.HybridConnectionKeyInner; -import com.azure.resourcemanager.appservice.fluent.models.IdentifierInner; -import com.azure.resourcemanager.appservice.fluent.models.KeyInfoInner; -import com.azure.resourcemanager.appservice.fluent.models.MSDeployLogInner; -import com.azure.resourcemanager.appservice.fluent.models.MSDeployStatusInner; -import com.azure.resourcemanager.appservice.fluent.models.MigrateMySqlStatusInner; -import com.azure.resourcemanager.appservice.fluent.models.NetworkFeaturesInner; -import com.azure.resourcemanager.appservice.fluent.models.NetworkTraceInner; -import com.azure.resourcemanager.appservice.fluent.models.OperationInner; -import com.azure.resourcemanager.appservice.fluent.models.PerfMonResponseInner; -import com.azure.resourcemanager.appservice.fluent.models.PremierAddOnInner; -import com.azure.resourcemanager.appservice.fluent.models.PrivateAccessInner; -import com.azure.resourcemanager.appservice.fluent.models.ProcessInfoInner; -import com.azure.resourcemanager.appservice.fluent.models.ProcessModuleInfoInner; -import com.azure.resourcemanager.appservice.fluent.models.ProcessThreadInfoInner; -import com.azure.resourcemanager.appservice.fluent.models.PublicCertificateInner; -import com.azure.resourcemanager.appservice.fluent.models.PushSettingsInner; -import com.azure.resourcemanager.appservice.fluent.models.RelayServiceConnectionEntityInner; -import com.azure.resourcemanager.appservice.fluent.models.ResourceMetricDefinitionInner; -import com.azure.resourcemanager.appservice.fluent.models.ResourceMetricInner; -import com.azure.resourcemanager.appservice.fluent.models.RestoreRequestInner; -import com.azure.resourcemanager.appservice.fluent.models.SiteAuthSettingsInner; -import com.azure.resourcemanager.appservice.fluent.models.SiteCloneabilityInner; -import com.azure.resourcemanager.appservice.fluent.models.SiteConfigResourceInner; -import com.azure.resourcemanager.appservice.fluent.models.SiteConfigurationSnapshotInfoInner; -import com.azure.resourcemanager.appservice.fluent.models.SiteExtensionInfoInner; -import com.azure.resourcemanager.appservice.fluent.models.SiteInner; -import com.azure.resourcemanager.appservice.fluent.models.SiteInstanceInner; -import com.azure.resourcemanager.appservice.fluent.models.SiteLogsConfigInner; -import com.azure.resourcemanager.appservice.fluent.models.SitePatchResourceInner; -import com.azure.resourcemanager.appservice.fluent.models.SitePhpErrorLogFlagInner; -import com.azure.resourcemanager.appservice.fluent.models.SiteSourceControlInner; -import com.azure.resourcemanager.appservice.fluent.models.SlotConfigNamesResourceInner; -import com.azure.resourcemanager.appservice.fluent.models.SlotDifferenceInner; -import com.azure.resourcemanager.appservice.fluent.models.SnapshotInner; -import com.azure.resourcemanager.appservice.fluent.models.StorageMigrationResponseInner; -import com.azure.resourcemanager.appservice.fluent.models.StringDictionaryInner; -import com.azure.resourcemanager.appservice.fluent.models.SwiftVirtualNetworkInner; -import com.azure.resourcemanager.appservice.fluent.models.TriggeredJobHistoryInner; -import com.azure.resourcemanager.appservice.fluent.models.TriggeredWebJobInner; -import com.azure.resourcemanager.appservice.fluent.models.UserInner; -import com.azure.resourcemanager.appservice.fluent.models.VnetGatewayInner; -import com.azure.resourcemanager.appservice.fluent.models.VnetInfoInner; -import com.azure.resourcemanager.appservice.fluent.models.WebJobInner; -import com.azure.resourcemanager.appservice.models.BackupItemCollection; -import com.azure.resourcemanager.appservice.models.ContinuousWebJobCollection; -import com.azure.resourcemanager.appservice.models.CsmPublishingProfileOptions; -import com.azure.resourcemanager.appservice.models.CsmSlotEntity; -import com.azure.resourcemanager.appservice.models.CsmUsageQuotaCollection; -import com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException; -import com.azure.resourcemanager.appservice.models.DeletedAppRestoreRequest; -import com.azure.resourcemanager.appservice.models.DeploymentCollection; -import com.azure.resourcemanager.appservice.models.FunctionEnvelopeCollection; -import com.azure.resourcemanager.appservice.models.HostnameBindingCollection; -import com.azure.resourcemanager.appservice.models.IdentifierCollection; -import com.azure.resourcemanager.appservice.models.MSDeploy; -import com.azure.resourcemanager.appservice.models.MigrateMySqlRequest; -import com.azure.resourcemanager.appservice.models.PerfMonCounterCollection; -import com.azure.resourcemanager.appservice.models.PremierAddOnPatchResource; -import com.azure.resourcemanager.appservice.models.ProcessInfoCollection; -import com.azure.resourcemanager.appservice.models.ProcessModuleInfoCollection; -import com.azure.resourcemanager.appservice.models.ProcessThreadInfoCollection; -import com.azure.resourcemanager.appservice.models.PublicCertificateCollection; -import com.azure.resourcemanager.appservice.models.ResourceMetricCollection; -import com.azure.resourcemanager.appservice.models.ResourceMetricDefinitionCollection; -import com.azure.resourcemanager.appservice.models.SiteConfigResourceCollection; -import com.azure.resourcemanager.appservice.models.SiteConfigurationSnapshotInfoCollection; -import com.azure.resourcemanager.appservice.models.SiteExtensionInfoCollection; -import com.azure.resourcemanager.appservice.models.SlotDifferenceCollection; -import com.azure.resourcemanager.appservice.models.SnapshotCollection; -import com.azure.resourcemanager.appservice.models.SnapshotRestoreRequest; -import com.azure.resourcemanager.appservice.models.StorageMigrationOptions; -import com.azure.resourcemanager.appservice.models.TriggeredJobHistoryCollection; -import com.azure.resourcemanager.appservice.models.TriggeredWebJobCollection; -import com.azure.resourcemanager.appservice.models.WebAppCollection; -import com.azure.resourcemanager.appservice.models.WebAppInstanceCollection; -import com.azure.resourcemanager.appservice.models.WebJobCollection; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import com.fasterxml.jackson.databind.util.ByteBufferBackedInputStream; -import java.io.InputStream; -import java.io.SequenceInputStream; -import java.nio.ByteBuffer; -import java.util.Enumeration; -import java.util.Iterator; -import java.util.List; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in WebAppsClient. */ -public final class WebAppsClientImpl - implements InnerSupportsGet, InnerSupportsListing, InnerSupportsDelete, WebAppsClient { - private final ClientLogger logger = new ClientLogger(WebAppsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final WebAppsService service; - - /** The service client containing this operation class. */ - private final WebSiteManagementClientImpl client; - - /** - * Initializes an instance of WebAppsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - WebAppsClientImpl(WebSiteManagementClientImpl client) { - this.service = RestProxy.create(WebAppsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for WebSiteManagementClientWebApps to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "WebSiteManagementCli") - private interface WebAppsService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Web/sites") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("includeSlots") Boolean includeSlots, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") SiteInner siteEnvelope, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}") - @ExpectedResponses({200, 204, 404}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @QueryParam("deleteMetrics") Boolean deleteMetrics, - @QueryParam("deleteEmptyServerFarm") Boolean deleteEmptyServerFarm, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> update( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") SitePatchResourceInner siteEnvelope, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/analyzeCustomHostname") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> analyzeCustomHostname( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @QueryParam("hostName") String hostname, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/applySlotConfig") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> applySlotConfigToProduction( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") CsmSlotEntity slotSwapEntity, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/backup") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> backup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") BackupRequestInner request, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/backups") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listBackups( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/backups/{backupId}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getBackupStatus( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("backupId") String backupId, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/backups/{backupId}") - @ExpectedResponses({200, 404}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteBackup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("backupId") String backupId, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/backups/{backupId}/list") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listBackupStatusSecrets( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("backupId") String backupId, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") BackupRequestInner request, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/backups/{backupId}/restore") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> restore( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("backupId") String backupId, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") RestoreRequestInner request, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/config") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listConfigurations( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/config/appsettings") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> updateApplicationSettings( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") StringDictionaryInner appSettings, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/config/appsettings/list") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listApplicationSettings( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/config/authsettings") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> updateAuthSettings( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") SiteAuthSettingsInner siteAuthSettings, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/config/authsettings/list") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getAuthSettings( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/config/azurestorageaccounts") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> updateAzureStorageAccounts( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") AzureStoragePropertyDictionaryResourceInner azureStorageAccounts, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/config/azurestorageaccounts/list") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listAzureStorageAccounts( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/config/backup") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> updateBackupConfiguration( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") BackupRequestInner request, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/config/backup") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteBackupConfiguration( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/config/backup/list") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getBackupConfiguration( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/config/connectionstrings") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> updateConnectionStrings( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ConnectionStringDictionaryInner connectionStrings, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/config/connectionstrings/list") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listConnectionStrings( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/config/logs") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getDiagnosticLogsConfiguration( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/config/logs") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> updateDiagnosticLogsConfig( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") SiteLogsConfigInner siteLogsConfig, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/config/metadata") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> updateMetadata( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") StringDictionaryInner metadata, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/config/metadata/list") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listMetadata( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/config/publishingcredentials/list") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono>> listPublishingCredentials( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/config/pushsettings") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> updateSitePushSettings( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") PushSettingsInner pushSettings, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/config/pushsettings/list") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listSitePushSettings( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/config/slotConfigNames") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listSlotConfigurationNames( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/config/slotConfigNames") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> updateSlotConfigurationNames( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") SlotConfigNamesResourceInner slotConfigNames, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/config/web") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getConfiguration( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/config/web") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> createOrUpdateConfiguration( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") SiteConfigResourceInner siteConfig, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/config/web") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> updateConfiguration( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") SiteConfigResourceInner siteConfig, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/config/web/snapshots") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listConfigurationSnapshotInfo( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/config/web/snapshots/{snapshotId}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getConfigurationSnapshot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("snapshotId") String snapshotId, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/config/web/snapshots/{snapshotId}/recover") - @ExpectedResponses({204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> recoverSiteConfigurationSnapshot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("snapshotId") String snapshotId, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/containerlogs") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono getWebSiteContainerLogs( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/containerlogs/zip/download") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono getContainerLogsZip( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/continuouswebjobs") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listContinuousWebJobs( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/continuouswebjobs/{webJobName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getContinuousWebJob( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("webJobName") String webJobName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/continuouswebjobs/{webJobName}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteContinuousWebJob( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("webJobName") String webJobName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/continuouswebjobs/{webJobName}/start") - @ExpectedResponses({200, 404}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> startContinuousWebJob( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("webJobName") String webJobName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/continuouswebjobs/{webJobName}/stop") - @ExpectedResponses({200, 404}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> stopContinuousWebJob( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("webJobName") String webJobName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/deployments") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listDeployments( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/deployments/{id}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getDeployment( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("id") String id, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/deployments/{id}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> createDeployment( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("id") String id, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") DeploymentInner deployment, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/deployments/{id}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteDeployment( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("id") String id, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/deployments/{id}/log") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listDeploymentLog( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("id") String id, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/discoverbackup") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> discoverBackup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") RestoreRequestInner request, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/domainOwnershipIdentifiers") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listDomainOwnershipIdentifiers( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getDomainOwnershipIdentifier( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("domainOwnershipIdentifierName") String domainOwnershipIdentifierName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> createOrUpdateDomainOwnershipIdentifier( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("domainOwnershipIdentifierName") String domainOwnershipIdentifierName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") IdentifierInner domainOwnershipIdentifier, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteDomainOwnershipIdentifier( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("domainOwnershipIdentifierName") String domainOwnershipIdentifierName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> updateDomainOwnershipIdentifier( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("domainOwnershipIdentifierName") String domainOwnershipIdentifierName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") IdentifierInner domainOwnershipIdentifier, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/extensions/MSDeploy") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getMSDeployStatus( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/extensions/MSDeploy") - @ExpectedResponses({201, 409}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createMSDeployOperation( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") MSDeploy mSDeploy, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/extensions/MSDeploy/log") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getMSDeployLog( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/functions") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listFunctions( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/functions/admin/token") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getFunctionsAdminToken( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/functions/{functionName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getFunction( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("functionName") String functionName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/functions/{functionName}") - @ExpectedResponses({201}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono>> createFunction( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("functionName") String functionName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") FunctionEnvelopeInner functionEnvelope, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/functions/{functionName}") - @ExpectedResponses({204, 404}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteFunction( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("functionName") String functionName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/functions/{functionName}/keys/{keyName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> createOrUpdateFunctionSecret( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("functionName") String functionName, - @PathParam("keyName") String keyName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") KeyInfoInner key, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/functions/{functionName}/keys/{keyName}") - @ExpectedResponses({204, 404}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteFunctionSecret( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("functionName") String functionName, - @PathParam("keyName") String keyName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/functions/{functionName}/listkeys") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listFunctionKeys( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("functionName") String functionName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/functions/{functionName}/listsecrets") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listFunctionSecrets( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("functionName") String functionName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/host/default/listkeys") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listHostKeys( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/host/default/listsyncstatus") - @ExpectedResponses({204}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listSyncStatus( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/host/default/sync") - @ExpectedResponses({204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> syncFunctions( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/host/default/{keyType}/{keyName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> createOrUpdateHostSecret( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("keyType") String keyType, - @PathParam("keyName") String keyName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") KeyInfoInner key, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/host/default/{keyType}/{keyName}") - @ExpectedResponses({204, 404}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> deleteHostSecret( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("keyType") String keyType, - @PathParam("keyName") String keyName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/hostNameBindings") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listHostnameBindings( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/hostNameBindings/{hostName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getHostnameBinding( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("hostName") String hostname, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/hostNameBindings/{hostName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> createOrUpdateHostnameBinding( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("hostName") String hostname, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") HostnameBindingInner hostnameBinding, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/hostNameBindings/{hostName}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteHostnameBinding( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("hostName") String hostname, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getHybridConnection( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("namespaceName") String namespaceName, - @PathParam("relayName") String relayName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> createOrUpdateHybridConnection( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("namespaceName") String namespaceName, - @PathParam("relayName") String relayName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") HybridConnectionInner connectionEnvelope, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}") - @ExpectedResponses({200, 404}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteHybridConnection( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("namespaceName") String namespaceName, - @PathParam("relayName") String relayName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> updateHybridConnection( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("namespaceName") String namespaceName, - @PathParam("relayName") String relayName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") HybridConnectionInner connectionEnvelope, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}/listKeys") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listHybridConnectionKeys( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("namespaceName") String namespaceName, - @PathParam("relayName") String relayName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/hybridConnectionRelays") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listHybridConnections( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/hybridconnection") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listRelayServiceConnections( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/hybridconnection/{entityName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getRelayServiceConnection( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("entityName") String entityName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/hybridconnection/{entityName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> createOrUpdateRelayServiceConnection( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("entityName") String entityName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") RelayServiceConnectionEntityInner connectionEnvelope, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/hybridconnection/{entityName}") - @ExpectedResponses({200, 404}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteRelayServiceConnection( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("entityName") String entityName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/hybridconnection/{entityName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> updateRelayServiceConnection( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("entityName") String entityName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") RelayServiceConnectionEntityInner connectionEnvelope, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/instances") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listInstanceIdentifiers( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/instances/{instanceId}/extensions/MSDeploy") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getInstanceMsDeployStatus( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("instanceId") String instanceId, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/instances/{instanceId}/extensions/MSDeploy") - @ExpectedResponses({201, 409}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createInstanceMSDeployOperation( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("instanceId") String instanceId, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") MSDeploy mSDeploy, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/instances/{instanceId}/extensions/MSDeploy/log") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getInstanceMSDeployLog( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("instanceId") String instanceId, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/instances/{instanceId}/processes") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listInstanceProcesses( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("instanceId") String instanceId, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/instances/{instanceId}/processes/{processId}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getInstanceProcess( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("processId") String processId, - @PathParam("instanceId") String instanceId, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/instances/{instanceId}/processes/{processId}") - @ExpectedResponses({204, 404}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteInstanceProcess( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("processId") String processId, - @PathParam("instanceId") String instanceId, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/instances/{instanceId}/processes/{processId}/dump") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono getInstanceProcessDump( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("processId") String processId, - @PathParam("instanceId") String instanceId, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/instances/{instanceId}/processes/{processId}/modules") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listInstanceProcessModules( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("processId") String processId, - @PathParam("instanceId") String instanceId, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/instances/{instanceId}/processes/{processId}/modules/{baseAddress}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getInstanceProcessModule( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("processId") String processId, - @PathParam("baseAddress") String baseAddress, - @PathParam("instanceId") String instanceId, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/instances/{instanceId}/processes/{processId}/threads") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listInstanceProcessThreads( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("processId") String processId, - @PathParam("instanceId") String instanceId, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/instances/{instanceId}/processes/{processId}/threads/{threadId}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getInstanceProcessThread( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("processId") String processId, - @PathParam("threadId") String threadId, - @PathParam("instanceId") String instanceId, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/iscloneable") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> isCloneable( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/listsyncfunctiontriggerstatus") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listSyncFunctionTriggers( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/metricdefinitions") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listMetricDefinitions( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/metrics") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listMetrics( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @QueryParam("details") Boolean details, - @QueryParam(value = "$filter", encoded = true) String filter, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/migrate") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono>> migrateStorage( - @HostParam("$host") String endpoint, - @QueryParam("subscriptionName") String subscriptionName, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") StorageMigrationOptions migrationOptions, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/migratemysql") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono>> migrateMySql( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") MigrateMySqlRequest migrationRequestEnvelope, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/migratemysql/status") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getMigrateMySqlStatus( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/networkConfig/virtualNetwork") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getSwiftVirtualNetworkConnection( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/networkConfig/virtualNetwork") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> createOrUpdateSwiftVirtualNetworkConnection( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") SwiftVirtualNetworkInner connectionEnvelope, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/networkConfig/virtualNetwork") - @ExpectedResponses({200, 404}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteSwiftVirtualNetwork( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/networkConfig/virtualNetwork") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> updateSwiftVirtualNetworkConnection( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") SwiftVirtualNetworkInner connectionEnvelope, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/networkFeatures/{view}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNetworkFeatures( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("view") String view, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/networkTrace/operationresults/{operationId}") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getNetworkTraceOperation( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("operationId") String operationId, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/networkTrace/start") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> startWebSiteNetworkTrace( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @QueryParam("durationInSeconds") Integer durationInSeconds, - @QueryParam("maxFrameLength") Integer maxFrameLength, - @QueryParam("sasUrl") String sasUrl, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/networkTrace/startOperation") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono>> startWebSiteNetworkTraceOperation( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @QueryParam("durationInSeconds") Integer durationInSeconds, - @QueryParam("maxFrameLength") Integer maxFrameLength, - @QueryParam("sasUrl") String sasUrl, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/networkTrace/stop") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> stopWebSiteNetworkTrace( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/networkTrace/{operationId}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono>> getNetworkTraces( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("operationId") String operationId, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/networkTraces/current/operationresults/{operationId}") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getNetworkTraceOperationV2( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("operationId") String operationId, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/networkTraces/{operationId}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono>> getNetworkTracesV2( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("operationId") String operationId, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/newpassword") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> generateNewSitePublishingPassword( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/perfcounters") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listPerfMonCounters( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @QueryParam(value = "$filter", encoded = true) String filter, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/phplogging") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getSitePhpErrorLogFlag( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/premieraddons") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listPremierAddOns( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/premieraddons/{premierAddOnName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getPremierAddOn( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("premierAddOnName") String premierAddOnName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/premieraddons/{premierAddOnName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> addPremierAddOn( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("premierAddOnName") String premierAddOnName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") PremierAddOnInner premierAddOn, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/premieraddons/{premierAddOnName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deletePremierAddOn( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("premierAddOnName") String premierAddOnName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/premieraddons/{premierAddOnName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> updatePremierAddOn( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("premierAddOnName") String premierAddOnName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") PremierAddOnPatchResource premierAddOn, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/privateAccess/virtualNetworks") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getPrivateAccess( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/privateAccess/virtualNetworks") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> putPrivateAccessVnet( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") PrivateAccessInner access, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/processes") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listProcesses( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/processes/{processId}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getProcess( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("processId") String processId, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/processes/{processId}") - @ExpectedResponses({204, 404}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteProcess( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("processId") String processId, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/processes/{processId}/dump") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono getProcessDump( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("processId") String processId, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/processes/{processId}/modules") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listProcessModules( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("processId") String processId, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/processes/{processId}/modules/{baseAddress}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getProcessModule( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("processId") String processId, - @PathParam("baseAddress") String baseAddress, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/processes/{processId}/threads") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listProcessThreads( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("processId") String processId, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/processes/{processId}/threads/{threadId}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getProcessThread( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("processId") String processId, - @PathParam("threadId") String threadId, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/publicCertificates") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listPublicCertificates( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/publicCertificates/{publicCertificateName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getPublicCertificate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("publicCertificateName") String publicCertificateName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/publicCertificates/{publicCertificateName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> createOrUpdatePublicCertificate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("publicCertificateName") String publicCertificateName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") PublicCertificateInner publicCertificate, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/publicCertificates/{publicCertificateName}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deletePublicCertificate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("publicCertificateName") String publicCertificateName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/publishxml") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono listPublishingProfileXmlWithSecrets( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") CsmPublishingProfileOptions publishingProfileOptions, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/resetSlotConfig") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> resetProductionSlotConfig( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/restart") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> restart( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @QueryParam("softRestart") Boolean softRestart, - @QueryParam("synchronous") Boolean synchronous, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/restoreFromBackupBlob") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> restoreFromBackupBlob( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") RestoreRequestInner request, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/restoreFromDeletedApp") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> restoreFromDeletedApp( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") DeletedAppRestoreRequest restoreRequest, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/restoreSnapshot") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> restoreSnapshot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") SnapshotRestoreRequest restoreRequest, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/siteextensions") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listSiteExtensions( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/siteextensions/{siteExtensionId}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getSiteExtension( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("siteExtensionId") String siteExtensionId, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/siteextensions/{siteExtensionId}") - @ExpectedResponses({200, 201, 429}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> installSiteExtension( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("siteExtensionId") String siteExtensionId, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/siteextensions/{siteExtensionId}") - @ExpectedResponses({204, 404}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteSiteExtension( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("siteExtensionId") String siteExtensionId, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listSlots( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono>> createOrUpdateSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") SiteInner siteEnvelope, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}") - @ExpectedResponses({200, 204, 404}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @QueryParam("deleteMetrics") Boolean deleteMetrics, - @QueryParam("deleteEmptyServerFarm") Boolean deleteEmptyServerFarm, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> updateSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") SitePatchResourceInner siteEnvelope, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/analyzeCustomHostname") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> analyzeCustomHostnameSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @QueryParam("hostName") String hostname, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/applySlotConfig") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> applySlotConfigurationSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") CsmSlotEntity slotSwapEntity, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/backup") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> backupSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") BackupRequestInner request, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/backups") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listBackupsSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/backups/{backupId}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getBackupStatusSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("backupId") String backupId, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/backups/{backupId}") - @ExpectedResponses({200, 404}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteBackupSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("backupId") String backupId, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/backups/{backupId}/list") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listBackupStatusSecretsSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("backupId") String backupId, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") BackupRequestInner request, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/backups/{backupId}/restore") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> restoreSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("backupId") String backupId, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") RestoreRequestInner request, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/config") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listConfigurationsSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/config/appsettings") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> updateApplicationSettingsSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") StringDictionaryInner appSettings, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/config/appsettings/list") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listApplicationSettingsSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/config/authsettings") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> updateAuthSettingsSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") SiteAuthSettingsInner siteAuthSettings, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/config/authsettings/list") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getAuthSettingsSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/config/azurestorageaccounts") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> updateAzureStorageAccountsSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") AzureStoragePropertyDictionaryResourceInner azureStorageAccounts, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/config/azurestorageaccounts/list") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listAzureStorageAccountsSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/config/backup") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> updateBackupConfigurationSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") BackupRequestInner request, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/config/backup") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteBackupConfigurationSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/config/backup/list") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getBackupConfigurationSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/config/connectionstrings") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> updateConnectionStringsSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ConnectionStringDictionaryInner connectionStrings, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/config/connectionstrings/list") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listConnectionStringsSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/config/logs") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getDiagnosticLogsConfigurationSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/config/logs") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> updateDiagnosticLogsConfigSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") SiteLogsConfigInner siteLogsConfig, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/config/metadata") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> updateMetadataSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") StringDictionaryInner metadata, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/config/metadata/list") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listMetadataSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/config/publishingcredentials/list") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono>> listPublishingCredentialsSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/config/pushsettings") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> updateSitePushSettingsSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") PushSettingsInner pushSettings, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/config/pushsettings/list") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listSitePushSettingsSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/config/web") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getConfigurationSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/config/web") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> createOrUpdateConfigurationSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") SiteConfigResourceInner siteConfig, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/config/web") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> updateConfigurationSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") SiteConfigResourceInner siteConfig, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/config/web/snapshots") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listConfigurationSnapshotInfoSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/config/web/snapshots/{snapshotId}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getConfigurationSnapshotSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("snapshotId") String snapshotId, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/config/web/snapshots/{snapshotId}/recover") - @ExpectedResponses({204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> recoverSiteConfigurationSnapshotSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("snapshotId") String snapshotId, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/containerlogs") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono getWebSiteContainerLogsSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/containerlogs/zip/download") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono getContainerLogsZipSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/continuouswebjobs") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listContinuousWebJobsSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/continuouswebjobs/{webJobName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getContinuousWebJobSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("webJobName") String webJobName, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/continuouswebjobs/{webJobName}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteContinuousWebJobSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("webJobName") String webJobName, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/continuouswebjobs/{webJobName}/start") - @ExpectedResponses({200, 404}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> startContinuousWebJobSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("webJobName") String webJobName, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/continuouswebjobs/{webJobName}/stop") - @ExpectedResponses({200, 404}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> stopContinuousWebJobSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("webJobName") String webJobName, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/deployments") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listDeploymentsSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/deployments/{id}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getDeploymentSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("id") String id, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/deployments/{id}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> createDeploymentSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("id") String id, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") DeploymentInner deployment, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/deployments/{id}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteDeploymentSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("id") String id, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/deployments/{id}/log") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listDeploymentLogSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("id") String id, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/discoverbackup") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> discoverBackupSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") RestoreRequestInner request, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/domainOwnershipIdentifiers") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listDomainOwnershipIdentifiersSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getDomainOwnershipIdentifierSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("domainOwnershipIdentifierName") String domainOwnershipIdentifierName, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> createOrUpdateDomainOwnershipIdentifierSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("domainOwnershipIdentifierName") String domainOwnershipIdentifierName, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") IdentifierInner domainOwnershipIdentifier, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteDomainOwnershipIdentifierSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("domainOwnershipIdentifierName") String domainOwnershipIdentifierName, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> updateDomainOwnershipIdentifierSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("domainOwnershipIdentifierName") String domainOwnershipIdentifierName, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") IdentifierInner domainOwnershipIdentifier, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/extensions/MSDeploy") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getMSDeployStatusSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/extensions/MSDeploy") - @ExpectedResponses({201, 409}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createMSDeployOperationSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") MSDeploy mSDeploy, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/extensions/MSDeploy/log") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getMSDeployLogSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/functions") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listInstanceFunctionsSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/functions/admin/token") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getFunctionsAdminTokenSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/functions/{functionName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getInstanceFunctionSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("functionName") String functionName, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/functions/{functionName}") - @ExpectedResponses({201}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono>> createInstanceFunctionSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("functionName") String functionName, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") FunctionEnvelopeInner functionEnvelope, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/functions/{functionName}") - @ExpectedResponses({204, 404}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteInstanceFunctionSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("functionName") String functionName, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/functions/{functionName}/keys/{keyName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> createOrUpdateFunctionSecretSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("functionName") String functionName, - @PathParam("keyName") String keyName, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") KeyInfoInner key, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/functions/{functionName}/keys/{keyName}") - @ExpectedResponses({204, 404}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteFunctionSecretSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("functionName") String functionName, - @PathParam("keyName") String keyName, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/functions/{functionName}/listkeys") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listFunctionKeysSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("functionName") String functionName, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/functions/{functionName}/listsecrets") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listFunctionSecretsSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("functionName") String functionName, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/host/default/listkeys") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listHostKeysSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/host/default/listsyncstatus") - @ExpectedResponses({204}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listSyncStatusSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/host/default/sync") - @ExpectedResponses({204}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> syncFunctionsSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/host/default/{keyType}/{keyName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> createOrUpdateHostSecretSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("keyType") String keyType, - @PathParam("keyName") String keyName, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") KeyInfoInner key, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/host/default/{keyType}/{keyName}") - @ExpectedResponses({204, 404}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> deleteHostSecretSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("keyType") String keyType, - @PathParam("keyName") String keyName, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/hostNameBindings") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listHostnameBindingsSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/hostNameBindings/{hostName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getHostnameBindingSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("hostName") String hostname, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/hostNameBindings/{hostName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> createOrUpdateHostnameBindingSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("hostName") String hostname, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") HostnameBindingInner hostnameBinding, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/hostNameBindings/{hostName}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteHostnameBindingSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("hostName") String hostname, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getHybridConnectionSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("namespaceName") String namespaceName, - @PathParam("relayName") String relayName, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> createOrUpdateHybridConnectionSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("namespaceName") String namespaceName, - @PathParam("relayName") String relayName, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") HybridConnectionInner connectionEnvelope, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}") - @ExpectedResponses({200, 404}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteHybridConnectionSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("namespaceName") String namespaceName, - @PathParam("relayName") String relayName, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> updateHybridConnectionSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("namespaceName") String namespaceName, - @PathParam("relayName") String relayName, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") HybridConnectionInner connectionEnvelope, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}/listKeys") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listHybridConnectionKeysSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("namespaceName") String namespaceName, - @PathParam("relayName") String relayName, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/hybridConnectionRelays") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listHybridConnectionsSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/hybridconnection") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listRelayServiceConnectionsSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/hybridconnection/{entityName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getRelayServiceConnectionSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("entityName") String entityName, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/hybridconnection/{entityName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> createOrUpdateRelayServiceConnectionSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("entityName") String entityName, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") RelayServiceConnectionEntityInner connectionEnvelope, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/hybridconnection/{entityName}") - @ExpectedResponses({200, 404}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteRelayServiceConnectionSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("entityName") String entityName, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/hybridconnection/{entityName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> updateRelayServiceConnectionSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("entityName") String entityName, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") RelayServiceConnectionEntityInner connectionEnvelope, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/instances") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listInstanceIdentifiersSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/instances/{instanceId}/extensions/MSDeploy") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getInstanceMsDeployStatusSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("instanceId") String instanceId, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/instances/{instanceId}/extensions/MSDeploy") - @ExpectedResponses({201, 409}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createInstanceMSDeployOperationSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("instanceId") String instanceId, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") MSDeploy mSDeploy, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/instances/{instanceId}/extensions/MSDeploy/log") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getInstanceMSDeployLogSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("instanceId") String instanceId, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/instances/{instanceId}/processes") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listInstanceProcessesSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("instanceId") String instanceId, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/instances/{instanceId}/processes/{processId}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getInstanceProcessSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("processId") String processId, - @PathParam("slot") String slot, - @PathParam("instanceId") String instanceId, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/instances/{instanceId}/processes/{processId}") - @ExpectedResponses({204, 404}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteInstanceProcessSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("processId") String processId, - @PathParam("slot") String slot, - @PathParam("instanceId") String instanceId, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/instances/{instanceId}/processes/{processId}/dump") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono getInstanceProcessDumpSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("processId") String processId, - @PathParam("slot") String slot, - @PathParam("instanceId") String instanceId, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/instances/{instanceId}/processes/{processId}/modules") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listInstanceProcessModulesSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("processId") String processId, - @PathParam("slot") String slot, - @PathParam("instanceId") String instanceId, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/instances/{instanceId}/processes/{processId}/modules/{baseAddress}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getInstanceProcessModuleSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("processId") String processId, - @PathParam("baseAddress") String baseAddress, - @PathParam("slot") String slot, - @PathParam("instanceId") String instanceId, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/instances/{instanceId}/processes/{processId}/threads") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listInstanceProcessThreadsSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("processId") String processId, - @PathParam("slot") String slot, - @PathParam("instanceId") String instanceId, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/instances/{instanceId}/processes/{processId}/threads/{threadId}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getInstanceProcessThreadSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("processId") String processId, - @PathParam("threadId") String threadId, - @PathParam("slot") String slot, - @PathParam("instanceId") String instanceId, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/iscloneable") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> isCloneableSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/listsyncfunctiontriggerstatus") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listSyncFunctionTriggersSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/metricdefinitions") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listMetricDefinitionsSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/metrics") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listMetricsSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @QueryParam("details") Boolean details, - @QueryParam(value = "$filter", encoded = true) String filter, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/migratemysql/status") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getMigrateMySqlStatusSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/networkConfig/virtualNetwork") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getSwiftVirtualNetworkConnectionSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/networkConfig/virtualNetwork") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> createOrUpdateSwiftVirtualNetworkConnectionSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") SwiftVirtualNetworkInner connectionEnvelope, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/networkConfig/virtualNetwork") - @ExpectedResponses({200, 404}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteSwiftVirtualNetworkSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/networkConfig/virtualNetwork") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> updateSwiftVirtualNetworkConnectionSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") SwiftVirtualNetworkInner connectionEnvelope, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/networkFeatures/{view}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNetworkFeaturesSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("view") String view, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/networkTrace/operationresults/{operationId}") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getNetworkTraceOperationSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("operationId") String operationId, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/networkTrace/start") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> startWebSiteNetworkTraceSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @QueryParam("durationInSeconds") Integer durationInSeconds, - @PathParam("slot") String slot, - @QueryParam("maxFrameLength") Integer maxFrameLength, - @QueryParam("sasUrl") String sasUrl, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/networkTrace/startOperation") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono>> startWebSiteNetworkTraceOperationSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @QueryParam("durationInSeconds") Integer durationInSeconds, - @PathParam("slot") String slot, - @QueryParam("maxFrameLength") Integer maxFrameLength, - @QueryParam("sasUrl") String sasUrl, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/networkTrace/stop") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> stopWebSiteNetworkTraceSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/networkTrace/{operationId}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono>> getNetworkTracesSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("operationId") String operationId, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/networkTraces/current/operationresults/{operationId}") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getNetworkTraceOperationSlotV2( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("operationId") String operationId, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/networkTraces/{operationId}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono>> getNetworkTracesSlotV2( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("operationId") String operationId, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/newpassword") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> generateNewSitePublishingPasswordSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/perfcounters") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listPerfMonCountersSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @QueryParam(value = "$filter", encoded = true) String filter, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/phplogging") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getSitePhpErrorLogFlagSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/premieraddons") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listPremierAddOnsSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/premieraddons/{premierAddOnName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getPremierAddOnSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("premierAddOnName") String premierAddOnName, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/premieraddons/{premierAddOnName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> addPremierAddOnSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("premierAddOnName") String premierAddOnName, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") PremierAddOnInner premierAddOn, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/premieraddons/{premierAddOnName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deletePremierAddOnSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("premierAddOnName") String premierAddOnName, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/premieraddons/{premierAddOnName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> updatePremierAddOnSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("premierAddOnName") String premierAddOnName, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") PremierAddOnPatchResource premierAddOn, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/privateAccess/virtualNetworks") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getPrivateAccessSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/privateAccess/virtualNetworks") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> putPrivateAccessVnetSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") PrivateAccessInner access, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/processes") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listProcessesSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/processes/{processId}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getProcessSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("processId") String processId, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/processes/{processId}") - @ExpectedResponses({204, 404}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteProcessSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("processId") String processId, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/processes/{processId}/dump") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono getProcessDumpSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("processId") String processId, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/processes/{processId}/modules") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listProcessModulesSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("processId") String processId, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/processes/{processId}/modules/{baseAddress}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getProcessModuleSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("processId") String processId, - @PathParam("baseAddress") String baseAddress, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/processes/{processId}/threads") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listProcessThreadsSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("processId") String processId, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/processes/{processId}/threads/{threadId}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getProcessThreadSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("processId") String processId, - @PathParam("threadId") String threadId, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/publicCertificates") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listPublicCertificatesSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/publicCertificates/{publicCertificateName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getPublicCertificateSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("publicCertificateName") String publicCertificateName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/publicCertificates/{publicCertificateName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> createOrUpdatePublicCertificateSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("publicCertificateName") String publicCertificateName, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") PublicCertificateInner publicCertificate, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/publicCertificates/{publicCertificateName}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deletePublicCertificateSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("publicCertificateName") String publicCertificateName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/publishxml") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono listPublishingProfileXmlWithSecretsSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") CsmPublishingProfileOptions publishingProfileOptions, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/resetSlotConfig") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> resetSlotConfigurationSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/restart") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> restartSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @QueryParam("softRestart") Boolean softRestart, - @QueryParam("synchronous") Boolean synchronous, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/restoreFromBackupBlob") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> restoreFromBackupBlobSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") RestoreRequestInner request, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/restoreFromDeletedApp") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> restoreFromDeletedAppSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") DeletedAppRestoreRequest restoreRequest, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/restoreSnapshot") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> restoreSnapshotSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") SnapshotRestoreRequest restoreRequest, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/siteextensions") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listSiteExtensionsSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/siteextensions/{siteExtensionId}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getSiteExtensionSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("siteExtensionId") String siteExtensionId, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/siteextensions/{siteExtensionId}") - @ExpectedResponses({200, 201, 429}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> installSiteExtensionSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("siteExtensionId") String siteExtensionId, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/siteextensions/{siteExtensionId}") - @ExpectedResponses({204, 404}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteSiteExtensionSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("siteExtensionId") String siteExtensionId, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/slotsdiffs") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listSlotDifferencesSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") CsmSlotEntity slotSwapEntity, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/slotsswap") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> swapSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") CsmSlotEntity slotSwapEntity, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/snapshots") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listSnapshotsSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/snapshotsdr") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listSnapshotsFromDRSecondarySlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/sourcecontrols/web") - @ExpectedResponses({200, 201, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getSourceControlSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/sourcecontrols/web") - @ExpectedResponses({200, 201, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono>> createOrUpdateSourceControlSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") SiteSourceControlInner siteSourceControl, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/sourcecontrols/web") - @ExpectedResponses({200, 202, 404}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteSourceControlSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/sourcecontrols/web") - @ExpectedResponses({200, 201, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> updateSourceControlSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") SiteSourceControlInner siteSourceControl, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/start") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> startSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/startNetworkTrace") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono>> startNetworkTraceSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @QueryParam("durationInSeconds") Integer durationInSeconds, - @PathParam("slot") String slot, - @QueryParam("maxFrameLength") Integer maxFrameLength, - @QueryParam("sasUrl") String sasUrl, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/stop") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> stopSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/stopNetworkTrace") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> stopNetworkTraceSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/sync") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> syncRepositorySlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/syncfunctiontriggers") - @ExpectedResponses({204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> syncFunctionTriggersSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/triggeredwebjobs") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listTriggeredWebJobsSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/triggeredwebjobs/{webJobName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getTriggeredWebJobSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("webJobName") String webJobName, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/triggeredwebjobs/{webJobName}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteTriggeredWebJobSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("webJobName") String webJobName, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/triggeredwebjobs/{webJobName}/history") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listTriggeredWebJobHistorySlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("webJobName") String webJobName, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/triggeredwebjobs/{webJobName}/history/{id}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getTriggeredWebJobHistorySlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("webJobName") String webJobName, - @PathParam("id") String id, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/triggeredwebjobs/{webJobName}/run") - @ExpectedResponses({200, 404}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> runTriggeredWebJobSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("webJobName") String webJobName, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/usages") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listUsagesSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @QueryParam(value = "$filter", encoded = true) String filter, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/virtualNetworkConnections") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono>> listVnetConnectionsSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/virtualNetworkConnections/{vnetName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getVnetConnectionSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("vnetName") String vnetName, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/virtualNetworkConnections/{vnetName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> createOrUpdateVnetConnectionSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("vnetName") String vnetName, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") VnetInfoInner connectionEnvelope, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/virtualNetworkConnections/{vnetName}") - @ExpectedResponses({200, 404}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteVnetConnectionSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("vnetName") String vnetName, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/virtualNetworkConnections/{vnetName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> updateVnetConnectionSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("vnetName") String vnetName, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") VnetInfoInner connectionEnvelope, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getVnetConnectionGatewaySlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("vnetName") String vnetName, - @PathParam("gatewayName") String gatewayName, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> createOrUpdateVnetConnectionGatewaySlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("vnetName") String vnetName, - @PathParam("gatewayName") String gatewayName, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") VnetGatewayInner connectionEnvelope, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> updateVnetConnectionGatewaySlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("vnetName") String vnetName, - @PathParam("gatewayName") String gatewayName, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") VnetGatewayInner connectionEnvelope, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/webjobs") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listWebJobsSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/webjobs/{webJobName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getWebJobSlot( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("webJobName") String webJobName, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slotsdiffs") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listSlotDifferencesFromProduction( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") CsmSlotEntity slotSwapEntity, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slotsswap") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> swapSlotWithProduction( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") CsmSlotEntity slotSwapEntity, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/snapshots") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listSnapshots( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/snapshotsdr") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listSnapshotsFromDRSecondary( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/sourcecontrols/web") - @ExpectedResponses({200, 201, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getSourceControl( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/sourcecontrols/web") - @ExpectedResponses({200, 201, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono>> createOrUpdateSourceControl( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") SiteSourceControlInner siteSourceControl, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/sourcecontrols/web") - @ExpectedResponses({200, 202, 404}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteSourceControl( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/sourcecontrols/web") - @ExpectedResponses({200, 201, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> updateSourceControl( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") SiteSourceControlInner siteSourceControl, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/start") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> start( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/startNetworkTrace") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono>> startNetworkTrace( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @QueryParam("durationInSeconds") Integer durationInSeconds, - @QueryParam("maxFrameLength") Integer maxFrameLength, - @QueryParam("sasUrl") String sasUrl, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/stop") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> stop( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/stopNetworkTrace") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> stopNetworkTrace( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/sync") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> syncRepository( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/syncfunctiontriggers") - @ExpectedResponses({204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> syncFunctionTriggers( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/triggeredwebjobs") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listTriggeredWebJobs( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/triggeredwebjobs/{webJobName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getTriggeredWebJob( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("webJobName") String webJobName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/triggeredwebjobs/{webJobName}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteTriggeredWebJob( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("webJobName") String webJobName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/triggeredwebjobs/{webJobName}/history") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listTriggeredWebJobHistory( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("webJobName") String webJobName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/triggeredwebjobs/{webJobName}/history/{id}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getTriggeredWebJobHistory( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("webJobName") String webJobName, - @PathParam("id") String id, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/triggeredwebjobs/{webJobName}/run") - @ExpectedResponses({200, 404}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> runTriggeredWebJob( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("webJobName") String webJobName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/usages") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listUsages( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @QueryParam(value = "$filter", encoded = true) String filter, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/virtualNetworkConnections") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono>> listVnetConnections( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/virtualNetworkConnections/{vnetName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getVnetConnection( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("vnetName") String vnetName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/virtualNetworkConnections/{vnetName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> createOrUpdateVnetConnection( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("vnetName") String vnetName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") VnetInfoInner connectionEnvelope, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/virtualNetworkConnections/{vnetName}") - @ExpectedResponses({200, 404}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteVnetConnection( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("vnetName") String vnetName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/virtualNetworkConnections/{vnetName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> updateVnetConnection( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("vnetName") String vnetName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") VnetInfoInner connectionEnvelope, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getVnetConnectionGateway( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("vnetName") String vnetName, - @PathParam("gatewayName") String gatewayName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> createOrUpdateVnetConnectionGateway( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("vnetName") String vnetName, - @PathParam("gatewayName") String gatewayName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") VnetGatewayInner connectionEnvelope, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> updateVnetConnectionGateway( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("vnetName") String vnetName, - @PathParam("gatewayName") String gatewayName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") VnetGatewayInner connectionEnvelope, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/webjobs") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listWebJobs( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/webjobs/{webJobName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getWebJob( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("webJobName") String webJobName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listBackupsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listConfigurationsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listConfigurationSnapshotInfoNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listContinuousWebJobsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listDeploymentsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listDomainOwnershipIdentifiersNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listFunctionsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listHostnameBindingsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listInstanceIdentifiersNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listInstanceProcessesNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listInstanceProcessModulesNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listInstanceProcessThreadsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listMetricDefinitionsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listMetricsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listPerfMonCountersNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listProcessesNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listProcessModulesNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listProcessThreadsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listPublicCertificatesNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listSiteExtensionsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listSlotsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listBackupsSlotNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listConfigurationsSlotNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listConfigurationSnapshotInfoSlotNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listContinuousWebJobsSlotNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listDeploymentsSlotNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listDomainOwnershipIdentifiersSlotNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listInstanceFunctionsSlotNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listHostnameBindingsSlotNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listInstanceIdentifiersSlotNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listInstanceProcessesSlotNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listInstanceProcessModulesSlotNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listInstanceProcessThreadsSlotNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listMetricDefinitionsSlotNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listMetricsSlotNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listPerfMonCountersSlotNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listProcessesSlotNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listProcessModulesSlotNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listProcessThreadsSlotNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listPublicCertificatesSlotNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listSiteExtensionsSlotNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listSlotDifferencesSlotNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listSnapshotsSlotNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listSnapshotsFromDRSecondarySlotNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listTriggeredWebJobsSlotNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listTriggeredWebJobHistorySlotNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listUsagesSlotNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listWebJobsSlotNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listSlotDifferencesFromProductionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listSnapshotsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listSnapshotsFromDRSecondaryNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listTriggeredWebJobsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listTriggeredWebJobHistoryNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listUsagesNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listWebJobsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Get all apps for a subscription. - * - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all apps for a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get all apps for a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all apps for a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get all apps for a subscription. - * - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all apps for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Get all apps for a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all apps for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Get all apps for a subscription. - * - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all apps for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Get all apps for a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all apps for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Gets all web, mobile, and API apps in the specified resource group. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param includeSlots Specify <strong>true</strong> to include deployment slots in results. The default - * is false, which only gives you the production slot of all apps. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all web, mobile, and API apps in the specified resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Boolean includeSlots) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - includeSlots, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all web, mobile, and API apps in the specified resource group. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param includeSlots Specify <strong>true</strong> to include deployment slots in results. The default - * is false, which only gives you the production slot of all apps. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all web, mobile, and API apps in the specified resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Boolean includeSlots, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - includeSlots, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all web, mobile, and API apps in the specified resource group. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param includeSlots Specify <strong>true</strong> to include deployment slots in results. The default - * is false, which only gives you the production slot of all apps. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all web, mobile, and API apps in the specified resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName, Boolean includeSlots) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, includeSlots), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * Gets all web, mobile, and API apps in the specified resource group. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all web, mobile, and API apps in the specified resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - final Boolean includeSlots = null; - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, includeSlots), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * Gets all web, mobile, and API apps in the specified resource group. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param includeSlots Specify <strong>true</strong> to include deployment slots in results. The default - * is false, which only gives you the production slot of all apps. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all web, mobile, and API apps in the specified resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync( - String resourceGroupName, Boolean includeSlots, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, includeSlots, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all web, mobile, and API apps in the specified resource group. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all web, mobile, and API apps in the specified resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - final Boolean includeSlots = null; - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, includeSlots)); - } - - /** - * Gets all web, mobile, and API apps in the specified resource group. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param includeSlots Specify <strong>true</strong> to include deployment slots in results. The default - * is false, which only gives you the production slot of all apps. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all web, mobile, and API apps in the specified resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup( - String resourceGroupName, Boolean includeSlots, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, includeSlots, context)); - } - - /** - * Gets the details of a web, mobile, or API app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of a web, mobile, or API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the details of a web, mobile, or API app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of a web, mobile, or API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets the details of a web, mobile, or API app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of a web, mobile, or API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync(String resourceGroupName, String name) { - return getByResourceGroupWithResponseAsync(resourceGroupName, name) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the details of a web, mobile, or API app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of a web, mobile, or API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SiteInner getByResourceGroup(String resourceGroupName, String name) { - return getByResourceGroupAsync(resourceGroupName, name).block(); - } - - /** - * Gets the details of a web, mobile, or API app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of a web, mobile, or API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); - } - - /** - * Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} - * parameter. - * @param siteEnvelope A JSON representation of the app properties. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a web app, a mobile app backend, or an API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String name, SiteInner siteEnvelope) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (siteEnvelope == null) { - return Mono.error(new IllegalArgumentException("Parameter siteEnvelope is required and cannot be null.")); - } else { - siteEnvelope.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - siteEnvelope, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} - * parameter. - * @param siteEnvelope A JSON representation of the app properties. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a web app, a mobile app backend, or an API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String name, SiteInner siteEnvelope, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (siteEnvelope == null) { - return Mono.error(new IllegalArgumentException("Parameter siteEnvelope is required and cannot be null.")); - } else { - siteEnvelope.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - siteEnvelope, - accept, - context); - } - - /** - * Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} - * parameter. - * @param siteEnvelope A JSON representation of the app properties. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a web app, a mobile app backend, or an API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, SiteInner> beginCreateOrUpdateAsync( - String resourceGroupName, String name, SiteInner siteEnvelope) { - Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, name, siteEnvelope); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), SiteInner.class, SiteInner.class, this.client.getContext()); - } - - /** - * Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} - * parameter. - * @param siteEnvelope A JSON representation of the app properties. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a web app, a mobile app backend, or an API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, SiteInner> beginCreateOrUpdateAsync( - String resourceGroupName, String name, SiteInner siteEnvelope, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, name, siteEnvelope, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), SiteInner.class, SiteInner.class, context); - } - - /** - * Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} - * parameter. - * @param siteEnvelope A JSON representation of the app properties. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a web app, a mobile app backend, or an API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, SiteInner> beginCreateOrUpdate( - String resourceGroupName, String name, SiteInner siteEnvelope) { - return beginCreateOrUpdateAsync(resourceGroupName, name, siteEnvelope).getSyncPoller(); - } - - /** - * Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} - * parameter. - * @param siteEnvelope A JSON representation of the app properties. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a web app, a mobile app backend, or an API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, SiteInner> beginCreateOrUpdate( - String resourceGroupName, String name, SiteInner siteEnvelope, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, name, siteEnvelope, context).getSyncPoller(); - } - - /** - * Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} - * parameter. - * @param siteEnvelope A JSON representation of the app properties. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a web app, a mobile app backend, or an API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync(String resourceGroupName, String name, SiteInner siteEnvelope) { - return beginCreateOrUpdateAsync(resourceGroupName, name, siteEnvelope) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} - * parameter. - * @param siteEnvelope A JSON representation of the app properties. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a web app, a mobile app backend, or an API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String name, SiteInner siteEnvelope, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, name, siteEnvelope, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} - * parameter. - * @param siteEnvelope A JSON representation of the app properties. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a web app, a mobile app backend, or an API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SiteInner createOrUpdate(String resourceGroupName, String name, SiteInner siteEnvelope) { - return createOrUpdateAsync(resourceGroupName, name, siteEnvelope).block(); - } - - /** - * Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} - * parameter. - * @param siteEnvelope A JSON representation of the app properties. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a web app, a mobile app backend, or an API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SiteInner createOrUpdate(String resourceGroupName, String name, SiteInner siteEnvelope, Context context) { - return createOrUpdateAsync(resourceGroupName, name, siteEnvelope, context).block(); - } - - /** - * Deletes a web, mobile, or API app, or one of the deployment slots. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app to delete. - * @param deleteMetrics If true, web app metrics are also deleted. - * @param deleteEmptyServerFarm Specify false if you want to keep empty App Service plan. By default, empty App - * Service plan is deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync( - String resourceGroupName, String name, Boolean deleteMetrics, Boolean deleteEmptyServerFarm) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - name, - deleteMetrics, - deleteEmptyServerFarm, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a web, mobile, or API app, or one of the deployment slots. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app to delete. - * @param deleteMetrics If true, web app metrics are also deleted. - * @param deleteEmptyServerFarm Specify false if you want to keep empty App Service plan. By default, empty App - * Service plan is deleted. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String name, Boolean deleteMetrics, Boolean deleteEmptyServerFarm, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - name, - deleteMetrics, - deleteEmptyServerFarm, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Deletes a web, mobile, or API app, or one of the deployment slots. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app to delete. - * @param deleteMetrics If true, web app metrics are also deleted. - * @param deleteEmptyServerFarm Specify false if you want to keep empty App Service plan. By default, empty App - * Service plan is deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync( - String resourceGroupName, String name, Boolean deleteMetrics, Boolean deleteEmptyServerFarm) { - return deleteWithResponseAsync(resourceGroupName, name, deleteMetrics, deleteEmptyServerFarm) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes a web, mobile, or API app, or one of the deployment slots. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app to delete. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String name) { - final Boolean deleteMetrics = null; - final Boolean deleteEmptyServerFarm = null; - return deleteWithResponseAsync(resourceGroupName, name, deleteMetrics, deleteEmptyServerFarm) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes a web, mobile, or API app, or one of the deployment slots. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app to delete. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String name) { - final Boolean deleteMetrics = null; - final Boolean deleteEmptyServerFarm = null; - deleteAsync(resourceGroupName, name, deleteMetrics, deleteEmptyServerFarm).block(); - } - - /** - * Deletes a web, mobile, or API app, or one of the deployment slots. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app to delete. - * @param deleteMetrics If true, web app metrics are also deleted. - * @param deleteEmptyServerFarm Specify false if you want to keep empty App Service plan. By default, empty App - * Service plan is deleted. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse( - String resourceGroupName, String name, Boolean deleteMetrics, Boolean deleteEmptyServerFarm, Context context) { - return deleteWithResponseAsync(resourceGroupName, name, deleteMetrics, deleteEmptyServerFarm, context).block(); - } - - /** - * Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} - * parameter. - * @param siteEnvelope A JSON representation of the app properties. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a web app, a mobile app backend, or an API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateWithResponseAsync( - String resourceGroupName, String name, SitePatchResourceInner siteEnvelope) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (siteEnvelope == null) { - return Mono.error(new IllegalArgumentException("Parameter siteEnvelope is required and cannot be null.")); - } else { - siteEnvelope.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - siteEnvelope, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} - * parameter. - * @param siteEnvelope A JSON representation of the app properties. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a web app, a mobile app backend, or an API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, String name, SitePatchResourceInner siteEnvelope, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (siteEnvelope == null) { - return Mono.error(new IllegalArgumentException("Parameter siteEnvelope is required and cannot be null.")); - } else { - siteEnvelope.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - siteEnvelope, - accept, - context); - } - - /** - * Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} - * parameter. - * @param siteEnvelope A JSON representation of the app properties. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a web app, a mobile app backend, or an API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync(String resourceGroupName, String name, SitePatchResourceInner siteEnvelope) { - return updateWithResponseAsync(resourceGroupName, name, siteEnvelope) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} - * parameter. - * @param siteEnvelope A JSON representation of the app properties. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a web app, a mobile app backend, or an API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SiteInner update(String resourceGroupName, String name, SitePatchResourceInner siteEnvelope) { - return updateAsync(resourceGroupName, name, siteEnvelope).block(); - } - - /** - * Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} - * parameter. - * @param siteEnvelope A JSON representation of the app properties. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a web app, a mobile app backend, or an API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, String name, SitePatchResourceInner siteEnvelope, Context context) { - return updateWithResponseAsync(resourceGroupName, name, siteEnvelope, context).block(); - } - - /** - * Analyze a custom hostname. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param hostname Custom hostname. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return custom domain analysis. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> analyzeCustomHostnameWithResponseAsync( - String resourceGroupName, String name, String hostname) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .analyzeCustomHostname( - this.client.getEndpoint(), - resourceGroupName, - name, - hostname, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Analyze a custom hostname. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param hostname Custom hostname. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return custom domain analysis. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> analyzeCustomHostnameWithResponseAsync( - String resourceGroupName, String name, String hostname, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .analyzeCustomHostname( - this.client.getEndpoint(), - resourceGroupName, - name, - hostname, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Analyze a custom hostname. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param hostname Custom hostname. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return custom domain analysis. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono analyzeCustomHostnameAsync( - String resourceGroupName, String name, String hostname) { - return analyzeCustomHostnameWithResponseAsync(resourceGroupName, name, hostname) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Analyze a custom hostname. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return custom domain analysis. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono analyzeCustomHostnameAsync(String resourceGroupName, String name) { - final String hostname = null; - return analyzeCustomHostnameWithResponseAsync(resourceGroupName, name, hostname) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Analyze a custom hostname. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return custom domain analysis. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CustomHostnameAnalysisResultInner analyzeCustomHostname(String resourceGroupName, String name) { - final String hostname = null; - return analyzeCustomHostnameAsync(resourceGroupName, name, hostname).block(); - } - - /** - * Analyze a custom hostname. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param hostname Custom hostname. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return custom domain analysis. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response analyzeCustomHostnameWithResponse( - String resourceGroupName, String name, String hostname, Context context) { - return analyzeCustomHostnameWithResponseAsync(resourceGroupName, name, hostname, context).block(); - } - - /** - * Applies the configuration settings from the target slot onto the current slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slotSwapEntity JSON object that contains the target slot name. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> applySlotConfigToProductionWithResponseAsync( - String resourceGroupName, String name, CsmSlotEntity slotSwapEntity) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (slotSwapEntity == null) { - return Mono.error(new IllegalArgumentException("Parameter slotSwapEntity is required and cannot be null.")); - } else { - slotSwapEntity.validate(); - } - return FluxUtil - .withContext( - context -> - service - .applySlotConfigToProduction( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - slotSwapEntity, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Applies the configuration settings from the target slot onto the current slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slotSwapEntity JSON object that contains the target slot name. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> applySlotConfigToProductionWithResponseAsync( - String resourceGroupName, String name, CsmSlotEntity slotSwapEntity, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (slotSwapEntity == null) { - return Mono.error(new IllegalArgumentException("Parameter slotSwapEntity is required and cannot be null.")); - } else { - slotSwapEntity.validate(); - } - context = this.client.mergeContext(context); - return service - .applySlotConfigToProduction( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - slotSwapEntity, - context); - } - - /** - * Applies the configuration settings from the target slot onto the current slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slotSwapEntity JSON object that contains the target slot name. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono applySlotConfigToProductionAsync( - String resourceGroupName, String name, CsmSlotEntity slotSwapEntity) { - return applySlotConfigToProductionWithResponseAsync(resourceGroupName, name, slotSwapEntity) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Applies the configuration settings from the target slot onto the current slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slotSwapEntity JSON object that contains the target slot name. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void applySlotConfigToProduction(String resourceGroupName, String name, CsmSlotEntity slotSwapEntity) { - applySlotConfigToProductionAsync(resourceGroupName, name, slotSwapEntity).block(); - } - - /** - * Applies the configuration settings from the target slot onto the current slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slotSwapEntity JSON object that contains the target slot name. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response applySlotConfigToProductionWithResponse( - String resourceGroupName, String name, CsmSlotEntity slotSwapEntity, Context context) { - return applySlotConfigToProductionWithResponseAsync(resourceGroupName, name, slotSwapEntity, context).block(); - } - - /** - * Creates a backup of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param request Backup configuration. You can use the JSON response from the POST action as input here. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup description. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> backupWithResponseAsync( - String resourceGroupName, String name, BackupRequestInner request) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (request == null) { - return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); - } else { - request.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .backup( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - request, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates a backup of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param request Backup configuration. You can use the JSON response from the POST action as input here. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup description. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> backupWithResponseAsync( - String resourceGroupName, String name, BackupRequestInner request, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (request == null) { - return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); - } else { - request.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .backup( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - request, - accept, - context); - } - - /** - * Creates a backup of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param request Backup configuration. You can use the JSON response from the POST action as input here. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup description. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono backupAsync(String resourceGroupName, String name, BackupRequestInner request) { - return backupWithResponseAsync(resourceGroupName, name, request) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates a backup of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param request Backup configuration. You can use the JSON response from the POST action as input here. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup description. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BackupItemInner backup(String resourceGroupName, String name, BackupRequestInner request) { - return backupAsync(resourceGroupName, name, request).block(); - } - - /** - * Creates a backup of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param request Backup configuration. You can use the JSON response from the POST action as input here. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup description. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response backupWithResponse( - String resourceGroupName, String name, BackupRequestInner request, Context context) { - return backupWithResponseAsync(resourceGroupName, name, request, context).block(); - } - - /** - * Gets existing backups of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return existing backups of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBackupsSinglePageAsync(String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listBackups( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets existing backups of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return existing backups of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBackupsSinglePageAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listBackups( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets existing backups of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return existing backups of an app. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listBackupsAsync(String resourceGroupName, String name) { - return new PagedFlux<>( - () -> listBackupsSinglePageAsync(resourceGroupName, name), - nextLink -> listBackupsNextSinglePageAsync(nextLink)); - } - - /** - * Gets existing backups of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return existing backups of an app. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listBackupsAsync(String resourceGroupName, String name, Context context) { - return new PagedFlux<>( - () -> listBackupsSinglePageAsync(resourceGroupName, name, context), - nextLink -> listBackupsNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets existing backups of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return existing backups of an app. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listBackups(String resourceGroupName, String name) { - return new PagedIterable<>(listBackupsAsync(resourceGroupName, name)); - } - - /** - * Gets existing backups of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return existing backups of an app. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listBackups(String resourceGroupName, String name, Context context) { - return new PagedIterable<>(listBackupsAsync(resourceGroupName, name, context)); - } - - /** - * Gets a backup of an app by its ID. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a backup of an app by its ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getBackupStatusWithResponseAsync( - String resourceGroupName, String name, String backupId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (backupId == null) { - return Mono.error(new IllegalArgumentException("Parameter backupId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getBackupStatus( - this.client.getEndpoint(), - resourceGroupName, - name, - backupId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a backup of an app by its ID. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a backup of an app by its ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getBackupStatusWithResponseAsync( - String resourceGroupName, String name, String backupId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (backupId == null) { - return Mono.error(new IllegalArgumentException("Parameter backupId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getBackupStatus( - this.client.getEndpoint(), - resourceGroupName, - name, - backupId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets a backup of an app by its ID. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a backup of an app by its ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getBackupStatusAsync(String resourceGroupName, String name, String backupId) { - return getBackupStatusWithResponseAsync(resourceGroupName, name, backupId) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a backup of an app by its ID. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a backup of an app by its ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BackupItemInner getBackupStatus(String resourceGroupName, String name, String backupId) { - return getBackupStatusAsync(resourceGroupName, name, backupId).block(); - } - - /** - * Gets a backup of an app by its ID. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a backup of an app by its ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getBackupStatusWithResponse( - String resourceGroupName, String name, String backupId, Context context) { - return getBackupStatusWithResponseAsync(resourceGroupName, name, backupId, context).block(); - } - - /** - * Deletes a backup of an app by its ID. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteBackupWithResponseAsync(String resourceGroupName, String name, String backupId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (backupId == null) { - return Mono.error(new IllegalArgumentException("Parameter backupId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .deleteBackup( - this.client.getEndpoint(), - resourceGroupName, - name, - backupId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a backup of an app by its ID. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteBackupWithResponseAsync( - String resourceGroupName, String name, String backupId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (backupId == null) { - return Mono.error(new IllegalArgumentException("Parameter backupId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .deleteBackup( - this.client.getEndpoint(), - resourceGroupName, - name, - backupId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Deletes a backup of an app by its ID. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteBackupAsync(String resourceGroupName, String name, String backupId) { - return deleteBackupWithResponseAsync(resourceGroupName, name, backupId) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes a backup of an app by its ID. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteBackup(String resourceGroupName, String name, String backupId) { - deleteBackupAsync(resourceGroupName, name, backupId).block(); - } - - /** - * Deletes a backup of an app by its ID. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteBackupWithResponse( - String resourceGroupName, String name, String backupId, Context context) { - return deleteBackupWithResponseAsync(resourceGroupName, name, backupId, context).block(); - } - - /** - * Gets status of a web app backup that may be in progress, including secrets associated with the backup, such as - * the Azure Storage SAS URL. Also can be used to update the SAS URL for the backup if a new URL is passed in the - * request body. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param backupId ID of backup. - * @param request Information on backup request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return status of a web app backup that may be in progress, including secrets associated with the backup, such as - * the Azure Storage SAS URL. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listBackupStatusSecretsWithResponseAsync( - String resourceGroupName, String name, String backupId, BackupRequestInner request) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (backupId == null) { - return Mono.error(new IllegalArgumentException("Parameter backupId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (request == null) { - return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); - } else { - request.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listBackupStatusSecrets( - this.client.getEndpoint(), - resourceGroupName, - name, - backupId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - request, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets status of a web app backup that may be in progress, including secrets associated with the backup, such as - * the Azure Storage SAS URL. Also can be used to update the SAS URL for the backup if a new URL is passed in the - * request body. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param backupId ID of backup. - * @param request Information on backup request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return status of a web app backup that may be in progress, including secrets associated with the backup, such as - * the Azure Storage SAS URL. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBackupStatusSecretsWithResponseAsync( - String resourceGroupName, String name, String backupId, BackupRequestInner request, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (backupId == null) { - return Mono.error(new IllegalArgumentException("Parameter backupId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (request == null) { - return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); - } else { - request.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listBackupStatusSecrets( - this.client.getEndpoint(), - resourceGroupName, - name, - backupId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - request, - accept, - context); - } - - /** - * Gets status of a web app backup that may be in progress, including secrets associated with the backup, such as - * the Azure Storage SAS URL. Also can be used to update the SAS URL for the backup if a new URL is passed in the - * request body. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param backupId ID of backup. - * @param request Information on backup request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return status of a web app backup that may be in progress, including secrets associated with the backup, such as - * the Azure Storage SAS URL. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listBackupStatusSecretsAsync( - String resourceGroupName, String name, String backupId, BackupRequestInner request) { - return listBackupStatusSecretsWithResponseAsync(resourceGroupName, name, backupId, request) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets status of a web app backup that may be in progress, including secrets associated with the backup, such as - * the Azure Storage SAS URL. Also can be used to update the SAS URL for the backup if a new URL is passed in the - * request body. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param backupId ID of backup. - * @param request Information on backup request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return status of a web app backup that may be in progress, including secrets associated with the backup, such as - * the Azure Storage SAS URL. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BackupItemInner listBackupStatusSecrets( - String resourceGroupName, String name, String backupId, BackupRequestInner request) { - return listBackupStatusSecretsAsync(resourceGroupName, name, backupId, request).block(); - } - - /** - * Gets status of a web app backup that may be in progress, including secrets associated with the backup, such as - * the Azure Storage SAS URL. Also can be used to update the SAS URL for the backup if a new URL is passed in the - * request body. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param backupId ID of backup. - * @param request Information on backup request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return status of a web app backup that may be in progress, including secrets associated with the backup, such as - * the Azure Storage SAS URL. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listBackupStatusSecretsWithResponse( - String resourceGroupName, String name, String backupId, BackupRequestInner request, Context context) { - return listBackupStatusSecretsWithResponseAsync(resourceGroupName, name, backupId, request, context).block(); - } - - /** - * Restores a specific backup to another app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param request Information on restore request . - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> restoreWithResponseAsync( - String resourceGroupName, String name, String backupId, RestoreRequestInner request) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (backupId == null) { - return Mono.error(new IllegalArgumentException("Parameter backupId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (request == null) { - return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); - } else { - request.validate(); - } - return FluxUtil - .withContext( - context -> - service - .restore( - this.client.getEndpoint(), - resourceGroupName, - name, - backupId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - request, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Restores a specific backup to another app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param request Information on restore request . - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> restoreWithResponseAsync( - String resourceGroupName, String name, String backupId, RestoreRequestInner request, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (backupId == null) { - return Mono.error(new IllegalArgumentException("Parameter backupId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (request == null) { - return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); - } else { - request.validate(); - } - context = this.client.mergeContext(context); - return service - .restore( - this.client.getEndpoint(), - resourceGroupName, - name, - backupId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - request, - context); - } - - /** - * Restores a specific backup to another app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param request Information on restore request . - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginRestoreAsync( - String resourceGroupName, String name, String backupId, RestoreRequestInner request) { - Mono>> mono = restoreWithResponseAsync(resourceGroupName, name, backupId, request); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Restores a specific backup to another app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param request Information on restore request . - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginRestoreAsync( - String resourceGroupName, String name, String backupId, RestoreRequestInner request, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - restoreWithResponseAsync(resourceGroupName, name, backupId, request, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Restores a specific backup to another app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param request Information on restore request . - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginRestore( - String resourceGroupName, String name, String backupId, RestoreRequestInner request) { - return beginRestoreAsync(resourceGroupName, name, backupId, request).getSyncPoller(); - } - - /** - * Restores a specific backup to another app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param request Information on restore request . - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginRestore( - String resourceGroupName, String name, String backupId, RestoreRequestInner request, Context context) { - return beginRestoreAsync(resourceGroupName, name, backupId, request, context).getSyncPoller(); - } - - /** - * Restores a specific backup to another app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param request Information on restore request . - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono restoreAsync( - String resourceGroupName, String name, String backupId, RestoreRequestInner request) { - return beginRestoreAsync(resourceGroupName, name, backupId, request) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Restores a specific backup to another app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param request Information on restore request . - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono restoreAsync( - String resourceGroupName, String name, String backupId, RestoreRequestInner request, Context context) { - return beginRestoreAsync(resourceGroupName, name, backupId, request, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Restores a specific backup to another app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param request Information on restore request . - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void restore(String resourceGroupName, String name, String backupId, RestoreRequestInner request) { - restoreAsync(resourceGroupName, name, backupId, request).block(); - } - - /** - * Restores a specific backup to another app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param request Information on restore request . - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void restore( - String resourceGroupName, String name, String backupId, RestoreRequestInner request, Context context) { - restoreAsync(resourceGroupName, name, backupId, request, context).block(); - } - - /** - * List the configurations of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of site configurations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listConfigurationsSinglePageAsync( - String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listConfigurations( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List the configurations of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of site configurations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listConfigurationsSinglePageAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listConfigurations( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * List the configurations of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of site configurations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listConfigurationsAsync(String resourceGroupName, String name) { - return new PagedFlux<>( - () -> listConfigurationsSinglePageAsync(resourceGroupName, name), - nextLink -> listConfigurationsNextSinglePageAsync(nextLink)); - } - - /** - * List the configurations of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of site configurations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listConfigurationsAsync( - String resourceGroupName, String name, Context context) { - return new PagedFlux<>( - () -> listConfigurationsSinglePageAsync(resourceGroupName, name, context), - nextLink -> listConfigurationsNextSinglePageAsync(nextLink, context)); - } - - /** - * List the configurations of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of site configurations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listConfigurations(String resourceGroupName, String name) { - return new PagedIterable<>(listConfigurationsAsync(resourceGroupName, name)); - } - - /** - * List the configurations of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of site configurations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listConfigurations( - String resourceGroupName, String name, Context context) { - return new PagedIterable<>(listConfigurationsAsync(resourceGroupName, name, context)); - } - - /** - * Replaces the application settings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param appSettings Application settings of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return string dictionary resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateApplicationSettingsWithResponseAsync( - String resourceGroupName, String name, StringDictionaryInner appSettings) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (appSettings == null) { - return Mono.error(new IllegalArgumentException("Parameter appSettings is required and cannot be null.")); - } else { - appSettings.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updateApplicationSettings( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - appSettings, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Replaces the application settings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param appSettings Application settings of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return string dictionary resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateApplicationSettingsWithResponseAsync( - String resourceGroupName, String name, StringDictionaryInner appSettings, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (appSettings == null) { - return Mono.error(new IllegalArgumentException("Parameter appSettings is required and cannot be null.")); - } else { - appSettings.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updateApplicationSettings( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - appSettings, - accept, - context); - } - - /** - * Replaces the application settings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param appSettings Application settings of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return string dictionary resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateApplicationSettingsAsync( - String resourceGroupName, String name, StringDictionaryInner appSettings) { - return updateApplicationSettingsWithResponseAsync(resourceGroupName, name, appSettings) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Replaces the application settings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param appSettings Application settings of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return string dictionary resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public StringDictionaryInner updateApplicationSettings( - String resourceGroupName, String name, StringDictionaryInner appSettings) { - return updateApplicationSettingsAsync(resourceGroupName, name, appSettings).block(); - } - - /** - * Replaces the application settings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param appSettings Application settings of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return string dictionary resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateApplicationSettingsWithResponse( - String resourceGroupName, String name, StringDictionaryInner appSettings, Context context) { - return updateApplicationSettingsWithResponseAsync(resourceGroupName, name, appSettings, context).block(); - } - - /** - * Gets the application settings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the application settings of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listApplicationSettingsWithResponseAsync( - String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listApplicationSettings( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the application settings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the application settings of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listApplicationSettingsWithResponseAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listApplicationSettings( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets the application settings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the application settings of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listApplicationSettingsAsync(String resourceGroupName, String name) { - return listApplicationSettingsWithResponseAsync(resourceGroupName, name) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the application settings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the application settings of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public StringDictionaryInner listApplicationSettings(String resourceGroupName, String name) { - return listApplicationSettingsAsync(resourceGroupName, name).block(); - } - - /** - * Gets the application settings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the application settings of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listApplicationSettingsWithResponse( - String resourceGroupName, String name, Context context) { - return listApplicationSettingsWithResponseAsync(resourceGroupName, name, context).block(); - } - - /** - * Updates the Authentication / Authorization settings associated with web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param siteAuthSettings Auth settings associated with web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration settings for the Azure App Service Authentication / Authorization feature. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateAuthSettingsWithResponseAsync( - String resourceGroupName, String name, SiteAuthSettingsInner siteAuthSettings) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (siteAuthSettings == null) { - return Mono - .error(new IllegalArgumentException("Parameter siteAuthSettings is required and cannot be null.")); - } else { - siteAuthSettings.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updateAuthSettings( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - siteAuthSettings, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates the Authentication / Authorization settings associated with web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param siteAuthSettings Auth settings associated with web app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration settings for the Azure App Service Authentication / Authorization feature. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateAuthSettingsWithResponseAsync( - String resourceGroupName, String name, SiteAuthSettingsInner siteAuthSettings, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (siteAuthSettings == null) { - return Mono - .error(new IllegalArgumentException("Parameter siteAuthSettings is required and cannot be null.")); - } else { - siteAuthSettings.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updateAuthSettings( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - siteAuthSettings, - accept, - context); - } - - /** - * Updates the Authentication / Authorization settings associated with web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param siteAuthSettings Auth settings associated with web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration settings for the Azure App Service Authentication / Authorization feature. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAuthSettingsAsync( - String resourceGroupName, String name, SiteAuthSettingsInner siteAuthSettings) { - return updateAuthSettingsWithResponseAsync(resourceGroupName, name, siteAuthSettings) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Updates the Authentication / Authorization settings associated with web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param siteAuthSettings Auth settings associated with web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration settings for the Azure App Service Authentication / Authorization feature. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SiteAuthSettingsInner updateAuthSettings( - String resourceGroupName, String name, SiteAuthSettingsInner siteAuthSettings) { - return updateAuthSettingsAsync(resourceGroupName, name, siteAuthSettings).block(); - } - - /** - * Updates the Authentication / Authorization settings associated with web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param siteAuthSettings Auth settings associated with web app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration settings for the Azure App Service Authentication / Authorization feature. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateAuthSettingsWithResponse( - String resourceGroupName, String name, SiteAuthSettingsInner siteAuthSettings, Context context) { - return updateAuthSettingsWithResponseAsync(resourceGroupName, name, siteAuthSettings, context).block(); - } - - /** - * Gets the Authentication/Authorization settings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Authentication/Authorization settings of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getAuthSettingsWithResponseAsync( - String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getAuthSettings( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the Authentication/Authorization settings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Authentication/Authorization settings of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getAuthSettingsWithResponseAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getAuthSettings( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets the Authentication/Authorization settings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Authentication/Authorization settings of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAuthSettingsAsync(String resourceGroupName, String name) { - return getAuthSettingsWithResponseAsync(resourceGroupName, name) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the Authentication/Authorization settings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Authentication/Authorization settings of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SiteAuthSettingsInner getAuthSettings(String resourceGroupName, String name) { - return getAuthSettingsAsync(resourceGroupName, name).block(); - } - - /** - * Gets the Authentication/Authorization settings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Authentication/Authorization settings of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getAuthSettingsWithResponse( - String resourceGroupName, String name, Context context) { - return getAuthSettingsWithResponseAsync(resourceGroupName, name, context).block(); - } - - /** - * Updates the Azure storage account configurations of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param azureStorageAccounts Azure storage accounts of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azureStorageInfo dictionary resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateAzureStorageAccountsWithResponseAsync( - String resourceGroupName, String name, AzureStoragePropertyDictionaryResourceInner azureStorageAccounts) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (azureStorageAccounts == null) { - return Mono - .error(new IllegalArgumentException("Parameter azureStorageAccounts is required and cannot be null.")); - } else { - azureStorageAccounts.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updateAzureStorageAccounts( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - azureStorageAccounts, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates the Azure storage account configurations of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param azureStorageAccounts Azure storage accounts of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azureStorageInfo dictionary resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateAzureStorageAccountsWithResponseAsync( - String resourceGroupName, - String name, - AzureStoragePropertyDictionaryResourceInner azureStorageAccounts, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (azureStorageAccounts == null) { - return Mono - .error(new IllegalArgumentException("Parameter azureStorageAccounts is required and cannot be null.")); - } else { - azureStorageAccounts.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updateAzureStorageAccounts( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - azureStorageAccounts, - accept, - context); - } - - /** - * Updates the Azure storage account configurations of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param azureStorageAccounts Azure storage accounts of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azureStorageInfo dictionary resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAzureStorageAccountsAsync( - String resourceGroupName, String name, AzureStoragePropertyDictionaryResourceInner azureStorageAccounts) { - return updateAzureStorageAccountsWithResponseAsync(resourceGroupName, name, azureStorageAccounts) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Updates the Azure storage account configurations of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param azureStorageAccounts Azure storage accounts of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azureStorageInfo dictionary resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AzureStoragePropertyDictionaryResourceInner updateAzureStorageAccounts( - String resourceGroupName, String name, AzureStoragePropertyDictionaryResourceInner azureStorageAccounts) { - return updateAzureStorageAccountsAsync(resourceGroupName, name, azureStorageAccounts).block(); - } - - /** - * Updates the Azure storage account configurations of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param azureStorageAccounts Azure storage accounts of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azureStorageInfo dictionary resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateAzureStorageAccountsWithResponse( - String resourceGroupName, - String name, - AzureStoragePropertyDictionaryResourceInner azureStorageAccounts, - Context context) { - return updateAzureStorageAccountsWithResponseAsync(resourceGroupName, name, azureStorageAccounts, context) - .block(); - } - - /** - * Gets the Azure storage account configurations of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Azure storage account configurations of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listAzureStorageAccountsWithResponseAsync( - String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listAzureStorageAccounts( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the Azure storage account configurations of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Azure storage account configurations of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAzureStorageAccountsWithResponseAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listAzureStorageAccounts( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets the Azure storage account configurations of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Azure storage account configurations of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listAzureStorageAccountsAsync( - String resourceGroupName, String name) { - return listAzureStorageAccountsWithResponseAsync(resourceGroupName, name) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the Azure storage account configurations of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Azure storage account configurations of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AzureStoragePropertyDictionaryResourceInner listAzureStorageAccounts(String resourceGroupName, String name) { - return listAzureStorageAccountsAsync(resourceGroupName, name).block(); - } - - /** - * Gets the Azure storage account configurations of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Azure storage account configurations of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listAzureStorageAccountsWithResponse( - String resourceGroupName, String name, Context context) { - return listAzureStorageAccountsWithResponseAsync(resourceGroupName, name, context).block(); - } - - /** - * Updates the backup configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param request Edited backup configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a backup which will be performed. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateBackupConfigurationWithResponseAsync( - String resourceGroupName, String name, BackupRequestInner request) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (request == null) { - return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); - } else { - request.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updateBackupConfiguration( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - request, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates the backup configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param request Edited backup configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a backup which will be performed. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateBackupConfigurationWithResponseAsync( - String resourceGroupName, String name, BackupRequestInner request, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (request == null) { - return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); - } else { - request.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updateBackupConfiguration( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - request, - accept, - context); - } - - /** - * Updates the backup configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param request Edited backup configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a backup which will be performed. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateBackupConfigurationAsync( - String resourceGroupName, String name, BackupRequestInner request) { - return updateBackupConfigurationWithResponseAsync(resourceGroupName, name, request) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Updates the backup configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param request Edited backup configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a backup which will be performed. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BackupRequestInner updateBackupConfiguration( - String resourceGroupName, String name, BackupRequestInner request) { - return updateBackupConfigurationAsync(resourceGroupName, name, request).block(); - } - - /** - * Updates the backup configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param request Edited backup configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a backup which will be performed. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateBackupConfigurationWithResponse( - String resourceGroupName, String name, BackupRequestInner request, Context context) { - return updateBackupConfigurationWithResponseAsync(resourceGroupName, name, request, context).block(); - } - - /** - * Deletes the backup configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteBackupConfigurationWithResponseAsync(String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .deleteBackupConfiguration( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the backup configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteBackupConfigurationWithResponseAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .deleteBackupConfiguration( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Deletes the backup configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteBackupConfigurationAsync(String resourceGroupName, String name) { - return deleteBackupConfigurationWithResponseAsync(resourceGroupName, name) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes the backup configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteBackupConfiguration(String resourceGroupName, String name) { - deleteBackupConfigurationAsync(resourceGroupName, name).block(); - } - - /** - * Deletes the backup configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteBackupConfigurationWithResponse( - String resourceGroupName, String name, Context context) { - return deleteBackupConfigurationWithResponseAsync(resourceGroupName, name, context).block(); - } - - /** - * Gets the backup configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the backup configuration of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getBackupConfigurationWithResponseAsync( - String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getBackupConfiguration( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the backup configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the backup configuration of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getBackupConfigurationWithResponseAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getBackupConfiguration( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets the backup configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the backup configuration of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getBackupConfigurationAsync(String resourceGroupName, String name) { - return getBackupConfigurationWithResponseAsync(resourceGroupName, name) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the backup configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the backup configuration of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BackupRequestInner getBackupConfiguration(String resourceGroupName, String name) { - return getBackupConfigurationAsync(resourceGroupName, name).block(); - } - - /** - * Gets the backup configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the backup configuration of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getBackupConfigurationWithResponse( - String resourceGroupName, String name, Context context) { - return getBackupConfigurationWithResponseAsync(resourceGroupName, name, context).block(); - } - - /** - * Replaces the connection strings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param connectionStrings Connection strings of the app or deployment slot. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return string dictionary resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateConnectionStringsWithResponseAsync( - String resourceGroupName, String name, ConnectionStringDictionaryInner connectionStrings) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (connectionStrings == null) { - return Mono - .error(new IllegalArgumentException("Parameter connectionStrings is required and cannot be null.")); - } else { - connectionStrings.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updateConnectionStrings( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - connectionStrings, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Replaces the connection strings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param connectionStrings Connection strings of the app or deployment slot. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return string dictionary resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateConnectionStringsWithResponseAsync( - String resourceGroupName, String name, ConnectionStringDictionaryInner connectionStrings, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (connectionStrings == null) { - return Mono - .error(new IllegalArgumentException("Parameter connectionStrings is required and cannot be null.")); - } else { - connectionStrings.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updateConnectionStrings( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - connectionStrings, - accept, - context); - } - - /** - * Replaces the connection strings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param connectionStrings Connection strings of the app or deployment slot. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return string dictionary resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateConnectionStringsAsync( - String resourceGroupName, String name, ConnectionStringDictionaryInner connectionStrings) { - return updateConnectionStringsWithResponseAsync(resourceGroupName, name, connectionStrings) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Replaces the connection strings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param connectionStrings Connection strings of the app or deployment slot. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return string dictionary resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ConnectionStringDictionaryInner updateConnectionStrings( - String resourceGroupName, String name, ConnectionStringDictionaryInner connectionStrings) { - return updateConnectionStringsAsync(resourceGroupName, name, connectionStrings).block(); - } - - /** - * Replaces the connection strings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param connectionStrings Connection strings of the app or deployment slot. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return string dictionary resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateConnectionStringsWithResponse( - String resourceGroupName, String name, ConnectionStringDictionaryInner connectionStrings, Context context) { - return updateConnectionStringsWithResponseAsync(resourceGroupName, name, connectionStrings, context).block(); - } - - /** - * Gets the connection strings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the connection strings of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listConnectionStringsWithResponseAsync( - String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listConnectionStrings( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the connection strings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the connection strings of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listConnectionStringsWithResponseAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listConnectionStrings( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets the connection strings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the connection strings of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listConnectionStringsAsync(String resourceGroupName, String name) { - return listConnectionStringsWithResponseAsync(resourceGroupName, name) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the connection strings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the connection strings of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ConnectionStringDictionaryInner listConnectionStrings(String resourceGroupName, String name) { - return listConnectionStringsAsync(resourceGroupName, name).block(); - } - - /** - * Gets the connection strings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the connection strings of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listConnectionStringsWithResponse( - String resourceGroupName, String name, Context context) { - return listConnectionStringsWithResponseAsync(resourceGroupName, name, context).block(); - } - - /** - * Gets the logging configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the logging configuration of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getDiagnosticLogsConfigurationWithResponseAsync( - String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getDiagnosticLogsConfiguration( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the logging configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the logging configuration of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getDiagnosticLogsConfigurationWithResponseAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getDiagnosticLogsConfiguration( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets the logging configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the logging configuration of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getDiagnosticLogsConfigurationAsync(String resourceGroupName, String name) { - return getDiagnosticLogsConfigurationWithResponseAsync(resourceGroupName, name) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the logging configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the logging configuration of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SiteLogsConfigInner getDiagnosticLogsConfiguration(String resourceGroupName, String name) { - return getDiagnosticLogsConfigurationAsync(resourceGroupName, name).block(); - } - - /** - * Gets the logging configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the logging configuration of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getDiagnosticLogsConfigurationWithResponse( - String resourceGroupName, String name, Context context) { - return getDiagnosticLogsConfigurationWithResponseAsync(resourceGroupName, name, context).block(); - } - - /** - * Updates the logging configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param siteLogsConfig A SiteLogsConfig JSON object that contains the logging configuration to change in the - * "properties" property. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration of App Service site logs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateDiagnosticLogsConfigWithResponseAsync( - String resourceGroupName, String name, SiteLogsConfigInner siteLogsConfig) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (siteLogsConfig == null) { - return Mono.error(new IllegalArgumentException("Parameter siteLogsConfig is required and cannot be null.")); - } else { - siteLogsConfig.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updateDiagnosticLogsConfig( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - siteLogsConfig, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates the logging configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param siteLogsConfig A SiteLogsConfig JSON object that contains the logging configuration to change in the - * "properties" property. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration of App Service site logs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateDiagnosticLogsConfigWithResponseAsync( - String resourceGroupName, String name, SiteLogsConfigInner siteLogsConfig, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (siteLogsConfig == null) { - return Mono.error(new IllegalArgumentException("Parameter siteLogsConfig is required and cannot be null.")); - } else { - siteLogsConfig.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updateDiagnosticLogsConfig( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - siteLogsConfig, - accept, - context); - } - - /** - * Updates the logging configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param siteLogsConfig A SiteLogsConfig JSON object that contains the logging configuration to change in the - * "properties" property. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration of App Service site logs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateDiagnosticLogsConfigAsync( - String resourceGroupName, String name, SiteLogsConfigInner siteLogsConfig) { - return updateDiagnosticLogsConfigWithResponseAsync(resourceGroupName, name, siteLogsConfig) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Updates the logging configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param siteLogsConfig A SiteLogsConfig JSON object that contains the logging configuration to change in the - * "properties" property. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration of App Service site logs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SiteLogsConfigInner updateDiagnosticLogsConfig( - String resourceGroupName, String name, SiteLogsConfigInner siteLogsConfig) { - return updateDiagnosticLogsConfigAsync(resourceGroupName, name, siteLogsConfig).block(); - } - - /** - * Updates the logging configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param siteLogsConfig A SiteLogsConfig JSON object that contains the logging configuration to change in the - * "properties" property. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration of App Service site logs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateDiagnosticLogsConfigWithResponse( - String resourceGroupName, String name, SiteLogsConfigInner siteLogsConfig, Context context) { - return updateDiagnosticLogsConfigWithResponseAsync(resourceGroupName, name, siteLogsConfig, context).block(); - } - - /** - * Replaces the metadata of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param metadata Edited metadata of the app or deployment slot. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return string dictionary resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateMetadataWithResponseAsync( - String resourceGroupName, String name, StringDictionaryInner metadata) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (metadata == null) { - return Mono.error(new IllegalArgumentException("Parameter metadata is required and cannot be null.")); - } else { - metadata.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updateMetadata( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - metadata, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Replaces the metadata of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param metadata Edited metadata of the app or deployment slot. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return string dictionary resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateMetadataWithResponseAsync( - String resourceGroupName, String name, StringDictionaryInner metadata, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (metadata == null) { - return Mono.error(new IllegalArgumentException("Parameter metadata is required and cannot be null.")); - } else { - metadata.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updateMetadata( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - metadata, - accept, - context); - } - - /** - * Replaces the metadata of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param metadata Edited metadata of the app or deployment slot. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return string dictionary resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateMetadataAsync( - String resourceGroupName, String name, StringDictionaryInner metadata) { - return updateMetadataWithResponseAsync(resourceGroupName, name, metadata) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Replaces the metadata of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param metadata Edited metadata of the app or deployment slot. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return string dictionary resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public StringDictionaryInner updateMetadata(String resourceGroupName, String name, StringDictionaryInner metadata) { - return updateMetadataAsync(resourceGroupName, name, metadata).block(); - } - - /** - * Replaces the metadata of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param metadata Edited metadata of the app or deployment slot. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return string dictionary resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateMetadataWithResponse( - String resourceGroupName, String name, StringDictionaryInner metadata, Context context) { - return updateMetadataWithResponseAsync(resourceGroupName, name, metadata, context).block(); - } - - /** - * Gets the metadata of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the metadata of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listMetadataWithResponseAsync(String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listMetadata( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the metadata of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the metadata of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listMetadataWithResponseAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listMetadata( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets the metadata of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the metadata of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listMetadataAsync(String resourceGroupName, String name) { - return listMetadataWithResponseAsync(resourceGroupName, name) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the metadata of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the metadata of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public StringDictionaryInner listMetadata(String resourceGroupName, String name) { - return listMetadataAsync(resourceGroupName, name).block(); - } - - /** - * Gets the metadata of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the metadata of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listMetadataWithResponse( - String resourceGroupName, String name, Context context) { - return listMetadataWithResponseAsync(resourceGroupName, name, context).block(); - } - - /** - * Gets the Git/FTP publishing credentials of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Git/FTP publishing credentials of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> listPublishingCredentialsWithResponseAsync( - String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listPublishingCredentials( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the Git/FTP publishing credentials of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Git/FTP publishing credentials of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> listPublishingCredentialsWithResponseAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listPublishingCredentials( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets the Git/FTP publishing credentials of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Git/FTP publishing credentials of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, UserInner> beginListPublishingCredentialsAsync( - String resourceGroupName, String name) { - Mono>> mono = listPublishingCredentialsWithResponseAsync(resourceGroupName, name); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), UserInner.class, UserInner.class, this.client.getContext()); - } - - /** - * Gets the Git/FTP publishing credentials of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Git/FTP publishing credentials of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, UserInner> beginListPublishingCredentialsAsync( - String resourceGroupName, String name, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - listPublishingCredentialsWithResponseAsync(resourceGroupName, name, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), UserInner.class, UserInner.class, context); - } - - /** - * Gets the Git/FTP publishing credentials of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Git/FTP publishing credentials of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, UserInner> beginListPublishingCredentials( - String resourceGroupName, String name) { - return beginListPublishingCredentialsAsync(resourceGroupName, name).getSyncPoller(); - } - - /** - * Gets the Git/FTP publishing credentials of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Git/FTP publishing credentials of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, UserInner> beginListPublishingCredentials( - String resourceGroupName, String name, Context context) { - return beginListPublishingCredentialsAsync(resourceGroupName, name, context).getSyncPoller(); - } - - /** - * Gets the Git/FTP publishing credentials of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Git/FTP publishing credentials of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listPublishingCredentialsAsync(String resourceGroupName, String name) { - return beginListPublishingCredentialsAsync(resourceGroupName, name) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Gets the Git/FTP publishing credentials of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Git/FTP publishing credentials of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listPublishingCredentialsAsync(String resourceGroupName, String name, Context context) { - return beginListPublishingCredentialsAsync(resourceGroupName, name, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Gets the Git/FTP publishing credentials of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Git/FTP publishing credentials of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public UserInner listPublishingCredentials(String resourceGroupName, String name) { - return listPublishingCredentialsAsync(resourceGroupName, name).block(); - } - - /** - * Gets the Git/FTP publishing credentials of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Git/FTP publishing credentials of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public UserInner listPublishingCredentials(String resourceGroupName, String name, Context context) { - return listPublishingCredentialsAsync(resourceGroupName, name, context).block(); - } - - /** - * Updates the Push settings associated with web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param pushSettings Push settings associated with web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return push settings for the App. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateSitePushSettingsWithResponseAsync( - String resourceGroupName, String name, PushSettingsInner pushSettings) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (pushSettings == null) { - return Mono.error(new IllegalArgumentException("Parameter pushSettings is required and cannot be null.")); - } else { - pushSettings.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updateSitePushSettings( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - pushSettings, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates the Push settings associated with web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param pushSettings Push settings associated with web app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return push settings for the App. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateSitePushSettingsWithResponseAsync( - String resourceGroupName, String name, PushSettingsInner pushSettings, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (pushSettings == null) { - return Mono.error(new IllegalArgumentException("Parameter pushSettings is required and cannot be null.")); - } else { - pushSettings.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updateSitePushSettings( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - pushSettings, - accept, - context); - } - - /** - * Updates the Push settings associated with web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param pushSettings Push settings associated with web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return push settings for the App. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateSitePushSettingsAsync( - String resourceGroupName, String name, PushSettingsInner pushSettings) { - return updateSitePushSettingsWithResponseAsync(resourceGroupName, name, pushSettings) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Updates the Push settings associated with web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param pushSettings Push settings associated with web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return push settings for the App. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PushSettingsInner updateSitePushSettings( - String resourceGroupName, String name, PushSettingsInner pushSettings) { - return updateSitePushSettingsAsync(resourceGroupName, name, pushSettings).block(); - } - - /** - * Updates the Push settings associated with web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param pushSettings Push settings associated with web app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return push settings for the App. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateSitePushSettingsWithResponse( - String resourceGroupName, String name, PushSettingsInner pushSettings, Context context) { - return updateSitePushSettingsWithResponseAsync(resourceGroupName, name, pushSettings, context).block(); - } - - /** - * Gets the Push settings associated with web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Push settings associated with web app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listSitePushSettingsWithResponseAsync( - String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listSitePushSettings( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the Push settings associated with web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Push settings associated with web app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSitePushSettingsWithResponseAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listSitePushSettings( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets the Push settings associated with web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Push settings associated with web app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listSitePushSettingsAsync(String resourceGroupName, String name) { - return listSitePushSettingsWithResponseAsync(resourceGroupName, name) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the Push settings associated with web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Push settings associated with web app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PushSettingsInner listSitePushSettings(String resourceGroupName, String name) { - return listSitePushSettingsAsync(resourceGroupName, name).block(); - } - - /** - * Gets the Push settings associated with web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Push settings associated with web app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listSitePushSettingsWithResponse( - String resourceGroupName, String name, Context context) { - return listSitePushSettingsWithResponseAsync(resourceGroupName, name, context).block(); - } - - /** - * Gets the names of app settings and connection strings that stick to the slot (not swapped). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the names of app settings and connection strings that stick to the slot (not swapped). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listSlotConfigurationNamesWithResponseAsync( - String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listSlotConfigurationNames( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the names of app settings and connection strings that stick to the slot (not swapped). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the names of app settings and connection strings that stick to the slot (not swapped). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSlotConfigurationNamesWithResponseAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listSlotConfigurationNames( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets the names of app settings and connection strings that stick to the slot (not swapped). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the names of app settings and connection strings that stick to the slot (not swapped). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listSlotConfigurationNamesAsync(String resourceGroupName, String name) { - return listSlotConfigurationNamesWithResponseAsync(resourceGroupName, name) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the names of app settings and connection strings that stick to the slot (not swapped). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the names of app settings and connection strings that stick to the slot (not swapped). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SlotConfigNamesResourceInner listSlotConfigurationNames(String resourceGroupName, String name) { - return listSlotConfigurationNamesAsync(resourceGroupName, name).block(); - } - - /** - * Gets the names of app settings and connection strings that stick to the slot (not swapped). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the names of app settings and connection strings that stick to the slot (not swapped). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listSlotConfigurationNamesWithResponse( - String resourceGroupName, String name, Context context) { - return listSlotConfigurationNamesWithResponseAsync(resourceGroupName, name, context).block(); - } - - /** - * Updates the names of application settings and connection string that remain with the slot during swap operation. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slotConfigNames Names of application settings and connection strings. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return slot Config names azure resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateSlotConfigurationNamesWithResponseAsync( - String resourceGroupName, String name, SlotConfigNamesResourceInner slotConfigNames) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (slotConfigNames == null) { - return Mono - .error(new IllegalArgumentException("Parameter slotConfigNames is required and cannot be null.")); - } else { - slotConfigNames.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updateSlotConfigurationNames( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - slotConfigNames, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates the names of application settings and connection string that remain with the slot during swap operation. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slotConfigNames Names of application settings and connection strings. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return slot Config names azure resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateSlotConfigurationNamesWithResponseAsync( - String resourceGroupName, String name, SlotConfigNamesResourceInner slotConfigNames, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (slotConfigNames == null) { - return Mono - .error(new IllegalArgumentException("Parameter slotConfigNames is required and cannot be null.")); - } else { - slotConfigNames.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updateSlotConfigurationNames( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - slotConfigNames, - accept, - context); - } - - /** - * Updates the names of application settings and connection string that remain with the slot during swap operation. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slotConfigNames Names of application settings and connection strings. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return slot Config names azure resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateSlotConfigurationNamesAsync( - String resourceGroupName, String name, SlotConfigNamesResourceInner slotConfigNames) { - return updateSlotConfigurationNamesWithResponseAsync(resourceGroupName, name, slotConfigNames) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Updates the names of application settings and connection string that remain with the slot during swap operation. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slotConfigNames Names of application settings and connection strings. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return slot Config names azure resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SlotConfigNamesResourceInner updateSlotConfigurationNames( - String resourceGroupName, String name, SlotConfigNamesResourceInner slotConfigNames) { - return updateSlotConfigurationNamesAsync(resourceGroupName, name, slotConfigNames).block(); - } - - /** - * Updates the names of application settings and connection string that remain with the slot during swap operation. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slotConfigNames Names of application settings and connection strings. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return slot Config names azure resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateSlotConfigurationNamesWithResponse( - String resourceGroupName, String name, SlotConfigNamesResourceInner slotConfigNames, Context context) { - return updateSlotConfigurationNamesWithResponseAsync(resourceGroupName, name, slotConfigNames, context).block(); - } - - /** - * Gets the configuration of an app, such as platform version and bitness, default documents, virtual applications, - * Always On, etc. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the configuration of an app, such as platform version and bitness, default documents, virtual - * applications, Always On, etc. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getConfigurationWithResponseAsync( - String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getConfiguration( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the configuration of an app, such as platform version and bitness, default documents, virtual applications, - * Always On, etc. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the configuration of an app, such as platform version and bitness, default documents, virtual - * applications, Always On, etc. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getConfigurationWithResponseAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getConfiguration( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets the configuration of an app, such as platform version and bitness, default documents, virtual applications, - * Always On, etc. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the configuration of an app, such as platform version and bitness, default documents, virtual - * applications, Always On, etc. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getConfigurationAsync(String resourceGroupName, String name) { - return getConfigurationWithResponseAsync(resourceGroupName, name) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the configuration of an app, such as platform version and bitness, default documents, virtual applications, - * Always On, etc. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the configuration of an app, such as platform version and bitness, default documents, virtual - * applications, Always On, etc. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SiteConfigResourceInner getConfiguration(String resourceGroupName, String name) { - return getConfigurationAsync(resourceGroupName, name).block(); - } - - /** - * Gets the configuration of an app, such as platform version and bitness, default documents, virtual applications, - * Always On, etc. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the configuration of an app, such as platform version and bitness, default documents, virtual - * applications, Always On, etc. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getConfigurationWithResponse( - String resourceGroupName, String name, Context context) { - return getConfigurationWithResponseAsync(resourceGroupName, name, context).block(); - } - - /** - * Updates the configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param siteConfig JSON representation of a SiteConfig object. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return web app configuration ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateConfigurationWithResponseAsync( - String resourceGroupName, String name, SiteConfigResourceInner siteConfig) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (siteConfig == null) { - return Mono.error(new IllegalArgumentException("Parameter siteConfig is required and cannot be null.")); - } else { - siteConfig.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdateConfiguration( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - siteConfig, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates the configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param siteConfig JSON representation of a SiteConfig object. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return web app configuration ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateConfigurationWithResponseAsync( - String resourceGroupName, String name, SiteConfigResourceInner siteConfig, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (siteConfig == null) { - return Mono.error(new IllegalArgumentException("Parameter siteConfig is required and cannot be null.")); - } else { - siteConfig.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdateConfiguration( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - siteConfig, - accept, - context); - } - - /** - * Updates the configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param siteConfig JSON representation of a SiteConfig object. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return web app configuration ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateConfigurationAsync( - String resourceGroupName, String name, SiteConfigResourceInner siteConfig) { - return createOrUpdateConfigurationWithResponseAsync(resourceGroupName, name, siteConfig) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Updates the configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param siteConfig JSON representation of a SiteConfig object. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return web app configuration ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SiteConfigResourceInner createOrUpdateConfiguration( - String resourceGroupName, String name, SiteConfigResourceInner siteConfig) { - return createOrUpdateConfigurationAsync(resourceGroupName, name, siteConfig).block(); - } - - /** - * Updates the configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param siteConfig JSON representation of a SiteConfig object. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return web app configuration ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateConfigurationWithResponse( - String resourceGroupName, String name, SiteConfigResourceInner siteConfig, Context context) { - return createOrUpdateConfigurationWithResponseAsync(resourceGroupName, name, siteConfig, context).block(); - } - - /** - * Updates the configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param siteConfig JSON representation of a SiteConfig object. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return web app configuration ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateConfigurationWithResponseAsync( - String resourceGroupName, String name, SiteConfigResourceInner siteConfig) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (siteConfig == null) { - return Mono.error(new IllegalArgumentException("Parameter siteConfig is required and cannot be null.")); - } else { - siteConfig.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updateConfiguration( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - siteConfig, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates the configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param siteConfig JSON representation of a SiteConfig object. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return web app configuration ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateConfigurationWithResponseAsync( - String resourceGroupName, String name, SiteConfigResourceInner siteConfig, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (siteConfig == null) { - return Mono.error(new IllegalArgumentException("Parameter siteConfig is required and cannot be null.")); - } else { - siteConfig.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updateConfiguration( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - siteConfig, - accept, - context); - } - - /** - * Updates the configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param siteConfig JSON representation of a SiteConfig object. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return web app configuration ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateConfigurationAsync( - String resourceGroupName, String name, SiteConfigResourceInner siteConfig) { - return updateConfigurationWithResponseAsync(resourceGroupName, name, siteConfig) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Updates the configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param siteConfig JSON representation of a SiteConfig object. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return web app configuration ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SiteConfigResourceInner updateConfiguration( - String resourceGroupName, String name, SiteConfigResourceInner siteConfig) { - return updateConfigurationAsync(resourceGroupName, name, siteConfig).block(); - } - - /** - * Updates the configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param siteConfig JSON representation of a SiteConfig object. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return web app configuration ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateConfigurationWithResponse( - String resourceGroupName, String name, SiteConfigResourceInner siteConfig, Context context) { - return updateConfigurationWithResponseAsync(resourceGroupName, name, siteConfig, context).block(); - } - - /** - * Gets a list of web app configuration snapshots identifiers. Each element of the list contains a timestamp and the - * ID of the snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of web app configuration snapshots identifiers. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listConfigurationSnapshotInfoSinglePageAsync( - String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listConfigurationSnapshotInfo( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a list of web app configuration snapshots identifiers. Each element of the list contains a timestamp and the - * ID of the snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of web app configuration snapshots identifiers. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listConfigurationSnapshotInfoSinglePageAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listConfigurationSnapshotInfo( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets a list of web app configuration snapshots identifiers. Each element of the list contains a timestamp and the - * ID of the snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of web app configuration snapshots identifiers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listConfigurationSnapshotInfoAsync( - String resourceGroupName, String name) { - return new PagedFlux<>( - () -> listConfigurationSnapshotInfoSinglePageAsync(resourceGroupName, name), - nextLink -> listConfigurationSnapshotInfoNextSinglePageAsync(nextLink)); - } - - /** - * Gets a list of web app configuration snapshots identifiers. Each element of the list contains a timestamp and the - * ID of the snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of web app configuration snapshots identifiers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listConfigurationSnapshotInfoAsync( - String resourceGroupName, String name, Context context) { - return new PagedFlux<>( - () -> listConfigurationSnapshotInfoSinglePageAsync(resourceGroupName, name, context), - nextLink -> listConfigurationSnapshotInfoNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets a list of web app configuration snapshots identifiers. Each element of the list contains a timestamp and the - * ID of the snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of web app configuration snapshots identifiers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listConfigurationSnapshotInfo( - String resourceGroupName, String name) { - return new PagedIterable<>(listConfigurationSnapshotInfoAsync(resourceGroupName, name)); - } - - /** - * Gets a list of web app configuration snapshots identifiers. Each element of the list contains a timestamp and the - * ID of the snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of web app configuration snapshots identifiers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listConfigurationSnapshotInfo( - String resourceGroupName, String name, Context context) { - return new PagedIterable<>(listConfigurationSnapshotInfoAsync(resourceGroupName, name, context)); - } - - /** - * Gets a snapshot of the configuration of an app at a previous point in time. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param snapshotId The ID of the snapshot to read. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a snapshot of the configuration of an app at a previous point in time. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getConfigurationSnapshotWithResponseAsync( - String resourceGroupName, String name, String snapshotId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (snapshotId == null) { - return Mono.error(new IllegalArgumentException("Parameter snapshotId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getConfigurationSnapshot( - this.client.getEndpoint(), - resourceGroupName, - name, - snapshotId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a snapshot of the configuration of an app at a previous point in time. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param snapshotId The ID of the snapshot to read. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a snapshot of the configuration of an app at a previous point in time. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getConfigurationSnapshotWithResponseAsync( - String resourceGroupName, String name, String snapshotId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (snapshotId == null) { - return Mono.error(new IllegalArgumentException("Parameter snapshotId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getConfigurationSnapshot( - this.client.getEndpoint(), - resourceGroupName, - name, - snapshotId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets a snapshot of the configuration of an app at a previous point in time. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param snapshotId The ID of the snapshot to read. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a snapshot of the configuration of an app at a previous point in time. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getConfigurationSnapshotAsync( - String resourceGroupName, String name, String snapshotId) { - return getConfigurationSnapshotWithResponseAsync(resourceGroupName, name, snapshotId) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a snapshot of the configuration of an app at a previous point in time. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param snapshotId The ID of the snapshot to read. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a snapshot of the configuration of an app at a previous point in time. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SiteConfigResourceInner getConfigurationSnapshot(String resourceGroupName, String name, String snapshotId) { - return getConfigurationSnapshotAsync(resourceGroupName, name, snapshotId).block(); - } - - /** - * Gets a snapshot of the configuration of an app at a previous point in time. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param snapshotId The ID of the snapshot to read. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a snapshot of the configuration of an app at a previous point in time. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getConfigurationSnapshotWithResponse( - String resourceGroupName, String name, String snapshotId, Context context) { - return getConfigurationSnapshotWithResponseAsync(resourceGroupName, name, snapshotId, context).block(); - } - - /** - * Reverts the configuration of an app to a previous snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param snapshotId The ID of the snapshot to read. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> recoverSiteConfigurationSnapshotWithResponseAsync( - String resourceGroupName, String name, String snapshotId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (snapshotId == null) { - return Mono.error(new IllegalArgumentException("Parameter snapshotId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .recoverSiteConfigurationSnapshot( - this.client.getEndpoint(), - resourceGroupName, - name, - snapshotId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Reverts the configuration of an app to a previous snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param snapshotId The ID of the snapshot to read. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> recoverSiteConfigurationSnapshotWithResponseAsync( - String resourceGroupName, String name, String snapshotId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (snapshotId == null) { - return Mono.error(new IllegalArgumentException("Parameter snapshotId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .recoverSiteConfigurationSnapshot( - this.client.getEndpoint(), - resourceGroupName, - name, - snapshotId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Reverts the configuration of an app to a previous snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param snapshotId The ID of the snapshot to read. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono recoverSiteConfigurationSnapshotAsync(String resourceGroupName, String name, String snapshotId) { - return recoverSiteConfigurationSnapshotWithResponseAsync(resourceGroupName, name, snapshotId) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Reverts the configuration of an app to a previous snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param snapshotId The ID of the snapshot to read. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void recoverSiteConfigurationSnapshot(String resourceGroupName, String name, String snapshotId) { - recoverSiteConfigurationSnapshotAsync(resourceGroupName, name, snapshotId).block(); - } - - /** - * Reverts the configuration of an app to a previous snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param snapshotId The ID of the snapshot to read. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response recoverSiteConfigurationSnapshotWithResponse( - String resourceGroupName, String name, String snapshotId, Context context) { - return recoverSiteConfigurationSnapshotWithResponseAsync(resourceGroupName, name, snapshotId, context).block(); - } - - /** - * Gets the last lines of docker logs for the given site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the last lines of docker logs for the given site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getWebSiteContainerLogsWithResponseAsync(String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/octet-stream"; - return FluxUtil - .withContext( - context -> - service - .getWebSiteContainerLogs( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the last lines of docker logs for the given site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the last lines of docker logs for the given site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getWebSiteContainerLogsWithResponseAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/octet-stream"; - context = this.client.mergeContext(context); - return service - .getWebSiteContainerLogs( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets the last lines of docker logs for the given site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the last lines of docker logs for the given site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Flux getWebSiteContainerLogsAsync(String resourceGroupName, String name) { - return getWebSiteContainerLogsWithResponseAsync(resourceGroupName, name).flatMapMany(StreamResponse::getValue); - } - - /** - * Gets the last lines of docker logs for the given site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the last lines of docker logs for the given site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public InputStream getWebSiteContainerLogs(String resourceGroupName, String name) { - Iterator iterator = - getWebSiteContainerLogsAsync(resourceGroupName, name) - .map(ByteBufferBackedInputStream::new) - .toStream() - .iterator(); - Enumeration enumeration = - new Enumeration() { - @Override - public boolean hasMoreElements() { - return iterator.hasNext(); - } - - @Override - public InputStream nextElement() { - return iterator.next(); - } - }; - return new SequenceInputStream(enumeration); - } - - /** - * Gets the last lines of docker logs for the given site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the last lines of docker logs for the given site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public StreamResponse getWebSiteContainerLogsWithResponse(String resourceGroupName, String name, Context context) { - return getWebSiteContainerLogsWithResponseAsync(resourceGroupName, name, context).block(); - } - - /** - * Gets the ZIP archived docker log files for the given site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ZIP archived docker log files for the given site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getContainerLogsZipWithResponseAsync(String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/zip"; - return FluxUtil - .withContext( - context -> - service - .getContainerLogsZip( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the ZIP archived docker log files for the given site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ZIP archived docker log files for the given site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getContainerLogsZipWithResponseAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/zip"; - context = this.client.mergeContext(context); - return service - .getContainerLogsZip( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets the ZIP archived docker log files for the given site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ZIP archived docker log files for the given site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Flux getContainerLogsZipAsync(String resourceGroupName, String name) { - return getContainerLogsZipWithResponseAsync(resourceGroupName, name).flatMapMany(StreamResponse::getValue); - } - - /** - * Gets the ZIP archived docker log files for the given site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ZIP archived docker log files for the given site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public InputStream getContainerLogsZip(String resourceGroupName, String name) { - Iterator iterator = - getContainerLogsZipAsync(resourceGroupName, name) - .map(ByteBufferBackedInputStream::new) - .toStream() - .iterator(); - Enumeration enumeration = - new Enumeration() { - @Override - public boolean hasMoreElements() { - return iterator.hasNext(); - } - - @Override - public InputStream nextElement() { - return iterator.next(); - } - }; - return new SequenceInputStream(enumeration); - } - - /** - * Gets the ZIP archived docker log files for the given site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ZIP archived docker log files for the given site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public StreamResponse getContainerLogsZipWithResponse(String resourceGroupName, String name, Context context) { - return getContainerLogsZipWithResponseAsync(resourceGroupName, name, context).block(); - } - - /** - * List continuous web jobs for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu continuous web job information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listContinuousWebJobsSinglePageAsync( - String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listContinuousWebJobs( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List continuous web jobs for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu continuous web job information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listContinuousWebJobsSinglePageAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listContinuousWebJobs( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * List continuous web jobs for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu continuous web job information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listContinuousWebJobsAsync(String resourceGroupName, String name) { - return new PagedFlux<>( - () -> listContinuousWebJobsSinglePageAsync(resourceGroupName, name), - nextLink -> listContinuousWebJobsNextSinglePageAsync(nextLink)); - } - - /** - * List continuous web jobs for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu continuous web job information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listContinuousWebJobsAsync( - String resourceGroupName, String name, Context context) { - return new PagedFlux<>( - () -> listContinuousWebJobsSinglePageAsync(resourceGroupName, name, context), - nextLink -> listContinuousWebJobsNextSinglePageAsync(nextLink, context)); - } - - /** - * List continuous web jobs for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu continuous web job information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listContinuousWebJobs(String resourceGroupName, String name) { - return new PagedIterable<>(listContinuousWebJobsAsync(resourceGroupName, name)); - } - - /** - * List continuous web jobs for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu continuous web job information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listContinuousWebJobs( - String resourceGroupName, String name, Context context) { - return new PagedIterable<>(listContinuousWebJobsAsync(resourceGroupName, name, context)); - } - - /** - * Gets a continuous web job by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a continuous web job by its ID for an app, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getContinuousWebJobWithResponseAsync( - String resourceGroupName, String name, String webJobName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (webJobName == null) { - return Mono.error(new IllegalArgumentException("Parameter webJobName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getContinuousWebJob( - this.client.getEndpoint(), - resourceGroupName, - name, - webJobName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a continuous web job by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a continuous web job by its ID for an app, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getContinuousWebJobWithResponseAsync( - String resourceGroupName, String name, String webJobName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (webJobName == null) { - return Mono.error(new IllegalArgumentException("Parameter webJobName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getContinuousWebJob( - this.client.getEndpoint(), - resourceGroupName, - name, - webJobName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets a continuous web job by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a continuous web job by its ID for an app, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getContinuousWebJobAsync( - String resourceGroupName, String name, String webJobName) { - return getContinuousWebJobWithResponseAsync(resourceGroupName, name, webJobName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a continuous web job by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a continuous web job by its ID for an app, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ContinuousWebJobInner getContinuousWebJob(String resourceGroupName, String name, String webJobName) { - return getContinuousWebJobAsync(resourceGroupName, name, webJobName).block(); - } - - /** - * Gets a continuous web job by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a continuous web job by its ID for an app, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getContinuousWebJobWithResponse( - String resourceGroupName, String name, String webJobName, Context context) { - return getContinuousWebJobWithResponseAsync(resourceGroupName, name, webJobName, context).block(); - } - - /** - * Delete a continuous web job by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteContinuousWebJobWithResponseAsync( - String resourceGroupName, String name, String webJobName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (webJobName == null) { - return Mono.error(new IllegalArgumentException("Parameter webJobName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .deleteContinuousWebJob( - this.client.getEndpoint(), - resourceGroupName, - name, - webJobName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete a continuous web job by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteContinuousWebJobWithResponseAsync( - String resourceGroupName, String name, String webJobName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (webJobName == null) { - return Mono.error(new IllegalArgumentException("Parameter webJobName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .deleteContinuousWebJob( - this.client.getEndpoint(), - resourceGroupName, - name, - webJobName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Delete a continuous web job by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteContinuousWebJobAsync(String resourceGroupName, String name, String webJobName) { - return deleteContinuousWebJobWithResponseAsync(resourceGroupName, name, webJobName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Delete a continuous web job by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteContinuousWebJob(String resourceGroupName, String name, String webJobName) { - deleteContinuousWebJobAsync(resourceGroupName, name, webJobName).block(); - } - - /** - * Delete a continuous web job by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteContinuousWebJobWithResponse( - String resourceGroupName, String name, String webJobName, Context context) { - return deleteContinuousWebJobWithResponseAsync(resourceGroupName, name, webJobName, context).block(); - } - - /** - * Start a continuous web job for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> startContinuousWebJobWithResponseAsync( - String resourceGroupName, String name, String webJobName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (webJobName == null) { - return Mono.error(new IllegalArgumentException("Parameter webJobName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .startContinuousWebJob( - this.client.getEndpoint(), - resourceGroupName, - name, - webJobName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Start a continuous web job for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> startContinuousWebJobWithResponseAsync( - String resourceGroupName, String name, String webJobName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (webJobName == null) { - return Mono.error(new IllegalArgumentException("Parameter webJobName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .startContinuousWebJob( - this.client.getEndpoint(), - resourceGroupName, - name, - webJobName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Start a continuous web job for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono startContinuousWebJobAsync(String resourceGroupName, String name, String webJobName) { - return startContinuousWebJobWithResponseAsync(resourceGroupName, name, webJobName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Start a continuous web job for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void startContinuousWebJob(String resourceGroupName, String name, String webJobName) { - startContinuousWebJobAsync(resourceGroupName, name, webJobName).block(); - } - - /** - * Start a continuous web job for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response startContinuousWebJobWithResponse( - String resourceGroupName, String name, String webJobName, Context context) { - return startContinuousWebJobWithResponseAsync(resourceGroupName, name, webJobName, context).block(); - } - - /** - * Stop a continuous web job for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> stopContinuousWebJobWithResponseAsync( - String resourceGroupName, String name, String webJobName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (webJobName == null) { - return Mono.error(new IllegalArgumentException("Parameter webJobName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .stopContinuousWebJob( - this.client.getEndpoint(), - resourceGroupName, - name, - webJobName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Stop a continuous web job for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> stopContinuousWebJobWithResponseAsync( - String resourceGroupName, String name, String webJobName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (webJobName == null) { - return Mono.error(new IllegalArgumentException("Parameter webJobName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .stopContinuousWebJob( - this.client.getEndpoint(), - resourceGroupName, - name, - webJobName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Stop a continuous web job for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono stopContinuousWebJobAsync(String resourceGroupName, String name, String webJobName) { - return stopContinuousWebJobWithResponseAsync(resourceGroupName, name, webJobName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Stop a continuous web job for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void stopContinuousWebJob(String resourceGroupName, String name, String webJobName) { - stopContinuousWebJobAsync(resourceGroupName, name, webJobName).block(); - } - - /** - * Stop a continuous web job for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response stopContinuousWebJobWithResponse( - String resourceGroupName, String name, String webJobName, Context context) { - return stopContinuousWebJobWithResponseAsync(resourceGroupName, name, webJobName, context).block(); - } - - /** - * List deployments for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of app deployments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listDeploymentsSinglePageAsync(String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listDeployments( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List deployments for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of app deployments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listDeploymentsSinglePageAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listDeployments( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * List deployments for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of app deployments. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listDeploymentsAsync(String resourceGroupName, String name) { - return new PagedFlux<>( - () -> listDeploymentsSinglePageAsync(resourceGroupName, name), - nextLink -> listDeploymentsNextSinglePageAsync(nextLink)); - } - - /** - * List deployments for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of app deployments. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listDeploymentsAsync(String resourceGroupName, String name, Context context) { - return new PagedFlux<>( - () -> listDeploymentsSinglePageAsync(resourceGroupName, name, context), - nextLink -> listDeploymentsNextSinglePageAsync(nextLink, context)); - } - - /** - * List deployments for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of app deployments. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listDeployments(String resourceGroupName, String name) { - return new PagedIterable<>(listDeploymentsAsync(resourceGroupName, name)); - } - - /** - * List deployments for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of app deployments. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listDeployments(String resourceGroupName, String name, Context context) { - return new PagedIterable<>(listDeploymentsAsync(resourceGroupName, name, context)); - } - - /** - * Get a deployment by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param id Deployment ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment by its ID for an app, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getDeploymentWithResponseAsync( - String resourceGroupName, String name, String id) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (id == null) { - return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getDeployment( - this.client.getEndpoint(), - resourceGroupName, - name, - id, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a deployment by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param id Deployment ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment by its ID for an app, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getDeploymentWithResponseAsync( - String resourceGroupName, String name, String id, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (id == null) { - return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getDeployment( - this.client.getEndpoint(), - resourceGroupName, - name, - id, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Get a deployment by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param id Deployment ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment by its ID for an app, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getDeploymentAsync(String resourceGroupName, String name, String id) { - return getDeploymentWithResponseAsync(resourceGroupName, name, id) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get a deployment by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param id Deployment ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment by its ID for an app, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentInner getDeployment(String resourceGroupName, String name, String id) { - return getDeploymentAsync(resourceGroupName, name, id).block(); - } - - /** - * Get a deployment by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param id Deployment ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment by its ID for an app, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getDeploymentWithResponse( - String resourceGroupName, String name, String id, Context context) { - return getDeploymentWithResponseAsync(resourceGroupName, name, id, context).block(); - } - - /** - * Create a deployment for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param id ID of an existing deployment. - * @param deployment Deployment details. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user credentials used for publishing activity. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createDeploymentWithResponseAsync( - String resourceGroupName, String name, String id, DeploymentInner deployment) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (id == null) { - return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (deployment == null) { - return Mono.error(new IllegalArgumentException("Parameter deployment is required and cannot be null.")); - } else { - deployment.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createDeployment( - this.client.getEndpoint(), - resourceGroupName, - name, - id, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - deployment, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create a deployment for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param id ID of an existing deployment. - * @param deployment Deployment details. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user credentials used for publishing activity. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createDeploymentWithResponseAsync( - String resourceGroupName, String name, String id, DeploymentInner deployment, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (id == null) { - return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (deployment == null) { - return Mono.error(new IllegalArgumentException("Parameter deployment is required and cannot be null.")); - } else { - deployment.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createDeployment( - this.client.getEndpoint(), - resourceGroupName, - name, - id, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - deployment, - accept, - context); - } - - /** - * Create a deployment for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param id ID of an existing deployment. - * @param deployment Deployment details. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user credentials used for publishing activity. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createDeploymentAsync( - String resourceGroupName, String name, String id, DeploymentInner deployment) { - return createDeploymentWithResponseAsync(resourceGroupName, name, id, deployment) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Create a deployment for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param id ID of an existing deployment. - * @param deployment Deployment details. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user credentials used for publishing activity. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentInner createDeployment( - String resourceGroupName, String name, String id, DeploymentInner deployment) { - return createDeploymentAsync(resourceGroupName, name, id, deployment).block(); - } - - /** - * Create a deployment for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param id ID of an existing deployment. - * @param deployment Deployment details. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user credentials used for publishing activity. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createDeploymentWithResponse( - String resourceGroupName, String name, String id, DeploymentInner deployment, Context context) { - return createDeploymentWithResponseAsync(resourceGroupName, name, id, deployment, context).block(); - } - - /** - * Delete a deployment by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param id Deployment ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteDeploymentWithResponseAsync(String resourceGroupName, String name, String id) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (id == null) { - return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .deleteDeployment( - this.client.getEndpoint(), - resourceGroupName, - name, - id, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete a deployment by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param id Deployment ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteDeploymentWithResponseAsync( - String resourceGroupName, String name, String id, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (id == null) { - return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .deleteDeployment( - this.client.getEndpoint(), - resourceGroupName, - name, - id, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Delete a deployment by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param id Deployment ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteDeploymentAsync(String resourceGroupName, String name, String id) { - return deleteDeploymentWithResponseAsync(resourceGroupName, name, id) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Delete a deployment by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param id Deployment ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteDeployment(String resourceGroupName, String name, String id) { - deleteDeploymentAsync(resourceGroupName, name, id).block(); - } - - /** - * Delete a deployment by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param id Deployment ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteDeploymentWithResponse( - String resourceGroupName, String name, String id, Context context) { - return deleteDeploymentWithResponseAsync(resourceGroupName, name, id, context).block(); - } - - /** - * List deployment log for specific deployment for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param id The ID of a specific deployment. This is the value of the name property in the JSON response from "GET - * /api/sites/{siteName}/deployments". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user credentials used for publishing activity. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listDeploymentLogWithResponseAsync( - String resourceGroupName, String name, String id) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (id == null) { - return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listDeploymentLog( - this.client.getEndpoint(), - resourceGroupName, - name, - id, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List deployment log for specific deployment for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param id The ID of a specific deployment. This is the value of the name property in the JSON response from "GET - * /api/sites/{siteName}/deployments". - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user credentials used for publishing activity. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listDeploymentLogWithResponseAsync( - String resourceGroupName, String name, String id, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (id == null) { - return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listDeploymentLog( - this.client.getEndpoint(), - resourceGroupName, - name, - id, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * List deployment log for specific deployment for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param id The ID of a specific deployment. This is the value of the name property in the JSON response from "GET - * /api/sites/{siteName}/deployments". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user credentials used for publishing activity. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listDeploymentLogAsync(String resourceGroupName, String name, String id) { - return listDeploymentLogWithResponseAsync(resourceGroupName, name, id) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * List deployment log for specific deployment for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param id The ID of a specific deployment. This is the value of the name property in the JSON response from "GET - * /api/sites/{siteName}/deployments". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user credentials used for publishing activity. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentInner listDeploymentLog(String resourceGroupName, String name, String id) { - return listDeploymentLogAsync(resourceGroupName, name, id).block(); - } - - /** - * List deployment log for specific deployment for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param id The ID of a specific deployment. This is the value of the name property in the JSON response from "GET - * /api/sites/{siteName}/deployments". - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user credentials used for publishing activity. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listDeploymentLogWithResponse( - String resourceGroupName, String name, String id, Context context) { - return listDeploymentLogWithResponseAsync(resourceGroupName, name, id, context).block(); - } - - /** - * Discovers an existing app backup that can be restored from a blob in Azure storage. Use this to get information - * about the databases stored in a backup. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param request A RestoreRequest object that includes Azure storage URL and blog name for discovery of backup. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a restore request. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> discoverBackupWithResponseAsync( - String resourceGroupName, String name, RestoreRequestInner request) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (request == null) { - return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); - } else { - request.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .discoverBackup( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - request, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Discovers an existing app backup that can be restored from a blob in Azure storage. Use this to get information - * about the databases stored in a backup. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param request A RestoreRequest object that includes Azure storage URL and blog name for discovery of backup. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a restore request. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> discoverBackupWithResponseAsync( - String resourceGroupName, String name, RestoreRequestInner request, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (request == null) { - return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); - } else { - request.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .discoverBackup( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - request, - accept, - context); - } - - /** - * Discovers an existing app backup that can be restored from a blob in Azure storage. Use this to get information - * about the databases stored in a backup. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param request A RestoreRequest object that includes Azure storage URL and blog name for discovery of backup. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a restore request. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono discoverBackupAsync( - String resourceGroupName, String name, RestoreRequestInner request) { - return discoverBackupWithResponseAsync(resourceGroupName, name, request) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Discovers an existing app backup that can be restored from a blob in Azure storage. Use this to get information - * about the databases stored in a backup. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param request A RestoreRequest object that includes Azure storage URL and blog name for discovery of backup. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a restore request. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RestoreRequestInner discoverBackup(String resourceGroupName, String name, RestoreRequestInner request) { - return discoverBackupAsync(resourceGroupName, name, request).block(); - } - - /** - * Discovers an existing app backup that can be restored from a blob in Azure storage. Use this to get information - * about the databases stored in a backup. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param request A RestoreRequest object that includes Azure storage URL and blog name for discovery of backup. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a restore request. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response discoverBackupWithResponse( - String resourceGroupName, String name, RestoreRequestInner request, Context context) { - return discoverBackupWithResponseAsync(resourceGroupName, name, request, context).block(); - } - - /** - * Lists ownership identifiers for domain associated with web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of identifiers. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listDomainOwnershipIdentifiersSinglePageAsync( - String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listDomainOwnershipIdentifiers( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists ownership identifiers for domain associated with web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of identifiers. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listDomainOwnershipIdentifiersSinglePageAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listDomainOwnershipIdentifiers( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists ownership identifiers for domain associated with web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of identifiers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listDomainOwnershipIdentifiersAsync(String resourceGroupName, String name) { - return new PagedFlux<>( - () -> listDomainOwnershipIdentifiersSinglePageAsync(resourceGroupName, name), - nextLink -> listDomainOwnershipIdentifiersNextSinglePageAsync(nextLink)); - } - - /** - * Lists ownership identifiers for domain associated with web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of identifiers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listDomainOwnershipIdentifiersAsync( - String resourceGroupName, String name, Context context) { - return new PagedFlux<>( - () -> listDomainOwnershipIdentifiersSinglePageAsync(resourceGroupName, name, context), - nextLink -> listDomainOwnershipIdentifiersNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists ownership identifiers for domain associated with web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of identifiers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listDomainOwnershipIdentifiers(String resourceGroupName, String name) { - return new PagedIterable<>(listDomainOwnershipIdentifiersAsync(resourceGroupName, name)); - } - - /** - * Lists ownership identifiers for domain associated with web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of identifiers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listDomainOwnershipIdentifiers( - String resourceGroupName, String name, Context context) { - return new PagedIterable<>(listDomainOwnershipIdentifiersAsync(resourceGroupName, name, context)); - } - - /** - * Get domain ownership identifier for web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param domainOwnershipIdentifierName Name of domain ownership identifier. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return domain ownership identifier for web app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getDomainOwnershipIdentifierWithResponseAsync( - String resourceGroupName, String name, String domainOwnershipIdentifierName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (domainOwnershipIdentifierName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter domainOwnershipIdentifierName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getDomainOwnershipIdentifier( - this.client.getEndpoint(), - resourceGroupName, - name, - domainOwnershipIdentifierName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get domain ownership identifier for web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param domainOwnershipIdentifierName Name of domain ownership identifier. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return domain ownership identifier for web app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getDomainOwnershipIdentifierWithResponseAsync( - String resourceGroupName, String name, String domainOwnershipIdentifierName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (domainOwnershipIdentifierName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter domainOwnershipIdentifierName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getDomainOwnershipIdentifier( - this.client.getEndpoint(), - resourceGroupName, - name, - domainOwnershipIdentifierName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Get domain ownership identifier for web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param domainOwnershipIdentifierName Name of domain ownership identifier. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return domain ownership identifier for web app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getDomainOwnershipIdentifierAsync( - String resourceGroupName, String name, String domainOwnershipIdentifierName) { - return getDomainOwnershipIdentifierWithResponseAsync(resourceGroupName, name, domainOwnershipIdentifierName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get domain ownership identifier for web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param domainOwnershipIdentifierName Name of domain ownership identifier. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return domain ownership identifier for web app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public IdentifierInner getDomainOwnershipIdentifier( - String resourceGroupName, String name, String domainOwnershipIdentifierName) { - return getDomainOwnershipIdentifierAsync(resourceGroupName, name, domainOwnershipIdentifierName).block(); - } - - /** - * Get domain ownership identifier for web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param domainOwnershipIdentifierName Name of domain ownership identifier. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return domain ownership identifier for web app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getDomainOwnershipIdentifierWithResponse( - String resourceGroupName, String name, String domainOwnershipIdentifierName, Context context) { - return getDomainOwnershipIdentifierWithResponseAsync( - resourceGroupName, name, domainOwnershipIdentifierName, context) - .block(); - } - - /** - * Creates a domain ownership identifier for web app, or updates an existing ownership identifier. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param domainOwnershipIdentifierName Name of domain ownership identifier. - * @param domainOwnershipIdentifier A JSON representation of the domain ownership properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a domain specific resource identifier. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateDomainOwnershipIdentifierWithResponseAsync( - String resourceGroupName, - String name, - String domainOwnershipIdentifierName, - IdentifierInner domainOwnershipIdentifier) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (domainOwnershipIdentifierName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter domainOwnershipIdentifierName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (domainOwnershipIdentifier == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter domainOwnershipIdentifier is required and cannot be null.")); - } else { - domainOwnershipIdentifier.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdateDomainOwnershipIdentifier( - this.client.getEndpoint(), - resourceGroupName, - name, - domainOwnershipIdentifierName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - domainOwnershipIdentifier, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates a domain ownership identifier for web app, or updates an existing ownership identifier. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param domainOwnershipIdentifierName Name of domain ownership identifier. - * @param domainOwnershipIdentifier A JSON representation of the domain ownership properties. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a domain specific resource identifier. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateDomainOwnershipIdentifierWithResponseAsync( - String resourceGroupName, - String name, - String domainOwnershipIdentifierName, - IdentifierInner domainOwnershipIdentifier, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (domainOwnershipIdentifierName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter domainOwnershipIdentifierName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (domainOwnershipIdentifier == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter domainOwnershipIdentifier is required and cannot be null.")); - } else { - domainOwnershipIdentifier.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdateDomainOwnershipIdentifier( - this.client.getEndpoint(), - resourceGroupName, - name, - domainOwnershipIdentifierName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - domainOwnershipIdentifier, - accept, - context); - } - - /** - * Creates a domain ownership identifier for web app, or updates an existing ownership identifier. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param domainOwnershipIdentifierName Name of domain ownership identifier. - * @param domainOwnershipIdentifier A JSON representation of the domain ownership properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a domain specific resource identifier. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateDomainOwnershipIdentifierAsync( - String resourceGroupName, - String name, - String domainOwnershipIdentifierName, - IdentifierInner domainOwnershipIdentifier) { - return createOrUpdateDomainOwnershipIdentifierWithResponseAsync( - resourceGroupName, name, domainOwnershipIdentifierName, domainOwnershipIdentifier) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates a domain ownership identifier for web app, or updates an existing ownership identifier. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param domainOwnershipIdentifierName Name of domain ownership identifier. - * @param domainOwnershipIdentifier A JSON representation of the domain ownership properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a domain specific resource identifier. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public IdentifierInner createOrUpdateDomainOwnershipIdentifier( - String resourceGroupName, - String name, - String domainOwnershipIdentifierName, - IdentifierInner domainOwnershipIdentifier) { - return createOrUpdateDomainOwnershipIdentifierAsync( - resourceGroupName, name, domainOwnershipIdentifierName, domainOwnershipIdentifier) - .block(); - } - - /** - * Creates a domain ownership identifier for web app, or updates an existing ownership identifier. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param domainOwnershipIdentifierName Name of domain ownership identifier. - * @param domainOwnershipIdentifier A JSON representation of the domain ownership properties. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a domain specific resource identifier. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateDomainOwnershipIdentifierWithResponse( - String resourceGroupName, - String name, - String domainOwnershipIdentifierName, - IdentifierInner domainOwnershipIdentifier, - Context context) { - return createOrUpdateDomainOwnershipIdentifierWithResponseAsync( - resourceGroupName, name, domainOwnershipIdentifierName, domainOwnershipIdentifier, context) - .block(); - } - - /** - * Deletes a domain ownership identifier for a web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param domainOwnershipIdentifierName Name of domain ownership identifier. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteDomainOwnershipIdentifierWithResponseAsync( - String resourceGroupName, String name, String domainOwnershipIdentifierName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (domainOwnershipIdentifierName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter domainOwnershipIdentifierName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .deleteDomainOwnershipIdentifier( - this.client.getEndpoint(), - resourceGroupName, - name, - domainOwnershipIdentifierName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a domain ownership identifier for a web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param domainOwnershipIdentifierName Name of domain ownership identifier. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteDomainOwnershipIdentifierWithResponseAsync( - String resourceGroupName, String name, String domainOwnershipIdentifierName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (domainOwnershipIdentifierName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter domainOwnershipIdentifierName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .deleteDomainOwnershipIdentifier( - this.client.getEndpoint(), - resourceGroupName, - name, - domainOwnershipIdentifierName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Deletes a domain ownership identifier for a web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param domainOwnershipIdentifierName Name of domain ownership identifier. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteDomainOwnershipIdentifierAsync( - String resourceGroupName, String name, String domainOwnershipIdentifierName) { - return deleteDomainOwnershipIdentifierWithResponseAsync(resourceGroupName, name, domainOwnershipIdentifierName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes a domain ownership identifier for a web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param domainOwnershipIdentifierName Name of domain ownership identifier. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteDomainOwnershipIdentifier( - String resourceGroupName, String name, String domainOwnershipIdentifierName) { - deleteDomainOwnershipIdentifierAsync(resourceGroupName, name, domainOwnershipIdentifierName).block(); - } - - /** - * Deletes a domain ownership identifier for a web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param domainOwnershipIdentifierName Name of domain ownership identifier. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteDomainOwnershipIdentifierWithResponse( - String resourceGroupName, String name, String domainOwnershipIdentifierName, Context context) { - return deleteDomainOwnershipIdentifierWithResponseAsync( - resourceGroupName, name, domainOwnershipIdentifierName, context) - .block(); - } - - /** - * Creates a domain ownership identifier for web app, or updates an existing ownership identifier. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param domainOwnershipIdentifierName Name of domain ownership identifier. - * @param domainOwnershipIdentifier A JSON representation of the domain ownership properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a domain specific resource identifier. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateDomainOwnershipIdentifierWithResponseAsync( - String resourceGroupName, - String name, - String domainOwnershipIdentifierName, - IdentifierInner domainOwnershipIdentifier) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (domainOwnershipIdentifierName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter domainOwnershipIdentifierName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (domainOwnershipIdentifier == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter domainOwnershipIdentifier is required and cannot be null.")); - } else { - domainOwnershipIdentifier.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updateDomainOwnershipIdentifier( - this.client.getEndpoint(), - resourceGroupName, - name, - domainOwnershipIdentifierName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - domainOwnershipIdentifier, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates a domain ownership identifier for web app, or updates an existing ownership identifier. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param domainOwnershipIdentifierName Name of domain ownership identifier. - * @param domainOwnershipIdentifier A JSON representation of the domain ownership properties. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a domain specific resource identifier. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateDomainOwnershipIdentifierWithResponseAsync( - String resourceGroupName, - String name, - String domainOwnershipIdentifierName, - IdentifierInner domainOwnershipIdentifier, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (domainOwnershipIdentifierName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter domainOwnershipIdentifierName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (domainOwnershipIdentifier == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter domainOwnershipIdentifier is required and cannot be null.")); - } else { - domainOwnershipIdentifier.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updateDomainOwnershipIdentifier( - this.client.getEndpoint(), - resourceGroupName, - name, - domainOwnershipIdentifierName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - domainOwnershipIdentifier, - accept, - context); - } - - /** - * Creates a domain ownership identifier for web app, or updates an existing ownership identifier. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param domainOwnershipIdentifierName Name of domain ownership identifier. - * @param domainOwnershipIdentifier A JSON representation of the domain ownership properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a domain specific resource identifier. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateDomainOwnershipIdentifierAsync( - String resourceGroupName, - String name, - String domainOwnershipIdentifierName, - IdentifierInner domainOwnershipIdentifier) { - return updateDomainOwnershipIdentifierWithResponseAsync( - resourceGroupName, name, domainOwnershipIdentifierName, domainOwnershipIdentifier) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates a domain ownership identifier for web app, or updates an existing ownership identifier. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param domainOwnershipIdentifierName Name of domain ownership identifier. - * @param domainOwnershipIdentifier A JSON representation of the domain ownership properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a domain specific resource identifier. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public IdentifierInner updateDomainOwnershipIdentifier( - String resourceGroupName, - String name, - String domainOwnershipIdentifierName, - IdentifierInner domainOwnershipIdentifier) { - return updateDomainOwnershipIdentifierAsync( - resourceGroupName, name, domainOwnershipIdentifierName, domainOwnershipIdentifier) - .block(); - } - - /** - * Creates a domain ownership identifier for web app, or updates an existing ownership identifier. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param domainOwnershipIdentifierName Name of domain ownership identifier. - * @param domainOwnershipIdentifier A JSON representation of the domain ownership properties. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a domain specific resource identifier. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateDomainOwnershipIdentifierWithResponse( - String resourceGroupName, - String name, - String domainOwnershipIdentifierName, - IdentifierInner domainOwnershipIdentifier, - Context context) { - return updateDomainOwnershipIdentifierWithResponseAsync( - resourceGroupName, name, domainOwnershipIdentifierName, domainOwnershipIdentifier, context) - .block(); - } - - /** - * Get the status of the last MSDeploy operation. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of the last MSDeploy operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getMSDeployStatusWithResponseAsync( - String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getMSDeployStatus( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the status of the last MSDeploy operation. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of the last MSDeploy operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getMSDeployStatusWithResponseAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getMSDeployStatus( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Get the status of the last MSDeploy operation. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of the last MSDeploy operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getMSDeployStatusAsync(String resourceGroupName, String name) { - return getMSDeployStatusWithResponseAsync(resourceGroupName, name) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get the status of the last MSDeploy operation. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of the last MSDeploy operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public MSDeployStatusInner getMSDeployStatus(String resourceGroupName, String name) { - return getMSDeployStatusAsync(resourceGroupName, name).block(); - } - - /** - * Get the status of the last MSDeploy operation. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of the last MSDeploy operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getMSDeployStatusWithResponse( - String resourceGroupName, String name, Context context) { - return getMSDeployStatusWithResponseAsync(resourceGroupName, name, context).block(); - } - - /** - * Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param mSDeploy Details of MSDeploy operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createMSDeployOperationWithResponseAsync( - String resourceGroupName, String name, MSDeploy mSDeploy) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (mSDeploy == null) { - return Mono.error(new IllegalArgumentException("Parameter mSDeploy is required and cannot be null.")); - } else { - mSDeploy.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createMSDeployOperation( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - mSDeploy, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param mSDeploy Details of MSDeploy operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createMSDeployOperationWithResponseAsync( - String resourceGroupName, String name, MSDeploy mSDeploy, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (mSDeploy == null) { - return Mono.error(new IllegalArgumentException("Parameter mSDeploy is required and cannot be null.")); - } else { - mSDeploy.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createMSDeployOperation( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - mSDeploy, - accept, - context); - } - - /** - * Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param mSDeploy Details of MSDeploy operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, MSDeployStatusInner> beginCreateMSDeployOperationAsync( - String resourceGroupName, String name, MSDeploy mSDeploy) { - Mono>> mono = - createMSDeployOperationWithResponseAsync(resourceGroupName, name, mSDeploy); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - MSDeployStatusInner.class, - MSDeployStatusInner.class, - Context.NONE); - } - - /** - * Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param mSDeploy Details of MSDeploy operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, MSDeployStatusInner> beginCreateMSDeployOperationAsync( - String resourceGroupName, String name, MSDeploy mSDeploy, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createMSDeployOperationWithResponseAsync(resourceGroupName, name, mSDeploy, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), MSDeployStatusInner.class, MSDeployStatusInner.class, context); - } - - /** - * Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param mSDeploy Details of MSDeploy operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, MSDeployStatusInner> beginCreateMSDeployOperation( - String resourceGroupName, String name, MSDeploy mSDeploy) { - return beginCreateMSDeployOperationAsync(resourceGroupName, name, mSDeploy).getSyncPoller(); - } - - /** - * Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param mSDeploy Details of MSDeploy operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, MSDeployStatusInner> beginCreateMSDeployOperation( - String resourceGroupName, String name, MSDeploy mSDeploy, Context context) { - return beginCreateMSDeployOperationAsync(resourceGroupName, name, mSDeploy, context).getSyncPoller(); - } - - /** - * Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param mSDeploy Details of MSDeploy operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createMSDeployOperationAsync( - String resourceGroupName, String name, MSDeploy mSDeploy) { - return beginCreateMSDeployOperationAsync(resourceGroupName, name, mSDeploy) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param mSDeploy Details of MSDeploy operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createMSDeployOperationAsync( - String resourceGroupName, String name, MSDeploy mSDeploy, Context context) { - return beginCreateMSDeployOperationAsync(resourceGroupName, name, mSDeploy, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param mSDeploy Details of MSDeploy operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public MSDeployStatusInner createMSDeployOperation(String resourceGroupName, String name, MSDeploy mSDeploy) { - return createMSDeployOperationAsync(resourceGroupName, name, mSDeploy).block(); - } - - /** - * Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param mSDeploy Details of MSDeploy operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public MSDeployStatusInner createMSDeployOperation( - String resourceGroupName, String name, MSDeploy mSDeploy, Context context) { - return createMSDeployOperationAsync(resourceGroupName, name, mSDeploy, context).block(); - } - - /** - * Get the MSDeploy Log for the last MSDeploy operation. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the MSDeploy Log for the last MSDeploy operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getMSDeployLogWithResponseAsync(String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getMSDeployLog( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the MSDeploy Log for the last MSDeploy operation. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the MSDeploy Log for the last MSDeploy operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getMSDeployLogWithResponseAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getMSDeployLog( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Get the MSDeploy Log for the last MSDeploy operation. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the MSDeploy Log for the last MSDeploy operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getMSDeployLogAsync(String resourceGroupName, String name) { - return getMSDeployLogWithResponseAsync(resourceGroupName, name) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get the MSDeploy Log for the last MSDeploy operation. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the MSDeploy Log for the last MSDeploy operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public MSDeployLogInner getMSDeployLog(String resourceGroupName, String name) { - return getMSDeployLogAsync(resourceGroupName, name).block(); - } - - /** - * Get the MSDeploy Log for the last MSDeploy operation. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the MSDeploy Log for the last MSDeploy operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getMSDeployLogWithResponse( - String resourceGroupName, String name, Context context) { - return getMSDeployLogWithResponseAsync(resourceGroupName, name, context).block(); - } - - /** - * List the functions for a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu function information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listFunctionsSinglePageAsync( - String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listFunctions( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List the functions for a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu function information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listFunctionsSinglePageAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listFunctions( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * List the functions for a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu function information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listFunctionsAsync(String resourceGroupName, String name) { - return new PagedFlux<>( - () -> listFunctionsSinglePageAsync(resourceGroupName, name), - nextLink -> listFunctionsNextSinglePageAsync(nextLink)); - } - - /** - * List the functions for a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu function information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listFunctionsAsync( - String resourceGroupName, String name, Context context) { - return new PagedFlux<>( - () -> listFunctionsSinglePageAsync(resourceGroupName, name, context), - nextLink -> listFunctionsNextSinglePageAsync(nextLink, context)); - } - - /** - * List the functions for a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu function information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listFunctions(String resourceGroupName, String name) { - return new PagedIterable<>(listFunctionsAsync(resourceGroupName, name)); - } - - /** - * List the functions for a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu function information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listFunctions(String resourceGroupName, String name, Context context) { - return new PagedIterable<>(listFunctionsAsync(resourceGroupName, name, context)); - } - - /** - * Fetch a short lived token that can be exchanged for a master key. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getFunctionsAdminTokenWithResponseAsync(String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getFunctionsAdminToken( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Fetch a short lived token that can be exchanged for a master key. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getFunctionsAdminTokenWithResponseAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getFunctionsAdminToken( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Fetch a short lived token that can be exchanged for a master key. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getFunctionsAdminTokenAsync(String resourceGroupName, String name) { - return getFunctionsAdminTokenWithResponseAsync(resourceGroupName, name) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Fetch a short lived token that can be exchanged for a master key. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public String getFunctionsAdminToken(String resourceGroupName, String name) { - return getFunctionsAdminTokenAsync(resourceGroupName, name).block(); - } - - /** - * Fetch a short lived token that can be exchanged for a master key. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getFunctionsAdminTokenWithResponse(String resourceGroupName, String name, Context context) { - return getFunctionsAdminTokenWithResponseAsync(resourceGroupName, name, context).block(); - } - - /** - * Get function information by its ID for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function information by its ID for web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getFunctionWithResponseAsync( - String resourceGroupName, String name, String functionName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (functionName == null) { - return Mono.error(new IllegalArgumentException("Parameter functionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getFunction( - this.client.getEndpoint(), - resourceGroupName, - name, - functionName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get function information by its ID for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function information by its ID for web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getFunctionWithResponseAsync( - String resourceGroupName, String name, String functionName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (functionName == null) { - return Mono.error(new IllegalArgumentException("Parameter functionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getFunction( - this.client.getEndpoint(), - resourceGroupName, - name, - functionName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Get function information by its ID for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function information by its ID for web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getFunctionAsync(String resourceGroupName, String name, String functionName) { - return getFunctionWithResponseAsync(resourceGroupName, name, functionName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get function information by its ID for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function information by its ID for web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public FunctionEnvelopeInner getFunction(String resourceGroupName, String name, String functionName) { - return getFunctionAsync(resourceGroupName, name, functionName).block(); - } - - /** - * Get function information by its ID for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function information by its ID for web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getFunctionWithResponse( - String resourceGroupName, String name, String functionName, Context context) { - return getFunctionWithResponseAsync(resourceGroupName, name, functionName, context).block(); - } - - /** - * Create function for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param functionEnvelope Function details. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createFunctionWithResponseAsync( - String resourceGroupName, String name, String functionName, FunctionEnvelopeInner functionEnvelope) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (functionName == null) { - return Mono.error(new IllegalArgumentException("Parameter functionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (functionEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter functionEnvelope is required and cannot be null.")); - } else { - functionEnvelope.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createFunction( - this.client.getEndpoint(), - resourceGroupName, - name, - functionName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - functionEnvelope, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create function for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param functionEnvelope Function details. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createFunctionWithResponseAsync( - String resourceGroupName, - String name, - String functionName, - FunctionEnvelopeInner functionEnvelope, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (functionName == null) { - return Mono.error(new IllegalArgumentException("Parameter functionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (functionEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter functionEnvelope is required and cannot be null.")); - } else { - functionEnvelope.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createFunction( - this.client.getEndpoint(), - resourceGroupName, - name, - functionName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - functionEnvelope, - accept, - context); - } - - /** - * Create function for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param functionEnvelope Function details. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, FunctionEnvelopeInner> beginCreateFunctionAsync( - String resourceGroupName, String name, String functionName, FunctionEnvelopeInner functionEnvelope) { - Mono>> mono = - createFunctionWithResponseAsync(resourceGroupName, name, functionName, functionEnvelope); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - FunctionEnvelopeInner.class, - FunctionEnvelopeInner.class, - Context.NONE); - } - - /** - * Create function for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param functionEnvelope Function details. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, FunctionEnvelopeInner> beginCreateFunctionAsync( - String resourceGroupName, - String name, - String functionName, - FunctionEnvelopeInner functionEnvelope, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createFunctionWithResponseAsync(resourceGroupName, name, functionName, functionEnvelope, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), FunctionEnvelopeInner.class, FunctionEnvelopeInner.class, context); - } - - /** - * Create function for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param functionEnvelope Function details. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, FunctionEnvelopeInner> beginCreateFunction( - String resourceGroupName, String name, String functionName, FunctionEnvelopeInner functionEnvelope) { - return beginCreateFunctionAsync(resourceGroupName, name, functionName, functionEnvelope).getSyncPoller(); - } - - /** - * Create function for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param functionEnvelope Function details. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, FunctionEnvelopeInner> beginCreateFunction( - String resourceGroupName, - String name, - String functionName, - FunctionEnvelopeInner functionEnvelope, - Context context) { - return beginCreateFunctionAsync(resourceGroupName, name, functionName, functionEnvelope, context) - .getSyncPoller(); - } - - /** - * Create function for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param functionEnvelope Function details. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createFunctionAsync( - String resourceGroupName, String name, String functionName, FunctionEnvelopeInner functionEnvelope) { - return beginCreateFunctionAsync(resourceGroupName, name, functionName, functionEnvelope) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create function for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param functionEnvelope Function details. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createFunctionAsync( - String resourceGroupName, - String name, - String functionName, - FunctionEnvelopeInner functionEnvelope, - Context context) { - return beginCreateFunctionAsync(resourceGroupName, name, functionName, functionEnvelope, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create function for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param functionEnvelope Function details. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public FunctionEnvelopeInner createFunction( - String resourceGroupName, String name, String functionName, FunctionEnvelopeInner functionEnvelope) { - return createFunctionAsync(resourceGroupName, name, functionName, functionEnvelope).block(); - } - - /** - * Create function for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param functionEnvelope Function details. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public FunctionEnvelopeInner createFunction( - String resourceGroupName, - String name, - String functionName, - FunctionEnvelopeInner functionEnvelope, - Context context) { - return createFunctionAsync(resourceGroupName, name, functionName, functionEnvelope, context).block(); - } - - /** - * Delete a function for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteFunctionWithResponseAsync( - String resourceGroupName, String name, String functionName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (functionName == null) { - return Mono.error(new IllegalArgumentException("Parameter functionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .deleteFunction( - this.client.getEndpoint(), - resourceGroupName, - name, - functionName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete a function for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteFunctionWithResponseAsync( - String resourceGroupName, String name, String functionName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (functionName == null) { - return Mono.error(new IllegalArgumentException("Parameter functionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .deleteFunction( - this.client.getEndpoint(), - resourceGroupName, - name, - functionName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Delete a function for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteFunctionAsync(String resourceGroupName, String name, String functionName) { - return deleteFunctionWithResponseAsync(resourceGroupName, name, functionName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Delete a function for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteFunction(String resourceGroupName, String name, String functionName) { - deleteFunctionAsync(resourceGroupName, name, functionName).block(); - } - - /** - * Delete a function for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteFunctionWithResponse( - String resourceGroupName, String name, String functionName, Context context) { - return deleteFunctionWithResponseAsync(resourceGroupName, name, functionName, context).block(); - } - - /** - * Add or update a function secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName The name of the function. - * @param keyName The name of the key. - * @param key The key to create or update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function key info. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateFunctionSecretWithResponseAsync( - String resourceGroupName, String name, String functionName, String keyName, KeyInfoInner key) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (functionName == null) { - return Mono.error(new IllegalArgumentException("Parameter functionName is required and cannot be null.")); - } - if (keyName == null) { - return Mono.error(new IllegalArgumentException("Parameter keyName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (key == null) { - return Mono.error(new IllegalArgumentException("Parameter key is required and cannot be null.")); - } else { - key.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdateFunctionSecret( - this.client.getEndpoint(), - resourceGroupName, - name, - functionName, - keyName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - key, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Add or update a function secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName The name of the function. - * @param keyName The name of the key. - * @param key The key to create or update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function key info. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateFunctionSecretWithResponseAsync( - String resourceGroupName, String name, String functionName, String keyName, KeyInfoInner key, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (functionName == null) { - return Mono.error(new IllegalArgumentException("Parameter functionName is required and cannot be null.")); - } - if (keyName == null) { - return Mono.error(new IllegalArgumentException("Parameter keyName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (key == null) { - return Mono.error(new IllegalArgumentException("Parameter key is required and cannot be null.")); - } else { - key.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdateFunctionSecret( - this.client.getEndpoint(), - resourceGroupName, - name, - functionName, - keyName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - key, - accept, - context); - } - - /** - * Add or update a function secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName The name of the function. - * @param keyName The name of the key. - * @param key The key to create or update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function key info. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateFunctionSecretAsync( - String resourceGroupName, String name, String functionName, String keyName, KeyInfoInner key) { - return createOrUpdateFunctionSecretWithResponseAsync(resourceGroupName, name, functionName, keyName, key) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Add or update a function secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName The name of the function. - * @param keyName The name of the key. - * @param key The key to create or update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function key info. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public KeyInfoInner createOrUpdateFunctionSecret( - String resourceGroupName, String name, String functionName, String keyName, KeyInfoInner key) { - return createOrUpdateFunctionSecretAsync(resourceGroupName, name, functionName, keyName, key).block(); - } - - /** - * Add or update a function secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName The name of the function. - * @param keyName The name of the key. - * @param key The key to create or update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function key info. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateFunctionSecretWithResponse( - String resourceGroupName, String name, String functionName, String keyName, KeyInfoInner key, Context context) { - return createOrUpdateFunctionSecretWithResponseAsync( - resourceGroupName, name, functionName, keyName, key, context) - .block(); - } - - /** - * Delete a function secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName The name of the function. - * @param keyName The name of the key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteFunctionSecretWithResponseAsync( - String resourceGroupName, String name, String functionName, String keyName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (functionName == null) { - return Mono.error(new IllegalArgumentException("Parameter functionName is required and cannot be null.")); - } - if (keyName == null) { - return Mono.error(new IllegalArgumentException("Parameter keyName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .deleteFunctionSecret( - this.client.getEndpoint(), - resourceGroupName, - name, - functionName, - keyName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete a function secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName The name of the function. - * @param keyName The name of the key. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteFunctionSecretWithResponseAsync( - String resourceGroupName, String name, String functionName, String keyName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (functionName == null) { - return Mono.error(new IllegalArgumentException("Parameter functionName is required and cannot be null.")); - } - if (keyName == null) { - return Mono.error(new IllegalArgumentException("Parameter keyName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .deleteFunctionSecret( - this.client.getEndpoint(), - resourceGroupName, - name, - functionName, - keyName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Delete a function secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName The name of the function. - * @param keyName The name of the key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteFunctionSecretAsync( - String resourceGroupName, String name, String functionName, String keyName) { - return deleteFunctionSecretWithResponseAsync(resourceGroupName, name, functionName, keyName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Delete a function secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName The name of the function. - * @param keyName The name of the key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteFunctionSecret(String resourceGroupName, String name, String functionName, String keyName) { - deleteFunctionSecretAsync(resourceGroupName, name, functionName, keyName).block(); - } - - /** - * Delete a function secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName The name of the function. - * @param keyName The name of the key. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteFunctionSecretWithResponse( - String resourceGroupName, String name, String functionName, String keyName, Context context) { - return deleteFunctionSecretWithResponseAsync(resourceGroupName, name, functionName, keyName, context).block(); - } - - /** - * Get function keys for a function in a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function keys for a function in a web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listFunctionKeysWithResponseAsync( - String resourceGroupName, String name, String functionName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (functionName == null) { - return Mono.error(new IllegalArgumentException("Parameter functionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listFunctionKeys( - this.client.getEndpoint(), - resourceGroupName, - name, - functionName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get function keys for a function in a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function keys for a function in a web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listFunctionKeysWithResponseAsync( - String resourceGroupName, String name, String functionName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (functionName == null) { - return Mono.error(new IllegalArgumentException("Parameter functionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listFunctionKeys( - this.client.getEndpoint(), - resourceGroupName, - name, - functionName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Get function keys for a function in a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function keys for a function in a web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listFunctionKeysAsync( - String resourceGroupName, String name, String functionName) { - return listFunctionKeysWithResponseAsync(resourceGroupName, name, functionName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get function keys for a function in a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function keys for a function in a web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public StringDictionaryInner listFunctionKeys(String resourceGroupName, String name, String functionName) { - return listFunctionKeysAsync(resourceGroupName, name, functionName).block(); - } - - /** - * Get function keys for a function in a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function keys for a function in a web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listFunctionKeysWithResponse( - String resourceGroupName, String name, String functionName, Context context) { - return listFunctionKeysWithResponseAsync(resourceGroupName, name, functionName, context).block(); - } - - /** - * Get function secrets for a function in a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function secrets for a function in a web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listFunctionSecretsWithResponseAsync( - String resourceGroupName, String name, String functionName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (functionName == null) { - return Mono.error(new IllegalArgumentException("Parameter functionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listFunctionSecrets( - this.client.getEndpoint(), - resourceGroupName, - name, - functionName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get function secrets for a function in a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function secrets for a function in a web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listFunctionSecretsWithResponseAsync( - String resourceGroupName, String name, String functionName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (functionName == null) { - return Mono.error(new IllegalArgumentException("Parameter functionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listFunctionSecrets( - this.client.getEndpoint(), - resourceGroupName, - name, - functionName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Get function secrets for a function in a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function secrets for a function in a web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listFunctionSecretsAsync( - String resourceGroupName, String name, String functionName) { - return listFunctionSecretsWithResponseAsync(resourceGroupName, name, functionName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get function secrets for a function in a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function secrets for a function in a web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public FunctionSecretsInner listFunctionSecrets(String resourceGroupName, String name, String functionName) { - return listFunctionSecretsAsync(resourceGroupName, name, functionName).block(); - } - - /** - * Get function secrets for a function in a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function secrets for a function in a web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listFunctionSecretsWithResponse( - String resourceGroupName, String name, String functionName, Context context) { - return listFunctionSecretsWithResponseAsync(resourceGroupName, name, functionName, context).block(); - } - - /** - * Get host secrets for a function app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return host secrets for a function app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listHostKeysWithResponseAsync(String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listHostKeys( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get host secrets for a function app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return host secrets for a function app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listHostKeysWithResponseAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listHostKeys( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Get host secrets for a function app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return host secrets for a function app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listHostKeysAsync(String resourceGroupName, String name) { - return listHostKeysWithResponseAsync(resourceGroupName, name) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get host secrets for a function app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return host secrets for a function app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public HostKeysInner listHostKeys(String resourceGroupName, String name) { - return listHostKeysAsync(resourceGroupName, name).block(); - } - - /** - * Get host secrets for a function app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return host secrets for a function app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listHostKeysWithResponse(String resourceGroupName, String name, Context context) { - return listHostKeysWithResponseAsync(resourceGroupName, name, context).block(); - } - - /** - * This is to allow calling via powershell and ARM template. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listSyncStatusWithResponseAsync(String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listSyncStatus( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * This is to allow calling via powershell and ARM template. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSyncStatusWithResponseAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listSyncStatus( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * This is to allow calling via powershell and ARM template. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listSyncStatusAsync(String resourceGroupName, String name) { - return listSyncStatusWithResponseAsync(resourceGroupName, name).flatMap((Response res) -> Mono.empty()); - } - - /** - * This is to allow calling via powershell and ARM template. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void listSyncStatus(String resourceGroupName, String name) { - listSyncStatusAsync(resourceGroupName, name).block(); - } - - /** - * This is to allow calling via powershell and ARM template. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listSyncStatusWithResponse(String resourceGroupName, String name, Context context) { - return listSyncStatusWithResponseAsync(resourceGroupName, name, context).block(); - } - - /** - * Syncs function trigger metadata to the management database. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> syncFunctionsWithResponseAsync(String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .syncFunctions( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Syncs function trigger metadata to the management database. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> syncFunctionsWithResponseAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .syncFunctions( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Syncs function trigger metadata to the management database. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono syncFunctionsAsync(String resourceGroupName, String name) { - return syncFunctionsWithResponseAsync(resourceGroupName, name).flatMap((Response res) -> Mono.empty()); - } - - /** - * Syncs function trigger metadata to the management database. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void syncFunctions(String resourceGroupName, String name) { - syncFunctionsAsync(resourceGroupName, name).block(); - } - - /** - * Syncs function trigger metadata to the management database. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response syncFunctionsWithResponse(String resourceGroupName, String name, Context context) { - return syncFunctionsWithResponseAsync(resourceGroupName, name, context).block(); - } - - /** - * Add or update a host level secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param keyType The type of host key. - * @param keyName The name of the key. - * @param key The key to create or update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function key info. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateHostSecretWithResponseAsync( - String resourceGroupName, String name, String keyType, String keyName, KeyInfoInner key) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (keyType == null) { - return Mono.error(new IllegalArgumentException("Parameter keyType is required and cannot be null.")); - } - if (keyName == null) { - return Mono.error(new IllegalArgumentException("Parameter keyName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (key == null) { - return Mono.error(new IllegalArgumentException("Parameter key is required and cannot be null.")); - } else { - key.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdateHostSecret( - this.client.getEndpoint(), - resourceGroupName, - name, - keyType, - keyName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - key, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Add or update a host level secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param keyType The type of host key. - * @param keyName The name of the key. - * @param key The key to create or update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function key info. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateHostSecretWithResponseAsync( - String resourceGroupName, String name, String keyType, String keyName, KeyInfoInner key, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (keyType == null) { - return Mono.error(new IllegalArgumentException("Parameter keyType is required and cannot be null.")); - } - if (keyName == null) { - return Mono.error(new IllegalArgumentException("Parameter keyName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (key == null) { - return Mono.error(new IllegalArgumentException("Parameter key is required and cannot be null.")); - } else { - key.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdateHostSecret( - this.client.getEndpoint(), - resourceGroupName, - name, - keyType, - keyName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - key, - accept, - context); - } - - /** - * Add or update a host level secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param keyType The type of host key. - * @param keyName The name of the key. - * @param key The key to create or update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function key info. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateHostSecretAsync( - String resourceGroupName, String name, String keyType, String keyName, KeyInfoInner key) { - return createOrUpdateHostSecretWithResponseAsync(resourceGroupName, name, keyType, keyName, key) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Add or update a host level secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param keyType The type of host key. - * @param keyName The name of the key. - * @param key The key to create or update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function key info. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public KeyInfoInner createOrUpdateHostSecret( - String resourceGroupName, String name, String keyType, String keyName, KeyInfoInner key) { - return createOrUpdateHostSecretAsync(resourceGroupName, name, keyType, keyName, key).block(); - } - - /** - * Add or update a host level secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param keyType The type of host key. - * @param keyName The name of the key. - * @param key The key to create or update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function key info. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateHostSecretWithResponse( - String resourceGroupName, String name, String keyType, String keyName, KeyInfoInner key, Context context) { - return createOrUpdateHostSecretWithResponseAsync(resourceGroupName, name, keyType, keyName, key, context) - .block(); - } - - /** - * Delete a host level secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param keyType The type of host key. - * @param keyName The name of the key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteHostSecretWithResponseAsync( - String resourceGroupName, String name, String keyType, String keyName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (keyType == null) { - return Mono.error(new IllegalArgumentException("Parameter keyType is required and cannot be null.")); - } - if (keyName == null) { - return Mono.error(new IllegalArgumentException("Parameter keyName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .deleteHostSecret( - this.client.getEndpoint(), - resourceGroupName, - name, - keyType, - keyName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete a host level secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param keyType The type of host key. - * @param keyName The name of the key. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteHostSecretWithResponseAsync( - String resourceGroupName, String name, String keyType, String keyName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (keyType == null) { - return Mono.error(new IllegalArgumentException("Parameter keyType is required and cannot be null.")); - } - if (keyName == null) { - return Mono.error(new IllegalArgumentException("Parameter keyName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .deleteHostSecret( - this.client.getEndpoint(), - resourceGroupName, - name, - keyType, - keyName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Delete a host level secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param keyType The type of host key. - * @param keyName The name of the key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteHostSecretAsync(String resourceGroupName, String name, String keyType, String keyName) { - return deleteHostSecretWithResponseAsync(resourceGroupName, name, keyType, keyName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Delete a host level secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param keyType The type of host key. - * @param keyName The name of the key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteHostSecret(String resourceGroupName, String name, String keyType, String keyName) { - deleteHostSecretAsync(resourceGroupName, name, keyType, keyName).block(); - } - - /** - * Delete a host level secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param keyType The type of host key. - * @param keyName The name of the key. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteHostSecretWithResponse( - String resourceGroupName, String name, String keyType, String keyName, Context context) { - return deleteHostSecretWithResponseAsync(resourceGroupName, name, keyType, keyName, context).block(); - } - - /** - * Get hostname bindings for an app or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hostname bindings for an app or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listHostnameBindingsSinglePageAsync( - String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listHostnameBindings( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get hostname bindings for an app or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hostname bindings for an app or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listHostnameBindingsSinglePageAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listHostnameBindings( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get hostname bindings for an app or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hostname bindings for an app or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listHostnameBindingsAsync(String resourceGroupName, String name) { - return new PagedFlux<>( - () -> listHostnameBindingsSinglePageAsync(resourceGroupName, name), - nextLink -> listHostnameBindingsNextSinglePageAsync(nextLink)); - } - - /** - * Get hostname bindings for an app or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hostname bindings for an app or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listHostnameBindingsAsync( - String resourceGroupName, String name, Context context) { - return new PagedFlux<>( - () -> listHostnameBindingsSinglePageAsync(resourceGroupName, name, context), - nextLink -> listHostnameBindingsNextSinglePageAsync(nextLink, context)); - } - - /** - * Get hostname bindings for an app or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hostname bindings for an app or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listHostnameBindings(String resourceGroupName, String name) { - return new PagedIterable<>(listHostnameBindingsAsync(resourceGroupName, name)); - } - - /** - * Get hostname bindings for an app or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hostname bindings for an app or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listHostnameBindings( - String resourceGroupName, String name, Context context) { - return new PagedIterable<>(listHostnameBindingsAsync(resourceGroupName, name, context)); - } - - /** - * Get the named hostname binding for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param hostname Hostname in the hostname binding. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the named hostname binding for an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getHostnameBindingWithResponseAsync( - String resourceGroupName, String name, String hostname) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (hostname == null) { - return Mono.error(new IllegalArgumentException("Parameter hostname is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getHostnameBinding( - this.client.getEndpoint(), - resourceGroupName, - name, - hostname, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the named hostname binding for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param hostname Hostname in the hostname binding. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the named hostname binding for an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getHostnameBindingWithResponseAsync( - String resourceGroupName, String name, String hostname, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (hostname == null) { - return Mono.error(new IllegalArgumentException("Parameter hostname is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getHostnameBinding( - this.client.getEndpoint(), - resourceGroupName, - name, - hostname, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Get the named hostname binding for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param hostname Hostname in the hostname binding. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the named hostname binding for an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getHostnameBindingAsync(String resourceGroupName, String name, String hostname) { - return getHostnameBindingWithResponseAsync(resourceGroupName, name, hostname) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get the named hostname binding for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param hostname Hostname in the hostname binding. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the named hostname binding for an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public HostnameBindingInner getHostnameBinding(String resourceGroupName, String name, String hostname) { - return getHostnameBindingAsync(resourceGroupName, name, hostname).block(); - } - - /** - * Get the named hostname binding for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param hostname Hostname in the hostname binding. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the named hostname binding for an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getHostnameBindingWithResponse( - String resourceGroupName, String name, String hostname, Context context) { - return getHostnameBindingWithResponseAsync(resourceGroupName, name, hostname, context).block(); - } - - /** - * Creates a hostname binding for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param hostname Hostname in the hostname binding. - * @param hostnameBinding Binding details. This is the JSON representation of a HostNameBinding object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a hostname binding object. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateHostnameBindingWithResponseAsync( - String resourceGroupName, String name, String hostname, HostnameBindingInner hostnameBinding) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (hostname == null) { - return Mono.error(new IllegalArgumentException("Parameter hostname is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (hostnameBinding == null) { - return Mono - .error(new IllegalArgumentException("Parameter hostnameBinding is required and cannot be null.")); - } else { - hostnameBinding.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdateHostnameBinding( - this.client.getEndpoint(), - resourceGroupName, - name, - hostname, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - hostnameBinding, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates a hostname binding for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param hostname Hostname in the hostname binding. - * @param hostnameBinding Binding details. This is the JSON representation of a HostNameBinding object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a hostname binding object. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateHostnameBindingWithResponseAsync( - String resourceGroupName, String name, String hostname, HostnameBindingInner hostnameBinding, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (hostname == null) { - return Mono.error(new IllegalArgumentException("Parameter hostname is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (hostnameBinding == null) { - return Mono - .error(new IllegalArgumentException("Parameter hostnameBinding is required and cannot be null.")); - } else { - hostnameBinding.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdateHostnameBinding( - this.client.getEndpoint(), - resourceGroupName, - name, - hostname, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - hostnameBinding, - accept, - context); - } - - /** - * Creates a hostname binding for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param hostname Hostname in the hostname binding. - * @param hostnameBinding Binding details. This is the JSON representation of a HostNameBinding object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a hostname binding object. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateHostnameBindingAsync( - String resourceGroupName, String name, String hostname, HostnameBindingInner hostnameBinding) { - return createOrUpdateHostnameBindingWithResponseAsync(resourceGroupName, name, hostname, hostnameBinding) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates a hostname binding for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param hostname Hostname in the hostname binding. - * @param hostnameBinding Binding details. This is the JSON representation of a HostNameBinding object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a hostname binding object. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public HostnameBindingInner createOrUpdateHostnameBinding( - String resourceGroupName, String name, String hostname, HostnameBindingInner hostnameBinding) { - return createOrUpdateHostnameBindingAsync(resourceGroupName, name, hostname, hostnameBinding).block(); - } - - /** - * Creates a hostname binding for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param hostname Hostname in the hostname binding. - * @param hostnameBinding Binding details. This is the JSON representation of a HostNameBinding object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a hostname binding object. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateHostnameBindingWithResponse( - String resourceGroupName, String name, String hostname, HostnameBindingInner hostnameBinding, Context context) { - return createOrUpdateHostnameBindingWithResponseAsync( - resourceGroupName, name, hostname, hostnameBinding, context) - .block(); - } - - /** - * Deletes a hostname binding for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param hostname Hostname in the hostname binding. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteHostnameBindingWithResponseAsync( - String resourceGroupName, String name, String hostname) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (hostname == null) { - return Mono.error(new IllegalArgumentException("Parameter hostname is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .deleteHostnameBinding( - this.client.getEndpoint(), - resourceGroupName, - name, - hostname, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a hostname binding for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param hostname Hostname in the hostname binding. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteHostnameBindingWithResponseAsync( - String resourceGroupName, String name, String hostname, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (hostname == null) { - return Mono.error(new IllegalArgumentException("Parameter hostname is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .deleteHostnameBinding( - this.client.getEndpoint(), - resourceGroupName, - name, - hostname, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Deletes a hostname binding for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param hostname Hostname in the hostname binding. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteHostnameBindingAsync(String resourceGroupName, String name, String hostname) { - return deleteHostnameBindingWithResponseAsync(resourceGroupName, name, hostname) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes a hostname binding for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param hostname Hostname in the hostname binding. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteHostnameBinding(String resourceGroupName, String name, String hostname) { - deleteHostnameBindingAsync(resourceGroupName, name, hostname).block(); - } - - /** - * Deletes a hostname binding for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param hostname Hostname in the hostname binding. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteHostnameBindingWithResponse( - String resourceGroupName, String name, String hostname, Context context) { - return deleteHostnameBindingWithResponseAsync(resourceGroupName, name, hostname, context).block(); - } - - /** - * Retrieves a specific Service Bus Hybrid Connection used by this Web App. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getHybridConnectionWithResponseAsync( - String resourceGroupName, String name, String namespaceName, String relayName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (relayName == null) { - return Mono.error(new IllegalArgumentException("Parameter relayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getHybridConnection( - this.client.getEndpoint(), - resourceGroupName, - name, - namespaceName, - relayName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Retrieves a specific Service Bus Hybrid Connection used by this Web App. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getHybridConnectionWithResponseAsync( - String resourceGroupName, String name, String namespaceName, String relayName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (relayName == null) { - return Mono.error(new IllegalArgumentException("Parameter relayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getHybridConnection( - this.client.getEndpoint(), - resourceGroupName, - name, - namespaceName, - relayName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Retrieves a specific Service Bus Hybrid Connection used by this Web App. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getHybridConnectionAsync( - String resourceGroupName, String name, String namespaceName, String relayName) { - return getHybridConnectionWithResponseAsync(resourceGroupName, name, namespaceName, relayName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Retrieves a specific Service Bus Hybrid Connection used by this Web App. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public HybridConnectionInner getHybridConnection( - String resourceGroupName, String name, String namespaceName, String relayName) { - return getHybridConnectionAsync(resourceGroupName, name, namespaceName, relayName).block(); - } - - /** - * Retrieves a specific Service Bus Hybrid Connection used by this Web App. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getHybridConnectionWithResponse( - String resourceGroupName, String name, String namespaceName, String relayName, Context context) { - return getHybridConnectionWithResponseAsync(resourceGroupName, name, namespaceName, relayName, context).block(); - } - - /** - * Creates a new Hybrid Connection using a Service Bus relay. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @param connectionEnvelope The details of the hybrid connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateHybridConnectionWithResponseAsync( - String resourceGroupName, - String name, - String namespaceName, - String relayName, - HybridConnectionInner connectionEnvelope) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (relayName == null) { - return Mono.error(new IllegalArgumentException("Parameter relayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (connectionEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter connectionEnvelope is required and cannot be null.")); - } else { - connectionEnvelope.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdateHybridConnection( - this.client.getEndpoint(), - resourceGroupName, - name, - namespaceName, - relayName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - connectionEnvelope, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates a new Hybrid Connection using a Service Bus relay. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @param connectionEnvelope The details of the hybrid connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateHybridConnectionWithResponseAsync( - String resourceGroupName, - String name, - String namespaceName, - String relayName, - HybridConnectionInner connectionEnvelope, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (relayName == null) { - return Mono.error(new IllegalArgumentException("Parameter relayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (connectionEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter connectionEnvelope is required and cannot be null.")); - } else { - connectionEnvelope.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdateHybridConnection( - this.client.getEndpoint(), - resourceGroupName, - name, - namespaceName, - relayName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - connectionEnvelope, - accept, - context); - } - - /** - * Creates a new Hybrid Connection using a Service Bus relay. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @param connectionEnvelope The details of the hybrid connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateHybridConnectionAsync( - String resourceGroupName, - String name, - String namespaceName, - String relayName, - HybridConnectionInner connectionEnvelope) { - return createOrUpdateHybridConnectionWithResponseAsync( - resourceGroupName, name, namespaceName, relayName, connectionEnvelope) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates a new Hybrid Connection using a Service Bus relay. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @param connectionEnvelope The details of the hybrid connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public HybridConnectionInner createOrUpdateHybridConnection( - String resourceGroupName, - String name, - String namespaceName, - String relayName, - HybridConnectionInner connectionEnvelope) { - return createOrUpdateHybridConnectionAsync( - resourceGroupName, name, namespaceName, relayName, connectionEnvelope) - .block(); - } - - /** - * Creates a new Hybrid Connection using a Service Bus relay. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @param connectionEnvelope The details of the hybrid connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateHybridConnectionWithResponse( - String resourceGroupName, - String name, - String namespaceName, - String relayName, - HybridConnectionInner connectionEnvelope, - Context context) { - return createOrUpdateHybridConnectionWithResponseAsync( - resourceGroupName, name, namespaceName, relayName, connectionEnvelope, context) - .block(); - } - - /** - * Removes a Hybrid Connection from this site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteHybridConnectionWithResponseAsync( - String resourceGroupName, String name, String namespaceName, String relayName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (relayName == null) { - return Mono.error(new IllegalArgumentException("Parameter relayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .deleteHybridConnection( - this.client.getEndpoint(), - resourceGroupName, - name, - namespaceName, - relayName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Removes a Hybrid Connection from this site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteHybridConnectionWithResponseAsync( - String resourceGroupName, String name, String namespaceName, String relayName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (relayName == null) { - return Mono.error(new IllegalArgumentException("Parameter relayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .deleteHybridConnection( - this.client.getEndpoint(), - resourceGroupName, - name, - namespaceName, - relayName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Removes a Hybrid Connection from this site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteHybridConnectionAsync( - String resourceGroupName, String name, String namespaceName, String relayName) { - return deleteHybridConnectionWithResponseAsync(resourceGroupName, name, namespaceName, relayName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Removes a Hybrid Connection from this site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteHybridConnection(String resourceGroupName, String name, String namespaceName, String relayName) { - deleteHybridConnectionAsync(resourceGroupName, name, namespaceName, relayName).block(); - } - - /** - * Removes a Hybrid Connection from this site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteHybridConnectionWithResponse( - String resourceGroupName, String name, String namespaceName, String relayName, Context context) { - return deleteHybridConnectionWithResponseAsync(resourceGroupName, name, namespaceName, relayName, context) - .block(); - } - - /** - * Creates a new Hybrid Connection using a Service Bus relay. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @param connectionEnvelope The details of the hybrid connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateHybridConnectionWithResponseAsync( - String resourceGroupName, - String name, - String namespaceName, - String relayName, - HybridConnectionInner connectionEnvelope) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (relayName == null) { - return Mono.error(new IllegalArgumentException("Parameter relayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (connectionEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter connectionEnvelope is required and cannot be null.")); - } else { - connectionEnvelope.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updateHybridConnection( - this.client.getEndpoint(), - resourceGroupName, - name, - namespaceName, - relayName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - connectionEnvelope, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates a new Hybrid Connection using a Service Bus relay. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @param connectionEnvelope The details of the hybrid connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateHybridConnectionWithResponseAsync( - String resourceGroupName, - String name, - String namespaceName, - String relayName, - HybridConnectionInner connectionEnvelope, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (relayName == null) { - return Mono.error(new IllegalArgumentException("Parameter relayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (connectionEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter connectionEnvelope is required and cannot be null.")); - } else { - connectionEnvelope.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updateHybridConnection( - this.client.getEndpoint(), - resourceGroupName, - name, - namespaceName, - relayName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - connectionEnvelope, - accept, - context); - } - - /** - * Creates a new Hybrid Connection using a Service Bus relay. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @param connectionEnvelope The details of the hybrid connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateHybridConnectionAsync( - String resourceGroupName, - String name, - String namespaceName, - String relayName, - HybridConnectionInner connectionEnvelope) { - return updateHybridConnectionWithResponseAsync( - resourceGroupName, name, namespaceName, relayName, connectionEnvelope) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates a new Hybrid Connection using a Service Bus relay. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @param connectionEnvelope The details of the hybrid connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public HybridConnectionInner updateHybridConnection( - String resourceGroupName, - String name, - String namespaceName, - String relayName, - HybridConnectionInner connectionEnvelope) { - return updateHybridConnectionAsync(resourceGroupName, name, namespaceName, relayName, connectionEnvelope) - .block(); - } - - /** - * Creates a new Hybrid Connection using a Service Bus relay. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @param connectionEnvelope The details of the hybrid connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateHybridConnectionWithResponse( - String resourceGroupName, - String name, - String namespaceName, - String relayName, - HybridConnectionInner connectionEnvelope, - Context context) { - return updateHybridConnectionWithResponseAsync( - resourceGroupName, name, namespaceName, relayName, connectionEnvelope, context) - .block(); - } - - /** - * Gets the send key name and value for a Hybrid Connection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the send key name and value for a Hybrid Connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listHybridConnectionKeysWithResponseAsync( - String resourceGroupName, String name, String namespaceName, String relayName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (relayName == null) { - return Mono.error(new IllegalArgumentException("Parameter relayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listHybridConnectionKeys( - this.client.getEndpoint(), - resourceGroupName, - name, - namespaceName, - relayName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the send key name and value for a Hybrid Connection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the send key name and value for a Hybrid Connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listHybridConnectionKeysWithResponseAsync( - String resourceGroupName, String name, String namespaceName, String relayName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (relayName == null) { - return Mono.error(new IllegalArgumentException("Parameter relayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listHybridConnectionKeys( - this.client.getEndpoint(), - resourceGroupName, - name, - namespaceName, - relayName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets the send key name and value for a Hybrid Connection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the send key name and value for a Hybrid Connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listHybridConnectionKeysAsync( - String resourceGroupName, String name, String namespaceName, String relayName) { - return listHybridConnectionKeysWithResponseAsync(resourceGroupName, name, namespaceName, relayName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the send key name and value for a Hybrid Connection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the send key name and value for a Hybrid Connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public HybridConnectionKeyInner listHybridConnectionKeys( - String resourceGroupName, String name, String namespaceName, String relayName) { - return listHybridConnectionKeysAsync(resourceGroupName, name, namespaceName, relayName).block(); - } - - /** - * Gets the send key name and value for a Hybrid Connection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the send key name and value for a Hybrid Connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listHybridConnectionKeysWithResponse( - String resourceGroupName, String name, String namespaceName, String relayName, Context context) { - return listHybridConnectionKeysWithResponseAsync(resourceGroupName, name, namespaceName, relayName, context) - .block(); - } - - /** - * Retrieves all Service Bus Hybrid Connections used by this Web App. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listHybridConnectionsWithResponseAsync( - String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listHybridConnections( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Retrieves all Service Bus Hybrid Connections used by this Web App. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listHybridConnectionsWithResponseAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listHybridConnections( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Retrieves all Service Bus Hybrid Connections used by this Web App. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listHybridConnectionsAsync(String resourceGroupName, String name) { - return listHybridConnectionsWithResponseAsync(resourceGroupName, name) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Retrieves all Service Bus Hybrid Connections used by this Web App. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public HybridConnectionInner listHybridConnections(String resourceGroupName, String name) { - return listHybridConnectionsAsync(resourceGroupName, name).block(); - } - - /** - * Retrieves all Service Bus Hybrid Connections used by this Web App. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listHybridConnectionsWithResponse( - String resourceGroupName, String name, Context context) { - return listHybridConnectionsWithResponseAsync(resourceGroupName, name, context).block(); - } - - /** - * Gets hybrid connections configured for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid connections configured for an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listRelayServiceConnectionsWithResponseAsync( - String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listRelayServiceConnections( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets hybrid connections configured for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid connections configured for an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listRelayServiceConnectionsWithResponseAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listRelayServiceConnections( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets hybrid connections configured for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid connections configured for an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listRelayServiceConnectionsAsync( - String resourceGroupName, String name) { - return listRelayServiceConnectionsWithResponseAsync(resourceGroupName, name) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets hybrid connections configured for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid connections configured for an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RelayServiceConnectionEntityInner listRelayServiceConnections(String resourceGroupName, String name) { - return listRelayServiceConnectionsAsync(resourceGroupName, name).block(); - } - - /** - * Gets hybrid connections configured for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid connections configured for an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listRelayServiceConnectionsWithResponse( - String resourceGroupName, String name, Context context) { - return listRelayServiceConnectionsWithResponseAsync(resourceGroupName, name, context).block(); - } - - /** - * Gets a hybrid connection configuration by its name. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param entityName Name of the hybrid connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a hybrid connection configuration by its name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getRelayServiceConnectionWithResponseAsync( - String resourceGroupName, String name, String entityName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (entityName == null) { - return Mono.error(new IllegalArgumentException("Parameter entityName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getRelayServiceConnection( - this.client.getEndpoint(), - resourceGroupName, - name, - entityName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a hybrid connection configuration by its name. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param entityName Name of the hybrid connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a hybrid connection configuration by its name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getRelayServiceConnectionWithResponseAsync( - String resourceGroupName, String name, String entityName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (entityName == null) { - return Mono.error(new IllegalArgumentException("Parameter entityName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getRelayServiceConnection( - this.client.getEndpoint(), - resourceGroupName, - name, - entityName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets a hybrid connection configuration by its name. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param entityName Name of the hybrid connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a hybrid connection configuration by its name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getRelayServiceConnectionAsync( - String resourceGroupName, String name, String entityName) { - return getRelayServiceConnectionWithResponseAsync(resourceGroupName, name, entityName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a hybrid connection configuration by its name. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param entityName Name of the hybrid connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a hybrid connection configuration by its name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RelayServiceConnectionEntityInner getRelayServiceConnection( - String resourceGroupName, String name, String entityName) { - return getRelayServiceConnectionAsync(resourceGroupName, name, entityName).block(); - } - - /** - * Gets a hybrid connection configuration by its name. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param entityName Name of the hybrid connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a hybrid connection configuration by its name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getRelayServiceConnectionWithResponse( - String resourceGroupName, String name, String entityName, Context context) { - return getRelayServiceConnectionWithResponseAsync(resourceGroupName, name, entityName, context).block(); - } - - /** - * Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param entityName Name of the hybrid connection configuration. - * @param connectionEnvelope Details of the hybrid connection configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection for an App Service app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateRelayServiceConnectionWithResponseAsync( - String resourceGroupName, - String name, - String entityName, - RelayServiceConnectionEntityInner connectionEnvelope) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (entityName == null) { - return Mono.error(new IllegalArgumentException("Parameter entityName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (connectionEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter connectionEnvelope is required and cannot be null.")); - } else { - connectionEnvelope.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdateRelayServiceConnection( - this.client.getEndpoint(), - resourceGroupName, - name, - entityName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - connectionEnvelope, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param entityName Name of the hybrid connection configuration. - * @param connectionEnvelope Details of the hybrid connection configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection for an App Service app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateRelayServiceConnectionWithResponseAsync( - String resourceGroupName, - String name, - String entityName, - RelayServiceConnectionEntityInner connectionEnvelope, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (entityName == null) { - return Mono.error(new IllegalArgumentException("Parameter entityName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (connectionEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter connectionEnvelope is required and cannot be null.")); - } else { - connectionEnvelope.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdateRelayServiceConnection( - this.client.getEndpoint(), - resourceGroupName, - name, - entityName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - connectionEnvelope, - accept, - context); - } - - /** - * Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param entityName Name of the hybrid connection configuration. - * @param connectionEnvelope Details of the hybrid connection configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection for an App Service app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateRelayServiceConnectionAsync( - String resourceGroupName, - String name, - String entityName, - RelayServiceConnectionEntityInner connectionEnvelope) { - return createOrUpdateRelayServiceConnectionWithResponseAsync( - resourceGroupName, name, entityName, connectionEnvelope) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param entityName Name of the hybrid connection configuration. - * @param connectionEnvelope Details of the hybrid connection configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection for an App Service app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RelayServiceConnectionEntityInner createOrUpdateRelayServiceConnection( - String resourceGroupName, - String name, - String entityName, - RelayServiceConnectionEntityInner connectionEnvelope) { - return createOrUpdateRelayServiceConnectionAsync(resourceGroupName, name, entityName, connectionEnvelope) - .block(); - } - - /** - * Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param entityName Name of the hybrid connection configuration. - * @param connectionEnvelope Details of the hybrid connection configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection for an App Service app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateRelayServiceConnectionWithResponse( - String resourceGroupName, - String name, - String entityName, - RelayServiceConnectionEntityInner connectionEnvelope, - Context context) { - return createOrUpdateRelayServiceConnectionWithResponseAsync( - resourceGroupName, name, entityName, connectionEnvelope, context) - .block(); - } - - /** - * Deletes a relay service connection by its name. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param entityName Name of the hybrid connection configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteRelayServiceConnectionWithResponseAsync( - String resourceGroupName, String name, String entityName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (entityName == null) { - return Mono.error(new IllegalArgumentException("Parameter entityName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .deleteRelayServiceConnection( - this.client.getEndpoint(), - resourceGroupName, - name, - entityName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a relay service connection by its name. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param entityName Name of the hybrid connection configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteRelayServiceConnectionWithResponseAsync( - String resourceGroupName, String name, String entityName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (entityName == null) { - return Mono.error(new IllegalArgumentException("Parameter entityName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .deleteRelayServiceConnection( - this.client.getEndpoint(), - resourceGroupName, - name, - entityName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Deletes a relay service connection by its name. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param entityName Name of the hybrid connection configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteRelayServiceConnectionAsync(String resourceGroupName, String name, String entityName) { - return deleteRelayServiceConnectionWithResponseAsync(resourceGroupName, name, entityName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes a relay service connection by its name. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param entityName Name of the hybrid connection configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteRelayServiceConnection(String resourceGroupName, String name, String entityName) { - deleteRelayServiceConnectionAsync(resourceGroupName, name, entityName).block(); - } - - /** - * Deletes a relay service connection by its name. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param entityName Name of the hybrid connection configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteRelayServiceConnectionWithResponse( - String resourceGroupName, String name, String entityName, Context context) { - return deleteRelayServiceConnectionWithResponseAsync(resourceGroupName, name, entityName, context).block(); - } - - /** - * Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param entityName Name of the hybrid connection configuration. - * @param connectionEnvelope Details of the hybrid connection configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection for an App Service app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateRelayServiceConnectionWithResponseAsync( - String resourceGroupName, - String name, - String entityName, - RelayServiceConnectionEntityInner connectionEnvelope) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (entityName == null) { - return Mono.error(new IllegalArgumentException("Parameter entityName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (connectionEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter connectionEnvelope is required and cannot be null.")); - } else { - connectionEnvelope.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updateRelayServiceConnection( - this.client.getEndpoint(), - resourceGroupName, - name, - entityName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - connectionEnvelope, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param entityName Name of the hybrid connection configuration. - * @param connectionEnvelope Details of the hybrid connection configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection for an App Service app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateRelayServiceConnectionWithResponseAsync( - String resourceGroupName, - String name, - String entityName, - RelayServiceConnectionEntityInner connectionEnvelope, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (entityName == null) { - return Mono.error(new IllegalArgumentException("Parameter entityName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (connectionEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter connectionEnvelope is required and cannot be null.")); - } else { - connectionEnvelope.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updateRelayServiceConnection( - this.client.getEndpoint(), - resourceGroupName, - name, - entityName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - connectionEnvelope, - accept, - context); - } - - /** - * Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param entityName Name of the hybrid connection configuration. - * @param connectionEnvelope Details of the hybrid connection configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection for an App Service app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateRelayServiceConnectionAsync( - String resourceGroupName, - String name, - String entityName, - RelayServiceConnectionEntityInner connectionEnvelope) { - return updateRelayServiceConnectionWithResponseAsync(resourceGroupName, name, entityName, connectionEnvelope) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param entityName Name of the hybrid connection configuration. - * @param connectionEnvelope Details of the hybrid connection configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection for an App Service app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RelayServiceConnectionEntityInner updateRelayServiceConnection( - String resourceGroupName, - String name, - String entityName, - RelayServiceConnectionEntityInner connectionEnvelope) { - return updateRelayServiceConnectionAsync(resourceGroupName, name, entityName, connectionEnvelope).block(); - } - - /** - * Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param entityName Name of the hybrid connection configuration. - * @param connectionEnvelope Details of the hybrid connection configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection for an App Service app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateRelayServiceConnectionWithResponse( - String resourceGroupName, - String name, - String entityName, - RelayServiceConnectionEntityInner connectionEnvelope, - Context context) { - return updateRelayServiceConnectionWithResponseAsync( - resourceGroupName, name, entityName, connectionEnvelope, context) - .block(); - } - - /** - * Gets all scale-out instances of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all scale-out instances of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listInstanceIdentifiersSinglePageAsync( - String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listInstanceIdentifiers( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all scale-out instances of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all scale-out instances of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listInstanceIdentifiersSinglePageAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listInstanceIdentifiers( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all scale-out instances of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all scale-out instances of an app. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listInstanceIdentifiersAsync(String resourceGroupName, String name) { - return new PagedFlux<>( - () -> listInstanceIdentifiersSinglePageAsync(resourceGroupName, name), - nextLink -> listInstanceIdentifiersNextSinglePageAsync(nextLink)); - } - - /** - * Gets all scale-out instances of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all scale-out instances of an app. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listInstanceIdentifiersAsync( - String resourceGroupName, String name, Context context) { - return new PagedFlux<>( - () -> listInstanceIdentifiersSinglePageAsync(resourceGroupName, name, context), - nextLink -> listInstanceIdentifiersNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all scale-out instances of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all scale-out instances of an app. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listInstanceIdentifiers(String resourceGroupName, String name) { - return new PagedIterable<>(listInstanceIdentifiersAsync(resourceGroupName, name)); - } - - /** - * Gets all scale-out instances of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all scale-out instances of an app. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listInstanceIdentifiers( - String resourceGroupName, String name, Context context) { - return new PagedIterable<>(listInstanceIdentifiersAsync(resourceGroupName, name, context)); - } - - /** - * Get the status of the last MSDeploy operation. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param instanceId ID of web app instance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of the last MSDeploy operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getInstanceMsDeployStatusWithResponseAsync( - String resourceGroupName, String name, String instanceId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getInstanceMsDeployStatus( - this.client.getEndpoint(), - resourceGroupName, - name, - instanceId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the status of the last MSDeploy operation. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param instanceId ID of web app instance. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of the last MSDeploy operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getInstanceMsDeployStatusWithResponseAsync( - String resourceGroupName, String name, String instanceId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getInstanceMsDeployStatus( - this.client.getEndpoint(), - resourceGroupName, - name, - instanceId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Get the status of the last MSDeploy operation. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param instanceId ID of web app instance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of the last MSDeploy operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getInstanceMsDeployStatusAsync( - String resourceGroupName, String name, String instanceId) { - return getInstanceMsDeployStatusWithResponseAsync(resourceGroupName, name, instanceId) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get the status of the last MSDeploy operation. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param instanceId ID of web app instance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of the last MSDeploy operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public MSDeployStatusInner getInstanceMsDeployStatus(String resourceGroupName, String name, String instanceId) { - return getInstanceMsDeployStatusAsync(resourceGroupName, name, instanceId).block(); - } - - /** - * Get the status of the last MSDeploy operation. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param instanceId ID of web app instance. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of the last MSDeploy operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getInstanceMsDeployStatusWithResponse( - String resourceGroupName, String name, String instanceId, Context context) { - return getInstanceMsDeployStatusWithResponseAsync(resourceGroupName, name, instanceId, context).block(); - } - - /** - * Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param instanceId ID of web app instance. - * @param mSDeploy Details of MSDeploy operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createInstanceMSDeployOperationWithResponseAsync( - String resourceGroupName, String name, String instanceId, MSDeploy mSDeploy) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (mSDeploy == null) { - return Mono.error(new IllegalArgumentException("Parameter mSDeploy is required and cannot be null.")); - } else { - mSDeploy.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createInstanceMSDeployOperation( - this.client.getEndpoint(), - resourceGroupName, - name, - instanceId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - mSDeploy, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param instanceId ID of web app instance. - * @param mSDeploy Details of MSDeploy operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createInstanceMSDeployOperationWithResponseAsync( - String resourceGroupName, String name, String instanceId, MSDeploy mSDeploy, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (mSDeploy == null) { - return Mono.error(new IllegalArgumentException("Parameter mSDeploy is required and cannot be null.")); - } else { - mSDeploy.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createInstanceMSDeployOperation( - this.client.getEndpoint(), - resourceGroupName, - name, - instanceId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - mSDeploy, - accept, - context); - } - - /** - * Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param instanceId ID of web app instance. - * @param mSDeploy Details of MSDeploy operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, MSDeployStatusInner> beginCreateInstanceMSDeployOperationAsync( - String resourceGroupName, String name, String instanceId, MSDeploy mSDeploy) { - Mono>> mono = - createInstanceMSDeployOperationWithResponseAsync(resourceGroupName, name, instanceId, mSDeploy); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - MSDeployStatusInner.class, - MSDeployStatusInner.class, - Context.NONE); - } - - /** - * Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param instanceId ID of web app instance. - * @param mSDeploy Details of MSDeploy operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, MSDeployStatusInner> beginCreateInstanceMSDeployOperationAsync( - String resourceGroupName, String name, String instanceId, MSDeploy mSDeploy, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createInstanceMSDeployOperationWithResponseAsync(resourceGroupName, name, instanceId, mSDeploy, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), MSDeployStatusInner.class, MSDeployStatusInner.class, context); - } - - /** - * Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param instanceId ID of web app instance. - * @param mSDeploy Details of MSDeploy operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, MSDeployStatusInner> beginCreateInstanceMSDeployOperation( - String resourceGroupName, String name, String instanceId, MSDeploy mSDeploy) { - return beginCreateInstanceMSDeployOperationAsync(resourceGroupName, name, instanceId, mSDeploy).getSyncPoller(); - } - - /** - * Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param instanceId ID of web app instance. - * @param mSDeploy Details of MSDeploy operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, MSDeployStatusInner> beginCreateInstanceMSDeployOperation( - String resourceGroupName, String name, String instanceId, MSDeploy mSDeploy, Context context) { - return beginCreateInstanceMSDeployOperationAsync(resourceGroupName, name, instanceId, mSDeploy, context) - .getSyncPoller(); - } - - /** - * Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param instanceId ID of web app instance. - * @param mSDeploy Details of MSDeploy operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createInstanceMSDeployOperationAsync( - String resourceGroupName, String name, String instanceId, MSDeploy mSDeploy) { - return beginCreateInstanceMSDeployOperationAsync(resourceGroupName, name, instanceId, mSDeploy) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param instanceId ID of web app instance. - * @param mSDeploy Details of MSDeploy operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createInstanceMSDeployOperationAsync( - String resourceGroupName, String name, String instanceId, MSDeploy mSDeploy, Context context) { - return beginCreateInstanceMSDeployOperationAsync(resourceGroupName, name, instanceId, mSDeploy, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param instanceId ID of web app instance. - * @param mSDeploy Details of MSDeploy operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public MSDeployStatusInner createInstanceMSDeployOperation( - String resourceGroupName, String name, String instanceId, MSDeploy mSDeploy) { - return createInstanceMSDeployOperationAsync(resourceGroupName, name, instanceId, mSDeploy).block(); - } - - /** - * Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param instanceId ID of web app instance. - * @param mSDeploy Details of MSDeploy operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public MSDeployStatusInner createInstanceMSDeployOperation( - String resourceGroupName, String name, String instanceId, MSDeploy mSDeploy, Context context) { - return createInstanceMSDeployOperationAsync(resourceGroupName, name, instanceId, mSDeploy, context).block(); - } - - /** - * Get the MSDeploy Log for the last MSDeploy operation. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param instanceId ID of web app instance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the MSDeploy Log for the last MSDeploy operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getInstanceMSDeployLogWithResponseAsync( - String resourceGroupName, String name, String instanceId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getInstanceMSDeployLog( - this.client.getEndpoint(), - resourceGroupName, - name, - instanceId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the MSDeploy Log for the last MSDeploy operation. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param instanceId ID of web app instance. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the MSDeploy Log for the last MSDeploy operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getInstanceMSDeployLogWithResponseAsync( - String resourceGroupName, String name, String instanceId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getInstanceMSDeployLog( - this.client.getEndpoint(), - resourceGroupName, - name, - instanceId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Get the MSDeploy Log for the last MSDeploy operation. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param instanceId ID of web app instance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the MSDeploy Log for the last MSDeploy operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getInstanceMSDeployLogAsync( - String resourceGroupName, String name, String instanceId) { - return getInstanceMSDeployLogWithResponseAsync(resourceGroupName, name, instanceId) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get the MSDeploy Log for the last MSDeploy operation. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param instanceId ID of web app instance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the MSDeploy Log for the last MSDeploy operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public MSDeployLogInner getInstanceMSDeployLog(String resourceGroupName, String name, String instanceId) { - return getInstanceMSDeployLogAsync(resourceGroupName, name, instanceId).block(); - } - - /** - * Get the MSDeploy Log for the last MSDeploy operation. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param instanceId ID of web app instance. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the MSDeploy Log for the last MSDeploy operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getInstanceMSDeployLogWithResponse( - String resourceGroupName, String name, String instanceId, Context context) { - return getInstanceMSDeployLogWithResponseAsync(resourceGroupName, name, instanceId, context).block(); - } - - /** - * Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web - * site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listInstanceProcessesSinglePageAsync( - String resourceGroupName, String name, String instanceId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listInstanceProcesses( - this.client.getEndpoint(), - resourceGroupName, - name, - instanceId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web - * site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listInstanceProcessesSinglePageAsync( - String resourceGroupName, String name, String instanceId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listInstanceProcesses( - this.client.getEndpoint(), - resourceGroupName, - name, - instanceId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web - * site. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listInstanceProcessesAsync( - String resourceGroupName, String name, String instanceId) { - return new PagedFlux<>( - () -> listInstanceProcessesSinglePageAsync(resourceGroupName, name, instanceId), - nextLink -> listInstanceProcessesNextSinglePageAsync(nextLink)); - } - - /** - * Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web - * site. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listInstanceProcessesAsync( - String resourceGroupName, String name, String instanceId, Context context) { - return new PagedFlux<>( - () -> listInstanceProcessesSinglePageAsync(resourceGroupName, name, instanceId, context), - nextLink -> listInstanceProcessesNextSinglePageAsync(nextLink, context)); - } - - /** - * Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web - * site. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listInstanceProcesses( - String resourceGroupName, String name, String instanceId) { - return new PagedIterable<>(listInstanceProcessesAsync(resourceGroupName, name, instanceId)); - } - - /** - * Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web - * site. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listInstanceProcesses( - String resourceGroupName, String name, String instanceId, Context context) { - return new PagedIterable<>(listInstanceProcessesAsync(resourceGroupName, name, instanceId, context)); - } - - /** - * Get process information by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return process information by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getInstanceProcessWithResponseAsync( - String resourceGroupName, String name, String processId, String instanceId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (processId == null) { - return Mono.error(new IllegalArgumentException("Parameter processId is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getInstanceProcess( - this.client.getEndpoint(), - resourceGroupName, - name, - processId, - instanceId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get process information by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return process information by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getInstanceProcessWithResponseAsync( - String resourceGroupName, String name, String processId, String instanceId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (processId == null) { - return Mono.error(new IllegalArgumentException("Parameter processId is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getInstanceProcess( - this.client.getEndpoint(), - resourceGroupName, - name, - processId, - instanceId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Get process information by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return process information by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getInstanceProcessAsync( - String resourceGroupName, String name, String processId, String instanceId) { - return getInstanceProcessWithResponseAsync(resourceGroupName, name, processId, instanceId) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get process information by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return process information by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ProcessInfoInner getInstanceProcess( - String resourceGroupName, String name, String processId, String instanceId) { - return getInstanceProcessAsync(resourceGroupName, name, processId, instanceId).block(); - } - - /** - * Get process information by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return process information by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getInstanceProcessWithResponse( - String resourceGroupName, String name, String processId, String instanceId, Context context) { - return getInstanceProcessWithResponseAsync(resourceGroupName, name, processId, instanceId, context).block(); - } - - /** - * Terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in a web - * site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteInstanceProcessWithResponseAsync( - String resourceGroupName, String name, String processId, String instanceId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (processId == null) { - return Mono.error(new IllegalArgumentException("Parameter processId is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .deleteInstanceProcess( - this.client.getEndpoint(), - resourceGroupName, - name, - processId, - instanceId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in a web - * site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteInstanceProcessWithResponseAsync( - String resourceGroupName, String name, String processId, String instanceId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (processId == null) { - return Mono.error(new IllegalArgumentException("Parameter processId is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .deleteInstanceProcess( - this.client.getEndpoint(), - resourceGroupName, - name, - processId, - instanceId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in a web - * site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteInstanceProcessAsync( - String resourceGroupName, String name, String processId, String instanceId) { - return deleteInstanceProcessWithResponseAsync(resourceGroupName, name, processId, instanceId) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in a web - * site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteInstanceProcess(String resourceGroupName, String name, String processId, String instanceId) { - deleteInstanceProcessAsync(resourceGroupName, name, processId, instanceId).block(); - } - - /** - * Terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in a web - * site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteInstanceProcessWithResponse( - String resourceGroupName, String name, String processId, String instanceId, Context context) { - return deleteInstanceProcessWithResponseAsync(resourceGroupName, name, processId, instanceId, context).block(); - } - - /** - * Get a memory dump of a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a memory dump of a process by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getInstanceProcessDumpWithResponseAsync( - String resourceGroupName, String name, String processId, String instanceId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (processId == null) { - return Mono.error(new IllegalArgumentException("Parameter processId is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getInstanceProcessDump( - this.client.getEndpoint(), - resourceGroupName, - name, - processId, - instanceId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a memory dump of a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a memory dump of a process by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getInstanceProcessDumpWithResponseAsync( - String resourceGroupName, String name, String processId, String instanceId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (processId == null) { - return Mono.error(new IllegalArgumentException("Parameter processId is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getInstanceProcessDump( - this.client.getEndpoint(), - resourceGroupName, - name, - processId, - instanceId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Get a memory dump of a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a memory dump of a process by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Flux getInstanceProcessDumpAsync( - String resourceGroupName, String name, String processId, String instanceId) { - return getInstanceProcessDumpWithResponseAsync(resourceGroupName, name, processId, instanceId) - .flatMapMany(StreamResponse::getValue); - } - - /** - * Get a memory dump of a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a memory dump of a process by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public InputStream getInstanceProcessDump( - String resourceGroupName, String name, String processId, String instanceId) { - Iterator iterator = - getInstanceProcessDumpAsync(resourceGroupName, name, processId, instanceId) - .map(ByteBufferBackedInputStream::new) - .toStream() - .iterator(); - Enumeration enumeration = - new Enumeration() { - @Override - public boolean hasMoreElements() { - return iterator.hasNext(); - } - - @Override - public InputStream nextElement() { - return iterator.next(); - } - }; - return new SequenceInputStream(enumeration); - } - - /** - * Get a memory dump of a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a memory dump of a process by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public StreamResponse getInstanceProcessDumpWithResponse( - String resourceGroupName, String name, String processId, String instanceId, Context context) { - return getInstanceProcessDumpWithResponseAsync(resourceGroupName, name, processId, instanceId, context).block(); - } - - /** - * List module information for a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listInstanceProcessModulesSinglePageAsync( - String resourceGroupName, String name, String processId, String instanceId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (processId == null) { - return Mono.error(new IllegalArgumentException("Parameter processId is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listInstanceProcessModules( - this.client.getEndpoint(), - resourceGroupName, - name, - processId, - instanceId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List module information for a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listInstanceProcessModulesSinglePageAsync( - String resourceGroupName, String name, String processId, String instanceId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (processId == null) { - return Mono.error(new IllegalArgumentException("Parameter processId is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listInstanceProcessModules( - this.client.getEndpoint(), - resourceGroupName, - name, - processId, - instanceId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * List module information for a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listInstanceProcessModulesAsync( - String resourceGroupName, String name, String processId, String instanceId) { - return new PagedFlux<>( - () -> listInstanceProcessModulesSinglePageAsync(resourceGroupName, name, processId, instanceId), - nextLink -> listInstanceProcessModulesNextSinglePageAsync(nextLink)); - } - - /** - * List module information for a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listInstanceProcessModulesAsync( - String resourceGroupName, String name, String processId, String instanceId, Context context) { - return new PagedFlux<>( - () -> listInstanceProcessModulesSinglePageAsync(resourceGroupName, name, processId, instanceId, context), - nextLink -> listInstanceProcessModulesNextSinglePageAsync(nextLink, context)); - } - - /** - * List module information for a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listInstanceProcessModules( - String resourceGroupName, String name, String processId, String instanceId) { - return new PagedIterable<>(listInstanceProcessModulesAsync(resourceGroupName, name, processId, instanceId)); - } - - /** - * List module information for a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listInstanceProcessModules( - String resourceGroupName, String name, String processId, String instanceId, Context context) { - return new PagedIterable<>( - listInstanceProcessModulesAsync(resourceGroupName, name, processId, instanceId, context)); - } - - /** - * Get process information by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param baseAddress Module base address. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return process information by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getInstanceProcessModuleWithResponseAsync( - String resourceGroupName, String name, String processId, String baseAddress, String instanceId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (processId == null) { - return Mono.error(new IllegalArgumentException("Parameter processId is required and cannot be null.")); - } - if (baseAddress == null) { - return Mono.error(new IllegalArgumentException("Parameter baseAddress is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getInstanceProcessModule( - this.client.getEndpoint(), - resourceGroupName, - name, - processId, - baseAddress, - instanceId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get process information by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param baseAddress Module base address. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return process information by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getInstanceProcessModuleWithResponseAsync( - String resourceGroupName, - String name, - String processId, - String baseAddress, - String instanceId, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (processId == null) { - return Mono.error(new IllegalArgumentException("Parameter processId is required and cannot be null.")); - } - if (baseAddress == null) { - return Mono.error(new IllegalArgumentException("Parameter baseAddress is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getInstanceProcessModule( - this.client.getEndpoint(), - resourceGroupName, - name, - processId, - baseAddress, - instanceId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Get process information by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param baseAddress Module base address. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return process information by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getInstanceProcessModuleAsync( - String resourceGroupName, String name, String processId, String baseAddress, String instanceId) { - return getInstanceProcessModuleWithResponseAsync(resourceGroupName, name, processId, baseAddress, instanceId) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get process information by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param baseAddress Module base address. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return process information by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ProcessModuleInfoInner getInstanceProcessModule( - String resourceGroupName, String name, String processId, String baseAddress, String instanceId) { - return getInstanceProcessModuleAsync(resourceGroupName, name, processId, baseAddress, instanceId).block(); - } - - /** - * Get process information by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param baseAddress Module base address. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return process information by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getInstanceProcessModuleWithResponse( - String resourceGroupName, - String name, - String processId, - String baseAddress, - String instanceId, - Context context) { - return getInstanceProcessModuleWithResponseAsync( - resourceGroupName, name, processId, baseAddress, instanceId, context) - .block(); - } - - /** - * List the threads in a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listInstanceProcessThreadsSinglePageAsync( - String resourceGroupName, String name, String processId, String instanceId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (processId == null) { - return Mono.error(new IllegalArgumentException("Parameter processId is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listInstanceProcessThreads( - this.client.getEndpoint(), - resourceGroupName, - name, - processId, - instanceId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List the threads in a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listInstanceProcessThreadsSinglePageAsync( - String resourceGroupName, String name, String processId, String instanceId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (processId == null) { - return Mono.error(new IllegalArgumentException("Parameter processId is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listInstanceProcessThreads( - this.client.getEndpoint(), - resourceGroupName, - name, - processId, - instanceId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * List the threads in a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listInstanceProcessThreadsAsync( - String resourceGroupName, String name, String processId, String instanceId) { - return new PagedFlux<>( - () -> listInstanceProcessThreadsSinglePageAsync(resourceGroupName, name, processId, instanceId), - nextLink -> listInstanceProcessThreadsNextSinglePageAsync(nextLink)); - } - - /** - * List the threads in a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listInstanceProcessThreadsAsync( - String resourceGroupName, String name, String processId, String instanceId, Context context) { - return new PagedFlux<>( - () -> listInstanceProcessThreadsSinglePageAsync(resourceGroupName, name, processId, instanceId, context), - nextLink -> listInstanceProcessThreadsNextSinglePageAsync(nextLink, context)); - } - - /** - * List the threads in a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listInstanceProcessThreads( - String resourceGroupName, String name, String processId, String instanceId) { - return new PagedIterable<>(listInstanceProcessThreadsAsync(resourceGroupName, name, processId, instanceId)); - } - - /** - * List the threads in a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listInstanceProcessThreads( - String resourceGroupName, String name, String processId, String instanceId, Context context) { - return new PagedIterable<>( - listInstanceProcessThreadsAsync(resourceGroupName, name, processId, instanceId, context)); - } - - /** - * Get thread information by Thread ID for a specific process, in a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param threadId TID. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return thread information by Thread ID for a specific process, in a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getInstanceProcessThreadWithResponseAsync( - String resourceGroupName, String name, String processId, String threadId, String instanceId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (processId == null) { - return Mono.error(new IllegalArgumentException("Parameter processId is required and cannot be null.")); - } - if (threadId == null) { - return Mono.error(new IllegalArgumentException("Parameter threadId is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getInstanceProcessThread( - this.client.getEndpoint(), - resourceGroupName, - name, - processId, - threadId, - instanceId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get thread information by Thread ID for a specific process, in a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param threadId TID. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return thread information by Thread ID for a specific process, in a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getInstanceProcessThreadWithResponseAsync( - String resourceGroupName, String name, String processId, String threadId, String instanceId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (processId == null) { - return Mono.error(new IllegalArgumentException("Parameter processId is required and cannot be null.")); - } - if (threadId == null) { - return Mono.error(new IllegalArgumentException("Parameter threadId is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getInstanceProcessThread( - this.client.getEndpoint(), - resourceGroupName, - name, - processId, - threadId, - instanceId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Get thread information by Thread ID for a specific process, in a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param threadId TID. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return thread information by Thread ID for a specific process, in a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getInstanceProcessThreadAsync( - String resourceGroupName, String name, String processId, String threadId, String instanceId) { - return getInstanceProcessThreadWithResponseAsync(resourceGroupName, name, processId, threadId, instanceId) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get thread information by Thread ID for a specific process, in a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param threadId TID. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return thread information by Thread ID for a specific process, in a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ProcessThreadInfoInner getInstanceProcessThread( - String resourceGroupName, String name, String processId, String threadId, String instanceId) { - return getInstanceProcessThreadAsync(resourceGroupName, name, processId, threadId, instanceId).block(); - } - - /** - * Get thread information by Thread ID for a specific process, in a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param threadId TID. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return thread information by Thread ID for a specific process, in a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getInstanceProcessThreadWithResponse( - String resourceGroupName, String name, String processId, String threadId, String instanceId, Context context) { - return getInstanceProcessThreadWithResponseAsync( - resourceGroupName, name, processId, threadId, instanceId, context) - .block(); - } - - /** - * Shows whether an app can be cloned to another resource group or subscription. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents whether or not an app is cloneable. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> isCloneableWithResponseAsync(String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .isCloneable( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Shows whether an app can be cloned to another resource group or subscription. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents whether or not an app is cloneable. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> isCloneableWithResponseAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .isCloneable( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Shows whether an app can be cloned to another resource group or subscription. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents whether or not an app is cloneable. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono isCloneableAsync(String resourceGroupName, String name) { - return isCloneableWithResponseAsync(resourceGroupName, name) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Shows whether an app can be cloned to another resource group or subscription. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents whether or not an app is cloneable. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SiteCloneabilityInner isCloneable(String resourceGroupName, String name) { - return isCloneableAsync(resourceGroupName, name).block(); - } - - /** - * Shows whether an app can be cloned to another resource group or subscription. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents whether or not an app is cloneable. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response isCloneableWithResponse( - String resourceGroupName, String name, Context context) { - return isCloneableWithResponseAsync(resourceGroupName, name, context).block(); - } - - /** - * This is to allow calling via powershell and ARM template. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function secrets. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listSyncFunctionTriggersWithResponseAsync( - String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listSyncFunctionTriggers( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * This is to allow calling via powershell and ARM template. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function secrets. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSyncFunctionTriggersWithResponseAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listSyncFunctionTriggers( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * This is to allow calling via powershell and ARM template. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function secrets. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listSyncFunctionTriggersAsync(String resourceGroupName, String name) { - return listSyncFunctionTriggersWithResponseAsync(resourceGroupName, name) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * This is to allow calling via powershell and ARM template. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function secrets. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public FunctionSecretsInner listSyncFunctionTriggers(String resourceGroupName, String name) { - return listSyncFunctionTriggersAsync(resourceGroupName, name).block(); - } - - /** - * This is to allow calling via powershell and ARM template. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function secrets. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listSyncFunctionTriggersWithResponse( - String resourceGroupName, String name, Context context) { - return listSyncFunctionTriggersWithResponseAsync(resourceGroupName, name, context).block(); - } - - /** - * Gets all metric definitions of an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all metric definitions of an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listMetricDefinitionsSinglePageAsync( - String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listMetricDefinitions( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all metric definitions of an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all metric definitions of an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listMetricDefinitionsSinglePageAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listMetricDefinitions( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all metric definitions of an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all metric definitions of an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listMetricDefinitionsAsync(String resourceGroupName, String name) { - return new PagedFlux<>( - () -> listMetricDefinitionsSinglePageAsync(resourceGroupName, name), - nextLink -> listMetricDefinitionsNextSinglePageAsync(nextLink)); - } - - /** - * Gets all metric definitions of an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all metric definitions of an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listMetricDefinitionsAsync( - String resourceGroupName, String name, Context context) { - return new PagedFlux<>( - () -> listMetricDefinitionsSinglePageAsync(resourceGroupName, name, context), - nextLink -> listMetricDefinitionsNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all metric definitions of an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all metric definitions of an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listMetricDefinitions(String resourceGroupName, String name) { - return new PagedIterable<>(listMetricDefinitionsAsync(resourceGroupName, name)); - } - - /** - * Gets all metric definitions of an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all metric definitions of an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listMetricDefinitions( - String resourceGroupName, String name, Context context) { - return new PagedIterable<>(listMetricDefinitionsAsync(resourceGroupName, name, context)); - } - - /** - * Gets performance metrics of an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param details Specify "true" to include metric details in the response. It is "false" by default. - * @param filter Return only metrics specified in the filter (using OData syntax). For example: $filter=(name.value - * eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and endTime eq - * 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return performance metrics of an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listMetricsSinglePageAsync( - String resourceGroupName, String name, Boolean details, String filter) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listMetrics( - this.client.getEndpoint(), - resourceGroupName, - name, - details, - filter, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets performance metrics of an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param details Specify "true" to include metric details in the response. It is "false" by default. - * @param filter Return only metrics specified in the filter (using OData syntax). For example: $filter=(name.value - * eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and endTime eq - * 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return performance metrics of an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listMetricsSinglePageAsync( - String resourceGroupName, String name, Boolean details, String filter, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listMetrics( - this.client.getEndpoint(), - resourceGroupName, - name, - details, - filter, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets performance metrics of an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param details Specify "true" to include metric details in the response. It is "false" by default. - * @param filter Return only metrics specified in the filter (using OData syntax). For example: $filter=(name.value - * eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and endTime eq - * 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return performance metrics of an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listMetricsAsync( - String resourceGroupName, String name, Boolean details, String filter) { - return new PagedFlux<>( - () -> listMetricsSinglePageAsync(resourceGroupName, name, details, filter), - nextLink -> listMetricsNextSinglePageAsync(nextLink)); - } - - /** - * Gets performance metrics of an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return performance metrics of an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listMetricsAsync(String resourceGroupName, String name) { - final Boolean details = null; - final String filter = null; - return new PagedFlux<>( - () -> listMetricsSinglePageAsync(resourceGroupName, name, details, filter), - nextLink -> listMetricsNextSinglePageAsync(nextLink)); - } - - /** - * Gets performance metrics of an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param details Specify "true" to include metric details in the response. It is "false" by default. - * @param filter Return only metrics specified in the filter (using OData syntax). For example: $filter=(name.value - * eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and endTime eq - * 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return performance metrics of an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listMetricsAsync( - String resourceGroupName, String name, Boolean details, String filter, Context context) { - return new PagedFlux<>( - () -> listMetricsSinglePageAsync(resourceGroupName, name, details, filter, context), - nextLink -> listMetricsNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets performance metrics of an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return performance metrics of an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listMetrics(String resourceGroupName, String name) { - final Boolean details = null; - final String filter = null; - return new PagedIterable<>(listMetricsAsync(resourceGroupName, name, details, filter)); - } - - /** - * Gets performance metrics of an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param details Specify "true" to include metric details in the response. It is "false" by default. - * @param filter Return only metrics specified in the filter (using OData syntax). For example: $filter=(name.value - * eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and endTime eq - * 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return performance metrics of an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listMetrics( - String resourceGroupName, String name, Boolean details, String filter, Context context) { - return new PagedIterable<>(listMetricsAsync(resourceGroupName, name, details, filter, context)); - } - - /** - * Restores a web app. - * - * @param subscriptionName Azure subscription. - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param migrationOptions Migration migrationOptions. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for a migration of app content request. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> migrateStorageWithResponseAsync( - String subscriptionName, String resourceGroupName, String name, StorageMigrationOptions migrationOptions) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (subscriptionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter subscriptionName is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (migrationOptions == null) { - return Mono - .error(new IllegalArgumentException("Parameter migrationOptions is required and cannot be null.")); - } else { - migrationOptions.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .migrateStorage( - this.client.getEndpoint(), - subscriptionName, - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - migrationOptions, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Restores a web app. - * - * @param subscriptionName Azure subscription. - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param migrationOptions Migration migrationOptions. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for a migration of app content request. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> migrateStorageWithResponseAsync( - String subscriptionName, - String resourceGroupName, - String name, - StorageMigrationOptions migrationOptions, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (subscriptionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter subscriptionName is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (migrationOptions == null) { - return Mono - .error(new IllegalArgumentException("Parameter migrationOptions is required and cannot be null.")); - } else { - migrationOptions.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .migrateStorage( - this.client.getEndpoint(), - subscriptionName, - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - migrationOptions, - accept, - context); - } - - /** - * Restores a web app. - * - * @param subscriptionName Azure subscription. - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param migrationOptions Migration migrationOptions. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for a migration of app content request. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, StorageMigrationResponseInner> - beginMigrateStorageAsync( - String subscriptionName, String resourceGroupName, String name, StorageMigrationOptions migrationOptions) { - Mono>> mono = - migrateStorageWithResponseAsync(subscriptionName, resourceGroupName, name, migrationOptions); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - StorageMigrationResponseInner.class, - StorageMigrationResponseInner.class, - Context.NONE); - } - - /** - * Restores a web app. - * - * @param subscriptionName Azure subscription. - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param migrationOptions Migration migrationOptions. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for a migration of app content request. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, StorageMigrationResponseInner> - beginMigrateStorageAsync( - String subscriptionName, - String resourceGroupName, - String name, - StorageMigrationOptions migrationOptions, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - migrateStorageWithResponseAsync(subscriptionName, resourceGroupName, name, migrationOptions, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - StorageMigrationResponseInner.class, - StorageMigrationResponseInner.class, - context); - } - - /** - * Restores a web app. - * - * @param subscriptionName Azure subscription. - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param migrationOptions Migration migrationOptions. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for a migration of app content request. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, StorageMigrationResponseInner> beginMigrateStorage( - String subscriptionName, String resourceGroupName, String name, StorageMigrationOptions migrationOptions) { - return beginMigrateStorageAsync(subscriptionName, resourceGroupName, name, migrationOptions).getSyncPoller(); - } - - /** - * Restores a web app. - * - * @param subscriptionName Azure subscription. - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param migrationOptions Migration migrationOptions. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for a migration of app content request. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, StorageMigrationResponseInner> beginMigrateStorage( - String subscriptionName, - String resourceGroupName, - String name, - StorageMigrationOptions migrationOptions, - Context context) { - return beginMigrateStorageAsync(subscriptionName, resourceGroupName, name, migrationOptions, context) - .getSyncPoller(); - } - - /** - * Restores a web app. - * - * @param subscriptionName Azure subscription. - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param migrationOptions Migration migrationOptions. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for a migration of app content request. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono migrateStorageAsync( - String subscriptionName, String resourceGroupName, String name, StorageMigrationOptions migrationOptions) { - return beginMigrateStorageAsync(subscriptionName, resourceGroupName, name, migrationOptions) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Restores a web app. - * - * @param subscriptionName Azure subscription. - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param migrationOptions Migration migrationOptions. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for a migration of app content request. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono migrateStorageAsync( - String subscriptionName, - String resourceGroupName, - String name, - StorageMigrationOptions migrationOptions, - Context context) { - return beginMigrateStorageAsync(subscriptionName, resourceGroupName, name, migrationOptions, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Restores a web app. - * - * @param subscriptionName Azure subscription. - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param migrationOptions Migration migrationOptions. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for a migration of app content request. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public StorageMigrationResponseInner migrateStorage( - String subscriptionName, String resourceGroupName, String name, StorageMigrationOptions migrationOptions) { - return migrateStorageAsync(subscriptionName, resourceGroupName, name, migrationOptions).block(); - } - - /** - * Restores a web app. - * - * @param subscriptionName Azure subscription. - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param migrationOptions Migration migrationOptions. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for a migration of app content request. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public StorageMigrationResponseInner migrateStorage( - String subscriptionName, - String resourceGroupName, - String name, - StorageMigrationOptions migrationOptions, - Context context) { - return migrateStorageAsync(subscriptionName, resourceGroupName, name, migrationOptions, context).block(); - } - - /** - * Migrates a local (in-app) MySql database to a remote MySql database. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param migrationRequestEnvelope MySql migration options. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an operation on a resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> migrateMySqlWithResponseAsync( - String resourceGroupName, String name, MigrateMySqlRequest migrationRequestEnvelope) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (migrationRequestEnvelope == null) { - return Mono - .error( - new IllegalArgumentException("Parameter migrationRequestEnvelope is required and cannot be null.")); - } else { - migrationRequestEnvelope.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .migrateMySql( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - migrationRequestEnvelope, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Migrates a local (in-app) MySql database to a remote MySql database. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param migrationRequestEnvelope MySql migration options. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an operation on a resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> migrateMySqlWithResponseAsync( - String resourceGroupName, String name, MigrateMySqlRequest migrationRequestEnvelope, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (migrationRequestEnvelope == null) { - return Mono - .error( - new IllegalArgumentException("Parameter migrationRequestEnvelope is required and cannot be null.")); - } else { - migrationRequestEnvelope.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .migrateMySql( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - migrationRequestEnvelope, - accept, - context); - } - - /** - * Migrates a local (in-app) MySql database to a remote MySql database. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param migrationRequestEnvelope MySql migration options. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an operation on a resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, OperationInner> beginMigrateMySqlAsync( - String resourceGroupName, String name, MigrateMySqlRequest migrationRequestEnvelope) { - Mono>> mono = - migrateMySqlWithResponseAsync(resourceGroupName, name, migrationRequestEnvelope); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - OperationInner.class, - OperationInner.class, - this.client.getContext()); - } - - /** - * Migrates a local (in-app) MySql database to a remote MySql database. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param migrationRequestEnvelope MySql migration options. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an operation on a resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, OperationInner> beginMigrateMySqlAsync( - String resourceGroupName, String name, MigrateMySqlRequest migrationRequestEnvelope, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - migrateMySqlWithResponseAsync(resourceGroupName, name, migrationRequestEnvelope, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), OperationInner.class, OperationInner.class, context); - } - - /** - * Migrates a local (in-app) MySql database to a remote MySql database. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param migrationRequestEnvelope MySql migration options. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an operation on a resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, OperationInner> beginMigrateMySql( - String resourceGroupName, String name, MigrateMySqlRequest migrationRequestEnvelope) { - return beginMigrateMySqlAsync(resourceGroupName, name, migrationRequestEnvelope).getSyncPoller(); - } - - /** - * Migrates a local (in-app) MySql database to a remote MySql database. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param migrationRequestEnvelope MySql migration options. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an operation on a resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, OperationInner> beginMigrateMySql( - String resourceGroupName, String name, MigrateMySqlRequest migrationRequestEnvelope, Context context) { - return beginMigrateMySqlAsync(resourceGroupName, name, migrationRequestEnvelope, context).getSyncPoller(); - } - - /** - * Migrates a local (in-app) MySql database to a remote MySql database. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param migrationRequestEnvelope MySql migration options. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an operation on a resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono migrateMySqlAsync( - String resourceGroupName, String name, MigrateMySqlRequest migrationRequestEnvelope) { - return beginMigrateMySqlAsync(resourceGroupName, name, migrationRequestEnvelope) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Migrates a local (in-app) MySql database to a remote MySql database. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param migrationRequestEnvelope MySql migration options. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an operation on a resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono migrateMySqlAsync( - String resourceGroupName, String name, MigrateMySqlRequest migrationRequestEnvelope, Context context) { - return beginMigrateMySqlAsync(resourceGroupName, name, migrationRequestEnvelope, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Migrates a local (in-app) MySql database to a remote MySql database. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param migrationRequestEnvelope MySql migration options. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an operation on a resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public OperationInner migrateMySql( - String resourceGroupName, String name, MigrateMySqlRequest migrationRequestEnvelope) { - return migrateMySqlAsync(resourceGroupName, name, migrationRequestEnvelope).block(); - } - - /** - * Migrates a local (in-app) MySql database to a remote MySql database. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param migrationRequestEnvelope MySql migration options. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an operation on a resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public OperationInner migrateMySql( - String resourceGroupName, String name, MigrateMySqlRequest migrationRequestEnvelope, Context context) { - return migrateMySqlAsync(resourceGroupName, name, migrationRequestEnvelope, context).block(); - } - - /** - * Returns the status of MySql in app migration, if one is active, and whether or not MySql in app is enabled. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mySQL migration status. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getMigrateMySqlStatusWithResponseAsync( - String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getMigrateMySqlStatus( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns the status of MySql in app migration, if one is active, and whether or not MySql in app is enabled. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mySQL migration status. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getMigrateMySqlStatusWithResponseAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getMigrateMySqlStatus( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Returns the status of MySql in app migration, if one is active, and whether or not MySql in app is enabled. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mySQL migration status. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getMigrateMySqlStatusAsync(String resourceGroupName, String name) { - return getMigrateMySqlStatusWithResponseAsync(resourceGroupName, name) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Returns the status of MySql in app migration, if one is active, and whether or not MySql in app is enabled. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mySQL migration status. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public MigrateMySqlStatusInner getMigrateMySqlStatus(String resourceGroupName, String name) { - return getMigrateMySqlStatusAsync(resourceGroupName, name).block(); - } - - /** - * Returns the status of MySql in app migration, if one is active, and whether or not MySql in app is enabled. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mySQL migration status. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getMigrateMySqlStatusWithResponse( - String resourceGroupName, String name, Context context) { - return getMigrateMySqlStatusWithResponseAsync(resourceGroupName, name, context).block(); - } - - /** - * Gets a Swift Virtual Network connection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Swift Virtual Network connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getSwiftVirtualNetworkConnectionWithResponseAsync( - String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getSwiftVirtualNetworkConnection( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a Swift Virtual Network connection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Swift Virtual Network connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getSwiftVirtualNetworkConnectionWithResponseAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getSwiftVirtualNetworkConnection( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets a Swift Virtual Network connection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Swift Virtual Network connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getSwiftVirtualNetworkConnectionAsync(String resourceGroupName, String name) { - return getSwiftVirtualNetworkConnectionWithResponseAsync(resourceGroupName, name) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a Swift Virtual Network connection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Swift Virtual Network connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SwiftVirtualNetworkInner getSwiftVirtualNetworkConnection(String resourceGroupName, String name) { - return getSwiftVirtualNetworkConnectionAsync(resourceGroupName, name).block(); - } - - /** - * Gets a Swift Virtual Network connection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Swift Virtual Network connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getSwiftVirtualNetworkConnectionWithResponse( - String resourceGroupName, String name, Context context) { - return getSwiftVirtualNetworkConnectionWithResponseAsync(resourceGroupName, name, context).block(); - } - - /** - * Integrates this Web App with a Virtual Network. This requires that 1) "swiftSupported" is true when doing a GET - * against this resource, and 2) that the target Subnet has already been delegated, and is not in use by another App - * Service Plan other than the one this App is in. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param connectionEnvelope Properties of the Virtual Network connection. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return swift Virtual Network Contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateSwiftVirtualNetworkConnectionWithResponseAsync( - String resourceGroupName, String name, SwiftVirtualNetworkInner connectionEnvelope) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (connectionEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter connectionEnvelope is required and cannot be null.")); - } else { - connectionEnvelope.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdateSwiftVirtualNetworkConnection( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - connectionEnvelope, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Integrates this Web App with a Virtual Network. This requires that 1) "swiftSupported" is true when doing a GET - * against this resource, and 2) that the target Subnet has already been delegated, and is not in use by another App - * Service Plan other than the one this App is in. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param connectionEnvelope Properties of the Virtual Network connection. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return swift Virtual Network Contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateSwiftVirtualNetworkConnectionWithResponseAsync( - String resourceGroupName, String name, SwiftVirtualNetworkInner connectionEnvelope, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (connectionEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter connectionEnvelope is required and cannot be null.")); - } else { - connectionEnvelope.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdateSwiftVirtualNetworkConnection( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - connectionEnvelope, - accept, - context); - } - - /** - * Integrates this Web App with a Virtual Network. This requires that 1) "swiftSupported" is true when doing a GET - * against this resource, and 2) that the target Subnet has already been delegated, and is not in use by another App - * Service Plan other than the one this App is in. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param connectionEnvelope Properties of the Virtual Network connection. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return swift Virtual Network Contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateSwiftVirtualNetworkConnectionAsync( - String resourceGroupName, String name, SwiftVirtualNetworkInner connectionEnvelope) { - return createOrUpdateSwiftVirtualNetworkConnectionWithResponseAsync(resourceGroupName, name, connectionEnvelope) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Integrates this Web App with a Virtual Network. This requires that 1) "swiftSupported" is true when doing a GET - * against this resource, and 2) that the target Subnet has already been delegated, and is not in use by another App - * Service Plan other than the one this App is in. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param connectionEnvelope Properties of the Virtual Network connection. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return swift Virtual Network Contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SwiftVirtualNetworkInner createOrUpdateSwiftVirtualNetworkConnection( - String resourceGroupName, String name, SwiftVirtualNetworkInner connectionEnvelope) { - return createOrUpdateSwiftVirtualNetworkConnectionAsync(resourceGroupName, name, connectionEnvelope).block(); - } - - /** - * Integrates this Web App with a Virtual Network. This requires that 1) "swiftSupported" is true when doing a GET - * against this resource, and 2) that the target Subnet has already been delegated, and is not in use by another App - * Service Plan other than the one this App is in. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param connectionEnvelope Properties of the Virtual Network connection. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return swift Virtual Network Contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateSwiftVirtualNetworkConnectionWithResponse( - String resourceGroupName, String name, SwiftVirtualNetworkInner connectionEnvelope, Context context) { - return createOrUpdateSwiftVirtualNetworkConnectionWithResponseAsync( - resourceGroupName, name, connectionEnvelope, context) - .block(); - } - - /** - * Deletes a Swift Virtual Network connection from an app (or deployment slot). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteSwiftVirtualNetworkWithResponseAsync(String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .deleteSwiftVirtualNetwork( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a Swift Virtual Network connection from an app (or deployment slot). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteSwiftVirtualNetworkWithResponseAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .deleteSwiftVirtualNetwork( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Deletes a Swift Virtual Network connection from an app (or deployment slot). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteSwiftVirtualNetworkAsync(String resourceGroupName, String name) { - return deleteSwiftVirtualNetworkWithResponseAsync(resourceGroupName, name) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes a Swift Virtual Network connection from an app (or deployment slot). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteSwiftVirtualNetwork(String resourceGroupName, String name) { - deleteSwiftVirtualNetworkAsync(resourceGroupName, name).block(); - } - - /** - * Deletes a Swift Virtual Network connection from an app (or deployment slot). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteSwiftVirtualNetworkWithResponse( - String resourceGroupName, String name, Context context) { - return deleteSwiftVirtualNetworkWithResponseAsync(resourceGroupName, name, context).block(); - } - - /** - * Integrates this Web App with a Virtual Network. This requires that 1) "swiftSupported" is true when doing a GET - * against this resource, and 2) that the target Subnet has already been delegated, and is not in use by another App - * Service Plan other than the one this App is in. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param connectionEnvelope Properties of the Virtual Network connection. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return swift Virtual Network Contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateSwiftVirtualNetworkConnectionWithResponseAsync( - String resourceGroupName, String name, SwiftVirtualNetworkInner connectionEnvelope) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (connectionEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter connectionEnvelope is required and cannot be null.")); - } else { - connectionEnvelope.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updateSwiftVirtualNetworkConnection( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - connectionEnvelope, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Integrates this Web App with a Virtual Network. This requires that 1) "swiftSupported" is true when doing a GET - * against this resource, and 2) that the target Subnet has already been delegated, and is not in use by another App - * Service Plan other than the one this App is in. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param connectionEnvelope Properties of the Virtual Network connection. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return swift Virtual Network Contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateSwiftVirtualNetworkConnectionWithResponseAsync( - String resourceGroupName, String name, SwiftVirtualNetworkInner connectionEnvelope, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (connectionEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter connectionEnvelope is required and cannot be null.")); - } else { - connectionEnvelope.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updateSwiftVirtualNetworkConnection( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - connectionEnvelope, - accept, - context); - } - - /** - * Integrates this Web App with a Virtual Network. This requires that 1) "swiftSupported" is true when doing a GET - * against this resource, and 2) that the target Subnet has already been delegated, and is not in use by another App - * Service Plan other than the one this App is in. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param connectionEnvelope Properties of the Virtual Network connection. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return swift Virtual Network Contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateSwiftVirtualNetworkConnectionAsync( - String resourceGroupName, String name, SwiftVirtualNetworkInner connectionEnvelope) { - return updateSwiftVirtualNetworkConnectionWithResponseAsync(resourceGroupName, name, connectionEnvelope) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Integrates this Web App with a Virtual Network. This requires that 1) "swiftSupported" is true when doing a GET - * against this resource, and 2) that the target Subnet has already been delegated, and is not in use by another App - * Service Plan other than the one this App is in. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param connectionEnvelope Properties of the Virtual Network connection. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return swift Virtual Network Contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SwiftVirtualNetworkInner updateSwiftVirtualNetworkConnection( - String resourceGroupName, String name, SwiftVirtualNetworkInner connectionEnvelope) { - return updateSwiftVirtualNetworkConnectionAsync(resourceGroupName, name, connectionEnvelope).block(); - } - - /** - * Integrates this Web App with a Virtual Network. This requires that 1) "swiftSupported" is true when doing a GET - * against this resource, and 2) that the target Subnet has already been delegated, and is not in use by another App - * Service Plan other than the one this App is in. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param connectionEnvelope Properties of the Virtual Network connection. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return swift Virtual Network Contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateSwiftVirtualNetworkConnectionWithResponse( - String resourceGroupName, String name, SwiftVirtualNetworkInner connectionEnvelope, Context context) { - return updateSwiftVirtualNetworkConnectionWithResponseAsync( - resourceGroupName, name, connectionEnvelope, context) - .block(); - } - - /** - * Gets all network features used by the app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param view The type of view. This can either be "summary" or "detailed". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network features used by the app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listNetworkFeaturesWithResponseAsync( - String resourceGroupName, String name, String view) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (view == null) { - return Mono.error(new IllegalArgumentException("Parameter view is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listNetworkFeatures( - this.client.getEndpoint(), - resourceGroupName, - name, - view, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all network features used by the app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param view The type of view. This can either be "summary" or "detailed". - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network features used by the app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNetworkFeaturesWithResponseAsync( - String resourceGroupName, String name, String view, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (view == null) { - return Mono.error(new IllegalArgumentException("Parameter view is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNetworkFeatures( - this.client.getEndpoint(), - resourceGroupName, - name, - view, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets all network features used by the app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param view The type of view. This can either be "summary" or "detailed". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network features used by the app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listNetworkFeaturesAsync(String resourceGroupName, String name, String view) { - return listNetworkFeaturesWithResponseAsync(resourceGroupName, name, view) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets all network features used by the app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param view The type of view. This can either be "summary" or "detailed". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network features used by the app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public NetworkFeaturesInner listNetworkFeatures(String resourceGroupName, String name, String view) { - return listNetworkFeaturesAsync(resourceGroupName, name, view).block(); - } - - /** - * Gets all network features used by the app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param view The type of view. This can either be "summary" or "detailed". - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network features used by the app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listNetworkFeaturesWithResponse( - String resourceGroupName, String name, String view, Context context) { - return listNetworkFeaturesWithResponseAsync(resourceGroupName, name, view, context).block(); - } - - /** - * Gets a named operation for a network trace capturing (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param operationId GUID of the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named operation for a network trace capturing (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getNetworkTraceOperationWithResponseAsync( - String resourceGroupName, String name, String operationId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (operationId == null) { - return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getNetworkTraceOperation( - this.client.getEndpoint(), - resourceGroupName, - name, - operationId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a named operation for a network trace capturing (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param operationId GUID of the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named operation for a network trace capturing (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getNetworkTraceOperationWithResponseAsync( - String resourceGroupName, String name, String operationId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (operationId == null) { - return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getNetworkTraceOperation( - this.client.getEndpoint(), - resourceGroupName, - name, - operationId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets a named operation for a network trace capturing (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param operationId GUID of the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named operation for a network trace capturing (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getNetworkTraceOperationAsync(String resourceGroupName, String name, String operationId) { - return getNetworkTraceOperationWithResponseAsync(resourceGroupName, name, operationId) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a named operation for a network trace capturing (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param operationId GUID of the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named operation for a network trace capturing (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Object getNetworkTraceOperation(String resourceGroupName, String name, String operationId) { - return getNetworkTraceOperationAsync(resourceGroupName, name, operationId).block(); - } - - /** - * Gets a named operation for a network trace capturing (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param operationId GUID of the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named operation for a network trace capturing (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getNetworkTraceOperationWithResponse( - String resourceGroupName, String name, String operationId, Context context) { - return getNetworkTraceOperationWithResponseAsync(resourceGroupName, name, operationId, context).block(); - } - - /** - * Start capturing network packets for the site (To be deprecated). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> startWebSiteNetworkTraceWithResponseAsync( - String resourceGroupName, String name, Integer durationInSeconds, Integer maxFrameLength, String sasUrl) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .startWebSiteNetworkTrace( - this.client.getEndpoint(), - resourceGroupName, - name, - durationInSeconds, - maxFrameLength, - sasUrl, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Start capturing network packets for the site (To be deprecated). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> startWebSiteNetworkTraceWithResponseAsync( - String resourceGroupName, - String name, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .startWebSiteNetworkTrace( - this.client.getEndpoint(), - resourceGroupName, - name, - durationInSeconds, - maxFrameLength, - sasUrl, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Start capturing network packets for the site (To be deprecated). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono startWebSiteNetworkTraceAsync( - String resourceGroupName, String name, Integer durationInSeconds, Integer maxFrameLength, String sasUrl) { - return startWebSiteNetworkTraceWithResponseAsync( - resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Start capturing network packets for the site (To be deprecated). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono startWebSiteNetworkTraceAsync(String resourceGroupName, String name) { - final Integer durationInSeconds = null; - final Integer maxFrameLength = null; - final String sasUrl = null; - return startWebSiteNetworkTraceWithResponseAsync( - resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Start capturing network packets for the site (To be deprecated). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public String startWebSiteNetworkTrace(String resourceGroupName, String name) { - final Integer durationInSeconds = null; - final Integer maxFrameLength = null; - final String sasUrl = null; - return startWebSiteNetworkTraceAsync(resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl) - .block(); - } - - /** - * Start capturing network packets for the site (To be deprecated). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response startWebSiteNetworkTraceWithResponse( - String resourceGroupName, - String name, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl, - Context context) { - return startWebSiteNetworkTraceWithResponseAsync( - resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl, context) - .block(); - } - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> startWebSiteNetworkTraceOperationWithResponseAsync( - String resourceGroupName, String name, Integer durationInSeconds, Integer maxFrameLength, String sasUrl) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .startWebSiteNetworkTraceOperation( - this.client.getEndpoint(), - resourceGroupName, - name, - durationInSeconds, - maxFrameLength, - sasUrl, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> startWebSiteNetworkTraceOperationWithResponseAsync( - String resourceGroupName, - String name, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .startWebSiteNetworkTraceOperation( - this.client.getEndpoint(), - resourceGroupName, - name, - durationInSeconds, - maxFrameLength, - sasUrl, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Object> beginStartWebSiteNetworkTraceOperationAsync( - String resourceGroupName, String name, Integer durationInSeconds, Integer maxFrameLength, String sasUrl) { - Mono>> mono = - startWebSiteNetworkTraceOperationWithResponseAsync( - resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Object.class, Object.class, this.client.getContext()); - } - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Object> beginStartWebSiteNetworkTraceOperationAsync( - String resourceGroupName, - String name, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - startWebSiteNetworkTraceOperationWithResponseAsync( - resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Object.class, Object.class, context); - } - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Object> beginStartWebSiteNetworkTraceOperation( - String resourceGroupName, String name, Integer durationInSeconds, Integer maxFrameLength, String sasUrl) { - return beginStartWebSiteNetworkTraceOperationAsync( - resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl) - .getSyncPoller(); - } - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Object> beginStartWebSiteNetworkTraceOperation( - String resourceGroupName, - String name, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl, - Context context) { - return beginStartWebSiteNetworkTraceOperationAsync( - resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl, context) - .getSyncPoller(); - } - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono startWebSiteNetworkTraceOperationAsync( - String resourceGroupName, String name, Integer durationInSeconds, Integer maxFrameLength, String sasUrl) { - return beginStartWebSiteNetworkTraceOperationAsync( - resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono startWebSiteNetworkTraceOperationAsync(String resourceGroupName, String name) { - final Integer durationInSeconds = null; - final Integer maxFrameLength = null; - final String sasUrl = null; - return beginStartWebSiteNetworkTraceOperationAsync( - resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono startWebSiteNetworkTraceOperationAsync( - String resourceGroupName, - String name, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl, - Context context) { - return beginStartWebSiteNetworkTraceOperationAsync( - resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Object startWebSiteNetworkTraceOperation( - String resourceGroupName, String name, Integer durationInSeconds, Integer maxFrameLength, String sasUrl) { - return startWebSiteNetworkTraceOperationAsync( - resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl) - .block(); - } - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Object startWebSiteNetworkTraceOperation(String resourceGroupName, String name) { - final Integer durationInSeconds = null; - final Integer maxFrameLength = null; - final String sasUrl = null; - return startWebSiteNetworkTraceOperationAsync( - resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl) - .block(); - } - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Object startWebSiteNetworkTraceOperation( - String resourceGroupName, - String name, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl, - Context context) { - return startWebSiteNetworkTraceOperationAsync( - resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl, context) - .block(); - } - - /** - * Stop ongoing capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> stopWebSiteNetworkTraceWithResponseAsync(String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .stopWebSiteNetworkTrace( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Stop ongoing capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> stopWebSiteNetworkTraceWithResponseAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .stopWebSiteNetworkTrace( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Stop ongoing capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono stopWebSiteNetworkTraceAsync(String resourceGroupName, String name) { - return stopWebSiteNetworkTraceWithResponseAsync(resourceGroupName, name) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Stop ongoing capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void stopWebSiteNetworkTrace(String resourceGroupName, String name) { - stopWebSiteNetworkTraceAsync(resourceGroupName, name).block(); - } - - /** - * Stop ongoing capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response stopWebSiteNetworkTraceWithResponse(String resourceGroupName, String name, Context context) { - return stopWebSiteNetworkTraceWithResponseAsync(resourceGroupName, name, context).block(); - } - - /** - * Gets a named operation for a network trace capturing (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param operationId GUID of the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named operation for a network trace capturing (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> getNetworkTracesWithResponseAsync( - String resourceGroupName, String name, String operationId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (operationId == null) { - return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getNetworkTraces( - this.client.getEndpoint(), - resourceGroupName, - name, - operationId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a named operation for a network trace capturing (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param operationId GUID of the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named operation for a network trace capturing (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> getNetworkTracesWithResponseAsync( - String resourceGroupName, String name, String operationId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (operationId == null) { - return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getNetworkTraces( - this.client.getEndpoint(), - resourceGroupName, - name, - operationId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets a named operation for a network trace capturing (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param operationId GUID of the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named operation for a network trace capturing (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getNetworkTracesAsync( - String resourceGroupName, String name, String operationId) { - return getNetworkTracesWithResponseAsync(resourceGroupName, name, operationId) - .flatMap( - (Response> res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a named operation for a network trace capturing (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param operationId GUID of the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named operation for a network trace capturing (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public List getNetworkTraces(String resourceGroupName, String name, String operationId) { - return getNetworkTracesAsync(resourceGroupName, name, operationId).block(); - } - - /** - * Gets a named operation for a network trace capturing (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param operationId GUID of the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named operation for a network trace capturing (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response> getNetworkTracesWithResponse( - String resourceGroupName, String name, String operationId, Context context) { - return getNetworkTracesWithResponseAsync(resourceGroupName, name, operationId, context).block(); - } - - /** - * Gets a named operation for a network trace capturing (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param operationId GUID of the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named operation for a network trace capturing (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getNetworkTraceOperationV2WithResponseAsync( - String resourceGroupName, String name, String operationId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (operationId == null) { - return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getNetworkTraceOperationV2( - this.client.getEndpoint(), - resourceGroupName, - name, - operationId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a named operation for a network trace capturing (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param operationId GUID of the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named operation for a network trace capturing (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getNetworkTraceOperationV2WithResponseAsync( - String resourceGroupName, String name, String operationId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (operationId == null) { - return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getNetworkTraceOperationV2( - this.client.getEndpoint(), - resourceGroupName, - name, - operationId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets a named operation for a network trace capturing (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param operationId GUID of the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named operation for a network trace capturing (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getNetworkTraceOperationV2Async(String resourceGroupName, String name, String operationId) { - return getNetworkTraceOperationV2WithResponseAsync(resourceGroupName, name, operationId) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a named operation for a network trace capturing (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param operationId GUID of the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named operation for a network trace capturing (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Object getNetworkTraceOperationV2(String resourceGroupName, String name, String operationId) { - return getNetworkTraceOperationV2Async(resourceGroupName, name, operationId).block(); - } - - /** - * Gets a named operation for a network trace capturing (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param operationId GUID of the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named operation for a network trace capturing (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getNetworkTraceOperationV2WithResponse( - String resourceGroupName, String name, String operationId, Context context) { - return getNetworkTraceOperationV2WithResponseAsync(resourceGroupName, name, operationId, context).block(); - } - - /** - * Gets a named operation for a network trace capturing (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param operationId GUID of the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named operation for a network trace capturing (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> getNetworkTracesV2WithResponseAsync( - String resourceGroupName, String name, String operationId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (operationId == null) { - return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getNetworkTracesV2( - this.client.getEndpoint(), - resourceGroupName, - name, - operationId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a named operation for a network trace capturing (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param operationId GUID of the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named operation for a network trace capturing (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> getNetworkTracesV2WithResponseAsync( - String resourceGroupName, String name, String operationId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (operationId == null) { - return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getNetworkTracesV2( - this.client.getEndpoint(), - resourceGroupName, - name, - operationId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets a named operation for a network trace capturing (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param operationId GUID of the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named operation for a network trace capturing (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getNetworkTracesV2Async( - String resourceGroupName, String name, String operationId) { - return getNetworkTracesV2WithResponseAsync(resourceGroupName, name, operationId) - .flatMap( - (Response> res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a named operation for a network trace capturing (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param operationId GUID of the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named operation for a network trace capturing (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public List getNetworkTracesV2(String resourceGroupName, String name, String operationId) { - return getNetworkTracesV2Async(resourceGroupName, name, operationId).block(); - } - - /** - * Gets a named operation for a network trace capturing (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param operationId GUID of the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named operation for a network trace capturing (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response> getNetworkTracesV2WithResponse( - String resourceGroupName, String name, String operationId, Context context) { - return getNetworkTracesV2WithResponseAsync(resourceGroupName, name, operationId, context).block(); - } - - /** - * Generates a new publishing password for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> generateNewSitePublishingPasswordWithResponseAsync( - String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .generateNewSitePublishingPassword( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Generates a new publishing password for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> generateNewSitePublishingPasswordWithResponseAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .generateNewSitePublishingPassword( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Generates a new publishing password for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono generateNewSitePublishingPasswordAsync(String resourceGroupName, String name) { - return generateNewSitePublishingPasswordWithResponseAsync(resourceGroupName, name) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Generates a new publishing password for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void generateNewSitePublishingPassword(String resourceGroupName, String name) { - generateNewSitePublishingPasswordAsync(resourceGroupName, name).block(); - } - - /** - * Generates a new publishing password for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response generateNewSitePublishingPasswordWithResponse( - String resourceGroupName, String name, Context context) { - return generateNewSitePublishingPasswordWithResponseAsync(resourceGroupName, name, context).block(); - } - - /** - * Gets perfmon counters for web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: - * $filter=(startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq - * duration'[Hour|Minute|Day]'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return perfmon counters for web app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listPerfMonCountersSinglePageAsync( - String resourceGroupName, String name, String filter) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listPerfMonCounters( - this.client.getEndpoint(), - resourceGroupName, - name, - filter, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets perfmon counters for web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: - * $filter=(startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq - * duration'[Hour|Minute|Day]'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return perfmon counters for web app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listPerfMonCountersSinglePageAsync( - String resourceGroupName, String name, String filter, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listPerfMonCounters( - this.client.getEndpoint(), - resourceGroupName, - name, - filter, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets perfmon counters for web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: - * $filter=(startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq - * duration'[Hour|Minute|Day]'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return perfmon counters for web app. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listPerfMonCountersAsync( - String resourceGroupName, String name, String filter) { - return new PagedFlux<>( - () -> listPerfMonCountersSinglePageAsync(resourceGroupName, name, filter), - nextLink -> listPerfMonCountersNextSinglePageAsync(nextLink)); - } - - /** - * Gets perfmon counters for web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return perfmon counters for web app. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listPerfMonCountersAsync(String resourceGroupName, String name) { - final String filter = null; - return new PagedFlux<>( - () -> listPerfMonCountersSinglePageAsync(resourceGroupName, name, filter), - nextLink -> listPerfMonCountersNextSinglePageAsync(nextLink)); - } - - /** - * Gets perfmon counters for web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: - * $filter=(startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq - * duration'[Hour|Minute|Day]'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return perfmon counters for web app. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listPerfMonCountersAsync( - String resourceGroupName, String name, String filter, Context context) { - return new PagedFlux<>( - () -> listPerfMonCountersSinglePageAsync(resourceGroupName, name, filter, context), - nextLink -> listPerfMonCountersNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets perfmon counters for web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return perfmon counters for web app. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listPerfMonCounters(String resourceGroupName, String name) { - final String filter = null; - return new PagedIterable<>(listPerfMonCountersAsync(resourceGroupName, name, filter)); - } - - /** - * Gets perfmon counters for web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: - * $filter=(startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq - * duration'[Hour|Minute|Day]'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return perfmon counters for web app. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listPerfMonCounters( - String resourceGroupName, String name, String filter, Context context) { - return new PagedIterable<>(listPerfMonCountersAsync(resourceGroupName, name, filter, context)); - } - - /** - * Gets web app's event logs. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return web app's event logs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getSitePhpErrorLogFlagWithResponseAsync( - String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getSitePhpErrorLogFlag( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets web app's event logs. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return web app's event logs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getSitePhpErrorLogFlagWithResponseAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getSitePhpErrorLogFlag( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets web app's event logs. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return web app's event logs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getSitePhpErrorLogFlagAsync(String resourceGroupName, String name) { - return getSitePhpErrorLogFlagWithResponseAsync(resourceGroupName, name) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets web app's event logs. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return web app's event logs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SitePhpErrorLogFlagInner getSitePhpErrorLogFlag(String resourceGroupName, String name) { - return getSitePhpErrorLogFlagAsync(resourceGroupName, name).block(); - } - - /** - * Gets web app's event logs. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return web app's event logs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getSitePhpErrorLogFlagWithResponse( - String resourceGroupName, String name, Context context) { - return getSitePhpErrorLogFlagWithResponseAsync(resourceGroupName, name, context).block(); - } - - /** - * Gets the premier add-ons of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the premier add-ons of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listPremierAddOnsWithResponseAsync(String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listPremierAddOns( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the premier add-ons of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the premier add-ons of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listPremierAddOnsWithResponseAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listPremierAddOns( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets the premier add-ons of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the premier add-ons of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listPremierAddOnsAsync(String resourceGroupName, String name) { - return listPremierAddOnsWithResponseAsync(resourceGroupName, name) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the premier add-ons of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the premier add-ons of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PremierAddOnInner listPremierAddOns(String resourceGroupName, String name) { - return listPremierAddOnsAsync(resourceGroupName, name).block(); - } - - /** - * Gets the premier add-ons of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the premier add-ons of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listPremierAddOnsWithResponse( - String resourceGroupName, String name, Context context) { - return listPremierAddOnsWithResponseAsync(resourceGroupName, name, context).block(); - } - - /** - * Gets a named add-on of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param premierAddOnName Add-on name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named add-on of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getPremierAddOnWithResponseAsync( - String resourceGroupName, String name, String premierAddOnName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (premierAddOnName == null) { - return Mono - .error(new IllegalArgumentException("Parameter premierAddOnName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getPremierAddOn( - this.client.getEndpoint(), - resourceGroupName, - name, - premierAddOnName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a named add-on of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param premierAddOnName Add-on name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named add-on of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getPremierAddOnWithResponseAsync( - String resourceGroupName, String name, String premierAddOnName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (premierAddOnName == null) { - return Mono - .error(new IllegalArgumentException("Parameter premierAddOnName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getPremierAddOn( - this.client.getEndpoint(), - resourceGroupName, - name, - premierAddOnName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets a named add-on of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param premierAddOnName Add-on name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named add-on of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getPremierAddOnAsync( - String resourceGroupName, String name, String premierAddOnName) { - return getPremierAddOnWithResponseAsync(resourceGroupName, name, premierAddOnName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a named add-on of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param premierAddOnName Add-on name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named add-on of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PremierAddOnInner getPremierAddOn(String resourceGroupName, String name, String premierAddOnName) { - return getPremierAddOnAsync(resourceGroupName, name, premierAddOnName).block(); - } - - /** - * Gets a named add-on of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param premierAddOnName Add-on name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named add-on of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getPremierAddOnWithResponse( - String resourceGroupName, String name, String premierAddOnName, Context context) { - return getPremierAddOnWithResponseAsync(resourceGroupName, name, premierAddOnName, context).block(); - } - - /** - * Updates a named add-on of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param premierAddOnName Add-on name. - * @param premierAddOn A JSON representation of the edited premier add-on. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return premier add-on. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> addPremierAddOnWithResponseAsync( - String resourceGroupName, String name, String premierAddOnName, PremierAddOnInner premierAddOn) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (premierAddOnName == null) { - return Mono - .error(new IllegalArgumentException("Parameter premierAddOnName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (premierAddOn == null) { - return Mono.error(new IllegalArgumentException("Parameter premierAddOn is required and cannot be null.")); - } else { - premierAddOn.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .addPremierAddOn( - this.client.getEndpoint(), - resourceGroupName, - name, - premierAddOnName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - premierAddOn, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates a named add-on of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param premierAddOnName Add-on name. - * @param premierAddOn A JSON representation of the edited premier add-on. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return premier add-on. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> addPremierAddOnWithResponseAsync( - String resourceGroupName, - String name, - String premierAddOnName, - PremierAddOnInner premierAddOn, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (premierAddOnName == null) { - return Mono - .error(new IllegalArgumentException("Parameter premierAddOnName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (premierAddOn == null) { - return Mono.error(new IllegalArgumentException("Parameter premierAddOn is required and cannot be null.")); - } else { - premierAddOn.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .addPremierAddOn( - this.client.getEndpoint(), - resourceGroupName, - name, - premierAddOnName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - premierAddOn, - accept, - context); - } - - /** - * Updates a named add-on of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param premierAddOnName Add-on name. - * @param premierAddOn A JSON representation of the edited premier add-on. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return premier add-on. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono addPremierAddOnAsync( - String resourceGroupName, String name, String premierAddOnName, PremierAddOnInner premierAddOn) { - return addPremierAddOnWithResponseAsync(resourceGroupName, name, premierAddOnName, premierAddOn) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Updates a named add-on of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param premierAddOnName Add-on name. - * @param premierAddOn A JSON representation of the edited premier add-on. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return premier add-on. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PremierAddOnInner addPremierAddOn( - String resourceGroupName, String name, String premierAddOnName, PremierAddOnInner premierAddOn) { - return addPremierAddOnAsync(resourceGroupName, name, premierAddOnName, premierAddOn).block(); - } - - /** - * Updates a named add-on of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param premierAddOnName Add-on name. - * @param premierAddOn A JSON representation of the edited premier add-on. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return premier add-on. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response addPremierAddOnWithResponse( - String resourceGroupName, - String name, - String premierAddOnName, - PremierAddOnInner premierAddOn, - Context context) { - return addPremierAddOnWithResponseAsync(resourceGroupName, name, premierAddOnName, premierAddOn, context) - .block(); - } - - /** - * Delete a premier add-on from an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param premierAddOnName Add-on name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deletePremierAddOnWithResponseAsync( - String resourceGroupName, String name, String premierAddOnName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (premierAddOnName == null) { - return Mono - .error(new IllegalArgumentException("Parameter premierAddOnName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .deletePremierAddOn( - this.client.getEndpoint(), - resourceGroupName, - name, - premierAddOnName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete a premier add-on from an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param premierAddOnName Add-on name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deletePremierAddOnWithResponseAsync( - String resourceGroupName, String name, String premierAddOnName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (premierAddOnName == null) { - return Mono - .error(new IllegalArgumentException("Parameter premierAddOnName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .deletePremierAddOn( - this.client.getEndpoint(), - resourceGroupName, - name, - premierAddOnName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Delete a premier add-on from an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param premierAddOnName Add-on name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deletePremierAddOnAsync(String resourceGroupName, String name, String premierAddOnName) { - return deletePremierAddOnWithResponseAsync(resourceGroupName, name, premierAddOnName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Delete a premier add-on from an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param premierAddOnName Add-on name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deletePremierAddOn(String resourceGroupName, String name, String premierAddOnName) { - deletePremierAddOnAsync(resourceGroupName, name, premierAddOnName).block(); - } - - /** - * Delete a premier add-on from an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param premierAddOnName Add-on name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deletePremierAddOnWithResponse( - String resourceGroupName, String name, String premierAddOnName, Context context) { - return deletePremierAddOnWithResponseAsync(resourceGroupName, name, premierAddOnName, context).block(); - } - - /** - * Updates a named add-on of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param premierAddOnName Add-on name. - * @param premierAddOn A JSON representation of the edited premier add-on. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return premier add-on. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updatePremierAddOnWithResponseAsync( - String resourceGroupName, String name, String premierAddOnName, PremierAddOnPatchResource premierAddOn) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (premierAddOnName == null) { - return Mono - .error(new IllegalArgumentException("Parameter premierAddOnName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (premierAddOn == null) { - return Mono.error(new IllegalArgumentException("Parameter premierAddOn is required and cannot be null.")); - } else { - premierAddOn.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updatePremierAddOn( - this.client.getEndpoint(), - resourceGroupName, - name, - premierAddOnName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - premierAddOn, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates a named add-on of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param premierAddOnName Add-on name. - * @param premierAddOn A JSON representation of the edited premier add-on. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return premier add-on. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updatePremierAddOnWithResponseAsync( - String resourceGroupName, - String name, - String premierAddOnName, - PremierAddOnPatchResource premierAddOn, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (premierAddOnName == null) { - return Mono - .error(new IllegalArgumentException("Parameter premierAddOnName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (premierAddOn == null) { - return Mono.error(new IllegalArgumentException("Parameter premierAddOn is required and cannot be null.")); - } else { - premierAddOn.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updatePremierAddOn( - this.client.getEndpoint(), - resourceGroupName, - name, - premierAddOnName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - premierAddOn, - accept, - context); - } - - /** - * Updates a named add-on of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param premierAddOnName Add-on name. - * @param premierAddOn A JSON representation of the edited premier add-on. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return premier add-on. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updatePremierAddOnAsync( - String resourceGroupName, String name, String premierAddOnName, PremierAddOnPatchResource premierAddOn) { - return updatePremierAddOnWithResponseAsync(resourceGroupName, name, premierAddOnName, premierAddOn) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Updates a named add-on of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param premierAddOnName Add-on name. - * @param premierAddOn A JSON representation of the edited premier add-on. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return premier add-on. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PremierAddOnInner updatePremierAddOn( - String resourceGroupName, String name, String premierAddOnName, PremierAddOnPatchResource premierAddOn) { - return updatePremierAddOnAsync(resourceGroupName, name, premierAddOnName, premierAddOn).block(); - } - - /** - * Updates a named add-on of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param premierAddOnName Add-on name. - * @param premierAddOn A JSON representation of the edited premier add-on. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return premier add-on. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updatePremierAddOnWithResponse( - String resourceGroupName, - String name, - String premierAddOnName, - PremierAddOnPatchResource premierAddOn, - Context context) { - return updatePremierAddOnWithResponseAsync(resourceGroupName, name, premierAddOnName, premierAddOn, context) - .block(); - } - - /** - * Gets data around private site access enablement and authorized Virtual Networks that can access the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data around private site access enablement and authorized Virtual Networks that can access the site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getPrivateAccessWithResponseAsync(String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getPrivateAccess( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets data around private site access enablement and authorized Virtual Networks that can access the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data around private site access enablement and authorized Virtual Networks that can access the site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getPrivateAccessWithResponseAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getPrivateAccess( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets data around private site access enablement and authorized Virtual Networks that can access the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data around private site access enablement and authorized Virtual Networks that can access the site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getPrivateAccessAsync(String resourceGroupName, String name) { - return getPrivateAccessWithResponseAsync(resourceGroupName, name) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets data around private site access enablement and authorized Virtual Networks that can access the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data around private site access enablement and authorized Virtual Networks that can access the site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateAccessInner getPrivateAccess(String resourceGroupName, String name) { - return getPrivateAccessAsync(resourceGroupName, name).block(); - } - - /** - * Gets data around private site access enablement and authorized Virtual Networks that can access the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data around private site access enablement and authorized Virtual Networks that can access the site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getPrivateAccessWithResponse( - String resourceGroupName, String name, Context context) { - return getPrivateAccessWithResponseAsync(resourceGroupName, name, context).block(); - } - - /** - * Sets data around private site access enablement and authorized Virtual Networks that can access the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param access The information for the private access. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of the parameters of Private Access for a Web Site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> putPrivateAccessVnetWithResponseAsync( - String resourceGroupName, String name, PrivateAccessInner access) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (access == null) { - return Mono.error(new IllegalArgumentException("Parameter access is required and cannot be null.")); - } else { - access.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .putPrivateAccessVnet( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - access, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Sets data around private site access enablement and authorized Virtual Networks that can access the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param access The information for the private access. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of the parameters of Private Access for a Web Site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> putPrivateAccessVnetWithResponseAsync( - String resourceGroupName, String name, PrivateAccessInner access, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (access == null) { - return Mono.error(new IllegalArgumentException("Parameter access is required and cannot be null.")); - } else { - access.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .putPrivateAccessVnet( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - access, - accept, - context); - } - - /** - * Sets data around private site access enablement and authorized Virtual Networks that can access the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param access The information for the private access. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of the parameters of Private Access for a Web Site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono putPrivateAccessVnetAsync( - String resourceGroupName, String name, PrivateAccessInner access) { - return putPrivateAccessVnetWithResponseAsync(resourceGroupName, name, access) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Sets data around private site access enablement and authorized Virtual Networks that can access the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param access The information for the private access. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of the parameters of Private Access for a Web Site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateAccessInner putPrivateAccessVnet(String resourceGroupName, String name, PrivateAccessInner access) { - return putPrivateAccessVnetAsync(resourceGroupName, name, access).block(); - } - - /** - * Sets data around private site access enablement and authorized Virtual Networks that can access the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param access The information for the private access. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of the parameters of Private Access for a Web Site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response putPrivateAccessVnetWithResponse( - String resourceGroupName, String name, PrivateAccessInner access, Context context) { - return putPrivateAccessVnetWithResponseAsync(resourceGroupName, name, access, context).block(); - } - - /** - * Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web - * site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listProcessesSinglePageAsync(String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listProcesses( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web - * site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listProcessesSinglePageAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listProcesses( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web - * site. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listProcessesAsync(String resourceGroupName, String name) { - return new PagedFlux<>( - () -> listProcessesSinglePageAsync(resourceGroupName, name), - nextLink -> listProcessesNextSinglePageAsync(nextLink)); - } - - /** - * Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web - * site. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listProcessesAsync(String resourceGroupName, String name, Context context) { - return new PagedFlux<>( - () -> listProcessesSinglePageAsync(resourceGroupName, name, context), - nextLink -> listProcessesNextSinglePageAsync(nextLink, context)); - } - - /** - * Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web - * site. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listProcesses(String resourceGroupName, String name) { - return new PagedIterable<>(listProcessesAsync(resourceGroupName, name)); - } - - /** - * Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web - * site. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listProcesses(String resourceGroupName, String name, Context context) { - return new PagedIterable<>(listProcessesAsync(resourceGroupName, name, context)); - } - - /** - * Get process information by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return process information by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getProcessWithResponseAsync( - String resourceGroupName, String name, String processId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (processId == null) { - return Mono.error(new IllegalArgumentException("Parameter processId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getProcess( - this.client.getEndpoint(), - resourceGroupName, - name, - processId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get process information by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return process information by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getProcessWithResponseAsync( - String resourceGroupName, String name, String processId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (processId == null) { - return Mono.error(new IllegalArgumentException("Parameter processId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getProcess( - this.client.getEndpoint(), - resourceGroupName, - name, - processId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Get process information by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return process information by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getProcessAsync(String resourceGroupName, String name, String processId) { - return getProcessWithResponseAsync(resourceGroupName, name, processId) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get process information by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return process information by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ProcessInfoInner getProcess(String resourceGroupName, String name, String processId) { - return getProcessAsync(resourceGroupName, name, processId).block(); - } - - /** - * Get process information by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return process information by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getProcessWithResponse( - String resourceGroupName, String name, String processId, Context context) { - return getProcessWithResponseAsync(resourceGroupName, name, processId, context).block(); - } - - /** - * Terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in a web - * site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteProcessWithResponseAsync( - String resourceGroupName, String name, String processId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (processId == null) { - return Mono.error(new IllegalArgumentException("Parameter processId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .deleteProcess( - this.client.getEndpoint(), - resourceGroupName, - name, - processId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in a web - * site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteProcessWithResponseAsync( - String resourceGroupName, String name, String processId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (processId == null) { - return Mono.error(new IllegalArgumentException("Parameter processId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .deleteProcess( - this.client.getEndpoint(), - resourceGroupName, - name, - processId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in a web - * site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteProcessAsync(String resourceGroupName, String name, String processId) { - return deleteProcessWithResponseAsync(resourceGroupName, name, processId) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in a web - * site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteProcess(String resourceGroupName, String name, String processId) { - deleteProcessAsync(resourceGroupName, name, processId).block(); - } - - /** - * Terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in a web - * site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteProcessWithResponse( - String resourceGroupName, String name, String processId, Context context) { - return deleteProcessWithResponseAsync(resourceGroupName, name, processId, context).block(); - } - - /** - * Get a memory dump of a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a memory dump of a process by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getProcessDumpWithResponseAsync( - String resourceGroupName, String name, String processId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (processId == null) { - return Mono.error(new IllegalArgumentException("Parameter processId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getProcessDump( - this.client.getEndpoint(), - resourceGroupName, - name, - processId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a memory dump of a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a memory dump of a process by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getProcessDumpWithResponseAsync( - String resourceGroupName, String name, String processId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (processId == null) { - return Mono.error(new IllegalArgumentException("Parameter processId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getProcessDump( - this.client.getEndpoint(), - resourceGroupName, - name, - processId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Get a memory dump of a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a memory dump of a process by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Flux getProcessDumpAsync(String resourceGroupName, String name, String processId) { - return getProcessDumpWithResponseAsync(resourceGroupName, name, processId) - .flatMapMany(StreamResponse::getValue); - } - - /** - * Get a memory dump of a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a memory dump of a process by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public InputStream getProcessDump(String resourceGroupName, String name, String processId) { - Iterator iterator = - getProcessDumpAsync(resourceGroupName, name, processId) - .map(ByteBufferBackedInputStream::new) - .toStream() - .iterator(); - Enumeration enumeration = - new Enumeration() { - @Override - public boolean hasMoreElements() { - return iterator.hasNext(); - } - - @Override - public InputStream nextElement() { - return iterator.next(); - } - }; - return new SequenceInputStream(enumeration); - } - - /** - * Get a memory dump of a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a memory dump of a process by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public StreamResponse getProcessDumpWithResponse( - String resourceGroupName, String name, String processId, Context context) { - return getProcessDumpWithResponseAsync(resourceGroupName, name, processId, context).block(); - } - - /** - * List module information for a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listProcessModulesSinglePageAsync( - String resourceGroupName, String name, String processId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (processId == null) { - return Mono.error(new IllegalArgumentException("Parameter processId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listProcessModules( - this.client.getEndpoint(), - resourceGroupName, - name, - processId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List module information for a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listProcessModulesSinglePageAsync( - String resourceGroupName, String name, String processId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (processId == null) { - return Mono.error(new IllegalArgumentException("Parameter processId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listProcessModules( - this.client.getEndpoint(), - resourceGroupName, - name, - processId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * List module information for a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listProcessModulesAsync( - String resourceGroupName, String name, String processId) { - return new PagedFlux<>( - () -> listProcessModulesSinglePageAsync(resourceGroupName, name, processId), - nextLink -> listProcessModulesNextSinglePageAsync(nextLink)); - } - - /** - * List module information for a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listProcessModulesAsync( - String resourceGroupName, String name, String processId, Context context) { - return new PagedFlux<>( - () -> listProcessModulesSinglePageAsync(resourceGroupName, name, processId, context), - nextLink -> listProcessModulesNextSinglePageAsync(nextLink, context)); - } - - /** - * List module information for a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listProcessModules( - String resourceGroupName, String name, String processId) { - return new PagedIterable<>(listProcessModulesAsync(resourceGroupName, name, processId)); - } - - /** - * List module information for a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listProcessModules( - String resourceGroupName, String name, String processId, Context context) { - return new PagedIterable<>(listProcessModulesAsync(resourceGroupName, name, processId, context)); - } - - /** - * Get process information by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param baseAddress Module base address. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return process information by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getProcessModuleWithResponseAsync( - String resourceGroupName, String name, String processId, String baseAddress) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (processId == null) { - return Mono.error(new IllegalArgumentException("Parameter processId is required and cannot be null.")); - } - if (baseAddress == null) { - return Mono.error(new IllegalArgumentException("Parameter baseAddress is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getProcessModule( - this.client.getEndpoint(), - resourceGroupName, - name, - processId, - baseAddress, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get process information by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param baseAddress Module base address. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return process information by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getProcessModuleWithResponseAsync( - String resourceGroupName, String name, String processId, String baseAddress, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (processId == null) { - return Mono.error(new IllegalArgumentException("Parameter processId is required and cannot be null.")); - } - if (baseAddress == null) { - return Mono.error(new IllegalArgumentException("Parameter baseAddress is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getProcessModule( - this.client.getEndpoint(), - resourceGroupName, - name, - processId, - baseAddress, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Get process information by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param baseAddress Module base address. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return process information by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getProcessModuleAsync( - String resourceGroupName, String name, String processId, String baseAddress) { - return getProcessModuleWithResponseAsync(resourceGroupName, name, processId, baseAddress) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get process information by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param baseAddress Module base address. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return process information by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ProcessModuleInfoInner getProcessModule( - String resourceGroupName, String name, String processId, String baseAddress) { - return getProcessModuleAsync(resourceGroupName, name, processId, baseAddress).block(); - } - - /** - * Get process information by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param baseAddress Module base address. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return process information by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getProcessModuleWithResponse( - String resourceGroupName, String name, String processId, String baseAddress, Context context) { - return getProcessModuleWithResponseAsync(resourceGroupName, name, processId, baseAddress, context).block(); - } - - /** - * List the threads in a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listProcessThreadsSinglePageAsync( - String resourceGroupName, String name, String processId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (processId == null) { - return Mono.error(new IllegalArgumentException("Parameter processId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listProcessThreads( - this.client.getEndpoint(), - resourceGroupName, - name, - processId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List the threads in a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listProcessThreadsSinglePageAsync( - String resourceGroupName, String name, String processId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (processId == null) { - return Mono.error(new IllegalArgumentException("Parameter processId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listProcessThreads( - this.client.getEndpoint(), - resourceGroupName, - name, - processId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * List the threads in a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listProcessThreadsAsync( - String resourceGroupName, String name, String processId) { - return new PagedFlux<>( - () -> listProcessThreadsSinglePageAsync(resourceGroupName, name, processId), - nextLink -> listProcessThreadsNextSinglePageAsync(nextLink)); - } - - /** - * List the threads in a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listProcessThreadsAsync( - String resourceGroupName, String name, String processId, Context context) { - return new PagedFlux<>( - () -> listProcessThreadsSinglePageAsync(resourceGroupName, name, processId, context), - nextLink -> listProcessThreadsNextSinglePageAsync(nextLink, context)); - } - - /** - * List the threads in a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listProcessThreads( - String resourceGroupName, String name, String processId) { - return new PagedIterable<>(listProcessThreadsAsync(resourceGroupName, name, processId)); - } - - /** - * List the threads in a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listProcessThreads( - String resourceGroupName, String name, String processId, Context context) { - return new PagedIterable<>(listProcessThreadsAsync(resourceGroupName, name, processId, context)); - } - - /** - * Get thread information by Thread ID for a specific process, in a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param threadId TID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return thread information by Thread ID for a specific process, in a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getProcessThreadWithResponseAsync( - String resourceGroupName, String name, String processId, String threadId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (processId == null) { - return Mono.error(new IllegalArgumentException("Parameter processId is required and cannot be null.")); - } - if (threadId == null) { - return Mono.error(new IllegalArgumentException("Parameter threadId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getProcessThread( - this.client.getEndpoint(), - resourceGroupName, - name, - processId, - threadId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get thread information by Thread ID for a specific process, in a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param threadId TID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return thread information by Thread ID for a specific process, in a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getProcessThreadWithResponseAsync( - String resourceGroupName, String name, String processId, String threadId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (processId == null) { - return Mono.error(new IllegalArgumentException("Parameter processId is required and cannot be null.")); - } - if (threadId == null) { - return Mono.error(new IllegalArgumentException("Parameter threadId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getProcessThread( - this.client.getEndpoint(), - resourceGroupName, - name, - processId, - threadId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Get thread information by Thread ID for a specific process, in a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param threadId TID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return thread information by Thread ID for a specific process, in a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getProcessThreadAsync( - String resourceGroupName, String name, String processId, String threadId) { - return getProcessThreadWithResponseAsync(resourceGroupName, name, processId, threadId) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get thread information by Thread ID for a specific process, in a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param threadId TID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return thread information by Thread ID for a specific process, in a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ProcessThreadInfoInner getProcessThread( - String resourceGroupName, String name, String processId, String threadId) { - return getProcessThreadAsync(resourceGroupName, name, processId, threadId).block(); - } - - /** - * Get thread information by Thread ID for a specific process, in a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param threadId TID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return thread information by Thread ID for a specific process, in a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getProcessThreadWithResponse( - String resourceGroupName, String name, String processId, String threadId, Context context) { - return getProcessThreadWithResponseAsync(resourceGroupName, name, processId, threadId, context).block(); - } - - /** - * Get public certificates for an app or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public certificates for an app or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listPublicCertificatesSinglePageAsync( - String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listPublicCertificates( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get public certificates for an app or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public certificates for an app or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listPublicCertificatesSinglePageAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listPublicCertificates( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get public certificates for an app or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public certificates for an app or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listPublicCertificatesAsync(String resourceGroupName, String name) { - return new PagedFlux<>( - () -> listPublicCertificatesSinglePageAsync(resourceGroupName, name), - nextLink -> listPublicCertificatesNextSinglePageAsync(nextLink)); - } - - /** - * Get public certificates for an app or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public certificates for an app or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listPublicCertificatesAsync( - String resourceGroupName, String name, Context context) { - return new PagedFlux<>( - () -> listPublicCertificatesSinglePageAsync(resourceGroupName, name, context), - nextLink -> listPublicCertificatesNextSinglePageAsync(nextLink, context)); - } - - /** - * Get public certificates for an app or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public certificates for an app or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listPublicCertificates(String resourceGroupName, String name) { - return new PagedIterable<>(listPublicCertificatesAsync(resourceGroupName, name)); - } - - /** - * Get public certificates for an app or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public certificates for an app or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listPublicCertificates( - String resourceGroupName, String name, Context context) { - return new PagedIterable<>(listPublicCertificatesAsync(resourceGroupName, name, context)); - } - - /** - * Get the named public certificate for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param publicCertificateName Public certificate name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the named public certificate for an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getPublicCertificateWithResponseAsync( - String resourceGroupName, String name, String publicCertificateName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (publicCertificateName == null) { - return Mono - .error(new IllegalArgumentException("Parameter publicCertificateName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getPublicCertificate( - this.client.getEndpoint(), - resourceGroupName, - name, - publicCertificateName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the named public certificate for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param publicCertificateName Public certificate name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the named public certificate for an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getPublicCertificateWithResponseAsync( - String resourceGroupName, String name, String publicCertificateName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (publicCertificateName == null) { - return Mono - .error(new IllegalArgumentException("Parameter publicCertificateName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getPublicCertificate( - this.client.getEndpoint(), - resourceGroupName, - name, - publicCertificateName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Get the named public certificate for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param publicCertificateName Public certificate name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the named public certificate for an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getPublicCertificateAsync( - String resourceGroupName, String name, String publicCertificateName) { - return getPublicCertificateWithResponseAsync(resourceGroupName, name, publicCertificateName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get the named public certificate for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param publicCertificateName Public certificate name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the named public certificate for an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PublicCertificateInner getPublicCertificate( - String resourceGroupName, String name, String publicCertificateName) { - return getPublicCertificateAsync(resourceGroupName, name, publicCertificateName).block(); - } - - /** - * Get the named public certificate for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param publicCertificateName Public certificate name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the named public certificate for an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getPublicCertificateWithResponse( - String resourceGroupName, String name, String publicCertificateName, Context context) { - return getPublicCertificateWithResponseAsync(resourceGroupName, name, publicCertificateName, context).block(); - } - - /** - * Creates a hostname binding for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param publicCertificateName Public certificate name. - * @param publicCertificate Public certificate details. This is the JSON representation of a PublicCertificate - * object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public certificate object. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdatePublicCertificateWithResponseAsync( - String resourceGroupName, String name, String publicCertificateName, PublicCertificateInner publicCertificate) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (publicCertificateName == null) { - return Mono - .error(new IllegalArgumentException("Parameter publicCertificateName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (publicCertificate == null) { - return Mono - .error(new IllegalArgumentException("Parameter publicCertificate is required and cannot be null.")); - } else { - publicCertificate.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdatePublicCertificate( - this.client.getEndpoint(), - resourceGroupName, - name, - publicCertificateName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - publicCertificate, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates a hostname binding for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param publicCertificateName Public certificate name. - * @param publicCertificate Public certificate details. This is the JSON representation of a PublicCertificate - * object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public certificate object. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdatePublicCertificateWithResponseAsync( - String resourceGroupName, - String name, - String publicCertificateName, - PublicCertificateInner publicCertificate, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (publicCertificateName == null) { - return Mono - .error(new IllegalArgumentException("Parameter publicCertificateName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (publicCertificate == null) { - return Mono - .error(new IllegalArgumentException("Parameter publicCertificate is required and cannot be null.")); - } else { - publicCertificate.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdatePublicCertificate( - this.client.getEndpoint(), - resourceGroupName, - name, - publicCertificateName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - publicCertificate, - accept, - context); - } - - /** - * Creates a hostname binding for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param publicCertificateName Public certificate name. - * @param publicCertificate Public certificate details. This is the JSON representation of a PublicCertificate - * object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public certificate object. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdatePublicCertificateAsync( - String resourceGroupName, String name, String publicCertificateName, PublicCertificateInner publicCertificate) { - return createOrUpdatePublicCertificateWithResponseAsync( - resourceGroupName, name, publicCertificateName, publicCertificate) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates a hostname binding for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param publicCertificateName Public certificate name. - * @param publicCertificate Public certificate details. This is the JSON representation of a PublicCertificate - * object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public certificate object. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PublicCertificateInner createOrUpdatePublicCertificate( - String resourceGroupName, String name, String publicCertificateName, PublicCertificateInner publicCertificate) { - return createOrUpdatePublicCertificateAsync(resourceGroupName, name, publicCertificateName, publicCertificate) - .block(); - } - - /** - * Creates a hostname binding for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param publicCertificateName Public certificate name. - * @param publicCertificate Public certificate details. This is the JSON representation of a PublicCertificate - * object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public certificate object. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdatePublicCertificateWithResponse( - String resourceGroupName, - String name, - String publicCertificateName, - PublicCertificateInner publicCertificate, - Context context) { - return createOrUpdatePublicCertificateWithResponseAsync( - resourceGroupName, name, publicCertificateName, publicCertificate, context) - .block(); - } - - /** - * Deletes a hostname binding for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param publicCertificateName Public certificate name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deletePublicCertificateWithResponseAsync( - String resourceGroupName, String name, String publicCertificateName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (publicCertificateName == null) { - return Mono - .error(new IllegalArgumentException("Parameter publicCertificateName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .deletePublicCertificate( - this.client.getEndpoint(), - resourceGroupName, - name, - publicCertificateName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a hostname binding for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param publicCertificateName Public certificate name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deletePublicCertificateWithResponseAsync( - String resourceGroupName, String name, String publicCertificateName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (publicCertificateName == null) { - return Mono - .error(new IllegalArgumentException("Parameter publicCertificateName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .deletePublicCertificate( - this.client.getEndpoint(), - resourceGroupName, - name, - publicCertificateName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Deletes a hostname binding for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param publicCertificateName Public certificate name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deletePublicCertificateAsync( - String resourceGroupName, String name, String publicCertificateName) { - return deletePublicCertificateWithResponseAsync(resourceGroupName, name, publicCertificateName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes a hostname binding for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param publicCertificateName Public certificate name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deletePublicCertificate(String resourceGroupName, String name, String publicCertificateName) { - deletePublicCertificateAsync(resourceGroupName, name, publicCertificateName).block(); - } - - /** - * Deletes a hostname binding for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param publicCertificateName Public certificate name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deletePublicCertificateWithResponse( - String resourceGroupName, String name, String publicCertificateName, Context context) { - return deletePublicCertificateWithResponseAsync(resourceGroupName, name, publicCertificateName, context) - .block(); - } - - /** - * Gets the publishing profile for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param publishingProfileOptions Specifies publishingProfileOptions for publishing profile. For example, use - * {"format": "FileZilla3"} to get a FileZilla publishing profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the publishing profile for an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listPublishingProfileXmlWithSecretsWithResponseAsync( - String resourceGroupName, String name, CsmPublishingProfileOptions publishingProfileOptions) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (publishingProfileOptions == null) { - return Mono - .error( - new IllegalArgumentException("Parameter publishingProfileOptions is required and cannot be null.")); - } else { - publishingProfileOptions.validate(); - } - final String accept = "application/xml"; - return FluxUtil - .withContext( - context -> - service - .listPublishingProfileXmlWithSecrets( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - publishingProfileOptions, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the publishing profile for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param publishingProfileOptions Specifies publishingProfileOptions for publishing profile. For example, use - * {"format": "FileZilla3"} to get a FileZilla publishing profile. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the publishing profile for an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listPublishingProfileXmlWithSecretsWithResponseAsync( - String resourceGroupName, String name, CsmPublishingProfileOptions publishingProfileOptions, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (publishingProfileOptions == null) { - return Mono - .error( - new IllegalArgumentException("Parameter publishingProfileOptions is required and cannot be null.")); - } else { - publishingProfileOptions.validate(); - } - final String accept = "application/xml"; - context = this.client.mergeContext(context); - return service - .listPublishingProfileXmlWithSecrets( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - publishingProfileOptions, - accept, - context); - } - - /** - * Gets the publishing profile for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param publishingProfileOptions Specifies publishingProfileOptions for publishing profile. For example, use - * {"format": "FileZilla3"} to get a FileZilla publishing profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the publishing profile for an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Flux listPublishingProfileXmlWithSecretsAsync( - String resourceGroupName, String name, CsmPublishingProfileOptions publishingProfileOptions) { - return listPublishingProfileXmlWithSecretsWithResponseAsync(resourceGroupName, name, publishingProfileOptions) - .flatMapMany(StreamResponse::getValue); - } - - /** - * Gets the publishing profile for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param publishingProfileOptions Specifies publishingProfileOptions for publishing profile. For example, use - * {"format": "FileZilla3"} to get a FileZilla publishing profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the publishing profile for an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public InputStream listPublishingProfileXmlWithSecrets( - String resourceGroupName, String name, CsmPublishingProfileOptions publishingProfileOptions) { - Iterator iterator = - listPublishingProfileXmlWithSecretsAsync(resourceGroupName, name, publishingProfileOptions) - .map(ByteBufferBackedInputStream::new) - .toStream() - .iterator(); - Enumeration enumeration = - new Enumeration() { - @Override - public boolean hasMoreElements() { - return iterator.hasNext(); - } - - @Override - public InputStream nextElement() { - return iterator.next(); - } - }; - return new SequenceInputStream(enumeration); - } - - /** - * Gets the publishing profile for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param publishingProfileOptions Specifies publishingProfileOptions for publishing profile. For example, use - * {"format": "FileZilla3"} to get a FileZilla publishing profile. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the publishing profile for an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public StreamResponse listPublishingProfileXmlWithSecretsWithResponse( - String resourceGroupName, String name, CsmPublishingProfileOptions publishingProfileOptions, Context context) { - return listPublishingProfileXmlWithSecretsWithResponseAsync( - resourceGroupName, name, publishingProfileOptions, context) - .block(); - } - - /** - * Resets the configuration settings of the current slot if they were previously modified by calling the API with - * POST. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> resetProductionSlotConfigWithResponseAsync(String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .resetProductionSlotConfig( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Resets the configuration settings of the current slot if they were previously modified by calling the API with - * POST. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> resetProductionSlotConfigWithResponseAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .resetProductionSlotConfig( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Resets the configuration settings of the current slot if they were previously modified by calling the API with - * POST. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono resetProductionSlotConfigAsync(String resourceGroupName, String name) { - return resetProductionSlotConfigWithResponseAsync(resourceGroupName, name) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Resets the configuration settings of the current slot if they were previously modified by calling the API with - * POST. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void resetProductionSlotConfig(String resourceGroupName, String name) { - resetProductionSlotConfigAsync(resourceGroupName, name).block(); - } - - /** - * Resets the configuration settings of the current slot if they were previously modified by calling the API with - * POST. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response resetProductionSlotConfigWithResponse( - String resourceGroupName, String name, Context context) { - return resetProductionSlotConfigWithResponseAsync(resourceGroupName, name, context).block(); - } - - /** - * Restarts an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param softRestart Specify true to apply the configuration settings and restarts the app only if necessary. By - * default, the API always restarts and reprovisions the app. - * @param synchronous Specify true to block until the app is restarted. By default, it is set to false, and the API - * responds immediately (asynchronous). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> restartWithResponseAsync( - String resourceGroupName, String name, Boolean softRestart, Boolean synchronous) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .restart( - this.client.getEndpoint(), - resourceGroupName, - name, - softRestart, - synchronous, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Restarts an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param softRestart Specify true to apply the configuration settings and restarts the app only if necessary. By - * default, the API always restarts and reprovisions the app. - * @param synchronous Specify true to block until the app is restarted. By default, it is set to false, and the API - * responds immediately (asynchronous). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> restartWithResponseAsync( - String resourceGroupName, String name, Boolean softRestart, Boolean synchronous, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .restart( - this.client.getEndpoint(), - resourceGroupName, - name, - softRestart, - synchronous, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Restarts an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param softRestart Specify true to apply the configuration settings and restarts the app only if necessary. By - * default, the API always restarts and reprovisions the app. - * @param synchronous Specify true to block until the app is restarted. By default, it is set to false, and the API - * responds immediately (asynchronous). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono restartAsync(String resourceGroupName, String name, Boolean softRestart, Boolean synchronous) { - return restartWithResponseAsync(resourceGroupName, name, softRestart, synchronous) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Restarts an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono restartAsync(String resourceGroupName, String name) { - final Boolean softRestart = null; - final Boolean synchronous = null; - return restartWithResponseAsync(resourceGroupName, name, softRestart, synchronous) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Restarts an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void restart(String resourceGroupName, String name) { - final Boolean softRestart = null; - final Boolean synchronous = null; - restartAsync(resourceGroupName, name, softRestart, synchronous).block(); - } - - /** - * Restarts an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param softRestart Specify true to apply the configuration settings and restarts the app only if necessary. By - * default, the API always restarts and reprovisions the app. - * @param synchronous Specify true to block until the app is restarted. By default, it is set to false, and the API - * responds immediately (asynchronous). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response restartWithResponse( - String resourceGroupName, String name, Boolean softRestart, Boolean synchronous, Context context) { - return restartWithResponseAsync(resourceGroupName, name, softRestart, synchronous, context).block(); - } - - /** - * Restores an app from a backup blob in Azure Storage. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param request Information on restore request . - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> restoreFromBackupBlobWithResponseAsync( - String resourceGroupName, String name, RestoreRequestInner request) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (request == null) { - return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); - } else { - request.validate(); - } - return FluxUtil - .withContext( - context -> - service - .restoreFromBackupBlob( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - request, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Restores an app from a backup blob in Azure Storage. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param request Information on restore request . - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> restoreFromBackupBlobWithResponseAsync( - String resourceGroupName, String name, RestoreRequestInner request, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (request == null) { - return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); - } else { - request.validate(); - } - context = this.client.mergeContext(context); - return service - .restoreFromBackupBlob( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - request, - context); - } - - /** - * Restores an app from a backup blob in Azure Storage. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param request Information on restore request . - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginRestoreFromBackupBlobAsync( - String resourceGroupName, String name, RestoreRequestInner request) { - Mono>> mono = - restoreFromBackupBlobWithResponseAsync(resourceGroupName, name, request); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Restores an app from a backup blob in Azure Storage. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param request Information on restore request . - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginRestoreFromBackupBlobAsync( - String resourceGroupName, String name, RestoreRequestInner request, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - restoreFromBackupBlobWithResponseAsync(resourceGroupName, name, request, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Restores an app from a backup blob in Azure Storage. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param request Information on restore request . - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginRestoreFromBackupBlob( - String resourceGroupName, String name, RestoreRequestInner request) { - return beginRestoreFromBackupBlobAsync(resourceGroupName, name, request).getSyncPoller(); - } - - /** - * Restores an app from a backup blob in Azure Storage. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param request Information on restore request . - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginRestoreFromBackupBlob( - String resourceGroupName, String name, RestoreRequestInner request, Context context) { - return beginRestoreFromBackupBlobAsync(resourceGroupName, name, request, context).getSyncPoller(); - } - - /** - * Restores an app from a backup blob in Azure Storage. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param request Information on restore request . - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono restoreFromBackupBlobAsync(String resourceGroupName, String name, RestoreRequestInner request) { - return beginRestoreFromBackupBlobAsync(resourceGroupName, name, request) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Restores an app from a backup blob in Azure Storage. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param request Information on restore request . - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono restoreFromBackupBlobAsync( - String resourceGroupName, String name, RestoreRequestInner request, Context context) { - return beginRestoreFromBackupBlobAsync(resourceGroupName, name, request, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Restores an app from a backup blob in Azure Storage. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param request Information on restore request . - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void restoreFromBackupBlob(String resourceGroupName, String name, RestoreRequestInner request) { - restoreFromBackupBlobAsync(resourceGroupName, name, request).block(); - } - - /** - * Restores an app from a backup blob in Azure Storage. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param request Information on restore request . - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void restoreFromBackupBlob( - String resourceGroupName, String name, RestoreRequestInner request, Context context) { - restoreFromBackupBlobAsync(resourceGroupName, name, request, context).block(); - } - - /** - * Restores a deleted web app to this web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param restoreRequest Deleted web app restore information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> restoreFromDeletedAppWithResponseAsync( - String resourceGroupName, String name, DeletedAppRestoreRequest restoreRequest) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (restoreRequest == null) { - return Mono.error(new IllegalArgumentException("Parameter restoreRequest is required and cannot be null.")); - } else { - restoreRequest.validate(); - } - return FluxUtil - .withContext( - context -> - service - .restoreFromDeletedApp( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - restoreRequest, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Restores a deleted web app to this web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param restoreRequest Deleted web app restore information. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> restoreFromDeletedAppWithResponseAsync( - String resourceGroupName, String name, DeletedAppRestoreRequest restoreRequest, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (restoreRequest == null) { - return Mono.error(new IllegalArgumentException("Parameter restoreRequest is required and cannot be null.")); - } else { - restoreRequest.validate(); - } - context = this.client.mergeContext(context); - return service - .restoreFromDeletedApp( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - restoreRequest, - context); - } - - /** - * Restores a deleted web app to this web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param restoreRequest Deleted web app restore information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginRestoreFromDeletedAppAsync( - String resourceGroupName, String name, DeletedAppRestoreRequest restoreRequest) { - Mono>> mono = - restoreFromDeletedAppWithResponseAsync(resourceGroupName, name, restoreRequest); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Restores a deleted web app to this web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param restoreRequest Deleted web app restore information. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginRestoreFromDeletedAppAsync( - String resourceGroupName, String name, DeletedAppRestoreRequest restoreRequest, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - restoreFromDeletedAppWithResponseAsync(resourceGroupName, name, restoreRequest, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Restores a deleted web app to this web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param restoreRequest Deleted web app restore information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginRestoreFromDeletedApp( - String resourceGroupName, String name, DeletedAppRestoreRequest restoreRequest) { - return beginRestoreFromDeletedAppAsync(resourceGroupName, name, restoreRequest).getSyncPoller(); - } - - /** - * Restores a deleted web app to this web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param restoreRequest Deleted web app restore information. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginRestoreFromDeletedApp( - String resourceGroupName, String name, DeletedAppRestoreRequest restoreRequest, Context context) { - return beginRestoreFromDeletedAppAsync(resourceGroupName, name, restoreRequest, context).getSyncPoller(); - } - - /** - * Restores a deleted web app to this web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param restoreRequest Deleted web app restore information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono restoreFromDeletedAppAsync( - String resourceGroupName, String name, DeletedAppRestoreRequest restoreRequest) { - return beginRestoreFromDeletedAppAsync(resourceGroupName, name, restoreRequest) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Restores a deleted web app to this web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param restoreRequest Deleted web app restore information. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono restoreFromDeletedAppAsync( - String resourceGroupName, String name, DeletedAppRestoreRequest restoreRequest, Context context) { - return beginRestoreFromDeletedAppAsync(resourceGroupName, name, restoreRequest, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Restores a deleted web app to this web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param restoreRequest Deleted web app restore information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void restoreFromDeletedApp(String resourceGroupName, String name, DeletedAppRestoreRequest restoreRequest) { - restoreFromDeletedAppAsync(resourceGroupName, name, restoreRequest).block(); - } - - /** - * Restores a deleted web app to this web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param restoreRequest Deleted web app restore information. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void restoreFromDeletedApp( - String resourceGroupName, String name, DeletedAppRestoreRequest restoreRequest, Context context) { - restoreFromDeletedAppAsync(resourceGroupName, name, restoreRequest, context).block(); - } - - /** - * Restores a web app from a snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param restoreRequest Snapshot restore settings. Snapshot information can be obtained by calling GetDeletedSites - * or GetSiteSnapshots API. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> restoreSnapshotWithResponseAsync( - String resourceGroupName, String name, SnapshotRestoreRequest restoreRequest) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (restoreRequest == null) { - return Mono.error(new IllegalArgumentException("Parameter restoreRequest is required and cannot be null.")); - } else { - restoreRequest.validate(); - } - return FluxUtil - .withContext( - context -> - service - .restoreSnapshot( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - restoreRequest, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Restores a web app from a snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param restoreRequest Snapshot restore settings. Snapshot information can be obtained by calling GetDeletedSites - * or GetSiteSnapshots API. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> restoreSnapshotWithResponseAsync( - String resourceGroupName, String name, SnapshotRestoreRequest restoreRequest, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (restoreRequest == null) { - return Mono.error(new IllegalArgumentException("Parameter restoreRequest is required and cannot be null.")); - } else { - restoreRequest.validate(); - } - context = this.client.mergeContext(context); - return service - .restoreSnapshot( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - restoreRequest, - context); - } - - /** - * Restores a web app from a snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param restoreRequest Snapshot restore settings. Snapshot information can be obtained by calling GetDeletedSites - * or GetSiteSnapshots API. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginRestoreSnapshotAsync( - String resourceGroupName, String name, SnapshotRestoreRequest restoreRequest) { - Mono>> mono = - restoreSnapshotWithResponseAsync(resourceGroupName, name, restoreRequest); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Restores a web app from a snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param restoreRequest Snapshot restore settings. Snapshot information can be obtained by calling GetDeletedSites - * or GetSiteSnapshots API. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginRestoreSnapshotAsync( - String resourceGroupName, String name, SnapshotRestoreRequest restoreRequest, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - restoreSnapshotWithResponseAsync(resourceGroupName, name, restoreRequest, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Restores a web app from a snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param restoreRequest Snapshot restore settings. Snapshot information can be obtained by calling GetDeletedSites - * or GetSiteSnapshots API. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginRestoreSnapshot( - String resourceGroupName, String name, SnapshotRestoreRequest restoreRequest) { - return beginRestoreSnapshotAsync(resourceGroupName, name, restoreRequest).getSyncPoller(); - } - - /** - * Restores a web app from a snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param restoreRequest Snapshot restore settings. Snapshot information can be obtained by calling GetDeletedSites - * or GetSiteSnapshots API. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginRestoreSnapshot( - String resourceGroupName, String name, SnapshotRestoreRequest restoreRequest, Context context) { - return beginRestoreSnapshotAsync(resourceGroupName, name, restoreRequest, context).getSyncPoller(); - } - - /** - * Restores a web app from a snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param restoreRequest Snapshot restore settings. Snapshot information can be obtained by calling GetDeletedSites - * or GetSiteSnapshots API. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono restoreSnapshotAsync( - String resourceGroupName, String name, SnapshotRestoreRequest restoreRequest) { - return beginRestoreSnapshotAsync(resourceGroupName, name, restoreRequest) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Restores a web app from a snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param restoreRequest Snapshot restore settings. Snapshot information can be obtained by calling GetDeletedSites - * or GetSiteSnapshots API. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono restoreSnapshotAsync( - String resourceGroupName, String name, SnapshotRestoreRequest restoreRequest, Context context) { - return beginRestoreSnapshotAsync(resourceGroupName, name, restoreRequest, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Restores a web app from a snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param restoreRequest Snapshot restore settings. Snapshot information can be obtained by calling GetDeletedSites - * or GetSiteSnapshots API. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void restoreSnapshot(String resourceGroupName, String name, SnapshotRestoreRequest restoreRequest) { - restoreSnapshotAsync(resourceGroupName, name, restoreRequest).block(); - } - - /** - * Restores a web app from a snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param restoreRequest Snapshot restore settings. Snapshot information can be obtained by calling GetDeletedSites - * or GetSiteSnapshots API. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void restoreSnapshot( - String resourceGroupName, String name, SnapshotRestoreRequest restoreRequest, Context context) { - restoreSnapshotAsync(resourceGroupName, name, restoreRequest, context).block(); - } - - /** - * Get list of siteextensions for a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of siteextensions for a web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSiteExtensionsSinglePageAsync( - String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listSiteExtensions( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get list of siteextensions for a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of siteextensions for a web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSiteExtensionsSinglePageAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listSiteExtensions( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get list of siteextensions for a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of siteextensions for a web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listSiteExtensionsAsync(String resourceGroupName, String name) { - return new PagedFlux<>( - () -> listSiteExtensionsSinglePageAsync(resourceGroupName, name), - nextLink -> listSiteExtensionsNextSinglePageAsync(nextLink)); - } - - /** - * Get list of siteextensions for a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of siteextensions for a web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listSiteExtensionsAsync( - String resourceGroupName, String name, Context context) { - return new PagedFlux<>( - () -> listSiteExtensionsSinglePageAsync(resourceGroupName, name, context), - nextLink -> listSiteExtensionsNextSinglePageAsync(nextLink, context)); - } - - /** - * Get list of siteextensions for a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of siteextensions for a web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listSiteExtensions(String resourceGroupName, String name) { - return new PagedIterable<>(listSiteExtensionsAsync(resourceGroupName, name)); - } - - /** - * Get list of siteextensions for a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of siteextensions for a web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listSiteExtensions( - String resourceGroupName, String name, Context context) { - return new PagedIterable<>(listSiteExtensionsAsync(resourceGroupName, name, context)); - } - - /** - * Get site extension information by its ID for a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site extension information by its ID for a web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getSiteExtensionWithResponseAsync( - String resourceGroupName, String name, String siteExtensionId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (siteExtensionId == null) { - return Mono - .error(new IllegalArgumentException("Parameter siteExtensionId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getSiteExtension( - this.client.getEndpoint(), - resourceGroupName, - name, - siteExtensionId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get site extension information by its ID for a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site extension information by its ID for a web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getSiteExtensionWithResponseAsync( - String resourceGroupName, String name, String siteExtensionId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (siteExtensionId == null) { - return Mono - .error(new IllegalArgumentException("Parameter siteExtensionId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getSiteExtension( - this.client.getEndpoint(), - resourceGroupName, - name, - siteExtensionId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Get site extension information by its ID for a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site extension information by its ID for a web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getSiteExtensionAsync( - String resourceGroupName, String name, String siteExtensionId) { - return getSiteExtensionWithResponseAsync(resourceGroupName, name, siteExtensionId) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get site extension information by its ID for a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site extension information by its ID for a web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SiteExtensionInfoInner getSiteExtension(String resourceGroupName, String name, String siteExtensionId) { - return getSiteExtensionAsync(resourceGroupName, name, siteExtensionId).block(); - } - - /** - * Get site extension information by its ID for a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site extension information by its ID for a web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getSiteExtensionWithResponse( - String resourceGroupName, String name, String siteExtensionId, Context context) { - return getSiteExtensionWithResponseAsync(resourceGroupName, name, siteExtensionId, context).block(); - } - - /** - * Install site extension on a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Extension Information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> installSiteExtensionWithResponseAsync( - String resourceGroupName, String name, String siteExtensionId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (siteExtensionId == null) { - return Mono - .error(new IllegalArgumentException("Parameter siteExtensionId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .installSiteExtension( - this.client.getEndpoint(), - resourceGroupName, - name, - siteExtensionId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Install site extension on a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Extension Information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> installSiteExtensionWithResponseAsync( - String resourceGroupName, String name, String siteExtensionId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (siteExtensionId == null) { - return Mono - .error(new IllegalArgumentException("Parameter siteExtensionId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .installSiteExtension( - this.client.getEndpoint(), - resourceGroupName, - name, - siteExtensionId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Install site extension on a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Extension Information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, SiteExtensionInfoInner> beginInstallSiteExtensionAsync( - String resourceGroupName, String name, String siteExtensionId) { - Mono>> mono = - installSiteExtensionWithResponseAsync(resourceGroupName, name, siteExtensionId); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - SiteExtensionInfoInner.class, - SiteExtensionInfoInner.class, - Context.NONE); - } - - /** - * Install site extension on a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Extension Information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, SiteExtensionInfoInner> beginInstallSiteExtensionAsync( - String resourceGroupName, String name, String siteExtensionId, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - installSiteExtensionWithResponseAsync(resourceGroupName, name, siteExtensionId, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - SiteExtensionInfoInner.class, - SiteExtensionInfoInner.class, - context); - } - - /** - * Install site extension on a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Extension Information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, SiteExtensionInfoInner> beginInstallSiteExtension( - String resourceGroupName, String name, String siteExtensionId) { - return beginInstallSiteExtensionAsync(resourceGroupName, name, siteExtensionId).getSyncPoller(); - } - - /** - * Install site extension on a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Extension Information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, SiteExtensionInfoInner> beginInstallSiteExtension( - String resourceGroupName, String name, String siteExtensionId, Context context) { - return beginInstallSiteExtensionAsync(resourceGroupName, name, siteExtensionId, context).getSyncPoller(); - } - - /** - * Install site extension on a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Extension Information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono installSiteExtensionAsync( - String resourceGroupName, String name, String siteExtensionId) { - return beginInstallSiteExtensionAsync(resourceGroupName, name, siteExtensionId) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Install site extension on a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Extension Information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono installSiteExtensionAsync( - String resourceGroupName, String name, String siteExtensionId, Context context) { - return beginInstallSiteExtensionAsync(resourceGroupName, name, siteExtensionId, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Install site extension on a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Extension Information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SiteExtensionInfoInner installSiteExtension(String resourceGroupName, String name, String siteExtensionId) { - return installSiteExtensionAsync(resourceGroupName, name, siteExtensionId).block(); - } - - /** - * Install site extension on a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Extension Information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SiteExtensionInfoInner installSiteExtension( - String resourceGroupName, String name, String siteExtensionId, Context context) { - return installSiteExtensionAsync(resourceGroupName, name, siteExtensionId, context).block(); - } - - /** - * Remove a site extension from a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteSiteExtensionWithResponseAsync( - String resourceGroupName, String name, String siteExtensionId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (siteExtensionId == null) { - return Mono - .error(new IllegalArgumentException("Parameter siteExtensionId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .deleteSiteExtension( - this.client.getEndpoint(), - resourceGroupName, - name, - siteExtensionId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Remove a site extension from a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteSiteExtensionWithResponseAsync( - String resourceGroupName, String name, String siteExtensionId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (siteExtensionId == null) { - return Mono - .error(new IllegalArgumentException("Parameter siteExtensionId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .deleteSiteExtension( - this.client.getEndpoint(), - resourceGroupName, - name, - siteExtensionId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Remove a site extension from a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteSiteExtensionAsync(String resourceGroupName, String name, String siteExtensionId) { - return deleteSiteExtensionWithResponseAsync(resourceGroupName, name, siteExtensionId) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Remove a site extension from a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteSiteExtension(String resourceGroupName, String name, String siteExtensionId) { - deleteSiteExtensionAsync(resourceGroupName, name, siteExtensionId).block(); - } - - /** - * Remove a site extension from a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteSiteExtensionWithResponse( - String resourceGroupName, String name, String siteExtensionId, Context context) { - return deleteSiteExtensionWithResponseAsync(resourceGroupName, name, siteExtensionId, context).block(); - } - - /** - * Gets an app's deployment slots. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an app's deployment slots. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSlotsSinglePageAsync(String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listSlots( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets an app's deployment slots. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an app's deployment slots. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSlotsSinglePageAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listSlots( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets an app's deployment slots. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an app's deployment slots. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listSlotsAsync(String resourceGroupName, String name) { - return new PagedFlux<>( - () -> listSlotsSinglePageAsync(resourceGroupName, name), - nextLink -> listSlotsNextSinglePageAsync(nextLink)); - } - - /** - * Gets an app's deployment slots. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an app's deployment slots. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listSlotsAsync(String resourceGroupName, String name, Context context) { - return new PagedFlux<>( - () -> listSlotsSinglePageAsync(resourceGroupName, name, context), - nextLink -> listSlotsNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets an app's deployment slots. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an app's deployment slots. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listSlots(String resourceGroupName, String name) { - return new PagedIterable<>(listSlotsAsync(resourceGroupName, name)); - } - - /** - * Gets an app's deployment slots. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an app's deployment slots. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listSlots(String resourceGroupName, String name, Context context) { - return new PagedIterable<>(listSlotsAsync(resourceGroupName, name, context)); - } - - /** - * Gets the details of a web, mobile, or API app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. By default, this API returns the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of a web, mobile, or API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getSlotWithResponseAsync(String resourceGroupName, String name, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the details of a web, mobile, or API app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. By default, this API returns the production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of a web, mobile, or API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getSlotWithResponseAsync( - String resourceGroupName, String name, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets the details of a web, mobile, or API app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. By default, this API returns the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of a web, mobile, or API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getSlotAsync(String resourceGroupName, String name, String slot) { - return getSlotWithResponseAsync(resourceGroupName, name, slot) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the details of a web, mobile, or API app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. By default, this API returns the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of a web, mobile, or API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SiteInner getSlot(String resourceGroupName, String name, String slot) { - return getSlotAsync(resourceGroupName, name, slot).block(); - } - - /** - * Gets the details of a web, mobile, or API app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. By default, this API returns the production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of a web, mobile, or API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getSlotWithResponse( - String resourceGroupName, String name, String slot, Context context) { - return getSlotWithResponseAsync(resourceGroupName, name, slot, context).block(); - } - - /** - * Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} - * parameter. - * @param slot Name of the deployment slot to create or update. By default, this API attempts to create or modify - * the production slot. - * @param siteEnvelope A JSON representation of the app properties. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a web app, a mobile app backend, or an API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateSlotWithResponseAsync( - String resourceGroupName, String name, String slot, SiteInner siteEnvelope) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (siteEnvelope == null) { - return Mono.error(new IllegalArgumentException("Parameter siteEnvelope is required and cannot be null.")); - } else { - siteEnvelope.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdateSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - siteEnvelope, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} - * parameter. - * @param slot Name of the deployment slot to create or update. By default, this API attempts to create or modify - * the production slot. - * @param siteEnvelope A JSON representation of the app properties. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a web app, a mobile app backend, or an API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateSlotWithResponseAsync( - String resourceGroupName, String name, String slot, SiteInner siteEnvelope, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (siteEnvelope == null) { - return Mono.error(new IllegalArgumentException("Parameter siteEnvelope is required and cannot be null.")); - } else { - siteEnvelope.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdateSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - siteEnvelope, - accept, - context); - } - - /** - * Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} - * parameter. - * @param slot Name of the deployment slot to create or update. By default, this API attempts to create or modify - * the production slot. - * @param siteEnvelope A JSON representation of the app properties. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a web app, a mobile app backend, or an API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, SiteInner> beginCreateOrUpdateSlotAsync( - String resourceGroupName, String name, String slot, SiteInner siteEnvelope) { - Mono>> mono = - createOrUpdateSlotWithResponseAsync(resourceGroupName, name, slot, siteEnvelope); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), SiteInner.class, SiteInner.class, this.client.getContext()); - } - - /** - * Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} - * parameter. - * @param slot Name of the deployment slot to create or update. By default, this API attempts to create or modify - * the production slot. - * @param siteEnvelope A JSON representation of the app properties. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a web app, a mobile app backend, or an API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, SiteInner> beginCreateOrUpdateSlotAsync( - String resourceGroupName, String name, String slot, SiteInner siteEnvelope, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateSlotWithResponseAsync(resourceGroupName, name, slot, siteEnvelope, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), SiteInner.class, SiteInner.class, context); - } - - /** - * Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} - * parameter. - * @param slot Name of the deployment slot to create or update. By default, this API attempts to create or modify - * the production slot. - * @param siteEnvelope A JSON representation of the app properties. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a web app, a mobile app backend, or an API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, SiteInner> beginCreateOrUpdateSlot( - String resourceGroupName, String name, String slot, SiteInner siteEnvelope) { - return beginCreateOrUpdateSlotAsync(resourceGroupName, name, slot, siteEnvelope).getSyncPoller(); - } - - /** - * Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} - * parameter. - * @param slot Name of the deployment slot to create or update. By default, this API attempts to create or modify - * the production slot. - * @param siteEnvelope A JSON representation of the app properties. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a web app, a mobile app backend, or an API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, SiteInner> beginCreateOrUpdateSlot( - String resourceGroupName, String name, String slot, SiteInner siteEnvelope, Context context) { - return beginCreateOrUpdateSlotAsync(resourceGroupName, name, slot, siteEnvelope, context).getSyncPoller(); - } - - /** - * Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} - * parameter. - * @param slot Name of the deployment slot to create or update. By default, this API attempts to create or modify - * the production slot. - * @param siteEnvelope A JSON representation of the app properties. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a web app, a mobile app backend, or an API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateSlotAsync( - String resourceGroupName, String name, String slot, SiteInner siteEnvelope) { - return beginCreateOrUpdateSlotAsync(resourceGroupName, name, slot, siteEnvelope) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} - * parameter. - * @param slot Name of the deployment slot to create or update. By default, this API attempts to create or modify - * the production slot. - * @param siteEnvelope A JSON representation of the app properties. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a web app, a mobile app backend, or an API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateSlotAsync( - String resourceGroupName, String name, String slot, SiteInner siteEnvelope, Context context) { - return beginCreateOrUpdateSlotAsync(resourceGroupName, name, slot, siteEnvelope, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} - * parameter. - * @param slot Name of the deployment slot to create or update. By default, this API attempts to create or modify - * the production slot. - * @param siteEnvelope A JSON representation of the app properties. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a web app, a mobile app backend, or an API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SiteInner createOrUpdateSlot(String resourceGroupName, String name, String slot, SiteInner siteEnvelope) { - return createOrUpdateSlotAsync(resourceGroupName, name, slot, siteEnvelope).block(); - } - - /** - * Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} - * parameter. - * @param slot Name of the deployment slot to create or update. By default, this API attempts to create or modify - * the production slot. - * @param siteEnvelope A JSON representation of the app properties. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a web app, a mobile app backend, or an API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SiteInner createOrUpdateSlot( - String resourceGroupName, String name, String slot, SiteInner siteEnvelope, Context context) { - return createOrUpdateSlotAsync(resourceGroupName, name, slot, siteEnvelope, context).block(); - } - - /** - * Deletes a web, mobile, or API app, or one of the deployment slots. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app to delete. - * @param slot Name of the deployment slot to delete. By default, the API deletes the production slot. - * @param deleteMetrics If true, web app metrics are also deleted. - * @param deleteEmptyServerFarm Specify true if the App Service plan will be empty after app deletion and you want - * to delete the empty App Service plan. By default, the empty App Service plan is not deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteSlotWithResponseAsync( - String resourceGroupName, String name, String slot, Boolean deleteMetrics, Boolean deleteEmptyServerFarm) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .deleteSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - deleteMetrics, - deleteEmptyServerFarm, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a web, mobile, or API app, or one of the deployment slots. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app to delete. - * @param slot Name of the deployment slot to delete. By default, the API deletes the production slot. - * @param deleteMetrics If true, web app metrics are also deleted. - * @param deleteEmptyServerFarm Specify true if the App Service plan will be empty after app deletion and you want - * to delete the empty App Service plan. By default, the empty App Service plan is not deleted. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteSlotWithResponseAsync( - String resourceGroupName, - String name, - String slot, - Boolean deleteMetrics, - Boolean deleteEmptyServerFarm, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .deleteSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - deleteMetrics, - deleteEmptyServerFarm, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Deletes a web, mobile, or API app, or one of the deployment slots. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app to delete. - * @param slot Name of the deployment slot to delete. By default, the API deletes the production slot. - * @param deleteMetrics If true, web app metrics are also deleted. - * @param deleteEmptyServerFarm Specify true if the App Service plan will be empty after app deletion and you want - * to delete the empty App Service plan. By default, the empty App Service plan is not deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteSlotAsync( - String resourceGroupName, String name, String slot, Boolean deleteMetrics, Boolean deleteEmptyServerFarm) { - return deleteSlotWithResponseAsync(resourceGroupName, name, slot, deleteMetrics, deleteEmptyServerFarm) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes a web, mobile, or API app, or one of the deployment slots. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app to delete. - * @param slot Name of the deployment slot to delete. By default, the API deletes the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteSlotAsync(String resourceGroupName, String name, String slot) { - final Boolean deleteMetrics = null; - final Boolean deleteEmptyServerFarm = null; - return deleteSlotWithResponseAsync(resourceGroupName, name, slot, deleteMetrics, deleteEmptyServerFarm) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes a web, mobile, or API app, or one of the deployment slots. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app to delete. - * @param slot Name of the deployment slot to delete. By default, the API deletes the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteSlot(String resourceGroupName, String name, String slot) { - final Boolean deleteMetrics = null; - final Boolean deleteEmptyServerFarm = null; - deleteSlotAsync(resourceGroupName, name, slot, deleteMetrics, deleteEmptyServerFarm).block(); - } - - /** - * Deletes a web, mobile, or API app, or one of the deployment slots. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app to delete. - * @param slot Name of the deployment slot to delete. By default, the API deletes the production slot. - * @param deleteMetrics If true, web app metrics are also deleted. - * @param deleteEmptyServerFarm Specify true if the App Service plan will be empty after app deletion and you want - * to delete the empty App Service plan. By default, the empty App Service plan is not deleted. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteSlotWithResponse( - String resourceGroupName, - String name, - String slot, - Boolean deleteMetrics, - Boolean deleteEmptyServerFarm, - Context context) { - return deleteSlotWithResponseAsync(resourceGroupName, name, slot, deleteMetrics, deleteEmptyServerFarm, context) - .block(); - } - - /** - * Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} - * parameter. - * @param slot Name of the deployment slot to create or update. By default, this API attempts to create or modify - * the production slot. - * @param siteEnvelope A JSON representation of the app properties. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a web app, a mobile app backend, or an API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateSlotWithResponseAsync( - String resourceGroupName, String name, String slot, SitePatchResourceInner siteEnvelope) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (siteEnvelope == null) { - return Mono.error(new IllegalArgumentException("Parameter siteEnvelope is required and cannot be null.")); - } else { - siteEnvelope.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updateSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - siteEnvelope, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} - * parameter. - * @param slot Name of the deployment slot to create or update. By default, this API attempts to create or modify - * the production slot. - * @param siteEnvelope A JSON representation of the app properties. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a web app, a mobile app backend, or an API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateSlotWithResponseAsync( - String resourceGroupName, String name, String slot, SitePatchResourceInner siteEnvelope, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (siteEnvelope == null) { - return Mono.error(new IllegalArgumentException("Parameter siteEnvelope is required and cannot be null.")); - } else { - siteEnvelope.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updateSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - siteEnvelope, - accept, - context); - } - - /** - * Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} - * parameter. - * @param slot Name of the deployment slot to create or update. By default, this API attempts to create or modify - * the production slot. - * @param siteEnvelope A JSON representation of the app properties. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a web app, a mobile app backend, or an API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateSlotAsync( - String resourceGroupName, String name, String slot, SitePatchResourceInner siteEnvelope) { - return updateSlotWithResponseAsync(resourceGroupName, name, slot, siteEnvelope) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} - * parameter. - * @param slot Name of the deployment slot to create or update. By default, this API attempts to create or modify - * the production slot. - * @param siteEnvelope A JSON representation of the app properties. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a web app, a mobile app backend, or an API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SiteInner updateSlot( - String resourceGroupName, String name, String slot, SitePatchResourceInner siteEnvelope) { - return updateSlotAsync(resourceGroupName, name, slot, siteEnvelope).block(); - } - - /** - * Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} - * parameter. - * @param slot Name of the deployment slot to create or update. By default, this API attempts to create or modify - * the production slot. - * @param siteEnvelope A JSON representation of the app properties. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a web app, a mobile app backend, or an API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateSlotWithResponse( - String resourceGroupName, String name, String slot, SitePatchResourceInner siteEnvelope, Context context) { - return updateSlotWithResponseAsync(resourceGroupName, name, slot, siteEnvelope, context).block(); - } - - /** - * Analyze a custom hostname. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param hostname Custom hostname. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return custom domain analysis. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> analyzeCustomHostnameSlotWithResponseAsync( - String resourceGroupName, String name, String slot, String hostname) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .analyzeCustomHostnameSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - hostname, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Analyze a custom hostname. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param hostname Custom hostname. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return custom domain analysis. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> analyzeCustomHostnameSlotWithResponseAsync( - String resourceGroupName, String name, String slot, String hostname, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .analyzeCustomHostnameSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - hostname, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Analyze a custom hostname. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param hostname Custom hostname. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return custom domain analysis. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono analyzeCustomHostnameSlotAsync( - String resourceGroupName, String name, String slot, String hostname) { - return analyzeCustomHostnameSlotWithResponseAsync(resourceGroupName, name, slot, hostname) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Analyze a custom hostname. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return custom domain analysis. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono analyzeCustomHostnameSlotAsync( - String resourceGroupName, String name, String slot) { - final String hostname = null; - return analyzeCustomHostnameSlotWithResponseAsync(resourceGroupName, name, slot, hostname) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Analyze a custom hostname. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return custom domain analysis. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CustomHostnameAnalysisResultInner analyzeCustomHostnameSlot( - String resourceGroupName, String name, String slot) { - final String hostname = null; - return analyzeCustomHostnameSlotAsync(resourceGroupName, name, slot, hostname).block(); - } - - /** - * Analyze a custom hostname. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param hostname Custom hostname. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return custom domain analysis. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response analyzeCustomHostnameSlotWithResponse( - String resourceGroupName, String name, String slot, String hostname, Context context) { - return analyzeCustomHostnameSlotWithResponseAsync(resourceGroupName, name, slot, hostname, context).block(); - } - - /** - * Applies the configuration settings from the target slot onto the current slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the source slot. If a slot is not specified, the production slot is used as the source slot. - * @param slotSwapEntity JSON object that contains the target slot name. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> applySlotConfigurationSlotWithResponseAsync( - String resourceGroupName, String name, String slot, CsmSlotEntity slotSwapEntity) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (slotSwapEntity == null) { - return Mono.error(new IllegalArgumentException("Parameter slotSwapEntity is required and cannot be null.")); - } else { - slotSwapEntity.validate(); - } - return FluxUtil - .withContext( - context -> - service - .applySlotConfigurationSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - slotSwapEntity, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Applies the configuration settings from the target slot onto the current slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the source slot. If a slot is not specified, the production slot is used as the source slot. - * @param slotSwapEntity JSON object that contains the target slot name. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> applySlotConfigurationSlotWithResponseAsync( - String resourceGroupName, String name, String slot, CsmSlotEntity slotSwapEntity, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (slotSwapEntity == null) { - return Mono.error(new IllegalArgumentException("Parameter slotSwapEntity is required and cannot be null.")); - } else { - slotSwapEntity.validate(); - } - context = this.client.mergeContext(context); - return service - .applySlotConfigurationSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - slotSwapEntity, - context); - } - - /** - * Applies the configuration settings from the target slot onto the current slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the source slot. If a slot is not specified, the production slot is used as the source slot. - * @param slotSwapEntity JSON object that contains the target slot name. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono applySlotConfigurationSlotAsync( - String resourceGroupName, String name, String slot, CsmSlotEntity slotSwapEntity) { - return applySlotConfigurationSlotWithResponseAsync(resourceGroupName, name, slot, slotSwapEntity) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Applies the configuration settings from the target slot onto the current slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the source slot. If a slot is not specified, the production slot is used as the source slot. - * @param slotSwapEntity JSON object that contains the target slot name. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void applySlotConfigurationSlot( - String resourceGroupName, String name, String slot, CsmSlotEntity slotSwapEntity) { - applySlotConfigurationSlotAsync(resourceGroupName, name, slot, slotSwapEntity).block(); - } - - /** - * Applies the configuration settings from the target slot onto the current slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the source slot. If a slot is not specified, the production slot is used as the source slot. - * @param slotSwapEntity JSON object that contains the target slot name. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response applySlotConfigurationSlotWithResponse( - String resourceGroupName, String name, String slot, CsmSlotEntity slotSwapEntity, Context context) { - return applySlotConfigurationSlotWithResponseAsync(resourceGroupName, name, slot, slotSwapEntity, context) - .block(); - } - - /** - * Creates a backup of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will create a backup for the - * production slot. - * @param request Backup configuration. You can use the JSON response from the POST action as input here. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup description. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> backupSlotWithResponseAsync( - String resourceGroupName, String name, String slot, BackupRequestInner request) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (request == null) { - return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); - } else { - request.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .backupSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - request, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates a backup of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will create a backup for the - * production slot. - * @param request Backup configuration. You can use the JSON response from the POST action as input here. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup description. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> backupSlotWithResponseAsync( - String resourceGroupName, String name, String slot, BackupRequestInner request, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (request == null) { - return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); - } else { - request.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .backupSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - request, - accept, - context); - } - - /** - * Creates a backup of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will create a backup for the - * production slot. - * @param request Backup configuration. You can use the JSON response from the POST action as input here. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup description. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono backupSlotAsync( - String resourceGroupName, String name, String slot, BackupRequestInner request) { - return backupSlotWithResponseAsync(resourceGroupName, name, slot, request) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates a backup of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will create a backup for the - * production slot. - * @param request Backup configuration. You can use the JSON response from the POST action as input here. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup description. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BackupItemInner backupSlot(String resourceGroupName, String name, String slot, BackupRequestInner request) { - return backupSlotAsync(resourceGroupName, name, slot, request).block(); - } - - /** - * Creates a backup of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will create a backup for the - * production slot. - * @param request Backup configuration. You can use the JSON response from the POST action as input here. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup description. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response backupSlotWithResponse( - String resourceGroupName, String name, String slot, BackupRequestInner request, Context context) { - return backupSlotWithResponseAsync(resourceGroupName, name, slot, request, context).block(); - } - - /** - * Gets existing backups of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get backups of the production - * slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return existing backups of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBackupsSlotSinglePageAsync( - String resourceGroupName, String name, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listBackupsSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets existing backups of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get backups of the production - * slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return existing backups of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBackupsSlotSinglePageAsync( - String resourceGroupName, String name, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listBackupsSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets existing backups of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get backups of the production - * slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return existing backups of an app. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listBackupsSlotAsync(String resourceGroupName, String name, String slot) { - return new PagedFlux<>( - () -> listBackupsSlotSinglePageAsync(resourceGroupName, name, slot), - nextLink -> listBackupsSlotNextSinglePageAsync(nextLink)); - } - - /** - * Gets existing backups of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get backups of the production - * slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return existing backups of an app. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listBackupsSlotAsync( - String resourceGroupName, String name, String slot, Context context) { - return new PagedFlux<>( - () -> listBackupsSlotSinglePageAsync(resourceGroupName, name, slot, context), - nextLink -> listBackupsSlotNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets existing backups of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get backups of the production - * slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return existing backups of an app. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listBackupsSlot(String resourceGroupName, String name, String slot) { - return new PagedIterable<>(listBackupsSlotAsync(resourceGroupName, name, slot)); - } - - /** - * Gets existing backups of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get backups of the production - * slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return existing backups of an app. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listBackupsSlot( - String resourceGroupName, String name, String slot, Context context) { - return new PagedIterable<>(listBackupsSlotAsync(resourceGroupName, name, slot, context)); - } - - /** - * Gets a backup of an app by its ID. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get a backup of the production - * slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a backup of an app by its ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getBackupStatusSlotWithResponseAsync( - String resourceGroupName, String name, String backupId, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (backupId == null) { - return Mono.error(new IllegalArgumentException("Parameter backupId is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getBackupStatusSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - backupId, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a backup of an app by its ID. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get a backup of the production - * slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a backup of an app by its ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getBackupStatusSlotWithResponseAsync( - String resourceGroupName, String name, String backupId, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (backupId == null) { - return Mono.error(new IllegalArgumentException("Parameter backupId is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getBackupStatusSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - backupId, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets a backup of an app by its ID. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get a backup of the production - * slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a backup of an app by its ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getBackupStatusSlotAsync( - String resourceGroupName, String name, String backupId, String slot) { - return getBackupStatusSlotWithResponseAsync(resourceGroupName, name, backupId, slot) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a backup of an app by its ID. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get a backup of the production - * slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a backup of an app by its ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BackupItemInner getBackupStatusSlot(String resourceGroupName, String name, String backupId, String slot) { - return getBackupStatusSlotAsync(resourceGroupName, name, backupId, slot).block(); - } - - /** - * Gets a backup of an app by its ID. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get a backup of the production - * slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a backup of an app by its ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getBackupStatusSlotWithResponse( - String resourceGroupName, String name, String backupId, String slot, Context context) { - return getBackupStatusSlotWithResponseAsync(resourceGroupName, name, backupId, slot, context).block(); - } - - /** - * Deletes a backup of an app by its ID. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete a backup of the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteBackupSlotWithResponseAsync( - String resourceGroupName, String name, String backupId, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (backupId == null) { - return Mono.error(new IllegalArgumentException("Parameter backupId is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .deleteBackupSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - backupId, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a backup of an app by its ID. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete a backup of the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteBackupSlotWithResponseAsync( - String resourceGroupName, String name, String backupId, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (backupId == null) { - return Mono.error(new IllegalArgumentException("Parameter backupId is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .deleteBackupSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - backupId, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Deletes a backup of an app by its ID. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete a backup of the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteBackupSlotAsync(String resourceGroupName, String name, String backupId, String slot) { - return deleteBackupSlotWithResponseAsync(resourceGroupName, name, backupId, slot) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes a backup of an app by its ID. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete a backup of the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteBackupSlot(String resourceGroupName, String name, String backupId, String slot) { - deleteBackupSlotAsync(resourceGroupName, name, backupId, slot).block(); - } - - /** - * Deletes a backup of an app by its ID. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete a backup of the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteBackupSlotWithResponse( - String resourceGroupName, String name, String backupId, String slot, Context context) { - return deleteBackupSlotWithResponseAsync(resourceGroupName, name, backupId, slot, context).block(); - } - - /** - * Gets status of a web app backup that may be in progress, including secrets associated with the backup, such as - * the Azure Storage SAS URL. Also can be used to update the SAS URL for the backup if a new URL is passed in the - * request body. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param backupId ID of backup. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param request Information on backup request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return status of a web app backup that may be in progress, including secrets associated with the backup, such as - * the Azure Storage SAS URL. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listBackupStatusSecretsSlotWithResponseAsync( - String resourceGroupName, String name, String backupId, String slot, BackupRequestInner request) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (backupId == null) { - return Mono.error(new IllegalArgumentException("Parameter backupId is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (request == null) { - return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); - } else { - request.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listBackupStatusSecretsSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - backupId, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - request, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets status of a web app backup that may be in progress, including secrets associated with the backup, such as - * the Azure Storage SAS URL. Also can be used to update the SAS URL for the backup if a new URL is passed in the - * request body. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param backupId ID of backup. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param request Information on backup request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return status of a web app backup that may be in progress, including secrets associated with the backup, such as - * the Azure Storage SAS URL. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBackupStatusSecretsSlotWithResponseAsync( - String resourceGroupName, - String name, - String backupId, - String slot, - BackupRequestInner request, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (backupId == null) { - return Mono.error(new IllegalArgumentException("Parameter backupId is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (request == null) { - return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); - } else { - request.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listBackupStatusSecretsSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - backupId, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - request, - accept, - context); - } - - /** - * Gets status of a web app backup that may be in progress, including secrets associated with the backup, such as - * the Azure Storage SAS URL. Also can be used to update the SAS URL for the backup if a new URL is passed in the - * request body. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param backupId ID of backup. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param request Information on backup request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return status of a web app backup that may be in progress, including secrets associated with the backup, such as - * the Azure Storage SAS URL. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listBackupStatusSecretsSlotAsync( - String resourceGroupName, String name, String backupId, String slot, BackupRequestInner request) { - return listBackupStatusSecretsSlotWithResponseAsync(resourceGroupName, name, backupId, slot, request) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets status of a web app backup that may be in progress, including secrets associated with the backup, such as - * the Azure Storage SAS URL. Also can be used to update the SAS URL for the backup if a new URL is passed in the - * request body. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param backupId ID of backup. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param request Information on backup request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return status of a web app backup that may be in progress, including secrets associated with the backup, such as - * the Azure Storage SAS URL. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BackupItemInner listBackupStatusSecretsSlot( - String resourceGroupName, String name, String backupId, String slot, BackupRequestInner request) { - return listBackupStatusSecretsSlotAsync(resourceGroupName, name, backupId, slot, request).block(); - } - - /** - * Gets status of a web app backup that may be in progress, including secrets associated with the backup, such as - * the Azure Storage SAS URL. Also can be used to update the SAS URL for the backup if a new URL is passed in the - * request body. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param backupId ID of backup. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param request Information on backup request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return status of a web app backup that may be in progress, including secrets associated with the backup, such as - * the Azure Storage SAS URL. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listBackupStatusSecretsSlotWithResponse( - String resourceGroupName, - String name, - String backupId, - String slot, - BackupRequestInner request, - Context context) { - return listBackupStatusSecretsSlotWithResponseAsync(resourceGroupName, name, backupId, slot, request, context) - .block(); - } - - /** - * Restores a specific backup to another app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param slot Name of the deployment slot. If a slot is not specified, the API will restore a backup of the - * production slot. - * @param request Information on restore request . - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> restoreSlotWithResponseAsync( - String resourceGroupName, String name, String backupId, String slot, RestoreRequestInner request) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (backupId == null) { - return Mono.error(new IllegalArgumentException("Parameter backupId is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (request == null) { - return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); - } else { - request.validate(); - } - return FluxUtil - .withContext( - context -> - service - .restoreSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - backupId, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - request, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Restores a specific backup to another app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param slot Name of the deployment slot. If a slot is not specified, the API will restore a backup of the - * production slot. - * @param request Information on restore request . - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> restoreSlotWithResponseAsync( - String resourceGroupName, - String name, - String backupId, - String slot, - RestoreRequestInner request, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (backupId == null) { - return Mono.error(new IllegalArgumentException("Parameter backupId is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (request == null) { - return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); - } else { - request.validate(); - } - context = this.client.mergeContext(context); - return service - .restoreSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - backupId, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - request, - context); - } - - /** - * Restores a specific backup to another app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param slot Name of the deployment slot. If a slot is not specified, the API will restore a backup of the - * production slot. - * @param request Information on restore request . - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginRestoreSlotAsync( - String resourceGroupName, String name, String backupId, String slot, RestoreRequestInner request) { - Mono>> mono = - restoreSlotWithResponseAsync(resourceGroupName, name, backupId, slot, request); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Restores a specific backup to another app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param slot Name of the deployment slot. If a slot is not specified, the API will restore a backup of the - * production slot. - * @param request Information on restore request . - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginRestoreSlotAsync( - String resourceGroupName, - String name, - String backupId, - String slot, - RestoreRequestInner request, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - restoreSlotWithResponseAsync(resourceGroupName, name, backupId, slot, request, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Restores a specific backup to another app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param slot Name of the deployment slot. If a slot is not specified, the API will restore a backup of the - * production slot. - * @param request Information on restore request . - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginRestoreSlot( - String resourceGroupName, String name, String backupId, String slot, RestoreRequestInner request) { - return beginRestoreSlotAsync(resourceGroupName, name, backupId, slot, request).getSyncPoller(); - } - - /** - * Restores a specific backup to another app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param slot Name of the deployment slot. If a slot is not specified, the API will restore a backup of the - * production slot. - * @param request Information on restore request . - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginRestoreSlot( - String resourceGroupName, - String name, - String backupId, - String slot, - RestoreRequestInner request, - Context context) { - return beginRestoreSlotAsync(resourceGroupName, name, backupId, slot, request, context).getSyncPoller(); - } - - /** - * Restores a specific backup to another app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param slot Name of the deployment slot. If a slot is not specified, the API will restore a backup of the - * production slot. - * @param request Information on restore request . - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono restoreSlotAsync( - String resourceGroupName, String name, String backupId, String slot, RestoreRequestInner request) { - return beginRestoreSlotAsync(resourceGroupName, name, backupId, slot, request) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Restores a specific backup to another app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param slot Name of the deployment slot. If a slot is not specified, the API will restore a backup of the - * production slot. - * @param request Information on restore request . - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono restoreSlotAsync( - String resourceGroupName, - String name, - String backupId, - String slot, - RestoreRequestInner request, - Context context) { - return beginRestoreSlotAsync(resourceGroupName, name, backupId, slot, request, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Restores a specific backup to another app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param slot Name of the deployment slot. If a slot is not specified, the API will restore a backup of the - * production slot. - * @param request Information on restore request . - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void restoreSlot( - String resourceGroupName, String name, String backupId, String slot, RestoreRequestInner request) { - restoreSlotAsync(resourceGroupName, name, backupId, slot, request).block(); - } - - /** - * Restores a specific backup to another app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param slot Name of the deployment slot. If a slot is not specified, the API will restore a backup of the - * production slot. - * @param request Information on restore request . - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void restoreSlot( - String resourceGroupName, - String name, - String backupId, - String slot, - RestoreRequestInner request, - Context context) { - restoreSlotAsync(resourceGroupName, name, backupId, slot, request, context).block(); - } - - /** - * List the configurations of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will return configuration for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of site configurations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listConfigurationsSlotSinglePageAsync( - String resourceGroupName, String name, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listConfigurationsSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List the configurations of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will return configuration for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of site configurations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listConfigurationsSlotSinglePageAsync( - String resourceGroupName, String name, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listConfigurationsSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * List the configurations of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will return configuration for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of site configurations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listConfigurationsSlotAsync( - String resourceGroupName, String name, String slot) { - return new PagedFlux<>( - () -> listConfigurationsSlotSinglePageAsync(resourceGroupName, name, slot), - nextLink -> listConfigurationsSlotNextSinglePageAsync(nextLink)); - } - - /** - * List the configurations of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will return configuration for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of site configurations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listConfigurationsSlotAsync( - String resourceGroupName, String name, String slot, Context context) { - return new PagedFlux<>( - () -> listConfigurationsSlotSinglePageAsync(resourceGroupName, name, slot, context), - nextLink -> listConfigurationsSlotNextSinglePageAsync(nextLink, context)); - } - - /** - * List the configurations of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will return configuration for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of site configurations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listConfigurationsSlot( - String resourceGroupName, String name, String slot) { - return new PagedIterable<>(listConfigurationsSlotAsync(resourceGroupName, name, slot)); - } - - /** - * List the configurations of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will return configuration for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of site configurations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listConfigurationsSlot( - String resourceGroupName, String name, String slot, Context context) { - return new PagedIterable<>(listConfigurationsSlotAsync(resourceGroupName, name, slot, context)); - } - - /** - * Replaces the application settings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the application settings - * for the production slot. - * @param appSettings Application settings of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return string dictionary resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateApplicationSettingsSlotWithResponseAsync( - String resourceGroupName, String name, String slot, StringDictionaryInner appSettings) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (appSettings == null) { - return Mono.error(new IllegalArgumentException("Parameter appSettings is required and cannot be null.")); - } else { - appSettings.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updateApplicationSettingsSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - appSettings, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Replaces the application settings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the application settings - * for the production slot. - * @param appSettings Application settings of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return string dictionary resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateApplicationSettingsSlotWithResponseAsync( - String resourceGroupName, String name, String slot, StringDictionaryInner appSettings, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (appSettings == null) { - return Mono.error(new IllegalArgumentException("Parameter appSettings is required and cannot be null.")); - } else { - appSettings.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updateApplicationSettingsSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - appSettings, - accept, - context); - } - - /** - * Replaces the application settings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the application settings - * for the production slot. - * @param appSettings Application settings of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return string dictionary resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateApplicationSettingsSlotAsync( - String resourceGroupName, String name, String slot, StringDictionaryInner appSettings) { - return updateApplicationSettingsSlotWithResponseAsync(resourceGroupName, name, slot, appSettings) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Replaces the application settings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the application settings - * for the production slot. - * @param appSettings Application settings of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return string dictionary resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public StringDictionaryInner updateApplicationSettingsSlot( - String resourceGroupName, String name, String slot, StringDictionaryInner appSettings) { - return updateApplicationSettingsSlotAsync(resourceGroupName, name, slot, appSettings).block(); - } - - /** - * Replaces the application settings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the application settings - * for the production slot. - * @param appSettings Application settings of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return string dictionary resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateApplicationSettingsSlotWithResponse( - String resourceGroupName, String name, String slot, StringDictionaryInner appSettings, Context context) { - return updateApplicationSettingsSlotWithResponseAsync(resourceGroupName, name, slot, appSettings, context) - .block(); - } - - /** - * Gets the application settings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the application settings - * for the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the application settings of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listApplicationSettingsSlotWithResponseAsync( - String resourceGroupName, String name, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listApplicationSettingsSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the application settings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the application settings - * for the production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the application settings of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listApplicationSettingsSlotWithResponseAsync( - String resourceGroupName, String name, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listApplicationSettingsSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets the application settings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the application settings - * for the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the application settings of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listApplicationSettingsSlotAsync( - String resourceGroupName, String name, String slot) { - return listApplicationSettingsSlotWithResponseAsync(resourceGroupName, name, slot) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the application settings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the application settings - * for the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the application settings of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public StringDictionaryInner listApplicationSettingsSlot(String resourceGroupName, String name, String slot) { - return listApplicationSettingsSlotAsync(resourceGroupName, name, slot).block(); - } - - /** - * Gets the application settings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the application settings - * for the production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the application settings of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listApplicationSettingsSlotWithResponse( - String resourceGroupName, String name, String slot, Context context) { - return listApplicationSettingsSlotWithResponseAsync(resourceGroupName, name, slot, context).block(); - } - - /** - * Updates the Authentication / Authorization settings associated with web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param siteAuthSettings Auth settings associated with web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration settings for the Azure App Service Authentication / Authorization feature. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateAuthSettingsSlotWithResponseAsync( - String resourceGroupName, String name, String slot, SiteAuthSettingsInner siteAuthSettings) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (siteAuthSettings == null) { - return Mono - .error(new IllegalArgumentException("Parameter siteAuthSettings is required and cannot be null.")); - } else { - siteAuthSettings.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updateAuthSettingsSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - siteAuthSettings, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates the Authentication / Authorization settings associated with web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param siteAuthSettings Auth settings associated with web app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration settings for the Azure App Service Authentication / Authorization feature. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateAuthSettingsSlotWithResponseAsync( - String resourceGroupName, String name, String slot, SiteAuthSettingsInner siteAuthSettings, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (siteAuthSettings == null) { - return Mono - .error(new IllegalArgumentException("Parameter siteAuthSettings is required and cannot be null.")); - } else { - siteAuthSettings.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updateAuthSettingsSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - siteAuthSettings, - accept, - context); - } - - /** - * Updates the Authentication / Authorization settings associated with web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param siteAuthSettings Auth settings associated with web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration settings for the Azure App Service Authentication / Authorization feature. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAuthSettingsSlotAsync( - String resourceGroupName, String name, String slot, SiteAuthSettingsInner siteAuthSettings) { - return updateAuthSettingsSlotWithResponseAsync(resourceGroupName, name, slot, siteAuthSettings) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Updates the Authentication / Authorization settings associated with web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param siteAuthSettings Auth settings associated with web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration settings for the Azure App Service Authentication / Authorization feature. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SiteAuthSettingsInner updateAuthSettingsSlot( - String resourceGroupName, String name, String slot, SiteAuthSettingsInner siteAuthSettings) { - return updateAuthSettingsSlotAsync(resourceGroupName, name, slot, siteAuthSettings).block(); - } - - /** - * Updates the Authentication / Authorization settings associated with web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param siteAuthSettings Auth settings associated with web app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration settings for the Azure App Service Authentication / Authorization feature. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateAuthSettingsSlotWithResponse( - String resourceGroupName, String name, String slot, SiteAuthSettingsInner siteAuthSettings, Context context) { - return updateAuthSettingsSlotWithResponseAsync(resourceGroupName, name, slot, siteAuthSettings, context) - .block(); - } - - /** - * Gets the Authentication/Authorization settings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the settings for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Authentication/Authorization settings of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getAuthSettingsSlotWithResponseAsync( - String resourceGroupName, String name, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getAuthSettingsSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the Authentication/Authorization settings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the settings for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Authentication/Authorization settings of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getAuthSettingsSlotWithResponseAsync( - String resourceGroupName, String name, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getAuthSettingsSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets the Authentication/Authorization settings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the settings for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Authentication/Authorization settings of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAuthSettingsSlotAsync(String resourceGroupName, String name, String slot) { - return getAuthSettingsSlotWithResponseAsync(resourceGroupName, name, slot) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the Authentication/Authorization settings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the settings for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Authentication/Authorization settings of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SiteAuthSettingsInner getAuthSettingsSlot(String resourceGroupName, String name, String slot) { - return getAuthSettingsSlotAsync(resourceGroupName, name, slot).block(); - } - - /** - * Gets the Authentication/Authorization settings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the settings for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Authentication/Authorization settings of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getAuthSettingsSlotWithResponse( - String resourceGroupName, String name, String slot, Context context) { - return getAuthSettingsSlotWithResponseAsync(resourceGroupName, name, slot, context).block(); - } - - /** - * Updates the Azure storage account configurations of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the Azure storage - * account configurations for the production slot. - * @param azureStorageAccounts Azure storage accounts of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azureStorageInfo dictionary resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateAzureStorageAccountsSlotWithResponseAsync( - String resourceGroupName, - String name, - String slot, - AzureStoragePropertyDictionaryResourceInner azureStorageAccounts) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (azureStorageAccounts == null) { - return Mono - .error(new IllegalArgumentException("Parameter azureStorageAccounts is required and cannot be null.")); - } else { - azureStorageAccounts.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updateAzureStorageAccountsSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - azureStorageAccounts, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates the Azure storage account configurations of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the Azure storage - * account configurations for the production slot. - * @param azureStorageAccounts Azure storage accounts of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azureStorageInfo dictionary resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateAzureStorageAccountsSlotWithResponseAsync( - String resourceGroupName, - String name, - String slot, - AzureStoragePropertyDictionaryResourceInner azureStorageAccounts, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (azureStorageAccounts == null) { - return Mono - .error(new IllegalArgumentException("Parameter azureStorageAccounts is required and cannot be null.")); - } else { - azureStorageAccounts.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updateAzureStorageAccountsSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - azureStorageAccounts, - accept, - context); - } - - /** - * Updates the Azure storage account configurations of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the Azure storage - * account configurations for the production slot. - * @param azureStorageAccounts Azure storage accounts of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azureStorageInfo dictionary resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAzureStorageAccountsSlotAsync( - String resourceGroupName, - String name, - String slot, - AzureStoragePropertyDictionaryResourceInner azureStorageAccounts) { - return updateAzureStorageAccountsSlotWithResponseAsync(resourceGroupName, name, slot, azureStorageAccounts) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Updates the Azure storage account configurations of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the Azure storage - * account configurations for the production slot. - * @param azureStorageAccounts Azure storage accounts of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azureStorageInfo dictionary resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AzureStoragePropertyDictionaryResourceInner updateAzureStorageAccountsSlot( - String resourceGroupName, - String name, - String slot, - AzureStoragePropertyDictionaryResourceInner azureStorageAccounts) { - return updateAzureStorageAccountsSlotAsync(resourceGroupName, name, slot, azureStorageAccounts).block(); - } - - /** - * Updates the Azure storage account configurations of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the Azure storage - * account configurations for the production slot. - * @param azureStorageAccounts Azure storage accounts of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azureStorageInfo dictionary resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateAzureStorageAccountsSlotWithResponse( - String resourceGroupName, - String name, - String slot, - AzureStoragePropertyDictionaryResourceInner azureStorageAccounts, - Context context) { - return updateAzureStorageAccountsSlotWithResponseAsync( - resourceGroupName, name, slot, azureStorageAccounts, context) - .block(); - } - - /** - * Gets the Azure storage account configurations of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the Azure storage - * account configurations for the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Azure storage account configurations of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listAzureStorageAccountsSlotWithResponseAsync( - String resourceGroupName, String name, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listAzureStorageAccountsSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the Azure storage account configurations of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the Azure storage - * account configurations for the production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Azure storage account configurations of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAzureStorageAccountsSlotWithResponseAsync( - String resourceGroupName, String name, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listAzureStorageAccountsSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets the Azure storage account configurations of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the Azure storage - * account configurations for the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Azure storage account configurations of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listAzureStorageAccountsSlotAsync( - String resourceGroupName, String name, String slot) { - return listAzureStorageAccountsSlotWithResponseAsync(resourceGroupName, name, slot) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the Azure storage account configurations of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the Azure storage - * account configurations for the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Azure storage account configurations of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AzureStoragePropertyDictionaryResourceInner listAzureStorageAccountsSlot( - String resourceGroupName, String name, String slot) { - return listAzureStorageAccountsSlotAsync(resourceGroupName, name, slot).block(); - } - - /** - * Gets the Azure storage account configurations of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the Azure storage - * account configurations for the production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Azure storage account configurations of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listAzureStorageAccountsSlotWithResponse( - String resourceGroupName, String name, String slot, Context context) { - return listAzureStorageAccountsSlotWithResponseAsync(resourceGroupName, name, slot, context).block(); - } - - /** - * Updates the backup configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the backup configuration - * for the production slot. - * @param request Edited backup configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a backup which will be performed. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateBackupConfigurationSlotWithResponseAsync( - String resourceGroupName, String name, String slot, BackupRequestInner request) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (request == null) { - return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); - } else { - request.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updateBackupConfigurationSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - request, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates the backup configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the backup configuration - * for the production slot. - * @param request Edited backup configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a backup which will be performed. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateBackupConfigurationSlotWithResponseAsync( - String resourceGroupName, String name, String slot, BackupRequestInner request, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (request == null) { - return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); - } else { - request.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updateBackupConfigurationSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - request, - accept, - context); - } - - /** - * Updates the backup configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the backup configuration - * for the production slot. - * @param request Edited backup configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a backup which will be performed. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateBackupConfigurationSlotAsync( - String resourceGroupName, String name, String slot, BackupRequestInner request) { - return updateBackupConfigurationSlotWithResponseAsync(resourceGroupName, name, slot, request) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Updates the backup configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the backup configuration - * for the production slot. - * @param request Edited backup configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a backup which will be performed. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BackupRequestInner updateBackupConfigurationSlot( - String resourceGroupName, String name, String slot, BackupRequestInner request) { - return updateBackupConfigurationSlotAsync(resourceGroupName, name, slot, request).block(); - } - - /** - * Updates the backup configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the backup configuration - * for the production slot. - * @param request Edited backup configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a backup which will be performed. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateBackupConfigurationSlotWithResponse( - String resourceGroupName, String name, String slot, BackupRequestInner request, Context context) { - return updateBackupConfigurationSlotWithResponseAsync(resourceGroupName, name, slot, request, context).block(); - } - - /** - * Deletes the backup configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the backup configuration - * for the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteBackupConfigurationSlotWithResponseAsync( - String resourceGroupName, String name, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .deleteBackupConfigurationSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the backup configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the backup configuration - * for the production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteBackupConfigurationSlotWithResponseAsync( - String resourceGroupName, String name, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .deleteBackupConfigurationSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Deletes the backup configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the backup configuration - * for the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteBackupConfigurationSlotAsync(String resourceGroupName, String name, String slot) { - return deleteBackupConfigurationSlotWithResponseAsync(resourceGroupName, name, slot) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes the backup configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the backup configuration - * for the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteBackupConfigurationSlot(String resourceGroupName, String name, String slot) { - deleteBackupConfigurationSlotAsync(resourceGroupName, name, slot).block(); - } - - /** - * Deletes the backup configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the backup configuration - * for the production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteBackupConfigurationSlotWithResponse( - String resourceGroupName, String name, String slot, Context context) { - return deleteBackupConfigurationSlotWithResponseAsync(resourceGroupName, name, slot, context).block(); - } - - /** - * Gets the backup configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the backup configuration - * for the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the backup configuration of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getBackupConfigurationSlotWithResponseAsync( - String resourceGroupName, String name, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getBackupConfigurationSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the backup configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the backup configuration - * for the production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the backup configuration of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getBackupConfigurationSlotWithResponseAsync( - String resourceGroupName, String name, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getBackupConfigurationSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets the backup configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the backup configuration - * for the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the backup configuration of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getBackupConfigurationSlotAsync( - String resourceGroupName, String name, String slot) { - return getBackupConfigurationSlotWithResponseAsync(resourceGroupName, name, slot) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the backup configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the backup configuration - * for the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the backup configuration of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BackupRequestInner getBackupConfigurationSlot(String resourceGroupName, String name, String slot) { - return getBackupConfigurationSlotAsync(resourceGroupName, name, slot).block(); - } - - /** - * Gets the backup configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the backup configuration - * for the production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the backup configuration of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getBackupConfigurationSlotWithResponse( - String resourceGroupName, String name, String slot, Context context) { - return getBackupConfigurationSlotWithResponseAsync(resourceGroupName, name, slot, context).block(); - } - - /** - * Replaces the connection strings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the connection settings - * for the production slot. - * @param connectionStrings Connection strings of the app or deployment slot. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return string dictionary resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateConnectionStringsSlotWithResponseAsync( - String resourceGroupName, String name, String slot, ConnectionStringDictionaryInner connectionStrings) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (connectionStrings == null) { - return Mono - .error(new IllegalArgumentException("Parameter connectionStrings is required and cannot be null.")); - } else { - connectionStrings.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updateConnectionStringsSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - connectionStrings, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Replaces the connection strings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the connection settings - * for the production slot. - * @param connectionStrings Connection strings of the app or deployment slot. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return string dictionary resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateConnectionStringsSlotWithResponseAsync( - String resourceGroupName, - String name, - String slot, - ConnectionStringDictionaryInner connectionStrings, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (connectionStrings == null) { - return Mono - .error(new IllegalArgumentException("Parameter connectionStrings is required and cannot be null.")); - } else { - connectionStrings.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updateConnectionStringsSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - connectionStrings, - accept, - context); - } - - /** - * Replaces the connection strings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the connection settings - * for the production slot. - * @param connectionStrings Connection strings of the app or deployment slot. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return string dictionary resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateConnectionStringsSlotAsync( - String resourceGroupName, String name, String slot, ConnectionStringDictionaryInner connectionStrings) { - return updateConnectionStringsSlotWithResponseAsync(resourceGroupName, name, slot, connectionStrings) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Replaces the connection strings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the connection settings - * for the production slot. - * @param connectionStrings Connection strings of the app or deployment slot. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return string dictionary resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ConnectionStringDictionaryInner updateConnectionStringsSlot( - String resourceGroupName, String name, String slot, ConnectionStringDictionaryInner connectionStrings) { - return updateConnectionStringsSlotAsync(resourceGroupName, name, slot, connectionStrings).block(); - } - - /** - * Replaces the connection strings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the connection settings - * for the production slot. - * @param connectionStrings Connection strings of the app or deployment slot. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return string dictionary resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateConnectionStringsSlotWithResponse( - String resourceGroupName, - String name, - String slot, - ConnectionStringDictionaryInner connectionStrings, - Context context) { - return updateConnectionStringsSlotWithResponseAsync(resourceGroupName, name, slot, connectionStrings, context) - .block(); - } - - /** - * Gets the connection strings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the connection settings for - * the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the connection strings of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listConnectionStringsSlotWithResponseAsync( - String resourceGroupName, String name, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listConnectionStringsSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the connection strings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the connection settings for - * the production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the connection strings of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listConnectionStringsSlotWithResponseAsync( - String resourceGroupName, String name, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listConnectionStringsSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets the connection strings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the connection settings for - * the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the connection strings of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listConnectionStringsSlotAsync( - String resourceGroupName, String name, String slot) { - return listConnectionStringsSlotWithResponseAsync(resourceGroupName, name, slot) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the connection strings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the connection settings for - * the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the connection strings of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ConnectionStringDictionaryInner listConnectionStringsSlot( - String resourceGroupName, String name, String slot) { - return listConnectionStringsSlotAsync(resourceGroupName, name, slot).block(); - } - - /** - * Gets the connection strings of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the connection settings for - * the production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the connection strings of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listConnectionStringsSlotWithResponse( - String resourceGroupName, String name, String slot, Context context) { - return listConnectionStringsSlotWithResponseAsync(resourceGroupName, name, slot, context).block(); - } - - /** - * Gets the logging configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the logging configuration - * for the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the logging configuration of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getDiagnosticLogsConfigurationSlotWithResponseAsync( - String resourceGroupName, String name, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getDiagnosticLogsConfigurationSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the logging configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the logging configuration - * for the production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the logging configuration of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getDiagnosticLogsConfigurationSlotWithResponseAsync( - String resourceGroupName, String name, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getDiagnosticLogsConfigurationSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets the logging configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the logging configuration - * for the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the logging configuration of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getDiagnosticLogsConfigurationSlotAsync( - String resourceGroupName, String name, String slot) { - return getDiagnosticLogsConfigurationSlotWithResponseAsync(resourceGroupName, name, slot) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the logging configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the logging configuration - * for the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the logging configuration of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SiteLogsConfigInner getDiagnosticLogsConfigurationSlot(String resourceGroupName, String name, String slot) { - return getDiagnosticLogsConfigurationSlotAsync(resourceGroupName, name, slot).block(); - } - - /** - * Gets the logging configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the logging configuration - * for the production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the logging configuration of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getDiagnosticLogsConfigurationSlotWithResponse( - String resourceGroupName, String name, String slot, Context context) { - return getDiagnosticLogsConfigurationSlotWithResponseAsync(resourceGroupName, name, slot, context).block(); - } - - /** - * Updates the logging configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the logging - * configuration for the production slot. - * @param siteLogsConfig A SiteLogsConfig JSON object that contains the logging configuration to change in the - * "properties" property. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration of App Service site logs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateDiagnosticLogsConfigSlotWithResponseAsync( - String resourceGroupName, String name, String slot, SiteLogsConfigInner siteLogsConfig) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (siteLogsConfig == null) { - return Mono.error(new IllegalArgumentException("Parameter siteLogsConfig is required and cannot be null.")); - } else { - siteLogsConfig.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updateDiagnosticLogsConfigSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - siteLogsConfig, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates the logging configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the logging - * configuration for the production slot. - * @param siteLogsConfig A SiteLogsConfig JSON object that contains the logging configuration to change in the - * "properties" property. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration of App Service site logs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateDiagnosticLogsConfigSlotWithResponseAsync( - String resourceGroupName, String name, String slot, SiteLogsConfigInner siteLogsConfig, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (siteLogsConfig == null) { - return Mono.error(new IllegalArgumentException("Parameter siteLogsConfig is required and cannot be null.")); - } else { - siteLogsConfig.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updateDiagnosticLogsConfigSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - siteLogsConfig, - accept, - context); - } - - /** - * Updates the logging configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the logging - * configuration for the production slot. - * @param siteLogsConfig A SiteLogsConfig JSON object that contains the logging configuration to change in the - * "properties" property. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration of App Service site logs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateDiagnosticLogsConfigSlotAsync( - String resourceGroupName, String name, String slot, SiteLogsConfigInner siteLogsConfig) { - return updateDiagnosticLogsConfigSlotWithResponseAsync(resourceGroupName, name, slot, siteLogsConfig) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Updates the logging configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the logging - * configuration for the production slot. - * @param siteLogsConfig A SiteLogsConfig JSON object that contains the logging configuration to change in the - * "properties" property. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration of App Service site logs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SiteLogsConfigInner updateDiagnosticLogsConfigSlot( - String resourceGroupName, String name, String slot, SiteLogsConfigInner siteLogsConfig) { - return updateDiagnosticLogsConfigSlotAsync(resourceGroupName, name, slot, siteLogsConfig).block(); - } - - /** - * Updates the logging configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the logging - * configuration for the production slot. - * @param siteLogsConfig A SiteLogsConfig JSON object that contains the logging configuration to change in the - * "properties" property. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration of App Service site logs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateDiagnosticLogsConfigSlotWithResponse( - String resourceGroupName, String name, String slot, SiteLogsConfigInner siteLogsConfig, Context context) { - return updateDiagnosticLogsConfigSlotWithResponseAsync(resourceGroupName, name, slot, siteLogsConfig, context) - .block(); - } - - /** - * Replaces the metadata of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the metadata for the - * production slot. - * @param metadata Edited metadata of the app or deployment slot. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return string dictionary resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateMetadataSlotWithResponseAsync( - String resourceGroupName, String name, String slot, StringDictionaryInner metadata) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (metadata == null) { - return Mono.error(new IllegalArgumentException("Parameter metadata is required and cannot be null.")); - } else { - metadata.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updateMetadataSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - metadata, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Replaces the metadata of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the metadata for the - * production slot. - * @param metadata Edited metadata of the app or deployment slot. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return string dictionary resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateMetadataSlotWithResponseAsync( - String resourceGroupName, String name, String slot, StringDictionaryInner metadata, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (metadata == null) { - return Mono.error(new IllegalArgumentException("Parameter metadata is required and cannot be null.")); - } else { - metadata.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updateMetadataSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - metadata, - accept, - context); - } - - /** - * Replaces the metadata of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the metadata for the - * production slot. - * @param metadata Edited metadata of the app or deployment slot. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return string dictionary resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateMetadataSlotAsync( - String resourceGroupName, String name, String slot, StringDictionaryInner metadata) { - return updateMetadataSlotWithResponseAsync(resourceGroupName, name, slot, metadata) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Replaces the metadata of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the metadata for the - * production slot. - * @param metadata Edited metadata of the app or deployment slot. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return string dictionary resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public StringDictionaryInner updateMetadataSlot( - String resourceGroupName, String name, String slot, StringDictionaryInner metadata) { - return updateMetadataSlotAsync(resourceGroupName, name, slot, metadata).block(); - } - - /** - * Replaces the metadata of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the metadata for the - * production slot. - * @param metadata Edited metadata of the app or deployment slot. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return string dictionary resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateMetadataSlotWithResponse( - String resourceGroupName, String name, String slot, StringDictionaryInner metadata, Context context) { - return updateMetadataSlotWithResponseAsync(resourceGroupName, name, slot, metadata, context).block(); - } - - /** - * Gets the metadata of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the metadata for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the metadata of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listMetadataSlotWithResponseAsync( - String resourceGroupName, String name, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listMetadataSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the metadata of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the metadata for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the metadata of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listMetadataSlotWithResponseAsync( - String resourceGroupName, String name, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listMetadataSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets the metadata of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the metadata for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the metadata of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listMetadataSlotAsync(String resourceGroupName, String name, String slot) { - return listMetadataSlotWithResponseAsync(resourceGroupName, name, slot) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the metadata of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the metadata for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the metadata of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public StringDictionaryInner listMetadataSlot(String resourceGroupName, String name, String slot) { - return listMetadataSlotAsync(resourceGroupName, name, slot).block(); - } - - /** - * Gets the metadata of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the metadata for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the metadata of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listMetadataSlotWithResponse( - String resourceGroupName, String name, String slot, Context context) { - return listMetadataSlotWithResponseAsync(resourceGroupName, name, slot, context).block(); - } - - /** - * Gets the Git/FTP publishing credentials of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the publishing credentials - * for the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Git/FTP publishing credentials of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> listPublishingCredentialsSlotWithResponseAsync( - String resourceGroupName, String name, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listPublishingCredentialsSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the Git/FTP publishing credentials of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the publishing credentials - * for the production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Git/FTP publishing credentials of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> listPublishingCredentialsSlotWithResponseAsync( - String resourceGroupName, String name, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listPublishingCredentialsSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets the Git/FTP publishing credentials of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the publishing credentials - * for the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Git/FTP publishing credentials of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, UserInner> beginListPublishingCredentialsSlotAsync( - String resourceGroupName, String name, String slot) { - Mono>> mono = - listPublishingCredentialsSlotWithResponseAsync(resourceGroupName, name, slot); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), UserInner.class, UserInner.class, this.client.getContext()); - } - - /** - * Gets the Git/FTP publishing credentials of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the publishing credentials - * for the production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Git/FTP publishing credentials of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, UserInner> beginListPublishingCredentialsSlotAsync( - String resourceGroupName, String name, String slot, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - listPublishingCredentialsSlotWithResponseAsync(resourceGroupName, name, slot, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), UserInner.class, UserInner.class, context); - } - - /** - * Gets the Git/FTP publishing credentials of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the publishing credentials - * for the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Git/FTP publishing credentials of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, UserInner> beginListPublishingCredentialsSlot( - String resourceGroupName, String name, String slot) { - return beginListPublishingCredentialsSlotAsync(resourceGroupName, name, slot).getSyncPoller(); - } - - /** - * Gets the Git/FTP publishing credentials of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the publishing credentials - * for the production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Git/FTP publishing credentials of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, UserInner> beginListPublishingCredentialsSlot( - String resourceGroupName, String name, String slot, Context context) { - return beginListPublishingCredentialsSlotAsync(resourceGroupName, name, slot, context).getSyncPoller(); - } - - /** - * Gets the Git/FTP publishing credentials of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the publishing credentials - * for the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Git/FTP publishing credentials of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listPublishingCredentialsSlotAsync(String resourceGroupName, String name, String slot) { - return beginListPublishingCredentialsSlotAsync(resourceGroupName, name, slot) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Gets the Git/FTP publishing credentials of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the publishing credentials - * for the production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Git/FTP publishing credentials of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listPublishingCredentialsSlotAsync( - String resourceGroupName, String name, String slot, Context context) { - return beginListPublishingCredentialsSlotAsync(resourceGroupName, name, slot, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Gets the Git/FTP publishing credentials of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the publishing credentials - * for the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Git/FTP publishing credentials of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public UserInner listPublishingCredentialsSlot(String resourceGroupName, String name, String slot) { - return listPublishingCredentialsSlotAsync(resourceGroupName, name, slot).block(); - } - - /** - * Gets the Git/FTP publishing credentials of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the publishing credentials - * for the production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Git/FTP publishing credentials of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public UserInner listPublishingCredentialsSlot( - String resourceGroupName, String name, String slot, Context context) { - return listPublishingCredentialsSlotAsync(resourceGroupName, name, slot, context).block(); - } - - /** - * Updates the Push settings associated with web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param pushSettings Push settings associated with web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return push settings for the App. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateSitePushSettingsSlotWithResponseAsync( - String resourceGroupName, String name, String slot, PushSettingsInner pushSettings) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (pushSettings == null) { - return Mono.error(new IllegalArgumentException("Parameter pushSettings is required and cannot be null.")); - } else { - pushSettings.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updateSitePushSettingsSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - pushSettings, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates the Push settings associated with web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param pushSettings Push settings associated with web app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return push settings for the App. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateSitePushSettingsSlotWithResponseAsync( - String resourceGroupName, String name, String slot, PushSettingsInner pushSettings, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (pushSettings == null) { - return Mono.error(new IllegalArgumentException("Parameter pushSettings is required and cannot be null.")); - } else { - pushSettings.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updateSitePushSettingsSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - pushSettings, - accept, - context); - } - - /** - * Updates the Push settings associated with web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param pushSettings Push settings associated with web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return push settings for the App. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateSitePushSettingsSlotAsync( - String resourceGroupName, String name, String slot, PushSettingsInner pushSettings) { - return updateSitePushSettingsSlotWithResponseAsync(resourceGroupName, name, slot, pushSettings) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Updates the Push settings associated with web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param pushSettings Push settings associated with web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return push settings for the App. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PushSettingsInner updateSitePushSettingsSlot( - String resourceGroupName, String name, String slot, PushSettingsInner pushSettings) { - return updateSitePushSettingsSlotAsync(resourceGroupName, name, slot, pushSettings).block(); - } - - /** - * Updates the Push settings associated with web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param pushSettings Push settings associated with web app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return push settings for the App. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateSitePushSettingsSlotWithResponse( - String resourceGroupName, String name, String slot, PushSettingsInner pushSettings, Context context) { - return updateSitePushSettingsSlotWithResponseAsync(resourceGroupName, name, slot, pushSettings, context) - .block(); - } - - /** - * Gets the Push settings associated with web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Push settings associated with web app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listSitePushSettingsSlotWithResponseAsync( - String resourceGroupName, String name, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listSitePushSettingsSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the Push settings associated with web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Push settings associated with web app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSitePushSettingsSlotWithResponseAsync( - String resourceGroupName, String name, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listSitePushSettingsSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets the Push settings associated with web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Push settings associated with web app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listSitePushSettingsSlotAsync(String resourceGroupName, String name, String slot) { - return listSitePushSettingsSlotWithResponseAsync(resourceGroupName, name, slot) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the Push settings associated with web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Push settings associated with web app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PushSettingsInner listSitePushSettingsSlot(String resourceGroupName, String name, String slot) { - return listSitePushSettingsSlotAsync(resourceGroupName, name, slot).block(); - } - - /** - * Gets the Push settings associated with web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Push settings associated with web app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listSitePushSettingsSlotWithResponse( - String resourceGroupName, String name, String slot, Context context) { - return listSitePushSettingsSlotWithResponseAsync(resourceGroupName, name, slot, context).block(); - } - - /** - * Gets the configuration of an app, such as platform version and bitness, default documents, virtual applications, - * Always On, etc. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will return configuration for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the configuration of an app, such as platform version and bitness, default documents, virtual - * applications, Always On, etc. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getConfigurationSlotWithResponseAsync( - String resourceGroupName, String name, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getConfigurationSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the configuration of an app, such as platform version and bitness, default documents, virtual applications, - * Always On, etc. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will return configuration for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the configuration of an app, such as platform version and bitness, default documents, virtual - * applications, Always On, etc. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getConfigurationSlotWithResponseAsync( - String resourceGroupName, String name, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getConfigurationSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets the configuration of an app, such as platform version and bitness, default documents, virtual applications, - * Always On, etc. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will return configuration for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the configuration of an app, such as platform version and bitness, default documents, virtual - * applications, Always On, etc. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getConfigurationSlotAsync(String resourceGroupName, String name, String slot) { - return getConfigurationSlotWithResponseAsync(resourceGroupName, name, slot) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the configuration of an app, such as platform version and bitness, default documents, virtual applications, - * Always On, etc. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will return configuration for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the configuration of an app, such as platform version and bitness, default documents, virtual - * applications, Always On, etc. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SiteConfigResourceInner getConfigurationSlot(String resourceGroupName, String name, String slot) { - return getConfigurationSlotAsync(resourceGroupName, name, slot).block(); - } - - /** - * Gets the configuration of an app, such as platform version and bitness, default documents, virtual applications, - * Always On, etc. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will return configuration for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the configuration of an app, such as platform version and bitness, default documents, virtual - * applications, Always On, etc. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getConfigurationSlotWithResponse( - String resourceGroupName, String name, String slot, Context context) { - return getConfigurationSlotWithResponseAsync(resourceGroupName, name, slot, context).block(); - } - - /** - * Updates the configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update configuration for the - * production slot. - * @param siteConfig JSON representation of a SiteConfig object. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return web app configuration ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateConfigurationSlotWithResponseAsync( - String resourceGroupName, String name, String slot, SiteConfigResourceInner siteConfig) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (siteConfig == null) { - return Mono.error(new IllegalArgumentException("Parameter siteConfig is required and cannot be null.")); - } else { - siteConfig.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdateConfigurationSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - siteConfig, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates the configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update configuration for the - * production slot. - * @param siteConfig JSON representation of a SiteConfig object. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return web app configuration ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateConfigurationSlotWithResponseAsync( - String resourceGroupName, String name, String slot, SiteConfigResourceInner siteConfig, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (siteConfig == null) { - return Mono.error(new IllegalArgumentException("Parameter siteConfig is required and cannot be null.")); - } else { - siteConfig.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdateConfigurationSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - siteConfig, - accept, - context); - } - - /** - * Updates the configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update configuration for the - * production slot. - * @param siteConfig JSON representation of a SiteConfig object. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return web app configuration ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateConfigurationSlotAsync( - String resourceGroupName, String name, String slot, SiteConfigResourceInner siteConfig) { - return createOrUpdateConfigurationSlotWithResponseAsync(resourceGroupName, name, slot, siteConfig) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Updates the configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update configuration for the - * production slot. - * @param siteConfig JSON representation of a SiteConfig object. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return web app configuration ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SiteConfigResourceInner createOrUpdateConfigurationSlot( - String resourceGroupName, String name, String slot, SiteConfigResourceInner siteConfig) { - return createOrUpdateConfigurationSlotAsync(resourceGroupName, name, slot, siteConfig).block(); - } - - /** - * Updates the configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update configuration for the - * production slot. - * @param siteConfig JSON representation of a SiteConfig object. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return web app configuration ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateConfigurationSlotWithResponse( - String resourceGroupName, String name, String slot, SiteConfigResourceInner siteConfig, Context context) { - return createOrUpdateConfigurationSlotWithResponseAsync(resourceGroupName, name, slot, siteConfig, context) - .block(); - } - - /** - * Updates the configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update configuration for the - * production slot. - * @param siteConfig JSON representation of a SiteConfig object. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return web app configuration ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateConfigurationSlotWithResponseAsync( - String resourceGroupName, String name, String slot, SiteConfigResourceInner siteConfig) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (siteConfig == null) { - return Mono.error(new IllegalArgumentException("Parameter siteConfig is required and cannot be null.")); - } else { - siteConfig.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updateConfigurationSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - siteConfig, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates the configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update configuration for the - * production slot. - * @param siteConfig JSON representation of a SiteConfig object. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return web app configuration ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateConfigurationSlotWithResponseAsync( - String resourceGroupName, String name, String slot, SiteConfigResourceInner siteConfig, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (siteConfig == null) { - return Mono.error(new IllegalArgumentException("Parameter siteConfig is required and cannot be null.")); - } else { - siteConfig.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updateConfigurationSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - siteConfig, - accept, - context); - } - - /** - * Updates the configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update configuration for the - * production slot. - * @param siteConfig JSON representation of a SiteConfig object. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return web app configuration ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateConfigurationSlotAsync( - String resourceGroupName, String name, String slot, SiteConfigResourceInner siteConfig) { - return updateConfigurationSlotWithResponseAsync(resourceGroupName, name, slot, siteConfig) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Updates the configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update configuration for the - * production slot. - * @param siteConfig JSON representation of a SiteConfig object. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return web app configuration ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SiteConfigResourceInner updateConfigurationSlot( - String resourceGroupName, String name, String slot, SiteConfigResourceInner siteConfig) { - return updateConfigurationSlotAsync(resourceGroupName, name, slot, siteConfig).block(); - } - - /** - * Updates the configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update configuration for the - * production slot. - * @param siteConfig JSON representation of a SiteConfig object. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return web app configuration ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateConfigurationSlotWithResponse( - String resourceGroupName, String name, String slot, SiteConfigResourceInner siteConfig, Context context) { - return updateConfigurationSlotWithResponseAsync(resourceGroupName, name, slot, siteConfig, context).block(); - } - - /** - * Gets a list of web app configuration snapshots identifiers. Each element of the list contains a timestamp and the - * ID of the snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will return configuration for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of web app configuration snapshots identifiers. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listConfigurationSnapshotInfoSlotSinglePageAsync( - String resourceGroupName, String name, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listConfigurationSnapshotInfoSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a list of web app configuration snapshots identifiers. Each element of the list contains a timestamp and the - * ID of the snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will return configuration for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of web app configuration snapshots identifiers. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listConfigurationSnapshotInfoSlotSinglePageAsync( - String resourceGroupName, String name, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listConfigurationSnapshotInfoSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets a list of web app configuration snapshots identifiers. Each element of the list contains a timestamp and the - * ID of the snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will return configuration for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of web app configuration snapshots identifiers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listConfigurationSnapshotInfoSlotAsync( - String resourceGroupName, String name, String slot) { - return new PagedFlux<>( - () -> listConfigurationSnapshotInfoSlotSinglePageAsync(resourceGroupName, name, slot), - nextLink -> listConfigurationSnapshotInfoSlotNextSinglePageAsync(nextLink)); - } - - /** - * Gets a list of web app configuration snapshots identifiers. Each element of the list contains a timestamp and the - * ID of the snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will return configuration for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of web app configuration snapshots identifiers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listConfigurationSnapshotInfoSlotAsync( - String resourceGroupName, String name, String slot, Context context) { - return new PagedFlux<>( - () -> listConfigurationSnapshotInfoSlotSinglePageAsync(resourceGroupName, name, slot, context), - nextLink -> listConfigurationSnapshotInfoSlotNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets a list of web app configuration snapshots identifiers. Each element of the list contains a timestamp and the - * ID of the snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will return configuration for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of web app configuration snapshots identifiers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listConfigurationSnapshotInfoSlot( - String resourceGroupName, String name, String slot) { - return new PagedIterable<>(listConfigurationSnapshotInfoSlotAsync(resourceGroupName, name, slot)); - } - - /** - * Gets a list of web app configuration snapshots identifiers. Each element of the list contains a timestamp and the - * ID of the snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will return configuration for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of web app configuration snapshots identifiers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listConfigurationSnapshotInfoSlot( - String resourceGroupName, String name, String slot, Context context) { - return new PagedIterable<>(listConfigurationSnapshotInfoSlotAsync(resourceGroupName, name, slot, context)); - } - - /** - * Gets a snapshot of the configuration of an app at a previous point in time. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param snapshotId The ID of the snapshot to read. - * @param slot Name of the deployment slot. If a slot is not specified, the API will return configuration for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a snapshot of the configuration of an app at a previous point in time. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getConfigurationSnapshotSlotWithResponseAsync( - String resourceGroupName, String name, String snapshotId, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (snapshotId == null) { - return Mono.error(new IllegalArgumentException("Parameter snapshotId is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getConfigurationSnapshotSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - snapshotId, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a snapshot of the configuration of an app at a previous point in time. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param snapshotId The ID of the snapshot to read. - * @param slot Name of the deployment slot. If a slot is not specified, the API will return configuration for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a snapshot of the configuration of an app at a previous point in time. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getConfigurationSnapshotSlotWithResponseAsync( - String resourceGroupName, String name, String snapshotId, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (snapshotId == null) { - return Mono.error(new IllegalArgumentException("Parameter snapshotId is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getConfigurationSnapshotSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - snapshotId, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets a snapshot of the configuration of an app at a previous point in time. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param snapshotId The ID of the snapshot to read. - * @param slot Name of the deployment slot. If a slot is not specified, the API will return configuration for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a snapshot of the configuration of an app at a previous point in time. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getConfigurationSnapshotSlotAsync( - String resourceGroupName, String name, String snapshotId, String slot) { - return getConfigurationSnapshotSlotWithResponseAsync(resourceGroupName, name, snapshotId, slot) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a snapshot of the configuration of an app at a previous point in time. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param snapshotId The ID of the snapshot to read. - * @param slot Name of the deployment slot. If a slot is not specified, the API will return configuration for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a snapshot of the configuration of an app at a previous point in time. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SiteConfigResourceInner getConfigurationSnapshotSlot( - String resourceGroupName, String name, String snapshotId, String slot) { - return getConfigurationSnapshotSlotAsync(resourceGroupName, name, snapshotId, slot).block(); - } - - /** - * Gets a snapshot of the configuration of an app at a previous point in time. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param snapshotId The ID of the snapshot to read. - * @param slot Name of the deployment slot. If a slot is not specified, the API will return configuration for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a snapshot of the configuration of an app at a previous point in time. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getConfigurationSnapshotSlotWithResponse( - String resourceGroupName, String name, String snapshotId, String slot, Context context) { - return getConfigurationSnapshotSlotWithResponseAsync(resourceGroupName, name, snapshotId, slot, context) - .block(); - } - - /** - * Reverts the configuration of an app to a previous snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param snapshotId The ID of the snapshot to read. - * @param slot Name of the deployment slot. If a slot is not specified, the API will return configuration for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> recoverSiteConfigurationSnapshotSlotWithResponseAsync( - String resourceGroupName, String name, String snapshotId, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (snapshotId == null) { - return Mono.error(new IllegalArgumentException("Parameter snapshotId is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .recoverSiteConfigurationSnapshotSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - snapshotId, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Reverts the configuration of an app to a previous snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param snapshotId The ID of the snapshot to read. - * @param slot Name of the deployment slot. If a slot is not specified, the API will return configuration for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> recoverSiteConfigurationSnapshotSlotWithResponseAsync( - String resourceGroupName, String name, String snapshotId, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (snapshotId == null) { - return Mono.error(new IllegalArgumentException("Parameter snapshotId is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .recoverSiteConfigurationSnapshotSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - snapshotId, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Reverts the configuration of an app to a previous snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param snapshotId The ID of the snapshot to read. - * @param slot Name of the deployment slot. If a slot is not specified, the API will return configuration for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono recoverSiteConfigurationSnapshotSlotAsync( - String resourceGroupName, String name, String snapshotId, String slot) { - return recoverSiteConfigurationSnapshotSlotWithResponseAsync(resourceGroupName, name, snapshotId, slot) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Reverts the configuration of an app to a previous snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param snapshotId The ID of the snapshot to read. - * @param slot Name of the deployment slot. If a slot is not specified, the API will return configuration for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void recoverSiteConfigurationSnapshotSlot( - String resourceGroupName, String name, String snapshotId, String slot) { - recoverSiteConfigurationSnapshotSlotAsync(resourceGroupName, name, snapshotId, slot).block(); - } - - /** - * Reverts the configuration of an app to a previous snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param snapshotId The ID of the snapshot to read. - * @param slot Name of the deployment slot. If a slot is not specified, the API will return configuration for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response recoverSiteConfigurationSnapshotSlotWithResponse( - String resourceGroupName, String name, String snapshotId, String slot, Context context) { - return recoverSiteConfigurationSnapshotSlotWithResponseAsync(resourceGroupName, name, snapshotId, slot, context) - .block(); - } - - /** - * Gets the last lines of docker logs for the given site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the last lines of docker logs for the given site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getWebSiteContainerLogsSlotWithResponseAsync( - String resourceGroupName, String name, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/octet-stream"; - return FluxUtil - .withContext( - context -> - service - .getWebSiteContainerLogsSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the last lines of docker logs for the given site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the last lines of docker logs for the given site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getWebSiteContainerLogsSlotWithResponseAsync( - String resourceGroupName, String name, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/octet-stream"; - context = this.client.mergeContext(context); - return service - .getWebSiteContainerLogsSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets the last lines of docker logs for the given site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the last lines of docker logs for the given site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Flux getWebSiteContainerLogsSlotAsync(String resourceGroupName, String name, String slot) { - return getWebSiteContainerLogsSlotWithResponseAsync(resourceGroupName, name, slot) - .flatMapMany(StreamResponse::getValue); - } - - /** - * Gets the last lines of docker logs for the given site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the last lines of docker logs for the given site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public InputStream getWebSiteContainerLogsSlot(String resourceGroupName, String name, String slot) { - Iterator iterator = - getWebSiteContainerLogsSlotAsync(resourceGroupName, name, slot) - .map(ByteBufferBackedInputStream::new) - .toStream() - .iterator(); - Enumeration enumeration = - new Enumeration() { - @Override - public boolean hasMoreElements() { - return iterator.hasNext(); - } - - @Override - public InputStream nextElement() { - return iterator.next(); - } - }; - return new SequenceInputStream(enumeration); - } - - /** - * Gets the last lines of docker logs for the given site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the last lines of docker logs for the given site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public StreamResponse getWebSiteContainerLogsSlotWithResponse( - String resourceGroupName, String name, String slot, Context context) { - return getWebSiteContainerLogsSlotWithResponseAsync(resourceGroupName, name, slot, context).block(); - } - - /** - * Gets the ZIP archived docker log files for the given site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ZIP archived docker log files for the given site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getContainerLogsZipSlotWithResponseAsync( - String resourceGroupName, String name, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/zip"; - return FluxUtil - .withContext( - context -> - service - .getContainerLogsZipSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the ZIP archived docker log files for the given site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ZIP archived docker log files for the given site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getContainerLogsZipSlotWithResponseAsync( - String resourceGroupName, String name, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/zip"; - context = this.client.mergeContext(context); - return service - .getContainerLogsZipSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets the ZIP archived docker log files for the given site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ZIP archived docker log files for the given site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Flux getContainerLogsZipSlotAsync(String resourceGroupName, String name, String slot) { - return getContainerLogsZipSlotWithResponseAsync(resourceGroupName, name, slot) - .flatMapMany(StreamResponse::getValue); - } - - /** - * Gets the ZIP archived docker log files for the given site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ZIP archived docker log files for the given site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public InputStream getContainerLogsZipSlot(String resourceGroupName, String name, String slot) { - Iterator iterator = - getContainerLogsZipSlotAsync(resourceGroupName, name, slot) - .map(ByteBufferBackedInputStream::new) - .toStream() - .iterator(); - Enumeration enumeration = - new Enumeration() { - @Override - public boolean hasMoreElements() { - return iterator.hasNext(); - } - - @Override - public InputStream nextElement() { - return iterator.next(); - } - }; - return new SequenceInputStream(enumeration); - } - - /** - * Gets the ZIP archived docker log files for the given site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ZIP archived docker log files for the given site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public StreamResponse getContainerLogsZipSlotWithResponse( - String resourceGroupName, String name, String slot, Context context) { - return getContainerLogsZipSlotWithResponseAsync(resourceGroupName, name, slot, context).block(); - } - - /** - * List continuous web jobs for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu continuous web job information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listContinuousWebJobsSlotSinglePageAsync( - String resourceGroupName, String name, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listContinuousWebJobsSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List continuous web jobs for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu continuous web job information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listContinuousWebJobsSlotSinglePageAsync( - String resourceGroupName, String name, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listContinuousWebJobsSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * List continuous web jobs for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu continuous web job information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listContinuousWebJobsSlotAsync( - String resourceGroupName, String name, String slot) { - return new PagedFlux<>( - () -> listContinuousWebJobsSlotSinglePageAsync(resourceGroupName, name, slot), - nextLink -> listContinuousWebJobsSlotNextSinglePageAsync(nextLink)); - } - - /** - * List continuous web jobs for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu continuous web job information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listContinuousWebJobsSlotAsync( - String resourceGroupName, String name, String slot, Context context) { - return new PagedFlux<>( - () -> listContinuousWebJobsSlotSinglePageAsync(resourceGroupName, name, slot, context), - nextLink -> listContinuousWebJobsSlotNextSinglePageAsync(nextLink, context)); - } - - /** - * List continuous web jobs for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu continuous web job information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listContinuousWebJobsSlot( - String resourceGroupName, String name, String slot) { - return new PagedIterable<>(listContinuousWebJobsSlotAsync(resourceGroupName, name, slot)); - } - - /** - * List continuous web jobs for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu continuous web job information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listContinuousWebJobsSlot( - String resourceGroupName, String name, String slot, Context context) { - return new PagedIterable<>(listContinuousWebJobsSlotAsync(resourceGroupName, name, slot, context)); - } - - /** - * Gets a continuous web job by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a continuous web job by its ID for an app, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getContinuousWebJobSlotWithResponseAsync( - String resourceGroupName, String name, String webJobName, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (webJobName == null) { - return Mono.error(new IllegalArgumentException("Parameter webJobName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getContinuousWebJobSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - webJobName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a continuous web job by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a continuous web job by its ID for an app, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getContinuousWebJobSlotWithResponseAsync( - String resourceGroupName, String name, String webJobName, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (webJobName == null) { - return Mono.error(new IllegalArgumentException("Parameter webJobName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getContinuousWebJobSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - webJobName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets a continuous web job by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a continuous web job by its ID for an app, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getContinuousWebJobSlotAsync( - String resourceGroupName, String name, String webJobName, String slot) { - return getContinuousWebJobSlotWithResponseAsync(resourceGroupName, name, webJobName, slot) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a continuous web job by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a continuous web job by its ID for an app, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ContinuousWebJobInner getContinuousWebJobSlot( - String resourceGroupName, String name, String webJobName, String slot) { - return getContinuousWebJobSlotAsync(resourceGroupName, name, webJobName, slot).block(); - } - - /** - * Gets a continuous web job by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a continuous web job by its ID for an app, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getContinuousWebJobSlotWithResponse( - String resourceGroupName, String name, String webJobName, String slot, Context context) { - return getContinuousWebJobSlotWithResponseAsync(resourceGroupName, name, webJobName, slot, context).block(); - } - - /** - * Delete a continuous web job by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteContinuousWebJobSlotWithResponseAsync( - String resourceGroupName, String name, String webJobName, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (webJobName == null) { - return Mono.error(new IllegalArgumentException("Parameter webJobName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .deleteContinuousWebJobSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - webJobName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete a continuous web job by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteContinuousWebJobSlotWithResponseAsync( - String resourceGroupName, String name, String webJobName, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (webJobName == null) { - return Mono.error(new IllegalArgumentException("Parameter webJobName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .deleteContinuousWebJobSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - webJobName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Delete a continuous web job by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteContinuousWebJobSlotAsync( - String resourceGroupName, String name, String webJobName, String slot) { - return deleteContinuousWebJobSlotWithResponseAsync(resourceGroupName, name, webJobName, slot) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Delete a continuous web job by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteContinuousWebJobSlot(String resourceGroupName, String name, String webJobName, String slot) { - deleteContinuousWebJobSlotAsync(resourceGroupName, name, webJobName, slot).block(); - } - - /** - * Delete a continuous web job by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteContinuousWebJobSlotWithResponse( - String resourceGroupName, String name, String webJobName, String slot, Context context) { - return deleteContinuousWebJobSlotWithResponseAsync(resourceGroupName, name, webJobName, slot, context).block(); - } - - /** - * Start a continuous web job for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> startContinuousWebJobSlotWithResponseAsync( - String resourceGroupName, String name, String webJobName, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (webJobName == null) { - return Mono.error(new IllegalArgumentException("Parameter webJobName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .startContinuousWebJobSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - webJobName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Start a continuous web job for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> startContinuousWebJobSlotWithResponseAsync( - String resourceGroupName, String name, String webJobName, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (webJobName == null) { - return Mono.error(new IllegalArgumentException("Parameter webJobName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .startContinuousWebJobSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - webJobName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Start a continuous web job for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono startContinuousWebJobSlotAsync( - String resourceGroupName, String name, String webJobName, String slot) { - return startContinuousWebJobSlotWithResponseAsync(resourceGroupName, name, webJobName, slot) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Start a continuous web job for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void startContinuousWebJobSlot(String resourceGroupName, String name, String webJobName, String slot) { - startContinuousWebJobSlotAsync(resourceGroupName, name, webJobName, slot).block(); - } - - /** - * Start a continuous web job for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response startContinuousWebJobSlotWithResponse( - String resourceGroupName, String name, String webJobName, String slot, Context context) { - return startContinuousWebJobSlotWithResponseAsync(resourceGroupName, name, webJobName, slot, context).block(); - } - - /** - * Stop a continuous web job for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> stopContinuousWebJobSlotWithResponseAsync( - String resourceGroupName, String name, String webJobName, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (webJobName == null) { - return Mono.error(new IllegalArgumentException("Parameter webJobName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .stopContinuousWebJobSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - webJobName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Stop a continuous web job for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> stopContinuousWebJobSlotWithResponseAsync( - String resourceGroupName, String name, String webJobName, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (webJobName == null) { - return Mono.error(new IllegalArgumentException("Parameter webJobName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .stopContinuousWebJobSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - webJobName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Stop a continuous web job for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono stopContinuousWebJobSlotAsync( - String resourceGroupName, String name, String webJobName, String slot) { - return stopContinuousWebJobSlotWithResponseAsync(resourceGroupName, name, webJobName, slot) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Stop a continuous web job for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void stopContinuousWebJobSlot(String resourceGroupName, String name, String webJobName, String slot) { - stopContinuousWebJobSlotAsync(resourceGroupName, name, webJobName, slot).block(); - } - - /** - * Stop a continuous web job for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response stopContinuousWebJobSlotWithResponse( - String resourceGroupName, String name, String webJobName, String slot, Context context) { - return stopContinuousWebJobSlotWithResponseAsync(resourceGroupName, name, webJobName, slot, context).block(); - } - - /** - * List deployments for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of app deployments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listDeploymentsSlotSinglePageAsync( - String resourceGroupName, String name, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listDeploymentsSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List deployments for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of app deployments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listDeploymentsSlotSinglePageAsync( - String resourceGroupName, String name, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listDeploymentsSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * List deployments for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of app deployments. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listDeploymentsSlotAsync(String resourceGroupName, String name, String slot) { - return new PagedFlux<>( - () -> listDeploymentsSlotSinglePageAsync(resourceGroupName, name, slot), - nextLink -> listDeploymentsSlotNextSinglePageAsync(nextLink)); - } - - /** - * List deployments for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of app deployments. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listDeploymentsSlotAsync( - String resourceGroupName, String name, String slot, Context context) { - return new PagedFlux<>( - () -> listDeploymentsSlotSinglePageAsync(resourceGroupName, name, slot, context), - nextLink -> listDeploymentsSlotNextSinglePageAsync(nextLink, context)); - } - - /** - * List deployments for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of app deployments. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listDeploymentsSlot(String resourceGroupName, String name, String slot) { - return new PagedIterable<>(listDeploymentsSlotAsync(resourceGroupName, name, slot)); - } - - /** - * List deployments for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of app deployments. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listDeploymentsSlot( - String resourceGroupName, String name, String slot, Context context) { - return new PagedIterable<>(listDeploymentsSlotAsync(resourceGroupName, name, slot, context)); - } - - /** - * Get a deployment by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param id Deployment ID. - * @param slot Name of the deployment slot. If a slot is not specified, the API gets a deployment for the production - * slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment by its ID for an app, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getDeploymentSlotWithResponseAsync( - String resourceGroupName, String name, String id, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (id == null) { - return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getDeploymentSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - id, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a deployment by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param id Deployment ID. - * @param slot Name of the deployment slot. If a slot is not specified, the API gets a deployment for the production - * slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment by its ID for an app, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getDeploymentSlotWithResponseAsync( - String resourceGroupName, String name, String id, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (id == null) { - return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getDeploymentSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - id, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Get a deployment by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param id Deployment ID. - * @param slot Name of the deployment slot. If a slot is not specified, the API gets a deployment for the production - * slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment by its ID for an app, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getDeploymentSlotAsync(String resourceGroupName, String name, String id, String slot) { - return getDeploymentSlotWithResponseAsync(resourceGroupName, name, id, slot) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get a deployment by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param id Deployment ID. - * @param slot Name of the deployment slot. If a slot is not specified, the API gets a deployment for the production - * slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment by its ID for an app, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentInner getDeploymentSlot(String resourceGroupName, String name, String id, String slot) { - return getDeploymentSlotAsync(resourceGroupName, name, id, slot).block(); - } - - /** - * Get a deployment by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param id Deployment ID. - * @param slot Name of the deployment slot. If a slot is not specified, the API gets a deployment for the production - * slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment by its ID for an app, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getDeploymentSlotWithResponse( - String resourceGroupName, String name, String id, String slot, Context context) { - return getDeploymentSlotWithResponseAsync(resourceGroupName, name, id, slot, context).block(); - } - - /** - * Create a deployment for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param id ID of an existing deployment. - * @param slot Name of the deployment slot. If a slot is not specified, the API creates a deployment for the - * production slot. - * @param deployment Deployment details. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user credentials used for publishing activity. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createDeploymentSlotWithResponseAsync( - String resourceGroupName, String name, String id, String slot, DeploymentInner deployment) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (id == null) { - return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (deployment == null) { - return Mono.error(new IllegalArgumentException("Parameter deployment is required and cannot be null.")); - } else { - deployment.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createDeploymentSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - id, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - deployment, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create a deployment for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param id ID of an existing deployment. - * @param slot Name of the deployment slot. If a slot is not specified, the API creates a deployment for the - * production slot. - * @param deployment Deployment details. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user credentials used for publishing activity. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createDeploymentSlotWithResponseAsync( - String resourceGroupName, String name, String id, String slot, DeploymentInner deployment, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (id == null) { - return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (deployment == null) { - return Mono.error(new IllegalArgumentException("Parameter deployment is required and cannot be null.")); - } else { - deployment.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createDeploymentSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - id, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - deployment, - accept, - context); - } - - /** - * Create a deployment for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param id ID of an existing deployment. - * @param slot Name of the deployment slot. If a slot is not specified, the API creates a deployment for the - * production slot. - * @param deployment Deployment details. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user credentials used for publishing activity. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createDeploymentSlotAsync( - String resourceGroupName, String name, String id, String slot, DeploymentInner deployment) { - return createDeploymentSlotWithResponseAsync(resourceGroupName, name, id, slot, deployment) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Create a deployment for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param id ID of an existing deployment. - * @param slot Name of the deployment slot. If a slot is not specified, the API creates a deployment for the - * production slot. - * @param deployment Deployment details. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user credentials used for publishing activity. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentInner createDeploymentSlot( - String resourceGroupName, String name, String id, String slot, DeploymentInner deployment) { - return createDeploymentSlotAsync(resourceGroupName, name, id, slot, deployment).block(); - } - - /** - * Create a deployment for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param id ID of an existing deployment. - * @param slot Name of the deployment slot. If a slot is not specified, the API creates a deployment for the - * production slot. - * @param deployment Deployment details. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user credentials used for publishing activity. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createDeploymentSlotWithResponse( - String resourceGroupName, String name, String id, String slot, DeploymentInner deployment, Context context) { - return createDeploymentSlotWithResponseAsync(resourceGroupName, name, id, slot, deployment, context).block(); - } - - /** - * Delete a deployment by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param id Deployment ID. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteDeploymentSlotWithResponseAsync( - String resourceGroupName, String name, String id, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (id == null) { - return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .deleteDeploymentSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - id, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete a deployment by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param id Deployment ID. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteDeploymentSlotWithResponseAsync( - String resourceGroupName, String name, String id, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (id == null) { - return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .deleteDeploymentSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - id, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Delete a deployment by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param id Deployment ID. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteDeploymentSlotAsync(String resourceGroupName, String name, String id, String slot) { - return deleteDeploymentSlotWithResponseAsync(resourceGroupName, name, id, slot) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Delete a deployment by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param id Deployment ID. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteDeploymentSlot(String resourceGroupName, String name, String id, String slot) { - deleteDeploymentSlotAsync(resourceGroupName, name, id, slot).block(); - } - - /** - * Delete a deployment by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param id Deployment ID. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteDeploymentSlotWithResponse( - String resourceGroupName, String name, String id, String slot, Context context) { - return deleteDeploymentSlotWithResponseAsync(resourceGroupName, name, id, slot, context).block(); - } - - /** - * List deployment log for specific deployment for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param id The ID of a specific deployment. This is the value of the name property in the JSON response from "GET - * /api/sites/{siteName}/deployments". - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user credentials used for publishing activity. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listDeploymentLogSlotWithResponseAsync( - String resourceGroupName, String name, String id, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (id == null) { - return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listDeploymentLogSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - id, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List deployment log for specific deployment for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param id The ID of a specific deployment. This is the value of the name property in the JSON response from "GET - * /api/sites/{siteName}/deployments". - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user credentials used for publishing activity. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listDeploymentLogSlotWithResponseAsync( - String resourceGroupName, String name, String id, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (id == null) { - return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listDeploymentLogSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - id, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * List deployment log for specific deployment for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param id The ID of a specific deployment. This is the value of the name property in the JSON response from "GET - * /api/sites/{siteName}/deployments". - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user credentials used for publishing activity. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listDeploymentLogSlotAsync( - String resourceGroupName, String name, String id, String slot) { - return listDeploymentLogSlotWithResponseAsync(resourceGroupName, name, id, slot) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * List deployment log for specific deployment for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param id The ID of a specific deployment. This is the value of the name property in the JSON response from "GET - * /api/sites/{siteName}/deployments". - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user credentials used for publishing activity. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentInner listDeploymentLogSlot(String resourceGroupName, String name, String id, String slot) { - return listDeploymentLogSlotAsync(resourceGroupName, name, id, slot).block(); - } - - /** - * List deployment log for specific deployment for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param id The ID of a specific deployment. This is the value of the name property in the JSON response from "GET - * /api/sites/{siteName}/deployments". - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user credentials used for publishing activity. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listDeploymentLogSlotWithResponse( - String resourceGroupName, String name, String id, String slot, Context context) { - return listDeploymentLogSlotWithResponseAsync(resourceGroupName, name, id, slot, context).block(); - } - - /** - * Discovers an existing app backup that can be restored from a blob in Azure storage. Use this to get information - * about the databases stored in a backup. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will perform discovery for the - * production slot. - * @param request A RestoreRequest object that includes Azure storage URL and blog name for discovery of backup. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a restore request. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> discoverBackupSlotWithResponseAsync( - String resourceGroupName, String name, String slot, RestoreRequestInner request) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (request == null) { - return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); - } else { - request.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .discoverBackupSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - request, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Discovers an existing app backup that can be restored from a blob in Azure storage. Use this to get information - * about the databases stored in a backup. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will perform discovery for the - * production slot. - * @param request A RestoreRequest object that includes Azure storage URL and blog name for discovery of backup. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a restore request. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> discoverBackupSlotWithResponseAsync( - String resourceGroupName, String name, String slot, RestoreRequestInner request, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (request == null) { - return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); - } else { - request.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .discoverBackupSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - request, - accept, - context); - } - - /** - * Discovers an existing app backup that can be restored from a blob in Azure storage. Use this to get information - * about the databases stored in a backup. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will perform discovery for the - * production slot. - * @param request A RestoreRequest object that includes Azure storage URL and blog name for discovery of backup. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a restore request. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono discoverBackupSlotAsync( - String resourceGroupName, String name, String slot, RestoreRequestInner request) { - return discoverBackupSlotWithResponseAsync(resourceGroupName, name, slot, request) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Discovers an existing app backup that can be restored from a blob in Azure storage. Use this to get information - * about the databases stored in a backup. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will perform discovery for the - * production slot. - * @param request A RestoreRequest object that includes Azure storage URL and blog name for discovery of backup. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a restore request. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RestoreRequestInner discoverBackupSlot( - String resourceGroupName, String name, String slot, RestoreRequestInner request) { - return discoverBackupSlotAsync(resourceGroupName, name, slot, request).block(); - } - - /** - * Discovers an existing app backup that can be restored from a blob in Azure storage. Use this to get information - * about the databases stored in a backup. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will perform discovery for the - * production slot. - * @param request A RestoreRequest object that includes Azure storage URL and blog name for discovery of backup. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a restore request. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response discoverBackupSlotWithResponse( - String resourceGroupName, String name, String slot, RestoreRequestInner request, Context context) { - return discoverBackupSlotWithResponseAsync(resourceGroupName, name, slot, request, context).block(); - } - - /** - * Lists ownership identifiers for domain associated with web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the binding for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of identifiers. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listDomainOwnershipIdentifiersSlotSinglePageAsync( - String resourceGroupName, String name, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listDomainOwnershipIdentifiersSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists ownership identifiers for domain associated with web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the binding for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of identifiers. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listDomainOwnershipIdentifiersSlotSinglePageAsync( - String resourceGroupName, String name, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listDomainOwnershipIdentifiersSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists ownership identifiers for domain associated with web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the binding for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of identifiers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listDomainOwnershipIdentifiersSlotAsync( - String resourceGroupName, String name, String slot) { - return new PagedFlux<>( - () -> listDomainOwnershipIdentifiersSlotSinglePageAsync(resourceGroupName, name, slot), - nextLink -> listDomainOwnershipIdentifiersSlotNextSinglePageAsync(nextLink)); - } - - /** - * Lists ownership identifiers for domain associated with web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the binding for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of identifiers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listDomainOwnershipIdentifiersSlotAsync( - String resourceGroupName, String name, String slot, Context context) { - return new PagedFlux<>( - () -> listDomainOwnershipIdentifiersSlotSinglePageAsync(resourceGroupName, name, slot, context), - nextLink -> listDomainOwnershipIdentifiersSlotNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists ownership identifiers for domain associated with web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the binding for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of identifiers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listDomainOwnershipIdentifiersSlot( - String resourceGroupName, String name, String slot) { - return new PagedIterable<>(listDomainOwnershipIdentifiersSlotAsync(resourceGroupName, name, slot)); - } - - /** - * Lists ownership identifiers for domain associated with web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the binding for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of identifiers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listDomainOwnershipIdentifiersSlot( - String resourceGroupName, String name, String slot, Context context) { - return new PagedIterable<>(listDomainOwnershipIdentifiersSlotAsync(resourceGroupName, name, slot, context)); - } - - /** - * Get domain ownership identifier for web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param domainOwnershipIdentifierName Name of domain ownership identifier. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the binding for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return domain ownership identifier for web app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getDomainOwnershipIdentifierSlotWithResponseAsync( - String resourceGroupName, String name, String domainOwnershipIdentifierName, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (domainOwnershipIdentifierName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter domainOwnershipIdentifierName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getDomainOwnershipIdentifierSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - domainOwnershipIdentifierName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get domain ownership identifier for web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param domainOwnershipIdentifierName Name of domain ownership identifier. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the binding for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return domain ownership identifier for web app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getDomainOwnershipIdentifierSlotWithResponseAsync( - String resourceGroupName, String name, String domainOwnershipIdentifierName, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (domainOwnershipIdentifierName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter domainOwnershipIdentifierName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getDomainOwnershipIdentifierSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - domainOwnershipIdentifierName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Get domain ownership identifier for web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param domainOwnershipIdentifierName Name of domain ownership identifier. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the binding for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return domain ownership identifier for web app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getDomainOwnershipIdentifierSlotAsync( - String resourceGroupName, String name, String domainOwnershipIdentifierName, String slot) { - return getDomainOwnershipIdentifierSlotWithResponseAsync( - resourceGroupName, name, domainOwnershipIdentifierName, slot) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get domain ownership identifier for web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param domainOwnershipIdentifierName Name of domain ownership identifier. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the binding for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return domain ownership identifier for web app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public IdentifierInner getDomainOwnershipIdentifierSlot( - String resourceGroupName, String name, String domainOwnershipIdentifierName, String slot) { - return getDomainOwnershipIdentifierSlotAsync(resourceGroupName, name, domainOwnershipIdentifierName, slot) - .block(); - } - - /** - * Get domain ownership identifier for web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param domainOwnershipIdentifierName Name of domain ownership identifier. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the binding for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return domain ownership identifier for web app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getDomainOwnershipIdentifierSlotWithResponse( - String resourceGroupName, String name, String domainOwnershipIdentifierName, String slot, Context context) { - return getDomainOwnershipIdentifierSlotWithResponseAsync( - resourceGroupName, name, domainOwnershipIdentifierName, slot, context) - .block(); - } - - /** - * Creates a domain ownership identifier for web app, or updates an existing ownership identifier. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param domainOwnershipIdentifierName Name of domain ownership identifier. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the binding for the - * production slot. - * @param domainOwnershipIdentifier A JSON representation of the domain ownership properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a domain specific resource identifier. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateDomainOwnershipIdentifierSlotWithResponseAsync( - String resourceGroupName, - String name, - String domainOwnershipIdentifierName, - String slot, - IdentifierInner domainOwnershipIdentifier) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (domainOwnershipIdentifierName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter domainOwnershipIdentifierName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (domainOwnershipIdentifier == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter domainOwnershipIdentifier is required and cannot be null.")); - } else { - domainOwnershipIdentifier.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdateDomainOwnershipIdentifierSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - domainOwnershipIdentifierName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - domainOwnershipIdentifier, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates a domain ownership identifier for web app, or updates an existing ownership identifier. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param domainOwnershipIdentifierName Name of domain ownership identifier. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the binding for the - * production slot. - * @param domainOwnershipIdentifier A JSON representation of the domain ownership properties. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a domain specific resource identifier. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateDomainOwnershipIdentifierSlotWithResponseAsync( - String resourceGroupName, - String name, - String domainOwnershipIdentifierName, - String slot, - IdentifierInner domainOwnershipIdentifier, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (domainOwnershipIdentifierName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter domainOwnershipIdentifierName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (domainOwnershipIdentifier == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter domainOwnershipIdentifier is required and cannot be null.")); - } else { - domainOwnershipIdentifier.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdateDomainOwnershipIdentifierSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - domainOwnershipIdentifierName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - domainOwnershipIdentifier, - accept, - context); - } - - /** - * Creates a domain ownership identifier for web app, or updates an existing ownership identifier. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param domainOwnershipIdentifierName Name of domain ownership identifier. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the binding for the - * production slot. - * @param domainOwnershipIdentifier A JSON representation of the domain ownership properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a domain specific resource identifier. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateDomainOwnershipIdentifierSlotAsync( - String resourceGroupName, - String name, - String domainOwnershipIdentifierName, - String slot, - IdentifierInner domainOwnershipIdentifier) { - return createOrUpdateDomainOwnershipIdentifierSlotWithResponseAsync( - resourceGroupName, name, domainOwnershipIdentifierName, slot, domainOwnershipIdentifier) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates a domain ownership identifier for web app, or updates an existing ownership identifier. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param domainOwnershipIdentifierName Name of domain ownership identifier. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the binding for the - * production slot. - * @param domainOwnershipIdentifier A JSON representation of the domain ownership properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a domain specific resource identifier. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public IdentifierInner createOrUpdateDomainOwnershipIdentifierSlot( - String resourceGroupName, - String name, - String domainOwnershipIdentifierName, - String slot, - IdentifierInner domainOwnershipIdentifier) { - return createOrUpdateDomainOwnershipIdentifierSlotAsync( - resourceGroupName, name, domainOwnershipIdentifierName, slot, domainOwnershipIdentifier) - .block(); - } - - /** - * Creates a domain ownership identifier for web app, or updates an existing ownership identifier. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param domainOwnershipIdentifierName Name of domain ownership identifier. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the binding for the - * production slot. - * @param domainOwnershipIdentifier A JSON representation of the domain ownership properties. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a domain specific resource identifier. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateDomainOwnershipIdentifierSlotWithResponse( - String resourceGroupName, - String name, - String domainOwnershipIdentifierName, - String slot, - IdentifierInner domainOwnershipIdentifier, - Context context) { - return createOrUpdateDomainOwnershipIdentifierSlotWithResponseAsync( - resourceGroupName, name, domainOwnershipIdentifierName, slot, domainOwnershipIdentifier, context) - .block(); - } - - /** - * Deletes a domain ownership identifier for a web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param domainOwnershipIdentifierName Name of domain ownership identifier. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the binding for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteDomainOwnershipIdentifierSlotWithResponseAsync( - String resourceGroupName, String name, String domainOwnershipIdentifierName, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (domainOwnershipIdentifierName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter domainOwnershipIdentifierName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .deleteDomainOwnershipIdentifierSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - domainOwnershipIdentifierName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a domain ownership identifier for a web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param domainOwnershipIdentifierName Name of domain ownership identifier. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the binding for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteDomainOwnershipIdentifierSlotWithResponseAsync( - String resourceGroupName, String name, String domainOwnershipIdentifierName, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (domainOwnershipIdentifierName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter domainOwnershipIdentifierName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .deleteDomainOwnershipIdentifierSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - domainOwnershipIdentifierName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Deletes a domain ownership identifier for a web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param domainOwnershipIdentifierName Name of domain ownership identifier. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the binding for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteDomainOwnershipIdentifierSlotAsync( - String resourceGroupName, String name, String domainOwnershipIdentifierName, String slot) { - return deleteDomainOwnershipIdentifierSlotWithResponseAsync( - resourceGroupName, name, domainOwnershipIdentifierName, slot) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes a domain ownership identifier for a web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param domainOwnershipIdentifierName Name of domain ownership identifier. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the binding for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteDomainOwnershipIdentifierSlot( - String resourceGroupName, String name, String domainOwnershipIdentifierName, String slot) { - deleteDomainOwnershipIdentifierSlotAsync(resourceGroupName, name, domainOwnershipIdentifierName, slot).block(); - } - - /** - * Deletes a domain ownership identifier for a web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param domainOwnershipIdentifierName Name of domain ownership identifier. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the binding for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteDomainOwnershipIdentifierSlotWithResponse( - String resourceGroupName, String name, String domainOwnershipIdentifierName, String slot, Context context) { - return deleteDomainOwnershipIdentifierSlotWithResponseAsync( - resourceGroupName, name, domainOwnershipIdentifierName, slot, context) - .block(); - } - - /** - * Creates a domain ownership identifier for web app, or updates an existing ownership identifier. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param domainOwnershipIdentifierName Name of domain ownership identifier. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the binding for the - * production slot. - * @param domainOwnershipIdentifier A JSON representation of the domain ownership properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a domain specific resource identifier. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateDomainOwnershipIdentifierSlotWithResponseAsync( - String resourceGroupName, - String name, - String domainOwnershipIdentifierName, - String slot, - IdentifierInner domainOwnershipIdentifier) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (domainOwnershipIdentifierName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter domainOwnershipIdentifierName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (domainOwnershipIdentifier == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter domainOwnershipIdentifier is required and cannot be null.")); - } else { - domainOwnershipIdentifier.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updateDomainOwnershipIdentifierSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - domainOwnershipIdentifierName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - domainOwnershipIdentifier, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates a domain ownership identifier for web app, or updates an existing ownership identifier. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param domainOwnershipIdentifierName Name of domain ownership identifier. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the binding for the - * production slot. - * @param domainOwnershipIdentifier A JSON representation of the domain ownership properties. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a domain specific resource identifier. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateDomainOwnershipIdentifierSlotWithResponseAsync( - String resourceGroupName, - String name, - String domainOwnershipIdentifierName, - String slot, - IdentifierInner domainOwnershipIdentifier, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (domainOwnershipIdentifierName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter domainOwnershipIdentifierName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (domainOwnershipIdentifier == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter domainOwnershipIdentifier is required and cannot be null.")); - } else { - domainOwnershipIdentifier.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updateDomainOwnershipIdentifierSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - domainOwnershipIdentifierName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - domainOwnershipIdentifier, - accept, - context); - } - - /** - * Creates a domain ownership identifier for web app, or updates an existing ownership identifier. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param domainOwnershipIdentifierName Name of domain ownership identifier. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the binding for the - * production slot. - * @param domainOwnershipIdentifier A JSON representation of the domain ownership properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a domain specific resource identifier. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateDomainOwnershipIdentifierSlotAsync( - String resourceGroupName, - String name, - String domainOwnershipIdentifierName, - String slot, - IdentifierInner domainOwnershipIdentifier) { - return updateDomainOwnershipIdentifierSlotWithResponseAsync( - resourceGroupName, name, domainOwnershipIdentifierName, slot, domainOwnershipIdentifier) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates a domain ownership identifier for web app, or updates an existing ownership identifier. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param domainOwnershipIdentifierName Name of domain ownership identifier. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the binding for the - * production slot. - * @param domainOwnershipIdentifier A JSON representation of the domain ownership properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a domain specific resource identifier. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public IdentifierInner updateDomainOwnershipIdentifierSlot( - String resourceGroupName, - String name, - String domainOwnershipIdentifierName, - String slot, - IdentifierInner domainOwnershipIdentifier) { - return updateDomainOwnershipIdentifierSlotAsync( - resourceGroupName, name, domainOwnershipIdentifierName, slot, domainOwnershipIdentifier) - .block(); - } - - /** - * Creates a domain ownership identifier for web app, or updates an existing ownership identifier. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param domainOwnershipIdentifierName Name of domain ownership identifier. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the binding for the - * production slot. - * @param domainOwnershipIdentifier A JSON representation of the domain ownership properties. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a domain specific resource identifier. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateDomainOwnershipIdentifierSlotWithResponse( - String resourceGroupName, - String name, - String domainOwnershipIdentifierName, - String slot, - IdentifierInner domainOwnershipIdentifier, - Context context) { - return updateDomainOwnershipIdentifierSlotWithResponseAsync( - resourceGroupName, name, domainOwnershipIdentifierName, slot, domainOwnershipIdentifier, context) - .block(); - } - - /** - * Get the status of the last MSDeploy operation. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of the last MSDeploy operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getMSDeployStatusSlotWithResponseAsync( - String resourceGroupName, String name, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getMSDeployStatusSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the status of the last MSDeploy operation. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of the last MSDeploy operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getMSDeployStatusSlotWithResponseAsync( - String resourceGroupName, String name, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getMSDeployStatusSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Get the status of the last MSDeploy operation. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of the last MSDeploy operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getMSDeployStatusSlotAsync(String resourceGroupName, String name, String slot) { - return getMSDeployStatusSlotWithResponseAsync(resourceGroupName, name, slot) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get the status of the last MSDeploy operation. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of the last MSDeploy operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public MSDeployStatusInner getMSDeployStatusSlot(String resourceGroupName, String name, String slot) { - return getMSDeployStatusSlotAsync(resourceGroupName, name, slot).block(); - } - - /** - * Get the status of the last MSDeploy operation. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of the last MSDeploy operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getMSDeployStatusSlotWithResponse( - String resourceGroupName, String name, String slot, Context context) { - return getMSDeployStatusSlotWithResponseAsync(resourceGroupName, name, slot, context).block(); - } - - /** - * Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param mSDeploy Details of MSDeploy operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createMSDeployOperationSlotWithResponseAsync( - String resourceGroupName, String name, String slot, MSDeploy mSDeploy) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (mSDeploy == null) { - return Mono.error(new IllegalArgumentException("Parameter mSDeploy is required and cannot be null.")); - } else { - mSDeploy.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createMSDeployOperationSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - mSDeploy, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param mSDeploy Details of MSDeploy operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createMSDeployOperationSlotWithResponseAsync( - String resourceGroupName, String name, String slot, MSDeploy mSDeploy, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (mSDeploy == null) { - return Mono.error(new IllegalArgumentException("Parameter mSDeploy is required and cannot be null.")); - } else { - mSDeploy.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createMSDeployOperationSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - mSDeploy, - accept, - context); - } - - /** - * Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param mSDeploy Details of MSDeploy operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, MSDeployStatusInner> beginCreateMSDeployOperationSlotAsync( - String resourceGroupName, String name, String slot, MSDeploy mSDeploy) { - Mono>> mono = - createMSDeployOperationSlotWithResponseAsync(resourceGroupName, name, slot, mSDeploy); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - MSDeployStatusInner.class, - MSDeployStatusInner.class, - Context.NONE); - } - - /** - * Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param mSDeploy Details of MSDeploy operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, MSDeployStatusInner> beginCreateMSDeployOperationSlotAsync( - String resourceGroupName, String name, String slot, MSDeploy mSDeploy, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createMSDeployOperationSlotWithResponseAsync(resourceGroupName, name, slot, mSDeploy, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), MSDeployStatusInner.class, MSDeployStatusInner.class, context); - } - - /** - * Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param mSDeploy Details of MSDeploy operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, MSDeployStatusInner> beginCreateMSDeployOperationSlot( - String resourceGroupName, String name, String slot, MSDeploy mSDeploy) { - return beginCreateMSDeployOperationSlotAsync(resourceGroupName, name, slot, mSDeploy).getSyncPoller(); - } - - /** - * Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param mSDeploy Details of MSDeploy operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, MSDeployStatusInner> beginCreateMSDeployOperationSlot( - String resourceGroupName, String name, String slot, MSDeploy mSDeploy, Context context) { - return beginCreateMSDeployOperationSlotAsync(resourceGroupName, name, slot, mSDeploy, context).getSyncPoller(); - } - - /** - * Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param mSDeploy Details of MSDeploy operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createMSDeployOperationSlotAsync( - String resourceGroupName, String name, String slot, MSDeploy mSDeploy) { - return beginCreateMSDeployOperationSlotAsync(resourceGroupName, name, slot, mSDeploy) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param mSDeploy Details of MSDeploy operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createMSDeployOperationSlotAsync( - String resourceGroupName, String name, String slot, MSDeploy mSDeploy, Context context) { - return beginCreateMSDeployOperationSlotAsync(resourceGroupName, name, slot, mSDeploy, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param mSDeploy Details of MSDeploy operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public MSDeployStatusInner createMSDeployOperationSlot( - String resourceGroupName, String name, String slot, MSDeploy mSDeploy) { - return createMSDeployOperationSlotAsync(resourceGroupName, name, slot, mSDeploy).block(); - } - - /** - * Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param mSDeploy Details of MSDeploy operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public MSDeployStatusInner createMSDeployOperationSlot( - String resourceGroupName, String name, String slot, MSDeploy mSDeploy, Context context) { - return createMSDeployOperationSlotAsync(resourceGroupName, name, slot, mSDeploy, context).block(); - } - - /** - * Get the MSDeploy Log for the last MSDeploy operation. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the MSDeploy Log for the last MSDeploy operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getMSDeployLogSlotWithResponseAsync( - String resourceGroupName, String name, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getMSDeployLogSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the MSDeploy Log for the last MSDeploy operation. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the MSDeploy Log for the last MSDeploy operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getMSDeployLogSlotWithResponseAsync( - String resourceGroupName, String name, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getMSDeployLogSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Get the MSDeploy Log for the last MSDeploy operation. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the MSDeploy Log for the last MSDeploy operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getMSDeployLogSlotAsync(String resourceGroupName, String name, String slot) { - return getMSDeployLogSlotWithResponseAsync(resourceGroupName, name, slot) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get the MSDeploy Log for the last MSDeploy operation. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the MSDeploy Log for the last MSDeploy operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public MSDeployLogInner getMSDeployLogSlot(String resourceGroupName, String name, String slot) { - return getMSDeployLogSlotAsync(resourceGroupName, name, slot).block(); - } - - /** - * Get the MSDeploy Log for the last MSDeploy operation. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the MSDeploy Log for the last MSDeploy operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getMSDeployLogSlotWithResponse( - String resourceGroupName, String name, String slot, Context context) { - return getMSDeployLogSlotWithResponseAsync(resourceGroupName, name, slot, context).block(); - } - - /** - * List the functions for a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param slot Name of the deployment slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu function information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listInstanceFunctionsSlotSinglePageAsync( - String resourceGroupName, String name, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listInstanceFunctionsSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List the functions for a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param slot Name of the deployment slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu function information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listInstanceFunctionsSlotSinglePageAsync( - String resourceGroupName, String name, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listInstanceFunctionsSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * List the functions for a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param slot Name of the deployment slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu function information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listInstanceFunctionsSlotAsync( - String resourceGroupName, String name, String slot) { - return new PagedFlux<>( - () -> listInstanceFunctionsSlotSinglePageAsync(resourceGroupName, name, slot), - nextLink -> listInstanceFunctionsSlotNextSinglePageAsync(nextLink)); - } - - /** - * List the functions for a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param slot Name of the deployment slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu function information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listInstanceFunctionsSlotAsync( - String resourceGroupName, String name, String slot, Context context) { - return new PagedFlux<>( - () -> listInstanceFunctionsSlotSinglePageAsync(resourceGroupName, name, slot, context), - nextLink -> listInstanceFunctionsSlotNextSinglePageAsync(nextLink, context)); - } - - /** - * List the functions for a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param slot Name of the deployment slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu function information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listInstanceFunctionsSlot( - String resourceGroupName, String name, String slot) { - return new PagedIterable<>(listInstanceFunctionsSlotAsync(resourceGroupName, name, slot)); - } - - /** - * List the functions for a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param slot Name of the deployment slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu function information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listInstanceFunctionsSlot( - String resourceGroupName, String name, String slot, Context context) { - return new PagedIterable<>(listInstanceFunctionsSlotAsync(resourceGroupName, name, slot, context)); - } - - /** - * Fetch a short lived token that can be exchanged for a master key. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getFunctionsAdminTokenSlotWithResponseAsync( - String resourceGroupName, String name, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getFunctionsAdminTokenSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Fetch a short lived token that can be exchanged for a master key. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getFunctionsAdminTokenSlotWithResponseAsync( - String resourceGroupName, String name, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getFunctionsAdminTokenSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Fetch a short lived token that can be exchanged for a master key. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getFunctionsAdminTokenSlotAsync(String resourceGroupName, String name, String slot) { - return getFunctionsAdminTokenSlotWithResponseAsync(resourceGroupName, name, slot) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Fetch a short lived token that can be exchanged for a master key. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public String getFunctionsAdminTokenSlot(String resourceGroupName, String name, String slot) { - return getFunctionsAdminTokenSlotAsync(resourceGroupName, name, slot).block(); - } - - /** - * Fetch a short lived token that can be exchanged for a master key. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getFunctionsAdminTokenSlotWithResponse( - String resourceGroupName, String name, String slot, Context context) { - return getFunctionsAdminTokenSlotWithResponseAsync(resourceGroupName, name, slot, context).block(); - } - - /** - * Get function information by its ID for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param slot Name of the deployment slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function information by its ID for web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getInstanceFunctionSlotWithResponseAsync( - String resourceGroupName, String name, String functionName, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (functionName == null) { - return Mono.error(new IllegalArgumentException("Parameter functionName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getInstanceFunctionSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - functionName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get function information by its ID for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param slot Name of the deployment slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function information by its ID for web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getInstanceFunctionSlotWithResponseAsync( - String resourceGroupName, String name, String functionName, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (functionName == null) { - return Mono.error(new IllegalArgumentException("Parameter functionName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getInstanceFunctionSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - functionName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Get function information by its ID for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param slot Name of the deployment slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function information by its ID for web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getInstanceFunctionSlotAsync( - String resourceGroupName, String name, String functionName, String slot) { - return getInstanceFunctionSlotWithResponseAsync(resourceGroupName, name, functionName, slot) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get function information by its ID for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param slot Name of the deployment slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function information by its ID for web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public FunctionEnvelopeInner getInstanceFunctionSlot( - String resourceGroupName, String name, String functionName, String slot) { - return getInstanceFunctionSlotAsync(resourceGroupName, name, functionName, slot).block(); - } - - /** - * Get function information by its ID for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param slot Name of the deployment slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function information by its ID for web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getInstanceFunctionSlotWithResponse( - String resourceGroupName, String name, String functionName, String slot, Context context) { - return getInstanceFunctionSlotWithResponseAsync(resourceGroupName, name, functionName, slot, context).block(); - } - - /** - * Create function for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param slot Name of the deployment slot. - * @param functionEnvelope Function details. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createInstanceFunctionSlotWithResponseAsync( - String resourceGroupName, - String name, - String functionName, - String slot, - FunctionEnvelopeInner functionEnvelope) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (functionName == null) { - return Mono.error(new IllegalArgumentException("Parameter functionName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (functionEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter functionEnvelope is required and cannot be null.")); - } else { - functionEnvelope.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createInstanceFunctionSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - functionName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - functionEnvelope, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create function for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param slot Name of the deployment slot. - * @param functionEnvelope Function details. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createInstanceFunctionSlotWithResponseAsync( - String resourceGroupName, - String name, - String functionName, - String slot, - FunctionEnvelopeInner functionEnvelope, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (functionName == null) { - return Mono.error(new IllegalArgumentException("Parameter functionName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (functionEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter functionEnvelope is required and cannot be null.")); - } else { - functionEnvelope.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createInstanceFunctionSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - functionName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - functionEnvelope, - accept, - context); - } - - /** - * Create function for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param slot Name of the deployment slot. - * @param functionEnvelope Function details. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, FunctionEnvelopeInner> beginCreateInstanceFunctionSlotAsync( - String resourceGroupName, - String name, - String functionName, - String slot, - FunctionEnvelopeInner functionEnvelope) { - Mono>> mono = - createInstanceFunctionSlotWithResponseAsync(resourceGroupName, name, functionName, slot, functionEnvelope); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - FunctionEnvelopeInner.class, - FunctionEnvelopeInner.class, - Context.NONE); - } - - /** - * Create function for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param slot Name of the deployment slot. - * @param functionEnvelope Function details. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, FunctionEnvelopeInner> beginCreateInstanceFunctionSlotAsync( - String resourceGroupName, - String name, - String functionName, - String slot, - FunctionEnvelopeInner functionEnvelope, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createInstanceFunctionSlotWithResponseAsync( - resourceGroupName, name, functionName, slot, functionEnvelope, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), FunctionEnvelopeInner.class, FunctionEnvelopeInner.class, context); - } - - /** - * Create function for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param slot Name of the deployment slot. - * @param functionEnvelope Function details. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, FunctionEnvelopeInner> beginCreateInstanceFunctionSlot( - String resourceGroupName, - String name, - String functionName, - String slot, - FunctionEnvelopeInner functionEnvelope) { - return beginCreateInstanceFunctionSlotAsync(resourceGroupName, name, functionName, slot, functionEnvelope) - .getSyncPoller(); - } - - /** - * Create function for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param slot Name of the deployment slot. - * @param functionEnvelope Function details. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, FunctionEnvelopeInner> beginCreateInstanceFunctionSlot( - String resourceGroupName, - String name, - String functionName, - String slot, - FunctionEnvelopeInner functionEnvelope, - Context context) { - return beginCreateInstanceFunctionSlotAsync( - resourceGroupName, name, functionName, slot, functionEnvelope, context) - .getSyncPoller(); - } - - /** - * Create function for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param slot Name of the deployment slot. - * @param functionEnvelope Function details. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createInstanceFunctionSlotAsync( - String resourceGroupName, - String name, - String functionName, - String slot, - FunctionEnvelopeInner functionEnvelope) { - return beginCreateInstanceFunctionSlotAsync(resourceGroupName, name, functionName, slot, functionEnvelope) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create function for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param slot Name of the deployment slot. - * @param functionEnvelope Function details. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createInstanceFunctionSlotAsync( - String resourceGroupName, - String name, - String functionName, - String slot, - FunctionEnvelopeInner functionEnvelope, - Context context) { - return beginCreateInstanceFunctionSlotAsync( - resourceGroupName, name, functionName, slot, functionEnvelope, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create function for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param slot Name of the deployment slot. - * @param functionEnvelope Function details. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public FunctionEnvelopeInner createInstanceFunctionSlot( - String resourceGroupName, - String name, - String functionName, - String slot, - FunctionEnvelopeInner functionEnvelope) { - return createInstanceFunctionSlotAsync(resourceGroupName, name, functionName, slot, functionEnvelope).block(); - } - - /** - * Create function for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param slot Name of the deployment slot. - * @param functionEnvelope Function details. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public FunctionEnvelopeInner createInstanceFunctionSlot( - String resourceGroupName, - String name, - String functionName, - String slot, - FunctionEnvelopeInner functionEnvelope, - Context context) { - return createInstanceFunctionSlotAsync(resourceGroupName, name, functionName, slot, functionEnvelope, context) - .block(); - } - - /** - * Delete a function for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param slot Name of the deployment slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteInstanceFunctionSlotWithResponseAsync( - String resourceGroupName, String name, String functionName, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (functionName == null) { - return Mono.error(new IllegalArgumentException("Parameter functionName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .deleteInstanceFunctionSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - functionName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete a function for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param slot Name of the deployment slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteInstanceFunctionSlotWithResponseAsync( - String resourceGroupName, String name, String functionName, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (functionName == null) { - return Mono.error(new IllegalArgumentException("Parameter functionName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .deleteInstanceFunctionSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - functionName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Delete a function for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param slot Name of the deployment slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteInstanceFunctionSlotAsync( - String resourceGroupName, String name, String functionName, String slot) { - return deleteInstanceFunctionSlotWithResponseAsync(resourceGroupName, name, functionName, slot) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Delete a function for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param slot Name of the deployment slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteInstanceFunctionSlot(String resourceGroupName, String name, String functionName, String slot) { - deleteInstanceFunctionSlotAsync(resourceGroupName, name, functionName, slot).block(); - } - - /** - * Delete a function for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param slot Name of the deployment slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteInstanceFunctionSlotWithResponse( - String resourceGroupName, String name, String functionName, String slot, Context context) { - return deleteInstanceFunctionSlotWithResponseAsync(resourceGroupName, name, functionName, slot, context) - .block(); - } - - /** - * Add or update a function secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName The name of the function. - * @param keyName The name of the key. - * @param slot Name of the deployment slot. - * @param key The key to create or update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function key info. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateFunctionSecretSlotWithResponseAsync( - String resourceGroupName, String name, String functionName, String keyName, String slot, KeyInfoInner key) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (functionName == null) { - return Mono.error(new IllegalArgumentException("Parameter functionName is required and cannot be null.")); - } - if (keyName == null) { - return Mono.error(new IllegalArgumentException("Parameter keyName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (key == null) { - return Mono.error(new IllegalArgumentException("Parameter key is required and cannot be null.")); - } else { - key.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdateFunctionSecretSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - functionName, - keyName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - key, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Add or update a function secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName The name of the function. - * @param keyName The name of the key. - * @param slot Name of the deployment slot. - * @param key The key to create or update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function key info. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateFunctionSecretSlotWithResponseAsync( - String resourceGroupName, - String name, - String functionName, - String keyName, - String slot, - KeyInfoInner key, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (functionName == null) { - return Mono.error(new IllegalArgumentException("Parameter functionName is required and cannot be null.")); - } - if (keyName == null) { - return Mono.error(new IllegalArgumentException("Parameter keyName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (key == null) { - return Mono.error(new IllegalArgumentException("Parameter key is required and cannot be null.")); - } else { - key.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdateFunctionSecretSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - functionName, - keyName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - key, - accept, - context); - } - - /** - * Add or update a function secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName The name of the function. - * @param keyName The name of the key. - * @param slot Name of the deployment slot. - * @param key The key to create or update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function key info. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateFunctionSecretSlotAsync( - String resourceGroupName, String name, String functionName, String keyName, String slot, KeyInfoInner key) { - return createOrUpdateFunctionSecretSlotWithResponseAsync( - resourceGroupName, name, functionName, keyName, slot, key) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Add or update a function secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName The name of the function. - * @param keyName The name of the key. - * @param slot Name of the deployment slot. - * @param key The key to create or update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function key info. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public KeyInfoInner createOrUpdateFunctionSecretSlot( - String resourceGroupName, String name, String functionName, String keyName, String slot, KeyInfoInner key) { - return createOrUpdateFunctionSecretSlotAsync(resourceGroupName, name, functionName, keyName, slot, key).block(); - } - - /** - * Add or update a function secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName The name of the function. - * @param keyName The name of the key. - * @param slot Name of the deployment slot. - * @param key The key to create or update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function key info. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateFunctionSecretSlotWithResponse( - String resourceGroupName, - String name, - String functionName, - String keyName, - String slot, - KeyInfoInner key, - Context context) { - return createOrUpdateFunctionSecretSlotWithResponseAsync( - resourceGroupName, name, functionName, keyName, slot, key, context) - .block(); - } - - /** - * Delete a function secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName The name of the function. - * @param keyName The name of the key. - * @param slot Name of the deployment slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteFunctionSecretSlotWithResponseAsync( - String resourceGroupName, String name, String functionName, String keyName, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (functionName == null) { - return Mono.error(new IllegalArgumentException("Parameter functionName is required and cannot be null.")); - } - if (keyName == null) { - return Mono.error(new IllegalArgumentException("Parameter keyName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .deleteFunctionSecretSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - functionName, - keyName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete a function secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName The name of the function. - * @param keyName The name of the key. - * @param slot Name of the deployment slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteFunctionSecretSlotWithResponseAsync( - String resourceGroupName, String name, String functionName, String keyName, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (functionName == null) { - return Mono.error(new IllegalArgumentException("Parameter functionName is required and cannot be null.")); - } - if (keyName == null) { - return Mono.error(new IllegalArgumentException("Parameter keyName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .deleteFunctionSecretSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - functionName, - keyName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Delete a function secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName The name of the function. - * @param keyName The name of the key. - * @param slot Name of the deployment slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteFunctionSecretSlotAsync( - String resourceGroupName, String name, String functionName, String keyName, String slot) { - return deleteFunctionSecretSlotWithResponseAsync(resourceGroupName, name, functionName, keyName, slot) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Delete a function secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName The name of the function. - * @param keyName The name of the key. - * @param slot Name of the deployment slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteFunctionSecretSlot( - String resourceGroupName, String name, String functionName, String keyName, String slot) { - deleteFunctionSecretSlotAsync(resourceGroupName, name, functionName, keyName, slot).block(); - } - - /** - * Delete a function secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName The name of the function. - * @param keyName The name of the key. - * @param slot Name of the deployment slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteFunctionSecretSlotWithResponse( - String resourceGroupName, String name, String functionName, String keyName, String slot, Context context) { - return deleteFunctionSecretSlotWithResponseAsync(resourceGroupName, name, functionName, keyName, slot, context) - .block(); - } - - /** - * Get function keys for a function in a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param slot Name of the deployment slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function keys for a function in a web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listFunctionKeysSlotWithResponseAsync( - String resourceGroupName, String name, String functionName, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (functionName == null) { - return Mono.error(new IllegalArgumentException("Parameter functionName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listFunctionKeysSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - functionName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get function keys for a function in a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param slot Name of the deployment slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function keys for a function in a web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listFunctionKeysSlotWithResponseAsync( - String resourceGroupName, String name, String functionName, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (functionName == null) { - return Mono.error(new IllegalArgumentException("Parameter functionName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listFunctionKeysSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - functionName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Get function keys for a function in a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param slot Name of the deployment slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function keys for a function in a web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listFunctionKeysSlotAsync( - String resourceGroupName, String name, String functionName, String slot) { - return listFunctionKeysSlotWithResponseAsync(resourceGroupName, name, functionName, slot) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get function keys for a function in a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param slot Name of the deployment slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function keys for a function in a web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public StringDictionaryInner listFunctionKeysSlot( - String resourceGroupName, String name, String functionName, String slot) { - return listFunctionKeysSlotAsync(resourceGroupName, name, functionName, slot).block(); - } - - /** - * Get function keys for a function in a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param slot Name of the deployment slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function keys for a function in a web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listFunctionKeysSlotWithResponse( - String resourceGroupName, String name, String functionName, String slot, Context context) { - return listFunctionKeysSlotWithResponseAsync(resourceGroupName, name, functionName, slot, context).block(); - } - - /** - * Get function secrets for a function in a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param slot Name of the deployment slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function secrets for a function in a web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listFunctionSecretsSlotWithResponseAsync( - String resourceGroupName, String name, String functionName, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (functionName == null) { - return Mono.error(new IllegalArgumentException("Parameter functionName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listFunctionSecretsSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - functionName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get function secrets for a function in a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param slot Name of the deployment slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function secrets for a function in a web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listFunctionSecretsSlotWithResponseAsync( - String resourceGroupName, String name, String functionName, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (functionName == null) { - return Mono.error(new IllegalArgumentException("Parameter functionName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listFunctionSecretsSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - functionName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Get function secrets for a function in a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param slot Name of the deployment slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function secrets for a function in a web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listFunctionSecretsSlotAsync( - String resourceGroupName, String name, String functionName, String slot) { - return listFunctionSecretsSlotWithResponseAsync(resourceGroupName, name, functionName, slot) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get function secrets for a function in a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param slot Name of the deployment slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function secrets for a function in a web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public FunctionSecretsInner listFunctionSecretsSlot( - String resourceGroupName, String name, String functionName, String slot) { - return listFunctionSecretsSlotAsync(resourceGroupName, name, functionName, slot).block(); - } - - /** - * Get function secrets for a function in a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param slot Name of the deployment slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function secrets for a function in a web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listFunctionSecretsSlotWithResponse( - String resourceGroupName, String name, String functionName, String slot, Context context) { - return listFunctionSecretsSlotWithResponseAsync(resourceGroupName, name, functionName, slot, context).block(); - } - - /** - * Get host secrets for a function app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param slot Name of the deployment slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return host secrets for a function app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listHostKeysSlotWithResponseAsync( - String resourceGroupName, String name, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listHostKeysSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get host secrets for a function app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param slot Name of the deployment slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return host secrets for a function app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listHostKeysSlotWithResponseAsync( - String resourceGroupName, String name, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listHostKeysSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Get host secrets for a function app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param slot Name of the deployment slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return host secrets for a function app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listHostKeysSlotAsync(String resourceGroupName, String name, String slot) { - return listHostKeysSlotWithResponseAsync(resourceGroupName, name, slot) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get host secrets for a function app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param slot Name of the deployment slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return host secrets for a function app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public HostKeysInner listHostKeysSlot(String resourceGroupName, String name, String slot) { - return listHostKeysSlotAsync(resourceGroupName, name, slot).block(); - } - - /** - * Get host secrets for a function app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param slot Name of the deployment slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return host secrets for a function app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listHostKeysSlotWithResponse( - String resourceGroupName, String name, String slot, Context context) { - return listHostKeysSlotWithResponseAsync(resourceGroupName, name, slot, context).block(); - } - - /** - * This is to allow calling via powershell and ARM template. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listSyncStatusSlotWithResponseAsync( - String resourceGroupName, String name, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listSyncStatusSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * This is to allow calling via powershell and ARM template. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSyncStatusSlotWithResponseAsync( - String resourceGroupName, String name, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listSyncStatusSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * This is to allow calling via powershell and ARM template. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listSyncStatusSlotAsync(String resourceGroupName, String name, String slot) { - return listSyncStatusSlotWithResponseAsync(resourceGroupName, name, slot) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * This is to allow calling via powershell and ARM template. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void listSyncStatusSlot(String resourceGroupName, String name, String slot) { - listSyncStatusSlotAsync(resourceGroupName, name, slot).block(); - } - - /** - * This is to allow calling via powershell and ARM template. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listSyncStatusSlotWithResponse( - String resourceGroupName, String name, String slot, Context context) { - return listSyncStatusSlotWithResponseAsync(resourceGroupName, name, slot, context).block(); - } - - /** - * Syncs function trigger metadata to the management database. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> syncFunctionsSlotWithResponseAsync(String resourceGroupName, String name, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .syncFunctionsSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Syncs function trigger metadata to the management database. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> syncFunctionsSlotWithResponseAsync( - String resourceGroupName, String name, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .syncFunctionsSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Syncs function trigger metadata to the management database. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono syncFunctionsSlotAsync(String resourceGroupName, String name, String slot) { - return syncFunctionsSlotWithResponseAsync(resourceGroupName, name, slot) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Syncs function trigger metadata to the management database. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void syncFunctionsSlot(String resourceGroupName, String name, String slot) { - syncFunctionsSlotAsync(resourceGroupName, name, slot).block(); - } - - /** - * Syncs function trigger metadata to the management database. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response syncFunctionsSlotWithResponse( - String resourceGroupName, String name, String slot, Context context) { - return syncFunctionsSlotWithResponseAsync(resourceGroupName, name, slot, context).block(); - } - - /** - * Add or update a host level secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param keyType The type of host key. - * @param keyName The name of the key. - * @param slot Name of the deployment slot. - * @param key The key to create or update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function key info. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateHostSecretSlotWithResponseAsync( - String resourceGroupName, String name, String keyType, String keyName, String slot, KeyInfoInner key) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (keyType == null) { - return Mono.error(new IllegalArgumentException("Parameter keyType is required and cannot be null.")); - } - if (keyName == null) { - return Mono.error(new IllegalArgumentException("Parameter keyName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (key == null) { - return Mono.error(new IllegalArgumentException("Parameter key is required and cannot be null.")); - } else { - key.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdateHostSecretSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - keyType, - keyName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - key, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Add or update a host level secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param keyType The type of host key. - * @param keyName The name of the key. - * @param slot Name of the deployment slot. - * @param key The key to create or update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function key info. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateHostSecretSlotWithResponseAsync( - String resourceGroupName, - String name, - String keyType, - String keyName, - String slot, - KeyInfoInner key, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (keyType == null) { - return Mono.error(new IllegalArgumentException("Parameter keyType is required and cannot be null.")); - } - if (keyName == null) { - return Mono.error(new IllegalArgumentException("Parameter keyName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (key == null) { - return Mono.error(new IllegalArgumentException("Parameter key is required and cannot be null.")); - } else { - key.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdateHostSecretSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - keyType, - keyName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - key, - accept, - context); - } - - /** - * Add or update a host level secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param keyType The type of host key. - * @param keyName The name of the key. - * @param slot Name of the deployment slot. - * @param key The key to create or update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function key info. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateHostSecretSlotAsync( - String resourceGroupName, String name, String keyType, String keyName, String slot, KeyInfoInner key) { - return createOrUpdateHostSecretSlotWithResponseAsync(resourceGroupName, name, keyType, keyName, slot, key) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Add or update a host level secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param keyType The type of host key. - * @param keyName The name of the key. - * @param slot Name of the deployment slot. - * @param key The key to create or update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function key info. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public KeyInfoInner createOrUpdateHostSecretSlot( - String resourceGroupName, String name, String keyType, String keyName, String slot, KeyInfoInner key) { - return createOrUpdateHostSecretSlotAsync(resourceGroupName, name, keyType, keyName, slot, key).block(); - } - - /** - * Add or update a host level secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param keyType The type of host key. - * @param keyName The name of the key. - * @param slot Name of the deployment slot. - * @param key The key to create or update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function key info. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateHostSecretSlotWithResponse( - String resourceGroupName, - String name, - String keyType, - String keyName, - String slot, - KeyInfoInner key, - Context context) { - return createOrUpdateHostSecretSlotWithResponseAsync( - resourceGroupName, name, keyType, keyName, slot, key, context) - .block(); - } - - /** - * Delete a host level secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param keyType The type of host key. - * @param keyName The name of the key. - * @param slot Name of the deployment slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteHostSecretSlotWithResponseAsync( - String resourceGroupName, String name, String keyType, String keyName, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (keyType == null) { - return Mono.error(new IllegalArgumentException("Parameter keyType is required and cannot be null.")); - } - if (keyName == null) { - return Mono.error(new IllegalArgumentException("Parameter keyName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .deleteHostSecretSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - keyType, - keyName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete a host level secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param keyType The type of host key. - * @param keyName The name of the key. - * @param slot Name of the deployment slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteHostSecretSlotWithResponseAsync( - String resourceGroupName, String name, String keyType, String keyName, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (keyType == null) { - return Mono.error(new IllegalArgumentException("Parameter keyType is required and cannot be null.")); - } - if (keyName == null) { - return Mono.error(new IllegalArgumentException("Parameter keyName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .deleteHostSecretSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - keyType, - keyName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Delete a host level secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param keyType The type of host key. - * @param keyName The name of the key. - * @param slot Name of the deployment slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteHostSecretSlotAsync( - String resourceGroupName, String name, String keyType, String keyName, String slot) { - return deleteHostSecretSlotWithResponseAsync(resourceGroupName, name, keyType, keyName, slot) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Delete a host level secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param keyType The type of host key. - * @param keyName The name of the key. - * @param slot Name of the deployment slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteHostSecretSlot( - String resourceGroupName, String name, String keyType, String keyName, String slot) { - deleteHostSecretSlotAsync(resourceGroupName, name, keyType, keyName, slot).block(); - } - - /** - * Delete a host level secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param keyType The type of host key. - * @param keyName The name of the key. - * @param slot Name of the deployment slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteHostSecretSlotWithResponse( - String resourceGroupName, String name, String keyType, String keyName, String slot, Context context) { - return deleteHostSecretSlotWithResponseAsync(resourceGroupName, name, keyType, keyName, slot, context).block(); - } - - /** - * Get hostname bindings for an app or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API gets hostname bindings for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hostname bindings for an app or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listHostnameBindingsSlotSinglePageAsync( - String resourceGroupName, String name, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listHostnameBindingsSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get hostname bindings for an app or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API gets hostname bindings for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hostname bindings for an app or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listHostnameBindingsSlotSinglePageAsync( - String resourceGroupName, String name, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listHostnameBindingsSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get hostname bindings for an app or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API gets hostname bindings for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hostname bindings for an app or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listHostnameBindingsSlotAsync( - String resourceGroupName, String name, String slot) { - return new PagedFlux<>( - () -> listHostnameBindingsSlotSinglePageAsync(resourceGroupName, name, slot), - nextLink -> listHostnameBindingsSlotNextSinglePageAsync(nextLink)); - } - - /** - * Get hostname bindings for an app or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API gets hostname bindings for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hostname bindings for an app or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listHostnameBindingsSlotAsync( - String resourceGroupName, String name, String slot, Context context) { - return new PagedFlux<>( - () -> listHostnameBindingsSlotSinglePageAsync(resourceGroupName, name, slot, context), - nextLink -> listHostnameBindingsSlotNextSinglePageAsync(nextLink, context)); - } - - /** - * Get hostname bindings for an app or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API gets hostname bindings for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hostname bindings for an app or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listHostnameBindingsSlot( - String resourceGroupName, String name, String slot) { - return new PagedIterable<>(listHostnameBindingsSlotAsync(resourceGroupName, name, slot)); - } - - /** - * Get hostname bindings for an app or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API gets hostname bindings for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hostname bindings for an app or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listHostnameBindingsSlot( - String resourceGroupName, String name, String slot, Context context) { - return new PagedIterable<>(listHostnameBindingsSlotAsync(resourceGroupName, name, slot, context)); - } - - /** - * Get the named hostname binding for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API the named binding for the production - * slot. - * @param hostname Hostname in the hostname binding. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the named hostname binding for an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getHostnameBindingSlotWithResponseAsync( - String resourceGroupName, String name, String slot, String hostname) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (hostname == null) { - return Mono.error(new IllegalArgumentException("Parameter hostname is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getHostnameBindingSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - hostname, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the named hostname binding for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API the named binding for the production - * slot. - * @param hostname Hostname in the hostname binding. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the named hostname binding for an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getHostnameBindingSlotWithResponseAsync( - String resourceGroupName, String name, String slot, String hostname, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (hostname == null) { - return Mono.error(new IllegalArgumentException("Parameter hostname is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getHostnameBindingSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - hostname, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Get the named hostname binding for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API the named binding for the production - * slot. - * @param hostname Hostname in the hostname binding. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the named hostname binding for an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getHostnameBindingSlotAsync( - String resourceGroupName, String name, String slot, String hostname) { - return getHostnameBindingSlotWithResponseAsync(resourceGroupName, name, slot, hostname) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get the named hostname binding for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API the named binding for the production - * slot. - * @param hostname Hostname in the hostname binding. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the named hostname binding for an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public HostnameBindingInner getHostnameBindingSlot( - String resourceGroupName, String name, String slot, String hostname) { - return getHostnameBindingSlotAsync(resourceGroupName, name, slot, hostname).block(); - } - - /** - * Get the named hostname binding for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API the named binding for the production - * slot. - * @param hostname Hostname in the hostname binding. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the named hostname binding for an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getHostnameBindingSlotWithResponse( - String resourceGroupName, String name, String slot, String hostname, Context context) { - return getHostnameBindingSlotWithResponseAsync(resourceGroupName, name, slot, hostname, context).block(); - } - - /** - * Creates a hostname binding for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param hostname Hostname in the hostname binding. - * @param slot Name of the deployment slot. If a slot is not specified, the API will create a binding for the - * production slot. - * @param hostnameBinding Binding details. This is the JSON representation of a HostNameBinding object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a hostname binding object. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateHostnameBindingSlotWithResponseAsync( - String resourceGroupName, String name, String hostname, String slot, HostnameBindingInner hostnameBinding) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (hostname == null) { - return Mono.error(new IllegalArgumentException("Parameter hostname is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (hostnameBinding == null) { - return Mono - .error(new IllegalArgumentException("Parameter hostnameBinding is required and cannot be null.")); - } else { - hostnameBinding.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdateHostnameBindingSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - hostname, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - hostnameBinding, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates a hostname binding for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param hostname Hostname in the hostname binding. - * @param slot Name of the deployment slot. If a slot is not specified, the API will create a binding for the - * production slot. - * @param hostnameBinding Binding details. This is the JSON representation of a HostNameBinding object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a hostname binding object. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateHostnameBindingSlotWithResponseAsync( - String resourceGroupName, - String name, - String hostname, - String slot, - HostnameBindingInner hostnameBinding, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (hostname == null) { - return Mono.error(new IllegalArgumentException("Parameter hostname is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (hostnameBinding == null) { - return Mono - .error(new IllegalArgumentException("Parameter hostnameBinding is required and cannot be null.")); - } else { - hostnameBinding.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdateHostnameBindingSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - hostname, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - hostnameBinding, - accept, - context); - } - - /** - * Creates a hostname binding for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param hostname Hostname in the hostname binding. - * @param slot Name of the deployment slot. If a slot is not specified, the API will create a binding for the - * production slot. - * @param hostnameBinding Binding details. This is the JSON representation of a HostNameBinding object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a hostname binding object. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateHostnameBindingSlotAsync( - String resourceGroupName, String name, String hostname, String slot, HostnameBindingInner hostnameBinding) { - return createOrUpdateHostnameBindingSlotWithResponseAsync( - resourceGroupName, name, hostname, slot, hostnameBinding) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates a hostname binding for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param hostname Hostname in the hostname binding. - * @param slot Name of the deployment slot. If a slot is not specified, the API will create a binding for the - * production slot. - * @param hostnameBinding Binding details. This is the JSON representation of a HostNameBinding object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a hostname binding object. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public HostnameBindingInner createOrUpdateHostnameBindingSlot( - String resourceGroupName, String name, String hostname, String slot, HostnameBindingInner hostnameBinding) { - return createOrUpdateHostnameBindingSlotAsync(resourceGroupName, name, hostname, slot, hostnameBinding).block(); - } - - /** - * Creates a hostname binding for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param hostname Hostname in the hostname binding. - * @param slot Name of the deployment slot. If a slot is not specified, the API will create a binding for the - * production slot. - * @param hostnameBinding Binding details. This is the JSON representation of a HostNameBinding object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a hostname binding object. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateHostnameBindingSlotWithResponse( - String resourceGroupName, - String name, - String hostname, - String slot, - HostnameBindingInner hostnameBinding, - Context context) { - return createOrUpdateHostnameBindingSlotWithResponseAsync( - resourceGroupName, name, hostname, slot, hostnameBinding, context) - .block(); - } - - /** - * Deletes a hostname binding for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the binding for the - * production slot. - * @param hostname Hostname in the hostname binding. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteHostnameBindingSlotWithResponseAsync( - String resourceGroupName, String name, String slot, String hostname) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (hostname == null) { - return Mono.error(new IllegalArgumentException("Parameter hostname is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .deleteHostnameBindingSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - hostname, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a hostname binding for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the binding for the - * production slot. - * @param hostname Hostname in the hostname binding. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteHostnameBindingSlotWithResponseAsync( - String resourceGroupName, String name, String slot, String hostname, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (hostname == null) { - return Mono.error(new IllegalArgumentException("Parameter hostname is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .deleteHostnameBindingSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - hostname, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Deletes a hostname binding for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the binding for the - * production slot. - * @param hostname Hostname in the hostname binding. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteHostnameBindingSlotAsync( - String resourceGroupName, String name, String slot, String hostname) { - return deleteHostnameBindingSlotWithResponseAsync(resourceGroupName, name, slot, hostname) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes a hostname binding for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the binding for the - * production slot. - * @param hostname Hostname in the hostname binding. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteHostnameBindingSlot(String resourceGroupName, String name, String slot, String hostname) { - deleteHostnameBindingSlotAsync(resourceGroupName, name, slot, hostname).block(); - } - - /** - * Deletes a hostname binding for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the binding for the - * production slot. - * @param hostname Hostname in the hostname binding. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteHostnameBindingSlotWithResponse( - String resourceGroupName, String name, String slot, String hostname, Context context) { - return deleteHostnameBindingSlotWithResponseAsync(resourceGroupName, name, slot, hostname, context).block(); - } - - /** - * Retrieves a specific Service Bus Hybrid Connection used by this Web App. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @param slot The name of the slot for the web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getHybridConnectionSlotWithResponseAsync( - String resourceGroupName, String name, String namespaceName, String relayName, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (relayName == null) { - return Mono.error(new IllegalArgumentException("Parameter relayName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getHybridConnectionSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - namespaceName, - relayName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Retrieves a specific Service Bus Hybrid Connection used by this Web App. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @param slot The name of the slot for the web app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getHybridConnectionSlotWithResponseAsync( - String resourceGroupName, String name, String namespaceName, String relayName, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (relayName == null) { - return Mono.error(new IllegalArgumentException("Parameter relayName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getHybridConnectionSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - namespaceName, - relayName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Retrieves a specific Service Bus Hybrid Connection used by this Web App. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @param slot The name of the slot for the web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getHybridConnectionSlotAsync( - String resourceGroupName, String name, String namespaceName, String relayName, String slot) { - return getHybridConnectionSlotWithResponseAsync(resourceGroupName, name, namespaceName, relayName, slot) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Retrieves a specific Service Bus Hybrid Connection used by this Web App. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @param slot The name of the slot for the web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public HybridConnectionInner getHybridConnectionSlot( - String resourceGroupName, String name, String namespaceName, String relayName, String slot) { - return getHybridConnectionSlotAsync(resourceGroupName, name, namespaceName, relayName, slot).block(); - } - - /** - * Retrieves a specific Service Bus Hybrid Connection used by this Web App. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @param slot The name of the slot for the web app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getHybridConnectionSlotWithResponse( - String resourceGroupName, String name, String namespaceName, String relayName, String slot, Context context) { - return getHybridConnectionSlotWithResponseAsync( - resourceGroupName, name, namespaceName, relayName, slot, context) - .block(); - } - - /** - * Creates a new Hybrid Connection using a Service Bus relay. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @param slot The name of the slot for the web app. - * @param connectionEnvelope The details of the hybrid connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateHybridConnectionSlotWithResponseAsync( - String resourceGroupName, - String name, - String namespaceName, - String relayName, - String slot, - HybridConnectionInner connectionEnvelope) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (relayName == null) { - return Mono.error(new IllegalArgumentException("Parameter relayName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (connectionEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter connectionEnvelope is required and cannot be null.")); - } else { - connectionEnvelope.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdateHybridConnectionSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - namespaceName, - relayName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - connectionEnvelope, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates a new Hybrid Connection using a Service Bus relay. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @param slot The name of the slot for the web app. - * @param connectionEnvelope The details of the hybrid connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateHybridConnectionSlotWithResponseAsync( - String resourceGroupName, - String name, - String namespaceName, - String relayName, - String slot, - HybridConnectionInner connectionEnvelope, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (relayName == null) { - return Mono.error(new IllegalArgumentException("Parameter relayName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (connectionEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter connectionEnvelope is required and cannot be null.")); - } else { - connectionEnvelope.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdateHybridConnectionSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - namespaceName, - relayName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - connectionEnvelope, - accept, - context); - } - - /** - * Creates a new Hybrid Connection using a Service Bus relay. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @param slot The name of the slot for the web app. - * @param connectionEnvelope The details of the hybrid connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateHybridConnectionSlotAsync( - String resourceGroupName, - String name, - String namespaceName, - String relayName, - String slot, - HybridConnectionInner connectionEnvelope) { - return createOrUpdateHybridConnectionSlotWithResponseAsync( - resourceGroupName, name, namespaceName, relayName, slot, connectionEnvelope) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates a new Hybrid Connection using a Service Bus relay. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @param slot The name of the slot for the web app. - * @param connectionEnvelope The details of the hybrid connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public HybridConnectionInner createOrUpdateHybridConnectionSlot( - String resourceGroupName, - String name, - String namespaceName, - String relayName, - String slot, - HybridConnectionInner connectionEnvelope) { - return createOrUpdateHybridConnectionSlotAsync( - resourceGroupName, name, namespaceName, relayName, slot, connectionEnvelope) - .block(); - } - - /** - * Creates a new Hybrid Connection using a Service Bus relay. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @param slot The name of the slot for the web app. - * @param connectionEnvelope The details of the hybrid connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateHybridConnectionSlotWithResponse( - String resourceGroupName, - String name, - String namespaceName, - String relayName, - String slot, - HybridConnectionInner connectionEnvelope, - Context context) { - return createOrUpdateHybridConnectionSlotWithResponseAsync( - resourceGroupName, name, namespaceName, relayName, slot, connectionEnvelope, context) - .block(); - } - - /** - * Removes a Hybrid Connection from this site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @param slot The name of the slot for the web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteHybridConnectionSlotWithResponseAsync( - String resourceGroupName, String name, String namespaceName, String relayName, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (relayName == null) { - return Mono.error(new IllegalArgumentException("Parameter relayName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .deleteHybridConnectionSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - namespaceName, - relayName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Removes a Hybrid Connection from this site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @param slot The name of the slot for the web app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteHybridConnectionSlotWithResponseAsync( - String resourceGroupName, String name, String namespaceName, String relayName, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (relayName == null) { - return Mono.error(new IllegalArgumentException("Parameter relayName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .deleteHybridConnectionSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - namespaceName, - relayName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Removes a Hybrid Connection from this site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @param slot The name of the slot for the web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteHybridConnectionSlotAsync( - String resourceGroupName, String name, String namespaceName, String relayName, String slot) { - return deleteHybridConnectionSlotWithResponseAsync(resourceGroupName, name, namespaceName, relayName, slot) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Removes a Hybrid Connection from this site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @param slot The name of the slot for the web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteHybridConnectionSlot( - String resourceGroupName, String name, String namespaceName, String relayName, String slot) { - deleteHybridConnectionSlotAsync(resourceGroupName, name, namespaceName, relayName, slot).block(); - } - - /** - * Removes a Hybrid Connection from this site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @param slot The name of the slot for the web app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteHybridConnectionSlotWithResponse( - String resourceGroupName, String name, String namespaceName, String relayName, String slot, Context context) { - return deleteHybridConnectionSlotWithResponseAsync( - resourceGroupName, name, namespaceName, relayName, slot, context) - .block(); - } - - /** - * Creates a new Hybrid Connection using a Service Bus relay. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @param slot The name of the slot for the web app. - * @param connectionEnvelope The details of the hybrid connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateHybridConnectionSlotWithResponseAsync( - String resourceGroupName, - String name, - String namespaceName, - String relayName, - String slot, - HybridConnectionInner connectionEnvelope) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (relayName == null) { - return Mono.error(new IllegalArgumentException("Parameter relayName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (connectionEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter connectionEnvelope is required and cannot be null.")); - } else { - connectionEnvelope.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updateHybridConnectionSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - namespaceName, - relayName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - connectionEnvelope, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates a new Hybrid Connection using a Service Bus relay. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @param slot The name of the slot for the web app. - * @param connectionEnvelope The details of the hybrid connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateHybridConnectionSlotWithResponseAsync( - String resourceGroupName, - String name, - String namespaceName, - String relayName, - String slot, - HybridConnectionInner connectionEnvelope, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (relayName == null) { - return Mono.error(new IllegalArgumentException("Parameter relayName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (connectionEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter connectionEnvelope is required and cannot be null.")); - } else { - connectionEnvelope.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updateHybridConnectionSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - namespaceName, - relayName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - connectionEnvelope, - accept, - context); - } - - /** - * Creates a new Hybrid Connection using a Service Bus relay. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @param slot The name of the slot for the web app. - * @param connectionEnvelope The details of the hybrid connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateHybridConnectionSlotAsync( - String resourceGroupName, - String name, - String namespaceName, - String relayName, - String slot, - HybridConnectionInner connectionEnvelope) { - return updateHybridConnectionSlotWithResponseAsync( - resourceGroupName, name, namespaceName, relayName, slot, connectionEnvelope) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates a new Hybrid Connection using a Service Bus relay. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @param slot The name of the slot for the web app. - * @param connectionEnvelope The details of the hybrid connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public HybridConnectionInner updateHybridConnectionSlot( - String resourceGroupName, - String name, - String namespaceName, - String relayName, - String slot, - HybridConnectionInner connectionEnvelope) { - return updateHybridConnectionSlotAsync( - resourceGroupName, name, namespaceName, relayName, slot, connectionEnvelope) - .block(); - } - - /** - * Creates a new Hybrid Connection using a Service Bus relay. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @param slot The name of the slot for the web app. - * @param connectionEnvelope The details of the hybrid connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateHybridConnectionSlotWithResponse( - String resourceGroupName, - String name, - String namespaceName, - String relayName, - String slot, - HybridConnectionInner connectionEnvelope, - Context context) { - return updateHybridConnectionSlotWithResponseAsync( - resourceGroupName, name, namespaceName, relayName, slot, connectionEnvelope, context) - .block(); - } - - /** - * Gets the send key name and value for a Hybrid Connection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @param slot The name of the slot for the web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the send key name and value for a Hybrid Connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listHybridConnectionKeysSlotWithResponseAsync( - String resourceGroupName, String name, String namespaceName, String relayName, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (relayName == null) { - return Mono.error(new IllegalArgumentException("Parameter relayName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listHybridConnectionKeysSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - namespaceName, - relayName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the send key name and value for a Hybrid Connection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @param slot The name of the slot for the web app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the send key name and value for a Hybrid Connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listHybridConnectionKeysSlotWithResponseAsync( - String resourceGroupName, String name, String namespaceName, String relayName, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (relayName == null) { - return Mono.error(new IllegalArgumentException("Parameter relayName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listHybridConnectionKeysSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - namespaceName, - relayName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets the send key name and value for a Hybrid Connection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @param slot The name of the slot for the web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the send key name and value for a Hybrid Connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listHybridConnectionKeysSlotAsync( - String resourceGroupName, String name, String namespaceName, String relayName, String slot) { - return listHybridConnectionKeysSlotWithResponseAsync(resourceGroupName, name, namespaceName, relayName, slot) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the send key name and value for a Hybrid Connection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @param slot The name of the slot for the web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the send key name and value for a Hybrid Connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public HybridConnectionKeyInner listHybridConnectionKeysSlot( - String resourceGroupName, String name, String namespaceName, String relayName, String slot) { - return listHybridConnectionKeysSlotAsync(resourceGroupName, name, namespaceName, relayName, slot).block(); - } - - /** - * Gets the send key name and value for a Hybrid Connection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param namespaceName The namespace for this hybrid connection. - * @param relayName The relay name for this hybrid connection. - * @param slot The name of the slot for the web app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the send key name and value for a Hybrid Connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listHybridConnectionKeysSlotWithResponse( - String resourceGroupName, String name, String namespaceName, String relayName, String slot, Context context) { - return listHybridConnectionKeysSlotWithResponseAsync( - resourceGroupName, name, namespaceName, relayName, slot, context) - .block(); - } - - /** - * Retrieves all Service Bus Hybrid Connections used by this Web App. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for the web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listHybridConnectionsSlotWithResponseAsync( - String resourceGroupName, String name, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listHybridConnectionsSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Retrieves all Service Bus Hybrid Connections used by this Web App. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for the web app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listHybridConnectionsSlotWithResponseAsync( - String resourceGroupName, String name, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listHybridConnectionsSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Retrieves all Service Bus Hybrid Connections used by this Web App. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for the web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listHybridConnectionsSlotAsync( - String resourceGroupName, String name, String slot) { - return listHybridConnectionsSlotWithResponseAsync(resourceGroupName, name, slot) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Retrieves all Service Bus Hybrid Connections used by this Web App. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for the web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public HybridConnectionInner listHybridConnectionsSlot(String resourceGroupName, String name, String slot) { - return listHybridConnectionsSlotAsync(resourceGroupName, name, slot).block(); - } - - /** - * Retrieves all Service Bus Hybrid Connections used by this Web App. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for the web app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listHybridConnectionsSlotWithResponse( - String resourceGroupName, String name, String slot, Context context) { - return listHybridConnectionsSlotWithResponseAsync(resourceGroupName, name, slot, context).block(); - } - - /** - * Gets hybrid connections configured for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get hybrid connections for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid connections configured for an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listRelayServiceConnectionsSlotWithResponseAsync( - String resourceGroupName, String name, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listRelayServiceConnectionsSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets hybrid connections configured for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get hybrid connections for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid connections configured for an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listRelayServiceConnectionsSlotWithResponseAsync( - String resourceGroupName, String name, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listRelayServiceConnectionsSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets hybrid connections configured for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get hybrid connections for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid connections configured for an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listRelayServiceConnectionsSlotAsync( - String resourceGroupName, String name, String slot) { - return listRelayServiceConnectionsSlotWithResponseAsync(resourceGroupName, name, slot) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets hybrid connections configured for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get hybrid connections for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid connections configured for an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RelayServiceConnectionEntityInner listRelayServiceConnectionsSlot( - String resourceGroupName, String name, String slot) { - return listRelayServiceConnectionsSlotAsync(resourceGroupName, name, slot).block(); - } - - /** - * Gets hybrid connections configured for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get hybrid connections for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid connections configured for an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listRelayServiceConnectionsSlotWithResponse( - String resourceGroupName, String name, String slot, Context context) { - return listRelayServiceConnectionsSlotWithResponseAsync(resourceGroupName, name, slot, context).block(); - } - - /** - * Gets a hybrid connection configuration by its name. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param entityName Name of the hybrid connection. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get a hybrid connection for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a hybrid connection configuration by its name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getRelayServiceConnectionSlotWithResponseAsync( - String resourceGroupName, String name, String entityName, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (entityName == null) { - return Mono.error(new IllegalArgumentException("Parameter entityName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getRelayServiceConnectionSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - entityName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a hybrid connection configuration by its name. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param entityName Name of the hybrid connection. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get a hybrid connection for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a hybrid connection configuration by its name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getRelayServiceConnectionSlotWithResponseAsync( - String resourceGroupName, String name, String entityName, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (entityName == null) { - return Mono.error(new IllegalArgumentException("Parameter entityName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getRelayServiceConnectionSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - entityName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets a hybrid connection configuration by its name. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param entityName Name of the hybrid connection. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get a hybrid connection for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a hybrid connection configuration by its name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getRelayServiceConnectionSlotAsync( - String resourceGroupName, String name, String entityName, String slot) { - return getRelayServiceConnectionSlotWithResponseAsync(resourceGroupName, name, entityName, slot) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a hybrid connection configuration by its name. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param entityName Name of the hybrid connection. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get a hybrid connection for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a hybrid connection configuration by its name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RelayServiceConnectionEntityInner getRelayServiceConnectionSlot( - String resourceGroupName, String name, String entityName, String slot) { - return getRelayServiceConnectionSlotAsync(resourceGroupName, name, entityName, slot).block(); - } - - /** - * Gets a hybrid connection configuration by its name. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param entityName Name of the hybrid connection. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get a hybrid connection for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a hybrid connection configuration by its name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getRelayServiceConnectionSlotWithResponse( - String resourceGroupName, String name, String entityName, String slot, Context context) { - return getRelayServiceConnectionSlotWithResponseAsync(resourceGroupName, name, entityName, slot, context) - .block(); - } - - /** - * Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param entityName Name of the hybrid connection configuration. - * @param slot Name of the deployment slot. If a slot is not specified, the API will create or update a hybrid - * connection for the production slot. - * @param connectionEnvelope Details of the hybrid connection configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection for an App Service app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateRelayServiceConnectionSlotWithResponseAsync( - String resourceGroupName, - String name, - String entityName, - String slot, - RelayServiceConnectionEntityInner connectionEnvelope) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (entityName == null) { - return Mono.error(new IllegalArgumentException("Parameter entityName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (connectionEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter connectionEnvelope is required and cannot be null.")); - } else { - connectionEnvelope.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdateRelayServiceConnectionSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - entityName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - connectionEnvelope, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param entityName Name of the hybrid connection configuration. - * @param slot Name of the deployment slot. If a slot is not specified, the API will create or update a hybrid - * connection for the production slot. - * @param connectionEnvelope Details of the hybrid connection configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection for an App Service app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateRelayServiceConnectionSlotWithResponseAsync( - String resourceGroupName, - String name, - String entityName, - String slot, - RelayServiceConnectionEntityInner connectionEnvelope, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (entityName == null) { - return Mono.error(new IllegalArgumentException("Parameter entityName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (connectionEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter connectionEnvelope is required and cannot be null.")); - } else { - connectionEnvelope.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdateRelayServiceConnectionSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - entityName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - connectionEnvelope, - accept, - context); - } - - /** - * Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param entityName Name of the hybrid connection configuration. - * @param slot Name of the deployment slot. If a slot is not specified, the API will create or update a hybrid - * connection for the production slot. - * @param connectionEnvelope Details of the hybrid connection configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection for an App Service app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateRelayServiceConnectionSlotAsync( - String resourceGroupName, - String name, - String entityName, - String slot, - RelayServiceConnectionEntityInner connectionEnvelope) { - return createOrUpdateRelayServiceConnectionSlotWithResponseAsync( - resourceGroupName, name, entityName, slot, connectionEnvelope) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param entityName Name of the hybrid connection configuration. - * @param slot Name of the deployment slot. If a slot is not specified, the API will create or update a hybrid - * connection for the production slot. - * @param connectionEnvelope Details of the hybrid connection configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection for an App Service app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RelayServiceConnectionEntityInner createOrUpdateRelayServiceConnectionSlot( - String resourceGroupName, - String name, - String entityName, - String slot, - RelayServiceConnectionEntityInner connectionEnvelope) { - return createOrUpdateRelayServiceConnectionSlotAsync( - resourceGroupName, name, entityName, slot, connectionEnvelope) - .block(); - } - - /** - * Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param entityName Name of the hybrid connection configuration. - * @param slot Name of the deployment slot. If a slot is not specified, the API will create or update a hybrid - * connection for the production slot. - * @param connectionEnvelope Details of the hybrid connection configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection for an App Service app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateRelayServiceConnectionSlotWithResponse( - String resourceGroupName, - String name, - String entityName, - String slot, - RelayServiceConnectionEntityInner connectionEnvelope, - Context context) { - return createOrUpdateRelayServiceConnectionSlotWithResponseAsync( - resourceGroupName, name, entityName, slot, connectionEnvelope, context) - .block(); - } - - /** - * Deletes a relay service connection by its name. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param entityName Name of the hybrid connection configuration. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete a hybrid connection for - * the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteRelayServiceConnectionSlotWithResponseAsync( - String resourceGroupName, String name, String entityName, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (entityName == null) { - return Mono.error(new IllegalArgumentException("Parameter entityName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .deleteRelayServiceConnectionSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - entityName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a relay service connection by its name. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param entityName Name of the hybrid connection configuration. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete a hybrid connection for - * the production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteRelayServiceConnectionSlotWithResponseAsync( - String resourceGroupName, String name, String entityName, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (entityName == null) { - return Mono.error(new IllegalArgumentException("Parameter entityName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .deleteRelayServiceConnectionSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - entityName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Deletes a relay service connection by its name. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param entityName Name of the hybrid connection configuration. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete a hybrid connection for - * the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteRelayServiceConnectionSlotAsync( - String resourceGroupName, String name, String entityName, String slot) { - return deleteRelayServiceConnectionSlotWithResponseAsync(resourceGroupName, name, entityName, slot) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes a relay service connection by its name. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param entityName Name of the hybrid connection configuration. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete a hybrid connection for - * the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteRelayServiceConnectionSlot( - String resourceGroupName, String name, String entityName, String slot) { - deleteRelayServiceConnectionSlotAsync(resourceGroupName, name, entityName, slot).block(); - } - - /** - * Deletes a relay service connection by its name. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param entityName Name of the hybrid connection configuration. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete a hybrid connection for - * the production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteRelayServiceConnectionSlotWithResponse( - String resourceGroupName, String name, String entityName, String slot, Context context) { - return deleteRelayServiceConnectionSlotWithResponseAsync(resourceGroupName, name, entityName, slot, context) - .block(); - } - - /** - * Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param entityName Name of the hybrid connection configuration. - * @param slot Name of the deployment slot. If a slot is not specified, the API will create or update a hybrid - * connection for the production slot. - * @param connectionEnvelope Details of the hybrid connection configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection for an App Service app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateRelayServiceConnectionSlotWithResponseAsync( - String resourceGroupName, - String name, - String entityName, - String slot, - RelayServiceConnectionEntityInner connectionEnvelope) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (entityName == null) { - return Mono.error(new IllegalArgumentException("Parameter entityName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (connectionEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter connectionEnvelope is required and cannot be null.")); - } else { - connectionEnvelope.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updateRelayServiceConnectionSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - entityName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - connectionEnvelope, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param entityName Name of the hybrid connection configuration. - * @param slot Name of the deployment slot. If a slot is not specified, the API will create or update a hybrid - * connection for the production slot. - * @param connectionEnvelope Details of the hybrid connection configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection for an App Service app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateRelayServiceConnectionSlotWithResponseAsync( - String resourceGroupName, - String name, - String entityName, - String slot, - RelayServiceConnectionEntityInner connectionEnvelope, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (entityName == null) { - return Mono.error(new IllegalArgumentException("Parameter entityName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (connectionEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter connectionEnvelope is required and cannot be null.")); - } else { - connectionEnvelope.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updateRelayServiceConnectionSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - entityName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - connectionEnvelope, - accept, - context); - } - - /** - * Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param entityName Name of the hybrid connection configuration. - * @param slot Name of the deployment slot. If a slot is not specified, the API will create or update a hybrid - * connection for the production slot. - * @param connectionEnvelope Details of the hybrid connection configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection for an App Service app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateRelayServiceConnectionSlotAsync( - String resourceGroupName, - String name, - String entityName, - String slot, - RelayServiceConnectionEntityInner connectionEnvelope) { - return updateRelayServiceConnectionSlotWithResponseAsync( - resourceGroupName, name, entityName, slot, connectionEnvelope) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param entityName Name of the hybrid connection configuration. - * @param slot Name of the deployment slot. If a slot is not specified, the API will create or update a hybrid - * connection for the production slot. - * @param connectionEnvelope Details of the hybrid connection configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection for an App Service app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RelayServiceConnectionEntityInner updateRelayServiceConnectionSlot( - String resourceGroupName, - String name, - String entityName, - String slot, - RelayServiceConnectionEntityInner connectionEnvelope) { - return updateRelayServiceConnectionSlotAsync(resourceGroupName, name, entityName, slot, connectionEnvelope) - .block(); - } - - /** - * Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param entityName Name of the hybrid connection configuration. - * @param slot Name of the deployment slot. If a slot is not specified, the API will create or update a hybrid - * connection for the production slot. - * @param connectionEnvelope Details of the hybrid connection configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hybrid Connection for an App Service app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateRelayServiceConnectionSlotWithResponse( - String resourceGroupName, - String name, - String entityName, - String slot, - RelayServiceConnectionEntityInner connectionEnvelope, - Context context) { - return updateRelayServiceConnectionSlotWithResponseAsync( - resourceGroupName, name, entityName, slot, connectionEnvelope, context) - .block(); - } - - /** - * Gets all scale-out instances of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API gets the production slot instances. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all scale-out instances of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listInstanceIdentifiersSlotSinglePageAsync( - String resourceGroupName, String name, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listInstanceIdentifiersSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all scale-out instances of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API gets the production slot instances. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all scale-out instances of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listInstanceIdentifiersSlotSinglePageAsync( - String resourceGroupName, String name, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listInstanceIdentifiersSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all scale-out instances of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API gets the production slot instances. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all scale-out instances of an app. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listInstanceIdentifiersSlotAsync( - String resourceGroupName, String name, String slot) { - return new PagedFlux<>( - () -> listInstanceIdentifiersSlotSinglePageAsync(resourceGroupName, name, slot), - nextLink -> listInstanceIdentifiersSlotNextSinglePageAsync(nextLink)); - } - - /** - * Gets all scale-out instances of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API gets the production slot instances. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all scale-out instances of an app. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listInstanceIdentifiersSlotAsync( - String resourceGroupName, String name, String slot, Context context) { - return new PagedFlux<>( - () -> listInstanceIdentifiersSlotSinglePageAsync(resourceGroupName, name, slot, context), - nextLink -> listInstanceIdentifiersSlotNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all scale-out instances of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API gets the production slot instances. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all scale-out instances of an app. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listInstanceIdentifiersSlot( - String resourceGroupName, String name, String slot) { - return new PagedIterable<>(listInstanceIdentifiersSlotAsync(resourceGroupName, name, slot)); - } - - /** - * Gets all scale-out instances of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API gets the production slot instances. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all scale-out instances of an app. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listInstanceIdentifiersSlot( - String resourceGroupName, String name, String slot, Context context) { - return new PagedIterable<>(listInstanceIdentifiersSlotAsync(resourceGroupName, name, slot, context)); - } - - /** - * Get the status of the last MSDeploy operation. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param instanceId ID of web app instance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of the last MSDeploy operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getInstanceMsDeployStatusSlotWithResponseAsync( - String resourceGroupName, String name, String slot, String instanceId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getInstanceMsDeployStatusSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - instanceId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the status of the last MSDeploy operation. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param instanceId ID of web app instance. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of the last MSDeploy operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getInstanceMsDeployStatusSlotWithResponseAsync( - String resourceGroupName, String name, String slot, String instanceId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getInstanceMsDeployStatusSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - instanceId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Get the status of the last MSDeploy operation. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param instanceId ID of web app instance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of the last MSDeploy operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getInstanceMsDeployStatusSlotAsync( - String resourceGroupName, String name, String slot, String instanceId) { - return getInstanceMsDeployStatusSlotWithResponseAsync(resourceGroupName, name, slot, instanceId) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get the status of the last MSDeploy operation. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param instanceId ID of web app instance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of the last MSDeploy operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public MSDeployStatusInner getInstanceMsDeployStatusSlot( - String resourceGroupName, String name, String slot, String instanceId) { - return getInstanceMsDeployStatusSlotAsync(resourceGroupName, name, slot, instanceId).block(); - } - - /** - * Get the status of the last MSDeploy operation. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param instanceId ID of web app instance. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of the last MSDeploy operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getInstanceMsDeployStatusSlotWithResponse( - String resourceGroupName, String name, String slot, String instanceId, Context context) { - return getInstanceMsDeployStatusSlotWithResponseAsync(resourceGroupName, name, slot, instanceId, context) - .block(); - } - - /** - * Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param instanceId ID of web app instance. - * @param mSDeploy Details of MSDeploy operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createInstanceMSDeployOperationSlotWithResponseAsync( - String resourceGroupName, String name, String slot, String instanceId, MSDeploy mSDeploy) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (mSDeploy == null) { - return Mono.error(new IllegalArgumentException("Parameter mSDeploy is required and cannot be null.")); - } else { - mSDeploy.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createInstanceMSDeployOperationSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - instanceId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - mSDeploy, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param instanceId ID of web app instance. - * @param mSDeploy Details of MSDeploy operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createInstanceMSDeployOperationSlotWithResponseAsync( - String resourceGroupName, String name, String slot, String instanceId, MSDeploy mSDeploy, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (mSDeploy == null) { - return Mono.error(new IllegalArgumentException("Parameter mSDeploy is required and cannot be null.")); - } else { - mSDeploy.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createInstanceMSDeployOperationSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - instanceId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - mSDeploy, - accept, - context); - } - - /** - * Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param instanceId ID of web app instance. - * @param mSDeploy Details of MSDeploy operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, MSDeployStatusInner> - beginCreateInstanceMSDeployOperationSlotAsync( - String resourceGroupName, String name, String slot, String instanceId, MSDeploy mSDeploy) { - Mono>> mono = - createInstanceMSDeployOperationSlotWithResponseAsync(resourceGroupName, name, slot, instanceId, mSDeploy); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - MSDeployStatusInner.class, - MSDeployStatusInner.class, - Context.NONE); - } - - /** - * Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param instanceId ID of web app instance. - * @param mSDeploy Details of MSDeploy operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, MSDeployStatusInner> - beginCreateInstanceMSDeployOperationSlotAsync( - String resourceGroupName, String name, String slot, String instanceId, MSDeploy mSDeploy, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createInstanceMSDeployOperationSlotWithResponseAsync( - resourceGroupName, name, slot, instanceId, mSDeploy, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), MSDeployStatusInner.class, MSDeployStatusInner.class, context); - } - - /** - * Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param instanceId ID of web app instance. - * @param mSDeploy Details of MSDeploy operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, MSDeployStatusInner> beginCreateInstanceMSDeployOperationSlot( - String resourceGroupName, String name, String slot, String instanceId, MSDeploy mSDeploy) { - return beginCreateInstanceMSDeployOperationSlotAsync(resourceGroupName, name, slot, instanceId, mSDeploy) - .getSyncPoller(); - } - - /** - * Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param instanceId ID of web app instance. - * @param mSDeploy Details of MSDeploy operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, MSDeployStatusInner> beginCreateInstanceMSDeployOperationSlot( - String resourceGroupName, String name, String slot, String instanceId, MSDeploy mSDeploy, Context context) { - return beginCreateInstanceMSDeployOperationSlotAsync( - resourceGroupName, name, slot, instanceId, mSDeploy, context) - .getSyncPoller(); - } - - /** - * Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param instanceId ID of web app instance. - * @param mSDeploy Details of MSDeploy operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createInstanceMSDeployOperationSlotAsync( - String resourceGroupName, String name, String slot, String instanceId, MSDeploy mSDeploy) { - return beginCreateInstanceMSDeployOperationSlotAsync(resourceGroupName, name, slot, instanceId, mSDeploy) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param instanceId ID of web app instance. - * @param mSDeploy Details of MSDeploy operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createInstanceMSDeployOperationSlotAsync( - String resourceGroupName, String name, String slot, String instanceId, MSDeploy mSDeploy, Context context) { - return beginCreateInstanceMSDeployOperationSlotAsync( - resourceGroupName, name, slot, instanceId, mSDeploy, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param instanceId ID of web app instance. - * @param mSDeploy Details of MSDeploy operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public MSDeployStatusInner createInstanceMSDeployOperationSlot( - String resourceGroupName, String name, String slot, String instanceId, MSDeploy mSDeploy) { - return createInstanceMSDeployOperationSlotAsync(resourceGroupName, name, slot, instanceId, mSDeploy).block(); - } - - /** - * Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param instanceId ID of web app instance. - * @param mSDeploy Details of MSDeploy operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public MSDeployStatusInner createInstanceMSDeployOperationSlot( - String resourceGroupName, String name, String slot, String instanceId, MSDeploy mSDeploy, Context context) { - return createInstanceMSDeployOperationSlotAsync(resourceGroupName, name, slot, instanceId, mSDeploy, context) - .block(); - } - - /** - * Get the MSDeploy Log for the last MSDeploy operation. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param instanceId ID of web app instance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the MSDeploy Log for the last MSDeploy operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getInstanceMSDeployLogSlotWithResponseAsync( - String resourceGroupName, String name, String slot, String instanceId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getInstanceMSDeployLogSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - instanceId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the MSDeploy Log for the last MSDeploy operation. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param instanceId ID of web app instance. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the MSDeploy Log for the last MSDeploy operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getInstanceMSDeployLogSlotWithResponseAsync( - String resourceGroupName, String name, String slot, String instanceId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getInstanceMSDeployLogSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - instanceId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Get the MSDeploy Log for the last MSDeploy operation. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param instanceId ID of web app instance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the MSDeploy Log for the last MSDeploy operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getInstanceMSDeployLogSlotAsync( - String resourceGroupName, String name, String slot, String instanceId) { - return getInstanceMSDeployLogSlotWithResponseAsync(resourceGroupName, name, slot, instanceId) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get the MSDeploy Log for the last MSDeploy operation. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param instanceId ID of web app instance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the MSDeploy Log for the last MSDeploy operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public MSDeployLogInner getInstanceMSDeployLogSlot( - String resourceGroupName, String name, String slot, String instanceId) { - return getInstanceMSDeployLogSlotAsync(resourceGroupName, name, slot, instanceId).block(); - } - - /** - * Get the MSDeploy Log for the last MSDeploy operation. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param instanceId ID of web app instance. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the MSDeploy Log for the last MSDeploy operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getInstanceMSDeployLogSlotWithResponse( - String resourceGroupName, String name, String slot, String instanceId, Context context) { - return getInstanceMSDeployLogSlotWithResponseAsync(resourceGroupName, name, slot, instanceId, context).block(); - } - - /** - * Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web - * site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listInstanceProcessesSlotSinglePageAsync( - String resourceGroupName, String name, String slot, String instanceId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listInstanceProcessesSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - instanceId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web - * site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listInstanceProcessesSlotSinglePageAsync( - String resourceGroupName, String name, String slot, String instanceId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listInstanceProcessesSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - instanceId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web - * site. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listInstanceProcessesSlotAsync( - String resourceGroupName, String name, String slot, String instanceId) { - return new PagedFlux<>( - () -> listInstanceProcessesSlotSinglePageAsync(resourceGroupName, name, slot, instanceId), - nextLink -> listInstanceProcessesSlotNextSinglePageAsync(nextLink)); - } - - /** - * Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web - * site. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listInstanceProcessesSlotAsync( - String resourceGroupName, String name, String slot, String instanceId, Context context) { - return new PagedFlux<>( - () -> listInstanceProcessesSlotSinglePageAsync(resourceGroupName, name, slot, instanceId, context), - nextLink -> listInstanceProcessesSlotNextSinglePageAsync(nextLink, context)); - } - - /** - * Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web - * site. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listInstanceProcessesSlot( - String resourceGroupName, String name, String slot, String instanceId) { - return new PagedIterable<>(listInstanceProcessesSlotAsync(resourceGroupName, name, slot, instanceId)); - } - - /** - * Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web - * site. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listInstanceProcessesSlot( - String resourceGroupName, String name, String slot, String instanceId, Context context) { - return new PagedIterable<>(listInstanceProcessesSlotAsync(resourceGroupName, name, slot, instanceId, context)); - } - - /** - * Get process information by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return process information by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getInstanceProcessSlotWithResponseAsync( - String resourceGroupName, String name, String processId, String slot, String instanceId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (processId == null) { - return Mono.error(new IllegalArgumentException("Parameter processId is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getInstanceProcessSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - processId, - slot, - instanceId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get process information by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return process information by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getInstanceProcessSlotWithResponseAsync( - String resourceGroupName, String name, String processId, String slot, String instanceId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (processId == null) { - return Mono.error(new IllegalArgumentException("Parameter processId is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getInstanceProcessSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - processId, - slot, - instanceId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Get process information by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return process information by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getInstanceProcessSlotAsync( - String resourceGroupName, String name, String processId, String slot, String instanceId) { - return getInstanceProcessSlotWithResponseAsync(resourceGroupName, name, processId, slot, instanceId) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get process information by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return process information by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ProcessInfoInner getInstanceProcessSlot( - String resourceGroupName, String name, String processId, String slot, String instanceId) { - return getInstanceProcessSlotAsync(resourceGroupName, name, processId, slot, instanceId).block(); - } - - /** - * Get process information by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return process information by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getInstanceProcessSlotWithResponse( - String resourceGroupName, String name, String processId, String slot, String instanceId, Context context) { - return getInstanceProcessSlotWithResponseAsync(resourceGroupName, name, processId, slot, instanceId, context) - .block(); - } - - /** - * Terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in a web - * site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteInstanceProcessSlotWithResponseAsync( - String resourceGroupName, String name, String processId, String slot, String instanceId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (processId == null) { - return Mono.error(new IllegalArgumentException("Parameter processId is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .deleteInstanceProcessSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - processId, - slot, - instanceId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in a web - * site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteInstanceProcessSlotWithResponseAsync( - String resourceGroupName, String name, String processId, String slot, String instanceId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (processId == null) { - return Mono.error(new IllegalArgumentException("Parameter processId is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .deleteInstanceProcessSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - processId, - slot, - instanceId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in a web - * site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteInstanceProcessSlotAsync( - String resourceGroupName, String name, String processId, String slot, String instanceId) { - return deleteInstanceProcessSlotWithResponseAsync(resourceGroupName, name, processId, slot, instanceId) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in a web - * site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteInstanceProcessSlot( - String resourceGroupName, String name, String processId, String slot, String instanceId) { - deleteInstanceProcessSlotAsync(resourceGroupName, name, processId, slot, instanceId).block(); - } - - /** - * Terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in a web - * site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteInstanceProcessSlotWithResponse( - String resourceGroupName, String name, String processId, String slot, String instanceId, Context context) { - return deleteInstanceProcessSlotWithResponseAsync(resourceGroupName, name, processId, slot, instanceId, context) - .block(); - } - - /** - * Get a memory dump of a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a memory dump of a process by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getInstanceProcessDumpSlotWithResponseAsync( - String resourceGroupName, String name, String processId, String slot, String instanceId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (processId == null) { - return Mono.error(new IllegalArgumentException("Parameter processId is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getInstanceProcessDumpSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - processId, - slot, - instanceId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a memory dump of a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a memory dump of a process by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getInstanceProcessDumpSlotWithResponseAsync( - String resourceGroupName, String name, String processId, String slot, String instanceId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (processId == null) { - return Mono.error(new IllegalArgumentException("Parameter processId is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getInstanceProcessDumpSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - processId, - slot, - instanceId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Get a memory dump of a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a memory dump of a process by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Flux getInstanceProcessDumpSlotAsync( - String resourceGroupName, String name, String processId, String slot, String instanceId) { - return getInstanceProcessDumpSlotWithResponseAsync(resourceGroupName, name, processId, slot, instanceId) - .flatMapMany(StreamResponse::getValue); - } - - /** - * Get a memory dump of a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a memory dump of a process by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public InputStream getInstanceProcessDumpSlot( - String resourceGroupName, String name, String processId, String slot, String instanceId) { - Iterator iterator = - getInstanceProcessDumpSlotAsync(resourceGroupName, name, processId, slot, instanceId) - .map(ByteBufferBackedInputStream::new) - .toStream() - .iterator(); - Enumeration enumeration = - new Enumeration() { - @Override - public boolean hasMoreElements() { - return iterator.hasNext(); - } - - @Override - public InputStream nextElement() { - return iterator.next(); - } - }; - return new SequenceInputStream(enumeration); - } - - /** - * Get a memory dump of a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a memory dump of a process by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public StreamResponse getInstanceProcessDumpSlotWithResponse( - String resourceGroupName, String name, String processId, String slot, String instanceId, Context context) { - return getInstanceProcessDumpSlotWithResponseAsync( - resourceGroupName, name, processId, slot, instanceId, context) - .block(); - } - - /** - * List module information for a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listInstanceProcessModulesSlotSinglePageAsync( - String resourceGroupName, String name, String processId, String slot, String instanceId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (processId == null) { - return Mono.error(new IllegalArgumentException("Parameter processId is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listInstanceProcessModulesSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - processId, - slot, - instanceId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List module information for a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listInstanceProcessModulesSlotSinglePageAsync( - String resourceGroupName, String name, String processId, String slot, String instanceId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (processId == null) { - return Mono.error(new IllegalArgumentException("Parameter processId is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listInstanceProcessModulesSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - processId, - slot, - instanceId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * List module information for a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listInstanceProcessModulesSlotAsync( - String resourceGroupName, String name, String processId, String slot, String instanceId) { - return new PagedFlux<>( - () -> listInstanceProcessModulesSlotSinglePageAsync(resourceGroupName, name, processId, slot, instanceId), - nextLink -> listInstanceProcessModulesSlotNextSinglePageAsync(nextLink)); - } - - /** - * List module information for a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listInstanceProcessModulesSlotAsync( - String resourceGroupName, String name, String processId, String slot, String instanceId, Context context) { - return new PagedFlux<>( - () -> - listInstanceProcessModulesSlotSinglePageAsync( - resourceGroupName, name, processId, slot, instanceId, context), - nextLink -> listInstanceProcessModulesSlotNextSinglePageAsync(nextLink, context)); - } - - /** - * List module information for a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listInstanceProcessModulesSlot( - String resourceGroupName, String name, String processId, String slot, String instanceId) { - return new PagedIterable<>( - listInstanceProcessModulesSlotAsync(resourceGroupName, name, processId, slot, instanceId)); - } - - /** - * List module information for a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listInstanceProcessModulesSlot( - String resourceGroupName, String name, String processId, String slot, String instanceId, Context context) { - return new PagedIterable<>( - listInstanceProcessModulesSlotAsync(resourceGroupName, name, processId, slot, instanceId, context)); - } - - /** - * Get process information by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param baseAddress Module base address. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return process information by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getInstanceProcessModuleSlotWithResponseAsync( - String resourceGroupName, String name, String processId, String baseAddress, String slot, String instanceId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (processId == null) { - return Mono.error(new IllegalArgumentException("Parameter processId is required and cannot be null.")); - } - if (baseAddress == null) { - return Mono.error(new IllegalArgumentException("Parameter baseAddress is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getInstanceProcessModuleSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - processId, - baseAddress, - slot, - instanceId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get process information by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param baseAddress Module base address. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return process information by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getInstanceProcessModuleSlotWithResponseAsync( - String resourceGroupName, - String name, - String processId, - String baseAddress, - String slot, - String instanceId, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (processId == null) { - return Mono.error(new IllegalArgumentException("Parameter processId is required and cannot be null.")); - } - if (baseAddress == null) { - return Mono.error(new IllegalArgumentException("Parameter baseAddress is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getInstanceProcessModuleSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - processId, - baseAddress, - slot, - instanceId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Get process information by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param baseAddress Module base address. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return process information by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getInstanceProcessModuleSlotAsync( - String resourceGroupName, String name, String processId, String baseAddress, String slot, String instanceId) { - return getInstanceProcessModuleSlotWithResponseAsync( - resourceGroupName, name, processId, baseAddress, slot, instanceId) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get process information by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param baseAddress Module base address. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return process information by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ProcessModuleInfoInner getInstanceProcessModuleSlot( - String resourceGroupName, String name, String processId, String baseAddress, String slot, String instanceId) { - return getInstanceProcessModuleSlotAsync(resourceGroupName, name, processId, baseAddress, slot, instanceId) - .block(); - } - - /** - * Get process information by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param baseAddress Module base address. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return process information by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getInstanceProcessModuleSlotWithResponse( - String resourceGroupName, - String name, - String processId, - String baseAddress, - String slot, - String instanceId, - Context context) { - return getInstanceProcessModuleSlotWithResponseAsync( - resourceGroupName, name, processId, baseAddress, slot, instanceId, context) - .block(); - } - - /** - * List the threads in a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listInstanceProcessThreadsSlotSinglePageAsync( - String resourceGroupName, String name, String processId, String slot, String instanceId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (processId == null) { - return Mono.error(new IllegalArgumentException("Parameter processId is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listInstanceProcessThreadsSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - processId, - slot, - instanceId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List the threads in a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listInstanceProcessThreadsSlotSinglePageAsync( - String resourceGroupName, String name, String processId, String slot, String instanceId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (processId == null) { - return Mono.error(new IllegalArgumentException("Parameter processId is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listInstanceProcessThreadsSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - processId, - slot, - instanceId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * List the threads in a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listInstanceProcessThreadsSlotAsync( - String resourceGroupName, String name, String processId, String slot, String instanceId) { - return new PagedFlux<>( - () -> listInstanceProcessThreadsSlotSinglePageAsync(resourceGroupName, name, processId, slot, instanceId), - nextLink -> listInstanceProcessThreadsSlotNextSinglePageAsync(nextLink)); - } - - /** - * List the threads in a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listInstanceProcessThreadsSlotAsync( - String resourceGroupName, String name, String processId, String slot, String instanceId, Context context) { - return new PagedFlux<>( - () -> - listInstanceProcessThreadsSlotSinglePageAsync( - resourceGroupName, name, processId, slot, instanceId, context), - nextLink -> listInstanceProcessThreadsSlotNextSinglePageAsync(nextLink, context)); - } - - /** - * List the threads in a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listInstanceProcessThreadsSlot( - String resourceGroupName, String name, String processId, String slot, String instanceId) { - return new PagedIterable<>( - listInstanceProcessThreadsSlotAsync(resourceGroupName, name, processId, slot, instanceId)); - } - - /** - * List the threads in a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listInstanceProcessThreadsSlot( - String resourceGroupName, String name, String processId, String slot, String instanceId, Context context) { - return new PagedIterable<>( - listInstanceProcessThreadsSlotAsync(resourceGroupName, name, processId, slot, instanceId, context)); - } - - /** - * Get thread information by Thread ID for a specific process, in a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param threadId TID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return thread information by Thread ID for a specific process, in a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getInstanceProcessThreadSlotWithResponseAsync( - String resourceGroupName, String name, String processId, String threadId, String slot, String instanceId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (processId == null) { - return Mono.error(new IllegalArgumentException("Parameter processId is required and cannot be null.")); - } - if (threadId == null) { - return Mono.error(new IllegalArgumentException("Parameter threadId is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getInstanceProcessThreadSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - processId, - threadId, - slot, - instanceId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get thread information by Thread ID for a specific process, in a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param threadId TID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return thread information by Thread ID for a specific process, in a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getInstanceProcessThreadSlotWithResponseAsync( - String resourceGroupName, - String name, - String processId, - String threadId, - String slot, - String instanceId, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (processId == null) { - return Mono.error(new IllegalArgumentException("Parameter processId is required and cannot be null.")); - } - if (threadId == null) { - return Mono.error(new IllegalArgumentException("Parameter threadId is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getInstanceProcessThreadSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - processId, - threadId, - slot, - instanceId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Get thread information by Thread ID for a specific process, in a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param threadId TID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return thread information by Thread ID for a specific process, in a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getInstanceProcessThreadSlotAsync( - String resourceGroupName, String name, String processId, String threadId, String slot, String instanceId) { - return getInstanceProcessThreadSlotWithResponseAsync( - resourceGroupName, name, processId, threadId, slot, instanceId) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get thread information by Thread ID for a specific process, in a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param threadId TID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return thread information by Thread ID for a specific process, in a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ProcessThreadInfoInner getInstanceProcessThreadSlot( - String resourceGroupName, String name, String processId, String threadId, String slot, String instanceId) { - return getInstanceProcessThreadSlotAsync(resourceGroupName, name, processId, threadId, slot, instanceId) - .block(); - } - - /** - * Get thread information by Thread ID for a specific process, in a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param threadId TID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param instanceId ID of a specific scaled-out instance. This is the value of the name property in the JSON - * response from "GET api/sites/{siteName}/instances". - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return thread information by Thread ID for a specific process, in a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getInstanceProcessThreadSlotWithResponse( - String resourceGroupName, - String name, - String processId, - String threadId, - String slot, - String instanceId, - Context context) { - return getInstanceProcessThreadSlotWithResponseAsync( - resourceGroupName, name, processId, threadId, slot, instanceId, context) - .block(); - } - - /** - * Shows whether an app can be cloned to another resource group or subscription. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. By default, this API returns information on the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents whether or not an app is cloneable. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> isCloneableSlotWithResponseAsync( - String resourceGroupName, String name, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .isCloneableSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Shows whether an app can be cloned to another resource group or subscription. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. By default, this API returns information on the production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents whether or not an app is cloneable. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> isCloneableSlotWithResponseAsync( - String resourceGroupName, String name, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .isCloneableSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Shows whether an app can be cloned to another resource group or subscription. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. By default, this API returns information on the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents whether or not an app is cloneable. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono isCloneableSlotAsync(String resourceGroupName, String name, String slot) { - return isCloneableSlotWithResponseAsync(resourceGroupName, name, slot) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Shows whether an app can be cloned to another resource group or subscription. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. By default, this API returns information on the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents whether or not an app is cloneable. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SiteCloneabilityInner isCloneableSlot(String resourceGroupName, String name, String slot) { - return isCloneableSlotAsync(resourceGroupName, name, slot).block(); - } - - /** - * Shows whether an app can be cloned to another resource group or subscription. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. By default, this API returns information on the production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents whether or not an app is cloneable. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response isCloneableSlotWithResponse( - String resourceGroupName, String name, String slot, Context context) { - return isCloneableSlotWithResponseAsync(resourceGroupName, name, slot, context).block(); - } - - /** - * This is to allow calling via powershell and ARM template. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function secrets. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listSyncFunctionTriggersSlotWithResponseAsync( - String resourceGroupName, String name, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listSyncFunctionTriggersSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * This is to allow calling via powershell and ARM template. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function secrets. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSyncFunctionTriggersSlotWithResponseAsync( - String resourceGroupName, String name, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listSyncFunctionTriggersSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * This is to allow calling via powershell and ARM template. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function secrets. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listSyncFunctionTriggersSlotAsync( - String resourceGroupName, String name, String slot) { - return listSyncFunctionTriggersSlotWithResponseAsync(resourceGroupName, name, slot) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * This is to allow calling via powershell and ARM template. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function secrets. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public FunctionSecretsInner listSyncFunctionTriggersSlot(String resourceGroupName, String name, String slot) { - return listSyncFunctionTriggersSlotAsync(resourceGroupName, name, slot).block(); - } - - /** - * This is to allow calling via powershell and ARM template. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function secrets. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listSyncFunctionTriggersSlotWithResponse( - String resourceGroupName, String name, String slot, Context context) { - return listSyncFunctionTriggersSlotWithResponseAsync(resourceGroupName, name, slot, context).block(); - } - - /** - * Gets all metric definitions of an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get metric definitions of the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all metric definitions of an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listMetricDefinitionsSlotSinglePageAsync( - String resourceGroupName, String name, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listMetricDefinitionsSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all metric definitions of an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get metric definitions of the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all metric definitions of an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listMetricDefinitionsSlotSinglePageAsync( - String resourceGroupName, String name, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listMetricDefinitionsSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all metric definitions of an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get metric definitions of the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all metric definitions of an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listMetricDefinitionsSlotAsync( - String resourceGroupName, String name, String slot) { - return new PagedFlux<>( - () -> listMetricDefinitionsSlotSinglePageAsync(resourceGroupName, name, slot), - nextLink -> listMetricDefinitionsSlotNextSinglePageAsync(nextLink)); - } - - /** - * Gets all metric definitions of an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get metric definitions of the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all metric definitions of an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listMetricDefinitionsSlotAsync( - String resourceGroupName, String name, String slot, Context context) { - return new PagedFlux<>( - () -> listMetricDefinitionsSlotSinglePageAsync(resourceGroupName, name, slot, context), - nextLink -> listMetricDefinitionsSlotNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all metric definitions of an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get metric definitions of the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all metric definitions of an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listMetricDefinitionsSlot( - String resourceGroupName, String name, String slot) { - return new PagedIterable<>(listMetricDefinitionsSlotAsync(resourceGroupName, name, slot)); - } - - /** - * Gets all metric definitions of an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get metric definitions of the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all metric definitions of an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listMetricDefinitionsSlot( - String resourceGroupName, String name, String slot, Context context) { - return new PagedIterable<>(listMetricDefinitionsSlotAsync(resourceGroupName, name, slot, context)); - } - - /** - * Gets performance metrics of an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get metrics of the production - * slot. - * @param details Specify "true" to include metric details in the response. It is "false" by default. - * @param filter Return only metrics specified in the filter (using OData syntax). For example: $filter=(name.value - * eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and endTime eq - * 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return performance metrics of an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listMetricsSlotSinglePageAsync( - String resourceGroupName, String name, String slot, Boolean details, String filter) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listMetricsSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - details, - filter, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets performance metrics of an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get metrics of the production - * slot. - * @param details Specify "true" to include metric details in the response. It is "false" by default. - * @param filter Return only metrics specified in the filter (using OData syntax). For example: $filter=(name.value - * eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and endTime eq - * 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return performance metrics of an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listMetricsSlotSinglePageAsync( - String resourceGroupName, String name, String slot, Boolean details, String filter, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listMetricsSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - details, - filter, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets performance metrics of an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get metrics of the production - * slot. - * @param details Specify "true" to include metric details in the response. It is "false" by default. - * @param filter Return only metrics specified in the filter (using OData syntax). For example: $filter=(name.value - * eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and endTime eq - * 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return performance metrics of an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listMetricsSlotAsync( - String resourceGroupName, String name, String slot, Boolean details, String filter) { - return new PagedFlux<>( - () -> listMetricsSlotSinglePageAsync(resourceGroupName, name, slot, details, filter), - nextLink -> listMetricsSlotNextSinglePageAsync(nextLink)); - } - - /** - * Gets performance metrics of an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get metrics of the production - * slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return performance metrics of an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listMetricsSlotAsync(String resourceGroupName, String name, String slot) { - final Boolean details = null; - final String filter = null; - return new PagedFlux<>( - () -> listMetricsSlotSinglePageAsync(resourceGroupName, name, slot, details, filter), - nextLink -> listMetricsSlotNextSinglePageAsync(nextLink)); - } - - /** - * Gets performance metrics of an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get metrics of the production - * slot. - * @param details Specify "true" to include metric details in the response. It is "false" by default. - * @param filter Return only metrics specified in the filter (using OData syntax). For example: $filter=(name.value - * eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and endTime eq - * 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return performance metrics of an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listMetricsSlotAsync( - String resourceGroupName, String name, String slot, Boolean details, String filter, Context context) { - return new PagedFlux<>( - () -> listMetricsSlotSinglePageAsync(resourceGroupName, name, slot, details, filter, context), - nextLink -> listMetricsSlotNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets performance metrics of an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get metrics of the production - * slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return performance metrics of an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listMetricsSlot(String resourceGroupName, String name, String slot) { - final Boolean details = null; - final String filter = null; - return new PagedIterable<>(listMetricsSlotAsync(resourceGroupName, name, slot, details, filter)); - } - - /** - * Gets performance metrics of an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get metrics of the production - * slot. - * @param details Specify "true" to include metric details in the response. It is "false" by default. - * @param filter Return only metrics specified in the filter (using OData syntax). For example: $filter=(name.value - * eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and endTime eq - * 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return performance metrics of an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listMetricsSlot( - String resourceGroupName, String name, String slot, Boolean details, String filter, Context context) { - return new PagedIterable<>(listMetricsSlotAsync(resourceGroupName, name, slot, details, filter, context)); - } - - /** - * Returns the status of MySql in app migration, if one is active, and whether or not MySql in app is enabled. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of the deployment slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mySQL migration status. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getMigrateMySqlStatusSlotWithResponseAsync( - String resourceGroupName, String name, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getMigrateMySqlStatusSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns the status of MySql in app migration, if one is active, and whether or not MySql in app is enabled. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of the deployment slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mySQL migration status. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getMigrateMySqlStatusSlotWithResponseAsync( - String resourceGroupName, String name, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getMigrateMySqlStatusSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Returns the status of MySql in app migration, if one is active, and whether or not MySql in app is enabled. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of the deployment slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mySQL migration status. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getMigrateMySqlStatusSlotAsync( - String resourceGroupName, String name, String slot) { - return getMigrateMySqlStatusSlotWithResponseAsync(resourceGroupName, name, slot) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Returns the status of MySql in app migration, if one is active, and whether or not MySql in app is enabled. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of the deployment slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mySQL migration status. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public MigrateMySqlStatusInner getMigrateMySqlStatusSlot(String resourceGroupName, String name, String slot) { - return getMigrateMySqlStatusSlotAsync(resourceGroupName, name, slot).block(); - } - - /** - * Returns the status of MySql in app migration, if one is active, and whether or not MySql in app is enabled. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of the deployment slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mySQL migration status. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getMigrateMySqlStatusSlotWithResponse( - String resourceGroupName, String name, String slot, Context context) { - return getMigrateMySqlStatusSlotWithResponseAsync(resourceGroupName, name, slot, context).block(); - } - - /** - * Gets a Swift Virtual Network connection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get a gateway for the - * production slot's Virtual Network. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Swift Virtual Network connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getSwiftVirtualNetworkConnectionSlotWithResponseAsync( - String resourceGroupName, String name, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getSwiftVirtualNetworkConnectionSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a Swift Virtual Network connection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get a gateway for the - * production slot's Virtual Network. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Swift Virtual Network connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getSwiftVirtualNetworkConnectionSlotWithResponseAsync( - String resourceGroupName, String name, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getSwiftVirtualNetworkConnectionSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets a Swift Virtual Network connection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get a gateway for the - * production slot's Virtual Network. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Swift Virtual Network connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getSwiftVirtualNetworkConnectionSlotAsync( - String resourceGroupName, String name, String slot) { - return getSwiftVirtualNetworkConnectionSlotWithResponseAsync(resourceGroupName, name, slot) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a Swift Virtual Network connection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get a gateway for the - * production slot's Virtual Network. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Swift Virtual Network connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SwiftVirtualNetworkInner getSwiftVirtualNetworkConnectionSlot( - String resourceGroupName, String name, String slot) { - return getSwiftVirtualNetworkConnectionSlotAsync(resourceGroupName, name, slot).block(); - } - - /** - * Gets a Swift Virtual Network connection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get a gateway for the - * production slot's Virtual Network. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Swift Virtual Network connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getSwiftVirtualNetworkConnectionSlotWithResponse( - String resourceGroupName, String name, String slot, Context context) { - return getSwiftVirtualNetworkConnectionSlotWithResponseAsync(resourceGroupName, name, slot, context).block(); - } - - /** - * Integrates this Web App with a Virtual Network. This requires that 1) "swiftSupported" is true when doing a GET - * against this resource, and 2) that the target Subnet has already been delegated, and is not in use by another App - * Service Plan other than the one this App is in. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will add or update connections for - * the production slot. - * @param connectionEnvelope Properties of the Virtual Network connection. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return swift Virtual Network Contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateSwiftVirtualNetworkConnectionSlotWithResponseAsync( - String resourceGroupName, String name, String slot, SwiftVirtualNetworkInner connectionEnvelope) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (connectionEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter connectionEnvelope is required and cannot be null.")); - } else { - connectionEnvelope.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdateSwiftVirtualNetworkConnectionSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - connectionEnvelope, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Integrates this Web App with a Virtual Network. This requires that 1) "swiftSupported" is true when doing a GET - * against this resource, and 2) that the target Subnet has already been delegated, and is not in use by another App - * Service Plan other than the one this App is in. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will add or update connections for - * the production slot. - * @param connectionEnvelope Properties of the Virtual Network connection. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return swift Virtual Network Contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateSwiftVirtualNetworkConnectionSlotWithResponseAsync( - String resourceGroupName, - String name, - String slot, - SwiftVirtualNetworkInner connectionEnvelope, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (connectionEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter connectionEnvelope is required and cannot be null.")); - } else { - connectionEnvelope.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdateSwiftVirtualNetworkConnectionSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - connectionEnvelope, - accept, - context); - } - - /** - * Integrates this Web App with a Virtual Network. This requires that 1) "swiftSupported" is true when doing a GET - * against this resource, and 2) that the target Subnet has already been delegated, and is not in use by another App - * Service Plan other than the one this App is in. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will add or update connections for - * the production slot. - * @param connectionEnvelope Properties of the Virtual Network connection. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return swift Virtual Network Contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateSwiftVirtualNetworkConnectionSlotAsync( - String resourceGroupName, String name, String slot, SwiftVirtualNetworkInner connectionEnvelope) { - return createOrUpdateSwiftVirtualNetworkConnectionSlotWithResponseAsync( - resourceGroupName, name, slot, connectionEnvelope) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Integrates this Web App with a Virtual Network. This requires that 1) "swiftSupported" is true when doing a GET - * against this resource, and 2) that the target Subnet has already been delegated, and is not in use by another App - * Service Plan other than the one this App is in. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will add or update connections for - * the production slot. - * @param connectionEnvelope Properties of the Virtual Network connection. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return swift Virtual Network Contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SwiftVirtualNetworkInner createOrUpdateSwiftVirtualNetworkConnectionSlot( - String resourceGroupName, String name, String slot, SwiftVirtualNetworkInner connectionEnvelope) { - return createOrUpdateSwiftVirtualNetworkConnectionSlotAsync(resourceGroupName, name, slot, connectionEnvelope) - .block(); - } - - /** - * Integrates this Web App with a Virtual Network. This requires that 1) "swiftSupported" is true when doing a GET - * against this resource, and 2) that the target Subnet has already been delegated, and is not in use by another App - * Service Plan other than the one this App is in. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will add or update connections for - * the production slot. - * @param connectionEnvelope Properties of the Virtual Network connection. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return swift Virtual Network Contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateSwiftVirtualNetworkConnectionSlotWithResponse( - String resourceGroupName, - String name, - String slot, - SwiftVirtualNetworkInner connectionEnvelope, - Context context) { - return createOrUpdateSwiftVirtualNetworkConnectionSlotWithResponseAsync( - resourceGroupName, name, slot, connectionEnvelope, context) - .block(); - } - - /** - * Deletes a Swift Virtual Network connection from an app (or deployment slot). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the connection for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteSwiftVirtualNetworkSlotWithResponseAsync( - String resourceGroupName, String name, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .deleteSwiftVirtualNetworkSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a Swift Virtual Network connection from an app (or deployment slot). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the connection for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteSwiftVirtualNetworkSlotWithResponseAsync( - String resourceGroupName, String name, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .deleteSwiftVirtualNetworkSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Deletes a Swift Virtual Network connection from an app (or deployment slot). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the connection for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteSwiftVirtualNetworkSlotAsync(String resourceGroupName, String name, String slot) { - return deleteSwiftVirtualNetworkSlotWithResponseAsync(resourceGroupName, name, slot) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes a Swift Virtual Network connection from an app (or deployment slot). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the connection for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteSwiftVirtualNetworkSlot(String resourceGroupName, String name, String slot) { - deleteSwiftVirtualNetworkSlotAsync(resourceGroupName, name, slot).block(); - } - - /** - * Deletes a Swift Virtual Network connection from an app (or deployment slot). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the connection for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteSwiftVirtualNetworkSlotWithResponse( - String resourceGroupName, String name, String slot, Context context) { - return deleteSwiftVirtualNetworkSlotWithResponseAsync(resourceGroupName, name, slot, context).block(); - } - - /** - * Integrates this Web App with a Virtual Network. This requires that 1) "swiftSupported" is true when doing a GET - * against this resource, and 2) that the target Subnet has already been delegated, and is not in use by another App - * Service Plan other than the one this App is in. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will add or update connections for - * the production slot. - * @param connectionEnvelope Properties of the Virtual Network connection. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return swift Virtual Network Contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateSwiftVirtualNetworkConnectionSlotWithResponseAsync( - String resourceGroupName, String name, String slot, SwiftVirtualNetworkInner connectionEnvelope) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (connectionEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter connectionEnvelope is required and cannot be null.")); - } else { - connectionEnvelope.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updateSwiftVirtualNetworkConnectionSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - connectionEnvelope, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Integrates this Web App with a Virtual Network. This requires that 1) "swiftSupported" is true when doing a GET - * against this resource, and 2) that the target Subnet has already been delegated, and is not in use by another App - * Service Plan other than the one this App is in. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will add or update connections for - * the production slot. - * @param connectionEnvelope Properties of the Virtual Network connection. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return swift Virtual Network Contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateSwiftVirtualNetworkConnectionSlotWithResponseAsync( - String resourceGroupName, - String name, - String slot, - SwiftVirtualNetworkInner connectionEnvelope, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (connectionEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter connectionEnvelope is required and cannot be null.")); - } else { - connectionEnvelope.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updateSwiftVirtualNetworkConnectionSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - connectionEnvelope, - accept, - context); - } - - /** - * Integrates this Web App with a Virtual Network. This requires that 1) "swiftSupported" is true when doing a GET - * against this resource, and 2) that the target Subnet has already been delegated, and is not in use by another App - * Service Plan other than the one this App is in. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will add or update connections for - * the production slot. - * @param connectionEnvelope Properties of the Virtual Network connection. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return swift Virtual Network Contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateSwiftVirtualNetworkConnectionSlotAsync( - String resourceGroupName, String name, String slot, SwiftVirtualNetworkInner connectionEnvelope) { - return updateSwiftVirtualNetworkConnectionSlotWithResponseAsync( - resourceGroupName, name, slot, connectionEnvelope) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Integrates this Web App with a Virtual Network. This requires that 1) "swiftSupported" is true when doing a GET - * against this resource, and 2) that the target Subnet has already been delegated, and is not in use by another App - * Service Plan other than the one this App is in. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will add or update connections for - * the production slot. - * @param connectionEnvelope Properties of the Virtual Network connection. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return swift Virtual Network Contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SwiftVirtualNetworkInner updateSwiftVirtualNetworkConnectionSlot( - String resourceGroupName, String name, String slot, SwiftVirtualNetworkInner connectionEnvelope) { - return updateSwiftVirtualNetworkConnectionSlotAsync(resourceGroupName, name, slot, connectionEnvelope).block(); - } - - /** - * Integrates this Web App with a Virtual Network. This requires that 1) "swiftSupported" is true when doing a GET - * against this resource, and 2) that the target Subnet has already been delegated, and is not in use by another App - * Service Plan other than the one this App is in. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will add or update connections for - * the production slot. - * @param connectionEnvelope Properties of the Virtual Network connection. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return swift Virtual Network Contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateSwiftVirtualNetworkConnectionSlotWithResponse( - String resourceGroupName, - String name, - String slot, - SwiftVirtualNetworkInner connectionEnvelope, - Context context) { - return updateSwiftVirtualNetworkConnectionSlotWithResponseAsync( - resourceGroupName, name, slot, connectionEnvelope, context) - .block(); - } - - /** - * Gets all network features used by the app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param view The type of view. This can either be "summary" or "detailed". - * @param slot Name of the deployment slot. If a slot is not specified, the API will get network features for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network features used by the app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listNetworkFeaturesSlotWithResponseAsync( - String resourceGroupName, String name, String view, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (view == null) { - return Mono.error(new IllegalArgumentException("Parameter view is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listNetworkFeaturesSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - view, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all network features used by the app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param view The type of view. This can either be "summary" or "detailed". - * @param slot Name of the deployment slot. If a slot is not specified, the API will get network features for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network features used by the app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNetworkFeaturesSlotWithResponseAsync( - String resourceGroupName, String name, String view, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (view == null) { - return Mono.error(new IllegalArgumentException("Parameter view is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNetworkFeaturesSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - view, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets all network features used by the app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param view The type of view. This can either be "summary" or "detailed". - * @param slot Name of the deployment slot. If a slot is not specified, the API will get network features for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network features used by the app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listNetworkFeaturesSlotAsync( - String resourceGroupName, String name, String view, String slot) { - return listNetworkFeaturesSlotWithResponseAsync(resourceGroupName, name, view, slot) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets all network features used by the app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param view The type of view. This can either be "summary" or "detailed". - * @param slot Name of the deployment slot. If a slot is not specified, the API will get network features for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network features used by the app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public NetworkFeaturesInner listNetworkFeaturesSlot( - String resourceGroupName, String name, String view, String slot) { - return listNetworkFeaturesSlotAsync(resourceGroupName, name, view, slot).block(); - } - - /** - * Gets all network features used by the app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param view The type of view. This can either be "summary" or "detailed". - * @param slot Name of the deployment slot. If a slot is not specified, the API will get network features for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network features used by the app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listNetworkFeaturesSlotWithResponse( - String resourceGroupName, String name, String view, String slot, Context context) { - return listNetworkFeaturesSlotWithResponseAsync(resourceGroupName, name, view, slot, context).block(); - } - - /** - * Gets a named operation for a network trace capturing (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param operationId GUID of the operation. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get an operation for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named operation for a network trace capturing (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getNetworkTraceOperationSlotWithResponseAsync( - String resourceGroupName, String name, String operationId, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (operationId == null) { - return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getNetworkTraceOperationSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - operationId, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a named operation for a network trace capturing (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param operationId GUID of the operation. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get an operation for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named operation for a network trace capturing (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getNetworkTraceOperationSlotWithResponseAsync( - String resourceGroupName, String name, String operationId, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (operationId == null) { - return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getNetworkTraceOperationSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - operationId, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets a named operation for a network trace capturing (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param operationId GUID of the operation. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get an operation for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named operation for a network trace capturing (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getNetworkTraceOperationSlotAsync( - String resourceGroupName, String name, String operationId, String slot) { - return getNetworkTraceOperationSlotWithResponseAsync(resourceGroupName, name, operationId, slot) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a named operation for a network trace capturing (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param operationId GUID of the operation. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get an operation for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named operation for a network trace capturing (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Object getNetworkTraceOperationSlot(String resourceGroupName, String name, String operationId, String slot) { - return getNetworkTraceOperationSlotAsync(resourceGroupName, name, operationId, slot).block(); - } - - /** - * Gets a named operation for a network trace capturing (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param operationId GUID of the operation. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get an operation for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named operation for a network trace capturing (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getNetworkTraceOperationSlotWithResponse( - String resourceGroupName, String name, String operationId, String slot, Context context) { - return getNetworkTraceOperationSlotWithResponseAsync(resourceGroupName, name, operationId, slot, context) - .block(); - } - - /** - * Start capturing network packets for the site (To be deprecated). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> startWebSiteNetworkTraceSlotWithResponseAsync( - String resourceGroupName, - String name, - String slot, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .startWebSiteNetworkTraceSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - durationInSeconds, - slot, - maxFrameLength, - sasUrl, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Start capturing network packets for the site (To be deprecated). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> startWebSiteNetworkTraceSlotWithResponseAsync( - String resourceGroupName, - String name, - String slot, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .startWebSiteNetworkTraceSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - durationInSeconds, - slot, - maxFrameLength, - sasUrl, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Start capturing network packets for the site (To be deprecated). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono startWebSiteNetworkTraceSlotAsync( - String resourceGroupName, - String name, - String slot, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl) { - return startWebSiteNetworkTraceSlotWithResponseAsync( - resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Start capturing network packets for the site (To be deprecated). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono startWebSiteNetworkTraceSlotAsync(String resourceGroupName, String name, String slot) { - final Integer durationInSeconds = null; - final Integer maxFrameLength = null; - final String sasUrl = null; - return startWebSiteNetworkTraceSlotWithResponseAsync( - resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Start capturing network packets for the site (To be deprecated). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public String startWebSiteNetworkTraceSlot(String resourceGroupName, String name, String slot) { - final Integer durationInSeconds = null; - final Integer maxFrameLength = null; - final String sasUrl = null; - return startWebSiteNetworkTraceSlotAsync( - resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl) - .block(); - } - - /** - * Start capturing network packets for the site (To be deprecated). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response startWebSiteNetworkTraceSlotWithResponse( - String resourceGroupName, - String name, - String slot, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl, - Context context) { - return startWebSiteNetworkTraceSlotWithResponseAsync( - resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl, context) - .block(); - } - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> startWebSiteNetworkTraceOperationSlotWithResponseAsync( - String resourceGroupName, - String name, - String slot, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .startWebSiteNetworkTraceOperationSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - durationInSeconds, - slot, - maxFrameLength, - sasUrl, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> startWebSiteNetworkTraceOperationSlotWithResponseAsync( - String resourceGroupName, - String name, - String slot, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .startWebSiteNetworkTraceOperationSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - durationInSeconds, - slot, - maxFrameLength, - sasUrl, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Object> beginStartWebSiteNetworkTraceOperationSlotAsync( - String resourceGroupName, - String name, - String slot, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl) { - Mono>> mono = - startWebSiteNetworkTraceOperationSlotWithResponseAsync( - resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Object.class, Object.class, this.client.getContext()); - } - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Object> beginStartWebSiteNetworkTraceOperationSlotAsync( - String resourceGroupName, - String name, - String slot, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - startWebSiteNetworkTraceOperationSlotWithResponseAsync( - resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Object.class, Object.class, context); - } - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Object> beginStartWebSiteNetworkTraceOperationSlot( - String resourceGroupName, - String name, - String slot, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl) { - return beginStartWebSiteNetworkTraceOperationSlotAsync( - resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl) - .getSyncPoller(); - } - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Object> beginStartWebSiteNetworkTraceOperationSlot( - String resourceGroupName, - String name, - String slot, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl, - Context context) { - return beginStartWebSiteNetworkTraceOperationSlotAsync( - resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl, context) - .getSyncPoller(); - } - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono startWebSiteNetworkTraceOperationSlotAsync( - String resourceGroupName, - String name, - String slot, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl) { - return beginStartWebSiteNetworkTraceOperationSlotAsync( - resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono startWebSiteNetworkTraceOperationSlotAsync(String resourceGroupName, String name, String slot) { - final Integer durationInSeconds = null; - final Integer maxFrameLength = null; - final String sasUrl = null; - return beginStartWebSiteNetworkTraceOperationSlotAsync( - resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono startWebSiteNetworkTraceOperationSlotAsync( - String resourceGroupName, - String name, - String slot, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl, - Context context) { - return beginStartWebSiteNetworkTraceOperationSlotAsync( - resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Object startWebSiteNetworkTraceOperationSlot( - String resourceGroupName, - String name, - String slot, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl) { - return startWebSiteNetworkTraceOperationSlotAsync( - resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl) - .block(); - } - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Object startWebSiteNetworkTraceOperationSlot(String resourceGroupName, String name, String slot) { - final Integer durationInSeconds = null; - final Integer maxFrameLength = null; - final String sasUrl = null; - return startWebSiteNetworkTraceOperationSlotAsync( - resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl) - .block(); - } - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Object startWebSiteNetworkTraceOperationSlot( - String resourceGroupName, - String name, - String slot, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl, - Context context) { - return startWebSiteNetworkTraceOperationSlotAsync( - resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl, context) - .block(); - } - - /** - * Stop ongoing capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> stopWebSiteNetworkTraceSlotWithResponseAsync( - String resourceGroupName, String name, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .stopWebSiteNetworkTraceSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Stop ongoing capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> stopWebSiteNetworkTraceSlotWithResponseAsync( - String resourceGroupName, String name, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .stopWebSiteNetworkTraceSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Stop ongoing capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono stopWebSiteNetworkTraceSlotAsync(String resourceGroupName, String name, String slot) { - return stopWebSiteNetworkTraceSlotWithResponseAsync(resourceGroupName, name, slot) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Stop ongoing capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void stopWebSiteNetworkTraceSlot(String resourceGroupName, String name, String slot) { - stopWebSiteNetworkTraceSlotAsync(resourceGroupName, name, slot).block(); - } - - /** - * Stop ongoing capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response stopWebSiteNetworkTraceSlotWithResponse( - String resourceGroupName, String name, String slot, Context context) { - return stopWebSiteNetworkTraceSlotWithResponseAsync(resourceGroupName, name, slot, context).block(); - } - - /** - * Gets a named operation for a network trace capturing (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param operationId GUID of the operation. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get an operation for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named operation for a network trace capturing (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> getNetworkTracesSlotWithResponseAsync( - String resourceGroupName, String name, String operationId, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (operationId == null) { - return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getNetworkTracesSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - operationId, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a named operation for a network trace capturing (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param operationId GUID of the operation. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get an operation for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named operation for a network trace capturing (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> getNetworkTracesSlotWithResponseAsync( - String resourceGroupName, String name, String operationId, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (operationId == null) { - return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getNetworkTracesSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - operationId, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets a named operation for a network trace capturing (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param operationId GUID of the operation. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get an operation for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named operation for a network trace capturing (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getNetworkTracesSlotAsync( - String resourceGroupName, String name, String operationId, String slot) { - return getNetworkTracesSlotWithResponseAsync(resourceGroupName, name, operationId, slot) - .flatMap( - (Response> res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a named operation for a network trace capturing (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param operationId GUID of the operation. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get an operation for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named operation for a network trace capturing (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public List getNetworkTracesSlot( - String resourceGroupName, String name, String operationId, String slot) { - return getNetworkTracesSlotAsync(resourceGroupName, name, operationId, slot).block(); - } - - /** - * Gets a named operation for a network trace capturing (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param operationId GUID of the operation. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get an operation for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named operation for a network trace capturing (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response> getNetworkTracesSlotWithResponse( - String resourceGroupName, String name, String operationId, String slot, Context context) { - return getNetworkTracesSlotWithResponseAsync(resourceGroupName, name, operationId, slot, context).block(); - } - - /** - * Gets a named operation for a network trace capturing (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param operationId GUID of the operation. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get an operation for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named operation for a network trace capturing (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getNetworkTraceOperationSlotV2WithResponseAsync( - String resourceGroupName, String name, String operationId, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (operationId == null) { - return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getNetworkTraceOperationSlotV2( - this.client.getEndpoint(), - resourceGroupName, - name, - operationId, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a named operation for a network trace capturing (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param operationId GUID of the operation. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get an operation for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named operation for a network trace capturing (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getNetworkTraceOperationSlotV2WithResponseAsync( - String resourceGroupName, String name, String operationId, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (operationId == null) { - return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getNetworkTraceOperationSlotV2( - this.client.getEndpoint(), - resourceGroupName, - name, - operationId, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets a named operation for a network trace capturing (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param operationId GUID of the operation. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get an operation for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named operation for a network trace capturing (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getNetworkTraceOperationSlotV2Async( - String resourceGroupName, String name, String operationId, String slot) { - return getNetworkTraceOperationSlotV2WithResponseAsync(resourceGroupName, name, operationId, slot) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a named operation for a network trace capturing (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param operationId GUID of the operation. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get an operation for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named operation for a network trace capturing (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Object getNetworkTraceOperationSlotV2( - String resourceGroupName, String name, String operationId, String slot) { - return getNetworkTraceOperationSlotV2Async(resourceGroupName, name, operationId, slot).block(); - } - - /** - * Gets a named operation for a network trace capturing (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param operationId GUID of the operation. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get an operation for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named operation for a network trace capturing (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getNetworkTraceOperationSlotV2WithResponse( - String resourceGroupName, String name, String operationId, String slot, Context context) { - return getNetworkTraceOperationSlotV2WithResponseAsync(resourceGroupName, name, operationId, slot, context) - .block(); - } - - /** - * Gets a named operation for a network trace capturing (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param operationId GUID of the operation. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get an operation for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named operation for a network trace capturing (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> getNetworkTracesSlotV2WithResponseAsync( - String resourceGroupName, String name, String operationId, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (operationId == null) { - return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getNetworkTracesSlotV2( - this.client.getEndpoint(), - resourceGroupName, - name, - operationId, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a named operation for a network trace capturing (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param operationId GUID of the operation. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get an operation for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named operation for a network trace capturing (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> getNetworkTracesSlotV2WithResponseAsync( - String resourceGroupName, String name, String operationId, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (operationId == null) { - return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getNetworkTracesSlotV2( - this.client.getEndpoint(), - resourceGroupName, - name, - operationId, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets a named operation for a network trace capturing (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param operationId GUID of the operation. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get an operation for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named operation for a network trace capturing (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getNetworkTracesSlotV2Async( - String resourceGroupName, String name, String operationId, String slot) { - return getNetworkTracesSlotV2WithResponseAsync(resourceGroupName, name, operationId, slot) - .flatMap( - (Response> res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a named operation for a network trace capturing (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param operationId GUID of the operation. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get an operation for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named operation for a network trace capturing (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public List getNetworkTracesSlotV2( - String resourceGroupName, String name, String operationId, String slot) { - return getNetworkTracesSlotV2Async(resourceGroupName, name, operationId, slot).block(); - } - - /** - * Gets a named operation for a network trace capturing (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param operationId GUID of the operation. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get an operation for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named operation for a network trace capturing (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response> getNetworkTracesSlotV2WithResponse( - String resourceGroupName, String name, String operationId, String slot, Context context) { - return getNetworkTracesSlotV2WithResponseAsync(resourceGroupName, name, operationId, slot, context).block(); - } - - /** - * Generates a new publishing password for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API generate a new publishing password - * for the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> generateNewSitePublishingPasswordSlotWithResponseAsync( - String resourceGroupName, String name, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .generateNewSitePublishingPasswordSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Generates a new publishing password for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API generate a new publishing password - * for the production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> generateNewSitePublishingPasswordSlotWithResponseAsync( - String resourceGroupName, String name, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .generateNewSitePublishingPasswordSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Generates a new publishing password for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API generate a new publishing password - * for the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono generateNewSitePublishingPasswordSlotAsync(String resourceGroupName, String name, String slot) { - return generateNewSitePublishingPasswordSlotWithResponseAsync(resourceGroupName, name, slot) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Generates a new publishing password for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API generate a new publishing password - * for the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void generateNewSitePublishingPasswordSlot(String resourceGroupName, String name, String slot) { - generateNewSitePublishingPasswordSlotAsync(resourceGroupName, name, slot).block(); - } - - /** - * Generates a new publishing password for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API generate a new publishing password - * for the production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response generateNewSitePublishingPasswordSlotWithResponse( - String resourceGroupName, String name, String slot, Context context) { - return generateNewSitePublishingPasswordSlotWithResponseAsync(resourceGroupName, name, slot, context).block(); - } - - /** - * Gets perfmon counters for web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: - * $filter=(startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq - * duration'[Hour|Minute|Day]'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return perfmon counters for web app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listPerfMonCountersSlotSinglePageAsync( - String resourceGroupName, String name, String slot, String filter) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listPerfMonCountersSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - filter, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets perfmon counters for web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: - * $filter=(startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq - * duration'[Hour|Minute|Day]'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return perfmon counters for web app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listPerfMonCountersSlotSinglePageAsync( - String resourceGroupName, String name, String slot, String filter, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listPerfMonCountersSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - filter, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets perfmon counters for web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: - * $filter=(startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq - * duration'[Hour|Minute|Day]'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return perfmon counters for web app. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listPerfMonCountersSlotAsync( - String resourceGroupName, String name, String slot, String filter) { - return new PagedFlux<>( - () -> listPerfMonCountersSlotSinglePageAsync(resourceGroupName, name, slot, filter), - nextLink -> listPerfMonCountersSlotNextSinglePageAsync(nextLink)); - } - - /** - * Gets perfmon counters for web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return perfmon counters for web app. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listPerfMonCountersSlotAsync( - String resourceGroupName, String name, String slot) { - final String filter = null; - return new PagedFlux<>( - () -> listPerfMonCountersSlotSinglePageAsync(resourceGroupName, name, slot, filter), - nextLink -> listPerfMonCountersSlotNextSinglePageAsync(nextLink)); - } - - /** - * Gets perfmon counters for web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: - * $filter=(startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq - * duration'[Hour|Minute|Day]'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return perfmon counters for web app. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listPerfMonCountersSlotAsync( - String resourceGroupName, String name, String slot, String filter, Context context) { - return new PagedFlux<>( - () -> listPerfMonCountersSlotSinglePageAsync(resourceGroupName, name, slot, filter, context), - nextLink -> listPerfMonCountersSlotNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets perfmon counters for web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return perfmon counters for web app. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listPerfMonCountersSlot( - String resourceGroupName, String name, String slot) { - final String filter = null; - return new PagedIterable<>(listPerfMonCountersSlotAsync(resourceGroupName, name, slot, filter)); - } - - /** - * Gets perfmon counters for web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: - * $filter=(startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq - * duration'[Hour|Minute|Day]'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return perfmon counters for web app. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listPerfMonCountersSlot( - String resourceGroupName, String name, String slot, String filter, Context context) { - return new PagedIterable<>(listPerfMonCountersSlotAsync(resourceGroupName, name, slot, filter, context)); - } - - /** - * Gets web app's event logs. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return web app's event logs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getSitePhpErrorLogFlagSlotWithResponseAsync( - String resourceGroupName, String name, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getSitePhpErrorLogFlagSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets web app's event logs. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return web app's event logs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getSitePhpErrorLogFlagSlotWithResponseAsync( - String resourceGroupName, String name, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getSitePhpErrorLogFlagSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets web app's event logs. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return web app's event logs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getSitePhpErrorLogFlagSlotAsync( - String resourceGroupName, String name, String slot) { - return getSitePhpErrorLogFlagSlotWithResponseAsync(resourceGroupName, name, slot) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets web app's event logs. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return web app's event logs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SitePhpErrorLogFlagInner getSitePhpErrorLogFlagSlot(String resourceGroupName, String name, String slot) { - return getSitePhpErrorLogFlagSlotAsync(resourceGroupName, name, slot).block(); - } - - /** - * Gets web app's event logs. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return web app's event logs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getSitePhpErrorLogFlagSlotWithResponse( - String resourceGroupName, String name, String slot, Context context) { - return getSitePhpErrorLogFlagSlotWithResponseAsync(resourceGroupName, name, slot, context).block(); - } - - /** - * Gets the premier add-ons of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the premier add-ons for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the premier add-ons of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listPremierAddOnsSlotWithResponseAsync( - String resourceGroupName, String name, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listPremierAddOnsSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the premier add-ons of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the premier add-ons for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the premier add-ons of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listPremierAddOnsSlotWithResponseAsync( - String resourceGroupName, String name, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listPremierAddOnsSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets the premier add-ons of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the premier add-ons for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the premier add-ons of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listPremierAddOnsSlotAsync(String resourceGroupName, String name, String slot) { - return listPremierAddOnsSlotWithResponseAsync(resourceGroupName, name, slot) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the premier add-ons of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the premier add-ons for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the premier add-ons of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PremierAddOnInner listPremierAddOnsSlot(String resourceGroupName, String name, String slot) { - return listPremierAddOnsSlotAsync(resourceGroupName, name, slot).block(); - } - - /** - * Gets the premier add-ons of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the premier add-ons for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the premier add-ons of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listPremierAddOnsSlotWithResponse( - String resourceGroupName, String name, String slot, Context context) { - return listPremierAddOnsSlotWithResponseAsync(resourceGroupName, name, slot, context).block(); - } - - /** - * Gets a named add-on of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param premierAddOnName Add-on name. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the named add-on for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named add-on of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getPremierAddOnSlotWithResponseAsync( - String resourceGroupName, String name, String premierAddOnName, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (premierAddOnName == null) { - return Mono - .error(new IllegalArgumentException("Parameter premierAddOnName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getPremierAddOnSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - premierAddOnName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a named add-on of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param premierAddOnName Add-on name. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the named add-on for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named add-on of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getPremierAddOnSlotWithResponseAsync( - String resourceGroupName, String name, String premierAddOnName, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (premierAddOnName == null) { - return Mono - .error(new IllegalArgumentException("Parameter premierAddOnName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getPremierAddOnSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - premierAddOnName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets a named add-on of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param premierAddOnName Add-on name. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the named add-on for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named add-on of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getPremierAddOnSlotAsync( - String resourceGroupName, String name, String premierAddOnName, String slot) { - return getPremierAddOnSlotWithResponseAsync(resourceGroupName, name, premierAddOnName, slot) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a named add-on of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param premierAddOnName Add-on name. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the named add-on for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named add-on of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PremierAddOnInner getPremierAddOnSlot( - String resourceGroupName, String name, String premierAddOnName, String slot) { - return getPremierAddOnSlotAsync(resourceGroupName, name, premierAddOnName, slot).block(); - } - - /** - * Gets a named add-on of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param premierAddOnName Add-on name. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the named add-on for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named add-on of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getPremierAddOnSlotWithResponse( - String resourceGroupName, String name, String premierAddOnName, String slot, Context context) { - return getPremierAddOnSlotWithResponseAsync(resourceGroupName, name, premierAddOnName, slot, context).block(); - } - - /** - * Updates a named add-on of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param premierAddOnName Add-on name. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the named add-on for the - * production slot. - * @param premierAddOn A JSON representation of the edited premier add-on. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return premier add-on. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> addPremierAddOnSlotWithResponseAsync( - String resourceGroupName, String name, String premierAddOnName, String slot, PremierAddOnInner premierAddOn) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (premierAddOnName == null) { - return Mono - .error(new IllegalArgumentException("Parameter premierAddOnName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (premierAddOn == null) { - return Mono.error(new IllegalArgumentException("Parameter premierAddOn is required and cannot be null.")); - } else { - premierAddOn.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .addPremierAddOnSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - premierAddOnName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - premierAddOn, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates a named add-on of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param premierAddOnName Add-on name. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the named add-on for the - * production slot. - * @param premierAddOn A JSON representation of the edited premier add-on. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return premier add-on. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> addPremierAddOnSlotWithResponseAsync( - String resourceGroupName, - String name, - String premierAddOnName, - String slot, - PremierAddOnInner premierAddOn, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (premierAddOnName == null) { - return Mono - .error(new IllegalArgumentException("Parameter premierAddOnName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (premierAddOn == null) { - return Mono.error(new IllegalArgumentException("Parameter premierAddOn is required and cannot be null.")); - } else { - premierAddOn.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .addPremierAddOnSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - premierAddOnName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - premierAddOn, - accept, - context); - } - - /** - * Updates a named add-on of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param premierAddOnName Add-on name. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the named add-on for the - * production slot. - * @param premierAddOn A JSON representation of the edited premier add-on. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return premier add-on. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono addPremierAddOnSlotAsync( - String resourceGroupName, String name, String premierAddOnName, String slot, PremierAddOnInner premierAddOn) { - return addPremierAddOnSlotWithResponseAsync(resourceGroupName, name, premierAddOnName, slot, premierAddOn) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Updates a named add-on of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param premierAddOnName Add-on name. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the named add-on for the - * production slot. - * @param premierAddOn A JSON representation of the edited premier add-on. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return premier add-on. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PremierAddOnInner addPremierAddOnSlot( - String resourceGroupName, String name, String premierAddOnName, String slot, PremierAddOnInner premierAddOn) { - return addPremierAddOnSlotAsync(resourceGroupName, name, premierAddOnName, slot, premierAddOn).block(); - } - - /** - * Updates a named add-on of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param premierAddOnName Add-on name. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the named add-on for the - * production slot. - * @param premierAddOn A JSON representation of the edited premier add-on. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return premier add-on. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response addPremierAddOnSlotWithResponse( - String resourceGroupName, - String name, - String premierAddOnName, - String slot, - PremierAddOnInner premierAddOn, - Context context) { - return addPremierAddOnSlotWithResponseAsync( - resourceGroupName, name, premierAddOnName, slot, premierAddOn, context) - .block(); - } - - /** - * Delete a premier add-on from an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param premierAddOnName Add-on name. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the named add-on for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deletePremierAddOnSlotWithResponseAsync( - String resourceGroupName, String name, String premierAddOnName, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (premierAddOnName == null) { - return Mono - .error(new IllegalArgumentException("Parameter premierAddOnName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .deletePremierAddOnSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - premierAddOnName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete a premier add-on from an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param premierAddOnName Add-on name. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the named add-on for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deletePremierAddOnSlotWithResponseAsync( - String resourceGroupName, String name, String premierAddOnName, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (premierAddOnName == null) { - return Mono - .error(new IllegalArgumentException("Parameter premierAddOnName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .deletePremierAddOnSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - premierAddOnName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Delete a premier add-on from an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param premierAddOnName Add-on name. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the named add-on for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deletePremierAddOnSlotAsync( - String resourceGroupName, String name, String premierAddOnName, String slot) { - return deletePremierAddOnSlotWithResponseAsync(resourceGroupName, name, premierAddOnName, slot) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Delete a premier add-on from an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param premierAddOnName Add-on name. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the named add-on for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deletePremierAddOnSlot(String resourceGroupName, String name, String premierAddOnName, String slot) { - deletePremierAddOnSlotAsync(resourceGroupName, name, premierAddOnName, slot).block(); - } - - /** - * Delete a premier add-on from an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param premierAddOnName Add-on name. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the named add-on for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deletePremierAddOnSlotWithResponse( - String resourceGroupName, String name, String premierAddOnName, String slot, Context context) { - return deletePremierAddOnSlotWithResponseAsync(resourceGroupName, name, premierAddOnName, slot, context) - .block(); - } - - /** - * Updates a named add-on of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param premierAddOnName Add-on name. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the named add-on for the - * production slot. - * @param premierAddOn A JSON representation of the edited premier add-on. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return premier add-on. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updatePremierAddOnSlotWithResponseAsync( - String resourceGroupName, - String name, - String premierAddOnName, - String slot, - PremierAddOnPatchResource premierAddOn) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (premierAddOnName == null) { - return Mono - .error(new IllegalArgumentException("Parameter premierAddOnName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (premierAddOn == null) { - return Mono.error(new IllegalArgumentException("Parameter premierAddOn is required and cannot be null.")); - } else { - premierAddOn.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updatePremierAddOnSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - premierAddOnName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - premierAddOn, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates a named add-on of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param premierAddOnName Add-on name. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the named add-on for the - * production slot. - * @param premierAddOn A JSON representation of the edited premier add-on. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return premier add-on. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updatePremierAddOnSlotWithResponseAsync( - String resourceGroupName, - String name, - String premierAddOnName, - String slot, - PremierAddOnPatchResource premierAddOn, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (premierAddOnName == null) { - return Mono - .error(new IllegalArgumentException("Parameter premierAddOnName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (premierAddOn == null) { - return Mono.error(new IllegalArgumentException("Parameter premierAddOn is required and cannot be null.")); - } else { - premierAddOn.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updatePremierAddOnSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - premierAddOnName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - premierAddOn, - accept, - context); - } - - /** - * Updates a named add-on of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param premierAddOnName Add-on name. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the named add-on for the - * production slot. - * @param premierAddOn A JSON representation of the edited premier add-on. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return premier add-on. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updatePremierAddOnSlotAsync( - String resourceGroupName, - String name, - String premierAddOnName, - String slot, - PremierAddOnPatchResource premierAddOn) { - return updatePremierAddOnSlotWithResponseAsync(resourceGroupName, name, premierAddOnName, slot, premierAddOn) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Updates a named add-on of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param premierAddOnName Add-on name. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the named add-on for the - * production slot. - * @param premierAddOn A JSON representation of the edited premier add-on. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return premier add-on. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PremierAddOnInner updatePremierAddOnSlot( - String resourceGroupName, - String name, - String premierAddOnName, - String slot, - PremierAddOnPatchResource premierAddOn) { - return updatePremierAddOnSlotAsync(resourceGroupName, name, premierAddOnName, slot, premierAddOn).block(); - } - - /** - * Updates a named add-on of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param premierAddOnName Add-on name. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the named add-on for the - * production slot. - * @param premierAddOn A JSON representation of the edited premier add-on. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return premier add-on. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updatePremierAddOnSlotWithResponse( - String resourceGroupName, - String name, - String premierAddOnName, - String slot, - PremierAddOnPatchResource premierAddOn, - Context context) { - return updatePremierAddOnSlotWithResponseAsync( - resourceGroupName, name, premierAddOnName, slot, premierAddOn, context) - .block(); - } - - /** - * Gets data around private site access enablement and authorized Virtual Networks that can access the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for the web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data around private site access enablement and authorized Virtual Networks that can access the site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getPrivateAccessSlotWithResponseAsync( - String resourceGroupName, String name, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getPrivateAccessSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets data around private site access enablement and authorized Virtual Networks that can access the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for the web app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data around private site access enablement and authorized Virtual Networks that can access the site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getPrivateAccessSlotWithResponseAsync( - String resourceGroupName, String name, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getPrivateAccessSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets data around private site access enablement and authorized Virtual Networks that can access the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for the web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data around private site access enablement and authorized Virtual Networks that can access the site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getPrivateAccessSlotAsync(String resourceGroupName, String name, String slot) { - return getPrivateAccessSlotWithResponseAsync(resourceGroupName, name, slot) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets data around private site access enablement and authorized Virtual Networks that can access the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for the web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data around private site access enablement and authorized Virtual Networks that can access the site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateAccessInner getPrivateAccessSlot(String resourceGroupName, String name, String slot) { - return getPrivateAccessSlotAsync(resourceGroupName, name, slot).block(); - } - - /** - * Gets data around private site access enablement and authorized Virtual Networks that can access the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for the web app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data around private site access enablement and authorized Virtual Networks that can access the site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getPrivateAccessSlotWithResponse( - String resourceGroupName, String name, String slot, Context context) { - return getPrivateAccessSlotWithResponseAsync(resourceGroupName, name, slot, context).block(); - } - - /** - * Sets data around private site access enablement and authorized Virtual Networks that can access the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for the web app. - * @param access The information for the private access. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of the parameters of Private Access for a Web Site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> putPrivateAccessVnetSlotWithResponseAsync( - String resourceGroupName, String name, String slot, PrivateAccessInner access) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (access == null) { - return Mono.error(new IllegalArgumentException("Parameter access is required and cannot be null.")); - } else { - access.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .putPrivateAccessVnetSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - access, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Sets data around private site access enablement and authorized Virtual Networks that can access the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for the web app. - * @param access The information for the private access. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of the parameters of Private Access for a Web Site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> putPrivateAccessVnetSlotWithResponseAsync( - String resourceGroupName, String name, String slot, PrivateAccessInner access, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (access == null) { - return Mono.error(new IllegalArgumentException("Parameter access is required and cannot be null.")); - } else { - access.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .putPrivateAccessVnetSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - access, - accept, - context); - } - - /** - * Sets data around private site access enablement and authorized Virtual Networks that can access the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for the web app. - * @param access The information for the private access. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of the parameters of Private Access for a Web Site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono putPrivateAccessVnetSlotAsync( - String resourceGroupName, String name, String slot, PrivateAccessInner access) { - return putPrivateAccessVnetSlotWithResponseAsync(resourceGroupName, name, slot, access) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Sets data around private site access enablement and authorized Virtual Networks that can access the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for the web app. - * @param access The information for the private access. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of the parameters of Private Access for a Web Site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateAccessInner putPrivateAccessVnetSlot( - String resourceGroupName, String name, String slot, PrivateAccessInner access) { - return putPrivateAccessVnetSlotAsync(resourceGroupName, name, slot, access).block(); - } - - /** - * Sets data around private site access enablement and authorized Virtual Networks that can access the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for the web app. - * @param access The information for the private access. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of the parameters of Private Access for a Web Site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response putPrivateAccessVnetSlotWithResponse( - String resourceGroupName, String name, String slot, PrivateAccessInner access, Context context) { - return putPrivateAccessVnetSlotWithResponseAsync(resourceGroupName, name, slot, access, context).block(); - } - - /** - * Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web - * site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listProcessesSlotSinglePageAsync( - String resourceGroupName, String name, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listProcessesSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web - * site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listProcessesSlotSinglePageAsync( - String resourceGroupName, String name, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listProcessesSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web - * site. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listProcessesSlotAsync(String resourceGroupName, String name, String slot) { - return new PagedFlux<>( - () -> listProcessesSlotSinglePageAsync(resourceGroupName, name, slot), - nextLink -> listProcessesSlotNextSinglePageAsync(nextLink)); - } - - /** - * Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web - * site. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listProcessesSlotAsync( - String resourceGroupName, String name, String slot, Context context) { - return new PagedFlux<>( - () -> listProcessesSlotSinglePageAsync(resourceGroupName, name, slot, context), - nextLink -> listProcessesSlotNextSinglePageAsync(nextLink, context)); - } - - /** - * Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web - * site. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listProcessesSlot(String resourceGroupName, String name, String slot) { - return new PagedIterable<>(listProcessesSlotAsync(resourceGroupName, name, slot)); - } - - /** - * Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web - * site. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listProcessesSlot( - String resourceGroupName, String name, String slot, Context context) { - return new PagedIterable<>(listProcessesSlotAsync(resourceGroupName, name, slot, context)); - } - - /** - * Get process information by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return process information by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getProcessSlotWithResponseAsync( - String resourceGroupName, String name, String processId, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (processId == null) { - return Mono.error(new IllegalArgumentException("Parameter processId is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getProcessSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - processId, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get process information by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return process information by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getProcessSlotWithResponseAsync( - String resourceGroupName, String name, String processId, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (processId == null) { - return Mono.error(new IllegalArgumentException("Parameter processId is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getProcessSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - processId, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Get process information by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return process information by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getProcessSlotAsync( - String resourceGroupName, String name, String processId, String slot) { - return getProcessSlotWithResponseAsync(resourceGroupName, name, processId, slot) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get process information by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return process information by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ProcessInfoInner getProcessSlot(String resourceGroupName, String name, String processId, String slot) { - return getProcessSlotAsync(resourceGroupName, name, processId, slot).block(); - } - - /** - * Get process information by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return process information by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getProcessSlotWithResponse( - String resourceGroupName, String name, String processId, String slot, Context context) { - return getProcessSlotWithResponseAsync(resourceGroupName, name, processId, slot, context).block(); - } - - /** - * Terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in a web - * site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteProcessSlotWithResponseAsync( - String resourceGroupName, String name, String processId, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (processId == null) { - return Mono.error(new IllegalArgumentException("Parameter processId is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .deleteProcessSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - processId, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in a web - * site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteProcessSlotWithResponseAsync( - String resourceGroupName, String name, String processId, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (processId == null) { - return Mono.error(new IllegalArgumentException("Parameter processId is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .deleteProcessSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - processId, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in a web - * site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteProcessSlotAsync(String resourceGroupName, String name, String processId, String slot) { - return deleteProcessSlotWithResponseAsync(resourceGroupName, name, processId, slot) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in a web - * site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteProcessSlot(String resourceGroupName, String name, String processId, String slot) { - deleteProcessSlotAsync(resourceGroupName, name, processId, slot).block(); - } - - /** - * Terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in a web - * site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteProcessSlotWithResponse( - String resourceGroupName, String name, String processId, String slot, Context context) { - return deleteProcessSlotWithResponseAsync(resourceGroupName, name, processId, slot, context).block(); - } - - /** - * Get a memory dump of a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a memory dump of a process by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getProcessDumpSlotWithResponseAsync( - String resourceGroupName, String name, String processId, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (processId == null) { - return Mono.error(new IllegalArgumentException("Parameter processId is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getProcessDumpSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - processId, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a memory dump of a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a memory dump of a process by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getProcessDumpSlotWithResponseAsync( - String resourceGroupName, String name, String processId, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (processId == null) { - return Mono.error(new IllegalArgumentException("Parameter processId is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getProcessDumpSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - processId, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Get a memory dump of a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a memory dump of a process by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Flux getProcessDumpSlotAsync( - String resourceGroupName, String name, String processId, String slot) { - return getProcessDumpSlotWithResponseAsync(resourceGroupName, name, processId, slot) - .flatMapMany(StreamResponse::getValue); - } - - /** - * Get a memory dump of a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a memory dump of a process by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public InputStream getProcessDumpSlot(String resourceGroupName, String name, String processId, String slot) { - Iterator iterator = - getProcessDumpSlotAsync(resourceGroupName, name, processId, slot) - .map(ByteBufferBackedInputStream::new) - .toStream() - .iterator(); - Enumeration enumeration = - new Enumeration() { - @Override - public boolean hasMoreElements() { - return iterator.hasNext(); - } - - @Override - public InputStream nextElement() { - return iterator.next(); - } - }; - return new SequenceInputStream(enumeration); - } - - /** - * Get a memory dump of a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a memory dump of a process by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public StreamResponse getProcessDumpSlotWithResponse( - String resourceGroupName, String name, String processId, String slot, Context context) { - return getProcessDumpSlotWithResponseAsync(resourceGroupName, name, processId, slot, context).block(); - } - - /** - * List module information for a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listProcessModulesSlotSinglePageAsync( - String resourceGroupName, String name, String processId, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (processId == null) { - return Mono.error(new IllegalArgumentException("Parameter processId is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listProcessModulesSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - processId, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List module information for a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listProcessModulesSlotSinglePageAsync( - String resourceGroupName, String name, String processId, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (processId == null) { - return Mono.error(new IllegalArgumentException("Parameter processId is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listProcessModulesSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - processId, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * List module information for a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listProcessModulesSlotAsync( - String resourceGroupName, String name, String processId, String slot) { - return new PagedFlux<>( - () -> listProcessModulesSlotSinglePageAsync(resourceGroupName, name, processId, slot), - nextLink -> listProcessModulesSlotNextSinglePageAsync(nextLink)); - } - - /** - * List module information for a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listProcessModulesSlotAsync( - String resourceGroupName, String name, String processId, String slot, Context context) { - return new PagedFlux<>( - () -> listProcessModulesSlotSinglePageAsync(resourceGroupName, name, processId, slot, context), - nextLink -> listProcessModulesSlotNextSinglePageAsync(nextLink, context)); - } - - /** - * List module information for a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listProcessModulesSlot( - String resourceGroupName, String name, String processId, String slot) { - return new PagedIterable<>(listProcessModulesSlotAsync(resourceGroupName, name, processId, slot)); - } - - /** - * List module information for a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listProcessModulesSlot( - String resourceGroupName, String name, String processId, String slot, Context context) { - return new PagedIterable<>(listProcessModulesSlotAsync(resourceGroupName, name, processId, slot, context)); - } - - /** - * Get process information by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param baseAddress Module base address. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return process information by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getProcessModuleSlotWithResponseAsync( - String resourceGroupName, String name, String processId, String baseAddress, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (processId == null) { - return Mono.error(new IllegalArgumentException("Parameter processId is required and cannot be null.")); - } - if (baseAddress == null) { - return Mono.error(new IllegalArgumentException("Parameter baseAddress is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getProcessModuleSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - processId, - baseAddress, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get process information by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param baseAddress Module base address. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return process information by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getProcessModuleSlotWithResponseAsync( - String resourceGroupName, String name, String processId, String baseAddress, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (processId == null) { - return Mono.error(new IllegalArgumentException("Parameter processId is required and cannot be null.")); - } - if (baseAddress == null) { - return Mono.error(new IllegalArgumentException("Parameter baseAddress is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getProcessModuleSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - processId, - baseAddress, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Get process information by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param baseAddress Module base address. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return process information by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getProcessModuleSlotAsync( - String resourceGroupName, String name, String processId, String baseAddress, String slot) { - return getProcessModuleSlotWithResponseAsync(resourceGroupName, name, processId, baseAddress, slot) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get process information by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param baseAddress Module base address. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return process information by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ProcessModuleInfoInner getProcessModuleSlot( - String resourceGroupName, String name, String processId, String baseAddress, String slot) { - return getProcessModuleSlotAsync(resourceGroupName, name, processId, baseAddress, slot).block(); - } - - /** - * Get process information by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param baseAddress Module base address. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return process information by its ID for a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getProcessModuleSlotWithResponse( - String resourceGroupName, String name, String processId, String baseAddress, String slot, Context context) { - return getProcessModuleSlotWithResponseAsync(resourceGroupName, name, processId, baseAddress, slot, context) - .block(); - } - - /** - * List the threads in a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listProcessThreadsSlotSinglePageAsync( - String resourceGroupName, String name, String processId, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (processId == null) { - return Mono.error(new IllegalArgumentException("Parameter processId is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listProcessThreadsSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - processId, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List the threads in a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listProcessThreadsSlotSinglePageAsync( - String resourceGroupName, String name, String processId, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (processId == null) { - return Mono.error(new IllegalArgumentException("Parameter processId is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listProcessThreadsSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - processId, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * List the threads in a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listProcessThreadsSlotAsync( - String resourceGroupName, String name, String processId, String slot) { - return new PagedFlux<>( - () -> listProcessThreadsSlotSinglePageAsync(resourceGroupName, name, processId, slot), - nextLink -> listProcessThreadsSlotNextSinglePageAsync(nextLink)); - } - - /** - * List the threads in a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listProcessThreadsSlotAsync( - String resourceGroupName, String name, String processId, String slot, Context context) { - return new PagedFlux<>( - () -> listProcessThreadsSlotSinglePageAsync(resourceGroupName, name, processId, slot, context), - nextLink -> listProcessThreadsSlotNextSinglePageAsync(nextLink, context)); - } - - /** - * List the threads in a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listProcessThreadsSlot( - String resourceGroupName, String name, String processId, String slot) { - return new PagedIterable<>(listProcessThreadsSlotAsync(resourceGroupName, name, processId, slot)); - } - - /** - * List the threads in a process by its ID for a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listProcessThreadsSlot( - String resourceGroupName, String name, String processId, String slot, Context context) { - return new PagedIterable<>(listProcessThreadsSlotAsync(resourceGroupName, name, processId, slot, context)); - } - - /** - * Get thread information by Thread ID for a specific process, in a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param threadId TID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return thread information by Thread ID for a specific process, in a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getProcessThreadSlotWithResponseAsync( - String resourceGroupName, String name, String processId, String threadId, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (processId == null) { - return Mono.error(new IllegalArgumentException("Parameter processId is required and cannot be null.")); - } - if (threadId == null) { - return Mono.error(new IllegalArgumentException("Parameter threadId is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getProcessThreadSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - processId, - threadId, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get thread information by Thread ID for a specific process, in a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param threadId TID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return thread information by Thread ID for a specific process, in a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getProcessThreadSlotWithResponseAsync( - String resourceGroupName, String name, String processId, String threadId, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (processId == null) { - return Mono.error(new IllegalArgumentException("Parameter processId is required and cannot be null.")); - } - if (threadId == null) { - return Mono.error(new IllegalArgumentException("Parameter threadId is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getProcessThreadSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - processId, - threadId, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Get thread information by Thread ID for a specific process, in a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param threadId TID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return thread information by Thread ID for a specific process, in a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getProcessThreadSlotAsync( - String resourceGroupName, String name, String processId, String threadId, String slot) { - return getProcessThreadSlotWithResponseAsync(resourceGroupName, name, processId, threadId, slot) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get thread information by Thread ID for a specific process, in a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param threadId TID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return thread information by Thread ID for a specific process, in a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ProcessThreadInfoInner getProcessThreadSlot( - String resourceGroupName, String name, String processId, String threadId, String slot) { - return getProcessThreadSlotAsync(resourceGroupName, name, processId, threadId, slot).block(); - } - - /** - * Get thread information by Thread ID for a specific process, in a specific scaled-out instance in a web site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param processId PID. - * @param threadId TID. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return thread information by Thread ID for a specific process, in a specific scaled-out instance in a web site. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getProcessThreadSlotWithResponse( - String resourceGroupName, String name, String processId, String threadId, String slot, Context context) { - return getProcessThreadSlotWithResponseAsync(resourceGroupName, name, processId, threadId, slot, context) - .block(); - } - - /** - * Get public certificates for an app or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API gets hostname bindings for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public certificates for an app or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listPublicCertificatesSlotSinglePageAsync( - String resourceGroupName, String name, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listPublicCertificatesSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get public certificates for an app or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API gets hostname bindings for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public certificates for an app or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listPublicCertificatesSlotSinglePageAsync( - String resourceGroupName, String name, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listPublicCertificatesSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get public certificates for an app or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API gets hostname bindings for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public certificates for an app or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listPublicCertificatesSlotAsync( - String resourceGroupName, String name, String slot) { - return new PagedFlux<>( - () -> listPublicCertificatesSlotSinglePageAsync(resourceGroupName, name, slot), - nextLink -> listPublicCertificatesSlotNextSinglePageAsync(nextLink)); - } - - /** - * Get public certificates for an app or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API gets hostname bindings for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public certificates for an app or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listPublicCertificatesSlotAsync( - String resourceGroupName, String name, String slot, Context context) { - return new PagedFlux<>( - () -> listPublicCertificatesSlotSinglePageAsync(resourceGroupName, name, slot, context), - nextLink -> listPublicCertificatesSlotNextSinglePageAsync(nextLink, context)); - } - - /** - * Get public certificates for an app or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API gets hostname bindings for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public certificates for an app or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listPublicCertificatesSlot( - String resourceGroupName, String name, String slot) { - return new PagedIterable<>(listPublicCertificatesSlotAsync(resourceGroupName, name, slot)); - } - - /** - * Get public certificates for an app or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API gets hostname bindings for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public certificates for an app or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listPublicCertificatesSlot( - String resourceGroupName, String name, String slot, Context context) { - return new PagedIterable<>(listPublicCertificatesSlotAsync(resourceGroupName, name, slot, context)); - } - - /** - * Get the named public certificate for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API the named binding for the production - * slot. - * @param publicCertificateName Public certificate name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the named public certificate for an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getPublicCertificateSlotWithResponseAsync( - String resourceGroupName, String name, String slot, String publicCertificateName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (publicCertificateName == null) { - return Mono - .error(new IllegalArgumentException("Parameter publicCertificateName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getPublicCertificateSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - publicCertificateName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the named public certificate for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API the named binding for the production - * slot. - * @param publicCertificateName Public certificate name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the named public certificate for an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getPublicCertificateSlotWithResponseAsync( - String resourceGroupName, String name, String slot, String publicCertificateName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (publicCertificateName == null) { - return Mono - .error(new IllegalArgumentException("Parameter publicCertificateName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getPublicCertificateSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - publicCertificateName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Get the named public certificate for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API the named binding for the production - * slot. - * @param publicCertificateName Public certificate name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the named public certificate for an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getPublicCertificateSlotAsync( - String resourceGroupName, String name, String slot, String publicCertificateName) { - return getPublicCertificateSlotWithResponseAsync(resourceGroupName, name, slot, publicCertificateName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get the named public certificate for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API the named binding for the production - * slot. - * @param publicCertificateName Public certificate name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the named public certificate for an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PublicCertificateInner getPublicCertificateSlot( - String resourceGroupName, String name, String slot, String publicCertificateName) { - return getPublicCertificateSlotAsync(resourceGroupName, name, slot, publicCertificateName).block(); - } - - /** - * Get the named public certificate for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API the named binding for the production - * slot. - * @param publicCertificateName Public certificate name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the named public certificate for an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getPublicCertificateSlotWithResponse( - String resourceGroupName, String name, String slot, String publicCertificateName, Context context) { - return getPublicCertificateSlotWithResponseAsync(resourceGroupName, name, slot, publicCertificateName, context) - .block(); - } - - /** - * Creates a hostname binding for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param publicCertificateName Public certificate name. - * @param slot Name of the deployment slot. If a slot is not specified, the API will create a binding for the - * production slot. - * @param publicCertificate Public certificate details. This is the JSON representation of a PublicCertificate - * object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public certificate object. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdatePublicCertificateSlotWithResponseAsync( - String resourceGroupName, - String name, - String publicCertificateName, - String slot, - PublicCertificateInner publicCertificate) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (publicCertificateName == null) { - return Mono - .error(new IllegalArgumentException("Parameter publicCertificateName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (publicCertificate == null) { - return Mono - .error(new IllegalArgumentException("Parameter publicCertificate is required and cannot be null.")); - } else { - publicCertificate.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdatePublicCertificateSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - publicCertificateName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - publicCertificate, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates a hostname binding for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param publicCertificateName Public certificate name. - * @param slot Name of the deployment slot. If a slot is not specified, the API will create a binding for the - * production slot. - * @param publicCertificate Public certificate details. This is the JSON representation of a PublicCertificate - * object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public certificate object. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdatePublicCertificateSlotWithResponseAsync( - String resourceGroupName, - String name, - String publicCertificateName, - String slot, - PublicCertificateInner publicCertificate, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (publicCertificateName == null) { - return Mono - .error(new IllegalArgumentException("Parameter publicCertificateName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (publicCertificate == null) { - return Mono - .error(new IllegalArgumentException("Parameter publicCertificate is required and cannot be null.")); - } else { - publicCertificate.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdatePublicCertificateSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - publicCertificateName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - publicCertificate, - accept, - context); - } - - /** - * Creates a hostname binding for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param publicCertificateName Public certificate name. - * @param slot Name of the deployment slot. If a slot is not specified, the API will create a binding for the - * production slot. - * @param publicCertificate Public certificate details. This is the JSON representation of a PublicCertificate - * object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public certificate object. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdatePublicCertificateSlotAsync( - String resourceGroupName, - String name, - String publicCertificateName, - String slot, - PublicCertificateInner publicCertificate) { - return createOrUpdatePublicCertificateSlotWithResponseAsync( - resourceGroupName, name, publicCertificateName, slot, publicCertificate) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates a hostname binding for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param publicCertificateName Public certificate name. - * @param slot Name of the deployment slot. If a slot is not specified, the API will create a binding for the - * production slot. - * @param publicCertificate Public certificate details. This is the JSON representation of a PublicCertificate - * object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public certificate object. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PublicCertificateInner createOrUpdatePublicCertificateSlot( - String resourceGroupName, - String name, - String publicCertificateName, - String slot, - PublicCertificateInner publicCertificate) { - return createOrUpdatePublicCertificateSlotAsync( - resourceGroupName, name, publicCertificateName, slot, publicCertificate) - .block(); - } - - /** - * Creates a hostname binding for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param publicCertificateName Public certificate name. - * @param slot Name of the deployment slot. If a slot is not specified, the API will create a binding for the - * production slot. - * @param publicCertificate Public certificate details. This is the JSON representation of a PublicCertificate - * object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public certificate object. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdatePublicCertificateSlotWithResponse( - String resourceGroupName, - String name, - String publicCertificateName, - String slot, - PublicCertificateInner publicCertificate, - Context context) { - return createOrUpdatePublicCertificateSlotWithResponseAsync( - resourceGroupName, name, publicCertificateName, slot, publicCertificate, context) - .block(); - } - - /** - * Deletes a hostname binding for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the binding for the - * production slot. - * @param publicCertificateName Public certificate name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deletePublicCertificateSlotWithResponseAsync( - String resourceGroupName, String name, String slot, String publicCertificateName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (publicCertificateName == null) { - return Mono - .error(new IllegalArgumentException("Parameter publicCertificateName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .deletePublicCertificateSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - publicCertificateName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a hostname binding for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the binding for the - * production slot. - * @param publicCertificateName Public certificate name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deletePublicCertificateSlotWithResponseAsync( - String resourceGroupName, String name, String slot, String publicCertificateName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (publicCertificateName == null) { - return Mono - .error(new IllegalArgumentException("Parameter publicCertificateName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .deletePublicCertificateSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - publicCertificateName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Deletes a hostname binding for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the binding for the - * production slot. - * @param publicCertificateName Public certificate name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deletePublicCertificateSlotAsync( - String resourceGroupName, String name, String slot, String publicCertificateName) { - return deletePublicCertificateSlotWithResponseAsync(resourceGroupName, name, slot, publicCertificateName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes a hostname binding for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the binding for the - * production slot. - * @param publicCertificateName Public certificate name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deletePublicCertificateSlot( - String resourceGroupName, String name, String slot, String publicCertificateName) { - deletePublicCertificateSlotAsync(resourceGroupName, name, slot, publicCertificateName).block(); - } - - /** - * Deletes a hostname binding for an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the binding for the - * production slot. - * @param publicCertificateName Public certificate name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deletePublicCertificateSlotWithResponse( - String resourceGroupName, String name, String slot, String publicCertificateName, Context context) { - return deletePublicCertificateSlotWithResponseAsync( - resourceGroupName, name, slot, publicCertificateName, context) - .block(); - } - - /** - * Gets the publishing profile for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the publishing profile for - * the production slot. - * @param publishingProfileOptions Specifies publishingProfileOptions for publishing profile. For example, use - * {"format": "FileZilla3"} to get a FileZilla publishing profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the publishing profile for an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listPublishingProfileXmlWithSecretsSlotWithResponseAsync( - String resourceGroupName, String name, String slot, CsmPublishingProfileOptions publishingProfileOptions) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (publishingProfileOptions == null) { - return Mono - .error( - new IllegalArgumentException("Parameter publishingProfileOptions is required and cannot be null.")); - } else { - publishingProfileOptions.validate(); - } - final String accept = "application/xml"; - return FluxUtil - .withContext( - context -> - service - .listPublishingProfileXmlWithSecretsSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - publishingProfileOptions, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the publishing profile for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the publishing profile for - * the production slot. - * @param publishingProfileOptions Specifies publishingProfileOptions for publishing profile. For example, use - * {"format": "FileZilla3"} to get a FileZilla publishing profile. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the publishing profile for an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listPublishingProfileXmlWithSecretsSlotWithResponseAsync( - String resourceGroupName, - String name, - String slot, - CsmPublishingProfileOptions publishingProfileOptions, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (publishingProfileOptions == null) { - return Mono - .error( - new IllegalArgumentException("Parameter publishingProfileOptions is required and cannot be null.")); - } else { - publishingProfileOptions.validate(); - } - final String accept = "application/xml"; - context = this.client.mergeContext(context); - return service - .listPublishingProfileXmlWithSecretsSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - publishingProfileOptions, - accept, - context); - } - - /** - * Gets the publishing profile for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the publishing profile for - * the production slot. - * @param publishingProfileOptions Specifies publishingProfileOptions for publishing profile. For example, use - * {"format": "FileZilla3"} to get a FileZilla publishing profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the publishing profile for an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Flux listPublishingProfileXmlWithSecretsSlotAsync( - String resourceGroupName, String name, String slot, CsmPublishingProfileOptions publishingProfileOptions) { - return listPublishingProfileXmlWithSecretsSlotWithResponseAsync( - resourceGroupName, name, slot, publishingProfileOptions) - .flatMapMany(StreamResponse::getValue); - } - - /** - * Gets the publishing profile for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the publishing profile for - * the production slot. - * @param publishingProfileOptions Specifies publishingProfileOptions for publishing profile. For example, use - * {"format": "FileZilla3"} to get a FileZilla publishing profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the publishing profile for an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public InputStream listPublishingProfileXmlWithSecretsSlot( - String resourceGroupName, String name, String slot, CsmPublishingProfileOptions publishingProfileOptions) { - Iterator iterator = - listPublishingProfileXmlWithSecretsSlotAsync(resourceGroupName, name, slot, publishingProfileOptions) - .map(ByteBufferBackedInputStream::new) - .toStream() - .iterator(); - Enumeration enumeration = - new Enumeration() { - @Override - public boolean hasMoreElements() { - return iterator.hasNext(); - } - - @Override - public InputStream nextElement() { - return iterator.next(); - } - }; - return new SequenceInputStream(enumeration); - } - - /** - * Gets the publishing profile for an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the publishing profile for - * the production slot. - * @param publishingProfileOptions Specifies publishingProfileOptions for publishing profile. For example, use - * {"format": "FileZilla3"} to get a FileZilla publishing profile. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the publishing profile for an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public StreamResponse listPublishingProfileXmlWithSecretsSlotWithResponse( - String resourceGroupName, - String name, - String slot, - CsmPublishingProfileOptions publishingProfileOptions, - Context context) { - return listPublishingProfileXmlWithSecretsSlotWithResponseAsync( - resourceGroupName, name, slot, publishingProfileOptions, context) - .block(); - } - - /** - * Resets the configuration settings of the current slot if they were previously modified by calling the API with - * POST. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API resets configuration settings for - * the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> resetSlotConfigurationSlotWithResponseAsync( - String resourceGroupName, String name, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .resetSlotConfigurationSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Resets the configuration settings of the current slot if they were previously modified by calling the API with - * POST. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API resets configuration settings for - * the production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> resetSlotConfigurationSlotWithResponseAsync( - String resourceGroupName, String name, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .resetSlotConfigurationSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Resets the configuration settings of the current slot if they were previously modified by calling the API with - * POST. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API resets configuration settings for - * the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono resetSlotConfigurationSlotAsync(String resourceGroupName, String name, String slot) { - return resetSlotConfigurationSlotWithResponseAsync(resourceGroupName, name, slot) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Resets the configuration settings of the current slot if they were previously modified by calling the API with - * POST. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API resets configuration settings for - * the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void resetSlotConfigurationSlot(String resourceGroupName, String name, String slot) { - resetSlotConfigurationSlotAsync(resourceGroupName, name, slot).block(); - } - - /** - * Resets the configuration settings of the current slot if they were previously modified by calling the API with - * POST. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API resets configuration settings for - * the production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response resetSlotConfigurationSlotWithResponse( - String resourceGroupName, String name, String slot, Context context) { - return resetSlotConfigurationSlotWithResponseAsync(resourceGroupName, name, slot, context).block(); - } - - /** - * Restarts an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will restart the production slot. - * @param softRestart Specify true to apply the configuration settings and restarts the app only if necessary. By - * default, the API always restarts and reprovisions the app. - * @param synchronous Specify true to block until the app is restarted. By default, it is set to false, and the API - * responds immediately (asynchronous). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> restartSlotWithResponseAsync( - String resourceGroupName, String name, String slot, Boolean softRestart, Boolean synchronous) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .restartSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - softRestart, - synchronous, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Restarts an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will restart the production slot. - * @param softRestart Specify true to apply the configuration settings and restarts the app only if necessary. By - * default, the API always restarts and reprovisions the app. - * @param synchronous Specify true to block until the app is restarted. By default, it is set to false, and the API - * responds immediately (asynchronous). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> restartSlotWithResponseAsync( - String resourceGroupName, String name, String slot, Boolean softRestart, Boolean synchronous, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .restartSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - softRestart, - synchronous, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Restarts an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will restart the production slot. - * @param softRestart Specify true to apply the configuration settings and restarts the app only if necessary. By - * default, the API always restarts and reprovisions the app. - * @param synchronous Specify true to block until the app is restarted. By default, it is set to false, and the API - * responds immediately (asynchronous). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono restartSlotAsync( - String resourceGroupName, String name, String slot, Boolean softRestart, Boolean synchronous) { - return restartSlotWithResponseAsync(resourceGroupName, name, slot, softRestart, synchronous) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Restarts an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will restart the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono restartSlotAsync(String resourceGroupName, String name, String slot) { - final Boolean softRestart = null; - final Boolean synchronous = null; - return restartSlotWithResponseAsync(resourceGroupName, name, slot, softRestart, synchronous) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Restarts an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will restart the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void restartSlot(String resourceGroupName, String name, String slot) { - final Boolean softRestart = null; - final Boolean synchronous = null; - restartSlotAsync(resourceGroupName, name, slot, softRestart, synchronous).block(); - } - - /** - * Restarts an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will restart the production slot. - * @param softRestart Specify true to apply the configuration settings and restarts the app only if necessary. By - * default, the API always restarts and reprovisions the app. - * @param synchronous Specify true to block until the app is restarted. By default, it is set to false, and the API - * responds immediately (asynchronous). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response restartSlotWithResponse( - String resourceGroupName, String name, String slot, Boolean softRestart, Boolean synchronous, Context context) { - return restartSlotWithResponseAsync(resourceGroupName, name, slot, softRestart, synchronous, context).block(); - } - - /** - * Restores an app from a backup blob in Azure Storage. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will restore a backup of the - * production slot. - * @param request Information on restore request . - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> restoreFromBackupBlobSlotWithResponseAsync( - String resourceGroupName, String name, String slot, RestoreRequestInner request) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (request == null) { - return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); - } else { - request.validate(); - } - return FluxUtil - .withContext( - context -> - service - .restoreFromBackupBlobSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - request, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Restores an app from a backup blob in Azure Storage. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will restore a backup of the - * production slot. - * @param request Information on restore request . - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> restoreFromBackupBlobSlotWithResponseAsync( - String resourceGroupName, String name, String slot, RestoreRequestInner request, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (request == null) { - return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); - } else { - request.validate(); - } - context = this.client.mergeContext(context); - return service - .restoreFromBackupBlobSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - request, - context); - } - - /** - * Restores an app from a backup blob in Azure Storage. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will restore a backup of the - * production slot. - * @param request Information on restore request . - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginRestoreFromBackupBlobSlotAsync( - String resourceGroupName, String name, String slot, RestoreRequestInner request) { - Mono>> mono = - restoreFromBackupBlobSlotWithResponseAsync(resourceGroupName, name, slot, request); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Restores an app from a backup blob in Azure Storage. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will restore a backup of the - * production slot. - * @param request Information on restore request . - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginRestoreFromBackupBlobSlotAsync( - String resourceGroupName, String name, String slot, RestoreRequestInner request, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - restoreFromBackupBlobSlotWithResponseAsync(resourceGroupName, name, slot, request, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Restores an app from a backup blob in Azure Storage. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will restore a backup of the - * production slot. - * @param request Information on restore request . - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginRestoreFromBackupBlobSlot( - String resourceGroupName, String name, String slot, RestoreRequestInner request) { - return beginRestoreFromBackupBlobSlotAsync(resourceGroupName, name, slot, request).getSyncPoller(); - } - - /** - * Restores an app from a backup blob in Azure Storage. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will restore a backup of the - * production slot. - * @param request Information on restore request . - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginRestoreFromBackupBlobSlot( - String resourceGroupName, String name, String slot, RestoreRequestInner request, Context context) { - return beginRestoreFromBackupBlobSlotAsync(resourceGroupName, name, slot, request, context).getSyncPoller(); - } - - /** - * Restores an app from a backup blob in Azure Storage. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will restore a backup of the - * production slot. - * @param request Information on restore request . - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono restoreFromBackupBlobSlotAsync( - String resourceGroupName, String name, String slot, RestoreRequestInner request) { - return beginRestoreFromBackupBlobSlotAsync(resourceGroupName, name, slot, request) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Restores an app from a backup blob in Azure Storage. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will restore a backup of the - * production slot. - * @param request Information on restore request . - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono restoreFromBackupBlobSlotAsync( - String resourceGroupName, String name, String slot, RestoreRequestInner request, Context context) { - return beginRestoreFromBackupBlobSlotAsync(resourceGroupName, name, slot, request, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Restores an app from a backup blob in Azure Storage. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will restore a backup of the - * production slot. - * @param request Information on restore request . - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void restoreFromBackupBlobSlot( - String resourceGroupName, String name, String slot, RestoreRequestInner request) { - restoreFromBackupBlobSlotAsync(resourceGroupName, name, slot, request).block(); - } - - /** - * Restores an app from a backup blob in Azure Storage. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will restore a backup of the - * production slot. - * @param request Information on restore request . - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void restoreFromBackupBlobSlot( - String resourceGroupName, String name, String slot, RestoreRequestInner request, Context context) { - restoreFromBackupBlobSlotAsync(resourceGroupName, name, slot, request, context).block(); - } - - /** - * Restores a deleted web app to this web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param restoreRequest Deleted web app restore information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> restoreFromDeletedAppSlotWithResponseAsync( - String resourceGroupName, String name, String slot, DeletedAppRestoreRequest restoreRequest) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (restoreRequest == null) { - return Mono.error(new IllegalArgumentException("Parameter restoreRequest is required and cannot be null.")); - } else { - restoreRequest.validate(); - } - return FluxUtil - .withContext( - context -> - service - .restoreFromDeletedAppSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - restoreRequest, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Restores a deleted web app to this web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param restoreRequest Deleted web app restore information. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> restoreFromDeletedAppSlotWithResponseAsync( - String resourceGroupName, String name, String slot, DeletedAppRestoreRequest restoreRequest, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (restoreRequest == null) { - return Mono.error(new IllegalArgumentException("Parameter restoreRequest is required and cannot be null.")); - } else { - restoreRequest.validate(); - } - context = this.client.mergeContext(context); - return service - .restoreFromDeletedAppSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - restoreRequest, - context); - } - - /** - * Restores a deleted web app to this web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param restoreRequest Deleted web app restore information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginRestoreFromDeletedAppSlotAsync( - String resourceGroupName, String name, String slot, DeletedAppRestoreRequest restoreRequest) { - Mono>> mono = - restoreFromDeletedAppSlotWithResponseAsync(resourceGroupName, name, slot, restoreRequest); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Restores a deleted web app to this web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param restoreRequest Deleted web app restore information. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginRestoreFromDeletedAppSlotAsync( - String resourceGroupName, String name, String slot, DeletedAppRestoreRequest restoreRequest, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - restoreFromDeletedAppSlotWithResponseAsync(resourceGroupName, name, slot, restoreRequest, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Restores a deleted web app to this web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param restoreRequest Deleted web app restore information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginRestoreFromDeletedAppSlot( - String resourceGroupName, String name, String slot, DeletedAppRestoreRequest restoreRequest) { - return beginRestoreFromDeletedAppSlotAsync(resourceGroupName, name, slot, restoreRequest).getSyncPoller(); - } - - /** - * Restores a deleted web app to this web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param restoreRequest Deleted web app restore information. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginRestoreFromDeletedAppSlot( - String resourceGroupName, String name, String slot, DeletedAppRestoreRequest restoreRequest, Context context) { - return beginRestoreFromDeletedAppSlotAsync(resourceGroupName, name, slot, restoreRequest, context) - .getSyncPoller(); - } - - /** - * Restores a deleted web app to this web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param restoreRequest Deleted web app restore information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono restoreFromDeletedAppSlotAsync( - String resourceGroupName, String name, String slot, DeletedAppRestoreRequest restoreRequest) { - return beginRestoreFromDeletedAppSlotAsync(resourceGroupName, name, slot, restoreRequest) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Restores a deleted web app to this web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param restoreRequest Deleted web app restore information. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono restoreFromDeletedAppSlotAsync( - String resourceGroupName, String name, String slot, DeletedAppRestoreRequest restoreRequest, Context context) { - return beginRestoreFromDeletedAppSlotAsync(resourceGroupName, name, slot, restoreRequest, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Restores a deleted web app to this web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param restoreRequest Deleted web app restore information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void restoreFromDeletedAppSlot( - String resourceGroupName, String name, String slot, DeletedAppRestoreRequest restoreRequest) { - restoreFromDeletedAppSlotAsync(resourceGroupName, name, slot, restoreRequest).block(); - } - - /** - * Restores a deleted web app to this web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param restoreRequest Deleted web app restore information. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void restoreFromDeletedAppSlot( - String resourceGroupName, String name, String slot, DeletedAppRestoreRequest restoreRequest, Context context) { - restoreFromDeletedAppSlotAsync(resourceGroupName, name, slot, restoreRequest, context).block(); - } - - /** - * Restores a web app from a snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param restoreRequest Snapshot restore settings. Snapshot information can be obtained by calling GetDeletedSites - * or GetSiteSnapshots API. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> restoreSnapshotSlotWithResponseAsync( - String resourceGroupName, String name, String slot, SnapshotRestoreRequest restoreRequest) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (restoreRequest == null) { - return Mono.error(new IllegalArgumentException("Parameter restoreRequest is required and cannot be null.")); - } else { - restoreRequest.validate(); - } - return FluxUtil - .withContext( - context -> - service - .restoreSnapshotSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - restoreRequest, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Restores a web app from a snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param restoreRequest Snapshot restore settings. Snapshot information can be obtained by calling GetDeletedSites - * or GetSiteSnapshots API. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> restoreSnapshotSlotWithResponseAsync( - String resourceGroupName, String name, String slot, SnapshotRestoreRequest restoreRequest, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (restoreRequest == null) { - return Mono.error(new IllegalArgumentException("Parameter restoreRequest is required and cannot be null.")); - } else { - restoreRequest.validate(); - } - context = this.client.mergeContext(context); - return service - .restoreSnapshotSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - restoreRequest, - context); - } - - /** - * Restores a web app from a snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param restoreRequest Snapshot restore settings. Snapshot information can be obtained by calling GetDeletedSites - * or GetSiteSnapshots API. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginRestoreSnapshotSlotAsync( - String resourceGroupName, String name, String slot, SnapshotRestoreRequest restoreRequest) { - Mono>> mono = - restoreSnapshotSlotWithResponseAsync(resourceGroupName, name, slot, restoreRequest); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Restores a web app from a snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param restoreRequest Snapshot restore settings. Snapshot information can be obtained by calling GetDeletedSites - * or GetSiteSnapshots API. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginRestoreSnapshotSlotAsync( - String resourceGroupName, String name, String slot, SnapshotRestoreRequest restoreRequest, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - restoreSnapshotSlotWithResponseAsync(resourceGroupName, name, slot, restoreRequest, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Restores a web app from a snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param restoreRequest Snapshot restore settings. Snapshot information can be obtained by calling GetDeletedSites - * or GetSiteSnapshots API. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginRestoreSnapshotSlot( - String resourceGroupName, String name, String slot, SnapshotRestoreRequest restoreRequest) { - return beginRestoreSnapshotSlotAsync(resourceGroupName, name, slot, restoreRequest).getSyncPoller(); - } - - /** - * Restores a web app from a snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param restoreRequest Snapshot restore settings. Snapshot information can be obtained by calling GetDeletedSites - * or GetSiteSnapshots API. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginRestoreSnapshotSlot( - String resourceGroupName, String name, String slot, SnapshotRestoreRequest restoreRequest, Context context) { - return beginRestoreSnapshotSlotAsync(resourceGroupName, name, slot, restoreRequest, context).getSyncPoller(); - } - - /** - * Restores a web app from a snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param restoreRequest Snapshot restore settings. Snapshot information can be obtained by calling GetDeletedSites - * or GetSiteSnapshots API. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono restoreSnapshotSlotAsync( - String resourceGroupName, String name, String slot, SnapshotRestoreRequest restoreRequest) { - return beginRestoreSnapshotSlotAsync(resourceGroupName, name, slot, restoreRequest) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Restores a web app from a snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param restoreRequest Snapshot restore settings. Snapshot information can be obtained by calling GetDeletedSites - * or GetSiteSnapshots API. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono restoreSnapshotSlotAsync( - String resourceGroupName, String name, String slot, SnapshotRestoreRequest restoreRequest, Context context) { - return beginRestoreSnapshotSlotAsync(resourceGroupName, name, slot, restoreRequest, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Restores a web app from a snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param restoreRequest Snapshot restore settings. Snapshot information can be obtained by calling GetDeletedSites - * or GetSiteSnapshots API. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void restoreSnapshotSlot( - String resourceGroupName, String name, String slot, SnapshotRestoreRequest restoreRequest) { - restoreSnapshotSlotAsync(resourceGroupName, name, slot, restoreRequest).block(); - } - - /** - * Restores a web app from a snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param restoreRequest Snapshot restore settings. Snapshot information can be obtained by calling GetDeletedSites - * or GetSiteSnapshots API. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void restoreSnapshotSlot( - String resourceGroupName, String name, String slot, SnapshotRestoreRequest restoreRequest, Context context) { - restoreSnapshotSlotAsync(resourceGroupName, name, slot, restoreRequest, context).block(); - } - - /** - * Get list of siteextensions for a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of siteextensions for a web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSiteExtensionsSlotSinglePageAsync( - String resourceGroupName, String name, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listSiteExtensionsSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get list of siteextensions for a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of siteextensions for a web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSiteExtensionsSlotSinglePageAsync( - String resourceGroupName, String name, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listSiteExtensionsSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get list of siteextensions for a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of siteextensions for a web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listSiteExtensionsSlotAsync( - String resourceGroupName, String name, String slot) { - return new PagedFlux<>( - () -> listSiteExtensionsSlotSinglePageAsync(resourceGroupName, name, slot), - nextLink -> listSiteExtensionsSlotNextSinglePageAsync(nextLink)); - } - - /** - * Get list of siteextensions for a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of siteextensions for a web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listSiteExtensionsSlotAsync( - String resourceGroupName, String name, String slot, Context context) { - return new PagedFlux<>( - () -> listSiteExtensionsSlotSinglePageAsync(resourceGroupName, name, slot, context), - nextLink -> listSiteExtensionsSlotNextSinglePageAsync(nextLink, context)); - } - - /** - * Get list of siteextensions for a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of siteextensions for a web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listSiteExtensionsSlot( - String resourceGroupName, String name, String slot) { - return new PagedIterable<>(listSiteExtensionsSlotAsync(resourceGroupName, name, slot)); - } - - /** - * Get list of siteextensions for a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of siteextensions for a web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listSiteExtensionsSlot( - String resourceGroupName, String name, String slot, Context context) { - return new PagedIterable<>(listSiteExtensionsSlotAsync(resourceGroupName, name, slot, context)); - } - - /** - * Get site extension information by its ID for a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site extension information by its ID for a web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getSiteExtensionSlotWithResponseAsync( - String resourceGroupName, String name, String siteExtensionId, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (siteExtensionId == null) { - return Mono - .error(new IllegalArgumentException("Parameter siteExtensionId is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getSiteExtensionSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - siteExtensionId, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get site extension information by its ID for a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site extension information by its ID for a web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getSiteExtensionSlotWithResponseAsync( - String resourceGroupName, String name, String siteExtensionId, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (siteExtensionId == null) { - return Mono - .error(new IllegalArgumentException("Parameter siteExtensionId is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getSiteExtensionSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - siteExtensionId, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Get site extension information by its ID for a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site extension information by its ID for a web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getSiteExtensionSlotAsync( - String resourceGroupName, String name, String siteExtensionId, String slot) { - return getSiteExtensionSlotWithResponseAsync(resourceGroupName, name, siteExtensionId, slot) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get site extension information by its ID for a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site extension information by its ID for a web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SiteExtensionInfoInner getSiteExtensionSlot( - String resourceGroupName, String name, String siteExtensionId, String slot) { - return getSiteExtensionSlotAsync(resourceGroupName, name, siteExtensionId, slot).block(); - } - - /** - * Get site extension information by its ID for a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site extension information by its ID for a web site, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getSiteExtensionSlotWithResponse( - String resourceGroupName, String name, String siteExtensionId, String slot, Context context) { - return getSiteExtensionSlotWithResponseAsync(resourceGroupName, name, siteExtensionId, slot, context).block(); - } - - /** - * Install site extension on a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Extension Information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> installSiteExtensionSlotWithResponseAsync( - String resourceGroupName, String name, String siteExtensionId, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (siteExtensionId == null) { - return Mono - .error(new IllegalArgumentException("Parameter siteExtensionId is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .installSiteExtensionSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - siteExtensionId, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Install site extension on a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Extension Information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> installSiteExtensionSlotWithResponseAsync( - String resourceGroupName, String name, String siteExtensionId, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (siteExtensionId == null) { - return Mono - .error(new IllegalArgumentException("Parameter siteExtensionId is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .installSiteExtensionSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - siteExtensionId, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Install site extension on a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Extension Information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, SiteExtensionInfoInner> beginInstallSiteExtensionSlotAsync( - String resourceGroupName, String name, String siteExtensionId, String slot) { - Mono>> mono = - installSiteExtensionSlotWithResponseAsync(resourceGroupName, name, siteExtensionId, slot); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - SiteExtensionInfoInner.class, - SiteExtensionInfoInner.class, - Context.NONE); - } - - /** - * Install site extension on a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Extension Information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, SiteExtensionInfoInner> beginInstallSiteExtensionSlotAsync( - String resourceGroupName, String name, String siteExtensionId, String slot, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - installSiteExtensionSlotWithResponseAsync(resourceGroupName, name, siteExtensionId, slot, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - SiteExtensionInfoInner.class, - SiteExtensionInfoInner.class, - context); - } - - /** - * Install site extension on a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Extension Information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, SiteExtensionInfoInner> beginInstallSiteExtensionSlot( - String resourceGroupName, String name, String siteExtensionId, String slot) { - return beginInstallSiteExtensionSlotAsync(resourceGroupName, name, siteExtensionId, slot).getSyncPoller(); - } - - /** - * Install site extension on a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Extension Information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, SiteExtensionInfoInner> beginInstallSiteExtensionSlot( - String resourceGroupName, String name, String siteExtensionId, String slot, Context context) { - return beginInstallSiteExtensionSlotAsync(resourceGroupName, name, siteExtensionId, slot, context) - .getSyncPoller(); - } - - /** - * Install site extension on a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Extension Information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono installSiteExtensionSlotAsync( - String resourceGroupName, String name, String siteExtensionId, String slot) { - return beginInstallSiteExtensionSlotAsync(resourceGroupName, name, siteExtensionId, slot) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Install site extension on a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Extension Information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono installSiteExtensionSlotAsync( - String resourceGroupName, String name, String siteExtensionId, String slot, Context context) { - return beginInstallSiteExtensionSlotAsync(resourceGroupName, name, siteExtensionId, slot, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Install site extension on a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Extension Information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SiteExtensionInfoInner installSiteExtensionSlot( - String resourceGroupName, String name, String siteExtensionId, String slot) { - return installSiteExtensionSlotAsync(resourceGroupName, name, siteExtensionId, slot).block(); - } - - /** - * Install site extension on a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Extension Information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SiteExtensionInfoInner installSiteExtensionSlot( - String resourceGroupName, String name, String siteExtensionId, String slot, Context context) { - return installSiteExtensionSlotAsync(resourceGroupName, name, siteExtensionId, slot, context).block(); - } - - /** - * Remove a site extension from a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteSiteExtensionSlotWithResponseAsync( - String resourceGroupName, String name, String siteExtensionId, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (siteExtensionId == null) { - return Mono - .error(new IllegalArgumentException("Parameter siteExtensionId is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .deleteSiteExtensionSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - siteExtensionId, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Remove a site extension from a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteSiteExtensionSlotWithResponseAsync( - String resourceGroupName, String name, String siteExtensionId, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (siteExtensionId == null) { - return Mono - .error(new IllegalArgumentException("Parameter siteExtensionId is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .deleteSiteExtensionSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - siteExtensionId, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Remove a site extension from a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteSiteExtensionSlotAsync( - String resourceGroupName, String name, String siteExtensionId, String slot) { - return deleteSiteExtensionSlotWithResponseAsync(resourceGroupName, name, siteExtensionId, slot) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Remove a site extension from a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteSiteExtensionSlot(String resourceGroupName, String name, String siteExtensionId, String slot) { - deleteSiteExtensionSlotAsync(resourceGroupName, name, siteExtensionId, slot).block(); - } - - /** - * Remove a site extension from a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteSiteExtensionSlotWithResponse( - String resourceGroupName, String name, String siteExtensionId, String slot, Context context) { - return deleteSiteExtensionSlotWithResponseAsync(resourceGroupName, name, siteExtensionId, slot, context) - .block(); - } - - /** - * Get the difference in configuration settings between two web app slots. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the source slot. If a slot is not specified, the production slot is used as the source slot. - * @param slotSwapEntity JSON object that contains the target slot name. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the difference in configuration settings between two web app slots. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSlotDifferencesSlotSinglePageAsync( - String resourceGroupName, String name, String slot, CsmSlotEntity slotSwapEntity) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (slotSwapEntity == null) { - return Mono.error(new IllegalArgumentException("Parameter slotSwapEntity is required and cannot be null.")); - } else { - slotSwapEntity.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listSlotDifferencesSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - slotSwapEntity, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the difference in configuration settings between two web app slots. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the source slot. If a slot is not specified, the production slot is used as the source slot. - * @param slotSwapEntity JSON object that contains the target slot name. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the difference in configuration settings between two web app slots. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSlotDifferencesSlotSinglePageAsync( - String resourceGroupName, String name, String slot, CsmSlotEntity slotSwapEntity, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (slotSwapEntity == null) { - return Mono.error(new IllegalArgumentException("Parameter slotSwapEntity is required and cannot be null.")); - } else { - slotSwapEntity.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listSlotDifferencesSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - slotSwapEntity, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the difference in configuration settings between two web app slots. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the source slot. If a slot is not specified, the production slot is used as the source slot. - * @param slotSwapEntity JSON object that contains the target slot name. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the difference in configuration settings between two web app slots. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listSlotDifferencesSlotAsync( - String resourceGroupName, String name, String slot, CsmSlotEntity slotSwapEntity) { - return new PagedFlux<>( - () -> listSlotDifferencesSlotSinglePageAsync(resourceGroupName, name, slot, slotSwapEntity), - nextLink -> listSlotDifferencesSlotNextSinglePageAsync(nextLink)); - } - - /** - * Get the difference in configuration settings between two web app slots. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the source slot. If a slot is not specified, the production slot is used as the source slot. - * @param slotSwapEntity JSON object that contains the target slot name. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the difference in configuration settings between two web app slots. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listSlotDifferencesSlotAsync( - String resourceGroupName, String name, String slot, CsmSlotEntity slotSwapEntity, Context context) { - return new PagedFlux<>( - () -> listSlotDifferencesSlotSinglePageAsync(resourceGroupName, name, slot, slotSwapEntity, context), - nextLink -> listSlotDifferencesSlotNextSinglePageAsync(nextLink, context)); - } - - /** - * Get the difference in configuration settings between two web app slots. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the source slot. If a slot is not specified, the production slot is used as the source slot. - * @param slotSwapEntity JSON object that contains the target slot name. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the difference in configuration settings between two web app slots. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listSlotDifferencesSlot( - String resourceGroupName, String name, String slot, CsmSlotEntity slotSwapEntity) { - return new PagedIterable<>(listSlotDifferencesSlotAsync(resourceGroupName, name, slot, slotSwapEntity)); - } - - /** - * Get the difference in configuration settings between two web app slots. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the source slot. If a slot is not specified, the production slot is used as the source slot. - * @param slotSwapEntity JSON object that contains the target slot name. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the difference in configuration settings between two web app slots. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listSlotDifferencesSlot( - String resourceGroupName, String name, String slot, CsmSlotEntity slotSwapEntity, Context context) { - return new PagedIterable<>( - listSlotDifferencesSlotAsync(resourceGroupName, name, slot, slotSwapEntity, context)); - } - - /** - * Swaps two deployment slots of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the source slot. If a slot is not specified, the production slot is used as the source slot. - * @param slotSwapEntity JSON object that contains the target slot name. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> swapSlotWithResponseAsync( - String resourceGroupName, String name, String slot, CsmSlotEntity slotSwapEntity) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (slotSwapEntity == null) { - return Mono.error(new IllegalArgumentException("Parameter slotSwapEntity is required and cannot be null.")); - } else { - slotSwapEntity.validate(); - } - return FluxUtil - .withContext( - context -> - service - .swapSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - slotSwapEntity, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Swaps two deployment slots of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the source slot. If a slot is not specified, the production slot is used as the source slot. - * @param slotSwapEntity JSON object that contains the target slot name. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> swapSlotWithResponseAsync( - String resourceGroupName, String name, String slot, CsmSlotEntity slotSwapEntity, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (slotSwapEntity == null) { - return Mono.error(new IllegalArgumentException("Parameter slotSwapEntity is required and cannot be null.")); - } else { - slotSwapEntity.validate(); - } - context = this.client.mergeContext(context); - return service - .swapSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - slotSwapEntity, - context); - } - - /** - * Swaps two deployment slots of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the source slot. If a slot is not specified, the production slot is used as the source slot. - * @param slotSwapEntity JSON object that contains the target slot name. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginSwapSlotAsync( - String resourceGroupName, String name, String slot, CsmSlotEntity slotSwapEntity) { - Mono>> mono = - swapSlotWithResponseAsync(resourceGroupName, name, slot, slotSwapEntity); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Swaps two deployment slots of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the source slot. If a slot is not specified, the production slot is used as the source slot. - * @param slotSwapEntity JSON object that contains the target slot name. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginSwapSlotAsync( - String resourceGroupName, String name, String slot, CsmSlotEntity slotSwapEntity, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - swapSlotWithResponseAsync(resourceGroupName, name, slot, slotSwapEntity, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Swaps two deployment slots of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the source slot. If a slot is not specified, the production slot is used as the source slot. - * @param slotSwapEntity JSON object that contains the target slot name. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginSwapSlot( - String resourceGroupName, String name, String slot, CsmSlotEntity slotSwapEntity) { - return beginSwapSlotAsync(resourceGroupName, name, slot, slotSwapEntity).getSyncPoller(); - } - - /** - * Swaps two deployment slots of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the source slot. If a slot is not specified, the production slot is used as the source slot. - * @param slotSwapEntity JSON object that contains the target slot name. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginSwapSlot( - String resourceGroupName, String name, String slot, CsmSlotEntity slotSwapEntity, Context context) { - return beginSwapSlotAsync(resourceGroupName, name, slot, slotSwapEntity, context).getSyncPoller(); - } - - /** - * Swaps two deployment slots of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the source slot. If a slot is not specified, the production slot is used as the source slot. - * @param slotSwapEntity JSON object that contains the target slot name. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono swapSlotAsync(String resourceGroupName, String name, String slot, CsmSlotEntity slotSwapEntity) { - return beginSwapSlotAsync(resourceGroupName, name, slot, slotSwapEntity) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Swaps two deployment slots of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the source slot. If a slot is not specified, the production slot is used as the source slot. - * @param slotSwapEntity JSON object that contains the target slot name. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono swapSlotAsync( - String resourceGroupName, String name, String slot, CsmSlotEntity slotSwapEntity, Context context) { - return beginSwapSlotAsync(resourceGroupName, name, slot, slotSwapEntity, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Swaps two deployment slots of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the source slot. If a slot is not specified, the production slot is used as the source slot. - * @param slotSwapEntity JSON object that contains the target slot name. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void swapSlot(String resourceGroupName, String name, String slot, CsmSlotEntity slotSwapEntity) { - swapSlotAsync(resourceGroupName, name, slot, slotSwapEntity).block(); - } - - /** - * Swaps two deployment slots of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the source slot. If a slot is not specified, the production slot is used as the source slot. - * @param slotSwapEntity JSON object that contains the target slot name. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void swapSlot( - String resourceGroupName, String name, String slot, CsmSlotEntity slotSwapEntity, Context context) { - swapSlotAsync(resourceGroupName, name, slot, slotSwapEntity, context).block(); - } - - /** - * Returns all Snapshots to the user. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Website Name. - * @param slot Website Slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of snapshots which can be used to revert an app to a previous time. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSnapshotsSlotSinglePageAsync( - String resourceGroupName, String name, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listSnapshotsSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns all Snapshots to the user. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Website Name. - * @param slot Website Slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of snapshots which can be used to revert an app to a previous time. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSnapshotsSlotSinglePageAsync( - String resourceGroupName, String name, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listSnapshotsSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Returns all Snapshots to the user. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Website Name. - * @param slot Website Slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of snapshots which can be used to revert an app to a previous time. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listSnapshotsSlotAsync(String resourceGroupName, String name, String slot) { - return new PagedFlux<>( - () -> listSnapshotsSlotSinglePageAsync(resourceGroupName, name, slot), - nextLink -> listSnapshotsSlotNextSinglePageAsync(nextLink)); - } - - /** - * Returns all Snapshots to the user. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Website Name. - * @param slot Website Slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of snapshots which can be used to revert an app to a previous time. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listSnapshotsSlotAsync( - String resourceGroupName, String name, String slot, Context context) { - return new PagedFlux<>( - () -> listSnapshotsSlotSinglePageAsync(resourceGroupName, name, slot, context), - nextLink -> listSnapshotsSlotNextSinglePageAsync(nextLink, context)); - } - - /** - * Returns all Snapshots to the user. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Website Name. - * @param slot Website Slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of snapshots which can be used to revert an app to a previous time. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listSnapshotsSlot(String resourceGroupName, String name, String slot) { - return new PagedIterable<>(listSnapshotsSlotAsync(resourceGroupName, name, slot)); - } - - /** - * Returns all Snapshots to the user. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Website Name. - * @param slot Website Slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of snapshots which can be used to revert an app to a previous time. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listSnapshotsSlot( - String resourceGroupName, String name, String slot, Context context) { - return new PagedIterable<>(listSnapshotsSlotAsync(resourceGroupName, name, slot, context)); - } - - /** - * Returns all Snapshots to the user from DRSecondary endpoint. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Website Name. - * @param slot Website Slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of snapshots which can be used to revert an app to a previous time. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSnapshotsFromDRSecondarySlotSinglePageAsync( - String resourceGroupName, String name, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listSnapshotsFromDRSecondarySlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns all Snapshots to the user from DRSecondary endpoint. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Website Name. - * @param slot Website Slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of snapshots which can be used to revert an app to a previous time. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSnapshotsFromDRSecondarySlotSinglePageAsync( - String resourceGroupName, String name, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listSnapshotsFromDRSecondarySlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Returns all Snapshots to the user from DRSecondary endpoint. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Website Name. - * @param slot Website Slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of snapshots which can be used to revert an app to a previous time. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listSnapshotsFromDRSecondarySlotAsync( - String resourceGroupName, String name, String slot) { - return new PagedFlux<>( - () -> listSnapshotsFromDRSecondarySlotSinglePageAsync(resourceGroupName, name, slot), - nextLink -> listSnapshotsFromDRSecondarySlotNextSinglePageAsync(nextLink)); - } - - /** - * Returns all Snapshots to the user from DRSecondary endpoint. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Website Name. - * @param slot Website Slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of snapshots which can be used to revert an app to a previous time. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listSnapshotsFromDRSecondarySlotAsync( - String resourceGroupName, String name, String slot, Context context) { - return new PagedFlux<>( - () -> listSnapshotsFromDRSecondarySlotSinglePageAsync(resourceGroupName, name, slot, context), - nextLink -> listSnapshotsFromDRSecondarySlotNextSinglePageAsync(nextLink, context)); - } - - /** - * Returns all Snapshots to the user from DRSecondary endpoint. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Website Name. - * @param slot Website Slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of snapshots which can be used to revert an app to a previous time. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listSnapshotsFromDRSecondarySlot( - String resourceGroupName, String name, String slot) { - return new PagedIterable<>(listSnapshotsFromDRSecondarySlotAsync(resourceGroupName, name, slot)); - } - - /** - * Returns all Snapshots to the user from DRSecondary endpoint. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Website Name. - * @param slot Website Slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of snapshots which can be used to revert an app to a previous time. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listSnapshotsFromDRSecondarySlot( - String resourceGroupName, String name, String slot, Context context) { - return new PagedIterable<>(listSnapshotsFromDRSecondarySlotAsync(resourceGroupName, name, slot, context)); - } - - /** - * Gets the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the source control - * configuration for the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source control configuration of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getSourceControlSlotWithResponseAsync( - String resourceGroupName, String name, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getSourceControlSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the source control - * configuration for the production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source control configuration of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getSourceControlSlotWithResponseAsync( - String resourceGroupName, String name, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getSourceControlSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the source control - * configuration for the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source control configuration of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getSourceControlSlotAsync(String resourceGroupName, String name, String slot) { - return getSourceControlSlotWithResponseAsync(resourceGroupName, name, slot) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the source control - * configuration for the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source control configuration of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SiteSourceControlInner getSourceControlSlot(String resourceGroupName, String name, String slot) { - return getSourceControlSlotAsync(resourceGroupName, name, slot).block(); - } - - /** - * Gets the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the source control - * configuration for the production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source control configuration of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getSourceControlSlotWithResponse( - String resourceGroupName, String name, String slot, Context context) { - return getSourceControlSlotWithResponseAsync(resourceGroupName, name, slot, context).block(); - } - - /** - * Updates the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the source control - * configuration for the production slot. - * @param siteSourceControl JSON representation of a SiteSourceControl object. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control configuration for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateSourceControlSlotWithResponseAsync( - String resourceGroupName, String name, String slot, SiteSourceControlInner siteSourceControl) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (siteSourceControl == null) { - return Mono - .error(new IllegalArgumentException("Parameter siteSourceControl is required and cannot be null.")); - } else { - siteSourceControl.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdateSourceControlSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - siteSourceControl, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the source control - * configuration for the production slot. - * @param siteSourceControl JSON representation of a SiteSourceControl object. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control configuration for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateSourceControlSlotWithResponseAsync( - String resourceGroupName, String name, String slot, SiteSourceControlInner siteSourceControl, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (siteSourceControl == null) { - return Mono - .error(new IllegalArgumentException("Parameter siteSourceControl is required and cannot be null.")); - } else { - siteSourceControl.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdateSourceControlSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - siteSourceControl, - accept, - context); - } - - /** - * Updates the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the source control - * configuration for the production slot. - * @param siteSourceControl JSON representation of a SiteSourceControl object. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control configuration for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, SiteSourceControlInner> - beginCreateOrUpdateSourceControlSlotAsync( - String resourceGroupName, String name, String slot, SiteSourceControlInner siteSourceControl) { - Mono>> mono = - createOrUpdateSourceControlSlotWithResponseAsync(resourceGroupName, name, slot, siteSourceControl); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - SiteSourceControlInner.class, - SiteSourceControlInner.class, - Context.NONE); - } - - /** - * Updates the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the source control - * configuration for the production slot. - * @param siteSourceControl JSON representation of a SiteSourceControl object. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control configuration for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, SiteSourceControlInner> - beginCreateOrUpdateSourceControlSlotAsync( - String resourceGroupName, - String name, - String slot, - SiteSourceControlInner siteSourceControl, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateSourceControlSlotWithResponseAsync(resourceGroupName, name, slot, siteSourceControl, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - SiteSourceControlInner.class, - SiteSourceControlInner.class, - context); - } - - /** - * Updates the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the source control - * configuration for the production slot. - * @param siteSourceControl JSON representation of a SiteSourceControl object. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control configuration for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, SiteSourceControlInner> beginCreateOrUpdateSourceControlSlot( - String resourceGroupName, String name, String slot, SiteSourceControlInner siteSourceControl) { - return beginCreateOrUpdateSourceControlSlotAsync(resourceGroupName, name, slot, siteSourceControl) - .getSyncPoller(); - } - - /** - * Updates the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the source control - * configuration for the production slot. - * @param siteSourceControl JSON representation of a SiteSourceControl object. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control configuration for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, SiteSourceControlInner> beginCreateOrUpdateSourceControlSlot( - String resourceGroupName, String name, String slot, SiteSourceControlInner siteSourceControl, Context context) { - return beginCreateOrUpdateSourceControlSlotAsync(resourceGroupName, name, slot, siteSourceControl, context) - .getSyncPoller(); - } - - /** - * Updates the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the source control - * configuration for the production slot. - * @param siteSourceControl JSON representation of a SiteSourceControl object. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control configuration for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateSourceControlSlotAsync( - String resourceGroupName, String name, String slot, SiteSourceControlInner siteSourceControl) { - return beginCreateOrUpdateSourceControlSlotAsync(resourceGroupName, name, slot, siteSourceControl) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the source control - * configuration for the production slot. - * @param siteSourceControl JSON representation of a SiteSourceControl object. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control configuration for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateSourceControlSlotAsync( - String resourceGroupName, String name, String slot, SiteSourceControlInner siteSourceControl, Context context) { - return beginCreateOrUpdateSourceControlSlotAsync(resourceGroupName, name, slot, siteSourceControl, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the source control - * configuration for the production slot. - * @param siteSourceControl JSON representation of a SiteSourceControl object. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control configuration for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SiteSourceControlInner createOrUpdateSourceControlSlot( - String resourceGroupName, String name, String slot, SiteSourceControlInner siteSourceControl) { - return createOrUpdateSourceControlSlotAsync(resourceGroupName, name, slot, siteSourceControl).block(); - } - - /** - * Updates the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the source control - * configuration for the production slot. - * @param siteSourceControl JSON representation of a SiteSourceControl object. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control configuration for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SiteSourceControlInner createOrUpdateSourceControlSlot( - String resourceGroupName, String name, String slot, SiteSourceControlInner siteSourceControl, Context context) { - return createOrUpdateSourceControlSlotAsync(resourceGroupName, name, slot, siteSourceControl, context).block(); - } - - /** - * Deletes the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the source control - * configuration for the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteSourceControlSlotWithResponseAsync( - String resourceGroupName, String name, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .deleteSourceControlSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the source control - * configuration for the production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteSourceControlSlotWithResponseAsync( - String resourceGroupName, String name, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .deleteSourceControlSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Deletes the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the source control - * configuration for the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteSourceControlSlotAsync(String resourceGroupName, String name, String slot) { - return deleteSourceControlSlotWithResponseAsync(resourceGroupName, name, slot) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the source control - * configuration for the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteSourceControlSlot(String resourceGroupName, String name, String slot) { - deleteSourceControlSlotAsync(resourceGroupName, name, slot).block(); - } - - /** - * Deletes the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the source control - * configuration for the production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteSourceControlSlotWithResponse( - String resourceGroupName, String name, String slot, Context context) { - return deleteSourceControlSlotWithResponseAsync(resourceGroupName, name, slot, context).block(); - } - - /** - * Updates the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the source control - * configuration for the production slot. - * @param siteSourceControl JSON representation of a SiteSourceControl object. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control configuration for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateSourceControlSlotWithResponseAsync( - String resourceGroupName, String name, String slot, SiteSourceControlInner siteSourceControl) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (siteSourceControl == null) { - return Mono - .error(new IllegalArgumentException("Parameter siteSourceControl is required and cannot be null.")); - } else { - siteSourceControl.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updateSourceControlSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - siteSourceControl, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the source control - * configuration for the production slot. - * @param siteSourceControl JSON representation of a SiteSourceControl object. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control configuration for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateSourceControlSlotWithResponseAsync( - String resourceGroupName, String name, String slot, SiteSourceControlInner siteSourceControl, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (siteSourceControl == null) { - return Mono - .error(new IllegalArgumentException("Parameter siteSourceControl is required and cannot be null.")); - } else { - siteSourceControl.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updateSourceControlSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - siteSourceControl, - accept, - context); - } - - /** - * Updates the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the source control - * configuration for the production slot. - * @param siteSourceControl JSON representation of a SiteSourceControl object. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control configuration for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateSourceControlSlotAsync( - String resourceGroupName, String name, String slot, SiteSourceControlInner siteSourceControl) { - return updateSourceControlSlotWithResponseAsync(resourceGroupName, name, slot, siteSourceControl) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Updates the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the source control - * configuration for the production slot. - * @param siteSourceControl JSON representation of a SiteSourceControl object. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control configuration for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SiteSourceControlInner updateSourceControlSlot( - String resourceGroupName, String name, String slot, SiteSourceControlInner siteSourceControl) { - return updateSourceControlSlotAsync(resourceGroupName, name, slot, siteSourceControl).block(); - } - - /** - * Updates the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the source control - * configuration for the production slot. - * @param siteSourceControl JSON representation of a SiteSourceControl object. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control configuration for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateSourceControlSlotWithResponse( - String resourceGroupName, String name, String slot, SiteSourceControlInner siteSourceControl, Context context) { - return updateSourceControlSlotWithResponseAsync(resourceGroupName, name, slot, siteSourceControl, context) - .block(); - } - - /** - * Starts an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will start the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> startSlotWithResponseAsync(String resourceGroupName, String name, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .startSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Starts an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will start the production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> startSlotWithResponseAsync( - String resourceGroupName, String name, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .startSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Starts an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will start the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono startSlotAsync(String resourceGroupName, String name, String slot) { - return startSlotWithResponseAsync(resourceGroupName, name, slot).flatMap((Response res) -> Mono.empty()); - } - - /** - * Starts an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will start the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void startSlot(String resourceGroupName, String name, String slot) { - startSlotAsync(resourceGroupName, name, slot).block(); - } - - /** - * Starts an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will start the production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response startSlotWithResponse(String resourceGroupName, String name, String slot, Context context) { - return startSlotWithResponseAsync(resourceGroupName, name, slot, context).block(); - } - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> startNetworkTraceSlotWithResponseAsync( - String resourceGroupName, - String name, - String slot, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .startNetworkTraceSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - durationInSeconds, - slot, - maxFrameLength, - sasUrl, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> startNetworkTraceSlotWithResponseAsync( - String resourceGroupName, - String name, - String slot, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .startNetworkTraceSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - durationInSeconds, - slot, - maxFrameLength, - sasUrl, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Object> beginStartNetworkTraceSlotAsync( - String resourceGroupName, - String name, - String slot, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl) { - Mono>> mono = - startNetworkTraceSlotWithResponseAsync( - resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Object.class, Object.class, this.client.getContext()); - } - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Object> beginStartNetworkTraceSlotAsync( - String resourceGroupName, - String name, - String slot, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - startNetworkTraceSlotWithResponseAsync( - resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Object.class, Object.class, context); - } - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Object> beginStartNetworkTraceSlot( - String resourceGroupName, - String name, - String slot, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl) { - return beginStartNetworkTraceSlotAsync(resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl) - .getSyncPoller(); - } - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Object> beginStartNetworkTraceSlot( - String resourceGroupName, - String name, - String slot, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl, - Context context) { - return beginStartNetworkTraceSlotAsync( - resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl, context) - .getSyncPoller(); - } - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono startNetworkTraceSlotAsync( - String resourceGroupName, - String name, - String slot, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl) { - return beginStartNetworkTraceSlotAsync(resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono startNetworkTraceSlotAsync(String resourceGroupName, String name, String slot) { - final Integer durationInSeconds = null; - final Integer maxFrameLength = null; - final String sasUrl = null; - return beginStartNetworkTraceSlotAsync(resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono startNetworkTraceSlotAsync( - String resourceGroupName, - String name, - String slot, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl, - Context context) { - return beginStartNetworkTraceSlotAsync( - resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Object startNetworkTraceSlot( - String resourceGroupName, - String name, - String slot, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl) { - return startNetworkTraceSlotAsync(resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl) - .block(); - } - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Object startNetworkTraceSlot(String resourceGroupName, String name, String slot) { - final Integer durationInSeconds = null; - final Integer maxFrameLength = null; - final String sasUrl = null; - return startNetworkTraceSlotAsync(resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl) - .block(); - } - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Object startNetworkTraceSlot( - String resourceGroupName, - String name, - String slot, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl, - Context context) { - return startNetworkTraceSlotAsync( - resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl, context) - .block(); - } - - /** - * Stops an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will stop the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> stopSlotWithResponseAsync(String resourceGroupName, String name, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .stopSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Stops an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will stop the production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> stopSlotWithResponseAsync( - String resourceGroupName, String name, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .stopSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Stops an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will stop the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono stopSlotAsync(String resourceGroupName, String name, String slot) { - return stopSlotWithResponseAsync(resourceGroupName, name, slot).flatMap((Response res) -> Mono.empty()); - } - - /** - * Stops an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will stop the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void stopSlot(String resourceGroupName, String name, String slot) { - stopSlotAsync(resourceGroupName, name, slot).block(); - } - - /** - * Stops an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will stop the production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response stopSlotWithResponse(String resourceGroupName, String name, String slot, Context context) { - return stopSlotWithResponseAsync(resourceGroupName, name, slot, context).block(); - } - - /** - * Stop ongoing capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> stopNetworkTraceSlotWithResponseAsync( - String resourceGroupName, String name, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .stopNetworkTraceSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Stop ongoing capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> stopNetworkTraceSlotWithResponseAsync( - String resourceGroupName, String name, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .stopNetworkTraceSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Stop ongoing capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono stopNetworkTraceSlotAsync(String resourceGroupName, String name, String slot) { - return stopNetworkTraceSlotWithResponseAsync(resourceGroupName, name, slot) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Stop ongoing capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void stopNetworkTraceSlot(String resourceGroupName, String name, String slot) { - stopNetworkTraceSlotAsync(resourceGroupName, name, slot).block(); - } - - /** - * Stop ongoing capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response stopNetworkTraceSlotWithResponse( - String resourceGroupName, String name, String slot, Context context) { - return stopNetworkTraceSlotWithResponseAsync(resourceGroupName, name, slot, context).block(); - } - - /** - * Sync web app repository. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> syncRepositorySlotWithResponseAsync( - String resourceGroupName, String name, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .syncRepositorySlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Sync web app repository. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> syncRepositorySlotWithResponseAsync( - String resourceGroupName, String name, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .syncRepositorySlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Sync web app repository. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono syncRepositorySlotAsync(String resourceGroupName, String name, String slot) { - return syncRepositorySlotWithResponseAsync(resourceGroupName, name, slot) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Sync web app repository. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void syncRepositorySlot(String resourceGroupName, String name, String slot) { - syncRepositorySlotAsync(resourceGroupName, name, slot).block(); - } - - /** - * Sync web app repository. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response syncRepositorySlotWithResponse( - String resourceGroupName, String name, String slot, Context context) { - return syncRepositorySlotWithResponseAsync(resourceGroupName, name, slot, context).block(); - } - - /** - * Syncs function trigger metadata to the management database. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> syncFunctionTriggersSlotWithResponseAsync( - String resourceGroupName, String name, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .syncFunctionTriggersSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Syncs function trigger metadata to the management database. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> syncFunctionTriggersSlotWithResponseAsync( - String resourceGroupName, String name, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .syncFunctionTriggersSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Syncs function trigger metadata to the management database. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono syncFunctionTriggersSlotAsync(String resourceGroupName, String name, String slot) { - return syncFunctionTriggersSlotWithResponseAsync(resourceGroupName, name, slot) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Syncs function trigger metadata to the management database. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void syncFunctionTriggersSlot(String resourceGroupName, String name, String slot) { - syncFunctionTriggersSlotAsync(resourceGroupName, name, slot).block(); - } - - /** - * Syncs function trigger metadata to the management database. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response syncFunctionTriggersSlotWithResponse( - String resourceGroupName, String name, String slot, Context context) { - return syncFunctionTriggersSlotWithResponseAsync(resourceGroupName, name, slot, context).block(); - } - - /** - * List triggered web jobs for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu continuous web job information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listTriggeredWebJobsSlotSinglePageAsync( - String resourceGroupName, String name, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listTriggeredWebJobsSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List triggered web jobs for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu continuous web job information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listTriggeredWebJobsSlotSinglePageAsync( - String resourceGroupName, String name, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listTriggeredWebJobsSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * List triggered web jobs for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu continuous web job information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listTriggeredWebJobsSlotAsync( - String resourceGroupName, String name, String slot) { - return new PagedFlux<>( - () -> listTriggeredWebJobsSlotSinglePageAsync(resourceGroupName, name, slot), - nextLink -> listTriggeredWebJobsSlotNextSinglePageAsync(nextLink)); - } - - /** - * List triggered web jobs for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu continuous web job information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listTriggeredWebJobsSlotAsync( - String resourceGroupName, String name, String slot, Context context) { - return new PagedFlux<>( - () -> listTriggeredWebJobsSlotSinglePageAsync(resourceGroupName, name, slot, context), - nextLink -> listTriggeredWebJobsSlotNextSinglePageAsync(nextLink, context)); - } - - /** - * List triggered web jobs for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu continuous web job information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listTriggeredWebJobsSlot( - String resourceGroupName, String name, String slot) { - return new PagedIterable<>(listTriggeredWebJobsSlotAsync(resourceGroupName, name, slot)); - } - - /** - * List triggered web jobs for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu continuous web job information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listTriggeredWebJobsSlot( - String resourceGroupName, String name, String slot, Context context) { - return new PagedIterable<>(listTriggeredWebJobsSlotAsync(resourceGroupName, name, slot, context)); - } - - /** - * Gets a triggered web job by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a triggered web job by its ID for an app, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getTriggeredWebJobSlotWithResponseAsync( - String resourceGroupName, String name, String webJobName, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (webJobName == null) { - return Mono.error(new IllegalArgumentException("Parameter webJobName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getTriggeredWebJobSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - webJobName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a triggered web job by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a triggered web job by its ID for an app, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getTriggeredWebJobSlotWithResponseAsync( - String resourceGroupName, String name, String webJobName, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (webJobName == null) { - return Mono.error(new IllegalArgumentException("Parameter webJobName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getTriggeredWebJobSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - webJobName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets a triggered web job by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a triggered web job by its ID for an app, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getTriggeredWebJobSlotAsync( - String resourceGroupName, String name, String webJobName, String slot) { - return getTriggeredWebJobSlotWithResponseAsync(resourceGroupName, name, webJobName, slot) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a triggered web job by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a triggered web job by its ID for an app, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public TriggeredWebJobInner getTriggeredWebJobSlot( - String resourceGroupName, String name, String webJobName, String slot) { - return getTriggeredWebJobSlotAsync(resourceGroupName, name, webJobName, slot).block(); - } - - /** - * Gets a triggered web job by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a triggered web job by its ID for an app, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getTriggeredWebJobSlotWithResponse( - String resourceGroupName, String name, String webJobName, String slot, Context context) { - return getTriggeredWebJobSlotWithResponseAsync(resourceGroupName, name, webJobName, slot, context).block(); - } - - /** - * Delete a triggered web job by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteTriggeredWebJobSlotWithResponseAsync( - String resourceGroupName, String name, String webJobName, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (webJobName == null) { - return Mono.error(new IllegalArgumentException("Parameter webJobName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .deleteTriggeredWebJobSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - webJobName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete a triggered web job by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteTriggeredWebJobSlotWithResponseAsync( - String resourceGroupName, String name, String webJobName, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (webJobName == null) { - return Mono.error(new IllegalArgumentException("Parameter webJobName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .deleteTriggeredWebJobSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - webJobName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Delete a triggered web job by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteTriggeredWebJobSlotAsync( - String resourceGroupName, String name, String webJobName, String slot) { - return deleteTriggeredWebJobSlotWithResponseAsync(resourceGroupName, name, webJobName, slot) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Delete a triggered web job by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteTriggeredWebJobSlot(String resourceGroupName, String name, String webJobName, String slot) { - deleteTriggeredWebJobSlotAsync(resourceGroupName, name, webJobName, slot).block(); - } - - /** - * Delete a triggered web job by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteTriggeredWebJobSlotWithResponse( - String resourceGroupName, String name, String webJobName, String slot, Context context) { - return deleteTriggeredWebJobSlotWithResponseAsync(resourceGroupName, name, webJobName, slot, context).block(); - } - - /** - * List a triggered web job's history for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu continuous web job information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listTriggeredWebJobHistorySlotSinglePageAsync( - String resourceGroupName, String name, String webJobName, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (webJobName == null) { - return Mono.error(new IllegalArgumentException("Parameter webJobName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listTriggeredWebJobHistorySlot( - this.client.getEndpoint(), - resourceGroupName, - name, - webJobName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List a triggered web job's history for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu continuous web job information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listTriggeredWebJobHistorySlotSinglePageAsync( - String resourceGroupName, String name, String webJobName, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (webJobName == null) { - return Mono.error(new IllegalArgumentException("Parameter webJobName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listTriggeredWebJobHistorySlot( - this.client.getEndpoint(), - resourceGroupName, - name, - webJobName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * List a triggered web job's history for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu continuous web job information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listTriggeredWebJobHistorySlotAsync( - String resourceGroupName, String name, String webJobName, String slot) { - return new PagedFlux<>( - () -> listTriggeredWebJobHistorySlotSinglePageAsync(resourceGroupName, name, webJobName, slot), - nextLink -> listTriggeredWebJobHistorySlotNextSinglePageAsync(nextLink)); - } - - /** - * List a triggered web job's history for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu continuous web job information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listTriggeredWebJobHistorySlotAsync( - String resourceGroupName, String name, String webJobName, String slot, Context context) { - return new PagedFlux<>( - () -> listTriggeredWebJobHistorySlotSinglePageAsync(resourceGroupName, name, webJobName, slot, context), - nextLink -> listTriggeredWebJobHistorySlotNextSinglePageAsync(nextLink, context)); - } - - /** - * List a triggered web job's history for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu continuous web job information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listTriggeredWebJobHistorySlot( - String resourceGroupName, String name, String webJobName, String slot) { - return new PagedIterable<>(listTriggeredWebJobHistorySlotAsync(resourceGroupName, name, webJobName, slot)); - } - - /** - * List a triggered web job's history for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu continuous web job information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listTriggeredWebJobHistorySlot( - String resourceGroupName, String name, String webJobName, String slot, Context context) { - return new PagedIterable<>( - listTriggeredWebJobHistorySlotAsync(resourceGroupName, name, webJobName, slot, context)); - } - - /** - * Gets a triggered web job's history by its ID for an app, , or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param id History ID. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a triggered web job's history by its ID for an app, , or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getTriggeredWebJobHistorySlotWithResponseAsync( - String resourceGroupName, String name, String webJobName, String id, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (webJobName == null) { - return Mono.error(new IllegalArgumentException("Parameter webJobName is required and cannot be null.")); - } - if (id == null) { - return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getTriggeredWebJobHistorySlot( - this.client.getEndpoint(), - resourceGroupName, - name, - webJobName, - id, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a triggered web job's history by its ID for an app, , or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param id History ID. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a triggered web job's history by its ID for an app, , or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getTriggeredWebJobHistorySlotWithResponseAsync( - String resourceGroupName, String name, String webJobName, String id, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (webJobName == null) { - return Mono.error(new IllegalArgumentException("Parameter webJobName is required and cannot be null.")); - } - if (id == null) { - return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getTriggeredWebJobHistorySlot( - this.client.getEndpoint(), - resourceGroupName, - name, - webJobName, - id, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets a triggered web job's history by its ID for an app, , or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param id History ID. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a triggered web job's history by its ID for an app, , or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getTriggeredWebJobHistorySlotAsync( - String resourceGroupName, String name, String webJobName, String id, String slot) { - return getTriggeredWebJobHistorySlotWithResponseAsync(resourceGroupName, name, webJobName, id, slot) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a triggered web job's history by its ID for an app, , or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param id History ID. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a triggered web job's history by its ID for an app, , or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public TriggeredJobHistoryInner getTriggeredWebJobHistorySlot( - String resourceGroupName, String name, String webJobName, String id, String slot) { - return getTriggeredWebJobHistorySlotAsync(resourceGroupName, name, webJobName, id, slot).block(); - } - - /** - * Gets a triggered web job's history by its ID for an app, , or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param id History ID. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a triggered web job's history by its ID for an app, , or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getTriggeredWebJobHistorySlotWithResponse( - String resourceGroupName, String name, String webJobName, String id, String slot, Context context) { - return getTriggeredWebJobHistorySlotWithResponseAsync(resourceGroupName, name, webJobName, id, slot, context) - .block(); - } - - /** - * Run a triggered web job for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> runTriggeredWebJobSlotWithResponseAsync( - String resourceGroupName, String name, String webJobName, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (webJobName == null) { - return Mono.error(new IllegalArgumentException("Parameter webJobName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .runTriggeredWebJobSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - webJobName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Run a triggered web job for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> runTriggeredWebJobSlotWithResponseAsync( - String resourceGroupName, String name, String webJobName, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (webJobName == null) { - return Mono.error(new IllegalArgumentException("Parameter webJobName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .runTriggeredWebJobSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - webJobName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Run a triggered web job for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono runTriggeredWebJobSlotAsync( - String resourceGroupName, String name, String webJobName, String slot) { - return runTriggeredWebJobSlotWithResponseAsync(resourceGroupName, name, webJobName, slot) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Run a triggered web job for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void runTriggeredWebJobSlot(String resourceGroupName, String name, String webJobName, String slot) { - runTriggeredWebJobSlotAsync(resourceGroupName, name, webJobName, slot).block(); - } - - /** - * Run a triggered web job for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response runTriggeredWebJobSlotWithResponse( - String resourceGroupName, String name, String webJobName, String slot, Context context) { - return runTriggeredWebJobSlotWithResponseAsync(resourceGroupName, name, webJobName, slot, context).block(); - } - - /** - * Gets the quota usage information of an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get quota information of the - * production slot. - * @param filter Return only information specified in the filter (using OData syntax). For example: - * $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and - * endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the quota usage information of an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listUsagesSlotSinglePageAsync( - String resourceGroupName, String name, String slot, String filter) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listUsagesSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - filter, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the quota usage information of an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get quota information of the - * production slot. - * @param filter Return only information specified in the filter (using OData syntax). For example: - * $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and - * endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the quota usage information of an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listUsagesSlotSinglePageAsync( - String resourceGroupName, String name, String slot, String filter, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listUsagesSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - filter, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets the quota usage information of an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get quota information of the - * production slot. - * @param filter Return only information specified in the filter (using OData syntax). For example: - * $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and - * endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the quota usage information of an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listUsagesSlotAsync( - String resourceGroupName, String name, String slot, String filter) { - return new PagedFlux<>( - () -> listUsagesSlotSinglePageAsync(resourceGroupName, name, slot, filter), - nextLink -> listUsagesSlotNextSinglePageAsync(nextLink)); - } - - /** - * Gets the quota usage information of an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get quota information of the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the quota usage information of an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listUsagesSlotAsync(String resourceGroupName, String name, String slot) { - final String filter = null; - return new PagedFlux<>( - () -> listUsagesSlotSinglePageAsync(resourceGroupName, name, slot, filter), - nextLink -> listUsagesSlotNextSinglePageAsync(nextLink)); - } - - /** - * Gets the quota usage information of an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get quota information of the - * production slot. - * @param filter Return only information specified in the filter (using OData syntax). For example: - * $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and - * endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the quota usage information of an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listUsagesSlotAsync( - String resourceGroupName, String name, String slot, String filter, Context context) { - return new PagedFlux<>( - () -> listUsagesSlotSinglePageAsync(resourceGroupName, name, slot, filter, context), - nextLink -> listUsagesSlotNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets the quota usage information of an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get quota information of the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the quota usage information of an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listUsagesSlot(String resourceGroupName, String name, String slot) { - final String filter = null; - return new PagedIterable<>(listUsagesSlotAsync(resourceGroupName, name, slot, filter)); - } - - /** - * Gets the quota usage information of an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get quota information of the - * production slot. - * @param filter Return only information specified in the filter (using OData syntax). For example: - * $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and - * endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the quota usage information of an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listUsagesSlot( - String resourceGroupName, String name, String slot, String filter, Context context) { - return new PagedIterable<>(listUsagesSlotAsync(resourceGroupName, name, slot, filter, context)); - } - - /** - * Gets the virtual networks the app (or deployment slot) is connected to. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get virtual network connections - * for the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the virtual networks the app (or deployment slot) is connected to. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> listVnetConnectionsSlotWithResponseAsync( - String resourceGroupName, String name, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listVnetConnectionsSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the virtual networks the app (or deployment slot) is connected to. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get virtual network connections - * for the production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the virtual networks the app (or deployment slot) is connected to. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> listVnetConnectionsSlotWithResponseAsync( - String resourceGroupName, String name, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listVnetConnectionsSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets the virtual networks the app (or deployment slot) is connected to. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get virtual network connections - * for the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the virtual networks the app (or deployment slot) is connected to. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listVnetConnectionsSlotAsync(String resourceGroupName, String name, String slot) { - return listVnetConnectionsSlotWithResponseAsync(resourceGroupName, name, slot) - .flatMap( - (Response> res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the virtual networks the app (or deployment slot) is connected to. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get virtual network connections - * for the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the virtual networks the app (or deployment slot) is connected to. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public List listVnetConnectionsSlot(String resourceGroupName, String name, String slot) { - return listVnetConnectionsSlotAsync(resourceGroupName, name, slot).block(); - } - - /** - * Gets the virtual networks the app (or deployment slot) is connected to. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get virtual network connections - * for the production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the virtual networks the app (or deployment slot) is connected to. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response> listVnetConnectionsSlotWithResponse( - String resourceGroupName, String name, String slot, Context context) { - return listVnetConnectionsSlotWithResponseAsync(resourceGroupName, name, slot, context).block(); - } - - /** - * Gets a virtual network the app (or deployment slot) is connected to by name. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the virtual network. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the named virtual network - * for the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual network the app (or deployment slot) is connected to by name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getVnetConnectionSlotWithResponseAsync( - String resourceGroupName, String name, String vnetName, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (vnetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vnetName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getVnetConnectionSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - vnetName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a virtual network the app (or deployment slot) is connected to by name. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the virtual network. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the named virtual network - * for the production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual network the app (or deployment slot) is connected to by name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getVnetConnectionSlotWithResponseAsync( - String resourceGroupName, String name, String vnetName, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (vnetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vnetName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getVnetConnectionSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - vnetName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets a virtual network the app (or deployment slot) is connected to by name. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the virtual network. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the named virtual network - * for the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual network the app (or deployment slot) is connected to by name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getVnetConnectionSlotAsync( - String resourceGroupName, String name, String vnetName, String slot) { - return getVnetConnectionSlotWithResponseAsync(resourceGroupName, name, vnetName, slot) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a virtual network the app (or deployment slot) is connected to by name. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the virtual network. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the named virtual network - * for the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual network the app (or deployment slot) is connected to by name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VnetInfoInner getVnetConnectionSlot(String resourceGroupName, String name, String vnetName, String slot) { - return getVnetConnectionSlotAsync(resourceGroupName, name, vnetName, slot).block(); - } - - /** - * Gets a virtual network the app (or deployment slot) is connected to by name. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the virtual network. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the named virtual network - * for the production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual network the app (or deployment slot) is connected to by name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getVnetConnectionSlotWithResponse( - String resourceGroupName, String name, String vnetName, String slot, Context context) { - return getVnetConnectionSlotWithResponseAsync(resourceGroupName, name, vnetName, slot, context).block(); - } - - /** - * Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of an existing Virtual Network. - * @param slot Name of the deployment slot. If a slot is not specified, the API will add or update connections for - * the production slot. - * @param connectionEnvelope Properties of the Virtual Network connection. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network information contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateVnetConnectionSlotWithResponseAsync( - String resourceGroupName, String name, String vnetName, String slot, VnetInfoInner connectionEnvelope) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (vnetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vnetName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (connectionEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter connectionEnvelope is required and cannot be null.")); - } else { - connectionEnvelope.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdateVnetConnectionSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - vnetName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - connectionEnvelope, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of an existing Virtual Network. - * @param slot Name of the deployment slot. If a slot is not specified, the API will add or update connections for - * the production slot. - * @param connectionEnvelope Properties of the Virtual Network connection. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network information contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateVnetConnectionSlotWithResponseAsync( - String resourceGroupName, - String name, - String vnetName, - String slot, - VnetInfoInner connectionEnvelope, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (vnetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vnetName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (connectionEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter connectionEnvelope is required and cannot be null.")); - } else { - connectionEnvelope.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdateVnetConnectionSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - vnetName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - connectionEnvelope, - accept, - context); - } - - /** - * Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of an existing Virtual Network. - * @param slot Name of the deployment slot. If a slot is not specified, the API will add or update connections for - * the production slot. - * @param connectionEnvelope Properties of the Virtual Network connection. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network information contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateVnetConnectionSlotAsync( - String resourceGroupName, String name, String vnetName, String slot, VnetInfoInner connectionEnvelope) { - return createOrUpdateVnetConnectionSlotWithResponseAsync( - resourceGroupName, name, vnetName, slot, connectionEnvelope) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of an existing Virtual Network. - * @param slot Name of the deployment slot. If a slot is not specified, the API will add or update connections for - * the production slot. - * @param connectionEnvelope Properties of the Virtual Network connection. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network information contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VnetInfoInner createOrUpdateVnetConnectionSlot( - String resourceGroupName, String name, String vnetName, String slot, VnetInfoInner connectionEnvelope) { - return createOrUpdateVnetConnectionSlotAsync(resourceGroupName, name, vnetName, slot, connectionEnvelope) - .block(); - } - - /** - * Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of an existing Virtual Network. - * @param slot Name of the deployment slot. If a slot is not specified, the API will add or update connections for - * the production slot. - * @param connectionEnvelope Properties of the Virtual Network connection. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network information contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateVnetConnectionSlotWithResponse( - String resourceGroupName, - String name, - String vnetName, - String slot, - VnetInfoInner connectionEnvelope, - Context context) { - return createOrUpdateVnetConnectionSlotWithResponseAsync( - resourceGroupName, name, vnetName, slot, connectionEnvelope, context) - .block(); - } - - /** - * Deletes a connection from an app (or deployment slot to a named virtual network. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the virtual network. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the connection for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteVnetConnectionSlotWithResponseAsync( - String resourceGroupName, String name, String vnetName, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (vnetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vnetName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .deleteVnetConnectionSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - vnetName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a connection from an app (or deployment slot to a named virtual network. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the virtual network. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the connection for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteVnetConnectionSlotWithResponseAsync( - String resourceGroupName, String name, String vnetName, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (vnetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vnetName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .deleteVnetConnectionSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - vnetName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Deletes a connection from an app (or deployment slot to a named virtual network. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the virtual network. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the connection for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteVnetConnectionSlotAsync( - String resourceGroupName, String name, String vnetName, String slot) { - return deleteVnetConnectionSlotWithResponseAsync(resourceGroupName, name, vnetName, slot) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes a connection from an app (or deployment slot to a named virtual network. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the virtual network. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the connection for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteVnetConnectionSlot(String resourceGroupName, String name, String vnetName, String slot) { - deleteVnetConnectionSlotAsync(resourceGroupName, name, vnetName, slot).block(); - } - - /** - * Deletes a connection from an app (or deployment slot to a named virtual network. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the virtual network. - * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the connection for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteVnetConnectionSlotWithResponse( - String resourceGroupName, String name, String vnetName, String slot, Context context) { - return deleteVnetConnectionSlotWithResponseAsync(resourceGroupName, name, vnetName, slot, context).block(); - } - - /** - * Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of an existing Virtual Network. - * @param slot Name of the deployment slot. If a slot is not specified, the API will add or update connections for - * the production slot. - * @param connectionEnvelope Properties of the Virtual Network connection. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network information contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateVnetConnectionSlotWithResponseAsync( - String resourceGroupName, String name, String vnetName, String slot, VnetInfoInner connectionEnvelope) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (vnetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vnetName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (connectionEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter connectionEnvelope is required and cannot be null.")); - } else { - connectionEnvelope.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updateVnetConnectionSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - vnetName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - connectionEnvelope, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of an existing Virtual Network. - * @param slot Name of the deployment slot. If a slot is not specified, the API will add or update connections for - * the production slot. - * @param connectionEnvelope Properties of the Virtual Network connection. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network information contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateVnetConnectionSlotWithResponseAsync( - String resourceGroupName, - String name, - String vnetName, - String slot, - VnetInfoInner connectionEnvelope, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (vnetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vnetName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (connectionEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter connectionEnvelope is required and cannot be null.")); - } else { - connectionEnvelope.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updateVnetConnectionSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - vnetName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - connectionEnvelope, - accept, - context); - } - - /** - * Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of an existing Virtual Network. - * @param slot Name of the deployment slot. If a slot is not specified, the API will add or update connections for - * the production slot. - * @param connectionEnvelope Properties of the Virtual Network connection. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network information contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateVnetConnectionSlotAsync( - String resourceGroupName, String name, String vnetName, String slot, VnetInfoInner connectionEnvelope) { - return updateVnetConnectionSlotWithResponseAsync(resourceGroupName, name, vnetName, slot, connectionEnvelope) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of an existing Virtual Network. - * @param slot Name of the deployment slot. If a slot is not specified, the API will add or update connections for - * the production slot. - * @param connectionEnvelope Properties of the Virtual Network connection. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network information contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VnetInfoInner updateVnetConnectionSlot( - String resourceGroupName, String name, String vnetName, String slot, VnetInfoInner connectionEnvelope) { - return updateVnetConnectionSlotAsync(resourceGroupName, name, vnetName, slot, connectionEnvelope).block(); - } - - /** - * Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of an existing Virtual Network. - * @param slot Name of the deployment slot. If a slot is not specified, the API will add or update connections for - * the production slot. - * @param connectionEnvelope Properties of the Virtual Network connection. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network information contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateVnetConnectionSlotWithResponse( - String resourceGroupName, - String name, - String vnetName, - String slot, - VnetInfoInner connectionEnvelope, - Context context) { - return updateVnetConnectionSlotWithResponseAsync( - resourceGroupName, name, vnetName, slot, connectionEnvelope, context) - .block(); - } - - /** - * Gets an app's Virtual Network gateway. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the Virtual Network. - * @param gatewayName Name of the gateway. Currently, the only supported string is "primary". - * @param slot Name of the deployment slot. If a slot is not specified, the API will get a gateway for the - * production slot's Virtual Network. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an app's Virtual Network gateway. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getVnetConnectionGatewaySlotWithResponseAsync( - String resourceGroupName, String name, String vnetName, String gatewayName, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (vnetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vnetName is required and cannot be null.")); - } - if (gatewayName == null) { - return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getVnetConnectionGatewaySlot( - this.client.getEndpoint(), - resourceGroupName, - name, - vnetName, - gatewayName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets an app's Virtual Network gateway. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the Virtual Network. - * @param gatewayName Name of the gateway. Currently, the only supported string is "primary". - * @param slot Name of the deployment slot. If a slot is not specified, the API will get a gateway for the - * production slot's Virtual Network. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an app's Virtual Network gateway. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getVnetConnectionGatewaySlotWithResponseAsync( - String resourceGroupName, String name, String vnetName, String gatewayName, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (vnetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vnetName is required and cannot be null.")); - } - if (gatewayName == null) { - return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getVnetConnectionGatewaySlot( - this.client.getEndpoint(), - resourceGroupName, - name, - vnetName, - gatewayName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets an app's Virtual Network gateway. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the Virtual Network. - * @param gatewayName Name of the gateway. Currently, the only supported string is "primary". - * @param slot Name of the deployment slot. If a slot is not specified, the API will get a gateway for the - * production slot's Virtual Network. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an app's Virtual Network gateway. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getVnetConnectionGatewaySlotAsync( - String resourceGroupName, String name, String vnetName, String gatewayName, String slot) { - return getVnetConnectionGatewaySlotWithResponseAsync(resourceGroupName, name, vnetName, gatewayName, slot) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets an app's Virtual Network gateway. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the Virtual Network. - * @param gatewayName Name of the gateway. Currently, the only supported string is "primary". - * @param slot Name of the deployment slot. If a slot is not specified, the API will get a gateway for the - * production slot's Virtual Network. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an app's Virtual Network gateway. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VnetGatewayInner getVnetConnectionGatewaySlot( - String resourceGroupName, String name, String vnetName, String gatewayName, String slot) { - return getVnetConnectionGatewaySlotAsync(resourceGroupName, name, vnetName, gatewayName, slot).block(); - } - - /** - * Gets an app's Virtual Network gateway. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the Virtual Network. - * @param gatewayName Name of the gateway. Currently, the only supported string is "primary". - * @param slot Name of the deployment slot. If a slot is not specified, the API will get a gateway for the - * production slot's Virtual Network. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an app's Virtual Network gateway. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getVnetConnectionGatewaySlotWithResponse( - String resourceGroupName, String name, String vnetName, String gatewayName, String slot, Context context) { - return getVnetConnectionGatewaySlotWithResponseAsync( - resourceGroupName, name, vnetName, gatewayName, slot, context) - .block(); - } - - /** - * Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the Virtual Network. - * @param gatewayName Name of the gateway. Currently, the only supported string is "primary". - * @param slot Name of the deployment slot. If a slot is not specified, the API will add or update a gateway for the - * production slot's Virtual Network. - * @param connectionEnvelope The properties to update this gateway with. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Virtual Network gateway contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateVnetConnectionGatewaySlotWithResponseAsync( - String resourceGroupName, - String name, - String vnetName, - String gatewayName, - String slot, - VnetGatewayInner connectionEnvelope) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (vnetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vnetName is required and cannot be null.")); - } - if (gatewayName == null) { - return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (connectionEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter connectionEnvelope is required and cannot be null.")); - } else { - connectionEnvelope.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdateVnetConnectionGatewaySlot( - this.client.getEndpoint(), - resourceGroupName, - name, - vnetName, - gatewayName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - connectionEnvelope, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the Virtual Network. - * @param gatewayName Name of the gateway. Currently, the only supported string is "primary". - * @param slot Name of the deployment slot. If a slot is not specified, the API will add or update a gateway for the - * production slot's Virtual Network. - * @param connectionEnvelope The properties to update this gateway with. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Virtual Network gateway contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateVnetConnectionGatewaySlotWithResponseAsync( - String resourceGroupName, - String name, - String vnetName, - String gatewayName, - String slot, - VnetGatewayInner connectionEnvelope, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (vnetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vnetName is required and cannot be null.")); - } - if (gatewayName == null) { - return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (connectionEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter connectionEnvelope is required and cannot be null.")); - } else { - connectionEnvelope.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdateVnetConnectionGatewaySlot( - this.client.getEndpoint(), - resourceGroupName, - name, - vnetName, - gatewayName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - connectionEnvelope, - accept, - context); - } - - /** - * Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the Virtual Network. - * @param gatewayName Name of the gateway. Currently, the only supported string is "primary". - * @param slot Name of the deployment slot. If a slot is not specified, the API will add or update a gateway for the - * production slot's Virtual Network. - * @param connectionEnvelope The properties to update this gateway with. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Virtual Network gateway contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateVnetConnectionGatewaySlotAsync( - String resourceGroupName, - String name, - String vnetName, - String gatewayName, - String slot, - VnetGatewayInner connectionEnvelope) { - return createOrUpdateVnetConnectionGatewaySlotWithResponseAsync( - resourceGroupName, name, vnetName, gatewayName, slot, connectionEnvelope) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the Virtual Network. - * @param gatewayName Name of the gateway. Currently, the only supported string is "primary". - * @param slot Name of the deployment slot. If a slot is not specified, the API will add or update a gateway for the - * production slot's Virtual Network. - * @param connectionEnvelope The properties to update this gateway with. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Virtual Network gateway contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VnetGatewayInner createOrUpdateVnetConnectionGatewaySlot( - String resourceGroupName, - String name, - String vnetName, - String gatewayName, - String slot, - VnetGatewayInner connectionEnvelope) { - return createOrUpdateVnetConnectionGatewaySlotAsync( - resourceGroupName, name, vnetName, gatewayName, slot, connectionEnvelope) - .block(); - } - - /** - * Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the Virtual Network. - * @param gatewayName Name of the gateway. Currently, the only supported string is "primary". - * @param slot Name of the deployment slot. If a slot is not specified, the API will add or update a gateway for the - * production slot's Virtual Network. - * @param connectionEnvelope The properties to update this gateway with. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Virtual Network gateway contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateVnetConnectionGatewaySlotWithResponse( - String resourceGroupName, - String name, - String vnetName, - String gatewayName, - String slot, - VnetGatewayInner connectionEnvelope, - Context context) { - return createOrUpdateVnetConnectionGatewaySlotWithResponseAsync( - resourceGroupName, name, vnetName, gatewayName, slot, connectionEnvelope, context) - .block(); - } - - /** - * Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the Virtual Network. - * @param gatewayName Name of the gateway. Currently, the only supported string is "primary". - * @param slot Name of the deployment slot. If a slot is not specified, the API will add or update a gateway for the - * production slot's Virtual Network. - * @param connectionEnvelope The properties to update this gateway with. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Virtual Network gateway contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateVnetConnectionGatewaySlotWithResponseAsync( - String resourceGroupName, - String name, - String vnetName, - String gatewayName, - String slot, - VnetGatewayInner connectionEnvelope) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (vnetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vnetName is required and cannot be null.")); - } - if (gatewayName == null) { - return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (connectionEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter connectionEnvelope is required and cannot be null.")); - } else { - connectionEnvelope.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updateVnetConnectionGatewaySlot( - this.client.getEndpoint(), - resourceGroupName, - name, - vnetName, - gatewayName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - connectionEnvelope, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the Virtual Network. - * @param gatewayName Name of the gateway. Currently, the only supported string is "primary". - * @param slot Name of the deployment slot. If a slot is not specified, the API will add or update a gateway for the - * production slot's Virtual Network. - * @param connectionEnvelope The properties to update this gateway with. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Virtual Network gateway contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateVnetConnectionGatewaySlotWithResponseAsync( - String resourceGroupName, - String name, - String vnetName, - String gatewayName, - String slot, - VnetGatewayInner connectionEnvelope, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (vnetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vnetName is required and cannot be null.")); - } - if (gatewayName == null) { - return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (connectionEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter connectionEnvelope is required and cannot be null.")); - } else { - connectionEnvelope.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updateVnetConnectionGatewaySlot( - this.client.getEndpoint(), - resourceGroupName, - name, - vnetName, - gatewayName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - connectionEnvelope, - accept, - context); - } - - /** - * Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the Virtual Network. - * @param gatewayName Name of the gateway. Currently, the only supported string is "primary". - * @param slot Name of the deployment slot. If a slot is not specified, the API will add or update a gateway for the - * production slot's Virtual Network. - * @param connectionEnvelope The properties to update this gateway with. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Virtual Network gateway contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateVnetConnectionGatewaySlotAsync( - String resourceGroupName, - String name, - String vnetName, - String gatewayName, - String slot, - VnetGatewayInner connectionEnvelope) { - return updateVnetConnectionGatewaySlotWithResponseAsync( - resourceGroupName, name, vnetName, gatewayName, slot, connectionEnvelope) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the Virtual Network. - * @param gatewayName Name of the gateway. Currently, the only supported string is "primary". - * @param slot Name of the deployment slot. If a slot is not specified, the API will add or update a gateway for the - * production slot's Virtual Network. - * @param connectionEnvelope The properties to update this gateway with. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Virtual Network gateway contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VnetGatewayInner updateVnetConnectionGatewaySlot( - String resourceGroupName, - String name, - String vnetName, - String gatewayName, - String slot, - VnetGatewayInner connectionEnvelope) { - return updateVnetConnectionGatewaySlotAsync( - resourceGroupName, name, vnetName, gatewayName, slot, connectionEnvelope) - .block(); - } - - /** - * Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the Virtual Network. - * @param gatewayName Name of the gateway. Currently, the only supported string is "primary". - * @param slot Name of the deployment slot. If a slot is not specified, the API will add or update a gateway for the - * production slot's Virtual Network. - * @param connectionEnvelope The properties to update this gateway with. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Virtual Network gateway contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateVnetConnectionGatewaySlotWithResponse( - String resourceGroupName, - String name, - String vnetName, - String gatewayName, - String slot, - VnetGatewayInner connectionEnvelope, - Context context) { - return updateVnetConnectionGatewaySlotWithResponseAsync( - resourceGroupName, name, vnetName, gatewayName, slot, connectionEnvelope, context) - .block(); - } - - /** - * List webjobs for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu web job information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWebJobsSlotSinglePageAsync( - String resourceGroupName, String name, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listWebJobsSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List webjobs for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu web job information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWebJobsSlotSinglePageAsync( - String resourceGroupName, String name, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listWebJobsSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * List webjobs for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu web job information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listWebJobsSlotAsync(String resourceGroupName, String name, String slot) { - return new PagedFlux<>( - () -> listWebJobsSlotSinglePageAsync(resourceGroupName, name, slot), - nextLink -> listWebJobsSlotNextSinglePageAsync(nextLink)); - } - - /** - * List webjobs for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu web job information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listWebJobsSlotAsync( - String resourceGroupName, String name, String slot, Context context) { - return new PagedFlux<>( - () -> listWebJobsSlotSinglePageAsync(resourceGroupName, name, slot, context), - nextLink -> listWebJobsSlotNextSinglePageAsync(nextLink, context)); - } - - /** - * List webjobs for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu web job information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listWebJobsSlot(String resourceGroupName, String name, String slot) { - return new PagedIterable<>(listWebJobsSlotAsync(resourceGroupName, name, slot)); - } - - /** - * List webjobs for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu web job information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listWebJobsSlot( - String resourceGroupName, String name, String slot, Context context) { - return new PagedIterable<>(listWebJobsSlotAsync(resourceGroupName, name, slot, context)); - } - - /** - * Get webjob information for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of the web job. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return webjob information for an app, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWebJobSlotWithResponseAsync( - String resourceGroupName, String name, String webJobName, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (webJobName == null) { - return Mono.error(new IllegalArgumentException("Parameter webJobName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getWebJobSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - webJobName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get webjob information for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of the web job. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return webjob information for an app, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWebJobSlotWithResponseAsync( - String resourceGroupName, String name, String webJobName, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (webJobName == null) { - return Mono.error(new IllegalArgumentException("Parameter webJobName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getWebJobSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - webJobName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Get webjob information for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of the web job. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return webjob information for an app, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getWebJobSlotAsync(String resourceGroupName, String name, String webJobName, String slot) { - return getWebJobSlotWithResponseAsync(resourceGroupName, name, webJobName, slot) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get webjob information for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of the web job. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return webjob information for an app, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public WebJobInner getWebJobSlot(String resourceGroupName, String name, String webJobName, String slot) { - return getWebJobSlotAsync(resourceGroupName, name, webJobName, slot).block(); - } - - /** - * Get webjob information for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of the web job. - * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments for the - * production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return webjob information for an app, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWebJobSlotWithResponse( - String resourceGroupName, String name, String webJobName, String slot, Context context) { - return getWebJobSlotWithResponseAsync(resourceGroupName, name, webJobName, slot, context).block(); - } - - /** - * Get the difference in configuration settings between two web app slots. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slotSwapEntity JSON object that contains the target slot name. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the difference in configuration settings between two web app slots. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSlotDifferencesFromProductionSinglePageAsync( - String resourceGroupName, String name, CsmSlotEntity slotSwapEntity) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (slotSwapEntity == null) { - return Mono.error(new IllegalArgumentException("Parameter slotSwapEntity is required and cannot be null.")); - } else { - slotSwapEntity.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listSlotDifferencesFromProduction( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - slotSwapEntity, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the difference in configuration settings between two web app slots. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slotSwapEntity JSON object that contains the target slot name. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the difference in configuration settings between two web app slots. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSlotDifferencesFromProductionSinglePageAsync( - String resourceGroupName, String name, CsmSlotEntity slotSwapEntity, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (slotSwapEntity == null) { - return Mono.error(new IllegalArgumentException("Parameter slotSwapEntity is required and cannot be null.")); - } else { - slotSwapEntity.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listSlotDifferencesFromProduction( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - slotSwapEntity, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the difference in configuration settings between two web app slots. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slotSwapEntity JSON object that contains the target slot name. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the difference in configuration settings between two web app slots. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listSlotDifferencesFromProductionAsync( - String resourceGroupName, String name, CsmSlotEntity slotSwapEntity) { - return new PagedFlux<>( - () -> listSlotDifferencesFromProductionSinglePageAsync(resourceGroupName, name, slotSwapEntity), - nextLink -> listSlotDifferencesFromProductionNextSinglePageAsync(nextLink)); - } - - /** - * Get the difference in configuration settings between two web app slots. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slotSwapEntity JSON object that contains the target slot name. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the difference in configuration settings between two web app slots. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listSlotDifferencesFromProductionAsync( - String resourceGroupName, String name, CsmSlotEntity slotSwapEntity, Context context) { - return new PagedFlux<>( - () -> listSlotDifferencesFromProductionSinglePageAsync(resourceGroupName, name, slotSwapEntity, context), - nextLink -> listSlotDifferencesFromProductionNextSinglePageAsync(nextLink, context)); - } - - /** - * Get the difference in configuration settings between two web app slots. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slotSwapEntity JSON object that contains the target slot name. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the difference in configuration settings between two web app slots. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listSlotDifferencesFromProduction( - String resourceGroupName, String name, CsmSlotEntity slotSwapEntity) { - return new PagedIterable<>(listSlotDifferencesFromProductionAsync(resourceGroupName, name, slotSwapEntity)); - } - - /** - * Get the difference in configuration settings between two web app slots. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slotSwapEntity JSON object that contains the target slot name. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the difference in configuration settings between two web app slots. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listSlotDifferencesFromProduction( - String resourceGroupName, String name, CsmSlotEntity slotSwapEntity, Context context) { - return new PagedIterable<>( - listSlotDifferencesFromProductionAsync(resourceGroupName, name, slotSwapEntity, context)); - } - - /** - * Swaps two deployment slots of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slotSwapEntity JSON object that contains the target slot name. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> swapSlotWithProductionWithResponseAsync( - String resourceGroupName, String name, CsmSlotEntity slotSwapEntity) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (slotSwapEntity == null) { - return Mono.error(new IllegalArgumentException("Parameter slotSwapEntity is required and cannot be null.")); - } else { - slotSwapEntity.validate(); - } - return FluxUtil - .withContext( - context -> - service - .swapSlotWithProduction( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - slotSwapEntity, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Swaps two deployment slots of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slotSwapEntity JSON object that contains the target slot name. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> swapSlotWithProductionWithResponseAsync( - String resourceGroupName, String name, CsmSlotEntity slotSwapEntity, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (slotSwapEntity == null) { - return Mono.error(new IllegalArgumentException("Parameter slotSwapEntity is required and cannot be null.")); - } else { - slotSwapEntity.validate(); - } - context = this.client.mergeContext(context); - return service - .swapSlotWithProduction( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - slotSwapEntity, - context); - } - - /** - * Swaps two deployment slots of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slotSwapEntity JSON object that contains the target slot name. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginSwapSlotWithProductionAsync( - String resourceGroupName, String name, CsmSlotEntity slotSwapEntity) { - Mono>> mono = - swapSlotWithProductionWithResponseAsync(resourceGroupName, name, slotSwapEntity); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Swaps two deployment slots of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slotSwapEntity JSON object that contains the target slot name. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginSwapSlotWithProductionAsync( - String resourceGroupName, String name, CsmSlotEntity slotSwapEntity, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - swapSlotWithProductionWithResponseAsync(resourceGroupName, name, slotSwapEntity, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Swaps two deployment slots of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slotSwapEntity JSON object that contains the target slot name. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginSwapSlotWithProduction( - String resourceGroupName, String name, CsmSlotEntity slotSwapEntity) { - return beginSwapSlotWithProductionAsync(resourceGroupName, name, slotSwapEntity).getSyncPoller(); - } - - /** - * Swaps two deployment slots of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slotSwapEntity JSON object that contains the target slot name. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginSwapSlotWithProduction( - String resourceGroupName, String name, CsmSlotEntity slotSwapEntity, Context context) { - return beginSwapSlotWithProductionAsync(resourceGroupName, name, slotSwapEntity, context).getSyncPoller(); - } - - /** - * Swaps two deployment slots of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slotSwapEntity JSON object that contains the target slot name. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono swapSlotWithProductionAsync(String resourceGroupName, String name, CsmSlotEntity slotSwapEntity) { - return beginSwapSlotWithProductionAsync(resourceGroupName, name, slotSwapEntity) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Swaps two deployment slots of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slotSwapEntity JSON object that contains the target slot name. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono swapSlotWithProductionAsync( - String resourceGroupName, String name, CsmSlotEntity slotSwapEntity, Context context) { - return beginSwapSlotWithProductionAsync(resourceGroupName, name, slotSwapEntity, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Swaps two deployment slots of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slotSwapEntity JSON object that contains the target slot name. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void swapSlotWithProduction(String resourceGroupName, String name, CsmSlotEntity slotSwapEntity) { - swapSlotWithProductionAsync(resourceGroupName, name, slotSwapEntity).block(); - } - - /** - * Swaps two deployment slots of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slotSwapEntity JSON object that contains the target slot name. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void swapSlotWithProduction( - String resourceGroupName, String name, CsmSlotEntity slotSwapEntity, Context context) { - swapSlotWithProductionAsync(resourceGroupName, name, slotSwapEntity, context).block(); - } - - /** - * Returns all Snapshots to the user. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Website Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of snapshots which can be used to revert an app to a previous time. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSnapshotsSinglePageAsync(String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listSnapshots( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns all Snapshots to the user. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Website Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of snapshots which can be used to revert an app to a previous time. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSnapshotsSinglePageAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listSnapshots( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Returns all Snapshots to the user. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Website Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of snapshots which can be used to revert an app to a previous time. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listSnapshotsAsync(String resourceGroupName, String name) { - return new PagedFlux<>( - () -> listSnapshotsSinglePageAsync(resourceGroupName, name), - nextLink -> listSnapshotsNextSinglePageAsync(nextLink)); - } - - /** - * Returns all Snapshots to the user. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Website Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of snapshots which can be used to revert an app to a previous time. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listSnapshotsAsync(String resourceGroupName, String name, Context context) { - return new PagedFlux<>( - () -> listSnapshotsSinglePageAsync(resourceGroupName, name, context), - nextLink -> listSnapshotsNextSinglePageAsync(nextLink, context)); - } - - /** - * Returns all Snapshots to the user. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Website Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of snapshots which can be used to revert an app to a previous time. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listSnapshots(String resourceGroupName, String name) { - return new PagedIterable<>(listSnapshotsAsync(resourceGroupName, name)); - } - - /** - * Returns all Snapshots to the user. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Website Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of snapshots which can be used to revert an app to a previous time. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listSnapshots(String resourceGroupName, String name, Context context) { - return new PagedIterable<>(listSnapshotsAsync(resourceGroupName, name, context)); - } - - /** - * Returns all Snapshots to the user from DRSecondary endpoint. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Website Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of snapshots which can be used to revert an app to a previous time. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSnapshotsFromDRSecondarySinglePageAsync( - String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listSnapshotsFromDRSecondary( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns all Snapshots to the user from DRSecondary endpoint. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Website Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of snapshots which can be used to revert an app to a previous time. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSnapshotsFromDRSecondarySinglePageAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listSnapshotsFromDRSecondary( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Returns all Snapshots to the user from DRSecondary endpoint. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Website Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of snapshots which can be used to revert an app to a previous time. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listSnapshotsFromDRSecondaryAsync(String resourceGroupName, String name) { - return new PagedFlux<>( - () -> listSnapshotsFromDRSecondarySinglePageAsync(resourceGroupName, name), - nextLink -> listSnapshotsFromDRSecondaryNextSinglePageAsync(nextLink)); - } - - /** - * Returns all Snapshots to the user from DRSecondary endpoint. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Website Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of snapshots which can be used to revert an app to a previous time. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listSnapshotsFromDRSecondaryAsync( - String resourceGroupName, String name, Context context) { - return new PagedFlux<>( - () -> listSnapshotsFromDRSecondarySinglePageAsync(resourceGroupName, name, context), - nextLink -> listSnapshotsFromDRSecondaryNextSinglePageAsync(nextLink, context)); - } - - /** - * Returns all Snapshots to the user from DRSecondary endpoint. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Website Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of snapshots which can be used to revert an app to a previous time. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listSnapshotsFromDRSecondary(String resourceGroupName, String name) { - return new PagedIterable<>(listSnapshotsFromDRSecondaryAsync(resourceGroupName, name)); - } - - /** - * Returns all Snapshots to the user from DRSecondary endpoint. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Website Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of snapshots which can be used to revert an app to a previous time. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listSnapshotsFromDRSecondary( - String resourceGroupName, String name, Context context) { - return new PagedIterable<>(listSnapshotsFromDRSecondaryAsync(resourceGroupName, name, context)); - } - - /** - * Gets the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source control configuration of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getSourceControlWithResponseAsync( - String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getSourceControl( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source control configuration of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getSourceControlWithResponseAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getSourceControl( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source control configuration of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getSourceControlAsync(String resourceGroupName, String name) { - return getSourceControlWithResponseAsync(resourceGroupName, name) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source control configuration of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SiteSourceControlInner getSourceControl(String resourceGroupName, String name) { - return getSourceControlAsync(resourceGroupName, name).block(); - } - - /** - * Gets the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source control configuration of an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getSourceControlWithResponse( - String resourceGroupName, String name, Context context) { - return getSourceControlWithResponseAsync(resourceGroupName, name, context).block(); - } - - /** - * Updates the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param siteSourceControl JSON representation of a SiteSourceControl object. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control configuration for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateSourceControlWithResponseAsync( - String resourceGroupName, String name, SiteSourceControlInner siteSourceControl) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (siteSourceControl == null) { - return Mono - .error(new IllegalArgumentException("Parameter siteSourceControl is required and cannot be null.")); - } else { - siteSourceControl.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdateSourceControl( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - siteSourceControl, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param siteSourceControl JSON representation of a SiteSourceControl object. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control configuration for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateSourceControlWithResponseAsync( - String resourceGroupName, String name, SiteSourceControlInner siteSourceControl, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (siteSourceControl == null) { - return Mono - .error(new IllegalArgumentException("Parameter siteSourceControl is required and cannot be null.")); - } else { - siteSourceControl.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdateSourceControl( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - siteSourceControl, - accept, - context); - } - - /** - * Updates the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param siteSourceControl JSON representation of a SiteSourceControl object. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control configuration for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, SiteSourceControlInner> beginCreateOrUpdateSourceControlAsync( - String resourceGroupName, String name, SiteSourceControlInner siteSourceControl) { - Mono>> mono = - createOrUpdateSourceControlWithResponseAsync(resourceGroupName, name, siteSourceControl); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - SiteSourceControlInner.class, - SiteSourceControlInner.class, - Context.NONE); - } - - /** - * Updates the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param siteSourceControl JSON representation of a SiteSourceControl object. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control configuration for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, SiteSourceControlInner> - beginCreateOrUpdateSourceControlAsync( - String resourceGroupName, String name, SiteSourceControlInner siteSourceControl, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateSourceControlWithResponseAsync(resourceGroupName, name, siteSourceControl, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - SiteSourceControlInner.class, - SiteSourceControlInner.class, - context); - } - - /** - * Updates the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param siteSourceControl JSON representation of a SiteSourceControl object. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control configuration for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, SiteSourceControlInner> beginCreateOrUpdateSourceControl( - String resourceGroupName, String name, SiteSourceControlInner siteSourceControl) { - return beginCreateOrUpdateSourceControlAsync(resourceGroupName, name, siteSourceControl).getSyncPoller(); - } - - /** - * Updates the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param siteSourceControl JSON representation of a SiteSourceControl object. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control configuration for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, SiteSourceControlInner> beginCreateOrUpdateSourceControl( - String resourceGroupName, String name, SiteSourceControlInner siteSourceControl, Context context) { - return beginCreateOrUpdateSourceControlAsync(resourceGroupName, name, siteSourceControl, context) - .getSyncPoller(); - } - - /** - * Updates the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param siteSourceControl JSON representation of a SiteSourceControl object. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control configuration for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateSourceControlAsync( - String resourceGroupName, String name, SiteSourceControlInner siteSourceControl) { - return beginCreateOrUpdateSourceControlAsync(resourceGroupName, name, siteSourceControl) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param siteSourceControl JSON representation of a SiteSourceControl object. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control configuration for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateSourceControlAsync( - String resourceGroupName, String name, SiteSourceControlInner siteSourceControl, Context context) { - return beginCreateOrUpdateSourceControlAsync(resourceGroupName, name, siteSourceControl, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param siteSourceControl JSON representation of a SiteSourceControl object. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control configuration for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SiteSourceControlInner createOrUpdateSourceControl( - String resourceGroupName, String name, SiteSourceControlInner siteSourceControl) { - return createOrUpdateSourceControlAsync(resourceGroupName, name, siteSourceControl).block(); - } - - /** - * Updates the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param siteSourceControl JSON representation of a SiteSourceControl object. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control configuration for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SiteSourceControlInner createOrUpdateSourceControl( - String resourceGroupName, String name, SiteSourceControlInner siteSourceControl, Context context) { - return createOrUpdateSourceControlAsync(resourceGroupName, name, siteSourceControl, context).block(); - } - - /** - * Deletes the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteSourceControlWithResponseAsync(String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .deleteSourceControl( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteSourceControlWithResponseAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .deleteSourceControl( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Deletes the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteSourceControlAsync(String resourceGroupName, String name) { - return deleteSourceControlWithResponseAsync(resourceGroupName, name) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteSourceControl(String resourceGroupName, String name) { - deleteSourceControlAsync(resourceGroupName, name).block(); - } - - /** - * Deletes the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteSourceControlWithResponse(String resourceGroupName, String name, Context context) { - return deleteSourceControlWithResponseAsync(resourceGroupName, name, context).block(); - } - - /** - * Updates the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param siteSourceControl JSON representation of a SiteSourceControl object. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control configuration for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateSourceControlWithResponseAsync( - String resourceGroupName, String name, SiteSourceControlInner siteSourceControl) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (siteSourceControl == null) { - return Mono - .error(new IllegalArgumentException("Parameter siteSourceControl is required and cannot be null.")); - } else { - siteSourceControl.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updateSourceControl( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - siteSourceControl, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param siteSourceControl JSON representation of a SiteSourceControl object. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control configuration for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateSourceControlWithResponseAsync( - String resourceGroupName, String name, SiteSourceControlInner siteSourceControl, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (siteSourceControl == null) { - return Mono - .error(new IllegalArgumentException("Parameter siteSourceControl is required and cannot be null.")); - } else { - siteSourceControl.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updateSourceControl( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - siteSourceControl, - accept, - context); - } - - /** - * Updates the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param siteSourceControl JSON representation of a SiteSourceControl object. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control configuration for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateSourceControlAsync( - String resourceGroupName, String name, SiteSourceControlInner siteSourceControl) { - return updateSourceControlWithResponseAsync(resourceGroupName, name, siteSourceControl) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Updates the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param siteSourceControl JSON representation of a SiteSourceControl object. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control configuration for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SiteSourceControlInner updateSourceControl( - String resourceGroupName, String name, SiteSourceControlInner siteSourceControl) { - return updateSourceControlAsync(resourceGroupName, name, siteSourceControl).block(); - } - - /** - * Updates the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param siteSourceControl JSON representation of a SiteSourceControl object. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control configuration for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateSourceControlWithResponse( - String resourceGroupName, String name, SiteSourceControlInner siteSourceControl, Context context) { - return updateSourceControlWithResponseAsync(resourceGroupName, name, siteSourceControl, context).block(); - } - - /** - * Starts an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> startWithResponseAsync(String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .start( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Starts an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> startWithResponseAsync(String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .start( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Starts an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono startAsync(String resourceGroupName, String name) { - return startWithResponseAsync(resourceGroupName, name).flatMap((Response res) -> Mono.empty()); - } - - /** - * Starts an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void start(String resourceGroupName, String name) { - startAsync(resourceGroupName, name).block(); - } - - /** - * Starts an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response startWithResponse(String resourceGroupName, String name, Context context) { - return startWithResponseAsync(resourceGroupName, name, context).block(); - } - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> startNetworkTraceWithResponseAsync( - String resourceGroupName, String name, Integer durationInSeconds, Integer maxFrameLength, String sasUrl) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .startNetworkTrace( - this.client.getEndpoint(), - resourceGroupName, - name, - durationInSeconds, - maxFrameLength, - sasUrl, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> startNetworkTraceWithResponseAsync( - String resourceGroupName, - String name, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .startNetworkTrace( - this.client.getEndpoint(), - resourceGroupName, - name, - durationInSeconds, - maxFrameLength, - sasUrl, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Object> beginStartNetworkTraceAsync( - String resourceGroupName, String name, Integer durationInSeconds, Integer maxFrameLength, String sasUrl) { - Mono>> mono = - startNetworkTraceWithResponseAsync(resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Object.class, Object.class, this.client.getContext()); - } - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Object> beginStartNetworkTraceAsync( - String resourceGroupName, - String name, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - startNetworkTraceWithResponseAsync( - resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Object.class, Object.class, context); - } - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Object> beginStartNetworkTrace( - String resourceGroupName, String name, Integer durationInSeconds, Integer maxFrameLength, String sasUrl) { - return beginStartNetworkTraceAsync(resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl) - .getSyncPoller(); - } - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Object> beginStartNetworkTrace( - String resourceGroupName, - String name, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl, - Context context) { - return beginStartNetworkTraceAsync(resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl, context) - .getSyncPoller(); - } - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono startNetworkTraceAsync( - String resourceGroupName, String name, Integer durationInSeconds, Integer maxFrameLength, String sasUrl) { - return beginStartNetworkTraceAsync(resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono startNetworkTraceAsync(String resourceGroupName, String name) { - final Integer durationInSeconds = null; - final Integer maxFrameLength = null; - final String sasUrl = null; - return beginStartNetworkTraceAsync(resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono startNetworkTraceAsync( - String resourceGroupName, - String name, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl, - Context context) { - return beginStartNetworkTraceAsync(resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Object startNetworkTrace( - String resourceGroupName, String name, Integer durationInSeconds, Integer maxFrameLength, String sasUrl) { - return startNetworkTraceAsync(resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl).block(); - } - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Object startNetworkTrace(String resourceGroupName, String name) { - final Integer durationInSeconds = null; - final Integer maxFrameLength = null; - final String sasUrl = null; - return startNetworkTraceAsync(resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl).block(); - } - - /** - * Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Object startNetworkTrace( - String resourceGroupName, - String name, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl, - Context context) { - return startNetworkTraceAsync(resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl, context) - .block(); - } - - /** - * Stops an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> stopWithResponseAsync(String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .stop( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Stops an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> stopWithResponseAsync(String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .stop( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Stops an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono stopAsync(String resourceGroupName, String name) { - return stopWithResponseAsync(resourceGroupName, name).flatMap((Response res) -> Mono.empty()); - } - - /** - * Stops an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void stop(String resourceGroupName, String name) { - stopAsync(resourceGroupName, name).block(); - } - - /** - * Stops an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response stopWithResponse(String resourceGroupName, String name, Context context) { - return stopWithResponseAsync(resourceGroupName, name, context).block(); - } - - /** - * Stop ongoing capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> stopNetworkTraceWithResponseAsync(String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .stopNetworkTrace( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Stop ongoing capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> stopNetworkTraceWithResponseAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .stopNetworkTrace( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Stop ongoing capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono stopNetworkTraceAsync(String resourceGroupName, String name) { - return stopNetworkTraceWithResponseAsync(resourceGroupName, name).flatMap((Response res) -> Mono.empty()); - } - - /** - * Stop ongoing capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void stopNetworkTrace(String resourceGroupName, String name) { - stopNetworkTraceAsync(resourceGroupName, name).block(); - } - - /** - * Stop ongoing capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response stopNetworkTraceWithResponse(String resourceGroupName, String name, Context context) { - return stopNetworkTraceWithResponseAsync(resourceGroupName, name, context).block(); - } - - /** - * Sync web app repository. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> syncRepositoryWithResponseAsync(String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .syncRepository( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Sync web app repository. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> syncRepositoryWithResponseAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .syncRepository( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Sync web app repository. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono syncRepositoryAsync(String resourceGroupName, String name) { - return syncRepositoryWithResponseAsync(resourceGroupName, name).flatMap((Response res) -> Mono.empty()); - } - - /** - * Sync web app repository. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void syncRepository(String resourceGroupName, String name) { - syncRepositoryAsync(resourceGroupName, name).block(); - } - - /** - * Sync web app repository. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response syncRepositoryWithResponse(String resourceGroupName, String name, Context context) { - return syncRepositoryWithResponseAsync(resourceGroupName, name, context).block(); - } - - /** - * Syncs function trigger metadata to the management database. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> syncFunctionTriggersWithResponseAsync(String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .syncFunctionTriggers( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Syncs function trigger metadata to the management database. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> syncFunctionTriggersWithResponseAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .syncFunctionTriggers( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Syncs function trigger metadata to the management database. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono syncFunctionTriggersAsync(String resourceGroupName, String name) { - return syncFunctionTriggersWithResponseAsync(resourceGroupName, name) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Syncs function trigger metadata to the management database. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void syncFunctionTriggers(String resourceGroupName, String name) { - syncFunctionTriggersAsync(resourceGroupName, name).block(); - } - - /** - * Syncs function trigger metadata to the management database. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response syncFunctionTriggersWithResponse(String resourceGroupName, String name, Context context) { - return syncFunctionTriggersWithResponseAsync(resourceGroupName, name, context).block(); - } - - /** - * List triggered web jobs for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu continuous web job information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listTriggeredWebJobsSinglePageAsync( - String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listTriggeredWebJobs( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List triggered web jobs for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu continuous web job information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listTriggeredWebJobsSinglePageAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listTriggeredWebJobs( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * List triggered web jobs for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu continuous web job information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listTriggeredWebJobsAsync(String resourceGroupName, String name) { - return new PagedFlux<>( - () -> listTriggeredWebJobsSinglePageAsync(resourceGroupName, name), - nextLink -> listTriggeredWebJobsNextSinglePageAsync(nextLink)); - } - - /** - * List triggered web jobs for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu continuous web job information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listTriggeredWebJobsAsync( - String resourceGroupName, String name, Context context) { - return new PagedFlux<>( - () -> listTriggeredWebJobsSinglePageAsync(resourceGroupName, name, context), - nextLink -> listTriggeredWebJobsNextSinglePageAsync(nextLink, context)); - } - - /** - * List triggered web jobs for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu continuous web job information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listTriggeredWebJobs(String resourceGroupName, String name) { - return new PagedIterable<>(listTriggeredWebJobsAsync(resourceGroupName, name)); - } - - /** - * List triggered web jobs for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu continuous web job information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listTriggeredWebJobs( - String resourceGroupName, String name, Context context) { - return new PagedIterable<>(listTriggeredWebJobsAsync(resourceGroupName, name, context)); - } - - /** - * Gets a triggered web job by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a triggered web job by its ID for an app, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getTriggeredWebJobWithResponseAsync( - String resourceGroupName, String name, String webJobName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (webJobName == null) { - return Mono.error(new IllegalArgumentException("Parameter webJobName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getTriggeredWebJob( - this.client.getEndpoint(), - resourceGroupName, - name, - webJobName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a triggered web job by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a triggered web job by its ID for an app, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getTriggeredWebJobWithResponseAsync( - String resourceGroupName, String name, String webJobName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (webJobName == null) { - return Mono.error(new IllegalArgumentException("Parameter webJobName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getTriggeredWebJob( - this.client.getEndpoint(), - resourceGroupName, - name, - webJobName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets a triggered web job by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a triggered web job by its ID for an app, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getTriggeredWebJobAsync( - String resourceGroupName, String name, String webJobName) { - return getTriggeredWebJobWithResponseAsync(resourceGroupName, name, webJobName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a triggered web job by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a triggered web job by its ID for an app, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public TriggeredWebJobInner getTriggeredWebJob(String resourceGroupName, String name, String webJobName) { - return getTriggeredWebJobAsync(resourceGroupName, name, webJobName).block(); - } - - /** - * Gets a triggered web job by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a triggered web job by its ID for an app, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getTriggeredWebJobWithResponse( - String resourceGroupName, String name, String webJobName, Context context) { - return getTriggeredWebJobWithResponseAsync(resourceGroupName, name, webJobName, context).block(); - } - - /** - * Delete a triggered web job by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteTriggeredWebJobWithResponseAsync( - String resourceGroupName, String name, String webJobName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (webJobName == null) { - return Mono.error(new IllegalArgumentException("Parameter webJobName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .deleteTriggeredWebJob( - this.client.getEndpoint(), - resourceGroupName, - name, - webJobName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete a triggered web job by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteTriggeredWebJobWithResponseAsync( - String resourceGroupName, String name, String webJobName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (webJobName == null) { - return Mono.error(new IllegalArgumentException("Parameter webJobName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .deleteTriggeredWebJob( - this.client.getEndpoint(), - resourceGroupName, - name, - webJobName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Delete a triggered web job by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteTriggeredWebJobAsync(String resourceGroupName, String name, String webJobName) { - return deleteTriggeredWebJobWithResponseAsync(resourceGroupName, name, webJobName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Delete a triggered web job by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteTriggeredWebJob(String resourceGroupName, String name, String webJobName) { - deleteTriggeredWebJobAsync(resourceGroupName, name, webJobName).block(); - } - - /** - * Delete a triggered web job by its ID for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteTriggeredWebJobWithResponse( - String resourceGroupName, String name, String webJobName, Context context) { - return deleteTriggeredWebJobWithResponseAsync(resourceGroupName, name, webJobName, context).block(); - } - - /** - * List a triggered web job's history for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu continuous web job information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listTriggeredWebJobHistorySinglePageAsync( - String resourceGroupName, String name, String webJobName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (webJobName == null) { - return Mono.error(new IllegalArgumentException("Parameter webJobName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listTriggeredWebJobHistory( - this.client.getEndpoint(), - resourceGroupName, - name, - webJobName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List a triggered web job's history for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu continuous web job information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listTriggeredWebJobHistorySinglePageAsync( - String resourceGroupName, String name, String webJobName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (webJobName == null) { - return Mono.error(new IllegalArgumentException("Parameter webJobName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listTriggeredWebJobHistory( - this.client.getEndpoint(), - resourceGroupName, - name, - webJobName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * List a triggered web job's history for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu continuous web job information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listTriggeredWebJobHistoryAsync( - String resourceGroupName, String name, String webJobName) { - return new PagedFlux<>( - () -> listTriggeredWebJobHistorySinglePageAsync(resourceGroupName, name, webJobName), - nextLink -> listTriggeredWebJobHistoryNextSinglePageAsync(nextLink)); - } - - /** - * List a triggered web job's history for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu continuous web job information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listTriggeredWebJobHistoryAsync( - String resourceGroupName, String name, String webJobName, Context context) { - return new PagedFlux<>( - () -> listTriggeredWebJobHistorySinglePageAsync(resourceGroupName, name, webJobName, context), - nextLink -> listTriggeredWebJobHistoryNextSinglePageAsync(nextLink, context)); - } - - /** - * List a triggered web job's history for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu continuous web job information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listTriggeredWebJobHistory( - String resourceGroupName, String name, String webJobName) { - return new PagedIterable<>(listTriggeredWebJobHistoryAsync(resourceGroupName, name, webJobName)); - } - - /** - * List a triggered web job's history for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu continuous web job information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listTriggeredWebJobHistory( - String resourceGroupName, String name, String webJobName, Context context) { - return new PagedIterable<>(listTriggeredWebJobHistoryAsync(resourceGroupName, name, webJobName, context)); - } - - /** - * Gets a triggered web job's history by its ID for an app, , or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param id History ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a triggered web job's history by its ID for an app, , or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getTriggeredWebJobHistoryWithResponseAsync( - String resourceGroupName, String name, String webJobName, String id) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (webJobName == null) { - return Mono.error(new IllegalArgumentException("Parameter webJobName is required and cannot be null.")); - } - if (id == null) { - return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getTriggeredWebJobHistory( - this.client.getEndpoint(), - resourceGroupName, - name, - webJobName, - id, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a triggered web job's history by its ID for an app, , or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param id History ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a triggered web job's history by its ID for an app, , or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getTriggeredWebJobHistoryWithResponseAsync( - String resourceGroupName, String name, String webJobName, String id, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (webJobName == null) { - return Mono.error(new IllegalArgumentException("Parameter webJobName is required and cannot be null.")); - } - if (id == null) { - return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getTriggeredWebJobHistory( - this.client.getEndpoint(), - resourceGroupName, - name, - webJobName, - id, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets a triggered web job's history by its ID for an app, , or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param id History ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a triggered web job's history by its ID for an app, , or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getTriggeredWebJobHistoryAsync( - String resourceGroupName, String name, String webJobName, String id) { - return getTriggeredWebJobHistoryWithResponseAsync(resourceGroupName, name, webJobName, id) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a triggered web job's history by its ID for an app, , or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param id History ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a triggered web job's history by its ID for an app, , or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public TriggeredJobHistoryInner getTriggeredWebJobHistory( - String resourceGroupName, String name, String webJobName, String id) { - return getTriggeredWebJobHistoryAsync(resourceGroupName, name, webJobName, id).block(); - } - - /** - * Gets a triggered web job's history by its ID for an app, , or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param id History ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a triggered web job's history by its ID for an app, , or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getTriggeredWebJobHistoryWithResponse( - String resourceGroupName, String name, String webJobName, String id, Context context) { - return getTriggeredWebJobHistoryWithResponseAsync(resourceGroupName, name, webJobName, id, context).block(); - } - - /** - * Run a triggered web job for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> runTriggeredWebJobWithResponseAsync( - String resourceGroupName, String name, String webJobName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (webJobName == null) { - return Mono.error(new IllegalArgumentException("Parameter webJobName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .runTriggeredWebJob( - this.client.getEndpoint(), - resourceGroupName, - name, - webJobName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Run a triggered web job for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> runTriggeredWebJobWithResponseAsync( - String resourceGroupName, String name, String webJobName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (webJobName == null) { - return Mono.error(new IllegalArgumentException("Parameter webJobName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .runTriggeredWebJob( - this.client.getEndpoint(), - resourceGroupName, - name, - webJobName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Run a triggered web job for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono runTriggeredWebJobAsync(String resourceGroupName, String name, String webJobName) { - return runTriggeredWebJobWithResponseAsync(resourceGroupName, name, webJobName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Run a triggered web job for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void runTriggeredWebJob(String resourceGroupName, String name, String webJobName) { - runTriggeredWebJobAsync(resourceGroupName, name, webJobName).block(); - } - - /** - * Run a triggered web job for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of Web Job. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response runTriggeredWebJobWithResponse( - String resourceGroupName, String name, String webJobName, Context context) { - return runTriggeredWebJobWithResponseAsync(resourceGroupName, name, webJobName, context).block(); - } - - /** - * Gets the quota usage information of an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param filter Return only information specified in the filter (using OData syntax). For example: - * $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and - * endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the quota usage information of an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listUsagesSinglePageAsync( - String resourceGroupName, String name, String filter) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listUsages( - this.client.getEndpoint(), - resourceGroupName, - name, - filter, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the quota usage information of an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param filter Return only information specified in the filter (using OData syntax). For example: - * $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and - * endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the quota usage information of an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listUsagesSinglePageAsync( - String resourceGroupName, String name, String filter, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listUsages( - this.client.getEndpoint(), - resourceGroupName, - name, - filter, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets the quota usage information of an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param filter Return only information specified in the filter (using OData syntax). For example: - * $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and - * endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the quota usage information of an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listUsagesAsync(String resourceGroupName, String name, String filter) { - return new PagedFlux<>( - () -> listUsagesSinglePageAsync(resourceGroupName, name, filter), - nextLink -> listUsagesNextSinglePageAsync(nextLink)); - } - - /** - * Gets the quota usage information of an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the quota usage information of an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listUsagesAsync(String resourceGroupName, String name) { - final String filter = null; - return new PagedFlux<>( - () -> listUsagesSinglePageAsync(resourceGroupName, name, filter), - nextLink -> listUsagesNextSinglePageAsync(nextLink)); - } - - /** - * Gets the quota usage information of an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param filter Return only information specified in the filter (using OData syntax). For example: - * $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and - * endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the quota usage information of an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listUsagesAsync( - String resourceGroupName, String name, String filter, Context context) { - return new PagedFlux<>( - () -> listUsagesSinglePageAsync(resourceGroupName, name, filter, context), - nextLink -> listUsagesNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets the quota usage information of an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the quota usage information of an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listUsages(String resourceGroupName, String name) { - final String filter = null; - return new PagedIterable<>(listUsagesAsync(resourceGroupName, name, filter)); - } - - /** - * Gets the quota usage information of an app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param filter Return only information specified in the filter (using OData syntax). For example: - * $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and - * endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the quota usage information of an app (or deployment slot, if specified). - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listUsages( - String resourceGroupName, String name, String filter, Context context) { - return new PagedIterable<>(listUsagesAsync(resourceGroupName, name, filter, context)); - } - - /** - * Gets the virtual networks the app (or deployment slot) is connected to. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the virtual networks the app (or deployment slot) is connected to. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> listVnetConnectionsWithResponseAsync( - String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listVnetConnections( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the virtual networks the app (or deployment slot) is connected to. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the virtual networks the app (or deployment slot) is connected to. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> listVnetConnectionsWithResponseAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listVnetConnections( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets the virtual networks the app (or deployment slot) is connected to. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the virtual networks the app (or deployment slot) is connected to. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listVnetConnectionsAsync(String resourceGroupName, String name) { - return listVnetConnectionsWithResponseAsync(resourceGroupName, name) - .flatMap( - (Response> res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the virtual networks the app (or deployment slot) is connected to. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the virtual networks the app (or deployment slot) is connected to. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public List listVnetConnections(String resourceGroupName, String name) { - return listVnetConnectionsAsync(resourceGroupName, name).block(); - } - - /** - * Gets the virtual networks the app (or deployment slot) is connected to. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the virtual networks the app (or deployment slot) is connected to. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response> listVnetConnectionsWithResponse( - String resourceGroupName, String name, Context context) { - return listVnetConnectionsWithResponseAsync(resourceGroupName, name, context).block(); - } - - /** - * Gets a virtual network the app (or deployment slot) is connected to by name. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the virtual network. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual network the app (or deployment slot) is connected to by name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getVnetConnectionWithResponseAsync( - String resourceGroupName, String name, String vnetName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (vnetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vnetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getVnetConnection( - this.client.getEndpoint(), - resourceGroupName, - name, - vnetName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a virtual network the app (or deployment slot) is connected to by name. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the virtual network. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual network the app (or deployment slot) is connected to by name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getVnetConnectionWithResponseAsync( - String resourceGroupName, String name, String vnetName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (vnetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vnetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getVnetConnection( - this.client.getEndpoint(), - resourceGroupName, - name, - vnetName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets a virtual network the app (or deployment slot) is connected to by name. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the virtual network. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual network the app (or deployment slot) is connected to by name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getVnetConnectionAsync(String resourceGroupName, String name, String vnetName) { - return getVnetConnectionWithResponseAsync(resourceGroupName, name, vnetName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a virtual network the app (or deployment slot) is connected to by name. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the virtual network. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual network the app (or deployment slot) is connected to by name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VnetInfoInner getVnetConnection(String resourceGroupName, String name, String vnetName) { - return getVnetConnectionAsync(resourceGroupName, name, vnetName).block(); - } - - /** - * Gets a virtual network the app (or deployment slot) is connected to by name. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the virtual network. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual network the app (or deployment slot) is connected to by name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getVnetConnectionWithResponse( - String resourceGroupName, String name, String vnetName, Context context) { - return getVnetConnectionWithResponseAsync(resourceGroupName, name, vnetName, context).block(); - } - - /** - * Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of an existing Virtual Network. - * @param connectionEnvelope Properties of the Virtual Network connection. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network information contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateVnetConnectionWithResponseAsync( - String resourceGroupName, String name, String vnetName, VnetInfoInner connectionEnvelope) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (vnetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vnetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (connectionEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter connectionEnvelope is required and cannot be null.")); - } else { - connectionEnvelope.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdateVnetConnection( - this.client.getEndpoint(), - resourceGroupName, - name, - vnetName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - connectionEnvelope, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of an existing Virtual Network. - * @param connectionEnvelope Properties of the Virtual Network connection. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network information contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateVnetConnectionWithResponseAsync( - String resourceGroupName, String name, String vnetName, VnetInfoInner connectionEnvelope, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (vnetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vnetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (connectionEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter connectionEnvelope is required and cannot be null.")); - } else { - connectionEnvelope.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdateVnetConnection( - this.client.getEndpoint(), - resourceGroupName, - name, - vnetName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - connectionEnvelope, - accept, - context); - } - - /** - * Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of an existing Virtual Network. - * @param connectionEnvelope Properties of the Virtual Network connection. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network information contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateVnetConnectionAsync( - String resourceGroupName, String name, String vnetName, VnetInfoInner connectionEnvelope) { - return createOrUpdateVnetConnectionWithResponseAsync(resourceGroupName, name, vnetName, connectionEnvelope) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of an existing Virtual Network. - * @param connectionEnvelope Properties of the Virtual Network connection. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network information contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VnetInfoInner createOrUpdateVnetConnection( - String resourceGroupName, String name, String vnetName, VnetInfoInner connectionEnvelope) { - return createOrUpdateVnetConnectionAsync(resourceGroupName, name, vnetName, connectionEnvelope).block(); - } - - /** - * Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of an existing Virtual Network. - * @param connectionEnvelope Properties of the Virtual Network connection. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network information contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateVnetConnectionWithResponse( - String resourceGroupName, String name, String vnetName, VnetInfoInner connectionEnvelope, Context context) { - return createOrUpdateVnetConnectionWithResponseAsync( - resourceGroupName, name, vnetName, connectionEnvelope, context) - .block(); - } - - /** - * Deletes a connection from an app (or deployment slot to a named virtual network. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the virtual network. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteVnetConnectionWithResponseAsync( - String resourceGroupName, String name, String vnetName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (vnetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vnetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .deleteVnetConnection( - this.client.getEndpoint(), - resourceGroupName, - name, - vnetName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a connection from an app (or deployment slot to a named virtual network. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the virtual network. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteVnetConnectionWithResponseAsync( - String resourceGroupName, String name, String vnetName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (vnetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vnetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .deleteVnetConnection( - this.client.getEndpoint(), - resourceGroupName, - name, - vnetName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Deletes a connection from an app (or deployment slot to a named virtual network. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the virtual network. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteVnetConnectionAsync(String resourceGroupName, String name, String vnetName) { - return deleteVnetConnectionWithResponseAsync(resourceGroupName, name, vnetName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes a connection from an app (or deployment slot to a named virtual network. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the virtual network. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteVnetConnection(String resourceGroupName, String name, String vnetName) { - deleteVnetConnectionAsync(resourceGroupName, name, vnetName).block(); - } - - /** - * Deletes a connection from an app (or deployment slot to a named virtual network. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the virtual network. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteVnetConnectionWithResponse( - String resourceGroupName, String name, String vnetName, Context context) { - return deleteVnetConnectionWithResponseAsync(resourceGroupName, name, vnetName, context).block(); - } - - /** - * Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of an existing Virtual Network. - * @param connectionEnvelope Properties of the Virtual Network connection. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network information contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateVnetConnectionWithResponseAsync( - String resourceGroupName, String name, String vnetName, VnetInfoInner connectionEnvelope) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (vnetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vnetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (connectionEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter connectionEnvelope is required and cannot be null.")); - } else { - connectionEnvelope.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updateVnetConnection( - this.client.getEndpoint(), - resourceGroupName, - name, - vnetName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - connectionEnvelope, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of an existing Virtual Network. - * @param connectionEnvelope Properties of the Virtual Network connection. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network information contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateVnetConnectionWithResponseAsync( - String resourceGroupName, String name, String vnetName, VnetInfoInner connectionEnvelope, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (vnetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vnetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (connectionEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter connectionEnvelope is required and cannot be null.")); - } else { - connectionEnvelope.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updateVnetConnection( - this.client.getEndpoint(), - resourceGroupName, - name, - vnetName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - connectionEnvelope, - accept, - context); - } - - /** - * Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of an existing Virtual Network. - * @param connectionEnvelope Properties of the Virtual Network connection. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network information contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateVnetConnectionAsync( - String resourceGroupName, String name, String vnetName, VnetInfoInner connectionEnvelope) { - return updateVnetConnectionWithResponseAsync(resourceGroupName, name, vnetName, connectionEnvelope) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of an existing Virtual Network. - * @param connectionEnvelope Properties of the Virtual Network connection. See example. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network information contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VnetInfoInner updateVnetConnection( - String resourceGroupName, String name, String vnetName, VnetInfoInner connectionEnvelope) { - return updateVnetConnectionAsync(resourceGroupName, name, vnetName, connectionEnvelope).block(); - } - - /** - * Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of an existing Virtual Network. - * @param connectionEnvelope Properties of the Virtual Network connection. See example. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network information contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateVnetConnectionWithResponse( - String resourceGroupName, String name, String vnetName, VnetInfoInner connectionEnvelope, Context context) { - return updateVnetConnectionWithResponseAsync(resourceGroupName, name, vnetName, connectionEnvelope, context) - .block(); - } - - /** - * Gets an app's Virtual Network gateway. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the Virtual Network. - * @param gatewayName Name of the gateway. Currently, the only supported string is "primary". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an app's Virtual Network gateway. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getVnetConnectionGatewayWithResponseAsync( - String resourceGroupName, String name, String vnetName, String gatewayName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (vnetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vnetName is required and cannot be null.")); - } - if (gatewayName == null) { - return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getVnetConnectionGateway( - this.client.getEndpoint(), - resourceGroupName, - name, - vnetName, - gatewayName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets an app's Virtual Network gateway. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the Virtual Network. - * @param gatewayName Name of the gateway. Currently, the only supported string is "primary". - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an app's Virtual Network gateway. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getVnetConnectionGatewayWithResponseAsync( - String resourceGroupName, String name, String vnetName, String gatewayName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (vnetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vnetName is required and cannot be null.")); - } - if (gatewayName == null) { - return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getVnetConnectionGateway( - this.client.getEndpoint(), - resourceGroupName, - name, - vnetName, - gatewayName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets an app's Virtual Network gateway. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the Virtual Network. - * @param gatewayName Name of the gateway. Currently, the only supported string is "primary". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an app's Virtual Network gateway. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getVnetConnectionGatewayAsync( - String resourceGroupName, String name, String vnetName, String gatewayName) { - return getVnetConnectionGatewayWithResponseAsync(resourceGroupName, name, vnetName, gatewayName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets an app's Virtual Network gateway. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the Virtual Network. - * @param gatewayName Name of the gateway. Currently, the only supported string is "primary". - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an app's Virtual Network gateway. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VnetGatewayInner getVnetConnectionGateway( - String resourceGroupName, String name, String vnetName, String gatewayName) { - return getVnetConnectionGatewayAsync(resourceGroupName, name, vnetName, gatewayName).block(); - } - - /** - * Gets an app's Virtual Network gateway. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the Virtual Network. - * @param gatewayName Name of the gateway. Currently, the only supported string is "primary". - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an app's Virtual Network gateway. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getVnetConnectionGatewayWithResponse( - String resourceGroupName, String name, String vnetName, String gatewayName, Context context) { - return getVnetConnectionGatewayWithResponseAsync(resourceGroupName, name, vnetName, gatewayName, context) - .block(); - } - - /** - * Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the Virtual Network. - * @param gatewayName Name of the gateway. Currently, the only supported string is "primary". - * @param connectionEnvelope The properties to update this gateway with. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Virtual Network gateway contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateVnetConnectionGatewayWithResponseAsync( - String resourceGroupName, - String name, - String vnetName, - String gatewayName, - VnetGatewayInner connectionEnvelope) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (vnetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vnetName is required and cannot be null.")); - } - if (gatewayName == null) { - return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (connectionEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter connectionEnvelope is required and cannot be null.")); - } else { - connectionEnvelope.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdateVnetConnectionGateway( - this.client.getEndpoint(), - resourceGroupName, - name, - vnetName, - gatewayName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - connectionEnvelope, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the Virtual Network. - * @param gatewayName Name of the gateway. Currently, the only supported string is "primary". - * @param connectionEnvelope The properties to update this gateway with. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Virtual Network gateway contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateVnetConnectionGatewayWithResponseAsync( - String resourceGroupName, - String name, - String vnetName, - String gatewayName, - VnetGatewayInner connectionEnvelope, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (vnetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vnetName is required and cannot be null.")); - } - if (gatewayName == null) { - return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (connectionEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter connectionEnvelope is required and cannot be null.")); - } else { - connectionEnvelope.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdateVnetConnectionGateway( - this.client.getEndpoint(), - resourceGroupName, - name, - vnetName, - gatewayName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - connectionEnvelope, - accept, - context); - } - - /** - * Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the Virtual Network. - * @param gatewayName Name of the gateway. Currently, the only supported string is "primary". - * @param connectionEnvelope The properties to update this gateway with. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Virtual Network gateway contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateVnetConnectionGatewayAsync( - String resourceGroupName, - String name, - String vnetName, - String gatewayName, - VnetGatewayInner connectionEnvelope) { - return createOrUpdateVnetConnectionGatewayWithResponseAsync( - resourceGroupName, name, vnetName, gatewayName, connectionEnvelope) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the Virtual Network. - * @param gatewayName Name of the gateway. Currently, the only supported string is "primary". - * @param connectionEnvelope The properties to update this gateway with. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Virtual Network gateway contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VnetGatewayInner createOrUpdateVnetConnectionGateway( - String resourceGroupName, - String name, - String vnetName, - String gatewayName, - VnetGatewayInner connectionEnvelope) { - return createOrUpdateVnetConnectionGatewayAsync( - resourceGroupName, name, vnetName, gatewayName, connectionEnvelope) - .block(); - } - - /** - * Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the Virtual Network. - * @param gatewayName Name of the gateway. Currently, the only supported string is "primary". - * @param connectionEnvelope The properties to update this gateway with. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Virtual Network gateway contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateVnetConnectionGatewayWithResponse( - String resourceGroupName, - String name, - String vnetName, - String gatewayName, - VnetGatewayInner connectionEnvelope, - Context context) { - return createOrUpdateVnetConnectionGatewayWithResponseAsync( - resourceGroupName, name, vnetName, gatewayName, connectionEnvelope, context) - .block(); - } - - /** - * Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the Virtual Network. - * @param gatewayName Name of the gateway. Currently, the only supported string is "primary". - * @param connectionEnvelope The properties to update this gateway with. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Virtual Network gateway contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateVnetConnectionGatewayWithResponseAsync( - String resourceGroupName, - String name, - String vnetName, - String gatewayName, - VnetGatewayInner connectionEnvelope) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (vnetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vnetName is required and cannot be null.")); - } - if (gatewayName == null) { - return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (connectionEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter connectionEnvelope is required and cannot be null.")); - } else { - connectionEnvelope.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updateVnetConnectionGateway( - this.client.getEndpoint(), - resourceGroupName, - name, - vnetName, - gatewayName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - connectionEnvelope, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the Virtual Network. - * @param gatewayName Name of the gateway. Currently, the only supported string is "primary". - * @param connectionEnvelope The properties to update this gateway with. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Virtual Network gateway contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateVnetConnectionGatewayWithResponseAsync( - String resourceGroupName, - String name, - String vnetName, - String gatewayName, - VnetGatewayInner connectionEnvelope, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (vnetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vnetName is required and cannot be null.")); - } - if (gatewayName == null) { - return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (connectionEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter connectionEnvelope is required and cannot be null.")); - } else { - connectionEnvelope.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updateVnetConnectionGateway( - this.client.getEndpoint(), - resourceGroupName, - name, - vnetName, - gatewayName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - connectionEnvelope, - accept, - context); - } - - /** - * Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the Virtual Network. - * @param gatewayName Name of the gateway. Currently, the only supported string is "primary". - * @param connectionEnvelope The properties to update this gateway with. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Virtual Network gateway contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateVnetConnectionGatewayAsync( - String resourceGroupName, - String name, - String vnetName, - String gatewayName, - VnetGatewayInner connectionEnvelope) { - return updateVnetConnectionGatewayWithResponseAsync( - resourceGroupName, name, vnetName, gatewayName, connectionEnvelope) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the Virtual Network. - * @param gatewayName Name of the gateway. Currently, the only supported string is "primary". - * @param connectionEnvelope The properties to update this gateway with. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Virtual Network gateway contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VnetGatewayInner updateVnetConnectionGateway( - String resourceGroupName, - String name, - String vnetName, - String gatewayName, - VnetGatewayInner connectionEnvelope) { - return updateVnetConnectionGatewayAsync(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope) - .block(); - } - - /** - * Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param vnetName Name of the Virtual Network. - * @param gatewayName Name of the gateway. Currently, the only supported string is "primary". - * @param connectionEnvelope The properties to update this gateway with. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Virtual Network gateway contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateVnetConnectionGatewayWithResponse( - String resourceGroupName, - String name, - String vnetName, - String gatewayName, - VnetGatewayInner connectionEnvelope, - Context context) { - return updateVnetConnectionGatewayWithResponseAsync( - resourceGroupName, name, vnetName, gatewayName, connectionEnvelope, context) - .block(); - } - - /** - * List webjobs for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu web job information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWebJobsSinglePageAsync(String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listWebJobs( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List webjobs for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu web job information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWebJobsSinglePageAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listWebJobs( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * List webjobs for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu web job information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listWebJobsAsync(String resourceGroupName, String name) { - return new PagedFlux<>( - () -> listWebJobsSinglePageAsync(resourceGroupName, name), - nextLink -> listWebJobsNextSinglePageAsync(nextLink)); - } - - /** - * List webjobs for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu web job information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listWebJobsAsync(String resourceGroupName, String name, Context context) { - return new PagedFlux<>( - () -> listWebJobsSinglePageAsync(resourceGroupName, name, context), - nextLink -> listWebJobsNextSinglePageAsync(nextLink, context)); - } - - /** - * List webjobs for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu web job information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listWebJobs(String resourceGroupName, String name) { - return new PagedIterable<>(listWebJobsAsync(resourceGroupName, name)); - } - - /** - * List webjobs for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu web job information elements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listWebJobs(String resourceGroupName, String name, Context context) { - return new PagedIterable<>(listWebJobsAsync(resourceGroupName, name, context)); - } - - /** - * Get webjob information for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of the web job. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return webjob information for an app, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWebJobWithResponseAsync( - String resourceGroupName, String name, String webJobName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (webJobName == null) { - return Mono.error(new IllegalArgumentException("Parameter webJobName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getWebJob( - this.client.getEndpoint(), - resourceGroupName, - name, - webJobName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get webjob information for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of the web job. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return webjob information for an app, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWebJobWithResponseAsync( - String resourceGroupName, String name, String webJobName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (webJobName == null) { - return Mono.error(new IllegalArgumentException("Parameter webJobName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getWebJob( - this.client.getEndpoint(), - resourceGroupName, - name, - webJobName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Get webjob information for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of the web job. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return webjob information for an app, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getWebJobAsync(String resourceGroupName, String name, String webJobName) { - return getWebJobWithResponseAsync(resourceGroupName, name, webJobName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get webjob information for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of the web job. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return webjob information for an app, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public WebJobInner getWebJob(String resourceGroupName, String name, String webJobName) { - return getWebJobAsync(resourceGroupName, name, webJobName).block(); - } - - /** - * Get webjob information for an app, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param webJobName Name of the web job. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return webjob information for an app, or a deployment slot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWebJobWithResponse( - String resourceGroupName, String name, String webJobName, Context context) { - return getWebJobWithResponseAsync(resourceGroupName, name, webJobName, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of backup items. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBackupsNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listBackupsNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of backup items. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBackupsNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listBackupsNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of site configurations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listConfigurationsNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listConfigurationsNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of site configurations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listConfigurationsNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listConfigurationsNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of metadata for the app configuration snapshots that can be restored. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listConfigurationSnapshotInfoNextSinglePageAsync( - String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service.listConfigurationSnapshotInfoNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of metadata for the app configuration snapshots that can be restored. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listConfigurationSnapshotInfoNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listConfigurationSnapshotInfoNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu continuous web job information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listContinuousWebJobsNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listContinuousWebJobsNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu continuous web job information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listContinuousWebJobsNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listContinuousWebJobsNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of app deployments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listDeploymentsNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listDeploymentsNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of app deployments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listDeploymentsNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listDeploymentsNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of identifiers. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listDomainOwnershipIdentifiersNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service.listDomainOwnershipIdentifiersNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of identifiers. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listDomainOwnershipIdentifiersNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listDomainOwnershipIdentifiersNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu function information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listFunctionsNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listFunctionsNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu function information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listFunctionsNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listFunctionsNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of hostname bindings. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listHostnameBindingsNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listHostnameBindingsNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of hostname bindings. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listHostnameBindingsNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listHostnameBindingsNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of app instances. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listInstanceIdentifiersNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listInstanceIdentifiersNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of app instances. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listInstanceIdentifiersNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listInstanceIdentifiersNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu process information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listInstanceProcessesNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listInstanceProcessesNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu process information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listInstanceProcessesNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listInstanceProcessesNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listInstanceProcessModulesNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listInstanceProcessModulesNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listInstanceProcessModulesNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listInstanceProcessModulesNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listInstanceProcessThreadsNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listInstanceProcessThreadsNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listInstanceProcessThreadsNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listInstanceProcessThreadsNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of metric definitions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listMetricDefinitionsNextSinglePageAsync( - String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listMetricDefinitionsNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of metric definitions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listMetricDefinitionsNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listMetricDefinitionsNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of metric responses. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listMetricsNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listMetricsNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of metric responses. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listMetricsNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listMetricsNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of performance monitor counters. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listPerfMonCountersNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listPerfMonCountersNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of performance monitor counters. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listPerfMonCountersNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listPerfMonCountersNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu process information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listProcessesNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listProcessesNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu process information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listProcessesNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listProcessesNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listProcessModulesNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listProcessModulesNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listProcessModulesNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listProcessModulesNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listProcessThreadsNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listProcessThreadsNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listProcessThreadsNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listProcessThreadsNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of public certificates. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listPublicCertificatesNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listPublicCertificatesNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of public certificates. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listPublicCertificatesNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listPublicCertificatesNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu site extension information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSiteExtensionsNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listSiteExtensionsNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu site extension information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSiteExtensionsNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listSiteExtensionsNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSlotsNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listSlotsNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSlotsNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listSlotsNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of backup items. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBackupsSlotNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listBackupsSlotNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of backup items. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBackupsSlotNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listBackupsSlotNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of site configurations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listConfigurationsSlotNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listConfigurationsSlotNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of site configurations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listConfigurationsSlotNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listConfigurationsSlotNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of metadata for the app configuration snapshots that can be restored. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listConfigurationSnapshotInfoSlotNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service.listConfigurationSnapshotInfoSlotNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of metadata for the app configuration snapshots that can be restored. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listConfigurationSnapshotInfoSlotNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listConfigurationSnapshotInfoSlotNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu continuous web job information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listContinuousWebJobsSlotNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listContinuousWebJobsSlotNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu continuous web job information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listContinuousWebJobsSlotNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listContinuousWebJobsSlotNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of app deployments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listDeploymentsSlotNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listDeploymentsSlotNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of app deployments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listDeploymentsSlotNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listDeploymentsSlotNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of identifiers. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listDomainOwnershipIdentifiersSlotNextSinglePageAsync( - String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listDomainOwnershipIdentifiersSlotNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of identifiers. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listDomainOwnershipIdentifiersSlotNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listDomainOwnershipIdentifiersSlotNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu function information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listInstanceFunctionsSlotNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listInstanceFunctionsSlotNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu function information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listInstanceFunctionsSlotNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listInstanceFunctionsSlotNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of hostname bindings. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listHostnameBindingsSlotNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listHostnameBindingsSlotNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of hostname bindings. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listHostnameBindingsSlotNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listHostnameBindingsSlotNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of app instances. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listInstanceIdentifiersSlotNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service.listInstanceIdentifiersSlotNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of app instances. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listInstanceIdentifiersSlotNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listInstanceIdentifiersSlotNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu process information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listInstanceProcessesSlotNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listInstanceProcessesSlotNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu process information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listInstanceProcessesSlotNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listInstanceProcessesSlotNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listInstanceProcessModulesSlotNextSinglePageAsync( - String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service.listInstanceProcessModulesSlotNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listInstanceProcessModulesSlotNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listInstanceProcessModulesSlotNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listInstanceProcessThreadsSlotNextSinglePageAsync( - String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service.listInstanceProcessThreadsSlotNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listInstanceProcessThreadsSlotNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listInstanceProcessThreadsSlotNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of metric definitions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listMetricDefinitionsSlotNextSinglePageAsync( - String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listMetricDefinitionsSlotNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of metric definitions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listMetricDefinitionsSlotNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listMetricDefinitionsSlotNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of metric responses. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listMetricsSlotNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listMetricsSlotNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of metric responses. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listMetricsSlotNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listMetricsSlotNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of performance monitor counters. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listPerfMonCountersSlotNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listPerfMonCountersSlotNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of performance monitor counters. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listPerfMonCountersSlotNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listPerfMonCountersSlotNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu process information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listProcessesSlotNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listProcessesSlotNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu process information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listProcessesSlotNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listProcessesSlotNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listProcessModulesSlotNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listProcessModulesSlotNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listProcessModulesSlotNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listProcessModulesSlotNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listProcessThreadsSlotNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listProcessThreadsSlotNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu thread information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listProcessThreadsSlotNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listProcessThreadsSlotNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of public certificates. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listPublicCertificatesSlotNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listPublicCertificatesSlotNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of public certificates. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listPublicCertificatesSlotNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listPublicCertificatesSlotNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu site extension information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSiteExtensionsSlotNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listSiteExtensionsSlotNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu site extension information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSiteExtensionsSlotNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listSiteExtensionsSlotNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of slot differences. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSlotDifferencesSlotNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listSlotDifferencesSlotNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of slot differences. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSlotDifferencesSlotNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listSlotDifferencesSlotNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of snapshots which can be used to revert an app to a previous time. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSnapshotsSlotNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listSnapshotsSlotNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of snapshots which can be used to revert an app to a previous time. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSnapshotsSlotNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listSnapshotsSlotNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of snapshots which can be used to revert an app to a previous time. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSnapshotsFromDRSecondarySlotNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service.listSnapshotsFromDRSecondarySlotNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of snapshots which can be used to revert an app to a previous time. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSnapshotsFromDRSecondarySlotNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listSnapshotsFromDRSecondarySlotNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu continuous web job information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listTriggeredWebJobsSlotNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listTriggeredWebJobsSlotNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu continuous web job information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listTriggeredWebJobsSlotNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listTriggeredWebJobsSlotNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu continuous web job information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listTriggeredWebJobHistorySlotNextSinglePageAsync( - String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service.listTriggeredWebJobHistorySlotNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu continuous web job information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listTriggeredWebJobHistorySlotNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listTriggeredWebJobHistorySlotNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of CSM usage quotas. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listUsagesSlotNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listUsagesSlotNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of CSM usage quotas. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listUsagesSlotNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listUsagesSlotNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu web job information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWebJobsSlotNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listWebJobsSlotNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu web job information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWebJobsSlotNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listWebJobsSlotNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of slot differences. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSlotDifferencesFromProductionNextSinglePageAsync( - String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service.listSlotDifferencesFromProductionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of slot differences. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSlotDifferencesFromProductionNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listSlotDifferencesFromProductionNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of snapshots which can be used to revert an app to a previous time. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSnapshotsNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listSnapshotsNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of snapshots which can be used to revert an app to a previous time. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSnapshotsNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listSnapshotsNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of snapshots which can be used to revert an app to a previous time. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSnapshotsFromDRSecondaryNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service.listSnapshotsFromDRSecondaryNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of snapshots which can be used to revert an app to a previous time. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSnapshotsFromDRSecondaryNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listSnapshotsFromDRSecondaryNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu continuous web job information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listTriggeredWebJobsNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listTriggeredWebJobsNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu continuous web job information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listTriggeredWebJobsNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listTriggeredWebJobsNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu continuous web job information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listTriggeredWebJobHistoryNextSinglePageAsync( - String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listTriggeredWebJobHistoryNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu continuous web job information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listTriggeredWebJobHistoryNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listTriggeredWebJobHistoryNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of CSM usage quotas. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listUsagesNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listUsagesNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of CSM usage quotas. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listUsagesNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listUsagesNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu web job information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWebJobsNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listWebJobsNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Kudu web job information elements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWebJobsNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listWebJobsNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/WebAppsImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/WebAppsImpl.java deleted file mode 100644 index e52816dfa21d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/WebAppsImpl.java +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.CoreUtils; -import com.azure.resourcemanager.appservice.AppServiceManager; -import com.azure.resourcemanager.appservice.fluent.WebAppsClient; -import com.azure.resourcemanager.appservice.fluent.models.SiteConfigResourceInner; -import com.azure.resourcemanager.appservice.fluent.models.SiteInner; -import com.azure.resourcemanager.appservice.fluent.models.SiteLogsConfigInner; -import com.azure.resourcemanager.appservice.models.WebApp; -import com.azure.resourcemanager.appservice.models.WebAppBasic; -import com.azure.resourcemanager.appservice.models.WebApps; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsBatchDeletion; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.BatchDeletionImpl; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.GroupableResourcesImpl; -import com.azure.resourcemanager.resources.fluentcore.utils.PagedConverter; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.List; -import java.util.regex.Pattern; - -/** The implementation for WebApps. */ -public class WebAppsImpl - extends GroupableResourcesImpl - implements WebApps, SupportsBatchDeletion { - - public WebAppsImpl(final AppServiceManager manager) { - super(manager.serviceClient().getWebApps(), manager); - } - - @Override - public Mono getByResourceGroupAsync(final String resourceGroupName, final String name) { - if (CoreUtils.isNullOrEmpty(resourceGroupName)) { - return Mono.error( - new IllegalArgumentException("Parameter 'resourceGroupName' is required and cannot be null.")); - } - if (CoreUtils.isNullOrEmpty(name)) { - return Mono.error( - new IllegalArgumentException("Parameter 'name' is required and cannot be null.")); - } - return this - .getInnerAsync(resourceGroupName, name) - .flatMap( - siteInner -> - Mono - .zip( - this.inner().getConfigurationAsync(resourceGroupName, name), - this.inner().getDiagnosticLogsConfigurationAsync(resourceGroupName, name), - (SiteConfigResourceInner siteConfigResourceInner, SiteLogsConfigInner logsConfigInner) -> - wrapModel(siteInner, siteConfigResourceInner, logsConfigInner))); - } - - @Override - protected Mono getInnerAsync(String resourceGroupName, String name) { - return this.inner().getByResourceGroupAsync(resourceGroupName, name); - } - - @Override - protected Mono deleteInnerAsync(String resourceGroupName, String name) { - return inner().deleteAsync(resourceGroupName, name).then(); - } - - @Override - protected WebAppImpl wrapModel(String name) { - return new WebAppImpl(name, new SiteInner().withKind("app"), null, null, this.manager()); - } - - protected WebAppImpl wrapModel(SiteInner inner, SiteConfigResourceInner siteConfig, SiteLogsConfigInner logConfig) { - if (inner == null) { - return null; - } - return new WebAppImpl(inner.name(), inner, siteConfig, logConfig, this.manager()); - } - - @Override - protected WebAppImpl wrapModel(SiteInner inner) { - return wrapModel(inner, null, null); - } - - @Override - public WebAppImpl define(String name) { - return wrapModel(name); - } - - @Override - public Flux deleteByIdsAsync(Collection ids) { - return BatchDeletionImpl.deleteByIdsAsync(ids, this::deleteInnerAsync); - } - - @Override - public Flux deleteByIdsAsync(String... ids) { - return this.deleteByIdsAsync(new ArrayList<>(Arrays.asList(ids))); - } - - @Override - public void deleteByIds(Collection ids) { - if (ids != null && !ids.isEmpty()) { - this.deleteByIdsAsync(ids).blockLast(); - } - } - - @Override - public void deleteByIds(String... ids) { - this.deleteByIds(new ArrayList<>(Arrays.asList(ids))); - } - - @Override - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(this.listByResourceGroupAsync(resourceGroupName)); - } - - @Override - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - if (CoreUtils.isNullOrEmpty(resourceGroupName)) { - return new PagedFlux<>(() -> Mono.error( - new IllegalArgumentException("Parameter 'resourceGroupName' is required and cannot be null."))); - } - return PagedConverter.flatMapPage(inner().listByResourceGroupAsync(resourceGroupName), - inner -> isWebApp(inner) ? Mono.just(new WebAppBasicImpl(inner, this.manager())) : Mono.empty()); - } - - @Override - public PagedIterable list() { - return new PagedIterable<>(this.listAsync()); - } - - @Override - public PagedFlux listAsync() { - return PagedConverter.flatMapPage(inner().listAsync(), - inner -> isWebApp(inner) ? Mono.just(new WebAppBasicImpl(inner, this.manager())) : Mono.empty()); - } - - private static boolean isWebApp(SiteInner inner) { - boolean ret = false; - if (inner.kind() == null) { - ret = true; - } else { - List kinds = Arrays.asList(inner.kind().split(Pattern.quote(","))); - if ((kinds.contains("app") || kinds.contains("api")) && !kinds.contains("kubernetes")) { - ret = true; - } - } - return ret; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/WebDeploymentImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/WebDeploymentImpl.java deleted file mode 100644 index 4a342f2e2d57..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/WebDeploymentImpl.java +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.appservice.implementation; - -import com.azure.resourcemanager.appservice.models.MSDeploy; -import com.azure.resourcemanager.appservice.models.MSDeployCore; -import com.azure.resourcemanager.appservice.models.WebAppBase; -import com.azure.resourcemanager.appservice.models.WebDeployment; -import com.azure.resourcemanager.appservice.fluent.models.MSDeployStatusInner; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.ExecutableImpl; -import java.time.OffsetDateTime; -import java.util.ArrayList; -import java.util.HashMap; -import reactor.core.publisher.Mono; - -/** - * Implementation of WebDeployment. - * - * @param the fluent interface, web app, function app, or deployment slot - * @param the implementation class for FluentT - */ -public class WebDeploymentImpl> - extends ExecutableImpl implements WebDeployment, WebDeployment.Definition { - private final WebAppBaseImpl parent; - private MSDeploy request; - private MSDeployStatusInner result; - - WebDeploymentImpl(WebAppBaseImpl parent) { - this.parent = parent; - this.request = new MSDeploy(); - } - - @Override - public WebAppBase parent() { - return parent; - } - - @Override - public String deployer() { - return result.deployer(); - } - - @Override - public OffsetDateTime startTime() { - return result.startTime(); - } - - @Override - public OffsetDateTime endTime() { - return result.endTime(); - } - - @Override - public boolean complete() { - return result.complete(); - } - - @Override - public WebDeploymentImpl withPackageUri(String packageUri) { - request.withAddOnPackages(new ArrayList()); - request.addOnPackages().add(new MSDeployCore().withPackageUri(packageUri)); - return this; - } - - @Override - public Mono executeWorkAsync() { - return parent - .createMSDeploy(request) - .map( - msDeployStatusInner -> { - result = msDeployStatusInner; - return WebDeploymentImpl.this; - }); - } - - @Override - public WebDeploymentImpl withExistingDeploymentsDeleted(boolean deleteExisting) { - if (deleteExisting) { - MSDeployCore first = request.addOnPackages().remove(0); - request.withPackageUri(first.packageUri()); - } - return this; - } - - @Override - public WebDeploymentImpl withAddOnPackage(String packageUri) { - request.addOnPackages().add(new MSDeployCore().withPackageUri(packageUri)); - return this; - } - - @Override - public WebDeploymentImpl withSetParametersXmlFile(String fileUri) { - request.withSetParametersXmlFileUri(fileUri); - return this; - } - - @Override - public WebDeploymentImpl withSetParameter(String name, String value) { - if (request.setParameters() == null) { - request.withSetParameters(new HashMap()); - } - request.setParameters().put(name, value); - return this; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/WebDeploymentSlotBasicImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/WebDeploymentSlotBasicImpl.java deleted file mode 100644 index 9f5cca05e8cc..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/WebDeploymentSlotBasicImpl.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.implementation; - -import com.azure.resourcemanager.appservice.fluent.models.SiteInner; -import com.azure.resourcemanager.appservice.models.DeploymentSlot; -import com.azure.resourcemanager.appservice.models.WebApp; -import com.azure.resourcemanager.appservice.models.WebDeploymentSlotBasic; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasParent; -import reactor.core.publisher.Mono; - -class WebDeploymentSlotBasicImpl extends WebSiteBaseImpl implements WebDeploymentSlotBasic, HasParent { - - private final WebApp myParent; - - WebDeploymentSlotBasicImpl(SiteInner innerObject, WebApp myParent) { - super(innerObject); - this.myParent = myParent; - } - - @Override - public String name() { - return super.name().replaceAll(".*/", ""); - } - - @Override - public DeploymentSlot refresh() { - return this.refreshAsync().block(); - } - - @Override - public Mono refreshAsync() { - return this.parent().deploymentSlots().getByIdAsync(this.id()) - .doOnNext(site -> this.setInner(site.innerModel())); - } - - @Override - public WebApp parent() { - return myParent; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/WebSiteBaseImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/WebSiteBaseImpl.java deleted file mode 100644 index 2d2f3ddd8c02..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/WebSiteBaseImpl.java +++ /dev/null @@ -1,302 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.implementation; - -import com.azure.resourcemanager.appservice.fluent.models.SiteInner; -import com.azure.resourcemanager.appservice.models.CloningInfo; -import com.azure.resourcemanager.appservice.models.HostingEnvironmentProfile; -import com.azure.resourcemanager.appservice.models.HostnameSslState; -import com.azure.resourcemanager.appservice.models.ManagedServiceIdentity; -import com.azure.resourcemanager.appservice.models.OperatingSystem; -import com.azure.resourcemanager.appservice.models.RedundancyMode; -import com.azure.resourcemanager.appservice.models.SiteAvailabilityState; -import com.azure.resourcemanager.appservice.models.SlotSwapStatus; -import com.azure.resourcemanager.appservice.models.SslState; -import com.azure.resourcemanager.appservice.models.UsageState; -import com.azure.resourcemanager.appservice.models.WebSiteBase; -import com.azure.core.management.Region; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; - -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; -import java.util.UUID; - -class WebSiteBaseImpl implements WebSiteBase { - - private final String key; - private SiteInner innerObject; - - private final Set hostNamesSet = new HashSet<>(); - private final Set enabledHostNamesSet = new HashSet<>(); - private final Set trafficManagerHostNamesSet = new HashSet<>(); - private final Set outboundIPAddressesSet = new HashSet<>(); - private final Set possibleOutboundIPAddressesSet = new HashSet<>(); - private final Map hostNameSslStateMap = new HashMap<>(); - private final Set clientCertExclusionPathSet = new HashSet<>(); - - WebSiteBaseImpl(SiteInner innerObject) { - this.key = UUID.randomUUID().toString(); - this.setInner(innerObject); - } - - @Override - public String state() { - return innerModel().state(); - } - - @Override - public Set hostnames() { - return Collections.unmodifiableSet(hostNamesSet); - } - - @Override - public String repositorySiteName() { - return innerModel().repositorySiteName(); - } - - @Override - public UsageState usageState() { - return innerModel().usageState(); - } - - @Override - public boolean enabled() { - return innerModel().enabled() == null || innerModel().enabled(); - } - - @Override - public Set enabledHostNames() { - return Collections.unmodifiableSet(enabledHostNamesSet); - } - - @Override - public SiteAvailabilityState availabilityState() { - return innerModel().availabilityState(); - } - - @Override - public Map hostnameSslStates() { - return Collections.unmodifiableMap(hostNameSslStateMap); - } - - @Override - public OffsetDateTime lastModifiedTime() { - return innerModel().lastModifiedTimeUtc(); - } - - @Override - public Set trafficManagerHostNames() { - return Collections.unmodifiableSet(trafficManagerHostNamesSet); - } - - @Override - public boolean scmSiteAlsoStopped() { - return ResourceManagerUtils.toPrimitiveBoolean(innerModel().scmSiteAlsoStopped()); - } - - @Override - public String targetSwapSlot() { - return innerModel().targetSwapSlot(); - } - - @Override - public boolean clientAffinityEnabled() { - return ResourceManagerUtils.toPrimitiveBoolean(innerModel().clientAffinityEnabled()); - } - - @Override - public boolean clientCertEnabled() { - return ResourceManagerUtils.toPrimitiveBoolean(innerModel().clientCertEnabled()); - } - - @Override - public boolean hostnamesDisabled() { - return ResourceManagerUtils.toPrimitiveBoolean(innerModel().hostNamesDisabled()); - } - - @Override - public Set outboundIPAddresses() { - return Collections.unmodifiableSet(outboundIPAddressesSet); - } - - @Override - public int containerSize() { - return ResourceManagerUtils.toPrimitiveInt(innerModel().containerSize()); - } - - @Override - public CloningInfo cloningInfo() { - return innerModel().cloningInfo(); - } - - @Override - public boolean isDefaultContainer() { - return innerModel().isDefaultContainer() == null || innerModel().isDefaultContainer(); - } - - @Override - public String defaultHostname() { - return innerModel().defaultHostname(); - } - - @Override - public boolean httpsOnly() { - return ResourceManagerUtils.toPrimitiveBoolean(innerModel().httpsOnly()); - } - - @Override - public String appServicePlanId() { - return innerModel().serverFarmId(); - } - - @Override - public ManagedServiceIdentity identity() { - return innerModel().identity(); - } - - private boolean reserved() { - return ResourceManagerUtils.toPrimitiveBoolean(innerModel().reserved()); - } - - @Override - public boolean hyperV() { - return ResourceManagerUtils.toPrimitiveBoolean(innerModel().hyperV()); - } - - @Override - public HostingEnvironmentProfile hostingEnvironmentProfile() { - return innerModel().hostingEnvironmentProfile(); - } - - @Override - public Set clientCertExclusionPaths() { - return Collections.unmodifiableSet(clientCertExclusionPathSet); - } - - @Override - public Set possibleOutboundIpAddresses() { - return Collections.unmodifiableSet(possibleOutboundIPAddressesSet); - } - - @Override - public int dailyMemoryTimeQuota() { - return ResourceManagerUtils.toPrimitiveInt(innerModel().dailyMemoryTimeQuota()); - } - - @Override - public OffsetDateTime suspendedTill() { - return innerModel().suspendedTill(); - } - - @Override - public int maxNumberOfWorkers() { - return ResourceManagerUtils.toPrimitiveInt(innerModel().maxNumberOfWorkers()); - } - - @Override - public SlotSwapStatus slotSwapStatus() { - return innerModel().slotSwapStatus(); - } - - @Override - public RedundancyMode redundancyMode() { - return innerModel().redundancyMode(); - } - - @Override - public OperatingSystem operatingSystem() { - return reserved() ? OperatingSystem.LINUX : OperatingSystem.WINDOWS; - } - - @Override - public String resourceGroupName() { - return innerModel().resourceGroup(); - } - - @Override - public String type() { - return innerModel().type(); - } - - @Override - public String regionName() { - return innerModel().location(); - } - - @Override - public Region region() { - return Region.fromName(this.regionName()); - } - - @Override - public Map tags() { - return Collections.unmodifiableMap(innerModel().tags()); - } - - @Override - public String id() { - return innerModel().id(); - } - - @Override - public String name() { - return innerModel().name(); - } - - @Override - public SiteInner innerModel() { - return innerObject; - } - - protected void setInner(SiteInner innerObject) { - this.innerObject = innerObject; - - this.hostNamesSet.clear(); - if (innerModel().hostNames() != null) { - this.hostNamesSet.addAll(innerModel().hostNames()); - } - this.enabledHostNamesSet.clear(); - if (innerModel().enabledHostNames() != null) { - this.enabledHostNamesSet.addAll(innerModel().enabledHostNames()); - } - this.trafficManagerHostNamesSet.clear(); - if (innerModel().trafficManagerHostNames() != null) { - this.trafficManagerHostNamesSet.addAll(innerModel().trafficManagerHostNames()); - } - this.outboundIPAddressesSet.clear(); - if (innerModel().outboundIpAddresses() != null) { - this.outboundIPAddressesSet.addAll(Arrays.asList(innerModel().outboundIpAddresses().split(",[ ]*"))); - } - this.possibleOutboundIPAddressesSet.clear(); - if (innerModel().possibleOutboundIpAddresses() != null) { - this.possibleOutboundIPAddressesSet.addAll(Arrays.asList( - innerModel().possibleOutboundIpAddresses().split(",[ ]*"))); - } - this.hostNameSslStateMap.clear(); - if (innerModel().hostnameSslStates() != null) { - for (HostnameSslState hostNameSslState : innerModel().hostnameSslStates()) { - // Server returns null sometimes, invalid on update, so we set default - if (hostNameSslState.sslState() == null) { - hostNameSslState.withSslState(SslState.DISABLED); - } - hostNameSslStateMap.put(hostNameSslState.name(), hostNameSslState); - } - } - this.clientCertExclusionPathSet.clear(); - if (innerModel().clientCertExclusionPaths() != null) { - this.clientCertExclusionPathSet.addAll(Arrays.asList( - innerModel().clientCertExclusionPaths().split(",[ ]*"))); - } - } - - @Override - public String key() { - return key; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/WebSiteManagementClientBuilder.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/WebSiteManagementClientBuilder.java deleted file mode 100644 index 426c03bc6b2c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/WebSiteManagementClientBuilder.java +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.implementation; - -import com.azure.core.annotation.ServiceClientBuilder; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.policy.CookiePolicy; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerAdapter; -import java.time.Duration; - -/** A builder for creating a new instance of the WebSiteManagementClientImpl type. */ -@ServiceClientBuilder(serviceClients = {WebSiteManagementClientImpl.class}) -public final class WebSiteManagementClientBuilder { - /* - * Your Azure subscription ID. This is a GUID-formatted string (e.g. - * 00000000-0000-0000-0000-000000000000). - */ - private String subscriptionId; - - /** - * Sets Your Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). - * - * @param subscriptionId the subscriptionId value. - * @return the WebSiteManagementClientBuilder. - */ - public WebSiteManagementClientBuilder subscriptionId(String subscriptionId) { - this.subscriptionId = subscriptionId; - return this; - } - - /* - * server parameter - */ - private String endpoint; - - /** - * Sets server parameter. - * - * @param endpoint the endpoint value. - * @return the WebSiteManagementClientBuilder. - */ - public WebSiteManagementClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * The environment to connect to - */ - private AzureEnvironment environment; - - /** - * Sets The environment to connect to. - * - * @param environment the environment value. - * @return the WebSiteManagementClientBuilder. - */ - public WebSiteManagementClientBuilder environment(AzureEnvironment environment) { - this.environment = environment; - return this; - } - - /* - * The default poll interval for long-running operation - */ - private Duration defaultPollInterval; - - /** - * Sets The default poll interval for long-running operation. - * - * @param defaultPollInterval the defaultPollInterval value. - * @return the WebSiteManagementClientBuilder. - */ - public WebSiteManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = defaultPollInterval; - return this; - } - - /* - * The HTTP pipeline to send requests through - */ - private HttpPipeline pipeline; - - /** - * Sets The HTTP pipeline to send requests through. - * - * @param pipeline the pipeline value. - * @return the WebSiteManagementClientBuilder. - */ - public WebSiteManagementClientBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; - return this; - } - - /* - * The serializer to serialize an object into a string - */ - private SerializerAdapter serializerAdapter; - - /** - * Sets The serializer to serialize an object into a string. - * - * @param serializerAdapter the serializerAdapter value. - * @return the WebSiteManagementClientBuilder. - */ - public WebSiteManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { - this.serializerAdapter = serializerAdapter; - return this; - } - - /** - * Builds an instance of WebSiteManagementClientImpl with the provided parameters. - * - * @return an instance of WebSiteManagementClientImpl. - */ - public WebSiteManagementClientImpl buildClient() { - if (endpoint == null) { - this.endpoint = "https://management.azure.com"; - } - if (environment == null) { - this.environment = AzureEnvironment.AZURE; - } - if (defaultPollInterval == null) { - this.defaultPollInterval = Duration.ofSeconds(30); - } - if (pipeline == null) { - this.pipeline = - new HttpPipelineBuilder() - .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) - .build(); - } - if (serializerAdapter == null) { - this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); - } - WebSiteManagementClientImpl client = - new WebSiteManagementClientImpl( - pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); - return client; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/WebSiteManagementClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/WebSiteManagementClientImpl.java deleted file mode 100644 index 8ea79c3f3a11..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/WebSiteManagementClientImpl.java +++ /dev/null @@ -1,329 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.implementation; - -import com.azure.core.annotation.ServiceClient; -import com.azure.core.http.HttpPipeline; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.serializer.SerializerAdapter; -import com.azure.resourcemanager.appservice.fluent.AppServiceCertificateOrdersClient; -import com.azure.resourcemanager.appservice.fluent.AppServiceEnvironmentsClient; -import com.azure.resourcemanager.appservice.fluent.AppServicePlansClient; -import com.azure.resourcemanager.appservice.fluent.CertificateRegistrationProvidersClient; -import com.azure.resourcemanager.appservice.fluent.CertificatesClient; -import com.azure.resourcemanager.appservice.fluent.DeletedWebAppsClient; -import com.azure.resourcemanager.appservice.fluent.DiagnosticsClient; -import com.azure.resourcemanager.appservice.fluent.DomainRegistrationProvidersClient; -import com.azure.resourcemanager.appservice.fluent.DomainsClient; -import com.azure.resourcemanager.appservice.fluent.ProvidersClient; -import com.azure.resourcemanager.appservice.fluent.RecommendationsClient; -import com.azure.resourcemanager.appservice.fluent.ResourceHealthMetadatasClient; -import com.azure.resourcemanager.appservice.fluent.ResourceProvidersClient; -import com.azure.resourcemanager.appservice.fluent.TopLevelDomainsClient; -import com.azure.resourcemanager.appservice.fluent.WebAppsClient; -import com.azure.resourcemanager.appservice.fluent.WebSiteManagementClient; -import com.azure.resourcemanager.resources.fluentcore.AzureServiceClient; -import java.time.Duration; - -/** Initializes a new instance of the WebSiteManagementClientImpl type. */ -@ServiceClient(builder = WebSiteManagementClientBuilder.class) -public final class WebSiteManagementClientImpl extends AzureServiceClient implements WebSiteManagementClient { - private final ClientLogger logger = new ClientLogger(WebSiteManagementClientImpl.class); - - /** Your Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). */ - private final String subscriptionId; - - /** - * Gets Your Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). - * - * @return the subscriptionId value. - */ - public String getSubscriptionId() { - return this.subscriptionId; - } - - /** server parameter. */ - private final String endpoint; - - /** - * Gets server parameter. - * - * @return the endpoint value. - */ - public String getEndpoint() { - return this.endpoint; - } - - /** Api Version. */ - private final String apiVersion; - - /** - * Gets Api Version. - * - * @return the apiVersion value. - */ - public String getApiVersion() { - return this.apiVersion; - } - - /** The HTTP pipeline to send requests through. */ - private final HttpPipeline httpPipeline; - - /** - * Gets The HTTP pipeline to send requests through. - * - * @return the httpPipeline value. - */ - public HttpPipeline getHttpPipeline() { - return this.httpPipeline; - } - - /** The serializer to serialize an object into a string. */ - private final SerializerAdapter serializerAdapter; - - /** - * Gets The serializer to serialize an object into a string. - * - * @return the serializerAdapter value. - */ - SerializerAdapter getSerializerAdapter() { - return this.serializerAdapter; - } - - /** The default poll interval for long-running operation. */ - private final Duration defaultPollInterval; - - /** - * Gets The default poll interval for long-running operation. - * - * @return the defaultPollInterval value. - */ - public Duration getDefaultPollInterval() { - return this.defaultPollInterval; - } - - /** The AppServiceCertificateOrdersClient object to access its operations. */ - private final AppServiceCertificateOrdersClient appServiceCertificateOrders; - - /** - * Gets the AppServiceCertificateOrdersClient object to access its operations. - * - * @return the AppServiceCertificateOrdersClient object. - */ - public AppServiceCertificateOrdersClient getAppServiceCertificateOrders() { - return this.appServiceCertificateOrders; - } - - /** The CertificateRegistrationProvidersClient object to access its operations. */ - private final CertificateRegistrationProvidersClient certificateRegistrationProviders; - - /** - * Gets the CertificateRegistrationProvidersClient object to access its operations. - * - * @return the CertificateRegistrationProvidersClient object. - */ - public CertificateRegistrationProvidersClient getCertificateRegistrationProviders() { - return this.certificateRegistrationProviders; - } - - /** The DomainsClient object to access its operations. */ - private final DomainsClient domains; - - /** - * Gets the DomainsClient object to access its operations. - * - * @return the DomainsClient object. - */ - public DomainsClient getDomains() { - return this.domains; - } - - /** The TopLevelDomainsClient object to access its operations. */ - private final TopLevelDomainsClient topLevelDomains; - - /** - * Gets the TopLevelDomainsClient object to access its operations. - * - * @return the TopLevelDomainsClient object. - */ - public TopLevelDomainsClient getTopLevelDomains() { - return this.topLevelDomains; - } - - /** The DomainRegistrationProvidersClient object to access its operations. */ - private final DomainRegistrationProvidersClient domainRegistrationProviders; - - /** - * Gets the DomainRegistrationProvidersClient object to access its operations. - * - * @return the DomainRegistrationProvidersClient object. - */ - public DomainRegistrationProvidersClient getDomainRegistrationProviders() { - return this.domainRegistrationProviders; - } - - /** The CertificatesClient object to access its operations. */ - private final CertificatesClient certificates; - - /** - * Gets the CertificatesClient object to access its operations. - * - * @return the CertificatesClient object. - */ - public CertificatesClient getCertificates() { - return this.certificates; - } - - /** The DeletedWebAppsClient object to access its operations. */ - private final DeletedWebAppsClient deletedWebApps; - - /** - * Gets the DeletedWebAppsClient object to access its operations. - * - * @return the DeletedWebAppsClient object. - */ - public DeletedWebAppsClient getDeletedWebApps() { - return this.deletedWebApps; - } - - /** The DiagnosticsClient object to access its operations. */ - private final DiagnosticsClient diagnostics; - - /** - * Gets the DiagnosticsClient object to access its operations. - * - * @return the DiagnosticsClient object. - */ - public DiagnosticsClient getDiagnostics() { - return this.diagnostics; - } - - /** The ProvidersClient object to access its operations. */ - private final ProvidersClient providers; - - /** - * Gets the ProvidersClient object to access its operations. - * - * @return the ProvidersClient object. - */ - public ProvidersClient getProviders() { - return this.providers; - } - - /** The RecommendationsClient object to access its operations. */ - private final RecommendationsClient recommendations; - - /** - * Gets the RecommendationsClient object to access its operations. - * - * @return the RecommendationsClient object. - */ - public RecommendationsClient getRecommendations() { - return this.recommendations; - } - - /** The ResourceProvidersClient object to access its operations. */ - private final ResourceProvidersClient resourceProviders; - - /** - * Gets the ResourceProvidersClient object to access its operations. - * - * @return the ResourceProvidersClient object. - */ - public ResourceProvidersClient getResourceProviders() { - return this.resourceProviders; - } - - /** The WebAppsClient object to access its operations. */ - private final WebAppsClient webApps; - - /** - * Gets the WebAppsClient object to access its operations. - * - * @return the WebAppsClient object. - */ - public WebAppsClient getWebApps() { - return this.webApps; - } - - /** The AppServiceEnvironmentsClient object to access its operations. */ - private final AppServiceEnvironmentsClient appServiceEnvironments; - - /** - * Gets the AppServiceEnvironmentsClient object to access its operations. - * - * @return the AppServiceEnvironmentsClient object. - */ - public AppServiceEnvironmentsClient getAppServiceEnvironments() { - return this.appServiceEnvironments; - } - - /** The AppServicePlansClient object to access its operations. */ - private final AppServicePlansClient appServicePlans; - - /** - * Gets the AppServicePlansClient object to access its operations. - * - * @return the AppServicePlansClient object. - */ - public AppServicePlansClient getAppServicePlans() { - return this.appServicePlans; - } - - /** The ResourceHealthMetadatasClient object to access its operations. */ - private final ResourceHealthMetadatasClient resourceHealthMetadatas; - - /** - * Gets the ResourceHealthMetadatasClient object to access its operations. - * - * @return the ResourceHealthMetadatasClient object. - */ - public ResourceHealthMetadatasClient getResourceHealthMetadatas() { - return this.resourceHealthMetadatas; - } - - /** - * Initializes an instance of WebSiteManagementClient client. - * - * @param httpPipeline The HTTP pipeline to send requests through. - * @param serializerAdapter The serializer to serialize an object into a string. - * @param defaultPollInterval The default poll interval for long-running operation. - * @param environment The Azure environment. - * @param subscriptionId Your Azure subscription ID. This is a GUID-formatted string (e.g. - * 00000000-0000-0000-0000-000000000000). - * @param endpoint server parameter. - */ - WebSiteManagementClientImpl( - HttpPipeline httpPipeline, - SerializerAdapter serializerAdapter, - Duration defaultPollInterval, - AzureEnvironment environment, - String subscriptionId, - String endpoint) { - super(httpPipeline, serializerAdapter, environment); - this.httpPipeline = httpPipeline; - this.serializerAdapter = serializerAdapter; - this.defaultPollInterval = defaultPollInterval; - this.subscriptionId = subscriptionId; - this.endpoint = endpoint; - this.apiVersion = "2018-02-01"; - this.appServiceCertificateOrders = new AppServiceCertificateOrdersClientImpl(this); - this.certificateRegistrationProviders = new CertificateRegistrationProvidersClientImpl(this); - this.domains = new DomainsClientImpl(this); - this.topLevelDomains = new TopLevelDomainsClientImpl(this); - this.domainRegistrationProviders = new DomainRegistrationProvidersClientImpl(this); - this.certificates = new CertificatesClientImpl(this); - this.deletedWebApps = new DeletedWebAppsClientImpl(this); - this.diagnostics = new DiagnosticsClientImpl(this); - this.providers = new ProvidersClientImpl(this); - this.recommendations = new RecommendationsClientImpl(this); - this.resourceProviders = new ResourceProvidersClientImpl(this); - this.webApps = new WebAppsClientImpl(this); - this.appServiceEnvironments = new AppServiceEnvironmentsClientImpl(this); - this.appServicePlans = new AppServicePlansClientImpl(this); - this.resourceHealthMetadatas = new ResourceHealthMetadatasClientImpl(this); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AbnormalTimePeriod.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AbnormalTimePeriod.java deleted file mode 100644 index 4107df55cfa5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AbnormalTimePeriod.java +++ /dev/null @@ -1,136 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; - -/** Class representing Abnormal Time Period identified in diagnosis. */ -@Fluent -public final class AbnormalTimePeriod { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AbnormalTimePeriod.class); - - /* - * Start time of the downtime - */ - @JsonProperty(value = "startTime") - private OffsetDateTime startTime; - - /* - * End time of the downtime - */ - @JsonProperty(value = "endTime") - private OffsetDateTime endTime; - - /* - * List of Possible Cause of downtime - */ - @JsonProperty(value = "events") - private List events; - - /* - * List of proposed solutions - */ - @JsonProperty(value = "solutions") - private List solutions; - - /** - * Get the startTime property: Start time of the downtime. - * - * @return the startTime value. - */ - public OffsetDateTime startTime() { - return this.startTime; - } - - /** - * Set the startTime property: Start time of the downtime. - * - * @param startTime the startTime value to set. - * @return the AbnormalTimePeriod object itself. - */ - public AbnormalTimePeriod withStartTime(OffsetDateTime startTime) { - this.startTime = startTime; - return this; - } - - /** - * Get the endTime property: End time of the downtime. - * - * @return the endTime value. - */ - public OffsetDateTime endTime() { - return this.endTime; - } - - /** - * Set the endTime property: End time of the downtime. - * - * @param endTime the endTime value to set. - * @return the AbnormalTimePeriod object itself. - */ - public AbnormalTimePeriod withEndTime(OffsetDateTime endTime) { - this.endTime = endTime; - return this; - } - - /** - * Get the events property: List of Possible Cause of downtime. - * - * @return the events value. - */ - public List events() { - return this.events; - } - - /** - * Set the events property: List of Possible Cause of downtime. - * - * @param events the events value to set. - * @return the AbnormalTimePeriod object itself. - */ - public AbnormalTimePeriod withEvents(List events) { - this.events = events; - return this; - } - - /** - * Get the solutions property: List of proposed solutions. - * - * @return the solutions value. - */ - public List solutions() { - return this.solutions; - } - - /** - * Set the solutions property: List of proposed solutions. - * - * @param solutions the solutions value to set. - * @return the AbnormalTimePeriod object itself. - */ - public AbnormalTimePeriod withSolutions(List solutions) { - this.solutions = solutions; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (events() != null) { - events().forEach(e -> e.validate()); - } - if (solutions() != null) { - solutions().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AccessControlEntryAction.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AccessControlEntryAction.java deleted file mode 100644 index 9fa65c7c1212..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AccessControlEntryAction.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for AccessControlEntryAction. */ -public enum AccessControlEntryAction { - /** Enum value Permit. */ - PERMIT("Permit"), - - /** Enum value Deny. */ - DENY("Deny"); - - /** The actual serialized value for a AccessControlEntryAction instance. */ - private final String value; - - AccessControlEntryAction(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a AccessControlEntryAction instance. - * - * @param value the serialized value to parse. - * @return the parsed AccessControlEntryAction object, or null if unable to parse. - */ - @JsonCreator - public static AccessControlEntryAction fromString(String value) { - AccessControlEntryAction[] items = AccessControlEntryAction.values(); - for (AccessControlEntryAction item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/Address.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/Address.java deleted file mode 100644 index 6e5e435d0660..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/Address.java +++ /dev/null @@ -1,203 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Address information for domain registration. */ -@Fluent -public final class Address { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Address.class); - - /* - * First line of an Address. - */ - @JsonProperty(value = "address1", required = true) - private String address1; - - /* - * The second line of the Address. Optional. - */ - @JsonProperty(value = "address2") - private String address2; - - /* - * The city for the address. - */ - @JsonProperty(value = "city", required = true) - private String city; - - /* - * The country for the address. - */ - @JsonProperty(value = "country", required = true) - private String country; - - /* - * The postal code for the address. - */ - @JsonProperty(value = "postalCode", required = true) - private String postalCode; - - /* - * The state or province for the address. - */ - @JsonProperty(value = "state", required = true) - private String state; - - /** - * Get the address1 property: First line of an Address. - * - * @return the address1 value. - */ - public String address1() { - return this.address1; - } - - /** - * Set the address1 property: First line of an Address. - * - * @param address1 the address1 value to set. - * @return the Address object itself. - */ - public Address withAddress1(String address1) { - this.address1 = address1; - return this; - } - - /** - * Get the address2 property: The second line of the Address. Optional. - * - * @return the address2 value. - */ - public String address2() { - return this.address2; - } - - /** - * Set the address2 property: The second line of the Address. Optional. - * - * @param address2 the address2 value to set. - * @return the Address object itself. - */ - public Address withAddress2(String address2) { - this.address2 = address2; - return this; - } - - /** - * Get the city property: The city for the address. - * - * @return the city value. - */ - public String city() { - return this.city; - } - - /** - * Set the city property: The city for the address. - * - * @param city the city value to set. - * @return the Address object itself. - */ - public Address withCity(String city) { - this.city = city; - return this; - } - - /** - * Get the country property: The country for the address. - * - * @return the country value. - */ - public String country() { - return this.country; - } - - /** - * Set the country property: The country for the address. - * - * @param country the country value to set. - * @return the Address object itself. - */ - public Address withCountry(String country) { - this.country = country; - return this; - } - - /** - * Get the postalCode property: The postal code for the address. - * - * @return the postalCode value. - */ - public String postalCode() { - return this.postalCode; - } - - /** - * Set the postalCode property: The postal code for the address. - * - * @param postalCode the postalCode value to set. - * @return the Address object itself. - */ - public Address withPostalCode(String postalCode) { - this.postalCode = postalCode; - return this; - } - - /** - * Get the state property: The state or province for the address. - * - * @return the state value. - */ - public String state() { - return this.state; - } - - /** - * Set the state property: The state or province for the address. - * - * @param state the state value to set. - * @return the Address object itself. - */ - public Address withState(String state) { - this.state = state; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (address1() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property address1 in model Address")); - } - if (city() == null) { - throw logger - .logExceptionAsError(new IllegalArgumentException("Missing required property city in model Address")); - } - if (country() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property country in model Address")); - } - if (postalCode() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property postalCode in model Address")); - } - if (state() == null) { - throw logger - .logExceptionAsError(new IllegalArgumentException("Missing required property state in model Address")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ApiDefinitionInfo.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ApiDefinitionInfo.java deleted file mode 100644 index a7bfba096105..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ApiDefinitionInfo.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Information about the formal API definition for the app. */ -@Fluent -public final class ApiDefinitionInfo { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiDefinitionInfo.class); - - /* - * The URL of the API definition. - */ - @JsonProperty(value = "url") - private String url; - - /** - * Get the url property: The URL of the API definition. - * - * @return the url value. - */ - public String url() { - return this.url; - } - - /** - * Set the url property: The URL of the API definition. - * - * @param url the url value to set. - * @return the ApiDefinitionInfo object itself. - */ - public ApiDefinitionInfo withUrl(String url) { - this.url = url; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServiceCertificate.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServiceCertificate.java deleted file mode 100644 index 39706dac7413..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServiceCertificate.java +++ /dev/null @@ -1,136 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.appservice.AppServiceManager; -import com.azure.resourcemanager.appservice.fluent.models.CertificateInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.GroupableResource; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; -import java.io.File; -import java.time.OffsetDateTime; -import java.util.List; - -/** An immutable client-side representation of an Azure app service certificate. */ -@Fluent -public interface AppServiceCertificate - extends GroupableResource, Refreshable { - /** @return the friendly name of the certificate */ - String friendlyName(); - - /** @return the subject name of the certificate */ - String subjectName(); - - /** @return the host names the certificate applies to */ - List hostNames(); - - /** @return the pfx blob */ - byte[] pfxBlob(); - - /** @return the app name */ - String siteName(); - - /** @return the self link */ - String selfLink(); - - /** @return the certificate issuer */ - String issuer(); - - /** @return the certificate issue Date */ - OffsetDateTime issueDate(); - - /** @return the certificate expriration date */ - OffsetDateTime expirationDate(); - - /** @return the certificate password */ - String password(); - - /** @return the certificate thumbprint */ - String thumbprint(); - - /** @return if the certificate valid */ - Boolean valid(); - - /** @return the raw bytes of .cer file */ - byte[] certificateBlob(); - - /** @return the public key hash */ - String publicKeyHash(); - - /** @return the specification for the App Service Environment to use for the certificate */ - HostingEnvironmentProfile hostingEnvironmentProfile(); - - /** Container interface for all the definitions that need to be implemented. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithGroup, - DefinitionStages.WithCertificate, - DefinitionStages.WithPfxFilePassword, - DefinitionStages.WithCreate { - } - - /** Grouping of all the site definition stages. */ - interface DefinitionStages { - /** An app service certificate definition allowing region to be set. */ - interface Blank extends GroupableResource.DefinitionWithRegion { - } - - /** An app service certificate definition allowing resource group to be set. */ - interface WithGroup extends GroupableResource.DefinitionStages.WithGroup { - } - - /** An app service certificate definition allowing PFX certificate file to be set. */ - interface WithCertificate { - /** - * Specifies the PFX certificate file to upload. - * - * @param file the PFX certificate file - * @return the next stage of the definition - */ - WithPfxFilePassword withPfxFile(File file); - - /** - * Specifies the PFX byte array to upload. - * - * @param pfxByteArray the PFX byte array - * @return the next stage of the definition - */ - WithPfxFilePassword withPfxByteArray(byte[] pfxByteArray); - - /** - * Specifies the PFX file from a URL. - * - * @param url the URL pointing to the PFX file. - * @return the next stage of the definition - */ - WithPfxFilePassword withPfxFileFromUrl(String url); - - /** - * Specifies the app service certificate. - * - * @param certificateOrder the app service certificate order - * @return the next stage of the definition - */ - WithCreate withExistingCertificateOrder(AppServiceCertificateOrder certificateOrder); - } - /** An app service certificate definition allowing PFX certificate password to be set. */ - interface WithPfxFilePassword { - /** - * Specifies the password to the PFX certificate. - * - * @param password the PFX certificate password - * @return the next stage of the definition - */ - WithCreate withPfxPassword(String password); - } - - /** - * An app service certificate definition with sufficient inputs to create a new app service certificate in the - * cloud, but exposing additional optional inputs to specify. - */ - interface WithCreate extends Creatable { - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServiceCertificateCollection.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServiceCertificateCollection.java deleted file mode 100644 index 98f9a705add9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServiceCertificateCollection.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.models.AppServiceCertificateResourceInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Collection of certificate order certificates. */ -@Fluent -public final class AppServiceCertificateCollection { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AppServiceCertificateCollection.class); - - /* - * Collection of resources. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * Link to next page of resources. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: Collection of resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Collection of resources. - * - * @param value the value value to set. - * @return the AppServiceCertificateCollection object itself. - */ - public AppServiceCertificateCollection withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to next page of resources. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property value in model AppServiceCertificateCollection")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServiceCertificateKeyVaultBinding.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServiceCertificateKeyVaultBinding.java deleted file mode 100644 index 524a87e0d011..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServiceCertificateKeyVaultBinding.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.appservice.AppServiceManager; -import com.azure.resourcemanager.appservice.fluent.models.AppServiceCertificateResourceInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.IndependentChildResource; - -/** An immutable client-side representation of an Azure App Service Key Vault binding. */ -@Fluent -public interface AppServiceCertificateKeyVaultBinding - extends IndependentChildResource { - /** @return the key vault resource Id */ - String keyVaultId(); - - /** @return the key vault secret name */ - String keyVaultSecretName(); - - /** @return the status of the Key Vault secret */ - KeyVaultSecretStatus provisioningState(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServiceCertificateOrder.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServiceCertificateOrder.java deleted file mode 100644 index 0171951bc849..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServiceCertificateOrder.java +++ /dev/null @@ -1,265 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.appservice.AppServiceManager; -import com.azure.resourcemanager.appservice.fluent.models.AppServiceCertificateOrderInner; -import com.azure.resourcemanager.keyvault.models.Vault; -import com.azure.core.management.Region; -import com.azure.resourcemanager.resources.fluentcore.arm.models.GroupableResource; -import com.azure.resourcemanager.resources.fluentcore.model.Appliable; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; -import com.azure.resourcemanager.resources.fluentcore.model.Updatable; -import java.time.OffsetDateTime; -import reactor.core.publisher.Mono; - -/** An immutable client-side representation of an Azure App Service certificate order. */ -@Fluent -public interface AppServiceCertificateOrder - extends GroupableResource, - Refreshable, - Updatable { - - /** @return certificate's distinguished name */ - String distinguishedName(); - - /** @return the domain verification token */ - String domainVerificationToken(); - - /** @return duration in years (must be between 1 and 3) */ - int validityInYears(); - - /** @return the certificate key size */ - int keySize(); - - /** @return the certificate product type */ - CertificateProductType productType(); - - /** @return if the certificate should be automatically renewed upon expiration */ - boolean autoRenew(); - - /** @return current order status */ - CertificateOrderStatus status(); - - /** @return the signed certificate */ - CertificateDetails signedCertificate(); - - /** @return last certificate signing request that was created for this order */ - String certificateSigningRequest(); - - /** @return the intermediate certificate */ - CertificateDetails intermediate(); - - /** @return the root certificate */ - CertificateDetails root(); - - /** @return current serial number of the certificate */ - String serialNumber(); - - /** @return last issuance time */ - OffsetDateTime lastCertificateIssuanceTime(); - - /** @return expiration time */ - OffsetDateTime expirationTime(); - - /** - * Bind a Key Vault secret to a certificate store that will be used for storing the certificate once it's ready. - * - * @param certificateName the name of the Key Vault Secret - * @param vault the key vault to store the certificate - * @return a binding containing the key vault information - */ - AppServiceCertificateKeyVaultBinding createKeyVaultBinding(String certificateName, Vault vault); - - /** - * Bind a Key Vault secret to a certificate store that will be used for storing the certificate once it's ready. - * - * @param certificateName the name of the Key Vault Secret - * @param vault the key vault to store the certificate - * @return a binding containing the key vault information - */ - Mono createKeyVaultBindingAsync(String certificateName, Vault vault); - - /** @return the state of the Key Vault secret */ - AppServiceCertificateKeyVaultBinding getKeyVaultBinding(); - - /** @return the state of the Key Vault secret */ - Mono getKeyVaultBindingAsync(); - - /** - * Verifies the ownership of the domain by providing the Azure purchased domain. - * - * @param domain the Azure managed domain - */ - void verifyDomainOwnership(AppServiceDomain domain); - - /** - * Verifies the ownership of the domain by providing the Azure purchased domain. - * - * @param domain the Azure managed domain - * @return an Observable to the result - */ - Mono verifyDomainOwnershipAsync(AppServiceDomain domain); - - /************************************************************** - * Fluent interfaces to provision a App service certificate order - **************************************************************/ - - /** Container interface for all the definitions that need to be implemented. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithHostName, - DefinitionStages.WithCertificateSku, - DefinitionStages.WithDomainVerificationFromWebApp, - DefinitionStages.WithKeyVault, - DefinitionStages.WithCreate { - } - - /** Grouping of all the app service certificate order definition stages. */ - interface DefinitionStages { - /** An app service certificate order definition allowing resource group to be set. */ - interface Blank extends GroupableResource.DefinitionStages.WithExistingResourceGroup { - } - - /** An app service certificate order definition allowing hostname to be set. */ - interface WithHostName { - /** - * Specifies the hostname the certificate binds to. - * - * @param hostName the bare host name, without "www". Use *. prefix if it's a wild card certificate - * @return the next stage of the definition - */ - WithCertificateSku withHostName(String hostName); - } - - /** An app service certificate order definition allowing SKU to be set. */ - interface WithCertificateSku { - /** - * Specifies the SKU of the certificate to be standard. It will only provide SSL support to the hostname, - * and www.hostname. Wildcard type will provide SSL support to any sub-domain under the hostname. - * - * @return the next stage of the definition - */ - WithDomainVerificationFromWebApp withStandardSku(); - - /** - * Specifies the SKU of the certificate to be wildcard. It will provide SSL support to any sub-domain under - * the hostname. - * - * @return the next stage of the definition - */ - WithDomainVerification withWildcardSku(); - } - - /** An app service certificate order definition allowing domain verification method to be set. */ - interface WithDomainVerification { - /** - * Specifies the Azure managed domain to verify the ownership of the domain. - * - * @param domain the Azure managed domain - * @return the next stage of the definition - */ - WithKeyVault withDomainVerification(AppServiceDomain domain); - } - - /** An app service certificate order definition allowing more domain verification methods to be set. */ - interface WithDomainVerificationFromWebApp extends WithDomainVerification { - /** - * Specifies the web app to verify the ownership of the domain. The web app needs to be bound to the - * hostname for the certificate. - * - * @param webApp the web app bound to the hostname - * @return the next stage of the definition - */ - WithKeyVault withWebAppVerification(WebAppBase webApp); - } - - /** An app service certificate order definition allowing more domain verification methods to be set. */ - interface WithKeyVault { - /** - * Specifies an existing key vault to store the certificate private key. - * - *

The vault MUST allow 2 service principals to read/write secrets: f3c21649-0979-4721-ac85-b0216b2cf413 - * and abfa0a7c-a6b6-4736-8310-5855508787cd. If they don't have access, an attempt will be made to grant - * access. If you are logged in from an identity without access to the Active Directory Graph, this attempt - * will fail. - * - * @param vault the vault to store the private key - * @return the next stage of the definition - */ - WithCreate withExistingKeyVault(Vault vault); - - /** - * Creates a new key vault to store the certificate private key. - * - *

DO NOT use this method if you are logged in from an identity without access to the Active Directory - * Graph. - * - * @param vaultName the name of the new key vault - * @param region the region to create the vault - * @return the next stage of the definition - */ - WithCreate withNewKeyVault(String vaultName, Region region); - } - - /** An app service certificate order definition allowing valid years to be set. */ - interface WithValidYears { - /** - * Specifies the valid years of the certificate. - * - * @param years minimum 1 year, and maximum 3 years - * @return the next stage of the definition - */ - WithCreate withValidYears(int years); - } - - /** An app service certificate order definition allowing auto-renew settings to be set. */ - interface WithAutoRenew { - /** - * Specifies if the certificate should be auto-renewed. - * - * @param enabled true if the certificate order should be auto-renewed - * @return the next stage of the definition - */ - WithCreate withAutoRenew(boolean enabled); - } - - /** - * An app service certificate order definition with sufficient inputs to create a new app service certificate - * order in the cloud, but exposing additional optional inputs to specify. - */ - interface WithCreate - extends Creatable, - WithValidYears, - WithAutoRenew, - GroupableResource.DefinitionWithTags { - } - } - - /** Grouping of all the app service certificate order update stages. */ - interface UpdateStages { - /** An app service certificate order definition allowing auto-renew settings to be set. */ - interface WithAutoRenew { - /** - * Specifies if the certificate should be auto-renewed. - * - * @param enabled true if the certificate order should be auto-renewed - * @return the next stage of the update - */ - Update withAutoRenew(boolean enabled); - } - } - - /** - * The template for an app service certificate order update operation, containing all the settings that can be - * modified. - */ - interface Update - extends Appliable, - UpdateStages.WithAutoRenew, - GroupableResource.UpdateWithTags { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServiceCertificateOrderCollection.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServiceCertificateOrderCollection.java deleted file mode 100644 index d46c3b2a7d79..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServiceCertificateOrderCollection.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.models.AppServiceCertificateOrderInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Collection of certificate orders. */ -@Fluent -public final class AppServiceCertificateOrderCollection { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AppServiceCertificateOrderCollection.class); - - /* - * Collection of resources. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * Link to next page of resources. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: Collection of resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Collection of resources. - * - * @param value the value value to set. - * @return the AppServiceCertificateOrderCollection object itself. - */ - public AppServiceCertificateOrderCollection withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to next page of resources. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property value in model AppServiceCertificateOrderCollection")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServiceCertificateOrderPatchResource.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServiceCertificateOrderPatchResource.java deleted file mode 100644 index 69a43213463c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServiceCertificateOrderPatchResource.java +++ /dev/null @@ -1,333 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.models.AppServiceCertificateInner; -import com.azure.resourcemanager.appservice.fluent.models.AppServiceCertificateOrderPatchResourceProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; -import java.util.Map; - -/** ARM resource for a certificate order that is purchased through Azure. */ -@Fluent -public final class AppServiceCertificateOrderPatchResource extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AppServiceCertificateOrderPatchResource.class); - - /* - * AppServiceCertificateOrderPatchResource resource specific properties - */ - @JsonProperty(value = "properties") - private AppServiceCertificateOrderPatchResourceProperties innerProperties; - - /** - * Get the innerProperties property: AppServiceCertificateOrderPatchResource resource specific properties. - * - * @return the innerProperties value. - */ - private AppServiceCertificateOrderPatchResourceProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public AppServiceCertificateOrderPatchResource withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the certificates property: State of the Key Vault secret. - * - * @return the certificates value. - */ - public Map certificates() { - return this.innerProperties() == null ? null : this.innerProperties().certificates(); - } - - /** - * Set the certificates property: State of the Key Vault secret. - * - * @param certificates the certificates value to set. - * @return the AppServiceCertificateOrderPatchResource object itself. - */ - public AppServiceCertificateOrderPatchResource withCertificates( - Map certificates) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServiceCertificateOrderPatchResourceProperties(); - } - this.innerProperties().withCertificates(certificates); - return this; - } - - /** - * Get the distinguishedName property: Certificate distinguished name. - * - * @return the distinguishedName value. - */ - public String distinguishedName() { - return this.innerProperties() == null ? null : this.innerProperties().distinguishedName(); - } - - /** - * Set the distinguishedName property: Certificate distinguished name. - * - * @param distinguishedName the distinguishedName value to set. - * @return the AppServiceCertificateOrderPatchResource object itself. - */ - public AppServiceCertificateOrderPatchResource withDistinguishedName(String distinguishedName) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServiceCertificateOrderPatchResourceProperties(); - } - this.innerProperties().withDistinguishedName(distinguishedName); - return this; - } - - /** - * Get the domainVerificationToken property: Domain verification token. - * - * @return the domainVerificationToken value. - */ - public String domainVerificationToken() { - return this.innerProperties() == null ? null : this.innerProperties().domainVerificationToken(); - } - - /** - * Get the validityInYears property: Duration in years (must be between 1 and 3). - * - * @return the validityInYears value. - */ - public Integer validityInYears() { - return this.innerProperties() == null ? null : this.innerProperties().validityInYears(); - } - - /** - * Set the validityInYears property: Duration in years (must be between 1 and 3). - * - * @param validityInYears the validityInYears value to set. - * @return the AppServiceCertificateOrderPatchResource object itself. - */ - public AppServiceCertificateOrderPatchResource withValidityInYears(Integer validityInYears) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServiceCertificateOrderPatchResourceProperties(); - } - this.innerProperties().withValidityInYears(validityInYears); - return this; - } - - /** - * Get the keySize property: Certificate key size. - * - * @return the keySize value. - */ - public Integer keySize() { - return this.innerProperties() == null ? null : this.innerProperties().keySize(); - } - - /** - * Set the keySize property: Certificate key size. - * - * @param keySize the keySize value to set. - * @return the AppServiceCertificateOrderPatchResource object itself. - */ - public AppServiceCertificateOrderPatchResource withKeySize(Integer keySize) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServiceCertificateOrderPatchResourceProperties(); - } - this.innerProperties().withKeySize(keySize); - return this; - } - - /** - * Get the productType property: Certificate product type. - * - * @return the productType value. - */ - public CertificateProductType productType() { - return this.innerProperties() == null ? null : this.innerProperties().productType(); - } - - /** - * Set the productType property: Certificate product type. - * - * @param productType the productType value to set. - * @return the AppServiceCertificateOrderPatchResource object itself. - */ - public AppServiceCertificateOrderPatchResource withProductType(CertificateProductType productType) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServiceCertificateOrderPatchResourceProperties(); - } - this.innerProperties().withProductType(productType); - return this; - } - - /** - * Get the autoRenew property: <code>true</code> if the certificate should be automatically renewed when - * it expires; otherwise, <code>false</code>. - * - * @return the autoRenew value. - */ - public Boolean autoRenew() { - return this.innerProperties() == null ? null : this.innerProperties().autoRenew(); - } - - /** - * Set the autoRenew property: <code>true</code> if the certificate should be automatically renewed when - * it expires; otherwise, <code>false</code>. - * - * @param autoRenew the autoRenew value to set. - * @return the AppServiceCertificateOrderPatchResource object itself. - */ - public AppServiceCertificateOrderPatchResource withAutoRenew(Boolean autoRenew) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServiceCertificateOrderPatchResourceProperties(); - } - this.innerProperties().withAutoRenew(autoRenew); - return this; - } - - /** - * Get the provisioningState property: Status of certificate order. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the status property: Current order status. - * - * @return the status value. - */ - public CertificateOrderStatus status() { - return this.innerProperties() == null ? null : this.innerProperties().status(); - } - - /** - * Get the signedCertificate property: Signed certificate. - * - * @return the signedCertificate value. - */ - public CertificateDetails signedCertificate() { - return this.innerProperties() == null ? null : this.innerProperties().signedCertificate(); - } - - /** - * Get the csr property: Last CSR that was created for this order. - * - * @return the csr value. - */ - public String csr() { - return this.innerProperties() == null ? null : this.innerProperties().csr(); - } - - /** - * Set the csr property: Last CSR that was created for this order. - * - * @param csr the csr value to set. - * @return the AppServiceCertificateOrderPatchResource object itself. - */ - public AppServiceCertificateOrderPatchResource withCsr(String csr) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServiceCertificateOrderPatchResourceProperties(); - } - this.innerProperties().withCsr(csr); - return this; - } - - /** - * Get the intermediate property: Intermediate certificate. - * - * @return the intermediate value. - */ - public CertificateDetails intermediate() { - return this.innerProperties() == null ? null : this.innerProperties().intermediate(); - } - - /** - * Get the root property: Root certificate. - * - * @return the root value. - */ - public CertificateDetails root() { - return this.innerProperties() == null ? null : this.innerProperties().root(); - } - - /** - * Get the serialNumber property: Current serial number of the certificate. - * - * @return the serialNumber value. - */ - public String serialNumber() { - return this.innerProperties() == null ? null : this.innerProperties().serialNumber(); - } - - /** - * Get the lastCertificateIssuanceTime property: Certificate last issuance time. - * - * @return the lastCertificateIssuanceTime value. - */ - public OffsetDateTime lastCertificateIssuanceTime() { - return this.innerProperties() == null ? null : this.innerProperties().lastCertificateIssuanceTime(); - } - - /** - * Get the expirationTime property: Certificate expiration time. - * - * @return the expirationTime value. - */ - public OffsetDateTime expirationTime() { - return this.innerProperties() == null ? null : this.innerProperties().expirationTime(); - } - - /** - * Get the isPrivateKeyExternal property: <code>true</code> if private key is external; otherwise, - * <code>false</code>. - * - * @return the isPrivateKeyExternal value. - */ - public Boolean isPrivateKeyExternal() { - return this.innerProperties() == null ? null : this.innerProperties().isPrivateKeyExternal(); - } - - /** - * Get the appServiceCertificateNotRenewableReasons property: Reasons why App Service Certificate is not renewable - * at the current moment. - * - * @return the appServiceCertificateNotRenewableReasons value. - */ - public List - appServiceCertificateNotRenewableReasons() { - return this.innerProperties() == null - ? null - : this.innerProperties().appServiceCertificateNotRenewableReasons(); - } - - /** - * Get the nextAutoRenewalTimestamp property: Time stamp when the certificate would be auto renewed next. - * - * @return the nextAutoRenewalTimestamp value. - */ - public OffsetDateTime nextAutoRenewalTimestamp() { - return this.innerProperties() == null ? null : this.innerProperties().nextAutoRenewalTimestamp(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem.java deleted file mode 100644 index 5482b2d05e56..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem. */ -public final class AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem - extends ExpandableStringEnum< - AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem> { - /** - * Static value RegistrationStatusNotSupportedForRenewal for - * AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem. - */ - public static final AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem - REGISTRATION_STATUS_NOT_SUPPORTED_FOR_RENEWAL = fromString("RegistrationStatusNotSupportedForRenewal"); - - /** - * Static value ExpirationNotInRenewalTimeRange for - * AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem. - */ - public static final AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem - EXPIRATION_NOT_IN_RENEWAL_TIME_RANGE = fromString("ExpirationNotInRenewalTimeRange"); - - /** - * Static value SubscriptionNotActive for - * AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem. - */ - public static final AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem - SUBSCRIPTION_NOT_ACTIVE = fromString("SubscriptionNotActive"); - - /** - * Creates or finds a AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem - * from its string representation. - * - * @param name a name to look for. - * @return the corresponding - * AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem. - */ - @JsonCreator - public static AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem - fromString(String name) { - return fromString( - name, AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem.class); - } - - /** - * @return known AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem - * values. - */ - public static Collection< - AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem> - values() { - return values( - AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem.java deleted file mode 100644 index e140f2ee7634..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem. */ -public final class AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem - extends ExpandableStringEnum { - /** - * Static value RegistrationStatusNotSupportedForRenewal for - * AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem. - */ - public static final AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem - REGISTRATION_STATUS_NOT_SUPPORTED_FOR_RENEWAL = fromString("RegistrationStatusNotSupportedForRenewal"); - - /** - * Static value ExpirationNotInRenewalTimeRange for - * AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem. - */ - public static final AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem - EXPIRATION_NOT_IN_RENEWAL_TIME_RANGE = fromString("ExpirationNotInRenewalTimeRange"); - - /** - * Static value SubscriptionNotActive for - * AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem. - */ - public static final AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem - SUBSCRIPTION_NOT_ACTIVE = fromString("SubscriptionNotActive"); - - /** - * Creates or finds a AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem from its - * string representation. - * - * @param name a name to look for. - * @return the corresponding AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem. - */ - @JsonCreator - public static AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem fromString( - String name) { - return fromString(name, AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem.class); - } - - /** @return known AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem values. */ - public static Collection - values() { - return values(AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServiceCertificateOrders.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServiceCertificateOrders.java deleted file mode 100644 index 01ca46aec9c5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServiceCertificateOrders.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.appservice.AppServiceManager; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsDeletingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsListingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsCreating; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingById; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; - -/** Entry point for app service certificate order management API. */ -@Fluent -public interface AppServiceCertificateOrders - extends SupportsCreating, - SupportsDeletingById, - SupportsListingByResourceGroup, - SupportsGettingByResourceGroup, - SupportsListing, - SupportsGettingById, - SupportsDeletingByResourceGroup, - HasManager { -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServiceCertificates.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServiceCertificates.java deleted file mode 100644 index 487acbd33ea8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServiceCertificates.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.appservice.AppServiceManager; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsDeletingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsListingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsCreating; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingById; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; - -/** Entry point for certificate management API. */ -@Fluent -public interface AppServiceCertificates - extends SupportsCreating, - SupportsDeletingById, - SupportsListingByResourceGroup, - SupportsListing, - SupportsGettingByResourceGroup, - SupportsGettingById, - SupportsDeletingByResourceGroup, - HasManager { -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServiceDomain.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServiceDomain.java deleted file mode 100644 index 20abfba4509c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServiceDomain.java +++ /dev/null @@ -1,360 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.appservice.AppServiceManager; -import com.azure.resourcemanager.appservice.fluent.models.DomainInner; -import com.azure.resourcemanager.dns.models.DnsZone; -import com.azure.resourcemanager.resources.fluentcore.arm.models.GroupableResource; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasName; -import com.azure.resourcemanager.resources.fluentcore.model.Appliable; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; -import com.azure.resourcemanager.resources.fluentcore.model.Updatable; -import java.time.OffsetDateTime; -import java.util.List; -import java.util.Map; -import reactor.core.publisher.Mono; - -/** - * An immutable client-side representation of a domain. - * - *

Domains in Azure are purchased from 3rd party domain providers. By calling {@link Creatable#create()} or {@link - * Creatable#createAsync()} you agree to the agreements listed in {@link AppServiceDomains#listAgreements(String)}. - */ -@Fluent -public interface AppServiceDomain - extends GroupableResource, - HasName, - Refreshable, - Updatable { - - /** @return admin contact information */ - Contact adminContact(); - - /** @return billing contact information */ - Contact billingContact(); - - /** @return registrant contact information */ - Contact registrantContact(); - - /** @return technical contact information */ - Contact techContact(); - - /** @return domain registration status */ - DomainStatus registrationStatus(); - - /** @return name servers */ - List nameServers(); - - /** @return true if domain privacy is enabled for this domain */ - boolean privacy(); - - /** @return domain creation timestamp. */ - OffsetDateTime createdTime(); - - /** @return domain expiration timestamp. */ - OffsetDateTime expirationTime(); - - /** @return timestamp when the domain was renewed last time */ - OffsetDateTime lastRenewedTime(); - - /** @return true if domain will renewed automatically */ - boolean autoRenew(); - - /** - * @return true if Azure can assign this domain to Web Apps. This value will be true if domain registration status - * is active and it is hosted on name servers Azure has programmatic access to. - */ - boolean readyForDnsRecordManagement(); - - /** @return all hostnames derived from the domain and assigned to Azure resources */ - Map managedHostNames(); - - /** @return legal agreement consent. */ - DomainPurchaseConsent consent(); - - /** - * @return the type of DNS - */ - DnsType dnsType(); - - /** - * @return Azure DNS zone id - */ - String dnsZoneId(); - - /** - * Verifies the ownership of the domain for a certificate order bound to this domain. - * - * @param certificateOrderName the name of the certificate order - * @param domainVerificationToken the domain verification token for the certificate order - */ - void verifyDomainOwnership(String certificateOrderName, String domainVerificationToken); - - /** - * Verifies the ownership of the domain for a certificate order bound to this domain. - * - * @param certificateOrderName the name of the certificate order - * @param domainVerificationToken the domain verification token for the certificate order - * @return a representation of the deferred computation of this call - */ - Mono verifyDomainOwnershipAsync(String certificateOrderName, String domainVerificationToken); - - /************************************************************** - * Fluent interfaces to provision a domain - **************************************************************/ - - /** Container interface for all the definitions that need to be implemented. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithAdminContact, - DefinitionStages.WithBillingContact, - DefinitionStages.WithRegistrantContact, - DefinitionStages.WithTechContact, - DefinitionStages.WithCreate { - } - - /** Grouping of all the domain definition stages. */ - interface DefinitionStages { - /** The first stage of the domain definition. */ - interface Blank extends GroupableResource.DefinitionStages.WithExistingResourceGroup { - } - - /** A domain definition allowing admin contact to be set. */ - interface WithAdminContact { - /** - * Specify the admin contact. - * - * @param contact the admin contact - * @return the next stage of domain definition - */ - WithCreate withAdminContact(Contact contact); - } - - /** A domain definition allowing billing contact to be set. */ - interface WithBillingContact { - /** - * Specify the billing contact. - * - * @param contact the billing contact - * @return the next stage of domain definition - */ - WithCreate withBillingContact(Contact contact); - } - - /** A domain definition allowing registrant contact to be set. */ - interface WithRegistrantContact { - /** - * Specify the registrant contact. By default, this is also the contact for admin, billing, and tech. - * - * @param contact the registrant contact - * @return the next stage of domain definition - */ - WithCreate withRegistrantContact(Contact contact); - - /** - * Starts the definition of a new domain contact. - * - * @return the first stage of the domain contact definition - */ - DomainContact.DefinitionStages.Blank defineRegistrantContact(); - } - - /** A domain definition allowing tech contact to be set. */ - interface WithTechContact { - /** - * Specify the tech contact. - * - * @param contact the tech contact - * @return the next stage of domain definition. - */ - WithCreate withTechContact(Contact contact); - } - - /** A domain definition allowing domain privacy to be set. */ - interface WithDomainPrivacy { - /** - * Specifies if the registrant contact information is exposed publicly. If domain privacy is turned on, the - * contact information will NOT be available publicly. - * - * @param domainPrivacy true if domain privacy is turned on - * @return the next stage of domain definition - */ - WithCreate withDomainPrivacyEnabled(boolean domainPrivacy); - } - - /** A domain definition allowing auto-renew setting to be set. */ - interface WithAutoRenew { - /** - * Specifies if the domain should be automatically renewed when it's about to expire. - * - * @param autoRenew true if the domain should be automatically renewed - * @return the next stage of domain definition - */ - WithCreate withAutoRenewEnabled(boolean autoRenew); - } - - /** - * A domain definition allowing DNS zone to be set. - */ - interface WithDnsZone { - /** - * Creates a new DNS zone. - * - * @param dnsZoneName the name of DNS zone - * @return the next stage of domain definition - */ - WithCreate withNewDnsZone(String dnsZoneName); - - /** - * Creates a new DNS zone. - * - * @param dnsZone the creatable definition of DNS zone - * @return the next stage of domain definition - */ - WithCreate withNewDnsZone(Creatable dnsZone); - - /** - * Specifies an existing DNS zone. - * - * @param dnsZoneId the id of DNS zone - * @return the next stage of domain definition - */ - WithCreate withExistingDnsZone(String dnsZoneId); - - /** - * Specifies an existing DNS zone. - * - * @param dnsZone the DNS zone - * @return the next stage of domain definition - */ - WithCreate withExistingDnsZone(DnsZone dnsZone); - } - - /** - * A domain definition with sufficient inputs to create a new domain in the cloud, but exposing additional - * optional inputs to specify. - */ - interface WithCreate - extends WithDomainPrivacy, - WithAutoRenew, - WithAdminContact, - WithBillingContact, - WithTechContact, - WithDnsZone, - Creatable, - DefinitionWithTags { - } - } - - /** Grouping of all the domain update stages. */ - interface UpdateStages { - /** A domain definition allowing admin contact to be set. */ - interface WithAdminContact { - /** - * Specify the admin contact. - * - * @param contact the admin contact - * @return the next stage of domain definition - */ - Update withAdminContact(Contact contact); - } - - /** A domain definition allowing billing contact to be set. */ - interface WithBillingContact { - /** - * Specify the billing contact. - * - * @param contact the billing contact - * @return the next stage of domain definition - */ - Update withBillingContact(Contact contact); - } - - /** A domain definition allowing tech contact to be set. */ - interface WithTechContact { - /** - * Specify the tech contact. - * - * @param contact the tech contact - * @return the next stage of domain definition. - */ - Update withTechContact(Contact contact); - } - - /** A domain definition allowing domain privacy to be set. */ - interface WithDomainPrivacy { - /** - * Specifies if the registrant contact information is exposed publicly. If domain privacy is turned on, the - * contact information will NOT be available publicly. - * - * @param domainPrivacy true if domain privacy is turned on - * @return the next stage of domain definition - */ - Update withDomainPrivacyEnabled(boolean domainPrivacy); - } - - /** A domain definition allowing auto-renew setting to be set. */ - interface WithAutoRenew { - /** - * Specifies if the domain should be automatically renewed when it's about to expire. - * - * @param autoRenew true if the domain should be automatically renewed - * @return the next stage of domain definition - */ - Update withAutoRenewEnabled(boolean autoRenew); - } - - /** - * A domain definition allowing DNS zone to be set. - */ - interface WithDnsZone { - /** - * Creates a new DNS zone. - * - * @param dnsZoneName the name of DNS zone - * @return the next stage of domain definition - */ - Update withNewDnsZone(String dnsZoneName); - - /** - * Creates a new DNS zone. - * - * @param dnsZone the creatable definition of DNS zone - * @return the next stage of domain definition - */ - Update withNewDnsZone(Creatable dnsZone); - - /** - * Specifies an existing DNS zone. - * - * @param dnsZoneId the id of DNS zone - * @return the next stage of domain definition - */ - Update withExistingDnsZone(String dnsZoneId); - - /** - * Specifies an existing DNS zone. - * - * @param dnsZone the DNS zone - * @return the next stage of domain definition - */ - Update withExistingDnsZone(DnsZone dnsZone); - } - } - - /** The template for a domain update operation, containing all the settings that can be modified. */ - interface Update - extends Appliable, - UpdateStages.WithAdminContact, - UpdateStages.WithBillingContact, - UpdateStages.WithTechContact, - UpdateStages.WithAutoRenew, - UpdateStages.WithDomainPrivacy, - UpdateStages.WithDnsZone, - GroupableResource.UpdateWithTags { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServiceDomains.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServiceDomains.java deleted file mode 100644 index 8581a84b8358..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServiceDomains.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.appservice.AppServiceManager; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsDeletingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsListingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsCreating; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingById; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; - -/** Entry point for domain management API. */ -@Fluent -public interface AppServiceDomains - extends SupportsCreating, - SupportsListing, - SupportsListingByResourceGroup, - SupportsDeletingById, - SupportsDeletingByResourceGroup, - SupportsGettingByResourceGroup, - SupportsGettingById, - HasManager { - /** - * List the agreements for purchasing a domain with a specific top level extension. - * - * @param topLevelExtension the top level extension of the domain, e.g., "com", "net", "org" - * @return the list of agreements required for the purchase - */ - PagedIterable listAgreements(String topLevelExtension); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServiceEnvironmentCollection.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServiceEnvironmentCollection.java deleted file mode 100644 index e6c5ea5de367..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServiceEnvironmentCollection.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.models.AppServiceEnvironmentResourceInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Collection of App Service Environments. */ -@Fluent -public final class AppServiceEnvironmentCollection { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AppServiceEnvironmentCollection.class); - - /* - * Collection of resources. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * Link to next page of resources. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: Collection of resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Collection of resources. - * - * @param value the value value to set. - * @return the AppServiceEnvironmentCollection object itself. - */ - public AppServiceEnvironmentCollection withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to next page of resources. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property value in model AppServiceEnvironmentCollection")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServiceEnvironmentPatchResource.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServiceEnvironmentPatchResource.java deleted file mode 100644 index ada4d730b372..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServiceEnvironmentPatchResource.java +++ /dev/null @@ -1,737 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.models.AppServiceEnvironment; -import com.azure.resourcemanager.appservice.fluent.models.StampCapacityInner; -import com.azure.resourcemanager.appservice.fluent.models.WorkerPool; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** ARM resource for a app service environment. */ -@Fluent -public final class AppServiceEnvironmentPatchResource extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AppServiceEnvironmentPatchResource.class); - - /* - * Core resource properties - */ - @JsonProperty(value = "properties") - private AppServiceEnvironment innerProperties; - - /** - * Get the innerProperties property: Core resource properties. - * - * @return the innerProperties value. - */ - private AppServiceEnvironment innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public AppServiceEnvironmentPatchResource withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the name property: Name of the App Service Environment. - * - * @return the name value. - */ - public String namePropertiesName() { - return this.innerProperties() == null ? null : this.innerProperties().name(); - } - - /** - * Set the name property: Name of the App Service Environment. - * - * @param name the name value to set. - * @return the AppServiceEnvironmentPatchResource object itself. - */ - public AppServiceEnvironmentPatchResource withNamePropertiesName(String name) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServiceEnvironment(); - } - this.innerProperties().withName(name); - return this; - } - - /** - * Get the location property: Location of the App Service Environment, e.g. "West US". - * - * @return the location value. - */ - public String location() { - return this.innerProperties() == null ? null : this.innerProperties().location(); - } - - /** - * Set the location property: Location of the App Service Environment, e.g. "West US". - * - * @param location the location value to set. - * @return the AppServiceEnvironmentPatchResource object itself. - */ - public AppServiceEnvironmentPatchResource withLocation(String location) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServiceEnvironment(); - } - this.innerProperties().withLocation(location); - return this; - } - - /** - * Get the provisioningState property: Provisioning state of the App Service Environment. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the status property: Current status of the App Service Environment. - * - * @return the status value. - */ - public HostingEnvironmentStatus status() { - return this.innerProperties() == null ? null : this.innerProperties().status(); - } - - /** - * Get the vnetName property: Name of the Virtual Network for the App Service Environment. - * - * @return the vnetName value. - */ - public String vnetName() { - return this.innerProperties() == null ? null : this.innerProperties().vnetName(); - } - - /** - * Set the vnetName property: Name of the Virtual Network for the App Service Environment. - * - * @param vnetName the vnetName value to set. - * @return the AppServiceEnvironmentPatchResource object itself. - */ - public AppServiceEnvironmentPatchResource withVnetName(String vnetName) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServiceEnvironment(); - } - this.innerProperties().withVnetName(vnetName); - return this; - } - - /** - * Get the vnetResourceGroupName property: Resource group of the Virtual Network. - * - * @return the vnetResourceGroupName value. - */ - public String vnetResourceGroupName() { - return this.innerProperties() == null ? null : this.innerProperties().vnetResourceGroupName(); - } - - /** - * Set the vnetResourceGroupName property: Resource group of the Virtual Network. - * - * @param vnetResourceGroupName the vnetResourceGroupName value to set. - * @return the AppServiceEnvironmentPatchResource object itself. - */ - public AppServiceEnvironmentPatchResource withVnetResourceGroupName(String vnetResourceGroupName) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServiceEnvironment(); - } - this.innerProperties().withVnetResourceGroupName(vnetResourceGroupName); - return this; - } - - /** - * Get the vnetSubnetName property: Subnet of the Virtual Network. - * - * @return the vnetSubnetName value. - */ - public String vnetSubnetName() { - return this.innerProperties() == null ? null : this.innerProperties().vnetSubnetName(); - } - - /** - * Set the vnetSubnetName property: Subnet of the Virtual Network. - * - * @param vnetSubnetName the vnetSubnetName value to set. - * @return the AppServiceEnvironmentPatchResource object itself. - */ - public AppServiceEnvironmentPatchResource withVnetSubnetName(String vnetSubnetName) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServiceEnvironment(); - } - this.innerProperties().withVnetSubnetName(vnetSubnetName); - return this; - } - - /** - * Get the virtualNetwork property: Description of the Virtual Network. - * - * @return the virtualNetwork value. - */ - public VirtualNetworkProfile virtualNetwork() { - return this.innerProperties() == null ? null : this.innerProperties().virtualNetwork(); - } - - /** - * Set the virtualNetwork property: Description of the Virtual Network. - * - * @param virtualNetwork the virtualNetwork value to set. - * @return the AppServiceEnvironmentPatchResource object itself. - */ - public AppServiceEnvironmentPatchResource withVirtualNetwork(VirtualNetworkProfile virtualNetwork) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServiceEnvironment(); - } - this.innerProperties().withVirtualNetwork(virtualNetwork); - return this; - } - - /** - * Get the internalLoadBalancingMode property: Specifies which endpoints to serve internally in the Virtual Network - * for the App Service Environment. - * - * @return the internalLoadBalancingMode value. - */ - public InternalLoadBalancingMode internalLoadBalancingMode() { - return this.innerProperties() == null ? null : this.innerProperties().internalLoadBalancingMode(); - } - - /** - * Set the internalLoadBalancingMode property: Specifies which endpoints to serve internally in the Virtual Network - * for the App Service Environment. - * - * @param internalLoadBalancingMode the internalLoadBalancingMode value to set. - * @return the AppServiceEnvironmentPatchResource object itself. - */ - public AppServiceEnvironmentPatchResource withInternalLoadBalancingMode( - InternalLoadBalancingMode internalLoadBalancingMode) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServiceEnvironment(); - } - this.innerProperties().withInternalLoadBalancingMode(internalLoadBalancingMode); - return this; - } - - /** - * Get the multiSize property: Front-end VM size, e.g. "Medium", "Large". - * - * @return the multiSize value. - */ - public String multiSize() { - return this.innerProperties() == null ? null : this.innerProperties().multiSize(); - } - - /** - * Set the multiSize property: Front-end VM size, e.g. "Medium", "Large". - * - * @param multiSize the multiSize value to set. - * @return the AppServiceEnvironmentPatchResource object itself. - */ - public AppServiceEnvironmentPatchResource withMultiSize(String multiSize) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServiceEnvironment(); - } - this.innerProperties().withMultiSize(multiSize); - return this; - } - - /** - * Get the multiRoleCount property: Number of front-end instances. - * - * @return the multiRoleCount value. - */ - public Integer multiRoleCount() { - return this.innerProperties() == null ? null : this.innerProperties().multiRoleCount(); - } - - /** - * Set the multiRoleCount property: Number of front-end instances. - * - * @param multiRoleCount the multiRoleCount value to set. - * @return the AppServiceEnvironmentPatchResource object itself. - */ - public AppServiceEnvironmentPatchResource withMultiRoleCount(Integer multiRoleCount) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServiceEnvironment(); - } - this.innerProperties().withMultiRoleCount(multiRoleCount); - return this; - } - - /** - * Get the workerPools property: Description of worker pools with worker size IDs, VM sizes, and number of workers - * in each pool. - * - * @return the workerPools value. - */ - public List workerPools() { - return this.innerProperties() == null ? null : this.innerProperties().workerPools(); - } - - /** - * Set the workerPools property: Description of worker pools with worker size IDs, VM sizes, and number of workers - * in each pool. - * - * @param workerPools the workerPools value to set. - * @return the AppServiceEnvironmentPatchResource object itself. - */ - public AppServiceEnvironmentPatchResource withWorkerPools(List workerPools) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServiceEnvironment(); - } - this.innerProperties().withWorkerPools(workerPools); - return this; - } - - /** - * Get the ipsslAddressCount property: Number of IP SSL addresses reserved for the App Service Environment. - * - * @return the ipsslAddressCount value. - */ - public Integer ipsslAddressCount() { - return this.innerProperties() == null ? null : this.innerProperties().ipsslAddressCount(); - } - - /** - * Set the ipsslAddressCount property: Number of IP SSL addresses reserved for the App Service Environment. - * - * @param ipsslAddressCount the ipsslAddressCount value to set. - * @return the AppServiceEnvironmentPatchResource object itself. - */ - public AppServiceEnvironmentPatchResource withIpsslAddressCount(Integer ipsslAddressCount) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServiceEnvironment(); - } - this.innerProperties().withIpsslAddressCount(ipsslAddressCount); - return this; - } - - /** - * Get the databaseEdition property: Edition of the metadata database for the App Service Environment, e.g. - * "Standard". - * - * @return the databaseEdition value. - */ - public String databaseEdition() { - return this.innerProperties() == null ? null : this.innerProperties().databaseEdition(); - } - - /** - * Get the databaseServiceObjective property: Service objective of the metadata database for the App Service - * Environment, e.g. "S0". - * - * @return the databaseServiceObjective value. - */ - public String databaseServiceObjective() { - return this.innerProperties() == null ? null : this.innerProperties().databaseServiceObjective(); - } - - /** - * Get the upgradeDomains property: Number of upgrade domains of the App Service Environment. - * - * @return the upgradeDomains value. - */ - public Integer upgradeDomains() { - return this.innerProperties() == null ? null : this.innerProperties().upgradeDomains(); - } - - /** - * Get the subscriptionId property: Subscription of the App Service Environment. - * - * @return the subscriptionId value. - */ - public String subscriptionId() { - return this.innerProperties() == null ? null : this.innerProperties().subscriptionId(); - } - - /** - * Get the dnsSuffix property: DNS suffix of the App Service Environment. - * - * @return the dnsSuffix value. - */ - public String dnsSuffix() { - return this.innerProperties() == null ? null : this.innerProperties().dnsSuffix(); - } - - /** - * Set the dnsSuffix property: DNS suffix of the App Service Environment. - * - * @param dnsSuffix the dnsSuffix value to set. - * @return the AppServiceEnvironmentPatchResource object itself. - */ - public AppServiceEnvironmentPatchResource withDnsSuffix(String dnsSuffix) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServiceEnvironment(); - } - this.innerProperties().withDnsSuffix(dnsSuffix); - return this; - } - - /** - * Get the lastAction property: Last deployment action on the App Service Environment. - * - * @return the lastAction value. - */ - public String lastAction() { - return this.innerProperties() == null ? null : this.innerProperties().lastAction(); - } - - /** - * Get the lastActionResult property: Result of the last deployment action on the App Service Environment. - * - * @return the lastActionResult value. - */ - public String lastActionResult() { - return this.innerProperties() == null ? null : this.innerProperties().lastActionResult(); - } - - /** - * Get the allowedMultiSizes property: List of comma separated strings describing which VM sizes are allowed for - * front-ends. - * - * @return the allowedMultiSizes value. - */ - public String allowedMultiSizes() { - return this.innerProperties() == null ? null : this.innerProperties().allowedMultiSizes(); - } - - /** - * Get the allowedWorkerSizes property: List of comma separated strings describing which VM sizes are allowed for - * workers. - * - * @return the allowedWorkerSizes value. - */ - public String allowedWorkerSizes() { - return this.innerProperties() == null ? null : this.innerProperties().allowedWorkerSizes(); - } - - /** - * Get the maximumNumberOfMachines property: Maximum number of VMs in the App Service Environment. - * - * @return the maximumNumberOfMachines value. - */ - public Integer maximumNumberOfMachines() { - return this.innerProperties() == null ? null : this.innerProperties().maximumNumberOfMachines(); - } - - /** - * Get the vipMappings property: Description of IP SSL mapping for the App Service Environment. - * - * @return the vipMappings value. - */ - public List vipMappings() { - return this.innerProperties() == null ? null : this.innerProperties().vipMappings(); - } - - /** - * Get the environmentCapacities property: Current total, used, and available worker capacities. - * - * @return the environmentCapacities value. - */ - public List environmentCapacities() { - return this.innerProperties() == null ? null : this.innerProperties().environmentCapacities(); - } - - /** - * Get the networkAccessControlList property: Access control list for controlling traffic to the App Service - * Environment. - * - * @return the networkAccessControlList value. - */ - public List networkAccessControlList() { - return this.innerProperties() == null ? null : this.innerProperties().networkAccessControlList(); - } - - /** - * Set the networkAccessControlList property: Access control list for controlling traffic to the App Service - * Environment. - * - * @param networkAccessControlList the networkAccessControlList value to set. - * @return the AppServiceEnvironmentPatchResource object itself. - */ - public AppServiceEnvironmentPatchResource withNetworkAccessControlList( - List networkAccessControlList) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServiceEnvironment(); - } - this.innerProperties().withNetworkAccessControlList(networkAccessControlList); - return this; - } - - /** - * Get the environmentIsHealthy property: True/false indicating whether the App Service Environment is healthy. - * - * @return the environmentIsHealthy value. - */ - public Boolean environmentIsHealthy() { - return this.innerProperties() == null ? null : this.innerProperties().environmentIsHealthy(); - } - - /** - * Get the environmentStatus property: Detailed message about with results of the last check of the App Service - * Environment. - * - * @return the environmentStatus value. - */ - public String environmentStatus() { - return this.innerProperties() == null ? null : this.innerProperties().environmentStatus(); - } - - /** - * Get the resourceGroup property: Resource group of the App Service Environment. - * - * @return the resourceGroup value. - */ - public String resourceGroup() { - return this.innerProperties() == null ? null : this.innerProperties().resourceGroup(); - } - - /** - * Get the frontEndScaleFactor property: Scale factor for front-ends. - * - * @return the frontEndScaleFactor value. - */ - public Integer frontEndScaleFactor() { - return this.innerProperties() == null ? null : this.innerProperties().frontEndScaleFactor(); - } - - /** - * Set the frontEndScaleFactor property: Scale factor for front-ends. - * - * @param frontEndScaleFactor the frontEndScaleFactor value to set. - * @return the AppServiceEnvironmentPatchResource object itself. - */ - public AppServiceEnvironmentPatchResource withFrontEndScaleFactor(Integer frontEndScaleFactor) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServiceEnvironment(); - } - this.innerProperties().withFrontEndScaleFactor(frontEndScaleFactor); - return this; - } - - /** - * Get the defaultFrontEndScaleFactor property: Default Scale Factor for FrontEnds. - * - * @return the defaultFrontEndScaleFactor value. - */ - public Integer defaultFrontEndScaleFactor() { - return this.innerProperties() == null ? null : this.innerProperties().defaultFrontEndScaleFactor(); - } - - /** - * Get the apiManagementAccountId property: API Management Account associated with the App Service Environment. - * - * @return the apiManagementAccountId value. - */ - public String apiManagementAccountId() { - return this.innerProperties() == null ? null : this.innerProperties().apiManagementAccountId(); - } - - /** - * Set the apiManagementAccountId property: API Management Account associated with the App Service Environment. - * - * @param apiManagementAccountId the apiManagementAccountId value to set. - * @return the AppServiceEnvironmentPatchResource object itself. - */ - public AppServiceEnvironmentPatchResource withApiManagementAccountId(String apiManagementAccountId) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServiceEnvironment(); - } - this.innerProperties().withApiManagementAccountId(apiManagementAccountId); - return this; - } - - /** - * Get the suspended property: <code>true</code> if the App Service Environment is suspended; otherwise, - * <code>false</code>. The environment can be suspended, e.g. when the management endpoint is no longer - * available (most likely because NSG blocked the incoming traffic). - * - * @return the suspended value. - */ - public Boolean suspended() { - return this.innerProperties() == null ? null : this.innerProperties().suspended(); - } - - /** - * Set the suspended property: <code>true</code> if the App Service Environment is suspended; otherwise, - * <code>false</code>. The environment can be suspended, e.g. when the management endpoint is no longer - * available (most likely because NSG blocked the incoming traffic). - * - * @param suspended the suspended value to set. - * @return the AppServiceEnvironmentPatchResource object itself. - */ - public AppServiceEnvironmentPatchResource withSuspended(Boolean suspended) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServiceEnvironment(); - } - this.innerProperties().withSuspended(suspended); - return this; - } - - /** - * Get the dynamicCacheEnabled property: True/false indicating whether the App Service Environment is suspended. The - * environment can be suspended e.g. when the management endpoint is no longer available (most likely because NSG - * blocked the incoming traffic). - * - * @return the dynamicCacheEnabled value. - */ - public Boolean dynamicCacheEnabled() { - return this.innerProperties() == null ? null : this.innerProperties().dynamicCacheEnabled(); - } - - /** - * Set the dynamicCacheEnabled property: True/false indicating whether the App Service Environment is suspended. The - * environment can be suspended e.g. when the management endpoint is no longer available (most likely because NSG - * blocked the incoming traffic). - * - * @param dynamicCacheEnabled the dynamicCacheEnabled value to set. - * @return the AppServiceEnvironmentPatchResource object itself. - */ - public AppServiceEnvironmentPatchResource withDynamicCacheEnabled(Boolean dynamicCacheEnabled) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServiceEnvironment(); - } - this.innerProperties().withDynamicCacheEnabled(dynamicCacheEnabled); - return this; - } - - /** - * Get the clusterSettings property: Custom settings for changing the behavior of the App Service Environment. - * - * @return the clusterSettings value. - */ - public List clusterSettings() { - return this.innerProperties() == null ? null : this.innerProperties().clusterSettings(); - } - - /** - * Set the clusterSettings property: Custom settings for changing the behavior of the App Service Environment. - * - * @param clusterSettings the clusterSettings value to set. - * @return the AppServiceEnvironmentPatchResource object itself. - */ - public AppServiceEnvironmentPatchResource withClusterSettings(List clusterSettings) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServiceEnvironment(); - } - this.innerProperties().withClusterSettings(clusterSettings); - return this; - } - - /** - * Get the userWhitelistedIpRanges property: User added ip ranges to whitelist on ASE db. - * - * @return the userWhitelistedIpRanges value. - */ - public List userWhitelistedIpRanges() { - return this.innerProperties() == null ? null : this.innerProperties().userWhitelistedIpRanges(); - } - - /** - * Set the userWhitelistedIpRanges property: User added ip ranges to whitelist on ASE db. - * - * @param userWhitelistedIpRanges the userWhitelistedIpRanges value to set. - * @return the AppServiceEnvironmentPatchResource object itself. - */ - public AppServiceEnvironmentPatchResource withUserWhitelistedIpRanges(List userWhitelistedIpRanges) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServiceEnvironment(); - } - this.innerProperties().withUserWhitelistedIpRanges(userWhitelistedIpRanges); - return this; - } - - /** - * Get the hasLinuxWorkers property: Flag that displays whether an ASE has linux workers or not. - * - * @return the hasLinuxWorkers value. - */ - public Boolean hasLinuxWorkers() { - return this.innerProperties() == null ? null : this.innerProperties().hasLinuxWorkers(); - } - - /** - * Set the hasLinuxWorkers property: Flag that displays whether an ASE has linux workers or not. - * - * @param hasLinuxWorkers the hasLinuxWorkers value to set. - * @return the AppServiceEnvironmentPatchResource object itself. - */ - public AppServiceEnvironmentPatchResource withHasLinuxWorkers(Boolean hasLinuxWorkers) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServiceEnvironment(); - } - this.innerProperties().withHasLinuxWorkers(hasLinuxWorkers); - return this; - } - - /** - * Get the sslCertKeyVaultId property: Key Vault ID for ILB App Service Environment default SSL certificate. - * - * @return the sslCertKeyVaultId value. - */ - public String sslCertKeyVaultId() { - return this.innerProperties() == null ? null : this.innerProperties().sslCertKeyVaultId(); - } - - /** - * Set the sslCertKeyVaultId property: Key Vault ID for ILB App Service Environment default SSL certificate. - * - * @param sslCertKeyVaultId the sslCertKeyVaultId value to set. - * @return the AppServiceEnvironmentPatchResource object itself. - */ - public AppServiceEnvironmentPatchResource withSslCertKeyVaultId(String sslCertKeyVaultId) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServiceEnvironment(); - } - this.innerProperties().withSslCertKeyVaultId(sslCertKeyVaultId); - return this; - } - - /** - * Get the sslCertKeyVaultSecretName property: Key Vault Secret Name for ILB App Service Environment default SSL - * certificate. - * - * @return the sslCertKeyVaultSecretName value. - */ - public String sslCertKeyVaultSecretName() { - return this.innerProperties() == null ? null : this.innerProperties().sslCertKeyVaultSecretName(); - } - - /** - * Set the sslCertKeyVaultSecretName property: Key Vault Secret Name for ILB App Service Environment default SSL - * certificate. - * - * @param sslCertKeyVaultSecretName the sslCertKeyVaultSecretName value to set. - * @return the AppServiceEnvironmentPatchResource object itself. - */ - public AppServiceEnvironmentPatchResource withSslCertKeyVaultSecretName(String sslCertKeyVaultSecretName) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServiceEnvironment(); - } - this.innerProperties().withSslCertKeyVaultSecretName(sslCertKeyVaultSecretName); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServicePlan.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServicePlan.java deleted file mode 100644 index 88b1ef90b222..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServicePlan.java +++ /dev/null @@ -1,178 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.appservice.AppServiceManager; -import com.azure.resourcemanager.appservice.fluent.models.AppServicePlanInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.GroupableResource; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasName; -import com.azure.resourcemanager.resources.fluentcore.model.Appliable; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; -import com.azure.resourcemanager.resources.fluentcore.model.Updatable; - -/** An immutable client-side representation of an Azure App service plan. */ -@Fluent -public interface AppServicePlan - extends GroupableResource, - HasName, - Refreshable, - Updatable { - /** @return maximum number of instances that can be assigned */ - int maxInstances(); - - /** @return maximum number of instances that can be assigned */ - int capacity(); - - /** @return if apps assigned to this App Service Plan can be scaled independently */ - boolean perSiteScaling(); - - /** @return number of web apps assigned to this App Service Plan */ - int numberOfWebApps(); - - /** @return the pricing tier information of the App Service Plan */ - PricingTier pricingTier(); - - /** @return the operating system the web app is running on */ - OperatingSystem operatingSystem(); - - /************************************************************** - * Fluent interfaces to provision a App service plan - **************************************************************/ - - /** Container interface for all the definitions that need to be implemented. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithGroup, - DefinitionStages.WithPricingTier, - DefinitionStages.WithOperatingSystem, - DefinitionStages.WithCreate { - } - - /** Grouping of all the site definition stages. */ - interface DefinitionStages { - /** The first stage of the app service plan definition. */ - interface Blank extends DefinitionWithRegion { - } - - /** An app service plan definition allowing resource group to be set. */ - interface WithGroup extends GroupableResource.DefinitionStages.WithGroup { - } - - /** An app service plan definition allowing pricing tier to be set. */ - interface WithPricingTier { - /** - * Specifies free pricing tier for the app service plan. - * - * @return the next stage of the definition - */ - WithCreate withFreePricingTier(); - - /** - * Specifies shared pricing tier for the app service plan. - * - * @return the next stage of the definition - */ - WithCreate withSharedPricingTier(); - - /** - * Specifies the pricing tier for the app service plan. - * - * @param pricingTier the pricing tier enum - * @return the next stage of the definition - */ - WithOperatingSystem withPricingTier(PricingTier pricingTier); - } - - /** An app service plan definition allowing the operating system to be set. */ - interface WithOperatingSystem { - /** - * Specifies the operating system of the app service plan. - * - * @param operatingSystem the operating system - * @return the next stage of the definition - */ - WithCreate withOperatingSystem(OperatingSystem operatingSystem); - } - - /** An app service plan definition allowing per site scaling configuration to be set. */ - interface WithPerSiteScaling { - /** - * Specifies whether per-site scaling will be turned on. - * - * @param perSiteScaling if each site can be scaled individually - * @return the next stage of the definition - */ - WithCreate withPerSiteScaling(boolean perSiteScaling); - } - - /** An app service plan definition allowing instance capacity to be set. */ - interface WithCapacity { - /** - * Specifies the maximum number of instances running for this app service plan. - * - * @param capacity the maximum number of instances - * @return the next stage of an app service plan definition - */ - WithCreate withCapacity(int capacity); - } - - /** - * An app service plan definition with sufficient inputs to create a new website in the cloud, but exposing - * additional optional inputs to specify. - */ - interface WithCreate - extends WithPerSiteScaling, - WithCapacity, - Creatable, - GroupableResource.DefinitionWithTags { - } - } - - /** Grouping of all the site update stages. */ - interface UpdateStages { - /** An app service plan definition allowing pricing tier to be set. */ - interface WithPricingTier { - /** - * Specifies the pricing tier for the app service plan. - * - * @param pricingTier the pricing tier enum - * @return the next stage of the app service plan update - */ - Update withPricingTier(PricingTier pricingTier); - } - - /** An app service plan update allowing per site scaling configuration to be set. */ - interface WithPerSiteScaling { - /** - * Specifies whether per-site scaling will be turned on. - * - * @param perSiteScaling if each site can be scaled individually - * @return the next stage of the app service plan update - */ - Update withPerSiteScaling(boolean perSiteScaling); - } - - /** An app service plan definition allowing instance capacity to be set. */ - interface WithCapacity { - /** - * Specifies the maximum number of instances running for this app service plan. - * - * @param capacity the maximum number of instances - * @return the next stage of an app service plan update - */ - Update withCapacity(int capacity); - } - } - - /** The template for a site update operation, containing all the settings that can be modified. */ - interface Update - extends Appliable, - UpdateStages.WithCapacity, - UpdateStages.WithPerSiteScaling, - UpdateStages.WithPricingTier, - GroupableResource.UpdateWithTags { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServicePlanCollection.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServicePlanCollection.java deleted file mode 100644 index e07be38f6256..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServicePlanCollection.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.models.AppServicePlanInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Collection of App Service plans. */ -@Fluent -public final class AppServicePlanCollection { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AppServicePlanCollection.class); - - /* - * Collection of resources. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * Link to next page of resources. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: Collection of resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Collection of resources. - * - * @param value the value value to set. - * @return the AppServicePlanCollection object itself. - */ - public AppServicePlanCollection withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to next page of resources. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model AppServicePlanCollection")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServicePlanPatchResource.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServicePlanPatchResource.java deleted file mode 100644 index 8306112fb656..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServicePlanPatchResource.java +++ /dev/null @@ -1,410 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.models.AppServicePlanPatchResourceProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** ARM resource for a app service plan. */ -@Fluent -public final class AppServicePlanPatchResource extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AppServicePlanPatchResource.class); - - /* - * AppServicePlanPatchResource resource specific properties - */ - @JsonProperty(value = "properties") - private AppServicePlanPatchResourceProperties innerProperties; - - /** - * Get the innerProperties property: AppServicePlanPatchResource resource specific properties. - * - * @return the innerProperties value. - */ - private AppServicePlanPatchResourceProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public AppServicePlanPatchResource withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the workerTierName property: Target worker tier assigned to the App Service plan. - * - * @return the workerTierName value. - */ - public String workerTierName() { - return this.innerProperties() == null ? null : this.innerProperties().workerTierName(); - } - - /** - * Set the workerTierName property: Target worker tier assigned to the App Service plan. - * - * @param workerTierName the workerTierName value to set. - * @return the AppServicePlanPatchResource object itself. - */ - public AppServicePlanPatchResource withWorkerTierName(String workerTierName) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServicePlanPatchResourceProperties(); - } - this.innerProperties().withWorkerTierName(workerTierName); - return this; - } - - /** - * Get the status property: App Service plan status. - * - * @return the status value. - */ - public StatusOptions status() { - return this.innerProperties() == null ? null : this.innerProperties().status(); - } - - /** - * Get the subscription property: App Service plan subscription. - * - * @return the subscription value. - */ - public String subscription() { - return this.innerProperties() == null ? null : this.innerProperties().subscription(); - } - - /** - * Get the hostingEnvironmentProfile property: Specification for the App Service Environment to use for the App - * Service plan. - * - * @return the hostingEnvironmentProfile value. - */ - public HostingEnvironmentProfile hostingEnvironmentProfile() { - return this.innerProperties() == null ? null : this.innerProperties().hostingEnvironmentProfile(); - } - - /** - * Set the hostingEnvironmentProfile property: Specification for the App Service Environment to use for the App - * Service plan. - * - * @param hostingEnvironmentProfile the hostingEnvironmentProfile value to set. - * @return the AppServicePlanPatchResource object itself. - */ - public AppServicePlanPatchResource withHostingEnvironmentProfile( - HostingEnvironmentProfile hostingEnvironmentProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServicePlanPatchResourceProperties(); - } - this.innerProperties().withHostingEnvironmentProfile(hostingEnvironmentProfile); - return this; - } - - /** - * Get the maximumNumberOfWorkers property: Maximum number of instances that can be assigned to this App Service - * plan. - * - * @return the maximumNumberOfWorkers value. - */ - public Integer maximumNumberOfWorkers() { - return this.innerProperties() == null ? null : this.innerProperties().maximumNumberOfWorkers(); - } - - /** - * Get the geoRegion property: Geographical location for the App Service plan. - * - * @return the geoRegion value. - */ - public String geoRegion() { - return this.innerProperties() == null ? null : this.innerProperties().geoRegion(); - } - - /** - * Get the perSiteScaling property: If <code>true</code>, apps assigned to this App Service plan can be - * scaled independently. If <code>false</code>, apps assigned to this App Service plan will scale to all - * instances of the plan. - * - * @return the perSiteScaling value. - */ - public Boolean perSiteScaling() { - return this.innerProperties() == null ? null : this.innerProperties().perSiteScaling(); - } - - /** - * Set the perSiteScaling property: If <code>true</code>, apps assigned to this App Service plan can be - * scaled independently. If <code>false</code>, apps assigned to this App Service plan will scale to all - * instances of the plan. - * - * @param perSiteScaling the perSiteScaling value to set. - * @return the AppServicePlanPatchResource object itself. - */ - public AppServicePlanPatchResource withPerSiteScaling(Boolean perSiteScaling) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServicePlanPatchResourceProperties(); - } - this.innerProperties().withPerSiteScaling(perSiteScaling); - return this; - } - - /** - * Get the maximumElasticWorkerCount property: Maximum number of total workers allowed for this ElasticScaleEnabled - * App Service Plan. - * - * @return the maximumElasticWorkerCount value. - */ - public Integer maximumElasticWorkerCount() { - return this.innerProperties() == null ? null : this.innerProperties().maximumElasticWorkerCount(); - } - - /** - * Set the maximumElasticWorkerCount property: Maximum number of total workers allowed for this ElasticScaleEnabled - * App Service Plan. - * - * @param maximumElasticWorkerCount the maximumElasticWorkerCount value to set. - * @return the AppServicePlanPatchResource object itself. - */ - public AppServicePlanPatchResource withMaximumElasticWorkerCount(Integer maximumElasticWorkerCount) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServicePlanPatchResourceProperties(); - } - this.innerProperties().withMaximumElasticWorkerCount(maximumElasticWorkerCount); - return this; - } - - /** - * Get the numberOfSites property: Number of apps assigned to this App Service plan. - * - * @return the numberOfSites value. - */ - public Integer numberOfSites() { - return this.innerProperties() == null ? null : this.innerProperties().numberOfSites(); - } - - /** - * Get the isSpot property: If <code>true</code>, this App Service Plan owns spot instances. - * - * @return the isSpot value. - */ - public Boolean isSpot() { - return this.innerProperties() == null ? null : this.innerProperties().isSpot(); - } - - /** - * Set the isSpot property: If <code>true</code>, this App Service Plan owns spot instances. - * - * @param isSpot the isSpot value to set. - * @return the AppServicePlanPatchResource object itself. - */ - public AppServicePlanPatchResource withIsSpot(Boolean isSpot) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServicePlanPatchResourceProperties(); - } - this.innerProperties().withIsSpot(isSpot); - return this; - } - - /** - * Get the spotExpirationTime property: The time when the server farm expires. Valid only if it is a spot server - * farm. - * - * @return the spotExpirationTime value. - */ - public OffsetDateTime spotExpirationTime() { - return this.innerProperties() == null ? null : this.innerProperties().spotExpirationTime(); - } - - /** - * Set the spotExpirationTime property: The time when the server farm expires. Valid only if it is a spot server - * farm. - * - * @param spotExpirationTime the spotExpirationTime value to set. - * @return the AppServicePlanPatchResource object itself. - */ - public AppServicePlanPatchResource withSpotExpirationTime(OffsetDateTime spotExpirationTime) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServicePlanPatchResourceProperties(); - } - this.innerProperties().withSpotExpirationTime(spotExpirationTime); - return this; - } - - /** - * Get the freeOfferExpirationTime property: The time when the server farm free offer expires. - * - * @return the freeOfferExpirationTime value. - */ - public OffsetDateTime freeOfferExpirationTime() { - return this.innerProperties() == null ? null : this.innerProperties().freeOfferExpirationTime(); - } - - /** - * Set the freeOfferExpirationTime property: The time when the server farm free offer expires. - * - * @param freeOfferExpirationTime the freeOfferExpirationTime value to set. - * @return the AppServicePlanPatchResource object itself. - */ - public AppServicePlanPatchResource withFreeOfferExpirationTime(OffsetDateTime freeOfferExpirationTime) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServicePlanPatchResourceProperties(); - } - this.innerProperties().withFreeOfferExpirationTime(freeOfferExpirationTime); - return this; - } - - /** - * Get the resourceGroup property: Resource group of the App Service plan. - * - * @return the resourceGroup value. - */ - public String resourceGroup() { - return this.innerProperties() == null ? null : this.innerProperties().resourceGroup(); - } - - /** - * Get the reserved property: If Linux app service plan <code>true</code>, - * <code>false</code> otherwise. - * - * @return the reserved value. - */ - public Boolean reserved() { - return this.innerProperties() == null ? null : this.innerProperties().reserved(); - } - - /** - * Set the reserved property: If Linux app service plan <code>true</code>, - * <code>false</code> otherwise. - * - * @param reserved the reserved value to set. - * @return the AppServicePlanPatchResource object itself. - */ - public AppServicePlanPatchResource withReserved(Boolean reserved) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServicePlanPatchResourceProperties(); - } - this.innerProperties().withReserved(reserved); - return this; - } - - /** - * Get the isXenon property: Obsolete: If Hyper-V container app service plan <code>true</code>, - * <code>false</code> otherwise. - * - * @return the isXenon value. - */ - public Boolean isXenon() { - return this.innerProperties() == null ? null : this.innerProperties().isXenon(); - } - - /** - * Set the isXenon property: Obsolete: If Hyper-V container app service plan <code>true</code>, - * <code>false</code> otherwise. - * - * @param isXenon the isXenon value to set. - * @return the AppServicePlanPatchResource object itself. - */ - public AppServicePlanPatchResource withIsXenon(Boolean isXenon) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServicePlanPatchResourceProperties(); - } - this.innerProperties().withIsXenon(isXenon); - return this; - } - - /** - * Get the hyperV property: If Hyper-V container app service plan <code>true</code>, - * <code>false</code> otherwise. - * - * @return the hyperV value. - */ - public Boolean hyperV() { - return this.innerProperties() == null ? null : this.innerProperties().hyperV(); - } - - /** - * Set the hyperV property: If Hyper-V container app service plan <code>true</code>, - * <code>false</code> otherwise. - * - * @param hyperV the hyperV value to set. - * @return the AppServicePlanPatchResource object itself. - */ - public AppServicePlanPatchResource withHyperV(Boolean hyperV) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServicePlanPatchResourceProperties(); - } - this.innerProperties().withHyperV(hyperV); - return this; - } - - /** - * Get the targetWorkerCount property: Scaling worker count. - * - * @return the targetWorkerCount value. - */ - public Integer targetWorkerCount() { - return this.innerProperties() == null ? null : this.innerProperties().targetWorkerCount(); - } - - /** - * Set the targetWorkerCount property: Scaling worker count. - * - * @param targetWorkerCount the targetWorkerCount value to set. - * @return the AppServicePlanPatchResource object itself. - */ - public AppServicePlanPatchResource withTargetWorkerCount(Integer targetWorkerCount) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServicePlanPatchResourceProperties(); - } - this.innerProperties().withTargetWorkerCount(targetWorkerCount); - return this; - } - - /** - * Get the targetWorkerSizeId property: Scaling worker size ID. - * - * @return the targetWorkerSizeId value. - */ - public Integer targetWorkerSizeId() { - return this.innerProperties() == null ? null : this.innerProperties().targetWorkerSizeId(); - } - - /** - * Set the targetWorkerSizeId property: Scaling worker size ID. - * - * @param targetWorkerSizeId the targetWorkerSizeId value to set. - * @return the AppServicePlanPatchResource object itself. - */ - public AppServicePlanPatchResource withTargetWorkerSizeId(Integer targetWorkerSizeId) { - if (this.innerProperties() == null) { - this.innerProperties = new AppServicePlanPatchResourceProperties(); - } - this.innerProperties().withTargetWorkerSizeId(targetWorkerSizeId); - return this; - } - - /** - * Get the provisioningState property: Provisioning state of the App Service Environment. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServicePlanRestrictions.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServicePlanRestrictions.java deleted file mode 100644 index a6b433b8bfb0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServicePlanRestrictions.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for AppServicePlanRestrictions. */ -public enum AppServicePlanRestrictions { - /** Enum value None. */ - NONE("None"), - - /** Enum value Free. */ - FREE("Free"), - - /** Enum value Shared. */ - SHARED("Shared"), - - /** Enum value Basic. */ - BASIC("Basic"), - - /** Enum value Standard. */ - STANDARD("Standard"), - - /** Enum value Premium. */ - PREMIUM("Premium"); - - /** The actual serialized value for a AppServicePlanRestrictions instance. */ - private final String value; - - AppServicePlanRestrictions(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a AppServicePlanRestrictions instance. - * - * @param value the serialized value to parse. - * @return the parsed AppServicePlanRestrictions object, or null if unable to parse. - */ - @JsonCreator - public static AppServicePlanRestrictions fromString(String value) { - AppServicePlanRestrictions[] items = AppServicePlanRestrictions.values(); - for (AppServicePlanRestrictions item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServicePlans.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServicePlans.java deleted file mode 100644 index 9bd10bb62cc0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServicePlans.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.appservice.AppServiceManager; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsDeletingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsListingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsCreating; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingById; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; - -/** Entry point for App Service plan management API. */ -@Fluent -public interface AppServicePlans - extends SupportsCreating, - SupportsDeletingById, - SupportsListingByResourceGroup, - SupportsListing, - SupportsGettingByResourceGroup, - SupportsGettingById, - SupportsDeletingByResourceGroup, - HasManager { -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppSetting.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppSetting.java deleted file mode 100644 index 204f967ee327..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppSetting.java +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; - -/** An immutable client-side representation of an app setting on a web app. */ -@Fluent -public interface AppSetting { - /** @return the key of the setting */ - String key(); - - /** @return the value of the setting */ - String value(); - - /** @return if the setting sticks to the slot during a swap */ - boolean sticky(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ApplicationLogsConfig.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ApplicationLogsConfig.java deleted file mode 100644 index 6b6a699e40ff..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ApplicationLogsConfig.java +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Application logs configuration. */ -@Fluent -public final class ApplicationLogsConfig { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationLogsConfig.class); - - /* - * Application logs to file system configuration. - */ - @JsonProperty(value = "fileSystem") - private FileSystemApplicationLogsConfig fileSystem; - - /* - * Application logs to azure table storage configuration. - */ - @JsonProperty(value = "azureTableStorage") - private AzureTableStorageApplicationLogsConfig azureTableStorage; - - /* - * Application logs to blob storage configuration. - */ - @JsonProperty(value = "azureBlobStorage") - private AzureBlobStorageApplicationLogsConfig azureBlobStorage; - - /** - * Get the fileSystem property: Application logs to file system configuration. - * - * @return the fileSystem value. - */ - public FileSystemApplicationLogsConfig fileSystem() { - return this.fileSystem; - } - - /** - * Set the fileSystem property: Application logs to file system configuration. - * - * @param fileSystem the fileSystem value to set. - * @return the ApplicationLogsConfig object itself. - */ - public ApplicationLogsConfig withFileSystem(FileSystemApplicationLogsConfig fileSystem) { - this.fileSystem = fileSystem; - return this; - } - - /** - * Get the azureTableStorage property: Application logs to azure table storage configuration. - * - * @return the azureTableStorage value. - */ - public AzureTableStorageApplicationLogsConfig azureTableStorage() { - return this.azureTableStorage; - } - - /** - * Set the azureTableStorage property: Application logs to azure table storage configuration. - * - * @param azureTableStorage the azureTableStorage value to set. - * @return the ApplicationLogsConfig object itself. - */ - public ApplicationLogsConfig withAzureTableStorage(AzureTableStorageApplicationLogsConfig azureTableStorage) { - this.azureTableStorage = azureTableStorage; - return this; - } - - /** - * Get the azureBlobStorage property: Application logs to blob storage configuration. - * - * @return the azureBlobStorage value. - */ - public AzureBlobStorageApplicationLogsConfig azureBlobStorage() { - return this.azureBlobStorage; - } - - /** - * Set the azureBlobStorage property: Application logs to blob storage configuration. - * - * @param azureBlobStorage the azureBlobStorage value to set. - * @return the ApplicationLogsConfig object itself. - */ - public ApplicationLogsConfig withAzureBlobStorage(AzureBlobStorageApplicationLogsConfig azureBlobStorage) { - this.azureBlobStorage = azureBlobStorage; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (fileSystem() != null) { - fileSystem().validate(); - } - if (azureTableStorage() != null) { - azureTableStorage().validate(); - } - if (azureBlobStorage() != null) { - azureBlobStorage().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ApplicationStackCollection.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ApplicationStackCollection.java deleted file mode 100644 index 7c8a1c25c77b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ApplicationStackCollection.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.models.ApplicationStackInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Collection of Application Stacks. */ -@Fluent -public final class ApplicationStackCollection { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationStackCollection.class); - - /* - * Collection of resources. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * Link to next page of resources. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: Collection of resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Collection of resources. - * - * @param value the value value to set. - * @return the ApplicationStackCollection object itself. - */ - public ApplicationStackCollection withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to next page of resources. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property value in model ApplicationStackCollection")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AttributeCollection.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AttributeCollection.java deleted file mode 100644 index 7fc6c09acc18..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AttributeCollection.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.models; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.List; - -class AttributeCollection { - private final List values = new ArrayList<>(); - - T addValue(T value) { - values.add(value); - return value; - } - - Collection getAllValues() { - return Collections.unmodifiableCollection(new ArrayList<>(values)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AutoHealActionType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AutoHealActionType.java deleted file mode 100644 index 2f9587a18a8e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AutoHealActionType.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for AutoHealActionType. */ -public enum AutoHealActionType { - /** Enum value Recycle. */ - RECYCLE("Recycle"), - - /** Enum value LogEvent. */ - LOG_EVENT("LogEvent"), - - /** Enum value CustomAction. */ - CUSTOM_ACTION("CustomAction"); - - /** The actual serialized value for a AutoHealActionType instance. */ - private final String value; - - AutoHealActionType(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a AutoHealActionType instance. - * - * @param value the serialized value to parse. - * @return the parsed AutoHealActionType object, or null if unable to parse. - */ - @JsonCreator - public static AutoHealActionType fromString(String value) { - AutoHealActionType[] items = AutoHealActionType.values(); - for (AutoHealActionType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AutoHealActions.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AutoHealActions.java deleted file mode 100644 index a5cd19c41484..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AutoHealActions.java +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Actions which to take by the auto-heal module when a rule is triggered. */ -@Fluent -public final class AutoHealActions { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AutoHealActions.class); - - /* - * Predefined action to be taken. - */ - @JsonProperty(value = "actionType") - private AutoHealActionType actionType; - - /* - * Custom action to be taken. - */ - @JsonProperty(value = "customAction") - private AutoHealCustomAction customAction; - - /* - * Minimum time the process must execute - * before taking the action - */ - @JsonProperty(value = "minProcessExecutionTime") - private String minProcessExecutionTime; - - /** - * Get the actionType property: Predefined action to be taken. - * - * @return the actionType value. - */ - public AutoHealActionType actionType() { - return this.actionType; - } - - /** - * Set the actionType property: Predefined action to be taken. - * - * @param actionType the actionType value to set. - * @return the AutoHealActions object itself. - */ - public AutoHealActions withActionType(AutoHealActionType actionType) { - this.actionType = actionType; - return this; - } - - /** - * Get the customAction property: Custom action to be taken. - * - * @return the customAction value. - */ - public AutoHealCustomAction customAction() { - return this.customAction; - } - - /** - * Set the customAction property: Custom action to be taken. - * - * @param customAction the customAction value to set. - * @return the AutoHealActions object itself. - */ - public AutoHealActions withCustomAction(AutoHealCustomAction customAction) { - this.customAction = customAction; - return this; - } - - /** - * Get the minProcessExecutionTime property: Minimum time the process must execute before taking the action. - * - * @return the minProcessExecutionTime value. - */ - public String minProcessExecutionTime() { - return this.minProcessExecutionTime; - } - - /** - * Set the minProcessExecutionTime property: Minimum time the process must execute before taking the action. - * - * @param minProcessExecutionTime the minProcessExecutionTime value to set. - * @return the AutoHealActions object itself. - */ - public AutoHealActions withMinProcessExecutionTime(String minProcessExecutionTime) { - this.minProcessExecutionTime = minProcessExecutionTime; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (customAction() != null) { - customAction().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AutoHealCustomAction.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AutoHealCustomAction.java deleted file mode 100644 index 153be388c589..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AutoHealCustomAction.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Custom action to be executed when an auto heal rule is triggered. */ -@Fluent -public final class AutoHealCustomAction { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AutoHealCustomAction.class); - - /* - * Executable to be run. - */ - @JsonProperty(value = "exe") - private String exe; - - /* - * Parameters for the executable. - */ - @JsonProperty(value = "parameters") - private String parameters; - - /** - * Get the exe property: Executable to be run. - * - * @return the exe value. - */ - public String exe() { - return this.exe; - } - - /** - * Set the exe property: Executable to be run. - * - * @param exe the exe value to set. - * @return the AutoHealCustomAction object itself. - */ - public AutoHealCustomAction withExe(String exe) { - this.exe = exe; - return this; - } - - /** - * Get the parameters property: Parameters for the executable. - * - * @return the parameters value. - */ - public String parameters() { - return this.parameters; - } - - /** - * Set the parameters property: Parameters for the executable. - * - * @param parameters the parameters value to set. - * @return the AutoHealCustomAction object itself. - */ - public AutoHealCustomAction withParameters(String parameters) { - this.parameters = parameters; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AutoHealRules.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AutoHealRules.java deleted file mode 100644 index afdc8ea9d7ab..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AutoHealRules.java +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Rules that can be defined for auto-heal. */ -@Fluent -public final class AutoHealRules { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AutoHealRules.class); - - /* - * Conditions that describe when to execute the auto-heal actions. - */ - @JsonProperty(value = "triggers") - private AutoHealTriggers triggers; - - /* - * Actions to be executed when a rule is triggered. - */ - @JsonProperty(value = "actions") - private AutoHealActions actions; - - /** - * Get the triggers property: Conditions that describe when to execute the auto-heal actions. - * - * @return the triggers value. - */ - public AutoHealTriggers triggers() { - return this.triggers; - } - - /** - * Set the triggers property: Conditions that describe when to execute the auto-heal actions. - * - * @param triggers the triggers value to set. - * @return the AutoHealRules object itself. - */ - public AutoHealRules withTriggers(AutoHealTriggers triggers) { - this.triggers = triggers; - return this; - } - - /** - * Get the actions property: Actions to be executed when a rule is triggered. - * - * @return the actions value. - */ - public AutoHealActions actions() { - return this.actions; - } - - /** - * Set the actions property: Actions to be executed when a rule is triggered. - * - * @param actions the actions value to set. - * @return the AutoHealRules object itself. - */ - public AutoHealRules withActions(AutoHealActions actions) { - this.actions = actions; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (triggers() != null) { - triggers().validate(); - } - if (actions() != null) { - actions().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AutoHealTriggers.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AutoHealTriggers.java deleted file mode 100644 index b2508d2bb3e9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AutoHealTriggers.java +++ /dev/null @@ -1,138 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Triggers for auto-heal. */ -@Fluent -public final class AutoHealTriggers { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AutoHealTriggers.class); - - /* - * A rule based on total requests. - */ - @JsonProperty(value = "requests") - private RequestsBasedTrigger requests; - - /* - * A rule based on private bytes. - */ - @JsonProperty(value = "privateBytesInKB") - private Integer privateBytesInKB; - - /* - * A rule based on status codes. - */ - @JsonProperty(value = "statusCodes") - private List statusCodes; - - /* - * A rule based on request execution time. - */ - @JsonProperty(value = "slowRequests") - private SlowRequestsBasedTrigger slowRequests; - - /** - * Get the requests property: A rule based on total requests. - * - * @return the requests value. - */ - public RequestsBasedTrigger requests() { - return this.requests; - } - - /** - * Set the requests property: A rule based on total requests. - * - * @param requests the requests value to set. - * @return the AutoHealTriggers object itself. - */ - public AutoHealTriggers withRequests(RequestsBasedTrigger requests) { - this.requests = requests; - return this; - } - - /** - * Get the privateBytesInKB property: A rule based on private bytes. - * - * @return the privateBytesInKB value. - */ - public Integer privateBytesInKB() { - return this.privateBytesInKB; - } - - /** - * Set the privateBytesInKB property: A rule based on private bytes. - * - * @param privateBytesInKB the privateBytesInKB value to set. - * @return the AutoHealTriggers object itself. - */ - public AutoHealTriggers withPrivateBytesInKB(Integer privateBytesInKB) { - this.privateBytesInKB = privateBytesInKB; - return this; - } - - /** - * Get the statusCodes property: A rule based on status codes. - * - * @return the statusCodes value. - */ - public List statusCodes() { - return this.statusCodes; - } - - /** - * Set the statusCodes property: A rule based on status codes. - * - * @param statusCodes the statusCodes value to set. - * @return the AutoHealTriggers object itself. - */ - public AutoHealTriggers withStatusCodes(List statusCodes) { - this.statusCodes = statusCodes; - return this; - } - - /** - * Get the slowRequests property: A rule based on request execution time. - * - * @return the slowRequests value. - */ - public SlowRequestsBasedTrigger slowRequests() { - return this.slowRequests; - } - - /** - * Set the slowRequests property: A rule based on request execution time. - * - * @param slowRequests the slowRequests value to set. - * @return the AutoHealTriggers object itself. - */ - public AutoHealTriggers withSlowRequests(SlowRequestsBasedTrigger slowRequests) { - this.slowRequests = slowRequests; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (requests() != null) { - requests().validate(); - } - if (statusCodes() != null) { - statusCodes().forEach(e -> e.validate()); - } - if (slowRequests() != null) { - slowRequests().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AzureBlobStorageApplicationLogsConfig.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AzureBlobStorageApplicationLogsConfig.java deleted file mode 100644 index de722e99cfe4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AzureBlobStorageApplicationLogsConfig.java +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Application logs azure blob storage configuration. */ -@Fluent -public final class AzureBlobStorageApplicationLogsConfig { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureBlobStorageApplicationLogsConfig.class); - - /* - * Log level. - */ - @JsonProperty(value = "level") - private LogLevel level; - - /* - * SAS url to a azure blob container with read/write/list/delete - * permissions. - */ - @JsonProperty(value = "sasUrl") - private String sasUrl; - - /* - * Retention in days. - * Remove blobs older than X days. - * 0 or lower means no retention. - */ - @JsonProperty(value = "retentionInDays") - private Integer retentionInDays; - - /** - * Get the level property: Log level. - * - * @return the level value. - */ - public LogLevel level() { - return this.level; - } - - /** - * Set the level property: Log level. - * - * @param level the level value to set. - * @return the AzureBlobStorageApplicationLogsConfig object itself. - */ - public AzureBlobStorageApplicationLogsConfig withLevel(LogLevel level) { - this.level = level; - return this; - } - - /** - * Get the sasUrl property: SAS url to a azure blob container with read/write/list/delete permissions. - * - * @return the sasUrl value. - */ - public String sasUrl() { - return this.sasUrl; - } - - /** - * Set the sasUrl property: SAS url to a azure blob container with read/write/list/delete permissions. - * - * @param sasUrl the sasUrl value to set. - * @return the AzureBlobStorageApplicationLogsConfig object itself. - */ - public AzureBlobStorageApplicationLogsConfig withSasUrl(String sasUrl) { - this.sasUrl = sasUrl; - return this; - } - - /** - * Get the retentionInDays property: Retention in days. Remove blobs older than X days. 0 or lower means no - * retention. - * - * @return the retentionInDays value. - */ - public Integer retentionInDays() { - return this.retentionInDays; - } - - /** - * Set the retentionInDays property: Retention in days. Remove blobs older than X days. 0 or lower means no - * retention. - * - * @param retentionInDays the retentionInDays value to set. - * @return the AzureBlobStorageApplicationLogsConfig object itself. - */ - public AzureBlobStorageApplicationLogsConfig withRetentionInDays(Integer retentionInDays) { - this.retentionInDays = retentionInDays; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AzureBlobStorageHttpLogsConfig.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AzureBlobStorageHttpLogsConfig.java deleted file mode 100644 index 62be5cd6d6cd..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AzureBlobStorageHttpLogsConfig.java +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Http logs to azure blob storage configuration. */ -@Fluent -public final class AzureBlobStorageHttpLogsConfig { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureBlobStorageHttpLogsConfig.class); - - /* - * SAS url to a azure blob container with read/write/list/delete - * permissions. - */ - @JsonProperty(value = "sasUrl") - private String sasUrl; - - /* - * Retention in days. - * Remove blobs older than X days. - * 0 or lower means no retention. - */ - @JsonProperty(value = "retentionInDays") - private Integer retentionInDays; - - /* - * True if configuration is enabled, false if it is disabled and null if - * configuration is not set. - */ - @JsonProperty(value = "enabled") - private Boolean enabled; - - /** - * Get the sasUrl property: SAS url to a azure blob container with read/write/list/delete permissions. - * - * @return the sasUrl value. - */ - public String sasUrl() { - return this.sasUrl; - } - - /** - * Set the sasUrl property: SAS url to a azure blob container with read/write/list/delete permissions. - * - * @param sasUrl the sasUrl value to set. - * @return the AzureBlobStorageHttpLogsConfig object itself. - */ - public AzureBlobStorageHttpLogsConfig withSasUrl(String sasUrl) { - this.sasUrl = sasUrl; - return this; - } - - /** - * Get the retentionInDays property: Retention in days. Remove blobs older than X days. 0 or lower means no - * retention. - * - * @return the retentionInDays value. - */ - public Integer retentionInDays() { - return this.retentionInDays; - } - - /** - * Set the retentionInDays property: Retention in days. Remove blobs older than X days. 0 or lower means no - * retention. - * - * @param retentionInDays the retentionInDays value to set. - * @return the AzureBlobStorageHttpLogsConfig object itself. - */ - public AzureBlobStorageHttpLogsConfig withRetentionInDays(Integer retentionInDays) { - this.retentionInDays = retentionInDays; - return this; - } - - /** - * Get the enabled property: True if configuration is enabled, false if it is disabled and null if configuration is - * not set. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: True if configuration is enabled, false if it is disabled and null if configuration is - * not set. - * - * @param enabled the enabled value to set. - * @return the AzureBlobStorageHttpLogsConfig object itself. - */ - public AzureBlobStorageHttpLogsConfig withEnabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AzureResourceType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AzureResourceType.java deleted file mode 100644 index 01903b7f3f50..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AzureResourceType.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for AzureResourceType. */ -public enum AzureResourceType { - /** Enum value Website. */ - WEBSITE("Website"), - - /** Enum value TrafficManager. */ - TRAFFIC_MANAGER("TrafficManager"); - - /** The actual serialized value for a AzureResourceType instance. */ - private final String value; - - AzureResourceType(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a AzureResourceType instance. - * - * @param value the serialized value to parse. - * @return the parsed AzureResourceType object, or null if unable to parse. - */ - @JsonCreator - public static AzureResourceType fromString(String value) { - AzureResourceType[] items = AzureResourceType.values(); - for (AzureResourceType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AzureStorageInfoValue.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AzureStorageInfoValue.java deleted file mode 100644 index 8702ad96f8a2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AzureStorageInfoValue.java +++ /dev/null @@ -1,169 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Azure Files or Blob Storage access information value for dictionary storage. */ -@Fluent -public final class AzureStorageInfoValue { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureStorageInfoValue.class); - - /* - * Type of storage. - */ - @JsonProperty(value = "type") - private AzureStorageType type; - - /* - * Name of the storage account. - */ - @JsonProperty(value = "accountName") - private String accountName; - - /* - * Name of the file share (container name, for Blob storage). - */ - @JsonProperty(value = "shareName") - private String shareName; - - /* - * Access key for the storage account. - */ - @JsonProperty(value = "accessKey") - private String accessKey; - - /* - * Path to mount the storage within the site's runtime environment. - */ - @JsonProperty(value = "mountPath") - private String mountPath; - - /* - * State of the storage account. - */ - @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) - private AzureStorageState state; - - /** - * Get the type property: Type of storage. - * - * @return the type value. - */ - public AzureStorageType type() { - return this.type; - } - - /** - * Set the type property: Type of storage. - * - * @param type the type value to set. - * @return the AzureStorageInfoValue object itself. - */ - public AzureStorageInfoValue withType(AzureStorageType type) { - this.type = type; - return this; - } - - /** - * Get the accountName property: Name of the storage account. - * - * @return the accountName value. - */ - public String accountName() { - return this.accountName; - } - - /** - * Set the accountName property: Name of the storage account. - * - * @param accountName the accountName value to set. - * @return the AzureStorageInfoValue object itself. - */ - public AzureStorageInfoValue withAccountName(String accountName) { - this.accountName = accountName; - return this; - } - - /** - * Get the shareName property: Name of the file share (container name, for Blob storage). - * - * @return the shareName value. - */ - public String shareName() { - return this.shareName; - } - - /** - * Set the shareName property: Name of the file share (container name, for Blob storage). - * - * @param shareName the shareName value to set. - * @return the AzureStorageInfoValue object itself. - */ - public AzureStorageInfoValue withShareName(String shareName) { - this.shareName = shareName; - return this; - } - - /** - * Get the accessKey property: Access key for the storage account. - * - * @return the accessKey value. - */ - public String accessKey() { - return this.accessKey; - } - - /** - * Set the accessKey property: Access key for the storage account. - * - * @param accessKey the accessKey value to set. - * @return the AzureStorageInfoValue object itself. - */ - public AzureStorageInfoValue withAccessKey(String accessKey) { - this.accessKey = accessKey; - return this; - } - - /** - * Get the mountPath property: Path to mount the storage within the site's runtime environment. - * - * @return the mountPath value. - */ - public String mountPath() { - return this.mountPath; - } - - /** - * Set the mountPath property: Path to mount the storage within the site's runtime environment. - * - * @param mountPath the mountPath value to set. - * @return the AzureStorageInfoValue object itself. - */ - public AzureStorageInfoValue withMountPath(String mountPath) { - this.mountPath = mountPath; - return this; - } - - /** - * Get the state property: State of the storage account. - * - * @return the state value. - */ - public AzureStorageState state() { - return this.state; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AzureStorageState.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AzureStorageState.java deleted file mode 100644 index 2fae03998980..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AzureStorageState.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for AzureStorageState. */ -public enum AzureStorageState { - /** Enum value Ok. */ - OK("Ok"), - - /** Enum value InvalidCredentials. */ - INVALID_CREDENTIALS("InvalidCredentials"), - - /** Enum value InvalidShare. */ - INVALID_SHARE("InvalidShare"); - - /** The actual serialized value for a AzureStorageState instance. */ - private final String value; - - AzureStorageState(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a AzureStorageState instance. - * - * @param value the serialized value to parse. - * @return the parsed AzureStorageState object, or null if unable to parse. - */ - @JsonCreator - public static AzureStorageState fromString(String value) { - AzureStorageState[] items = AzureStorageState.values(); - for (AzureStorageState item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AzureStorageType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AzureStorageType.java deleted file mode 100644 index 09d69fd52fc8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AzureStorageType.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for AzureStorageType. */ -public enum AzureStorageType { - /** Enum value AzureFiles. */ - AZURE_FILES("AzureFiles"), - - /** Enum value AzureBlob. */ - AZURE_BLOB("AzureBlob"); - - /** The actual serialized value for a AzureStorageType instance. */ - private final String value; - - AzureStorageType(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a AzureStorageType instance. - * - * @param value the serialized value to parse. - * @return the parsed AzureStorageType object, or null if unable to parse. - */ - @JsonCreator - public static AzureStorageType fromString(String value) { - AzureStorageType[] items = AzureStorageType.values(); - for (AzureStorageType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AzureTableStorageApplicationLogsConfig.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AzureTableStorageApplicationLogsConfig.java deleted file mode 100644 index a132a78f81f4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AzureTableStorageApplicationLogsConfig.java +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Application logs to Azure table storage configuration. */ -@Fluent -public final class AzureTableStorageApplicationLogsConfig { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureTableStorageApplicationLogsConfig.class); - - /* - * Log level. - */ - @JsonProperty(value = "level") - private LogLevel level; - - /* - * SAS URL to an Azure table with add/query/delete permissions. - */ - @JsonProperty(value = "sasUrl", required = true) - private String sasUrl; - - /** - * Get the level property: Log level. - * - * @return the level value. - */ - public LogLevel level() { - return this.level; - } - - /** - * Set the level property: Log level. - * - * @param level the level value to set. - * @return the AzureTableStorageApplicationLogsConfig object itself. - */ - public AzureTableStorageApplicationLogsConfig withLevel(LogLevel level) { - this.level = level; - return this; - } - - /** - * Get the sasUrl property: SAS URL to an Azure table with add/query/delete permissions. - * - * @return the sasUrl value. - */ - public String sasUrl() { - return this.sasUrl; - } - - /** - * Set the sasUrl property: SAS URL to an Azure table with add/query/delete permissions. - * - * @param sasUrl the sasUrl value to set. - * @return the AzureTableStorageApplicationLogsConfig object itself. - */ - public AzureTableStorageApplicationLogsConfig withSasUrl(String sasUrl) { - this.sasUrl = sasUrl; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (sasUrl() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property sasUrl in model AzureTableStorageApplicationLogsConfig")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/BackupItemCollection.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/BackupItemCollection.java deleted file mode 100644 index 34dd06cfd84f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/BackupItemCollection.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.models.BackupItemInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Collection of backup items. */ -@Fluent -public final class BackupItemCollection { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupItemCollection.class); - - /* - * Collection of resources. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * Link to next page of resources. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: Collection of resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Collection of resources. - * - * @param value the value value to set. - * @return the BackupItemCollection object itself. - */ - public BackupItemCollection withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to next page of resources. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model BackupItemCollection")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/BackupItemStatus.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/BackupItemStatus.java deleted file mode 100644 index 8bb9943aa163..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/BackupItemStatus.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for BackupItemStatus. */ -public enum BackupItemStatus { - /** Enum value InProgress. */ - IN_PROGRESS("InProgress"), - - /** Enum value Failed. */ - FAILED("Failed"), - - /** Enum value Succeeded. */ - SUCCEEDED("Succeeded"), - - /** Enum value TimedOut. */ - TIMED_OUT("TimedOut"), - - /** Enum value Created. */ - CREATED("Created"), - - /** Enum value Skipped. */ - SKIPPED("Skipped"), - - /** Enum value PartiallySucceeded. */ - PARTIALLY_SUCCEEDED("PartiallySucceeded"), - - /** Enum value DeleteInProgress. */ - DELETE_IN_PROGRESS("DeleteInProgress"), - - /** Enum value DeleteFailed. */ - DELETE_FAILED("DeleteFailed"), - - /** Enum value Deleted. */ - DELETED("Deleted"); - - /** The actual serialized value for a BackupItemStatus instance. */ - private final String value; - - BackupItemStatus(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a BackupItemStatus instance. - * - * @param value the serialized value to parse. - * @return the parsed BackupItemStatus object, or null if unable to parse. - */ - @JsonCreator - public static BackupItemStatus fromString(String value) { - BackupItemStatus[] items = BackupItemStatus.values(); - for (BackupItemStatus item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/BackupRestoreOperationType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/BackupRestoreOperationType.java deleted file mode 100644 index 3a7e235ecf37..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/BackupRestoreOperationType.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for BackupRestoreOperationType. */ -public enum BackupRestoreOperationType { - /** Enum value Default. */ - DEFAULT("Default"), - - /** Enum value Clone. */ - CLONE("Clone"), - - /** Enum value Relocation. */ - RELOCATION("Relocation"), - - /** Enum value Snapshot. */ - SNAPSHOT("Snapshot"), - - /** Enum value CloudFS. */ - CLOUD_FS("CloudFS"); - - /** The actual serialized value for a BackupRestoreOperationType instance. */ - private final String value; - - BackupRestoreOperationType(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a BackupRestoreOperationType instance. - * - * @param value the serialized value to parse. - * @return the parsed BackupRestoreOperationType object, or null if unable to parse. - */ - @JsonCreator - public static BackupRestoreOperationType fromString(String value) { - BackupRestoreOperationType[] items = BackupRestoreOperationType.values(); - for (BackupRestoreOperationType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/BackupSchedule.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/BackupSchedule.java deleted file mode 100644 index ea06a03d7bf5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/BackupSchedule.java +++ /dev/null @@ -1,188 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** - * Description of a backup schedule. Describes how often should be the backup performed and what should be the retention - * policy. - */ -@Fluent -public final class BackupSchedule { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupSchedule.class); - - /* - * How often the backup should be executed (e.g. for weekly backup, this - * should be set to 7 and FrequencyUnit should be set to Day) - */ - @JsonProperty(value = "frequencyInterval", required = true) - private int frequencyInterval; - - /* - * The unit of time for how often the backup should be executed (e.g. for - * weekly backup, this should be set to Day and FrequencyInterval should be - * set to 7) - */ - @JsonProperty(value = "frequencyUnit", required = true) - private FrequencyUnit frequencyUnit; - - /* - * True if the retention policy should always keep at least one backup in - * the storage account, regardless how old it is; false otherwise. - */ - @JsonProperty(value = "keepAtLeastOneBackup", required = true) - private boolean keepAtLeastOneBackup; - - /* - * After how many days backups should be deleted. - */ - @JsonProperty(value = "retentionPeriodInDays", required = true) - private int retentionPeriodInDays; - - /* - * When the schedule should start working. - */ - @JsonProperty(value = "startTime") - private OffsetDateTime startTime; - - /* - * Last time when this schedule was triggered. - */ - @JsonProperty(value = "lastExecutionTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime lastExecutionTime; - - /** - * Get the frequencyInterval property: How often the backup should be executed (e.g. for weekly backup, this should - * be set to 7 and FrequencyUnit should be set to Day). - * - * @return the frequencyInterval value. - */ - public int frequencyInterval() { - return this.frequencyInterval; - } - - /** - * Set the frequencyInterval property: How often the backup should be executed (e.g. for weekly backup, this should - * be set to 7 and FrequencyUnit should be set to Day). - * - * @param frequencyInterval the frequencyInterval value to set. - * @return the BackupSchedule object itself. - */ - public BackupSchedule withFrequencyInterval(int frequencyInterval) { - this.frequencyInterval = frequencyInterval; - return this; - } - - /** - * Get the frequencyUnit property: The unit of time for how often the backup should be executed (e.g. for weekly - * backup, this should be set to Day and FrequencyInterval should be set to 7). - * - * @return the frequencyUnit value. - */ - public FrequencyUnit frequencyUnit() { - return this.frequencyUnit; - } - - /** - * Set the frequencyUnit property: The unit of time for how often the backup should be executed (e.g. for weekly - * backup, this should be set to Day and FrequencyInterval should be set to 7). - * - * @param frequencyUnit the frequencyUnit value to set. - * @return the BackupSchedule object itself. - */ - public BackupSchedule withFrequencyUnit(FrequencyUnit frequencyUnit) { - this.frequencyUnit = frequencyUnit; - return this; - } - - /** - * Get the keepAtLeastOneBackup property: True if the retention policy should always keep at least one backup in the - * storage account, regardless how old it is; false otherwise. - * - * @return the keepAtLeastOneBackup value. - */ - public boolean keepAtLeastOneBackup() { - return this.keepAtLeastOneBackup; - } - - /** - * Set the keepAtLeastOneBackup property: True if the retention policy should always keep at least one backup in the - * storage account, regardless how old it is; false otherwise. - * - * @param keepAtLeastOneBackup the keepAtLeastOneBackup value to set. - * @return the BackupSchedule object itself. - */ - public BackupSchedule withKeepAtLeastOneBackup(boolean keepAtLeastOneBackup) { - this.keepAtLeastOneBackup = keepAtLeastOneBackup; - return this; - } - - /** - * Get the retentionPeriodInDays property: After how many days backups should be deleted. - * - * @return the retentionPeriodInDays value. - */ - public int retentionPeriodInDays() { - return this.retentionPeriodInDays; - } - - /** - * Set the retentionPeriodInDays property: After how many days backups should be deleted. - * - * @param retentionPeriodInDays the retentionPeriodInDays value to set. - * @return the BackupSchedule object itself. - */ - public BackupSchedule withRetentionPeriodInDays(int retentionPeriodInDays) { - this.retentionPeriodInDays = retentionPeriodInDays; - return this; - } - - /** - * Get the startTime property: When the schedule should start working. - * - * @return the startTime value. - */ - public OffsetDateTime startTime() { - return this.startTime; - } - - /** - * Set the startTime property: When the schedule should start working. - * - * @param startTime the startTime value to set. - * @return the BackupSchedule object itself. - */ - public BackupSchedule withStartTime(OffsetDateTime startTime) { - this.startTime = startTime; - return this; - } - - /** - * Get the lastExecutionTime property: Last time when this schedule was triggered. - * - * @return the lastExecutionTime value. - */ - public OffsetDateTime lastExecutionTime() { - return this.lastExecutionTime; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (frequencyUnit() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property frequencyUnit in model BackupSchedule")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/BillingMeterCollection.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/BillingMeterCollection.java deleted file mode 100644 index 4c6ffa1c7d5f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/BillingMeterCollection.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.models.BillingMeterInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Collection of Billing Meters. */ -@Fluent -public final class BillingMeterCollection { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BillingMeterCollection.class); - - /* - * Collection of resources. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * Link to next page of resources. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: Collection of resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Collection of resources. - * - * @param value the value value to set. - * @return the BillingMeterCollection object itself. - */ - public BillingMeterCollection withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to next page of resources. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model BillingMeterCollection")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/BuiltInAuthenticationProvider.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/BuiltInAuthenticationProvider.java deleted file mode 100644 index 47cf49c1faa6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/BuiltInAuthenticationProvider.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for BuiltInAuthenticationProvider. */ -public enum BuiltInAuthenticationProvider { - /** Enum value AzureActiveDirectory. */ - AZURE_ACTIVE_DIRECTORY("AzureActiveDirectory"), - - /** Enum value Facebook. */ - FACEBOOK("Facebook"), - - /** Enum value Google. */ - GOOGLE("Google"), - - /** Enum value MicrosoftAccount. */ - MICROSOFT_ACCOUNT("MicrosoftAccount"), - - /** Enum value Twitter. */ - TWITTER("Twitter"); - - /** The actual serialized value for a BuiltInAuthenticationProvider instance. */ - private final String value; - - BuiltInAuthenticationProvider(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a BuiltInAuthenticationProvider instance. - * - * @param value the serialized value to parse. - * @return the parsed BuiltInAuthenticationProvider object, or null if unable to parse. - */ - @JsonCreator - public static BuiltInAuthenticationProvider fromString(String value) { - BuiltInAuthenticationProvider[] items = BuiltInAuthenticationProvider.values(); - for (BuiltInAuthenticationProvider item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/CertificateCollection.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/CertificateCollection.java deleted file mode 100644 index c3ec3100edf1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/CertificateCollection.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.models.CertificateInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Collection of certificates. */ -@Fluent -public final class CertificateCollection { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CertificateCollection.class); - - /* - * Collection of resources. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * Link to next page of resources. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: Collection of resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Collection of resources. - * - * @param value the value value to set. - * @return the CertificateCollection object itself. - */ - public CertificateCollection withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to next page of resources. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model CertificateCollection")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/CertificateDetails.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/CertificateDetails.java deleted file mode 100644 index a56c41dffe82..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/CertificateDetails.java +++ /dev/null @@ -1,160 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** SSL certificate details. */ -@Immutable -public final class CertificateDetails { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CertificateDetails.class); - - /* - * Certificate Version. - */ - @JsonProperty(value = "version", access = JsonProperty.Access.WRITE_ONLY) - private Integer version; - - /* - * Certificate Serial Number. - */ - @JsonProperty(value = "serialNumber", access = JsonProperty.Access.WRITE_ONLY) - private String serialNumber; - - /* - * Certificate Thumbprint. - */ - @JsonProperty(value = "thumbprint", access = JsonProperty.Access.WRITE_ONLY) - private String thumbprint; - - /* - * Certificate Subject. - */ - @JsonProperty(value = "subject", access = JsonProperty.Access.WRITE_ONLY) - private String subject; - - /* - * Date Certificate is valid from. - */ - @JsonProperty(value = "notBefore", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime notBefore; - - /* - * Date Certificate is valid to. - */ - @JsonProperty(value = "notAfter", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime notAfter; - - /* - * Certificate Signature algorithm. - */ - @JsonProperty(value = "signatureAlgorithm", access = JsonProperty.Access.WRITE_ONLY) - private String signatureAlgorithm; - - /* - * Certificate Issuer. - */ - @JsonProperty(value = "issuer", access = JsonProperty.Access.WRITE_ONLY) - private String issuer; - - /* - * Raw certificate data. - */ - @JsonProperty(value = "rawData", access = JsonProperty.Access.WRITE_ONLY) - private String rawData; - - /** - * Get the version property: Certificate Version. - * - * @return the version value. - */ - public Integer version() { - return this.version; - } - - /** - * Get the serialNumber property: Certificate Serial Number. - * - * @return the serialNumber value. - */ - public String serialNumber() { - return this.serialNumber; - } - - /** - * Get the thumbprint property: Certificate Thumbprint. - * - * @return the thumbprint value. - */ - public String thumbprint() { - return this.thumbprint; - } - - /** - * Get the subject property: Certificate Subject. - * - * @return the subject value. - */ - public String subject() { - return this.subject; - } - - /** - * Get the notBefore property: Date Certificate is valid from. - * - * @return the notBefore value. - */ - public OffsetDateTime notBefore() { - return this.notBefore; - } - - /** - * Get the notAfter property: Date Certificate is valid to. - * - * @return the notAfter value. - */ - public OffsetDateTime notAfter() { - return this.notAfter; - } - - /** - * Get the signatureAlgorithm property: Certificate Signature algorithm. - * - * @return the signatureAlgorithm value. - */ - public String signatureAlgorithm() { - return this.signatureAlgorithm; - } - - /** - * Get the issuer property: Certificate Issuer. - * - * @return the issuer value. - */ - public String issuer() { - return this.issuer; - } - - /** - * Get the rawData property: Raw certificate data. - * - * @return the rawData value. - */ - public String rawData() { - return this.rawData; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/CertificateOrderActionType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/CertificateOrderActionType.java deleted file mode 100644 index d4d838db542d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/CertificateOrderActionType.java +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for CertificateOrderActionType. */ -public enum CertificateOrderActionType { - /** Enum value CertificateIssued. */ - CERTIFICATE_ISSUED("CertificateIssued"), - - /** Enum value CertificateOrderCanceled. */ - CERTIFICATE_ORDER_CANCELED("CertificateOrderCanceled"), - - /** Enum value CertificateOrderCreated. */ - CERTIFICATE_ORDER_CREATED("CertificateOrderCreated"), - - /** Enum value CertificateRevoked. */ - CERTIFICATE_REVOKED("CertificateRevoked"), - - /** Enum value DomainValidationComplete. */ - DOMAIN_VALIDATION_COMPLETE("DomainValidationComplete"), - - /** Enum value FraudDetected. */ - FRAUD_DETECTED("FraudDetected"), - - /** Enum value OrgNameChange. */ - ORG_NAME_CHANGE("OrgNameChange"), - - /** Enum value OrgValidationComplete. */ - ORG_VALIDATION_COMPLETE("OrgValidationComplete"), - - /** Enum value SanDrop. */ - SAN_DROP("SanDrop"), - - /** Enum value FraudCleared. */ - FRAUD_CLEARED("FraudCleared"), - - /** Enum value CertificateExpired. */ - CERTIFICATE_EXPIRED("CertificateExpired"), - - /** Enum value CertificateExpirationWarning. */ - CERTIFICATE_EXPIRATION_WARNING("CertificateExpirationWarning"), - - /** Enum value FraudDocumentationRequired. */ - FRAUD_DOCUMENTATION_REQUIRED("FraudDocumentationRequired"), - - /** Enum value Unknown. */ - UNKNOWN("Unknown"); - - /** The actual serialized value for a CertificateOrderActionType instance. */ - private final String value; - - CertificateOrderActionType(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a CertificateOrderActionType instance. - * - * @param value the serialized value to parse. - * @return the parsed CertificateOrderActionType object, or null if unable to parse. - */ - @JsonCreator - public static CertificateOrderActionType fromString(String value) { - CertificateOrderActionType[] items = CertificateOrderActionType.values(); - for (CertificateOrderActionType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/CertificateOrderStatus.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/CertificateOrderStatus.java deleted file mode 100644 index 1024d245f089..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/CertificateOrderStatus.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for CertificateOrderStatus. */ -public enum CertificateOrderStatus { - /** Enum value Pendingissuance. */ - PENDINGISSUANCE("Pendingissuance"), - - /** Enum value Issued. */ - ISSUED("Issued"), - - /** Enum value Revoked. */ - REVOKED("Revoked"), - - /** Enum value Canceled. */ - CANCELED("Canceled"), - - /** Enum value Denied. */ - DENIED("Denied"), - - /** Enum value Pendingrevocation. */ - PENDINGREVOCATION("Pendingrevocation"), - - /** Enum value PendingRekey. */ - PENDING_REKEY("PendingRekey"), - - /** Enum value Unused. */ - UNUSED("Unused"), - - /** Enum value Expired. */ - EXPIRED("Expired"), - - /** Enum value NotSubmitted. */ - NOT_SUBMITTED("NotSubmitted"); - - /** The actual serialized value for a CertificateOrderStatus instance. */ - private final String value; - - CertificateOrderStatus(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a CertificateOrderStatus instance. - * - * @param value the serialized value to parse. - * @return the parsed CertificateOrderStatus object, or null if unable to parse. - */ - @JsonCreator - public static CertificateOrderStatus fromString(String value) { - CertificateOrderStatus[] items = CertificateOrderStatus.values(); - for (CertificateOrderStatus item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/CertificatePatchResource.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/CertificatePatchResource.java deleted file mode 100644 index 5d056a2fe504..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/CertificatePatchResource.java +++ /dev/null @@ -1,314 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.models.CertificatePatchResourceProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; - -/** ARM resource for a certificate. */ -@Fluent -public final class CertificatePatchResource extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CertificatePatchResource.class); - - /* - * CertificatePatchResource resource specific properties - */ - @JsonProperty(value = "properties") - private CertificatePatchResourceProperties innerProperties; - - /** - * Get the innerProperties property: CertificatePatchResource resource specific properties. - * - * @return the innerProperties value. - */ - private CertificatePatchResourceProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public CertificatePatchResource withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the friendlyName property: Friendly name of the certificate. - * - * @return the friendlyName value. - */ - public String friendlyName() { - return this.innerProperties() == null ? null : this.innerProperties().friendlyName(); - } - - /** - * Get the subjectName property: Subject name of the certificate. - * - * @return the subjectName value. - */ - public String subjectName() { - return this.innerProperties() == null ? null : this.innerProperties().subjectName(); - } - - /** - * Get the hostNames property: Host names the certificate applies to. - * - * @return the hostNames value. - */ - public List hostNames() { - return this.innerProperties() == null ? null : this.innerProperties().hostNames(); - } - - /** - * Set the hostNames property: Host names the certificate applies to. - * - * @param hostNames the hostNames value to set. - * @return the CertificatePatchResource object itself. - */ - public CertificatePatchResource withHostNames(List hostNames) { - if (this.innerProperties() == null) { - this.innerProperties = new CertificatePatchResourceProperties(); - } - this.innerProperties().withHostNames(hostNames); - return this; - } - - /** - * Get the pfxBlob property: Pfx blob. - * - * @return the pfxBlob value. - */ - public byte[] pfxBlob() { - return this.innerProperties() == null ? null : this.innerProperties().pfxBlob(); - } - - /** - * Set the pfxBlob property: Pfx blob. - * - * @param pfxBlob the pfxBlob value to set. - * @return the CertificatePatchResource object itself. - */ - public CertificatePatchResource withPfxBlob(byte[] pfxBlob) { - if (this.innerProperties() == null) { - this.innerProperties = new CertificatePatchResourceProperties(); - } - this.innerProperties().withPfxBlob(pfxBlob); - return this; - } - - /** - * Get the siteName property: App name. - * - * @return the siteName value. - */ - public String siteName() { - return this.innerProperties() == null ? null : this.innerProperties().siteName(); - } - - /** - * Get the selfLink property: Self link. - * - * @return the selfLink value. - */ - public String selfLink() { - return this.innerProperties() == null ? null : this.innerProperties().selfLink(); - } - - /** - * Get the issuer property: Certificate issuer. - * - * @return the issuer value. - */ - public String issuer() { - return this.innerProperties() == null ? null : this.innerProperties().issuer(); - } - - /** - * Get the issueDate property: Certificate issue Date. - * - * @return the issueDate value. - */ - public OffsetDateTime issueDate() { - return this.innerProperties() == null ? null : this.innerProperties().issueDate(); - } - - /** - * Get the expirationDate property: Certificate expiration date. - * - * @return the expirationDate value. - */ - public OffsetDateTime expirationDate() { - return this.innerProperties() == null ? null : this.innerProperties().expirationDate(); - } - - /** - * Get the password property: Certificate password. - * - * @return the password value. - */ - public String password() { - return this.innerProperties() == null ? null : this.innerProperties().password(); - } - - /** - * Set the password property: Certificate password. - * - * @param password the password value to set. - * @return the CertificatePatchResource object itself. - */ - public CertificatePatchResource withPassword(String password) { - if (this.innerProperties() == null) { - this.innerProperties = new CertificatePatchResourceProperties(); - } - this.innerProperties().withPassword(password); - return this; - } - - /** - * Get the thumbprint property: Certificate thumbprint. - * - * @return the thumbprint value. - */ - public String thumbprint() { - return this.innerProperties() == null ? null : this.innerProperties().thumbprint(); - } - - /** - * Get the valid property: Is the certificate valid?. - * - * @return the valid value. - */ - public Boolean valid() { - return this.innerProperties() == null ? null : this.innerProperties().valid(); - } - - /** - * Get the cerBlob property: Raw bytes of .cer file. - * - * @return the cerBlob value. - */ - public byte[] cerBlob() { - return this.innerProperties() == null ? null : this.innerProperties().cerBlob(); - } - - /** - * Get the publicKeyHash property: Public key hash. - * - * @return the publicKeyHash value. - */ - public String publicKeyHash() { - return this.innerProperties() == null ? null : this.innerProperties().publicKeyHash(); - } - - /** - * Get the hostingEnvironmentProfile property: Specification for the App Service Environment to use for the - * certificate. - * - * @return the hostingEnvironmentProfile value. - */ - public HostingEnvironmentProfile hostingEnvironmentProfile() { - return this.innerProperties() == null ? null : this.innerProperties().hostingEnvironmentProfile(); - } - - /** - * Get the keyVaultId property: Key Vault Csm resource Id. - * - * @return the keyVaultId value. - */ - public String keyVaultId() { - return this.innerProperties() == null ? null : this.innerProperties().keyVaultId(); - } - - /** - * Set the keyVaultId property: Key Vault Csm resource Id. - * - * @param keyVaultId the keyVaultId value to set. - * @return the CertificatePatchResource object itself. - */ - public CertificatePatchResource withKeyVaultId(String keyVaultId) { - if (this.innerProperties() == null) { - this.innerProperties = new CertificatePatchResourceProperties(); - } - this.innerProperties().withKeyVaultId(keyVaultId); - return this; - } - - /** - * Get the keyVaultSecretName property: Key Vault secret name. - * - * @return the keyVaultSecretName value. - */ - public String keyVaultSecretName() { - return this.innerProperties() == null ? null : this.innerProperties().keyVaultSecretName(); - } - - /** - * Set the keyVaultSecretName property: Key Vault secret name. - * - * @param keyVaultSecretName the keyVaultSecretName value to set. - * @return the CertificatePatchResource object itself. - */ - public CertificatePatchResource withKeyVaultSecretName(String keyVaultSecretName) { - if (this.innerProperties() == null) { - this.innerProperties = new CertificatePatchResourceProperties(); - } - this.innerProperties().withKeyVaultSecretName(keyVaultSecretName); - return this; - } - - /** - * Get the keyVaultSecretStatus property: Status of the Key Vault secret. - * - * @return the keyVaultSecretStatus value. - */ - public KeyVaultSecretStatus keyVaultSecretStatus() { - return this.innerProperties() == null ? null : this.innerProperties().keyVaultSecretStatus(); - } - - /** - * Get the serverFarmId property: Resource ID of the associated App Service plan, formatted as: - * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms" - + "/{appServicePlanName}". - * - * @return the serverFarmId value. - */ - public String serverFarmId() { - return this.innerProperties() == null ? null : this.innerProperties().serverFarmId(); - } - - /** - * Set the serverFarmId property: Resource ID of the associated App Service plan, formatted as: - * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms" - + "/{appServicePlanName}". - * - * @param serverFarmId the serverFarmId value to set. - * @return the CertificatePatchResource object itself. - */ - public CertificatePatchResource withServerFarmId(String serverFarmId) { - if (this.innerProperties() == null) { - this.innerProperties = new CertificatePatchResourceProperties(); - } - this.innerProperties().withServerFarmId(serverFarmId); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/CertificateProductType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/CertificateProductType.java deleted file mode 100644 index e43913a9a6eb..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/CertificateProductType.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for CertificateProductType. */ -public enum CertificateProductType { - /** Enum value StandardDomainValidatedSsl. */ - STANDARD_DOMAIN_VALIDATED_SSL("StandardDomainValidatedSsl"), - - /** Enum value StandardDomainValidatedWildCardSsl. */ - STANDARD_DOMAIN_VALIDATED_WILD_CARD_SSL("StandardDomainValidatedWildCardSsl"); - - /** The actual serialized value for a CertificateProductType instance. */ - private final String value; - - CertificateProductType(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a CertificateProductType instance. - * - * @param value the serialized value to parse. - * @return the parsed CertificateProductType object, or null if unable to parse. - */ - @JsonCreator - public static CertificateProductType fromString(String value) { - CertificateProductType[] items = CertificateProductType.values(); - for (CertificateProductType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/Channels.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/Channels.java deleted file mode 100644 index 762f4842275f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/Channels.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for Channels. */ -public enum Channels { - /** Enum value Notification. */ - NOTIFICATION("Notification"), - - /** Enum value Api. */ - API("Api"), - - /** Enum value Email. */ - EMAIL("Email"), - - /** Enum value Webhook. */ - WEBHOOK("Webhook"), - - /** Enum value All. */ - ALL("All"); - - /** The actual serialized value for a Channels instance. */ - private final String value; - - Channels(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a Channels instance. - * - * @param value the serialized value to parse. - * @return the parsed Channels object, or null if unable to parse. - */ - @JsonCreator - public static Channels fromString(String value) { - Channels[] items = Channels.values(); - for (Channels item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/CheckNameResourceTypes.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/CheckNameResourceTypes.java deleted file mode 100644 index 10ae13236a0b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/CheckNameResourceTypes.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for CheckNameResourceTypes. */ -public final class CheckNameResourceTypes extends ExpandableStringEnum { - /** Static value Site for CheckNameResourceTypes. */ - public static final CheckNameResourceTypes SITE = fromString("Site"); - - /** Static value Slot for CheckNameResourceTypes. */ - public static final CheckNameResourceTypes SLOT = fromString("Slot"); - - /** Static value HostingEnvironment for CheckNameResourceTypes. */ - public static final CheckNameResourceTypes HOSTING_ENVIRONMENT = fromString("HostingEnvironment"); - - /** Static value PublishingUser for CheckNameResourceTypes. */ - public static final CheckNameResourceTypes PUBLISHING_USER = fromString("PublishingUser"); - - /** Static value Microsoft.Web/sites for CheckNameResourceTypes. */ - public static final CheckNameResourceTypes MICROSOFT_WEB_SITES = fromString("Microsoft.Web/sites"); - - /** Static value Microsoft.Web/sites/slots for CheckNameResourceTypes. */ - public static final CheckNameResourceTypes MICROSOFT_WEB_SITES_SLOTS = fromString("Microsoft.Web/sites/slots"); - - /** Static value Microsoft.Web/hostingEnvironments for CheckNameResourceTypes. */ - public static final CheckNameResourceTypes MICROSOFT_WEB_HOSTING_ENVIRONMENTS = - fromString("Microsoft.Web/hostingEnvironments"); - - /** Static value Microsoft.Web/publishingUsers for CheckNameResourceTypes. */ - public static final CheckNameResourceTypes MICROSOFT_WEB_PUBLISHING_USERS = - fromString("Microsoft.Web/publishingUsers"); - - /** - * Creates or finds a CheckNameResourceTypes from its string representation. - * - * @param name a name to look for. - * @return the corresponding CheckNameResourceTypes. - */ - @JsonCreator - public static CheckNameResourceTypes fromString(String name) { - return fromString(name, CheckNameResourceTypes.class); - } - - /** @return known CheckNameResourceTypes values. */ - public static Collection values() { - return values(CheckNameResourceTypes.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/CloneAbilityResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/CloneAbilityResult.java deleted file mode 100644 index fbb397def497..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/CloneAbilityResult.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for CloneAbilityResult. */ -public enum CloneAbilityResult { - /** Enum value Cloneable. */ - CLONEABLE("Cloneable"), - - /** Enum value PartiallyCloneable. */ - PARTIALLY_CLONEABLE("PartiallyCloneable"), - - /** Enum value NotCloneable. */ - NOT_CLONEABLE("NotCloneable"); - - /** The actual serialized value for a CloneAbilityResult instance. */ - private final String value; - - CloneAbilityResult(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a CloneAbilityResult instance. - * - * @param value the serialized value to parse. - * @return the parsed CloneAbilityResult object, or null if unable to parse. - */ - @JsonCreator - public static CloneAbilityResult fromString(String value) { - CloneAbilityResult[] items = CloneAbilityResult.values(); - for (CloneAbilityResult item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/CloningInfo.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/CloningInfo.java deleted file mode 100644 index 6396e4a5619b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/CloningInfo.java +++ /dev/null @@ -1,361 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; -import java.util.UUID; - -/** Information needed for cloning operation. */ -@Fluent -public final class CloningInfo { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CloningInfo.class); - - /* - * Correlation ID of cloning operation. This ID ties multiple cloning - * operations - * together to use the same snapshot. - */ - @JsonProperty(value = "correlationId") - private UUID correlationId; - - /* - * true to overwrite destination app; otherwise, - * false. - */ - @JsonProperty(value = "overwrite") - private Boolean overwrite; - - /* - * true to clone custom hostnames from source app; otherwise, - * false. - */ - @JsonProperty(value = "cloneCustomHostNames") - private Boolean cloneCustomHostNames; - - /* - * true to clone source control from source app; otherwise, - * false. - */ - @JsonProperty(value = "cloneSourceControl") - private Boolean cloneSourceControl; - - /* - * ARM resource ID of the source app. App resource ID is of the form - * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} - * for production slots and - * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} - * for other slots. - */ - @JsonProperty(value = "sourceWebAppId", required = true) - private String sourceWebAppId; - - /* - * Location of source app ex: West US or North Europe - */ - @JsonProperty(value = "sourceWebAppLocation") - private String sourceWebAppLocation; - - /* - * App Service Environment. - */ - @JsonProperty(value = "hostingEnvironment") - private String hostingEnvironment; - - /* - * Application setting overrides for cloned app. If specified, these - * settings override the settings cloned - * from source app. Otherwise, application settings from source app are - * retained. - */ - @JsonProperty(value = "appSettingsOverrides") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map appSettingsOverrides; - - /* - * true to configure load balancing for source and destination - * app. - */ - @JsonProperty(value = "configureLoadBalancing") - private Boolean configureLoadBalancing; - - /* - * ARM resource ID of the Traffic Manager profile to use, if it exists. - * Traffic Manager resource ID is of the form - * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{profileName}. - */ - @JsonProperty(value = "trafficManagerProfileId") - private String trafficManagerProfileId; - - /* - * Name of Traffic Manager profile to create. This is only needed if - * Traffic Manager profile does not already exist. - */ - @JsonProperty(value = "trafficManagerProfileName") - private String trafficManagerProfileName; - - /** - * Get the correlationId property: Correlation ID of cloning operation. This ID ties multiple cloning operations - * together to use the same snapshot. - * - * @return the correlationId value. - */ - public UUID correlationId() { - return this.correlationId; - } - - /** - * Set the correlationId property: Correlation ID of cloning operation. This ID ties multiple cloning operations - * together to use the same snapshot. - * - * @param correlationId the correlationId value to set. - * @return the CloningInfo object itself. - */ - public CloningInfo withCorrelationId(UUID correlationId) { - this.correlationId = correlationId; - return this; - } - - /** - * Get the overwrite property: <code>true</code> to overwrite destination app; otherwise, - * <code>false</code>. - * - * @return the overwrite value. - */ - public Boolean overwrite() { - return this.overwrite; - } - - /** - * Set the overwrite property: <code>true</code> to overwrite destination app; otherwise, - * <code>false</code>. - * - * @param overwrite the overwrite value to set. - * @return the CloningInfo object itself. - */ - public CloningInfo withOverwrite(Boolean overwrite) { - this.overwrite = overwrite; - return this; - } - - /** - * Get the cloneCustomHostNames property: <code>true</code> to clone custom hostnames from source app; - * otherwise, <code>false</code>. - * - * @return the cloneCustomHostNames value. - */ - public Boolean cloneCustomHostNames() { - return this.cloneCustomHostNames; - } - - /** - * Set the cloneCustomHostNames property: <code>true</code> to clone custom hostnames from source app; - * otherwise, <code>false</code>. - * - * @param cloneCustomHostNames the cloneCustomHostNames value to set. - * @return the CloningInfo object itself. - */ - public CloningInfo withCloneCustomHostNames(Boolean cloneCustomHostNames) { - this.cloneCustomHostNames = cloneCustomHostNames; - return this; - } - - /** - * Get the cloneSourceControl property: <code>true</code> to clone source control from source app; - * otherwise, <code>false</code>. - * - * @return the cloneSourceControl value. - */ - public Boolean cloneSourceControl() { - return this.cloneSourceControl; - } - - /** - * Set the cloneSourceControl property: <code>true</code> to clone source control from source app; - * otherwise, <code>false</code>. - * - * @param cloneSourceControl the cloneSourceControl value to set. - * @return the CloningInfo object itself. - */ - public CloningInfo withCloneSourceControl(Boolean cloneSourceControl) { - this.cloneSourceControl = cloneSourceControl; - return this; - } - - /** - * Get the sourceWebAppId property: ARM resource ID of the source app. App resource ID is of the form - * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} for production - * slots and - * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} - * for other slots. - * - * @return the sourceWebAppId value. - */ - public String sourceWebAppId() { - return this.sourceWebAppId; - } - - /** - * Set the sourceWebAppId property: ARM resource ID of the source app. App resource ID is of the form - * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} for production - * slots and - * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} - * for other slots. - * - * @param sourceWebAppId the sourceWebAppId value to set. - * @return the CloningInfo object itself. - */ - public CloningInfo withSourceWebAppId(String sourceWebAppId) { - this.sourceWebAppId = sourceWebAppId; - return this; - } - - /** - * Get the sourceWebAppLocation property: Location of source app ex: West US or North Europe. - * - * @return the sourceWebAppLocation value. - */ - public String sourceWebAppLocation() { - return this.sourceWebAppLocation; - } - - /** - * Set the sourceWebAppLocation property: Location of source app ex: West US or North Europe. - * - * @param sourceWebAppLocation the sourceWebAppLocation value to set. - * @return the CloningInfo object itself. - */ - public CloningInfo withSourceWebAppLocation(String sourceWebAppLocation) { - this.sourceWebAppLocation = sourceWebAppLocation; - return this; - } - - /** - * Get the hostingEnvironment property: App Service Environment. - * - * @return the hostingEnvironment value. - */ - public String hostingEnvironment() { - return this.hostingEnvironment; - } - - /** - * Set the hostingEnvironment property: App Service Environment. - * - * @param hostingEnvironment the hostingEnvironment value to set. - * @return the CloningInfo object itself. - */ - public CloningInfo withHostingEnvironment(String hostingEnvironment) { - this.hostingEnvironment = hostingEnvironment; - return this; - } - - /** - * Get the appSettingsOverrides property: Application setting overrides for cloned app. If specified, these settings - * override the settings cloned from source app. Otherwise, application settings from source app are retained. - * - * @return the appSettingsOverrides value. - */ - public Map appSettingsOverrides() { - return this.appSettingsOverrides; - } - - /** - * Set the appSettingsOverrides property: Application setting overrides for cloned app. If specified, these settings - * override the settings cloned from source app. Otherwise, application settings from source app are retained. - * - * @param appSettingsOverrides the appSettingsOverrides value to set. - * @return the CloningInfo object itself. - */ - public CloningInfo withAppSettingsOverrides(Map appSettingsOverrides) { - this.appSettingsOverrides = appSettingsOverrides; - return this; - } - - /** - * Get the configureLoadBalancing property: <code>true</code> to configure load balancing for source and - * destination app. - * - * @return the configureLoadBalancing value. - */ - public Boolean configureLoadBalancing() { - return this.configureLoadBalancing; - } - - /** - * Set the configureLoadBalancing property: <code>true</code> to configure load balancing for source and - * destination app. - * - * @param configureLoadBalancing the configureLoadBalancing value to set. - * @return the CloningInfo object itself. - */ - public CloningInfo withConfigureLoadBalancing(Boolean configureLoadBalancing) { - this.configureLoadBalancing = configureLoadBalancing; - return this; - } - - /** - * Get the trafficManagerProfileId property: ARM resource ID of the Traffic Manager profile to use, if it exists. - * Traffic Manager resource ID is of the form - * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{profileName}. - * - * @return the trafficManagerProfileId value. - */ - public String trafficManagerProfileId() { - return this.trafficManagerProfileId; - } - - /** - * Set the trafficManagerProfileId property: ARM resource ID of the Traffic Manager profile to use, if it exists. - * Traffic Manager resource ID is of the form - * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{profileName}. - * - * @param trafficManagerProfileId the trafficManagerProfileId value to set. - * @return the CloningInfo object itself. - */ - public CloningInfo withTrafficManagerProfileId(String trafficManagerProfileId) { - this.trafficManagerProfileId = trafficManagerProfileId; - return this; - } - - /** - * Get the trafficManagerProfileName property: Name of Traffic Manager profile to create. This is only needed if - * Traffic Manager profile does not already exist. - * - * @return the trafficManagerProfileName value. - */ - public String trafficManagerProfileName() { - return this.trafficManagerProfileName; - } - - /** - * Set the trafficManagerProfileName property: Name of Traffic Manager profile to create. This is only needed if - * Traffic Manager profile does not already exist. - * - * @param trafficManagerProfileName the trafficManagerProfileName value to set. - * @return the CloningInfo object itself. - */ - public CloningInfo withTrafficManagerProfileName(String trafficManagerProfileName) { - this.trafficManagerProfileName = trafficManagerProfileName; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (sourceWebAppId() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property sourceWebAppId in model CloningInfo")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ComputeModeOptions.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ComputeModeOptions.java deleted file mode 100644 index e1c22289369e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ComputeModeOptions.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for ComputeModeOptions. */ -public enum ComputeModeOptions { - /** Enum value Shared. */ - SHARED("Shared"), - - /** Enum value Dedicated. */ - DEDICATED("Dedicated"), - - /** Enum value Dynamic. */ - DYNAMIC("Dynamic"); - - /** The actual serialized value for a ComputeModeOptions instance. */ - private final String value; - - ComputeModeOptions(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a ComputeModeOptions instance. - * - * @param value the serialized value to parse. - * @return the parsed ComputeModeOptions object, or null if unable to parse. - */ - @JsonCreator - public static ComputeModeOptions fromString(String value) { - ComputeModeOptions[] items = ComputeModeOptions.values(); - for (ComputeModeOptions item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ConnStringInfo.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ConnStringInfo.java deleted file mode 100644 index a896d0a335a1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ConnStringInfo.java +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Database connection string information. */ -@Fluent -public final class ConnStringInfo { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnStringInfo.class); - - /* - * Name of connection string. - */ - @JsonProperty(value = "name") - private String name; - - /* - * Connection string value. - */ - @JsonProperty(value = "connectionString") - private String connectionString; - - /* - * Type of database. - */ - @JsonProperty(value = "type") - private ConnectionStringType type; - - /** - * Get the name property: Name of connection string. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Name of connection string. - * - * @param name the name value to set. - * @return the ConnStringInfo object itself. - */ - public ConnStringInfo withName(String name) { - this.name = name; - return this; - } - - /** - * Get the connectionString property: Connection string value. - * - * @return the connectionString value. - */ - public String connectionString() { - return this.connectionString; - } - - /** - * Set the connectionString property: Connection string value. - * - * @param connectionString the connectionString value to set. - * @return the ConnStringInfo object itself. - */ - public ConnStringInfo withConnectionString(String connectionString) { - this.connectionString = connectionString; - return this; - } - - /** - * Get the type property: Type of database. - * - * @return the type value. - */ - public ConnectionStringType type() { - return this.type; - } - - /** - * Set the type property: Type of database. - * - * @param type the type value to set. - * @return the ConnStringInfo object itself. - */ - public ConnStringInfo withType(ConnectionStringType type) { - this.type = type; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ConnStringValueTypePair.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ConnStringValueTypePair.java deleted file mode 100644 index d6e18656d693..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ConnStringValueTypePair.java +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Database connection string value to type pair. */ -@Fluent -public final class ConnStringValueTypePair { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnStringValueTypePair.class); - - /* - * Value of pair. - */ - @JsonProperty(value = "value", required = true) - private String value; - - /* - * Type of database. - */ - @JsonProperty(value = "type", required = true) - private ConnectionStringType type; - - /** - * Get the value property: Value of pair. - * - * @return the value value. - */ - public String value() { - return this.value; - } - - /** - * Set the value property: Value of pair. - * - * @param value the value value to set. - * @return the ConnStringValueTypePair object itself. - */ - public ConnStringValueTypePair withValue(String value) { - this.value = value; - return this; - } - - /** - * Get the type property: Type of database. - * - * @return the type value. - */ - public ConnectionStringType type() { - return this.type; - } - - /** - * Set the type property: Type of database. - * - * @param type the type value to set. - * @return the ConnStringValueTypePair object itself. - */ - public ConnStringValueTypePair withType(ConnectionStringType type) { - this.type = type; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model ConnStringValueTypePair")); - } - if (type() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property type in model ConnStringValueTypePair")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ConnectionString.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ConnectionString.java deleted file mode 100644 index 226228074da5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ConnectionString.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; - -/** An immutable client-side representation of a connection string on a web app. */ -@Fluent -public interface ConnectionString { - /** @return the key of the setting */ - String name(); - - /** @return the value of the connection string */ - String value(); - - /** @return the type of the connection string */ - ConnectionStringType type(); - - /** @return if the connection string sticks to the slot during a swap */ - boolean sticky(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ConnectionStringType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ConnectionStringType.java deleted file mode 100644 index 18b5635c0867..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ConnectionStringType.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for ConnectionStringType. */ -public enum ConnectionStringType { - /** Enum value MySql. */ - MY_SQL("MySql"), - - /** Enum value SQLServer. */ - SQLSERVER("SQLServer"), - - /** Enum value SQLAzure. */ - SQLAZURE("SQLAzure"), - - /** Enum value Custom. */ - CUSTOM("Custom"), - - /** Enum value NotificationHub. */ - NOTIFICATION_HUB("NotificationHub"), - - /** Enum value ServiceBus. */ - SERVICE_BUS("ServiceBus"), - - /** Enum value EventHub. */ - EVENT_HUB("EventHub"), - - /** Enum value ApiHub. */ - API_HUB("ApiHub"), - - /** Enum value DocDb. */ - DOC_DB("DocDb"), - - /** Enum value RedisCache. */ - REDIS_CACHE("RedisCache"), - - /** Enum value PostgreSQL. */ - POSTGRE_SQL("PostgreSQL"); - - /** The actual serialized value for a ConnectionStringType instance. */ - private final String value; - - ConnectionStringType(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a ConnectionStringType instance. - * - * @param value the serialized value to parse. - * @return the parsed ConnectionStringType object, or null if unable to parse. - */ - @JsonCreator - public static ConnectionStringType fromString(String value) { - ConnectionStringType[] items = ConnectionStringType.values(); - for (ConnectionStringType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/Contact.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/Contact.java deleted file mode 100644 index 1ac27a7e5580..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/Contact.java +++ /dev/null @@ -1,282 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Contact information for domain registration. If 'Domain Privacy' option is not selected then the contact information - * is made publicly available through the Whois directories as per ICANN requirements. - */ -@Fluent -public final class Contact { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Contact.class); - - /* - * Mailing address. - */ - @JsonProperty(value = "addressMailing") - private Address addressMailing; - - /* - * Email address. - */ - @JsonProperty(value = "email", required = true) - private String email; - - /* - * Fax number. - */ - @JsonProperty(value = "fax") - private String fax; - - /* - * Job title. - */ - @JsonProperty(value = "jobTitle") - private String jobTitle; - - /* - * First name. - */ - @JsonProperty(value = "nameFirst", required = true) - private String nameFirst; - - /* - * Last name. - */ - @JsonProperty(value = "nameLast", required = true) - private String nameLast; - - /* - * Middle name. - */ - @JsonProperty(value = "nameMiddle") - private String nameMiddle; - - /* - * Organization contact belongs to. - */ - @JsonProperty(value = "organization") - private String organization; - - /* - * Phone number. - */ - @JsonProperty(value = "phone", required = true) - private String phone; - - /** - * Get the addressMailing property: Mailing address. - * - * @return the addressMailing value. - */ - public Address addressMailing() { - return this.addressMailing; - } - - /** - * Set the addressMailing property: Mailing address. - * - * @param addressMailing the addressMailing value to set. - * @return the Contact object itself. - */ - public Contact withAddressMailing(Address addressMailing) { - this.addressMailing = addressMailing; - return this; - } - - /** - * Get the email property: Email address. - * - * @return the email value. - */ - public String email() { - return this.email; - } - - /** - * Set the email property: Email address. - * - * @param email the email value to set. - * @return the Contact object itself. - */ - public Contact withEmail(String email) { - this.email = email; - return this; - } - - /** - * Get the fax property: Fax number. - * - * @return the fax value. - */ - public String fax() { - return this.fax; - } - - /** - * Set the fax property: Fax number. - * - * @param fax the fax value to set. - * @return the Contact object itself. - */ - public Contact withFax(String fax) { - this.fax = fax; - return this; - } - - /** - * Get the jobTitle property: Job title. - * - * @return the jobTitle value. - */ - public String jobTitle() { - return this.jobTitle; - } - - /** - * Set the jobTitle property: Job title. - * - * @param jobTitle the jobTitle value to set. - * @return the Contact object itself. - */ - public Contact withJobTitle(String jobTitle) { - this.jobTitle = jobTitle; - return this; - } - - /** - * Get the nameFirst property: First name. - * - * @return the nameFirst value. - */ - public String nameFirst() { - return this.nameFirst; - } - - /** - * Set the nameFirst property: First name. - * - * @param nameFirst the nameFirst value to set. - * @return the Contact object itself. - */ - public Contact withNameFirst(String nameFirst) { - this.nameFirst = nameFirst; - return this; - } - - /** - * Get the nameLast property: Last name. - * - * @return the nameLast value. - */ - public String nameLast() { - return this.nameLast; - } - - /** - * Set the nameLast property: Last name. - * - * @param nameLast the nameLast value to set. - * @return the Contact object itself. - */ - public Contact withNameLast(String nameLast) { - this.nameLast = nameLast; - return this; - } - - /** - * Get the nameMiddle property: Middle name. - * - * @return the nameMiddle value. - */ - public String nameMiddle() { - return this.nameMiddle; - } - - /** - * Set the nameMiddle property: Middle name. - * - * @param nameMiddle the nameMiddle value to set. - * @return the Contact object itself. - */ - public Contact withNameMiddle(String nameMiddle) { - this.nameMiddle = nameMiddle; - return this; - } - - /** - * Get the organization property: Organization contact belongs to. - * - * @return the organization value. - */ - public String organization() { - return this.organization; - } - - /** - * Set the organization property: Organization contact belongs to. - * - * @param organization the organization value to set. - * @return the Contact object itself. - */ - public Contact withOrganization(String organization) { - this.organization = organization; - return this; - } - - /** - * Get the phone property: Phone number. - * - * @return the phone value. - */ - public String phone() { - return this.phone; - } - - /** - * Set the phone property: Phone number. - * - * @param phone the phone value to set. - * @return the Contact object itself. - */ - public Contact withPhone(String phone) { - this.phone = phone; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (addressMailing() != null) { - addressMailing().validate(); - } - if (email() == null) { - throw logger - .logExceptionAsError(new IllegalArgumentException("Missing required property email in model Contact")); - } - if (nameFirst() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property nameFirst in model Contact")); - } - if (nameLast() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property nameLast in model Contact")); - } - if (phone() == null) { - throw logger - .logExceptionAsError(new IllegalArgumentException("Missing required property phone in model Contact")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ContinuousWebJobCollection.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ContinuousWebJobCollection.java deleted file mode 100644 index 5ec44623b6c6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ContinuousWebJobCollection.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.models.ContinuousWebJobInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Collection of Kudu continuous web job information elements. */ -@Fluent -public final class ContinuousWebJobCollection { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ContinuousWebJobCollection.class); - - /* - * Collection of resources. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * Link to next page of resources. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: Collection of resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Collection of resources. - * - * @param value the value value to set. - * @return the ContinuousWebJobCollection object itself. - */ - public ContinuousWebJobCollection withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to next page of resources. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property value in model ContinuousWebJobCollection")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ContinuousWebJobStatus.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ContinuousWebJobStatus.java deleted file mode 100644 index e89e13d0e1b4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ContinuousWebJobStatus.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for ContinuousWebJobStatus. */ -public enum ContinuousWebJobStatus { - /** Enum value Initializing. */ - INITIALIZING("Initializing"), - - /** Enum value Starting. */ - STARTING("Starting"), - - /** Enum value Running. */ - RUNNING("Running"), - - /** Enum value PendingRestart. */ - PENDING_RESTART("PendingRestart"), - - /** Enum value Stopped. */ - STOPPED("Stopped"); - - /** The actual serialized value for a ContinuousWebJobStatus instance. */ - private final String value; - - ContinuousWebJobStatus(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a ContinuousWebJobStatus instance. - * - * @param value the serialized value to parse. - * @return the parsed ContinuousWebJobStatus object, or null if unable to parse. - */ - @JsonCreator - public static ContinuousWebJobStatus fromString(String value) { - ContinuousWebJobStatus[] items = ContinuousWebJobStatus.values(); - for (ContinuousWebJobStatus item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/CorsSettings.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/CorsSettings.java deleted file mode 100644 index 96c195428cc4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/CorsSettings.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Cross-Origin Resource Sharing (CORS) settings for the app. */ -@Fluent -public final class CorsSettings { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CorsSettings.class); - - /* - * Gets or sets the list of origins that should be allowed to make - * cross-origin - * calls (for example: http://example.com:12345). Use "*" to allow all. - */ - @JsonProperty(value = "allowedOrigins") - private List allowedOrigins; - - /* - * Gets or sets whether CORS requests with credentials are allowed. See - * https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials - * for more details. - */ - @JsonProperty(value = "supportCredentials") - private Boolean supportCredentials; - - /** - * Get the allowedOrigins property: Gets or sets the list of origins that should be allowed to make cross-origin - * calls (for example: http://example.com:12345). Use "*" to allow all. - * - * @return the allowedOrigins value. - */ - public List allowedOrigins() { - return this.allowedOrigins; - } - - /** - * Set the allowedOrigins property: Gets or sets the list of origins that should be allowed to make cross-origin - * calls (for example: http://example.com:12345). Use "*" to allow all. - * - * @param allowedOrigins the allowedOrigins value to set. - * @return the CorsSettings object itself. - */ - public CorsSettings withAllowedOrigins(List allowedOrigins) { - this.allowedOrigins = allowedOrigins; - return this; - } - - /** - * Get the supportCredentials property: Gets or sets whether CORS requests with credentials are allowed. See - * https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials for more details. - * - * @return the supportCredentials value. - */ - public Boolean supportCredentials() { - return this.supportCredentials; - } - - /** - * Set the supportCredentials property: Gets or sets whether CORS requests with credentials are allowed. See - * https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials for more details. - * - * @param supportCredentials the supportCredentials value to set. - * @return the CorsSettings object itself. - */ - public CorsSettings withSupportCredentials(Boolean supportCredentials) { - this.supportCredentials = supportCredentials; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/CsmMoveResourceEnvelope.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/CsmMoveResourceEnvelope.java deleted file mode 100644 index 844cb728147b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/CsmMoveResourceEnvelope.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Object with a list of the resources that need to be moved and the resource group they should be moved to. */ -@Fluent -public final class CsmMoveResourceEnvelope { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CsmMoveResourceEnvelope.class); - - /* - * The targetResourceGroup property. - */ - @JsonProperty(value = "targetResourceGroup") - private String targetResourceGroup; - - /* - * The resources property. - */ - @JsonProperty(value = "resources") - private List resources; - - /** - * Get the targetResourceGroup property: The targetResourceGroup property. - * - * @return the targetResourceGroup value. - */ - public String targetResourceGroup() { - return this.targetResourceGroup; - } - - /** - * Set the targetResourceGroup property: The targetResourceGroup property. - * - * @param targetResourceGroup the targetResourceGroup value to set. - * @return the CsmMoveResourceEnvelope object itself. - */ - public CsmMoveResourceEnvelope withTargetResourceGroup(String targetResourceGroup) { - this.targetResourceGroup = targetResourceGroup; - return this; - } - - /** - * Get the resources property: The resources property. - * - * @return the resources value. - */ - public List resources() { - return this.resources; - } - - /** - * Set the resources property: The resources property. - * - * @param resources the resources value to set. - * @return the CsmMoveResourceEnvelope object itself. - */ - public CsmMoveResourceEnvelope withResources(List resources) { - this.resources = resources; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/CsmOperationCollection.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/CsmOperationCollection.java deleted file mode 100644 index f7c6b23b0415..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/CsmOperationCollection.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.models.CsmOperationDescriptionInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Collection of Azure resource manager operation metadata. */ -@Fluent -public final class CsmOperationCollection { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CsmOperationCollection.class); - - /* - * Collection of resources. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * Link to next page of resources. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: Collection of resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Collection of resources. - * - * @param value the value value to set. - * @return the CsmOperationCollection object itself. - */ - public CsmOperationCollection withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to next page of resources. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model CsmOperationCollection")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/CsmOperationDescriptionProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/CsmOperationDescriptionProperties.java deleted file mode 100644 index ab53e2fb8749..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/CsmOperationDescriptionProperties.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Properties available for a Microsoft.Web resource provider operation. */ -@Fluent -public final class CsmOperationDescriptionProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CsmOperationDescriptionProperties.class); - - /* - * Resource metrics service provided by Microsoft.Insights resource - * provider. - */ - @JsonProperty(value = "serviceSpecification") - private ServiceSpecification serviceSpecification; - - /** - * Get the serviceSpecification property: Resource metrics service provided by Microsoft.Insights resource provider. - * - * @return the serviceSpecification value. - */ - public ServiceSpecification serviceSpecification() { - return this.serviceSpecification; - } - - /** - * Set the serviceSpecification property: Resource metrics service provided by Microsoft.Insights resource provider. - * - * @param serviceSpecification the serviceSpecification value to set. - * @return the CsmOperationDescriptionProperties object itself. - */ - public CsmOperationDescriptionProperties withServiceSpecification(ServiceSpecification serviceSpecification) { - this.serviceSpecification = serviceSpecification; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (serviceSpecification() != null) { - serviceSpecification().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/CsmOperationDisplay.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/CsmOperationDisplay.java deleted file mode 100644 index 1c3e23e6da70..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/CsmOperationDisplay.java +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Meta data about operation used for display in portal. */ -@Fluent -public final class CsmOperationDisplay { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CsmOperationDisplay.class); - - /* - * The provider property. - */ - @JsonProperty(value = "provider") - private String provider; - - /* - * The resource property. - */ - @JsonProperty(value = "resource") - private String resource; - - /* - * The operation property. - */ - @JsonProperty(value = "operation") - private String operation; - - /* - * The description property. - */ - @JsonProperty(value = "description") - private String description; - - /** - * Get the provider property: The provider property. - * - * @return the provider value. - */ - public String provider() { - return this.provider; - } - - /** - * Set the provider property: The provider property. - * - * @param provider the provider value to set. - * @return the CsmOperationDisplay object itself. - */ - public CsmOperationDisplay withProvider(String provider) { - this.provider = provider; - return this; - } - - /** - * Get the resource property: The resource property. - * - * @return the resource value. - */ - public String resource() { - return this.resource; - } - - /** - * Set the resource property: The resource property. - * - * @param resource the resource value to set. - * @return the CsmOperationDisplay object itself. - */ - public CsmOperationDisplay withResource(String resource) { - this.resource = resource; - return this; - } - - /** - * Get the operation property: The operation property. - * - * @return the operation value. - */ - public String operation() { - return this.operation; - } - - /** - * Set the operation property: The operation property. - * - * @param operation the operation value to set. - * @return the CsmOperationDisplay object itself. - */ - public CsmOperationDisplay withOperation(String operation) { - this.operation = operation; - return this; - } - - /** - * Get the description property: The description property. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: The description property. - * - * @param description the description value to set. - * @return the CsmOperationDisplay object itself. - */ - public CsmOperationDisplay withDescription(String description) { - this.description = description; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/CsmPublishingProfileOptions.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/CsmPublishingProfileOptions.java deleted file mode 100644 index ffb572bdb7af..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/CsmPublishingProfileOptions.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Publishing options for requested profile. */ -@Fluent -public final class CsmPublishingProfileOptions { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CsmPublishingProfileOptions.class); - - /* - * Name of the format. Valid values are: - * FileZilla3 - * WebDeploy -- default - * Ftp - */ - @JsonProperty(value = "format") - private PublishingProfileFormat format; - - /* - * Include the DisasterRecover endpoint if true - */ - @JsonProperty(value = "includeDisasterRecoveryEndpoints") - private Boolean includeDisasterRecoveryEndpoints; - - /** - * Get the format property: Name of the format. Valid values are: FileZilla3 WebDeploy -- default Ftp. - * - * @return the format value. - */ - public PublishingProfileFormat format() { - return this.format; - } - - /** - * Set the format property: Name of the format. Valid values are: FileZilla3 WebDeploy -- default Ftp. - * - * @param format the format value to set. - * @return the CsmPublishingProfileOptions object itself. - */ - public CsmPublishingProfileOptions withFormat(PublishingProfileFormat format) { - this.format = format; - return this; - } - - /** - * Get the includeDisasterRecoveryEndpoints property: Include the DisasterRecover endpoint if true. - * - * @return the includeDisasterRecoveryEndpoints value. - */ - public Boolean includeDisasterRecoveryEndpoints() { - return this.includeDisasterRecoveryEndpoints; - } - - /** - * Set the includeDisasterRecoveryEndpoints property: Include the DisasterRecover endpoint if true. - * - * @param includeDisasterRecoveryEndpoints the includeDisasterRecoveryEndpoints value to set. - * @return the CsmPublishingProfileOptions object itself. - */ - public CsmPublishingProfileOptions withIncludeDisasterRecoveryEndpoints(Boolean includeDisasterRecoveryEndpoints) { - this.includeDisasterRecoveryEndpoints = includeDisasterRecoveryEndpoints; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/CsmSlotEntity.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/CsmSlotEntity.java deleted file mode 100644 index 9a6cb626e771..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/CsmSlotEntity.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Deployment slot parameters. */ -@Fluent -public final class CsmSlotEntity { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CsmSlotEntity.class); - - /* - * Destination deployment slot during swap operation. - */ - @JsonProperty(value = "targetSlot", required = true) - private String targetSlot; - - /* - * true to preserve Virtual Network to the slot during swap; - * otherwise, false. - */ - @JsonProperty(value = "preserveVnet", required = true) - private boolean preserveVnet; - - /** - * Get the targetSlot property: Destination deployment slot during swap operation. - * - * @return the targetSlot value. - */ - public String targetSlot() { - return this.targetSlot; - } - - /** - * Set the targetSlot property: Destination deployment slot during swap operation. - * - * @param targetSlot the targetSlot value to set. - * @return the CsmSlotEntity object itself. - */ - public CsmSlotEntity withTargetSlot(String targetSlot) { - this.targetSlot = targetSlot; - return this; - } - - /** - * Get the preserveVnet property: <code>true</code> to preserve Virtual Network to the slot during swap; - * otherwise, <code>false</code>. - * - * @return the preserveVnet value. - */ - public boolean preserveVnet() { - return this.preserveVnet; - } - - /** - * Set the preserveVnet property: <code>true</code> to preserve Virtual Network to the slot during swap; - * otherwise, <code>false</code>. - * - * @param preserveVnet the preserveVnet value to set. - * @return the CsmSlotEntity object itself. - */ - public CsmSlotEntity withPreserveVnet(boolean preserveVnet) { - this.preserveVnet = preserveVnet; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (targetSlot() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property targetSlot in model CsmSlotEntity")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/CsmUsageQuotaCollection.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/CsmUsageQuotaCollection.java deleted file mode 100644 index 85f0fa5321a7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/CsmUsageQuotaCollection.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.models.CsmUsageQuotaInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Collection of CSM usage quotas. */ -@Fluent -public final class CsmUsageQuotaCollection { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CsmUsageQuotaCollection.class); - - /* - * Collection of resources. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * Link to next page of resources. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: Collection of resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Collection of resources. - * - * @param value the value value to set. - * @return the CsmUsageQuotaCollection object itself. - */ - public CsmUsageQuotaCollection withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to next page of resources. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model CsmUsageQuotaCollection")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/CustomHostnameDnsRecordType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/CustomHostnameDnsRecordType.java deleted file mode 100644 index 3d029e33cf17..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/CustomHostnameDnsRecordType.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for CustomHostnameDnsRecordType. */ -public enum CustomHostnameDnsRecordType { - /** Enum value CName. */ - CNAME("CName"), - - /** Enum value A. */ - A("A"); - - /** The actual serialized value for a CustomHostnameDnsRecordType instance. */ - private final String value; - - CustomHostnameDnsRecordType(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a CustomHostnameDnsRecordType instance. - * - * @param value the serialized value to parse. - * @return the parsed CustomHostnameDnsRecordType object, or null if unable to parse. - */ - @JsonCreator - public static CustomHostnameDnsRecordType fromString(String value) { - CustomHostnameDnsRecordType[] items = CustomHostnameDnsRecordType.values(); - for (CustomHostnameDnsRecordType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DataSource.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DataSource.java deleted file mode 100644 index e20004a231fb..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DataSource.java +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Class representing data source used by the detectors. */ -@Fluent -public final class DataSource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DataSource.class); - - /* - * Instructions if any for the data source - */ - @JsonProperty(value = "instructions") - private List instructions; - - /* - * Datasource Uri Links - */ - @JsonProperty(value = "dataSourceUri") - private List dataSourceUri; - - /** - * Get the instructions property: Instructions if any for the data source. - * - * @return the instructions value. - */ - public List instructions() { - return this.instructions; - } - - /** - * Set the instructions property: Instructions if any for the data source. - * - * @param instructions the instructions value to set. - * @return the DataSource object itself. - */ - public DataSource withInstructions(List instructions) { - this.instructions = instructions; - return this; - } - - /** - * Get the dataSourceUri property: Datasource Uri Links. - * - * @return the dataSourceUri value. - */ - public List dataSourceUri() { - return this.dataSourceUri; - } - - /** - * Set the dataSourceUri property: Datasource Uri Links. - * - * @param dataSourceUri the dataSourceUri value to set. - * @return the DataSource object itself. - */ - public DataSource withDataSourceUri(List dataSourceUri) { - this.dataSourceUri = dataSourceUri; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (dataSourceUri() != null) { - dataSourceUri().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DataTableResponseColumn.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DataTableResponseColumn.java deleted file mode 100644 index 06cd365ca8dc..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DataTableResponseColumn.java +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Column definition. */ -@Fluent -public final class DataTableResponseColumn { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DataTableResponseColumn.class); - - /* - * Name of the column - */ - @JsonProperty(value = "columnName") - private String columnName; - - /* - * Data type which looks like 'String' or 'Int32'. - */ - @JsonProperty(value = "dataType") - private String dataType; - - /* - * Column Type - */ - @JsonProperty(value = "columnType") - private String columnType; - - /** - * Get the columnName property: Name of the column. - * - * @return the columnName value. - */ - public String columnName() { - return this.columnName; - } - - /** - * Set the columnName property: Name of the column. - * - * @param columnName the columnName value to set. - * @return the DataTableResponseColumn object itself. - */ - public DataTableResponseColumn withColumnName(String columnName) { - this.columnName = columnName; - return this; - } - - /** - * Get the dataType property: Data type which looks like 'String' or 'Int32'. - * - * @return the dataType value. - */ - public String dataType() { - return this.dataType; - } - - /** - * Set the dataType property: Data type which looks like 'String' or 'Int32'. - * - * @param dataType the dataType value to set. - * @return the DataTableResponseColumn object itself. - */ - public DataTableResponseColumn withDataType(String dataType) { - this.dataType = dataType; - return this; - } - - /** - * Get the columnType property: Column Type. - * - * @return the columnType value. - */ - public String columnType() { - return this.columnType; - } - - /** - * Set the columnType property: Column Type. - * - * @param columnType the columnType value to set. - * @return the DataTableResponseColumn object itself. - */ - public DataTableResponseColumn withColumnType(String columnType) { - this.columnType = columnType; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DataTableResponseObject.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DataTableResponseObject.java deleted file mode 100644 index 7025fa98776b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DataTableResponseObject.java +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Data Table which defines columns and raw row values. */ -@Fluent -public final class DataTableResponseObject { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DataTableResponseObject.class); - - /* - * Name of the table - */ - @JsonProperty(value = "tableName") - private String tableName; - - /* - * List of columns with data types - */ - @JsonProperty(value = "columns") - private List columns; - - /* - * Raw row values - */ - @JsonProperty(value = "rows") - private List> rows; - - /** - * Get the tableName property: Name of the table. - * - * @return the tableName value. - */ - public String tableName() { - return this.tableName; - } - - /** - * Set the tableName property: Name of the table. - * - * @param tableName the tableName value to set. - * @return the DataTableResponseObject object itself. - */ - public DataTableResponseObject withTableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * Get the columns property: List of columns with data types. - * - * @return the columns value. - */ - public List columns() { - return this.columns; - } - - /** - * Set the columns property: List of columns with data types. - * - * @param columns the columns value to set. - * @return the DataTableResponseObject object itself. - */ - public DataTableResponseObject withColumns(List columns) { - this.columns = columns; - return this; - } - - /** - * Get the rows property: Raw row values. - * - * @return the rows value. - */ - public List> rows() { - return this.rows; - } - - /** - * Set the rows property: Raw row values. - * - * @param rows the rows value to set. - * @return the DataTableResponseObject object itself. - */ - public DataTableResponseObject withRows(List> rows) { - this.rows = rows; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (columns() != null) { - columns().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DatabaseBackupSetting.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DatabaseBackupSetting.java deleted file mode 100644 index a00876613ecb..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DatabaseBackupSetting.java +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Database backup settings. */ -@Fluent -public final class DatabaseBackupSetting { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DatabaseBackupSetting.class); - - /* - * Database type (e.g. SqlAzure / MySql). - */ - @JsonProperty(value = "databaseType", required = true) - private DatabaseType databaseType; - - /* - * The name property. - */ - @JsonProperty(value = "name") - private String name; - - /* - * Contains a connection string name that is linked to the - * SiteConfig.ConnectionStrings. - * This is used during restore with overwrite connection strings options. - */ - @JsonProperty(value = "connectionStringName") - private String connectionStringName; - - /* - * Contains a connection string to a database which is being backed up or - * restored. If the restore should happen to a new database, the database - * name inside is the new one. - */ - @JsonProperty(value = "connectionString") - private String connectionString; - - /** - * Get the databaseType property: Database type (e.g. SqlAzure / MySql). - * - * @return the databaseType value. - */ - public DatabaseType databaseType() { - return this.databaseType; - } - - /** - * Set the databaseType property: Database type (e.g. SqlAzure / MySql). - * - * @param databaseType the databaseType value to set. - * @return the DatabaseBackupSetting object itself. - */ - public DatabaseBackupSetting withDatabaseType(DatabaseType databaseType) { - this.databaseType = databaseType; - return this; - } - - /** - * Get the name property: The name property. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name property. - * - * @param name the name value to set. - * @return the DatabaseBackupSetting object itself. - */ - public DatabaseBackupSetting withName(String name) { - this.name = name; - return this; - } - - /** - * Get the connectionStringName property: Contains a connection string name that is linked to the - * SiteConfig.ConnectionStrings. This is used during restore with overwrite connection strings options. - * - * @return the connectionStringName value. - */ - public String connectionStringName() { - return this.connectionStringName; - } - - /** - * Set the connectionStringName property: Contains a connection string name that is linked to the - * SiteConfig.ConnectionStrings. This is used during restore with overwrite connection strings options. - * - * @param connectionStringName the connectionStringName value to set. - * @return the DatabaseBackupSetting object itself. - */ - public DatabaseBackupSetting withConnectionStringName(String connectionStringName) { - this.connectionStringName = connectionStringName; - return this; - } - - /** - * Get the connectionString property: Contains a connection string to a database which is being backed up or - * restored. If the restore should happen to a new database, the database name inside is the new one. - * - * @return the connectionString value. - */ - public String connectionString() { - return this.connectionString; - } - - /** - * Set the connectionString property: Contains a connection string to a database which is being backed up or - * restored. If the restore should happen to a new database, the database name inside is the new one. - * - * @param connectionString the connectionString value to set. - * @return the DatabaseBackupSetting object itself. - */ - public DatabaseBackupSetting withConnectionString(String connectionString) { - this.connectionString = connectionString; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (databaseType() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property databaseType in model DatabaseBackupSetting")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DatabaseType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DatabaseType.java deleted file mode 100644 index 38bf2666e3a1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DatabaseType.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for DatabaseType. */ -public final class DatabaseType extends ExpandableStringEnum { - /** Static value SqlAzure for DatabaseType. */ - public static final DatabaseType SQL_AZURE = fromString("SqlAzure"); - - /** Static value MySql for DatabaseType. */ - public static final DatabaseType MY_SQL = fromString("MySql"); - - /** Static value LocalMySql for DatabaseType. */ - public static final DatabaseType LOCAL_MY_SQL = fromString("LocalMySql"); - - /** Static value PostgreSql for DatabaseType. */ - public static final DatabaseType POSTGRE_SQL = fromString("PostgreSql"); - - /** - * Creates or finds a DatabaseType from its string representation. - * - * @param name a name to look for. - * @return the corresponding DatabaseType. - */ - @JsonCreator - public static DatabaseType fromString(String name) { - return fromString(name, DatabaseType.class); - } - - /** @return known DatabaseType values. */ - public static Collection values() { - return values(DatabaseType.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DefaultErrorResponseError.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DefaultErrorResponseError.java deleted file mode 100644 index 541684a954f2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DefaultErrorResponseError.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.exception.ManagementError; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** App Service error response. */ -@Immutable -public final class DefaultErrorResponseError extends ManagementError { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DefaultErrorResponseError.class); - - /* - * More information to debug error. - */ - @JsonProperty(value = "innererror", access = JsonProperty.Access.WRITE_ONLY) - private String innererror; - - /** - * Get the innererror property: More information to debug error. - * - * @return the innererror value. - */ - public String getInnererror() { - return this.innererror; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DefaultErrorResponseErrorException.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DefaultErrorResponseErrorException.java deleted file mode 100644 index c7e58bae8cb2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DefaultErrorResponseErrorException.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.http.HttpResponse; -import com.azure.core.management.exception.ManagementException; - -/** Exception thrown for an invalid response with DefaultErrorResponseError information. */ -public final class DefaultErrorResponseErrorException extends ManagementException { - /** - * Initializes a new instance of the DefaultErrorResponseErrorException class. - * - * @param message the exception message or the response content if a message is not available. - * @param response the HTTP response. - */ - public DefaultErrorResponseErrorException(String message, HttpResponse response) { - super(message, response); - } - - /** - * Initializes a new instance of the DefaultErrorResponseErrorException class. - * - * @param message the exception message or the response content if a message is not available. - * @param response the HTTP response. - * @param value the deserialized response value. - */ - public DefaultErrorResponseErrorException(String message, HttpResponse response, DefaultErrorResponseError value) { - super(message, response, value); - } - - @Override - public DefaultErrorResponseError getValue() { - return (DefaultErrorResponseError) super.getValue(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DeletedAppRestoreRequest.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DeletedAppRestoreRequest.java deleted file mode 100644 index 6516254cc5bc..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DeletedAppRestoreRequest.java +++ /dev/null @@ -1,150 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.models.DeletedAppRestoreRequestProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Details about restoring a deleted app. */ -@Fluent -public final class DeletedAppRestoreRequest extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DeletedAppRestoreRequest.class); - - /* - * DeletedAppRestoreRequest resource specific properties - */ - @JsonProperty(value = "properties") - private DeletedAppRestoreRequestProperties innerProperties; - - /** - * Get the innerProperties property: DeletedAppRestoreRequest resource specific properties. - * - * @return the innerProperties value. - */ - private DeletedAppRestoreRequestProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public DeletedAppRestoreRequest withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the deletedSiteId property: ARM resource ID of the deleted app. Example: - * /subscriptions/{subId}/providers/Microsoft.Web/deletedSites/{deletedSiteId}. - * - * @return the deletedSiteId value. - */ - public String deletedSiteId() { - return this.innerProperties() == null ? null : this.innerProperties().deletedSiteId(); - } - - /** - * Set the deletedSiteId property: ARM resource ID of the deleted app. Example: - * /subscriptions/{subId}/providers/Microsoft.Web/deletedSites/{deletedSiteId}. - * - * @param deletedSiteId the deletedSiteId value to set. - * @return the DeletedAppRestoreRequest object itself. - */ - public DeletedAppRestoreRequest withDeletedSiteId(String deletedSiteId) { - if (this.innerProperties() == null) { - this.innerProperties = new DeletedAppRestoreRequestProperties(); - } - this.innerProperties().withDeletedSiteId(deletedSiteId); - return this; - } - - /** - * Get the recoverConfiguration property: If true, deleted site configuration, in addition to content, will be - * restored. - * - * @return the recoverConfiguration value. - */ - public Boolean recoverConfiguration() { - return this.innerProperties() == null ? null : this.innerProperties().recoverConfiguration(); - } - - /** - * Set the recoverConfiguration property: If true, deleted site configuration, in addition to content, will be - * restored. - * - * @param recoverConfiguration the recoverConfiguration value to set. - * @return the DeletedAppRestoreRequest object itself. - */ - public DeletedAppRestoreRequest withRecoverConfiguration(Boolean recoverConfiguration) { - if (this.innerProperties() == null) { - this.innerProperties = new DeletedAppRestoreRequestProperties(); - } - this.innerProperties().withRecoverConfiguration(recoverConfiguration); - return this; - } - - /** - * Get the snapshotTime property: Point in time to restore the deleted app from, formatted as a DateTime string. If - * unspecified, default value is the time that the app was deleted. - * - * @return the snapshotTime value. - */ - public String snapshotTime() { - return this.innerProperties() == null ? null : this.innerProperties().snapshotTime(); - } - - /** - * Set the snapshotTime property: Point in time to restore the deleted app from, formatted as a DateTime string. If - * unspecified, default value is the time that the app was deleted. - * - * @param snapshotTime the snapshotTime value to set. - * @return the DeletedAppRestoreRequest object itself. - */ - public DeletedAppRestoreRequest withSnapshotTime(String snapshotTime) { - if (this.innerProperties() == null) { - this.innerProperties = new DeletedAppRestoreRequestProperties(); - } - this.innerProperties().withSnapshotTime(snapshotTime); - return this; - } - - /** - * Get the useDRSecondary property: If true, the snapshot is retrieved from DRSecondary endpoint. - * - * @return the useDRSecondary value. - */ - public Boolean useDRSecondary() { - return this.innerProperties() == null ? null : this.innerProperties().useDRSecondary(); - } - - /** - * Set the useDRSecondary property: If true, the snapshot is retrieved from DRSecondary endpoint. - * - * @param useDRSecondary the useDRSecondary value to set. - * @return the DeletedAppRestoreRequest object itself. - */ - public DeletedAppRestoreRequest withUseDRSecondary(Boolean useDRSecondary) { - if (this.innerProperties() == null) { - this.innerProperties = new DeletedAppRestoreRequestProperties(); - } - this.innerProperties().withUseDRSecondary(useDRSecondary); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DeletedWebAppCollection.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DeletedWebAppCollection.java deleted file mode 100644 index 086d93e4d285..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DeletedWebAppCollection.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.models.DeletedSiteInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Collection of deleted apps. */ -@Fluent -public final class DeletedWebAppCollection { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DeletedWebAppCollection.class); - - /* - * Collection of resources. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * Link to next page of resources. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: Collection of resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Collection of resources. - * - * @param value the value value to set. - * @return the DeletedWebAppCollection object itself. - */ - public DeletedWebAppCollection withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to next page of resources. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model DeletedWebAppCollection")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DeployOptions.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DeployOptions.java deleted file mode 100644 index 7b43eba7e9bc..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DeployOptions.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.models; - -/** - * The options for OneDeploy. - */ -public class DeployOptions { - - private String path; - private Boolean restartSite; - private Boolean cleanDeployment; - - /** - * @return the path for deploy - */ - public String path() { - return path; - } - - /** - * Specifies the path for deploy. Some some deploy type, path is required. - * - * @param path the path for deploy - * @return the DeployOptions object - */ - public DeployOptions withPath(String path) { - this.path = path; - return this; - } - - /** - * @return whether to restart site after deployment - */ - public Boolean restartSite() { - return restartSite; - } - - /** - * Specifies whether to restart site after deployment. - * - * By default, any OneDeploy call will restart the site. This behavior can be altered by this option. - * - * @param restartSite whether to restart side after deployment - * @return the DeployOptions object - */ - public DeployOptions withRestartSite(Boolean restartSite) { - this.restartSite = restartSite; - return this; - } - - /** - * @return whether to perform clean deployment - */ - public Boolean cleanDeployment() { - return cleanDeployment; - } - - /** - * Specifies whether to perform clean deployment. - * - * By default {@code type=zip} and {@code type=war&path=webapps/} performs clean deployment. - * All other types of artifacts will be deployed incrementally. - * The default behavior for any artifact type can be changed by this option. - * A clean deployment removes the default directory associated with the type of artifact being deployed. - * - * @param cleanDeployment whether to perform clean deployment - * @return the DeployOptions object - */ - public DeployOptions withCleanDeployment(Boolean cleanDeployment) { - this.cleanDeployment = cleanDeployment; - return this; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DeployType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DeployType.java deleted file mode 100644 index a5d7feffa352..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DeployType.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; - -import java.util.Collection; - -/** - * OneDeploy type. - */ -public class DeployType extends ExpandableStringEnum { - - /** - * Deploy the war file to {@code /home/site/wwwroot/app.war}. - * - * If {@code DeployOptions.path} is provided, {@code path=webapps/} will behave exactly like wardeploy by - * unzipping app to {@code /home/site/wwwroot/webapps/}. - */ - public static final DeployType WAR = fromString("war"); - - /** - * Deploy the jar file to {@code /home/site/wwwroot/app.jar}. - */ - public static final DeployType JAR = fromString("jar"); - - /** - * Deploy the ear file to {@code /home/site/wwwroot/app.ear}. - */ - public static final DeployType EAR = fromString("ear"); - - /** - * Deploy the jar to {@code /home/site/libs}. {@code DeployOptions.path} parameter needs to be specified. - */ - public static final DeployType JAR_LIB = fromString("lib"); - - /** - * Deploy the static file to {@code /home/site/wwwroot/}. - * {@code DeployOptions.path} parameter needs to be specified. - */ - public static final DeployType STATIC = fromString("static"); - - /** - * Deploy the script file to {@code /home/site/scripts/}. - * {@code DeployOptions.path} parameter needs to be specified. - */ - public static final DeployType SCRIPT = fromString("script"); - - /** - * Deploy the script as startup.sh (Linux) or startup.cmd (Windows) to {@code /home/site/scripts/}. - * {@code DeployOptions.path} parameter is not supported. - */ - public static final DeployType SCRIPT_STARTUP = fromString("startup"); - - /** - * unzip the zip to {@code /home/site/wwwroot}. {@code DeployOptions.path} parameter is optional. - */ - public static final DeployType ZIP = fromString("zip"); - - /** - * Creates or finds a DeployType from its string representation. - * @param name a name to look for - * @return the corresponding DeployType - */ - @JsonCreator - public static DeployType fromString(String name) { - return fromString(name, DeployType.class); - } - - /** - * @return known DeployType type values - */ - public static Collection values() { - return values(DeployType.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DeploymentCollection.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DeploymentCollection.java deleted file mode 100644 index 8f0f0debefc4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DeploymentCollection.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.models.DeploymentInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Collection of app deployments. */ -@Fluent -public final class DeploymentCollection { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DeploymentCollection.class); - - /* - * Collection of resources. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * Link to next page of resources. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: Collection of resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Collection of resources. - * - * @param value the value value to set. - * @return the DeploymentCollection object itself. - */ - public DeploymentCollection withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to next page of resources. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model DeploymentCollection")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DeploymentSlot.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DeploymentSlot.java deleted file mode 100644 index 1e522cc6c7ff..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DeploymentSlot.java +++ /dev/null @@ -1,150 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.appservice.AppServiceManager; -import com.azure.resourcemanager.appservice.fluent.models.SiteInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasParent; -import com.azure.resourcemanager.resources.fluentcore.arm.models.IndependentChildResource; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.Updatable; -import java.io.File; -import java.io.InputStream; -import reactor.core.publisher.Mono; - -/** An immutable client-side representation of an Azure Web App deployment slot. */ -@Fluent -public interface DeploymentSlot - extends IndependentChildResource, - WebDeploymentSlotBasic, - SupportsOneDeploy, - DeploymentSlotBase, - Updatable>, - HasParent { - - /** - * Deploys a WAR file onto the Azure specialized Tomcat on this web app. - * - * @param warFile the WAR file to upload - */ - void warDeploy(File warFile); - - /** - * Deploys a WAR file onto the Azure specialized Tomcat on this web app. - * - * @param warFile the WAR file to upload - * @return a completable of the operation - */ - Mono warDeployAsync(File warFile); - - /** - * Deploys a WAR file onto the Azure specialized Tomcat on this web app. - * - * @param warFile the WAR file to upload - * @param length the length of the file - */ - void warDeploy(InputStream warFile, long length); - - /** - * Deploys a WAR file onto the Azure specialized Tomcat on this web app. - * - * @param warFile the WAR file to upload - * @param length the length of the file - * @return a completable of the operation - */ - Mono warDeployAsync(InputStream warFile, long length); - - /** - * Deploys a WAR file onto the Azure specialized Tomcat on this web app. - * - * @param warFile the WAR file to upload - * @param appName the name of the app, default to "ROOT" when not provided - */ - void warDeploy(File warFile, String appName); - - /** - * Deploys a WAR file onto the Azure specialized Tomcat on this web app. - * - * @param warFile the WAR file to upload - * @param appName the name of the app, default to "ROOT" when not provided - * @return a completable of the operation - */ - Mono warDeployAsync(File warFile, String appName); - - /** - * Deploys a WAR file onto the Azure specialized Tomcat on this web app. - * - * @param warFile the WAR file to upload - * @param length the length of the file - * @param appName the name of the app, default to "ROOT" when not provided - */ - void warDeploy(InputStream warFile, long length, String appName); - - /** - * Deploys a WAR file onto the Azure specialized Tomcat on this web app. - * - * @param warFile the WAR file to upload - * @param length the length of the file - * @param appName the name of the app, default to "ROOT" when not provided - * @return a completable of the operation - */ - Mono warDeployAsync(InputStream warFile, long length, String appName); - - /************************************************************** - * Fluent interfaces to provision a deployment slot - **************************************************************/ - - /** Container interface for all the definitions that need to be implemented. */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithConfiguration, DefinitionStages.WithCreate { - } - - /** Grouping of all the deployment slot definition stages. */ - interface DefinitionStages { - /** The first stage of the deployment slot definition. */ - interface Blank extends WithConfiguration { - } - - /** A deployment slot definition allowing the configuration to clone from to be specified. */ - interface WithConfiguration { - /** - * Creates the deployment slot with brand new site configurations. - * - * @return the next stage of the definition - */ - WithCreate withBrandNewConfiguration(); - - /** - * Copies the site configurations from the web app the deployment slot belongs to. - * - * @return the next stage of the definition - */ - WithCreate withConfigurationFromParent(); - - /** - * Copies the site configurations from a given web app. - * - * @param webApp the web app to copy the configurations from - * @return the next stage of the definition - */ - WithCreate withConfigurationFromWebApp(WebApp webApp); - - /** - * Copies the site configurations from a given deployment slot. - * - * @param deploymentSlot the deployment slot to copy the configurations from - * @return the next stage of the definition - */ - WithCreate withConfigurationFromDeploymentSlot(DeploymentSlot deploymentSlot); - } - - /** - * A site definition with sufficient inputs to create a new web app / deployments slot in the cloud, but - * exposing additional optional inputs to specify. - */ - interface WithCreate extends Creatable, WebAppBase.DefinitionStages.WithCreate { - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DeploymentSlotBase.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DeploymentSlotBase.java deleted file mode 100644 index 8becb4aacb64..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DeploymentSlotBase.java +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.resourcemanager.resources.fluentcore.model.Appliable; -import com.azure.resourcemanager.resources.fluentcore.model.Updatable; - -/** - * An immutable client-side representation of an Azure Web App deployment slot. - * - * @param the type of the resource - */ -public interface DeploymentSlotBase extends - WebAppBase, - Updatable> { - - /** - * Grouping of all the deployment slot update stages. - */ - interface UpdateStages { - /** - * A deployment slot update allowing runtime version to be specified. - */ - interface WithRuntimeVersion { - /** - * Specifies the runtime for the function app. - * @param runtime the Azure Functions runtime - * @return the next stage of the definition - */ - Update withRuntime(String runtime); - - /** - * Specifies the runtime version for the function app. - * @param version the version of the Azure Functions runtime - * @return the next stage of the definition - */ - Update withRuntimeVersion(String version); - - /** - * Uses the latest runtime version for the function app. - * @return the next stage of the definition - */ - Update withLatestRuntimeVersion(); - } - - /** - * A deployment slot update allowing docker image source to be specified. - */ - interface WithDockerContainerImage { - /** - * Specifies the docker container image to be one from Docker Hub. - * @param imageAndTag image and optional tag (eg 'image:tag') - * @return the next stage of the web app update - */ - Update withPublicDockerHubImage(String imageAndTag); - - /** - * Specifies the docker container image to be one from Docker Hub. - * @param imageAndTag image and optional tag (eg 'image:tag') - * @return the next stage of the web app update - */ - UpdateStages.WithCredentials withPrivateDockerHubImage(String imageAndTag); - - /** - * Specifies the docker container image to be one from a private registry. - * @param imageAndTag image and optional tag (eg 'image:tag') - * @param serverUrl the URL to the private registry server - * @return the next stage of the web app update - */ - UpdateStages.WithCredentials withPrivateRegistryImage(String imageAndTag, String serverUrl); - } - - /** - * A deployment slot update allowing docker hub credentials to be set. - */ - interface WithCredentials { - /** - * Specifies the username and password for Docker Hub. - * @param username the username for Docker Hub - * @param password the password for Docker Hub - * @return the next stage of the web app update - */ - Update withCredentials(String username, String password); - } - - /** - * A deployment slot update allowing docker startup command to be specified. - * This will replace the "CMD" section in the Dockerfile. - */ - interface WithStartUpCommand { - /** - * Specifies the startup command. - * - * @param startUpCommand startup command to replace "CMD" in Dockerfile - * @return the next stage of the web app update - */ - Update withStartUpCommand(String startUpCommand); - } - } - - /** The template for a web app update operation, containing all the settings that can be modified. */ - interface Update extends - Appliable, - WebAppBase.Update, - UpdateStages.WithRuntimeVersion, - UpdateStages.WithDockerContainerImage, - UpdateStages.WithStartUpCommand, - UpdateStages.WithCredentials { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DeploymentSlots.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DeploymentSlots.java deleted file mode 100644 index 15bb9b330cd6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DeploymentSlots.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.appservice.AppServiceManager; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingByName; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasParent; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsCreating; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingById; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingByName; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; - -/** Entry point for Azure web app deployment slot management API. */ -@Fluent -public interface DeploymentSlots - extends SupportsCreating, - SupportsListing, - SupportsGettingByName, - SupportsGettingById, - SupportsDeletingById, - SupportsDeletingByName, - HasManager, - HasParent { -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DetectorAbnormalTimePeriod.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DetectorAbnormalTimePeriod.java deleted file mode 100644 index f190477eead3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DetectorAbnormalTimePeriod.java +++ /dev/null @@ -1,240 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; - -/** Class representing Abnormal Time Period detected. */ -@Fluent -public final class DetectorAbnormalTimePeriod { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DetectorAbnormalTimePeriod.class); - - /* - * Start time of the correlated event - */ - @JsonProperty(value = "startTime") - private OffsetDateTime startTime; - - /* - * End time of the correlated event - */ - @JsonProperty(value = "endTime") - private OffsetDateTime endTime; - - /* - * Message describing the event - */ - @JsonProperty(value = "message") - private String message; - - /* - * Represents the name of the Detector - */ - @JsonProperty(value = "source") - private String source; - - /* - * Represents the rank of the Detector - */ - @JsonProperty(value = "priority") - private Double priority; - - /* - * Downtime metadata - */ - @JsonProperty(value = "metaData") - private List> metadata; - - /* - * Represents the type of the Detector - */ - @JsonProperty(value = "type") - private IssueType type; - - /* - * List of proposed solutions - */ - @JsonProperty(value = "solutions") - private List solutions; - - /** - * Get the startTime property: Start time of the correlated event. - * - * @return the startTime value. - */ - public OffsetDateTime startTime() { - return this.startTime; - } - - /** - * Set the startTime property: Start time of the correlated event. - * - * @param startTime the startTime value to set. - * @return the DetectorAbnormalTimePeriod object itself. - */ - public DetectorAbnormalTimePeriod withStartTime(OffsetDateTime startTime) { - this.startTime = startTime; - return this; - } - - /** - * Get the endTime property: End time of the correlated event. - * - * @return the endTime value. - */ - public OffsetDateTime endTime() { - return this.endTime; - } - - /** - * Set the endTime property: End time of the correlated event. - * - * @param endTime the endTime value to set. - * @return the DetectorAbnormalTimePeriod object itself. - */ - public DetectorAbnormalTimePeriod withEndTime(OffsetDateTime endTime) { - this.endTime = endTime; - return this; - } - - /** - * Get the message property: Message describing the event. - * - * @return the message value. - */ - public String message() { - return this.message; - } - - /** - * Set the message property: Message describing the event. - * - * @param message the message value to set. - * @return the DetectorAbnormalTimePeriod object itself. - */ - public DetectorAbnormalTimePeriod withMessage(String message) { - this.message = message; - return this; - } - - /** - * Get the source property: Represents the name of the Detector. - * - * @return the source value. - */ - public String source() { - return this.source; - } - - /** - * Set the source property: Represents the name of the Detector. - * - * @param source the source value to set. - * @return the DetectorAbnormalTimePeriod object itself. - */ - public DetectorAbnormalTimePeriod withSource(String source) { - this.source = source; - return this; - } - - /** - * Get the priority property: Represents the rank of the Detector. - * - * @return the priority value. - */ - public Double priority() { - return this.priority; - } - - /** - * Set the priority property: Represents the rank of the Detector. - * - * @param priority the priority value to set. - * @return the DetectorAbnormalTimePeriod object itself. - */ - public DetectorAbnormalTimePeriod withPriority(Double priority) { - this.priority = priority; - return this; - } - - /** - * Get the metadata property: Downtime metadata. - * - * @return the metadata value. - */ - public List> metadata() { - return this.metadata; - } - - /** - * Set the metadata property: Downtime metadata. - * - * @param metadata the metadata value to set. - * @return the DetectorAbnormalTimePeriod object itself. - */ - public DetectorAbnormalTimePeriod withMetadata(List> metadata) { - this.metadata = metadata; - return this; - } - - /** - * Get the type property: Represents the type of the Detector. - * - * @return the type value. - */ - public IssueType type() { - return this.type; - } - - /** - * Set the type property: Represents the type of the Detector. - * - * @param type the type value to set. - * @return the DetectorAbnormalTimePeriod object itself. - */ - public DetectorAbnormalTimePeriod withType(IssueType type) { - this.type = type; - return this; - } - - /** - * Get the solutions property: List of proposed solutions. - * - * @return the solutions value. - */ - public List solutions() { - return this.solutions; - } - - /** - * Set the solutions property: List of proposed solutions. - * - * @param solutions the solutions value to set. - * @return the DetectorAbnormalTimePeriod object itself. - */ - public DetectorAbnormalTimePeriod withSolutions(List solutions) { - this.solutions = solutions; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (metadata() != null) { - metadata().forEach(e -> e.forEach(e1 -> e1.validate())); - } - if (solutions() != null) { - solutions().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DetectorInfo.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DetectorInfo.java deleted file mode 100644 index 391f9ce56df4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DetectorInfo.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Definition of Detector. */ -@Immutable -public final class DetectorInfo { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DetectorInfo.class); - - /* - * Short description of the detector and its purpose - */ - @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) - private String description; - - /* - * Support Category - */ - @JsonProperty(value = "category", access = JsonProperty.Access.WRITE_ONLY) - private String category; - - /* - * Support Sub Category - */ - @JsonProperty(value = "subCategory", access = JsonProperty.Access.WRITE_ONLY) - private String subCategory; - - /* - * Support Topic Id - */ - @JsonProperty(value = "supportTopicId", access = JsonProperty.Access.WRITE_ONLY) - private String supportTopicId; - - /** - * Get the description property: Short description of the detector and its purpose. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Get the category property: Support Category. - * - * @return the category value. - */ - public String category() { - return this.category; - } - - /** - * Get the subCategory property: Support Sub Category. - * - * @return the subCategory value. - */ - public String subCategory() { - return this.subCategory; - } - - /** - * Get the supportTopicId property: Support Topic Id. - * - * @return the supportTopicId value. - */ - public String supportTopicId() { - return this.supportTopicId; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DetectorResponseCollection.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DetectorResponseCollection.java deleted file mode 100644 index 35fde0926639..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DetectorResponseCollection.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.models.DetectorResponseInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Collection of detector responses. */ -@Fluent -public final class DetectorResponseCollection { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DetectorResponseCollection.class); - - /* - * Collection of resources. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * Link to next page of resources. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: Collection of resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Collection of resources. - * - * @param value the value value to set. - * @return the DetectorResponseCollection object itself. - */ - public DetectorResponseCollection withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to next page of resources. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property value in model DetectorResponseCollection")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DiagnosticAnalysisCollection.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DiagnosticAnalysisCollection.java deleted file mode 100644 index fde86615ea6d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DiagnosticAnalysisCollection.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.models.AnalysisDefinitionInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Collection of Diagnostic Analyses. */ -@Fluent -public final class DiagnosticAnalysisCollection { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DiagnosticAnalysisCollection.class); - - /* - * Collection of resources. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * Link to next page of resources. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: Collection of resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Collection of resources. - * - * @param value the value value to set. - * @return the DiagnosticAnalysisCollection object itself. - */ - public DiagnosticAnalysisCollection withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to next page of resources. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property value in model DiagnosticAnalysisCollection")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DiagnosticCategoryCollection.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DiagnosticCategoryCollection.java deleted file mode 100644 index f89685992402..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DiagnosticCategoryCollection.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.models.DiagnosticCategoryInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Collection of Diagnostic Categories. */ -@Fluent -public final class DiagnosticCategoryCollection { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DiagnosticCategoryCollection.class); - - /* - * Collection of resources. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * Link to next page of resources. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: Collection of resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Collection of resources. - * - * @param value the value value to set. - * @return the DiagnosticCategoryCollection object itself. - */ - public DiagnosticCategoryCollection withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to next page of resources. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property value in model DiagnosticCategoryCollection")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DiagnosticData.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DiagnosticData.java deleted file mode 100644 index a699c81c2c33..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DiagnosticData.java +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Set of data with rendering instructions. */ -@Fluent -public final class DiagnosticData { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DiagnosticData.class); - - /* - * Data in table form - */ - @JsonProperty(value = "table") - private DataTableResponseObject table; - - /* - * Properties that describe how the table should be rendered - */ - @JsonProperty(value = "renderingProperties") - private Rendering renderingProperties; - - /** - * Get the table property: Data in table form. - * - * @return the table value. - */ - public DataTableResponseObject table() { - return this.table; - } - - /** - * Set the table property: Data in table form. - * - * @param table the table value to set. - * @return the DiagnosticData object itself. - */ - public DiagnosticData withTable(DataTableResponseObject table) { - this.table = table; - return this; - } - - /** - * Get the renderingProperties property: Properties that describe how the table should be rendered. - * - * @return the renderingProperties value. - */ - public Rendering renderingProperties() { - return this.renderingProperties; - } - - /** - * Set the renderingProperties property: Properties that describe how the table should be rendered. - * - * @param renderingProperties the renderingProperties value to set. - * @return the DiagnosticData object itself. - */ - public DiagnosticData withRenderingProperties(Rendering renderingProperties) { - this.renderingProperties = renderingProperties; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (table() != null) { - table().validate(); - } - if (renderingProperties() != null) { - renderingProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DiagnosticDetectorCollection.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DiagnosticDetectorCollection.java deleted file mode 100644 index 8a42e1818f20..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DiagnosticDetectorCollection.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.models.DetectorDefinitionInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Collection of Diagnostic Detectors. */ -@Fluent -public final class DiagnosticDetectorCollection { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DiagnosticDetectorCollection.class); - - /* - * Collection of resources. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * Link to next page of resources. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: Collection of resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Collection of resources. - * - * @param value the value value to set. - * @return the DiagnosticDetectorCollection object itself. - */ - public DiagnosticDetectorCollection withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to next page of resources. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property value in model DiagnosticDetectorCollection")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DiagnosticMetricSample.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DiagnosticMetricSample.java deleted file mode 100644 index a67889fabe2a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DiagnosticMetricSample.java +++ /dev/null @@ -1,191 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** Class representing Diagnostic Metric. */ -@Fluent -public final class DiagnosticMetricSample { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DiagnosticMetricSample.class); - - /* - * Time at which metric is measured - */ - @JsonProperty(value = "timestamp") - private OffsetDateTime timestamp; - - /* - * Role Instance. Null if this counter is not per instance - * This is returned and should be whichever instance name we desire to be - * returned - * i.e. CPU and Memory return RDWORKERNAME (LargeDed..._IN_0) - * where RDWORKERNAME is Machine name below and RoleInstance name in - * parenthesis - */ - @JsonProperty(value = "roleInstance") - private String roleInstance; - - /* - * Total value of the metric. If multiple measurements are made this will - * have sum of all. - */ - @JsonProperty(value = "total") - private Double total; - - /* - * Maximum of the metric sampled during the time period - */ - @JsonProperty(value = "maximum") - private Double maximum; - - /* - * Minimum of the metric sampled during the time period - */ - @JsonProperty(value = "minimum") - private Double minimum; - - /* - * Whether the values are aggregates across all workers or not - */ - @JsonProperty(value = "isAggregated") - private Boolean isAggregated; - - /** - * Get the timestamp property: Time at which metric is measured. - * - * @return the timestamp value. - */ - public OffsetDateTime timestamp() { - return this.timestamp; - } - - /** - * Set the timestamp property: Time at which metric is measured. - * - * @param timestamp the timestamp value to set. - * @return the DiagnosticMetricSample object itself. - */ - public DiagnosticMetricSample withTimestamp(OffsetDateTime timestamp) { - this.timestamp = timestamp; - return this; - } - - /** - * Get the roleInstance property: Role Instance. Null if this counter is not per instance This is returned and - * should be whichever instance name we desire to be returned i.e. CPU and Memory return RDWORKERNAME - * (LargeDed..._IN_0) where RDWORKERNAME is Machine name below and RoleInstance name in parenthesis. - * - * @return the roleInstance value. - */ - public String roleInstance() { - return this.roleInstance; - } - - /** - * Set the roleInstance property: Role Instance. Null if this counter is not per instance This is returned and - * should be whichever instance name we desire to be returned i.e. CPU and Memory return RDWORKERNAME - * (LargeDed..._IN_0) where RDWORKERNAME is Machine name below and RoleInstance name in parenthesis. - * - * @param roleInstance the roleInstance value to set. - * @return the DiagnosticMetricSample object itself. - */ - public DiagnosticMetricSample withRoleInstance(String roleInstance) { - this.roleInstance = roleInstance; - return this; - } - - /** - * Get the total property: Total value of the metric. If multiple measurements are made this will have sum of all. - * - * @return the total value. - */ - public Double total() { - return this.total; - } - - /** - * Set the total property: Total value of the metric. If multiple measurements are made this will have sum of all. - * - * @param total the total value to set. - * @return the DiagnosticMetricSample object itself. - */ - public DiagnosticMetricSample withTotal(Double total) { - this.total = total; - return this; - } - - /** - * Get the maximum property: Maximum of the metric sampled during the time period. - * - * @return the maximum value. - */ - public Double maximum() { - return this.maximum; - } - - /** - * Set the maximum property: Maximum of the metric sampled during the time period. - * - * @param maximum the maximum value to set. - * @return the DiagnosticMetricSample object itself. - */ - public DiagnosticMetricSample withMaximum(Double maximum) { - this.maximum = maximum; - return this; - } - - /** - * Get the minimum property: Minimum of the metric sampled during the time period. - * - * @return the minimum value. - */ - public Double minimum() { - return this.minimum; - } - - /** - * Set the minimum property: Minimum of the metric sampled during the time period. - * - * @param minimum the minimum value to set. - * @return the DiagnosticMetricSample object itself. - */ - public DiagnosticMetricSample withMinimum(Double minimum) { - this.minimum = minimum; - return this; - } - - /** - * Get the isAggregated property: Whether the values are aggregates across all workers or not. - * - * @return the isAggregated value. - */ - public Boolean isAggregated() { - return this.isAggregated; - } - - /** - * Set the isAggregated property: Whether the values are aggregates across all workers or not. - * - * @param isAggregated the isAggregated value to set. - * @return the DiagnosticMetricSample object itself. - */ - public DiagnosticMetricSample withIsAggregated(Boolean isAggregated) { - this.isAggregated = isAggregated; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DiagnosticMetricSet.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DiagnosticMetricSet.java deleted file mode 100644 index faa4d05b0bdf..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DiagnosticMetricSet.java +++ /dev/null @@ -1,188 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; - -/** Class representing Diagnostic Metric information. */ -@Fluent -public final class DiagnosticMetricSet { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DiagnosticMetricSet.class); - - /* - * Name of the metric - */ - @JsonProperty(value = "name") - private String name; - - /* - * Metric's unit - */ - @JsonProperty(value = "unit") - private String unit; - - /* - * Start time of the period - */ - @JsonProperty(value = "startTime") - private OffsetDateTime startTime; - - /* - * End time of the period - */ - @JsonProperty(value = "endTime") - private OffsetDateTime endTime; - - /* - * Presented time grain. Supported grains at the moment are PT1M, PT1H, P1D - */ - @JsonProperty(value = "timeGrain") - private String timeGrain; - - /* - * Collection of metric values for the selected period based on the - * {Microsoft.Web.Hosting.Administration.DiagnosticMetricSet.TimeGrain} - */ - @JsonProperty(value = "values") - private List values; - - /** - * Get the name property: Name of the metric. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Name of the metric. - * - * @param name the name value to set. - * @return the DiagnosticMetricSet object itself. - */ - public DiagnosticMetricSet withName(String name) { - this.name = name; - return this; - } - - /** - * Get the unit property: Metric's unit. - * - * @return the unit value. - */ - public String unit() { - return this.unit; - } - - /** - * Set the unit property: Metric's unit. - * - * @param unit the unit value to set. - * @return the DiagnosticMetricSet object itself. - */ - public DiagnosticMetricSet withUnit(String unit) { - this.unit = unit; - return this; - } - - /** - * Get the startTime property: Start time of the period. - * - * @return the startTime value. - */ - public OffsetDateTime startTime() { - return this.startTime; - } - - /** - * Set the startTime property: Start time of the period. - * - * @param startTime the startTime value to set. - * @return the DiagnosticMetricSet object itself. - */ - public DiagnosticMetricSet withStartTime(OffsetDateTime startTime) { - this.startTime = startTime; - return this; - } - - /** - * Get the endTime property: End time of the period. - * - * @return the endTime value. - */ - public OffsetDateTime endTime() { - return this.endTime; - } - - /** - * Set the endTime property: End time of the period. - * - * @param endTime the endTime value to set. - * @return the DiagnosticMetricSet object itself. - */ - public DiagnosticMetricSet withEndTime(OffsetDateTime endTime) { - this.endTime = endTime; - return this; - } - - /** - * Get the timeGrain property: Presented time grain. Supported grains at the moment are PT1M, PT1H, P1D. - * - * @return the timeGrain value. - */ - public String timeGrain() { - return this.timeGrain; - } - - /** - * Set the timeGrain property: Presented time grain. Supported grains at the moment are PT1M, PT1H, P1D. - * - * @param timeGrain the timeGrain value to set. - * @return the DiagnosticMetricSet object itself. - */ - public DiagnosticMetricSet withTimeGrain(String timeGrain) { - this.timeGrain = timeGrain; - return this; - } - - /** - * Get the values property: Collection of metric values for the selected period based on the - * {Microsoft.Web.Hosting.Administration.DiagnosticMetricSet.TimeGrain}. - * - * @return the values value. - */ - public List values() { - return this.values; - } - - /** - * Set the values property: Collection of metric values for the selected period based on the - * {Microsoft.Web.Hosting.Administration.DiagnosticMetricSet.TimeGrain}. - * - * @param values the values value to set. - * @return the DiagnosticMetricSet object itself. - */ - public DiagnosticMetricSet withValues(List values) { - this.values = values; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (values() != null) { - values().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/Dimension.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/Dimension.java deleted file mode 100644 index ecf7d15d9b93..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/Dimension.java +++ /dev/null @@ -1,131 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Dimension of a resource metric. For e.g. instance specific HTTP requests for a web app, where instance name is - * dimension of the metric HTTP request. - */ -@Fluent -public final class Dimension { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Dimension.class); - - /* - * The name property. - */ - @JsonProperty(value = "name") - private String name; - - /* - * The displayName property. - */ - @JsonProperty(value = "displayName") - private String displayName; - - /* - * The internalName property. - */ - @JsonProperty(value = "internalName") - private String internalName; - - /* - * The toBeExportedForShoebox property. - */ - @JsonProperty(value = "toBeExportedForShoebox") - private Boolean toBeExportedForShoebox; - - /** - * Get the name property: The name property. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name property. - * - * @param name the name value to set. - * @return the Dimension object itself. - */ - public Dimension withName(String name) { - this.name = name; - return this; - } - - /** - * Get the displayName property: The displayName property. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Set the displayName property: The displayName property. - * - * @param displayName the displayName value to set. - * @return the Dimension object itself. - */ - public Dimension withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - - /** - * Get the internalName property: The internalName property. - * - * @return the internalName value. - */ - public String internalName() { - return this.internalName; - } - - /** - * Set the internalName property: The internalName property. - * - * @param internalName the internalName value to set. - * @return the Dimension object itself. - */ - public Dimension withInternalName(String internalName) { - this.internalName = internalName; - return this; - } - - /** - * Get the toBeExportedForShoebox property: The toBeExportedForShoebox property. - * - * @return the toBeExportedForShoebox value. - */ - public Boolean toBeExportedForShoebox() { - return this.toBeExportedForShoebox; - } - - /** - * Set the toBeExportedForShoebox property: The toBeExportedForShoebox property. - * - * @param toBeExportedForShoebox the toBeExportedForShoebox value to set. - * @return the Dimension object itself. - */ - public Dimension withToBeExportedForShoebox(Boolean toBeExportedForShoebox) { - this.toBeExportedForShoebox = toBeExportedForShoebox; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DnsType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DnsType.java deleted file mode 100644 index cef9622bcd54..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DnsType.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for DnsType. */ -public enum DnsType { - /** Enum value AzureDns. */ - AZURE_DNS("AzureDns"), - - /** Enum value DefaultDomainRegistrarDns. */ - DEFAULT_DOMAIN_REGISTRAR_DNS("DefaultDomainRegistrarDns"); - - /** The actual serialized value for a DnsType instance. */ - private final String value; - - DnsType(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a DnsType instance. - * - * @param value the serialized value to parse. - * @return the parsed DnsType object, or null if unable to parse. - */ - @JsonCreator - public static DnsType fromString(String value) { - DnsType[] items = DnsType.values(); - for (DnsType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DnsVerificationTestResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DnsVerificationTestResult.java deleted file mode 100644 index 8fb03318c023..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DnsVerificationTestResult.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for DnsVerificationTestResult. */ -public enum DnsVerificationTestResult { - /** Enum value Passed. */ - PASSED("Passed"), - - /** Enum value Failed. */ - FAILED("Failed"), - - /** Enum value Skipped. */ - SKIPPED("Skipped"); - - /** The actual serialized value for a DnsVerificationTestResult instance. */ - private final String value; - - DnsVerificationTestResult(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a DnsVerificationTestResult instance. - * - * @param value the serialized value to parse. - * @return the parsed DnsVerificationTestResult object, or null if unable to parse. - */ - @JsonCreator - public static DnsVerificationTestResult fromString(String value) { - DnsVerificationTestResult[] items = DnsVerificationTestResult.values(); - for (DnsVerificationTestResult item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DomainCollection.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DomainCollection.java deleted file mode 100644 index 957b17767a65..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DomainCollection.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.models.DomainInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Collection of domains. */ -@Fluent -public final class DomainCollection { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DomainCollection.class); - - /* - * Collection of resources. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * Link to next page of resources. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: Collection of resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Collection of resources. - * - * @param value the value value to set. - * @return the DomainCollection object itself. - */ - public DomainCollection withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to next page of resources. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model DomainCollection")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DomainContact.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DomainContact.java deleted file mode 100644 index 83af45366ee9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DomainContact.java +++ /dev/null @@ -1,318 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.arm.CountryIsoCode; -import com.azure.resourcemanager.resources.fluentcore.arm.CountryPhoneCode; -import com.azure.resourcemanager.resources.fluentcore.arm.models.ChildResource; -import com.azure.resourcemanager.resources.fluentcore.model.Attachable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; - -/** A domain contact definition. */ -@Fluent -public interface DomainContact extends HasInnerModel, ChildResource { - - /** @return contact's mailing address */ - Address addressMailing(); - - /** @return contact's email address */ - String email(); - - /** @return contact's fax number */ - String fax(); - - /** @return contact's job title */ - String jobTitle(); - - /** @return contact's first name */ - String firstName(); - - /** @return contact's last name */ - String lastName(); - - /** @return contact's middle name */ - String middleName(); - - /** @return contact's organization */ - String organization(); - - /** @return contact's phone number */ - String phone(); - - /** - * The entirety of a domain contact definition. - * - * @param the return type of the final {@link Attachable#attach()} - */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithFirstName, - DefinitionStages.WithMiddleName, - DefinitionStages.WithAddressLine1, - DefinitionStages.WithAddressLine2, - DefinitionStages.WithCity, - DefinitionStages.WithStateOrProvince, - DefinitionStages.WithCountry, - DefinitionStages.WithPostalCode, - DefinitionStages.WithEmail, - DefinitionStages.WithPhoneCountryCode, - DefinitionStages.WithPhoneNumber, - DefinitionStages.WithAttach { - } - - /** Grouping of domain contact stages applicable as part of a domain creation. */ - interface DefinitionStages { - /** - * The first stage of a domain contact definition. - * - * @param the stage of the parent definition to return to after attaching - */ - interface Blank extends WithFirstName { - } - - /** - * The stage of contact definition allowing first name to be set. - * - * @param the stage of the parent definition to return to after attaching - */ - interface WithFirstName { - /** - * Specifies the first name. - * - * @param firstName the first name - * @return the next stage of the definition - */ - WithMiddleName withFirstName(String firstName); - } - - /** - * The stage of contact definition allowing middle name to be set. - * - * @param the stage of the parent definition to return to after attaching - */ - interface WithMiddleName extends WithLastName { - /** - * Specifies the middle name. - * - * @param middleName the middle name - * @return the next stage of the definition - */ - WithLastName withMiddleName(String middleName); - } - - /** - * The stage of contact definition allowing last name to be set. - * - * @param the stage of the parent definition to return to after attaching - */ - interface WithLastName { - /** - * Specifies the last name. - * - * @param lastName the last name - * @return the next stage of the definition - */ - WithEmail withLastName(String lastName); - } - - /** - * The stage of contact definition allowing email to be set. - * - * @param the stage of the parent definition to return to after attaching - */ - interface WithEmail { - /** - * Specifies the email. - * - * @param email contact's email address - * @return the next stage of the definition - */ - WithAddressLine1 withEmail(String email); - } - - /** - * The stage of contact definition allowing 1st line of address to be set. - * - * @param the stage of the parent definition to return to after attaching - */ - interface WithAddressLine1 { - /** - * Specifies the 1st line of the address. - * - * @param addressLine1 the 1st line of the address - * @return the next stage of the definition - */ - WithAddressLine2 withAddressLine1(String addressLine1); - } - - /** - * The stage of contact definition allowing 2nd line of address to be set. - * - * @param the stage of the parent definition to return to after attaching - */ - interface WithAddressLine2 extends WithCity { - /** - * Specifies the 2nd line of the address. - * - * @param addressLine2 the 2nd line of the address - * @return the next stage of the definition - */ - WithCity withAddressLine2(String addressLine2); - } - - /** - * The stage of contact definition allowing city to be set. - * - * @param the stage of the parent definition to return to after attaching - */ - interface WithCity { - /** - * Specifies the city of the address. - * - * @param city the city of the address - * @return the next stage of the definition - */ - WithStateOrProvince withCity(String city); - } - - /** - * The stage of contact definition allowing state/province to be set. - * - * @param the stage of the parent definition to return to after attaching - */ - interface WithStateOrProvince { - /** - * Specifies the state or province of the address. - * - * @param stateOrProvince the state or province of the address - * @return the next stage of the definition - */ - WithCountry withStateOrProvince(String stateOrProvince); - } - - /** - * The stage of contact definition allowing country to be set. - * - * @param the stage of the parent definition to return to after attaching - */ - interface WithCountry { - /** - * Specifies the country of the address. - * - * @param country the country of the address - * @return the next stage of the definition - */ - WithPostalCode withCountry(CountryIsoCode country); - } - - /** - * The stage of contact definition allowing postal/zip code to be set. - * - * @param the stage of the parent definition to return to after attaching - */ - interface WithPostalCode { - /** - * Specifies the postal code or zip code of the address. - * - * @param postalCode the postal code of the address - * @return the next stage of the definition - */ - WithPhoneCountryCode withPostalCode(String postalCode); - } - - /** - * The stage of contact definition allowing phone country code to be set. - * - * @param the stage of the parent definition to return to after attaching - */ - interface WithPhoneCountryCode { - /** - * Specifies the country code of the phone number. - * - * @param code the country code - * @return the next stage of the definition - */ - WithPhoneNumber withPhoneCountryCode(CountryPhoneCode code); - } - - /** - * The stage of contact definition allowing phone number to be set. - * - * @param the stage of the parent definition to return to after attaching - */ - interface WithPhoneNumber { - /** - * Specifies the phone number. - * - * @param phoneNumber phone number - * @return the next stage of the definition - */ - WithAttach withPhoneNumber(String phoneNumber); - } - - /** - * The stage of contact definition allowing fax number to be set. - * - * @param the stage of the parent definition to return to after attaching - */ - interface WithFaxNumber { - /** - * Specifies the fax number. - * - * @param faxNumber the fax number - * @return the next stage of the definition - */ - WithAttach withFaxNumber(String faxNumber); - } - - /** - * The stage of contact definition allowing organization to be set. - * - * @param the stage of the parent definition to return to after attaching - */ - interface WithOrganization { - /** - * Specifies the organization. - * - * @param organziation the organization - * @return the next stage of the definition - */ - WithAttach withOrganization(String organziation); - } - - /** - * The stage of contact definition allowing job title to be set. - * - * @param the stage of the parent definition to return to after attaching - */ - interface WithJobTitle { - /** - * Specifies the job title. - * - * @param jobTitle the job title - * @return the next stage of the definition - */ - WithAttach withJobTitle(String jobTitle); - } - - /** - * The final stage of the domain contact definition. - * - *

At this stage, any remaining optional settings can be specified, or the domain contact definition can be - * attached to the parent domain definition using {@link WithAttach#attach()}. - * - * @param the return type of {@link WithAttach#attach()} - */ - interface WithAttach - extends Attachable.InDefinition, - DefinitionStages.WithOrganization, - DefinitionStages.WithJobTitle, - DefinitionStages.WithFaxNumber { - /** - * @return the contact - */ - Contact build(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DomainLegalAgreement.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DomainLegalAgreement.java deleted file mode 100644 index 2c29e4338020..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DomainLegalAgreement.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.appservice.fluent.models.TldLegalAgreementInner; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; - -/** An immutable client-side representation of an Azure domain legal agreement. */ -@Fluent -public interface DomainLegalAgreement extends HasInnerModel { - /** @return unique identifier for the agreement */ - String agreementKey(); - - /** @return agreement title */ - String title(); - - /** @return agreement details */ - String content(); - - /** @return url where a copy of the agreement details is hosted */ - String url(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DomainOwnershipIdentifierCollection.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DomainOwnershipIdentifierCollection.java deleted file mode 100644 index 7923e778ee1d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DomainOwnershipIdentifierCollection.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.models.DomainOwnershipIdentifierInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Collection of domain ownership identifiers. */ -@Fluent -public final class DomainOwnershipIdentifierCollection { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DomainOwnershipIdentifierCollection.class); - - /* - * Collection of resources. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * Link to next page of resources. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: Collection of resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Collection of resources. - * - * @param value the value value to set. - * @return the DomainOwnershipIdentifierCollection object itself. - */ - public DomainOwnershipIdentifierCollection withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to next page of resources. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property value in model DomainOwnershipIdentifierCollection")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DomainPatchResource.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DomainPatchResource.java deleted file mode 100644 index 8b52de2da0f8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DomainPatchResource.java +++ /dev/null @@ -1,394 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.models.DomainPatchResourceProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; - -/** ARM resource for a domain. */ -@Fluent -public final class DomainPatchResource extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DomainPatchResource.class); - - /* - * DomainPatchResource resource specific properties - */ - @JsonProperty(value = "properties") - private DomainPatchResourceProperties innerProperties; - - /** - * Get the innerProperties property: DomainPatchResource resource specific properties. - * - * @return the innerProperties value. - */ - private DomainPatchResourceProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public DomainPatchResource withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the contactAdmin property: Administrative contact. - * - * @return the contactAdmin value. - */ - public Contact contactAdmin() { - return this.innerProperties() == null ? null : this.innerProperties().contactAdmin(); - } - - /** - * Set the contactAdmin property: Administrative contact. - * - * @param contactAdmin the contactAdmin value to set. - * @return the DomainPatchResource object itself. - */ - public DomainPatchResource withContactAdmin(Contact contactAdmin) { - if (this.innerProperties() == null) { - this.innerProperties = new DomainPatchResourceProperties(); - } - this.innerProperties().withContactAdmin(contactAdmin); - return this; - } - - /** - * Get the contactBilling property: Billing contact. - * - * @return the contactBilling value. - */ - public Contact contactBilling() { - return this.innerProperties() == null ? null : this.innerProperties().contactBilling(); - } - - /** - * Set the contactBilling property: Billing contact. - * - * @param contactBilling the contactBilling value to set. - * @return the DomainPatchResource object itself. - */ - public DomainPatchResource withContactBilling(Contact contactBilling) { - if (this.innerProperties() == null) { - this.innerProperties = new DomainPatchResourceProperties(); - } - this.innerProperties().withContactBilling(contactBilling); - return this; - } - - /** - * Get the contactRegistrant property: Registrant contact. - * - * @return the contactRegistrant value. - */ - public Contact contactRegistrant() { - return this.innerProperties() == null ? null : this.innerProperties().contactRegistrant(); - } - - /** - * Set the contactRegistrant property: Registrant contact. - * - * @param contactRegistrant the contactRegistrant value to set. - * @return the DomainPatchResource object itself. - */ - public DomainPatchResource withContactRegistrant(Contact contactRegistrant) { - if (this.innerProperties() == null) { - this.innerProperties = new DomainPatchResourceProperties(); - } - this.innerProperties().withContactRegistrant(contactRegistrant); - return this; - } - - /** - * Get the contactTech property: Technical contact. - * - * @return the contactTech value. - */ - public Contact contactTech() { - return this.innerProperties() == null ? null : this.innerProperties().contactTech(); - } - - /** - * Set the contactTech property: Technical contact. - * - * @param contactTech the contactTech value to set. - * @return the DomainPatchResource object itself. - */ - public DomainPatchResource withContactTech(Contact contactTech) { - if (this.innerProperties() == null) { - this.innerProperties = new DomainPatchResourceProperties(); - } - this.innerProperties().withContactTech(contactTech); - return this; - } - - /** - * Get the registrationStatus property: Domain registration status. - * - * @return the registrationStatus value. - */ - public DomainStatus registrationStatus() { - return this.innerProperties() == null ? null : this.innerProperties().registrationStatus(); - } - - /** - * Get the provisioningState property: Domain provisioning state. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the nameServers property: Name servers. - * - * @return the nameServers value. - */ - public List nameServers() { - return this.innerProperties() == null ? null : this.innerProperties().nameServers(); - } - - /** - * Get the privacy property: <code>true</code> if domain privacy is enabled for this domain; otherwise, - * <code>false</code>. - * - * @return the privacy value. - */ - public Boolean privacy() { - return this.innerProperties() == null ? null : this.innerProperties().privacy(); - } - - /** - * Set the privacy property: <code>true</code> if domain privacy is enabled for this domain; otherwise, - * <code>false</code>. - * - * @param privacy the privacy value to set. - * @return the DomainPatchResource object itself. - */ - public DomainPatchResource withPrivacy(Boolean privacy) { - if (this.innerProperties() == null) { - this.innerProperties = new DomainPatchResourceProperties(); - } - this.innerProperties().withPrivacy(privacy); - return this; - } - - /** - * Get the createdTime property: Domain creation timestamp. - * - * @return the createdTime value. - */ - public OffsetDateTime createdTime() { - return this.innerProperties() == null ? null : this.innerProperties().createdTime(); - } - - /** - * Get the expirationTime property: Domain expiration timestamp. - * - * @return the expirationTime value. - */ - public OffsetDateTime expirationTime() { - return this.innerProperties() == null ? null : this.innerProperties().expirationTime(); - } - - /** - * Get the lastRenewedTime property: Timestamp when the domain was renewed last time. - * - * @return the lastRenewedTime value. - */ - public OffsetDateTime lastRenewedTime() { - return this.innerProperties() == null ? null : this.innerProperties().lastRenewedTime(); - } - - /** - * Get the autoRenew property: <code>true</code> if the domain should be automatically renewed; - * otherwise, <code>false</code>. - * - * @return the autoRenew value. - */ - public Boolean autoRenew() { - return this.innerProperties() == null ? null : this.innerProperties().autoRenew(); - } - - /** - * Set the autoRenew property: <code>true</code> if the domain should be automatically renewed; - * otherwise, <code>false</code>. - * - * @param autoRenew the autoRenew value to set. - * @return the DomainPatchResource object itself. - */ - public DomainPatchResource withAutoRenew(Boolean autoRenew) { - if (this.innerProperties() == null) { - this.innerProperties = new DomainPatchResourceProperties(); - } - this.innerProperties().withAutoRenew(autoRenew); - return this; - } - - /** - * Get the readyForDnsRecordManagement property: <code>true</code> if Azure can assign this domain to - * App Service apps; otherwise, <code>false</code>. This value will be <code>true</code> if - * domain registration status is active and it is hosted on name servers Azure has programmatic access to. - * - * @return the readyForDnsRecordManagement value. - */ - public Boolean readyForDnsRecordManagement() { - return this.innerProperties() == null ? null : this.innerProperties().readyForDnsRecordManagement(); - } - - /** - * Get the managedHostNames property: All hostnames derived from the domain and assigned to Azure resources. - * - * @return the managedHostNames value. - */ - public List managedHostNames() { - return this.innerProperties() == null ? null : this.innerProperties().managedHostNames(); - } - - /** - * Get the consent property: Legal agreement consent. - * - * @return the consent value. - */ - public DomainPurchaseConsent consent() { - return this.innerProperties() == null ? null : this.innerProperties().consent(); - } - - /** - * Set the consent property: Legal agreement consent. - * - * @param consent the consent value to set. - * @return the DomainPatchResource object itself. - */ - public DomainPatchResource withConsent(DomainPurchaseConsent consent) { - if (this.innerProperties() == null) { - this.innerProperties = new DomainPatchResourceProperties(); - } - this.innerProperties().withConsent(consent); - return this; - } - - /** - * Get the domainNotRenewableReasons property: Reasons why domain is not renewable. - * - * @return the domainNotRenewableReasons value. - */ - public List domainNotRenewableReasons() { - return this.innerProperties() == null ? null : this.innerProperties().domainNotRenewableReasons(); - } - - /** - * Get the dnsType property: Current DNS type. - * - * @return the dnsType value. - */ - public DnsType dnsType() { - return this.innerProperties() == null ? null : this.innerProperties().dnsType(); - } - - /** - * Set the dnsType property: Current DNS type. - * - * @param dnsType the dnsType value to set. - * @return the DomainPatchResource object itself. - */ - public DomainPatchResource withDnsType(DnsType dnsType) { - if (this.innerProperties() == null) { - this.innerProperties = new DomainPatchResourceProperties(); - } - this.innerProperties().withDnsType(dnsType); - return this; - } - - /** - * Get the dnsZoneId property: Azure DNS Zone to use. - * - * @return the dnsZoneId value. - */ - public String dnsZoneId() { - return this.innerProperties() == null ? null : this.innerProperties().dnsZoneId(); - } - - /** - * Set the dnsZoneId property: Azure DNS Zone to use. - * - * @param dnsZoneId the dnsZoneId value to set. - * @return the DomainPatchResource object itself. - */ - public DomainPatchResource withDnsZoneId(String dnsZoneId) { - if (this.innerProperties() == null) { - this.innerProperties = new DomainPatchResourceProperties(); - } - this.innerProperties().withDnsZoneId(dnsZoneId); - return this; - } - - /** - * Get the targetDnsType property: Target DNS type (would be used for migration). - * - * @return the targetDnsType value. - */ - public DnsType targetDnsType() { - return this.innerProperties() == null ? null : this.innerProperties().targetDnsType(); - } - - /** - * Set the targetDnsType property: Target DNS type (would be used for migration). - * - * @param targetDnsType the targetDnsType value to set. - * @return the DomainPatchResource object itself. - */ - public DomainPatchResource withTargetDnsType(DnsType targetDnsType) { - if (this.innerProperties() == null) { - this.innerProperties = new DomainPatchResourceProperties(); - } - this.innerProperties().withTargetDnsType(targetDnsType); - return this; - } - - /** - * Get the authCode property: The authCode property. - * - * @return the authCode value. - */ - public String authCode() { - return this.innerProperties() == null ? null : this.innerProperties().authCode(); - } - - /** - * Set the authCode property: The authCode property. - * - * @param authCode the authCode value to set. - * @return the DomainPatchResource object itself. - */ - public DomainPatchResource withAuthCode(String authCode) { - if (this.innerProperties() == null) { - this.innerProperties = new DomainPatchResourceProperties(); - } - this.innerProperties().withAuthCode(authCode); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DomainPatchResourcePropertiesDomainNotRenewableReasonsItem.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DomainPatchResourcePropertiesDomainNotRenewableReasonsItem.java deleted file mode 100644 index 4c962cb437c8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DomainPatchResourcePropertiesDomainNotRenewableReasonsItem.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for DomainPatchResourcePropertiesDomainNotRenewableReasonsItem. */ -public final class DomainPatchResourcePropertiesDomainNotRenewableReasonsItem - extends ExpandableStringEnum { - /** - * Static value RegistrationStatusNotSupportedForRenewal for - * DomainPatchResourcePropertiesDomainNotRenewableReasonsItem. - */ - public static final DomainPatchResourcePropertiesDomainNotRenewableReasonsItem - REGISTRATION_STATUS_NOT_SUPPORTED_FOR_RENEWAL = fromString("RegistrationStatusNotSupportedForRenewal"); - - /** Static value ExpirationNotInRenewalTimeRange for DomainPatchResourcePropertiesDomainNotRenewableReasonsItem. */ - public static final DomainPatchResourcePropertiesDomainNotRenewableReasonsItem - EXPIRATION_NOT_IN_RENEWAL_TIME_RANGE = fromString("ExpirationNotInRenewalTimeRange"); - - /** Static value SubscriptionNotActive for DomainPatchResourcePropertiesDomainNotRenewableReasonsItem. */ - public static final DomainPatchResourcePropertiesDomainNotRenewableReasonsItem SUBSCRIPTION_NOT_ACTIVE = - fromString("SubscriptionNotActive"); - - /** - * Creates or finds a DomainPatchResourcePropertiesDomainNotRenewableReasonsItem from its string representation. - * - * @param name a name to look for. - * @return the corresponding DomainPatchResourcePropertiesDomainNotRenewableReasonsItem. - */ - @JsonCreator - public static DomainPatchResourcePropertiesDomainNotRenewableReasonsItem fromString(String name) { - return fromString(name, DomainPatchResourcePropertiesDomainNotRenewableReasonsItem.class); - } - - /** @return known DomainPatchResourcePropertiesDomainNotRenewableReasonsItem values. */ - public static Collection values() { - return values(DomainPatchResourcePropertiesDomainNotRenewableReasonsItem.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DomainPropertiesDomainNotRenewableReasonsItem.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DomainPropertiesDomainNotRenewableReasonsItem.java deleted file mode 100644 index aa27c350d0b8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DomainPropertiesDomainNotRenewableReasonsItem.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for DomainPropertiesDomainNotRenewableReasonsItem. */ -public final class DomainPropertiesDomainNotRenewableReasonsItem - extends ExpandableStringEnum { - /** Static value RegistrationStatusNotSupportedForRenewal for DomainPropertiesDomainNotRenewableReasonsItem. */ - public static final DomainPropertiesDomainNotRenewableReasonsItem REGISTRATION_STATUS_NOT_SUPPORTED_FOR_RENEWAL = - fromString("RegistrationStatusNotSupportedForRenewal"); - - /** Static value ExpirationNotInRenewalTimeRange for DomainPropertiesDomainNotRenewableReasonsItem. */ - public static final DomainPropertiesDomainNotRenewableReasonsItem EXPIRATION_NOT_IN_RENEWAL_TIME_RANGE = - fromString("ExpirationNotInRenewalTimeRange"); - - /** Static value SubscriptionNotActive for DomainPropertiesDomainNotRenewableReasonsItem. */ - public static final DomainPropertiesDomainNotRenewableReasonsItem SUBSCRIPTION_NOT_ACTIVE = - fromString("SubscriptionNotActive"); - - /** - * Creates or finds a DomainPropertiesDomainNotRenewableReasonsItem from its string representation. - * - * @param name a name to look for. - * @return the corresponding DomainPropertiesDomainNotRenewableReasonsItem. - */ - @JsonCreator - public static DomainPropertiesDomainNotRenewableReasonsItem fromString(String name) { - return fromString(name, DomainPropertiesDomainNotRenewableReasonsItem.class); - } - - /** @return known DomainPropertiesDomainNotRenewableReasonsItem values. */ - public static Collection values() { - return values(DomainPropertiesDomainNotRenewableReasonsItem.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DomainPurchaseConsent.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DomainPurchaseConsent.java deleted file mode 100644 index 95cc78c6213d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DomainPurchaseConsent.java +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; - -/** Domain purchase consent object, representing acceptance of applicable legal agreements. */ -@Fluent -public final class DomainPurchaseConsent { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DomainPurchaseConsent.class); - - /* - * List of applicable legal agreement keys. This list can be retrieved - * using ListLegalAgreements API under TopLevelDomain - * resource. - */ - @JsonProperty(value = "agreementKeys") - private List agreementKeys; - - /* - * Client IP address. - */ - @JsonProperty(value = "agreedBy") - private String agreedBy; - - /* - * Timestamp when the agreements were accepted. - */ - @JsonProperty(value = "agreedAt") - private OffsetDateTime agreedAt; - - /** - * Get the agreementKeys property: List of applicable legal agreement keys. This list can be retrieved using - * ListLegalAgreements API under <code>TopLevelDomain</code> resource. - * - * @return the agreementKeys value. - */ - public List agreementKeys() { - return this.agreementKeys; - } - - /** - * Set the agreementKeys property: List of applicable legal agreement keys. This list can be retrieved using - * ListLegalAgreements API under <code>TopLevelDomain</code> resource. - * - * @param agreementKeys the agreementKeys value to set. - * @return the DomainPurchaseConsent object itself. - */ - public DomainPurchaseConsent withAgreementKeys(List agreementKeys) { - this.agreementKeys = agreementKeys; - return this; - } - - /** - * Get the agreedBy property: Client IP address. - * - * @return the agreedBy value. - */ - public String agreedBy() { - return this.agreedBy; - } - - /** - * Set the agreedBy property: Client IP address. - * - * @param agreedBy the agreedBy value to set. - * @return the DomainPurchaseConsent object itself. - */ - public DomainPurchaseConsent withAgreedBy(String agreedBy) { - this.agreedBy = agreedBy; - return this; - } - - /** - * Get the agreedAt property: Timestamp when the agreements were accepted. - * - * @return the agreedAt value. - */ - public OffsetDateTime agreedAt() { - return this.agreedAt; - } - - /** - * Set the agreedAt property: Timestamp when the agreements were accepted. - * - * @param agreedAt the agreedAt value to set. - * @return the DomainPurchaseConsent object itself. - */ - public DomainPurchaseConsent withAgreedAt(OffsetDateTime agreedAt) { - this.agreedAt = agreedAt; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DomainRecommendationSearchParameters.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DomainRecommendationSearchParameters.java deleted file mode 100644 index d08fab4f1b04..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DomainRecommendationSearchParameters.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Domain recommendation search parameters. */ -@Fluent -public final class DomainRecommendationSearchParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DomainRecommendationSearchParameters.class); - - /* - * Keywords to be used for generating domain recommendations. - */ - @JsonProperty(value = "keywords") - private String keywords; - - /* - * Maximum number of recommendations. - */ - @JsonProperty(value = "maxDomainRecommendations") - private Integer maxDomainRecommendations; - - /** - * Get the keywords property: Keywords to be used for generating domain recommendations. - * - * @return the keywords value. - */ - public String keywords() { - return this.keywords; - } - - /** - * Set the keywords property: Keywords to be used for generating domain recommendations. - * - * @param keywords the keywords value to set. - * @return the DomainRecommendationSearchParameters object itself. - */ - public DomainRecommendationSearchParameters withKeywords(String keywords) { - this.keywords = keywords; - return this; - } - - /** - * Get the maxDomainRecommendations property: Maximum number of recommendations. - * - * @return the maxDomainRecommendations value. - */ - public Integer maxDomainRecommendations() { - return this.maxDomainRecommendations; - } - - /** - * Set the maxDomainRecommendations property: Maximum number of recommendations. - * - * @param maxDomainRecommendations the maxDomainRecommendations value to set. - * @return the DomainRecommendationSearchParameters object itself. - */ - public DomainRecommendationSearchParameters withMaxDomainRecommendations(Integer maxDomainRecommendations) { - this.maxDomainRecommendations = maxDomainRecommendations; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DomainStatus.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DomainStatus.java deleted file mode 100644 index b337889cfda3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DomainStatus.java +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for DomainStatus. */ -public enum DomainStatus { - /** Enum value Active. */ - ACTIVE("Active"), - - /** Enum value Awaiting. */ - AWAITING("Awaiting"), - - /** Enum value Cancelled. */ - CANCELLED("Cancelled"), - - /** Enum value Confiscated. */ - CONFISCATED("Confiscated"), - - /** Enum value Disabled. */ - DISABLED("Disabled"), - - /** Enum value Excluded. */ - EXCLUDED("Excluded"), - - /** Enum value Expired. */ - EXPIRED("Expired"), - - /** Enum value Failed. */ - FAILED("Failed"), - - /** Enum value Held. */ - HELD("Held"), - - /** Enum value Locked. */ - LOCKED("Locked"), - - /** Enum value Parked. */ - PARKED("Parked"), - - /** Enum value Pending. */ - PENDING("Pending"), - - /** Enum value Reserved. */ - RESERVED("Reserved"), - - /** Enum value Reverted. */ - REVERTED("Reverted"), - - /** Enum value Suspended. */ - SUSPENDED("Suspended"), - - /** Enum value Transferred. */ - TRANSFERRED("Transferred"), - - /** Enum value Unknown. */ - UNKNOWN("Unknown"), - - /** Enum value Unlocked. */ - UNLOCKED("Unlocked"), - - /** Enum value Unparked. */ - UNPARKED("Unparked"), - - /** Enum value Updated. */ - UPDATED("Updated"), - - /** Enum value JsonConverterFailed. */ - JSON_CONVERTER_FAILED("JsonConverterFailed"); - - /** The actual serialized value for a DomainStatus instance. */ - private final String value; - - DomainStatus(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a DomainStatus instance. - * - * @param value the serialized value to parse. - * @return the parsed DomainStatus object, or null if unable to parse. - */ - @JsonCreator - public static DomainStatus fromString(String value) { - DomainStatus[] items = DomainStatus.values(); - for (DomainStatus item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DomainType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DomainType.java deleted file mode 100644 index a8867bc83d73..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DomainType.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for DomainType. */ -public enum DomainType { - /** Enum value Regular. */ - REGULAR("Regular"), - - /** Enum value SoftDeleted. */ - SOFT_DELETED("SoftDeleted"); - - /** The actual serialized value for a DomainType instance. */ - private final String value; - - DomainType(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a DomainType instance. - * - * @param value the serialized value to parse. - * @return the parsed DomainType object, or null if unable to parse. - */ - @JsonCreator - public static DomainType fromString(String value) { - DomainType[] items = DomainType.values(); - for (DomainType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/EnabledConfig.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/EnabledConfig.java deleted file mode 100644 index dc6e7e17a310..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/EnabledConfig.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Enabled configuration. */ -@Fluent -public final class EnabledConfig { - @JsonIgnore private final ClientLogger logger = new ClientLogger(EnabledConfig.class); - - /* - * True if configuration is enabled, false if it is disabled and null if - * configuration is not set. - */ - @JsonProperty(value = "enabled") - private Boolean enabled; - - /** - * Get the enabled property: True if configuration is enabled, false if it is disabled and null if configuration is - * not set. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: True if configuration is enabled, false if it is disabled and null if configuration is - * not set. - * - * @param enabled the enabled value to set. - * @return the EnabledConfig object itself. - */ - public EnabledConfig withEnabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/EndpointDependency.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/EndpointDependency.java deleted file mode 100644 index 711df0fa229c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/EndpointDependency.java +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** A domain name that a service is reached at, including details of the current connection status. */ -@Fluent -public final class EndpointDependency { - @JsonIgnore private final ClientLogger logger = new ClientLogger(EndpointDependency.class); - - /* - * The domain name of the dependency. - */ - @JsonProperty(value = "domainName") - private String domainName; - - /* - * The IP Addresses and Ports used when connecting to DomainName. - */ - @JsonProperty(value = "endpointDetails") - private List endpointDetails; - - /** - * Get the domainName property: The domain name of the dependency. - * - * @return the domainName value. - */ - public String domainName() { - return this.domainName; - } - - /** - * Set the domainName property: The domain name of the dependency. - * - * @param domainName the domainName value to set. - * @return the EndpointDependency object itself. - */ - public EndpointDependency withDomainName(String domainName) { - this.domainName = domainName; - return this; - } - - /** - * Get the endpointDetails property: The IP Addresses and Ports used when connecting to DomainName. - * - * @return the endpointDetails value. - */ - public List endpointDetails() { - return this.endpointDetails; - } - - /** - * Set the endpointDetails property: The IP Addresses and Ports used when connecting to DomainName. - * - * @param endpointDetails the endpointDetails value to set. - * @return the EndpointDependency object itself. - */ - public EndpointDependency withEndpointDetails(List endpointDetails) { - this.endpointDetails = endpointDetails; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (endpointDetails() != null) { - endpointDetails().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/EndpointDetail.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/EndpointDetail.java deleted file mode 100644 index 5df1ba6d95c1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/EndpointDetail.java +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Current TCP connectivity information from the App Service Environment to a single endpoint. */ -@Fluent -public final class EndpointDetail { - @JsonIgnore private final ClientLogger logger = new ClientLogger(EndpointDetail.class); - - /* - * An IP Address that Domain Name currently resolves to. - */ - @JsonProperty(value = "ipAddress") - private String ipAddress; - - /* - * The port an endpoint is connected to. - */ - @JsonProperty(value = "port") - private Integer port; - - /* - * The time in milliseconds it takes for a TCP connection to be created - * from the App Service Environment to this IpAddress at this Port. - */ - @JsonProperty(value = "latency") - private Double latency; - - /* - * Whether it is possible to create a TCP connection from the App Service - * Environment to this IpAddress at this Port. - */ - @JsonProperty(value = "isAccessable") - private Boolean isAccessable; - - /** - * Get the ipAddress property: An IP Address that Domain Name currently resolves to. - * - * @return the ipAddress value. - */ - public String ipAddress() { - return this.ipAddress; - } - - /** - * Set the ipAddress property: An IP Address that Domain Name currently resolves to. - * - * @param ipAddress the ipAddress value to set. - * @return the EndpointDetail object itself. - */ - public EndpointDetail withIpAddress(String ipAddress) { - this.ipAddress = ipAddress; - return this; - } - - /** - * Get the port property: The port an endpoint is connected to. - * - * @return the port value. - */ - public Integer port() { - return this.port; - } - - /** - * Set the port property: The port an endpoint is connected to. - * - * @param port the port value to set. - * @return the EndpointDetail object itself. - */ - public EndpointDetail withPort(Integer port) { - this.port = port; - return this; - } - - /** - * Get the latency property: The time in milliseconds it takes for a TCP connection to be created from the App - * Service Environment to this IpAddress at this Port. - * - * @return the latency value. - */ - public Double latency() { - return this.latency; - } - - /** - * Set the latency property: The time in milliseconds it takes for a TCP connection to be created from the App - * Service Environment to this IpAddress at this Port. - * - * @param latency the latency value to set. - * @return the EndpointDetail object itself. - */ - public EndpointDetail withLatency(Double latency) { - this.latency = latency; - return this; - } - - /** - * Get the isAccessable property: Whether it is possible to create a TCP connection from the App Service Environment - * to this IpAddress at this Port. - * - * @return the isAccessable value. - */ - public Boolean isAccessable() { - return this.isAccessable; - } - - /** - * Set the isAccessable property: Whether it is possible to create a TCP connection from the App Service Environment - * to this IpAddress at this Port. - * - * @param isAccessable the isAccessable value to set. - * @return the EndpointDetail object itself. - */ - public EndpointDetail withIsAccessable(Boolean isAccessable) { - this.isAccessable = isAccessable; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ErrorEntity.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ErrorEntity.java deleted file mode 100644 index 1b0346b92fad..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ErrorEntity.java +++ /dev/null @@ -1,184 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Body of the error response returned from the API. */ -@Fluent -public final class ErrorEntity { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ErrorEntity.class); - - /* - * Type of error. - */ - @JsonProperty(value = "extendedCode") - private String extendedCode; - - /* - * Message template. - */ - @JsonProperty(value = "messageTemplate") - private String messageTemplate; - - /* - * Parameters for the template. - */ - @JsonProperty(value = "parameters") - private List parameters; - - /* - * Inner errors. - */ - @JsonProperty(value = "innerErrors") - private List innerErrors; - - /* - * Basic error code. - */ - @JsonProperty(value = "code") - private String code; - - /* - * Any details of the error. - */ - @JsonProperty(value = "message") - private String message; - - /** - * Get the extendedCode property: Type of error. - * - * @return the extendedCode value. - */ - public String extendedCode() { - return this.extendedCode; - } - - /** - * Set the extendedCode property: Type of error. - * - * @param extendedCode the extendedCode value to set. - * @return the ErrorEntity object itself. - */ - public ErrorEntity withExtendedCode(String extendedCode) { - this.extendedCode = extendedCode; - return this; - } - - /** - * Get the messageTemplate property: Message template. - * - * @return the messageTemplate value. - */ - public String messageTemplate() { - return this.messageTemplate; - } - - /** - * Set the messageTemplate property: Message template. - * - * @param messageTemplate the messageTemplate value to set. - * @return the ErrorEntity object itself. - */ - public ErrorEntity withMessageTemplate(String messageTemplate) { - this.messageTemplate = messageTemplate; - return this; - } - - /** - * Get the parameters property: Parameters for the template. - * - * @return the parameters value. - */ - public List parameters() { - return this.parameters; - } - - /** - * Set the parameters property: Parameters for the template. - * - * @param parameters the parameters value to set. - * @return the ErrorEntity object itself. - */ - public ErrorEntity withParameters(List parameters) { - this.parameters = parameters; - return this; - } - - /** - * Get the innerErrors property: Inner errors. - * - * @return the innerErrors value. - */ - public List innerErrors() { - return this.innerErrors; - } - - /** - * Set the innerErrors property: Inner errors. - * - * @param innerErrors the innerErrors value to set. - * @return the ErrorEntity object itself. - */ - public ErrorEntity withInnerErrors(List innerErrors) { - this.innerErrors = innerErrors; - return this; - } - - /** - * Get the code property: Basic error code. - * - * @return the code value. - */ - public String code() { - return this.code; - } - - /** - * Set the code property: Basic error code. - * - * @param code the code value to set. - * @return the ErrorEntity object itself. - */ - public ErrorEntity withCode(String code) { - this.code = code; - return this; - } - - /** - * Get the message property: Any details of the error. - * - * @return the message value. - */ - public String message() { - return this.message; - } - - /** - * Set the message property: Any details of the error. - * - * @param message the message value to set. - * @return the ErrorEntity object itself. - */ - public ErrorEntity withMessage(String message) { - this.message = message; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerErrors() != null) { - innerErrors().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/Experiments.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/Experiments.java deleted file mode 100644 index 5b4717b321dd..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/Experiments.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Routing rules in production experiments. */ -@Fluent -public final class Experiments { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Experiments.class); - - /* - * List of ramp-up rules. - */ - @JsonProperty(value = "rampUpRules") - private List rampUpRules; - - /** - * Get the rampUpRules property: List of ramp-up rules. - * - * @return the rampUpRules value. - */ - public List rampUpRules() { - return this.rampUpRules; - } - - /** - * Set the rampUpRules property: List of ramp-up rules. - * - * @param rampUpRules the rampUpRules value to set. - * @return the Experiments object itself. - */ - public Experiments withRampUpRules(List rampUpRules) { - this.rampUpRules = rampUpRules; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (rampUpRules() != null) { - rampUpRules().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/FileSystemApplicationLogsConfig.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/FileSystemApplicationLogsConfig.java deleted file mode 100644 index eab6b627e60d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/FileSystemApplicationLogsConfig.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Application logs to file system configuration. */ -@Fluent -public final class FileSystemApplicationLogsConfig { - @JsonIgnore private final ClientLogger logger = new ClientLogger(FileSystemApplicationLogsConfig.class); - - /* - * Log level. - */ - @JsonProperty(value = "level") - private LogLevel level; - - /** - * Get the level property: Log level. - * - * @return the level value. - */ - public LogLevel level() { - return this.level; - } - - /** - * Set the level property: Log level. - * - * @param level the level value to set. - * @return the FileSystemApplicationLogsConfig object itself. - */ - public FileSystemApplicationLogsConfig withLevel(LogLevel level) { - this.level = level; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/FileSystemHttpLogsConfig.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/FileSystemHttpLogsConfig.java deleted file mode 100644 index 9ed71898834a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/FileSystemHttpLogsConfig.java +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Http logs to file system configuration. */ -@Fluent -public final class FileSystemHttpLogsConfig { - @JsonIgnore private final ClientLogger logger = new ClientLogger(FileSystemHttpLogsConfig.class); - - /* - * Maximum size in megabytes that http log files can use. - * When reached old log files will be removed to make space for new ones. - * Value can range between 25 and 100. - */ - @JsonProperty(value = "retentionInMb") - private Integer retentionInMb; - - /* - * Retention in days. - * Remove files older than X days. - * 0 or lower means no retention. - */ - @JsonProperty(value = "retentionInDays") - private Integer retentionInDays; - - /* - * True if configuration is enabled, false if it is disabled and null if - * configuration is not set. - */ - @JsonProperty(value = "enabled") - private Boolean enabled; - - /** - * Get the retentionInMb property: Maximum size in megabytes that http log files can use. When reached old log files - * will be removed to make space for new ones. Value can range between 25 and 100. - * - * @return the retentionInMb value. - */ - public Integer retentionInMb() { - return this.retentionInMb; - } - - /** - * Set the retentionInMb property: Maximum size in megabytes that http log files can use. When reached old log files - * will be removed to make space for new ones. Value can range between 25 and 100. - * - * @param retentionInMb the retentionInMb value to set. - * @return the FileSystemHttpLogsConfig object itself. - */ - public FileSystemHttpLogsConfig withRetentionInMb(Integer retentionInMb) { - this.retentionInMb = retentionInMb; - return this; - } - - /** - * Get the retentionInDays property: Retention in days. Remove files older than X days. 0 or lower means no - * retention. - * - * @return the retentionInDays value. - */ - public Integer retentionInDays() { - return this.retentionInDays; - } - - /** - * Set the retentionInDays property: Retention in days. Remove files older than X days. 0 or lower means no - * retention. - * - * @param retentionInDays the retentionInDays value to set. - * @return the FileSystemHttpLogsConfig object itself. - */ - public FileSystemHttpLogsConfig withRetentionInDays(Integer retentionInDays) { - this.retentionInDays = retentionInDays; - return this; - } - - /** - * Get the enabled property: True if configuration is enabled, false if it is disabled and null if configuration is - * not set. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: True if configuration is enabled, false if it is disabled and null if configuration is - * not set. - * - * @param enabled the enabled value to set. - * @return the FileSystemHttpLogsConfig object itself. - */ - public FileSystemHttpLogsConfig withEnabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/FrequencyUnit.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/FrequencyUnit.java deleted file mode 100644 index c342cbd5853b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/FrequencyUnit.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for FrequencyUnit. */ -public enum FrequencyUnit { - /** Enum value Day. */ - DAY("Day"), - - /** Enum value Hour. */ - HOUR("Hour"); - - /** The actual serialized value for a FrequencyUnit instance. */ - private final String value; - - FrequencyUnit(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a FrequencyUnit instance. - * - * @param value the serialized value to parse. - * @return the parsed FrequencyUnit object, or null if unable to parse. - */ - @JsonCreator - public static FrequencyUnit fromString(String value) { - FrequencyUnit[] items = FrequencyUnit.values(); - for (FrequencyUnit item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/FtpsState.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/FtpsState.java deleted file mode 100644 index 8fc20a69da82..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/FtpsState.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for FtpsState. */ -public final class FtpsState extends ExpandableStringEnum { - /** Static value AllAllowed for FtpsState. */ - public static final FtpsState ALL_ALLOWED = fromString("AllAllowed"); - - /** Static value FtpsOnly for FtpsState. */ - public static final FtpsState FTPS_ONLY = fromString("FtpsOnly"); - - /** Static value Disabled for FtpsState. */ - public static final FtpsState DISABLED = fromString("Disabled"); - - /** - * Creates or finds a FtpsState from its string representation. - * - * @param name a name to look for. - * @return the corresponding FtpsState. - */ - @JsonCreator - public static FtpsState fromString(String name) { - return fromString(name, FtpsState.class); - } - - /** @return known FtpsState values. */ - public static Collection values() { - return values(FtpsState.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/FunctionApp.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/FunctionApp.java deleted file mode 100644 index a1dfcc182b12..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/FunctionApp.java +++ /dev/null @@ -1,737 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.resources.models.ResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.models.GroupableResource; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.Updatable; -import com.azure.resourcemanager.storage.models.StorageAccount; -import com.azure.resourcemanager.storage.models.StorageAccountSkuType; -import java.util.Map; -import reactor.core.publisher.Mono; - -/** An immutable client-side representation of an Azure Function App. */ -@Fluent -public interface FunctionApp extends FunctionAppBasic, WebAppBase, Updatable { - - /** @return the entry point to deployment slot management API under the function app */ - FunctionDeploymentSlots deploymentSlots(); - - /** @return the storage account associated with the function app */ - StorageAccount storageAccount(); - - /** @return the master key for the function app */ - String getMasterKey(); - - /** @return the master key for the function app */ - Mono getMasterKeyAsync(); - - /** - * List function information elements. - * - * @return list of function information elements - */ - PagedIterable listFunctions(); - - /** - * Retrieve the function key for a specific function. - * - * @param functionName the name of the function - * @return the function key - */ - Map listFunctionKeys(String functionName); - - /** - * Retrieve the function key for a specific function. - * - * @param functionName the name of the function - * @return the function key - */ - Mono> listFunctionKeysAsync(String functionName); - - /** - * Adds a key to a function in this function app. - * - * @param functionName the name of the function - * @param keyName the name of the key to add - * @param keyValue optional. If not provided, a value will be generated. - * @return the added function key - */ - NameValuePair addFunctionKey(String functionName, String keyName, String keyValue); - - /** - * Adds a key to a function in this function app. - * - * @param functionName the name of the function - * @param keyName the name of the key to add - * @param keyValue optional. If not provided, a value will be generated. - * @return the added function key - */ - Mono addFunctionKeyAsync(String functionName, String keyName, String keyValue); - - /** - * Removes a key to a function in this function app. - * - * @param functionName the name of the function - * @param keyName the name of the key to remove - */ - void removeFunctionKey(String functionName, String keyName); - - /** - * Removes a key to a function in this function app. - * - * @param functionName the name of the function - * @param keyName the name of the key to remove - * @return the completable of the operation - */ - Mono removeFunctionKeyAsync(String functionName, String keyName); - - /** - * Triggers a function. - * - * @param functionName the name of the function - * @param payload the payload to be serialized to JSON - */ - void triggerFunction(String functionName, Object payload); - - /** - * Triggers a function. - * - * @param functionName the name of the function - * @param payload the payload to be serialized to JSON - * @return the completable of the operation - */ - Mono triggerFunctionAsync(String functionName, Object payload); - - /** Syncs the triggers on the function app. */ - void syncTriggers(); - - /** - * Syncs the triggers on the function app. - * - * @return a completable for the operation - */ - Mono syncTriggersAsync(); - - /************************************************************** - * Fluent interfaces to provision a Function App - **************************************************************/ - - /** Container interface for all the definitions that need to be implemented. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.ExistingAppServicePlanWithGroup, - DefinitionStages.WithStorageAccount, - DefinitionStages.WithDockerContainerImage, - DefinitionStages.WithCredentials, - DefinitionStages.WithCreate { - } - - /** Grouping of all the function app definition stages. */ - interface DefinitionStages { - /** The first stage of the function app definition. */ - interface Blank extends DefinitionWithRegion { - /** - * Uses an existing Windows app service plan for the function app. - * - * @param appServicePlan the existing app service plan - * @return the next stage of the definition - */ - ExistingAppServicePlanWithGroup withExistingAppServicePlan(AppServicePlan appServicePlan); - - /** - * Uses an existing Linux app service plan for the function app. - * - * @param appServicePlan the existing app service plan - * @return the next stage of the definition - */ - ExistingLinuxPlanWithGroup withExistingLinuxAppServicePlan(AppServicePlan appServicePlan); - } - - /** - * A function app definition allowing resource group to be specified when an existing app service plan is used. - */ - interface ExistingAppServicePlanWithGroup extends GroupableResource.DefinitionStages.WithGroup { - } - - /** - * A function app definition allowing resource group to be specified when a new app service plan is to be - * created. - */ - interface NewAppServicePlanWithGroup { - /** - * Associates the resource with an existing resource group. - * - * @param groupName the name of an existing resource group to put this resource in. - * @return the next stage of the definition - */ - WithCreate withExistingResourceGroup(String groupName); - - /** - * Associates the resource with an existing resource group. - * - * @param group an existing resource group to put the resource in - * @return the next stage of the definition - */ - WithCreate withExistingResourceGroup(ResourceGroup group); - - /** - * Creates a new resource group to put the resource in. - * - *

The group will be created in the same location as the resource. - * - * @param name the name of the new group - * @return the next stage of the definition - */ - WithCreate withNewResourceGroup(String name); - - /** - * Creates a new resource group to put the resource in. - * - *

The group will be created in the same location as the resource. The group's name is automatically - * derived from the resource's name. - * - * @return the next stage of the definition - */ - WithCreate withNewResourceGroup(); - - /** - * Creates a new resource group to put the resource in, based on the definition specified. - * - * @param groupDefinition a creatable definition for a new resource group - * @return the next stage of the definition - */ - WithCreate withNewResourceGroup(Creatable groupDefinition); - } - - /** A function app definition allowing app service plan to be set. */ - interface WithNewAppServicePlan { - /** - * Creates a new Windows consumption plan to use. - * - * @return the next stage of the definition - */ - WithCreate withNewConsumptionPlan(); - - /** - * Creates a new Windows consumption plan to use. - * - * @param appServicePlanName the name of the new consumption plan - * @return the next stage of the definition - */ - WithCreate withNewConsumptionPlan(String appServicePlanName); - - /** - * Creates a new Windows free app service plan. This will fail if there are 10 or more free plans in the - * current subscription. - * - * @return the next stage of the definition - */ - WithCreate withNewFreeAppServicePlan(); - - /** - * Creates a new Windows shared app service plan. - * - * @return the next stage of the definition - */ - WithCreate withNewSharedAppServicePlan(); - - /** - * Creates a new Windows app service plan to use. - * - * @param pricingTier the sku of the app service plan - * @return the next stage of the definition - */ - WithCreate withNewAppServicePlan(PricingTier pricingTier); - - /** - * Creates a new Windows app service plan to use. - * - * @param appServicePlanName the name of the new app service plan - * @param pricingTier the sku of the app service plan - * @return the next stage of the definition - */ - WithCreate withNewAppServicePlan(String appServicePlanName, PricingTier pricingTier); - - /** - * Creates a new Windows app service plan to use. - * - * @param appServicePlanCreatable the new app service plan creatable - * @return the next stage of the definition - */ - WithCreate withNewAppServicePlan(Creatable appServicePlanCreatable); - - /** - * Creates a new Linux consumption plan to use. - * - * @return the next stage of the definition - */ - WithDockerContainerImage withNewLinuxConsumptionPlan(); - - /** - * Creates a new Linux consumption plan to use. - * - * @param appServicePlanName the name of the new consumption plan - * @return the next stage of the definition - */ - WithDockerContainerImage withNewLinuxConsumptionPlan(String appServicePlanName); - - /** - * Creates a new Linux app service plan to use. - * - * @param pricingTier the sku of the app service plan - * @return the next stage of the definition - */ - WithDockerContainerImage withNewLinuxAppServicePlan(PricingTier pricingTier); - - /** - * Creates a new Linux app service plan to use. - * - * @param appServicePlanName the name of the new app service plan - * @param pricingTier the sku of the app service plan - * @return the next stage of the definition - */ - WithDockerContainerImage withNewLinuxAppServicePlan(String appServicePlanName, PricingTier pricingTier); - - /** - * Creates a new Linux app service plan to use. - * - * @param appServicePlanCreatable the new app service plan creatable - * @return the next stage of the definition - */ - WithDockerContainerImage withNewLinuxAppServicePlan(Creatable appServicePlanCreatable); - } - - /** - * A function app definition allowing storage account to be specified. A storage account is required for storing - * function execution runtime, triggers, and logs. - */ - interface WithStorageAccount { - /** - * Creates a new storage account to use for the function app. - * - * @param name the name of the storage account - * @param sku the sku of the storage account - * @return the next stage of the definition - */ - WithCreate withNewStorageAccount(String name, StorageAccountSkuType sku); - - /** - * Creates a new storage account to use for the function app. - * - * @param storageAccount a creatable definition for a new storage account - * @return the next stage of the definition - */ - WithCreate withNewStorageAccount(Creatable storageAccount); - - /** - * Specifies the storage account to use for the function app. - * - * @param storageAccount the storage account to use - * @return the next stage of the definition - */ - WithCreate withExistingStorageAccount(StorageAccount storageAccount); - } - - /** A function app definition allowing runtime version to be specified. */ - interface WithRuntimeVersion { - /** - * Specifies the runtime for the function app. - * - * @param runtime the Azure Functions runtime - * @return the next stage of the definition - */ - WithCreate withRuntime(String runtime); - - /** - * Specifies the runtime version for the function app. - * - * @param version the version of the Azure Functions runtime - * @return the next stage of the definition - */ - WithCreate withRuntimeVersion(String version); - - /** - * Uses the latest runtime version for the function app. - * - * @return the next stage of the definition - */ - WithCreate withLatestRuntimeVersion(); - } - - /** A function app definition allowing daily usage quota to be specified. */ - interface WithDailyUsageQuota { - /** - * Specifies the daily usage data cap. - * - * @param quota the daily usage quota - * @return the next stage of the definition - */ - WithCreate withDailyUsageQuota(int quota); - - /** - * Specifies the daily usage data cap. - * - * @return the next stage of the definition - */ - WithCreate withoutDailyUsageQuota(); - } - - /** - * A function app definition with sufficient inputs to create a new function app in the cloud, but exposing - * additional optional inputs to specify. - */ - interface WithCreate - extends Creatable, - DefinitionStages.WithNewAppServicePlan, - DefinitionStages.WithStorageAccount, - DefinitionStages.WithRuntimeVersion, - DefinitionStages.WithDailyUsageQuota, - WebAppBase.DefinitionStages.WithCreate { - } - - /** - * A function app definition allowing resource group to be specified when an existing app service plan is used. - */ - interface ExistingLinuxPlanWithGroup { - /** - * Associates the resource with an existing resource group. - * - * @param groupName the name of an existing resource group to put this resource in. - * @return the next stage of the definition - */ - WithDockerContainerImage withExistingResourceGroup(String groupName); - - /** - * Associates the resource with an existing resource group. - * - * @param group an existing resource group to put the resource in - * @return the next stage of the definition - */ - WithDockerContainerImage withExistingResourceGroup(ResourceGroup group); - - /** - * Creates a new resource group to put the resource in. - * - *

The group will be created in the same location as the resource. - * - * @param name the name of the new group - * @return the next stage of the definition - */ - WithDockerContainerImage withNewResourceGroup(String name); - - /** - * Creates a new resource group to put the resource in. - * - *

The group will be created in the same location as the resource. The group's name is automatically - * derived from the resource's name. - * - * @return the next stage of the definition - */ - WithDockerContainerImage withNewResourceGroup(); - - /** - * Creates a new resource group to put the resource in, based on the definition specified. - * - * @param groupDefinition a creatable definition for a new resource group - * @return the next stage of the definition - */ - WithDockerContainerImage withNewResourceGroup(Creatable groupDefinition); - } - - /** A function app definition allowing docker image source to be specified. */ - interface WithDockerContainerImage { - /** - * Specifies the docker container image to be a built in one. - * - * @param runtimeStack the runtime stack installed on the image - * @return the next stage of the definition - */ - WithCreate withBuiltInImage(FunctionRuntimeStack runtimeStack); - - /** - * Specifies the docker container image to be one from Docker Hub. - * - * @param imageAndTag image and optional tag (eg 'image:tag') - * @return the next stage of the definition - */ - WithCreate withPublicDockerHubImage(String imageAndTag); - - /** - * Specifies the docker container image to be one from Docker Hub. - * - * @param imageAndTag image and optional tag (eg 'image:tag') - * @return the next stage of the definition - */ - WithCredentials withPrivateDockerHubImage(String imageAndTag); - - /** - * Specifies the docker container image to be one from a private registry. - * - * @param imageAndTag image and optional tag (eg 'image:tag') - * @param serverUrl the URL to the private registry server - * @return the next stage of the definition - */ - WithCredentials withPrivateRegistryImage(String imageAndTag, String serverUrl); - } - - /** A function app definition allowing docker registry credentials to be set. */ - interface WithCredentials { - /** - * Specifies the username and password for Docker Hub. - * - * @param username the username for Docker Hub - * @param password the password for Docker Hub - * @return the next stage of the web app update - */ - WithCreate withCredentials(String username, String password); - } - } - - /** Grouping of all the function app update stages. */ - interface UpdateStages { - /** A function app update allowing app service plan to be set. */ - interface WithAppServicePlan { - /** - * Creates a new Windows consumption plan to use. - * - * @return the next stage of the function app update - */ - Update withNewConsumptionPlan(); - - /** - * Creates a new Windows consumption plan to use. - * - * @param appServicePlanName the name of the new consumption plan - * @return the next stage of the function app update - */ - Update withNewConsumptionPlan(String appServicePlanName); - - /** - * Creates a new Windows free app service plan. This will fail if there are 10 or more free plans in the - * current subscription. - * - * @return the next stage of the function app update - */ - Update withNewFreeAppServicePlan(); - - /** - * Creates a new Windows shared app service plan. - * - * @return the next stage of the function app update - */ - Update withNewSharedAppServicePlan(); - - /** - * Creates a new Windows app service plan to use. - * - * @param pricingTier the sku of the app service plan - * @return the next stage of the function app update - */ - Update withNewAppServicePlan(PricingTier pricingTier); - - /** - * Creates a new Windows app service plan to use. - * - * @param appServicePlanName the name of the new app service plan - * @param pricingTier the sku of the app service plan - * @return the next stage of the function app update - */ - Update withNewAppServicePlan(String appServicePlanName, PricingTier pricingTier); - - /** - * Creates a new Windows app service plan to use. - * - * @param appServicePlanCreatable the new app service plan creatable - * @return the next stage of the function app update - */ - Update withNewAppServicePlan(Creatable appServicePlanCreatable); - - /** - * Uses an existing Windows app service plan for the function app. - * - * @param appServicePlan the existing app service plan - * @return the next stage of the function app update - */ - Update withExistingAppServicePlan(AppServicePlan appServicePlan); - - /** - * Uses an existing Linux app service plan for the function app. - * - * @param appServicePlan the existing app service plan - * @return the next stage of the definition - */ - Update withExistingLinuxAppServicePlan(AppServicePlan appServicePlan); - - /** - * Creates a new Linux consumption plan to use. - * - * @return the next stage of the definition - */ - Update withNewLinuxConsumptionPlan(); - - /** - * Creates a new Linux consumption plan to use. - * - * @param appServicePlanName the name of the new consumption plan - * @return the next stage of the definition - */ - Update withNewLinuxConsumptionPlan(String appServicePlanName); - - /** - * Creates a new Linux app service plan to use. - * - * @param pricingTier the sku of the app service plan - * @return the next stage of the definition - */ - Update withNewLinuxAppServicePlan(PricingTier pricingTier); - - /** - * Creates a new Linux app service plan to use. - * - * @param appServicePlanName the name of the new app service plan - * @param pricingTier the sku of the app service plan - * @return the next stage of the definition - */ - Update withNewLinuxAppServicePlan(String appServicePlanName, PricingTier pricingTier); - - /** - * Creates a new Linux app service plan to use. - * - * @param appServicePlanCreatable the new app service plan creatable - * @return the next stage of the definition - */ - Update withNewLinuxAppServicePlan(Creatable appServicePlanCreatable); - } - - /** A function app update allowing runtime version to be specified. */ - interface WithRuntimeVersion { - /** - * Specifies the runtime for the function app. - * - * @param runtime the Azure Functions runtime - * @return the next stage of the definition - */ - Update withRuntime(String runtime); - - /** - * Specifies the runtime version for the function app. - * - * @param version the version of the Azure Functions runtime - * @return the next stage of the function app update - */ - Update withRuntimeVersion(String version); - - /** - * Uses the latest runtime version for the function app. - * - * @return the next stage of the function app update - */ - Update withLatestRuntimeVersion(); - } - - /** - * A function app definition allowing storage account to be specified. A storage account is required for storing - * function execution runtime, triggers, and logs. - */ - interface WithStorageAccount { - /** - * Creates a new storage account to use for the function app. - * - * @param name the name of the storage account - * @param sku the sku of the storage account - * @return the next stage of the function app update - */ - Update withNewStorageAccount(String name, StorageAccountSkuType sku); - - /** - * Specifies the storage account to use for the function app. - * - * @param storageAccount the storage account to use - * @return the next stage of the function app update - */ - Update withExistingStorageAccount(StorageAccount storageAccount); - } - - /** A function app definition allowing daily usage quota to be specified. */ - interface WithDailyUsageQuota { - /** - * Specifies the daily usage data cap. - * - * @param quota the daily usage quota - * @return the next stage of the function app update - */ - Update withDailyUsageQuota(int quota); - - /** - * Specifies the daily usage data cap. - * - * @return the next stage of the function app update - */ - Update withoutDailyUsageQuota(); - } - - /** A function app update allowing docker image source to be specified. */ - interface WithDockerContainerImage { - /** - * Specifies the docker container image to be a built in one. - * - * @param runtimeStack the runtime stack installed on the image - * @return the next stage of the web app update - */ - Update withBuiltInImage(FunctionRuntimeStack runtimeStack); - - /** - * Specifies the docker container image to be one from Docker Hub. - * - * @param imageAndTag image and optional tag (eg 'image:tag') - * @return the next stage of the web app update - */ - Update withPublicDockerHubImage(String imageAndTag); - - /** - * Specifies the docker container image to be one from Docker Hub. - * - * @param imageAndTag image and optional tag (eg 'image:tag') - * @return the next stage of the web app update - */ - WithCredentials withPrivateDockerHubImage(String imageAndTag); - - /** - * Specifies the docker container image to be one from a private registry. - * - * @param imageAndTag image and optional tag (eg 'image:tag') - * @param serverUrl the URL to the private registry server - * @return the next stage of the web app update - */ - WithCredentials withPrivateRegistryImage(String imageAndTag, String serverUrl); - } - - /** A function app update allowing docker hub credentials to be set. */ - interface WithCredentials { - /** - * Specifies the username and password for Docker Hub. - * - * @param username the username for Docker Hub - * @param password the password for Docker Hub - * @return the next stage of the web app update - */ - Update withCredentials(String username, String password); - } - } - - /** The template for a function app update operation, containing all the settings that can be modified. */ - interface Update - extends WebAppBase.Update, - UpdateStages.WithAppServicePlan, - UpdateStages.WithRuntimeVersion, - UpdateStages.WithStorageAccount, - UpdateStages.WithDailyUsageQuota, - UpdateStages.WithDockerContainerImage, - UpdateStages.WithCredentials { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/FunctionAppBasic.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/FunctionAppBasic.java deleted file mode 100644 index f8674da41f49..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/FunctionAppBasic.java +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; - -/** - * An immutable client-side representation of an Azure Function App. - */ -public interface FunctionAppBasic extends WebSiteBase, Refreshable { -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/FunctionApps.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/FunctionApps.java deleted file mode 100644 index d687878255cb..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/FunctionApps.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.appservice.AppServiceManager; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsDeletingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsListingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsCreating; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingById; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; - -/** Entry point for web app management API. */ -@Fluent -public interface FunctionApps - extends SupportsCreating, - SupportsDeletingById, - SupportsListing, - SupportsListingByResourceGroup, - SupportsGettingByResourceGroup, - SupportsGettingById, - SupportsDeletingByResourceGroup, - HasManager { - - /** - * List function information elements. - * - * @param resourceGroupName resource group name - * @param name function app name - * @return list of function information elements - */ - PagedIterable listFunctions(String resourceGroupName, String name); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/FunctionAuthenticationPolicy.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/FunctionAuthenticationPolicy.java deleted file mode 100644 index 4df9119e812b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/FunctionAuthenticationPolicy.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.http.HttpPipelineCallContext; -import com.azure.core.http.HttpPipelineNextPolicy; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.policy.HttpPipelinePolicy; -import reactor.core.publisher.Mono; - -/** - * Function app authentication via x-functions-key - */ -public final class FunctionAuthenticationPolicy implements HttpPipelinePolicy { - private final FunctionApp functionApp; - private static final String HEADER_NAME = "x-functions-key"; - private String masterKey; - - /** - * Constructor - * @param functionApp the function app - */ - public FunctionAuthenticationPolicy(FunctionApp functionApp) { - this.functionApp = functionApp; - } - - @Override - public Mono process(HttpPipelineCallContext context, HttpPipelineNextPolicy next) { - Mono masterKeyMono = - masterKey == null - ? functionApp - .getMasterKeyAsync() - .map( - key -> { - masterKey = key; - return key; - }) - : Mono.just(masterKey); - return masterKeyMono - .flatMap( - key -> { - context.getHttpRequest().setHeader(HEADER_NAME, key); - return next.process(); - }); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/FunctionDeploymentSlot.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/FunctionDeploymentSlot.java deleted file mode 100644 index 1ab5ff15abb4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/FunctionDeploymentSlot.java +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.appservice.AppServiceManager; -import com.azure.resourcemanager.appservice.fluent.models.SiteInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasParent; -import com.azure.resourcemanager.resources.fluentcore.arm.models.IndependentChildResource; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.Updatable; -import reactor.core.publisher.Mono; - -/** An immutable client-side representation of an Azure Function App deployment slot. */ -@Fluent -public interface FunctionDeploymentSlot - extends IndependentChildResource, - FunctionDeploymentSlotBasic, - DeploymentSlotBase, - Updatable>, - HasParent { - - /** @return the master key for the function app */ - String getMasterKey(); - - /** @return the master key for the function app */ - Mono getMasterKeyAsync(); - - /************************************************************** - * Fluent interfaces to provision a function deployment slot - **************************************************************/ - - /** Container interface for all the definitions that need to be implemented. */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithConfiguration, DefinitionStages.WithCreate { - } - - /** Grouping of all the function deployment slot definition stages. */ - interface DefinitionStages { - /** The first stage of the function deployment slot definition. */ - interface Blank extends WithConfiguration { - } - - /** A function deployment slot definition allowing the configuration to clone from to be specified. */ - interface WithConfiguration { - /** - * Creates the function deployment slot with brand new site configurations. - * - * @return the next stage of the definition - */ - WithCreate withBrandNewConfiguration(); - - /** - * Copies the site configurations from the web app the function deployment slot belongs to. - * - * @return the next stage of the definition - */ - WithCreate withConfigurationFromParent(); - - /** - * Copies the site configurations from a given function app. - * - * @param app the function app to copy the configurations from - * @return the next stage of the definition - */ - WithCreate withConfigurationFromFunctionApp(FunctionApp app); - - /** - * Copies the site configurations from a givenfunction deployment slot. - * - * @param deploymentSlot the function deployment slot to copy the configurations from - * @return the next stage of the definition - */ - WithCreate withConfigurationFromDeploymentSlot(FunctionDeploymentSlot deploymentSlot); - } - - /** - * A site definition with sufficient inputs to create a new web app / deployments slot in the cloud, but - * exposing additional optional inputs to specify. - */ - interface WithCreate - extends Creatable, WebAppBase.DefinitionStages.WithCreate { - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/FunctionDeploymentSlotBasic.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/FunctionDeploymentSlotBasic.java deleted file mode 100644 index 4c73b83a2df4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/FunctionDeploymentSlotBasic.java +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; - -/** An immutable client-side representation of an Azure Function App deployment slot. */ -public interface FunctionDeploymentSlotBasic extends WebSiteBase, Refreshable { -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/FunctionDeploymentSlots.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/FunctionDeploymentSlots.java deleted file mode 100644 index 14ea3dd1e1e3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/FunctionDeploymentSlots.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.appservice.AppServiceManager; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingByName; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasParent; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsCreating; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingById; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingByName; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; - -/** Entry point for Azure function app deployment slot management API. */ -@Fluent -public interface FunctionDeploymentSlots - extends SupportsCreating, - SupportsListing, - SupportsGettingByName, - SupportsGettingById, - SupportsDeletingById, - SupportsDeletingByName, - HasManager, - HasParent { -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/FunctionEnvelope.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/FunctionEnvelope.java deleted file mode 100644 index dd9fe9fd1cfa..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/FunctionEnvelope.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.resourcemanager.appservice.fluent.models.FunctionEnvelopeInner; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import java.util.Map; - -/** An immutable representation of function Information. */ -public interface FunctionEnvelope extends HasInnerModel { - - /** @return the functionAppId value */ - String functionAppId(); - - /** @return the scriptRootPathHref value */ - String scriptRootPathHref(); - - /** @return the scriptHref value */ - String scriptHref(); - - /** @return the configHref value */ - String configHref(); - - /** @return the secretsFileHref value */ - String secretsFileHref(); - - /** @return the href value */ - String href(); - - /** @return the config value */ - Object config(); - - /** @return the files value */ - Map files(); - - /** @return the testData value */ - String testData(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/FunctionEnvelopeCollection.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/FunctionEnvelopeCollection.java deleted file mode 100644 index a631145df7f9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/FunctionEnvelopeCollection.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.models.FunctionEnvelopeInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Collection of Kudu function information elements. */ -@Fluent -public final class FunctionEnvelopeCollection { - @JsonIgnore private final ClientLogger logger = new ClientLogger(FunctionEnvelopeCollection.class); - - /* - * Collection of resources. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * Link to next page of resources. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: Collection of resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Collection of resources. - * - * @param value the value value to set. - * @return the FunctionEnvelopeCollection object itself. - */ - public FunctionEnvelopeCollection withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to next page of resources. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property value in model FunctionEnvelopeCollection")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/FunctionRuntimeStack.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/FunctionRuntimeStack.java deleted file mode 100644 index 51db8faf8e17..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/FunctionRuntimeStack.java +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import java.util.Objects; - -/** Defines function app runtime for Linux operating system. */ -@Fluent -public class FunctionRuntimeStack { - - /** JAVA 8. */ - public static final FunctionRuntimeStack JAVA_8 = new FunctionRuntimeStack("java", "~3", - "java|8"); - - /** JAVA 11. */ - public static final FunctionRuntimeStack JAVA_11 = new FunctionRuntimeStack("java", "~3", - "java|11"); - - private final String runtime; - private final String version; - - private final String linuxFxVersion; - - /** - * Creates a custom function app runtime stack. - * - * @param runtime the language runtime - * @param version the language runtime version - * @param linuxFxVersion the LinuxFxVersion property value - */ - public FunctionRuntimeStack( - String runtime, - String version, - String linuxFxVersion) { - this.runtime = Objects.requireNonNull(runtime); - this.version = Objects.requireNonNull(version); - - this.linuxFxVersion = Objects.requireNonNull(linuxFxVersion); - } - - /** @return the name of the language runtime */ - public String runtime() { - return runtime; - } - - /** @return the version of the Language runtime */ - public String version() { - return version; - } - - /** - * Gets LinuxFxVersion property value. - * - * @return the LinuxFxVersion property value for siteConfig - */ - public String getLinuxFxVersion() { - return linuxFxVersion; - } - - @Override - public String toString() { - return runtime; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - FunctionRuntimeStack that = (FunctionRuntimeStack) o; - return runtime.equals(that.runtime) && version.equals(that.version); - } - - @Override - public int hashCode() { - return Objects.hash(runtime, version); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/GeoDistribution.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/GeoDistribution.java deleted file mode 100644 index 6f7ae1d3593e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/GeoDistribution.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** A global distribution definition. */ -@Fluent -public final class GeoDistribution { - @JsonIgnore private final ClientLogger logger = new ClientLogger(GeoDistribution.class); - - /* - * Location. - */ - @JsonProperty(value = "location") - private String location; - - /* - * NumberOfWorkers. - */ - @JsonProperty(value = "numberOfWorkers") - private Integer numberOfWorkers; - - /** - * Get the location property: Location. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Set the location property: Location. - * - * @param location the location value to set. - * @return the GeoDistribution object itself. - */ - public GeoDistribution withLocation(String location) { - this.location = location; - return this; - } - - /** - * Get the numberOfWorkers property: NumberOfWorkers. - * - * @return the numberOfWorkers value. - */ - public Integer numberOfWorkers() { - return this.numberOfWorkers; - } - - /** - * Set the numberOfWorkers property: NumberOfWorkers. - * - * @param numberOfWorkers the numberOfWorkers value to set. - * @return the GeoDistribution object itself. - */ - public GeoDistribution withNumberOfWorkers(Integer numberOfWorkers) { - this.numberOfWorkers = numberOfWorkers; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/GeoRegionCollection.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/GeoRegionCollection.java deleted file mode 100644 index 81870953f1b5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/GeoRegionCollection.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.models.GeoRegionInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Collection of geographical regions. */ -@Fluent -public final class GeoRegionCollection { - @JsonIgnore private final ClientLogger logger = new ClientLogger(GeoRegionCollection.class); - - /* - * Collection of resources. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * Link to next page of resources. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: Collection of resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Collection of resources. - * - * @param value the value value to set. - * @return the GeoRegionCollection object itself. - */ - public GeoRegionCollection withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to next page of resources. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model GeoRegionCollection")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/GlobalCsmSkuDescription.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/GlobalCsmSkuDescription.java deleted file mode 100644 index b5d64224cf55..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/GlobalCsmSkuDescription.java +++ /dev/null @@ -1,214 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.models.CapabilityInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** A Global SKU Description. */ -@Fluent -public final class GlobalCsmSkuDescription { - @JsonIgnore private final ClientLogger logger = new ClientLogger(GlobalCsmSkuDescription.class); - - /* - * Name of the resource SKU. - */ - @JsonProperty(value = "name") - private String name; - - /* - * Service Tier of the resource SKU. - */ - @JsonProperty(value = "tier") - private String tier; - - /* - * Size specifier of the resource SKU. - */ - @JsonProperty(value = "size") - private String size; - - /* - * Family code of the resource SKU. - */ - @JsonProperty(value = "family") - private String family; - - /* - * Min, max, and default scale values of the SKU. - */ - @JsonProperty(value = "capacity") - private SkuCapacity capacity; - - /* - * Locations of the SKU. - */ - @JsonProperty(value = "locations") - private List locations; - - /* - * Capabilities of the SKU, e.g., is traffic manager enabled? - */ - @JsonProperty(value = "capabilities") - private List capabilities; - - /** - * Get the name property: Name of the resource SKU. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Name of the resource SKU. - * - * @param name the name value to set. - * @return the GlobalCsmSkuDescription object itself. - */ - public GlobalCsmSkuDescription withName(String name) { - this.name = name; - return this; - } - - /** - * Get the tier property: Service Tier of the resource SKU. - * - * @return the tier value. - */ - public String tier() { - return this.tier; - } - - /** - * Set the tier property: Service Tier of the resource SKU. - * - * @param tier the tier value to set. - * @return the GlobalCsmSkuDescription object itself. - */ - public GlobalCsmSkuDescription withTier(String tier) { - this.tier = tier; - return this; - } - - /** - * Get the size property: Size specifier of the resource SKU. - * - * @return the size value. - */ - public String size() { - return this.size; - } - - /** - * Set the size property: Size specifier of the resource SKU. - * - * @param size the size value to set. - * @return the GlobalCsmSkuDescription object itself. - */ - public GlobalCsmSkuDescription withSize(String size) { - this.size = size; - return this; - } - - /** - * Get the family property: Family code of the resource SKU. - * - * @return the family value. - */ - public String family() { - return this.family; - } - - /** - * Set the family property: Family code of the resource SKU. - * - * @param family the family value to set. - * @return the GlobalCsmSkuDescription object itself. - */ - public GlobalCsmSkuDescription withFamily(String family) { - this.family = family; - return this; - } - - /** - * Get the capacity property: Min, max, and default scale values of the SKU. - * - * @return the capacity value. - */ - public SkuCapacity capacity() { - return this.capacity; - } - - /** - * Set the capacity property: Min, max, and default scale values of the SKU. - * - * @param capacity the capacity value to set. - * @return the GlobalCsmSkuDescription object itself. - */ - public GlobalCsmSkuDescription withCapacity(SkuCapacity capacity) { - this.capacity = capacity; - return this; - } - - /** - * Get the locations property: Locations of the SKU. - * - * @return the locations value. - */ - public List locations() { - return this.locations; - } - - /** - * Set the locations property: Locations of the SKU. - * - * @param locations the locations value to set. - * @return the GlobalCsmSkuDescription object itself. - */ - public GlobalCsmSkuDescription withLocations(List locations) { - this.locations = locations; - return this; - } - - /** - * Get the capabilities property: Capabilities of the SKU, e.g., is traffic manager enabled?. - * - * @return the capabilities value. - */ - public List capabilities() { - return this.capabilities; - } - - /** - * Set the capabilities property: Capabilities of the SKU, e.g., is traffic manager enabled?. - * - * @param capabilities the capabilities value to set. - * @return the GlobalCsmSkuDescription object itself. - */ - public GlobalCsmSkuDescription withCapabilities(List capabilities) { - this.capabilities = capabilities; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (capacity() != null) { - capacity().validate(); - } - if (capabilities() != null) { - capabilities().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/HandlerMapping.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/HandlerMapping.java deleted file mode 100644 index e01218759333..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/HandlerMapping.java +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * The IIS handler mappings used to define which handler processes HTTP requests with certain extension. For example, it - * is used to configure php-cgi.exe process to handle all HTTP requests with *.php extension. - */ -@Fluent -public final class HandlerMapping { - @JsonIgnore private final ClientLogger logger = new ClientLogger(HandlerMapping.class); - - /* - * Requests with this extension will be handled using the specified FastCGI - * application. - */ - @JsonProperty(value = "extension") - private String extension; - - /* - * The absolute path to the FastCGI application. - */ - @JsonProperty(value = "scriptProcessor") - private String scriptProcessor; - - /* - * Command-line arguments to be passed to the script processor. - */ - @JsonProperty(value = "arguments") - private String arguments; - - /** - * Get the extension property: Requests with this extension will be handled using the specified FastCGI application. - * - * @return the extension value. - */ - public String extension() { - return this.extension; - } - - /** - * Set the extension property: Requests with this extension will be handled using the specified FastCGI application. - * - * @param extension the extension value to set. - * @return the HandlerMapping object itself. - */ - public HandlerMapping withExtension(String extension) { - this.extension = extension; - return this; - } - - /** - * Get the scriptProcessor property: The absolute path to the FastCGI application. - * - * @return the scriptProcessor value. - */ - public String scriptProcessor() { - return this.scriptProcessor; - } - - /** - * Set the scriptProcessor property: The absolute path to the FastCGI application. - * - * @param scriptProcessor the scriptProcessor value to set. - * @return the HandlerMapping object itself. - */ - public HandlerMapping withScriptProcessor(String scriptProcessor) { - this.scriptProcessor = scriptProcessor; - return this; - } - - /** - * Get the arguments property: Command-line arguments to be passed to the script processor. - * - * @return the arguments value. - */ - public String arguments() { - return this.arguments; - } - - /** - * Set the arguments property: Command-line arguments to be passed to the script processor. - * - * @param arguments the arguments value to set. - * @return the HandlerMapping object itself. - */ - public HandlerMapping withArguments(String arguments) { - this.arguments = arguments; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/HostType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/HostType.java deleted file mode 100644 index 247606070971..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/HostType.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for HostType. */ -public enum HostType { - /** Enum value Standard. */ - STANDARD("Standard"), - - /** Enum value Repository. */ - REPOSITORY("Repository"); - - /** The actual serialized value for a HostType instance. */ - private final String value; - - HostType(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a HostType instance. - * - * @param value the serialized value to parse. - * @return the parsed HostType object, or null if unable to parse. - */ - @JsonCreator - public static HostType fromString(String value) { - HostType[] items = HostType.values(); - for (HostType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/HostingEnvironmentDeploymentInfo.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/HostingEnvironmentDeploymentInfo.java deleted file mode 100644 index 6aa451d4078f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/HostingEnvironmentDeploymentInfo.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Information needed to create resources on an App Service Environment. */ -@Fluent -public final class HostingEnvironmentDeploymentInfo { - @JsonIgnore private final ClientLogger logger = new ClientLogger(HostingEnvironmentDeploymentInfo.class); - - /* - * Name of the App Service Environment. - */ - @JsonProperty(value = "name") - private String name; - - /* - * Location of the App Service Environment. - */ - @JsonProperty(value = "location") - private String location; - - /** - * Get the name property: Name of the App Service Environment. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Name of the App Service Environment. - * - * @param name the name value to set. - * @return the HostingEnvironmentDeploymentInfo object itself. - */ - public HostingEnvironmentDeploymentInfo withName(String name) { - this.name = name; - return this; - } - - /** - * Get the location property: Location of the App Service Environment. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Set the location property: Location of the App Service Environment. - * - * @param location the location value to set. - * @return the HostingEnvironmentDeploymentInfo object itself. - */ - public HostingEnvironmentDeploymentInfo withLocation(String location) { - this.location = location; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/HostingEnvironmentProfile.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/HostingEnvironmentProfile.java deleted file mode 100644 index d5720cddf741..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/HostingEnvironmentProfile.java +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Specification for an App Service Environment to use for this resource. */ -@Fluent -public final class HostingEnvironmentProfile { - @JsonIgnore private final ClientLogger logger = new ClientLogger(HostingEnvironmentProfile.class); - - /* - * Resource ID of the App Service Environment. - */ - @JsonProperty(value = "id") - private String id; - - /* - * Name of the App Service Environment. - */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) - private String name; - - /* - * Resource type of the App Service Environment. - */ - @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) - private String type; - - /** - * Get the id property: Resource ID of the App Service Environment. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: Resource ID of the App Service Environment. - * - * @param id the id value to set. - * @return the HostingEnvironmentProfile object itself. - */ - public HostingEnvironmentProfile withId(String id) { - this.id = id; - return this; - } - - /** - * Get the name property: Name of the App Service Environment. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the type property: Resource type of the App Service Environment. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/HostingEnvironmentStatus.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/HostingEnvironmentStatus.java deleted file mode 100644 index 9aea7b580314..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/HostingEnvironmentStatus.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for HostingEnvironmentStatus. */ -public enum HostingEnvironmentStatus { - /** Enum value Preparing. */ - PREPARING("Preparing"), - - /** Enum value Ready. */ - READY("Ready"), - - /** Enum value Scaling. */ - SCALING("Scaling"), - - /** Enum value Deleting. */ - DELETING("Deleting"); - - /** The actual serialized value for a HostingEnvironmentStatus instance. */ - private final String value; - - HostingEnvironmentStatus(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a HostingEnvironmentStatus instance. - * - * @param value the serialized value to parse. - * @return the parsed HostingEnvironmentStatus object, or null if unable to parse. - */ - @JsonCreator - public static HostingEnvironmentStatus fromString(String value) { - HostingEnvironmentStatus[] items = HostingEnvironmentStatus.values(); - for (HostingEnvironmentStatus item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/Hostname.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/Hostname.java deleted file mode 100644 index 407d0b5363fb..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/Hostname.java +++ /dev/null @@ -1,188 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Details of a hostname derived from a domain. */ -@Fluent -public final class Hostname { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Hostname.class); - - /* - * Name of the hostname. - */ - @JsonProperty(value = "name") - private String name; - - /* - * List of apps the hostname is assigned to. This list will have more than - * one app only if the hostname is pointing to a Traffic Manager. - */ - @JsonProperty(value = "siteNames") - private List siteNames; - - /* - * Name of the Azure resource the hostname is assigned to. If it is - * assigned to a Traffic Manager then it will be the Traffic Manager name - * otherwise it will be the app name. - */ - @JsonProperty(value = "azureResourceName") - private String azureResourceName; - - /* - * Type of the Azure resource the hostname is assigned to. - */ - @JsonProperty(value = "azureResourceType") - private AzureResourceType azureResourceType; - - /* - * Type of the DNS record. - */ - @JsonProperty(value = "customHostNameDnsRecordType") - private CustomHostnameDnsRecordType customHostnameDnsRecordType; - - /* - * Type of the hostname. - */ - @JsonProperty(value = "hostNameType") - private HostnameType hostnameType; - - /** - * Get the name property: Name of the hostname. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Name of the hostname. - * - * @param name the name value to set. - * @return the Hostname object itself. - */ - public Hostname withName(String name) { - this.name = name; - return this; - } - - /** - * Get the siteNames property: List of apps the hostname is assigned to. This list will have more than one app only - * if the hostname is pointing to a Traffic Manager. - * - * @return the siteNames value. - */ - public List siteNames() { - return this.siteNames; - } - - /** - * Set the siteNames property: List of apps the hostname is assigned to. This list will have more than one app only - * if the hostname is pointing to a Traffic Manager. - * - * @param siteNames the siteNames value to set. - * @return the Hostname object itself. - */ - public Hostname withSiteNames(List siteNames) { - this.siteNames = siteNames; - return this; - } - - /** - * Get the azureResourceName property: Name of the Azure resource the hostname is assigned to. If it is assigned to - * a Traffic Manager then it will be the Traffic Manager name otherwise it will be the app name. - * - * @return the azureResourceName value. - */ - public String azureResourceName() { - return this.azureResourceName; - } - - /** - * Set the azureResourceName property: Name of the Azure resource the hostname is assigned to. If it is assigned to - * a Traffic Manager then it will be the Traffic Manager name otherwise it will be the app name. - * - * @param azureResourceName the azureResourceName value to set. - * @return the Hostname object itself. - */ - public Hostname withAzureResourceName(String azureResourceName) { - this.azureResourceName = azureResourceName; - return this; - } - - /** - * Get the azureResourceType property: Type of the Azure resource the hostname is assigned to. - * - * @return the azureResourceType value. - */ - public AzureResourceType azureResourceType() { - return this.azureResourceType; - } - - /** - * Set the azureResourceType property: Type of the Azure resource the hostname is assigned to. - * - * @param azureResourceType the azureResourceType value to set. - * @return the Hostname object itself. - */ - public Hostname withAzureResourceType(AzureResourceType azureResourceType) { - this.azureResourceType = azureResourceType; - return this; - } - - /** - * Get the customHostnameDnsRecordType property: Type of the DNS record. - * - * @return the customHostnameDnsRecordType value. - */ - public CustomHostnameDnsRecordType customHostnameDnsRecordType() { - return this.customHostnameDnsRecordType; - } - - /** - * Set the customHostnameDnsRecordType property: Type of the DNS record. - * - * @param customHostnameDnsRecordType the customHostnameDnsRecordType value to set. - * @return the Hostname object itself. - */ - public Hostname withCustomHostnameDnsRecordType(CustomHostnameDnsRecordType customHostnameDnsRecordType) { - this.customHostnameDnsRecordType = customHostnameDnsRecordType; - return this; - } - - /** - * Get the hostnameType property: Type of the hostname. - * - * @return the hostnameType value. - */ - public HostnameType hostnameType() { - return this.hostnameType; - } - - /** - * Set the hostnameType property: Type of the hostname. - * - * @param hostnameType the hostnameType value to set. - * @return the Hostname object itself. - */ - public Hostname withHostnameType(HostnameType hostnameType) { - this.hostnameType = hostnameType; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/HostnameBinding.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/HostnameBinding.java deleted file mode 100644 index 93e2bcb6bae1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/HostnameBinding.java +++ /dev/null @@ -1,210 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.appservice.fluent.models.HostnameBindingInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.ExternalChildResource; -import com.azure.resourcemanager.resources.fluentcore.arm.models.Resource; -import com.azure.resourcemanager.resources.fluentcore.model.Attachable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; - -/** An immutable representation of a host name binding. */ -@Fluent -public interface HostnameBinding - extends HasInnerModel, ExternalChildResource, Resource { - /** @return the web app name */ - String webAppName(); - - /** @return the fully qualified ARM domain resource URI */ - String domainId(); - - /** @return Azure resource name to bind to */ - String azureResourceName(); - - /** @return Azure resource type */ - AzureResourceType azureResourceType(); - - /** @return custom DNS record type */ - CustomHostnameDnsRecordType dnsRecordType(); - - /** @return the host name type */ - HostnameType hostnameType(); - - /** - * The entirety of a hostname binding definition. - * - * @param the return type of the final {@link Attachable#attach()} - */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithDomain, - DefinitionStages.WithSubDomain, - DefinitionStages.WithHostNameDnsRecordType, - DefinitionStages.WithAttach { - } - - /** Grouping of hostname binding definition stages applicable as part of a web app creation. */ - interface DefinitionStages { - /** - * The first stage of a host name binding definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface Blank extends WithDomain { - } - - /** - * The stage of a hostname binding definition allowing domain to be specified. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithDomain { - /** - * Binds to a domain purchased from Azure. - * - * @param domain the domain purchased from Azure - * @return the next stage of the definition - */ - WithSubDomain withAzureManagedDomain(AppServiceDomain domain); - - /** - * Binds to a 3rd party domain. - * - * @param domain the 3rd party domain name - * @return the next stage of the definition - */ - WithSubDomain withThirdPartyDomain(String domain); - } - - /** - * The stage of a hostname binding definition allowing sub-domain to be specified. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithSubDomain { - /** - * Specifies the sub-domain to bind to. - * - * @param subDomain the sub-domain name excluding the top level domain, e.g., "@", "www" - * @return the next stage of the definition - */ - WithHostNameDnsRecordType withSubDomain(String subDomain); - } - - /** - * The stage of a hostname binding definition allowing DNS record type to be set. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithHostNameDnsRecordType { - /** - * Specifies the DNS record type. - * - * @param hostnameDnsRecordType the DNS record type - * @return the next stage of the definition - */ - WithAttach withDnsRecordType(CustomHostnameDnsRecordType hostnameDnsRecordType); - } - - /** - * The final stage of the hostname binding definition. - * - *

At this stage, any remaining optional settings can be specified, or the hostname binding definition can be - * attached to the parent web app definition using {@link WithAttach#attach()}. - * - * @param the return type of {@link WithAttach#attach()} - */ - interface WithAttach extends Attachable.InDefinition { - } - } - - /** - * The entirety of a hostname binding definition as part of a web app update. - * - * @param the return type of the final {@link UpdateDefinitionStages.WithAttach#attach()} - */ - interface UpdateDefinition - extends UpdateDefinitionStages.Blank, - UpdateDefinitionStages.WithDomain, - UpdateDefinitionStages.WithSubDomain, - UpdateDefinitionStages.WithHostNameDnsRecordType, - UpdateDefinitionStages.WithAttach { - } - - /** Grouping of host name binding definition stages applicable as part of a web app creation. */ - interface UpdateDefinitionStages { - /** - * The first stage of a host name binding definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface Blank extends WithDomain { - } - - /** - * The stage of a hostname binding definition allowing domain to be specified. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithDomain { - /** - * Binds to a domain purchased from Azure. - * - * @param domain the domain purchased from Azure - * @return the next stage of the definition - */ - WithSubDomain withAzureManagedDomain(AppServiceDomain domain); - - /** - * Binds to a 3rd party domain. - * - * @param domain the 3rd party domain name - * @return the next stage of the definition - */ - WithSubDomain withThirdPartyDomain(String domain); - } - - /** - * The stage of a hostname binding definition allowing sub-domain to be specified. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithSubDomain { - /** - * Specifies the sub-domain to bind to. - * - * @param subDomain the sub-domain name excluding the top level domain, e.g., "@", "www" - * @return the next stage of the definition - */ - WithHostNameDnsRecordType withSubDomain(String subDomain); - } - - /** - * The stage of a hostname binding definition allowing DNS record type to be set. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithHostNameDnsRecordType { - /** - * Specifies the DNS record type. - * - * @param hostnameDnsRecordType the DNS record type - * @return the next stage of the definition - */ - WithAttach withDnsRecordType(CustomHostnameDnsRecordType hostnameDnsRecordType); - } - - /** - * The final stage of the hostname binding definition. - * - *

At this stage, any remaining optional settings can be specified, or the hostname binding definition can be - * attached to the parent web app update using {@link WithAttach#attach()}. - * - * @param the return type of {@link WithAttach#attach()} - */ - interface WithAttach extends Attachable.InUpdate { - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/HostnameBindingCollection.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/HostnameBindingCollection.java deleted file mode 100644 index 5cfaf15d0943..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/HostnameBindingCollection.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.models.HostnameBindingInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Collection of hostname bindings. */ -@Fluent -public final class HostnameBindingCollection { - @JsonIgnore private final ClientLogger logger = new ClientLogger(HostnameBindingCollection.class); - - /* - * Collection of resources. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * Link to next page of resources. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: Collection of resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Collection of resources. - * - * @param value the value value to set. - * @return the HostnameBindingCollection object itself. - */ - public HostnameBindingCollection withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to next page of resources. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model HostnameBindingCollection")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/HostnameSslBinding.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/HostnameSslBinding.java deleted file mode 100644 index 38c634b6048b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/HostnameSslBinding.java +++ /dev/null @@ -1,297 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.keyvault.models.Vault; -import com.azure.resourcemanager.resources.fluentcore.arm.models.ChildResource; -import com.azure.resourcemanager.resources.fluentcore.model.Attachable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import java.io.File; - -/** An immutable representation of an host name SSL binding. */ -@Fluent -public interface HostnameSslBinding extends HasInnerModel, ChildResource { - /** @return the SSL type */ - SslState sslState(); - - /** @return the virtual IP address assigned to the host name if IP based SSL is enabled */ - String virtualIp(); - - /** @return the SSL cert thumbprint. */ - String thumbprint(); - - /** - * The entirety of a hostname SSL binding definition. - * - * @param the return type of the final {@link Attachable#attach()} - */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithHostname, - DefinitionStages.WithCertificate, - DefinitionStages.WithKeyVault, - DefinitionStages.WithSslType, - DefinitionStages.WithAttach { - } - - /** Grouping of hostname SSL binding definition stages applicable as part of a web app creation. */ - interface DefinitionStages { - /** - * The first stage of a hostname SSL binding definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface Blank extends WithHostname { - } - - /** - * The stage of a hostname SSL binding definition allowing hostname to be specified. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithHostname { - /** - * Specifies the hostname to bind SSL certificate to. - * - * @param hostname the naked hostname, excluding "www". But use *. prefix for wild card typed certificate - * order. - * @return the next stage of the definition - */ - WithCertificate forHostname(String hostname); - } - - /** - * The stage of a hostname SSL binding definition allowing certificate information to be specified. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithCertificate { - /** - * Uploads a PFX certificate. - * - * @param pfxFile the PFX certificate file to upload - * @param password the password to the certificate - * @return the next stage of the definition - */ - WithSslType withPfxCertificateToUpload(File pfxFile, String password); - - /** - * Use an existing certificate in the resource group. - * - * @param certificateName the name of the certificate - * @return the next stage of the definition - */ - WithSslType withExistingCertificate(String certificateName); - - /** - * Places a new App Service certificate order to use for the hostname. - * - * @param certificateOrderName the name of the certificate order - * @return the next stage of the definition - */ - WithKeyVault withNewStandardSslCertificateOrder(String certificateOrderName); - - /** - * Specifies a ready-to-use certificate order to use. This is usually useful for reusing wildcard - * certificates. - * - * @param certificateOrder the ready-to-use certificate order - * @return the next stage of the definition - */ - WithSslType withExistingAppServiceCertificateOrder(AppServiceCertificateOrder certificateOrder); - } - - /** - * The stage of a hostname SSL binding definition allowing key vault for certificate store to be specified. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithKeyVault { - /** - * Stores the certificate in an existing vault. - * - * @param vault the existing vault to use - * @return the next stage of the definition - */ - WithSslType withExistingKeyVault(Vault vault); - - /** - * Creates a new key vault to store the certificate. - * - * @param vaultName the name of the key vault to create - * @return the next stage of the definition - */ - WithSslType withNewKeyVault(String vaultName); - } - - /** - * The stage of a hostname SSL binding definition allowing SSL type to be specified. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithSslType { - /** - * Uses Server Name Indication (SNI) based SSL. - * - * @return the next stage of the definition - */ - WithAttach withSniBasedSsl(); - - /** - * Uses IP based SSL. Only one hostname can be bound to IP based SSL. - * - * @return the next stage of the definition - */ - WithAttach withIpBasedSsl(); - } - - /** - * The final stage of the hostname SSL binding definition. - * - *

At this stage, any remaining optional settings can be specified, or the hostname SSL binding definition - * can be attached to the parent web app definition using {@link WithAttach#attach()}. - * - * @param the return type of {@link WithAttach#attach()} - */ - interface WithAttach extends Attachable.InDefinition { - } - } - - /** - * The entirety of a hostname SSL binding definition as part of a web app update. - * - * @param the return type of the final {@link UpdateDefinitionStages.WithAttach#attach()} - */ - interface UpdateDefinition - extends UpdateDefinitionStages.Blank, - UpdateDefinitionStages.WithHostname, - UpdateDefinitionStages.WithCertificate, - UpdateDefinitionStages.WithKeyVault, - UpdateDefinitionStages.WithSslType, - UpdateDefinitionStages.WithAttach { - } - - /** Grouping of hostname SSL binding definition stages applicable as part of a web app update. */ - interface UpdateDefinitionStages { - /** - * The first stage of a hostname SSL binding definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface Blank extends WithHostname { - } - - /** - * The stage of a hostname SSL binding definition allowing hostname to be specified. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithHostname { - /** - * Specifies the hostname to bind SSL certificate to. - * - * @param hostname the naked hostname, excluding "www". But use *. prefix for wild card typed certificate - * order. - * @return the next stage of the definition - */ - WithCertificate forHostname(String hostname); - } - - /** - * The stage of a hostname SSL binding definition allowing certificate information to be specified. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithCertificate { - /** - * Uploads a PFX certificate. - * - * @param pfxFile the PFX certificate file to upload - * @param password the password to the certificate - * @return the next stage of the definition - */ - WithSslType withPfxCertificateToUpload(File pfxFile, String password); - - /** - * Use an existing certificate in the resource group. - * - * @param certificateNameOrThumbprint the name or the thumbprint of the certificate - * @return the next stage of the definition - */ - WithSslType withExistingCertificate(String certificateNameOrThumbprint); - - /** - * Places a new App Service certificate order to use for the hostname. - * - * @param certificateOrderName the name of the certificate order - * @return the next stage of the definition - */ - WithKeyVault withNewStandardSslCertificateOrder(String certificateOrderName); - - /** - * Specifies a ready-to-use certificate order to use. This is usually useful for reusing wildcard - * certificates. - * - * @param certificateOrder the ready-to-use certificate order - * @return the next stage of the definition - */ - WithSslType withExistingAppServiceCertificateOrder(AppServiceCertificateOrder certificateOrder); - } - - /** - * The stage of a hostname SSL binding definition allowing key vault for certificate store to be specified. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithKeyVault { - /** - * Stores the certificate in an existing vault. - * - * @param vault the existing vault to use - * @return the next stage of the definition - */ - WithSslType withExistingKeyVault(Vault vault); - - /** - * Creates a new key vault to store the certificate. - * - * @param vaultName the name of the key vault to create - * @return the next stage of the definition - */ - WithSslType withNewKeyVault(String vaultName); - } - - /** - * The stage of a hostname SSL binding definition allowing SSL type to be specified. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithSslType { - /** - * Uses Server Name Indication (SNI) based SSL. - * - * @return the next stage of the definition - */ - WithAttach withSniBasedSsl(); - - /** - * Uses IP based SSL. Only one hostname can be bound to IP based SSL. - * - * @return the next stage of the definition - */ - WithAttach withIpBasedSsl(); - } - - /** - * The final stage of the hostname SSL binding definition. - * - *

At this stage, any remaining optional settings can be specified, or the hostname SSL binding definition - * can be attached to the parent web app update using {@link WithAttach#attach()}. - * - * @param the return type of {@link WithAttach#attach()} - */ - interface WithAttach extends Attachable.InUpdate { - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/HostnameSslState.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/HostnameSslState.java deleted file mode 100644 index 935a79943a02..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/HostnameSslState.java +++ /dev/null @@ -1,180 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** SSL-enabled hostname. */ -@Fluent -public final class HostnameSslState { - @JsonIgnore private final ClientLogger logger = new ClientLogger(HostnameSslState.class); - - /* - * Hostname. - */ - @JsonProperty(value = "name") - private String name; - - /* - * SSL type. - */ - @JsonProperty(value = "sslState") - private SslState sslState; - - /* - * Virtual IP address assigned to the hostname if IP based SSL is enabled. - */ - @JsonProperty(value = "virtualIP") - private String virtualIp; - - /* - * SSL certificate thumbprint. - */ - @JsonProperty(value = "thumbprint") - private String thumbprint; - - /* - * Set to true to update existing hostname. - */ - @JsonProperty(value = "toUpdate") - private Boolean toUpdate; - - /* - * Indicates whether the hostname is a standard or repository hostname. - */ - @JsonProperty(value = "hostType") - private HostType hostType; - - /** - * Get the name property: Hostname. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Hostname. - * - * @param name the name value to set. - * @return the HostnameSslState object itself. - */ - public HostnameSslState withName(String name) { - this.name = name; - return this; - } - - /** - * Get the sslState property: SSL type. - * - * @return the sslState value. - */ - public SslState sslState() { - return this.sslState; - } - - /** - * Set the sslState property: SSL type. - * - * @param sslState the sslState value to set. - * @return the HostnameSslState object itself. - */ - public HostnameSslState withSslState(SslState sslState) { - this.sslState = sslState; - return this; - } - - /** - * Get the virtualIp property: Virtual IP address assigned to the hostname if IP based SSL is enabled. - * - * @return the virtualIp value. - */ - public String virtualIp() { - return this.virtualIp; - } - - /** - * Set the virtualIp property: Virtual IP address assigned to the hostname if IP based SSL is enabled. - * - * @param virtualIp the virtualIp value to set. - * @return the HostnameSslState object itself. - */ - public HostnameSslState withVirtualIp(String virtualIp) { - this.virtualIp = virtualIp; - return this; - } - - /** - * Get the thumbprint property: SSL certificate thumbprint. - * - * @return the thumbprint value. - */ - public String thumbprint() { - return this.thumbprint; - } - - /** - * Set the thumbprint property: SSL certificate thumbprint. - * - * @param thumbprint the thumbprint value to set. - * @return the HostnameSslState object itself. - */ - public HostnameSslState withThumbprint(String thumbprint) { - this.thumbprint = thumbprint; - return this; - } - - /** - * Get the toUpdate property: Set to <code>true</code> to update existing hostname. - * - * @return the toUpdate value. - */ - public Boolean toUpdate() { - return this.toUpdate; - } - - /** - * Set the toUpdate property: Set to <code>true</code> to update existing hostname. - * - * @param toUpdate the toUpdate value to set. - * @return the HostnameSslState object itself. - */ - public HostnameSslState withToUpdate(Boolean toUpdate) { - this.toUpdate = toUpdate; - return this; - } - - /** - * Get the hostType property: Indicates whether the hostname is a standard or repository hostname. - * - * @return the hostType value. - */ - public HostType hostType() { - return this.hostType; - } - - /** - * Set the hostType property: Indicates whether the hostname is a standard or repository hostname. - * - * @param hostType the hostType value to set. - * @return the HostnameSslState object itself. - */ - public HostnameSslState withHostType(HostType hostType) { - this.hostType = hostType; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/HostnameType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/HostnameType.java deleted file mode 100644 index 762c6f430a7d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/HostnameType.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for HostnameType. */ -public enum HostnameType { - /** Enum value Verified. */ - VERIFIED("Verified"), - - /** Enum value Managed. */ - MANAGED("Managed"); - - /** The actual serialized value for a HostnameType instance. */ - private final String value; - - HostnameType(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a HostnameType instance. - * - * @param value the serialized value to parse. - * @return the parsed HostnameType object, or null if unable to parse. - */ - @JsonCreator - public static HostnameType fromString(String value) { - HostnameType[] items = HostnameType.values(); - for (HostnameType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/HttpLogsConfig.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/HttpLogsConfig.java deleted file mode 100644 index 0c00dced0fe0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/HttpLogsConfig.java +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Http logs configuration. */ -@Fluent -public final class HttpLogsConfig { - @JsonIgnore private final ClientLogger logger = new ClientLogger(HttpLogsConfig.class); - - /* - * Http logs to file system configuration. - */ - @JsonProperty(value = "fileSystem") - private FileSystemHttpLogsConfig fileSystem; - - /* - * Http logs to azure blob storage configuration. - */ - @JsonProperty(value = "azureBlobStorage") - private AzureBlobStorageHttpLogsConfig azureBlobStorage; - - /** - * Get the fileSystem property: Http logs to file system configuration. - * - * @return the fileSystem value. - */ - public FileSystemHttpLogsConfig fileSystem() { - return this.fileSystem; - } - - /** - * Set the fileSystem property: Http logs to file system configuration. - * - * @param fileSystem the fileSystem value to set. - * @return the HttpLogsConfig object itself. - */ - public HttpLogsConfig withFileSystem(FileSystemHttpLogsConfig fileSystem) { - this.fileSystem = fileSystem; - return this; - } - - /** - * Get the azureBlobStorage property: Http logs to azure blob storage configuration. - * - * @return the azureBlobStorage value. - */ - public AzureBlobStorageHttpLogsConfig azureBlobStorage() { - return this.azureBlobStorage; - } - - /** - * Set the azureBlobStorage property: Http logs to azure blob storage configuration. - * - * @param azureBlobStorage the azureBlobStorage value to set. - * @return the HttpLogsConfig object itself. - */ - public HttpLogsConfig withAzureBlobStorage(AzureBlobStorageHttpLogsConfig azureBlobStorage) { - this.azureBlobStorage = azureBlobStorage; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (fileSystem() != null) { - fileSystem().validate(); - } - if (azureBlobStorage() != null) { - azureBlobStorage().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/HybridConnectionCollection.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/HybridConnectionCollection.java deleted file mode 100644 index 7840d0b4371f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/HybridConnectionCollection.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.models.HybridConnectionInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Collection of hostname bindings. */ -@Fluent -public final class HybridConnectionCollection { - @JsonIgnore private final ClientLogger logger = new ClientLogger(HybridConnectionCollection.class); - - /* - * Collection of resources. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * Link to next page of resources. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: Collection of resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Collection of resources. - * - * @param value the value value to set. - * @return the HybridConnectionCollection object itself. - */ - public HybridConnectionCollection withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to next page of resources. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property value in model HybridConnectionCollection")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/IdentifierCollection.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/IdentifierCollection.java deleted file mode 100644 index 7251d850d1e0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/IdentifierCollection.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.models.IdentifierInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Collection of identifiers. */ -@Fluent -public final class IdentifierCollection { - @JsonIgnore private final ClientLogger logger = new ClientLogger(IdentifierCollection.class); - - /* - * Collection of resources. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * Link to next page of resources. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: Collection of resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Collection of resources. - * - * @param value the value value to set. - * @return the IdentifierCollection object itself. - */ - public IdentifierCollection withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to next page of resources. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model IdentifierCollection")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/InAvailabilityReasonType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/InAvailabilityReasonType.java deleted file mode 100644 index 3fe9537f62d5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/InAvailabilityReasonType.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for InAvailabilityReasonType. */ -public final class InAvailabilityReasonType extends ExpandableStringEnum { - /** Static value Invalid for InAvailabilityReasonType. */ - public static final InAvailabilityReasonType INVALID = fromString("Invalid"); - - /** Static value AlreadyExists for InAvailabilityReasonType. */ - public static final InAvailabilityReasonType ALREADY_EXISTS = fromString("AlreadyExists"); - - /** - * Creates or finds a InAvailabilityReasonType from its string representation. - * - * @param name a name to look for. - * @return the corresponding InAvailabilityReasonType. - */ - @JsonCreator - public static InAvailabilityReasonType fromString(String name) { - return fromString(name, InAvailabilityReasonType.class); - } - - /** @return known InAvailabilityReasonType values. */ - public static Collection values() { - return values(InAvailabilityReasonType.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/InboundEnvironmentEndpointCollection.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/InboundEnvironmentEndpointCollection.java deleted file mode 100644 index cb6ea49a32f9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/InboundEnvironmentEndpointCollection.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.models.InboundEnvironmentEndpointInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Collection of Inbound Environment Endpoints. */ -@Fluent -public final class InboundEnvironmentEndpointCollection { - @JsonIgnore private final ClientLogger logger = new ClientLogger(InboundEnvironmentEndpointCollection.class); - - /* - * Collection of resources. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * Link to next page of resources. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: Collection of resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Collection of resources. - * - * @param value the value value to set. - * @return the InboundEnvironmentEndpointCollection object itself. - */ - public InboundEnvironmentEndpointCollection withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to next page of resources. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property value in model InboundEnvironmentEndpointCollection")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/InternalLoadBalancingMode.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/InternalLoadBalancingMode.java deleted file mode 100644 index f6e23f210959..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/InternalLoadBalancingMode.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for InternalLoadBalancingMode. */ -public enum InternalLoadBalancingMode { - /** Enum value None. */ - NONE("None"), - - /** Enum value Web. */ - WEB("Web"), - - /** Enum value Publishing. */ - PUBLISHING("Publishing"); - - /** The actual serialized value for a InternalLoadBalancingMode instance. */ - private final String value; - - InternalLoadBalancingMode(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a InternalLoadBalancingMode instance. - * - * @param value the serialized value to parse. - * @return the parsed InternalLoadBalancingMode object, or null if unable to parse. - */ - @JsonCreator - public static InternalLoadBalancingMode fromString(String value) { - InternalLoadBalancingMode[] items = InternalLoadBalancingMode.values(); - for (InternalLoadBalancingMode item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/IpFilterTag.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/IpFilterTag.java deleted file mode 100644 index 235075d42374..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/IpFilterTag.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for IpFilterTag. */ -public enum IpFilterTag { - /** Enum value Default. */ - DEFAULT("Default"), - - /** Enum value XffProxy. */ - XFF_PROXY("XffProxy"); - - - /** Static value ServiceTag for IpFilterTag. */ - public static final IpFilterTag SERVICE_TAG = fromString("ServiceTag"); - - /** The actual serialized value for a IpFilterTag instance. */ - private final String value; - - IpFilterTag(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a IpFilterTag instance. - * - * @param value the serialized value to parse. - * @return the parsed IpFilterTag object, or null if unable to parse. - */ - @JsonCreator - public static IpFilterTag fromString(String value) { - IpFilterTag[] items = IpFilterTag.values(); - for (IpFilterTag item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/IpSecurityRestriction.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/IpSecurityRestriction.java deleted file mode 100644 index e95638feb387..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/IpSecurityRestriction.java +++ /dev/null @@ -1,292 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** IP security restriction on an app. */ -@Fluent -public final class IpSecurityRestriction { - @JsonIgnore private final ClientLogger logger = new ClientLogger(IpSecurityRestriction.class); - - /* - * IP address the security restriction is valid for. - * It can be in form of pure ipv4 address (required SubnetMask property) or - * CIDR notation such as ipv4/mask (leading bit match). For CIDR, - * SubnetMask property must not be specified. - */ - @JsonProperty(value = "ipAddress") - private String ipAddress; - - /* - * Subnet mask for the range of IP addresses the restriction is valid for. - */ - @JsonProperty(value = "subnetMask") - private String subnetMask; - - /* - * Virtual network resource id - */ - @JsonProperty(value = "vnetSubnetResourceId") - private String vnetSubnetResourceId; - - /* - * (internal) Vnet traffic tag - */ - @JsonProperty(value = "vnetTrafficTag") - private Integer vnetTrafficTag; - - /* - * (internal) Subnet traffic tag - */ - @JsonProperty(value = "subnetTrafficTag") - private Integer subnetTrafficTag; - - /* - * Allow or Deny access for this IP range. - */ - @JsonProperty(value = "action") - private String action; - - /* - * Defines what this IP filter will be used for. This is to support IP - * filtering on proxies. - */ - @JsonProperty(value = "tag") - private IpFilterTag tag; - - /* - * Priority of IP restriction rule. - */ - @JsonProperty(value = "priority") - private Integer priority; - - /* - * IP restriction rule name. - */ - @JsonProperty(value = "name") - private String name; - - /* - * IP restriction rule description. - */ - @JsonProperty(value = "description") - private String description; - - /** - * Get the ipAddress property: IP address the security restriction is valid for. It can be in form of pure ipv4 - * address (required SubnetMask property) or CIDR notation such as ipv4/mask (leading bit match). For CIDR, - * SubnetMask property must not be specified. - * - * @return the ipAddress value. - */ - public String ipAddress() { - return this.ipAddress; - } - - /** - * Set the ipAddress property: IP address the security restriction is valid for. It can be in form of pure ipv4 - * address (required SubnetMask property) or CIDR notation such as ipv4/mask (leading bit match). For CIDR, - * SubnetMask property must not be specified. - * - * @param ipAddress the ipAddress value to set. - * @return the IpSecurityRestriction object itself. - */ - public IpSecurityRestriction withIpAddress(String ipAddress) { - this.ipAddress = ipAddress; - return this; - } - - /** - * Get the subnetMask property: Subnet mask for the range of IP addresses the restriction is valid for. - * - * @return the subnetMask value. - */ - public String subnetMask() { - return this.subnetMask; - } - - /** - * Set the subnetMask property: Subnet mask for the range of IP addresses the restriction is valid for. - * - * @param subnetMask the subnetMask value to set. - * @return the IpSecurityRestriction object itself. - */ - public IpSecurityRestriction withSubnetMask(String subnetMask) { - this.subnetMask = subnetMask; - return this; - } - - /** - * Get the vnetSubnetResourceId property: Virtual network resource id. - * - * @return the vnetSubnetResourceId value. - */ - public String vnetSubnetResourceId() { - return this.vnetSubnetResourceId; - } - - /** - * Set the vnetSubnetResourceId property: Virtual network resource id. - * - * @param vnetSubnetResourceId the vnetSubnetResourceId value to set. - * @return the IpSecurityRestriction object itself. - */ - public IpSecurityRestriction withVnetSubnetResourceId(String vnetSubnetResourceId) { - this.vnetSubnetResourceId = vnetSubnetResourceId; - return this; - } - - /** - * Get the vnetTrafficTag property: (internal) Vnet traffic tag. - * - * @return the vnetTrafficTag value. - */ - public Integer vnetTrafficTag() { - return this.vnetTrafficTag; - } - - /** - * Set the vnetTrafficTag property: (internal) Vnet traffic tag. - * - * @param vnetTrafficTag the vnetTrafficTag value to set. - * @return the IpSecurityRestriction object itself. - */ - public IpSecurityRestriction withVnetTrafficTag(Integer vnetTrafficTag) { - this.vnetTrafficTag = vnetTrafficTag; - return this; - } - - /** - * Get the subnetTrafficTag property: (internal) Subnet traffic tag. - * - * @return the subnetTrafficTag value. - */ - public Integer subnetTrafficTag() { - return this.subnetTrafficTag; - } - - /** - * Set the subnetTrafficTag property: (internal) Subnet traffic tag. - * - * @param subnetTrafficTag the subnetTrafficTag value to set. - * @return the IpSecurityRestriction object itself. - */ - public IpSecurityRestriction withSubnetTrafficTag(Integer subnetTrafficTag) { - this.subnetTrafficTag = subnetTrafficTag; - return this; - } - - /** - * Get the action property: Allow or Deny access for this IP range. - * - * @return the action value. - */ - public String action() { - return this.action; - } - - /** - * Set the action property: Allow or Deny access for this IP range. - * - * @param action the action value to set. - * @return the IpSecurityRestriction object itself. - */ - public IpSecurityRestriction withAction(String action) { - this.action = action; - return this; - } - - /** - * Get the tag property: Defines what this IP filter will be used for. This is to support IP filtering on proxies. - * - * @return the tag value. - */ - public IpFilterTag tag() { - return this.tag; - } - - /** - * Set the tag property: Defines what this IP filter will be used for. This is to support IP filtering on proxies. - * - * @param tag the tag value to set. - * @return the IpSecurityRestriction object itself. - */ - public IpSecurityRestriction withTag(IpFilterTag tag) { - this.tag = tag; - return this; - } - - /** - * Get the priority property: Priority of IP restriction rule. - * - * @return the priority value. - */ - public Integer priority() { - return this.priority; - } - - /** - * Set the priority property: Priority of IP restriction rule. - * - * @param priority the priority value to set. - * @return the IpSecurityRestriction object itself. - */ - public IpSecurityRestriction withPriority(Integer priority) { - this.priority = priority; - return this; - } - - /** - * Get the name property: IP restriction rule name. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: IP restriction rule name. - * - * @param name the name value to set. - * @return the IpSecurityRestriction object itself. - */ - public IpSecurityRestriction withName(String name) { - this.name = name; - return this; - } - - /** - * Get the description property: IP restriction rule description. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: IP restriction rule description. - * - * @param description the description value to set. - * @return the IpSecurityRestriction object itself. - */ - public IpSecurityRestriction withDescription(String description) { - this.description = description; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/IssueType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/IssueType.java deleted file mode 100644 index a57d76b4ba6f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/IssueType.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for IssueType. */ -public enum IssueType { - /** Enum value ServiceIncident. */ - SERVICE_INCIDENT("ServiceIncident"), - - /** Enum value AppDeployment. */ - APP_DEPLOYMENT("AppDeployment"), - - /** Enum value AppCrash. */ - APP_CRASH("AppCrash"), - - /** Enum value RuntimeIssueDetected. */ - RUNTIME_ISSUE_DETECTED("RuntimeIssueDetected"), - - /** Enum value AseDeployment. */ - ASE_DEPLOYMENT("AseDeployment"), - - /** Enum value UserIssue. */ - USER_ISSUE("UserIssue"), - - /** Enum value PlatformIssue. */ - PLATFORM_ISSUE("PlatformIssue"), - - /** Enum value Other. */ - OTHER("Other"); - - /** The actual serialized value for a IssueType instance. */ - private final String value; - - IssueType(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a IssueType instance. - * - * @param value the serialized value to parse. - * @return the parsed IssueType object, or null if unable to parse. - */ - @JsonCreator - public static IssueType fromString(String value) { - IssueType[] items = IssueType.values(); - for (IssueType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/JavaVersion.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/JavaVersion.java deleted file mode 100644 index 96cb82d07cc1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/JavaVersion.java +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.util.ExpandableStringEnum; - -import java.util.Collection; - -/** Defines values for Java versions. */ -public final class JavaVersion extends ExpandableStringEnum { - /** Static value 'Off' for JavaVersion. */ - public static final JavaVersion OFF = fromString("null"); - - /** Static value Java 7 newest for JavaVersion. */ - public static final JavaVersion JAVA_7_NEWEST = fromString("1.7"); - - /** Static value 1.7.0_51 for JavaVersion. */ - public static final JavaVersion JAVA_1_7_0_51 = fromString("1.7.0_51"); - - /** Static value 1.7.0_71 for JavaVersion. */ - public static final JavaVersion JAVA_1_7_0_71 = fromString("1.7.0_71"); - - /** Static value 1.7.0_80 for JavaVersion. */ - public static final JavaVersion JAVA_1_7_0_80 = fromString("1.7.0_80"); - - /** Static value 1.7.0_191_ZULU for JavaVersion. */ - public static final JavaVersion JAVA_ZULU_1_7_0_191 = fromString("1.7.0_191_ZULU"); - - /** Static value Java 8 newest for JavaVersion. */ - public static final JavaVersion JAVA_8_NEWEST = fromString("1.8"); - - /** Static value 1.8.0_25 for JavaVersion. */ - public static final JavaVersion JAVA_1_8_0_25 = fromString("1.8.0_25"); - - /** Static value 1.8.0_60 for JavaVersion. */ - public static final JavaVersion JAVA_1_8_0_60 = fromString("1.8.0_60"); - - /** Static value 1.8.0_73 for JavaVersion. */ - public static final JavaVersion JAVA_1_8_0_73 = fromString("1.8.0_73"); - - /** Static value 1.8.0_111 for JavaVersion. */ - public static final JavaVersion JAVA_1_8_0_111 = fromString("1.8.0_111"); - - /** Static value 1.8.0_144 for JavaVersion. */ - public static final JavaVersion JAVA_1_8_0_144 = fromString("1.8.0_144"); - - /** Static value 1.8.0_172 for JavaVersion. */ - public static final JavaVersion JAVA_1_8_0_172 = fromString("1.8.0_172"); - - /** Static value 1.8.0_172_ZULU for JavaVersion. */ - public static final JavaVersion JAVA_ZULU_1_8_0_172 = fromString("1.8.0_172_ZULU"); - - /** Static value Zulu 1.8.0_92 for JavaVersion. */ - public static final JavaVersion JAVA_ZULU_1_8_0_92 = fromString("1.8.0_92"); - - /** Static value Zulu 1.8.0_102 for JavaVersion. */ - public static final JavaVersion JAVA_ZULU_1_8_0_102 = fromString("1.8.0_102"); - - /** Static value Zulu 1.8.0_181 for JavaVersion. */ - public static final JavaVersion JAVA_1_8_0_181 = fromString("1.8.0_181"); - - /** Static value Zulu 1.8.0_181_ZULU for JavaVersion. */ - public static final JavaVersion JAVA_ZULU_1_8_0_181 = fromString("1.8.0_181_ZULU"); - - /** Static value Zulu 1.8.0_202 for JavaVersion. */ - public static final JavaVersion JAVA_1_8_0_202 = fromString("1.8.0_202"); - - /** Static value Zulu 1.8.0_202_ZULU for JavaVersion. */ - public static final JavaVersion JAVA_ZULU_1_8_0_202 = fromString("1.8.0_202_ZULU"); - - /** Static value Zulu 11 for JavaVersion. */ - public static final JavaVersion JAVA_11 = fromString("11"); - - /** Static value Zulu 11.0.2_ZULU for JavaVersion. */ - public static final JavaVersion JAVA_ZULU_11_0_2 = fromString("11.0.2_ZULU"); - - /** - * Finds or creates a Java version value based on the provided name. - * - * @param name a name - * @return a JavaVersion instance - */ - public static JavaVersion fromString(String name) { - return fromString(name, JavaVersion.class); - } - - /** @return known Java versions */ - public static Collection values() { - return values(JavaVersion.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/KeyVaultSecretStatus.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/KeyVaultSecretStatus.java deleted file mode 100644 index ceee795d920d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/KeyVaultSecretStatus.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for KeyVaultSecretStatus. */ -public enum KeyVaultSecretStatus { - /** Enum value Initialized. */ - INITIALIZED("Initialized"), - - /** Enum value WaitingOnCertificateOrder. */ - WAITING_ON_CERTIFICATE_ORDER("WaitingOnCertificateOrder"), - - /** Enum value Succeeded. */ - SUCCEEDED("Succeeded"), - - /** Enum value CertificateOrderFailed. */ - CERTIFICATE_ORDER_FAILED("CertificateOrderFailed"), - - /** Enum value OperationNotPermittedOnKeyVault. */ - OPERATION_NOT_PERMITTED_ON_KEY_VAULT("OperationNotPermittedOnKeyVault"), - - /** Enum value AzureServiceUnauthorizedToAccessKeyVault. */ - AZURE_SERVICE_UNAUTHORIZED_TO_ACCESS_KEY_VAULT("AzureServiceUnauthorizedToAccessKeyVault"), - - /** Enum value KeyVaultDoesNotExist. */ - KEY_VAULT_DOES_NOT_EXIST("KeyVaultDoesNotExist"), - - /** Enum value KeyVaultSecretDoesNotExist. */ - KEY_VAULT_SECRET_DOES_NOT_EXIST("KeyVaultSecretDoesNotExist"), - - /** Enum value UnknownError. */ - UNKNOWN_ERROR("UnknownError"), - - /** Enum value ExternalPrivateKey. */ - EXTERNAL_PRIVATE_KEY("ExternalPrivateKey"), - - /** Enum value Unknown. */ - UNKNOWN("Unknown"); - - /** The actual serialized value for a KeyVaultSecretStatus instance. */ - private final String value; - - KeyVaultSecretStatus(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a KeyVaultSecretStatus instance. - * - * @param value the serialized value to parse. - * @return the parsed KeyVaultSecretStatus object, or null if unable to parse. - */ - @JsonCreator - public static KeyVaultSecretStatus fromString(String value) { - KeyVaultSecretStatus[] items = KeyVaultSecretStatus.values(); - for (KeyVaultSecretStatus item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/KuduAuthenticationPolicy.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/KuduAuthenticationPolicy.java deleted file mode 100644 index a84dee40368b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/KuduAuthenticationPolicy.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.http.HttpPipelineCallContext; -import com.azure.core.http.HttpPipelineNextPolicy; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.policy.HttpPipelinePolicy; -import reactor.core.publisher.Mono; - -import java.nio.charset.StandardCharsets; -import java.util.Base64; - -/** - * Kudu web app authentication via basic auth - */ -public final class KuduAuthenticationPolicy implements HttpPipelinePolicy { - private final WebAppBase webApp; - private static final String HEADER_NAME = "Authorization"; - private String basicToken; - - /** - * Constructor - * @param webApp the web app - */ - public KuduAuthenticationPolicy(WebAppBase webApp) { - this.webApp = webApp; - } - - @Override - public Mono process(HttpPipelineCallContext context, HttpPipelineNextPolicy next) { - Mono basicTokenMono = - basicToken == null - ? webApp - .getPublishingProfileAsync() - .map( - profile -> { - basicToken = - Base64 - .getEncoder() - .encodeToString( - (profile.gitUsername() + ":" + profile.gitPassword()) - .getBytes(StandardCharsets.UTF_8)); - return basicToken; - }) - : Mono.just(basicToken); - return basicTokenMono - .flatMap( - key -> { - context.getHttpRequest().setHeader(HEADER_NAME, "Basic " + basicToken); - return next.process(); - }); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/LocalizableString.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/LocalizableString.java deleted file mode 100644 index 802aae7e45c3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/LocalizableString.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Localizable string object containing the name and a localized value. */ -@Fluent -public final class LocalizableString { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LocalizableString.class); - - /* - * Non-localized name. - */ - @JsonProperty(value = "value") - private String value; - - /* - * Localized name. - */ - @JsonProperty(value = "localizedValue") - private String localizedValue; - - /** - * Get the value property: Non-localized name. - * - * @return the value value. - */ - public String value() { - return this.value; - } - - /** - * Set the value property: Non-localized name. - * - * @param value the value value to set. - * @return the LocalizableString object itself. - */ - public LocalizableString withValue(String value) { - this.value = value; - return this; - } - - /** - * Get the localizedValue property: Localized name. - * - * @return the localizedValue value. - */ - public String localizedValue() { - return this.localizedValue; - } - - /** - * Set the localizedValue property: Localized name. - * - * @param localizedValue the localizedValue value to set. - * @return the LocalizableString object itself. - */ - public LocalizableString withLocalizedValue(String localizedValue) { - this.localizedValue = localizedValue; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/LogLevel.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/LogLevel.java deleted file mode 100644 index fd93b4aaf533..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/LogLevel.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for LogLevel. */ -public enum LogLevel { - /** Enum value Off. */ - OFF("Off"), - - /** Enum value Verbose. */ - VERBOSE("Verbose"), - - /** Enum value Information. */ - INFORMATION("Information"), - - /** Enum value Warning. */ - WARNING("Warning"), - - /** Enum value Error. */ - ERROR("Error"); - - /** The actual serialized value for a LogLevel instance. */ - private final String value; - - LogLevel(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a LogLevel instance. - * - * @param value the serialized value to parse. - * @return the parsed LogLevel object, or null if unable to parse. - */ - @JsonCreator - public static LogLevel fromString(String value) { - LogLevel[] items = LogLevel.values(); - for (LogLevel item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/LogSpecification.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/LogSpecification.java deleted file mode 100644 index da3aa0f52b44..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/LogSpecification.java +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Log Definition of a single resource metric. */ -@Fluent -public final class LogSpecification { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LogSpecification.class); - - /* - * The name property. - */ - @JsonProperty(value = "name") - private String name; - - /* - * The displayName property. - */ - @JsonProperty(value = "displayName") - private String displayName; - - /* - * The blobDuration property. - */ - @JsonProperty(value = "blobDuration") - private String blobDuration; - - /** - * Get the name property: The name property. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name property. - * - * @param name the name value to set. - * @return the LogSpecification object itself. - */ - public LogSpecification withName(String name) { - this.name = name; - return this; - } - - /** - * Get the displayName property: The displayName property. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Set the displayName property: The displayName property. - * - * @param displayName the displayName value to set. - * @return the LogSpecification object itself. - */ - public LogSpecification withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - - /** - * Get the blobDuration property: The blobDuration property. - * - * @return the blobDuration value. - */ - public String blobDuration() { - return this.blobDuration; - } - - /** - * Set the blobDuration property: The blobDuration property. - * - * @param blobDuration the blobDuration value to set. - * @return the LogSpecification object itself. - */ - public LogSpecification withBlobDuration(String blobDuration) { - this.blobDuration = blobDuration; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/MSDeploy.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/MSDeploy.java deleted file mode 100644 index c104873ba445..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/MSDeploy.java +++ /dev/null @@ -1,248 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.models.MSDeployProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** MSDeploy ARM PUT information. */ -@Fluent -public final class MSDeploy extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MSDeploy.class); - - /* - * Core resource properties - */ - @JsonProperty(value = "properties") - private MSDeployProperties innerProperties; - - /** - * Get the innerProperties property: Core resource properties. - * - * @return the innerProperties value. - */ - private MSDeployProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public MSDeploy withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the addOnPackages property: List of Add-On packages. Add-On packages implicitly enable the Do Not Delete - * MSDeploy rule. - * - * @return the addOnPackages value. - */ - public List addOnPackages() { - return this.innerProperties() == null ? null : this.innerProperties().addOnPackages(); - } - - /** - * Set the addOnPackages property: List of Add-On packages. Add-On packages implicitly enable the Do Not Delete - * MSDeploy rule. - * - * @param addOnPackages the addOnPackages value to set. - * @return the MSDeploy object itself. - */ - public MSDeploy withAddOnPackages(List addOnPackages) { - if (this.innerProperties() == null) { - this.innerProperties = new MSDeployProperties(); - } - this.innerProperties().withAddOnPackages(addOnPackages); - return this; - } - - /** - * Get the packageUri property: Package URI. - * - * @return the packageUri value. - */ - public String packageUri() { - return this.innerProperties() == null ? null : this.innerProperties().packageUri(); - } - - /** - * Set the packageUri property: Package URI. - * - * @param packageUri the packageUri value to set. - * @return the MSDeploy object itself. - */ - public MSDeploy withPackageUri(String packageUri) { - if (this.innerProperties() == null) { - this.innerProperties = new MSDeployProperties(); - } - this.innerProperties().withPackageUri(packageUri); - return this; - } - - /** - * Get the connectionString property: SQL Connection String. - * - * @return the connectionString value. - */ - public String connectionString() { - return this.innerProperties() == null ? null : this.innerProperties().connectionString(); - } - - /** - * Set the connectionString property: SQL Connection String. - * - * @param connectionString the connectionString value to set. - * @return the MSDeploy object itself. - */ - public MSDeploy withConnectionString(String connectionString) { - if (this.innerProperties() == null) { - this.innerProperties = new MSDeployProperties(); - } - this.innerProperties().withConnectionString(connectionString); - return this; - } - - /** - * Get the dbType property: Database Type. - * - * @return the dbType value. - */ - public String dbType() { - return this.innerProperties() == null ? null : this.innerProperties().dbType(); - } - - /** - * Set the dbType property: Database Type. - * - * @param dbType the dbType value to set. - * @return the MSDeploy object itself. - */ - public MSDeploy withDbType(String dbType) { - if (this.innerProperties() == null) { - this.innerProperties = new MSDeployProperties(); - } - this.innerProperties().withDbType(dbType); - return this; - } - - /** - * Get the setParametersXmlFileUri property: URI of MSDeploy Parameters file. Must not be set if SetParameters is - * used. - * - * @return the setParametersXmlFileUri value. - */ - public String setParametersXmlFileUri() { - return this.innerProperties() == null ? null : this.innerProperties().setParametersXmlFileUri(); - } - - /** - * Set the setParametersXmlFileUri property: URI of MSDeploy Parameters file. Must not be set if SetParameters is - * used. - * - * @param setParametersXmlFileUri the setParametersXmlFileUri value to set. - * @return the MSDeploy object itself. - */ - public MSDeploy withSetParametersXmlFileUri(String setParametersXmlFileUri) { - if (this.innerProperties() == null) { - this.innerProperties = new MSDeployProperties(); - } - this.innerProperties().withSetParametersXmlFileUri(setParametersXmlFileUri); - return this; - } - - /** - * Get the setParameters property: MSDeploy Parameters. Must not be set if SetParametersXmlFileUri is used. - * - * @return the setParameters value. - */ - public Map setParameters() { - return this.innerProperties() == null ? null : this.innerProperties().setParameters(); - } - - /** - * Set the setParameters property: MSDeploy Parameters. Must not be set if SetParametersXmlFileUri is used. - * - * @param setParameters the setParameters value to set. - * @return the MSDeploy object itself. - */ - public MSDeploy withSetParameters(Map setParameters) { - if (this.innerProperties() == null) { - this.innerProperties = new MSDeployProperties(); - } - this.innerProperties().withSetParameters(setParameters); - return this; - } - - /** - * Get the skipAppData property: Controls whether the MSDeploy operation skips the App_Data directory. If set to - * <code>true</code>, the existing App_Data directory on the destination will not be deleted, and any - * App_Data directory in the source will be ignored. Setting is <code>false</code> by default. - * - * @return the skipAppData value. - */ - public Boolean skipAppData() { - return this.innerProperties() == null ? null : this.innerProperties().skipAppData(); - } - - /** - * Set the skipAppData property: Controls whether the MSDeploy operation skips the App_Data directory. If set to - * <code>true</code>, the existing App_Data directory on the destination will not be deleted, and any - * App_Data directory in the source will be ignored. Setting is <code>false</code> by default. - * - * @param skipAppData the skipAppData value to set. - * @return the MSDeploy object itself. - */ - public MSDeploy withSkipAppData(Boolean skipAppData) { - if (this.innerProperties() == null) { - this.innerProperties = new MSDeployProperties(); - } - this.innerProperties().withSkipAppData(skipAppData); - return this; - } - - /** - * Get the appOffline property: Sets the AppOffline rule while the MSDeploy operation executes. Setting is - * <code>false</code> by default. - * - * @return the appOffline value. - */ - public Boolean appOffline() { - return this.innerProperties() == null ? null : this.innerProperties().appOffline(); - } - - /** - * Set the appOffline property: Sets the AppOffline rule while the MSDeploy operation executes. Setting is - * <code>false</code> by default. - * - * @param appOffline the appOffline value to set. - * @return the MSDeploy object itself. - */ - public MSDeploy withAppOffline(Boolean appOffline) { - if (this.innerProperties() == null) { - this.innerProperties = new MSDeployProperties(); - } - this.innerProperties().withAppOffline(appOffline); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/MSDeployCore.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/MSDeployCore.java deleted file mode 100644 index 6994071453c5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/MSDeployCore.java +++ /dev/null @@ -1,224 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** MSDeploy ARM PUT core information. */ -@Fluent -public class MSDeployCore { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MSDeployCore.class); - - /* - * Package URI - */ - @JsonProperty(value = "packageUri") - private String packageUri; - - /* - * SQL Connection String - */ - @JsonProperty(value = "connectionString") - private String connectionString; - - /* - * Database Type - */ - @JsonProperty(value = "dbType") - private String dbType; - - /* - * URI of MSDeploy Parameters file. Must not be set if SetParameters is - * used. - */ - @JsonProperty(value = "setParametersXmlFileUri") - private String setParametersXmlFileUri; - - /* - * MSDeploy Parameters. Must not be set if SetParametersXmlFileUri is used. - */ - @JsonProperty(value = "setParameters") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map setParameters; - - /* - * Controls whether the MSDeploy operation skips the App_Data directory. - * If set to true, the existing App_Data directory on the - * destination - * will not be deleted, and any App_Data directory in the source will be - * ignored. - * Setting is false by default. - */ - @JsonProperty(value = "skipAppData") - private Boolean skipAppData; - - /* - * Sets the AppOffline rule while the MSDeploy operation executes. - * Setting is false by default. - */ - @JsonProperty(value = "appOffline") - private Boolean appOffline; - - /** - * Get the packageUri property: Package URI. - * - * @return the packageUri value. - */ - public String packageUri() { - return this.packageUri; - } - - /** - * Set the packageUri property: Package URI. - * - * @param packageUri the packageUri value to set. - * @return the MSDeployCore object itself. - */ - public MSDeployCore withPackageUri(String packageUri) { - this.packageUri = packageUri; - return this; - } - - /** - * Get the connectionString property: SQL Connection String. - * - * @return the connectionString value. - */ - public String connectionString() { - return this.connectionString; - } - - /** - * Set the connectionString property: SQL Connection String. - * - * @param connectionString the connectionString value to set. - * @return the MSDeployCore object itself. - */ - public MSDeployCore withConnectionString(String connectionString) { - this.connectionString = connectionString; - return this; - } - - /** - * Get the dbType property: Database Type. - * - * @return the dbType value. - */ - public String dbType() { - return this.dbType; - } - - /** - * Set the dbType property: Database Type. - * - * @param dbType the dbType value to set. - * @return the MSDeployCore object itself. - */ - public MSDeployCore withDbType(String dbType) { - this.dbType = dbType; - return this; - } - - /** - * Get the setParametersXmlFileUri property: URI of MSDeploy Parameters file. Must not be set if SetParameters is - * used. - * - * @return the setParametersXmlFileUri value. - */ - public String setParametersXmlFileUri() { - return this.setParametersXmlFileUri; - } - - /** - * Set the setParametersXmlFileUri property: URI of MSDeploy Parameters file. Must not be set if SetParameters is - * used. - * - * @param setParametersXmlFileUri the setParametersXmlFileUri value to set. - * @return the MSDeployCore object itself. - */ - public MSDeployCore withSetParametersXmlFileUri(String setParametersXmlFileUri) { - this.setParametersXmlFileUri = setParametersXmlFileUri; - return this; - } - - /** - * Get the setParameters property: MSDeploy Parameters. Must not be set if SetParametersXmlFileUri is used. - * - * @return the setParameters value. - */ - public Map setParameters() { - return this.setParameters; - } - - /** - * Set the setParameters property: MSDeploy Parameters. Must not be set if SetParametersXmlFileUri is used. - * - * @param setParameters the setParameters value to set. - * @return the MSDeployCore object itself. - */ - public MSDeployCore withSetParameters(Map setParameters) { - this.setParameters = setParameters; - return this; - } - - /** - * Get the skipAppData property: Controls whether the MSDeploy operation skips the App_Data directory. If set to - * <code>true</code>, the existing App_Data directory on the destination will not be deleted, and any - * App_Data directory in the source will be ignored. Setting is <code>false</code> by default. - * - * @return the skipAppData value. - */ - public Boolean skipAppData() { - return this.skipAppData; - } - - /** - * Set the skipAppData property: Controls whether the MSDeploy operation skips the App_Data directory. If set to - * <code>true</code>, the existing App_Data directory on the destination will not be deleted, and any - * App_Data directory in the source will be ignored. Setting is <code>false</code> by default. - * - * @param skipAppData the skipAppData value to set. - * @return the MSDeployCore object itself. - */ - public MSDeployCore withSkipAppData(Boolean skipAppData) { - this.skipAppData = skipAppData; - return this; - } - - /** - * Get the appOffline property: Sets the AppOffline rule while the MSDeploy operation executes. Setting is - * <code>false</code> by default. - * - * @return the appOffline value. - */ - public Boolean appOffline() { - return this.appOffline; - } - - /** - * Set the appOffline property: Sets the AppOffline rule while the MSDeploy operation executes. Setting is - * <code>false</code> by default. - * - * @param appOffline the appOffline value to set. - * @return the MSDeployCore object itself. - */ - public MSDeployCore withAppOffline(Boolean appOffline) { - this.appOffline = appOffline; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/MSDeployLogEntry.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/MSDeployLogEntry.java deleted file mode 100644 index f2c9ea089ae0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/MSDeployLogEntry.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** MSDeploy log entry. */ -@Immutable -public final class MSDeployLogEntry { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MSDeployLogEntry.class); - - /* - * Timestamp of log entry - */ - @JsonProperty(value = "time", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime time; - - /* - * Log entry type - */ - @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) - private MSDeployLogEntryType type; - - /* - * Log entry message - */ - @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) - private String message; - - /** - * Get the time property: Timestamp of log entry. - * - * @return the time value. - */ - public OffsetDateTime time() { - return this.time; - } - - /** - * Get the type property: Log entry type. - * - * @return the type value. - */ - public MSDeployLogEntryType type() { - return this.type; - } - - /** - * Get the message property: Log entry message. - * - * @return the message value. - */ - public String message() { - return this.message; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/MSDeployLogEntryType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/MSDeployLogEntryType.java deleted file mode 100644 index bfe708c06561..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/MSDeployLogEntryType.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for MSDeployLogEntryType. */ -public enum MSDeployLogEntryType { - /** Enum value Message. */ - MESSAGE("Message"), - - /** Enum value Warning. */ - WARNING("Warning"), - - /** Enum value Error. */ - ERROR("Error"); - - /** The actual serialized value for a MSDeployLogEntryType instance. */ - private final String value; - - MSDeployLogEntryType(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a MSDeployLogEntryType instance. - * - * @param value the serialized value to parse. - * @return the parsed MSDeployLogEntryType object, or null if unable to parse. - */ - @JsonCreator - public static MSDeployLogEntryType fromString(String value) { - MSDeployLogEntryType[] items = MSDeployLogEntryType.values(); - for (MSDeployLogEntryType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/MSDeployProvisioningState.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/MSDeployProvisioningState.java deleted file mode 100644 index 558d53d4ff41..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/MSDeployProvisioningState.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for MSDeployProvisioningState. */ -public enum MSDeployProvisioningState { - /** Enum value accepted. */ - ACCEPTED("accepted"), - - /** Enum value running. */ - RUNNING("running"), - - /** Enum value succeeded. */ - SUCCEEDED("succeeded"), - - /** Enum value failed. */ - FAILED("failed"), - - /** Enum value canceled. */ - CANCELED("canceled"); - - /** The actual serialized value for a MSDeployProvisioningState instance. */ - private final String value; - - MSDeployProvisioningState(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a MSDeployProvisioningState instance. - * - * @param value the serialized value to parse. - * @return the parsed MSDeployProvisioningState object, or null if unable to parse. - */ - @JsonCreator - public static MSDeployProvisioningState fromString(String value) { - MSDeployProvisioningState[] items = MSDeployProvisioningState.values(); - for (MSDeployProvisioningState item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ManagedPipelineMode.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ManagedPipelineMode.java deleted file mode 100644 index fbfe13912cf3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ManagedPipelineMode.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for ManagedPipelineMode. */ -public enum ManagedPipelineMode { - /** Enum value Integrated. */ - INTEGRATED("Integrated"), - - /** Enum value Classic. */ - CLASSIC("Classic"); - - /** The actual serialized value for a ManagedPipelineMode instance. */ - private final String value; - - ManagedPipelineMode(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a ManagedPipelineMode instance. - * - * @param value the serialized value to parse. - * @return the parsed ManagedPipelineMode object, or null if unable to parse. - */ - @JsonCreator - public static ManagedPipelineMode fromString(String value) { - ManagedPipelineMode[] items = ManagedPipelineMode.values(); - for (ManagedPipelineMode item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ManagedServiceIdentity.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ManagedServiceIdentity.java deleted file mode 100644 index e8f35b756942..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ManagedServiceIdentity.java +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** Managed service identity. */ -@Fluent -public class ManagedServiceIdentity { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedServiceIdentity.class); - - /* - * Type of managed service identity. - */ - @JsonProperty(value = "type") - private ManagedServiceIdentityType type; - - /* - * Tenant of managed service identity. - */ - @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) - private String tenantId; - - /* - * Principal Id of managed service identity. - */ - @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) - private String principalId; - - /* - * The list of user assigned identities associated with the resource. The - * user identity dictionary key references will be ARM resource ids in the - * form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName} - */ - @JsonProperty(value = "userAssignedIdentities") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map userAssignedIdentities; - - /** - * Get the type property: Type of managed service identity. - * - * @return the type value. - */ - public ManagedServiceIdentityType type() { - return this.type; - } - - /** - * Set the type property: Type of managed service identity. - * - * @param type the type value to set. - * @return the ManagedServiceIdentity object itself. - */ - public ManagedServiceIdentity withType(ManagedServiceIdentityType type) { - this.type = type; - return this; - } - - /** - * Get the tenantId property: Tenant of managed service identity. - * - * @return the tenantId value. - */ - public String tenantId() { - return this.tenantId; - } - - /** - * Get the principalId property: Principal Id of managed service identity. - * - * @return the principalId value. - */ - public String principalId() { - return this.principalId; - } - - /** - * Get the userAssignedIdentities property: The list of user assigned identities associated with the resource. The - * user identity dictionary key references will be ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - * - * @return the userAssignedIdentities value. - */ - public Map userAssignedIdentities() { - return this.userAssignedIdentities; - } - - /** - * Set the userAssignedIdentities property: The list of user assigned identities associated with the resource. The - * user identity dictionary key references will be ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - * - * @param userAssignedIdentities the userAssignedIdentities value to set. - * @return the ManagedServiceIdentity object itself. - */ - public ManagedServiceIdentity withUserAssignedIdentities( - Map userAssignedIdentities) { - this.userAssignedIdentities = userAssignedIdentities; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (userAssignedIdentities() != null) { - userAssignedIdentities() - .values() - .forEach( - e -> { - if (e != null) { - e.validate(); - } - }); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ManagedServiceIdentityType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ManagedServiceIdentityType.java deleted file mode 100644 index 72f5d9b7bb15..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ManagedServiceIdentityType.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ManagedServiceIdentityType. */ -public final class ManagedServiceIdentityType extends ExpandableStringEnum { - /** Static value SystemAssigned for ManagedServiceIdentityType. */ - public static final ManagedServiceIdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); - - /** Static value UserAssigned for ManagedServiceIdentityType. */ - public static final ManagedServiceIdentityType USER_ASSIGNED = fromString("UserAssigned"); - - /** Static value SystemAssigned, UserAssigned for ManagedServiceIdentityType. */ - public static final ManagedServiceIdentityType SYSTEM_ASSIGNED_USER_ASSIGNED = - fromString("SystemAssigned, UserAssigned"); - - /** Static value None for ManagedServiceIdentityType. */ - public static final ManagedServiceIdentityType NONE = fromString("None"); - - /** - * Creates or finds a ManagedServiceIdentityType from its string representation. - * - * @param name a name to look for. - * @return the corresponding ManagedServiceIdentityType. - */ - @JsonCreator - public static ManagedServiceIdentityType fromString(String name) { - return fromString(name, ManagedServiceIdentityType.class); - } - - /** @return known ManagedServiceIdentityType values. */ - public static Collection values() { - return values(ManagedServiceIdentityType.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ManagedServiceIdentityUserAssignedIdentities.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ManagedServiceIdentityUserAssignedIdentities.java deleted file mode 100644 index 9025ecf28788..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ManagedServiceIdentityUserAssignedIdentities.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The ManagedServiceIdentityUserAssignedIdentities model. */ -@Immutable -public final class ManagedServiceIdentityUserAssignedIdentities { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(ManagedServiceIdentityUserAssignedIdentities.class); - - /* - * Principal Id of user assigned identity - */ - @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) - private String principalId; - - /* - * Client Id of user assigned identity - */ - @JsonProperty(value = "clientId", access = JsonProperty.Access.WRITE_ONLY) - private String clientId; - - /** - * Get the principalId property: Principal Id of user assigned identity. - * - * @return the principalId value. - */ - public String principalId() { - return this.principalId; - } - - /** - * Get the clientId property: Client Id of user assigned identity. - * - * @return the clientId value. - */ - public String clientId() { - return this.clientId; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/MetricAvailabilily.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/MetricAvailabilily.java deleted file mode 100644 index abb34537bd7f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/MetricAvailabilily.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Metric availability and retention. */ -@Fluent -public final class MetricAvailabilily { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MetricAvailabilily.class); - - /* - * Time grain. - */ - @JsonProperty(value = "timeGrain") - private String timeGrain; - - /* - * Retention period for the current time grain. - */ - @JsonProperty(value = "retention") - private String retention; - - /** - * Get the timeGrain property: Time grain. - * - * @return the timeGrain value. - */ - public String timeGrain() { - return this.timeGrain; - } - - /** - * Set the timeGrain property: Time grain. - * - * @param timeGrain the timeGrain value to set. - * @return the MetricAvailabilily object itself. - */ - public MetricAvailabilily withTimeGrain(String timeGrain) { - this.timeGrain = timeGrain; - return this; - } - - /** - * Get the retention property: Retention period for the current time grain. - * - * @return the retention value. - */ - public String retention() { - return this.retention; - } - - /** - * Set the retention property: Retention period for the current time grain. - * - * @param retention the retention value to set. - * @return the MetricAvailabilily object itself. - */ - public MetricAvailabilily withRetention(String retention) { - this.retention = retention; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/MetricAvailability.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/MetricAvailability.java deleted file mode 100644 index 9dd6ce49ec98..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/MetricAvailability.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Retention policy of a resource metric. */ -@Fluent -public final class MetricAvailability { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MetricAvailability.class); - - /* - * The timeGrain property. - */ - @JsonProperty(value = "timeGrain") - private String timeGrain; - - /* - * The blobDuration property. - */ - @JsonProperty(value = "blobDuration") - private String blobDuration; - - /** - * Get the timeGrain property: The timeGrain property. - * - * @return the timeGrain value. - */ - public String timeGrain() { - return this.timeGrain; - } - - /** - * Set the timeGrain property: The timeGrain property. - * - * @param timeGrain the timeGrain value to set. - * @return the MetricAvailability object itself. - */ - public MetricAvailability withTimeGrain(String timeGrain) { - this.timeGrain = timeGrain; - return this; - } - - /** - * Get the blobDuration property: The blobDuration property. - * - * @return the blobDuration value. - */ - public String blobDuration() { - return this.blobDuration; - } - - /** - * Set the blobDuration property: The blobDuration property. - * - * @param blobDuration the blobDuration value to set. - * @return the MetricAvailability object itself. - */ - public MetricAvailability withBlobDuration(String blobDuration) { - this.blobDuration = blobDuration; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/MetricSpecification.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/MetricSpecification.java deleted file mode 100644 index 9d2a760e9cb4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/MetricSpecification.java +++ /dev/null @@ -1,421 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Definition of a single resource metric. */ -@Fluent -public final class MetricSpecification { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MetricSpecification.class); - - /* - * The name property. - */ - @JsonProperty(value = "name") - private String name; - - /* - * The displayName property. - */ - @JsonProperty(value = "displayName") - private String displayName; - - /* - * The displayDescription property. - */ - @JsonProperty(value = "displayDescription") - private String displayDescription; - - /* - * The unit property. - */ - @JsonProperty(value = "unit") - private String unit; - - /* - * The aggregationType property. - */ - @JsonProperty(value = "aggregationType") - private String aggregationType; - - /* - * The supportsInstanceLevelAggregation property. - */ - @JsonProperty(value = "supportsInstanceLevelAggregation") - private Boolean supportsInstanceLevelAggregation; - - /* - * The enableRegionalMdmAccount property. - */ - @JsonProperty(value = "enableRegionalMdmAccount") - private Boolean enableRegionalMdmAccount; - - /* - * The sourceMdmAccount property. - */ - @JsonProperty(value = "sourceMdmAccount") - private String sourceMdmAccount; - - /* - * The sourceMdmNamespace property. - */ - @JsonProperty(value = "sourceMdmNamespace") - private String sourceMdmNamespace; - - /* - * The metricFilterPattern property. - */ - @JsonProperty(value = "metricFilterPattern") - private String metricFilterPattern; - - /* - * The fillGapWithZero property. - */ - @JsonProperty(value = "fillGapWithZero") - private Boolean fillGapWithZero; - - /* - * The isInternal property. - */ - @JsonProperty(value = "isInternal") - private Boolean isInternal; - - /* - * The dimensions property. - */ - @JsonProperty(value = "dimensions") - private List dimensions; - - /* - * The category property. - */ - @JsonProperty(value = "category") - private String category; - - /* - * The availabilities property. - */ - @JsonProperty(value = "availabilities") - private List availabilities; - - /** - * Get the name property: The name property. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name property. - * - * @param name the name value to set. - * @return the MetricSpecification object itself. - */ - public MetricSpecification withName(String name) { - this.name = name; - return this; - } - - /** - * Get the displayName property: The displayName property. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Set the displayName property: The displayName property. - * - * @param displayName the displayName value to set. - * @return the MetricSpecification object itself. - */ - public MetricSpecification withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - - /** - * Get the displayDescription property: The displayDescription property. - * - * @return the displayDescription value. - */ - public String displayDescription() { - return this.displayDescription; - } - - /** - * Set the displayDescription property: The displayDescription property. - * - * @param displayDescription the displayDescription value to set. - * @return the MetricSpecification object itself. - */ - public MetricSpecification withDisplayDescription(String displayDescription) { - this.displayDescription = displayDescription; - return this; - } - - /** - * Get the unit property: The unit property. - * - * @return the unit value. - */ - public String unit() { - return this.unit; - } - - /** - * Set the unit property: The unit property. - * - * @param unit the unit value to set. - * @return the MetricSpecification object itself. - */ - public MetricSpecification withUnit(String unit) { - this.unit = unit; - return this; - } - - /** - * Get the aggregationType property: The aggregationType property. - * - * @return the aggregationType value. - */ - public String aggregationType() { - return this.aggregationType; - } - - /** - * Set the aggregationType property: The aggregationType property. - * - * @param aggregationType the aggregationType value to set. - * @return the MetricSpecification object itself. - */ - public MetricSpecification withAggregationType(String aggregationType) { - this.aggregationType = aggregationType; - return this; - } - - /** - * Get the supportsInstanceLevelAggregation property: The supportsInstanceLevelAggregation property. - * - * @return the supportsInstanceLevelAggregation value. - */ - public Boolean supportsInstanceLevelAggregation() { - return this.supportsInstanceLevelAggregation; - } - - /** - * Set the supportsInstanceLevelAggregation property: The supportsInstanceLevelAggregation property. - * - * @param supportsInstanceLevelAggregation the supportsInstanceLevelAggregation value to set. - * @return the MetricSpecification object itself. - */ - public MetricSpecification withSupportsInstanceLevelAggregation(Boolean supportsInstanceLevelAggregation) { - this.supportsInstanceLevelAggregation = supportsInstanceLevelAggregation; - return this; - } - - /** - * Get the enableRegionalMdmAccount property: The enableRegionalMdmAccount property. - * - * @return the enableRegionalMdmAccount value. - */ - public Boolean enableRegionalMdmAccount() { - return this.enableRegionalMdmAccount; - } - - /** - * Set the enableRegionalMdmAccount property: The enableRegionalMdmAccount property. - * - * @param enableRegionalMdmAccount the enableRegionalMdmAccount value to set. - * @return the MetricSpecification object itself. - */ - public MetricSpecification withEnableRegionalMdmAccount(Boolean enableRegionalMdmAccount) { - this.enableRegionalMdmAccount = enableRegionalMdmAccount; - return this; - } - - /** - * Get the sourceMdmAccount property: The sourceMdmAccount property. - * - * @return the sourceMdmAccount value. - */ - public String sourceMdmAccount() { - return this.sourceMdmAccount; - } - - /** - * Set the sourceMdmAccount property: The sourceMdmAccount property. - * - * @param sourceMdmAccount the sourceMdmAccount value to set. - * @return the MetricSpecification object itself. - */ - public MetricSpecification withSourceMdmAccount(String sourceMdmAccount) { - this.sourceMdmAccount = sourceMdmAccount; - return this; - } - - /** - * Get the sourceMdmNamespace property: The sourceMdmNamespace property. - * - * @return the sourceMdmNamespace value. - */ - public String sourceMdmNamespace() { - return this.sourceMdmNamespace; - } - - /** - * Set the sourceMdmNamespace property: The sourceMdmNamespace property. - * - * @param sourceMdmNamespace the sourceMdmNamespace value to set. - * @return the MetricSpecification object itself. - */ - public MetricSpecification withSourceMdmNamespace(String sourceMdmNamespace) { - this.sourceMdmNamespace = sourceMdmNamespace; - return this; - } - - /** - * Get the metricFilterPattern property: The metricFilterPattern property. - * - * @return the metricFilterPattern value. - */ - public String metricFilterPattern() { - return this.metricFilterPattern; - } - - /** - * Set the metricFilterPattern property: The metricFilterPattern property. - * - * @param metricFilterPattern the metricFilterPattern value to set. - * @return the MetricSpecification object itself. - */ - public MetricSpecification withMetricFilterPattern(String metricFilterPattern) { - this.metricFilterPattern = metricFilterPattern; - return this; - } - - /** - * Get the fillGapWithZero property: The fillGapWithZero property. - * - * @return the fillGapWithZero value. - */ - public Boolean fillGapWithZero() { - return this.fillGapWithZero; - } - - /** - * Set the fillGapWithZero property: The fillGapWithZero property. - * - * @param fillGapWithZero the fillGapWithZero value to set. - * @return the MetricSpecification object itself. - */ - public MetricSpecification withFillGapWithZero(Boolean fillGapWithZero) { - this.fillGapWithZero = fillGapWithZero; - return this; - } - - /** - * Get the isInternal property: The isInternal property. - * - * @return the isInternal value. - */ - public Boolean isInternal() { - return this.isInternal; - } - - /** - * Set the isInternal property: The isInternal property. - * - * @param isInternal the isInternal value to set. - * @return the MetricSpecification object itself. - */ - public MetricSpecification withIsInternal(Boolean isInternal) { - this.isInternal = isInternal; - return this; - } - - /** - * Get the dimensions property: The dimensions property. - * - * @return the dimensions value. - */ - public List dimensions() { - return this.dimensions; - } - - /** - * Set the dimensions property: The dimensions property. - * - * @param dimensions the dimensions value to set. - * @return the MetricSpecification object itself. - */ - public MetricSpecification withDimensions(List dimensions) { - this.dimensions = dimensions; - return this; - } - - /** - * Get the category property: The category property. - * - * @return the category value. - */ - public String category() { - return this.category; - } - - /** - * Set the category property: The category property. - * - * @param category the category value to set. - * @return the MetricSpecification object itself. - */ - public MetricSpecification withCategory(String category) { - this.category = category; - return this; - } - - /** - * Get the availabilities property: The availabilities property. - * - * @return the availabilities value. - */ - public List availabilities() { - return this.availabilities; - } - - /** - * Set the availabilities property: The availabilities property. - * - * @param availabilities the availabilities value to set. - * @return the MetricSpecification object itself. - */ - public MetricSpecification withAvailabilities(List availabilities) { - this.availabilities = availabilities; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (dimensions() != null) { - dimensions().forEach(e -> e.validate()); - } - if (availabilities() != null) { - availabilities().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/MigrateMySqlRequest.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/MigrateMySqlRequest.java deleted file mode 100644 index e5996c640caf..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/MigrateMySqlRequest.java +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.models.MigrateMySqlRequestProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** MySQL migration request. */ -@Fluent -public final class MigrateMySqlRequest extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateMySqlRequest.class); - - /* - * MigrateMySqlRequest resource specific properties - */ - @JsonProperty(value = "properties") - private MigrateMySqlRequestProperties innerProperties; - - /** - * Get the innerProperties property: MigrateMySqlRequest resource specific properties. - * - * @return the innerProperties value. - */ - private MigrateMySqlRequestProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public MigrateMySqlRequest withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the connectionString property: Connection string to the remote MySQL database. - * - * @return the connectionString value. - */ - public String connectionString() { - return this.innerProperties() == null ? null : this.innerProperties().connectionString(); - } - - /** - * Set the connectionString property: Connection string to the remote MySQL database. - * - * @param connectionString the connectionString value to set. - * @return the MigrateMySqlRequest object itself. - */ - public MigrateMySqlRequest withConnectionString(String connectionString) { - if (this.innerProperties() == null) { - this.innerProperties = new MigrateMySqlRequestProperties(); - } - this.innerProperties().withConnectionString(connectionString); - return this; - } - - /** - * Get the migrationType property: The type of migration operation to be done. - * - * @return the migrationType value. - */ - public MySqlMigrationType migrationType() { - return this.innerProperties() == null ? null : this.innerProperties().migrationType(); - } - - /** - * Set the migrationType property: The type of migration operation to be done. - * - * @param migrationType the migrationType value to set. - * @return the MigrateMySqlRequest object itself. - */ - public MigrateMySqlRequest withMigrationType(MySqlMigrationType migrationType) { - if (this.innerProperties() == null) { - this.innerProperties = new MigrateMySqlRequestProperties(); - } - this.innerProperties().withMigrationType(migrationType); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/MySqlMigrationType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/MySqlMigrationType.java deleted file mode 100644 index a2e005b2883f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/MySqlMigrationType.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for MySqlMigrationType. */ -public enum MySqlMigrationType { - /** Enum value LocalToRemote. */ - LOCAL_TO_REMOTE("LocalToRemote"), - - /** Enum value RemoteToLocal. */ - REMOTE_TO_LOCAL("RemoteToLocal"); - - /** The actual serialized value for a MySqlMigrationType instance. */ - private final String value; - - MySqlMigrationType(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a MySqlMigrationType instance. - * - * @param value the serialized value to parse. - * @return the parsed MySqlMigrationType object, or null if unable to parse. - */ - @JsonCreator - public static MySqlMigrationType fromString(String value) { - MySqlMigrationType[] items = MySqlMigrationType.values(); - for (MySqlMigrationType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/NameIdentifierCollection.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/NameIdentifierCollection.java deleted file mode 100644 index 71b9468a2368..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/NameIdentifierCollection.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.models.NameIdentifierInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Collection of domain name identifiers. */ -@Fluent -public final class NameIdentifierCollection { - @JsonIgnore private final ClientLogger logger = new ClientLogger(NameIdentifierCollection.class); - - /* - * Collection of resources. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * Link to next page of resources. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: Collection of resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Collection of resources. - * - * @param value the value value to set. - * @return the NameIdentifierCollection object itself. - */ - public NameIdentifierCollection withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to next page of resources. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model NameIdentifierCollection")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/NameValuePair.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/NameValuePair.java deleted file mode 100644 index 0c68b2fbc080..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/NameValuePair.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Name value pair. */ -@Fluent -public final class NameValuePair { - @JsonIgnore private final ClientLogger logger = new ClientLogger(NameValuePair.class); - - /* - * Pair name. - */ - @JsonProperty(value = "name") - private String name; - - /* - * Pair value. - */ - @JsonProperty(value = "value") - private String value; - - /** - * Get the name property: Pair name. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Pair name. - * - * @param name the name value to set. - * @return the NameValuePair object itself. - */ - public NameValuePair withName(String name) { - this.name = name; - return this; - } - - /** - * Get the value property: Pair value. - * - * @return the value value. - */ - public String value() { - return this.value; - } - - /** - * Set the value property: Pair value. - * - * @param value the value value to set. - * @return the NameValuePair object itself. - */ - public NameValuePair withValue(String value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/NetFrameworkVersion.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/NetFrameworkVersion.java deleted file mode 100644 index 633948545309..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/NetFrameworkVersion.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.util.ExpandableStringEnum; - -import java.util.Collection; - -/** Defines values for .NET framework version. */ -public final class NetFrameworkVersion extends ExpandableStringEnum { - /** Static value v3.5 for NetFrameworkVersion. */ - public static final NetFrameworkVersion V3_0 = NetFrameworkVersion.fromString("v3.0"); - - /** Static value v4.6 for NetFrameworkVersion. */ - public static final NetFrameworkVersion V4_6 = NetFrameworkVersion.fromString("v4.6"); - - /** - * Finds or creates a .NET Framework version based on the name. - * - * @param name a name - * @return an instance of NetFrameworkVersion - */ - public static NetFrameworkVersion fromString(String name) { - return fromString(name, NetFrameworkVersion.class); - } - - /** @return known .NET framework versions */ - public static Collection values() { - return values(NetFrameworkVersion.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/NetworkAccessControlEntry.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/NetworkAccessControlEntry.java deleted file mode 100644 index 4379b91d3b6b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/NetworkAccessControlEntry.java +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Network access control entry. */ -@Fluent -public final class NetworkAccessControlEntry { - @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkAccessControlEntry.class); - - /* - * Action object. - */ - @JsonProperty(value = "action") - private AccessControlEntryAction action; - - /* - * Description of network access control entry. - */ - @JsonProperty(value = "description") - private String description; - - /* - * Order of precedence. - */ - @JsonProperty(value = "order") - private Integer order; - - /* - * Remote subnet. - */ - @JsonProperty(value = "remoteSubnet") - private String remoteSubnet; - - /** - * Get the action property: Action object. - * - * @return the action value. - */ - public AccessControlEntryAction action() { - return this.action; - } - - /** - * Set the action property: Action object. - * - * @param action the action value to set. - * @return the NetworkAccessControlEntry object itself. - */ - public NetworkAccessControlEntry withAction(AccessControlEntryAction action) { - this.action = action; - return this; - } - - /** - * Get the description property: Description of network access control entry. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: Description of network access control entry. - * - * @param description the description value to set. - * @return the NetworkAccessControlEntry object itself. - */ - public NetworkAccessControlEntry withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the order property: Order of precedence. - * - * @return the order value. - */ - public Integer order() { - return this.order; - } - - /** - * Set the order property: Order of precedence. - * - * @param order the order value to set. - * @return the NetworkAccessControlEntry object itself. - */ - public NetworkAccessControlEntry withOrder(Integer order) { - this.order = order; - return this; - } - - /** - * Get the remoteSubnet property: Remote subnet. - * - * @return the remoteSubnet value. - */ - public String remoteSubnet() { - return this.remoteSubnet; - } - - /** - * Set the remoteSubnet property: Remote subnet. - * - * @param remoteSubnet the remoteSubnet value to set. - * @return the NetworkAccessControlEntry object itself. - */ - public NetworkAccessControlEntry withRemoteSubnet(String remoteSubnet) { - this.remoteSubnet = remoteSubnet; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/NotificationLevel.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/NotificationLevel.java deleted file mode 100644 index 62a9717d2ecf..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/NotificationLevel.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for NotificationLevel. */ -public enum NotificationLevel { - /** Enum value Critical. */ - CRITICAL("Critical"), - - /** Enum value Warning. */ - WARNING("Warning"), - - /** Enum value Information. */ - INFORMATION("Information"), - - /** Enum value NonUrgentSuggestion. */ - NON_URGENT_SUGGESTION("NonUrgentSuggestion"); - - /** The actual serialized value for a NotificationLevel instance. */ - private final String value; - - NotificationLevel(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a NotificationLevel instance. - * - * @param value the serialized value to parse. - * @return the parsed NotificationLevel object, or null if unable to parse. - */ - @JsonCreator - public static NotificationLevel fromString(String value) { - NotificationLevel[] items = NotificationLevel.values(); - for (NotificationLevel item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/OperatingSystem.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/OperatingSystem.java deleted file mode 100644 index 382cf3a42bec..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/OperatingSystem.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for AppServiceOperatingSystem. */ -public enum OperatingSystem { - /** Enum value Windows. */ - WINDOWS("windows"), - - /** Enum value Linux. */ - LINUX("linux"); - - /** The actual serialized value for a AppServiceOperatingSystem instance. */ - private String value; - - OperatingSystem(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a AppServiceOperatingSystem instance. - * - * @param value the serialized value to parse. - * @return the parsed AppServiceOperatingSystem object, or null if unable to parse. - */ - @JsonCreator - public static OperatingSystem fromString(String value) { - OperatingSystem[] items = OperatingSystem.values(); - for (OperatingSystem item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/OperationStatus.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/OperationStatus.java deleted file mode 100644 index 13382acb4043..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/OperationStatus.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for OperationStatus. */ -public enum OperationStatus { - /** Enum value InProgress. */ - IN_PROGRESS("InProgress"), - - /** Enum value Failed. */ - FAILED("Failed"), - - /** Enum value Succeeded. */ - SUCCEEDED("Succeeded"), - - /** Enum value TimedOut. */ - TIMED_OUT("TimedOut"), - - /** Enum value Created. */ - CREATED("Created"); - - /** The actual serialized value for a OperationStatus instance. */ - private final String value; - - OperationStatus(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a OperationStatus instance. - * - * @param value the serialized value to parse. - * @return the parsed OperationStatus object, or null if unable to parse. - */ - @JsonCreator - public static OperationStatus fromString(String value) { - OperationStatus[] items = OperationStatus.values(); - for (OperationStatus item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/OutboundEnvironmentEndpointCollection.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/OutboundEnvironmentEndpointCollection.java deleted file mode 100644 index 3a86a3cbcca5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/OutboundEnvironmentEndpointCollection.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.models.OutboundEnvironmentEndpointInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Collection of Outbound Environment Endpoints. */ -@Fluent -public final class OutboundEnvironmentEndpointCollection { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OutboundEnvironmentEndpointCollection.class); - - /* - * Collection of resources. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * Link to next page of resources. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: Collection of resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Collection of resources. - * - * @param value the value value to set. - * @return the OutboundEnvironmentEndpointCollection object itself. - */ - public OutboundEnvironmentEndpointCollection withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to next page of resources. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property value in model OutboundEnvironmentEndpointCollection")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/PerfMonCounterCollection.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/PerfMonCounterCollection.java deleted file mode 100644 index afe0caaad82b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/PerfMonCounterCollection.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.models.PerfMonResponseInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Collection of performance monitor counters. */ -@Fluent -public final class PerfMonCounterCollection { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PerfMonCounterCollection.class); - - /* - * Collection of resources. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * Link to next page of resources. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: Collection of resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Collection of resources. - * - * @param value the value value to set. - * @return the PerfMonCounterCollection object itself. - */ - public PerfMonCounterCollection withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to next page of resources. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model PerfMonCounterCollection")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/PerfMonSample.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/PerfMonSample.java deleted file mode 100644 index b65c433ec436..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/PerfMonSample.java +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** Performance monitor sample in a set. */ -@Fluent -public final class PerfMonSample { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PerfMonSample.class); - - /* - * Point in time for which counter was measured. - */ - @JsonProperty(value = "time") - private OffsetDateTime time; - - /* - * Name of the server on which the measurement is made. - */ - @JsonProperty(value = "instanceName") - private String instanceName; - - /* - * Value of counter at a certain time. - */ - @JsonProperty(value = "value") - private Double value; - - /** - * Get the time property: Point in time for which counter was measured. - * - * @return the time value. - */ - public OffsetDateTime time() { - return this.time; - } - - /** - * Set the time property: Point in time for which counter was measured. - * - * @param time the time value to set. - * @return the PerfMonSample object itself. - */ - public PerfMonSample withTime(OffsetDateTime time) { - this.time = time; - return this; - } - - /** - * Get the instanceName property: Name of the server on which the measurement is made. - * - * @return the instanceName value. - */ - public String instanceName() { - return this.instanceName; - } - - /** - * Set the instanceName property: Name of the server on which the measurement is made. - * - * @param instanceName the instanceName value to set. - * @return the PerfMonSample object itself. - */ - public PerfMonSample withInstanceName(String instanceName) { - this.instanceName = instanceName; - return this; - } - - /** - * Get the value property: Value of counter at a certain time. - * - * @return the value value. - */ - public Double value() { - return this.value; - } - - /** - * Set the value property: Value of counter at a certain time. - * - * @param value the value value to set. - * @return the PerfMonSample object itself. - */ - public PerfMonSample withValue(Double value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/PerfMonSet.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/PerfMonSet.java deleted file mode 100644 index 0f04e4a54be3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/PerfMonSet.java +++ /dev/null @@ -1,159 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; - -/** Metric information. */ -@Fluent -public final class PerfMonSet { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PerfMonSet.class); - - /* - * Unique key name of the counter. - */ - @JsonProperty(value = "name") - private String name; - - /* - * Start time of the period. - */ - @JsonProperty(value = "startTime") - private OffsetDateTime startTime; - - /* - * End time of the period. - */ - @JsonProperty(value = "endTime") - private OffsetDateTime endTime; - - /* - * Presented time grain. - */ - @JsonProperty(value = "timeGrain") - private String timeGrain; - - /* - * Collection of workers that are active during this time. - */ - @JsonProperty(value = "values") - private List values; - - /** - * Get the name property: Unique key name of the counter. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Unique key name of the counter. - * - * @param name the name value to set. - * @return the PerfMonSet object itself. - */ - public PerfMonSet withName(String name) { - this.name = name; - return this; - } - - /** - * Get the startTime property: Start time of the period. - * - * @return the startTime value. - */ - public OffsetDateTime startTime() { - return this.startTime; - } - - /** - * Set the startTime property: Start time of the period. - * - * @param startTime the startTime value to set. - * @return the PerfMonSet object itself. - */ - public PerfMonSet withStartTime(OffsetDateTime startTime) { - this.startTime = startTime; - return this; - } - - /** - * Get the endTime property: End time of the period. - * - * @return the endTime value. - */ - public OffsetDateTime endTime() { - return this.endTime; - } - - /** - * Set the endTime property: End time of the period. - * - * @param endTime the endTime value to set. - * @return the PerfMonSet object itself. - */ - public PerfMonSet withEndTime(OffsetDateTime endTime) { - this.endTime = endTime; - return this; - } - - /** - * Get the timeGrain property: Presented time grain. - * - * @return the timeGrain value. - */ - public String timeGrain() { - return this.timeGrain; - } - - /** - * Set the timeGrain property: Presented time grain. - * - * @param timeGrain the timeGrain value to set. - * @return the PerfMonSet object itself. - */ - public PerfMonSet withTimeGrain(String timeGrain) { - this.timeGrain = timeGrain; - return this; - } - - /** - * Get the values property: Collection of workers that are active during this time. - * - * @return the values value. - */ - public List values() { - return this.values; - } - - /** - * Set the values property: Collection of workers that are active during this time. - * - * @param values the values value to set. - * @return the PerfMonSet object itself. - */ - public PerfMonSet withValues(List values) { - this.values = values; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (values() != null) { - values().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/PhpVersion.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/PhpVersion.java deleted file mode 100644 index dd1aaf952aec..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/PhpVersion.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.util.ExpandableStringEnum; - -import java.util.Collection; - -/** Defines values for PHP version. */ -public final class PhpVersion extends ExpandableStringEnum { - /** Static value 'Off' for PhpVersion. */ - public static final PhpVersion OFF = PhpVersion.fromString("null"); - - /** Static value 5.5 for PhpVersion. */ - public static final PhpVersion PHP5_5 = PhpVersion.fromString("5.5"); - - /** Static value 5.6 for PhpVersion. */ - public static final PhpVersion PHP5_6 = PhpVersion.fromString("5.6"); - - /** Static value 7.0 for PhpVersion. */ - public static final PhpVersion PHP7 = PhpVersion.fromString("7.0"); - - /** Static value 7.1 for PhpVersion. */ - public static final PhpVersion PHP7_1 = PhpVersion.fromString("7.1"); - - /** - * Finds or creates a PHP version based on the specified name. - * - * @param name a name - * @return a PhpVersion instance - */ - public static PhpVersion fromString(String name) { - return fromString(name, PhpVersion.class); - } - - /** @return known PHP versions */ - public static Collection values() { - return values(PhpVersion.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/PlatformArchitecture.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/PlatformArchitecture.java deleted file mode 100644 index 46134ddbb509..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/PlatformArchitecture.java +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.models; - -/** Defines values for app service platform architecture. */ -public enum PlatformArchitecture { - /** Enum value for 32 bit platform. */ - X86, - - /** Enum value for 64 bit platform. */ - X64 -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/PremierAddOnOfferCollection.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/PremierAddOnOfferCollection.java deleted file mode 100644 index 471a005ed48e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/PremierAddOnOfferCollection.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.models.PremierAddOnOfferInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Collection of premier add-on offers. */ -@Fluent -public final class PremierAddOnOfferCollection { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PremierAddOnOfferCollection.class); - - /* - * Collection of resources. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * Link to next page of resources. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: Collection of resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Collection of resources. - * - * @param value the value value to set. - * @return the PremierAddOnOfferCollection object itself. - */ - public PremierAddOnOfferCollection withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to next page of resources. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property value in model PremierAddOnOfferCollection")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/PremierAddOnPatchResource.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/PremierAddOnPatchResource.java deleted file mode 100644 index 52792acd3607..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/PremierAddOnPatchResource.java +++ /dev/null @@ -1,167 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.models.PremierAddOnPatchResourceProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** ARM resource for a PremierAddOn. */ -@Fluent -public final class PremierAddOnPatchResource extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PremierAddOnPatchResource.class); - - /* - * PremierAddOnPatchResource resource specific properties - */ - @JsonProperty(value = "properties") - private PremierAddOnPatchResourceProperties innerProperties; - - /** - * Get the innerProperties property: PremierAddOnPatchResource resource specific properties. - * - * @return the innerProperties value. - */ - private PremierAddOnPatchResourceProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public PremierAddOnPatchResource withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the sku property: Premier add on SKU. - * - * @return the sku value. - */ - public String sku() { - return this.innerProperties() == null ? null : this.innerProperties().sku(); - } - - /** - * Set the sku property: Premier add on SKU. - * - * @param sku the sku value to set. - * @return the PremierAddOnPatchResource object itself. - */ - public PremierAddOnPatchResource withSku(String sku) { - if (this.innerProperties() == null) { - this.innerProperties = new PremierAddOnPatchResourceProperties(); - } - this.innerProperties().withSku(sku); - return this; - } - - /** - * Get the product property: Premier add on Product. - * - * @return the product value. - */ - public String product() { - return this.innerProperties() == null ? null : this.innerProperties().product(); - } - - /** - * Set the product property: Premier add on Product. - * - * @param product the product value to set. - * @return the PremierAddOnPatchResource object itself. - */ - public PremierAddOnPatchResource withProduct(String product) { - if (this.innerProperties() == null) { - this.innerProperties = new PremierAddOnPatchResourceProperties(); - } - this.innerProperties().withProduct(product); - return this; - } - - /** - * Get the vendor property: Premier add on Vendor. - * - * @return the vendor value. - */ - public String vendor() { - return this.innerProperties() == null ? null : this.innerProperties().vendor(); - } - - /** - * Set the vendor property: Premier add on Vendor. - * - * @param vendor the vendor value to set. - * @return the PremierAddOnPatchResource object itself. - */ - public PremierAddOnPatchResource withVendor(String vendor) { - if (this.innerProperties() == null) { - this.innerProperties = new PremierAddOnPatchResourceProperties(); - } - this.innerProperties().withVendor(vendor); - return this; - } - - /** - * Get the marketplacePublisher property: Premier add on Marketplace publisher. - * - * @return the marketplacePublisher value. - */ - public String marketplacePublisher() { - return this.innerProperties() == null ? null : this.innerProperties().marketplacePublisher(); - } - - /** - * Set the marketplacePublisher property: Premier add on Marketplace publisher. - * - * @param marketplacePublisher the marketplacePublisher value to set. - * @return the PremierAddOnPatchResource object itself. - */ - public PremierAddOnPatchResource withMarketplacePublisher(String marketplacePublisher) { - if (this.innerProperties() == null) { - this.innerProperties = new PremierAddOnPatchResourceProperties(); - } - this.innerProperties().withMarketplacePublisher(marketplacePublisher); - return this; - } - - /** - * Get the marketplaceOffer property: Premier add on Marketplace offer. - * - * @return the marketplaceOffer value. - */ - public String marketplaceOffer() { - return this.innerProperties() == null ? null : this.innerProperties().marketplaceOffer(); - } - - /** - * Set the marketplaceOffer property: Premier add on Marketplace offer. - * - * @param marketplaceOffer the marketplaceOffer value to set. - * @return the PremierAddOnPatchResource object itself. - */ - public PremierAddOnPatchResource withMarketplaceOffer(String marketplaceOffer) { - if (this.innerProperties() == null) { - this.innerProperties = new PremierAddOnPatchResourceProperties(); - } - this.innerProperties().withMarketplaceOffer(marketplaceOffer); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/PricingTier.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/PricingTier.java deleted file mode 100644 index 71e03a58df98..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/PricingTier.java +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.Collection; - -/** Defines App service pricing tiers. */ -@Fluent -public final class PricingTier { - private static final AttributeCollection COLLECTION = new AttributeCollection<>(); - - /** Basic pricing tier with a small size. */ - public static final PricingTier BASIC_B1 = - COLLECTION.addValue(new PricingTier(SkuName.BASIC.toString(), "B1")); - - /** Basic pricing tier with a medium size. */ - public static final PricingTier BASIC_B2 = - COLLECTION.addValue(new PricingTier(SkuName.BASIC.toString(), "B2")); - - /** Basic pricing tier with a large size. */ - public static final PricingTier BASIC_B3 = - COLLECTION.addValue(new PricingTier(SkuName.BASIC.toString(), "B3")); - - /** Standard pricing tier with a small size. */ - public static final PricingTier STANDARD_S1 = - COLLECTION.addValue(new PricingTier(SkuName.STANDARD.toString(), "S1")); - - /** Standard pricing tier with a medium size. */ - public static final PricingTier STANDARD_S2 = - COLLECTION.addValue(new PricingTier(SkuName.STANDARD.toString(), "S2")); - - /** Standard pricing tier with a large size. */ - public static final PricingTier STANDARD_S3 = - COLLECTION.addValue(new PricingTier(SkuName.STANDARD.toString(), "S3")); - - /** Premium pricing tier with a small size. */ - public static final PricingTier PREMIUM_P1 = - COLLECTION.addValue(new PricingTier(SkuName.PREMIUM.toString(), "P1")); - - /** Premium pricing tier with a medium size. */ - public static final PricingTier PREMIUM_P2 = - COLLECTION.addValue(new PricingTier(SkuName.PREMIUM.toString(), "P2")); - - /** Premium pricing tier with a large size. */ - public static final PricingTier PREMIUM_P3 = - COLLECTION.addValue(new PricingTier(SkuName.PREMIUM.toString(), "P3")); - - /** V2 Premium pricing tier with a small size. */ - public static final PricingTier PREMIUM_P1V2 = - COLLECTION.addValue(new PricingTier(SkuName.PREMIUM_V2.toString(), "P1v2")); - - /** V2 Premium pricing tier with a medium size. */ - public static final PricingTier PREMIUM_P2V2 = - COLLECTION.addValue(new PricingTier(SkuName.PREMIUM_V2.toString(), "P2v2")); - - /** V2 Premium pricing tier with a large size. */ - public static final PricingTier PREMIUM_P3V2 = - COLLECTION.addValue(new PricingTier(SkuName.PREMIUM_V2.toString(), "P3v2")); - - /** V3 Premium pricing tier with a small size. */ - public static final PricingTier PREMIUM_P1V3 = - COLLECTION.addValue(new PricingTier("PremiumV3", "P1v3")); - - /** V3 Premium pricing tier with a medium size. */ - public static final PricingTier PREMIUM_P2V3 = - COLLECTION.addValue(new PricingTier("PremiumV3", "P2v3")); - - /** V3 Premium pricing tier with a large size. */ - public static final PricingTier PREMIUM_P3V3 = - COLLECTION.addValue(new PricingTier("PremiumV3", "P3v3")); - - /** Free pricing tier. This does not work with Linux web apps, host name bindings, and SSL bindings. */ - public static final PricingTier FREE_F1 = - COLLECTION.addValue(new PricingTier(SkuName.FREE.toString(), "F1")); - - /** Shared pricing tier. This does not work with Linux web apps, host name bindings, and SSL bindings. */ - public static final PricingTier SHARED_D1 = - COLLECTION.addValue(new PricingTier(SkuName.SHARED.toString(), "D1")); - - /** The actual serialized value for a SiteAvailabilityState instance. */ - private final SkuDescription skuDescription; - - /** - * Creates a custom app service pricing tier. - * - * @param tier the tier name - * @param size the size of the plan - */ - public PricingTier(String tier, String size) { - this.skuDescription = new SkuDescription().withName(size).withTier(tier).withSize(size); - } - - /** - * Parses a serialized value to an AppServicePricingTier instance. - * - * @param skuDescription the serialized value to parse. - * @return the parsed AppServicePricingTier object, or null if unable to parse. - */ - public static PricingTier fromSkuDescription(SkuDescription skuDescription) { - if (skuDescription == null) { - return null; - } - return new PricingTier(skuDescription.tier(), skuDescription.size()); - } - - /** - * Lists the pre-defined app service pricing tiers. - * - * @return immutable collection of the pre-defined app service pricing tiers - */ - public static Collection getAll() { - return COLLECTION.getAllValues(); - } - - @Override - public String toString() { - return skuDescription.tier() + "_" + skuDescription.size(); - } - - /** @return the underneath sku description */ - @JsonValue - public SkuDescription toSkuDescription() { - return this.skuDescription; - } - - @Override - public int hashCode() { - return skuDescription.hashCode(); - } - - @Override - public boolean equals(Object obj) { - if (!(obj instanceof PricingTier)) { - return false; - } - if (obj == this) { - return true; - } - PricingTier rhs = (PricingTier) obj; - return toString().equalsIgnoreCase(rhs.toString()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/PrivateAccessSubnet.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/PrivateAccessSubnet.java deleted file mode 100644 index 7941272fd719..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/PrivateAccessSubnet.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Description of a Virtual Network subnet that is useable for private site access. */ -@Fluent -public final class PrivateAccessSubnet { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateAccessSubnet.class); - - /* - * The name of the subnet. - */ - @JsonProperty(value = "name") - private String name; - - /* - * The key (ID) of the subnet. - */ - @JsonProperty(value = "key") - private Integer key; - - /** - * Get the name property: The name of the subnet. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the subnet. - * - * @param name the name value to set. - * @return the PrivateAccessSubnet object itself. - */ - public PrivateAccessSubnet withName(String name) { - this.name = name; - return this; - } - - /** - * Get the key property: The key (ID) of the subnet. - * - * @return the key value. - */ - public Integer key() { - return this.key; - } - - /** - * Set the key property: The key (ID) of the subnet. - * - * @param key the key value to set. - * @return the PrivateAccessSubnet object itself. - */ - public PrivateAccessSubnet withKey(Integer key) { - this.key = key; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/PrivateAccessVirtualNetwork.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/PrivateAccessVirtualNetwork.java deleted file mode 100644 index a042f87c363e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/PrivateAccessVirtualNetwork.java +++ /dev/null @@ -1,136 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Description of a Virtual Network that is useable for private site access. */ -@Fluent -public final class PrivateAccessVirtualNetwork { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateAccessVirtualNetwork.class); - - /* - * The name of the Virtual Network. - */ - @JsonProperty(value = "name") - private String name; - - /* - * The key (ID) of the Virtual Network. - */ - @JsonProperty(value = "key") - private Integer key; - - /* - * The ARM uri of the Virtual Network - */ - @JsonProperty(value = "resourceId") - private String resourceId; - - /* - * A List of subnets that access is allowed to on this Virtual Network. An - * empty array (but not null) is interpreted to mean that all subnets are - * allowed within this Virtual Network. - */ - @JsonProperty(value = "subnets") - private List subnets; - - /** - * Get the name property: The name of the Virtual Network. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the Virtual Network. - * - * @param name the name value to set. - * @return the PrivateAccessVirtualNetwork object itself. - */ - public PrivateAccessVirtualNetwork withName(String name) { - this.name = name; - return this; - } - - /** - * Get the key property: The key (ID) of the Virtual Network. - * - * @return the key value. - */ - public Integer key() { - return this.key; - } - - /** - * Set the key property: The key (ID) of the Virtual Network. - * - * @param key the key value to set. - * @return the PrivateAccessVirtualNetwork object itself. - */ - public PrivateAccessVirtualNetwork withKey(Integer key) { - this.key = key; - return this; - } - - /** - * Get the resourceId property: The ARM uri of the Virtual Network. - * - * @return the resourceId value. - */ - public String resourceId() { - return this.resourceId; - } - - /** - * Set the resourceId property: The ARM uri of the Virtual Network. - * - * @param resourceId the resourceId value to set. - * @return the PrivateAccessVirtualNetwork object itself. - */ - public PrivateAccessVirtualNetwork withResourceId(String resourceId) { - this.resourceId = resourceId; - return this; - } - - /** - * Get the subnets property: A List of subnets that access is allowed to on this Virtual Network. An empty array - * (but not null) is interpreted to mean that all subnets are allowed within this Virtual Network. - * - * @return the subnets value. - */ - public List subnets() { - return this.subnets; - } - - /** - * Set the subnets property: A List of subnets that access is allowed to on this Virtual Network. An empty array - * (but not null) is interpreted to mean that all subnets are allowed within this Virtual Network. - * - * @param subnets the subnets value to set. - * @return the PrivateAccessVirtualNetwork object itself. - */ - public PrivateAccessVirtualNetwork withSubnets(List subnets) { - this.subnets = subnets; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (subnets() != null) { - subnets().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ProcessInfoCollection.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ProcessInfoCollection.java deleted file mode 100644 index 8931bfbde3c0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ProcessInfoCollection.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.models.ProcessInfoInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Collection of Kudu process information elements. */ -@Fluent -public final class ProcessInfoCollection { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ProcessInfoCollection.class); - - /* - * Collection of resources. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * Link to next page of resources. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: Collection of resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Collection of resources. - * - * @param value the value value to set. - * @return the ProcessInfoCollection object itself. - */ - public ProcessInfoCollection withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to next page of resources. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model ProcessInfoCollection")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ProcessModuleInfoCollection.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ProcessModuleInfoCollection.java deleted file mode 100644 index 50df0f3a79aa..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ProcessModuleInfoCollection.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.models.ProcessModuleInfoInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Collection of Kudu thread information elements. */ -@Fluent -public final class ProcessModuleInfoCollection { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ProcessModuleInfoCollection.class); - - /* - * Collection of resources. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * Link to next page of resources. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: Collection of resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Collection of resources. - * - * @param value the value value to set. - * @return the ProcessModuleInfoCollection object itself. - */ - public ProcessModuleInfoCollection withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to next page of resources. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property value in model ProcessModuleInfoCollection")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ProcessThreadInfoCollection.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ProcessThreadInfoCollection.java deleted file mode 100644 index 30fbbc1fcd42..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ProcessThreadInfoCollection.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.models.ProcessThreadInfoInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Collection of Kudu thread information elements. */ -@Fluent -public final class ProcessThreadInfoCollection { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ProcessThreadInfoCollection.class); - - /* - * Collection of resources. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * Link to next page of resources. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: Collection of resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Collection of resources. - * - * @param value the value value to set. - * @return the ProcessThreadInfoCollection object itself. - */ - public ProcessThreadInfoCollection withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to next page of resources. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property value in model ProcessThreadInfoCollection")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ProviderOsTypeSelected.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ProviderOsTypeSelected.java deleted file mode 100644 index a012ca58fb7f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ProviderOsTypeSelected.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ProviderOsTypeSelected. */ -public final class ProviderOsTypeSelected extends ExpandableStringEnum { - /** Static value Windows for ProviderOsTypeSelected. */ - public static final ProviderOsTypeSelected WINDOWS = fromString("Windows"); - - /** Static value Linux for ProviderOsTypeSelected. */ - public static final ProviderOsTypeSelected LINUX = fromString("Linux"); - - /** Static value WindowsFunctions for ProviderOsTypeSelected. */ - public static final ProviderOsTypeSelected WINDOWS_FUNCTIONS = fromString("WindowsFunctions"); - - /** Static value LinuxFunctions for ProviderOsTypeSelected. */ - public static final ProviderOsTypeSelected LINUX_FUNCTIONS = fromString("LinuxFunctions"); - - /** - * Creates or finds a ProviderOsTypeSelected from its string representation. - * - * @param name a name to look for. - * @return the corresponding ProviderOsTypeSelected. - */ - @JsonCreator - public static ProviderOsTypeSelected fromString(String name) { - return fromString(name, ProviderOsTypeSelected.class); - } - - /** @return known ProviderOsTypeSelected values. */ - public static Collection values() { - return values(ProviderOsTypeSelected.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ProvisioningState.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ProvisioningState.java deleted file mode 100644 index b2b2bf192dfb..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ProvisioningState.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for ProvisioningState. */ -public enum ProvisioningState { - /** Enum value Succeeded. */ - SUCCEEDED("Succeeded"), - - /** Enum value Failed. */ - FAILED("Failed"), - - /** Enum value Canceled. */ - CANCELED("Canceled"), - - /** Enum value InProgress. */ - IN_PROGRESS("InProgress"), - - /** Enum value Deleting. */ - DELETING("Deleting"); - - /** The actual serialized value for a ProvisioningState instance. */ - private final String value; - - ProvisioningState(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a ProvisioningState instance. - * - * @param value the serialized value to parse. - * @return the parsed ProvisioningState object, or null if unable to parse. - */ - @JsonCreator - public static ProvisioningState fromString(String value) { - ProvisioningState[] items = ProvisioningState.values(); - for (ProvisioningState item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ProxyOnlyResource.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ProxyOnlyResource.java deleted file mode 100644 index 1c39f2e53ffb..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ProxyOnlyResource.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Azure proxy only resource. This resource is not tracked by Azure Resource Manager. */ -@Fluent -public class ProxyOnlyResource extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ProxyOnlyResource.class); - - /* - * Kind of resource. - */ - @JsonProperty(value = "kind") - private String kind; - - /** - * Get the kind property: Kind of resource. - * - * @return the kind value. - */ - public String kind() { - return this.kind; - } - - /** - * Set the kind property: Kind of resource. - * - * @param kind the kind value to set. - * @return the ProxyOnlyResource object itself. - */ - public ProxyOnlyResource withKind(String kind) { - this.kind = kind; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/PublicCertificateCollection.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/PublicCertificateCollection.java deleted file mode 100644 index 0c5f48936540..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/PublicCertificateCollection.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.models.PublicCertificateInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Collection of public certificates. */ -@Fluent -public final class PublicCertificateCollection { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PublicCertificateCollection.class); - - /* - * Collection of resources. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * Link to next page of resources. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: Collection of resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Collection of resources. - * - * @param value the value value to set. - * @return the PublicCertificateCollection object itself. - */ - public PublicCertificateCollection withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to next page of resources. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property value in model PublicCertificateCollection")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/PublicCertificateLocation.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/PublicCertificateLocation.java deleted file mode 100644 index f3b09db8d526..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/PublicCertificateLocation.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for PublicCertificateLocation. */ -public enum PublicCertificateLocation { - /** Enum value CurrentUserMy. */ - CURRENT_USER_MY("CurrentUserMy"), - - /** Enum value LocalMachineMy. */ - LOCAL_MACHINE_MY("LocalMachineMy"), - - /** Enum value Unknown. */ - UNKNOWN("Unknown"); - - /** The actual serialized value for a PublicCertificateLocation instance. */ - private final String value; - - PublicCertificateLocation(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a PublicCertificateLocation instance. - * - * @param value the serialized value to parse. - * @return the parsed PublicCertificateLocation object, or null if unable to parse. - */ - @JsonCreator - public static PublicCertificateLocation fromString(String value) { - PublicCertificateLocation[] items = PublicCertificateLocation.values(); - for (PublicCertificateLocation item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/PublishingProfile.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/PublishingProfile.java deleted file mode 100644 index 60df6dcb3095..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/PublishingProfile.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; - -/** Endpoints and credentials for publishing to a web app. */ -@Fluent -public interface PublishingProfile { - /** @return the url for FTP publishing, with ftp:// and the root folder. E.g. ftp://ftp.contoso.com/site/wwwroot */ - String ftpUrl(); - /** @return the username used for FTP publishing */ - String ftpUsername(); - - /** @return the password used for FTP publishing */ - String ftpPassword(); - - /** @return the url for FTP publishing, with https:// upfront. E.g. https://contoso.com:443/myRepo.git */ - String gitUrl(); - - /** @return the username used for Git publishing */ - String gitUsername(); - - /** @return the password used for Git publishing */ - String gitPassword(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/PublishingProfileFormat.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/PublishingProfileFormat.java deleted file mode 100644 index 28242d92f560..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/PublishingProfileFormat.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for PublishingProfileFormat. */ -public final class PublishingProfileFormat extends ExpandableStringEnum { - /** Static value FileZilla3 for PublishingProfileFormat. */ - public static final PublishingProfileFormat FILE_ZILLA3 = fromString("FileZilla3"); - - /** Static value WebDeploy for PublishingProfileFormat. */ - public static final PublishingProfileFormat WEB_DEPLOY = fromString("WebDeploy"); - - /** Static value Ftp for PublishingProfileFormat. */ - public static final PublishingProfileFormat FTP = fromString("Ftp"); - - /** - * Creates or finds a PublishingProfileFormat from its string representation. - * - * @param name a name to look for. - * @return the corresponding PublishingProfileFormat. - */ - @JsonCreator - public static PublishingProfileFormat fromString(String name) { - return fromString(name, PublishingProfileFormat.class); - } - - /** @return known PublishingProfileFormat values. */ - public static Collection values() { - return values(PublishingProfileFormat.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/PythonVersion.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/PythonVersion.java deleted file mode 100644 index e62b5075f333..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/PythonVersion.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.util.ExpandableStringEnum; - -import java.util.Collection; - -/** Defines values for Python version. */ -public final class PythonVersion extends ExpandableStringEnum { - /** Static value 'Off' for PythonVersion. */ - public static final PythonVersion OFF = PythonVersion.fromString("null"); - - /** Static value 2.7 for PythonVersion. */ - public static final PythonVersion PYTHON_27 = PythonVersion.fromString("2.7"); - - /** Static value 3.4 for PythonVersion. */ - public static final PythonVersion PYTHON_34 = PythonVersion.fromString("3.4"); - - /** - * Finds or creates a Python version based on the specified name. - * - * @param name a name - * @return a PythonVersion instance - */ - public static PythonVersion fromString(String name) { - return fromString(name, PythonVersion.class); - } - - /** @return known Python versions */ - public static Collection values() { - return values(PythonVersion.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/RampUpRule.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/RampUpRule.java deleted file mode 100644 index 3ff07c5c960c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/RampUpRule.java +++ /dev/null @@ -1,265 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Routing rules for ramp up testing. This rule allows to redirect static traffic % to a slot or to gradually change - * routing % based on performance. - */ -@Fluent -public final class RampUpRule { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RampUpRule.class); - - /* - * Hostname of a slot to which the traffic will be redirected if decided - * to. E.g. myapp-stage.azurewebsites.net. - */ - @JsonProperty(value = "actionHostName") - private String actionHostname; - - /* - * Percentage of the traffic which will be redirected to - * ActionHostName. - */ - @JsonProperty(value = "reroutePercentage") - private Double reroutePercentage; - - /* - * In auto ramp up scenario this is the step to add/remove from - * ReroutePercentage until it reaches - * MinReroutePercentage or MaxReroutePercentage. - * Site metrics are checked every N minutes specified in - * ChangeIntervalInMinutes. - * Custom decision algorithm can be provided in TiPCallback site extension - * which URL can be specified in ChangeDecisionCallbackUrl. - */ - @JsonProperty(value = "changeStep") - private Double changeStep; - - /* - * Specifies interval in minutes to reevaluate ReroutePercentage. - */ - @JsonProperty(value = "changeIntervalInMinutes") - private Integer changeIntervalInMinutes; - - /* - * Specifies lower boundary above which ReroutePercentage will stay. - */ - @JsonProperty(value = "minReroutePercentage") - private Double minReroutePercentage; - - /* - * Specifies upper boundary below which ReroutePercentage will stay. - */ - @JsonProperty(value = "maxReroutePercentage") - private Double maxReroutePercentage; - - /* - * Custom decision algorithm can be provided in TiPCallback site extension - * which URL can be specified. See TiPCallback site extension for the - * scaffold and contracts. - * https://www.siteextensions.net/packages/TiPCallback/ - */ - @JsonProperty(value = "changeDecisionCallbackUrl") - private String changeDecisionCallbackUrl; - - /* - * Name of the routing rule. The recommended name would be to point to the - * slot which will receive the traffic in the experiment. - */ - @JsonProperty(value = "name") - private String name; - - /** - * Get the actionHostname property: Hostname of a slot to which the traffic will be redirected if decided to. E.g. - * myapp-stage.azurewebsites.net. - * - * @return the actionHostname value. - */ - public String actionHostname() { - return this.actionHostname; - } - - /** - * Set the actionHostname property: Hostname of a slot to which the traffic will be redirected if decided to. E.g. - * myapp-stage.azurewebsites.net. - * - * @param actionHostname the actionHostname value to set. - * @return the RampUpRule object itself. - */ - public RampUpRule withActionHostname(String actionHostname) { - this.actionHostname = actionHostname; - return this; - } - - /** - * Get the reroutePercentage property: Percentage of the traffic which will be redirected to - * <code>ActionHostName</code>. - * - * @return the reroutePercentage value. - */ - public Double reroutePercentage() { - return this.reroutePercentage; - } - - /** - * Set the reroutePercentage property: Percentage of the traffic which will be redirected to - * <code>ActionHostName</code>. - * - * @param reroutePercentage the reroutePercentage value to set. - * @return the RampUpRule object itself. - */ - public RampUpRule withReroutePercentage(Double reroutePercentage) { - this.reroutePercentage = reroutePercentage; - return this; - } - - /** - * Get the changeStep property: In auto ramp up scenario this is the step to add/remove from - * <code>ReroutePercentage</code> until it reaches <code>MinReroutePercentage</code> or - * <code>MaxReroutePercentage</code>. Site metrics are checked every N minutes specified in - * <code>ChangeIntervalInMinutes</code>. Custom decision algorithm can be provided in TiPCallback site - * extension which URL can be specified in <code>ChangeDecisionCallbackUrl</code>. - * - * @return the changeStep value. - */ - public Double changeStep() { - return this.changeStep; - } - - /** - * Set the changeStep property: In auto ramp up scenario this is the step to add/remove from - * <code>ReroutePercentage</code> until it reaches <code>MinReroutePercentage</code> or - * <code>MaxReroutePercentage</code>. Site metrics are checked every N minutes specified in - * <code>ChangeIntervalInMinutes</code>. Custom decision algorithm can be provided in TiPCallback site - * extension which URL can be specified in <code>ChangeDecisionCallbackUrl</code>. - * - * @param changeStep the changeStep value to set. - * @return the RampUpRule object itself. - */ - public RampUpRule withChangeStep(Double changeStep) { - this.changeStep = changeStep; - return this; - } - - /** - * Get the changeIntervalInMinutes property: Specifies interval in minutes to reevaluate ReroutePercentage. - * - * @return the changeIntervalInMinutes value. - */ - public Integer changeIntervalInMinutes() { - return this.changeIntervalInMinutes; - } - - /** - * Set the changeIntervalInMinutes property: Specifies interval in minutes to reevaluate ReroutePercentage. - * - * @param changeIntervalInMinutes the changeIntervalInMinutes value to set. - * @return the RampUpRule object itself. - */ - public RampUpRule withChangeIntervalInMinutes(Integer changeIntervalInMinutes) { - this.changeIntervalInMinutes = changeIntervalInMinutes; - return this; - } - - /** - * Get the minReroutePercentage property: Specifies lower boundary above which ReroutePercentage will stay. - * - * @return the minReroutePercentage value. - */ - public Double minReroutePercentage() { - return this.minReroutePercentage; - } - - /** - * Set the minReroutePercentage property: Specifies lower boundary above which ReroutePercentage will stay. - * - * @param minReroutePercentage the minReroutePercentage value to set. - * @return the RampUpRule object itself. - */ - public RampUpRule withMinReroutePercentage(Double minReroutePercentage) { - this.minReroutePercentage = minReroutePercentage; - return this; - } - - /** - * Get the maxReroutePercentage property: Specifies upper boundary below which ReroutePercentage will stay. - * - * @return the maxReroutePercentage value. - */ - public Double maxReroutePercentage() { - return this.maxReroutePercentage; - } - - /** - * Set the maxReroutePercentage property: Specifies upper boundary below which ReroutePercentage will stay. - * - * @param maxReroutePercentage the maxReroutePercentage value to set. - * @return the RampUpRule object itself. - */ - public RampUpRule withMaxReroutePercentage(Double maxReroutePercentage) { - this.maxReroutePercentage = maxReroutePercentage; - return this; - } - - /** - * Get the changeDecisionCallbackUrl property: Custom decision algorithm can be provided in TiPCallback site - * extension which URL can be specified. See TiPCallback site extension for the scaffold and contracts. - * https://www.siteextensions.net/packages/TiPCallback/. - * - * @return the changeDecisionCallbackUrl value. - */ - public String changeDecisionCallbackUrl() { - return this.changeDecisionCallbackUrl; - } - - /** - * Set the changeDecisionCallbackUrl property: Custom decision algorithm can be provided in TiPCallback site - * extension which URL can be specified. See TiPCallback site extension for the scaffold and contracts. - * https://www.siteextensions.net/packages/TiPCallback/. - * - * @param changeDecisionCallbackUrl the changeDecisionCallbackUrl value to set. - * @return the RampUpRule object itself. - */ - public RampUpRule withChangeDecisionCallbackUrl(String changeDecisionCallbackUrl) { - this.changeDecisionCallbackUrl = changeDecisionCallbackUrl; - return this; - } - - /** - * Get the name property: Name of the routing rule. The recommended name would be to point to the slot which will - * receive the traffic in the experiment. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Name of the routing rule. The recommended name would be to point to the slot which will - * receive the traffic in the experiment. - * - * @param name the name value to set. - * @return the RampUpRule object itself. - */ - public RampUpRule withName(String name) { - this.name = name; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/RecommendationCollection.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/RecommendationCollection.java deleted file mode 100644 index 5fe3000300b4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/RecommendationCollection.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.models.RecommendationInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Collection of recommendations. */ -@Fluent -public final class RecommendationCollection { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RecommendationCollection.class); - - /* - * Collection of resources. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * Link to next page of resources. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: Collection of resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Collection of resources. - * - * @param value the value value to set. - * @return the RecommendationCollection object itself. - */ - public RecommendationCollection withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to next page of resources. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model RecommendationCollection")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/RedundancyMode.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/RedundancyMode.java deleted file mode 100644 index c4e349f5cd83..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/RedundancyMode.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for RedundancyMode. */ -public enum RedundancyMode { - /** Enum value None. */ - NONE("None"), - - /** Enum value Manual. */ - MANUAL("Manual"), - - /** Enum value Failover. */ - FAILOVER("Failover"), - - /** Enum value ActiveActive. */ - ACTIVE_ACTIVE("ActiveActive"), - - /** Enum value GeoRedundant. */ - GEO_REDUNDANT("GeoRedundant"); - - /** The actual serialized value for a RedundancyMode instance. */ - private final String value; - - RedundancyMode(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a RedundancyMode instance. - * - * @param value the serialized value to parse. - * @return the parsed RedundancyMode object, or null if unable to parse. - */ - @JsonCreator - public static RedundancyMode fromString(String value) { - RedundancyMode[] items = RedundancyMode.values(); - for (RedundancyMode item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ReissueCertificateOrderRequest.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ReissueCertificateOrderRequest.java deleted file mode 100644 index 74d7edc024c3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ReissueCertificateOrderRequest.java +++ /dev/null @@ -1,148 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.models.ReissueCertificateOrderRequestProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Class representing certificate reissue request. */ -@Fluent -public final class ReissueCertificateOrderRequest extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ReissueCertificateOrderRequest.class); - - /* - * ReissueCertificateOrderRequest resource specific properties - */ - @JsonProperty(value = "properties") - private ReissueCertificateOrderRequestProperties innerProperties; - - /** - * Get the innerProperties property: ReissueCertificateOrderRequest resource specific properties. - * - * @return the innerProperties value. - */ - private ReissueCertificateOrderRequestProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public ReissueCertificateOrderRequest withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the keySize property: Certificate Key Size. - * - * @return the keySize value. - */ - public Integer keySize() { - return this.innerProperties() == null ? null : this.innerProperties().keySize(); - } - - /** - * Set the keySize property: Certificate Key Size. - * - * @param keySize the keySize value to set. - * @return the ReissueCertificateOrderRequest object itself. - */ - public ReissueCertificateOrderRequest withKeySize(Integer keySize) { - if (this.innerProperties() == null) { - this.innerProperties = new ReissueCertificateOrderRequestProperties(); - } - this.innerProperties().withKeySize(keySize); - return this; - } - - /** - * Get the delayExistingRevokeInHours property: Delay in hours to revoke existing certificate after the new - * certificate is issued. - * - * @return the delayExistingRevokeInHours value. - */ - public Integer delayExistingRevokeInHours() { - return this.innerProperties() == null ? null : this.innerProperties().delayExistingRevokeInHours(); - } - - /** - * Set the delayExistingRevokeInHours property: Delay in hours to revoke existing certificate after the new - * certificate is issued. - * - * @param delayExistingRevokeInHours the delayExistingRevokeInHours value to set. - * @return the ReissueCertificateOrderRequest object itself. - */ - public ReissueCertificateOrderRequest withDelayExistingRevokeInHours(Integer delayExistingRevokeInHours) { - if (this.innerProperties() == null) { - this.innerProperties = new ReissueCertificateOrderRequestProperties(); - } - this.innerProperties().withDelayExistingRevokeInHours(delayExistingRevokeInHours); - return this; - } - - /** - * Get the csr property: Csr to be used for re-key operation. - * - * @return the csr value. - */ - public String csr() { - return this.innerProperties() == null ? null : this.innerProperties().csr(); - } - - /** - * Set the csr property: Csr to be used for re-key operation. - * - * @param csr the csr value to set. - * @return the ReissueCertificateOrderRequest object itself. - */ - public ReissueCertificateOrderRequest withCsr(String csr) { - if (this.innerProperties() == null) { - this.innerProperties = new ReissueCertificateOrderRequestProperties(); - } - this.innerProperties().withCsr(csr); - return this; - } - - /** - * Get the isPrivateKeyExternal property: Should we change the ASC type (from managed private key to external - * private key and vice versa). - * - * @return the isPrivateKeyExternal value. - */ - public Boolean isPrivateKeyExternal() { - return this.innerProperties() == null ? null : this.innerProperties().isPrivateKeyExternal(); - } - - /** - * Set the isPrivateKeyExternal property: Should we change the ASC type (from managed private key to external - * private key and vice versa). - * - * @param isPrivateKeyExternal the isPrivateKeyExternal value to set. - * @return the ReissueCertificateOrderRequest object itself. - */ - public ReissueCertificateOrderRequest withIsPrivateKeyExternal(Boolean isPrivateKeyExternal) { - if (this.innerProperties() == null) { - this.innerProperties = new ReissueCertificateOrderRequestProperties(); - } - this.innerProperties().withIsPrivateKeyExternal(isPrivateKeyExternal); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/RemoteVisualStudioVersion.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/RemoteVisualStudioVersion.java deleted file mode 100644 index f33385929266..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/RemoteVisualStudioVersion.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.util.ExpandableStringEnum; - -import java.util.Collection; - -/** Defines values for remote visual studio version for remote debugging. */ -public final class RemoteVisualStudioVersion extends ExpandableStringEnum { - /** Static value VS2017 for RemoteVisualStudioVersion. */ - public static final RemoteVisualStudioVersion VS2017 = RemoteVisualStudioVersion.fromString("VS2017"); - - /** Static value VS2019 for RemoteVisualStudioVersion. */ - public static final RemoteVisualStudioVersion VS2019 = RemoteVisualStudioVersion.fromString("VS2019"); - - /** - * Finds or creates a Visual Studio version based on the specified name. - * - * @param name a name - * @return a RemoteVisualStudioVersion instance - */ - public static RemoteVisualStudioVersion fromString(String name) { - return fromString(name, RemoteVisualStudioVersion.class); - } - - /** @return known Visual Studio versions */ - public static Collection values() { - return values(RemoteVisualStudioVersion.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/Rendering.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/Rendering.java deleted file mode 100644 index 10fdf409ce8d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/Rendering.java +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Instructions for rendering the data. */ -@Fluent -public final class Rendering { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Rendering.class); - - /* - * Rendering Type - */ - @JsonProperty(value = "type") - private RenderingType type; - - /* - * Title of data - */ - @JsonProperty(value = "title") - private String title; - - /* - * Description of the data that will help it be interpreted - */ - @JsonProperty(value = "description") - private String description; - - /** - * Get the type property: Rendering Type. - * - * @return the type value. - */ - public RenderingType type() { - return this.type; - } - - /** - * Set the type property: Rendering Type. - * - * @param type the type value to set. - * @return the Rendering object itself. - */ - public Rendering withType(RenderingType type) { - this.type = type; - return this; - } - - /** - * Get the title property: Title of data. - * - * @return the title value. - */ - public String title() { - return this.title; - } - - /** - * Set the title property: Title of data. - * - * @param title the title value to set. - * @return the Rendering object itself. - */ - public Rendering withTitle(String title) { - this.title = title; - return this; - } - - /** - * Get the description property: Description of the data that will help it be interpreted. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: Description of the data that will help it be interpreted. - * - * @param description the description value to set. - * @return the Rendering object itself. - */ - public Rendering withDescription(String description) { - this.description = description; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/RenderingType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/RenderingType.java deleted file mode 100644 index 3d22edb4ec98..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/RenderingType.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for RenderingType. */ -public enum RenderingType { - /** Enum value NoGraph. */ - NO_GRAPH("NoGraph"), - - /** Enum value Table. */ - TABLE("Table"), - - /** Enum value TimeSeries. */ - TIME_SERIES("TimeSeries"), - - /** Enum value TimeSeriesPerInstance. */ - TIME_SERIES_PER_INSTANCE("TimeSeriesPerInstance"); - - /** The actual serialized value for a RenderingType instance. */ - private final String value; - - RenderingType(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a RenderingType instance. - * - * @param value the serialized value to parse. - * @return the parsed RenderingType object, or null if unable to parse. - */ - @JsonCreator - public static RenderingType fromString(String value) { - RenderingType[] items = RenderingType.values(); - for (RenderingType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/RenewCertificateOrderRequest.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/RenewCertificateOrderRequest.java deleted file mode 100644 index 0b9284549add..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/RenewCertificateOrderRequest.java +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.models.RenewCertificateOrderRequestProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Class representing certificate renew request. */ -@Fluent -public final class RenewCertificateOrderRequest extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RenewCertificateOrderRequest.class); - - /* - * RenewCertificateOrderRequest resource specific properties - */ - @JsonProperty(value = "properties") - private RenewCertificateOrderRequestProperties innerProperties; - - /** - * Get the innerProperties property: RenewCertificateOrderRequest resource specific properties. - * - * @return the innerProperties value. - */ - private RenewCertificateOrderRequestProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public RenewCertificateOrderRequest withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the keySize property: Certificate Key Size. - * - * @return the keySize value. - */ - public Integer keySize() { - return this.innerProperties() == null ? null : this.innerProperties().keySize(); - } - - /** - * Set the keySize property: Certificate Key Size. - * - * @param keySize the keySize value to set. - * @return the RenewCertificateOrderRequest object itself. - */ - public RenewCertificateOrderRequest withKeySize(Integer keySize) { - if (this.innerProperties() == null) { - this.innerProperties = new RenewCertificateOrderRequestProperties(); - } - this.innerProperties().withKeySize(keySize); - return this; - } - - /** - * Get the csr property: Csr to be used for re-key operation. - * - * @return the csr value. - */ - public String csr() { - return this.innerProperties() == null ? null : this.innerProperties().csr(); - } - - /** - * Set the csr property: Csr to be used for re-key operation. - * - * @param csr the csr value to set. - * @return the RenewCertificateOrderRequest object itself. - */ - public RenewCertificateOrderRequest withCsr(String csr) { - if (this.innerProperties() == null) { - this.innerProperties = new RenewCertificateOrderRequestProperties(); - } - this.innerProperties().withCsr(csr); - return this; - } - - /** - * Get the isPrivateKeyExternal property: Should we change the ASC type (from managed private key to external - * private key and vice versa). - * - * @return the isPrivateKeyExternal value. - */ - public Boolean isPrivateKeyExternal() { - return this.innerProperties() == null ? null : this.innerProperties().isPrivateKeyExternal(); - } - - /** - * Set the isPrivateKeyExternal property: Should we change the ASC type (from managed private key to external - * private key and vice versa). - * - * @param isPrivateKeyExternal the isPrivateKeyExternal value to set. - * @return the RenewCertificateOrderRequest object itself. - */ - public RenewCertificateOrderRequest withIsPrivateKeyExternal(Boolean isPrivateKeyExternal) { - if (this.innerProperties() == null) { - this.innerProperties = new RenewCertificateOrderRequestProperties(); - } - this.innerProperties().withIsPrivateKeyExternal(isPrivateKeyExternal); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/RepositoryType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/RepositoryType.java deleted file mode 100644 index bbdd1feeaeef..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/RepositoryType.java +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.models; - -/** The type of a repository. */ -public enum RepositoryType { - /** Git repository. */ - GIT, - /** Mercurial repository. */ - MERCURIAL -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/RequestsBasedTrigger.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/RequestsBasedTrigger.java deleted file mode 100644 index 83a2e358ef21..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/RequestsBasedTrigger.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Trigger based on total requests. */ -@Fluent -public final class RequestsBasedTrigger { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RequestsBasedTrigger.class); - - /* - * Request Count. - */ - @JsonProperty(value = "count") - private Integer count; - - /* - * Time interval. - */ - @JsonProperty(value = "timeInterval") - private String timeInterval; - - /** - * Get the count property: Request Count. - * - * @return the count value. - */ - public Integer count() { - return this.count; - } - - /** - * Set the count property: Request Count. - * - * @param count the count value to set. - * @return the RequestsBasedTrigger object itself. - */ - public RequestsBasedTrigger withCount(Integer count) { - this.count = count; - return this; - } - - /** - * Get the timeInterval property: Time interval. - * - * @return the timeInterval value. - */ - public String timeInterval() { - return this.timeInterval; - } - - /** - * Set the timeInterval property: Time interval. - * - * @param timeInterval the timeInterval value to set. - * @return the RequestsBasedTrigger object itself. - */ - public RequestsBasedTrigger withTimeInterval(String timeInterval) { - this.timeInterval = timeInterval; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ResourceCollection.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ResourceCollection.java deleted file mode 100644 index 6a34aa74bda4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ResourceCollection.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Collection of resources. */ -@Fluent -public final class ResourceCollection { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceCollection.class); - - /* - * Collection of resources. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * Link to next page of resources. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: Collection of resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Collection of resources. - * - * @param value the value value to set. - * @return the ResourceCollection object itself. - */ - public ResourceCollection withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to next page of resources. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model ResourceCollection")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ResourceHealthMetadataCollection.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ResourceHealthMetadataCollection.java deleted file mode 100644 index bee7cecba4d3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ResourceHealthMetadataCollection.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.models.ResourceHealthMetadataInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Collection of resource health metadata. */ -@Fluent -public final class ResourceHealthMetadataCollection { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceHealthMetadataCollection.class); - - /* - * Collection of resources. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * Link to next page of resources. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: Collection of resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Collection of resources. - * - * @param value the value value to set. - * @return the ResourceHealthMetadataCollection object itself. - */ - public ResourceHealthMetadataCollection withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to next page of resources. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property value in model ResourceHealthMetadataCollection")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ResourceMetricAvailability.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ResourceMetricAvailability.java deleted file mode 100644 index 083dca51d7ab..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ResourceMetricAvailability.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Metrics availability and retention. */ -@Immutable -public final class ResourceMetricAvailability { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceMetricAvailability.class); - - /* - * Time grain . - */ - @JsonProperty(value = "timeGrain", access = JsonProperty.Access.WRITE_ONLY) - private String timeGrain; - - /* - * Retention period for the current time grain. - */ - @JsonProperty(value = "retention", access = JsonProperty.Access.WRITE_ONLY) - private String retention; - - /** - * Get the timeGrain property: Time grain . - * - * @return the timeGrain value. - */ - public String timeGrain() { - return this.timeGrain; - } - - /** - * Get the retention property: Retention period for the current time grain. - * - * @return the retention value. - */ - public String retention() { - return this.retention; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ResourceMetricCollection.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ResourceMetricCollection.java deleted file mode 100644 index 5f9877596535..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ResourceMetricCollection.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.models.ResourceMetricInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Collection of metric responses. */ -@Fluent -public final class ResourceMetricCollection { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceMetricCollection.class); - - /* - * Collection of resources. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * Link to next page of resources. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: Collection of resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Collection of resources. - * - * @param value the value value to set. - * @return the ResourceMetricCollection object itself. - */ - public ResourceMetricCollection withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to next page of resources. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model ResourceMetricCollection")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ResourceMetricDefinitionCollection.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ResourceMetricDefinitionCollection.java deleted file mode 100644 index 9551ecc9c229..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ResourceMetricDefinitionCollection.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.models.ResourceMetricDefinitionInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Collection of metric definitions. */ -@Fluent -public final class ResourceMetricDefinitionCollection { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceMetricDefinitionCollection.class); - - /* - * Collection of resources. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * Link to next page of resources. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: Collection of resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Collection of resources. - * - * @param value the value value to set. - * @return the ResourceMetricDefinitionCollection object itself. - */ - public ResourceMetricDefinitionCollection withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to next page of resources. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property value in model ResourceMetricDefinitionCollection")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ResourceMetricName.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ResourceMetricName.java deleted file mode 100644 index ef0255f91a53..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ResourceMetricName.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Name of a metric for any resource . */ -@Immutable -public final class ResourceMetricName { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceMetricName.class); - - /* - * metric name value. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private String value; - - /* - * Localized metric name value. - */ - @JsonProperty(value = "localizedValue", access = JsonProperty.Access.WRITE_ONLY) - private String localizedValue; - - /** - * Get the value property: metric name value. - * - * @return the value value. - */ - public String value() { - return this.value; - } - - /** - * Get the localizedValue property: Localized metric name value. - * - * @return the localizedValue value. - */ - public String localizedValue() { - return this.localizedValue; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ResourceMetricProperty.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ResourceMetricProperty.java deleted file mode 100644 index dce158e145cb..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ResourceMetricProperty.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Resource metric property. */ -@Fluent -public final class ResourceMetricProperty { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceMetricProperty.class); - - /* - * Key for resource metric property. - */ - @JsonProperty(value = "key") - private String key; - - /* - * Value of pair. - */ - @JsonProperty(value = "value") - private String value; - - /** - * Get the key property: Key for resource metric property. - * - * @return the key value. - */ - public String key() { - return this.key; - } - - /** - * Set the key property: Key for resource metric property. - * - * @param key the key value to set. - * @return the ResourceMetricProperty object itself. - */ - public ResourceMetricProperty withKey(String key) { - this.key = key; - return this; - } - - /** - * Get the value property: Value of pair. - * - * @return the value value. - */ - public String value() { - return this.value; - } - - /** - * Set the value property: Value of pair. - * - * @param value the value value to set. - * @return the ResourceMetricProperty object itself. - */ - public ResourceMetricProperty withValue(String value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ResourceMetricValue.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ResourceMetricValue.java deleted file mode 100644 index 2a3627cf3bba..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ResourceMetricValue.java +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Value of resource metric. */ -@Immutable -public final class ResourceMetricValue { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceMetricValue.class); - - /* - * Value timestamp. - */ - @JsonProperty(value = "timestamp", access = JsonProperty.Access.WRITE_ONLY) - private String timestamp; - - /* - * Value average. - */ - @JsonProperty(value = "average", access = JsonProperty.Access.WRITE_ONLY) - private Float average; - - /* - * Value minimum. - */ - @JsonProperty(value = "minimum", access = JsonProperty.Access.WRITE_ONLY) - private Float minimum; - - /* - * Value maximum. - */ - @JsonProperty(value = "maximum", access = JsonProperty.Access.WRITE_ONLY) - private Float maximum; - - /* - * Value total. - */ - @JsonProperty(value = "total", access = JsonProperty.Access.WRITE_ONLY) - private Float total; - - /* - * Value count. - */ - @JsonProperty(value = "count", access = JsonProperty.Access.WRITE_ONLY) - private Float count; - - /* - * Resource metric properties collection. - */ - @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY) - private List properties; - - /** - * Get the timestamp property: Value timestamp. - * - * @return the timestamp value. - */ - public String timestamp() { - return this.timestamp; - } - - /** - * Get the average property: Value average. - * - * @return the average value. - */ - public Float average() { - return this.average; - } - - /** - * Get the minimum property: Value minimum. - * - * @return the minimum value. - */ - public Float minimum() { - return this.minimum; - } - - /** - * Get the maximum property: Value maximum. - * - * @return the maximum value. - */ - public Float maximum() { - return this.maximum; - } - - /** - * Get the total property: Value total. - * - * @return the total value. - */ - public Float total() { - return this.total; - } - - /** - * Get the count property: Value count. - * - * @return the count value. - */ - public Float count() { - return this.count; - } - - /** - * Get the properties property: Resource metric properties collection. - * - * @return the properties value. - */ - public List properties() { - return this.properties; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ResourceNameAvailabilityRequest.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ResourceNameAvailabilityRequest.java deleted file mode 100644 index 72dc7ffa9c92..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ResourceNameAvailabilityRequest.java +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Resource name availability request content. */ -@Fluent -public final class ResourceNameAvailabilityRequest { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceNameAvailabilityRequest.class); - - /* - * Resource name to verify. - */ - @JsonProperty(value = "name", required = true) - private String name; - - /* - * Resource type used for verification. - */ - @JsonProperty(value = "type", required = true) - private CheckNameResourceTypes type; - - /* - * Is fully qualified domain name. - */ - @JsonProperty(value = "isFqdn") - private Boolean isFqdn; - - /** - * Get the name property: Resource name to verify. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Resource name to verify. - * - * @param name the name value to set. - * @return the ResourceNameAvailabilityRequest object itself. - */ - public ResourceNameAvailabilityRequest withName(String name) { - this.name = name; - return this; - } - - /** - * Get the type property: Resource type used for verification. - * - * @return the type value. - */ - public CheckNameResourceTypes type() { - return this.type; - } - - /** - * Set the type property: Resource type used for verification. - * - * @param type the type value to set. - * @return the ResourceNameAvailabilityRequest object itself. - */ - public ResourceNameAvailabilityRequest withType(CheckNameResourceTypes type) { - this.type = type; - return this; - } - - /** - * Get the isFqdn property: Is fully qualified domain name. - * - * @return the isFqdn value. - */ - public Boolean isFqdn() { - return this.isFqdn; - } - - /** - * Set the isFqdn property: Is fully qualified domain name. - * - * @param isFqdn the isFqdn value to set. - * @return the ResourceNameAvailabilityRequest object itself. - */ - public ResourceNameAvailabilityRequest withIsFqdn(Boolean isFqdn) { - this.isFqdn = isFqdn; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property name in model ResourceNameAvailabilityRequest")); - } - if (type() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property type in model ResourceNameAvailabilityRequest")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ResourceScopeType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ResourceScopeType.java deleted file mode 100644 index 54c3d1e52c26..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ResourceScopeType.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ResourceScopeType. */ -public final class ResourceScopeType extends ExpandableStringEnum { - /** Static value ServerFarm for ResourceScopeType. */ - public static final ResourceScopeType SERVER_FARM = fromString("ServerFarm"); - - /** Static value Subscription for ResourceScopeType. */ - public static final ResourceScopeType SUBSCRIPTION = fromString("Subscription"); - - /** Static value WebSite for ResourceScopeType. */ - public static final ResourceScopeType WEB_SITE = fromString("WebSite"); - - /** - * Creates or finds a ResourceScopeType from its string representation. - * - * @param name a name to look for. - * @return the corresponding ResourceScopeType. - */ - @JsonCreator - public static ResourceScopeType fromString(String name) { - return fromString(name, ResourceScopeType.class); - } - - /** @return known ResourceScopeType values. */ - public static Collection values() { - return values(ResourceScopeType.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ResponseMetadata.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ResponseMetadata.java deleted file mode 100644 index 864fe22fd4af..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ResponseMetadata.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The ResponseMetadata model. */ -@Fluent -public final class ResponseMetadata { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResponseMetadata.class); - - /* - * Source of the Data - */ - @JsonProperty(value = "dataSource") - private DataSource dataSource; - - /** - * Get the dataSource property: Source of the Data. - * - * @return the dataSource value. - */ - public DataSource dataSource() { - return this.dataSource; - } - - /** - * Set the dataSource property: Source of the Data. - * - * @param dataSource the dataSource value to set. - * @return the ResponseMetadata object itself. - */ - public ResponseMetadata withDataSource(DataSource dataSource) { - this.dataSource = dataSource; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (dataSource() != null) { - dataSource().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/RouteType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/RouteType.java deleted file mode 100644 index 56b845ce5d8f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/RouteType.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for RouteType. */ -public final class RouteType extends ExpandableStringEnum { - /** Static value DEFAULT for RouteType. */ - public static final RouteType DEFAULT = fromString("DEFAULT"); - - /** Static value INHERITED for RouteType. */ - public static final RouteType INHERITED = fromString("INHERITED"); - - /** Static value STATIC for RouteType. */ - public static final RouteType STATIC = fromString("STATIC"); - - /** - * Creates or finds a RouteType from its string representation. - * - * @param name a name to look for. - * @return the corresponding RouteType. - */ - @JsonCreator - public static RouteType fromString(String name) { - return fromString(name, RouteType.class); - } - - /** @return known RouteType values. */ - public static Collection values() { - return values(RouteType.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/RuntimeStack.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/RuntimeStack.java deleted file mode 100644 index 6e102cc3e522..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/RuntimeStack.java +++ /dev/null @@ -1,148 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import java.util.Collection; - -/** Defines App service pricing tiers. */ -@Fluent -public class RuntimeStack { - private static final AttributeCollection COLLECTION = new AttributeCollection<>(); - - /** .NET Core v2.1. */ - public static final RuntimeStack NETCORE_V2_1 = COLLECTION.addValue(new RuntimeStack("DOTNETCORE", "2.1")); - - /** .NET Core v3.1. */ - public static final RuntimeStack NETCORE_V3_1 = COLLECTION.addValue(new RuntimeStack("DOTNETCORE", "3.1")); - - /** JAVA JRE 8. */ - public static final RuntimeStack JAVA_8_JRE8 = COLLECTION.addValue(new RuntimeStack("JAVA", "8-jre8")); - - /** JAVA JAVA 11. */ - public static final RuntimeStack JAVA_11_JAVA11 = COLLECTION.addValue(new RuntimeStack("JAVA", "11-java11")); - - /** Node.JS 10.1. */ - public static final RuntimeStack NODEJS_10_1 = COLLECTION.addValue(new RuntimeStack("NODE", "10.1")); - - /** Node.JS 10.6. */ - public static final RuntimeStack NODEJS_10_6 = COLLECTION.addValue(new RuntimeStack("NODE", "10.6")); - - /** Node.JS 10.14. */ - public static final RuntimeStack NODEJS_10_14 = COLLECTION.addValue(new RuntimeStack("NODE", "10.14")); - - /** Node.JS 10 LTS. */ - public static final RuntimeStack NODEJS_10_LTS = COLLECTION.addValue(new RuntimeStack("NODE", "10-lts")); - - /** Node.JS 12 LTS. */ - public static final RuntimeStack NODEJS_12_LTS = COLLECTION.addValue(new RuntimeStack("NODE", "12-lts")); - - /** Node.JS 14 LTS. */ - public static final RuntimeStack NODEJS_14_LTS = COLLECTION.addValue(new RuntimeStack("NODE", "14-lts")); - - /** PHP 7.2. */ - public static final RuntimeStack PHP_7_2 = COLLECTION.addValue(new RuntimeStack("PHP", "7.2")); - - /** PHP 7.3. */ - public static final RuntimeStack PHP_7_3 = COLLECTION.addValue(new RuntimeStack("PHP", "7.3")); - - /** PHP 7.4. */ - public static final RuntimeStack PHP_7_4 = COLLECTION.addValue(new RuntimeStack("PHP", "7.4")); - - /** PYTHON 3.6. */ - public static final RuntimeStack PYTHON_3_6 = COLLECTION.addValue(new RuntimeStack("PYTHON", "3.6")); - - /** PYTHON 3.7. */ - public static final RuntimeStack PYTHON_3_7 = COLLECTION.addValue(new RuntimeStack("PYTHON", "3.7")); - - /** PYTHON 3.8. */ - public static final RuntimeStack PYTHON_3_8 = COLLECTION.addValue(new RuntimeStack("PYTHON", "3.8")); - - /** RUBY 2.5. */ - public static final RuntimeStack RUBY_2_5 = COLLECTION.addValue(new RuntimeStack("RUBY", "2.5")); - - /** RUBY 2.6. */ - public static final RuntimeStack RUBY_2_6 = COLLECTION.addValue(new RuntimeStack("RUBY", "2.6")); - - /** Tomcat 8.5-java11 image with catalina root set to Azure wwwroot. */ - public static final RuntimeStack TOMCAT_8_5_JAVA11 = COLLECTION.addValue(new RuntimeStack("TOMCAT", "8.5-java11")); - - /** Tomcat 8.5-jre8 image with catalina root set to Azure wwwroot. */ - public static final RuntimeStack TOMCAT_8_5_JRE8 = COLLECTION.addValue(new RuntimeStack("TOMCAT", "8.5-jre8")); - - /** Tomcat 9.0-java11 image with catalina root set to Azure wwwroot. */ - public static final RuntimeStack TOMCAT_9_0_JAVA11 = COLLECTION.addValue(new RuntimeStack("TOMCAT", "9.0-java11")); - - /** Tomcat 9.0-jre8 image with catalina root set to Azure wwwroot. */ - public static final RuntimeStack TOMCAT_9_0_JRE8 = COLLECTION.addValue(new RuntimeStack("TOMCAT", "9.0-jre8")); - - /** JBOSS EAP 7.2-java8. */ - public static final RuntimeStack JBOSS_EAP_7_2_JAVA8 = - COLLECTION.addValue(new RuntimeStack("JBOSSEAP", "7.2-java8")); - - /** JBOSS EAP 7-java8. */ - public static final RuntimeStack JBOSS_EAP_7_JAVA8 = - COLLECTION.addValue(new RuntimeStack("JBOSSEAP", "7-java8")); - - /** JBOSS EAP 7-java11. */ - public static final RuntimeStack JBOSS_EAP_7_JAVA11 = - COLLECTION.addValue(new RuntimeStack("JBOSSEAP", "7-java11")); - - /** The name of the language runtime stack. */ - private final String stack; - /** The version of the runtime. */ - private final String version; - - /** - * Creates a custom app service runtime stack on Linux operating system. - * - * @param stack the name of the language stack - * @param version the version of the runtime - */ - public RuntimeStack(String stack, String version) { - this.stack = stack; - this.version = version; - } - - /** @return the name of the language runtime stack */ - public String stack() { - return stack; - } - - /** @return the version of the runtime stack */ - public String version() { - return version; - } - - /** - * Lists the pre-defined app service runtime stacks. - * - * @return immutable collection of the pre-defined app service runtime stacks - */ - public static Collection getAll() { - return COLLECTION.getAllValues(); - } - - @Override - public String toString() { - return stack + " " + version; - } - - @Override - public int hashCode() { - return toString().hashCode(); - } - - @Override - public boolean equals(Object obj) { - if (!(obj instanceof RuntimeStack)) { - return false; - } - if (obj == this) { - return true; - } - RuntimeStack rhs = (RuntimeStack) obj; - return toString().equalsIgnoreCase(rhs.toString()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ScmType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ScmType.java deleted file mode 100644 index 840cd2a511ac..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ScmType.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ScmType. */ -public final class ScmType extends ExpandableStringEnum { - /** Static value None for ScmType. */ - public static final ScmType NONE = fromString("None"); - - /** Static value Dropbox for ScmType. */ - public static final ScmType DROPBOX = fromString("Dropbox"); - - /** Static value Tfs for ScmType. */ - public static final ScmType TFS = fromString("Tfs"); - - /** Static value LocalGit for ScmType. */ - public static final ScmType LOCAL_GIT = fromString("LocalGit"); - - /** Static value GitHub for ScmType. */ - public static final ScmType GIT_HUB = fromString("GitHub"); - - /** Static value CodePlexGit for ScmType. */ - public static final ScmType CODE_PLEX_GIT = fromString("CodePlexGit"); - - /** Static value CodePlexHg for ScmType. */ - public static final ScmType CODE_PLEX_HG = fromString("CodePlexHg"); - - /** Static value BitbucketGit for ScmType. */ - public static final ScmType BITBUCKET_GIT = fromString("BitbucketGit"); - - /** Static value BitbucketHg for ScmType. */ - public static final ScmType BITBUCKET_HG = fromString("BitbucketHg"); - - /** Static value ExternalGit for ScmType. */ - public static final ScmType EXTERNAL_GIT = fromString("ExternalGit"); - - /** Static value ExternalHg for ScmType. */ - public static final ScmType EXTERNAL_HG = fromString("ExternalHg"); - - /** Static value OneDrive for ScmType. */ - public static final ScmType ONE_DRIVE = fromString("OneDrive"); - - /** Static value VSO for ScmType. */ - public static final ScmType VSO = fromString("VSO"); - - /** - * Creates or finds a ScmType from its string representation. - * - * @param name a name to look for. - * @return the corresponding ScmType. - */ - @JsonCreator - public static ScmType fromString(String name) { - return fromString(name, ScmType.class); - } - - /** @return known ScmType values. */ - public static Collection values() { - return values(ScmType.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ServiceSpecification.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ServiceSpecification.java deleted file mode 100644 index c2aef75ed545..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ServiceSpecification.java +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Resource metrics service provided by Microsoft.Insights resource provider. */ -@Fluent -public final class ServiceSpecification { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceSpecification.class); - - /* - * The metricSpecifications property. - */ - @JsonProperty(value = "metricSpecifications") - private List metricSpecifications; - - /* - * The logSpecifications property. - */ - @JsonProperty(value = "logSpecifications") - private List logSpecifications; - - /** - * Get the metricSpecifications property: The metricSpecifications property. - * - * @return the metricSpecifications value. - */ - public List metricSpecifications() { - return this.metricSpecifications; - } - - /** - * Set the metricSpecifications property: The metricSpecifications property. - * - * @param metricSpecifications the metricSpecifications value to set. - * @return the ServiceSpecification object itself. - */ - public ServiceSpecification withMetricSpecifications(List metricSpecifications) { - this.metricSpecifications = metricSpecifications; - return this; - } - - /** - * Get the logSpecifications property: The logSpecifications property. - * - * @return the logSpecifications value. - */ - public List logSpecifications() { - return this.logSpecifications; - } - - /** - * Set the logSpecifications property: The logSpecifications property. - * - * @param logSpecifications the logSpecifications value to set. - * @return the ServiceSpecification object itself. - */ - public ServiceSpecification withLogSpecifications(List logSpecifications) { - this.logSpecifications = logSpecifications; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (metricSpecifications() != null) { - metricSpecifications().forEach(e -> e.validate()); - } - if (logSpecifications() != null) { - logSpecifications().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SiteAvailabilityState.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SiteAvailabilityState.java deleted file mode 100644 index 15b3074764c0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SiteAvailabilityState.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for SiteAvailabilityState. */ -public enum SiteAvailabilityState { - /** Enum value Normal. */ - NORMAL("Normal"), - - /** Enum value Limited. */ - LIMITED("Limited"), - - /** Enum value DisasterRecoveryMode. */ - DISASTER_RECOVERY_MODE("DisasterRecoveryMode"); - - /** The actual serialized value for a SiteAvailabilityState instance. */ - private final String value; - - SiteAvailabilityState(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a SiteAvailabilityState instance. - * - * @param value the serialized value to parse. - * @return the parsed SiteAvailabilityState object, or null if unable to parse. - */ - @JsonCreator - public static SiteAvailabilityState fromString(String value) { - SiteAvailabilityState[] items = SiteAvailabilityState.values(); - for (SiteAvailabilityState item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SiteCloneabilityCriterion.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SiteCloneabilityCriterion.java deleted file mode 100644 index e4034f48a76f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SiteCloneabilityCriterion.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** An app cloneability criterion. */ -@Fluent -public final class SiteCloneabilityCriterion { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SiteCloneabilityCriterion.class); - - /* - * Name of criterion. - */ - @JsonProperty(value = "name") - private String name; - - /* - * Description of criterion. - */ - @JsonProperty(value = "description") - private String description; - - /** - * Get the name property: Name of criterion. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Name of criterion. - * - * @param name the name value to set. - * @return the SiteCloneabilityCriterion object itself. - */ - public SiteCloneabilityCriterion withName(String name) { - this.name = name; - return this; - } - - /** - * Get the description property: Description of criterion. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: Description of criterion. - * - * @param description the description value to set. - * @return the SiteCloneabilityCriterion object itself. - */ - public SiteCloneabilityCriterion withDescription(String description) { - this.description = description; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SiteConfigResourceCollection.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SiteConfigResourceCollection.java deleted file mode 100644 index 1df3265de8cc..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SiteConfigResourceCollection.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.models.SiteConfigResourceInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Collection of site configurations. */ -@Fluent -public final class SiteConfigResourceCollection { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SiteConfigResourceCollection.class); - - /* - * Collection of resources. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * Link to next page of resources. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: Collection of resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Collection of resources. - * - * @param value the value value to set. - * @return the SiteConfigResourceCollection object itself. - */ - public SiteConfigResourceCollection withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to next page of resources. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property value in model SiteConfigResourceCollection")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SiteConfigurationSnapshotInfoCollection.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SiteConfigurationSnapshotInfoCollection.java deleted file mode 100644 index 773d24a94563..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SiteConfigurationSnapshotInfoCollection.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.models.SiteConfigurationSnapshotInfoInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Collection of metadata for the app configuration snapshots that can be restored. */ -@Fluent -public final class SiteConfigurationSnapshotInfoCollection { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SiteConfigurationSnapshotInfoCollection.class); - - /* - * Collection of resources. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * Link to next page of resources. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: Collection of resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Collection of resources. - * - * @param value the value value to set. - * @return the SiteConfigurationSnapshotInfoCollection object itself. - */ - public SiteConfigurationSnapshotInfoCollection withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to next page of resources. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property value in model SiteConfigurationSnapshotInfoCollection")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SiteExtensionInfoCollection.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SiteExtensionInfoCollection.java deleted file mode 100644 index 0b23099356ab..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SiteExtensionInfoCollection.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.models.SiteExtensionInfoInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Collection of Kudu site extension information elements. */ -@Fluent -public final class SiteExtensionInfoCollection { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SiteExtensionInfoCollection.class); - - /* - * Collection of resources. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * Link to next page of resources. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: Collection of resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Collection of resources. - * - * @param value the value value to set. - * @return the SiteExtensionInfoCollection object itself. - */ - public SiteExtensionInfoCollection withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to next page of resources. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property value in model SiteExtensionInfoCollection")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SiteExtensionType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SiteExtensionType.java deleted file mode 100644 index b0671a948222..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SiteExtensionType.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for SiteExtensionType. */ -public enum SiteExtensionType { - /** Enum value Gallery. */ - GALLERY("Gallery"), - - /** Enum value WebRoot. */ - WEB_ROOT("WebRoot"); - - /** The actual serialized value for a SiteExtensionType instance. */ - private final String value; - - SiteExtensionType(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a SiteExtensionType instance. - * - * @param value the serialized value to parse. - * @return the parsed SiteExtensionType object, or null if unable to parse. - */ - @JsonCreator - public static SiteExtensionType fromString(String value) { - SiteExtensionType[] items = SiteExtensionType.values(); - for (SiteExtensionType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SiteLimits.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SiteLimits.java deleted file mode 100644 index 556598b65822..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SiteLimits.java +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Metric limits set on an app. */ -@Fluent -public final class SiteLimits { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SiteLimits.class); - - /* - * Maximum allowed CPU usage percentage. - */ - @JsonProperty(value = "maxPercentageCpu") - private Double maxPercentageCpu; - - /* - * Maximum allowed memory usage in MB. - */ - @JsonProperty(value = "maxMemoryInMb") - private Long maxMemoryInMb; - - /* - * Maximum allowed disk size usage in MB. - */ - @JsonProperty(value = "maxDiskSizeInMb") - private Long maxDiskSizeInMb; - - /** - * Get the maxPercentageCpu property: Maximum allowed CPU usage percentage. - * - * @return the maxPercentageCpu value. - */ - public Double maxPercentageCpu() { - return this.maxPercentageCpu; - } - - /** - * Set the maxPercentageCpu property: Maximum allowed CPU usage percentage. - * - * @param maxPercentageCpu the maxPercentageCpu value to set. - * @return the SiteLimits object itself. - */ - public SiteLimits withMaxPercentageCpu(Double maxPercentageCpu) { - this.maxPercentageCpu = maxPercentageCpu; - return this; - } - - /** - * Get the maxMemoryInMb property: Maximum allowed memory usage in MB. - * - * @return the maxMemoryInMb value. - */ - public Long maxMemoryInMb() { - return this.maxMemoryInMb; - } - - /** - * Set the maxMemoryInMb property: Maximum allowed memory usage in MB. - * - * @param maxMemoryInMb the maxMemoryInMb value to set. - * @return the SiteLimits object itself. - */ - public SiteLimits withMaxMemoryInMb(Long maxMemoryInMb) { - this.maxMemoryInMb = maxMemoryInMb; - return this; - } - - /** - * Get the maxDiskSizeInMb property: Maximum allowed disk size usage in MB. - * - * @return the maxDiskSizeInMb value. - */ - public Long maxDiskSizeInMb() { - return this.maxDiskSizeInMb; - } - - /** - * Set the maxDiskSizeInMb property: Maximum allowed disk size usage in MB. - * - * @param maxDiskSizeInMb the maxDiskSizeInMb value to set. - * @return the SiteLimits object itself. - */ - public SiteLimits withMaxDiskSizeInMb(Long maxDiskSizeInMb) { - this.maxDiskSizeInMb = maxDiskSizeInMb; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SiteLoadBalancing.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SiteLoadBalancing.java deleted file mode 100644 index 7877483c383f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SiteLoadBalancing.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for SiteLoadBalancing. */ -public enum SiteLoadBalancing { - /** Enum value WeightedRoundRobin. */ - WEIGHTED_ROUND_ROBIN("WeightedRoundRobin"), - - /** Enum value LeastRequests. */ - LEAST_REQUESTS("LeastRequests"), - - /** Enum value LeastResponseTime. */ - LEAST_RESPONSE_TIME("LeastResponseTime"), - - /** Enum value WeightedTotalTraffic. */ - WEIGHTED_TOTAL_TRAFFIC("WeightedTotalTraffic"), - - /** Enum value RequestHash. */ - REQUEST_HASH("RequestHash"); - - /** The actual serialized value for a SiteLoadBalancing instance. */ - private final String value; - - SiteLoadBalancing(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a SiteLoadBalancing instance. - * - * @param value the serialized value to parse. - * @return the parsed SiteLoadBalancing object, or null if unable to parse. - */ - @JsonCreator - public static SiteLoadBalancing fromString(String value) { - SiteLoadBalancing[] items = SiteLoadBalancing.values(); - for (SiteLoadBalancing item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SiteMachineKey.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SiteMachineKey.java deleted file mode 100644 index a3e0436a9118..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SiteMachineKey.java +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** MachineKey of an app. */ -@Fluent -public final class SiteMachineKey { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SiteMachineKey.class); - - /* - * MachineKey validation. - */ - @JsonProperty(value = "validation") - private String validation; - - /* - * Validation key. - */ - @JsonProperty(value = "validationKey") - private String validationKey; - - /* - * Algorithm used for decryption. - */ - @JsonProperty(value = "decryption") - private String decryption; - - /* - * Decryption key. - */ - @JsonProperty(value = "decryptionKey") - private String decryptionKey; - - /** - * Get the validation property: MachineKey validation. - * - * @return the validation value. - */ - public String validation() { - return this.validation; - } - - /** - * Set the validation property: MachineKey validation. - * - * @param validation the validation value to set. - * @return the SiteMachineKey object itself. - */ - public SiteMachineKey withValidation(String validation) { - this.validation = validation; - return this; - } - - /** - * Get the validationKey property: Validation key. - * - * @return the validationKey value. - */ - public String validationKey() { - return this.validationKey; - } - - /** - * Set the validationKey property: Validation key. - * - * @param validationKey the validationKey value to set. - * @return the SiteMachineKey object itself. - */ - public SiteMachineKey withValidationKey(String validationKey) { - this.validationKey = validationKey; - return this; - } - - /** - * Get the decryption property: Algorithm used for decryption. - * - * @return the decryption value. - */ - public String decryption() { - return this.decryption; - } - - /** - * Set the decryption property: Algorithm used for decryption. - * - * @param decryption the decryption value to set. - * @return the SiteMachineKey object itself. - */ - public SiteMachineKey withDecryption(String decryption) { - this.decryption = decryption; - return this; - } - - /** - * Get the decryptionKey property: Decryption key. - * - * @return the decryptionKey value. - */ - public String decryptionKey() { - return this.decryptionKey; - } - - /** - * Set the decryptionKey property: Decryption key. - * - * @param decryptionKey the decryptionKey value to set. - * @return the SiteMachineKey object itself. - */ - public SiteMachineKey withDecryptionKey(String decryptionKey) { - this.decryptionKey = decryptionKey; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SiteSealRequest.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SiteSealRequest.java deleted file mode 100644 index 23111ff5d740..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SiteSealRequest.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Site seal request. */ -@Fluent -public final class SiteSealRequest { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SiteSealRequest.class); - - /* - * If true use the light color theme for site seal; otherwise, - * use the default color theme. - */ - @JsonProperty(value = "lightTheme") - private Boolean lightTheme; - - /* - * Locale of site seal. - */ - @JsonProperty(value = "locale") - private String locale; - - /** - * Get the lightTheme property: If <code>true</code> use the light color theme for site seal; otherwise, - * use the default color theme. - * - * @return the lightTheme value. - */ - public Boolean lightTheme() { - return this.lightTheme; - } - - /** - * Set the lightTheme property: If <code>true</code> use the light color theme for site seal; otherwise, - * use the default color theme. - * - * @param lightTheme the lightTheme value to set. - * @return the SiteSealRequest object itself. - */ - public SiteSealRequest withLightTheme(Boolean lightTheme) { - this.lightTheme = lightTheme; - return this; - } - - /** - * Get the locale property: Locale of site seal. - * - * @return the locale value. - */ - public String locale() { - return this.locale; - } - - /** - * Set the locale property: Locale of site seal. - * - * @param locale the locale value to set. - * @return the SiteSealRequest object itself. - */ - public SiteSealRequest withLocale(String locale) { - this.locale = locale; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SkuCapacity.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SkuCapacity.java deleted file mode 100644 index ef2dfc5a9381..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SkuCapacity.java +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Description of the App Service plan scale options. */ -@Fluent -public final class SkuCapacity { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SkuCapacity.class); - - /* - * Minimum number of workers for this App Service plan SKU. - */ - @JsonProperty(value = "minimum") - private Integer minimum; - - /* - * Maximum number of workers for this App Service plan SKU. - */ - @JsonProperty(value = "maximum") - private Integer maximum; - - /* - * Default number of workers for this App Service plan SKU. - */ - @JsonProperty(value = "default") - private Integer defaultProperty; - - /* - * Available scale configurations for an App Service plan. - */ - @JsonProperty(value = "scaleType") - private String scaleType; - - /** - * Get the minimum property: Minimum number of workers for this App Service plan SKU. - * - * @return the minimum value. - */ - public Integer minimum() { - return this.minimum; - } - - /** - * Set the minimum property: Minimum number of workers for this App Service plan SKU. - * - * @param minimum the minimum value to set. - * @return the SkuCapacity object itself. - */ - public SkuCapacity withMinimum(Integer minimum) { - this.minimum = minimum; - return this; - } - - /** - * Get the maximum property: Maximum number of workers for this App Service plan SKU. - * - * @return the maximum value. - */ - public Integer maximum() { - return this.maximum; - } - - /** - * Set the maximum property: Maximum number of workers for this App Service plan SKU. - * - * @param maximum the maximum value to set. - * @return the SkuCapacity object itself. - */ - public SkuCapacity withMaximum(Integer maximum) { - this.maximum = maximum; - return this; - } - - /** - * Get the defaultProperty property: Default number of workers for this App Service plan SKU. - * - * @return the defaultProperty value. - */ - public Integer defaultProperty() { - return this.defaultProperty; - } - - /** - * Set the defaultProperty property: Default number of workers for this App Service plan SKU. - * - * @param defaultProperty the defaultProperty value to set. - * @return the SkuCapacity object itself. - */ - public SkuCapacity withDefaultProperty(Integer defaultProperty) { - this.defaultProperty = defaultProperty; - return this; - } - - /** - * Get the scaleType property: Available scale configurations for an App Service plan. - * - * @return the scaleType value. - */ - public String scaleType() { - return this.scaleType; - } - - /** - * Set the scaleType property: Available scale configurations for an App Service plan. - * - * @param scaleType the scaleType value to set. - * @return the SkuCapacity object itself. - */ - public SkuCapacity withScaleType(String scaleType) { - this.scaleType = scaleType; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SkuDescription.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SkuDescription.java deleted file mode 100644 index 79e89e0c971f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SkuDescription.java +++ /dev/null @@ -1,240 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.models.CapabilityInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Description of a SKU for a scalable resource. */ -@Fluent -public final class SkuDescription { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SkuDescription.class); - - /* - * Name of the resource SKU. - */ - @JsonProperty(value = "name") - private String name; - - /* - * Service tier of the resource SKU. - */ - @JsonProperty(value = "tier") - private String tier; - - /* - * Size specifier of the resource SKU. - */ - @JsonProperty(value = "size") - private String size; - - /* - * Family code of the resource SKU. - */ - @JsonProperty(value = "family") - private String family; - - /* - * Current number of instances assigned to the resource. - */ - @JsonProperty(value = "capacity") - private Integer capacity; - - /* - * Min, max, and default scale values of the SKU. - */ - @JsonProperty(value = "skuCapacity") - private SkuCapacity skuCapacity; - - /* - * Locations of the SKU. - */ - @JsonProperty(value = "locations") - private List locations; - - /* - * Capabilities of the SKU, e.g., is traffic manager enabled? - */ - @JsonProperty(value = "capabilities") - private List capabilities; - - /** - * Get the name property: Name of the resource SKU. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Name of the resource SKU. - * - * @param name the name value to set. - * @return the SkuDescription object itself. - */ - public SkuDescription withName(String name) { - this.name = name; - return this; - } - - /** - * Get the tier property: Service tier of the resource SKU. - * - * @return the tier value. - */ - public String tier() { - return this.tier; - } - - /** - * Set the tier property: Service tier of the resource SKU. - * - * @param tier the tier value to set. - * @return the SkuDescription object itself. - */ - public SkuDescription withTier(String tier) { - this.tier = tier; - return this; - } - - /** - * Get the size property: Size specifier of the resource SKU. - * - * @return the size value. - */ - public String size() { - return this.size; - } - - /** - * Set the size property: Size specifier of the resource SKU. - * - * @param size the size value to set. - * @return the SkuDescription object itself. - */ - public SkuDescription withSize(String size) { - this.size = size; - return this; - } - - /** - * Get the family property: Family code of the resource SKU. - * - * @return the family value. - */ - public String family() { - return this.family; - } - - /** - * Set the family property: Family code of the resource SKU. - * - * @param family the family value to set. - * @return the SkuDescription object itself. - */ - public SkuDescription withFamily(String family) { - this.family = family; - return this; - } - - /** - * Get the capacity property: Current number of instances assigned to the resource. - * - * @return the capacity value. - */ - public Integer capacity() { - return this.capacity; - } - - /** - * Set the capacity property: Current number of instances assigned to the resource. - * - * @param capacity the capacity value to set. - * @return the SkuDescription object itself. - */ - public SkuDescription withCapacity(Integer capacity) { - this.capacity = capacity; - return this; - } - - /** - * Get the skuCapacity property: Min, max, and default scale values of the SKU. - * - * @return the skuCapacity value. - */ - public SkuCapacity skuCapacity() { - return this.skuCapacity; - } - - /** - * Set the skuCapacity property: Min, max, and default scale values of the SKU. - * - * @param skuCapacity the skuCapacity value to set. - * @return the SkuDescription object itself. - */ - public SkuDescription withSkuCapacity(SkuCapacity skuCapacity) { - this.skuCapacity = skuCapacity; - return this; - } - - /** - * Get the locations property: Locations of the SKU. - * - * @return the locations value. - */ - public List locations() { - return this.locations; - } - - /** - * Set the locations property: Locations of the SKU. - * - * @param locations the locations value to set. - * @return the SkuDescription object itself. - */ - public SkuDescription withLocations(List locations) { - this.locations = locations; - return this; - } - - /** - * Get the capabilities property: Capabilities of the SKU, e.g., is traffic manager enabled?. - * - * @return the capabilities value. - */ - public List capabilities() { - return this.capabilities; - } - - /** - * Set the capabilities property: Capabilities of the SKU, e.g., is traffic manager enabled?. - * - * @param capabilities the capabilities value to set. - * @return the SkuDescription object itself. - */ - public SkuDescription withCapabilities(List capabilities) { - this.capabilities = capabilities; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (skuCapacity() != null) { - skuCapacity().validate(); - } - if (capabilities() != null) { - capabilities().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SkuInfoCollection.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SkuInfoCollection.java deleted file mode 100644 index 052752800129..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SkuInfoCollection.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.models.SkuInfoInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Collection of SKU information. */ -@Fluent -public final class SkuInfoCollection { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SkuInfoCollection.class); - - /* - * Collection of resources. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * Link to next page of resources. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: Collection of resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Collection of resources. - * - * @param value the value value to set. - * @return the SkuInfoCollection object itself. - */ - public SkuInfoCollection withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to next page of resources. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model SkuInfoCollection")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SkuName.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SkuName.java deleted file mode 100644 index 054ff0dfa23e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SkuName.java +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for SkuName. */ -public final class SkuName extends ExpandableStringEnum { - /** Static value Free for SkuName. */ - public static final SkuName FREE = fromString("Free"); - - /** Static value Shared for SkuName. */ - public static final SkuName SHARED = fromString("Shared"); - - /** Static value Basic for SkuName. */ - public static final SkuName BASIC = fromString("Basic"); - - /** Static value Standard for SkuName. */ - public static final SkuName STANDARD = fromString("Standard"); - - /** Static value Premium for SkuName. */ - public static final SkuName PREMIUM = fromString("Premium"); - - /** Static value Dynamic for SkuName. */ - public static final SkuName DYNAMIC = fromString("Dynamic"); - - /** Static value Isolated for SkuName. */ - public static final SkuName ISOLATED = fromString("Isolated"); - - /** Static value PremiumV2 for SkuName. */ - public static final SkuName PREMIUM_V2 = fromString("PremiumV2"); - - /** Static value ElasticPremium for SkuName. */ - public static final SkuName ELASTIC_PREMIUM = fromString("ElasticPremium"); - - /** Static value ElasticIsolated for SkuName. */ - public static final SkuName ELASTIC_ISOLATED = fromString("ElasticIsolated"); - - /** - * Creates or finds a SkuName from its string representation. - * - * @param name a name to look for. - * @return the corresponding SkuName. - */ - @JsonCreator - public static SkuName fromString(String name) { - return fromString(name, SkuName.class); - } - - /** @return known SkuName values. */ - public static Collection values() { - return values(SkuName.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SlotDifferenceCollection.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SlotDifferenceCollection.java deleted file mode 100644 index d9ebd1123b87..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SlotDifferenceCollection.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.models.SlotDifferenceInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Collection of slot differences. */ -@Fluent -public final class SlotDifferenceCollection { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SlotDifferenceCollection.class); - - /* - * Collection of resources. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * Link to next page of resources. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: Collection of resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Collection of resources. - * - * @param value the value value to set. - * @return the SlotDifferenceCollection object itself. - */ - public SlotDifferenceCollection withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to next page of resources. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model SlotDifferenceCollection")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SlotSwapStatus.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SlotSwapStatus.java deleted file mode 100644 index 7188245e7131..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SlotSwapStatus.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** The status of the last successful slot swap operation. */ -@Immutable -public final class SlotSwapStatus { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SlotSwapStatus.class); - - /* - * The time the last successful slot swap completed. - */ - @JsonProperty(value = "timestampUtc", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime timestampUtc; - - /* - * The source slot of the last swap operation. - */ - @JsonProperty(value = "sourceSlotName", access = JsonProperty.Access.WRITE_ONLY) - private String sourceSlotName; - - /* - * The destination slot of the last swap operation. - */ - @JsonProperty(value = "destinationSlotName", access = JsonProperty.Access.WRITE_ONLY) - private String destinationSlotName; - - /** - * Get the timestampUtc property: The time the last successful slot swap completed. - * - * @return the timestampUtc value. - */ - public OffsetDateTime timestampUtc() { - return this.timestampUtc; - } - - /** - * Get the sourceSlotName property: The source slot of the last swap operation. - * - * @return the sourceSlotName value. - */ - public String sourceSlotName() { - return this.sourceSlotName; - } - - /** - * Get the destinationSlotName property: The destination slot of the last swap operation. - * - * @return the destinationSlotName value. - */ - public String destinationSlotName() { - return this.destinationSlotName; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SlowRequestsBasedTrigger.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SlowRequestsBasedTrigger.java deleted file mode 100644 index fdf9232841b5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SlowRequestsBasedTrigger.java +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Trigger based on request execution time. */ -@Fluent -public final class SlowRequestsBasedTrigger { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SlowRequestsBasedTrigger.class); - - /* - * Time taken. - */ - @JsonProperty(value = "timeTaken") - private String timeTaken; - - /* - * Request Count. - */ - @JsonProperty(value = "count") - private Integer count; - - /* - * Time interval. - */ - @JsonProperty(value = "timeInterval") - private String timeInterval; - - /** - * Get the timeTaken property: Time taken. - * - * @return the timeTaken value. - */ - public String timeTaken() { - return this.timeTaken; - } - - /** - * Set the timeTaken property: Time taken. - * - * @param timeTaken the timeTaken value to set. - * @return the SlowRequestsBasedTrigger object itself. - */ - public SlowRequestsBasedTrigger withTimeTaken(String timeTaken) { - this.timeTaken = timeTaken; - return this; - } - - /** - * Get the count property: Request Count. - * - * @return the count value. - */ - public Integer count() { - return this.count; - } - - /** - * Set the count property: Request Count. - * - * @param count the count value to set. - * @return the SlowRequestsBasedTrigger object itself. - */ - public SlowRequestsBasedTrigger withCount(Integer count) { - this.count = count; - return this; - } - - /** - * Get the timeInterval property: Time interval. - * - * @return the timeInterval value. - */ - public String timeInterval() { - return this.timeInterval; - } - - /** - * Set the timeInterval property: Time interval. - * - * @param timeInterval the timeInterval value to set. - * @return the SlowRequestsBasedTrigger object itself. - */ - public SlowRequestsBasedTrigger withTimeInterval(String timeInterval) { - this.timeInterval = timeInterval; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SnapshotCollection.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SnapshotCollection.java deleted file mode 100644 index 654e46f931d6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SnapshotCollection.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.models.SnapshotInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Collection of snapshots which can be used to revert an app to a previous time. */ -@Fluent -public final class SnapshotCollection { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SnapshotCollection.class); - - /* - * Collection of resources. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * Link to next page of resources. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: Collection of resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Collection of resources. - * - * @param value the value value to set. - * @return the SnapshotCollection object itself. - */ - public SnapshotCollection withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to next page of resources. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model SnapshotCollection")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SnapshotRecoverySource.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SnapshotRecoverySource.java deleted file mode 100644 index 3136c245a6af..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SnapshotRecoverySource.java +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Specifies the web app that snapshot contents will be retrieved from. */ -@Fluent -public final class SnapshotRecoverySource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SnapshotRecoverySource.class); - - /* - * Geographical location of the source web app, e.g. SouthEastAsia, - * SouthCentralUS - */ - @JsonProperty(value = "location") - private String location; - - /* - * ARM resource ID of the source app. - * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} - * for production slots and - * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} - * for other slots. - */ - @JsonProperty(value = "id") - private String id; - - /** - * Get the location property: Geographical location of the source web app, e.g. SouthEastAsia, SouthCentralUS. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Set the location property: Geographical location of the source web app, e.g. SouthEastAsia, SouthCentralUS. - * - * @param location the location value to set. - * @return the SnapshotRecoverySource object itself. - */ - public SnapshotRecoverySource withLocation(String location) { - this.location = location; - return this; - } - - /** - * Get the id property: ARM resource ID of the source app. - * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} for production - * slots and - * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} - * for other slots. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: ARM resource ID of the source app. - * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} for production - * slots and - * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} - * for other slots. - * - * @param id the id value to set. - * @return the SnapshotRecoverySource object itself. - */ - public SnapshotRecoverySource withId(String id) { - this.id = id; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SnapshotRestoreRequest.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SnapshotRestoreRequest.java deleted file mode 100644 index 2bef39b70baf..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SnapshotRestoreRequest.java +++ /dev/null @@ -1,198 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.models.SnapshotRestoreRequestProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Details about app recovery operation. */ -@Fluent -public final class SnapshotRestoreRequest extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SnapshotRestoreRequest.class); - - /* - * SnapshotRestoreRequest resource specific properties - */ - @JsonProperty(value = "properties") - private SnapshotRestoreRequestProperties innerProperties; - - /** - * Get the innerProperties property: SnapshotRestoreRequest resource specific properties. - * - * @return the innerProperties value. - */ - private SnapshotRestoreRequestProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public SnapshotRestoreRequest withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the snapshotTime property: Point in time in which the app restore should be done, formatted as a DateTime - * string. - * - * @return the snapshotTime value. - */ - public String snapshotTime() { - return this.innerProperties() == null ? null : this.innerProperties().snapshotTime(); - } - - /** - * Set the snapshotTime property: Point in time in which the app restore should be done, formatted as a DateTime - * string. - * - * @param snapshotTime the snapshotTime value to set. - * @return the SnapshotRestoreRequest object itself. - */ - public SnapshotRestoreRequest withSnapshotTime(String snapshotTime) { - if (this.innerProperties() == null) { - this.innerProperties = new SnapshotRestoreRequestProperties(); - } - this.innerProperties().withSnapshotTime(snapshotTime); - return this; - } - - /** - * Get the recoverySource property: Optional. Specifies the web app that snapshot contents will be retrieved from. - * If empty, the targeted web app will be used as the source. - * - * @return the recoverySource value. - */ - public SnapshotRecoverySource recoverySource() { - return this.innerProperties() == null ? null : this.innerProperties().recoverySource(); - } - - /** - * Set the recoverySource property: Optional. Specifies the web app that snapshot contents will be retrieved from. - * If empty, the targeted web app will be used as the source. - * - * @param recoverySource the recoverySource value to set. - * @return the SnapshotRestoreRequest object itself. - */ - public SnapshotRestoreRequest withRecoverySource(SnapshotRecoverySource recoverySource) { - if (this.innerProperties() == null) { - this.innerProperties = new SnapshotRestoreRequestProperties(); - } - this.innerProperties().withRecoverySource(recoverySource); - return this; - } - - /** - * Get the overwrite property: If <code>true</code> the restore operation can overwrite source app; - * otherwise, <code>false</code>. - * - * @return the overwrite value. - */ - public Boolean overwrite() { - return this.innerProperties() == null ? null : this.innerProperties().overwrite(); - } - - /** - * Set the overwrite property: If <code>true</code> the restore operation can overwrite source app; - * otherwise, <code>false</code>. - * - * @param overwrite the overwrite value to set. - * @return the SnapshotRestoreRequest object itself. - */ - public SnapshotRestoreRequest withOverwrite(Boolean overwrite) { - if (this.innerProperties() == null) { - this.innerProperties = new SnapshotRestoreRequestProperties(); - } - this.innerProperties().withOverwrite(overwrite); - return this; - } - - /** - * Get the recoverConfiguration property: If true, site configuration, in addition to content, will be reverted. - * - * @return the recoverConfiguration value. - */ - public Boolean recoverConfiguration() { - return this.innerProperties() == null ? null : this.innerProperties().recoverConfiguration(); - } - - /** - * Set the recoverConfiguration property: If true, site configuration, in addition to content, will be reverted. - * - * @param recoverConfiguration the recoverConfiguration value to set. - * @return the SnapshotRestoreRequest object itself. - */ - public SnapshotRestoreRequest withRecoverConfiguration(Boolean recoverConfiguration) { - if (this.innerProperties() == null) { - this.innerProperties = new SnapshotRestoreRequestProperties(); - } - this.innerProperties().withRecoverConfiguration(recoverConfiguration); - return this; - } - - /** - * Get the ignoreConflictingHostNames property: If true, custom hostname conflicts will be ignored when recovering - * to a target web app. This setting is only necessary when RecoverConfiguration is enabled. - * - * @return the ignoreConflictingHostNames value. - */ - public Boolean ignoreConflictingHostNames() { - return this.innerProperties() == null ? null : this.innerProperties().ignoreConflictingHostNames(); - } - - /** - * Set the ignoreConflictingHostNames property: If true, custom hostname conflicts will be ignored when recovering - * to a target web app. This setting is only necessary when RecoverConfiguration is enabled. - * - * @param ignoreConflictingHostNames the ignoreConflictingHostNames value to set. - * @return the SnapshotRestoreRequest object itself. - */ - public SnapshotRestoreRequest withIgnoreConflictingHostNames(Boolean ignoreConflictingHostNames) { - if (this.innerProperties() == null) { - this.innerProperties = new SnapshotRestoreRequestProperties(); - } - this.innerProperties().withIgnoreConflictingHostNames(ignoreConflictingHostNames); - return this; - } - - /** - * Get the useDRSecondary property: If true, the snapshot is retrieved from DRSecondary endpoint. - * - * @return the useDRSecondary value. - */ - public Boolean useDRSecondary() { - return this.innerProperties() == null ? null : this.innerProperties().useDRSecondary(); - } - - /** - * Set the useDRSecondary property: If true, the snapshot is retrieved from DRSecondary endpoint. - * - * @param useDRSecondary the useDRSecondary value to set. - * @return the SnapshotRestoreRequest object itself. - */ - public SnapshotRestoreRequest withUseDRSecondary(Boolean useDRSecondary) { - if (this.innerProperties() == null) { - this.innerProperties = new SnapshotRestoreRequestProperties(); - } - this.innerProperties().withUseDRSecondary(useDRSecondary); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/Solution.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/Solution.java deleted file mode 100644 index 0629337e7ba1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/Solution.java +++ /dev/null @@ -1,213 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Class Representing Solution for problems detected. */ -@Fluent -public final class Solution { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Solution.class); - - /* - * Solution Id. - */ - @JsonProperty(value = "id") - private Double id; - - /* - * Display Name of the solution - */ - @JsonProperty(value = "displayName") - private String displayName; - - /* - * Order of the solution. - */ - @JsonProperty(value = "order") - private Double order; - - /* - * Description of the solution - */ - @JsonProperty(value = "description") - private String description; - - /* - * Type of Solution - */ - @JsonProperty(value = "type") - private SolutionType type; - - /* - * Solution Data. - */ - @JsonProperty(value = "data") - private List> data; - - /* - * Solution Metadata. - */ - @JsonProperty(value = "metadata") - private List> metadata; - - /** - * Get the id property: Solution Id. - * - * @return the id value. - */ - public Double id() { - return this.id; - } - - /** - * Set the id property: Solution Id. - * - * @param id the id value to set. - * @return the Solution object itself. - */ - public Solution withId(Double id) { - this.id = id; - return this; - } - - /** - * Get the displayName property: Display Name of the solution. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Set the displayName property: Display Name of the solution. - * - * @param displayName the displayName value to set. - * @return the Solution object itself. - */ - public Solution withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - - /** - * Get the order property: Order of the solution. - * - * @return the order value. - */ - public Double order() { - return this.order; - } - - /** - * Set the order property: Order of the solution. - * - * @param order the order value to set. - * @return the Solution object itself. - */ - public Solution withOrder(Double order) { - this.order = order; - return this; - } - - /** - * Get the description property: Description of the solution. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: Description of the solution. - * - * @param description the description value to set. - * @return the Solution object itself. - */ - public Solution withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the type property: Type of Solution. - * - * @return the type value. - */ - public SolutionType type() { - return this.type; - } - - /** - * Set the type property: Type of Solution. - * - * @param type the type value to set. - * @return the Solution object itself. - */ - public Solution withType(SolutionType type) { - this.type = type; - return this; - } - - /** - * Get the data property: Solution Data. - * - * @return the data value. - */ - public List> data() { - return this.data; - } - - /** - * Set the data property: Solution Data. - * - * @param data the data value to set. - * @return the Solution object itself. - */ - public Solution withData(List> data) { - this.data = data; - return this; - } - - /** - * Get the metadata property: Solution Metadata. - * - * @return the metadata value. - */ - public List> metadata() { - return this.metadata; - } - - /** - * Set the metadata property: Solution Metadata. - * - * @param metadata the metadata value to set. - * @return the Solution object itself. - */ - public Solution withMetadata(List> metadata) { - this.metadata = metadata; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (data() != null) { - data().forEach(e -> e.forEach(e1 -> e1.validate())); - } - if (metadata() != null) { - metadata().forEach(e -> e.forEach(e1 -> e1.validate())); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SolutionType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SolutionType.java deleted file mode 100644 index 1e4b9cd1d0ac..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SolutionType.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for SolutionType. */ -public enum SolutionType { - /** Enum value QuickSolution. */ - QUICK_SOLUTION("QuickSolution"), - - /** Enum value DeepInvestigation. */ - DEEP_INVESTIGATION("DeepInvestigation"), - - /** Enum value BestPractices. */ - BEST_PRACTICES("BestPractices"); - - /** The actual serialized value for a SolutionType instance. */ - private final String value; - - SolutionType(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a SolutionType instance. - * - * @param value the serialized value to parse. - * @return the parsed SolutionType object, or null if unable to parse. - */ - @JsonCreator - public static SolutionType fromString(String value) { - SolutionType[] items = SolutionType.values(); - for (SolutionType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SourceControlCollection.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SourceControlCollection.java deleted file mode 100644 index be7553e93d52..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SourceControlCollection.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.models.SourceControlInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Collection of source controls. */ -@Fluent -public final class SourceControlCollection { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SourceControlCollection.class); - - /* - * Collection of resources. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * Link to next page of resources. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: Collection of resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Collection of resources. - * - * @param value the value value to set. - * @return the SourceControlCollection object itself. - */ - public SourceControlCollection withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to next page of resources. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model SourceControlCollection")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SslState.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SslState.java deleted file mode 100644 index 23bde191d21d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SslState.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for SslState. */ -public enum SslState { - /** Enum value Disabled. */ - DISABLED("Disabled"), - - /** Enum value SniEnabled. */ - SNI_ENABLED("SniEnabled"), - - /** Enum value IpBasedEnabled. */ - IP_BASED_ENABLED("IpBasedEnabled"); - - /** The actual serialized value for a SslState instance. */ - private final String value; - - SslState(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a SslState instance. - * - * @param value the serialized value to parse. - * @return the parsed SslState object, or null if unable to parse. - */ - @JsonCreator - public static SslState fromString(String value) { - SslState[] items = SslState.values(); - for (SslState item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/StackMajorVersion.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/StackMajorVersion.java deleted file mode 100644 index be87842ad7d2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/StackMajorVersion.java +++ /dev/null @@ -1,164 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Application stack major version. */ -@Fluent -public final class StackMajorVersion { - @JsonIgnore private final ClientLogger logger = new ClientLogger(StackMajorVersion.class); - - /* - * Application stack major version (display only). - */ - @JsonProperty(value = "displayVersion") - private String displayVersion; - - /* - * Application stack major version (runtime only). - */ - @JsonProperty(value = "runtimeVersion") - private String runtimeVersion; - - /* - * true if this is the default major version; otherwise, - * false. - */ - @JsonProperty(value = "isDefault") - private Boolean isDefault; - - /* - * Minor versions associated with the major version. - */ - @JsonProperty(value = "minorVersions") - private List minorVersions; - - /* - * true if this supports Application Insights; otherwise, - * false. - */ - @JsonProperty(value = "applicationInsights") - private Boolean applicationInsights; - - /** - * Get the displayVersion property: Application stack major version (display only). - * - * @return the displayVersion value. - */ - public String displayVersion() { - return this.displayVersion; - } - - /** - * Set the displayVersion property: Application stack major version (display only). - * - * @param displayVersion the displayVersion value to set. - * @return the StackMajorVersion object itself. - */ - public StackMajorVersion withDisplayVersion(String displayVersion) { - this.displayVersion = displayVersion; - return this; - } - - /** - * Get the runtimeVersion property: Application stack major version (runtime only). - * - * @return the runtimeVersion value. - */ - public String runtimeVersion() { - return this.runtimeVersion; - } - - /** - * Set the runtimeVersion property: Application stack major version (runtime only). - * - * @param runtimeVersion the runtimeVersion value to set. - * @return the StackMajorVersion object itself. - */ - public StackMajorVersion withRuntimeVersion(String runtimeVersion) { - this.runtimeVersion = runtimeVersion; - return this; - } - - /** - * Get the isDefault property: <code>true</code> if this is the default major version; otherwise, - * <code>false</code>. - * - * @return the isDefault value. - */ - public Boolean isDefault() { - return this.isDefault; - } - - /** - * Set the isDefault property: <code>true</code> if this is the default major version; otherwise, - * <code>false</code>. - * - * @param isDefault the isDefault value to set. - * @return the StackMajorVersion object itself. - */ - public StackMajorVersion withIsDefault(Boolean isDefault) { - this.isDefault = isDefault; - return this; - } - - /** - * Get the minorVersions property: Minor versions associated with the major version. - * - * @return the minorVersions value. - */ - public List minorVersions() { - return this.minorVersions; - } - - /** - * Set the minorVersions property: Minor versions associated with the major version. - * - * @param minorVersions the minorVersions value to set. - * @return the StackMajorVersion object itself. - */ - public StackMajorVersion withMinorVersions(List minorVersions) { - this.minorVersions = minorVersions; - return this; - } - - /** - * Get the applicationInsights property: <code>true</code> if this supports Application Insights; - * otherwise, <code>false</code>. - * - * @return the applicationInsights value. - */ - public Boolean applicationInsights() { - return this.applicationInsights; - } - - /** - * Set the applicationInsights property: <code>true</code> if this supports Application Insights; - * otherwise, <code>false</code>. - * - * @param applicationInsights the applicationInsights value to set. - * @return the StackMajorVersion object itself. - */ - public StackMajorVersion withApplicationInsights(Boolean applicationInsights) { - this.applicationInsights = applicationInsights; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (minorVersions() != null) { - minorVersions().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/StackMinorVersion.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/StackMinorVersion.java deleted file mode 100644 index 1d097983175f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/StackMinorVersion.java +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Application stack minor version. */ -@Fluent -public final class StackMinorVersion { - @JsonIgnore private final ClientLogger logger = new ClientLogger(StackMinorVersion.class); - - /* - * Application stack minor version (display only). - */ - @JsonProperty(value = "displayVersion") - private String displayVersion; - - /* - * Application stack minor version (runtime only). - */ - @JsonProperty(value = "runtimeVersion") - private String runtimeVersion; - - /* - * true if this is the default minor version; otherwise, - * false. - */ - @JsonProperty(value = "isDefault") - private Boolean isDefault; - - /* - * true if this supports Remote Debugging, otherwise - * false. - */ - @JsonProperty(value = "isRemoteDebuggingEnabled") - private Boolean isRemoteDebuggingEnabled; - - /** - * Get the displayVersion property: Application stack minor version (display only). - * - * @return the displayVersion value. - */ - public String displayVersion() { - return this.displayVersion; - } - - /** - * Set the displayVersion property: Application stack minor version (display only). - * - * @param displayVersion the displayVersion value to set. - * @return the StackMinorVersion object itself. - */ - public StackMinorVersion withDisplayVersion(String displayVersion) { - this.displayVersion = displayVersion; - return this; - } - - /** - * Get the runtimeVersion property: Application stack minor version (runtime only). - * - * @return the runtimeVersion value. - */ - public String runtimeVersion() { - return this.runtimeVersion; - } - - /** - * Set the runtimeVersion property: Application stack minor version (runtime only). - * - * @param runtimeVersion the runtimeVersion value to set. - * @return the StackMinorVersion object itself. - */ - public StackMinorVersion withRuntimeVersion(String runtimeVersion) { - this.runtimeVersion = runtimeVersion; - return this; - } - - /** - * Get the isDefault property: <code>true</code> if this is the default minor version; otherwise, - * <code>false</code>. - * - * @return the isDefault value. - */ - public Boolean isDefault() { - return this.isDefault; - } - - /** - * Set the isDefault property: <code>true</code> if this is the default minor version; otherwise, - * <code>false</code>. - * - * @param isDefault the isDefault value to set. - * @return the StackMinorVersion object itself. - */ - public StackMinorVersion withIsDefault(Boolean isDefault) { - this.isDefault = isDefault; - return this; - } - - /** - * Get the isRemoteDebuggingEnabled property: <code>true</code> if this supports Remote Debugging, - * otherwise <code>false</code>. - * - * @return the isRemoteDebuggingEnabled value. - */ - public Boolean isRemoteDebuggingEnabled() { - return this.isRemoteDebuggingEnabled; - } - - /** - * Set the isRemoteDebuggingEnabled property: <code>true</code> if this supports Remote Debugging, - * otherwise <code>false</code>. - * - * @param isRemoteDebuggingEnabled the isRemoteDebuggingEnabled value to set. - * @return the StackMinorVersion object itself. - */ - public StackMinorVersion withIsRemoteDebuggingEnabled(Boolean isRemoteDebuggingEnabled) { - this.isRemoteDebuggingEnabled = isRemoteDebuggingEnabled; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/StampCapacityCollection.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/StampCapacityCollection.java deleted file mode 100644 index ef389b29736d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/StampCapacityCollection.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.models.StampCapacityInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Collection of stamp capacities. */ -@Fluent -public final class StampCapacityCollection { - @JsonIgnore private final ClientLogger logger = new ClientLogger(StampCapacityCollection.class); - - /* - * Collection of resources. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * Link to next page of resources. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: Collection of resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Collection of resources. - * - * @param value the value value to set. - * @return the StampCapacityCollection object itself. - */ - public StampCapacityCollection withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to next page of resources. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model StampCapacityCollection")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/StatusCodesBasedTrigger.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/StatusCodesBasedTrigger.java deleted file mode 100644 index e53ff1cb4026..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/StatusCodesBasedTrigger.java +++ /dev/null @@ -1,154 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Trigger based on status code. */ -@Fluent -public final class StatusCodesBasedTrigger { - @JsonIgnore private final ClientLogger logger = new ClientLogger(StatusCodesBasedTrigger.class); - - /* - * HTTP status code. - */ - @JsonProperty(value = "status") - private Integer status; - - /* - * Request Sub Status. - */ - @JsonProperty(value = "subStatus") - private Integer subStatus; - - /* - * Win32 error code. - */ - @JsonProperty(value = "win32Status") - private Integer win32Status; - - /* - * Request Count. - */ - @JsonProperty(value = "count") - private Integer count; - - /* - * Time interval. - */ - @JsonProperty(value = "timeInterval") - private String timeInterval; - - /** - * Get the status property: HTTP status code. - * - * @return the status value. - */ - public Integer status() { - return this.status; - } - - /** - * Set the status property: HTTP status code. - * - * @param status the status value to set. - * @return the StatusCodesBasedTrigger object itself. - */ - public StatusCodesBasedTrigger withStatus(Integer status) { - this.status = status; - return this; - } - - /** - * Get the subStatus property: Request Sub Status. - * - * @return the subStatus value. - */ - public Integer subStatus() { - return this.subStatus; - } - - /** - * Set the subStatus property: Request Sub Status. - * - * @param subStatus the subStatus value to set. - * @return the StatusCodesBasedTrigger object itself. - */ - public StatusCodesBasedTrigger withSubStatus(Integer subStatus) { - this.subStatus = subStatus; - return this; - } - - /** - * Get the win32Status property: Win32 error code. - * - * @return the win32Status value. - */ - public Integer win32Status() { - return this.win32Status; - } - - /** - * Set the win32Status property: Win32 error code. - * - * @param win32Status the win32Status value to set. - * @return the StatusCodesBasedTrigger object itself. - */ - public StatusCodesBasedTrigger withWin32Status(Integer win32Status) { - this.win32Status = win32Status; - return this; - } - - /** - * Get the count property: Request Count. - * - * @return the count value. - */ - public Integer count() { - return this.count; - } - - /** - * Set the count property: Request Count. - * - * @param count the count value to set. - * @return the StatusCodesBasedTrigger object itself. - */ - public StatusCodesBasedTrigger withCount(Integer count) { - this.count = count; - return this; - } - - /** - * Get the timeInterval property: Time interval. - * - * @return the timeInterval value. - */ - public String timeInterval() { - return this.timeInterval; - } - - /** - * Set the timeInterval property: Time interval. - * - * @param timeInterval the timeInterval value to set. - * @return the StatusCodesBasedTrigger object itself. - */ - public StatusCodesBasedTrigger withTimeInterval(String timeInterval) { - this.timeInterval = timeInterval; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/StatusOptions.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/StatusOptions.java deleted file mode 100644 index 03a0cddaa66c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/StatusOptions.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for StatusOptions. */ -public enum StatusOptions { - /** Enum value Ready. */ - READY("Ready"), - - /** Enum value Pending. */ - PENDING("Pending"), - - /** Enum value Creating. */ - CREATING("Creating"); - - /** The actual serialized value for a StatusOptions instance. */ - private final String value; - - StatusOptions(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a StatusOptions instance. - * - * @param value the serialized value to parse. - * @return the parsed StatusOptions object, or null if unable to parse. - */ - @JsonCreator - public static StatusOptions fromString(String value) { - StatusOptions[] items = StatusOptions.values(); - for (StatusOptions item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/StorageMigrationOptions.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/StorageMigrationOptions.java deleted file mode 100644 index 34daa007ee79..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/StorageMigrationOptions.java +++ /dev/null @@ -1,148 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.models.StorageMigrationOptionsProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Options for app content migration. */ -@Fluent -public final class StorageMigrationOptions extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageMigrationOptions.class); - - /* - * StorageMigrationOptions resource specific properties - */ - @JsonProperty(value = "properties") - private StorageMigrationOptionsProperties innerProperties; - - /** - * Get the innerProperties property: StorageMigrationOptions resource specific properties. - * - * @return the innerProperties value. - */ - private StorageMigrationOptionsProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public StorageMigrationOptions withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the azurefilesConnectionString property: AzureFiles connection string. - * - * @return the azurefilesConnectionString value. - */ - public String azurefilesConnectionString() { - return this.innerProperties() == null ? null : this.innerProperties().azurefilesConnectionString(); - } - - /** - * Set the azurefilesConnectionString property: AzureFiles connection string. - * - * @param azurefilesConnectionString the azurefilesConnectionString value to set. - * @return the StorageMigrationOptions object itself. - */ - public StorageMigrationOptions withAzurefilesConnectionString(String azurefilesConnectionString) { - if (this.innerProperties() == null) { - this.innerProperties = new StorageMigrationOptionsProperties(); - } - this.innerProperties().withAzurefilesConnectionString(azurefilesConnectionString); - return this; - } - - /** - * Get the azurefilesShare property: AzureFiles share. - * - * @return the azurefilesShare value. - */ - public String azurefilesShare() { - return this.innerProperties() == null ? null : this.innerProperties().azurefilesShare(); - } - - /** - * Set the azurefilesShare property: AzureFiles share. - * - * @param azurefilesShare the azurefilesShare value to set. - * @return the StorageMigrationOptions object itself. - */ - public StorageMigrationOptions withAzurefilesShare(String azurefilesShare) { - if (this.innerProperties() == null) { - this.innerProperties = new StorageMigrationOptionsProperties(); - } - this.innerProperties().withAzurefilesShare(azurefilesShare); - return this; - } - - /** - * Get the switchSiteAfterMigration property: <code>true</code>if the app should be switched over; - * otherwise, <code>false</code>. - * - * @return the switchSiteAfterMigration value. - */ - public Boolean switchSiteAfterMigration() { - return this.innerProperties() == null ? null : this.innerProperties().switchSiteAfterMigration(); - } - - /** - * Set the switchSiteAfterMigration property: <code>true</code>if the app should be switched over; - * otherwise, <code>false</code>. - * - * @param switchSiteAfterMigration the switchSiteAfterMigration value to set. - * @return the StorageMigrationOptions object itself. - */ - public StorageMigrationOptions withSwitchSiteAfterMigration(Boolean switchSiteAfterMigration) { - if (this.innerProperties() == null) { - this.innerProperties = new StorageMigrationOptionsProperties(); - } - this.innerProperties().withSwitchSiteAfterMigration(switchSiteAfterMigration); - return this; - } - - /** - * Get the blockWriteAccessToSite property: <code>true</code> if the app should be read only during copy - * operation; otherwise, <code>false</code>. - * - * @return the blockWriteAccessToSite value. - */ - public Boolean blockWriteAccessToSite() { - return this.innerProperties() == null ? null : this.innerProperties().blockWriteAccessToSite(); - } - - /** - * Set the blockWriteAccessToSite property: <code>true</code> if the app should be read only during copy - * operation; otherwise, <code>false</code>. - * - * @param blockWriteAccessToSite the blockWriteAccessToSite value to set. - * @return the StorageMigrationOptions object itself. - */ - public StorageMigrationOptions withBlockWriteAccessToSite(Boolean blockWriteAccessToSite) { - if (this.innerProperties() == null) { - this.innerProperties = new StorageMigrationOptionsProperties(); - } - this.innerProperties().withBlockWriteAccessToSite(blockWriteAccessToSite); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SupportedTlsVersions.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SupportedTlsVersions.java deleted file mode 100644 index b0dda7a4c157..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SupportedTlsVersions.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for SupportedTlsVersions. */ -public final class SupportedTlsVersions extends ExpandableStringEnum { - /** Static value 1.0 for SupportedTlsVersions. */ - public static final SupportedTlsVersions ONE_ZERO = fromString("1.0"); - - /** Static value 1.1 for SupportedTlsVersions. */ - public static final SupportedTlsVersions ONE_ONE = fromString("1.1"); - - /** Static value 1.2 for SupportedTlsVersions. */ - public static final SupportedTlsVersions ONE_TWO = fromString("1.2"); - - /** - * Creates or finds a SupportedTlsVersions from its string representation. - * - * @param name a name to look for. - * @return the corresponding SupportedTlsVersions. - */ - @JsonCreator - public static SupportedTlsVersions fromString(String name) { - return fromString(name, SupportedTlsVersions.class); - } - - /** @return known SupportedTlsVersions values. */ - public static Collection values() { - return values(SupportedTlsVersions.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SupportsOneDeploy.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SupportsOneDeploy.java deleted file mode 100644 index 1c00dc7459d6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SupportsOneDeploy.java +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.models; - -import reactor.core.publisher.Mono; - -import java.io.File; -import java.io.InputStream; - -/** - * Provides access to OneDeploy. - */ -public interface SupportsOneDeploy { - - /** - * Deploy a file to Azure site. - * - * @param type the deploy type - * @param file the file to upload - */ - void deploy(DeployType type, File file); - - /** - * Deploy a file to Azure site. - * - * @param type the deploy type - * @param file the file to upload - * @return the completable of the operation - */ - Mono deployAsync(DeployType type, File file); - - /** - * Deploy a file to Azure site. - * - * @param type the deploy type - * @param file the file to upload - * @param deployOptions the deploy options - */ - void deploy(DeployType type, File file, DeployOptions deployOptions); - - /** - * Deploy a file to Azure site. - * - * @param type the deploy type - * @param file the file to upload - * @param deployOptions the deploy options - * @return the completable of the operation - */ - Mono deployAsync(DeployType type, File file, DeployOptions deployOptions); - - /** - * Deploy a file to Azure site. - * - * @param type the deploy type - * @param file the file to upload - * @param length the length of the file - */ - void deploy(DeployType type, InputStream file, long length); - - /** - * Deploy a file to Azure site. - * - * @param type the deploy type - * @param file the file to upload - * @param length the length of the file - * @return the completable of the operation - */ - Mono deployAsync(DeployType type, InputStream file, long length); - - /** - * Deploy a file to Azure site. - * - * @param type the deploy type - * @param file the file to upload - * @param length the length of the file - * @param deployOptions the deploy options - */ - void deploy(DeployType type, InputStream file, long length, DeployOptions deployOptions); - - /** - * Deploy a file to Azure site. - * - * @param type the deploy type - * @param file the file to upload - * @param length the length of the file - * @param deployOptions the deploy options - * @return the completable of the operation - */ - Mono deployAsync(DeployType type, InputStream file, long length, DeployOptions deployOptions); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/TldLegalAgreementCollection.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/TldLegalAgreementCollection.java deleted file mode 100644 index b4c114ff3a60..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/TldLegalAgreementCollection.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.models.TldLegalAgreementInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Collection of top-level domain legal agreements. */ -@Fluent -public final class TldLegalAgreementCollection { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TldLegalAgreementCollection.class); - - /* - * Collection of resources. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * Link to next page of resources. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: Collection of resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Collection of resources. - * - * @param value the value value to set. - * @return the TldLegalAgreementCollection object itself. - */ - public TldLegalAgreementCollection withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to next page of resources. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property value in model TldLegalAgreementCollection")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/TopLevelDomainAgreementOption.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/TopLevelDomainAgreementOption.java deleted file mode 100644 index 9f10bc52a708..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/TopLevelDomainAgreementOption.java +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Options for retrieving the list of top level domain legal agreements. */ -@Fluent -public final class TopLevelDomainAgreementOption { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TopLevelDomainAgreementOption.class); - - /* - * If true, then the list of agreements will include - * agreements for domain privacy as well; otherwise, false. - */ - @JsonProperty(value = "includePrivacy") - private Boolean includePrivacy; - - /* - * If true, then the list of agreements will include - * agreements for domain transfer as well; otherwise, false. - */ - @JsonProperty(value = "forTransfer") - private Boolean forTransfer; - - /** - * Get the includePrivacy property: If <code>true</code>, then the list of agreements will include - * agreements for domain privacy as well; otherwise, <code>false</code>. - * - * @return the includePrivacy value. - */ - public Boolean includePrivacy() { - return this.includePrivacy; - } - - /** - * Set the includePrivacy property: If <code>true</code>, then the list of agreements will include - * agreements for domain privacy as well; otherwise, <code>false</code>. - * - * @param includePrivacy the includePrivacy value to set. - * @return the TopLevelDomainAgreementOption object itself. - */ - public TopLevelDomainAgreementOption withIncludePrivacy(Boolean includePrivacy) { - this.includePrivacy = includePrivacy; - return this; - } - - /** - * Get the forTransfer property: If <code>true</code>, then the list of agreements will include - * agreements for domain transfer as well; otherwise, <code>false</code>. - * - * @return the forTransfer value. - */ - public Boolean forTransfer() { - return this.forTransfer; - } - - /** - * Set the forTransfer property: If <code>true</code>, then the list of agreements will include - * agreements for domain transfer as well; otherwise, <code>false</code>. - * - * @param forTransfer the forTransfer value to set. - * @return the TopLevelDomainAgreementOption object itself. - */ - public TopLevelDomainAgreementOption withForTransfer(Boolean forTransfer) { - this.forTransfer = forTransfer; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/TopLevelDomainCollection.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/TopLevelDomainCollection.java deleted file mode 100644 index 81474c8ea28d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/TopLevelDomainCollection.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.models.TopLevelDomainInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Collection of Top-level domains. */ -@Fluent -public final class TopLevelDomainCollection { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TopLevelDomainCollection.class); - - /* - * Collection of resources. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * Link to next page of resources. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: Collection of resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Collection of resources. - * - * @param value the value value to set. - * @return the TopLevelDomainCollection object itself. - */ - public TopLevelDomainCollection withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to next page of resources. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model TopLevelDomainCollection")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/TriggeredJobHistoryCollection.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/TriggeredJobHistoryCollection.java deleted file mode 100644 index 8bd65083a90f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/TriggeredJobHistoryCollection.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.models.TriggeredJobHistoryInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Collection of Kudu continuous web job information elements. */ -@Fluent -public final class TriggeredJobHistoryCollection { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TriggeredJobHistoryCollection.class); - - /* - * Collection of resources. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * Link to next page of resources. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: Collection of resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Collection of resources. - * - * @param value the value value to set. - * @return the TriggeredJobHistoryCollection object itself. - */ - public TriggeredJobHistoryCollection withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to next page of resources. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property value in model TriggeredJobHistoryCollection")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/TriggeredJobRun.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/TriggeredJobRun.java deleted file mode 100644 index 9708f6605825..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/TriggeredJobRun.java +++ /dev/null @@ -1,306 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.models.TriggeredJobRunProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** Triggered Web Job Run Information. */ -@Fluent -public final class TriggeredJobRun extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TriggeredJobRun.class); - - /* - * TriggeredJobRun resource specific properties - */ - @JsonProperty(value = "properties") - private TriggeredJobRunProperties innerProperties; - - /** - * Get the innerProperties property: TriggeredJobRun resource specific properties. - * - * @return the innerProperties value. - */ - private TriggeredJobRunProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public TriggeredJobRun withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the webJobId property: Job ID. - * - * @return the webJobId value. - */ - public String webJobId() { - return this.innerProperties() == null ? null : this.innerProperties().webJobId(); - } - - /** - * Set the webJobId property: Job ID. - * - * @param webJobId the webJobId value to set. - * @return the TriggeredJobRun object itself. - */ - public TriggeredJobRun withWebJobId(String webJobId) { - if (this.innerProperties() == null) { - this.innerProperties = new TriggeredJobRunProperties(); - } - this.innerProperties().withWebJobId(webJobId); - return this; - } - - /** - * Get the webJobName property: Job name. - * - * @return the webJobName value. - */ - public String webJobName() { - return this.innerProperties() == null ? null : this.innerProperties().webJobName(); - } - - /** - * Set the webJobName property: Job name. - * - * @param webJobName the webJobName value to set. - * @return the TriggeredJobRun object itself. - */ - public TriggeredJobRun withWebJobName(String webJobName) { - if (this.innerProperties() == null) { - this.innerProperties = new TriggeredJobRunProperties(); - } - this.innerProperties().withWebJobName(webJobName); - return this; - } - - /** - * Get the status property: Job status. - * - * @return the status value. - */ - public TriggeredWebJobStatus status() { - return this.innerProperties() == null ? null : this.innerProperties().status(); - } - - /** - * Set the status property: Job status. - * - * @param status the status value to set. - * @return the TriggeredJobRun object itself. - */ - public TriggeredJobRun withStatus(TriggeredWebJobStatus status) { - if (this.innerProperties() == null) { - this.innerProperties = new TriggeredJobRunProperties(); - } - this.innerProperties().withStatus(status); - return this; - } - - /** - * Get the startTime property: Start time. - * - * @return the startTime value. - */ - public OffsetDateTime startTime() { - return this.innerProperties() == null ? null : this.innerProperties().startTime(); - } - - /** - * Set the startTime property: Start time. - * - * @param startTime the startTime value to set. - * @return the TriggeredJobRun object itself. - */ - public TriggeredJobRun withStartTime(OffsetDateTime startTime) { - if (this.innerProperties() == null) { - this.innerProperties = new TriggeredJobRunProperties(); - } - this.innerProperties().withStartTime(startTime); - return this; - } - - /** - * Get the endTime property: End time. - * - * @return the endTime value. - */ - public OffsetDateTime endTime() { - return this.innerProperties() == null ? null : this.innerProperties().endTime(); - } - - /** - * Set the endTime property: End time. - * - * @param endTime the endTime value to set. - * @return the TriggeredJobRun object itself. - */ - public TriggeredJobRun withEndTime(OffsetDateTime endTime) { - if (this.innerProperties() == null) { - this.innerProperties = new TriggeredJobRunProperties(); - } - this.innerProperties().withEndTime(endTime); - return this; - } - - /** - * Get the duration property: Job duration. - * - * @return the duration value. - */ - public String duration() { - return this.innerProperties() == null ? null : this.innerProperties().duration(); - } - - /** - * Set the duration property: Job duration. - * - * @param duration the duration value to set. - * @return the TriggeredJobRun object itself. - */ - public TriggeredJobRun withDuration(String duration) { - if (this.innerProperties() == null) { - this.innerProperties = new TriggeredJobRunProperties(); - } - this.innerProperties().withDuration(duration); - return this; - } - - /** - * Get the outputUrl property: Output URL. - * - * @return the outputUrl value. - */ - public String outputUrl() { - return this.innerProperties() == null ? null : this.innerProperties().outputUrl(); - } - - /** - * Set the outputUrl property: Output URL. - * - * @param outputUrl the outputUrl value to set. - * @return the TriggeredJobRun object itself. - */ - public TriggeredJobRun withOutputUrl(String outputUrl) { - if (this.innerProperties() == null) { - this.innerProperties = new TriggeredJobRunProperties(); - } - this.innerProperties().withOutputUrl(outputUrl); - return this; - } - - /** - * Get the errorUrl property: Error URL. - * - * @return the errorUrl value. - */ - public String errorUrl() { - return this.innerProperties() == null ? null : this.innerProperties().errorUrl(); - } - - /** - * Set the errorUrl property: Error URL. - * - * @param errorUrl the errorUrl value to set. - * @return the TriggeredJobRun object itself. - */ - public TriggeredJobRun withErrorUrl(String errorUrl) { - if (this.innerProperties() == null) { - this.innerProperties = new TriggeredJobRunProperties(); - } - this.innerProperties().withErrorUrl(errorUrl); - return this; - } - - /** - * Get the url property: Job URL. - * - * @return the url value. - */ - public String url() { - return this.innerProperties() == null ? null : this.innerProperties().url(); - } - - /** - * Set the url property: Job URL. - * - * @param url the url value to set. - * @return the TriggeredJobRun object itself. - */ - public TriggeredJobRun withUrl(String url) { - if (this.innerProperties() == null) { - this.innerProperties = new TriggeredJobRunProperties(); - } - this.innerProperties().withUrl(url); - return this; - } - - /** - * Get the jobName property: Job name. - * - * @return the jobName value. - */ - public String jobName() { - return this.innerProperties() == null ? null : this.innerProperties().jobName(); - } - - /** - * Set the jobName property: Job name. - * - * @param jobName the jobName value to set. - * @return the TriggeredJobRun object itself. - */ - public TriggeredJobRun withJobName(String jobName) { - if (this.innerProperties() == null) { - this.innerProperties = new TriggeredJobRunProperties(); - } - this.innerProperties().withJobName(jobName); - return this; - } - - /** - * Get the trigger property: Job trigger. - * - * @return the trigger value. - */ - public String trigger() { - return this.innerProperties() == null ? null : this.innerProperties().trigger(); - } - - /** - * Set the trigger property: Job trigger. - * - * @param trigger the trigger value to set. - * @return the TriggeredJobRun object itself. - */ - public TriggeredJobRun withTrigger(String trigger) { - if (this.innerProperties() == null) { - this.innerProperties = new TriggeredJobRunProperties(); - } - this.innerProperties().withTrigger(trigger); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/TriggeredWebJobCollection.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/TriggeredWebJobCollection.java deleted file mode 100644 index d83d289c7942..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/TriggeredWebJobCollection.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.models.TriggeredWebJobInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Collection of Kudu continuous web job information elements. */ -@Fluent -public final class TriggeredWebJobCollection { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TriggeredWebJobCollection.class); - - /* - * Collection of resources. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * Link to next page of resources. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: Collection of resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Collection of resources. - * - * @param value the value value to set. - * @return the TriggeredWebJobCollection object itself. - */ - public TriggeredWebJobCollection withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to next page of resources. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model TriggeredWebJobCollection")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/TriggeredWebJobStatus.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/TriggeredWebJobStatus.java deleted file mode 100644 index 30aef991d9fb..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/TriggeredWebJobStatus.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for TriggeredWebJobStatus. */ -public enum TriggeredWebJobStatus { - /** Enum value Success. */ - SUCCESS("Success"), - - /** Enum value Failed. */ - FAILED("Failed"), - - /** Enum value Error. */ - ERROR("Error"); - - /** The actual serialized value for a TriggeredWebJobStatus instance. */ - private final String value; - - TriggeredWebJobStatus(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a TriggeredWebJobStatus instance. - * - * @param value the serialized value to parse. - * @return the parsed TriggeredWebJobStatus object, or null if unable to parse. - */ - @JsonCreator - public static TriggeredWebJobStatus fromString(String value) { - TriggeredWebJobStatus[] items = TriggeredWebJobStatus.values(); - for (TriggeredWebJobStatus item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/UnauthenticatedClientAction.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/UnauthenticatedClientAction.java deleted file mode 100644 index 308c2fd9a118..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/UnauthenticatedClientAction.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for UnauthenticatedClientAction. */ -public enum UnauthenticatedClientAction { - /** Enum value RedirectToLoginPage. */ - REDIRECT_TO_LOGIN_PAGE("RedirectToLoginPage"), - - /** Enum value AllowAnonymous. */ - ALLOW_ANONYMOUS("AllowAnonymous"); - - /** The actual serialized value for a UnauthenticatedClientAction instance. */ - private final String value; - - UnauthenticatedClientAction(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a UnauthenticatedClientAction instance. - * - * @param value the serialized value to parse. - * @return the parsed UnauthenticatedClientAction object, or null if unable to parse. - */ - @JsonCreator - public static UnauthenticatedClientAction fromString(String value) { - UnauthenticatedClientAction[] items = UnauthenticatedClientAction.values(); - for (UnauthenticatedClientAction item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/UsageCollection.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/UsageCollection.java deleted file mode 100644 index 79a9c1ebbfdb..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/UsageCollection.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.models.UsageInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Collection of usages. */ -@Fluent -public final class UsageCollection { - @JsonIgnore private final ClientLogger logger = new ClientLogger(UsageCollection.class); - - /* - * Collection of resources. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * Link to next page of resources. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: Collection of resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Collection of resources. - * - * @param value the value value to set. - * @return the UsageCollection object itself. - */ - public UsageCollection withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to next page of resources. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model UsageCollection")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/UsageState.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/UsageState.java deleted file mode 100644 index f2c45404e8dc..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/UsageState.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for UsageState. */ -public enum UsageState { - /** Enum value Normal. */ - NORMAL("Normal"), - - /** Enum value Exceeded. */ - EXCEEDED("Exceeded"); - - /** The actual serialized value for a UsageState instance. */ - private final String value; - - UsageState(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a UsageState instance. - * - * @param value the serialized value to parse. - * @return the parsed UsageState object, or null if unable to parse. - */ - @JsonCreator - public static UsageState fromString(String value) { - UsageState[] items = UsageState.values(); - for (UsageState item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ValidateContainerSettingsRequest.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ValidateContainerSettingsRequest.java deleted file mode 100644 index 9d88a213456e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ValidateContainerSettingsRequest.java +++ /dev/null @@ -1,180 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Container settings validation request context. */ -@Fluent -public final class ValidateContainerSettingsRequest { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ValidateContainerSettingsRequest.class); - - /* - * Base URL of the container registry - */ - @JsonProperty(value = "baseUrl") - private String baseUrl; - - /* - * Username for to access the container registry - */ - @JsonProperty(value = "username") - private String username; - - /* - * Password for to access the container registry - */ - @JsonProperty(value = "password") - private String password; - - /* - * Repository name (image name) - */ - @JsonProperty(value = "repository") - private String repository; - - /* - * Image tag - */ - @JsonProperty(value = "tag") - private String tag; - - /* - * Platform (windows or linux) - */ - @JsonProperty(value = "platform") - private String platform; - - /** - * Get the baseUrl property: Base URL of the container registry. - * - * @return the baseUrl value. - */ - public String baseUrl() { - return this.baseUrl; - } - - /** - * Set the baseUrl property: Base URL of the container registry. - * - * @param baseUrl the baseUrl value to set. - * @return the ValidateContainerSettingsRequest object itself. - */ - public ValidateContainerSettingsRequest withBaseUrl(String baseUrl) { - this.baseUrl = baseUrl; - return this; - } - - /** - * Get the username property: Username for to access the container registry. - * - * @return the username value. - */ - public String username() { - return this.username; - } - - /** - * Set the username property: Username for to access the container registry. - * - * @param username the username value to set. - * @return the ValidateContainerSettingsRequest object itself. - */ - public ValidateContainerSettingsRequest withUsername(String username) { - this.username = username; - return this; - } - - /** - * Get the password property: Password for to access the container registry. - * - * @return the password value. - */ - public String password() { - return this.password; - } - - /** - * Set the password property: Password for to access the container registry. - * - * @param password the password value to set. - * @return the ValidateContainerSettingsRequest object itself. - */ - public ValidateContainerSettingsRequest withPassword(String password) { - this.password = password; - return this; - } - - /** - * Get the repository property: Repository name (image name). - * - * @return the repository value. - */ - public String repository() { - return this.repository; - } - - /** - * Set the repository property: Repository name (image name). - * - * @param repository the repository value to set. - * @return the ValidateContainerSettingsRequest object itself. - */ - public ValidateContainerSettingsRequest withRepository(String repository) { - this.repository = repository; - return this; - } - - /** - * Get the tag property: Image tag. - * - * @return the tag value. - */ - public String tag() { - return this.tag; - } - - /** - * Set the tag property: Image tag. - * - * @param tag the tag value to set. - * @return the ValidateContainerSettingsRequest object itself. - */ - public ValidateContainerSettingsRequest withTag(String tag) { - this.tag = tag; - return this; - } - - /** - * Get the platform property: Platform (windows or linux). - * - * @return the platform value. - */ - public String platform() { - return this.platform; - } - - /** - * Set the platform property: Platform (windows or linux). - * - * @param platform the platform value to set. - * @return the ValidateContainerSettingsRequest object itself. - */ - public ValidateContainerSettingsRequest withPlatform(String platform) { - this.platform = platform; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ValidateRequest.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ValidateRequest.java deleted file mode 100644 index 6f60a1b12cbb..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ValidateRequest.java +++ /dev/null @@ -1,307 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.models.ValidateProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Resource validation request content. */ -@Fluent -public final class ValidateRequest { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ValidateRequest.class); - - /* - * Resource name to verify. - */ - @JsonProperty(value = "name", required = true) - private String name; - - /* - * Resource type used for verification. - */ - @JsonProperty(value = "type", required = true) - private ValidateResourceTypes type; - - /* - * Expected location of the resource. - */ - @JsonProperty(value = "location", required = true) - private String location; - - /* - * Properties of the resource to validate. - */ - @JsonProperty(value = "properties", required = true) - private ValidateProperties innerProperties = new ValidateProperties(); - - /** - * Get the name property: Resource name to verify. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Resource name to verify. - * - * @param name the name value to set. - * @return the ValidateRequest object itself. - */ - public ValidateRequest withName(String name) { - this.name = name; - return this; - } - - /** - * Get the type property: Resource type used for verification. - * - * @return the type value. - */ - public ValidateResourceTypes type() { - return this.type; - } - - /** - * Set the type property: Resource type used for verification. - * - * @param type the type value to set. - * @return the ValidateRequest object itself. - */ - public ValidateRequest withType(ValidateResourceTypes type) { - this.type = type; - return this; - } - - /** - * Get the location property: Expected location of the resource. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Set the location property: Expected location of the resource. - * - * @param location the location value to set. - * @return the ValidateRequest object itself. - */ - public ValidateRequest withLocation(String location) { - this.location = location; - return this; - } - - /** - * Get the innerProperties property: Properties of the resource to validate. - * - * @return the innerProperties value. - */ - private ValidateProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the serverFarmId property: ARM resource ID of an App Service plan that would host the app. - * - * @return the serverFarmId value. - */ - public String serverFarmId() { - return this.innerProperties() == null ? null : this.innerProperties().serverFarmId(); - } - - /** - * Set the serverFarmId property: ARM resource ID of an App Service plan that would host the app. - * - * @param serverFarmId the serverFarmId value to set. - * @return the ValidateRequest object itself. - */ - public ValidateRequest withServerFarmId(String serverFarmId) { - if (this.innerProperties() == null) { - this.innerProperties = new ValidateProperties(); - } - this.innerProperties().withServerFarmId(serverFarmId); - return this; - } - - /** - * Get the skuName property: Name of the target SKU for the App Service plan. - * - * @return the skuName value. - */ - public String skuName() { - return this.innerProperties() == null ? null : this.innerProperties().skuName(); - } - - /** - * Set the skuName property: Name of the target SKU for the App Service plan. - * - * @param skuName the skuName value to set. - * @return the ValidateRequest object itself. - */ - public ValidateRequest withSkuName(String skuName) { - if (this.innerProperties() == null) { - this.innerProperties = new ValidateProperties(); - } - this.innerProperties().withSkuName(skuName); - return this; - } - - /** - * Get the needLinuxWorkers property: <code>true</code> if App Service plan is for Linux workers; - * otherwise, <code>false</code>. - * - * @return the needLinuxWorkers value. - */ - public Boolean needLinuxWorkers() { - return this.innerProperties() == null ? null : this.innerProperties().needLinuxWorkers(); - } - - /** - * Set the needLinuxWorkers property: <code>true</code> if App Service plan is for Linux workers; - * otherwise, <code>false</code>. - * - * @param needLinuxWorkers the needLinuxWorkers value to set. - * @return the ValidateRequest object itself. - */ - public ValidateRequest withNeedLinuxWorkers(Boolean needLinuxWorkers) { - if (this.innerProperties() == null) { - this.innerProperties = new ValidateProperties(); - } - this.innerProperties().withNeedLinuxWorkers(needLinuxWorkers); - return this; - } - - /** - * Get the isSpot property: <code>true</code> if App Service plan is for Spot instances; otherwise, - * <code>false</code>. - * - * @return the isSpot value. - */ - public Boolean isSpot() { - return this.innerProperties() == null ? null : this.innerProperties().isSpot(); - } - - /** - * Set the isSpot property: <code>true</code> if App Service plan is for Spot instances; otherwise, - * <code>false</code>. - * - * @param isSpot the isSpot value to set. - * @return the ValidateRequest object itself. - */ - public ValidateRequest withIsSpot(Boolean isSpot) { - if (this.innerProperties() == null) { - this.innerProperties = new ValidateProperties(); - } - this.innerProperties().withIsSpot(isSpot); - return this; - } - - /** - * Get the capacity property: Target capacity of the App Service plan (number of VMs). - * - * @return the capacity value. - */ - public Integer capacity() { - return this.innerProperties() == null ? null : this.innerProperties().capacity(); - } - - /** - * Set the capacity property: Target capacity of the App Service plan (number of VMs). - * - * @param capacity the capacity value to set. - * @return the ValidateRequest object itself. - */ - public ValidateRequest withCapacity(Integer capacity) { - if (this.innerProperties() == null) { - this.innerProperties = new ValidateProperties(); - } - this.innerProperties().withCapacity(capacity); - return this; - } - - /** - * Get the hostingEnvironment property: Name of App Service Environment where app or App Service plan should be - * created. - * - * @return the hostingEnvironment value. - */ - public String hostingEnvironment() { - return this.innerProperties() == null ? null : this.innerProperties().hostingEnvironment(); - } - - /** - * Set the hostingEnvironment property: Name of App Service Environment where app or App Service plan should be - * created. - * - * @param hostingEnvironment the hostingEnvironment value to set. - * @return the ValidateRequest object itself. - */ - public ValidateRequest withHostingEnvironment(String hostingEnvironment) { - if (this.innerProperties() == null) { - this.innerProperties = new ValidateProperties(); - } - this.innerProperties().withHostingEnvironment(hostingEnvironment); - return this; - } - - /** - * Get the isXenon property: <code>true</code> if App Service plan is running as a windows container. - * - * @return the isXenon value. - */ - public Boolean isXenon() { - return this.innerProperties() == null ? null : this.innerProperties().isXenon(); - } - - /** - * Set the isXenon property: <code>true</code> if App Service plan is running as a windows container. - * - * @param isXenon the isXenon value to set. - * @return the ValidateRequest object itself. - */ - public ValidateRequest withIsXenon(Boolean isXenon) { - if (this.innerProperties() == null) { - this.innerProperties = new ValidateProperties(); - } - this.innerProperties().withIsXenon(isXenon); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property name in model ValidateRequest")); - } - if (type() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property type in model ValidateRequest")); - } - if (location() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property location in model ValidateRequest")); - } - if (innerProperties() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property innerProperties in model ValidateRequest")); - } else { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ValidateResourceTypes.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ValidateResourceTypes.java deleted file mode 100644 index a4e08daf301f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ValidateResourceTypes.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ValidateResourceTypes. */ -public final class ValidateResourceTypes extends ExpandableStringEnum { - /** Static value ServerFarm for ValidateResourceTypes. */ - public static final ValidateResourceTypes SERVER_FARM = fromString("ServerFarm"); - - /** Static value Site for ValidateResourceTypes. */ - public static final ValidateResourceTypes SITE = fromString("Site"); - - /** - * Creates or finds a ValidateResourceTypes from its string representation. - * - * @param name a name to look for. - * @return the corresponding ValidateResourceTypes. - */ - @JsonCreator - public static ValidateResourceTypes fromString(String name) { - return fromString(name, ValidateResourceTypes.class); - } - - /** @return known ValidateResourceTypes values. */ - public static Collection values() { - return values(ValidateResourceTypes.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ValidateResponseError.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ValidateResponseError.java deleted file mode 100644 index 1e497b513fde..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ValidateResponseError.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Error details for when validation fails. */ -@Fluent -public final class ValidateResponseError { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ValidateResponseError.class); - - /* - * Validation error code. - */ - @JsonProperty(value = "code") - private String code; - - /* - * Validation error message. - */ - @JsonProperty(value = "message") - private String message; - - /** - * Get the code property: Validation error code. - * - * @return the code value. - */ - public String code() { - return this.code; - } - - /** - * Set the code property: Validation error code. - * - * @param code the code value to set. - * @return the ValidateResponseError object itself. - */ - public ValidateResponseError withCode(String code) { - this.code = code; - return this; - } - - /** - * Get the message property: Validation error message. - * - * @return the message value. - */ - public String message() { - return this.message; - } - - /** - * Set the message property: Validation error message. - * - * @param message the message value to set. - * @return the ValidateResponseError object itself. - */ - public ValidateResponseError withMessage(String message) { - this.message = message; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/VirtualApplication.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/VirtualApplication.java deleted file mode 100644 index 796bb3e0a793..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/VirtualApplication.java +++ /dev/null @@ -1,135 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Virtual application in an app. */ -@Fluent -public final class VirtualApplication { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualApplication.class); - - /* - * Virtual path. - */ - @JsonProperty(value = "virtualPath") - private String virtualPath; - - /* - * Physical path. - */ - @JsonProperty(value = "physicalPath") - private String physicalPath; - - /* - * true if preloading is enabled; otherwise, - * false. - */ - @JsonProperty(value = "preloadEnabled") - private Boolean preloadEnabled; - - /* - * Virtual directories for virtual application. - */ - @JsonProperty(value = "virtualDirectories") - private List virtualDirectories; - - /** - * Get the virtualPath property: Virtual path. - * - * @return the virtualPath value. - */ - public String virtualPath() { - return this.virtualPath; - } - - /** - * Set the virtualPath property: Virtual path. - * - * @param virtualPath the virtualPath value to set. - * @return the VirtualApplication object itself. - */ - public VirtualApplication withVirtualPath(String virtualPath) { - this.virtualPath = virtualPath; - return this; - } - - /** - * Get the physicalPath property: Physical path. - * - * @return the physicalPath value. - */ - public String physicalPath() { - return this.physicalPath; - } - - /** - * Set the physicalPath property: Physical path. - * - * @param physicalPath the physicalPath value to set. - * @return the VirtualApplication object itself. - */ - public VirtualApplication withPhysicalPath(String physicalPath) { - this.physicalPath = physicalPath; - return this; - } - - /** - * Get the preloadEnabled property: <code>true</code> if preloading is enabled; otherwise, - * <code>false</code>. - * - * @return the preloadEnabled value. - */ - public Boolean preloadEnabled() { - return this.preloadEnabled; - } - - /** - * Set the preloadEnabled property: <code>true</code> if preloading is enabled; otherwise, - * <code>false</code>. - * - * @param preloadEnabled the preloadEnabled value to set. - * @return the VirtualApplication object itself. - */ - public VirtualApplication withPreloadEnabled(Boolean preloadEnabled) { - this.preloadEnabled = preloadEnabled; - return this; - } - - /** - * Get the virtualDirectories property: Virtual directories for virtual application. - * - * @return the virtualDirectories value. - */ - public List virtualDirectories() { - return this.virtualDirectories; - } - - /** - * Set the virtualDirectories property: Virtual directories for virtual application. - * - * @param virtualDirectories the virtualDirectories value to set. - * @return the VirtualApplication object itself. - */ - public VirtualApplication withVirtualDirectories(List virtualDirectories) { - this.virtualDirectories = virtualDirectories; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (virtualDirectories() != null) { - virtualDirectories().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/VirtualDirectory.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/VirtualDirectory.java deleted file mode 100644 index 6113af0bd74b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/VirtualDirectory.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Directory for virtual application. */ -@Fluent -public final class VirtualDirectory { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualDirectory.class); - - /* - * Path to virtual application. - */ - @JsonProperty(value = "virtualPath") - private String virtualPath; - - /* - * Physical path. - */ - @JsonProperty(value = "physicalPath") - private String physicalPath; - - /** - * Get the virtualPath property: Path to virtual application. - * - * @return the virtualPath value. - */ - public String virtualPath() { - return this.virtualPath; - } - - /** - * Set the virtualPath property: Path to virtual application. - * - * @param virtualPath the virtualPath value to set. - * @return the VirtualDirectory object itself. - */ - public VirtualDirectory withVirtualPath(String virtualPath) { - this.virtualPath = virtualPath; - return this; - } - - /** - * Get the physicalPath property: Physical path. - * - * @return the physicalPath value. - */ - public String physicalPath() { - return this.physicalPath; - } - - /** - * Set the physicalPath property: Physical path. - * - * @param physicalPath the physicalPath value to set. - * @return the VirtualDirectory object itself. - */ - public VirtualDirectory withPhysicalPath(String physicalPath) { - this.physicalPath = physicalPath; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/VirtualIpMapping.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/VirtualIpMapping.java deleted file mode 100644 index 982e3426ab1e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/VirtualIpMapping.java +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Virtual IP mapping. */ -@Fluent -public final class VirtualIpMapping { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualIpMapping.class); - - /* - * Virtual IP address. - */ - @JsonProperty(value = "virtualIP") - private String virtualIp; - - /* - * Internal HTTP port. - */ - @JsonProperty(value = "internalHttpPort") - private Integer internalHttpPort; - - /* - * Internal HTTPS port. - */ - @JsonProperty(value = "internalHttpsPort") - private Integer internalHttpsPort; - - /* - * Is virtual IP mapping in use. - */ - @JsonProperty(value = "inUse") - private Boolean inUse; - - /** - * Get the virtualIp property: Virtual IP address. - * - * @return the virtualIp value. - */ - public String virtualIp() { - return this.virtualIp; - } - - /** - * Set the virtualIp property: Virtual IP address. - * - * @param virtualIp the virtualIp value to set. - * @return the VirtualIpMapping object itself. - */ - public VirtualIpMapping withVirtualIp(String virtualIp) { - this.virtualIp = virtualIp; - return this; - } - - /** - * Get the internalHttpPort property: Internal HTTP port. - * - * @return the internalHttpPort value. - */ - public Integer internalHttpPort() { - return this.internalHttpPort; - } - - /** - * Set the internalHttpPort property: Internal HTTP port. - * - * @param internalHttpPort the internalHttpPort value to set. - * @return the VirtualIpMapping object itself. - */ - public VirtualIpMapping withInternalHttpPort(Integer internalHttpPort) { - this.internalHttpPort = internalHttpPort; - return this; - } - - /** - * Get the internalHttpsPort property: Internal HTTPS port. - * - * @return the internalHttpsPort value. - */ - public Integer internalHttpsPort() { - return this.internalHttpsPort; - } - - /** - * Set the internalHttpsPort property: Internal HTTPS port. - * - * @param internalHttpsPort the internalHttpsPort value to set. - * @return the VirtualIpMapping object itself. - */ - public VirtualIpMapping withInternalHttpsPort(Integer internalHttpsPort) { - this.internalHttpsPort = internalHttpsPort; - return this; - } - - /** - * Get the inUse property: Is virtual IP mapping in use. - * - * @return the inUse value. - */ - public Boolean inUse() { - return this.inUse; - } - - /** - * Set the inUse property: Is virtual IP mapping in use. - * - * @param inUse the inUse value to set. - * @return the VirtualIpMapping object itself. - */ - public VirtualIpMapping withInUse(Boolean inUse) { - this.inUse = inUse; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/VirtualNetworkProfile.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/VirtualNetworkProfile.java deleted file mode 100644 index a14ee5a8ed76..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/VirtualNetworkProfile.java +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Specification for using a Virtual Network. */ -@Fluent -public final class VirtualNetworkProfile { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkProfile.class); - - /* - * Resource id of the Virtual Network. - */ - @JsonProperty(value = "id") - private String id; - - /* - * Name of the Virtual Network (read-only). - */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) - private String name; - - /* - * Resource type of the Virtual Network (read-only). - */ - @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) - private String type; - - /* - * Subnet within the Virtual Network. - */ - @JsonProperty(value = "subnet") - private String subnet; - - /** - * Get the id property: Resource id of the Virtual Network. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: Resource id of the Virtual Network. - * - * @param id the id value to set. - * @return the VirtualNetworkProfile object itself. - */ - public VirtualNetworkProfile withId(String id) { - this.id = id; - return this; - } - - /** - * Get the name property: Name of the Virtual Network (read-only). - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the type property: Resource type of the Virtual Network (read-only). - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Get the subnet property: Subnet within the Virtual Network. - * - * @return the subnet value. - */ - public String subnet() { - return this.subnet; - } - - /** - * Set the subnet property: Subnet within the Virtual Network. - * - * @param subnet the subnet value to set. - * @return the VirtualNetworkProfile object itself. - */ - public VirtualNetworkProfile withSubnet(String subnet) { - this.subnet = subnet; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/VnetParameters.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/VnetParameters.java deleted file mode 100644 index b37dd9f778e0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/VnetParameters.java +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.models.VnetParametersProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The required set of inputs to validate a VNET. */ -@Fluent -public final class VnetParameters extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VnetParameters.class); - - /* - * VnetParameters resource specific properties - */ - @JsonProperty(value = "properties") - private VnetParametersProperties innerProperties; - - /** - * Get the innerProperties property: VnetParameters resource specific properties. - * - * @return the innerProperties value. - */ - private VnetParametersProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public VnetParameters withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the vnetResourceGroup property: The Resource Group of the VNET to be validated. - * - * @return the vnetResourceGroup value. - */ - public String vnetResourceGroup() { - return this.innerProperties() == null ? null : this.innerProperties().vnetResourceGroup(); - } - - /** - * Set the vnetResourceGroup property: The Resource Group of the VNET to be validated. - * - * @param vnetResourceGroup the vnetResourceGroup value to set. - * @return the VnetParameters object itself. - */ - public VnetParameters withVnetResourceGroup(String vnetResourceGroup) { - if (this.innerProperties() == null) { - this.innerProperties = new VnetParametersProperties(); - } - this.innerProperties().withVnetResourceGroup(vnetResourceGroup); - return this; - } - - /** - * Get the vnetName property: The name of the VNET to be validated. - * - * @return the vnetName value. - */ - public String vnetName() { - return this.innerProperties() == null ? null : this.innerProperties().vnetName(); - } - - /** - * Set the vnetName property: The name of the VNET to be validated. - * - * @param vnetName the vnetName value to set. - * @return the VnetParameters object itself. - */ - public VnetParameters withVnetName(String vnetName) { - if (this.innerProperties() == null) { - this.innerProperties = new VnetParametersProperties(); - } - this.innerProperties().withVnetName(vnetName); - return this; - } - - /** - * Get the vnetSubnetName property: The subnet name to be validated. - * - * @return the vnetSubnetName value. - */ - public String vnetSubnetName() { - return this.innerProperties() == null ? null : this.innerProperties().vnetSubnetName(); - } - - /** - * Set the vnetSubnetName property: The subnet name to be validated. - * - * @param vnetSubnetName the vnetSubnetName value to set. - * @return the VnetParameters object itself. - */ - public VnetParameters withVnetSubnetName(String vnetSubnetName) { - if (this.innerProperties() == null) { - this.innerProperties = new VnetParametersProperties(); - } - this.innerProperties().withVnetSubnetName(vnetSubnetName); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/VnetValidationTestFailure.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/VnetValidationTestFailure.java deleted file mode 100644 index 4be52e189077..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/VnetValidationTestFailure.java +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.models.VnetValidationTestFailureProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** A class that describes a test that failed during NSG and UDR validation. */ -@Fluent -public final class VnetValidationTestFailure extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VnetValidationTestFailure.class); - - /* - * VnetValidationTestFailure resource specific properties - */ - @JsonProperty(value = "properties") - private VnetValidationTestFailureProperties innerProperties; - - /** - * Get the innerProperties property: VnetValidationTestFailure resource specific properties. - * - * @return the innerProperties value. - */ - private VnetValidationTestFailureProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public VnetValidationTestFailure withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * Get the testName property: The name of the test that failed. - * - * @return the testName value. - */ - public String testName() { - return this.innerProperties() == null ? null : this.innerProperties().testName(); - } - - /** - * Set the testName property: The name of the test that failed. - * - * @param testName the testName value to set. - * @return the VnetValidationTestFailure object itself. - */ - public VnetValidationTestFailure withTestName(String testName) { - if (this.innerProperties() == null) { - this.innerProperties = new VnetValidationTestFailureProperties(); - } - this.innerProperties().withTestName(testName); - return this; - } - - /** - * Get the details property: The details of what caused the failure, e.g. the blocking rule name, etc. - * - * @return the details value. - */ - public String details() { - return this.innerProperties() == null ? null : this.innerProperties().details(); - } - - /** - * Set the details property: The details of what caused the failure, e.g. the blocking rule name, etc. - * - * @param details the details value to set. - * @return the VnetValidationTestFailure object itself. - */ - public VnetValidationTestFailure withDetails(String details) { - if (this.innerProperties() == null) { - this.innerProperties = new VnetValidationTestFailureProperties(); - } - this.innerProperties().withDetails(details); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebApp.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebApp.java deleted file mode 100644 index ca2370245435..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebApp.java +++ /dev/null @@ -1,531 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.models.ResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.models.GroupableResource; -import com.azure.resourcemanager.resources.fluentcore.model.Appliable; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.Updatable; -import java.io.File; -import java.io.InputStream; -import reactor.core.publisher.Mono; - -/** An immutable client-side representation of an Azure Web App. */ -@Fluent -public interface WebApp extends WebAppBasic, SupportsOneDeploy, WebAppBase, Updatable { - - /** @return the entry point to deployment slot management API under the web app */ - DeploymentSlots deploymentSlots(); - - /** - * Deploys a WAR file onto the Azure specialized Tomcat on this web app. - * - * @param warFile the WAR file to upload - */ - void warDeploy(File warFile); - - /** - * Deploys a WAR file onto the Azure specialized Tomcat on this web app. - * - * @param warFile the WAR file to upload - * @return a completable of the operation - */ - Mono warDeployAsync(File warFile); - - /** - * Deploys a WAR file onto the Azure specialized Tomcat on this web app. - *

- * Retry by client is required if error happens, due to nature of the stream. - * - * @param warFile the WAR file to upload - * @param length the length of the file - */ - void warDeploy(InputStream warFile, long length); - - /** - * Deploys a WAR file onto the Azure specialized Tomcat on this web app. - *

- * Retry by client is required if error happens, due to nature of the stream. - * - * @param warFile the WAR file to upload - * @param length the length of the file - * @return a completable of the operation - */ - Mono warDeployAsync(InputStream warFile, long length); - - /** - * Deploys a WAR file onto the Azure specialized Tomcat on this web app. - * - * @param warFile the WAR file to upload - * @param appName the name of the app, default to "ROOT" when not provided - */ - void warDeploy(File warFile, String appName); - - /** - * Deploys a WAR file onto the Azure specialized Tomcat on this web app. - * - * @param warFile the WAR file to upload - * @param appName the name of the app, default to "ROOT" when not provided - * @return a completable of the operation - */ - Mono warDeployAsync(File warFile, String appName); - - /** - * Deploys a WAR file onto the Azure specialized Tomcat on this web app. - *

- * Retry by client is required if error happens, due to nature of the stream. - * - * @param warFile the WAR file to upload - * @param length the length of the file - * @param appName the name of the app, default to "ROOT" when not provided - */ - void warDeploy(InputStream warFile, long length, String appName); - - /** - * Deploys a WAR file onto the Azure specialized Tomcat on this web app. - *

- * Retry by client is required if error happens, due to nature of the stream. - * - * @param warFile the WAR file to upload - * @param length the length of the file - * @param appName the name of the app, default to "ROOT" when not provided - * @return a completable of the operation - */ - Mono warDeployAsync(InputStream warFile, long length, String appName); - - /************************************************************** - * Fluent interfaces to provision a Web App - **************************************************************/ - - /** Container interface for all the definitions that need to be implemented. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.NewAppServicePlanWithGroup, - DefinitionStages.WithNewAppServicePlan, - DefinitionStages.WithLinuxAppFramework, - DefinitionStages.WithCredentials, - DefinitionStages.WithStartUpCommand, - DefinitionStages.WithWindowsAppFramework, - DefinitionStages.WithCreate { - } - - /** Grouping of all the web app definition stages. */ - interface DefinitionStages { - /** The first stage of the web app definition. */ - interface Blank extends DefinitionWithRegion { - /** - * Uses an existing app service plan for the web app. - * - * @param appServicePlan the existing app service plan - * @return the next stage of the definition - */ - ExistingWindowsPlanWithGroup withExistingWindowsPlan(AppServicePlan appServicePlan); - - /** - * Uses an existing app service plan for the web app. - * - * @param appServicePlan the existing app service plan - * @return the next stage of the definition - */ - ExistingLinuxPlanWithGroup withExistingLinuxPlan(AppServicePlan appServicePlan); - } - - /** A web app definition allowing resource group to be specified when an existing app service plan is used. */ - interface NewAppServicePlanWithGroup - extends GroupableResource.DefinitionStages.WithGroup { - } - - /** - * A web app definition allowing resource group to be specified when a new app service plan is to be created. - */ - interface ExistingWindowsPlanWithGroup { - /** - * Associates the resource with an existing resource group. - * - * @param groupName the name of an existing resource group to put this resource in. - * @return the next stage of the definition - */ - WithWindowsAppFramework withExistingResourceGroup(String groupName); - - /** - * Associates the resource with an existing resource group. - * - * @param group an existing resource group to put the resource in - * @return the next stage of the definition - */ - WithWindowsAppFramework withExistingResourceGroup(ResourceGroup group); - - /** - * Creates a new resource group to put the resource in. - * - *

The group will be created in the same location as the resource. - * - * @param name the name of the new group - * @return the next stage of the definition - */ - WithWindowsAppFramework withNewResourceGroup(String name); - - /** - * Creates a new resource group to put the resource in. - * - *

The group will be created in the same location as the resource. The group's name is automatically - * derived from the resource's name. - * - * @return the next stage of the definition - */ - WithWindowsAppFramework withNewResourceGroup(); - - /** - * Creates a new resource group to put the resource in, based on the definition specified. - * - * @param groupDefinition a creatable definition for a new resource group - * @return the next stage of the definition - */ - WithWindowsAppFramework withNewResourceGroup(Creatable groupDefinition); - } - - /** - * A web app definition allowing resource group to be specified when a new app service plan is to be created. - */ - interface ExistingLinuxPlanWithGroup { - /** - * Associates the resource with an existing resource group. - * - * @param groupName the name of an existing resource group to put this resource in. - * @return the next stage of the definition - */ - WithLinuxAppFramework withExistingResourceGroup(String groupName); - - /** - * Associates the resource with an existing resource group. - * - * @param group an existing resource group to put the resource in - * @return the next stage of the definition - */ - WithLinuxAppFramework withExistingResourceGroup(ResourceGroup group); - - /** - * Creates a new resource group to put the resource in. - * - *

The group will be created in the same location as the resource. - * - * @param name the name of the new group - * @return the next stage of the definition - */ - WithLinuxAppFramework withNewResourceGroup(String name); - - /** - * Creates a new resource group to put the resource in. - * - *

The group will be created in the same location as the resource. The group's name is automatically - * derived from the resource's name. - * - * @return the next stage of the definition - */ - WithLinuxAppFramework withNewResourceGroup(); - - /** - * Creates a new resource group to put the resource in, based on the definition specified. - * - * @param groupDefinition a creatable definition for a new resource group - * @return the next stage of the definition - */ - WithLinuxAppFramework withNewResourceGroup(Creatable groupDefinition); - } - - /** A web app definition allowing app service plan to be set. */ - interface WithNewAppServicePlan { - /** - * Creates a new free app service plan. This will fail if there are 10 or more free plans in the current - * subscription. - * - * @return the next stage of the definition - */ - WithWindowsAppFramework withNewFreeAppServicePlan(); - - /** - * Creates a new shared app service plan. - * - * @return the next stage of the definition - */ - WithWindowsAppFramework withNewSharedAppServicePlan(); - - /** - * Creates a new app service plan to use. - * - * @param pricingTier the sku of the app service plan - * @return the next stage of the definition - */ - WithWindowsAppFramework withNewWindowsPlan(PricingTier pricingTier); - - /** - * Creates a new app service plan to use. - * - * @param appServicePlanName the name of the new app service plan - * @param pricingTier the sku of the app service plan - * @return the next stage of the definition - */ - WithWindowsAppFramework withNewWindowsPlan(String appServicePlanName, PricingTier pricingTier); - - /** - * Creates a new app service plan to use. - * - * @param appServicePlanCreatable the new app service plan creatable - * @return the next stage of the definition - */ - WithWindowsAppFramework withNewWindowsPlan(Creatable appServicePlanCreatable); - - /** - * Creates a new app service plan to use. - * - * @param pricingTier the sku of the app service plan - * @return the next stage of the definition - */ - WithLinuxAppFramework withNewLinuxPlan(PricingTier pricingTier); - - /** - * Creates a new app service plan to use. - * - * @param appServicePlanName the name of the new app service plan - * @param pricingTier the sku of the app service plan - * @return the next stage of the definition - */ - WithLinuxAppFramework withNewLinuxPlan(String appServicePlanName, PricingTier pricingTier); - - /** - * Creates a new app service plan to use. - * - * @param appServicePlanCreatable the new app service plan creatable - * @return the next stage of the definition - */ - WithLinuxAppFramework withNewLinuxPlan(Creatable appServicePlanCreatable); - } - - /** A web app definition allowing container image source to be specified. */ - interface WithContainerImage { - /** - * Specifies the docker container image to be one from Docker Hub. - * - * @param imageAndTag image and optional tag (eg 'image:tag') - * @return the next stage of the definition - */ - WithStartUpCommand withPublicDockerHubImage(String imageAndTag); - - /** - * Specifies the docker container image to be one from Docker Hub. - * - * @param imageAndTag image and optional tag (eg 'image:tag') - * @return the next stage of the definition - */ - WithCredentials withPrivateDockerHubImage(String imageAndTag); - - /** - * Specifies the docker container image to be one from a private registry. - * - * @param imageAndTag image and optional tag (eg 'image:tag') - * @param serverUrl the URL to the private registry server - * @return the next stage of the definition - */ - WithCredentials withPrivateRegistryImage(String imageAndTag, String serverUrl); - } - - /** A web app definition allowing app framework on Linux operating system to be specified. */ - interface WithLinuxAppFramework extends WithContainerImage { - /** - * Specifies the docker container image to be a built in one. - * - * @param runtimeStack the runtime stack installed on the image - * @return the next stage of the definition - */ - WithCreate withBuiltInImage(RuntimeStack runtimeStack); - } - - /** A web app definition allowing docker registry credentials to be set. */ - interface WithCredentials { - /** - * Specifies the username and password for Docker Hub or the docker registry. - * - * @param username the username for Docker Hub or the docker registry - * @param password the password for Docker Hub or the docker registry - * @return the next stage of the definition - */ - WithStartUpCommand withCredentials(String username, String password); - } - - /** - * A web app definition allowing docker startup command to be specified. This will replace the "CMD" section in - * the Dockerfile. - */ - interface WithStartUpCommand extends WithCreate { - /** - * Specifies the startup command. - * - * @param startUpCommand startup command to replace "CMD" in Dockerfile - * @return the next stage of the definition - */ - WithCreate withStartUpCommand(String startUpCommand); - } - - /** A web app definition allowing app framework on Windows operating system to be specified. */ - interface WithWindowsAppFramework extends WithContainerImage, WithCreate { - /** - * Specifies the runtime stack for the web app on Windows operating system. - * - * @param runtimeStack the runtime stack for web app - * @return the next stage of the definition - */ - WithCreate withRuntimeStack(WebAppRuntimeStack runtimeStack); - } - - /** - * A site definition with sufficient inputs to create a new web app / deployments slot in the cloud, but - * exposing additional optional inputs to specify. - */ - interface WithCreate extends Creatable, WebAppBase.DefinitionStages.WithCreate { - } - } - - /** Grouping of all the web app update stages. */ - interface UpdateStages { - /** A web app update allowing app service plan to be set. */ - interface WithAppServicePlan { - /** - * Creates a new free app service plan. This will fail if there are 10 or more free plans in the current - * subscription. - * - * @return the next stage of the web app update - */ - Update withNewFreeAppServicePlan(); - - /** - * Creates a new shared app service plan. - * - * @return the next stage of the web app update - */ - Update withNewSharedAppServicePlan(); - - /** - * Creates a new app service plan to use. - * - * @param pricingTier the sku of the app service plan - * @return the next stage of the web app update - */ - Update withNewAppServicePlan(PricingTier pricingTier); - - /** - * Creates a new app service plan to use. - * - * @param appServicePlanName the name of the new app service plan - * @param pricingTier the sku of the app service plan - * @return the next stage of the web app update - */ - Update withNewAppServicePlan(String appServicePlanName, PricingTier pricingTier); - - /** - * Creates a new app service plan to use. - * - * @param appServicePlanCreatable the new app service plan creatable - * @return the next stage of the web app update - */ - Update withNewAppServicePlan(Creatable appServicePlanCreatable); - - /** - * Uses an existing app service plan for the web app. - * - * @param appServicePlan the existing app service plan - * @return the next stage of the web app update - */ - Update withExistingAppServicePlan(AppServicePlan appServicePlan); - } - - /** A web app update allowing container image source to be specified. */ - interface WithContainerImage { - - /** - * Specifies the docker container image to be one from Docker Hub. - * - * @param imageAndTag image and optional tag (eg 'image:tag') - * @return the next stage of the web app update - */ - WithStartUpCommand withPublicDockerHubImage(String imageAndTag); - - /** - * Specifies the docker container image to be one from Docker Hub. - * - * @param imageAndTag image and optional tag (eg 'image:tag') - * @return the next stage of the web app update - */ - WithCredentials withPrivateDockerHubImage(String imageAndTag); - - /** - * Specifies the docker container image to be one from a private registry. - * - * @param imageAndTag image and optional tag (eg 'image:tag') - * @param serverUrl the URL to the private registry server - * @return the next stage of the web app update - */ - WithCredentials withPrivateRegistryImage(String imageAndTag, String serverUrl); - } - - /** A web app update allowing built-in container image on Linux operating system to be specified. */ - interface WithLinuxAppImage { - /** - * Specifies the docker container image to be a built in one. - * - * @param runtimeStack the runtime stack installed on the image - * @return the next stage of the web app update - */ - Update withBuiltInImage(RuntimeStack runtimeStack); - } - - /** A web app update allowing docker hub credentials to be set. */ - interface WithCredentials { - /** - * Specifies the username and password for Docker Hub. - * - * @param username the username for Docker Hub - * @param password the password for Docker Hub - * @return the next stage of the web app update - */ - WithStartUpCommand withCredentials(String username, String password); - } - - /** - * A web app update allowing docker startup command to be specified. This will replace the "CMD" section in the - * Dockerfile. - */ - interface WithStartUpCommand extends Update { - /** - * Specifies the startup command. - * - * @param startUpCommand startup command to replace "CMD" in Dockerfile - * @return the next stage of the web app update - */ - Update withStartUpCommand(String startUpCommand); - } - - /** A web app update allowing runtime stack on Windows operating system to be specified. */ - interface WithWindowsRuntimeStack { - /** - * Specifies the runtime stack for the web app on Windows operating system. - * - * @param runtimeStack the runtime stack for web app - * @return the next stage of the web app update - */ - Update withRuntimeStack(WebAppRuntimeStack runtimeStack); - } - } - - /** The template for a web app update operation, containing all the settings that can be modified. */ - interface Update - extends Appliable, - UpdateStages.WithAppServicePlan, - UpdateStages.WithContainerImage, - UpdateStages.WithWindowsRuntimeStack, - UpdateStages.WithLinuxAppImage, - WebAppBase.Update { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebAppAuthentication.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebAppAuthentication.java deleted file mode 100644 index ac50da2e2600..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebAppAuthentication.java +++ /dev/null @@ -1,300 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.appservice.fluent.models.SiteAuthSettingsInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasParent; -import com.azure.resourcemanager.resources.fluentcore.model.Attachable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.model.Indexable; - -/** A web app authentication configuration in a web app. */ -@Fluent -public interface WebAppAuthentication extends HasInnerModel, Indexable, HasParent { - - /** - * The entirety of a web app authentication definition. - * - * @param the return type of the final {@link Attachable#attach()} - */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithDefaultAuthenticationProvider, - DefinitionStages.WithAttach { - } - - /** Grouping of web app authentication definition stages applicable as part of a web app creation. */ - interface DefinitionStages { - /** - * The first stage of a web app authentication definition as part of a definition of a web app. - * - * @param the return type of the final {@link Attachable#attach()} - */ - interface Blank extends WithDefaultAuthenticationProvider { - } - - /** - * A web app authentication definition allowing the default authentication provider to be set. - * - * @param the return type of the final {@link Attachable#attach()} - */ - interface WithDefaultAuthenticationProvider { - /** - * Does not require login by default. - * - * @return the next stage of the definition - */ - WithAttach withAnonymousAuthentication(); - - /** - * Specifies the default authentication provider. - * - * @param provider the default authentication provider - * @return the next stage of the definition - */ - WithAttach withDefaultAuthenticationProvider(BuiltInAuthenticationProvider provider); - } - - /** - * A web app authentication definition allowing detailed provider information to be specified. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithAuthenticationProvider { - /** - * Specifies the provider to be Active Directory and its client ID and issuer URL. - * - * @param clientId the AAD app's client ID - * @param issuerUrl the token issuer URL in the format of https://sts.windows.net/(tenantId) - * @return the next stage of the definition - */ - WithAttach withActiveDirectory(String clientId, String issuerUrl); - - /** - * Specifies the provider to be Facebook and its app ID and app secret. - * - * @param appId the Facebook app ID - * @param appSecret the Facebook app secret - * @return the next stage of the definition - */ - WithAttach withFacebook(String appId, String appSecret); - - /** - * Specifies the provider to be Google and its client ID and client secret. - * - * @param clientId the Google app's client ID - * @param clientSecret the Google app's client secret - * @return the next stage of the definition - */ - WithAttach withGoogle(String clientId, String clientSecret); - - /** - * Specifies the provider to be Twitter and its API key and API secret. - * - * @param apiKey the Twitter app's API key - * @param apiSecret the Twitter app's API secret - * @return the next stage of the definition - */ - WithAttach withTwitter(String apiKey, String apiSecret); - - /** - * Specifies the provider to be Microsoft and its client ID and client secret. - * - * @param clientId the Microsoft app's client ID - * @param clientSecret the Microsoft app's client secret - * @return the next stage of the definition - */ - WithAttach withMicrosoft(String clientId, String clientSecret); - } - - /** - * A web app authentication definition allowing token store to be specified. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithTokenStore { - /** - * Specifies if token store should be enabled. - * - * @param enabled true if token store should be enabled - * @return the next stage of the definition - */ - WithAttach withTokenStore(boolean enabled); - } - - /** - * A web app authentication definition allowing branch to be specified. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithExternalRedirectUrls { - /** - * Adds an external redirect URL. - * - * @param url the external redirect URL - * @return the next stage of the definition - */ - WithAttach withAllowedExternalRedirectUrl(String url); - } - - /** - * The final stage of the web app authentication definition. - * - *

At this stage, any remaining optional settings can be specified, or the web app authentication definition - * can be attached to the parent web app definition using {@link WithAttach#attach()}. - * - * @param the return type of {@link WithAttach#attach()} - */ - interface WithAttach - extends Attachable.InDefinition, - WithAuthenticationProvider, - WithTokenStore, - WithExternalRedirectUrls { - } - } - - /** - * The entirety of a web app authentication definition as part of a web app update. - * - * @param the return type of the final {@link UpdateDefinitionStages.WithAttach#attach()} - */ - interface UpdateDefinition - extends UpdateDefinitionStages.Blank, - UpdateDefinitionStages.WithAttach, - UpdateDefinitionStages.WithDefaultAuthenticationProvider, - UpdateDefinitionStages.WithAuthenticationProvider, - UpdateDefinitionStages.WithTokenStore, - UpdateDefinitionStages.WithExternalRedirectUrls { - } - - /** Grouping of web app authentication definition stages applicable as part of a web app update. */ - interface UpdateDefinitionStages { - /** - * The first stage of a web app authentication definition as part of a definition of a web app. - * - * @param the return type of the final {@link Attachable#attach()} - */ - interface Blank extends WithDefaultAuthenticationProvider { - } - - /** - * A web app authentication definition allowing the default authentication provider to be set. - * - * @param the return type of the final {@link Attachable#attach()} - */ - interface WithDefaultAuthenticationProvider { - /** - * Does not require login by default. - * - * @return the next stage of the definition - */ - WithAttach withAnonymousAuthentication(); - - /** - * Specifies the default authentication provider. - * - * @param provider the default authentication provider - * @return the next stage of the definition - */ - WithAttach withDefaultAuthenticationProvider(BuiltInAuthenticationProvider provider); - } - - /** - * A web app authentication definition allowing detailed provider information to be specified. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithAuthenticationProvider { - /** - * Specifies the provider to be Active Directory and its client ID and issuer URL. - * - * @param clientId the AAD app's client ID - * @param issuerUrl the token issuer URL in the format of https://sts.windows.net/(tenantId) - * @return the next stage of the definition - */ - WithAttach withActiveDirectory(String clientId, String issuerUrl); - - /** - * Specifies the provider to be Facebook and its app ID and app secret. - * - * @param appId the Facebook app ID - * @param appSecret the Facebook app secret - * @return the next stage of the definition - */ - WithAttach withFacebook(String appId, String appSecret); - - /** - * Specifies the provider to be Google and its client ID and client secret. - * - * @param clientId the Google app's client ID - * @param clientSecret the Google app's client secret - * @return the next stage of the definition - */ - WithAttach withGoogle(String clientId, String clientSecret); - - /** - * Specifies the provider to be Twitter and its API key and API secret. - * - * @param apiKey the Twitter app's API key - * @param apiSecret the Twitter app's API secret - * @return the next stage of the definition - */ - WithAttach withTwitter(String apiKey, String apiSecret); - - /** - * Specifies the provider to be Microsoft and its client ID and client secret. - * - * @param clientId the Microsoft app's client ID - * @param clientSecret the Microsoft app's client secret - * @return the next stage of the definition - */ - WithAttach withMicrosoft(String clientId, String clientSecret); - } - - /** - * A web app authentication definition allowing token store to be specified. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithTokenStore { - /** - * Specifies if token store should be enabled. - * - * @param enabled true if token store should be enabled - * @return the next stage of the definition - */ - WithAttach withTokenStore(boolean enabled); - } - - /** - * A web app authentication definition allowing branch to be specified. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithExternalRedirectUrls { - /** - * Adds an external redirect URL. - * - * @param url the external redirect URL - * @return the next stage of the definition - */ - WithAttach withAllowedExternalRedirectUrl(String url); - } - - /** - * The final stage of the web app authentication definition. - * - *

At this stage, any remaining optional settings can be specified, or the web app authentication definition - * can be attached to the parent web app update using {@link WithAttach#attach()}. - * - * @param the return type of {@link WithAttach#attach()} - */ - interface WithAttach - extends Attachable.InUpdate, - WithAuthenticationProvider, - WithTokenStore, - WithExternalRedirectUrls { - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebAppBase.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebAppBase.java deleted file mode 100644 index 2e4748c51e8b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebAppBase.java +++ /dev/null @@ -1,1624 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.appservice.AppServiceManager; -import com.azure.resourcemanager.appservice.fluent.models.SiteInner; -import com.azure.resourcemanager.authorization.models.BuiltInRole; -import com.azure.resourcemanager.resources.fluentcore.arm.models.GroupableResource; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasName; -import com.azure.resourcemanager.resources.fluentcore.model.Appliable; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import java.io.File; -import java.io.InputStream; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An immutable client-side representation of an Azure Web App or deployment slot. */ -@Fluent -public interface WebAppBase extends HasName, GroupableResource, WebSiteBase { - - /** @return the default documents */ - List defaultDocuments(); - - /** @return the .NET Framework version */ - NetFrameworkVersion netFrameworkVersion(); - - /** @return the version of PHP */ - PhpVersion phpVersion(); - - /** @return the version of Python */ - PythonVersion pythonVersion(); - - /** @return the version of Node.JS */ - String nodeVersion(); - - /** @return if the remote eebugging is enabled */ - boolean remoteDebuggingEnabled(); - - /** @return the remote debugging version */ - RemoteVisualStudioVersion remoteDebuggingVersion(); - - /** @return if web socket is enabled */ - boolean webSocketsEnabled(); - - /** @return if the web app is always on */ - boolean alwaysOn(); - - /** @return Java version */ - JavaVersion javaVersion(); - - /** @return Java container */ - String javaContainer(); - - /** @return Java container version */ - String javaContainerVersion(); - - /** @return managed pipeline mode */ - ManagedPipelineMode managedPipelineMode(); - - /** @return the auto swap slot name */ - String autoSwapSlotName(); - - /** @return the state of FTP / FTPS service */ - FtpsState ftpsState(); - - /** @return the virtual applications and their virtual directories in this web app */ - List virtualApplications(); - - /** @return whether to allow clients to connect over http2.0 */ - boolean http20Enabled(); - - /** @return the minimum version of TLS required for SSL requests. */ - SupportedTlsVersions minTlsVersion(); - - /** @return whether local MySQL is enabled */ - boolean localMySqlEnabled(); - - /** @return the SCM configuration for the web app */ - ScmType scmType(); - - /** @return the root directory for the web app */ - String documentRoot(); - - /** - * @return the System Assigned (Local) Managed Service Identity specific Active Directory tenant ID assigned to the - * web app. - */ - String systemAssignedManagedServiceIdentityTenantId(); - - /** - * @return the System Assigned (Local) Managed Service Identity specific Active Directory service principal ID - * assigned to the web app. - */ - String systemAssignedManagedServiceIdentityPrincipalId(); - - /** @return The ids of the user assigned identities */ - Set userAssignedManagedServiceIdentityIds(); - - /** @return the app settings defined on the web app */ - Map getAppSettings(); - - /** @return the app settings defined on the web app */ - Mono> getAppSettingsAsync(); - - /** @return the connection strings defined on the web app */ - Map getConnectionStrings(); - - /** @return the connection strings defined on the web app */ - Mono> getConnectionStringsAsync(); - - /** @return the authentication configuration defined on the web app */ - WebAppAuthentication getAuthenticationConfig(); - - /** @return the authentication configuration defined on the web app */ - Mono getAuthenticationConfigAsync(); - - /** @return the architecture of the platform, either 32 bit (x86) or 64 bit (x64). */ - PlatformArchitecture platformArchitecture(); - - /** @return the Linux app framework and version if this is a Linux web app. */ - String linuxFxVersion(); - - /** @return the Windows app framework and version if this is a Windows web app. */ - String windowsFxVersion(); - - /** @return the list of ip security rules. */ - List ipSecurityRules(); - - /** @return the diagnostic logs configuration */ - WebAppDiagnosticLogs diagnosticLogsConfig(); - - /** @return the mapping from host names and the host name bindings */ - Map getHostnameBindings(); - - /** @return the mapping from host names and the host name bindings */ - Mono> getHostnameBindingsAsync(); - - /** @return the URL and credentials for publishing through FTP or Git */ - PublishingProfile getPublishingProfile(); - - /** @return the URL and credentials for publishing through FTP or Git */ - Mono getPublishingProfileAsync(); - - /** @return the source control information for the web app */ - WebAppSourceControl getSourceControl(); - - /** @return the source control information for the web app */ - Mono getSourceControlAsync(); - - /** - * First step specifying the parameters to make a web deployment (MS Deploy) to the web app. - * - * @return a stage to create web deployment - */ - WebDeployment.DefinitionStages.WithPackageUri deploy(); - - /** @return the last lines of docker logs for a Linux web app */ - byte[] getContainerLogs(); - - /** @return the last lines of docker logs for a Linux web app */ - Mono getContainerLogsAsync(); - - /** @return the zipped archive of docker logs for a Linux web app */ - byte[] getContainerLogsZip(); - - /** @return the zipped archive of docker logs for a Linux web app */ - Mono getContainerLogsZipAsync(); - - /** @return a open stream to the application logs */ - InputStream streamApplicationLogs(); - - /** @return a open stream to the HTTP logs */ - InputStream streamHttpLogs(); - - /** @return a open stream to the trace logs */ - InputStream streamTraceLogs(); - - /** @return a open stream to the deployment logs */ - InputStream streamDeploymentLogs(); - - /** @return a open stream to all logs */ - InputStream streamAllLogs(); - - /** @return an Observable streaming application logs */ - Flux streamApplicationLogsAsync(); - - /** @return an Observable streaming HTTP logs */ - Flux streamHttpLogsAsync(); - - /** @return an Observable streaming trace logs */ - Flux streamTraceLogsAsync(); - - /** @return an Observable streaming deployment logs */ - Flux streamDeploymentLogsAsync(); - - /** @return an Observable streaming all logs */ - Flux streamAllLogsAsync(); - - /** - * Verifies the ownership of the domain for a certificate order by verifying a hostname of the domain is bound to - * this web app. - * - * @param certificateOrderName the name of the certificate order - * @param domainVerificationToken the domain verification token for the certificate order - */ - void verifyDomainOwnership(String certificateOrderName, String domainVerificationToken); - - /** - * Verifies the ownership of the domain for a certificate order by verifying a hostname of the domain is bound to - * this web app. - * - * @param certificateOrderName the name of the certificate order - * @param domainVerificationToken the domain verification token for the certificate order - * @return a representation of the deferred computation of this call - */ - Mono verifyDomainOwnershipAsync(String certificateOrderName, String domainVerificationToken); - - /** Starts the web app or deployment slot. */ - void start(); - - /** - * Starts the web app or deployment slot. - * - * @return a representation of the deferred computation of this call - */ - Mono startAsync(); - - /** Stops the web app or deployment slot. */ - void stop(); - - /** - * Stops the web app or deployment slot. - * - * @return a representation of the deferred computation of this call - */ - Mono stopAsync(); - - /** Restarts the web app or deployment slot. */ - void restart(); - - /** - * Restarts the web app or deployment slot. - * - * @return a representation of the deferred computation of this call - */ - Mono restartAsync(); - - /** - * Swaps the app running in the current web app / slot with the app running in the specified slot. - * - * @param slotName the target slot to swap with. Use 'production' for the production slot. - */ - void swap(String slotName); - - /** - * Swaps the app running in the current web app / slot with the app running in the specified slot. - * - * @param slotName the target slot to swap with. Use 'production' for the production slot. - * @return a representation of the deferred computation of this call - */ - Mono swapAsync(String slotName); - - /** - * Apply the slot (or sticky) configurations from the specified slot to the current one. This is useful for "Swap - * with Preview". - * - * @param slotName the target slot to apply configurations from - */ - void applySlotConfigurations(String slotName); - - /** - * Apply the slot (or sticky) configurations from the specified slot to the current one. This is useful for "Swap - * with Preview". - * - * @param slotName the target slot to apply configurations from - * @return a representation of the deferred computation of this call - */ - Mono applySlotConfigurationsAsync(String slotName); - - /** Reset the slot to its original configurations. */ - void resetSlotConfigurations(); - - /** - * Reset the slot to its original configurations. - * - * @return a representation of the deferred computation of this call - */ - Mono resetSlotConfigurationsAsync(); - - /** - * Deploys a ZIP file onto the Azure specialized Java SE image on this web app. - * - * @param zipFile the ZIP file to upload - */ - void zipDeploy(File zipFile); - - /** - * Deploys a ZIP file onto the Azure specialized Java SE image on this web app. - * - * @param zipFile the ZIP file to upload - * @return a completable of the operation - */ - Mono zipDeployAsync(File zipFile); - - /** - * Deploys a ZIP file onto the Azure specialized Java SE image on this web app. - *

- * Retry by client is required if error happens, due to nature of the stream. - * - * @param zipFile the ZIP file to upload - * @param length the length of the file - */ - void zipDeploy(InputStream zipFile, long length); - - /** - * Deploys a ZIP file onto the Azure specialized Java SE image on this web app. - *

- * Retry by client is required if error happens, due to nature of the stream. - * - * @param zipFile the ZIP file to upload - * @param length the length of the file - * @return a completable of the operation - */ - Mono zipDeployAsync(InputStream zipFile, long length); - - /** - * Gets the App Settings on site from Kudu client. It might lag after App Setting update to the site. - * @return the App Settings on site from Kudu client - */ - Map getSiteAppSettings(); - - /** - * Gets the App Settings on site from Kudu client. It might lag after App Setting update to the site. - * @return the App Settings on site from Kudu client - */ - Mono> getSiteAppSettingsAsync(); - - /************************************************************** - * Fluent interfaces to provision a Web App or deployment slot. - **************************************************************/ - - /** - * The entirety of the web app base definition. - * - * @param the type of the resource - */ - interface Definition - extends DefinitionStages.WithWebContainer, - DefinitionStages.WithCreate, - DefinitionStages.WithSystemAssignedIdentityBasedAccessOrCreate { - } - - /** Grouping of all the site definition stages. */ - interface DefinitionStages { - /** - * A web app definition stage allowing host name binding to be specified. - * - * @param the type of the resource - */ - interface WithHostNameBinding { - /** - * Starts the definition of a new host name binding. - * - * @return the first stage of a hostname binding definition - */ - HostnameBinding.DefinitionStages.Blank> defineHostnameBinding(); - - /** - * Defines a list of host names of an Azure managed domain. The DNS record type is defaulted to be CNAME - * except for the root level domain ("@"). - * - * @param domain the Azure managed domain - * @param hostnames the list of sub-domains - * @return the next stage of the definition - */ - WithCreate withManagedHostnameBindings(AppServiceDomain domain, String... hostnames); - - /** - * Defines a list of host names of an externally purchased domain. The hostnames must be configured before - * hand to point to the web app. - * - * @param domain the external domain name - * @param hostnames the list of sub-domains - * @return the next stage of the definition - */ - WithCreate withThirdPartyHostnameBinding(String domain, String... hostnames); - } - - /** - * A web app definition stage allowing SSL binding to be set. - * - * @param the type of the resource - */ - interface WithHostNameSslBinding { - /** - * Starts a definition of an SSL binding. - * - * @return the first stage of an SSL binding definition - */ - HostnameSslBinding.DefinitionStages.Blank> defineSslBinding(); - } - - /** - * A web app definition stage allowing disabling the web app upon creation. - * - * @param the type of the resource - */ - interface WithSiteEnabled { - /** - * Disables the web app upon creation. - * - * @return the next stage of the definition - */ - WithCreate withAppDisabledOnCreation(); - } - - /** - * A web app definition stage allowing setting if SCM site is also stopped when the web app is stopped. - * - * @param the type of the resource - */ - interface WithScmSiteAlsoStopped { - /** - * Specifies if SCM site is also stopped when the web app is stopped. - * - * @param scmSiteAlsoStopped true if SCM site is also stopped - * @return the next stage of the definition - */ - WithCreate withScmSiteAlsoStopped(boolean scmSiteAlsoStopped); - } - - /** - * A web app definition stage allowing setting if client affinity is enabled. - * - * @param the type of the resource - */ - interface WithClientAffinityEnabled { - /** - * Specifies if client affinity is enabled. - * - * @param enabled true if client affinity is enabled - * @return the next stage of the definition - */ - WithCreate withClientAffinityEnabled(boolean enabled); - } - - /** - * A web app definition stage allowing setting if client cert is enabled. - * - * @param the type of the resource - */ - interface WithClientCertEnabled { - /** - * Specifies if client cert is enabled. - * - * @param enabled true if client cert is enabled - * @return the next stage of the definition - */ - WithCreate withClientCertEnabled(boolean enabled); - } - - /** - * A web app definition stage allowing Java web container to be set. This is required after specifying Java - * version. - * - * @param the type of the resource - */ - interface WithWebContainer { - /** - * Specifies the Java web container. - * - * @param webContainer the Java web container - * @return the next stage of the definition - */ - WithCreate withWebContainer(WebContainer webContainer); - } - - /** - * A web app definition stage allowing other configurations to be set. These configurations can be cloned when - * creating or swapping with a deployment slot. - * - * @param the type of the resource - */ - interface WithSiteConfigs { - /** - * Specifies the .NET Framework version. - * - * @param version the .NET Framework version - * @return the next stage of the definition - */ - WithCreate withNetFrameworkVersion(NetFrameworkVersion version); - - /** - * Specifies the PHP version. - * - * @param version the PHP version - * @return the next stage of the definition - */ - WithCreate withPhpVersion(PhpVersion version); - - /** - * Specifies the Java version. - * - * @param version the Java version - * @return the next stage of the definition - */ - WithWebContainer withJavaVersion(JavaVersion version); - - /** - * Specifies the Python version. - * - * @param version the Python version - * @return the next stage of the definition - */ - WithCreate withPythonVersion(PythonVersion version); - - /** - * Specifies the platform architecture to use. - * - * @param platform the platform architecture - * @return the next stage of the definition - */ - WithCreate withPlatformArchitecture(PlatformArchitecture platform); - - /** - * Specifies if web sockets are enabled. - * - * @param enabled true if web sockets are enabled - * @return the next stage of the definition - */ - WithCreate withWebSocketsEnabled(boolean enabled); - - /** - * Specifies if the VM powering the web app is always powered on. - * - * @param alwaysOn true if the web app is always powered on - * @return the next stage of the definition - */ - WithCreate withWebAppAlwaysOn(boolean alwaysOn); - - /** - * Specifies the managed pipeline mode. - * - * @param managedPipelineMode managed pipeline mode - * @return the next stage of the definition - */ - WithCreate withManagedPipelineMode(ManagedPipelineMode managedPipelineMode); - - /** - * Specifies the slot name to auto-swap when a deployment is completed in this web app / deployment slot. - * - * @param slotName the name of the slot, or 'production', to auto-swap - * @return the next stage of the definition - */ - WithCreate withAutoSwapSlotName(String slotName); - - /** - * Specifies the Visual Studio version for remote debugging. - * - * @param remoteVisualStudioVersion the Visual Studio version for remote debugging - * @return the next stage of the definition - */ - WithCreate withRemoteDebuggingEnabled(RemoteVisualStudioVersion remoteVisualStudioVersion); - - /** - * Disables remote debugging. - * - * @return the next stage of the definition - */ - WithCreate withRemoteDebuggingDisabled(); - - /** - * Adds a default document. - * - * @param document default document - * @return the next stage of the definition - */ - WithCreate withDefaultDocument(String document); - - /** - * Adds a list of default documents. - * - * @param documents list of default documents - * @return the next stage of the definition - */ - WithCreate withDefaultDocuments(List documents); - - /** - * Removes a default document. - * - * @param document default document to remove - * @return the next stage of the definition - */ - WithCreate withoutDefaultDocument(String document); - - /** - * Sets whether the web app only accepts HTTPS traffic. - * - * @param httpsOnly true if the web app only accepts HTTPS traffic - * @return the next stage of web app definition - */ - WithCreate withHttpsOnly(boolean httpsOnly); - - /** - * Sets whether the web app accepts HTTP 2.0 traffic. - * - * @param http20Enabled true if the web app accepts HTTP 2.0 traffic - * @return the next stage of web app definition - */ - WithCreate withHttp20Enabled(boolean http20Enabled); - - /** - * Sets whether the web app supports certain type of FTP(S). - * - * @param ftpsState the FTP(S) configuration - * @return the next stage of web app definition - */ - WithCreate withFtpsState(FtpsState ftpsState); - - /** - * Sets the virtual applications in the web app. - * - * @param virtualApplications the list of virtual applications in the web app - * @return the next stage of web app definition - */ - WithCreate withVirtualApplications(List virtualApplications); - - /** - * Sets the minimum version of TLS required for SSL requests. - * - * @param minTlsVersion the minimum version of TLS required for SSL requests. - * @return the next stage of web app definition - */ - WithCreate withMinTlsVersion(SupportedTlsVersions minTlsVersion); - } - - /** - * A web app definition stage allowing app settings to be set. - * - * @param the type of the resource - */ - interface WithAppSettings { - /** - * Adds an app setting to the web app. - * - * @param key the key for the app setting - * @param value the value for the app setting - * @return the next stage of the definition - */ - WithCreate withAppSetting(String key, String value); - - /** - * Specifies the app settings for the web app as a {@link Map}. - * - * @param settings a {@link Map} of app settings - * @return the next stage of the definition - */ - WithCreate withAppSettings(Map settings); - - /** - * Adds an app setting to the web app. This app setting will be swapped as well after a deployment slot - * swap. - * - * @param key the key for the app setting - * @param value the value for the app setting - * @return the next stage of the definition - */ - WithCreate withStickyAppSetting(String key, String value); - - /** - * Specifies the app settings for the web app as a {@link Map}. These app settings will be swapped as well - * after a deployment slot swap. - * - * @param settings a {@link Map} of app settings - * @return the next stage of the definition - */ - WithCreate withStickyAppSettings(Map settings); - } - - /** - * A web app definition stage allowing connection strings to be set. - * - * @param the type of the resource - */ - interface WithConnectionString { - /** - * Adds a connection string to the web app. - * - * @param name the name of the connection string - * @param value the connection string value - * @param type the connection string type - * @return the next stage of the definition - */ - WithCreate withConnectionString(String name, String value, ConnectionStringType type); - - /** - * Adds a connection string to the web app. This connection string will be swapped as well after a - * deployment slot swap. - * - * @param name the name of the connection string - * @param value the connection string value - * @param type the connection string type - * @return the next stage of the definition - */ - WithCreate withStickyConnectionString(String name, String value, ConnectionStringType type); - } - - /** - * A web app definition stage allowing source control to be set. - * - * @param the type of the resource - */ - interface WithSourceControl { - /** - * Starts the definition of a new source control. - * - * @return the first stage of a source control definition - */ - WebAppSourceControl.DefinitionStages.Blank> defineSourceControl(); - - /** - * Specifies the source control to be a local Git repository on the web app. - * - * @return the next stage of the definition - */ - WithCreate withLocalGitSourceControl(); - } - - /** - * A web app definition stage allowing authentication to be set. - * - * @param the type of the resource - */ - interface WithAuthentication { - /** - * Specifies the definition of a new authentication configuration. - * - * @return the first stage of an authentication definition - */ - WebAppAuthentication.DefinitionStages.Blank> defineAuthentication(); - } - - /** - * A web app definition stage allowing diagnostic logging to be set. - * - * @param the type of the resource - */ - interface WithDiagnosticLogging { - /** - * Specifies the definition of a new diagnostic logs configuration. - * - * @return the first stage of an diagnostic logs definition - */ - WebAppDiagnosticLogs.DefinitionStages.Blank> defineDiagnosticLogsConfiguration(); - - /** - * Specifies the configuration for container logging for Linux web apps. - * - * @param quotaInMB the limit that restricts file system usage by app diagnostics logs. Value can range from - * 25 MB and 100 MB. - * @param retentionDays maximum days of logs that will be available - * @return the next stage of the web app definition - */ - WithCreate withContainerLoggingEnabled(int quotaInMB, int retentionDays); - - /** - * Specifies the configuration for container logging for Linux web apps. Logs will be stored on the file - * system for up to 35 MB. - * - * @return the next stage of the web app definition - */ - WithCreate withContainerLoggingEnabled(); - - /** - * Disable the container logging for Linux web apps. - * - * @return the next stage of the web app definition - */ - WithCreate withContainerLoggingDisabled(); - } - - /** - * A web app definition stage allowing System Assigned Managed Service Identity to be set. - * - * @param the type of the resource - */ - interface WithManagedServiceIdentity { - /** - * Specifies that System Assigned Managed Service Identity needs to be enabled in the web app. - * - * @return the next stage of the web app definition - */ - WithSystemAssignedIdentityBasedAccessOrCreate withSystemAssignedManagedServiceIdentity(); - - /** - * Specifies that System Assigned (Local) Managed Service Identity needs to be disabled. - * - * @return the next stage of the update - */ - Update withoutSystemAssignedManagedServiceIdentity(); - } - - /** - * The stage of the System Assigned (Local) Managed Service Identity enabled web app allowing to set access role - * for the identity. - * - * @param the type of the resource - */ - interface WithSystemAssignedIdentityBasedAccessOrCreate extends WithCreate { - /** - * Specifies that web app's system assigned (local) identity should have the given access (described by the - * role) on an ARM resource identified by the resource ID. Applications running on the web app will have the - * same permission (role) on the ARM resource. - * - * @param resourceId the ARM identifier of the resource - * @param role access role to assigned to the web app's local identity - * @return the next stage of the definition - */ - WithSystemAssignedIdentityBasedAccessOrCreate withSystemAssignedIdentityBasedAccessTo( - String resourceId, BuiltInRole role); - - /** - * Specifies that web app's system assigned (local) identity should have the given access (described by the - * role) on the resource group that web app resides. Applications running on the web app will have the same - * permission (role) on the resource group. - * - * @param role access role to assigned to the web app's local identity - * @return the next stage of the definition - */ - WithSystemAssignedIdentityBasedAccessOrCreate - withSystemAssignedIdentityBasedAccessToCurrentResourceGroup(BuiltInRole role); - - /** - * Specifies that web app's system assigned (local) identity should have the access (described by the role - * definition) on an ARM resource identified by the resource ID. Applications running on the web app will - * have the same permission (role) on the ARM resource. - * - * @param resourceId scope of the access represented in ARM resource ID format - * @param roleDefinitionId access role definition to assigned to the web app's local identity - * @return the next stage of the definition - */ - WithSystemAssignedIdentityBasedAccessOrCreate withSystemAssignedIdentityBasedAccessTo( - String resourceId, String roleDefinitionId); - - /** - * Specifies that web app's system assigned (local) identity should have the access (described by the role - * definition) on the resource group that web app resides. Applications running on the web app will have the - * same permission (role) on the resource group. - * - * @param roleDefinitionId access role definition to assigned to the web app's local identity - * @return the next stage of the definition - */ - WithSystemAssignedIdentityBasedAccessOrCreate - withSystemAssignedIdentityBasedAccessToCurrentResourceGroup(String roleDefinitionId); - } - - /** The stage of web app definition allowing to configure network access settings. */ - interface WithNetworkAccess { - /** - * Specifies that access to the web app from the specific virtual network subnet should be allowed. - * - * @param subnetId the virtual network subnet id - * @param priority the priority of the rule - * @return the next stage of the definition - */ - WithCreate withAccessFromNetworkSubnet(String subnetId, int priority); - - /** - * Specifies that access to the web app from the specific ip address should be allowed. - * - * Allowing any specific access will add a Deny Any rule with least priority. - * - * @param ipAddress the ip address - * @param priority the priority of the rule - * @return the next stage of the definition - */ - WithCreate withAccessFromIpAddress(String ipAddress, int priority); - - /** - * Specifies that access to the web app from the specific ip range should be allowed. - * - * Allowing any specific access will add a Deny Any rule with least priority. - * - * @param ipAddressCidr the ip address range expressed in cidr format - * @param priority the priority of the rule - * @return the next stage of the definition - */ - WithCreate withAccessFromIpAddressRange(String ipAddressCidr, int priority); - - /** - * Specifies the ip security rule. - * - * Allowing any specific access will add a Deny Any rule with least priority. - * - * @param ipSecurityRule the ip security rule - * @return the next stage of the definition - */ - WithCreate withAccessRule(IpSecurityRestriction ipSecurityRule); - } - - /** - * A site definition with sufficient inputs to create a new web app / deployments slot in the cloud, but - * exposing additional optional inputs to specify. - * - * @param the type of the resource - */ - interface WithCreate - extends Creatable, - GroupableResource.DefinitionWithTags>, - WithClientAffinityEnabled, - WithClientCertEnabled, - WithScmSiteAlsoStopped, - WithSiteConfigs, - WithAppSettings, - WithConnectionString, - WithSourceControl, - WithHostNameBinding, - WithHostNameSslBinding, - WithAuthentication, - WithDiagnosticLogging, - WithManagedServiceIdentity, - WithNetworkAccess { - } - } - - /** Grouping of all the web app update stages. */ - interface UpdateStages { - /** - * The stage of the web app update allowing host name binding to be set. - * - * @param the type of the resource - */ - interface WithHostNameBinding { - /** - * Starts the definition of a new host name binding. - * - * @return the first stage of a hostname binding update - */ - HostnameBinding.UpdateDefinitionStages.Blank> defineHostnameBinding(); - - /** - * Defines a list of host names of an Azure managed domain. The DNS record type is defaulted to be CNAME - * except for the root level domain ("@"). - * - * @param domain the Azure managed domain - * @param hostnames the list of sub-domains - * @return the next stage of web app update - */ - Update withManagedHostnameBindings(AppServiceDomain domain, String... hostnames); - - /** - * Defines a list of host names of an externally purchased domain. The hostnames must be configured before - * hand to point to the web app. - * - * @param domain the external domain name - * @param hostnames the list of sub-domains - * @return the next stage of web app update - */ - Update withThirdPartyHostnameBinding(String domain, String... hostnames); - - /** - * Unbinds a hostname from the web app. - * - * @param hostname the hostname to unbind - * @return the next stage of web app update - */ - Update withoutHostnameBinding(String hostname); - } - - /** - * The stage of the web app update allowing SSL binding to be set. - * - * @param the type of the resource - */ - interface WithHostNameSslBinding { - /** - * Starts a definition of an SSL binding. - * - * @return the first stage of an SSL binding definition - */ - HostnameSslBinding.UpdateDefinitionStages.Blank> defineSslBinding(); - - /** - * Removes an SSL binding for a specific hostname. - * - * @param hostname the hostname to remove SSL certificate from - * @return the next stage of web app update - */ - Update withoutSslBinding(String hostname); - } - - /** - * The stage of the web app update allowing disabling the web app upon creation. - * - * @param the type of the resource - */ - interface WithSiteEnabled { - /** - * Disables the web app upon creation. - * - * @return the next stage of web app update - */ - Update withAppDisabledOnCreation(); - } - - /** - * The stage of the web app update allowing setting if SCM site is also stopped when the web app is stopped. - * - * @param the type of the resource - */ - interface WithScmSiteAlsoStopped { - /** - * Specifies if SCM site is also stopped when the web app is stopped. - * - * @param scmSiteAlsoStopped true if SCM site is also stopped - * @return the next stage of web app update - */ - Update withScmSiteAlsoStopped(boolean scmSiteAlsoStopped); - } - - /** - * The stage of the web app update allowing setting if client affinity is enabled. - * - * @param the type of the resource - */ - interface WithClientAffinityEnabled { - /** - * Specifies if client affinity is enabled. - * - * @param enabled true if client affinity is enabled - * @return the next stage of web app update - */ - Update withClientAffinityEnabled(boolean enabled); - } - - /** - * The stage of the web app update allowing setting if client cert is enabled. - * - * @param the type of the resource - */ - interface WithClientCertEnabled { - /** - * Specifies if client cert is enabled. - * - * @param enabled true if client cert is enabled - * @return the next stage of web app update - */ - Update withClientCertEnabled(boolean enabled); - } - - /** - * The stage of the web app update allowing Java web container to be set. This is required after specifying Java - * version. - * - * @param the type of the resource - */ - interface WithWebContainer { - /** - * Specifies the Java web container. - * - * @param webContainer the Java web container - * @return the next stage of the web app update - */ - Update withWebContainer(WebContainer webContainer); - } - - /** - * The stage of the web app update allowing other configurations to be set. These configurations can be cloned - * when creating or swapping with a deployment slot. - * - * @param the type of the resource - */ - interface WithSiteConfigs { - /** - * Specifies the .NET Framework version. - * - * @param version the .NET Framework version - * @return the next stage of web app update - */ - Update withNetFrameworkVersion(NetFrameworkVersion version); - - /** - * Specifies the PHP version. - * - * @param version the PHP version - * @return the next stage of web app update - */ - Update withPhpVersion(PhpVersion version); - - /** - * Turn off PHP support. - * - * @return the next stage of the update - */ - Update withoutPhp(); - - /** - * Specifies the Java version. - * - * @param version the Java version - * @return the next stage of web app update - */ - WithWebContainer withJavaVersion(JavaVersion version); - - /** - * Turn off Java support. - * - * @return the next stage of web app update - */ - Update withoutJava(); - - /** - * Specifies the Python version. - * - * @param version the Python version - * @return the next stage of web app update - */ - Update withPythonVersion(PythonVersion version); - - /** - * Turn off Python support. - * - * @return the next stage of web app update - */ - Update withoutPython(); - - /** - * Specifies the platform architecture to use. - * - * @param platform the platform architecture - * @return the next stage of web app update - */ - Update withPlatformArchitecture(PlatformArchitecture platform); - - /** - * Specifies if web sockets are enabled. - * - * @param enabled true if web sockets are enabled - * @return the next stage of web app update - */ - Update withWebSocketsEnabled(boolean enabled); - - /** - * Specifies if the VM powering the web app is always powered on. - * - * @param alwaysOn true if the web app is always powered on - * @return the next stage of web app update - */ - Update withWebAppAlwaysOn(boolean alwaysOn); - - /** - * Specifies the managed pipeline mode. - * - * @param managedPipelineMode managed pipeline mode - * @return the next stage of web app update - */ - Update withManagedPipelineMode(ManagedPipelineMode managedPipelineMode); - - /** - * Specifies the slot name to auto-swap when a deployment is completed in this web app / deployment slot. - * - * @param slotName the name of the slot, or 'production', to auto-swap - * @return the next stage of web app update - */ - Update withAutoSwapSlotName(String slotName); - - /** - * Specifies the Visual Studio version for remote debugging. - * - * @param remoteVisualStudioVersion the Visual Studio version for remote debugging - * @return the next stage of web app update - */ - Update withRemoteDebuggingEnabled(RemoteVisualStudioVersion remoteVisualStudioVersion); - - /** - * Disables remote debugging. - * - * @return the next stage of web app update - */ - Update withRemoteDebuggingDisabled(); - - /** - * Adds a default document. - * - * @param document default document - * @return the next stage of web app update - */ - Update withDefaultDocument(String document); - - /** - * Adds a list of default documents. - * - * @param documents list of default documents - * @return the next stage of web app update - */ - Update withDefaultDocuments(List documents); - - /** - * Removes a default document. - * - * @param document default document to remove - * @return the next stage of web app update - */ - Update withoutDefaultDocument(String document); - - /** - * Sets whether the web app only accepts HTTPS traffic. - * - * @param httpsOnly true if the web app only accepts HTTPS traffic - * @return the next stage of web app update - */ - Update withHttpsOnly(boolean httpsOnly); - - /** - * Sets whether the web app accepts HTTP 2.0 traffic. - * - * @param http20Enabled true if the web app accepts HTTP 2.0 traffic - * @return the next stage of web app update - */ - Update withHttp20Enabled(boolean http20Enabled); - - /** - * Sets whether the web app supports certain type of FTP(S). - * - * @param ftpsState the FTP(S) configuration - * @return the next stage of web app update - */ - Update withFtpsState(FtpsState ftpsState); - - /** - * Sets the virtual applications in the web app. - * - * @param virtualApplications the list of virtual applications in the web app - * @return the next stage of web app update - */ - Update withVirtualApplications(List virtualApplications); - - /** - * Sets the minimum version of TLS required for SSL requests. - * - * @param minTlsVersion the minimum version of TLS required for SSL requests. - * @return the next stage of web app definition - */ - Update withMinTlsVersion(SupportedTlsVersions minTlsVersion); - } - - /** - * A web app update stage allowing app settings to be set. - * - * @param the type of the resource - */ - interface WithAppSettings { - /** - * Adds an app setting to the web app. - * - * @param key the key for the app setting - * @param value the value for the app setting - * @return the next stage of the web app update - */ - Update withAppSetting(String key, String value); - - /** - * Specifies the app settings for the web app as a {@link Map}. - * - * @param settings a {@link Map} of app settings - * @return the next stage of the web app update - */ - Update withAppSettings(Map settings); - - /** - * Adds an app setting to the web app. This app setting will stay at the slot during a swap. - * - * @param key the key for the app setting - * @param value the value for the app setting - * @return the next stage of the web app update - */ - Update withStickyAppSetting(String key, String value); - - /** - * Specifies the app settings for the web app as a {@link Map}. These app settings will stay at the slot - * during a swap. - * - * @param settings a {@link Map} of app settings - * @return the next stage of the web app update - */ - Update withStickyAppSettings(Map settings); - - /** - * Removes an app setting from the web app. - * - * @param key the key of the app setting to remove - * @return the next stage of the web app update - */ - Update withoutAppSetting(String key); - - /** - * Changes the stickiness of an app setting. - * - * @param key the key of the app setting to change stickiness - * @param sticky true if the app setting sticks to the slot during a swap - * @return the next stage of the web app update - */ - Update withAppSettingStickiness(String key, boolean sticky); - } - - /** - * A web app update stage allowing connection strings to be set. - * - * @param the type of the resource - */ - interface WithConnectionString { - /** - * Adds a connection string to the web app. - * - * @param name the name of the connection string - * @param value the connection string value - * @param type the connection string type - * @return the next stage of the web app update - */ - Update withConnectionString(String name, String value, ConnectionStringType type); - - /** - * Adds a connection string to the web app. This connection string will stay at the slot during a swap. - * - * @param name the name of the connection string - * @param value the connection string value - * @param type the connection string type - * @return the next stage of the web app update - */ - Update withStickyConnectionString(String name, String value, ConnectionStringType type); - - /** - * Removes a connection string from the web app. - * - * @param name the name of the connection string - * @return the next stage of the web app update - */ - Update withoutConnectionString(String name); - - /** - * Changes the stickiness of a connection string. - * - * @param name the name of the connection string - * @param sticky true if the connection string sticks to the slot during a swap - * @return the next stage of the web app update - */ - Update withConnectionStringStickiness(String name, boolean sticky); - } - - /** - * A web app update stage allowing source control to be set. - * - * @param the type of the resource - */ - interface WithSourceControl { - /** - * Starts the definition of a new source control. - * - * @return the first stage of a source control definition - */ - WebAppSourceControl.UpdateDefinitionStages.Blank> defineSourceControl(); - - /** - * Removes source control for deployment from the web app. - * - * @return the next stage of the web app update - */ - Update withoutSourceControl(); - - /** - * Specifies the source control to be a local Git repository on the web app. - * - * @return the next stage of the web app update - */ - Update withLocalGitSourceControl(); - } - - /** - * A web app definition stage allowing authentication to be set. - * - * @param the type of the resource - */ - interface WithAuthentication { - /** - * Specifies the definition of a new authentication configuration. - * - * @return the first stage of an authentication definition - */ - WebAppAuthentication.UpdateDefinitionStages.Blank> defineAuthentication(); - - /** - * Turns off the authentication on the web app. - * - * @return the next stage of the web app update - */ - Update withoutAuthentication(); - } - - /** - * A web app definition stage allowing diagnostic logging to be set. - * - * @param the type of the resource - */ - interface WithDiagnosticLogging { - /** - * Specifies the update of an existing diagnostic logs configuration. - * - * @return the first stage of an diagnostic logs update - */ - WebAppDiagnosticLogs.UpdateStages.Blank> updateDiagnosticLogsConfiguration(); - - /** - * Specifies the configuration for container logging for Linux web apps. - * - * @param quotaInMB the limit that restricts file system usage by app diagnostics logs. Value can range from - * 25 MB and 100 MB. - * @param retentionDays maximum days of logs that will be available - * @return the next stage of the web app update - */ - Update withContainerLoggingEnabled(int quotaInMB, int retentionDays); - - /** - * Specifies the configuration for container logging for Linux web apps. Logs will be stored on the file - * system for up to 35 MB. - * - * @return the next stage of the web app update - */ - Update withContainerLoggingEnabled(); - - /** - * Disable the container logging for Linux web apps. - * - * @return the next stage of the web app update - */ - Update withContainerLoggingDisabled(); - } - - /** - * A web app definition stage allowing System Assigned Managed Service Identity to be set. - * - * @param the type of the resource - */ - interface WithManagedServiceIdentity { - /** - * Specifies that System Assigned Managed Service Identity needs to be enabled in the web app. - * - * @return the next stage of the web app definition - */ - Update withSystemAssignedManagedServiceIdentity(); - - /** - * Specifies that User Assigned Managed Service Identity needs to be enabled in the web app. - * - * @return the next stage of the web app definition - */ - Update withUserAssignedManagedServiceIdentity(); - } - - /** - * The stage of the System Assigned (Local) Managed Service Identity enabled web app allowing to set access role - * for the identity. - * - * @param the type of the resource - */ - interface WithSystemAssignedIdentityBasedAccess { - /** - * Specifies that web app's system assigned (local) identity should have the given access (described by the - * role) on an ARM resource identified by the resource ID. Applications running on the web app will have the - * same permission (role) on the ARM resource. - * - * @param resourceId the ARM identifier of the resource - * @param role access role to assigned to the web app's local identity - * @return the next stage of the update - */ - Update withSystemAssignedIdentityBasedAccessTo(String resourceId, BuiltInRole role); - - /** - * Specifies that web app's system assigned (local) identity should have the given access (described by the - * role) on the resource group that web app resides. Applications running on the web app will have the same - * permission (role) on the resource group. - * - * @param role access role to assigned to the web app's local identity - * @return the next stage of the update - */ - Update withSystemAssignedIdentityBasedAccessToCurrentResourceGroup(BuiltInRole role); - - /** - * Specifies that web app's system assigned (local) identity should have the access (described by the role - * definition) on an ARM resource identified by the resource ID. Applications running on the web app will - * have the same permission (role) on the ARM resource. - * - * @param resourceId scope of the access represented in ARM resource ID format - * @param roleDefinitionId access role definition to assigned to the web app's local identity - * @return the next stage of the update - */ - Update withSystemAssignedIdentityBasedAccessTo(String resourceId, String roleDefinitionId); - - /** - * Specifies that web app's system assigned (local) identity should have the access (described by the role - * definition) on the resource group that web app resides. Applications running on the web app will have the - * same permission (role) on the resource group. - * - * @param roleDefinitionId access role definition to assigned to the web app's local identity - * @return the next stage of the update - */ - Update withSystemAssignedIdentityBasedAccessToCurrentResourceGroup(String roleDefinitionId); - } - - /** The stage of storage account update allowing to configure network access. */ - interface WithNetworkAccess { - /** - * Specifies that access to web app should be allowed from all networks. - * - * @return the next stage of the update - */ - Update withAccessFromAllNetworks(); - - /** - * Specifies that access to the web app from the specific virtual network subnet should be allowed. - * - * Allowing any specific access will add a Deny Any rule with least priority. - * - * @param subnetId the virtual network subnet id - * @param priority the priority of the rule - * @return the next stage of the update - */ - Update withAccessFromNetworkSubnet(String subnetId, int priority); - - /** - * Specifies that access to the web app from the specific ip address should be allowed. - * - * Allowing any specific access will add a Deny Any rule with least priority. - * - * @param ipAddress the ip address - * @param priority the priority of the rule - * @return the next stage of the update - */ - Update withAccessFromIpAddress(String ipAddress, int priority); - - /** - * Specifies that access to the web app from the specific ip range should be allowed. - * - * Allowing any specific access will add a Deny Any rule with least priority. - * - * @param ipAddressCidr the ip address range expressed in cidr format - * @param priority the priority of the rule - * @return the next stage of the update - */ - Update withAccessFromIpAddressRange(String ipAddressCidr, int priority); - - /** - * Specifies that the ip security rule. - * - * Allowing any specific access will add a Deny Any rule with least priority. - * - * @param ipSecurityRule the ip security rule - * @return the next stage of the update - */ - Update withAccessRule(IpSecurityRestriction ipSecurityRule); - - /** - * Specifies that previously allowed access from specific virtual network subnet should be removed. - * - * @param subnetId the virtual network subnet id - * @return the next stage of the update - */ - Update withoutNetworkSubnetAccess(String subnetId); - - /** - * Specifies that previously allowed access from specific ip address should be removed. - * - * @param ipAddress the ip address - * @return the next stage of the update - */ - Update withoutIpAddressAccess(String ipAddress); - - /** - * Specifies that the access rule should be removed. - * - * @param ipSecurityRule the ip security rule - * @return the next stage of the update - */ - Update withoutAccessRule(IpSecurityRestriction ipSecurityRule); - - /** - * Specifies that previously allowed access from specific ip range should be removed. - * - * @param ipAddressCidr the ip address range expressed in cidr format - * @return the next stage of the update - */ - Update withoutIpAddressRangeAccess(String ipAddressCidr); - } - } - - /** - * The template for a site update operation, containing all the settings that can be modified. - * - * @param the type of the resource - */ - interface Update - extends Appliable, - GroupableResource.UpdateWithTags>, - UpdateStages.WithClientAffinityEnabled, - UpdateStages.WithClientCertEnabled, - UpdateStages.WithScmSiteAlsoStopped, - UpdateStages.WithSiteConfigs, - UpdateStages.WithAppSettings, - UpdateStages.WithConnectionString, - UpdateStages.WithSourceControl, - UpdateStages.WithHostNameBinding, - UpdateStages.WithHostNameSslBinding, - UpdateStages.WithAuthentication, - UpdateStages.WithDiagnosticLogging, - UpdateStages.WithManagedServiceIdentity, - UpdateStages.WithSystemAssignedIdentityBasedAccess, - UpdateStages.WithNetworkAccess { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebAppBasic.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebAppBasic.java deleted file mode 100644 index cc97f0db1d29..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebAppBasic.java +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; - -/** - * An immutable client-side representation of an Azure Web App. - */ -public interface WebAppBasic extends WebSiteBase, Refreshable { -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebAppCollection.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebAppCollection.java deleted file mode 100644 index bde26ee9ef11..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebAppCollection.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.models.SiteInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Collection of App Service apps. */ -@Fluent -public final class WebAppCollection { - @JsonIgnore private final ClientLogger logger = new ClientLogger(WebAppCollection.class); - - /* - * Collection of resources. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * Link to next page of resources. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: Collection of resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Collection of resources. - * - * @param value the value value to set. - * @return the WebAppCollection object itself. - */ - public WebAppCollection withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to next page of resources. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model WebAppCollection")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebAppDiagnosticLogs.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebAppDiagnosticLogs.java deleted file mode 100644 index fe59c2785a82..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebAppDiagnosticLogs.java +++ /dev/null @@ -1,544 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.appservice.models.WebAppDiagnosticLogs.UpdateStages.Update; -import com.azure.resourcemanager.appservice.fluent.models.SiteLogsConfigInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasParent; -import com.azure.resourcemanager.resources.fluentcore.model.Attachable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.model.Indexable; -import com.azure.resourcemanager.resources.fluentcore.model.Settable; - -/** A web app diagnostic log configuration in a web app. */ -@Fluent -public interface WebAppDiagnosticLogs extends HasInnerModel, Indexable, HasParent { - /** @return application log level on file system */ - LogLevel applicationLoggingFileSystemLogLevel(); - - /** @return Azure Storage Blob container URL for storing application logs */ - String applicationLoggingStorageBlobContainer(); - - /** @return application log level on Azure Storage Blob */ - LogLevel applicationLoggingStorageBlobLogLevel(); - - /** @return application log retention days on Azure Storage Blob */ - int applicationLoggingStorageBlobRetentionDays(); - - /** @return web server quota in MB on file system */ - int webServerLoggingFileSystemQuotaInMB(); - - /** @return web server log retention days on file system */ - int webServerLoggingFileSystemRetentionDays(); - - /** @return web server log retention days on Azure Storage Blob */ - int webServerLoggingStorageBlobRetentionDays(); - - /** @return Azure Storage Blob container URL for storing web server logs */ - String webServerLoggingStorageBlobContainer(); - - /** @return if diagnostic information on failed requests should be gathered */ - boolean failedRequestsTracing(); - - /** @return if detailed error messages should be gathered */ - boolean detailedErrorMessages(); - - /** - * The entirety of a web app diagnostic log definition. - * - * @param the return type of the final {@link Attachable#attach()} - */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithDiagnosticLogging, - DefinitionStages.WithApplicationLogLevel, - DefinitionStages.WithStorageLocationForApplication, - DefinitionStages.WithStorageLocationForWebServer, - DefinitionStages.WithAttachForWebServerStorage, - DefinitionStages.WithAttachForWebServerFileSystem, - DefinitionStages.WithAttachForApplicationStorage { - } - - /** Grouping of web app diagnostic log definition stages applicable as part of a web app creation. */ - interface DefinitionStages { - /** - * The first stage of a web app diagnostic log definition as part of a definition of a web app. - * - * @param the return type of the final {@link Attachable#attach()} - */ - interface Blank extends WithDiagnosticLogging { - } - - /** - * A web app diagnostic log definition allowing the log source to be set. - * - * @param the return type of the final {@link Attachable#attach()} - */ - interface WithDiagnosticLogging { - /** - * Enable logging from the web application. - * - * @return the next stage of the definition - */ - WithApplicationLogLevel withApplicationLogging(); - - /** - * Enable logging from the web server. - * - * @return the next stage of the definition - */ - WithStorageLocationForWebServer withWebServerLogging(); - } - - /** - * A web app diagnostic log definition allowing detailed error messages to be specified. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithDetailedErrorMessages { - /** - * Specifies if detailed error messages should be gathered from the web app. - * - * @param enabled true if detailed error messages should be gathered - * @return the next stage of the definition - */ - WithAttach withDetailedErrorMessages(boolean enabled); - } - - /** - * A web app diagnostic log definition allowing failed request tracing to be specified. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithFailedRequestTracing { - /** - * Specifies if diagnostic information on failed requests should be gathered. - * - * @param enabled true if diagnostic information on failed requests should be gathered - * @return the next stage of the definition - */ - WithAttach withFailedRequestTracing(boolean enabled); - } - - /** - * A web app diagnostic log definition allowing application log storage location to be specified. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithStorageLocationForApplication { - /** - * Specifies the storage location of application logs to be on the file system. - * - * @return the next stage of the definition - */ - WithAttach withApplicationLogsStoredOnFileSystem(); - - /** - * Specifies the storage location of application logs to be on in a Storage blob. - * - * @param containerSasUrl the URL to the container including the SAS token - * @return the next stage of the definition - */ - WithAttachForApplicationStorage withApplicationLogsStoredOnStorageBlob(String containerSasUrl); - } - - /** - * A web app diagnostic log definition allowing web server log storage location to be specified. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithStorageLocationForWebServer { - /** - * Specifies the storage location of web server logs to be on the file system. - * - * @return the next stage of the definition - */ - WithAttachForWebServerFileSystem withWebServerLogsStoredOnFileSystem(); - - /** - * Specifies the storage location of web server logs to be on in a Storage blob. - * - * @param containerSasUrl the URL to the container including the SAS token - * @return the next stage of the definition - */ - WithAttachForWebServerStorage withWebServerLogsStoredOnStorageBlob(String containerSasUrl); - } - - /** - * A web app diagnostic log definition allowing application log level to be specified. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithApplicationLogLevel { - /** - * Specifies the application log level. - * - * @param logLevel the application log level - * @return the next stage of the definition - */ - WithStorageLocationForApplication withLogLevel(LogLevel logLevel); - } - - /** - * A web app diagnostic log definition allowing web server file system logging quota to be specified. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithQuota { - /** - * Specifies the maximum size of logs allowed on the file system (in MB). - * - * @param quotaInMB the maximum size of logs allowed (in MB). Must be between 25 and 100. - * @return the next stage of the definition - */ - WithAttachForWebServerFileSystem withWebServerFileSystemQuotaInMB(int quotaInMB); - } - - /** - * A web app diagnostic log definition allowing retention days to be specified. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithRetentionDays { - /** - * Specifies the maximum days of logs to keep. Logs older than this will be deleted. - * - * @param retentionDays the maximum days of logs to keep - * @return the next stage of the definition - */ - WithAttach withLogRetentionDays(int retentionDays); - - /** - * Specifies the logs will not be deleted beyond a certain time. - * - * @return the next stage of the definition - */ - WithAttach withUnlimitedLogRetentionDays(); - } - - /** - * The final stage of the web app diagnostic log definition, plus extra settings for application logs stored in - * a Storage blob. - * - *

At this stage, any remaining optional settings can be specified, or the web app diagnostic log definition - * can be attached to the parent web app definition using {@link WithAttach#attach()}. - * - * @param the return type of {@link WithAttach#attach()} - */ - interface WithAttachForApplicationStorage extends WithAttach, WithRetentionDays { - } - - /** - * The final stage of the web app diagnostic log definition, plus extra settings for web server logs stored in a - * Storage blob. - * - *

At this stage, any remaining optional settings can be specified, or the web app diagnostic log definition - * can be attached to the parent web app definition using {@link WithAttach#attach()}. - * - * @param the return type of {@link WithAttach#attach()} - */ - interface WithAttachForWebServerStorage extends WithAttach, WithRetentionDays { - } - - /** - * The final stage of the web app diagnostic log definition, plus extra settings for web server logs stored in - * the file system. - * - *

At this stage, any remaining optional settings can be specified, or the web app diagnostic log definition - * can be attached to the parent web app definition using {@link WithAttach#attach()}. - * - * @param the return type of {@link WithAttach#attach()} - */ - interface WithAttachForWebServerFileSystem - extends WithAttach, WithQuota, WithRetentionDays { - } - - /** - * The final stage of the web app diagnostic log definition. - * - *

At this stage, any remaining optional settings can be specified, or the web app diagnostic log definition - * can be attached to the parent web app definition using {@link WithAttach#attach()}. - * - * @param the return type of {@link WithAttach#attach()} - */ - interface WithAttach - extends Attachable.InDefinition, - DefinitionStages.WithDetailedErrorMessages, - DefinitionStages.WithFailedRequestTracing { - } - } - - /** - * The entirety of a web app diagnostic log definition as part of a web app update. - * - * @param the return type of the final {@link Update#parent()} ()} - */ - interface UpdateDefinition - extends UpdateStages.Blank, - UpdateStages.Update, - UpdateStages.WithDiagnosticLogging, - UpdateStages.WithApplicationLogLevel, - UpdateStages.WithStorageLocationForApplication, - UpdateStages.WithStorageLocationForWebServer, - UpdateStages.WithAttachForWebServerStorage, - UpdateStages.WithAttachForWebServerFileSystem, - UpdateStages.WithAttachForApplicationStorage { - } - - /** Grouping of web app diagnostic log update stages applicable as part of a web app update. */ - interface UpdateStages { - /** - * The first stage of a web app diagnostic log update as part of a update of a web app. - * - * @param the return type of the final {@link Attachable#attach()} - */ - interface Blank extends WithDiagnosticLogging { - } - - /** - * A web app diagnostic log update allowing the log source to be set. - * - * @param the return type of the final {@link Attachable#attach()} - */ - interface WithDiagnosticLogging { - /** - * Enable logging from the web application. - * - * @return the next stage of the update - */ - WithApplicationLogLevel withApplicationLogging(); - - /** - * Disable logging from the web application. - * - * @return the next stage of the update - */ - Update withoutApplicationLogging(); - - /** - * Enable logging from the web server. - * - * @return the next stage of the update - */ - WithStorageLocationForWebServer withWebServerLogging(); - - /** - * Disable logging from the web server. - * - * @return the next stage of the update - */ - Update withoutWebServerLogging(); - } - - /** - * A web app diagnostic log update allowing detailed error messages to be specified. - * - * @param the stage of the parent update to return to after attaching this update - */ - interface WithDetailedErrorMessages { - /** - * Specifies if detailed error messages should be gathered from the web app. - * - * @param enabled true if detailed error messages should be gathered - * @return the next stage of the update - */ - Update withDetailedErrorMessages(boolean enabled); - } - - /** - * A web app diagnostic log update allowing failed request tracing to be specified. - * - * @param the stage of the parent update to return to after attaching this update - */ - interface WithFailedRequestTracing { - /** - * Specifies if diagnostic information on failed requests should be gathered. - * - * @param enabled true if diagnostic information on failed requests should be gathered - * @return the next stage of the update - */ - Update withFailedRequestTracing(boolean enabled); - } - - /** - * A web app diagnostic log update allowing application log storage location to be specified. - * - * @param the stage of the parent update to return to after attaching this update - */ - interface WithStorageLocationForApplication { - /** - * Specifies the storage location of application logs to be on the file system. - * - * @return the next stage of the update - */ - Update withApplicationLogsStoredOnFileSystem(); - - /** - * Specifies the storage location of application logs to be on in a Storage blob. - * - * @param containerSasUrl the URL to the container including the SAS token - * @return the next stage of the update - */ - WithAttachForApplicationStorage withApplicationLogsStoredOnStorageBlob(String containerSasUrl); - } - - /** - * A web app diagnostic log update allowing application log storage location to be specified. - * - * @param the stage of the parent update to return to after attaching this update - */ - interface WithoutStorageLocationForApplication { - /** - * Stops application logs to be stored on the file system. - * - * @return the next stage of the update - */ - Update withoutApplicationLogsStoredOnFileSystem(); - - /** - * Stops application logs to be stored on in a Storage blob. - * - * @return the next stage of the update - */ - Update withoutApplicationLogsStoredOnStorageBlob(); - } - - /** - * A web app diagnostic log update allowing web server log storage location to be specified. - * - * @param the stage of the parent update to return to after attaching this update - */ - interface WithStorageLocationForWebServer { - /** - * Specifies the storage location of web server logs to be on the file system. - * - * @return the next stage of the definition - */ - WithAttachForWebServerFileSystem withWebServerLogsStoredOnFileSystem(); - - /** - * Specifies the storage location of web server logs to be on in a Storage blob. - * - * @param containerSasUrl the URL to the container including the SAS token - * @return the next stage of the update - */ - WithAttachForWebServerStorage withWebServerLogsStoredOnStorageBlob(String containerSasUrl); - - /** - * Stops web server logs to be stored on the file system. - * - * @return the next stage of the update - */ - Update withoutWebServerLogsStoredOnFileSystem(); - - /** - * Stops web server logs to be stored on in a Storage blob. - * - * @return the next stage of the update - */ - Update withoutWebServerLogsStoredOnStorageBlob(); - } - - /** - * A web app diagnostic log update allowing application log level to be specified. - * - * @param the stage of the parent update to return to after attaching this update - */ - interface WithApplicationLogLevel extends WithoutStorageLocationForApplication { - /** - * Specifies the application log level. - * - * @param logLevel the application log level - * @return the next stage of the update - */ - WithStorageLocationForApplication withLogLevel(LogLevel logLevel); - } - - /** - * A web app diagnostic log update allowing web server file system logging quota to be specified. - * - * @param the stage of the parent update to return to after attaching this update - */ - interface WithQuota { - /** - * Specifies the maximum size of logs allowed on the file system (in MB). - * - * @param quotaInMB the maximum size of logs allowed (in MB). Must be between 25 and 100. - * @return the next stage of the update - */ - WithAttachForWebServerFileSystem withWebServerFileSystemQuotaInMB(int quotaInMB); - } - - /** - * A web app diagnostic log update allowing retention days to be specified. - * - * @param the stage of the parent update to return to after attaching this update - */ - interface WithRetentionDays { - /** - * Specifies the maximum days of logs to keep. Logs older than this will be deleted. - * - * @param retentionDays the maximum days of logs to keep - * @return the next stage of the update - */ - Update withLogRetentionDays(int retentionDays); - - /** - * Specifies the logs will not be deleted beyond a certain time. - * - * @return the next stage of the update - */ - Update withUnlimitedLogRetentionDays(); - } - - /** - * The final stage of the web app diagnostic log update, plus extra settings for application logs stored in a - * Storage blob. - * - *

At this stage, any remaining optional settings can be specified, or the web app diagnostic log update can - * be attached to the parent web app update using {@link Update#parent()}. - * - * @param the return type of {@link Update#parent()} - */ - interface WithAttachForApplicationStorage extends Update, WithRetentionDays { - } - - /** - * The final stage of the web app diagnostic log update, plus extra settings for web server logs stored in a - * Storage blob. - * - *

At this stage, any remaining optional settings can be specified, or the web app diagnostic log update can - * be attached to the parent web app update using {@link Update#parent()}. - * - * @param the return type of {@link Update#parent()} - */ - interface WithAttachForWebServerStorage extends Update, WithRetentionDays { - } - - /** - * The final stage of the web app diagnostic log update, plus extra settings for web server logs stored in the - * file system. - * - *

At this stage, any remaining optional settings can be specified, or the web app diagnostic log update can - * be attached to the parent web app update using {@link Update#parent()}. - * - * @param the return type of {@link Update#parent()} - */ - interface WithAttachForWebServerFileSystem - extends Update, WithQuota, WithRetentionDays { - } - - /** - * The final stage of the web app diagnostic log update. - * - *

At this stage, any remaining optional settings can be specified, or the web app diagnostic log update can - * be attached to the parent web app update using {@link Update#parent()}. - * - * @param the return type of {@link Update#parent()} - */ - interface Update - extends Settable, WithDetailedErrorMessages, WithFailedRequestTracing { - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebAppInstanceCollection.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebAppInstanceCollection.java deleted file mode 100644 index c55cd3315c54..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebAppInstanceCollection.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.models.SiteInstanceInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Collection of app instances. */ -@Fluent -public final class WebAppInstanceCollection { - @JsonIgnore private final ClientLogger logger = new ClientLogger(WebAppInstanceCollection.class); - - /* - * Collection of resources. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * Link to next page of resources. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: Collection of resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Collection of resources. - * - * @param value the value value to set. - * @return the WebAppInstanceCollection object itself. - */ - public WebAppInstanceCollection withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to next page of resources. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model WebAppInstanceCollection")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebAppRuntimeStack.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebAppRuntimeStack.java deleted file mode 100644 index f6b3fd5010e1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebAppRuntimeStack.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import java.util.Objects; - -/** Defines web app runtime stack on Windows operating system. */ -@Fluent -public class WebAppRuntimeStack { - - /** .NET Core. */ - public static final WebAppRuntimeStack NETCORE = new WebAppRuntimeStack("dotnetcore"); - - /** .NET Framework. */ - public static final WebAppRuntimeStack NET = new WebAppRuntimeStack("dotnet"); - - /** PHP. */ - public static final WebAppRuntimeStack PHP = new WebAppRuntimeStack("php"); - - /** Python. */ - public static final WebAppRuntimeStack PYTHON = new WebAppRuntimeStack("python"); - - /** Java. */ - public static final WebAppRuntimeStack JAVA = new WebAppRuntimeStack("java"); - - private final String runtime; - - /** - * Creates a custom web app runtime stack on Windows operating system. - * - * @param runtime the language runtime - */ - public WebAppRuntimeStack(String runtime) { - this.runtime = Objects.requireNonNull(runtime); - } - - /** @return the name of the language runtime */ - public String runtime() { - return runtime; - } - - @Override - public String toString() { - return runtime; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - WebAppRuntimeStack that = (WebAppRuntimeStack) o; - return runtime.equals(that.runtime); - } - - @Override - public int hashCode() { - return Objects.hash(runtime); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebAppSourceControl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebAppSourceControl.java deleted file mode 100644 index aa46688ebae3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebAppSourceControl.java +++ /dev/null @@ -1,306 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.appservice.fluent.models.SiteSourceControlInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.ChildResource; -import com.azure.resourcemanager.resources.fluentcore.model.Attachable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; - -/** An immutable representation of a web app source control configuration in a web app. */ -@Fluent -public interface WebAppSourceControl extends HasInnerModel, ChildResource { - /** @return the repository or source control url */ - String repositoryUrl(); - - /** @return the name of the branch to use for deployment */ - String branch(); - - /** @return whether to do manual or continuous integration */ - boolean isManualIntegration(); - - /** @return whether deployment rollback is enabled */ - boolean deploymentRollbackEnabled(); - - /** @return mercurial or Git repository type */ - RepositoryType repositoryType(); - - /** - * The entirety of a web app source control definition. - * - * @param the return type of the final {@link Attachable#attach()} - */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithAttach, - DefinitionStages.GitHubWithAttach, - DefinitionStages.WithRepositoryType, - DefinitionStages.WithBranch, - DefinitionStages.WithGitHubBranch { - } - - /** Grouping of web app source control definition stages applicable as part of a web app creation. */ - interface DefinitionStages { - /** - * The first stage of a web app source control definition as part of a definition of a web app. - * - * @param the return type of the final {@link Attachable#attach()} - */ - interface Blank extends WithRepositoryType { - } - - /** - * A web app source control definition allowing repository type to be specified. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithRepositoryType { - /** - * Specifies the repository to be a public external repository, either Git or Mercurial. Continuous - * integration will not be turned on. - * - * @param url the url of the Git repository - * @return the next stage of the definition - */ - WithBranch withPublicGitRepository(String url); - - /** - * Specifies the repository to be a public external repository, either Git or Mercurial. Continuous - * integration will not be turned on. - * - * @param url the url of the Mercurial repository - * @return the next stage of the definition - */ - WithBranch withPublicMercurialRepository(String url); - - /** - * Specifies the repository to be a GitHub repository. Continuous integration will be turned on. This - * repository can be either public or private, but your GitHub access token must have enough privileges to - * add a webhook to the repository. - * - * @param organization the user name or organization name the GitHub repository belongs to, e.g. Azure - * @param repository the name of the repository, e.g. azure-sdk-for-java - * @return the next stage of the definition - */ - WithGitHubBranch withContinuouslyIntegratedGitHubRepository( - String organization, String repository); - - /** - * Specifies the repository to be a GitHub repository. Continuous integration will be turned on. This - * repository can be either public or private, but your GitHub access token must have enough privileges to - * add a webhook to the repository. - * - * @param url the URL pointing to the repository, e.g. https://github.com/Azure/azure-sdk-for-java - * @return the next stage of the definition - */ - WithGitHubBranch withContinuouslyIntegratedGitHubRepository(String url); - } - - /** - * A web app source control definition allowing branch to be specified. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithBranch { - /** - * Specifies the branch in the repository to use. - * - * @param branch the branch to use - * @return the next stage of the definition - */ - WithAttach withBranch(String branch); - } - - /** - * A web app source control definition allowing branch to be specified. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithGitHubBranch { - /** - * Specifies the branch in the repository to use. - * - * @param branch the branch to use - * @return the next stage of the definition - */ - GitHubWithAttach withBranch(String branch); - } - - /** - * A web app source control definition allowing GitHub access token to be specified. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithGitHubAccessToken { - /** - * Specifies the GitHub personal access token. You can acquire one from https://github.com/settings/tokens. - * - * @param personalAccessToken the personal access token from GitHub. - * @return the next stage of the definition - */ - GitHubWithAttach withGitHubAccessToken(String personalAccessToken); - } - - /** - * The final stage of the web app source control definition. - * - *

At this stage, any remaining optional settings can be specified, or the web app source control definition - * can be attached to the parent web app definition using {@link WithAttach#attach()}. - * - * @param the return type of {@link WithAttach#attach()} - */ - interface WithAttach extends Attachable.InDefinition { - } - - /** - * The final stage of the web app source control definition that binds to a GitHub account. - * - *

At this stage, any remaining optional settings can be specified, or the web app source control definition - * can be attached to the parent web app definition using {@link WithAttach#attach()}. - * - * @param the return type of {@link WithAttach#attach()} - */ - interface GitHubWithAttach extends WithAttach, WithGitHubAccessToken { - } - } - - /** - * The entirety of a web app source control definition as part of a web app update. - * - * @param the return type of the final {@link UpdateDefinitionStages.WithAttach#attach()} - */ - interface UpdateDefinition - extends UpdateDefinitionStages.Blank, - UpdateDefinitionStages.WithAttach, - UpdateDefinitionStages.GitHubWithAttach, - UpdateDefinitionStages.WithRepositoryType, - UpdateDefinitionStages.WithBranch, - UpdateDefinitionStages.WithGitHubBranch { - } - - /** Grouping of web app source control definition stages applicable as part of a web app update. */ - interface UpdateDefinitionStages { - /** - * The first stage of a web app source control definition as part of an update of a web app. - * - * @param the return type of the final {@link Attachable#attach()} - */ - interface Blank extends WithRepositoryType { - } - - /** - * A web app source control definition allowing repository type to be specified. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithRepositoryType { - /** - * Specifies the repository to be a public external repository, either Git or Mercurial. Continuous - * integration will not be turned on. - * - * @param url the url of the Git repository - * @return the next stage of the definition - */ - WithBranch withPublicGitRepository(String url); - - /** - * Specifies the repository to be a public external repository, either Git or Mercurial. Continuous - * integration will not be turned on. - * - * @param url the url of the Mercurial repository - * @return the next stage of the definition - */ - WithBranch withPublicMercurialRepository(String url); - - /** - * Specifies the repository to be a GitHub repository. Continuous integration will be turned on. This - * repository can be either public or private, but your GitHub access token must have enough privileges to - * add a webhook to the repository. - * - * @param organization the user name or organization name the GitHub repository belongs to, e.g. Azure - * @param repository the name of the repository, e.g. azure-sdk-for-java - * @return the next stage of the definition - */ - WithGitHubBranch withContinuouslyIntegratedGitHubRepository( - String organization, String repository); - - /** - * Specifies the repository to be a GitHub repository. Continuous integration will be turned on. This - * repository can be either public or private, but your GitHub access token must have enough privileges to - * add a webhook to the repository. - * - * @param url the URL pointing to the repository, e.g. https://github.com/Azure/azure-sdk-for-java - * @return the next stage of the definition - */ - WithGitHubBranch withContinuouslyIntegratedGitHubRepository(String url); - } - - /** - * A web app source control definition allowing branch to be specified. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithBranch { - /** - * Specifies the branch in the repository to use. - * - * @param branch the branch to use - * @return the next stage of the definition - */ - WithAttach withBranch(String branch); - } - - /** - * A web app source control definition allowing branch to be specified. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithGitHubBranch { - /** - * Specifies the branch in the repository to use. - * - * @param branch the branch to use - * @return the next stage of the definition - */ - GitHubWithAttach withBranch(String branch); - } - - /** - * A web app source control definition allowing GitHub access token to be specified. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithGitHubAccessToken { - /** - * Specifies the GitHub personal access token. You can acquire one from https://github.com/settings/tokens. - * - * @param personalAccessToken the personal access token from GitHub. - * @return the next stage of the definition - */ - GitHubWithAttach withGitHubAccessToken(String personalAccessToken); - } - - /** - * The final stage of the web app source control definition. - * - *

At this stage, any remaining optional settings can be specified, or the web app source control definition - * can be attached to the parent web app update using {@link WithAttach#attach()}. - * - * @param the return type of {@link WithAttach#attach()} - */ - interface WithAttach extends Attachable.InUpdate { - } - - /** - * The final stage of the web app source control definition that binds to a GitHub account. - * - *

At this stage, any remaining optional settings can be specified, or the web app source control definition - * can be attached to the parent web app update using {@link WithAttach#attach()}. - * - * @param the return type of {@link WithAttach#attach()} - */ - interface GitHubWithAttach extends WithAttach, WithGitHubAccessToken { - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebApps.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebApps.java deleted file mode 100644 index 9dd7d734dac4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebApps.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.appservice.AppServiceManager; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsDeletingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsListingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsCreating; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingById; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; - -/** Entry point for web app management API. */ -@Fluent -public interface WebApps - extends SupportsCreating, - SupportsDeletingById, - SupportsListing, - SupportsListingByResourceGroup, - SupportsGettingByResourceGroup, - SupportsGettingById, - SupportsDeletingByResourceGroup, - HasManager { -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebContainer.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebContainer.java deleted file mode 100644 index e1f6d7eea980..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebContainer.java +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.util.ExpandableStringEnum; - -import java.util.Collection; - -/** Defines values for Java web container. */ -public final class WebContainer extends ExpandableStringEnum { - /** Static value tomcat 7.0 newest for WebContainer. */ - public static final WebContainer TOMCAT_7_0_NEWEST = WebContainer.fromString("tomcat 7.0"); - - /** Static value tomcat 7.0.50 for WebContainer. */ - public static final WebContainer TOMCAT_7_0_50 = WebContainer.fromString("tomcat 7.0.50"); - - /** Static value tomcat 7.0.62 for WebContainer. */ - public static final WebContainer TOMCAT_7_0_62 = WebContainer.fromString("tomcat 7.0.62"); - - /** Static value tomcat 8.0 newest for WebContainer. */ - public static final WebContainer TOMCAT_8_0_NEWEST = WebContainer.fromString("tomcat 8.0"); - - /** Static value tomcat 8.0.23 for WebContainer. */ - public static final WebContainer TOMCAT_8_0_23 = WebContainer.fromString("tomcat 8.0.23"); - - /** Static value tomcat 8.5 newest for WebContainer. */ - public static final WebContainer TOMCAT_8_5_NEWEST = WebContainer.fromString("tomcat 8.5"); - - /** Static value tomcat 8.5.6 for WebContainer. */ - public static final WebContainer TOMCAT_8_5_6 = WebContainer.fromString("tomcat 8.5.6"); - - /** Static value tomcat 8.5.20 for WebContainer. */ - public static final WebContainer TOMCAT_8_5_20 = WebContainer.fromString("tomcat 8.5.20"); - - /** Static value tomcat 8.5.31 for WebContainer. */ - public static final WebContainer TOMCAT_8_5_31 = WebContainer.fromString("tomcat 8.5.31"); - - /** Static value tomcat 8.5.34 for WebContainer. */ - public static final WebContainer TOMCAT_8_5_34 = WebContainer.fromString("tomcat 8.5.34"); - - /** Static value tomcat 8.5.37 for WebContainer. */ - public static final WebContainer TOMCAT_8_5_37 = WebContainer.fromString("tomcat 8.5.37"); - - /** Static value tomcat 9.0 newest for WebContainer. */ - public static final WebContainer TOMCAT_9_0_NEWEST = WebContainer.fromString("tomcat 9.0"); - - /** Static value tomcat 9_0_0 for WebContainer. */ - public static final WebContainer TOMCAT_9_0_0 = WebContainer.fromString("tomcat 9.0.0"); - - /** Static value tomcat 9_0_8 for WebContainer. */ - public static final WebContainer TOMCAT_9_0_8 = WebContainer.fromString("tomcat 9.0.8"); - - /** Static value tomcat 9_0_12 for WebContainer. */ - public static final WebContainer TOMCAT_9_0_12 = WebContainer.fromString("tomcat 9.0.12"); - - /** Static value tomcat 9_0_14 for WebContainer. */ - public static final WebContainer TOMCAT_9_0_14 = WebContainer.fromString("tomcat 9.0.14"); - - /** Static value jetty 9.1 for WebContainer. */ - public static final WebContainer JETTY_9_1_NEWEST = WebContainer.fromString("jetty 9.1"); - - /** Static value jetty 9.1.0 v20131115 for WebContainer. */ - public static final WebContainer JETTY_9_1_V20131115 = WebContainer.fromString("jetty 9.1.0.20131115"); - - /** Static value jetty 9.3 for WebContainer. */ - public static final WebContainer JETTY_9_3_NEWEST = WebContainer.fromString("jetty 9.3"); - - /** Static value jetty 9.3.13 v20161014 for WebContainer. */ - public static final WebContainer JETTY_9_3_V20161014 = WebContainer.fromString("jetty 9.3.13.20161014"); - - /** Static value java 8 for WebContainer. */ - public static final WebContainer JAVA_8 = WebContainer.fromString("java 8"); - - /** - * Finds or creates a Web container based on the specified name. - * - * @param name a name - * @return a WebContainer instance - */ - public static WebContainer fromString(String name) { - return fromString(name, WebContainer.class); - } - - /** @return known Web container types */ - public static Collection values() { - return values(WebContainer.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebDeployment.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebDeployment.java deleted file mode 100644 index 0f8f67b3c10b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebDeployment.java +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasParent; -import com.azure.resourcemanager.resources.fluentcore.model.Executable; -import java.time.OffsetDateTime; - -/** A client-side representation allowing user to deploy to a web app through web deployment (MSDeploy). */ -@Fluent -public interface WebDeployment extends Executable, HasParent { - /** @return username of the deployer */ - String deployer(); - - /** @return the start time of the deploy operation */ - OffsetDateTime startTime(); - - /** @return the end time of the deploy operation */ - OffsetDateTime endTime(); - - /** @return whether the deployment operation has completed */ - boolean complete(); - - /** The entirety of web deployment parameters definition. */ - interface Definition extends DefinitionStages.WithPackageUri, DefinitionStages.WithExecute { - } - - /** Grouping of web deployment definition stages. */ - interface DefinitionStages { - /** The first stage of a web deployment definition. */ - interface WithPackageUri { - /** - * Specifies the zipped package to deploy. - * - * @param packageUri the URL to the package. It can be a publicly available link to the package zip, or an - * Azure Storage object with a SAS token - * @return the next definition stage - */ - WithExecute withPackageUri(String packageUri); - } - - /** A web deployment definition stage allowing specifying whether to delete existing deployments. */ - interface WithExistingDeploymentsDeleted { - /** - * Specifies whether existing deployed files on the web app should be deleted. - * - * @param deleteExisting if set to true, all files on the web app will be deleted. Default is false. - * @return the next definition stage - */ - WithExecute withExistingDeploymentsDeleted(boolean deleteExisting); - } - - /** A web deployment definition stage allowing adding more packages. */ - interface WithAddOnPackage { - /** - * Adds an extra package to the deployment. - * - * @param packageUri the URL to the package. It can be a publicly available link to the package zip, or an - * Azure Storage object with a SAS token - * @return the next definition stage - */ - WithExecute withAddOnPackage(String packageUri); - } - - /** A web deployment definition stage allowing specifying parameters. */ - interface WithSetParameters { - /** - * Specifies the XML file containing the parameters. - * - * @param fileUri the XML file's URI - * @return the next definition stage - */ - WithExecute withSetParametersXmlFile(String fileUri); - - /** - * Adds a parameter for the deployment. - * - * @param name name of the parameter - * @param value the value of the parameter - * @return the next definition stage - */ - WithExecute withSetParameter(String name, String value); - } - - /** - * The stage of the definition which contains all the minimum required inputs for the resource to be created, - * but also allows for any other optional settings to be specified. - */ - interface WithExecute - extends Executable, WithExistingDeploymentsDeleted, WithAddOnPackage, WithSetParameters { - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebDeploymentSlotBasic.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebDeploymentSlotBasic.java deleted file mode 100644 index 3825a093ab02..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebDeploymentSlotBasic.java +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; - -/** An immutable client-side representation of an Azure Web App deployment slot. */ -public interface WebDeploymentSlotBasic extends WebSiteBase, Refreshable { -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebJobCollection.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebJobCollection.java deleted file mode 100644 index dc9c9da2ee2d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebJobCollection.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.models.WebJobInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Collection of Kudu web job information elements. */ -@Fluent -public final class WebJobCollection { - @JsonIgnore private final ClientLogger logger = new ClientLogger(WebJobCollection.class); - - /* - * Collection of resources. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * Link to next page of resources. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: Collection of resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Collection of resources. - * - * @param value the value value to set. - * @return the WebJobCollection object itself. - */ - public WebJobCollection withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to next page of resources. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model WebJobCollection")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebJobType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebJobType.java deleted file mode 100644 index 4d88c337a35c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebJobType.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for WebJobType. */ -public enum WebJobType { - /** Enum value Continuous. */ - CONTINUOUS("Continuous"), - - /** Enum value Triggered. */ - TRIGGERED("Triggered"); - - /** The actual serialized value for a WebJobType instance. */ - private final String value; - - WebJobType(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a WebJobType instance. - * - * @param value the serialized value to parse. - * @return the parsed WebJobType object, or null if unable to parse. - */ - @JsonCreator - public static WebJobType fromString(String value) { - WebJobType[] items = WebJobType.values(); - for (WebJobType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebSiteBase.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebSiteBase.java deleted file mode 100644 index 9d96f2620c98..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebSiteBase.java +++ /dev/null @@ -1,167 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.resourcemanager.appservice.fluent.models.SiteInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.models.Resource; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; - -import java.time.OffsetDateTime; -import java.util.Map; -import java.util.Set; - -/** - * An immutable client-side representation of an Azure Web App or Function App. - */ -public interface WebSiteBase extends Resource, HasResourceGroup, HasInnerModel { - - /** @return state of the web app */ - String state(); - - /** @return hostnames associated with web app */ - Set hostnames(); - - /** @return name of repository site */ - String repositorySiteName(); - - /** @return state indicating whether web app has exceeded its quota usage */ - UsageState usageState(); - - /** @return true if the site is enabled; otherwise, false */ - boolean enabled(); - - /** @return host names for the web app that are enabled */ - Set enabledHostNames(); - - /** @return management information availability state for the web app */ - SiteAvailabilityState availabilityState(); - - /** @return list of SSL states used to manage the SSL bindings for site's hostnames */ - Map hostnameSslStates(); - - /** @return Last time web app was modified in UTC */ - OffsetDateTime lastModifiedTime(); - - /** @return list of Azure Traffic manager host names associated with web app */ - Set trafficManagerHostNames(); - - /** @return whether to stop SCM (KUDU) site when the web app is stopped. Default is false. */ - boolean scmSiteAlsoStopped(); - - /** @return which slot this app will swap into */ - String targetSwapSlot(); - - /** - * @return if the client affinity is enabled when load balancing http request for multiple instances of the web app - */ - boolean clientAffinityEnabled(); - - /** @return if the client certificate is enabled for the web app */ - boolean clientCertEnabled(); - - /** - * @return if the public hostnames are disabled the web app. If set to true the app is only accessible via API - * Management process. - */ - boolean hostnamesDisabled(); - - /** - * @return list of IP addresses that this web app uses for outbound connections. Those can be used when configuring - * firewall rules for databases accessed by this web app. - */ - Set outboundIPAddresses(); - - /** @return size of a function container */ - int containerSize(); - - /** @return information about whether the web app is cloned from another */ - CloningInfo cloningInfo(); - - /** @return site is a default container */ - boolean isDefaultContainer(); - - /** @return default hostname of the web app */ - String defaultHostname(); - - /** @return true if the web app is configured to accept only HTTPS requests. HTTP requests will be redirected. */ - boolean httpsOnly(); - - /** @return The resource ID of the app service plan */ - String appServicePlanId(); - - /** - * Get the identity property: Managed service identity. - * - * @return the identity value. - */ - ManagedServiceIdentity identity(); - - /** - * Get the hyperV property: Hyper-V sandbox. - * - * @return the hyperV value. - */ - boolean hyperV(); - - /** - * Get the hostingEnvironmentProfile property: App Service Environment to use for the app. - * - * @return the hostingEnvironmentProfile value. - */ - HostingEnvironmentProfile hostingEnvironmentProfile(); - - /** - * Get the clientCertExclusionPaths property: client certificate authentication comma-separated exclusion paths. - * - * @return the clientCertExclusionPaths value. - */ - Set clientCertExclusionPaths(); - - /** - * Get the possibleOutboundIpAddresses property: List of IP addresses that the app uses for outbound connections - * (e.g. database access). Includes VIPs from all tenants except dataComponent. Read-only. - * - * @return the possibleOutboundIpAddresses value. - */ - Set possibleOutboundIpAddresses(); - - /** - * Get the dailyMemoryTimeQuota property: Maximum allowed daily memory-time quota (applicable on dynamic apps only). - * - * @return the dailyMemoryTimeQuota value. - */ - int dailyMemoryTimeQuota(); - - /** - * Get the suspendedTill property: App suspended till in case memory-time quota is exceeded. - * - * @return the suspendedTill value. - */ - OffsetDateTime suspendedTill(); - - /** - * Get the maxNumberOfWorkers property: Maximum number of workers. This only applies to Functions container. - * - * @return the maxNumberOfWorkers value. - */ - int maxNumberOfWorkers(); - - /** - * Get the slotSwapStatus property: Status of the last deployment slot swap operation. - * - * @return the slotSwapStatus value. - */ - SlotSwapStatus slotSwapStatus(); - - /** - * Get the redundancyMode property: Site redundancy mode. - * - * @return the redundancyMode value. - */ - RedundancyMode redundancyMode(); - - /** @return the operating system the web app is running on */ - OperatingSystem operatingSystem(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WorkerPoolCollection.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WorkerPoolCollection.java deleted file mode 100644 index 6b27c53a69e8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WorkerPoolCollection.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.fluent.models.WorkerPoolResourceInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Collection of worker pools. */ -@Fluent -public final class WorkerPoolCollection { - @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkerPoolCollection.class); - - /* - * Collection of resources. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * Link to next page of resources. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: Collection of resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Collection of resources. - * - * @param value the value value to set. - * @return the WorkerPoolCollection object itself. - */ - public WorkerPoolCollection withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to next page of resources. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model WorkerPoolCollection")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WorkerSizeOptions.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WorkerSizeOptions.java deleted file mode 100644 index 6b1dccfea71e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WorkerSizeOptions.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appservice.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for WorkerSizeOptions. */ -public enum WorkerSizeOptions { - /** Enum value Small. */ - SMALL("Small"), - - /** Enum value Medium. */ - MEDIUM("Medium"), - - /** Enum value Large. */ - LARGE("Large"), - - /** Enum value D1. */ - D1("D1"), - - /** Enum value D2. */ - D2("D2"), - - /** Enum value D3. */ - D3("D3"), - - /** Enum value Default. */ - DEFAULT("Default"); - - /** The actual serialized value for a WorkerSizeOptions instance. */ - private final String value; - - WorkerSizeOptions(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a WorkerSizeOptions instance. - * - * @param value the serialized value to parse. - * @return the parsed WorkerSizeOptions object, or null if unable to parse. - */ - @JsonCreator - public static WorkerSizeOptions fromString(String value) { - WorkerSizeOptions[] items = WorkerSizeOptions.values(); - for (WorkerSizeOptions item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/package-info.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/package-info.java deleted file mode 100644 index d1cdaa1c4e77..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** Package containing the data models for WebSiteManagementClient. WebSite Management Client. */ -package com.azure.resourcemanager.appservice.models; diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/package-info.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/package-info.java deleted file mode 100644 index d94e14cd7742..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** Package containing the classes for WebSiteManagementClient. WebSite Management Client. */ -package com.azure.resourcemanager.appservice; diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/module-info.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/module-info.java deleted file mode 100644 index a4361ff4b55e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/module-info.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -module com.azure.resourcemanager.appservice { - requires transitive com.azure.resourcemanager.resources; - requires transitive com.azure.resourcemanager.dns; - requires transitive com.azure.resourcemanager.keyvault; - requires transitive com.azure.resourcemanager.storage; - - // export public APIs of appservice - exports com.azure.resourcemanager.appservice; - exports com.azure.resourcemanager.appservice.fluent; - exports com.azure.resourcemanager.appservice.fluent.models; - exports com.azure.resourcemanager.appservice.models; - - // open packages specifically for azure core and jackson - opens com.azure.resourcemanager.appservice.fluent.models to - com.azure.core, - com.fasterxml.jackson.databind; - opens com.azure.resourcemanager.appservice.models to - com.azure.core, - com.fasterxml.jackson.databind; -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/samples/java/com/azure/resourcemanager/appservice/ReadmeSamples.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/samples/java/com/azure/resourcemanager/appservice/ReadmeSamples.java deleted file mode 100644 index b7989b339a30..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/samples/java/com/azure/resourcemanager/appservice/ReadmeSamples.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice; - -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpMethod; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.util.serializer.JacksonAdapter; -import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.identity.DefaultAzureCredentialBuilder; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.ArrayNode; - -import java.io.IOException; -import java.util.HashMap; - -public class ReadmeSamples { - - public void authenticate() { - // BEGIN: com.azure.resourcemanager.appservice.authenticate - String armEndpoint = "https://management.."; - AzureProfile profile = new AzureProfile(getAzureEnvironmentFromArmEndpoint(armEndpoint)); - TokenCredential credential = new DefaultAzureCredentialBuilder() - .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) - .build(); - AppServiceManager manager = AppServiceManager - .authenticate(credential, profile); - // END: com.azure.resourcemanager.appservice.authenticate - } - - // BEGIN: com.azure.resourcemanager.appservice.getazureenvironment - private static AzureEnvironment getAzureEnvironmentFromArmEndpoint(String armEndpoint) { - // Create HTTP client and request - HttpClient httpClient = HttpClient.createDefault(); - - HttpRequest request = new HttpRequest(HttpMethod.GET, - String.format("%s/metadata/endpoints?api-version=2019-10-01", armEndpoint)) - .setHeader("accept", "application/json"); - - // Execute the request and read the response - HttpResponse response = httpClient.send(request).block(); - if (response.getStatusCode() != 200) { - throw new RuntimeException("Failed : HTTP error code : " + response.getStatusCode()); - } - String body = response.getBodyAsString().block(); - try { - ArrayNode metadataArray = JacksonAdapter.createDefaultSerializerAdapter() - .deserialize(body, ArrayNode.class, SerializerEncoding.JSON); - - if (metadataArray == null || metadataArray.isEmpty()) { - throw new RuntimeException("Failed to find metadata : " + body); - } - - JsonNode metadata = metadataArray.iterator().next(); - AzureEnvironment azureEnvironment = new AzureEnvironment(new HashMap() { - { - put("managementEndpointUrl", metadata.at("/authentication/audiences/0").asText()); - put("resourceManagerEndpointUrl", armEndpoint); - put("galleryEndpointUrl", metadata.at("/gallery").asText()); - put("activeDirectoryEndpointUrl", metadata.at("/authentication/loginEndpoint").asText()); - put("activeDirectoryResourceId", metadata.at("/authentication/audiences/0").asText()); - put("activeDirectoryGraphResourceId", metadata.at("/graph").asText()); - put("storageEndpointSuffix", "." + metadata.at("/suffixes/storage").asText()); - put("keyVaultDnsSuffix", "." + metadata.at("/suffixes/keyVaultDns").asText()); - } - }); - return azureEnvironment; - } catch (IOException ioe) { - ioe.printStackTrace(); - throw new RuntimeException(ioe); - } - } - // END: com.azure.resourcemanager.appservice.getazureenvironment -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/java/com/azure/resourcemanager/appservice/AppServicePlansTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/java/com/azure/resourcemanager/appservice/AppServicePlansTests.java deleted file mode 100644 index 5a780fbd3d86..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/java/com/azure/resourcemanager/appservice/AppServicePlansTests.java +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice; - -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.exception.ManagementException; -import com.azure.resourcemanager.appservice.models.AppServicePlan; -import com.azure.resourcemanager.appservice.models.OperatingSystem; -import com.azure.resourcemanager.appservice.models.PricingTier; -import com.azure.core.management.Region; -import com.azure.core.management.profile.AzureProfile; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public class AppServicePlansTests extends AppServiceTest { - private String appServicePlanName = ""; - - @Override - protected void initializeClients(HttpPipeline httpPipeline, AzureProfile profile) { - appServicePlanName = generateRandomResourceName("java-asp-", 20); - super.initializeClients(httpPipeline, profile); - } - - @Override - protected void cleanUpResources() { - resourceManager.resourceGroups().deleteByName(rgName); - } - - @Test - @Disabled( - "Permanent server side issue: Cannot modify this web hosting plan because another operation is in progress") - public void canCRUDAppServicePlan() throws Exception { - // CREATE - AppServicePlan appServicePlan = - appServiceManager - .appServicePlans() - .define(appServicePlanName) - .withRegion(locationOrDefault(Region.US_WEST)) - .withNewResourceGroup(rgName) - .withPricingTier(PricingTier.PREMIUM_P1) - .withOperatingSystem(OperatingSystem.WINDOWS) - .withPerSiteScaling(false) - .withCapacity(2) - .create(); - Assertions.assertNotNull(appServicePlan); - Assertions.assertEquals(PricingTier.PREMIUM_P1, appServicePlan.pricingTier()); - Assertions.assertEquals(false, appServicePlan.perSiteScaling()); - Assertions.assertEquals(2, appServicePlan.capacity()); - Assertions.assertEquals(0, appServicePlan.numberOfWebApps()); - Assertions.assertEquals(20, appServicePlan.maxInstances()); - // GET - Assertions - .assertNotNull(appServiceManager.appServicePlans().getByResourceGroup(rgName, appServicePlanName)); - // LIST - PagedIterable appServicePlans = - appServiceManager.appServicePlans().listByResourceGroup(rgName); - boolean found = false; - for (AppServicePlan asp : appServicePlans) { - if (appServicePlanName.equals(asp.name())) { - found = true; - break; - } - } - Assertions.assertTrue(found); - // UPDATE - appServicePlan = - appServicePlan - .update() - .withPricingTier(PricingTier.STANDARD_S1) - .withPerSiteScaling(true) - .withCapacity(3) - .apply(); - Assertions.assertNotNull(appServicePlan); - Assertions.assertEquals(PricingTier.STANDARD_S1, appServicePlan.pricingTier()); - Assertions.assertEquals(true, appServicePlan.perSiteScaling()); - Assertions.assertEquals(3, appServicePlan.capacity()); - } - - @Test - public void failOnAppServiceNotFound() { - resourceManager.resourceGroups().define(rgName) - .withRegion(locationOrDefault(Region.US_WEST)) - .create(); - Assertions.assertThrows(ManagementException.class, () -> { - appServiceManager.appServicePlans().getByResourceGroup("rgName", "no_such_appservice"); - }); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/java/com/azure/resourcemanager/appservice/AppServiceTest.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/java/com/azure/resourcemanager/appservice/AppServiceTest.java deleted file mode 100644 index 5864f310de5f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/java/com/azure/resourcemanager/appservice/AppServiceTest.java +++ /dev/null @@ -1,239 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice; - -import com.azure.core.credential.TokenCredential; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpMethod; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.policy.HttpLogDetailLevel; -import com.azure.core.http.policy.HttpLogOptions; -import com.azure.core.http.policy.HttpLoggingPolicy; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appservice.models.AppServiceCertificateOrder; -import com.azure.resourcemanager.appservice.models.AppServiceDomain; -import com.azure.resourcemanager.appservice.models.PublishingProfile; -import com.azure.resourcemanager.keyvault.KeyVaultManager; -import com.azure.resourcemanager.resources.fluentcore.arm.CountryIsoCode; -import com.azure.resourcemanager.resources.fluentcore.arm.CountryPhoneCode; -import com.azure.core.management.Region; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.resources.ResourceManager; -import java.io.IOException; -import java.io.InputStream; -import java.time.Duration; -import java.time.temporal.ChronoUnit; -import java.util.List; -import java.util.concurrent.TimeoutException; - -import com.azure.resourcemanager.resources.fluentcore.utils.HttpPipelineProvider; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import com.azure.resourcemanager.test.ResourceManagerTestBase; -import com.azure.resourcemanager.test.utils.TestDelayProvider; -import com.azure.resourcemanager.test.utils.TestIdentifierProvider; -import org.apache.commons.net.ftp.FTP; -import org.apache.commons.net.ftp.FTPClient; -import reactor.core.publisher.Mono; -import reactor.util.retry.Retry; - -/** The base for app service tests. */ -public class AppServiceTest extends ResourceManagerTestBase { - - private static final ClientLogger LOGGER = new ClientLogger(AppServiceTest.class); - - protected ResourceManager resourceManager; - protected KeyVaultManager keyVaultManager; - protected AppServiceManager appServiceManager; - - protected AppServiceDomain domain; - protected AppServiceCertificateOrder certificateOrder; - protected String rgName = ""; - - @Override - protected HttpPipeline buildHttpPipeline( - TokenCredential credential, - AzureProfile profile, - HttpLogOptions httpLogOptions, - List policies, - HttpClient httpClient) { - return HttpPipelineProvider.buildHttpPipeline( - credential, - profile, - null, - httpLogOptions, - null, - new RetryPolicy("Retry-After", ChronoUnit.SECONDS), - policies, - httpClient); - } - - @Override - protected void initializeClients(HttpPipeline httpPipeline, AzureProfile profile) { - rgName = generateRandomResourceName("javacsmrg", 20); - ResourceManagerUtils.InternalRuntimeContext.setDelayProvider(new TestDelayProvider(!isPlaybackMode())); - ResourceManagerUtils.InternalRuntimeContext internalContext = new ResourceManagerUtils.InternalRuntimeContext(); - internalContext.setIdentifierFunction(name -> new TestIdentifierProvider(testResourceNamer)); - - keyVaultManager = buildManager(KeyVaultManager.class, httpPipeline, profile); - appServiceManager = buildManager(AppServiceManager.class, httpPipeline, profile); - resourceManager = appServiceManager.resourceManager(); - setInternalContext(internalContext, appServiceManager); - - // useExistingDomainAndCertificate(); - // createNewDomainAndCertificate(); - } - - @Override - protected void cleanUpResources() { - resourceManager.resourceGroups().beginDeleteByName(rgName); - } - - private void useExistingDomainAndCertificate() { - String rgName = "rgnemv24d683784f51d"; - String certOrder = "wild2crt8b42374211"; - String domainName = "jsdk79877.com"; - if (System.getenv("appservice-group") != null) { - rgName = System.getenv("appservice-group"); - } - if (System.getenv("appservice-domain") != null) { - domainName = System.getenv("appservice-domain"); - } - if (System.getenv("appservice-certificateorder") != null) { - certOrder = System.getenv("appservice-certificateorder"); - } - - domain = appServiceManager.domains().getByResourceGroup(rgName, domainName); - certificateOrder = appServiceManager.certificateOrders().getByResourceGroup(rgName, certOrder); - } - - private void createNewDomainAndCertificate() { - domain = - appServiceManager - .domains() - .define(System.getenv("appservice-domain")) - .withExistingResourceGroup(System.getenv("appservice-group")) - .defineRegistrantContact() - .withFirstName("Jon") - .withLastName("Doe") - .withEmail("jondoe@contoso.com") - .withAddressLine1("123 4th Ave") - .withCity("Redmond") - .withStateOrProvince("WA") - .withCountry(CountryIsoCode.UNITED_STATES) - .withPostalCode("98052") - .withPhoneCountryCode(CountryPhoneCode.UNITED_STATES) - .withPhoneNumber("4258828080") - .attach() - .withDomainPrivacyEnabled(true) - .withAutoRenewEnabled(true) - .create(); - certificateOrder = - appServiceManager - .certificateOrders() - .define(System.getenv("appservice-certificateorder")) - .withExistingResourceGroup(System.getenv("appservice-group")) - .withHostName("*." + domain.name()) - .withWildcardSku() - .withDomainVerification(domain) - .withNewKeyVault("graphvault", locationOrDefault(Region.US_WEST)) - .withValidYears(1) - .create(); - } - - /** - * Uploads a file to an Azure web app. - * - * @param profile the publishing profile for the web app. - * @param fileName the name of the file on server - * @param file the local file - */ - public static void uploadFileToWebApp(PublishingProfile profile, String fileName, InputStream file) { - FTPClient ftpClient = new FTPClient(); - String[] ftpUrlSegments = profile.ftpUrl().split("/", 2); - String server = ftpUrlSegments[0]; - String path = "./site/wwwroot/webapps"; - if (fileName.contains("/")) { - int lastslash = fileName.lastIndexOf('/'); - path = path + "/" + fileName.substring(0, lastslash); - fileName = fileName.substring(lastslash + 1); - } - try { - ftpClient.connect(server); - ftpClient.enterLocalPassiveMode(); - ftpClient.login(profile.ftpUsername(), profile.ftpPassword()); - ftpClient.setFileType(FTP.BINARY_FILE_TYPE); - for (String segment : path.split("/")) { - if (!ftpClient.changeWorkingDirectory(segment)) { - ftpClient.makeDirectory(segment); - ftpClient.changeWorkingDirectory(segment); - } - } - ftpClient.storeFile(fileName, file); - ftpClient.disconnect(); - } catch (IOException e) { - e.printStackTrace(); - } - } - - protected static Response curl(String urlString) { - HttpRequest request = new HttpRequest(HttpMethod.GET, urlString); - Mono> response = - stringResponse(HTTP_PIPELINE.send(request) - .flatMap(response1 -> { - int code = response1.getStatusCode(); - if (code == 200 || code == 400 || code == 404) { - return Mono.just(response1); - } else { - return Mono.error(new HttpResponseException(response1)); - } - }) - .retryWhen(Retry - .fixedDelay(3, Duration.ofSeconds(30)) - .filter(t -> t instanceof TimeoutException))); - return response.block(); - } - - protected static String post(String urlString, String body) { - try { - HttpRequest request = new HttpRequest(HttpMethod.POST, urlString).setBody(body); - Mono> response = - stringResponse(HTTP_PIPELINE.send(request) - .flatMap(response1 -> { - int code = response1.getStatusCode(); - if (code == 200 || code == 400 || code == 404) { - return Mono.just(response1); - } else { - return Mono.error(new HttpResponseException(response1)); - } - }) - .retryWhen(Retry - .fixedDelay(3, Duration.ofSeconds(30)) - .filter(t -> t instanceof TimeoutException))); - Response ret = response.block(); - return ret == null ? null : ret.getValue(); - } catch (Exception e) { - LOGGER.logThrowableAsError(e); - return null; - } - } - - private static Mono> stringResponse(Mono responseMono) { - return responseMono.flatMap(response -> response.getBodyAsString() - .map(str -> new SimpleResponse<>(response.getRequest(), response.getStatusCode(), response.getHeaders(), str))); - } - - private static final HttpPipeline HTTP_PIPELINE = new HttpPipelineBuilder() - .policies( - new HttpLoggingPolicy(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)), - new RetryPolicy("Retry-After", ChronoUnit.SECONDS)) - .build(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/java/com/azure/resourcemanager/appservice/AuthenticationTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/java/com/azure/resourcemanager/appservice/AuthenticationTests.java deleted file mode 100644 index bf36f35cebbe..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/java/com/azure/resourcemanager/appservice/AuthenticationTests.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice; - -import com.azure.core.http.HttpPipeline; -import com.azure.resourcemanager.appservice.models.AppServicePlan; -import com.azure.resourcemanager.appservice.models.BuiltInAuthenticationProvider; -import com.azure.resourcemanager.appservice.models.PricingTier; -import com.azure.resourcemanager.appservice.models.WebApp; -import com.azure.core.management.Region; -import com.azure.core.management.profile.AzureProfile; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public class AuthenticationTests extends AppServiceTest { - private String rgName1 = ""; - private String webappName1 = ""; - - @Override - protected void initializeClients(HttpPipeline httpPipeline, AzureProfile profile) { - webappName1 = generateRandomResourceName("java-webapp-", 20); - rgName1 = generateRandomResourceName("javacsmrg", 20); - - super.initializeClients(httpPipeline, profile); - } - - @Override - protected void cleanUpResources() { - resourceManager.resourceGroups().beginDeleteByName(rgName1); - } - - @Test - @Disabled("Need facebook developer account") - public void canCRUDWebAppWithAuthentication() throws Exception { - // Create with new app service plan - WebApp webApp1 = - appServiceManager - .webApps() - .define(webappName1) - .withRegion(locationOrDefault(Region.US_WEST)) - .withNewResourceGroup(rgName1) - .withNewWindowsPlan(PricingTier.BASIC_B1) - .defineAuthentication() - .withDefaultAuthenticationProvider(BuiltInAuthenticationProvider.FACEBOOK) - .withFacebook("appId", "appSecret") - .attach() - .create(); - Assertions.assertNotNull(webApp1); - Assertions.assertEquals(locationOrDefault(Region.US_WEST), webApp1.region()); - AppServicePlan plan1 = appServiceManager.appServicePlans().getById(webApp1.appServicePlanId()); - Assertions.assertNotNull(plan1); - Assertions.assertEquals(locationOrDefault(Region.US_WEST), plan1.region()); - Assertions.assertEquals(PricingTier.BASIC_B1, plan1.pricingTier()); - - String response = curl("http://" + webApp1.defaultHostname()).getValue(); - Assertions.assertTrue(response.contains("do not have permission")); - - // Update - webApp1 - .update() - .defineAuthentication() - .withAnonymousAuthentication() - .withFacebook("appId", "appSecret") - .attach() - .apply(); - - response = curl("http://" + webApp1.defaultHostname()).getValue(); - Assertions.assertFalse(response.contains("do not have permission")); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/java/com/azure/resourcemanager/appservice/CertificateOrdersTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/java/com/azure/resourcemanager/appservice/CertificateOrdersTests.java deleted file mode 100644 index 363699a8bebe..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/java/com/azure/resourcemanager/appservice/CertificateOrdersTests.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.appservice.models.AppServiceCertificateOrder; -import com.azure.core.management.Region; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public class CertificateOrdersTests extends AppServiceTest { - private final String certificateName = "graphwildcert319"; - - @Override - protected void cleanUpResources() { - // super.cleanUpResources(); - } - - @Test - @Disabled( - "Test is failing fix it. we may not intent to create a resource here but just to fetch existing resource.") - public void canCRUDCertificateOrder() throws Exception { - // CREATE - AppServiceCertificateOrder certificateOrder = - appServiceManager - .certificateOrders() - .define(certificateName) - .withExistingResourceGroup(rgName) - .withHostName("*.graph-webapp-319.com") - .withWildcardSku() - .withDomainVerification(appServiceManager.domains().getByResourceGroup(rgName, "graph-webapp-319.com")) - .withNewKeyVault("graphvault", locationOrDefault(Region.US_WEST)) - .withValidYears(1) - .create(); - Assertions.assertNotNull(certificateOrder); - // GET - Assertions.assertNotNull(appServiceManager.certificateOrders().getByResourceGroup(rgName, certificateName)); - // LIST - PagedIterable certificateOrders = - appServiceManager.certificateOrders().listByResourceGroup(rgName); - boolean found = false; - for (AppServiceCertificateOrder co : certificateOrders) { - if (certificateName.equals(co.name())) { - found = true; - break; - } - } - Assertions.assertTrue(found); - // UPDATE - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/java/com/azure/resourcemanager/appservice/CertificatesTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/java/com/azure/resourcemanager/appservice/CertificatesTests.java deleted file mode 100644 index 074eab83b80d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/java/com/azure/resourcemanager/appservice/CertificatesTests.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.appservice.models.AppServiceCertificate; -import com.azure.resourcemanager.keyvault.models.Vault; -import com.azure.core.management.Region; -import java.io.File; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public class CertificatesTests extends AppServiceTest { - private final String certificateName = "javagoodcert319"; - - @Override - protected void cleanUpResources() { - // super.cleanUpResources(); - } - - @Test - @Disabled("Test is failing fix it, this is based on Existing RG and settings.") - public void canCRDCertificate() throws Exception { - Vault vault = keyVaultManager.vaults().getByResourceGroup(rgName, "bananagraphwebapp319com"); - AppServiceCertificate certificate = - appServiceManager - .certificates() - .define("bananacert") - .withRegion(locationOrDefault(Region.US_WEST)) - .withExistingResourceGroup(rgName) - .withExistingCertificateOrder( - appServiceManager.certificateOrders().getByResourceGroup(rgName, "graphwebapp319")) - .create(); - Assertions.assertNotNull(certificate); - - // CREATE - certificate = - appServiceManager - .certificates() - .define(certificateName) - .withRegion(locationOrDefault(Region.US_EAST)) - .withExistingResourceGroup(rgName) - .withPfxFile(new File("/Users/jianghlu/Documents/code/certs/myserver.pfx")) - .withPfxPassword("StrongPass!123") - .create(); - Assertions.assertNotNull(certificate); - } - - @Test - public void canListCertificate() { - PagedIterable certificates = appServiceManager.certificates().list(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/java/com/azure/resourcemanager/appservice/DeploymentSlotsTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/java/com/azure/resourcemanager/appservice/DeploymentSlotsTests.java deleted file mode 100644 index 116504bdbca6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/java/com/azure/resourcemanager/appservice/DeploymentSlotsTests.java +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice; - -import com.azure.core.http.HttpPipeline; -import com.azure.resourcemanager.appservice.models.DeploymentSlot; -import com.azure.resourcemanager.appservice.models.JavaVersion; -import com.azure.resourcemanager.appservice.models.PricingTier; -import com.azure.resourcemanager.appservice.models.PythonVersion; -import com.azure.resourcemanager.appservice.models.WebApp; -import com.azure.resourcemanager.appservice.models.WebContainer; -import com.azure.resourcemanager.appservice.models.WebDeploymentSlotBasic; -import com.azure.core.management.Region; -import com.azure.core.management.profile.AzureProfile; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public class DeploymentSlotsTests extends AppServiceTest { - private String webappName = ""; -// private String slotName1 = ""; - private String slotName2 = ""; - private String slotName3 = ""; - - @Override - protected void initializeClients(HttpPipeline httpPipeline, AzureProfile profile) { - webappName = generateRandomResourceName("java-webapp-", 20); -// slotName1 = generateRandomResourceName("java-slot-", 20); - slotName2 = generateRandomResourceName("java-slot-", 20); - slotName3 = generateRandomResourceName("java-slot-", 20); - - super.initializeClients(httpPipeline, profile); - } - - @Test - public void canCRUDSwapSlots() throws Exception { - // Create web app - WebApp webApp = - appServiceManager - .webApps() - .define(webappName) - .withRegion(locationOrDefault(Region.US_WEST)) - .withNewResourceGroup(rgName) - .withNewWindowsPlan(PricingTier.STANDARD_S2) - .withJavaVersion(JavaVersion.JAVA_1_7_0_51) - .withWebContainer(WebContainer.TOMCAT_7_0_50) - .create(); - Assertions.assertNotNull(webApp); - Assertions.assertEquals(locationOrDefault(Region.US_WEST), webApp.region()); - - // Create a deployment slot with web app's config - DeploymentSlot slot2 = webApp.deploymentSlots().define(slotName2).withConfigurationFromParent().create(); - Assertions.assertNotNull(slot2); - Assertions.assertEquals(JavaVersion.JAVA_1_7_0_51, slot2.javaVersion()); - - // Update deployment slot - slot2 - .update() - .withoutJava() - .withPythonVersion(PythonVersion.PYTHON_34) - .withAppSetting("slot2key", "slot2value") - .withStickyAppSetting("sticky2key", "sticky2value") - .apply(); - Assertions.assertNotNull(slot2); - Assertions.assertEquals(JavaVersion.OFF, slot2.javaVersion()); - Assertions.assertEquals(PythonVersion.PYTHON_34, slot2.pythonVersion()); - - // Create 3rd deployment slot with configuration from slot 2 - DeploymentSlot slot3 = - webApp.deploymentSlots().define(slotName3) - .withConfigurationFromDeploymentSlot(slot2) - .withHttpsOnly(true) - .create(); - Assertions.assertNotNull(slot3); - Assertions.assertEquals(JavaVersion.OFF, slot3.javaVersion()); - Assertions.assertEquals(PythonVersion.PYTHON_34, slot3.pythonVersion()); - Assertions.assertTrue(slot3.httpsOnly()); - - // Get - DeploymentSlot deploymentSlot = webApp.deploymentSlots().getByName(slotName3); - Assertions.assertEquals(slot3.id(), deploymentSlot.id()); - - // List - WebDeploymentSlotBasic slotBasic3 = webApp.deploymentSlots().list().stream() - .filter(slotBasic -> slotName3.equals(slotBasic.name())) - .findFirst().orElse(null); - Assertions.assertNotNull(slotBasic3); - Assertions.assertEquals(slot3.id(), slotBasic3.id()); - Assertions.assertEquals(slot3.name(), slotBasic3.name()); - Assertions.assertEquals(slot3.appServicePlanId(), slotBasic3.appServicePlanId()); - Assertions.assertEquals(slot3.operatingSystem(), slotBasic3.operatingSystem()); - Assertions.assertEquals(slot3.httpsOnly(), slotBasic3.httpsOnly()); - - DeploymentSlot slot3Refreshed = slotBasic3.refresh(); - Assertions.assertEquals(PythonVersion.PYTHON_34, slot3Refreshed.pythonVersion()); - - // Swap - slot2.update() - .withoutAppSetting("slot2key") - .apply(); - - DeploymentSlot slot3Swapped = slot3Refreshed; - slot3Swapped.swap(slot2.name()); - Assertions.assertFalse(slot3Swapped.getAppSettings().containsKey("slot2key")); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/java/com/azure/resourcemanager/appservice/DiagnosticLogsTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/java/com/azure/resourcemanager/appservice/DiagnosticLogsTests.java deleted file mode 100644 index f6c0447f3587..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/java/com/azure/resourcemanager/appservice/DiagnosticLogsTests.java +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice; - -import com.azure.core.http.HttpPipeline; -import com.azure.resourcemanager.appservice.models.AppServicePlan; -import com.azure.resourcemanager.appservice.models.LogLevel; -import com.azure.resourcemanager.appservice.models.PricingTier; -import com.azure.resourcemanager.appservice.models.WebApp; -import com.azure.core.management.Region; -import com.azure.core.management.profile.AzureProfile; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public class DiagnosticLogsTests extends AppServiceTest { - private String rgName1 = ""; - private String webappName1 = ""; - - @Override - protected void initializeClients(HttpPipeline httpPipeline, AzureProfile profile) { - webappName1 = generateRandomResourceName("java-webapp-", 20); - rgName1 = generateRandomResourceName("javacsmrg", 20); - - super.initializeClients(httpPipeline, profile); - } - - @Override - protected void cleanUpResources() { - resourceManager.resourceGroups().beginDeleteByName(rgName1); - } - - @Test - public void canCRUDWebAppWithDiagnosticLogs() throws Exception { - // Create with new app service plan - WebApp webApp1 = - appServiceManager - .webApps() - .define(webappName1) - .withRegion(locationOrDefault(Region.US_WEST)) - .withNewResourceGroup(rgName1) - .withNewWindowsPlan(PricingTier.BASIC_B1) - .defineDiagnosticLogsConfiguration() - .withApplicationLogging() - .withLogLevel(LogLevel.INFORMATION) - .withApplicationLogsStoredOnFileSystem() - .attach() - .defineDiagnosticLogsConfiguration() - .withWebServerLogging() - .withWebServerLogsStoredOnFileSystem() - .withWebServerFileSystemQuotaInMB(50) - .withUnlimitedLogRetentionDays() - .attach() - .create(); - Assertions.assertNotNull(webApp1); - Assertions.assertEquals(locationOrDefault(Region.US_WEST), webApp1.region()); - AppServicePlan plan1 = appServiceManager.appServicePlans().getById(webApp1.appServicePlanId()); - Assertions.assertNotNull(plan1); - Assertions.assertEquals(locationOrDefault(Region.US_WEST), plan1.region()); - Assertions.assertEquals(PricingTier.BASIC_B1, plan1.pricingTier()); - - Assertions.assertNotNull(webApp1.diagnosticLogsConfig()); - Assertions - .assertEquals(LogLevel.INFORMATION, webApp1.diagnosticLogsConfig().applicationLoggingFileSystemLogLevel()); - Assertions.assertEquals(LogLevel.OFF, webApp1.diagnosticLogsConfig().applicationLoggingStorageBlobLogLevel()); - Assertions.assertNull(webApp1.diagnosticLogsConfig().applicationLoggingStorageBlobContainer()); - Assertions.assertEquals(0, webApp1.diagnosticLogsConfig().applicationLoggingStorageBlobRetentionDays()); - Assertions.assertEquals(50, webApp1.diagnosticLogsConfig().webServerLoggingFileSystemQuotaInMB()); - // 0 means unlimited - Assertions.assertEquals(0, webApp1.diagnosticLogsConfig().webServerLoggingFileSystemRetentionDays()); - Assertions.assertNull(webApp1.diagnosticLogsConfig().webServerLoggingStorageBlobContainer()); - Assertions.assertEquals(0, webApp1.diagnosticLogsConfig().webServerLoggingStorageBlobRetentionDays()); - Assertions.assertFalse(webApp1.diagnosticLogsConfig().detailedErrorMessages()); - Assertions.assertFalse(webApp1.diagnosticLogsConfig().failedRequestsTracing()); - - // Update - webApp1 - .update() - .updateDiagnosticLogsConfiguration() - .withoutApplicationLogging() - .parent() - .updateDiagnosticLogsConfiguration() - .withWebServerLogging() - .withWebServerLogsStoredOnFileSystem() - .withWebServerFileSystemQuotaInMB(80) - .withLogRetentionDays(3) - .withDetailedErrorMessages(true) - .parent() - .apply(); - - Assertions.assertNotNull(webApp1.diagnosticLogsConfig()); - Assertions.assertEquals(LogLevel.OFF, webApp1.diagnosticLogsConfig().applicationLoggingFileSystemLogLevel()); - Assertions.assertEquals(LogLevel.OFF, webApp1.diagnosticLogsConfig().applicationLoggingStorageBlobLogLevel()); - Assertions.assertNull(webApp1.diagnosticLogsConfig().applicationLoggingStorageBlobContainer()); - Assertions.assertEquals(0, webApp1.diagnosticLogsConfig().applicationLoggingStorageBlobRetentionDays()); - Assertions.assertEquals(80, webApp1.diagnosticLogsConfig().webServerLoggingFileSystemQuotaInMB()); - Assertions.assertEquals(3, webApp1.diagnosticLogsConfig().webServerLoggingFileSystemRetentionDays()); - Assertions.assertNull(webApp1.diagnosticLogsConfig().webServerLoggingStorageBlobContainer()); - Assertions.assertEquals(3, webApp1.diagnosticLogsConfig().webServerLoggingStorageBlobRetentionDays()); - Assertions.assertTrue(webApp1.diagnosticLogsConfig().detailedErrorMessages()); - Assertions.assertFalse(webApp1.diagnosticLogsConfig().failedRequestsTracing()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/java/com/azure/resourcemanager/appservice/DomainsTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/java/com/azure/resourcemanager/appservice/DomainsTests.java deleted file mode 100644 index a2deb88ab497..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/java/com/azure/resourcemanager/appservice/DomainsTests.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice; - -import com.azure.resourcemanager.appservice.models.AppServiceDomain; -import com.azure.resourcemanager.resources.fluentcore.arm.CountryIsoCode; -import com.azure.resourcemanager.resources.fluentcore.arm.CountryPhoneCode; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public class DomainsTests extends AppServiceTest { - private final String domainName = "javatest720.com"; - - @Override - protected void cleanUpResources() { - // super.cleanUpResources(); - } - - @Test - @Disabled( - "Test is failing fix it. we may not intent to create a resource here but just to fetch existing resource.") - public void canCRUDDomain() throws Exception { - // CREATE - AppServiceDomain domain = - appServiceManager - .domains() - .define(domainName) - .withExistingResourceGroup(rgName) - .defineRegistrantContact() - .withFirstName("Jianghao") - .withLastName("Lu") - .withEmail("jianghlu@microsoft.com") - .withAddressLine1("1 Microsoft Way") - .withCity("Seattle") - .withStateOrProvince("WA") - .withCountry(CountryIsoCode.UNITED_STATES) - .withPostalCode("98101") - .withPhoneCountryCode(CountryPhoneCode.UNITED_STATES) - .withPhoneNumber("4258828080") - .attach() - .withDomainPrivacyEnabled(true) - .withAutoRenewEnabled(true) - .create(); - // Domain domain = appServiceManager.domains().getByGroup(RG_NAME, DOMAIN_NAME); - Assertions.assertNotNull(domain); - domain.update().withAutoRenewEnabled(false).apply(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/java/com/azure/resourcemanager/appservice/FunctionAppsTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/java/com/azure/resourcemanager/appservice/FunctionAppsTests.java deleted file mode 100644 index ae552ba19148..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/java/com/azure/resourcemanager/appservice/FunctionAppsTests.java +++ /dev/null @@ -1,444 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice; - -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.exception.ManagementException; -import com.azure.resourcemanager.appservice.models.AppServicePlan; -import com.azure.resourcemanager.appservice.models.AppSetting; -import com.azure.resourcemanager.appservice.models.FunctionApp; -import com.azure.resourcemanager.appservice.models.FunctionAppBasic; -import com.azure.resourcemanager.appservice.models.FunctionEnvelope; -import com.azure.resourcemanager.appservice.models.FunctionRuntimeStack; -import com.azure.resourcemanager.appservice.models.PricingTier; -import com.azure.resourcemanager.appservice.models.SkuName; -import com.azure.resourcemanager.test.utils.TestUtilities; -import com.azure.core.management.Region; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import com.azure.resourcemanager.storage.models.StorageAccount; -import com.azure.resourcemanager.storage.models.StorageAccountSkuType; -import com.azure.resourcemanager.storage.StorageManager; -import java.io.ByteArrayOutputStream; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.time.Duration; -import java.util.Arrays; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public class FunctionAppsTests extends AppServiceTest { - private String rgName1 = ""; - private String rgName2 = ""; - private String webappName1 = ""; - private String webappName2 = ""; - private String webappName3 = ""; - private String appServicePlanName1 = ""; - private String appServicePlanName2 = ""; - private String storageAccountName1 = ""; - - protected StorageManager storageManager; - - @Override - protected void initializeClients(HttpPipeline httpPipeline, AzureProfile profile) { - webappName1 = generateRandomResourceName("java-func-", 20); - webappName2 = generateRandomResourceName("java-func-", 20); - webappName3 = generateRandomResourceName("java-func-", 20); - appServicePlanName1 = generateRandomResourceName("java-asp-", 20); - appServicePlanName2 = generateRandomResourceName("java-asp-", 20); - storageAccountName1 = generateRandomResourceName("javastore", 20); - rgName1 = generateRandomResourceName("javacsmrg", 20); - rgName2 = generateRandomResourceName("javacsmrg", 20); - - storageManager = buildManager(StorageManager.class, httpPipeline, profile); - - super.initializeClients(httpPipeline, profile); - } - - @Override - protected void cleanUpResources() { - if (rgName1 != null) { - resourceManager.resourceGroups().beginDeleteByName(rgName1); - } - if (rgName2 != null) { - try { - resourceManager.resourceGroups().beginDeleteByName(rgName2); - } catch (ManagementException e) { - // fine, RG_NAME_2 is not created - } - } - } - - @Test - public void canCRUDFunctionApp() throws Exception { - // Create with consumption - FunctionApp functionApp1 = - appServiceManager - .functionApps() - .define(webappName1) - .withRegion(locationOrDefault(Region.US_WEST)) - .withNewResourceGroup(rgName1) - .create(); - Assertions.assertNotNull(functionApp1); - Assertions.assertEquals(locationOrDefault(Region.US_WEST), functionApp1.region()); - AppServicePlan plan1 = appServiceManager.appServicePlans().getById(functionApp1.appServicePlanId()); - Assertions.assertNotNull(plan1); - Assertions.assertEquals(locationOrDefault(Region.US_WEST), plan1.region()); - Assertions.assertEquals(new PricingTier("Dynamic", "Y1"), plan1.pricingTier()); - - FunctionAppResource functionAppResource1 = getStorageAccount(storageManager, functionApp1); - // consumption plan requires this 2 settings - Assertions.assertTrue(functionAppResource1.appSettings.containsKey(KEY_CONTENT_AZURE_FILE_CONNECTION_STRING)); - Assertions.assertTrue(functionAppResource1.appSettings.containsKey(KEY_CONTENT_SHARE)); - Assertions - .assertEquals( - functionAppResource1.appSettings.get(KEY_AZURE_WEB_JOBS_STORAGE).value(), - functionAppResource1.appSettings.get(KEY_CONTENT_AZURE_FILE_CONNECTION_STRING).value()); - // verify accountKey - Assertions - .assertEquals( - functionAppResource1.storageAccount.getKeys().get(0).value(), functionAppResource1.accountKey); - - // Create with the same consumption plan - FunctionApp functionApp2 = - appServiceManager - .functionApps() - .define(webappName2) - .withExistingAppServicePlan(plan1) - .withNewResourceGroup(rgName2) - .withExistingStorageAccount(functionApp1.storageAccount()) - .create(); - Assertions.assertNotNull(functionApp2); - Assertions.assertEquals(locationOrDefault(Region.US_WEST), functionApp2.region()); - - // Create with app service plan - FunctionApp functionApp3 = - appServiceManager - .functionApps() - .define(webappName3) - .withRegion(locationOrDefault(Region.US_WEST)) - .withExistingResourceGroup(rgName2) - .withNewAppServicePlan(PricingTier.BASIC_B1) - .withExistingStorageAccount(functionApp1.storageAccount()) - .create(); - Assertions.assertNotNull(functionApp2); - Assertions.assertEquals(locationOrDefault(Region.US_WEST), functionApp2.region()); - - // app service plan does not have this 2 settings - // https://github.com/Azure/azure-libraries-for-net/issues/485 - FunctionAppResource functionAppResource3 = getStorageAccount(storageManager, functionApp3); - Assertions.assertFalse(functionAppResource3.appSettings.containsKey(KEY_CONTENT_AZURE_FILE_CONNECTION_STRING)); - Assertions.assertFalse(functionAppResource3.appSettings.containsKey(KEY_CONTENT_SHARE)); - // verify accountKey - Assertions - .assertEquals( - functionAppResource3.storageAccount.getKeys().get(0).value(), functionAppResource3.accountKey); - - // Get - FunctionApp functionApp = appServiceManager.functionApps().getByResourceGroup(rgName1, functionApp1.name()); - Assertions.assertEquals(functionApp1.id(), functionApp.id()); - functionApp = appServiceManager.functionApps().getById(functionApp2.id()); - Assertions.assertEquals(functionApp2.name(), functionApp.name()); - - // List - PagedIterable functionApps = appServiceManager.functionApps().listByResourceGroup(rgName1); - Assertions.assertEquals(1, TestUtilities.getSize(functionApps)); - functionApps = appServiceManager.functionApps().listByResourceGroup(rgName2); - Assertions.assertEquals(2, TestUtilities.getSize(functionApps)); - - // Update - functionApp2.update().withNewStorageAccount(storageAccountName1, StorageAccountSkuType.STANDARD_LRS).apply(); - Assertions.assertEquals(storageAccountName1, functionApp2.storageAccount().name()); - - FunctionAppResource functionAppResource2 = getStorageAccount(storageManager, functionApp2); - Assertions.assertTrue(functionAppResource2.appSettings.containsKey(KEY_CONTENT_AZURE_FILE_CONNECTION_STRING)); - Assertions.assertTrue(functionAppResource2.appSettings.containsKey(KEY_CONTENT_SHARE)); - Assertions - .assertEquals( - functionAppResource2.appSettings.get(KEY_AZURE_WEB_JOBS_STORAGE).value(), - functionAppResource2.appSettings.get(KEY_CONTENT_AZURE_FILE_CONNECTION_STRING).value()); - Assertions.assertEquals(storageAccountName1, functionAppResource2.storageAccount.name()); - Assertions - .assertEquals( - functionAppResource2.storageAccount.getKeys().get(0).value(), functionAppResource2.accountKey); - - // Update, verify modify AppSetting does not create new storage account - // https://github.com/Azure/azure-libraries-for-net/issues/457 - int numStorageAccountBefore = - TestUtilities.getSize(storageManager.storageAccounts().listByResourceGroup(rgName1)); - functionApp1.update().withAppSetting("newKey", "newValue").apply(); - int numStorageAccountAfter = - TestUtilities.getSize(storageManager.storageAccounts().listByResourceGroup(rgName1)); - Assertions.assertEquals(numStorageAccountBefore, numStorageAccountAfter); - FunctionAppResource functionAppResource1Updated = getStorageAccount(storageManager, functionApp1); - Assertions.assertTrue(functionAppResource1Updated.appSettings.containsKey("newKey")); - Assertions - .assertEquals( - functionAppResource1.appSettings.get(KEY_AZURE_WEB_JOBS_STORAGE).value(), - functionAppResource1Updated.appSettings.get(KEY_AZURE_WEB_JOBS_STORAGE).value()); - Assertions - .assertEquals( - functionAppResource1.appSettings.get(KEY_CONTENT_AZURE_FILE_CONNECTION_STRING).value(), - functionAppResource1Updated.appSettings.get(KEY_CONTENT_AZURE_FILE_CONNECTION_STRING).value()); - Assertions - .assertEquals( - functionAppResource1.appSettings.get(KEY_CONTENT_SHARE).value(), - functionAppResource1Updated.appSettings.get(KEY_CONTENT_SHARE).value()); - Assertions - .assertEquals( - functionAppResource1.storageAccount.name(), functionAppResource1Updated.storageAccount.name()); - - // Scale - functionApp3.update().withNewAppServicePlan(PricingTier.STANDARD_S2).apply(); - Assertions.assertNotEquals(functionApp3.appServicePlanId(), functionApp1.appServicePlanId()); - } - - private static final String FUNCTION_APP_PACKAGE_URL = - "https://raw.githubusercontent.com/Azure/azure-sdk-for-java/main/sdk/resourcemanager/azure-resourcemanager-appservice/src/test/resources/java-functions.zip"; - - @Test - public void canCRUDLinuxFunctionApp() throws Exception { - rgName2 = null; - - // function app with consumption plan - FunctionApp functionApp1 = - appServiceManager - .functionApps() - .define(webappName1) - .withRegion(locationOrDefault(Region.US_EAST)) - .withNewResourceGroup(rgName1) - .withNewLinuxConsumptionPlan() - .withBuiltInImage(FunctionRuntimeStack.JAVA_8) - .withHttpsOnly(true) - .withAppSetting("WEBSITE_RUN_FROM_PACKAGE", FUNCTION_APP_PACKAGE_URL) - .create(); - Assertions.assertNotNull(functionApp1); - assertLinuxJava(functionApp1, FunctionRuntimeStack.JAVA_8.getLinuxFxVersion()); - - AppServicePlan plan1 = appServiceManager.appServicePlans().getById(functionApp1.appServicePlanId()); - Assertions.assertNotNull(plan1); - Assertions.assertEquals(locationOrDefault(Region.US_EAST), plan1.region()); - Assertions.assertEquals(new PricingTier(SkuName.DYNAMIC.toString(), "Y1"), plan1.pricingTier()); - Assertions.assertTrue(plan1.innerModel().reserved()); - Assertions - .assertTrue( - Arrays - .asList(functionApp1.innerModel().kind().split(",")) - .containsAll(Arrays.asList("linux", "functionapp"))); - - PagedIterable functionApps = appServiceManager.functionApps().listByResourceGroup(rgName1); - Assertions.assertEquals(1, TestUtilities.getSize(functionApps)); - - // function app with app service plan - FunctionApp functionApp2 = - appServiceManager - .functionApps() - .define(webappName2) - .withRegion(locationOrDefault(Region.US_EAST)) - .withExistingResourceGroup(rgName1) - .withNewLinuxAppServicePlan(PricingTier.STANDARD_S1) - .withBuiltInImage(FunctionRuntimeStack.JAVA_8) - .withHttpsOnly(true) - .withAppSetting("WEBSITE_RUN_FROM_PACKAGE", FUNCTION_APP_PACKAGE_URL) - .create(); - Assertions.assertNotNull(functionApp2); - assertLinuxJava(functionApp2, FunctionRuntimeStack.JAVA_8.getLinuxFxVersion()); - - AppServicePlan plan2 = appServiceManager.appServicePlans().getById(functionApp2.appServicePlanId()); - Assertions.assertNotNull(plan2); - Assertions.assertEquals(PricingTier.STANDARD_S1, plan2.pricingTier()); - Assertions.assertTrue(plan2.innerModel().reserved()); - - // one more function app using existing app service plan - FunctionApp functionApp3 = - appServiceManager - .functionApps() - .define(webappName3) - .withExistingLinuxAppServicePlan(plan2) - .withExistingResourceGroup(rgName1) - .withBuiltInImage(FunctionRuntimeStack.JAVA_8) - .withHttpsOnly(true) - .withAppSetting("WEBSITE_RUN_FROM_PACKAGE", FUNCTION_APP_PACKAGE_URL) - .create(); - Assertions.assertNotNull(functionApp3); - assertLinuxJava(functionApp3, FunctionRuntimeStack.JAVA_8.getLinuxFxVersion()); - - // wait for deploy - if (!isPlaybackMode()) { - ResourceManagerUtils.sleep(Duration.ofMinutes(3)); - } - - functionApps = appServiceManager.functionApps().listByResourceGroup(rgName1); - Assertions.assertEquals(3, TestUtilities.getSize(functionApps)); - - // verify deploy - PagedIterable functions = - appServiceManager.functionApps().listFunctions(functionApp1.resourceGroupName(), functionApp1.name()); - Assertions.assertEquals(1, TestUtilities.getSize(functions)); - - functions = - appServiceManager.functionApps().listFunctions(functionApp2.resourceGroupName(), functionApp2.name()); - Assertions.assertEquals(1, TestUtilities.getSize(functions)); - - functions = - appServiceManager.functionApps().listFunctions(functionApp3.resourceGroupName(), functionApp3.name()); - Assertions.assertEquals(1, TestUtilities.getSize(functions)); - } - - @Test - public void canCRUDLinuxFunctionAppPremium() { - rgName2 = null; - - // function app with premium plan - FunctionApp functionApp1 = - appServiceManager - .functionApps() - .define(webappName1) - .withRegion(locationOrDefault(Region.US_EAST)) - .withNewResourceGroup(rgName1) - .withNewLinuxAppServicePlan(new PricingTier(SkuName.ELASTIC_PREMIUM.toString(), "EP1")) - .withBuiltInImage(FunctionRuntimeStack.JAVA_8) - .withHttpsOnly(true) - .withAppSetting("WEBSITE_RUN_FROM_PACKAGE", FUNCTION_APP_PACKAGE_URL) - .create(); - Assertions.assertNotNull(functionApp1); - AppServicePlan plan1 = appServiceManager.appServicePlans().getById(functionApp1.appServicePlanId()); - Assertions.assertNotNull(plan1); - Assertions.assertEquals(new PricingTier(SkuName.ELASTIC_PREMIUM.toString(), "EP1"), plan1.pricingTier()); - Assertions.assertTrue(plan1.innerModel().reserved()); - assertLinuxJava(functionApp1, FunctionRuntimeStack.JAVA_8.getLinuxFxVersion()); - - // wait for deploy - if (!isPlaybackMode()) { - ResourceManagerUtils.sleep(Duration.ofMinutes(3)); - } - - // verify deploy - PagedIterable functions = - appServiceManager.functionApps().listFunctions(functionApp1.resourceGroupName(), functionApp1.name()); - Assertions.assertEquals(1, TestUtilities.getSize(functions)); - } - - @Test - @Disabled("Need container registry") - public void canCRUDLinuxFunctionAppPremiumDocker() { - // function app with premium plan with private docker - FunctionApp functionApp1 = - appServiceManager - .functionApps() - .define(webappName1) - .withRegion(locationOrDefault(Region.US_EAST)) - .withNewResourceGroup(rgName1) - .withNewLinuxAppServicePlan(new PricingTier(SkuName.ELASTIC_PREMIUM.toString(), "EP1")) - .withPrivateRegistryImage( - "weidxuregistry.azurecr.io/az-func-java:v1", "https://weidxuregistry.azurecr.io") - .withCredentials("weidxuregistry", "PASSWORD") - .withRuntime("java") - .withRuntimeVersion("~3") - .create(); - - // deploy - if (!isPlaybackMode()) { - functionApp1.zipDeploy(new File(FunctionAppsTests.class.getResource("/java-functions.zip").getPath())); - } - } - - @Test - public void canCRUDLinuxFunctionAppJava11() throws Exception { - rgName2 = null; - - // function app with consumption plan - FunctionApp functionApp1 = appServiceManager.functionApps().define(webappName1) - .withRegion(locationOrDefault(Region.US_EAST)) - .withNewResourceGroup(rgName1) - .withNewLinuxConsumptionPlan() - .withBuiltInImage(FunctionRuntimeStack.JAVA_11) - .withHttpsOnly(true) - .withAppSetting("WEBSITE_RUN_FROM_PACKAGE", FUNCTION_APP_PACKAGE_URL) - .create(); - Assertions.assertNotNull(functionApp1); - assertLinuxJava(functionApp1, FunctionRuntimeStack.JAVA_11.getLinuxFxVersion()); - } - - private static Map assertLinuxJava(FunctionApp functionApp, String linuxFxVersion) { - Assertions.assertEquals(linuxFxVersion, functionApp.linuxFxVersion()); - Assertions - .assertTrue( - Arrays - .asList(functionApp.innerModel().kind().split(",")) - .containsAll(Arrays.asList("linux", "functionapp"))); - Assertions.assertTrue(functionApp.innerModel().reserved()); - - Map appSettings = functionApp.getAppSettings(); - Assertions.assertNotNull(appSettings); - Assertions.assertNotNull(appSettings.get(KEY_AZURE_WEB_JOBS_STORAGE)); - Assertions - .assertEquals(FunctionRuntimeStack.JAVA_8.runtime(), appSettings.get(KEY_FUNCTIONS_WORKER_RUNTIME).value()); - Assertions - .assertEquals( - FunctionRuntimeStack.JAVA_8.version(), appSettings.get(KEY_FUNCTIONS_EXTENSION_VERSION).value()); - - return appSettings; - } - - private static final String KEY_AZURE_WEB_JOBS_STORAGE = "AzureWebJobsStorage"; - private static final String KEY_CONTENT_AZURE_FILE_CONNECTION_STRING = "WEBSITE_CONTENTAZUREFILECONNECTIONSTRING"; - private static final String KEY_CONTENT_SHARE = "WEBSITE_CONTENTSHARE"; - private static final String KEY_FUNCTIONS_WORKER_RUNTIME = "FUNCTIONS_WORKER_RUNTIME"; - private static final String KEY_FUNCTIONS_EXTENSION_VERSION = "FUNCTIONS_EXTENSION_VERSION"; - - private static final String ACCOUNT_NAME_SEGMENT = "AccountName="; - private static final String ACCOUNT_KEY_SEGMENT = "AccountKey="; - - private static class FunctionAppResource { - Map appSettings; - - String accountName; - String accountKey; - - StorageAccount storageAccount; - } - - private static FunctionAppResource getStorageAccount(StorageManager storageManager, FunctionApp functionApp) { - FunctionAppResource resource = new FunctionAppResource(); - resource.appSettings = functionApp.getAppSettings(); - - String storageAccountConnectionString = resource.appSettings.get(KEY_AZURE_WEB_JOBS_STORAGE).value(); - String[] segments = storageAccountConnectionString.split(";"); - for (String segment : segments) { - if (segment.startsWith(ACCOUNT_NAME_SEGMENT)) { - resource.accountName = segment.substring(ACCOUNT_NAME_SEGMENT.length()); - } else if (segment.startsWith(ACCOUNT_KEY_SEGMENT)) { - resource.accountKey = segment.substring(ACCOUNT_KEY_SEGMENT.length()); - } - } - if (resource.accountName != null) { - PagedIterable storageAccounts = storageManager.storageAccounts().list(); - for (StorageAccount storageAccount : storageAccounts) { - if (resource.accountName.equals(storageAccount.name())) { - resource.storageAccount = storageAccount; - break; - } - } - } - - return resource; - } - - private static String readLine(InputStream in) throws IOException { - ByteArrayOutputStream stream = new ByteArrayOutputStream(); - int c; - for (c = in.read(); c != '\n' && c >= 0; c = in.read()) { - stream.write(c); - } - if (c == -1 && stream.size() == 0) { - return null; - } - return stream.toString("UTF-8"); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/java/com/azure/resourcemanager/appservice/FunctionDeploymentSlotsTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/java/com/azure/resourcemanager/appservice/FunctionDeploymentSlotsTests.java deleted file mode 100644 index f50c34b0036a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/java/com/azure/resourcemanager/appservice/FunctionDeploymentSlotsTests.java +++ /dev/null @@ -1,173 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice; - -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.appservice.models.AppServicePlan; -import com.azure.resourcemanager.appservice.models.AppSetting; -import com.azure.resourcemanager.appservice.models.ConnectionString; -import com.azure.resourcemanager.appservice.models.ConnectionStringType; -import com.azure.resourcemanager.appservice.models.FunctionApp; -import com.azure.resourcemanager.appservice.models.FunctionDeploymentSlot; -import com.azure.resourcemanager.appservice.models.FunctionDeploymentSlotBasic; -import com.azure.resourcemanager.appservice.models.FunctionRuntimeStack; -import com.azure.resourcemanager.appservice.models.PricingTier; -import com.azure.resourcemanager.appservice.models.PythonVersion; -import com.azure.resourcemanager.test.utils.TestUtilities; -import com.azure.core.management.Region; -import java.util.Map; - -import com.azure.core.management.profile.AzureProfile; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public class FunctionDeploymentSlotsTests extends AppServiceTest { - private String webappName1 = ""; - private String slotName1 = ""; - private String slotName2 = ""; - private String slotName3 = ""; - - @Override - protected void initializeClients(HttpPipeline httpPipeline, AzureProfile profile) { - webappName1 = generateRandomResourceName("java-funcapp-", 20); - rgName = generateRandomResourceName("javacsmrg", 20); - slotName1 = generateRandomResourceName("java-slot-", 20); - slotName2 = generateRandomResourceName("java-slot-", 20); - slotName3 = generateRandomResourceName("java-slot-", 20); - - super.initializeClients(httpPipeline, profile); - } - - @Test - public void canCRUDFunctionSwapSlots() throws Exception { - // Create with consumption - FunctionApp functionApp1 = - appServiceManager - .functionApps() - .define(webappName1) - .withRegion(locationOrDefault(Region.US_WEST)) - .withNewResourceGroup(rgName) - .withNewAppServicePlan(PricingTier.STANDARD_S1) - .withAppSetting("appkey", "appvalue") - .withStickyAppSetting("stickykey", "stickyvalue") - .withConnectionString("connectionName", "connectionValue", ConnectionStringType.CUSTOM) - .withStickyConnectionString("stickyName", "stickyValue", ConnectionStringType.CUSTOM) - .withPythonVersion(PythonVersion.PYTHON_27) - .create(); - Assertions.assertNotNull(functionApp1); - Assertions.assertEquals(locationOrDefault(Region.US_WEST), functionApp1.region()); - AppServicePlan plan1 = appServiceManager.appServicePlans().getById(functionApp1.appServicePlanId()); - Assertions.assertNotNull(plan1); - Assertions.assertEquals(locationOrDefault(Region.US_WEST), plan1.region()); - - /* - IMPORTANT, function app cannot create slot with empty config. - "site.withSiteConfig(new SiteConfigInner())" sets the empty config. - However service will response with "Function App app settings are not expected to be empty. Please try again with WEBSITE_CONTENTAZUREFILECONNECTIONSTRING as a storage account connection string.: Function App app settings are not expected to be empty. Please try again with WEBSITE_CONTENTAZUREFILECONNECTIONSTRING as a storage account connection string.", if this is done to function app. - */ - - // Create a deployment slot with empty config - FunctionDeploymentSlot slot1 = - functionApp1 - .deploymentSlots() - .define(slotName1) - .withBrandNewConfiguration() - .withPythonVersion(PythonVersion.PYTHON_34) - .create(); - Assertions.assertNotNull(slot1); - Assertions.assertEquals(PythonVersion.PYTHON_34, slot1.pythonVersion()); -// Map appSettingMap = slot1.getAppSettings(); -// Assertions.assertFalse(appSettingMap.containsKey("appkey")); -// Assertions.assertFalse(appSettingMap.containsKey("stickykey")); -// Map connectionStringMap = slot1.getConnectionStrings(); -// Assertions.assertFalse(connectionStringMap.containsKey("connectionName")); -// Assertions.assertFalse(connectionStringMap.containsKey("stickyName")); - - // Create a deployment slot with web app's config - FunctionDeploymentSlot slot2 = - functionApp1.deploymentSlots().define(slotName2).withConfigurationFromParent().create(); - Assertions.assertNotNull(slot2); - Assertions.assertEquals(PythonVersion.PYTHON_27, slot2.pythonVersion()); - Map appSettingMap = slot2.getAppSettings(); - Assertions.assertEquals("appvalue", appSettingMap.get("appkey").value()); - Assertions.assertEquals(false, appSettingMap.get("appkey").sticky()); - Assertions.assertEquals("stickyvalue", appSettingMap.get("stickykey").value()); - Assertions.assertEquals(true, appSettingMap.get("stickykey").sticky()); - Map connectionStringMap = slot2.getConnectionStrings(); - Assertions.assertEquals("connectionValue", connectionStringMap.get("connectionName").value()); - Assertions.assertEquals(false, connectionStringMap.get("connectionName").sticky()); - Assertions.assertEquals("stickyValue", connectionStringMap.get("stickyName").value()); - Assertions.assertEquals(true, connectionStringMap.get("stickyName").sticky()); - - // Update deployment slot - slot2 - .update() - .withPythonVersion(PythonVersion.PYTHON_34) - .withAppSetting("slot2key", "slot2value") - .withStickyAppSetting("sticky2key", "sticky2value") - .apply(); - Assertions.assertNotNull(slot2); - Assertions.assertEquals(PythonVersion.PYTHON_34, slot2.pythonVersion()); - appSettingMap = slot2.getAppSettings(); - Assertions.assertEquals("slot2value", appSettingMap.get("slot2key").value()); - - // Create 3rd deployment slot with configuration from slot 2 - FunctionDeploymentSlot slot3 = - functionApp1.deploymentSlots().define(slotName3).withConfigurationFromDeploymentSlot(slot2).create(); - Assertions.assertNotNull(slot3); - Assertions.assertEquals(PythonVersion.PYTHON_34, slot3.pythonVersion()); - appSettingMap = slot3.getAppSettings(); - Assertions.assertEquals("slot2value", appSettingMap.get("slot2key").value()); - - slot3 - .update() - .withPythonVersion(PythonVersion.PYTHON_27) - .apply(); - - // Get - FunctionDeploymentSlot deploymentSlot = functionApp1.deploymentSlots().getByName(slotName3); - Assertions.assertEquals(slot3.id(), deploymentSlot.id()); - - // List - PagedIterable deploymentSlots = functionApp1.deploymentSlots().list(); - Assertions.assertEquals(3, TestUtilities.getSize(deploymentSlots)); - - // Swap - slot3.swap(slot1.name()); - slot1 = functionApp1.deploymentSlots().getByName(slotName1); - Assertions.assertEquals(PythonVersion.PYTHON_27, slot1.pythonVersion()); - Assertions.assertEquals(PythonVersion.PYTHON_34, slot3.pythonVersion()); - Map slot1AppSettings = slot1.getAppSettings(); - Map slot3AppSettings = slot3.getAppSettings(); - Assertions.assertEquals("appvalue", slot1AppSettings.get("appkey").value()); - Assertions.assertEquals("slot2value", slot1AppSettings.get("slot2key").value()); - Assertions.assertEquals("sticky2value", slot3AppSettings.get("sticky2key").value()); - Assertions.assertEquals("stickyvalue", slot3AppSettings.get("stickykey").value()); - } - - private static final String FUNCTION_APP_PACKAGE_URL = - "https://raw.githubusercontent.com/Azure/azure-sdk-for-java/main/sdk/resourcemanager/azure-resourcemanager-appservice/src/test/resources/java-functions.zip"; - - @Test - public void canCRUDFunctionSlots() { - FunctionApp functionApp1 = appServiceManager.functionApps().define(webappName1) - .withRegion(locationOrDefault(Region.US_EAST)) - .withNewResourceGroup(rgName) - .withNewLinuxAppServicePlan(PricingTier.STANDARD_S1) - .withBuiltInImage(FunctionRuntimeStack.JAVA_8) - .withHttpsOnly(true) - .withAppSetting("WEBSITE_RUN_FROM_PACKAGE", FUNCTION_APP_PACKAGE_URL) - .create(); - Assertions.assertNotNull(functionApp1); - - FunctionDeploymentSlot slot1 = functionApp1.deploymentSlots().define("slot1") - .withConfigurationFromParent() - .create(); - - slot1.update() - .withPublicDockerHubImage("wordpress") - .apply(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/java/com/azure/resourcemanager/appservice/HostnameSslTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/java/com/azure/resourcemanager/appservice/HostnameSslTests.java deleted file mode 100644 index 304809ab0596..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/java/com/azure/resourcemanager/appservice/HostnameSslTests.java +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice; - -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.rest.Response; -import com.azure.resourcemanager.appservice.models.CustomHostnameDnsRecordType; -import com.azure.resourcemanager.appservice.models.PricingTier; -import com.azure.resourcemanager.appservice.models.WebApp; -import com.azure.core.management.Region; -import com.azure.core.management.profile.AzureProfile; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public class HostnameSslTests extends AppServiceTest { - private String webappName = ""; - private String appServicePlanName = ""; - private String domainName = ""; - - @Override - protected void initializeClients(HttpPipeline httpPipeline, AzureProfile profile) { - super.initializeClients(httpPipeline, profile); - - webappName = generateRandomResourceName("java-webapp-", 20); - appServicePlanName = generateRandomResourceName("java-asp-", 20); - - domainName = super.domain.name(); - } - - @Test - @Disabled("Need a domain and a certificate") - public void canBindHostnameAndSsl() throws Exception { - // hostname binding - appServiceManager - .webApps() - .define(webappName) - .withRegion(locationOrDefault(Region.US_WEST)) - .withNewResourceGroup(rgName) - .withNewWindowsPlan(PricingTier.BASIC_B1) - .defineHostnameBinding() - .withAzureManagedDomain(domain) - .withSubDomain(webappName) - .withDnsRecordType(CustomHostnameDnsRecordType.CNAME) - .attach() - .create(); - - WebApp webApp = appServiceManager.webApps().getByResourceGroup(rgName, webappName); - Assertions.assertNotNull(webApp); - if (!isPlaybackMode()) { - Response response = curl("http://" + webappName + "." + domainName); - Assertions.assertEquals(200, response.getStatusCode()); - Assertions.assertNotNull(response.getValue()); - } - // hostname binding shortcut - webApp.update().withManagedHostnameBindings(domain, webappName + "-1", webappName + "-2").apply(); - if (!isPlaybackMode()) { - Response response = curl("http://" + webappName + "-1." + domainName); - Assertions.assertEquals(200, response.getStatusCode()); - Assertions.assertNotNull(response.getValue()); - response = curl("http://" + webappName + "-2." + domainName); - Assertions.assertEquals(200, response.getStatusCode()); - Assertions.assertNotNull(response.getValue()); - } - // SSL binding - webApp - .update() - .defineSslBinding() - .forHostname(webappName + "." + domainName) - .withExistingAppServiceCertificateOrder(certificateOrder) - .withSniBasedSsl() - .attach() - .apply(); -// if (!isPlaybackMode()) { -// Response response = null; -// int retryCount = 3; -// while (response == null && retryCount > 0) { -// // TODO (weidxu) this probably not work after switch from okhttp to azure-core -// try { -// response = curl("https://" + webappName + "." + domainName); -// } catch (SSLPeerUnverifiedException e) { -// retryCount--; -// ResourceManagerUtils.sleep(Duration.ofSeconds(5)); -// } -// } -// if (retryCount == 0) { -// Assertions.fail(); -// } -// Assertions.assertEquals(200, response.getStatusCode()); -// Assertions.assertNotNull(response.getValue()); -// } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/java/com/azure/resourcemanager/appservice/LinuxWebAppsTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/java/com/azure/resourcemanager/appservice/LinuxWebAppsTests.java deleted file mode 100644 index 9b58215b8016..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/java/com/azure/resourcemanager/appservice/LinuxWebAppsTests.java +++ /dev/null @@ -1,193 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice; - -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.rest.Response; -import com.azure.resourcemanager.appservice.models.AppServicePlan; -import com.azure.resourcemanager.appservice.models.OperatingSystem; -import com.azure.resourcemanager.appservice.models.PricingTier; -import com.azure.resourcemanager.appservice.models.RuntimeStack; -import com.azure.resourcemanager.appservice.models.WebApp; -import com.azure.core.management.Region; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import java.io.ByteArrayInputStream; -import java.time.Duration; -import java.util.zip.ZipInputStream; -import org.apache.commons.io.IOUtils; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public class LinuxWebAppsTests extends AppServiceTest { - private String rgName1 = ""; - private String rgName2 = ""; - private String webappName1 = ""; - private String webappName2 = ""; - - @Override - protected void initializeClients(HttpPipeline httpPipeline, AzureProfile profile) { - webappName1 = generateRandomResourceName("java-webapp-", 20); - webappName2 = generateRandomResourceName("java-webapp-", 20); - rgName1 = generateRandomResourceName("javacsmrg", 20); - rgName2 = generateRandomResourceName("javacsmrg", 20); - - super.initializeClients(httpPipeline, profile); - } - - @Override - protected void cleanUpResources() { - resourceManager.resourceGroups().beginDeleteByName(rgName2); - resourceManager.resourceGroups().beginDeleteByName(rgName1); - } - - @Test - public void canCRUDLinuxWebApp() throws Exception { - // Create with new app service plan - WebApp webApp1 = - appServiceManager - .webApps() - .define(webappName1) - .withRegion(locationOrDefault(Region.US_WEST)) - .withNewResourceGroup(rgName1) - .withNewLinuxPlan(PricingTier.BASIC_B1) - .withPublicDockerHubImage("wordpress") - .create(); - Assertions.assertNotNull(webApp1); - Assertions.assertEquals(locationOrDefault(Region.US_WEST), webApp1.region()); - AppServicePlan plan1 = appServiceManager.appServicePlans().getById(webApp1.appServicePlanId()); - Assertions.assertNotNull(plan1); - Assertions.assertEquals(locationOrDefault(Region.US_WEST), plan1.region()); - Assertions.assertEquals(PricingTier.BASIC_B1, plan1.pricingTier()); - Assertions.assertEquals(OperatingSystem.LINUX, plan1.operatingSystem()); - Assertions.assertEquals(OperatingSystem.LINUX, webApp1.operatingSystem()); - - // Create in a new group with existing app service plan - WebApp webApp2 = - appServiceManager - .webApps() - .define(webappName2) - .withExistingLinuxPlan(plan1) - .withNewResourceGroup(rgName2) - .withPublicDockerHubImage("tomcat") - .withContainerLoggingEnabled() - .create(); - Assertions.assertNotNull(webApp2); - Assertions.assertEquals(locationOrDefault(Region.US_WEST), webApp2.region()); - Assertions.assertEquals(OperatingSystem.LINUX, webApp2.operatingSystem()); - - // Get - WebApp webApp = appServiceManager.webApps().getByResourceGroup(rgName1, webApp1.name()); - Assertions.assertEquals(OperatingSystem.LINUX, webApp.operatingSystem()); - webApp = appServiceManager.webApps().getById(webApp2.id()); - Assertions.assertEquals(OperatingSystem.LINUX, webApp.operatingSystem()); - - // View logs - if (!isPlaybackMode()) { - // warm up - curl("http://" + webApp.defaultHostname()); - } - byte[] logs = webApp.getContainerLogs(); - Assertions.assertTrue(logs.length > 0); - byte[] logsZip = webApp.getContainerLogsZip(); - if (!isPlaybackMode()) { - ZipInputStream zipInputStream = new ZipInputStream(new ByteArrayInputStream(logsZip)); - Assertions.assertNotNull(zipInputStream.getNextEntry()); - byte[] unzipped = IOUtils.toByteArray(zipInputStream); - Assertions.assertTrue(unzipped.length > 0); - } - - // Update - webApp = webApp1.update().withNewAppServicePlan(PricingTier.STANDARD_S2).apply(); - AppServicePlan plan2 = appServiceManager.appServicePlans().getById(webApp1.appServicePlanId()); - Assertions.assertNotNull(plan2); - Assertions.assertEquals(locationOrDefault(Region.US_WEST), plan2.region()); - Assertions.assertEquals(PricingTier.STANDARD_S2, plan2.pricingTier()); - Assertions.assertEquals(OperatingSystem.LINUX, plan2.operatingSystem()); - - webApp = - webApp1 - .update() - .withBuiltInImage(RuntimeStack.NODEJS_10_LTS) - .defineSourceControl() - .withPublicGitRepository("https://github.com/jianghaolu/azure-site-test.git") - .withBranch("master") - .attach() - .apply(); - Assertions.assertNotNull(webApp); - if (!isPlaybackMode()) { - // maybe 2 minutes is enough? - ResourceManagerUtils.sleep(Duration.ofMinutes(2)); - Response response = curl("http://" + webApp1.defaultHostname()); - Assertions.assertEquals(200, response.getStatusCode()); - String body = response.getValue(); - Assertions.assertNotNull(body); - Assertions.assertTrue(body.contains("Hello world from linux 4")); - } - - // update to a java 11 image - webApp = webApp1.update().withBuiltInImage(RuntimeStack.TOMCAT_9_0_JAVA11).apply(); - Assertions.assertNotNull(webApp); - } - - @Test - public void canCRUDLinuxJava11WebApp() throws Exception { - // Create with new app service plan - WebApp webApp1 = - appServiceManager - .webApps() - .define(webappName1) - .withRegion(locationOrDefault(Region.US_WEST)) - .withNewResourceGroup(rgName1) - .withNewLinuxPlan(PricingTier.BASIC_B1) - .withBuiltInImage(RuntimeStack.TOMCAT_9_0_JAVA11) - .create(); - Assertions.assertNotNull(webApp1); - Assertions.assertEquals(locationOrDefault(Region.US_WEST), webApp1.region()); - AppServicePlan plan1 = appServiceManager.appServicePlans().getById(webApp1.appServicePlanId()); - Assertions.assertNotNull(plan1); - Assertions.assertEquals(locationOrDefault(Region.US_WEST), plan1.region()); - Assertions.assertEquals(PricingTier.BASIC_B1, plan1.pricingTier()); - Assertions.assertEquals(OperatingSystem.LINUX, plan1.operatingSystem()); - Assertions.assertEquals(OperatingSystem.LINUX, webApp1.operatingSystem()); - - WebApp webApp2 = - appServiceManager - .webApps() - .define(webappName2) - .withRegion(locationOrDefault(Region.US_WEST)) - .withNewResourceGroup(rgName2) - .withNewLinuxPlan(PricingTier.BASIC_B2) - .withBuiltInImage(RuntimeStack.TOMCAT_8_5_JAVA11) - .create(); - Assertions.assertNotNull(webApp1); - Assertions.assertEquals(locationOrDefault(Region.US_WEST), webApp2.region()); - plan1 = appServiceManager.appServicePlans().getById(webApp2.appServicePlanId()); - Assertions.assertNotNull(plan1); - Assertions.assertEquals(locationOrDefault(Region.US_WEST), plan1.region()); - Assertions.assertEquals(PricingTier.BASIC_B2, plan1.pricingTier()); - Assertions.assertEquals(OperatingSystem.LINUX, plan1.operatingSystem()); - Assertions.assertEquals(OperatingSystem.LINUX, webApp2.operatingSystem()); - - WebApp webApp = - webApp1 - .update() - .withBuiltInImage(RuntimeStack.NODEJS_14_LTS) - .defineSourceControl() - .withPublicGitRepository("https://github.com/jianghaolu/azure-site-test.git") - .withBranch("master") - .attach() - .apply(); - Assertions.assertNotNull(webApp); - if (!isPlaybackMode()) { - // wait long - ResourceManagerUtils.sleep(Duration.ofMinutes(5)); - Response response = curl("https://" + webApp1.defaultHostname()); - Assertions.assertEquals(200, response.getStatusCode()); - String body = response.getValue(); - Assertions.assertNotNull(body); - Assertions.assertTrue(body.contains("Hello world from linux 4")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/java/com/azure/resourcemanager/appservice/OneDeployTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/java/com/azure/resourcemanager/appservice/OneDeployTests.java deleted file mode 100644 index dd6a67f3c51c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/java/com/azure/resourcemanager/appservice/OneDeployTests.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice; - -import com.azure.core.management.Region; -import com.azure.core.test.annotation.DoNotRecord; -import com.azure.resourcemanager.appservice.models.DeployType; -import com.azure.resourcemanager.appservice.models.JavaVersion; -import com.azure.resourcemanager.appservice.models.PricingTier; -import com.azure.resourcemanager.appservice.models.WebApp; -import com.azure.resourcemanager.appservice.models.WebContainer; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -import java.io.File; -import java.time.Duration; - -public class OneDeployTests extends AppServiceTest { - - @Test - @DoNotRecord - public void canDeployZip() throws Exception { - if (skipInPlayback()) { - return; - } - - String webAppName1 = generateRandomResourceName("webapp", 10); - - WebApp webApp1 = - appServiceManager - .webApps() - .define(webAppName1) - .withRegion(locationOrDefault(Region.US_CENTRAL)) - .withNewResourceGroup(rgName) - .withNewWindowsPlan(PricingTier.BASIC_B1) - .withJavaVersion(JavaVersion.JAVA_8_NEWEST) - .withWebContainer(WebContainer.TOMCAT_8_5_NEWEST) - .withHttpsOnly(true) - .create(); - - File zipFile = new File(OneDeployTests.class.getResource("/webapps.zip").getPath()); - webApp1.deploy(DeployType.ZIP, zipFile); - - // wait a bit - ResourceManagerUtils.sleep(Duration.ofSeconds(10)); - - String response = curl("https://" + webAppName1 + ".azurewebsites.net/" + "helloworld/").getValue(); - Assertions.assertTrue(response.contains("Hello")); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/java/com/azure/resourcemanager/appservice/ServiceTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/java/com/azure/resourcemanager/appservice/ServiceTests.java deleted file mode 100644 index a016550a20ad..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/java/com/azure/resourcemanager/appservice/ServiceTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice; - -import com.azure.core.test.annotation.DoNotRecord; -import org.junit.jupiter.api.Test; - -public class ServiceTests extends AppServiceTest { - - @DoNotRecord(skipInPlayback = true) - @Test - public void canAccess() { - appServiceManager.webApps().list().stream().count(); - appServiceManager.appServicePlans().list().stream().count(); - appServiceManager.domains().list().stream().count(); - appServiceManager.certificates().list().stream().count(); - appServiceManager.certificateOrders().list().stream().count(); - } - - @Override - protected void cleanUpResources() { - // NOOP - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/java/com/azure/resourcemanager/appservice/SourceControlTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/java/com/azure/resourcemanager/appservice/SourceControlTests.java deleted file mode 100644 index 0d5081754cfa..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/java/com/azure/resourcemanager/appservice/SourceControlTests.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice; - -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.rest.Response; -import com.azure.resourcemanager.appservice.models.PricingTier; -import com.azure.resourcemanager.appservice.models.WebApp; -import com.azure.core.management.Region; -import com.azure.core.management.profile.AzureProfile; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public class SourceControlTests extends AppServiceTest { - private String webappName = ""; - - @Override - protected void initializeClients(HttpPipeline httpPipeline, AzureProfile profile) { - webappName = generateRandomResourceName("java-webapp-", 20); - - super.initializeClients(httpPipeline, profile); - } - - @Test - public void canDeploySourceControl() throws Exception { - // Create web app - WebApp webApp = - appServiceManager - .webApps() - .define(webappName) - .withRegion(locationOrDefault(Region.US_WEST)) - .withNewResourceGroup(rgName) - .withNewWindowsPlan(PricingTier.STANDARD_S1) - .defineSourceControl() - .withPublicGitRepository("https://github.com/jianghaolu/azure-site-test") - .withBranch("master") - .attach() - .create(); - Assertions.assertNotNull(webApp); - if (!isPlaybackMode()) { - Response response = curl("http://" + webappName + "." + "azurewebsites.net"); - Assertions.assertEquals(200, response.getStatusCode()); - String body = response.getValue(); - Assertions.assertNotNull(body); - Assertions.assertTrue(body.contains("Hello world from linux 4")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/java/com/azure/resourcemanager/appservice/UtilsTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/java/com/azure/resourcemanager/appservice/UtilsTests.java deleted file mode 100644 index b29aa3a97006..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/java/com/azure/resourcemanager/appservice/UtilsTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice; - -import java.util.Collection; - -import com.azure.resourcemanager.appservice.models.RuntimeStack; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public class UtilsTests { - - @Test - public void testAttributeCollection() throws Exception { - Collection runtimeStacks = RuntimeStack.getAll(); - int count = runtimeStacks.size(); - Assertions.assertTrue(count > 10); // a rough count - - RuntimeStack newRuntimeStack = new RuntimeStack("stack", "version"); // new, but not count as pre-defined - - runtimeStacks = RuntimeStack.getAll(); - Assertions.assertEquals(count, runtimeStacks.size()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/java/com/azure/resourcemanager/appservice/WarDeployTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/java/com/azure/resourcemanager/appservice/WarDeployTests.java deleted file mode 100644 index 6f95522f556f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/java/com/azure/resourcemanager/appservice/WarDeployTests.java +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice; - -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.rest.Response; -import com.azure.resourcemanager.appservice.models.JavaVersion; -import com.azure.resourcemanager.appservice.models.PricingTier; -import com.azure.resourcemanager.appservice.models.WebApp; -import com.azure.resourcemanager.appservice.models.WebContainer; -import com.azure.core.management.Region; -import java.io.File; -import java.io.FileInputStream; -import java.io.InputStream; -import java.time.Duration; - -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public class WarDeployTests extends AppServiceTest { - private String webappName = ""; - - private final File warFile = new File(WarDeployTests.class.getResource("/helloworld.war").getPath()); - - @Override - protected void initializeClients(HttpPipeline httpPipeline, AzureProfile profile) { - webappName = "JAVA" + generateRandomResourceName("webapp-", 20); - - super.initializeClients(httpPipeline, profile); - } - - @Test - public void canDeployWar() throws Exception { - if (!isPlaybackMode()) { - // webApp.warDeploy method randomly fails in playback mode with error java.net.UnknownHostException, - // Run this only in live mode ignore in playback until we find the root cause - // https://api.travis-ci.org/v3/job/427936160/log.txt - // - // Create web app - WebApp webApp = - appServiceManager - .webApps() - .define(webappName) - .withRegion(locationOrDefault(Region.US_WEST)) - .withNewResourceGroup(rgName) - .withNewWindowsPlan(PricingTier.STANDARD_S1) - .withJavaVersion(JavaVersion.JAVA_8_NEWEST) - .withWebContainer(WebContainer.TOMCAT_9_0_NEWEST) - .create(); - Assertions.assertNotNull(webApp); - - webApp.warDeploy(warFile); - - if (!isPlaybackMode()) { - ResourceManagerUtils.sleep(Duration.ofSeconds(30)); - - Response response = curl("http://" + webappName + "." + "azurewebsites.net"); - Assertions.assertEquals(200, response.getStatusCode()); - String body = response.getValue(); - Assertions.assertNotNull(body); - Assertions.assertTrue(body.contains("Azure Samples Hello World")); - } - } - } - - @Test - public void canDeployMultipleWars() throws Exception { - // Create web app - WebApp webApp = - appServiceManager - .webApps() - .define(webappName) - .withRegion(locationOrDefault(Region.US_WEST)) - .withNewResourceGroup(rgName) - .withNewWindowsPlan(PricingTier.STANDARD_S1) - .withJavaVersion(JavaVersion.JAVA_8_NEWEST) - .withWebContainer(WebContainer.TOMCAT_9_0_NEWEST) - .create(); - Assertions.assertNotNull(webApp); - - if (!isPlaybackMode()) { - webApp.warDeploy(warFile); - try (InputStream is = new FileInputStream(warFile)) { - webApp.warDeploy(is, warFile.length(), "app2"); - } - - ResourceManagerUtils.sleep(Duration.ofSeconds(30)); - - Response response = curl("http://" + webappName + "." + "azurewebsites.net"); - Assertions.assertEquals(200, response.getStatusCode()); - String body = response.getValue(); - Assertions.assertNotNull(body); - Assertions.assertTrue(body.contains("Azure Samples Hello World")); - - response = curl("http://" + webappName + "." + "azurewebsites.net/app2/"); - Assertions.assertEquals(200, response.getStatusCode()); - body = response.getValue(); - Assertions.assertNotNull(body); - Assertions.assertTrue(body.contains("Azure Samples Hello World")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/java/com/azure/resourcemanager/appservice/WebAppConfigTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/java/com/azure/resourcemanager/appservice/WebAppConfigTests.java deleted file mode 100644 index c9db98b32079..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/java/com/azure/resourcemanager/appservice/WebAppConfigTests.java +++ /dev/null @@ -1,178 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice; - -import com.azure.core.http.HttpPipeline; -import com.azure.resourcemanager.appservice.models.AppSetting; -import com.azure.resourcemanager.appservice.models.ConnectionString; -import com.azure.resourcemanager.appservice.models.ConnectionStringType; -import com.azure.resourcemanager.appservice.models.FtpsState; -import com.azure.resourcemanager.appservice.models.JavaVersion; -import com.azure.resourcemanager.appservice.models.NetFrameworkVersion; -import com.azure.resourcemanager.appservice.models.PricingTier; -import com.azure.resourcemanager.appservice.models.PythonVersion; -import com.azure.resourcemanager.appservice.models.SupportedTlsVersions; -import com.azure.resourcemanager.appservice.models.WebApp; -import com.azure.resourcemanager.appservice.models.WebContainer; -import com.azure.core.management.Region; -import java.util.Map; - -import com.azure.core.management.profile.AzureProfile; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public class WebAppConfigTests extends AppServiceTest { - private String webappName = ""; - - @Override - protected void initializeClients(HttpPipeline httpPipeline, AzureProfile profile) { - webappName = generateRandomResourceName("java-webapp-", 20); - - super.initializeClients(httpPipeline, profile); - } - - @Test - public void canCRUDWebAppConfig() throws Exception { - // Create with new app service plan - appServiceManager - .webApps() - .define(webappName) - .withRegion(locationOrDefault(Region.US_EAST)) - .withNewResourceGroup(rgName) - .withNewWindowsPlan(PricingTier.BASIC_B1) - .withNetFrameworkVersion(NetFrameworkVersion.V3_0) - .withMinTlsVersion(SupportedTlsVersions.ONE_ONE) - .create(); - - WebApp webApp = appServiceManager.webApps().getByResourceGroup(rgName, webappName); - Assertions.assertNotNull(webApp); - Assertions.assertEquals(locationOrDefault(Region.US_EAST), webApp.region()); - Assertions.assertEquals(NetFrameworkVersion.V3_0, webApp.netFrameworkVersion()); - Assertions.assertEquals(SupportedTlsVersions.ONE_ONE, webApp.minTlsVersion()); - - // Java version - webApp.update().withJavaVersion(JavaVersion.JAVA_1_7_0_51).withWebContainer(WebContainer.TOMCAT_7_0_50).apply(); - webApp = appServiceManager.webApps().getByResourceGroup(rgName, webappName); - Assertions.assertEquals(JavaVersion.JAVA_1_7_0_51, webApp.javaVersion()); - - // Python version - webApp.update().withPythonVersion(PythonVersion.PYTHON_34).apply(); - webApp = appServiceManager.webApps().getByResourceGroup(rgName, webappName); - Assertions.assertEquals(PythonVersion.PYTHON_34, webApp.pythonVersion()); - - // Default documents - int documentSize = webApp.defaultDocuments().size(); - webApp.update().withDefaultDocument("somedocument.html").apply(); - webApp = appServiceManager.webApps().getByResourceGroup(rgName, webappName); - Assertions.assertEquals(documentSize + 1, webApp.defaultDocuments().size()); - Assertions.assertTrue(webApp.defaultDocuments().contains("somedocument.html")); - - // App settings - webApp.update().withAppSetting("appkey", "appvalue").withStickyAppSetting("stickykey", "stickyvalue").apply(); - webApp = appServiceManager.webApps().getByResourceGroup(rgName, webappName); - Map appSettingMap = webApp.getAppSettings(); - Assertions.assertEquals("appvalue", appSettingMap.get("appkey").value()); - Assertions.assertEquals(false, appSettingMap.get("appkey").sticky()); - Assertions.assertEquals("stickyvalue", appSettingMap.get("stickykey").value()); - Assertions.assertEquals(true, appSettingMap.get("stickykey").sticky()); - - // Connection strings - webApp - .update() - .withConnectionString("connectionName", "connectionValue", ConnectionStringType.CUSTOM) - .withStickyConnectionString("stickyName", "stickyValue", ConnectionStringType.CUSTOM) - .apply(); - webApp = appServiceManager.webApps().getByResourceGroup(rgName, webappName); - Map connectionStringMap = webApp.getConnectionStrings(); - Assertions.assertEquals("connectionValue", connectionStringMap.get("connectionName").value()); - Assertions.assertEquals(false, connectionStringMap.get("connectionName").sticky()); - Assertions.assertEquals("stickyValue", connectionStringMap.get("stickyName").value()); - Assertions.assertEquals(true, connectionStringMap.get("stickyName").sticky()); - - // HTTPS only - webApp = webApp.update().withHttpsOnly(true).apply(); - Assertions.assertTrue(webApp.httpsOnly()); - - // FTPS - webApp = webApp.update().withFtpsState(FtpsState.FTPS_ONLY).apply(); - Assertions.assertEquals(FtpsState.FTPS_ONLY, webApp.ftpsState()); - - // Min TLS version - webApp = webApp.update().withMinTlsVersion(SupportedTlsVersions.ONE_TWO).apply(); - Assertions.assertEquals(SupportedTlsVersions.ONE_TWO, webApp.minTlsVersion()); - - // Logs - webApp = webApp.update().withContainerLoggingEnabled().apply(); - Assertions.assertTrue(webApp.diagnosticLogsConfig().innerModel().httpLogs().fileSystem().enabled()); - // verify on new instance - // https://github.com/Azure/azure-libraries-for-java/issues/759 - webApp = appServiceManager.webApps().getById(webApp.id()); - Assertions.assertTrue(webApp.diagnosticLogsConfig().innerModel().httpLogs().fileSystem().enabled()); - } - - @Test - public void canCRUDWebAppConfigJava11() throws Exception { - // Create with new app service plan - appServiceManager - .webApps() - .define(webappName) - .withRegion(locationOrDefault(Region.US_EAST)) - .withNewResourceGroup(rgName) - .withNewWindowsPlan(PricingTier.BASIC_B1) - .withNetFrameworkVersion(NetFrameworkVersion.V3_0) - .create(); - - WebApp webApp = appServiceManager.webApps().getByResourceGroup(rgName, webappName); - Assertions.assertNotNull(webApp); - Assertions.assertEquals(locationOrDefault(Region.US_EAST), webApp.region()); - Assertions.assertEquals(NetFrameworkVersion.V3_0, webApp.netFrameworkVersion()); - - // Java version - webApp.update().withJavaVersion(JavaVersion.JAVA_11).withWebContainer(WebContainer.TOMCAT_9_0_NEWEST).apply(); - webApp = appServiceManager.webApps().getByResourceGroup(rgName, webappName); - Assertions.assertEquals(JavaVersion.JAVA_11, webApp.javaVersion()); - - // Python version - webApp.update().withPythonVersion(PythonVersion.PYTHON_34).apply(); - webApp = appServiceManager.webApps().getByResourceGroup(rgName, webappName); - Assertions.assertEquals(PythonVersion.PYTHON_34, webApp.pythonVersion()); - - // Default documents - int documentSize = webApp.defaultDocuments().size(); - webApp.update().withDefaultDocument("somedocument.html").apply(); - webApp = appServiceManager.webApps().getByResourceGroup(rgName, webappName); - Assertions.assertEquals(documentSize + 1, webApp.defaultDocuments().size()); - Assertions.assertTrue(webApp.defaultDocuments().contains("somedocument.html")); - - // App settings - webApp.update().withAppSetting("appkey", "appvalue").withStickyAppSetting("stickykey", "stickyvalue").apply(); - webApp = appServiceManager.webApps().getByResourceGroup(rgName, webappName); - Map appSettingMap = webApp.getAppSettings(); - Assertions.assertEquals("appvalue", appSettingMap.get("appkey").value()); - Assertions.assertEquals(false, appSettingMap.get("appkey").sticky()); - Assertions.assertEquals("stickyvalue", appSettingMap.get("stickykey").value()); - Assertions.assertEquals(true, appSettingMap.get("stickykey").sticky()); - - // Connection strings - webApp - .update() - .withConnectionString("connectionName", "connectionValue", ConnectionStringType.CUSTOM) - .withStickyConnectionString("stickyName", "stickyValue", ConnectionStringType.CUSTOM) - .apply(); - webApp = appServiceManager.webApps().getByResourceGroup(rgName, webappName); - Map connectionStringMap = webApp.getConnectionStrings(); - Assertions.assertEquals("connectionValue", connectionStringMap.get("connectionName").value()); - Assertions.assertEquals(false, connectionStringMap.get("connectionName").sticky()); - Assertions.assertEquals("stickyValue", connectionStringMap.get("stickyName").value()); - Assertions.assertEquals(true, connectionStringMap.get("stickyName").sticky()); - - // HTTPS only - webApp = webApp.update().withHttpsOnly(true).apply(); - Assertions.assertTrue(webApp.httpsOnly()); - - // FTPS - webApp = webApp.update().withFtpsState(FtpsState.FTPS_ONLY).apply(); - Assertions.assertEquals(FtpsState.FTPS_ONLY, webApp.ftpsState()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/java/com/azure/resourcemanager/appservice/WebAppsMsiTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/java/com/azure/resourcemanager/appservice/WebAppsMsiTests.java deleted file mode 100644 index da6900b7d75a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/java/com/azure/resourcemanager/appservice/WebAppsMsiTests.java +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice; - -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.rest.Response; -import com.azure.resourcemanager.appservice.models.AppServicePlan; -import com.azure.resourcemanager.appservice.models.JavaVersion; -import com.azure.resourcemanager.appservice.models.PricingTier; -import com.azure.resourcemanager.appservice.models.RemoteVisualStudioVersion; -import com.azure.resourcemanager.appservice.models.WebApp; -import com.azure.resourcemanager.appservice.models.WebContainer; -import com.azure.resourcemanager.authorization.models.BuiltInRole; -import com.azure.core.management.Region; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; - -import java.time.Duration; -import java.util.Set; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public class WebAppsMsiTests extends AppServiceTest { - private String rgName1 = ""; - private String webappName1 = ""; - private String vaultName = ""; - - @Override - protected void initializeClients(HttpPipeline httpPipeline, AzureProfile profile) { - webappName1 = generateRandomResourceName("java-webapp-", 20); - rgName1 = generateRandomResourceName("javacsmrg", 20); - vaultName = generateRandomResourceName("java-vault-", 20); - super.initializeClients(httpPipeline, profile); - } - - @Override - protected void cleanUpResources() { - resourceManager.resourceGroups().beginDeleteByName(rgName1); - try { - resourceManager.resourceGroups().beginDeleteByName(rgName); - } catch (Exception e) { - // fine, RG_NAME is not created - } - } - - @Test - @Disabled("MSI not available in AzureStack profile 2020-09-01-hybrid") - public void canCRUDWebAppWithMsi() throws Exception { - // Create with new app service plan - WebApp webApp = - appServiceManager - .webApps() - .define(webappName1) - .withRegion(locationOrDefault(Region.US_WEST)) - .withNewResourceGroup(rgName1) - .withNewWindowsPlan(PricingTier.BASIC_B1) - .withRemoteDebuggingEnabled(RemoteVisualStudioVersion.VS2019) - .withSystemAssignedManagedServiceIdentity() - .withSystemAssignedIdentityBasedAccessToCurrentResourceGroup(BuiltInRole.CONTRIBUTOR) - .withJavaVersion(JavaVersion.JAVA_8_NEWEST) - .withWebContainer(WebContainer.TOMCAT_8_0_NEWEST) - .create(); - Assertions.assertNotNull(webApp); - Assertions.assertEquals(locationOrDefault(Region.US_WEST), webApp.region()); - AppServicePlan plan = appServiceManager.appServicePlans().getById(webApp.appServicePlanId()); - Assertions.assertNotNull(plan); - Assertions.assertEquals(locationOrDefault(Region.US_WEST), plan.region()); - Assertions.assertEquals(PricingTier.BASIC_B1, plan.pricingTier()); - Assertions.assertNotNull(webApp.systemAssignedManagedServiceIdentityPrincipalId()); - Assertions.assertNotNull(webApp.systemAssignedManagedServiceIdentityTenantId()); - - if (!isPlaybackMode()) { - // Check availability of environment variables - uploadFileToWebApp( - webApp.getPublishingProfile(), - "appservicemsi.war", - WebAppsMsiTests.class.getResourceAsStream("/appservicemsi.war")); - - ResourceManagerUtils.sleep(Duration.ofSeconds(30)); - - Response response = curl("http://" + webappName1 + "." + "azurewebsites.net/appservicemsi/"); - Assertions.assertEquals(200, response.getStatusCode()); - String body = response.getValue(); - Assertions.assertNotNull(body); - Assertions.assertTrue(body.contains(webApp.resourceGroupName())); - Assertions.assertTrue(body.contains(webApp.id())); - } - } - - boolean setContainsValue(Set stringSet, String value) { - boolean found = false; - for (String setContent : stringSet) { - if (setContent.contains(value)) { - found = true; - break; - } - } - - return found; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/java/com/azure/resourcemanager/appservice/WebAppsTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/java/com/azure/resourcemanager/appservice/WebAppsTests.java deleted file mode 100644 index 90e3d3a06880..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/java/com/azure/resourcemanager/appservice/WebAppsTests.java +++ /dev/null @@ -1,290 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice; - -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.appservice.models.AppServicePlan; -import com.azure.resourcemanager.appservice.models.FunctionApp; -import com.azure.resourcemanager.appservice.models.FunctionAppBasic; -import com.azure.resourcemanager.appservice.models.IpFilterTag; -import com.azure.resourcemanager.appservice.models.IpSecurityRestriction; -import com.azure.resourcemanager.appservice.models.LogLevel; -import com.azure.resourcemanager.appservice.models.NetFrameworkVersion; -import com.azure.resourcemanager.appservice.models.OperatingSystem; -import com.azure.resourcemanager.appservice.models.PricingTier; -import com.azure.resourcemanager.appservice.models.RemoteVisualStudioVersion; -import com.azure.resourcemanager.appservice.models.WebApp; -import com.azure.resourcemanager.appservice.models.WebAppBasic; -import com.azure.resourcemanager.appservice.models.WebAppRuntimeStack; -import com.azure.resourcemanager.test.utils.TestUtilities; -import com.azure.core.management.Region; -import com.azure.core.management.profile.AzureProfile; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public class WebAppsTests extends AppServiceTest { - private String rgName1 = ""; - private String rgName2 = ""; - private String webappName1 = ""; - private String webappName2 = ""; - private String webappName3 = ""; - private String appServicePlanName1 = ""; - - @Override - protected void initializeClients(HttpPipeline httpPipeline, AzureProfile profile) { - webappName1 = generateRandomResourceName("java-webapp-", 20); - webappName2 = generateRandomResourceName("java-webapp-", 20); - webappName3 = generateRandomResourceName("java-webapp-", 20); - appServicePlanName1 = generateRandomResourceName("java-asp-", 20); - rgName1 = generateRandomResourceName("javacsmrg", 20); - rgName2 = generateRandomResourceName("javacsmrg", 20); - - super.initializeClients(httpPipeline, profile); - } - - @Override - protected void cleanUpResources() { - if (rgName2 != null) { - resourceManager.resourceGroups().beginDeleteByName(rgName2); - } - resourceManager.resourceGroups().beginDeleteByName(rgName1); - } - - @Test - public void canCRUDWebApp() throws Exception { - // Create with new app service plan - WebApp webApp1 = - appServiceManager - .webApps() - .define(webappName1) - .withRegion(locationOrDefault(Region.US_WEST)) - .withNewResourceGroup(rgName1) - .withNewWindowsPlan(appServicePlanName1, PricingTier.BASIC_B1) - .withRemoteDebuggingEnabled(RemoteVisualStudioVersion.VS2019) - .create(); - Assertions.assertNotNull(webApp1); - Assertions.assertEquals(locationOrDefault(Region.US_WEST), webApp1.region()); - AppServicePlan plan1 = appServiceManager.appServicePlans().getById(webApp1.appServicePlanId()); - Assertions.assertNotNull(plan1); - Assertions.assertEquals(appServicePlanName1, plan1.name()); - Assertions.assertEquals(locationOrDefault(Region.US_WEST), plan1.region()); - Assertions.assertEquals(PricingTier.BASIC_B1, plan1.pricingTier()); - - // Create in a new group with existing app service plan - WebApp webApp2 = - appServiceManager - .webApps() - .define(webappName2) - .withExistingWindowsPlan(plan1) - .withNewResourceGroup(rgName2) - .create(); - Assertions.assertNotNull(webApp2); - Assertions.assertEquals(locationOrDefault(Region.US_WEST), webApp1.region()); - - // Get - WebApp webApp = appServiceManager.webApps().getByResourceGroup(rgName1, webApp1.name()); - Assertions.assertEquals(webApp1.id(), webApp.id()); - webApp = appServiceManager.webApps().getById(webApp2.id()); - Assertions.assertEquals(webApp2.name(), webApp.name()); - - // List - PagedIterable webApps = appServiceManager.webApps().listByResourceGroup(rgName1); - Assertions.assertEquals(1, TestUtilities.getSize(webApps)); - webApps = appServiceManager.webApps().listByResourceGroup(rgName2); - Assertions.assertEquals(1, TestUtilities.getSize(webApps)); - - // Update - webApp1 - .update() - .withNewAppServicePlan(PricingTier.STANDARD_S2) - .withRuntimeStack(WebAppRuntimeStack.NETCORE) - .apply(); - AppServicePlan plan2 = appServiceManager.appServicePlans().getById(webApp1.appServicePlanId()); - Assertions.assertNotNull(plan2); - Assertions.assertEquals(locationOrDefault(Region.US_WEST), plan2.region()); - Assertions.assertEquals(PricingTier.STANDARD_S2, plan2.pricingTier()); - Assertions - .assertEquals( - WebAppRuntimeStack.NETCORE.runtime(), - webApp1 - .manager() - .serviceClient() - .getWebApps() - .listMetadata(webApp1.resourceGroupName(), webApp1.name()) - .properties() - .get("CURRENT_STACK")); - - WebApp webApp3 = - appServiceManager - .webApps() - .define(webappName3) - .withExistingWindowsPlan(plan1) - .withExistingResourceGroup(rgName2) - .withRuntimeStack(WebAppRuntimeStack.NET) - .withNetFrameworkVersion(NetFrameworkVersion.V4_6) - .create(); - Assertions - .assertEquals( - WebAppRuntimeStack.NET.runtime(), - webApp3 - .manager() - .serviceClient() - .getWebApps() - .listMetadata(webApp3.resourceGroupName(), webApp3.name()) - .properties() - .get("CURRENT_STACK")); - } - - @Test - public void canListWebApp() throws Exception { - rgName2 = null; - - WebApp webApp1 = - appServiceManager - .webApps() - .define(webappName1) - .withRegion(locationOrDefault(Region.US_WEST)) - .withNewResourceGroup(rgName1) - .withNewWindowsPlan(appServicePlanName1, PricingTier.BASIC_B1) - .withRemoteDebuggingEnabled(RemoteVisualStudioVersion.VS2019) - .withHttpsOnly(true) - .defineDiagnosticLogsConfiguration() - .withApplicationLogging() - .withLogLevel(LogLevel.VERBOSE) - .withApplicationLogsStoredOnFileSystem() - .attach() - .create(); - - PagedIterable webApps = appServiceManager.webApps() - .listByResourceGroup(rgName1); - Assertions.assertEquals(1, TestUtilities.getSize(webApps)); - - WebAppBasic webAppBasic1 = webApps.iterator().next(); - // verify basic info - Assertions.assertEquals(webApp1.id(), webAppBasic1.id()); - Assertions.assertEquals(webApp1.name(), webAppBasic1.name()); - Assertions.assertEquals(webApp1.appServicePlanId(), webAppBasic1.appServicePlanId()); - Assertions.assertEquals(webApp1.operatingSystem(), webAppBasic1.operatingSystem()); - Assertions.assertEquals(webApp1.httpsOnly(), webAppBasic1.httpsOnly()); - // verify detailed info after refresh - WebApp webAppBasic1Refreshed = webAppBasic1.refresh(); - Assertions.assertEquals(webApp1.remoteDebuggingVersion(), webAppBasic1Refreshed.remoteDebuggingVersion()); - Assertions.assertEquals(webApp1.diagnosticLogsConfig().applicationLoggingStorageBlobLogLevel(), - webAppBasic1Refreshed.diagnosticLogsConfig().applicationLoggingStorageBlobLogLevel()); - } - - @Test - public void canCRUDWebAppWithContainer() { - rgName2 = null; - - AppServicePlan plan1 = appServiceManager.appServicePlans().define(appServicePlanName1) - .withRegion(locationOrDefault(Region.US_EAST)) // many other regions does not have quota for PREMIUM_P1V3 - .withNewResourceGroup(rgName1) - .withPricingTier(PricingTier.PREMIUM_P1V3) - .withOperatingSystem(OperatingSystem.WINDOWS) - .create(); - - final String imageAndTag = "mcr.microsoft.com/azure-app-service/samples/aspnethelloworld:latest"; - - WebApp webApp1 = appServiceManager.webApps().define(webappName1) - .withExistingWindowsPlan(plan1) - .withExistingResourceGroup(rgName1) - .withPublicDockerHubImage(imageAndTag) - .create(); - - Assertions.assertNotNull(webApp1.windowsFxVersion()); - Assertions.assertTrue(webApp1.windowsFxVersion().contains(imageAndTag)); - } - - @Test - public void canListWebAppAndFunctionApp() { - rgName2 = null; - - WebApp webApp1 = appServiceManager.webApps() - .define(webappName1) - .withRegion(locationOrDefault(Region.US_WEST)) - .withNewResourceGroup(rgName1) - .withNewWindowsPlan(appServicePlanName1, PricingTier.BASIC_B1) - .create(); - - FunctionApp functionApp1 = appServiceManager.functionApps() - .define(webappName2) - .withRegion(locationOrDefault(Region.US_WEST)) - .withExistingResourceGroup(rgName1) - .withNewFreeAppServicePlan() - .create(); - - PagedIterable webApps = appServiceManager.webApps().listByResourceGroup(rgName1); - - PagedIterable functionApps = appServiceManager.functionApps().listByResourceGroup(rgName1); - - Assertions.assertEquals(1, TestUtilities.getSize(webApps)); - - Assertions.assertEquals(1, TestUtilities.getSize(functionApps)); - - Assertions.assertEquals(webappName1, webApps.iterator().next().name()); - - Assertions.assertEquals(webappName2, functionApps.iterator().next().name()); - } - - @Test - @Disabled("Test is failing due to resource group not existing") - public void canUpdateIpRestriction() { - WebApp webApp2 = - appServiceManager - .webApps() - .define(webappName2) - .withRegion(locationOrDefault(Region.US_WEST)) - .withNewResourceGroup(rgName2) - .withNewWindowsPlan(appServicePlanName1, PricingTier.BASIC_B1) - .create(); - webApp2.refresh(); - - Assertions.assertEquals(1, webApp2.ipSecurityRules().size()); - Assertions.assertEquals("Allow", webApp2.ipSecurityRules().iterator().next().action()); - Assertions.assertEquals("Any", webApp2.ipSecurityRules().iterator().next().ipAddress()); - - WebApp webApp1 = - appServiceManager - .webApps() - .define(webappName1) - .withRegion(locationOrDefault(Region.US_WEST)) - .withNewResourceGroup(rgName1) - .withNewWindowsPlan(appServicePlanName1, PricingTier.BASIC_B1) - .withAccessFromIpAddressRange("167.220.0.0/16", 300) - .withAccessFromIpAddress("167.220.0.1", 400) - .withAccessRule(new IpSecurityRestriction() - .withAction("Allow") - .withPriority(500) - .withTag(IpFilterTag.SERVICE_TAG) - .withIpAddress("AzureFrontDoor.Backend")) - .create(); - - Assertions.assertEquals(3 + 1, webApp1.ipSecurityRules().size()); - Assertions.assertTrue(webApp1.ipSecurityRules().stream().anyMatch(r -> "Deny".equals(r.action()) && "Any".equals(r.ipAddress()))); - - IpSecurityRestriction serviceTagRule = webApp1.ipSecurityRules().stream() - .filter(r -> r.tag() == IpFilterTag.SERVICE_TAG) - .findFirst().get(); - - webApp1.update() - .withoutIpAddressAccess("167.220.0.1") - .withoutIpAddressRangeAccess("167.220.0.0/16") - .withoutAccessRule(serviceTagRule) - .withAccessFromIpAddressRange("167.220.0.0/24", 300) - .apply(); - - Assertions.assertEquals(1 + 1, webApp1.ipSecurityRules().size()); - - webApp1.update() - .withAccessFromAllNetworks() - .apply(); - - Assertions.assertEquals(1, webApp1.ipSecurityRules().size()); - Assertions.assertEquals("Allow", webApp1.ipSecurityRules().iterator().next().action()); - Assertions.assertEquals("Any", webApp1.ipSecurityRules().iterator().next().ipAddress()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/java/com/azure/resourcemanager/appservice/WebAppsWebDeployTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/java/com/azure/resourcemanager/appservice/WebAppsWebDeployTests.java deleted file mode 100644 index ad44e85fa9d9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/java/com/azure/resourcemanager/appservice/WebAppsWebDeployTests.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice; - -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.rest.Response; -import com.azure.resourcemanager.appservice.models.AppServicePlan; -import com.azure.resourcemanager.appservice.models.JavaVersion; -import com.azure.resourcemanager.appservice.models.PricingTier; -import com.azure.resourcemanager.appservice.models.WebApp; -import com.azure.resourcemanager.appservice.models.WebContainer; -import com.azure.resourcemanager.appservice.models.WebDeployment; -import com.azure.core.management.Region; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -import java.time.Duration; - -public class WebAppsWebDeployTests extends AppServiceTest { - private String rgName1 = ""; - private String webappName1 = ""; - - @Override - protected void initializeClients(HttpPipeline httpPipeline, AzureProfile profile) { - webappName1 = generateRandomResourceName("java-webapp-", 20); - rgName1 = generateRandomResourceName("javacsmrg", 20); - - super.initializeClients(httpPipeline, profile); - } - - @Override - protected void cleanUpResources() { - resourceManager.resourceGroups().beginDeleteByName(rgName1); - } - - @Test - public void canDeployWarFile() throws Exception { - // Create with new app service plan - WebApp webApp1 = - appServiceManager - .webApps() - .define(webappName1) - .withRegion(locationOrDefault(Region.US_WEST)) - .withNewResourceGroup(rgName1) - .withNewWindowsPlan(PricingTier.BASIC_B1) - .withJavaVersion(JavaVersion.JAVA_8_NEWEST) - .withWebContainer(WebContainer.TOMCAT_8_0_NEWEST) - .create(); - Assertions.assertNotNull(webApp1); - Assertions.assertEquals(locationOrDefault(Region.US_WEST), webApp1.region()); - AppServicePlan plan1 = appServiceManager.appServicePlans().getById(webApp1.appServicePlanId()); - Assertions.assertNotNull(plan1); - Assertions.assertEquals(locationOrDefault(Region.US_WEST), plan1.region()); - Assertions.assertEquals(PricingTier.BASIC_B1, plan1.pricingTier()); - - WebDeployment deployment = - webApp1 - .deploy() - .withPackageUri( - "https://raw.githubusercontent.com/Azure/azure-sdk-for-java/main/sdk/resourcemanager/azure-resourcemanager-appservice/src/test/resources/webapps.zip") - .withExistingDeploymentsDeleted(true) - .execute(); - - Assertions.assertNotNull(deployment); - if (!isPlaybackMode()) { - ResourceManagerUtils.sleep(Duration.ofSeconds(10)); - Response response = curl("http://" + webApp1.defaultHostname() + "/helloworld/"); - Assertions.assertEquals(200, response.getStatusCode()); - String body = response.getValue(); - Assertions.assertNotNull(body); - Assertions.assertTrue(body.contains("Current time:")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/java/com/azure/resourcemanager/appservice/ZipDeployTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/java/com/azure/resourcemanager/appservice/ZipDeployTests.java deleted file mode 100644 index 88146f379340..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/java/com/azure/resourcemanager/appservice/ZipDeployTests.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.appservice; - -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.test.annotation.DoNotRecord; -import com.azure.resourcemanager.appservice.models.FunctionApp; -import com.azure.resourcemanager.appservice.models.FunctionEnvelope; -import com.azure.resourcemanager.test.utils.TestUtilities; -import com.azure.core.management.Region; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import java.io.File; -import java.time.Duration; - -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public class ZipDeployTests extends AppServiceTest { - private String webappName4 = ""; - - @Override - protected void initializeClients(HttpPipeline httpPipeline, AzureProfile profile) { - webappName4 = generateRandomResourceName("java-func-", 20); - - super.initializeClients(httpPipeline, profile); - } - - @Test - @DoNotRecord - public void canZipDeployFunction() { - if (skipInPlayback()) { - return; - } - - // Create function app - FunctionApp functionApp = - appServiceManager - .functionApps() - .define(webappName4) - .withRegion(locationOrDefault(Region.US_WEST)) - .withNewResourceGroup(rgName) - .create(); - Assertions.assertNotNull(functionApp); - ResourceManagerUtils.sleep(Duration.ofSeconds(5)); - functionApp.zipDeploy(new File(FunctionAppsTests.class.getResource("/square-function-app.zip").getPath())); - ResourceManagerUtils.sleep(Duration.ofSeconds(5)); - String response = post("http://" + webappName4 + ".azurewebsites.net" + "/api/square", "25"); - Assertions.assertNotNull(response); - Assertions.assertEquals("625", response); - - PagedIterable envelopes = - appServiceManager.functionApps().listFunctions(rgName, functionApp.name()); - Assertions.assertNotNull(envelopes); - Assertions.assertEquals(1, TestUtilities.getSize(envelopes)); - Assertions - .assertEquals( - envelopes.iterator().next().href(), - "https://" + webappName4 + ".scm.azurewebsites.net/api/functions/square"); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/java/com/azure/resourcemanager/appservice/implementation/KuduTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/java/com/azure/resourcemanager/appservice/implementation/KuduTests.java deleted file mode 100644 index 98809fd61cee..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/java/com/azure/resourcemanager/appservice/implementation/KuduTests.java +++ /dev/null @@ -1,190 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.implementation; - -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Random; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Flux; - -public class KuduTests { - - private static final String LOG_STREAM = - "2020-02-25T07:19:40 Welcome, you are now connected to log-streaming service. The default timeout is 2 hours." - + " Change the timeout with the App Setting SCM_LOGSTREAM_TIMEOUT (in seconds).\n" - + "2020-02-25T07:20:40 No new trace in the past 1 min(s).\n" - + "2020-02-25T07:21:40 No new trace in the past 2 min(s).\n" - + "2020-02-25 07:21:48 WA1-WEIDXU GET / X-ARR-LOG-ID=0b0cce68-2698-48a6-91cd-3bf7634ac63b 80 - ::1" - + " AlwaysOn ARRAffinity=9c45f76fcf2ed72fc0f79776f0387a38a4f53d6739f8aa06a66a120a04466857 -" - + " wa1-weidxu.azurewebsites.net 200 0 0 6651 679 78\n" - + "2020-02-25 07:21:48 ~1WA1-WEIDXU GET / - 80 - 10.0.128.39 AlwaysOn - - wa1-weidxu.azurewebsites.net 200" - + " 0 0 3108 443 140\n" - + "2020-02-25 07:23:07 WA1-WEIDXU GET /coffeeshop/ X-ARR-LOG-ID=cb1691d6-a3d7-4331-92a1-670beeeb4c7a 80 -" - + " 13.64.92.44" - + " Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/79.0.3945.130+Safari/537.36" - + " JSESSIONID=3080AD1F0E745FFB80CE3DC1039A820F;+ARRAffinity=9c45f76fcf2ed72fc0f79776f0387a38a4f53d6739f8aa06a66a120a04466857" - + " - wa1-weidxu.azurewebsites.net 200 0 0 1147 1124 503\n" - + "2020-02-25 07:23:07 WA1-WEIDXU GET /coffeeshop/Images/bkg.png" - + " X-ARR-LOG-ID=029e30f3-92b6-4c8d-8e90-fe1fc2554926 80 - 13.64.92.44" - + " Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/79.0.3945.130+Safari/537.36" - + " JSESSIONID=3080AD1F0E745FFB80CE3DC1039A820F;+ARRAffinity=9c45f76fcf2ed72fc0f79776f0387a38a4f53d6739f8aa06a66a120a04466857" - + " http://wa1-weidxu.azurewebsites.net/coffeeshop/Content/Site.css wa1-weidxu.azurewebsites.net 404 0 0" - + " 1405 1099 15\n" - + "2020-02-25 07:23:07 WA1-WEIDXU GET /coffeeshop/Images/brand.png" - + " X-ARR-LOG-ID=200dda67-062b-445f-9501-03fd716b3b49 80 - 13.64.92.44" - + " Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/79.0.3945.130+Safari/537.36" - + " JSESSIONID=3080AD1F0E745FFB80CE3DC1039A820F;+ARRAffinity=9c45f76fcf2ed72fc0f79776f0387a38a4f53d6739f8aa06a66a120a04466857" - + " http://wa1-weidxu.azurewebsites.net/coffeeshop/Content/Site.css wa1-weidxu.azurewebsites.net 404 0 0" - + " 1409 1105 38\n" - + "2020-02-25 07:23:07 WA1-WEIDXU GET /Images/brand.png X-ARR-LOG-ID=7c8c9018-308b-4ccc-8f0a-def855b03797" - + " 80 - 13.64.92.44" - + " Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/79.0.3945.130+Safari/537.36" - + " ARRAffinity=9c45f76fcf2ed72fc0f79776f0387a38a4f53d6739f8aa06a66a120a04466857" - + " http://wa1-weidxu.azurewebsites.net/coffeeshop/ wa1-weidxu.azurewebsites.net 404 0 0 1387 1011 46\n" - + "2020-02-25 07:23:07 WA1-WEIDXU GET /Images/bkg.png X-ARR-LOG-ID=8f2a2049-bc2f-4c96-b8f6-31b3fd05cfea 80" - + " - 13.64.92.44" - + " Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/79.0.3945.130+Safari/537.36" - + " ARRAffinity=9c45f76fcf2ed72fc0f79776f0387a38a4f53d6739f8aa06a66a120a04466857" - + " http://wa1-weidxu.azurewebsites.net/coffeeshop/ wa1-weidxu.azurewebsites.net 404 0 0 1383 1005 31\n" - + "2020-02-25T07:24:40 No new trace in the past 1 min(s).\n" - + "2020-02-25 07:25:16 WA1-WEIDXU GET /coffeeshop/Images/brand.png" - + " X-ARR-LOG-ID=9cf7d479-82f0-41e0-9b81-62e435d312c0 80 - 13.64.92.44" - + " Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/79.0.3945.130+Safari/537.36" - + " JSESSIONID=3080AD1F0E745FFB80CE3DC1039A820F;+ARRAffinity=9c45f76fcf2ed72fc0f79776f0387a38a4f53d6739f8aa06a66a120a04466857" - + " http://wa1-weidxu.azurewebsites.net/coffeeshop/ wa1-weidxu.azurewebsites.net 404 0 0 1409 1089 46\n" - + "2020-02-25 07:25:16 WA1-WEIDXU GET /coffeeshop/Images/bkg.png" - + " X-ARR-LOG-ID=ac923602-6ab7-4f59-8222-941a82f05a2f 80 - 13.64.92.44" - + " Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/79.0.3945.130+Safari/537.36" - + " JSESSIONID=3080AD1F0E745FFB80CE3DC1039A820F;+ARRAffinity=9c45f76fcf2ed72fc0f79776f0387a38a4f53d6739f8aa06a66a120a04466857" - + " http://wa1-weidxu.azurewebsites.net/coffeeshop/ wa1-weidxu.azurewebsites.net 404 0 0 1405 1083 69\n" - + "2020-02-25T07:26:40 No new trace in the past 1 min(s).\n" - + "2020-02-25 07:26:48 ~1WA1-WEIDXU GET / - 80 - 10.0.128.39 AlwaysOn - - wa1-weidxu.azurewebsites.net 200" - + " 0 0 3108 443 46\n" - + "2020-02-25 07:26:48 WA1-WEIDXU GET / X-ARR-LOG-ID=7aebc121-d061-4230-9c2b-cc6b1be4b15a 80 - ::1" - + " AlwaysOn ARRAffinity=9c45f76fcf2ed72fc0f79776f0387a38a4f53d6739f8aa06a66a120a04466857 -" - + " wa1-weidxu.azurewebsites.net 200 0 0 6651 679 61\n" - + "2020-02-25T07:28:40 No new trace in the past 1 min(s).\n" - + "2020-02-25T07:29:40 No new trace in the past 2 min(s).\n" - + "2020-02-25T07:30:40 No new trace in the past 3 min(s).\n" - + "2020-02-25T07:31:40 No new trace in the past 4 min(s).\n" - + "2020-02-25 07:31:48 ~1WA1-WEIDXU GET / - 80 - 10.0.128.39 AlwaysOn - - wa1-weidxu.azurewebsites.net 200" - + " 0 0 3108 443 46\n" - + "2020-02-25 07:31:48 WA1-WEIDXU GET / X-ARR-LOG-ID=5f7a3006-6e4e-42dd-aadb-d9a2f1af4736 80 - ::1" - + " AlwaysOn ARRAffinity=9c45f76fcf2ed72fc0f79776f0387a38a4f53d6739f8aa06a66a120a04466857 -" - + " wa1-weidxu.azurewebsites.net 200 0 0 6651 679 79\n" - + "2020-02-25T07:33:40 No new trace in the past 1 min(s).\n" - + "2020-02-25T07:34:40 No new trace in the past 2 min(s).\n" - + "2020-02-25T07:35:40 No new trace in the past 3 min(s).\n" - + "2020-02-25T07:36:40 No new trace in the past 4 min(s).\n" - + "2020-02-25 07:36:48 ~1WA1-WEIDXU GET / - 80 - 10.0.128.39 AlwaysOn - - wa1-weidxu.azurewebsites.net 200" - + " 0 0 3109 443 51\n" - + "2020-02-25 07:36:48 WA1-WEIDXU GET / X-ARR-LOG-ID=9705abff-8f34-4bb9-867a-7194f7e0577c 80 - ::1" - + " AlwaysOn ARRAffinity=9c45f76fcf2ed72fc0f79776f0387a38a4f53d6739f8aa06a66a120a04466857 -" - + " wa1-weidxu.azurewebsites.net 200 0 0 6651 679 60\n" - + "2020-02-25T07:38:40 No new trace in the past 1 min(s).\n" - + "2020-02-25T07:39:40 No new trace in the past 2 min(s).\n" - + "2020-02-25T07:40:40 No new trace in the past 3 min(s).\n" - + "2020-02-25T07:41:40 No new trace in the past 4 min(s).\n"; - - @Test - public void testConversionFromByteToString() { - // prepare expected lines - String[] logArray = LOG_STREAM.split("\n"); - final List expectedLogLines = new ArrayList<>(logArray.length); - for (String logLine : logArray) { - if (!logLine.isEmpty() && logLine.charAt(logLine.length() - 1) == '\r') { - logLine = logLine.substring(0, logLine.length() - 1); - } - expectedLogLines.add(logLine); - } - - byte[] logStreamBytes = LOG_STREAM.getBytes(StandardCharsets.UTF_8); - - // simple cast, just one big ByteBuffer - ByteBuffer byteBuffer = ByteBuffer.wrap(logStreamBytes); - Flux byteBufferFlux = Flux.fromIterable(Arrays.asList(byteBuffer)); - - Flux lineFlux = KuduClient.streamFromFluxBytes(byteBufferFlux); - List lines = lineFlux.collectList().block(); - - Assertions.assertEquals(expectedLogLines, lines); - - // simple case, Flux breaks at newline - List byteBuffers = new ArrayList<>(); - int offset = 0; - for (int i = 0; i < logStreamBytes.length; ++i) { - if (logStreamBytes[i] == '\n') { - int nextOffset = i + 1; - byteBuffers.add(ByteBuffer.wrap(logStreamBytes, offset, nextOffset - offset)); - offset = nextOffset; - } - } - if (offset != logStreamBytes.length) { - byteBuffers.add(ByteBuffer.wrap(logStreamBytes, offset, logStreamBytes.length - offset)); - } - - byteBufferFlux = Flux.fromIterable(byteBuffers); - - lineFlux = KuduClient.streamFromFluxBytes(byteBufferFlux); - lines = lineFlux.collectList().block(); - - Assertions.assertEquals(expectedLogLines, lines); - - // random - for (int seed = 0; seed < 100; ++seed) { - Random random = new Random(seed); - - byteBuffers = new ArrayList<>(); - offset = 0; - for (int i = 0; i < logStreamBytes.length; ++i) { - if (random.nextInt(256) == 0) { - int nextOffset = i + 1; - byteBuffers.add(ByteBuffer.wrap(logStreamBytes, offset, nextOffset - offset)); - offset = nextOffset; - } - } - if (offset != logStreamBytes.length) { - byteBuffers.add(ByteBuffer.wrap(logStreamBytes, offset, logStreamBytes.length - offset)); - } - - byteBufferFlux = Flux.fromIterable(byteBuffers); - - lineFlux = KuduClient.streamFromFluxBytes(byteBufferFlux); - lines = lineFlux.collectList().block(); - - Assertions.assertEquals(expectedLogLines, lines); - } - - // random - logStreamBytes = LOG_STREAM.replace("\n", "\r\n").getBytes(StandardCharsets.UTF_8); - for (int seed = 0; seed < 100; ++seed) { - Random random = new Random(seed); - - byteBuffers = new ArrayList<>(); - offset = 0; - for (int i = 0; i < logStreamBytes.length; ++i) { - if (random.nextInt(256) == 0) { - int nextOffset = i + 1; - byteBuffers.add(ByteBuffer.wrap(logStreamBytes, offset, nextOffset - offset)); - offset = nextOffset; - } - } - if (offset != logStreamBytes.length) { - byteBuffers.add(ByteBuffer.wrap(logStreamBytes, offset, logStreamBytes.length - offset)); - } - - byteBufferFlux = Flux.fromIterable(byteBuffers); - - lineFlux = KuduClient.streamFromFluxBytes(byteBufferFlux); - lines = lineFlux.collectList().block(); - - Assertions.assertEquals(expectedLogLines, lines); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/java/com/azure/resourcemanager/appservice/implementation/UtilsTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/java/com/azure/resourcemanager/appservice/implementation/UtilsTests.java deleted file mode 100644 index db33a95985f1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/java/com/azure/resourcemanager/appservice/implementation/UtilsTests.java +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.appservice.implementation; - -import java.nio.charset.StandardCharsets; -import java.time.temporal.ChronoUnit; -import java.util.Base64; - -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.policy.HttpLogDetailLevel; -import com.azure.core.http.policy.HttpLogOptions; -import com.azure.core.http.policy.HttpLoggingPolicy; -import com.azure.core.http.policy.RetryPolicy; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public class UtilsTests { - - @Test - public void testWebAppPrivateRegistryImage() throws Exception { - // completion - Assertions - .assertEquals( - "weidxuregistry.azurecr.io/az-func-java:v1", - Utils - .smartCompletionPrivateRegistryImage( - "weidxuregistry.azurecr.io/az-func-java:v1", "https://weidxuregistry.azurecr.io")); - - // completion - Assertions - .assertEquals( - "weidxuregistry.azurecr.io/az-func-java:v1", - Utils.smartCompletionPrivateRegistryImage("az-func-java:v1", "https://weidxuregistry.azurecr.io")); - - // completion - Assertions - .assertEquals( - "weidxuregistry.azurecr.io/weidxu/az-func-java:v1", - Utils - .smartCompletionPrivateRegistryImage( - "weidxu/az-func-java:v1", "https://weidxuregistry.azurecr.io")); - - // completion - Assertions - .assertEquals( - "weidxuregistry.azurecr.io:5000/weidxu/az-func-java:v1", - Utils - .smartCompletionPrivateRegistryImage( - "weidxu/az-func-java:v1", "https://weidxuregistry.azurecr.io:5000")); - - // completion - Assertions - .assertEquals( - "weidxuregistry.azurecr.io/weidxu/az-func-java:v1", - Utils - .smartCompletionPrivateRegistryImage( - "az-func-java:v1", "https://weidxuregistry.azurecr.io/weidxu")); - - // completion not happen due to possible host - Assertions - .assertEquals( - "host.name/az-func-java:v1", - Utils - .smartCompletionPrivateRegistryImage( - "host.name/az-func-java:v1", "https://weidxuregistry.azurecr.io")); - - // completion not happen due to possible port - Assertions - .assertEquals( - "host:port/az-func-java:v1", - Utils - .smartCompletionPrivateRegistryImage( - "host:port/az-func-java:v1", "https://weidxuregistry.azurecr.io")); - - // completion not happen due to no idea what it is - Assertions - .assertEquals( - "/az-func-java:v1", - Utils.smartCompletionPrivateRegistryImage("/az-func-java:v1", "https://weidxuregistry.azurecr.io")); - - // completion not happen due to incorrect serviceUrl - Assertions - .assertEquals( - "az-func-java:v1", - Utils.smartCompletionPrivateRegistryImage("az-func-java:v1", "weidxuregistry.azurecr.io")); - } - - @Test - public void testBase16() { - testBase16Encoding("", ""); - testBase16Encoding("f", "66"); - testBase16Encoding("fo", "666F"); - testBase16Encoding("foo", "666F6F"); - testBase16Encoding("foob", "666F6F62"); - testBase16Encoding("fooba", "666F6F6261"); - testBase16Encoding("foobar", "666F6F626172"); - } - - private static void testBase16Encoding(String decoded, String encoded) { - Assertions.assertEquals(Utils.base16Encode(decoded.getBytes(StandardCharsets.UTF_8)), encoded); - } - - @Test - public void testBase64Url() { - String encoded = - "eyJuYmYiOjE1ODI2OTM0NTIsImV4cCI6MTU4MjY5Mzc1MiwiaWF0IjoxNTgyNjkzNDUyLCJpc3MiOiJodHRwczovL3dhMS13ZWlkeHUuc2NtLmF6dXJld2Vic2l0ZXMubmV0IiwiYXVkIjoiaHR0cHM6Ly93YTEtd2VpZHh1LmF6dXJld2Vic2l0ZXMubmV0L2F6dXJlZnVuY3Rpb25zIn0"; - String decoded = - "{\"nbf\":1582693452,\"exp\":1582693752,\"iat\":1582693452,\"iss\":\"https://wa1-weidxu.scm.azurewebsites.net\",\"aud\":\"https://wa1-weidxu.azurewebsites.net/azurefunctions\"}"; - Assertions.assertEquals(decoded, new String(Base64.getUrlDecoder().decode(encoded), StandardCharsets.UTF_8)); - } - - @Test - public void canDownloadFile() throws Exception { - HttpPipeline httpPipeline = new HttpPipelineBuilder() - .policies( - new HttpLoggingPolicy(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BODY_AND_HEADERS)), - new RetryPolicy("Retry-After", ChronoUnit.SECONDS) - ) - .build(); - byte[] content = Utils.downloadFileAsync("https://www.google.com/humans.txt", httpPipeline).block(); - String contentString = new String(content); - Assertions.assertNotNull(contentString); - Assertions.assertTrue(contentString.startsWith("Google is built by a large team of engineers,")); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/resources/appservicemsi.war b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/resources/appservicemsi.war deleted file mode 100644 index 234f2ead2660..000000000000 Binary files a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/resources/appservicemsi.war and /dev/null differ diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/resources/helloworld.war b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/resources/helloworld.war deleted file mode 100644 index 700a2a55c66e..000000000000 Binary files a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/resources/helloworld.war and /dev/null differ diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/resources/java-functions.zip b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/resources/java-functions.zip deleted file mode 100644 index 4b15070b0c93..000000000000 Binary files a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/resources/java-functions.zip and /dev/null differ diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/resources/junit-platform.properties b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/resources/junit-platform.properties deleted file mode 100644 index 202d099b3ee8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/resources/junit-platform.properties +++ /dev/null @@ -1,4 +0,0 @@ -junit.jupiter.execution.parallel.enabled=true -junit.jupiter.execution.parallel.mode.default=concurrent -junit.jupiter.execution.parallel.config.strategy=fixed -junit.jupiter.execution.parallel.config.fixed.parallelism=32 diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/resources/square-function-app.zip b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/resources/square-function-app.zip deleted file mode 100644 index 56748163f242..000000000000 Binary files a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/resources/square-function-app.zip and /dev/null differ diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/resources/webapps.zip b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/resources/webapps.zip deleted file mode 100644 index 4d918eae2ba6..000000000000 Binary files a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/test/resources/webapps.zip and /dev/null differ diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/CHANGELOG.md b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/CHANGELOG.md deleted file mode 100644 index 7badb29d954d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/CHANGELOG.md +++ /dev/null @@ -1,8 +0,0 @@ -# Release History - -## 1.0.0-hybrid (2022-01-12) - -- Azure Resource Manager Authorization client library for Java (Hybrid) using API Profiles to allow building hybrid cloud solutions -that target both Azure and Azure Stack Hub. -- Supports api versions in the 2020-09-01-hybrid api profile -- Requires Azure Stack Update 2102+ diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/README.md b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/README.md deleted file mode 100644 index 4e20f4fe30db..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/README.md +++ /dev/null @@ -1,135 +0,0 @@ -# Azure Resource Manager Authorization client library for Java (Hybrid) - -Azure Resource Manager Authorization client library for Java (Hybrid) using [API Profiles][api_profile] to allow building hybrid cloud solutions -that target both Azure and Azure Stack Hub. - -For documentation on how to use this package, please see [Azure Management Libraries for Java (Hybrid)][resourcemanagerhybrid_lib]. - -## Getting started - -### Prerequisites - -- [Java Development Kit (JDK)][jdk] with version 8 or above -- [Azure Subscription][azure_subscription] - -### Adding the package to your product - -```xml - - com.azure.resourcemanager - azure-resourcemanager-authorization - 1.0.0-hybrid - -``` - -### Include the recommended packages - -Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. - -[Azure Identity][azure_identity] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation. - -### Authentication - -By default, Azure Active Directory token authentication depends on correct configure of following environment variables. - -- `AZURE_CLIENT_ID` for Azure client ID. -- `AZURE_TENANT_ID` for Azure tenant ID. -- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. - -In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`. - -With above configuration, `azure` client can be authenticated by following code: - -```java com.azure.resourcemanager.authorization.authenticate -String armEndpoint = "https://management.."; -AzureProfile profile = new AzureProfile(getAzureEnvironmentFromArmEndpoint(armEndpoint)); -TokenCredential credential = new DefaultAzureCredentialBuilder() - .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) - .build(); -AuthorizationManager manager = AuthorizationManager - .authenticate(credential, profile); -``` - -Change `armEndpoint` to point to the Azure Resource Manager endpoint of your Azure Stack Hub. The azure environment's -properties above can be populated with the following example: - -```java com.azure.resourcemanager.authorization.getazureenvironment -private static AzureEnvironment getAzureEnvironmentFromArmEndpoint(String armEndpoint) { - // Create HTTP client and request - HttpClient httpClient = HttpClient.createDefault(); - - HttpRequest request = new HttpRequest(HttpMethod.GET, - String.format("%s/metadata/endpoints?api-version=2019-10-01", armEndpoint)) - .setHeader("accept", "application/json"); - - // Execute the request and read the response - HttpResponse response = httpClient.send(request).block(); - if (response.getStatusCode() != 200) { - throw new RuntimeException("Failed : HTTP error code : " + response.getStatusCode()); - } - String body = response.getBodyAsString().block(); - try { - ArrayNode metadataArray = JacksonAdapter.createDefaultSerializerAdapter() - .deserialize(body, ArrayNode.class, SerializerEncoding.JSON); - - if (metadataArray == null || metadataArray.isEmpty()) { - throw new RuntimeException("Failed to find metadata : " + body); - } - - JsonNode metadata = metadataArray.iterator().next(); - AzureEnvironment azureEnvironment = new AzureEnvironment(new HashMap() { - { - put("managementEndpointUrl", metadata.at("/authentication/audiences/0").asText()); - put("resourceManagerEndpointUrl", armEndpoint); - put("galleryEndpointUrl", metadata.at("/gallery").asText()); - put("activeDirectoryEndpointUrl", metadata.at("/authentication/loginEndpoint").asText()); - put("activeDirectoryResourceId", metadata.at("/authentication/audiences/0").asText()); - put("activeDirectoryGraphResourceId", metadata.at("/graph").asText()); - put("storageEndpointSuffix", "." + metadata.at("/suffixes/storage").asText()); - put("keyVaultDnsSuffix", "." + metadata.at("/suffixes/keyVaultDns").asText()); - } - }); - return azureEnvironment; - } catch (IOException ioe) { - ioe.printStackTrace(); - throw new RuntimeException(ioe); - } -} -``` - -When targeting a hybrid solution to global Azure instead of your Azure Stack Hub, `AzureEnvironment.AZURE` can be used instead. - -See [Authentication][authenticate] for more options. - -## Key concepts - -See [API design][design] for general introduction on design and key concepts on Azure Management Libraries. - -## Examples - -See [Samples][sample] for code snippets and samples. - -## Troubleshooting - -## Next steps - -## Contributing - -For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). - -1. Fork it -1. Create your feature branch (`git checkout -b my-new-feature`) -1. Commit your changes (`git commit -am 'Add some feature'`) -1. Push to the branch (`git push origin my-new-feature`) -1. Create new Pull Request - - -[jdk]: https://learn.microsoft.com/java/azure/jdk/ -[azure_subscription]: https://azure.microsoft.com/free/ -[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity -[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty -[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md -[sample]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/SAMPLE.md -[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md -[api_profile]: https://learn.microsoft.com/azure-stack/user/azure-stack-version-profiles -[resourcemanagerhybrid_lib]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanagerhybrid diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/pom.xml b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/pom.xml deleted file mode 100644 index 553edd7bcd92..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/pom.xml +++ /dev/null @@ -1,137 +0,0 @@ - - - 4.0.0 - - com.azure - azure-client-sdk-parent - 1.7.0 - ../../parents/azure-client-sdk-parent - - - com.azure.resourcemanager - azure-resourcemanager-authorization - 1.0.0-hybrid - jar - - Microsoft Azure SDK for Authorization Management (Hybrid) - This package contains Microsoft Azure Authorization Management Hybrid SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt - https://github.com/Azure/azure-sdk-for-java - - - - The MIT License (MIT) - http://opensource.org/licenses/MIT - repo - - - - - https://github.com/Azure/azure-sdk-for-java - scm:git:git@github.com:Azure/azure-sdk-for-java.git - HEAD - - - - - 0.10 - 0.10 - - - --add-opens com.azure.resourcemanager.authorization/com.azure.resourcemanager.authorization=ALL-UNNAMED - --add-opens com.azure.resourcemanager.resources/com.azure.resourcemanager.resources=ALL-UNNAMED - --add-opens com.azure.core/com.azure.core.implementation.jackson=ALL-UNNAMED - - - - - - microsoft - Microsoft - - - - - - com.azure.resourcemanager - azure-resourcemanager-resources - 1.0.0-hybrid - - - org.slf4j - slf4j-simple - 1.7.36 - test - - - org.junit.jupiter - junit-jupiter-engine - 5.13.4 - test - - - org.junit.jupiter - junit-jupiter-api - 5.13.4 - test - - - com.azure - azure-core-http-netty - 1.16.2 - test - - - - - azure-mgmt-sdk-test-jar - - - !maven.test.skip - - - - - com.azure.resourcemanager - azure-resourcemanager-test - 1.0.0-hybrid - test - - - - - - - - org.apache.maven.plugins - maven-jar-plugin - 3.4.2 - - - - true - true - - - - - - - org.jacoco - jacoco-maven-plugin - 0.8.13 - - - com/azure/resourcemanager/**/fluent/**/* - com/azure/resourcemanager/**/models/**/* - com/azure/resourcemanager/**/implementation/*ClientImpl* - com/azure/resourcemanager/**/implementation/*ClientBuilder* - - - - - - diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/AuthorizationManager.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/AuthorizationManager.java deleted file mode 100644 index e4c586f06d6a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/AuthorizationManager.java +++ /dev/null @@ -1,194 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.authorization; - -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpPipeline; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.authorization.fluent.AuthorizationManagementClient; -import com.azure.resourcemanager.authorization.implementation.AuthorizationManagementClientBuilder; -import com.azure.resourcemanager.authorization.fluent.GraphRbacManagementClient; -import com.azure.resourcemanager.authorization.implementation.GraphRbacManagementClientBuilder; -import com.azure.resourcemanager.authorization.implementation.ActiveDirectoryApplicationsImpl; -import com.azure.resourcemanager.authorization.implementation.ActiveDirectoryGroupsImpl; -import com.azure.resourcemanager.authorization.implementation.ActiveDirectoryUsersImpl; -import com.azure.resourcemanager.authorization.implementation.RoleAssignmentsImpl; -import com.azure.resourcemanager.authorization.implementation.RoleDefinitionsImpl; -import com.azure.resourcemanager.authorization.implementation.ServicePrincipalsImpl; -import com.azure.resourcemanager.authorization.models.ActiveDirectoryApplications; -import com.azure.resourcemanager.authorization.models.ActiveDirectoryGroups; -import com.azure.resourcemanager.authorization.models.ActiveDirectoryUsers; -import com.azure.resourcemanager.authorization.models.RoleAssignments; -import com.azure.resourcemanager.authorization.models.RoleDefinitions; -import com.azure.resourcemanager.authorization.models.ServicePrincipals; -import com.azure.resourcemanager.resources.fluentcore.arm.AzureConfigurable; -import com.azure.resourcemanager.resources.fluentcore.arm.implementation.AzureConfigurableImpl; -import com.azure.resourcemanager.resources.fluentcore.model.HasServiceClient; -import com.azure.resourcemanager.resources.fluentcore.utils.HttpPipelineProvider; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; - -import java.util.Objects; - -/** Entry point to Azure Authorization and Graph RBAC management. */ -public final class AuthorizationManager implements HasServiceClient { - private final String tenantId; - private ResourceManagerUtils.InternalRuntimeContext internalContext; - // The sdk clients - private final GraphRbacManagementClient graphRbacManagementClient; - private final AuthorizationManagementClient authorizationManagementClient; - // The collections - private ActiveDirectoryUsers activeDirectoryUsers; - private ActiveDirectoryGroups activeDirectoryGroups; - private ServicePrincipals servicePrincipals; - private ActiveDirectoryApplications applications; - private RoleAssignments roleAssignments; - private RoleDefinitions roleDefinitions; - - /** - * Creates an instance of AuthorizationManager that exposes Authorization - * and Graph RBAC management API entry points. - * - * @param credential the credential to use - * @param profile the profile to use - * @return the AuthorizationManager instance - */ - public static AuthorizationManager authenticate(TokenCredential credential, AzureProfile profile) { - Objects.requireNonNull(credential, "'credential' cannot be null."); - Objects.requireNonNull(profile, "'profile' cannot be null."); - return authenticate(HttpPipelineProvider.buildHttpPipeline(credential, profile), profile); - } - - /** - * Creates an instance of AuthorizationManager that exposes Authorization - * and Graph RBAC management API entry points. - * - * @param httpPipeline the HttpPipeline to be used for API calls - * @param profile the profile used in Active Directory - * @return the AuthorizationManager instance - */ - public static AuthorizationManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { - Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); - Objects.requireNonNull(profile, "'profile' cannot be null."); - return new AuthorizationManager(httpPipeline, profile); - } - - /** - * Get a Configurable instance that can be used to create AuthorizationManager with optional configuration. - * - * @return the instance allowing configurations - */ - public static Configurable configure() { - return new AuthorizationManager.ConfigurableImpl(); - } - - @Override - public GraphRbacManagementClient serviceClient() { - return this.graphRbacManagementClient; - } - - /** The interface allowing configurations to be set. */ - public interface Configurable extends AzureConfigurable { - /** - * Creates an instance of AuthorizationManager that exposes Authorization - * and Graph RBAC management API entry points. - * - * @param credential the credential to use - * @param profile the profile to use - * @return the AuthorizationManager instance - */ - AuthorizationManager authenticate(TokenCredential credential, AzureProfile profile); - } - - /** The implementation for Configurable interface. */ - private static class ConfigurableImpl extends AzureConfigurableImpl implements Configurable { - public AuthorizationManager authenticate(TokenCredential credential, AzureProfile profile) { - return AuthorizationManager - .authenticate(buildHttpPipeline(credential, profile), profile); - } - } - - private AuthorizationManager(HttpPipeline httpPipeline, AzureProfile profile) { - this.graphRbacManagementClient = - new GraphRbacManagementClientBuilder() - .pipeline(httpPipeline) - .endpoint(profile.getEnvironment().getGraphEndpoint()) - .buildClient(); - this.authorizationManagementClient = - new AuthorizationManagementClientBuilder() - .pipeline(httpPipeline) - .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) - .subscriptionId(profile.getSubscriptionId()) - .buildClient(); - this.tenantId = profile.getTenantId(); - } - - /** - * @return wrapped inner authorization client providing direct access to auto-generated API implementation, based on - * Azure REST API - */ - public AuthorizationManagementClient roleServiceClient() { - return authorizationManagementClient; - } - - /** @return the tenant ID the graph client is associated with */ - public String tenantId() { - return tenantId; - } - - /** @return the {@link ResourceManagerUtils.InternalRuntimeContext} associated with this manager */ - public ResourceManagerUtils.InternalRuntimeContext internalContext() { - if (internalContext == null) { - internalContext = new ResourceManagerUtils.InternalRuntimeContext(); - } - return internalContext; - } - - /** @return the Active Directory user management API entry point */ - public ActiveDirectoryUsers users() { - if (activeDirectoryUsers == null) { - activeDirectoryUsers = new ActiveDirectoryUsersImpl(this); - } - return activeDirectoryUsers; - } - - /** @return the Active Directory group management API entry point */ - public ActiveDirectoryGroups groups() { - if (activeDirectoryGroups == null) { - activeDirectoryGroups = new ActiveDirectoryGroupsImpl(this); - } - return activeDirectoryGroups; - } - - /** @return the service principal management API entry point */ - public ServicePrincipals servicePrincipals() { - if (servicePrincipals == null) { - servicePrincipals = new ServicePrincipalsImpl(graphRbacManagementClient.getServicePrincipals(), this); - } - return servicePrincipals; - } - - /** @return the application management API entry point */ - public ActiveDirectoryApplications applications() { - if (applications == null) { - applications = new ActiveDirectoryApplicationsImpl(graphRbacManagementClient.getApplications(), this); - } - return applications; - } - - /** @return the role assignment management API entry point */ - public RoleAssignments roleAssignments() { - if (roleAssignments == null) { - roleAssignments = new RoleAssignmentsImpl(this); - } - return roleAssignments; - } - - /** @return the role definition management API entry point */ - public RoleDefinitions roleDefinitions() { - if (roleDefinitions == null) { - roleDefinitions = new RoleDefinitionsImpl(this); - } - return roleDefinitions; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/ApplicationsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/ApplicationsClient.java deleted file mode 100644 index 910157669963..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/ApplicationsClient.java +++ /dev/null @@ -1,759 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.authorization.fluent.models.ApplicationInner; -import com.azure.resourcemanager.authorization.fluent.models.DirectoryObjectInner; -import com.azure.resourcemanager.authorization.fluent.models.KeyCredentialInner; -import com.azure.resourcemanager.authorization.fluent.models.PasswordCredentialInner; -import com.azure.resourcemanager.authorization.fluent.models.ServicePrincipalObjectResultInner; -import com.azure.resourcemanager.authorization.models.AddOwnerParameters; -import com.azure.resourcemanager.authorization.models.ApplicationCreateParameters; -import com.azure.resourcemanager.authorization.models.ApplicationUpdateParameters; -import com.azure.resourcemanager.authorization.models.KeyCredentialsUpdateParameters; -import com.azure.resourcemanager.authorization.models.PasswordCredentialsUpdateParameters; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ApplicationsClient. */ -public interface ApplicationsClient extends InnerSupportsDelete { - /** - * Create a new application. - * - * @param tenantId The tenant ID. - * @param parameters The parameters for creating an application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return active Directory application information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createWithResponseAsync(String tenantId, ApplicationCreateParameters parameters); - - /** - * Create a new application. - * - * @param tenantId The tenant ID. - * @param parameters The parameters for creating an application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return active Directory application information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createAsync(String tenantId, ApplicationCreateParameters parameters); - - /** - * Create a new application. - * - * @param tenantId The tenant ID. - * @param parameters The parameters for creating an application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return active Directory application information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ApplicationInner create(String tenantId, ApplicationCreateParameters parameters); - - /** - * Create a new application. - * - * @param tenantId The tenant ID. - * @param parameters The parameters for creating an application. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return active Directory application information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createWithResponse( - String tenantId, ApplicationCreateParameters parameters, Context context); - - /** - * Lists applications by filter parameters. - * - * @param tenantId The tenant ID. - * @param filter The filters to apply to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return application list operation result. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String tenantId, String filter); - - /** - * Lists applications by filter parameters. - * - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return application list operation result. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String tenantId); - - /** - * Lists applications by filter parameters. - * - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return application list operation result. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String tenantId); - - /** - * Lists applications by filter parameters. - * - * @param tenantId The tenant ID. - * @param filter The filters to apply to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return application list operation result. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String tenantId, String filter, Context context); - - /** - * Delete an application. - * - * @param applicationObjectId Application object ID. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteWithResponseAsync(String applicationObjectId, String tenantId); - - /** - * Delete an application. - * - * @param applicationObjectId Application object ID. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String applicationObjectId, String tenantId); - - /** - * Delete an application. - * - * @param applicationObjectId Application object ID. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String applicationObjectId, String tenantId); - - /** - * Delete an application. - * - * @param applicationObjectId Application object ID. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String applicationObjectId, String tenantId, Context context); - - /** - * Get an application by object ID. - * - * @param applicationObjectId Application object ID. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an application by object ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync(String applicationObjectId, String tenantId); - - /** - * Get an application by object ID. - * - * @param applicationObjectId Application object ID. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an application by object ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync(String applicationObjectId, String tenantId); - - /** - * Get an application by object ID. - * - * @param applicationObjectId Application object ID. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an application by object ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ApplicationInner get(String applicationObjectId, String tenantId); - - /** - * Get an application by object ID. - * - * @param applicationObjectId Application object ID. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an application by object ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String applicationObjectId, String tenantId, Context context); - - /** - * Update an existing application. - * - * @param applicationObjectId Application object ID. - * @param tenantId The tenant ID. - * @param parameters Parameters to update an existing application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> patchWithResponseAsync( - String applicationObjectId, String tenantId, ApplicationUpdateParameters parameters); - - /** - * Update an existing application. - * - * @param applicationObjectId Application object ID. - * @param tenantId The tenant ID. - * @param parameters Parameters to update an existing application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono patchAsync(String applicationObjectId, String tenantId, ApplicationUpdateParameters parameters); - - /** - * Update an existing application. - * - * @param applicationObjectId Application object ID. - * @param tenantId The tenant ID. - * @param parameters Parameters to update an existing application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void patch(String applicationObjectId, String tenantId, ApplicationUpdateParameters parameters); - - /** - * Update an existing application. - * - * @param applicationObjectId Application object ID. - * @param tenantId The tenant ID. - * @param parameters Parameters to update an existing application. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response patchWithResponse( - String applicationObjectId, String tenantId, ApplicationUpdateParameters parameters, Context context); - - /** - * The owners are a set of non-admin users who are allowed to modify this object. - * - * @param applicationObjectId The object ID of the application for which to get owners. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return directoryObject list operation result. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listOwnersAsync(String applicationObjectId, String tenantId); - - /** - * The owners are a set of non-admin users who are allowed to modify this object. - * - * @param applicationObjectId The object ID of the application for which to get owners. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return directoryObject list operation result. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listOwners(String applicationObjectId, String tenantId); - - /** - * The owners are a set of non-admin users who are allowed to modify this object. - * - * @param applicationObjectId The object ID of the application for which to get owners. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return directoryObject list operation result. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listOwners(String applicationObjectId, String tenantId, Context context); - - /** - * Add an owner to an application. - * - * @param applicationObjectId The object ID of the application to which to add the owner. - * @param tenantId The tenant ID. - * @param parameters The URL of the owner object, such as - * https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects/f260bbc4-c254-447b-94cf-293b5ec434dd. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> addOwnerWithResponseAsync( - String applicationObjectId, String tenantId, AddOwnerParameters parameters); - - /** - * Add an owner to an application. - * - * @param applicationObjectId The object ID of the application to which to add the owner. - * @param tenantId The tenant ID. - * @param parameters The URL of the owner object, such as - * https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects/f260bbc4-c254-447b-94cf-293b5ec434dd. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono addOwnerAsync(String applicationObjectId, String tenantId, AddOwnerParameters parameters); - - /** - * Add an owner to an application. - * - * @param applicationObjectId The object ID of the application to which to add the owner. - * @param tenantId The tenant ID. - * @param parameters The URL of the owner object, such as - * https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects/f260bbc4-c254-447b-94cf-293b5ec434dd. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void addOwner(String applicationObjectId, String tenantId, AddOwnerParameters parameters); - - /** - * Add an owner to an application. - * - * @param applicationObjectId The object ID of the application to which to add the owner. - * @param tenantId The tenant ID. - * @param parameters The URL of the owner object, such as - * https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects/f260bbc4-c254-447b-94cf-293b5ec434dd. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response addOwnerWithResponse( - String applicationObjectId, String tenantId, AddOwnerParameters parameters, Context context); - - /** - * Remove a member from owners. - * - * @param applicationObjectId The object ID of the application from which to remove the owner. - * @param ownerObjectId Owner object id. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> removeOwnerWithResponseAsync( - String applicationObjectId, String ownerObjectId, String tenantId); - - /** - * Remove a member from owners. - * - * @param applicationObjectId The object ID of the application from which to remove the owner. - * @param ownerObjectId Owner object id. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono removeOwnerAsync(String applicationObjectId, String ownerObjectId, String tenantId); - - /** - * Remove a member from owners. - * - * @param applicationObjectId The object ID of the application from which to remove the owner. - * @param ownerObjectId Owner object id. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void removeOwner(String applicationObjectId, String ownerObjectId, String tenantId); - - /** - * Remove a member from owners. - * - * @param applicationObjectId The object ID of the application from which to remove the owner. - * @param ownerObjectId Owner object id. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response removeOwnerWithResponse( - String applicationObjectId, String ownerObjectId, String tenantId, Context context); - - /** - * Get the keyCredentials associated with an application. - * - * @param applicationObjectId Application object ID. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the keyCredentials associated with an application. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listKeyCredentialsAsync(String applicationObjectId, String tenantId); - - /** - * Get the keyCredentials associated with an application. - * - * @param applicationObjectId Application object ID. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the keyCredentials associated with an application. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listKeyCredentials(String applicationObjectId, String tenantId); - - /** - * Get the keyCredentials associated with an application. - * - * @param applicationObjectId Application object ID. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the keyCredentials associated with an application. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listKeyCredentials(String applicationObjectId, String tenantId, Context context); - - /** - * Update the keyCredentials associated with an application. - * - * @param applicationObjectId Application object ID. - * @param tenantId The tenant ID. - * @param parameters Parameters to update the keyCredentials of an existing application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateKeyCredentialsWithResponseAsync( - String applicationObjectId, String tenantId, KeyCredentialsUpdateParameters parameters); - - /** - * Update the keyCredentials associated with an application. - * - * @param applicationObjectId Application object ID. - * @param tenantId The tenant ID. - * @param parameters Parameters to update the keyCredentials of an existing application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateKeyCredentialsAsync( - String applicationObjectId, String tenantId, KeyCredentialsUpdateParameters parameters); - - /** - * Update the keyCredentials associated with an application. - * - * @param applicationObjectId Application object ID. - * @param tenantId The tenant ID. - * @param parameters Parameters to update the keyCredentials of an existing application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void updateKeyCredentials(String applicationObjectId, String tenantId, KeyCredentialsUpdateParameters parameters); - - /** - * Update the keyCredentials associated with an application. - * - * @param applicationObjectId Application object ID. - * @param tenantId The tenant ID. - * @param parameters Parameters to update the keyCredentials of an existing application. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateKeyCredentialsWithResponse( - String applicationObjectId, String tenantId, KeyCredentialsUpdateParameters parameters, Context context); - - /** - * Get the passwordCredentials associated with an application. - * - * @param applicationObjectId Application object ID. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the passwordCredentials associated with an application. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listPasswordCredentialsAsync(String applicationObjectId, String tenantId); - - /** - * Get the passwordCredentials associated with an application. - * - * @param applicationObjectId Application object ID. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the passwordCredentials associated with an application. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listPasswordCredentials(String applicationObjectId, String tenantId); - - /** - * Get the passwordCredentials associated with an application. - * - * @param applicationObjectId Application object ID. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the passwordCredentials associated with an application. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listPasswordCredentials( - String applicationObjectId, String tenantId, Context context); - - /** - * Update passwordCredentials associated with an application. - * - * @param applicationObjectId Application object ID. - * @param tenantId The tenant ID. - * @param parameters Parameters to update passwordCredentials of an existing application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updatePasswordCredentialsWithResponseAsync( - String applicationObjectId, String tenantId, PasswordCredentialsUpdateParameters parameters); - - /** - * Update passwordCredentials associated with an application. - * - * @param applicationObjectId Application object ID. - * @param tenantId The tenant ID. - * @param parameters Parameters to update passwordCredentials of an existing application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updatePasswordCredentialsAsync( - String applicationObjectId, String tenantId, PasswordCredentialsUpdateParameters parameters); - - /** - * Update passwordCredentials associated with an application. - * - * @param applicationObjectId Application object ID. - * @param tenantId The tenant ID. - * @param parameters Parameters to update passwordCredentials of an existing application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void updatePasswordCredentials( - String applicationObjectId, String tenantId, PasswordCredentialsUpdateParameters parameters); - - /** - * Update passwordCredentials associated with an application. - * - * @param applicationObjectId Application object ID. - * @param tenantId The tenant ID. - * @param parameters Parameters to update passwordCredentials of an existing application. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updatePasswordCredentialsWithResponse( - String applicationObjectId, String tenantId, PasswordCredentialsUpdateParameters parameters, Context context); - - /** - * Gets an object id for a given application id from the current tenant. - * - * @param tenantId The tenant ID. - * @param applicationId The application ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object id for a given application id from the current tenant. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getServicePrincipalsIdByAppIdWithResponseAsync( - String tenantId, String applicationId); - - /** - * Gets an object id for a given application id from the current tenant. - * - * @param tenantId The tenant ID. - * @param applicationId The application ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object id for a given application id from the current tenant. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getServicePrincipalsIdByAppIdAsync(String tenantId, String applicationId); - - /** - * Gets an object id for a given application id from the current tenant. - * - * @param tenantId The tenant ID. - * @param applicationId The application ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object id for a given application id from the current tenant. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ServicePrincipalObjectResultInner getServicePrincipalsIdByAppId(String tenantId, String applicationId); - - /** - * Gets an object id for a given application id from the current tenant. - * - * @param tenantId The tenant ID. - * @param applicationId The application ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object id for a given application id from the current tenant. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getServicePrincipalsIdByAppIdWithResponse( - String tenantId, String applicationId, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/AuthorizationManagementClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/AuthorizationManagementClient.java deleted file mode 100644 index 5596b5bd6c7d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/AuthorizationManagementClient.java +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.fluent; - -import com.azure.core.http.HttpPipeline; -import java.time.Duration; - -/** The interface for AuthorizationManagementClient class. */ -public interface AuthorizationManagementClient { - /** - * Gets The ID of the target subscription. - * - * @return the subscriptionId value. - */ - String getSubscriptionId(); - - /** - * Gets server parameter. - * - * @return the endpoint value. - */ - String getEndpoint(); - - /** - * Gets Api Version. - * - * @return the apiVersion value. - */ - String getApiVersion(); - - /** - * Gets The HTTP pipeline to send requests through. - * - * @return the httpPipeline value. - */ - HttpPipeline getHttpPipeline(); - - /** - * Gets The default poll interval for long-running operation. - * - * @return the defaultPollInterval value. - */ - Duration getDefaultPollInterval(); - - /** - * Gets the PermissionsClient object to access its operations. - * - * @return the PermissionsClient object. - */ - PermissionsClient getPermissions(); - - /** - * Gets the RoleDefinitionsClient object to access its operations. - * - * @return the RoleDefinitionsClient object. - */ - RoleDefinitionsClient getRoleDefinitions(); - - /** - * Gets the ProviderOperationsMetadatasClient object to access its operations. - * - * @return the ProviderOperationsMetadatasClient object. - */ - ProviderOperationsMetadatasClient getProviderOperationsMetadatas(); - - /** - * Gets the GlobalAdministratorsClient object to access its operations. - * - * @return the GlobalAdministratorsClient object. - */ - GlobalAdministratorsClient getGlobalAdministrators(); - - /** - * Gets the RoleAssignmentsClient object to access its operations. - * - * @return the RoleAssignmentsClient object. - */ - RoleAssignmentsClient getRoleAssignments(); - - /** - * Gets the ClassicAdministratorsClient object to access its operations. - * - * @return the ClassicAdministratorsClient object. - */ - ClassicAdministratorsClient getClassicAdministrators(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/ClassicAdministratorsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/ClassicAdministratorsClient.java deleted file mode 100644 index 30574ab0ef6a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/ClassicAdministratorsClient.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.authorization.fluent.models.ClassicAdministratorInner; - -/** An instance of this class provides access to all the operations defined in ClassicAdministratorsClient. */ -public interface ClassicAdministratorsClient { - /** - * Gets service administrator, account administrator, and co-administrators for the subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service administrator, account administrator, and co-administrators for the subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Gets service administrator, account administrator, and co-administrators for the subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service administrator, account administrator, and co-administrators for the subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Gets service administrator, account administrator, and co-administrators for the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service administrator, account administrator, and co-administrators for the subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/DeletedApplicationsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/DeletedApplicationsClient.java deleted file mode 100644 index af6096cb5802..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/DeletedApplicationsClient.java +++ /dev/null @@ -1,185 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.authorization.fluent.models.ApplicationInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in DeletedApplicationsClient. */ -public interface DeletedApplicationsClient { - /** - * Restores the deleted application in the directory. - * - * @param objectId Application object ID. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return active Directory application information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> restoreWithResponseAsync(String objectId, String tenantId); - - /** - * Restores the deleted application in the directory. - * - * @param objectId Application object ID. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return active Directory application information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono restoreAsync(String objectId, String tenantId); - - /** - * Restores the deleted application in the directory. - * - * @param objectId Application object ID. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return active Directory application information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ApplicationInner restore(String objectId, String tenantId); - - /** - * Restores the deleted application in the directory. - * - * @param objectId Application object ID. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return active Directory application information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response restoreWithResponse(String objectId, String tenantId, Context context); - - /** - * Gets a list of deleted applications in the directory. - * - * @param tenantId The tenant ID. - * @param filter The filter to apply to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of deleted applications in the directory. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String tenantId, String filter); - - /** - * Gets a list of deleted applications in the directory. - * - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of deleted applications in the directory. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String tenantId); - - /** - * Gets a list of deleted applications in the directory. - * - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of deleted applications in the directory. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String tenantId); - - /** - * Gets a list of deleted applications in the directory. - * - * @param tenantId The tenant ID. - * @param filter The filter to apply to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of deleted applications in the directory. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String tenantId, String filter, Context context); - - /** - * Hard-delete an application. - * - * @param applicationObjectId Application object ID. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> hardDeleteWithResponseAsync(String applicationObjectId, String tenantId); - - /** - * Hard-delete an application. - * - * @param applicationObjectId Application object ID. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono hardDeleteAsync(String applicationObjectId, String tenantId); - - /** - * Hard-delete an application. - * - * @param applicationObjectId Application object ID. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void hardDelete(String applicationObjectId, String tenantId); - - /** - * Hard-delete an application. - * - * @param applicationObjectId Application object ID. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response hardDeleteWithResponse(String applicationObjectId, String tenantId, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/DomainsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/DomainsClient.java deleted file mode 100644 index 6fffd5624b09..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/DomainsClient.java +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.authorization.fluent.models.DomainInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in DomainsClient. */ -public interface DomainsClient { - /** - * Gets a list of domains for the current tenant. - * - * @param tenantId The tenant ID. - * @param filter The filter to apply to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of domains for the current tenant. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String tenantId, String filter); - - /** - * Gets a list of domains for the current tenant. - * - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of domains for the current tenant. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String tenantId); - - /** - * Gets a list of domains for the current tenant. - * - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of domains for the current tenant. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String tenantId); - - /** - * Gets a list of domains for the current tenant. - * - * @param tenantId The tenant ID. - * @param filter The filter to apply to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of domains for the current tenant. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String tenantId, String filter, Context context); - - /** - * Gets a specific domain in the current tenant. - * - * @param domainName name of the domain. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific domain in the current tenant. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync(String domainName, String tenantId); - - /** - * Gets a specific domain in the current tenant. - * - * @param domainName name of the domain. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific domain in the current tenant. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync(String domainName, String tenantId); - - /** - * Gets a specific domain in the current tenant. - * - * @param domainName name of the domain. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific domain in the current tenant. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DomainInner get(String domainName, String tenantId); - - /** - * Gets a specific domain in the current tenant. - * - * @param domainName name of the domain. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific domain in the current tenant. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String domainName, String tenantId, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/GlobalAdministratorsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/GlobalAdministratorsClient.java deleted file mode 100644 index 25acf7cd3dce..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/GlobalAdministratorsClient.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in GlobalAdministratorsClient. */ -public interface GlobalAdministratorsClient { - /** - * Elevates access for a Global Administrator. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> elevateAccessWithResponseAsync(); - - /** - * Elevates access for a Global Administrator. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono elevateAccessAsync(); - - /** - * Elevates access for a Global Administrator. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void elevateAccess(); - - /** - * Elevates access for a Global Administrator. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response elevateAccessWithResponse(Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/GraphRbacManagementClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/GraphRbacManagementClient.java deleted file mode 100644 index 6d7122c9d815..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/GraphRbacManagementClient.java +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.fluent; - -import com.azure.core.http.HttpPipeline; -import java.time.Duration; - -/** The interface for GraphRbacManagementClient class. */ -public interface GraphRbacManagementClient { - /** - * Gets server parameter. - * - * @return the endpoint value. - */ - String getEndpoint(); - - /** - * Gets Api Version. - * - * @return the apiVersion value. - */ - String getApiVersion(); - - /** - * Gets The HTTP pipeline to send requests through. - * - * @return the httpPipeline value. - */ - HttpPipeline getHttpPipeline(); - - /** - * Gets The default poll interval for long-running operation. - * - * @return the defaultPollInterval value. - */ - Duration getDefaultPollInterval(); - - /** - * Gets the SignedInUsersClient object to access its operations. - * - * @return the SignedInUsersClient object. - */ - SignedInUsersClient getSignedInUsers(); - - /** - * Gets the ApplicationsClient object to access its operations. - * - * @return the ApplicationsClient object. - */ - ApplicationsClient getApplications(); - - /** - * Gets the DeletedApplicationsClient object to access its operations. - * - * @return the DeletedApplicationsClient object. - */ - DeletedApplicationsClient getDeletedApplications(); - - /** - * Gets the GroupsClient object to access its operations. - * - * @return the GroupsClient object. - */ - GroupsClient getGroups(); - - /** - * Gets the ServicePrincipalsClient object to access its operations. - * - * @return the ServicePrincipalsClient object. - */ - ServicePrincipalsClient getServicePrincipals(); - - /** - * Gets the UsersClient object to access its operations. - * - * @return the UsersClient object. - */ - UsersClient getUsers(); - - /** - * Gets the ObjectsClient object to access its operations. - * - * @return the ObjectsClient object. - */ - ObjectsClient getObjects(); - - /** - * Gets the DomainsClient object to access its operations. - * - * @return the DomainsClient object. - */ - DomainsClient getDomains(); - - /** - * Gets the OAuth2PermissionGrantsClient object to access its operations. - * - * @return the OAuth2PermissionGrantsClient object. - */ - OAuth2PermissionGrantsClient getOAuth2PermissionGrants(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/GroupsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/GroupsClient.java deleted file mode 100644 index 1d9d2eecc4ee..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/GroupsClient.java +++ /dev/null @@ -1,698 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.authorization.fluent.models.ADGroupInner; -import com.azure.resourcemanager.authorization.fluent.models.CheckGroupMembershipResultInner; -import com.azure.resourcemanager.authorization.fluent.models.DirectoryObjectInner; -import com.azure.resourcemanager.authorization.models.AddOwnerParameters; -import com.azure.resourcemanager.authorization.models.CheckGroupMembershipParameters; -import com.azure.resourcemanager.authorization.models.GroupAddMemberParameters; -import com.azure.resourcemanager.authorization.models.GroupCreateParameters; -import com.azure.resourcemanager.authorization.models.GroupGetMemberGroupsParameters; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in GroupsClient. */ -public interface GroupsClient extends InnerSupportsDelete { - /** - * Checks whether the specified user, group, contact, or service principal is a direct or transitive member of the - * specified group. - * - * @param tenantId The tenant ID. - * @param parameters The check group membership parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return server response for IsMemberOf API call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> isMemberOfWithResponseAsync( - String tenantId, CheckGroupMembershipParameters parameters); - - /** - * Checks whether the specified user, group, contact, or service principal is a direct or transitive member of the - * specified group. - * - * @param tenantId The tenant ID. - * @param parameters The check group membership parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return server response for IsMemberOf API call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono isMemberOfAsync(String tenantId, CheckGroupMembershipParameters parameters); - - /** - * Checks whether the specified user, group, contact, or service principal is a direct or transitive member of the - * specified group. - * - * @param tenantId The tenant ID. - * @param parameters The check group membership parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return server response for IsMemberOf API call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - CheckGroupMembershipResultInner isMemberOf(String tenantId, CheckGroupMembershipParameters parameters); - - /** - * Checks whether the specified user, group, contact, or service principal is a direct or transitive member of the - * specified group. - * - * @param tenantId The tenant ID. - * @param parameters The check group membership parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return server response for IsMemberOf API call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response isMemberOfWithResponse( - String tenantId, CheckGroupMembershipParameters parameters, Context context); - - /** - * Remove a member from a group. - * - * @param groupObjectId The object ID of the group from which to remove the member. - * @param memberObjectId Member object id. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> removeMemberWithResponseAsync(String groupObjectId, String memberObjectId, String tenantId); - - /** - * Remove a member from a group. - * - * @param groupObjectId The object ID of the group from which to remove the member. - * @param memberObjectId Member object id. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono removeMemberAsync(String groupObjectId, String memberObjectId, String tenantId); - - /** - * Remove a member from a group. - * - * @param groupObjectId The object ID of the group from which to remove the member. - * @param memberObjectId Member object id. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void removeMember(String groupObjectId, String memberObjectId, String tenantId); - - /** - * Remove a member from a group. - * - * @param groupObjectId The object ID of the group from which to remove the member. - * @param memberObjectId Member object id. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response removeMemberWithResponse( - String groupObjectId, String memberObjectId, String tenantId, Context context); - - /** - * Add a member to a group. - * - * @param groupObjectId The object ID of the group to which to add the member. - * @param tenantId The tenant ID. - * @param parameters The URL of the member object, such as - * https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects/f260bbc4-c254-447b-94cf-293b5ec434dd. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> addMemberWithResponseAsync( - String groupObjectId, String tenantId, GroupAddMemberParameters parameters); - - /** - * Add a member to a group. - * - * @param groupObjectId The object ID of the group to which to add the member. - * @param tenantId The tenant ID. - * @param parameters The URL of the member object, such as - * https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects/f260bbc4-c254-447b-94cf-293b5ec434dd. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono addMemberAsync(String groupObjectId, String tenantId, GroupAddMemberParameters parameters); - - /** - * Add a member to a group. - * - * @param groupObjectId The object ID of the group to which to add the member. - * @param tenantId The tenant ID. - * @param parameters The URL of the member object, such as - * https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects/f260bbc4-c254-447b-94cf-293b5ec434dd. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void addMember(String groupObjectId, String tenantId, GroupAddMemberParameters parameters); - - /** - * Add a member to a group. - * - * @param groupObjectId The object ID of the group to which to add the member. - * @param tenantId The tenant ID. - * @param parameters The URL of the member object, such as - * https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects/f260bbc4-c254-447b-94cf-293b5ec434dd. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response addMemberWithResponse( - String groupObjectId, String tenantId, GroupAddMemberParameters parameters, Context context); - - /** - * Create a group in the directory. - * - * @param tenantId The tenant ID. - * @param parameters The parameters for the group to create. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return active Directory group information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createWithResponseAsync(String tenantId, GroupCreateParameters parameters); - - /** - * Create a group in the directory. - * - * @param tenantId The tenant ID. - * @param parameters The parameters for the group to create. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return active Directory group information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createAsync(String tenantId, GroupCreateParameters parameters); - - /** - * Create a group in the directory. - * - * @param tenantId The tenant ID. - * @param parameters The parameters for the group to create. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return active Directory group information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ADGroupInner create(String tenantId, GroupCreateParameters parameters); - - /** - * Create a group in the directory. - * - * @param tenantId The tenant ID. - * @param parameters The parameters for the group to create. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return active Directory group information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createWithResponse(String tenantId, GroupCreateParameters parameters, Context context); - - /** - * Gets list of groups for the current tenant. - * - * @param tenantId The tenant ID. - * @param filter The filter to apply to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of groups for the current tenant. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String tenantId, String filter); - - /** - * Gets list of groups for the current tenant. - * - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of groups for the current tenant. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String tenantId); - - /** - * Gets list of groups for the current tenant. - * - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of groups for the current tenant. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String tenantId); - - /** - * Gets list of groups for the current tenant. - * - * @param tenantId The tenant ID. - * @param filter The filter to apply to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of groups for the current tenant. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String tenantId, String filter, Context context); - - /** - * Gets the members of a group. - * - * @param objectId The object ID of the group whose members should be retrieved. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the members of a group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux getGroupMembersAsync(String objectId, String tenantId); - - /** - * Gets the members of a group. - * - * @param objectId The object ID of the group whose members should be retrieved. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the members of a group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable getGroupMembers(String objectId, String tenantId); - - /** - * Gets the members of a group. - * - * @param objectId The object ID of the group whose members should be retrieved. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the members of a group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable getGroupMembers(String objectId, String tenantId, Context context); - - /** - * Gets group information from the directory. - * - * @param objectId The object ID of the user for which to get group information. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return group information from the directory. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync(String objectId, String tenantId); - - /** - * Gets group information from the directory. - * - * @param objectId The object ID of the user for which to get group information. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return group information from the directory. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync(String objectId, String tenantId); - - /** - * Gets group information from the directory. - * - * @param objectId The object ID of the user for which to get group information. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return group information from the directory. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ADGroupInner get(String objectId, String tenantId); - - /** - * Gets group information from the directory. - * - * @param objectId The object ID of the user for which to get group information. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return group information from the directory. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String objectId, String tenantId, Context context); - - /** - * Delete a group from the directory. - * - * @param objectId The object ID of the group to delete. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteWithResponseAsync(String objectId, String tenantId); - - /** - * Delete a group from the directory. - * - * @param objectId The object ID of the group to delete. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String objectId, String tenantId); - - /** - * Delete a group from the directory. - * - * @param objectId The object ID of the group to delete. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String objectId, String tenantId); - - /** - * Delete a group from the directory. - * - * @param objectId The object ID of the group to delete. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String objectId, String tenantId, Context context); - - /** - * Gets a collection of object IDs of groups of which the specified group is a member. - * - * @param objectId The object ID of the group for which to get group membership. - * @param tenantId The tenant ID. - * @param parameters Group filtering parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a collection of object IDs of groups of which the specified group is a member. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux getMemberGroupsAsync(String objectId, String tenantId, GroupGetMemberGroupsParameters parameters); - - /** - * Gets a collection of object IDs of groups of which the specified group is a member. - * - * @param objectId The object ID of the group for which to get group membership. - * @param tenantId The tenant ID. - * @param parameters Group filtering parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a collection of object IDs of groups of which the specified group is a member. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable getMemberGroups(String objectId, String tenantId, GroupGetMemberGroupsParameters parameters); - - /** - * Gets a collection of object IDs of groups of which the specified group is a member. - * - * @param objectId The object ID of the group for which to get group membership. - * @param tenantId The tenant ID. - * @param parameters Group filtering parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a collection of object IDs of groups of which the specified group is a member. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable getMemberGroups( - String objectId, String tenantId, GroupGetMemberGroupsParameters parameters, Context context); - - /** - * The owners are a set of non-admin users who are allowed to modify this object. - * - * @param objectId The object ID of the group for which to get owners. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return directoryObject list operation result. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listOwnersAsync(String objectId, String tenantId); - - /** - * The owners are a set of non-admin users who are allowed to modify this object. - * - * @param objectId The object ID of the group for which to get owners. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return directoryObject list operation result. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listOwners(String objectId, String tenantId); - - /** - * The owners are a set of non-admin users who are allowed to modify this object. - * - * @param objectId The object ID of the group for which to get owners. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return directoryObject list operation result. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listOwners(String objectId, String tenantId, Context context); - - /** - * Add an owner to a group. - * - * @param objectId The object ID of the application to which to add the owner. - * @param tenantId The tenant ID. - * @param parameters The URL of the owner object, such as - * https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects/f260bbc4-c254-447b-94cf-293b5ec434dd. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> addOwnerWithResponseAsync(String objectId, String tenantId, AddOwnerParameters parameters); - - /** - * Add an owner to a group. - * - * @param objectId The object ID of the application to which to add the owner. - * @param tenantId The tenant ID. - * @param parameters The URL of the owner object, such as - * https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects/f260bbc4-c254-447b-94cf-293b5ec434dd. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono addOwnerAsync(String objectId, String tenantId, AddOwnerParameters parameters); - - /** - * Add an owner to a group. - * - * @param objectId The object ID of the application to which to add the owner. - * @param tenantId The tenant ID. - * @param parameters The URL of the owner object, such as - * https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects/f260bbc4-c254-447b-94cf-293b5ec434dd. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void addOwner(String objectId, String tenantId, AddOwnerParameters parameters); - - /** - * Add an owner to a group. - * - * @param objectId The object ID of the application to which to add the owner. - * @param tenantId The tenant ID. - * @param parameters The URL of the owner object, such as - * https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects/f260bbc4-c254-447b-94cf-293b5ec434dd. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response addOwnerWithResponse( - String objectId, String tenantId, AddOwnerParameters parameters, Context context); - - /** - * Remove a member from owners. - * - * @param objectId The object ID of the group from which to remove the owner. - * @param ownerObjectId Owner object id. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> removeOwnerWithResponseAsync(String objectId, String ownerObjectId, String tenantId); - - /** - * Remove a member from owners. - * - * @param objectId The object ID of the group from which to remove the owner. - * @param ownerObjectId Owner object id. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono removeOwnerAsync(String objectId, String ownerObjectId, String tenantId); - - /** - * Remove a member from owners. - * - * @param objectId The object ID of the group from which to remove the owner. - * @param ownerObjectId Owner object id. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void removeOwner(String objectId, String ownerObjectId, String tenantId); - - /** - * Remove a member from owners. - * - * @param objectId The object ID of the group from which to remove the owner. - * @param ownerObjectId Owner object id. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response removeOwnerWithResponse(String objectId, String ownerObjectId, String tenantId, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/OAuth2PermissionGrantsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/OAuth2PermissionGrantsClient.java deleted file mode 100644 index 0ab6faac6b11..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/OAuth2PermissionGrantsClient.java +++ /dev/null @@ -1,191 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.authorization.fluent.models.OAuth2PermissionGrantInner; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in OAuth2PermissionGrantsClient. */ -public interface OAuth2PermissionGrantsClient extends InnerSupportsDelete { - /** - * Queries OAuth2 permissions grants for the relevant SP ObjectId of an app. - * - * @param tenantId The tenant ID. - * @param filter This is the Service Principal ObjectId associated with the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return server response for get oauth2 permissions grants. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String tenantId, String filter); - - /** - * Queries OAuth2 permissions grants for the relevant SP ObjectId of an app. - * - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return server response for get oauth2 permissions grants. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String tenantId); - - /** - * Queries OAuth2 permissions grants for the relevant SP ObjectId of an app. - * - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return server response for get oauth2 permissions grants. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String tenantId); - - /** - * Queries OAuth2 permissions grants for the relevant SP ObjectId of an app. - * - * @param tenantId The tenant ID. - * @param filter This is the Service Principal ObjectId associated with the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return server response for get oauth2 permissions grants. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String tenantId, String filter, Context context); - - /** - * Grants OAuth2 permissions for the relevant resource Ids of an app. - * - * @param tenantId The tenant ID. - * @param body The relevant app Service Principal Object Id and the Service Principal Object Id you want to grant. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createWithResponseAsync( - String tenantId, OAuth2PermissionGrantInner body); - - /** - * Grants OAuth2 permissions for the relevant resource Ids of an app. - * - * @param tenantId The tenant ID. - * @param body The relevant app Service Principal Object Id and the Service Principal Object Id you want to grant. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createAsync(String tenantId, OAuth2PermissionGrantInner body); - - /** - * Grants OAuth2 permissions for the relevant resource Ids of an app. - * - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createAsync(String tenantId); - - /** - * Grants OAuth2 permissions for the relevant resource Ids of an app. - * - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - OAuth2PermissionGrantInner create(String tenantId); - - /** - * Grants OAuth2 permissions for the relevant resource Ids of an app. - * - * @param tenantId The tenant ID. - * @param body The relevant app Service Principal Object Id and the Service Principal Object Id you want to grant. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createWithResponse( - String tenantId, OAuth2PermissionGrantInner body, Context context); - - /** - * Delete a OAuth2 permission grant for the relevant resource Ids of an app. - * - * @param objectId The object ID of a permission grant. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteWithResponseAsync(String objectId, String tenantId); - - /** - * Delete a OAuth2 permission grant for the relevant resource Ids of an app. - * - * @param objectId The object ID of a permission grant. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String objectId, String tenantId); - - /** - * Delete a OAuth2 permission grant for the relevant resource Ids of an app. - * - * @param objectId The object ID of a permission grant. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String objectId, String tenantId); - - /** - * Delete a OAuth2 permission grant for the relevant resource Ids of an app. - * - * @param objectId The object ID of a permission grant. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String objectId, String tenantId, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/ObjectsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/ObjectsClient.java deleted file mode 100644 index 69cb6104c3be..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/ObjectsClient.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.authorization.fluent.models.DirectoryObjectInner; -import com.azure.resourcemanager.authorization.models.GetObjectsParameters; - -/** An instance of this class provides access to all the operations defined in ObjectsClient. */ -public interface ObjectsClient { - /** - * Gets the directory objects specified in a list of object IDs. You can also specify which resource collections - * (users, groups, etc.) should be searched by specifying the optional types parameter. - * - * @param tenantId The tenant ID. - * @param parameters Objects filtering parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the directory objects specified in a list of object IDs. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux getObjectsByObjectIdsAsync(String tenantId, GetObjectsParameters parameters); - - /** - * Gets the directory objects specified in a list of object IDs. You can also specify which resource collections - * (users, groups, etc.) should be searched by specifying the optional types parameter. - * - * @param tenantId The tenant ID. - * @param parameters Objects filtering parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the directory objects specified in a list of object IDs. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable getObjectsByObjectIds(String tenantId, GetObjectsParameters parameters); - - /** - * Gets the directory objects specified in a list of object IDs. You can also specify which resource collections - * (users, groups, etc.) should be searched by specifying the optional types parameter. - * - * @param tenantId The tenant ID. - * @param parameters Objects filtering parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the directory objects specified in a list of object IDs. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable getObjectsByObjectIds( - String tenantId, GetObjectsParameters parameters, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/PermissionsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/PermissionsClient.java deleted file mode 100644 index fe254885f1bc..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/PermissionsClient.java +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.authorization.fluent.models.PermissionInner; - -/** An instance of this class provides access to all the operations defined in PermissionsClient. */ -public interface PermissionsClient { - /** - * Gets all permissions the caller has for a resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all permissions the caller has for a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName); - - /** - * Gets all permissions the caller has for a resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all permissions the caller has for a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Gets all permissions the caller has for a resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all permissions the caller has for a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * Gets all permissions the caller has for a resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource. - * @param resourceName The name of the resource to get the permissions for. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all permissions the caller has for a resource. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listForResourceAsync( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName); - - /** - * Gets all permissions the caller has for a resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource. - * @param resourceName The name of the resource to get the permissions for. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all permissions the caller has for a resource. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listForResource( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName); - - /** - * Gets all permissions the caller has for a resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource. - * @param resourceName The name of the resource to get the permissions for. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all permissions the caller has for a resource. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listForResource( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/ProviderOperationsMetadatasClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/ProviderOperationsMetadatasClient.java deleted file mode 100644 index 62e0a000abd0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/ProviderOperationsMetadatasClient.java +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.authorization.fluent.models.ProviderOperationsMetadataInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ProviderOperationsMetadatasClient. */ -public interface ProviderOperationsMetadatasClient { - /** - * Gets provider operations metadata for the specified resource provider. - * - * @param resourceProviderNamespace The namespace of the resource provider. - * @param expand Specifies whether to expand the values. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return provider operations metadata for the specified resource provider. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync( - String resourceProviderNamespace, String expand); - - /** - * Gets provider operations metadata for the specified resource provider. - * - * @param resourceProviderNamespace The namespace of the resource provider. - * @param expand Specifies whether to expand the values. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return provider operations metadata for the specified resource provider. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync(String resourceProviderNamespace, String expand); - - /** - * Gets provider operations metadata for the specified resource provider. - * - * @param resourceProviderNamespace The namespace of the resource provider. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return provider operations metadata for the specified resource provider. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync(String resourceProviderNamespace); - - /** - * Gets provider operations metadata for the specified resource provider. - * - * @param resourceProviderNamespace The namespace of the resource provider. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return provider operations metadata for the specified resource provider. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ProviderOperationsMetadataInner get(String resourceProviderNamespace); - - /** - * Gets provider operations metadata for the specified resource provider. - * - * @param resourceProviderNamespace The namespace of the resource provider. - * @param expand Specifies whether to expand the values. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return provider operations metadata for the specified resource provider. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceProviderNamespace, String expand, Context context); - - /** - * Gets provider operations metadata for all resource providers. - * - * @param expand Specifies whether to expand the values. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return provider operations metadata for all resource providers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String expand); - - /** - * Gets provider operations metadata for all resource providers. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return provider operations metadata for all resource providers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Gets provider operations metadata for all resource providers. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return provider operations metadata for all resource providers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Gets provider operations metadata for all resource providers. - * - * @param expand Specifies whether to expand the values. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return provider operations metadata for all resource providers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String expand, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/RoleAssignmentsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/RoleAssignmentsClient.java deleted file mode 100644 index 5474aa2069a0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/RoleAssignmentsClient.java +++ /dev/null @@ -1,645 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.authorization.fluent.models.RoleAssignmentInner; -import com.azure.resourcemanager.authorization.models.RoleAssignmentCreateParameters; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in RoleAssignmentsClient. */ -public interface RoleAssignmentsClient - extends InnerSupportsListing, InnerSupportsDelete { - /** - * Gets role assignments for a resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource. - * @param resourceName The name of the resource to get role assignments for. - * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or - * above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope - * for the specified principal. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role assignments for a resource. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listForResourceAsync( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String filter); - - /** - * Gets role assignments for a resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource. - * @param resourceName The name of the resource to get role assignments for. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role assignments for a resource. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listForResourceAsync( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName); - - /** - * Gets role assignments for a resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource. - * @param resourceName The name of the resource to get role assignments for. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role assignments for a resource. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listForResource( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName); - - /** - * Gets role assignments for a resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource. - * @param resourceName The name of the resource to get role assignments for. - * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or - * above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope - * for the specified principal. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role assignments for a resource. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listForResource( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String filter, - Context context); - - /** - * Gets role assignments for a resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or - * above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope - * for the specified principal. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role assignments for a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName, String filter); - - /** - * Gets role assignments for a resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role assignments for a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName); - - /** - * Gets role assignments for a resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role assignments for a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Gets role assignments for a resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or - * above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope - * for the specified principal. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role assignments for a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, String filter, Context context); - - /** - * Deletes a role assignment. - * - * @param scope The scope of the role assignment to delete. - * @param roleAssignmentName The name of the role assignment to delete. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role Assignments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteWithResponseAsync(String scope, String roleAssignmentName); - - /** - * Deletes a role assignment. - * - * @param scope The scope of the role assignment to delete. - * @param roleAssignmentName The name of the role assignment to delete. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role Assignments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String scope, String roleAssignmentName); - - /** - * Deletes a role assignment. - * - * @param scope The scope of the role assignment to delete. - * @param roleAssignmentName The name of the role assignment to delete. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role Assignments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RoleAssignmentInner delete(String scope, String roleAssignmentName); - - /** - * Deletes a role assignment. - * - * @param scope The scope of the role assignment to delete. - * @param roleAssignmentName The name of the role assignment to delete. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role Assignments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String scope, String roleAssignmentName, Context context); - - /** - * Creates a role assignment. - * - * @param scope The scope of the role assignment to create. The scope can be any REST resource instance. For - * example, use '/subscriptions/{subscription-id}/' for a subscription, - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' - * for a resource. - * @param roleAssignmentName The name of the role assignment to create. It can be any valid GUID. - * @param parameters Parameters for the role assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role Assignments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createWithResponseAsync( - String scope, String roleAssignmentName, RoleAssignmentCreateParameters parameters); - - /** - * Creates a role assignment. - * - * @param scope The scope of the role assignment to create. The scope can be any REST resource instance. For - * example, use '/subscriptions/{subscription-id}/' for a subscription, - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' - * for a resource. - * @param roleAssignmentName The name of the role assignment to create. It can be any valid GUID. - * @param parameters Parameters for the role assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role Assignments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createAsync( - String scope, String roleAssignmentName, RoleAssignmentCreateParameters parameters); - - /** - * Creates a role assignment. - * - * @param scope The scope of the role assignment to create. The scope can be any REST resource instance. For - * example, use '/subscriptions/{subscription-id}/' for a subscription, - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' - * for a resource. - * @param roleAssignmentName The name of the role assignment to create. It can be any valid GUID. - * @param parameters Parameters for the role assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role Assignments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RoleAssignmentInner create(String scope, String roleAssignmentName, RoleAssignmentCreateParameters parameters); - - /** - * Creates a role assignment. - * - * @param scope The scope of the role assignment to create. The scope can be any REST resource instance. For - * example, use '/subscriptions/{subscription-id}/' for a subscription, - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' - * for a resource. - * @param roleAssignmentName The name of the role assignment to create. It can be any valid GUID. - * @param parameters Parameters for the role assignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role Assignments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createWithResponse( - String scope, String roleAssignmentName, RoleAssignmentCreateParameters parameters, Context context); - - /** - * Get the specified role assignment. - * - * @param scope The scope of the role assignment. - * @param roleAssignmentName The name of the role assignment to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified role assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync(String scope, String roleAssignmentName); - - /** - * Get the specified role assignment. - * - * @param scope The scope of the role assignment. - * @param roleAssignmentName The name of the role assignment to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified role assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync(String scope, String roleAssignmentName); - - /** - * Get the specified role assignment. - * - * @param scope The scope of the role assignment. - * @param roleAssignmentName The name of the role assignment to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified role assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RoleAssignmentInner get(String scope, String roleAssignmentName); - - /** - * Get the specified role assignment. - * - * @param scope The scope of the role assignment. - * @param roleAssignmentName The name of the role assignment to get. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified role assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String scope, String roleAssignmentName, Context context); - - /** - * Deletes a role assignment. - * - * @param roleAssignmentId The fully qualified ID of the role assignment, including the scope, resource name and - * resource type. Use the format, - * /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. Example: - * /subscriptions/{subId}/resourcegroups/{rgname}//providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role Assignments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteByIdWithResponseAsync(String roleAssignmentId); - - /** - * Deletes a role assignment. - * - * @param roleAssignmentId The fully qualified ID of the role assignment, including the scope, resource name and - * resource type. Use the format, - * /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. Example: - * /subscriptions/{subId}/resourcegroups/{rgname}//providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role Assignments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteByIdAsync(String roleAssignmentId); - - /** - * Deletes a role assignment. - * - * @param roleAssignmentId The fully qualified ID of the role assignment, including the scope, resource name and - * resource type. Use the format, - * /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. Example: - * /subscriptions/{subId}/resourcegroups/{rgname}//providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role Assignments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RoleAssignmentInner deleteById(String roleAssignmentId); - - /** - * Deletes a role assignment. - * - * @param roleAssignmentId The fully qualified ID of the role assignment, including the scope, resource name and - * resource type. Use the format, - * /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. Example: - * /subscriptions/{subId}/resourcegroups/{rgname}//providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role Assignments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteByIdWithResponse(String roleAssignmentId, Context context); - - /** - * Creates a role assignment by ID. - * - * @param roleAssignmentId The fully qualified ID of the role assignment, including the scope, resource name and - * resource type. Use the format, - * /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. Example: - * /subscriptions/{subId}/resourcegroups/{rgname}//providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. - * @param parameters Parameters for the role assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role Assignments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createByIdWithResponseAsync( - String roleAssignmentId, RoleAssignmentCreateParameters parameters); - - /** - * Creates a role assignment by ID. - * - * @param roleAssignmentId The fully qualified ID of the role assignment, including the scope, resource name and - * resource type. Use the format, - * /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. Example: - * /subscriptions/{subId}/resourcegroups/{rgname}//providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. - * @param parameters Parameters for the role assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role Assignments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createByIdAsync(String roleAssignmentId, RoleAssignmentCreateParameters parameters); - - /** - * Creates a role assignment by ID. - * - * @param roleAssignmentId The fully qualified ID of the role assignment, including the scope, resource name and - * resource type. Use the format, - * /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. Example: - * /subscriptions/{subId}/resourcegroups/{rgname}//providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. - * @param parameters Parameters for the role assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role Assignments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RoleAssignmentInner createById(String roleAssignmentId, RoleAssignmentCreateParameters parameters); - - /** - * Creates a role assignment by ID. - * - * @param roleAssignmentId The fully qualified ID of the role assignment, including the scope, resource name and - * resource type. Use the format, - * /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. Example: - * /subscriptions/{subId}/resourcegroups/{rgname}//providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. - * @param parameters Parameters for the role assignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role Assignments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createByIdWithResponse( - String roleAssignmentId, RoleAssignmentCreateParameters parameters, Context context); - - /** - * Gets a role assignment by ID. - * - * @param roleAssignmentId The fully qualified ID of the role assignment, including the scope, resource name and - * resource type. Use the format, - * /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. Example: - * /subscriptions/{subId}/resourcegroups/{rgname}//providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a role assignment by ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByIdWithResponseAsync(String roleAssignmentId); - - /** - * Gets a role assignment by ID. - * - * @param roleAssignmentId The fully qualified ID of the role assignment, including the scope, resource name and - * resource type. Use the format, - * /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. Example: - * /subscriptions/{subId}/resourcegroups/{rgname}//providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a role assignment by ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByIdAsync(String roleAssignmentId); - - /** - * Gets a role assignment by ID. - * - * @param roleAssignmentId The fully qualified ID of the role assignment, including the scope, resource name and - * resource type. Use the format, - * /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. Example: - * /subscriptions/{subId}/resourcegroups/{rgname}//providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a role assignment by ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RoleAssignmentInner getById(String roleAssignmentId); - - /** - * Gets a role assignment by ID. - * - * @param roleAssignmentId The fully qualified ID of the role assignment, including the scope, resource name and - * resource type. Use the format, - * /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. Example: - * /subscriptions/{subId}/resourcegroups/{rgname}//providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a role assignment by ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByIdWithResponse(String roleAssignmentId, Context context); - - /** - * Gets all role assignments for the subscription. - * - * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or - * above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope - * for the specified principal. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all role assignments for the subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String filter); - - /** - * Gets all role assignments for the subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all role assignments for the subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Gets all role assignments for the subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all role assignments for the subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Gets all role assignments for the subscription. - * - * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or - * above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope - * for the specified principal. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all role assignments for the subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String filter, Context context); - - /** - * Gets role assignments for a scope. - * - * @param scope The scope of the role assignments. - * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or - * above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope - * for the specified principal. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role assignments for a scope. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listForScopeAsync(String scope, String filter); - - /** - * Gets role assignments for a scope. - * - * @param scope The scope of the role assignments. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role assignments for a scope. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listForScopeAsync(String scope); - - /** - * Gets role assignments for a scope. - * - * @param scope The scope of the role assignments. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role assignments for a scope. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listForScope(String scope); - - /** - * Gets role assignments for a scope. - * - * @param scope The scope of the role assignments. - * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or - * above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope - * for the specified principal. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role assignments for a scope. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listForScope(String scope, String filter, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/RoleDefinitionsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/RoleDefinitionsClient.java deleted file mode 100644 index fa646205947f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/RoleDefinitionsClient.java +++ /dev/null @@ -1,298 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.authorization.fluent.models.RoleDefinitionInner; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in RoleDefinitionsClient. */ -public interface RoleDefinitionsClient extends InnerSupportsDelete { - /** - * Deletes a role definition. - * - * @param scope The scope of the role definition. - * @param roleDefinitionId The ID of the role definition to delete. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteWithResponseAsync(String scope, String roleDefinitionId); - - /** - * Deletes a role definition. - * - * @param scope The scope of the role definition. - * @param roleDefinitionId The ID of the role definition to delete. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String scope, String roleDefinitionId); - - /** - * Deletes a role definition. - * - * @param scope The scope of the role definition. - * @param roleDefinitionId The ID of the role definition to delete. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RoleDefinitionInner delete(String scope, String roleDefinitionId); - - /** - * Deletes a role definition. - * - * @param scope The scope of the role definition. - * @param roleDefinitionId The ID of the role definition to delete. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String scope, String roleDefinitionId, Context context); - - /** - * Get role definition by name (GUID). - * - * @param scope The scope of the role definition. - * @param roleDefinitionId The ID of the role definition. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role definition by name (GUID). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync(String scope, String roleDefinitionId); - - /** - * Get role definition by name (GUID). - * - * @param scope The scope of the role definition. - * @param roleDefinitionId The ID of the role definition. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role definition by name (GUID). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync(String scope, String roleDefinitionId); - - /** - * Get role definition by name (GUID). - * - * @param scope The scope of the role definition. - * @param roleDefinitionId The ID of the role definition. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role definition by name (GUID). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RoleDefinitionInner get(String scope, String roleDefinitionId); - - /** - * Get role definition by name (GUID). - * - * @param scope The scope of the role definition. - * @param roleDefinitionId The ID of the role definition. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role definition by name (GUID). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String scope, String roleDefinitionId, Context context); - - /** - * Creates or updates a role definition. - * - * @param scope The scope of the role definition. - * @param roleDefinitionId The ID of the role definition. - * @param roleDefinition The values for the role definition. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createOrUpdateWithResponseAsync( - String scope, String roleDefinitionId, RoleDefinitionInner roleDefinition); - - /** - * Creates or updates a role definition. - * - * @param scope The scope of the role definition. - * @param roleDefinitionId The ID of the role definition. - * @param roleDefinition The values for the role definition. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String scope, String roleDefinitionId, RoleDefinitionInner roleDefinition); - - /** - * Creates or updates a role definition. - * - * @param scope The scope of the role definition. - * @param roleDefinitionId The ID of the role definition. - * @param roleDefinition The values for the role definition. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RoleDefinitionInner createOrUpdate(String scope, String roleDefinitionId, RoleDefinitionInner roleDefinition); - - /** - * Creates or updates a role definition. - * - * @param scope The scope of the role definition. - * @param roleDefinitionId The ID of the role definition. - * @param roleDefinition The values for the role definition. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String scope, String roleDefinitionId, RoleDefinitionInner roleDefinition, Context context); - - /** - * Get all role definitions that are applicable at scope and above. - * - * @param scope The scope of the role definition. - * @param filter The filter to apply on the operation. Use atScopeAndBelow filter to search below the given scope as - * well. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all role definitions that are applicable at scope and above. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String scope, String filter); - - /** - * Get all role definitions that are applicable at scope and above. - * - * @param scope The scope of the role definition. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all role definitions that are applicable at scope and above. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String scope); - - /** - * Get all role definitions that are applicable at scope and above. - * - * @param scope The scope of the role definition. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all role definitions that are applicable at scope and above. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String scope); - - /** - * Get all role definitions that are applicable at scope and above. - * - * @param scope The scope of the role definition. - * @param filter The filter to apply on the operation. Use atScopeAndBelow filter to search below the given scope as - * well. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all role definitions that are applicable at scope and above. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String scope, String filter, Context context); - - /** - * Gets a role definition by ID. - * - * @param roleDefinitionId The fully qualified role definition ID. Use the format, - * /subscriptions/{guid}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} for subscription - * level role definitions, or /providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} for tenant - * level role definitions. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a role definition by ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByIdWithResponseAsync(String roleDefinitionId); - - /** - * Gets a role definition by ID. - * - * @param roleDefinitionId The fully qualified role definition ID. Use the format, - * /subscriptions/{guid}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} for subscription - * level role definitions, or /providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} for tenant - * level role definitions. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a role definition by ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByIdAsync(String roleDefinitionId); - - /** - * Gets a role definition by ID. - * - * @param roleDefinitionId The fully qualified role definition ID. Use the format, - * /subscriptions/{guid}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} for subscription - * level role definitions, or /providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} for tenant - * level role definitions. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a role definition by ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RoleDefinitionInner getById(String roleDefinitionId); - - /** - * Gets a role definition by ID. - * - * @param roleDefinitionId The fully qualified role definition ID. Use the format, - * /subscriptions/{guid}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} for subscription - * level role definitions, or /providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} for tenant - * level role definitions. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a role definition by ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByIdWithResponse(String roleDefinitionId, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/ServicePrincipalsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/ServicePrincipalsClient.java deleted file mode 100644 index 5a82d2024d63..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/ServicePrincipalsClient.java +++ /dev/null @@ -1,781 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.authorization.fluent.models.AppRoleAssignmentInner; -import com.azure.resourcemanager.authorization.fluent.models.DirectoryObjectInner; -import com.azure.resourcemanager.authorization.fluent.models.KeyCredentialInner; -import com.azure.resourcemanager.authorization.fluent.models.PasswordCredentialInner; -import com.azure.resourcemanager.authorization.fluent.models.ServicePrincipalInner; -import com.azure.resourcemanager.authorization.models.AddOwnerParameters; -import com.azure.resourcemanager.authorization.models.KeyCredentialsUpdateParameters; -import com.azure.resourcemanager.authorization.models.PasswordCredentialsUpdateParameters; -import com.azure.resourcemanager.authorization.models.ServicePrincipalCreateParameters; -import com.azure.resourcemanager.authorization.models.ServicePrincipalUpdateParameters; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ServicePrincipalsClient. */ -public interface ServicePrincipalsClient extends InnerSupportsDelete { - /** - * Creates a service principal in the directory. - * - * @param tenantId The tenant ID. - * @param parameters Parameters to create a service principal. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return active Directory service principal information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createWithResponseAsync( - String tenantId, ServicePrincipalCreateParameters parameters); - - /** - * Creates a service principal in the directory. - * - * @param tenantId The tenant ID. - * @param parameters Parameters to create a service principal. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return active Directory service principal information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createAsync(String tenantId, ServicePrincipalCreateParameters parameters); - - /** - * Creates a service principal in the directory. - * - * @param tenantId The tenant ID. - * @param parameters Parameters to create a service principal. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return active Directory service principal information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ServicePrincipalInner create(String tenantId, ServicePrincipalCreateParameters parameters); - - /** - * Creates a service principal in the directory. - * - * @param tenantId The tenant ID. - * @param parameters Parameters to create a service principal. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return active Directory service principal information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createWithResponse( - String tenantId, ServicePrincipalCreateParameters parameters, Context context); - - /** - * Gets a list of service principals from the current tenant. - * - * @param tenantId The tenant ID. - * @param filter The filter to apply to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of service principals from the current tenant. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String tenantId, String filter); - - /** - * Gets a list of service principals from the current tenant. - * - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of service principals from the current tenant. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String tenantId); - - /** - * Gets a list of service principals from the current tenant. - * - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of service principals from the current tenant. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String tenantId); - - /** - * Gets a list of service principals from the current tenant. - * - * @param tenantId The tenant ID. - * @param filter The filter to apply to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of service principals from the current tenant. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String tenantId, String filter, Context context); - - /** - * Updates a service principal in the directory. - * - * @param objectId The object ID of the service principal to delete. - * @param tenantId The tenant ID. - * @param parameters Parameters to update a service principal. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateWithResponseAsync( - String objectId, String tenantId, ServicePrincipalUpdateParameters parameters); - - /** - * Updates a service principal in the directory. - * - * @param objectId The object ID of the service principal to delete. - * @param tenantId The tenant ID. - * @param parameters Parameters to update a service principal. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAsync(String objectId, String tenantId, ServicePrincipalUpdateParameters parameters); - - /** - * Updates a service principal in the directory. - * - * @param objectId The object ID of the service principal to delete. - * @param tenantId The tenant ID. - * @param parameters Parameters to update a service principal. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void update(String objectId, String tenantId, ServicePrincipalUpdateParameters parameters); - - /** - * Updates a service principal in the directory. - * - * @param objectId The object ID of the service principal to delete. - * @param tenantId The tenant ID. - * @param parameters Parameters to update a service principal. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String objectId, String tenantId, ServicePrincipalUpdateParameters parameters, Context context); - - /** - * Deletes a service principal from the directory. - * - * @param objectId The object ID of the service principal to delete. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteWithResponseAsync(String objectId, String tenantId); - - /** - * Deletes a service principal from the directory. - * - * @param objectId The object ID of the service principal to delete. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String objectId, String tenantId); - - /** - * Deletes a service principal from the directory. - * - * @param objectId The object ID of the service principal to delete. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String objectId, String tenantId); - - /** - * Deletes a service principal from the directory. - * - * @param objectId The object ID of the service principal to delete. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String objectId, String tenantId, Context context); - - /** - * Gets service principal information from the directory. Query by objectId or pass a filter to query by appId. - * - * @param objectId The object ID of the service principal to get. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service principal information from the directory. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync(String objectId, String tenantId); - - /** - * Gets service principal information from the directory. Query by objectId or pass a filter to query by appId. - * - * @param objectId The object ID of the service principal to get. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service principal information from the directory. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync(String objectId, String tenantId); - - /** - * Gets service principal information from the directory. Query by objectId or pass a filter to query by appId. - * - * @param objectId The object ID of the service principal to get. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service principal information from the directory. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ServicePrincipalInner get(String objectId, String tenantId); - - /** - * Gets service principal information from the directory. Query by objectId or pass a filter to query by appId. - * - * @param objectId The object ID of the service principal to get. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service principal information from the directory. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String objectId, String tenantId, Context context); - - /** - * Principals (users, groups, and service principals) that are assigned to this service principal. - * - * @param objectId The object ID of the service principal for which to get owners. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return appRoleAssignment list operation result. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAppRoleAssignedToAsync(String objectId, String tenantId); - - /** - * Principals (users, groups, and service principals) that are assigned to this service principal. - * - * @param objectId The object ID of the service principal for which to get owners. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return appRoleAssignment list operation result. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listAppRoleAssignedTo(String objectId, String tenantId); - - /** - * Principals (users, groups, and service principals) that are assigned to this service principal. - * - * @param objectId The object ID of the service principal for which to get owners. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return appRoleAssignment list operation result. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listAppRoleAssignedTo(String objectId, String tenantId, Context context); - - /** - * Applications that the service principal is assigned to. - * - * @param objectId The object ID of the service principal for which to get owners. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return appRoleAssignment list operation result. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAppRoleAssignmentsAsync(String objectId, String tenantId); - - /** - * Applications that the service principal is assigned to. - * - * @param objectId The object ID of the service principal for which to get owners. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return appRoleAssignment list operation result. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listAppRoleAssignments(String objectId, String tenantId); - - /** - * Applications that the service principal is assigned to. - * - * @param objectId The object ID of the service principal for which to get owners. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return appRoleAssignment list operation result. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listAppRoleAssignments(String objectId, String tenantId, Context context); - - /** - * The owners are a set of non-admin users who are allowed to modify this object. - * - * @param objectId The object ID of the service principal for which to get owners. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return directoryObject list operation result. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listOwnersAsync(String objectId, String tenantId); - - /** - * The owners are a set of non-admin users who are allowed to modify this object. - * - * @param objectId The object ID of the service principal for which to get owners. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return directoryObject list operation result. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listOwners(String objectId, String tenantId); - - /** - * The owners are a set of non-admin users who are allowed to modify this object. - * - * @param objectId The object ID of the service principal for which to get owners. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return directoryObject list operation result. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listOwners(String objectId, String tenantId, Context context); - - /** - * Add an owner to a service principal. - * - * @param objectId The object ID of the service principal to which to add the owner. - * @param tenantId The tenant ID. - * @param parameters The URL of the owner object, such as - * https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects/f260bbc4-c254-447b-94cf-293b5ec434dd. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> addOwnerWithResponseAsync(String objectId, String tenantId, AddOwnerParameters parameters); - - /** - * Add an owner to a service principal. - * - * @param objectId The object ID of the service principal to which to add the owner. - * @param tenantId The tenant ID. - * @param parameters The URL of the owner object, such as - * https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects/f260bbc4-c254-447b-94cf-293b5ec434dd. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono addOwnerAsync(String objectId, String tenantId, AddOwnerParameters parameters); - - /** - * Add an owner to a service principal. - * - * @param objectId The object ID of the service principal to which to add the owner. - * @param tenantId The tenant ID. - * @param parameters The URL of the owner object, such as - * https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects/f260bbc4-c254-447b-94cf-293b5ec434dd. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void addOwner(String objectId, String tenantId, AddOwnerParameters parameters); - - /** - * Add an owner to a service principal. - * - * @param objectId The object ID of the service principal to which to add the owner. - * @param tenantId The tenant ID. - * @param parameters The URL of the owner object, such as - * https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects/f260bbc4-c254-447b-94cf-293b5ec434dd. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response addOwnerWithResponse( - String objectId, String tenantId, AddOwnerParameters parameters, Context context); - - /** - * Remove a member from owners. - * - * @param objectId The object ID of the service principal from which to remove the owner. - * @param ownerObjectId Owner object id. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> removeOwnerWithResponseAsync(String objectId, String ownerObjectId, String tenantId); - - /** - * Remove a member from owners. - * - * @param objectId The object ID of the service principal from which to remove the owner. - * @param ownerObjectId Owner object id. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono removeOwnerAsync(String objectId, String ownerObjectId, String tenantId); - - /** - * Remove a member from owners. - * - * @param objectId The object ID of the service principal from which to remove the owner. - * @param ownerObjectId Owner object id. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void removeOwner(String objectId, String ownerObjectId, String tenantId); - - /** - * Remove a member from owners. - * - * @param objectId The object ID of the service principal from which to remove the owner. - * @param ownerObjectId Owner object id. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response removeOwnerWithResponse(String objectId, String ownerObjectId, String tenantId, Context context); - - /** - * Get the keyCredentials associated with the specified service principal. - * - * @param objectId The object ID of the service principal for which to get keyCredentials. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the keyCredentials associated with the specified service principal. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listKeyCredentialsAsync(String objectId, String tenantId); - - /** - * Get the keyCredentials associated with the specified service principal. - * - * @param objectId The object ID of the service principal for which to get keyCredentials. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the keyCredentials associated with the specified service principal. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listKeyCredentials(String objectId, String tenantId); - - /** - * Get the keyCredentials associated with the specified service principal. - * - * @param objectId The object ID of the service principal for which to get keyCredentials. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the keyCredentials associated with the specified service principal. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listKeyCredentials(String objectId, String tenantId, Context context); - - /** - * Update the keyCredentials associated with a service principal. - * - * @param objectId The object ID for which to get service principal information. - * @param tenantId The tenant ID. - * @param parameters Parameters to update the keyCredentials of an existing service principal. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateKeyCredentialsWithResponseAsync( - String objectId, String tenantId, KeyCredentialsUpdateParameters parameters); - - /** - * Update the keyCredentials associated with a service principal. - * - * @param objectId The object ID for which to get service principal information. - * @param tenantId The tenant ID. - * @param parameters Parameters to update the keyCredentials of an existing service principal. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateKeyCredentialsAsync(String objectId, String tenantId, KeyCredentialsUpdateParameters parameters); - - /** - * Update the keyCredentials associated with a service principal. - * - * @param objectId The object ID for which to get service principal information. - * @param tenantId The tenant ID. - * @param parameters Parameters to update the keyCredentials of an existing service principal. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void updateKeyCredentials(String objectId, String tenantId, KeyCredentialsUpdateParameters parameters); - - /** - * Update the keyCredentials associated with a service principal. - * - * @param objectId The object ID for which to get service principal information. - * @param tenantId The tenant ID. - * @param parameters Parameters to update the keyCredentials of an existing service principal. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateKeyCredentialsWithResponse( - String objectId, String tenantId, KeyCredentialsUpdateParameters parameters, Context context); - - /** - * Gets the passwordCredentials associated with a service principal. - * - * @param objectId The object ID of the service principal. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the passwordCredentials associated with a service principal. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listPasswordCredentialsAsync(String objectId, String tenantId); - - /** - * Gets the passwordCredentials associated with a service principal. - * - * @param objectId The object ID of the service principal. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the passwordCredentials associated with a service principal. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listPasswordCredentials(String objectId, String tenantId); - - /** - * Gets the passwordCredentials associated with a service principal. - * - * @param objectId The object ID of the service principal. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the passwordCredentials associated with a service principal. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listPasswordCredentials(String objectId, String tenantId, Context context); - - /** - * Updates the passwordCredentials associated with a service principal. - * - * @param objectId The object ID of the service principal. - * @param tenantId The tenant ID. - * @param parameters Parameters to update the passwordCredentials of an existing service principal. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updatePasswordCredentialsWithResponseAsync( - String objectId, String tenantId, PasswordCredentialsUpdateParameters parameters); - - /** - * Updates the passwordCredentials associated with a service principal. - * - * @param objectId The object ID of the service principal. - * @param tenantId The tenant ID. - * @param parameters Parameters to update the passwordCredentials of an existing service principal. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updatePasswordCredentialsAsync( - String objectId, String tenantId, PasswordCredentialsUpdateParameters parameters); - - /** - * Updates the passwordCredentials associated with a service principal. - * - * @param objectId The object ID of the service principal. - * @param tenantId The tenant ID. - * @param parameters Parameters to update the passwordCredentials of an existing service principal. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void updatePasswordCredentials(String objectId, String tenantId, PasswordCredentialsUpdateParameters parameters); - - /** - * Updates the passwordCredentials associated with a service principal. - * - * @param objectId The object ID of the service principal. - * @param tenantId The tenant ID. - * @param parameters Parameters to update the passwordCredentials of an existing service principal. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updatePasswordCredentialsWithResponse( - String objectId, String tenantId, PasswordCredentialsUpdateParameters parameters, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/SignedInUsersClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/SignedInUsersClient.java deleted file mode 100644 index 1e6d6f5dd112..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/SignedInUsersClient.java +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.authorization.fluent.models.DirectoryObjectInner; -import com.azure.resourcemanager.authorization.fluent.models.UserInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in SignedInUsersClient. */ -public interface SignedInUsersClient { - /** - * Gets the details for the currently logged-in user. - * - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details for the currently logged-in user. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync(String tenantId); - - /** - * Gets the details for the currently logged-in user. - * - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details for the currently logged-in user. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync(String tenantId); - - /** - * Gets the details for the currently logged-in user. - * - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details for the currently logged-in user. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - UserInner get(String tenantId); - - /** - * Gets the details for the currently logged-in user. - * - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details for the currently logged-in user. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String tenantId, Context context); - - /** - * Get the list of directory objects that are owned by the user. - * - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of directory objects that are owned by the user. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listOwnedObjectsAsync(String tenantId); - - /** - * Get the list of directory objects that are owned by the user. - * - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of directory objects that are owned by the user. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listOwnedObjects(String tenantId); - - /** - * Get the list of directory objects that are owned by the user. - * - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of directory objects that are owned by the user. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listOwnedObjects(String tenantId, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/UsersClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/UsersClient.java deleted file mode 100644 index b12dd51a412d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/UsersClient.java +++ /dev/null @@ -1,359 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.authorization.fluent.models.UserInner; -import com.azure.resourcemanager.authorization.models.UserCreateParameters; -import com.azure.resourcemanager.authorization.models.UserGetMemberGroupsParameters; -import com.azure.resourcemanager.authorization.models.UserUpdateParameters; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in UsersClient. */ -public interface UsersClient extends InnerSupportsDelete { - /** - * Create a new user. - * - * @param tenantId The tenant ID. - * @param parameters Parameters to create a user. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return active Directory user information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createWithResponseAsync(String tenantId, UserCreateParameters parameters); - - /** - * Create a new user. - * - * @param tenantId The tenant ID. - * @param parameters Parameters to create a user. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return active Directory user information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createAsync(String tenantId, UserCreateParameters parameters); - - /** - * Create a new user. - * - * @param tenantId The tenant ID. - * @param parameters Parameters to create a user. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return active Directory user information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - UserInner create(String tenantId, UserCreateParameters parameters); - - /** - * Create a new user. - * - * @param tenantId The tenant ID. - * @param parameters Parameters to create a user. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return active Directory user information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createWithResponse(String tenantId, UserCreateParameters parameters, Context context); - - /** - * Gets list of users for the current tenant. - * - * @param tenantId The tenant ID. - * @param filter The filter to apply to the operation. - * @param expand The expand value for the operation result. - * @param top (Optional) Set the maximum number of results per response. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of users for the current tenant. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String tenantId, String filter, String expand, Integer top); - - /** - * Gets list of users for the current tenant. - * - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of users for the current tenant. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String tenantId); - - /** - * Gets list of users for the current tenant. - * - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of users for the current tenant. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String tenantId); - - /** - * Gets list of users for the current tenant. - * - * @param tenantId The tenant ID. - * @param filter The filter to apply to the operation. - * @param expand The expand value for the operation result. - * @param top (Optional) Set the maximum number of results per response. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of users for the current tenant. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String tenantId, String filter, String expand, Integer top, Context context); - - /** - * Gets user information from the directory. - * - * @param upnOrObjectId The object ID or principal name of the user for which to get information. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user information from the directory. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync(String upnOrObjectId, String tenantId); - - /** - * Gets user information from the directory. - * - * @param upnOrObjectId The object ID or principal name of the user for which to get information. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user information from the directory. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync(String upnOrObjectId, String tenantId); - - /** - * Gets user information from the directory. - * - * @param upnOrObjectId The object ID or principal name of the user for which to get information. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user information from the directory. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - UserInner get(String upnOrObjectId, String tenantId); - - /** - * Gets user information from the directory. - * - * @param upnOrObjectId The object ID or principal name of the user for which to get information. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user information from the directory. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String upnOrObjectId, String tenantId, Context context); - - /** - * Updates a user. - * - * @param upnOrObjectId The object ID or principal name of the user to update. - * @param tenantId The tenant ID. - * @param parameters Parameters to update an existing user. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateWithResponseAsync( - String upnOrObjectId, String tenantId, UserUpdateParameters parameters); - - /** - * Updates a user. - * - * @param upnOrObjectId The object ID or principal name of the user to update. - * @param tenantId The tenant ID. - * @param parameters Parameters to update an existing user. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAsync(String upnOrObjectId, String tenantId, UserUpdateParameters parameters); - - /** - * Updates a user. - * - * @param upnOrObjectId The object ID or principal name of the user to update. - * @param tenantId The tenant ID. - * @param parameters Parameters to update an existing user. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void update(String upnOrObjectId, String tenantId, UserUpdateParameters parameters); - - /** - * Updates a user. - * - * @param upnOrObjectId The object ID or principal name of the user to update. - * @param tenantId The tenant ID. - * @param parameters Parameters to update an existing user. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String upnOrObjectId, String tenantId, UserUpdateParameters parameters, Context context); - - /** - * Delete a user. - * - * @param upnOrObjectId The object ID or principal name of the user to delete. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteWithResponseAsync(String upnOrObjectId, String tenantId); - - /** - * Delete a user. - * - * @param upnOrObjectId The object ID or principal name of the user to delete. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String upnOrObjectId, String tenantId); - - /** - * Delete a user. - * - * @param upnOrObjectId The object ID or principal name of the user to delete. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String upnOrObjectId, String tenantId); - - /** - * Delete a user. - * - * @param upnOrObjectId The object ID or principal name of the user to delete. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String upnOrObjectId, String tenantId, Context context); - - /** - * Gets a collection that contains the object IDs of the groups of which the user is a member. - * - * @param objectId The object ID of the user for which to get group membership. - * @param tenantId The tenant ID. - * @param parameters User filtering parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a collection that contains the object IDs of the groups of which the user is a member. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux getMemberGroupsAsync(String objectId, String tenantId, UserGetMemberGroupsParameters parameters); - - /** - * Gets a collection that contains the object IDs of the groups of which the user is a member. - * - * @param objectId The object ID of the user for which to get group membership. - * @param tenantId The tenant ID. - * @param parameters User filtering parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a collection that contains the object IDs of the groups of which the user is a member. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable getMemberGroups(String objectId, String tenantId, UserGetMemberGroupsParameters parameters); - - /** - * Gets a collection that contains the object IDs of the groups of which the user is a member. - * - * @param objectId The object ID of the user for which to get group membership. - * @param tenantId The tenant ID. - * @param parameters User filtering parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.authorization.models.GraphErrorException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a collection that contains the object IDs of the groups of which the user is a member. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable getMemberGroups( - String objectId, String tenantId, UserGetMemberGroupsParameters parameters, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/ADGroupInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/ADGroupInner.java deleted file mode 100644 index f8b40be9327f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/ADGroupInner.java +++ /dev/null @@ -1,163 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** Active Directory group information. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") -@JsonTypeName("Group") -@Fluent -public final class ADGroupInner extends DirectoryObjectInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ADGroupInner.class); - - /* - * The display name of the group. - */ - @JsonProperty(value = "displayName") - private String displayName; - - /* - * Whether the group is mail-enabled. Must be false. This is because only - * pure security groups can be created using the Graph API. - */ - @JsonProperty(value = "mailEnabled") - private Boolean mailEnabled; - - /* - * The mail alias for the group. - */ - @JsonProperty(value = "mailNickname") - private String mailNickname; - - /* - * Whether the group is security-enable. - */ - @JsonProperty(value = "securityEnabled") - private Boolean securityEnabled; - - /* - * The primary email address of the group. - */ - @JsonProperty(value = "mail") - private String mail; - - /** - * Get the displayName property: The display name of the group. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Set the displayName property: The display name of the group. - * - * @param displayName the displayName value to set. - * @return the ADGroupInner object itself. - */ - public ADGroupInner withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - - /** - * Get the mailEnabled property: Whether the group is mail-enabled. Must be false. This is because only pure - * security groups can be created using the Graph API. - * - * @return the mailEnabled value. - */ - public Boolean mailEnabled() { - return this.mailEnabled; - } - - /** - * Set the mailEnabled property: Whether the group is mail-enabled. Must be false. This is because only pure - * security groups can be created using the Graph API. - * - * @param mailEnabled the mailEnabled value to set. - * @return the ADGroupInner object itself. - */ - public ADGroupInner withMailEnabled(Boolean mailEnabled) { - this.mailEnabled = mailEnabled; - return this; - } - - /** - * Get the mailNickname property: The mail alias for the group. - * - * @return the mailNickname value. - */ - public String mailNickname() { - return this.mailNickname; - } - - /** - * Set the mailNickname property: The mail alias for the group. - * - * @param mailNickname the mailNickname value to set. - * @return the ADGroupInner object itself. - */ - public ADGroupInner withMailNickname(String mailNickname) { - this.mailNickname = mailNickname; - return this; - } - - /** - * Get the securityEnabled property: Whether the group is security-enable. - * - * @return the securityEnabled value. - */ - public Boolean securityEnabled() { - return this.securityEnabled; - } - - /** - * Set the securityEnabled property: Whether the group is security-enable. - * - * @param securityEnabled the securityEnabled value to set. - * @return the ADGroupInner object itself. - */ - public ADGroupInner withSecurityEnabled(Boolean securityEnabled) { - this.securityEnabled = securityEnabled; - return this; - } - - /** - * Get the mail property: The primary email address of the group. - * - * @return the mail value. - */ - public String mail() { - return this.mail; - } - - /** - * Set the mail property: The primary email address of the group. - * - * @param mail the mail value to set. - * @return the ADGroupInner object itself. - */ - public ADGroupInner withMail(String mail) { - this.mail = mail; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/AppRoleAssignmentInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/AppRoleAssignmentInner.java deleted file mode 100644 index ca5a740b6607..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/AppRoleAssignmentInner.java +++ /dev/null @@ -1,195 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** AppRoleAssignment information. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") -@JsonTypeName("AppRoleAssignment") -@Fluent -public final class AppRoleAssignmentInner extends DirectoryObjectInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AppRoleAssignmentInner.class); - - /* - * The role id that was assigned to the principal. This role must be - * declared by the target resource application resourceId in its appRoles - * property. - */ - @JsonProperty(value = "id") - private String id; - - /* - * The display name of the principal that was granted the access. - */ - @JsonProperty(value = "principalDisplayName") - private String principalDisplayName; - - /* - * The unique identifier (objectId) for the principal being granted the - * access. - */ - @JsonProperty(value = "principalId") - private String principalId; - - /* - * The type of principal. This can either be "User", "Group" or - * "ServicePrincipal". - */ - @JsonProperty(value = "principalType") - private String principalType; - - /* - * The display name of the resource to which the assignment was made. - */ - @JsonProperty(value = "resourceDisplayName") - private String resourceDisplayName; - - /* - * The unique identifier (objectId) for the target resource (service - * principal) for which the assignment was made. - */ - @JsonProperty(value = "resourceId") - private String resourceId; - - /** - * Get the id property: The role id that was assigned to the principal. This role must be declared by the target - * resource application resourceId in its appRoles property. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: The role id that was assigned to the principal. This role must be declared by the target - * resource application resourceId in its appRoles property. - * - * @param id the id value to set. - * @return the AppRoleAssignmentInner object itself. - */ - public AppRoleAssignmentInner withId(String id) { - this.id = id; - return this; - } - - /** - * Get the principalDisplayName property: The display name of the principal that was granted the access. - * - * @return the principalDisplayName value. - */ - public String principalDisplayName() { - return this.principalDisplayName; - } - - /** - * Set the principalDisplayName property: The display name of the principal that was granted the access. - * - * @param principalDisplayName the principalDisplayName value to set. - * @return the AppRoleAssignmentInner object itself. - */ - public AppRoleAssignmentInner withPrincipalDisplayName(String principalDisplayName) { - this.principalDisplayName = principalDisplayName; - return this; - } - - /** - * Get the principalId property: The unique identifier (objectId) for the principal being granted the access. - * - * @return the principalId value. - */ - public String principalId() { - return this.principalId; - } - - /** - * Set the principalId property: The unique identifier (objectId) for the principal being granted the access. - * - * @param principalId the principalId value to set. - * @return the AppRoleAssignmentInner object itself. - */ - public AppRoleAssignmentInner withPrincipalId(String principalId) { - this.principalId = principalId; - return this; - } - - /** - * Get the principalType property: The type of principal. This can either be "User", "Group" or "ServicePrincipal". - * - * @return the principalType value. - */ - public String principalType() { - return this.principalType; - } - - /** - * Set the principalType property: The type of principal. This can either be "User", "Group" or "ServicePrincipal". - * - * @param principalType the principalType value to set. - * @return the AppRoleAssignmentInner object itself. - */ - public AppRoleAssignmentInner withPrincipalType(String principalType) { - this.principalType = principalType; - return this; - } - - /** - * Get the resourceDisplayName property: The display name of the resource to which the assignment was made. - * - * @return the resourceDisplayName value. - */ - public String resourceDisplayName() { - return this.resourceDisplayName; - } - - /** - * Set the resourceDisplayName property: The display name of the resource to which the assignment was made. - * - * @param resourceDisplayName the resourceDisplayName value to set. - * @return the AppRoleAssignmentInner object itself. - */ - public AppRoleAssignmentInner withResourceDisplayName(String resourceDisplayName) { - this.resourceDisplayName = resourceDisplayName; - return this; - } - - /** - * Get the resourceId property: The unique identifier (objectId) for the target resource (service principal) for - * which the assignment was made. - * - * @return the resourceId value. - */ - public String resourceId() { - return this.resourceId; - } - - /** - * Set the resourceId property: The unique identifier (objectId) for the target resource (service principal) for - * which the assignment was made. - * - * @param resourceId the resourceId value to set. - * @return the AppRoleAssignmentInner object itself. - */ - public AppRoleAssignmentInner withResourceId(String resourceId) { - this.resourceId = resourceId; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/ApplicationInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/ApplicationInner.java deleted file mode 100644 index c6f9e3841183..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/ApplicationInner.java +++ /dev/null @@ -1,948 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.authorization.models.AppRole; -import com.azure.resourcemanager.authorization.models.GroupMembershipClaimTypes; -import com.azure.resourcemanager.authorization.models.InformationalUrl; -import com.azure.resourcemanager.authorization.models.OAuth2Permission; -import com.azure.resourcemanager.authorization.models.OptionalClaims; -import com.azure.resourcemanager.authorization.models.PreAuthorizedApplication; -import com.azure.resourcemanager.authorization.models.RequiredResourceAccess; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.util.List; - -/** Active Directory application information. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") -@JsonTypeName("Application") -@Fluent -public final class ApplicationInner extends DirectoryObjectInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationInner.class); - - /* - * The application ID. - */ - @JsonProperty(value = "appId") - private String appId; - - /* - * A property on the application to indicate if the application accepts - * other IDPs or not or partially accepts. - */ - @JsonProperty(value = "allowGuestsSignIn") - private Boolean allowGuestsSignIn; - - /* - * Indicates that the application supports pass through users who have no - * presence in the resource tenant. - */ - @JsonProperty(value = "allowPassthroughUsers") - private Boolean allowPassthroughUsers; - - /* - * The url for the application logo image stored in a CDN. - */ - @JsonProperty(value = "appLogoUrl") - private String appLogoUrl; - - /* - * The collection of application roles that an application may declare. - * These roles can be assigned to users, groups or service principals. - */ - @JsonProperty(value = "appRoles") - private List appRoles; - - /* - * The application permissions. - */ - @JsonProperty(value = "appPermissions") - private List appPermissions; - - /* - * Whether the application is available to other tenants. - */ - @JsonProperty(value = "availableToOtherTenants") - private Boolean availableToOtherTenants; - - /* - * The display name of the application. - */ - @JsonProperty(value = "displayName") - private String displayName; - - /* - * A URL provided by the author of the application to report errors when - * using the application. - */ - @JsonProperty(value = "errorUrl") - private String errorUrl; - - /* - * Configures the groups claim issued in a user or OAuth 2.0 access token - * that the app expects. - */ - @JsonProperty(value = "groupMembershipClaims") - private GroupMembershipClaimTypes groupMembershipClaims; - - /* - * The home page of the application. - */ - @JsonProperty(value = "homepage") - private String homepage; - - /* - * A collection of URIs for the application. - */ - @JsonProperty(value = "identifierUris") - private List identifierUris; - - /* - * URLs with more information about the application. - */ - @JsonProperty(value = "informationalUrls") - private InformationalUrl informationalUrls; - - /* - * Specifies whether this application supports device authentication - * without a user. The default is false. - */ - @JsonProperty(value = "isDeviceOnlyAuthSupported") - private Boolean isDeviceOnlyAuthSupported; - - /* - * A collection of KeyCredential objects. - */ - @JsonProperty(value = "keyCredentials") - private List keyCredentials; - - /* - * Client applications that are tied to this resource application. Consent - * to any of the known client applications will result in implicit consent - * to the resource application through a combined consent dialog (showing - * the OAuth permission scopes required by the client and the resource). - */ - @JsonProperty(value = "knownClientApplications") - private List knownClientApplications; - - /* - * the url of the logout page - */ - @JsonProperty(value = "logoutUrl") - private String logoutUrl; - - /* - * Whether to allow implicit grant flow for OAuth2 - */ - @JsonProperty(value = "oauth2AllowImplicitFlow") - private Boolean oauth2AllowImplicitFlow; - - /* - * Specifies whether during a token Request Azure AD will allow path - * matching of the redirect URI against the applications collection of - * replyURLs. The default is false. - */ - @JsonProperty(value = "oauth2AllowUrlPathMatching") - private Boolean oauth2AllowUrlPathMatching; - - /* - * The collection of OAuth 2.0 permission scopes that the web API - * (resource) application exposes to client applications. These permission - * scopes may be granted to client applications during consent. - */ - @JsonProperty(value = "oauth2Permissions") - private List oauth2Permissions; - - /* - * Specifies whether, as part of OAuth 2.0 token requests, Azure AD will - * allow POST requests, as opposed to GET requests. The default is false, - * which specifies that only GET requests will be allowed. - */ - @JsonProperty(value = "oauth2RequirePostResponse") - private Boolean oauth2RequirePostResponse; - - /* - * A list of tenants allowed to access application. - */ - @JsonProperty(value = "orgRestrictions") - private List orgRestrictions; - - /* - * Specifying the claims to be included in the token. - */ - @JsonProperty(value = "optionalClaims") - private OptionalClaims optionalClaims; - - /* - * A collection of PasswordCredential objects - */ - @JsonProperty(value = "passwordCredentials") - private List passwordCredentials; - - /* - * list of pre-authorized applications. - */ - @JsonProperty(value = "preAuthorizedApplications") - private List preAuthorizedApplications; - - /* - * Specifies whether this application is a public client (such as an - * installed application running on a mobile device). Default is false. - */ - @JsonProperty(value = "publicClient") - private Boolean publicClient; - - /* - * Reliable domain which can be used to identify an application. - */ - @JsonProperty(value = "publisherDomain") - private String publisherDomain; - - /* - * A collection of reply URLs for the application. - */ - @JsonProperty(value = "replyUrls") - private List replyUrls; - - /* - * Specifies resources that this application requires access to and the set - * of OAuth permission scopes and application roles that it needs under - * each of those resources. This pre-configuration of required resource - * access drives the consent experience. - */ - @JsonProperty(value = "requiredResourceAccess") - private List requiredResourceAccess; - - /* - * The URL to the SAML metadata for the application. - */ - @JsonProperty(value = "samlMetadataUrl") - private String samlMetadataUrl; - - /* - * Audience for signing in to the application (AzureADMyOrganization, - * AzureADAllOrganizations, AzureADAndMicrosoftAccounts). - */ - @JsonProperty(value = "signInAudience") - private String signInAudience; - - /* - * The primary Web page. - */ - @JsonProperty(value = "wwwHomepage") - private String wwwHomepage; - - /** - * Get the appId property: The application ID. - * - * @return the appId value. - */ - public String appId() { - return this.appId; - } - - /** - * Set the appId property: The application ID. - * - * @param appId the appId value to set. - * @return the ApplicationInner object itself. - */ - public ApplicationInner withAppId(String appId) { - this.appId = appId; - return this; - } - - /** - * Get the allowGuestsSignIn property: A property on the application to indicate if the application accepts other - * IDPs or not or partially accepts. - * - * @return the allowGuestsSignIn value. - */ - public Boolean allowGuestsSignIn() { - return this.allowGuestsSignIn; - } - - /** - * Set the allowGuestsSignIn property: A property on the application to indicate if the application accepts other - * IDPs or not or partially accepts. - * - * @param allowGuestsSignIn the allowGuestsSignIn value to set. - * @return the ApplicationInner object itself. - */ - public ApplicationInner withAllowGuestsSignIn(Boolean allowGuestsSignIn) { - this.allowGuestsSignIn = allowGuestsSignIn; - return this; - } - - /** - * Get the allowPassthroughUsers property: Indicates that the application supports pass through users who have no - * presence in the resource tenant. - * - * @return the allowPassthroughUsers value. - */ - public Boolean allowPassthroughUsers() { - return this.allowPassthroughUsers; - } - - /** - * Set the allowPassthroughUsers property: Indicates that the application supports pass through users who have no - * presence in the resource tenant. - * - * @param allowPassthroughUsers the allowPassthroughUsers value to set. - * @return the ApplicationInner object itself. - */ - public ApplicationInner withAllowPassthroughUsers(Boolean allowPassthroughUsers) { - this.allowPassthroughUsers = allowPassthroughUsers; - return this; - } - - /** - * Get the appLogoUrl property: The url for the application logo image stored in a CDN. - * - * @return the appLogoUrl value. - */ - public String appLogoUrl() { - return this.appLogoUrl; - } - - /** - * Set the appLogoUrl property: The url for the application logo image stored in a CDN. - * - * @param appLogoUrl the appLogoUrl value to set. - * @return the ApplicationInner object itself. - */ - public ApplicationInner withAppLogoUrl(String appLogoUrl) { - this.appLogoUrl = appLogoUrl; - return this; - } - - /** - * Get the appRoles property: The collection of application roles that an application may declare. These roles can - * be assigned to users, groups or service principals. - * - * @return the appRoles value. - */ - public List appRoles() { - return this.appRoles; - } - - /** - * Set the appRoles property: The collection of application roles that an application may declare. These roles can - * be assigned to users, groups or service principals. - * - * @param appRoles the appRoles value to set. - * @return the ApplicationInner object itself. - */ - public ApplicationInner withAppRoles(List appRoles) { - this.appRoles = appRoles; - return this; - } - - /** - * Get the appPermissions property: The application permissions. - * - * @return the appPermissions value. - */ - public List appPermissions() { - return this.appPermissions; - } - - /** - * Set the appPermissions property: The application permissions. - * - * @param appPermissions the appPermissions value to set. - * @return the ApplicationInner object itself. - */ - public ApplicationInner withAppPermissions(List appPermissions) { - this.appPermissions = appPermissions; - return this; - } - - /** - * Get the availableToOtherTenants property: Whether the application is available to other tenants. - * - * @return the availableToOtherTenants value. - */ - public Boolean availableToOtherTenants() { - return this.availableToOtherTenants; - } - - /** - * Set the availableToOtherTenants property: Whether the application is available to other tenants. - * - * @param availableToOtherTenants the availableToOtherTenants value to set. - * @return the ApplicationInner object itself. - */ - public ApplicationInner withAvailableToOtherTenants(Boolean availableToOtherTenants) { - this.availableToOtherTenants = availableToOtherTenants; - return this; - } - - /** - * Get the displayName property: The display name of the application. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Set the displayName property: The display name of the application. - * - * @param displayName the displayName value to set. - * @return the ApplicationInner object itself. - */ - public ApplicationInner withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - - /** - * Get the errorUrl property: A URL provided by the author of the application to report errors when using the - * application. - * - * @return the errorUrl value. - */ - public String errorUrl() { - return this.errorUrl; - } - - /** - * Set the errorUrl property: A URL provided by the author of the application to report errors when using the - * application. - * - * @param errorUrl the errorUrl value to set. - * @return the ApplicationInner object itself. - */ - public ApplicationInner withErrorUrl(String errorUrl) { - this.errorUrl = errorUrl; - return this; - } - - /** - * Get the groupMembershipClaims property: Configures the groups claim issued in a user or OAuth 2.0 access token - * that the app expects. - * - * @return the groupMembershipClaims value. - */ - public GroupMembershipClaimTypes groupMembershipClaims() { - return this.groupMembershipClaims; - } - - /** - * Set the groupMembershipClaims property: Configures the groups claim issued in a user or OAuth 2.0 access token - * that the app expects. - * - * @param groupMembershipClaims the groupMembershipClaims value to set. - * @return the ApplicationInner object itself. - */ - public ApplicationInner withGroupMembershipClaims(GroupMembershipClaimTypes groupMembershipClaims) { - this.groupMembershipClaims = groupMembershipClaims; - return this; - } - - /** - * Get the homepage property: The home page of the application. - * - * @return the homepage value. - */ - public String homepage() { - return this.homepage; - } - - /** - * Set the homepage property: The home page of the application. - * - * @param homepage the homepage value to set. - * @return the ApplicationInner object itself. - */ - public ApplicationInner withHomepage(String homepage) { - this.homepage = homepage; - return this; - } - - /** - * Get the identifierUris property: A collection of URIs for the application. - * - * @return the identifierUris value. - */ - public List identifierUris() { - return this.identifierUris; - } - - /** - * Set the identifierUris property: A collection of URIs for the application. - * - * @param identifierUris the identifierUris value to set. - * @return the ApplicationInner object itself. - */ - public ApplicationInner withIdentifierUris(List identifierUris) { - this.identifierUris = identifierUris; - return this; - } - - /** - * Get the informationalUrls property: URLs with more information about the application. - * - * @return the informationalUrls value. - */ - public InformationalUrl informationalUrls() { - return this.informationalUrls; - } - - /** - * Set the informationalUrls property: URLs with more information about the application. - * - * @param informationalUrls the informationalUrls value to set. - * @return the ApplicationInner object itself. - */ - public ApplicationInner withInformationalUrls(InformationalUrl informationalUrls) { - this.informationalUrls = informationalUrls; - return this; - } - - /** - * Get the isDeviceOnlyAuthSupported property: Specifies whether this application supports device authentication - * without a user. The default is false. - * - * @return the isDeviceOnlyAuthSupported value. - */ - public Boolean isDeviceOnlyAuthSupported() { - return this.isDeviceOnlyAuthSupported; - } - - /** - * Set the isDeviceOnlyAuthSupported property: Specifies whether this application supports device authentication - * without a user. The default is false. - * - * @param isDeviceOnlyAuthSupported the isDeviceOnlyAuthSupported value to set. - * @return the ApplicationInner object itself. - */ - public ApplicationInner withIsDeviceOnlyAuthSupported(Boolean isDeviceOnlyAuthSupported) { - this.isDeviceOnlyAuthSupported = isDeviceOnlyAuthSupported; - return this; - } - - /** - * Get the keyCredentials property: A collection of KeyCredential objects. - * - * @return the keyCredentials value. - */ - public List keyCredentials() { - return this.keyCredentials; - } - - /** - * Set the keyCredentials property: A collection of KeyCredential objects. - * - * @param keyCredentials the keyCredentials value to set. - * @return the ApplicationInner object itself. - */ - public ApplicationInner withKeyCredentials(List keyCredentials) { - this.keyCredentials = keyCredentials; - return this; - } - - /** - * Get the knownClientApplications property: Client applications that are tied to this resource application. Consent - * to any of the known client applications will result in implicit consent to the resource application through a - * combined consent dialog (showing the OAuth permission scopes required by the client and the resource). - * - * @return the knownClientApplications value. - */ - public List knownClientApplications() { - return this.knownClientApplications; - } - - /** - * Set the knownClientApplications property: Client applications that are tied to this resource application. Consent - * to any of the known client applications will result in implicit consent to the resource application through a - * combined consent dialog (showing the OAuth permission scopes required by the client and the resource). - * - * @param knownClientApplications the knownClientApplications value to set. - * @return the ApplicationInner object itself. - */ - public ApplicationInner withKnownClientApplications(List knownClientApplications) { - this.knownClientApplications = knownClientApplications; - return this; - } - - /** - * Get the logoutUrl property: the url of the logout page. - * - * @return the logoutUrl value. - */ - public String logoutUrl() { - return this.logoutUrl; - } - - /** - * Set the logoutUrl property: the url of the logout page. - * - * @param logoutUrl the logoutUrl value to set. - * @return the ApplicationInner object itself. - */ - public ApplicationInner withLogoutUrl(String logoutUrl) { - this.logoutUrl = logoutUrl; - return this; - } - - /** - * Get the oauth2AllowImplicitFlow property: Whether to allow implicit grant flow for OAuth2. - * - * @return the oauth2AllowImplicitFlow value. - */ - public Boolean oauth2AllowImplicitFlow() { - return this.oauth2AllowImplicitFlow; - } - - /** - * Set the oauth2AllowImplicitFlow property: Whether to allow implicit grant flow for OAuth2. - * - * @param oauth2AllowImplicitFlow the oauth2AllowImplicitFlow value to set. - * @return the ApplicationInner object itself. - */ - public ApplicationInner withOauth2AllowImplicitFlow(Boolean oauth2AllowImplicitFlow) { - this.oauth2AllowImplicitFlow = oauth2AllowImplicitFlow; - return this; - } - - /** - * Get the oauth2AllowUrlPathMatching property: Specifies whether during a token Request Azure AD will allow path - * matching of the redirect URI against the applications collection of replyURLs. The default is false. - * - * @return the oauth2AllowUrlPathMatching value. - */ - public Boolean oauth2AllowUrlPathMatching() { - return this.oauth2AllowUrlPathMatching; - } - - /** - * Set the oauth2AllowUrlPathMatching property: Specifies whether during a token Request Azure AD will allow path - * matching of the redirect URI against the applications collection of replyURLs. The default is false. - * - * @param oauth2AllowUrlPathMatching the oauth2AllowUrlPathMatching value to set. - * @return the ApplicationInner object itself. - */ - public ApplicationInner withOauth2AllowUrlPathMatching(Boolean oauth2AllowUrlPathMatching) { - this.oauth2AllowUrlPathMatching = oauth2AllowUrlPathMatching; - return this; - } - - /** - * Get the oauth2Permissions property: The collection of OAuth 2.0 permission scopes that the web API (resource) - * application exposes to client applications. These permission scopes may be granted to client applications during - * consent. - * - * @return the oauth2Permissions value. - */ - public List oauth2Permissions() { - return this.oauth2Permissions; - } - - /** - * Set the oauth2Permissions property: The collection of OAuth 2.0 permission scopes that the web API (resource) - * application exposes to client applications. These permission scopes may be granted to client applications during - * consent. - * - * @param oauth2Permissions the oauth2Permissions value to set. - * @return the ApplicationInner object itself. - */ - public ApplicationInner withOauth2Permissions(List oauth2Permissions) { - this.oauth2Permissions = oauth2Permissions; - return this; - } - - /** - * Get the oauth2RequirePostResponse property: Specifies whether, as part of OAuth 2.0 token requests, Azure AD will - * allow POST requests, as opposed to GET requests. The default is false, which specifies that only GET requests - * will be allowed. - * - * @return the oauth2RequirePostResponse value. - */ - public Boolean oauth2RequirePostResponse() { - return this.oauth2RequirePostResponse; - } - - /** - * Set the oauth2RequirePostResponse property: Specifies whether, as part of OAuth 2.0 token requests, Azure AD will - * allow POST requests, as opposed to GET requests. The default is false, which specifies that only GET requests - * will be allowed. - * - * @param oauth2RequirePostResponse the oauth2RequirePostResponse value to set. - * @return the ApplicationInner object itself. - */ - public ApplicationInner withOauth2RequirePostResponse(Boolean oauth2RequirePostResponse) { - this.oauth2RequirePostResponse = oauth2RequirePostResponse; - return this; - } - - /** - * Get the orgRestrictions property: A list of tenants allowed to access application. - * - * @return the orgRestrictions value. - */ - public List orgRestrictions() { - return this.orgRestrictions; - } - - /** - * Set the orgRestrictions property: A list of tenants allowed to access application. - * - * @param orgRestrictions the orgRestrictions value to set. - * @return the ApplicationInner object itself. - */ - public ApplicationInner withOrgRestrictions(List orgRestrictions) { - this.orgRestrictions = orgRestrictions; - return this; - } - - /** - * Get the optionalClaims property: Specifying the claims to be included in the token. - * - * @return the optionalClaims value. - */ - public OptionalClaims optionalClaims() { - return this.optionalClaims; - } - - /** - * Set the optionalClaims property: Specifying the claims to be included in the token. - * - * @param optionalClaims the optionalClaims value to set. - * @return the ApplicationInner object itself. - */ - public ApplicationInner withOptionalClaims(OptionalClaims optionalClaims) { - this.optionalClaims = optionalClaims; - return this; - } - - /** - * Get the passwordCredentials property: A collection of PasswordCredential objects. - * - * @return the passwordCredentials value. - */ - public List passwordCredentials() { - return this.passwordCredentials; - } - - /** - * Set the passwordCredentials property: A collection of PasswordCredential objects. - * - * @param passwordCredentials the passwordCredentials value to set. - * @return the ApplicationInner object itself. - */ - public ApplicationInner withPasswordCredentials(List passwordCredentials) { - this.passwordCredentials = passwordCredentials; - return this; - } - - /** - * Get the preAuthorizedApplications property: list of pre-authorized applications. - * - * @return the preAuthorizedApplications value. - */ - public List preAuthorizedApplications() { - return this.preAuthorizedApplications; - } - - /** - * Set the preAuthorizedApplications property: list of pre-authorized applications. - * - * @param preAuthorizedApplications the preAuthorizedApplications value to set. - * @return the ApplicationInner object itself. - */ - public ApplicationInner withPreAuthorizedApplications(List preAuthorizedApplications) { - this.preAuthorizedApplications = preAuthorizedApplications; - return this; - } - - /** - * Get the publicClient property: Specifies whether this application is a public client (such as an installed - * application running on a mobile device). Default is false. - * - * @return the publicClient value. - */ - public Boolean publicClient() { - return this.publicClient; - } - - /** - * Set the publicClient property: Specifies whether this application is a public client (such as an installed - * application running on a mobile device). Default is false. - * - * @param publicClient the publicClient value to set. - * @return the ApplicationInner object itself. - */ - public ApplicationInner withPublicClient(Boolean publicClient) { - this.publicClient = publicClient; - return this; - } - - /** - * Get the publisherDomain property: Reliable domain which can be used to identify an application. - * - * @return the publisherDomain value. - */ - public String publisherDomain() { - return this.publisherDomain; - } - - /** - * Set the publisherDomain property: Reliable domain which can be used to identify an application. - * - * @param publisherDomain the publisherDomain value to set. - * @return the ApplicationInner object itself. - */ - public ApplicationInner withPublisherDomain(String publisherDomain) { - this.publisherDomain = publisherDomain; - return this; - } - - /** - * Get the replyUrls property: A collection of reply URLs for the application. - * - * @return the replyUrls value. - */ - public List replyUrls() { - return this.replyUrls; - } - - /** - * Set the replyUrls property: A collection of reply URLs for the application. - * - * @param replyUrls the replyUrls value to set. - * @return the ApplicationInner object itself. - */ - public ApplicationInner withReplyUrls(List replyUrls) { - this.replyUrls = replyUrls; - return this; - } - - /** - * Get the requiredResourceAccess property: Specifies resources that this application requires access to and the set - * of OAuth permission scopes and application roles that it needs under each of those resources. This - * pre-configuration of required resource access drives the consent experience. - * - * @return the requiredResourceAccess value. - */ - public List requiredResourceAccess() { - return this.requiredResourceAccess; - } - - /** - * Set the requiredResourceAccess property: Specifies resources that this application requires access to and the set - * of OAuth permission scopes and application roles that it needs under each of those resources. This - * pre-configuration of required resource access drives the consent experience. - * - * @param requiredResourceAccess the requiredResourceAccess value to set. - * @return the ApplicationInner object itself. - */ - public ApplicationInner withRequiredResourceAccess(List requiredResourceAccess) { - this.requiredResourceAccess = requiredResourceAccess; - return this; - } - - /** - * Get the samlMetadataUrl property: The URL to the SAML metadata for the application. - * - * @return the samlMetadataUrl value. - */ - public String samlMetadataUrl() { - return this.samlMetadataUrl; - } - - /** - * Set the samlMetadataUrl property: The URL to the SAML metadata for the application. - * - * @param samlMetadataUrl the samlMetadataUrl value to set. - * @return the ApplicationInner object itself. - */ - public ApplicationInner withSamlMetadataUrl(String samlMetadataUrl) { - this.samlMetadataUrl = samlMetadataUrl; - return this; - } - - /** - * Get the signInAudience property: Audience for signing in to the application (AzureADMyOrganization, - * AzureADAllOrganizations, AzureADAndMicrosoftAccounts). - * - * @return the signInAudience value. - */ - public String signInAudience() { - return this.signInAudience; - } - - /** - * Set the signInAudience property: Audience for signing in to the application (AzureADMyOrganization, - * AzureADAllOrganizations, AzureADAndMicrosoftAccounts). - * - * @param signInAudience the signInAudience value to set. - * @return the ApplicationInner object itself. - */ - public ApplicationInner withSignInAudience(String signInAudience) { - this.signInAudience = signInAudience; - return this; - } - - /** - * Get the wwwHomepage property: The primary Web page. - * - * @return the wwwHomepage value. - */ - public String wwwHomepage() { - return this.wwwHomepage; - } - - /** - * Set the wwwHomepage property: The primary Web page. - * - * @param wwwHomepage the wwwHomepage value to set. - * @return the ApplicationInner object itself. - */ - public ApplicationInner withWwwHomepage(String wwwHomepage) { - this.wwwHomepage = wwwHomepage; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (appRoles() != null) { - appRoles().forEach(e -> e.validate()); - } - if (informationalUrls() != null) { - informationalUrls().validate(); - } - if (keyCredentials() != null) { - keyCredentials().forEach(e -> e.validate()); - } - if (oauth2Permissions() != null) { - oauth2Permissions().forEach(e -> e.validate()); - } - if (optionalClaims() != null) { - optionalClaims().validate(); - } - if (passwordCredentials() != null) { - passwordCredentials().forEach(e -> e.validate()); - } - if (preAuthorizedApplications() != null) { - preAuthorizedApplications().forEach(e -> e.validate()); - } - if (requiredResourceAccess() != null) { - requiredResourceAccess().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/CheckGroupMembershipResultInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/CheckGroupMembershipResultInner.java deleted file mode 100644 index 76a32d43ff7c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/CheckGroupMembershipResultInner.java +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; -import java.util.Map; - -/** Server response for IsMemberOf API call. */ -@Fluent -public final class CheckGroupMembershipResultInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CheckGroupMembershipResultInner.class); - - /* - * True if the specified user, group, contact, or service principal has - * either direct or transitive membership in the specified group; - * otherwise, false. - */ - @JsonProperty(value = "value") - private Boolean value; - - /* - * Server response for IsMemberOf API call - */ - @JsonIgnore private Map additionalProperties; - - /** - * Get the value property: True if the specified user, group, contact, or service principal has either direct or - * transitive membership in the specified group; otherwise, false. - * - * @return the value value. - */ - public Boolean value() { - return this.value; - } - - /** - * Set the value property: True if the specified user, group, contact, or service principal has either direct or - * transitive membership in the specified group; otherwise, false. - * - * @param value the value value to set. - * @return the CheckGroupMembershipResultInner object itself. - */ - public CheckGroupMembershipResultInner withValue(Boolean value) { - this.value = value; - return this; - } - - /** - * Get the additionalProperties property: Server response for IsMemberOf API call. - * - * @return the additionalProperties value. - */ - @JsonAnyGetter - public Map additionalProperties() { - return this.additionalProperties; - } - - /** - * Set the additionalProperties property: Server response for IsMemberOf API call. - * - * @param additionalProperties the additionalProperties value to set. - * @return the CheckGroupMembershipResultInner object itself. - */ - public CheckGroupMembershipResultInner withAdditionalProperties(Map additionalProperties) { - this.additionalProperties = additionalProperties; - return this; - } - - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/ClassicAdministratorInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/ClassicAdministratorInner.java deleted file mode 100644 index 69a8b53fb6a0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/ClassicAdministratorInner.java +++ /dev/null @@ -1,166 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Classic Administrators. */ -@Fluent -public final class ClassicAdministratorInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ClassicAdministratorInner.class); - - /* - * The ID of the administrator. - */ - @JsonProperty(value = "id") - private String id; - - /* - * The name of the administrator. - */ - @JsonProperty(value = "name") - private String name; - - /* - * The type of the administrator. - */ - @JsonProperty(value = "type") - private String type; - - /* - * Properties for the classic administrator. - */ - @JsonProperty(value = "properties") - private ClassicAdministratorProperties innerProperties; - - /** - * Get the id property: The ID of the administrator. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: The ID of the administrator. - * - * @param id the id value to set. - * @return the ClassicAdministratorInner object itself. - */ - public ClassicAdministratorInner withId(String id) { - this.id = id; - return this; - } - - /** - * Get the name property: The name of the administrator. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the administrator. - * - * @param name the name value to set. - * @return the ClassicAdministratorInner object itself. - */ - public ClassicAdministratorInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the type property: The type of the administrator. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Set the type property: The type of the administrator. - * - * @param type the type value to set. - * @return the ClassicAdministratorInner object itself. - */ - public ClassicAdministratorInner withType(String type) { - this.type = type; - return this; - } - - /** - * Get the innerProperties property: Properties for the classic administrator. - * - * @return the innerProperties value. - */ - private ClassicAdministratorProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the emailAddress property: The email address of the administrator. - * - * @return the emailAddress value. - */ - public String emailAddress() { - return this.innerProperties() == null ? null : this.innerProperties().emailAddress(); - } - - /** - * Set the emailAddress property: The email address of the administrator. - * - * @param emailAddress the emailAddress value to set. - * @return the ClassicAdministratorInner object itself. - */ - public ClassicAdministratorInner withEmailAddress(String emailAddress) { - if (this.innerProperties() == null) { - this.innerProperties = new ClassicAdministratorProperties(); - } - this.innerProperties().withEmailAddress(emailAddress); - return this; - } - - /** - * Get the role property: The role of the administrator. - * - * @return the role value. - */ - public String role() { - return this.innerProperties() == null ? null : this.innerProperties().role(); - } - - /** - * Set the role property: The role of the administrator. - * - * @param role the role value to set. - * @return the ClassicAdministratorInner object itself. - */ - public ClassicAdministratorInner withRole(String role) { - if (this.innerProperties() == null) { - this.innerProperties = new ClassicAdministratorProperties(); - } - this.innerProperties().withRole(role); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/ClassicAdministratorProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/ClassicAdministratorProperties.java deleted file mode 100644 index 7eccffa4a5b0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/ClassicAdministratorProperties.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Classic Administrator properties. */ -@Fluent -public final class ClassicAdministratorProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ClassicAdministratorProperties.class); - - /* - * The email address of the administrator. - */ - @JsonProperty(value = "emailAddress") - private String emailAddress; - - /* - * The role of the administrator. - */ - @JsonProperty(value = "role") - private String role; - - /** - * Get the emailAddress property: The email address of the administrator. - * - * @return the emailAddress value. - */ - public String emailAddress() { - return this.emailAddress; - } - - /** - * Set the emailAddress property: The email address of the administrator. - * - * @param emailAddress the emailAddress value to set. - * @return the ClassicAdministratorProperties object itself. - */ - public ClassicAdministratorProperties withEmailAddress(String emailAddress) { - this.emailAddress = emailAddress; - return this; - } - - /** - * Get the role property: The role of the administrator. - * - * @return the role value. - */ - public String role() { - return this.role; - } - - /** - * Set the role property: The role of the administrator. - * - * @param role the role value to set. - * @return the ClassicAdministratorProperties object itself. - */ - public ClassicAdministratorProperties withRole(String role) { - this.role = role; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/DirectoryObjectInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/DirectoryObjectInner.java deleted file mode 100644 index 4f656a8f6da1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/DirectoryObjectInner.java +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; - -/** Represents an Azure Active Directory object. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "objectType", - defaultImpl = DirectoryObjectInner.class) -@JsonTypeName("DirectoryObject") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "User", value = UserInner.class), - @JsonSubTypes.Type(name = "Application", value = ApplicationInner.class), - @JsonSubTypes.Type(name = "Group", value = ADGroupInner.class), - @JsonSubTypes.Type(name = "ServicePrincipal", value = ServicePrincipalInner.class), - @JsonSubTypes.Type(name = "AppRoleAssignment", value = AppRoleAssignmentInner.class) -}) -@Fluent -public class DirectoryObjectInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DirectoryObjectInner.class); - - /* - * The object ID. - */ - @JsonProperty(value = "objectId", access = JsonProperty.Access.WRITE_ONLY) - private String objectId; - - /* - * The time at which the directory object was deleted. - */ - @JsonProperty(value = "deletionTimestamp", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime deletionTimestamp; - - /* - * Represents an Azure Active Directory object. - */ - @JsonIgnore private Map additionalProperties; - - /** - * Get the objectId property: The object ID. - * - * @return the objectId value. - */ - public String objectId() { - return this.objectId; - } - - /** - * Get the deletionTimestamp property: The time at which the directory object was deleted. - * - * @return the deletionTimestamp value. - */ - public OffsetDateTime deletionTimestamp() { - return this.deletionTimestamp; - } - - /** - * Get the additionalProperties property: Represents an Azure Active Directory object. - * - * @return the additionalProperties value. - */ - @JsonAnyGetter - public Map additionalProperties() { - return this.additionalProperties; - } - - /** - * Set the additionalProperties property: Represents an Azure Active Directory object. - * - * @param additionalProperties the additionalProperties value to set. - * @return the DirectoryObjectInner object itself. - */ - public DirectoryObjectInner withAdditionalProperties(Map additionalProperties) { - this.additionalProperties = additionalProperties; - return this; - } - - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/DomainInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/DomainInner.java deleted file mode 100644 index 90c6e2f5c15d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/DomainInner.java +++ /dev/null @@ -1,138 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; -import java.util.Map; - -/** Active Directory Domain information. */ -@Fluent -public final class DomainInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DomainInner.class); - - /* - * the type of the authentication into the domain. - */ - @JsonProperty(value = "authenticationType", access = JsonProperty.Access.WRITE_ONLY) - private String authenticationType; - - /* - * if this is the default domain in the tenant. - */ - @JsonProperty(value = "isDefault", access = JsonProperty.Access.WRITE_ONLY) - private Boolean isDefault; - - /* - * if this domain's ownership is verified. - */ - @JsonProperty(value = "isVerified", access = JsonProperty.Access.WRITE_ONLY) - private Boolean isVerified; - - /* - * the domain name. - */ - @JsonProperty(value = "name", required = true) - private String name; - - /* - * Active Directory Domain information. - */ - @JsonIgnore private Map additionalProperties; - - /** - * Get the authenticationType property: the type of the authentication into the domain. - * - * @return the authenticationType value. - */ - public String authenticationType() { - return this.authenticationType; - } - - /** - * Get the isDefault property: if this is the default domain in the tenant. - * - * @return the isDefault value. - */ - public Boolean isDefault() { - return this.isDefault; - } - - /** - * Get the isVerified property: if this domain's ownership is verified. - * - * @return the isVerified value. - */ - public Boolean isVerified() { - return this.isVerified; - } - - /** - * Get the name property: the domain name. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: the domain name. - * - * @param name the name value to set. - * @return the DomainInner object itself. - */ - public DomainInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the additionalProperties property: Active Directory Domain information. - * - * @return the additionalProperties value. - */ - @JsonAnyGetter - public Map additionalProperties() { - return this.additionalProperties; - } - - /** - * Set the additionalProperties property: Active Directory Domain information. - * - * @param additionalProperties the additionalProperties value to set. - * @return the DomainInner object itself. - */ - public DomainInner withAdditionalProperties(Map additionalProperties) { - this.additionalProperties = additionalProperties; - return this; - } - - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property name in model DomainInner")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/ErrorMessage.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/ErrorMessage.java deleted file mode 100644 index 3f9d08a68fb0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/ErrorMessage.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Active Directory error message. */ -@Fluent -public final class ErrorMessage { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ErrorMessage.class); - - /* - * Error message value. - */ - @JsonProperty(value = "value") - private String message; - - /** - * Get the message property: Error message value. - * - * @return the message value. - */ - public String message() { - return this.message; - } - - /** - * Set the message property: Error message value. - * - * @param message the message value to set. - * @return the ErrorMessage object itself. - */ - public ErrorMessage withMessage(String message) { - this.message = message; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/KeyCredentialInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/KeyCredentialInner.java deleted file mode 100644 index 7c365652d1ae..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/KeyCredentialInner.java +++ /dev/null @@ -1,245 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; - -/** Active Directory Key Credential information. */ -@Fluent -public final class KeyCredentialInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(KeyCredentialInner.class); - - /* - * Start date. - */ - @JsonProperty(value = "startDate") - private OffsetDateTime startDate; - - /* - * End date. - */ - @JsonProperty(value = "endDate") - private OffsetDateTime endDate; - - /* - * Key value. - */ - @JsonProperty(value = "value") - private String value; - - /* - * Key ID. - */ - @JsonProperty(value = "keyId") - private String keyId; - - /* - * Usage. Acceptable values are 'Verify' and 'Sign'. - */ - @JsonProperty(value = "usage") - private String usage; - - /* - * Type. Acceptable values are 'AsymmetricX509Cert' and 'Symmetric'. - */ - @JsonProperty(value = "type") - private String type; - - /* - * Custom Key Identifier - */ - @JsonProperty(value = "customKeyIdentifier") - private String customKeyIdentifier; - - /* - * Active Directory Key Credential information. - */ - @JsonIgnore private Map additionalProperties; - - /** - * Get the startDate property: Start date. - * - * @return the startDate value. - */ - public OffsetDateTime startDate() { - return this.startDate; - } - - /** - * Set the startDate property: Start date. - * - * @param startDate the startDate value to set. - * @return the KeyCredentialInner object itself. - */ - public KeyCredentialInner withStartDate(OffsetDateTime startDate) { - this.startDate = startDate; - return this; - } - - /** - * Get the endDate property: End date. - * - * @return the endDate value. - */ - public OffsetDateTime endDate() { - return this.endDate; - } - - /** - * Set the endDate property: End date. - * - * @param endDate the endDate value to set. - * @return the KeyCredentialInner object itself. - */ - public KeyCredentialInner withEndDate(OffsetDateTime endDate) { - this.endDate = endDate; - return this; - } - - /** - * Get the value property: Key value. - * - * @return the value value. - */ - public String value() { - return this.value; - } - - /** - * Set the value property: Key value. - * - * @param value the value value to set. - * @return the KeyCredentialInner object itself. - */ - public KeyCredentialInner withValue(String value) { - this.value = value; - return this; - } - - /** - * Get the keyId property: Key ID. - * - * @return the keyId value. - */ - public String keyId() { - return this.keyId; - } - - /** - * Set the keyId property: Key ID. - * - * @param keyId the keyId value to set. - * @return the KeyCredentialInner object itself. - */ - public KeyCredentialInner withKeyId(String keyId) { - this.keyId = keyId; - return this; - } - - /** - * Get the usage property: Usage. Acceptable values are 'Verify' and 'Sign'. - * - * @return the usage value. - */ - public String usage() { - return this.usage; - } - - /** - * Set the usage property: Usage. Acceptable values are 'Verify' and 'Sign'. - * - * @param usage the usage value to set. - * @return the KeyCredentialInner object itself. - */ - public KeyCredentialInner withUsage(String usage) { - this.usage = usage; - return this; - } - - /** - * Get the type property: Type. Acceptable values are 'AsymmetricX509Cert' and 'Symmetric'. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Set the type property: Type. Acceptable values are 'AsymmetricX509Cert' and 'Symmetric'. - * - * @param type the type value to set. - * @return the KeyCredentialInner object itself. - */ - public KeyCredentialInner withType(String type) { - this.type = type; - return this; - } - - /** - * Get the customKeyIdentifier property: Custom Key Identifier. - * - * @return the customKeyIdentifier value. - */ - public String customKeyIdentifier() { - return this.customKeyIdentifier; - } - - /** - * Set the customKeyIdentifier property: Custom Key Identifier. - * - * @param customKeyIdentifier the customKeyIdentifier value to set. - * @return the KeyCredentialInner object itself. - */ - public KeyCredentialInner withCustomKeyIdentifier(String customKeyIdentifier) { - this.customKeyIdentifier = customKeyIdentifier; - return this; - } - - /** - * Get the additionalProperties property: Active Directory Key Credential information. - * - * @return the additionalProperties value. - */ - @JsonAnyGetter - public Map additionalProperties() { - return this.additionalProperties; - } - - /** - * Set the additionalProperties property: Active Directory Key Credential information. - * - * @param additionalProperties the additionalProperties value to set. - * @return the KeyCredentialInner object itself. - */ - public KeyCredentialInner withAdditionalProperties(Map additionalProperties) { - this.additionalProperties = additionalProperties; - return this; - } - - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/OAuth2PermissionGrantInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/OAuth2PermissionGrantInner.java deleted file mode 100644 index b9e04acb00fa..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/OAuth2PermissionGrantInner.java +++ /dev/null @@ -1,272 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.authorization.models.ConsentType; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The OAuth2PermissionGrant model. */ -@Fluent -public final class OAuth2PermissionGrantInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OAuth2PermissionGrantInner.class); - - /* - * Microsoft.DirectoryServices.OAuth2PermissionGrant - */ - @JsonProperty(value = "odata.type") - private String odataType; - - /* - * The id of the resource's service principal granted consent to - * impersonate the user when accessing the resource (represented by the - * resourceId property). - */ - @JsonProperty(value = "clientId") - private String clientId; - - /* - * The id of the permission grant - */ - @JsonProperty(value = "objectId") - private String objectId; - - /* - * Indicates if consent was provided by the administrator (on behalf of the - * organization) or by an individual. - */ - @JsonProperty(value = "consentType") - private ConsentType consentType; - - /* - * When consent type is Principal, this property specifies the id of the - * user that granted consent and applies only for that user. - */ - @JsonProperty(value = "principalId") - private String principalId; - - /* - * Object Id of the resource you want to grant - */ - @JsonProperty(value = "resourceId") - private String resourceId; - - /* - * Specifies the value of the scope claim that the resource application - * should expect in the OAuth 2.0 access token. For example, User.Read - */ - @JsonProperty(value = "scope") - private String scope; - - /* - * Start time for TTL - */ - @JsonProperty(value = "startTime") - private String startTime; - - /* - * Expiry time for TTL - */ - @JsonProperty(value = "expiryTime") - private String expiryTime; - - /** - * Get the odataType property: Microsoft.DirectoryServices.OAuth2PermissionGrant. - * - * @return the odataType value. - */ - public String odataType() { - return this.odataType; - } - - /** - * Set the odataType property: Microsoft.DirectoryServices.OAuth2PermissionGrant. - * - * @param odataType the odataType value to set. - * @return the OAuth2PermissionGrantInner object itself. - */ - public OAuth2PermissionGrantInner withOdataType(String odataType) { - this.odataType = odataType; - return this; - } - - /** - * Get the clientId property: The id of the resource's service principal granted consent to impersonate the user - * when accessing the resource (represented by the resourceId property). - * - * @return the clientId value. - */ - public String clientId() { - return this.clientId; - } - - /** - * Set the clientId property: The id of the resource's service principal granted consent to impersonate the user - * when accessing the resource (represented by the resourceId property). - * - * @param clientId the clientId value to set. - * @return the OAuth2PermissionGrantInner object itself. - */ - public OAuth2PermissionGrantInner withClientId(String clientId) { - this.clientId = clientId; - return this; - } - - /** - * Get the objectId property: The id of the permission grant. - * - * @return the objectId value. - */ - public String objectId() { - return this.objectId; - } - - /** - * Set the objectId property: The id of the permission grant. - * - * @param objectId the objectId value to set. - * @return the OAuth2PermissionGrantInner object itself. - */ - public OAuth2PermissionGrantInner withObjectId(String objectId) { - this.objectId = objectId; - return this; - } - - /** - * Get the consentType property: Indicates if consent was provided by the administrator (on behalf of the - * organization) or by an individual. - * - * @return the consentType value. - */ - public ConsentType consentType() { - return this.consentType; - } - - /** - * Set the consentType property: Indicates if consent was provided by the administrator (on behalf of the - * organization) or by an individual. - * - * @param consentType the consentType value to set. - * @return the OAuth2PermissionGrantInner object itself. - */ - public OAuth2PermissionGrantInner withConsentType(ConsentType consentType) { - this.consentType = consentType; - return this; - } - - /** - * Get the principalId property: When consent type is Principal, this property specifies the id of the user that - * granted consent and applies only for that user. - * - * @return the principalId value. - */ - public String principalId() { - return this.principalId; - } - - /** - * Set the principalId property: When consent type is Principal, this property specifies the id of the user that - * granted consent and applies only for that user. - * - * @param principalId the principalId value to set. - * @return the OAuth2PermissionGrantInner object itself. - */ - public OAuth2PermissionGrantInner withPrincipalId(String principalId) { - this.principalId = principalId; - return this; - } - - /** - * Get the resourceId property: Object Id of the resource you want to grant. - * - * @return the resourceId value. - */ - public String resourceId() { - return this.resourceId; - } - - /** - * Set the resourceId property: Object Id of the resource you want to grant. - * - * @param resourceId the resourceId value to set. - * @return the OAuth2PermissionGrantInner object itself. - */ - public OAuth2PermissionGrantInner withResourceId(String resourceId) { - this.resourceId = resourceId; - return this; - } - - /** - * Get the scope property: Specifies the value of the scope claim that the resource application should expect in the - * OAuth 2.0 access token. For example, User.Read. - * - * @return the scope value. - */ - public String scope() { - return this.scope; - } - - /** - * Set the scope property: Specifies the value of the scope claim that the resource application should expect in the - * OAuth 2.0 access token. For example, User.Read. - * - * @param scope the scope value to set. - * @return the OAuth2PermissionGrantInner object itself. - */ - public OAuth2PermissionGrantInner withScope(String scope) { - this.scope = scope; - return this; - } - - /** - * Get the startTime property: Start time for TTL. - * - * @return the startTime value. - */ - public String startTime() { - return this.startTime; - } - - /** - * Set the startTime property: Start time for TTL. - * - * @param startTime the startTime value to set. - * @return the OAuth2PermissionGrantInner object itself. - */ - public OAuth2PermissionGrantInner withStartTime(String startTime) { - this.startTime = startTime; - return this; - } - - /** - * Get the expiryTime property: Expiry time for TTL. - * - * @return the expiryTime value. - */ - public String expiryTime() { - return this.expiryTime; - } - - /** - * Set the expiryTime property: Expiry time for TTL. - * - * @param expiryTime the expiryTime value to set. - * @return the OAuth2PermissionGrantInner object itself. - */ - public OAuth2PermissionGrantInner withExpiryTime(String expiryTime) { - this.expiryTime = expiryTime; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/OdataError.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/OdataError.java deleted file mode 100644 index 3bdc933e3b61..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/OdataError.java +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Active Directory OData error information. */ -@Fluent -public final class OdataError { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OdataError.class); - - /* - * Error code. - */ - @JsonProperty(value = "code") - private String code; - - /* - * Error Message. - */ - @JsonProperty(value = "message") - private ErrorMessage innerMessage; - - /** - * Get the code property: Error code. - * - * @return the code value. - */ - public String code() { - return this.code; - } - - /** - * Set the code property: Error code. - * - * @param code the code value to set. - * @return the OdataError object itself. - */ - public OdataError withCode(String code) { - this.code = code; - return this; - } - - /** - * Get the innerMessage property: Error Message. - * - * @return the innerMessage value. - */ - private ErrorMessage innerMessage() { - return this.innerMessage; - } - - /** - * Get the message property: Error message value. - * - * @return the message value. - */ - public String message() { - return this.innerMessage() == null ? null : this.innerMessage().message(); - } - - /** - * Set the message property: Error message value. - * - * @param message the message value to set. - * @return the OdataError object itself. - */ - public OdataError withMessage(String message) { - if (this.innerMessage() == null) { - this.innerMessage = new ErrorMessage(); - } - this.innerMessage().withMessage(message); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerMessage() != null) { - innerMessage().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/PasswordCredentialInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/PasswordCredentialInner.java deleted file mode 100644 index 8460a1875e25..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/PasswordCredentialInner.java +++ /dev/null @@ -1,194 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; - -/** Active Directory Password Credential information. */ -@Fluent -public final class PasswordCredentialInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PasswordCredentialInner.class); - - /* - * Start date. - */ - @JsonProperty(value = "startDate") - private OffsetDateTime startDate; - - /* - * End date. - */ - @JsonProperty(value = "endDate") - private OffsetDateTime endDate; - - /* - * Key ID. - */ - @JsonProperty(value = "keyId") - private String keyId; - - /* - * Key value. - */ - @JsonProperty(value = "value") - private String value; - - /* - * Custom Key Identifier - */ - @JsonProperty(value = "customKeyIdentifier") - private byte[] customKeyIdentifier; - - /* - * Active Directory Password Credential information. - */ - @JsonIgnore private Map additionalProperties; - - /** - * Get the startDate property: Start date. - * - * @return the startDate value. - */ - public OffsetDateTime startDate() { - return this.startDate; - } - - /** - * Set the startDate property: Start date. - * - * @param startDate the startDate value to set. - * @return the PasswordCredentialInner object itself. - */ - public PasswordCredentialInner withStartDate(OffsetDateTime startDate) { - this.startDate = startDate; - return this; - } - - /** - * Get the endDate property: End date. - * - * @return the endDate value. - */ - public OffsetDateTime endDate() { - return this.endDate; - } - - /** - * Set the endDate property: End date. - * - * @param endDate the endDate value to set. - * @return the PasswordCredentialInner object itself. - */ - public PasswordCredentialInner withEndDate(OffsetDateTime endDate) { - this.endDate = endDate; - return this; - } - - /** - * Get the keyId property: Key ID. - * - * @return the keyId value. - */ - public String keyId() { - return this.keyId; - } - - /** - * Set the keyId property: Key ID. - * - * @param keyId the keyId value to set. - * @return the PasswordCredentialInner object itself. - */ - public PasswordCredentialInner withKeyId(String keyId) { - this.keyId = keyId; - return this; - } - - /** - * Get the value property: Key value. - * - * @return the value value. - */ - public String value() { - return this.value; - } - - /** - * Set the value property: Key value. - * - * @param value the value value to set. - * @return the PasswordCredentialInner object itself. - */ - public PasswordCredentialInner withValue(String value) { - this.value = value; - return this; - } - - /** - * Get the customKeyIdentifier property: Custom Key Identifier. - * - * @return the customKeyIdentifier value. - */ - public byte[] customKeyIdentifier() { - return CoreUtils.clone(this.customKeyIdentifier); - } - - /** - * Set the customKeyIdentifier property: Custom Key Identifier. - * - * @param customKeyIdentifier the customKeyIdentifier value to set. - * @return the PasswordCredentialInner object itself. - */ - public PasswordCredentialInner withCustomKeyIdentifier(byte[] customKeyIdentifier) { - this.customKeyIdentifier = CoreUtils.clone(customKeyIdentifier); - return this; - } - - /** - * Get the additionalProperties property: Active Directory Password Credential information. - * - * @return the additionalProperties value. - */ - @JsonAnyGetter - public Map additionalProperties() { - return this.additionalProperties; - } - - /** - * Set the additionalProperties property: Active Directory Password Credential information. - * - * @param additionalProperties the additionalProperties value to set. - * @return the PasswordCredentialInner object itself. - */ - public PasswordCredentialInner withAdditionalProperties(Map additionalProperties) { - this.additionalProperties = additionalProperties; - return this; - } - - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/PermissionInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/PermissionInner.java deleted file mode 100644 index 2f2c6583c86a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/PermissionInner.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Role definition permissions. */ -@Fluent -public final class PermissionInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PermissionInner.class); - - /* - * Allowed actions. - */ - @JsonProperty(value = "actions") - private List actions; - - /* - * Denied actions. - */ - @JsonProperty(value = "notActions") - private List notActions; - - /** - * Get the actions property: Allowed actions. - * - * @return the actions value. - */ - public List actions() { - return this.actions; - } - - /** - * Set the actions property: Allowed actions. - * - * @param actions the actions value to set. - * @return the PermissionInner object itself. - */ - public PermissionInner withActions(List actions) { - this.actions = actions; - return this; - } - - /** - * Get the notActions property: Denied actions. - * - * @return the notActions value. - */ - public List notActions() { - return this.notActions; - } - - /** - * Set the notActions property: Denied actions. - * - * @param notActions the notActions value to set. - * @return the PermissionInner object itself. - */ - public PermissionInner withNotActions(List notActions) { - this.notActions = notActions; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/ProviderOperationsMetadataInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/ProviderOperationsMetadataInner.java deleted file mode 100644 index 35ec8d48da98..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/ProviderOperationsMetadataInner.java +++ /dev/null @@ -1,189 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.authorization.models.ProviderOperation; -import com.azure.resourcemanager.authorization.models.ResourceType; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Provider Operations metadata. */ -@Fluent -public final class ProviderOperationsMetadataInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ProviderOperationsMetadataInner.class); - - /* - * The provider id. - */ - @JsonProperty(value = "id") - private String id; - - /* - * The provider name. - */ - @JsonProperty(value = "name") - private String name; - - /* - * The provider type. - */ - @JsonProperty(value = "type") - private String type; - - /* - * The provider display name. - */ - @JsonProperty(value = "displayName") - private String displayName; - - /* - * The provider resource types - */ - @JsonProperty(value = "resourceTypes") - private List resourceTypes; - - /* - * The provider operations. - */ - @JsonProperty(value = "operations") - private List operations; - - /** - * Get the id property: The provider id. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: The provider id. - * - * @param id the id value to set. - * @return the ProviderOperationsMetadataInner object itself. - */ - public ProviderOperationsMetadataInner withId(String id) { - this.id = id; - return this; - } - - /** - * Get the name property: The provider name. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The provider name. - * - * @param name the name value to set. - * @return the ProviderOperationsMetadataInner object itself. - */ - public ProviderOperationsMetadataInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the type property: The provider type. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Set the type property: The provider type. - * - * @param type the type value to set. - * @return the ProviderOperationsMetadataInner object itself. - */ - public ProviderOperationsMetadataInner withType(String type) { - this.type = type; - return this; - } - - /** - * Get the displayName property: The provider display name. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Set the displayName property: The provider display name. - * - * @param displayName the displayName value to set. - * @return the ProviderOperationsMetadataInner object itself. - */ - public ProviderOperationsMetadataInner withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - - /** - * Get the resourceTypes property: The provider resource types. - * - * @return the resourceTypes value. - */ - public List resourceTypes() { - return this.resourceTypes; - } - - /** - * Set the resourceTypes property: The provider resource types. - * - * @param resourceTypes the resourceTypes value to set. - * @return the ProviderOperationsMetadataInner object itself. - */ - public ProviderOperationsMetadataInner withResourceTypes(List resourceTypes) { - this.resourceTypes = resourceTypes; - return this; - } - - /** - * Get the operations property: The provider operations. - * - * @return the operations value. - */ - public List operations() { - return this.operations; - } - - /** - * Set the operations property: The provider operations. - * - * @param operations the operations value to set. - * @return the ProviderOperationsMetadataInner object itself. - */ - public ProviderOperationsMetadataInner withOperations(List operations) { - this.operations = operations; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (resourceTypes() != null) { - resourceTypes().forEach(e -> e.validate()); - } - if (operations() != null) { - operations().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/RoleAssignmentInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/RoleAssignmentInner.java deleted file mode 100644 index b8690e9955f2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/RoleAssignmentInner.java +++ /dev/null @@ -1,156 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Role Assignments. */ -@Fluent -public final class RoleAssignmentInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RoleAssignmentInner.class); - - /* - * The role assignment ID. - */ - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) - private String id; - - /* - * The role assignment name. - */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) - private String name; - - /* - * The role assignment type. - */ - @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) - private String type; - - /* - * Role assignment properties. - */ - @JsonProperty(value = "properties") - private RoleAssignmentPropertiesWithScope innerProperties; - - /** - * Get the id property: The role assignment ID. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Get the name property: The role assignment name. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the type property: The role assignment type. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Get the innerProperties property: Role assignment properties. - * - * @return the innerProperties value. - */ - private RoleAssignmentPropertiesWithScope innerProperties() { - return this.innerProperties; - } - - /** - * Get the scope property: The role assignment scope. - * - * @return the scope value. - */ - public String scope() { - return this.innerProperties() == null ? null : this.innerProperties().scope(); - } - - /** - * Set the scope property: The role assignment scope. - * - * @param scope the scope value to set. - * @return the RoleAssignmentInner object itself. - */ - public RoleAssignmentInner withScope(String scope) { - if (this.innerProperties() == null) { - this.innerProperties = new RoleAssignmentPropertiesWithScope(); - } - this.innerProperties().withScope(scope); - return this; - } - - /** - * Get the roleDefinitionId property: The role definition ID. - * - * @return the roleDefinitionId value. - */ - public String roleDefinitionId() { - return this.innerProperties() == null ? null : this.innerProperties().roleDefinitionId(); - } - - /** - * Set the roleDefinitionId property: The role definition ID. - * - * @param roleDefinitionId the roleDefinitionId value to set. - * @return the RoleAssignmentInner object itself. - */ - public RoleAssignmentInner withRoleDefinitionId(String roleDefinitionId) { - if (this.innerProperties() == null) { - this.innerProperties = new RoleAssignmentPropertiesWithScope(); - } - this.innerProperties().withRoleDefinitionId(roleDefinitionId); - return this; - } - - /** - * Get the principalId property: The principal ID. - * - * @return the principalId value. - */ - public String principalId() { - return this.innerProperties() == null ? null : this.innerProperties().principalId(); - } - - /** - * Set the principalId property: The principal ID. - * - * @param principalId the principalId value to set. - * @return the RoleAssignmentInner object itself. - */ - public RoleAssignmentInner withPrincipalId(String principalId) { - if (this.innerProperties() == null) { - this.innerProperties = new RoleAssignmentPropertiesWithScope(); - } - this.innerProperties().withPrincipalId(principalId); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/RoleAssignmentProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/RoleAssignmentProperties.java deleted file mode 100644 index e972c06164e2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/RoleAssignmentProperties.java +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Role assignment properties. */ -@Fluent -public final class RoleAssignmentProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RoleAssignmentProperties.class); - - /* - * The role definition ID used in the role assignment. - */ - @JsonProperty(value = "roleDefinitionId", required = true) - private String roleDefinitionId; - - /* - * The principal ID assigned to the role. This maps to the ID inside the - * Active Directory. It can point to a user, service principal, or security - * group. - */ - @JsonProperty(value = "principalId", required = true) - private String principalId; - - /** - * Get the roleDefinitionId property: The role definition ID used in the role assignment. - * - * @return the roleDefinitionId value. - */ - public String roleDefinitionId() { - return this.roleDefinitionId; - } - - /** - * Set the roleDefinitionId property: The role definition ID used in the role assignment. - * - * @param roleDefinitionId the roleDefinitionId value to set. - * @return the RoleAssignmentProperties object itself. - */ - public RoleAssignmentProperties withRoleDefinitionId(String roleDefinitionId) { - this.roleDefinitionId = roleDefinitionId; - return this; - } - - /** - * Get the principalId property: The principal ID assigned to the role. This maps to the ID inside the Active - * Directory. It can point to a user, service principal, or security group. - * - * @return the principalId value. - */ - public String principalId() { - return this.principalId; - } - - /** - * Set the principalId property: The principal ID assigned to the role. This maps to the ID inside the Active - * Directory. It can point to a user, service principal, or security group. - * - * @param principalId the principalId value to set. - * @return the RoleAssignmentProperties object itself. - */ - public RoleAssignmentProperties withPrincipalId(String principalId) { - this.principalId = principalId; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (roleDefinitionId() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property roleDefinitionId in model RoleAssignmentProperties")); - } - if (principalId() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property principalId in model RoleAssignmentProperties")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/RoleAssignmentPropertiesWithScope.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/RoleAssignmentPropertiesWithScope.java deleted file mode 100644 index d552d5840a03..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/RoleAssignmentPropertiesWithScope.java +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Role assignment properties with scope. */ -@Fluent -public final class RoleAssignmentPropertiesWithScope { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RoleAssignmentPropertiesWithScope.class); - - /* - * The role assignment scope. - */ - @JsonProperty(value = "scope") - private String scope; - - /* - * The role definition ID. - */ - @JsonProperty(value = "roleDefinitionId") - private String roleDefinitionId; - - /* - * The principal ID. - */ - @JsonProperty(value = "principalId") - private String principalId; - - /** - * Get the scope property: The role assignment scope. - * - * @return the scope value. - */ - public String scope() { - return this.scope; - } - - /** - * Set the scope property: The role assignment scope. - * - * @param scope the scope value to set. - * @return the RoleAssignmentPropertiesWithScope object itself. - */ - public RoleAssignmentPropertiesWithScope withScope(String scope) { - this.scope = scope; - return this; - } - - /** - * Get the roleDefinitionId property: The role definition ID. - * - * @return the roleDefinitionId value. - */ - public String roleDefinitionId() { - return this.roleDefinitionId; - } - - /** - * Set the roleDefinitionId property: The role definition ID. - * - * @param roleDefinitionId the roleDefinitionId value to set. - * @return the RoleAssignmentPropertiesWithScope object itself. - */ - public RoleAssignmentPropertiesWithScope withRoleDefinitionId(String roleDefinitionId) { - this.roleDefinitionId = roleDefinitionId; - return this; - } - - /** - * Get the principalId property: The principal ID. - * - * @return the principalId value. - */ - public String principalId() { - return this.principalId; - } - - /** - * Set the principalId property: The principal ID. - * - * @param principalId the principalId value to set. - * @return the RoleAssignmentPropertiesWithScope object itself. - */ - public RoleAssignmentPropertiesWithScope withPrincipalId(String principalId) { - this.principalId = principalId; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/RoleDefinitionInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/RoleDefinitionInner.java deleted file mode 100644 index 7c1ec31d6349..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/RoleDefinitionInner.java +++ /dev/null @@ -1,203 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Role definition. */ -@Fluent -public final class RoleDefinitionInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RoleDefinitionInner.class); - - /* - * The role definition ID. - */ - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) - private String id; - - /* - * The role definition name. - */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) - private String name; - - /* - * The role definition type. - */ - @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) - private String type; - - /* - * Role definition properties. - */ - @JsonProperty(value = "properties") - private RoleDefinitionProperties innerProperties; - - /** - * Get the id property: The role definition ID. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Get the name property: The role definition name. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the type property: The role definition type. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Get the innerProperties property: Role definition properties. - * - * @return the innerProperties value. - */ - private RoleDefinitionProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the roleName property: The role name. - * - * @return the roleName value. - */ - public String roleName() { - return this.innerProperties() == null ? null : this.innerProperties().roleName(); - } - - /** - * Set the roleName property: The role name. - * - * @param roleName the roleName value to set. - * @return the RoleDefinitionInner object itself. - */ - public RoleDefinitionInner withRoleName(String roleName) { - if (this.innerProperties() == null) { - this.innerProperties = new RoleDefinitionProperties(); - } - this.innerProperties().withRoleName(roleName); - return this; - } - - /** - * Get the description property: The role definition description. - * - * @return the description value. - */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); - } - - /** - * Set the description property: The role definition description. - * - * @param description the description value to set. - * @return the RoleDefinitionInner object itself. - */ - public RoleDefinitionInner withDescription(String description) { - if (this.innerProperties() == null) { - this.innerProperties = new RoleDefinitionProperties(); - } - this.innerProperties().withDescription(description); - return this; - } - - /** - * Get the roleType property: The role type. - * - * @return the roleType value. - */ - public String roleType() { - return this.innerProperties() == null ? null : this.innerProperties().roleType(); - } - - /** - * Set the roleType property: The role type. - * - * @param roleType the roleType value to set. - * @return the RoleDefinitionInner object itself. - */ - public RoleDefinitionInner withRoleType(String roleType) { - if (this.innerProperties() == null) { - this.innerProperties = new RoleDefinitionProperties(); - } - this.innerProperties().withRoleType(roleType); - return this; - } - - /** - * Get the permissions property: Role definition permissions. - * - * @return the permissions value. - */ - public List permissions() { - return this.innerProperties() == null ? null : this.innerProperties().permissions(); - } - - /** - * Set the permissions property: Role definition permissions. - * - * @param permissions the permissions value to set. - * @return the RoleDefinitionInner object itself. - */ - public RoleDefinitionInner withPermissions(List permissions) { - if (this.innerProperties() == null) { - this.innerProperties = new RoleDefinitionProperties(); - } - this.innerProperties().withPermissions(permissions); - return this; - } - - /** - * Get the assignableScopes property: Role definition assignable scopes. - * - * @return the assignableScopes value. - */ - public List assignableScopes() { - return this.innerProperties() == null ? null : this.innerProperties().assignableScopes(); - } - - /** - * Set the assignableScopes property: Role definition assignable scopes. - * - * @param assignableScopes the assignableScopes value to set. - * @return the RoleDefinitionInner object itself. - */ - public RoleDefinitionInner withAssignableScopes(List assignableScopes) { - if (this.innerProperties() == null) { - this.innerProperties = new RoleDefinitionProperties(); - } - this.innerProperties().withAssignableScopes(assignableScopes); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/RoleDefinitionProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/RoleDefinitionProperties.java deleted file mode 100644 index 7ebf00cdc484..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/RoleDefinitionProperties.java +++ /dev/null @@ -1,158 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Role definition properties. */ -@Fluent -public final class RoleDefinitionProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RoleDefinitionProperties.class); - - /* - * The role name. - */ - @JsonProperty(value = "roleName") - private String roleName; - - /* - * The role definition description. - */ - @JsonProperty(value = "description") - private String description; - - /* - * The role type. - */ - @JsonProperty(value = "type") - private String roleType; - - /* - * Role definition permissions. - */ - @JsonProperty(value = "permissions") - private List permissions; - - /* - * Role definition assignable scopes. - */ - @JsonProperty(value = "assignableScopes") - private List assignableScopes; - - /** - * Get the roleName property: The role name. - * - * @return the roleName value. - */ - public String roleName() { - return this.roleName; - } - - /** - * Set the roleName property: The role name. - * - * @param roleName the roleName value to set. - * @return the RoleDefinitionProperties object itself. - */ - public RoleDefinitionProperties withRoleName(String roleName) { - this.roleName = roleName; - return this; - } - - /** - * Get the description property: The role definition description. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: The role definition description. - * - * @param description the description value to set. - * @return the RoleDefinitionProperties object itself. - */ - public RoleDefinitionProperties withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the roleType property: The role type. - * - * @return the roleType value. - */ - public String roleType() { - return this.roleType; - } - - /** - * Set the roleType property: The role type. - * - * @param roleType the roleType value to set. - * @return the RoleDefinitionProperties object itself. - */ - public RoleDefinitionProperties withRoleType(String roleType) { - this.roleType = roleType; - return this; - } - - /** - * Get the permissions property: Role definition permissions. - * - * @return the permissions value. - */ - public List permissions() { - return this.permissions; - } - - /** - * Set the permissions property: Role definition permissions. - * - * @param permissions the permissions value to set. - * @return the RoleDefinitionProperties object itself. - */ - public RoleDefinitionProperties withPermissions(List permissions) { - this.permissions = permissions; - return this; - } - - /** - * Get the assignableScopes property: Role definition assignable scopes. - * - * @return the assignableScopes value. - */ - public List assignableScopes() { - return this.assignableScopes; - } - - /** - * Set the assignableScopes property: Role definition assignable scopes. - * - * @param assignableScopes the assignableScopes value to set. - * @return the RoleDefinitionProperties object itself. - */ - public RoleDefinitionProperties withAssignableScopes(List assignableScopes) { - this.assignableScopes = assignableScopes; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (permissions() != null) { - permissions().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/ServicePrincipalInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/ServicePrincipalInner.java deleted file mode 100644 index 84d0f6caa959..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/ServicePrincipalInner.java +++ /dev/null @@ -1,577 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.authorization.models.AppRole; -import com.azure.resourcemanager.authorization.models.OAuth2Permission; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.util.List; - -/** Active Directory service principal information. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") -@JsonTypeName("ServicePrincipal") -@Fluent -public final class ServicePrincipalInner extends DirectoryObjectInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ServicePrincipalInner.class); - - /* - * whether or not the service principal account is enabled - */ - @JsonProperty(value = "accountEnabled") - private Boolean accountEnabled; - - /* - * alternative names - */ - @JsonProperty(value = "alternativeNames") - private List alternativeNames; - - /* - * The display name exposed by the associated application. - */ - @JsonProperty(value = "appDisplayName", access = JsonProperty.Access.WRITE_ONLY) - private String appDisplayName; - - /* - * The application ID. - */ - @JsonProperty(value = "appId") - private String appId; - - /* - * The appOwnerTenantId property. - */ - @JsonProperty(value = "appOwnerTenantId", access = JsonProperty.Access.WRITE_ONLY) - private String appOwnerTenantId; - - /* - * Specifies whether an AppRoleAssignment to a user or group is required - * before Azure AD will issue a user or access token to the application. - */ - @JsonProperty(value = "appRoleAssignmentRequired") - private Boolean appRoleAssignmentRequired; - - /* - * The collection of application roles that an application may declare. - * These roles can be assigned to users, groups or service principals. - */ - @JsonProperty(value = "appRoles") - private List appRoles; - - /* - * The display name of the service principal. - */ - @JsonProperty(value = "displayName") - private String displayName; - - /* - * A URL provided by the author of the associated application to report - * errors when using the application. - */ - @JsonProperty(value = "errorUrl") - private String errorUrl; - - /* - * The URL to the homepage of the associated application. - */ - @JsonProperty(value = "homepage") - private String homepage; - - /* - * The collection of key credentials associated with the service principal. - */ - @JsonProperty(value = "keyCredentials") - private List keyCredentials; - - /* - * A URL provided by the author of the associated application to logout - */ - @JsonProperty(value = "logoutUrl") - private String logoutUrl; - - /* - * The OAuth 2.0 permissions exposed by the associated application. - */ - @JsonProperty(value = "oauth2Permissions", access = JsonProperty.Access.WRITE_ONLY) - private List oauth2Permissions; - - /* - * The collection of password credentials associated with the service - * principal. - */ - @JsonProperty(value = "passwordCredentials") - private List passwordCredentials; - - /* - * The thumbprint of preferred certificate to sign the token - */ - @JsonProperty(value = "preferredTokenSigningKeyThumbprint") - private String preferredTokenSigningKeyThumbprint; - - /* - * The publisher's name of the associated application - */ - @JsonProperty(value = "publisherName") - private String publisherName; - - /* - * The URLs that user tokens are sent to for sign in with the associated - * application. The redirect URIs that the oAuth 2.0 authorization code - * and access tokens are sent to for the associated application. - */ - @JsonProperty(value = "replyUrls") - private List replyUrls; - - /* - * The URL to the SAML metadata of the associated application - */ - @JsonProperty(value = "samlMetadataUrl") - private String samlMetadataUrl; - - /* - * A collection of service principal names. - */ - @JsonProperty(value = "servicePrincipalNames") - private List servicePrincipalNames; - - /* - * the type of the service principal - */ - @JsonProperty(value = "servicePrincipalType") - private String servicePrincipalType; - - /* - * Optional list of tags that you can apply to your service principals. Not - * nullable. - */ - @JsonProperty(value = "tags") - private List tags; - - /** - * Get the accountEnabled property: whether or not the service principal account is enabled. - * - * @return the accountEnabled value. - */ - public Boolean accountEnabled() { - return this.accountEnabled; - } - - /** - * Set the accountEnabled property: whether or not the service principal account is enabled. - * - * @param accountEnabled the accountEnabled value to set. - * @return the ServicePrincipalInner object itself. - */ - public ServicePrincipalInner withAccountEnabled(Boolean accountEnabled) { - this.accountEnabled = accountEnabled; - return this; - } - - /** - * Get the alternativeNames property: alternative names. - * - * @return the alternativeNames value. - */ - public List alternativeNames() { - return this.alternativeNames; - } - - /** - * Set the alternativeNames property: alternative names. - * - * @param alternativeNames the alternativeNames value to set. - * @return the ServicePrincipalInner object itself. - */ - public ServicePrincipalInner withAlternativeNames(List alternativeNames) { - this.alternativeNames = alternativeNames; - return this; - } - - /** - * Get the appDisplayName property: The display name exposed by the associated application. - * - * @return the appDisplayName value. - */ - public String appDisplayName() { - return this.appDisplayName; - } - - /** - * Get the appId property: The application ID. - * - * @return the appId value. - */ - public String appId() { - return this.appId; - } - - /** - * Set the appId property: The application ID. - * - * @param appId the appId value to set. - * @return the ServicePrincipalInner object itself. - */ - public ServicePrincipalInner withAppId(String appId) { - this.appId = appId; - return this; - } - - /** - * Get the appOwnerTenantId property: The appOwnerTenantId property. - * - * @return the appOwnerTenantId value. - */ - public String appOwnerTenantId() { - return this.appOwnerTenantId; - } - - /** - * Get the appRoleAssignmentRequired property: Specifies whether an AppRoleAssignment to a user or group is required - * before Azure AD will issue a user or access token to the application. - * - * @return the appRoleAssignmentRequired value. - */ - public Boolean appRoleAssignmentRequired() { - return this.appRoleAssignmentRequired; - } - - /** - * Set the appRoleAssignmentRequired property: Specifies whether an AppRoleAssignment to a user or group is required - * before Azure AD will issue a user or access token to the application. - * - * @param appRoleAssignmentRequired the appRoleAssignmentRequired value to set. - * @return the ServicePrincipalInner object itself. - */ - public ServicePrincipalInner withAppRoleAssignmentRequired(Boolean appRoleAssignmentRequired) { - this.appRoleAssignmentRequired = appRoleAssignmentRequired; - return this; - } - - /** - * Get the appRoles property: The collection of application roles that an application may declare. These roles can - * be assigned to users, groups or service principals. - * - * @return the appRoles value. - */ - public List appRoles() { - return this.appRoles; - } - - /** - * Set the appRoles property: The collection of application roles that an application may declare. These roles can - * be assigned to users, groups or service principals. - * - * @param appRoles the appRoles value to set. - * @return the ServicePrincipalInner object itself. - */ - public ServicePrincipalInner withAppRoles(List appRoles) { - this.appRoles = appRoles; - return this; - } - - /** - * Get the displayName property: The display name of the service principal. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Set the displayName property: The display name of the service principal. - * - * @param displayName the displayName value to set. - * @return the ServicePrincipalInner object itself. - */ - public ServicePrincipalInner withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - - /** - * Get the errorUrl property: A URL provided by the author of the associated application to report errors when using - * the application. - * - * @return the errorUrl value. - */ - public String errorUrl() { - return this.errorUrl; - } - - /** - * Set the errorUrl property: A URL provided by the author of the associated application to report errors when using - * the application. - * - * @param errorUrl the errorUrl value to set. - * @return the ServicePrincipalInner object itself. - */ - public ServicePrincipalInner withErrorUrl(String errorUrl) { - this.errorUrl = errorUrl; - return this; - } - - /** - * Get the homepage property: The URL to the homepage of the associated application. - * - * @return the homepage value. - */ - public String homepage() { - return this.homepage; - } - - /** - * Set the homepage property: The URL to the homepage of the associated application. - * - * @param homepage the homepage value to set. - * @return the ServicePrincipalInner object itself. - */ - public ServicePrincipalInner withHomepage(String homepage) { - this.homepage = homepage; - return this; - } - - /** - * Get the keyCredentials property: The collection of key credentials associated with the service principal. - * - * @return the keyCredentials value. - */ - public List keyCredentials() { - return this.keyCredentials; - } - - /** - * Set the keyCredentials property: The collection of key credentials associated with the service principal. - * - * @param keyCredentials the keyCredentials value to set. - * @return the ServicePrincipalInner object itself. - */ - public ServicePrincipalInner withKeyCredentials(List keyCredentials) { - this.keyCredentials = keyCredentials; - return this; - } - - /** - * Get the logoutUrl property: A URL provided by the author of the associated application to logout. - * - * @return the logoutUrl value. - */ - public String logoutUrl() { - return this.logoutUrl; - } - - /** - * Set the logoutUrl property: A URL provided by the author of the associated application to logout. - * - * @param logoutUrl the logoutUrl value to set. - * @return the ServicePrincipalInner object itself. - */ - public ServicePrincipalInner withLogoutUrl(String logoutUrl) { - this.logoutUrl = logoutUrl; - return this; - } - - /** - * Get the oauth2Permissions property: The OAuth 2.0 permissions exposed by the associated application. - * - * @return the oauth2Permissions value. - */ - public List oauth2Permissions() { - return this.oauth2Permissions; - } - - /** - * Get the passwordCredentials property: The collection of password credentials associated with the service - * principal. - * - * @return the passwordCredentials value. - */ - public List passwordCredentials() { - return this.passwordCredentials; - } - - /** - * Set the passwordCredentials property: The collection of password credentials associated with the service - * principal. - * - * @param passwordCredentials the passwordCredentials value to set. - * @return the ServicePrincipalInner object itself. - */ - public ServicePrincipalInner withPasswordCredentials(List passwordCredentials) { - this.passwordCredentials = passwordCredentials; - return this; - } - - /** - * Get the preferredTokenSigningKeyThumbprint property: The thumbprint of preferred certificate to sign the token. - * - * @return the preferredTokenSigningKeyThumbprint value. - */ - public String preferredTokenSigningKeyThumbprint() { - return this.preferredTokenSigningKeyThumbprint; - } - - /** - * Set the preferredTokenSigningKeyThumbprint property: The thumbprint of preferred certificate to sign the token. - * - * @param preferredTokenSigningKeyThumbprint the preferredTokenSigningKeyThumbprint value to set. - * @return the ServicePrincipalInner object itself. - */ - public ServicePrincipalInner withPreferredTokenSigningKeyThumbprint(String preferredTokenSigningKeyThumbprint) { - this.preferredTokenSigningKeyThumbprint = preferredTokenSigningKeyThumbprint; - return this; - } - - /** - * Get the publisherName property: The publisher's name of the associated application. - * - * @return the publisherName value. - */ - public String publisherName() { - return this.publisherName; - } - - /** - * Set the publisherName property: The publisher's name of the associated application. - * - * @param publisherName the publisherName value to set. - * @return the ServicePrincipalInner object itself. - */ - public ServicePrincipalInner withPublisherName(String publisherName) { - this.publisherName = publisherName; - return this; - } - - /** - * Get the replyUrls property: The URLs that user tokens are sent to for sign in with the associated application. - * The redirect URIs that the oAuth 2.0 authorization code and access tokens are sent to for the associated - * application. - * - * @return the replyUrls value. - */ - public List replyUrls() { - return this.replyUrls; - } - - /** - * Set the replyUrls property: The URLs that user tokens are sent to for sign in with the associated application. - * The redirect URIs that the oAuth 2.0 authorization code and access tokens are sent to for the associated - * application. - * - * @param replyUrls the replyUrls value to set. - * @return the ServicePrincipalInner object itself. - */ - public ServicePrincipalInner withReplyUrls(List replyUrls) { - this.replyUrls = replyUrls; - return this; - } - - /** - * Get the samlMetadataUrl property: The URL to the SAML metadata of the associated application. - * - * @return the samlMetadataUrl value. - */ - public String samlMetadataUrl() { - return this.samlMetadataUrl; - } - - /** - * Set the samlMetadataUrl property: The URL to the SAML metadata of the associated application. - * - * @param samlMetadataUrl the samlMetadataUrl value to set. - * @return the ServicePrincipalInner object itself. - */ - public ServicePrincipalInner withSamlMetadataUrl(String samlMetadataUrl) { - this.samlMetadataUrl = samlMetadataUrl; - return this; - } - - /** - * Get the servicePrincipalNames property: A collection of service principal names. - * - * @return the servicePrincipalNames value. - */ - public List servicePrincipalNames() { - return this.servicePrincipalNames; - } - - /** - * Set the servicePrincipalNames property: A collection of service principal names. - * - * @param servicePrincipalNames the servicePrincipalNames value to set. - * @return the ServicePrincipalInner object itself. - */ - public ServicePrincipalInner withServicePrincipalNames(List servicePrincipalNames) { - this.servicePrincipalNames = servicePrincipalNames; - return this; - } - - /** - * Get the servicePrincipalType property: the type of the service principal. - * - * @return the servicePrincipalType value. - */ - public String servicePrincipalType() { - return this.servicePrincipalType; - } - - /** - * Set the servicePrincipalType property: the type of the service principal. - * - * @param servicePrincipalType the servicePrincipalType value to set. - * @return the ServicePrincipalInner object itself. - */ - public ServicePrincipalInner withServicePrincipalType(String servicePrincipalType) { - this.servicePrincipalType = servicePrincipalType; - return this; - } - - /** - * Get the tags property: Optional list of tags that you can apply to your service principals. Not nullable. - * - * @return the tags value. - */ - public List tags() { - return this.tags; - } - - /** - * Set the tags property: Optional list of tags that you can apply to your service principals. Not nullable. - * - * @param tags the tags value to set. - * @return the ServicePrincipalInner object itself. - */ - public ServicePrincipalInner withTags(List tags) { - this.tags = tags; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (appRoles() != null) { - appRoles().forEach(e -> e.validate()); - } - if (keyCredentials() != null) { - keyCredentials().forEach(e -> e.validate()); - } - if (oauth2Permissions() != null) { - oauth2Permissions().forEach(e -> e.validate()); - } - if (passwordCredentials() != null) { - passwordCredentials().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/ServicePrincipalObjectResultInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/ServicePrincipalObjectResultInner.java deleted file mode 100644 index fc0b6bc2b80f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/ServicePrincipalObjectResultInner.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Service Principal Object Result. */ -@Fluent -public final class ServicePrincipalObjectResultInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ServicePrincipalObjectResultInner.class); - - /* - * The Object ID of the service principal with the specified application - * ID. - */ - @JsonProperty(value = "value") - private String value; - - /* - * The URL representing edm equivalent. - */ - @JsonProperty(value = "odata.metadata") - private String odataMetadata; - - /** - * Get the value property: The Object ID of the service principal with the specified application ID. - * - * @return the value value. - */ - public String value() { - return this.value; - } - - /** - * Set the value property: The Object ID of the service principal with the specified application ID. - * - * @param value the value value to set. - * @return the ServicePrincipalObjectResultInner object itself. - */ - public ServicePrincipalObjectResultInner withValue(String value) { - this.value = value; - return this; - } - - /** - * Get the odataMetadata property: The URL representing edm equivalent. - * - * @return the odataMetadata value. - */ - public String odataMetadata() { - return this.odataMetadata; - } - - /** - * Set the odataMetadata property: The URL representing edm equivalent. - * - * @param odataMetadata the odataMetadata value to set. - * @return the ServicePrincipalObjectResultInner object itself. - */ - public ServicePrincipalObjectResultInner withOdataMetadata(String odataMetadata) { - this.odataMetadata = odataMetadata; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/UserInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/UserInner.java deleted file mode 100644 index 8bf6e533da71..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/UserInner.java +++ /dev/null @@ -1,339 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.authorization.models.SignInName; -import com.azure.resourcemanager.authorization.models.UserType; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.util.List; - -/** Active Directory user information. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") -@JsonTypeName("User") -@Fluent -public final class UserInner extends DirectoryObjectInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(UserInner.class); - - /* - * This must be specified if you are using a federated domain for the - * user's userPrincipalName (UPN) property when creating a new user - * account. It is used to associate an on-premises Active Directory user - * account with their Azure AD user object. - */ - @JsonProperty(value = "immutableId") - private String immutableId; - - /* - * A two letter country code (ISO standard 3166). Required for users that - * will be assigned licenses due to legal requirement to check for - * availability of services in countries. Examples include: "US", "JP", and - * "GB". - */ - @JsonProperty(value = "usageLocation") - private String usageLocation; - - /* - * The given name for the user. - */ - @JsonProperty(value = "givenName") - private String givenName; - - /* - * The user's surname (family name or last name). - */ - @JsonProperty(value = "surname") - private String surname; - - /* - * A string value that can be used to classify user types in your - * directory, such as 'Member' and 'Guest'. - */ - @JsonProperty(value = "userType") - private UserType userType; - - /* - * Whether the account is enabled. - */ - @JsonProperty(value = "accountEnabled") - private Boolean accountEnabled; - - /* - * The display name of the user. - */ - @JsonProperty(value = "displayName") - private String displayName; - - /* - * The principal name of the user. - */ - @JsonProperty(value = "userPrincipalName") - private String userPrincipalName; - - /* - * The mail alias for the user. - */ - @JsonProperty(value = "mailNickname") - private String mailNickname; - - /* - * The primary email address of the user. - */ - @JsonProperty(value = "mail") - private String mail; - - /* - * The sign-in names of the user. - */ - @JsonProperty(value = "signInNames") - private List signInNames; - - /** - * Get the immutableId property: This must be specified if you are using a federated domain for the user's - * userPrincipalName (UPN) property when creating a new user account. It is used to associate an on-premises Active - * Directory user account with their Azure AD user object. - * - * @return the immutableId value. - */ - public String immutableId() { - return this.immutableId; - } - - /** - * Set the immutableId property: This must be specified if you are using a federated domain for the user's - * userPrincipalName (UPN) property when creating a new user account. It is used to associate an on-premises Active - * Directory user account with their Azure AD user object. - * - * @param immutableId the immutableId value to set. - * @return the UserInner object itself. - */ - public UserInner withImmutableId(String immutableId) { - this.immutableId = immutableId; - return this; - } - - /** - * Get the usageLocation property: A two letter country code (ISO standard 3166). Required for users that will be - * assigned licenses due to legal requirement to check for availability of services in countries. Examples include: - * "US", "JP", and "GB". - * - * @return the usageLocation value. - */ - public String usageLocation() { - return this.usageLocation; - } - - /** - * Set the usageLocation property: A two letter country code (ISO standard 3166). Required for users that will be - * assigned licenses due to legal requirement to check for availability of services in countries. Examples include: - * "US", "JP", and "GB". - * - * @param usageLocation the usageLocation value to set. - * @return the UserInner object itself. - */ - public UserInner withUsageLocation(String usageLocation) { - this.usageLocation = usageLocation; - return this; - } - - /** - * Get the givenName property: The given name for the user. - * - * @return the givenName value. - */ - public String givenName() { - return this.givenName; - } - - /** - * Set the givenName property: The given name for the user. - * - * @param givenName the givenName value to set. - * @return the UserInner object itself. - */ - public UserInner withGivenName(String givenName) { - this.givenName = givenName; - return this; - } - - /** - * Get the surname property: The user's surname (family name or last name). - * - * @return the surname value. - */ - public String surname() { - return this.surname; - } - - /** - * Set the surname property: The user's surname (family name or last name). - * - * @param surname the surname value to set. - * @return the UserInner object itself. - */ - public UserInner withSurname(String surname) { - this.surname = surname; - return this; - } - - /** - * Get the userType property: A string value that can be used to classify user types in your directory, such as - * 'Member' and 'Guest'. - * - * @return the userType value. - */ - public UserType userType() { - return this.userType; - } - - /** - * Set the userType property: A string value that can be used to classify user types in your directory, such as - * 'Member' and 'Guest'. - * - * @param userType the userType value to set. - * @return the UserInner object itself. - */ - public UserInner withUserType(UserType userType) { - this.userType = userType; - return this; - } - - /** - * Get the accountEnabled property: Whether the account is enabled. - * - * @return the accountEnabled value. - */ - public Boolean accountEnabled() { - return this.accountEnabled; - } - - /** - * Set the accountEnabled property: Whether the account is enabled. - * - * @param accountEnabled the accountEnabled value to set. - * @return the UserInner object itself. - */ - public UserInner withAccountEnabled(Boolean accountEnabled) { - this.accountEnabled = accountEnabled; - return this; - } - - /** - * Get the displayName property: The display name of the user. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Set the displayName property: The display name of the user. - * - * @param displayName the displayName value to set. - * @return the UserInner object itself. - */ - public UserInner withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - - /** - * Get the userPrincipalName property: The principal name of the user. - * - * @return the userPrincipalName value. - */ - public String userPrincipalName() { - return this.userPrincipalName; - } - - /** - * Set the userPrincipalName property: The principal name of the user. - * - * @param userPrincipalName the userPrincipalName value to set. - * @return the UserInner object itself. - */ - public UserInner withUserPrincipalName(String userPrincipalName) { - this.userPrincipalName = userPrincipalName; - return this; - } - - /** - * Get the mailNickname property: The mail alias for the user. - * - * @return the mailNickname value. - */ - public String mailNickname() { - return this.mailNickname; - } - - /** - * Set the mailNickname property: The mail alias for the user. - * - * @param mailNickname the mailNickname value to set. - * @return the UserInner object itself. - */ - public UserInner withMailNickname(String mailNickname) { - this.mailNickname = mailNickname; - return this; - } - - /** - * Get the mail property: The primary email address of the user. - * - * @return the mail value. - */ - public String mail() { - return this.mail; - } - - /** - * Set the mail property: The primary email address of the user. - * - * @param mail the mail value to set. - * @return the UserInner object itself. - */ - public UserInner withMail(String mail) { - this.mail = mail; - return this; - } - - /** - * Get the signInNames property: The sign-in names of the user. - * - * @return the signInNames value. - */ - public List signInNames() { - return this.signInNames; - } - - /** - * Set the signInNames property: The sign-in names of the user. - * - * @param signInNames the signInNames value to set. - * @return the UserInner object itself. - */ - public UserInner withSignInNames(List signInNames) { - this.signInNames = signInNames; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (signInNames() != null) { - signInNames().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/package-info.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/package-info.java deleted file mode 100644 index 36dafbab0a78..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** Package containing the inner data models for GraphRbacManagementClient. The Graph RBAC Management Client. */ -package com.azure.resourcemanager.authorization.fluent.models; diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/package-info.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/package-info.java deleted file mode 100644 index 2b76ff5519f7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** Package containing the service clients for GraphRbacManagementClient. The Graph RBAC Management Client. */ -package com.azure.resourcemanager.authorization.fluent; diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/ActiveDirectoryApplicationImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/ActiveDirectoryApplicationImpl.java deleted file mode 100644 index ee578e8989f8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/ActiveDirectoryApplicationImpl.java +++ /dev/null @@ -1,317 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.authorization.implementation; - -import com.azure.resourcemanager.authorization.AuthorizationManager; -import com.azure.resourcemanager.authorization.models.ActiveDirectoryApplication; -import com.azure.resourcemanager.authorization.models.ApplicationCreateParameters; -import com.azure.resourcemanager.authorization.models.ApplicationUpdateParameters; -import com.azure.resourcemanager.authorization.models.CertificateCredential; -import com.azure.resourcemanager.authorization.models.PasswordCredential; -import com.azure.resourcemanager.authorization.fluent.models.ApplicationInner; -import com.azure.resourcemanager.authorization.fluent.models.KeyCredentialInner; -import com.azure.resourcemanager.authorization.fluent.models.PasswordCredentialInner; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.CreatableUpdatableImpl; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.function.Function; -import reactor.core.publisher.Mono; - -/** Implementation for ServicePrincipal and its parent interfaces. */ -class ActiveDirectoryApplicationImpl - extends CreatableUpdatableImpl - implements ActiveDirectoryApplication, - ActiveDirectoryApplication.Definition, - ActiveDirectoryApplication.Update, - HasCredential { - private AuthorizationManager manager; - private ApplicationCreateParameters createParameters; - private ApplicationUpdateParameters updateParameters; - private Map cachedPasswordCredentials; - private Map cachedCertificateCredentials; - - ActiveDirectoryApplicationImpl(ApplicationInner innerObject, AuthorizationManager manager) { - super(innerObject.displayName(), innerObject); - this.manager = manager; - this.createParameters = new ApplicationCreateParameters().withDisplayName(innerObject.displayName()); - this.updateParameters = new ApplicationUpdateParameters().withDisplayName(innerObject.displayName()); - } - - @Override - public boolean isInCreateMode() { - return this.id() == null; - } - - @Override - public Mono createResourceAsync() { - if (createParameters.identifierUris() == null) { - createParameters.withIdentifierUris(new ArrayList()); - createParameters.identifierUris().add(createParameters.homepage()); - } - return manager - .serviceClient() - .getApplications() - .createAsync(this.manager.tenantId(), createParameters) - .map(innerToFluentMap(this)) - .flatMap(application -> refreshCredentialsAsync()); - } - - @Override - public Mono updateResourceAsync() { - return manager.serviceClient().getApplications().patchAsync( - id(), this.manager.tenantId(), updateParameters).then(Mono.just(this)); - } - - Mono refreshCredentialsAsync() { - final Mono keyCredentials = - manager - .serviceClient() - .getApplications() - .listKeyCredentialsAsync(id(), this.manager.tenantId()) - .map( - (Function) - keyCredentialInner -> - new CertificateCredentialImpl(keyCredentialInner)) - .collectMap(certificateCredential -> certificateCredential.name()) - .map( - stringCertificateCredentialMap -> { - ActiveDirectoryApplicationImpl.this.cachedCertificateCredentials = - stringCertificateCredentialMap; - return ActiveDirectoryApplicationImpl.this; - }); - - final Mono passwordCredentials = - manager - .serviceClient() - .getApplications() - .listPasswordCredentialsAsync(id(), this.manager.tenantId()) - .map( - (Function) - passwordCredentialInner -> - new PasswordCredentialImpl(passwordCredentialInner)) - .collectMap(passwordCredential -> passwordCredential.name()) - .map( - stringPasswordCredentialMap -> { - ActiveDirectoryApplicationImpl.this.cachedPasswordCredentials = stringPasswordCredentialMap; - return ActiveDirectoryApplicationImpl.this; - }); - - return keyCredentials.mergeWith(passwordCredentials).last(); - } - - @Override - public Mono refreshAsync() { - return getInnerAsync().map(innerToFluentMap(this)).flatMap(application -> refreshCredentialsAsync()); - } - - @Override - public String applicationId() { - return innerModel().appId(); - } - - @Override - public List applicationPermissions() { - if (innerModel().appPermissions() == null) { - return null; - } - return Collections.unmodifiableList(innerModel().appPermissions()); - } - - @Override - public boolean availableToOtherTenants() { - return innerModel().availableToOtherTenants(); - } - - @Override - public Set identifierUris() { - if (innerModel().identifierUris() == null) { - return null; - } - return Collections.unmodifiableSet(new HashSet<>(innerModel().identifierUris())); - } - - @Override - public Set replyUrls() { - if (innerModel().replyUrls() == null) { - return null; - } - return Collections.unmodifiableSet(new HashSet<>(innerModel().replyUrls())); - } - - @Override - public URL signOnUrl() { - try { - return new URL(innerModel().homepage()); - } catch (MalformedURLException e) { - return null; - } - } - - @Override - public Map passwordCredentials() { - if (cachedPasswordCredentials == null) { - return null; - } - return Collections.unmodifiableMap(cachedPasswordCredentials); - } - - @Override - public Map certificateCredentials() { - if (cachedCertificateCredentials == null) { - return null; - } - return Collections.unmodifiableMap(cachedCertificateCredentials); - } - - @Override - protected Mono getInnerAsync() { - return manager.serviceClient().getApplications().getAsync(id(), this.manager.tenantId()); - } - - @Override - public ActiveDirectoryApplicationImpl withSignOnUrl(String signOnUrl) { - if (isInCreateMode()) { - createParameters.withHomepage(signOnUrl); - } else { - updateParameters.withHomepage(signOnUrl); - } - return withReplyUrl(signOnUrl); - } - - @Override - public ActiveDirectoryApplicationImpl withReplyUrl(String replyUrl) { - if (isInCreateMode()) { - if (createParameters.replyUrls() == null) { - createParameters.withReplyUrls(new ArrayList<>()); - } - createParameters.replyUrls().add(replyUrl); - } else { - if (updateParameters.replyUrls() == null) { - updateParameters.withReplyUrls(new ArrayList<>(replyUrls())); - } - updateParameters.replyUrls().add(replyUrl); - } - return this; - } - - @Override - public ActiveDirectoryApplicationImpl withoutReplyUrl(String replyUrl) { - if (updateParameters.replyUrls() != null) { - updateParameters.replyUrls().remove(replyUrl); - } - return this; - } - - @Override - public ActiveDirectoryApplicationImpl withIdentifierUrl(String identifierUrl) { - if (isInCreateMode()) { - if (createParameters.identifierUris() == null) { - createParameters.withIdentifierUris(new ArrayList<>()); - } - createParameters.identifierUris().add(identifierUrl); - } else { - if (updateParameters.identifierUris() == null) { - updateParameters.withIdentifierUris(new ArrayList<>(identifierUris())); - } - updateParameters.identifierUris().add(identifierUrl); - } - return this; - } - - @Override - public Update withoutIdentifierUrl(String identifierUrl) { - if (updateParameters.identifierUris() != null) { - updateParameters.identifierUris().remove(identifierUrl); - } - return this; - } - - @Override - public CertificateCredentialImpl defineCertificateCredential(String name) { - return new CertificateCredentialImpl<>(name, this); - } - - @Override - public PasswordCredentialImpl definePasswordCredential(String name) { - return new PasswordCredentialImpl<>(name, this); - } - - @Override - public ActiveDirectoryApplicationImpl withoutCredential(final String name) { - if (cachedPasswordCredentials.containsKey(name)) { - cachedPasswordCredentials.remove(name); - List updatePasswordCredentials = new ArrayList<>(); - for (PasswordCredential passwordCredential : cachedPasswordCredentials.values()) { - updatePasswordCredentials.add(passwordCredential.innerModel()); - } - updateParameters.withPasswordCredentials(updatePasswordCredentials); - } else if (cachedCertificateCredentials.containsKey(name)) { - cachedCertificateCredentials.remove(name); - List updateCertificateCredentials = new ArrayList<>(); - for (CertificateCredential certificateCredential : cachedCertificateCredentials.values()) { - updateCertificateCredentials.add(certificateCredential.innerModel()); - } - updateParameters.withKeyCredentials(updateCertificateCredentials); - } - return this; - } - - @Override - public ActiveDirectoryApplicationImpl withCertificateCredential(CertificateCredentialImpl credential) { - if (isInCreateMode()) { - if (createParameters.keyCredentials() == null) { - createParameters.withKeyCredentials(new ArrayList<>()); - } - createParameters.keyCredentials().add(credential.innerModel()); - } else { - if (updateParameters.keyCredentials() == null) { - updateParameters.withKeyCredentials(new ArrayList<>()); - } - updateParameters.keyCredentials().add(credential.innerModel()); - } - return this; - } - - @Override - public ActiveDirectoryApplicationImpl withPasswordCredential(PasswordCredentialImpl credential) { - if (isInCreateMode()) { - if (createParameters.passwordCredentials() == null) { - createParameters.withPasswordCredentials(new ArrayList<>()); - } - createParameters.passwordCredentials().add(credential.innerModel()); - } else { - if (updateParameters.passwordCredentials() == null) { - updateParameters.withPasswordCredentials(new ArrayList<>()); - } - updateParameters.passwordCredentials().add(credential.innerModel()); - } - return this; - } - - @Override - public ActiveDirectoryApplicationImpl withAvailableToOtherTenants(boolean availableToOtherTenants) { - if (isInCreateMode()) { - createParameters.withAvailableToOtherTenants(availableToOtherTenants); - } else { - updateParameters.withAvailableToOtherTenants(availableToOtherTenants); - } - return this; - } - - @Override - public String id() { - return innerModel().objectId(); - } - - @Override - public AuthorizationManager manager() { - return this.manager; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/ActiveDirectoryApplicationsImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/ActiveDirectoryApplicationsImpl.java deleted file mode 100644 index 56faa5d72875..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/ActiveDirectoryApplicationsImpl.java +++ /dev/null @@ -1,130 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.authorization.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.authorization.AuthorizationManager; -import com.azure.resourcemanager.authorization.models.ActiveDirectoryApplication; -import com.azure.resourcemanager.authorization.models.ActiveDirectoryApplications; -import com.azure.resourcemanager.authorization.fluent.models.ApplicationInner; -import com.azure.resourcemanager.authorization.fluent.ApplicationsClient; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.CreatableResourcesImpl; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import java.util.UUID; - -import com.azure.resourcemanager.resources.fluentcore.utils.PagedConverter; -import reactor.core.publisher.Mono; - -/** The implementation of Applications and its parent interfaces. */ -public class ActiveDirectoryApplicationsImpl - extends CreatableResourcesImpl - implements ActiveDirectoryApplications, HasManager { - private ApplicationsClient innerCollection; - private AuthorizationManager manager; - - public ActiveDirectoryApplicationsImpl( - final ApplicationsClient client, final AuthorizationManager authorizationManager) { - this.innerCollection = client; - this.manager = authorizationManager; - } - - @Override - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - @Override - public PagedFlux listAsync() { - return PagedConverter.flatMapPage(inner().listAsync(this.manager.tenantId()), applicationInner -> { - ActiveDirectoryApplicationImpl application = this.wrapModel(applicationInner); - return application.refreshCredentialsAsync().thenReturn(application); - }); - } - - @Override - protected ActiveDirectoryApplicationImpl wrapModel(ApplicationInner applicationInner) { - if (applicationInner == null) { - return null; - } - return new ActiveDirectoryApplicationImpl(applicationInner, manager()); - } - - @Override - public ActiveDirectoryApplicationImpl getById(String id) { - return (ActiveDirectoryApplicationImpl) getByIdAsync(id).block(); - } - - @Override - public Mono getByIdAsync(String id) { - return innerCollection - .getAsync(id, this.manager.tenantId()) - .flatMap( - applicationInner -> - new ActiveDirectoryApplicationImpl(applicationInner, manager()).refreshCredentialsAsync()); - } - - @Override - public ActiveDirectoryApplication getByName(String spn) { - return getByNameAsync(spn).block(); - } - - @Override - public Mono getByNameAsync(String name) { - final String trimmed = name.replaceFirst("^'+", "").replaceAll("'+$", ""); - return inner() - .listAsync(this.manager.tenantId(), String.format("displayName eq '%s'", trimmed)) - .singleOrEmpty() - .switchIfEmpty(Mono.defer(() -> { - try { - UUID.fromString(trimmed); - } catch (IllegalArgumentException e) { - return Mono.empty(); - } - - return inner() - .listAsync(this.manager.tenantId(), String.format("appId eq '%s'", trimmed)) - .singleOrEmpty(); - })) - .map(applicationInner -> new ActiveDirectoryApplicationImpl(applicationInner, manager())) - .flatMap(activeDirectoryApplication -> activeDirectoryApplication.refreshCredentialsAsync()); - } - - @Override - protected ActiveDirectoryApplicationImpl wrapModel(String name) { - return new ActiveDirectoryApplicationImpl(new ApplicationInner().withDisplayName(name), manager()); - } - - @Override - public Mono deleteByIdAsync(String id) { - return inner().deleteAsync(id, this.manager.tenantId()); - } - - @Override - public ActiveDirectoryApplicationImpl define(String name) { - return wrapModel(name); - } - - @Override - public AuthorizationManager manager() { - return this.manager; - } - - public ApplicationsClient inner() { - return this.innerCollection; - } - - @Override - public PagedIterable listByFilter(String filter) { - return new PagedIterable<>(listByFilterAsync(filter)); - } - - @Override - public PagedFlux listByFilterAsync(String filter) { - return PagedConverter.flatMapPage(inner().listAsync(this.manager.tenantId(), filter), applicationInner -> { - ActiveDirectoryApplicationImpl application = this.wrapModel(applicationInner); - return application.refreshCredentialsAsync().thenReturn(application); - }); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/ActiveDirectoryGroupImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/ActiveDirectoryGroupImpl.java deleted file mode 100644 index 3a1e79195db4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/ActiveDirectoryGroupImpl.java +++ /dev/null @@ -1,210 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.authorization.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.resourcemanager.authorization.AuthorizationManager; -import com.azure.resourcemanager.authorization.fluent.models.ADGroupInner; -import com.azure.resourcemanager.authorization.fluent.models.ApplicationInner; -import com.azure.resourcemanager.authorization.fluent.models.ServicePrincipalInner; -import com.azure.resourcemanager.authorization.fluent.models.UserInner; -import com.azure.resourcemanager.authorization.models.ActiveDirectoryGroup; -import com.azure.resourcemanager.authorization.models.ActiveDirectoryObject; -import com.azure.resourcemanager.authorization.models.ActiveDirectoryUser; -import com.azure.resourcemanager.authorization.models.GroupAddMemberParameters; -import com.azure.resourcemanager.authorization.models.GroupCreateParameters; -import com.azure.resourcemanager.authorization.models.ServicePrincipal; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.CreatableUpdatableImpl; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -/** Implementation for Group and its parent interfaces. */ -class ActiveDirectoryGroupImpl - extends CreatableUpdatableImpl - implements ActiveDirectoryGroup, ActiveDirectoryGroup.Definition, ActiveDirectoryGroup.Update { - - private final AuthorizationManager manager; - private GroupCreateParameters createParameters; - private Set membersToAdd; - private Set membersToRemove; - - ActiveDirectoryGroupImpl(ADGroupInner innerModel, AuthorizationManager manager) { - super(innerModel.displayName(), innerModel); - this.manager = manager; - this.createParameters = - new GroupCreateParameters() - .withDisplayName(innerModel.displayName()) - .withMailEnabled(false) - .withSecurityEnabled(true); - membersToAdd = new HashSet<>(); - membersToRemove = new HashSet<>(); - } - - @Override - public boolean securityEnabled() { - return ResourceManagerUtils.toPrimitiveBoolean(innerModel().securityEnabled()); - } - - @Override - public String mail() { - return innerModel().mail(); - } - - @Override - public List listMembers() { - return listMembersAsync().collectList().block(); - } - - @Override - public PagedFlux listMembersAsync() { - return manager() - .serviceClient() - .getGroups() - .getGroupMembersAsync(id(), this.manager.tenantId()) - .mapPage( - directoryObjectInner -> { - if (directoryObjectInner instanceof UserInner) { - return new ActiveDirectoryUserImpl((UserInner) directoryObjectInner, manager()); - } else if (directoryObjectInner instanceof ADGroupInner) { - return new ActiveDirectoryGroupImpl((ADGroupInner) directoryObjectInner, manager()); - } else if (directoryObjectInner instanceof ServicePrincipalInner) { - return new ServicePrincipalImpl((ServicePrincipalInner) directoryObjectInner, manager()); - } else if (directoryObjectInner instanceof ApplicationInner) { - return new ActiveDirectoryApplicationImpl((ApplicationInner) directoryObjectInner, manager()); - } else { - return null; - } - }); - } - - @Override - protected Mono getInnerAsync() { - return manager().serviceClient().getGroups().getAsync(id(), this.manager.tenantId()); - } - - @Override - public boolean isInCreateMode() { - return id() == null; - } - - @Override - public Mono createResourceAsync() { - Mono group = Mono.just(this); - if (isInCreateMode()) { - group = manager() - .serviceClient() - .getGroups() - .createAsync(this.manager.tenantId(), createParameters) - .map(innerToFluentMap(this)); - } - if (!membersToRemove.isEmpty()) { - group = - group - .flatMap( - o -> - Flux - .fromIterable(membersToRemove) - .flatMap(s -> manager() - .serviceClient() - .getGroups() - .removeMemberAsync(id(), s, this.manager.tenantId())) - .singleOrEmpty() - .thenReturn(Mono.just(this)) - .doFinally(signalType -> membersToRemove.clear())); - } - if (!membersToAdd.isEmpty()) { - group = - group - .flatMap( - o -> - Flux - .fromIterable(membersToAdd) - .flatMap(s -> manager() - .serviceClient() - .getGroups() - .addMemberAsync( - id(), - this.manager.tenantId(), - new GroupAddMemberParameters().withUrl(s))) - .singleOrEmpty() - .thenReturn(Mono.just(this)) - .doFinally(signalType -> membersToAdd.clear())); - } - return group.map(o -> ActiveDirectoryGroupImpl.this); - } - - @Override - public ActiveDirectoryGroupImpl withEmailAlias(String mailNickname) { - // User providing domain - if (mailNickname.contains("@")) { - String[] parts = mailNickname.split("@"); - // domainName = parts[1]; // no use - mailNickname = parts[0]; - } - createParameters.withMailNickname(mailNickname); - return this; - } - - @Override - public ActiveDirectoryGroupImpl withMember(String objectId) { - membersToAdd - .add( - String.format( - "%s%s/directoryObjects/%s", - manager().serviceClient().getEndpoint(), manager().tenantId(), - objectId)); - return this; - } - - @Override - public ActiveDirectoryGroupImpl withMember(ActiveDirectoryUser user) { - return withMember(user.id()); - } - - @Override - public ActiveDirectoryGroupImpl withMember(ActiveDirectoryGroup group) { - return withMember(group.id()); - } - - @Override - public ActiveDirectoryGroupImpl withMember(ServicePrincipal servicePrincipal) { - return withMember(servicePrincipal.id()); - } - - @Override - public ActiveDirectoryGroupImpl withoutMember(String objectId) { - membersToRemove.add(objectId); - return this; - } - - @Override - public ActiveDirectoryGroupImpl withoutMember(ActiveDirectoryUser user) { - return withoutMember(user.id()); - } - - @Override - public ActiveDirectoryGroupImpl withoutMember(ActiveDirectoryGroup group) { - return withoutMember(group.id()); - } - - @Override - public ActiveDirectoryGroupImpl withoutMember(ServicePrincipal servicePrincipal) { - return withoutMember(servicePrincipal.id()); - } - - @Override - public String id() { - return innerModel().objectId(); - } - - @Override - public AuthorizationManager manager() { - return this.manager; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/ActiveDirectoryGroupsImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/ActiveDirectoryGroupsImpl.java deleted file mode 100644 index 98430c9a7589..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/ActiveDirectoryGroupsImpl.java +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.authorization.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.authorization.AuthorizationManager; -import com.azure.resourcemanager.authorization.models.ActiveDirectoryGroup; -import com.azure.resourcemanager.authorization.models.ActiveDirectoryGroups; -import com.azure.resourcemanager.authorization.fluent.models.ADGroupInner; -import com.azure.resourcemanager.authorization.fluent.GroupsClient; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.CreatableWrappersImpl; -import reactor.core.publisher.Mono; - -/** The implementation of Users and its parent interfaces. */ -public class ActiveDirectoryGroupsImpl - extends CreatableWrappersImpl - implements ActiveDirectoryGroups { - private final AuthorizationManager manager; - - public ActiveDirectoryGroupsImpl(final AuthorizationManager manager) { - this.manager = manager; - } - - @Override - public PagedIterable list() { - return wrapList(this.manager.serviceClient().getGroups().list(this.manager.tenantId())); - } - - @Override - protected ActiveDirectoryGroupImpl wrapModel(ADGroupInner groupInner) { - if (groupInner == null) { - return null; - } - return new ActiveDirectoryGroupImpl(groupInner, manager()); - } - - @Override - public ActiveDirectoryGroupImpl getById(String objectId) { - return (ActiveDirectoryGroupImpl) getByIdAsync(objectId).block(); - } - - @Override - public Mono getByIdAsync(String id) { - return manager - .serviceClient() - .getGroups() - .getAsync(id, this.manager.tenantId()) - .map(groupInner -> new ActiveDirectoryGroupImpl(groupInner, manager())); - } - - @Override - public PagedFlux listAsync() { - return wrapPageAsync(manager().serviceClient().getGroups().listAsync(this.manager.tenantId(), null)); - } - - @Override - public Mono getByNameAsync(String name) { - return manager() - .serviceClient() - .getGroups() - .listAsync(this.manager.tenantId(), String.format("displayName eq '%s'", name)) - .singleOrEmpty() - .map(adGroupInner -> new ActiveDirectoryGroupImpl(adGroupInner, manager())); - } - - @Override - public ActiveDirectoryGroup getByName(String name) { - return getByNameAsync(name).block(); - } - - @Override - public ActiveDirectoryGroupImpl define(String name) { - return wrapModel(name); - } - - @Override - protected ActiveDirectoryGroupImpl wrapModel(String name) { - return wrapModel(new ADGroupInner().withDisplayName(name)); - } - - @Override - public Mono deleteByIdAsync(String id) { - return manager().serviceClient().getGroups().deleteAsync(id, this.manager.tenantId()); - } - - @Override - public AuthorizationManager manager() { - return this.manager; - } - - public GroupsClient inner() { - return manager().serviceClient().getGroups(); - } - - @Override - public PagedIterable listByFilter(String filter) { - return new PagedIterable<>(listByFilterAsync(filter)); - } - - @Override - public PagedFlux listByFilterAsync(String filter) { - return inner().listAsync(this.manager.tenantId(), filter).mapPage(this::wrapModel); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/ActiveDirectoryUserImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/ActiveDirectoryUserImpl.java deleted file mode 100644 index 1c49ecb1a513..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/ActiveDirectoryUserImpl.java +++ /dev/null @@ -1,170 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.authorization.implementation; - -import com.azure.resourcemanager.authorization.AuthorizationManager; -import com.azure.resourcemanager.authorization.models.ActiveDirectoryUser; -import com.azure.resourcemanager.authorization.models.PasswordProfile; -import com.azure.resourcemanager.authorization.models.UserCreateParameters; -import com.azure.resourcemanager.authorization.models.UserUpdateParameters; -import com.azure.resourcemanager.authorization.fluent.models.UserInner; -import com.azure.resourcemanager.resources.fluentcore.arm.CountryIsoCode; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.CreatableUpdatableImpl; -import reactor.core.publisher.Mono; - -/** Implementation for User and its parent interfaces. */ -class ActiveDirectoryUserImpl extends CreatableUpdatableImpl - implements ActiveDirectoryUser, ActiveDirectoryUser.Definition, ActiveDirectoryUser.Update { - - private final AuthorizationManager manager; - private UserCreateParameters createParameters; - private UserUpdateParameters updateParameters; - private String emailAlias; - - ActiveDirectoryUserImpl(UserInner innerObject, AuthorizationManager manager) { - super(innerObject.displayName(), innerObject); - this.manager = manager; - this.createParameters = new UserCreateParameters().withDisplayName(name()).withAccountEnabled(true); - this.updateParameters = new UserUpdateParameters().withDisplayName(name()); - } - - @Override - public String userPrincipalName() { - return innerModel().userPrincipalName(); - } - - @Override - public String signInName() { - if (innerModel().signInNames() != null && !innerModel().signInNames().isEmpty()) { - return innerModel().signInNames().get(0).value(); - } else { - return null; - } - } - - @Override - public String mail() { - return innerModel().mail(); - } - - @Override - public String mailNickname() { - return innerModel().mailNickname(); - } - - @Override - public CountryIsoCode usageLocation() { - return CountryIsoCode.fromString(innerModel().usageLocation()); - } - - @Override - public ActiveDirectoryUserImpl withUserPrincipalName(String userPrincipalName) { - createParameters.withUserPrincipalName(userPrincipalName); - if (isInCreateMode() || updateParameters.mailNickname() != null) { - withMailNickname(userPrincipalName.replaceAll("@.+$", "")); - } - return this; - } - - @Override - public ActiveDirectoryUserImpl withEmailAlias(String emailAlias) { - this.emailAlias = emailAlias; - return this; - } - - @Override - public ActiveDirectoryUserImpl withPassword(String password) { - createParameters.withPasswordProfile(new PasswordProfile().withPassword(password)); - updateParameters.withPasswordProfile(new PasswordProfile().withPassword(password)); - return this; - } - - @Override - protected Mono getInnerAsync() { - return manager.serviceClient().getUsers().getAsync(this.id(), this.manager.tenantId()); - } - - @Override - public boolean isInCreateMode() { - return id() == null; - } - - @Override - public Mono createResourceAsync() { - Mono domain = null; - if (emailAlias != null) { - domain = - manager() - .serviceClient() - .getDomains() - .listAsync(this.manager.tenantId()) - .map( - domainInner -> { - if (domainInner.isVerified() && domainInner.isDefault()) { - if (emailAlias != null) { - withUserPrincipalName(emailAlias + "@" + domainInner.name()); - } - } - return Mono.just(ActiveDirectoryUserImpl.this); - }) - .blockLast(); - } - if (domain == null) { - domain = Mono.just(this); - } - return domain - .flatMap(activeDirectoryUser -> - manager().serviceClient().getUsers().createAsync(this.manager.tenantId(), createParameters)) - .map(innerToFluentMap(this)); - } - - public Mono updateResourceAsync() { - return manager() - .serviceClient() - .getUsers() - .updateAsync(id(), this.manager.tenantId(), updateParameters) - .then(ActiveDirectoryUserImpl.this.refreshAsync()); - } - - private void withMailNickname(String mailNickname) { - createParameters.withMailNickname(mailNickname); - updateParameters.withMailNickname(mailNickname); - } - - @Override - public ActiveDirectoryUserImpl withPromptToChangePasswordOnLogin(boolean promptToChangePasswordOnLogin) { - createParameters.passwordProfile().withForceChangePasswordNextLogin(promptToChangePasswordOnLogin); - updateParameters.passwordProfile().withForceChangePasswordNextLogin(promptToChangePasswordOnLogin); - return this; - } - - @Override - public String toString() { - return name() + " - " + userPrincipalName(); - } - - @Override - public ActiveDirectoryUserImpl withAccountEnabled(boolean accountEnabled) { - createParameters.withAccountEnabled(accountEnabled); - updateParameters.withAccountEnabled(accountEnabled); - return this; - } - - @Override - public ActiveDirectoryUserImpl withUsageLocation(CountryIsoCode usageLocation) { - createParameters.withUsageLocation(usageLocation.toString()); - updateParameters.withUsageLocation(usageLocation.toString()); - return this; - } - - @Override - public String id() { - return innerModel().objectId(); - } - - @Override - public AuthorizationManager manager() { - return this.manager; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/ActiveDirectoryUsersImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/ActiveDirectoryUsersImpl.java deleted file mode 100644 index 303a750fa1d5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/ActiveDirectoryUsersImpl.java +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.authorization.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.authorization.AuthorizationManager; -import com.azure.resourcemanager.authorization.fluent.UsersClient; -import com.azure.resourcemanager.authorization.fluent.models.UserInner; -import com.azure.resourcemanager.authorization.models.ActiveDirectoryUser; -import com.azure.resourcemanager.authorization.models.ActiveDirectoryUsers; -import com.azure.resourcemanager.authorization.models.GraphErrorException; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.CreatableWrappersImpl; -import reactor.core.publisher.Mono; - -/** The implementation of Users and its parent interfaces. */ -public class ActiveDirectoryUsersImpl - extends CreatableWrappersImpl - implements ActiveDirectoryUsers { - private final AuthorizationManager manager; - - public ActiveDirectoryUsersImpl(final AuthorizationManager manager) { - this.manager = manager; - } - - @Override - public PagedIterable list() { - return wrapList(this.manager().serviceClient().getUsers().list(this.manager.tenantId())); - } - - @Override - protected ActiveDirectoryUserImpl wrapModel(UserInner userInner) { - if (userInner == null) { - return null; - } - return new ActiveDirectoryUserImpl(userInner, manager()); - } - - @Override - public ActiveDirectoryUserImpl getById(String objectId) { - return (ActiveDirectoryUserImpl) getByIdAsync(objectId).block(); - } - - @Override - public Mono getByIdAsync(String id) { - return manager() - .serviceClient() - .getUsers() - .getAsync(id, this.manager.tenantId()) - .map(userInner -> new ActiveDirectoryUserImpl(userInner, manager())); - } - - @Override - public ActiveDirectoryUserImpl getByName(String upn) { - return (ActiveDirectoryUserImpl) getByNameAsync(upn).block(); - } - - @Override - public Mono getByNameAsync(final String name) { - return manager() - .serviceClient() - .getUsers() - .getAsync(name, this.manager.tenantId()) - .onErrorResume( - GraphErrorException.class, - e -> manager() - .serviceClient() - .getUsers() - .listAsync( - this.manager.tenantId(), - name.contains("@") - ? String.format("mail eq '%s' or mailNickName eq '%s#EXT#'", name, name.replace("@", "_")) - : String.format("displayName eq '%s'", name), - null, - null) - .singleOrEmpty()) - .map(userInner -> new ActiveDirectoryUserImpl(userInner, manager())); - } - - @Override - public PagedFlux listAsync() { - return wrapPageAsync(this.inner().listAsync(this.manager.tenantId())); - } - - @Override - public ActiveDirectoryUserImpl define(String name) { - return wrapModel(name); - } - - @Override - protected ActiveDirectoryUserImpl wrapModel(String name) { - return new ActiveDirectoryUserImpl(new UserInner().withDisplayName(name), manager()); - } - - @Override - public Mono deleteByIdAsync(String id) { - return manager().serviceClient().getUsers().deleteAsync(id, this.manager.tenantId()); - } - - @Override - public AuthorizationManager manager() { - return this.manager; - } - - public UsersClient inner() { - return manager().serviceClient().getUsers(); - } - - @Override - public PagedIterable listByFilter(String filter) { - return new PagedIterable<>(listByFilterAsync(filter)); - } - - @Override - public PagedFlux listByFilterAsync(String filter) { - return inner().listAsync(this.manager.tenantId(), filter, null, null).mapPage(this::wrapModel); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/ApplicationsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/ApplicationsClientImpl.java deleted file mode 100644 index 6346ce8defd6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/ApplicationsClientImpl.java +++ /dev/null @@ -1,2267 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.authorization.fluent.ApplicationsClient; -import com.azure.resourcemanager.authorization.fluent.models.ApplicationInner; -import com.azure.resourcemanager.authorization.fluent.models.DirectoryObjectInner; -import com.azure.resourcemanager.authorization.fluent.models.KeyCredentialInner; -import com.azure.resourcemanager.authorization.fluent.models.PasswordCredentialInner; -import com.azure.resourcemanager.authorization.fluent.models.ServicePrincipalObjectResultInner; -import com.azure.resourcemanager.authorization.models.AddOwnerParameters; -import com.azure.resourcemanager.authorization.models.ApplicationCreateParameters; -import com.azure.resourcemanager.authorization.models.ApplicationListResult; -import com.azure.resourcemanager.authorization.models.ApplicationUpdateParameters; -import com.azure.resourcemanager.authorization.models.DirectoryObjectListResult; -import com.azure.resourcemanager.authorization.models.GraphErrorException; -import com.azure.resourcemanager.authorization.models.KeyCredentialListResult; -import com.azure.resourcemanager.authorization.models.KeyCredentialsUpdateParameters; -import com.azure.resourcemanager.authorization.models.PasswordCredentialListResult; -import com.azure.resourcemanager.authorization.models.PasswordCredentialsUpdateParameters; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ApplicationsClient. */ -public final class ApplicationsClientImpl implements InnerSupportsDelete, ApplicationsClient { - private final ClientLogger logger = new ClientLogger(ApplicationsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final ApplicationsService service; - - /** The service client containing this operation class. */ - private final GraphRbacManagementClientImpl client; - - /** - * Initializes an instance of ApplicationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ApplicationsClientImpl(GraphRbacManagementClientImpl client) { - this.service = - RestProxy.create(ApplicationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for GraphRbacManagementClientApplications to be used by the proxy service - * to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "GraphRbacManagementC") - private interface ApplicationsService { - @Headers({"Content-Type: application/json"}) - @Post("/{tenantID}/applications") - @ExpectedResponses({201}) - @UnexpectedResponseExceptionType(GraphErrorException.class) - Mono> create( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("tenantID") String tenantId, - @BodyParam("application/json") ApplicationCreateParameters parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/{tenantID}/applications") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(GraphErrorException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("$filter") String filter, - @QueryParam("api-version") String apiVersion, - @PathParam("tenantID") String tenantId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete("/{tenantID}/applications/{applicationObjectId}") - @ExpectedResponses({204}) - @UnexpectedResponseExceptionType(GraphErrorException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @PathParam("applicationObjectId") String applicationObjectId, - @QueryParam("api-version") String apiVersion, - @PathParam("tenantID") String tenantId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/{tenantID}/applications/{applicationObjectId}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(GraphErrorException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("applicationObjectId") String applicationObjectId, - @QueryParam("api-version") String apiVersion, - @PathParam("tenantID") String tenantId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch("/{tenantID}/applications/{applicationObjectId}") - @ExpectedResponses({204}) - @UnexpectedResponseExceptionType(GraphErrorException.class) - Mono> patch( - @HostParam("$host") String endpoint, - @PathParam("applicationObjectId") String applicationObjectId, - @QueryParam("api-version") String apiVersion, - @PathParam("tenantID") String tenantId, - @BodyParam("application/json") ApplicationUpdateParameters parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/{tenantID}/applications/{applicationObjectId}/owners") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(GraphErrorException.class) - Mono> listOwners( - @HostParam("$host") String endpoint, - @PathParam("applicationObjectId") String applicationObjectId, - @QueryParam("api-version") String apiVersion, - @PathParam("tenantID") String tenantId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post("/{tenantID}/applications/{applicationObjectId}/$links/owners") - @ExpectedResponses({204}) - @UnexpectedResponseExceptionType(GraphErrorException.class) - Mono> addOwner( - @HostParam("$host") String endpoint, - @PathParam("applicationObjectId") String applicationObjectId, - @QueryParam("api-version") String apiVersion, - @PathParam("tenantID") String tenantId, - @BodyParam("application/json") AddOwnerParameters parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete("/{tenantID}/applications/{applicationObjectId}/$links/owners/{ownerObjectId}") - @ExpectedResponses({204}) - @UnexpectedResponseExceptionType(GraphErrorException.class) - Mono> removeOwner( - @HostParam("$host") String endpoint, - @PathParam("applicationObjectId") String applicationObjectId, - @PathParam("ownerObjectId") String ownerObjectId, - @QueryParam("api-version") String apiVersion, - @PathParam("tenantID") String tenantId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/{tenantID}/applications/{applicationObjectId}/keyCredentials") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(GraphErrorException.class) - Mono> listKeyCredentials( - @HostParam("$host") String endpoint, - @PathParam("applicationObjectId") String applicationObjectId, - @QueryParam("api-version") String apiVersion, - @PathParam("tenantID") String tenantId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch("/{tenantID}/applications/{applicationObjectId}/keyCredentials") - @ExpectedResponses({204}) - @UnexpectedResponseExceptionType(GraphErrorException.class) - Mono> updateKeyCredentials( - @HostParam("$host") String endpoint, - @PathParam("applicationObjectId") String applicationObjectId, - @QueryParam("api-version") String apiVersion, - @PathParam("tenantID") String tenantId, - @BodyParam("application/json") KeyCredentialsUpdateParameters parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/{tenantID}/applications/{applicationObjectId}/passwordCredentials") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(GraphErrorException.class) - Mono> listPasswordCredentials( - @HostParam("$host") String endpoint, - @PathParam("applicationObjectId") String applicationObjectId, - @QueryParam("api-version") String apiVersion, - @PathParam("tenantID") String tenantId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch("/{tenantID}/applications/{applicationObjectId}/passwordCredentials") - @ExpectedResponses({204}) - @UnexpectedResponseExceptionType(GraphErrorException.class) - Mono> updatePasswordCredentials( - @HostParam("$host") String endpoint, - @PathParam("applicationObjectId") String applicationObjectId, - @QueryParam("api-version") String apiVersion, - @PathParam("tenantID") String tenantId, - @BodyParam("application/json") PasswordCredentialsUpdateParameters parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/{tenantID}/servicePrincipalsByAppId/{applicationID}/objectId") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(GraphErrorException.class) - Mono> getServicePrincipalsIdByAppId( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("tenantID") String tenantId, - @PathParam("applicationID") String applicationId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/{tenantID}/{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(GraphErrorException.class) - Mono> listNext( - @HostParam("$host") String endpoint, - @PathParam(value = "nextLink", encoded = true) String nextLink, - @QueryParam("api-version") String apiVersion, - @PathParam("tenantID") String tenantId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(GraphErrorException.class) - Mono> listOwnersNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Create a new application. - * - * @param tenantId The tenant ID. - * @param parameters The parameters for creating an application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return active Directory application information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createWithResponseAsync( - String tenantId, ApplicationCreateParameters parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .create( - this.client.getEndpoint(), - this.client.getApiVersion(), - tenantId, - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create a new application. - * - * @param tenantId The tenant ID. - * @param parameters The parameters for creating an application. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return active Directory application information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync( - String tenantId, ApplicationCreateParameters parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .create(this.client.getEndpoint(), this.client.getApiVersion(), tenantId, parameters, accept, context); - } - - /** - * Create a new application. - * - * @param tenantId The tenant ID. - * @param parameters The parameters for creating an application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return active Directory application information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createAsync(String tenantId, ApplicationCreateParameters parameters) { - return createWithResponseAsync(tenantId, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Create a new application. - * - * @param tenantId The tenant ID. - * @param parameters The parameters for creating an application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return active Directory application information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ApplicationInner create(String tenantId, ApplicationCreateParameters parameters) { - return createAsync(tenantId, parameters).block(); - } - - /** - * Create a new application. - * - * @param tenantId The tenant ID. - * @param parameters The parameters for creating an application. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return active Directory application information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse( - String tenantId, ApplicationCreateParameters parameters, Context context) { - return createWithResponseAsync(tenantId, parameters, context).block(); - } - - /** - * Lists applications by filter parameters. - * - * @param tenantId The tenant ID. - * @param filter The filters to apply to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return application list operation result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String tenantId, String filter) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), filter, this.client.getApiVersion(), tenantId, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().odataNextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists applications by filter parameters. - * - * @param tenantId The tenant ID. - * @param filter The filters to apply to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return application list operation result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String tenantId, String filter, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), filter, this.client.getApiVersion(), tenantId, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().odataNextLink(), - null)); - } - - /** - * Lists applications by filter parameters. - * - * @param tenantId The tenant ID. - * @param filter The filters to apply to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return application list operation result. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String tenantId, String filter) { - return new PagedFlux<>( - () -> listSinglePageAsync(tenantId, filter), nextLink -> listNextSinglePageAsync(nextLink, tenantId)); - } - - /** - * Lists applications by filter parameters. - * - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return application list operation result. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String tenantId) { - final String filter = null; - return new PagedFlux<>( - () -> listSinglePageAsync(tenantId, filter), nextLink -> listNextSinglePageAsync(nextLink, tenantId)); - } - - /** - * Lists applications by filter parameters. - * - * @param tenantId The tenant ID. - * @param filter The filters to apply to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return application list operation result. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String tenantId, String filter, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(tenantId, filter, context), - nextLink -> listNextSinglePageAsync(nextLink, tenantId, context)); - } - - /** - * Lists applications by filter parameters. - * - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return application list operation result. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String tenantId) { - final String filter = null; - return new PagedIterable<>(listAsync(tenantId, filter)); - } - - /** - * Lists applications by filter parameters. - * - * @param tenantId The tenant ID. - * @param filter The filters to apply to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return application list operation result. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String tenantId, String filter, Context context) { - return new PagedIterable<>(listAsync(tenantId, filter, context)); - } - - /** - * Delete an application. - * - * @param applicationObjectId Application object ID. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String applicationObjectId, String tenantId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (applicationObjectId == null) { - return Mono - .error(new IllegalArgumentException("Parameter applicationObjectId is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - applicationObjectId, - this.client.getApiVersion(), - tenantId, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete an application. - * - * @param applicationObjectId Application object ID. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String applicationObjectId, String tenantId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (applicationObjectId == null) { - return Mono - .error(new IllegalArgumentException("Parameter applicationObjectId is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), applicationObjectId, this.client.getApiVersion(), tenantId, accept, context); - } - - /** - * Delete an application. - * - * @param applicationObjectId Application object ID. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String applicationObjectId, String tenantId) { - return deleteWithResponseAsync(applicationObjectId, tenantId).flatMap((Response res) -> Mono.empty()); - } - - /** - * Delete an application. - * - * @param applicationObjectId Application object ID. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String applicationObjectId, String tenantId) { - deleteAsync(applicationObjectId, tenantId).block(); - } - - /** - * Delete an application. - * - * @param applicationObjectId Application object ID. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String applicationObjectId, String tenantId, Context context) { - return deleteWithResponseAsync(applicationObjectId, tenantId, context).block(); - } - - /** - * Get an application by object ID. - * - * @param applicationObjectId Application object ID. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an application by object ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync(String applicationObjectId, String tenantId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (applicationObjectId == null) { - return Mono - .error(new IllegalArgumentException("Parameter applicationObjectId is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - applicationObjectId, - this.client.getApiVersion(), - tenantId, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get an application by object ID. - * - * @param applicationObjectId Application object ID. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an application by object ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String applicationObjectId, String tenantId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (applicationObjectId == null) { - return Mono - .error(new IllegalArgumentException("Parameter applicationObjectId is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), applicationObjectId, this.client.getApiVersion(), tenantId, accept, context); - } - - /** - * Get an application by object ID. - * - * @param applicationObjectId Application object ID. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an application by object ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync(String applicationObjectId, String tenantId) { - return getWithResponseAsync(applicationObjectId, tenantId) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get an application by object ID. - * - * @param applicationObjectId Application object ID. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an application by object ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ApplicationInner get(String applicationObjectId, String tenantId) { - return getAsync(applicationObjectId, tenantId).block(); - } - - /** - * Get an application by object ID. - * - * @param applicationObjectId Application object ID. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an application by object ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String applicationObjectId, String tenantId, Context context) { - return getWithResponseAsync(applicationObjectId, tenantId, context).block(); - } - - /** - * Update an existing application. - * - * @param applicationObjectId Application object ID. - * @param tenantId The tenant ID. - * @param parameters Parameters to update an existing application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> patchWithResponseAsync( - String applicationObjectId, String tenantId, ApplicationUpdateParameters parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (applicationObjectId == null) { - return Mono - .error(new IllegalArgumentException("Parameter applicationObjectId is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .patch( - this.client.getEndpoint(), - applicationObjectId, - this.client.getApiVersion(), - tenantId, - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Update an existing application. - * - * @param applicationObjectId Application object ID. - * @param tenantId The tenant ID. - * @param parameters Parameters to update an existing application. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> patchWithResponseAsync( - String applicationObjectId, String tenantId, ApplicationUpdateParameters parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (applicationObjectId == null) { - return Mono - .error(new IllegalArgumentException("Parameter applicationObjectId is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .patch( - this.client.getEndpoint(), - applicationObjectId, - this.client.getApiVersion(), - tenantId, - parameters, - accept, - context); - } - - /** - * Update an existing application. - * - * @param applicationObjectId Application object ID. - * @param tenantId The tenant ID. - * @param parameters Parameters to update an existing application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono patchAsync(String applicationObjectId, String tenantId, ApplicationUpdateParameters parameters) { - return patchWithResponseAsync(applicationObjectId, tenantId, parameters) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Update an existing application. - * - * @param applicationObjectId Application object ID. - * @param tenantId The tenant ID. - * @param parameters Parameters to update an existing application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void patch(String applicationObjectId, String tenantId, ApplicationUpdateParameters parameters) { - patchAsync(applicationObjectId, tenantId, parameters).block(); - } - - /** - * Update an existing application. - * - * @param applicationObjectId Application object ID. - * @param tenantId The tenant ID. - * @param parameters Parameters to update an existing application. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response patchWithResponse( - String applicationObjectId, String tenantId, ApplicationUpdateParameters parameters, Context context) { - return patchWithResponseAsync(applicationObjectId, tenantId, parameters, context).block(); - } - - /** - * The owners are a set of non-admin users who are allowed to modify this object. - * - * @param applicationObjectId The object ID of the application for which to get owners. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return directoryObject list operation result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listOwnersSinglePageAsync( - String applicationObjectId, String tenantId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (applicationObjectId == null) { - return Mono - .error(new IllegalArgumentException("Parameter applicationObjectId is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .listOwners( - this.client.getEndpoint(), - applicationObjectId, - this.client.getApiVersion(), - tenantId, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().odataNextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * The owners are a set of non-admin users who are allowed to modify this object. - * - * @param applicationObjectId The object ID of the application for which to get owners. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return directoryObject list operation result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listOwnersSinglePageAsync( - String applicationObjectId, String tenantId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (applicationObjectId == null) { - return Mono - .error(new IllegalArgumentException("Parameter applicationObjectId is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .listOwners( - this.client.getEndpoint(), applicationObjectId, this.client.getApiVersion(), tenantId, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().odataNextLink(), - null)); - } - - /** - * The owners are a set of non-admin users who are allowed to modify this object. - * - * @param applicationObjectId The object ID of the application for which to get owners. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return directoryObject list operation result. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listOwnersAsync(String applicationObjectId, String tenantId) { - return new PagedFlux<>( - () -> listOwnersSinglePageAsync(applicationObjectId, tenantId), - nextLink -> listOwnersNextSinglePageAsync(nextLink)); - } - - /** - * The owners are a set of non-admin users who are allowed to modify this object. - * - * @param applicationObjectId The object ID of the application for which to get owners. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return directoryObject list operation result. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listOwnersAsync( - String applicationObjectId, String tenantId, Context context) { - return new PagedFlux<>( - () -> listOwnersSinglePageAsync(applicationObjectId, tenantId, context), - nextLink -> listOwnersNextSinglePageAsync(nextLink, context)); - } - - /** - * The owners are a set of non-admin users who are allowed to modify this object. - * - * @param applicationObjectId The object ID of the application for which to get owners. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return directoryObject list operation result. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listOwners(String applicationObjectId, String tenantId) { - return new PagedIterable<>(listOwnersAsync(applicationObjectId, tenantId)); - } - - /** - * The owners are a set of non-admin users who are allowed to modify this object. - * - * @param applicationObjectId The object ID of the application for which to get owners. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return directoryObject list operation result. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listOwners( - String applicationObjectId, String tenantId, Context context) { - return new PagedIterable<>(listOwnersAsync(applicationObjectId, tenantId, context)); - } - - /** - * Add an owner to an application. - * - * @param applicationObjectId The object ID of the application to which to add the owner. - * @param tenantId The tenant ID. - * @param parameters The URL of the owner object, such as - * https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects/f260bbc4-c254-447b-94cf-293b5ec434dd. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> addOwnerWithResponseAsync( - String applicationObjectId, String tenantId, AddOwnerParameters parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (applicationObjectId == null) { - return Mono - .error(new IllegalArgumentException("Parameter applicationObjectId is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .addOwner( - this.client.getEndpoint(), - applicationObjectId, - this.client.getApiVersion(), - tenantId, - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Add an owner to an application. - * - * @param applicationObjectId The object ID of the application to which to add the owner. - * @param tenantId The tenant ID. - * @param parameters The URL of the owner object, such as - * https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects/f260bbc4-c254-447b-94cf-293b5ec434dd. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> addOwnerWithResponseAsync( - String applicationObjectId, String tenantId, AddOwnerParameters parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (applicationObjectId == null) { - return Mono - .error(new IllegalArgumentException("Parameter applicationObjectId is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .addOwner( - this.client.getEndpoint(), - applicationObjectId, - this.client.getApiVersion(), - tenantId, - parameters, - accept, - context); - } - - /** - * Add an owner to an application. - * - * @param applicationObjectId The object ID of the application to which to add the owner. - * @param tenantId The tenant ID. - * @param parameters The URL of the owner object, such as - * https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects/f260bbc4-c254-447b-94cf-293b5ec434dd. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono addOwnerAsync(String applicationObjectId, String tenantId, AddOwnerParameters parameters) { - return addOwnerWithResponseAsync(applicationObjectId, tenantId, parameters) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Add an owner to an application. - * - * @param applicationObjectId The object ID of the application to which to add the owner. - * @param tenantId The tenant ID. - * @param parameters The URL of the owner object, such as - * https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects/f260bbc4-c254-447b-94cf-293b5ec434dd. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void addOwner(String applicationObjectId, String tenantId, AddOwnerParameters parameters) { - addOwnerAsync(applicationObjectId, tenantId, parameters).block(); - } - - /** - * Add an owner to an application. - * - * @param applicationObjectId The object ID of the application to which to add the owner. - * @param tenantId The tenant ID. - * @param parameters The URL of the owner object, such as - * https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects/f260bbc4-c254-447b-94cf-293b5ec434dd. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response addOwnerWithResponse( - String applicationObjectId, String tenantId, AddOwnerParameters parameters, Context context) { - return addOwnerWithResponseAsync(applicationObjectId, tenantId, parameters, context).block(); - } - - /** - * Remove a member from owners. - * - * @param applicationObjectId The object ID of the application from which to remove the owner. - * @param ownerObjectId Owner object id. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> removeOwnerWithResponseAsync( - String applicationObjectId, String ownerObjectId, String tenantId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (applicationObjectId == null) { - return Mono - .error(new IllegalArgumentException("Parameter applicationObjectId is required and cannot be null.")); - } - if (ownerObjectId == null) { - return Mono.error(new IllegalArgumentException("Parameter ownerObjectId is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .removeOwner( - this.client.getEndpoint(), - applicationObjectId, - ownerObjectId, - this.client.getApiVersion(), - tenantId, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Remove a member from owners. - * - * @param applicationObjectId The object ID of the application from which to remove the owner. - * @param ownerObjectId Owner object id. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> removeOwnerWithResponseAsync( - String applicationObjectId, String ownerObjectId, String tenantId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (applicationObjectId == null) { - return Mono - .error(new IllegalArgumentException("Parameter applicationObjectId is required and cannot be null.")); - } - if (ownerObjectId == null) { - return Mono.error(new IllegalArgumentException("Parameter ownerObjectId is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .removeOwner( - this.client.getEndpoint(), - applicationObjectId, - ownerObjectId, - this.client.getApiVersion(), - tenantId, - accept, - context); - } - - /** - * Remove a member from owners. - * - * @param applicationObjectId The object ID of the application from which to remove the owner. - * @param ownerObjectId Owner object id. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono removeOwnerAsync(String applicationObjectId, String ownerObjectId, String tenantId) { - return removeOwnerWithResponseAsync(applicationObjectId, ownerObjectId, tenantId) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Remove a member from owners. - * - * @param applicationObjectId The object ID of the application from which to remove the owner. - * @param ownerObjectId Owner object id. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void removeOwner(String applicationObjectId, String ownerObjectId, String tenantId) { - removeOwnerAsync(applicationObjectId, ownerObjectId, tenantId).block(); - } - - /** - * Remove a member from owners. - * - * @param applicationObjectId The object ID of the application from which to remove the owner. - * @param ownerObjectId Owner object id. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response removeOwnerWithResponse( - String applicationObjectId, String ownerObjectId, String tenantId, Context context) { - return removeOwnerWithResponseAsync(applicationObjectId, ownerObjectId, tenantId, context).block(); - } - - /** - * Get the keyCredentials associated with an application. - * - * @param applicationObjectId Application object ID. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the keyCredentials associated with an application. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listKeyCredentialsSinglePageAsync( - String applicationObjectId, String tenantId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (applicationObjectId == null) { - return Mono - .error(new IllegalArgumentException("Parameter applicationObjectId is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .listKeyCredentials( - this.client.getEndpoint(), - applicationObjectId, - this.client.getApiVersion(), - tenantId, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the keyCredentials associated with an application. - * - * @param applicationObjectId Application object ID. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the keyCredentials associated with an application. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listKeyCredentialsSinglePageAsync( - String applicationObjectId, String tenantId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (applicationObjectId == null) { - return Mono - .error(new IllegalArgumentException("Parameter applicationObjectId is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .listKeyCredentials( - this.client.getEndpoint(), applicationObjectId, this.client.getApiVersion(), tenantId, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); - } - - /** - * Get the keyCredentials associated with an application. - * - * @param applicationObjectId Application object ID. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the keyCredentials associated with an application. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listKeyCredentialsAsync(String applicationObjectId, String tenantId) { - return new PagedFlux<>(() -> listKeyCredentialsSinglePageAsync(applicationObjectId, tenantId)); - } - - /** - * Get the keyCredentials associated with an application. - * - * @param applicationObjectId Application object ID. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the keyCredentials associated with an application. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listKeyCredentialsAsync( - String applicationObjectId, String tenantId, Context context) { - return new PagedFlux<>(() -> listKeyCredentialsSinglePageAsync(applicationObjectId, tenantId, context)); - } - - /** - * Get the keyCredentials associated with an application. - * - * @param applicationObjectId Application object ID. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the keyCredentials associated with an application. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listKeyCredentials(String applicationObjectId, String tenantId) { - return new PagedIterable<>(listKeyCredentialsAsync(applicationObjectId, tenantId)); - } - - /** - * Get the keyCredentials associated with an application. - * - * @param applicationObjectId Application object ID. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the keyCredentials associated with an application. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listKeyCredentials( - String applicationObjectId, String tenantId, Context context) { - return new PagedIterable<>(listKeyCredentialsAsync(applicationObjectId, tenantId, context)); - } - - /** - * Update the keyCredentials associated with an application. - * - * @param applicationObjectId Application object ID. - * @param tenantId The tenant ID. - * @param parameters Parameters to update the keyCredentials of an existing application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateKeyCredentialsWithResponseAsync( - String applicationObjectId, String tenantId, KeyCredentialsUpdateParameters parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (applicationObjectId == null) { - return Mono - .error(new IllegalArgumentException("Parameter applicationObjectId is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .updateKeyCredentials( - this.client.getEndpoint(), - applicationObjectId, - this.client.getApiVersion(), - tenantId, - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Update the keyCredentials associated with an application. - * - * @param applicationObjectId Application object ID. - * @param tenantId The tenant ID. - * @param parameters Parameters to update the keyCredentials of an existing application. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateKeyCredentialsWithResponseAsync( - String applicationObjectId, String tenantId, KeyCredentialsUpdateParameters parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (applicationObjectId == null) { - return Mono - .error(new IllegalArgumentException("Parameter applicationObjectId is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .updateKeyCredentials( - this.client.getEndpoint(), - applicationObjectId, - this.client.getApiVersion(), - tenantId, - parameters, - accept, - context); - } - - /** - * Update the keyCredentials associated with an application. - * - * @param applicationObjectId Application object ID. - * @param tenantId The tenant ID. - * @param parameters Parameters to update the keyCredentials of an existing application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateKeyCredentialsAsync( - String applicationObjectId, String tenantId, KeyCredentialsUpdateParameters parameters) { - return updateKeyCredentialsWithResponseAsync(applicationObjectId, tenantId, parameters) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Update the keyCredentials associated with an application. - * - * @param applicationObjectId Application object ID. - * @param tenantId The tenant ID. - * @param parameters Parameters to update the keyCredentials of an existing application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void updateKeyCredentials( - String applicationObjectId, String tenantId, KeyCredentialsUpdateParameters parameters) { - updateKeyCredentialsAsync(applicationObjectId, tenantId, parameters).block(); - } - - /** - * Update the keyCredentials associated with an application. - * - * @param applicationObjectId Application object ID. - * @param tenantId The tenant ID. - * @param parameters Parameters to update the keyCredentials of an existing application. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateKeyCredentialsWithResponse( - String applicationObjectId, String tenantId, KeyCredentialsUpdateParameters parameters, Context context) { - return updateKeyCredentialsWithResponseAsync(applicationObjectId, tenantId, parameters, context).block(); - } - - /** - * Get the passwordCredentials associated with an application. - * - * @param applicationObjectId Application object ID. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the passwordCredentials associated with an application. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listPasswordCredentialsSinglePageAsync( - String applicationObjectId, String tenantId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (applicationObjectId == null) { - return Mono - .error(new IllegalArgumentException("Parameter applicationObjectId is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .listPasswordCredentials( - this.client.getEndpoint(), - applicationObjectId, - this.client.getApiVersion(), - tenantId, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the passwordCredentials associated with an application. - * - * @param applicationObjectId Application object ID. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the passwordCredentials associated with an application. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listPasswordCredentialsSinglePageAsync( - String applicationObjectId, String tenantId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (applicationObjectId == null) { - return Mono - .error(new IllegalArgumentException("Parameter applicationObjectId is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .listPasswordCredentials( - this.client.getEndpoint(), applicationObjectId, this.client.getApiVersion(), tenantId, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); - } - - /** - * Get the passwordCredentials associated with an application. - * - * @param applicationObjectId Application object ID. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the passwordCredentials associated with an application. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listPasswordCredentialsAsync( - String applicationObjectId, String tenantId) { - return new PagedFlux<>(() -> listPasswordCredentialsSinglePageAsync(applicationObjectId, tenantId)); - } - - /** - * Get the passwordCredentials associated with an application. - * - * @param applicationObjectId Application object ID. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the passwordCredentials associated with an application. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listPasswordCredentialsAsync( - String applicationObjectId, String tenantId, Context context) { - return new PagedFlux<>(() -> listPasswordCredentialsSinglePageAsync(applicationObjectId, tenantId, context)); - } - - /** - * Get the passwordCredentials associated with an application. - * - * @param applicationObjectId Application object ID. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the passwordCredentials associated with an application. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listPasswordCredentials(String applicationObjectId, String tenantId) { - return new PagedIterable<>(listPasswordCredentialsAsync(applicationObjectId, tenantId)); - } - - /** - * Get the passwordCredentials associated with an application. - * - * @param applicationObjectId Application object ID. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the passwordCredentials associated with an application. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listPasswordCredentials( - String applicationObjectId, String tenantId, Context context) { - return new PagedIterable<>(listPasswordCredentialsAsync(applicationObjectId, tenantId, context)); - } - - /** - * Update passwordCredentials associated with an application. - * - * @param applicationObjectId Application object ID. - * @param tenantId The tenant ID. - * @param parameters Parameters to update passwordCredentials of an existing application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updatePasswordCredentialsWithResponseAsync( - String applicationObjectId, String tenantId, PasswordCredentialsUpdateParameters parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (applicationObjectId == null) { - return Mono - .error(new IllegalArgumentException("Parameter applicationObjectId is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .updatePasswordCredentials( - this.client.getEndpoint(), - applicationObjectId, - this.client.getApiVersion(), - tenantId, - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Update passwordCredentials associated with an application. - * - * @param applicationObjectId Application object ID. - * @param tenantId The tenant ID. - * @param parameters Parameters to update passwordCredentials of an existing application. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updatePasswordCredentialsWithResponseAsync( - String applicationObjectId, String tenantId, PasswordCredentialsUpdateParameters parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (applicationObjectId == null) { - return Mono - .error(new IllegalArgumentException("Parameter applicationObjectId is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .updatePasswordCredentials( - this.client.getEndpoint(), - applicationObjectId, - this.client.getApiVersion(), - tenantId, - parameters, - accept, - context); - } - - /** - * Update passwordCredentials associated with an application. - * - * @param applicationObjectId Application object ID. - * @param tenantId The tenant ID. - * @param parameters Parameters to update passwordCredentials of an existing application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updatePasswordCredentialsAsync( - String applicationObjectId, String tenantId, PasswordCredentialsUpdateParameters parameters) { - return updatePasswordCredentialsWithResponseAsync(applicationObjectId, tenantId, parameters) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Update passwordCredentials associated with an application. - * - * @param applicationObjectId Application object ID. - * @param tenantId The tenant ID. - * @param parameters Parameters to update passwordCredentials of an existing application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void updatePasswordCredentials( - String applicationObjectId, String tenantId, PasswordCredentialsUpdateParameters parameters) { - updatePasswordCredentialsAsync(applicationObjectId, tenantId, parameters).block(); - } - - /** - * Update passwordCredentials associated with an application. - * - * @param applicationObjectId Application object ID. - * @param tenantId The tenant ID. - * @param parameters Parameters to update passwordCredentials of an existing application. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updatePasswordCredentialsWithResponse( - String applicationObjectId, String tenantId, PasswordCredentialsUpdateParameters parameters, Context context) { - return updatePasswordCredentialsWithResponseAsync(applicationObjectId, tenantId, parameters, context).block(); - } - - /** - * Gets an object id for a given application id from the current tenant. - * - * @param tenantId The tenant ID. - * @param applicationId The application ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object id for a given application id from the current tenant. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getServicePrincipalsIdByAppIdWithResponseAsync( - String tenantId, String applicationId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - if (applicationId == null) { - return Mono.error(new IllegalArgumentException("Parameter applicationId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .getServicePrincipalsIdByAppId( - this.client.getEndpoint(), - this.client.getApiVersion(), - tenantId, - applicationId, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets an object id for a given application id from the current tenant. - * - * @param tenantId The tenant ID. - * @param applicationId The application ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object id for a given application id from the current tenant. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getServicePrincipalsIdByAppIdWithResponseAsync( - String tenantId, String applicationId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - if (applicationId == null) { - return Mono.error(new IllegalArgumentException("Parameter applicationId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .getServicePrincipalsIdByAppId( - this.client.getEndpoint(), this.client.getApiVersion(), tenantId, applicationId, accept, context); - } - - /** - * Gets an object id for a given application id from the current tenant. - * - * @param tenantId The tenant ID. - * @param applicationId The application ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object id for a given application id from the current tenant. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getServicePrincipalsIdByAppIdAsync( - String tenantId, String applicationId) { - return getServicePrincipalsIdByAppIdWithResponseAsync(tenantId, applicationId) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets an object id for a given application id from the current tenant. - * - * @param tenantId The tenant ID. - * @param applicationId The application ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object id for a given application id from the current tenant. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ServicePrincipalObjectResultInner getServicePrincipalsIdByAppId(String tenantId, String applicationId) { - return getServicePrincipalsIdByAppIdAsync(tenantId, applicationId).block(); - } - - /** - * Gets an object id for a given application id from the current tenant. - * - * @param tenantId The tenant ID. - * @param applicationId The application ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object id for a given application id from the current tenant. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getServicePrincipalsIdByAppIdWithResponse( - String tenantId, String applicationId, Context context) { - return getServicePrincipalsIdByAppIdWithResponseAsync(tenantId, applicationId, context).block(); - } - - /** - * Gets a list of applications from the current tenant. - * - * @param nextLink Next link for the list operation. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of applications from the current tenant. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, String tenantId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .listNext( - this.client.getEndpoint(), - nextLink, - this.client.getApiVersion(), - tenantId, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().odataNextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a list of applications from the current tenant. - * - * @param nextLink Next link for the list operation. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of applications from the current tenant. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync( - String nextLink, String tenantId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .listNext(this.client.getEndpoint(), nextLink, this.client.getApiVersion(), tenantId, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().odataNextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return directoryObject list operation result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listOwnersNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext(context -> service.listOwnersNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().odataNextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return directoryObject list operation result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listOwnersNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .listOwnersNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().odataNextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/AuthorizationManagementClientBuilder.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/AuthorizationManagementClientBuilder.java deleted file mode 100644 index c05212101078..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/AuthorizationManagementClientBuilder.java +++ /dev/null @@ -1,146 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.implementation; - -import com.azure.core.annotation.ServiceClientBuilder; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.policy.CookiePolicy; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerAdapter; -import java.time.Duration; - -/** A builder for creating a new instance of the AuthorizationManagementClientImpl type. */ -@ServiceClientBuilder(serviceClients = {AuthorizationManagementClientImpl.class}) -public final class AuthorizationManagementClientBuilder { - /* - * The ID of the target subscription. - */ - private String subscriptionId; - - /** - * Sets The ID of the target subscription. - * - * @param subscriptionId the subscriptionId value. - * @return the AuthorizationManagementClientBuilder. - */ - public AuthorizationManagementClientBuilder subscriptionId(String subscriptionId) { - this.subscriptionId = subscriptionId; - return this; - } - - /* - * server parameter - */ - private String endpoint; - - /** - * Sets server parameter. - * - * @param endpoint the endpoint value. - * @return the AuthorizationManagementClientBuilder. - */ - public AuthorizationManagementClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * The environment to connect to - */ - private AzureEnvironment environment; - - /** - * Sets The environment to connect to. - * - * @param environment the environment value. - * @return the AuthorizationManagementClientBuilder. - */ - public AuthorizationManagementClientBuilder environment(AzureEnvironment environment) { - this.environment = environment; - return this; - } - - /* - * The default poll interval for long-running operation - */ - private Duration defaultPollInterval; - - /** - * Sets The default poll interval for long-running operation. - * - * @param defaultPollInterval the defaultPollInterval value. - * @return the AuthorizationManagementClientBuilder. - */ - public AuthorizationManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = defaultPollInterval; - return this; - } - - /* - * The HTTP pipeline to send requests through - */ - private HttpPipeline pipeline; - - /** - * Sets The HTTP pipeline to send requests through. - * - * @param pipeline the pipeline value. - * @return the AuthorizationManagementClientBuilder. - */ - public AuthorizationManagementClientBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; - return this; - } - - /* - * The serializer to serialize an object into a string - */ - private SerializerAdapter serializerAdapter; - - /** - * Sets The serializer to serialize an object into a string. - * - * @param serializerAdapter the serializerAdapter value. - * @return the AuthorizationManagementClientBuilder. - */ - public AuthorizationManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { - this.serializerAdapter = serializerAdapter; - return this; - } - - /** - * Builds an instance of AuthorizationManagementClientImpl with the provided parameters. - * - * @return an instance of AuthorizationManagementClientImpl. - */ - public AuthorizationManagementClientImpl buildClient() { - if (endpoint == null) { - this.endpoint = "https://management.azure.com"; - } - if (environment == null) { - this.environment = AzureEnvironment.AZURE; - } - if (defaultPollInterval == null) { - this.defaultPollInterval = Duration.ofSeconds(30); - } - if (pipeline == null) { - this.pipeline = - new HttpPipelineBuilder() - .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) - .build(); - } - if (serializerAdapter == null) { - this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); - } - AuthorizationManagementClientImpl client = - new AuthorizationManagementClientImpl( - pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); - return client; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/AuthorizationManagementClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/AuthorizationManagementClientImpl.java deleted file mode 100644 index d7dce4d353fc..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/AuthorizationManagementClientImpl.java +++ /dev/null @@ -1,203 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.implementation; - -import com.azure.core.annotation.ServiceClient; -import com.azure.core.http.HttpPipeline; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.serializer.SerializerAdapter; -import com.azure.resourcemanager.authorization.fluent.AuthorizationManagementClient; -import com.azure.resourcemanager.authorization.fluent.ClassicAdministratorsClient; -import com.azure.resourcemanager.authorization.fluent.GlobalAdministratorsClient; -import com.azure.resourcemanager.authorization.fluent.PermissionsClient; -import com.azure.resourcemanager.authorization.fluent.ProviderOperationsMetadatasClient; -import com.azure.resourcemanager.authorization.fluent.RoleAssignmentsClient; -import com.azure.resourcemanager.authorization.fluent.RoleDefinitionsClient; -import com.azure.resourcemanager.resources.fluentcore.AzureServiceClient; -import java.time.Duration; - -/** Initializes a new instance of the AuthorizationManagementClientImpl type. */ -@ServiceClient(builder = AuthorizationManagementClientBuilder.class) -public final class AuthorizationManagementClientImpl extends AzureServiceClient - implements AuthorizationManagementClient { - private final ClientLogger logger = new ClientLogger(AuthorizationManagementClientImpl.class); - - /** The ID of the target subscription. */ - private final String subscriptionId; - - /** - * Gets The ID of the target subscription. - * - * @return the subscriptionId value. - */ - public String getSubscriptionId() { - return this.subscriptionId; - } - - /** server parameter. */ - private final String endpoint; - - /** - * Gets server parameter. - * - * @return the endpoint value. - */ - public String getEndpoint() { - return this.endpoint; - } - - /** Api Version. */ - private final String apiVersion; - - /** - * Gets Api Version. - * - * @return the apiVersion value. - */ - public String getApiVersion() { - return this.apiVersion; - } - - /** The HTTP pipeline to send requests through. */ - private final HttpPipeline httpPipeline; - - /** - * Gets The HTTP pipeline to send requests through. - * - * @return the httpPipeline value. - */ - public HttpPipeline getHttpPipeline() { - return this.httpPipeline; - } - - /** The serializer to serialize an object into a string. */ - private final SerializerAdapter serializerAdapter; - - /** - * Gets The serializer to serialize an object into a string. - * - * @return the serializerAdapter value. - */ - SerializerAdapter getSerializerAdapter() { - return this.serializerAdapter; - } - - /** The default poll interval for long-running operation. */ - private final Duration defaultPollInterval; - - /** - * Gets The default poll interval for long-running operation. - * - * @return the defaultPollInterval value. - */ - public Duration getDefaultPollInterval() { - return this.defaultPollInterval; - } - - /** The PermissionsClient object to access its operations. */ - private final PermissionsClient permissions; - - /** - * Gets the PermissionsClient object to access its operations. - * - * @return the PermissionsClient object. - */ - public PermissionsClient getPermissions() { - return this.permissions; - } - - /** The RoleDefinitionsClient object to access its operations. */ - private final RoleDefinitionsClient roleDefinitions; - - /** - * Gets the RoleDefinitionsClient object to access its operations. - * - * @return the RoleDefinitionsClient object. - */ - public RoleDefinitionsClient getRoleDefinitions() { - return this.roleDefinitions; - } - - /** The ProviderOperationsMetadatasClient object to access its operations. */ - private final ProviderOperationsMetadatasClient providerOperationsMetadatas; - - /** - * Gets the ProviderOperationsMetadatasClient object to access its operations. - * - * @return the ProviderOperationsMetadatasClient object. - */ - public ProviderOperationsMetadatasClient getProviderOperationsMetadatas() { - return this.providerOperationsMetadatas; - } - - /** The GlobalAdministratorsClient object to access its operations. */ - private final GlobalAdministratorsClient globalAdministrators; - - /** - * Gets the GlobalAdministratorsClient object to access its operations. - * - * @return the GlobalAdministratorsClient object. - */ - public GlobalAdministratorsClient getGlobalAdministrators() { - return this.globalAdministrators; - } - - /** The RoleAssignmentsClient object to access its operations. */ - private final RoleAssignmentsClient roleAssignments; - - /** - * Gets the RoleAssignmentsClient object to access its operations. - * - * @return the RoleAssignmentsClient object. - */ - public RoleAssignmentsClient getRoleAssignments() { - return this.roleAssignments; - } - - /** The ClassicAdministratorsClient object to access its operations. */ - private final ClassicAdministratorsClient classicAdministrators; - - /** - * Gets the ClassicAdministratorsClient object to access its operations. - * - * @return the ClassicAdministratorsClient object. - */ - public ClassicAdministratorsClient getClassicAdministrators() { - return this.classicAdministrators; - } - - /** - * Initializes an instance of AuthorizationManagementClient client. - * - * @param httpPipeline The HTTP pipeline to send requests through. - * @param serializerAdapter The serializer to serialize an object into a string. - * @param defaultPollInterval The default poll interval for long-running operation. - * @param environment The Azure environment. - * @param subscriptionId The ID of the target subscription. - * @param endpoint server parameter. - */ - AuthorizationManagementClientImpl( - HttpPipeline httpPipeline, - SerializerAdapter serializerAdapter, - Duration defaultPollInterval, - AzureEnvironment environment, - String subscriptionId, - String endpoint) { - super(httpPipeline, serializerAdapter, environment); - this.httpPipeline = httpPipeline; - this.serializerAdapter = serializerAdapter; - this.defaultPollInterval = defaultPollInterval; - this.subscriptionId = subscriptionId; - this.endpoint = endpoint; - this.apiVersion = "2015-07-01"; - this.permissions = new PermissionsClientImpl(this); - this.roleDefinitions = new RoleDefinitionsClientImpl(this); - this.providerOperationsMetadatas = new ProviderOperationsMetadatasClientImpl(this); - this.globalAdministrators = new GlobalAdministratorsClientImpl(this); - this.roleAssignments = new RoleAssignmentsClientImpl(this); - this.classicAdministrators = new ClassicAdministratorsClientImpl(this); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/CertificateCredentialImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/CertificateCredentialImpl.java deleted file mode 100644 index a9494e94ac1d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/CertificateCredentialImpl.java +++ /dev/null @@ -1,200 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.authorization.implementation; - -import com.azure.core.management.AzureEnvironment; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.authorization.models.CertificateCredential; -import com.azure.resourcemanager.authorization.models.CertificateType; -import com.azure.resourcemanager.authorization.fluent.models.KeyCredentialInner; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.IndexableRefreshableWrapperImpl; -import reactor.core.publisher.Mono; - -import java.io.IOException; -import java.io.OutputStream; -import java.nio.charset.StandardCharsets; -import java.time.Duration; -import java.time.OffsetDateTime; -import java.util.Base64; - -/** Implementation for ServicePrincipal and its parent interfaces. */ -class CertificateCredentialImpl> - extends IndexableRefreshableWrapperImpl - implements CertificateCredential, CertificateCredential.Definition, CertificateCredential.UpdateDefinition { - - private String name; - private HasCredential parent; - private OutputStream authFile; - private String privateKeyPath; - private String privateKeyPassword; - private final ClientLogger logger = new ClientLogger(CertificateCredentialImpl.class); - - CertificateCredentialImpl(KeyCredentialInner keyCredential) { - super(keyCredential); - if (keyCredential.customKeyIdentifier() != null && !keyCredential.customKeyIdentifier().isEmpty()) { - this.name = new String(Base64.getMimeDecoder().decode(keyCredential.customKeyIdentifier()), - StandardCharsets.UTF_8); - } else { - this.name = keyCredential.keyId(); - } - } - - CertificateCredentialImpl(String name, HasCredential parent) { - super( - new KeyCredentialInner() - .withUsage("Verify") - .withCustomKeyIdentifier(Base64.getEncoder().encodeToString(name.getBytes(StandardCharsets.UTF_8))) - .withStartDate(OffsetDateTime.now()) - .withEndDate(OffsetDateTime.now().plusYears(1))); - this.name = name; - this.parent = parent; - } - - @Override - public Mono refreshAsync() { - throw logger.logExceptionAsError(new UnsupportedOperationException("Cannot refresh credentials.")); - } - - @Override - protected Mono getInnerAsync() { - throw logger.logExceptionAsError(new UnsupportedOperationException("Cannot refresh credentials.")); - } - - @Override - public OffsetDateTime startDate() { - return innerModel().startDate(); - } - - @Override - public OffsetDateTime endDate() { - return innerModel().endDate(); - } - - @Override - public String value() { - return innerModel().value(); - } - - @Override - public T attach() { - return parent.withCertificateCredential(this); - } - - @Override - public CertificateCredentialImpl withStartDate(OffsetDateTime startDate) { - OffsetDateTime original = startDate(); - innerModel().withStartDate(startDate); - // Adjust end time - withDuration(Duration.between(original, endDate())); - return this; - } - - @Override - public CertificateCredentialImpl withDuration(Duration duration) { - innerModel().withEndDate(startDate().plus(duration)); - return this; - } - - @Override - public CertificateCredentialImpl withAsymmetricX509Certificate() { - innerModel().withType(CertificateType.ASYMMETRIC_X509_CERT.toString()); - return this; - } - - @Override - public CertificateCredentialImpl withSymmetricEncryption() { - innerModel().withType(CertificateType.SYMMETRIC.toString()); - return this; - } - - @Override - public CertificateCredentialImpl withPublicKey(byte[] certificate) { - innerModel().withValue(Base64.getEncoder().encodeToString(certificate)); - return this; - } - - @Override - public CertificateCredentialImpl withSecretKey(byte[] secret) { - innerModel().withValue(Base64.getEncoder().encodeToString(secret)); - return this; - } - - void exportAuthFile(ServicePrincipalImpl servicePrincipal) { - if (authFile == null) { - return; - } - AzureEnvironment environment = AzureEnvironment.AZURE; - StringBuilder builder = new StringBuilder("{\n"); - builder - .append(" ") - .append(String.format("\"clientId\": \"%s\",", servicePrincipal.applicationId())) - .append("\n"); - builder - .append(" ") - .append(String.format("\"clientCertificate\": \"%s\",", privateKeyPath.replace("\\", "\\\\"))) - .append("\n"); - builder - .append(" ") - .append(String.format("\"clientCertificatePassword\": \"%s\",", privateKeyPassword)) - .append("\n"); - builder - .append(" ") - .append(String.format("\"tenantId\": \"%s\",", servicePrincipal.manager().tenantId())) - .append("\n"); - builder - .append(" ") - .append(String.format("\"subscriptionId\": \"%s\",", servicePrincipal.assignedSubscription)) - .append("\n"); - builder - .append(" ") - .append(String.format("\"activeDirectoryEndpointUrl\": \"%s\",", environment.getActiveDirectoryEndpoint())) - .append("\n"); - builder - .append(" ") - .append(String.format("\"resourceManagerEndpointUrl\": \"%s\",", environment.getResourceManagerEndpoint())) - .append("\n"); - builder - .append(" ") - .append(String.format("\"activeDirectoryGraphResourceId\": \"%s\",", environment.getGraphEndpoint())) - .append("\n"); - builder - .append(" ") - .append(String.format("\"managementEndpointUrl\": \"%s\"", environment.getManagementEndpoint())) - .append("\n"); - builder.append("}"); - try { - authFile.write(builder.toString().getBytes(StandardCharsets.UTF_8)); - } catch (IOException e) { - throw logger.logExceptionAsError(new RuntimeException(e)); - } - } - - @Override - public CertificateCredentialImpl withAuthFileToExport(OutputStream outputStream) { - this.authFile = outputStream; - return this; - } - - @Override - public CertificateCredentialImpl withPrivateKeyFile(String privateKeyPath) { - this.privateKeyPath = privateKeyPath; - return this; - } - - @Override - public CertificateCredentialImpl withPrivateKeyPassword(String privateKeyPassword) { - this.privateKeyPassword = privateKeyPassword; - return this; - } - - @Override - public String id() { - return innerModel().keyId(); - } - - @Override - public String name() { - return this.name; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/ClassicAdministratorsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/ClassicAdministratorsClientImpl.java deleted file mode 100644 index 2faee6c75aee..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/ClassicAdministratorsClientImpl.java +++ /dev/null @@ -1,295 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.authorization.fluent.ClassicAdministratorsClient; -import com.azure.resourcemanager.authorization.fluent.models.ClassicAdministratorInner; -import com.azure.resourcemanager.authorization.models.ClassicAdministratorListResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ClassicAdministratorsClient. */ -public final class ClassicAdministratorsClientImpl implements ClassicAdministratorsClient { - private final ClientLogger logger = new ClientLogger(ClassicAdministratorsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final ClassicAdministratorsService service; - - /** The service client containing this operation class. */ - private final AuthorizationManagementClientImpl client; - - /** - * Initializes an instance of ClassicAdministratorsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ClassicAdministratorsClientImpl(AuthorizationManagementClientImpl client) { - this.service = - RestProxy - .create(ClassicAdministratorsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for AuthorizationManagementClientClassicAdministrators to be used by the - * proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "AuthorizationManagem") - private interface ClassicAdministratorsService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/classicAdministrators") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets service administrator, account administrator, and co-administrators for the subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service administrator, account administrator, and co-administrators for the subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets service administrator, account administrator, and co-administrators for the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service administrator, account administrator, and co-administrators for the subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets service administrator, account administrator, and co-administrators for the subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service administrator, account administrator, and co-administrators for the subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets service administrator, account administrator, and co-administrators for the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service administrator, account administrator, and co-administrators for the subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets service administrator, account administrator, and co-administrators for the subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service administrator, account administrator, and co-administrators for the subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Gets service administrator, account administrator, and co-administrators for the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service administrator, account administrator, and co-administrators for the subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return classicAdministrator list result information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return classicAdministrator list result information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/DeletedApplicationsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/DeletedApplicationsClientImpl.java deleted file mode 100644 index 237f14321b4b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/DeletedApplicationsClientImpl.java +++ /dev/null @@ -1,603 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.implementation; - -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.authorization.fluent.DeletedApplicationsClient; -import com.azure.resourcemanager.authorization.fluent.models.ApplicationInner; -import com.azure.resourcemanager.authorization.models.ApplicationListResult; -import com.azure.resourcemanager.authorization.models.GraphErrorException; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in DeletedApplicationsClient. */ -public final class DeletedApplicationsClientImpl implements DeletedApplicationsClient { - private final ClientLogger logger = new ClientLogger(DeletedApplicationsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final DeletedApplicationsService service; - - /** The service client containing this operation class. */ - private final GraphRbacManagementClientImpl client; - - /** - * Initializes an instance of DeletedApplicationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - DeletedApplicationsClientImpl(GraphRbacManagementClientImpl client) { - this.service = - RestProxy.create(DeletedApplicationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for GraphRbacManagementClientDeletedApplications to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "GraphRbacManagementC") - private interface DeletedApplicationsService { - @Headers({"Content-Type: application/json"}) - @Post("/{tenantID}/deletedApplications/{objectId}/restore") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(GraphErrorException.class) - Mono> restore( - @HostParam("$host") String endpoint, - @PathParam("objectId") String objectId, - @QueryParam("api-version") String apiVersion, - @PathParam("tenantID") String tenantId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/{tenantID}/deletedApplications") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(GraphErrorException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("$filter") String filter, - @QueryParam("api-version") String apiVersion, - @PathParam("tenantID") String tenantId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete("/{tenantID}/deletedApplications/{applicationObjectId}") - @ExpectedResponses({204}) - @UnexpectedResponseExceptionType(GraphErrorException.class) - Mono> hardDelete( - @HostParam("$host") String endpoint, - @PathParam("applicationObjectId") String applicationObjectId, - @QueryParam("api-version") String apiVersion, - @PathParam("tenantID") String tenantId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/{tenantID}/{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(GraphErrorException.class) - Mono> listNext( - @HostParam("$host") String endpoint, - @PathParam(value = "nextLink", encoded = true) String nextLink, - @QueryParam("api-version") String apiVersion, - @PathParam("tenantID") String tenantId, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Restores the deleted application in the directory. - * - * @param objectId Application object ID. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return active Directory application information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> restoreWithResponseAsync(String objectId, String tenantId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (objectId == null) { - return Mono.error(new IllegalArgumentException("Parameter objectId is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .restore( - this.client.getEndpoint(), - objectId, - this.client.getApiVersion(), - tenantId, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Restores the deleted application in the directory. - * - * @param objectId Application object ID. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return active Directory application information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> restoreWithResponseAsync( - String objectId, String tenantId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (objectId == null) { - return Mono.error(new IllegalArgumentException("Parameter objectId is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .restore(this.client.getEndpoint(), objectId, this.client.getApiVersion(), tenantId, accept, context); - } - - /** - * Restores the deleted application in the directory. - * - * @param objectId Application object ID. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return active Directory application information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono restoreAsync(String objectId, String tenantId) { - return restoreWithResponseAsync(objectId, tenantId) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Restores the deleted application in the directory. - * - * @param objectId Application object ID. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return active Directory application information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ApplicationInner restore(String objectId, String tenantId) { - return restoreAsync(objectId, tenantId).block(); - } - - /** - * Restores the deleted application in the directory. - * - * @param objectId Application object ID. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return active Directory application information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response restoreWithResponse(String objectId, String tenantId, Context context) { - return restoreWithResponseAsync(objectId, tenantId, context).block(); - } - - /** - * Gets a list of deleted applications in the directory. - * - * @param tenantId The tenant ID. - * @param filter The filter to apply to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of deleted applications in the directory. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String tenantId, String filter) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), filter, this.client.getApiVersion(), tenantId, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().odataNextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a list of deleted applications in the directory. - * - * @param tenantId The tenant ID. - * @param filter The filter to apply to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of deleted applications in the directory. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String tenantId, String filter, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), filter, this.client.getApiVersion(), tenantId, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().odataNextLink(), - null)); - } - - /** - * Gets a list of deleted applications in the directory. - * - * @param tenantId The tenant ID. - * @param filter The filter to apply to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of deleted applications in the directory. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String tenantId, String filter) { - return new PagedFlux<>( - () -> listSinglePageAsync(tenantId, filter), nextLink -> listNextSinglePageAsync(nextLink, tenantId)); - } - - /** - * Gets a list of deleted applications in the directory. - * - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of deleted applications in the directory. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String tenantId) { - final String filter = null; - return new PagedFlux<>( - () -> listSinglePageAsync(tenantId, filter), nextLink -> listNextSinglePageAsync(nextLink, tenantId)); - } - - /** - * Gets a list of deleted applications in the directory. - * - * @param tenantId The tenant ID. - * @param filter The filter to apply to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of deleted applications in the directory. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String tenantId, String filter, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(tenantId, filter, context), - nextLink -> listNextSinglePageAsync(nextLink, tenantId, context)); - } - - /** - * Gets a list of deleted applications in the directory. - * - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of deleted applications in the directory. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String tenantId) { - final String filter = null; - return new PagedIterable<>(listAsync(tenantId, filter)); - } - - /** - * Gets a list of deleted applications in the directory. - * - * @param tenantId The tenant ID. - * @param filter The filter to apply to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of deleted applications in the directory. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String tenantId, String filter, Context context) { - return new PagedIterable<>(listAsync(tenantId, filter, context)); - } - - /** - * Hard-delete an application. - * - * @param applicationObjectId Application object ID. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> hardDeleteWithResponseAsync(String applicationObjectId, String tenantId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (applicationObjectId == null) { - return Mono - .error(new IllegalArgumentException("Parameter applicationObjectId is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .hardDelete( - this.client.getEndpoint(), - applicationObjectId, - this.client.getApiVersion(), - tenantId, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Hard-delete an application. - * - * @param applicationObjectId Application object ID. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> hardDeleteWithResponseAsync( - String applicationObjectId, String tenantId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (applicationObjectId == null) { - return Mono - .error(new IllegalArgumentException("Parameter applicationObjectId is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .hardDelete( - this.client.getEndpoint(), applicationObjectId, this.client.getApiVersion(), tenantId, accept, context); - } - - /** - * Hard-delete an application. - * - * @param applicationObjectId Application object ID. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono hardDeleteAsync(String applicationObjectId, String tenantId) { - return hardDeleteWithResponseAsync(applicationObjectId, tenantId).flatMap((Response res) -> Mono.empty()); - } - - /** - * Hard-delete an application. - * - * @param applicationObjectId Application object ID. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void hardDelete(String applicationObjectId, String tenantId) { - hardDeleteAsync(applicationObjectId, tenantId).block(); - } - - /** - * Hard-delete an application. - * - * @param applicationObjectId Application object ID. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response hardDeleteWithResponse(String applicationObjectId, String tenantId, Context context) { - return hardDeleteWithResponseAsync(applicationObjectId, tenantId, context).block(); - } - - /** - * Gets a list of deleted applications in the directory. - * - * @param nextLink Next link for the list operation. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of deleted applications in the directory. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, String tenantId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .listNext( - this.client.getEndpoint(), - nextLink, - this.client.getApiVersion(), - tenantId, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().odataNextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a list of deleted applications in the directory. - * - * @param nextLink Next link for the list operation. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of deleted applications in the directory. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync( - String nextLink, String tenantId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .listNext(this.client.getEndpoint(), nextLink, this.client.getApiVersion(), tenantId, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().odataNextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/DomainsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/DomainsClientImpl.java deleted file mode 100644 index 489f1752a914..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/DomainsClientImpl.java +++ /dev/null @@ -1,353 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.authorization.fluent.DomainsClient; -import com.azure.resourcemanager.authorization.fluent.models.DomainInner; -import com.azure.resourcemanager.authorization.models.DomainListResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in DomainsClient. */ -public final class DomainsClientImpl implements DomainsClient { - private final ClientLogger logger = new ClientLogger(DomainsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final DomainsService service; - - /** The service client containing this operation class. */ - private final GraphRbacManagementClientImpl client; - - /** - * Initializes an instance of DomainsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - DomainsClientImpl(GraphRbacManagementClientImpl client) { - this.service = RestProxy.create(DomainsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for GraphRbacManagementClientDomains to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "GraphRbacManagementC") - private interface DomainsService { - @Headers({"Content-Type: application/json"}) - @Get("/{tenantID}/domains") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("$filter") String filter, - @QueryParam("api-version") String apiVersion, - @PathParam("tenantID") String tenantId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/{tenantID}/domains/{domainName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("domainName") String domainName, - @QueryParam("api-version") String apiVersion, - @PathParam("tenantID") String tenantId, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets a list of domains for the current tenant. - * - * @param tenantId The tenant ID. - * @param filter The filter to apply to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of domains for the current tenant. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String tenantId, String filter) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), filter, this.client.getApiVersion(), tenantId, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a list of domains for the current tenant. - * - * @param tenantId The tenant ID. - * @param filter The filter to apply to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of domains for the current tenant. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String tenantId, String filter, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), filter, this.client.getApiVersion(), tenantId, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); - } - - /** - * Gets a list of domains for the current tenant. - * - * @param tenantId The tenant ID. - * @param filter The filter to apply to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of domains for the current tenant. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String tenantId, String filter) { - return new PagedFlux<>(() -> listSinglePageAsync(tenantId, filter)); - } - - /** - * Gets a list of domains for the current tenant. - * - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of domains for the current tenant. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String tenantId) { - final String filter = null; - return new PagedFlux<>(() -> listSinglePageAsync(tenantId, filter)); - } - - /** - * Gets a list of domains for the current tenant. - * - * @param tenantId The tenant ID. - * @param filter The filter to apply to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of domains for the current tenant. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String tenantId, String filter, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(tenantId, filter, context)); - } - - /** - * Gets a list of domains for the current tenant. - * - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of domains for the current tenant. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String tenantId) { - final String filter = null; - return new PagedIterable<>(listAsync(tenantId, filter)); - } - - /** - * Gets a list of domains for the current tenant. - * - * @param tenantId The tenant ID. - * @param filter The filter to apply to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of domains for the current tenant. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String tenantId, String filter, Context context) { - return new PagedIterable<>(listAsync(tenantId, filter, context)); - } - - /** - * Gets a specific domain in the current tenant. - * - * @param domainName name of the domain. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific domain in the current tenant. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync(String domainName, String tenantId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (domainName == null) { - return Mono.error(new IllegalArgumentException("Parameter domainName is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - domainName, - this.client.getApiVersion(), - tenantId, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a specific domain in the current tenant. - * - * @param domainName name of the domain. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific domain in the current tenant. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String domainName, String tenantId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (domainName == null) { - return Mono.error(new IllegalArgumentException("Parameter domainName is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .get(this.client.getEndpoint(), domainName, this.client.getApiVersion(), tenantId, accept, context); - } - - /** - * Gets a specific domain in the current tenant. - * - * @param domainName name of the domain. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific domain in the current tenant. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync(String domainName, String tenantId) { - return getWithResponseAsync(domainName, tenantId) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a specific domain in the current tenant. - * - * @param domainName name of the domain. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific domain in the current tenant. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DomainInner get(String domainName, String tenantId) { - return getAsync(domainName, tenantId).block(); - } - - /** - * Gets a specific domain in the current tenant. - * - * @param domainName name of the domain. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific domain in the current tenant. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String domainName, String tenantId, Context context) { - return getWithResponseAsync(domainName, tenantId, context).block(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/GlobalAdministratorsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/GlobalAdministratorsClientImpl.java deleted file mode 100644 index 23728686aab6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/GlobalAdministratorsClientImpl.java +++ /dev/null @@ -1,148 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.authorization.fluent.GlobalAdministratorsClient; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in GlobalAdministratorsClient. */ -public final class GlobalAdministratorsClientImpl implements GlobalAdministratorsClient { - private final ClientLogger logger = new ClientLogger(GlobalAdministratorsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final GlobalAdministratorsService service; - - /** The service client containing this operation class. */ - private final AuthorizationManagementClientImpl client; - - /** - * Initializes an instance of GlobalAdministratorsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - GlobalAdministratorsClientImpl(AuthorizationManagementClientImpl client) { - this.service = - RestProxy - .create(GlobalAdministratorsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for AuthorizationManagementClientGlobalAdministrators to be used by the - * proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "AuthorizationManagem") - private interface GlobalAdministratorsService { - @Headers({"Content-Type: application/json"}) - @Post("/providers/Microsoft.Authorization/elevateAccess") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> elevateAccess( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Elevates access for a Global Administrator. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> elevateAccessWithResponseAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service.elevateAccess(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Elevates access for a Global Administrator. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> elevateAccessWithResponseAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.elevateAccess(this.client.getEndpoint(), this.client.getApiVersion(), accept, context); - } - - /** - * Elevates access for a Global Administrator. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono elevateAccessAsync() { - return elevateAccessWithResponseAsync().flatMap((Response res) -> Mono.empty()); - } - - /** - * Elevates access for a Global Administrator. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void elevateAccess() { - elevateAccessAsync().block(); - } - - /** - * Elevates access for a Global Administrator. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response elevateAccessWithResponse(Context context) { - return elevateAccessWithResponseAsync(context).block(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/GraphRbacManagementClientBuilder.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/GraphRbacManagementClientBuilder.java deleted file mode 100644 index c049863be2e1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/GraphRbacManagementClientBuilder.java +++ /dev/null @@ -1,129 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.implementation; - -import com.azure.core.annotation.ServiceClientBuilder; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.policy.CookiePolicy; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerAdapter; -import java.time.Duration; - -/** A builder for creating a new instance of the GraphRbacManagementClientImpl type. */ -@ServiceClientBuilder(serviceClients = {GraphRbacManagementClientImpl.class}) -public final class GraphRbacManagementClientBuilder { - /* - * server parameter - */ - private String endpoint; - - /** - * Sets server parameter. - * - * @param endpoint the endpoint value. - * @return the GraphRbacManagementClientBuilder. - */ - public GraphRbacManagementClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * The environment to connect to - */ - private AzureEnvironment environment; - - /** - * Sets The environment to connect to. - * - * @param environment the environment value. - * @return the GraphRbacManagementClientBuilder. - */ - public GraphRbacManagementClientBuilder environment(AzureEnvironment environment) { - this.environment = environment; - return this; - } - - /* - * The default poll interval for long-running operation - */ - private Duration defaultPollInterval; - - /** - * Sets The default poll interval for long-running operation. - * - * @param defaultPollInterval the defaultPollInterval value. - * @return the GraphRbacManagementClientBuilder. - */ - public GraphRbacManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = defaultPollInterval; - return this; - } - - /* - * The HTTP pipeline to send requests through - */ - private HttpPipeline pipeline; - - /** - * Sets The HTTP pipeline to send requests through. - * - * @param pipeline the pipeline value. - * @return the GraphRbacManagementClientBuilder. - */ - public GraphRbacManagementClientBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; - return this; - } - - /* - * The serializer to serialize an object into a string - */ - private SerializerAdapter serializerAdapter; - - /** - * Sets The serializer to serialize an object into a string. - * - * @param serializerAdapter the serializerAdapter value. - * @return the GraphRbacManagementClientBuilder. - */ - public GraphRbacManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { - this.serializerAdapter = serializerAdapter; - return this; - } - - /** - * Builds an instance of GraphRbacManagementClientImpl with the provided parameters. - * - * @return an instance of GraphRbacManagementClientImpl. - */ - public GraphRbacManagementClientImpl buildClient() { - if (endpoint == null) { - this.endpoint = "https://graph.windows.net"; - } - if (environment == null) { - this.environment = AzureEnvironment.AZURE; - } - if (defaultPollInterval == null) { - this.defaultPollInterval = Duration.ofSeconds(30); - } - if (pipeline == null) { - this.pipeline = - new HttpPipelineBuilder() - .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) - .build(); - } - if (serializerAdapter == null) { - this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); - } - GraphRbacManagementClientImpl client = - new GraphRbacManagementClientImpl(pipeline, serializerAdapter, defaultPollInterval, environment, endpoint); - return client; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/GraphRbacManagementClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/GraphRbacManagementClientImpl.java deleted file mode 100644 index 851708a784e3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/GraphRbacManagementClientImpl.java +++ /dev/null @@ -1,229 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.implementation; - -import com.azure.core.annotation.ServiceClient; -import com.azure.core.http.HttpPipeline; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.serializer.SerializerAdapter; -import com.azure.resourcemanager.authorization.fluent.ApplicationsClient; -import com.azure.resourcemanager.authorization.fluent.DeletedApplicationsClient; -import com.azure.resourcemanager.authorization.fluent.DomainsClient; -import com.azure.resourcemanager.authorization.fluent.GraphRbacManagementClient; -import com.azure.resourcemanager.authorization.fluent.GroupsClient; -import com.azure.resourcemanager.authorization.fluent.OAuth2PermissionGrantsClient; -import com.azure.resourcemanager.authorization.fluent.ObjectsClient; -import com.azure.resourcemanager.authorization.fluent.ServicePrincipalsClient; -import com.azure.resourcemanager.authorization.fluent.SignedInUsersClient; -import com.azure.resourcemanager.authorization.fluent.UsersClient; -import com.azure.resourcemanager.resources.fluentcore.AzureServiceClient; -import java.time.Duration; - -/** Initializes a new instance of the GraphRbacManagementClientImpl type. */ -@ServiceClient(builder = GraphRbacManagementClientBuilder.class) -public final class GraphRbacManagementClientImpl extends AzureServiceClient implements GraphRbacManagementClient { - private final ClientLogger logger = new ClientLogger(GraphRbacManagementClientImpl.class); - - /** server parameter. */ - private final String endpoint; - - /** - * Gets server parameter. - * - * @return the endpoint value. - */ - public String getEndpoint() { - return this.endpoint; - } - - /** Api Version. */ - private final String apiVersion; - - /** - * Gets Api Version. - * - * @return the apiVersion value. - */ - public String getApiVersion() { - return this.apiVersion; - } - - /** The HTTP pipeline to send requests through. */ - private final HttpPipeline httpPipeline; - - /** - * Gets The HTTP pipeline to send requests through. - * - * @return the httpPipeline value. - */ - public HttpPipeline getHttpPipeline() { - return this.httpPipeline; - } - - /** The serializer to serialize an object into a string. */ - private final SerializerAdapter serializerAdapter; - - /** - * Gets The serializer to serialize an object into a string. - * - * @return the serializerAdapter value. - */ - SerializerAdapter getSerializerAdapter() { - return this.serializerAdapter; - } - - /** The default poll interval for long-running operation. */ - private final Duration defaultPollInterval; - - /** - * Gets The default poll interval for long-running operation. - * - * @return the defaultPollInterval value. - */ - public Duration getDefaultPollInterval() { - return this.defaultPollInterval; - } - - /** The SignedInUsersClient object to access its operations. */ - private final SignedInUsersClient signedInUsers; - - /** - * Gets the SignedInUsersClient object to access its operations. - * - * @return the SignedInUsersClient object. - */ - public SignedInUsersClient getSignedInUsers() { - return this.signedInUsers; - } - - /** The ApplicationsClient object to access its operations. */ - private final ApplicationsClient applications; - - /** - * Gets the ApplicationsClient object to access its operations. - * - * @return the ApplicationsClient object. - */ - public ApplicationsClient getApplications() { - return this.applications; - } - - /** The DeletedApplicationsClient object to access its operations. */ - private final DeletedApplicationsClient deletedApplications; - - /** - * Gets the DeletedApplicationsClient object to access its operations. - * - * @return the DeletedApplicationsClient object. - */ - public DeletedApplicationsClient getDeletedApplications() { - return this.deletedApplications; - } - - /** The GroupsClient object to access its operations. */ - private final GroupsClient groups; - - /** - * Gets the GroupsClient object to access its operations. - * - * @return the GroupsClient object. - */ - public GroupsClient getGroups() { - return this.groups; - } - - /** The ServicePrincipalsClient object to access its operations. */ - private final ServicePrincipalsClient servicePrincipals; - - /** - * Gets the ServicePrincipalsClient object to access its operations. - * - * @return the ServicePrincipalsClient object. - */ - public ServicePrincipalsClient getServicePrincipals() { - return this.servicePrincipals; - } - - /** The UsersClient object to access its operations. */ - private final UsersClient users; - - /** - * Gets the UsersClient object to access its operations. - * - * @return the UsersClient object. - */ - public UsersClient getUsers() { - return this.users; - } - - /** The ObjectsClient object to access its operations. */ - private final ObjectsClient objects; - - /** - * Gets the ObjectsClient object to access its operations. - * - * @return the ObjectsClient object. - */ - public ObjectsClient getObjects() { - return this.objects; - } - - /** The DomainsClient object to access its operations. */ - private final DomainsClient domains; - - /** - * Gets the DomainsClient object to access its operations. - * - * @return the DomainsClient object. - */ - public DomainsClient getDomains() { - return this.domains; - } - - /** The OAuth2PermissionGrantsClient object to access its operations. */ - private final OAuth2PermissionGrantsClient oAuth2PermissionGrants; - - /** - * Gets the OAuth2PermissionGrantsClient object to access its operations. - * - * @return the OAuth2PermissionGrantsClient object. - */ - public OAuth2PermissionGrantsClient getOAuth2PermissionGrants() { - return this.oAuth2PermissionGrants; - } - - /** - * Initializes an instance of GraphRbacManagementClient client. - * - * @param httpPipeline The HTTP pipeline to send requests through. - * @param serializerAdapter The serializer to serialize an object into a string. - * @param defaultPollInterval The default poll interval for long-running operation. - * @param environment The Azure environment. - * @param endpoint server parameter. - */ - GraphRbacManagementClientImpl( - HttpPipeline httpPipeline, - SerializerAdapter serializerAdapter, - Duration defaultPollInterval, - AzureEnvironment environment, - String endpoint) { - super(httpPipeline, serializerAdapter, environment); - this.httpPipeline = httpPipeline; - this.serializerAdapter = serializerAdapter; - this.defaultPollInterval = defaultPollInterval; - this.endpoint = endpoint; - this.apiVersion = "1.6"; - this.signedInUsers = new SignedInUsersClientImpl(this); - this.applications = new ApplicationsClientImpl(this); - this.deletedApplications = new DeletedApplicationsClientImpl(this); - this.groups = new GroupsClientImpl(this); - this.servicePrincipals = new ServicePrincipalsClientImpl(this); - this.users = new UsersClientImpl(this); - this.objects = new ObjectsClientImpl(this); - this.domains = new DomainsClientImpl(this); - this.oAuth2PermissionGrants = new OAuth2PermissionGrantsClientImpl(this); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/GroupsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/GroupsClientImpl.java deleted file mode 100644 index 18ab4e13f3a2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/GroupsClientImpl.java +++ /dev/null @@ -1,2213 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.authorization.fluent.GroupsClient; -import com.azure.resourcemanager.authorization.fluent.models.ADGroupInner; -import com.azure.resourcemanager.authorization.fluent.models.CheckGroupMembershipResultInner; -import com.azure.resourcemanager.authorization.fluent.models.DirectoryObjectInner; -import com.azure.resourcemanager.authorization.models.AddOwnerParameters; -import com.azure.resourcemanager.authorization.models.CheckGroupMembershipParameters; -import com.azure.resourcemanager.authorization.models.DirectoryObjectListResult; -import com.azure.resourcemanager.authorization.models.GraphErrorException; -import com.azure.resourcemanager.authorization.models.GroupAddMemberParameters; -import com.azure.resourcemanager.authorization.models.GroupCreateParameters; -import com.azure.resourcemanager.authorization.models.GroupGetMemberGroupsParameters; -import com.azure.resourcemanager.authorization.models.GroupGetMemberGroupsResult; -import com.azure.resourcemanager.authorization.models.GroupListResult; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in GroupsClient. */ -public final class GroupsClientImpl implements InnerSupportsDelete, GroupsClient { - private final ClientLogger logger = new ClientLogger(GroupsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final GroupsService service; - - /** The service client containing this operation class. */ - private final GraphRbacManagementClientImpl client; - - /** - * Initializes an instance of GroupsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - GroupsClientImpl(GraphRbacManagementClientImpl client) { - this.service = RestProxy.create(GroupsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for GraphRbacManagementClientGroups to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "GraphRbacManagementC") - private interface GroupsService { - @Headers({"Content-Type: application/json"}) - @Post("/{tenantID}/isMemberOf") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(GraphErrorException.class) - Mono> isMemberOf( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("tenantID") String tenantId, - @BodyParam("application/json") CheckGroupMembershipParameters parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete("/{tenantID}/groups/{groupObjectId}/$links/members/{memberObjectId}") - @ExpectedResponses({204}) - @UnexpectedResponseExceptionType(GraphErrorException.class) - Mono> removeMember( - @HostParam("$host") String endpoint, - @PathParam("groupObjectId") String groupObjectId, - @PathParam("memberObjectId") String memberObjectId, - @QueryParam("api-version") String apiVersion, - @PathParam("tenantID") String tenantId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post("/{tenantID}/groups/{groupObjectId}/$links/members") - @ExpectedResponses({204}) - @UnexpectedResponseExceptionType(GraphErrorException.class) - Mono> addMember( - @HostParam("$host") String endpoint, - @PathParam("groupObjectId") String groupObjectId, - @QueryParam("api-version") String apiVersion, - @PathParam("tenantID") String tenantId, - @BodyParam("application/json") GroupAddMemberParameters parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post("/{tenantID}/groups") - @ExpectedResponses({201}) - @UnexpectedResponseExceptionType(GraphErrorException.class) - Mono> create( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("tenantID") String tenantId, - @BodyParam("application/json") GroupCreateParameters parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/{tenantID}/groups") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(GraphErrorException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("$filter") String filter, - @QueryParam("api-version") String apiVersion, - @PathParam("tenantID") String tenantId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/{tenantID}/groups/{objectId}/members") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(GraphErrorException.class) - Mono> getGroupMembers( - @HostParam("$host") String endpoint, - @PathParam("objectId") String objectId, - @QueryParam("api-version") String apiVersion, - @PathParam("tenantID") String tenantId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/{tenantID}/groups/{objectId}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(GraphErrorException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("objectId") String objectId, - @QueryParam("api-version") String apiVersion, - @PathParam("tenantID") String tenantId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete("/{tenantID}/groups/{objectId}") - @ExpectedResponses({204}) - @UnexpectedResponseExceptionType(GraphErrorException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @PathParam("objectId") String objectId, - @QueryParam("api-version") String apiVersion, - @PathParam("tenantID") String tenantId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post("/{tenantID}/groups/{objectId}/getMemberGroups") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(GraphErrorException.class) - Mono> getMemberGroups( - @HostParam("$host") String endpoint, - @PathParam("objectId") String objectId, - @QueryParam("api-version") String apiVersion, - @PathParam("tenantID") String tenantId, - @BodyParam("application/json") GroupGetMemberGroupsParameters parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/{tenantID}/groups/{objectId}/owners") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(GraphErrorException.class) - Mono> listOwners( - @HostParam("$host") String endpoint, - @PathParam("objectId") String objectId, - @QueryParam("api-version") String apiVersion, - @PathParam("tenantID") String tenantId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post("/{tenantID}/groups/{objectId}/$links/owners") - @ExpectedResponses({204}) - @UnexpectedResponseExceptionType(GraphErrorException.class) - Mono> addOwner( - @HostParam("$host") String endpoint, - @PathParam("objectId") String objectId, - @QueryParam("api-version") String apiVersion, - @PathParam("tenantID") String tenantId, - @BodyParam("application/json") AddOwnerParameters parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete("/{tenantID}/groups/{objectId}/$links/owners/{ownerObjectId}") - @ExpectedResponses({204}) - @UnexpectedResponseExceptionType(GraphErrorException.class) - Mono> removeOwner( - @HostParam("$host") String endpoint, - @PathParam("objectId") String objectId, - @PathParam("ownerObjectId") String ownerObjectId, - @QueryParam("api-version") String apiVersion, - @PathParam("tenantID") String tenantId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/{tenantID}/{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(GraphErrorException.class) - Mono> listNext( - @HostParam("$host") String endpoint, - @PathParam(value = "nextLink", encoded = true) String nextLink, - @QueryParam("api-version") String apiVersion, - @PathParam("tenantID") String tenantId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/{tenantID}/{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(GraphErrorException.class) - Mono> getGroupMembersNext( - @HostParam("$host") String endpoint, - @PathParam(value = "nextLink", encoded = true) String nextLink, - @QueryParam("api-version") String apiVersion, - @PathParam("tenantID") String tenantId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(GraphErrorException.class) - Mono> listOwnersNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Checks whether the specified user, group, contact, or service principal is a direct or transitive member of the - * specified group. - * - * @param tenantId The tenant ID. - * @param parameters The check group membership parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return server response for IsMemberOf API call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> isMemberOfWithResponseAsync( - String tenantId, CheckGroupMembershipParameters parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .isMemberOf( - this.client.getEndpoint(), - this.client.getApiVersion(), - tenantId, - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Checks whether the specified user, group, contact, or service principal is a direct or transitive member of the - * specified group. - * - * @param tenantId The tenant ID. - * @param parameters The check group membership parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return server response for IsMemberOf API call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> isMemberOfWithResponseAsync( - String tenantId, CheckGroupMembershipParameters parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .isMemberOf(this.client.getEndpoint(), this.client.getApiVersion(), tenantId, parameters, accept, context); - } - - /** - * Checks whether the specified user, group, contact, or service principal is a direct or transitive member of the - * specified group. - * - * @param tenantId The tenant ID. - * @param parameters The check group membership parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return server response for IsMemberOf API call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono isMemberOfAsync( - String tenantId, CheckGroupMembershipParameters parameters) { - return isMemberOfWithResponseAsync(tenantId, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Checks whether the specified user, group, contact, or service principal is a direct or transitive member of the - * specified group. - * - * @param tenantId The tenant ID. - * @param parameters The check group membership parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return server response for IsMemberOf API call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CheckGroupMembershipResultInner isMemberOf(String tenantId, CheckGroupMembershipParameters parameters) { - return isMemberOfAsync(tenantId, parameters).block(); - } - - /** - * Checks whether the specified user, group, contact, or service principal is a direct or transitive member of the - * specified group. - * - * @param tenantId The tenant ID. - * @param parameters The check group membership parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return server response for IsMemberOf API call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response isMemberOfWithResponse( - String tenantId, CheckGroupMembershipParameters parameters, Context context) { - return isMemberOfWithResponseAsync(tenantId, parameters, context).block(); - } - - /** - * Remove a member from a group. - * - * @param groupObjectId The object ID of the group from which to remove the member. - * @param memberObjectId Member object id. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> removeMemberWithResponseAsync( - String groupObjectId, String memberObjectId, String tenantId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (groupObjectId == null) { - return Mono.error(new IllegalArgumentException("Parameter groupObjectId is required and cannot be null.")); - } - if (memberObjectId == null) { - return Mono.error(new IllegalArgumentException("Parameter memberObjectId is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .removeMember( - this.client.getEndpoint(), - groupObjectId, - memberObjectId, - this.client.getApiVersion(), - tenantId, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Remove a member from a group. - * - * @param groupObjectId The object ID of the group from which to remove the member. - * @param memberObjectId Member object id. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> removeMemberWithResponseAsync( - String groupObjectId, String memberObjectId, String tenantId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (groupObjectId == null) { - return Mono.error(new IllegalArgumentException("Parameter groupObjectId is required and cannot be null.")); - } - if (memberObjectId == null) { - return Mono.error(new IllegalArgumentException("Parameter memberObjectId is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .removeMember( - this.client.getEndpoint(), - groupObjectId, - memberObjectId, - this.client.getApiVersion(), - tenantId, - accept, - context); - } - - /** - * Remove a member from a group. - * - * @param groupObjectId The object ID of the group from which to remove the member. - * @param memberObjectId Member object id. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono removeMemberAsync(String groupObjectId, String memberObjectId, String tenantId) { - return removeMemberWithResponseAsync(groupObjectId, memberObjectId, tenantId) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Remove a member from a group. - * - * @param groupObjectId The object ID of the group from which to remove the member. - * @param memberObjectId Member object id. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void removeMember(String groupObjectId, String memberObjectId, String tenantId) { - removeMemberAsync(groupObjectId, memberObjectId, tenantId).block(); - } - - /** - * Remove a member from a group. - * - * @param groupObjectId The object ID of the group from which to remove the member. - * @param memberObjectId Member object id. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response removeMemberWithResponse( - String groupObjectId, String memberObjectId, String tenantId, Context context) { - return removeMemberWithResponseAsync(groupObjectId, memberObjectId, tenantId, context).block(); - } - - /** - * Add a member to a group. - * - * @param groupObjectId The object ID of the group to which to add the member. - * @param tenantId The tenant ID. - * @param parameters The URL of the member object, such as - * https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects/f260bbc4-c254-447b-94cf-293b5ec434dd. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> addMemberWithResponseAsync( - String groupObjectId, String tenantId, GroupAddMemberParameters parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (groupObjectId == null) { - return Mono.error(new IllegalArgumentException("Parameter groupObjectId is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .addMember( - this.client.getEndpoint(), - groupObjectId, - this.client.getApiVersion(), - tenantId, - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Add a member to a group. - * - * @param groupObjectId The object ID of the group to which to add the member. - * @param tenantId The tenant ID. - * @param parameters The URL of the member object, such as - * https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects/f260bbc4-c254-447b-94cf-293b5ec434dd. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> addMemberWithResponseAsync( - String groupObjectId, String tenantId, GroupAddMemberParameters parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (groupObjectId == null) { - return Mono.error(new IllegalArgumentException("Parameter groupObjectId is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .addMember( - this.client.getEndpoint(), - groupObjectId, - this.client.getApiVersion(), - tenantId, - parameters, - accept, - context); - } - - /** - * Add a member to a group. - * - * @param groupObjectId The object ID of the group to which to add the member. - * @param tenantId The tenant ID. - * @param parameters The URL of the member object, such as - * https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects/f260bbc4-c254-447b-94cf-293b5ec434dd. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono addMemberAsync(String groupObjectId, String tenantId, GroupAddMemberParameters parameters) { - return addMemberWithResponseAsync(groupObjectId, tenantId, parameters) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Add a member to a group. - * - * @param groupObjectId The object ID of the group to which to add the member. - * @param tenantId The tenant ID. - * @param parameters The URL of the member object, such as - * https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects/f260bbc4-c254-447b-94cf-293b5ec434dd. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void addMember(String groupObjectId, String tenantId, GroupAddMemberParameters parameters) { - addMemberAsync(groupObjectId, tenantId, parameters).block(); - } - - /** - * Add a member to a group. - * - * @param groupObjectId The object ID of the group to which to add the member. - * @param tenantId The tenant ID. - * @param parameters The URL of the member object, such as - * https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects/f260bbc4-c254-447b-94cf-293b5ec434dd. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response addMemberWithResponse( - String groupObjectId, String tenantId, GroupAddMemberParameters parameters, Context context) { - return addMemberWithResponseAsync(groupObjectId, tenantId, parameters, context).block(); - } - - /** - * Create a group in the directory. - * - * @param tenantId The tenant ID. - * @param parameters The parameters for the group to create. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return active Directory group information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createWithResponseAsync(String tenantId, GroupCreateParameters parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .create( - this.client.getEndpoint(), - this.client.getApiVersion(), - tenantId, - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create a group in the directory. - * - * @param tenantId The tenant ID. - * @param parameters The parameters for the group to create. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return active Directory group information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync( - String tenantId, GroupCreateParameters parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .create(this.client.getEndpoint(), this.client.getApiVersion(), tenantId, parameters, accept, context); - } - - /** - * Create a group in the directory. - * - * @param tenantId The tenant ID. - * @param parameters The parameters for the group to create. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return active Directory group information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createAsync(String tenantId, GroupCreateParameters parameters) { - return createWithResponseAsync(tenantId, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Create a group in the directory. - * - * @param tenantId The tenant ID. - * @param parameters The parameters for the group to create. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return active Directory group information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ADGroupInner create(String tenantId, GroupCreateParameters parameters) { - return createAsync(tenantId, parameters).block(); - } - - /** - * Create a group in the directory. - * - * @param tenantId The tenant ID. - * @param parameters The parameters for the group to create. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return active Directory group information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse( - String tenantId, GroupCreateParameters parameters, Context context) { - return createWithResponseAsync(tenantId, parameters, context).block(); - } - - /** - * Gets list of groups for the current tenant. - * - * @param tenantId The tenant ID. - * @param filter The filter to apply to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of groups for the current tenant. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String tenantId, String filter) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), filter, this.client.getApiVersion(), tenantId, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().odataNextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets list of groups for the current tenant. - * - * @param tenantId The tenant ID. - * @param filter The filter to apply to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of groups for the current tenant. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String tenantId, String filter, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), filter, this.client.getApiVersion(), tenantId, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().odataNextLink(), - null)); - } - - /** - * Gets list of groups for the current tenant. - * - * @param tenantId The tenant ID. - * @param filter The filter to apply to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of groups for the current tenant. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String tenantId, String filter) { - return new PagedFlux<>( - () -> listSinglePageAsync(tenantId, filter), nextLink -> listNextSinglePageAsync(nextLink, tenantId)); - } - - /** - * Gets list of groups for the current tenant. - * - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of groups for the current tenant. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String tenantId) { - final String filter = null; - return new PagedFlux<>( - () -> listSinglePageAsync(tenantId, filter), nextLink -> listNextSinglePageAsync(nextLink, tenantId)); - } - - /** - * Gets list of groups for the current tenant. - * - * @param tenantId The tenant ID. - * @param filter The filter to apply to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of groups for the current tenant. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String tenantId, String filter, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(tenantId, filter, context), - nextLink -> listNextSinglePageAsync(nextLink, tenantId, context)); - } - - /** - * Gets list of groups for the current tenant. - * - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of groups for the current tenant. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String tenantId) { - final String filter = null; - return new PagedIterable<>(listAsync(tenantId, filter)); - } - - /** - * Gets list of groups for the current tenant. - * - * @param tenantId The tenant ID. - * @param filter The filter to apply to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of groups for the current tenant. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String tenantId, String filter, Context context) { - return new PagedIterable<>(listAsync(tenantId, filter, context)); - } - - /** - * Gets the members of a group. - * - * @param objectId The object ID of the group whose members should be retrieved. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the members of a group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getGroupMembersSinglePageAsync(String objectId, String tenantId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (objectId == null) { - return Mono.error(new IllegalArgumentException("Parameter objectId is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .getGroupMembers( - this.client.getEndpoint(), - objectId, - this.client.getApiVersion(), - tenantId, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().odataNextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the members of a group. - * - * @param objectId The object ID of the group whose members should be retrieved. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the members of a group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getGroupMembersSinglePageAsync( - String objectId, String tenantId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (objectId == null) { - return Mono.error(new IllegalArgumentException("Parameter objectId is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .getGroupMembers( - this.client.getEndpoint(), objectId, this.client.getApiVersion(), tenantId, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().odataNextLink(), - null)); - } - - /** - * Gets the members of a group. - * - * @param objectId The object ID of the group whose members should be retrieved. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the members of a group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux getGroupMembersAsync(String objectId, String tenantId) { - return new PagedFlux<>( - () -> getGroupMembersSinglePageAsync(objectId, tenantId), - nextLink -> getGroupMembersNextSinglePageAsync(nextLink, tenantId)); - } - - /** - * Gets the members of a group. - * - * @param objectId The object ID of the group whose members should be retrieved. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the members of a group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux getGroupMembersAsync(String objectId, String tenantId, Context context) { - return new PagedFlux<>( - () -> getGroupMembersSinglePageAsync(objectId, tenantId, context), - nextLink -> getGroupMembersNextSinglePageAsync(nextLink, tenantId, context)); - } - - /** - * Gets the members of a group. - * - * @param objectId The object ID of the group whose members should be retrieved. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the members of a group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable getGroupMembers(String objectId, String tenantId) { - return new PagedIterable<>(getGroupMembersAsync(objectId, tenantId)); - } - - /** - * Gets the members of a group. - * - * @param objectId The object ID of the group whose members should be retrieved. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the members of a group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable getGroupMembers(String objectId, String tenantId, Context context) { - return new PagedIterable<>(getGroupMembersAsync(objectId, tenantId, context)); - } - - /** - * Gets group information from the directory. - * - * @param objectId The object ID of the user for which to get group information. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return group information from the directory. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync(String objectId, String tenantId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (objectId == null) { - return Mono.error(new IllegalArgumentException("Parameter objectId is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - objectId, - this.client.getApiVersion(), - tenantId, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets group information from the directory. - * - * @param objectId The object ID of the user for which to get group information. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return group information from the directory. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String objectId, String tenantId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (objectId == null) { - return Mono.error(new IllegalArgumentException("Parameter objectId is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), objectId, this.client.getApiVersion(), tenantId, accept, context); - } - - /** - * Gets group information from the directory. - * - * @param objectId The object ID of the user for which to get group information. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return group information from the directory. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync(String objectId, String tenantId) { - return getWithResponseAsync(objectId, tenantId) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets group information from the directory. - * - * @param objectId The object ID of the user for which to get group information. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return group information from the directory. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ADGroupInner get(String objectId, String tenantId) { - return getAsync(objectId, tenantId).block(); - } - - /** - * Gets group information from the directory. - * - * @param objectId The object ID of the user for which to get group information. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return group information from the directory. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String objectId, String tenantId, Context context) { - return getWithResponseAsync(objectId, tenantId, context).block(); - } - - /** - * Delete a group from the directory. - * - * @param objectId The object ID of the group to delete. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String objectId, String tenantId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (objectId == null) { - return Mono.error(new IllegalArgumentException("Parameter objectId is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - objectId, - this.client.getApiVersion(), - tenantId, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete a group from the directory. - * - * @param objectId The object ID of the group to delete. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String objectId, String tenantId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (objectId == null) { - return Mono.error(new IllegalArgumentException("Parameter objectId is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .delete(this.client.getEndpoint(), objectId, this.client.getApiVersion(), tenantId, accept, context); - } - - /** - * Delete a group from the directory. - * - * @param objectId The object ID of the group to delete. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String objectId, String tenantId) { - return deleteWithResponseAsync(objectId, tenantId).flatMap((Response res) -> Mono.empty()); - } - - /** - * Delete a group from the directory. - * - * @param objectId The object ID of the group to delete. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String objectId, String tenantId) { - deleteAsync(objectId, tenantId).block(); - } - - /** - * Delete a group from the directory. - * - * @param objectId The object ID of the group to delete. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String objectId, String tenantId, Context context) { - return deleteWithResponseAsync(objectId, tenantId, context).block(); - } - - /** - * Gets a collection of object IDs of groups of which the specified group is a member. - * - * @param objectId The object ID of the group for which to get group membership. - * @param tenantId The tenant ID. - * @param parameters Group filtering parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a collection of object IDs of groups of which the specified group is a member. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getMemberGroupsSinglePageAsync( - String objectId, String tenantId, GroupGetMemberGroupsParameters parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (objectId == null) { - return Mono.error(new IllegalArgumentException("Parameter objectId is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .getMemberGroups( - this.client.getEndpoint(), - objectId, - this.client.getApiVersion(), - tenantId, - parameters, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a collection of object IDs of groups of which the specified group is a member. - * - * @param objectId The object ID of the group for which to get group membership. - * @param tenantId The tenant ID. - * @param parameters Group filtering parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a collection of object IDs of groups of which the specified group is a member. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getMemberGroupsSinglePageAsync( - String objectId, String tenantId, GroupGetMemberGroupsParameters parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (objectId == null) { - return Mono.error(new IllegalArgumentException("Parameter objectId is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .getMemberGroups( - this.client.getEndpoint(), objectId, this.client.getApiVersion(), tenantId, parameters, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); - } - - /** - * Gets a collection of object IDs of groups of which the specified group is a member. - * - * @param objectId The object ID of the group for which to get group membership. - * @param tenantId The tenant ID. - * @param parameters Group filtering parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a collection of object IDs of groups of which the specified group is a member. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux getMemberGroupsAsync( - String objectId, String tenantId, GroupGetMemberGroupsParameters parameters) { - return new PagedFlux<>(() -> getMemberGroupsSinglePageAsync(objectId, tenantId, parameters)); - } - - /** - * Gets a collection of object IDs of groups of which the specified group is a member. - * - * @param objectId The object ID of the group for which to get group membership. - * @param tenantId The tenant ID. - * @param parameters Group filtering parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a collection of object IDs of groups of which the specified group is a member. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux getMemberGroupsAsync( - String objectId, String tenantId, GroupGetMemberGroupsParameters parameters, Context context) { - return new PagedFlux<>(() -> getMemberGroupsSinglePageAsync(objectId, tenantId, parameters, context)); - } - - /** - * Gets a collection of object IDs of groups of which the specified group is a member. - * - * @param objectId The object ID of the group for which to get group membership. - * @param tenantId The tenant ID. - * @param parameters Group filtering parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a collection of object IDs of groups of which the specified group is a member. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable getMemberGroups( - String objectId, String tenantId, GroupGetMemberGroupsParameters parameters) { - return new PagedIterable<>(getMemberGroupsAsync(objectId, tenantId, parameters)); - } - - /** - * Gets a collection of object IDs of groups of which the specified group is a member. - * - * @param objectId The object ID of the group for which to get group membership. - * @param tenantId The tenant ID. - * @param parameters Group filtering parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a collection of object IDs of groups of which the specified group is a member. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable getMemberGroups( - String objectId, String tenantId, GroupGetMemberGroupsParameters parameters, Context context) { - return new PagedIterable<>(getMemberGroupsAsync(objectId, tenantId, parameters, context)); - } - - /** - * The owners are a set of non-admin users who are allowed to modify this object. - * - * @param objectId The object ID of the group for which to get owners. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return directoryObject list operation result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listOwnersSinglePageAsync(String objectId, String tenantId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (objectId == null) { - return Mono.error(new IllegalArgumentException("Parameter objectId is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .listOwners( - this.client.getEndpoint(), - objectId, - this.client.getApiVersion(), - tenantId, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().odataNextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * The owners are a set of non-admin users who are allowed to modify this object. - * - * @param objectId The object ID of the group for which to get owners. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return directoryObject list operation result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listOwnersSinglePageAsync( - String objectId, String tenantId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (objectId == null) { - return Mono.error(new IllegalArgumentException("Parameter objectId is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .listOwners(this.client.getEndpoint(), objectId, this.client.getApiVersion(), tenantId, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().odataNextLink(), - null)); - } - - /** - * The owners are a set of non-admin users who are allowed to modify this object. - * - * @param objectId The object ID of the group for which to get owners. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return directoryObject list operation result. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listOwnersAsync(String objectId, String tenantId) { - return new PagedFlux<>( - () -> listOwnersSinglePageAsync(objectId, tenantId), nextLink -> listOwnersNextSinglePageAsync(nextLink)); - } - - /** - * The owners are a set of non-admin users who are allowed to modify this object. - * - * @param objectId The object ID of the group for which to get owners. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return directoryObject list operation result. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listOwnersAsync(String objectId, String tenantId, Context context) { - return new PagedFlux<>( - () -> listOwnersSinglePageAsync(objectId, tenantId, context), - nextLink -> listOwnersNextSinglePageAsync(nextLink, context)); - } - - /** - * The owners are a set of non-admin users who are allowed to modify this object. - * - * @param objectId The object ID of the group for which to get owners. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return directoryObject list operation result. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listOwners(String objectId, String tenantId) { - return new PagedIterable<>(listOwnersAsync(objectId, tenantId)); - } - - /** - * The owners are a set of non-admin users who are allowed to modify this object. - * - * @param objectId The object ID of the group for which to get owners. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return directoryObject list operation result. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listOwners(String objectId, String tenantId, Context context) { - return new PagedIterable<>(listOwnersAsync(objectId, tenantId, context)); - } - - /** - * Add an owner to a group. - * - * @param objectId The object ID of the application to which to add the owner. - * @param tenantId The tenant ID. - * @param parameters The URL of the owner object, such as - * https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects/f260bbc4-c254-447b-94cf-293b5ec434dd. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> addOwnerWithResponseAsync( - String objectId, String tenantId, AddOwnerParameters parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (objectId == null) { - return Mono.error(new IllegalArgumentException("Parameter objectId is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .addOwner( - this.client.getEndpoint(), - objectId, - this.client.getApiVersion(), - tenantId, - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Add an owner to a group. - * - * @param objectId The object ID of the application to which to add the owner. - * @param tenantId The tenant ID. - * @param parameters The URL of the owner object, such as - * https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects/f260bbc4-c254-447b-94cf-293b5ec434dd. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> addOwnerWithResponseAsync( - String objectId, String tenantId, AddOwnerParameters parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (objectId == null) { - return Mono.error(new IllegalArgumentException("Parameter objectId is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .addOwner( - this.client.getEndpoint(), - objectId, - this.client.getApiVersion(), - tenantId, - parameters, - accept, - context); - } - - /** - * Add an owner to a group. - * - * @param objectId The object ID of the application to which to add the owner. - * @param tenantId The tenant ID. - * @param parameters The URL of the owner object, such as - * https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects/f260bbc4-c254-447b-94cf-293b5ec434dd. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono addOwnerAsync(String objectId, String tenantId, AddOwnerParameters parameters) { - return addOwnerWithResponseAsync(objectId, tenantId, parameters).flatMap((Response res) -> Mono.empty()); - } - - /** - * Add an owner to a group. - * - * @param objectId The object ID of the application to which to add the owner. - * @param tenantId The tenant ID. - * @param parameters The URL of the owner object, such as - * https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects/f260bbc4-c254-447b-94cf-293b5ec434dd. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void addOwner(String objectId, String tenantId, AddOwnerParameters parameters) { - addOwnerAsync(objectId, tenantId, parameters).block(); - } - - /** - * Add an owner to a group. - * - * @param objectId The object ID of the application to which to add the owner. - * @param tenantId The tenant ID. - * @param parameters The URL of the owner object, such as - * https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects/f260bbc4-c254-447b-94cf-293b5ec434dd. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response addOwnerWithResponse( - String objectId, String tenantId, AddOwnerParameters parameters, Context context) { - return addOwnerWithResponseAsync(objectId, tenantId, parameters, context).block(); - } - - /** - * Remove a member from owners. - * - * @param objectId The object ID of the group from which to remove the owner. - * @param ownerObjectId Owner object id. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> removeOwnerWithResponseAsync(String objectId, String ownerObjectId, String tenantId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (objectId == null) { - return Mono.error(new IllegalArgumentException("Parameter objectId is required and cannot be null.")); - } - if (ownerObjectId == null) { - return Mono.error(new IllegalArgumentException("Parameter ownerObjectId is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .removeOwner( - this.client.getEndpoint(), - objectId, - ownerObjectId, - this.client.getApiVersion(), - tenantId, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Remove a member from owners. - * - * @param objectId The object ID of the group from which to remove the owner. - * @param ownerObjectId Owner object id. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> removeOwnerWithResponseAsync( - String objectId, String ownerObjectId, String tenantId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (objectId == null) { - return Mono.error(new IllegalArgumentException("Parameter objectId is required and cannot be null.")); - } - if (ownerObjectId == null) { - return Mono.error(new IllegalArgumentException("Parameter ownerObjectId is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .removeOwner( - this.client.getEndpoint(), - objectId, - ownerObjectId, - this.client.getApiVersion(), - tenantId, - accept, - context); - } - - /** - * Remove a member from owners. - * - * @param objectId The object ID of the group from which to remove the owner. - * @param ownerObjectId Owner object id. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono removeOwnerAsync(String objectId, String ownerObjectId, String tenantId) { - return removeOwnerWithResponseAsync(objectId, ownerObjectId, tenantId) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Remove a member from owners. - * - * @param objectId The object ID of the group from which to remove the owner. - * @param ownerObjectId Owner object id. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void removeOwner(String objectId, String ownerObjectId, String tenantId) { - removeOwnerAsync(objectId, ownerObjectId, tenantId).block(); - } - - /** - * Remove a member from owners. - * - * @param objectId The object ID of the group from which to remove the owner. - * @param ownerObjectId Owner object id. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response removeOwnerWithResponse( - String objectId, String ownerObjectId, String tenantId, Context context) { - return removeOwnerWithResponseAsync(objectId, ownerObjectId, tenantId, context).block(); - } - - /** - * Gets a list of groups for the current tenant. - * - * @param nextLink Next link for the list operation. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of groups for the current tenant. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, String tenantId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .listNext( - this.client.getEndpoint(), - nextLink, - this.client.getApiVersion(), - tenantId, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().odataNextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a list of groups for the current tenant. - * - * @param nextLink Next link for the list operation. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of groups for the current tenant. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync( - String nextLink, String tenantId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .listNext(this.client.getEndpoint(), nextLink, this.client.getApiVersion(), tenantId, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().odataNextLink(), - null)); - } - - /** - * Gets the members of a group. - * - * @param nextLink Next link for the list operation. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the members of a group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getGroupMembersNextSinglePageAsync( - String nextLink, String tenantId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .getGroupMembersNext( - this.client.getEndpoint(), - nextLink, - this.client.getApiVersion(), - tenantId, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().odataNextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the members of a group. - * - * @param nextLink Next link for the list operation. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the members of a group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getGroupMembersNextSinglePageAsync( - String nextLink, String tenantId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .getGroupMembersNext( - this.client.getEndpoint(), nextLink, this.client.getApiVersion(), tenantId, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().odataNextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return directoryObject list operation result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listOwnersNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext(context -> service.listOwnersNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().odataNextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return directoryObject list operation result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listOwnersNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .listOwnersNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().odataNextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/HasCredential.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/HasCredential.java deleted file mode 100644 index 34def983c38a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/HasCredential.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.authorization.implementation; - -import com.azure.core.annotation.Fluent; - -/** An interface representing a model that can attach a credential. */ -@Fluent -interface HasCredential> { - /** - * Attach a credential to this model. - * - * @param credential the credential to attach to - * @return the interface itself - */ - T withCertificateCredential(CertificateCredentialImpl credential); - /** - * Attach a credential to this model. - * - * @param credential the credential to attach to - * @return the interface itself - */ - T withPasswordCredential(PasswordCredentialImpl credential); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/OAuth2PermissionGrantsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/OAuth2PermissionGrantsClientImpl.java deleted file mode 100644 index 0ebb1db80604..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/OAuth2PermissionGrantsClientImpl.java +++ /dev/null @@ -1,623 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.authorization.fluent.OAuth2PermissionGrantsClient; -import com.azure.resourcemanager.authorization.fluent.models.OAuth2PermissionGrantInner; -import com.azure.resourcemanager.authorization.models.GraphErrorException; -import com.azure.resourcemanager.authorization.models.OAuth2PermissionGrantListResult; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in OAuth2PermissionGrantsClient. */ -public final class OAuth2PermissionGrantsClientImpl implements InnerSupportsDelete, OAuth2PermissionGrantsClient { - private final ClientLogger logger = new ClientLogger(OAuth2PermissionGrantsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final OAuth2PermissionGrantsService service; - - /** The service client containing this operation class. */ - private final GraphRbacManagementClientImpl client; - - /** - * Initializes an instance of OAuth2PermissionGrantsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - OAuth2PermissionGrantsClientImpl(GraphRbacManagementClientImpl client) { - this.service = - RestProxy - .create(OAuth2PermissionGrantsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for GraphRbacManagementClientOAuth2PermissionGrants to be used by the - * proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "GraphRbacManagementC") - private interface OAuth2PermissionGrantsService { - @Headers({"Content-Type: application/json"}) - @Get("/{tenantID}/oauth2PermissionGrants") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("$filter") String filter, - @QueryParam("api-version") String apiVersion, - @PathParam("tenantID") String tenantId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post("/{tenantID}/oauth2PermissionGrants") - @ExpectedResponses({201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> create( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("tenantID") String tenantId, - @BodyParam("application/json") OAuth2PermissionGrantInner body, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete("/{tenantID}/oauth2PermissionGrants/{objectId}") - @ExpectedResponses({204}) - @UnexpectedResponseExceptionType(GraphErrorException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @PathParam("objectId") String objectId, - @QueryParam("api-version") String apiVersion, - @PathParam("tenantID") String tenantId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/{tenantID}/{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(GraphErrorException.class) - Mono> listNext( - @HostParam("$host") String endpoint, - @PathParam(value = "nextLink", encoded = true) String nextLink, - @QueryParam("api-version") String apiVersion, - @PathParam("tenantID") String tenantId, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Queries OAuth2 permissions grants for the relevant SP ObjectId of an app. - * - * @param tenantId The tenant ID. - * @param filter This is the Service Principal ObjectId associated with the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return server response for get oauth2 permissions grants. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String tenantId, String filter) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), filter, this.client.getApiVersion(), tenantId, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().odataNextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Queries OAuth2 permissions grants for the relevant SP ObjectId of an app. - * - * @param tenantId The tenant ID. - * @param filter This is the Service Principal ObjectId associated with the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return server response for get oauth2 permissions grants. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String tenantId, String filter, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), filter, this.client.getApiVersion(), tenantId, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().odataNextLink(), - null)); - } - - /** - * Queries OAuth2 permissions grants for the relevant SP ObjectId of an app. - * - * @param tenantId The tenant ID. - * @param filter This is the Service Principal ObjectId associated with the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return server response for get oauth2 permissions grants. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String tenantId, String filter) { - return new PagedFlux<>( - () -> listSinglePageAsync(tenantId, filter), nextLink -> listNextSinglePageAsync(nextLink, tenantId)); - } - - /** - * Queries OAuth2 permissions grants for the relevant SP ObjectId of an app. - * - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return server response for get oauth2 permissions grants. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String tenantId) { - final String filter = null; - return new PagedFlux<>( - () -> listSinglePageAsync(tenantId, filter), nextLink -> listNextSinglePageAsync(nextLink, tenantId)); - } - - /** - * Queries OAuth2 permissions grants for the relevant SP ObjectId of an app. - * - * @param tenantId The tenant ID. - * @param filter This is the Service Principal ObjectId associated with the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return server response for get oauth2 permissions grants. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String tenantId, String filter, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(tenantId, filter, context), - nextLink -> listNextSinglePageAsync(nextLink, tenantId, context)); - } - - /** - * Queries OAuth2 permissions grants for the relevant SP ObjectId of an app. - * - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return server response for get oauth2 permissions grants. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String tenantId) { - final String filter = null; - return new PagedIterable<>(listAsync(tenantId, filter)); - } - - /** - * Queries OAuth2 permissions grants for the relevant SP ObjectId of an app. - * - * @param tenantId The tenant ID. - * @param filter This is the Service Principal ObjectId associated with the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return server response for get oauth2 permissions grants. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String tenantId, String filter, Context context) { - return new PagedIterable<>(listAsync(tenantId, filter, context)); - } - - /** - * Grants OAuth2 permissions for the relevant resource Ids of an app. - * - * @param tenantId The tenant ID. - * @param body The relevant app Service Principal Object Id and the Service Principal Object Id you want to grant. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createWithResponseAsync( - String tenantId, OAuth2PermissionGrantInner body) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - if (body != null) { - body.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .create( - this.client.getEndpoint(), this.client.getApiVersion(), tenantId, body, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Grants OAuth2 permissions for the relevant resource Ids of an app. - * - * @param tenantId The tenant ID. - * @param body The relevant app Service Principal Object Id and the Service Principal Object Id you want to grant. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync( - String tenantId, OAuth2PermissionGrantInner body, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - if (body != null) { - body.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.create(this.client.getEndpoint(), this.client.getApiVersion(), tenantId, body, accept, context); - } - - /** - * Grants OAuth2 permissions for the relevant resource Ids of an app. - * - * @param tenantId The tenant ID. - * @param body The relevant app Service Principal Object Id and the Service Principal Object Id you want to grant. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createAsync(String tenantId, OAuth2PermissionGrantInner body) { - return createWithResponseAsync(tenantId, body) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Grants OAuth2 permissions for the relevant resource Ids of an app. - * - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createAsync(String tenantId) { - final OAuth2PermissionGrantInner body = null; - return createWithResponseAsync(tenantId, body) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Grants OAuth2 permissions for the relevant resource Ids of an app. - * - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public OAuth2PermissionGrantInner create(String tenantId) { - final OAuth2PermissionGrantInner body = null; - return createAsync(tenantId, body).block(); - } - - /** - * Grants OAuth2 permissions for the relevant resource Ids of an app. - * - * @param tenantId The tenant ID. - * @param body The relevant app Service Principal Object Id and the Service Principal Object Id you want to grant. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse( - String tenantId, OAuth2PermissionGrantInner body, Context context) { - return createWithResponseAsync(tenantId, body, context).block(); - } - - /** - * Delete a OAuth2 permission grant for the relevant resource Ids of an app. - * - * @param objectId The object ID of a permission grant. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String objectId, String tenantId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (objectId == null) { - return Mono.error(new IllegalArgumentException("Parameter objectId is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - objectId, - this.client.getApiVersion(), - tenantId, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete a OAuth2 permission grant for the relevant resource Ids of an app. - * - * @param objectId The object ID of a permission grant. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String objectId, String tenantId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (objectId == null) { - return Mono.error(new IllegalArgumentException("Parameter objectId is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .delete(this.client.getEndpoint(), objectId, this.client.getApiVersion(), tenantId, accept, context); - } - - /** - * Delete a OAuth2 permission grant for the relevant resource Ids of an app. - * - * @param objectId The object ID of a permission grant. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String objectId, String tenantId) { - return deleteWithResponseAsync(objectId, tenantId).flatMap((Response res) -> Mono.empty()); - } - - /** - * Delete a OAuth2 permission grant for the relevant resource Ids of an app. - * - * @param objectId The object ID of a permission grant. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String objectId, String tenantId) { - deleteAsync(objectId, tenantId).block(); - } - - /** - * Delete a OAuth2 permission grant for the relevant resource Ids of an app. - * - * @param objectId The object ID of a permission grant. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String objectId, String tenantId, Context context) { - return deleteWithResponseAsync(objectId, tenantId, context).block(); - } - - /** - * Gets the next page of OAuth2 permission grants. - * - * @param nextLink Next link for the list operation. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the next page of OAuth2 permission grants. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, String tenantId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .listNext( - this.client.getEndpoint(), - nextLink, - this.client.getApiVersion(), - tenantId, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().odataNextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the next page of OAuth2 permission grants. - * - * @param nextLink Next link for the list operation. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the next page of OAuth2 permission grants. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync( - String nextLink, String tenantId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .listNext(this.client.getEndpoint(), nextLink, this.client.getApiVersion(), tenantId, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().odataNextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/ObjectsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/ObjectsClientImpl.java deleted file mode 100644 index cf3a45797ca5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/ObjectsClientImpl.java +++ /dev/null @@ -1,348 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.authorization.fluent.ObjectsClient; -import com.azure.resourcemanager.authorization.fluent.models.DirectoryObjectInner; -import com.azure.resourcemanager.authorization.models.DirectoryObjectListResult; -import com.azure.resourcemanager.authorization.models.GetObjectsParameters; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ObjectsClient. */ -public final class ObjectsClientImpl implements ObjectsClient { - private final ClientLogger logger = new ClientLogger(ObjectsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final ObjectsService service; - - /** The service client containing this operation class. */ - private final GraphRbacManagementClientImpl client; - - /** - * Initializes an instance of ObjectsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ObjectsClientImpl(GraphRbacManagementClientImpl client) { - this.service = RestProxy.create(ObjectsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for GraphRbacManagementClientObjects to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "GraphRbacManagementC") - private interface ObjectsService { - @Headers({"Content-Type: application/json"}) - @Post("/{tenantID}/getObjectsByObjectIds") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getObjectsByObjectIds( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("tenantID") String tenantId, - @BodyParam("application/json") GetObjectsParameters parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post("/{tenantID}/{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getObjectsByObjectIdsNext( - @HostParam("$host") String endpoint, - @PathParam(value = "nextLink", encoded = true) String nextLink, - @QueryParam("api-version") String apiVersion, - @PathParam("tenantID") String tenantId, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets the directory objects specified in a list of object IDs. You can also specify which resource collections - * (users, groups, etc.) should be searched by specifying the optional types parameter. - * - * @param tenantId The tenant ID. - * @param parameters Objects filtering parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the directory objects specified in a list of object IDs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getObjectsByObjectIdsSinglePageAsync( - String tenantId, GetObjectsParameters parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .getObjectsByObjectIds( - this.client.getEndpoint(), - this.client.getApiVersion(), - tenantId, - parameters, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().odataNextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the directory objects specified in a list of object IDs. You can also specify which resource collections - * (users, groups, etc.) should be searched by specifying the optional types parameter. - * - * @param tenantId The tenant ID. - * @param parameters Objects filtering parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the directory objects specified in a list of object IDs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getObjectsByObjectIdsSinglePageAsync( - String tenantId, GetObjectsParameters parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .getObjectsByObjectIds( - this.client.getEndpoint(), this.client.getApiVersion(), tenantId, parameters, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().odataNextLink(), - null)); - } - - /** - * Gets the directory objects specified in a list of object IDs. You can also specify which resource collections - * (users, groups, etc.) should be searched by specifying the optional types parameter. - * - * @param tenantId The tenant ID. - * @param parameters Objects filtering parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the directory objects specified in a list of object IDs. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux getObjectsByObjectIdsAsync( - String tenantId, GetObjectsParameters parameters) { - return new PagedFlux<>( - () -> getObjectsByObjectIdsSinglePageAsync(tenantId, parameters), - nextLink -> getObjectsByObjectIdsNextSinglePageAsync(nextLink, tenantId)); - } - - /** - * Gets the directory objects specified in a list of object IDs. You can also specify which resource collections - * (users, groups, etc.) should be searched by specifying the optional types parameter. - * - * @param tenantId The tenant ID. - * @param parameters Objects filtering parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the directory objects specified in a list of object IDs. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux getObjectsByObjectIdsAsync( - String tenantId, GetObjectsParameters parameters, Context context) { - return new PagedFlux<>( - () -> getObjectsByObjectIdsSinglePageAsync(tenantId, parameters, context), - nextLink -> getObjectsByObjectIdsNextSinglePageAsync(nextLink, tenantId, context)); - } - - /** - * Gets the directory objects specified in a list of object IDs. You can also specify which resource collections - * (users, groups, etc.) should be searched by specifying the optional types parameter. - * - * @param tenantId The tenant ID. - * @param parameters Objects filtering parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the directory objects specified in a list of object IDs. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable getObjectsByObjectIds(String tenantId, GetObjectsParameters parameters) { - return new PagedIterable<>(getObjectsByObjectIdsAsync(tenantId, parameters)); - } - - /** - * Gets the directory objects specified in a list of object IDs. You can also specify which resource collections - * (users, groups, etc.) should be searched by specifying the optional types parameter. - * - * @param tenantId The tenant ID. - * @param parameters Objects filtering parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the directory objects specified in a list of object IDs. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable getObjectsByObjectIds( - String tenantId, GetObjectsParameters parameters, Context context) { - return new PagedIterable<>(getObjectsByObjectIdsAsync(tenantId, parameters, context)); - } - - /** - * Gets AD group membership for the specified AD object IDs. - * - * @param nextLink Next link for the list operation. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return aD group membership for the specified AD object IDs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getObjectsByObjectIdsNextSinglePageAsync( - String nextLink, String tenantId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .getObjectsByObjectIdsNext( - this.client.getEndpoint(), - nextLink, - this.client.getApiVersion(), - tenantId, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().odataNextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets AD group membership for the specified AD object IDs. - * - * @param nextLink Next link for the list operation. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return aD group membership for the specified AD object IDs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getObjectsByObjectIdsNextSinglePageAsync( - String nextLink, String tenantId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .getObjectsByObjectIdsNext( - this.client.getEndpoint(), nextLink, this.client.getApiVersion(), tenantId, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().odataNextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/PasswordCredentialImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/PasswordCredentialImpl.java deleted file mode 100644 index 1d32184b8571..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/PasswordCredentialImpl.java +++ /dev/null @@ -1,169 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.authorization.implementation; - -import com.azure.core.management.AzureEnvironment; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.authorization.models.PasswordCredential; -import com.azure.resourcemanager.authorization.fluent.models.PasswordCredentialInner; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.IndexableRefreshableWrapperImpl; -import reactor.core.publisher.Mono; - -import java.io.IOException; -import java.io.OutputStream; -import java.nio.charset.StandardCharsets; -import java.time.Duration; -import java.time.OffsetDateTime; -import java.util.Base64; - -/** Implementation for ServicePrincipal and its parent interfaces. */ -class PasswordCredentialImpl> - extends IndexableRefreshableWrapperImpl - implements PasswordCredential, PasswordCredential.Definition, PasswordCredential.UpdateDefinition { - - private String name; - private HasCredential parent; - OutputStream authFile; - private String subscriptionId; - private final ClientLogger logger = new ClientLogger(PasswordCredentialImpl.class); - - PasswordCredentialImpl(PasswordCredentialInner passwordCredential) { - super(passwordCredential); - if (passwordCredential.customKeyIdentifier() != null && passwordCredential.customKeyIdentifier().length > 0) { - this.name = new String( - Base64.getMimeDecoder().decode( - new String(passwordCredential.customKeyIdentifier(), StandardCharsets.UTF_8)), - StandardCharsets.UTF_8); - } else { - this.name = passwordCredential.keyId(); - } - } - - PasswordCredentialImpl(String name, HasCredential parent) { - super( - new PasswordCredentialInner() - .withCustomKeyIdentifier(Base64.getEncoder().encode(name.getBytes(StandardCharsets.UTF_8))) - .withStartDate(OffsetDateTime.now()) - .withEndDate(OffsetDateTime.now().plusYears(1))); - this.name = name; - this.parent = parent; - } - - @Override - public Mono refreshAsync() { - throw logger.logExceptionAsError(new UnsupportedOperationException("Cannot refresh credentials.")); - } - - @Override - protected Mono getInnerAsync() { - throw logger.logExceptionAsError(new UnsupportedOperationException("Cannot refresh credentials.")); - } - - @Override - public OffsetDateTime startDate() { - return innerModel().startDate(); - } - - @Override - public OffsetDateTime endDate() { - return innerModel().endDate(); - } - - @Override - public String value() { - return innerModel().value(); - } - - @Override - public T attach() { - return parent.withPasswordCredential(this); - } - - @Override - public PasswordCredentialImpl withPasswordValue(String password) { - innerModel().withValue(password); - return this; - } - - @Override - public PasswordCredentialImpl withStartDate(OffsetDateTime startDate) { - OffsetDateTime original = startDate(); - innerModel().withStartDate(startDate); - // Adjust end time - withDuration(Duration.between(original, endDate())); - return this; - } - - @Override - public PasswordCredentialImpl withDuration(Duration duration) { - innerModel().withEndDate(startDate().plus(duration)); - return this; - } - - @Override - public PasswordCredentialImpl withAuthFileToExport(OutputStream outputStream) { - this.authFile = outputStream; - return this; - } - - void exportAuthFile(ServicePrincipalImpl servicePrincipal) { - if (authFile == null) { - return; - } - AzureEnvironment environment = AzureEnvironment.AZURE; - - StringBuilder builder = new StringBuilder("{\n"); - builder - .append(" ") - .append(String.format("\"clientId\": \"%s\",", servicePrincipal.applicationId())) - .append("\n"); - builder.append(" ").append(String.format("\"clientSecret\": \"%s\",", value())).append("\n"); - builder - .append(" ") - .append(String.format("\"tenantId\": \"%s\",", servicePrincipal.manager().tenantId())) - .append("\n"); - builder - .append(" ") - .append(String.format("\"subscriptionId\": \"%s\",", servicePrincipal.assignedSubscription)) - .append("\n"); - builder - .append(" ") - .append(String.format("\"activeDirectoryEndpointUrl\": \"%s\",", environment.getActiveDirectoryEndpoint())) - .append("\n"); - builder - .append(" ") - .append(String.format("\"resourceManagerEndpointUrl\": \"%s\",", environment.getResourceManagerEndpoint())) - .append("\n"); - builder - .append(" ") - .append(String.format("\"activeDirectoryGraphResourceId\": \"%s\",", environment.getGraphEndpoint())) - .append("\n"); - builder - .append(" ") - .append(String.format("\"managementEndpointUrl\": \"%s\"", environment.getManagementEndpoint())) - .append("\n"); - builder.append("}"); - try { - authFile.write(builder.toString().getBytes(StandardCharsets.UTF_8)); - } catch (IOException e) { - throw logger.logExceptionAsError(new RuntimeException(e)); - } - } - - @Override - public PasswordCredentialImpl withSubscriptionId(String subscriptionId) { - this.subscriptionId = subscriptionId; - return this; - } - - @Override - public String id() { - return innerModel().keyId(); - } - - @Override - public String name() { - return this.name; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/PermissionImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/PermissionImpl.java deleted file mode 100644 index 6b5ca22d00d0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/PermissionImpl.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.authorization.implementation; - -import com.azure.resourcemanager.authorization.models.Permission; -import com.azure.resourcemanager.authorization.fluent.models.PermissionInner; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.WrapperImpl; -import java.util.List; - -/** Implementation for Permission and its parent interfaces. */ -class PermissionImpl extends WrapperImpl implements Permission { - protected PermissionImpl(PermissionInner innerObject) { - super(innerObject); - } - - @Override - public List actions() { - return innerModel().actions(); - } - - @Override - public List notActions() { - return innerModel().notActions(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/PermissionsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/PermissionsClientImpl.java deleted file mode 100644 index 0db3aa264431..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/PermissionsClientImpl.java +++ /dev/null @@ -1,693 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.authorization.fluent.PermissionsClient; -import com.azure.resourcemanager.authorization.fluent.models.PermissionInner; -import com.azure.resourcemanager.authorization.models.PermissionGetResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in PermissionsClient. */ -public final class PermissionsClientImpl implements PermissionsClient { - private final ClientLogger logger = new ClientLogger(PermissionsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final PermissionsService service; - - /** The service client containing this operation class. */ - private final AuthorizationManagementClientImpl client; - - /** - * Initializes an instance of PermissionsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - PermissionsClientImpl(AuthorizationManagementClientImpl client) { - this.service = - RestProxy.create(PermissionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for AuthorizationManagementClientPermissions to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "AuthorizationManagem") - private interface PermissionsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Authorization" - + "/permissions") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}" - + "/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/permissions") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listForResource( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("resourceProviderNamespace") String resourceProviderNamespace, - @PathParam(value = "parentResourcePath", encoded = true) String parentResourcePath, - @PathParam(value = "resourceType", encoded = true) String resourceType, - @PathParam("resourceName") String resourceName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listForResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listForResourceNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets all permissions the caller has for a resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all permissions the caller has for a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all permissions the caller has for a resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all permissions the caller has for a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all permissions the caller has for a resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all permissions the caller has for a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listForResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * Gets all permissions the caller has for a resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all permissions the caller has for a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listForResourceGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all permissions the caller has for a resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all permissions the caller has for a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * Gets all permissions the caller has for a resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all permissions the caller has for a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * Gets all permissions the caller has for a resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource. - * @param resourceName The name of the resource to get the permissions for. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all permissions the caller has for a resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listForResourceSinglePageAsync( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceProviderNamespace == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter resourceProviderNamespace is required and cannot be null.")); - } - if (parentResourcePath == null) { - return Mono - .error(new IllegalArgumentException("Parameter parentResourcePath is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listForResource( - this.client.getEndpoint(), - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all permissions the caller has for a resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource. - * @param resourceName The name of the resource to get the permissions for. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all permissions the caller has for a resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listForResourceSinglePageAsync( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceProviderNamespace == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter resourceProviderNamespace is required and cannot be null.")); - } - if (parentResourcePath == null) { - return Mono - .error(new IllegalArgumentException("Parameter parentResourcePath is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listForResource( - this.client.getEndpoint(), - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all permissions the caller has for a resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource. - * @param resourceName The name of the resource to get the permissions for. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all permissions the caller has for a resource. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listForResourceAsync( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName) { - return new PagedFlux<>( - () -> - listForResourceSinglePageAsync( - resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName), - nextLink -> listForResourceNextSinglePageAsync(nextLink)); - } - - /** - * Gets all permissions the caller has for a resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource. - * @param resourceName The name of the resource to get the permissions for. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all permissions the caller has for a resource. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listForResourceAsync( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - Context context) { - return new PagedFlux<>( - () -> - listForResourceSinglePageAsync( - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - context), - nextLink -> listForResourceNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all permissions the caller has for a resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource. - * @param resourceName The name of the resource to get the permissions for. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all permissions the caller has for a resource. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listForResource( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName) { - return new PagedIterable<>( - listForResourceAsync( - resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName)); - } - - /** - * Gets all permissions the caller has for a resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource. - * @param resourceName The name of the resource to get the permissions for. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all permissions the caller has for a resource. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listForResource( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - Context context) { - return new PagedIterable<>( - listForResourceAsync( - resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return permissions information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listForResourceGroupNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listForResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return permissions information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listForResourceGroupNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listForResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return permissions information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listForResourceNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listForResourceNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return permissions information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listForResourceNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listForResourceNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/ProviderOperationsMetadatasClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/ProviderOperationsMetadatasClientImpl.java deleted file mode 100644 index 6226f76bec1b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/ProviderOperationsMetadatasClientImpl.java +++ /dev/null @@ -1,463 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.authorization.fluent.ProviderOperationsMetadatasClient; -import com.azure.resourcemanager.authorization.fluent.models.ProviderOperationsMetadataInner; -import com.azure.resourcemanager.authorization.models.ProviderOperationsMetadataListResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ProviderOperationsMetadatasClient. */ -public final class ProviderOperationsMetadatasClientImpl implements ProviderOperationsMetadatasClient { - private final ClientLogger logger = new ClientLogger(ProviderOperationsMetadatasClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final ProviderOperationsMetadatasService service; - - /** The service client containing this operation class. */ - private final AuthorizationManagementClientImpl client; - - /** - * Initializes an instance of ProviderOperationsMetadatasClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ProviderOperationsMetadatasClientImpl(AuthorizationManagementClientImpl client) { - this.service = - RestProxy - .create( - ProviderOperationsMetadatasService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for AuthorizationManagementClientProviderOperationsMetadatas to be used - * by the proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "AuthorizationManagem") - private interface ProviderOperationsMetadatasService { - @Headers({"Content-Type: application/json"}) - @Get("/providers/Microsoft.Authorization/providerOperations/{resourceProviderNamespace}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("resourceProviderNamespace") String resourceProviderNamespace, - @QueryParam("api-version") String apiVersion, - @QueryParam("$expand") String expand, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/providers/Microsoft.Authorization/providerOperations") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @QueryParam("$expand") String expand, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets provider operations metadata for the specified resource provider. - * - * @param resourceProviderNamespace The namespace of the resource provider. - * @param expand Specifies whether to expand the values. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return provider operations metadata for the specified resource provider. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String resourceProviderNamespace, String expand) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceProviderNamespace == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter resourceProviderNamespace is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - resourceProviderNamespace, - this.client.getApiVersion(), - expand, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets provider operations metadata for the specified resource provider. - * - * @param resourceProviderNamespace The namespace of the resource provider. - * @param expand Specifies whether to expand the values. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return provider operations metadata for the specified resource provider. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceProviderNamespace, String expand, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceProviderNamespace == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter resourceProviderNamespace is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - resourceProviderNamespace, - this.client.getApiVersion(), - expand, - accept, - context); - } - - /** - * Gets provider operations metadata for the specified resource provider. - * - * @param resourceProviderNamespace The namespace of the resource provider. - * @param expand Specifies whether to expand the values. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return provider operations metadata for the specified resource provider. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync(String resourceProviderNamespace, String expand) { - return getWithResponseAsync(resourceProviderNamespace, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets provider operations metadata for the specified resource provider. - * - * @param resourceProviderNamespace The namespace of the resource provider. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return provider operations metadata for the specified resource provider. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync(String resourceProviderNamespace) { - final String expand = null; - return getWithResponseAsync(resourceProviderNamespace, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets provider operations metadata for the specified resource provider. - * - * @param resourceProviderNamespace The namespace of the resource provider. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return provider operations metadata for the specified resource provider. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ProviderOperationsMetadataInner get(String resourceProviderNamespace) { - final String expand = null; - return getAsync(resourceProviderNamespace, expand).block(); - } - - /** - * Gets provider operations metadata for the specified resource provider. - * - * @param resourceProviderNamespace The namespace of the resource provider. - * @param expand Specifies whether to expand the values. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return provider operations metadata for the specified resource provider. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceProviderNamespace, String expand, Context context) { - return getWithResponseAsync(resourceProviderNamespace, expand, context).block(); - } - - /** - * Gets provider operations metadata for all resource providers. - * - * @param expand Specifies whether to expand the values. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return provider operations metadata for all resource providers. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String expand) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service.list(this.client.getEndpoint(), this.client.getApiVersion(), expand, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets provider operations metadata for all resource providers. - * - * @param expand Specifies whether to expand the values. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return provider operations metadata for all resource providers. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String expand, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), expand, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets provider operations metadata for all resource providers. - * - * @param expand Specifies whether to expand the values. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return provider operations metadata for all resource providers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String expand) { - return new PagedFlux<>(() -> listSinglePageAsync(expand), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets provider operations metadata for all resource providers. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return provider operations metadata for all resource providers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - final String expand = null; - return new PagedFlux<>(() -> listSinglePageAsync(expand), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets provider operations metadata for all resource providers. - * - * @param expand Specifies whether to expand the values. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return provider operations metadata for all resource providers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String expand, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(expand, context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets provider operations metadata for all resource providers. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return provider operations metadata for all resource providers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - final String expand = null; - return new PagedIterable<>(listAsync(expand)); - } - - /** - * Gets provider operations metadata for all resource providers. - * - * @param expand Specifies whether to expand the values. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return provider operations metadata for all resource providers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String expand, Context context) { - return new PagedIterable<>(listAsync(expand, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return provider operations metadata list. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return provider operations metadata list. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/RoleAssignmentImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/RoleAssignmentImpl.java deleted file mode 100644 index ac8f1a64fb76..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/RoleAssignmentImpl.java +++ /dev/null @@ -1,221 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.authorization.implementation; - -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.authorization.AuthorizationManager; -import com.azure.resourcemanager.authorization.models.ActiveDirectoryGroup; -import com.azure.resourcemanager.authorization.models.ActiveDirectoryUser; -import com.azure.resourcemanager.authorization.models.BuiltInRole; -import com.azure.resourcemanager.authorization.models.RoleAssignment; -import com.azure.resourcemanager.authorization.models.RoleAssignmentCreateParameters; -import com.azure.resourcemanager.authorization.models.ServicePrincipal; -import com.azure.resourcemanager.authorization.fluent.models.RoleAssignmentInner; -import com.azure.resourcemanager.resources.models.ResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.models.Resource; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.CreatableImpl; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import reactor.core.Exceptions; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; -import reactor.util.retry.Retry; - -import java.time.Duration; -import java.util.Locale; - -/** Implementation for ServicePrincipal and its parent interfaces. */ -class RoleAssignmentImpl extends CreatableImpl - implements RoleAssignment, RoleAssignment.Definition { - private AuthorizationManager manager; - // Active Directory identify info - private String objectId; - private String userName; - private String servicePrincipalName; - // role info - private String roleDefinitionId; - private String roleName; - private final ClientLogger logger = new ClientLogger(RoleAssignmentImpl.class); - - RoleAssignmentImpl(String name, RoleAssignmentInner innerObject, AuthorizationManager manager) { - super(name, innerObject); - this.manager = manager; - } - - @Override - public boolean isInCreateMode() { - return innerModel().id() == null; - } - - @Override - public Mono createResourceAsync() { - Mono objectIdObservable; - if (objectId != null) { - objectIdObservable = Mono.just(objectId); - } else if (userName != null) { - objectIdObservable = manager.users().getByNameAsync(userName).map(user -> user.id()); - } else if (servicePrincipalName != null) { - objectIdObservable = manager.servicePrincipals().getByNameAsync(servicePrincipalName).map(sp -> sp.id()); - } else { - throw logger.logExceptionAsError(new IllegalArgumentException( - "Please pass a non-null value for either object Id, user, group, or service principal")); - } - - Mono roleDefinitionIdObservable; - if (roleDefinitionId != null) { - roleDefinitionIdObservable = Mono.just(roleDefinitionId); - } else if (roleName != null) { - roleDefinitionIdObservable = - manager() - .roleDefinitions() - .getByScopeAndRoleNameAsync(scope(), roleName) - .map(roleDefinition -> roleDefinition.id()); - } else { - throw logger.logExceptionAsError(new IllegalArgumentException( - "Please pass a non-null value for either role name or role definition ID")); - } - - return Mono - .zip( - objectIdObservable, - roleDefinitionIdObservable, - (objectId, roleDefinitionId) -> - new RoleAssignmentCreateParameters() - .withPrincipalId(objectId) - .withRoleDefinitionId(roleDefinitionId)) - .flatMap( - roleAssignmentPropertiesInner -> - manager() - .roleServiceClient() - .getRoleAssignments() - .createAsync(scope(), name(), roleAssignmentPropertiesInner) - .retryWhen(Retry.withThrowable( - throwableFlux -> - throwableFlux - .zipWith( - Flux.range(1, 30), - (throwable, integer) -> { - if (throwable instanceof ManagementException) { - ManagementException managementException = - (ManagementException) throwable; - String exceptionMessage = - managementException.getMessage().toLowerCase(Locale.ROOT); - if (exceptionMessage.contains("principalnotfound") - || exceptionMessage.contains("does not exist in the directory")) { - /* - * ref: - * https://github.com/Azure/azure-cli/blob/dev/src/command_modules/azure-cli-role/azure/cli/command_modules/role/custom.py#L1048-L1065 - */ - return integer; - } else { - throw logger.logExceptionAsError(Exceptions.propagate(throwable)); - } - } else { - throw logger.logExceptionAsError(Exceptions.propagate(throwable)); - } - }) - .flatMap(i -> Mono.delay(ResourceManagerUtils.InternalRuntimeContext - .getDelayDuration(Duration.ofSeconds(i))))))) - .map(innerToFluentMap(this)); - } - - @Override - protected Mono getInnerAsync() { - return manager.roleServiceClient().getRoleAssignments().getAsync(scope(), name()); - } - - @Override - public String scope() { - return innerModel().scope(); - } - - @Override - public String roleDefinitionId() { - return innerModel().roleDefinitionId(); - } - - @Override - public String principalId() { - return innerModel().principalId(); - } - - @Override - public RoleAssignmentImpl forObjectId(String objectId) { - this.objectId = objectId; - return this; - } - - @Override - public RoleAssignmentImpl forUser(ActiveDirectoryUser user) { - this.objectId = user.id(); - return this; - } - - @Override - public RoleAssignmentImpl forUser(String name) { - this.userName = name; - return this; - } - - @Override - public RoleAssignmentImpl forGroup(ActiveDirectoryGroup activeDirectoryGroup) { - this.objectId = activeDirectoryGroup.id(); - return this; - } - - @Override - public RoleAssignmentImpl forServicePrincipal(ServicePrincipal servicePrincipal) { - this.objectId = servicePrincipal.id(); - return this; - } - - @Override - public RoleAssignmentImpl forServicePrincipal(String servicePrincipalName) { - this.servicePrincipalName = servicePrincipalName; - return this; - } - - @Override - public RoleAssignmentImpl withBuiltInRole(BuiltInRole role) { - this.roleName = role.toString(); - return this; - } - - @Override - public RoleAssignmentImpl withRoleDefinition(String roleDefinitionId) { - this.roleDefinitionId = roleDefinitionId; - return this; - } - - @Override - public RoleAssignmentImpl withScope(String scope) { - this.innerModel().withScope(scope); - return this; - } - - @Override - public RoleAssignmentImpl withResourceGroupScope(ResourceGroup resourceGroup) { - return withScope(resourceGroup.id()); - } - - @Override - public RoleAssignmentImpl withResourceScope(Resource resource) { - return withScope(resource.id()); - } - - @Override - public RoleAssignmentImpl withSubscriptionScope(String subscriptionId) { - return withScope("subscriptions/" + subscriptionId); - } - - @Override - public String id() { - return innerModel().id(); - } - - @Override - public AuthorizationManager manager() { - return this.manager; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/RoleAssignmentsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/RoleAssignmentsClientImpl.java deleted file mode 100644 index 75a0b94dc846..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/RoleAssignmentsClientImpl.java +++ /dev/null @@ -1,2239 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.authorization.fluent.RoleAssignmentsClient; -import com.azure.resourcemanager.authorization.fluent.models.RoleAssignmentInner; -import com.azure.resourcemanager.authorization.models.RoleAssignmentCreateParameters; -import com.azure.resourcemanager.authorization.models.RoleAssignmentListResult; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in RoleAssignmentsClient. */ -public final class RoleAssignmentsClientImpl - implements InnerSupportsListing, - InnerSupportsDelete, - RoleAssignmentsClient { - private final ClientLogger logger = new ClientLogger(RoleAssignmentsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final RoleAssignmentsService service; - - /** The service client containing this operation class. */ - private final AuthorizationManagementClientImpl client; - - /** - * Initializes an instance of RoleAssignmentsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - RoleAssignmentsClientImpl(AuthorizationManagementClientImpl client) { - this.service = - RestProxy.create(RoleAssignmentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for AuthorizationManagementClientRoleAssignments to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "AuthorizationManagem") - private interface RoleAssignmentsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}" - + "/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization" - + "/roleAssignments") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listForResource( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("resourceProviderNamespace") String resourceProviderNamespace, - @PathParam(value = "parentResourcePath", encoded = true) String parentResourcePath, - @PathParam(value = "resourceType", encoded = true) String resourceType, - @PathParam("resourceName") String resourceName, - @QueryParam("$filter") String filter, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization" - + "/roleAssignments") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("$filter") String filter, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete("/{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @PathParam(value = "scope", encoded = true) String scope, - @PathParam("roleAssignmentName") String roleAssignmentName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put("/{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}") - @ExpectedResponses({201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> create( - @HostParam("$host") String endpoint, - @PathParam(value = "scope", encoded = true) String scope, - @PathParam("roleAssignmentName") String roleAssignmentName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") RoleAssignmentCreateParameters parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam(value = "scope", encoded = true) String scope, - @PathParam("roleAssignmentName") String roleAssignmentName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete("/{roleAssignmentId}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteById( - @HostParam("$host") String endpoint, - @PathParam(value = "roleAssignmentId", encoded = true) String roleAssignmentId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put("/{roleAssignmentId}") - @ExpectedResponses({201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createById( - @HostParam("$host") String endpoint, - @PathParam(value = "roleAssignmentId", encoded = true) String roleAssignmentId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") RoleAssignmentCreateParameters parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/{roleAssignmentId}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getById( - @HostParam("$host") String endpoint, - @PathParam(value = "roleAssignmentId", encoded = true) String roleAssignmentId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/roleAssignments") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("$filter") String filter, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/{scope}/providers/Microsoft.Authorization/roleAssignments") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listForScope( - @HostParam("$host") String endpoint, - @PathParam(value = "scope", encoded = true) String scope, - @QueryParam("$filter") String filter, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listForResourceNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listForResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listForScopeNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets role assignments for a resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource. - * @param resourceName The name of the resource to get role assignments for. - * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or - * above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope - * for the specified principal. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role assignments for a resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listForResourceSinglePageAsync( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String filter) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceProviderNamespace == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter resourceProviderNamespace is required and cannot be null.")); - } - if (parentResourcePath == null) { - return Mono - .error(new IllegalArgumentException("Parameter parentResourcePath is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listForResource( - this.client.getEndpoint(), - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - filter, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets role assignments for a resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource. - * @param resourceName The name of the resource to get role assignments for. - * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or - * above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope - * for the specified principal. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role assignments for a resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listForResourceSinglePageAsync( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String filter, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceProviderNamespace == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter resourceProviderNamespace is required and cannot be null.")); - } - if (parentResourcePath == null) { - return Mono - .error(new IllegalArgumentException("Parameter parentResourcePath is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listForResource( - this.client.getEndpoint(), - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - filter, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets role assignments for a resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource. - * @param resourceName The name of the resource to get role assignments for. - * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or - * above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope - * for the specified principal. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role assignments for a resource. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listForResourceAsync( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String filter) { - return new PagedFlux<>( - () -> - listForResourceSinglePageAsync( - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - filter), - nextLink -> listForResourceNextSinglePageAsync(nextLink)); - } - - /** - * Gets role assignments for a resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource. - * @param resourceName The name of the resource to get role assignments for. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role assignments for a resource. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listForResourceAsync( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName) { - final String filter = null; - return new PagedFlux<>( - () -> - listForResourceSinglePageAsync( - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - filter), - nextLink -> listForResourceNextSinglePageAsync(nextLink)); - } - - /** - * Gets role assignments for a resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource. - * @param resourceName The name of the resource to get role assignments for. - * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or - * above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope - * for the specified principal. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role assignments for a resource. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listForResourceAsync( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String filter, - Context context) { - return new PagedFlux<>( - () -> - listForResourceSinglePageAsync( - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - filter, - context), - nextLink -> listForResourceNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets role assignments for a resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource. - * @param resourceName The name of the resource to get role assignments for. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role assignments for a resource. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listForResource( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName) { - final String filter = null; - return new PagedIterable<>( - listForResourceAsync( - resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, filter)); - } - - /** - * Gets role assignments for a resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource. - * @param resourceName The name of the resource to get role assignments for. - * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or - * above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope - * for the specified principal. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role assignments for a resource. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listForResource( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String filter, - Context context) { - return new PagedIterable<>( - listForResourceAsync( - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - filter, - context)); - } - - /** - * Gets role assignments for a resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or - * above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope - * for the specified principal. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role assignments for a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, String filter) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - filter, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets role assignments for a resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or - * above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope - * for the specified principal. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role assignments for a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, String filter, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - filter, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets role assignments for a resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or - * above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope - * for the specified principal. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role assignments for a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName, String filter) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, filter), - nextLink -> listForResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * Gets role assignments for a resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role assignments for a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - final String filter = null; - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, filter), - nextLink -> listForResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * Gets role assignments for a resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or - * above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope - * for the specified principal. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role assignments for a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync( - String resourceGroupName, String filter, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, context), - nextLink -> listForResourceGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets role assignments for a resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role assignments for a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - final String filter = null; - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, filter)); - } - - /** - * Gets role assignments for a resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or - * above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope - * for the specified principal. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role assignments for a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup( - String resourceGroupName, String filter, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, filter, context)); - } - - /** - * Deletes a role assignment. - * - * @param scope The scope of the role assignment to delete. - * @param roleAssignmentName The name of the role assignment to delete. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role Assignments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String scope, String roleAssignmentName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (roleAssignmentName == null) { - return Mono - .error(new IllegalArgumentException("Parameter roleAssignmentName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - scope, - roleAssignmentName, - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a role assignment. - * - * @param scope The scope of the role assignment to delete. - * @param roleAssignmentName The name of the role assignment to delete. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role Assignments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String scope, String roleAssignmentName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (roleAssignmentName == null) { - return Mono - .error(new IllegalArgumentException("Parameter roleAssignmentName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete(this.client.getEndpoint(), scope, roleAssignmentName, this.client.getApiVersion(), accept, context); - } - - /** - * Deletes a role assignment. - * - * @param scope The scope of the role assignment to delete. - * @param roleAssignmentName The name of the role assignment to delete. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role Assignments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String scope, String roleAssignmentName) { - return deleteWithResponseAsync(scope, roleAssignmentName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Deletes a role assignment. - * - * @param scope The scope of the role assignment to delete. - * @param roleAssignmentName The name of the role assignment to delete. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role Assignments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RoleAssignmentInner delete(String scope, String roleAssignmentName) { - return deleteAsync(scope, roleAssignmentName).block(); - } - - /** - * Deletes a role assignment. - * - * @param scope The scope of the role assignment to delete. - * @param roleAssignmentName The name of the role assignment to delete. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role Assignments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String scope, String roleAssignmentName, Context context) { - return deleteWithResponseAsync(scope, roleAssignmentName, context).block(); - } - - /** - * Creates a role assignment. - * - * @param scope The scope of the role assignment to create. The scope can be any REST resource instance. For - * example, use '/subscriptions/{subscription-id}/' for a subscription, - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' - * for a resource. - * @param roleAssignmentName The name of the role assignment to create. It can be any valid GUID. - * @param parameters Parameters for the role assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role Assignments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createWithResponseAsync( - String scope, String roleAssignmentName, RoleAssignmentCreateParameters parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (roleAssignmentName == null) { - return Mono - .error(new IllegalArgumentException("Parameter roleAssignmentName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .create( - this.client.getEndpoint(), - scope, - roleAssignmentName, - this.client.getApiVersion(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates a role assignment. - * - * @param scope The scope of the role assignment to create. The scope can be any REST resource instance. For - * example, use '/subscriptions/{subscription-id}/' for a subscription, - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' - * for a resource. - * @param roleAssignmentName The name of the role assignment to create. It can be any valid GUID. - * @param parameters Parameters for the role assignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role Assignments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync( - String scope, String roleAssignmentName, RoleAssignmentCreateParameters parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (roleAssignmentName == null) { - return Mono - .error(new IllegalArgumentException("Parameter roleAssignmentName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .create( - this.client.getEndpoint(), - scope, - roleAssignmentName, - this.client.getApiVersion(), - parameters, - accept, - context); - } - - /** - * Creates a role assignment. - * - * @param scope The scope of the role assignment to create. The scope can be any REST resource instance. For - * example, use '/subscriptions/{subscription-id}/' for a subscription, - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' - * for a resource. - * @param roleAssignmentName The name of the role assignment to create. It can be any valid GUID. - * @param parameters Parameters for the role assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role Assignments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createAsync( - String scope, String roleAssignmentName, RoleAssignmentCreateParameters parameters) { - return createWithResponseAsync(scope, roleAssignmentName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates a role assignment. - * - * @param scope The scope of the role assignment to create. The scope can be any REST resource instance. For - * example, use '/subscriptions/{subscription-id}/' for a subscription, - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' - * for a resource. - * @param roleAssignmentName The name of the role assignment to create. It can be any valid GUID. - * @param parameters Parameters for the role assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role Assignments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RoleAssignmentInner create( - String scope, String roleAssignmentName, RoleAssignmentCreateParameters parameters) { - return createAsync(scope, roleAssignmentName, parameters).block(); - } - - /** - * Creates a role assignment. - * - * @param scope The scope of the role assignment to create. The scope can be any REST resource instance. For - * example, use '/subscriptions/{subscription-id}/' for a subscription, - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' - * for a resource. - * @param roleAssignmentName The name of the role assignment to create. It can be any valid GUID. - * @param parameters Parameters for the role assignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role Assignments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse( - String scope, String roleAssignmentName, RoleAssignmentCreateParameters parameters, Context context) { - return createWithResponseAsync(scope, roleAssignmentName, parameters, context).block(); - } - - /** - * Get the specified role assignment. - * - * @param scope The scope of the role assignment. - * @param roleAssignmentName The name of the role assignment to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified role assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync(String scope, String roleAssignmentName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (roleAssignmentName == null) { - return Mono - .error(new IllegalArgumentException("Parameter roleAssignmentName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - scope, - roleAssignmentName, - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the specified role assignment. - * - * @param scope The scope of the role assignment. - * @param roleAssignmentName The name of the role assignment to get. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified role assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String scope, String roleAssignmentName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (roleAssignmentName == null) { - return Mono - .error(new IllegalArgumentException("Parameter roleAssignmentName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get(this.client.getEndpoint(), scope, roleAssignmentName, this.client.getApiVersion(), accept, context); - } - - /** - * Get the specified role assignment. - * - * @param scope The scope of the role assignment. - * @param roleAssignmentName The name of the role assignment to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified role assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync(String scope, String roleAssignmentName) { - return getWithResponseAsync(scope, roleAssignmentName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get the specified role assignment. - * - * @param scope The scope of the role assignment. - * @param roleAssignmentName The name of the role assignment to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified role assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RoleAssignmentInner get(String scope, String roleAssignmentName) { - return getAsync(scope, roleAssignmentName).block(); - } - - /** - * Get the specified role assignment. - * - * @param scope The scope of the role assignment. - * @param roleAssignmentName The name of the role assignment to get. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified role assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String scope, String roleAssignmentName, Context context) { - return getWithResponseAsync(scope, roleAssignmentName, context).block(); - } - - /** - * Deletes a role assignment. - * - * @param roleAssignmentId The fully qualified ID of the role assignment, including the scope, resource name and - * resource type. Use the format, - * /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. Example: - * /subscriptions/{subId}/resourcegroups/{rgname}//providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role Assignments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteByIdWithResponseAsync(String roleAssignmentId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (roleAssignmentId == null) { - return Mono - .error(new IllegalArgumentException("Parameter roleAssignmentId is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .deleteById( - this.client.getEndpoint(), roleAssignmentId, this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a role assignment. - * - * @param roleAssignmentId The fully qualified ID of the role assignment, including the scope, resource name and - * resource type. Use the format, - * /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. Example: - * /subscriptions/{subId}/resourcegroups/{rgname}//providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role Assignments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteByIdWithResponseAsync(String roleAssignmentId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (roleAssignmentId == null) { - return Mono - .error(new IllegalArgumentException("Parameter roleAssignmentId is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .deleteById(this.client.getEndpoint(), roleAssignmentId, this.client.getApiVersion(), accept, context); - } - - /** - * Deletes a role assignment. - * - * @param roleAssignmentId The fully qualified ID of the role assignment, including the scope, resource name and - * resource type. Use the format, - * /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. Example: - * /subscriptions/{subId}/resourcegroups/{rgname}//providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role Assignments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteByIdAsync(String roleAssignmentId) { - return deleteByIdWithResponseAsync(roleAssignmentId) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Deletes a role assignment. - * - * @param roleAssignmentId The fully qualified ID of the role assignment, including the scope, resource name and - * resource type. Use the format, - * /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. Example: - * /subscriptions/{subId}/resourcegroups/{rgname}//providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role Assignments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RoleAssignmentInner deleteById(String roleAssignmentId) { - return deleteByIdAsync(roleAssignmentId).block(); - } - - /** - * Deletes a role assignment. - * - * @param roleAssignmentId The fully qualified ID of the role assignment, including the scope, resource name and - * resource type. Use the format, - * /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. Example: - * /subscriptions/{subId}/resourcegroups/{rgname}//providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role Assignments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteByIdWithResponse(String roleAssignmentId, Context context) { - return deleteByIdWithResponseAsync(roleAssignmentId, context).block(); - } - - /** - * Creates a role assignment by ID. - * - * @param roleAssignmentId The fully qualified ID of the role assignment, including the scope, resource name and - * resource type. Use the format, - * /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. Example: - * /subscriptions/{subId}/resourcegroups/{rgname}//providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. - * @param parameters Parameters for the role assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role Assignments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createByIdWithResponseAsync( - String roleAssignmentId, RoleAssignmentCreateParameters parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (roleAssignmentId == null) { - return Mono - .error(new IllegalArgumentException("Parameter roleAssignmentId is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createById( - this.client.getEndpoint(), - roleAssignmentId, - this.client.getApiVersion(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates a role assignment by ID. - * - * @param roleAssignmentId The fully qualified ID of the role assignment, including the scope, resource name and - * resource type. Use the format, - * /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. Example: - * /subscriptions/{subId}/resourcegroups/{rgname}//providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. - * @param parameters Parameters for the role assignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role Assignments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createByIdWithResponseAsync( - String roleAssignmentId, RoleAssignmentCreateParameters parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (roleAssignmentId == null) { - return Mono - .error(new IllegalArgumentException("Parameter roleAssignmentId is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createById( - this.client.getEndpoint(), roleAssignmentId, this.client.getApiVersion(), parameters, accept, context); - } - - /** - * Creates a role assignment by ID. - * - * @param roleAssignmentId The fully qualified ID of the role assignment, including the scope, resource name and - * resource type. Use the format, - * /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. Example: - * /subscriptions/{subId}/resourcegroups/{rgname}//providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. - * @param parameters Parameters for the role assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role Assignments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createByIdAsync( - String roleAssignmentId, RoleAssignmentCreateParameters parameters) { - return createByIdWithResponseAsync(roleAssignmentId, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates a role assignment by ID. - * - * @param roleAssignmentId The fully qualified ID of the role assignment, including the scope, resource name and - * resource type. Use the format, - * /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. Example: - * /subscriptions/{subId}/resourcegroups/{rgname}//providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. - * @param parameters Parameters for the role assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role Assignments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RoleAssignmentInner createById(String roleAssignmentId, RoleAssignmentCreateParameters parameters) { - return createByIdAsync(roleAssignmentId, parameters).block(); - } - - /** - * Creates a role assignment by ID. - * - * @param roleAssignmentId The fully qualified ID of the role assignment, including the scope, resource name and - * resource type. Use the format, - * /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. Example: - * /subscriptions/{subId}/resourcegroups/{rgname}//providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. - * @param parameters Parameters for the role assignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role Assignments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createByIdWithResponse( - String roleAssignmentId, RoleAssignmentCreateParameters parameters, Context context) { - return createByIdWithResponseAsync(roleAssignmentId, parameters, context).block(); - } - - /** - * Gets a role assignment by ID. - * - * @param roleAssignmentId The fully qualified ID of the role assignment, including the scope, resource name and - * resource type. Use the format, - * /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. Example: - * /subscriptions/{subId}/resourcegroups/{rgname}//providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a role assignment by ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByIdWithResponseAsync(String roleAssignmentId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (roleAssignmentId == null) { - return Mono - .error(new IllegalArgumentException("Parameter roleAssignmentId is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getById( - this.client.getEndpoint(), roleAssignmentId, this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a role assignment by ID. - * - * @param roleAssignmentId The fully qualified ID of the role assignment, including the scope, resource name and - * resource type. Use the format, - * /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. Example: - * /subscriptions/{subId}/resourcegroups/{rgname}//providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a role assignment by ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByIdWithResponseAsync(String roleAssignmentId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (roleAssignmentId == null) { - return Mono - .error(new IllegalArgumentException("Parameter roleAssignmentId is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getById(this.client.getEndpoint(), roleAssignmentId, this.client.getApiVersion(), accept, context); - } - - /** - * Gets a role assignment by ID. - * - * @param roleAssignmentId The fully qualified ID of the role assignment, including the scope, resource name and - * resource type. Use the format, - * /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. Example: - * /subscriptions/{subId}/resourcegroups/{rgname}//providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a role assignment by ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByIdAsync(String roleAssignmentId) { - return getByIdWithResponseAsync(roleAssignmentId) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a role assignment by ID. - * - * @param roleAssignmentId The fully qualified ID of the role assignment, including the scope, resource name and - * resource type. Use the format, - * /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. Example: - * /subscriptions/{subId}/resourcegroups/{rgname}//providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a role assignment by ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RoleAssignmentInner getById(String roleAssignmentId) { - return getByIdAsync(roleAssignmentId).block(); - } - - /** - * Gets a role assignment by ID. - * - * @param roleAssignmentId The fully qualified ID of the role assignment, including the scope, resource name and - * resource type. Use the format, - * /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. Example: - * /subscriptions/{subId}/resourcegroups/{rgname}//providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a role assignment by ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByIdWithResponse(String roleAssignmentId, Context context) { - return getByIdWithResponseAsync(roleAssignmentId, context).block(); - } - - /** - * Gets all role assignments for the subscription. - * - * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or - * above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope - * for the specified principal. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all role assignments for the subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String filter) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - filter, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all role assignments for the subscription. - * - * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or - * above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope - * for the specified principal. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all role assignments for the subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String filter, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - filter, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all role assignments for the subscription. - * - * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or - * above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope - * for the specified principal. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all role assignments for the subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String filter) { - return new PagedFlux<>(() -> listSinglePageAsync(filter), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets all role assignments for the subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all role assignments for the subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - final String filter = null; - return new PagedFlux<>(() -> listSinglePageAsync(filter), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets all role assignments for the subscription. - * - * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or - * above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope - * for the specified principal. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all role assignments for the subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String filter, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(filter, context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all role assignments for the subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all role assignments for the subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - final String filter = null; - return new PagedIterable<>(listAsync(filter)); - } - - /** - * Gets all role assignments for the subscription. - * - * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or - * above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope - * for the specified principal. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all role assignments for the subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String filter, Context context) { - return new PagedIterable<>(listAsync(filter, context)); - } - - /** - * Gets role assignments for a scope. - * - * @param scope The scope of the role assignments. - * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or - * above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope - * for the specified principal. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role assignments for a scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listForScopeSinglePageAsync(String scope, String filter) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listForScope( - this.client.getEndpoint(), scope, filter, this.client.getApiVersion(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets role assignments for a scope. - * - * @param scope The scope of the role assignments. - * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or - * above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope - * for the specified principal. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role assignments for a scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listForScopeSinglePageAsync( - String scope, String filter, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listForScope(this.client.getEndpoint(), scope, filter, this.client.getApiVersion(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets role assignments for a scope. - * - * @param scope The scope of the role assignments. - * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or - * above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope - * for the specified principal. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role assignments for a scope. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listForScopeAsync(String scope, String filter) { - return new PagedFlux<>( - () -> listForScopeSinglePageAsync(scope, filter), nextLink -> listForScopeNextSinglePageAsync(nextLink)); - } - - /** - * Gets role assignments for a scope. - * - * @param scope The scope of the role assignments. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role assignments for a scope. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listForScopeAsync(String scope) { - final String filter = null; - return new PagedFlux<>( - () -> listForScopeSinglePageAsync(scope, filter), nextLink -> listForScopeNextSinglePageAsync(nextLink)); - } - - /** - * Gets role assignments for a scope. - * - * @param scope The scope of the role assignments. - * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or - * above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope - * for the specified principal. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role assignments for a scope. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listForScopeAsync(String scope, String filter, Context context) { - return new PagedFlux<>( - () -> listForScopeSinglePageAsync(scope, filter, context), - nextLink -> listForScopeNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets role assignments for a scope. - * - * @param scope The scope of the role assignments. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role assignments for a scope. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listForScope(String scope) { - final String filter = null; - return new PagedIterable<>(listForScopeAsync(scope, filter)); - } - - /** - * Gets role assignments for a scope. - * - * @param scope The scope of the role assignments. - * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or - * above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope - * for the specified principal. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role assignments for a scope. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listForScope(String scope, String filter, Context context) { - return new PagedIterable<>(listForScopeAsync(scope, filter, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role assignment list operation result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listForResourceNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listForResourceNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role assignment list operation result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listForResourceNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listForResourceNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role assignment list operation result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listForResourceGroupNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listForResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role assignment list operation result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listForResourceGroupNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listForResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role assignment list operation result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role assignment list operation result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role assignment list operation result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listForScopeNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listForScopeNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role assignment list operation result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listForScopeNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listForScopeNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/RoleAssignmentsImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/RoleAssignmentsImpl.java deleted file mode 100644 index d3e066678065..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/RoleAssignmentsImpl.java +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.authorization.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.authorization.AuthorizationManager; -import com.azure.resourcemanager.authorization.models.RoleAssignment; -import com.azure.resourcemanager.authorization.models.RoleAssignments; -import com.azure.resourcemanager.authorization.fluent.models.RoleAssignmentInner; -import com.azure.resourcemanager.authorization.fluent.RoleAssignmentsClient; -import com.azure.resourcemanager.authorization.models.ServicePrincipal; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.CreatableResourcesImpl; -import reactor.core.publisher.Mono; -import com.azure.resourcemanager.resources.fluentcore.utils.PagedConverter; - -import java.util.Objects; - -/** The implementation of RoleAssignments and its parent interfaces. */ -public class RoleAssignmentsImpl extends CreatableResourcesImpl - implements RoleAssignments { - private final AuthorizationManager manager; - - public RoleAssignmentsImpl(final AuthorizationManager manager) { - this.manager = manager; - } - - @Override - protected RoleAssignmentImpl wrapModel(RoleAssignmentInner roleAssignmentInner) { - if (roleAssignmentInner == null) { - return null; - } - return new RoleAssignmentImpl(roleAssignmentInner.name(), roleAssignmentInner, manager()); - } - - @Override - public RoleAssignmentImpl getById(String objectId) { - return (RoleAssignmentImpl) getByIdAsync(objectId).block(); - } - - @Override - public Mono getByIdAsync(String id) { - return inner() - .getByIdAsync(id) - .map( - roleAssignmentInner -> - new RoleAssignmentImpl(roleAssignmentInner.name(), roleAssignmentInner, manager())); - } - - @Override - public RoleAssignmentImpl getByScope(String scope, String name) { - return (RoleAssignmentImpl) getByScopeAsync(scope, name).block(); - } - - @Override - public PagedFlux listByScopeAsync(String scope) { - return PagedConverter.mapPage(inner().listForScopeAsync(scope, null), this::wrapModel); - } - - @Override - public PagedIterable listByScope(String scope) { - return wrapList(inner().listForScope(scope)); - } - - @Override - public PagedFlux listByServicePrincipalAsync(ServicePrincipal servicePrincipal) { - return listByServicePrincipalAsync(Objects.requireNonNull(servicePrincipal).id()); - } - - @Override - public PagedIterable listByServicePrincipal(ServicePrincipal servicePrincipal) { - return new PagedIterable<>(listByServicePrincipalAsync(servicePrincipal)); - } - - @Override - public PagedFlux listByServicePrincipalAsync(String principalId) { - String filterStr = String.format("principalId eq '%s'", Objects.requireNonNull(principalId)); - return PagedConverter.mapPage(inner().listAsync(filterStr), this::wrapModel); - } - - @Override - public PagedIterable listByServicePrincipal(String principalId) { - return new PagedIterable<>(listByServicePrincipalAsync(principalId)); - } - - @Override - public Mono getByScopeAsync(String scope, String name) { - return inner() - .getAsync(scope, name) - .map( - roleAssignmentInner -> - new RoleAssignmentImpl(roleAssignmentInner.name(), roleAssignmentInner, manager())); - } - - @Override - protected RoleAssignmentImpl wrapModel(String name) { - return new RoleAssignmentImpl(name, new RoleAssignmentInner(), manager()); - } - - @Override - public Mono deleteByIdAsync(String id) { - return inner().deleteByIdAsync(id).then(); - } - - @Override - public RoleAssignmentImpl define(String name) { - return wrapModel(name); - } - - @Override - public AuthorizationManager manager() { - return this.manager; - } - - public RoleAssignmentsClient inner() { - return manager().roleServiceClient().getRoleAssignments(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/RoleDefinitionImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/RoleDefinitionImpl.java deleted file mode 100644 index e02e9ec5b934..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/RoleDefinitionImpl.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.authorization.implementation; - -import com.azure.resourcemanager.authorization.AuthorizationManager; -import com.azure.resourcemanager.authorization.models.Permission; -import com.azure.resourcemanager.authorization.models.RoleDefinition; -import com.azure.resourcemanager.authorization.fluent.models.PermissionInner; -import com.azure.resourcemanager.authorization.fluent.models.RoleDefinitionInner; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.WrapperImpl; -import java.util.Collections; -import java.util.HashSet; -import java.util.Set; - -/** Implementation for ServicePrincipal and its parent interfaces. */ -class RoleDefinitionImpl extends WrapperImpl implements RoleDefinition { - private AuthorizationManager manager; - // Active Directory identify info - // private String objectId; - // private String userName; - // private String servicePrincipalName; - // role info - // private String roleDefinitionId; - // private String roleName; - - RoleDefinitionImpl(RoleDefinitionInner innerObject, AuthorizationManager manager) { - super(innerObject); - this.manager = manager; - } - - @Override - public String roleName() { - return innerModel().roleName(); - } - - @Override - public String description() { - return innerModel().description(); - } - - @Override - public String type() { - return innerModel().type(); - } - - @Override - public Set permissions() { - HashSet ret = new HashSet<>(); - for (PermissionInner inner : innerModel().permissions()) { - ret.add(new PermissionImpl(inner)); - } - return ret; - } - - @Override - public Set assignableScopes() { - return Collections.unmodifiableSet(new HashSet<>(innerModel().assignableScopes())); - } - - @Override - public String id() { - return innerModel().id(); - } - - @Override - public AuthorizationManager manager() { - return this.manager; - } - - @Override - public String name() { - return innerModel().name(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/RoleDefinitionsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/RoleDefinitionsClientImpl.java deleted file mode 100644 index a0766668ef96..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/RoleDefinitionsClientImpl.java +++ /dev/null @@ -1,900 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.authorization.fluent.RoleDefinitionsClient; -import com.azure.resourcemanager.authorization.fluent.models.RoleDefinitionInner; -import com.azure.resourcemanager.authorization.models.RoleDefinitionListResult; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in RoleDefinitionsClient. */ -public final class RoleDefinitionsClientImpl - implements InnerSupportsDelete, RoleDefinitionsClient { - private final ClientLogger logger = new ClientLogger(RoleDefinitionsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final RoleDefinitionsService service; - - /** The service client containing this operation class. */ - private final AuthorizationManagementClientImpl client; - - /** - * Initializes an instance of RoleDefinitionsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - RoleDefinitionsClientImpl(AuthorizationManagementClientImpl client) { - this.service = - RestProxy.create(RoleDefinitionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for AuthorizationManagementClientRoleDefinitions to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "AuthorizationManagem") - private interface RoleDefinitionsService { - @Headers({"Content-Type: application/json"}) - @Delete("/{scope}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @PathParam(value = "scope", encoded = true) String scope, - @PathParam("roleDefinitionId") String roleDefinitionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/{scope}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam(value = "scope", encoded = true) String scope, - @PathParam("roleDefinitionId") String roleDefinitionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put("/{scope}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId}") - @ExpectedResponses({201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam(value = "scope", encoded = true) String scope, - @PathParam("roleDefinitionId") String roleDefinitionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") RoleDefinitionInner roleDefinition, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/{scope}/providers/Microsoft.Authorization/roleDefinitions") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam(value = "scope", encoded = true) String scope, - @QueryParam("$filter") String filter, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/{roleDefinitionId}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getById( - @HostParam("$host") String endpoint, - @PathParam(value = "roleDefinitionId", encoded = true) String roleDefinitionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Deletes a role definition. - * - * @param scope The scope of the role definition. - * @param roleDefinitionId The ID of the role definition to delete. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String scope, String roleDefinitionId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (roleDefinitionId == null) { - return Mono - .error(new IllegalArgumentException("Parameter roleDefinitionId is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - scope, - roleDefinitionId, - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a role definition. - * - * @param scope The scope of the role definition. - * @param roleDefinitionId The ID of the role definition to delete. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String scope, String roleDefinitionId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (roleDefinitionId == null) { - return Mono - .error(new IllegalArgumentException("Parameter roleDefinitionId is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete(this.client.getEndpoint(), scope, roleDefinitionId, this.client.getApiVersion(), accept, context); - } - - /** - * Deletes a role definition. - * - * @param scope The scope of the role definition. - * @param roleDefinitionId The ID of the role definition to delete. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String scope, String roleDefinitionId) { - return deleteWithResponseAsync(scope, roleDefinitionId) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Deletes a role definition. - * - * @param scope The scope of the role definition. - * @param roleDefinitionId The ID of the role definition to delete. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RoleDefinitionInner delete(String scope, String roleDefinitionId) { - return deleteAsync(scope, roleDefinitionId).block(); - } - - /** - * Deletes a role definition. - * - * @param scope The scope of the role definition. - * @param roleDefinitionId The ID of the role definition to delete. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String scope, String roleDefinitionId, Context context) { - return deleteWithResponseAsync(scope, roleDefinitionId, context).block(); - } - - /** - * Get role definition by name (GUID). - * - * @param scope The scope of the role definition. - * @param roleDefinitionId The ID of the role definition. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role definition by name (GUID). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync(String scope, String roleDefinitionId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (roleDefinitionId == null) { - return Mono - .error(new IllegalArgumentException("Parameter roleDefinitionId is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - scope, - roleDefinitionId, - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get role definition by name (GUID). - * - * @param scope The scope of the role definition. - * @param roleDefinitionId The ID of the role definition. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role definition by name (GUID). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String scope, String roleDefinitionId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (roleDefinitionId == null) { - return Mono - .error(new IllegalArgumentException("Parameter roleDefinitionId is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get(this.client.getEndpoint(), scope, roleDefinitionId, this.client.getApiVersion(), accept, context); - } - - /** - * Get role definition by name (GUID). - * - * @param scope The scope of the role definition. - * @param roleDefinitionId The ID of the role definition. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role definition by name (GUID). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync(String scope, String roleDefinitionId) { - return getWithResponseAsync(scope, roleDefinitionId) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get role definition by name (GUID). - * - * @param scope The scope of the role definition. - * @param roleDefinitionId The ID of the role definition. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role definition by name (GUID). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RoleDefinitionInner get(String scope, String roleDefinitionId) { - return getAsync(scope, roleDefinitionId).block(); - } - - /** - * Get role definition by name (GUID). - * - * @param scope The scope of the role definition. - * @param roleDefinitionId The ID of the role definition. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role definition by name (GUID). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String scope, String roleDefinitionId, Context context) { - return getWithResponseAsync(scope, roleDefinitionId, context).block(); - } - - /** - * Creates or updates a role definition. - * - * @param scope The scope of the role definition. - * @param roleDefinitionId The ID of the role definition. - * @param roleDefinition The values for the role definition. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponseAsync( - String scope, String roleDefinitionId, RoleDefinitionInner roleDefinition) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (roleDefinitionId == null) { - return Mono - .error(new IllegalArgumentException("Parameter roleDefinitionId is required and cannot be null.")); - } - if (roleDefinition == null) { - return Mono.error(new IllegalArgumentException("Parameter roleDefinition is required and cannot be null.")); - } else { - roleDefinition.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - scope, - roleDefinitionId, - this.client.getApiVersion(), - roleDefinition, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a role definition. - * - * @param scope The scope of the role definition. - * @param roleDefinitionId The ID of the role definition. - * @param roleDefinition The values for the role definition. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String scope, String roleDefinitionId, RoleDefinitionInner roleDefinition, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (roleDefinitionId == null) { - return Mono - .error(new IllegalArgumentException("Parameter roleDefinitionId is required and cannot be null.")); - } - if (roleDefinition == null) { - return Mono.error(new IllegalArgumentException("Parameter roleDefinition is required and cannot be null.")); - } else { - roleDefinition.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - scope, - roleDefinitionId, - this.client.getApiVersion(), - roleDefinition, - accept, - context); - } - - /** - * Creates or updates a role definition. - * - * @param scope The scope of the role definition. - * @param roleDefinitionId The ID of the role definition. - * @param roleDefinition The values for the role definition. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String scope, String roleDefinitionId, RoleDefinitionInner roleDefinition) { - return createOrUpdateWithResponseAsync(scope, roleDefinitionId, roleDefinition) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates or updates a role definition. - * - * @param scope The scope of the role definition. - * @param roleDefinitionId The ID of the role definition. - * @param roleDefinition The values for the role definition. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RoleDefinitionInner createOrUpdate( - String scope, String roleDefinitionId, RoleDefinitionInner roleDefinition) { - return createOrUpdateAsync(scope, roleDefinitionId, roleDefinition).block(); - } - - /** - * Creates or updates a role definition. - * - * @param scope The scope of the role definition. - * @param roleDefinitionId The ID of the role definition. - * @param roleDefinition The values for the role definition. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String scope, String roleDefinitionId, RoleDefinitionInner roleDefinition, Context context) { - return createOrUpdateWithResponseAsync(scope, roleDefinitionId, roleDefinition, context).block(); - } - - /** - * Get all role definitions that are applicable at scope and above. - * - * @param scope The scope of the role definition. - * @param filter The filter to apply on the operation. Use atScopeAndBelow filter to search below the given scope as - * well. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all role definitions that are applicable at scope and above. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String scope, String filter) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), scope, filter, this.client.getApiVersion(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get all role definitions that are applicable at scope and above. - * - * @param scope The scope of the role definition. - * @param filter The filter to apply on the operation. Use atScopeAndBelow filter to search below the given scope as - * well. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all role definitions that are applicable at scope and above. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String scope, String filter, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), scope, filter, this.client.getApiVersion(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get all role definitions that are applicable at scope and above. - * - * @param scope The scope of the role definition. - * @param filter The filter to apply on the operation. Use atScopeAndBelow filter to search below the given scope as - * well. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all role definitions that are applicable at scope and above. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String scope, String filter) { - return new PagedFlux<>(() -> listSinglePageAsync(scope, filter), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Get all role definitions that are applicable at scope and above. - * - * @param scope The scope of the role definition. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all role definitions that are applicable at scope and above. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String scope) { - final String filter = null; - return new PagedFlux<>(() -> listSinglePageAsync(scope, filter), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Get all role definitions that are applicable at scope and above. - * - * @param scope The scope of the role definition. - * @param filter The filter to apply on the operation. Use atScopeAndBelow filter to search below the given scope as - * well. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all role definitions that are applicable at scope and above. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String scope, String filter, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(scope, filter, context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Get all role definitions that are applicable at scope and above. - * - * @param scope The scope of the role definition. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all role definitions that are applicable at scope and above. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String scope) { - final String filter = null; - return new PagedIterable<>(listAsync(scope, filter)); - } - - /** - * Get all role definitions that are applicable at scope and above. - * - * @param scope The scope of the role definition. - * @param filter The filter to apply on the operation. Use atScopeAndBelow filter to search below the given scope as - * well. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all role definitions that are applicable at scope and above. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String scope, String filter, Context context) { - return new PagedIterable<>(listAsync(scope, filter, context)); - } - - /** - * Gets a role definition by ID. - * - * @param roleDefinitionId The fully qualified role definition ID. Use the format, - * /subscriptions/{guid}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} for subscription - * level role definitions, or /providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} for tenant - * level role definitions. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a role definition by ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByIdWithResponseAsync(String roleDefinitionId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (roleDefinitionId == null) { - return Mono - .error(new IllegalArgumentException("Parameter roleDefinitionId is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getById( - this.client.getEndpoint(), roleDefinitionId, this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a role definition by ID. - * - * @param roleDefinitionId The fully qualified role definition ID. Use the format, - * /subscriptions/{guid}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} for subscription - * level role definitions, or /providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} for tenant - * level role definitions. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a role definition by ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByIdWithResponseAsync(String roleDefinitionId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (roleDefinitionId == null) { - return Mono - .error(new IllegalArgumentException("Parameter roleDefinitionId is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getById(this.client.getEndpoint(), roleDefinitionId, this.client.getApiVersion(), accept, context); - } - - /** - * Gets a role definition by ID. - * - * @param roleDefinitionId The fully qualified role definition ID. Use the format, - * /subscriptions/{guid}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} for subscription - * level role definitions, or /providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} for tenant - * level role definitions. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a role definition by ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByIdAsync(String roleDefinitionId) { - return getByIdWithResponseAsync(roleDefinitionId) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a role definition by ID. - * - * @param roleDefinitionId The fully qualified role definition ID. Use the format, - * /subscriptions/{guid}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} for subscription - * level role definitions, or /providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} for tenant - * level role definitions. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a role definition by ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RoleDefinitionInner getById(String roleDefinitionId) { - return getByIdAsync(roleDefinitionId).block(); - } - - /** - * Gets a role definition by ID. - * - * @param roleDefinitionId The fully qualified role definition ID. Use the format, - * /subscriptions/{guid}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} for subscription - * level role definitions, or /providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} for tenant - * level role definitions. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a role definition by ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByIdWithResponse(String roleDefinitionId, Context context) { - return getByIdWithResponseAsync(roleDefinitionId, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role definition list operation result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role definition list operation result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/RoleDefinitionsImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/RoleDefinitionsImpl.java deleted file mode 100644 index 867dccd889cc..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/RoleDefinitionsImpl.java +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.authorization.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.authorization.AuthorizationManager; -import com.azure.resourcemanager.authorization.models.RoleDefinition; -import com.azure.resourcemanager.authorization.models.RoleDefinitions; -import com.azure.resourcemanager.authorization.fluent.models.RoleDefinitionInner; -import com.azure.resourcemanager.authorization.fluent.RoleDefinitionsClient; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.ReadableWrappersImpl; -import reactor.core.publisher.Mono; -import com.azure.resourcemanager.resources.fluentcore.utils.PagedConverter; - -/** The implementation of RoleDefinitions and its parent interfaces. */ -public class RoleDefinitionsImpl extends ReadableWrappersImpl - implements RoleDefinitions { - private final AuthorizationManager manager; - - public RoleDefinitionsImpl(final AuthorizationManager manager) { - this.manager = manager; - } - - @Override - protected RoleDefinitionImpl wrapModel(RoleDefinitionInner roleDefinitionInner) { - if (roleDefinitionInner == null) { - return null; - } - return new RoleDefinitionImpl(roleDefinitionInner, manager()); - } - - @Override - public RoleDefinition getById(String objectId) { - return getByIdAsync(objectId).block(); - } - - @Override - public Mono getByIdAsync(String id) { - return inner() - .getByIdAsync(id) - .map(roleDefinitionInner -> new RoleDefinitionImpl(roleDefinitionInner, manager())); - } - - @Override - public RoleDefinition getByScope(String scope, String name) { - return getByScopeAsync(scope, name).block(); - } - - @Override - public Mono getByScopeAsync(String scope, String name) { - return inner() - .getAsync(scope, name) - .map(roleDefinitionInner -> new RoleDefinitionImpl(roleDefinitionInner, manager())); - } - - @Override - public RoleDefinition getByScopeAndRoleName(String scope, String roleName) { - return getByScopeAndRoleNameAsync(scope, roleName).block(); - } - - @Override - public PagedFlux listByScopeAsync(String scope) { - return PagedConverter.mapPage(inner() - .listAsync(scope, null), - roleDefinitionInner -> new RoleDefinitionImpl(roleDefinitionInner, manager())); - } - - @Override - public PagedIterable listByScope(String scope) { - return wrapList(inner().list(scope)); - } - - @Override - public Mono getByScopeAndRoleNameAsync(String scope, String roleName) { - return inner() - .listAsync(scope, String.format("roleName eq '%s'", roleName)) - .singleOrEmpty() - .map(roleDefinitionInner -> new RoleDefinitionImpl(roleDefinitionInner, manager())); - } - - @Override - public AuthorizationManager manager() { - return this.manager; - } - - public RoleDefinitionsClient inner() { - return manager().roleServiceClient().getRoleDefinitions(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/ServicePrincipalImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/ServicePrincipalImpl.java deleted file mode 100644 index 9ff4865b6a0e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/ServicePrincipalImpl.java +++ /dev/null @@ -1,379 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.authorization.implementation; - -import com.azure.resourcemanager.authorization.AuthorizationManager; -import com.azure.resourcemanager.authorization.fluent.models.KeyCredentialInner; -import com.azure.resourcemanager.authorization.fluent.models.PasswordCredentialInner; -import com.azure.resourcemanager.authorization.fluent.models.ServicePrincipalInner; -import com.azure.resourcemanager.authorization.models.ActiveDirectoryApplication; -import com.azure.resourcemanager.authorization.models.BuiltInRole; -import com.azure.resourcemanager.authorization.models.CertificateCredential; -import com.azure.resourcemanager.authorization.models.KeyCredentialsUpdateParameters; -import com.azure.resourcemanager.authorization.models.PasswordCredential; -import com.azure.resourcemanager.authorization.models.PasswordCredentialsUpdateParameters; -import com.azure.resourcemanager.authorization.models.RoleAssignment; -import com.azure.resourcemanager.authorization.models.ServicePrincipal; -import com.azure.resourcemanager.authorization.models.ServicePrincipalCreateParameters; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.CreatableUpdatableImpl; -import com.azure.resourcemanager.resources.models.ResourceGroup; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.function.Function; - -/** Implementation for ServicePrincipal and its parent interfaces. */ -class ServicePrincipalImpl extends CreatableUpdatableImpl - implements ServicePrincipal, - ServicePrincipal.Definition, - ServicePrincipal.Update, - HasCredential { - private AuthorizationManager manager; - - private Map cachedPasswordCredentials; - private Map cachedCertificateCredentials; - private Map cachedRoleAssignments; - - private ServicePrincipalCreateParameters createParameters; - private Creatable applicationCreatable; - private Map rolesToCreate; - private Set rolesToDelete; - - String assignedSubscription; - private List> certificateCredentialsToCreate; - private List> passwordCredentialsToCreate; - private Set certificateCredentialsToDelete; - private Set passwordCredentialsToDelete; - - ServicePrincipalImpl(ServicePrincipalInner innerObject, AuthorizationManager manager) { - super(innerObject.displayName(), innerObject); - this.manager = manager; - this.createParameters = new ServicePrincipalCreateParameters(); - this.createParameters.withAccountEnabled(true); - this.cachedRoleAssignments = new HashMap<>(); - this.rolesToCreate = new HashMap<>(); - this.rolesToDelete = new HashSet<>(); - this.cachedCertificateCredentials = new HashMap<>(); - this.certificateCredentialsToCreate = new ArrayList<>(); - this.certificateCredentialsToDelete = new HashSet<>(); - this.cachedPasswordCredentials = new HashMap<>(); - this.passwordCredentialsToCreate = new ArrayList<>(); - this.passwordCredentialsToDelete = new HashSet<>(); - } - - @Override - public String applicationId() { - return innerModel().appId(); - } - - @Override - public List servicePrincipalNames() { - return innerModel().servicePrincipalNames(); - } - - @Override - public Map passwordCredentials() { - return Collections.unmodifiableMap(cachedPasswordCredentials); - } - - @Override - public Map certificateCredentials() { - return Collections.unmodifiableMap(cachedCertificateCredentials); - } - - @Override - public Set roleAssignments() { - return Collections.unmodifiableSet(new HashSet<>(cachedRoleAssignments.values())); - } - - @Override - protected Mono getInnerAsync() { - return manager.serviceClient().getServicePrincipals().getAsync(id(), this.manager.tenantId()); - } - - @Override - public Mono createResourceAsync() { - Mono sp = Mono.just(this); - if (isInCreateMode()) { - if (applicationCreatable != null) { - ActiveDirectoryApplication application = this.taskResult(applicationCreatable.key()); - createParameters.withAppId(application.applicationId()); - } - sp = manager.serviceClient().getServicePrincipals() - .createAsync(this.manager.tenantId(), createParameters).map(innerToFluentMap(this)); - } - return sp - .flatMap( - servicePrincipal -> - submitCredentialsAsync(servicePrincipal).mergeWith(submitRolesAsync(servicePrincipal)).last()) - .map( - servicePrincipal -> { - for (PasswordCredentialImpl passwordCredential : passwordCredentialsToCreate) { - passwordCredential.exportAuthFile((ServicePrincipalImpl) servicePrincipal); - } - for (CertificateCredentialImpl certificateCredential : certificateCredentialsToCreate) { - certificateCredential.exportAuthFile((ServicePrincipalImpl) servicePrincipal); - } - passwordCredentialsToCreate.clear(); - certificateCredentialsToCreate.clear(); - return servicePrincipal; - }); - } - - private Mono submitCredentialsAsync(final ServicePrincipal sp) { - Mono mono = Mono.empty(); - if (!certificateCredentialsToCreate.isEmpty() || !certificateCredentialsToDelete.isEmpty()) { - Map newCerts = new HashMap<>(cachedCertificateCredentials); - for (String delete : certificateCredentialsToDelete) { - newCerts.remove(delete); - } - for (CertificateCredential create : certificateCredentialsToCreate) { - newCerts.put(create.name(), create); - } - List updateKeyCredentials = new ArrayList<>(); - for (CertificateCredential certificateCredential : newCerts.values()) { - updateKeyCredentials.add(certificateCredential.innerModel()); - } - mono = - mono - .concatWith( - manager() - .serviceClient() - .getServicePrincipals() - .updateKeyCredentialsAsync( - sp.id(), - this.manager.tenantId(), - new KeyCredentialsUpdateParameters().withValue(updateKeyCredentials)) - .then(Mono.just(ServicePrincipalImpl.this))) - .last(); - } - if (!passwordCredentialsToCreate.isEmpty() || !passwordCredentialsToDelete.isEmpty()) { - Map newPasses = new HashMap<>(cachedPasswordCredentials); - for (String delete : passwordCredentialsToDelete) { - newPasses.remove(delete); - } - for (PasswordCredential create : passwordCredentialsToCreate) { - newPasses.put(create.name(), create); - } - List updatePasswordCredentials = new ArrayList<>(); - for (PasswordCredential passwordCredential : newPasses.values()) { - updatePasswordCredentials.add(passwordCredential.innerModel()); - } - mono = - mono - .concatWith( - manager() - .serviceClient() - .getServicePrincipals() - .updatePasswordCredentialsAsync( - sp.id(), - this.manager.tenantId(), - new PasswordCredentialsUpdateParameters().withValue(updatePasswordCredentials)) - .then(Mono.just(ServicePrincipalImpl.this))) - .last(); - } - return mono - .flatMap( - servicePrincipal -> { - passwordCredentialsToDelete.clear(); - certificateCredentialsToDelete.clear(); - return refreshCredentialsAsync(); - }); - } - - private Mono submitRolesAsync(final ServicePrincipal servicePrincipal) { - Mono create; - if (rolesToCreate.isEmpty()) { - create = Mono.just(servicePrincipal); - } else { - create = - Flux - .fromIterable(rolesToCreate.entrySet()) - .flatMap( - roleEntry -> - manager() - .roleAssignments() - .define(this.manager().internalContext().randomUuid()) - .forServicePrincipal(servicePrincipal) - .withBuiltInRole(roleEntry.getValue()) - .withScope(roleEntry.getKey()) - .createAsync()) - .doOnNext( - indexable -> - cachedRoleAssignments.put(indexable.id(), indexable)) - .last() - .map( - indexable -> { - rolesToCreate.clear(); - return servicePrincipal; - }); - } - Mono delete; - if (rolesToDelete.isEmpty()) { - delete = Mono.just(servicePrincipal); - } else { - delete = - Flux - .fromIterable(rolesToDelete) - .flatMap( - role -> - manager() - .roleAssignments() - .deleteByIdAsync(cachedRoleAssignments.get(role).id()) - .thenReturn(role)) - .doOnNext(s -> cachedRoleAssignments.remove(s)) - .last() - .map( - s -> { - rolesToDelete.clear(); - return servicePrincipal; - }); - } - return create.mergeWith(delete).last(); - } - - @Override - public boolean isInCreateMode() { - return id() == null; - } - - Mono refreshCredentialsAsync() { - return Mono - .just(ServicePrincipalImpl.this) - .map( - (Function) - servicePrincipal -> { - servicePrincipal.cachedCertificateCredentials.clear(); - servicePrincipal.cachedPasswordCredentials.clear(); - return servicePrincipal; - }) - .concatWith( - manager() - .serviceClient() - .getServicePrincipals() - .listKeyCredentialsAsync(id(), this.manager.tenantId()) - .map( - keyCredentialInner -> { - CertificateCredential credential = new CertificateCredentialImpl<>(keyCredentialInner); - ServicePrincipalImpl.this.cachedCertificateCredentials.put(credential.name(), credential); - return ServicePrincipalImpl.this; - })) - .concatWith( - manager() - .serviceClient() - .getServicePrincipals() - .listPasswordCredentialsAsync(id(), this.manager.tenantId()) - .map( - passwordCredentialInner -> { - PasswordCredential credential = new PasswordCredentialImpl<>(passwordCredentialInner); - ServicePrincipalImpl.this.cachedPasswordCredentials.put(credential.name(), credential); - return ServicePrincipalImpl.this; - })) - .last(); - } - - @Override - public Mono refreshAsync() { - return getInnerAsync().map(innerToFluentMap(this)).flatMap(application -> refreshCredentialsAsync()); - } - - @Override - public CertificateCredentialImpl defineCertificateCredential(String name) { - return new CertificateCredentialImpl<>(name, this); - } - - @Override - public PasswordCredentialImpl definePasswordCredential(String name) { - return new PasswordCredentialImpl<>(name, this); - } - - @Override - public ServicePrincipalImpl withoutCredential(String name) { - if (cachedPasswordCredentials.containsKey(name)) { - passwordCredentialsToDelete.add(name); - } else if (cachedCertificateCredentials.containsKey(name)) { - certificateCredentialsToDelete.add(name); - } - return this; - } - - @Override - public ServicePrincipalImpl withCertificateCredential(CertificateCredentialImpl credential) { - this.certificateCredentialsToCreate.add(credential); - return this; - } - - @Override - public ServicePrincipalImpl withPasswordCredential(PasswordCredentialImpl credential) { - - this.passwordCredentialsToCreate.add(credential); - return this; - } - - @Override - public ServicePrincipalImpl withExistingApplication(String id) { - createParameters.withAppId(id); - return this; - } - - @Override - public ServicePrincipalImpl withExistingApplication(ActiveDirectoryApplication application) { - createParameters.withAppId(application.applicationId()); - return this; - } - - @Override - public ServicePrincipalImpl withNewApplication(Creatable applicationCreatable) { - this.addDependency(applicationCreatable); - this.applicationCreatable = applicationCreatable; - return this; - } - - @Override - public ServicePrincipalImpl withNewApplication(String signOnUrl) { - return withNewApplication( - manager.applications().define(name()).withSignOnUrl(signOnUrl).withIdentifierUrl(signOnUrl)); - } - - @Override - public ServicePrincipalImpl withNewRole(BuiltInRole role, String scope) { - this.rolesToCreate.put(scope, role); - return this; - } - - @Override - public ServicePrincipalImpl withNewRoleInSubscription(BuiltInRole role, String subscriptionId) { - this.assignedSubscription = subscriptionId; - return withNewRole(role, "subscriptions/" + subscriptionId); - } - - @Override - public ServicePrincipalImpl withNewRoleInResourceGroup(BuiltInRole role, ResourceGroup resourceGroup) { - return withNewRole(role, resourceGroup.id()); - } - - @Override - public Update withoutRole(RoleAssignment roleAssignment) { - this.rolesToDelete.add(roleAssignment.id()); - return this; - } - - @Override - public String id() { - return innerModel().objectId(); - } - - @Override - public AuthorizationManager manager() { - return this.manager; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/ServicePrincipalsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/ServicePrincipalsClientImpl.java deleted file mode 100644 index e1e0a3d52711..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/ServicePrincipalsClientImpl.java +++ /dev/null @@ -1,2601 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.authorization.fluent.ServicePrincipalsClient; -import com.azure.resourcemanager.authorization.fluent.models.AppRoleAssignmentInner; -import com.azure.resourcemanager.authorization.fluent.models.DirectoryObjectInner; -import com.azure.resourcemanager.authorization.fluent.models.KeyCredentialInner; -import com.azure.resourcemanager.authorization.fluent.models.PasswordCredentialInner; -import com.azure.resourcemanager.authorization.fluent.models.ServicePrincipalInner; -import com.azure.resourcemanager.authorization.models.AddOwnerParameters; -import com.azure.resourcemanager.authorization.models.AppRoleAssignmentListResult; -import com.azure.resourcemanager.authorization.models.DirectoryObjectListResult; -import com.azure.resourcemanager.authorization.models.GraphErrorException; -import com.azure.resourcemanager.authorization.models.KeyCredentialListResult; -import com.azure.resourcemanager.authorization.models.KeyCredentialsUpdateParameters; -import com.azure.resourcemanager.authorization.models.PasswordCredentialListResult; -import com.azure.resourcemanager.authorization.models.PasswordCredentialsUpdateParameters; -import com.azure.resourcemanager.authorization.models.ServicePrincipalCreateParameters; -import com.azure.resourcemanager.authorization.models.ServicePrincipalListResult; -import com.azure.resourcemanager.authorization.models.ServicePrincipalUpdateParameters; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ServicePrincipalsClient. */ -public final class ServicePrincipalsClientImpl implements InnerSupportsDelete, ServicePrincipalsClient { - private final ClientLogger logger = new ClientLogger(ServicePrincipalsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final ServicePrincipalsService service; - - /** The service client containing this operation class. */ - private final GraphRbacManagementClientImpl client; - - /** - * Initializes an instance of ServicePrincipalsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ServicePrincipalsClientImpl(GraphRbacManagementClientImpl client) { - this.service = - RestProxy.create(ServicePrincipalsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for GraphRbacManagementClientServicePrincipals to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "GraphRbacManagementC") - private interface ServicePrincipalsService { - @Headers({"Content-Type: application/json"}) - @Post("/{tenantID}/servicePrincipals") - @ExpectedResponses({201}) - @UnexpectedResponseExceptionType(GraphErrorException.class) - Mono> create( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("tenantID") String tenantId, - @BodyParam("application/json") ServicePrincipalCreateParameters parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/{tenantID}/servicePrincipals") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(GraphErrorException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("$filter") String filter, - @QueryParam("api-version") String apiVersion, - @PathParam("tenantID") String tenantId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch("/{tenantID}/servicePrincipals/{objectId}") - @ExpectedResponses({204}) - @UnexpectedResponseExceptionType(GraphErrorException.class) - Mono> update( - @HostParam("$host") String endpoint, - @PathParam("objectId") String objectId, - @QueryParam("api-version") String apiVersion, - @PathParam("tenantID") String tenantId, - @BodyParam("application/json") ServicePrincipalUpdateParameters parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete("/{tenantID}/servicePrincipals/{objectId}") - @ExpectedResponses({204}) - @UnexpectedResponseExceptionType(GraphErrorException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @PathParam("objectId") String objectId, - @QueryParam("api-version") String apiVersion, - @PathParam("tenantID") String tenantId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/{tenantID}/servicePrincipals/{objectId}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(GraphErrorException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("objectId") String objectId, - @QueryParam("api-version") String apiVersion, - @PathParam("tenantID") String tenantId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/{tenantID}/servicePrincipals/{objectId}/appRoleAssignedTo") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(GraphErrorException.class) - Mono> listAppRoleAssignedTo( - @HostParam("$host") String endpoint, - @PathParam("objectId") String objectId, - @QueryParam("api-version") String apiVersion, - @PathParam("tenantID") String tenantId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/{tenantID}/servicePrincipals/{objectId}/appRoleAssignments") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(GraphErrorException.class) - Mono> listAppRoleAssignments( - @HostParam("$host") String endpoint, - @PathParam("objectId") String objectId, - @QueryParam("api-version") String apiVersion, - @PathParam("tenantID") String tenantId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/{tenantID}/servicePrincipals/{objectId}/owners") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(GraphErrorException.class) - Mono> listOwners( - @HostParam("$host") String endpoint, - @PathParam("objectId") String objectId, - @QueryParam("api-version") String apiVersion, - @PathParam("tenantID") String tenantId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post("/{tenantID}/servicePrincipals/{objectId}/$links/owners") - @ExpectedResponses({204}) - @UnexpectedResponseExceptionType(GraphErrorException.class) - Mono> addOwner( - @HostParam("$host") String endpoint, - @PathParam("objectId") String objectId, - @QueryParam("api-version") String apiVersion, - @PathParam("tenantID") String tenantId, - @BodyParam("application/json") AddOwnerParameters parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete("/{tenantID}/servicePrincipals/{objectId}/$links/owners/{ownerObjectId}") - @ExpectedResponses({204}) - @UnexpectedResponseExceptionType(GraphErrorException.class) - Mono> removeOwner( - @HostParam("$host") String endpoint, - @PathParam("objectId") String objectId, - @PathParam("ownerObjectId") String ownerObjectId, - @QueryParam("api-version") String apiVersion, - @PathParam("tenantID") String tenantId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/{tenantID}/servicePrincipals/{objectId}/keyCredentials") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(GraphErrorException.class) - Mono> listKeyCredentials( - @HostParam("$host") String endpoint, - @PathParam("objectId") String objectId, - @QueryParam("api-version") String apiVersion, - @PathParam("tenantID") String tenantId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch("/{tenantID}/servicePrincipals/{objectId}/keyCredentials") - @ExpectedResponses({204}) - @UnexpectedResponseExceptionType(GraphErrorException.class) - Mono> updateKeyCredentials( - @HostParam("$host") String endpoint, - @PathParam("objectId") String objectId, - @QueryParam("api-version") String apiVersion, - @PathParam("tenantID") String tenantId, - @BodyParam("application/json") KeyCredentialsUpdateParameters parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/{tenantID}/servicePrincipals/{objectId}/passwordCredentials") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(GraphErrorException.class) - Mono> listPasswordCredentials( - @HostParam("$host") String endpoint, - @PathParam("objectId") String objectId, - @QueryParam("api-version") String apiVersion, - @PathParam("tenantID") String tenantId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch("/{tenantID}/servicePrincipals/{objectId}/passwordCredentials") - @ExpectedResponses({204}) - @UnexpectedResponseExceptionType(GraphErrorException.class) - Mono> updatePasswordCredentials( - @HostParam("$host") String endpoint, - @PathParam("objectId") String objectId, - @QueryParam("api-version") String apiVersion, - @PathParam("tenantID") String tenantId, - @BodyParam("application/json") PasswordCredentialsUpdateParameters parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/{tenantID}/{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(GraphErrorException.class) - Mono> listNext( - @HostParam("$host") String endpoint, - @PathParam(value = "nextLink", encoded = true) String nextLink, - @QueryParam("api-version") String apiVersion, - @PathParam("tenantID") String tenantId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(GraphErrorException.class) - Mono> listAppRoleAssignedToNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(GraphErrorException.class) - Mono> listAppRoleAssignmentsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(GraphErrorException.class) - Mono> listOwnersNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Creates a service principal in the directory. - * - * @param tenantId The tenant ID. - * @param parameters Parameters to create a service principal. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return active Directory service principal information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createWithResponseAsync( - String tenantId, ServicePrincipalCreateParameters parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .create( - this.client.getEndpoint(), - this.client.getApiVersion(), - tenantId, - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates a service principal in the directory. - * - * @param tenantId The tenant ID. - * @param parameters Parameters to create a service principal. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return active Directory service principal information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync( - String tenantId, ServicePrincipalCreateParameters parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .create(this.client.getEndpoint(), this.client.getApiVersion(), tenantId, parameters, accept, context); - } - - /** - * Creates a service principal in the directory. - * - * @param tenantId The tenant ID. - * @param parameters Parameters to create a service principal. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return active Directory service principal information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createAsync(String tenantId, ServicePrincipalCreateParameters parameters) { - return createWithResponseAsync(tenantId, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates a service principal in the directory. - * - * @param tenantId The tenant ID. - * @param parameters Parameters to create a service principal. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return active Directory service principal information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ServicePrincipalInner create(String tenantId, ServicePrincipalCreateParameters parameters) { - return createAsync(tenantId, parameters).block(); - } - - /** - * Creates a service principal in the directory. - * - * @param tenantId The tenant ID. - * @param parameters Parameters to create a service principal. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return active Directory service principal information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse( - String tenantId, ServicePrincipalCreateParameters parameters, Context context) { - return createWithResponseAsync(tenantId, parameters, context).block(); - } - - /** - * Gets a list of service principals from the current tenant. - * - * @param tenantId The tenant ID. - * @param filter The filter to apply to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of service principals from the current tenant. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String tenantId, String filter) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), filter, this.client.getApiVersion(), tenantId, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().odataNextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a list of service principals from the current tenant. - * - * @param tenantId The tenant ID. - * @param filter The filter to apply to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of service principals from the current tenant. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String tenantId, String filter, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), filter, this.client.getApiVersion(), tenantId, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().odataNextLink(), - null)); - } - - /** - * Gets a list of service principals from the current tenant. - * - * @param tenantId The tenant ID. - * @param filter The filter to apply to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of service principals from the current tenant. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String tenantId, String filter) { - return new PagedFlux<>( - () -> listSinglePageAsync(tenantId, filter), nextLink -> listNextSinglePageAsync(nextLink, tenantId)); - } - - /** - * Gets a list of service principals from the current tenant. - * - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of service principals from the current tenant. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String tenantId) { - final String filter = null; - return new PagedFlux<>( - () -> listSinglePageAsync(tenantId, filter), nextLink -> listNextSinglePageAsync(nextLink, tenantId)); - } - - /** - * Gets a list of service principals from the current tenant. - * - * @param tenantId The tenant ID. - * @param filter The filter to apply to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of service principals from the current tenant. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String tenantId, String filter, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(tenantId, filter, context), - nextLink -> listNextSinglePageAsync(nextLink, tenantId, context)); - } - - /** - * Gets a list of service principals from the current tenant. - * - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of service principals from the current tenant. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String tenantId) { - final String filter = null; - return new PagedIterable<>(listAsync(tenantId, filter)); - } - - /** - * Gets a list of service principals from the current tenant. - * - * @param tenantId The tenant ID. - * @param filter The filter to apply to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of service principals from the current tenant. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String tenantId, String filter, Context context) { - return new PagedIterable<>(listAsync(tenantId, filter, context)); - } - - /** - * Updates a service principal in the directory. - * - * @param objectId The object ID of the service principal to delete. - * @param tenantId The tenant ID. - * @param parameters Parameters to update a service principal. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateWithResponseAsync( - String objectId, String tenantId, ServicePrincipalUpdateParameters parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (objectId == null) { - return Mono.error(new IllegalArgumentException("Parameter objectId is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - objectId, - this.client.getApiVersion(), - tenantId, - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates a service principal in the directory. - * - * @param objectId The object ID of the service principal to delete. - * @param tenantId The tenant ID. - * @param parameters Parameters to update a service principal. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String objectId, String tenantId, ServicePrincipalUpdateParameters parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (objectId == null) { - return Mono.error(new IllegalArgumentException("Parameter objectId is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - objectId, - this.client.getApiVersion(), - tenantId, - parameters, - accept, - context); - } - - /** - * Updates a service principal in the directory. - * - * @param objectId The object ID of the service principal to delete. - * @param tenantId The tenant ID. - * @param parameters Parameters to update a service principal. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync(String objectId, String tenantId, ServicePrincipalUpdateParameters parameters) { - return updateWithResponseAsync(objectId, tenantId, parameters).flatMap((Response res) -> Mono.empty()); - } - - /** - * Updates a service principal in the directory. - * - * @param objectId The object ID of the service principal to delete. - * @param tenantId The tenant ID. - * @param parameters Parameters to update a service principal. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void update(String objectId, String tenantId, ServicePrincipalUpdateParameters parameters) { - updateAsync(objectId, tenantId, parameters).block(); - } - - /** - * Updates a service principal in the directory. - * - * @param objectId The object ID of the service principal to delete. - * @param tenantId The tenant ID. - * @param parameters Parameters to update a service principal. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String objectId, String tenantId, ServicePrincipalUpdateParameters parameters, Context context) { - return updateWithResponseAsync(objectId, tenantId, parameters, context).block(); - } - - /** - * Deletes a service principal from the directory. - * - * @param objectId The object ID of the service principal to delete. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String objectId, String tenantId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (objectId == null) { - return Mono.error(new IllegalArgumentException("Parameter objectId is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - objectId, - this.client.getApiVersion(), - tenantId, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a service principal from the directory. - * - * @param objectId The object ID of the service principal to delete. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String objectId, String tenantId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (objectId == null) { - return Mono.error(new IllegalArgumentException("Parameter objectId is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .delete(this.client.getEndpoint(), objectId, this.client.getApiVersion(), tenantId, accept, context); - } - - /** - * Deletes a service principal from the directory. - * - * @param objectId The object ID of the service principal to delete. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String objectId, String tenantId) { - return deleteWithResponseAsync(objectId, tenantId).flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes a service principal from the directory. - * - * @param objectId The object ID of the service principal to delete. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String objectId, String tenantId) { - deleteAsync(objectId, tenantId).block(); - } - - /** - * Deletes a service principal from the directory. - * - * @param objectId The object ID of the service principal to delete. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String objectId, String tenantId, Context context) { - return deleteWithResponseAsync(objectId, tenantId, context).block(); - } - - /** - * Gets service principal information from the directory. Query by objectId or pass a filter to query by appId. - * - * @param objectId The object ID of the service principal to get. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service principal information from the directory. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync(String objectId, String tenantId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (objectId == null) { - return Mono.error(new IllegalArgumentException("Parameter objectId is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - objectId, - this.client.getApiVersion(), - tenantId, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets service principal information from the directory. Query by objectId or pass a filter to query by appId. - * - * @param objectId The object ID of the service principal to get. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service principal information from the directory. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String objectId, String tenantId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (objectId == null) { - return Mono.error(new IllegalArgumentException("Parameter objectId is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), objectId, this.client.getApiVersion(), tenantId, accept, context); - } - - /** - * Gets service principal information from the directory. Query by objectId or pass a filter to query by appId. - * - * @param objectId The object ID of the service principal to get. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service principal information from the directory. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync(String objectId, String tenantId) { - return getWithResponseAsync(objectId, tenantId) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets service principal information from the directory. Query by objectId or pass a filter to query by appId. - * - * @param objectId The object ID of the service principal to get. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service principal information from the directory. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ServicePrincipalInner get(String objectId, String tenantId) { - return getAsync(objectId, tenantId).block(); - } - - /** - * Gets service principal information from the directory. Query by objectId or pass a filter to query by appId. - * - * @param objectId The object ID of the service principal to get. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service principal information from the directory. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String objectId, String tenantId, Context context) { - return getWithResponseAsync(objectId, tenantId, context).block(); - } - - /** - * Principals (users, groups, and service principals) that are assigned to this service principal. - * - * @param objectId The object ID of the service principal for which to get owners. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return appRoleAssignment list operation result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAppRoleAssignedToSinglePageAsync( - String objectId, String tenantId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (objectId == null) { - return Mono.error(new IllegalArgumentException("Parameter objectId is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .listAppRoleAssignedTo( - this.client.getEndpoint(), - objectId, - this.client.getApiVersion(), - tenantId, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().odataNextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Principals (users, groups, and service principals) that are assigned to this service principal. - * - * @param objectId The object ID of the service principal for which to get owners. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return appRoleAssignment list operation result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAppRoleAssignedToSinglePageAsync( - String objectId, String tenantId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (objectId == null) { - return Mono.error(new IllegalArgumentException("Parameter objectId is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .listAppRoleAssignedTo( - this.client.getEndpoint(), objectId, this.client.getApiVersion(), tenantId, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().odataNextLink(), - null)); - } - - /** - * Principals (users, groups, and service principals) that are assigned to this service principal. - * - * @param objectId The object ID of the service principal for which to get owners. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return appRoleAssignment list operation result. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAppRoleAssignedToAsync(String objectId, String tenantId) { - return new PagedFlux<>( - () -> listAppRoleAssignedToSinglePageAsync(objectId, tenantId), - nextLink -> listAppRoleAssignedToNextSinglePageAsync(nextLink)); - } - - /** - * Principals (users, groups, and service principals) that are assigned to this service principal. - * - * @param objectId The object ID of the service principal for which to get owners. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return appRoleAssignment list operation result. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAppRoleAssignedToAsync( - String objectId, String tenantId, Context context) { - return new PagedFlux<>( - () -> listAppRoleAssignedToSinglePageAsync(objectId, tenantId, context), - nextLink -> listAppRoleAssignedToNextSinglePageAsync(nextLink, context)); - } - - /** - * Principals (users, groups, and service principals) that are assigned to this service principal. - * - * @param objectId The object ID of the service principal for which to get owners. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return appRoleAssignment list operation result. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAppRoleAssignedTo(String objectId, String tenantId) { - return new PagedIterable<>(listAppRoleAssignedToAsync(objectId, tenantId)); - } - - /** - * Principals (users, groups, and service principals) that are assigned to this service principal. - * - * @param objectId The object ID of the service principal for which to get owners. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return appRoleAssignment list operation result. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAppRoleAssignedTo( - String objectId, String tenantId, Context context) { - return new PagedIterable<>(listAppRoleAssignedToAsync(objectId, tenantId, context)); - } - - /** - * Applications that the service principal is assigned to. - * - * @param objectId The object ID of the service principal for which to get owners. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return appRoleAssignment list operation result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAppRoleAssignmentsSinglePageAsync( - String objectId, String tenantId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (objectId == null) { - return Mono.error(new IllegalArgumentException("Parameter objectId is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .listAppRoleAssignments( - this.client.getEndpoint(), - objectId, - this.client.getApiVersion(), - tenantId, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().odataNextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Applications that the service principal is assigned to. - * - * @param objectId The object ID of the service principal for which to get owners. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return appRoleAssignment list operation result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAppRoleAssignmentsSinglePageAsync( - String objectId, String tenantId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (objectId == null) { - return Mono.error(new IllegalArgumentException("Parameter objectId is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .listAppRoleAssignments( - this.client.getEndpoint(), objectId, this.client.getApiVersion(), tenantId, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().odataNextLink(), - null)); - } - - /** - * Applications that the service principal is assigned to. - * - * @param objectId The object ID of the service principal for which to get owners. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return appRoleAssignment list operation result. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAppRoleAssignmentsAsync(String objectId, String tenantId) { - return new PagedFlux<>( - () -> listAppRoleAssignmentsSinglePageAsync(objectId, tenantId), - nextLink -> listAppRoleAssignmentsNextSinglePageAsync(nextLink)); - } - - /** - * Applications that the service principal is assigned to. - * - * @param objectId The object ID of the service principal for which to get owners. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return appRoleAssignment list operation result. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAppRoleAssignmentsAsync( - String objectId, String tenantId, Context context) { - return new PagedFlux<>( - () -> listAppRoleAssignmentsSinglePageAsync(objectId, tenantId, context), - nextLink -> listAppRoleAssignmentsNextSinglePageAsync(nextLink, context)); - } - - /** - * Applications that the service principal is assigned to. - * - * @param objectId The object ID of the service principal for which to get owners. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return appRoleAssignment list operation result. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAppRoleAssignments(String objectId, String tenantId) { - return new PagedIterable<>(listAppRoleAssignmentsAsync(objectId, tenantId)); - } - - /** - * Applications that the service principal is assigned to. - * - * @param objectId The object ID of the service principal for which to get owners. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return appRoleAssignment list operation result. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAppRoleAssignments( - String objectId, String tenantId, Context context) { - return new PagedIterable<>(listAppRoleAssignmentsAsync(objectId, tenantId, context)); - } - - /** - * The owners are a set of non-admin users who are allowed to modify this object. - * - * @param objectId The object ID of the service principal for which to get owners. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return directoryObject list operation result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listOwnersSinglePageAsync(String objectId, String tenantId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (objectId == null) { - return Mono.error(new IllegalArgumentException("Parameter objectId is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .listOwners( - this.client.getEndpoint(), - objectId, - this.client.getApiVersion(), - tenantId, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().odataNextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * The owners are a set of non-admin users who are allowed to modify this object. - * - * @param objectId The object ID of the service principal for which to get owners. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return directoryObject list operation result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listOwnersSinglePageAsync( - String objectId, String tenantId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (objectId == null) { - return Mono.error(new IllegalArgumentException("Parameter objectId is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .listOwners(this.client.getEndpoint(), objectId, this.client.getApiVersion(), tenantId, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().odataNextLink(), - null)); - } - - /** - * The owners are a set of non-admin users who are allowed to modify this object. - * - * @param objectId The object ID of the service principal for which to get owners. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return directoryObject list operation result. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listOwnersAsync(String objectId, String tenantId) { - return new PagedFlux<>( - () -> listOwnersSinglePageAsync(objectId, tenantId), nextLink -> listOwnersNextSinglePageAsync(nextLink)); - } - - /** - * The owners are a set of non-admin users who are allowed to modify this object. - * - * @param objectId The object ID of the service principal for which to get owners. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return directoryObject list operation result. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listOwnersAsync(String objectId, String tenantId, Context context) { - return new PagedFlux<>( - () -> listOwnersSinglePageAsync(objectId, tenantId, context), - nextLink -> listOwnersNextSinglePageAsync(nextLink, context)); - } - - /** - * The owners are a set of non-admin users who are allowed to modify this object. - * - * @param objectId The object ID of the service principal for which to get owners. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return directoryObject list operation result. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listOwners(String objectId, String tenantId) { - return new PagedIterable<>(listOwnersAsync(objectId, tenantId)); - } - - /** - * The owners are a set of non-admin users who are allowed to modify this object. - * - * @param objectId The object ID of the service principal for which to get owners. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return directoryObject list operation result. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listOwners(String objectId, String tenantId, Context context) { - return new PagedIterable<>(listOwnersAsync(objectId, tenantId, context)); - } - - /** - * Add an owner to a service principal. - * - * @param objectId The object ID of the service principal to which to add the owner. - * @param tenantId The tenant ID. - * @param parameters The URL of the owner object, such as - * https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects/f260bbc4-c254-447b-94cf-293b5ec434dd. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> addOwnerWithResponseAsync( - String objectId, String tenantId, AddOwnerParameters parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (objectId == null) { - return Mono.error(new IllegalArgumentException("Parameter objectId is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .addOwner( - this.client.getEndpoint(), - objectId, - this.client.getApiVersion(), - tenantId, - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Add an owner to a service principal. - * - * @param objectId The object ID of the service principal to which to add the owner. - * @param tenantId The tenant ID. - * @param parameters The URL of the owner object, such as - * https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects/f260bbc4-c254-447b-94cf-293b5ec434dd. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> addOwnerWithResponseAsync( - String objectId, String tenantId, AddOwnerParameters parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (objectId == null) { - return Mono.error(new IllegalArgumentException("Parameter objectId is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .addOwner( - this.client.getEndpoint(), - objectId, - this.client.getApiVersion(), - tenantId, - parameters, - accept, - context); - } - - /** - * Add an owner to a service principal. - * - * @param objectId The object ID of the service principal to which to add the owner. - * @param tenantId The tenant ID. - * @param parameters The URL of the owner object, such as - * https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects/f260bbc4-c254-447b-94cf-293b5ec434dd. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono addOwnerAsync(String objectId, String tenantId, AddOwnerParameters parameters) { - return addOwnerWithResponseAsync(objectId, tenantId, parameters).flatMap((Response res) -> Mono.empty()); - } - - /** - * Add an owner to a service principal. - * - * @param objectId The object ID of the service principal to which to add the owner. - * @param tenantId The tenant ID. - * @param parameters The URL of the owner object, such as - * https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects/f260bbc4-c254-447b-94cf-293b5ec434dd. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void addOwner(String objectId, String tenantId, AddOwnerParameters parameters) { - addOwnerAsync(objectId, tenantId, parameters).block(); - } - - /** - * Add an owner to a service principal. - * - * @param objectId The object ID of the service principal to which to add the owner. - * @param tenantId The tenant ID. - * @param parameters The URL of the owner object, such as - * https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects/f260bbc4-c254-447b-94cf-293b5ec434dd. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response addOwnerWithResponse( - String objectId, String tenantId, AddOwnerParameters parameters, Context context) { - return addOwnerWithResponseAsync(objectId, tenantId, parameters, context).block(); - } - - /** - * Remove a member from owners. - * - * @param objectId The object ID of the service principal from which to remove the owner. - * @param ownerObjectId Owner object id. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> removeOwnerWithResponseAsync(String objectId, String ownerObjectId, String tenantId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (objectId == null) { - return Mono.error(new IllegalArgumentException("Parameter objectId is required and cannot be null.")); - } - if (ownerObjectId == null) { - return Mono.error(new IllegalArgumentException("Parameter ownerObjectId is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .removeOwner( - this.client.getEndpoint(), - objectId, - ownerObjectId, - this.client.getApiVersion(), - tenantId, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Remove a member from owners. - * - * @param objectId The object ID of the service principal from which to remove the owner. - * @param ownerObjectId Owner object id. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> removeOwnerWithResponseAsync( - String objectId, String ownerObjectId, String tenantId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (objectId == null) { - return Mono.error(new IllegalArgumentException("Parameter objectId is required and cannot be null.")); - } - if (ownerObjectId == null) { - return Mono.error(new IllegalArgumentException("Parameter ownerObjectId is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .removeOwner( - this.client.getEndpoint(), - objectId, - ownerObjectId, - this.client.getApiVersion(), - tenantId, - accept, - context); - } - - /** - * Remove a member from owners. - * - * @param objectId The object ID of the service principal from which to remove the owner. - * @param ownerObjectId Owner object id. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono removeOwnerAsync(String objectId, String ownerObjectId, String tenantId) { - return removeOwnerWithResponseAsync(objectId, ownerObjectId, tenantId) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Remove a member from owners. - * - * @param objectId The object ID of the service principal from which to remove the owner. - * @param ownerObjectId Owner object id. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void removeOwner(String objectId, String ownerObjectId, String tenantId) { - removeOwnerAsync(objectId, ownerObjectId, tenantId).block(); - } - - /** - * Remove a member from owners. - * - * @param objectId The object ID of the service principal from which to remove the owner. - * @param ownerObjectId Owner object id. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response removeOwnerWithResponse( - String objectId, String ownerObjectId, String tenantId, Context context) { - return removeOwnerWithResponseAsync(objectId, ownerObjectId, tenantId, context).block(); - } - - /** - * Get the keyCredentials associated with the specified service principal. - * - * @param objectId The object ID of the service principal for which to get keyCredentials. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the keyCredentials associated with the specified service principal. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listKeyCredentialsSinglePageAsync( - String objectId, String tenantId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (objectId == null) { - return Mono.error(new IllegalArgumentException("Parameter objectId is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .listKeyCredentials( - this.client.getEndpoint(), - objectId, - this.client.getApiVersion(), - tenantId, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the keyCredentials associated with the specified service principal. - * - * @param objectId The object ID of the service principal for which to get keyCredentials. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the keyCredentials associated with the specified service principal. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listKeyCredentialsSinglePageAsync( - String objectId, String tenantId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (objectId == null) { - return Mono.error(new IllegalArgumentException("Parameter objectId is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .listKeyCredentials( - this.client.getEndpoint(), objectId, this.client.getApiVersion(), tenantId, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); - } - - /** - * Get the keyCredentials associated with the specified service principal. - * - * @param objectId The object ID of the service principal for which to get keyCredentials. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the keyCredentials associated with the specified service principal. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listKeyCredentialsAsync(String objectId, String tenantId) { - return new PagedFlux<>(() -> listKeyCredentialsSinglePageAsync(objectId, tenantId)); - } - - /** - * Get the keyCredentials associated with the specified service principal. - * - * @param objectId The object ID of the service principal for which to get keyCredentials. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the keyCredentials associated with the specified service principal. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listKeyCredentialsAsync(String objectId, String tenantId, Context context) { - return new PagedFlux<>(() -> listKeyCredentialsSinglePageAsync(objectId, tenantId, context)); - } - - /** - * Get the keyCredentials associated with the specified service principal. - * - * @param objectId The object ID of the service principal for which to get keyCredentials. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the keyCredentials associated with the specified service principal. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listKeyCredentials(String objectId, String tenantId) { - return new PagedIterable<>(listKeyCredentialsAsync(objectId, tenantId)); - } - - /** - * Get the keyCredentials associated with the specified service principal. - * - * @param objectId The object ID of the service principal for which to get keyCredentials. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the keyCredentials associated with the specified service principal. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listKeyCredentials(String objectId, String tenantId, Context context) { - return new PagedIterable<>(listKeyCredentialsAsync(objectId, tenantId, context)); - } - - /** - * Update the keyCredentials associated with a service principal. - * - * @param objectId The object ID for which to get service principal information. - * @param tenantId The tenant ID. - * @param parameters Parameters to update the keyCredentials of an existing service principal. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateKeyCredentialsWithResponseAsync( - String objectId, String tenantId, KeyCredentialsUpdateParameters parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (objectId == null) { - return Mono.error(new IllegalArgumentException("Parameter objectId is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .updateKeyCredentials( - this.client.getEndpoint(), - objectId, - this.client.getApiVersion(), - tenantId, - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Update the keyCredentials associated with a service principal. - * - * @param objectId The object ID for which to get service principal information. - * @param tenantId The tenant ID. - * @param parameters Parameters to update the keyCredentials of an existing service principal. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateKeyCredentialsWithResponseAsync( - String objectId, String tenantId, KeyCredentialsUpdateParameters parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (objectId == null) { - return Mono.error(new IllegalArgumentException("Parameter objectId is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .updateKeyCredentials( - this.client.getEndpoint(), - objectId, - this.client.getApiVersion(), - tenantId, - parameters, - accept, - context); - } - - /** - * Update the keyCredentials associated with a service principal. - * - * @param objectId The object ID for which to get service principal information. - * @param tenantId The tenant ID. - * @param parameters Parameters to update the keyCredentials of an existing service principal. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateKeyCredentialsAsync( - String objectId, String tenantId, KeyCredentialsUpdateParameters parameters) { - return updateKeyCredentialsWithResponseAsync(objectId, tenantId, parameters) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Update the keyCredentials associated with a service principal. - * - * @param objectId The object ID for which to get service principal information. - * @param tenantId The tenant ID. - * @param parameters Parameters to update the keyCredentials of an existing service principal. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void updateKeyCredentials(String objectId, String tenantId, KeyCredentialsUpdateParameters parameters) { - updateKeyCredentialsAsync(objectId, tenantId, parameters).block(); - } - - /** - * Update the keyCredentials associated with a service principal. - * - * @param objectId The object ID for which to get service principal information. - * @param tenantId The tenant ID. - * @param parameters Parameters to update the keyCredentials of an existing service principal. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateKeyCredentialsWithResponse( - String objectId, String tenantId, KeyCredentialsUpdateParameters parameters, Context context) { - return updateKeyCredentialsWithResponseAsync(objectId, tenantId, parameters, context).block(); - } - - /** - * Gets the passwordCredentials associated with a service principal. - * - * @param objectId The object ID of the service principal. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the passwordCredentials associated with a service principal. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listPasswordCredentialsSinglePageAsync( - String objectId, String tenantId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (objectId == null) { - return Mono.error(new IllegalArgumentException("Parameter objectId is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .listPasswordCredentials( - this.client.getEndpoint(), - objectId, - this.client.getApiVersion(), - tenantId, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the passwordCredentials associated with a service principal. - * - * @param objectId The object ID of the service principal. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the passwordCredentials associated with a service principal. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listPasswordCredentialsSinglePageAsync( - String objectId, String tenantId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (objectId == null) { - return Mono.error(new IllegalArgumentException("Parameter objectId is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .listPasswordCredentials( - this.client.getEndpoint(), objectId, this.client.getApiVersion(), tenantId, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); - } - - /** - * Gets the passwordCredentials associated with a service principal. - * - * @param objectId The object ID of the service principal. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the passwordCredentials associated with a service principal. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listPasswordCredentialsAsync(String objectId, String tenantId) { - return new PagedFlux<>(() -> listPasswordCredentialsSinglePageAsync(objectId, tenantId)); - } - - /** - * Gets the passwordCredentials associated with a service principal. - * - * @param objectId The object ID of the service principal. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the passwordCredentials associated with a service principal. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listPasswordCredentialsAsync( - String objectId, String tenantId, Context context) { - return new PagedFlux<>(() -> listPasswordCredentialsSinglePageAsync(objectId, tenantId, context)); - } - - /** - * Gets the passwordCredentials associated with a service principal. - * - * @param objectId The object ID of the service principal. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the passwordCredentials associated with a service principal. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listPasswordCredentials(String objectId, String tenantId) { - return new PagedIterable<>(listPasswordCredentialsAsync(objectId, tenantId)); - } - - /** - * Gets the passwordCredentials associated with a service principal. - * - * @param objectId The object ID of the service principal. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the passwordCredentials associated with a service principal. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listPasswordCredentials( - String objectId, String tenantId, Context context) { - return new PagedIterable<>(listPasswordCredentialsAsync(objectId, tenantId, context)); - } - - /** - * Updates the passwordCredentials associated with a service principal. - * - * @param objectId The object ID of the service principal. - * @param tenantId The tenant ID. - * @param parameters Parameters to update the passwordCredentials of an existing service principal. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updatePasswordCredentialsWithResponseAsync( - String objectId, String tenantId, PasswordCredentialsUpdateParameters parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (objectId == null) { - return Mono.error(new IllegalArgumentException("Parameter objectId is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .updatePasswordCredentials( - this.client.getEndpoint(), - objectId, - this.client.getApiVersion(), - tenantId, - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates the passwordCredentials associated with a service principal. - * - * @param objectId The object ID of the service principal. - * @param tenantId The tenant ID. - * @param parameters Parameters to update the passwordCredentials of an existing service principal. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updatePasswordCredentialsWithResponseAsync( - String objectId, String tenantId, PasswordCredentialsUpdateParameters parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (objectId == null) { - return Mono.error(new IllegalArgumentException("Parameter objectId is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .updatePasswordCredentials( - this.client.getEndpoint(), - objectId, - this.client.getApiVersion(), - tenantId, - parameters, - accept, - context); - } - - /** - * Updates the passwordCredentials associated with a service principal. - * - * @param objectId The object ID of the service principal. - * @param tenantId The tenant ID. - * @param parameters Parameters to update the passwordCredentials of an existing service principal. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updatePasswordCredentialsAsync( - String objectId, String tenantId, PasswordCredentialsUpdateParameters parameters) { - return updatePasswordCredentialsWithResponseAsync(objectId, tenantId, parameters) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Updates the passwordCredentials associated with a service principal. - * - * @param objectId The object ID of the service principal. - * @param tenantId The tenant ID. - * @param parameters Parameters to update the passwordCredentials of an existing service principal. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void updatePasswordCredentials( - String objectId, String tenantId, PasswordCredentialsUpdateParameters parameters) { - updatePasswordCredentialsAsync(objectId, tenantId, parameters).block(); - } - - /** - * Updates the passwordCredentials associated with a service principal. - * - * @param objectId The object ID of the service principal. - * @param tenantId The tenant ID. - * @param parameters Parameters to update the passwordCredentials of an existing service principal. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updatePasswordCredentialsWithResponse( - String objectId, String tenantId, PasswordCredentialsUpdateParameters parameters, Context context) { - return updatePasswordCredentialsWithResponseAsync(objectId, tenantId, parameters, context).block(); - } - - /** - * Gets a list of service principals from the current tenant. - * - * @param nextLink Next link for the list operation. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of service principals from the current tenant. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, String tenantId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .listNext( - this.client.getEndpoint(), - nextLink, - this.client.getApiVersion(), - tenantId, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().odataNextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a list of service principals from the current tenant. - * - * @param nextLink Next link for the list operation. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of service principals from the current tenant. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync( - String nextLink, String tenantId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .listNext(this.client.getEndpoint(), nextLink, this.client.getApiVersion(), tenantId, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().odataNextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return appRoleAssignment list operation result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAppRoleAssignedToNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> service.listAppRoleAssignedToNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().odataNextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return appRoleAssignment list operation result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAppRoleAssignedToNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .listAppRoleAssignedToNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().odataNextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return appRoleAssignment list operation result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAppRoleAssignmentsNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> service.listAppRoleAssignmentsNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().odataNextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return appRoleAssignment list operation result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAppRoleAssignmentsNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .listAppRoleAssignmentsNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().odataNextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return directoryObject list operation result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listOwnersNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext(context -> service.listOwnersNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().odataNextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return directoryObject list operation result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listOwnersNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .listOwnersNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().odataNextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/ServicePrincipalsImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/ServicePrincipalsImpl.java deleted file mode 100644 index c26f98445179..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/ServicePrincipalsImpl.java +++ /dev/null @@ -1,120 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.authorization.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.authorization.AuthorizationManager; -import com.azure.resourcemanager.authorization.models.ServicePrincipal; -import com.azure.resourcemanager.authorization.models.ServicePrincipals; -import com.azure.resourcemanager.authorization.fluent.models.ServicePrincipalInner; -import com.azure.resourcemanager.authorization.fluent.ServicePrincipalsClient; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.CreatableWrappersImpl; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.utils.PagedConverter; -import reactor.core.publisher.Mono; - -/** The implementation of ServicePrincipals and its parent interfaces. */ -public class ServicePrincipalsImpl - extends CreatableWrappersImpl - implements ServicePrincipals, HasManager { - private ServicePrincipalsClient innerCollection; - private AuthorizationManager manager; - - public ServicePrincipalsImpl( - final ServicePrincipalsClient client, final AuthorizationManager authorizationManager) { - this.innerCollection = client; - this.manager = authorizationManager; - } - - @Override - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - @Override - public PagedFlux listAsync() { - return PagedConverter.flatMapPage(inner().listAsync(this.manager.tenantId()), servicePrincipalInner -> { - ServicePrincipalImpl servicePrincipal = this.wrapModel(servicePrincipalInner); - return servicePrincipal.refreshCredentialsAsync().thenReturn(servicePrincipal); - }); - } - - @Override - protected ServicePrincipalImpl wrapModel(ServicePrincipalInner servicePrincipalInner) { - if (servicePrincipalInner == null) { - return null; - } - return new ServicePrincipalImpl(servicePrincipalInner, manager()); - } - - @Override - public ServicePrincipalImpl getById(String id) { - return (ServicePrincipalImpl) getByIdAsync(id).block(); - } - - @Override - public Mono getByIdAsync(String id) { - return innerCollection - .getAsync(id, this.manager.tenantId()) - .flatMap( - servicePrincipalInner -> - new ServicePrincipalImpl(servicePrincipalInner, manager()).refreshCredentialsAsync()); - } - - @Override - public ServicePrincipal getByName(String spn) { - return getByNameAsync(spn).block(); - } - - @Override - public Mono getByNameAsync(final String name) { - return inner() - .listAsync(this.manager.tenantId(), String.format("servicePrincipalNames/any(c:c eq '%s')", name)) - .singleOrEmpty() - .switchIfEmpty( - Mono.defer(() -> inner() - .listAsync(this.manager.tenantId(), String.format("displayName eq '%s'", name)) - .singleOrEmpty())) - .map(servicePrincipalInner -> new ServicePrincipalImpl(servicePrincipalInner, manager())) - .flatMap(servicePrincipal -> servicePrincipal.refreshCredentialsAsync()); - } - - @Override - public ServicePrincipalImpl define(String name) { - return new ServicePrincipalImpl(new ServicePrincipalInner().withDisplayName(name), manager()); - } - - @Override - protected ServicePrincipalImpl wrapModel(String name) { - return new ServicePrincipalImpl(new ServicePrincipalInner().withDisplayName(name), manager()); - } - - @Override - public Mono deleteByIdAsync(String id) { - return inner().deleteAsync(id, this.manager.tenantId()); - } - - @Override - public AuthorizationManager manager() { - return this.manager; - } - - public ServicePrincipalsClient inner() { - return manager().serviceClient().getServicePrincipals(); - } - - @Override - public PagedIterable listByFilter(String filter) { - return new PagedIterable<>(listByFilterAsync(filter)); - } - - @Override - public PagedFlux listByFilterAsync(String filter) { - return PagedConverter.flatMapPage(inner().listAsync(this.manager.tenantId(), filter), servicePrincipalInner -> { - ServicePrincipalImpl servicePrincipal = this.wrapModel(servicePrincipalInner); - return servicePrincipal.refreshCredentialsAsync().thenReturn(servicePrincipal); - }); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/SignedInUsersClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/SignedInUsersClientImpl.java deleted file mode 100644 index 34ccb1923b33..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/SignedInUsersClientImpl.java +++ /dev/null @@ -1,431 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.authorization.fluent.SignedInUsersClient; -import com.azure.resourcemanager.authorization.fluent.models.DirectoryObjectInner; -import com.azure.resourcemanager.authorization.fluent.models.UserInner; -import com.azure.resourcemanager.authorization.models.DirectoryObjectListResult; -import com.azure.resourcemanager.authorization.models.GraphErrorException; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in SignedInUsersClient. */ -public final class SignedInUsersClientImpl implements SignedInUsersClient { - private final ClientLogger logger = new ClientLogger(SignedInUsersClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final SignedInUsersService service; - - /** The service client containing this operation class. */ - private final GraphRbacManagementClientImpl client; - - /** - * Initializes an instance of SignedInUsersClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - SignedInUsersClientImpl(GraphRbacManagementClientImpl client) { - this.service = - RestProxy.create(SignedInUsersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for GraphRbacManagementClientSignedInUsers to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "GraphRbacManagementC") - private interface SignedInUsersService { - @Headers({"Content-Type: application/json"}) - @Get("/{tenantID}/me") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(GraphErrorException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("tenantID") String tenantId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/{tenantID}/me/ownedObjects") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(GraphErrorException.class) - Mono> listOwnedObjects( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("tenantID") String tenantId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/{tenantID}/{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(GraphErrorException.class) - Mono> listOwnedObjectsNext( - @HostParam("$host") String endpoint, - @PathParam(value = "nextLink", encoded = true) String nextLink, - @QueryParam("api-version") String apiVersion, - @PathParam("tenantID") String tenantId, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets the details for the currently logged-in user. - * - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details for the currently logged-in user. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync(String tenantId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service.get(this.client.getEndpoint(), this.client.getApiVersion(), tenantId, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the details for the currently logged-in user. - * - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details for the currently logged-in user. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String tenantId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getApiVersion(), tenantId, accept, context); - } - - /** - * Gets the details for the currently logged-in user. - * - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details for the currently logged-in user. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync(String tenantId) { - return getWithResponseAsync(tenantId) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the details for the currently logged-in user. - * - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details for the currently logged-in user. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public UserInner get(String tenantId) { - return getAsync(tenantId).block(); - } - - /** - * Gets the details for the currently logged-in user. - * - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details for the currently logged-in user. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String tenantId, Context context) { - return getWithResponseAsync(tenantId, context).block(); - } - - /** - * Get the list of directory objects that are owned by the user. - * - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of directory objects that are owned by the user. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listOwnedObjectsSinglePageAsync(String tenantId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .listOwnedObjects( - this.client.getEndpoint(), this.client.getApiVersion(), tenantId, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().odataNextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the list of directory objects that are owned by the user. - * - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of directory objects that are owned by the user. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listOwnedObjectsSinglePageAsync( - String tenantId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .listOwnedObjects(this.client.getEndpoint(), this.client.getApiVersion(), tenantId, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().odataNextLink(), - null)); - } - - /** - * Get the list of directory objects that are owned by the user. - * - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of directory objects that are owned by the user. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listOwnedObjectsAsync(String tenantId) { - return new PagedFlux<>( - () -> listOwnedObjectsSinglePageAsync(tenantId), - nextLink -> listOwnedObjectsNextSinglePageAsync(nextLink, tenantId)); - } - - /** - * Get the list of directory objects that are owned by the user. - * - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of directory objects that are owned by the user. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listOwnedObjectsAsync(String tenantId, Context context) { - return new PagedFlux<>( - () -> listOwnedObjectsSinglePageAsync(tenantId, context), - nextLink -> listOwnedObjectsNextSinglePageAsync(nextLink, tenantId, context)); - } - - /** - * Get the list of directory objects that are owned by the user. - * - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of directory objects that are owned by the user. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listOwnedObjects(String tenantId) { - return new PagedIterable<>(listOwnedObjectsAsync(tenantId)); - } - - /** - * Get the list of directory objects that are owned by the user. - * - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of directory objects that are owned by the user. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listOwnedObjects(String tenantId, Context context) { - return new PagedIterable<>(listOwnedObjectsAsync(tenantId, context)); - } - - /** - * Get the list of directory objects that are owned by the user. - * - * @param nextLink Next link for the list operation. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of directory objects that are owned by the user. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listOwnedObjectsNextSinglePageAsync( - String nextLink, String tenantId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .listOwnedObjectsNext( - this.client.getEndpoint(), - nextLink, - this.client.getApiVersion(), - tenantId, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().odataNextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the list of directory objects that are owned by the user. - * - * @param nextLink Next link for the list operation. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of directory objects that are owned by the user. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listOwnedObjectsNextSinglePageAsync( - String nextLink, String tenantId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .listOwnedObjectsNext( - this.client.getEndpoint(), nextLink, this.client.getApiVersion(), tenantId, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().odataNextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/UsersClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/UsersClientImpl.java deleted file mode 100644 index aa4e5dd47c21..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/UsersClientImpl.java +++ /dev/null @@ -1,1105 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.authorization.fluent.UsersClient; -import com.azure.resourcemanager.authorization.fluent.models.UserInner; -import com.azure.resourcemanager.authorization.models.GraphErrorException; -import com.azure.resourcemanager.authorization.models.UserCreateParameters; -import com.azure.resourcemanager.authorization.models.UserGetMemberGroupsParameters; -import com.azure.resourcemanager.authorization.models.UserGetMemberGroupsResult; -import com.azure.resourcemanager.authorization.models.UserListResult; -import com.azure.resourcemanager.authorization.models.UserUpdateParameters; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in UsersClient. */ -public final class UsersClientImpl implements InnerSupportsDelete, UsersClient { - private final ClientLogger logger = new ClientLogger(UsersClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final UsersService service; - - /** The service client containing this operation class. */ - private final GraphRbacManagementClientImpl client; - - /** - * Initializes an instance of UsersClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - UsersClientImpl(GraphRbacManagementClientImpl client) { - this.service = RestProxy.create(UsersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for GraphRbacManagementClientUsers to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "GraphRbacManagementC") - private interface UsersService { - @Headers({"Content-Type: application/json"}) - @Post("/{tenantID}/users") - @ExpectedResponses({201}) - @UnexpectedResponseExceptionType(GraphErrorException.class) - Mono> create( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("tenantID") String tenantId, - @BodyParam("application/json") UserCreateParameters parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/{tenantID}/users") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(GraphErrorException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("$filter") String filter, - @QueryParam("$expand") String expand, - @QueryParam("$top") Integer top, - @QueryParam("api-version") String apiVersion, - @PathParam("tenantID") String tenantId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/{tenantID}/users/{upnOrObjectId}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(GraphErrorException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("upnOrObjectId") String upnOrObjectId, - @QueryParam("api-version") String apiVersion, - @PathParam("tenantID") String tenantId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch("/{tenantID}/users/{upnOrObjectId}") - @ExpectedResponses({204}) - @UnexpectedResponseExceptionType(GraphErrorException.class) - Mono> update( - @HostParam("$host") String endpoint, - @PathParam("upnOrObjectId") String upnOrObjectId, - @QueryParam("api-version") String apiVersion, - @PathParam("tenantID") String tenantId, - @BodyParam("application/json") UserUpdateParameters parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete("/{tenantID}/users/{upnOrObjectId}") - @ExpectedResponses({204}) - @UnexpectedResponseExceptionType(GraphErrorException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @PathParam("upnOrObjectId") String upnOrObjectId, - @QueryParam("api-version") String apiVersion, - @PathParam("tenantID") String tenantId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post("/{tenantID}/users/{objectId}/getMemberGroups") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(GraphErrorException.class) - Mono> getMemberGroups( - @HostParam("$host") String endpoint, - @PathParam("objectId") String objectId, - @QueryParam("api-version") String apiVersion, - @PathParam("tenantID") String tenantId, - @BodyParam("application/json") UserGetMemberGroupsParameters parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/{tenantID}/{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(GraphErrorException.class) - Mono> listNext( - @HostParam("$host") String endpoint, - @PathParam(value = "nextLink", encoded = true) String nextLink, - @QueryParam("api-version") String apiVersion, - @PathParam("tenantID") String tenantId, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Create a new user. - * - * @param tenantId The tenant ID. - * @param parameters Parameters to create a user. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return active Directory user information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createWithResponseAsync(String tenantId, UserCreateParameters parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .create( - this.client.getEndpoint(), - this.client.getApiVersion(), - tenantId, - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create a new user. - * - * @param tenantId The tenant ID. - * @param parameters Parameters to create a user. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return active Directory user information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync( - String tenantId, UserCreateParameters parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .create(this.client.getEndpoint(), this.client.getApiVersion(), tenantId, parameters, accept, context); - } - - /** - * Create a new user. - * - * @param tenantId The tenant ID. - * @param parameters Parameters to create a user. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return active Directory user information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createAsync(String tenantId, UserCreateParameters parameters) { - return createWithResponseAsync(tenantId, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Create a new user. - * - * @param tenantId The tenant ID. - * @param parameters Parameters to create a user. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return active Directory user information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public UserInner create(String tenantId, UserCreateParameters parameters) { - return createAsync(tenantId, parameters).block(); - } - - /** - * Create a new user. - * - * @param tenantId The tenant ID. - * @param parameters Parameters to create a user. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return active Directory user information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse(String tenantId, UserCreateParameters parameters, Context context) { - return createWithResponseAsync(tenantId, parameters, context).block(); - } - - /** - * Gets list of users for the current tenant. - * - * @param tenantId The tenant ID. - * @param filter The filter to apply to the operation. - * @param expand The expand value for the operation result. - * @param top (Optional) Set the maximum number of results per response. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of users for the current tenant. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String tenantId, String filter, String expand, Integer top) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - filter, - expand, - top, - this.client.getApiVersion(), - tenantId, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().odataNextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets list of users for the current tenant. - * - * @param tenantId The tenant ID. - * @param filter The filter to apply to the operation. - * @param expand The expand value for the operation result. - * @param top (Optional) Set the maximum number of results per response. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of users for the current tenant. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String tenantId, String filter, String expand, Integer top, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), filter, expand, top, this.client.getApiVersion(), tenantId, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().odataNextLink(), - null)); - } - - /** - * Gets list of users for the current tenant. - * - * @param tenantId The tenant ID. - * @param filter The filter to apply to the operation. - * @param expand The expand value for the operation result. - * @param top (Optional) Set the maximum number of results per response. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of users for the current tenant. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String tenantId, String filter, String expand, Integer top) { - return new PagedFlux<>( - () -> listSinglePageAsync(tenantId, filter, expand, top), - nextLink -> listNextSinglePageAsync(nextLink, tenantId)); - } - - /** - * Gets list of users for the current tenant. - * - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of users for the current tenant. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String tenantId) { - final String filter = null; - final String expand = null; - final Integer top = null; - return new PagedFlux<>( - () -> listSinglePageAsync(tenantId, filter, expand, top), - nextLink -> listNextSinglePageAsync(nextLink, tenantId)); - } - - /** - * Gets list of users for the current tenant. - * - * @param tenantId The tenant ID. - * @param filter The filter to apply to the operation. - * @param expand The expand value for the operation result. - * @param top (Optional) Set the maximum number of results per response. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of users for the current tenant. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String tenantId, String filter, String expand, Integer top, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(tenantId, filter, expand, top, context), - nextLink -> listNextSinglePageAsync(nextLink, tenantId, context)); - } - - /** - * Gets list of users for the current tenant. - * - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of users for the current tenant. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String tenantId) { - final String filter = null; - final String expand = null; - final Integer top = null; - return new PagedIterable<>(listAsync(tenantId, filter, expand, top)); - } - - /** - * Gets list of users for the current tenant. - * - * @param tenantId The tenant ID. - * @param filter The filter to apply to the operation. - * @param expand The expand value for the operation result. - * @param top (Optional) Set the maximum number of results per response. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of users for the current tenant. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String tenantId, String filter, String expand, Integer top, Context context) { - return new PagedIterable<>(listAsync(tenantId, filter, expand, top, context)); - } - - /** - * Gets user information from the directory. - * - * @param upnOrObjectId The object ID or principal name of the user for which to get information. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user information from the directory. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync(String upnOrObjectId, String tenantId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (upnOrObjectId == null) { - return Mono.error(new IllegalArgumentException("Parameter upnOrObjectId is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - upnOrObjectId, - this.client.getApiVersion(), - tenantId, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets user information from the directory. - * - * @param upnOrObjectId The object ID or principal name of the user for which to get information. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user information from the directory. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String upnOrObjectId, String tenantId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (upnOrObjectId == null) { - return Mono.error(new IllegalArgumentException("Parameter upnOrObjectId is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .get(this.client.getEndpoint(), upnOrObjectId, this.client.getApiVersion(), tenantId, accept, context); - } - - /** - * Gets user information from the directory. - * - * @param upnOrObjectId The object ID or principal name of the user for which to get information. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user information from the directory. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync(String upnOrObjectId, String tenantId) { - return getWithResponseAsync(upnOrObjectId, tenantId) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets user information from the directory. - * - * @param upnOrObjectId The object ID or principal name of the user for which to get information. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user information from the directory. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public UserInner get(String upnOrObjectId, String tenantId) { - return getAsync(upnOrObjectId, tenantId).block(); - } - - /** - * Gets user information from the directory. - * - * @param upnOrObjectId The object ID or principal name of the user for which to get information. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user information from the directory. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String upnOrObjectId, String tenantId, Context context) { - return getWithResponseAsync(upnOrObjectId, tenantId, context).block(); - } - - /** - * Updates a user. - * - * @param upnOrObjectId The object ID or principal name of the user to update. - * @param tenantId The tenant ID. - * @param parameters Parameters to update an existing user. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateWithResponseAsync( - String upnOrObjectId, String tenantId, UserUpdateParameters parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (upnOrObjectId == null) { - return Mono.error(new IllegalArgumentException("Parameter upnOrObjectId is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - upnOrObjectId, - this.client.getApiVersion(), - tenantId, - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates a user. - * - * @param upnOrObjectId The object ID or principal name of the user to update. - * @param tenantId The tenant ID. - * @param parameters Parameters to update an existing user. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String upnOrObjectId, String tenantId, UserUpdateParameters parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (upnOrObjectId == null) { - return Mono.error(new IllegalArgumentException("Parameter upnOrObjectId is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - upnOrObjectId, - this.client.getApiVersion(), - tenantId, - parameters, - accept, - context); - } - - /** - * Updates a user. - * - * @param upnOrObjectId The object ID or principal name of the user to update. - * @param tenantId The tenant ID. - * @param parameters Parameters to update an existing user. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync(String upnOrObjectId, String tenantId, UserUpdateParameters parameters) { - return updateWithResponseAsync(upnOrObjectId, tenantId, parameters) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Updates a user. - * - * @param upnOrObjectId The object ID or principal name of the user to update. - * @param tenantId The tenant ID. - * @param parameters Parameters to update an existing user. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void update(String upnOrObjectId, String tenantId, UserUpdateParameters parameters) { - updateAsync(upnOrObjectId, tenantId, parameters).block(); - } - - /** - * Updates a user. - * - * @param upnOrObjectId The object ID or principal name of the user to update. - * @param tenantId The tenant ID. - * @param parameters Parameters to update an existing user. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String upnOrObjectId, String tenantId, UserUpdateParameters parameters, Context context) { - return updateWithResponseAsync(upnOrObjectId, tenantId, parameters, context).block(); - } - - /** - * Delete a user. - * - * @param upnOrObjectId The object ID or principal name of the user to delete. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String upnOrObjectId, String tenantId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (upnOrObjectId == null) { - return Mono.error(new IllegalArgumentException("Parameter upnOrObjectId is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - upnOrObjectId, - this.client.getApiVersion(), - tenantId, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete a user. - * - * @param upnOrObjectId The object ID or principal name of the user to delete. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String upnOrObjectId, String tenantId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (upnOrObjectId == null) { - return Mono.error(new IllegalArgumentException("Parameter upnOrObjectId is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .delete(this.client.getEndpoint(), upnOrObjectId, this.client.getApiVersion(), tenantId, accept, context); - } - - /** - * Delete a user. - * - * @param upnOrObjectId The object ID or principal name of the user to delete. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String upnOrObjectId, String tenantId) { - return deleteWithResponseAsync(upnOrObjectId, tenantId).flatMap((Response res) -> Mono.empty()); - } - - /** - * Delete a user. - * - * @param upnOrObjectId The object ID or principal name of the user to delete. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String upnOrObjectId, String tenantId) { - deleteAsync(upnOrObjectId, tenantId).block(); - } - - /** - * Delete a user. - * - * @param upnOrObjectId The object ID or principal name of the user to delete. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String upnOrObjectId, String tenantId, Context context) { - return deleteWithResponseAsync(upnOrObjectId, tenantId, context).block(); - } - - /** - * Gets a collection that contains the object IDs of the groups of which the user is a member. - * - * @param objectId The object ID of the user for which to get group membership. - * @param tenantId The tenant ID. - * @param parameters User filtering parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a collection that contains the object IDs of the groups of which the user is a member. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getMemberGroupsSinglePageAsync( - String objectId, String tenantId, UserGetMemberGroupsParameters parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (objectId == null) { - return Mono.error(new IllegalArgumentException("Parameter objectId is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .getMemberGroups( - this.client.getEndpoint(), - objectId, - this.client.getApiVersion(), - tenantId, - parameters, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a collection that contains the object IDs of the groups of which the user is a member. - * - * @param objectId The object ID of the user for which to get group membership. - * @param tenantId The tenant ID. - * @param parameters User filtering parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a collection that contains the object IDs of the groups of which the user is a member. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getMemberGroupsSinglePageAsync( - String objectId, String tenantId, UserGetMemberGroupsParameters parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (objectId == null) { - return Mono.error(new IllegalArgumentException("Parameter objectId is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .getMemberGroups( - this.client.getEndpoint(), objectId, this.client.getApiVersion(), tenantId, parameters, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); - } - - /** - * Gets a collection that contains the object IDs of the groups of which the user is a member. - * - * @param objectId The object ID of the user for which to get group membership. - * @param tenantId The tenant ID. - * @param parameters User filtering parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a collection that contains the object IDs of the groups of which the user is a member. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux getMemberGroupsAsync( - String objectId, String tenantId, UserGetMemberGroupsParameters parameters) { - return new PagedFlux<>(() -> getMemberGroupsSinglePageAsync(objectId, tenantId, parameters)); - } - - /** - * Gets a collection that contains the object IDs of the groups of which the user is a member. - * - * @param objectId The object ID of the user for which to get group membership. - * @param tenantId The tenant ID. - * @param parameters User filtering parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a collection that contains the object IDs of the groups of which the user is a member. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux getMemberGroupsAsync( - String objectId, String tenantId, UserGetMemberGroupsParameters parameters, Context context) { - return new PagedFlux<>(() -> getMemberGroupsSinglePageAsync(objectId, tenantId, parameters, context)); - } - - /** - * Gets a collection that contains the object IDs of the groups of which the user is a member. - * - * @param objectId The object ID of the user for which to get group membership. - * @param tenantId The tenant ID. - * @param parameters User filtering parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a collection that contains the object IDs of the groups of which the user is a member. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable getMemberGroups( - String objectId, String tenantId, UserGetMemberGroupsParameters parameters) { - return new PagedIterable<>(getMemberGroupsAsync(objectId, tenantId, parameters)); - } - - /** - * Gets a collection that contains the object IDs of the groups of which the user is a member. - * - * @param objectId The object ID of the user for which to get group membership. - * @param tenantId The tenant ID. - * @param parameters User filtering parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a collection that contains the object IDs of the groups of which the user is a member. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable getMemberGroups( - String objectId, String tenantId, UserGetMemberGroupsParameters parameters, Context context) { - return new PagedIterable<>(getMemberGroupsAsync(objectId, tenantId, parameters, context)); - } - - /** - * Gets a list of users for the current tenant. - * - * @param nextLink Next link for the list operation. - * @param tenantId The tenant ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of users for the current tenant. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, String tenantId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .listNext( - this.client.getEndpoint(), - nextLink, - this.client.getApiVersion(), - tenantId, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().odataNextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a list of users for the current tenant. - * - * @param nextLink Next link for the list operation. - * @param tenantId The tenant ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws GraphErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of users for the current tenant. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, String tenantId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (tenantId == null) { - return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .listNext(this.client.getEndpoint(), nextLink, this.client.getApiVersion(), tenantId, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().odataNextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ActiveDirectoryApplication.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ActiveDirectoryApplication.java deleted file mode 100644 index 8f62b31a9dfb..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ActiveDirectoryApplication.java +++ /dev/null @@ -1,237 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.authorization.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.authorization.fluent.models.ApplicationInner; -import com.azure.resourcemanager.resources.fluentcore.model.Appliable; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.model.Updatable; -import java.net.URL; -import java.util.List; -import java.util.Map; -import java.util.Set; - -/** An immutable client-side representation of an Azure AD application. */ -@Fluent -public interface ActiveDirectoryApplication - extends ActiveDirectoryObject, HasInnerModel, Updatable { - /** @return the application ID */ - String applicationId(); - - /** @return the application permissions */ - List applicationPermissions(); - - /** @return whether the application is be available to other tenants */ - boolean availableToOtherTenants(); - - /** @return a collection of URIs for the application */ - Set identifierUris(); - - /** @return a collection of reply URLs for the application */ - Set replyUrls(); - - /** @return the home page of the application */ - URL signOnUrl(); - - /** @return the mapping of password credentials from their names */ - Map passwordCredentials(); - - /** @return the mapping of certificate credentials from their names */ - Map certificateCredentials(); - - /************************************************************** - * Fluent interfaces to provision an application - **************************************************************/ - - /** Container interface for all the definitions that need to be implemented. */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithCreate { - } - - /** Grouping of all the application definition stages. */ - interface DefinitionStages { - /** The first stage of the application definition. */ - interface Blank extends WithSignOnUrl { - } - - /** The stage of application definition allowing specifying the sign on URL. */ - interface WithSignOnUrl { - /** - * Specifies the sign on URL. - * - * @param signOnUrl the URL where users can sign in and use this app - * @return the next stage in application definition - */ - WithCreate withSignOnUrl(String signOnUrl); - } - - /** The stage of application definition allowing specifying reply URLs. */ - interface WithReplyUrl { - /** - * Adds a reply URL to the application. - * - * @param replyUrl URIs to which Azure AD will redirect in response to an OAuth 2.0 request - * @return the next stage in application definition - */ - WithCreate withReplyUrl(String replyUrl); - } - - /** The stage of application definition allowing specifying identifier URLs. */ - interface WithIdentifierUrl { - /** - * Adds an identifier URL to the application. - * - * @param identifierUrl unique URI that Azure AD can use for this app - * @return the next stage in application definition - */ - WithCreate withIdentifierUrl(String identifierUrl); - } - - /** The stage of application definition allowing specifying identifier keys. */ - interface WithCredential { - /** - * Starts the definition of a certificate credential. - * - * @param name the descriptive name of the certificate credential - * @return the first stage in certificate credential definition - */ - CertificateCredential.DefinitionStages.Blank defineCertificateCredential(String name); - - /** - * Starts the definition of a password credential. - * - * @param name the descriptive name of the password credential - * @return the first stage in password credential definition - */ - PasswordCredential.DefinitionStages.Blank definePasswordCredential(String name); - } - - /** - * The stage of application definition allowing specifying if the application can be used in multiple tenants. - */ - interface WithMultiTenant { - /** - * Specifies if the application can be used in multiple tenants. - * - * @param availableToOtherTenants true if this application is available in other tenants - * @return the next stage in application definition - */ - WithCreate withAvailableToOtherTenants(boolean availableToOtherTenants); - } - - /** - * An application definition with sufficient inputs to create a new application in the cloud, but exposing - * additional optional inputs to specify. - */ - interface WithCreate - extends Creatable, - WithIdentifierUrl, - WithReplyUrl, - WithCredential, - WithMultiTenant { - } - } - - /** Grouping of all the application update stages. */ - interface UpdateStages { - /** The stage of application update allowing specifying the sign on URL. */ - interface WithSignOnUrl { - /** - * Specifies the sign on URL. - * - * @param signOnUrl the URL where users can sign in and use this app - * @return the next stage in application update - */ - Update withSignOnUrl(String signOnUrl); - } - - /** The stage of application update allowing specifying reply URLs. */ - interface WithReplyUrl { - /** - * Adds a reply URL to the application. - * - * @param replyUrl URIs to which Azure AD will redirect in response to an OAuth 2.0 request - * @return the next stage in application update - */ - Update withReplyUrl(String replyUrl); - - /** - * Removes a reply URL. - * - * @param replyUrl the reply URL to remove - * @return the next stage in application update - */ - Update withoutReplyUrl(String replyUrl); - } - - /** The stage of application update allowing specifying identifier URLs. */ - interface WithIdentifierUrl { - /** - * Adds an identifier URL to the application. - * - * @param identifierUrl unique URI that Azure AD can use for this app - * @return the next stage in application update - */ - Update withIdentifierUrl(String identifierUrl); - - /** - * Removes an identifier URL from the application. - * - * @param identifierUrl identifier URI to remove - * @return the next stage in application update - */ - Update withoutIdentifierUrl(String identifierUrl); - } - - /** The stage of application update allowing specifying identifier keys. */ - interface WithCredential { - /** - * Starts the definition of a certificate credential. - * - * @param name the descriptive name of the certificate credential - * @return the first stage in certificate credential definition - */ - CertificateCredential.UpdateDefinitionStages.Blank - defineCertificateCredential(String name); - - /** - * Starts the definition of a password credential. - * - * @param name the descriptive name of the password credential - * @return the first stage in password credential definition - */ - PasswordCredential.UpdateDefinitionStages.Blank definePasswordCredential(String name); - - /** - * Removes a key. - * - * @param name the name of the key - * @return the next stage of the application update - */ - Update withoutCredential(String name); - } - - /** The stage of application update allowing specifying if the application can be used in multiple tenants. */ - interface WithMultiTenant { - /** - * Specifies if the application can be used in multiple tenants. - * - * @param availableToOtherTenants true if this application is available in other tenants - * @return the next stage in application update - */ - Update withAvailableToOtherTenants(boolean availableToOtherTenants); - } - } - - /** The template for an application update operation, containing all the settings that can be modified. */ - interface Update - extends Appliable, - UpdateStages.WithSignOnUrl, - UpdateStages.WithIdentifierUrl, - UpdateStages.WithReplyUrl, - UpdateStages.WithCredential, - UpdateStages.WithMultiTenant { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ActiveDirectoryApplications.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ActiveDirectoryApplications.java deleted file mode 100644 index d0dceebb4be1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ActiveDirectoryApplications.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.authorization.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.authorization.AuthorizationManager; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingByName; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsBatchCreation; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsCreating; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingById; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListingByFilter; - -/** Entry point to application management API. */ -@Fluent -public interface ActiveDirectoryApplications - extends SupportsListing, - SupportsListingByFilter, - SupportsGettingById, - SupportsGettingByName, - SupportsCreating, - SupportsBatchCreation, - SupportsDeletingById, - HasManager { -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ActiveDirectoryGroup.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ActiveDirectoryGroup.java deleted file mode 100644 index 98b1f2a03532..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ActiveDirectoryGroup.java +++ /dev/null @@ -1,179 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.authorization.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.http.rest.PagedFlux; -import com.azure.resourcemanager.authorization.fluent.models.ADGroupInner; -import com.azure.resourcemanager.resources.fluentcore.model.Appliable; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.model.Updatable; - -import java.util.List; - -/** An immutable client-side representation of an Azure AD group. */ -@Fluent -public interface ActiveDirectoryGroup - extends ActiveDirectoryObject, HasInnerModel, Updatable { - /** @return security enabled field. */ - boolean securityEnabled(); - - /** @return mail field. */ - String mail(); - - /** - * Lists the members in the group. - * - * @return a list of the members - */ - List listMembers(); - - /** - * Lists the members in the group. - * - * @return a list of the members - */ - PagedFlux listMembersAsync(); - - /** Container interface for all the definitions that need to be implemented. */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithEmailAlias, DefinitionStages.WithCreate { - } - - /** Grouping of all the AD group definition stages. */ - interface DefinitionStages { - /** The first stage of the AD group definition. */ - interface Blank extends WithEmailAlias { - } - - /** An AD Group definition allowing mail nickname to be specified. */ - interface WithEmailAlias { - /** - * Adds an email alias. - * - * @param mailNickname the Active Directory object's email alias - * @return the next AD Group definition stage - */ - WithCreate withEmailAlias(String mailNickname); - } - - /** An AD Group definition allowing members to be added. */ - interface WithMember { - /** - * Add a member based on its object id. The member can be a user, a group, a service principal, or an - * application. - * - * @param objectId the Active Directory object's id - * @return the next AD Group definition stage - */ - WithCreate withMember(String objectId); - - /** - * Adds a user as a member in the group. - * - * @param user the Active Directory user to add - * @return the next AD group definition stage - */ - WithCreate withMember(ActiveDirectoryUser user); - - /** - * Adds a group as a member in the group. - * - * @param group the Active Directory group to add - * @return the next AD group definition stage - */ - WithCreate withMember(ActiveDirectoryGroup group); - - /** - * Adds a service principal as a member in the group. - * - * @param servicePrincipal the service principal to add - * @return the next AD group definition stage - */ - WithCreate withMember(ServicePrincipal servicePrincipal); - } - - /** - * An AD group definition with sufficient inputs to create a new group in the cloud, but exposing additional - * optional inputs to specify. - */ - interface WithCreate extends Creatable, WithMember { - } - } - - /** Grouping of all the AD group update stages. */ - interface UpdateStages { - /** An AD Group definition allowing members to be added or removed. */ - interface WithMember { - /** - * Adds a member based on its object id. The member can be a user, a group, a service principal, or an - * application. - * - * @param objectId the Active Directory object's id - * @return the next AD Group update stage - */ - Update withMember(String objectId); - - /** - * Adds a user as a member in the group. - * - * @param user the Active Directory user to add - * @return the next AD group update stage - */ - Update withMember(ActiveDirectoryUser user); - - /** - * Adds a group as a member in the group. - * - * @param group the Active Directory group to add - * @return the next AD group update stage - */ - Update withMember(ActiveDirectoryGroup group); - - /** - * Adds a service principal as a member in the group. - * - * @param servicePrincipal the service principal to add - * @return the next AD group update stage - */ - Update withMember(ServicePrincipal servicePrincipal); - - /** - * Removes a member based on its object id. - * - * @param objectId the Active Directory object's id - * @return the next AD Group update stage - */ - Update withoutMember(String objectId); - - /** - * Removes a user as a member in the group. - * - * @param user the Active Directory user to remove - * @return the next AD group update stage - */ - Update withoutMember(ActiveDirectoryUser user); - - /** - * Removes a group as a member in the group. - * - * @param group the Active Directory group to remove - * @return the next AD group update stage - */ - Update withoutMember(ActiveDirectoryGroup group); - - /** - * Removes a service principal as a member in the group. - * - * @param servicePrincipal the service principal to remove - * @return the next AD group update stage - */ - Update withoutMember(ServicePrincipal servicePrincipal); - } - } - - /** The template for a group update operation, containing all the settings that can be modified. */ - interface Update extends Appliable, UpdateStages.WithMember { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ActiveDirectoryGroups.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ActiveDirectoryGroups.java deleted file mode 100644 index 48e14ce5a8c6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ActiveDirectoryGroups.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.authorization.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.authorization.AuthorizationManager; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingByName; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsCreating; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingById; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListingByFilter; - -/** Entry point to AD group management API. */ -@Fluent -public interface ActiveDirectoryGroups - extends SupportsListing, - SupportsListingByFilter, - SupportsGettingById, - SupportsGettingByName, - SupportsCreating, - SupportsDeletingById, - HasManager { -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ActiveDirectoryObject.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ActiveDirectoryObject.java deleted file mode 100644 index 3cf145119432..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ActiveDirectoryObject.java +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.authorization.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.authorization.AuthorizationManager; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasId; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasName; -import com.azure.resourcemanager.resources.fluentcore.model.Indexable; - -/** An immutable client-side representation of an Azure AD object. */ -@Fluent -public interface ActiveDirectoryObject extends Indexable, HasId, HasName, HasManager { -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ActiveDirectoryUser.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ActiveDirectoryUser.java deleted file mode 100644 index c9b94819745e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ActiveDirectoryUser.java +++ /dev/null @@ -1,184 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.authorization.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.authorization.fluent.models.UserInner; -import com.azure.resourcemanager.resources.fluentcore.arm.CountryIsoCode; -import com.azure.resourcemanager.resources.fluentcore.model.Appliable; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.model.Updatable; - -/** An immutable client-side representation of an Azure AD user. */ -@Fluent -public interface ActiveDirectoryUser - extends ActiveDirectoryObject, HasInnerModel, Updatable { - /** @return user principal name */ - String userPrincipalName(); - - /** @return user signIn name */ - String signInName(); - - /** @return user mail */ - String mail(); - - /** @return the mail alias for the user */ - String mailNickname(); - - /** @return the usage location of the user */ - CountryIsoCode usageLocation(); - - /************************************************************** - * Fluent interfaces to provision a user - **************************************************************/ - - /** Container interface for all the definitions that need to be implemented. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithUserPrincipalName, - DefinitionStages.WithPassword, - DefinitionStages.WithCreate { - } - - /** Grouping of all the user definition stages. */ - interface DefinitionStages { - /** The first stage of the user definition. */ - interface Blank extends WithUserPrincipalName { - } - - /** A user definition allowing user principal name to be specified. */ - interface WithUserPrincipalName { - /** - * Specifies the user principal name of the user. It must contain one of the verified domains for the - * tenant. - * - * @param userPrincipalName the user principal name - * @return the next stage of user definition - */ - WithPassword withUserPrincipalName(String userPrincipalName); - - /** - * Specifies the email alias of the new user. - * - * @param emailAlias the email alias of the new user - * @return the next stage of user definition - */ - WithPassword withEmailAlias(String emailAlias); - } - - /** A user definition allowing password to be specified. */ - interface WithPassword { - /** - * Specifies the password of the user. - * - * @param password the password of the user - * @return the next stage of user definition - */ - WithCreate withPassword(String password); - } - - /** A user definition allowing setting whether the user should change password on the next login. */ - interface WithPromptToChangePasswordOnLogin { - /** - * Specifies whether the user should change password on the next login. - * - * @param promptToChangePasswordOnLogin true if the user should change password on next login. - * @return the next stage of user definition - */ - WithCreate withPromptToChangePasswordOnLogin(boolean promptToChangePasswordOnLogin); - } - - /** A user definition allowing specifying whether the account is enabled. */ - interface WithAccontEnabled { - /** - * Specifies whether the user account is enabled. - * - * @param accountEnabled true if account is enabled, false otherwise - * @return the next stage of user definition - */ - WithCreate withAccountEnabled(boolean accountEnabled); - } - - /** A user definition allowing usage location to be specified. */ - interface WithUsageLocation { - /** - * Specifies the usage location for the user. Required for users that will be assigned licenses due to legal - * requirement to check for availability of services in countries. - * - * @param usageLocation A two letter country code (ISO standard 3166). - * @return The next stage of user definition - */ - WithCreate withUsageLocation(CountryIsoCode usageLocation); - } - - /** - * An AD user definition with sufficient inputs to create a new user in the cloud, but exposing additional - * optional inputs to specify. - */ - interface WithCreate - extends Creatable, - DefinitionStages.WithAccontEnabled, - DefinitionStages.WithPromptToChangePasswordOnLogin, - DefinitionStages.WithUsageLocation { - } - } - - /** Group of all the user update stages. */ - interface UpdateStages { - /** A user update allowing password to be specified. */ - interface WithPassword { - /** - * Specifies the password of the user. - * - * @param password the password of the user - * @return the next stage of user update - */ - Update withPassword(String password); - } - - /** A user update allowing setting whether the user should change password on the next login. */ - interface WithPromptToChangePasswordOnLogin { - /** - * Specifies whether the user should change password on the next login. - * - * @param promptToChangePasswordOnLogin true if the user should change password on next login. - * @return the next stage of user update - */ - Update withPromptToChangePasswordOnLogin(boolean promptToChangePasswordOnLogin); - } - - /** A user update allowing specifying whether the account is enabled. */ - interface WithAccontEnabled { - /** - * Specifies whether the user account is enabled. - * - * @param accountEnabled true if account is enabled, false otherwise - * @return the next stage of user update - */ - Update withAccountEnabled(boolean accountEnabled); - } - - /** A user update allowing usage location to be specified. */ - interface WithUsageLocation { - /** - * Specifies the usage location for the user. Required for users that will be assigned licenses due to legal - * requirement to check for availability of services in countries. - * - * @param usageLocation A two letter country code (ISO standard 3166). - * @return The next stage of user update - */ - Update withUsageLocation(CountryIsoCode usageLocation); - } - } - - /** The template for a user update operation, containing all the settings that can be modified. */ - interface Update - extends Appliable, - UpdateStages.WithAccontEnabled, - UpdateStages.WithPassword, - UpdateStages.WithPromptToChangePasswordOnLogin, - UpdateStages.WithUsageLocation { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ActiveDirectoryUsers.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ActiveDirectoryUsers.java deleted file mode 100644 index c4116124b904..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ActiveDirectoryUsers.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.authorization.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.authorization.AuthorizationManager; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingByName; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsCreating; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingById; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListingByFilter; - -/** Entry point to AD user management API. */ -@Fluent -public interface ActiveDirectoryUsers - extends SupportsGettingById, - SupportsGettingByName, - SupportsListing, - SupportsListingByFilter, - SupportsCreating, - SupportsDeletingById, - HasManager { -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/AddOwnerParameters.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/AddOwnerParameters.java deleted file mode 100644 index 9b824371a35b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/AddOwnerParameters.java +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; -import java.util.Map; - -/** Request parameters for adding a owner to an application. */ -@Fluent -public final class AddOwnerParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AddOwnerParameters.class); - - /* - * A owner object URL, such as - * "https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects" - + "/f260bbc4-c254-447b-94cf-293b5ec434dd", - * where "0b1f9851-1bf0-433f-aec3-cb9272f093dc" is the tenantId and - * "f260bbc4-c254-447b-94cf-293b5ec434dd" is the objectId of the owner - * (user, application, servicePrincipal, group) to be added. - */ - @JsonProperty(value = "url", required = true) - private String url; - - /* - * Request parameters for adding a owner to an application. - */ - @JsonIgnore private Map additionalProperties; - - /** - * Get the url property: A owner object URL, such as - * "https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects" - + "/f260bbc4-c254-447b-94cf-293b5ec434dd", - * where "0b1f9851-1bf0-433f-aec3-cb9272f093dc" is the tenantId and "f260bbc4-c254-447b-94cf-293b5ec434dd" is the - * objectId of the owner (user, application, servicePrincipal, group) to be added. - * - * @return the url value. - */ - public String url() { - return this.url; - } - - /** - * Set the url property: A owner object URL, such as - * "https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects" - + "/f260bbc4-c254-447b-94cf-293b5ec434dd", - * where "0b1f9851-1bf0-433f-aec3-cb9272f093dc" is the tenantId and "f260bbc4-c254-447b-94cf-293b5ec434dd" is the - * objectId of the owner (user, application, servicePrincipal, group) to be added. - * - * @param url the url value to set. - * @return the AddOwnerParameters object itself. - */ - public AddOwnerParameters withUrl(String url) { - this.url = url; - return this; - } - - /** - * Get the additionalProperties property: Request parameters for adding a owner to an application. - * - * @return the additionalProperties value. - */ - @JsonAnyGetter - public Map additionalProperties() { - return this.additionalProperties; - } - - /** - * Set the additionalProperties property: Request parameters for adding a owner to an application. - * - * @param additionalProperties the additionalProperties value to set. - * @return the AddOwnerParameters object itself. - */ - public AddOwnerParameters withAdditionalProperties(Map additionalProperties) { - this.additionalProperties = additionalProperties; - return this; - } - - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (url() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property url in model AddOwnerParameters")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/AppRole.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/AppRole.java deleted file mode 100644 index 837fd098927a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/AppRole.java +++ /dev/null @@ -1,203 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The AppRole model. */ -@Fluent -public final class AppRole { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AppRole.class); - - /* - * Unique role identifier inside the appRoles collection. - */ - @JsonProperty(value = "id") - private String id; - - /* - * Specifies whether this app role definition can be assigned to users and - * groups by setting to 'User', or to other applications (that are - * accessing this application in daemon service scenarios) by setting to - * 'Application', or to both. - */ - @JsonProperty(value = "allowedMemberTypes") - private List allowedMemberTypes; - - /* - * Permission help text that appears in the admin app assignment and - * consent experiences. - */ - @JsonProperty(value = "description") - private String description; - - /* - * Display name for the permission that appears in the admin consent and - * app assignment experiences. - */ - @JsonProperty(value = "displayName") - private String displayName; - - /* - * When creating or updating a role definition, this must be set to true - * (which is the default). To delete a role, this must first be set to - * false. At that point, in a subsequent call, this role may be removed. - */ - @JsonProperty(value = "isEnabled") - private Boolean isEnabled; - - /* - * Specifies the value of the roles claim that the application should - * expect in the authentication and access tokens. - */ - @JsonProperty(value = "value") - private String value; - - /** - * Get the id property: Unique role identifier inside the appRoles collection. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: Unique role identifier inside the appRoles collection. - * - * @param id the id value to set. - * @return the AppRole object itself. - */ - public AppRole withId(String id) { - this.id = id; - return this; - } - - /** - * Get the allowedMemberTypes property: Specifies whether this app role definition can be assigned to users and - * groups by setting to 'User', or to other applications (that are accessing this application in daemon service - * scenarios) by setting to 'Application', or to both. - * - * @return the allowedMemberTypes value. - */ - public List allowedMemberTypes() { - return this.allowedMemberTypes; - } - - /** - * Set the allowedMemberTypes property: Specifies whether this app role definition can be assigned to users and - * groups by setting to 'User', or to other applications (that are accessing this application in daemon service - * scenarios) by setting to 'Application', or to both. - * - * @param allowedMemberTypes the allowedMemberTypes value to set. - * @return the AppRole object itself. - */ - public AppRole withAllowedMemberTypes(List allowedMemberTypes) { - this.allowedMemberTypes = allowedMemberTypes; - return this; - } - - /** - * Get the description property: Permission help text that appears in the admin app assignment and consent - * experiences. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: Permission help text that appears in the admin app assignment and consent - * experiences. - * - * @param description the description value to set. - * @return the AppRole object itself. - */ - public AppRole withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the displayName property: Display name for the permission that appears in the admin consent and app - * assignment experiences. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Set the displayName property: Display name for the permission that appears in the admin consent and app - * assignment experiences. - * - * @param displayName the displayName value to set. - * @return the AppRole object itself. - */ - public AppRole withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - - /** - * Get the isEnabled property: When creating or updating a role definition, this must be set to true (which is the - * default). To delete a role, this must first be set to false. At that point, in a subsequent call, this role may - * be removed. - * - * @return the isEnabled value. - */ - public Boolean isEnabled() { - return this.isEnabled; - } - - /** - * Set the isEnabled property: When creating or updating a role definition, this must be set to true (which is the - * default). To delete a role, this must first be set to false. At that point, in a subsequent call, this role may - * be removed. - * - * @param isEnabled the isEnabled value to set. - * @return the AppRole object itself. - */ - public AppRole withIsEnabled(Boolean isEnabled) { - this.isEnabled = isEnabled; - return this; - } - - /** - * Get the value property: Specifies the value of the roles claim that the application should expect in the - * authentication and access tokens. - * - * @return the value value. - */ - public String value() { - return this.value; - } - - /** - * Set the value property: Specifies the value of the roles claim that the application should expect in the - * authentication and access tokens. - * - * @param value the value value to set. - * @return the AppRole object itself. - */ - public AppRole withValue(String value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/AppRoleAssignmentListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/AppRoleAssignmentListResult.java deleted file mode 100644 index 9cedf2e9839b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/AppRoleAssignmentListResult.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.authorization.fluent.models.AppRoleAssignmentInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** AppRoleAssignment list operation result. */ -@Fluent -public final class AppRoleAssignmentListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AppRoleAssignmentListResult.class); - - /* - * A collection of AppRoleAssignment. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to get the next set of results. - */ - @JsonProperty(value = "odata.nextLink") - private String odataNextLink; - - /** - * Get the value property: A collection of AppRoleAssignment. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: A collection of AppRoleAssignment. - * - * @param value the value value to set. - * @return the AppRoleAssignmentListResult object itself. - */ - public AppRoleAssignmentListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the odataNextLink property: The URL to get the next set of results. - * - * @return the odataNextLink value. - */ - public String odataNextLink() { - return this.odataNextLink; - } - - /** - * Set the odataNextLink property: The URL to get the next set of results. - * - * @param odataNextLink the odataNextLink value to set. - * @return the AppRoleAssignmentListResult object itself. - */ - public AppRoleAssignmentListResult withOdataNextLink(String odataNextLink) { - this.odataNextLink = odataNextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ApplicationBase.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ApplicationBase.java deleted file mode 100644 index 9108e3ef8a13..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ApplicationBase.java +++ /dev/null @@ -1,859 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.authorization.fluent.models.KeyCredentialInner; -import com.azure.resourcemanager.authorization.fluent.models.PasswordCredentialInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Active Directive Application common properties shared among GET, POST and PATCH. */ -@Fluent -public class ApplicationBase { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationBase.class); - - /* - * A property on the application to indicate if the application accepts - * other IDPs or not or partially accepts. - */ - @JsonProperty(value = "allowGuestsSignIn") - private Boolean allowGuestsSignIn; - - /* - * Indicates that the application supports pass through users who have no - * presence in the resource tenant. - */ - @JsonProperty(value = "allowPassthroughUsers") - private Boolean allowPassthroughUsers; - - /* - * The url for the application logo image stored in a CDN. - */ - @JsonProperty(value = "appLogoUrl") - private String appLogoUrl; - - /* - * The collection of application roles that an application may declare. - * These roles can be assigned to users, groups or service principals. - */ - @JsonProperty(value = "appRoles") - private List appRoles; - - /* - * The application permissions. - */ - @JsonProperty(value = "appPermissions") - private List appPermissions; - - /* - * Whether the application is available to other tenants. - */ - @JsonProperty(value = "availableToOtherTenants") - private Boolean availableToOtherTenants; - - /* - * A URL provided by the author of the application to report errors when - * using the application. - */ - @JsonProperty(value = "errorUrl") - private String errorUrl; - - /* - * Configures the groups claim issued in a user or OAuth 2.0 access token - * that the app expects. - */ - @JsonProperty(value = "groupMembershipClaims") - private GroupMembershipClaimTypes groupMembershipClaims; - - /* - * The home page of the application. - */ - @JsonProperty(value = "homepage") - private String homepage; - - /* - * URLs with more information about the application. - */ - @JsonProperty(value = "informationalUrls") - private InformationalUrl informationalUrls; - - /* - * Specifies whether this application supports device authentication - * without a user. The default is false. - */ - @JsonProperty(value = "isDeviceOnlyAuthSupported") - private Boolean isDeviceOnlyAuthSupported; - - /* - * A collection of KeyCredential objects. - */ - @JsonProperty(value = "keyCredentials") - private List keyCredentials; - - /* - * Client applications that are tied to this resource application. Consent - * to any of the known client applications will result in implicit consent - * to the resource application through a combined consent dialog (showing - * the OAuth permission scopes required by the client and the resource). - */ - @JsonProperty(value = "knownClientApplications") - private List knownClientApplications; - - /* - * the url of the logout page - */ - @JsonProperty(value = "logoutUrl") - private String logoutUrl; - - /* - * Whether to allow implicit grant flow for OAuth2 - */ - @JsonProperty(value = "oauth2AllowImplicitFlow") - private Boolean oauth2AllowImplicitFlow; - - /* - * Specifies whether during a token Request Azure AD will allow path - * matching of the redirect URI against the applications collection of - * replyURLs. The default is false. - */ - @JsonProperty(value = "oauth2AllowUrlPathMatching") - private Boolean oauth2AllowUrlPathMatching; - - /* - * The collection of OAuth 2.0 permission scopes that the web API - * (resource) application exposes to client applications. These permission - * scopes may be granted to client applications during consent. - */ - @JsonProperty(value = "oauth2Permissions") - private List oauth2Permissions; - - /* - * Specifies whether, as part of OAuth 2.0 token requests, Azure AD will - * allow POST requests, as opposed to GET requests. The default is false, - * which specifies that only GET requests will be allowed. - */ - @JsonProperty(value = "oauth2RequirePostResponse") - private Boolean oauth2RequirePostResponse; - - /* - * A list of tenants allowed to access application. - */ - @JsonProperty(value = "orgRestrictions") - private List orgRestrictions; - - /* - * Specifying the claims to be included in the token. - */ - @JsonProperty(value = "optionalClaims") - private OptionalClaims optionalClaims; - - /* - * A collection of PasswordCredential objects - */ - @JsonProperty(value = "passwordCredentials") - private List passwordCredentials; - - /* - * list of pre-authorized applications. - */ - @JsonProperty(value = "preAuthorizedApplications") - private List preAuthorizedApplications; - - /* - * Specifies whether this application is a public client (such as an - * installed application running on a mobile device). Default is false. - */ - @JsonProperty(value = "publicClient") - private Boolean publicClient; - - /* - * Reliable domain which can be used to identify an application. - */ - @JsonProperty(value = "publisherDomain") - private String publisherDomain; - - /* - * A collection of reply URLs for the application. - */ - @JsonProperty(value = "replyUrls") - private List replyUrls; - - /* - * Specifies resources that this application requires access to and the set - * of OAuth permission scopes and application roles that it needs under - * each of those resources. This pre-configuration of required resource - * access drives the consent experience. - */ - @JsonProperty(value = "requiredResourceAccess") - private List requiredResourceAccess; - - /* - * The URL to the SAML metadata for the application. - */ - @JsonProperty(value = "samlMetadataUrl") - private String samlMetadataUrl; - - /* - * Audience for signing in to the application (AzureADMyOrganization, - * AzureADAllOrganizations, AzureADAndMicrosoftAccounts). - */ - @JsonProperty(value = "signInAudience") - private String signInAudience; - - /* - * The primary Web page. - */ - @JsonProperty(value = "wwwHomepage") - private String wwwHomepage; - - /** - * Get the allowGuestsSignIn property: A property on the application to indicate if the application accepts other - * IDPs or not or partially accepts. - * - * @return the allowGuestsSignIn value. - */ - public Boolean allowGuestsSignIn() { - return this.allowGuestsSignIn; - } - - /** - * Set the allowGuestsSignIn property: A property on the application to indicate if the application accepts other - * IDPs or not or partially accepts. - * - * @param allowGuestsSignIn the allowGuestsSignIn value to set. - * @return the ApplicationBase object itself. - */ - public ApplicationBase withAllowGuestsSignIn(Boolean allowGuestsSignIn) { - this.allowGuestsSignIn = allowGuestsSignIn; - return this; - } - - /** - * Get the allowPassthroughUsers property: Indicates that the application supports pass through users who have no - * presence in the resource tenant. - * - * @return the allowPassthroughUsers value. - */ - public Boolean allowPassthroughUsers() { - return this.allowPassthroughUsers; - } - - /** - * Set the allowPassthroughUsers property: Indicates that the application supports pass through users who have no - * presence in the resource tenant. - * - * @param allowPassthroughUsers the allowPassthroughUsers value to set. - * @return the ApplicationBase object itself. - */ - public ApplicationBase withAllowPassthroughUsers(Boolean allowPassthroughUsers) { - this.allowPassthroughUsers = allowPassthroughUsers; - return this; - } - - /** - * Get the appLogoUrl property: The url for the application logo image stored in a CDN. - * - * @return the appLogoUrl value. - */ - public String appLogoUrl() { - return this.appLogoUrl; - } - - /** - * Set the appLogoUrl property: The url for the application logo image stored in a CDN. - * - * @param appLogoUrl the appLogoUrl value to set. - * @return the ApplicationBase object itself. - */ - public ApplicationBase withAppLogoUrl(String appLogoUrl) { - this.appLogoUrl = appLogoUrl; - return this; - } - - /** - * Get the appRoles property: The collection of application roles that an application may declare. These roles can - * be assigned to users, groups or service principals. - * - * @return the appRoles value. - */ - public List appRoles() { - return this.appRoles; - } - - /** - * Set the appRoles property: The collection of application roles that an application may declare. These roles can - * be assigned to users, groups or service principals. - * - * @param appRoles the appRoles value to set. - * @return the ApplicationBase object itself. - */ - public ApplicationBase withAppRoles(List appRoles) { - this.appRoles = appRoles; - return this; - } - - /** - * Get the appPermissions property: The application permissions. - * - * @return the appPermissions value. - */ - public List appPermissions() { - return this.appPermissions; - } - - /** - * Set the appPermissions property: The application permissions. - * - * @param appPermissions the appPermissions value to set. - * @return the ApplicationBase object itself. - */ - public ApplicationBase withAppPermissions(List appPermissions) { - this.appPermissions = appPermissions; - return this; - } - - /** - * Get the availableToOtherTenants property: Whether the application is available to other tenants. - * - * @return the availableToOtherTenants value. - */ - public Boolean availableToOtherTenants() { - return this.availableToOtherTenants; - } - - /** - * Set the availableToOtherTenants property: Whether the application is available to other tenants. - * - * @param availableToOtherTenants the availableToOtherTenants value to set. - * @return the ApplicationBase object itself. - */ - public ApplicationBase withAvailableToOtherTenants(Boolean availableToOtherTenants) { - this.availableToOtherTenants = availableToOtherTenants; - return this; - } - - /** - * Get the errorUrl property: A URL provided by the author of the application to report errors when using the - * application. - * - * @return the errorUrl value. - */ - public String errorUrl() { - return this.errorUrl; - } - - /** - * Set the errorUrl property: A URL provided by the author of the application to report errors when using the - * application. - * - * @param errorUrl the errorUrl value to set. - * @return the ApplicationBase object itself. - */ - public ApplicationBase withErrorUrl(String errorUrl) { - this.errorUrl = errorUrl; - return this; - } - - /** - * Get the groupMembershipClaims property: Configures the groups claim issued in a user or OAuth 2.0 access token - * that the app expects. - * - * @return the groupMembershipClaims value. - */ - public GroupMembershipClaimTypes groupMembershipClaims() { - return this.groupMembershipClaims; - } - - /** - * Set the groupMembershipClaims property: Configures the groups claim issued in a user or OAuth 2.0 access token - * that the app expects. - * - * @param groupMembershipClaims the groupMembershipClaims value to set. - * @return the ApplicationBase object itself. - */ - public ApplicationBase withGroupMembershipClaims(GroupMembershipClaimTypes groupMembershipClaims) { - this.groupMembershipClaims = groupMembershipClaims; - return this; - } - - /** - * Get the homepage property: The home page of the application. - * - * @return the homepage value. - */ - public String homepage() { - return this.homepage; - } - - /** - * Set the homepage property: The home page of the application. - * - * @param homepage the homepage value to set. - * @return the ApplicationBase object itself. - */ - public ApplicationBase withHomepage(String homepage) { - this.homepage = homepage; - return this; - } - - /** - * Get the informationalUrls property: URLs with more information about the application. - * - * @return the informationalUrls value. - */ - public InformationalUrl informationalUrls() { - return this.informationalUrls; - } - - /** - * Set the informationalUrls property: URLs with more information about the application. - * - * @param informationalUrls the informationalUrls value to set. - * @return the ApplicationBase object itself. - */ - public ApplicationBase withInformationalUrls(InformationalUrl informationalUrls) { - this.informationalUrls = informationalUrls; - return this; - } - - /** - * Get the isDeviceOnlyAuthSupported property: Specifies whether this application supports device authentication - * without a user. The default is false. - * - * @return the isDeviceOnlyAuthSupported value. - */ - public Boolean isDeviceOnlyAuthSupported() { - return this.isDeviceOnlyAuthSupported; - } - - /** - * Set the isDeviceOnlyAuthSupported property: Specifies whether this application supports device authentication - * without a user. The default is false. - * - * @param isDeviceOnlyAuthSupported the isDeviceOnlyAuthSupported value to set. - * @return the ApplicationBase object itself. - */ - public ApplicationBase withIsDeviceOnlyAuthSupported(Boolean isDeviceOnlyAuthSupported) { - this.isDeviceOnlyAuthSupported = isDeviceOnlyAuthSupported; - return this; - } - - /** - * Get the keyCredentials property: A collection of KeyCredential objects. - * - * @return the keyCredentials value. - */ - public List keyCredentials() { - return this.keyCredentials; - } - - /** - * Set the keyCredentials property: A collection of KeyCredential objects. - * - * @param keyCredentials the keyCredentials value to set. - * @return the ApplicationBase object itself. - */ - public ApplicationBase withKeyCredentials(List keyCredentials) { - this.keyCredentials = keyCredentials; - return this; - } - - /** - * Get the knownClientApplications property: Client applications that are tied to this resource application. Consent - * to any of the known client applications will result in implicit consent to the resource application through a - * combined consent dialog (showing the OAuth permission scopes required by the client and the resource). - * - * @return the knownClientApplications value. - */ - public List knownClientApplications() { - return this.knownClientApplications; - } - - /** - * Set the knownClientApplications property: Client applications that are tied to this resource application. Consent - * to any of the known client applications will result in implicit consent to the resource application through a - * combined consent dialog (showing the OAuth permission scopes required by the client and the resource). - * - * @param knownClientApplications the knownClientApplications value to set. - * @return the ApplicationBase object itself. - */ - public ApplicationBase withKnownClientApplications(List knownClientApplications) { - this.knownClientApplications = knownClientApplications; - return this; - } - - /** - * Get the logoutUrl property: the url of the logout page. - * - * @return the logoutUrl value. - */ - public String logoutUrl() { - return this.logoutUrl; - } - - /** - * Set the logoutUrl property: the url of the logout page. - * - * @param logoutUrl the logoutUrl value to set. - * @return the ApplicationBase object itself. - */ - public ApplicationBase withLogoutUrl(String logoutUrl) { - this.logoutUrl = logoutUrl; - return this; - } - - /** - * Get the oauth2AllowImplicitFlow property: Whether to allow implicit grant flow for OAuth2. - * - * @return the oauth2AllowImplicitFlow value. - */ - public Boolean oauth2AllowImplicitFlow() { - return this.oauth2AllowImplicitFlow; - } - - /** - * Set the oauth2AllowImplicitFlow property: Whether to allow implicit grant flow for OAuth2. - * - * @param oauth2AllowImplicitFlow the oauth2AllowImplicitFlow value to set. - * @return the ApplicationBase object itself. - */ - public ApplicationBase withOauth2AllowImplicitFlow(Boolean oauth2AllowImplicitFlow) { - this.oauth2AllowImplicitFlow = oauth2AllowImplicitFlow; - return this; - } - - /** - * Get the oauth2AllowUrlPathMatching property: Specifies whether during a token Request Azure AD will allow path - * matching of the redirect URI against the applications collection of replyURLs. The default is false. - * - * @return the oauth2AllowUrlPathMatching value. - */ - public Boolean oauth2AllowUrlPathMatching() { - return this.oauth2AllowUrlPathMatching; - } - - /** - * Set the oauth2AllowUrlPathMatching property: Specifies whether during a token Request Azure AD will allow path - * matching of the redirect URI against the applications collection of replyURLs. The default is false. - * - * @param oauth2AllowUrlPathMatching the oauth2AllowUrlPathMatching value to set. - * @return the ApplicationBase object itself. - */ - public ApplicationBase withOauth2AllowUrlPathMatching(Boolean oauth2AllowUrlPathMatching) { - this.oauth2AllowUrlPathMatching = oauth2AllowUrlPathMatching; - return this; - } - - /** - * Get the oauth2Permissions property: The collection of OAuth 2.0 permission scopes that the web API (resource) - * application exposes to client applications. These permission scopes may be granted to client applications during - * consent. - * - * @return the oauth2Permissions value. - */ - public List oauth2Permissions() { - return this.oauth2Permissions; - } - - /** - * Set the oauth2Permissions property: The collection of OAuth 2.0 permission scopes that the web API (resource) - * application exposes to client applications. These permission scopes may be granted to client applications during - * consent. - * - * @param oauth2Permissions the oauth2Permissions value to set. - * @return the ApplicationBase object itself. - */ - public ApplicationBase withOauth2Permissions(List oauth2Permissions) { - this.oauth2Permissions = oauth2Permissions; - return this; - } - - /** - * Get the oauth2RequirePostResponse property: Specifies whether, as part of OAuth 2.0 token requests, Azure AD will - * allow POST requests, as opposed to GET requests. The default is false, which specifies that only GET requests - * will be allowed. - * - * @return the oauth2RequirePostResponse value. - */ - public Boolean oauth2RequirePostResponse() { - return this.oauth2RequirePostResponse; - } - - /** - * Set the oauth2RequirePostResponse property: Specifies whether, as part of OAuth 2.0 token requests, Azure AD will - * allow POST requests, as opposed to GET requests. The default is false, which specifies that only GET requests - * will be allowed. - * - * @param oauth2RequirePostResponse the oauth2RequirePostResponse value to set. - * @return the ApplicationBase object itself. - */ - public ApplicationBase withOauth2RequirePostResponse(Boolean oauth2RequirePostResponse) { - this.oauth2RequirePostResponse = oauth2RequirePostResponse; - return this; - } - - /** - * Get the orgRestrictions property: A list of tenants allowed to access application. - * - * @return the orgRestrictions value. - */ - public List orgRestrictions() { - return this.orgRestrictions; - } - - /** - * Set the orgRestrictions property: A list of tenants allowed to access application. - * - * @param orgRestrictions the orgRestrictions value to set. - * @return the ApplicationBase object itself. - */ - public ApplicationBase withOrgRestrictions(List orgRestrictions) { - this.orgRestrictions = orgRestrictions; - return this; - } - - /** - * Get the optionalClaims property: Specifying the claims to be included in the token. - * - * @return the optionalClaims value. - */ - public OptionalClaims optionalClaims() { - return this.optionalClaims; - } - - /** - * Set the optionalClaims property: Specifying the claims to be included in the token. - * - * @param optionalClaims the optionalClaims value to set. - * @return the ApplicationBase object itself. - */ - public ApplicationBase withOptionalClaims(OptionalClaims optionalClaims) { - this.optionalClaims = optionalClaims; - return this; - } - - /** - * Get the passwordCredentials property: A collection of PasswordCredential objects. - * - * @return the passwordCredentials value. - */ - public List passwordCredentials() { - return this.passwordCredentials; - } - - /** - * Set the passwordCredentials property: A collection of PasswordCredential objects. - * - * @param passwordCredentials the passwordCredentials value to set. - * @return the ApplicationBase object itself. - */ - public ApplicationBase withPasswordCredentials(List passwordCredentials) { - this.passwordCredentials = passwordCredentials; - return this; - } - - /** - * Get the preAuthorizedApplications property: list of pre-authorized applications. - * - * @return the preAuthorizedApplications value. - */ - public List preAuthorizedApplications() { - return this.preAuthorizedApplications; - } - - /** - * Set the preAuthorizedApplications property: list of pre-authorized applications. - * - * @param preAuthorizedApplications the preAuthorizedApplications value to set. - * @return the ApplicationBase object itself. - */ - public ApplicationBase withPreAuthorizedApplications(List preAuthorizedApplications) { - this.preAuthorizedApplications = preAuthorizedApplications; - return this; - } - - /** - * Get the publicClient property: Specifies whether this application is a public client (such as an installed - * application running on a mobile device). Default is false. - * - * @return the publicClient value. - */ - public Boolean publicClient() { - return this.publicClient; - } - - /** - * Set the publicClient property: Specifies whether this application is a public client (such as an installed - * application running on a mobile device). Default is false. - * - * @param publicClient the publicClient value to set. - * @return the ApplicationBase object itself. - */ - public ApplicationBase withPublicClient(Boolean publicClient) { - this.publicClient = publicClient; - return this; - } - - /** - * Get the publisherDomain property: Reliable domain which can be used to identify an application. - * - * @return the publisherDomain value. - */ - public String publisherDomain() { - return this.publisherDomain; - } - - /** - * Set the publisherDomain property: Reliable domain which can be used to identify an application. - * - * @param publisherDomain the publisherDomain value to set. - * @return the ApplicationBase object itself. - */ - public ApplicationBase withPublisherDomain(String publisherDomain) { - this.publisherDomain = publisherDomain; - return this; - } - - /** - * Get the replyUrls property: A collection of reply URLs for the application. - * - * @return the replyUrls value. - */ - public List replyUrls() { - return this.replyUrls; - } - - /** - * Set the replyUrls property: A collection of reply URLs for the application. - * - * @param replyUrls the replyUrls value to set. - * @return the ApplicationBase object itself. - */ - public ApplicationBase withReplyUrls(List replyUrls) { - this.replyUrls = replyUrls; - return this; - } - - /** - * Get the requiredResourceAccess property: Specifies resources that this application requires access to and the set - * of OAuth permission scopes and application roles that it needs under each of those resources. This - * pre-configuration of required resource access drives the consent experience. - * - * @return the requiredResourceAccess value. - */ - public List requiredResourceAccess() { - return this.requiredResourceAccess; - } - - /** - * Set the requiredResourceAccess property: Specifies resources that this application requires access to and the set - * of OAuth permission scopes and application roles that it needs under each of those resources. This - * pre-configuration of required resource access drives the consent experience. - * - * @param requiredResourceAccess the requiredResourceAccess value to set. - * @return the ApplicationBase object itself. - */ - public ApplicationBase withRequiredResourceAccess(List requiredResourceAccess) { - this.requiredResourceAccess = requiredResourceAccess; - return this; - } - - /** - * Get the samlMetadataUrl property: The URL to the SAML metadata for the application. - * - * @return the samlMetadataUrl value. - */ - public String samlMetadataUrl() { - return this.samlMetadataUrl; - } - - /** - * Set the samlMetadataUrl property: The URL to the SAML metadata for the application. - * - * @param samlMetadataUrl the samlMetadataUrl value to set. - * @return the ApplicationBase object itself. - */ - public ApplicationBase withSamlMetadataUrl(String samlMetadataUrl) { - this.samlMetadataUrl = samlMetadataUrl; - return this; - } - - /** - * Get the signInAudience property: Audience for signing in to the application (AzureADMyOrganization, - * AzureADAllOrganizations, AzureADAndMicrosoftAccounts). - * - * @return the signInAudience value. - */ - public String signInAudience() { - return this.signInAudience; - } - - /** - * Set the signInAudience property: Audience for signing in to the application (AzureADMyOrganization, - * AzureADAllOrganizations, AzureADAndMicrosoftAccounts). - * - * @param signInAudience the signInAudience value to set. - * @return the ApplicationBase object itself. - */ - public ApplicationBase withSignInAudience(String signInAudience) { - this.signInAudience = signInAudience; - return this; - } - - /** - * Get the wwwHomepage property: The primary Web page. - * - * @return the wwwHomepage value. - */ - public String wwwHomepage() { - return this.wwwHomepage; - } - - /** - * Set the wwwHomepage property: The primary Web page. - * - * @param wwwHomepage the wwwHomepage value to set. - * @return the ApplicationBase object itself. - */ - public ApplicationBase withWwwHomepage(String wwwHomepage) { - this.wwwHomepage = wwwHomepage; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (appRoles() != null) { - appRoles().forEach(e -> e.validate()); - } - if (informationalUrls() != null) { - informationalUrls().validate(); - } - if (keyCredentials() != null) { - keyCredentials().forEach(e -> e.validate()); - } - if (oauth2Permissions() != null) { - oauth2Permissions().forEach(e -> e.validate()); - } - if (optionalClaims() != null) { - optionalClaims().validate(); - } - if (passwordCredentials() != null) { - passwordCredentials().forEach(e -> e.validate()); - } - if (preAuthorizedApplications() != null) { - preAuthorizedApplications().forEach(e -> e.validate()); - } - if (requiredResourceAccess() != null) { - requiredResourceAccess().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ApplicationCreateParameters.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ApplicationCreateParameters.java deleted file mode 100644 index da0036dec074..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ApplicationCreateParameters.java +++ /dev/null @@ -1,291 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.authorization.fluent.models.KeyCredentialInner; -import com.azure.resourcemanager.authorization.fluent.models.PasswordCredentialInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Request parameters for creating a new application. */ -@Fluent -public final class ApplicationCreateParameters extends ApplicationBase { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationCreateParameters.class); - - /* - * The display name of the application. - */ - @JsonProperty(value = "displayName", required = true) - private String displayName; - - /* - * A collection of URIs for the application. - */ - @JsonProperty(value = "identifierUris") - private List identifierUris; - - /** - * Get the displayName property: The display name of the application. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Set the displayName property: The display name of the application. - * - * @param displayName the displayName value to set. - * @return the ApplicationCreateParameters object itself. - */ - public ApplicationCreateParameters withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - - /** - * Get the identifierUris property: A collection of URIs for the application. - * - * @return the identifierUris value. - */ - public List identifierUris() { - return this.identifierUris; - } - - /** - * Set the identifierUris property: A collection of URIs for the application. - * - * @param identifierUris the identifierUris value to set. - * @return the ApplicationCreateParameters object itself. - */ - public ApplicationCreateParameters withIdentifierUris(List identifierUris) { - this.identifierUris = identifierUris; - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicationCreateParameters withAllowGuestsSignIn(Boolean allowGuestsSignIn) { - super.withAllowGuestsSignIn(allowGuestsSignIn); - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicationCreateParameters withAllowPassthroughUsers(Boolean allowPassthroughUsers) { - super.withAllowPassthroughUsers(allowPassthroughUsers); - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicationCreateParameters withAppLogoUrl(String appLogoUrl) { - super.withAppLogoUrl(appLogoUrl); - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicationCreateParameters withAppRoles(List appRoles) { - super.withAppRoles(appRoles); - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicationCreateParameters withAppPermissions(List appPermissions) { - super.withAppPermissions(appPermissions); - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicationCreateParameters withAvailableToOtherTenants(Boolean availableToOtherTenants) { - super.withAvailableToOtherTenants(availableToOtherTenants); - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicationCreateParameters withErrorUrl(String errorUrl) { - super.withErrorUrl(errorUrl); - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicationCreateParameters withGroupMembershipClaims(GroupMembershipClaimTypes groupMembershipClaims) { - super.withGroupMembershipClaims(groupMembershipClaims); - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicationCreateParameters withHomepage(String homepage) { - super.withHomepage(homepage); - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicationCreateParameters withInformationalUrls(InformationalUrl informationalUrls) { - super.withInformationalUrls(informationalUrls); - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicationCreateParameters withIsDeviceOnlyAuthSupported(Boolean isDeviceOnlyAuthSupported) { - super.withIsDeviceOnlyAuthSupported(isDeviceOnlyAuthSupported); - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicationCreateParameters withKeyCredentials(List keyCredentials) { - super.withKeyCredentials(keyCredentials); - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicationCreateParameters withKnownClientApplications(List knownClientApplications) { - super.withKnownClientApplications(knownClientApplications); - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicationCreateParameters withLogoutUrl(String logoutUrl) { - super.withLogoutUrl(logoutUrl); - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicationCreateParameters withOauth2AllowImplicitFlow(Boolean oauth2AllowImplicitFlow) { - super.withOauth2AllowImplicitFlow(oauth2AllowImplicitFlow); - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicationCreateParameters withOauth2AllowUrlPathMatching(Boolean oauth2AllowUrlPathMatching) { - super.withOauth2AllowUrlPathMatching(oauth2AllowUrlPathMatching); - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicationCreateParameters withOauth2Permissions(List oauth2Permissions) { - super.withOauth2Permissions(oauth2Permissions); - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicationCreateParameters withOauth2RequirePostResponse(Boolean oauth2RequirePostResponse) { - super.withOauth2RequirePostResponse(oauth2RequirePostResponse); - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicationCreateParameters withOrgRestrictions(List orgRestrictions) { - super.withOrgRestrictions(orgRestrictions); - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicationCreateParameters withOptionalClaims(OptionalClaims optionalClaims) { - super.withOptionalClaims(optionalClaims); - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicationCreateParameters withPasswordCredentials(List passwordCredentials) { - super.withPasswordCredentials(passwordCredentials); - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicationCreateParameters withPreAuthorizedApplications( - List preAuthorizedApplications) { - super.withPreAuthorizedApplications(preAuthorizedApplications); - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicationCreateParameters withPublicClient(Boolean publicClient) { - super.withPublicClient(publicClient); - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicationCreateParameters withPublisherDomain(String publisherDomain) { - super.withPublisherDomain(publisherDomain); - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicationCreateParameters withReplyUrls(List replyUrls) { - super.withReplyUrls(replyUrls); - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicationCreateParameters withRequiredResourceAccess(List requiredResourceAccess) { - super.withRequiredResourceAccess(requiredResourceAccess); - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicationCreateParameters withSamlMetadataUrl(String samlMetadataUrl) { - super.withSamlMetadataUrl(samlMetadataUrl); - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicationCreateParameters withSignInAudience(String signInAudience) { - super.withSignInAudience(signInAudience); - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicationCreateParameters withWwwHomepage(String wwwHomepage) { - super.withWwwHomepage(wwwHomepage); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (displayName() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property displayName in model ApplicationCreateParameters")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ApplicationListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ApplicationListResult.java deleted file mode 100644 index 0daa8724dfde..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ApplicationListResult.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.authorization.fluent.models.ApplicationInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Application list operation result. */ -@Fluent -public final class ApplicationListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationListResult.class); - - /* - * A collection of applications. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to get the next set of results. - */ - @JsonProperty(value = "odata.nextLink") - private String odataNextLink; - - /** - * Get the value property: A collection of applications. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: A collection of applications. - * - * @param value the value value to set. - * @return the ApplicationListResult object itself. - */ - public ApplicationListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the odataNextLink property: The URL to get the next set of results. - * - * @return the odataNextLink value. - */ - public String odataNextLink() { - return this.odataNextLink; - } - - /** - * Set the odataNextLink property: The URL to get the next set of results. - * - * @param odataNextLink the odataNextLink value to set. - * @return the ApplicationListResult object itself. - */ - public ApplicationListResult withOdataNextLink(String odataNextLink) { - this.odataNextLink = odataNextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ApplicationUpdateParameters.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ApplicationUpdateParameters.java deleted file mode 100644 index 7e9b11ce333e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ApplicationUpdateParameters.java +++ /dev/null @@ -1,285 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.authorization.fluent.models.KeyCredentialInner; -import com.azure.resourcemanager.authorization.fluent.models.PasswordCredentialInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Request parameters for updating a new application. */ -@Fluent -public final class ApplicationUpdateParameters extends ApplicationBase { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationUpdateParameters.class); - - /* - * The display name of the application. - */ - @JsonProperty(value = "displayName") - private String displayName; - - /* - * A collection of URIs for the application. - */ - @JsonProperty(value = "identifierUris") - private List identifierUris; - - /** - * Get the displayName property: The display name of the application. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Set the displayName property: The display name of the application. - * - * @param displayName the displayName value to set. - * @return the ApplicationUpdateParameters object itself. - */ - public ApplicationUpdateParameters withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - - /** - * Get the identifierUris property: A collection of URIs for the application. - * - * @return the identifierUris value. - */ - public List identifierUris() { - return this.identifierUris; - } - - /** - * Set the identifierUris property: A collection of URIs for the application. - * - * @param identifierUris the identifierUris value to set. - * @return the ApplicationUpdateParameters object itself. - */ - public ApplicationUpdateParameters withIdentifierUris(List identifierUris) { - this.identifierUris = identifierUris; - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicationUpdateParameters withAllowGuestsSignIn(Boolean allowGuestsSignIn) { - super.withAllowGuestsSignIn(allowGuestsSignIn); - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicationUpdateParameters withAllowPassthroughUsers(Boolean allowPassthroughUsers) { - super.withAllowPassthroughUsers(allowPassthroughUsers); - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicationUpdateParameters withAppLogoUrl(String appLogoUrl) { - super.withAppLogoUrl(appLogoUrl); - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicationUpdateParameters withAppRoles(List appRoles) { - super.withAppRoles(appRoles); - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicationUpdateParameters withAppPermissions(List appPermissions) { - super.withAppPermissions(appPermissions); - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicationUpdateParameters withAvailableToOtherTenants(Boolean availableToOtherTenants) { - super.withAvailableToOtherTenants(availableToOtherTenants); - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicationUpdateParameters withErrorUrl(String errorUrl) { - super.withErrorUrl(errorUrl); - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicationUpdateParameters withGroupMembershipClaims(GroupMembershipClaimTypes groupMembershipClaims) { - super.withGroupMembershipClaims(groupMembershipClaims); - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicationUpdateParameters withHomepage(String homepage) { - super.withHomepage(homepage); - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicationUpdateParameters withInformationalUrls(InformationalUrl informationalUrls) { - super.withInformationalUrls(informationalUrls); - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicationUpdateParameters withIsDeviceOnlyAuthSupported(Boolean isDeviceOnlyAuthSupported) { - super.withIsDeviceOnlyAuthSupported(isDeviceOnlyAuthSupported); - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicationUpdateParameters withKeyCredentials(List keyCredentials) { - super.withKeyCredentials(keyCredentials); - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicationUpdateParameters withKnownClientApplications(List knownClientApplications) { - super.withKnownClientApplications(knownClientApplications); - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicationUpdateParameters withLogoutUrl(String logoutUrl) { - super.withLogoutUrl(logoutUrl); - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicationUpdateParameters withOauth2AllowImplicitFlow(Boolean oauth2AllowImplicitFlow) { - super.withOauth2AllowImplicitFlow(oauth2AllowImplicitFlow); - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicationUpdateParameters withOauth2AllowUrlPathMatching(Boolean oauth2AllowUrlPathMatching) { - super.withOauth2AllowUrlPathMatching(oauth2AllowUrlPathMatching); - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicationUpdateParameters withOauth2Permissions(List oauth2Permissions) { - super.withOauth2Permissions(oauth2Permissions); - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicationUpdateParameters withOauth2RequirePostResponse(Boolean oauth2RequirePostResponse) { - super.withOauth2RequirePostResponse(oauth2RequirePostResponse); - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicationUpdateParameters withOrgRestrictions(List orgRestrictions) { - super.withOrgRestrictions(orgRestrictions); - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicationUpdateParameters withOptionalClaims(OptionalClaims optionalClaims) { - super.withOptionalClaims(optionalClaims); - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicationUpdateParameters withPasswordCredentials(List passwordCredentials) { - super.withPasswordCredentials(passwordCredentials); - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicationUpdateParameters withPreAuthorizedApplications( - List preAuthorizedApplications) { - super.withPreAuthorizedApplications(preAuthorizedApplications); - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicationUpdateParameters withPublicClient(Boolean publicClient) { - super.withPublicClient(publicClient); - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicationUpdateParameters withPublisherDomain(String publisherDomain) { - super.withPublisherDomain(publisherDomain); - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicationUpdateParameters withReplyUrls(List replyUrls) { - super.withReplyUrls(replyUrls); - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicationUpdateParameters withRequiredResourceAccess(List requiredResourceAccess) { - super.withRequiredResourceAccess(requiredResourceAccess); - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicationUpdateParameters withSamlMetadataUrl(String samlMetadataUrl) { - super.withSamlMetadataUrl(samlMetadataUrl); - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicationUpdateParameters withSignInAudience(String signInAudience) { - super.withSignInAudience(signInAudience); - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicationUpdateParameters withWwwHomepage(String wwwHomepage) { - super.withWwwHomepage(wwwHomepage); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/BuiltInRole.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/BuiltInRole.java deleted file mode 100644 index d45407a85157..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/BuiltInRole.java +++ /dev/null @@ -1,228 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.authorization.models; - -import com.azure.core.util.ExpandableStringEnum; - -import java.util.Collection; - -/** Defines values for roles. */ -public final class BuiltInRole extends ExpandableStringEnum { - /** A role that can manage API Management service and the APIs. */ - public static final BuiltInRole API_MANAGEMENT_SERVICE_CONTRIBUTOR = - BuiltInRole.fromString("API Management Service Contributor"); - - /** A role that can manage API Management service, but not the APIs themselves. */ - public static final BuiltInRole API_MANAGEMENT_SERVICE_OPERATOR_ROLE = - BuiltInRole.fromString("API Management Service Operator Role"); - - /** A role that has read-only access to API Management service and APIs. */ - public static final BuiltInRole API_MANAGEMENT_SERVICE_READER_ROLE = - BuiltInRole.fromString("API Management Service Reader Role"); - - /** A role that can manage Application Insights components. */ - public static final BuiltInRole APPLICATION_INSIGHTS_COMPONENT_CONTRIBUTOR = - BuiltInRole.fromString("Application Insights Component Contributor"); - - /** A role that is able to start, stop, suspend, and resume jobs. */ - public static final BuiltInRole AUTOMATION_OPERATOR = BuiltInRole.fromString("Automation Operator"); - - /** A role that can manage backup in Recovery Services vault. */ - public static final BuiltInRole BACKUP_CONTRIBUTOR = BuiltInRole.fromString("Backup Contributor"); - - /** A role that can manage backup except removing backup, in Recovery Services vault. */ - public static final BuiltInRole BACKUP_OPERATOR = BuiltInRole.fromString("Backup Operator"); - - /** A role that can view all backup management services. */ - public static final BuiltInRole BACKUP_READER = BuiltInRole.fromString("Backup Reader"); - - /** A role that can view all billing information. */ - public static final BuiltInRole BILLING_READER = BuiltInRole.fromString("Billing Reader"); - - /** A role that can manage BizTalk services. */ - public static final BuiltInRole BIZTALK_CONTRIBUTOR = BuiltInRole.fromString("BizTalk Contributor"); - - /** A role that can manage ClearDB MySQL databases. */ - public static final BuiltInRole CLEARDB_MYSQL_DB_CONTRIBUTOR = - BuiltInRole.fromString("ClearDB MySQL DB Contributor"); - - /** A role that can manage everything except access.. */ - public static final BuiltInRole CONTRIBUTOR = BuiltInRole.fromString("Contributor"); - - /** A role that can create and manage data factories, and child resources within them.. */ - public static final BuiltInRole DATA_FACTORY_CONTRIBUTOR = BuiltInRole.fromString("Data Factory Contributor"); - - /** A role that can view everything and connect, start, restart, and shutdown virtual machines. */ - public static final BuiltInRole DEVTEST_LABS_USER = BuiltInRole.fromString("DevTest Labs User"); - - /** A role that can manage DNS zones and records. */ - public static final BuiltInRole DNS_ZONE_CONTRIBUTOR = BuiltInRole.fromString("DNS Zone Contributor"); - - /** A role that can manage Azure Cosmos DB accounts. */ - public static final BuiltInRole AZURE_COSMOS_DB_ACCOUNT_CONTRIBUTOR = - BuiltInRole.fromString("Azure Cosmos DB Account Contributor"); - - /** A role that can manage Intelligent Systems accounts. */ - public static final BuiltInRole INTELLIGENT_SYSTEMS_ACCOUNT_CONTRIBUTOR = - BuiltInRole.fromString("Intelligent Systems Account Contributor"); - - /** A role that can manage user assigned identities. */ - public static final BuiltInRole MANAGED_IDENTITY_CONTRIBUTOR = - BuiltInRole.fromString("Managed Identity Contributor"); - - /** A role that can read and assign user assigned identities. */ - public static final BuiltInRole MANAGED_IDENTITY_OPERATOR = BuiltInRole.fromString("Managed Identity Operator"); - - /** A role that can read all monitoring data. */ - public static final BuiltInRole MONITORING_READER = BuiltInRole.fromString("Monitoring Reader"); - - /** A role that can read monitoring data and edit monitoring settings. */ - public static final BuiltInRole MONITORING_CONTRIBUTOR = BuiltInRole.fromString("Monitoring Contributor"); - - /** A role that can manage all network resources. */ - public static final BuiltInRole NETWORK_CONTRIBUTOR = BuiltInRole.fromString("Network Contributor"); - - /** A role that can manage New Relic Application Performance Management accounts and applications. */ - public static final BuiltInRole NEW_RELIC_APM_ACCOUNT_CONTRIBUTOR = - BuiltInRole.fromString("New Relic APM Account Contributor"); - - /** A role that can manage everything, including access. */ - public static final BuiltInRole OWNER = BuiltInRole.fromString("Owner"); - - /** A role that can view everything, but can't make changes. */ - public static final BuiltInRole READER = BuiltInRole.fromString("Reader"); - - /** A role that can manage Redis caches. */ - public static final BuiltInRole REDIS_CACHE_CONTRIBUTOR = BuiltInRole.fromString("Redis Cache Contributor"); - - /** A role that can manage scheduler job collections. */ - public static final BuiltInRole SCHEDULER_JOB_COLLECTIONS_CONTRIBUTOR = - BuiltInRole.fromString("Scheduler Job Collections Contributor"); - - /** A role that can manage search services. */ - public static final BuiltInRole SEARCH_SERVICE_CONTRIBUTOR = BuiltInRole.fromString("Search Service Contributor"); - - /** A role that can manage security components, security policies, and virtual machines. */ - public static final BuiltInRole SECURITY_MANAGER = BuiltInRole.fromString("Security Manager"); - - /** A role that can manage SQL databases, but not their security-related policies. */ - public static final BuiltInRole SQL_DB_CONTRIBUTOR = BuiltInRole.fromString("SQL DB Contributor"); - - /** A role that can manage the security-related policies of SQL servers and databases. */ - public static final BuiltInRole SQL_SECURITY_MANAGER = BuiltInRole.fromString("SQL Security Manager"); - - /** A role that can manage SQL servers and databases, but not their security-related policies. */ - public static final BuiltInRole SQL_SERVER_CONTRIBUTOR = BuiltInRole.fromString("SQL Server Contributor"); - - /** A role that can manage classic storage accounts. */ - public static final BuiltInRole CLASSIC_STORAGE_ACCOUNT_CONTRIBUTOR = - BuiltInRole.fromString("Classic Storage Account Contributor"); - - /** A role that can manage storage accounts. */ - public static final BuiltInRole STORAGE_ACCOUNT_CONTRIBUTOR = BuiltInRole.fromString("Storage Account Contributor"); - - /** A role that can manage user access to Azure resources. */ - public static final BuiltInRole USER_ACCESS_ADMINISTRATOR = BuiltInRole.fromString("User Access Administrator"); - - /** - * A role that can manage classic virtual machines, but not the virtual network or storage account to which they are - * connected. - */ - public static final BuiltInRole CLASSIC_VIRTUAL_MACHINE_CONTRIBUTOR = - BuiltInRole.fromString("Classic Virtual Machine Contributor"); - - /** - * A role that can manage virtual machines, but not the virtual network or storage account to which they are - * connected. - */ - public static final BuiltInRole VIRTUAL_MACHINE_CONTRIBUTOR = BuiltInRole.fromString("Virtual Machine Contributor"); - - /** A role that can manage classic virtual networks and reserved IPs. */ - public static final BuiltInRole CLASSIC_NETWORK_CONTRIBUTOR = BuiltInRole.fromString("Classic Network Contributor"); - - /** A role that can manage web plans. */ - public static final BuiltInRole WEB_PLAN_CONTRIBUTOR = BuiltInRole.fromString("Web Plan Contributor"); - - /** A role that can manage websites, but not the web plans to which they are connected. */ - public static final BuiltInRole WEBSITE_CONTRIBUTOR = BuiltInRole.fromString("Website Contributor"); - - /** A role that can manage key vaults, but not access to them. */ - public static final BuiltInRole KEY_VAULT_CONTRIBUTOR = BuiltInRole.fromString("Key Vault Contributor"); - - // Storage data related roles - /** Storage Account Key Operators are allowed to list and regenerate keys on Storage Accounts. */ - public static final BuiltInRole STORAGE_ACCOUNT_KEY_OPERATOR_SERVICE_ROLE = - BuiltInRole.fromString("Storage Account Key Operator Service Role"); - /** Allows for read, write and delete access to Azure Storage blob containers and data. */ - public static final BuiltInRole STORAGE_BLOB_DATA_CONTRIBUTOR = - BuiltInRole.fromString("Storage Blob Data Contributor"); - /** Allows for full access to Azure Storage blob containers and data, including assigning POSIX access control. */ - public static final BuiltInRole STORAGE_BLOB_DATA_OWNER = - BuiltInRole.fromString("Storage Blob Data Owner"); - /** Allows for read access to Azure Storage blob containers and data. */ - public static final BuiltInRole STORAGE_BLOB_DATA_READER = - BuiltInRole.fromString("Storage Blob Data Reader"); - /** Allows for read, write, and delete access to Azure Storage queues and queue messages. */ - public static final BuiltInRole STORAGE_QUEUE_DATA_CONTRIBUTOR = - BuiltInRole.fromString("Storage Queue Data Contributor"); - /** Allows for peek, receive, and delete access to Azure Storage queue messages. */ - public static final BuiltInRole STORAGE_QUEUE_DATA_MESSAGE_PROCESSOR = - BuiltInRole.fromString("Storage Queue Data Message Processor"); - /** Allows for sending of Azure Storage queue messages. */ - public static final BuiltInRole STORAGE_QUEUE_DATA_MESSAGE_SENDER = - BuiltInRole.fromString("Storage Queue Data Message Sender"); - /** Allows for read access to Azure Storage queues and queue messages. */ - public static final BuiltInRole STORAGE_QUEUE_DATA_READER = - BuiltInRole.fromString("Storage Queue Data Reader"); - /** Allows for read access to Azure File Share over SMB. */ - public static final BuiltInRole STORAGE_FILE_DATA_SMB_SHARE_READER = - BuiltInRole.fromString("Storage File Data SMB Share Reader"); - /** Allows for read, write, and delete access in Azure Storage file shares over SMB. */ - public static final BuiltInRole STORAGE_FILE_DATA_SMB_SHARE_CONTRIBUTOR = - BuiltInRole.fromString("Storage File Data SMB Share Contributor"); - - // Key Vault data related roles - /** - * Perform all data plane operations on a key vault and all objects in it, including certificates, keys, and - * secrets. - */ - public static final BuiltInRole KEY_VAULT_ADMINISTRATOR = - BuiltInRole.fromString("Key Vault Administrator"); - /** Perform any action on the keys of a key vault, except manage permissions. */ - public static final BuiltInRole KEY_VAULT_CRYPTO_OFFICER = - BuiltInRole.fromString("Key Vault Crypto Officer"); - /** Perform cryptographic operations using keys. */ - public static final BuiltInRole KEY_VAULT_CRYPTO_USER = - BuiltInRole.fromString("Key Vault Crypto User"); - /** Perform any action on the secrets of a key vault, except manage permissions. */ - public static final BuiltInRole KEY_VAULT_SECRETS_OFFICER = - BuiltInRole.fromString("Key Vault Secrets Officer"); - /** Read secret contents. */ - public static final BuiltInRole KEY_VAULT_SECRETS_USER = - BuiltInRole.fromString("Key Vault Secrets User"); - /** Perform any action on the certificates of a key vault, except manage permissions. */ - public static final BuiltInRole KEY_VAULT_CERTIFICATES_OFFICER = - BuiltInRole.fromString("Key Vault Certificates Officer"); - /** Read metadata of key vaults and its certificates, keys, and secrets. */ - public static final BuiltInRole KEY_VAULT_READER = - BuiltInRole.fromString("Key Vault Reader"); - /** Read metadata of keys and perform wrap/unwrap operations. */ - public static final BuiltInRole KEY_VAULT_CRYPTO_SERVICE_ENCRYPTION_USER = - BuiltInRole.fromString("Key Vault Crypto Service Encryption User"); - - /** - * Finds or creates a role instance based on the specified name. - * - * @param name a name - * @return a BuiltInRole instance - */ - public static BuiltInRole fromString(String name) { - return fromString(name, BuiltInRole.class); - } - - /** @return known roles */ - public static Collection values() { - return values(BuiltInRole.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/CertificateCredential.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/CertificateCredential.java deleted file mode 100644 index f5e4a24f397c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/CertificateCredential.java +++ /dev/null @@ -1,334 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.authorization.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.authorization.fluent.models.KeyCredentialInner; -import com.azure.resourcemanager.resources.fluentcore.model.Attachable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import java.io.OutputStream; -import java.time.Duration; -import java.time.OffsetDateTime; - -/** An immutable client-side representation of an Azure AD credential. */ -@Fluent -public interface CertificateCredential extends Credential, HasInnerModel { - - /************************************************************** - * Fluent interfaces to attach a credential - **************************************************************/ - - /** - * The entirety of a credential definition. - * - * @param the return type of the final {@link Attachable#attach()} - */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithCertificateType, - DefinitionStages.WithPublicKey, - DefinitionStages.WithSymmetricKey, - DefinitionStages.WithAttach, - DefinitionStages.WithAuthFileCertificate, - DefinitionStages.WithAuthFileCertificatePassword { - } - - /** Grouping of credential definition stages applicable as part of a application or service principal creation. */ - interface DefinitionStages { - /** - * The first stage of a credential definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface Blank extends WithCertificateType { - } - - /** - * The credential definition stage allowing the certificate type to be set. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithCertificateType { - /** - * Specifies the type of the certificate to be Asymmetric X509. - * - * @return the next stage in credential definition - */ - WithPublicKey withAsymmetricX509Certificate(); - - /** - * Specifies the type of the certificate to be symmetric. - * - * @return the next stage in credential definition - */ - WithSymmetricKey withSymmetricEncryption(); - } - - /** - * The credential definition stage allowing the public key to be set. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithPublicKey { - /** - * Specifies the public key for an asymmetric X509 certificate. - * - * @param certificate the certificate content - * @return the next stage in credential definition - */ - WithAttach withPublicKey(byte[] certificate); - } - - /** - * The credential definition stage allowing the secret key to be set. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithSymmetricKey { - /** - * Specifies the secret key for a symmetric encryption. - * - * @param secret the secret key content - * @return the next stage in credential definition - */ - WithAttach withSecretKey(byte[] secret); - } - - /** - * The credential definition stage allowing start date to be set. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithStartDate { - /** - * Specifies the start date after which password or key would be valid. Default value is current time. - * - * @param startDate the start date for validity - * @return the next stage in credential definition - */ - WithAttach withStartDate(OffsetDateTime startDate); - } - - /** - * The credential definition stage allowing the duration of key validity to be set. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithDuration { - /** - * Specifies the duration for which password or key would be valid. Default value is 1 year. - * - * @param duration the duration of validity - * @return the next stage in credential definition - */ - WithAttach withDuration(Duration duration); - } - - /** A credential definition stage allowing exporting the auth file for the service principal. */ - interface WithAuthFile { - /** - * Export the information of this service principal into an auth file. - * - * @param outputStream the output stream to export the file - * @return the next stage in credential definition - */ - WithAuthFileCertificate withAuthFileToExport(OutputStream outputStream); - } - - /** A credential definition stage allowing specifying the private key for exporting an auth file. */ - interface WithAuthFileCertificate { - /** - * Export the information of this service principal into an auth file. - * - * @param privateKeyPath the path to the private key file - * @return the next stage in credential definition - */ - WithAuthFileCertificatePassword withPrivateKeyFile(String privateKeyPath); - } - - /** - * A credential definition stage allowing specifying the password for the private key for exporting an auth - * file. - */ - interface WithAuthFileCertificatePassword { - /** - * Export the information of this service principal into an auth file. - * - * @param privateKeyPassword the password for the private key - * @return the next stage in credential definition - */ - WithAttach withPrivateKeyPassword(String privateKeyPassword); - } - - /** - * The final stage of the credential definition. - * - *

At this stage, more settings can be specified, or the credential definition can be attached to the parent - * application / service principal definition using {@link WithAttach#attach()}. - * - * @param the return type of {@link WithAttach#attach()} - */ - interface WithAttach - extends Attachable.InDefinition, - WithStartDate, - WithDuration, - WithAuthFile { - } - } - - /** - * The entirety of a credential definition as part of a application or service principal update. - * - * @param the return type of the final {@link UpdateDefinitionStages.WithAttach#attach()} - */ - interface UpdateDefinition - extends UpdateDefinitionStages.Blank, - UpdateDefinitionStages.WithCertificateType, - UpdateDefinitionStages.WithPublicKey, - UpdateDefinitionStages.WithSymmetricKey, - UpdateDefinitionStages.WithAttach, - UpdateDefinitionStages.WithAuthFileCertificate, - UpdateDefinitionStages.WithAuthFileCertificatePassword { - } - - /** Grouping of credential definition stages applicable as part of a application or service principal update. */ - interface UpdateDefinitionStages { - /** - * The first stage of a credential definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface Blank extends WithCertificateType { - } - - /** - * The credential definition stage allowing the certificate type to be set. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithCertificateType { - /** - * Specifies the type of the certificate to be asymmetric X509. - * - * @return the next stage in credential definition - */ - WithPublicKey withAsymmetricX509Certificate(); - - /** - * Specifies the type of the certificate to be symmetric. - * - * @return the next stage in credential definition - */ - WithSymmetricKey withSymmetricEncryption(); - } - - /** - * The credential definition stage allowing the public key to be set. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithPublicKey { - /** - * Specifies the public key for an asymmetric X509 certificate. - * - * @param certificate the certificate content - * @return the next stage in credential definition - */ - WithAttach withPublicKey(byte[] certificate); - } - - /** - * The credential definition stage allowing the secret key to be set. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithSymmetricKey { - /** - * Specifies the secret key for a symmetric encryption. - * - * @param secret the secret key content - * @return the next stage in credential definition - */ - WithAttach withSecretKey(byte[] secret); - } - - /** - * The credential definition stage allowing start date to be set. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithStartDate { - /** - * Specifies the start date after which password or key would be valid. Default value is current time. - * - * @param startDate the start date for validity - * @return the next stage in credential definition - */ - WithAttach withStartDate(OffsetDateTime startDate); - } - - /** - * The credential definition stage allowing the duration of key validity to be set. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithDuration { - /** - * Specifies the duration for which password or key would be valid. Default value is 1 year. - * - * @param duration the duration of validity - * @return the next stage in credential definition - */ - WithAttach withDuration(Duration duration); - } - - /** A credential definition stage allowing exporting the auth file for the service principal. */ - interface WithAuthFile { - /** - * Export the information of this service principal into an auth file. - * - * @param outputStream the output stream to export the file - * @return the next stage in credential definition - */ - WithAuthFileCertificate withAuthFileToExport(OutputStream outputStream); - } - - /** A credential definition stage allowing specifying the private key for exporting an auth file. */ - interface WithAuthFileCertificate { - /** - * Export the information of this service principal into an auth file. - * - * @param privateKeyPath the path to the private key file - * @return the next stage in credential definition - */ - WithAuthFileCertificatePassword withPrivateKeyFile(String privateKeyPath); - } - - /** - * A credential definition stage allowing specifying the password for the private key for exporting an auth - * file. - */ - interface WithAuthFileCertificatePassword { - /** - * Export the information of this service principal into an auth file. - * - * @param privateKeyPassword the password for the private key - * @return the next stage in credential definition - */ - WithAttach withPrivateKeyPassword(String privateKeyPassword); - } - - /** - * The final stage of the credential definition. - * - *

At this stage, more settings can be specified, or the credential definition can be attached to the parent - * application / service principal definition using {@link WithAttach#attach()}. - * - * @param the return type of {@link WithAttach#attach()} - */ - interface WithAttach - extends Attachable.InUpdate, WithStartDate, WithDuration, WithAuthFile { - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/CertificateType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/CertificateType.java deleted file mode 100644 index 49d0317f1364..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/CertificateType.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.authorization.models; - -import com.azure.core.util.ExpandableStringEnum; - -import java.util.Collection; - -/** Defines values for certificate types. */ -public final class CertificateType extends ExpandableStringEnum { - /** Static value AsymmetricX509Cert for CertificateType. */ - public static final CertificateType ASYMMETRIC_X509_CERT = CertificateType.fromString("AsymmetricX509Cert"); - - /** Static value Symmetric for CertificateType. */ - public static final CertificateType SYMMETRIC = CertificateType.fromString("Symmetric"); - - /** - * Finds or creates a certificate type instance based on the specified name. - * - * @param name a name - * @return a CertificateType instance - */ - public static CertificateType fromString(String name) { - return fromString(name, CertificateType.class); - } - - /** @return known certificate types */ - public static Collection values() { - return values(CertificateType.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/CheckGroupMembershipParameters.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/CheckGroupMembershipParameters.java deleted file mode 100644 index 43d225902ab0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/CheckGroupMembershipParameters.java +++ /dev/null @@ -1,129 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; -import java.util.Map; - -/** Request parameters for IsMemberOf API call. */ -@Fluent -public final class CheckGroupMembershipParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CheckGroupMembershipParameters.class); - - /* - * The object ID of the group to check. - */ - @JsonProperty(value = "groupId", required = true) - private String groupId; - - /* - * The object ID of the contact, group, user, or service principal to check - * for membership in the specified group. - */ - @JsonProperty(value = "memberId", required = true) - private String memberId; - - /* - * Request parameters for IsMemberOf API call. - */ - @JsonIgnore private Map additionalProperties; - - /** - * Get the groupId property: The object ID of the group to check. - * - * @return the groupId value. - */ - public String groupId() { - return this.groupId; - } - - /** - * Set the groupId property: The object ID of the group to check. - * - * @param groupId the groupId value to set. - * @return the CheckGroupMembershipParameters object itself. - */ - public CheckGroupMembershipParameters withGroupId(String groupId) { - this.groupId = groupId; - return this; - } - - /** - * Get the memberId property: The object ID of the contact, group, user, or service principal to check for - * membership in the specified group. - * - * @return the memberId value. - */ - public String memberId() { - return this.memberId; - } - - /** - * Set the memberId property: The object ID of the contact, group, user, or service principal to check for - * membership in the specified group. - * - * @param memberId the memberId value to set. - * @return the CheckGroupMembershipParameters object itself. - */ - public CheckGroupMembershipParameters withMemberId(String memberId) { - this.memberId = memberId; - return this; - } - - /** - * Get the additionalProperties property: Request parameters for IsMemberOf API call. - * - * @return the additionalProperties value. - */ - @JsonAnyGetter - public Map additionalProperties() { - return this.additionalProperties; - } - - /** - * Set the additionalProperties property: Request parameters for IsMemberOf API call. - * - * @param additionalProperties the additionalProperties value to set. - * @return the CheckGroupMembershipParameters object itself. - */ - public CheckGroupMembershipParameters withAdditionalProperties(Map additionalProperties) { - this.additionalProperties = additionalProperties; - return this; - } - - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (groupId() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property groupId in model CheckGroupMembershipParameters")); - } - if (memberId() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property memberId in model CheckGroupMembershipParameters")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ClassicAdministratorListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ClassicAdministratorListResult.java deleted file mode 100644 index 9340c6cef276..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ClassicAdministratorListResult.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.authorization.fluent.models.ClassicAdministratorInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** ClassicAdministrator list result information. */ -@Fluent -public final class ClassicAdministratorListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ClassicAdministratorListResult.class); - - /* - * An array of administrators. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to use for getting the next set of results. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: An array of administrators. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: An array of administrators. - * - * @param value the value value to set. - * @return the ClassicAdministratorListResult object itself. - */ - public ClassicAdministratorListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to use for getting the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The URL to use for getting the next set of results. - * - * @param nextLink the nextLink value to set. - * @return the ClassicAdministratorListResult object itself. - */ - public ClassicAdministratorListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ConsentType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ConsentType.java deleted file mode 100644 index f0622b107293..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ConsentType.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ConsentType. */ -public final class ConsentType extends ExpandableStringEnum { - /** Static value AllPrincipals for ConsentType. */ - public static final ConsentType ALL_PRINCIPALS = fromString("AllPrincipals"); - - /** Static value Principal for ConsentType. */ - public static final ConsentType PRINCIPAL = fromString("Principal"); - - /** - * Creates or finds a ConsentType from its string representation. - * - * @param name a name to look for. - * @return the corresponding ConsentType. - */ - @JsonCreator - public static ConsentType fromString(String name) { - return fromString(name, ConsentType.class); - } - - /** @return known ConsentType values. */ - public static Collection values() { - return values(ConsentType.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/Credential.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/Credential.java deleted file mode 100644 index ca1af02ceddd..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/Credential.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.authorization.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasId; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasName; -import com.azure.resourcemanager.resources.fluentcore.model.Indexable; -import java.time.OffsetDateTime; - -/** An immutable client-side representation of an Azure AD credential. */ -@Fluent -public interface Credential extends Indexable, HasId, HasName { - /** @return start date. */ - OffsetDateTime startDate(); - - /** @return end date. */ - OffsetDateTime endDate(); - - /** @return key value. */ - String value(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/DirectoryObjectListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/DirectoryObjectListResult.java deleted file mode 100644 index 809f4e9e9247..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/DirectoryObjectListResult.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.authorization.fluent.models.DirectoryObjectInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** DirectoryObject list operation result. */ -@Fluent -public final class DirectoryObjectListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DirectoryObjectListResult.class); - - /* - * A collection of DirectoryObject. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to get the next set of results. - */ - @JsonProperty(value = "odata.nextLink") - private String odataNextLink; - - /** - * Get the value property: A collection of DirectoryObject. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: A collection of DirectoryObject. - * - * @param value the value value to set. - * @return the DirectoryObjectListResult object itself. - */ - public DirectoryObjectListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the odataNextLink property: The URL to get the next set of results. - * - * @return the odataNextLink value. - */ - public String odataNextLink() { - return this.odataNextLink; - } - - /** - * Set the odataNextLink property: The URL to get the next set of results. - * - * @param odataNextLink the odataNextLink value to set. - * @return the DirectoryObjectListResult object itself. - */ - public DirectoryObjectListResult withOdataNextLink(String odataNextLink) { - this.odataNextLink = odataNextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/DomainListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/DomainListResult.java deleted file mode 100644 index 881bd3f23582..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/DomainListResult.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.authorization.fluent.models.DomainInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Server response for Get tenant domains API call. */ -@Fluent -public final class DomainListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DomainListResult.class); - - /* - * the list of domains. - */ - @JsonProperty(value = "value") - private List value; - - /** - * Get the value property: the list of domains. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: the list of domains. - * - * @param value the value value to set. - * @return the DomainListResult object itself. - */ - public DomainListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/GetObjectsParameters.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/GetObjectsParameters.java deleted file mode 100644 index 3c232f38320f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/GetObjectsParameters.java +++ /dev/null @@ -1,141 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** Request parameters for the GetObjectsByObjectIds API. */ -@Fluent -public final class GetObjectsParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(GetObjectsParameters.class); - - /* - * The requested object IDs. - */ - @JsonProperty(value = "objectIds") - private List objectIds; - - /* - * The requested object types. - */ - @JsonProperty(value = "types") - private List types; - - /* - * If true, also searches for object IDs in the partner tenant. - */ - @JsonProperty(value = "includeDirectoryObjectReferences") - private Boolean includeDirectoryObjectReferences; - - /* - * Request parameters for the GetObjectsByObjectIds API. - */ - @JsonIgnore private Map additionalProperties; - - /** - * Get the objectIds property: The requested object IDs. - * - * @return the objectIds value. - */ - public List objectIds() { - return this.objectIds; - } - - /** - * Set the objectIds property: The requested object IDs. - * - * @param objectIds the objectIds value to set. - * @return the GetObjectsParameters object itself. - */ - public GetObjectsParameters withObjectIds(List objectIds) { - this.objectIds = objectIds; - return this; - } - - /** - * Get the types property: The requested object types. - * - * @return the types value. - */ - public List types() { - return this.types; - } - - /** - * Set the types property: The requested object types. - * - * @param types the types value to set. - * @return the GetObjectsParameters object itself. - */ - public GetObjectsParameters withTypes(List types) { - this.types = types; - return this; - } - - /** - * Get the includeDirectoryObjectReferences property: If true, also searches for object IDs in the partner tenant. - * - * @return the includeDirectoryObjectReferences value. - */ - public Boolean includeDirectoryObjectReferences() { - return this.includeDirectoryObjectReferences; - } - - /** - * Set the includeDirectoryObjectReferences property: If true, also searches for object IDs in the partner tenant. - * - * @param includeDirectoryObjectReferences the includeDirectoryObjectReferences value to set. - * @return the GetObjectsParameters object itself. - */ - public GetObjectsParameters withIncludeDirectoryObjectReferences(Boolean includeDirectoryObjectReferences) { - this.includeDirectoryObjectReferences = includeDirectoryObjectReferences; - return this; - } - - /** - * Get the additionalProperties property: Request parameters for the GetObjectsByObjectIds API. - * - * @return the additionalProperties value. - */ - @JsonAnyGetter - public Map additionalProperties() { - return this.additionalProperties; - } - - /** - * Set the additionalProperties property: Request parameters for the GetObjectsByObjectIds API. - * - * @param additionalProperties the additionalProperties value to set. - * @return the GetObjectsParameters object itself. - */ - public GetObjectsParameters withAdditionalProperties(Map additionalProperties) { - this.additionalProperties = additionalProperties; - return this; - } - - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/GraphError.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/GraphError.java deleted file mode 100644 index 191f93e7bd8e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/GraphError.java +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.authorization.fluent.models.OdataError; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Active Directory error information. */ -@Fluent -public final class GraphError { - @JsonIgnore private final ClientLogger logger = new ClientLogger(GraphError.class); - - /* - * A Graph API error. - */ - @JsonProperty(value = "odata.error") - private OdataError innerOdataError; - - /** - * Get the innerOdataError property: A Graph API error. - * - * @return the innerOdataError value. - */ - private OdataError innerOdataError() { - return this.innerOdataError; - } - - /** - * Get the code property: Error code. - * - * @return the code value. - */ - public String code() { - return this.innerOdataError() == null ? null : this.innerOdataError().code(); - } - - /** - * Set the code property: Error code. - * - * @param code the code value to set. - * @return the GraphError object itself. - */ - public GraphError withCode(String code) { - if (this.innerOdataError() == null) { - this.innerOdataError = new OdataError(); - } - this.innerOdataError().withCode(code); - return this; - } - - /** - * Get the message property: Error message value. - * - * @return the message value. - */ - public String message() { - return this.innerOdataError() == null ? null : this.innerOdataError().message(); - } - - /** - * Set the message property: Error message value. - * - * @param message the message value to set. - * @return the GraphError object itself. - */ - public GraphError withMessage(String message) { - if (this.innerOdataError() == null) { - this.innerOdataError = new OdataError(); - } - this.innerOdataError().withMessage(message); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerOdataError() != null) { - innerOdataError().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/GraphErrorException.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/GraphErrorException.java deleted file mode 100644 index fc92c34dd6b7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/GraphErrorException.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.models; - -import com.azure.core.exception.HttpResponseException; -import com.azure.core.http.HttpResponse; - -/** Exception thrown for an invalid response with GraphError information. */ -public final class GraphErrorException extends HttpResponseException { - /** - * Initializes a new instance of the GraphErrorException class. - * - * @param message the exception message or the response content if a message is not available. - * @param response the HTTP response. - */ - public GraphErrorException(String message, HttpResponse response) { - super(message, response); - } - - /** - * Initializes a new instance of the GraphErrorException class. - * - * @param message the exception message or the response content if a message is not available. - * @param response the HTTP response. - * @param value the deserialized response value. - */ - public GraphErrorException(String message, HttpResponse response, GraphError value) { - super(message, response, value); - } - - @Override - public GraphError getValue() { - return (GraphError) super.getValue(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/GroupAddMemberParameters.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/GroupAddMemberParameters.java deleted file mode 100644 index 60036fa18ba7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/GroupAddMemberParameters.java +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; -import java.util.Map; - -/** Request parameters for adding a member to a group. */ -@Fluent -public final class GroupAddMemberParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(GroupAddMemberParameters.class); - - /* - * A member object URL, such as - * "https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects" - + "/f260bbc4-c254-447b-94cf-293b5ec434dd", - * where "0b1f9851-1bf0-433f-aec3-cb9272f093dc" is the tenantId and - * "f260bbc4-c254-447b-94cf-293b5ec434dd" is the objectId of the member - * (user, application, servicePrincipal, group) to be added. - */ - @JsonProperty(value = "url", required = true) - private String url; - - /* - * Request parameters for adding a member to a group. - */ - @JsonIgnore private Map additionalProperties; - - /** - * Get the url property: A member object URL, such as - * "https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects" - + "/f260bbc4-c254-447b-94cf-293b5ec434dd", - * where "0b1f9851-1bf0-433f-aec3-cb9272f093dc" is the tenantId and "f260bbc4-c254-447b-94cf-293b5ec434dd" is the - * objectId of the member (user, application, servicePrincipal, group) to be added. - * - * @return the url value. - */ - public String url() { - return this.url; - } - - /** - * Set the url property: A member object URL, such as - * "https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects" - + "/f260bbc4-c254-447b-94cf-293b5ec434dd", - * where "0b1f9851-1bf0-433f-aec3-cb9272f093dc" is the tenantId and "f260bbc4-c254-447b-94cf-293b5ec434dd" is the - * objectId of the member (user, application, servicePrincipal, group) to be added. - * - * @param url the url value to set. - * @return the GroupAddMemberParameters object itself. - */ - public GroupAddMemberParameters withUrl(String url) { - this.url = url; - return this; - } - - /** - * Get the additionalProperties property: Request parameters for adding a member to a group. - * - * @return the additionalProperties value. - */ - @JsonAnyGetter - public Map additionalProperties() { - return this.additionalProperties; - } - - /** - * Set the additionalProperties property: Request parameters for adding a member to a group. - * - * @param additionalProperties the additionalProperties value to set. - * @return the GroupAddMemberParameters object itself. - */ - public GroupAddMemberParameters withAdditionalProperties(Map additionalProperties) { - this.additionalProperties = additionalProperties; - return this; - } - - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (url() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property url in model GroupAddMemberParameters")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/GroupCreateParameters.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/GroupCreateParameters.java deleted file mode 100644 index 3b7f964d8157..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/GroupCreateParameters.java +++ /dev/null @@ -1,190 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; -import java.util.Map; - -/** Request parameters for creating a new group. */ -@Fluent -public final class GroupCreateParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(GroupCreateParameters.class); - - /* - * Group display name - */ - @JsonProperty(value = "displayName", required = true) - private String displayName; - - /* - * Whether the group is mail-enabled. Must be false. This is because only - * pure security groups can be created using the Graph API. - */ - @JsonProperty(value = "mailEnabled", required = true) - private boolean mailEnabled; - - /* - * Mail nickname - */ - @JsonProperty(value = "mailNickname", required = true) - private String mailNickname; - - /* - * Whether the group is a security group. Must be true. This is because - * only pure security groups can be created using the Graph API. - */ - @JsonProperty(value = "securityEnabled", required = true) - private boolean securityEnabled; - - /* - * Request parameters for creating a new group. - */ - @JsonIgnore private Map additionalProperties; - - /** Creates an instance of GroupCreateParameters class. */ - public GroupCreateParameters() { - mailEnabled = false; - securityEnabled = true; - } - - /** - * Get the displayName property: Group display name. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Set the displayName property: Group display name. - * - * @param displayName the displayName value to set. - * @return the GroupCreateParameters object itself. - */ - public GroupCreateParameters withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - - /** - * Get the mailEnabled property: Whether the group is mail-enabled. Must be false. This is because only pure - * security groups can be created using the Graph API. - * - * @return the mailEnabled value. - */ - public boolean mailEnabled() { - return this.mailEnabled; - } - - /** - * Set the mailEnabled property: Whether the group is mail-enabled. Must be false. This is because only pure - * security groups can be created using the Graph API. - * - * @param mailEnabled the mailEnabled value to set. - * @return the GroupCreateParameters object itself. - */ - public GroupCreateParameters withMailEnabled(boolean mailEnabled) { - this.mailEnabled = mailEnabled; - return this; - } - - /** - * Get the mailNickname property: Mail nickname. - * - * @return the mailNickname value. - */ - public String mailNickname() { - return this.mailNickname; - } - - /** - * Set the mailNickname property: Mail nickname. - * - * @param mailNickname the mailNickname value to set. - * @return the GroupCreateParameters object itself. - */ - public GroupCreateParameters withMailNickname(String mailNickname) { - this.mailNickname = mailNickname; - return this; - } - - /** - * Get the securityEnabled property: Whether the group is a security group. Must be true. This is because only pure - * security groups can be created using the Graph API. - * - * @return the securityEnabled value. - */ - public boolean securityEnabled() { - return this.securityEnabled; - } - - /** - * Set the securityEnabled property: Whether the group is a security group. Must be true. This is because only pure - * security groups can be created using the Graph API. - * - * @param securityEnabled the securityEnabled value to set. - * @return the GroupCreateParameters object itself. - */ - public GroupCreateParameters withSecurityEnabled(boolean securityEnabled) { - this.securityEnabled = securityEnabled; - return this; - } - - /** - * Get the additionalProperties property: Request parameters for creating a new group. - * - * @return the additionalProperties value. - */ - @JsonAnyGetter - public Map additionalProperties() { - return this.additionalProperties; - } - - /** - * Set the additionalProperties property: Request parameters for creating a new group. - * - * @param additionalProperties the additionalProperties value to set. - * @return the GroupCreateParameters object itself. - */ - public GroupCreateParameters withAdditionalProperties(Map additionalProperties) { - this.additionalProperties = additionalProperties; - return this; - } - - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (displayName() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property displayName in model GroupCreateParameters")); - } - if (mailNickname() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property mailNickname in model GroupCreateParameters")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/GroupGetMemberGroupsParameters.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/GroupGetMemberGroupsParameters.java deleted file mode 100644 index 5a4220cccacd..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/GroupGetMemberGroupsParameters.java +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; -import java.util.Map; - -/** Request parameters for GetMemberGroups API call. */ -@Fluent -public final class GroupGetMemberGroupsParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(GroupGetMemberGroupsParameters.class); - - /* - * If true, only membership in security-enabled groups should be checked. - * Otherwise, membership in all groups should be checked. - */ - @JsonProperty(value = "securityEnabledOnly", required = true) - private boolean securityEnabledOnly; - - /* - * Request parameters for GetMemberGroups API call. - */ - @JsonIgnore private Map additionalProperties; - - /** - * Get the securityEnabledOnly property: If true, only membership in security-enabled groups should be checked. - * Otherwise, membership in all groups should be checked. - * - * @return the securityEnabledOnly value. - */ - public boolean securityEnabledOnly() { - return this.securityEnabledOnly; - } - - /** - * Set the securityEnabledOnly property: If true, only membership in security-enabled groups should be checked. - * Otherwise, membership in all groups should be checked. - * - * @param securityEnabledOnly the securityEnabledOnly value to set. - * @return the GroupGetMemberGroupsParameters object itself. - */ - public GroupGetMemberGroupsParameters withSecurityEnabledOnly(boolean securityEnabledOnly) { - this.securityEnabledOnly = securityEnabledOnly; - return this; - } - - /** - * Get the additionalProperties property: Request parameters for GetMemberGroups API call. - * - * @return the additionalProperties value. - */ - @JsonAnyGetter - public Map additionalProperties() { - return this.additionalProperties; - } - - /** - * Set the additionalProperties property: Request parameters for GetMemberGroups API call. - * - * @param additionalProperties the additionalProperties value to set. - * @return the GroupGetMemberGroupsParameters object itself. - */ - public GroupGetMemberGroupsParameters withAdditionalProperties(Map additionalProperties) { - this.additionalProperties = additionalProperties; - return this; - } - - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/GroupGetMemberGroupsResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/GroupGetMemberGroupsResult.java deleted file mode 100644 index 038f56cad21e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/GroupGetMemberGroupsResult.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Server response for GetMemberGroups API call. */ -@Fluent -public final class GroupGetMemberGroupsResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(GroupGetMemberGroupsResult.class); - - /* - * A collection of group IDs of which the group is a member. - */ - @JsonProperty(value = "value") - private List value; - - /** - * Get the value property: A collection of group IDs of which the group is a member. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: A collection of group IDs of which the group is a member. - * - * @param value the value value to set. - * @return the GroupGetMemberGroupsResult object itself. - */ - public GroupGetMemberGroupsResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/GroupListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/GroupListResult.java deleted file mode 100644 index b1879356a207..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/GroupListResult.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.authorization.fluent.models.ADGroupInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Server response for Get tenant groups API call. */ -@Fluent -public final class GroupListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(GroupListResult.class); - - /* - * A collection of Active Directory groups. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to get the next set of results. - */ - @JsonProperty(value = "odata.nextLink") - private String odataNextLink; - - /** - * Get the value property: A collection of Active Directory groups. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: A collection of Active Directory groups. - * - * @param value the value value to set. - * @return the GroupListResult object itself. - */ - public GroupListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the odataNextLink property: The URL to get the next set of results. - * - * @return the odataNextLink value. - */ - public String odataNextLink() { - return this.odataNextLink; - } - - /** - * Set the odataNextLink property: The URL to get the next set of results. - * - * @param odataNextLink the odataNextLink value to set. - * @return the GroupListResult object itself. - */ - public GroupListResult withOdataNextLink(String odataNextLink) { - this.odataNextLink = odataNextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/GroupMembershipClaimTypes.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/GroupMembershipClaimTypes.java deleted file mode 100644 index f93cdfcd3936..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/GroupMembershipClaimTypes.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for GroupMembershipClaimTypes. */ -public final class GroupMembershipClaimTypes extends ExpandableStringEnum { - /** Static value None for GroupMembershipClaimTypes. */ - public static final GroupMembershipClaimTypes NONE = fromString("None"); - - /** Static value SecurityGroup for GroupMembershipClaimTypes. */ - public static final GroupMembershipClaimTypes SECURITY_GROUP = fromString("SecurityGroup"); - - /** Static value All for GroupMembershipClaimTypes. */ - public static final GroupMembershipClaimTypes ALL = fromString("All"); - - /** - * Creates or finds a GroupMembershipClaimTypes from its string representation. - * - * @param name a name to look for. - * @return the corresponding GroupMembershipClaimTypes. - */ - @JsonCreator - public static GroupMembershipClaimTypes fromString(String name) { - return fromString(name, GroupMembershipClaimTypes.class); - } - - /** @return known GroupMembershipClaimTypes values. */ - public static Collection values() { - return values(GroupMembershipClaimTypes.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/InformationalUrl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/InformationalUrl.java deleted file mode 100644 index 9bdb8e853edf..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/InformationalUrl.java +++ /dev/null @@ -1,131 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Represents a group of URIs that provide terms of service, marketing, support and privacy policy information about an - * application. The default value for each string is null. - */ -@Fluent -public final class InformationalUrl { - @JsonIgnore private final ClientLogger logger = new ClientLogger(InformationalUrl.class); - - /* - * The terms of service URI - */ - @JsonProperty(value = "termsOfService") - private String termsOfService; - - /* - * The marketing URI - */ - @JsonProperty(value = "marketing") - private String marketing; - - /* - * The privacy policy URI - */ - @JsonProperty(value = "privacy") - private String privacy; - - /* - * The support URI - */ - @JsonProperty(value = "support") - private String support; - - /** - * Get the termsOfService property: The terms of service URI. - * - * @return the termsOfService value. - */ - public String termsOfService() { - return this.termsOfService; - } - - /** - * Set the termsOfService property: The terms of service URI. - * - * @param termsOfService the termsOfService value to set. - * @return the InformationalUrl object itself. - */ - public InformationalUrl withTermsOfService(String termsOfService) { - this.termsOfService = termsOfService; - return this; - } - - /** - * Get the marketing property: The marketing URI. - * - * @return the marketing value. - */ - public String marketing() { - return this.marketing; - } - - /** - * Set the marketing property: The marketing URI. - * - * @param marketing the marketing value to set. - * @return the InformationalUrl object itself. - */ - public InformationalUrl withMarketing(String marketing) { - this.marketing = marketing; - return this; - } - - /** - * Get the privacy property: The privacy policy URI. - * - * @return the privacy value. - */ - public String privacy() { - return this.privacy; - } - - /** - * Set the privacy property: The privacy policy URI. - * - * @param privacy the privacy value to set. - * @return the InformationalUrl object itself. - */ - public InformationalUrl withPrivacy(String privacy) { - this.privacy = privacy; - return this; - } - - /** - * Get the support property: The support URI. - * - * @return the support value. - */ - public String support() { - return this.support; - } - - /** - * Set the support property: The support URI. - * - * @param support the support value to set. - * @return the InformationalUrl object itself. - */ - public InformationalUrl withSupport(String support) { - this.support = support; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/KeyCredentialListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/KeyCredentialListResult.java deleted file mode 100644 index 4633faf0b9e5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/KeyCredentialListResult.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.authorization.fluent.models.KeyCredentialInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** KeyCredential list operation result. */ -@Fluent -public final class KeyCredentialListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(KeyCredentialListResult.class); - - /* - * A collection of KeyCredentials. - */ - @JsonProperty(value = "value") - private List value; - - /** - * Get the value property: A collection of KeyCredentials. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: A collection of KeyCredentials. - * - * @param value the value value to set. - * @return the KeyCredentialListResult object itself. - */ - public KeyCredentialListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/KeyCredentialsUpdateParameters.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/KeyCredentialsUpdateParameters.java deleted file mode 100644 index 2c699b1b9351..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/KeyCredentialsUpdateParameters.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.authorization.fluent.models.KeyCredentialInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Request parameters for a KeyCredentials update operation. */ -@Fluent -public final class KeyCredentialsUpdateParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(KeyCredentialsUpdateParameters.class); - - /* - * A collection of KeyCredentials. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /** - * Get the value property: A collection of KeyCredentials. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: A collection of KeyCredentials. - * - * @param value the value value to set. - * @return the KeyCredentialsUpdateParameters object itself. - */ - public KeyCredentialsUpdateParameters withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property value in model KeyCredentialsUpdateParameters")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/OAuth2Permission.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/OAuth2Permission.java deleted file mode 100644 index 643541700d92..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/OAuth2Permission.java +++ /dev/null @@ -1,263 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Represents an OAuth 2.0 delegated permission scope. The specified OAuth 2.0 delegated permission scopes may be - * requested by client applications (through the requiredResourceAccess collection on the Application object) when - * calling a resource application. The oauth2Permissions property of the ServicePrincipal entity and of the Application - * entity is a collection of OAuth2Permission. - */ -@Fluent -public final class OAuth2Permission { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OAuth2Permission.class); - - /* - * Permission help text that appears in the admin consent and app - * assignment experiences. - */ - @JsonProperty(value = "adminConsentDescription") - private String adminConsentDescription; - - /* - * Display name for the permission that appears in the admin consent and - * app assignment experiences. - */ - @JsonProperty(value = "adminConsentDisplayName") - private String adminConsentDisplayName; - - /* - * Unique scope permission identifier inside the oauth2Permissions - * collection. - */ - @JsonProperty(value = "id") - private String id; - - /* - * When creating or updating a permission, this property must be set to - * true (which is the default). To delete a permission, this property must - * first be set to false. At that point, in a subsequent call, the - * permission may be removed. - */ - @JsonProperty(value = "isEnabled") - private Boolean isEnabled; - - /* - * Specifies whether this scope permission can be consented to by an end - * user, or whether it is a tenant-wide permission that must be consented - * to by a Company Administrator. Possible values are "User" or "Admin". - */ - @JsonProperty(value = "type") - private String type; - - /* - * Permission help text that appears in the end user consent experience. - */ - @JsonProperty(value = "userConsentDescription") - private String userConsentDescription; - - /* - * Display name for the permission that appears in the end user consent - * experience. - */ - @JsonProperty(value = "userConsentDisplayName") - private String userConsentDisplayName; - - /* - * The value of the scope claim that the resource application should expect - * in the OAuth 2.0 access token. - */ - @JsonProperty(value = "value") - private String value; - - /** - * Get the adminConsentDescription property: Permission help text that appears in the admin consent and app - * assignment experiences. - * - * @return the adminConsentDescription value. - */ - public String adminConsentDescription() { - return this.adminConsentDescription; - } - - /** - * Set the adminConsentDescription property: Permission help text that appears in the admin consent and app - * assignment experiences. - * - * @param adminConsentDescription the adminConsentDescription value to set. - * @return the OAuth2Permission object itself. - */ - public OAuth2Permission withAdminConsentDescription(String adminConsentDescription) { - this.adminConsentDescription = adminConsentDescription; - return this; - } - - /** - * Get the adminConsentDisplayName property: Display name for the permission that appears in the admin consent and - * app assignment experiences. - * - * @return the adminConsentDisplayName value. - */ - public String adminConsentDisplayName() { - return this.adminConsentDisplayName; - } - - /** - * Set the adminConsentDisplayName property: Display name for the permission that appears in the admin consent and - * app assignment experiences. - * - * @param adminConsentDisplayName the adminConsentDisplayName value to set. - * @return the OAuth2Permission object itself. - */ - public OAuth2Permission withAdminConsentDisplayName(String adminConsentDisplayName) { - this.adminConsentDisplayName = adminConsentDisplayName; - return this; - } - - /** - * Get the id property: Unique scope permission identifier inside the oauth2Permissions collection. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: Unique scope permission identifier inside the oauth2Permissions collection. - * - * @param id the id value to set. - * @return the OAuth2Permission object itself. - */ - public OAuth2Permission withId(String id) { - this.id = id; - return this; - } - - /** - * Get the isEnabled property: When creating or updating a permission, this property must be set to true (which is - * the default). To delete a permission, this property must first be set to false. At that point, in a subsequent - * call, the permission may be removed. - * - * @return the isEnabled value. - */ - public Boolean isEnabled() { - return this.isEnabled; - } - - /** - * Set the isEnabled property: When creating or updating a permission, this property must be set to true (which is - * the default). To delete a permission, this property must first be set to false. At that point, in a subsequent - * call, the permission may be removed. - * - * @param isEnabled the isEnabled value to set. - * @return the OAuth2Permission object itself. - */ - public OAuth2Permission withIsEnabled(Boolean isEnabled) { - this.isEnabled = isEnabled; - return this; - } - - /** - * Get the type property: Specifies whether this scope permission can be consented to by an end user, or whether it - * is a tenant-wide permission that must be consented to by a Company Administrator. Possible values are "User" or - * "Admin". - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Set the type property: Specifies whether this scope permission can be consented to by an end user, or whether it - * is a tenant-wide permission that must be consented to by a Company Administrator. Possible values are "User" or - * "Admin". - * - * @param type the type value to set. - * @return the OAuth2Permission object itself. - */ - public OAuth2Permission withType(String type) { - this.type = type; - return this; - } - - /** - * Get the userConsentDescription property: Permission help text that appears in the end user consent experience. - * - * @return the userConsentDescription value. - */ - public String userConsentDescription() { - return this.userConsentDescription; - } - - /** - * Set the userConsentDescription property: Permission help text that appears in the end user consent experience. - * - * @param userConsentDescription the userConsentDescription value to set. - * @return the OAuth2Permission object itself. - */ - public OAuth2Permission withUserConsentDescription(String userConsentDescription) { - this.userConsentDescription = userConsentDescription; - return this; - } - - /** - * Get the userConsentDisplayName property: Display name for the permission that appears in the end user consent - * experience. - * - * @return the userConsentDisplayName value. - */ - public String userConsentDisplayName() { - return this.userConsentDisplayName; - } - - /** - * Set the userConsentDisplayName property: Display name for the permission that appears in the end user consent - * experience. - * - * @param userConsentDisplayName the userConsentDisplayName value to set. - * @return the OAuth2Permission object itself. - */ - public OAuth2Permission withUserConsentDisplayName(String userConsentDisplayName) { - this.userConsentDisplayName = userConsentDisplayName; - return this; - } - - /** - * Get the value property: The value of the scope claim that the resource application should expect in the OAuth 2.0 - * access token. - * - * @return the value value. - */ - public String value() { - return this.value; - } - - /** - * Set the value property: The value of the scope claim that the resource application should expect in the OAuth 2.0 - * access token. - * - * @param value the value value to set. - * @return the OAuth2Permission object itself. - */ - public OAuth2Permission withValue(String value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/OAuth2PermissionGrantListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/OAuth2PermissionGrantListResult.java deleted file mode 100644 index dfe669e66010..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/OAuth2PermissionGrantListResult.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.authorization.fluent.models.OAuth2PermissionGrantInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Server response for get oauth2 permissions grants. */ -@Fluent -public final class OAuth2PermissionGrantListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OAuth2PermissionGrantListResult.class); - - /* - * the list of oauth2 permissions grants - */ - @JsonProperty(value = "value") - private List value; - - /* - * the URL to get the next set of results. - */ - @JsonProperty(value = "odata.nextLink") - private String odataNextLink; - - /** - * Get the value property: the list of oauth2 permissions grants. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: the list of oauth2 permissions grants. - * - * @param value the value value to set. - * @return the OAuth2PermissionGrantListResult object itself. - */ - public OAuth2PermissionGrantListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the odataNextLink property: the URL to get the next set of results. - * - * @return the odataNextLink value. - */ - public String odataNextLink() { - return this.odataNextLink; - } - - /** - * Set the odataNextLink property: the URL to get the next set of results. - * - * @param odataNextLink the odataNextLink value to set. - * @return the OAuth2PermissionGrantListResult object itself. - */ - public OAuth2PermissionGrantListResult withOdataNextLink(String odataNextLink) { - this.odataNextLink = odataNextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/OptionalClaim.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/OptionalClaim.java deleted file mode 100644 index 7c1978ace0a6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/OptionalClaim.java +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Specifying the claims to be included in a token. */ -@Fluent -public final class OptionalClaim { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OptionalClaim.class); - - /* - * Claim name. - */ - @JsonProperty(value = "name") - private String name; - - /* - * Claim source. - */ - @JsonProperty(value = "source") - private String source; - - /* - * Is this a required claim. - */ - @JsonProperty(value = "essential") - private Boolean essential; - - /* - * Any object - */ - @JsonProperty(value = "additionalProperties") - private Object additionalProperties; - - /** - * Get the name property: Claim name. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Claim name. - * - * @param name the name value to set. - * @return the OptionalClaim object itself. - */ - public OptionalClaim withName(String name) { - this.name = name; - return this; - } - - /** - * Get the source property: Claim source. - * - * @return the source value. - */ - public String source() { - return this.source; - } - - /** - * Set the source property: Claim source. - * - * @param source the source value to set. - * @return the OptionalClaim object itself. - */ - public OptionalClaim withSource(String source) { - this.source = source; - return this; - } - - /** - * Get the essential property: Is this a required claim. - * - * @return the essential value. - */ - public Boolean essential() { - return this.essential; - } - - /** - * Set the essential property: Is this a required claim. - * - * @param essential the essential value to set. - * @return the OptionalClaim object itself. - */ - public OptionalClaim withEssential(Boolean essential) { - this.essential = essential; - return this; - } - - /** - * Get the additionalProperties property: Any object. - * - * @return the additionalProperties value. - */ - public Object additionalProperties() { - return this.additionalProperties; - } - - /** - * Set the additionalProperties property: Any object. - * - * @param additionalProperties the additionalProperties value to set. - * @return the OptionalClaim object itself. - */ - public OptionalClaim withAdditionalProperties(Object additionalProperties) { - this.additionalProperties = additionalProperties; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/OptionalClaims.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/OptionalClaims.java deleted file mode 100644 index eb09bfa0e74b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/OptionalClaims.java +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Specifying the claims to be included in the token. */ -@Fluent -public final class OptionalClaims { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OptionalClaims.class); - - /* - * Optional claims requested to be included in the id token. - */ - @JsonProperty(value = "idToken") - private List idToken; - - /* - * Optional claims requested to be included in the access token. - */ - @JsonProperty(value = "accessToken") - private List accessToken; - - /* - * Optional claims requested to be included in the saml token. - */ - @JsonProperty(value = "samlToken") - private List samlToken; - - /** - * Get the idToken property: Optional claims requested to be included in the id token. - * - * @return the idToken value. - */ - public List idToken() { - return this.idToken; - } - - /** - * Set the idToken property: Optional claims requested to be included in the id token. - * - * @param idToken the idToken value to set. - * @return the OptionalClaims object itself. - */ - public OptionalClaims withIdToken(List idToken) { - this.idToken = idToken; - return this; - } - - /** - * Get the accessToken property: Optional claims requested to be included in the access token. - * - * @return the accessToken value. - */ - public List accessToken() { - return this.accessToken; - } - - /** - * Set the accessToken property: Optional claims requested to be included in the access token. - * - * @param accessToken the accessToken value to set. - * @return the OptionalClaims object itself. - */ - public OptionalClaims withAccessToken(List accessToken) { - this.accessToken = accessToken; - return this; - } - - /** - * Get the samlToken property: Optional claims requested to be included in the saml token. - * - * @return the samlToken value. - */ - public List samlToken() { - return this.samlToken; - } - - /** - * Set the samlToken property: Optional claims requested to be included in the saml token. - * - * @param samlToken the samlToken value to set. - * @return the OptionalClaims object itself. - */ - public OptionalClaims withSamlToken(List samlToken) { - this.samlToken = samlToken; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (idToken() != null) { - idToken().forEach(e -> e.validate()); - } - if (accessToken() != null) { - accessToken().forEach(e -> e.validate()); - } - if (samlToken() != null) { - samlToken().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/PasswordCredential.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/PasswordCredential.java deleted file mode 100644 index d39e488a334e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/PasswordCredential.java +++ /dev/null @@ -1,242 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.authorization.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.authorization.fluent.models.PasswordCredentialInner; -import com.azure.resourcemanager.resources.fluentcore.model.Attachable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import java.io.OutputStream; -import java.time.Duration; -import java.time.OffsetDateTime; - -/** An immutable client-side representation of an Azure AD credential. */ -@Fluent -public interface PasswordCredential extends Credential, HasInnerModel { - - /************************************************************** - * Fluent interfaces to attach a credential - **************************************************************/ - - /** - * The entirety of a credential definition. - * - * @param the return type of the final {@link Attachable#attach()} - */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithSubscriptionInAuthFile, - DefinitionStages.WithAttach { - } - - /** Grouping of credential definition stages applicable as part of a application or service principal creation. */ - interface DefinitionStages { - /** - * The first stage of a credential definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface Blank extends WithKey { - } - - /** - * The credential definition stage allowing the the password or certificate to be set. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithKey { - /** - * Use a password as a key. - * - * @param password the password value - * @return the next stage in credential definition - */ - WithAttach withPasswordValue(String password); - } - - /** - * The credential definition stage allowing start date to be set. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithStartDate { - /** - * Specifies the start date after which password or key would be valid. Default value is current time. - * - * @param startDate the start date for validity - * @return the next stage in credential definition - */ - WithAttach withStartDate(OffsetDateTime startDate); - } - - /** - * The credential definition stage allowing the duration of key validity to be set. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithDuration { - /** - * Specifies the duration for which password or key would be valid. Default value is 1 year. - * - * @param duration the duration of validity - * @return the next stage in credential definition - */ - WithAttach withDuration(Duration duration); - } - - /** - * A credential definition stage allowing exporting the auth file for the service principal. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithAuthFile { - /** - * Export the information of this service principal into an auth file. - * - * @param outputStream the output stream to export the file - * @return the next stage in credential definition - */ - WithSubscriptionInAuthFile withAuthFileToExport(OutputStream outputStream); - } - - /** - * A credential definition stage allowing the subscription in the auth file to be set. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithSubscriptionInAuthFile { - /** - * Specifies the "subscription=" field in the auth file. - * - * @param subscriptionId the UUID of the subscription - * @return the next stage in credential definition - */ - WithAttach withSubscriptionId(String subscriptionId); - } - - /** - * The final stage of the credential definition. - * - *

At this stage, more settings can be specified, or the credential definition can be attached to the parent - * application / service principal definition using {@link WithAttach#attach()}. - * - * @param the return type of {@link WithAttach#attach()} - */ - interface WithAttach - extends Attachable.InDefinition, - WithStartDate, - WithDuration, - WithAuthFile { - } - } - - /** - * The entirety of a credential definition as part of a application or service principal update. - * - * @param the return type of the final {@link UpdateDefinitionStages.WithAttach#attach()} - */ - interface UpdateDefinition - extends UpdateDefinitionStages.Blank, - UpdateDefinitionStages.WithSubscriptionInAuthFile, - UpdateDefinitionStages.WithAttach { - } - - /** Grouping of credential definition stages applicable as part of a application or service principal update. */ - interface UpdateDefinitionStages { - /** - * The first stage of a credential definition. - * - * @param the stage of the parent update to return to after attaching this definition - */ - interface Blank extends WithKey { - } - - /** - * The credential definition stage allowing the the password or certificate to be set. - * - * @param the stage of the parent update to return to after attaching this definition - */ - interface WithKey { - /** - * Use a password as a key. - * - * @param password the password value - * @return the next stage in credential definition - */ - WithAttach withPasswordValue(String password); - } - - /** - * The credential definition stage allowing start date to be set. - * - * @param the stage of the parent update to return to after attaching this definition - */ - interface WithStartDate { - /** - * Specifies the start date after which password or key would be valid. Default value is current time. - * - * @param startDate the start date for validity - * @return the next stage in credential definition - */ - WithAttach withStartDate(OffsetDateTime startDate); - } - - /** - * The credential definition stage allowing the duration of key validity to be set. - * - * @param the stage of the parent update to return to after attaching this definition - */ - interface WithDuration { - /** - * Specifies the duration for which password or key would be valid. Default value is 1 year. - * - * @param duration the duration of validity - * @return the next stage in credential definition - */ - WithAttach withDuration(Duration duration); - } - - /** - * A credential definition stage allowing exporting the auth file for the service principal. - * - * @param the stage of the parent update to return to after attaching this definition - */ - interface WithAuthFile { - /** - * Export the information of this service principal into an auth file. - * - * @param outputStream the output stream to export the file - * @return the next stage in credential definition - */ - WithSubscriptionInAuthFile withAuthFileToExport(OutputStream outputStream); - } - - /** - * A credential definition stage allowing the subscription in the auth file to be set. - * - * @param the stage of the parent update to return to after attaching this definition - */ - interface WithSubscriptionInAuthFile { - /** - * Specifies the "subscription=" field in the auth file. - * - * @param subscriptionId the UUID of the subscription - * @return the next stage in credential definition - */ - WithAttach withSubscriptionId(String subscriptionId); - } - - /** - * The final stage of the credential definition. - * - *

At this stage, more settings can be specified, or the credential definition can be attached to the parent - * application / service principal update using {@link WithAttach#attach()}. - * - * @param the return type of {@link WithAttach#attach()} - */ - interface WithAttach - extends Attachable.InUpdate, WithStartDate, WithDuration, WithAuthFile { - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/PasswordCredentialListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/PasswordCredentialListResult.java deleted file mode 100644 index 7103a2dacafe..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/PasswordCredentialListResult.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.authorization.fluent.models.PasswordCredentialInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** PasswordCredential list operation result. */ -@Fluent -public final class PasswordCredentialListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PasswordCredentialListResult.class); - - /* - * A collection of PasswordCredentials. - */ - @JsonProperty(value = "value") - private List value; - - /** - * Get the value property: A collection of PasswordCredentials. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: A collection of PasswordCredentials. - * - * @param value the value value to set. - * @return the PasswordCredentialListResult object itself. - */ - public PasswordCredentialListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/PasswordCredentialsUpdateParameters.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/PasswordCredentialsUpdateParameters.java deleted file mode 100644 index c3da6310fa9f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/PasswordCredentialsUpdateParameters.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.authorization.fluent.models.PasswordCredentialInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Request parameters for a PasswordCredentials update operation. */ -@Fluent -public final class PasswordCredentialsUpdateParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PasswordCredentialsUpdateParameters.class); - - /* - * A collection of PasswordCredentials. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /** - * Get the value property: A collection of PasswordCredentials. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: A collection of PasswordCredentials. - * - * @param value the value value to set. - * @return the PasswordCredentialsUpdateParameters object itself. - */ - public PasswordCredentialsUpdateParameters withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property value in model PasswordCredentialsUpdateParameters")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/PasswordProfile.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/PasswordProfile.java deleted file mode 100644 index aab48ed3ab84..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/PasswordProfile.java +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; -import java.util.Map; - -/** The password profile associated with a user. */ -@Fluent -public final class PasswordProfile { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PasswordProfile.class); - - /* - * Password - */ - @JsonProperty(value = "password", required = true) - private String password; - - /* - * Whether to force a password change on next login. - */ - @JsonProperty(value = "forceChangePasswordNextLogin") - private Boolean forceChangePasswordNextLogin; - - /* - * The password profile associated with a user. - */ - @JsonIgnore private Map additionalProperties; - - /** - * Get the password property: Password. - * - * @return the password value. - */ - public String password() { - return this.password; - } - - /** - * Set the password property: Password. - * - * @param password the password value to set. - * @return the PasswordProfile object itself. - */ - public PasswordProfile withPassword(String password) { - this.password = password; - return this; - } - - /** - * Get the forceChangePasswordNextLogin property: Whether to force a password change on next login. - * - * @return the forceChangePasswordNextLogin value. - */ - public Boolean forceChangePasswordNextLogin() { - return this.forceChangePasswordNextLogin; - } - - /** - * Set the forceChangePasswordNextLogin property: Whether to force a password change on next login. - * - * @param forceChangePasswordNextLogin the forceChangePasswordNextLogin value to set. - * @return the PasswordProfile object itself. - */ - public PasswordProfile withForceChangePasswordNextLogin(Boolean forceChangePasswordNextLogin) { - this.forceChangePasswordNextLogin = forceChangePasswordNextLogin; - return this; - } - - /** - * Get the additionalProperties property: The password profile associated with a user. - * - * @return the additionalProperties value. - */ - @JsonAnyGetter - public Map additionalProperties() { - return this.additionalProperties; - } - - /** - * Set the additionalProperties property: The password profile associated with a user. - * - * @param additionalProperties the additionalProperties value to set. - * @return the PasswordProfile object itself. - */ - public PasswordProfile withAdditionalProperties(Map additionalProperties) { - this.additionalProperties = additionalProperties; - return this; - } - - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (password() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property password in model PasswordProfile")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/Permission.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/Permission.java deleted file mode 100644 index 711f25474b13..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/Permission.java +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.authorization.models; - -import com.azure.resourcemanager.authorization.fluent.models.PermissionInner; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import java.util.List; - -/** An immutable client-side representation of a permission. */ -public interface Permission extends HasInnerModel { - /** @return allowed actions */ - List actions(); - - /** @return denied actions */ - List notActions(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/PermissionGetResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/PermissionGetResult.java deleted file mode 100644 index ba64f85e0df9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/PermissionGetResult.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.authorization.fluent.models.PermissionInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Permissions information. */ -@Fluent -public final class PermissionGetResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PermissionGetResult.class); - - /* - * An array of permissions. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to use for getting the next set of results. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: An array of permissions. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: An array of permissions. - * - * @param value the value value to set. - * @return the PermissionGetResult object itself. - */ - public PermissionGetResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to use for getting the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The URL to use for getting the next set of results. - * - * @param nextLink the nextLink value to set. - * @return the PermissionGetResult object itself. - */ - public PermissionGetResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/PreAuthorizedApplication.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/PreAuthorizedApplication.java deleted file mode 100644 index 6275de980718..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/PreAuthorizedApplication.java +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Contains information about pre authorized client application. */ -@Fluent -public final class PreAuthorizedApplication { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PreAuthorizedApplication.class); - - /* - * Represents the application id. - */ - @JsonProperty(value = "appId") - private String appId; - - /* - * Collection of required app permissions/entitlements from the resource - * application. - */ - @JsonProperty(value = "permissions") - private List permissions; - - /* - * Collection of extensions from the resource application. - */ - @JsonProperty(value = "extensions") - private List extensions; - - /** - * Get the appId property: Represents the application id. - * - * @return the appId value. - */ - public String appId() { - return this.appId; - } - - /** - * Set the appId property: Represents the application id. - * - * @param appId the appId value to set. - * @return the PreAuthorizedApplication object itself. - */ - public PreAuthorizedApplication withAppId(String appId) { - this.appId = appId; - return this; - } - - /** - * Get the permissions property: Collection of required app permissions/entitlements from the resource application. - * - * @return the permissions value. - */ - public List permissions() { - return this.permissions; - } - - /** - * Set the permissions property: Collection of required app permissions/entitlements from the resource application. - * - * @param permissions the permissions value to set. - * @return the PreAuthorizedApplication object itself. - */ - public PreAuthorizedApplication withPermissions(List permissions) { - this.permissions = permissions; - return this; - } - - /** - * Get the extensions property: Collection of extensions from the resource application. - * - * @return the extensions value. - */ - public List extensions() { - return this.extensions; - } - - /** - * Set the extensions property: Collection of extensions from the resource application. - * - * @param extensions the extensions value to set. - * @return the PreAuthorizedApplication object itself. - */ - public PreAuthorizedApplication withExtensions(List extensions) { - this.extensions = extensions; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (permissions() != null) { - permissions().forEach(e -> e.validate()); - } - if (extensions() != null) { - extensions().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/PreAuthorizedApplicationExtension.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/PreAuthorizedApplicationExtension.java deleted file mode 100644 index eb923356c350..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/PreAuthorizedApplicationExtension.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Representation of an app PreAuthorizedApplicationExtension required by a pre authorized client app. */ -@Fluent -public final class PreAuthorizedApplicationExtension { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PreAuthorizedApplicationExtension.class); - - /* - * The extension's conditions. - */ - @JsonProperty(value = "conditions") - private List conditions; - - /** - * Get the conditions property: The extension's conditions. - * - * @return the conditions value. - */ - public List conditions() { - return this.conditions; - } - - /** - * Set the conditions property: The extension's conditions. - * - * @param conditions the conditions value to set. - * @return the PreAuthorizedApplicationExtension object itself. - */ - public PreAuthorizedApplicationExtension withConditions(List conditions) { - this.conditions = conditions; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/PreAuthorizedApplicationPermission.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/PreAuthorizedApplicationPermission.java deleted file mode 100644 index 53dfedb0e4c3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/PreAuthorizedApplicationPermission.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Contains information about the pre-authorized permissions. */ -@Fluent -public final class PreAuthorizedApplicationPermission { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PreAuthorizedApplicationPermission.class); - - /* - * Indicates whether the permission set is DirectAccess or impersonation. - */ - @JsonProperty(value = "directAccessGrant") - private Boolean directAccessGrant; - - /* - * The list of permissions. - */ - @JsonProperty(value = "accessGrants") - private List accessGrants; - - /** - * Get the directAccessGrant property: Indicates whether the permission set is DirectAccess or impersonation. - * - * @return the directAccessGrant value. - */ - public Boolean directAccessGrant() { - return this.directAccessGrant; - } - - /** - * Set the directAccessGrant property: Indicates whether the permission set is DirectAccess or impersonation. - * - * @param directAccessGrant the directAccessGrant value to set. - * @return the PreAuthorizedApplicationPermission object itself. - */ - public PreAuthorizedApplicationPermission withDirectAccessGrant(Boolean directAccessGrant) { - this.directAccessGrant = directAccessGrant; - return this; - } - - /** - * Get the accessGrants property: The list of permissions. - * - * @return the accessGrants value. - */ - public List accessGrants() { - return this.accessGrants; - } - - /** - * Set the accessGrants property: The list of permissions. - * - * @param accessGrants the accessGrants value to set. - * @return the PreAuthorizedApplicationPermission object itself. - */ - public PreAuthorizedApplicationPermission withAccessGrants(List accessGrants) { - this.accessGrants = accessGrants; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ProviderOperation.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ProviderOperation.java deleted file mode 100644 index f213e6ada382..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ProviderOperation.java +++ /dev/null @@ -1,154 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Operation. */ -@Fluent -public final class ProviderOperation { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ProviderOperation.class); - - /* - * The operation name. - */ - @JsonProperty(value = "name") - private String name; - - /* - * The operation display name. - */ - @JsonProperty(value = "displayName") - private String displayName; - - /* - * The operation description. - */ - @JsonProperty(value = "description") - private String description; - - /* - * The operation origin. - */ - @JsonProperty(value = "origin") - private String origin; - - /* - * The operation properties. - */ - @JsonProperty(value = "properties") - private Object properties; - - /** - * Get the name property: The operation name. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The operation name. - * - * @param name the name value to set. - * @return the ProviderOperation object itself. - */ - public ProviderOperation withName(String name) { - this.name = name; - return this; - } - - /** - * Get the displayName property: The operation display name. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Set the displayName property: The operation display name. - * - * @param displayName the displayName value to set. - * @return the ProviderOperation object itself. - */ - public ProviderOperation withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - - /** - * Get the description property: The operation description. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: The operation description. - * - * @param description the description value to set. - * @return the ProviderOperation object itself. - */ - public ProviderOperation withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the origin property: The operation origin. - * - * @return the origin value. - */ - public String origin() { - return this.origin; - } - - /** - * Set the origin property: The operation origin. - * - * @param origin the origin value to set. - * @return the ProviderOperation object itself. - */ - public ProviderOperation withOrigin(String origin) { - this.origin = origin; - return this; - } - - /** - * Get the properties property: The operation properties. - * - * @return the properties value. - */ - public Object properties() { - return this.properties; - } - - /** - * Set the properties property: The operation properties. - * - * @param properties the properties value to set. - * @return the ProviderOperation object itself. - */ - public ProviderOperation withProperties(Object properties) { - this.properties = properties; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ProviderOperationsMetadataListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ProviderOperationsMetadataListResult.java deleted file mode 100644 index 393878e4946e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ProviderOperationsMetadataListResult.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.authorization.fluent.models.ProviderOperationsMetadataInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Provider operations metadata list. */ -@Fluent -public final class ProviderOperationsMetadataListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ProviderOperationsMetadataListResult.class); - - /* - * The list of providers. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to use for getting the next set of results. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: The list of providers. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The list of providers. - * - * @param value the value value to set. - * @return the ProviderOperationsMetadataListResult object itself. - */ - public ProviderOperationsMetadataListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to use for getting the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The URL to use for getting the next set of results. - * - * @param nextLink the nextLink value to set. - * @return the ProviderOperationsMetadataListResult object itself. - */ - public ProviderOperationsMetadataListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/RequiredResourceAccess.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/RequiredResourceAccess.java deleted file mode 100644 index d330c1364e21..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/RequiredResourceAccess.java +++ /dev/null @@ -1,148 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * Specifies the set of OAuth 2.0 permission scopes and app roles under the specified resource that an application - * requires access to. The specified OAuth 2.0 permission scopes may be requested by client applications (through the - * requiredResourceAccess collection) when calling a resource application. The requiredResourceAccess property of the - * Application entity is a collection of RequiredResourceAccess. - */ -@Fluent -public final class RequiredResourceAccess { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RequiredResourceAccess.class); - - /* - * The list of OAuth2.0 permission scopes and app roles that the - * application requires from the specified resource. - */ - @JsonProperty(value = "resourceAccess", required = true) - private List resourceAccess; - - /* - * The unique identifier for the resource that the application requires - * access to. This should be equal to the appId declared on the target - * resource application. - */ - @JsonProperty(value = "resourceAppId") - private String resourceAppId; - - /* - * Specifies the set of OAuth 2.0 permission scopes and app roles under the - * specified resource that an application requires access to. The specified - * OAuth 2.0 permission scopes may be requested by client applications - * (through the requiredResourceAccess collection) when calling a resource - * application. The requiredResourceAccess property of the Application - * entity is a collection of RequiredResourceAccess. - */ - @JsonIgnore private Map additionalProperties; - - /** - * Get the resourceAccess property: The list of OAuth2.0 permission scopes and app roles that the application - * requires from the specified resource. - * - * @return the resourceAccess value. - */ - public List resourceAccess() { - return this.resourceAccess; - } - - /** - * Set the resourceAccess property: The list of OAuth2.0 permission scopes and app roles that the application - * requires from the specified resource. - * - * @param resourceAccess the resourceAccess value to set. - * @return the RequiredResourceAccess object itself. - */ - public RequiredResourceAccess withResourceAccess(List resourceAccess) { - this.resourceAccess = resourceAccess; - return this; - } - - /** - * Get the resourceAppId property: The unique identifier for the resource that the application requires access to. - * This should be equal to the appId declared on the target resource application. - * - * @return the resourceAppId value. - */ - public String resourceAppId() { - return this.resourceAppId; - } - - /** - * Set the resourceAppId property: The unique identifier for the resource that the application requires access to. - * This should be equal to the appId declared on the target resource application. - * - * @param resourceAppId the resourceAppId value to set. - * @return the RequiredResourceAccess object itself. - */ - public RequiredResourceAccess withResourceAppId(String resourceAppId) { - this.resourceAppId = resourceAppId; - return this; - } - - /** - * Get the additionalProperties property: Specifies the set of OAuth 2.0 permission scopes and app roles under the - * specified resource that an application requires access to. The specified OAuth 2.0 permission scopes may be - * requested by client applications (through the requiredResourceAccess collection) when calling a resource - * application. The requiredResourceAccess property of the Application entity is a collection of - * RequiredResourceAccess. - * - * @return the additionalProperties value. - */ - @JsonAnyGetter - public Map additionalProperties() { - return this.additionalProperties; - } - - /** - * Set the additionalProperties property: Specifies the set of OAuth 2.0 permission scopes and app roles under the - * specified resource that an application requires access to. The specified OAuth 2.0 permission scopes may be - * requested by client applications (through the requiredResourceAccess collection) when calling a resource - * application. The requiredResourceAccess property of the Application entity is a collection of - * RequiredResourceAccess. - * - * @param additionalProperties the additionalProperties value to set. - * @return the RequiredResourceAccess object itself. - */ - public RequiredResourceAccess withAdditionalProperties(Map additionalProperties) { - this.additionalProperties = additionalProperties; - return this; - } - - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (resourceAccess() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property resourceAccess in model RequiredResourceAccess")); - } else { - resourceAccess().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ResourceAccess.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ResourceAccess.java deleted file mode 100644 index 7f1c50724872..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ResourceAccess.java +++ /dev/null @@ -1,132 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; -import java.util.Map; - -/** - * Specifies an OAuth 2.0 permission scope or an app role that an application requires. The resourceAccess property of - * the RequiredResourceAccess type is a collection of ResourceAccess. - */ -@Fluent -public final class ResourceAccess { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceAccess.class); - - /* - * The unique identifier for one of the OAuth2Permission or AppRole - * instances that the resource application exposes. - */ - @JsonProperty(value = "id", required = true) - private String id; - - /* - * Specifies whether the id property references an OAuth2Permission or an - * AppRole. Possible values are "scope" or "role". - */ - @JsonProperty(value = "type") - private String type; - - /* - * Specifies an OAuth 2.0 permission scope or an app role that an - * application requires. The resourceAccess property of the - * RequiredResourceAccess type is a collection of ResourceAccess. - */ - @JsonIgnore private Map additionalProperties; - - /** - * Get the id property: The unique identifier for one of the OAuth2Permission or AppRole instances that the resource - * application exposes. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: The unique identifier for one of the OAuth2Permission or AppRole instances that the resource - * application exposes. - * - * @param id the id value to set. - * @return the ResourceAccess object itself. - */ - public ResourceAccess withId(String id) { - this.id = id; - return this; - } - - /** - * Get the type property: Specifies whether the id property references an OAuth2Permission or an AppRole. Possible - * values are "scope" or "role". - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Set the type property: Specifies whether the id property references an OAuth2Permission or an AppRole. Possible - * values are "scope" or "role". - * - * @param type the type value to set. - * @return the ResourceAccess object itself. - */ - public ResourceAccess withType(String type) { - this.type = type; - return this; - } - - /** - * Get the additionalProperties property: Specifies an OAuth 2.0 permission scope or an app role that an application - * requires. The resourceAccess property of the RequiredResourceAccess type is a collection of ResourceAccess. - * - * @return the additionalProperties value. - */ - @JsonAnyGetter - public Map additionalProperties() { - return this.additionalProperties; - } - - /** - * Set the additionalProperties property: Specifies an OAuth 2.0 permission scope or an app role that an application - * requires. The resourceAccess property of the RequiredResourceAccess type is a collection of ResourceAccess. - * - * @param additionalProperties the additionalProperties value to set. - * @return the ResourceAccess object itself. - */ - public ResourceAccess withAdditionalProperties(Map additionalProperties) { - this.additionalProperties = additionalProperties; - return this; - } - - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (id() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property id in model ResourceAccess")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ResourceType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ResourceType.java deleted file mode 100644 index 38422aef574a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ResourceType.java +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Resource Type. */ -@Fluent -public final class ResourceType { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceType.class); - - /* - * The resource type name. - */ - @JsonProperty(value = "name") - private String name; - - /* - * The resource type display name. - */ - @JsonProperty(value = "displayName") - private String displayName; - - /* - * The resource type operations. - */ - @JsonProperty(value = "operations") - private List operations; - - /** - * Get the name property: The resource type name. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The resource type name. - * - * @param name the name value to set. - * @return the ResourceType object itself. - */ - public ResourceType withName(String name) { - this.name = name; - return this; - } - - /** - * Get the displayName property: The resource type display name. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Set the displayName property: The resource type display name. - * - * @param displayName the displayName value to set. - * @return the ResourceType object itself. - */ - public ResourceType withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - - /** - * Get the operations property: The resource type operations. - * - * @return the operations value. - */ - public List operations() { - return this.operations; - } - - /** - * Set the operations property: The resource type operations. - * - * @param operations the operations value to set. - * @return the ResourceType object itself. - */ - public ResourceType withOperations(List operations) { - this.operations = operations; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (operations() != null) { - operations().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/RoleAssignment.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/RoleAssignment.java deleted file mode 100644 index 388dfa0df7ce..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/RoleAssignment.java +++ /dev/null @@ -1,161 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.authorization.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.authorization.AuthorizationManager; -import com.azure.resourcemanager.authorization.fluent.models.RoleAssignmentInner; -import com.azure.resourcemanager.resources.models.ResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasId; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasName; -import com.azure.resourcemanager.resources.fluentcore.arm.models.Resource; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.model.Indexable; - -/** An immutable client-side representation of an Azure AD role assignment. */ -@Fluent -public interface RoleAssignment - extends Indexable, HasInnerModel, HasId, HasName, HasManager { - /** @return the role assignment scope */ - String scope(); - - /** @return the role definition ID */ - String roleDefinitionId(); - - /** @return the principal ID */ - String principalId(); - - /************************************************************** - * Fluent interfaces to provision an role assignment - **************************************************************/ - - /** Container interface for all the definitions that need to be implemented. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithRole, - DefinitionStages.WithScope, - DefinitionStages.WithCreate { - } - - /** Grouping of all the role assignment definition stages. */ - interface DefinitionStages { - /** The first stage of the role assignment definition. */ - interface Blank extends WithAssignee { - } - - /** The stage of role assignment definition allowing specifying the assignee information. */ - interface WithAssignee { - /** - * Specifies the assignee of the role assignment. - * - * @param objectId the object ID of an Active Directory identity - * @return the next stage in role assignment definition - */ - WithRole forObjectId(String objectId); - - /** - * Specifies the assignee of the role assignment to be a user. - * - * @param user the user object - * @return the next stage in role assignment definition - */ - WithRole forUser(ActiveDirectoryUser user); - - /** - * Specifies the assignee of the role assignment to be a user. - * - * @param name the user's user principal name, full display name, or email address - * @return the next stage in role assignment definition - */ - WithRole forUser(String name); - - /** - * Specifies the assignee of the role assignment to be a group. - * - * @param activeDirectoryGroup the user group - * @return the next stage in role assignment definition - */ - WithRole forGroup(ActiveDirectoryGroup activeDirectoryGroup); - - /** - * Specifies the assignee of the role assignment to be a service principal. - * - * @param servicePrincipal the service principal object - * @return the next stage in role assignment definition - */ - WithRole forServicePrincipal(ServicePrincipal servicePrincipal); - - /** - * Specifies the assignee of the role assignment to be a service principal. - * - * @param servicePrincipalName the service principal name - * @return the next stage in role assignment definition - */ - WithRole forServicePrincipal(String servicePrincipalName); - } - - /** The stage of role assignment definition allowing specifying the role. */ - interface WithRole { - /** - * Specifies the name of a built in role for this assignment. - * - * @param role the name of the role - * @return the next stage in role assignment definition - */ - WithScope withBuiltInRole(BuiltInRole role); - /** - * Specifies the ID of the custom role for this assignment. - * - * @param roleDefinitionId ID of the custom role definition - * @return the next stage in role assignment definition - */ - WithScope withRoleDefinition(String roleDefinitionId); - } - - /** The stage of role assignment definition allowing specifying the scope of the assignment. */ - interface WithScope { - /** - * Specifies the scope of the role assignment. The scope is usually the ID of a subscription, a resource - * group, a resource, etc. - * - * @param scope the scope of the assignment - * @return the next stage in role assignment definition - */ - WithCreate withScope(String scope); - - /** - * Specifies the scope of the role assignment to be a resource group. - * - * @param resourceGroup the resource group the assignee is assigned to access - * @return the next stage in role assignment definition - */ - WithCreate withResourceGroupScope(ResourceGroup resourceGroup); - - /** - * Specifies the scope of the role assignment to be a specific resource. - * - * @param resource the resource the assignee is assigned to access - * @return the next stage in role assignment definition - */ - WithCreate withResourceScope(Resource resource); - - /** - * Specifies the scope of the role assignment to be an entire subscription. - * - * @param subscriptionId the subscription the assignee is assigned to access - * @return the next stage in role assignment definition - */ - WithCreate withSubscriptionScope(String subscriptionId); - } - - /** - * An role assignment definition with sufficient inputs to create a new role assignment in the cloud, but - * exposing additional optional inputs to specify. - */ - interface WithCreate extends Creatable { - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/RoleAssignmentCreateParameters.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/RoleAssignmentCreateParameters.java deleted file mode 100644 index bfdf69b86aed..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/RoleAssignmentCreateParameters.java +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.authorization.fluent.models.RoleAssignmentProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Role assignment create parameters. */ -@Fluent -public final class RoleAssignmentCreateParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RoleAssignmentCreateParameters.class); - - /* - * Role assignment properties. - */ - @JsonProperty(value = "properties", required = true) - private RoleAssignmentProperties innerProperties = new RoleAssignmentProperties(); - - /** - * Get the innerProperties property: Role assignment properties. - * - * @return the innerProperties value. - */ - private RoleAssignmentProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the roleDefinitionId property: The role definition ID used in the role assignment. - * - * @return the roleDefinitionId value. - */ - public String roleDefinitionId() { - return this.innerProperties() == null ? null : this.innerProperties().roleDefinitionId(); - } - - /** - * Set the roleDefinitionId property: The role definition ID used in the role assignment. - * - * @param roleDefinitionId the roleDefinitionId value to set. - * @return the RoleAssignmentCreateParameters object itself. - */ - public RoleAssignmentCreateParameters withRoleDefinitionId(String roleDefinitionId) { - if (this.innerProperties() == null) { - this.innerProperties = new RoleAssignmentProperties(); - } - this.innerProperties().withRoleDefinitionId(roleDefinitionId); - return this; - } - - /** - * Get the principalId property: The principal ID assigned to the role. This maps to the ID inside the Active - * Directory. It can point to a user, service principal, or security group. - * - * @return the principalId value. - */ - public String principalId() { - return this.innerProperties() == null ? null : this.innerProperties().principalId(); - } - - /** - * Set the principalId property: The principal ID assigned to the role. This maps to the ID inside the Active - * Directory. It can point to a user, service principal, or security group. - * - * @param principalId the principalId value to set. - * @return the RoleAssignmentCreateParameters object itself. - */ - public RoleAssignmentCreateParameters withPrincipalId(String principalId) { - if (this.innerProperties() == null) { - this.innerProperties = new RoleAssignmentProperties(); - } - this.innerProperties().withPrincipalId(principalId); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property innerProperties in model RoleAssignmentCreateParameters")); - } else { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/RoleAssignmentListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/RoleAssignmentListResult.java deleted file mode 100644 index f2e70cac5749..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/RoleAssignmentListResult.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.authorization.fluent.models.RoleAssignmentInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Role assignment list operation result. */ -@Fluent -public final class RoleAssignmentListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RoleAssignmentListResult.class); - - /* - * Role assignment list. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to use for getting the next set of results. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: Role assignment list. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Role assignment list. - * - * @param value the value value to set. - * @return the RoleAssignmentListResult object itself. - */ - public RoleAssignmentListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to use for getting the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The URL to use for getting the next set of results. - * - * @param nextLink the nextLink value to set. - * @return the RoleAssignmentListResult object itself. - */ - public RoleAssignmentListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/RoleAssignments.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/RoleAssignments.java deleted file mode 100644 index e88f209a7a6a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/RoleAssignments.java +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.authorization.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.authorization.AuthorizationManager; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsBatchCreation; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsCreating; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingById; -import reactor.core.publisher.Mono; - -/** Entry point to role assignment management API. */ -@Fluent -public interface RoleAssignments - extends SupportsGettingById, - SupportsCreating, - SupportsBatchCreation, - SupportsDeletingById, - HasManager { - /** - * Gets the information about a role assignment based on scope and name. - * - * @param scope the scope of the role assignment - * @param name the name of the role assignment - * @return an immutable representation of the role assignment - */ - Mono getByScopeAsync(String scope, String name); - - /** - * Gets the information about a role assignment based on scope and name. - * - * @param scope the scope of the role assignment - * @param name the name of the role assignment - * @return an immutable representation of the role assignment - */ - RoleAssignment getByScope(String scope, String name); - - /** - * List role assignments in a scope. - * - * @param scope the scope of the role assignments - * @return a list of role assignments - */ - PagedFlux listByScopeAsync(String scope); - - /** - * List role assignments in a scope. - * - * @param scope the scope of the role assignments - * @return a list of role assignments - */ - PagedIterable listByScope(String scope); - - /** - * List role assignments for a service principal. - * - * @param servicePrincipal the service principal - * @return a list of role assignments - */ - PagedFlux listByServicePrincipalAsync(ServicePrincipal servicePrincipal); - - /** - * List role assignments for a service principal. - * - * @param servicePrincipal the service principal - * @return a list of role assignments - */ - PagedIterable listByServicePrincipal(ServicePrincipal servicePrincipal); - - - /** - * List role assignments for a service principal. - * - * @param principalId the ID of the service principal - * @return a list of role assignments - */ - PagedFlux listByServicePrincipalAsync(String principalId); - - /** - * List role assignments for a service principal. - * - * @param principalId the ID of the service principal - * @return a list of role assignments - */ - PagedIterable listByServicePrincipal(String principalId); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/RoleDefinition.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/RoleDefinition.java deleted file mode 100644 index 3d93b872a71e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/RoleDefinition.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.authorization.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.authorization.AuthorizationManager; -import com.azure.resourcemanager.authorization.fluent.models.RoleDefinitionInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasId; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasName; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import java.util.Set; - -/** An immutable client-side representation of an Azure AD role definition. */ -@Fluent -public interface RoleDefinition - extends HasInnerModel, HasId, HasName, HasManager { - /** @return the role name */ - String roleName(); - - /** @return the role definition description */ - String description(); - - /** @return the role type */ - String type(); - - /** @return role definition permissions */ - Set permissions(); - - /** @return role definition assignable scopes */ - Set assignableScopes(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/RoleDefinitionListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/RoleDefinitionListResult.java deleted file mode 100644 index 3710cbe538ab..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/RoleDefinitionListResult.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.authorization.fluent.models.RoleDefinitionInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Role definition list operation result. */ -@Fluent -public final class RoleDefinitionListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RoleDefinitionListResult.class); - - /* - * Role definition list. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to use for getting the next set of results. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: Role definition list. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Role definition list. - * - * @param value the value value to set. - * @return the RoleDefinitionListResult object itself. - */ - public RoleDefinitionListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to use for getting the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The URL to use for getting the next set of results. - * - * @param nextLink the nextLink value to set. - * @return the RoleDefinitionListResult object itself. - */ - public RoleDefinitionListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/RoleDefinitions.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/RoleDefinitions.java deleted file mode 100644 index 0e910c091dd8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/RoleDefinitions.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.authorization.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.authorization.AuthorizationManager; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import reactor.core.publisher.Mono; - -/** Entry point to role definition management API. */ -@Fluent -public interface RoleDefinitions - extends SupportsGettingById, HasManager { - /** - * Gets the information about a role definition based on scope and name. - * - * @param scope the scope of the role definition - * @param name the name of the role definition - * @return an immutable representation of the role definition - */ - Mono getByScopeAsync(String scope, String name); - - /** - * Gets the information about a role definition based on scope and name. - * - * @param scope the scope of the role definition - * @param name the name of the role definition - * @return an immutable representation of the role definition - */ - RoleDefinition getByScope(String scope, String name); - - /** - * Gets the information about a role definition based on scope and name. - * - * @param scope the scope of the role definition - * @param roleName the name of the role - * @return an immutable representation of the role definition - */ - Mono getByScopeAndRoleNameAsync(String scope, String roleName); - - /** - * Gets the information about a role definition based on scope and name. - * - * @param scope the scope of the role definition - * @param roleName the name of the role - * @return an immutable representation of the role definition - */ - RoleDefinition getByScopeAndRoleName(String scope, String roleName); - - /** - * List role definitions in a scope. - * - * @param scope the scope of the role definition - * @return an observable of role definitions - */ - PagedFlux listByScopeAsync(String scope); - - /** - * List role definitions in a scope. - * - * @param scope the scope of the role definition - * @return a list of role definitions - */ - PagedIterable listByScope(String scope); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ServicePrincipal.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ServicePrincipal.java deleted file mode 100644 index b76e6ce7227a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ServicePrincipal.java +++ /dev/null @@ -1,217 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.authorization.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.authorization.fluent.models.ServicePrincipalInner; -import com.azure.resourcemanager.resources.models.ResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.model.Appliable; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.model.Updatable; -import java.util.List; -import java.util.Map; -import java.util.Set; - -/** An immutable client-side representation of an Azure AD service principal. */ -@Fluent -public interface ServicePrincipal - extends ActiveDirectoryObject, HasInnerModel, Updatable { - /** @return app id. */ - String applicationId(); - - /** @return the list of names. */ - List servicePrincipalNames(); - - /** @return the mapping of password credentials from their names */ - Map passwordCredentials(); - - /** @return the mapping of certificate credentials from their names */ - Map certificateCredentials(); - - /** @return the mapping from scopes to role assignments */ - Set roleAssignments(); - - /************************************************************** - * Fluent interfaces to provision a service principal - **************************************************************/ - - /** Container interface for all the definitions that need to be implemented. */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithCreate { - } - - /** Grouping of all the service principal definition stages. */ - interface DefinitionStages { - /** The first stage of the service principal definition. */ - interface Blank extends WithApplication { - } - - /** A service principal definition allowing application to be specified. */ - interface WithApplication { - /** - * Specifies an existing application by its app ID. - * - * @param id the app ID of the application - * @return the next stage of the service principal definition - */ - WithCreate withExistingApplication(String id); - - /** - * Specifies an existing application to use by the service principal. - * - * @param application the application - * @return the next stage of the service principal definition - */ - WithCreate withExistingApplication(ActiveDirectoryApplication application); - - /** - * Specifies a new application to create and use by the service principal. - * - * @param applicationCreatable the new application's creatable - * @return the next stage of the service principal definition - */ - WithCreate withNewApplication(Creatable applicationCreatable); - - /** - * Specifies a new application to create and use by the service principal. - * - * @param signOnUrl the new application's sign on URL - * @return the next stage of the service principal definition - */ - WithCreate withNewApplication(String signOnUrl); - } - - /** A service principal definition allowing credentials to be specified. */ - interface WithCredential { - /** - * Starts the definition of a certificate credential. - * - * @param name the descriptive name of the certificate credential - * @return the first stage in certificate credential definition - */ - CertificateCredential.DefinitionStages.Blank defineCertificateCredential(String name); - - /** - * Starts the definition of a password credential. - * - * @param name the descriptive name of the password credential - * @return the first stage in password credential definition - */ - PasswordCredential.DefinitionStages.Blank definePasswordCredential(String name); - } - - /** A service principal definition allowing role assignments to be added. */ - interface WithRoleAssignment { - /** - * Assigns a new role to the service principal. - * - * @param role the role to assign to the service principal - * @param scope the scope the service principal can access - * @return the next stage of the service principal definition - */ - WithCreate withNewRole(BuiltInRole role, String scope); - - /** - * Assigns a new role to the service principal. - * - * @param role the role to assign to the service principal - * @param subscriptionId the subscription the service principal can access - * @return the next stage of the service principal definition - */ - WithCreate withNewRoleInSubscription(BuiltInRole role, String subscriptionId); - - /** - * Assigns a new role to the service principal. - * - * @param role the role to assign to the service principal - * @param resourceGroup the resource group the service principal can access - * @return the next stage of the service principal definition - */ - WithCreate withNewRoleInResourceGroup(BuiltInRole role, ResourceGroup resourceGroup); - } - - /** - * A service principal definition with sufficient inputs to create a new service principal in the cloud, but - * exposing additional optional inputs to specify. - */ - interface WithCreate extends Creatable, WithCredential, WithRoleAssignment { - } - } - - /** Grouping of all the service principal update stages. */ - interface UpdateStages { - /** A service principal update allowing credentials to be specified. */ - interface WithCredential { - /** - * Starts the definition of a certificate credential. - * - * @param name the descriptive name of the certificate credential - * @return the first stage in certificate credential update - */ - CertificateCredential.UpdateDefinitionStages.Blank - defineCertificateCredential(String name); - - /** - * Starts the definition of a password credential. - * - * @param name the descriptive name of the password credential - * @return the first stage in password credential update - */ - PasswordCredential.UpdateDefinitionStages.Blank definePasswordCredential(String name); - - /** - * Removes a credential. - * - * @param name the name of the credential - * @return the next stage of the service principal update - */ - Update withoutCredential(String name); - } - - /** A service principal update allowing role assignments to be added. */ - interface WithRoleAssignment { - /** - * Assigns a new role to the service principal. - * - * @param role the role to assign to the service principal - * @param scope the scope the service principal can access - * @return the next stage of the service principal update - */ - Update withNewRole(BuiltInRole role, String scope); - - /** - * Assigns a new role to the service principal. - * - * @param role the role to assign to the service principal - * @param subscriptionId the subscription the service principal can access - * @return the next stage of the service principal update - */ - Update withNewRoleInSubscription(BuiltInRole role, String subscriptionId); - - /** - * Assigns a new role to the service principal. - * - * @param role the role to assign to the service principal - * @param resourceGroup the resource group the service principal can access - * @return the next stage of the service principal update - */ - Update withNewRoleInResourceGroup(BuiltInRole role, ResourceGroup resourceGroup); - - /** - * Removes a role from the service principal. - * - * @param roleAssignment the role assignment to remove - * @return the next stage of the service principal update - */ - Update withoutRole(RoleAssignment roleAssignment); - } - } - - /** The template for a service principal update operation, containing all the settings that can be modified. */ - interface Update - extends Appliable, - ServicePrincipal.UpdateStages.WithCredential, - ServicePrincipal.UpdateStages.WithRoleAssignment { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ServicePrincipalBase.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ServicePrincipalBase.java deleted file mode 100644 index ebb9b5c414b1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ServicePrincipalBase.java +++ /dev/null @@ -1,196 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.authorization.fluent.models.KeyCredentialInner; -import com.azure.resourcemanager.authorization.fluent.models.PasswordCredentialInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Active Directory service principal common properties shared among GET, POST and PATCH. */ -@Fluent -public class ServicePrincipalBase { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ServicePrincipalBase.class); - - /* - * whether or not the service principal account is enabled - */ - @JsonProperty(value = "accountEnabled") - private Boolean accountEnabled; - - /* - * Specifies whether an AppRoleAssignment to a user or group is required - * before Azure AD will issue a user or access token to the application. - */ - @JsonProperty(value = "appRoleAssignmentRequired") - private Boolean appRoleAssignmentRequired; - - /* - * The collection of key credentials associated with the service principal. - */ - @JsonProperty(value = "keyCredentials") - private List keyCredentials; - - /* - * The collection of password credentials associated with the service - * principal. - */ - @JsonProperty(value = "passwordCredentials") - private List passwordCredentials; - - /* - * the type of the service principal - */ - @JsonProperty(value = "servicePrincipalType") - private String servicePrincipalType; - - /* - * Optional list of tags that you can apply to your service principals. Not - * nullable. - */ - @JsonProperty(value = "tags") - private List tags; - - /** - * Get the accountEnabled property: whether or not the service principal account is enabled. - * - * @return the accountEnabled value. - */ - public Boolean accountEnabled() { - return this.accountEnabled; - } - - /** - * Set the accountEnabled property: whether or not the service principal account is enabled. - * - * @param accountEnabled the accountEnabled value to set. - * @return the ServicePrincipalBase object itself. - */ - public ServicePrincipalBase withAccountEnabled(Boolean accountEnabled) { - this.accountEnabled = accountEnabled; - return this; - } - - /** - * Get the appRoleAssignmentRequired property: Specifies whether an AppRoleAssignment to a user or group is required - * before Azure AD will issue a user or access token to the application. - * - * @return the appRoleAssignmentRequired value. - */ - public Boolean appRoleAssignmentRequired() { - return this.appRoleAssignmentRequired; - } - - /** - * Set the appRoleAssignmentRequired property: Specifies whether an AppRoleAssignment to a user or group is required - * before Azure AD will issue a user or access token to the application. - * - * @param appRoleAssignmentRequired the appRoleAssignmentRequired value to set. - * @return the ServicePrincipalBase object itself. - */ - public ServicePrincipalBase withAppRoleAssignmentRequired(Boolean appRoleAssignmentRequired) { - this.appRoleAssignmentRequired = appRoleAssignmentRequired; - return this; - } - - /** - * Get the keyCredentials property: The collection of key credentials associated with the service principal. - * - * @return the keyCredentials value. - */ - public List keyCredentials() { - return this.keyCredentials; - } - - /** - * Set the keyCredentials property: The collection of key credentials associated with the service principal. - * - * @param keyCredentials the keyCredentials value to set. - * @return the ServicePrincipalBase object itself. - */ - public ServicePrincipalBase withKeyCredentials(List keyCredentials) { - this.keyCredentials = keyCredentials; - return this; - } - - /** - * Get the passwordCredentials property: The collection of password credentials associated with the service - * principal. - * - * @return the passwordCredentials value. - */ - public List passwordCredentials() { - return this.passwordCredentials; - } - - /** - * Set the passwordCredentials property: The collection of password credentials associated with the service - * principal. - * - * @param passwordCredentials the passwordCredentials value to set. - * @return the ServicePrincipalBase object itself. - */ - public ServicePrincipalBase withPasswordCredentials(List passwordCredentials) { - this.passwordCredentials = passwordCredentials; - return this; - } - - /** - * Get the servicePrincipalType property: the type of the service principal. - * - * @return the servicePrincipalType value. - */ - public String servicePrincipalType() { - return this.servicePrincipalType; - } - - /** - * Set the servicePrincipalType property: the type of the service principal. - * - * @param servicePrincipalType the servicePrincipalType value to set. - * @return the ServicePrincipalBase object itself. - */ - public ServicePrincipalBase withServicePrincipalType(String servicePrincipalType) { - this.servicePrincipalType = servicePrincipalType; - return this; - } - - /** - * Get the tags property: Optional list of tags that you can apply to your service principals. Not nullable. - * - * @return the tags value. - */ - public List tags() { - return this.tags; - } - - /** - * Set the tags property: Optional list of tags that you can apply to your service principals. Not nullable. - * - * @param tags the tags value to set. - * @return the ServicePrincipalBase object itself. - */ - public ServicePrincipalBase withTags(List tags) { - this.tags = tags; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (keyCredentials() != null) { - keyCredentials().forEach(e -> e.validate()); - } - if (passwordCredentials() != null) { - passwordCredentials().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ServicePrincipalCreateParameters.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ServicePrincipalCreateParameters.java deleted file mode 100644 index a53ab9a115c7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ServicePrincipalCreateParameters.java +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.authorization.fluent.models.KeyCredentialInner; -import com.azure.resourcemanager.authorization.fluent.models.PasswordCredentialInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Request parameters for creating a new service principal. */ -@Fluent -public final class ServicePrincipalCreateParameters extends ServicePrincipalBase { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ServicePrincipalCreateParameters.class); - - /* - * The application ID. - */ - @JsonProperty(value = "appId", required = true) - private String appId; - - /** - * Get the appId property: The application ID. - * - * @return the appId value. - */ - public String appId() { - return this.appId; - } - - /** - * Set the appId property: The application ID. - * - * @param appId the appId value to set. - * @return the ServicePrincipalCreateParameters object itself. - */ - public ServicePrincipalCreateParameters withAppId(String appId) { - this.appId = appId; - return this; - } - - /** {@inheritDoc} */ - @Override - public ServicePrincipalCreateParameters withAccountEnabled(Boolean accountEnabled) { - super.withAccountEnabled(accountEnabled); - return this; - } - - /** {@inheritDoc} */ - @Override - public ServicePrincipalCreateParameters withAppRoleAssignmentRequired(Boolean appRoleAssignmentRequired) { - super.withAppRoleAssignmentRequired(appRoleAssignmentRequired); - return this; - } - - /** {@inheritDoc} */ - @Override - public ServicePrincipalCreateParameters withKeyCredentials(List keyCredentials) { - super.withKeyCredentials(keyCredentials); - return this; - } - - /** {@inheritDoc} */ - @Override - public ServicePrincipalCreateParameters withPasswordCredentials(List passwordCredentials) { - super.withPasswordCredentials(passwordCredentials); - return this; - } - - /** {@inheritDoc} */ - @Override - public ServicePrincipalCreateParameters withServicePrincipalType(String servicePrincipalType) { - super.withServicePrincipalType(servicePrincipalType); - return this; - } - - /** {@inheritDoc} */ - @Override - public ServicePrincipalCreateParameters withTags(List tags) { - super.withTags(tags); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (appId() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property appId in model ServicePrincipalCreateParameters")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ServicePrincipalListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ServicePrincipalListResult.java deleted file mode 100644 index a364e6a40c97..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ServicePrincipalListResult.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.authorization.fluent.models.ServicePrincipalInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Server response for get tenant service principals API call. */ -@Fluent -public final class ServicePrincipalListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ServicePrincipalListResult.class); - - /* - * the list of service principals. - */ - @JsonProperty(value = "value") - private List value; - - /* - * the URL to get the next set of results. - */ - @JsonProperty(value = "odata.nextLink") - private String odataNextLink; - - /** - * Get the value property: the list of service principals. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: the list of service principals. - * - * @param value the value value to set. - * @return the ServicePrincipalListResult object itself. - */ - public ServicePrincipalListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the odataNextLink property: the URL to get the next set of results. - * - * @return the odataNextLink value. - */ - public String odataNextLink() { - return this.odataNextLink; - } - - /** - * Set the odataNextLink property: the URL to get the next set of results. - * - * @param odataNextLink the odataNextLink value to set. - * @return the ServicePrincipalListResult object itself. - */ - public ServicePrincipalListResult withOdataNextLink(String odataNextLink) { - this.odataNextLink = odataNextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ServicePrincipalUpdateParameters.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ServicePrincipalUpdateParameters.java deleted file mode 100644 index c4a1c8caf5e0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ServicePrincipalUpdateParameters.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.authorization.fluent.models.KeyCredentialInner; -import com.azure.resourcemanager.authorization.fluent.models.PasswordCredentialInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import java.util.List; - -/** Request parameters for update an existing service principal. */ -@Fluent -public final class ServicePrincipalUpdateParameters extends ServicePrincipalBase { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ServicePrincipalUpdateParameters.class); - - /** {@inheritDoc} */ - @Override - public ServicePrincipalUpdateParameters withAccountEnabled(Boolean accountEnabled) { - super.withAccountEnabled(accountEnabled); - return this; - } - - /** {@inheritDoc} */ - @Override - public ServicePrincipalUpdateParameters withAppRoleAssignmentRequired(Boolean appRoleAssignmentRequired) { - super.withAppRoleAssignmentRequired(appRoleAssignmentRequired); - return this; - } - - /** {@inheritDoc} */ - @Override - public ServicePrincipalUpdateParameters withKeyCredentials(List keyCredentials) { - super.withKeyCredentials(keyCredentials); - return this; - } - - /** {@inheritDoc} */ - @Override - public ServicePrincipalUpdateParameters withPasswordCredentials(List passwordCredentials) { - super.withPasswordCredentials(passwordCredentials); - return this; - } - - /** {@inheritDoc} */ - @Override - public ServicePrincipalUpdateParameters withServicePrincipalType(String servicePrincipalType) { - super.withServicePrincipalType(servicePrincipalType); - return this; - } - - /** {@inheritDoc} */ - @Override - public ServicePrincipalUpdateParameters withTags(List tags) { - super.withTags(tags); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ServicePrincipals.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ServicePrincipals.java deleted file mode 100644 index d264b9e4bda6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ServicePrincipals.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.authorization.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.authorization.AuthorizationManager; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingByName; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsCreating; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingById; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListingByFilter; - -/** Entry point to service principal management API. */ -@Fluent -public interface ServicePrincipals - extends SupportsListing, - SupportsListingByFilter, - SupportsGettingById, - SupportsGettingByName, - SupportsCreating, - SupportsDeletingById, - HasManager { -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/SignInName.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/SignInName.java deleted file mode 100644 index 185daaf47229..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/SignInName.java +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; -import java.util.Map; - -/** Contains information about a sign-in name of a local account user in an Azure Active Directory B2C tenant. */ -@Fluent -public final class SignInName { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SignInName.class); - - /* - * A string value that can be used to classify user sign-in types in your - * directory, such as 'emailAddress' or 'userName'. - */ - @JsonProperty(value = "type") - private String type; - - /* - * The sign-in used by the local account. Must be unique across the - * company/tenant. For example, 'johnc@example.com'. - */ - @JsonProperty(value = "value") - private String value; - - /* - * Contains information about a sign-in name of a local account user in an - * Azure Active Directory B2C tenant. - */ - @JsonIgnore private Map additionalProperties; - - /** - * Get the type property: A string value that can be used to classify user sign-in types in your directory, such as - * 'emailAddress' or 'userName'. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Set the type property: A string value that can be used to classify user sign-in types in your directory, such as - * 'emailAddress' or 'userName'. - * - * @param type the type value to set. - * @return the SignInName object itself. - */ - public SignInName withType(String type) { - this.type = type; - return this; - } - - /** - * Get the value property: The sign-in used by the local account. Must be unique across the company/tenant. For - * example, 'johnc@example.com'. - * - * @return the value value. - */ - public String value() { - return this.value; - } - - /** - * Set the value property: The sign-in used by the local account. Must be unique across the company/tenant. For - * example, 'johnc@example.com'. - * - * @param value the value value to set. - * @return the SignInName object itself. - */ - public SignInName withValue(String value) { - this.value = value; - return this; - } - - /** - * Get the additionalProperties property: Contains information about a sign-in name of a local account user in an - * Azure Active Directory B2C tenant. - * - * @return the additionalProperties value. - */ - @JsonAnyGetter - public Map additionalProperties() { - return this.additionalProperties; - } - - /** - * Set the additionalProperties property: Contains information about a sign-in name of a local account user in an - * Azure Active Directory B2C tenant. - * - * @param additionalProperties the additionalProperties value to set. - * @return the SignInName object itself. - */ - public SignInName withAdditionalProperties(Map additionalProperties) { - this.additionalProperties = additionalProperties; - return this; - } - - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/UserBase.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/UserBase.java deleted file mode 100644 index 379284a4440c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/UserBase.java +++ /dev/null @@ -1,209 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; -import java.util.Map; - -/** The UserBase model. */ -@Fluent -public class UserBase { - @JsonIgnore private final ClientLogger logger = new ClientLogger(UserBase.class); - - /* - * This must be specified if you are using a federated domain for the - * user's userPrincipalName (UPN) property when creating a new user - * account. It is used to associate an on-premises Active Directory user - * account with their Azure AD user object. - */ - @JsonProperty(value = "immutableId") - private String immutableId; - - /* - * A two letter country code (ISO standard 3166). Required for users that - * will be assigned licenses due to legal requirement to check for - * availability of services in countries. Examples include: "US", "JP", and - * "GB". - */ - @JsonProperty(value = "usageLocation") - private String usageLocation; - - /* - * The given name for the user. - */ - @JsonProperty(value = "givenName") - private String givenName; - - /* - * The user's surname (family name or last name). - */ - @JsonProperty(value = "surname") - private String surname; - - /* - * A string value that can be used to classify user types in your - * directory, such as 'Member' and 'Guest'. - */ - @JsonProperty(value = "userType") - private UserType userType; - - /* - * Dictionary of - */ - @JsonIgnore private Map additionalProperties; - - /** - * Get the immutableId property: This must be specified if you are using a federated domain for the user's - * userPrincipalName (UPN) property when creating a new user account. It is used to associate an on-premises Active - * Directory user account with their Azure AD user object. - * - * @return the immutableId value. - */ - public String immutableId() { - return this.immutableId; - } - - /** - * Set the immutableId property: This must be specified if you are using a federated domain for the user's - * userPrincipalName (UPN) property when creating a new user account. It is used to associate an on-premises Active - * Directory user account with their Azure AD user object. - * - * @param immutableId the immutableId value to set. - * @return the UserBase object itself. - */ - public UserBase withImmutableId(String immutableId) { - this.immutableId = immutableId; - return this; - } - - /** - * Get the usageLocation property: A two letter country code (ISO standard 3166). Required for users that will be - * assigned licenses due to legal requirement to check for availability of services in countries. Examples include: - * "US", "JP", and "GB". - * - * @return the usageLocation value. - */ - public String usageLocation() { - return this.usageLocation; - } - - /** - * Set the usageLocation property: A two letter country code (ISO standard 3166). Required for users that will be - * assigned licenses due to legal requirement to check for availability of services in countries. Examples include: - * "US", "JP", and "GB". - * - * @param usageLocation the usageLocation value to set. - * @return the UserBase object itself. - */ - public UserBase withUsageLocation(String usageLocation) { - this.usageLocation = usageLocation; - return this; - } - - /** - * Get the givenName property: The given name for the user. - * - * @return the givenName value. - */ - public String givenName() { - return this.givenName; - } - - /** - * Set the givenName property: The given name for the user. - * - * @param givenName the givenName value to set. - * @return the UserBase object itself. - */ - public UserBase withGivenName(String givenName) { - this.givenName = givenName; - return this; - } - - /** - * Get the surname property: The user's surname (family name or last name). - * - * @return the surname value. - */ - public String surname() { - return this.surname; - } - - /** - * Set the surname property: The user's surname (family name or last name). - * - * @param surname the surname value to set. - * @return the UserBase object itself. - */ - public UserBase withSurname(String surname) { - this.surname = surname; - return this; - } - - /** - * Get the userType property: A string value that can be used to classify user types in your directory, such as - * 'Member' and 'Guest'. - * - * @return the userType value. - */ - public UserType userType() { - return this.userType; - } - - /** - * Set the userType property: A string value that can be used to classify user types in your directory, such as - * 'Member' and 'Guest'. - * - * @param userType the userType value to set. - * @return the UserBase object itself. - */ - public UserBase withUserType(UserType userType) { - this.userType = userType; - return this; - } - - /** - * Get the additionalProperties property: Dictionary of <AnyObject>. - * - * @return the additionalProperties value. - */ - @JsonAnyGetter - public Map additionalProperties() { - return this.additionalProperties; - } - - /** - * Set the additionalProperties property: Dictionary of <AnyObject>. - * - * @param additionalProperties the additionalProperties value to set. - * @return the UserBase object itself. - */ - public UserBase withAdditionalProperties(Map additionalProperties) { - this.additionalProperties = additionalProperties; - return this; - } - - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/UserCreateParameters.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/UserCreateParameters.java deleted file mode 100644 index b592ab6ce03a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/UserCreateParameters.java +++ /dev/null @@ -1,246 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Request parameters for creating a new work or school account user. */ -@Fluent -public final class UserCreateParameters extends UserBase { - @JsonIgnore private final ClientLogger logger = new ClientLogger(UserCreateParameters.class); - - /* - * Whether the account is enabled. - */ - @JsonProperty(value = "accountEnabled", required = true) - private boolean accountEnabled; - - /* - * The display name of the user. - */ - @JsonProperty(value = "displayName", required = true) - private String displayName; - - /* - * Password Profile - */ - @JsonProperty(value = "passwordProfile", required = true) - private PasswordProfile passwordProfile; - - /* - * The user principal name (someuser@contoso.com). It must contain one of - * the verified domains for the tenant. - */ - @JsonProperty(value = "userPrincipalName", required = true) - private String userPrincipalName; - - /* - * The mail alias for the user. - */ - @JsonProperty(value = "mailNickname", required = true) - private String mailNickname; - - /* - * The primary email address of the user. - */ - @JsonProperty(value = "mail") - private String mail; - - /** - * Get the accountEnabled property: Whether the account is enabled. - * - * @return the accountEnabled value. - */ - public boolean accountEnabled() { - return this.accountEnabled; - } - - /** - * Set the accountEnabled property: Whether the account is enabled. - * - * @param accountEnabled the accountEnabled value to set. - * @return the UserCreateParameters object itself. - */ - public UserCreateParameters withAccountEnabled(boolean accountEnabled) { - this.accountEnabled = accountEnabled; - return this; - } - - /** - * Get the displayName property: The display name of the user. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Set the displayName property: The display name of the user. - * - * @param displayName the displayName value to set. - * @return the UserCreateParameters object itself. - */ - public UserCreateParameters withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - - /** - * Get the passwordProfile property: Password Profile. - * - * @return the passwordProfile value. - */ - public PasswordProfile passwordProfile() { - return this.passwordProfile; - } - - /** - * Set the passwordProfile property: Password Profile. - * - * @param passwordProfile the passwordProfile value to set. - * @return the UserCreateParameters object itself. - */ - public UserCreateParameters withPasswordProfile(PasswordProfile passwordProfile) { - this.passwordProfile = passwordProfile; - return this; - } - - /** - * Get the userPrincipalName property: The user principal name (someuser@contoso.com). It must contain one of the - * verified domains for the tenant. - * - * @return the userPrincipalName value. - */ - public String userPrincipalName() { - return this.userPrincipalName; - } - - /** - * Set the userPrincipalName property: The user principal name (someuser@contoso.com). It must contain one of the - * verified domains for the tenant. - * - * @param userPrincipalName the userPrincipalName value to set. - * @return the UserCreateParameters object itself. - */ - public UserCreateParameters withUserPrincipalName(String userPrincipalName) { - this.userPrincipalName = userPrincipalName; - return this; - } - - /** - * Get the mailNickname property: The mail alias for the user. - * - * @return the mailNickname value. - */ - public String mailNickname() { - return this.mailNickname; - } - - /** - * Set the mailNickname property: The mail alias for the user. - * - * @param mailNickname the mailNickname value to set. - * @return the UserCreateParameters object itself. - */ - public UserCreateParameters withMailNickname(String mailNickname) { - this.mailNickname = mailNickname; - return this; - } - - /** - * Get the mail property: The primary email address of the user. - * - * @return the mail value. - */ - public String mail() { - return this.mail; - } - - /** - * Set the mail property: The primary email address of the user. - * - * @param mail the mail value to set. - * @return the UserCreateParameters object itself. - */ - public UserCreateParameters withMail(String mail) { - this.mail = mail; - return this; - } - - /** {@inheritDoc} */ - @Override - public UserCreateParameters withImmutableId(String immutableId) { - super.withImmutableId(immutableId); - return this; - } - - /** {@inheritDoc} */ - @Override - public UserCreateParameters withUsageLocation(String usageLocation) { - super.withUsageLocation(usageLocation); - return this; - } - - /** {@inheritDoc} */ - @Override - public UserCreateParameters withGivenName(String givenName) { - super.withGivenName(givenName); - return this; - } - - /** {@inheritDoc} */ - @Override - public UserCreateParameters withSurname(String surname) { - super.withSurname(surname); - return this; - } - - /** {@inheritDoc} */ - @Override - public UserCreateParameters withUserType(UserType userType) { - super.withUserType(userType); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (displayName() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property displayName in model UserCreateParameters")); - } - if (passwordProfile() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property passwordProfile in model UserCreateParameters")); - } else { - passwordProfile().validate(); - } - if (userPrincipalName() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property userPrincipalName in model UserCreateParameters")); - } - if (mailNickname() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property mailNickname in model UserCreateParameters")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/UserGetMemberGroupsParameters.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/UserGetMemberGroupsParameters.java deleted file mode 100644 index d82780203afb..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/UserGetMemberGroupsParameters.java +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; -import java.util.Map; - -/** Request parameters for GetMemberGroups API call. */ -@Fluent -public final class UserGetMemberGroupsParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(UserGetMemberGroupsParameters.class); - - /* - * If true, only membership in security-enabled groups should be checked. - * Otherwise, membership in all groups should be checked. - */ - @JsonProperty(value = "securityEnabledOnly", required = true) - private boolean securityEnabledOnly; - - /* - * Request parameters for GetMemberGroups API call. - */ - @JsonIgnore private Map additionalProperties; - - /** - * Get the securityEnabledOnly property: If true, only membership in security-enabled groups should be checked. - * Otherwise, membership in all groups should be checked. - * - * @return the securityEnabledOnly value. - */ - public boolean securityEnabledOnly() { - return this.securityEnabledOnly; - } - - /** - * Set the securityEnabledOnly property: If true, only membership in security-enabled groups should be checked. - * Otherwise, membership in all groups should be checked. - * - * @param securityEnabledOnly the securityEnabledOnly value to set. - * @return the UserGetMemberGroupsParameters object itself. - */ - public UserGetMemberGroupsParameters withSecurityEnabledOnly(boolean securityEnabledOnly) { - this.securityEnabledOnly = securityEnabledOnly; - return this; - } - - /** - * Get the additionalProperties property: Request parameters for GetMemberGroups API call. - * - * @return the additionalProperties value. - */ - @JsonAnyGetter - public Map additionalProperties() { - return this.additionalProperties; - } - - /** - * Set the additionalProperties property: Request parameters for GetMemberGroups API call. - * - * @param additionalProperties the additionalProperties value to set. - * @return the UserGetMemberGroupsParameters object itself. - */ - public UserGetMemberGroupsParameters withAdditionalProperties(Map additionalProperties) { - this.additionalProperties = additionalProperties; - return this; - } - - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/UserGetMemberGroupsResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/UserGetMemberGroupsResult.java deleted file mode 100644 index be44fccd8c68..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/UserGetMemberGroupsResult.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Server response for GetMemberGroups API call. */ -@Fluent -public final class UserGetMemberGroupsResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(UserGetMemberGroupsResult.class); - - /* - * A collection of group IDs of which the user is a member. - */ - @JsonProperty(value = "value") - private List value; - - /** - * Get the value property: A collection of group IDs of which the user is a member. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: A collection of group IDs of which the user is a member. - * - * @param value the value value to set. - * @return the UserGetMemberGroupsResult object itself. - */ - public UserGetMemberGroupsResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/UserListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/UserListResult.java deleted file mode 100644 index d609ac3fcebb..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/UserListResult.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.authorization.fluent.models.UserInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Server response for Get tenant users API call. */ -@Fluent -public final class UserListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(UserListResult.class); - - /* - * the list of users. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to get the next set of results. - */ - @JsonProperty(value = "odata.nextLink") - private String odataNextLink; - - /** - * Get the value property: the list of users. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: the list of users. - * - * @param value the value value to set. - * @return the UserListResult object itself. - */ - public UserListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the odataNextLink property: The URL to get the next set of results. - * - * @return the odataNextLink value. - */ - public String odataNextLink() { - return this.odataNextLink; - } - - /** - * Set the odataNextLink property: The URL to get the next set of results. - * - * @param odataNextLink the odataNextLink value to set. - * @return the UserListResult object itself. - */ - public UserListResult withOdataNextLink(String odataNextLink) { - this.odataNextLink = odataNextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/UserType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/UserType.java deleted file mode 100644 index d30266d578c1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/UserType.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for UserType. */ -public final class UserType extends ExpandableStringEnum { - /** Static value Member for UserType. */ - public static final UserType MEMBER = fromString("Member"); - - /** Static value Guest for UserType. */ - public static final UserType GUEST = fromString("Guest"); - - /** - * Creates or finds a UserType from its string representation. - * - * @param name a name to look for. - * @return the corresponding UserType. - */ - @JsonCreator - public static UserType fromString(String name) { - return fromString(name, UserType.class); - } - - /** @return known UserType values. */ - public static Collection values() { - return values(UserType.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/UserUpdateParameters.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/UserUpdateParameters.java deleted file mode 100644 index 065a6308cf10..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/UserUpdateParameters.java +++ /dev/null @@ -1,223 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.authorization.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Request parameters for updating an existing work or school account user. */ -@Fluent -public final class UserUpdateParameters extends UserBase { - @JsonIgnore private final ClientLogger logger = new ClientLogger(UserUpdateParameters.class); - - /* - * Whether the account is enabled. - */ - @JsonProperty(value = "accountEnabled") - private Boolean accountEnabled; - - /* - * The display name of the user. - */ - @JsonProperty(value = "displayName") - private String displayName; - - /* - * The password profile of the user. - */ - @JsonProperty(value = "passwordProfile") - private PasswordProfile passwordProfile; - - /* - * The user principal name (someuser@contoso.com). It must contain one of - * the verified domains for the tenant. - */ - @JsonProperty(value = "userPrincipalName") - private String userPrincipalName; - - /* - * The mail alias for the user. - */ - @JsonProperty(value = "mailNickname") - private String mailNickname; - - /* - * The primary email address of the user. - */ - @JsonProperty(value = "mail") - private String mail; - - /** - * Get the accountEnabled property: Whether the account is enabled. - * - * @return the accountEnabled value. - */ - public Boolean accountEnabled() { - return this.accountEnabled; - } - - /** - * Set the accountEnabled property: Whether the account is enabled. - * - * @param accountEnabled the accountEnabled value to set. - * @return the UserUpdateParameters object itself. - */ - public UserUpdateParameters withAccountEnabled(Boolean accountEnabled) { - this.accountEnabled = accountEnabled; - return this; - } - - /** - * Get the displayName property: The display name of the user. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Set the displayName property: The display name of the user. - * - * @param displayName the displayName value to set. - * @return the UserUpdateParameters object itself. - */ - public UserUpdateParameters withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - - /** - * Get the passwordProfile property: The password profile of the user. - * - * @return the passwordProfile value. - */ - public PasswordProfile passwordProfile() { - return this.passwordProfile; - } - - /** - * Set the passwordProfile property: The password profile of the user. - * - * @param passwordProfile the passwordProfile value to set. - * @return the UserUpdateParameters object itself. - */ - public UserUpdateParameters withPasswordProfile(PasswordProfile passwordProfile) { - this.passwordProfile = passwordProfile; - return this; - } - - /** - * Get the userPrincipalName property: The user principal name (someuser@contoso.com). It must contain one of the - * verified domains for the tenant. - * - * @return the userPrincipalName value. - */ - public String userPrincipalName() { - return this.userPrincipalName; - } - - /** - * Set the userPrincipalName property: The user principal name (someuser@contoso.com). It must contain one of the - * verified domains for the tenant. - * - * @param userPrincipalName the userPrincipalName value to set. - * @return the UserUpdateParameters object itself. - */ - public UserUpdateParameters withUserPrincipalName(String userPrincipalName) { - this.userPrincipalName = userPrincipalName; - return this; - } - - /** - * Get the mailNickname property: The mail alias for the user. - * - * @return the mailNickname value. - */ - public String mailNickname() { - return this.mailNickname; - } - - /** - * Set the mailNickname property: The mail alias for the user. - * - * @param mailNickname the mailNickname value to set. - * @return the UserUpdateParameters object itself. - */ - public UserUpdateParameters withMailNickname(String mailNickname) { - this.mailNickname = mailNickname; - return this; - } - - /** - * Get the mail property: The primary email address of the user. - * - * @return the mail value. - */ - public String mail() { - return this.mail; - } - - /** - * Set the mail property: The primary email address of the user. - * - * @param mail the mail value to set. - * @return the UserUpdateParameters object itself. - */ - public UserUpdateParameters withMail(String mail) { - this.mail = mail; - return this; - } - - /** {@inheritDoc} */ - @Override - public UserUpdateParameters withImmutableId(String immutableId) { - super.withImmutableId(immutableId); - return this; - } - - /** {@inheritDoc} */ - @Override - public UserUpdateParameters withUsageLocation(String usageLocation) { - super.withUsageLocation(usageLocation); - return this; - } - - /** {@inheritDoc} */ - @Override - public UserUpdateParameters withGivenName(String givenName) { - super.withGivenName(givenName); - return this; - } - - /** {@inheritDoc} */ - @Override - public UserUpdateParameters withSurname(String surname) { - super.withSurname(surname); - return this; - } - - /** {@inheritDoc} */ - @Override - public UserUpdateParameters withUserType(UserType userType) { - super.withUserType(userType); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (passwordProfile() != null) { - passwordProfile().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/package-info.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/package-info.java deleted file mode 100644 index 60211653ef78..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** Package containing the data models for GraphRbacManagementClient. The Graph RBAC Management Client. */ -package com.azure.resourcemanager.authorization.models; diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/package-info.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/package-info.java deleted file mode 100644 index f37210124623..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** Package containing the classes for GraphRbacManagementClient. The Graph RBAC Management Client. */ -package com.azure.resourcemanager.authorization; diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/utils/RoleAssignmentHelper.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/utils/RoleAssignmentHelper.java deleted file mode 100644 index 2ce03fa8d2d6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/utils/RoleAssignmentHelper.java +++ /dev/null @@ -1,258 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.authorization.utils; - -import com.azure.core.management.exception.ManagementException; -import com.azure.resourcemanager.authorization.AuthorizationManager; -import com.azure.resourcemanager.authorization.models.BuiltInRole; -import com.azure.resourcemanager.authorization.models.RoleAssignment; -import com.azure.resourcemanager.authorization.models.RoleDefinition; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceId; -import com.azure.resourcemanager.resources.fluentcore.dag.FunctionalTaskItem; -import com.azure.resourcemanager.resources.fluentcore.dag.TaskGroup; -import com.azure.resourcemanager.resources.fluentcore.model.Indexable; -import reactor.core.publisher.Mono; - -import java.util.Objects; -import java.util.function.Function; - -/** - * A utility class to operate on role assignments for a resource with service principal (object id). This type is used - * for internal implementations, client should not take dependency on this as the method signature and behaviour can - * change in future releases. - */ -public class RoleAssignmentHelper { - /** - * A type that provide the service principal id (object id) and ARM resource id of the resource for which role - * assignments needs to be done. - */ - public interface IdProvider { - /** @return the service principal id (object id) */ - String principalId(); - /** @return ARM resource id of the resource */ - String resourceId(); - } - - private static final String CURRENT_RESOURCE_GROUP_SCOPE = "CURRENT_RESOURCE_GROUP"; - - private final AuthorizationManager authorizationManager; - private final IdProvider idProvider; - private final TaskGroup preRunTaskGroup; - - /** - * Creates RoleAssignmentHelper. - * - * @param authorizationManager the graph rbac manager - * @param taskGroup the pre-run task group after which role assignments create/remove tasks should run - * @param idProvider the provider that provides service principal id and resource id - */ - public RoleAssignmentHelper( - final AuthorizationManager authorizationManager, TaskGroup taskGroup, IdProvider idProvider) { - this.authorizationManager = Objects.requireNonNull(authorizationManager); - this.idProvider = Objects.requireNonNull(idProvider); - this.preRunTaskGroup = Objects.requireNonNull(taskGroup); - } - - /** - * Specifies that applications running on an Azure service with this identity requires the given access role with - * scope of access limited to the current resource group that the identity resides. - * - * @param asRole access role to assigned to the identity - * @return RoleAssignmentHelper - */ - public RoleAssignmentHelper withAccessToCurrentResourceGroup(BuiltInRole asRole) { - return this.withAccessTo(CURRENT_RESOURCE_GROUP_SCOPE, asRole); - } - - /** - * Specifies that applications running on an Azure service with this identity requires the given access role with - * scope of access limited to the ARM resource identified by the resource ID specified in the scope parameter. - * - * @param scope scope of the access represented in ARM resource ID format - * @param asRole access role to assigned to the identity - * @return RoleAssignmentHelper - */ - public RoleAssignmentHelper withAccessTo(final String scope, final BuiltInRole asRole) { - FunctionalTaskItem creator = - cxt -> { - final String principalId = idProvider.principalId(); - if (principalId == null) { - return cxt.voidMono(); - } - final String roleAssignmentName = authorizationManager.internalContext().randomUuid(); - final String resourceScope; - if (scope.equals(CURRENT_RESOURCE_GROUP_SCOPE)) { - resourceScope = resourceGroupId(idProvider.resourceId()); - } else { - resourceScope = scope; - } - return authorizationManager - .roleAssignments() - .define(roleAssignmentName) - .forObjectId(principalId) - .withBuiltInRole(asRole) - .withScope(resourceScope) - .createAsync() - .cast(Indexable.class) - .onErrorResume( - throwable -> { - if (isRoleAssignmentExists(throwable)) { - return cxt.voidMono(); - } - return Mono.error(throwable); - }); - }; - this.preRunTaskGroup.addPostRunDependent(creator, authorizationManager.internalContext()); - return this; - } - - /** - * Specifies that applications running on an Azure service with this identity requires the given access role with - * scope of access limited to the current resource group that the identity resides. - * - * @param roleDefinitionId access role definition to assigned to the identity - * @return RoleAssignmentHelper - */ - public RoleAssignmentHelper withAccessToCurrentResourceGroup(String roleDefinitionId) { - return this.withAccessTo(CURRENT_RESOURCE_GROUP_SCOPE, roleDefinitionId); - } - - /** - * Specifies that applications running on an Azure service with this identity requires the access described in the - * given role definition with scope of access limited to an ARM resource. - * - * @param scope scope of the access represented in ARM resource ID format - * @param roleDefinitionId access role definition to assigned to the identity - * @return RoleAssignmentHelper - */ - public RoleAssignmentHelper withAccessTo(final String scope, final String roleDefinitionId) { - FunctionalTaskItem creator = - cxt -> { - final String principalId = idProvider.principalId(); - if (principalId == null) { - return cxt.voidMono(); - } - final String roleAssignmentName = authorizationManager.internalContext().randomUuid(); - final String resourceScope; - if (scope.equals(CURRENT_RESOURCE_GROUP_SCOPE)) { - resourceScope = resourceGroupId(idProvider.resourceId()); - } else { - resourceScope = scope; - } - return authorizationManager - .roleAssignments() - .define(roleAssignmentName) - .forObjectId(principalId) - .withRoleDefinition(roleDefinitionId) - .withScope(resourceScope) - .createAsync() - .cast(Indexable.class) - .onErrorResume( - throwable -> { - if (isRoleAssignmentExists(throwable)) { - return cxt.voidMono(); - } - return Mono.error(throwable); - }); - }; - this.preRunTaskGroup.addPostRunDependent(creator, authorizationManager.internalContext()); - return this; - } - - /** - * Specifies that an access role assigned to the identity should be removed. - * - * @param roleAssignment a role assigned to the identity - * @return RoleAssignmentHelper - */ - public RoleAssignmentHelper withoutAccessTo(final RoleAssignment roleAssignment) { - String principalId = roleAssignment.principalId(); - if (principalId == null || !principalId.equalsIgnoreCase(idProvider.principalId())) { - return this; - } - FunctionalTaskItem remover = - cxt -> authorizationManager.roleAssignments().deleteByIdAsync(roleAssignment.id()).then(cxt.voidMono()); - this.preRunTaskGroup.addPostRunDependent(remover); - return this; - } - - /** - * Specifies that an access role assigned to the identity should be removed. - * - * @param scope the scope of the role assignment - * @param asRole the role of the role assignment - * @return RoleAssignmentHelper - */ - public RoleAssignmentHelper withoutAccessTo(final String scope, final BuiltInRole asRole) { - FunctionalTaskItem remover = - cxt -> - authorizationManager - .roleDefinitions() - .getByScopeAndRoleNameAsync(scope, asRole.toString()) - .flatMap( - (Function>) - roleDefinition -> - authorizationManager - .roleAssignments() - .listByScopeAsync(scope) - .filter( - roleAssignment -> { - if (roleDefinition != null && roleAssignment != null) { - return roleAssignment - .roleDefinitionId() - .equalsIgnoreCase(roleDefinition.id()) - && roleAssignment - .principalId() - .equalsIgnoreCase(idProvider.principalId()); - } else { - return false; - } - }) - .last()) - .flatMap( - (Function>) - roleAssignment -> - authorizationManager - .roleAssignments() - .deleteByIdAsync(roleAssignment.id()) - .then(cxt.voidMono())); - this.preRunTaskGroup.addPostRunDependent(remover); - return this; - } - - /** - * This method returns ARM id of the resource group from the given ARM id of a resource in the resource group. - * - * @param id ARM id - * @return the ARM id of resource group - */ - private static String resourceGroupId(String id) { - final ResourceId resourceId = ResourceId.fromString(id); - final StringBuilder builder = new StringBuilder(); - builder - .append("/subscriptions/") - .append(resourceId.subscriptionId()) - .append("/resourceGroups/") - .append(resourceId.resourceGroupName()); - return builder.toString(); - } - - /** - * Checks whether the given exception indicates role assignment already exists or not. - * - * @param throwable the exception to check - * @return true if role assignment exists, false otherwise - */ - private static boolean isRoleAssignmentExists(Throwable throwable) { - if (throwable instanceof ManagementException) { - ManagementException exception = (ManagementException) throwable; - if (exception.getValue() != null - && exception.getValue().getCode() != null - && exception.getValue().getCode().equalsIgnoreCase("RoleAssignmentExists")) { - return true; - } - } - return false; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/utils/package-info.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/utils/package-info.java deleted file mode 100644 index 0024593f7ca4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/utils/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -/** - * This package contains utility classes for working with Azure authorization. - */ -package com.azure.resourcemanager.authorization.utils; diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/module-info.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/module-info.java deleted file mode 100644 index 7c08f2019abf..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/module-info.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -module com.azure.resourcemanager.authorization { - requires transitive com.azure.resourcemanager.resources; - - // export public APIs of authorization - exports com.azure.resourcemanager.authorization; - exports com.azure.resourcemanager.authorization.fluent; - exports com.azure.resourcemanager.authorization.fluent.models; - exports com.azure.resourcemanager.authorization.models; - exports com.azure.resourcemanager.authorization.utils; - - // open packages specifically for azure core and jackson - opens com.azure.resourcemanager.authorization.fluent.models to - com.azure.core, - com.fasterxml.jackson.databind; - opens com.azure.resourcemanager.authorization.models to - com.azure.core, - com.fasterxml.jackson.databind; -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/ReadmeSamples.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/ReadmeSamples.java deleted file mode 100644 index 362036bad8ec..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/ReadmeSamples.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.authorization; - -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpMethod; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.util.serializer.JacksonAdapter; -import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.identity.DefaultAzureCredentialBuilder; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.ArrayNode; - -import java.io.IOException; -import java.util.HashMap; - -public class ReadmeSamples { - - public void authenticate() { - // BEGIN: com.azure.resourcemanager.authorization.authenticate - String armEndpoint = "https://management.."; - AzureProfile profile = new AzureProfile(getAzureEnvironmentFromArmEndpoint(armEndpoint)); - TokenCredential credential = new DefaultAzureCredentialBuilder() - .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) - .build(); - AuthorizationManager manager = AuthorizationManager - .authenticate(credential, profile); - // END: com.azure.resourcemanager.authorization.authenticate - } - - // BEGIN: com.azure.resourcemanager.authorization.getazureenvironment - private static AzureEnvironment getAzureEnvironmentFromArmEndpoint(String armEndpoint) { - // Create HTTP client and request - HttpClient httpClient = HttpClient.createDefault(); - - HttpRequest request = new HttpRequest(HttpMethod.GET, - String.format("%s/metadata/endpoints?api-version=2019-10-01", armEndpoint)) - .setHeader("accept", "application/json"); - - // Execute the request and read the response - HttpResponse response = httpClient.send(request).block(); - if (response.getStatusCode() != 200) { - throw new RuntimeException("Failed : HTTP error code : " + response.getStatusCode()); - } - String body = response.getBodyAsString().block(); - try { - ArrayNode metadataArray = JacksonAdapter.createDefaultSerializerAdapter() - .deserialize(body, ArrayNode.class, SerializerEncoding.JSON); - - if (metadataArray == null || metadataArray.isEmpty()) { - throw new RuntimeException("Failed to find metadata : " + body); - } - - JsonNode metadata = metadataArray.iterator().next(); - AzureEnvironment azureEnvironment = new AzureEnvironment(new HashMap() { - { - put("managementEndpointUrl", metadata.at("/authentication/audiences/0").asText()); - put("resourceManagerEndpointUrl", armEndpoint); - put("galleryEndpointUrl", metadata.at("/gallery").asText()); - put("activeDirectoryEndpointUrl", metadata.at("/authentication/loginEndpoint").asText()); - put("activeDirectoryResourceId", metadata.at("/authentication/audiences/0").asText()); - put("activeDirectoryGraphResourceId", metadata.at("/graph").asText()); - put("storageEndpointSuffix", "." + metadata.at("/suffixes/storage").asText()); - put("keyVaultDnsSuffix", "." + metadata.at("/suffixes/keyVaultDns").asText()); - } - }); - return azureEnvironment; - } catch (IOException ioe) { - ioe.printStackTrace(); - throw new RuntimeException(ioe); - } - } - // END: com.azure.resourcemanager.authorization.getazureenvironment -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/test/java/com/azure/resourcemanager/authorization/ApplicationsTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/test/java/com/azure/resourcemanager/authorization/ApplicationsTests.java deleted file mode 100644 index 8d051385f7c0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/test/java/com/azure/resourcemanager/authorization/ApplicationsTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.authorization; - -import java.time.Duration; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.test.annotation.DoNotRecord; -import com.azure.resourcemanager.authorization.models.ActiveDirectoryApplication; -import com.azure.resourcemanager.test.utils.TestUtilities; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public class ApplicationsTests extends GraphRbacManagementTest { - @Test - public void canCRUDApplication() throws Exception { - String name = generateRandomResourceName("javasdkapp", 20); - - ActiveDirectoryApplication application = null; - try { - application = - authorizationManager - .applications() - .define(name) - .withSignOnUrl("http://easycreate.azure.com/" + name) - .definePasswordCredential("passwd") - .withPasswordValue("P@ssw0rd") - .withDuration(Duration.ofDays(700)) - .attach() - .defineCertificateCredential("cert") - .withAsymmetricX509Certificate() - .withPublicKey(readAllBytes(this.getClass().getResourceAsStream("/myTest.cer"))) - .withDuration(Duration.ofDays(100)) - .attach() - .create(); - System.out.println(application.id() + " - " + application.applicationId()); - Assertions.assertNotNull(application.id()); - Assertions.assertNotNull(application.applicationId()); - Assertions.assertEquals(name, application.name()); - Assertions.assertEquals(1, application.certificateCredentials().size()); - Assertions.assertEquals(1, application.passwordCredentials().size()); - Assertions.assertEquals(1, application.replyUrls().size()); - Assertions.assertEquals(1, application.identifierUris().size()); - Assertions.assertEquals("http://easycreate.azure.com/" + name, application.signOnUrl().toString()); - - application.update().withoutCredential("passwd").apply(); - System.out.println(application.id() + " - " + application.applicationId()); - Assertions.assertEquals(0, application.passwordCredentials().size()); - } finally { - if (application != null) { - authorizationManager.applications().deleteById(application.id()); - } - } - } - - @Test - @DoNotRecord - public void canListApplications() { - if (skipInPlayback()) { - return; - } - - PagedIterable applications = authorizationManager.applications().list(); - Assertions.assertTrue(TestUtilities.getSize(applications) > 0); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/test/java/com/azure/resourcemanager/authorization/GraphRbacManagementTest.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/test/java/com/azure/resourcemanager/authorization/GraphRbacManagementTest.java deleted file mode 100644 index 7fd3b81dc0b4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/test/java/com/azure/resourcemanager/authorization/GraphRbacManagementTest.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.authorization; - -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.policy.HttpLogOptions; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.resources.ResourceManager; -import com.azure.resourcemanager.resources.fluentcore.utils.HttpPipelineProvider; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import com.azure.resourcemanager.test.ResourceManagerTestBase; -import com.azure.resourcemanager.test.utils.TestDelayProvider; - -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.time.temporal.ChronoUnit; -import java.util.List; - -/** The base for storage manager tests. */ -public abstract class GraphRbacManagementTest extends ResourceManagerTestBase { - protected AuthorizationManager authorizationManager; - protected ResourceManager resourceManager; - - @Override - protected HttpPipeline buildHttpPipeline( - TokenCredential credential, - AzureProfile profile, - HttpLogOptions httpLogOptions, - List policies, - HttpClient httpClient) { - return HttpPipelineProvider.buildHttpPipeline( - credential, - profile, - null, - httpLogOptions, - null, - new RetryPolicy("Retry-After", ChronoUnit.SECONDS), - policies, - httpClient); - } - - @Override - protected void initializeClients(HttpPipeline httpPipeline, AzureProfile profile) { - ResourceManagerUtils.InternalRuntimeContext.setDelayProvider(new TestDelayProvider(!isPlaybackMode())); - authorizationManager = buildManager(AuthorizationManager.class, httpPipeline, profile); - resourceManager = buildManager(ResourceManager.class, httpPipeline, profile); - } - - - @Override - protected void cleanUpResources() { - } - - protected byte[] readAllBytes(InputStream inputStream) throws IOException { - ByteArrayOutputStream buffer = new ByteArrayOutputStream(); - int readValue; - byte[] data = new byte[0xFFFF]; - while ((readValue = inputStream.read(data, 0, data.length)) != -1) { - buffer.write(data, 0, readValue); - } - return buffer.toByteArray(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/test/java/com/azure/resourcemanager/authorization/GroupsTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/test/java/com/azure/resourcemanager/authorization/GroupsTests.java deleted file mode 100644 index daad4387321a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/test/java/com/azure/resourcemanager/authorization/GroupsTests.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.authorization; - -import com.azure.resourcemanager.authorization.models.ActiveDirectoryGroup; -import com.azure.resourcemanager.authorization.models.ActiveDirectoryObject; -import com.azure.resourcemanager.authorization.models.ActiveDirectoryUser; -import com.azure.resourcemanager.authorization.models.ServicePrincipal; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -import java.time.Duration; -import java.util.Iterator; -import java.util.List; - -public class GroupsTests extends GraphRbacManagementTest { - - @Test - public void canCRUDGroup() throws Exception { - String userName = generateRandomResourceName("user", 16); - String spName = generateRandomResourceName("sp", 16); - String group1Name = generateRandomResourceName("group", 16); - String group2Name = generateRandomResourceName("group", 16); - ActiveDirectoryUser user = null; - ServicePrincipal servicePrincipal = null; - ActiveDirectoryGroup group1 = null; - ActiveDirectoryGroup group2 = null; - try { - user = - authorizationManager - .users() - .define(userName) - .withEmailAlias(userName) - .withPassword(password()) - .create(); - servicePrincipal = - authorizationManager.servicePrincipals().define(spName).withNewApplication("https://" + spName).create(); - group1 = authorizationManager.groups().define(group1Name).withEmailAlias(group1Name).create(); - ResourceManagerUtils.sleep(Duration.ofSeconds(15)); - group2 = - authorizationManager - .groups() - .define(group2Name) - .withEmailAlias(group2Name) - .withMember(user.id()) - .withMember(servicePrincipal.id()) - .withMember(group1.id()) - .create(); - - Assertions.assertNotNull(group2); - Assertions.assertNotNull(group2.id()); - List members = group2.listMembers(); - Assertions.assertEquals(3, members.size()); - Iterator iterator = members.iterator(); - Assertions.assertNotNull(iterator.next().id()); - Assertions.assertNotNull(iterator.next().id()); - Assertions.assertNotNull(iterator.next().id()); - } finally { - if (servicePrincipal != null) { - authorizationManager.servicePrincipals().deleteById(servicePrincipal.id()); - } - // cannot delete users or groups from service principal - // if (user != null) { - // graphRbacManager.users().deleteById(user.id()); - // } - // if (group != null) { - // graphRbacManager.groups().deleteById(group.id()); - // } - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/test/java/com/azure/resourcemanager/authorization/RoleAssignmentTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/test/java/com/azure/resourcemanager/authorization/RoleAssignmentTests.java deleted file mode 100644 index 589148909391..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/test/java/com/azure/resourcemanager/authorization/RoleAssignmentTests.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.authorization; - -import com.azure.resourcemanager.authorization.models.BuiltInRole; -import com.azure.resourcemanager.authorization.models.RoleAssignment; -import com.azure.resourcemanager.authorization.models.ServicePrincipal; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -import java.time.Duration; -import java.util.List; -import java.util.stream.Collectors; - -public class RoleAssignmentTests extends GraphRbacManagementTest { - @Test - public void canCRUDRoleAssignment() throws Exception { - String roleAssignmentName = generateRandomUuid(); - String spName = generateRandomResourceName("sp", 20); - - ServicePrincipal sp = - authorizationManager.servicePrincipals().define(spName).withNewApplication("http://" + spName).create(); - - try { - ResourceManagerUtils.sleep(Duration.ofSeconds(15)); - - RoleAssignment roleAssignment = - authorizationManager - .roleAssignments() - .define(roleAssignmentName) - .forServicePrincipal(sp) - .withBuiltInRole(BuiltInRole.CONTRIBUTOR) - .withSubscriptionScope(resourceManager.subscriptionId()) - .create(); - - Assertions.assertNotNull(roleAssignment); - - List roleAssignments = authorizationManager.roleAssignments() - .listByServicePrincipal(sp.id()).stream().collect(Collectors.toList()); - - Assertions.assertEquals(1, roleAssignments.size()); - RoleAssignment roleAssignment1 = roleAssignments.iterator().next(); - Assertions.assertEquals(roleAssignment.id(), roleAssignment1.id()); - Assertions.assertEquals(roleAssignment.scope(), roleAssignment1.scope()); - Assertions.assertEquals(roleAssignment.roleDefinitionId(), roleAssignment1.roleDefinitionId()); - Assertions.assertEquals(roleAssignment.principalId(), roleAssignment1.principalId()); - } finally { - authorizationManager.servicePrincipals().deleteById(sp.id()); - authorizationManager - .applications() - .deleteById(authorizationManager.applications().getByName(sp.applicationId()).id()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/test/java/com/azure/resourcemanager/authorization/RoleDefinitionTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/test/java/com/azure/resourcemanager/authorization/RoleDefinitionTests.java deleted file mode 100644 index 58377c079a4e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/test/java/com/azure/resourcemanager/authorization/RoleDefinitionTests.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.authorization; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.authorization.models.RoleDefinition; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -import java.util.Locale; - -public class RoleDefinitionTests extends GraphRbacManagementTest { - @Test - public void canGetRoleByRoleName() throws Exception { - RoleDefinition roleDefinition = - authorizationManager - .roleDefinitions() - .getByScopeAndRoleName("subscriptions/" + resourceManager.subscriptionId(), "Contributor"); - Assertions.assertNotNull(roleDefinition); - Assertions.assertEquals("Contributor", roleDefinition.roleName()); - } - - @Test - @Disabled("Util to generate missing built-in role") - public void generateMissingRole() { - PagedIterable roleDefinitions = - authorizationManager.roleDefinitions().listByScope("subscriptions/" + resourceManager.subscriptionId()); - - StringBuilder sb = new StringBuilder(); - - roleDefinitions.stream() - //.filter(r -> r.roleName().startsWith("Storage")) - .forEach(r -> { - String roleEnumName = r.roleName().toUpperCase(Locale.ROOT).replaceAll(" ", "_"); - - sb.append("/** ").append(r.description()).append(". */").append(System.lineSeparator()) - .append("public static final BuiltInRole ").append(roleEnumName).append(" =").append(System.lineSeparator()) - .append(" BuiltInRole.fromString(\"").append(r.roleName()).append("\");").append(System.lineSeparator()); - }); - - System.out.print(sb.toString()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/test/java/com/azure/resourcemanager/authorization/ServicePrincipalsTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/test/java/com/azure/resourcemanager/authorization/ServicePrincipalsTests.java deleted file mode 100644 index 4bee8508ccfa..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/test/java/com/azure/resourcemanager/authorization/ServicePrincipalsTests.java +++ /dev/null @@ -1,152 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.authorization; - -import com.azure.identity.DefaultAzureCredentialBuilder; -import com.azure.resourcemanager.authorization.models.BuiltInRole; -import com.azure.resourcemanager.authorization.models.RoleAssignment; -import com.azure.resourcemanager.authorization.models.ServicePrincipal; -import com.azure.resourcemanager.resources.models.ResourceGroup; -import com.azure.core.management.Region; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import com.azure.resourcemanager.resources.ResourceManager; -import java.io.FileOutputStream; -import java.nio.file.Files; -import java.nio.file.Paths; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public class ServicePrincipalsTests extends GraphRbacManagementTest { - - @Test - public void canCRUDServicePrincipal() throws Exception { - String name = generateRandomResourceName("ssp", 21); - ServicePrincipal servicePrincipal = null; - try { - // Create - servicePrincipal = - authorizationManager - .servicePrincipals() - .define(name) - .withNewApplication("http://easycreate.azure.com/" + name) - .definePasswordCredential("sppass") - .withPasswordValue("StrongPass!12") - .attach() - .create(); - System - .out - .println(servicePrincipal.id() + " - " + String.join(",", servicePrincipal.servicePrincipalNames())); - Assertions.assertNotNull(servicePrincipal.id()); - Assertions.assertNotNull(servicePrincipal.applicationId()); - Assertions.assertEquals(2, servicePrincipal.servicePrincipalNames().size()); - Assertions.assertEquals(1, servicePrincipal.passwordCredentials().size()); - Assertions.assertEquals(0, servicePrincipal.certificateCredentials().size()); - - // Get - servicePrincipal = authorizationManager.servicePrincipals().getByName(name); - Assertions.assertNotNull(servicePrincipal); - Assertions.assertNotNull(servicePrincipal.applicationId()); - Assertions.assertEquals(2, servicePrincipal.servicePrincipalNames().size()); - Assertions.assertEquals(1, servicePrincipal.passwordCredentials().size()); - Assertions.assertEquals(0, servicePrincipal.certificateCredentials().size()); - - // Update - servicePrincipal - .update() - .withoutCredential("sppass") - .defineCertificateCredential("spcert") - .withAsymmetricX509Certificate() - .withPublicKey(readAllBytes(ServicePrincipalsTests.class.getResourceAsStream("/myTest.cer"))) - .withDuration(Duration.ofDays(1)) - .attach() - .apply(); - Assertions.assertNotNull(servicePrincipal); - Assertions.assertNotNull(servicePrincipal.applicationId()); - Assertions.assertEquals(2, servicePrincipal.servicePrincipalNames().size()); - Assertions.assertEquals(0, servicePrincipal.passwordCredentials().size()); - Assertions.assertEquals(1, servicePrincipal.certificateCredentials().size()); - } finally { - if (servicePrincipal != null) { - authorizationManager.servicePrincipals().deleteById(servicePrincipal.id()); - authorizationManager - .applications() - .deleteById(authorizationManager.applications().getByName(servicePrincipal.applicationId()).id()); - } - } - } - - @Test - @Disabled("Do not record - recorded JSON may contain auth info") - public void canCRUDServicePrincipalWithRole() throws Exception { - String name = generateRandomResourceName("ssp", 21); - String rgName = generateRandomResourceName("rg", 22); - ServicePrincipal servicePrincipal = null; - String authFile = "/Users/jianghlu/Downloads/graphtestapp.azureauth"; - String subscription = "0b1f6471-1bf0-4dda-aec3-cb9272f09590"; - try { - // Create - servicePrincipal = - authorizationManager - .servicePrincipals() - .define(name) - .withNewApplication("http://easycreate.azure.com/ansp/" + name) - .definePasswordCredential("sppass") - .withPasswordValue("StrongPass!12") - .attach() - .defineCertificateCredential("spcert") - .withAsymmetricX509Certificate() - .withPublicKey(Files.readAllBytes(Paths.get("/Users/jianghlu/Documents/code/certs/myserver.crt"))) - .withDuration(Duration.ofDays(7)) - .withAuthFileToExport(new FileOutputStream(authFile)) - .withPrivateKeyFile("/Users/jianghlu/Documents/code/certs/myserver.pfx") - .withPrivateKeyPassword("StrongPass!123") - .attach() - .withNewRoleInSubscription(BuiltInRole.CONTRIBUTOR, subscription) - .create(); - System - .out - .println(servicePrincipal.id() + " - " + String.join(",", servicePrincipal.servicePrincipalNames())); - Assertions.assertNotNull(servicePrincipal.id()); - Assertions.assertNotNull(servicePrincipal.applicationId()); - Assertions.assertEquals(2, servicePrincipal.servicePrincipalNames().size()); - - ResourceManagerUtils.sleep(Duration.ofSeconds(10)); - ResourceManager resourceManager = - ResourceManager - .authenticate(new DefaultAzureCredentialBuilder().build(), profile()) - .withSubscription(subscription); - ResourceGroup group = resourceManager.resourceGroups().define(rgName).withRegion(locationOrDefault(Region.US_WEST)).create(); - - // Update - RoleAssignment ra = servicePrincipal.roleAssignments().iterator().next(); - servicePrincipal - .update() - .withoutRole(ra) - .withNewRoleInResourceGroup(BuiltInRole.CONTRIBUTOR, group) - .apply(); - - ResourceManagerUtils.sleep(Duration.ofMinutes(2)); - Assertions.assertNotNull(resourceManager.resourceGroups().getByName(group.name())); - try { - resourceManager.resourceGroups().define(rgName + "2").withRegion(locationOrDefault(Region.US_WEST)).create(); - Assertions.fail(); - } catch (Exception e) { - // expected - } - } finally { - try { - authorizationManager.servicePrincipals().deleteById(servicePrincipal.id()); - } catch (Exception e) { - } - try { - authorizationManager - .applications() - .deleteById(authorizationManager.applications().getByName(servicePrincipal.applicationId()).id()); - } catch (Exception e) { - } - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/test/java/com/azure/resourcemanager/authorization/UsersTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/test/java/com/azure/resourcemanager/authorization/UsersTests.java deleted file mode 100644 index 5ab18cafc956..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/test/java/com/azure/resourcemanager/authorization/UsersTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.authorization; - -import com.azure.resourcemanager.authorization.models.ActiveDirectoryUser; -import com.azure.resourcemanager.resources.fluentcore.arm.CountryIsoCode; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public class UsersTests extends GraphRbacManagementTest { - @Test - @Disabled("Need a specific domain") - public void canGetUserByEmail() throws Exception { - ActiveDirectoryUser user = authorizationManager.users().getByName("admin@azuresdkteam.onmicrosoft.com"); - Assertions.assertEquals("Admin", user.name()); - } - - @Test - @Disabled("Need a specific domain") - public void canGetUserByForeignEmail() throws Exception { - ActiveDirectoryUser user = authorizationManager.users().getByName("jianghlu@microsoft.com"); - Assertions.assertEquals("Jianghao Lu", user.name()); - } - - @Test - @Disabled("Need a specific domain") - public void canGetUserByDisplayName() throws Exception { - ActiveDirectoryUser user = authorizationManager.users().getByName("Reader zero"); - Assertions.assertEquals("Reader zero", user.name()); - } - - @Test - public void canCreateUser() throws Exception { - String name = generateRandomResourceName("user", 16); - ActiveDirectoryUser user = - authorizationManager - .users() - .define("Automatic " + name) - .withEmailAlias(name) - .withPassword(password()) - .withPromptToChangePasswordOnLogin(true) - .create(); - - Assertions.assertNotNull(user); - Assertions.assertNotNull(user.id()); - } - - @Test - public void canUpdateUser() throws Exception { - String name = generateRandomResourceName("user", 16); - ActiveDirectoryUser user = - authorizationManager - .users() - .define("Test " + name) - .withEmailAlias(name) - .withPassword(password()) - .create(); - - user = user.update().withUsageLocation(CountryIsoCode.AUSTRALIA).apply(); - - Assertions.assertEquals(CountryIsoCode.AUSTRALIA, user.usageLocation()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/test/resources/junit-platform.properties b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/test/resources/junit-platform.properties deleted file mode 100644 index 202d099b3ee8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/test/resources/junit-platform.properties +++ /dev/null @@ -1,4 +0,0 @@ -junit.jupiter.execution.parallel.enabled=true -junit.jupiter.execution.parallel.mode.default=concurrent -junit.jupiter.execution.parallel.config.strategy=fixed -junit.jupiter.execution.parallel.config.fixed.parallelism=32 diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/test/resources/myTest.cer b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/test/resources/myTest.cer deleted file mode 100644 index 8ab238abf74f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/test/resources/myTest.cer +++ /dev/null @@ -1,17 +0,0 @@ ------BEGIN CERTIFICATE----- -MIICwTCCAamgAwIBAgIEJk52uDANBgkqhkiG9w0BAQsFADARMQ8wDQYDVQQDEwZt -eVRlc3QwHhcNMTYxMTEyMDExMzI2WhcNMjYxMTEwMDExMzI2WjARMQ8wDQYDVQQD -EwZteVRlc3QwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCbnzJF3c+/ -scbgRynsixxmWl3GdZiQHvoAcUbWeGdl1uo0RT6Xy8BCKdXCBQoYmxng3XbvSKdb -vPe2bkGT9A08qU8yUqT0bEIqW5FBgx5dEsw4Tx+n9p7QhJMaw6X54VuJUbyUp4DZ -vTle99n00jGHpt6TBwjoEI6sDOS7XnenY9YR1GXDcM3qWbvIWTrzJaqys1RgSbxg -cRILn885VZZLuuyjU6WhJQFfx/i3GXKT3ZP8rU3e6d7q0PjVAKyFwaMNVeU4VmDi -7knGhyC84IYo1OFKsAcSVCaxdSQbOGaexvFaj2jjoKfvY3dn4ioo3yIzSMJglfMA -HHX/xzTkx27lAgMBAAGjITAfMB0GA1UdDgQWBBSCQubqxdIPUu/PEWqRlSXpKLFu -qTANBgkqhkiG9w0BAQsFAAOCAQEACp6YCKt8FjkPunlCIJPVYxRYQ3st7G/JF2y9 -0EiPZW8LsB8QS/GPrchBaZdOi1SMLkDvS2Bz37unJK7YF6X/IXmgacCJJcNyWr/0 -IuDT4f0hu3T+Xyfe0TUxVIC4Cb8icw5IpF2EagVacERTZGB/u38Y77Fa3JRSx4wZ -nsHTmP4JSKuOxRZknDw5/gHGHfHr+9nycNJ7IHrYKKCEEgkhDUvUax3fN3TWyZap -R98S+RQaJ3rLaNiNqVjuGrbHjReQikTtZwCtlpM8VHoviyyTUE7xkekM2p4YhDpD -ZDN+i2OgUKsSKmDwrZTC732D0G7r80fl96ezNM9O7qh457ihVA== ------END CERTIFICATE----- diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/CHANGELOG.md b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/CHANGELOG.md deleted file mode 100644 index f31b076619f7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/CHANGELOG.md +++ /dev/null @@ -1,8 +0,0 @@ -# Release History - -## 1.0.0-hybrid (2022-01-12) - -- Azure Resource Manager Compute client library for Java (Hybrid) using API Profiles to allow building hybrid cloud solutions -that target both Azure and Azure Stack Hub. -- Supports api versions in the 2020-09-01-hybrid api profile -- Requires Azure Stack Update 2102+ diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/README.md b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/README.md deleted file mode 100644 index d7bacc5ab4ba..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/README.md +++ /dev/null @@ -1,135 +0,0 @@ -# Azure Resource Manager Compute client library for Java (Hybrid) - -Azure Resource Manager Compute client library for Java (Hybrid) using [API Profiles][api_profile] to allow building hybrid cloud solutions -that target both Azure and Azure Stack Hub. - -For documentation on how to use this package, please see [Azure Management Libraries for Java (Hybrid)][resourcemanagerhybrid_lib]. - -## Getting started - -### Prerequisites - -- [Java Development Kit (JDK)][jdk] with version 8 or above -- [Azure Subscription][azure_subscription] - -### Adding the package to your product - -```xml - - com.azure.resourcemanager - azure-resourcemanager-compute - 1.0.0-hybrid - -``` - -### Include the recommended packages - -Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. - -[Azure Identity][azure_identity] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation. - -### Authentication - -By default, Azure Active Directory token authentication depends on correct configure of following environment variables. - -- `AZURE_CLIENT_ID` for Azure client ID. -- `AZURE_TENANT_ID` for Azure tenant ID. -- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. - -In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`. - -With above configuration, `azure` client can be authenticated by following code: - -```java com.azure.resourcemanager.compute.authenticate -String armEndpoint = "https://management.."; -AzureProfile profile = new AzureProfile(getAzureEnvironmentFromArmEndpoint(armEndpoint)); -TokenCredential credential = new DefaultAzureCredentialBuilder() - .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) - .build(); -ComputeManager manager = ComputeManager - .authenticate(credential, profile); -``` - -Change `armEndpoint` to point to the Azure Resource Manager endpoint of your Azure Stack Hub. The azure environment's -properties above can be populated with the following example: - -```java com.azure.resourcemanager.compute.getazureenvironment -private static AzureEnvironment getAzureEnvironmentFromArmEndpoint(String armEndpoint) { - // Create HTTP client and request - HttpClient httpClient = HttpClient.createDefault(); - - HttpRequest request = new HttpRequest(HttpMethod.GET, - String.format("%s/metadata/endpoints?api-version=2019-10-01", armEndpoint)) - .setHeader("accept", "application/json"); - - // Execute the request and read the response - HttpResponse response = httpClient.send(request).block(); - if (response.getStatusCode() != 200) { - throw new RuntimeException("Failed : HTTP error code : " + response.getStatusCode()); - } - String body = response.getBodyAsString().block(); - try { - ArrayNode metadataArray = JacksonAdapter.createDefaultSerializerAdapter() - .deserialize(body, ArrayNode.class, SerializerEncoding.JSON); - - if (metadataArray == null || metadataArray.isEmpty()) { - throw new RuntimeException("Failed to find metadata : " + body); - } - - JsonNode metadata = metadataArray.iterator().next(); - AzureEnvironment azureEnvironment = new AzureEnvironment(new HashMap() { - { - put("managementEndpointUrl", metadata.at("/authentication/audiences/0").asText()); - put("resourceManagerEndpointUrl", armEndpoint); - put("galleryEndpointUrl", metadata.at("/gallery").asText()); - put("activeDirectoryEndpointUrl", metadata.at("/authentication/loginEndpoint").asText()); - put("activeDirectoryResourceId", metadata.at("/authentication/audiences/0").asText()); - put("activeDirectoryGraphResourceId", metadata.at("/graph").asText()); - put("storageEndpointSuffix", "." + metadata.at("/suffixes/storage").asText()); - put("keyVaultDnsSuffix", "." + metadata.at("/suffixes/keyVaultDns").asText()); - } - }); - return azureEnvironment; - } catch (IOException ioe) { - ioe.printStackTrace(); - throw new RuntimeException(ioe); - } -} -``` - -When targeting a hybrid solution to global Azure instead of your Azure Stack Hub, `AzureEnvironment.AZURE` can be used instead. - -See [Authentication][authenticate] for more options. - -## Key concepts - -See [API design][design] for general introduction on design and key concepts on Azure Management Libraries. - -## Examples - -See [Samples][sample] for code snippets and samples. - -## Troubleshooting - -## Next steps - -## Contributing - -For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). - -1. Fork it -1. Create your feature branch (`git checkout -b my-new-feature`) -1. Commit your changes (`git commit -am 'Add some feature'`) -1. Push to the branch (`git push origin my-new-feature`) -1. Create new Pull Request - - -[jdk]: https://learn.microsoft.com/java/azure/jdk/ -[azure_subscription]: https://azure.microsoft.com/free/ -[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity -[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty -[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md -[sample]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/SAMPLE.md -[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md -[api_profile]: https://learn.microsoft.com/azure-stack/user/azure-stack-version-profiles -[resourcemanagerhybrid_lib]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanagerhybrid diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/pom.xml b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/pom.xml deleted file mode 100644 index 7d8e5a76ec6d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/pom.xml +++ /dev/null @@ -1,197 +0,0 @@ - - - 4.0.0 - - com.azure - azure-client-sdk-parent - 1.7.0 - ../../parents/azure-client-sdk-parent - - - com.azure.resourcemanager - azure-resourcemanager-compute - 1.0.0-hybrid - jar - - Microsoft Azure SDK for Compute Management (Hybrid) - This package contains Microsoft Azure Compute Management Hybrid SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt - https://github.com/Azure/azure-sdk-for-java - - - - The MIT License (MIT) - http://opensource.org/licenses/MIT - repo - - - - - https://github.com/Azure/azure-sdk-for-java - scm:git:git@github.com:Azure/azure-sdk-for-java.git - HEAD - - - - - 0.10 - 0.10 - - - --add-exports com.azure.resourcemanager.resources/com.azure.resourcemanager.resources.fluentcore.arm.implementation=ALL-UNNAMED - --add-exports com.azure.resourcemanager.resources/com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation=ALL-UNNAMED - --add-exports com.azure.resourcemanager.resources/com.azure.resourcemanager.resources.fluentcore.arm.models.implementation=ALL-UNNAMED - --add-exports com.azure.resourcemanager.resources/com.azure.resourcemanager.resources.fluentcore.model.implementation=ALL-UNNAMED - - --add-opens com.azure.resourcemanager.authorization/com.azure.resourcemanager.authorization=ALL-UNNAMED - --add-opens com.azure.resourcemanager.msi/com.azure.resourcemanager.msi=ALL-UNNAMED - --add-opens com.azure.resourcemanager.network/com.azure.resourcemanager.network=ALL-UNNAMED - --add-opens com.azure.resourcemanager.compute/com.azure.resourcemanager.compute=ALL-UNNAMED - --add-opens com.azure.resourcemanager.resources/com.azure.resourcemanager.resources=ALL-UNNAMED - --add-opens com.azure.resourcemanager.resources/com.azure.resourcemanager.resources.fluentcore.arm=ALL-UNNAMED - --add-opens com.azure.resourcemanager.storage/com.azure.resourcemanager.storage=ALL-UNNAMED - --add-opens com.azure.core/com.azure.core.implementation.jackson=ALL-UNNAMED - - - - - - microsoft - Microsoft - - - - - - com.azure.resourcemanager - azure-resourcemanager-resources - 1.0.0-hybrid - - - com.azure.resourcemanager - azure-resourcemanager-storage - 1.0.0-hybrid - - - com.azure.resourcemanager - azure-resourcemanager-network - 1.0.0-hybrid - - - com.azure.resourcemanager - azure-resourcemanager-msi - 2.53.5 - - - com.azure.resourcemanager - azure-resourcemanager-authorization - 1.0.0-hybrid - - - org.slf4j - slf4j-simple - 1.7.36 - test - - - org.junit.jupiter - junit-jupiter-engine - 5.13.4 - test - - - org.junit.jupiter - junit-jupiter-api - 5.13.4 - test - - - com.azure - azure-core-http-netty - 1.16.2 - test - - - com.azure.resourcemanager - azure-resourcemanager-keyvault - 1.0.0-hybrid - test - - - com.azure - azure-storage-blob - 12.32.0 - test - - - com.fasterxml.jackson.core - jackson-core - - - - - com.jcraft - jsch - 0.1.55 - test - - - commons-io - commons-io - 2.17.0 - test - - - - - azure-mgmt-sdk-test-jar - - - !maven.test.skip - - - - - com.azure.resourcemanager - azure-resourcemanager-test - 1.0.0-hybrid - test - - - - - - - - org.apache.maven.plugins - maven-jar-plugin - 3.4.2 - - - - true - true - - - - - - - org.jacoco - jacoco-maven-plugin - 0.8.13 - - - com/azure/resourcemanager/**/fluent/**/* - com/azure/resourcemanager/**/models/**/* - com/azure/resourcemanager/**/implementation/*ClientImpl* - com/azure/resourcemanager/**/implementation/*ClientBuilder* - - - - - - diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/ComputeManager.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/ComputeManager.java deleted file mode 100644 index b6a5a399cf1a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/ComputeManager.java +++ /dev/null @@ -1,267 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute; - -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpPipeline; -import com.azure.resourcemanager.compute.fluent.ComputeManagementClient; -import com.azure.resourcemanager.compute.implementation.ComputeManagementClientBuilder; -import com.azure.resourcemanager.compute.implementation.AvailabilitySetsImpl; -import com.azure.resourcemanager.compute.implementation.ComputeSkusImpl; -import com.azure.resourcemanager.compute.implementation.ComputeUsagesImpl; -import com.azure.resourcemanager.compute.implementation.DisksImpl; -import com.azure.resourcemanager.compute.implementation.GalleriesImpl; -import com.azure.resourcemanager.compute.implementation.GalleryImageVersionsImpl; -import com.azure.resourcemanager.compute.implementation.GalleryImagesImpl; -import com.azure.resourcemanager.compute.implementation.SnapshotsImpl; -import com.azure.resourcemanager.compute.implementation.VirtualMachineCustomImagesImpl; -import com.azure.resourcemanager.compute.implementation.VirtualMachineExtensionImagesImpl; -import com.azure.resourcemanager.compute.implementation.VirtualMachineImagesImpl; -import com.azure.resourcemanager.compute.implementation.VirtualMachinePublishersImpl; -import com.azure.resourcemanager.compute.implementation.VirtualMachineScaleSetsImpl; -import com.azure.resourcemanager.compute.implementation.VirtualMachinesImpl; -import com.azure.resourcemanager.compute.models.AvailabilitySets; -import com.azure.resourcemanager.compute.models.ComputeSkus; -import com.azure.resourcemanager.compute.models.ComputeUsages; -import com.azure.resourcemanager.compute.models.Disks; -import com.azure.resourcemanager.compute.models.Galleries; -import com.azure.resourcemanager.compute.models.GalleryImageVersions; -import com.azure.resourcemanager.compute.models.GalleryImages; -import com.azure.resourcemanager.compute.models.Snapshots; -import com.azure.resourcemanager.compute.models.VirtualMachineCustomImages; -import com.azure.resourcemanager.compute.models.VirtualMachineExtensionImages; -import com.azure.resourcemanager.compute.models.VirtualMachineImages; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSets; -import com.azure.resourcemanager.compute.models.VirtualMachines; -import com.azure.resourcemanager.authorization.AuthorizationManager; -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.resources.fluentcore.arm.AzureConfigurable; -import com.azure.resourcemanager.resources.fluentcore.arm.implementation.AzureConfigurableImpl; -import com.azure.resourcemanager.resources.fluentcore.arm.Manager; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.resources.fluentcore.utils.HttpPipelineProvider; -import com.azure.resourcemanager.storage.StorageManager; - -import java.util.Objects; - -/** Entry point to Azure compute resource management. */ -public final class ComputeManager extends Manager { - // The service managers - private final StorageManager storageManager; - private final NetworkManager networkManager; - private final AuthorizationManager authorizationManager; - - // The collections - private AvailabilitySets availabilitySets; - private VirtualMachines virtualMachines; - private VirtualMachineImages virtualMachineImages; - private VirtualMachineExtensionImages virtualMachineExtensionImages; - private VirtualMachineScaleSets virtualMachineScaleSets; - private ComputeUsages computeUsages; - private VirtualMachineCustomImages virtualMachineCustomImages; - private Disks disks; - private Snapshots snapshots; - private ComputeSkus computeSkus; - private Galleries galleries; - private GalleryImages galleryImages; - private GalleryImageVersions galleryImageVersions; - - /** @return the storage manager */ - public StorageManager storageManager() { - return storageManager; - } - - /** @return the network manager */ - public NetworkManager networkManager() { - return networkManager; - } - - /** @return the authorization manager */ - public AuthorizationManager authorizationManager() { - return authorizationManager; - } - - /** - * Get a Configurable instance that can be used to create ComputeManager with optional configuration. - * - * @return Configurable - */ - public static Configurable configure() { - return new ComputeManager.ConfigurableImpl(); - } - - /** - * Creates an instance of ComputeManager that exposes Compute resource management API entry points. - * - * @param credential the credential to use - * @param profile the profile to use - * @return the ComputeManager - */ - public static ComputeManager authenticate(TokenCredential credential, AzureProfile profile) { - Objects.requireNonNull(credential, "'credential' cannot be null."); - Objects.requireNonNull(profile, "'profile' cannot be null."); - return authenticate(HttpPipelineProvider.buildHttpPipeline(credential, profile), profile); - } - - /** - * Creates an instance of ComputeManager that exposes Compute resource management API entry points. - * - * @param httpPipeline the HttpPipeline to be used for API calls. - * @param profile the profile to use - * @return the ComputeManager - */ - public static ComputeManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { - Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); - Objects.requireNonNull(profile, "'profile' cannot be null."); - return new ComputeManager(httpPipeline, profile); - } - - /** The interface allowing configurations to be set. */ - public interface Configurable extends AzureConfigurable { - /** - * Creates an instance of ComputeManager that exposes Compute resource management API entry points. - * - * @param credential the credential to use - * @param profile the profile to use - * @return the ComputeManager - */ - ComputeManager authenticate(TokenCredential credential, AzureProfile profile); - } - - /** The implementation for Configurable interface. */ - private static final class ConfigurableImpl extends AzureConfigurableImpl implements Configurable { - @Override - public ComputeManager authenticate(TokenCredential credential, AzureProfile profile) { - return ComputeManager.authenticate(buildHttpPipeline(credential, profile), profile); - } - } - - private ComputeManager(HttpPipeline httpPipeline, AzureProfile profile) { - super( - httpPipeline, - profile, - new ComputeManagementClientBuilder() - .pipeline(httpPipeline) - .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) - .subscriptionId(profile.getSubscriptionId()) - .buildClient()); - storageManager = StorageManager.authenticate(httpPipeline, profile); - networkManager = NetworkManager.authenticate(httpPipeline, profile); - authorizationManager = AuthorizationManager.authenticate(httpPipeline, profile); - } - - /** @return the availability set resource management API entry point */ - public AvailabilitySets availabilitySets() { - if (availabilitySets == null) { - availabilitySets = new AvailabilitySetsImpl(this); - } - return availabilitySets; - } - - /** @return the virtual machine resource management API entry point */ - public VirtualMachines virtualMachines() { - if (virtualMachines == null) { - virtualMachines = new VirtualMachinesImpl(this, storageManager, networkManager, authorizationManager); - } - return virtualMachines; - } - - /** @return the virtual machine image resource management API entry point */ - public VirtualMachineImages virtualMachineImages() { - if (virtualMachineImages == null) { - virtualMachineImages = - new VirtualMachineImagesImpl( - new VirtualMachinePublishersImpl( - this.serviceClient().getVirtualMachineImages(), - this.serviceClient().getVirtualMachineExtensionImages()), - this.serviceClient().getVirtualMachineImages()); - } - return virtualMachineImages; - } - - /** @return the virtual machine extension image resource management API entry point */ - public VirtualMachineExtensionImages virtualMachineExtensionImages() { - if (virtualMachineExtensionImages == null) { - virtualMachineExtensionImages = - new VirtualMachineExtensionImagesImpl( - new VirtualMachinePublishersImpl( - this.serviceClient().getVirtualMachineImages(), - this.serviceClient().getVirtualMachineExtensionImages())); - } - return virtualMachineExtensionImages; - } - - /** @return the virtual machine scale set resource management API entry point */ - public VirtualMachineScaleSets virtualMachineScaleSets() { - if (virtualMachineScaleSets == null) { - virtualMachineScaleSets = - new VirtualMachineScaleSetsImpl(this, storageManager, networkManager, this.authorizationManager); - } - return virtualMachineScaleSets; - } - - /** @return the compute resource usage management API entry point */ - public ComputeUsages usages() { - if (computeUsages == null) { - computeUsages = new ComputeUsagesImpl(this.serviceClient()); - } - return computeUsages; - } - - /** @return the virtual machine custom image management API entry point */ - public VirtualMachineCustomImages virtualMachineCustomImages() { - if (virtualMachineCustomImages == null) { - virtualMachineCustomImages = new VirtualMachineCustomImagesImpl(this); - } - return virtualMachineCustomImages; - } - - /** @return the managed disk management API entry point */ - public Disks disks() { - if (disks == null) { - disks = new DisksImpl(this); - } - return disks; - } - - /** @return the managed snapshot management API entry point */ - public Snapshots snapshots() { - if (snapshots == null) { - snapshots = new SnapshotsImpl(this); - } - return snapshots; - } - - /** @return the compute service SKU management API entry point */ - public ComputeSkus computeSkus() { - if (computeSkus == null) { - computeSkus = new ComputeSkusImpl(this); - } - return computeSkus; - } - - /** @return the compute service gallery management entry point */ - public Galleries galleries() { - if (galleries == null) { - galleries = new GalleriesImpl(this); - } - return galleries; - } - - /** @return the compute service gallery image management entry point */ - public GalleryImages galleryImages() { - if (galleryImages == null) { - galleryImages = new GalleryImagesImpl(this); - } - return galleryImages; - } - - /** @return the compute service gallery image version management entry point */ - public GalleryImageVersions galleryImageVersions() { - if (galleryImageVersions == null) { - galleryImageVersions = new GalleryImageVersionsImpl(this); - } - return galleryImageVersions; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/AvailabilitySetsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/AvailabilitySetsClient.java deleted file mode 100644 index dfa8577e5e11..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/AvailabilitySetsClient.java +++ /dev/null @@ -1,379 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.compute.fluent.models.AvailabilitySetInner; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineSizeInner; -import com.azure.resourcemanager.compute.models.AvailabilitySetUpdate; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in AvailabilitySetsClient. */ -public interface AvailabilitySetsClient - extends InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete { - /** - * Create or update an availability set. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName The name of the availability set. - * @param parameters Parameters supplied to the Create Availability Set operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the availability set that the virtual machine should be assigned to. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String availabilitySetName, AvailabilitySetInner parameters); - - /** - * Create or update an availability set. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName The name of the availability set. - * @param parameters Parameters supplied to the Create Availability Set operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the availability set that the virtual machine should be assigned to. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, String availabilitySetName, AvailabilitySetInner parameters); - - /** - * Create or update an availability set. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName The name of the availability set. - * @param parameters Parameters supplied to the Create Availability Set operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the availability set that the virtual machine should be assigned to. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AvailabilitySetInner createOrUpdate( - String resourceGroupName, String availabilitySetName, AvailabilitySetInner parameters); - - /** - * Create or update an availability set. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName The name of the availability set. - * @param parameters Parameters supplied to the Create Availability Set operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the availability set that the virtual machine should be assigned to. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, String availabilitySetName, AvailabilitySetInner parameters, Context context); - - /** - * Update an availability set. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName The name of the availability set. - * @param parameters Parameters supplied to the Update Availability Set operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the availability set that the virtual machine should be assigned to. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateWithResponseAsync( - String resourceGroupName, String availabilitySetName, AvailabilitySetUpdate parameters); - - /** - * Update an availability set. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName The name of the availability set. - * @param parameters Parameters supplied to the Update Availability Set operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the availability set that the virtual machine should be assigned to. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAsync( - String resourceGroupName, String availabilitySetName, AvailabilitySetUpdate parameters); - - /** - * Update an availability set. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName The name of the availability set. - * @param parameters Parameters supplied to the Update Availability Set operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the availability set that the virtual machine should be assigned to. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AvailabilitySetInner update(String resourceGroupName, String availabilitySetName, AvailabilitySetUpdate parameters); - - /** - * Update an availability set. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName The name of the availability set. - * @param parameters Parameters supplied to the Update Availability Set operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the availability set that the virtual machine should be assigned to. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String resourceGroupName, String availabilitySetName, AvailabilitySetUpdate parameters, Context context); - - /** - * Delete an availability set. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName The name of the availability set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteWithResponseAsync(String resourceGroupName, String availabilitySetName); - - /** - * Delete an availability set. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName The name of the availability set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String availabilitySetName); - - /** - * Delete an availability set. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName The name of the availability set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String availabilitySetName); - - /** - * Delete an availability set. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName The name of the availability set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String availabilitySetName, Context context); - - /** - * Retrieves information about an availability set. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName The name of the availability set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the availability set that the virtual machine should be assigned to. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String availabilitySetName); - - /** - * Retrieves information about an availability set. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName The name of the availability set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the availability set that the virtual machine should be assigned to. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync(String resourceGroupName, String availabilitySetName); - - /** - * Retrieves information about an availability set. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName The name of the availability set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the availability set that the virtual machine should be assigned to. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AvailabilitySetInner getByResourceGroup(String resourceGroupName, String availabilitySetName); - - /** - * Retrieves information about an availability set. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName The name of the availability set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the availability set that the virtual machine should be assigned to. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String availabilitySetName, Context context); - - /** - * Lists all availability sets in a subscription. - * - * @param expand The expand expression to apply to the operation. Allowed values are 'instanceView'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Availability Set operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String expand); - - /** - * Lists all availability sets in a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Availability Set operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Lists all availability sets in a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Availability Set operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Lists all availability sets in a subscription. - * - * @param expand The expand expression to apply to the operation. Allowed values are 'instanceView'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Availability Set operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String expand, Context context); - - /** - * Lists all availability sets in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Availability Set operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName); - - /** - * Lists all availability sets in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Availability Set operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Lists all availability sets in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Availability Set operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing - * availability set. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName The name of the availability set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Virtual Machine operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAvailableSizesAsync(String resourceGroupName, String availabilitySetName); - - /** - * Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing - * availability set. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName The name of the availability set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Virtual Machine operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listAvailableSizes(String resourceGroupName, String availabilitySetName); - - /** - * Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing - * availability set. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName The name of the availability set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Virtual Machine operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listAvailableSizes( - String resourceGroupName, String availabilitySetName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/ComputeManagementClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/ComputeManagementClient.java deleted file mode 100644 index 3f38d7a4ab03..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/ComputeManagementClient.java +++ /dev/null @@ -1,250 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent; - -import com.azure.core.http.HttpPipeline; -import java.time.Duration; - -/** The interface for ComputeManagementClient class. */ -public interface ComputeManagementClient { - /** - * Gets Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms - * part of the URI for every service call. - * - * @return the subscriptionId value. - */ - String getSubscriptionId(); - - /** - * Gets server parameter. - * - * @return the endpoint value. - */ - String getEndpoint(); - - /** - * Gets The HTTP pipeline to send requests through. - * - * @return the httpPipeline value. - */ - HttpPipeline getHttpPipeline(); - - /** - * Gets The default poll interval for long-running operation. - * - * @return the defaultPollInterval value. - */ - Duration getDefaultPollInterval(); - - /** - * Gets the OperationsClient object to access its operations. - * - * @return the OperationsClient object. - */ - OperationsClient getOperations(); - - /** - * Gets the AvailabilitySetsClient object to access its operations. - * - * @return the AvailabilitySetsClient object. - */ - AvailabilitySetsClient getAvailabilitySets(); - - /** - * Gets the ProximityPlacementGroupsClient object to access its operations. - * - * @return the ProximityPlacementGroupsClient object. - */ - ProximityPlacementGroupsClient getProximityPlacementGroups(); - - /** - * Gets the DedicatedHostGroupsClient object to access its operations. - * - * @return the DedicatedHostGroupsClient object. - */ - DedicatedHostGroupsClient getDedicatedHostGroups(); - - /** - * Gets the DedicatedHostsClient object to access its operations. - * - * @return the DedicatedHostsClient object. - */ - DedicatedHostsClient getDedicatedHosts(); - - /** - * Gets the SshPublicKeysClient object to access its operations. - * - * @return the SshPublicKeysClient object. - */ - SshPublicKeysClient getSshPublicKeys(); - - /** - * Gets the VirtualMachineExtensionImagesClient object to access its operations. - * - * @return the VirtualMachineExtensionImagesClient object. - */ - VirtualMachineExtensionImagesClient getVirtualMachineExtensionImages(); - - /** - * Gets the VirtualMachineExtensionsClient object to access its operations. - * - * @return the VirtualMachineExtensionsClient object. - */ - VirtualMachineExtensionsClient getVirtualMachineExtensions(); - - /** - * Gets the VirtualMachineImagesClient object to access its operations. - * - * @return the VirtualMachineImagesClient object. - */ - VirtualMachineImagesClient getVirtualMachineImages(); - - /** - * Gets the UsagesClient object to access its operations. - * - * @return the UsagesClient object. - */ - UsagesClient getUsages(); - - /** - * Gets the VirtualMachinesClient object to access its operations. - * - * @return the VirtualMachinesClient object. - */ - VirtualMachinesClient getVirtualMachines(); - - /** - * Gets the VirtualMachineSizesClient object to access its operations. - * - * @return the VirtualMachineSizesClient object. - */ - VirtualMachineSizesClient getVirtualMachineSizes(); - - /** - * Gets the ImagesClient object to access its operations. - * - * @return the ImagesClient object. - */ - ImagesClient getImages(); - - /** - * Gets the VirtualMachineScaleSetsClient object to access its operations. - * - * @return the VirtualMachineScaleSetsClient object. - */ - VirtualMachineScaleSetsClient getVirtualMachineScaleSets(); - - /** - * Gets the VirtualMachineScaleSetExtensionsClient object to access its operations. - * - * @return the VirtualMachineScaleSetExtensionsClient object. - */ - VirtualMachineScaleSetExtensionsClient getVirtualMachineScaleSetExtensions(); - - /** - * Gets the VirtualMachineScaleSetRollingUpgradesClient object to access its operations. - * - * @return the VirtualMachineScaleSetRollingUpgradesClient object. - */ - VirtualMachineScaleSetRollingUpgradesClient getVirtualMachineScaleSetRollingUpgrades(); - - /** - * Gets the VirtualMachineScaleSetVMExtensionsClient object to access its operations. - * - * @return the VirtualMachineScaleSetVMExtensionsClient object. - */ - VirtualMachineScaleSetVMExtensionsClient getVirtualMachineScaleSetVMExtensions(); - - /** - * Gets the VirtualMachineScaleSetVMsClient object to access its operations. - * - * @return the VirtualMachineScaleSetVMsClient object. - */ - VirtualMachineScaleSetVMsClient getVirtualMachineScaleSetVMs(); - - /** - * Gets the LogAnalyticsClient object to access its operations. - * - * @return the LogAnalyticsClient object. - */ - LogAnalyticsClient getLogAnalytics(); - - /** - * Gets the VirtualMachineRunCommandsClient object to access its operations. - * - * @return the VirtualMachineRunCommandsClient object. - */ - VirtualMachineRunCommandsClient getVirtualMachineRunCommands(); - - /** - * Gets the VirtualMachineScaleSetVMRunCommandsClient object to access its operations. - * - * @return the VirtualMachineScaleSetVMRunCommandsClient object. - */ - VirtualMachineScaleSetVMRunCommandsClient getVirtualMachineScaleSetVMRunCommands(); - - /** - * Gets the ResourceSkusClient object to access its operations. - * - * @return the ResourceSkusClient object. - */ - ResourceSkusClient getResourceSkus(); - - /** - * Gets the DisksClient object to access its operations. - * - * @return the DisksClient object. - */ - DisksClient getDisks(); - - /** - * Gets the SnapshotsClient object to access its operations. - * - * @return the SnapshotsClient object. - */ - SnapshotsClient getSnapshots(); - - /** - * Gets the DiskEncryptionSetsClient object to access its operations. - * - * @return the DiskEncryptionSetsClient object. - */ - DiskEncryptionSetsClient getDiskEncryptionSets(); - - /** - * Gets the GalleriesClient object to access its operations. - * - * @return the GalleriesClient object. - */ - GalleriesClient getGalleries(); - - /** - * Gets the GalleryImagesClient object to access its operations. - * - * @return the GalleryImagesClient object. - */ - GalleryImagesClient getGalleryImages(); - - /** - * Gets the GalleryImageVersionsClient object to access its operations. - * - * @return the GalleryImageVersionsClient object. - */ - GalleryImageVersionsClient getGalleryImageVersions(); - - /** - * Gets the GalleryApplicationsClient object to access its operations. - * - * @return the GalleryApplicationsClient object. - */ - GalleryApplicationsClient getGalleryApplications(); - - /** - * Gets the GalleryApplicationVersionsClient object to access its operations. - * - * @return the GalleryApplicationVersionsClient object. - */ - GalleryApplicationVersionsClient getGalleryApplicationVersions(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/DedicatedHostGroupsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/DedicatedHostGroupsClient.java deleted file mode 100644 index dca8efec02ed..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/DedicatedHostGroupsClient.java +++ /dev/null @@ -1,352 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.compute.fluent.models.DedicatedHostGroupInner; -import com.azure.resourcemanager.compute.models.DedicatedHostGroupUpdate; -import com.azure.resourcemanager.compute.models.InstanceViewTypes; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in DedicatedHostGroupsClient. */ -public interface DedicatedHostGroupsClient - extends InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete { - /** - * Create or update a dedicated host group. For details of Dedicated Host and Dedicated Host Groups please see - * [Dedicated Host Documentation] (https://go.microsoft.com/fwlink/?linkid=2082596). - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param parameters Parameters supplied to the Create Dedicated Host Group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the dedicated host group that the dedicated hosts should be assigned to. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String hostGroupName, DedicatedHostGroupInner parameters); - - /** - * Create or update a dedicated host group. For details of Dedicated Host and Dedicated Host Groups please see - * [Dedicated Host Documentation] (https://go.microsoft.com/fwlink/?linkid=2082596). - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param parameters Parameters supplied to the Create Dedicated Host Group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the dedicated host group that the dedicated hosts should be assigned to. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, String hostGroupName, DedicatedHostGroupInner parameters); - - /** - * Create or update a dedicated host group. For details of Dedicated Host and Dedicated Host Groups please see - * [Dedicated Host Documentation] (https://go.microsoft.com/fwlink/?linkid=2082596). - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param parameters Parameters supplied to the Create Dedicated Host Group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the dedicated host group that the dedicated hosts should be assigned to. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DedicatedHostGroupInner createOrUpdate( - String resourceGroupName, String hostGroupName, DedicatedHostGroupInner parameters); - - /** - * Create or update a dedicated host group. For details of Dedicated Host and Dedicated Host Groups please see - * [Dedicated Host Documentation] (https://go.microsoft.com/fwlink/?linkid=2082596). - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param parameters Parameters supplied to the Create Dedicated Host Group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the dedicated host group that the dedicated hosts should be assigned to. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, String hostGroupName, DedicatedHostGroupInner parameters, Context context); - - /** - * Update an dedicated host group. - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param parameters Parameters supplied to the Update Dedicated Host Group operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the dedicated host group that the dedicated hosts should be assigned to. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateWithResponseAsync( - String resourceGroupName, String hostGroupName, DedicatedHostGroupUpdate parameters); - - /** - * Update an dedicated host group. - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param parameters Parameters supplied to the Update Dedicated Host Group operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the dedicated host group that the dedicated hosts should be assigned to. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAsync( - String resourceGroupName, String hostGroupName, DedicatedHostGroupUpdate parameters); - - /** - * Update an dedicated host group. - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param parameters Parameters supplied to the Update Dedicated Host Group operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the dedicated host group that the dedicated hosts should be assigned to. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DedicatedHostGroupInner update(String resourceGroupName, String hostGroupName, DedicatedHostGroupUpdate parameters); - - /** - * Update an dedicated host group. - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param parameters Parameters supplied to the Update Dedicated Host Group operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the dedicated host group that the dedicated hosts should be assigned to. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String resourceGroupName, String hostGroupName, DedicatedHostGroupUpdate parameters, Context context); - - /** - * Delete a dedicated host group. - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteWithResponseAsync(String resourceGroupName, String hostGroupName); - - /** - * Delete a dedicated host group. - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String hostGroupName); - - /** - * Delete a dedicated host group. - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String hostGroupName); - - /** - * Delete a dedicated host group. - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String hostGroupName, Context context); - - /** - * Retrieves information about a dedicated host group. - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param expand The expand expression to apply on the operation. The response shows the list of instance view of - * the dedicated hosts under the dedicated host group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the dedicated host group that the dedicated hosts should be assigned to. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String hostGroupName, InstanceViewTypes expand); - - /** - * Retrieves information about a dedicated host group. - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param expand The expand expression to apply on the operation. The response shows the list of instance view of - * the dedicated hosts under the dedicated host group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the dedicated host group that the dedicated hosts should be assigned to. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync( - String resourceGroupName, String hostGroupName, InstanceViewTypes expand); - - /** - * Retrieves information about a dedicated host group. - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the dedicated host group that the dedicated hosts should be assigned to. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync(String resourceGroupName, String hostGroupName); - - /** - * Retrieves information about a dedicated host group. - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the dedicated host group that the dedicated hosts should be assigned to. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DedicatedHostGroupInner getByResourceGroup(String resourceGroupName, String hostGroupName); - - /** - * Retrieves information about a dedicated host group. - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param expand The expand expression to apply on the operation. The response shows the list of instance view of - * the dedicated hosts under the dedicated host group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the dedicated host group that the dedicated hosts should be assigned to. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String hostGroupName, InstanceViewTypes expand, Context context); - - /** - * Lists all of the dedicated host groups in the specified resource group. Use the nextLink property in the response - * to get the next page of dedicated host groups. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Dedicated Host Group with resource group response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName); - - /** - * Lists all of the dedicated host groups in the specified resource group. Use the nextLink property in the response - * to get the next page of dedicated host groups. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Dedicated Host Group with resource group response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Lists all of the dedicated host groups in the specified resource group. Use the nextLink property in the response - * to get the next page of dedicated host groups. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Dedicated Host Group with resource group response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * Lists all of the dedicated host groups in the subscription. Use the nextLink property in the response to get the - * next page of dedicated host groups. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Dedicated Host Group with resource group response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Lists all of the dedicated host groups in the subscription. Use the nextLink property in the response to get the - * next page of dedicated host groups. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Dedicated Host Group with resource group response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Lists all of the dedicated host groups in the subscription. Use the nextLink property in the response to get the - * next page of dedicated host groups. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Dedicated Host Group with resource group response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/DedicatedHostsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/DedicatedHostsClient.java deleted file mode 100644 index 89c94ec569a1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/DedicatedHostsClient.java +++ /dev/null @@ -1,489 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.compute.fluent.models.DedicatedHostInner; -import com.azure.resourcemanager.compute.models.DedicatedHostUpdate; -import com.azure.resourcemanager.compute.models.InstanceViewTypes; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in DedicatedHostsClient. */ -public interface DedicatedHostsClient { - /** - * Create or update a dedicated host . - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host . - * @param parameters Parameters supplied to the Create Dedicated Host. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Dedicated host. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String hostGroupName, String hostname, DedicatedHostInner parameters); - - /** - * Create or update a dedicated host . - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host . - * @param parameters Parameters supplied to the Create Dedicated Host. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Dedicated host. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, DedicatedHostInner> beginCreateOrUpdateAsync( - String resourceGroupName, String hostGroupName, String hostname, DedicatedHostInner parameters); - - /** - * Create or update a dedicated host . - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host . - * @param parameters Parameters supplied to the Create Dedicated Host. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Dedicated host. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, DedicatedHostInner> beginCreateOrUpdate( - String resourceGroupName, String hostGroupName, String hostname, DedicatedHostInner parameters); - - /** - * Create or update a dedicated host . - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host . - * @param parameters Parameters supplied to the Create Dedicated Host. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Dedicated host. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, DedicatedHostInner> beginCreateOrUpdate( - String resourceGroupName, - String hostGroupName, - String hostname, - DedicatedHostInner parameters, - Context context); - - /** - * Create or update a dedicated host . - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host . - * @param parameters Parameters supplied to the Create Dedicated Host. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Dedicated host. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, String hostGroupName, String hostname, DedicatedHostInner parameters); - - /** - * Create or update a dedicated host . - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host . - * @param parameters Parameters supplied to the Create Dedicated Host. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Dedicated host. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DedicatedHostInner createOrUpdate( - String resourceGroupName, String hostGroupName, String hostname, DedicatedHostInner parameters); - - /** - * Create or update a dedicated host . - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host . - * @param parameters Parameters supplied to the Create Dedicated Host. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Dedicated host. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DedicatedHostInner createOrUpdate( - String resourceGroupName, - String hostGroupName, - String hostname, - DedicatedHostInner parameters, - Context context); - - /** - * Update an dedicated host . - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host . - * @param parameters Parameters supplied to the Update Dedicated Host operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Dedicated host. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> updateWithResponseAsync( - String resourceGroupName, String hostGroupName, String hostname, DedicatedHostUpdate parameters); - - /** - * Update an dedicated host . - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host . - * @param parameters Parameters supplied to the Update Dedicated Host operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Dedicated host. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, DedicatedHostInner> beginUpdateAsync( - String resourceGroupName, String hostGroupName, String hostname, DedicatedHostUpdate parameters); - - /** - * Update an dedicated host . - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host . - * @param parameters Parameters supplied to the Update Dedicated Host operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Dedicated host. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, DedicatedHostInner> beginUpdate( - String resourceGroupName, String hostGroupName, String hostname, DedicatedHostUpdate parameters); - - /** - * Update an dedicated host . - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host . - * @param parameters Parameters supplied to the Update Dedicated Host operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Dedicated host. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, DedicatedHostInner> beginUpdate( - String resourceGroupName, - String hostGroupName, - String hostname, - DedicatedHostUpdate parameters, - Context context); - - /** - * Update an dedicated host . - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host . - * @param parameters Parameters supplied to the Update Dedicated Host operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Dedicated host. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAsync( - String resourceGroupName, String hostGroupName, String hostname, DedicatedHostUpdate parameters); - - /** - * Update an dedicated host . - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host . - * @param parameters Parameters supplied to the Update Dedicated Host operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Dedicated host. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DedicatedHostInner update( - String resourceGroupName, String hostGroupName, String hostname, DedicatedHostUpdate parameters); - - /** - * Update an dedicated host . - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host . - * @param parameters Parameters supplied to the Update Dedicated Host operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Dedicated host. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DedicatedHostInner update( - String resourceGroupName, - String hostGroupName, - String hostname, - DedicatedHostUpdate parameters, - Context context); - - /** - * Delete a dedicated host. - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync( - String resourceGroupName, String hostGroupName, String hostname); - - /** - * Delete a dedicated host. - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String hostGroupName, String hostname); - - /** - * Delete a dedicated host. - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String hostGroupName, String hostname); - - /** - * Delete a dedicated host. - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String hostGroupName, String hostname, Context context); - - /** - * Delete a dedicated host. - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String hostGroupName, String hostname); - - /** - * Delete a dedicated host. - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String hostGroupName, String hostname); - - /** - * Delete a dedicated host. - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String hostGroupName, String hostname, Context context); - - /** - * Retrieves information about a dedicated host. - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host. - * @param expand The expand expression to apply on the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Dedicated host. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync( - String resourceGroupName, String hostGroupName, String hostname, InstanceViewTypes expand); - - /** - * Retrieves information about a dedicated host. - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host. - * @param expand The expand expression to apply on the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Dedicated host. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync( - String resourceGroupName, String hostGroupName, String hostname, InstanceViewTypes expand); - - /** - * Retrieves information about a dedicated host. - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Dedicated host. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync(String resourceGroupName, String hostGroupName, String hostname); - - /** - * Retrieves information about a dedicated host. - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Dedicated host. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DedicatedHostInner get(String resourceGroupName, String hostGroupName, String hostname); - - /** - * Retrieves information about a dedicated host. - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host. - * @param expand The expand expression to apply on the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Dedicated host. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String hostGroupName, String hostname, InstanceViewTypes expand, Context context); - - /** - * Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response - * to get the next page of dedicated hosts. - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list dedicated host operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByHostGroupAsync(String resourceGroupName, String hostGroupName); - - /** - * Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response - * to get the next page of dedicated hosts. - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list dedicated host operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByHostGroup(String resourceGroupName, String hostGroupName); - - /** - * Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response - * to get the next page of dedicated hosts. - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list dedicated host operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByHostGroup(String resourceGroupName, String hostGroupName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/DiskEncryptionSetsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/DiskEncryptionSetsClient.java deleted file mode 100644 index 5a71c713bcbf..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/DiskEncryptionSetsClient.java +++ /dev/null @@ -1,535 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.compute.fluent.models.DiskEncryptionSetInner; -import com.azure.resourcemanager.compute.models.DiskEncryptionSetUpdate; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in DiskEncryptionSetsClient. */ -public interface DiskEncryptionSetsClient - extends InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete { - /** - * Creates or updates a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @param diskEncryptionSet disk encryption set object supplied in the body of the Put disk encryption set - * operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk encryption set resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String diskEncryptionSetName, DiskEncryptionSetInner diskEncryptionSet); - - /** - * Creates or updates a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @param diskEncryptionSet disk encryption set object supplied in the body of the Put disk encryption set - * operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk encryption set resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, DiskEncryptionSetInner> beginCreateOrUpdateAsync( - String resourceGroupName, String diskEncryptionSetName, DiskEncryptionSetInner diskEncryptionSet); - - /** - * Creates or updates a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @param diskEncryptionSet disk encryption set object supplied in the body of the Put disk encryption set - * operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk encryption set resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, DiskEncryptionSetInner> beginCreateOrUpdate( - String resourceGroupName, String diskEncryptionSetName, DiskEncryptionSetInner diskEncryptionSet); - - /** - * Creates or updates a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @param diskEncryptionSet disk encryption set object supplied in the body of the Put disk encryption set - * operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk encryption set resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, DiskEncryptionSetInner> beginCreateOrUpdate( - String resourceGroupName, - String diskEncryptionSetName, - DiskEncryptionSetInner diskEncryptionSet, - Context context); - - /** - * Creates or updates a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @param diskEncryptionSet disk encryption set object supplied in the body of the Put disk encryption set - * operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk encryption set resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, String diskEncryptionSetName, DiskEncryptionSetInner diskEncryptionSet); - - /** - * Creates or updates a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @param diskEncryptionSet disk encryption set object supplied in the body of the Put disk encryption set - * operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk encryption set resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DiskEncryptionSetInner createOrUpdate( - String resourceGroupName, String diskEncryptionSetName, DiskEncryptionSetInner diskEncryptionSet); - - /** - * Creates or updates a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @param diskEncryptionSet disk encryption set object supplied in the body of the Put disk encryption set - * operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk encryption set resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DiskEncryptionSetInner createOrUpdate( - String resourceGroupName, - String diskEncryptionSetName, - DiskEncryptionSetInner diskEncryptionSet, - Context context); - - /** - * Updates (patches) a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @param diskEncryptionSet disk encryption set object supplied in the body of the Patch disk encryption set - * operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk encryption set resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> updateWithResponseAsync( - String resourceGroupName, String diskEncryptionSetName, DiskEncryptionSetUpdate diskEncryptionSet); - - /** - * Updates (patches) a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @param diskEncryptionSet disk encryption set object supplied in the body of the Patch disk encryption set - * operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk encryption set resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, DiskEncryptionSetInner> beginUpdateAsync( - String resourceGroupName, String diskEncryptionSetName, DiskEncryptionSetUpdate diskEncryptionSet); - - /** - * Updates (patches) a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @param diskEncryptionSet disk encryption set object supplied in the body of the Patch disk encryption set - * operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk encryption set resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, DiskEncryptionSetInner> beginUpdate( - String resourceGroupName, String diskEncryptionSetName, DiskEncryptionSetUpdate diskEncryptionSet); - - /** - * Updates (patches) a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @param diskEncryptionSet disk encryption set object supplied in the body of the Patch disk encryption set - * operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk encryption set resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, DiskEncryptionSetInner> beginUpdate( - String resourceGroupName, - String diskEncryptionSetName, - DiskEncryptionSetUpdate diskEncryptionSet, - Context context); - - /** - * Updates (patches) a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @param diskEncryptionSet disk encryption set object supplied in the body of the Patch disk encryption set - * operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk encryption set resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAsync( - String resourceGroupName, String diskEncryptionSetName, DiskEncryptionSetUpdate diskEncryptionSet); - - /** - * Updates (patches) a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @param diskEncryptionSet disk encryption set object supplied in the body of the Patch disk encryption set - * operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk encryption set resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DiskEncryptionSetInner update( - String resourceGroupName, String diskEncryptionSetName, DiskEncryptionSetUpdate diskEncryptionSet); - - /** - * Updates (patches) a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @param diskEncryptionSet disk encryption set object supplied in the body of the Patch disk encryption set - * operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk encryption set resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DiskEncryptionSetInner update( - String resourceGroupName, - String diskEncryptionSetName, - DiskEncryptionSetUpdate diskEncryptionSet, - Context context); - - /** - * Gets information about a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a disk encryption set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String diskEncryptionSetName); - - /** - * Gets information about a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a disk encryption set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync(String resourceGroupName, String diskEncryptionSetName); - - /** - * Gets information about a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a disk encryption set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DiskEncryptionSetInner getByResourceGroup(String resourceGroupName, String diskEncryptionSetName); - - /** - * Gets information about a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a disk encryption set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String diskEncryptionSetName, Context context); - - /** - * Deletes a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync(String resourceGroupName, String diskEncryptionSetName); - - /** - * Deletes a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String diskEncryptionSetName); - - /** - * Deletes a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String diskEncryptionSetName); - - /** - * Deletes a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String diskEncryptionSetName, Context context); - - /** - * Deletes a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String diskEncryptionSetName); - - /** - * Deletes a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String diskEncryptionSetName); - - /** - * Deletes a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String diskEncryptionSetName, Context context); - - /** - * Lists all the disk encryption sets under a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List disk encryption set operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName); - - /** - * Lists all the disk encryption sets under a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List disk encryption set operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Lists all the disk encryption sets under a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List disk encryption set operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * Lists all the disk encryption sets under a subscription. - * - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List disk encryption set operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Lists all the disk encryption sets under a subscription. - * - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List disk encryption set operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Lists all the disk encryption sets under a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List disk encryption set operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/DisksClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/DisksClient.java deleted file mode 100644 index 9c164c4e747d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/DisksClient.java +++ /dev/null @@ -1,685 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.compute.fluent.models.AccessUriInner; -import com.azure.resourcemanager.compute.fluent.models.DiskInner; -import com.azure.resourcemanager.compute.models.DiskUpdate; -import com.azure.resourcemanager.compute.models.GrantAccessData; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in DisksClient. */ -public interface DisksClient - extends InnerSupportsGet, InnerSupportsListing, InnerSupportsDelete { - /** - * Creates or updates a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param disk Disk object supplied in the body of the Put disk operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String diskName, DiskInner disk); - - /** - * Creates or updates a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param disk Disk object supplied in the body of the Put disk operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, DiskInner> beginCreateOrUpdateAsync( - String resourceGroupName, String diskName, DiskInner disk); - - /** - * Creates or updates a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param disk Disk object supplied in the body of the Put disk operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, DiskInner> beginCreateOrUpdate( - String resourceGroupName, String diskName, DiskInner disk); - - /** - * Creates or updates a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param disk Disk object supplied in the body of the Put disk operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, DiskInner> beginCreateOrUpdate( - String resourceGroupName, String diskName, DiskInner disk, Context context); - - /** - * Creates or updates a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param disk Disk object supplied in the body of the Put disk operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync(String resourceGroupName, String diskName, DiskInner disk); - - /** - * Creates or updates a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param disk Disk object supplied in the body of the Put disk operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DiskInner createOrUpdate(String resourceGroupName, String diskName, DiskInner disk); - - /** - * Creates or updates a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param disk Disk object supplied in the body of the Put disk operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DiskInner createOrUpdate(String resourceGroupName, String diskName, DiskInner disk, Context context); - - /** - * Updates (patches) a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param disk Disk object supplied in the body of the Patch disk operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> updateWithResponseAsync( - String resourceGroupName, String diskName, DiskUpdate disk); - - /** - * Updates (patches) a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param disk Disk object supplied in the body of the Patch disk operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, DiskInner> beginUpdateAsync( - String resourceGroupName, String diskName, DiskUpdate disk); - - /** - * Updates (patches) a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param disk Disk object supplied in the body of the Patch disk operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, DiskInner> beginUpdate( - String resourceGroupName, String diskName, DiskUpdate disk); - - /** - * Updates (patches) a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param disk Disk object supplied in the body of the Patch disk operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, DiskInner> beginUpdate( - String resourceGroupName, String diskName, DiskUpdate disk, Context context); - - /** - * Updates (patches) a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param disk Disk object supplied in the body of the Patch disk operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAsync(String resourceGroupName, String diskName, DiskUpdate disk); - - /** - * Updates (patches) a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param disk Disk object supplied in the body of the Patch disk operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DiskInner update(String resourceGroupName, String diskName, DiskUpdate disk); - - /** - * Updates (patches) a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param disk Disk object supplied in the body of the Patch disk operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DiskInner update(String resourceGroupName, String diskName, DiskUpdate disk, Context context); - - /** - * Gets information about a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a disk. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String diskName); - - /** - * Gets information about a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a disk. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync(String resourceGroupName, String diskName); - - /** - * Gets information about a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a disk. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DiskInner getByResourceGroup(String resourceGroupName, String diskName); - - /** - * Gets information about a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a disk. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse(String resourceGroupName, String diskName, Context context); - - /** - * Deletes a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync(String resourceGroupName, String diskName); - - /** - * Deletes a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String diskName); - - /** - * Deletes a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String diskName); - - /** - * Deletes a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String diskName, Context context); - - /** - * Deletes a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String diskName); - - /** - * Deletes a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String diskName); - - /** - * Deletes a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String diskName, Context context); - - /** - * Lists all the disks under a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Disks operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName); - - /** - * Lists all the disks under a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Disks operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Lists all the disks under a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Disks operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * Lists all the disks under a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Disks operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Lists all the disks under a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Disks operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Lists all the disks under a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Disks operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Grants access to a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param grantAccessData Access data object supplied in the body of the get disk access operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a disk access SAS uri. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> grantAccessWithResponseAsync( - String resourceGroupName, String diskName, GrantAccessData grantAccessData); - - /** - * Grants access to a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param grantAccessData Access data object supplied in the body of the get disk access operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a disk access SAS uri. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, AccessUriInner> beginGrantAccessAsync( - String resourceGroupName, String diskName, GrantAccessData grantAccessData); - - /** - * Grants access to a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param grantAccessData Access data object supplied in the body of the get disk access operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a disk access SAS uri. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, AccessUriInner> beginGrantAccess( - String resourceGroupName, String diskName, GrantAccessData grantAccessData); - - /** - * Grants access to a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param grantAccessData Access data object supplied in the body of the get disk access operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a disk access SAS uri. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, AccessUriInner> beginGrantAccess( - String resourceGroupName, String diskName, GrantAccessData grantAccessData, Context context); - - /** - * Grants access to a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param grantAccessData Access data object supplied in the body of the get disk access operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a disk access SAS uri. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono grantAccessAsync(String resourceGroupName, String diskName, GrantAccessData grantAccessData); - - /** - * Grants access to a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param grantAccessData Access data object supplied in the body of the get disk access operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a disk access SAS uri. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AccessUriInner grantAccess(String resourceGroupName, String diskName, GrantAccessData grantAccessData); - - /** - * Grants access to a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param grantAccessData Access data object supplied in the body of the get disk access operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a disk access SAS uri. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AccessUriInner grantAccess( - String resourceGroupName, String diskName, GrantAccessData grantAccessData, Context context); - - /** - * Revokes access to a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> revokeAccessWithResponseAsync(String resourceGroupName, String diskName); - - /** - * Revokes access to a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginRevokeAccessAsync(String resourceGroupName, String diskName); - - /** - * Revokes access to a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginRevokeAccess(String resourceGroupName, String diskName); - - /** - * Revokes access to a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginRevokeAccess(String resourceGroupName, String diskName, Context context); - - /** - * Revokes access to a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono revokeAccessAsync(String resourceGroupName, String diskName); - - /** - * Revokes access to a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void revokeAccess(String resourceGroupName, String diskName); - - /** - * Revokes access to a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void revokeAccess(String resourceGroupName, String diskName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/GalleriesClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/GalleriesClient.java deleted file mode 100644 index 8d3f06216ffd..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/GalleriesClient.java +++ /dev/null @@ -1,463 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.compute.fluent.models.GalleryInner; -import com.azure.resourcemanager.compute.models.GalleryUpdate; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in GalleriesClient. */ -public interface GalleriesClient - extends InnerSupportsGet, InnerSupportsListing, InnerSupportsDelete { - /** - * Create or update a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with - * dots and periods allowed in the middle. The maximum length is 80 characters. - * @param gallery Parameters supplied to the create or update Shared Image Gallery operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Shared Image Gallery that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String galleryName, GalleryInner gallery); - - /** - * Create or update a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with - * dots and periods allowed in the middle. The maximum length is 80 characters. - * @param gallery Parameters supplied to the create or update Shared Image Gallery operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Shared Image Gallery that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, GalleryInner> beginCreateOrUpdateAsync( - String resourceGroupName, String galleryName, GalleryInner gallery); - - /** - * Create or update a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with - * dots and periods allowed in the middle. The maximum length is 80 characters. - * @param gallery Parameters supplied to the create or update Shared Image Gallery operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Shared Image Gallery that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, GalleryInner> beginCreateOrUpdate( - String resourceGroupName, String galleryName, GalleryInner gallery); - - /** - * Create or update a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with - * dots and periods allowed in the middle. The maximum length is 80 characters. - * @param gallery Parameters supplied to the create or update Shared Image Gallery operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Shared Image Gallery that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, GalleryInner> beginCreateOrUpdate( - String resourceGroupName, String galleryName, GalleryInner gallery, Context context); - - /** - * Create or update a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with - * dots and periods allowed in the middle. The maximum length is 80 characters. - * @param gallery Parameters supplied to the create or update Shared Image Gallery operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Shared Image Gallery that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync(String resourceGroupName, String galleryName, GalleryInner gallery); - - /** - * Create or update a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with - * dots and periods allowed in the middle. The maximum length is 80 characters. - * @param gallery Parameters supplied to the create or update Shared Image Gallery operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Shared Image Gallery that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GalleryInner createOrUpdate(String resourceGroupName, String galleryName, GalleryInner gallery); - - /** - * Create or update a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with - * dots and periods allowed in the middle. The maximum length is 80 characters. - * @param gallery Parameters supplied to the create or update Shared Image Gallery operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Shared Image Gallery that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GalleryInner createOrUpdate(String resourceGroupName, String galleryName, GalleryInner gallery, Context context); - - /** - * Update a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with - * dots and periods allowed in the middle. The maximum length is 80 characters. - * @param gallery Parameters supplied to the update Shared Image Gallery operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Shared Image Gallery that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> updateWithResponseAsync( - String resourceGroupName, String galleryName, GalleryUpdate gallery); - - /** - * Update a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with - * dots and periods allowed in the middle. The maximum length is 80 characters. - * @param gallery Parameters supplied to the update Shared Image Gallery operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Shared Image Gallery that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, GalleryInner> beginUpdateAsync( - String resourceGroupName, String galleryName, GalleryUpdate gallery); - - /** - * Update a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with - * dots and periods allowed in the middle. The maximum length is 80 characters. - * @param gallery Parameters supplied to the update Shared Image Gallery operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Shared Image Gallery that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, GalleryInner> beginUpdate( - String resourceGroupName, String galleryName, GalleryUpdate gallery); - - /** - * Update a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with - * dots and periods allowed in the middle. The maximum length is 80 characters. - * @param gallery Parameters supplied to the update Shared Image Gallery operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Shared Image Gallery that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, GalleryInner> beginUpdate( - String resourceGroupName, String galleryName, GalleryUpdate gallery, Context context); - - /** - * Update a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with - * dots and periods allowed in the middle. The maximum length is 80 characters. - * @param gallery Parameters supplied to the update Shared Image Gallery operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Shared Image Gallery that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAsync(String resourceGroupName, String galleryName, GalleryUpdate gallery); - - /** - * Update a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with - * dots and periods allowed in the middle. The maximum length is 80 characters. - * @param gallery Parameters supplied to the update Shared Image Gallery operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Shared Image Gallery that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GalleryInner update(String resourceGroupName, String galleryName, GalleryUpdate gallery); - - /** - * Update a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with - * dots and periods allowed in the middle. The maximum length is 80 characters. - * @param gallery Parameters supplied to the update Shared Image Gallery operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Shared Image Gallery that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GalleryInner update(String resourceGroupName, String galleryName, GalleryUpdate gallery, Context context); - - /** - * Retrieves information about a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Shared Image Gallery that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String galleryName); - - /** - * Retrieves information about a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Shared Image Gallery that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync(String resourceGroupName, String galleryName); - - /** - * Retrieves information about a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Shared Image Gallery that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GalleryInner getByResourceGroup(String resourceGroupName, String galleryName); - - /** - * Retrieves information about a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Shared Image Gallery that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String galleryName, Context context); - - /** - * Delete a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery to be deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync(String resourceGroupName, String galleryName); - - /** - * Delete a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery to be deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String galleryName); - - /** - * Delete a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery to be deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String galleryName); - - /** - * Delete a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery to be deleted. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String galleryName, Context context); - - /** - * Delete a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery to be deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String galleryName); - - /** - * Delete a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery to be deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String galleryName); - - /** - * Delete a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery to be deleted. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String galleryName, Context context); - - /** - * List galleries under a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Galleries operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName); - - /** - * List galleries under a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Galleries operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * List galleries under a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Galleries operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * List galleries under a subscription. - * - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Galleries operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * List galleries under a subscription. - * - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Galleries operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * List galleries under a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Galleries operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/GalleryApplicationVersionsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/GalleryApplicationVersionsClient.java deleted file mode 100644 index ff61f93be601..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/GalleryApplicationVersionsClient.java +++ /dev/null @@ -1,674 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.compute.fluent.models.GalleryApplicationVersionInner; -import com.azure.resourcemanager.compute.models.GalleryApplicationVersionUpdate; -import com.azure.resourcemanager.compute.models.ReplicationStatusTypes; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in GalleryApplicationVersionsClient. */ -public interface GalleryApplicationVersionsClient { - /** - * Create or update a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is - * to be created. - * @param galleryApplicationVersionName The name of the gallery Application Version to be created. Needs to follow - * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range - * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryApplicationVersion Parameters supplied to the create or update gallery Application Version - * operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName, - GalleryApplicationVersionInner galleryApplicationVersion); - - /** - * Create or update a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is - * to be created. - * @param galleryApplicationVersionName The name of the gallery Application Version to be created. Needs to follow - * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range - * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryApplicationVersion Parameters supplied to the create or update gallery Application Version - * operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, GalleryApplicationVersionInner> beginCreateOrUpdateAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName, - GalleryApplicationVersionInner galleryApplicationVersion); - - /** - * Create or update a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is - * to be created. - * @param galleryApplicationVersionName The name of the gallery Application Version to be created. Needs to follow - * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range - * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryApplicationVersion Parameters supplied to the create or update gallery Application Version - * operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, GalleryApplicationVersionInner> beginCreateOrUpdate( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName, - GalleryApplicationVersionInner galleryApplicationVersion); - - /** - * Create or update a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is - * to be created. - * @param galleryApplicationVersionName The name of the gallery Application Version to be created. Needs to follow - * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range - * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryApplicationVersion Parameters supplied to the create or update gallery Application Version - * operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, GalleryApplicationVersionInner> beginCreateOrUpdate( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName, - GalleryApplicationVersionInner galleryApplicationVersion, - Context context); - - /** - * Create or update a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is - * to be created. - * @param galleryApplicationVersionName The name of the gallery Application Version to be created. Needs to follow - * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range - * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryApplicationVersion Parameters supplied to the create or update gallery Application Version - * operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName, - GalleryApplicationVersionInner galleryApplicationVersion); - - /** - * Create or update a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is - * to be created. - * @param galleryApplicationVersionName The name of the gallery Application Version to be created. Needs to follow - * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range - * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryApplicationVersion Parameters supplied to the create or update gallery Application Version - * operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GalleryApplicationVersionInner createOrUpdate( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName, - GalleryApplicationVersionInner galleryApplicationVersion); - - /** - * Create or update a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is - * to be created. - * @param galleryApplicationVersionName The name of the gallery Application Version to be created. Needs to follow - * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range - * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryApplicationVersion Parameters supplied to the create or update gallery Application Version - * operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GalleryApplicationVersionInner createOrUpdate( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName, - GalleryApplicationVersionInner galleryApplicationVersion, - Context context); - - /** - * Update a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is - * to be updated. - * @param galleryApplicationVersionName The name of the gallery Application Version to be updated. Needs to follow - * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range - * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryApplicationVersion Parameters supplied to the update gallery Application Version operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> updateWithResponseAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName, - GalleryApplicationVersionUpdate galleryApplicationVersion); - - /** - * Update a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is - * to be updated. - * @param galleryApplicationVersionName The name of the gallery Application Version to be updated. Needs to follow - * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range - * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryApplicationVersion Parameters supplied to the update gallery Application Version operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, GalleryApplicationVersionInner> beginUpdateAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName, - GalleryApplicationVersionUpdate galleryApplicationVersion); - - /** - * Update a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is - * to be updated. - * @param galleryApplicationVersionName The name of the gallery Application Version to be updated. Needs to follow - * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range - * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryApplicationVersion Parameters supplied to the update gallery Application Version operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, GalleryApplicationVersionInner> beginUpdate( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName, - GalleryApplicationVersionUpdate galleryApplicationVersion); - - /** - * Update a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is - * to be updated. - * @param galleryApplicationVersionName The name of the gallery Application Version to be updated. Needs to follow - * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range - * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryApplicationVersion Parameters supplied to the update gallery Application Version operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, GalleryApplicationVersionInner> beginUpdate( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName, - GalleryApplicationVersionUpdate galleryApplicationVersion, - Context context); - - /** - * Update a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is - * to be updated. - * @param galleryApplicationVersionName The name of the gallery Application Version to be updated. Needs to follow - * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range - * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryApplicationVersion Parameters supplied to the update gallery Application Version operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName, - GalleryApplicationVersionUpdate galleryApplicationVersion); - - /** - * Update a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is - * to be updated. - * @param galleryApplicationVersionName The name of the gallery Application Version to be updated. Needs to follow - * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range - * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryApplicationVersion Parameters supplied to the update gallery Application Version operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GalleryApplicationVersionInner update( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName, - GalleryApplicationVersionUpdate galleryApplicationVersion); - - /** - * Update a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is - * to be updated. - * @param galleryApplicationVersionName The name of the gallery Application Version to be updated. Needs to follow - * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range - * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryApplicationVersion Parameters supplied to the update gallery Application Version operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GalleryApplicationVersionInner update( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName, - GalleryApplicationVersionUpdate galleryApplicationVersion, - Context context); - - /** - * Retrieves information about a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version - * resides. - * @param galleryApplicationVersionName The name of the gallery Application Version to be retrieved. - * @param expand The expand expression to apply on the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName, - ReplicationStatusTypes expand); - - /** - * Retrieves information about a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version - * resides. - * @param galleryApplicationVersionName The name of the gallery Application Version to be retrieved. - * @param expand The expand expression to apply on the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName, - ReplicationStatusTypes expand); - - /** - * Retrieves information about a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version - * resides. - * @param galleryApplicationVersionName The name of the gallery Application Version to be retrieved. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName); - - /** - * Retrieves information about a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version - * resides. - * @param galleryApplicationVersionName The name of the gallery Application Version to be retrieved. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GalleryApplicationVersionInner get( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName); - - /** - * Retrieves information about a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version - * resides. - * @param galleryApplicationVersionName The name of the gallery Application Version to be retrieved. - * @param expand The expand expression to apply on the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName, - ReplicationStatusTypes expand, - Context context); - - /** - * Delete a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version - * resides. - * @param galleryApplicationVersionName The name of the gallery Application Version to be deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName); - - /** - * Delete a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version - * resides. - * @param galleryApplicationVersionName The name of the gallery Application Version to be deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName); - - /** - * Delete a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version - * resides. - * @param galleryApplicationVersionName The name of the gallery Application Version to be deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName); - - /** - * Delete a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version - * resides. - * @param galleryApplicationVersionName The name of the gallery Application Version to be deleted. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName, - Context context); - - /** - * Delete a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version - * resides. - * @param galleryApplicationVersionName The name of the gallery Application Version to be deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName); - - /** - * Delete a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version - * resides. - * @param galleryApplicationVersionName The name of the gallery Application Version to be deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName); - - /** - * Delete a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version - * resides. - * @param galleryApplicationVersionName The name of the gallery Application Version to be deleted. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName, - Context context); - - /** - * List gallery Application Versions in a gallery Application Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the Shared Application Gallery Application Definition from which the - * Application Versions are to be listed. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Gallery Application version operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByGalleryApplicationAsync( - String resourceGroupName, String galleryName, String galleryApplicationName); - - /** - * List gallery Application Versions in a gallery Application Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the Shared Application Gallery Application Definition from which the - * Application Versions are to be listed. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Gallery Application version operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByGalleryApplication( - String resourceGroupName, String galleryName, String galleryApplicationName); - - /** - * List gallery Application Versions in a gallery Application Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the Shared Application Gallery Application Definition from which the - * Application Versions are to be listed. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Gallery Application version operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByGalleryApplication( - String resourceGroupName, String galleryName, String galleryApplicationName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/GalleryApplicationsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/GalleryApplicationsClient.java deleted file mode 100644 index 1962da24933a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/GalleryApplicationsClient.java +++ /dev/null @@ -1,554 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.compute.fluent.models.GalleryApplicationInner; -import com.azure.resourcemanager.compute.models.GalleryApplicationUpdate; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in GalleryApplicationsClient. */ -public interface GalleryApplicationsClient { - /** - * Create or update a gallery Application Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * created. - * @param galleryApplicationName The name of the gallery Application Definition to be created or updated. The - * allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The - * maximum length is 80 characters. - * @param galleryApplication Parameters supplied to the create or update gallery Application operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - GalleryApplicationInner galleryApplication); - - /** - * Create or update a gallery Application Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * created. - * @param galleryApplicationName The name of the gallery Application Definition to be created or updated. The - * allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The - * maximum length is 80 characters. - * @param galleryApplication Parameters supplied to the create or update gallery Application operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, GalleryApplicationInner> beginCreateOrUpdateAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - GalleryApplicationInner galleryApplication); - - /** - * Create or update a gallery Application Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * created. - * @param galleryApplicationName The name of the gallery Application Definition to be created or updated. The - * allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The - * maximum length is 80 characters. - * @param galleryApplication Parameters supplied to the create or update gallery Application operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, GalleryApplicationInner> beginCreateOrUpdate( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - GalleryApplicationInner galleryApplication); - - /** - * Create or update a gallery Application Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * created. - * @param galleryApplicationName The name of the gallery Application Definition to be created or updated. The - * allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The - * maximum length is 80 characters. - * @param galleryApplication Parameters supplied to the create or update gallery Application operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, GalleryApplicationInner> beginCreateOrUpdate( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - GalleryApplicationInner galleryApplication, - Context context); - - /** - * Create or update a gallery Application Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * created. - * @param galleryApplicationName The name of the gallery Application Definition to be created or updated. The - * allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The - * maximum length is 80 characters. - * @param galleryApplication Parameters supplied to the create or update gallery Application operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - GalleryApplicationInner galleryApplication); - - /** - * Create or update a gallery Application Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * created. - * @param galleryApplicationName The name of the gallery Application Definition to be created or updated. The - * allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The - * maximum length is 80 characters. - * @param galleryApplication Parameters supplied to the create or update gallery Application operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GalleryApplicationInner createOrUpdate( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - GalleryApplicationInner galleryApplication); - - /** - * Create or update a gallery Application Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * created. - * @param galleryApplicationName The name of the gallery Application Definition to be created or updated. The - * allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The - * maximum length is 80 characters. - * @param galleryApplication Parameters supplied to the create or update gallery Application operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GalleryApplicationInner createOrUpdate( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - GalleryApplicationInner galleryApplication, - Context context); - - /** - * Update a gallery Application Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * updated. - * @param galleryApplicationName The name of the gallery Application Definition to be updated. The allowed - * characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length - * is 80 characters. - * @param galleryApplication Parameters supplied to the update gallery Application operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> updateWithResponseAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - GalleryApplicationUpdate galleryApplication); - - /** - * Update a gallery Application Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * updated. - * @param galleryApplicationName The name of the gallery Application Definition to be updated. The allowed - * characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length - * is 80 characters. - * @param galleryApplication Parameters supplied to the update gallery Application operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, GalleryApplicationInner> beginUpdateAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - GalleryApplicationUpdate galleryApplication); - - /** - * Update a gallery Application Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * updated. - * @param galleryApplicationName The name of the gallery Application Definition to be updated. The allowed - * characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length - * is 80 characters. - * @param galleryApplication Parameters supplied to the update gallery Application operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, GalleryApplicationInner> beginUpdate( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - GalleryApplicationUpdate galleryApplication); - - /** - * Update a gallery Application Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * updated. - * @param galleryApplicationName The name of the gallery Application Definition to be updated. The allowed - * characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length - * is 80 characters. - * @param galleryApplication Parameters supplied to the update gallery Application operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, GalleryApplicationInner> beginUpdate( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - GalleryApplicationUpdate galleryApplication, - Context context); - - /** - * Update a gallery Application Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * updated. - * @param galleryApplicationName The name of the gallery Application Definition to be updated. The allowed - * characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length - * is 80 characters. - * @param galleryApplication Parameters supplied to the update gallery Application operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - GalleryApplicationUpdate galleryApplication); - - /** - * Update a gallery Application Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * updated. - * @param galleryApplicationName The name of the gallery Application Definition to be updated. The allowed - * characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length - * is 80 characters. - * @param galleryApplication Parameters supplied to the update gallery Application operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GalleryApplicationInner update( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - GalleryApplicationUpdate galleryApplication); - - /** - * Update a gallery Application Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * updated. - * @param galleryApplicationName The name of the gallery Application Definition to be updated. The allowed - * characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length - * is 80 characters. - * @param galleryApplication Parameters supplied to the update gallery Application operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GalleryApplicationInner update( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - GalleryApplicationUpdate galleryApplication, - Context context); - - /** - * Retrieves information about a gallery Application Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery from which the Application Definitions are to be - * retrieved. - * @param galleryApplicationName The name of the gallery Application Definition to be retrieved. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync( - String resourceGroupName, String galleryName, String galleryApplicationName); - - /** - * Retrieves information about a gallery Application Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery from which the Application Definitions are to be - * retrieved. - * @param galleryApplicationName The name of the gallery Application Definition to be retrieved. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync(String resourceGroupName, String galleryName, String galleryApplicationName); - - /** - * Retrieves information about a gallery Application Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery from which the Application Definitions are to be - * retrieved. - * @param galleryApplicationName The name of the gallery Application Definition to be retrieved. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GalleryApplicationInner get(String resourceGroupName, String galleryName, String galleryApplicationName); - - /** - * Retrieves information about a gallery Application Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery from which the Application Definitions are to be - * retrieved. - * @param galleryApplicationName The name of the gallery Application Definition to be retrieved. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String galleryName, String galleryApplicationName, Context context); - - /** - * Delete a gallery Application. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * deleted. - * @param galleryApplicationName The name of the gallery Application Definition to be deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync( - String resourceGroupName, String galleryName, String galleryApplicationName); - - /** - * Delete a gallery Application. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * deleted. - * @param galleryApplicationName The name of the gallery Application Definition to be deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String galleryName, String galleryApplicationName); - - /** - * Delete a gallery Application. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * deleted. - * @param galleryApplicationName The name of the gallery Application Definition to be deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String galleryName, String galleryApplicationName); - - /** - * Delete a gallery Application. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * deleted. - * @param galleryApplicationName The name of the gallery Application Definition to be deleted. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String galleryName, String galleryApplicationName, Context context); - - /** - * Delete a gallery Application. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * deleted. - * @param galleryApplicationName The name of the gallery Application Definition to be deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String galleryName, String galleryApplicationName); - - /** - * Delete a gallery Application. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * deleted. - * @param galleryApplicationName The name of the gallery Application Definition to be deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String galleryName, String galleryApplicationName); - - /** - * Delete a gallery Application. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * deleted. - * @param galleryApplicationName The name of the gallery Application Definition to be deleted. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String galleryName, String galleryApplicationName, Context context); - - /** - * List gallery Application Definitions in a gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery from which Application Definitions are to be - * listed. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Gallery Applications operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByGalleryAsync(String resourceGroupName, String galleryName); - - /** - * List gallery Application Definitions in a gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery from which Application Definitions are to be - * listed. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Gallery Applications operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByGallery(String resourceGroupName, String galleryName); - - /** - * List gallery Application Definitions in a gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery from which Application Definitions are to be - * listed. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Gallery Applications operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByGallery(String resourceGroupName, String galleryName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/GalleryImageVersionsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/GalleryImageVersionsClient.java deleted file mode 100644 index fe4576c5b570..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/GalleryImageVersionsClient.java +++ /dev/null @@ -1,619 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.compute.fluent.models.GalleryImageVersionInner; -import com.azure.resourcemanager.compute.models.GalleryImageVersionUpdate; -import com.azure.resourcemanager.compute.models.ReplicationStatusTypes; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in GalleryImageVersionsClient. */ -public interface GalleryImageVersionsClient { - /** - * Create or update a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version is to be created. - * @param galleryImageVersionName The name of the gallery Image Version to be created. Needs to follow semantic - * version name pattern: The allowed characters are digit and period. Digits must be within the range of a - * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryImageVersion Parameters supplied to the create or update gallery Image Version operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String galleryName, - String galleryImageName, - String galleryImageVersionName, - GalleryImageVersionInner galleryImageVersion); - - /** - * Create or update a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version is to be created. - * @param galleryImageVersionName The name of the gallery Image Version to be created. Needs to follow semantic - * version name pattern: The allowed characters are digit and period. Digits must be within the range of a - * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryImageVersion Parameters supplied to the create or update gallery Image Version operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, GalleryImageVersionInner> beginCreateOrUpdateAsync( - String resourceGroupName, - String galleryName, - String galleryImageName, - String galleryImageVersionName, - GalleryImageVersionInner galleryImageVersion); - - /** - * Create or update a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version is to be created. - * @param galleryImageVersionName The name of the gallery Image Version to be created. Needs to follow semantic - * version name pattern: The allowed characters are digit and period. Digits must be within the range of a - * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryImageVersion Parameters supplied to the create or update gallery Image Version operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, GalleryImageVersionInner> beginCreateOrUpdate( - String resourceGroupName, - String galleryName, - String galleryImageName, - String galleryImageVersionName, - GalleryImageVersionInner galleryImageVersion); - - /** - * Create or update a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version is to be created. - * @param galleryImageVersionName The name of the gallery Image Version to be created. Needs to follow semantic - * version name pattern: The allowed characters are digit and period. Digits must be within the range of a - * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryImageVersion Parameters supplied to the create or update gallery Image Version operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, GalleryImageVersionInner> beginCreateOrUpdate( - String resourceGroupName, - String galleryName, - String galleryImageName, - String galleryImageVersionName, - GalleryImageVersionInner galleryImageVersion, - Context context); - - /** - * Create or update a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version is to be created. - * @param galleryImageVersionName The name of the gallery Image Version to be created. Needs to follow semantic - * version name pattern: The allowed characters are digit and period. Digits must be within the range of a - * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryImageVersion Parameters supplied to the create or update gallery Image Version operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, - String galleryName, - String galleryImageName, - String galleryImageVersionName, - GalleryImageVersionInner galleryImageVersion); - - /** - * Create or update a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version is to be created. - * @param galleryImageVersionName The name of the gallery Image Version to be created. Needs to follow semantic - * version name pattern: The allowed characters are digit and period. Digits must be within the range of a - * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryImageVersion Parameters supplied to the create or update gallery Image Version operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GalleryImageVersionInner createOrUpdate( - String resourceGroupName, - String galleryName, - String galleryImageName, - String galleryImageVersionName, - GalleryImageVersionInner galleryImageVersion); - - /** - * Create or update a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version is to be created. - * @param galleryImageVersionName The name of the gallery Image Version to be created. Needs to follow semantic - * version name pattern: The allowed characters are digit and period. Digits must be within the range of a - * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryImageVersion Parameters supplied to the create or update gallery Image Version operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GalleryImageVersionInner createOrUpdate( - String resourceGroupName, - String galleryName, - String galleryImageName, - String galleryImageVersionName, - GalleryImageVersionInner galleryImageVersion, - Context context); - - /** - * Update a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version is to be updated. - * @param galleryImageVersionName The name of the gallery Image Version to be updated. Needs to follow semantic - * version name pattern: The allowed characters are digit and period. Digits must be within the range of a - * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryImageVersion Parameters supplied to the update gallery Image Version operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> updateWithResponseAsync( - String resourceGroupName, - String galleryName, - String galleryImageName, - String galleryImageVersionName, - GalleryImageVersionUpdate galleryImageVersion); - - /** - * Update a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version is to be updated. - * @param galleryImageVersionName The name of the gallery Image Version to be updated. Needs to follow semantic - * version name pattern: The allowed characters are digit and period. Digits must be within the range of a - * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryImageVersion Parameters supplied to the update gallery Image Version operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, GalleryImageVersionInner> beginUpdateAsync( - String resourceGroupName, - String galleryName, - String galleryImageName, - String galleryImageVersionName, - GalleryImageVersionUpdate galleryImageVersion); - - /** - * Update a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version is to be updated. - * @param galleryImageVersionName The name of the gallery Image Version to be updated. Needs to follow semantic - * version name pattern: The allowed characters are digit and period. Digits must be within the range of a - * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryImageVersion Parameters supplied to the update gallery Image Version operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, GalleryImageVersionInner> beginUpdate( - String resourceGroupName, - String galleryName, - String galleryImageName, - String galleryImageVersionName, - GalleryImageVersionUpdate galleryImageVersion); - - /** - * Update a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version is to be updated. - * @param galleryImageVersionName The name of the gallery Image Version to be updated. Needs to follow semantic - * version name pattern: The allowed characters are digit and period. Digits must be within the range of a - * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryImageVersion Parameters supplied to the update gallery Image Version operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, GalleryImageVersionInner> beginUpdate( - String resourceGroupName, - String galleryName, - String galleryImageName, - String galleryImageVersionName, - GalleryImageVersionUpdate galleryImageVersion, - Context context); - - /** - * Update a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version is to be updated. - * @param galleryImageVersionName The name of the gallery Image Version to be updated. Needs to follow semantic - * version name pattern: The allowed characters are digit and period. Digits must be within the range of a - * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryImageVersion Parameters supplied to the update gallery Image Version operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAsync( - String resourceGroupName, - String galleryName, - String galleryImageName, - String galleryImageVersionName, - GalleryImageVersionUpdate galleryImageVersion); - - /** - * Update a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version is to be updated. - * @param galleryImageVersionName The name of the gallery Image Version to be updated. Needs to follow semantic - * version name pattern: The allowed characters are digit and period. Digits must be within the range of a - * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryImageVersion Parameters supplied to the update gallery Image Version operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GalleryImageVersionInner update( - String resourceGroupName, - String galleryName, - String galleryImageName, - String galleryImageVersionName, - GalleryImageVersionUpdate galleryImageVersion); - - /** - * Update a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version is to be updated. - * @param galleryImageVersionName The name of the gallery Image Version to be updated. Needs to follow semantic - * version name pattern: The allowed characters are digit and period. Digits must be within the range of a - * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryImageVersion Parameters supplied to the update gallery Image Version operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GalleryImageVersionInner update( - String resourceGroupName, - String galleryName, - String galleryImageName, - String galleryImageVersionName, - GalleryImageVersionUpdate galleryImageVersion, - Context context); - - /** - * Retrieves information about a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version resides. - * @param galleryImageVersionName The name of the gallery Image Version to be retrieved. - * @param expand The expand expression to apply on the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync( - String resourceGroupName, - String galleryName, - String galleryImageName, - String galleryImageVersionName, - ReplicationStatusTypes expand); - - /** - * Retrieves information about a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version resides. - * @param galleryImageVersionName The name of the gallery Image Version to be retrieved. - * @param expand The expand expression to apply on the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync( - String resourceGroupName, - String galleryName, - String galleryImageName, - String galleryImageVersionName, - ReplicationStatusTypes expand); - - /** - * Retrieves information about a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version resides. - * @param galleryImageVersionName The name of the gallery Image Version to be retrieved. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync( - String resourceGroupName, String galleryName, String galleryImageName, String galleryImageVersionName); - - /** - * Retrieves information about a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version resides. - * @param galleryImageVersionName The name of the gallery Image Version to be retrieved. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GalleryImageVersionInner get( - String resourceGroupName, String galleryName, String galleryImageName, String galleryImageVersionName); - - /** - * Retrieves information about a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version resides. - * @param galleryImageVersionName The name of the gallery Image Version to be retrieved. - * @param expand The expand expression to apply on the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, - String galleryName, - String galleryImageName, - String galleryImageVersionName, - ReplicationStatusTypes expand, - Context context); - - /** - * Delete a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version resides. - * @param galleryImageVersionName The name of the gallery Image Version to be deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync( - String resourceGroupName, String galleryName, String galleryImageName, String galleryImageVersionName); - - /** - * Delete a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version resides. - * @param galleryImageVersionName The name of the gallery Image Version to be deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String galleryName, String galleryImageName, String galleryImageVersionName); - - /** - * Delete a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version resides. - * @param galleryImageVersionName The name of the gallery Image Version to be deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String galleryName, String galleryImageName, String galleryImageVersionName); - - /** - * Delete a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version resides. - * @param galleryImageVersionName The name of the gallery Image Version to be deleted. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, - String galleryName, - String galleryImageName, - String galleryImageVersionName, - Context context); - - /** - * Delete a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version resides. - * @param galleryImageVersionName The name of the gallery Image Version to be deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync( - String resourceGroupName, String galleryName, String galleryImageName, String galleryImageVersionName); - - /** - * Delete a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version resides. - * @param galleryImageVersionName The name of the gallery Image Version to be deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String galleryName, String galleryImageName, String galleryImageVersionName); - - /** - * Delete a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version resides. - * @param galleryImageVersionName The name of the gallery Image Version to be deleted. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete( - String resourceGroupName, - String galleryName, - String galleryImageName, - String galleryImageVersionName, - Context context); - - /** - * List gallery Image Versions in a gallery Image Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the Shared Image Gallery Image Definition from which the Image Versions are - * to be listed. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Gallery Image version operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByGalleryImageAsync( - String resourceGroupName, String galleryName, String galleryImageName); - - /** - * List gallery Image Versions in a gallery Image Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the Shared Image Gallery Image Definition from which the Image Versions are - * to be listed. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Gallery Image version operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByGalleryImage( - String resourceGroupName, String galleryName, String galleryImageName); - - /** - * List gallery Image Versions in a gallery Image Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the Shared Image Gallery Image Definition from which the Image Versions are - * to be listed. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Gallery Image version operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByGalleryImage( - String resourceGroupName, String galleryName, String galleryImageName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/GalleryImagesClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/GalleryImagesClient.java deleted file mode 100644 index 538963217514..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/GalleryImagesClient.java +++ /dev/null @@ -1,496 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.compute.fluent.models.GalleryImageInner; -import com.azure.resourcemanager.compute.models.GalleryImageUpdate; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in GalleryImagesClient. */ -public interface GalleryImagesClient { - /** - * Create or update a gallery Image Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be created. - * @param galleryImageName The name of the gallery Image Definition to be created or updated. The allowed characters - * are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 - * characters. - * @param galleryImage Parameters supplied to the create or update gallery image operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String galleryName, String galleryImageName, GalleryImageInner galleryImage); - - /** - * Create or update a gallery Image Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be created. - * @param galleryImageName The name of the gallery Image Definition to be created or updated. The allowed characters - * are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 - * characters. - * @param galleryImage Parameters supplied to the create or update gallery image operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, GalleryImageInner> beginCreateOrUpdateAsync( - String resourceGroupName, String galleryName, String galleryImageName, GalleryImageInner galleryImage); - - /** - * Create or update a gallery Image Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be created. - * @param galleryImageName The name of the gallery Image Definition to be created or updated. The allowed characters - * are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 - * characters. - * @param galleryImage Parameters supplied to the create or update gallery image operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, GalleryImageInner> beginCreateOrUpdate( - String resourceGroupName, String galleryName, String galleryImageName, GalleryImageInner galleryImage); - - /** - * Create or update a gallery Image Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be created. - * @param galleryImageName The name of the gallery Image Definition to be created or updated. The allowed characters - * are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 - * characters. - * @param galleryImage Parameters supplied to the create or update gallery image operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, GalleryImageInner> beginCreateOrUpdate( - String resourceGroupName, - String galleryName, - String galleryImageName, - GalleryImageInner galleryImage, - Context context); - - /** - * Create or update a gallery Image Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be created. - * @param galleryImageName The name of the gallery Image Definition to be created or updated. The allowed characters - * are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 - * characters. - * @param galleryImage Parameters supplied to the create or update gallery image operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, String galleryName, String galleryImageName, GalleryImageInner galleryImage); - - /** - * Create or update a gallery Image Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be created. - * @param galleryImageName The name of the gallery Image Definition to be created or updated. The allowed characters - * are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 - * characters. - * @param galleryImage Parameters supplied to the create or update gallery image operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GalleryImageInner createOrUpdate( - String resourceGroupName, String galleryName, String galleryImageName, GalleryImageInner galleryImage); - - /** - * Create or update a gallery Image Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be created. - * @param galleryImageName The name of the gallery Image Definition to be created or updated. The allowed characters - * are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 - * characters. - * @param galleryImage Parameters supplied to the create or update gallery image operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GalleryImageInner createOrUpdate( - String resourceGroupName, - String galleryName, - String galleryImageName, - GalleryImageInner galleryImage, - Context context); - - /** - * Update a gallery Image Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be updated. - * @param galleryImageName The name of the gallery Image Definition to be updated. The allowed characters are - * alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 - * characters. - * @param galleryImage Parameters supplied to the update gallery image operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> updateWithResponseAsync( - String resourceGroupName, String galleryName, String galleryImageName, GalleryImageUpdate galleryImage); - - /** - * Update a gallery Image Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be updated. - * @param galleryImageName The name of the gallery Image Definition to be updated. The allowed characters are - * alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 - * characters. - * @param galleryImage Parameters supplied to the update gallery image operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, GalleryImageInner> beginUpdateAsync( - String resourceGroupName, String galleryName, String galleryImageName, GalleryImageUpdate galleryImage); - - /** - * Update a gallery Image Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be updated. - * @param galleryImageName The name of the gallery Image Definition to be updated. The allowed characters are - * alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 - * characters. - * @param galleryImage Parameters supplied to the update gallery image operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, GalleryImageInner> beginUpdate( - String resourceGroupName, String galleryName, String galleryImageName, GalleryImageUpdate galleryImage); - - /** - * Update a gallery Image Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be updated. - * @param galleryImageName The name of the gallery Image Definition to be updated. The allowed characters are - * alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 - * characters. - * @param galleryImage Parameters supplied to the update gallery image operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, GalleryImageInner> beginUpdate( - String resourceGroupName, - String galleryName, - String galleryImageName, - GalleryImageUpdate galleryImage, - Context context); - - /** - * Update a gallery Image Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be updated. - * @param galleryImageName The name of the gallery Image Definition to be updated. The allowed characters are - * alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 - * characters. - * @param galleryImage Parameters supplied to the update gallery image operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAsync( - String resourceGroupName, String galleryName, String galleryImageName, GalleryImageUpdate galleryImage); - - /** - * Update a gallery Image Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be updated. - * @param galleryImageName The name of the gallery Image Definition to be updated. The allowed characters are - * alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 - * characters. - * @param galleryImage Parameters supplied to the update gallery image operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GalleryImageInner update( - String resourceGroupName, String galleryName, String galleryImageName, GalleryImageUpdate galleryImage); - - /** - * Update a gallery Image Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be updated. - * @param galleryImageName The name of the gallery Image Definition to be updated. The allowed characters are - * alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 - * characters. - * @param galleryImage Parameters supplied to the update gallery image operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GalleryImageInner update( - String resourceGroupName, - String galleryName, - String galleryImageName, - GalleryImageUpdate galleryImage, - Context context); - - /** - * Retrieves information about a gallery Image Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery from which the Image Definitions are to be retrieved. - * @param galleryImageName The name of the gallery Image Definition to be retrieved. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync( - String resourceGroupName, String galleryName, String galleryImageName); - - /** - * Retrieves information about a gallery Image Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery from which the Image Definitions are to be retrieved. - * @param galleryImageName The name of the gallery Image Definition to be retrieved. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync(String resourceGroupName, String galleryName, String galleryImageName); - - /** - * Retrieves information about a gallery Image Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery from which the Image Definitions are to be retrieved. - * @param galleryImageName The name of the gallery Image Definition to be retrieved. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GalleryImageInner get(String resourceGroupName, String galleryName, String galleryImageName); - - /** - * Retrieves information about a gallery Image Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery from which the Image Definitions are to be retrieved. - * @param galleryImageName The name of the gallery Image Definition to be retrieved. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String galleryName, String galleryImageName, Context context); - - /** - * Delete a gallery image. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be deleted. - * @param galleryImageName The name of the gallery Image Definition to be deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync( - String resourceGroupName, String galleryName, String galleryImageName); - - /** - * Delete a gallery image. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be deleted. - * @param galleryImageName The name of the gallery Image Definition to be deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String galleryName, String galleryImageName); - - /** - * Delete a gallery image. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be deleted. - * @param galleryImageName The name of the gallery Image Definition to be deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String galleryName, String galleryImageName); - - /** - * Delete a gallery image. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be deleted. - * @param galleryImageName The name of the gallery Image Definition to be deleted. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String galleryName, String galleryImageName, Context context); - - /** - * Delete a gallery image. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be deleted. - * @param galleryImageName The name of the gallery Image Definition to be deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String galleryName, String galleryImageName); - - /** - * Delete a gallery image. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be deleted. - * @param galleryImageName The name of the gallery Image Definition to be deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String galleryName, String galleryImageName); - - /** - * Delete a gallery image. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be deleted. - * @param galleryImageName The name of the gallery Image Definition to be deleted. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String galleryName, String galleryImageName, Context context); - - /** - * List gallery Image Definitions in a gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery from which Image Definitions are to be listed. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Gallery Images operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByGalleryAsync(String resourceGroupName, String galleryName); - - /** - * List gallery Image Definitions in a gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery from which Image Definitions are to be listed. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Gallery Images operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByGallery(String resourceGroupName, String galleryName); - - /** - * List gallery Image Definitions in a gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery from which Image Definitions are to be listed. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Gallery Images operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByGallery(String resourceGroupName, String galleryName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/ImagesClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/ImagesClient.java deleted file mode 100644 index 7e36b763d5b1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/ImagesClient.java +++ /dev/null @@ -1,469 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.compute.fluent.models.ImageInner; -import com.azure.resourcemanager.compute.models.ImageUpdate; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ImagesClient. */ -public interface ImagesClient - extends InnerSupportsGet, InnerSupportsListing, InnerSupportsDelete { - /** - * Create or update an image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @param parameters Parameters supplied to the Create Image operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source user image virtual hard disk. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String imageName, ImageInner parameters); - - /** - * Create or update an image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @param parameters Parameters supplied to the Create Image operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source user image virtual hard disk. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, ImageInner> beginCreateOrUpdateAsync( - String resourceGroupName, String imageName, ImageInner parameters); - - /** - * Create or update an image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @param parameters Parameters supplied to the Create Image operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source user image virtual hard disk. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ImageInner> beginCreateOrUpdate( - String resourceGroupName, String imageName, ImageInner parameters); - - /** - * Create or update an image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @param parameters Parameters supplied to the Create Image operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source user image virtual hard disk. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ImageInner> beginCreateOrUpdate( - String resourceGroupName, String imageName, ImageInner parameters, Context context); - - /** - * Create or update an image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @param parameters Parameters supplied to the Create Image operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source user image virtual hard disk. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync(String resourceGroupName, String imageName, ImageInner parameters); - - /** - * Create or update an image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @param parameters Parameters supplied to the Create Image operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source user image virtual hard disk. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ImageInner createOrUpdate(String resourceGroupName, String imageName, ImageInner parameters); - - /** - * Create or update an image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @param parameters Parameters supplied to the Create Image operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source user image virtual hard disk. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ImageInner createOrUpdate(String resourceGroupName, String imageName, ImageInner parameters, Context context); - - /** - * Update an image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @param parameters Parameters supplied to the Update Image operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source user image virtual hard disk. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> updateWithResponseAsync( - String resourceGroupName, String imageName, ImageUpdate parameters); - - /** - * Update an image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @param parameters Parameters supplied to the Update Image operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source user image virtual hard disk. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, ImageInner> beginUpdateAsync( - String resourceGroupName, String imageName, ImageUpdate parameters); - - /** - * Update an image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @param parameters Parameters supplied to the Update Image operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source user image virtual hard disk. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ImageInner> beginUpdate( - String resourceGroupName, String imageName, ImageUpdate parameters); - - /** - * Update an image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @param parameters Parameters supplied to the Update Image operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source user image virtual hard disk. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ImageInner> beginUpdate( - String resourceGroupName, String imageName, ImageUpdate parameters, Context context); - - /** - * Update an image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @param parameters Parameters supplied to the Update Image operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source user image virtual hard disk. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAsync(String resourceGroupName, String imageName, ImageUpdate parameters); - - /** - * Update an image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @param parameters Parameters supplied to the Update Image operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source user image virtual hard disk. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ImageInner update(String resourceGroupName, String imageName, ImageUpdate parameters); - - /** - * Update an image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @param parameters Parameters supplied to the Update Image operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source user image virtual hard disk. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ImageInner update(String resourceGroupName, String imageName, ImageUpdate parameters, Context context); - - /** - * Deletes an Image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync(String resourceGroupName, String imageName); - - /** - * Deletes an Image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String imageName); - - /** - * Deletes an Image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String imageName); - - /** - * Deletes an Image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String imageName, Context context); - - /** - * Deletes an Image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String imageName); - - /** - * Deletes an Image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String imageName); - - /** - * Deletes an Image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String imageName, Context context); - - /** - * Gets an image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @param expand The expand expression to apply on the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an image. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String imageName, String expand); - - /** - * Gets an image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @param expand The expand expression to apply on the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an image. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync(String resourceGroupName, String imageName, String expand); - - /** - * Gets an image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an image. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync(String resourceGroupName, String imageName); - - /** - * Gets an image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an image. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ImageInner getByResourceGroup(String resourceGroupName, String imageName); - - /** - * Gets an image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @param expand The expand expression to apply on the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an image. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String imageName, String expand, Context context); - - /** - * Gets the list of images under a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of images under a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName); - - /** - * Gets the list of images under a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of images under a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Gets the list of images under a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of images under a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * Gets the list of Images in the subscription. Use nextLink property in the response to get the next page of - * Images. Do this till nextLink is null to fetch all the Images. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Images in the subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Gets the list of Images in the subscription. Use nextLink property in the response to get the next page of - * Images. Do this till nextLink is null to fetch all the Images. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Images in the subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Gets the list of Images in the subscription. Use nextLink property in the response to get the next page of - * Images. Do this till nextLink is null to fetch all the Images. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Images in the subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/LogAnalyticsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/LogAnalyticsClient.java deleted file mode 100644 index fa49a8d7b50a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/LogAnalyticsClient.java +++ /dev/null @@ -1,228 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.compute.fluent.models.LogAnalyticsOperationResultInner; -import com.azure.resourcemanager.compute.models.RequestRateByIntervalInput; -import com.azure.resourcemanager.compute.models.ThrottledRequestsInput; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in LogAnalyticsClient. */ -public interface LogAnalyticsClient { - /** - * Export logs that show Api requests made by this subscription in the given time window to show throttling - * activities. - * - * @param location The location upon which virtual-machine-sizes is queried. - * @param parameters Parameters supplied to the LogAnalytics getRequestRateByInterval Api. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return logAnalytics operation status response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> exportRequestRateByIntervalWithResponseAsync( - String location, RequestRateByIntervalInput parameters); - - /** - * Export logs that show Api requests made by this subscription in the given time window to show throttling - * activities. - * - * @param location The location upon which virtual-machine-sizes is queried. - * @param parameters Parameters supplied to the LogAnalytics getRequestRateByInterval Api. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return logAnalytics operation status response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, LogAnalyticsOperationResultInner> - beginExportRequestRateByIntervalAsync(String location, RequestRateByIntervalInput parameters); - - /** - * Export logs that show Api requests made by this subscription in the given time window to show throttling - * activities. - * - * @param location The location upon which virtual-machine-sizes is queried. - * @param parameters Parameters supplied to the LogAnalytics getRequestRateByInterval Api. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return logAnalytics operation status response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, LogAnalyticsOperationResultInner> - beginExportRequestRateByInterval(String location, RequestRateByIntervalInput parameters); - - /** - * Export logs that show Api requests made by this subscription in the given time window to show throttling - * activities. - * - * @param location The location upon which virtual-machine-sizes is queried. - * @param parameters Parameters supplied to the LogAnalytics getRequestRateByInterval Api. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return logAnalytics operation status response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, LogAnalyticsOperationResultInner> - beginExportRequestRateByInterval(String location, RequestRateByIntervalInput parameters, Context context); - - /** - * Export logs that show Api requests made by this subscription in the given time window to show throttling - * activities. - * - * @param location The location upon which virtual-machine-sizes is queried. - * @param parameters Parameters supplied to the LogAnalytics getRequestRateByInterval Api. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return logAnalytics operation status response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono exportRequestRateByIntervalAsync( - String location, RequestRateByIntervalInput parameters); - - /** - * Export logs that show Api requests made by this subscription in the given time window to show throttling - * activities. - * - * @param location The location upon which virtual-machine-sizes is queried. - * @param parameters Parameters supplied to the LogAnalytics getRequestRateByInterval Api. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return logAnalytics operation status response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - LogAnalyticsOperationResultInner exportRequestRateByInterval( - String location, RequestRateByIntervalInput parameters); - - /** - * Export logs that show Api requests made by this subscription in the given time window to show throttling - * activities. - * - * @param location The location upon which virtual-machine-sizes is queried. - * @param parameters Parameters supplied to the LogAnalytics getRequestRateByInterval Api. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return logAnalytics operation status response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - LogAnalyticsOperationResultInner exportRequestRateByInterval( - String location, RequestRateByIntervalInput parameters, Context context); - - /** - * Export logs that show total throttled Api requests for this subscription in the given time window. - * - * @param location The location upon which virtual-machine-sizes is queried. - * @param parameters Parameters supplied to the LogAnalytics getThrottledRequests Api. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return logAnalytics operation status response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> exportThrottledRequestsWithResponseAsync( - String location, ThrottledRequestsInput parameters); - - /** - * Export logs that show total throttled Api requests for this subscription in the given time window. - * - * @param location The location upon which virtual-machine-sizes is queried. - * @param parameters Parameters supplied to the LogAnalytics getThrottledRequests Api. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return logAnalytics operation status response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, LogAnalyticsOperationResultInner> - beginExportThrottledRequestsAsync(String location, ThrottledRequestsInput parameters); - - /** - * Export logs that show total throttled Api requests for this subscription in the given time window. - * - * @param location The location upon which virtual-machine-sizes is queried. - * @param parameters Parameters supplied to the LogAnalytics getThrottledRequests Api. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return logAnalytics operation status response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, LogAnalyticsOperationResultInner> - beginExportThrottledRequests(String location, ThrottledRequestsInput parameters); - - /** - * Export logs that show total throttled Api requests for this subscription in the given time window. - * - * @param location The location upon which virtual-machine-sizes is queried. - * @param parameters Parameters supplied to the LogAnalytics getThrottledRequests Api. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return logAnalytics operation status response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, LogAnalyticsOperationResultInner> - beginExportThrottledRequests(String location, ThrottledRequestsInput parameters, Context context); - - /** - * Export logs that show total throttled Api requests for this subscription in the given time window. - * - * @param location The location upon which virtual-machine-sizes is queried. - * @param parameters Parameters supplied to the LogAnalytics getThrottledRequests Api. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return logAnalytics operation status response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono exportThrottledRequestsAsync( - String location, ThrottledRequestsInput parameters); - - /** - * Export logs that show total throttled Api requests for this subscription in the given time window. - * - * @param location The location upon which virtual-machine-sizes is queried. - * @param parameters Parameters supplied to the LogAnalytics getThrottledRequests Api. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return logAnalytics operation status response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - LogAnalyticsOperationResultInner exportThrottledRequests(String location, ThrottledRequestsInput parameters); - - /** - * Export logs that show total throttled Api requests for this subscription in the given time window. - * - * @param location The location upon which virtual-machine-sizes is queried. - * @param parameters Parameters supplied to the LogAnalytics getThrottledRequests Api. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return logAnalytics operation status response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - LogAnalyticsOperationResultInner exportThrottledRequests( - String location, ThrottledRequestsInput parameters, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/OperationsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/OperationsClient.java deleted file mode 100644 index 64b30c11ef3f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/OperationsClient.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.compute.fluent.models.ComputeOperationValueInner; - -/** An instance of this class provides access to all the operations defined in OperationsClient. */ -public interface OperationsClient { - /** - * Gets a list of compute operations. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of compute operations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Gets a list of compute operations. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of compute operations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Gets a list of compute operations. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of compute operations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/ProximityPlacementGroupsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/ProximityPlacementGroupsClient.java deleted file mode 100644 index becf2c59a452..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/ProximityPlacementGroupsClient.java +++ /dev/null @@ -1,349 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.compute.fluent.models.ProximityPlacementGroupInner; -import com.azure.resourcemanager.compute.models.ProximityPlacementGroupUpdate; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ProximityPlacementGroupsClient. */ -public interface ProximityPlacementGroupsClient - extends InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete { - /** - * Create or update a proximity placement group. - * - * @param resourceGroupName The name of the resource group. - * @param proximityPlacementGroupName The name of the proximity placement group. - * @param parameters Parameters supplied to the Create Proximity Placement Group operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the proximity placement group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String proximityPlacementGroupName, ProximityPlacementGroupInner parameters); - - /** - * Create or update a proximity placement group. - * - * @param resourceGroupName The name of the resource group. - * @param proximityPlacementGroupName The name of the proximity placement group. - * @param parameters Parameters supplied to the Create Proximity Placement Group operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the proximity placement group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, String proximityPlacementGroupName, ProximityPlacementGroupInner parameters); - - /** - * Create or update a proximity placement group. - * - * @param resourceGroupName The name of the resource group. - * @param proximityPlacementGroupName The name of the proximity placement group. - * @param parameters Parameters supplied to the Create Proximity Placement Group operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the proximity placement group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ProximityPlacementGroupInner createOrUpdate( - String resourceGroupName, String proximityPlacementGroupName, ProximityPlacementGroupInner parameters); - - /** - * Create or update a proximity placement group. - * - * @param resourceGroupName The name of the resource group. - * @param proximityPlacementGroupName The name of the proximity placement group. - * @param parameters Parameters supplied to the Create Proximity Placement Group operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the proximity placement group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, - String proximityPlacementGroupName, - ProximityPlacementGroupInner parameters, - Context context); - - /** - * Update a proximity placement group. - * - * @param resourceGroupName The name of the resource group. - * @param proximityPlacementGroupName The name of the proximity placement group. - * @param parameters Parameters supplied to the Update Proximity Placement Group operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the proximity placement group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateWithResponseAsync( - String resourceGroupName, String proximityPlacementGroupName, ProximityPlacementGroupUpdate parameters); - - /** - * Update a proximity placement group. - * - * @param resourceGroupName The name of the resource group. - * @param proximityPlacementGroupName The name of the proximity placement group. - * @param parameters Parameters supplied to the Update Proximity Placement Group operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the proximity placement group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAsync( - String resourceGroupName, String proximityPlacementGroupName, ProximityPlacementGroupUpdate parameters); - - /** - * Update a proximity placement group. - * - * @param resourceGroupName The name of the resource group. - * @param proximityPlacementGroupName The name of the proximity placement group. - * @param parameters Parameters supplied to the Update Proximity Placement Group operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the proximity placement group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ProximityPlacementGroupInner update( - String resourceGroupName, String proximityPlacementGroupName, ProximityPlacementGroupUpdate parameters); - - /** - * Update a proximity placement group. - * - * @param resourceGroupName The name of the resource group. - * @param proximityPlacementGroupName The name of the proximity placement group. - * @param parameters Parameters supplied to the Update Proximity Placement Group operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the proximity placement group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String resourceGroupName, - String proximityPlacementGroupName, - ProximityPlacementGroupUpdate parameters, - Context context); - - /** - * Delete a proximity placement group. - * - * @param resourceGroupName The name of the resource group. - * @param proximityPlacementGroupName The name of the proximity placement group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteWithResponseAsync(String resourceGroupName, String proximityPlacementGroupName); - - /** - * Delete a proximity placement group. - * - * @param resourceGroupName The name of the resource group. - * @param proximityPlacementGroupName The name of the proximity placement group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String proximityPlacementGroupName); - - /** - * Delete a proximity placement group. - * - * @param resourceGroupName The name of the resource group. - * @param proximityPlacementGroupName The name of the proximity placement group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String proximityPlacementGroupName); - - /** - * Delete a proximity placement group. - * - * @param resourceGroupName The name of the resource group. - * @param proximityPlacementGroupName The name of the proximity placement group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String proximityPlacementGroupName, Context context); - - /** - * Retrieves information about a proximity placement group . - * - * @param resourceGroupName The name of the resource group. - * @param proximityPlacementGroupName The name of the proximity placement group. - * @param includeColocationStatus includeColocationStatus=true enables fetching the colocation status of all the - * resources in the proximity placement group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the proximity placement group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String proximityPlacementGroupName, String includeColocationStatus); - - /** - * Retrieves information about a proximity placement group . - * - * @param resourceGroupName The name of the resource group. - * @param proximityPlacementGroupName The name of the proximity placement group. - * @param includeColocationStatus includeColocationStatus=true enables fetching the colocation status of all the - * resources in the proximity placement group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the proximity placement group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync( - String resourceGroupName, String proximityPlacementGroupName, String includeColocationStatus); - - /** - * Retrieves information about a proximity placement group . - * - * @param resourceGroupName The name of the resource group. - * @param proximityPlacementGroupName The name of the proximity placement group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the proximity placement group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync( - String resourceGroupName, String proximityPlacementGroupName); - - /** - * Retrieves information about a proximity placement group . - * - * @param resourceGroupName The name of the resource group. - * @param proximityPlacementGroupName The name of the proximity placement group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the proximity placement group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ProximityPlacementGroupInner getByResourceGroup(String resourceGroupName, String proximityPlacementGroupName); - - /** - * Retrieves information about a proximity placement group . - * - * @param resourceGroupName The name of the resource group. - * @param proximityPlacementGroupName The name of the proximity placement group. - * @param includeColocationStatus includeColocationStatus=true enables fetching the colocation status of all the - * resources in the proximity placement group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the proximity placement group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String proximityPlacementGroupName, String includeColocationStatus, Context context); - - /** - * Lists all proximity placement groups in a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Proximity Placement Group operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Lists all proximity placement groups in a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Proximity Placement Group operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Lists all proximity placement groups in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Proximity Placement Group operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Lists all proximity placement groups in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Proximity Placement Group operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName); - - /** - * Lists all proximity placement groups in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Proximity Placement Group operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Lists all proximity placement groups in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Proximity Placement Group operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/ResourceSkusClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/ResourceSkusClient.java deleted file mode 100644 index d7069b922c84..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/ResourceSkusClient.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.compute.fluent.models.ResourceSkuInner; - -/** An instance of this class provides access to all the operations defined in ResourceSkusClient. */ -public interface ResourceSkusClient { - /** - * Gets the list of Microsoft.Compute SKUs available for your Subscription. - * - * @param filter The filter to apply on the operation. Only **location** filter is supported currently. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Microsoft.Compute SKUs available for your Subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String filter); - - /** - * Gets the list of Microsoft.Compute SKUs available for your Subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Microsoft.Compute SKUs available for your Subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Gets the list of Microsoft.Compute SKUs available for your Subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Microsoft.Compute SKUs available for your Subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Gets the list of Microsoft.Compute SKUs available for your Subscription. - * - * @param filter The filter to apply on the operation. Only **location** filter is supported currently. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Microsoft.Compute SKUs available for your Subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String filter, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/SnapshotsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/SnapshotsClient.java deleted file mode 100644 index 0d166221692c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/SnapshotsClient.java +++ /dev/null @@ -1,689 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.compute.fluent.models.AccessUriInner; -import com.azure.resourcemanager.compute.fluent.models.SnapshotInner; -import com.azure.resourcemanager.compute.models.GrantAccessData; -import com.azure.resourcemanager.compute.models.SnapshotUpdate; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in SnapshotsClient. */ -public interface SnapshotsClient - extends InnerSupportsGet, InnerSupportsListing, InnerSupportsDelete { - /** - * Creates or updates a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param snapshot Snapshot object supplied in the body of the Put disk operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return snapshot resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String snapshotName, SnapshotInner snapshot); - - /** - * Creates or updates a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param snapshot Snapshot object supplied in the body of the Put disk operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return snapshot resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, SnapshotInner> beginCreateOrUpdateAsync( - String resourceGroupName, String snapshotName, SnapshotInner snapshot); - - /** - * Creates or updates a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param snapshot Snapshot object supplied in the body of the Put disk operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return snapshot resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, SnapshotInner> beginCreateOrUpdate( - String resourceGroupName, String snapshotName, SnapshotInner snapshot); - - /** - * Creates or updates a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param snapshot Snapshot object supplied in the body of the Put disk operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return snapshot resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, SnapshotInner> beginCreateOrUpdate( - String resourceGroupName, String snapshotName, SnapshotInner snapshot, Context context); - - /** - * Creates or updates a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param snapshot Snapshot object supplied in the body of the Put disk operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return snapshot resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync(String resourceGroupName, String snapshotName, SnapshotInner snapshot); - - /** - * Creates or updates a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param snapshot Snapshot object supplied in the body of the Put disk operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return snapshot resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SnapshotInner createOrUpdate(String resourceGroupName, String snapshotName, SnapshotInner snapshot); - - /** - * Creates or updates a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param snapshot Snapshot object supplied in the body of the Put disk operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return snapshot resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SnapshotInner createOrUpdate( - String resourceGroupName, String snapshotName, SnapshotInner snapshot, Context context); - - /** - * Updates (patches) a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param snapshot Snapshot object supplied in the body of the Patch snapshot operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return snapshot resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> updateWithResponseAsync( - String resourceGroupName, String snapshotName, SnapshotUpdate snapshot); - - /** - * Updates (patches) a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param snapshot Snapshot object supplied in the body of the Patch snapshot operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return snapshot resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, SnapshotInner> beginUpdateAsync( - String resourceGroupName, String snapshotName, SnapshotUpdate snapshot); - - /** - * Updates (patches) a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param snapshot Snapshot object supplied in the body of the Patch snapshot operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return snapshot resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, SnapshotInner> beginUpdate( - String resourceGroupName, String snapshotName, SnapshotUpdate snapshot); - - /** - * Updates (patches) a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param snapshot Snapshot object supplied in the body of the Patch snapshot operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return snapshot resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, SnapshotInner> beginUpdate( - String resourceGroupName, String snapshotName, SnapshotUpdate snapshot, Context context); - - /** - * Updates (patches) a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param snapshot Snapshot object supplied in the body of the Patch snapshot operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return snapshot resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAsync(String resourceGroupName, String snapshotName, SnapshotUpdate snapshot); - - /** - * Updates (patches) a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param snapshot Snapshot object supplied in the body of the Patch snapshot operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return snapshot resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SnapshotInner update(String resourceGroupName, String snapshotName, SnapshotUpdate snapshot); - - /** - * Updates (patches) a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param snapshot Snapshot object supplied in the body of the Patch snapshot operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return snapshot resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SnapshotInner update(String resourceGroupName, String snapshotName, SnapshotUpdate snapshot, Context context); - - /** - * Gets information about a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a snapshot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String snapshotName); - - /** - * Gets information about a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a snapshot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync(String resourceGroupName, String snapshotName); - - /** - * Gets information about a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a snapshot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SnapshotInner getByResourceGroup(String resourceGroupName, String snapshotName); - - /** - * Gets information about a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a snapshot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String snapshotName, Context context); - - /** - * Deletes a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync(String resourceGroupName, String snapshotName); - - /** - * Deletes a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String snapshotName); - - /** - * Deletes a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String snapshotName); - - /** - * Deletes a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String snapshotName, Context context); - - /** - * Deletes a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String snapshotName); - - /** - * Deletes a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String snapshotName); - - /** - * Deletes a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String snapshotName, Context context); - - /** - * Lists snapshots under a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Snapshots operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName); - - /** - * Lists snapshots under a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Snapshots operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Lists snapshots under a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Snapshots operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * Lists snapshots under a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Snapshots operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Lists snapshots under a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Snapshots operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Lists snapshots under a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Snapshots operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Grants access to a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param grantAccessData Access data object supplied in the body of the get snapshot access operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a disk access SAS uri. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> grantAccessWithResponseAsync( - String resourceGroupName, String snapshotName, GrantAccessData grantAccessData); - - /** - * Grants access to a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param grantAccessData Access data object supplied in the body of the get snapshot access operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a disk access SAS uri. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, AccessUriInner> beginGrantAccessAsync( - String resourceGroupName, String snapshotName, GrantAccessData grantAccessData); - - /** - * Grants access to a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param grantAccessData Access data object supplied in the body of the get snapshot access operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a disk access SAS uri. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, AccessUriInner> beginGrantAccess( - String resourceGroupName, String snapshotName, GrantAccessData grantAccessData); - - /** - * Grants access to a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param grantAccessData Access data object supplied in the body of the get snapshot access operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a disk access SAS uri. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, AccessUriInner> beginGrantAccess( - String resourceGroupName, String snapshotName, GrantAccessData grantAccessData, Context context); - - /** - * Grants access to a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param grantAccessData Access data object supplied in the body of the get snapshot access operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a disk access SAS uri. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono grantAccessAsync( - String resourceGroupName, String snapshotName, GrantAccessData grantAccessData); - - /** - * Grants access to a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param grantAccessData Access data object supplied in the body of the get snapshot access operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a disk access SAS uri. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AccessUriInner grantAccess(String resourceGroupName, String snapshotName, GrantAccessData grantAccessData); - - /** - * Grants access to a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param grantAccessData Access data object supplied in the body of the get snapshot access operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a disk access SAS uri. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AccessUriInner grantAccess( - String resourceGroupName, String snapshotName, GrantAccessData grantAccessData, Context context); - - /** - * Revokes access to a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> revokeAccessWithResponseAsync(String resourceGroupName, String snapshotName); - - /** - * Revokes access to a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginRevokeAccessAsync(String resourceGroupName, String snapshotName); - - /** - * Revokes access to a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginRevokeAccess(String resourceGroupName, String snapshotName); - - /** - * Revokes access to a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginRevokeAccess( - String resourceGroupName, String snapshotName, Context context); - - /** - * Revokes access to a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono revokeAccessAsync(String resourceGroupName, String snapshotName); - - /** - * Revokes access to a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void revokeAccess(String resourceGroupName, String snapshotName); - - /** - * Revokes access to a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void revokeAccess(String resourceGroupName, String snapshotName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/SshPublicKeysClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/SshPublicKeysClient.java deleted file mode 100644 index 591eaab67fac..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/SshPublicKeysClient.java +++ /dev/null @@ -1,389 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.compute.fluent.models.SshPublicKeyGenerateKeyPairResultInner; -import com.azure.resourcemanager.compute.fluent.models.SshPublicKeyResourceInner; -import com.azure.resourcemanager.compute.models.SshPublicKeyUpdateResource; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in SshPublicKeysClient. */ -public interface SshPublicKeysClient - extends InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete { - /** - * Lists all of the SSH public keys in the subscription. Use the nextLink property in the response to get the next - * page of SSH public keys. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list SSH public keys operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Lists all of the SSH public keys in the subscription. Use the nextLink property in the response to get the next - * page of SSH public keys. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list SSH public keys operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Lists all of the SSH public keys in the subscription. Use the nextLink property in the response to get the next - * page of SSH public keys. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list SSH public keys operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Lists all of the SSH public keys in the specified resource group. Use the nextLink property in the response to - * get the next page of SSH public keys. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list SSH public keys operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName); - - /** - * Lists all of the SSH public keys in the specified resource group. Use the nextLink property in the response to - * get the next page of SSH public keys. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list SSH public keys operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Lists all of the SSH public keys in the specified resource group. Use the nextLink property in the response to - * get the next page of SSH public keys. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list SSH public keys operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * Creates a new SSH public key resource. - * - * @param resourceGroupName The name of the resource group. - * @param sshPublicKeyName The name of the SSH public key. - * @param parameters Parameters supplied to create the SSH public key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the SSH public key. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createWithResponseAsync( - String resourceGroupName, String sshPublicKeyName, SshPublicKeyResourceInner parameters); - - /** - * Creates a new SSH public key resource. - * - * @param resourceGroupName The name of the resource group. - * @param sshPublicKeyName The name of the SSH public key. - * @param parameters Parameters supplied to create the SSH public key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the SSH public key. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createAsync( - String resourceGroupName, String sshPublicKeyName, SshPublicKeyResourceInner parameters); - - /** - * Creates a new SSH public key resource. - * - * @param resourceGroupName The name of the resource group. - * @param sshPublicKeyName The name of the SSH public key. - * @param parameters Parameters supplied to create the SSH public key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the SSH public key. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SshPublicKeyResourceInner create( - String resourceGroupName, String sshPublicKeyName, SshPublicKeyResourceInner parameters); - - /** - * Creates a new SSH public key resource. - * - * @param resourceGroupName The name of the resource group. - * @param sshPublicKeyName The name of the SSH public key. - * @param parameters Parameters supplied to create the SSH public key. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the SSH public key. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createWithResponse( - String resourceGroupName, String sshPublicKeyName, SshPublicKeyResourceInner parameters, Context context); - - /** - * Updates a new SSH public key resource. - * - * @param resourceGroupName The name of the resource group. - * @param sshPublicKeyName The name of the SSH public key. - * @param parameters Parameters supplied to update the SSH public key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the SSH public key. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateWithResponseAsync( - String resourceGroupName, String sshPublicKeyName, SshPublicKeyUpdateResource parameters); - - /** - * Updates a new SSH public key resource. - * - * @param resourceGroupName The name of the resource group. - * @param sshPublicKeyName The name of the SSH public key. - * @param parameters Parameters supplied to update the SSH public key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the SSH public key. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAsync( - String resourceGroupName, String sshPublicKeyName, SshPublicKeyUpdateResource parameters); - - /** - * Updates a new SSH public key resource. - * - * @param resourceGroupName The name of the resource group. - * @param sshPublicKeyName The name of the SSH public key. - * @param parameters Parameters supplied to update the SSH public key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the SSH public key. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SshPublicKeyResourceInner update( - String resourceGroupName, String sshPublicKeyName, SshPublicKeyUpdateResource parameters); - - /** - * Updates a new SSH public key resource. - * - * @param resourceGroupName The name of the resource group. - * @param sshPublicKeyName The name of the SSH public key. - * @param parameters Parameters supplied to update the SSH public key. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the SSH public key. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String resourceGroupName, String sshPublicKeyName, SshPublicKeyUpdateResource parameters, Context context); - - /** - * Delete an SSH public key. - * - * @param resourceGroupName The name of the resource group. - * @param sshPublicKeyName The name of the SSH public key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteWithResponseAsync(String resourceGroupName, String sshPublicKeyName); - - /** - * Delete an SSH public key. - * - * @param resourceGroupName The name of the resource group. - * @param sshPublicKeyName The name of the SSH public key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String sshPublicKeyName); - - /** - * Delete an SSH public key. - * - * @param resourceGroupName The name of the resource group. - * @param sshPublicKeyName The name of the SSH public key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String sshPublicKeyName); - - /** - * Delete an SSH public key. - * - * @param resourceGroupName The name of the resource group. - * @param sshPublicKeyName The name of the SSH public key. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String sshPublicKeyName, Context context); - - /** - * Retrieves information about an SSH public key. - * - * @param resourceGroupName The name of the resource group. - * @param sshPublicKeyName The name of the SSH public key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the SSH public key. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String sshPublicKeyName); - - /** - * Retrieves information about an SSH public key. - * - * @param resourceGroupName The name of the resource group. - * @param sshPublicKeyName The name of the SSH public key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the SSH public key. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync(String resourceGroupName, String sshPublicKeyName); - - /** - * Retrieves information about an SSH public key. - * - * @param resourceGroupName The name of the resource group. - * @param sshPublicKeyName The name of the SSH public key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the SSH public key. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SshPublicKeyResourceInner getByResourceGroup(String resourceGroupName, String sshPublicKeyName); - - /** - * Retrieves information about an SSH public key. - * - * @param resourceGroupName The name of the resource group. - * @param sshPublicKeyName The name of the SSH public key. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the SSH public key. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String sshPublicKeyName, Context context); - - /** - * Generates and returns a public/private key pair and populates the SSH public key resource with the public key. - * The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource. - * - * @param resourceGroupName The name of the resource group. - * @param sshPublicKeyName The name of the SSH public key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response from generation of an SSH key pair. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> generateKeyPairWithResponseAsync( - String resourceGroupName, String sshPublicKeyName); - - /** - * Generates and returns a public/private key pair and populates the SSH public key resource with the public key. - * The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource. - * - * @param resourceGroupName The name of the resource group. - * @param sshPublicKeyName The name of the SSH public key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response from generation of an SSH key pair. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono generateKeyPairAsync( - String resourceGroupName, String sshPublicKeyName); - - /** - * Generates and returns a public/private key pair and populates the SSH public key resource with the public key. - * The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource. - * - * @param resourceGroupName The name of the resource group. - * @param sshPublicKeyName The name of the SSH public key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response from generation of an SSH key pair. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SshPublicKeyGenerateKeyPairResultInner generateKeyPair(String resourceGroupName, String sshPublicKeyName); - - /** - * Generates and returns a public/private key pair and populates the SSH public key resource with the public key. - * The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource. - * - * @param resourceGroupName The name of the resource group. - * @param sshPublicKeyName The name of the SSH public key. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response from generation of an SSH key pair. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response generateKeyPairWithResponse( - String resourceGroupName, String sshPublicKeyName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/UsagesClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/UsagesClient.java deleted file mode 100644 index 79473ba5a02b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/UsagesClient.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.compute.fluent.models.UsageInner; - -/** An instance of this class provides access to all the operations defined in UsagesClient. */ -public interface UsagesClient { - /** - * Gets, for the specified location, the current compute resource usage information as well as the limits for - * compute resources under the subscription. - * - * @param location The location for which resource usage is queried. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Usages operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String location); - - /** - * Gets, for the specified location, the current compute resource usage information as well as the limits for - * compute resources under the subscription. - * - * @param location The location for which resource usage is queried. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Usages operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String location); - - /** - * Gets, for the specified location, the current compute resource usage information as well as the limits for - * compute resources under the subscription. - * - * @param location The location for which resource usage is queried. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Usages operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String location, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineExtensionImagesClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineExtensionImagesClient.java deleted file mode 100644 index ad1349594285..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineExtensionImagesClient.java +++ /dev/null @@ -1,224 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineExtensionImageInner; -import java.util.List; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in VirtualMachineExtensionImagesClient. */ -public interface VirtualMachineExtensionImagesClient { - /** - * Gets a virtual machine extension image. - * - * @param location The name of a supported Azure region. - * @param publisherName The publisherName parameter. - * @param type The type parameter. - * @param version The version parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual machine extension image. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync( - String location, String publisherName, String type, String version); - - /** - * Gets a virtual machine extension image. - * - * @param location The name of a supported Azure region. - * @param publisherName The publisherName parameter. - * @param type The type parameter. - * @param version The version parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual machine extension image. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync( - String location, String publisherName, String type, String version); - - /** - * Gets a virtual machine extension image. - * - * @param location The name of a supported Azure region. - * @param publisherName The publisherName parameter. - * @param type The type parameter. - * @param version The version parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual machine extension image. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualMachineExtensionImageInner get(String location, String publisherName, String type, String version); - - /** - * Gets a virtual machine extension image. - * - * @param location The name of a supported Azure region. - * @param publisherName The publisherName parameter. - * @param type The type parameter. - * @param version The version parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual machine extension image. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String location, String publisherName, String type, String version, Context context); - - /** - * Gets a list of virtual machine extension image types. - * - * @param location The name of a supported Azure region. - * @param publisherName The publisherName parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of virtual machine extension image types. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> listTypesWithResponseAsync( - String location, String publisherName); - - /** - * Gets a list of virtual machine extension image types. - * - * @param location The name of a supported Azure region. - * @param publisherName The publisherName parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of virtual machine extension image types. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listTypesAsync(String location, String publisherName); - - /** - * Gets a list of virtual machine extension image types. - * - * @param location The name of a supported Azure region. - * @param publisherName The publisherName parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of virtual machine extension image types. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - List listTypes(String location, String publisherName); - - /** - * Gets a list of virtual machine extension image types. - * - * @param location The name of a supported Azure region. - * @param publisherName The publisherName parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of virtual machine extension image types. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response> listTypesWithResponse( - String location, String publisherName, Context context); - - /** - * Gets a list of virtual machine extension image versions. - * - * @param location The name of a supported Azure region. - * @param publisherName The publisherName parameter. - * @param type The type parameter. - * @param filter The filter to apply on the operation. - * @param top The top parameter. - * @param orderby The orderby parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of virtual machine extension image versions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> listVersionsWithResponseAsync( - String location, String publisherName, String type, String filter, Integer top, String orderby); - - /** - * Gets a list of virtual machine extension image versions. - * - * @param location The name of a supported Azure region. - * @param publisherName The publisherName parameter. - * @param type The type parameter. - * @param filter The filter to apply on the operation. - * @param top The top parameter. - * @param orderby The orderby parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of virtual machine extension image versions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listVersionsAsync( - String location, String publisherName, String type, String filter, Integer top, String orderby); - - /** - * Gets a list of virtual machine extension image versions. - * - * @param location The name of a supported Azure region. - * @param publisherName The publisherName parameter. - * @param type The type parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of virtual machine extension image versions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listVersionsAsync(String location, String publisherName, String type); - - /** - * Gets a list of virtual machine extension image versions. - * - * @param location The name of a supported Azure region. - * @param publisherName The publisherName parameter. - * @param type The type parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of virtual machine extension image versions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - List listVersions(String location, String publisherName, String type); - - /** - * Gets a list of virtual machine extension image versions. - * - * @param location The name of a supported Azure region. - * @param publisherName The publisherName parameter. - * @param type The type parameter. - * @param filter The filter to apply on the operation. - * @param top The top parameter. - * @param orderby The orderby parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of virtual machine extension image versions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response> listVersionsWithResponse( - String location, - String publisherName, - String type, - String filter, - Integer top, - String orderby, - Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineExtensionsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineExtensionsClient.java deleted file mode 100644 index 76e05196b90a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineExtensionsClient.java +++ /dev/null @@ -1,545 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineExtensionInner; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineExtensionsListResultInner; -import com.azure.resourcemanager.compute.models.VirtualMachineExtensionUpdate; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in VirtualMachineExtensionsClient. */ -public interface VirtualMachineExtensionsClient { - /** - * The operation to create or update the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be created or updated. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Create Virtual Machine Extension operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String vmName, - String vmExtensionName, - VirtualMachineExtensionInner extensionParameters); - - /** - * The operation to create or update the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be created or updated. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Create Virtual Machine Extension operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, VirtualMachineExtensionInner> beginCreateOrUpdateAsync( - String resourceGroupName, - String vmName, - String vmExtensionName, - VirtualMachineExtensionInner extensionParameters); - - /** - * The operation to create or update the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be created or updated. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Create Virtual Machine Extension operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VirtualMachineExtensionInner> beginCreateOrUpdate( - String resourceGroupName, - String vmName, - String vmExtensionName, - VirtualMachineExtensionInner extensionParameters); - - /** - * The operation to create or update the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be created or updated. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Create Virtual Machine Extension operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VirtualMachineExtensionInner> beginCreateOrUpdate( - String resourceGroupName, - String vmName, - String vmExtensionName, - VirtualMachineExtensionInner extensionParameters, - Context context); - - /** - * The operation to create or update the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be created or updated. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Create Virtual Machine Extension operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, - String vmName, - String vmExtensionName, - VirtualMachineExtensionInner extensionParameters); - - /** - * The operation to create or update the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be created or updated. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Create Virtual Machine Extension operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualMachineExtensionInner createOrUpdate( - String resourceGroupName, - String vmName, - String vmExtensionName, - VirtualMachineExtensionInner extensionParameters); - - /** - * The operation to create or update the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be created or updated. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Create Virtual Machine Extension operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualMachineExtensionInner createOrUpdate( - String resourceGroupName, - String vmName, - String vmExtensionName, - VirtualMachineExtensionInner extensionParameters, - Context context); - - /** - * The operation to update the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be updated. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Update Virtual Machine Extension operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> updateWithResponseAsync( - String resourceGroupName, - String vmName, - String vmExtensionName, - VirtualMachineExtensionUpdate extensionParameters); - - /** - * The operation to update the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be updated. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Update Virtual Machine Extension operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, VirtualMachineExtensionInner> beginUpdateAsync( - String resourceGroupName, - String vmName, - String vmExtensionName, - VirtualMachineExtensionUpdate extensionParameters); - - /** - * The operation to update the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be updated. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Update Virtual Machine Extension operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VirtualMachineExtensionInner> beginUpdate( - String resourceGroupName, - String vmName, - String vmExtensionName, - VirtualMachineExtensionUpdate extensionParameters); - - /** - * The operation to update the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be updated. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Update Virtual Machine Extension operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VirtualMachineExtensionInner> beginUpdate( - String resourceGroupName, - String vmName, - String vmExtensionName, - VirtualMachineExtensionUpdate extensionParameters, - Context context); - - /** - * The operation to update the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be updated. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Update Virtual Machine Extension operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAsync( - String resourceGroupName, - String vmName, - String vmExtensionName, - VirtualMachineExtensionUpdate extensionParameters); - - /** - * The operation to update the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be updated. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Update Virtual Machine Extension operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualMachineExtensionInner update( - String resourceGroupName, - String vmName, - String vmExtensionName, - VirtualMachineExtensionUpdate extensionParameters); - - /** - * The operation to update the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be updated. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Update Virtual Machine Extension operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualMachineExtensionInner update( - String resourceGroupName, - String vmName, - String vmExtensionName, - VirtualMachineExtensionUpdate extensionParameters, - Context context); - - /** - * The operation to delete the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be deleted. - * @param vmExtensionName The name of the virtual machine extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync( - String resourceGroupName, String vmName, String vmExtensionName); - - /** - * The operation to delete the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be deleted. - * @param vmExtensionName The name of the virtual machine extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String vmName, String vmExtensionName); - - /** - * The operation to delete the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be deleted. - * @param vmExtensionName The name of the virtual machine extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String vmName, String vmExtensionName); - - /** - * The operation to delete the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be deleted. - * @param vmExtensionName The name of the virtual machine extension. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String vmName, String vmExtensionName, Context context); - - /** - * The operation to delete the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be deleted. - * @param vmExtensionName The name of the virtual machine extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String vmName, String vmExtensionName); - - /** - * The operation to delete the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be deleted. - * @param vmExtensionName The name of the virtual machine extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String vmName, String vmExtensionName); - - /** - * The operation to delete the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be deleted. - * @param vmExtensionName The name of the virtual machine extension. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String vmName, String vmExtensionName, Context context); - - /** - * The operation to get the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine containing the extension. - * @param vmExtensionName The name of the virtual machine extension. - * @param expand The expand expression to apply on the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync( - String resourceGroupName, String vmName, String vmExtensionName, String expand); - - /** - * The operation to get the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine containing the extension. - * @param vmExtensionName The name of the virtual machine extension. - * @param expand The expand expression to apply on the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync( - String resourceGroupName, String vmName, String vmExtensionName, String expand); - - /** - * The operation to get the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine containing the extension. - * @param vmExtensionName The name of the virtual machine extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync(String resourceGroupName, String vmName, String vmExtensionName); - - /** - * The operation to get the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine containing the extension. - * @param vmExtensionName The name of the virtual machine extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualMachineExtensionInner get(String resourceGroupName, String vmName, String vmExtensionName); - - /** - * The operation to get the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine containing the extension. - * @param vmExtensionName The name of the virtual machine extension. - * @param expand The expand expression to apply on the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String vmName, String vmExtensionName, String expand, Context context); - - /** - * The operation to get all extensions of a Virtual Machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine containing the extension. - * @param expand The expand expression to apply on the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Extension operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listWithResponseAsync( - String resourceGroupName, String vmName, String expand); - - /** - * The operation to get all extensions of a Virtual Machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine containing the extension. - * @param expand The expand expression to apply on the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Extension operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listAsync(String resourceGroupName, String vmName, String expand); - - /** - * The operation to get all extensions of a Virtual Machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine containing the extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Extension operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listAsync(String resourceGroupName, String vmName); - - /** - * The operation to get all extensions of a Virtual Machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine containing the extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Extension operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualMachineExtensionsListResultInner list(String resourceGroupName, String vmName); - - /** - * The operation to get all extensions of a Virtual Machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine containing the extension. - * @param expand The expand expression to apply on the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Extension operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listWithResponse( - String resourceGroupName, String vmName, String expand, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineImagesClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineImagesClient.java deleted file mode 100644 index 218d77dde621..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineImagesClient.java +++ /dev/null @@ -1,344 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineImageInner; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineImageResourceInner; -import java.util.List; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in VirtualMachineImagesClient. */ -public interface VirtualMachineImagesClient { - /** - * Gets a virtual machine image. - * - * @param location The name of a supported Azure region. - * @param publisherName A valid image publisher. - * @param offer A valid image publisher offer. - * @param skus A valid image SKU. - * @param version A valid image SKU version. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual machine image. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync( - String location, String publisherName, String offer, String skus, String version); - - /** - * Gets a virtual machine image. - * - * @param location The name of a supported Azure region. - * @param publisherName A valid image publisher. - * @param offer A valid image publisher offer. - * @param skus A valid image SKU. - * @param version A valid image SKU version. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual machine image. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync( - String location, String publisherName, String offer, String skus, String version); - - /** - * Gets a virtual machine image. - * - * @param location The name of a supported Azure region. - * @param publisherName A valid image publisher. - * @param offer A valid image publisher offer. - * @param skus A valid image SKU. - * @param version A valid image SKU version. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual machine image. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualMachineImageInner get(String location, String publisherName, String offer, String skus, String version); - - /** - * Gets a virtual machine image. - * - * @param location The name of a supported Azure region. - * @param publisherName A valid image publisher. - * @param offer A valid image publisher offer. - * @param skus A valid image SKU. - * @param version A valid image SKU version. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual machine image. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String location, String publisherName, String offer, String skus, String version, Context context); - - /** - * Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. - * - * @param location The name of a supported Azure region. - * @param publisherName A valid image publisher. - * @param offer A valid image publisher offer. - * @param skus A valid image SKU. - * @param expand The expand expression to apply on the operation. - * @param top The top parameter. - * @param orderby The orderby parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> listWithResponseAsync( - String location, String publisherName, String offer, String skus, String expand, Integer top, String orderby); - - /** - * Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. - * - * @param location The name of a supported Azure region. - * @param publisherName A valid image publisher. - * @param offer A valid image publisher offer. - * @param skus A valid image SKU. - * @param expand The expand expression to apply on the operation. - * @param top The top parameter. - * @param orderby The orderby parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listAsync( - String location, String publisherName, String offer, String skus, String expand, Integer top, String orderby); - - /** - * Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. - * - * @param location The name of a supported Azure region. - * @param publisherName A valid image publisher. - * @param offer A valid image publisher offer. - * @param skus A valid image SKU. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listAsync( - String location, String publisherName, String offer, String skus); - - /** - * Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. - * - * @param location The name of a supported Azure region. - * @param publisherName A valid image publisher. - * @param offer A valid image publisher offer. - * @param skus A valid image SKU. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - List list(String location, String publisherName, String offer, String skus); - - /** - * Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. - * - * @param location The name of a supported Azure region. - * @param publisherName A valid image publisher. - * @param offer A valid image publisher offer. - * @param skus A valid image SKU. - * @param expand The expand expression to apply on the operation. - * @param top The top parameter. - * @param orderby The orderby parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response> listWithResponse( - String location, - String publisherName, - String offer, - String skus, - String expand, - Integer top, - String orderby, - Context context); - - /** - * Gets a list of virtual machine image offers for the specified location and publisher. - * - * @param location The name of a supported Azure region. - * @param publisherName A valid image publisher. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of virtual machine image offers for the specified location and publisher. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> listOffersWithResponseAsync( - String location, String publisherName); - - /** - * Gets a list of virtual machine image offers for the specified location and publisher. - * - * @param location The name of a supported Azure region. - * @param publisherName A valid image publisher. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of virtual machine image offers for the specified location and publisher. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listOffersAsync(String location, String publisherName); - - /** - * Gets a list of virtual machine image offers for the specified location and publisher. - * - * @param location The name of a supported Azure region. - * @param publisherName A valid image publisher. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of virtual machine image offers for the specified location and publisher. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - List listOffers(String location, String publisherName); - - /** - * Gets a list of virtual machine image offers for the specified location and publisher. - * - * @param location The name of a supported Azure region. - * @param publisherName A valid image publisher. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of virtual machine image offers for the specified location and publisher. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response> listOffersWithResponse( - String location, String publisherName, Context context); - - /** - * Gets a list of virtual machine image publishers for the specified Azure location. - * - * @param location The name of a supported Azure region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of virtual machine image publishers for the specified Azure location. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> listPublishersWithResponseAsync(String location); - - /** - * Gets a list of virtual machine image publishers for the specified Azure location. - * - * @param location The name of a supported Azure region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of virtual machine image publishers for the specified Azure location. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listPublishersAsync(String location); - - /** - * Gets a list of virtual machine image publishers for the specified Azure location. - * - * @param location The name of a supported Azure region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of virtual machine image publishers for the specified Azure location. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - List listPublishers(String location); - - /** - * Gets a list of virtual machine image publishers for the specified Azure location. - * - * @param location The name of a supported Azure region. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of virtual machine image publishers for the specified Azure location. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response> listPublishersWithResponse(String location, Context context); - - /** - * Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. - * - * @param location The name of a supported Azure region. - * @param publisherName A valid image publisher. - * @param offer A valid image publisher offer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of virtual machine image SKUs for the specified location, publisher, and offer. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> listSkusWithResponseAsync( - String location, String publisherName, String offer); - - /** - * Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. - * - * @param location The name of a supported Azure region. - * @param publisherName A valid image publisher. - * @param offer A valid image publisher offer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of virtual machine image SKUs for the specified location, publisher, and offer. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listSkusAsync(String location, String publisherName, String offer); - - /** - * Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. - * - * @param location The name of a supported Azure region. - * @param publisherName A valid image publisher. - * @param offer A valid image publisher offer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of virtual machine image SKUs for the specified location, publisher, and offer. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - List listSkus(String location, String publisherName, String offer); - - /** - * Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. - * - * @param location The name of a supported Azure region. - * @param publisherName A valid image publisher. - * @param offer A valid image publisher offer. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of virtual machine image SKUs for the specified location, publisher, and offer. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response> listSkusWithResponse( - String location, String publisherName, String offer, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineRunCommandsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineRunCommandsClient.java deleted file mode 100644 index ecec66c6306d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineRunCommandsClient.java +++ /dev/null @@ -1,594 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.compute.fluent.models.RunCommandDocumentBaseInner; -import com.azure.resourcemanager.compute.fluent.models.RunCommandDocumentInner; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineRunCommandInner; -import com.azure.resourcemanager.compute.models.VirtualMachineRunCommandUpdate; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in VirtualMachineRunCommandsClient. */ -public interface VirtualMachineRunCommandsClient { - /** - * Lists all available run commands for a subscription in a location. - * - * @param location The location upon which run commands is queried. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Virtual Machine operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String location); - - /** - * Lists all available run commands for a subscription in a location. - * - * @param location The location upon which run commands is queried. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Virtual Machine operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String location); - - /** - * Lists all available run commands for a subscription in a location. - * - * @param location The location upon which run commands is queried. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Virtual Machine operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String location, Context context); - - /** - * Gets specific run command for a subscription in a location. - * - * @param location The location upon which run commands is queried. - * @param commandId The command id. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specific run command for a subscription in a location. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync(String location, String commandId); - - /** - * Gets specific run command for a subscription in a location. - * - * @param location The location upon which run commands is queried. - * @param commandId The command id. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specific run command for a subscription in a location. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync(String location, String commandId); - - /** - * Gets specific run command for a subscription in a location. - * - * @param location The location upon which run commands is queried. - * @param commandId The command id. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specific run command for a subscription in a location. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RunCommandDocumentInner get(String location, String commandId); - - /** - * Gets specific run command for a subscription in a location. - * - * @param location The location upon which run commands is queried. - * @param commandId The command id. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specific run command for a subscription in a location. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String location, String commandId, Context context); - - /** - * The operation to create or update the run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the run command should be created or updated. - * @param runCommandName The name of the virtual machine run command. - * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String vmName, String runCommandName, VirtualMachineRunCommandInner runCommand); - - /** - * The operation to create or update the run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the run command should be created or updated. - * @param runCommandName The name of the virtual machine run command. - * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, VirtualMachineRunCommandInner> beginCreateOrUpdateAsync( - String resourceGroupName, String vmName, String runCommandName, VirtualMachineRunCommandInner runCommand); - - /** - * The operation to create or update the run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the run command should be created or updated. - * @param runCommandName The name of the virtual machine run command. - * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VirtualMachineRunCommandInner> beginCreateOrUpdate( - String resourceGroupName, String vmName, String runCommandName, VirtualMachineRunCommandInner runCommand); - - /** - * The operation to create or update the run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the run command should be created or updated. - * @param runCommandName The name of the virtual machine run command. - * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VirtualMachineRunCommandInner> beginCreateOrUpdate( - String resourceGroupName, - String vmName, - String runCommandName, - VirtualMachineRunCommandInner runCommand, - Context context); - - /** - * The operation to create or update the run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the run command should be created or updated. - * @param runCommandName The name of the virtual machine run command. - * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, String vmName, String runCommandName, VirtualMachineRunCommandInner runCommand); - - /** - * The operation to create or update the run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the run command should be created or updated. - * @param runCommandName The name of the virtual machine run command. - * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualMachineRunCommandInner createOrUpdate( - String resourceGroupName, String vmName, String runCommandName, VirtualMachineRunCommandInner runCommand); - - /** - * The operation to create or update the run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the run command should be created or updated. - * @param runCommandName The name of the virtual machine run command. - * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualMachineRunCommandInner createOrUpdate( - String resourceGroupName, - String vmName, - String runCommandName, - VirtualMachineRunCommandInner runCommand, - Context context); - - /** - * The operation to update the run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the run command should be updated. - * @param runCommandName The name of the virtual machine run command. - * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> updateWithResponseAsync( - String resourceGroupName, String vmName, String runCommandName, VirtualMachineRunCommandUpdate runCommand); - - /** - * The operation to update the run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the run command should be updated. - * @param runCommandName The name of the virtual machine run command. - * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, VirtualMachineRunCommandInner> beginUpdateAsync( - String resourceGroupName, String vmName, String runCommandName, VirtualMachineRunCommandUpdate runCommand); - - /** - * The operation to update the run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the run command should be updated. - * @param runCommandName The name of the virtual machine run command. - * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VirtualMachineRunCommandInner> beginUpdate( - String resourceGroupName, String vmName, String runCommandName, VirtualMachineRunCommandUpdate runCommand); - - /** - * The operation to update the run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the run command should be updated. - * @param runCommandName The name of the virtual machine run command. - * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VirtualMachineRunCommandInner> beginUpdate( - String resourceGroupName, - String vmName, - String runCommandName, - VirtualMachineRunCommandUpdate runCommand, - Context context); - - /** - * The operation to update the run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the run command should be updated. - * @param runCommandName The name of the virtual machine run command. - * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAsync( - String resourceGroupName, String vmName, String runCommandName, VirtualMachineRunCommandUpdate runCommand); - - /** - * The operation to update the run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the run command should be updated. - * @param runCommandName The name of the virtual machine run command. - * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualMachineRunCommandInner update( - String resourceGroupName, String vmName, String runCommandName, VirtualMachineRunCommandUpdate runCommand); - - /** - * The operation to update the run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the run command should be updated. - * @param runCommandName The name of the virtual machine run command. - * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualMachineRunCommandInner update( - String resourceGroupName, - String vmName, - String runCommandName, - VirtualMachineRunCommandUpdate runCommand, - Context context); - - /** - * The operation to delete the run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the run command should be deleted. - * @param runCommandName The name of the virtual machine run command. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync( - String resourceGroupName, String vmName, String runCommandName); - - /** - * The operation to delete the run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the run command should be deleted. - * @param runCommandName The name of the virtual machine run command. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String vmName, String runCommandName); - - /** - * The operation to delete the run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the run command should be deleted. - * @param runCommandName The name of the virtual machine run command. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String vmName, String runCommandName); - - /** - * The operation to delete the run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the run command should be deleted. - * @param runCommandName The name of the virtual machine run command. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String vmName, String runCommandName, Context context); - - /** - * The operation to delete the run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the run command should be deleted. - * @param runCommandName The name of the virtual machine run command. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String vmName, String runCommandName); - - /** - * The operation to delete the run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the run command should be deleted. - * @param runCommandName The name of the virtual machine run command. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String vmName, String runCommandName); - - /** - * The operation to delete the run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the run command should be deleted. - * @param runCommandName The name of the virtual machine run command. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String vmName, String runCommandName, Context context); - - /** - * The operation to get the run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine containing the run command. - * @param runCommandName The name of the virtual machine run command. - * @param expand The expand expression to apply on the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByVirtualMachineWithResponseAsync( - String resourceGroupName, String vmName, String runCommandName, String expand); - - /** - * The operation to get the run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine containing the run command. - * @param runCommandName The name of the virtual machine run command. - * @param expand The expand expression to apply on the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByVirtualMachineAsync( - String resourceGroupName, String vmName, String runCommandName, String expand); - - /** - * The operation to get the run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine containing the run command. - * @param runCommandName The name of the virtual machine run command. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByVirtualMachineAsync( - String resourceGroupName, String vmName, String runCommandName); - - /** - * The operation to get the run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine containing the run command. - * @param runCommandName The name of the virtual machine run command. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualMachineRunCommandInner getByVirtualMachine(String resourceGroupName, String vmName, String runCommandName); - - /** - * The operation to get the run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine containing the run command. - * @param runCommandName The name of the virtual machine run command. - * @param expand The expand expression to apply on the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByVirtualMachineWithResponse( - String resourceGroupName, String vmName, String runCommandName, String expand, Context context); - - /** - * The operation to get all run commands of a Virtual Machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine containing the run command. - * @param expand The expand expression to apply on the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List run command operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByVirtualMachineAsync( - String resourceGroupName, String vmName, String expand); - - /** - * The operation to get all run commands of a Virtual Machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine containing the run command. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List run command operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByVirtualMachineAsync(String resourceGroupName, String vmName); - - /** - * The operation to get all run commands of a Virtual Machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine containing the run command. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List run command operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByVirtualMachine(String resourceGroupName, String vmName); - - /** - * The operation to get all run commands of a Virtual Machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine containing the run command. - * @param expand The expand expression to apply on the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List run command operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByVirtualMachine( - String resourceGroupName, String vmName, String expand, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineScaleSetExtensionsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineScaleSetExtensionsClient.java deleted file mode 100644 index fddb33e0c2bc..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineScaleSetExtensionsClient.java +++ /dev/null @@ -1,523 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineScaleSetExtensionInner; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetExtensionUpdate; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in VirtualMachineScaleSetExtensionsClient. - */ -public interface VirtualMachineScaleSetExtensionsClient { - /** - * The operation to create or update an extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. - * @param vmssExtensionName The name of the VM scale set extension. - * @param extensionParameters Parameters supplied to the Create VM scale set Extension operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String vmScaleSetName, - String vmssExtensionName, - VirtualMachineScaleSetExtensionInner extensionParameters); - - /** - * The operation to create or update an extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. - * @param vmssExtensionName The name of the VM scale set extension. - * @param extensionParameters Parameters supplied to the Create VM scale set Extension operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, VirtualMachineScaleSetExtensionInner> - beginCreateOrUpdateAsync( - String resourceGroupName, - String vmScaleSetName, - String vmssExtensionName, - VirtualMachineScaleSetExtensionInner extensionParameters); - - /** - * The operation to create or update an extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. - * @param vmssExtensionName The name of the VM scale set extension. - * @param extensionParameters Parameters supplied to the Create VM scale set Extension operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VirtualMachineScaleSetExtensionInner> - beginCreateOrUpdate( - String resourceGroupName, - String vmScaleSetName, - String vmssExtensionName, - VirtualMachineScaleSetExtensionInner extensionParameters); - - /** - * The operation to create or update an extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. - * @param vmssExtensionName The name of the VM scale set extension. - * @param extensionParameters Parameters supplied to the Create VM scale set Extension operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VirtualMachineScaleSetExtensionInner> - beginCreateOrUpdate( - String resourceGroupName, - String vmScaleSetName, - String vmssExtensionName, - VirtualMachineScaleSetExtensionInner extensionParameters, - Context context); - - /** - * The operation to create or update an extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. - * @param vmssExtensionName The name of the VM scale set extension. - * @param extensionParameters Parameters supplied to the Create VM scale set Extension operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, - String vmScaleSetName, - String vmssExtensionName, - VirtualMachineScaleSetExtensionInner extensionParameters); - - /** - * The operation to create or update an extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. - * @param vmssExtensionName The name of the VM scale set extension. - * @param extensionParameters Parameters supplied to the Create VM scale set Extension operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualMachineScaleSetExtensionInner createOrUpdate( - String resourceGroupName, - String vmScaleSetName, - String vmssExtensionName, - VirtualMachineScaleSetExtensionInner extensionParameters); - - /** - * The operation to create or update an extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. - * @param vmssExtensionName The name of the VM scale set extension. - * @param extensionParameters Parameters supplied to the Create VM scale set Extension operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualMachineScaleSetExtensionInner createOrUpdate( - String resourceGroupName, - String vmScaleSetName, - String vmssExtensionName, - VirtualMachineScaleSetExtensionInner extensionParameters, - Context context); - - /** - * The operation to update an extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be updated. - * @param vmssExtensionName The name of the VM scale set extension. - * @param extensionParameters Parameters supplied to the Update VM scale set Extension operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> updateWithResponseAsync( - String resourceGroupName, - String vmScaleSetName, - String vmssExtensionName, - VirtualMachineScaleSetExtensionUpdate extensionParameters); - - /** - * The operation to update an extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be updated. - * @param vmssExtensionName The name of the VM scale set extension. - * @param extensionParameters Parameters supplied to the Update VM scale set Extension operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, VirtualMachineScaleSetExtensionInner> beginUpdateAsync( - String resourceGroupName, - String vmScaleSetName, - String vmssExtensionName, - VirtualMachineScaleSetExtensionUpdate extensionParameters); - - /** - * The operation to update an extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be updated. - * @param vmssExtensionName The name of the VM scale set extension. - * @param extensionParameters Parameters supplied to the Update VM scale set Extension operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VirtualMachineScaleSetExtensionInner> beginUpdate( - String resourceGroupName, - String vmScaleSetName, - String vmssExtensionName, - VirtualMachineScaleSetExtensionUpdate extensionParameters); - - /** - * The operation to update an extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be updated. - * @param vmssExtensionName The name of the VM scale set extension. - * @param extensionParameters Parameters supplied to the Update VM scale set Extension operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VirtualMachineScaleSetExtensionInner> beginUpdate( - String resourceGroupName, - String vmScaleSetName, - String vmssExtensionName, - VirtualMachineScaleSetExtensionUpdate extensionParameters, - Context context); - - /** - * The operation to update an extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be updated. - * @param vmssExtensionName The name of the VM scale set extension. - * @param extensionParameters Parameters supplied to the Update VM scale set Extension operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAsync( - String resourceGroupName, - String vmScaleSetName, - String vmssExtensionName, - VirtualMachineScaleSetExtensionUpdate extensionParameters); - - /** - * The operation to update an extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be updated. - * @param vmssExtensionName The name of the VM scale set extension. - * @param extensionParameters Parameters supplied to the Update VM scale set Extension operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualMachineScaleSetExtensionInner update( - String resourceGroupName, - String vmScaleSetName, - String vmssExtensionName, - VirtualMachineScaleSetExtensionUpdate extensionParameters); - - /** - * The operation to update an extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be updated. - * @param vmssExtensionName The name of the VM scale set extension. - * @param extensionParameters Parameters supplied to the Update VM scale set Extension operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualMachineScaleSetExtensionInner update( - String resourceGroupName, - String vmScaleSetName, - String vmssExtensionName, - VirtualMachineScaleSetExtensionUpdate extensionParameters, - Context context); - - /** - * The operation to delete the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be deleted. - * @param vmssExtensionName The name of the VM scale set extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String vmssExtensionName); - - /** - * The operation to delete the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be deleted. - * @param vmssExtensionName The name of the VM scale set extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String vmScaleSetName, String vmssExtensionName); - - /** - * The operation to delete the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be deleted. - * @param vmssExtensionName The name of the VM scale set extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String vmScaleSetName, String vmssExtensionName); - - /** - * The operation to delete the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be deleted. - * @param vmssExtensionName The name of the VM scale set extension. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String vmScaleSetName, String vmssExtensionName, Context context); - - /** - * The operation to delete the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be deleted. - * @param vmssExtensionName The name of the VM scale set extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String vmScaleSetName, String vmssExtensionName); - - /** - * The operation to delete the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be deleted. - * @param vmssExtensionName The name of the VM scale set extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String vmScaleSetName, String vmssExtensionName); - - /** - * The operation to delete the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be deleted. - * @param vmssExtensionName The name of the VM scale set extension. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String vmScaleSetName, String vmssExtensionName, Context context); - - /** - * The operation to get the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set containing the extension. - * @param vmssExtensionName The name of the VM scale set extension. - * @param expand The expand expression to apply on the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String vmssExtensionName, String expand); - - /** - * The operation to get the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set containing the extension. - * @param vmssExtensionName The name of the VM scale set extension. - * @param expand The expand expression to apply on the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync( - String resourceGroupName, String vmScaleSetName, String vmssExtensionName, String expand); - - /** - * The operation to get the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set containing the extension. - * @param vmssExtensionName The name of the VM scale set extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync( - String resourceGroupName, String vmScaleSetName, String vmssExtensionName); - - /** - * The operation to get the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set containing the extension. - * @param vmssExtensionName The name of the VM scale set extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualMachineScaleSetExtensionInner get(String resourceGroupName, String vmScaleSetName, String vmssExtensionName); - - /** - * The operation to get the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set containing the extension. - * @param vmssExtensionName The name of the VM scale set extension. - * @param expand The expand expression to apply on the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String vmScaleSetName, String vmssExtensionName, String expand, Context context); - - /** - * Gets a list of all extensions in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set containing the extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all extensions in a VM scale set. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String resourceGroupName, String vmScaleSetName); - - /** - * Gets a list of all extensions in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set containing the extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all extensions in a VM scale set. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String vmScaleSetName); - - /** - * Gets a list of all extensions in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set containing the extension. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all extensions in a VM scale set. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String resourceGroupName, String vmScaleSetName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineScaleSetRollingUpgradesClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineScaleSetRollingUpgradesClient.java deleted file mode 100644 index b390dfeeb0c5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineScaleSetRollingUpgradesClient.java +++ /dev/null @@ -1,368 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.compute.fluent.models.RollingUpgradeStatusInfoInner; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in - * VirtualMachineScaleSetRollingUpgradesClient. - */ -public interface VirtualMachineScaleSetRollingUpgradesClient { - /** - * Cancels the current virtual machine scale set rolling upgrade. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> cancelWithResponseAsync(String resourceGroupName, String vmScaleSetName); - - /** - * Cancels the current virtual machine scale set rolling upgrade. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginCancelAsync(String resourceGroupName, String vmScaleSetName); - - /** - * Cancels the current virtual machine scale set rolling upgrade. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginCancel(String resourceGroupName, String vmScaleSetName); - - /** - * Cancels the current virtual machine scale set rolling upgrade. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginCancel(String resourceGroupName, String vmScaleSetName, Context context); - - /** - * Cancels the current virtual machine scale set rolling upgrade. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono cancelAsync(String resourceGroupName, String vmScaleSetName); - - /** - * Cancels the current virtual machine scale set rolling upgrade. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void cancel(String resourceGroupName, String vmScaleSetName); - - /** - * Cancels the current virtual machine scale set rolling upgrade. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void cancel(String resourceGroupName, String vmScaleSetName, Context context); - - /** - * Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image - * OS version. Instances which are already running the latest available OS version are not affected. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> startOSUpgradeWithResponseAsync(String resourceGroupName, String vmScaleSetName); - - /** - * Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image - * OS version. Instances which are already running the latest available OS version are not affected. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginStartOSUpgradeAsync(String resourceGroupName, String vmScaleSetName); - - /** - * Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image - * OS version. Instances which are already running the latest available OS version are not affected. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginStartOSUpgrade(String resourceGroupName, String vmScaleSetName); - - /** - * Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image - * OS version. Instances which are already running the latest available OS version are not affected. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginStartOSUpgrade( - String resourceGroupName, String vmScaleSetName, Context context); - - /** - * Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image - * OS version. Instances which are already running the latest available OS version are not affected. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono startOSUpgradeAsync(String resourceGroupName, String vmScaleSetName); - - /** - * Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image - * OS version. Instances which are already running the latest available OS version are not affected. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void startOSUpgrade(String resourceGroupName, String vmScaleSetName); - - /** - * Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image - * OS version. Instances which are already running the latest available OS version are not affected. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void startOSUpgrade(String resourceGroupName, String vmScaleSetName, Context context); - - /** - * Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest - * available extension version. Instances which are already running the latest extension versions are not affected. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> startExtensionUpgradeWithResponseAsync( - String resourceGroupName, String vmScaleSetName); - - /** - * Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest - * available extension version. Instances which are already running the latest extension versions are not affected. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginStartExtensionUpgradeAsync(String resourceGroupName, String vmScaleSetName); - - /** - * Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest - * available extension version. Instances which are already running the latest extension versions are not affected. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginStartExtensionUpgrade(String resourceGroupName, String vmScaleSetName); - - /** - * Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest - * available extension version. Instances which are already running the latest extension versions are not affected. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginStartExtensionUpgrade( - String resourceGroupName, String vmScaleSetName, Context context); - - /** - * Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest - * available extension version. Instances which are already running the latest extension versions are not affected. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono startExtensionUpgradeAsync(String resourceGroupName, String vmScaleSetName); - - /** - * Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest - * available extension version. Instances which are already running the latest extension versions are not affected. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void startExtensionUpgrade(String resourceGroupName, String vmScaleSetName); - - /** - * Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest - * available extension version. Instances which are already running the latest extension versions are not affected. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void startExtensionUpgrade(String resourceGroupName, String vmScaleSetName, Context context); - - /** - * Gets the status of the latest virtual machine scale set rolling upgrade. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of the latest virtual machine scale set rolling upgrade. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getLatestWithResponseAsync( - String resourceGroupName, String vmScaleSetName); - - /** - * Gets the status of the latest virtual machine scale set rolling upgrade. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of the latest virtual machine scale set rolling upgrade. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getLatestAsync(String resourceGroupName, String vmScaleSetName); - - /** - * Gets the status of the latest virtual machine scale set rolling upgrade. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of the latest virtual machine scale set rolling upgrade. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RollingUpgradeStatusInfoInner getLatest(String resourceGroupName, String vmScaleSetName); - - /** - * Gets the status of the latest virtual machine scale set rolling upgrade. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of the latest virtual machine scale set rolling upgrade. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getLatestWithResponse( - String resourceGroupName, String vmScaleSetName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineScaleSetVMExtensionsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineScaleSetVMExtensionsClient.java deleted file mode 100644 index c9fc94cf0d65..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineScaleSetVMExtensionsClient.java +++ /dev/null @@ -1,608 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineScaleSetVMExtensionInner; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineScaleSetVMExtensionsListResultInner; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetVMExtensionUpdate; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in VirtualMachineScaleSetVMExtensionsClient. - */ -public interface VirtualMachineScaleSetVMExtensionsClient { - /** - * The operation to create or update the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Create Virtual Machine Extension operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a VMSS VM Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String vmExtensionName, - VirtualMachineScaleSetVMExtensionInner extensionParameters); - - /** - * The operation to create or update the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Create Virtual Machine Extension operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a VMSS VM Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, VirtualMachineScaleSetVMExtensionInner> - beginCreateOrUpdateAsync( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String vmExtensionName, - VirtualMachineScaleSetVMExtensionInner extensionParameters); - - /** - * The operation to create or update the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Create Virtual Machine Extension operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a VMSS VM Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VirtualMachineScaleSetVMExtensionInner> - beginCreateOrUpdate( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String vmExtensionName, - VirtualMachineScaleSetVMExtensionInner extensionParameters); - - /** - * The operation to create or update the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Create Virtual Machine Extension operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a VMSS VM Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VirtualMachineScaleSetVMExtensionInner> - beginCreateOrUpdate( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String vmExtensionName, - VirtualMachineScaleSetVMExtensionInner extensionParameters, - Context context); - - /** - * The operation to create or update the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Create Virtual Machine Extension operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a VMSS VM Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String vmExtensionName, - VirtualMachineScaleSetVMExtensionInner extensionParameters); - - /** - * The operation to create or update the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Create Virtual Machine Extension operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a VMSS VM Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualMachineScaleSetVMExtensionInner createOrUpdate( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String vmExtensionName, - VirtualMachineScaleSetVMExtensionInner extensionParameters); - - /** - * The operation to create or update the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Create Virtual Machine Extension operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a VMSS VM Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualMachineScaleSetVMExtensionInner createOrUpdate( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String vmExtensionName, - VirtualMachineScaleSetVMExtensionInner extensionParameters, - Context context); - - /** - * The operation to update the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Update Virtual Machine Extension operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a VMSS VM Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> updateWithResponseAsync( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String vmExtensionName, - VirtualMachineScaleSetVMExtensionUpdate extensionParameters); - - /** - * The operation to update the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Update Virtual Machine Extension operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a VMSS VM Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, VirtualMachineScaleSetVMExtensionInner> - beginUpdateAsync( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String vmExtensionName, - VirtualMachineScaleSetVMExtensionUpdate extensionParameters); - - /** - * The operation to update the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Update Virtual Machine Extension operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a VMSS VM Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VirtualMachineScaleSetVMExtensionInner> beginUpdate( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String vmExtensionName, - VirtualMachineScaleSetVMExtensionUpdate extensionParameters); - - /** - * The operation to update the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Update Virtual Machine Extension operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a VMSS VM Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VirtualMachineScaleSetVMExtensionInner> beginUpdate( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String vmExtensionName, - VirtualMachineScaleSetVMExtensionUpdate extensionParameters, - Context context); - - /** - * The operation to update the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Update Virtual Machine Extension operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a VMSS VM Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAsync( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String vmExtensionName, - VirtualMachineScaleSetVMExtensionUpdate extensionParameters); - - /** - * The operation to update the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Update Virtual Machine Extension operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a VMSS VM Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualMachineScaleSetVMExtensionInner update( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String vmExtensionName, - VirtualMachineScaleSetVMExtensionUpdate extensionParameters); - - /** - * The operation to update the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Update Virtual Machine Extension operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a VMSS VM Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualMachineScaleSetVMExtensionInner update( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String vmExtensionName, - VirtualMachineScaleSetVMExtensionUpdate extensionParameters, - Context context); - - /** - * The operation to delete the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName); - - /** - * The operation to delete the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName); - - /** - * The operation to delete the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName); - - /** - * The operation to delete the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName, Context context); - - /** - * The operation to delete the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName); - - /** - * The operation to delete the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName); - - /** - * The operation to delete the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete( - String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName, Context context); - - /** - * The operation to get the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param expand The expand expression to apply on the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a VMSS VM Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName, String expand); - - /** - * The operation to get the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param expand The expand expression to apply on the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a VMSS VM Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName, String expand); - - /** - * The operation to get the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a VMSS VM Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName); - - /** - * The operation to get the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a VMSS VM Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualMachineScaleSetVMExtensionInner get( - String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName); - - /** - * The operation to get the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param expand The expand expression to apply on the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a VMSS VM Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String vmExtensionName, - String expand, - Context context); - - /** - * The operation to get all extensions of an instance in Virtual Machine Scaleset. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param expand The expand expression to apply on the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List VMSS VM Extension operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, String expand); - - /** - * The operation to get all extensions of an instance in Virtual Machine Scaleset. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param expand The expand expression to apply on the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List VMSS VM Extension operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, String expand); - - /** - * The operation to get all extensions of an instance in Virtual Machine Scaleset. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List VMSS VM Extension operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listAsync( - String resourceGroupName, String vmScaleSetName, String instanceId); - - /** - * The operation to get all extensions of an instance in Virtual Machine Scaleset. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List VMSS VM Extension operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualMachineScaleSetVMExtensionsListResultInner list( - String resourceGroupName, String vmScaleSetName, String instanceId); - - /** - * The operation to get all extensions of an instance in Virtual Machine Scaleset. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param expand The expand expression to apply on the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List VMSS VM Extension operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listWithResponse( - String resourceGroupName, String vmScaleSetName, String instanceId, String expand, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineScaleSetVMRunCommandsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineScaleSetVMRunCommandsClient.java deleted file mode 100644 index c850c8590413..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineScaleSetVMRunCommandsClient.java +++ /dev/null @@ -1,589 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineRunCommandInner; -import com.azure.resourcemanager.compute.models.VirtualMachineRunCommandUpdate; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in VirtualMachineScaleSetVMRunCommandsClient. - */ -public interface VirtualMachineScaleSetVMRunCommandsClient { - /** - * The operation to create or update the VMSS VM run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param runCommandName The name of the virtual machine run command. - * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String runCommandName, - VirtualMachineRunCommandInner runCommand); - - /** - * The operation to create or update the VMSS VM run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param runCommandName The name of the virtual machine run command. - * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, VirtualMachineRunCommandInner> beginCreateOrUpdateAsync( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String runCommandName, - VirtualMachineRunCommandInner runCommand); - - /** - * The operation to create or update the VMSS VM run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param runCommandName The name of the virtual machine run command. - * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VirtualMachineRunCommandInner> beginCreateOrUpdate( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String runCommandName, - VirtualMachineRunCommandInner runCommand); - - /** - * The operation to create or update the VMSS VM run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param runCommandName The name of the virtual machine run command. - * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VirtualMachineRunCommandInner> beginCreateOrUpdate( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String runCommandName, - VirtualMachineRunCommandInner runCommand, - Context context); - - /** - * The operation to create or update the VMSS VM run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param runCommandName The name of the virtual machine run command. - * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String runCommandName, - VirtualMachineRunCommandInner runCommand); - - /** - * The operation to create or update the VMSS VM run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param runCommandName The name of the virtual machine run command. - * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualMachineRunCommandInner createOrUpdate( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String runCommandName, - VirtualMachineRunCommandInner runCommand); - - /** - * The operation to create or update the VMSS VM run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param runCommandName The name of the virtual machine run command. - * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualMachineRunCommandInner createOrUpdate( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String runCommandName, - VirtualMachineRunCommandInner runCommand, - Context context); - - /** - * The operation to update the VMSS VM run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param runCommandName The name of the virtual machine run command. - * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> updateWithResponseAsync( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String runCommandName, - VirtualMachineRunCommandUpdate runCommand); - - /** - * The operation to update the VMSS VM run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param runCommandName The name of the virtual machine run command. - * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, VirtualMachineRunCommandInner> beginUpdateAsync( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String runCommandName, - VirtualMachineRunCommandUpdate runCommand); - - /** - * The operation to update the VMSS VM run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param runCommandName The name of the virtual machine run command. - * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VirtualMachineRunCommandInner> beginUpdate( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String runCommandName, - VirtualMachineRunCommandUpdate runCommand); - - /** - * The operation to update the VMSS VM run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param runCommandName The name of the virtual machine run command. - * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VirtualMachineRunCommandInner> beginUpdate( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String runCommandName, - VirtualMachineRunCommandUpdate runCommand, - Context context); - - /** - * The operation to update the VMSS VM run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param runCommandName The name of the virtual machine run command. - * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAsync( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String runCommandName, - VirtualMachineRunCommandUpdate runCommand); - - /** - * The operation to update the VMSS VM run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param runCommandName The name of the virtual machine run command. - * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualMachineRunCommandInner update( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String runCommandName, - VirtualMachineRunCommandUpdate runCommand); - - /** - * The operation to update the VMSS VM run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param runCommandName The name of the virtual machine run command. - * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualMachineRunCommandInner update( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String runCommandName, - VirtualMachineRunCommandUpdate runCommand, - Context context); - - /** - * The operation to delete the VMSS VM run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param runCommandName The name of the virtual machine run command. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName); - - /** - * The operation to delete the VMSS VM run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param runCommandName The name of the virtual machine run command. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName); - - /** - * The operation to delete the VMSS VM run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param runCommandName The name of the virtual machine run command. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName); - - /** - * The operation to delete the VMSS VM run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param runCommandName The name of the virtual machine run command. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName, Context context); - - /** - * The operation to delete the VMSS VM run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param runCommandName The name of the virtual machine run command. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName); - - /** - * The operation to delete the VMSS VM run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param runCommandName The name of the virtual machine run command. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName); - - /** - * The operation to delete the VMSS VM run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param runCommandName The name of the virtual machine run command. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete( - String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName, Context context); - - /** - * The operation to get the VMSS VM run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param runCommandName The name of the virtual machine run command. - * @param expand The expand expression to apply on the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName, String expand); - - /** - * The operation to get the VMSS VM run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param runCommandName The name of the virtual machine run command. - * @param expand The expand expression to apply on the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName, String expand); - - /** - * The operation to get the VMSS VM run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param runCommandName The name of the virtual machine run command. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName); - - /** - * The operation to get the VMSS VM run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param runCommandName The name of the virtual machine run command. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualMachineRunCommandInner get( - String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName); - - /** - * The operation to get the VMSS VM run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param runCommandName The name of the virtual machine run command. - * @param expand The expand expression to apply on the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String runCommandName, - String expand, - Context context); - - /** - * The operation to get all run commands of an instance in Virtual Machine Scaleset. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param expand The expand expression to apply on the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List run command operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, String expand); - - /** - * The operation to get all run commands of an instance in Virtual Machine Scaleset. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List run command operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync( - String resourceGroupName, String vmScaleSetName, String instanceId); - - /** - * The operation to get all run commands of an instance in Virtual Machine Scaleset. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List run command operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String resourceGroupName, String vmScaleSetName, String instanceId); - - /** - * The operation to get all run commands of an instance in Virtual Machine Scaleset. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param expand The expand expression to apply on the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List run command operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String resourceGroupName, String vmScaleSetName, String instanceId, String expand, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineScaleSetVMsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineScaleSetVMsClient.java deleted file mode 100644 index 601913839bed..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineScaleSetVMsClient.java +++ /dev/null @@ -1,1672 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.compute.fluent.models.RetrieveBootDiagnosticsDataResultInner; -import com.azure.resourcemanager.compute.fluent.models.RunCommandResultInner; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineScaleSetVMInner; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineScaleSetVMInstanceViewInner; -import com.azure.resourcemanager.compute.models.InstanceViewTypes; -import com.azure.resourcemanager.compute.models.RunCommandInput; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetVMReimageParameters; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in VirtualMachineScaleSetVMsClient. */ -public interface VirtualMachineScaleSetVMsClient { - /** - * Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmScaleSetVMReimageInput Parameters for the Reimaging Virtual machine in ScaleSet. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> reimageWithResponseAsync( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - VirtualMachineScaleSetVMReimageParameters vmScaleSetVMReimageInput); - - /** - * Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmScaleSetVMReimageInput Parameters for the Reimaging Virtual machine in ScaleSet. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginReimageAsync( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - VirtualMachineScaleSetVMReimageParameters vmScaleSetVMReimageInput); - - /** - * Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmScaleSetVMReimageInput Parameters for the Reimaging Virtual machine in ScaleSet. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginReimage( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - VirtualMachineScaleSetVMReimageParameters vmScaleSetVMReimageInput); - - /** - * Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmScaleSetVMReimageInput Parameters for the Reimaging Virtual machine in ScaleSet. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginReimage( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - VirtualMachineScaleSetVMReimageParameters vmScaleSetVMReimageInput, - Context context); - - /** - * Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmScaleSetVMReimageInput Parameters for the Reimaging Virtual machine in ScaleSet. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono reimageAsync( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - VirtualMachineScaleSetVMReimageParameters vmScaleSetVMReimageInput); - - /** - * Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono reimageAsync(String resourceGroupName, String vmScaleSetName, String instanceId); - - /** - * Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmScaleSetVMReimageInput Parameters for the Reimaging Virtual machine in ScaleSet. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void reimage( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - VirtualMachineScaleSetVMReimageParameters vmScaleSetVMReimageInput); - - /** - * Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void reimage(String resourceGroupName, String vmScaleSetName, String instanceId); - - /** - * Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmScaleSetVMReimageInput Parameters for the Reimaging Virtual machine in ScaleSet. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void reimage( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - VirtualMachineScaleSetVMReimageParameters vmScaleSetVMReimageInput, - Context context); - - /** - * Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is - * only supported for managed disks. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> reimageAllWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId); - - /** - * Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is - * only supported for managed disks. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginReimageAllAsync( - String resourceGroupName, String vmScaleSetName, String instanceId); - - /** - * Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is - * only supported for managed disks. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginReimageAll( - String resourceGroupName, String vmScaleSetName, String instanceId); - - /** - * Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is - * only supported for managed disks. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginReimageAll( - String resourceGroupName, String vmScaleSetName, String instanceId, Context context); - - /** - * Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is - * only supported for managed disks. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono reimageAllAsync(String resourceGroupName, String vmScaleSetName, String instanceId); - - /** - * Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is - * only supported for managed disks. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void reimageAll(String resourceGroupName, String vmScaleSetName, String instanceId); - - /** - * Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is - * only supported for managed disks. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void reimageAll(String resourceGroupName, String vmScaleSetName, String instanceId, Context context); - - /** - * Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute - * resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deallocateWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId); - - /** - * Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute - * resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeallocateAsync( - String resourceGroupName, String vmScaleSetName, String instanceId); - - /** - * Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute - * resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDeallocate( - String resourceGroupName, String vmScaleSetName, String instanceId); - - /** - * Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute - * resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDeallocate( - String resourceGroupName, String vmScaleSetName, String instanceId, Context context); - - /** - * Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute - * resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deallocateAsync(String resourceGroupName, String vmScaleSetName, String instanceId); - - /** - * Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute - * resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deallocate(String resourceGroupName, String vmScaleSetName, String instanceId); - - /** - * Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute - * resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deallocate(String resourceGroupName, String vmScaleSetName, String instanceId, Context context); - - /** - * Updates a virtual machine of a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. - * @param instanceId The instance ID of the virtual machine. - * @param parameters Parameters supplied to the Update Virtual Machine Scale Sets VM operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a virtual machine scale set virtual machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> updateWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, VirtualMachineScaleSetVMInner parameters); - - /** - * Updates a virtual machine of a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. - * @param instanceId The instance ID of the virtual machine. - * @param parameters Parameters supplied to the Update Virtual Machine Scale Sets VM operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a virtual machine scale set virtual machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, VirtualMachineScaleSetVMInner> beginUpdateAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, VirtualMachineScaleSetVMInner parameters); - - /** - * Updates a virtual machine of a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. - * @param instanceId The instance ID of the virtual machine. - * @param parameters Parameters supplied to the Update Virtual Machine Scale Sets VM operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a virtual machine scale set virtual machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VirtualMachineScaleSetVMInner> beginUpdate( - String resourceGroupName, String vmScaleSetName, String instanceId, VirtualMachineScaleSetVMInner parameters); - - /** - * Updates a virtual machine of a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. - * @param instanceId The instance ID of the virtual machine. - * @param parameters Parameters supplied to the Update Virtual Machine Scale Sets VM operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a virtual machine scale set virtual machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VirtualMachineScaleSetVMInner> beginUpdate( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - VirtualMachineScaleSetVMInner parameters, - Context context); - - /** - * Updates a virtual machine of a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. - * @param instanceId The instance ID of the virtual machine. - * @param parameters Parameters supplied to the Update Virtual Machine Scale Sets VM operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a virtual machine scale set virtual machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, VirtualMachineScaleSetVMInner parameters); - - /** - * Updates a virtual machine of a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. - * @param instanceId The instance ID of the virtual machine. - * @param parameters Parameters supplied to the Update Virtual Machine Scale Sets VM operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a virtual machine scale set virtual machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualMachineScaleSetVMInner update( - String resourceGroupName, String vmScaleSetName, String instanceId, VirtualMachineScaleSetVMInner parameters); - - /** - * Updates a virtual machine of a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. - * @param instanceId The instance ID of the virtual machine. - * @param parameters Parameters supplied to the Update Virtual Machine Scale Sets VM operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a virtual machine scale set virtual machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualMachineScaleSetVMInner update( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - VirtualMachineScaleSetVMInner parameters, - Context context); - - /** - * Deletes a virtual machine from a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId); - - /** - * Deletes a virtual machine from a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String vmScaleSetName, String instanceId); - - /** - * Deletes a virtual machine from a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String vmScaleSetName, String instanceId); - - /** - * Deletes a virtual machine from a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String vmScaleSetName, String instanceId, Context context); - - /** - * Deletes a virtual machine from a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String vmScaleSetName, String instanceId); - - /** - * Deletes a virtual machine from a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String vmScaleSetName, String instanceId); - - /** - * Deletes a virtual machine from a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String vmScaleSetName, String instanceId, Context context); - - /** - * Gets a virtual machine from a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param expand The expand expression to apply on the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual machine from a VM scale set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, InstanceViewTypes expand); - - /** - * Gets a virtual machine from a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param expand The expand expression to apply on the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual machine from a VM scale set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, InstanceViewTypes expand); - - /** - * Gets a virtual machine from a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual machine from a VM scale set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync(String resourceGroupName, String vmScaleSetName, String instanceId); - - /** - * Gets a virtual machine from a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual machine from a VM scale set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualMachineScaleSetVMInner get(String resourceGroupName, String vmScaleSetName, String instanceId); - - /** - * Gets a virtual machine from a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param expand The expand expression to apply on the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual machine from a VM scale set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String vmScaleSetName, String instanceId, InstanceViewTypes expand, Context context); - - /** - * Gets the status of a virtual machine from a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of a virtual machine from a VM scale set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getInstanceViewWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId); - - /** - * Gets the status of a virtual machine from a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of a virtual machine from a VM scale set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getInstanceViewAsync( - String resourceGroupName, String vmScaleSetName, String instanceId); - - /** - * Gets the status of a virtual machine from a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of a virtual machine from a VM scale set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualMachineScaleSetVMInstanceViewInner getInstanceView( - String resourceGroupName, String vmScaleSetName, String instanceId); - - /** - * Gets the status of a virtual machine from a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of a virtual machine from a VM scale set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getInstanceViewWithResponse( - String resourceGroupName, String vmScaleSetName, String instanceId, Context context); - - /** - * Gets a list of all virtual machines in a VM scale sets. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the VM scale set. - * @param filter The filter to apply to the operation. Allowed values are 'startswith(instanceView/statuses/code, - * 'PowerState') eq true', 'properties/latestModelApplied eq true', 'properties/latestModelApplied eq false'. - * @param select The list parameters. Allowed values are 'instanceView', 'instanceView/statuses'. - * @param expand The expand expression to apply to the operation. Allowed values are 'instanceView'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all virtual machines in a VM scale sets. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync( - String resourceGroupName, String virtualMachineScaleSetName, String filter, String select, String expand); - - /** - * Gets a list of all virtual machines in a VM scale sets. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all virtual machines in a VM scale sets. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String resourceGroupName, String virtualMachineScaleSetName); - - /** - * Gets a list of all virtual machines in a VM scale sets. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all virtual machines in a VM scale sets. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String virtualMachineScaleSetName); - - /** - * Gets a list of all virtual machines in a VM scale sets. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the VM scale set. - * @param filter The filter to apply to the operation. Allowed values are 'startswith(instanceView/statuses/code, - * 'PowerState') eq true', 'properties/latestModelApplied eq true', 'properties/latestModelApplied eq false'. - * @param select The list parameters. Allowed values are 'instanceView', 'instanceView/statuses'. - * @param expand The expand expression to apply to the operation. Allowed values are 'instanceView'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all virtual machines in a VM scale sets. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String resourceGroupName, - String virtualMachineScaleSetName, - String filter, - String select, - String expand, - Context context); - - /** - * Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting - * charged for the resources. Instead, use deallocate to release resources and avoid charges. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> powerOffWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, Boolean skipShutdown); - - /** - * Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting - * charged for the resources. Instead, use deallocate to release resources and avoid charges. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginPowerOffAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, Boolean skipShutdown); - - /** - * Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting - * charged for the resources. Instead, use deallocate to release resources and avoid charges. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginPowerOff( - String resourceGroupName, String vmScaleSetName, String instanceId, Boolean skipShutdown); - - /** - * Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting - * charged for the resources. Instead, use deallocate to release resources and avoid charges. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginPowerOff( - String resourceGroupName, String vmScaleSetName, String instanceId, Boolean skipShutdown, Context context); - - /** - * Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting - * charged for the resources. Instead, use deallocate to release resources and avoid charges. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono powerOffAsync(String resourceGroupName, String vmScaleSetName, String instanceId, Boolean skipShutdown); - - /** - * Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting - * charged for the resources. Instead, use deallocate to release resources and avoid charges. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono powerOffAsync(String resourceGroupName, String vmScaleSetName, String instanceId); - - /** - * Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting - * charged for the resources. Instead, use deallocate to release resources and avoid charges. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void powerOff(String resourceGroupName, String vmScaleSetName, String instanceId, Boolean skipShutdown); - - /** - * Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting - * charged for the resources. Instead, use deallocate to release resources and avoid charges. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void powerOff(String resourceGroupName, String vmScaleSetName, String instanceId); - - /** - * Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting - * charged for the resources. Instead, use deallocate to release resources and avoid charges. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void powerOff( - String resourceGroupName, String vmScaleSetName, String instanceId, Boolean skipShutdown, Context context); - - /** - * Restarts a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> restartWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId); - - /** - * Restarts a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginRestartAsync( - String resourceGroupName, String vmScaleSetName, String instanceId); - - /** - * Restarts a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginRestart(String resourceGroupName, String vmScaleSetName, String instanceId); - - /** - * Restarts a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginRestart( - String resourceGroupName, String vmScaleSetName, String instanceId, Context context); - - /** - * Restarts a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono restartAsync(String resourceGroupName, String vmScaleSetName, String instanceId); - - /** - * Restarts a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void restart(String resourceGroupName, String vmScaleSetName, String instanceId); - - /** - * Restarts a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void restart(String resourceGroupName, String vmScaleSetName, String instanceId, Context context); - - /** - * Starts a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> startWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId); - - /** - * Starts a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginStartAsync( - String resourceGroupName, String vmScaleSetName, String instanceId); - - /** - * Starts a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginStart(String resourceGroupName, String vmScaleSetName, String instanceId); - - /** - * Starts a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginStart( - String resourceGroupName, String vmScaleSetName, String instanceId, Context context); - - /** - * Starts a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono startAsync(String resourceGroupName, String vmScaleSetName, String instanceId); - - /** - * Starts a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void start(String resourceGroupName, String vmScaleSetName, String instanceId); - - /** - * Starts a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void start(String resourceGroupName, String vmScaleSetName, String instanceId, Context context); - - /** - * Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> redeployWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId); - - /** - * Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginRedeployAsync( - String resourceGroupName, String vmScaleSetName, String instanceId); - - /** - * Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginRedeploy( - String resourceGroupName, String vmScaleSetName, String instanceId); - - /** - * Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginRedeploy( - String resourceGroupName, String vmScaleSetName, String instanceId, Context context); - - /** - * Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono redeployAsync(String resourceGroupName, String vmScaleSetName, String instanceId); - - /** - * Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void redeploy(String resourceGroupName, String vmScaleSetName, String instanceId); - - /** - * Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void redeploy(String resourceGroupName, String vmScaleSetName, String instanceId, Context context); - - /** - * The operation to retrieve SAS URIs of boot diagnostic logs for a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param sasUriExpirationTimeInMinutes Expiration duration in minutes for the SAS URIs with a value between 1 to - * 1440 minutes. <br><br>NOTE: If not specified, SAS URIs will be generated with a default - * expiration duration of 120 minutes. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the SAS URIs of the console screenshot and serial log blobs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> retrieveBootDiagnosticsDataWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, Integer sasUriExpirationTimeInMinutes); - - /** - * The operation to retrieve SAS URIs of boot diagnostic logs for a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param sasUriExpirationTimeInMinutes Expiration duration in minutes for the SAS URIs with a value between 1 to - * 1440 minutes. <br><br>NOTE: If not specified, SAS URIs will be generated with a default - * expiration duration of 120 minutes. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the SAS URIs of the console screenshot and serial log blobs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono retrieveBootDiagnosticsDataAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, Integer sasUriExpirationTimeInMinutes); - - /** - * The operation to retrieve SAS URIs of boot diagnostic logs for a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the SAS URIs of the console screenshot and serial log blobs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono retrieveBootDiagnosticsDataAsync( - String resourceGroupName, String vmScaleSetName, String instanceId); - - /** - * The operation to retrieve SAS URIs of boot diagnostic logs for a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the SAS URIs of the console screenshot and serial log blobs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RetrieveBootDiagnosticsDataResultInner retrieveBootDiagnosticsData( - String resourceGroupName, String vmScaleSetName, String instanceId); - - /** - * The operation to retrieve SAS URIs of boot diagnostic logs for a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param sasUriExpirationTimeInMinutes Expiration duration in minutes for the SAS URIs with a value between 1 to - * 1440 minutes. <br><br>NOTE: If not specified, SAS URIs will be generated with a default - * expiration duration of 120 minutes. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the SAS URIs of the console screenshot and serial log blobs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response retrieveBootDiagnosticsDataWithResponse( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - Integer sasUriExpirationTimeInMinutes, - Context context); - - /** - * Performs maintenance on a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> performMaintenanceWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId); - - /** - * Performs maintenance on a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginPerformMaintenanceAsync( - String resourceGroupName, String vmScaleSetName, String instanceId); - - /** - * Performs maintenance on a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginPerformMaintenance( - String resourceGroupName, String vmScaleSetName, String instanceId); - - /** - * Performs maintenance on a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginPerformMaintenance( - String resourceGroupName, String vmScaleSetName, String instanceId, Context context); - - /** - * Performs maintenance on a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono performMaintenanceAsync(String resourceGroupName, String vmScaleSetName, String instanceId); - - /** - * Performs maintenance on a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void performMaintenance(String resourceGroupName, String vmScaleSetName, String instanceId); - - /** - * Performs maintenance on a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void performMaintenance(String resourceGroupName, String vmScaleSetName, String instanceId, Context context); - - /** - * The operation to simulate the eviction of spot virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> simulateEvictionWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId); - - /** - * The operation to simulate the eviction of spot virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono simulateEvictionAsync(String resourceGroupName, String vmScaleSetName, String instanceId); - - /** - * The operation to simulate the eviction of spot virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void simulateEviction(String resourceGroupName, String vmScaleSetName, String instanceId); - - /** - * The operation to simulate the eviction of spot virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response simulateEvictionWithResponse( - String resourceGroupName, String vmScaleSetName, String instanceId, Context context); - - /** - * Run command on a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param parameters Parameters supplied to the Run command operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> runCommandWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, RunCommandInput parameters); - - /** - * Run command on a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param parameters Parameters supplied to the Run command operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, RunCommandResultInner> beginRunCommandAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, RunCommandInput parameters); - - /** - * Run command on a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param parameters Parameters supplied to the Run command operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, RunCommandResultInner> beginRunCommand( - String resourceGroupName, String vmScaleSetName, String instanceId, RunCommandInput parameters); - - /** - * Run command on a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param parameters Parameters supplied to the Run command operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, RunCommandResultInner> beginRunCommand( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - RunCommandInput parameters, - Context context); - - /** - * Run command on a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param parameters Parameters supplied to the Run command operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono runCommandAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, RunCommandInput parameters); - - /** - * Run command on a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param parameters Parameters supplied to the Run command operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RunCommandResultInner runCommand( - String resourceGroupName, String vmScaleSetName, String instanceId, RunCommandInput parameters); - - /** - * Run command on a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param parameters Parameters supplied to the Run command operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RunCommandResultInner runCommand( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - RunCommandInput parameters, - Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineScaleSetsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineScaleSetsClient.java deleted file mode 100644 index 7c4582d7f9bf..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineScaleSetsClient.java +++ /dev/null @@ -1,2272 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.compute.fluent.models.RecoveryWalkResponseInner; -import com.azure.resourcemanager.compute.fluent.models.UpgradeOperationHistoricalStatusInfoInner; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineScaleSetInner; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineScaleSetInstanceViewInner; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineScaleSetSkuInner; -import com.azure.resourcemanager.compute.models.OrchestrationServiceStateInput; -import com.azure.resourcemanager.compute.models.VMScaleSetConvertToSinglePlacementGroupInput; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetReimageParameters; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetUpdate; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetVMInstanceIDs; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetVMInstanceRequiredIDs; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in VirtualMachineScaleSetsClient. */ -public interface VirtualMachineScaleSetsClient - extends InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete { - /** - * Create or update a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set to create or update. - * @param parameters The scale set object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetInner parameters); - - /** - * Create or update a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set to create or update. - * @param parameters The scale set object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, VirtualMachineScaleSetInner> beginCreateOrUpdateAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetInner parameters); - - /** - * Create or update a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set to create or update. - * @param parameters The scale set object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VirtualMachineScaleSetInner> beginCreateOrUpdate( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetInner parameters); - - /** - * Create or update a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set to create or update. - * @param parameters The scale set object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VirtualMachineScaleSetInner> beginCreateOrUpdate( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetInner parameters, Context context); - - /** - * Create or update a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set to create or update. - * @param parameters The scale set object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetInner parameters); - - /** - * Create or update a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set to create or update. - * @param parameters The scale set object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualMachineScaleSetInner createOrUpdate( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetInner parameters); - - /** - * Create or update a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set to create or update. - * @param parameters The scale set object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualMachineScaleSetInner createOrUpdate( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetInner parameters, Context context); - - /** - * Update a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set to create or update. - * @param parameters The scale set object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> updateWithResponseAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdate parameters); - - /** - * Update a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set to create or update. - * @param parameters The scale set object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, VirtualMachineScaleSetInner> beginUpdateAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdate parameters); - - /** - * Update a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set to create or update. - * @param parameters The scale set object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VirtualMachineScaleSetInner> beginUpdate( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdate parameters); - - /** - * Update a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set to create or update. - * @param parameters The scale set object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VirtualMachineScaleSetInner> beginUpdate( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdate parameters, Context context); - - /** - * Update a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set to create or update. - * @param parameters The scale set object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdate parameters); - - /** - * Update a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set to create or update. - * @param parameters The scale set object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualMachineScaleSetInner update( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdate parameters); - - /** - * Update a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set to create or update. - * @param parameters The scale set object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualMachineScaleSetInner update( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdate parameters, Context context); - - /** - * Deletes a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync(String resourceGroupName, String vmScaleSetName); - - /** - * Deletes a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String vmScaleSetName); - - /** - * Deletes a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String vmScaleSetName); - - /** - * Deletes a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String vmScaleSetName, Context context); - - /** - * Deletes a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String vmScaleSetName); - - /** - * Deletes a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String vmScaleSetName); - - /** - * Deletes a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String vmScaleSetName, Context context); - - /** - * Display information about a virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String vmScaleSetName); - - /** - * Display information about a virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync(String resourceGroupName, String vmScaleSetName); - - /** - * Display information about a virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualMachineScaleSetInner getByResourceGroup(String resourceGroupName, String vmScaleSetName); - - /** - * Display information about a virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String vmScaleSetName, Context context); - - /** - * Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute - * resources. You are not billed for the compute resources that this virtual machine scale set deallocates. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deallocateWithResponseAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs); - - /** - * Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute - * resources. You are not billed for the compute resources that this virtual machine scale set deallocates. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeallocateAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs); - - /** - * Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute - * resources. You are not billed for the compute resources that this virtual machine scale set deallocates. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDeallocate( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs); - - /** - * Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute - * resources. You are not billed for the compute resources that this virtual machine scale set deallocates. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDeallocate( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, - Context context); - - /** - * Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute - * resources. You are not billed for the compute resources that this virtual machine scale set deallocates. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deallocateAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs); - - /** - * Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute - * resources. You are not billed for the compute resources that this virtual machine scale set deallocates. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deallocateAsync(String resourceGroupName, String vmScaleSetName); - - /** - * Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute - * resources. You are not billed for the compute resources that this virtual machine scale set deallocates. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deallocate(String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs); - - /** - * Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute - * resources. You are not billed for the compute resources that this virtual machine scale set deallocates. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deallocate(String resourceGroupName, String vmScaleSetName); - - /** - * Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute - * resources. You are not billed for the compute resources that this virtual machine scale set deallocates. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deallocate( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, - Context context); - - /** - * Deletes virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteInstancesWithResponseAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs); - - /** - * Deletes virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteInstancesAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs); - - /** - * Deletes virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDeleteInstances( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs); - - /** - * Deletes virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDeleteInstances( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs, - Context context); - - /** - * Deletes virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteInstancesAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs); - - /** - * Deletes virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deleteInstances( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs); - - /** - * Deletes virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deleteInstances( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs, - Context context); - - /** - * Gets the status of a VM scale set instance. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of a VM scale set instance. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getInstanceViewWithResponseAsync( - String resourceGroupName, String vmScaleSetName); - - /** - * Gets the status of a VM scale set instance. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of a VM scale set instance. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getInstanceViewAsync(String resourceGroupName, String vmScaleSetName); - - /** - * Gets the status of a VM scale set instance. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of a VM scale set instance. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualMachineScaleSetInstanceViewInner getInstanceView(String resourceGroupName, String vmScaleSetName); - - /** - * Gets the status of a VM scale set instance. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of a VM scale set instance. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getInstanceViewWithResponse( - String resourceGroupName, String vmScaleSetName, Context context); - - /** - * Gets a list of all VM scale sets under a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all VM scale sets under a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName); - - /** - * Gets a list of all VM scale sets under a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all VM scale sets under a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Gets a list of all VM scale sets under a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all VM scale sets under a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink - * property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM - * Scale Sets. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all VM Scale Sets in the subscription, regardless of the associated resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink - * property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM - * Scale Sets. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all VM Scale Sets in the subscription, regardless of the associated resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink - * property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM - * Scale Sets. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all VM Scale Sets in the subscription, regardless of the associated resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for - * each SKU. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed - * for each SKU. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listSkusAsync(String resourceGroupName, String vmScaleSetName); - - /** - * Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for - * each SKU. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed - * for each SKU. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listSkus(String resourceGroupName, String vmScaleSetName); - - /** - * Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for - * each SKU. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed - * for each SKU. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listSkus( - String resourceGroupName, String vmScaleSetName, Context context); - - /** - * Gets list of OS upgrades on a VM scale set instance. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of OS upgrades on a VM scale set instance. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux getOSUpgradeHistoryAsync( - String resourceGroupName, String vmScaleSetName); - - /** - * Gets list of OS upgrades on a VM scale set instance. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of OS upgrades on a VM scale set instance. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable getOSUpgradeHistory( - String resourceGroupName, String vmScaleSetName); - - /** - * Gets list of OS upgrades on a VM scale set instance. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of OS upgrades on a VM scale set instance. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable getOSUpgradeHistory( - String resourceGroupName, String vmScaleSetName, Context context); - - /** - * Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you - * are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> powerOffWithResponseAsync( - String resourceGroupName, - String vmScaleSetName, - Boolean skipShutdown, - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs); - - /** - * Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you - * are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginPowerOffAsync( - String resourceGroupName, - String vmScaleSetName, - Boolean skipShutdown, - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs); - - /** - * Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you - * are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginPowerOff( - String resourceGroupName, - String vmScaleSetName, - Boolean skipShutdown, - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs); - - /** - * Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you - * are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginPowerOff( - String resourceGroupName, - String vmScaleSetName, - Boolean skipShutdown, - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, - Context context); - - /** - * Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you - * are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono powerOffAsync( - String resourceGroupName, - String vmScaleSetName, - Boolean skipShutdown, - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs); - - /** - * Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you - * are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono powerOffAsync(String resourceGroupName, String vmScaleSetName); - - /** - * Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you - * are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void powerOff( - String resourceGroupName, - String vmScaleSetName, - Boolean skipShutdown, - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs); - - /** - * Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you - * are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void powerOff(String resourceGroupName, String vmScaleSetName); - - /** - * Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you - * are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void powerOff( - String resourceGroupName, - String vmScaleSetName, - Boolean skipShutdown, - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, - Context context); - - /** - * Restarts one or more virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> restartWithResponseAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs); - - /** - * Restarts one or more virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginRestartAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs); - - /** - * Restarts one or more virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginRestart( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs); - - /** - * Restarts one or more virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginRestart( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, - Context context); - - /** - * Restarts one or more virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono restartAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs); - - /** - * Restarts one or more virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono restartAsync(String resourceGroupName, String vmScaleSetName); - - /** - * Restarts one or more virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void restart(String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs); - - /** - * Restarts one or more virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void restart(String resourceGroupName, String vmScaleSetName); - - /** - * Restarts one or more virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void restart( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, - Context context); - - /** - * Starts one or more virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> startWithResponseAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs); - - /** - * Starts one or more virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginStartAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs); - - /** - * Starts one or more virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginStart( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs); - - /** - * Starts one or more virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginStart( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, - Context context); - - /** - * Starts one or more virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono startAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs); - - /** - * Starts one or more virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono startAsync(String resourceGroupName, String vmScaleSetName); - - /** - * Starts one or more virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void start(String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs); - - /** - * Starts one or more virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void start(String resourceGroupName, String vmScaleSetName); - - /** - * Starts one or more virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void start( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, - Context context); - - /** - * Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them - * back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> redeployWithResponseAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs); - - /** - * Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them - * back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginRedeployAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs); - - /** - * Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them - * back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginRedeploy( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs); - - /** - * Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them - * back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginRedeploy( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, - Context context); - - /** - * Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them - * back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono redeployAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs); - - /** - * Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them - * back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono redeployAsync(String resourceGroupName, String vmScaleSetName); - - /** - * Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them - * back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void redeploy(String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs); - - /** - * Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them - * back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void redeploy(String resourceGroupName, String vmScaleSetName); - - /** - * Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them - * back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void redeploy( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, - Context context); - - /** - * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not - * eligible for perform maintenance will be failed. Please refer to best practices for more details: - * https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> performMaintenanceWithResponseAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs); - - /** - * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not - * eligible for perform maintenance will be failed. Please refer to best practices for more details: - * https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginPerformMaintenanceAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs); - - /** - * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not - * eligible for perform maintenance will be failed. Please refer to best practices for more details: - * https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginPerformMaintenance( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs); - - /** - * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not - * eligible for perform maintenance will be failed. Please refer to best practices for more details: - * https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginPerformMaintenance( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, - Context context); - - /** - * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not - * eligible for perform maintenance will be failed. Please refer to best practices for more details: - * https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono performMaintenanceAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs); - - /** - * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not - * eligible for perform maintenance will be failed. Please refer to best practices for more details: - * https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono performMaintenanceAsync(String resourceGroupName, String vmScaleSetName); - - /** - * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not - * eligible for perform maintenance will be failed. Please refer to best practices for more details: - * https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void performMaintenance( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs); - - /** - * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not - * eligible for perform maintenance will be failed. Please refer to best practices for more details: - * https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void performMaintenance(String resourceGroupName, String vmScaleSetName); - - /** - * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not - * eligible for perform maintenance will be failed. Please refer to best practices for more details: - * https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void performMaintenance( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, - Context context); - - /** - * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> updateInstancesWithResponseAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs); - - /** - * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginUpdateInstancesAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs); - - /** - * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginUpdateInstances( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs); - - /** - * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginUpdateInstances( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs, - Context context); - - /** - * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateInstancesAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs); - - /** - * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void updateInstances( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs); - - /** - * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void updateInstances( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs, - Context context); - - /** - * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a - * ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial - * state. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmScaleSetReimageInput Parameters for Reimaging VM ScaleSet. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> reimageWithResponseAsync( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput); - - /** - * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a - * ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial - * state. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmScaleSetReimageInput Parameters for Reimaging VM ScaleSet. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginReimageAsync( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput); - - /** - * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a - * ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial - * state. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmScaleSetReimageInput Parameters for Reimaging VM ScaleSet. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginReimage( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput); - - /** - * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a - * ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial - * state. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmScaleSetReimageInput Parameters for Reimaging VM ScaleSet. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginReimage( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput, - Context context); - - /** - * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a - * ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial - * state. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmScaleSetReimageInput Parameters for Reimaging VM ScaleSet. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono reimageAsync( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput); - - /** - * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a - * ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial - * state. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono reimageAsync(String resourceGroupName, String vmScaleSetName); - - /** - * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a - * ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial - * state. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmScaleSetReimageInput Parameters for Reimaging VM ScaleSet. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void reimage( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput); - - /** - * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a - * ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial - * state. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void reimage(String resourceGroupName, String vmScaleSetName); - - /** - * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a - * ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial - * state. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmScaleSetReimageInput Parameters for Reimaging VM ScaleSet. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void reimage( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput, - Context context); - - /** - * Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only - * supported for managed disks. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> reimageAllWithResponseAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs); - - /** - * Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only - * supported for managed disks. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginReimageAllAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs); - - /** - * Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only - * supported for managed disks. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginReimageAll( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs); - - /** - * Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only - * supported for managed disks. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginReimageAll( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, - Context context); - - /** - * Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only - * supported for managed disks. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono reimageAllAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs); - - /** - * Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only - * supported for managed disks. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono reimageAllAsync(String resourceGroupName, String vmScaleSetName); - - /** - * Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only - * supported for managed disks. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void reimageAll(String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs); - - /** - * Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only - * supported for managed disks. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void reimageAll(String resourceGroupName, String vmScaleSetName); - - /** - * Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only - * supported for managed disks. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void reimageAll( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, - Context context); - - /** - * Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param platformUpdateDomain The platform update domain for which a manual recovery walk is requested. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response after calling a manual recovery walk. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> forceRecoveryServiceFabricPlatformUpdateDomainWalkWithResponseAsync( - String resourceGroupName, String vmScaleSetName, int platformUpdateDomain); - - /** - * Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param platformUpdateDomain The platform update domain for which a manual recovery walk is requested. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response after calling a manual recovery walk. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono forceRecoveryServiceFabricPlatformUpdateDomainWalkAsync( - String resourceGroupName, String vmScaleSetName, int platformUpdateDomain); - - /** - * Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param platformUpdateDomain The platform update domain for which a manual recovery walk is requested. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response after calling a manual recovery walk. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RecoveryWalkResponseInner forceRecoveryServiceFabricPlatformUpdateDomainWalk( - String resourceGroupName, String vmScaleSetName, int platformUpdateDomain); - - /** - * Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param platformUpdateDomain The platform update domain for which a manual recovery walk is requested. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response after calling a manual recovery walk. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response forceRecoveryServiceFabricPlatformUpdateDomainWalkWithResponse( - String resourceGroupName, String vmScaleSetName, int platformUpdateDomain, Context context); - - /** - * Converts SinglePlacementGroup property to false for a existing virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the virtual machine scale set to create or update. - * @param parameters The input object for ConvertToSinglePlacementGroup API. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> convertToSinglePlacementGroupWithResponseAsync( - String resourceGroupName, String vmScaleSetName, VMScaleSetConvertToSinglePlacementGroupInput parameters); - - /** - * Converts SinglePlacementGroup property to false for a existing virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the virtual machine scale set to create or update. - * @param parameters The input object for ConvertToSinglePlacementGroup API. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono convertToSinglePlacementGroupAsync( - String resourceGroupName, String vmScaleSetName, VMScaleSetConvertToSinglePlacementGroupInput parameters); - - /** - * Converts SinglePlacementGroup property to false for a existing virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the virtual machine scale set to create or update. - * @param parameters The input object for ConvertToSinglePlacementGroup API. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void convertToSinglePlacementGroup( - String resourceGroupName, String vmScaleSetName, VMScaleSetConvertToSinglePlacementGroupInput parameters); - - /** - * Converts SinglePlacementGroup property to false for a existing virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the virtual machine scale set to create or update. - * @param parameters The input object for ConvertToSinglePlacementGroup API. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response convertToSinglePlacementGroupWithResponse( - String resourceGroupName, - String vmScaleSetName, - VMScaleSetConvertToSinglePlacementGroupInput parameters, - Context context); - - /** - * Changes ServiceState property for a given service. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the virtual machine scale set to create or update. - * @param parameters The input object for SetOrchestrationServiceState API. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> setOrchestrationServiceStateWithResponseAsync( - String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateInput parameters); - - /** - * Changes ServiceState property for a given service. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the virtual machine scale set to create or update. - * @param parameters The input object for SetOrchestrationServiceState API. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginSetOrchestrationServiceStateAsync( - String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateInput parameters); - - /** - * Changes ServiceState property for a given service. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the virtual machine scale set to create or update. - * @param parameters The input object for SetOrchestrationServiceState API. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginSetOrchestrationServiceState( - String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateInput parameters); - - /** - * Changes ServiceState property for a given service. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the virtual machine scale set to create or update. - * @param parameters The input object for SetOrchestrationServiceState API. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginSetOrchestrationServiceState( - String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateInput parameters, Context context); - - /** - * Changes ServiceState property for a given service. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the virtual machine scale set to create or update. - * @param parameters The input object for SetOrchestrationServiceState API. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono setOrchestrationServiceStateAsync( - String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateInput parameters); - - /** - * Changes ServiceState property for a given service. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the virtual machine scale set to create or update. - * @param parameters The input object for SetOrchestrationServiceState API. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void setOrchestrationServiceState( - String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateInput parameters); - - /** - * Changes ServiceState property for a given service. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the virtual machine scale set to create or update. - * @param parameters The input object for SetOrchestrationServiceState API. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void setOrchestrationServiceState( - String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateInput parameters, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineSizesClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineSizesClient.java deleted file mode 100644 index 0457c93fa434..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineSizesClient.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineSizeInner; - -/** An instance of this class provides access to all the operations defined in VirtualMachineSizesClient. */ -public interface VirtualMachineSizesClient { - /** - * This API is deprecated. Use [Resources - * Skus](https://docs.microsoft.com/en-us/rest/api/compute/resourceskus/list). - * - * @param location The location upon which virtual-machine-sizes is queried. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Virtual Machine operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String location); - - /** - * This API is deprecated. Use [Resources - * Skus](https://docs.microsoft.com/en-us/rest/api/compute/resourceskus/list). - * - * @param location The location upon which virtual-machine-sizes is queried. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Virtual Machine operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String location); - - /** - * This API is deprecated. Use [Resources - * Skus](https://docs.microsoft.com/en-us/rest/api/compute/resourceskus/list). - * - * @param location The location upon which virtual-machine-sizes is queried. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Virtual Machine operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String location, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachinesClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachinesClient.java deleted file mode 100644 index 3f724c0be7a4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachinesClient.java +++ /dev/null @@ -1,2119 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.compute.fluent.models.RetrieveBootDiagnosticsDataResultInner; -import com.azure.resourcemanager.compute.fluent.models.RunCommandResultInner; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineAssessPatchesResultInner; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineCaptureResultInner; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineInner; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineInstanceViewInner; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineSizeInner; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineUpdateInner; -import com.azure.resourcemanager.compute.models.InstanceViewTypes; -import com.azure.resourcemanager.compute.models.RunCommandInput; -import com.azure.resourcemanager.compute.models.VirtualMachineCaptureParameters; -import com.azure.resourcemanager.compute.models.VirtualMachineReimageParameters; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in VirtualMachinesClient. */ -public interface VirtualMachinesClient - extends InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete { - /** - * Gets all the virtual machines under the specified subscription for the specified location. - * - * @param location The location for which virtual machines under the subscription are queried. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the virtual machines under the specified subscription for the specified location. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByLocationAsync(String location); - - /** - * Gets all the virtual machines under the specified subscription for the specified location. - * - * @param location The location for which virtual machines under the subscription are queried. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the virtual machines under the specified subscription for the specified location. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByLocation(String location); - - /** - * Gets all the virtual machines under the specified subscription for the specified location. - * - * @param location The location for which virtual machines under the subscription are queried. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the virtual machines under the specified subscription for the specified location. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByLocation(String location, Context context); - - /** - * Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar - * VMs. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Capture Virtual Machine operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of virtual machine capture operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> captureWithResponseAsync( - String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters); - - /** - * Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar - * VMs. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Capture Virtual Machine operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of virtual machine capture operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, VirtualMachineCaptureResultInner> beginCaptureAsync( - String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters); - - /** - * Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar - * VMs. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Capture Virtual Machine operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of virtual machine capture operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VirtualMachineCaptureResultInner> beginCapture( - String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters); - - /** - * Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar - * VMs. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Capture Virtual Machine operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of virtual machine capture operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VirtualMachineCaptureResultInner> beginCapture( - String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters, Context context); - - /** - * Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar - * VMs. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Capture Virtual Machine operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of virtual machine capture operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono captureAsync( - String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters); - - /** - * Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar - * VMs. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Capture Virtual Machine operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of virtual machine capture operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualMachineCaptureResultInner capture( - String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters); - - /** - * Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar - * VMs. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Capture Virtual Machine operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of virtual machine capture operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualMachineCaptureResultInner capture( - String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters, Context context); - - /** - * The operation to create or update a virtual machine. Please note some properties can be set only during virtual - * machine creation. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Create Virtual Machine operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String vmName, VirtualMachineInner parameters); - - /** - * The operation to create or update a virtual machine. Please note some properties can be set only during virtual - * machine creation. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Create Virtual Machine operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, VirtualMachineInner> beginCreateOrUpdateAsync( - String resourceGroupName, String vmName, VirtualMachineInner parameters); - - /** - * The operation to create or update a virtual machine. Please note some properties can be set only during virtual - * machine creation. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Create Virtual Machine operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VirtualMachineInner> beginCreateOrUpdate( - String resourceGroupName, String vmName, VirtualMachineInner parameters); - - /** - * The operation to create or update a virtual machine. Please note some properties can be set only during virtual - * machine creation. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Create Virtual Machine operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VirtualMachineInner> beginCreateOrUpdate( - String resourceGroupName, String vmName, VirtualMachineInner parameters, Context context); - - /** - * The operation to create or update a virtual machine. Please note some properties can be set only during virtual - * machine creation. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Create Virtual Machine operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, String vmName, VirtualMachineInner parameters); - - /** - * The operation to create or update a virtual machine. Please note some properties can be set only during virtual - * machine creation. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Create Virtual Machine operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualMachineInner createOrUpdate(String resourceGroupName, String vmName, VirtualMachineInner parameters); - - /** - * The operation to create or update a virtual machine. Please note some properties can be set only during virtual - * machine creation. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Create Virtual Machine operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualMachineInner createOrUpdate( - String resourceGroupName, String vmName, VirtualMachineInner parameters, Context context); - - /** - * The operation to update a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Update Virtual Machine operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> updateWithResponseAsync( - String resourceGroupName, String vmName, VirtualMachineUpdateInner parameters); - - /** - * The operation to update a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Update Virtual Machine operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, VirtualMachineInner> beginUpdateAsync( - String resourceGroupName, String vmName, VirtualMachineUpdateInner parameters); - - /** - * The operation to update a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Update Virtual Machine operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VirtualMachineInner> beginUpdate( - String resourceGroupName, String vmName, VirtualMachineUpdateInner parameters); - - /** - * The operation to update a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Update Virtual Machine operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VirtualMachineInner> beginUpdate( - String resourceGroupName, String vmName, VirtualMachineUpdateInner parameters, Context context); - - /** - * The operation to update a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Update Virtual Machine operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAsync( - String resourceGroupName, String vmName, VirtualMachineUpdateInner parameters); - - /** - * The operation to update a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Update Virtual Machine operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualMachineInner update(String resourceGroupName, String vmName, VirtualMachineUpdateInner parameters); - - /** - * The operation to update a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Update Virtual Machine operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualMachineInner update( - String resourceGroupName, String vmName, VirtualMachineUpdateInner parameters, Context context); - - /** - * The operation to delete a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param forceDeletion Optional parameter to force delete virtual machines.(Feature in Preview). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync( - String resourceGroupName, String vmName, Boolean forceDeletion); - - /** - * The operation to delete a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param forceDeletion Optional parameter to force delete virtual machines.(Feature in Preview). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String vmName, Boolean forceDeletion); - - /** - * The operation to delete a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param forceDeletion Optional parameter to force delete virtual machines.(Feature in Preview). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String vmName, Boolean forceDeletion); - - /** - * The operation to delete a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param forceDeletion Optional parameter to force delete virtual machines.(Feature in Preview). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String vmName, Boolean forceDeletion, Context context); - - /** - * The operation to delete a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param forceDeletion Optional parameter to force delete virtual machines.(Feature in Preview). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String vmName, Boolean forceDeletion); - - /** - * The operation to delete a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String vmName); - - /** - * The operation to delete a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param forceDeletion Optional parameter to force delete virtual machines.(Feature in Preview). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String vmName, Boolean forceDeletion); - - /** - * The operation to delete a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String vmName); - - /** - * The operation to delete a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param forceDeletion Optional parameter to force delete virtual machines.(Feature in Preview). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String vmName, Boolean forceDeletion, Context context); - - /** - * Retrieves information about the model view or the instance view of a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param expand The expand expression to apply on the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String vmName, InstanceViewTypes expand); - - /** - * Retrieves information about the model view or the instance view of a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param expand The expand expression to apply on the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync( - String resourceGroupName, String vmName, InstanceViewTypes expand); - - /** - * Retrieves information about the model view or the instance view of a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync(String resourceGroupName, String vmName); - - /** - * Retrieves information about the model view or the instance view of a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualMachineInner getByResourceGroup(String resourceGroupName, String vmName); - - /** - * Retrieves information about the model view or the instance view of a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param expand The expand expression to apply on the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String vmName, InstanceViewTypes expand, Context context); - - /** - * Retrieves information about the run-time state of a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the instance view of a virtual machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> instanceViewWithResponseAsync( - String resourceGroupName, String vmName); - - /** - * Retrieves information about the run-time state of a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the instance view of a virtual machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono instanceViewAsync(String resourceGroupName, String vmName); - - /** - * Retrieves information about the run-time state of a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the instance view of a virtual machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualMachineInstanceViewInner instanceView(String resourceGroupName, String vmName); - - /** - * Retrieves information about the run-time state of a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the instance view of a virtual machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response instanceViewWithResponse( - String resourceGroupName, String vmName, Context context); - - /** - * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before - * invoking this operation. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> convertToManagedDisksWithResponseAsync(String resourceGroupName, String vmName); - - /** - * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before - * invoking this operation. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginConvertToManagedDisksAsync(String resourceGroupName, String vmName); - - /** - * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before - * invoking this operation. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginConvertToManagedDisks(String resourceGroupName, String vmName); - - /** - * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before - * invoking this operation. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginConvertToManagedDisks( - String resourceGroupName, String vmName, Context context); - - /** - * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before - * invoking this operation. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono convertToManagedDisksAsync(String resourceGroupName, String vmName); - - /** - * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before - * invoking this operation. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void convertToManagedDisks(String resourceGroupName, String vmName); - - /** - * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before - * invoking this operation. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void convertToManagedDisks(String resourceGroupName, String vmName, Context context); - - /** - * Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources - * that this virtual machine uses. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deallocateWithResponseAsync(String resourceGroupName, String vmName); - - /** - * Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources - * that this virtual machine uses. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeallocateAsync(String resourceGroupName, String vmName); - - /** - * Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources - * that this virtual machine uses. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDeallocate(String resourceGroupName, String vmName); - - /** - * Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources - * that this virtual machine uses. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDeallocate(String resourceGroupName, String vmName, Context context); - - /** - * Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources - * that this virtual machine uses. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deallocateAsync(String resourceGroupName, String vmName); - - /** - * Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources - * that this virtual machine uses. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deallocate(String resourceGroupName, String vmName); - - /** - * Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources - * that this virtual machine uses. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deallocate(String resourceGroupName, String vmName, Context context); - - /** - * Sets the OS state of the virtual machine to generalized. It is recommended to sysprep the virtual machine before - * performing this operation. <br>For Windows, please refer to [Create a managed image of a generalized VM in - * Azure](https://docs.microsoft.com/en-us/azure/virtual-machines/windows/capture-image-resource).<br>For - * Linux, please refer to [How to create an image of a virtual machine or - * VHD](https://docs.microsoft.com/en-us/azure/virtual-machines/linux/capture-image). - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> generalizeWithResponseAsync(String resourceGroupName, String vmName); - - /** - * Sets the OS state of the virtual machine to generalized. It is recommended to sysprep the virtual machine before - * performing this operation. <br>For Windows, please refer to [Create a managed image of a generalized VM in - * Azure](https://docs.microsoft.com/en-us/azure/virtual-machines/windows/capture-image-resource).<br>For - * Linux, please refer to [How to create an image of a virtual machine or - * VHD](https://docs.microsoft.com/en-us/azure/virtual-machines/linux/capture-image). - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono generalizeAsync(String resourceGroupName, String vmName); - - /** - * Sets the OS state of the virtual machine to generalized. It is recommended to sysprep the virtual machine before - * performing this operation. <br>For Windows, please refer to [Create a managed image of a generalized VM in - * Azure](https://docs.microsoft.com/en-us/azure/virtual-machines/windows/capture-image-resource).<br>For - * Linux, please refer to [How to create an image of a virtual machine or - * VHD](https://docs.microsoft.com/en-us/azure/virtual-machines/linux/capture-image). - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void generalize(String resourceGroupName, String vmName); - - /** - * Sets the OS state of the virtual machine to generalized. It is recommended to sysprep the virtual machine before - * performing this operation. <br>For Windows, please refer to [Create a managed image of a generalized VM in - * Azure](https://docs.microsoft.com/en-us/azure/virtual-machines/windows/capture-image-resource).<br>For - * Linux, please refer to [How to create an image of a virtual machine or - * VHD](https://docs.microsoft.com/en-us/azure/virtual-machines/linux/capture-image). - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response generalizeWithResponse(String resourceGroupName, String vmName, Context context); - - /** - * Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to - * get the next page of virtual machines. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Virtual Machine operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName); - - /** - * Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to - * get the next page of virtual machines. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Virtual Machine operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to - * get the next page of virtual machines. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Virtual Machine operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get - * the next page of virtual machines. - * - * @param statusOnly statusOnly=true enables fetching run time status of all Virtual Machines in the subscription. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Virtual Machine operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String statusOnly); - - /** - * Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get - * the next page of virtual machines. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Virtual Machine operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get - * the next page of virtual machines. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Virtual Machine operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get - * the next page of virtual machines. - * - * @param statusOnly statusOnly=true enables fetching run time status of all Virtual Machines in the subscription. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Virtual Machine operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String statusOnly, Context context); - - /** - * Lists all available virtual machine sizes to which the specified virtual machine can be resized. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Virtual Machine operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAvailableSizesAsync(String resourceGroupName, String vmName); - - /** - * Lists all available virtual machine sizes to which the specified virtual machine can be resized. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Virtual Machine operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listAvailableSizes(String resourceGroupName, String vmName); - - /** - * Lists all available virtual machine sizes to which the specified virtual machine can be resized. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Virtual Machine operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listAvailableSizes(String resourceGroupName, String vmName, Context context); - - /** - * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same - * provisioned resources. You are still charged for this virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> powerOffWithResponseAsync( - String resourceGroupName, String vmName, Boolean skipShutdown); - - /** - * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same - * provisioned resources. You are still charged for this virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginPowerOffAsync( - String resourceGroupName, String vmName, Boolean skipShutdown); - - /** - * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same - * provisioned resources. You are still charged for this virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginPowerOff(String resourceGroupName, String vmName, Boolean skipShutdown); - - /** - * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same - * provisioned resources. You are still charged for this virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginPowerOff( - String resourceGroupName, String vmName, Boolean skipShutdown, Context context); - - /** - * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same - * provisioned resources. You are still charged for this virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono powerOffAsync(String resourceGroupName, String vmName, Boolean skipShutdown); - - /** - * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same - * provisioned resources. You are still charged for this virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono powerOffAsync(String resourceGroupName, String vmName); - - /** - * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same - * provisioned resources. You are still charged for this virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void powerOff(String resourceGroupName, String vmName, Boolean skipShutdown); - - /** - * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same - * provisioned resources. You are still charged for this virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void powerOff(String resourceGroupName, String vmName); - - /** - * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same - * provisioned resources. You are still charged for this virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void powerOff(String resourceGroupName, String vmName, Boolean skipShutdown, Context context); - - /** - * The operation to reapply a virtual machine's state. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> reapplyWithResponseAsync(String resourceGroupName, String vmName); - - /** - * The operation to reapply a virtual machine's state. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginReapplyAsync(String resourceGroupName, String vmName); - - /** - * The operation to reapply a virtual machine's state. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginReapply(String resourceGroupName, String vmName); - - /** - * The operation to reapply a virtual machine's state. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginReapply(String resourceGroupName, String vmName, Context context); - - /** - * The operation to reapply a virtual machine's state. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono reapplyAsync(String resourceGroupName, String vmName); - - /** - * The operation to reapply a virtual machine's state. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void reapply(String resourceGroupName, String vmName); - - /** - * The operation to reapply a virtual machine's state. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void reapply(String resourceGroupName, String vmName, Context context); - - /** - * The operation to restart a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> restartWithResponseAsync(String resourceGroupName, String vmName); - - /** - * The operation to restart a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginRestartAsync(String resourceGroupName, String vmName); - - /** - * The operation to restart a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginRestart(String resourceGroupName, String vmName); - - /** - * The operation to restart a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginRestart(String resourceGroupName, String vmName, Context context); - - /** - * The operation to restart a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono restartAsync(String resourceGroupName, String vmName); - - /** - * The operation to restart a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void restart(String resourceGroupName, String vmName); - - /** - * The operation to restart a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void restart(String resourceGroupName, String vmName, Context context); - - /** - * The operation to start a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> startWithResponseAsync(String resourceGroupName, String vmName); - - /** - * The operation to start a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginStartAsync(String resourceGroupName, String vmName); - - /** - * The operation to start a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginStart(String resourceGroupName, String vmName); - - /** - * The operation to start a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginStart(String resourceGroupName, String vmName, Context context); - - /** - * The operation to start a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono startAsync(String resourceGroupName, String vmName); - - /** - * The operation to start a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void start(String resourceGroupName, String vmName); - - /** - * The operation to start a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void start(String resourceGroupName, String vmName, Context context); - - /** - * Shuts down the virtual machine, moves it to a new node, and powers it back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> redeployWithResponseAsync(String resourceGroupName, String vmName); - - /** - * Shuts down the virtual machine, moves it to a new node, and powers it back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginRedeployAsync(String resourceGroupName, String vmName); - - /** - * Shuts down the virtual machine, moves it to a new node, and powers it back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginRedeploy(String resourceGroupName, String vmName); - - /** - * Shuts down the virtual machine, moves it to a new node, and powers it back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginRedeploy(String resourceGroupName, String vmName, Context context); - - /** - * Shuts down the virtual machine, moves it to a new node, and powers it back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono redeployAsync(String resourceGroupName, String vmName); - - /** - * Shuts down the virtual machine, moves it to a new node, and powers it back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void redeploy(String resourceGroupName, String vmName); - - /** - * Shuts down the virtual machine, moves it to a new node, and powers it back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void redeploy(String resourceGroupName, String vmName, Context context); - - /** - * Reimages the virtual machine which has an ephemeral OS disk back to its initial state. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Reimage Virtual Machine operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> reimageWithResponseAsync( - String resourceGroupName, String vmName, VirtualMachineReimageParameters parameters); - - /** - * Reimages the virtual machine which has an ephemeral OS disk back to its initial state. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Reimage Virtual Machine operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginReimageAsync( - String resourceGroupName, String vmName, VirtualMachineReimageParameters parameters); - - /** - * Reimages the virtual machine which has an ephemeral OS disk back to its initial state. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Reimage Virtual Machine operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginReimage( - String resourceGroupName, String vmName, VirtualMachineReimageParameters parameters); - - /** - * Reimages the virtual machine which has an ephemeral OS disk back to its initial state. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Reimage Virtual Machine operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginReimage( - String resourceGroupName, String vmName, VirtualMachineReimageParameters parameters, Context context); - - /** - * Reimages the virtual machine which has an ephemeral OS disk back to its initial state. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Reimage Virtual Machine operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono reimageAsync(String resourceGroupName, String vmName, VirtualMachineReimageParameters parameters); - - /** - * Reimages the virtual machine which has an ephemeral OS disk back to its initial state. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono reimageAsync(String resourceGroupName, String vmName); - - /** - * Reimages the virtual machine which has an ephemeral OS disk back to its initial state. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Reimage Virtual Machine operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void reimage(String resourceGroupName, String vmName, VirtualMachineReimageParameters parameters); - - /** - * Reimages the virtual machine which has an ephemeral OS disk back to its initial state. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void reimage(String resourceGroupName, String vmName); - - /** - * Reimages the virtual machine which has an ephemeral OS disk back to its initial state. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Reimage Virtual Machine operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void reimage(String resourceGroupName, String vmName, VirtualMachineReimageParameters parameters, Context context); - - /** - * The operation to retrieve SAS URIs for a virtual machine's boot diagnostic logs. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param sasUriExpirationTimeInMinutes Expiration duration in minutes for the SAS URIs with a value between 1 to - * 1440 minutes. <br><br>NOTE: If not specified, SAS URIs will be generated with a default - * expiration duration of 120 minutes. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the SAS URIs of the console screenshot and serial log blobs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> retrieveBootDiagnosticsDataWithResponseAsync( - String resourceGroupName, String vmName, Integer sasUriExpirationTimeInMinutes); - - /** - * The operation to retrieve SAS URIs for a virtual machine's boot diagnostic logs. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param sasUriExpirationTimeInMinutes Expiration duration in minutes for the SAS URIs with a value between 1 to - * 1440 minutes. <br><br>NOTE: If not specified, SAS URIs will be generated with a default - * expiration duration of 120 minutes. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the SAS URIs of the console screenshot and serial log blobs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono retrieveBootDiagnosticsDataAsync( - String resourceGroupName, String vmName, Integer sasUriExpirationTimeInMinutes); - - /** - * The operation to retrieve SAS URIs for a virtual machine's boot diagnostic logs. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the SAS URIs of the console screenshot and serial log blobs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono retrieveBootDiagnosticsDataAsync( - String resourceGroupName, String vmName); - - /** - * The operation to retrieve SAS URIs for a virtual machine's boot diagnostic logs. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the SAS URIs of the console screenshot and serial log blobs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RetrieveBootDiagnosticsDataResultInner retrieveBootDiagnosticsData(String resourceGroupName, String vmName); - - /** - * The operation to retrieve SAS URIs for a virtual machine's boot diagnostic logs. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param sasUriExpirationTimeInMinutes Expiration duration in minutes for the SAS URIs with a value between 1 to - * 1440 minutes. <br><br>NOTE: If not specified, SAS URIs will be generated with a default - * expiration duration of 120 minutes. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the SAS URIs of the console screenshot and serial log blobs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response retrieveBootDiagnosticsDataWithResponse( - String resourceGroupName, String vmName, Integer sasUriExpirationTimeInMinutes, Context context); - - /** - * The operation to perform maintenance on a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> performMaintenanceWithResponseAsync(String resourceGroupName, String vmName); - - /** - * The operation to perform maintenance on a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginPerformMaintenanceAsync(String resourceGroupName, String vmName); - - /** - * The operation to perform maintenance on a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginPerformMaintenance(String resourceGroupName, String vmName); - - /** - * The operation to perform maintenance on a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginPerformMaintenance( - String resourceGroupName, String vmName, Context context); - - /** - * The operation to perform maintenance on a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono performMaintenanceAsync(String resourceGroupName, String vmName); - - /** - * The operation to perform maintenance on a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void performMaintenance(String resourceGroupName, String vmName); - - /** - * The operation to perform maintenance on a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void performMaintenance(String resourceGroupName, String vmName, Context context); - - /** - * The operation to simulate the eviction of spot virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> simulateEvictionWithResponseAsync(String resourceGroupName, String vmName); - - /** - * The operation to simulate the eviction of spot virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono simulateEvictionAsync(String resourceGroupName, String vmName); - - /** - * The operation to simulate the eviction of spot virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void simulateEviction(String resourceGroupName, String vmName); - - /** - * The operation to simulate the eviction of spot virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response simulateEvictionWithResponse(String resourceGroupName, String vmName, Context context); - - /** - * Assess patches on the VM. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the properties of an AssessPatches result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> assessPatchesWithResponseAsync(String resourceGroupName, String vmName); - - /** - * Assess patches on the VM. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the properties of an AssessPatches result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, VirtualMachineAssessPatchesResultInner> - beginAssessPatchesAsync(String resourceGroupName, String vmName); - - /** - * Assess patches on the VM. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the properties of an AssessPatches result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VirtualMachineAssessPatchesResultInner> - beginAssessPatches(String resourceGroupName, String vmName); - - /** - * Assess patches on the VM. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the properties of an AssessPatches result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VirtualMachineAssessPatchesResultInner> - beginAssessPatches(String resourceGroupName, String vmName, Context context); - - /** - * Assess patches on the VM. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the properties of an AssessPatches result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono assessPatchesAsync(String resourceGroupName, String vmName); - - /** - * Assess patches on the VM. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the properties of an AssessPatches result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualMachineAssessPatchesResultInner assessPatches(String resourceGroupName, String vmName); - - /** - * Assess patches on the VM. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the properties of an AssessPatches result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualMachineAssessPatchesResultInner assessPatches(String resourceGroupName, String vmName, Context context); - - /** - * Run command on the VM. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Run command operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> runCommandWithResponseAsync( - String resourceGroupName, String vmName, RunCommandInput parameters); - - /** - * Run command on the VM. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Run command operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, RunCommandResultInner> beginRunCommandAsync( - String resourceGroupName, String vmName, RunCommandInput parameters); - - /** - * Run command on the VM. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Run command operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, RunCommandResultInner> beginRunCommand( - String resourceGroupName, String vmName, RunCommandInput parameters); - - /** - * Run command on the VM. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Run command operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, RunCommandResultInner> beginRunCommand( - String resourceGroupName, String vmName, RunCommandInput parameters, Context context); - - /** - * Run command on the VM. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Run command operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono runCommandAsync(String resourceGroupName, String vmName, RunCommandInput parameters); - - /** - * Run command on the VM. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Run command operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RunCommandResultInner runCommand(String resourceGroupName, String vmName, RunCommandInput parameters); - - /** - * Run command on the VM. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Run command operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RunCommandResultInner runCommand( - String resourceGroupName, String vmName, RunCommandInput parameters, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/AccessUriInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/AccessUriInner.java deleted file mode 100644 index c2898aea50f6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/AccessUriInner.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** A disk access SAS uri. */ -@Immutable -public final class AccessUriInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AccessUriInner.class); - - /* - * A SAS uri for accessing a disk. - */ - @JsonProperty(value = "accessSAS", access = JsonProperty.Access.WRITE_ONLY) - private String accessSas; - - /** - * Get the accessSas property: A SAS uri for accessing a disk. - * - * @return the accessSas value. - */ - public String accessSas() { - return this.accessSas; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/AvailabilitySetInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/AvailabilitySetInner.java deleted file mode 100644 index 681f7cdb2fcf..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/AvailabilitySetInner.java +++ /dev/null @@ -1,211 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.models.InstanceViewStatus; -import com.azure.resourcemanager.compute.models.Sku; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** - * Specifies information about the availability set that the virtual machine should be assigned to. Virtual machines - * specified in the same availability set are allocated to different nodes to maximize availability. For more - * information about availability sets, see [Manage the availability of virtual - * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). - * <br><br> For more information on Azure planned maintenance, see [Planned maintenance for virtual machines - * in - * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) - * <br><br> Currently, a VM can only be added to availability set at creation time. An existing VM cannot be - * added to an availability set. - */ -@Fluent -public final class AvailabilitySetInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailabilitySetInner.class); - - /* - * The instance view of a resource. - */ - @JsonProperty(value = "properties") - private AvailabilitySetProperties innerProperties; - - /* - * Sku of the availability set, only name is required to be set. See - * AvailabilitySetSkuTypes for possible set of values. Use 'Aligned' for - * virtual machines with managed disks and 'Classic' for virtual machines - * with unmanaged disks. Default value is 'Classic'. - */ - @JsonProperty(value = "sku") - private Sku sku; - - /** - * Get the innerProperties property: The instance view of a resource. - * - * @return the innerProperties value. - */ - private AvailabilitySetProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the sku property: Sku of the availability set, only name is required to be set. See AvailabilitySetSkuTypes - * for possible set of values. Use 'Aligned' for virtual machines with managed disks and 'Classic' for virtual - * machines with unmanaged disks. Default value is 'Classic'. - * - * @return the sku value. - */ - public Sku sku() { - return this.sku; - } - - /** - * Set the sku property: Sku of the availability set, only name is required to be set. See AvailabilitySetSkuTypes - * for possible set of values. Use 'Aligned' for virtual machines with managed disks and 'Classic' for virtual - * machines with unmanaged disks. Default value is 'Classic'. - * - * @param sku the sku value to set. - * @return the AvailabilitySetInner object itself. - */ - public AvailabilitySetInner withSku(Sku sku) { - this.sku = sku; - return this; - } - - /** {@inheritDoc} */ - @Override - public AvailabilitySetInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public AvailabilitySetInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the platformUpdateDomainCount property: Update Domain count. - * - * @return the platformUpdateDomainCount value. - */ - public Integer platformUpdateDomainCount() { - return this.innerProperties() == null ? null : this.innerProperties().platformUpdateDomainCount(); - } - - /** - * Set the platformUpdateDomainCount property: Update Domain count. - * - * @param platformUpdateDomainCount the platformUpdateDomainCount value to set. - * @return the AvailabilitySetInner object itself. - */ - public AvailabilitySetInner withPlatformUpdateDomainCount(Integer platformUpdateDomainCount) { - if (this.innerProperties() == null) { - this.innerProperties = new AvailabilitySetProperties(); - } - this.innerProperties().withPlatformUpdateDomainCount(platformUpdateDomainCount); - return this; - } - - /** - * Get the platformFaultDomainCount property: Fault Domain count. - * - * @return the platformFaultDomainCount value. - */ - public Integer platformFaultDomainCount() { - return this.innerProperties() == null ? null : this.innerProperties().platformFaultDomainCount(); - } - - /** - * Set the platformFaultDomainCount property: Fault Domain count. - * - * @param platformFaultDomainCount the platformFaultDomainCount value to set. - * @return the AvailabilitySetInner object itself. - */ - public AvailabilitySetInner withPlatformFaultDomainCount(Integer platformFaultDomainCount) { - if (this.innerProperties() == null) { - this.innerProperties = new AvailabilitySetProperties(); - } - this.innerProperties().withPlatformFaultDomainCount(platformFaultDomainCount); - return this; - } - - /** - * Get the virtualMachines property: A list of references to all virtual machines in the availability set. - * - * @return the virtualMachines value. - */ - public List virtualMachines() { - return this.innerProperties() == null ? null : this.innerProperties().virtualMachines(); - } - - /** - * Set the virtualMachines property: A list of references to all virtual machines in the availability set. - * - * @param virtualMachines the virtualMachines value to set. - * @return the AvailabilitySetInner object itself. - */ - public AvailabilitySetInner withVirtualMachines(List virtualMachines) { - if (this.innerProperties() == null) { - this.innerProperties = new AvailabilitySetProperties(); - } - this.innerProperties().withVirtualMachines(virtualMachines); - return this; - } - - /** - * Get the proximityPlacementGroup property: Specifies information about the proximity placement group that the - * availability set should be assigned to. <br><br>Minimum api-version: 2018-04-01. - * - * @return the proximityPlacementGroup value. - */ - public SubResource proximityPlacementGroup() { - return this.innerProperties() == null ? null : this.innerProperties().proximityPlacementGroup(); - } - - /** - * Set the proximityPlacementGroup property: Specifies information about the proximity placement group that the - * availability set should be assigned to. <br><br>Minimum api-version: 2018-04-01. - * - * @param proximityPlacementGroup the proximityPlacementGroup value to set. - * @return the AvailabilitySetInner object itself. - */ - public AvailabilitySetInner withProximityPlacementGroup(SubResource proximityPlacementGroup) { - if (this.innerProperties() == null) { - this.innerProperties = new AvailabilitySetProperties(); - } - this.innerProperties().withProximityPlacementGroup(proximityPlacementGroup); - return this; - } - - /** - * Get the statuses property: The resource status information. - * - * @return the statuses value. - */ - public List statuses() { - return this.innerProperties() == null ? null : this.innerProperties().statuses(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - if (sku() != null) { - sku().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/AvailabilitySetProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/AvailabilitySetProperties.java deleted file mode 100644 index 8a2ca602da0d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/AvailabilitySetProperties.java +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.models.InstanceViewStatus; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The instance view of a resource. */ -@Fluent -public final class AvailabilitySetProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailabilitySetProperties.class); - - /* - * Update Domain count. - */ - @JsonProperty(value = "platformUpdateDomainCount") - private Integer platformUpdateDomainCount; - - /* - * Fault Domain count. - */ - @JsonProperty(value = "platformFaultDomainCount") - private Integer platformFaultDomainCount; - - /* - * A list of references to all virtual machines in the availability set. - */ - @JsonProperty(value = "virtualMachines") - private List virtualMachines; - - /* - * Specifies information about the proximity placement group that the - * availability set should be assigned to.

Minimum api-version: - * 2018-04-01. - */ - @JsonProperty(value = "proximityPlacementGroup") - private SubResource proximityPlacementGroup; - - /* - * The resource status information. - */ - @JsonProperty(value = "statuses", access = JsonProperty.Access.WRITE_ONLY) - private List statuses; - - /** - * Get the platformUpdateDomainCount property: Update Domain count. - * - * @return the platformUpdateDomainCount value. - */ - public Integer platformUpdateDomainCount() { - return this.platformUpdateDomainCount; - } - - /** - * Set the platformUpdateDomainCount property: Update Domain count. - * - * @param platformUpdateDomainCount the platformUpdateDomainCount value to set. - * @return the AvailabilitySetProperties object itself. - */ - public AvailabilitySetProperties withPlatformUpdateDomainCount(Integer platformUpdateDomainCount) { - this.platformUpdateDomainCount = platformUpdateDomainCount; - return this; - } - - /** - * Get the platformFaultDomainCount property: Fault Domain count. - * - * @return the platformFaultDomainCount value. - */ - public Integer platformFaultDomainCount() { - return this.platformFaultDomainCount; - } - - /** - * Set the platformFaultDomainCount property: Fault Domain count. - * - * @param platformFaultDomainCount the platformFaultDomainCount value to set. - * @return the AvailabilitySetProperties object itself. - */ - public AvailabilitySetProperties withPlatformFaultDomainCount(Integer platformFaultDomainCount) { - this.platformFaultDomainCount = platformFaultDomainCount; - return this; - } - - /** - * Get the virtualMachines property: A list of references to all virtual machines in the availability set. - * - * @return the virtualMachines value. - */ - public List virtualMachines() { - return this.virtualMachines; - } - - /** - * Set the virtualMachines property: A list of references to all virtual machines in the availability set. - * - * @param virtualMachines the virtualMachines value to set. - * @return the AvailabilitySetProperties object itself. - */ - public AvailabilitySetProperties withVirtualMachines(List virtualMachines) { - this.virtualMachines = virtualMachines; - return this; - } - - /** - * Get the proximityPlacementGroup property: Specifies information about the proximity placement group that the - * availability set should be assigned to. <br><br>Minimum api-version: 2018-04-01. - * - * @return the proximityPlacementGroup value. - */ - public SubResource proximityPlacementGroup() { - return this.proximityPlacementGroup; - } - - /** - * Set the proximityPlacementGroup property: Specifies information about the proximity placement group that the - * availability set should be assigned to. <br><br>Minimum api-version: 2018-04-01. - * - * @param proximityPlacementGroup the proximityPlacementGroup value to set. - * @return the AvailabilitySetProperties object itself. - */ - public AvailabilitySetProperties withProximityPlacementGroup(SubResource proximityPlacementGroup) { - this.proximityPlacementGroup = proximityPlacementGroup; - return this; - } - - /** - * Get the statuses property: The resource status information. - * - * @return the statuses value. - */ - public List statuses() { - return this.statuses; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (statuses() != null) { - statuses().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/ComputeOperationValueDisplay.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/ComputeOperationValueDisplay.java deleted file mode 100644 index e3563854ec82..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/ComputeOperationValueDisplay.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describes the properties of a Compute Operation Value Display. */ -@Immutable -public final class ComputeOperationValueDisplay { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ComputeOperationValueDisplay.class); - - /* - * The display name of the compute operation. - */ - @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) - private String operation; - - /* - * The display name of the resource the operation applies to. - */ - @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) - private String resource; - - /* - * The description of the operation. - */ - @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) - private String description; - - /* - * The resource provider for the operation. - */ - @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) - private String provider; - - /** - * Get the operation property: The display name of the compute operation. - * - * @return the operation value. - */ - public String operation() { - return this.operation; - } - - /** - * Get the resource property: The display name of the resource the operation applies to. - * - * @return the resource value. - */ - public String resource() { - return this.resource; - } - - /** - * Get the description property: The description of the operation. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Get the provider property: The resource provider for the operation. - * - * @return the provider value. - */ - public String provider() { - return this.provider; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/ComputeOperationValueInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/ComputeOperationValueInner.java deleted file mode 100644 index a245195d690e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/ComputeOperationValueInner.java +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describes the properties of a Compute Operation value. */ -@Fluent -public final class ComputeOperationValueInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ComputeOperationValueInner.class); - - /* - * The origin of the compute operation. - */ - @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) - private String origin; - - /* - * The name of the compute operation. - */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) - private String name; - - /* - * Describes the properties of a Compute Operation Value Display. - */ - @JsonProperty(value = "display") - private ComputeOperationValueDisplay innerDisplay; - - /** - * Get the origin property: The origin of the compute operation. - * - * @return the origin value. - */ - public String origin() { - return this.origin; - } - - /** - * Get the name property: The name of the compute operation. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the innerDisplay property: Describes the properties of a Compute Operation Value Display. - * - * @return the innerDisplay value. - */ - private ComputeOperationValueDisplay innerDisplay() { - return this.innerDisplay; - } - - /** - * Get the operation property: The display name of the compute operation. - * - * @return the operation value. - */ - public String operation() { - return this.innerDisplay() == null ? null : this.innerDisplay().operation(); - } - - /** - * Get the resource property: The display name of the resource the operation applies to. - * - * @return the resource value. - */ - public String resource() { - return this.innerDisplay() == null ? null : this.innerDisplay().resource(); - } - - /** - * Get the description property: The description of the operation. - * - * @return the description value. - */ - public String description() { - return this.innerDisplay() == null ? null : this.innerDisplay().description(); - } - - /** - * Get the provider property: The resource provider for the operation. - * - * @return the provider value. - */ - public String provider() { - return this.innerDisplay() == null ? null : this.innerDisplay().provider(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerDisplay() != null) { - innerDisplay().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/DedicatedHostGroupInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/DedicatedHostGroupInner.java deleted file mode 100644 index 8c95332032a0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/DedicatedHostGroupInner.java +++ /dev/null @@ -1,169 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.models.DedicatedHostGroupInstanceView; -import com.azure.resourcemanager.compute.models.SubResourceReadOnly; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** - * Specifies information about the dedicated host group that the dedicated hosts should be assigned to. - * <br><br> Currently, a dedicated host can only be added to a dedicated host group at creation time. An - * existing dedicated host cannot be added to another dedicated host group. - */ -@Fluent -public final class DedicatedHostGroupInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DedicatedHostGroupInner.class); - - /* - * Dedicated Host Group Properties. - */ - @JsonProperty(value = "properties") - private DedicatedHostGroupProperties innerProperties; - - /* - * Availability Zone to use for this host group. Only single zone is - * supported. The zone can be assigned only during creation. If not - * provided, the group supports all zones in the region. If provided, - * enforces each host in the group to be in the same zone. - */ - @JsonProperty(value = "zones") - private List zones; - - /** - * Get the innerProperties property: Dedicated Host Group Properties. - * - * @return the innerProperties value. - */ - private DedicatedHostGroupProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the zones property: Availability Zone to use for this host group. Only single zone is supported. The zone can - * be assigned only during creation. If not provided, the group supports all zones in the region. If provided, - * enforces each host in the group to be in the same zone. - * - * @return the zones value. - */ - public List zones() { - return this.zones; - } - - /** - * Set the zones property: Availability Zone to use for this host group. Only single zone is supported. The zone can - * be assigned only during creation. If not provided, the group supports all zones in the region. If provided, - * enforces each host in the group to be in the same zone. - * - * @param zones the zones value to set. - * @return the DedicatedHostGroupInner object itself. - */ - public DedicatedHostGroupInner withZones(List zones) { - this.zones = zones; - return this; - } - - /** {@inheritDoc} */ - @Override - public DedicatedHostGroupInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public DedicatedHostGroupInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the platformFaultDomainCount property: Number of fault domains that the host group can span. - * - * @return the platformFaultDomainCount value. - */ - public Integer platformFaultDomainCount() { - return this.innerProperties() == null ? null : this.innerProperties().platformFaultDomainCount(); - } - - /** - * Set the platformFaultDomainCount property: Number of fault domains that the host group can span. - * - * @param platformFaultDomainCount the platformFaultDomainCount value to set. - * @return the DedicatedHostGroupInner object itself. - */ - public DedicatedHostGroupInner withPlatformFaultDomainCount(Integer platformFaultDomainCount) { - if (this.innerProperties() == null) { - this.innerProperties = new DedicatedHostGroupProperties(); - } - this.innerProperties().withPlatformFaultDomainCount(platformFaultDomainCount); - return this; - } - - /** - * Get the hosts property: A list of references to all dedicated hosts in the dedicated host group. - * - * @return the hosts value. - */ - public List hosts() { - return this.innerProperties() == null ? null : this.innerProperties().hosts(); - } - - /** - * Get the instanceView property: The dedicated host group instance view, which has the list of instance view of the - * dedicated hosts under the dedicated host group. - * - * @return the instanceView value. - */ - public DedicatedHostGroupInstanceView instanceView() { - return this.innerProperties() == null ? null : this.innerProperties().instanceView(); - } - - /** - * Get the supportAutomaticPlacement property: Specifies whether virtual machines or virtual machine scale sets can - * be placed automatically on the dedicated host group. Automatic placement means resources are allocated on - * dedicated hosts, that are chosen by Azure, under the dedicated host group. The value is defaulted to 'false' when - * not provided. <br><br>Minimum api-version: 2020-06-01. - * - * @return the supportAutomaticPlacement value. - */ - public Boolean supportAutomaticPlacement() { - return this.innerProperties() == null ? null : this.innerProperties().supportAutomaticPlacement(); - } - - /** - * Set the supportAutomaticPlacement property: Specifies whether virtual machines or virtual machine scale sets can - * be placed automatically on the dedicated host group. Automatic placement means resources are allocated on - * dedicated hosts, that are chosen by Azure, under the dedicated host group. The value is defaulted to 'false' when - * not provided. <br><br>Minimum api-version: 2020-06-01. - * - * @param supportAutomaticPlacement the supportAutomaticPlacement value to set. - * @return the DedicatedHostGroupInner object itself. - */ - public DedicatedHostGroupInner withSupportAutomaticPlacement(Boolean supportAutomaticPlacement) { - if (this.innerProperties() == null) { - this.innerProperties = new DedicatedHostGroupProperties(); - } - this.innerProperties().withSupportAutomaticPlacement(supportAutomaticPlacement); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/DedicatedHostGroupProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/DedicatedHostGroupProperties.java deleted file mode 100644 index 3271890aa240..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/DedicatedHostGroupProperties.java +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.models.DedicatedHostGroupInstanceView; -import com.azure.resourcemanager.compute.models.SubResourceReadOnly; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Dedicated Host Group Properties. */ -@Fluent -public final class DedicatedHostGroupProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DedicatedHostGroupProperties.class); - - /* - * Number of fault domains that the host group can span. - */ - @JsonProperty(value = "platformFaultDomainCount", required = true) - private int platformFaultDomainCount; - - /* - * A list of references to all dedicated hosts in the dedicated host group. - */ - @JsonProperty(value = "hosts", access = JsonProperty.Access.WRITE_ONLY) - private List hosts; - - /* - * The dedicated host group instance view, which has the list of instance - * view of the dedicated hosts under the dedicated host group. - */ - @JsonProperty(value = "instanceView", access = JsonProperty.Access.WRITE_ONLY) - private DedicatedHostGroupInstanceView instanceView; - - /* - * Specifies whether virtual machines or virtual machine scale sets can be - * placed automatically on the dedicated host group. Automatic placement - * means resources are allocated on dedicated hosts, that are chosen by - * Azure, under the dedicated host group. The value is defaulted to 'false' - * when not provided.

Minimum api-version: 2020-06-01. - */ - @JsonProperty(value = "supportAutomaticPlacement") - private Boolean supportAutomaticPlacement; - - /** - * Get the platformFaultDomainCount property: Number of fault domains that the host group can span. - * - * @return the platformFaultDomainCount value. - */ - public int platformFaultDomainCount() { - return this.platformFaultDomainCount; - } - - /** - * Set the platformFaultDomainCount property: Number of fault domains that the host group can span. - * - * @param platformFaultDomainCount the platformFaultDomainCount value to set. - * @return the DedicatedHostGroupProperties object itself. - */ - public DedicatedHostGroupProperties withPlatformFaultDomainCount(int platformFaultDomainCount) { - this.platformFaultDomainCount = platformFaultDomainCount; - return this; - } - - /** - * Get the hosts property: A list of references to all dedicated hosts in the dedicated host group. - * - * @return the hosts value. - */ - public List hosts() { - return this.hosts; - } - - /** - * Get the instanceView property: The dedicated host group instance view, which has the list of instance view of the - * dedicated hosts under the dedicated host group. - * - * @return the instanceView value. - */ - public DedicatedHostGroupInstanceView instanceView() { - return this.instanceView; - } - - /** - * Get the supportAutomaticPlacement property: Specifies whether virtual machines or virtual machine scale sets can - * be placed automatically on the dedicated host group. Automatic placement means resources are allocated on - * dedicated hosts, that are chosen by Azure, under the dedicated host group. The value is defaulted to 'false' when - * not provided. <br><br>Minimum api-version: 2020-06-01. - * - * @return the supportAutomaticPlacement value. - */ - public Boolean supportAutomaticPlacement() { - return this.supportAutomaticPlacement; - } - - /** - * Set the supportAutomaticPlacement property: Specifies whether virtual machines or virtual machine scale sets can - * be placed automatically on the dedicated host group. Automatic placement means resources are allocated on - * dedicated hosts, that are chosen by Azure, under the dedicated host group. The value is defaulted to 'false' when - * not provided. <br><br>Minimum api-version: 2020-06-01. - * - * @param supportAutomaticPlacement the supportAutomaticPlacement value to set. - * @return the DedicatedHostGroupProperties object itself. - */ - public DedicatedHostGroupProperties withSupportAutomaticPlacement(Boolean supportAutomaticPlacement) { - this.supportAutomaticPlacement = supportAutomaticPlacement; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (hosts() != null) { - hosts().forEach(e -> e.validate()); - } - if (instanceView() != null) { - instanceView().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/DedicatedHostInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/DedicatedHostInner.java deleted file mode 100644 index fbce3689a550..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/DedicatedHostInner.java +++ /dev/null @@ -1,224 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.models.DedicatedHostInstanceView; -import com.azure.resourcemanager.compute.models.DedicatedHostLicenseTypes; -import com.azure.resourcemanager.compute.models.Sku; -import com.azure.resourcemanager.compute.models.SubResourceReadOnly; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; -import java.util.Map; - -/** Specifies information about the Dedicated host. */ -@Fluent -public final class DedicatedHostInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DedicatedHostInner.class); - - /* - * Properties of the dedicated host. - */ - @JsonProperty(value = "properties") - private DedicatedHostProperties innerProperties; - - /* - * SKU of the dedicated host for Hardware Generation and VM family. Only - * name is required to be set. List Microsoft.Compute SKUs for a list of - * possible values. - */ - @JsonProperty(value = "sku", required = true) - private Sku sku; - - /** - * Get the innerProperties property: Properties of the dedicated host. - * - * @return the innerProperties value. - */ - private DedicatedHostProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the sku property: SKU of the dedicated host for Hardware Generation and VM family. Only name is required to - * be set. List Microsoft.Compute SKUs for a list of possible values. - * - * @return the sku value. - */ - public Sku sku() { - return this.sku; - } - - /** - * Set the sku property: SKU of the dedicated host for Hardware Generation and VM family. Only name is required to - * be set. List Microsoft.Compute SKUs for a list of possible values. - * - * @param sku the sku value to set. - * @return the DedicatedHostInner object itself. - */ - public DedicatedHostInner withSku(Sku sku) { - this.sku = sku; - return this; - } - - /** {@inheritDoc} */ - @Override - public DedicatedHostInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public DedicatedHostInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the platformFaultDomain property: Fault domain of the dedicated host within a dedicated host group. - * - * @return the platformFaultDomain value. - */ - public Integer platformFaultDomain() { - return this.innerProperties() == null ? null : this.innerProperties().platformFaultDomain(); - } - - /** - * Set the platformFaultDomain property: Fault domain of the dedicated host within a dedicated host group. - * - * @param platformFaultDomain the platformFaultDomain value to set. - * @return the DedicatedHostInner object itself. - */ - public DedicatedHostInner withPlatformFaultDomain(Integer platformFaultDomain) { - if (this.innerProperties() == null) { - this.innerProperties = new DedicatedHostProperties(); - } - this.innerProperties().withPlatformFaultDomain(platformFaultDomain); - return this; - } - - /** - * Get the autoReplaceOnFailure property: Specifies whether the dedicated host should be replaced automatically in - * case of a failure. The value is defaulted to 'true' when not provided. - * - * @return the autoReplaceOnFailure value. - */ - public Boolean autoReplaceOnFailure() { - return this.innerProperties() == null ? null : this.innerProperties().autoReplaceOnFailure(); - } - - /** - * Set the autoReplaceOnFailure property: Specifies whether the dedicated host should be replaced automatically in - * case of a failure. The value is defaulted to 'true' when not provided. - * - * @param autoReplaceOnFailure the autoReplaceOnFailure value to set. - * @return the DedicatedHostInner object itself. - */ - public DedicatedHostInner withAutoReplaceOnFailure(Boolean autoReplaceOnFailure) { - if (this.innerProperties() == null) { - this.innerProperties = new DedicatedHostProperties(); - } - this.innerProperties().withAutoReplaceOnFailure(autoReplaceOnFailure); - return this; - } - - /** - * Get the hostId property: A unique id generated and assigned to the dedicated host by the platform. - * <br><br> Does not change throughout the lifetime of the host. - * - * @return the hostId value. - */ - public String hostId() { - return this.innerProperties() == null ? null : this.innerProperties().hostId(); - } - - /** - * Get the virtualMachines property: A list of references to all virtual machines in the Dedicated Host. - * - * @return the virtualMachines value. - */ - public List virtualMachines() { - return this.innerProperties() == null ? null : this.innerProperties().virtualMachines(); - } - - /** - * Get the licenseType property: Specifies the software license type that will be applied to the VMs deployed on the - * dedicated host. <br><br> Possible values are: <br><br> **None** <br><br> - * **Windows_Server_Hybrid** <br><br> **Windows_Server_Perpetual** <br><br> Default: - * **None**. - * - * @return the licenseType value. - */ - public DedicatedHostLicenseTypes licenseType() { - return this.innerProperties() == null ? null : this.innerProperties().licenseType(); - } - - /** - * Set the licenseType property: Specifies the software license type that will be applied to the VMs deployed on the - * dedicated host. <br><br> Possible values are: <br><br> **None** <br><br> - * **Windows_Server_Hybrid** <br><br> **Windows_Server_Perpetual** <br><br> Default: - * **None**. - * - * @param licenseType the licenseType value to set. - * @return the DedicatedHostInner object itself. - */ - public DedicatedHostInner withLicenseType(DedicatedHostLicenseTypes licenseType) { - if (this.innerProperties() == null) { - this.innerProperties = new DedicatedHostProperties(); - } - this.innerProperties().withLicenseType(licenseType); - return this; - } - - /** - * Get the provisioningTime property: The date when the host was first provisioned. - * - * @return the provisioningTime value. - */ - public OffsetDateTime provisioningTime() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningTime(); - } - - /** - * Get the provisioningState property: The provisioning state, which only appears in the response. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the instanceView property: The dedicated host instance view. - * - * @return the instanceView value. - */ - public DedicatedHostInstanceView instanceView() { - return this.innerProperties() == null ? null : this.innerProperties().instanceView(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - if (sku() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property sku in model DedicatedHostInner")); - } else { - sku().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/DedicatedHostProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/DedicatedHostProperties.java deleted file mode 100644 index 19f5690bf50f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/DedicatedHostProperties.java +++ /dev/null @@ -1,202 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.models.DedicatedHostInstanceView; -import com.azure.resourcemanager.compute.models.DedicatedHostLicenseTypes; -import com.azure.resourcemanager.compute.models.SubResourceReadOnly; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; - -/** Properties of the dedicated host. */ -@Fluent -public final class DedicatedHostProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DedicatedHostProperties.class); - - /* - * Fault domain of the dedicated host within a dedicated host group. - */ - @JsonProperty(value = "platformFaultDomain") - private Integer platformFaultDomain; - - /* - * Specifies whether the dedicated host should be replaced automatically in - * case of a failure. The value is defaulted to 'true' when not provided. - */ - @JsonProperty(value = "autoReplaceOnFailure") - private Boolean autoReplaceOnFailure; - - /* - * A unique id generated and assigned to the dedicated host by the - * platform.

Does not change throughout the lifetime of the host. - */ - @JsonProperty(value = "hostId", access = JsonProperty.Access.WRITE_ONLY) - private String hostId; - - /* - * A list of references to all virtual machines in the Dedicated Host. - */ - @JsonProperty(value = "virtualMachines", access = JsonProperty.Access.WRITE_ONLY) - private List virtualMachines; - - /* - * Specifies the software license type that will be applied to the VMs - * deployed on the dedicated host.

Possible values are:

- * **None**

**Windows_Server_Hybrid**

- * **Windows_Server_Perpetual**

Default: **None** - */ - @JsonProperty(value = "licenseType") - private DedicatedHostLicenseTypes licenseType; - - /* - * The date when the host was first provisioned. - */ - @JsonProperty(value = "provisioningTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime provisioningTime; - - /* - * The provisioning state, which only appears in the response. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; - - /* - * The dedicated host instance view. - */ - @JsonProperty(value = "instanceView", access = JsonProperty.Access.WRITE_ONLY) - private DedicatedHostInstanceView instanceView; - - /** - * Get the platformFaultDomain property: Fault domain of the dedicated host within a dedicated host group. - * - * @return the platformFaultDomain value. - */ - public Integer platformFaultDomain() { - return this.platformFaultDomain; - } - - /** - * Set the platformFaultDomain property: Fault domain of the dedicated host within a dedicated host group. - * - * @param platformFaultDomain the platformFaultDomain value to set. - * @return the DedicatedHostProperties object itself. - */ - public DedicatedHostProperties withPlatformFaultDomain(Integer platformFaultDomain) { - this.platformFaultDomain = platformFaultDomain; - return this; - } - - /** - * Get the autoReplaceOnFailure property: Specifies whether the dedicated host should be replaced automatically in - * case of a failure. The value is defaulted to 'true' when not provided. - * - * @return the autoReplaceOnFailure value. - */ - public Boolean autoReplaceOnFailure() { - return this.autoReplaceOnFailure; - } - - /** - * Set the autoReplaceOnFailure property: Specifies whether the dedicated host should be replaced automatically in - * case of a failure. The value is defaulted to 'true' when not provided. - * - * @param autoReplaceOnFailure the autoReplaceOnFailure value to set. - * @return the DedicatedHostProperties object itself. - */ - public DedicatedHostProperties withAutoReplaceOnFailure(Boolean autoReplaceOnFailure) { - this.autoReplaceOnFailure = autoReplaceOnFailure; - return this; - } - - /** - * Get the hostId property: A unique id generated and assigned to the dedicated host by the platform. - * <br><br> Does not change throughout the lifetime of the host. - * - * @return the hostId value. - */ - public String hostId() { - return this.hostId; - } - - /** - * Get the virtualMachines property: A list of references to all virtual machines in the Dedicated Host. - * - * @return the virtualMachines value. - */ - public List virtualMachines() { - return this.virtualMachines; - } - - /** - * Get the licenseType property: Specifies the software license type that will be applied to the VMs deployed on the - * dedicated host. <br><br> Possible values are: <br><br> **None** <br><br> - * **Windows_Server_Hybrid** <br><br> **Windows_Server_Perpetual** <br><br> Default: - * **None**. - * - * @return the licenseType value. - */ - public DedicatedHostLicenseTypes licenseType() { - return this.licenseType; - } - - /** - * Set the licenseType property: Specifies the software license type that will be applied to the VMs deployed on the - * dedicated host. <br><br> Possible values are: <br><br> **None** <br><br> - * **Windows_Server_Hybrid** <br><br> **Windows_Server_Perpetual** <br><br> Default: - * **None**. - * - * @param licenseType the licenseType value to set. - * @return the DedicatedHostProperties object itself. - */ - public DedicatedHostProperties withLicenseType(DedicatedHostLicenseTypes licenseType) { - this.licenseType = licenseType; - return this; - } - - /** - * Get the provisioningTime property: The date when the host was first provisioned. - * - * @return the provisioningTime value. - */ - public OffsetDateTime provisioningTime() { - return this.provisioningTime; - } - - /** - * Get the provisioningState property: The provisioning state, which only appears in the response. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Get the instanceView property: The dedicated host instance view. - * - * @return the instanceView value. - */ - public DedicatedHostInstanceView instanceView() { - return this.instanceView; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (virtualMachines() != null) { - virtualMachines().forEach(e -> e.validate()); - } - if (instanceView() != null) { - instanceView().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/DiskEncryptionSetInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/DiskEncryptionSetInner.java deleted file mode 100644 index c2f53bd3b528..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/DiskEncryptionSetInner.java +++ /dev/null @@ -1,135 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.models.EncryptionSetIdentity; -import com.azure.resourcemanager.compute.models.KeyVaultAndKeyReference; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** disk encryption set resource. */ -@Fluent -public final class DiskEncryptionSetInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DiskEncryptionSetInner.class); - - /* - * The managed identity for the disk encryption set. It should be given - * permission on the key vault before it can be used to encrypt disks. - */ - @JsonProperty(value = "identity") - private EncryptionSetIdentity identity; - - /* - * The properties property. - */ - @JsonProperty(value = "properties") - private EncryptionSetProperties innerProperties; - - /** - * Get the identity property: The managed identity for the disk encryption set. It should be given permission on the - * key vault before it can be used to encrypt disks. - * - * @return the identity value. - */ - public EncryptionSetIdentity identity() { - return this.identity; - } - - /** - * Set the identity property: The managed identity for the disk encryption set. It should be given permission on the - * key vault before it can be used to encrypt disks. - * - * @param identity the identity value to set. - * @return the DiskEncryptionSetInner object itself. - */ - public DiskEncryptionSetInner withIdentity(EncryptionSetIdentity identity) { - this.identity = identity; - return this; - } - - /** - * Get the innerProperties property: The properties property. - * - * @return the innerProperties value. - */ - private EncryptionSetProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public DiskEncryptionSetInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public DiskEncryptionSetInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the activeKey property: The key vault key which is currently used by this disk encryption set. - * - * @return the activeKey value. - */ - public KeyVaultAndKeyReference activeKey() { - return this.innerProperties() == null ? null : this.innerProperties().activeKey(); - } - - /** - * Set the activeKey property: The key vault key which is currently used by this disk encryption set. - * - * @param activeKey the activeKey value to set. - * @return the DiskEncryptionSetInner object itself. - */ - public DiskEncryptionSetInner withActiveKey(KeyVaultAndKeyReference activeKey) { - if (this.innerProperties() == null) { - this.innerProperties = new EncryptionSetProperties(); - } - this.innerProperties().withActiveKey(activeKey); - return this; - } - - /** - * Get the previousKeys property: A readonly collection of key vault keys previously used by this disk encryption - * set while a key rotation is in progress. It will be empty if there is no ongoing key rotation. - * - * @return the previousKeys value. - */ - public List previousKeys() { - return this.innerProperties() == null ? null : this.innerProperties().previousKeys(); - } - - /** - * Get the provisioningState property: The disk encryption set provisioning state. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (identity() != null) { - identity().validate(); - } - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/DiskEncryptionSetUpdateProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/DiskEncryptionSetUpdateProperties.java deleted file mode 100644 index a5fe281da6e1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/DiskEncryptionSetUpdateProperties.java +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.models.KeyVaultAndKeyReference; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** disk encryption set resource update properties. */ -@Fluent -public final class DiskEncryptionSetUpdateProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DiskEncryptionSetUpdateProperties.class); - - /* - * Key Vault Key Url and vault id of KeK, KeK is optional and when provided - * is used to unwrap the encryptionKey - */ - @JsonProperty(value = "activeKey") - private KeyVaultAndKeyReference activeKey; - - /** - * Get the activeKey property: Key Vault Key Url and vault id of KeK, KeK is optional and when provided is used to - * unwrap the encryptionKey. - * - * @return the activeKey value. - */ - public KeyVaultAndKeyReference activeKey() { - return this.activeKey; - } - - /** - * Set the activeKey property: Key Vault Key Url and vault id of KeK, KeK is optional and when provided is used to - * unwrap the encryptionKey. - * - * @param activeKey the activeKey value to set. - * @return the DiskEncryptionSetUpdateProperties object itself. - */ - public DiskEncryptionSetUpdateProperties withActiveKey(KeyVaultAndKeyReference activeKey) { - this.activeKey = activeKey; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (activeKey() != null) { - activeKey().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/DiskInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/DiskInner.java deleted file mode 100644 index f85ad927d9ca..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/DiskInner.java +++ /dev/null @@ -1,383 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.models.CreationData; -import com.azure.resourcemanager.compute.models.DiskSku; -import com.azure.resourcemanager.compute.models.DiskState; -import com.azure.resourcemanager.compute.models.Encryption; -import com.azure.resourcemanager.compute.models.EncryptionSettingsCollection; -import com.azure.resourcemanager.compute.models.HyperVGeneration; -import com.azure.resourcemanager.compute.models.OperatingSystemTypes; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; -import java.util.Map; - -/** Disk resource. */ -@Fluent -public final class DiskInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DiskInner.class); - - /* - * A relative URI containing the ID of the VM that has the disk attached. - */ - @JsonProperty(value = "managedBy", access = JsonProperty.Access.WRITE_ONLY) - private String managedBy; - - /* - * The disks sku name. Can be Standard_LRS, Premium_LRS, StandardSSD_LRS, - * or UltraSSD_LRS. - */ - @JsonProperty(value = "sku") - private DiskSku sku; - - /* - * The Logical zone list for Disk. - */ - @JsonProperty(value = "zones") - private List zones; - - /* - * Disk resource properties. - */ - @JsonProperty(value = "properties") - private DiskProperties innerProperties; - - /** - * Get the managedBy property: A relative URI containing the ID of the VM that has the disk attached. - * - * @return the managedBy value. - */ - public String managedBy() { - return this.managedBy; - } - - /** - * Get the sku property: The disks sku name. Can be Standard_LRS, Premium_LRS, StandardSSD_LRS, or UltraSSD_LRS. - * - * @return the sku value. - */ - public DiskSku sku() { - return this.sku; - } - - /** - * Set the sku property: The disks sku name. Can be Standard_LRS, Premium_LRS, StandardSSD_LRS, or UltraSSD_LRS. - * - * @param sku the sku value to set. - * @return the DiskInner object itself. - */ - public DiskInner withSku(DiskSku sku) { - this.sku = sku; - return this; - } - - /** - * Get the zones property: The Logical zone list for Disk. - * - * @return the zones value. - */ - public List zones() { - return this.zones; - } - - /** - * Set the zones property: The Logical zone list for Disk. - * - * @param zones the zones value to set. - * @return the DiskInner object itself. - */ - public DiskInner withZones(List zones) { - this.zones = zones; - return this; - } - - /** - * Get the innerProperties property: Disk resource properties. - * - * @return the innerProperties value. - */ - private DiskProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public DiskInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public DiskInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the timeCreated property: The time when the disk was created. - * - * @return the timeCreated value. - */ - public OffsetDateTime timeCreated() { - return this.innerProperties() == null ? null : this.innerProperties().timeCreated(); - } - - /** - * Get the osType property: The Operating System type. - * - * @return the osType value. - */ - public OperatingSystemTypes osType() { - return this.innerProperties() == null ? null : this.innerProperties().osType(); - } - - /** - * Set the osType property: The Operating System type. - * - * @param osType the osType value to set. - * @return the DiskInner object itself. - */ - public DiskInner withOsType(OperatingSystemTypes osType) { - if (this.innerProperties() == null) { - this.innerProperties = new DiskProperties(); - } - this.innerProperties().withOsType(osType); - return this; - } - - /** - * Get the hyperVGeneration property: The hypervisor generation of the Virtual Machine. Applicable to OS disks only. - * - * @return the hyperVGeneration value. - */ - public HyperVGeneration hyperVGeneration() { - return this.innerProperties() == null ? null : this.innerProperties().hyperVGeneration(); - } - - /** - * Set the hyperVGeneration property: The hypervisor generation of the Virtual Machine. Applicable to OS disks only. - * - * @param hyperVGeneration the hyperVGeneration value to set. - * @return the DiskInner object itself. - */ - public DiskInner withHyperVGeneration(HyperVGeneration hyperVGeneration) { - if (this.innerProperties() == null) { - this.innerProperties = new DiskProperties(); - } - this.innerProperties().withHyperVGeneration(hyperVGeneration); - return this; - } - - /** - * Get the creationData property: Disk source information. CreationData information cannot be changed after the disk - * has been created. - * - * @return the creationData value. - */ - public CreationData creationData() { - return this.innerProperties() == null ? null : this.innerProperties().creationData(); - } - - /** - * Set the creationData property: Disk source information. CreationData information cannot be changed after the disk - * has been created. - * - * @param creationData the creationData value to set. - * @return the DiskInner object itself. - */ - public DiskInner withCreationData(CreationData creationData) { - if (this.innerProperties() == null) { - this.innerProperties = new DiskProperties(); - } - this.innerProperties().withCreationData(creationData); - return this; - } - - /** - * Get the diskSizeGB property: If creationData.createOption is Empty, this field is mandatory and it indicates the - * size of the disk to create. If this field is present for updates or creation with other options, it indicates a - * resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's - * size. - * - * @return the diskSizeGB value. - */ - public Integer diskSizeGB() { - return this.innerProperties() == null ? null : this.innerProperties().diskSizeGB(); - } - - /** - * Set the diskSizeGB property: If creationData.createOption is Empty, this field is mandatory and it indicates the - * size of the disk to create. If this field is present for updates or creation with other options, it indicates a - * resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's - * size. - * - * @param diskSizeGB the diskSizeGB value to set. - * @return the DiskInner object itself. - */ - public DiskInner withDiskSizeGB(Integer diskSizeGB) { - if (this.innerProperties() == null) { - this.innerProperties = new DiskProperties(); - } - this.innerProperties().withDiskSizeGB(diskSizeGB); - return this; - } - - /** - * Get the diskSizeBytes property: The size of the disk in bytes. This field is read only. - * - * @return the diskSizeBytes value. - */ - public Long diskSizeBytes() { - return this.innerProperties() == null ? null : this.innerProperties().diskSizeBytes(); - } - - /** - * Get the uniqueId property: Unique Guid identifying the resource. - * - * @return the uniqueId value. - */ - public String uniqueId() { - return this.innerProperties() == null ? null : this.innerProperties().uniqueId(); - } - - /** - * Get the encryptionSettingsCollection property: Encryption settings collection used for Azure Disk Encryption, can - * contain multiple encryption settings per disk or snapshot. - * - * @return the encryptionSettingsCollection value. - */ - public EncryptionSettingsCollection encryptionSettingsCollection() { - return this.innerProperties() == null ? null : this.innerProperties().encryptionSettingsCollection(); - } - - /** - * Set the encryptionSettingsCollection property: Encryption settings collection used for Azure Disk Encryption, can - * contain multiple encryption settings per disk or snapshot. - * - * @param encryptionSettingsCollection the encryptionSettingsCollection value to set. - * @return the DiskInner object itself. - */ - public DiskInner withEncryptionSettingsCollection(EncryptionSettingsCollection encryptionSettingsCollection) { - if (this.innerProperties() == null) { - this.innerProperties = new DiskProperties(); - } - this.innerProperties().withEncryptionSettingsCollection(encryptionSettingsCollection); - return this; - } - - /** - * Get the provisioningState property: The disk provisioning state. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the diskIopsReadWrite property: The number of IOPS allowed for this disk; only settable for UltraSSD disks. - * One operation can transfer between 4k and 256k bytes. - * - * @return the diskIopsReadWrite value. - */ - public Long diskIopsReadWrite() { - return this.innerProperties() == null ? null : this.innerProperties().diskIopsReadWrite(); - } - - /** - * Set the diskIopsReadWrite property: The number of IOPS allowed for this disk; only settable for UltraSSD disks. - * One operation can transfer between 4k and 256k bytes. - * - * @param diskIopsReadWrite the diskIopsReadWrite value to set. - * @return the DiskInner object itself. - */ - public DiskInner withDiskIopsReadWrite(Long diskIopsReadWrite) { - if (this.innerProperties() == null) { - this.innerProperties = new DiskProperties(); - } - this.innerProperties().withDiskIopsReadWrite(diskIopsReadWrite); - return this; - } - - /** - * Get the diskMBpsReadWrite property: The bandwidth allowed for this disk; only settable for UltraSSD disks. MBps - * means millions of bytes per second - MB here uses the ISO notation, of powers of 10. - * - * @return the diskMBpsReadWrite value. - */ - public Integer diskMBpsReadWrite() { - return this.innerProperties() == null ? null : this.innerProperties().diskMBpsReadWrite(); - } - - /** - * Set the diskMBpsReadWrite property: The bandwidth allowed for this disk; only settable for UltraSSD disks. MBps - * means millions of bytes per second - MB here uses the ISO notation, of powers of 10. - * - * @param diskMBpsReadWrite the diskMBpsReadWrite value to set. - * @return the DiskInner object itself. - */ - public DiskInner withDiskMBpsReadWrite(Integer diskMBpsReadWrite) { - if (this.innerProperties() == null) { - this.innerProperties = new DiskProperties(); - } - this.innerProperties().withDiskMBpsReadWrite(diskMBpsReadWrite); - return this; - } - - /** - * Get the diskState property: The state of the disk. - * - * @return the diskState value. - */ - public DiskState diskState() { - return this.innerProperties() == null ? null : this.innerProperties().diskState(); - } - - /** - * Get the encryption property: Encryption property can be used to encrypt data at rest with customer managed keys - * or platform managed keys. - * - * @return the encryption value. - */ - public Encryption encryption() { - return this.innerProperties() == null ? null : this.innerProperties().encryption(); - } - - /** - * Set the encryption property: Encryption property can be used to encrypt data at rest with customer managed keys - * or platform managed keys. - * - * @param encryption the encryption value to set. - * @return the DiskInner object itself. - */ - public DiskInner withEncryption(Encryption encryption) { - if (this.innerProperties() == null) { - this.innerProperties = new DiskProperties(); - } - this.innerProperties().withEncryption(encryption); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (sku() != null) { - sku().validate(); - } - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/DiskProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/DiskProperties.java deleted file mode 100644 index 2988d98c0488..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/DiskProperties.java +++ /dev/null @@ -1,354 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.models.CreationData; -import com.azure.resourcemanager.compute.models.DiskState; -import com.azure.resourcemanager.compute.models.Encryption; -import com.azure.resourcemanager.compute.models.EncryptionSettingsCollection; -import com.azure.resourcemanager.compute.models.HyperVGeneration; -import com.azure.resourcemanager.compute.models.OperatingSystemTypes; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** Disk resource properties. */ -@Fluent -public final class DiskProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DiskProperties.class); - - /* - * The time when the disk was created. - */ - @JsonProperty(value = "timeCreated", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime timeCreated; - - /* - * The Operating System type. - */ - @JsonProperty(value = "osType") - private OperatingSystemTypes osType; - - /* - * The hypervisor generation of the Virtual Machine. Applicable to OS disks - * only. - */ - @JsonProperty(value = "hyperVGeneration") - private HyperVGeneration hyperVGeneration; - - /* - * Disk source information. CreationData information cannot be changed - * after the disk has been created. - */ - @JsonProperty(value = "creationData", required = true) - private CreationData creationData; - - /* - * If creationData.createOption is Empty, this field is mandatory and it - * indicates the size of the disk to create. If this field is present for - * updates or creation with other options, it indicates a resize. Resizes - * are only allowed if the disk is not attached to a running VM, and can - * only increase the disk's size. - */ - @JsonProperty(value = "diskSizeGB") - private Integer diskSizeGB; - - /* - * The size of the disk in bytes. This field is read only. - */ - @JsonProperty(value = "diskSizeBytes", access = JsonProperty.Access.WRITE_ONLY) - private Long diskSizeBytes; - - /* - * Unique Guid identifying the resource. - */ - @JsonProperty(value = "uniqueId", access = JsonProperty.Access.WRITE_ONLY) - private String uniqueId; - - /* - * Encryption settings collection used for Azure Disk Encryption, can - * contain multiple encryption settings per disk or snapshot. - */ - @JsonProperty(value = "encryptionSettingsCollection") - private EncryptionSettingsCollection encryptionSettingsCollection; - - /* - * The disk provisioning state. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; - - /* - * The number of IOPS allowed for this disk; only settable for UltraSSD - * disks. One operation can transfer between 4k and 256k bytes. - */ - @JsonProperty(value = "diskIOPSReadWrite") - private Long diskIopsReadWrite; - - /* - * The bandwidth allowed for this disk; only settable for UltraSSD disks. - * MBps means millions of bytes per second - MB here uses the ISO notation, - * of powers of 10. - */ - @JsonProperty(value = "diskMBpsReadWrite") - private Integer diskMBpsReadWrite; - - /* - * The state of the disk. - */ - @JsonProperty(value = "diskState", access = JsonProperty.Access.WRITE_ONLY) - private DiskState diskState; - - /* - * Encryption property can be used to encrypt data at rest with customer - * managed keys or platform managed keys. - */ - @JsonProperty(value = "encryption") - private Encryption encryption; - - /** - * Get the timeCreated property: The time when the disk was created. - * - * @return the timeCreated value. - */ - public OffsetDateTime timeCreated() { - return this.timeCreated; - } - - /** - * Get the osType property: The Operating System type. - * - * @return the osType value. - */ - public OperatingSystemTypes osType() { - return this.osType; - } - - /** - * Set the osType property: The Operating System type. - * - * @param osType the osType value to set. - * @return the DiskProperties object itself. - */ - public DiskProperties withOsType(OperatingSystemTypes osType) { - this.osType = osType; - return this; - } - - /** - * Get the hyperVGeneration property: The hypervisor generation of the Virtual Machine. Applicable to OS disks only. - * - * @return the hyperVGeneration value. - */ - public HyperVGeneration hyperVGeneration() { - return this.hyperVGeneration; - } - - /** - * Set the hyperVGeneration property: The hypervisor generation of the Virtual Machine. Applicable to OS disks only. - * - * @param hyperVGeneration the hyperVGeneration value to set. - * @return the DiskProperties object itself. - */ - public DiskProperties withHyperVGeneration(HyperVGeneration hyperVGeneration) { - this.hyperVGeneration = hyperVGeneration; - return this; - } - - /** - * Get the creationData property: Disk source information. CreationData information cannot be changed after the disk - * has been created. - * - * @return the creationData value. - */ - public CreationData creationData() { - return this.creationData; - } - - /** - * Set the creationData property: Disk source information. CreationData information cannot be changed after the disk - * has been created. - * - * @param creationData the creationData value to set. - * @return the DiskProperties object itself. - */ - public DiskProperties withCreationData(CreationData creationData) { - this.creationData = creationData; - return this; - } - - /** - * Get the diskSizeGB property: If creationData.createOption is Empty, this field is mandatory and it indicates the - * size of the disk to create. If this field is present for updates or creation with other options, it indicates a - * resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's - * size. - * - * @return the diskSizeGB value. - */ - public Integer diskSizeGB() { - return this.diskSizeGB; - } - - /** - * Set the diskSizeGB property: If creationData.createOption is Empty, this field is mandatory and it indicates the - * size of the disk to create. If this field is present for updates or creation with other options, it indicates a - * resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's - * size. - * - * @param diskSizeGB the diskSizeGB value to set. - * @return the DiskProperties object itself. - */ - public DiskProperties withDiskSizeGB(Integer diskSizeGB) { - this.diskSizeGB = diskSizeGB; - return this; - } - - /** - * Get the diskSizeBytes property: The size of the disk in bytes. This field is read only. - * - * @return the diskSizeBytes value. - */ - public Long diskSizeBytes() { - return this.diskSizeBytes; - } - - /** - * Get the uniqueId property: Unique Guid identifying the resource. - * - * @return the uniqueId value. - */ - public String uniqueId() { - return this.uniqueId; - } - - /** - * Get the encryptionSettingsCollection property: Encryption settings collection used for Azure Disk Encryption, can - * contain multiple encryption settings per disk or snapshot. - * - * @return the encryptionSettingsCollection value. - */ - public EncryptionSettingsCollection encryptionSettingsCollection() { - return this.encryptionSettingsCollection; - } - - /** - * Set the encryptionSettingsCollection property: Encryption settings collection used for Azure Disk Encryption, can - * contain multiple encryption settings per disk or snapshot. - * - * @param encryptionSettingsCollection the encryptionSettingsCollection value to set. - * @return the DiskProperties object itself. - */ - public DiskProperties withEncryptionSettingsCollection(EncryptionSettingsCollection encryptionSettingsCollection) { - this.encryptionSettingsCollection = encryptionSettingsCollection; - return this; - } - - /** - * Get the provisioningState property: The disk provisioning state. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Get the diskIopsReadWrite property: The number of IOPS allowed for this disk; only settable for UltraSSD disks. - * One operation can transfer between 4k and 256k bytes. - * - * @return the diskIopsReadWrite value. - */ - public Long diskIopsReadWrite() { - return this.diskIopsReadWrite; - } - - /** - * Set the diskIopsReadWrite property: The number of IOPS allowed for this disk; only settable for UltraSSD disks. - * One operation can transfer between 4k and 256k bytes. - * - * @param diskIopsReadWrite the diskIopsReadWrite value to set. - * @return the DiskProperties object itself. - */ - public DiskProperties withDiskIopsReadWrite(Long diskIopsReadWrite) { - this.diskIopsReadWrite = diskIopsReadWrite; - return this; - } - - /** - * Get the diskMBpsReadWrite property: The bandwidth allowed for this disk; only settable for UltraSSD disks. MBps - * means millions of bytes per second - MB here uses the ISO notation, of powers of 10. - * - * @return the diskMBpsReadWrite value. - */ - public Integer diskMBpsReadWrite() { - return this.diskMBpsReadWrite; - } - - /** - * Set the diskMBpsReadWrite property: The bandwidth allowed for this disk; only settable for UltraSSD disks. MBps - * means millions of bytes per second - MB here uses the ISO notation, of powers of 10. - * - * @param diskMBpsReadWrite the diskMBpsReadWrite value to set. - * @return the DiskProperties object itself. - */ - public DiskProperties withDiskMBpsReadWrite(Integer diskMBpsReadWrite) { - this.diskMBpsReadWrite = diskMBpsReadWrite; - return this; - } - - /** - * Get the diskState property: The state of the disk. - * - * @return the diskState value. - */ - public DiskState diskState() { - return this.diskState; - } - - /** - * Get the encryption property: Encryption property can be used to encrypt data at rest with customer managed keys - * or platform managed keys. - * - * @return the encryption value. - */ - public Encryption encryption() { - return this.encryption; - } - - /** - * Set the encryption property: Encryption property can be used to encrypt data at rest with customer managed keys - * or platform managed keys. - * - * @param encryption the encryption value to set. - * @return the DiskProperties object itself. - */ - public DiskProperties withEncryption(Encryption encryption) { - this.encryption = encryption; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (creationData() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property creationData in model DiskProperties")); - } else { - creationData().validate(); - } - if (encryptionSettingsCollection() != null) { - encryptionSettingsCollection().validate(); - } - if (encryption() != null) { - encryption().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/DiskUpdateProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/DiskUpdateProperties.java deleted file mode 100644 index 01452d8c8362..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/DiskUpdateProperties.java +++ /dev/null @@ -1,213 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.models.Encryption; -import com.azure.resourcemanager.compute.models.EncryptionSettingsCollection; -import com.azure.resourcemanager.compute.models.OperatingSystemTypes; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Disk resource update properties. */ -@Fluent -public final class DiskUpdateProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DiskUpdateProperties.class); - - /* - * the Operating System type. - */ - @JsonProperty(value = "osType") - private OperatingSystemTypes osType; - - /* - * If creationData.createOption is Empty, this field is mandatory and it - * indicates the size of the disk to create. If this field is present for - * updates or creation with other options, it indicates a resize. Resizes - * are only allowed if the disk is not attached to a running VM, and can - * only increase the disk's size. - */ - @JsonProperty(value = "diskSizeGB") - private Integer diskSizeGB; - - /* - * Encryption settings collection used be Azure Disk Encryption, can - * contain multiple encryption settings per disk or snapshot. - */ - @JsonProperty(value = "encryptionSettingsCollection") - private EncryptionSettingsCollection encryptionSettingsCollection; - - /* - * The number of IOPS allowed for this disk; only settable for UltraSSD - * disks. One operation can transfer between 4k and 256k bytes. - */ - @JsonProperty(value = "diskIOPSReadWrite") - private Long diskIopsReadWrite; - - /* - * The bandwidth allowed for this disk; only settable for UltraSSD disks. - * MBps means millions of bytes per second - MB here uses the ISO notation, - * of powers of 10. - */ - @JsonProperty(value = "diskMBpsReadWrite") - private Integer diskMBpsReadWrite; - - /* - * Encryption property can be used to encrypt data at rest with customer - * managed keys or platform managed keys. - */ - @JsonProperty(value = "encryption") - private Encryption encryption; - - /** - * Get the osType property: the Operating System type. - * - * @return the osType value. - */ - public OperatingSystemTypes osType() { - return this.osType; - } - - /** - * Set the osType property: the Operating System type. - * - * @param osType the osType value to set. - * @return the DiskUpdateProperties object itself. - */ - public DiskUpdateProperties withOsType(OperatingSystemTypes osType) { - this.osType = osType; - return this; - } - - /** - * Get the diskSizeGB property: If creationData.createOption is Empty, this field is mandatory and it indicates the - * size of the disk to create. If this field is present for updates or creation with other options, it indicates a - * resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's - * size. - * - * @return the diskSizeGB value. - */ - public Integer diskSizeGB() { - return this.diskSizeGB; - } - - /** - * Set the diskSizeGB property: If creationData.createOption is Empty, this field is mandatory and it indicates the - * size of the disk to create. If this field is present for updates or creation with other options, it indicates a - * resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's - * size. - * - * @param diskSizeGB the diskSizeGB value to set. - * @return the DiskUpdateProperties object itself. - */ - public DiskUpdateProperties withDiskSizeGB(Integer diskSizeGB) { - this.diskSizeGB = diskSizeGB; - return this; - } - - /** - * Get the encryptionSettingsCollection property: Encryption settings collection used be Azure Disk Encryption, can - * contain multiple encryption settings per disk or snapshot. - * - * @return the encryptionSettingsCollection value. - */ - public EncryptionSettingsCollection encryptionSettingsCollection() { - return this.encryptionSettingsCollection; - } - - /** - * Set the encryptionSettingsCollection property: Encryption settings collection used be Azure Disk Encryption, can - * contain multiple encryption settings per disk or snapshot. - * - * @param encryptionSettingsCollection the encryptionSettingsCollection value to set. - * @return the DiskUpdateProperties object itself. - */ - public DiskUpdateProperties withEncryptionSettingsCollection( - EncryptionSettingsCollection encryptionSettingsCollection) { - this.encryptionSettingsCollection = encryptionSettingsCollection; - return this; - } - - /** - * Get the diskIopsReadWrite property: The number of IOPS allowed for this disk; only settable for UltraSSD disks. - * One operation can transfer between 4k and 256k bytes. - * - * @return the diskIopsReadWrite value. - */ - public Long diskIopsReadWrite() { - return this.diskIopsReadWrite; - } - - /** - * Set the diskIopsReadWrite property: The number of IOPS allowed for this disk; only settable for UltraSSD disks. - * One operation can transfer between 4k and 256k bytes. - * - * @param diskIopsReadWrite the diskIopsReadWrite value to set. - * @return the DiskUpdateProperties object itself. - */ - public DiskUpdateProperties withDiskIopsReadWrite(Long diskIopsReadWrite) { - this.diskIopsReadWrite = diskIopsReadWrite; - return this; - } - - /** - * Get the diskMBpsReadWrite property: The bandwidth allowed for this disk; only settable for UltraSSD disks. MBps - * means millions of bytes per second - MB here uses the ISO notation, of powers of 10. - * - * @return the diskMBpsReadWrite value. - */ - public Integer diskMBpsReadWrite() { - return this.diskMBpsReadWrite; - } - - /** - * Set the diskMBpsReadWrite property: The bandwidth allowed for this disk; only settable for UltraSSD disks. MBps - * means millions of bytes per second - MB here uses the ISO notation, of powers of 10. - * - * @param diskMBpsReadWrite the diskMBpsReadWrite value to set. - * @return the DiskUpdateProperties object itself. - */ - public DiskUpdateProperties withDiskMBpsReadWrite(Integer diskMBpsReadWrite) { - this.diskMBpsReadWrite = diskMBpsReadWrite; - return this; - } - - /** - * Get the encryption property: Encryption property can be used to encrypt data at rest with customer managed keys - * or platform managed keys. - * - * @return the encryption value. - */ - public Encryption encryption() { - return this.encryption; - } - - /** - * Set the encryption property: Encryption property can be used to encrypt data at rest with customer managed keys - * or platform managed keys. - * - * @param encryption the encryption value to set. - * @return the DiskUpdateProperties object itself. - */ - public DiskUpdateProperties withEncryption(Encryption encryption) { - this.encryption = encryption; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (encryptionSettingsCollection() != null) { - encryptionSettingsCollection().validate(); - } - if (encryption() != null) { - encryption().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/EncryptionSetProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/EncryptionSetProperties.java deleted file mode 100644 index 8fadcba408c1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/EncryptionSetProperties.java +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.models.KeyVaultAndKeyReference; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The EncryptionSetProperties model. */ -@Fluent -public final class EncryptionSetProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(EncryptionSetProperties.class); - - /* - * The key vault key which is currently used by this disk encryption set. - */ - @JsonProperty(value = "activeKey") - private KeyVaultAndKeyReference activeKey; - - /* - * A readonly collection of key vault keys previously used by this disk - * encryption set while a key rotation is in progress. It will be empty if - * there is no ongoing key rotation. - */ - @JsonProperty(value = "previousKeys", access = JsonProperty.Access.WRITE_ONLY) - private List previousKeys; - - /* - * The disk encryption set provisioning state. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; - - /** - * Get the activeKey property: The key vault key which is currently used by this disk encryption set. - * - * @return the activeKey value. - */ - public KeyVaultAndKeyReference activeKey() { - return this.activeKey; - } - - /** - * Set the activeKey property: The key vault key which is currently used by this disk encryption set. - * - * @param activeKey the activeKey value to set. - * @return the EncryptionSetProperties object itself. - */ - public EncryptionSetProperties withActiveKey(KeyVaultAndKeyReference activeKey) { - this.activeKey = activeKey; - return this; - } - - /** - * Get the previousKeys property: A readonly collection of key vault keys previously used by this disk encryption - * set while a key rotation is in progress. It will be empty if there is no ongoing key rotation. - * - * @return the previousKeys value. - */ - public List previousKeys() { - return this.previousKeys; - } - - /** - * Get the provisioningState property: The disk encryption set provisioning state. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (activeKey() != null) { - activeKey().validate(); - } - if (previousKeys() != null) { - previousKeys().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/GalleryApplicationInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/GalleryApplicationInner.java deleted file mode 100644 index eab94736051e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/GalleryApplicationInner.java +++ /dev/null @@ -1,206 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.models.OperatingSystemTypes; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.Map; - -/** Specifies information about the gallery Application Definition that you want to create or update. */ -@Fluent -public final class GalleryApplicationInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(GalleryApplicationInner.class); - - /* - * Describes the properties of a gallery Application Definition. - */ - @JsonProperty(value = "properties") - private GalleryApplicationProperties innerProperties; - - /** - * Get the innerProperties property: Describes the properties of a gallery Application Definition. - * - * @return the innerProperties value. - */ - private GalleryApplicationProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public GalleryApplicationInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public GalleryApplicationInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the description property: The description of this gallery Application Definition resource. This property is - * updatable. - * - * @return the description value. - */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); - } - - /** - * Set the description property: The description of this gallery Application Definition resource. This property is - * updatable. - * - * @param description the description value to set. - * @return the GalleryApplicationInner object itself. - */ - public GalleryApplicationInner withDescription(String description) { - if (this.innerProperties() == null) { - this.innerProperties = new GalleryApplicationProperties(); - } - this.innerProperties().withDescription(description); - return this; - } - - /** - * Get the eula property: The Eula agreement for the gallery Application Definition. - * - * @return the eula value. - */ - public String eula() { - return this.innerProperties() == null ? null : this.innerProperties().eula(); - } - - /** - * Set the eula property: The Eula agreement for the gallery Application Definition. - * - * @param eula the eula value to set. - * @return the GalleryApplicationInner object itself. - */ - public GalleryApplicationInner withEula(String eula) { - if (this.innerProperties() == null) { - this.innerProperties = new GalleryApplicationProperties(); - } - this.innerProperties().withEula(eula); - return this; - } - - /** - * Get the privacyStatementUri property: The privacy statement uri. - * - * @return the privacyStatementUri value. - */ - public String privacyStatementUri() { - return this.innerProperties() == null ? null : this.innerProperties().privacyStatementUri(); - } - - /** - * Set the privacyStatementUri property: The privacy statement uri. - * - * @param privacyStatementUri the privacyStatementUri value to set. - * @return the GalleryApplicationInner object itself. - */ - public GalleryApplicationInner withPrivacyStatementUri(String privacyStatementUri) { - if (this.innerProperties() == null) { - this.innerProperties = new GalleryApplicationProperties(); - } - this.innerProperties().withPrivacyStatementUri(privacyStatementUri); - return this; - } - - /** - * Get the releaseNoteUri property: The release note uri. - * - * @return the releaseNoteUri value. - */ - public String releaseNoteUri() { - return this.innerProperties() == null ? null : this.innerProperties().releaseNoteUri(); - } - - /** - * Set the releaseNoteUri property: The release note uri. - * - * @param releaseNoteUri the releaseNoteUri value to set. - * @return the GalleryApplicationInner object itself. - */ - public GalleryApplicationInner withReleaseNoteUri(String releaseNoteUri) { - if (this.innerProperties() == null) { - this.innerProperties = new GalleryApplicationProperties(); - } - this.innerProperties().withReleaseNoteUri(releaseNoteUri); - return this; - } - - /** - * Get the endOfLifeDate property: The end of life date of the gallery Application Definition. This property can be - * used for decommissioning purposes. This property is updatable. - * - * @return the endOfLifeDate value. - */ - public OffsetDateTime endOfLifeDate() { - return this.innerProperties() == null ? null : this.innerProperties().endOfLifeDate(); - } - - /** - * Set the endOfLifeDate property: The end of life date of the gallery Application Definition. This property can be - * used for decommissioning purposes. This property is updatable. - * - * @param endOfLifeDate the endOfLifeDate value to set. - * @return the GalleryApplicationInner object itself. - */ - public GalleryApplicationInner withEndOfLifeDate(OffsetDateTime endOfLifeDate) { - if (this.innerProperties() == null) { - this.innerProperties = new GalleryApplicationProperties(); - } - this.innerProperties().withEndOfLifeDate(endOfLifeDate); - return this; - } - - /** - * Get the supportedOSType property: This property allows you to specify the supported type of the OS that - * application is built for. <br><br> Possible values are: <br><br> **Windows** - * <br><br> **Linux**. - * - * @return the supportedOSType value. - */ - public OperatingSystemTypes supportedOSType() { - return this.innerProperties() == null ? null : this.innerProperties().supportedOSType(); - } - - /** - * Set the supportedOSType property: This property allows you to specify the supported type of the OS that - * application is built for. <br><br> Possible values are: <br><br> **Windows** - * <br><br> **Linux**. - * - * @param supportedOSType the supportedOSType value to set. - * @return the GalleryApplicationInner object itself. - */ - public GalleryApplicationInner withSupportedOSType(OperatingSystemTypes supportedOSType) { - if (this.innerProperties() == null) { - this.innerProperties = new GalleryApplicationProperties(); - } - this.innerProperties().withSupportedOSType(supportedOSType); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/GalleryApplicationProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/GalleryApplicationProperties.java deleted file mode 100644 index 9d654f876c6a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/GalleryApplicationProperties.java +++ /dev/null @@ -1,201 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.models.OperatingSystemTypes; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** Describes the properties of a gallery Application Definition. */ -@Fluent -public final class GalleryApplicationProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(GalleryApplicationProperties.class); - - /* - * The description of this gallery Application Definition resource. This - * property is updatable. - */ - @JsonProperty(value = "description") - private String description; - - /* - * The Eula agreement for the gallery Application Definition. - */ - @JsonProperty(value = "eula") - private String eula; - - /* - * The privacy statement uri. - */ - @JsonProperty(value = "privacyStatementUri") - private String privacyStatementUri; - - /* - * The release note uri. - */ - @JsonProperty(value = "releaseNoteUri") - private String releaseNoteUri; - - /* - * The end of life date of the gallery Application Definition. This - * property can be used for decommissioning purposes. This property is - * updatable. - */ - @JsonProperty(value = "endOfLifeDate") - private OffsetDateTime endOfLifeDate; - - /* - * This property allows you to specify the supported type of the OS that - * application is built for.

Possible values are:

- * **Windows**

**Linux** - */ - @JsonProperty(value = "supportedOSType", required = true) - private OperatingSystemTypes supportedOSType; - - /** - * Get the description property: The description of this gallery Application Definition resource. This property is - * updatable. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: The description of this gallery Application Definition resource. This property is - * updatable. - * - * @param description the description value to set. - * @return the GalleryApplicationProperties object itself. - */ - public GalleryApplicationProperties withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the eula property: The Eula agreement for the gallery Application Definition. - * - * @return the eula value. - */ - public String eula() { - return this.eula; - } - - /** - * Set the eula property: The Eula agreement for the gallery Application Definition. - * - * @param eula the eula value to set. - * @return the GalleryApplicationProperties object itself. - */ - public GalleryApplicationProperties withEula(String eula) { - this.eula = eula; - return this; - } - - /** - * Get the privacyStatementUri property: The privacy statement uri. - * - * @return the privacyStatementUri value. - */ - public String privacyStatementUri() { - return this.privacyStatementUri; - } - - /** - * Set the privacyStatementUri property: The privacy statement uri. - * - * @param privacyStatementUri the privacyStatementUri value to set. - * @return the GalleryApplicationProperties object itself. - */ - public GalleryApplicationProperties withPrivacyStatementUri(String privacyStatementUri) { - this.privacyStatementUri = privacyStatementUri; - return this; - } - - /** - * Get the releaseNoteUri property: The release note uri. - * - * @return the releaseNoteUri value. - */ - public String releaseNoteUri() { - return this.releaseNoteUri; - } - - /** - * Set the releaseNoteUri property: The release note uri. - * - * @param releaseNoteUri the releaseNoteUri value to set. - * @return the GalleryApplicationProperties object itself. - */ - public GalleryApplicationProperties withReleaseNoteUri(String releaseNoteUri) { - this.releaseNoteUri = releaseNoteUri; - return this; - } - - /** - * Get the endOfLifeDate property: The end of life date of the gallery Application Definition. This property can be - * used for decommissioning purposes. This property is updatable. - * - * @return the endOfLifeDate value. - */ - public OffsetDateTime endOfLifeDate() { - return this.endOfLifeDate; - } - - /** - * Set the endOfLifeDate property: The end of life date of the gallery Application Definition. This property can be - * used for decommissioning purposes. This property is updatable. - * - * @param endOfLifeDate the endOfLifeDate value to set. - * @return the GalleryApplicationProperties object itself. - */ - public GalleryApplicationProperties withEndOfLifeDate(OffsetDateTime endOfLifeDate) { - this.endOfLifeDate = endOfLifeDate; - return this; - } - - /** - * Get the supportedOSType property: This property allows you to specify the supported type of the OS that - * application is built for. <br><br> Possible values are: <br><br> **Windows** - * <br><br> **Linux**. - * - * @return the supportedOSType value. - */ - public OperatingSystemTypes supportedOSType() { - return this.supportedOSType; - } - - /** - * Set the supportedOSType property: This property allows you to specify the supported type of the OS that - * application is built for. <br><br> Possible values are: <br><br> **Windows** - * <br><br> **Linux**. - * - * @param supportedOSType the supportedOSType value to set. - * @return the GalleryApplicationProperties object itself. - */ - public GalleryApplicationProperties withSupportedOSType(OperatingSystemTypes supportedOSType) { - this.supportedOSType = supportedOSType; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (supportedOSType() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property supportedOSType in model GalleryApplicationProperties")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/GalleryApplicationVersionInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/GalleryApplicationVersionInner.java deleted file mode 100644 index 3578f925f2ab..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/GalleryApplicationVersionInner.java +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.models.GalleryApplicationVersionPropertiesProvisioningState; -import com.azure.resourcemanager.compute.models.GalleryApplicationVersionPublishingProfile; -import com.azure.resourcemanager.compute.models.ReplicationStatus; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** Specifies information about the gallery Application Version that you want to create or update. */ -@Fluent -public final class GalleryApplicationVersionInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(GalleryApplicationVersionInner.class); - - /* - * Describes the properties of a gallery Image Version. - */ - @JsonProperty(value = "properties") - private GalleryApplicationVersionProperties innerProperties; - - /** - * Get the innerProperties property: Describes the properties of a gallery Image Version. - * - * @return the innerProperties value. - */ - private GalleryApplicationVersionProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public GalleryApplicationVersionInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public GalleryApplicationVersionInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the publishingProfile property: The publishing profile of a gallery image version. - * - * @return the publishingProfile value. - */ - public GalleryApplicationVersionPublishingProfile publishingProfile() { - return this.innerProperties() == null ? null : this.innerProperties().publishingProfile(); - } - - /** - * Set the publishingProfile property: The publishing profile of a gallery image version. - * - * @param publishingProfile the publishingProfile value to set. - * @return the GalleryApplicationVersionInner object itself. - */ - public GalleryApplicationVersionInner withPublishingProfile( - GalleryApplicationVersionPublishingProfile publishingProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new GalleryApplicationVersionProperties(); - } - this.innerProperties().withPublishingProfile(publishingProfile); - return this; - } - - /** - * Get the provisioningState property: The current state of the gallery Application Version. The provisioning state, - * which only appears in the response. - * - * @return the provisioningState value. - */ - public GalleryApplicationVersionPropertiesProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the replicationStatus property: This is the replication status of the gallery Image Version. - * - * @return the replicationStatus value. - */ - public ReplicationStatus replicationStatus() { - return this.innerProperties() == null ? null : this.innerProperties().replicationStatus(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/GalleryApplicationVersionProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/GalleryApplicationVersionProperties.java deleted file mode 100644 index 4eea376f9c69..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/GalleryApplicationVersionProperties.java +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.models.GalleryApplicationVersionPropertiesProvisioningState; -import com.azure.resourcemanager.compute.models.GalleryApplicationVersionPublishingProfile; -import com.azure.resourcemanager.compute.models.ReplicationStatus; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describes the properties of a gallery Image Version. */ -@Fluent -public final class GalleryApplicationVersionProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(GalleryApplicationVersionProperties.class); - - /* - * The publishing profile of a gallery image version. - */ - @JsonProperty(value = "publishingProfile", required = true) - private GalleryApplicationVersionPublishingProfile publishingProfile; - - /* - * The current state of the gallery Application Version. The provisioning - * state, which only appears in the response. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private GalleryApplicationVersionPropertiesProvisioningState provisioningState; - - /* - * This is the replication status of the gallery Image Version. - */ - @JsonProperty(value = "replicationStatus", access = JsonProperty.Access.WRITE_ONLY) - private ReplicationStatus replicationStatus; - - /** - * Get the publishingProfile property: The publishing profile of a gallery image version. - * - * @return the publishingProfile value. - */ - public GalleryApplicationVersionPublishingProfile publishingProfile() { - return this.publishingProfile; - } - - /** - * Set the publishingProfile property: The publishing profile of a gallery image version. - * - * @param publishingProfile the publishingProfile value to set. - * @return the GalleryApplicationVersionProperties object itself. - */ - public GalleryApplicationVersionProperties withPublishingProfile( - GalleryApplicationVersionPublishingProfile publishingProfile) { - this.publishingProfile = publishingProfile; - return this; - } - - /** - * Get the provisioningState property: The current state of the gallery Application Version. The provisioning state, - * which only appears in the response. - * - * @return the provisioningState value. - */ - public GalleryApplicationVersionPropertiesProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Get the replicationStatus property: This is the replication status of the gallery Image Version. - * - * @return the replicationStatus value. - */ - public ReplicationStatus replicationStatus() { - return this.replicationStatus; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (publishingProfile() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property publishingProfile in model GalleryApplicationVersionProperties")); - } else { - publishingProfile().validate(); - } - if (replicationStatus() != null) { - replicationStatus().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/GalleryImageInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/GalleryImageInner.java deleted file mode 100644 index 82020979c9cc..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/GalleryImageInner.java +++ /dev/null @@ -1,367 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.models.Disallowed; -import com.azure.resourcemanager.compute.models.GalleryImageIdentifier; -import com.azure.resourcemanager.compute.models.GalleryImagePropertiesProvisioningState; -import com.azure.resourcemanager.compute.models.HyperVGeneration; -import com.azure.resourcemanager.compute.models.ImagePurchasePlan; -import com.azure.resourcemanager.compute.models.OperatingSystemStateTypes; -import com.azure.resourcemanager.compute.models.OperatingSystemTypes; -import com.azure.resourcemanager.compute.models.RecommendedMachineConfiguration; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.Map; - -/** Specifies information about the gallery Image Definition that you want to create or update. */ -@Fluent -public final class GalleryImageInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(GalleryImageInner.class); - - /* - * Describes the properties of a gallery Image Definition. - */ - @JsonProperty(value = "properties") - private GalleryImageProperties innerProperties; - - /** - * Get the innerProperties property: Describes the properties of a gallery Image Definition. - * - * @return the innerProperties value. - */ - private GalleryImageProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public GalleryImageInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public GalleryImageInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the description property: The description of this gallery Image Definition resource. This property is - * updatable. - * - * @return the description value. - */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); - } - - /** - * Set the description property: The description of this gallery Image Definition resource. This property is - * updatable. - * - * @param description the description value to set. - * @return the GalleryImageInner object itself. - */ - public GalleryImageInner withDescription(String description) { - if (this.innerProperties() == null) { - this.innerProperties = new GalleryImageProperties(); - } - this.innerProperties().withDescription(description); - return this; - } - - /** - * Get the eula property: The Eula agreement for the gallery Image Definition. - * - * @return the eula value. - */ - public String eula() { - return this.innerProperties() == null ? null : this.innerProperties().eula(); - } - - /** - * Set the eula property: The Eula agreement for the gallery Image Definition. - * - * @param eula the eula value to set. - * @return the GalleryImageInner object itself. - */ - public GalleryImageInner withEula(String eula) { - if (this.innerProperties() == null) { - this.innerProperties = new GalleryImageProperties(); - } - this.innerProperties().withEula(eula); - return this; - } - - /** - * Get the privacyStatementUri property: The privacy statement uri. - * - * @return the privacyStatementUri value. - */ - public String privacyStatementUri() { - return this.innerProperties() == null ? null : this.innerProperties().privacyStatementUri(); - } - - /** - * Set the privacyStatementUri property: The privacy statement uri. - * - * @param privacyStatementUri the privacyStatementUri value to set. - * @return the GalleryImageInner object itself. - */ - public GalleryImageInner withPrivacyStatementUri(String privacyStatementUri) { - if (this.innerProperties() == null) { - this.innerProperties = new GalleryImageProperties(); - } - this.innerProperties().withPrivacyStatementUri(privacyStatementUri); - return this; - } - - /** - * Get the releaseNoteUri property: The release note uri. - * - * @return the releaseNoteUri value. - */ - public String releaseNoteUri() { - return this.innerProperties() == null ? null : this.innerProperties().releaseNoteUri(); - } - - /** - * Set the releaseNoteUri property: The release note uri. - * - * @param releaseNoteUri the releaseNoteUri value to set. - * @return the GalleryImageInner object itself. - */ - public GalleryImageInner withReleaseNoteUri(String releaseNoteUri) { - if (this.innerProperties() == null) { - this.innerProperties = new GalleryImageProperties(); - } - this.innerProperties().withReleaseNoteUri(releaseNoteUri); - return this; - } - - /** - * Get the osType property: This property allows you to specify the type of the OS that is included in the disk when - * creating a VM from a managed image. <br><br> Possible values are: <br><br> **Windows** - * <br><br> **Linux**. - * - * @return the osType value. - */ - public OperatingSystemTypes osType() { - return this.innerProperties() == null ? null : this.innerProperties().osType(); - } - - /** - * Set the osType property: This property allows you to specify the type of the OS that is included in the disk when - * creating a VM from a managed image. <br><br> Possible values are: <br><br> **Windows** - * <br><br> **Linux**. - * - * @param osType the osType value to set. - * @return the GalleryImageInner object itself. - */ - public GalleryImageInner withOsType(OperatingSystemTypes osType) { - if (this.innerProperties() == null) { - this.innerProperties = new GalleryImageProperties(); - } - this.innerProperties().withOsType(osType); - return this; - } - - /** - * Get the osState property: This property allows the user to specify whether the virtual machines created under - * this image are 'Generalized' or 'Specialized'. - * - * @return the osState value. - */ - public OperatingSystemStateTypes osState() { - return this.innerProperties() == null ? null : this.innerProperties().osState(); - } - - /** - * Set the osState property: This property allows the user to specify whether the virtual machines created under - * this image are 'Generalized' or 'Specialized'. - * - * @param osState the osState value to set. - * @return the GalleryImageInner object itself. - */ - public GalleryImageInner withOsState(OperatingSystemStateTypes osState) { - if (this.innerProperties() == null) { - this.innerProperties = new GalleryImageProperties(); - } - this.innerProperties().withOsState(osState); - return this; - } - - /** - * Get the hyperVGeneration property: The hypervisor generation of the Virtual Machine. Applicable to OS disks only. - * - * @return the hyperVGeneration value. - */ - public HyperVGeneration hyperVGeneration() { - return this.innerProperties() == null ? null : this.innerProperties().hyperVGeneration(); - } - - /** - * Set the hyperVGeneration property: The hypervisor generation of the Virtual Machine. Applicable to OS disks only. - * - * @param hyperVGeneration the hyperVGeneration value to set. - * @return the GalleryImageInner object itself. - */ - public GalleryImageInner withHyperVGeneration(HyperVGeneration hyperVGeneration) { - if (this.innerProperties() == null) { - this.innerProperties = new GalleryImageProperties(); - } - this.innerProperties().withHyperVGeneration(hyperVGeneration); - return this; - } - - /** - * Get the endOfLifeDate property: The end of life date of the gallery Image Definition. This property can be used - * for decommissioning purposes. This property is updatable. - * - * @return the endOfLifeDate value. - */ - public OffsetDateTime endOfLifeDate() { - return this.innerProperties() == null ? null : this.innerProperties().endOfLifeDate(); - } - - /** - * Set the endOfLifeDate property: The end of life date of the gallery Image Definition. This property can be used - * for decommissioning purposes. This property is updatable. - * - * @param endOfLifeDate the endOfLifeDate value to set. - * @return the GalleryImageInner object itself. - */ - public GalleryImageInner withEndOfLifeDate(OffsetDateTime endOfLifeDate) { - if (this.innerProperties() == null) { - this.innerProperties = new GalleryImageProperties(); - } - this.innerProperties().withEndOfLifeDate(endOfLifeDate); - return this; - } - - /** - * Get the identifier property: This is the gallery Image Definition identifier. - * - * @return the identifier value. - */ - public GalleryImageIdentifier identifier() { - return this.innerProperties() == null ? null : this.innerProperties().identifier(); - } - - /** - * Set the identifier property: This is the gallery Image Definition identifier. - * - * @param identifier the identifier value to set. - * @return the GalleryImageInner object itself. - */ - public GalleryImageInner withIdentifier(GalleryImageIdentifier identifier) { - if (this.innerProperties() == null) { - this.innerProperties = new GalleryImageProperties(); - } - this.innerProperties().withIdentifier(identifier); - return this; - } - - /** - * Get the recommended property: The properties describe the recommended machine configuration for this Image - * Definition. These properties are updatable. - * - * @return the recommended value. - */ - public RecommendedMachineConfiguration recommended() { - return this.innerProperties() == null ? null : this.innerProperties().recommended(); - } - - /** - * Set the recommended property: The properties describe the recommended machine configuration for this Image - * Definition. These properties are updatable. - * - * @param recommended the recommended value to set. - * @return the GalleryImageInner object itself. - */ - public GalleryImageInner withRecommended(RecommendedMachineConfiguration recommended) { - if (this.innerProperties() == null) { - this.innerProperties = new GalleryImageProperties(); - } - this.innerProperties().withRecommended(recommended); - return this; - } - - /** - * Get the disallowed property: Describes the disallowed disk types. - * - * @return the disallowed value. - */ - public Disallowed disallowed() { - return this.innerProperties() == null ? null : this.innerProperties().disallowed(); - } - - /** - * Set the disallowed property: Describes the disallowed disk types. - * - * @param disallowed the disallowed value to set. - * @return the GalleryImageInner object itself. - */ - public GalleryImageInner withDisallowed(Disallowed disallowed) { - if (this.innerProperties() == null) { - this.innerProperties = new GalleryImageProperties(); - } - this.innerProperties().withDisallowed(disallowed); - return this; - } - - /** - * Get the purchasePlan property: Describes the gallery Image Definition purchase plan. This is used by marketplace - * images. - * - * @return the purchasePlan value. - */ - public ImagePurchasePlan purchasePlan() { - return this.innerProperties() == null ? null : this.innerProperties().purchasePlan(); - } - - /** - * Set the purchasePlan property: Describes the gallery Image Definition purchase plan. This is used by marketplace - * images. - * - * @param purchasePlan the purchasePlan value to set. - * @return the GalleryImageInner object itself. - */ - public GalleryImageInner withPurchasePlan(ImagePurchasePlan purchasePlan) { - if (this.innerProperties() == null) { - this.innerProperties = new GalleryImageProperties(); - } - this.innerProperties().withPurchasePlan(purchasePlan); - return this; - } - - /** - * Get the provisioningState property: The current state of the gallery Image Definition. The provisioning state, - * which only appears in the response. - * - * @return the provisioningState value. - */ - public GalleryImagePropertiesProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/GalleryImageProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/GalleryImageProperties.java deleted file mode 100644 index cc50d19380a6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/GalleryImageProperties.java +++ /dev/null @@ -1,411 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.models.Disallowed; -import com.azure.resourcemanager.compute.models.GalleryImageIdentifier; -import com.azure.resourcemanager.compute.models.GalleryImagePropertiesProvisioningState; -import com.azure.resourcemanager.compute.models.HyperVGeneration; -import com.azure.resourcemanager.compute.models.ImagePurchasePlan; -import com.azure.resourcemanager.compute.models.OperatingSystemStateTypes; -import com.azure.resourcemanager.compute.models.OperatingSystemTypes; -import com.azure.resourcemanager.compute.models.RecommendedMachineConfiguration; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** Describes the properties of a gallery Image Definition. */ -@Fluent -public final class GalleryImageProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(GalleryImageProperties.class); - - /* - * The description of this gallery Image Definition resource. This property - * is updatable. - */ - @JsonProperty(value = "description") - private String description; - - /* - * The Eula agreement for the gallery Image Definition. - */ - @JsonProperty(value = "eula") - private String eula; - - /* - * The privacy statement uri. - */ - @JsonProperty(value = "privacyStatementUri") - private String privacyStatementUri; - - /* - * The release note uri. - */ - @JsonProperty(value = "releaseNoteUri") - private String releaseNoteUri; - - /* - * This property allows you to specify the type of the OS that is included - * in the disk when creating a VM from a managed image.

Possible - * values are:

**Windows**

**Linux** - */ - @JsonProperty(value = "osType", required = true) - private OperatingSystemTypes osType; - - /* - * This property allows the user to specify whether the virtual machines - * created under this image are 'Generalized' or 'Specialized'. - */ - @JsonProperty(value = "osState", required = true) - private OperatingSystemStateTypes osState; - - /* - * The hypervisor generation of the Virtual Machine. Applicable to OS disks - * only. - */ - @JsonProperty(value = "hyperVGeneration") - private HyperVGeneration hyperVGeneration; - - /* - * The end of life date of the gallery Image Definition. This property can - * be used for decommissioning purposes. This property is updatable. - */ - @JsonProperty(value = "endOfLifeDate") - private OffsetDateTime endOfLifeDate; - - /* - * This is the gallery Image Definition identifier. - */ - @JsonProperty(value = "identifier", required = true) - private GalleryImageIdentifier identifier; - - /* - * The properties describe the recommended machine configuration for this - * Image Definition. These properties are updatable. - */ - @JsonProperty(value = "recommended") - private RecommendedMachineConfiguration recommended; - - /* - * Describes the disallowed disk types. - */ - @JsonProperty(value = "disallowed") - private Disallowed disallowed; - - /* - * Describes the gallery Image Definition purchase plan. This is used by - * marketplace images. - */ - @JsonProperty(value = "purchasePlan") - private ImagePurchasePlan purchasePlan; - - /* - * The current state of the gallery Image Definition. The provisioning - * state, which only appears in the response. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private GalleryImagePropertiesProvisioningState provisioningState; - - /** - * Get the description property: The description of this gallery Image Definition resource. This property is - * updatable. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: The description of this gallery Image Definition resource. This property is - * updatable. - * - * @param description the description value to set. - * @return the GalleryImageProperties object itself. - */ - public GalleryImageProperties withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the eula property: The Eula agreement for the gallery Image Definition. - * - * @return the eula value. - */ - public String eula() { - return this.eula; - } - - /** - * Set the eula property: The Eula agreement for the gallery Image Definition. - * - * @param eula the eula value to set. - * @return the GalleryImageProperties object itself. - */ - public GalleryImageProperties withEula(String eula) { - this.eula = eula; - return this; - } - - /** - * Get the privacyStatementUri property: The privacy statement uri. - * - * @return the privacyStatementUri value. - */ - public String privacyStatementUri() { - return this.privacyStatementUri; - } - - /** - * Set the privacyStatementUri property: The privacy statement uri. - * - * @param privacyStatementUri the privacyStatementUri value to set. - * @return the GalleryImageProperties object itself. - */ - public GalleryImageProperties withPrivacyStatementUri(String privacyStatementUri) { - this.privacyStatementUri = privacyStatementUri; - return this; - } - - /** - * Get the releaseNoteUri property: The release note uri. - * - * @return the releaseNoteUri value. - */ - public String releaseNoteUri() { - return this.releaseNoteUri; - } - - /** - * Set the releaseNoteUri property: The release note uri. - * - * @param releaseNoteUri the releaseNoteUri value to set. - * @return the GalleryImageProperties object itself. - */ - public GalleryImageProperties withReleaseNoteUri(String releaseNoteUri) { - this.releaseNoteUri = releaseNoteUri; - return this; - } - - /** - * Get the osType property: This property allows you to specify the type of the OS that is included in the disk when - * creating a VM from a managed image. <br><br> Possible values are: <br><br> **Windows** - * <br><br> **Linux**. - * - * @return the osType value. - */ - public OperatingSystemTypes osType() { - return this.osType; - } - - /** - * Set the osType property: This property allows you to specify the type of the OS that is included in the disk when - * creating a VM from a managed image. <br><br> Possible values are: <br><br> **Windows** - * <br><br> **Linux**. - * - * @param osType the osType value to set. - * @return the GalleryImageProperties object itself. - */ - public GalleryImageProperties withOsType(OperatingSystemTypes osType) { - this.osType = osType; - return this; - } - - /** - * Get the osState property: This property allows the user to specify whether the virtual machines created under - * this image are 'Generalized' or 'Specialized'. - * - * @return the osState value. - */ - public OperatingSystemStateTypes osState() { - return this.osState; - } - - /** - * Set the osState property: This property allows the user to specify whether the virtual machines created under - * this image are 'Generalized' or 'Specialized'. - * - * @param osState the osState value to set. - * @return the GalleryImageProperties object itself. - */ - public GalleryImageProperties withOsState(OperatingSystemStateTypes osState) { - this.osState = osState; - return this; - } - - /** - * Get the hyperVGeneration property: The hypervisor generation of the Virtual Machine. Applicable to OS disks only. - * - * @return the hyperVGeneration value. - */ - public HyperVGeneration hyperVGeneration() { - return this.hyperVGeneration; - } - - /** - * Set the hyperVGeneration property: The hypervisor generation of the Virtual Machine. Applicable to OS disks only. - * - * @param hyperVGeneration the hyperVGeneration value to set. - * @return the GalleryImageProperties object itself. - */ - public GalleryImageProperties withHyperVGeneration(HyperVGeneration hyperVGeneration) { - this.hyperVGeneration = hyperVGeneration; - return this; - } - - /** - * Get the endOfLifeDate property: The end of life date of the gallery Image Definition. This property can be used - * for decommissioning purposes. This property is updatable. - * - * @return the endOfLifeDate value. - */ - public OffsetDateTime endOfLifeDate() { - return this.endOfLifeDate; - } - - /** - * Set the endOfLifeDate property: The end of life date of the gallery Image Definition. This property can be used - * for decommissioning purposes. This property is updatable. - * - * @param endOfLifeDate the endOfLifeDate value to set. - * @return the GalleryImageProperties object itself. - */ - public GalleryImageProperties withEndOfLifeDate(OffsetDateTime endOfLifeDate) { - this.endOfLifeDate = endOfLifeDate; - return this; - } - - /** - * Get the identifier property: This is the gallery Image Definition identifier. - * - * @return the identifier value. - */ - public GalleryImageIdentifier identifier() { - return this.identifier; - } - - /** - * Set the identifier property: This is the gallery Image Definition identifier. - * - * @param identifier the identifier value to set. - * @return the GalleryImageProperties object itself. - */ - public GalleryImageProperties withIdentifier(GalleryImageIdentifier identifier) { - this.identifier = identifier; - return this; - } - - /** - * Get the recommended property: The properties describe the recommended machine configuration for this Image - * Definition. These properties are updatable. - * - * @return the recommended value. - */ - public RecommendedMachineConfiguration recommended() { - return this.recommended; - } - - /** - * Set the recommended property: The properties describe the recommended machine configuration for this Image - * Definition. These properties are updatable. - * - * @param recommended the recommended value to set. - * @return the GalleryImageProperties object itself. - */ - public GalleryImageProperties withRecommended(RecommendedMachineConfiguration recommended) { - this.recommended = recommended; - return this; - } - - /** - * Get the disallowed property: Describes the disallowed disk types. - * - * @return the disallowed value. - */ - public Disallowed disallowed() { - return this.disallowed; - } - - /** - * Set the disallowed property: Describes the disallowed disk types. - * - * @param disallowed the disallowed value to set. - * @return the GalleryImageProperties object itself. - */ - public GalleryImageProperties withDisallowed(Disallowed disallowed) { - this.disallowed = disallowed; - return this; - } - - /** - * Get the purchasePlan property: Describes the gallery Image Definition purchase plan. This is used by marketplace - * images. - * - * @return the purchasePlan value. - */ - public ImagePurchasePlan purchasePlan() { - return this.purchasePlan; - } - - /** - * Set the purchasePlan property: Describes the gallery Image Definition purchase plan. This is used by marketplace - * images. - * - * @param purchasePlan the purchasePlan value to set. - * @return the GalleryImageProperties object itself. - */ - public GalleryImageProperties withPurchasePlan(ImagePurchasePlan purchasePlan) { - this.purchasePlan = purchasePlan; - return this; - } - - /** - * Get the provisioningState property: The current state of the gallery Image Definition. The provisioning state, - * which only appears in the response. - * - * @return the provisioningState value. - */ - public GalleryImagePropertiesProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (osType() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property osType in model GalleryImageProperties")); - } - if (osState() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property osState in model GalleryImageProperties")); - } - if (identifier() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property identifier in model GalleryImageProperties")); - } else { - identifier().validate(); - } - if (recommended() != null) { - recommended().validate(); - } - if (disallowed() != null) { - disallowed().validate(); - } - if (purchasePlan() != null) { - purchasePlan().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/GalleryImageVersionInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/GalleryImageVersionInner.java deleted file mode 100644 index 08b4d4d874c9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/GalleryImageVersionInner.java +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.models.GalleryImageVersionPropertiesProvisioningState; -import com.azure.resourcemanager.compute.models.GalleryImageVersionPublishingProfile; -import com.azure.resourcemanager.compute.models.GalleryImageVersionStorageProfile; -import com.azure.resourcemanager.compute.models.ReplicationStatus; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** Specifies information about the gallery Image Version that you want to create or update. */ -@Fluent -public final class GalleryImageVersionInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(GalleryImageVersionInner.class); - - /* - * Describes the properties of a gallery Image Version. - */ - @JsonProperty(value = "properties") - private GalleryImageVersionProperties innerProperties; - - /** - * Get the innerProperties property: Describes the properties of a gallery Image Version. - * - * @return the innerProperties value. - */ - private GalleryImageVersionProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public GalleryImageVersionInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public GalleryImageVersionInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the publishingProfile property: The publishing profile of a gallery Image Version. - * - * @return the publishingProfile value. - */ - public GalleryImageVersionPublishingProfile publishingProfile() { - return this.innerProperties() == null ? null : this.innerProperties().publishingProfile(); - } - - /** - * Set the publishingProfile property: The publishing profile of a gallery Image Version. - * - * @param publishingProfile the publishingProfile value to set. - * @return the GalleryImageVersionInner object itself. - */ - public GalleryImageVersionInner withPublishingProfile(GalleryImageVersionPublishingProfile publishingProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new GalleryImageVersionProperties(); - } - this.innerProperties().withPublishingProfile(publishingProfile); - return this; - } - - /** - * Get the provisioningState property: The current state of the gallery Image Version. The provisioning state, which - * only appears in the response. - * - * @return the provisioningState value. - */ - public GalleryImageVersionPropertiesProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the storageProfile property: This is the storage profile of a Gallery Image Version. - * - * @return the storageProfile value. - */ - public GalleryImageVersionStorageProfile storageProfile() { - return this.innerProperties() == null ? null : this.innerProperties().storageProfile(); - } - - /** - * Set the storageProfile property: This is the storage profile of a Gallery Image Version. - * - * @param storageProfile the storageProfile value to set. - * @return the GalleryImageVersionInner object itself. - */ - public GalleryImageVersionInner withStorageProfile(GalleryImageVersionStorageProfile storageProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new GalleryImageVersionProperties(); - } - this.innerProperties().withStorageProfile(storageProfile); - return this; - } - - /** - * Get the replicationStatus property: This is the replication status of the gallery Image Version. - * - * @return the replicationStatus value. - */ - public ReplicationStatus replicationStatus() { - return this.innerProperties() == null ? null : this.innerProperties().replicationStatus(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/GalleryImageVersionProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/GalleryImageVersionProperties.java deleted file mode 100644 index 8a8685975567..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/GalleryImageVersionProperties.java +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.models.GalleryImageVersionPropertiesProvisioningState; -import com.azure.resourcemanager.compute.models.GalleryImageVersionPublishingProfile; -import com.azure.resourcemanager.compute.models.GalleryImageVersionStorageProfile; -import com.azure.resourcemanager.compute.models.ReplicationStatus; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describes the properties of a gallery Image Version. */ -@Fluent -public final class GalleryImageVersionProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(GalleryImageVersionProperties.class); - - /* - * The publishing profile of a gallery Image Version. - */ - @JsonProperty(value = "publishingProfile") - private GalleryImageVersionPublishingProfile publishingProfile; - - /* - * The current state of the gallery Image Version. The provisioning state, - * which only appears in the response. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private GalleryImageVersionPropertiesProvisioningState provisioningState; - - /* - * This is the storage profile of a Gallery Image Version. - */ - @JsonProperty(value = "storageProfile", required = true) - private GalleryImageVersionStorageProfile storageProfile; - - /* - * This is the replication status of the gallery Image Version. - */ - @JsonProperty(value = "replicationStatus", access = JsonProperty.Access.WRITE_ONLY) - private ReplicationStatus replicationStatus; - - /** - * Get the publishingProfile property: The publishing profile of a gallery Image Version. - * - * @return the publishingProfile value. - */ - public GalleryImageVersionPublishingProfile publishingProfile() { - return this.publishingProfile; - } - - /** - * Set the publishingProfile property: The publishing profile of a gallery Image Version. - * - * @param publishingProfile the publishingProfile value to set. - * @return the GalleryImageVersionProperties object itself. - */ - public GalleryImageVersionProperties withPublishingProfile(GalleryImageVersionPublishingProfile publishingProfile) { - this.publishingProfile = publishingProfile; - return this; - } - - /** - * Get the provisioningState property: The current state of the gallery Image Version. The provisioning state, which - * only appears in the response. - * - * @return the provisioningState value. - */ - public GalleryImageVersionPropertiesProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Get the storageProfile property: This is the storage profile of a Gallery Image Version. - * - * @return the storageProfile value. - */ - public GalleryImageVersionStorageProfile storageProfile() { - return this.storageProfile; - } - - /** - * Set the storageProfile property: This is the storage profile of a Gallery Image Version. - * - * @param storageProfile the storageProfile value to set. - * @return the GalleryImageVersionProperties object itself. - */ - public GalleryImageVersionProperties withStorageProfile(GalleryImageVersionStorageProfile storageProfile) { - this.storageProfile = storageProfile; - return this; - } - - /** - * Get the replicationStatus property: This is the replication status of the gallery Image Version. - * - * @return the replicationStatus value. - */ - public ReplicationStatus replicationStatus() { - return this.replicationStatus; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (publishingProfile() != null) { - publishingProfile().validate(); - } - if (storageProfile() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property storageProfile in model GalleryImageVersionProperties")); - } else { - storageProfile().validate(); - } - if (replicationStatus() != null) { - replicationStatus().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/GalleryInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/GalleryInner.java deleted file mode 100644 index 484184acadb7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/GalleryInner.java +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.models.GalleryIdentifier; -import com.azure.resourcemanager.compute.models.GalleryPropertiesProvisioningState; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** Specifies information about the Shared Image Gallery that you want to create or update. */ -@Fluent -public final class GalleryInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(GalleryInner.class); - - /* - * Describes the properties of a Shared Image Gallery. - */ - @JsonProperty(value = "properties") - private GalleryProperties innerProperties; - - /** - * Get the innerProperties property: Describes the properties of a Shared Image Gallery. - * - * @return the innerProperties value. - */ - private GalleryProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public GalleryInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public GalleryInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the description property: The description of this Shared Image Gallery resource. This property is updatable. - * - * @return the description value. - */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); - } - - /** - * Set the description property: The description of this Shared Image Gallery resource. This property is updatable. - * - * @param description the description value to set. - * @return the GalleryInner object itself. - */ - public GalleryInner withDescription(String description) { - if (this.innerProperties() == null) { - this.innerProperties = new GalleryProperties(); - } - this.innerProperties().withDescription(description); - return this; - } - - /** - * Get the identifier property: Describes the gallery unique name. - * - * @return the identifier value. - */ - public GalleryIdentifier identifier() { - return this.innerProperties() == null ? null : this.innerProperties().identifier(); - } - - /** - * Set the identifier property: Describes the gallery unique name. - * - * @param identifier the identifier value to set. - * @return the GalleryInner object itself. - */ - public GalleryInner withIdentifier(GalleryIdentifier identifier) { - if (this.innerProperties() == null) { - this.innerProperties = new GalleryProperties(); - } - this.innerProperties().withIdentifier(identifier); - return this; - } - - /** - * Get the provisioningState property: The current state of the gallery. The provisioning state, which only appears - * in the response. - * - * @return the provisioningState value. - */ - public GalleryPropertiesProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/GalleryProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/GalleryProperties.java deleted file mode 100644 index a5628c73f305..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/GalleryProperties.java +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.models.GalleryIdentifier; -import com.azure.resourcemanager.compute.models.GalleryPropertiesProvisioningState; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describes the properties of a Shared Image Gallery. */ -@Fluent -public final class GalleryProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(GalleryProperties.class); - - /* - * The description of this Shared Image Gallery resource. This property is - * updatable. - */ - @JsonProperty(value = "description") - private String description; - - /* - * Describes the gallery unique name. - */ - @JsonProperty(value = "identifier") - private GalleryIdentifier identifier; - - /* - * The current state of the gallery. The provisioning state, which only - * appears in the response. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private GalleryPropertiesProvisioningState provisioningState; - - /** - * Get the description property: The description of this Shared Image Gallery resource. This property is updatable. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: The description of this Shared Image Gallery resource. This property is updatable. - * - * @param description the description value to set. - * @return the GalleryProperties object itself. - */ - public GalleryProperties withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the identifier property: Describes the gallery unique name. - * - * @return the identifier value. - */ - public GalleryIdentifier identifier() { - return this.identifier; - } - - /** - * Set the identifier property: Describes the gallery unique name. - * - * @param identifier the identifier value to set. - * @return the GalleryProperties object itself. - */ - public GalleryProperties withIdentifier(GalleryIdentifier identifier) { - this.identifier = identifier; - return this; - } - - /** - * Get the provisioningState property: The current state of the gallery. The provisioning state, which only appears - * in the response. - * - * @return the provisioningState value. - */ - public GalleryPropertiesProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (identifier() != null) { - identifier().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/ImageInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/ImageInner.java deleted file mode 100644 index f2dd54f1e1be..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/ImageInner.java +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.models.HyperVGenerationTypes; -import com.azure.resourcemanager.compute.models.ImageStorageProfile; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** - * The source user image virtual hard disk. The virtual hard disk will be copied before being attached to the virtual - * machine. If SourceImage is provided, the destination virtual hard drive must not exist. - */ -@Fluent -public final class ImageInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ImageInner.class); - - /* - * Describes the properties of an Image. - */ - @JsonProperty(value = "properties") - private ImageProperties innerProperties; - - /** - * Get the innerProperties property: Describes the properties of an Image. - * - * @return the innerProperties value. - */ - private ImageProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public ImageInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public ImageInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the sourceVirtualMachine property: The source virtual machine from which Image is created. - * - * @return the sourceVirtualMachine value. - */ - public SubResource sourceVirtualMachine() { - return this.innerProperties() == null ? null : this.innerProperties().sourceVirtualMachine(); - } - - /** - * Set the sourceVirtualMachine property: The source virtual machine from which Image is created. - * - * @param sourceVirtualMachine the sourceVirtualMachine value to set. - * @return the ImageInner object itself. - */ - public ImageInner withSourceVirtualMachine(SubResource sourceVirtualMachine) { - if (this.innerProperties() == null) { - this.innerProperties = new ImageProperties(); - } - this.innerProperties().withSourceVirtualMachine(sourceVirtualMachine); - return this; - } - - /** - * Get the storageProfile property: Specifies the storage settings for the virtual machine disks. - * - * @return the storageProfile value. - */ - public ImageStorageProfile storageProfile() { - return this.innerProperties() == null ? null : this.innerProperties().storageProfile(); - } - - /** - * Set the storageProfile property: Specifies the storage settings for the virtual machine disks. - * - * @param storageProfile the storageProfile value to set. - * @return the ImageInner object itself. - */ - public ImageInner withStorageProfile(ImageStorageProfile storageProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new ImageProperties(); - } - this.innerProperties().withStorageProfile(storageProfile); - return this; - } - - /** - * Get the provisioningState property: The provisioning state. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the hyperVGeneration property: Gets the HyperVGenerationType of the VirtualMachine created from the image. - * - * @return the hyperVGeneration value. - */ - public HyperVGenerationTypes hyperVGeneration() { - return this.innerProperties() == null ? null : this.innerProperties().hyperVGeneration(); - } - - /** - * Set the hyperVGeneration property: Gets the HyperVGenerationType of the VirtualMachine created from the image. - * - * @param hyperVGeneration the hyperVGeneration value to set. - * @return the ImageInner object itself. - */ - public ImageInner withHyperVGeneration(HyperVGenerationTypes hyperVGeneration) { - if (this.innerProperties() == null) { - this.innerProperties = new ImageProperties(); - } - this.innerProperties().withHyperVGeneration(hyperVGeneration); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/ImageProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/ImageProperties.java deleted file mode 100644 index 8f4f455bc1b9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/ImageProperties.java +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.models.HyperVGenerationTypes; -import com.azure.resourcemanager.compute.models.ImageStorageProfile; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describes the properties of an Image. */ -@Fluent -public final class ImageProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ImageProperties.class); - - /* - * The source virtual machine from which Image is created. - */ - @JsonProperty(value = "sourceVirtualMachine") - private SubResource sourceVirtualMachine; - - /* - * Specifies the storage settings for the virtual machine disks. - */ - @JsonProperty(value = "storageProfile") - private ImageStorageProfile storageProfile; - - /* - * The provisioning state. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; - - /* - * Gets the HyperVGenerationType of the VirtualMachine created from the - * image - */ - @JsonProperty(value = "hyperVGeneration") - private HyperVGenerationTypes hyperVGeneration; - - /** - * Get the sourceVirtualMachine property: The source virtual machine from which Image is created. - * - * @return the sourceVirtualMachine value. - */ - public SubResource sourceVirtualMachine() { - return this.sourceVirtualMachine; - } - - /** - * Set the sourceVirtualMachine property: The source virtual machine from which Image is created. - * - * @param sourceVirtualMachine the sourceVirtualMachine value to set. - * @return the ImageProperties object itself. - */ - public ImageProperties withSourceVirtualMachine(SubResource sourceVirtualMachine) { - this.sourceVirtualMachine = sourceVirtualMachine; - return this; - } - - /** - * Get the storageProfile property: Specifies the storage settings for the virtual machine disks. - * - * @return the storageProfile value. - */ - public ImageStorageProfile storageProfile() { - return this.storageProfile; - } - - /** - * Set the storageProfile property: Specifies the storage settings for the virtual machine disks. - * - * @param storageProfile the storageProfile value to set. - * @return the ImageProperties object itself. - */ - public ImageProperties withStorageProfile(ImageStorageProfile storageProfile) { - this.storageProfile = storageProfile; - return this; - } - - /** - * Get the provisioningState property: The provisioning state. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Get the hyperVGeneration property: Gets the HyperVGenerationType of the VirtualMachine created from the image. - * - * @return the hyperVGeneration value. - */ - public HyperVGenerationTypes hyperVGeneration() { - return this.hyperVGeneration; - } - - /** - * Set the hyperVGeneration property: Gets the HyperVGenerationType of the VirtualMachine created from the image. - * - * @param hyperVGeneration the hyperVGeneration value to set. - * @return the ImageProperties object itself. - */ - public ImageProperties withHyperVGeneration(HyperVGenerationTypes hyperVGeneration) { - this.hyperVGeneration = hyperVGeneration; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (storageProfile() != null) { - storageProfile().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/LogAnalyticsOperationResultInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/LogAnalyticsOperationResultInner.java deleted file mode 100644 index 17db35e47986..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/LogAnalyticsOperationResultInner.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.models.LogAnalyticsOutput; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** LogAnalytics operation status response. */ -@Immutable -public final class LogAnalyticsOperationResultInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LogAnalyticsOperationResultInner.class); - - /* - * LogAnalyticsOutput - */ - @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY) - private LogAnalyticsOutput properties; - - /** - * Get the properties property: LogAnalyticsOutput. - * - * @return the properties value. - */ - public LogAnalyticsOutput properties() { - return this.properties; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/NetworkInterfaceReferenceProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/NetworkInterfaceReferenceProperties.java deleted file mode 100644 index 71c9b695ab9b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/NetworkInterfaceReferenceProperties.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describes a network interface reference properties. */ -@Fluent -public final class NetworkInterfaceReferenceProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkInterfaceReferenceProperties.class); - - /* - * Specifies the primary network interface in case the virtual machine has - * more than 1 network interface. - */ - @JsonProperty(value = "primary") - private Boolean primary; - - /** - * Get the primary property: Specifies the primary network interface in case the virtual machine has more than 1 - * network interface. - * - * @return the primary value. - */ - public Boolean primary() { - return this.primary; - } - - /** - * Set the primary property: Specifies the primary network interface in case the virtual machine has more than 1 - * network interface. - * - * @param primary the primary value to set. - * @return the NetworkInterfaceReferenceProperties object itself. - */ - public NetworkInterfaceReferenceProperties withPrimary(Boolean primary) { - this.primary = primary; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/ProximityPlacementGroupInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/ProximityPlacementGroupInner.java deleted file mode 100644 index 620ccbc3b80b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/ProximityPlacementGroupInner.java +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.models.InstanceViewStatus; -import com.azure.resourcemanager.compute.models.ProximityPlacementGroupType; -import com.azure.resourcemanager.compute.models.SubResourceWithColocationStatus; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** Specifies information about the proximity placement group. */ -@Fluent -public final class ProximityPlacementGroupInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ProximityPlacementGroupInner.class); - - /* - * Describes the properties of a Proximity Placement Group. - */ - @JsonProperty(value = "properties") - private ProximityPlacementGroupProperties innerProperties; - - /** - * Get the innerProperties property: Describes the properties of a Proximity Placement Group. - * - * @return the innerProperties value. - */ - private ProximityPlacementGroupProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public ProximityPlacementGroupInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public ProximityPlacementGroupInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the proximityPlacementGroupType property: Specifies the type of the proximity placement group. - * <br><br> Possible values are: <br><br> **Standard** : Co-locate resources within an Azure - * region or Availability Zone. <br><br> **Ultra** : For future use. - * - * @return the proximityPlacementGroupType value. - */ - public ProximityPlacementGroupType proximityPlacementGroupType() { - return this.innerProperties() == null ? null : this.innerProperties().proximityPlacementGroupType(); - } - - /** - * Set the proximityPlacementGroupType property: Specifies the type of the proximity placement group. - * <br><br> Possible values are: <br><br> **Standard** : Co-locate resources within an Azure - * region or Availability Zone. <br><br> **Ultra** : For future use. - * - * @param proximityPlacementGroupType the proximityPlacementGroupType value to set. - * @return the ProximityPlacementGroupInner object itself. - */ - public ProximityPlacementGroupInner withProximityPlacementGroupType( - ProximityPlacementGroupType proximityPlacementGroupType) { - if (this.innerProperties() == null) { - this.innerProperties = new ProximityPlacementGroupProperties(); - } - this.innerProperties().withProximityPlacementGroupType(proximityPlacementGroupType); - return this; - } - - /** - * Get the virtualMachines property: A list of references to all virtual machines in the proximity placement group. - * - * @return the virtualMachines value. - */ - public List virtualMachines() { - return this.innerProperties() == null ? null : this.innerProperties().virtualMachines(); - } - - /** - * Get the virtualMachineScaleSets property: A list of references to all virtual machine scale sets in the proximity - * placement group. - * - * @return the virtualMachineScaleSets value. - */ - public List virtualMachineScaleSets() { - return this.innerProperties() == null ? null : this.innerProperties().virtualMachineScaleSets(); - } - - /** - * Get the availabilitySets property: A list of references to all availability sets in the proximity placement - * group. - * - * @return the availabilitySets value. - */ - public List availabilitySets() { - return this.innerProperties() == null ? null : this.innerProperties().availabilitySets(); - } - - /** - * Get the colocationStatus property: Describes colocation status of the Proximity Placement Group. - * - * @return the colocationStatus value. - */ - public InstanceViewStatus colocationStatus() { - return this.innerProperties() == null ? null : this.innerProperties().colocationStatus(); - } - - /** - * Set the colocationStatus property: Describes colocation status of the Proximity Placement Group. - * - * @param colocationStatus the colocationStatus value to set. - * @return the ProximityPlacementGroupInner object itself. - */ - public ProximityPlacementGroupInner withColocationStatus(InstanceViewStatus colocationStatus) { - if (this.innerProperties() == null) { - this.innerProperties = new ProximityPlacementGroupProperties(); - } - this.innerProperties().withColocationStatus(colocationStatus); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/ProximityPlacementGroupProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/ProximityPlacementGroupProperties.java deleted file mode 100644 index 3ea59a4f3a91..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/ProximityPlacementGroupProperties.java +++ /dev/null @@ -1,149 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.models.InstanceViewStatus; -import com.azure.resourcemanager.compute.models.ProximityPlacementGroupType; -import com.azure.resourcemanager.compute.models.SubResourceWithColocationStatus; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Describes the properties of a Proximity Placement Group. */ -@Fluent -public final class ProximityPlacementGroupProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ProximityPlacementGroupProperties.class); - - /* - * Specifies the type of the proximity placement group.

Possible - * values are:

**Standard** : Co-locate resources within an Azure - * region or Availability Zone.

**Ultra** : For future use. - */ - @JsonProperty(value = "proximityPlacementGroupType") - private ProximityPlacementGroupType proximityPlacementGroupType; - - /* - * A list of references to all virtual machines in the proximity placement - * group. - */ - @JsonProperty(value = "virtualMachines", access = JsonProperty.Access.WRITE_ONLY) - private List virtualMachines; - - /* - * A list of references to all virtual machine scale sets in the proximity - * placement group. - */ - @JsonProperty(value = "virtualMachineScaleSets", access = JsonProperty.Access.WRITE_ONLY) - private List virtualMachineScaleSets; - - /* - * A list of references to all availability sets in the proximity placement - * group. - */ - @JsonProperty(value = "availabilitySets", access = JsonProperty.Access.WRITE_ONLY) - private List availabilitySets; - - /* - * Describes colocation status of the Proximity Placement Group. - */ - @JsonProperty(value = "colocationStatus") - private InstanceViewStatus colocationStatus; - - /** - * Get the proximityPlacementGroupType property: Specifies the type of the proximity placement group. - * <br><br> Possible values are: <br><br> **Standard** : Co-locate resources within an Azure - * region or Availability Zone. <br><br> **Ultra** : For future use. - * - * @return the proximityPlacementGroupType value. - */ - public ProximityPlacementGroupType proximityPlacementGroupType() { - return this.proximityPlacementGroupType; - } - - /** - * Set the proximityPlacementGroupType property: Specifies the type of the proximity placement group. - * <br><br> Possible values are: <br><br> **Standard** : Co-locate resources within an Azure - * region or Availability Zone. <br><br> **Ultra** : For future use. - * - * @param proximityPlacementGroupType the proximityPlacementGroupType value to set. - * @return the ProximityPlacementGroupProperties object itself. - */ - public ProximityPlacementGroupProperties withProximityPlacementGroupType( - ProximityPlacementGroupType proximityPlacementGroupType) { - this.proximityPlacementGroupType = proximityPlacementGroupType; - return this; - } - - /** - * Get the virtualMachines property: A list of references to all virtual machines in the proximity placement group. - * - * @return the virtualMachines value. - */ - public List virtualMachines() { - return this.virtualMachines; - } - - /** - * Get the virtualMachineScaleSets property: A list of references to all virtual machine scale sets in the proximity - * placement group. - * - * @return the virtualMachineScaleSets value. - */ - public List virtualMachineScaleSets() { - return this.virtualMachineScaleSets; - } - - /** - * Get the availabilitySets property: A list of references to all availability sets in the proximity placement - * group. - * - * @return the availabilitySets value. - */ - public List availabilitySets() { - return this.availabilitySets; - } - - /** - * Get the colocationStatus property: Describes colocation status of the Proximity Placement Group. - * - * @return the colocationStatus value. - */ - public InstanceViewStatus colocationStatus() { - return this.colocationStatus; - } - - /** - * Set the colocationStatus property: Describes colocation status of the Proximity Placement Group. - * - * @param colocationStatus the colocationStatus value to set. - * @return the ProximityPlacementGroupProperties object itself. - */ - public ProximityPlacementGroupProperties withColocationStatus(InstanceViewStatus colocationStatus) { - this.colocationStatus = colocationStatus; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (virtualMachines() != null) { - virtualMachines().forEach(e -> e.validate()); - } - if (virtualMachineScaleSets() != null) { - virtualMachineScaleSets().forEach(e -> e.validate()); - } - if (availabilitySets() != null) { - availabilitySets().forEach(e -> e.validate()); - } - if (colocationStatus() != null) { - colocationStatus().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/RecoveryWalkResponseInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/RecoveryWalkResponseInner.java deleted file mode 100644 index f91b803d5b9b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/RecoveryWalkResponseInner.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Response after calling a manual recovery walk. */ -@Immutable -public final class RecoveryWalkResponseInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RecoveryWalkResponseInner.class); - - /* - * Whether the recovery walk was performed - */ - @JsonProperty(value = "walkPerformed", access = JsonProperty.Access.WRITE_ONLY) - private Boolean walkPerformed; - - /* - * The next update domain that needs to be walked. Null means walk spanning - * all update domains has been completed - */ - @JsonProperty(value = "nextPlatformUpdateDomain", access = JsonProperty.Access.WRITE_ONLY) - private Integer nextPlatformUpdateDomain; - - /** - * Get the walkPerformed property: Whether the recovery walk was performed. - * - * @return the walkPerformed value. - */ - public Boolean walkPerformed() { - return this.walkPerformed; - } - - /** - * Get the nextPlatformUpdateDomain property: The next update domain that needs to be walked. Null means walk - * spanning all update domains has been completed. - * - * @return the nextPlatformUpdateDomain value. - */ - public Integer nextPlatformUpdateDomain() { - return this.nextPlatformUpdateDomain; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/ResourceSkuInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/ResourceSkuInner.java deleted file mode 100644 index a7786145f621..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/ResourceSkuInner.java +++ /dev/null @@ -1,246 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.models.ResourceSkuCapabilities; -import com.azure.resourcemanager.compute.models.ResourceSkuCapacity; -import com.azure.resourcemanager.compute.models.ResourceSkuCosts; -import com.azure.resourcemanager.compute.models.ResourceSkuLocationInfo; -import com.azure.resourcemanager.compute.models.ResourceSkuRestrictions; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Describes an available Compute SKU. */ -@Immutable -public final class ResourceSkuInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceSkuInner.class); - - /* - * The type of resource the SKU applies to. - */ - @JsonProperty(value = "resourceType", access = JsonProperty.Access.WRITE_ONLY) - private String resourceType; - - /* - * The name of SKU. - */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) - private String name; - - /* - * Specifies the tier of virtual machines in a scale set.

- * Possible Values:

**Standard**

**Basic** - */ - @JsonProperty(value = "tier", access = JsonProperty.Access.WRITE_ONLY) - private String tier; - - /* - * The Size of the SKU. - */ - @JsonProperty(value = "size", access = JsonProperty.Access.WRITE_ONLY) - private String size; - - /* - * The Family of this particular SKU. - */ - @JsonProperty(value = "family", access = JsonProperty.Access.WRITE_ONLY) - private String family; - - /* - * The Kind of resources that are supported in this SKU. - */ - @JsonProperty(value = "kind", access = JsonProperty.Access.WRITE_ONLY) - private String kind; - - /* - * Specifies the number of virtual machines in the scale set. - */ - @JsonProperty(value = "capacity", access = JsonProperty.Access.WRITE_ONLY) - private ResourceSkuCapacity capacity; - - /* - * The set of locations that the SKU is available. - */ - @JsonProperty(value = "locations", access = JsonProperty.Access.WRITE_ONLY) - private List locations; - - /* - * A list of locations and availability zones in those locations where the - * SKU is available. - */ - @JsonProperty(value = "locationInfo", access = JsonProperty.Access.WRITE_ONLY) - private List locationInfo; - - /* - * The api versions that support this SKU. - */ - @JsonProperty(value = "apiVersions", access = JsonProperty.Access.WRITE_ONLY) - private List apiVersions; - - /* - * Metadata for retrieving price info. - */ - @JsonProperty(value = "costs", access = JsonProperty.Access.WRITE_ONLY) - private List costs; - - /* - * A name value pair to describe the capability. - */ - @JsonProperty(value = "capabilities", access = JsonProperty.Access.WRITE_ONLY) - private List capabilities; - - /* - * The restrictions because of which SKU cannot be used. This is empty if - * there are no restrictions. - */ - @JsonProperty(value = "restrictions", access = JsonProperty.Access.WRITE_ONLY) - private List restrictions; - - /** - * Get the resourceType property: The type of resource the SKU applies to. - * - * @return the resourceType value. - */ - public String resourceType() { - return this.resourceType; - } - - /** - * Get the name property: The name of SKU. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the tier property: Specifies the tier of virtual machines in a scale set.<br /><br /> Possible - * Values:<br /><br /> **Standard**<br /><br /> **Basic**. - * - * @return the tier value. - */ - public String tier() { - return this.tier; - } - - /** - * Get the size property: The Size of the SKU. - * - * @return the size value. - */ - public String size() { - return this.size; - } - - /** - * Get the family property: The Family of this particular SKU. - * - * @return the family value. - */ - public String family() { - return this.family; - } - - /** - * Get the kind property: The Kind of resources that are supported in this SKU. - * - * @return the kind value. - */ - public String kind() { - return this.kind; - } - - /** - * Get the capacity property: Specifies the number of virtual machines in the scale set. - * - * @return the capacity value. - */ - public ResourceSkuCapacity capacity() { - return this.capacity; - } - - /** - * Get the locations property: The set of locations that the SKU is available. - * - * @return the locations value. - */ - public List locations() { - return this.locations; - } - - /** - * Get the locationInfo property: A list of locations and availability zones in those locations where the SKU is - * available. - * - * @return the locationInfo value. - */ - public List locationInfo() { - return this.locationInfo; - } - - /** - * Get the apiVersions property: The api versions that support this SKU. - * - * @return the apiVersions value. - */ - public List apiVersions() { - return this.apiVersions; - } - - /** - * Get the costs property: Metadata for retrieving price info. - * - * @return the costs value. - */ - public List costs() { - return this.costs; - } - - /** - * Get the capabilities property: A name value pair to describe the capability. - * - * @return the capabilities value. - */ - public List capabilities() { - return this.capabilities; - } - - /** - * Get the restrictions property: The restrictions because of which SKU cannot be used. This is empty if there are - * no restrictions. - * - * @return the restrictions value. - */ - public List restrictions() { - return this.restrictions; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (capacity() != null) { - capacity().validate(); - } - if (locationInfo() != null) { - locationInfo().forEach(e -> e.validate()); - } - if (costs() != null) { - costs().forEach(e -> e.validate()); - } - if (capabilities() != null) { - capabilities().forEach(e -> e.validate()); - } - if (restrictions() != null) { - restrictions().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/RetrieveBootDiagnosticsDataResultInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/RetrieveBootDiagnosticsDataResultInner.java deleted file mode 100644 index 375aa7df98d1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/RetrieveBootDiagnosticsDataResultInner.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The SAS URIs of the console screenshot and serial log blobs. */ -@Immutable -public final class RetrieveBootDiagnosticsDataResultInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RetrieveBootDiagnosticsDataResultInner.class); - - /* - * The console screenshot blob URI - */ - @JsonProperty(value = "consoleScreenshotBlobUri", access = JsonProperty.Access.WRITE_ONLY) - private String consoleScreenshotBlobUri; - - /* - * The serial console log blob URI. - */ - @JsonProperty(value = "serialConsoleLogBlobUri", access = JsonProperty.Access.WRITE_ONLY) - private String serialConsoleLogBlobUri; - - /** - * Get the consoleScreenshotBlobUri property: The console screenshot blob URI. - * - * @return the consoleScreenshotBlobUri value. - */ - public String consoleScreenshotBlobUri() { - return this.consoleScreenshotBlobUri; - } - - /** - * Get the serialConsoleLogBlobUri property: The serial console log blob URI. - * - * @return the serialConsoleLogBlobUri value. - */ - public String serialConsoleLogBlobUri() { - return this.serialConsoleLogBlobUri; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/RollingUpgradeStatusInfoInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/RollingUpgradeStatusInfoInner.java deleted file mode 100644 index 0129a0397ffc..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/RollingUpgradeStatusInfoInner.java +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.models.ApiError; -import com.azure.resourcemanager.compute.models.RollingUpgradePolicy; -import com.azure.resourcemanager.compute.models.RollingUpgradeProgressInfo; -import com.azure.resourcemanager.compute.models.RollingUpgradeRunningStatus; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** The status of the latest virtual machine scale set rolling upgrade. */ -@Fluent -public final class RollingUpgradeStatusInfoInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RollingUpgradeStatusInfoInner.class); - - /* - * The status of the latest virtual machine scale set rolling upgrade. - */ - @JsonProperty(value = "properties") - private RollingUpgradeStatusInfoProperties innerProperties; - - /** - * Get the innerProperties property: The status of the latest virtual machine scale set rolling upgrade. - * - * @return the innerProperties value. - */ - private RollingUpgradeStatusInfoProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public RollingUpgradeStatusInfoInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public RollingUpgradeStatusInfoInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the policy property: The rolling upgrade policies applied for this upgrade. - * - * @return the policy value. - */ - public RollingUpgradePolicy policy() { - return this.innerProperties() == null ? null : this.innerProperties().policy(); - } - - /** - * Get the runningStatus property: Information about the current running state of the overall upgrade. - * - * @return the runningStatus value. - */ - public RollingUpgradeRunningStatus runningStatus() { - return this.innerProperties() == null ? null : this.innerProperties().runningStatus(); - } - - /** - * Get the progress property: Information about the number of virtual machine instances in each upgrade state. - * - * @return the progress value. - */ - public RollingUpgradeProgressInfo progress() { - return this.innerProperties() == null ? null : this.innerProperties().progress(); - } - - /** - * Get the error property: Error details for this upgrade, if there are any. - * - * @return the error value. - */ - public ApiError error() { - return this.innerProperties() == null ? null : this.innerProperties().error(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/RollingUpgradeStatusInfoProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/RollingUpgradeStatusInfoProperties.java deleted file mode 100644 index fa783f3fefef..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/RollingUpgradeStatusInfoProperties.java +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.models.ApiError; -import com.azure.resourcemanager.compute.models.RollingUpgradePolicy; -import com.azure.resourcemanager.compute.models.RollingUpgradeProgressInfo; -import com.azure.resourcemanager.compute.models.RollingUpgradeRunningStatus; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The status of the latest virtual machine scale set rolling upgrade. */ -@Immutable -public final class RollingUpgradeStatusInfoProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RollingUpgradeStatusInfoProperties.class); - - /* - * The rolling upgrade policies applied for this upgrade. - */ - @JsonProperty(value = "policy", access = JsonProperty.Access.WRITE_ONLY) - private RollingUpgradePolicy policy; - - /* - * Information about the current running state of the overall upgrade. - */ - @JsonProperty(value = "runningStatus", access = JsonProperty.Access.WRITE_ONLY) - private RollingUpgradeRunningStatus runningStatus; - - /* - * Information about the number of virtual machine instances in each - * upgrade state. - */ - @JsonProperty(value = "progress", access = JsonProperty.Access.WRITE_ONLY) - private RollingUpgradeProgressInfo progress; - - /* - * Error details for this upgrade, if there are any. - */ - @JsonProperty(value = "error", access = JsonProperty.Access.WRITE_ONLY) - private ApiError error; - - /** - * Get the policy property: The rolling upgrade policies applied for this upgrade. - * - * @return the policy value. - */ - public RollingUpgradePolicy policy() { - return this.policy; - } - - /** - * Get the runningStatus property: Information about the current running state of the overall upgrade. - * - * @return the runningStatus value. - */ - public RollingUpgradeRunningStatus runningStatus() { - return this.runningStatus; - } - - /** - * Get the progress property: Information about the number of virtual machine instances in each upgrade state. - * - * @return the progress value. - */ - public RollingUpgradeProgressInfo progress() { - return this.progress; - } - - /** - * Get the error property: Error details for this upgrade, if there are any. - * - * @return the error value. - */ - public ApiError error() { - return this.error; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (policy() != null) { - policy().validate(); - } - if (runningStatus() != null) { - runningStatus().validate(); - } - if (progress() != null) { - progress().validate(); - } - if (error() != null) { - error().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/RunCommandDocumentBaseInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/RunCommandDocumentBaseInner.java deleted file mode 100644 index f9273581e9fd..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/RunCommandDocumentBaseInner.java +++ /dev/null @@ -1,184 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.models.OperatingSystemTypes; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describes the properties of a Run Command metadata. */ -@Fluent -public class RunCommandDocumentBaseInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RunCommandDocumentBaseInner.class); - - /* - * The VM run command schema. - */ - @JsonProperty(value = "$schema", required = true) - private String schema; - - /* - * The VM run command id. - */ - @JsonProperty(value = "id", required = true) - private String id; - - /* - * The Operating System type. - */ - @JsonProperty(value = "osType", required = true) - private OperatingSystemTypes osType; - - /* - * The VM run command label. - */ - @JsonProperty(value = "label", required = true) - private String label; - - /* - * The VM run command description. - */ - @JsonProperty(value = "description", required = true) - private String description; - - /** - * Get the schema property: The VM run command schema. - * - * @return the schema value. - */ - public String schema() { - return this.schema; - } - - /** - * Set the schema property: The VM run command schema. - * - * @param schema the schema value to set. - * @return the RunCommandDocumentBaseInner object itself. - */ - public RunCommandDocumentBaseInner withSchema(String schema) { - this.schema = schema; - return this; - } - - /** - * Get the id property: The VM run command id. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: The VM run command id. - * - * @param id the id value to set. - * @return the RunCommandDocumentBaseInner object itself. - */ - public RunCommandDocumentBaseInner withId(String id) { - this.id = id; - return this; - } - - /** - * Get the osType property: The Operating System type. - * - * @return the osType value. - */ - public OperatingSystemTypes osType() { - return this.osType; - } - - /** - * Set the osType property: The Operating System type. - * - * @param osType the osType value to set. - * @return the RunCommandDocumentBaseInner object itself. - */ - public RunCommandDocumentBaseInner withOsType(OperatingSystemTypes osType) { - this.osType = osType; - return this; - } - - /** - * Get the label property: The VM run command label. - * - * @return the label value. - */ - public String label() { - return this.label; - } - - /** - * Set the label property: The VM run command label. - * - * @param label the label value to set. - * @return the RunCommandDocumentBaseInner object itself. - */ - public RunCommandDocumentBaseInner withLabel(String label) { - this.label = label; - return this; - } - - /** - * Get the description property: The VM run command description. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: The VM run command description. - * - * @param description the description value to set. - * @return the RunCommandDocumentBaseInner object itself. - */ - public RunCommandDocumentBaseInner withDescription(String description) { - this.description = description; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (schema() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property schema in model RunCommandDocumentBaseInner")); - } - if (id() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property id in model RunCommandDocumentBaseInner")); - } - if (osType() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property osType in model RunCommandDocumentBaseInner")); - } - if (label() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property label in model RunCommandDocumentBaseInner")); - } - if (description() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property description in model RunCommandDocumentBaseInner")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/RunCommandDocumentInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/RunCommandDocumentInner.java deleted file mode 100644 index 43bee880068a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/RunCommandDocumentInner.java +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.models.OperatingSystemTypes; -import com.azure.resourcemanager.compute.models.RunCommandParameterDefinition; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Describes the properties of a Run Command. */ -@Fluent -public final class RunCommandDocumentInner extends RunCommandDocumentBaseInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RunCommandDocumentInner.class); - - /* - * The script to be executed. - */ - @JsonProperty(value = "script", required = true) - private List script; - - /* - * The parameters used by the script. - */ - @JsonProperty(value = "parameters") - private List parameters; - - /** - * Get the script property: The script to be executed. - * - * @return the script value. - */ - public List script() { - return this.script; - } - - /** - * Set the script property: The script to be executed. - * - * @param script the script value to set. - * @return the RunCommandDocumentInner object itself. - */ - public RunCommandDocumentInner withScript(List script) { - this.script = script; - return this; - } - - /** - * Get the parameters property: The parameters used by the script. - * - * @return the parameters value. - */ - public List parameters() { - return this.parameters; - } - - /** - * Set the parameters property: The parameters used by the script. - * - * @param parameters the parameters value to set. - * @return the RunCommandDocumentInner object itself. - */ - public RunCommandDocumentInner withParameters(List parameters) { - this.parameters = parameters; - return this; - } - - /** {@inheritDoc} */ - @Override - public RunCommandDocumentInner withSchema(String schema) { - super.withSchema(schema); - return this; - } - - /** {@inheritDoc} */ - @Override - public RunCommandDocumentInner withId(String id) { - super.withId(id); - return this; - } - - /** {@inheritDoc} */ - @Override - public RunCommandDocumentInner withOsType(OperatingSystemTypes osType) { - super.withOsType(osType); - return this; - } - - /** {@inheritDoc} */ - @Override - public RunCommandDocumentInner withLabel(String label) { - super.withLabel(label); - return this; - } - - /** {@inheritDoc} */ - @Override - public RunCommandDocumentInner withDescription(String description) { - super.withDescription(description); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (script() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property script in model RunCommandDocumentInner")); - } - if (parameters() != null) { - parameters().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/RunCommandResultInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/RunCommandResultInner.java deleted file mode 100644 index 01e1ad531265..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/RunCommandResultInner.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.models.InstanceViewStatus; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The RunCommandResult model. */ -@Fluent -public final class RunCommandResultInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RunCommandResultInner.class); - - /* - * Run command operation response. - */ - @JsonProperty(value = "value") - private List value; - - /** - * Get the value property: Run command operation response. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Run command operation response. - * - * @param value the value value to set. - * @return the RunCommandResultInner object itself. - */ - public RunCommandResultInner withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/SnapshotInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/SnapshotInner.java deleted file mode 100644 index ccb5d93ae15e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/SnapshotInner.java +++ /dev/null @@ -1,321 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.models.CreationData; -import com.azure.resourcemanager.compute.models.Encryption; -import com.azure.resourcemanager.compute.models.EncryptionSettingsCollection; -import com.azure.resourcemanager.compute.models.HyperVGeneration; -import com.azure.resourcemanager.compute.models.OperatingSystemTypes; -import com.azure.resourcemanager.compute.models.SnapshotSku; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.Map; - -/** Snapshot resource. */ -@Fluent -public final class SnapshotInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SnapshotInner.class); - - /* - * Unused. Always Null. - */ - @JsonProperty(value = "managedBy", access = JsonProperty.Access.WRITE_ONLY) - private String managedBy; - - /* - * The snapshots sku name. Can be Standard_LRS, Premium_LRS, or - * Standard_ZRS. - */ - @JsonProperty(value = "sku") - private SnapshotSku sku; - - /* - * Snapshot resource properties. - */ - @JsonProperty(value = "properties") - private SnapshotProperties innerProperties; - - /** - * Get the managedBy property: Unused. Always Null. - * - * @return the managedBy value. - */ - public String managedBy() { - return this.managedBy; - } - - /** - * Get the sku property: The snapshots sku name. Can be Standard_LRS, Premium_LRS, or Standard_ZRS. - * - * @return the sku value. - */ - public SnapshotSku sku() { - return this.sku; - } - - /** - * Set the sku property: The snapshots sku name. Can be Standard_LRS, Premium_LRS, or Standard_ZRS. - * - * @param sku the sku value to set. - * @return the SnapshotInner object itself. - */ - public SnapshotInner withSku(SnapshotSku sku) { - this.sku = sku; - return this; - } - - /** - * Get the innerProperties property: Snapshot resource properties. - * - * @return the innerProperties value. - */ - private SnapshotProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public SnapshotInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public SnapshotInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the timeCreated property: The time when the disk was created. - * - * @return the timeCreated value. - */ - public OffsetDateTime timeCreated() { - return this.innerProperties() == null ? null : this.innerProperties().timeCreated(); - } - - /** - * Get the osType property: The Operating System type. - * - * @return the osType value. - */ - public OperatingSystemTypes osType() { - return this.innerProperties() == null ? null : this.innerProperties().osType(); - } - - /** - * Set the osType property: The Operating System type. - * - * @param osType the osType value to set. - * @return the SnapshotInner object itself. - */ - public SnapshotInner withOsType(OperatingSystemTypes osType) { - if (this.innerProperties() == null) { - this.innerProperties = new SnapshotProperties(); - } - this.innerProperties().withOsType(osType); - return this; - } - - /** - * Get the hyperVGeneration property: The hypervisor generation of the Virtual Machine. Applicable to OS disks only. - * - * @return the hyperVGeneration value. - */ - public HyperVGeneration hyperVGeneration() { - return this.innerProperties() == null ? null : this.innerProperties().hyperVGeneration(); - } - - /** - * Set the hyperVGeneration property: The hypervisor generation of the Virtual Machine. Applicable to OS disks only. - * - * @param hyperVGeneration the hyperVGeneration value to set. - * @return the SnapshotInner object itself. - */ - public SnapshotInner withHyperVGeneration(HyperVGeneration hyperVGeneration) { - if (this.innerProperties() == null) { - this.innerProperties = new SnapshotProperties(); - } - this.innerProperties().withHyperVGeneration(hyperVGeneration); - return this; - } - - /** - * Get the creationData property: Disk source information. CreationData information cannot be changed after the disk - * has been created. - * - * @return the creationData value. - */ - public CreationData creationData() { - return this.innerProperties() == null ? null : this.innerProperties().creationData(); - } - - /** - * Set the creationData property: Disk source information. CreationData information cannot be changed after the disk - * has been created. - * - * @param creationData the creationData value to set. - * @return the SnapshotInner object itself. - */ - public SnapshotInner withCreationData(CreationData creationData) { - if (this.innerProperties() == null) { - this.innerProperties = new SnapshotProperties(); - } - this.innerProperties().withCreationData(creationData); - return this; - } - - /** - * Get the diskSizeGB property: If creationData.createOption is Empty, this field is mandatory and it indicates the - * size of the disk to create. If this field is present for updates or creation with other options, it indicates a - * resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's - * size. - * - * @return the diskSizeGB value. - */ - public Integer diskSizeGB() { - return this.innerProperties() == null ? null : this.innerProperties().diskSizeGB(); - } - - /** - * Set the diskSizeGB property: If creationData.createOption is Empty, this field is mandatory and it indicates the - * size of the disk to create. If this field is present for updates or creation with other options, it indicates a - * resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's - * size. - * - * @param diskSizeGB the diskSizeGB value to set. - * @return the SnapshotInner object itself. - */ - public SnapshotInner withDiskSizeGB(Integer diskSizeGB) { - if (this.innerProperties() == null) { - this.innerProperties = new SnapshotProperties(); - } - this.innerProperties().withDiskSizeGB(diskSizeGB); - return this; - } - - /** - * Get the diskSizeBytes property: The size of the disk in bytes. This field is read only. - * - * @return the diskSizeBytes value. - */ - public Long diskSizeBytes() { - return this.innerProperties() == null ? null : this.innerProperties().diskSizeBytes(); - } - - /** - * Get the uniqueId property: Unique Guid identifying the resource. - * - * @return the uniqueId value. - */ - public String uniqueId() { - return this.innerProperties() == null ? null : this.innerProperties().uniqueId(); - } - - /** - * Get the encryptionSettingsCollection property: Encryption settings collection used be Azure Disk Encryption, can - * contain multiple encryption settings per disk or snapshot. - * - * @return the encryptionSettingsCollection value. - */ - public EncryptionSettingsCollection encryptionSettingsCollection() { - return this.innerProperties() == null ? null : this.innerProperties().encryptionSettingsCollection(); - } - - /** - * Set the encryptionSettingsCollection property: Encryption settings collection used be Azure Disk Encryption, can - * contain multiple encryption settings per disk or snapshot. - * - * @param encryptionSettingsCollection the encryptionSettingsCollection value to set. - * @return the SnapshotInner object itself. - */ - public SnapshotInner withEncryptionSettingsCollection(EncryptionSettingsCollection encryptionSettingsCollection) { - if (this.innerProperties() == null) { - this.innerProperties = new SnapshotProperties(); - } - this.innerProperties().withEncryptionSettingsCollection(encryptionSettingsCollection); - return this; - } - - /** - * Get the provisioningState property: The disk provisioning state. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the incremental property: Whether a snapshot is incremental. Incremental snapshots on the same disk occupy - * less space than full snapshots and can be diffed. - * - * @return the incremental value. - */ - public Boolean incremental() { - return this.innerProperties() == null ? null : this.innerProperties().incremental(); - } - - /** - * Set the incremental property: Whether a snapshot is incremental. Incremental snapshots on the same disk occupy - * less space than full snapshots and can be diffed. - * - * @param incremental the incremental value to set. - * @return the SnapshotInner object itself. - */ - public SnapshotInner withIncremental(Boolean incremental) { - if (this.innerProperties() == null) { - this.innerProperties = new SnapshotProperties(); - } - this.innerProperties().withIncremental(incremental); - return this; - } - - /** - * Get the encryption property: Encryption property can be used to encrypt data at rest with customer managed keys - * or platform managed keys. - * - * @return the encryption value. - */ - public Encryption encryption() { - return this.innerProperties() == null ? null : this.innerProperties().encryption(); - } - - /** - * Set the encryption property: Encryption property can be used to encrypt data at rest with customer managed keys - * or platform managed keys. - * - * @param encryption the encryption value to set. - * @return the SnapshotInner object itself. - */ - public SnapshotInner withEncryption(Encryption encryption) { - if (this.innerProperties() == null) { - this.innerProperties = new SnapshotProperties(); - } - this.innerProperties().withEncryption(encryption); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (sku() != null) { - sku().validate(); - } - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/SnapshotProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/SnapshotProperties.java deleted file mode 100644 index aef547447ce9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/SnapshotProperties.java +++ /dev/null @@ -1,309 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.models.CreationData; -import com.azure.resourcemanager.compute.models.Encryption; -import com.azure.resourcemanager.compute.models.EncryptionSettingsCollection; -import com.azure.resourcemanager.compute.models.HyperVGeneration; -import com.azure.resourcemanager.compute.models.OperatingSystemTypes; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** Snapshot resource properties. */ -@Fluent -public final class SnapshotProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SnapshotProperties.class); - - /* - * The time when the disk was created. - */ - @JsonProperty(value = "timeCreated", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime timeCreated; - - /* - * The Operating System type. - */ - @JsonProperty(value = "osType") - private OperatingSystemTypes osType; - - /* - * The hypervisor generation of the Virtual Machine. Applicable to OS disks - * only. - */ - @JsonProperty(value = "hyperVGeneration") - private HyperVGeneration hyperVGeneration; - - /* - * Disk source information. CreationData information cannot be changed - * after the disk has been created. - */ - @JsonProperty(value = "creationData", required = true) - private CreationData creationData; - - /* - * If creationData.createOption is Empty, this field is mandatory and it - * indicates the size of the disk to create. If this field is present for - * updates or creation with other options, it indicates a resize. Resizes - * are only allowed if the disk is not attached to a running VM, and can - * only increase the disk's size. - */ - @JsonProperty(value = "diskSizeGB") - private Integer diskSizeGB; - - /* - * The size of the disk in bytes. This field is read only. - */ - @JsonProperty(value = "diskSizeBytes", access = JsonProperty.Access.WRITE_ONLY) - private Long diskSizeBytes; - - /* - * Unique Guid identifying the resource. - */ - @JsonProperty(value = "uniqueId", access = JsonProperty.Access.WRITE_ONLY) - private String uniqueId; - - /* - * Encryption settings collection used be Azure Disk Encryption, can - * contain multiple encryption settings per disk or snapshot. - */ - @JsonProperty(value = "encryptionSettingsCollection") - private EncryptionSettingsCollection encryptionSettingsCollection; - - /* - * The disk provisioning state. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; - - /* - * Whether a snapshot is incremental. Incremental snapshots on the same - * disk occupy less space than full snapshots and can be diffed. - */ - @JsonProperty(value = "incremental") - private Boolean incremental; - - /* - * Encryption property can be used to encrypt data at rest with customer - * managed keys or platform managed keys. - */ - @JsonProperty(value = "encryption") - private Encryption encryption; - - /** - * Get the timeCreated property: The time when the disk was created. - * - * @return the timeCreated value. - */ - public OffsetDateTime timeCreated() { - return this.timeCreated; - } - - /** - * Get the osType property: The Operating System type. - * - * @return the osType value. - */ - public OperatingSystemTypes osType() { - return this.osType; - } - - /** - * Set the osType property: The Operating System type. - * - * @param osType the osType value to set. - * @return the SnapshotProperties object itself. - */ - public SnapshotProperties withOsType(OperatingSystemTypes osType) { - this.osType = osType; - return this; - } - - /** - * Get the hyperVGeneration property: The hypervisor generation of the Virtual Machine. Applicable to OS disks only. - * - * @return the hyperVGeneration value. - */ - public HyperVGeneration hyperVGeneration() { - return this.hyperVGeneration; - } - - /** - * Set the hyperVGeneration property: The hypervisor generation of the Virtual Machine. Applicable to OS disks only. - * - * @param hyperVGeneration the hyperVGeneration value to set. - * @return the SnapshotProperties object itself. - */ - public SnapshotProperties withHyperVGeneration(HyperVGeneration hyperVGeneration) { - this.hyperVGeneration = hyperVGeneration; - return this; - } - - /** - * Get the creationData property: Disk source information. CreationData information cannot be changed after the disk - * has been created. - * - * @return the creationData value. - */ - public CreationData creationData() { - return this.creationData; - } - - /** - * Set the creationData property: Disk source information. CreationData information cannot be changed after the disk - * has been created. - * - * @param creationData the creationData value to set. - * @return the SnapshotProperties object itself. - */ - public SnapshotProperties withCreationData(CreationData creationData) { - this.creationData = creationData; - return this; - } - - /** - * Get the diskSizeGB property: If creationData.createOption is Empty, this field is mandatory and it indicates the - * size of the disk to create. If this field is present for updates or creation with other options, it indicates a - * resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's - * size. - * - * @return the diskSizeGB value. - */ - public Integer diskSizeGB() { - return this.diskSizeGB; - } - - /** - * Set the diskSizeGB property: If creationData.createOption is Empty, this field is mandatory and it indicates the - * size of the disk to create. If this field is present for updates or creation with other options, it indicates a - * resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's - * size. - * - * @param diskSizeGB the diskSizeGB value to set. - * @return the SnapshotProperties object itself. - */ - public SnapshotProperties withDiskSizeGB(Integer diskSizeGB) { - this.diskSizeGB = diskSizeGB; - return this; - } - - /** - * Get the diskSizeBytes property: The size of the disk in bytes. This field is read only. - * - * @return the diskSizeBytes value. - */ - public Long diskSizeBytes() { - return this.diskSizeBytes; - } - - /** - * Get the uniqueId property: Unique Guid identifying the resource. - * - * @return the uniqueId value. - */ - public String uniqueId() { - return this.uniqueId; - } - - /** - * Get the encryptionSettingsCollection property: Encryption settings collection used be Azure Disk Encryption, can - * contain multiple encryption settings per disk or snapshot. - * - * @return the encryptionSettingsCollection value. - */ - public EncryptionSettingsCollection encryptionSettingsCollection() { - return this.encryptionSettingsCollection; - } - - /** - * Set the encryptionSettingsCollection property: Encryption settings collection used be Azure Disk Encryption, can - * contain multiple encryption settings per disk or snapshot. - * - * @param encryptionSettingsCollection the encryptionSettingsCollection value to set. - * @return the SnapshotProperties object itself. - */ - public SnapshotProperties withEncryptionSettingsCollection( - EncryptionSettingsCollection encryptionSettingsCollection) { - this.encryptionSettingsCollection = encryptionSettingsCollection; - return this; - } - - /** - * Get the provisioningState property: The disk provisioning state. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Get the incremental property: Whether a snapshot is incremental. Incremental snapshots on the same disk occupy - * less space than full snapshots and can be diffed. - * - * @return the incremental value. - */ - public Boolean incremental() { - return this.incremental; - } - - /** - * Set the incremental property: Whether a snapshot is incremental. Incremental snapshots on the same disk occupy - * less space than full snapshots and can be diffed. - * - * @param incremental the incremental value to set. - * @return the SnapshotProperties object itself. - */ - public SnapshotProperties withIncremental(Boolean incremental) { - this.incremental = incremental; - return this; - } - - /** - * Get the encryption property: Encryption property can be used to encrypt data at rest with customer managed keys - * or platform managed keys. - * - * @return the encryption value. - */ - public Encryption encryption() { - return this.encryption; - } - - /** - * Set the encryption property: Encryption property can be used to encrypt data at rest with customer managed keys - * or platform managed keys. - * - * @param encryption the encryption value to set. - * @return the SnapshotProperties object itself. - */ - public SnapshotProperties withEncryption(Encryption encryption) { - this.encryption = encryption; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (creationData() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property creationData in model SnapshotProperties")); - } else { - creationData().validate(); - } - if (encryptionSettingsCollection() != null) { - encryptionSettingsCollection().validate(); - } - if (encryption() != null) { - encryption().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/SnapshotUpdateProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/SnapshotUpdateProperties.java deleted file mode 100644 index f14fa1fb5910..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/SnapshotUpdateProperties.java +++ /dev/null @@ -1,154 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.models.Encryption; -import com.azure.resourcemanager.compute.models.EncryptionSettingsCollection; -import com.azure.resourcemanager.compute.models.OperatingSystemTypes; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Snapshot resource update properties. */ -@Fluent -public final class SnapshotUpdateProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SnapshotUpdateProperties.class); - - /* - * the Operating System type. - */ - @JsonProperty(value = "osType") - private OperatingSystemTypes osType; - - /* - * If creationData.createOption is Empty, this field is mandatory and it - * indicates the size of the disk to create. If this field is present for - * updates or creation with other options, it indicates a resize. Resizes - * are only allowed if the disk is not attached to a running VM, and can - * only increase the disk's size. - */ - @JsonProperty(value = "diskSizeGB") - private Integer diskSizeGB; - - /* - * Encryption settings collection used be Azure Disk Encryption, can - * contain multiple encryption settings per disk or snapshot. - */ - @JsonProperty(value = "encryptionSettingsCollection") - private EncryptionSettingsCollection encryptionSettingsCollection; - - /* - * Encryption property can be used to encrypt data at rest with customer - * managed keys or platform managed keys. - */ - @JsonProperty(value = "encryption") - private Encryption encryption; - - /** - * Get the osType property: the Operating System type. - * - * @return the osType value. - */ - public OperatingSystemTypes osType() { - return this.osType; - } - - /** - * Set the osType property: the Operating System type. - * - * @param osType the osType value to set. - * @return the SnapshotUpdateProperties object itself. - */ - public SnapshotUpdateProperties withOsType(OperatingSystemTypes osType) { - this.osType = osType; - return this; - } - - /** - * Get the diskSizeGB property: If creationData.createOption is Empty, this field is mandatory and it indicates the - * size of the disk to create. If this field is present for updates or creation with other options, it indicates a - * resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's - * size. - * - * @return the diskSizeGB value. - */ - public Integer diskSizeGB() { - return this.diskSizeGB; - } - - /** - * Set the diskSizeGB property: If creationData.createOption is Empty, this field is mandatory and it indicates the - * size of the disk to create. If this field is present for updates or creation with other options, it indicates a - * resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's - * size. - * - * @param diskSizeGB the diskSizeGB value to set. - * @return the SnapshotUpdateProperties object itself. - */ - public SnapshotUpdateProperties withDiskSizeGB(Integer diskSizeGB) { - this.diskSizeGB = diskSizeGB; - return this; - } - - /** - * Get the encryptionSettingsCollection property: Encryption settings collection used be Azure Disk Encryption, can - * contain multiple encryption settings per disk or snapshot. - * - * @return the encryptionSettingsCollection value. - */ - public EncryptionSettingsCollection encryptionSettingsCollection() { - return this.encryptionSettingsCollection; - } - - /** - * Set the encryptionSettingsCollection property: Encryption settings collection used be Azure Disk Encryption, can - * contain multiple encryption settings per disk or snapshot. - * - * @param encryptionSettingsCollection the encryptionSettingsCollection value to set. - * @return the SnapshotUpdateProperties object itself. - */ - public SnapshotUpdateProperties withEncryptionSettingsCollection( - EncryptionSettingsCollection encryptionSettingsCollection) { - this.encryptionSettingsCollection = encryptionSettingsCollection; - return this; - } - - /** - * Get the encryption property: Encryption property can be used to encrypt data at rest with customer managed keys - * or platform managed keys. - * - * @return the encryption value. - */ - public Encryption encryption() { - return this.encryption; - } - - /** - * Set the encryption property: Encryption property can be used to encrypt data at rest with customer managed keys - * or platform managed keys. - * - * @param encryption the encryption value to set. - * @return the SnapshotUpdateProperties object itself. - */ - public SnapshotUpdateProperties withEncryption(Encryption encryption) { - this.encryption = encryption; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (encryptionSettingsCollection() != null) { - encryptionSettingsCollection().validate(); - } - if (encryption() != null) { - encryption().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/SshPublicKeyGenerateKeyPairResultInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/SshPublicKeyGenerateKeyPairResultInner.java deleted file mode 100644 index 7fcb19a2b728..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/SshPublicKeyGenerateKeyPairResultInner.java +++ /dev/null @@ -1,130 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Response from generation of an SSH key pair. */ -@Fluent -public final class SshPublicKeyGenerateKeyPairResultInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SshPublicKeyGenerateKeyPairResultInner.class); - - /* - * Private key portion of the key pair used to authenticate to a virtual - * machine through ssh. The private key is returned in RFC3447 format and - * should be treated as a secret. - */ - @JsonProperty(value = "privateKey", required = true) - private String privateKey; - - /* - * Public key portion of the key pair used to authenticate to a virtual - * machine through ssh. The public key is in ssh-rsa format. - */ - @JsonProperty(value = "publicKey", required = true) - private String publicKey; - - /* - * The ARM resource id in the form of - * /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{SshPublicKeyName} - */ - @JsonProperty(value = "id", required = true) - private String id; - - /** - * Get the privateKey property: Private key portion of the key pair used to authenticate to a virtual machine - * through ssh. The private key is returned in RFC3447 format and should be treated as a secret. - * - * @return the privateKey value. - */ - public String privateKey() { - return this.privateKey; - } - - /** - * Set the privateKey property: Private key portion of the key pair used to authenticate to a virtual machine - * through ssh. The private key is returned in RFC3447 format and should be treated as a secret. - * - * @param privateKey the privateKey value to set. - * @return the SshPublicKeyGenerateKeyPairResultInner object itself. - */ - public SshPublicKeyGenerateKeyPairResultInner withPrivateKey(String privateKey) { - this.privateKey = privateKey; - return this; - } - - /** - * Get the publicKey property: Public key portion of the key pair used to authenticate to a virtual machine through - * ssh. The public key is in ssh-rsa format. - * - * @return the publicKey value. - */ - public String publicKey() { - return this.publicKey; - } - - /** - * Set the publicKey property: Public key portion of the key pair used to authenticate to a virtual machine through - * ssh. The public key is in ssh-rsa format. - * - * @param publicKey the publicKey value to set. - * @return the SshPublicKeyGenerateKeyPairResultInner object itself. - */ - public SshPublicKeyGenerateKeyPairResultInner withPublicKey(String publicKey) { - this.publicKey = publicKey; - return this; - } - - /** - * Get the id property: The ARM resource id in the form of - * /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{SshPublicKeyName}. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: The ARM resource id in the form of - * /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{SshPublicKeyName}. - * - * @param id the id value to set. - * @return the SshPublicKeyGenerateKeyPairResultInner object itself. - */ - public SshPublicKeyGenerateKeyPairResultInner withId(String id) { - this.id = id; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (privateKey() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property privateKey in model SshPublicKeyGenerateKeyPairResultInner")); - } - if (publicKey() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property publicKey in model SshPublicKeyGenerateKeyPairResultInner")); - } - if (id() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property id in model SshPublicKeyGenerateKeyPairResultInner")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/SshPublicKeyResourceInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/SshPublicKeyResourceInner.java deleted file mode 100644 index 7835ca48eab9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/SshPublicKeyResourceInner.java +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** Specifies information about the SSH public key. */ -@Fluent -public final class SshPublicKeyResourceInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SshPublicKeyResourceInner.class); - - /* - * Properties of the SSH public key. - */ - @JsonProperty(value = "properties") - private SshPublicKeyResourceProperties innerProperties; - - /** - * Get the innerProperties property: Properties of the SSH public key. - * - * @return the innerProperties value. - */ - private SshPublicKeyResourceProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public SshPublicKeyResourceInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public SshPublicKeyResourceInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the publicKey property: SSH public key used to authenticate to a virtual machine through ssh. If this - * property is not initially provided when the resource is created, the publicKey property will be populated when - * generateKeyPair is called. If the public key is provided upon resource creation, the provided public key needs to - * be at least 2048-bit and in ssh-rsa format. - * - * @return the publicKey value. - */ - public String publicKey() { - return this.innerProperties() == null ? null : this.innerProperties().publicKey(); - } - - /** - * Set the publicKey property: SSH public key used to authenticate to a virtual machine through ssh. If this - * property is not initially provided when the resource is created, the publicKey property will be populated when - * generateKeyPair is called. If the public key is provided upon resource creation, the provided public key needs to - * be at least 2048-bit and in ssh-rsa format. - * - * @param publicKey the publicKey value to set. - * @return the SshPublicKeyResourceInner object itself. - */ - public SshPublicKeyResourceInner withPublicKey(String publicKey) { - if (this.innerProperties() == null) { - this.innerProperties = new SshPublicKeyResourceProperties(); - } - this.innerProperties().withPublicKey(publicKey); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/SshPublicKeyResourceProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/SshPublicKeyResourceProperties.java deleted file mode 100644 index 23aa2d8dc228..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/SshPublicKeyResourceProperties.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Properties of the SSH public key. */ -@Fluent -public final class SshPublicKeyResourceProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SshPublicKeyResourceProperties.class); - - /* - * SSH public key used to authenticate to a virtual machine through ssh. If - * this property is not initially provided when the resource is created, - * the publicKey property will be populated when generateKeyPair is called. - * If the public key is provided upon resource creation, the provided - * public key needs to be at least 2048-bit and in ssh-rsa format. - */ - @JsonProperty(value = "publicKey") - private String publicKey; - - /** - * Get the publicKey property: SSH public key used to authenticate to a virtual machine through ssh. If this - * property is not initially provided when the resource is created, the publicKey property will be populated when - * generateKeyPair is called. If the public key is provided upon resource creation, the provided public key needs to - * be at least 2048-bit and in ssh-rsa format. - * - * @return the publicKey value. - */ - public String publicKey() { - return this.publicKey; - } - - /** - * Set the publicKey property: SSH public key used to authenticate to a virtual machine through ssh. If this - * property is not initially provided when the resource is created, the publicKey property will be populated when - * generateKeyPair is called. If the public key is provided upon resource creation, the provided public key needs to - * be at least 2048-bit and in ssh-rsa format. - * - * @param publicKey the publicKey value to set. - * @return the SshPublicKeyResourceProperties object itself. - */ - public SshPublicKeyResourceProperties withPublicKey(String publicKey) { - this.publicKey = publicKey; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/UpgradeOperationHistoricalStatusInfoInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/UpgradeOperationHistoricalStatusInfoInner.java deleted file mode 100644 index 2783c66f2d84..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/UpgradeOperationHistoricalStatusInfoInner.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.models.UpgradeOperationHistoricalStatusInfoProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Virtual Machine Scale Set OS Upgrade History operation response. */ -@Immutable -public final class UpgradeOperationHistoricalStatusInfoInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(UpgradeOperationHistoricalStatusInfoInner.class); - - /* - * Information about the properties of the upgrade operation. - */ - @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY) - private UpgradeOperationHistoricalStatusInfoProperties properties; - - /* - * Resource type - */ - @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) - private String type; - - /* - * Resource location - */ - @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) - private String location; - - /** - * Get the properties property: Information about the properties of the upgrade operation. - * - * @return the properties value. - */ - public UpgradeOperationHistoricalStatusInfoProperties properties() { - return this.properties; - } - - /** - * Get the type property: Resource type. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Get the location property: Resource location. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/UsageInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/UsageInner.java deleted file mode 100644 index d98094dd14a7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/UsageInner.java +++ /dev/null @@ -1,141 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.models.UsageName; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describes Compute Resource Usage. */ -@Fluent -public final class UsageInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(UsageInner.class); - - /* - * An enum describing the unit of usage measurement. - */ - @JsonProperty(value = "unit", required = true) - private String unit; - - /* - * The current usage of the resource. - */ - @JsonProperty(value = "currentValue", required = true) - private int currentValue; - - /* - * The maximum permitted usage of the resource. - */ - @JsonProperty(value = "limit", required = true) - private long limit; - - /* - * The name of the type of usage. - */ - @JsonProperty(value = "name", required = true) - private UsageName name; - - /** Creates an instance of UsageInner class. */ - public UsageInner() { - unit = "Count"; - } - - /** - * Get the unit property: An enum describing the unit of usage measurement. - * - * @return the unit value. - */ - public String unit() { - return this.unit; - } - - /** - * Set the unit property: An enum describing the unit of usage measurement. - * - * @param unit the unit value to set. - * @return the UsageInner object itself. - */ - public UsageInner withUnit(String unit) { - this.unit = unit; - return this; - } - - /** - * Get the currentValue property: The current usage of the resource. - * - * @return the currentValue value. - */ - public int currentValue() { - return this.currentValue; - } - - /** - * Set the currentValue property: The current usage of the resource. - * - * @param currentValue the currentValue value to set. - * @return the UsageInner object itself. - */ - public UsageInner withCurrentValue(int currentValue) { - this.currentValue = currentValue; - return this; - } - - /** - * Get the limit property: The maximum permitted usage of the resource. - * - * @return the limit value. - */ - public long limit() { - return this.limit; - } - - /** - * Set the limit property: The maximum permitted usage of the resource. - * - * @param limit the limit value to set. - * @return the UsageInner object itself. - */ - public UsageInner withLimit(long limit) { - this.limit = limit; - return this; - } - - /** - * Get the name property: The name of the type of usage. - * - * @return the name value. - */ - public UsageName name() { - return this.name; - } - - /** - * Set the name property: The name of the type of usage. - * - * @param name the name value to set. - * @return the UsageInner object itself. - */ - public UsageInner withName(UsageName name) { - this.name = name; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property name in model UsageInner")); - } else { - name().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineAssessPatchesResultInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineAssessPatchesResultInner.java deleted file mode 100644 index 5d26f71d58e7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineAssessPatchesResultInner.java +++ /dev/null @@ -1,168 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.models.ApiError; -import com.azure.resourcemanager.compute.models.PatchOperationStatus; -import com.azure.resourcemanager.compute.models.VirtualMachineSoftwarePatchProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; - -/** Describes the properties of an AssessPatches result. */ -@Immutable -public final class VirtualMachineAssessPatchesResultInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineAssessPatchesResultInner.class); - - /* - * The overall success or failure status of the operation. It remains - * "InProgress" until the operation completes. At that point it will become - * "Failed", "Succeeded", or "CompletedWithWarnings." - */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) - private PatchOperationStatus status; - - /* - * The activity ID of the operation that produced this result. It is used - * to correlate across CRP and extension logs. - */ - @JsonProperty(value = "assessmentActivityId", access = JsonProperty.Access.WRITE_ONLY) - private String assessmentActivityId; - - /* - * The overall reboot status of the VM. It will be true when partially - * installed patches require a reboot to complete installation but the - * reboot has not yet occurred. - */ - @JsonProperty(value = "rebootPending", access = JsonProperty.Access.WRITE_ONLY) - private Boolean rebootPending; - - /* - * The number of critical or security patches that have been detected as - * available and not yet installed. - */ - @JsonProperty(value = "criticalAndSecurityPatchCount", access = JsonProperty.Access.WRITE_ONLY) - private Integer criticalAndSecurityPatchCount; - - /* - * The number of all available patches excluding critical and security. - */ - @JsonProperty(value = "otherPatchCount", access = JsonProperty.Access.WRITE_ONLY) - private Integer otherPatchCount; - - /* - * The UTC timestamp when the operation began. - */ - @JsonProperty(value = "startDateTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime startDateTime; - - /* - * The list of patches that have been detected as available for - * installation. - */ - @JsonProperty(value = "patches", access = JsonProperty.Access.WRITE_ONLY) - private List patches; - - /* - * The errors that were encountered during execution of the operation. The - * details array contains the list of them. - */ - @JsonProperty(value = "error", access = JsonProperty.Access.WRITE_ONLY) - private ApiError error; - - /** - * Get the status property: The overall success or failure status of the operation. It remains "InProgress" until - * the operation completes. At that point it will become "Failed", "Succeeded", or "CompletedWithWarnings.". - * - * @return the status value. - */ - public PatchOperationStatus status() { - return this.status; - } - - /** - * Get the assessmentActivityId property: The activity ID of the operation that produced this result. It is used to - * correlate across CRP and extension logs. - * - * @return the assessmentActivityId value. - */ - public String assessmentActivityId() { - return this.assessmentActivityId; - } - - /** - * Get the rebootPending property: The overall reboot status of the VM. It will be true when partially installed - * patches require a reboot to complete installation but the reboot has not yet occurred. - * - * @return the rebootPending value. - */ - public Boolean rebootPending() { - return this.rebootPending; - } - - /** - * Get the criticalAndSecurityPatchCount property: The number of critical or security patches that have been - * detected as available and not yet installed. - * - * @return the criticalAndSecurityPatchCount value. - */ - public Integer criticalAndSecurityPatchCount() { - return this.criticalAndSecurityPatchCount; - } - - /** - * Get the otherPatchCount property: The number of all available patches excluding critical and security. - * - * @return the otherPatchCount value. - */ - public Integer otherPatchCount() { - return this.otherPatchCount; - } - - /** - * Get the startDateTime property: The UTC timestamp when the operation began. - * - * @return the startDateTime value. - */ - public OffsetDateTime startDateTime() { - return this.startDateTime; - } - - /** - * Get the patches property: The list of patches that have been detected as available for installation. - * - * @return the patches value. - */ - public List patches() { - return this.patches; - } - - /** - * Get the error property: The errors that were encountered during execution of the operation. The details array - * contains the list of them. - * - * @return the error value. - */ - public ApiError error() { - return this.error; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (patches() != null) { - patches().forEach(e -> e.validate()); - } - if (error() != null) { - error().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineCaptureResultInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineCaptureResultInner.java deleted file mode 100644 index 63d3cf49d71a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineCaptureResultInner.java +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Output of virtual machine capture operation. */ -@Fluent -public final class VirtualMachineCaptureResultInner extends SubResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineCaptureResultInner.class); - - /* - * the schema of the captured virtual machine - */ - @JsonProperty(value = "$schema", access = JsonProperty.Access.WRITE_ONLY) - private String schema; - - /* - * the version of the content - */ - @JsonProperty(value = "contentVersion", access = JsonProperty.Access.WRITE_ONLY) - private String contentVersion; - - /* - * parameters of the captured virtual machine - */ - @JsonProperty(value = "parameters", access = JsonProperty.Access.WRITE_ONLY) - private Object parameters; - - /* - * a list of resource items of the captured virtual machine - */ - @JsonProperty(value = "resources", access = JsonProperty.Access.WRITE_ONLY) - private List resources; - - /** - * Get the schema property: the schema of the captured virtual machine. - * - * @return the schema value. - */ - public String schema() { - return this.schema; - } - - /** - * Get the contentVersion property: the version of the content. - * - * @return the contentVersion value. - */ - public String contentVersion() { - return this.contentVersion; - } - - /** - * Get the parameters property: parameters of the captured virtual machine. - * - * @return the parameters value. - */ - public Object parameters() { - return this.parameters; - } - - /** - * Get the resources property: a list of resource items of the captured virtual machine. - * - * @return the resources value. - */ - public List resources() { - return this.resources; - } - - /** {@inheritDoc} */ - @Override - public VirtualMachineCaptureResultInner withId(String id) { - super.withId(id); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineExtensionImageInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineExtensionImageInner.java deleted file mode 100644 index e0acb3f764dd..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineExtensionImageInner.java +++ /dev/null @@ -1,179 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** Describes a Virtual Machine Extension Image. */ -@Fluent -public final class VirtualMachineExtensionImageInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineExtensionImageInner.class); - - /* - * Describes the properties of a Virtual Machine Extension Image. - */ - @JsonProperty(value = "properties") - private VirtualMachineExtensionImageProperties innerProperties; - - /** - * Get the innerProperties property: Describes the properties of a Virtual Machine Extension Image. - * - * @return the innerProperties value. - */ - private VirtualMachineExtensionImageProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public VirtualMachineExtensionImageInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public VirtualMachineExtensionImageInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the operatingSystem property: The operating system this extension supports. - * - * @return the operatingSystem value. - */ - public String operatingSystem() { - return this.innerProperties() == null ? null : this.innerProperties().operatingSystem(); - } - - /** - * Set the operatingSystem property: The operating system this extension supports. - * - * @param operatingSystem the operatingSystem value to set. - * @return the VirtualMachineExtensionImageInner object itself. - */ - public VirtualMachineExtensionImageInner withOperatingSystem(String operatingSystem) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineExtensionImageProperties(); - } - this.innerProperties().withOperatingSystem(operatingSystem); - return this; - } - - /** - * Get the computeRole property: The type of role (IaaS or PaaS) this extension supports. - * - * @return the computeRole value. - */ - public String computeRole() { - return this.innerProperties() == null ? null : this.innerProperties().computeRole(); - } - - /** - * Set the computeRole property: The type of role (IaaS or PaaS) this extension supports. - * - * @param computeRole the computeRole value to set. - * @return the VirtualMachineExtensionImageInner object itself. - */ - public VirtualMachineExtensionImageInner withComputeRole(String computeRole) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineExtensionImageProperties(); - } - this.innerProperties().withComputeRole(computeRole); - return this; - } - - /** - * Get the handlerSchema property: The schema defined by publisher, where extension consumers should provide - * settings in a matching schema. - * - * @return the handlerSchema value. - */ - public String handlerSchema() { - return this.innerProperties() == null ? null : this.innerProperties().handlerSchema(); - } - - /** - * Set the handlerSchema property: The schema defined by publisher, where extension consumers should provide - * settings in a matching schema. - * - * @param handlerSchema the handlerSchema value to set. - * @return the VirtualMachineExtensionImageInner object itself. - */ - public VirtualMachineExtensionImageInner withHandlerSchema(String handlerSchema) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineExtensionImageProperties(); - } - this.innerProperties().withHandlerSchema(handlerSchema); - return this; - } - - /** - * Get the vmScaleSetEnabled property: Whether the extension can be used on xRP VMScaleSets. By default existing - * extensions are usable on scalesets, but there might be cases where a publisher wants to explicitly indicate the - * extension is only enabled for CRP VMs but not VMSS. - * - * @return the vmScaleSetEnabled value. - */ - public Boolean vmScaleSetEnabled() { - return this.innerProperties() == null ? null : this.innerProperties().vmScaleSetEnabled(); - } - - /** - * Set the vmScaleSetEnabled property: Whether the extension can be used on xRP VMScaleSets. By default existing - * extensions are usable on scalesets, but there might be cases where a publisher wants to explicitly indicate the - * extension is only enabled for CRP VMs but not VMSS. - * - * @param vmScaleSetEnabled the vmScaleSetEnabled value to set. - * @return the VirtualMachineExtensionImageInner object itself. - */ - public VirtualMachineExtensionImageInner withVmScaleSetEnabled(Boolean vmScaleSetEnabled) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineExtensionImageProperties(); - } - this.innerProperties().withVmScaleSetEnabled(vmScaleSetEnabled); - return this; - } - - /** - * Get the supportsMultipleExtensions property: Whether the handler can support multiple extensions. - * - * @return the supportsMultipleExtensions value. - */ - public Boolean supportsMultipleExtensions() { - return this.innerProperties() == null ? null : this.innerProperties().supportsMultipleExtensions(); - } - - /** - * Set the supportsMultipleExtensions property: Whether the handler can support multiple extensions. - * - * @param supportsMultipleExtensions the supportsMultipleExtensions value to set. - * @return the VirtualMachineExtensionImageInner object itself. - */ - public VirtualMachineExtensionImageInner withSupportsMultipleExtensions(Boolean supportsMultipleExtensions) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineExtensionImageProperties(); - } - this.innerProperties().withSupportsMultipleExtensions(supportsMultipleExtensions); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineExtensionImageProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineExtensionImageProperties.java deleted file mode 100644 index ceb6ee3149c9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineExtensionImageProperties.java +++ /dev/null @@ -1,182 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describes the properties of a Virtual Machine Extension Image. */ -@Fluent -public final class VirtualMachineExtensionImageProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineExtensionImageProperties.class); - - /* - * The operating system this extension supports. - */ - @JsonProperty(value = "operatingSystem", required = true) - private String operatingSystem; - - /* - * The type of role (IaaS or PaaS) this extension supports. - */ - @JsonProperty(value = "computeRole", required = true) - private String computeRole; - - /* - * The schema defined by publisher, where extension consumers should - * provide settings in a matching schema. - */ - @JsonProperty(value = "handlerSchema", required = true) - private String handlerSchema; - - /* - * Whether the extension can be used on xRP VMScaleSets. By default - * existing extensions are usable on scalesets, but there might be cases - * where a publisher wants to explicitly indicate the extension is only - * enabled for CRP VMs but not VMSS. - */ - @JsonProperty(value = "vmScaleSetEnabled") - private Boolean vmScaleSetEnabled; - - /* - * Whether the handler can support multiple extensions. - */ - @JsonProperty(value = "supportsMultipleExtensions") - private Boolean supportsMultipleExtensions; - - /** - * Get the operatingSystem property: The operating system this extension supports. - * - * @return the operatingSystem value. - */ - public String operatingSystem() { - return this.operatingSystem; - } - - /** - * Set the operatingSystem property: The operating system this extension supports. - * - * @param operatingSystem the operatingSystem value to set. - * @return the VirtualMachineExtensionImageProperties object itself. - */ - public VirtualMachineExtensionImageProperties withOperatingSystem(String operatingSystem) { - this.operatingSystem = operatingSystem; - return this; - } - - /** - * Get the computeRole property: The type of role (IaaS or PaaS) this extension supports. - * - * @return the computeRole value. - */ - public String computeRole() { - return this.computeRole; - } - - /** - * Set the computeRole property: The type of role (IaaS or PaaS) this extension supports. - * - * @param computeRole the computeRole value to set. - * @return the VirtualMachineExtensionImageProperties object itself. - */ - public VirtualMachineExtensionImageProperties withComputeRole(String computeRole) { - this.computeRole = computeRole; - return this; - } - - /** - * Get the handlerSchema property: The schema defined by publisher, where extension consumers should provide - * settings in a matching schema. - * - * @return the handlerSchema value. - */ - public String handlerSchema() { - return this.handlerSchema; - } - - /** - * Set the handlerSchema property: The schema defined by publisher, where extension consumers should provide - * settings in a matching schema. - * - * @param handlerSchema the handlerSchema value to set. - * @return the VirtualMachineExtensionImageProperties object itself. - */ - public VirtualMachineExtensionImageProperties withHandlerSchema(String handlerSchema) { - this.handlerSchema = handlerSchema; - return this; - } - - /** - * Get the vmScaleSetEnabled property: Whether the extension can be used on xRP VMScaleSets. By default existing - * extensions are usable on scalesets, but there might be cases where a publisher wants to explicitly indicate the - * extension is only enabled for CRP VMs but not VMSS. - * - * @return the vmScaleSetEnabled value. - */ - public Boolean vmScaleSetEnabled() { - return this.vmScaleSetEnabled; - } - - /** - * Set the vmScaleSetEnabled property: Whether the extension can be used on xRP VMScaleSets. By default existing - * extensions are usable on scalesets, but there might be cases where a publisher wants to explicitly indicate the - * extension is only enabled for CRP VMs but not VMSS. - * - * @param vmScaleSetEnabled the vmScaleSetEnabled value to set. - * @return the VirtualMachineExtensionImageProperties object itself. - */ - public VirtualMachineExtensionImageProperties withVmScaleSetEnabled(Boolean vmScaleSetEnabled) { - this.vmScaleSetEnabled = vmScaleSetEnabled; - return this; - } - - /** - * Get the supportsMultipleExtensions property: Whether the handler can support multiple extensions. - * - * @return the supportsMultipleExtensions value. - */ - public Boolean supportsMultipleExtensions() { - return this.supportsMultipleExtensions; - } - - /** - * Set the supportsMultipleExtensions property: Whether the handler can support multiple extensions. - * - * @param supportsMultipleExtensions the supportsMultipleExtensions value to set. - * @return the VirtualMachineExtensionImageProperties object itself. - */ - public VirtualMachineExtensionImageProperties withSupportsMultipleExtensions(Boolean supportsMultipleExtensions) { - this.supportsMultipleExtensions = supportsMultipleExtensions; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (operatingSystem() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property operatingSystem in model VirtualMachineExtensionImageProperties")); - } - if (computeRole() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property computeRole in model VirtualMachineExtensionImageProperties")); - } - if (handlerSchema() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property handlerSchema in model VirtualMachineExtensionImageProperties")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineExtensionInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineExtensionInner.java deleted file mode 100644 index f37bd10a6be2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineExtensionInner.java +++ /dev/null @@ -1,285 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.models.VirtualMachineExtensionInstanceView; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** Describes a Virtual Machine Extension. */ -@Fluent -public final class VirtualMachineExtensionInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineExtensionInner.class); - - /* - * Describes the properties of a Virtual Machine Extension. - */ - @JsonProperty(value = "properties") - private VirtualMachineExtensionProperties innerProperties; - - /** - * Get the innerProperties property: Describes the properties of a Virtual Machine Extension. - * - * @return the innerProperties value. - */ - private VirtualMachineExtensionProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public VirtualMachineExtensionInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public VirtualMachineExtensionInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the forceUpdateTag property: How the extension handler should be forced to update even if the extension - * configuration has not changed. - * - * @return the forceUpdateTag value. - */ - public String forceUpdateTag() { - return this.innerProperties() == null ? null : this.innerProperties().forceUpdateTag(); - } - - /** - * Set the forceUpdateTag property: How the extension handler should be forced to update even if the extension - * configuration has not changed. - * - * @param forceUpdateTag the forceUpdateTag value to set. - * @return the VirtualMachineExtensionInner object itself. - */ - public VirtualMachineExtensionInner withForceUpdateTag(String forceUpdateTag) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineExtensionProperties(); - } - this.innerProperties().withForceUpdateTag(forceUpdateTag); - return this; - } - - /** - * Get the publisher property: The name of the extension handler publisher. - * - * @return the publisher value. - */ - public String publisher() { - return this.innerProperties() == null ? null : this.innerProperties().publisher(); - } - - /** - * Set the publisher property: The name of the extension handler publisher. - * - * @param publisher the publisher value to set. - * @return the VirtualMachineExtensionInner object itself. - */ - public VirtualMachineExtensionInner withPublisher(String publisher) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineExtensionProperties(); - } - this.innerProperties().withPublisher(publisher); - return this; - } - - /** - * Get the type property: Specifies the type of the extension; an example is "CustomScriptExtension". - * - * @return the type value. - */ - public String typePropertiesType() { - return this.innerProperties() == null ? null : this.innerProperties().type(); - } - - /** - * Set the type property: Specifies the type of the extension; an example is "CustomScriptExtension". - * - * @param type the type value to set. - * @return the VirtualMachineExtensionInner object itself. - */ - public VirtualMachineExtensionInner withTypePropertiesType(String type) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineExtensionProperties(); - } - this.innerProperties().withType(type); - return this; - } - - /** - * Get the typeHandlerVersion property: Specifies the version of the script handler. - * - * @return the typeHandlerVersion value. - */ - public String typeHandlerVersion() { - return this.innerProperties() == null ? null : this.innerProperties().typeHandlerVersion(); - } - - /** - * Set the typeHandlerVersion property: Specifies the version of the script handler. - * - * @param typeHandlerVersion the typeHandlerVersion value to set. - * @return the VirtualMachineExtensionInner object itself. - */ - public VirtualMachineExtensionInner withTypeHandlerVersion(String typeHandlerVersion) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineExtensionProperties(); - } - this.innerProperties().withTypeHandlerVersion(typeHandlerVersion); - return this; - } - - /** - * Get the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one - * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless - * redeployed, even with this property set to true. - * - * @return the autoUpgradeMinorVersion value. - */ - public Boolean autoUpgradeMinorVersion() { - return this.innerProperties() == null ? null : this.innerProperties().autoUpgradeMinorVersion(); - } - - /** - * Set the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one - * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless - * redeployed, even with this property set to true. - * - * @param autoUpgradeMinorVersion the autoUpgradeMinorVersion value to set. - * @return the VirtualMachineExtensionInner object itself. - */ - public VirtualMachineExtensionInner withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineExtensionProperties(); - } - this.innerProperties().withAutoUpgradeMinorVersion(autoUpgradeMinorVersion); - return this; - } - - /** - * Get the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the - * platform if there is a newer version of the extension available. - * - * @return the enableAutomaticUpgrade value. - */ - public Boolean enableAutomaticUpgrade() { - return this.innerProperties() == null ? null : this.innerProperties().enableAutomaticUpgrade(); - } - - /** - * Set the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the - * platform if there is a newer version of the extension available. - * - * @param enableAutomaticUpgrade the enableAutomaticUpgrade value to set. - * @return the VirtualMachineExtensionInner object itself. - */ - public VirtualMachineExtensionInner withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineExtensionProperties(); - } - this.innerProperties().withEnableAutomaticUpgrade(enableAutomaticUpgrade); - return this; - } - - /** - * Get the settings property: Json formatted public settings for the extension. - * - * @return the settings value. - */ - public Object settings() { - return this.innerProperties() == null ? null : this.innerProperties().settings(); - } - - /** - * Set the settings property: Json formatted public settings for the extension. - * - * @param settings the settings value to set. - * @return the VirtualMachineExtensionInner object itself. - */ - public VirtualMachineExtensionInner withSettings(Object settings) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineExtensionProperties(); - } - this.innerProperties().withSettings(settings); - return this; - } - - /** - * Get the protectedSettings property: The extension can contain either protectedSettings or - * protectedSettingsFromKeyVault or no protected settings at all. - * - * @return the protectedSettings value. - */ - public Object protectedSettings() { - return this.innerProperties() == null ? null : this.innerProperties().protectedSettings(); - } - - /** - * Set the protectedSettings property: The extension can contain either protectedSettings or - * protectedSettingsFromKeyVault or no protected settings at all. - * - * @param protectedSettings the protectedSettings value to set. - * @return the VirtualMachineExtensionInner object itself. - */ - public VirtualMachineExtensionInner withProtectedSettings(Object protectedSettings) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineExtensionProperties(); - } - this.innerProperties().withProtectedSettings(protectedSettings); - return this; - } - - /** - * Get the provisioningState property: The provisioning state, which only appears in the response. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the instanceView property: The virtual machine extension instance view. - * - * @return the instanceView value. - */ - public VirtualMachineExtensionInstanceView instanceView() { - return this.innerProperties() == null ? null : this.innerProperties().instanceView(); - } - - /** - * Set the instanceView property: The virtual machine extension instance view. - * - * @param instanceView the instanceView value to set. - * @return the VirtualMachineExtensionInner object itself. - */ - public VirtualMachineExtensionInner withInstanceView(VirtualMachineExtensionInstanceView instanceView) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineExtensionProperties(); - } - this.innerProperties().withInstanceView(instanceView); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineExtensionProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineExtensionProperties.java deleted file mode 100644 index c55b78186d14..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineExtensionProperties.java +++ /dev/null @@ -1,294 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.models.VirtualMachineExtensionInstanceView; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describes the properties of a Virtual Machine Extension. */ -@Fluent -public final class VirtualMachineExtensionProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineExtensionProperties.class); - - /* - * How the extension handler should be forced to update even if the - * extension configuration has not changed. - */ - @JsonProperty(value = "forceUpdateTag") - private String forceUpdateTag; - - /* - * The name of the extension handler publisher. - */ - @JsonProperty(value = "publisher") - private String publisher; - - /* - * Specifies the type of the extension; an example is - * "CustomScriptExtension". - */ - @JsonProperty(value = "type") - private String type; - - /* - * Specifies the version of the script handler. - */ - @JsonProperty(value = "typeHandlerVersion") - private String typeHandlerVersion; - - /* - * Indicates whether the extension should use a newer minor version if one - * is available at deployment time. Once deployed, however, the extension - * will not upgrade minor versions unless redeployed, even with this - * property set to true. - */ - @JsonProperty(value = "autoUpgradeMinorVersion") - private Boolean autoUpgradeMinorVersion; - - /* - * Indicates whether the extension should be automatically upgraded by the - * platform if there is a newer version of the extension available. - */ - @JsonProperty(value = "enableAutomaticUpgrade") - private Boolean enableAutomaticUpgrade; - - /* - * Json formatted public settings for the extension. - */ - @JsonProperty(value = "settings") - private Object settings; - - /* - * The extension can contain either protectedSettings or - * protectedSettingsFromKeyVault or no protected settings at all. - */ - @JsonProperty(value = "protectedSettings") - private Object protectedSettings; - - /* - * The provisioning state, which only appears in the response. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; - - /* - * The virtual machine extension instance view. - */ - @JsonProperty(value = "instanceView") - private VirtualMachineExtensionInstanceView instanceView; - - /** - * Get the forceUpdateTag property: How the extension handler should be forced to update even if the extension - * configuration has not changed. - * - * @return the forceUpdateTag value. - */ - public String forceUpdateTag() { - return this.forceUpdateTag; - } - - /** - * Set the forceUpdateTag property: How the extension handler should be forced to update even if the extension - * configuration has not changed. - * - * @param forceUpdateTag the forceUpdateTag value to set. - * @return the VirtualMachineExtensionProperties object itself. - */ - public VirtualMachineExtensionProperties withForceUpdateTag(String forceUpdateTag) { - this.forceUpdateTag = forceUpdateTag; - return this; - } - - /** - * Get the publisher property: The name of the extension handler publisher. - * - * @return the publisher value. - */ - public String publisher() { - return this.publisher; - } - - /** - * Set the publisher property: The name of the extension handler publisher. - * - * @param publisher the publisher value to set. - * @return the VirtualMachineExtensionProperties object itself. - */ - public VirtualMachineExtensionProperties withPublisher(String publisher) { - this.publisher = publisher; - return this; - } - - /** - * Get the type property: Specifies the type of the extension; an example is "CustomScriptExtension". - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Set the type property: Specifies the type of the extension; an example is "CustomScriptExtension". - * - * @param type the type value to set. - * @return the VirtualMachineExtensionProperties object itself. - */ - public VirtualMachineExtensionProperties withType(String type) { - this.type = type; - return this; - } - - /** - * Get the typeHandlerVersion property: Specifies the version of the script handler. - * - * @return the typeHandlerVersion value. - */ - public String typeHandlerVersion() { - return this.typeHandlerVersion; - } - - /** - * Set the typeHandlerVersion property: Specifies the version of the script handler. - * - * @param typeHandlerVersion the typeHandlerVersion value to set. - * @return the VirtualMachineExtensionProperties object itself. - */ - public VirtualMachineExtensionProperties withTypeHandlerVersion(String typeHandlerVersion) { - this.typeHandlerVersion = typeHandlerVersion; - return this; - } - - /** - * Get the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one - * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless - * redeployed, even with this property set to true. - * - * @return the autoUpgradeMinorVersion value. - */ - public Boolean autoUpgradeMinorVersion() { - return this.autoUpgradeMinorVersion; - } - - /** - * Set the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one - * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless - * redeployed, even with this property set to true. - * - * @param autoUpgradeMinorVersion the autoUpgradeMinorVersion value to set. - * @return the VirtualMachineExtensionProperties object itself. - */ - public VirtualMachineExtensionProperties withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion) { - this.autoUpgradeMinorVersion = autoUpgradeMinorVersion; - return this; - } - - /** - * Get the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the - * platform if there is a newer version of the extension available. - * - * @return the enableAutomaticUpgrade value. - */ - public Boolean enableAutomaticUpgrade() { - return this.enableAutomaticUpgrade; - } - - /** - * Set the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the - * platform if there is a newer version of the extension available. - * - * @param enableAutomaticUpgrade the enableAutomaticUpgrade value to set. - * @return the VirtualMachineExtensionProperties object itself. - */ - public VirtualMachineExtensionProperties withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade) { - this.enableAutomaticUpgrade = enableAutomaticUpgrade; - return this; - } - - /** - * Get the settings property: Json formatted public settings for the extension. - * - * @return the settings value. - */ - public Object settings() { - return this.settings; - } - - /** - * Set the settings property: Json formatted public settings for the extension. - * - * @param settings the settings value to set. - * @return the VirtualMachineExtensionProperties object itself. - */ - public VirtualMachineExtensionProperties withSettings(Object settings) { - this.settings = settings; - return this; - } - - /** - * Get the protectedSettings property: The extension can contain either protectedSettings or - * protectedSettingsFromKeyVault or no protected settings at all. - * - * @return the protectedSettings value. - */ - public Object protectedSettings() { - return this.protectedSettings; - } - - /** - * Set the protectedSettings property: The extension can contain either protectedSettings or - * protectedSettingsFromKeyVault or no protected settings at all. - * - * @param protectedSettings the protectedSettings value to set. - * @return the VirtualMachineExtensionProperties object itself. - */ - public VirtualMachineExtensionProperties withProtectedSettings(Object protectedSettings) { - this.protectedSettings = protectedSettings; - return this; - } - - /** - * Get the provisioningState property: The provisioning state, which only appears in the response. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Get the instanceView property: The virtual machine extension instance view. - * - * @return the instanceView value. - */ - public VirtualMachineExtensionInstanceView instanceView() { - return this.instanceView; - } - - /** - * Set the instanceView property: The virtual machine extension instance view. - * - * @param instanceView the instanceView value to set. - * @return the VirtualMachineExtensionProperties object itself. - */ - public VirtualMachineExtensionProperties withInstanceView(VirtualMachineExtensionInstanceView instanceView) { - this.instanceView = instanceView; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (instanceView() != null) { - instanceView().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineExtensionUpdateProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineExtensionUpdateProperties.java deleted file mode 100644 index 663b6837094c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineExtensionUpdateProperties.java +++ /dev/null @@ -1,249 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describes the properties of a Virtual Machine Extension. */ -@Fluent -public final class VirtualMachineExtensionUpdateProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineExtensionUpdateProperties.class); - - /* - * How the extension handler should be forced to update even if the - * extension configuration has not changed. - */ - @JsonProperty(value = "forceUpdateTag") - private String forceUpdateTag; - - /* - * The name of the extension handler publisher. - */ - @JsonProperty(value = "publisher") - private String publisher; - - /* - * Specifies the type of the extension; an example is - * "CustomScriptExtension". - */ - @JsonProperty(value = "type") - private String type; - - /* - * Specifies the version of the script handler. - */ - @JsonProperty(value = "typeHandlerVersion") - private String typeHandlerVersion; - - /* - * Indicates whether the extension should use a newer minor version if one - * is available at deployment time. Once deployed, however, the extension - * will not upgrade minor versions unless redeployed, even with this - * property set to true. - */ - @JsonProperty(value = "autoUpgradeMinorVersion") - private Boolean autoUpgradeMinorVersion; - - /* - * Indicates whether the extension should be automatically upgraded by the - * platform if there is a newer version of the extension available. - */ - @JsonProperty(value = "enableAutomaticUpgrade") - private Boolean enableAutomaticUpgrade; - - /* - * Json formatted public settings for the extension. - */ - @JsonProperty(value = "settings") - private Object settings; - - /* - * The extension can contain either protectedSettings or - * protectedSettingsFromKeyVault or no protected settings at all. - */ - @JsonProperty(value = "protectedSettings") - private Object protectedSettings; - - /** - * Get the forceUpdateTag property: How the extension handler should be forced to update even if the extension - * configuration has not changed. - * - * @return the forceUpdateTag value. - */ - public String forceUpdateTag() { - return this.forceUpdateTag; - } - - /** - * Set the forceUpdateTag property: How the extension handler should be forced to update even if the extension - * configuration has not changed. - * - * @param forceUpdateTag the forceUpdateTag value to set. - * @return the VirtualMachineExtensionUpdateProperties object itself. - */ - public VirtualMachineExtensionUpdateProperties withForceUpdateTag(String forceUpdateTag) { - this.forceUpdateTag = forceUpdateTag; - return this; - } - - /** - * Get the publisher property: The name of the extension handler publisher. - * - * @return the publisher value. - */ - public String publisher() { - return this.publisher; - } - - /** - * Set the publisher property: The name of the extension handler publisher. - * - * @param publisher the publisher value to set. - * @return the VirtualMachineExtensionUpdateProperties object itself. - */ - public VirtualMachineExtensionUpdateProperties withPublisher(String publisher) { - this.publisher = publisher; - return this; - } - - /** - * Get the type property: Specifies the type of the extension; an example is "CustomScriptExtension". - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Set the type property: Specifies the type of the extension; an example is "CustomScriptExtension". - * - * @param type the type value to set. - * @return the VirtualMachineExtensionUpdateProperties object itself. - */ - public VirtualMachineExtensionUpdateProperties withType(String type) { - this.type = type; - return this; - } - - /** - * Get the typeHandlerVersion property: Specifies the version of the script handler. - * - * @return the typeHandlerVersion value. - */ - public String typeHandlerVersion() { - return this.typeHandlerVersion; - } - - /** - * Set the typeHandlerVersion property: Specifies the version of the script handler. - * - * @param typeHandlerVersion the typeHandlerVersion value to set. - * @return the VirtualMachineExtensionUpdateProperties object itself. - */ - public VirtualMachineExtensionUpdateProperties withTypeHandlerVersion(String typeHandlerVersion) { - this.typeHandlerVersion = typeHandlerVersion; - return this; - } - - /** - * Get the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one - * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless - * redeployed, even with this property set to true. - * - * @return the autoUpgradeMinorVersion value. - */ - public Boolean autoUpgradeMinorVersion() { - return this.autoUpgradeMinorVersion; - } - - /** - * Set the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one - * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless - * redeployed, even with this property set to true. - * - * @param autoUpgradeMinorVersion the autoUpgradeMinorVersion value to set. - * @return the VirtualMachineExtensionUpdateProperties object itself. - */ - public VirtualMachineExtensionUpdateProperties withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion) { - this.autoUpgradeMinorVersion = autoUpgradeMinorVersion; - return this; - } - - /** - * Get the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the - * platform if there is a newer version of the extension available. - * - * @return the enableAutomaticUpgrade value. - */ - public Boolean enableAutomaticUpgrade() { - return this.enableAutomaticUpgrade; - } - - /** - * Set the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the - * platform if there is a newer version of the extension available. - * - * @param enableAutomaticUpgrade the enableAutomaticUpgrade value to set. - * @return the VirtualMachineExtensionUpdateProperties object itself. - */ - public VirtualMachineExtensionUpdateProperties withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade) { - this.enableAutomaticUpgrade = enableAutomaticUpgrade; - return this; - } - - /** - * Get the settings property: Json formatted public settings for the extension. - * - * @return the settings value. - */ - public Object settings() { - return this.settings; - } - - /** - * Set the settings property: Json formatted public settings for the extension. - * - * @param settings the settings value to set. - * @return the VirtualMachineExtensionUpdateProperties object itself. - */ - public VirtualMachineExtensionUpdateProperties withSettings(Object settings) { - this.settings = settings; - return this; - } - - /** - * Get the protectedSettings property: The extension can contain either protectedSettings or - * protectedSettingsFromKeyVault or no protected settings at all. - * - * @return the protectedSettings value. - */ - public Object protectedSettings() { - return this.protectedSettings; - } - - /** - * Set the protectedSettings property: The extension can contain either protectedSettings or - * protectedSettingsFromKeyVault or no protected settings at all. - * - * @param protectedSettings the protectedSettings value to set. - * @return the VirtualMachineExtensionUpdateProperties object itself. - */ - public VirtualMachineExtensionUpdateProperties withProtectedSettings(Object protectedSettings) { - this.protectedSettings = protectedSettings; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineExtensionsListResultInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineExtensionsListResultInner.java deleted file mode 100644 index 32dc0f88dcf9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineExtensionsListResultInner.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The List Extension operation response. */ -@Fluent -public final class VirtualMachineExtensionsListResultInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineExtensionsListResultInner.class); - - /* - * The list of extensions - */ - @JsonProperty(value = "value") - private List value; - - /** - * Get the value property: The list of extensions. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The list of extensions. - * - * @param value the value value to set. - * @return the VirtualMachineExtensionsListResultInner object itself. - */ - public VirtualMachineExtensionsListResultInner withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineImageInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineImageInner.java deleted file mode 100644 index c908d3b20ce5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineImageInner.java +++ /dev/null @@ -1,219 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.models.AutomaticOSUpgradeProperties; -import com.azure.resourcemanager.compute.models.DataDiskImage; -import com.azure.resourcemanager.compute.models.DisallowedConfiguration; -import com.azure.resourcemanager.compute.models.HyperVGenerationTypes; -import com.azure.resourcemanager.compute.models.OSDiskImage; -import com.azure.resourcemanager.compute.models.PurchasePlan; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** Describes a Virtual Machine Image. */ -@Fluent -public final class VirtualMachineImageInner extends VirtualMachineImageResourceInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineImageInner.class); - - /* - * Describes the properties of a Virtual Machine Image. - */ - @JsonProperty(value = "properties") - private VirtualMachineImageProperties innerProperties; - - /** - * Get the innerProperties property: Describes the properties of a Virtual Machine Image. - * - * @return the innerProperties value. - */ - private VirtualMachineImageProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public VirtualMachineImageInner withName(String name) { - super.withName(name); - return this; - } - - /** {@inheritDoc} */ - @Override - public VirtualMachineImageInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public VirtualMachineImageInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** {@inheritDoc} */ - @Override - public VirtualMachineImageInner withId(String id) { - super.withId(id); - return this; - } - - /** - * Get the plan property: Used for establishing the purchase context of any 3rd Party artifact through MarketPlace. - * - * @return the plan value. - */ - public PurchasePlan plan() { - return this.innerProperties() == null ? null : this.innerProperties().plan(); - } - - /** - * Set the plan property: Used for establishing the purchase context of any 3rd Party artifact through MarketPlace. - * - * @param plan the plan value to set. - * @return the VirtualMachineImageInner object itself. - */ - public VirtualMachineImageInner withPlan(PurchasePlan plan) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineImageProperties(); - } - this.innerProperties().withPlan(plan); - return this; - } - - /** - * Get the osDiskImage property: Contains the os disk image information. - * - * @return the osDiskImage value. - */ - public OSDiskImage osDiskImage() { - return this.innerProperties() == null ? null : this.innerProperties().osDiskImage(); - } - - /** - * Set the osDiskImage property: Contains the os disk image information. - * - * @param osDiskImage the osDiskImage value to set. - * @return the VirtualMachineImageInner object itself. - */ - public VirtualMachineImageInner withOsDiskImage(OSDiskImage osDiskImage) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineImageProperties(); - } - this.innerProperties().withOsDiskImage(osDiskImage); - return this; - } - - /** - * Get the dataDiskImages property: The dataDiskImages property. - * - * @return the dataDiskImages value. - */ - public List dataDiskImages() { - return this.innerProperties() == null ? null : this.innerProperties().dataDiskImages(); - } - - /** - * Set the dataDiskImages property: The dataDiskImages property. - * - * @param dataDiskImages the dataDiskImages value to set. - * @return the VirtualMachineImageInner object itself. - */ - public VirtualMachineImageInner withDataDiskImages(List dataDiskImages) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineImageProperties(); - } - this.innerProperties().withDataDiskImages(dataDiskImages); - return this; - } - - /** - * Get the automaticOSUpgradeProperties property: Describes automatic OS upgrade properties on the image. - * - * @return the automaticOSUpgradeProperties value. - */ - public AutomaticOSUpgradeProperties automaticOSUpgradeProperties() { - return this.innerProperties() == null ? null : this.innerProperties().automaticOSUpgradeProperties(); - } - - /** - * Set the automaticOSUpgradeProperties property: Describes automatic OS upgrade properties on the image. - * - * @param automaticOSUpgradeProperties the automaticOSUpgradeProperties value to set. - * @return the VirtualMachineImageInner object itself. - */ - public VirtualMachineImageInner withAutomaticOSUpgradeProperties( - AutomaticOSUpgradeProperties automaticOSUpgradeProperties) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineImageProperties(); - } - this.innerProperties().withAutomaticOSUpgradeProperties(automaticOSUpgradeProperties); - return this; - } - - /** - * Get the hyperVGeneration property: Specifies the HyperVGeneration Type. - * - * @return the hyperVGeneration value. - */ - public HyperVGenerationTypes hyperVGeneration() { - return this.innerProperties() == null ? null : this.innerProperties().hyperVGeneration(); - } - - /** - * Set the hyperVGeneration property: Specifies the HyperVGeneration Type. - * - * @param hyperVGeneration the hyperVGeneration value to set. - * @return the VirtualMachineImageInner object itself. - */ - public VirtualMachineImageInner withHyperVGeneration(HyperVGenerationTypes hyperVGeneration) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineImageProperties(); - } - this.innerProperties().withHyperVGeneration(hyperVGeneration); - return this; - } - - /** - * Get the disallowed property: Specifies disallowed configuration for the VirtualMachine created from the image. - * - * @return the disallowed value. - */ - public DisallowedConfiguration disallowed() { - return this.innerProperties() == null ? null : this.innerProperties().disallowed(); - } - - /** - * Set the disallowed property: Specifies disallowed configuration for the VirtualMachine created from the image. - * - * @param disallowed the disallowed value to set. - * @return the VirtualMachineImageInner object itself. - */ - public VirtualMachineImageInner withDisallowed(DisallowedConfiguration disallowed) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineImageProperties(); - } - this.innerProperties().withDisallowed(disallowed); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineImageProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineImageProperties.java deleted file mode 100644 index a59e9c7f38c5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineImageProperties.java +++ /dev/null @@ -1,205 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.models.AutomaticOSUpgradeProperties; -import com.azure.resourcemanager.compute.models.DataDiskImage; -import com.azure.resourcemanager.compute.models.DisallowedConfiguration; -import com.azure.resourcemanager.compute.models.HyperVGenerationTypes; -import com.azure.resourcemanager.compute.models.OSDiskImage; -import com.azure.resourcemanager.compute.models.PurchasePlan; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Describes the properties of a Virtual Machine Image. */ -@Fluent -public final class VirtualMachineImageProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineImageProperties.class); - - /* - * Used for establishing the purchase context of any 3rd Party artifact - * through MarketPlace. - */ - @JsonProperty(value = "plan") - private PurchasePlan plan; - - /* - * Contains the os disk image information. - */ - @JsonProperty(value = "osDiskImage") - private OSDiskImage osDiskImage; - - /* - * The dataDiskImages property. - */ - @JsonProperty(value = "dataDiskImages") - private List dataDiskImages; - - /* - * Describes automatic OS upgrade properties on the image. - */ - @JsonProperty(value = "automaticOSUpgradeProperties") - private AutomaticOSUpgradeProperties automaticOSUpgradeProperties; - - /* - * Specifies the HyperVGeneration Type - */ - @JsonProperty(value = "hyperVGeneration") - private HyperVGenerationTypes hyperVGeneration; - - /* - * Specifies disallowed configuration for the VirtualMachine created from - * the image - */ - @JsonProperty(value = "disallowed") - private DisallowedConfiguration disallowed; - - /** - * Get the plan property: Used for establishing the purchase context of any 3rd Party artifact through MarketPlace. - * - * @return the plan value. - */ - public PurchasePlan plan() { - return this.plan; - } - - /** - * Set the plan property: Used for establishing the purchase context of any 3rd Party artifact through MarketPlace. - * - * @param plan the plan value to set. - * @return the VirtualMachineImageProperties object itself. - */ - public VirtualMachineImageProperties withPlan(PurchasePlan plan) { - this.plan = plan; - return this; - } - - /** - * Get the osDiskImage property: Contains the os disk image information. - * - * @return the osDiskImage value. - */ - public OSDiskImage osDiskImage() { - return this.osDiskImage; - } - - /** - * Set the osDiskImage property: Contains the os disk image information. - * - * @param osDiskImage the osDiskImage value to set. - * @return the VirtualMachineImageProperties object itself. - */ - public VirtualMachineImageProperties withOsDiskImage(OSDiskImage osDiskImage) { - this.osDiskImage = osDiskImage; - return this; - } - - /** - * Get the dataDiskImages property: The dataDiskImages property. - * - * @return the dataDiskImages value. - */ - public List dataDiskImages() { - return this.dataDiskImages; - } - - /** - * Set the dataDiskImages property: The dataDiskImages property. - * - * @param dataDiskImages the dataDiskImages value to set. - * @return the VirtualMachineImageProperties object itself. - */ - public VirtualMachineImageProperties withDataDiskImages(List dataDiskImages) { - this.dataDiskImages = dataDiskImages; - return this; - } - - /** - * Get the automaticOSUpgradeProperties property: Describes automatic OS upgrade properties on the image. - * - * @return the automaticOSUpgradeProperties value. - */ - public AutomaticOSUpgradeProperties automaticOSUpgradeProperties() { - return this.automaticOSUpgradeProperties; - } - - /** - * Set the automaticOSUpgradeProperties property: Describes automatic OS upgrade properties on the image. - * - * @param automaticOSUpgradeProperties the automaticOSUpgradeProperties value to set. - * @return the VirtualMachineImageProperties object itself. - */ - public VirtualMachineImageProperties withAutomaticOSUpgradeProperties( - AutomaticOSUpgradeProperties automaticOSUpgradeProperties) { - this.automaticOSUpgradeProperties = automaticOSUpgradeProperties; - return this; - } - - /** - * Get the hyperVGeneration property: Specifies the HyperVGeneration Type. - * - * @return the hyperVGeneration value. - */ - public HyperVGenerationTypes hyperVGeneration() { - return this.hyperVGeneration; - } - - /** - * Set the hyperVGeneration property: Specifies the HyperVGeneration Type. - * - * @param hyperVGeneration the hyperVGeneration value to set. - * @return the VirtualMachineImageProperties object itself. - */ - public VirtualMachineImageProperties withHyperVGeneration(HyperVGenerationTypes hyperVGeneration) { - this.hyperVGeneration = hyperVGeneration; - return this; - } - - /** - * Get the disallowed property: Specifies disallowed configuration for the VirtualMachine created from the image. - * - * @return the disallowed value. - */ - public DisallowedConfiguration disallowed() { - return this.disallowed; - } - - /** - * Set the disallowed property: Specifies disallowed configuration for the VirtualMachine created from the image. - * - * @param disallowed the disallowed value to set. - * @return the VirtualMachineImageProperties object itself. - */ - public VirtualMachineImageProperties withDisallowed(DisallowedConfiguration disallowed) { - this.disallowed = disallowed; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (plan() != null) { - plan().validate(); - } - if (osDiskImage() != null) { - osDiskImage().validate(); - } - if (dataDiskImages() != null) { - dataDiskImages().forEach(e -> e.validate()); - } - if (automaticOSUpgradeProperties() != null) { - automaticOSUpgradeProperties().validate(); - } - if (disallowed() != null) { - disallowed().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineImageResourceInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineImageResourceInner.java deleted file mode 100644 index 6da2eaf11834..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineImageResourceInner.java +++ /dev/null @@ -1,131 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** Virtual machine image resource information. */ -@Fluent -public class VirtualMachineImageResourceInner extends SubResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineImageResourceInner.class); - - /* - * The name of the resource. - */ - @JsonProperty(value = "name", required = true) - private String name; - - /* - * The supported Azure location of the resource. - */ - @JsonProperty(value = "location", required = true) - private String location; - - /* - * Specifies the tags that are assigned to the virtual machine. For more - * information about using tags, see [Using tags to organize your Azure - * resources](https://docs.microsoft.com/azure/azure-resource-manager/resource-group-using-tags.md). - */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map tags; - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the resource. - * - * @param name the name value to set. - * @return the VirtualMachineImageResourceInner object itself. - */ - public VirtualMachineImageResourceInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the location property: The supported Azure location of the resource. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Set the location property: The supported Azure location of the resource. - * - * @param location the location value to set. - * @return the VirtualMachineImageResourceInner object itself. - */ - public VirtualMachineImageResourceInner withLocation(String location) { - this.location = location; - return this; - } - - /** - * Get the tags property: Specifies the tags that are assigned to the virtual machine. For more information about - * using tags, see [Using tags to organize your Azure - * resources](https://docs.microsoft.com/azure/azure-resource-manager/resource-group-using-tags.md). - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Specifies the tags that are assigned to the virtual machine. For more information about - * using tags, see [Using tags to organize your Azure - * resources](https://docs.microsoft.com/azure/azure-resource-manager/resource-group-using-tags.md). - * - * @param tags the tags value to set. - * @return the VirtualMachineImageResourceInner object itself. - */ - public VirtualMachineImageResourceInner withTags(Map tags) { - this.tags = tags; - return this; - } - - /** {@inheritDoc} */ - @Override - public VirtualMachineImageResourceInner withId(String id) { - super.withId(id); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property name in model VirtualMachineImageResourceInner")); - } - if (location() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property location in model VirtualMachineImageResourceInner")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineInner.java deleted file mode 100644 index e91c416d70e1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineInner.java +++ /dev/null @@ -1,681 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.models.AdditionalCapabilities; -import com.azure.resourcemanager.compute.models.BillingProfile; -import com.azure.resourcemanager.compute.models.DiagnosticsProfile; -import com.azure.resourcemanager.compute.models.HardwareProfile; -import com.azure.resourcemanager.compute.models.NetworkProfile; -import com.azure.resourcemanager.compute.models.OSProfile; -import com.azure.resourcemanager.compute.models.Plan; -import com.azure.resourcemanager.compute.models.SecurityProfile; -import com.azure.resourcemanager.compute.models.StorageProfile; -import com.azure.resourcemanager.compute.models.VirtualMachineEvictionPolicyTypes; -import com.azure.resourcemanager.compute.models.VirtualMachineIdentity; -import com.azure.resourcemanager.compute.models.VirtualMachinePriorityTypes; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** Describes a Virtual Machine. */ -@Fluent -public final class VirtualMachineInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineInner.class); - - /* - * Specifies information about the marketplace image used to create the - * virtual machine. This element is only used for marketplace images. - * Before you can use a marketplace image from an API, you must enable the - * image for programmatic use. In the Azure portal, find the marketplace - * image that you want to use and then click **Want to deploy - * programmatically, Get Started ->**. Enter any required information and - * then click **Save**. - */ - @JsonProperty(value = "plan") - private Plan plan; - - /* - * Describes the properties of a Virtual Machine. - */ - @JsonProperty(value = "properties") - private VirtualMachinePropertiesInner innerProperties; - - /* - * The virtual machine child extension resources. - */ - @JsonProperty(value = "resources", access = JsonProperty.Access.WRITE_ONLY) - private List resources; - - /* - * The identity of the virtual machine, if configured. - */ - @JsonProperty(value = "identity") - private VirtualMachineIdentity identity; - - /* - * The virtual machine zones. - */ - @JsonProperty(value = "zones") - private List zones; - - /** - * Get the plan property: Specifies information about the marketplace image used to create the virtual machine. This - * element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable - * the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then - * click **Want to deploy programmatically, Get Started ->**. Enter any required information and then click - * **Save**. - * - * @return the plan value. - */ - public Plan plan() { - return this.plan; - } - - /** - * Set the plan property: Specifies information about the marketplace image used to create the virtual machine. This - * element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable - * the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then - * click **Want to deploy programmatically, Get Started ->**. Enter any required information and then click - * **Save**. - * - * @param plan the plan value to set. - * @return the VirtualMachineInner object itself. - */ - public VirtualMachineInner withPlan(Plan plan) { - this.plan = plan; - return this; - } - - /** - * Get the innerProperties property: Describes the properties of a Virtual Machine. - * - * @return the innerProperties value. - */ - private VirtualMachinePropertiesInner innerProperties() { - return this.innerProperties; - } - - /** - * Get the resources property: The virtual machine child extension resources. - * - * @return the resources value. - */ - public List resources() { - return this.resources; - } - - /** - * Get the identity property: The identity of the virtual machine, if configured. - * - * @return the identity value. - */ - public VirtualMachineIdentity identity() { - return this.identity; - } - - /** - * Set the identity property: The identity of the virtual machine, if configured. - * - * @param identity the identity value to set. - * @return the VirtualMachineInner object itself. - */ - public VirtualMachineInner withIdentity(VirtualMachineIdentity identity) { - this.identity = identity; - return this; - } - - /** - * Get the zones property: The virtual machine zones. - * - * @return the zones value. - */ - public List zones() { - return this.zones; - } - - /** - * Set the zones property: The virtual machine zones. - * - * @param zones the zones value to set. - * @return the VirtualMachineInner object itself. - */ - public VirtualMachineInner withZones(List zones) { - this.zones = zones; - return this; - } - - /** {@inheritDoc} */ - @Override - public VirtualMachineInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public VirtualMachineInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the hardwareProfile property: Specifies the hardware settings for the virtual machine. - * - * @return the hardwareProfile value. - */ - public HardwareProfile hardwareProfile() { - return this.innerProperties() == null ? null : this.innerProperties().hardwareProfile(); - } - - /** - * Set the hardwareProfile property: Specifies the hardware settings for the virtual machine. - * - * @param hardwareProfile the hardwareProfile value to set. - * @return the VirtualMachineInner object itself. - */ - public VirtualMachineInner withHardwareProfile(HardwareProfile hardwareProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachinePropertiesInner(); - } - this.innerProperties().withHardwareProfile(hardwareProfile); - return this; - } - - /** - * Get the storageProfile property: Specifies the storage settings for the virtual machine disks. - * - * @return the storageProfile value. - */ - public StorageProfile storageProfile() { - return this.innerProperties() == null ? null : this.innerProperties().storageProfile(); - } - - /** - * Set the storageProfile property: Specifies the storage settings for the virtual machine disks. - * - * @param storageProfile the storageProfile value to set. - * @return the VirtualMachineInner object itself. - */ - public VirtualMachineInner withStorageProfile(StorageProfile storageProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachinePropertiesInner(); - } - this.innerProperties().withStorageProfile(storageProfile); - return this; - } - - /** - * Get the additionalCapabilities property: Specifies additional capabilities enabled or disabled on the virtual - * machine. - * - * @return the additionalCapabilities value. - */ - public AdditionalCapabilities additionalCapabilities() { - return this.innerProperties() == null ? null : this.innerProperties().additionalCapabilities(); - } - - /** - * Set the additionalCapabilities property: Specifies additional capabilities enabled or disabled on the virtual - * machine. - * - * @param additionalCapabilities the additionalCapabilities value to set. - * @return the VirtualMachineInner object itself. - */ - public VirtualMachineInner withAdditionalCapabilities(AdditionalCapabilities additionalCapabilities) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachinePropertiesInner(); - } - this.innerProperties().withAdditionalCapabilities(additionalCapabilities); - return this; - } - - /** - * Get the osProfile property: Specifies the operating system settings used while creating the virtual machine. Some - * of the settings cannot be changed once VM is provisioned. - * - * @return the osProfile value. - */ - public OSProfile osProfile() { - return this.innerProperties() == null ? null : this.innerProperties().osProfile(); - } - - /** - * Set the osProfile property: Specifies the operating system settings used while creating the virtual machine. Some - * of the settings cannot be changed once VM is provisioned. - * - * @param osProfile the osProfile value to set. - * @return the VirtualMachineInner object itself. - */ - public VirtualMachineInner withOsProfile(OSProfile osProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachinePropertiesInner(); - } - this.innerProperties().withOsProfile(osProfile); - return this; - } - - /** - * Get the networkProfile property: Specifies the network interfaces of the virtual machine. - * - * @return the networkProfile value. - */ - public NetworkProfile networkProfile() { - return this.innerProperties() == null ? null : this.innerProperties().networkProfile(); - } - - /** - * Set the networkProfile property: Specifies the network interfaces of the virtual machine. - * - * @param networkProfile the networkProfile value to set. - * @return the VirtualMachineInner object itself. - */ - public VirtualMachineInner withNetworkProfile(NetworkProfile networkProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachinePropertiesInner(); - } - this.innerProperties().withNetworkProfile(networkProfile); - return this; - } - - /** - * Get the securityProfile property: Specifies the Security related profile settings for the virtual machine. - * - * @return the securityProfile value. - */ - public SecurityProfile securityProfile() { - return this.innerProperties() == null ? null : this.innerProperties().securityProfile(); - } - - /** - * Set the securityProfile property: Specifies the Security related profile settings for the virtual machine. - * - * @param securityProfile the securityProfile value to set. - * @return the VirtualMachineInner object itself. - */ - public VirtualMachineInner withSecurityProfile(SecurityProfile securityProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachinePropertiesInner(); - } - this.innerProperties().withSecurityProfile(securityProfile); - return this; - } - - /** - * Get the diagnosticsProfile property: Specifies the boot diagnostic settings state. <br><br>Minimum - * api-version: 2015-06-15. - * - * @return the diagnosticsProfile value. - */ - public DiagnosticsProfile diagnosticsProfile() { - return this.innerProperties() == null ? null : this.innerProperties().diagnosticsProfile(); - } - - /** - * Set the diagnosticsProfile property: Specifies the boot diagnostic settings state. <br><br>Minimum - * api-version: 2015-06-15. - * - * @param diagnosticsProfile the diagnosticsProfile value to set. - * @return the VirtualMachineInner object itself. - */ - public VirtualMachineInner withDiagnosticsProfile(DiagnosticsProfile diagnosticsProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachinePropertiesInner(); - } - this.innerProperties().withDiagnosticsProfile(diagnosticsProfile); - return this; - } - - /** - * Get the availabilitySet property: Specifies information about the availability set that the virtual machine - * should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes - * to maximize availability. For more information about availability sets, see [Manage the availability of virtual - * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). - * <br><br> For more information on Azure planned maintenance, see [Planned maintenance for virtual - * machines in - * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) - * <br><br> Currently, a VM can only be added to availability set at creation time. The availability set - * to which the VM is being added should be under the same resource group as the availability set resource. An - * existing VM cannot be added to an availability set. <br><br>This property cannot exist along with a - * non-null properties.virtualMachineScaleSet reference. - * - * @return the availabilitySet value. - */ - public SubResource availabilitySet() { - return this.innerProperties() == null ? null : this.innerProperties().availabilitySet(); - } - - /** - * Set the availabilitySet property: Specifies information about the availability set that the virtual machine - * should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes - * to maximize availability. For more information about availability sets, see [Manage the availability of virtual - * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). - * <br><br> For more information on Azure planned maintenance, see [Planned maintenance for virtual - * machines in - * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) - * <br><br> Currently, a VM can only be added to availability set at creation time. The availability set - * to which the VM is being added should be under the same resource group as the availability set resource. An - * existing VM cannot be added to an availability set. <br><br>This property cannot exist along with a - * non-null properties.virtualMachineScaleSet reference. - * - * @param availabilitySet the availabilitySet value to set. - * @return the VirtualMachineInner object itself. - */ - public VirtualMachineInner withAvailabilitySet(SubResource availabilitySet) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachinePropertiesInner(); - } - this.innerProperties().withAvailabilitySet(availabilitySet); - return this; - } - - /** - * Get the virtualMachineScaleSet property: Specifies information about the virtual machine scale set that the - * virtual machine should be assigned to. Virtual machines specified in the same virtual machine scale set are - * allocated to different nodes to maximize availability. Currently, a VM can only be added to virtual machine scale - * set at creation time. An existing VM cannot be added to a virtual machine scale set. <br><br>This - * property cannot exist along with a non-null properties.availabilitySet reference. <br><br>Minimum - * api‐version: 2019‐03‐01. - * - * @return the virtualMachineScaleSet value. - */ - public SubResource virtualMachineScaleSet() { - return this.innerProperties() == null ? null : this.innerProperties().virtualMachineScaleSet(); - } - - /** - * Set the virtualMachineScaleSet property: Specifies information about the virtual machine scale set that the - * virtual machine should be assigned to. Virtual machines specified in the same virtual machine scale set are - * allocated to different nodes to maximize availability. Currently, a VM can only be added to virtual machine scale - * set at creation time. An existing VM cannot be added to a virtual machine scale set. <br><br>This - * property cannot exist along with a non-null properties.availabilitySet reference. <br><br>Minimum - * api‐version: 2019‐03‐01. - * - * @param virtualMachineScaleSet the virtualMachineScaleSet value to set. - * @return the VirtualMachineInner object itself. - */ - public VirtualMachineInner withVirtualMachineScaleSet(SubResource virtualMachineScaleSet) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachinePropertiesInner(); - } - this.innerProperties().withVirtualMachineScaleSet(virtualMachineScaleSet); - return this; - } - - /** - * Get the proximityPlacementGroup property: Specifies information about the proximity placement group that the - * virtual machine should be assigned to. <br><br>Minimum api-version: 2018-04-01. - * - * @return the proximityPlacementGroup value. - */ - public SubResource proximityPlacementGroup() { - return this.innerProperties() == null ? null : this.innerProperties().proximityPlacementGroup(); - } - - /** - * Set the proximityPlacementGroup property: Specifies information about the proximity placement group that the - * virtual machine should be assigned to. <br><br>Minimum api-version: 2018-04-01. - * - * @param proximityPlacementGroup the proximityPlacementGroup value to set. - * @return the VirtualMachineInner object itself. - */ - public VirtualMachineInner withProximityPlacementGroup(SubResource proximityPlacementGroup) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachinePropertiesInner(); - } - this.innerProperties().withProximityPlacementGroup(proximityPlacementGroup); - return this; - } - - /** - * Get the priority property: Specifies the priority for the virtual machine. <br><br>Minimum - * api-version: 2019-03-01. - * - * @return the priority value. - */ - public VirtualMachinePriorityTypes priority() { - return this.innerProperties() == null ? null : this.innerProperties().priority(); - } - - /** - * Set the priority property: Specifies the priority for the virtual machine. <br><br>Minimum - * api-version: 2019-03-01. - * - * @param priority the priority value to set. - * @return the VirtualMachineInner object itself. - */ - public VirtualMachineInner withPriority(VirtualMachinePriorityTypes priority) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachinePropertiesInner(); - } - this.innerProperties().withPriority(priority); - return this; - } - - /** - * Get the evictionPolicy property: Specifies the eviction policy for the Azure Spot virtual machine and Azure Spot - * scale set. <br><br>For Azure Spot virtual machines, both 'Deallocate' and 'Delete' are supported and - * the minimum api-version is 2019-03-01. <br><br>For Azure Spot scale sets, both 'Deallocate' and - * 'Delete' are supported and the minimum api-version is 2017-10-30-preview. - * - * @return the evictionPolicy value. - */ - public VirtualMachineEvictionPolicyTypes evictionPolicy() { - return this.innerProperties() == null ? null : this.innerProperties().evictionPolicy(); - } - - /** - * Set the evictionPolicy property: Specifies the eviction policy for the Azure Spot virtual machine and Azure Spot - * scale set. <br><br>For Azure Spot virtual machines, both 'Deallocate' and 'Delete' are supported and - * the minimum api-version is 2019-03-01. <br><br>For Azure Spot scale sets, both 'Deallocate' and - * 'Delete' are supported and the minimum api-version is 2017-10-30-preview. - * - * @param evictionPolicy the evictionPolicy value to set. - * @return the VirtualMachineInner object itself. - */ - public VirtualMachineInner withEvictionPolicy(VirtualMachineEvictionPolicyTypes evictionPolicy) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachinePropertiesInner(); - } - this.innerProperties().withEvictionPolicy(evictionPolicy); - return this; - } - - /** - * Get the billingProfile property: Specifies the billing related details of a Azure Spot virtual machine. - * <br><br>Minimum api-version: 2019-03-01. - * - * @return the billingProfile value. - */ - public BillingProfile billingProfile() { - return this.innerProperties() == null ? null : this.innerProperties().billingProfile(); - } - - /** - * Set the billingProfile property: Specifies the billing related details of a Azure Spot virtual machine. - * <br><br>Minimum api-version: 2019-03-01. - * - * @param billingProfile the billingProfile value to set. - * @return the VirtualMachineInner object itself. - */ - public VirtualMachineInner withBillingProfile(BillingProfile billingProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachinePropertiesInner(); - } - this.innerProperties().withBillingProfile(billingProfile); - return this; - } - - /** - * Get the host property: Specifies information about the dedicated host that the virtual machine resides in. - * <br><br>Minimum api-version: 2018-10-01. - * - * @return the host value. - */ - public SubResource host() { - return this.innerProperties() == null ? null : this.innerProperties().host(); - } - - /** - * Set the host property: Specifies information about the dedicated host that the virtual machine resides in. - * <br><br>Minimum api-version: 2018-10-01. - * - * @param host the host value to set. - * @return the VirtualMachineInner object itself. - */ - public VirtualMachineInner withHost(SubResource host) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachinePropertiesInner(); - } - this.innerProperties().withHost(host); - return this; - } - - /** - * Get the hostGroup property: Specifies information about the dedicated host group that the virtual machine resides - * in. <br><br>Minimum api-version: 2020-06-01. <br><br>NOTE: User cannot specify both host - * and hostGroup properties. - * - * @return the hostGroup value. - */ - public SubResource hostGroup() { - return this.innerProperties() == null ? null : this.innerProperties().hostGroup(); - } - - /** - * Set the hostGroup property: Specifies information about the dedicated host group that the virtual machine resides - * in. <br><br>Minimum api-version: 2020-06-01. <br><br>NOTE: User cannot specify both host - * and hostGroup properties. - * - * @param hostGroup the hostGroup value to set. - * @return the VirtualMachineInner object itself. - */ - public VirtualMachineInner withHostGroup(SubResource hostGroup) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachinePropertiesInner(); - } - this.innerProperties().withHostGroup(hostGroup); - return this; - } - - /** - * Get the provisioningState property: The provisioning state, which only appears in the response. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the instanceView property: The virtual machine instance view. - * - * @return the instanceView value. - */ - public VirtualMachineInstanceViewInner instanceView() { - return this.innerProperties() == null ? null : this.innerProperties().instanceView(); - } - - /** - * Get the licenseType property: Specifies that the image or disk that is being used was licensed on-premises. - * <br><br> Possible values for Windows Server operating system are: <br><br> Windows_Client - * <br><br> Windows_Server <br><br> Possible values for Linux Server operating system are: - * <br><br> RHEL_BYOS (for RHEL) <br><br> SLES_BYOS (for SUSE) <br><br> For more - * information, see [Azure Hybrid Use Benefit for Windows - * Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) - * <br><br> [Azure Hybrid Use Benefit for Linux - * Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) <br><br> - * Minimum api-version: 2015-06-15. - * - * @return the licenseType value. - */ - public String licenseType() { - return this.innerProperties() == null ? null : this.innerProperties().licenseType(); - } - - /** - * Set the licenseType property: Specifies that the image or disk that is being used was licensed on-premises. - * <br><br> Possible values for Windows Server operating system are: <br><br> Windows_Client - * <br><br> Windows_Server <br><br> Possible values for Linux Server operating system are: - * <br><br> RHEL_BYOS (for RHEL) <br><br> SLES_BYOS (for SUSE) <br><br> For more - * information, see [Azure Hybrid Use Benefit for Windows - * Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) - * <br><br> [Azure Hybrid Use Benefit for Linux - * Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) <br><br> - * Minimum api-version: 2015-06-15. - * - * @param licenseType the licenseType value to set. - * @return the VirtualMachineInner object itself. - */ - public VirtualMachineInner withLicenseType(String licenseType) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachinePropertiesInner(); - } - this.innerProperties().withLicenseType(licenseType); - return this; - } - - /** - * Get the vmId property: Specifies the VM unique ID which is a 128-bits identifier that is encoded and stored in - * all Azure IaaS VMs SMBIOS and can be read using platform BIOS commands. - * - * @return the vmId value. - */ - public String vmId() { - return this.innerProperties() == null ? null : this.innerProperties().vmId(); - } - - /** - * Get the extensionsTimeBudget property: Specifies the time alloted for all extensions to start. The time duration - * should be between 15 minutes and 120 minutes (inclusive) and should be specified in ISO 8601 format. The default - * value is 90 minutes (PT1H30M). <br><br> Minimum api-version: 2020-06-01. - * - * @return the extensionsTimeBudget value. - */ - public String extensionsTimeBudget() { - return this.innerProperties() == null ? null : this.innerProperties().extensionsTimeBudget(); - } - - /** - * Set the extensionsTimeBudget property: Specifies the time alloted for all extensions to start. The time duration - * should be between 15 minutes and 120 minutes (inclusive) and should be specified in ISO 8601 format. The default - * value is 90 minutes (PT1H30M). <br><br> Minimum api-version: 2020-06-01. - * - * @param extensionsTimeBudget the extensionsTimeBudget value to set. - * @return the VirtualMachineInner object itself. - */ - public VirtualMachineInner withExtensionsTimeBudget(String extensionsTimeBudget) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachinePropertiesInner(); - } - this.innerProperties().withExtensionsTimeBudget(extensionsTimeBudget); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (plan() != null) { - plan().validate(); - } - if (innerProperties() != null) { - innerProperties().validate(); - } - if (resources() != null) { - resources().forEach(e -> e.validate()); - } - if (identity() != null) { - identity().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineInstanceViewInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineInstanceViewInner.java deleted file mode 100644 index c1fb36e85b5a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineInstanceViewInner.java +++ /dev/null @@ -1,465 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.models.BootDiagnosticsInstanceView; -import com.azure.resourcemanager.compute.models.DiskInstanceView; -import com.azure.resourcemanager.compute.models.HyperVGenerationType; -import com.azure.resourcemanager.compute.models.InstanceViewStatus; -import com.azure.resourcemanager.compute.models.MaintenanceRedeployStatus; -import com.azure.resourcemanager.compute.models.VirtualMachineAgentInstanceView; -import com.azure.resourcemanager.compute.models.VirtualMachineExtensionInstanceView; -import com.azure.resourcemanager.compute.models.VirtualMachineHealthStatus; -import com.azure.resourcemanager.compute.models.VirtualMachinePatchStatus; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The instance view of a virtual machine. */ -@Fluent -public final class VirtualMachineInstanceViewInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineInstanceViewInner.class); - - /* - * Specifies the update domain of the virtual machine. - */ - @JsonProperty(value = "platformUpdateDomain") - private Integer platformUpdateDomain; - - /* - * Specifies the fault domain of the virtual machine. - */ - @JsonProperty(value = "platformFaultDomain") - private Integer platformFaultDomain; - - /* - * The computer name assigned to the virtual machine. - */ - @JsonProperty(value = "computerName") - private String computerName; - - /* - * The Operating System running on the virtual machine. - */ - @JsonProperty(value = "osName") - private String osName; - - /* - * The version of Operating System running on the virtual machine. - */ - @JsonProperty(value = "osVersion") - private String osVersion; - - /* - * Specifies the HyperVGeneration Type associated with a resource - */ - @JsonProperty(value = "hyperVGeneration") - private HyperVGenerationType hyperVGeneration; - - /* - * The Remote desktop certificate thumbprint. - */ - @JsonProperty(value = "rdpThumbPrint") - private String rdpThumbPrint; - - /* - * The VM Agent running on the virtual machine. - */ - @JsonProperty(value = "vmAgent") - private VirtualMachineAgentInstanceView vmAgent; - - /* - * The Maintenance Operation status on the virtual machine. - */ - @JsonProperty(value = "maintenanceRedeployStatus") - private MaintenanceRedeployStatus maintenanceRedeployStatus; - - /* - * The virtual machine disk information. - */ - @JsonProperty(value = "disks") - private List disks; - - /* - * The extensions information. - */ - @JsonProperty(value = "extensions") - private List extensions; - - /* - * The health status for the VM. - */ - @JsonProperty(value = "vmHealth", access = JsonProperty.Access.WRITE_ONLY) - private VirtualMachineHealthStatus vmHealth; - - /* - * Boot Diagnostics is a debugging feature which allows you to view Console - * Output and Screenshot to diagnose VM status.

You can easily - * view the output of your console log.

Azure also enables you to - * see a screenshot of the VM from the hypervisor. - */ - @JsonProperty(value = "bootDiagnostics") - private BootDiagnosticsInstanceView bootDiagnostics; - - /* - * Resource id of the dedicated host, on which the virtual machine is - * allocated through automatic placement, when the virtual machine is - * associated with a dedicated host group that has automatic placement - * enabled.

Minimum api-version: 2020-06-01. - */ - @JsonProperty(value = "assignedHost", access = JsonProperty.Access.WRITE_ONLY) - private String assignedHost; - - /* - * The resource status information. - */ - @JsonProperty(value = "statuses") - private List statuses; - - /* - * The status of virtual machine patch operations. - */ - @JsonProperty(value = "patchStatus") - private VirtualMachinePatchStatus patchStatus; - - /** - * Get the platformUpdateDomain property: Specifies the update domain of the virtual machine. - * - * @return the platformUpdateDomain value. - */ - public Integer platformUpdateDomain() { - return this.platformUpdateDomain; - } - - /** - * Set the platformUpdateDomain property: Specifies the update domain of the virtual machine. - * - * @param platformUpdateDomain the platformUpdateDomain value to set. - * @return the VirtualMachineInstanceViewInner object itself. - */ - public VirtualMachineInstanceViewInner withPlatformUpdateDomain(Integer platformUpdateDomain) { - this.platformUpdateDomain = platformUpdateDomain; - return this; - } - - /** - * Get the platformFaultDomain property: Specifies the fault domain of the virtual machine. - * - * @return the platformFaultDomain value. - */ - public Integer platformFaultDomain() { - return this.platformFaultDomain; - } - - /** - * Set the platformFaultDomain property: Specifies the fault domain of the virtual machine. - * - * @param platformFaultDomain the platformFaultDomain value to set. - * @return the VirtualMachineInstanceViewInner object itself. - */ - public VirtualMachineInstanceViewInner withPlatformFaultDomain(Integer platformFaultDomain) { - this.platformFaultDomain = platformFaultDomain; - return this; - } - - /** - * Get the computerName property: The computer name assigned to the virtual machine. - * - * @return the computerName value. - */ - public String computerName() { - return this.computerName; - } - - /** - * Set the computerName property: The computer name assigned to the virtual machine. - * - * @param computerName the computerName value to set. - * @return the VirtualMachineInstanceViewInner object itself. - */ - public VirtualMachineInstanceViewInner withComputerName(String computerName) { - this.computerName = computerName; - return this; - } - - /** - * Get the osName property: The Operating System running on the virtual machine. - * - * @return the osName value. - */ - public String osName() { - return this.osName; - } - - /** - * Set the osName property: The Operating System running on the virtual machine. - * - * @param osName the osName value to set. - * @return the VirtualMachineInstanceViewInner object itself. - */ - public VirtualMachineInstanceViewInner withOsName(String osName) { - this.osName = osName; - return this; - } - - /** - * Get the osVersion property: The version of Operating System running on the virtual machine. - * - * @return the osVersion value. - */ - public String osVersion() { - return this.osVersion; - } - - /** - * Set the osVersion property: The version of Operating System running on the virtual machine. - * - * @param osVersion the osVersion value to set. - * @return the VirtualMachineInstanceViewInner object itself. - */ - public VirtualMachineInstanceViewInner withOsVersion(String osVersion) { - this.osVersion = osVersion; - return this; - } - - /** - * Get the hyperVGeneration property: Specifies the HyperVGeneration Type associated with a resource. - * - * @return the hyperVGeneration value. - */ - public HyperVGenerationType hyperVGeneration() { - return this.hyperVGeneration; - } - - /** - * Set the hyperVGeneration property: Specifies the HyperVGeneration Type associated with a resource. - * - * @param hyperVGeneration the hyperVGeneration value to set. - * @return the VirtualMachineInstanceViewInner object itself. - */ - public VirtualMachineInstanceViewInner withHyperVGeneration(HyperVGenerationType hyperVGeneration) { - this.hyperVGeneration = hyperVGeneration; - return this; - } - - /** - * Get the rdpThumbPrint property: The Remote desktop certificate thumbprint. - * - * @return the rdpThumbPrint value. - */ - public String rdpThumbPrint() { - return this.rdpThumbPrint; - } - - /** - * Set the rdpThumbPrint property: The Remote desktop certificate thumbprint. - * - * @param rdpThumbPrint the rdpThumbPrint value to set. - * @return the VirtualMachineInstanceViewInner object itself. - */ - public VirtualMachineInstanceViewInner withRdpThumbPrint(String rdpThumbPrint) { - this.rdpThumbPrint = rdpThumbPrint; - return this; - } - - /** - * Get the vmAgent property: The VM Agent running on the virtual machine. - * - * @return the vmAgent value. - */ - public VirtualMachineAgentInstanceView vmAgent() { - return this.vmAgent; - } - - /** - * Set the vmAgent property: The VM Agent running on the virtual machine. - * - * @param vmAgent the vmAgent value to set. - * @return the VirtualMachineInstanceViewInner object itself. - */ - public VirtualMachineInstanceViewInner withVmAgent(VirtualMachineAgentInstanceView vmAgent) { - this.vmAgent = vmAgent; - return this; - } - - /** - * Get the maintenanceRedeployStatus property: The Maintenance Operation status on the virtual machine. - * - * @return the maintenanceRedeployStatus value. - */ - public MaintenanceRedeployStatus maintenanceRedeployStatus() { - return this.maintenanceRedeployStatus; - } - - /** - * Set the maintenanceRedeployStatus property: The Maintenance Operation status on the virtual machine. - * - * @param maintenanceRedeployStatus the maintenanceRedeployStatus value to set. - * @return the VirtualMachineInstanceViewInner object itself. - */ - public VirtualMachineInstanceViewInner withMaintenanceRedeployStatus( - MaintenanceRedeployStatus maintenanceRedeployStatus) { - this.maintenanceRedeployStatus = maintenanceRedeployStatus; - return this; - } - - /** - * Get the disks property: The virtual machine disk information. - * - * @return the disks value. - */ - public List disks() { - return this.disks; - } - - /** - * Set the disks property: The virtual machine disk information. - * - * @param disks the disks value to set. - * @return the VirtualMachineInstanceViewInner object itself. - */ - public VirtualMachineInstanceViewInner withDisks(List disks) { - this.disks = disks; - return this; - } - - /** - * Get the extensions property: The extensions information. - * - * @return the extensions value. - */ - public List extensions() { - return this.extensions; - } - - /** - * Set the extensions property: The extensions information. - * - * @param extensions the extensions value to set. - * @return the VirtualMachineInstanceViewInner object itself. - */ - public VirtualMachineInstanceViewInner withExtensions(List extensions) { - this.extensions = extensions; - return this; - } - - /** - * Get the vmHealth property: The health status for the VM. - * - * @return the vmHealth value. - */ - public VirtualMachineHealthStatus vmHealth() { - return this.vmHealth; - } - - /** - * Get the bootDiagnostics property: 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. - * - * @return the bootDiagnostics value. - */ - public BootDiagnosticsInstanceView bootDiagnostics() { - return this.bootDiagnostics; - } - - /** - * Set the bootDiagnostics property: 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. - * - * @param bootDiagnostics the bootDiagnostics value to set. - * @return the VirtualMachineInstanceViewInner object itself. - */ - public VirtualMachineInstanceViewInner withBootDiagnostics(BootDiagnosticsInstanceView bootDiagnostics) { - this.bootDiagnostics = bootDiagnostics; - return this; - } - - /** - * Get the assignedHost property: Resource id of the dedicated host, on which the virtual machine is allocated - * through automatic placement, when the virtual machine is associated with a dedicated host group that has - * automatic placement enabled. <br><br>Minimum api-version: 2020-06-01. - * - * @return the assignedHost value. - */ - public String assignedHost() { - return this.assignedHost; - } - - /** - * Get the statuses property: The resource status information. - * - * @return the statuses value. - */ - public List statuses() { - return this.statuses; - } - - /** - * Set the statuses property: The resource status information. - * - * @param statuses the statuses value to set. - * @return the VirtualMachineInstanceViewInner object itself. - */ - public VirtualMachineInstanceViewInner withStatuses(List statuses) { - this.statuses = statuses; - return this; - } - - /** - * Get the patchStatus property: The status of virtual machine patch operations. - * - * @return the patchStatus value. - */ - public VirtualMachinePatchStatus patchStatus() { - return this.patchStatus; - } - - /** - * Set the patchStatus property: The status of virtual machine patch operations. - * - * @param patchStatus the patchStatus value to set. - * @return the VirtualMachineInstanceViewInner object itself. - */ - public VirtualMachineInstanceViewInner withPatchStatus(VirtualMachinePatchStatus patchStatus) { - this.patchStatus = patchStatus; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (vmAgent() != null) { - vmAgent().validate(); - } - if (maintenanceRedeployStatus() != null) { - maintenanceRedeployStatus().validate(); - } - if (disks() != null) { - disks().forEach(e -> e.validate()); - } - if (extensions() != null) { - extensions().forEach(e -> e.validate()); - } - if (vmHealth() != null) { - vmHealth().validate(); - } - if (bootDiagnostics() != null) { - bootDiagnostics().validate(); - } - if (statuses() != null) { - statuses().forEach(e -> e.validate()); - } - if (patchStatus() != null) { - patchStatus().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachinePropertiesInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachinePropertiesInner.java deleted file mode 100644 index 69921123b0d1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachinePropertiesInner.java +++ /dev/null @@ -1,674 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.models.AdditionalCapabilities; -import com.azure.resourcemanager.compute.models.BillingProfile; -import com.azure.resourcemanager.compute.models.DiagnosticsProfile; -import com.azure.resourcemanager.compute.models.HardwareProfile; -import com.azure.resourcemanager.compute.models.NetworkProfile; -import com.azure.resourcemanager.compute.models.OSProfile; -import com.azure.resourcemanager.compute.models.SecurityProfile; -import com.azure.resourcemanager.compute.models.StorageProfile; -import com.azure.resourcemanager.compute.models.VirtualMachineEvictionPolicyTypes; -import com.azure.resourcemanager.compute.models.VirtualMachinePriorityTypes; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describes the properties of a Virtual Machine. */ -@Fluent -public final class VirtualMachinePropertiesInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachinePropertiesInner.class); - - /* - * Specifies the hardware settings for the virtual machine. - */ - @JsonProperty(value = "hardwareProfile") - private HardwareProfile hardwareProfile; - - /* - * Specifies the storage settings for the virtual machine disks. - */ - @JsonProperty(value = "storageProfile") - private StorageProfile storageProfile; - - /* - * Specifies additional capabilities enabled or disabled on the virtual - * machine. - */ - @JsonProperty(value = "additionalCapabilities") - private AdditionalCapabilities additionalCapabilities; - - /* - * Specifies the operating system settings used while creating the virtual - * machine. Some of the settings cannot be changed once VM is provisioned. - */ - @JsonProperty(value = "osProfile") - private OSProfile osProfile; - - /* - * Specifies the network interfaces of the virtual machine. - */ - @JsonProperty(value = "networkProfile") - private NetworkProfile networkProfile; - - /* - * Specifies the Security related profile settings for the virtual machine. - */ - @JsonProperty(value = "securityProfile") - private SecurityProfile securityProfile; - - /* - * Specifies the boot diagnostic settings state.

Minimum - * api-version: 2015-06-15. - */ - @JsonProperty(value = "diagnosticsProfile") - private DiagnosticsProfile diagnosticsProfile; - - /* - * Specifies information about the availability set that the virtual - * machine should be assigned to. Virtual machines specified in the same - * availability set are allocated to different nodes to maximize - * availability. For more information about availability sets, see [Manage - * the availability of virtual - * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). - *

For more information on Azure planned maintenance, see [Planned - * maintenance for virtual machines in - * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) - *

Currently, a VM can only be added to availability set at - * creation time. The availability set to which the VM is being added - * should be under the same resource group as the availability set - * resource. An existing VM cannot be added to an availability set. - *

This property cannot exist along with a non-null - * properties.virtualMachineScaleSet reference. - */ - @JsonProperty(value = "availabilitySet") - private SubResource availabilitySet; - - /* - * Specifies information about the virtual machine scale set that the - * virtual machine should be assigned to. Virtual machines specified in the - * same virtual machine scale set are allocated to different nodes to - * maximize availability. Currently, a VM can only be added to virtual - * machine scale set at creation time. An existing VM cannot be added to a - * virtual machine scale set.

This property cannot exist along with - * a non-null properties.availabilitySet reference.

Minimum - * api‐version: 2019‐03‐01 - */ - @JsonProperty(value = "virtualMachineScaleSet") - private SubResource virtualMachineScaleSet; - - /* - * Specifies information about the proximity placement group that the - * virtual machine should be assigned to.

Minimum api-version: - * 2018-04-01. - */ - @JsonProperty(value = "proximityPlacementGroup") - private SubResource proximityPlacementGroup; - - /* - * Specifies the priority for the virtual machine.

Minimum - * api-version: 2019-03-01 - */ - @JsonProperty(value = "priority") - private VirtualMachinePriorityTypes priority; - - /* - * Specifies the eviction policy for the Azure Spot virtual machine and - * Azure Spot scale set.

For Azure Spot virtual machines, both - * 'Deallocate' and 'Delete' are supported and the minimum api-version is - * 2019-03-01.

For Azure Spot scale sets, both 'Deallocate' and - * 'Delete' are supported and the minimum api-version is - * 2017-10-30-preview. - */ - @JsonProperty(value = "evictionPolicy") - private VirtualMachineEvictionPolicyTypes evictionPolicy; - - /* - * Specifies the billing related details of a Azure Spot virtual machine. - *

Minimum api-version: 2019-03-01. - */ - @JsonProperty(value = "billingProfile") - private BillingProfile billingProfile; - - /* - * Specifies information about the dedicated host that the virtual machine - * resides in.

Minimum api-version: 2018-10-01. - */ - @JsonProperty(value = "host") - private SubResource host; - - /* - * Specifies information about the dedicated host group that the virtual - * machine resides in.

Minimum api-version: 2020-06-01. - *

NOTE: User cannot specify both host and hostGroup properties. - */ - @JsonProperty(value = "hostGroup") - private SubResource hostGroup; - - /* - * The provisioning state, which only appears in the response. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; - - /* - * The virtual machine instance view. - */ - @JsonProperty(value = "instanceView", access = JsonProperty.Access.WRITE_ONLY) - private VirtualMachineInstanceViewInner instanceView; - - /* - * Specifies that the image or disk that is being used was licensed - * on-premises.

Possible values for Windows Server operating - * system are:

Windows_Client

Windows_Server

- * Possible values for Linux Server operating system are:

- * RHEL_BYOS (for RHEL)

SLES_BYOS (for SUSE)

For more - * information, see [Azure Hybrid Use Benefit for Windows - * Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) - *

[Azure Hybrid Use Benefit for Linux - * Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) - *

Minimum api-version: 2015-06-15 - */ - @JsonProperty(value = "licenseType") - private String licenseType; - - /* - * Specifies the VM unique ID which is a 128-bits identifier that is - * encoded and stored in all Azure IaaS VMs SMBIOS and can be read using - * platform BIOS commands. - */ - @JsonProperty(value = "vmId", access = JsonProperty.Access.WRITE_ONLY) - private String vmId; - - /* - * Specifies the time alloted for all extensions to start. The time - * duration should be between 15 minutes and 120 minutes (inclusive) and - * should be specified in ISO 8601 format. The default value is 90 minutes - * (PT1H30M).

Minimum api-version: 2020-06-01 - */ - @JsonProperty(value = "extensionsTimeBudget") - private String extensionsTimeBudget; - - /** - * Get the hardwareProfile property: Specifies the hardware settings for the virtual machine. - * - * @return the hardwareProfile value. - */ - public HardwareProfile hardwareProfile() { - return this.hardwareProfile; - } - - /** - * Set the hardwareProfile property: Specifies the hardware settings for the virtual machine. - * - * @param hardwareProfile the hardwareProfile value to set. - * @return the VirtualMachinePropertiesInner object itself. - */ - public VirtualMachinePropertiesInner withHardwareProfile(HardwareProfile hardwareProfile) { - this.hardwareProfile = hardwareProfile; - return this; - } - - /** - * Get the storageProfile property: Specifies the storage settings for the virtual machine disks. - * - * @return the storageProfile value. - */ - public StorageProfile storageProfile() { - return this.storageProfile; - } - - /** - * Set the storageProfile property: Specifies the storage settings for the virtual machine disks. - * - * @param storageProfile the storageProfile value to set. - * @return the VirtualMachinePropertiesInner object itself. - */ - public VirtualMachinePropertiesInner withStorageProfile(StorageProfile storageProfile) { - this.storageProfile = storageProfile; - return this; - } - - /** - * Get the additionalCapabilities property: Specifies additional capabilities enabled or disabled on the virtual - * machine. - * - * @return the additionalCapabilities value. - */ - public AdditionalCapabilities additionalCapabilities() { - return this.additionalCapabilities; - } - - /** - * Set the additionalCapabilities property: Specifies additional capabilities enabled or disabled on the virtual - * machine. - * - * @param additionalCapabilities the additionalCapabilities value to set. - * @return the VirtualMachinePropertiesInner object itself. - */ - public VirtualMachinePropertiesInner withAdditionalCapabilities(AdditionalCapabilities additionalCapabilities) { - this.additionalCapabilities = additionalCapabilities; - return this; - } - - /** - * Get the osProfile property: Specifies the operating system settings used while creating the virtual machine. Some - * of the settings cannot be changed once VM is provisioned. - * - * @return the osProfile value. - */ - public OSProfile osProfile() { - return this.osProfile; - } - - /** - * Set the osProfile property: Specifies the operating system settings used while creating the virtual machine. Some - * of the settings cannot be changed once VM is provisioned. - * - * @param osProfile the osProfile value to set. - * @return the VirtualMachinePropertiesInner object itself. - */ - public VirtualMachinePropertiesInner withOsProfile(OSProfile osProfile) { - this.osProfile = osProfile; - return this; - } - - /** - * Get the networkProfile property: Specifies the network interfaces of the virtual machine. - * - * @return the networkProfile value. - */ - public NetworkProfile networkProfile() { - return this.networkProfile; - } - - /** - * Set the networkProfile property: Specifies the network interfaces of the virtual machine. - * - * @param networkProfile the networkProfile value to set. - * @return the VirtualMachinePropertiesInner object itself. - */ - public VirtualMachinePropertiesInner withNetworkProfile(NetworkProfile networkProfile) { - this.networkProfile = networkProfile; - return this; - } - - /** - * Get the securityProfile property: Specifies the Security related profile settings for the virtual machine. - * - * @return the securityProfile value. - */ - public SecurityProfile securityProfile() { - return this.securityProfile; - } - - /** - * Set the securityProfile property: Specifies the Security related profile settings for the virtual machine. - * - * @param securityProfile the securityProfile value to set. - * @return the VirtualMachinePropertiesInner object itself. - */ - public VirtualMachinePropertiesInner withSecurityProfile(SecurityProfile securityProfile) { - this.securityProfile = securityProfile; - return this; - } - - /** - * Get the diagnosticsProfile property: Specifies the boot diagnostic settings state. <br><br>Minimum - * api-version: 2015-06-15. - * - * @return the diagnosticsProfile value. - */ - public DiagnosticsProfile diagnosticsProfile() { - return this.diagnosticsProfile; - } - - /** - * Set the diagnosticsProfile property: Specifies the boot diagnostic settings state. <br><br>Minimum - * api-version: 2015-06-15. - * - * @param diagnosticsProfile the diagnosticsProfile value to set. - * @return the VirtualMachinePropertiesInner object itself. - */ - public VirtualMachinePropertiesInner withDiagnosticsProfile(DiagnosticsProfile diagnosticsProfile) { - this.diagnosticsProfile = diagnosticsProfile; - return this; - } - - /** - * Get the availabilitySet property: Specifies information about the availability set that the virtual machine - * should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes - * to maximize availability. For more information about availability sets, see [Manage the availability of virtual - * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). - * <br><br> For more information on Azure planned maintenance, see [Planned maintenance for virtual - * machines in - * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) - * <br><br> Currently, a VM can only be added to availability set at creation time. The availability set - * to which the VM is being added should be under the same resource group as the availability set resource. An - * existing VM cannot be added to an availability set. <br><br>This property cannot exist along with a - * non-null properties.virtualMachineScaleSet reference. - * - * @return the availabilitySet value. - */ - public SubResource availabilitySet() { - return this.availabilitySet; - } - - /** - * Set the availabilitySet property: Specifies information about the availability set that the virtual machine - * should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes - * to maximize availability. For more information about availability sets, see [Manage the availability of virtual - * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). - * <br><br> For more information on Azure planned maintenance, see [Planned maintenance for virtual - * machines in - * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) - * <br><br> Currently, a VM can only be added to availability set at creation time. The availability set - * to which the VM is being added should be under the same resource group as the availability set resource. An - * existing VM cannot be added to an availability set. <br><br>This property cannot exist along with a - * non-null properties.virtualMachineScaleSet reference. - * - * @param availabilitySet the availabilitySet value to set. - * @return the VirtualMachinePropertiesInner object itself. - */ - public VirtualMachinePropertiesInner withAvailabilitySet(SubResource availabilitySet) { - this.availabilitySet = availabilitySet; - return this; - } - - /** - * Get the virtualMachineScaleSet property: Specifies information about the virtual machine scale set that the - * virtual machine should be assigned to. Virtual machines specified in the same virtual machine scale set are - * allocated to different nodes to maximize availability. Currently, a VM can only be added to virtual machine scale - * set at creation time. An existing VM cannot be added to a virtual machine scale set. <br><br>This - * property cannot exist along with a non-null properties.availabilitySet reference. <br><br>Minimum - * api‐version: 2019‐03‐01. - * - * @return the virtualMachineScaleSet value. - */ - public SubResource virtualMachineScaleSet() { - return this.virtualMachineScaleSet; - } - - /** - * Set the virtualMachineScaleSet property: Specifies information about the virtual machine scale set that the - * virtual machine should be assigned to. Virtual machines specified in the same virtual machine scale set are - * allocated to different nodes to maximize availability. Currently, a VM can only be added to virtual machine scale - * set at creation time. An existing VM cannot be added to a virtual machine scale set. <br><br>This - * property cannot exist along with a non-null properties.availabilitySet reference. <br><br>Minimum - * api‐version: 2019‐03‐01. - * - * @param virtualMachineScaleSet the virtualMachineScaleSet value to set. - * @return the VirtualMachinePropertiesInner object itself. - */ - public VirtualMachinePropertiesInner withVirtualMachineScaleSet(SubResource virtualMachineScaleSet) { - this.virtualMachineScaleSet = virtualMachineScaleSet; - return this; - } - - /** - * Get the proximityPlacementGroup property: Specifies information about the proximity placement group that the - * virtual machine should be assigned to. <br><br>Minimum api-version: 2018-04-01. - * - * @return the proximityPlacementGroup value. - */ - public SubResource proximityPlacementGroup() { - return this.proximityPlacementGroup; - } - - /** - * Set the proximityPlacementGroup property: Specifies information about the proximity placement group that the - * virtual machine should be assigned to. <br><br>Minimum api-version: 2018-04-01. - * - * @param proximityPlacementGroup the proximityPlacementGroup value to set. - * @return the VirtualMachinePropertiesInner object itself. - */ - public VirtualMachinePropertiesInner withProximityPlacementGroup(SubResource proximityPlacementGroup) { - this.proximityPlacementGroup = proximityPlacementGroup; - return this; - } - - /** - * Get the priority property: Specifies the priority for the virtual machine. <br><br>Minimum - * api-version: 2019-03-01. - * - * @return the priority value. - */ - public VirtualMachinePriorityTypes priority() { - return this.priority; - } - - /** - * Set the priority property: Specifies the priority for the virtual machine. <br><br>Minimum - * api-version: 2019-03-01. - * - * @param priority the priority value to set. - * @return the VirtualMachinePropertiesInner object itself. - */ - public VirtualMachinePropertiesInner withPriority(VirtualMachinePriorityTypes priority) { - this.priority = priority; - return this; - } - - /** - * Get the evictionPolicy property: Specifies the eviction policy for the Azure Spot virtual machine and Azure Spot - * scale set. <br><br>For Azure Spot virtual machines, both 'Deallocate' and 'Delete' are supported and - * the minimum api-version is 2019-03-01. <br><br>For Azure Spot scale sets, both 'Deallocate' and - * 'Delete' are supported and the minimum api-version is 2017-10-30-preview. - * - * @return the evictionPolicy value. - */ - public VirtualMachineEvictionPolicyTypes evictionPolicy() { - return this.evictionPolicy; - } - - /** - * Set the evictionPolicy property: Specifies the eviction policy for the Azure Spot virtual machine and Azure Spot - * scale set. <br><br>For Azure Spot virtual machines, both 'Deallocate' and 'Delete' are supported and - * the minimum api-version is 2019-03-01. <br><br>For Azure Spot scale sets, both 'Deallocate' and - * 'Delete' are supported and the minimum api-version is 2017-10-30-preview. - * - * @param evictionPolicy the evictionPolicy value to set. - * @return the VirtualMachinePropertiesInner object itself. - */ - public VirtualMachinePropertiesInner withEvictionPolicy(VirtualMachineEvictionPolicyTypes evictionPolicy) { - this.evictionPolicy = evictionPolicy; - return this; - } - - /** - * Get the billingProfile property: Specifies the billing related details of a Azure Spot virtual machine. - * <br><br>Minimum api-version: 2019-03-01. - * - * @return the billingProfile value. - */ - public BillingProfile billingProfile() { - return this.billingProfile; - } - - /** - * Set the billingProfile property: Specifies the billing related details of a Azure Spot virtual machine. - * <br><br>Minimum api-version: 2019-03-01. - * - * @param billingProfile the billingProfile value to set. - * @return the VirtualMachinePropertiesInner object itself. - */ - public VirtualMachinePropertiesInner withBillingProfile(BillingProfile billingProfile) { - this.billingProfile = billingProfile; - return this; - } - - /** - * Get the host property: Specifies information about the dedicated host that the virtual machine resides in. - * <br><br>Minimum api-version: 2018-10-01. - * - * @return the host value. - */ - public SubResource host() { - return this.host; - } - - /** - * Set the host property: Specifies information about the dedicated host that the virtual machine resides in. - * <br><br>Minimum api-version: 2018-10-01. - * - * @param host the host value to set. - * @return the VirtualMachinePropertiesInner object itself. - */ - public VirtualMachinePropertiesInner withHost(SubResource host) { - this.host = host; - return this; - } - - /** - * Get the hostGroup property: Specifies information about the dedicated host group that the virtual machine resides - * in. <br><br>Minimum api-version: 2020-06-01. <br><br>NOTE: User cannot specify both host - * and hostGroup properties. - * - * @return the hostGroup value. - */ - public SubResource hostGroup() { - return this.hostGroup; - } - - /** - * Set the hostGroup property: Specifies information about the dedicated host group that the virtual machine resides - * in. <br><br>Minimum api-version: 2020-06-01. <br><br>NOTE: User cannot specify both host - * and hostGroup properties. - * - * @param hostGroup the hostGroup value to set. - * @return the VirtualMachinePropertiesInner object itself. - */ - public VirtualMachinePropertiesInner withHostGroup(SubResource hostGroup) { - this.hostGroup = hostGroup; - return this; - } - - /** - * Get the provisioningState property: The provisioning state, which only appears in the response. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Get the instanceView property: The virtual machine instance view. - * - * @return the instanceView value. - */ - public VirtualMachineInstanceViewInner instanceView() { - return this.instanceView; - } - - /** - * Get the licenseType property: Specifies that the image or disk that is being used was licensed on-premises. - * <br><br> Possible values for Windows Server operating system are: <br><br> Windows_Client - * <br><br> Windows_Server <br><br> Possible values for Linux Server operating system are: - * <br><br> RHEL_BYOS (for RHEL) <br><br> SLES_BYOS (for SUSE) <br><br> For more - * information, see [Azure Hybrid Use Benefit for Windows - * Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) - * <br><br> [Azure Hybrid Use Benefit for Linux - * Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) <br><br> - * Minimum api-version: 2015-06-15. - * - * @return the licenseType value. - */ - public String licenseType() { - return this.licenseType; - } - - /** - * Set the licenseType property: Specifies that the image or disk that is being used was licensed on-premises. - * <br><br> Possible values for Windows Server operating system are: <br><br> Windows_Client - * <br><br> Windows_Server <br><br> Possible values for Linux Server operating system are: - * <br><br> RHEL_BYOS (for RHEL) <br><br> SLES_BYOS (for SUSE) <br><br> For more - * information, see [Azure Hybrid Use Benefit for Windows - * Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) - * <br><br> [Azure Hybrid Use Benefit for Linux - * Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) <br><br> - * Minimum api-version: 2015-06-15. - * - * @param licenseType the licenseType value to set. - * @return the VirtualMachinePropertiesInner object itself. - */ - public VirtualMachinePropertiesInner withLicenseType(String licenseType) { - this.licenseType = licenseType; - return this; - } - - /** - * Get the vmId property: Specifies the VM unique ID which is a 128-bits identifier that is encoded and stored in - * all Azure IaaS VMs SMBIOS and can be read using platform BIOS commands. - * - * @return the vmId value. - */ - public String vmId() { - return this.vmId; - } - - /** - * Get the extensionsTimeBudget property: Specifies the time alloted for all extensions to start. The time duration - * should be between 15 minutes and 120 minutes (inclusive) and should be specified in ISO 8601 format. The default - * value is 90 minutes (PT1H30M). <br><br> Minimum api-version: 2020-06-01. - * - * @return the extensionsTimeBudget value. - */ - public String extensionsTimeBudget() { - return this.extensionsTimeBudget; - } - - /** - * Set the extensionsTimeBudget property: Specifies the time alloted for all extensions to start. The time duration - * should be between 15 minutes and 120 minutes (inclusive) and should be specified in ISO 8601 format. The default - * value is 90 minutes (PT1H30M). <br><br> Minimum api-version: 2020-06-01. - * - * @param extensionsTimeBudget the extensionsTimeBudget value to set. - * @return the VirtualMachinePropertiesInner object itself. - */ - public VirtualMachinePropertiesInner withExtensionsTimeBudget(String extensionsTimeBudget) { - this.extensionsTimeBudget = extensionsTimeBudget; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (hardwareProfile() != null) { - hardwareProfile().validate(); - } - if (storageProfile() != null) { - storageProfile().validate(); - } - if (additionalCapabilities() != null) { - additionalCapabilities().validate(); - } - if (osProfile() != null) { - osProfile().validate(); - } - if (networkProfile() != null) { - networkProfile().validate(); - } - if (securityProfile() != null) { - securityProfile().validate(); - } - if (diagnosticsProfile() != null) { - diagnosticsProfile().validate(); - } - if (billingProfile() != null) { - billingProfile().validate(); - } - if (instanceView() != null) { - instanceView().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineRunCommandInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineRunCommandInner.java deleted file mode 100644 index d01b917aa0fa..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineRunCommandInner.java +++ /dev/null @@ -1,289 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.models.RunCommandInputParameter; -import com.azure.resourcemanager.compute.models.VirtualMachineRunCommandInstanceView; -import com.azure.resourcemanager.compute.models.VirtualMachineRunCommandScriptSource; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** Describes a Virtual Machine run command. */ -@Fluent -public final class VirtualMachineRunCommandInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineRunCommandInner.class); - - /* - * Describes the properties of a Virtual Machine run command. - */ - @JsonProperty(value = "properties") - private VirtualMachineRunCommandProperties innerProperties; - - /** - * Get the innerProperties property: Describes the properties of a Virtual Machine run command. - * - * @return the innerProperties value. - */ - private VirtualMachineRunCommandProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public VirtualMachineRunCommandInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public VirtualMachineRunCommandInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the source property: The source of the run command script. - * - * @return the source value. - */ - public VirtualMachineRunCommandScriptSource source() { - return this.innerProperties() == null ? null : this.innerProperties().source(); - } - - /** - * Set the source property: The source of the run command script. - * - * @param source the source value to set. - * @return the VirtualMachineRunCommandInner object itself. - */ - public VirtualMachineRunCommandInner withSource(VirtualMachineRunCommandScriptSource source) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineRunCommandProperties(); - } - this.innerProperties().withSource(source); - return this; - } - - /** - * Get the parameters property: The parameters used by the script. - * - * @return the parameters value. - */ - public List parameters() { - return this.innerProperties() == null ? null : this.innerProperties().parameters(); - } - - /** - * Set the parameters property: The parameters used by the script. - * - * @param parameters the parameters value to set. - * @return the VirtualMachineRunCommandInner object itself. - */ - public VirtualMachineRunCommandInner withParameters(List parameters) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineRunCommandProperties(); - } - this.innerProperties().withParameters(parameters); - return this; - } - - /** - * Get the protectedParameters property: The parameters used by the script. - * - * @return the protectedParameters value. - */ - public List protectedParameters() { - return this.innerProperties() == null ? null : this.innerProperties().protectedParameters(); - } - - /** - * Set the protectedParameters property: The parameters used by the script. - * - * @param protectedParameters the protectedParameters value to set. - * @return the VirtualMachineRunCommandInner object itself. - */ - public VirtualMachineRunCommandInner withProtectedParameters(List protectedParameters) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineRunCommandProperties(); - } - this.innerProperties().withProtectedParameters(protectedParameters); - return this; - } - - /** - * Get the asyncExecution property: Optional. If set to true, provisioning will complete as soon as the script - * starts and will not wait for script to complete. - * - * @return the asyncExecution value. - */ - public Boolean asyncExecution() { - return this.innerProperties() == null ? null : this.innerProperties().asyncExecution(); - } - - /** - * Set the asyncExecution property: Optional. If set to true, provisioning will complete as soon as the script - * starts and will not wait for script to complete. - * - * @param asyncExecution the asyncExecution value to set. - * @return the VirtualMachineRunCommandInner object itself. - */ - public VirtualMachineRunCommandInner withAsyncExecution(Boolean asyncExecution) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineRunCommandProperties(); - } - this.innerProperties().withAsyncExecution(asyncExecution); - return this; - } - - /** - * Get the runAsUser property: Specifies the user account on the VM when executing the run command. - * - * @return the runAsUser value. - */ - public String runAsUser() { - return this.innerProperties() == null ? null : this.innerProperties().runAsUser(); - } - - /** - * Set the runAsUser property: Specifies the user account on the VM when executing the run command. - * - * @param runAsUser the runAsUser value to set. - * @return the VirtualMachineRunCommandInner object itself. - */ - public VirtualMachineRunCommandInner withRunAsUser(String runAsUser) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineRunCommandProperties(); - } - this.innerProperties().withRunAsUser(runAsUser); - return this; - } - - /** - * Get the runAsPassword property: Specifies the user account password on the VM when executing the run command. - * - * @return the runAsPassword value. - */ - public String runAsPassword() { - return this.innerProperties() == null ? null : this.innerProperties().runAsPassword(); - } - - /** - * Set the runAsPassword property: Specifies the user account password on the VM when executing the run command. - * - * @param runAsPassword the runAsPassword value to set. - * @return the VirtualMachineRunCommandInner object itself. - */ - public VirtualMachineRunCommandInner withRunAsPassword(String runAsPassword) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineRunCommandProperties(); - } - this.innerProperties().withRunAsPassword(runAsPassword); - return this; - } - - /** - * Get the timeoutInSeconds property: The timeout in seconds to execute the run command. - * - * @return the timeoutInSeconds value. - */ - public Integer timeoutInSeconds() { - return this.innerProperties() == null ? null : this.innerProperties().timeoutInSeconds(); - } - - /** - * Set the timeoutInSeconds property: The timeout in seconds to execute the run command. - * - * @param timeoutInSeconds the timeoutInSeconds value to set. - * @return the VirtualMachineRunCommandInner object itself. - */ - public VirtualMachineRunCommandInner withTimeoutInSeconds(Integer timeoutInSeconds) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineRunCommandProperties(); - } - this.innerProperties().withTimeoutInSeconds(timeoutInSeconds); - return this; - } - - /** - * Get the outputBlobUri property: Specifies the Azure storage blob where script output stream will be uploaded. - * - * @return the outputBlobUri value. - */ - public String outputBlobUri() { - return this.innerProperties() == null ? null : this.innerProperties().outputBlobUri(); - } - - /** - * Set the outputBlobUri property: Specifies the Azure storage blob where script output stream will be uploaded. - * - * @param outputBlobUri the outputBlobUri value to set. - * @return the VirtualMachineRunCommandInner object itself. - */ - public VirtualMachineRunCommandInner withOutputBlobUri(String outputBlobUri) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineRunCommandProperties(); - } - this.innerProperties().withOutputBlobUri(outputBlobUri); - return this; - } - - /** - * Get the errorBlobUri property: Specifies the Azure storage blob where script error stream will be uploaded. - * - * @return the errorBlobUri value. - */ - public String errorBlobUri() { - return this.innerProperties() == null ? null : this.innerProperties().errorBlobUri(); - } - - /** - * Set the errorBlobUri property: Specifies the Azure storage blob where script error stream will be uploaded. - * - * @param errorBlobUri the errorBlobUri value to set. - * @return the VirtualMachineRunCommandInner object itself. - */ - public VirtualMachineRunCommandInner withErrorBlobUri(String errorBlobUri) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineRunCommandProperties(); - } - this.innerProperties().withErrorBlobUri(errorBlobUri); - return this; - } - - /** - * Get the provisioningState property: The provisioning state, which only appears in the response. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the instanceView property: The virtual machine run command instance view. - * - * @return the instanceView value. - */ - public VirtualMachineRunCommandInstanceView instanceView() { - return this.innerProperties() == null ? null : this.innerProperties().instanceView(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineRunCommandProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineRunCommandProperties.java deleted file mode 100644 index 4d539ddd71c5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineRunCommandProperties.java +++ /dev/null @@ -1,311 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.models.RunCommandInputParameter; -import com.azure.resourcemanager.compute.models.VirtualMachineRunCommandInstanceView; -import com.azure.resourcemanager.compute.models.VirtualMachineRunCommandScriptSource; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Describes the properties of a Virtual Machine run command. */ -@Fluent -public final class VirtualMachineRunCommandProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineRunCommandProperties.class); - - /* - * The source of the run command script. - */ - @JsonProperty(value = "source") - private VirtualMachineRunCommandScriptSource source; - - /* - * The parameters used by the script. - */ - @JsonProperty(value = "parameters") - private List parameters; - - /* - * The parameters used by the script. - */ - @JsonProperty(value = "protectedParameters") - private List protectedParameters; - - /* - * Optional. If set to true, provisioning will complete as soon as the - * script starts and will not wait for script to complete. - */ - @JsonProperty(value = "asyncExecution") - private Boolean asyncExecution; - - /* - * Specifies the user account on the VM when executing the run command. - */ - @JsonProperty(value = "runAsUser") - private String runAsUser; - - /* - * Specifies the user account password on the VM when executing the run - * command. - */ - @JsonProperty(value = "runAsPassword") - private String runAsPassword; - - /* - * The timeout in seconds to execute the run command. - */ - @JsonProperty(value = "timeoutInSeconds") - private Integer timeoutInSeconds; - - /* - * Specifies the Azure storage blob where script output stream will be - * uploaded. - */ - @JsonProperty(value = "outputBlobUri") - private String outputBlobUri; - - /* - * Specifies the Azure storage blob where script error stream will be - * uploaded. - */ - @JsonProperty(value = "errorBlobUri") - private String errorBlobUri; - - /* - * The provisioning state, which only appears in the response. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; - - /* - * The virtual machine run command instance view. - */ - @JsonProperty(value = "instanceView", access = JsonProperty.Access.WRITE_ONLY) - private VirtualMachineRunCommandInstanceView instanceView; - - /** - * Get the source property: The source of the run command script. - * - * @return the source value. - */ - public VirtualMachineRunCommandScriptSource source() { - return this.source; - } - - /** - * Set the source property: The source of the run command script. - * - * @param source the source value to set. - * @return the VirtualMachineRunCommandProperties object itself. - */ - public VirtualMachineRunCommandProperties withSource(VirtualMachineRunCommandScriptSource source) { - this.source = source; - return this; - } - - /** - * Get the parameters property: The parameters used by the script. - * - * @return the parameters value. - */ - public List parameters() { - return this.parameters; - } - - /** - * Set the parameters property: The parameters used by the script. - * - * @param parameters the parameters value to set. - * @return the VirtualMachineRunCommandProperties object itself. - */ - public VirtualMachineRunCommandProperties withParameters(List parameters) { - this.parameters = parameters; - return this; - } - - /** - * Get the protectedParameters property: The parameters used by the script. - * - * @return the protectedParameters value. - */ - public List protectedParameters() { - return this.protectedParameters; - } - - /** - * Set the protectedParameters property: The parameters used by the script. - * - * @param protectedParameters the protectedParameters value to set. - * @return the VirtualMachineRunCommandProperties object itself. - */ - public VirtualMachineRunCommandProperties withProtectedParameters( - List protectedParameters) { - this.protectedParameters = protectedParameters; - return this; - } - - /** - * Get the asyncExecution property: Optional. If set to true, provisioning will complete as soon as the script - * starts and will not wait for script to complete. - * - * @return the asyncExecution value. - */ - public Boolean asyncExecution() { - return this.asyncExecution; - } - - /** - * Set the asyncExecution property: Optional. If set to true, provisioning will complete as soon as the script - * starts and will not wait for script to complete. - * - * @param asyncExecution the asyncExecution value to set. - * @return the VirtualMachineRunCommandProperties object itself. - */ - public VirtualMachineRunCommandProperties withAsyncExecution(Boolean asyncExecution) { - this.asyncExecution = asyncExecution; - return this; - } - - /** - * Get the runAsUser property: Specifies the user account on the VM when executing the run command. - * - * @return the runAsUser value. - */ - public String runAsUser() { - return this.runAsUser; - } - - /** - * Set the runAsUser property: Specifies the user account on the VM when executing the run command. - * - * @param runAsUser the runAsUser value to set. - * @return the VirtualMachineRunCommandProperties object itself. - */ - public VirtualMachineRunCommandProperties withRunAsUser(String runAsUser) { - this.runAsUser = runAsUser; - return this; - } - - /** - * Get the runAsPassword property: Specifies the user account password on the VM when executing the run command. - * - * @return the runAsPassword value. - */ - public String runAsPassword() { - return this.runAsPassword; - } - - /** - * Set the runAsPassword property: Specifies the user account password on the VM when executing the run command. - * - * @param runAsPassword the runAsPassword value to set. - * @return the VirtualMachineRunCommandProperties object itself. - */ - public VirtualMachineRunCommandProperties withRunAsPassword(String runAsPassword) { - this.runAsPassword = runAsPassword; - return this; - } - - /** - * Get the timeoutInSeconds property: The timeout in seconds to execute the run command. - * - * @return the timeoutInSeconds value. - */ - public Integer timeoutInSeconds() { - return this.timeoutInSeconds; - } - - /** - * Set the timeoutInSeconds property: The timeout in seconds to execute the run command. - * - * @param timeoutInSeconds the timeoutInSeconds value to set. - * @return the VirtualMachineRunCommandProperties object itself. - */ - public VirtualMachineRunCommandProperties withTimeoutInSeconds(Integer timeoutInSeconds) { - this.timeoutInSeconds = timeoutInSeconds; - return this; - } - - /** - * Get the outputBlobUri property: Specifies the Azure storage blob where script output stream will be uploaded. - * - * @return the outputBlobUri value. - */ - public String outputBlobUri() { - return this.outputBlobUri; - } - - /** - * Set the outputBlobUri property: Specifies the Azure storage blob where script output stream will be uploaded. - * - * @param outputBlobUri the outputBlobUri value to set. - * @return the VirtualMachineRunCommandProperties object itself. - */ - public VirtualMachineRunCommandProperties withOutputBlobUri(String outputBlobUri) { - this.outputBlobUri = outputBlobUri; - return this; - } - - /** - * Get the errorBlobUri property: Specifies the Azure storage blob where script error stream will be uploaded. - * - * @return the errorBlobUri value. - */ - public String errorBlobUri() { - return this.errorBlobUri; - } - - /** - * Set the errorBlobUri property: Specifies the Azure storage blob where script error stream will be uploaded. - * - * @param errorBlobUri the errorBlobUri value to set. - * @return the VirtualMachineRunCommandProperties object itself. - */ - public VirtualMachineRunCommandProperties withErrorBlobUri(String errorBlobUri) { - this.errorBlobUri = errorBlobUri; - return this; - } - - /** - * Get the provisioningState property: The provisioning state, which only appears in the response. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Get the instanceView property: The virtual machine run command instance view. - * - * @return the instanceView value. - */ - public VirtualMachineRunCommandInstanceView instanceView() { - return this.instanceView; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (source() != null) { - source().validate(); - } - if (parameters() != null) { - parameters().forEach(e -> e.validate()); - } - if (protectedParameters() != null) { - protectedParameters().forEach(e -> e.validate()); - } - if (instanceView() != null) { - instanceView().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineScaleSetExtensionInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineScaleSetExtensionInner.java deleted file mode 100644 index d11c2bf35b9c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineScaleSetExtensionInner.java +++ /dev/null @@ -1,315 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.models.SubResourceReadOnly; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Describes a Virtual Machine Scale Set Extension. */ -@Fluent -public final class VirtualMachineScaleSetExtensionInner extends SubResourceReadOnly { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetExtensionInner.class); - - /* - * The name of the extension. - */ - @JsonProperty(value = "name") - private String name; - - /* - * Resource type - */ - @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) - private String type; - - /* - * Describes the properties of a Virtual Machine Scale Set Extension. - */ - @JsonProperty(value = "properties") - private VirtualMachineScaleSetExtensionProperties innerProperties; - - /** - * Get the name property: The name of the extension. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the extension. - * - * @param name the name value to set. - * @return the VirtualMachineScaleSetExtensionInner object itself. - */ - public VirtualMachineScaleSetExtensionInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the type property: Resource type. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Get the innerProperties property: Describes the properties of a Virtual Machine Scale Set Extension. - * - * @return the innerProperties value. - */ - private VirtualMachineScaleSetExtensionProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the forceUpdateTag property: If a value is provided and is different from the previous value, the extension - * handler will be forced to update even if the extension configuration has not changed. - * - * @return the forceUpdateTag value. - */ - public String forceUpdateTag() { - return this.innerProperties() == null ? null : this.innerProperties().forceUpdateTag(); - } - - /** - * Set the forceUpdateTag property: If a value is provided and is different from the previous value, the extension - * handler will be forced to update even if the extension configuration has not changed. - * - * @param forceUpdateTag the forceUpdateTag value to set. - * @return the VirtualMachineScaleSetExtensionInner object itself. - */ - public VirtualMachineScaleSetExtensionInner withForceUpdateTag(String forceUpdateTag) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetExtensionProperties(); - } - this.innerProperties().withForceUpdateTag(forceUpdateTag); - return this; - } - - /** - * Get the publisher property: The name of the extension handler publisher. - * - * @return the publisher value. - */ - public String publisher() { - return this.innerProperties() == null ? null : this.innerProperties().publisher(); - } - - /** - * Set the publisher property: The name of the extension handler publisher. - * - * @param publisher the publisher value to set. - * @return the VirtualMachineScaleSetExtensionInner object itself. - */ - public VirtualMachineScaleSetExtensionInner withPublisher(String publisher) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetExtensionProperties(); - } - this.innerProperties().withPublisher(publisher); - return this; - } - - /** - * Get the type property: Specifies the type of the extension; an example is "CustomScriptExtension". - * - * @return the type value. - */ - public String typePropertiesType() { - return this.innerProperties() == null ? null : this.innerProperties().type(); - } - - /** - * Set the type property: Specifies the type of the extension; an example is "CustomScriptExtension". - * - * @param type the type value to set. - * @return the VirtualMachineScaleSetExtensionInner object itself. - */ - public VirtualMachineScaleSetExtensionInner withTypePropertiesType(String type) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetExtensionProperties(); - } - this.innerProperties().withType(type); - return this; - } - - /** - * Get the typeHandlerVersion property: Specifies the version of the script handler. - * - * @return the typeHandlerVersion value. - */ - public String typeHandlerVersion() { - return this.innerProperties() == null ? null : this.innerProperties().typeHandlerVersion(); - } - - /** - * Set the typeHandlerVersion property: Specifies the version of the script handler. - * - * @param typeHandlerVersion the typeHandlerVersion value to set. - * @return the VirtualMachineScaleSetExtensionInner object itself. - */ - public VirtualMachineScaleSetExtensionInner withTypeHandlerVersion(String typeHandlerVersion) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetExtensionProperties(); - } - this.innerProperties().withTypeHandlerVersion(typeHandlerVersion); - return this; - } - - /** - * Get the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one - * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless - * redeployed, even with this property set to true. - * - * @return the autoUpgradeMinorVersion value. - */ - public Boolean autoUpgradeMinorVersion() { - return this.innerProperties() == null ? null : this.innerProperties().autoUpgradeMinorVersion(); - } - - /** - * Set the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one - * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless - * redeployed, even with this property set to true. - * - * @param autoUpgradeMinorVersion the autoUpgradeMinorVersion value to set. - * @return the VirtualMachineScaleSetExtensionInner object itself. - */ - public VirtualMachineScaleSetExtensionInner withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetExtensionProperties(); - } - this.innerProperties().withAutoUpgradeMinorVersion(autoUpgradeMinorVersion); - return this; - } - - /** - * Get the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the - * platform if there is a newer version of the extension available. - * - * @return the enableAutomaticUpgrade value. - */ - public Boolean enableAutomaticUpgrade() { - return this.innerProperties() == null ? null : this.innerProperties().enableAutomaticUpgrade(); - } - - /** - * Set the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the - * platform if there is a newer version of the extension available. - * - * @param enableAutomaticUpgrade the enableAutomaticUpgrade value to set. - * @return the VirtualMachineScaleSetExtensionInner object itself. - */ - public VirtualMachineScaleSetExtensionInner withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetExtensionProperties(); - } - this.innerProperties().withEnableAutomaticUpgrade(enableAutomaticUpgrade); - return this; - } - - /** - * Get the settings property: Json formatted public settings for the extension. - * - * @return the settings value. - */ - public Object settings() { - return this.innerProperties() == null ? null : this.innerProperties().settings(); - } - - /** - * Set the settings property: Json formatted public settings for the extension. - * - * @param settings the settings value to set. - * @return the VirtualMachineScaleSetExtensionInner object itself. - */ - public VirtualMachineScaleSetExtensionInner withSettings(Object settings) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetExtensionProperties(); - } - this.innerProperties().withSettings(settings); - return this; - } - - /** - * Get the protectedSettings property: The extension can contain either protectedSettings or - * protectedSettingsFromKeyVault or no protected settings at all. - * - * @return the protectedSettings value. - */ - public Object protectedSettings() { - return this.innerProperties() == null ? null : this.innerProperties().protectedSettings(); - } - - /** - * Set the protectedSettings property: The extension can contain either protectedSettings or - * protectedSettingsFromKeyVault or no protected settings at all. - * - * @param protectedSettings the protectedSettings value to set. - * @return the VirtualMachineScaleSetExtensionInner object itself. - */ - public VirtualMachineScaleSetExtensionInner withProtectedSettings(Object protectedSettings) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetExtensionProperties(); - } - this.innerProperties().withProtectedSettings(protectedSettings); - return this; - } - - /** - * Get the provisioningState property: The provisioning state, which only appears in the response. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the provisionAfterExtensions property: Collection of extension names after which this extension needs to be - * provisioned. - * - * @return the provisionAfterExtensions value. - */ - public List provisionAfterExtensions() { - return this.innerProperties() == null ? null : this.innerProperties().provisionAfterExtensions(); - } - - /** - * Set the provisionAfterExtensions property: Collection of extension names after which this extension needs to be - * provisioned. - * - * @param provisionAfterExtensions the provisionAfterExtensions value to set. - * @return the VirtualMachineScaleSetExtensionInner object itself. - */ - public VirtualMachineScaleSetExtensionInner withProvisionAfterExtensions(List provisionAfterExtensions) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetExtensionProperties(); - } - this.innerProperties().withProvisionAfterExtensions(provisionAfterExtensions); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineScaleSetExtensionProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineScaleSetExtensionProperties.java deleted file mode 100644 index 19a48fb8f55a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineScaleSetExtensionProperties.java +++ /dev/null @@ -1,296 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Describes the properties of a Virtual Machine Scale Set Extension. */ -@Fluent -public final class VirtualMachineScaleSetExtensionProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetExtensionProperties.class); - - /* - * If a value is provided and is different from the previous value, the - * extension handler will be forced to update even if the extension - * configuration has not changed. - */ - @JsonProperty(value = "forceUpdateTag") - private String forceUpdateTag; - - /* - * The name of the extension handler publisher. - */ - @JsonProperty(value = "publisher") - private String publisher; - - /* - * Specifies the type of the extension; an example is - * "CustomScriptExtension". - */ - @JsonProperty(value = "type") - private String type; - - /* - * Specifies the version of the script handler. - */ - @JsonProperty(value = "typeHandlerVersion") - private String typeHandlerVersion; - - /* - * Indicates whether the extension should use a newer minor version if one - * is available at deployment time. Once deployed, however, the extension - * will not upgrade minor versions unless redeployed, even with this - * property set to true. - */ - @JsonProperty(value = "autoUpgradeMinorVersion") - private Boolean autoUpgradeMinorVersion; - - /* - * Indicates whether the extension should be automatically upgraded by the - * platform if there is a newer version of the extension available. - */ - @JsonProperty(value = "enableAutomaticUpgrade") - private Boolean enableAutomaticUpgrade; - - /* - * Json formatted public settings for the extension. - */ - @JsonProperty(value = "settings") - private Object settings; - - /* - * The extension can contain either protectedSettings or - * protectedSettingsFromKeyVault or no protected settings at all. - */ - @JsonProperty(value = "protectedSettings") - private Object protectedSettings; - - /* - * The provisioning state, which only appears in the response. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; - - /* - * Collection of extension names after which this extension needs to be - * provisioned. - */ - @JsonProperty(value = "provisionAfterExtensions") - private List provisionAfterExtensions; - - /** - * Get the forceUpdateTag property: If a value is provided and is different from the previous value, the extension - * handler will be forced to update even if the extension configuration has not changed. - * - * @return the forceUpdateTag value. - */ - public String forceUpdateTag() { - return this.forceUpdateTag; - } - - /** - * Set the forceUpdateTag property: If a value is provided and is different from the previous value, the extension - * handler will be forced to update even if the extension configuration has not changed. - * - * @param forceUpdateTag the forceUpdateTag value to set. - * @return the VirtualMachineScaleSetExtensionProperties object itself. - */ - public VirtualMachineScaleSetExtensionProperties withForceUpdateTag(String forceUpdateTag) { - this.forceUpdateTag = forceUpdateTag; - return this; - } - - /** - * Get the publisher property: The name of the extension handler publisher. - * - * @return the publisher value. - */ - public String publisher() { - return this.publisher; - } - - /** - * Set the publisher property: The name of the extension handler publisher. - * - * @param publisher the publisher value to set. - * @return the VirtualMachineScaleSetExtensionProperties object itself. - */ - public VirtualMachineScaleSetExtensionProperties withPublisher(String publisher) { - this.publisher = publisher; - return this; - } - - /** - * Get the type property: Specifies the type of the extension; an example is "CustomScriptExtension". - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Set the type property: Specifies the type of the extension; an example is "CustomScriptExtension". - * - * @param type the type value to set. - * @return the VirtualMachineScaleSetExtensionProperties object itself. - */ - public VirtualMachineScaleSetExtensionProperties withType(String type) { - this.type = type; - return this; - } - - /** - * Get the typeHandlerVersion property: Specifies the version of the script handler. - * - * @return the typeHandlerVersion value. - */ - public String typeHandlerVersion() { - return this.typeHandlerVersion; - } - - /** - * Set the typeHandlerVersion property: Specifies the version of the script handler. - * - * @param typeHandlerVersion the typeHandlerVersion value to set. - * @return the VirtualMachineScaleSetExtensionProperties object itself. - */ - public VirtualMachineScaleSetExtensionProperties withTypeHandlerVersion(String typeHandlerVersion) { - this.typeHandlerVersion = typeHandlerVersion; - return this; - } - - /** - * Get the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one - * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless - * redeployed, even with this property set to true. - * - * @return the autoUpgradeMinorVersion value. - */ - public Boolean autoUpgradeMinorVersion() { - return this.autoUpgradeMinorVersion; - } - - /** - * Set the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one - * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless - * redeployed, even with this property set to true. - * - * @param autoUpgradeMinorVersion the autoUpgradeMinorVersion value to set. - * @return the VirtualMachineScaleSetExtensionProperties object itself. - */ - public VirtualMachineScaleSetExtensionProperties withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion) { - this.autoUpgradeMinorVersion = autoUpgradeMinorVersion; - return this; - } - - /** - * Get the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the - * platform if there is a newer version of the extension available. - * - * @return the enableAutomaticUpgrade value. - */ - public Boolean enableAutomaticUpgrade() { - return this.enableAutomaticUpgrade; - } - - /** - * Set the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the - * platform if there is a newer version of the extension available. - * - * @param enableAutomaticUpgrade the enableAutomaticUpgrade value to set. - * @return the VirtualMachineScaleSetExtensionProperties object itself. - */ - public VirtualMachineScaleSetExtensionProperties withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade) { - this.enableAutomaticUpgrade = enableAutomaticUpgrade; - return this; - } - - /** - * Get the settings property: Json formatted public settings for the extension. - * - * @return the settings value. - */ - public Object settings() { - return this.settings; - } - - /** - * Set the settings property: Json formatted public settings for the extension. - * - * @param settings the settings value to set. - * @return the VirtualMachineScaleSetExtensionProperties object itself. - */ - public VirtualMachineScaleSetExtensionProperties withSettings(Object settings) { - this.settings = settings; - return this; - } - - /** - * Get the protectedSettings property: The extension can contain either protectedSettings or - * protectedSettingsFromKeyVault or no protected settings at all. - * - * @return the protectedSettings value. - */ - public Object protectedSettings() { - return this.protectedSettings; - } - - /** - * Set the protectedSettings property: The extension can contain either protectedSettings or - * protectedSettingsFromKeyVault or no protected settings at all. - * - * @param protectedSettings the protectedSettings value to set. - * @return the VirtualMachineScaleSetExtensionProperties object itself. - */ - public VirtualMachineScaleSetExtensionProperties withProtectedSettings(Object protectedSettings) { - this.protectedSettings = protectedSettings; - return this; - } - - /** - * Get the provisioningState property: The provisioning state, which only appears in the response. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Get the provisionAfterExtensions property: Collection of extension names after which this extension needs to be - * provisioned. - * - * @return the provisionAfterExtensions value. - */ - public List provisionAfterExtensions() { - return this.provisionAfterExtensions; - } - - /** - * Set the provisionAfterExtensions property: Collection of extension names after which this extension needs to be - * provisioned. - * - * @param provisionAfterExtensions the provisionAfterExtensions value to set. - * @return the VirtualMachineScaleSetExtensionProperties object itself. - */ - public VirtualMachineScaleSetExtensionProperties withProvisionAfterExtensions( - List provisionAfterExtensions) { - this.provisionAfterExtensions = provisionAfterExtensions; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineScaleSetInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineScaleSetInner.java deleted file mode 100644 index 7f2af145923c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineScaleSetInner.java +++ /dev/null @@ -1,514 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.models.AdditionalCapabilities; -import com.azure.resourcemanager.compute.models.AutomaticRepairsPolicy; -import com.azure.resourcemanager.compute.models.Plan; -import com.azure.resourcemanager.compute.models.ScaleInPolicy; -import com.azure.resourcemanager.compute.models.Sku; -import com.azure.resourcemanager.compute.models.UpgradePolicy; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetIdentity; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetVMProfile; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** Describes a Virtual Machine Scale Set. */ -@Fluent -public final class VirtualMachineScaleSetInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetInner.class); - - /* - * The virtual machine scale set sku. - */ - @JsonProperty(value = "sku") - private Sku sku; - - /* - * Specifies information about the marketplace image used to create the - * virtual machine. This element is only used for marketplace images. - * Before you can use a marketplace image from an API, you must enable the - * image for programmatic use. In the Azure portal, find the marketplace - * image that you want to use and then click **Want to deploy - * programmatically, Get Started ->**. Enter any required information and - * then click **Save**. - */ - @JsonProperty(value = "plan") - private Plan plan; - - /* - * Describes the properties of a Virtual Machine Scale Set. - */ - @JsonProperty(value = "properties") - private VirtualMachineScaleSetProperties innerProperties; - - /* - * The identity of the virtual machine scale set, if configured. - */ - @JsonProperty(value = "identity") - private VirtualMachineScaleSetIdentity identity; - - /* - * The virtual machine scale set zones. NOTE: Availability zones can only - * be set when you create the scale set - */ - @JsonProperty(value = "zones") - private List zones; - - /** - * Get the sku property: The virtual machine scale set sku. - * - * @return the sku value. - */ - public Sku sku() { - return this.sku; - } - - /** - * Set the sku property: The virtual machine scale set sku. - * - * @param sku the sku value to set. - * @return the VirtualMachineScaleSetInner object itself. - */ - public VirtualMachineScaleSetInner withSku(Sku sku) { - this.sku = sku; - return this; - } - - /** - * Get the plan property: Specifies information about the marketplace image used to create the virtual machine. This - * element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable - * the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then - * click **Want to deploy programmatically, Get Started ->**. Enter any required information and then click - * **Save**. - * - * @return the plan value. - */ - public Plan plan() { - return this.plan; - } - - /** - * Set the plan property: Specifies information about the marketplace image used to create the virtual machine. This - * element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable - * the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then - * click **Want to deploy programmatically, Get Started ->**. Enter any required information and then click - * **Save**. - * - * @param plan the plan value to set. - * @return the VirtualMachineScaleSetInner object itself. - */ - public VirtualMachineScaleSetInner withPlan(Plan plan) { - this.plan = plan; - return this; - } - - /** - * Get the innerProperties property: Describes the properties of a Virtual Machine Scale Set. - * - * @return the innerProperties value. - */ - private VirtualMachineScaleSetProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the identity property: The identity of the virtual machine scale set, if configured. - * - * @return the identity value. - */ - public VirtualMachineScaleSetIdentity identity() { - return this.identity; - } - - /** - * Set the identity property: The identity of the virtual machine scale set, if configured. - * - * @param identity the identity value to set. - * @return the VirtualMachineScaleSetInner object itself. - */ - public VirtualMachineScaleSetInner withIdentity(VirtualMachineScaleSetIdentity identity) { - this.identity = identity; - return this; - } - - /** - * Get the zones property: The virtual machine scale set zones. NOTE: Availability zones can only be set when you - * create the scale set. - * - * @return the zones value. - */ - public List zones() { - return this.zones; - } - - /** - * Set the zones property: The virtual machine scale set zones. NOTE: Availability zones can only be set when you - * create the scale set. - * - * @param zones the zones value to set. - * @return the VirtualMachineScaleSetInner object itself. - */ - public VirtualMachineScaleSetInner withZones(List zones) { - this.zones = zones; - return this; - } - - /** {@inheritDoc} */ - @Override - public VirtualMachineScaleSetInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public VirtualMachineScaleSetInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the upgradePolicy property: The upgrade policy. - * - * @return the upgradePolicy value. - */ - public UpgradePolicy upgradePolicy() { - return this.innerProperties() == null ? null : this.innerProperties().upgradePolicy(); - } - - /** - * Set the upgradePolicy property: The upgrade policy. - * - * @param upgradePolicy the upgradePolicy value to set. - * @return the VirtualMachineScaleSetInner object itself. - */ - public VirtualMachineScaleSetInner withUpgradePolicy(UpgradePolicy upgradePolicy) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetProperties(); - } - this.innerProperties().withUpgradePolicy(upgradePolicy); - return this; - } - - /** - * Get the automaticRepairsPolicy property: Policy for automatic repairs. - * - * @return the automaticRepairsPolicy value. - */ - public AutomaticRepairsPolicy automaticRepairsPolicy() { - return this.innerProperties() == null ? null : this.innerProperties().automaticRepairsPolicy(); - } - - /** - * Set the automaticRepairsPolicy property: Policy for automatic repairs. - * - * @param automaticRepairsPolicy the automaticRepairsPolicy value to set. - * @return the VirtualMachineScaleSetInner object itself. - */ - public VirtualMachineScaleSetInner withAutomaticRepairsPolicy(AutomaticRepairsPolicy automaticRepairsPolicy) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetProperties(); - } - this.innerProperties().withAutomaticRepairsPolicy(automaticRepairsPolicy); - return this; - } - - /** - * Get the virtualMachineProfile property: The virtual machine profile. - * - * @return the virtualMachineProfile value. - */ - public VirtualMachineScaleSetVMProfile virtualMachineProfile() { - return this.innerProperties() == null ? null : this.innerProperties().virtualMachineProfile(); - } - - /** - * Set the virtualMachineProfile property: The virtual machine profile. - * - * @param virtualMachineProfile the virtualMachineProfile value to set. - * @return the VirtualMachineScaleSetInner object itself. - */ - public VirtualMachineScaleSetInner withVirtualMachineProfile( - VirtualMachineScaleSetVMProfile virtualMachineProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetProperties(); - } - this.innerProperties().withVirtualMachineProfile(virtualMachineProfile); - return this; - } - - /** - * Get the provisioningState property: The provisioning state, which only appears in the response. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the overprovision property: Specifies whether the Virtual Machine Scale Set should be overprovisioned. - * - * @return the overprovision value. - */ - public Boolean overprovision() { - return this.innerProperties() == null ? null : this.innerProperties().overprovision(); - } - - /** - * Set the overprovision property: Specifies whether the Virtual Machine Scale Set should be overprovisioned. - * - * @param overprovision the overprovision value to set. - * @return the VirtualMachineScaleSetInner object itself. - */ - public VirtualMachineScaleSetInner withOverprovision(Boolean overprovision) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetProperties(); - } - this.innerProperties().withOverprovision(overprovision); - return this; - } - - /** - * Get the doNotRunExtensionsOnOverprovisionedVMs property: When Overprovision is enabled, extensions are launched - * only on the requested number of VMs which are finally kept. This property will hence ensure that the extensions - * do not run on the extra overprovisioned VMs. - * - * @return the doNotRunExtensionsOnOverprovisionedVMs value. - */ - public Boolean doNotRunExtensionsOnOverprovisionedVMs() { - return this.innerProperties() == null ? null : this.innerProperties().doNotRunExtensionsOnOverprovisionedVMs(); - } - - /** - * Set the doNotRunExtensionsOnOverprovisionedVMs property: When Overprovision is enabled, extensions are launched - * only on the requested number of VMs which are finally kept. This property will hence ensure that the extensions - * do not run on the extra overprovisioned VMs. - * - * @param doNotRunExtensionsOnOverprovisionedVMs the doNotRunExtensionsOnOverprovisionedVMs value to set. - * @return the VirtualMachineScaleSetInner object itself. - */ - public VirtualMachineScaleSetInner withDoNotRunExtensionsOnOverprovisionedVMs( - Boolean doNotRunExtensionsOnOverprovisionedVMs) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetProperties(); - } - this.innerProperties().withDoNotRunExtensionsOnOverprovisionedVMs(doNotRunExtensionsOnOverprovisionedVMs); - return this; - } - - /** - * Get the uniqueId property: Specifies the ID which uniquely identifies a Virtual Machine Scale Set. - * - * @return the uniqueId value. - */ - public String uniqueId() { - return this.innerProperties() == null ? null : this.innerProperties().uniqueId(); - } - - /** - * Get the singlePlacementGroup property: When true this limits the scale set to a single placement group, of max - * size 100 virtual machines. NOTE: If singlePlacementGroup is true, it may be modified to false. However, if - * singlePlacementGroup is false, it may not be modified to true. - * - * @return the singlePlacementGroup value. - */ - public Boolean singlePlacementGroup() { - return this.innerProperties() == null ? null : this.innerProperties().singlePlacementGroup(); - } - - /** - * Set the singlePlacementGroup property: When true this limits the scale set to a single placement group, of max - * size 100 virtual machines. NOTE: If singlePlacementGroup is true, it may be modified to false. However, if - * singlePlacementGroup is false, it may not be modified to true. - * - * @param singlePlacementGroup the singlePlacementGroup value to set. - * @return the VirtualMachineScaleSetInner object itself. - */ - public VirtualMachineScaleSetInner withSinglePlacementGroup(Boolean singlePlacementGroup) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetProperties(); - } - this.innerProperties().withSinglePlacementGroup(singlePlacementGroup); - return this; - } - - /** - * Get the zoneBalance property: Whether to force strictly even Virtual Machine distribution cross x-zones in case - * there is zone outage. - * - * @return the zoneBalance value. - */ - public Boolean zoneBalance() { - return this.innerProperties() == null ? null : this.innerProperties().zoneBalance(); - } - - /** - * Set the zoneBalance property: Whether to force strictly even Virtual Machine distribution cross x-zones in case - * there is zone outage. - * - * @param zoneBalance the zoneBalance value to set. - * @return the VirtualMachineScaleSetInner object itself. - */ - public VirtualMachineScaleSetInner withZoneBalance(Boolean zoneBalance) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetProperties(); - } - this.innerProperties().withZoneBalance(zoneBalance); - return this; - } - - /** - * Get the platformFaultDomainCount property: Fault Domain count for each placement group. - * - * @return the platformFaultDomainCount value. - */ - public Integer platformFaultDomainCount() { - return this.innerProperties() == null ? null : this.innerProperties().platformFaultDomainCount(); - } - - /** - * Set the platformFaultDomainCount property: Fault Domain count for each placement group. - * - * @param platformFaultDomainCount the platformFaultDomainCount value to set. - * @return the VirtualMachineScaleSetInner object itself. - */ - public VirtualMachineScaleSetInner withPlatformFaultDomainCount(Integer platformFaultDomainCount) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetProperties(); - } - this.innerProperties().withPlatformFaultDomainCount(platformFaultDomainCount); - return this; - } - - /** - * Get the proximityPlacementGroup property: Specifies information about the proximity placement group that the - * virtual machine scale set should be assigned to. <br><br>Minimum api-version: 2018-04-01. - * - * @return the proximityPlacementGroup value. - */ - public SubResource proximityPlacementGroup() { - return this.innerProperties() == null ? null : this.innerProperties().proximityPlacementGroup(); - } - - /** - * Set the proximityPlacementGroup property: Specifies information about the proximity placement group that the - * virtual machine scale set should be assigned to. <br><br>Minimum api-version: 2018-04-01. - * - * @param proximityPlacementGroup the proximityPlacementGroup value to set. - * @return the VirtualMachineScaleSetInner object itself. - */ - public VirtualMachineScaleSetInner withProximityPlacementGroup(SubResource proximityPlacementGroup) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetProperties(); - } - this.innerProperties().withProximityPlacementGroup(proximityPlacementGroup); - return this; - } - - /** - * Get the hostGroup property: Specifies information about the dedicated host group that the virtual machine scale - * set resides in. <br><br>Minimum api-version: 2020-06-01. - * - * @return the hostGroup value. - */ - public SubResource hostGroup() { - return this.innerProperties() == null ? null : this.innerProperties().hostGroup(); - } - - /** - * Set the hostGroup property: Specifies information about the dedicated host group that the virtual machine scale - * set resides in. <br><br>Minimum api-version: 2020-06-01. - * - * @param hostGroup the hostGroup value to set. - * @return the VirtualMachineScaleSetInner object itself. - */ - public VirtualMachineScaleSetInner withHostGroup(SubResource hostGroup) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetProperties(); - } - this.innerProperties().withHostGroup(hostGroup); - return this; - } - - /** - * Get the additionalCapabilities property: Specifies additional capabilities enabled or disabled on the Virtual - * Machines in the Virtual Machine Scale Set. For instance: whether the Virtual Machines have the capability to - * support attaching managed data disks with UltraSSD_LRS storage account type. - * - * @return the additionalCapabilities value. - */ - public AdditionalCapabilities additionalCapabilities() { - return this.innerProperties() == null ? null : this.innerProperties().additionalCapabilities(); - } - - /** - * Set the additionalCapabilities property: Specifies additional capabilities enabled or disabled on the Virtual - * Machines in the Virtual Machine Scale Set. For instance: whether the Virtual Machines have the capability to - * support attaching managed data disks with UltraSSD_LRS storage account type. - * - * @param additionalCapabilities the additionalCapabilities value to set. - * @return the VirtualMachineScaleSetInner object itself. - */ - public VirtualMachineScaleSetInner withAdditionalCapabilities(AdditionalCapabilities additionalCapabilities) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetProperties(); - } - this.innerProperties().withAdditionalCapabilities(additionalCapabilities); - return this; - } - - /** - * Get the scaleInPolicy property: Specifies the scale-in policy that decides which virtual machines are chosen for - * removal when a Virtual Machine Scale Set is scaled-in. - * - * @return the scaleInPolicy value. - */ - public ScaleInPolicy scaleInPolicy() { - return this.innerProperties() == null ? null : this.innerProperties().scaleInPolicy(); - } - - /** - * Set the scaleInPolicy property: Specifies the scale-in policy that decides which virtual machines are chosen for - * removal when a Virtual Machine Scale Set is scaled-in. - * - * @param scaleInPolicy the scaleInPolicy value to set. - * @return the VirtualMachineScaleSetInner object itself. - */ - public VirtualMachineScaleSetInner withScaleInPolicy(ScaleInPolicy scaleInPolicy) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetProperties(); - } - this.innerProperties().withScaleInPolicy(scaleInPolicy); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (sku() != null) { - sku().validate(); - } - if (plan() != null) { - plan().validate(); - } - if (innerProperties() != null) { - innerProperties().validate(); - } - if (identity() != null) { - identity().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineScaleSetInstanceViewInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineScaleSetInstanceViewInner.java deleted file mode 100644 index b8a8404e7e2c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineScaleSetInstanceViewInner.java +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.models.InstanceViewStatus; -import com.azure.resourcemanager.compute.models.OrchestrationServiceSummary; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetInstanceViewStatusesSummary; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetVMExtensionsSummary; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The instance view of a virtual machine scale set. */ -@Fluent -public final class VirtualMachineScaleSetInstanceViewInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetInstanceViewInner.class); - - /* - * The instance view status summary for the virtual machine scale set. - */ - @JsonProperty(value = "virtualMachine", access = JsonProperty.Access.WRITE_ONLY) - private VirtualMachineScaleSetInstanceViewStatusesSummary virtualMachine; - - /* - * The extensions information. - */ - @JsonProperty(value = "extensions", access = JsonProperty.Access.WRITE_ONLY) - private List extensions; - - /* - * The resource status information. - */ - @JsonProperty(value = "statuses") - private List statuses; - - /* - * The orchestration services information. - */ - @JsonProperty(value = "orchestrationServices", access = JsonProperty.Access.WRITE_ONLY) - private List orchestrationServices; - - /** - * Get the virtualMachine property: The instance view status summary for the virtual machine scale set. - * - * @return the virtualMachine value. - */ - public VirtualMachineScaleSetInstanceViewStatusesSummary virtualMachine() { - return this.virtualMachine; - } - - /** - * Get the extensions property: The extensions information. - * - * @return the extensions value. - */ - public List extensions() { - return this.extensions; - } - - /** - * Get the statuses property: The resource status information. - * - * @return the statuses value. - */ - public List statuses() { - return this.statuses; - } - - /** - * Set the statuses property: The resource status information. - * - * @param statuses the statuses value to set. - * @return the VirtualMachineScaleSetInstanceViewInner object itself. - */ - public VirtualMachineScaleSetInstanceViewInner withStatuses(List statuses) { - this.statuses = statuses; - return this; - } - - /** - * Get the orchestrationServices property: The orchestration services information. - * - * @return the orchestrationServices value. - */ - public List orchestrationServices() { - return this.orchestrationServices; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (virtualMachine() != null) { - virtualMachine().validate(); - } - if (extensions() != null) { - extensions().forEach(e -> e.validate()); - } - if (statuses() != null) { - statuses().forEach(e -> e.validate()); - } - if (orchestrationServices() != null) { - orchestrationServices().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineScaleSetIpConfigurationProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineScaleSetIpConfigurationProperties.java deleted file mode 100644 index 1e70de2e5061..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineScaleSetIpConfigurationProperties.java +++ /dev/null @@ -1,278 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.models.ApiEntityReference; -import com.azure.resourcemanager.compute.models.IpVersion; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetPublicIpAddressConfiguration; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Describes a virtual machine scale set network profile's IP configuration properties. */ -@Fluent -public final class VirtualMachineScaleSetIpConfigurationProperties { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetIpConfigurationProperties.class); - - /* - * Specifies the identifier of the subnet. - */ - @JsonProperty(value = "subnet") - private ApiEntityReference subnet; - - /* - * Specifies the primary network interface in case the virtual machine has - * more than 1 network interface. - */ - @JsonProperty(value = "primary") - private Boolean primary; - - /* - * The publicIPAddressConfiguration. - */ - @JsonProperty(value = "publicIPAddressConfiguration") - private VirtualMachineScaleSetPublicIpAddressConfiguration publicIpAddressConfiguration; - - /* - * Available from Api-Version 2017-03-30 onwards, it represents whether the - * specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. - * Possible values are: 'IPv4' and 'IPv6'. - */ - @JsonProperty(value = "privateIPAddressVersion") - private IpVersion privateIpAddressVersion; - - /* - * Specifies an array of references to backend address pools of application - * gateways. A scale set can reference backend address pools of multiple - * application gateways. Multiple scale sets cannot use the same - * application gateway. - */ - @JsonProperty(value = "applicationGatewayBackendAddressPools") - private List applicationGatewayBackendAddressPools; - - /* - * Specifies an array of references to application security group. - */ - @JsonProperty(value = "applicationSecurityGroups") - private List applicationSecurityGroups; - - /* - * Specifies an array of references to backend address pools of load - * balancers. A scale set can reference backend address pools of one public - * and one internal load balancer. Multiple scale sets cannot use the same - * basic sku load balancer. - */ - @JsonProperty(value = "loadBalancerBackendAddressPools") - private List loadBalancerBackendAddressPools; - - /* - * Specifies an array of references to inbound Nat pools of the load - * balancers. A scale set can reference inbound nat pools of one public and - * one internal load balancer. Multiple scale sets cannot use the same - * basic sku load balancer. - */ - @JsonProperty(value = "loadBalancerInboundNatPools") - private List loadBalancerInboundNatPools; - - /** - * Get the subnet property: Specifies the identifier of the subnet. - * - * @return the subnet value. - */ - public ApiEntityReference subnet() { - return this.subnet; - } - - /** - * Set the subnet property: Specifies the identifier of the subnet. - * - * @param subnet the subnet value to set. - * @return the VirtualMachineScaleSetIpConfigurationProperties object itself. - */ - public VirtualMachineScaleSetIpConfigurationProperties withSubnet(ApiEntityReference subnet) { - this.subnet = subnet; - return this; - } - - /** - * Get the primary property: Specifies the primary network interface in case the virtual machine has more than 1 - * network interface. - * - * @return the primary value. - */ - public Boolean primary() { - return this.primary; - } - - /** - * Set the primary property: Specifies the primary network interface in case the virtual machine has more than 1 - * network interface. - * - * @param primary the primary value to set. - * @return the VirtualMachineScaleSetIpConfigurationProperties object itself. - */ - public VirtualMachineScaleSetIpConfigurationProperties withPrimary(Boolean primary) { - this.primary = primary; - return this; - } - - /** - * Get the publicIpAddressConfiguration property: The publicIPAddressConfiguration. - * - * @return the publicIpAddressConfiguration value. - */ - public VirtualMachineScaleSetPublicIpAddressConfiguration publicIpAddressConfiguration() { - return this.publicIpAddressConfiguration; - } - - /** - * Set the publicIpAddressConfiguration property: The publicIPAddressConfiguration. - * - * @param publicIpAddressConfiguration the publicIpAddressConfiguration value to set. - * @return the VirtualMachineScaleSetIpConfigurationProperties object itself. - */ - public VirtualMachineScaleSetIpConfigurationProperties withPublicIpAddressConfiguration( - VirtualMachineScaleSetPublicIpAddressConfiguration publicIpAddressConfiguration) { - this.publicIpAddressConfiguration = publicIpAddressConfiguration; - return this; - } - - /** - * Get the privateIpAddressVersion property: Available from Api-Version 2017-03-30 onwards, it represents whether - * the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. - * - * @return the privateIpAddressVersion value. - */ - public IpVersion privateIpAddressVersion() { - return this.privateIpAddressVersion; - } - - /** - * Set the privateIpAddressVersion property: Available from Api-Version 2017-03-30 onwards, it represents whether - * the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. - * - * @param privateIpAddressVersion the privateIpAddressVersion value to set. - * @return the VirtualMachineScaleSetIpConfigurationProperties object itself. - */ - public VirtualMachineScaleSetIpConfigurationProperties withPrivateIpAddressVersion( - IpVersion privateIpAddressVersion) { - this.privateIpAddressVersion = privateIpAddressVersion; - return this; - } - - /** - * Get the applicationGatewayBackendAddressPools property: Specifies an array of references to backend address pools - * of application gateways. A scale set can reference backend address pools of multiple application gateways. - * Multiple scale sets cannot use the same application gateway. - * - * @return the applicationGatewayBackendAddressPools value. - */ - public List applicationGatewayBackendAddressPools() { - return this.applicationGatewayBackendAddressPools; - } - - /** - * Set the applicationGatewayBackendAddressPools property: Specifies an array of references to backend address pools - * of application gateways. A scale set can reference backend address pools of multiple application gateways. - * Multiple scale sets cannot use the same application gateway. - * - * @param applicationGatewayBackendAddressPools the applicationGatewayBackendAddressPools value to set. - * @return the VirtualMachineScaleSetIpConfigurationProperties object itself. - */ - public VirtualMachineScaleSetIpConfigurationProperties withApplicationGatewayBackendAddressPools( - List applicationGatewayBackendAddressPools) { - this.applicationGatewayBackendAddressPools = applicationGatewayBackendAddressPools; - return this; - } - - /** - * Get the applicationSecurityGroups property: Specifies an array of references to application security group. - * - * @return the applicationSecurityGroups value. - */ - public List applicationSecurityGroups() { - return this.applicationSecurityGroups; - } - - /** - * Set the applicationSecurityGroups property: Specifies an array of references to application security group. - * - * @param applicationSecurityGroups the applicationSecurityGroups value to set. - * @return the VirtualMachineScaleSetIpConfigurationProperties object itself. - */ - public VirtualMachineScaleSetIpConfigurationProperties withApplicationSecurityGroups( - List applicationSecurityGroups) { - this.applicationSecurityGroups = applicationSecurityGroups; - return this; - } - - /** - * Get the loadBalancerBackendAddressPools property: Specifies an array of references to backend address pools of - * load balancers. A scale set can reference backend address pools of one public and one internal load balancer. - * Multiple scale sets cannot use the same basic sku load balancer. - * - * @return the loadBalancerBackendAddressPools value. - */ - public List loadBalancerBackendAddressPools() { - return this.loadBalancerBackendAddressPools; - } - - /** - * Set the loadBalancerBackendAddressPools property: Specifies an array of references to backend address pools of - * load balancers. A scale set can reference backend address pools of one public and one internal load balancer. - * Multiple scale sets cannot use the same basic sku load balancer. - * - * @param loadBalancerBackendAddressPools the loadBalancerBackendAddressPools value to set. - * @return the VirtualMachineScaleSetIpConfigurationProperties object itself. - */ - public VirtualMachineScaleSetIpConfigurationProperties withLoadBalancerBackendAddressPools( - List loadBalancerBackendAddressPools) { - this.loadBalancerBackendAddressPools = loadBalancerBackendAddressPools; - return this; - } - - /** - * Get the loadBalancerInboundNatPools property: Specifies an array of references to inbound Nat pools of the load - * balancers. A scale set can reference inbound nat pools of one public and one internal load balancer. Multiple - * scale sets cannot use the same basic sku load balancer. - * - * @return the loadBalancerInboundNatPools value. - */ - public List loadBalancerInboundNatPools() { - return this.loadBalancerInboundNatPools; - } - - /** - * Set the loadBalancerInboundNatPools property: Specifies an array of references to inbound Nat pools of the load - * balancers. A scale set can reference inbound nat pools of one public and one internal load balancer. Multiple - * scale sets cannot use the same basic sku load balancer. - * - * @param loadBalancerInboundNatPools the loadBalancerInboundNatPools value to set. - * @return the VirtualMachineScaleSetIpConfigurationProperties object itself. - */ - public VirtualMachineScaleSetIpConfigurationProperties withLoadBalancerInboundNatPools( - List loadBalancerInboundNatPools) { - this.loadBalancerInboundNatPools = loadBalancerInboundNatPools; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (subnet() != null) { - subnet().validate(); - } - if (publicIpAddressConfiguration() != null) { - publicIpAddressConfiguration().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineScaleSetNetworkConfigurationProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineScaleSetNetworkConfigurationProperties.java deleted file mode 100644 index c500ae19b255..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineScaleSetNetworkConfigurationProperties.java +++ /dev/null @@ -1,233 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetIpConfiguration; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetNetworkConfigurationDnsSettings; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Describes a virtual machine scale set network profile's IP configuration. */ -@Fluent -public final class VirtualMachineScaleSetNetworkConfigurationProperties { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetNetworkConfigurationProperties.class); - - /* - * Specifies the primary network interface in case the virtual machine has - * more than 1 network interface. - */ - @JsonProperty(value = "primary") - private Boolean primary; - - /* - * Specifies whether the network interface is accelerated - * networking-enabled. - */ - @JsonProperty(value = "enableAcceleratedNetworking") - private Boolean enableAcceleratedNetworking; - - /* - * Specifies whether the network interface is FPGA networking-enabled. - */ - @JsonProperty(value = "enableFpga") - private Boolean enableFpga; - - /* - * The network security group. - */ - @JsonProperty(value = "networkSecurityGroup") - private SubResource networkSecurityGroup; - - /* - * The dns settings to be applied on the network interfaces. - */ - @JsonProperty(value = "dnsSettings") - private VirtualMachineScaleSetNetworkConfigurationDnsSettings dnsSettings; - - /* - * Specifies the IP configurations of the network interface. - */ - @JsonProperty(value = "ipConfigurations", required = true) - private List ipConfigurations; - - /* - * Whether IP forwarding enabled on this NIC. - */ - @JsonProperty(value = "enableIPForwarding") - private Boolean enableIpForwarding; - - /** - * Get the primary property: Specifies the primary network interface in case the virtual machine has more than 1 - * network interface. - * - * @return the primary value. - */ - public Boolean primary() { - return this.primary; - } - - /** - * Set the primary property: Specifies the primary network interface in case the virtual machine has more than 1 - * network interface. - * - * @param primary the primary value to set. - * @return the VirtualMachineScaleSetNetworkConfigurationProperties object itself. - */ - public VirtualMachineScaleSetNetworkConfigurationProperties withPrimary(Boolean primary) { - this.primary = primary; - return this; - } - - /** - * Get the enableAcceleratedNetworking property: Specifies whether the network interface is accelerated - * networking-enabled. - * - * @return the enableAcceleratedNetworking value. - */ - public Boolean enableAcceleratedNetworking() { - return this.enableAcceleratedNetworking; - } - - /** - * Set the enableAcceleratedNetworking property: Specifies whether the network interface is accelerated - * networking-enabled. - * - * @param enableAcceleratedNetworking the enableAcceleratedNetworking value to set. - * @return the VirtualMachineScaleSetNetworkConfigurationProperties object itself. - */ - public VirtualMachineScaleSetNetworkConfigurationProperties withEnableAcceleratedNetworking( - Boolean enableAcceleratedNetworking) { - this.enableAcceleratedNetworking = enableAcceleratedNetworking; - return this; - } - - /** - * Get the enableFpga property: Specifies whether the network interface is FPGA networking-enabled. - * - * @return the enableFpga value. - */ - public Boolean enableFpga() { - return this.enableFpga; - } - - /** - * Set the enableFpga property: Specifies whether the network interface is FPGA networking-enabled. - * - * @param enableFpga the enableFpga value to set. - * @return the VirtualMachineScaleSetNetworkConfigurationProperties object itself. - */ - public VirtualMachineScaleSetNetworkConfigurationProperties withEnableFpga(Boolean enableFpga) { - this.enableFpga = enableFpga; - return this; - } - - /** - * Get the networkSecurityGroup property: The network security group. - * - * @return the networkSecurityGroup value. - */ - public SubResource networkSecurityGroup() { - return this.networkSecurityGroup; - } - - /** - * Set the networkSecurityGroup property: The network security group. - * - * @param networkSecurityGroup the networkSecurityGroup value to set. - * @return the VirtualMachineScaleSetNetworkConfigurationProperties object itself. - */ - public VirtualMachineScaleSetNetworkConfigurationProperties withNetworkSecurityGroup( - SubResource networkSecurityGroup) { - this.networkSecurityGroup = networkSecurityGroup; - return this; - } - - /** - * Get the dnsSettings property: The dns settings to be applied on the network interfaces. - * - * @return the dnsSettings value. - */ - public VirtualMachineScaleSetNetworkConfigurationDnsSettings dnsSettings() { - return this.dnsSettings; - } - - /** - * Set the dnsSettings property: The dns settings to be applied on the network interfaces. - * - * @param dnsSettings the dnsSettings value to set. - * @return the VirtualMachineScaleSetNetworkConfigurationProperties object itself. - */ - public VirtualMachineScaleSetNetworkConfigurationProperties withDnsSettings( - VirtualMachineScaleSetNetworkConfigurationDnsSettings dnsSettings) { - this.dnsSettings = dnsSettings; - return this; - } - - /** - * Get the ipConfigurations property: Specifies the IP configurations of the network interface. - * - * @return the ipConfigurations value. - */ - public List ipConfigurations() { - return this.ipConfigurations; - } - - /** - * Set the ipConfigurations property: Specifies the IP configurations of the network interface. - * - * @param ipConfigurations the ipConfigurations value to set. - * @return the VirtualMachineScaleSetNetworkConfigurationProperties object itself. - */ - public VirtualMachineScaleSetNetworkConfigurationProperties withIpConfigurations( - List ipConfigurations) { - this.ipConfigurations = ipConfigurations; - return this; - } - - /** - * Get the enableIpForwarding property: Whether IP forwarding enabled on this NIC. - * - * @return the enableIpForwarding value. - */ - public Boolean enableIpForwarding() { - return this.enableIpForwarding; - } - - /** - * Set the enableIpForwarding property: Whether IP forwarding enabled on this NIC. - * - * @param enableIpForwarding the enableIpForwarding value to set. - * @return the VirtualMachineScaleSetNetworkConfigurationProperties object itself. - */ - public VirtualMachineScaleSetNetworkConfigurationProperties withEnableIpForwarding(Boolean enableIpForwarding) { - this.enableIpForwarding = enableIpForwarding; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (dnsSettings() != null) { - dnsSettings().validate(); - } - if (ipConfigurations() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property ipConfigurations in model" - + " VirtualMachineScaleSetNetworkConfigurationProperties")); - } else { - ipConfigurations().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineScaleSetProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineScaleSetProperties.java deleted file mode 100644 index 20b227d715cb..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineScaleSetProperties.java +++ /dev/null @@ -1,423 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.models.AdditionalCapabilities; -import com.azure.resourcemanager.compute.models.AutomaticRepairsPolicy; -import com.azure.resourcemanager.compute.models.ScaleInPolicy; -import com.azure.resourcemanager.compute.models.UpgradePolicy; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetVMProfile; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describes the properties of a Virtual Machine Scale Set. */ -@Fluent -public final class VirtualMachineScaleSetProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetProperties.class); - - /* - * The upgrade policy. - */ - @JsonProperty(value = "upgradePolicy") - private UpgradePolicy upgradePolicy; - - /* - * Policy for automatic repairs. - */ - @JsonProperty(value = "automaticRepairsPolicy") - private AutomaticRepairsPolicy automaticRepairsPolicy; - - /* - * The virtual machine profile. - */ - @JsonProperty(value = "virtualMachineProfile") - private VirtualMachineScaleSetVMProfile virtualMachineProfile; - - /* - * The provisioning state, which only appears in the response. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; - - /* - * Specifies whether the Virtual Machine Scale Set should be - * overprovisioned. - */ - @JsonProperty(value = "overprovision") - private Boolean overprovision; - - /* - * When Overprovision is enabled, extensions are launched only on the - * requested number of VMs which are finally kept. This property will hence - * ensure that the extensions do not run on the extra overprovisioned VMs. - */ - @JsonProperty(value = "doNotRunExtensionsOnOverprovisionedVMs") - private Boolean doNotRunExtensionsOnOverprovisionedVMs; - - /* - * Specifies the ID which uniquely identifies a Virtual Machine Scale Set. - */ - @JsonProperty(value = "uniqueId", access = JsonProperty.Access.WRITE_ONLY) - private String uniqueId; - - /* - * When true this limits the scale set to a single placement group, of max - * size 100 virtual machines. NOTE: If singlePlacementGroup is true, it may - * be modified to false. However, if singlePlacementGroup is false, it may - * not be modified to true. - */ - @JsonProperty(value = "singlePlacementGroup") - private Boolean singlePlacementGroup; - - /* - * Whether to force strictly even Virtual Machine distribution cross - * x-zones in case there is zone outage. - */ - @JsonProperty(value = "zoneBalance") - private Boolean zoneBalance; - - /* - * Fault Domain count for each placement group. - */ - @JsonProperty(value = "platformFaultDomainCount") - private Integer platformFaultDomainCount; - - /* - * Specifies information about the proximity placement group that the - * virtual machine scale set should be assigned to.

Minimum - * api-version: 2018-04-01. - */ - @JsonProperty(value = "proximityPlacementGroup") - private SubResource proximityPlacementGroup; - - /* - * Specifies information about the dedicated host group that the virtual - * machine scale set resides in.

Minimum api-version: 2020-06-01. - */ - @JsonProperty(value = "hostGroup") - private SubResource hostGroup; - - /* - * Specifies additional capabilities enabled or disabled on the Virtual - * Machines in the Virtual Machine Scale Set. For instance: whether the - * Virtual Machines have the capability to support attaching managed data - * disks with UltraSSD_LRS storage account type. - */ - @JsonProperty(value = "additionalCapabilities") - private AdditionalCapabilities additionalCapabilities; - - /* - * Specifies the scale-in policy that decides which virtual machines are - * chosen for removal when a Virtual Machine Scale Set is scaled-in. - */ - @JsonProperty(value = "scaleInPolicy") - private ScaleInPolicy scaleInPolicy; - - /** - * Get the upgradePolicy property: The upgrade policy. - * - * @return the upgradePolicy value. - */ - public UpgradePolicy upgradePolicy() { - return this.upgradePolicy; - } - - /** - * Set the upgradePolicy property: The upgrade policy. - * - * @param upgradePolicy the upgradePolicy value to set. - * @return the VirtualMachineScaleSetProperties object itself. - */ - public VirtualMachineScaleSetProperties withUpgradePolicy(UpgradePolicy upgradePolicy) { - this.upgradePolicy = upgradePolicy; - return this; - } - - /** - * Get the automaticRepairsPolicy property: Policy for automatic repairs. - * - * @return the automaticRepairsPolicy value. - */ - public AutomaticRepairsPolicy automaticRepairsPolicy() { - return this.automaticRepairsPolicy; - } - - /** - * Set the automaticRepairsPolicy property: Policy for automatic repairs. - * - * @param automaticRepairsPolicy the automaticRepairsPolicy value to set. - * @return the VirtualMachineScaleSetProperties object itself. - */ - public VirtualMachineScaleSetProperties withAutomaticRepairsPolicy(AutomaticRepairsPolicy automaticRepairsPolicy) { - this.automaticRepairsPolicy = automaticRepairsPolicy; - return this; - } - - /** - * Get the virtualMachineProfile property: The virtual machine profile. - * - * @return the virtualMachineProfile value. - */ - public VirtualMachineScaleSetVMProfile virtualMachineProfile() { - return this.virtualMachineProfile; - } - - /** - * Set the virtualMachineProfile property: The virtual machine profile. - * - * @param virtualMachineProfile the virtualMachineProfile value to set. - * @return the VirtualMachineScaleSetProperties object itself. - */ - public VirtualMachineScaleSetProperties withVirtualMachineProfile( - VirtualMachineScaleSetVMProfile virtualMachineProfile) { - this.virtualMachineProfile = virtualMachineProfile; - return this; - } - - /** - * Get the provisioningState property: The provisioning state, which only appears in the response. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Get the overprovision property: Specifies whether the Virtual Machine Scale Set should be overprovisioned. - * - * @return the overprovision value. - */ - public Boolean overprovision() { - return this.overprovision; - } - - /** - * Set the overprovision property: Specifies whether the Virtual Machine Scale Set should be overprovisioned. - * - * @param overprovision the overprovision value to set. - * @return the VirtualMachineScaleSetProperties object itself. - */ - public VirtualMachineScaleSetProperties withOverprovision(Boolean overprovision) { - this.overprovision = overprovision; - return this; - } - - /** - * Get the doNotRunExtensionsOnOverprovisionedVMs property: When Overprovision is enabled, extensions are launched - * only on the requested number of VMs which are finally kept. This property will hence ensure that the extensions - * do not run on the extra overprovisioned VMs. - * - * @return the doNotRunExtensionsOnOverprovisionedVMs value. - */ - public Boolean doNotRunExtensionsOnOverprovisionedVMs() { - return this.doNotRunExtensionsOnOverprovisionedVMs; - } - - /** - * Set the doNotRunExtensionsOnOverprovisionedVMs property: When Overprovision is enabled, extensions are launched - * only on the requested number of VMs which are finally kept. This property will hence ensure that the extensions - * do not run on the extra overprovisioned VMs. - * - * @param doNotRunExtensionsOnOverprovisionedVMs the doNotRunExtensionsOnOverprovisionedVMs value to set. - * @return the VirtualMachineScaleSetProperties object itself. - */ - public VirtualMachineScaleSetProperties withDoNotRunExtensionsOnOverprovisionedVMs( - Boolean doNotRunExtensionsOnOverprovisionedVMs) { - this.doNotRunExtensionsOnOverprovisionedVMs = doNotRunExtensionsOnOverprovisionedVMs; - return this; - } - - /** - * Get the uniqueId property: Specifies the ID which uniquely identifies a Virtual Machine Scale Set. - * - * @return the uniqueId value. - */ - public String uniqueId() { - return this.uniqueId; - } - - /** - * Get the singlePlacementGroup property: When true this limits the scale set to a single placement group, of max - * size 100 virtual machines. NOTE: If singlePlacementGroup is true, it may be modified to false. However, if - * singlePlacementGroup is false, it may not be modified to true. - * - * @return the singlePlacementGroup value. - */ - public Boolean singlePlacementGroup() { - return this.singlePlacementGroup; - } - - /** - * Set the singlePlacementGroup property: When true this limits the scale set to a single placement group, of max - * size 100 virtual machines. NOTE: If singlePlacementGroup is true, it may be modified to false. However, if - * singlePlacementGroup is false, it may not be modified to true. - * - * @param singlePlacementGroup the singlePlacementGroup value to set. - * @return the VirtualMachineScaleSetProperties object itself. - */ - public VirtualMachineScaleSetProperties withSinglePlacementGroup(Boolean singlePlacementGroup) { - this.singlePlacementGroup = singlePlacementGroup; - return this; - } - - /** - * Get the zoneBalance property: Whether to force strictly even Virtual Machine distribution cross x-zones in case - * there is zone outage. - * - * @return the zoneBalance value. - */ - public Boolean zoneBalance() { - return this.zoneBalance; - } - - /** - * Set the zoneBalance property: Whether to force strictly even Virtual Machine distribution cross x-zones in case - * there is zone outage. - * - * @param zoneBalance the zoneBalance value to set. - * @return the VirtualMachineScaleSetProperties object itself. - */ - public VirtualMachineScaleSetProperties withZoneBalance(Boolean zoneBalance) { - this.zoneBalance = zoneBalance; - return this; - } - - /** - * Get the platformFaultDomainCount property: Fault Domain count for each placement group. - * - * @return the platformFaultDomainCount value. - */ - public Integer platformFaultDomainCount() { - return this.platformFaultDomainCount; - } - - /** - * Set the platformFaultDomainCount property: Fault Domain count for each placement group. - * - * @param platformFaultDomainCount the platformFaultDomainCount value to set. - * @return the VirtualMachineScaleSetProperties object itself. - */ - public VirtualMachineScaleSetProperties withPlatformFaultDomainCount(Integer platformFaultDomainCount) { - this.platformFaultDomainCount = platformFaultDomainCount; - return this; - } - - /** - * Get the proximityPlacementGroup property: Specifies information about the proximity placement group that the - * virtual machine scale set should be assigned to. <br><br>Minimum api-version: 2018-04-01. - * - * @return the proximityPlacementGroup value. - */ - public SubResource proximityPlacementGroup() { - return this.proximityPlacementGroup; - } - - /** - * Set the proximityPlacementGroup property: Specifies information about the proximity placement group that the - * virtual machine scale set should be assigned to. <br><br>Minimum api-version: 2018-04-01. - * - * @param proximityPlacementGroup the proximityPlacementGroup value to set. - * @return the VirtualMachineScaleSetProperties object itself. - */ - public VirtualMachineScaleSetProperties withProximityPlacementGroup(SubResource proximityPlacementGroup) { - this.proximityPlacementGroup = proximityPlacementGroup; - return this; - } - - /** - * Get the hostGroup property: Specifies information about the dedicated host group that the virtual machine scale - * set resides in. <br><br>Minimum api-version: 2020-06-01. - * - * @return the hostGroup value. - */ - public SubResource hostGroup() { - return this.hostGroup; - } - - /** - * Set the hostGroup property: Specifies information about the dedicated host group that the virtual machine scale - * set resides in. <br><br>Minimum api-version: 2020-06-01. - * - * @param hostGroup the hostGroup value to set. - * @return the VirtualMachineScaleSetProperties object itself. - */ - public VirtualMachineScaleSetProperties withHostGroup(SubResource hostGroup) { - this.hostGroup = hostGroup; - return this; - } - - /** - * Get the additionalCapabilities property: Specifies additional capabilities enabled or disabled on the Virtual - * Machines in the Virtual Machine Scale Set. For instance: whether the Virtual Machines have the capability to - * support attaching managed data disks with UltraSSD_LRS storage account type. - * - * @return the additionalCapabilities value. - */ - public AdditionalCapabilities additionalCapabilities() { - return this.additionalCapabilities; - } - - /** - * Set the additionalCapabilities property: Specifies additional capabilities enabled or disabled on the Virtual - * Machines in the Virtual Machine Scale Set. For instance: whether the Virtual Machines have the capability to - * support attaching managed data disks with UltraSSD_LRS storage account type. - * - * @param additionalCapabilities the additionalCapabilities value to set. - * @return the VirtualMachineScaleSetProperties object itself. - */ - public VirtualMachineScaleSetProperties withAdditionalCapabilities(AdditionalCapabilities additionalCapabilities) { - this.additionalCapabilities = additionalCapabilities; - return this; - } - - /** - * Get the scaleInPolicy property: Specifies the scale-in policy that decides which virtual machines are chosen for - * removal when a Virtual Machine Scale Set is scaled-in. - * - * @return the scaleInPolicy value. - */ - public ScaleInPolicy scaleInPolicy() { - return this.scaleInPolicy; - } - - /** - * Set the scaleInPolicy property: Specifies the scale-in policy that decides which virtual machines are chosen for - * removal when a Virtual Machine Scale Set is scaled-in. - * - * @param scaleInPolicy the scaleInPolicy value to set. - * @return the VirtualMachineScaleSetProperties object itself. - */ - public VirtualMachineScaleSetProperties withScaleInPolicy(ScaleInPolicy scaleInPolicy) { - this.scaleInPolicy = scaleInPolicy; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (upgradePolicy() != null) { - upgradePolicy().validate(); - } - if (automaticRepairsPolicy() != null) { - automaticRepairsPolicy().validate(); - } - if (virtualMachineProfile() != null) { - virtualMachineProfile().validate(); - } - if (additionalCapabilities() != null) { - additionalCapabilities().validate(); - } - if (scaleInPolicy() != null) { - scaleInPolicy().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineScaleSetPublicIpAddressConfigurationProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineScaleSetPublicIpAddressConfigurationProperties.java deleted file mode 100644 index 86b22d253a62..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineScaleSetPublicIpAddressConfigurationProperties.java +++ /dev/null @@ -1,175 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.models.IpVersion; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetIpTag; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Describes a virtual machines scale set IP Configuration's PublicIPAddress configuration. */ -@Fluent -public final class VirtualMachineScaleSetPublicIpAddressConfigurationProperties { - @JsonIgnore - private final ClientLogger logger = - new ClientLogger(VirtualMachineScaleSetPublicIpAddressConfigurationProperties.class); - - /* - * The idle timeout of the public IP address. - */ - @JsonProperty(value = "idleTimeoutInMinutes") - private Integer idleTimeoutInMinutes; - - /* - * The dns settings to be applied on the publicIP addresses . - */ - @JsonProperty(value = "dnsSettings") - private VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings dnsSettings; - - /* - * The list of IP tags associated with the public IP address. - */ - @JsonProperty(value = "ipTags") - private List ipTags; - - /* - * The PublicIPPrefix from which to allocate publicIP addresses. - */ - @JsonProperty(value = "publicIPPrefix") - private SubResource publicIpPrefix; - - /* - * Available from Api-Version 2019-07-01 onwards, it represents whether the - * specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. - * Possible values are: 'IPv4' and 'IPv6'. - */ - @JsonProperty(value = "publicIPAddressVersion") - private IpVersion publicIpAddressVersion; - - /** - * Get the idleTimeoutInMinutes property: The idle timeout of the public IP address. - * - * @return the idleTimeoutInMinutes value. - */ - public Integer idleTimeoutInMinutes() { - return this.idleTimeoutInMinutes; - } - - /** - * Set the idleTimeoutInMinutes property: The idle timeout of the public IP address. - * - * @param idleTimeoutInMinutes the idleTimeoutInMinutes value to set. - * @return the VirtualMachineScaleSetPublicIpAddressConfigurationProperties object itself. - */ - public VirtualMachineScaleSetPublicIpAddressConfigurationProperties withIdleTimeoutInMinutes( - Integer idleTimeoutInMinutes) { - this.idleTimeoutInMinutes = idleTimeoutInMinutes; - return this; - } - - /** - * Get the dnsSettings property: The dns settings to be applied on the publicIP addresses . - * - * @return the dnsSettings value. - */ - public VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings dnsSettings() { - return this.dnsSettings; - } - - /** - * Set the dnsSettings property: The dns settings to be applied on the publicIP addresses . - * - * @param dnsSettings the dnsSettings value to set. - * @return the VirtualMachineScaleSetPublicIpAddressConfigurationProperties object itself. - */ - public VirtualMachineScaleSetPublicIpAddressConfigurationProperties withDnsSettings( - VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings dnsSettings) { - this.dnsSettings = dnsSettings; - return this; - } - - /** - * Get the ipTags property: The list of IP tags associated with the public IP address. - * - * @return the ipTags value. - */ - public List ipTags() { - return this.ipTags; - } - - /** - * Set the ipTags property: The list of IP tags associated with the public IP address. - * - * @param ipTags the ipTags value to set. - * @return the VirtualMachineScaleSetPublicIpAddressConfigurationProperties object itself. - */ - public VirtualMachineScaleSetPublicIpAddressConfigurationProperties withIpTags( - List ipTags) { - this.ipTags = ipTags; - return this; - } - - /** - * Get the publicIpPrefix property: The PublicIPPrefix from which to allocate publicIP addresses. - * - * @return the publicIpPrefix value. - */ - public SubResource publicIpPrefix() { - return this.publicIpPrefix; - } - - /** - * Set the publicIpPrefix property: The PublicIPPrefix from which to allocate publicIP addresses. - * - * @param publicIpPrefix the publicIpPrefix value to set. - * @return the VirtualMachineScaleSetPublicIpAddressConfigurationProperties object itself. - */ - public VirtualMachineScaleSetPublicIpAddressConfigurationProperties withPublicIpPrefix(SubResource publicIpPrefix) { - this.publicIpPrefix = publicIpPrefix; - return this; - } - - /** - * Get the publicIpAddressVersion property: Available from Api-Version 2019-07-01 onwards, it represents whether the - * specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. - * - * @return the publicIpAddressVersion value. - */ - public IpVersion publicIpAddressVersion() { - return this.publicIpAddressVersion; - } - - /** - * Set the publicIpAddressVersion property: Available from Api-Version 2019-07-01 onwards, it represents whether the - * specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. - * - * @param publicIpAddressVersion the publicIpAddressVersion value to set. - * @return the VirtualMachineScaleSetPublicIpAddressConfigurationProperties object itself. - */ - public VirtualMachineScaleSetPublicIpAddressConfigurationProperties withPublicIpAddressVersion( - IpVersion publicIpAddressVersion) { - this.publicIpAddressVersion = publicIpAddressVersion; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (dnsSettings() != null) { - dnsSettings().validate(); - } - if (ipTags() != null) { - ipTags().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineScaleSetSkuInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineScaleSetSkuInner.java deleted file mode 100644 index 0640ab87cdf1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineScaleSetSkuInner.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.models.Sku; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetSkuCapacity; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describes an available virtual machine scale set sku. */ -@Immutable -public final class VirtualMachineScaleSetSkuInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetSkuInner.class); - - /* - * The type of resource the sku applies to. - */ - @JsonProperty(value = "resourceType", access = JsonProperty.Access.WRITE_ONLY) - private String resourceType; - - /* - * The Sku. - */ - @JsonProperty(value = "sku", access = JsonProperty.Access.WRITE_ONLY) - private Sku sku; - - /* - * Specifies the number of virtual machines in the scale set. - */ - @JsonProperty(value = "capacity", access = JsonProperty.Access.WRITE_ONLY) - private VirtualMachineScaleSetSkuCapacity capacity; - - /** - * Get the resourceType property: The type of resource the sku applies to. - * - * @return the resourceType value. - */ - public String resourceType() { - return this.resourceType; - } - - /** - * Get the sku property: The Sku. - * - * @return the sku value. - */ - public Sku sku() { - return this.sku; - } - - /** - * Get the capacity property: Specifies the number of virtual machines in the scale set. - * - * @return the capacity value. - */ - public VirtualMachineScaleSetSkuCapacity capacity() { - return this.capacity; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (sku() != null) { - sku().validate(); - } - if (capacity() != null) { - capacity().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineScaleSetUpdateIpConfigurationProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineScaleSetUpdateIpConfigurationProperties.java deleted file mode 100644 index b47dfe1e7989..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineScaleSetUpdateIpConfigurationProperties.java +++ /dev/null @@ -1,257 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.models.ApiEntityReference; -import com.azure.resourcemanager.compute.models.IpVersion; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetUpdatePublicIpAddressConfiguration; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Describes a virtual machine scale set network profile's IP configuration properties. */ -@Fluent -public final class VirtualMachineScaleSetUpdateIpConfigurationProperties { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetUpdateIpConfigurationProperties.class); - - /* - * The subnet. - */ - @JsonProperty(value = "subnet") - private ApiEntityReference subnet; - - /* - * Specifies the primary IP Configuration in case the network interface has - * more than one IP Configuration. - */ - @JsonProperty(value = "primary") - private Boolean primary; - - /* - * The publicIPAddressConfiguration. - */ - @JsonProperty(value = "publicIPAddressConfiguration") - private VirtualMachineScaleSetUpdatePublicIpAddressConfiguration publicIpAddressConfiguration; - - /* - * Available from Api-Version 2017-03-30 onwards, it represents whether the - * specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. - * Possible values are: 'IPv4' and 'IPv6'. - */ - @JsonProperty(value = "privateIPAddressVersion") - private IpVersion privateIpAddressVersion; - - /* - * The application gateway backend address pools. - */ - @JsonProperty(value = "applicationGatewayBackendAddressPools") - private List applicationGatewayBackendAddressPools; - - /* - * Specifies an array of references to application security group. - */ - @JsonProperty(value = "applicationSecurityGroups") - private List applicationSecurityGroups; - - /* - * The load balancer backend address pools. - */ - @JsonProperty(value = "loadBalancerBackendAddressPools") - private List loadBalancerBackendAddressPools; - - /* - * The load balancer inbound nat pools. - */ - @JsonProperty(value = "loadBalancerInboundNatPools") - private List loadBalancerInboundNatPools; - - /** - * Get the subnet property: The subnet. - * - * @return the subnet value. - */ - public ApiEntityReference subnet() { - return this.subnet; - } - - /** - * Set the subnet property: The subnet. - * - * @param subnet the subnet value to set. - * @return the VirtualMachineScaleSetUpdateIpConfigurationProperties object itself. - */ - public VirtualMachineScaleSetUpdateIpConfigurationProperties withSubnet(ApiEntityReference subnet) { - this.subnet = subnet; - return this; - } - - /** - * Get the primary property: Specifies the primary IP Configuration in case the network interface has more than one - * IP Configuration. - * - * @return the primary value. - */ - public Boolean primary() { - return this.primary; - } - - /** - * Set the primary property: Specifies the primary IP Configuration in case the network interface has more than one - * IP Configuration. - * - * @param primary the primary value to set. - * @return the VirtualMachineScaleSetUpdateIpConfigurationProperties object itself. - */ - public VirtualMachineScaleSetUpdateIpConfigurationProperties withPrimary(Boolean primary) { - this.primary = primary; - return this; - } - - /** - * Get the publicIpAddressConfiguration property: The publicIPAddressConfiguration. - * - * @return the publicIpAddressConfiguration value. - */ - public VirtualMachineScaleSetUpdatePublicIpAddressConfiguration publicIpAddressConfiguration() { - return this.publicIpAddressConfiguration; - } - - /** - * Set the publicIpAddressConfiguration property: The publicIPAddressConfiguration. - * - * @param publicIpAddressConfiguration the publicIpAddressConfiguration value to set. - * @return the VirtualMachineScaleSetUpdateIpConfigurationProperties object itself. - */ - public VirtualMachineScaleSetUpdateIpConfigurationProperties withPublicIpAddressConfiguration( - VirtualMachineScaleSetUpdatePublicIpAddressConfiguration publicIpAddressConfiguration) { - this.publicIpAddressConfiguration = publicIpAddressConfiguration; - return this; - } - - /** - * Get the privateIpAddressVersion property: Available from Api-Version 2017-03-30 onwards, it represents whether - * the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. - * - * @return the privateIpAddressVersion value. - */ - public IpVersion privateIpAddressVersion() { - return this.privateIpAddressVersion; - } - - /** - * Set the privateIpAddressVersion property: Available from Api-Version 2017-03-30 onwards, it represents whether - * the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. - * - * @param privateIpAddressVersion the privateIpAddressVersion value to set. - * @return the VirtualMachineScaleSetUpdateIpConfigurationProperties object itself. - */ - public VirtualMachineScaleSetUpdateIpConfigurationProperties withPrivateIpAddressVersion( - IpVersion privateIpAddressVersion) { - this.privateIpAddressVersion = privateIpAddressVersion; - return this; - } - - /** - * Get the applicationGatewayBackendAddressPools property: The application gateway backend address pools. - * - * @return the applicationGatewayBackendAddressPools value. - */ - public List applicationGatewayBackendAddressPools() { - return this.applicationGatewayBackendAddressPools; - } - - /** - * Set the applicationGatewayBackendAddressPools property: The application gateway backend address pools. - * - * @param applicationGatewayBackendAddressPools the applicationGatewayBackendAddressPools value to set. - * @return the VirtualMachineScaleSetUpdateIpConfigurationProperties object itself. - */ - public VirtualMachineScaleSetUpdateIpConfigurationProperties withApplicationGatewayBackendAddressPools( - List applicationGatewayBackendAddressPools) { - this.applicationGatewayBackendAddressPools = applicationGatewayBackendAddressPools; - return this; - } - - /** - * Get the applicationSecurityGroups property: Specifies an array of references to application security group. - * - * @return the applicationSecurityGroups value. - */ - public List applicationSecurityGroups() { - return this.applicationSecurityGroups; - } - - /** - * Set the applicationSecurityGroups property: Specifies an array of references to application security group. - * - * @param applicationSecurityGroups the applicationSecurityGroups value to set. - * @return the VirtualMachineScaleSetUpdateIpConfigurationProperties object itself. - */ - public VirtualMachineScaleSetUpdateIpConfigurationProperties withApplicationSecurityGroups( - List applicationSecurityGroups) { - this.applicationSecurityGroups = applicationSecurityGroups; - return this; - } - - /** - * Get the loadBalancerBackendAddressPools property: The load balancer backend address pools. - * - * @return the loadBalancerBackendAddressPools value. - */ - public List loadBalancerBackendAddressPools() { - return this.loadBalancerBackendAddressPools; - } - - /** - * Set the loadBalancerBackendAddressPools property: The load balancer backend address pools. - * - * @param loadBalancerBackendAddressPools the loadBalancerBackendAddressPools value to set. - * @return the VirtualMachineScaleSetUpdateIpConfigurationProperties object itself. - */ - public VirtualMachineScaleSetUpdateIpConfigurationProperties withLoadBalancerBackendAddressPools( - List loadBalancerBackendAddressPools) { - this.loadBalancerBackendAddressPools = loadBalancerBackendAddressPools; - return this; - } - - /** - * Get the loadBalancerInboundNatPools property: The load balancer inbound nat pools. - * - * @return the loadBalancerInboundNatPools value. - */ - public List loadBalancerInboundNatPools() { - return this.loadBalancerInboundNatPools; - } - - /** - * Set the loadBalancerInboundNatPools property: The load balancer inbound nat pools. - * - * @param loadBalancerInboundNatPools the loadBalancerInboundNatPools value to set. - * @return the VirtualMachineScaleSetUpdateIpConfigurationProperties object itself. - */ - public VirtualMachineScaleSetUpdateIpConfigurationProperties withLoadBalancerInboundNatPools( - List loadBalancerInboundNatPools) { - this.loadBalancerInboundNatPools = loadBalancerInboundNatPools; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (subnet() != null) { - subnet().validate(); - } - if (publicIpAddressConfiguration() != null) { - publicIpAddressConfiguration().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineScaleSetUpdateNetworkConfigurationProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineScaleSetUpdateNetworkConfigurationProperties.java deleted file mode 100644 index 9e17d828e849..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineScaleSetUpdateNetworkConfigurationProperties.java +++ /dev/null @@ -1,229 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetNetworkConfigurationDnsSettings; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetUpdateIpConfiguration; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** - * Describes a virtual machine scale set updatable network profile's IP configuration.Use this object for updating - * network profile's IP Configuration. - */ -@Fluent -public final class VirtualMachineScaleSetUpdateNetworkConfigurationProperties { - @JsonIgnore - private final ClientLogger logger = - new ClientLogger(VirtualMachineScaleSetUpdateNetworkConfigurationProperties.class); - - /* - * Whether this is a primary NIC on a virtual machine. - */ - @JsonProperty(value = "primary") - private Boolean primary; - - /* - * Specifies whether the network interface is accelerated - * networking-enabled. - */ - @JsonProperty(value = "enableAcceleratedNetworking") - private Boolean enableAcceleratedNetworking; - - /* - * Specifies whether the network interface is FPGA networking-enabled. - */ - @JsonProperty(value = "enableFpga") - private Boolean enableFpga; - - /* - * The network security group. - */ - @JsonProperty(value = "networkSecurityGroup") - private SubResource networkSecurityGroup; - - /* - * The dns settings to be applied on the network interfaces. - */ - @JsonProperty(value = "dnsSettings") - private VirtualMachineScaleSetNetworkConfigurationDnsSettings dnsSettings; - - /* - * The virtual machine scale set IP Configuration. - */ - @JsonProperty(value = "ipConfigurations") - private List ipConfigurations; - - /* - * Whether IP forwarding enabled on this NIC. - */ - @JsonProperty(value = "enableIPForwarding") - private Boolean enableIpForwarding; - - /** - * Get the primary property: Whether this is a primary NIC on a virtual machine. - * - * @return the primary value. - */ - public Boolean primary() { - return this.primary; - } - - /** - * Set the primary property: Whether this is a primary NIC on a virtual machine. - * - * @param primary the primary value to set. - * @return the VirtualMachineScaleSetUpdateNetworkConfigurationProperties object itself. - */ - public VirtualMachineScaleSetUpdateNetworkConfigurationProperties withPrimary(Boolean primary) { - this.primary = primary; - return this; - } - - /** - * Get the enableAcceleratedNetworking property: Specifies whether the network interface is accelerated - * networking-enabled. - * - * @return the enableAcceleratedNetworking value. - */ - public Boolean enableAcceleratedNetworking() { - return this.enableAcceleratedNetworking; - } - - /** - * Set the enableAcceleratedNetworking property: Specifies whether the network interface is accelerated - * networking-enabled. - * - * @param enableAcceleratedNetworking the enableAcceleratedNetworking value to set. - * @return the VirtualMachineScaleSetUpdateNetworkConfigurationProperties object itself. - */ - public VirtualMachineScaleSetUpdateNetworkConfigurationProperties withEnableAcceleratedNetworking( - Boolean enableAcceleratedNetworking) { - this.enableAcceleratedNetworking = enableAcceleratedNetworking; - return this; - } - - /** - * Get the enableFpga property: Specifies whether the network interface is FPGA networking-enabled. - * - * @return the enableFpga value. - */ - public Boolean enableFpga() { - return this.enableFpga; - } - - /** - * Set the enableFpga property: Specifies whether the network interface is FPGA networking-enabled. - * - * @param enableFpga the enableFpga value to set. - * @return the VirtualMachineScaleSetUpdateNetworkConfigurationProperties object itself. - */ - public VirtualMachineScaleSetUpdateNetworkConfigurationProperties withEnableFpga(Boolean enableFpga) { - this.enableFpga = enableFpga; - return this; - } - - /** - * Get the networkSecurityGroup property: The network security group. - * - * @return the networkSecurityGroup value. - */ - public SubResource networkSecurityGroup() { - return this.networkSecurityGroup; - } - - /** - * Set the networkSecurityGroup property: The network security group. - * - * @param networkSecurityGroup the networkSecurityGroup value to set. - * @return the VirtualMachineScaleSetUpdateNetworkConfigurationProperties object itself. - */ - public VirtualMachineScaleSetUpdateNetworkConfigurationProperties withNetworkSecurityGroup( - SubResource networkSecurityGroup) { - this.networkSecurityGroup = networkSecurityGroup; - return this; - } - - /** - * Get the dnsSettings property: The dns settings to be applied on the network interfaces. - * - * @return the dnsSettings value. - */ - public VirtualMachineScaleSetNetworkConfigurationDnsSettings dnsSettings() { - return this.dnsSettings; - } - - /** - * Set the dnsSettings property: The dns settings to be applied on the network interfaces. - * - * @param dnsSettings the dnsSettings value to set. - * @return the VirtualMachineScaleSetUpdateNetworkConfigurationProperties object itself. - */ - public VirtualMachineScaleSetUpdateNetworkConfigurationProperties withDnsSettings( - VirtualMachineScaleSetNetworkConfigurationDnsSettings dnsSettings) { - this.dnsSettings = dnsSettings; - return this; - } - - /** - * Get the ipConfigurations property: The virtual machine scale set IP Configuration. - * - * @return the ipConfigurations value. - */ - public List ipConfigurations() { - return this.ipConfigurations; - } - - /** - * Set the ipConfigurations property: The virtual machine scale set IP Configuration. - * - * @param ipConfigurations the ipConfigurations value to set. - * @return the VirtualMachineScaleSetUpdateNetworkConfigurationProperties object itself. - */ - public VirtualMachineScaleSetUpdateNetworkConfigurationProperties withIpConfigurations( - List ipConfigurations) { - this.ipConfigurations = ipConfigurations; - return this; - } - - /** - * Get the enableIpForwarding property: Whether IP forwarding enabled on this NIC. - * - * @return the enableIpForwarding value. - */ - public Boolean enableIpForwarding() { - return this.enableIpForwarding; - } - - /** - * Set the enableIpForwarding property: Whether IP forwarding enabled on this NIC. - * - * @param enableIpForwarding the enableIpForwarding value to set. - * @return the VirtualMachineScaleSetUpdateNetworkConfigurationProperties object itself. - */ - public VirtualMachineScaleSetUpdateNetworkConfigurationProperties withEnableIpForwarding( - Boolean enableIpForwarding) { - this.enableIpForwarding = enableIpForwarding; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (dnsSettings() != null) { - dnsSettings().validate(); - } - if (ipConfigurations() != null) { - ipConfigurations().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineScaleSetUpdateProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineScaleSetUpdateProperties.java deleted file mode 100644 index 5385eb82c5d0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineScaleSetUpdateProperties.java +++ /dev/null @@ -1,311 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.models.AdditionalCapabilities; -import com.azure.resourcemanager.compute.models.AutomaticRepairsPolicy; -import com.azure.resourcemanager.compute.models.ScaleInPolicy; -import com.azure.resourcemanager.compute.models.UpgradePolicy; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetUpdateVMProfile; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describes the properties of a Virtual Machine Scale Set. */ -@Fluent -public final class VirtualMachineScaleSetUpdateProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetUpdateProperties.class); - - /* - * The upgrade policy. - */ - @JsonProperty(value = "upgradePolicy") - private UpgradePolicy upgradePolicy; - - /* - * Policy for automatic repairs. - */ - @JsonProperty(value = "automaticRepairsPolicy") - private AutomaticRepairsPolicy automaticRepairsPolicy; - - /* - * The virtual machine profile. - */ - @JsonProperty(value = "virtualMachineProfile") - private VirtualMachineScaleSetUpdateVMProfile virtualMachineProfile; - - /* - * Specifies whether the Virtual Machine Scale Set should be - * overprovisioned. - */ - @JsonProperty(value = "overprovision") - private Boolean overprovision; - - /* - * When Overprovision is enabled, extensions are launched only on the - * requested number of VMs which are finally kept. This property will hence - * ensure that the extensions do not run on the extra overprovisioned VMs. - */ - @JsonProperty(value = "doNotRunExtensionsOnOverprovisionedVMs") - private Boolean doNotRunExtensionsOnOverprovisionedVMs; - - /* - * When true this limits the scale set to a single placement group, of max - * size 100 virtual machines. NOTE: If singlePlacementGroup is true, it may - * be modified to false. However, if singlePlacementGroup is false, it may - * not be modified to true. - */ - @JsonProperty(value = "singlePlacementGroup") - private Boolean singlePlacementGroup; - - /* - * Specifies additional capabilities enabled or disabled on the Virtual - * Machines in the Virtual Machine Scale Set. For instance: whether the - * Virtual Machines have the capability to support attaching managed data - * disks with UltraSSD_LRS storage account type. - */ - @JsonProperty(value = "additionalCapabilities") - private AdditionalCapabilities additionalCapabilities; - - /* - * Specifies the scale-in policy that decides which virtual machines are - * chosen for removal when a Virtual Machine Scale Set is scaled-in. - */ - @JsonProperty(value = "scaleInPolicy") - private ScaleInPolicy scaleInPolicy; - - /* - * Specifies information about the proximity placement group that the - * virtual machine scale set should be assigned to.

Minimum - * api-version: 2018-04-01. - */ - @JsonProperty(value = "proximityPlacementGroup") - private SubResource proximityPlacementGroup; - - /** - * Get the upgradePolicy property: The upgrade policy. - * - * @return the upgradePolicy value. - */ - public UpgradePolicy upgradePolicy() { - return this.upgradePolicy; - } - - /** - * Set the upgradePolicy property: The upgrade policy. - * - * @param upgradePolicy the upgradePolicy value to set. - * @return the VirtualMachineScaleSetUpdateProperties object itself. - */ - public VirtualMachineScaleSetUpdateProperties withUpgradePolicy(UpgradePolicy upgradePolicy) { - this.upgradePolicy = upgradePolicy; - return this; - } - - /** - * Get the automaticRepairsPolicy property: Policy for automatic repairs. - * - * @return the automaticRepairsPolicy value. - */ - public AutomaticRepairsPolicy automaticRepairsPolicy() { - return this.automaticRepairsPolicy; - } - - /** - * Set the automaticRepairsPolicy property: Policy for automatic repairs. - * - * @param automaticRepairsPolicy the automaticRepairsPolicy value to set. - * @return the VirtualMachineScaleSetUpdateProperties object itself. - */ - public VirtualMachineScaleSetUpdateProperties withAutomaticRepairsPolicy( - AutomaticRepairsPolicy automaticRepairsPolicy) { - this.automaticRepairsPolicy = automaticRepairsPolicy; - return this; - } - - /** - * Get the virtualMachineProfile property: The virtual machine profile. - * - * @return the virtualMachineProfile value. - */ - public VirtualMachineScaleSetUpdateVMProfile virtualMachineProfile() { - return this.virtualMachineProfile; - } - - /** - * Set the virtualMachineProfile property: The virtual machine profile. - * - * @param virtualMachineProfile the virtualMachineProfile value to set. - * @return the VirtualMachineScaleSetUpdateProperties object itself. - */ - public VirtualMachineScaleSetUpdateProperties withVirtualMachineProfile( - VirtualMachineScaleSetUpdateVMProfile virtualMachineProfile) { - this.virtualMachineProfile = virtualMachineProfile; - return this; - } - - /** - * Get the overprovision property: Specifies whether the Virtual Machine Scale Set should be overprovisioned. - * - * @return the overprovision value. - */ - public Boolean overprovision() { - return this.overprovision; - } - - /** - * Set the overprovision property: Specifies whether the Virtual Machine Scale Set should be overprovisioned. - * - * @param overprovision the overprovision value to set. - * @return the VirtualMachineScaleSetUpdateProperties object itself. - */ - public VirtualMachineScaleSetUpdateProperties withOverprovision(Boolean overprovision) { - this.overprovision = overprovision; - return this; - } - - /** - * Get the doNotRunExtensionsOnOverprovisionedVMs property: When Overprovision is enabled, extensions are launched - * only on the requested number of VMs which are finally kept. This property will hence ensure that the extensions - * do not run on the extra overprovisioned VMs. - * - * @return the doNotRunExtensionsOnOverprovisionedVMs value. - */ - public Boolean doNotRunExtensionsOnOverprovisionedVMs() { - return this.doNotRunExtensionsOnOverprovisionedVMs; - } - - /** - * Set the doNotRunExtensionsOnOverprovisionedVMs property: When Overprovision is enabled, extensions are launched - * only on the requested number of VMs which are finally kept. This property will hence ensure that the extensions - * do not run on the extra overprovisioned VMs. - * - * @param doNotRunExtensionsOnOverprovisionedVMs the doNotRunExtensionsOnOverprovisionedVMs value to set. - * @return the VirtualMachineScaleSetUpdateProperties object itself. - */ - public VirtualMachineScaleSetUpdateProperties withDoNotRunExtensionsOnOverprovisionedVMs( - Boolean doNotRunExtensionsOnOverprovisionedVMs) { - this.doNotRunExtensionsOnOverprovisionedVMs = doNotRunExtensionsOnOverprovisionedVMs; - return this; - } - - /** - * Get the singlePlacementGroup property: When true this limits the scale set to a single placement group, of max - * size 100 virtual machines. NOTE: If singlePlacementGroup is true, it may be modified to false. However, if - * singlePlacementGroup is false, it may not be modified to true. - * - * @return the singlePlacementGroup value. - */ - public Boolean singlePlacementGroup() { - return this.singlePlacementGroup; - } - - /** - * Set the singlePlacementGroup property: When true this limits the scale set to a single placement group, of max - * size 100 virtual machines. NOTE: If singlePlacementGroup is true, it may be modified to false. However, if - * singlePlacementGroup is false, it may not be modified to true. - * - * @param singlePlacementGroup the singlePlacementGroup value to set. - * @return the VirtualMachineScaleSetUpdateProperties object itself. - */ - public VirtualMachineScaleSetUpdateProperties withSinglePlacementGroup(Boolean singlePlacementGroup) { - this.singlePlacementGroup = singlePlacementGroup; - return this; - } - - /** - * Get the additionalCapabilities property: Specifies additional capabilities enabled or disabled on the Virtual - * Machines in the Virtual Machine Scale Set. For instance: whether the Virtual Machines have the capability to - * support attaching managed data disks with UltraSSD_LRS storage account type. - * - * @return the additionalCapabilities value. - */ - public AdditionalCapabilities additionalCapabilities() { - return this.additionalCapabilities; - } - - /** - * Set the additionalCapabilities property: Specifies additional capabilities enabled or disabled on the Virtual - * Machines in the Virtual Machine Scale Set. For instance: whether the Virtual Machines have the capability to - * support attaching managed data disks with UltraSSD_LRS storage account type. - * - * @param additionalCapabilities the additionalCapabilities value to set. - * @return the VirtualMachineScaleSetUpdateProperties object itself. - */ - public VirtualMachineScaleSetUpdateProperties withAdditionalCapabilities( - AdditionalCapabilities additionalCapabilities) { - this.additionalCapabilities = additionalCapabilities; - return this; - } - - /** - * Get the scaleInPolicy property: Specifies the scale-in policy that decides which virtual machines are chosen for - * removal when a Virtual Machine Scale Set is scaled-in. - * - * @return the scaleInPolicy value. - */ - public ScaleInPolicy scaleInPolicy() { - return this.scaleInPolicy; - } - - /** - * Set the scaleInPolicy property: Specifies the scale-in policy that decides which virtual machines are chosen for - * removal when a Virtual Machine Scale Set is scaled-in. - * - * @param scaleInPolicy the scaleInPolicy value to set. - * @return the VirtualMachineScaleSetUpdateProperties object itself. - */ - public VirtualMachineScaleSetUpdateProperties withScaleInPolicy(ScaleInPolicy scaleInPolicy) { - this.scaleInPolicy = scaleInPolicy; - return this; - } - - /** - * Get the proximityPlacementGroup property: Specifies information about the proximity placement group that the - * virtual machine scale set should be assigned to. <br><br>Minimum api-version: 2018-04-01. - * - * @return the proximityPlacementGroup value. - */ - public SubResource proximityPlacementGroup() { - return this.proximityPlacementGroup; - } - - /** - * Set the proximityPlacementGroup property: Specifies information about the proximity placement group that the - * virtual machine scale set should be assigned to. <br><br>Minimum api-version: 2018-04-01. - * - * @param proximityPlacementGroup the proximityPlacementGroup value to set. - * @return the VirtualMachineScaleSetUpdateProperties object itself. - */ - public VirtualMachineScaleSetUpdateProperties withProximityPlacementGroup(SubResource proximityPlacementGroup) { - this.proximityPlacementGroup = proximityPlacementGroup; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (upgradePolicy() != null) { - upgradePolicy().validate(); - } - if (automaticRepairsPolicy() != null) { - automaticRepairsPolicy().validate(); - } - if (virtualMachineProfile() != null) { - virtualMachineProfile().validate(); - } - if (additionalCapabilities() != null) { - additionalCapabilities().validate(); - } - if (scaleInPolicy() != null) { - scaleInPolicy().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineScaleSetUpdatePublicIpAddressConfigurationProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineScaleSetUpdatePublicIpAddressConfigurationProperties.java deleted file mode 100644 index 15328b8248af..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineScaleSetUpdatePublicIpAddressConfigurationProperties.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describes a virtual machines scale set IP Configuration's PublicIPAddress configuration. */ -@Fluent -public final class VirtualMachineScaleSetUpdatePublicIpAddressConfigurationProperties { - @JsonIgnore - private final ClientLogger logger = - new ClientLogger(VirtualMachineScaleSetUpdatePublicIpAddressConfigurationProperties.class); - - /* - * The idle timeout of the public IP address. - */ - @JsonProperty(value = "idleTimeoutInMinutes") - private Integer idleTimeoutInMinutes; - - /* - * The dns settings to be applied on the publicIP addresses . - */ - @JsonProperty(value = "dnsSettings") - private VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings dnsSettings; - - /** - * Get the idleTimeoutInMinutes property: The idle timeout of the public IP address. - * - * @return the idleTimeoutInMinutes value. - */ - public Integer idleTimeoutInMinutes() { - return this.idleTimeoutInMinutes; - } - - /** - * Set the idleTimeoutInMinutes property: The idle timeout of the public IP address. - * - * @param idleTimeoutInMinutes the idleTimeoutInMinutes value to set. - * @return the VirtualMachineScaleSetUpdatePublicIpAddressConfigurationProperties object itself. - */ - public VirtualMachineScaleSetUpdatePublicIpAddressConfigurationProperties withIdleTimeoutInMinutes( - Integer idleTimeoutInMinutes) { - this.idleTimeoutInMinutes = idleTimeoutInMinutes; - return this; - } - - /** - * Get the dnsSettings property: The dns settings to be applied on the publicIP addresses . - * - * @return the dnsSettings value. - */ - public VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings dnsSettings() { - return this.dnsSettings; - } - - /** - * Set the dnsSettings property: The dns settings to be applied on the publicIP addresses . - * - * @param dnsSettings the dnsSettings value to set. - * @return the VirtualMachineScaleSetUpdatePublicIpAddressConfigurationProperties object itself. - */ - public VirtualMachineScaleSetUpdatePublicIpAddressConfigurationProperties withDnsSettings( - VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings dnsSettings) { - this.dnsSettings = dnsSettings; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (dnsSettings() != null) { - dnsSettings().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineScaleSetVMExtensionInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineScaleSetVMExtensionInner.java deleted file mode 100644 index 9b0e9953459e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineScaleSetVMExtensionInner.java +++ /dev/null @@ -1,302 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.models.SubResourceReadOnly; -import com.azure.resourcemanager.compute.models.VirtualMachineExtensionInstanceView; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describes a VMSS VM Extension. */ -@Fluent -public final class VirtualMachineScaleSetVMExtensionInner extends SubResourceReadOnly { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetVMExtensionInner.class); - - /* - * The name of the extension. - */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) - private String name; - - /* - * Resource type - */ - @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) - private String type; - - /* - * Describes the properties of a Virtual Machine Extension. - */ - @JsonProperty(value = "properties") - private VirtualMachineExtensionProperties innerProperties; - - /** - * Get the name property: The name of the extension. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the type property: Resource type. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Get the innerProperties property: Describes the properties of a Virtual Machine Extension. - * - * @return the innerProperties value. - */ - private VirtualMachineExtensionProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the forceUpdateTag property: How the extension handler should be forced to update even if the extension - * configuration has not changed. - * - * @return the forceUpdateTag value. - */ - public String forceUpdateTag() { - return this.innerProperties() == null ? null : this.innerProperties().forceUpdateTag(); - } - - /** - * Set the forceUpdateTag property: How the extension handler should be forced to update even if the extension - * configuration has not changed. - * - * @param forceUpdateTag the forceUpdateTag value to set. - * @return the VirtualMachineScaleSetVMExtensionInner object itself. - */ - public VirtualMachineScaleSetVMExtensionInner withForceUpdateTag(String forceUpdateTag) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineExtensionProperties(); - } - this.innerProperties().withForceUpdateTag(forceUpdateTag); - return this; - } - - /** - * Get the publisher property: The name of the extension handler publisher. - * - * @return the publisher value. - */ - public String publisher() { - return this.innerProperties() == null ? null : this.innerProperties().publisher(); - } - - /** - * Set the publisher property: The name of the extension handler publisher. - * - * @param publisher the publisher value to set. - * @return the VirtualMachineScaleSetVMExtensionInner object itself. - */ - public VirtualMachineScaleSetVMExtensionInner withPublisher(String publisher) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineExtensionProperties(); - } - this.innerProperties().withPublisher(publisher); - return this; - } - - /** - * Get the type property: Specifies the type of the extension; an example is "CustomScriptExtension". - * - * @return the type value. - */ - public String typePropertiesType() { - return this.innerProperties() == null ? null : this.innerProperties().type(); - } - - /** - * Set the type property: Specifies the type of the extension; an example is "CustomScriptExtension". - * - * @param type the type value to set. - * @return the VirtualMachineScaleSetVMExtensionInner object itself. - */ - public VirtualMachineScaleSetVMExtensionInner withTypePropertiesType(String type) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineExtensionProperties(); - } - this.innerProperties().withType(type); - return this; - } - - /** - * Get the typeHandlerVersion property: Specifies the version of the script handler. - * - * @return the typeHandlerVersion value. - */ - public String typeHandlerVersion() { - return this.innerProperties() == null ? null : this.innerProperties().typeHandlerVersion(); - } - - /** - * Set the typeHandlerVersion property: Specifies the version of the script handler. - * - * @param typeHandlerVersion the typeHandlerVersion value to set. - * @return the VirtualMachineScaleSetVMExtensionInner object itself. - */ - public VirtualMachineScaleSetVMExtensionInner withTypeHandlerVersion(String typeHandlerVersion) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineExtensionProperties(); - } - this.innerProperties().withTypeHandlerVersion(typeHandlerVersion); - return this; - } - - /** - * Get the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one - * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless - * redeployed, even with this property set to true. - * - * @return the autoUpgradeMinorVersion value. - */ - public Boolean autoUpgradeMinorVersion() { - return this.innerProperties() == null ? null : this.innerProperties().autoUpgradeMinorVersion(); - } - - /** - * Set the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one - * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless - * redeployed, even with this property set to true. - * - * @param autoUpgradeMinorVersion the autoUpgradeMinorVersion value to set. - * @return the VirtualMachineScaleSetVMExtensionInner object itself. - */ - public VirtualMachineScaleSetVMExtensionInner withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineExtensionProperties(); - } - this.innerProperties().withAutoUpgradeMinorVersion(autoUpgradeMinorVersion); - return this; - } - - /** - * Get the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the - * platform if there is a newer version of the extension available. - * - * @return the enableAutomaticUpgrade value. - */ - public Boolean enableAutomaticUpgrade() { - return this.innerProperties() == null ? null : this.innerProperties().enableAutomaticUpgrade(); - } - - /** - * Set the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the - * platform if there is a newer version of the extension available. - * - * @param enableAutomaticUpgrade the enableAutomaticUpgrade value to set. - * @return the VirtualMachineScaleSetVMExtensionInner object itself. - */ - public VirtualMachineScaleSetVMExtensionInner withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineExtensionProperties(); - } - this.innerProperties().withEnableAutomaticUpgrade(enableAutomaticUpgrade); - return this; - } - - /** - * Get the settings property: Json formatted public settings for the extension. - * - * @return the settings value. - */ - public Object settings() { - return this.innerProperties() == null ? null : this.innerProperties().settings(); - } - - /** - * Set the settings property: Json formatted public settings for the extension. - * - * @param settings the settings value to set. - * @return the VirtualMachineScaleSetVMExtensionInner object itself. - */ - public VirtualMachineScaleSetVMExtensionInner withSettings(Object settings) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineExtensionProperties(); - } - this.innerProperties().withSettings(settings); - return this; - } - - /** - * Get the protectedSettings property: The extension can contain either protectedSettings or - * protectedSettingsFromKeyVault or no protected settings at all. - * - * @return the protectedSettings value. - */ - public Object protectedSettings() { - return this.innerProperties() == null ? null : this.innerProperties().protectedSettings(); - } - - /** - * Set the protectedSettings property: The extension can contain either protectedSettings or - * protectedSettingsFromKeyVault or no protected settings at all. - * - * @param protectedSettings the protectedSettings value to set. - * @return the VirtualMachineScaleSetVMExtensionInner object itself. - */ - public VirtualMachineScaleSetVMExtensionInner withProtectedSettings(Object protectedSettings) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineExtensionProperties(); - } - this.innerProperties().withProtectedSettings(protectedSettings); - return this; - } - - /** - * Get the provisioningState property: The provisioning state, which only appears in the response. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the instanceView property: The virtual machine extension instance view. - * - * @return the instanceView value. - */ - public VirtualMachineExtensionInstanceView instanceView() { - return this.innerProperties() == null ? null : this.innerProperties().instanceView(); - } - - /** - * Set the instanceView property: The virtual machine extension instance view. - * - * @param instanceView the instanceView value to set. - * @return the VirtualMachineScaleSetVMExtensionInner object itself. - */ - public VirtualMachineScaleSetVMExtensionInner withInstanceView(VirtualMachineExtensionInstanceView instanceView) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineExtensionProperties(); - } - this.innerProperties().withInstanceView(instanceView); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineScaleSetVMExtensionsListResultInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineScaleSetVMExtensionsListResultInner.java deleted file mode 100644 index 9060dd30d1fe..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineScaleSetVMExtensionsListResultInner.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The List VMSS VM Extension operation response. */ -@Fluent -public final class VirtualMachineScaleSetVMExtensionsListResultInner { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetVMExtensionsListResultInner.class); - - /* - * The list of VMSS VM extensions - */ - @JsonProperty(value = "value") - private List value; - - /** - * Get the value property: The list of VMSS VM extensions. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The list of VMSS VM extensions. - * - * @param value the value value to set. - * @return the VirtualMachineScaleSetVMExtensionsListResultInner object itself. - */ - public VirtualMachineScaleSetVMExtensionsListResultInner withValue( - List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineScaleSetVMInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineScaleSetVMInner.java deleted file mode 100644 index 821c6a1057cb..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineScaleSetVMInner.java +++ /dev/null @@ -1,519 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.models.AdditionalCapabilities; -import com.azure.resourcemanager.compute.models.DiagnosticsProfile; -import com.azure.resourcemanager.compute.models.HardwareProfile; -import com.azure.resourcemanager.compute.models.NetworkProfile; -import com.azure.resourcemanager.compute.models.OSProfile; -import com.azure.resourcemanager.compute.models.Plan; -import com.azure.resourcemanager.compute.models.SecurityProfile; -import com.azure.resourcemanager.compute.models.Sku; -import com.azure.resourcemanager.compute.models.StorageProfile; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetVMNetworkProfileConfiguration; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetVMProtectionPolicy; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** Describes a virtual machine scale set virtual machine. */ -@Fluent -public final class VirtualMachineScaleSetVMInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetVMInner.class); - - /* - * The virtual machine instance ID. - */ - @JsonProperty(value = "instanceId", access = JsonProperty.Access.WRITE_ONLY) - private String instanceId; - - /* - * The virtual machine SKU. - */ - @JsonProperty(value = "sku", access = JsonProperty.Access.WRITE_ONLY) - private Sku sku; - - /* - * Describes the properties of a virtual machine scale set virtual machine. - */ - @JsonProperty(value = "properties") - private VirtualMachineScaleSetVMPropertiesInner innerProperties; - - /* - * Specifies information about the marketplace image used to create the - * virtual machine. This element is only used for marketplace images. - * Before you can use a marketplace image from an API, you must enable the - * image for programmatic use. In the Azure portal, find the marketplace - * image that you want to use and then click **Want to deploy - * programmatically, Get Started ->**. Enter any required information and - * then click **Save**. - */ - @JsonProperty(value = "plan") - private Plan plan; - - /* - * The virtual machine child extension resources. - */ - @JsonProperty(value = "resources", access = JsonProperty.Access.WRITE_ONLY) - private List resources; - - /* - * The virtual machine zones. - */ - @JsonProperty(value = "zones", access = JsonProperty.Access.WRITE_ONLY) - private List zones; - - /** - * Get the instanceId property: The virtual machine instance ID. - * - * @return the instanceId value. - */ - public String instanceId() { - return this.instanceId; - } - - /** - * Get the sku property: The virtual machine SKU. - * - * @return the sku value. - */ - public Sku sku() { - return this.sku; - } - - /** - * Get the innerProperties property: Describes the properties of a virtual machine scale set virtual machine. - * - * @return the innerProperties value. - */ - private VirtualMachineScaleSetVMPropertiesInner innerProperties() { - return this.innerProperties; - } - - /** - * Get the plan property: Specifies information about the marketplace image used to create the virtual machine. This - * element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable - * the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then - * click **Want to deploy programmatically, Get Started ->**. Enter any required information and then click - * **Save**. - * - * @return the plan value. - */ - public Plan plan() { - return this.plan; - } - - /** - * Set the plan property: Specifies information about the marketplace image used to create the virtual machine. This - * element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable - * the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then - * click **Want to deploy programmatically, Get Started ->**. Enter any required information and then click - * **Save**. - * - * @param plan the plan value to set. - * @return the VirtualMachineScaleSetVMInner object itself. - */ - public VirtualMachineScaleSetVMInner withPlan(Plan plan) { - this.plan = plan; - return this; - } - - /** - * Get the resources property: The virtual machine child extension resources. - * - * @return the resources value. - */ - public List resources() { - return this.resources; - } - - /** - * Get the zones property: The virtual machine zones. - * - * @return the zones value. - */ - public List zones() { - return this.zones; - } - - /** {@inheritDoc} */ - @Override - public VirtualMachineScaleSetVMInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public VirtualMachineScaleSetVMInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the latestModelApplied property: Specifies whether the latest model has been applied to the virtual machine. - * - * @return the latestModelApplied value. - */ - public Boolean latestModelApplied() { - return this.innerProperties() == null ? null : this.innerProperties().latestModelApplied(); - } - - /** - * Get the vmId property: Azure VM unique ID. - * - * @return the vmId value. - */ - public String vmId() { - return this.innerProperties() == null ? null : this.innerProperties().vmId(); - } - - /** - * Get the instanceView property: The virtual machine instance view. - * - * @return the instanceView value. - */ - public VirtualMachineScaleSetVMInstanceViewInner instanceView() { - return this.innerProperties() == null ? null : this.innerProperties().instanceView(); - } - - /** - * Get the hardwareProfile property: Specifies the hardware settings for the virtual machine. - * - * @return the hardwareProfile value. - */ - public HardwareProfile hardwareProfile() { - return this.innerProperties() == null ? null : this.innerProperties().hardwareProfile(); - } - - /** - * Set the hardwareProfile property: Specifies the hardware settings for the virtual machine. - * - * @param hardwareProfile the hardwareProfile value to set. - * @return the VirtualMachineScaleSetVMInner object itself. - */ - public VirtualMachineScaleSetVMInner withHardwareProfile(HardwareProfile hardwareProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetVMPropertiesInner(); - } - this.innerProperties().withHardwareProfile(hardwareProfile); - return this; - } - - /** - * Get the storageProfile property: Specifies the storage settings for the virtual machine disks. - * - * @return the storageProfile value. - */ - public StorageProfile storageProfile() { - return this.innerProperties() == null ? null : this.innerProperties().storageProfile(); - } - - /** - * Set the storageProfile property: Specifies the storage settings for the virtual machine disks. - * - * @param storageProfile the storageProfile value to set. - * @return the VirtualMachineScaleSetVMInner object itself. - */ - public VirtualMachineScaleSetVMInner withStorageProfile(StorageProfile storageProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetVMPropertiesInner(); - } - this.innerProperties().withStorageProfile(storageProfile); - return this; - } - - /** - * Get the additionalCapabilities property: Specifies additional capabilities enabled or disabled on the virtual - * machine in the scale set. For instance: whether the virtual machine has the capability to support attaching - * managed data disks with UltraSSD_LRS storage account type. - * - * @return the additionalCapabilities value. - */ - public AdditionalCapabilities additionalCapabilities() { - return this.innerProperties() == null ? null : this.innerProperties().additionalCapabilities(); - } - - /** - * Set the additionalCapabilities property: Specifies additional capabilities enabled or disabled on the virtual - * machine in the scale set. For instance: whether the virtual machine has the capability to support attaching - * managed data disks with UltraSSD_LRS storage account type. - * - * @param additionalCapabilities the additionalCapabilities value to set. - * @return the VirtualMachineScaleSetVMInner object itself. - */ - public VirtualMachineScaleSetVMInner withAdditionalCapabilities(AdditionalCapabilities additionalCapabilities) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetVMPropertiesInner(); - } - this.innerProperties().withAdditionalCapabilities(additionalCapabilities); - return this; - } - - /** - * Get the osProfile property: Specifies the operating system settings for the virtual machine. - * - * @return the osProfile value. - */ - public OSProfile osProfile() { - return this.innerProperties() == null ? null : this.innerProperties().osProfile(); - } - - /** - * Set the osProfile property: Specifies the operating system settings for the virtual machine. - * - * @param osProfile the osProfile value to set. - * @return the VirtualMachineScaleSetVMInner object itself. - */ - public VirtualMachineScaleSetVMInner withOsProfile(OSProfile osProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetVMPropertiesInner(); - } - this.innerProperties().withOsProfile(osProfile); - return this; - } - - /** - * Get the securityProfile property: Specifies the Security related profile settings for the virtual machine. - * - * @return the securityProfile value. - */ - public SecurityProfile securityProfile() { - return this.innerProperties() == null ? null : this.innerProperties().securityProfile(); - } - - /** - * Set the securityProfile property: Specifies the Security related profile settings for the virtual machine. - * - * @param securityProfile the securityProfile value to set. - * @return the VirtualMachineScaleSetVMInner object itself. - */ - public VirtualMachineScaleSetVMInner withSecurityProfile(SecurityProfile securityProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetVMPropertiesInner(); - } - this.innerProperties().withSecurityProfile(securityProfile); - return this; - } - - /** - * Get the networkProfile property: Specifies the network interfaces of the virtual machine. - * - * @return the networkProfile value. - */ - public NetworkProfile networkProfile() { - return this.innerProperties() == null ? null : this.innerProperties().networkProfile(); - } - - /** - * Set the networkProfile property: Specifies the network interfaces of the virtual machine. - * - * @param networkProfile the networkProfile value to set. - * @return the VirtualMachineScaleSetVMInner object itself. - */ - public VirtualMachineScaleSetVMInner withNetworkProfile(NetworkProfile networkProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetVMPropertiesInner(); - } - this.innerProperties().withNetworkProfile(networkProfile); - return this; - } - - /** - * Get the networkProfileConfiguration property: Specifies the network profile configuration of the virtual machine. - * - * @return the networkProfileConfiguration value. - */ - public VirtualMachineScaleSetVMNetworkProfileConfiguration networkProfileConfiguration() { - return this.innerProperties() == null ? null : this.innerProperties().networkProfileConfiguration(); - } - - /** - * Set the networkProfileConfiguration property: Specifies the network profile configuration of the virtual machine. - * - * @param networkProfileConfiguration the networkProfileConfiguration value to set. - * @return the VirtualMachineScaleSetVMInner object itself. - */ - public VirtualMachineScaleSetVMInner withNetworkProfileConfiguration( - VirtualMachineScaleSetVMNetworkProfileConfiguration networkProfileConfiguration) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetVMPropertiesInner(); - } - this.innerProperties().withNetworkProfileConfiguration(networkProfileConfiguration); - return this; - } - - /** - * Get the diagnosticsProfile property: Specifies the boot diagnostic settings state. <br><br>Minimum - * api-version: 2015-06-15. - * - * @return the diagnosticsProfile value. - */ - public DiagnosticsProfile diagnosticsProfile() { - return this.innerProperties() == null ? null : this.innerProperties().diagnosticsProfile(); - } - - /** - * Set the diagnosticsProfile property: Specifies the boot diagnostic settings state. <br><br>Minimum - * api-version: 2015-06-15. - * - * @param diagnosticsProfile the diagnosticsProfile value to set. - * @return the VirtualMachineScaleSetVMInner object itself. - */ - public VirtualMachineScaleSetVMInner withDiagnosticsProfile(DiagnosticsProfile diagnosticsProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetVMPropertiesInner(); - } - this.innerProperties().withDiagnosticsProfile(diagnosticsProfile); - return this; - } - - /** - * Get the availabilitySet property: Specifies information about the availability set that the virtual machine - * should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes - * to maximize availability. For more information about availability sets, see [Manage the availability of virtual - * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). - * <br><br> For more information on Azure planned maintenance, see [Planned maintenance for virtual - * machines in - * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) - * <br><br> Currently, a VM can only be added to availability set at creation time. An existing VM - * cannot be added to an availability set. - * - * @return the availabilitySet value. - */ - public SubResource availabilitySet() { - return this.innerProperties() == null ? null : this.innerProperties().availabilitySet(); - } - - /** - * Set the availabilitySet property: Specifies information about the availability set that the virtual machine - * should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes - * to maximize availability. For more information about availability sets, see [Manage the availability of virtual - * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). - * <br><br> For more information on Azure planned maintenance, see [Planned maintenance for virtual - * machines in - * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) - * <br><br> Currently, a VM can only be added to availability set at creation time. An existing VM - * cannot be added to an availability set. - * - * @param availabilitySet the availabilitySet value to set. - * @return the VirtualMachineScaleSetVMInner object itself. - */ - public VirtualMachineScaleSetVMInner withAvailabilitySet(SubResource availabilitySet) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetVMPropertiesInner(); - } - this.innerProperties().withAvailabilitySet(availabilitySet); - return this; - } - - /** - * Get the provisioningState property: The provisioning state, which only appears in the response. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the licenseType property: Specifies that the image or disk that is being used was licensed on-premises. - * <br><br> Possible values for Windows Server operating system are: <br><br> Windows_Client - * <br><br> Windows_Server <br><br> Possible values for Linux Server operating system are: - * <br><br> RHEL_BYOS (for RHEL) <br><br> SLES_BYOS (for SUSE) <br><br> For more - * information, see [Azure Hybrid Use Benefit for Windows - * Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) - * <br><br> [Azure Hybrid Use Benefit for Linux - * Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) <br><br> - * Minimum api-version: 2015-06-15. - * - * @return the licenseType value. - */ - public String licenseType() { - return this.innerProperties() == null ? null : this.innerProperties().licenseType(); - } - - /** - * Set the licenseType property: Specifies that the image or disk that is being used was licensed on-premises. - * <br><br> Possible values for Windows Server operating system are: <br><br> Windows_Client - * <br><br> Windows_Server <br><br> Possible values for Linux Server operating system are: - * <br><br> RHEL_BYOS (for RHEL) <br><br> SLES_BYOS (for SUSE) <br><br> For more - * information, see [Azure Hybrid Use Benefit for Windows - * Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) - * <br><br> [Azure Hybrid Use Benefit for Linux - * Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) <br><br> - * Minimum api-version: 2015-06-15. - * - * @param licenseType the licenseType value to set. - * @return the VirtualMachineScaleSetVMInner object itself. - */ - public VirtualMachineScaleSetVMInner withLicenseType(String licenseType) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetVMPropertiesInner(); - } - this.innerProperties().withLicenseType(licenseType); - return this; - } - - /** - * Get the modelDefinitionApplied property: Specifies whether the model applied to the virtual machine is the model - * of the virtual machine scale set or the customized model for the virtual machine. - * - * @return the modelDefinitionApplied value. - */ - public String modelDefinitionApplied() { - return this.innerProperties() == null ? null : this.innerProperties().modelDefinitionApplied(); - } - - /** - * Get the protectionPolicy property: Specifies the protection policy of the virtual machine. - * - * @return the protectionPolicy value. - */ - public VirtualMachineScaleSetVMProtectionPolicy protectionPolicy() { - return this.innerProperties() == null ? null : this.innerProperties().protectionPolicy(); - } - - /** - * Set the protectionPolicy property: Specifies the protection policy of the virtual machine. - * - * @param protectionPolicy the protectionPolicy value to set. - * @return the VirtualMachineScaleSetVMInner object itself. - */ - public VirtualMachineScaleSetVMInner withProtectionPolicy( - VirtualMachineScaleSetVMProtectionPolicy protectionPolicy) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetVMPropertiesInner(); - } - this.innerProperties().withProtectionPolicy(protectionPolicy); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (sku() != null) { - sku().validate(); - } - if (innerProperties() != null) { - innerProperties().validate(); - } - if (plan() != null) { - plan().validate(); - } - if (resources() != null) { - resources().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineScaleSetVMInstanceViewInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineScaleSetVMInstanceViewInner.java deleted file mode 100644 index 868ca75e978f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineScaleSetVMInstanceViewInner.java +++ /dev/null @@ -1,360 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.models.BootDiagnosticsInstanceView; -import com.azure.resourcemanager.compute.models.DiskInstanceView; -import com.azure.resourcemanager.compute.models.InstanceViewStatus; -import com.azure.resourcemanager.compute.models.MaintenanceRedeployStatus; -import com.azure.resourcemanager.compute.models.VirtualMachineAgentInstanceView; -import com.azure.resourcemanager.compute.models.VirtualMachineExtensionInstanceView; -import com.azure.resourcemanager.compute.models.VirtualMachineHealthStatus; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The instance view of a virtual machine scale set VM. */ -@Fluent -public final class VirtualMachineScaleSetVMInstanceViewInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetVMInstanceViewInner.class); - - /* - * The Update Domain count. - */ - @JsonProperty(value = "platformUpdateDomain") - private Integer platformUpdateDomain; - - /* - * The Fault Domain count. - */ - @JsonProperty(value = "platformFaultDomain") - private Integer platformFaultDomain; - - /* - * The Remote desktop certificate thumbprint. - */ - @JsonProperty(value = "rdpThumbPrint") - private String rdpThumbPrint; - - /* - * The VM Agent running on the virtual machine. - */ - @JsonProperty(value = "vmAgent") - private VirtualMachineAgentInstanceView vmAgent; - - /* - * The Maintenance Operation status on the virtual machine. - */ - @JsonProperty(value = "maintenanceRedeployStatus") - private MaintenanceRedeployStatus maintenanceRedeployStatus; - - /* - * The disks information. - */ - @JsonProperty(value = "disks") - private List disks; - - /* - * The extensions information. - */ - @JsonProperty(value = "extensions") - private List extensions; - - /* - * The health status for the VM. - */ - @JsonProperty(value = "vmHealth", access = JsonProperty.Access.WRITE_ONLY) - private VirtualMachineHealthStatus vmHealth; - - /* - * Boot Diagnostics is a debugging feature which allows you to view Console - * Output and Screenshot to diagnose VM status.

You can easily - * view the output of your console log.

Azure also enables you to - * see a screenshot of the VM from the hypervisor. - */ - @JsonProperty(value = "bootDiagnostics") - private BootDiagnosticsInstanceView bootDiagnostics; - - /* - * The resource status information. - */ - @JsonProperty(value = "statuses") - private List statuses; - - /* - * Resource id of the dedicated host, on which the virtual machine is - * allocated through automatic placement, when the virtual machine is - * associated with a dedicated host group that has automatic placement - * enabled.

Minimum api-version: 2020-06-01. - */ - @JsonProperty(value = "assignedHost", access = JsonProperty.Access.WRITE_ONLY) - private String assignedHost; - - /* - * The placement group in which the VM is running. If the VM is deallocated - * it will not have a placementGroupId. - */ - @JsonProperty(value = "placementGroupId") - private String placementGroupId; - - /** - * Get the platformUpdateDomain property: The Update Domain count. - * - * @return the platformUpdateDomain value. - */ - public Integer platformUpdateDomain() { - return this.platformUpdateDomain; - } - - /** - * Set the platformUpdateDomain property: The Update Domain count. - * - * @param platformUpdateDomain the platformUpdateDomain value to set. - * @return the VirtualMachineScaleSetVMInstanceViewInner object itself. - */ - public VirtualMachineScaleSetVMInstanceViewInner withPlatformUpdateDomain(Integer platformUpdateDomain) { - this.platformUpdateDomain = platformUpdateDomain; - return this; - } - - /** - * Get the platformFaultDomain property: The Fault Domain count. - * - * @return the platformFaultDomain value. - */ - public Integer platformFaultDomain() { - return this.platformFaultDomain; - } - - /** - * Set the platformFaultDomain property: The Fault Domain count. - * - * @param platformFaultDomain the platformFaultDomain value to set. - * @return the VirtualMachineScaleSetVMInstanceViewInner object itself. - */ - public VirtualMachineScaleSetVMInstanceViewInner withPlatformFaultDomain(Integer platformFaultDomain) { - this.platformFaultDomain = platformFaultDomain; - return this; - } - - /** - * Get the rdpThumbPrint property: The Remote desktop certificate thumbprint. - * - * @return the rdpThumbPrint value. - */ - public String rdpThumbPrint() { - return this.rdpThumbPrint; - } - - /** - * Set the rdpThumbPrint property: The Remote desktop certificate thumbprint. - * - * @param rdpThumbPrint the rdpThumbPrint value to set. - * @return the VirtualMachineScaleSetVMInstanceViewInner object itself. - */ - public VirtualMachineScaleSetVMInstanceViewInner withRdpThumbPrint(String rdpThumbPrint) { - this.rdpThumbPrint = rdpThumbPrint; - return this; - } - - /** - * Get the vmAgent property: The VM Agent running on the virtual machine. - * - * @return the vmAgent value. - */ - public VirtualMachineAgentInstanceView vmAgent() { - return this.vmAgent; - } - - /** - * Set the vmAgent property: The VM Agent running on the virtual machine. - * - * @param vmAgent the vmAgent value to set. - * @return the VirtualMachineScaleSetVMInstanceViewInner object itself. - */ - public VirtualMachineScaleSetVMInstanceViewInner withVmAgent(VirtualMachineAgentInstanceView vmAgent) { - this.vmAgent = vmAgent; - return this; - } - - /** - * Get the maintenanceRedeployStatus property: The Maintenance Operation status on the virtual machine. - * - * @return the maintenanceRedeployStatus value. - */ - public MaintenanceRedeployStatus maintenanceRedeployStatus() { - return this.maintenanceRedeployStatus; - } - - /** - * Set the maintenanceRedeployStatus property: The Maintenance Operation status on the virtual machine. - * - * @param maintenanceRedeployStatus the maintenanceRedeployStatus value to set. - * @return the VirtualMachineScaleSetVMInstanceViewInner object itself. - */ - public VirtualMachineScaleSetVMInstanceViewInner withMaintenanceRedeployStatus( - MaintenanceRedeployStatus maintenanceRedeployStatus) { - this.maintenanceRedeployStatus = maintenanceRedeployStatus; - return this; - } - - /** - * Get the disks property: The disks information. - * - * @return the disks value. - */ - public List disks() { - return this.disks; - } - - /** - * Set the disks property: The disks information. - * - * @param disks the disks value to set. - * @return the VirtualMachineScaleSetVMInstanceViewInner object itself. - */ - public VirtualMachineScaleSetVMInstanceViewInner withDisks(List disks) { - this.disks = disks; - return this; - } - - /** - * Get the extensions property: The extensions information. - * - * @return the extensions value. - */ - public List extensions() { - return this.extensions; - } - - /** - * Set the extensions property: The extensions information. - * - * @param extensions the extensions value to set. - * @return the VirtualMachineScaleSetVMInstanceViewInner object itself. - */ - public VirtualMachineScaleSetVMInstanceViewInner withExtensions( - List extensions) { - this.extensions = extensions; - return this; - } - - /** - * Get the vmHealth property: The health status for the VM. - * - * @return the vmHealth value. - */ - public VirtualMachineHealthStatus vmHealth() { - return this.vmHealth; - } - - /** - * Get the bootDiagnostics property: 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. - * - * @return the bootDiagnostics value. - */ - public BootDiagnosticsInstanceView bootDiagnostics() { - return this.bootDiagnostics; - } - - /** - * Set the bootDiagnostics property: 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. - * - * @param bootDiagnostics the bootDiagnostics value to set. - * @return the VirtualMachineScaleSetVMInstanceViewInner object itself. - */ - public VirtualMachineScaleSetVMInstanceViewInner withBootDiagnostics(BootDiagnosticsInstanceView bootDiagnostics) { - this.bootDiagnostics = bootDiagnostics; - return this; - } - - /** - * Get the statuses property: The resource status information. - * - * @return the statuses value. - */ - public List statuses() { - return this.statuses; - } - - /** - * Set the statuses property: The resource status information. - * - * @param statuses the statuses value to set. - * @return the VirtualMachineScaleSetVMInstanceViewInner object itself. - */ - public VirtualMachineScaleSetVMInstanceViewInner withStatuses(List statuses) { - this.statuses = statuses; - return this; - } - - /** - * Get the assignedHost property: Resource id of the dedicated host, on which the virtual machine is allocated - * through automatic placement, when the virtual machine is associated with a dedicated host group that has - * automatic placement enabled. <br><br>Minimum api-version: 2020-06-01. - * - * @return the assignedHost value. - */ - public String assignedHost() { - return this.assignedHost; - } - - /** - * Get the placementGroupId property: The placement group in which the VM is running. If the VM is deallocated it - * will not have a placementGroupId. - * - * @return the placementGroupId value. - */ - public String placementGroupId() { - return this.placementGroupId; - } - - /** - * Set the placementGroupId property: The placement group in which the VM is running. If the VM is deallocated it - * will not have a placementGroupId. - * - * @param placementGroupId the placementGroupId value to set. - * @return the VirtualMachineScaleSetVMInstanceViewInner object itself. - */ - public VirtualMachineScaleSetVMInstanceViewInner withPlacementGroupId(String placementGroupId) { - this.placementGroupId = placementGroupId; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (vmAgent() != null) { - vmAgent().validate(); - } - if (maintenanceRedeployStatus() != null) { - maintenanceRedeployStatus().validate(); - } - if (disks() != null) { - disks().forEach(e -> e.validate()); - } - if (extensions() != null) { - extensions().forEach(e -> e.validate()); - } - if (vmHealth() != null) { - vmHealth().validate(); - } - if (bootDiagnostics() != null) { - bootDiagnostics().validate(); - } - if (statuses() != null) { - statuses().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineScaleSetVMPropertiesInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineScaleSetVMPropertiesInner.java deleted file mode 100644 index 5ea438151272..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineScaleSetVMPropertiesInner.java +++ /dev/null @@ -1,493 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.models.AdditionalCapabilities; -import com.azure.resourcemanager.compute.models.DiagnosticsProfile; -import com.azure.resourcemanager.compute.models.HardwareProfile; -import com.azure.resourcemanager.compute.models.NetworkProfile; -import com.azure.resourcemanager.compute.models.OSProfile; -import com.azure.resourcemanager.compute.models.SecurityProfile; -import com.azure.resourcemanager.compute.models.StorageProfile; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetVMNetworkProfileConfiguration; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetVMProtectionPolicy; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describes the properties of a virtual machine scale set virtual machine. */ -@Fluent -public final class VirtualMachineScaleSetVMPropertiesInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetVMPropertiesInner.class); - - /* - * Specifies whether the latest model has been applied to the virtual - * machine. - */ - @JsonProperty(value = "latestModelApplied", access = JsonProperty.Access.WRITE_ONLY) - private Boolean latestModelApplied; - - /* - * Azure VM unique ID. - */ - @JsonProperty(value = "vmId", access = JsonProperty.Access.WRITE_ONLY) - private String vmId; - - /* - * The virtual machine instance view. - */ - @JsonProperty(value = "instanceView", access = JsonProperty.Access.WRITE_ONLY) - private VirtualMachineScaleSetVMInstanceViewInner instanceView; - - /* - * Specifies the hardware settings for the virtual machine. - */ - @JsonProperty(value = "hardwareProfile") - private HardwareProfile hardwareProfile; - - /* - * Specifies the storage settings for the virtual machine disks. - */ - @JsonProperty(value = "storageProfile") - private StorageProfile storageProfile; - - /* - * Specifies additional capabilities enabled or disabled on the virtual - * machine in the scale set. For instance: whether the virtual machine has - * the capability to support attaching managed data disks with UltraSSD_LRS - * storage account type. - */ - @JsonProperty(value = "additionalCapabilities") - private AdditionalCapabilities additionalCapabilities; - - /* - * Specifies the operating system settings for the virtual machine. - */ - @JsonProperty(value = "osProfile") - private OSProfile osProfile; - - /* - * Specifies the Security related profile settings for the virtual machine. - */ - @JsonProperty(value = "securityProfile") - private SecurityProfile securityProfile; - - /* - * Specifies the network interfaces of the virtual machine. - */ - @JsonProperty(value = "networkProfile") - private NetworkProfile networkProfile; - - /* - * Specifies the network profile configuration of the virtual machine. - */ - @JsonProperty(value = "networkProfileConfiguration") - private VirtualMachineScaleSetVMNetworkProfileConfiguration networkProfileConfiguration; - - /* - * Specifies the boot diagnostic settings state.

Minimum - * api-version: 2015-06-15. - */ - @JsonProperty(value = "diagnosticsProfile") - private DiagnosticsProfile diagnosticsProfile; - - /* - * Specifies information about the availability set that the virtual - * machine should be assigned to. Virtual machines specified in the same - * availability set are allocated to different nodes to maximize - * availability. For more information about availability sets, see [Manage - * the availability of virtual - * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). - *

For more information on Azure planned maintenance, see [Planned - * maintenance for virtual machines in - * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) - *

Currently, a VM can only be added to availability set at - * creation time. An existing VM cannot be added to an availability set. - */ - @JsonProperty(value = "availabilitySet") - private SubResource availabilitySet; - - /* - * The provisioning state, which only appears in the response. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; - - /* - * Specifies that the image or disk that is being used was licensed - * on-premises.

Possible values for Windows Server operating - * system are:

Windows_Client

Windows_Server

- * Possible values for Linux Server operating system are:

- * RHEL_BYOS (for RHEL)

SLES_BYOS (for SUSE)

For more - * information, see [Azure Hybrid Use Benefit for Windows - * Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) - *

[Azure Hybrid Use Benefit for Linux - * Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) - *

Minimum api-version: 2015-06-15 - */ - @JsonProperty(value = "licenseType") - private String licenseType; - - /* - * Specifies whether the model applied to the virtual machine is the model - * of the virtual machine scale set or the customized model for the virtual - * machine. - */ - @JsonProperty(value = "modelDefinitionApplied", access = JsonProperty.Access.WRITE_ONLY) - private String modelDefinitionApplied; - - /* - * Specifies the protection policy of the virtual machine. - */ - @JsonProperty(value = "protectionPolicy") - private VirtualMachineScaleSetVMProtectionPolicy protectionPolicy; - - /** - * Get the latestModelApplied property: Specifies whether the latest model has been applied to the virtual machine. - * - * @return the latestModelApplied value. - */ - public Boolean latestModelApplied() { - return this.latestModelApplied; - } - - /** - * Get the vmId property: Azure VM unique ID. - * - * @return the vmId value. - */ - public String vmId() { - return this.vmId; - } - - /** - * Get the instanceView property: The virtual machine instance view. - * - * @return the instanceView value. - */ - public VirtualMachineScaleSetVMInstanceViewInner instanceView() { - return this.instanceView; - } - - /** - * Get the hardwareProfile property: Specifies the hardware settings for the virtual machine. - * - * @return the hardwareProfile value. - */ - public HardwareProfile hardwareProfile() { - return this.hardwareProfile; - } - - /** - * Set the hardwareProfile property: Specifies the hardware settings for the virtual machine. - * - * @param hardwareProfile the hardwareProfile value to set. - * @return the VirtualMachineScaleSetVMPropertiesInner object itself. - */ - public VirtualMachineScaleSetVMPropertiesInner withHardwareProfile(HardwareProfile hardwareProfile) { - this.hardwareProfile = hardwareProfile; - return this; - } - - /** - * Get the storageProfile property: Specifies the storage settings for the virtual machine disks. - * - * @return the storageProfile value. - */ - public StorageProfile storageProfile() { - return this.storageProfile; - } - - /** - * Set the storageProfile property: Specifies the storage settings for the virtual machine disks. - * - * @param storageProfile the storageProfile value to set. - * @return the VirtualMachineScaleSetVMPropertiesInner object itself. - */ - public VirtualMachineScaleSetVMPropertiesInner withStorageProfile(StorageProfile storageProfile) { - this.storageProfile = storageProfile; - return this; - } - - /** - * Get the additionalCapabilities property: Specifies additional capabilities enabled or disabled on the virtual - * machine in the scale set. For instance: whether the virtual machine has the capability to support attaching - * managed data disks with UltraSSD_LRS storage account type. - * - * @return the additionalCapabilities value. - */ - public AdditionalCapabilities additionalCapabilities() { - return this.additionalCapabilities; - } - - /** - * Set the additionalCapabilities property: Specifies additional capabilities enabled or disabled on the virtual - * machine in the scale set. For instance: whether the virtual machine has the capability to support attaching - * managed data disks with UltraSSD_LRS storage account type. - * - * @param additionalCapabilities the additionalCapabilities value to set. - * @return the VirtualMachineScaleSetVMPropertiesInner object itself. - */ - public VirtualMachineScaleSetVMPropertiesInner withAdditionalCapabilities( - AdditionalCapabilities additionalCapabilities) { - this.additionalCapabilities = additionalCapabilities; - return this; - } - - /** - * Get the osProfile property: Specifies the operating system settings for the virtual machine. - * - * @return the osProfile value. - */ - public OSProfile osProfile() { - return this.osProfile; - } - - /** - * Set the osProfile property: Specifies the operating system settings for the virtual machine. - * - * @param osProfile the osProfile value to set. - * @return the VirtualMachineScaleSetVMPropertiesInner object itself. - */ - public VirtualMachineScaleSetVMPropertiesInner withOsProfile(OSProfile osProfile) { - this.osProfile = osProfile; - return this; - } - - /** - * Get the securityProfile property: Specifies the Security related profile settings for the virtual machine. - * - * @return the securityProfile value. - */ - public SecurityProfile securityProfile() { - return this.securityProfile; - } - - /** - * Set the securityProfile property: Specifies the Security related profile settings for the virtual machine. - * - * @param securityProfile the securityProfile value to set. - * @return the VirtualMachineScaleSetVMPropertiesInner object itself. - */ - public VirtualMachineScaleSetVMPropertiesInner withSecurityProfile(SecurityProfile securityProfile) { - this.securityProfile = securityProfile; - return this; - } - - /** - * Get the networkProfile property: Specifies the network interfaces of the virtual machine. - * - * @return the networkProfile value. - */ - public NetworkProfile networkProfile() { - return this.networkProfile; - } - - /** - * Set the networkProfile property: Specifies the network interfaces of the virtual machine. - * - * @param networkProfile the networkProfile value to set. - * @return the VirtualMachineScaleSetVMPropertiesInner object itself. - */ - public VirtualMachineScaleSetVMPropertiesInner withNetworkProfile(NetworkProfile networkProfile) { - this.networkProfile = networkProfile; - return this; - } - - /** - * Get the networkProfileConfiguration property: Specifies the network profile configuration of the virtual machine. - * - * @return the networkProfileConfiguration value. - */ - public VirtualMachineScaleSetVMNetworkProfileConfiguration networkProfileConfiguration() { - return this.networkProfileConfiguration; - } - - /** - * Set the networkProfileConfiguration property: Specifies the network profile configuration of the virtual machine. - * - * @param networkProfileConfiguration the networkProfileConfiguration value to set. - * @return the VirtualMachineScaleSetVMPropertiesInner object itself. - */ - public VirtualMachineScaleSetVMPropertiesInner withNetworkProfileConfiguration( - VirtualMachineScaleSetVMNetworkProfileConfiguration networkProfileConfiguration) { - this.networkProfileConfiguration = networkProfileConfiguration; - return this; - } - - /** - * Get the diagnosticsProfile property: Specifies the boot diagnostic settings state. <br><br>Minimum - * api-version: 2015-06-15. - * - * @return the diagnosticsProfile value. - */ - public DiagnosticsProfile diagnosticsProfile() { - return this.diagnosticsProfile; - } - - /** - * Set the diagnosticsProfile property: Specifies the boot diagnostic settings state. <br><br>Minimum - * api-version: 2015-06-15. - * - * @param diagnosticsProfile the diagnosticsProfile value to set. - * @return the VirtualMachineScaleSetVMPropertiesInner object itself. - */ - public VirtualMachineScaleSetVMPropertiesInner withDiagnosticsProfile(DiagnosticsProfile diagnosticsProfile) { - this.diagnosticsProfile = diagnosticsProfile; - return this; - } - - /** - * Get the availabilitySet property: Specifies information about the availability set that the virtual machine - * should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes - * to maximize availability. For more information about availability sets, see [Manage the availability of virtual - * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). - * <br><br> For more information on Azure planned maintenance, see [Planned maintenance for virtual - * machines in - * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) - * <br><br> Currently, a VM can only be added to availability set at creation time. An existing VM - * cannot be added to an availability set. - * - * @return the availabilitySet value. - */ - public SubResource availabilitySet() { - return this.availabilitySet; - } - - /** - * Set the availabilitySet property: Specifies information about the availability set that the virtual machine - * should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes - * to maximize availability. For more information about availability sets, see [Manage the availability of virtual - * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). - * <br><br> For more information on Azure planned maintenance, see [Planned maintenance for virtual - * machines in - * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) - * <br><br> Currently, a VM can only be added to availability set at creation time. An existing VM - * cannot be added to an availability set. - * - * @param availabilitySet the availabilitySet value to set. - * @return the VirtualMachineScaleSetVMPropertiesInner object itself. - */ - public VirtualMachineScaleSetVMPropertiesInner withAvailabilitySet(SubResource availabilitySet) { - this.availabilitySet = availabilitySet; - return this; - } - - /** - * Get the provisioningState property: The provisioning state, which only appears in the response. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Get the licenseType property: Specifies that the image or disk that is being used was licensed on-premises. - * <br><br> Possible values for Windows Server operating system are: <br><br> Windows_Client - * <br><br> Windows_Server <br><br> Possible values for Linux Server operating system are: - * <br><br> RHEL_BYOS (for RHEL) <br><br> SLES_BYOS (for SUSE) <br><br> For more - * information, see [Azure Hybrid Use Benefit for Windows - * Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) - * <br><br> [Azure Hybrid Use Benefit for Linux - * Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) <br><br> - * Minimum api-version: 2015-06-15. - * - * @return the licenseType value. - */ - public String licenseType() { - return this.licenseType; - } - - /** - * Set the licenseType property: Specifies that the image or disk that is being used was licensed on-premises. - * <br><br> Possible values for Windows Server operating system are: <br><br> Windows_Client - * <br><br> Windows_Server <br><br> Possible values for Linux Server operating system are: - * <br><br> RHEL_BYOS (for RHEL) <br><br> SLES_BYOS (for SUSE) <br><br> For more - * information, see [Azure Hybrid Use Benefit for Windows - * Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) - * <br><br> [Azure Hybrid Use Benefit for Linux - * Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) <br><br> - * Minimum api-version: 2015-06-15. - * - * @param licenseType the licenseType value to set. - * @return the VirtualMachineScaleSetVMPropertiesInner object itself. - */ - public VirtualMachineScaleSetVMPropertiesInner withLicenseType(String licenseType) { - this.licenseType = licenseType; - return this; - } - - /** - * Get the modelDefinitionApplied property: Specifies whether the model applied to the virtual machine is the model - * of the virtual machine scale set or the customized model for the virtual machine. - * - * @return the modelDefinitionApplied value. - */ - public String modelDefinitionApplied() { - return this.modelDefinitionApplied; - } - - /** - * Get the protectionPolicy property: Specifies the protection policy of the virtual machine. - * - * @return the protectionPolicy value. - */ - public VirtualMachineScaleSetVMProtectionPolicy protectionPolicy() { - return this.protectionPolicy; - } - - /** - * Set the protectionPolicy property: Specifies the protection policy of the virtual machine. - * - * @param protectionPolicy the protectionPolicy value to set. - * @return the VirtualMachineScaleSetVMPropertiesInner object itself. - */ - public VirtualMachineScaleSetVMPropertiesInner withProtectionPolicy( - VirtualMachineScaleSetVMProtectionPolicy protectionPolicy) { - this.protectionPolicy = protectionPolicy; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (instanceView() != null) { - instanceView().validate(); - } - if (hardwareProfile() != null) { - hardwareProfile().validate(); - } - if (storageProfile() != null) { - storageProfile().validate(); - } - if (additionalCapabilities() != null) { - additionalCapabilities().validate(); - } - if (osProfile() != null) { - osProfile().validate(); - } - if (securityProfile() != null) { - securityProfile().validate(); - } - if (networkProfile() != null) { - networkProfile().validate(); - } - if (networkProfileConfiguration() != null) { - networkProfileConfiguration().validate(); - } - if (diagnosticsProfile() != null) { - diagnosticsProfile().validate(); - } - if (protectionPolicy() != null) { - protectionPolicy().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineSizeInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineSizeInner.java deleted file mode 100644 index b41e5b547ee0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineSizeInner.java +++ /dev/null @@ -1,183 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describes the properties of a VM size. */ -@Fluent -public final class VirtualMachineSizeInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineSizeInner.class); - - /* - * The name of the virtual machine size. - */ - @JsonProperty(value = "name") - private String name; - - /* - * The number of cores supported by the virtual machine size. - */ - @JsonProperty(value = "numberOfCores") - private Integer numberOfCores; - - /* - * The OS disk size, in MB, allowed by the virtual machine size. - */ - @JsonProperty(value = "osDiskSizeInMB") - private Integer osDiskSizeInMB; - - /* - * The resource disk size, in MB, allowed by the virtual machine size. - */ - @JsonProperty(value = "resourceDiskSizeInMB") - private Integer resourceDiskSizeInMB; - - /* - * The amount of memory, in MB, supported by the virtual machine size. - */ - @JsonProperty(value = "memoryInMB") - private Integer memoryInMB; - - /* - * The maximum number of data disks that can be attached to the virtual - * machine size. - */ - @JsonProperty(value = "maxDataDiskCount") - private Integer maxDataDiskCount; - - /** - * Get the name property: The name of the virtual machine size. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the virtual machine size. - * - * @param name the name value to set. - * @return the VirtualMachineSizeInner object itself. - */ - public VirtualMachineSizeInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the numberOfCores property: The number of cores supported by the virtual machine size. - * - * @return the numberOfCores value. - */ - public Integer numberOfCores() { - return this.numberOfCores; - } - - /** - * Set the numberOfCores property: The number of cores supported by the virtual machine size. - * - * @param numberOfCores the numberOfCores value to set. - * @return the VirtualMachineSizeInner object itself. - */ - public VirtualMachineSizeInner withNumberOfCores(Integer numberOfCores) { - this.numberOfCores = numberOfCores; - return this; - } - - /** - * Get the osDiskSizeInMB property: The OS disk size, in MB, allowed by the virtual machine size. - * - * @return the osDiskSizeInMB value. - */ - public Integer osDiskSizeInMB() { - return this.osDiskSizeInMB; - } - - /** - * Set the osDiskSizeInMB property: The OS disk size, in MB, allowed by the virtual machine size. - * - * @param osDiskSizeInMB the osDiskSizeInMB value to set. - * @return the VirtualMachineSizeInner object itself. - */ - public VirtualMachineSizeInner withOsDiskSizeInMB(Integer osDiskSizeInMB) { - this.osDiskSizeInMB = osDiskSizeInMB; - return this; - } - - /** - * Get the resourceDiskSizeInMB property: The resource disk size, in MB, allowed by the virtual machine size. - * - * @return the resourceDiskSizeInMB value. - */ - public Integer resourceDiskSizeInMB() { - return this.resourceDiskSizeInMB; - } - - /** - * Set the resourceDiskSizeInMB property: The resource disk size, in MB, allowed by the virtual machine size. - * - * @param resourceDiskSizeInMB the resourceDiskSizeInMB value to set. - * @return the VirtualMachineSizeInner object itself. - */ - public VirtualMachineSizeInner withResourceDiskSizeInMB(Integer resourceDiskSizeInMB) { - this.resourceDiskSizeInMB = resourceDiskSizeInMB; - return this; - } - - /** - * Get the memoryInMB property: The amount of memory, in MB, supported by the virtual machine size. - * - * @return the memoryInMB value. - */ - public Integer memoryInMB() { - return this.memoryInMB; - } - - /** - * Set the memoryInMB property: The amount of memory, in MB, supported by the virtual machine size. - * - * @param memoryInMB the memoryInMB value to set. - * @return the VirtualMachineSizeInner object itself. - */ - public VirtualMachineSizeInner withMemoryInMB(Integer memoryInMB) { - this.memoryInMB = memoryInMB; - return this; - } - - /** - * Get the maxDataDiskCount property: The maximum number of data disks that can be attached to the virtual machine - * size. - * - * @return the maxDataDiskCount value. - */ - public Integer maxDataDiskCount() { - return this.maxDataDiskCount; - } - - /** - * Set the maxDataDiskCount property: The maximum number of data disks that can be attached to the virtual machine - * size. - * - * @param maxDataDiskCount the maxDataDiskCount value to set. - * @return the VirtualMachineSizeInner object itself. - */ - public VirtualMachineSizeInner withMaxDataDiskCount(Integer maxDataDiskCount) { - this.maxDataDiskCount = maxDataDiskCount; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineUpdateInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineUpdateInner.java deleted file mode 100644 index 51c0fda81950..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/VirtualMachineUpdateInner.java +++ /dev/null @@ -1,658 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.models.AdditionalCapabilities; -import com.azure.resourcemanager.compute.models.BillingProfile; -import com.azure.resourcemanager.compute.models.DiagnosticsProfile; -import com.azure.resourcemanager.compute.models.HardwareProfile; -import com.azure.resourcemanager.compute.models.NetworkProfile; -import com.azure.resourcemanager.compute.models.OSProfile; -import com.azure.resourcemanager.compute.models.Plan; -import com.azure.resourcemanager.compute.models.SecurityProfile; -import com.azure.resourcemanager.compute.models.StorageProfile; -import com.azure.resourcemanager.compute.models.UpdateResource; -import com.azure.resourcemanager.compute.models.VirtualMachineEvictionPolicyTypes; -import com.azure.resourcemanager.compute.models.VirtualMachineIdentity; -import com.azure.resourcemanager.compute.models.VirtualMachinePriorityTypes; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** Describes a Virtual Machine Update. */ -@Fluent -public final class VirtualMachineUpdateInner extends UpdateResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineUpdateInner.class); - - /* - * Specifies information about the marketplace image used to create the - * virtual machine. This element is only used for marketplace images. - * Before you can use a marketplace image from an API, you must enable the - * image for programmatic use. In the Azure portal, find the marketplace - * image that you want to use and then click **Want to deploy - * programmatically, Get Started ->**. Enter any required information and - * then click **Save**. - */ - @JsonProperty(value = "plan") - private Plan plan; - - /* - * Describes the properties of a Virtual Machine. - */ - @JsonProperty(value = "properties") - private VirtualMachinePropertiesInner innerProperties; - - /* - * The identity of the virtual machine, if configured. - */ - @JsonProperty(value = "identity") - private VirtualMachineIdentity identity; - - /* - * The virtual machine zones. - */ - @JsonProperty(value = "zones") - private List zones; - - /** - * Get the plan property: Specifies information about the marketplace image used to create the virtual machine. This - * element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable - * the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then - * click **Want to deploy programmatically, Get Started ->**. Enter any required information and then click - * **Save**. - * - * @return the plan value. - */ - public Plan plan() { - return this.plan; - } - - /** - * Set the plan property: Specifies information about the marketplace image used to create the virtual machine. This - * element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable - * the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then - * click **Want to deploy programmatically, Get Started ->**. Enter any required information and then click - * **Save**. - * - * @param plan the plan value to set. - * @return the VirtualMachineUpdateInner object itself. - */ - public VirtualMachineUpdateInner withPlan(Plan plan) { - this.plan = plan; - return this; - } - - /** - * Get the innerProperties property: Describes the properties of a Virtual Machine. - * - * @return the innerProperties value. - */ - private VirtualMachinePropertiesInner innerProperties() { - return this.innerProperties; - } - - /** - * Get the identity property: The identity of the virtual machine, if configured. - * - * @return the identity value. - */ - public VirtualMachineIdentity identity() { - return this.identity; - } - - /** - * Set the identity property: The identity of the virtual machine, if configured. - * - * @param identity the identity value to set. - * @return the VirtualMachineUpdateInner object itself. - */ - public VirtualMachineUpdateInner withIdentity(VirtualMachineIdentity identity) { - this.identity = identity; - return this; - } - - /** - * Get the zones property: The virtual machine zones. - * - * @return the zones value. - */ - public List zones() { - return this.zones; - } - - /** - * Set the zones property: The virtual machine zones. - * - * @param zones the zones value to set. - * @return the VirtualMachineUpdateInner object itself. - */ - public VirtualMachineUpdateInner withZones(List zones) { - this.zones = zones; - return this; - } - - /** {@inheritDoc} */ - @Override - public VirtualMachineUpdateInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the hardwareProfile property: Specifies the hardware settings for the virtual machine. - * - * @return the hardwareProfile value. - */ - public HardwareProfile hardwareProfile() { - return this.innerProperties() == null ? null : this.innerProperties().hardwareProfile(); - } - - /** - * Set the hardwareProfile property: Specifies the hardware settings for the virtual machine. - * - * @param hardwareProfile the hardwareProfile value to set. - * @return the VirtualMachineUpdateInner object itself. - */ - public VirtualMachineUpdateInner withHardwareProfile(HardwareProfile hardwareProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachinePropertiesInner(); - } - this.innerProperties().withHardwareProfile(hardwareProfile); - return this; - } - - /** - * Get the storageProfile property: Specifies the storage settings for the virtual machine disks. - * - * @return the storageProfile value. - */ - public StorageProfile storageProfile() { - return this.innerProperties() == null ? null : this.innerProperties().storageProfile(); - } - - /** - * Set the storageProfile property: Specifies the storage settings for the virtual machine disks. - * - * @param storageProfile the storageProfile value to set. - * @return the VirtualMachineUpdateInner object itself. - */ - public VirtualMachineUpdateInner withStorageProfile(StorageProfile storageProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachinePropertiesInner(); - } - this.innerProperties().withStorageProfile(storageProfile); - return this; - } - - /** - * Get the additionalCapabilities property: Specifies additional capabilities enabled or disabled on the virtual - * machine. - * - * @return the additionalCapabilities value. - */ - public AdditionalCapabilities additionalCapabilities() { - return this.innerProperties() == null ? null : this.innerProperties().additionalCapabilities(); - } - - /** - * Set the additionalCapabilities property: Specifies additional capabilities enabled or disabled on the virtual - * machine. - * - * @param additionalCapabilities the additionalCapabilities value to set. - * @return the VirtualMachineUpdateInner object itself. - */ - public VirtualMachineUpdateInner withAdditionalCapabilities(AdditionalCapabilities additionalCapabilities) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachinePropertiesInner(); - } - this.innerProperties().withAdditionalCapabilities(additionalCapabilities); - return this; - } - - /** - * Get the osProfile property: Specifies the operating system settings used while creating the virtual machine. Some - * of the settings cannot be changed once VM is provisioned. - * - * @return the osProfile value. - */ - public OSProfile osProfile() { - return this.innerProperties() == null ? null : this.innerProperties().osProfile(); - } - - /** - * Set the osProfile property: Specifies the operating system settings used while creating the virtual machine. Some - * of the settings cannot be changed once VM is provisioned. - * - * @param osProfile the osProfile value to set. - * @return the VirtualMachineUpdateInner object itself. - */ - public VirtualMachineUpdateInner withOsProfile(OSProfile osProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachinePropertiesInner(); - } - this.innerProperties().withOsProfile(osProfile); - return this; - } - - /** - * Get the networkProfile property: Specifies the network interfaces of the virtual machine. - * - * @return the networkProfile value. - */ - public NetworkProfile networkProfile() { - return this.innerProperties() == null ? null : this.innerProperties().networkProfile(); - } - - /** - * Set the networkProfile property: Specifies the network interfaces of the virtual machine. - * - * @param networkProfile the networkProfile value to set. - * @return the VirtualMachineUpdateInner object itself. - */ - public VirtualMachineUpdateInner withNetworkProfile(NetworkProfile networkProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachinePropertiesInner(); - } - this.innerProperties().withNetworkProfile(networkProfile); - return this; - } - - /** - * Get the securityProfile property: Specifies the Security related profile settings for the virtual machine. - * - * @return the securityProfile value. - */ - public SecurityProfile securityProfile() { - return this.innerProperties() == null ? null : this.innerProperties().securityProfile(); - } - - /** - * Set the securityProfile property: Specifies the Security related profile settings for the virtual machine. - * - * @param securityProfile the securityProfile value to set. - * @return the VirtualMachineUpdateInner object itself. - */ - public VirtualMachineUpdateInner withSecurityProfile(SecurityProfile securityProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachinePropertiesInner(); - } - this.innerProperties().withSecurityProfile(securityProfile); - return this; - } - - /** - * Get the diagnosticsProfile property: Specifies the boot diagnostic settings state. <br><br>Minimum - * api-version: 2015-06-15. - * - * @return the diagnosticsProfile value. - */ - public DiagnosticsProfile diagnosticsProfile() { - return this.innerProperties() == null ? null : this.innerProperties().diagnosticsProfile(); - } - - /** - * Set the diagnosticsProfile property: Specifies the boot diagnostic settings state. <br><br>Minimum - * api-version: 2015-06-15. - * - * @param diagnosticsProfile the diagnosticsProfile value to set. - * @return the VirtualMachineUpdateInner object itself. - */ - public VirtualMachineUpdateInner withDiagnosticsProfile(DiagnosticsProfile diagnosticsProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachinePropertiesInner(); - } - this.innerProperties().withDiagnosticsProfile(diagnosticsProfile); - return this; - } - - /** - * Get the availabilitySet property: Specifies information about the availability set that the virtual machine - * should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes - * to maximize availability. For more information about availability sets, see [Manage the availability of virtual - * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). - * <br><br> For more information on Azure planned maintenance, see [Planned maintenance for virtual - * machines in - * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) - * <br><br> Currently, a VM can only be added to availability set at creation time. The availability set - * to which the VM is being added should be under the same resource group as the availability set resource. An - * existing VM cannot be added to an availability set. <br><br>This property cannot exist along with a - * non-null properties.virtualMachineScaleSet reference. - * - * @return the availabilitySet value. - */ - public SubResource availabilitySet() { - return this.innerProperties() == null ? null : this.innerProperties().availabilitySet(); - } - - /** - * Set the availabilitySet property: Specifies information about the availability set that the virtual machine - * should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes - * to maximize availability. For more information about availability sets, see [Manage the availability of virtual - * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). - * <br><br> For more information on Azure planned maintenance, see [Planned maintenance for virtual - * machines in - * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) - * <br><br> Currently, a VM can only be added to availability set at creation time. The availability set - * to which the VM is being added should be under the same resource group as the availability set resource. An - * existing VM cannot be added to an availability set. <br><br>This property cannot exist along with a - * non-null properties.virtualMachineScaleSet reference. - * - * @param availabilitySet the availabilitySet value to set. - * @return the VirtualMachineUpdateInner object itself. - */ - public VirtualMachineUpdateInner withAvailabilitySet(SubResource availabilitySet) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachinePropertiesInner(); - } - this.innerProperties().withAvailabilitySet(availabilitySet); - return this; - } - - /** - * Get the virtualMachineScaleSet property: Specifies information about the virtual machine scale set that the - * virtual machine should be assigned to. Virtual machines specified in the same virtual machine scale set are - * allocated to different nodes to maximize availability. Currently, a VM can only be added to virtual machine scale - * set at creation time. An existing VM cannot be added to a virtual machine scale set. <br><br>This - * property cannot exist along with a non-null properties.availabilitySet reference. <br><br>Minimum - * api‐version: 2019‐03‐01. - * - * @return the virtualMachineScaleSet value. - */ - public SubResource virtualMachineScaleSet() { - return this.innerProperties() == null ? null : this.innerProperties().virtualMachineScaleSet(); - } - - /** - * Set the virtualMachineScaleSet property: Specifies information about the virtual machine scale set that the - * virtual machine should be assigned to. Virtual machines specified in the same virtual machine scale set are - * allocated to different nodes to maximize availability. Currently, a VM can only be added to virtual machine scale - * set at creation time. An existing VM cannot be added to a virtual machine scale set. <br><br>This - * property cannot exist along with a non-null properties.availabilitySet reference. <br><br>Minimum - * api‐version: 2019‐03‐01. - * - * @param virtualMachineScaleSet the virtualMachineScaleSet value to set. - * @return the VirtualMachineUpdateInner object itself. - */ - public VirtualMachineUpdateInner withVirtualMachineScaleSet(SubResource virtualMachineScaleSet) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachinePropertiesInner(); - } - this.innerProperties().withVirtualMachineScaleSet(virtualMachineScaleSet); - return this; - } - - /** - * Get the proximityPlacementGroup property: Specifies information about the proximity placement group that the - * virtual machine should be assigned to. <br><br>Minimum api-version: 2018-04-01. - * - * @return the proximityPlacementGroup value. - */ - public SubResource proximityPlacementGroup() { - return this.innerProperties() == null ? null : this.innerProperties().proximityPlacementGroup(); - } - - /** - * Set the proximityPlacementGroup property: Specifies information about the proximity placement group that the - * virtual machine should be assigned to. <br><br>Minimum api-version: 2018-04-01. - * - * @param proximityPlacementGroup the proximityPlacementGroup value to set. - * @return the VirtualMachineUpdateInner object itself. - */ - public VirtualMachineUpdateInner withProximityPlacementGroup(SubResource proximityPlacementGroup) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachinePropertiesInner(); - } - this.innerProperties().withProximityPlacementGroup(proximityPlacementGroup); - return this; - } - - /** - * Get the priority property: Specifies the priority for the virtual machine. <br><br>Minimum - * api-version: 2019-03-01. - * - * @return the priority value. - */ - public VirtualMachinePriorityTypes priority() { - return this.innerProperties() == null ? null : this.innerProperties().priority(); - } - - /** - * Set the priority property: Specifies the priority for the virtual machine. <br><br>Minimum - * api-version: 2019-03-01. - * - * @param priority the priority value to set. - * @return the VirtualMachineUpdateInner object itself. - */ - public VirtualMachineUpdateInner withPriority(VirtualMachinePriorityTypes priority) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachinePropertiesInner(); - } - this.innerProperties().withPriority(priority); - return this; - } - - /** - * Get the evictionPolicy property: Specifies the eviction policy for the Azure Spot virtual machine and Azure Spot - * scale set. <br><br>For Azure Spot virtual machines, both 'Deallocate' and 'Delete' are supported and - * the minimum api-version is 2019-03-01. <br><br>For Azure Spot scale sets, both 'Deallocate' and - * 'Delete' are supported and the minimum api-version is 2017-10-30-preview. - * - * @return the evictionPolicy value. - */ - public VirtualMachineEvictionPolicyTypes evictionPolicy() { - return this.innerProperties() == null ? null : this.innerProperties().evictionPolicy(); - } - - /** - * Set the evictionPolicy property: Specifies the eviction policy for the Azure Spot virtual machine and Azure Spot - * scale set. <br><br>For Azure Spot virtual machines, both 'Deallocate' and 'Delete' are supported and - * the minimum api-version is 2019-03-01. <br><br>For Azure Spot scale sets, both 'Deallocate' and - * 'Delete' are supported and the minimum api-version is 2017-10-30-preview. - * - * @param evictionPolicy the evictionPolicy value to set. - * @return the VirtualMachineUpdateInner object itself. - */ - public VirtualMachineUpdateInner withEvictionPolicy(VirtualMachineEvictionPolicyTypes evictionPolicy) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachinePropertiesInner(); - } - this.innerProperties().withEvictionPolicy(evictionPolicy); - return this; - } - - /** - * Get the billingProfile property: Specifies the billing related details of a Azure Spot virtual machine. - * <br><br>Minimum api-version: 2019-03-01. - * - * @return the billingProfile value. - */ - public BillingProfile billingProfile() { - return this.innerProperties() == null ? null : this.innerProperties().billingProfile(); - } - - /** - * Set the billingProfile property: Specifies the billing related details of a Azure Spot virtual machine. - * <br><br>Minimum api-version: 2019-03-01. - * - * @param billingProfile the billingProfile value to set. - * @return the VirtualMachineUpdateInner object itself. - */ - public VirtualMachineUpdateInner withBillingProfile(BillingProfile billingProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachinePropertiesInner(); - } - this.innerProperties().withBillingProfile(billingProfile); - return this; - } - - /** - * Get the host property: Specifies information about the dedicated host that the virtual machine resides in. - * <br><br>Minimum api-version: 2018-10-01. - * - * @return the host value. - */ - public SubResource host() { - return this.innerProperties() == null ? null : this.innerProperties().host(); - } - - /** - * Set the host property: Specifies information about the dedicated host that the virtual machine resides in. - * <br><br>Minimum api-version: 2018-10-01. - * - * @param host the host value to set. - * @return the VirtualMachineUpdateInner object itself. - */ - public VirtualMachineUpdateInner withHost(SubResource host) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachinePropertiesInner(); - } - this.innerProperties().withHost(host); - return this; - } - - /** - * Get the hostGroup property: Specifies information about the dedicated host group that the virtual machine resides - * in. <br><br>Minimum api-version: 2020-06-01. <br><br>NOTE: User cannot specify both host - * and hostGroup properties. - * - * @return the hostGroup value. - */ - public SubResource hostGroup() { - return this.innerProperties() == null ? null : this.innerProperties().hostGroup(); - } - - /** - * Set the hostGroup property: Specifies information about the dedicated host group that the virtual machine resides - * in. <br><br>Minimum api-version: 2020-06-01. <br><br>NOTE: User cannot specify both host - * and hostGroup properties. - * - * @param hostGroup the hostGroup value to set. - * @return the VirtualMachineUpdateInner object itself. - */ - public VirtualMachineUpdateInner withHostGroup(SubResource hostGroup) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachinePropertiesInner(); - } - this.innerProperties().withHostGroup(hostGroup); - return this; - } - - /** - * Get the provisioningState property: The provisioning state, which only appears in the response. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the instanceView property: The virtual machine instance view. - * - * @return the instanceView value. - */ - public VirtualMachineInstanceViewInner instanceView() { - return this.innerProperties() == null ? null : this.innerProperties().instanceView(); - } - - /** - * Get the licenseType property: Specifies that the image or disk that is being used was licensed on-premises. - * <br><br> Possible values for Windows Server operating system are: <br><br> Windows_Client - * <br><br> Windows_Server <br><br> Possible values for Linux Server operating system are: - * <br><br> RHEL_BYOS (for RHEL) <br><br> SLES_BYOS (for SUSE) <br><br> For more - * information, see [Azure Hybrid Use Benefit for Windows - * Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) - * <br><br> [Azure Hybrid Use Benefit for Linux - * Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) <br><br> - * Minimum api-version: 2015-06-15. - * - * @return the licenseType value. - */ - public String licenseType() { - return this.innerProperties() == null ? null : this.innerProperties().licenseType(); - } - - /** - * Set the licenseType property: Specifies that the image or disk that is being used was licensed on-premises. - * <br><br> Possible values for Windows Server operating system are: <br><br> Windows_Client - * <br><br> Windows_Server <br><br> Possible values for Linux Server operating system are: - * <br><br> RHEL_BYOS (for RHEL) <br><br> SLES_BYOS (for SUSE) <br><br> For more - * information, see [Azure Hybrid Use Benefit for Windows - * Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) - * <br><br> [Azure Hybrid Use Benefit for Linux - * Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) <br><br> - * Minimum api-version: 2015-06-15. - * - * @param licenseType the licenseType value to set. - * @return the VirtualMachineUpdateInner object itself. - */ - public VirtualMachineUpdateInner withLicenseType(String licenseType) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachinePropertiesInner(); - } - this.innerProperties().withLicenseType(licenseType); - return this; - } - - /** - * Get the vmId property: Specifies the VM unique ID which is a 128-bits identifier that is encoded and stored in - * all Azure IaaS VMs SMBIOS and can be read using platform BIOS commands. - * - * @return the vmId value. - */ - public String vmId() { - return this.innerProperties() == null ? null : this.innerProperties().vmId(); - } - - /** - * Get the extensionsTimeBudget property: Specifies the time alloted for all extensions to start. The time duration - * should be between 15 minutes and 120 minutes (inclusive) and should be specified in ISO 8601 format. The default - * value is 90 minutes (PT1H30M). <br><br> Minimum api-version: 2020-06-01. - * - * @return the extensionsTimeBudget value. - */ - public String extensionsTimeBudget() { - return this.innerProperties() == null ? null : this.innerProperties().extensionsTimeBudget(); - } - - /** - * Set the extensionsTimeBudget property: Specifies the time alloted for all extensions to start. The time duration - * should be between 15 minutes and 120 minutes (inclusive) and should be specified in ISO 8601 format. The default - * value is 90 minutes (PT1H30M). <br><br> Minimum api-version: 2020-06-01. - * - * @param extensionsTimeBudget the extensionsTimeBudget value to set. - * @return the VirtualMachineUpdateInner object itself. - */ - public VirtualMachineUpdateInner withExtensionsTimeBudget(String extensionsTimeBudget) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachinePropertiesInner(); - } - this.innerProperties().withExtensionsTimeBudget(extensionsTimeBudget); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (plan() != null) { - plan().validate(); - } - if (innerProperties() != null) { - innerProperties().validate(); - } - if (identity() != null) { - identity().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/package-info.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/package-info.java deleted file mode 100644 index cea307946e0f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** Package containing the inner data models for ComputeManagementClient. Compute Client. */ -package com.azure.resourcemanager.compute.fluent.models; diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/package-info.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/package-info.java deleted file mode 100644 index 6462ff0df745..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** Package containing the service clients for ComputeManagementClient. Compute Client. */ -package com.azure.resourcemanager.compute.fluent; diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/AvailabilitySetImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/AvailabilitySetImpl.java deleted file mode 100644 index 5cd9ea4a1d0a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/AvailabilitySetImpl.java +++ /dev/null @@ -1,224 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.compute.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.SubResource; -import com.azure.resourcemanager.compute.ComputeManager; -import com.azure.resourcemanager.compute.models.AvailabilitySet; -import com.azure.resourcemanager.compute.models.AvailabilitySetSkuTypes; -import com.azure.resourcemanager.compute.models.InstanceViewStatus; -import com.azure.resourcemanager.compute.models.ProximityPlacementGroup; -import com.azure.resourcemanager.compute.models.ProximityPlacementGroupType; -import com.azure.resourcemanager.compute.models.Sku; -import com.azure.resourcemanager.compute.models.VirtualMachineSize; -import com.azure.resourcemanager.compute.fluent.models.AvailabilitySetInner; -import com.azure.resourcemanager.compute.fluent.models.ProximityPlacementGroupInner; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceId; -import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.GroupableResourceImpl; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; - -import java.util.Collections; -import java.util.HashSet; -import java.util.List; -import java.util.Set; -import reactor.core.publisher.Mono; -import com.azure.resourcemanager.resources.fluentcore.utils.PagedConverter; - -/** The implementation for AvailabilitySet and its create and update interfaces. */ -class AvailabilitySetImpl - extends GroupableResourceImpl - implements AvailabilitySet, AvailabilitySet.Definition, AvailabilitySet.Update { - - private Set idOfVMsInSet; - // Name of the new proximity placement group - private String newProximityPlacementGroupName; - // Type fo the new proximity placement group - private ProximityPlacementGroupType newProximityPlacementGroupType; - - AvailabilitySetImpl(String name, AvailabilitySetInner innerModel, final ComputeManager computeManager) { - super(name, innerModel, computeManager); - newProximityPlacementGroupName = null; - newProximityPlacementGroupType = null; - newProximityPlacementGroupType = null; - } - - @Override - public int updateDomainCount() { - return ResourceManagerUtils.toPrimitiveInt(this.innerModel().platformUpdateDomainCount()); - } - - @Override - public int faultDomainCount() { - return ResourceManagerUtils.toPrimitiveInt(this.innerModel().platformFaultDomainCount()); - } - - @Override - public AvailabilitySetSkuTypes sku() { - if (this.innerModel().sku() != null && this.innerModel().sku().name() != null) { - return AvailabilitySetSkuTypes.fromString(this.innerModel().sku().name()); - } - return null; - } - - @Override - public Set virtualMachineIds() { - if (idOfVMsInSet == null) { - idOfVMsInSet = new HashSet<>(); - for (SubResource resource : this.innerModel().virtualMachines()) { - idOfVMsInSet.add(resource.id()); - } - } - return Collections.unmodifiableSet(idOfVMsInSet); - } - - @Override - public ProximityPlacementGroup proximityPlacementGroup() { - if (innerModel().proximityPlacementGroup() == null) { - return null; - } else { - ResourceId id = ResourceId.fromString(innerModel().proximityPlacementGroup().id()); - ProximityPlacementGroupInner plgInner = - manager() - .serviceClient() - .getProximityPlacementGroups() - .getByResourceGroup(id.resourceGroupName(), id.name()); - if (plgInner == null) { - return null; - } else { - return new ProximityPlacementGroupImpl(plgInner); - } - } - } - - @Override - public List statuses() { - return Collections.unmodifiableList(this.innerModel().statuses()); - } - - @Override - public PagedIterable listVirtualMachineSizes() { - return PagedConverter.mapPage(manager() - .serviceClient() - .getAvailabilitySets() - .listAvailableSizes(resourceGroupName(), name()), - virtualMachineSizeInner -> new VirtualMachineSizeImpl(virtualMachineSizeInner)); - } - - @Override - public Mono refreshAsync() { - return super - .refreshAsync() - .map( - availabilitySet -> { - AvailabilitySetImpl impl = (AvailabilitySetImpl) availabilitySet; - impl.idOfVMsInSet = null; - return impl; - }); - } - - @Override - protected Mono getInnerAsync() { - return this - .manager() - .serviceClient() - .getAvailabilitySets() - .getByResourceGroupAsync(this.resourceGroupName(), this.name()); - } - - @Override - public AvailabilitySetImpl withUpdateDomainCount(int updateDomainCount) { - this.innerModel().withPlatformUpdateDomainCount(updateDomainCount); - return this; - } - - @Override - public AvailabilitySetImpl withFaultDomainCount(int faultDomainCount) { - this.innerModel().withPlatformFaultDomainCount(faultDomainCount); - return this; - } - - @Override - public AvailabilitySetImpl withSku(AvailabilitySetSkuTypes skuType) { - if (this.innerModel().sku() == null) { - this.innerModel().withSku(new Sku()); - } - this.innerModel().sku().withName(skuType.toString()); - return this; - } - - @Override - public AvailabilitySetImpl withProximityPlacementGroup(String proximityPlacementGroupId) { - this.innerModel().withProximityPlacementGroup(new SubResource().withId(proximityPlacementGroupId)); - this.newProximityPlacementGroupType = null; - this.newProximityPlacementGroupName = null; - return this; - } - - @Override - public AvailabilitySetImpl withNewProximityPlacementGroup( - String proximityPlacementGroupName, ProximityPlacementGroupType type) { - this.newProximityPlacementGroupName = proximityPlacementGroupName; - this.newProximityPlacementGroupType = type; - - this.innerModel().withProximityPlacementGroup(null); - - return this; - } - - @Override - public AvailabilitySetImpl withoutProximityPlacementGroup() { - this.innerModel().withProximityPlacementGroup(null); - return this; - } - - // CreateUpdateTaskGroup.ResourceCreator.createResourceAsync implementation - - @Override - public Mono createResourceAsync() { - final AvailabilitySetImpl self = this; - if (this.innerModel().platformFaultDomainCount() == null) { - this.innerModel().withPlatformFaultDomainCount(2); - } - if (this.innerModel().platformUpdateDomainCount() == null) { - this.innerModel().withPlatformUpdateDomainCount(5); - } - return this - .createNewProximityPlacementGroupAsync() - .flatMap( - availabilitySet -> - manager() - .serviceClient() - .getAvailabilitySets() - .createOrUpdateAsync(resourceGroupName(), name(), innerModel()) - .map( - availabilitySetInner -> { - self.setInner(availabilitySetInner); - idOfVMsInSet = null; - return self; - })); - } - - private Mono createNewProximityPlacementGroupAsync() { - if (isInCreateMode()) { - if (this.newProximityPlacementGroupName != null && !this.newProximityPlacementGroupName.isEmpty()) { - ProximityPlacementGroupInner plgInner = new ProximityPlacementGroupInner(); - plgInner.withProximityPlacementGroupType(this.newProximityPlacementGroupType); - plgInner.withLocation(this.innerModel().location()); - return this - .manager() - .serviceClient() - .getProximityPlacementGroups() - .createOrUpdateAsync(this.resourceGroupName(), this.newProximityPlacementGroupName, plgInner) - .map( - createdPlgInner -> { - this - .innerModel() - .withProximityPlacementGroup(new SubResource().withId(createdPlgInner.id())); - return this; - }); - } - } - return Mono.just(this); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/AvailabilitySetsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/AvailabilitySetsClientImpl.java deleted file mode 100644 index 514b886eb165..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/AvailabilitySetsClientImpl.java +++ /dev/null @@ -1,1483 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.fluent.AvailabilitySetsClient; -import com.azure.resourcemanager.compute.fluent.models.AvailabilitySetInner; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineSizeInner; -import com.azure.resourcemanager.compute.models.AvailabilitySetListResult; -import com.azure.resourcemanager.compute.models.AvailabilitySetUpdate; -import com.azure.resourcemanager.compute.models.VirtualMachineSizeListResult; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in AvailabilitySetsClient. */ -public final class AvailabilitySetsClientImpl - implements InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete, - AvailabilitySetsClient { - private final ClientLogger logger = new ClientLogger(AvailabilitySetsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final AvailabilitySetsService service; - - /** The service client containing this operation class. */ - private final ComputeManagementClientImpl client; - - /** - * Initializes an instance of AvailabilitySetsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - AvailabilitySetsClientImpl(ComputeManagementClientImpl client) { - this.service = - RestProxy.create(AvailabilitySetsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for ComputeManagementClientAvailabilitySets to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "ComputeManagementCli") - private interface AvailabilitySetsService { - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/availabilitySets/{availabilitySetName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("availabilitySetName") String availabilitySetName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") AvailabilitySetInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/availabilitySets/{availabilitySetName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("availabilitySetName") String availabilitySetName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") AvailabilitySetUpdate parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/availabilitySets/{availabilitySetName}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("availabilitySetName") String availabilitySetName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/availabilitySets/{availabilitySetName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("availabilitySetName") String availabilitySetName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/availabilitySets") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("$expand") String expand, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/availabilitySets") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/availabilitySets/{availabilitySetName}/vmSizes") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAvailableSizes( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("availabilitySetName") String availabilitySetName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Create or update an availability set. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName The name of the availability set. - * @param parameters Parameters supplied to the Create Availability Set operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the availability set that the virtual machine should be assigned to. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String availabilitySetName, AvailabilitySetInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (availabilitySetName == null) { - return Mono - .error(new IllegalArgumentException("Parameter availabilitySetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - availabilitySetName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create or update an availability set. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName The name of the availability set. - * @param parameters Parameters supplied to the Create Availability Set operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the availability set that the virtual machine should be assigned to. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String availabilitySetName, AvailabilitySetInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (availabilitySetName == null) { - return Mono - .error(new IllegalArgumentException("Parameter availabilitySetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - availabilitySetName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Create or update an availability set. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName The name of the availability set. - * @param parameters Parameters supplied to the Create Availability Set operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the availability set that the virtual machine should be assigned to. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, String availabilitySetName, AvailabilitySetInner parameters) { - return createOrUpdateWithResponseAsync(resourceGroupName, availabilitySetName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Create or update an availability set. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName The name of the availability set. - * @param parameters Parameters supplied to the Create Availability Set operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the availability set that the virtual machine should be assigned to. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AvailabilitySetInner createOrUpdate( - String resourceGroupName, String availabilitySetName, AvailabilitySetInner parameters) { - return createOrUpdateAsync(resourceGroupName, availabilitySetName, parameters).block(); - } - - /** - * Create or update an availability set. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName The name of the availability set. - * @param parameters Parameters supplied to the Create Availability Set operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the availability set that the virtual machine should be assigned to. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceGroupName, String availabilitySetName, AvailabilitySetInner parameters, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, availabilitySetName, parameters, context).block(); - } - - /** - * Update an availability set. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName The name of the availability set. - * @param parameters Parameters supplied to the Update Availability Set operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the availability set that the virtual machine should be assigned to. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateWithResponseAsync( - String resourceGroupName, String availabilitySetName, AvailabilitySetUpdate parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (availabilitySetName == null) { - return Mono - .error(new IllegalArgumentException("Parameter availabilitySetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - resourceGroupName, - availabilitySetName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Update an availability set. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName The name of the availability set. - * @param parameters Parameters supplied to the Update Availability Set operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the availability set that the virtual machine should be assigned to. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, String availabilitySetName, AvailabilitySetUpdate parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (availabilitySetName == null) { - return Mono - .error(new IllegalArgumentException("Parameter availabilitySetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - resourceGroupName, - availabilitySetName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Update an availability set. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName The name of the availability set. - * @param parameters Parameters supplied to the Update Availability Set operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the availability set that the virtual machine should be assigned to. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync( - String resourceGroupName, String availabilitySetName, AvailabilitySetUpdate parameters) { - return updateWithResponseAsync(resourceGroupName, availabilitySetName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Update an availability set. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName The name of the availability set. - * @param parameters Parameters supplied to the Update Availability Set operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the availability set that the virtual machine should be assigned to. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AvailabilitySetInner update( - String resourceGroupName, String availabilitySetName, AvailabilitySetUpdate parameters) { - return updateAsync(resourceGroupName, availabilitySetName, parameters).block(); - } - - /** - * Update an availability set. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName The name of the availability set. - * @param parameters Parameters supplied to the Update Availability Set operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the availability set that the virtual machine should be assigned to. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, String availabilitySetName, AvailabilitySetUpdate parameters, Context context) { - return updateWithResponseAsync(resourceGroupName, availabilitySetName, parameters, context).block(); - } - - /** - * Delete an availability set. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName The name of the availability set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String resourceGroupName, String availabilitySetName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (availabilitySetName == null) { - return Mono - .error(new IllegalArgumentException("Parameter availabilitySetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - availabilitySetName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete an availability set. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName The name of the availability set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String availabilitySetName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (availabilitySetName == null) { - return Mono - .error(new IllegalArgumentException("Parameter availabilitySetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - availabilitySetName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Delete an availability set. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName The name of the availability set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String availabilitySetName) { - return deleteWithResponseAsync(resourceGroupName, availabilitySetName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Delete an availability set. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName The name of the availability set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String availabilitySetName) { - deleteAsync(resourceGroupName, availabilitySetName).block(); - } - - /** - * Delete an availability set. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName The name of the availability set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String availabilitySetName, Context context) { - return deleteWithResponseAsync(resourceGroupName, availabilitySetName, context).block(); - } - - /** - * Retrieves information about an availability set. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName The name of the availability set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the availability set that the virtual machine should be assigned to. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String availabilitySetName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (availabilitySetName == null) { - return Mono - .error(new IllegalArgumentException("Parameter availabilitySetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - availabilitySetName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Retrieves information about an availability set. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName The name of the availability set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the availability set that the virtual machine should be assigned to. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String availabilitySetName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (availabilitySetName == null) { - return Mono - .error(new IllegalArgumentException("Parameter availabilitySetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - availabilitySetName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Retrieves information about an availability set. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName The name of the availability set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the availability set that the virtual machine should be assigned to. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync(String resourceGroupName, String availabilitySetName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, availabilitySetName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Retrieves information about an availability set. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName The name of the availability set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the availability set that the virtual machine should be assigned to. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AvailabilitySetInner getByResourceGroup(String resourceGroupName, String availabilitySetName) { - return getByResourceGroupAsync(resourceGroupName, availabilitySetName).block(); - } - - /** - * Retrieves information about an availability set. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName The name of the availability set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the availability set that the virtual machine should be assigned to. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String availabilitySetName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, availabilitySetName, context).block(); - } - - /** - * Lists all availability sets in a subscription. - * - * @param expand The expand expression to apply to the operation. Allowed values are 'instanceView'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Availability Set operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String expand) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - expand, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all availability sets in a subscription. - * - * @param expand The expand expression to apply to the operation. Allowed values are 'instanceView'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Availability Set operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String expand, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), expand, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists all availability sets in a subscription. - * - * @param expand The expand expression to apply to the operation. Allowed values are 'instanceView'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Availability Set operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String expand) { - return new PagedFlux<>( - () -> listSinglePageAsync(expand), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); - } - - /** - * Lists all availability sets in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Availability Set operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - final String expand = null; - return new PagedFlux<>( - () -> listSinglePageAsync(expand), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); - } - - /** - * Lists all availability sets in a subscription. - * - * @param expand The expand expression to apply to the operation. Allowed values are 'instanceView'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Availability Set operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String expand, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(expand, context), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all availability sets in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Availability Set operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - final String expand = null; - return new PagedIterable<>(listAsync(expand)); - } - - /** - * Lists all availability sets in a subscription. - * - * @param expand The expand expression to apply to the operation. Allowed values are 'instanceView'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Availability Set operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String expand, Context context) { - return new PagedIterable<>(listAsync(expand, context)); - } - - /** - * Lists all availability sets in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Availability Set operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all availability sets in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Availability Set operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists all availability sets in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Availability Set operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists all availability sets in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Availability Set operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all availability sets in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Availability Set operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * Lists all availability sets in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Availability Set operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing - * availability set. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName The name of the availability set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Virtual Machine operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAvailableSizesSinglePageAsync( - String resourceGroupName, String availabilitySetName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (availabilitySetName == null) { - return Mono - .error(new IllegalArgumentException("Parameter availabilitySetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listAvailableSizes( - this.client.getEndpoint(), - resourceGroupName, - availabilitySetName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing - * availability set. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName The name of the availability set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Virtual Machine operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAvailableSizesSinglePageAsync( - String resourceGroupName, String availabilitySetName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (availabilitySetName == null) { - return Mono - .error(new IllegalArgumentException("Parameter availabilitySetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listAvailableSizes( - this.client.getEndpoint(), - resourceGroupName, - availabilitySetName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); - } - - /** - * Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing - * availability set. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName The name of the availability set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Virtual Machine operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAvailableSizesAsync( - String resourceGroupName, String availabilitySetName) { - return new PagedFlux<>(() -> listAvailableSizesSinglePageAsync(resourceGroupName, availabilitySetName)); - } - - /** - * Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing - * availability set. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName The name of the availability set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Virtual Machine operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAvailableSizesAsync( - String resourceGroupName, String availabilitySetName, Context context) { - return new PagedFlux<>( - () -> listAvailableSizesSinglePageAsync(resourceGroupName, availabilitySetName, context)); - } - - /** - * Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing - * availability set. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName The name of the availability set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Virtual Machine operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAvailableSizes( - String resourceGroupName, String availabilitySetName) { - return new PagedIterable<>(listAvailableSizesAsync(resourceGroupName, availabilitySetName)); - } - - /** - * Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing - * availability set. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName The name of the availability set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Virtual Machine operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAvailableSizes( - String resourceGroupName, String availabilitySetName, Context context) { - return new PagedIterable<>(listAvailableSizesAsync(resourceGroupName, availabilitySetName, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Availability Set operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Availability Set operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Availability Set operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Availability Set operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/AvailabilitySetsImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/AvailabilitySetsImpl.java deleted file mode 100644 index 548b51d6a557..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/AvailabilitySetsImpl.java +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.compute.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.CoreUtils; -import com.azure.resourcemanager.compute.ComputeManager; -import com.azure.resourcemanager.compute.models.AvailabilitySet; -import com.azure.resourcemanager.compute.models.AvailabilitySetSkuTypes; -import com.azure.resourcemanager.compute.models.AvailabilitySets; -import com.azure.resourcemanager.compute.fluent.models.AvailabilitySetInner; -import com.azure.resourcemanager.compute.fluent.AvailabilitySetsClient; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.GroupableResourcesImpl; -import reactor.core.publisher.Mono; -import com.azure.resourcemanager.resources.fluentcore.utils.PagedConverter; - -/** The implementation for AvailabilitySets. */ -public class AvailabilitySetsImpl - extends GroupableResourcesImpl< - AvailabilitySet, AvailabilitySetImpl, AvailabilitySetInner, AvailabilitySetsClient, ComputeManager> - implements AvailabilitySets { - - public AvailabilitySetsImpl(final ComputeManager computeManager) { - super(computeManager.serviceClient().getAvailabilitySets(), computeManager); - } - - @Override - public PagedIterable list() { - return new PagedIterable<>(this.listAsync()); - } - - @Override - public PagedFlux listAsync() { - return PagedConverter.mapPage(this.manager().serviceClient().getAvailabilitySets().listAsync(), this::wrapModel); - } - - @Override - public PagedIterable listByResourceGroup(String groupName) { - return new PagedIterable<>(this.listByResourceGroupAsync(groupName)); - } - - @Override - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - if (CoreUtils.isNullOrEmpty(resourceGroupName)) { - return new PagedFlux<>(() -> Mono.error( - new IllegalArgumentException("Parameter 'resourceGroupName' is required and cannot be null."))); - } - return wrapPageAsync(this.inner().listByResourceGroupAsync(resourceGroupName)); - } - - @Override - protected Mono getInnerAsync(String resourceGroupName, String name) { - return this.inner().getByResourceGroupAsync(resourceGroupName, name); - } - - @Override - public AvailabilitySetImpl define(String name) { - return wrapModel(name).withSku(AvailabilitySetSkuTypes.ALIGNED); - } - - @Override - protected Mono deleteInnerAsync(String groupName, String name) { - return this.inner().deleteAsync(groupName, name); - } - - /************************************************************** - * Fluent model helpers. - **************************************************************/ - - @Override - protected AvailabilitySetImpl wrapModel(String name) { - return new AvailabilitySetImpl(name, new AvailabilitySetInner(), this.manager()); - } - - @Override - protected AvailabilitySetImpl wrapModel(AvailabilitySetInner availabilitySetInner) { - if (availabilitySetInner == null) { - return null; - } - return new AvailabilitySetImpl(availabilitySetInner.name(), availabilitySetInner, this.manager()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/ComputeManagementClientBuilder.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/ComputeManagementClientBuilder.java deleted file mode 100644 index 30f3c61e3563..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/ComputeManagementClientBuilder.java +++ /dev/null @@ -1,149 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.implementation; - -import com.azure.core.annotation.ServiceClientBuilder; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.policy.CookiePolicy; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerAdapter; -import java.time.Duration; - -/** A builder for creating a new instance of the ComputeManagementClientImpl type. */ -@ServiceClientBuilder(serviceClients = {ComputeManagementClientImpl.class}) -public final class ComputeManagementClientBuilder { - /* - * Subscription credentials which uniquely identify Microsoft Azure - * subscription. The subscription ID forms part of the URI for every - * service call. - */ - private String subscriptionId; - - /** - * Sets Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms - * part of the URI for every service call. - * - * @param subscriptionId the subscriptionId value. - * @return the ComputeManagementClientBuilder. - */ - public ComputeManagementClientBuilder subscriptionId(String subscriptionId) { - this.subscriptionId = subscriptionId; - return this; - } - - /* - * server parameter - */ - private String endpoint; - - /** - * Sets server parameter. - * - * @param endpoint the endpoint value. - * @return the ComputeManagementClientBuilder. - */ - public ComputeManagementClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * The environment to connect to - */ - private AzureEnvironment environment; - - /** - * Sets The environment to connect to. - * - * @param environment the environment value. - * @return the ComputeManagementClientBuilder. - */ - public ComputeManagementClientBuilder environment(AzureEnvironment environment) { - this.environment = environment; - return this; - } - - /* - * The default poll interval for long-running operation - */ - private Duration defaultPollInterval; - - /** - * Sets The default poll interval for long-running operation. - * - * @param defaultPollInterval the defaultPollInterval value. - * @return the ComputeManagementClientBuilder. - */ - public ComputeManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = defaultPollInterval; - return this; - } - - /* - * The HTTP pipeline to send requests through - */ - private HttpPipeline pipeline; - - /** - * Sets The HTTP pipeline to send requests through. - * - * @param pipeline the pipeline value. - * @return the ComputeManagementClientBuilder. - */ - public ComputeManagementClientBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; - return this; - } - - /* - * The serializer to serialize an object into a string - */ - private SerializerAdapter serializerAdapter; - - /** - * Sets The serializer to serialize an object into a string. - * - * @param serializerAdapter the serializerAdapter value. - * @return the ComputeManagementClientBuilder. - */ - public ComputeManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { - this.serializerAdapter = serializerAdapter; - return this; - } - - /** - * Builds an instance of ComputeManagementClientImpl with the provided parameters. - * - * @return an instance of ComputeManagementClientImpl. - */ - public ComputeManagementClientImpl buildClient() { - if (endpoint == null) { - this.endpoint = "https://management.azure.com"; - } - if (environment == null) { - this.environment = AzureEnvironment.AZURE; - } - if (defaultPollInterval == null) { - this.defaultPollInterval = Duration.ofSeconds(30); - } - if (pipeline == null) { - this.pipeline = - new HttpPipelineBuilder() - .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) - .build(); - } - if (serializerAdapter == null) { - this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); - } - ComputeManagementClientImpl client = - new ComputeManagementClientImpl( - pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); - return client; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/ComputeManagementClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/ComputeManagementClientImpl.java deleted file mode 100644 index 5e63226c2ab3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/ComputeManagementClientImpl.java +++ /dev/null @@ -1,530 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.implementation; - -import com.azure.core.annotation.ServiceClient; -import com.azure.core.http.HttpPipeline; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.serializer.SerializerAdapter; -import com.azure.resourcemanager.compute.fluent.AvailabilitySetsClient; -import com.azure.resourcemanager.compute.fluent.ComputeManagementClient; -import com.azure.resourcemanager.compute.fluent.DedicatedHostGroupsClient; -import com.azure.resourcemanager.compute.fluent.DedicatedHostsClient; -import com.azure.resourcemanager.compute.fluent.DiskEncryptionSetsClient; -import com.azure.resourcemanager.compute.fluent.DisksClient; -import com.azure.resourcemanager.compute.fluent.GalleriesClient; -import com.azure.resourcemanager.compute.fluent.GalleryApplicationVersionsClient; -import com.azure.resourcemanager.compute.fluent.GalleryApplicationsClient; -import com.azure.resourcemanager.compute.fluent.GalleryImageVersionsClient; -import com.azure.resourcemanager.compute.fluent.GalleryImagesClient; -import com.azure.resourcemanager.compute.fluent.ImagesClient; -import com.azure.resourcemanager.compute.fluent.LogAnalyticsClient; -import com.azure.resourcemanager.compute.fluent.OperationsClient; -import com.azure.resourcemanager.compute.fluent.ProximityPlacementGroupsClient; -import com.azure.resourcemanager.compute.fluent.ResourceSkusClient; -import com.azure.resourcemanager.compute.fluent.SnapshotsClient; -import com.azure.resourcemanager.compute.fluent.SshPublicKeysClient; -import com.azure.resourcemanager.compute.fluent.UsagesClient; -import com.azure.resourcemanager.compute.fluent.VirtualMachineExtensionImagesClient; -import com.azure.resourcemanager.compute.fluent.VirtualMachineExtensionsClient; -import com.azure.resourcemanager.compute.fluent.VirtualMachineImagesClient; -import com.azure.resourcemanager.compute.fluent.VirtualMachineRunCommandsClient; -import com.azure.resourcemanager.compute.fluent.VirtualMachineScaleSetExtensionsClient; -import com.azure.resourcemanager.compute.fluent.VirtualMachineScaleSetRollingUpgradesClient; -import com.azure.resourcemanager.compute.fluent.VirtualMachineScaleSetVMExtensionsClient; -import com.azure.resourcemanager.compute.fluent.VirtualMachineScaleSetVMRunCommandsClient; -import com.azure.resourcemanager.compute.fluent.VirtualMachineScaleSetVMsClient; -import com.azure.resourcemanager.compute.fluent.VirtualMachineScaleSetsClient; -import com.azure.resourcemanager.compute.fluent.VirtualMachineSizesClient; -import com.azure.resourcemanager.compute.fluent.VirtualMachinesClient; -import com.azure.resourcemanager.resources.fluentcore.AzureServiceClient; -import java.time.Duration; - -/** Initializes a new instance of the ComputeManagementClientImpl type. */ -@ServiceClient(builder = ComputeManagementClientBuilder.class) -public final class ComputeManagementClientImpl extends AzureServiceClient implements ComputeManagementClient { - private final ClientLogger logger = new ClientLogger(ComputeManagementClientImpl.class); - - /** - * Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of - * the URI for every service call. - */ - private final String subscriptionId; - - /** - * Gets Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms - * part of the URI for every service call. - * - * @return the subscriptionId value. - */ - public String getSubscriptionId() { - return this.subscriptionId; - } - - /** server parameter. */ - private final String endpoint; - - /** - * Gets server parameter. - * - * @return the endpoint value. - */ - public String getEndpoint() { - return this.endpoint; - } - - /** The HTTP pipeline to send requests through. */ - private final HttpPipeline httpPipeline; - - /** - * Gets The HTTP pipeline to send requests through. - * - * @return the httpPipeline value. - */ - public HttpPipeline getHttpPipeline() { - return this.httpPipeline; - } - - /** The serializer to serialize an object into a string. */ - private final SerializerAdapter serializerAdapter; - - /** - * Gets The serializer to serialize an object into a string. - * - * @return the serializerAdapter value. - */ - SerializerAdapter getSerializerAdapter() { - return this.serializerAdapter; - } - - /** The default poll interval for long-running operation. */ - private final Duration defaultPollInterval; - - /** - * Gets The default poll interval for long-running operation. - * - * @return the defaultPollInterval value. - */ - public Duration getDefaultPollInterval() { - return this.defaultPollInterval; - } - - /** The OperationsClient object to access its operations. */ - private final OperationsClient operations; - - /** - * Gets the OperationsClient object to access its operations. - * - * @return the OperationsClient object. - */ - public OperationsClient getOperations() { - return this.operations; - } - - /** The AvailabilitySetsClient object to access its operations. */ - private final AvailabilitySetsClient availabilitySets; - - /** - * Gets the AvailabilitySetsClient object to access its operations. - * - * @return the AvailabilitySetsClient object. - */ - public AvailabilitySetsClient getAvailabilitySets() { - return this.availabilitySets; - } - - /** The ProximityPlacementGroupsClient object to access its operations. */ - private final ProximityPlacementGroupsClient proximityPlacementGroups; - - /** - * Gets the ProximityPlacementGroupsClient object to access its operations. - * - * @return the ProximityPlacementGroupsClient object. - */ - public ProximityPlacementGroupsClient getProximityPlacementGroups() { - return this.proximityPlacementGroups; - } - - /** The DedicatedHostGroupsClient object to access its operations. */ - private final DedicatedHostGroupsClient dedicatedHostGroups; - - /** - * Gets the DedicatedHostGroupsClient object to access its operations. - * - * @return the DedicatedHostGroupsClient object. - */ - public DedicatedHostGroupsClient getDedicatedHostGroups() { - return this.dedicatedHostGroups; - } - - /** The DedicatedHostsClient object to access its operations. */ - private final DedicatedHostsClient dedicatedHosts; - - /** - * Gets the DedicatedHostsClient object to access its operations. - * - * @return the DedicatedHostsClient object. - */ - public DedicatedHostsClient getDedicatedHosts() { - return this.dedicatedHosts; - } - - /** The SshPublicKeysClient object to access its operations. */ - private final SshPublicKeysClient sshPublicKeys; - - /** - * Gets the SshPublicKeysClient object to access its operations. - * - * @return the SshPublicKeysClient object. - */ - public SshPublicKeysClient getSshPublicKeys() { - return this.sshPublicKeys; - } - - /** The VirtualMachineExtensionImagesClient object to access its operations. */ - private final VirtualMachineExtensionImagesClient virtualMachineExtensionImages; - - /** - * Gets the VirtualMachineExtensionImagesClient object to access its operations. - * - * @return the VirtualMachineExtensionImagesClient object. - */ - public VirtualMachineExtensionImagesClient getVirtualMachineExtensionImages() { - return this.virtualMachineExtensionImages; - } - - /** The VirtualMachineExtensionsClient object to access its operations. */ - private final VirtualMachineExtensionsClient virtualMachineExtensions; - - /** - * Gets the VirtualMachineExtensionsClient object to access its operations. - * - * @return the VirtualMachineExtensionsClient object. - */ - public VirtualMachineExtensionsClient getVirtualMachineExtensions() { - return this.virtualMachineExtensions; - } - - /** The VirtualMachineImagesClient object to access its operations. */ - private final VirtualMachineImagesClient virtualMachineImages; - - /** - * Gets the VirtualMachineImagesClient object to access its operations. - * - * @return the VirtualMachineImagesClient object. - */ - public VirtualMachineImagesClient getVirtualMachineImages() { - return this.virtualMachineImages; - } - - /** The UsagesClient object to access its operations. */ - private final UsagesClient usages; - - /** - * Gets the UsagesClient object to access its operations. - * - * @return the UsagesClient object. - */ - public UsagesClient getUsages() { - return this.usages; - } - - /** The VirtualMachinesClient object to access its operations. */ - private final VirtualMachinesClient virtualMachines; - - /** - * Gets the VirtualMachinesClient object to access its operations. - * - * @return the VirtualMachinesClient object. - */ - public VirtualMachinesClient getVirtualMachines() { - return this.virtualMachines; - } - - /** The VirtualMachineSizesClient object to access its operations. */ - private final VirtualMachineSizesClient virtualMachineSizes; - - /** - * Gets the VirtualMachineSizesClient object to access its operations. - * - * @return the VirtualMachineSizesClient object. - */ - public VirtualMachineSizesClient getVirtualMachineSizes() { - return this.virtualMachineSizes; - } - - /** The ImagesClient object to access its operations. */ - private final ImagesClient images; - - /** - * Gets the ImagesClient object to access its operations. - * - * @return the ImagesClient object. - */ - public ImagesClient getImages() { - return this.images; - } - - /** The VirtualMachineScaleSetsClient object to access its operations. */ - private final VirtualMachineScaleSetsClient virtualMachineScaleSets; - - /** - * Gets the VirtualMachineScaleSetsClient object to access its operations. - * - * @return the VirtualMachineScaleSetsClient object. - */ - public VirtualMachineScaleSetsClient getVirtualMachineScaleSets() { - return this.virtualMachineScaleSets; - } - - /** The VirtualMachineScaleSetExtensionsClient object to access its operations. */ - private final VirtualMachineScaleSetExtensionsClient virtualMachineScaleSetExtensions; - - /** - * Gets the VirtualMachineScaleSetExtensionsClient object to access its operations. - * - * @return the VirtualMachineScaleSetExtensionsClient object. - */ - public VirtualMachineScaleSetExtensionsClient getVirtualMachineScaleSetExtensions() { - return this.virtualMachineScaleSetExtensions; - } - - /** The VirtualMachineScaleSetRollingUpgradesClient object to access its operations. */ - private final VirtualMachineScaleSetRollingUpgradesClient virtualMachineScaleSetRollingUpgrades; - - /** - * Gets the VirtualMachineScaleSetRollingUpgradesClient object to access its operations. - * - * @return the VirtualMachineScaleSetRollingUpgradesClient object. - */ - public VirtualMachineScaleSetRollingUpgradesClient getVirtualMachineScaleSetRollingUpgrades() { - return this.virtualMachineScaleSetRollingUpgrades; - } - - /** The VirtualMachineScaleSetVMExtensionsClient object to access its operations. */ - private final VirtualMachineScaleSetVMExtensionsClient virtualMachineScaleSetVMExtensions; - - /** - * Gets the VirtualMachineScaleSetVMExtensionsClient object to access its operations. - * - * @return the VirtualMachineScaleSetVMExtensionsClient object. - */ - public VirtualMachineScaleSetVMExtensionsClient getVirtualMachineScaleSetVMExtensions() { - return this.virtualMachineScaleSetVMExtensions; - } - - /** The VirtualMachineScaleSetVMsClient object to access its operations. */ - private final VirtualMachineScaleSetVMsClient virtualMachineScaleSetVMs; - - /** - * Gets the VirtualMachineScaleSetVMsClient object to access its operations. - * - * @return the VirtualMachineScaleSetVMsClient object. - */ - public VirtualMachineScaleSetVMsClient getVirtualMachineScaleSetVMs() { - return this.virtualMachineScaleSetVMs; - } - - /** The LogAnalyticsClient object to access its operations. */ - private final LogAnalyticsClient logAnalytics; - - /** - * Gets the LogAnalyticsClient object to access its operations. - * - * @return the LogAnalyticsClient object. - */ - public LogAnalyticsClient getLogAnalytics() { - return this.logAnalytics; - } - - /** The VirtualMachineRunCommandsClient object to access its operations. */ - private final VirtualMachineRunCommandsClient virtualMachineRunCommands; - - /** - * Gets the VirtualMachineRunCommandsClient object to access its operations. - * - * @return the VirtualMachineRunCommandsClient object. - */ - public VirtualMachineRunCommandsClient getVirtualMachineRunCommands() { - return this.virtualMachineRunCommands; - } - - /** The VirtualMachineScaleSetVMRunCommandsClient object to access its operations. */ - private final VirtualMachineScaleSetVMRunCommandsClient virtualMachineScaleSetVMRunCommands; - - /** - * Gets the VirtualMachineScaleSetVMRunCommandsClient object to access its operations. - * - * @return the VirtualMachineScaleSetVMRunCommandsClient object. - */ - public VirtualMachineScaleSetVMRunCommandsClient getVirtualMachineScaleSetVMRunCommands() { - return this.virtualMachineScaleSetVMRunCommands; - } - - /** The ResourceSkusClient object to access its operations. */ - private final ResourceSkusClient resourceSkus; - - /** - * Gets the ResourceSkusClient object to access its operations. - * - * @return the ResourceSkusClient object. - */ - public ResourceSkusClient getResourceSkus() { - return this.resourceSkus; - } - - /** The DisksClient object to access its operations. */ - private final DisksClient disks; - - /** - * Gets the DisksClient object to access its operations. - * - * @return the DisksClient object. - */ - public DisksClient getDisks() { - return this.disks; - } - - /** The SnapshotsClient object to access its operations. */ - private final SnapshotsClient snapshots; - - /** - * Gets the SnapshotsClient object to access its operations. - * - * @return the SnapshotsClient object. - */ - public SnapshotsClient getSnapshots() { - return this.snapshots; - } - - /** The DiskEncryptionSetsClient object to access its operations. */ - private final DiskEncryptionSetsClient diskEncryptionSets; - - /** - * Gets the DiskEncryptionSetsClient object to access its operations. - * - * @return the DiskEncryptionSetsClient object. - */ - public DiskEncryptionSetsClient getDiskEncryptionSets() { - return this.diskEncryptionSets; - } - - /** The GalleriesClient object to access its operations. */ - private final GalleriesClient galleries; - - /** - * Gets the GalleriesClient object to access its operations. - * - * @return the GalleriesClient object. - */ - public GalleriesClient getGalleries() { - return this.galleries; - } - - /** The GalleryImagesClient object to access its operations. */ - private final GalleryImagesClient galleryImages; - - /** - * Gets the GalleryImagesClient object to access its operations. - * - * @return the GalleryImagesClient object. - */ - public GalleryImagesClient getGalleryImages() { - return this.galleryImages; - } - - /** The GalleryImageVersionsClient object to access its operations. */ - private final GalleryImageVersionsClient galleryImageVersions; - - /** - * Gets the GalleryImageVersionsClient object to access its operations. - * - * @return the GalleryImageVersionsClient object. - */ - public GalleryImageVersionsClient getGalleryImageVersions() { - return this.galleryImageVersions; - } - - /** The GalleryApplicationsClient object to access its operations. */ - private final GalleryApplicationsClient galleryApplications; - - /** - * Gets the GalleryApplicationsClient object to access its operations. - * - * @return the GalleryApplicationsClient object. - */ - public GalleryApplicationsClient getGalleryApplications() { - return this.galleryApplications; - } - - /** The GalleryApplicationVersionsClient object to access its operations. */ - private final GalleryApplicationVersionsClient galleryApplicationVersions; - - /** - * Gets the GalleryApplicationVersionsClient object to access its operations. - * - * @return the GalleryApplicationVersionsClient object. - */ - public GalleryApplicationVersionsClient getGalleryApplicationVersions() { - return this.galleryApplicationVersions; - } - - /** - * Initializes an instance of ComputeManagementClient client. - * - * @param httpPipeline The HTTP pipeline to send requests through. - * @param serializerAdapter The serializer to serialize an object into a string. - * @param defaultPollInterval The default poll interval for long-running operation. - * @param environment The Azure environment. - * @param subscriptionId Subscription credentials which uniquely identify Microsoft Azure subscription. The - * subscription ID forms part of the URI for every service call. - * @param endpoint server parameter. - */ - ComputeManagementClientImpl( - HttpPipeline httpPipeline, - SerializerAdapter serializerAdapter, - Duration defaultPollInterval, - AzureEnvironment environment, - String subscriptionId, - String endpoint) { - super(httpPipeline, serializerAdapter, environment); - this.httpPipeline = httpPipeline; - this.serializerAdapter = serializerAdapter; - this.defaultPollInterval = defaultPollInterval; - this.subscriptionId = subscriptionId; - this.endpoint = endpoint; - this.operations = new OperationsClientImpl(this); - this.availabilitySets = new AvailabilitySetsClientImpl(this); - this.proximityPlacementGroups = new ProximityPlacementGroupsClientImpl(this); - this.dedicatedHostGroups = new DedicatedHostGroupsClientImpl(this); - this.dedicatedHosts = new DedicatedHostsClientImpl(this); - this.sshPublicKeys = new SshPublicKeysClientImpl(this); - this.virtualMachineExtensionImages = new VirtualMachineExtensionImagesClientImpl(this); - this.virtualMachineExtensions = new VirtualMachineExtensionsClientImpl(this); - this.virtualMachineImages = new VirtualMachineImagesClientImpl(this); - this.usages = new UsagesClientImpl(this); - this.virtualMachines = new VirtualMachinesClientImpl(this); - this.virtualMachineSizes = new VirtualMachineSizesClientImpl(this); - this.images = new ImagesClientImpl(this); - this.virtualMachineScaleSets = new VirtualMachineScaleSetsClientImpl(this); - this.virtualMachineScaleSetExtensions = new VirtualMachineScaleSetExtensionsClientImpl(this); - this.virtualMachineScaleSetRollingUpgrades = new VirtualMachineScaleSetRollingUpgradesClientImpl(this); - this.virtualMachineScaleSetVMExtensions = new VirtualMachineScaleSetVMExtensionsClientImpl(this); - this.virtualMachineScaleSetVMs = new VirtualMachineScaleSetVMsClientImpl(this); - this.logAnalytics = new LogAnalyticsClientImpl(this); - this.virtualMachineRunCommands = new VirtualMachineRunCommandsClientImpl(this); - this.virtualMachineScaleSetVMRunCommands = new VirtualMachineScaleSetVMRunCommandsClientImpl(this); - this.resourceSkus = new ResourceSkusClientImpl(this); - this.disks = new DisksClientImpl(this); - this.snapshots = new SnapshotsClientImpl(this); - this.diskEncryptionSets = new DiskEncryptionSetsClientImpl(this); - this.galleries = new GalleriesClientImpl(this); - this.galleryImages = new GalleryImagesClientImpl(this); - this.galleryImageVersions = new GalleryImageVersionsClientImpl(this); - this.galleryApplications = new GalleryApplicationsClientImpl(this); - this.galleryApplicationVersions = new GalleryApplicationVersionsClientImpl(this); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/ComputeSkuImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/ComputeSkuImpl.java deleted file mode 100644 index d8b03dbe8e38..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/ComputeSkuImpl.java +++ /dev/null @@ -1,178 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.implementation; - -import com.azure.resourcemanager.compute.models.AvailabilitySetSkuTypes; -import com.azure.resourcemanager.compute.models.ComputeResourceType; -import com.azure.resourcemanager.compute.models.ComputeSku; -import com.azure.resourcemanager.compute.models.ComputeSkuName; -import com.azure.resourcemanager.compute.models.ComputeSkuTier; -import com.azure.resourcemanager.compute.models.DiskSkuTypes; -import com.azure.resourcemanager.compute.models.DiskStorageAccountTypes; -import com.azure.resourcemanager.compute.models.ResourceSkuCapabilities; -import com.azure.resourcemanager.compute.models.ResourceSkuCapacity; -import com.azure.resourcemanager.compute.models.ResourceSkuCosts; -import com.azure.resourcemanager.compute.models.ResourceSkuLocationInfo; -import com.azure.resourcemanager.compute.models.ResourceSkuRestrictions; -import com.azure.resourcemanager.compute.models.VirtualMachineSizeTypes; -import com.azure.resourcemanager.compute.fluent.models.ResourceSkuInner; -import com.azure.resourcemanager.resources.fluentcore.arm.AvailabilityZoneId; -import com.azure.core.management.Region; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -/** The implementation for {@link ComputeSku}. */ -final class ComputeSkuImpl implements ComputeSku { - private final ResourceSkuInner inner; - - ComputeSkuImpl(ResourceSkuInner inner) { - this.inner = inner; - } - - @Override - public ComputeSkuName name() { - if (this.inner.name() != null) { - return ComputeSkuName.fromString(this.inner.name()); - } else { - return null; - } - } - - @Override - public ComputeSkuTier tier() { - if (this.inner.tier() != null) { - return ComputeSkuTier.fromString(this.inner.tier()); - } else { - return null; - } - } - - @Override - public ComputeResourceType resourceType() { - if (this.inner.resourceType() != null) { - return ComputeResourceType.fromString(this.inner.resourceType()); - } else { - return null; - } - } - - @Override - public VirtualMachineSizeTypes virtualMachineSizeType() { - if (this.inner.resourceType() != null - && this.inner.resourceType().equalsIgnoreCase("virtualMachines") - && this.inner.name() != null) { - return VirtualMachineSizeTypes.fromString(this.inner.name()); - } else { - return null; - } - } - - @Override - public DiskSkuTypes diskSkuType() { - if (this.inner.resourceType() != null - && (this.inner.resourceType().equalsIgnoreCase("disks") - || this.inner.resourceType().equalsIgnoreCase("snapshots")) - && this.inner.name() != null) { - return DiskSkuTypes.fromStorageAccountType(DiskStorageAccountTypes.fromString(this.inner.name())); - } else { - return null; - } - } - - @Override - public AvailabilitySetSkuTypes availabilitySetSkuType() { - if (this.inner.resourceType() != null - && (this.inner.resourceType().equalsIgnoreCase("availabilitySets")) - && this.inner.name() != null) { - return AvailabilitySetSkuTypes.fromString(this.inner.name()); - } else { - return null; - } - } - - @Override - public List regions() { - List regions = new ArrayList<>(); - if (this.inner.locations() != null) { - for (String location : this.inner.locations()) { - regions.add(Region.fromName(location)); - } - } - return regions; - } - - @Override - public Map> zones() { - Map> regionToZones = new HashMap<>(); - if (this.inner.locationInfo() != null) { - for (ResourceSkuLocationInfo info : this.inner.locationInfo()) { - if (info.location() != null) { - Region region = Region.fromName(info.location()); - if (!regionToZones.containsKey(region)) { - regionToZones.put(region, new HashSet<>()); - } - Set availabilityZoneIds = new HashSet<>(); - if (info.zones() != null) { - for (String zone : info.zones()) { - availabilityZoneIds.add(AvailabilityZoneId.fromString(zone)); - } - } - regionToZones.get(region).addAll(availabilityZoneIds); - } - } - } - return regionToZones; - } - - @Override - public ResourceSkuCapacity capacity() { - return this.inner.capacity(); - } - - @Override - public List apiVersions() { - if (this.inner.apiVersions() != null) { - return Collections.unmodifiableList(this.inner.apiVersions()); - } else { - return Collections.unmodifiableList(new ArrayList<>()); - } - } - - @Override - public List costs() { - if (this.inner.costs() != null) { - return Collections.unmodifiableList(this.inner.costs()); - } else { - return Collections.unmodifiableList(new ArrayList<>()); - } - } - - @Override - public List capabilities() { - if (this.inner.capabilities() != null) { - return Collections.unmodifiableList(this.inner.capabilities()); - } else { - return Collections.unmodifiableList(new ArrayList<>()); - } - } - - @Override - public List restrictions() { - if (this.inner.capabilities() != null) { - return Collections.unmodifiableList(this.inner.restrictions()); - } else { - return Collections.unmodifiableList(new ArrayList<>()); - } - } - - @Override - public ResourceSkuInner innerModel() { - return this.inner; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/ComputeSkusImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/ComputeSkusImpl.java deleted file mode 100644 index 124acc37e995..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/ComputeSkusImpl.java +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.compute.ComputeManager; -import com.azure.resourcemanager.compute.models.ComputeResourceType; -import com.azure.resourcemanager.compute.models.ComputeSku; -import com.azure.resourcemanager.compute.models.ComputeSkus; -import com.azure.resourcemanager.compute.fluent.models.ResourceSkuInner; -import com.azure.resourcemanager.compute.fluent.ResourceSkusClient; -import com.azure.core.management.Region; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.ReadableWrappersImpl; -import com.azure.resourcemanager.resources.fluentcore.utils.PagedConverter; -import reactor.core.publisher.Mono; - -/** The implementation for {@link ComputeSkus}. */ -public final class ComputeSkusImpl extends ReadableWrappersImpl - implements ComputeSkus { - private final ComputeManager manager; - - public ComputeSkusImpl(ComputeManager computeManager) { - this.manager = computeManager; - } - - @Override - protected ComputeSkuImpl wrapModel(ResourceSkuInner inner) { - return new ComputeSkuImpl(inner); - } - - @Override - public PagedIterable list() { - return wrapList(this.inner().list()); - } - - @Override - public PagedFlux listAsync() { - return wrapPageAsync(this.inner().listAsync()); - } - - @Override - public PagedIterable listByRegion(String regionName) { - return this.listByRegion(Region.fromName(regionName)); - } - - @Override - public PagedIterable listByRegion(Region region) { - return new PagedIterable<>(listByRegionAsync(region)); - } - - @Override - public PagedFlux listByRegionAsync(String regionName) { - return this.listByRegionAsync(Region.fromName(regionName)); - } - - @Override - public PagedFlux listByRegionAsync(final Region region) { - return PagedConverter.mapPage( - inner().listAsync(String.format("location eq '%s'", region.name())), - this::wrapModel); - } - - public ResourceSkusClient inner() { - return this.manager.serviceClient().getResourceSkus(); - } - - @Override - public ComputeManager manager() { - return this.manager; - } - - @Override - public PagedIterable listByResourceType(ComputeResourceType resourceType) { - return new PagedIterable<>(listByResourceTypeAsync(resourceType)); - } - - @Override - public PagedFlux listByResourceTypeAsync(final ComputeResourceType resourceType) { - return PagedConverter - .flatMapPage( - wrapPageAsync(inner().listAsync()), - computeSku -> { - if (computeSku.resourceType() != null && computeSku.resourceType().equals(resourceType)) { - return Mono.just(computeSku); - } else { - return Mono.empty(); - } - }); - } - - @Override - public PagedIterable listByRegionAndResourceType(Region region, ComputeResourceType resourceType) { - return new PagedIterable<>(listByRegionAndResourceTypeAsync(region, resourceType)); - } - - @Override - public PagedFlux listByRegionAndResourceTypeAsync( - final Region region, final ComputeResourceType resourceType) { - return PagedConverter - .flatMapPage( - wrapPageAsync(inner().listAsync(String.format("location eq '%s'", region.name()))), - computeSku -> { - if (computeSku.resourceType() != null && computeSku.resourceType().equals(resourceType)) { - return Mono.just(computeSku); - } else { - return Mono.empty(); - } - }); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/ComputeUsageImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/ComputeUsageImpl.java deleted file mode 100644 index c7be748c61a4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/ComputeUsageImpl.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.compute.implementation; - -import com.azure.resourcemanager.compute.models.ComputeUsage; -import com.azure.resourcemanager.compute.models.ComputeUsageUnit; -import com.azure.resourcemanager.compute.models.UsageName; -import com.azure.resourcemanager.compute.fluent.models.UsageInner; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.WrapperImpl; - -/** The implementation of ComputeUsage. */ -class ComputeUsageImpl extends WrapperImpl implements ComputeUsage { - ComputeUsageImpl(UsageInner innerObject) { - super(innerObject); - } - - @Override - public ComputeUsageUnit unit() { - return ComputeUsageUnit.fromString(innerModel().unit()); - } - - @Override - public int currentValue() { - return innerModel().currentValue(); - } - - @Override - public long limit() { - return innerModel().limit(); - } - - @Override - public UsageName name() { - return innerModel().name(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/ComputeUsagesImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/ComputeUsagesImpl.java deleted file mode 100644 index 6789522f3921..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/ComputeUsagesImpl.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.compute.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.compute.models.ComputeUsage; -import com.azure.resourcemanager.compute.models.ComputeUsages; -import com.azure.resourcemanager.compute.fluent.ComputeManagementClient; -import com.azure.resourcemanager.compute.fluent.models.UsageInner; -import com.azure.core.management.Region; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.ReadableWrappersImpl; - -/** The implementation of {@link ComputeUsages}. */ -public class ComputeUsagesImpl extends ReadableWrappersImpl - implements ComputeUsages { - private final ComputeManagementClient client; - - public ComputeUsagesImpl(ComputeManagementClient client) { - this.client = client; - } - - @Override - public PagedIterable listByRegion(Region region) { - return listByRegion(region.name()); - } - - @Override - public PagedIterable listByRegion(String regionName) { - return wrapList(client.getUsages().list(regionName)); - } - - @Override - public PagedFlux listByRegionAsync(Region region) { - return listByRegionAsync(region.name()); - } - - @Override - public PagedFlux listByRegionAsync(String regionName) { - return wrapPageAsync(client.getUsages().listAsync(regionName)); - } - - @Override - protected ComputeUsageImpl wrapModel(UsageInner usageInner) { - if (usageInner == null) { - return null; - } - return new ComputeUsageImpl(usageInner); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/CustomImageDataDiskImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/CustomImageDataDiskImpl.java deleted file mode 100644 index e7eee3bdcdd6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/CustomImageDataDiskImpl.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.implementation; - -import com.azure.core.management.SubResource; -import com.azure.resourcemanager.compute.models.CachingTypes; -import com.azure.resourcemanager.compute.models.Disk; -import com.azure.resourcemanager.compute.models.ImageDataDisk; -import com.azure.resourcemanager.compute.models.VirtualMachineCustomImage; -import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.ChildResourceImpl; - -/** The implementation for {@link VirtualMachineCustomImage.CustomImageDataDisk}. */ -class CustomImageDataDiskImpl - extends ChildResourceImpl - implements VirtualMachineCustomImage.CustomImageDataDisk, - VirtualMachineCustomImage.CustomImageDataDisk.Definition< - VirtualMachineCustomImage.DefinitionStages.WithCreateAndDataDiskImageOSDiskSettings> { - - CustomImageDataDiskImpl(ImageDataDisk inner, VirtualMachineCustomImageImpl parent) { - super(inner, parent); - } - - @Override - public CustomImageDataDiskImpl withDiskSizeInGB(int diskSizeGB) { - this.innerModel().withDiskSizeGB(diskSizeGB); - return this; - } - - @Override - public CustomImageDataDiskImpl withDiskCaching(CachingTypes cachingType) { - this.innerModel().withCaching(cachingType); - return this; - } - - @Override - public CustomImageDataDiskImpl withLun(int lun) { - this.innerModel().withLun(lun); - return this; - } - - @Override - public CustomImageDataDiskImpl fromVhd(String sourceVhdUrl) { - this.innerModel().withBlobUri(sourceVhdUrl); - return this; - } - - @Override - public CustomImageDataDiskImpl fromSnapshot(String sourceSnapshotId) { - this.innerModel().withSnapshot(new SubResource().withId(sourceSnapshotId)); - return this; - } - - @Override - public CustomImageDataDiskImpl fromManagedDisk(String sourceManagedDiskId) { - this.innerModel().withManagedDisk(new SubResource().withId(sourceManagedDiskId)); - return this; - } - - @Override - public CustomImageDataDiskImpl fromManagedDisk(Disk sourceManagedDisk) { - this.innerModel().withManagedDisk(new SubResource().withId(sourceManagedDisk.id())); - return this; - } - - @Override - public String name() { - return Integer.toString(this.innerModel().lun()); - } - - @Override - public VirtualMachineCustomImageImpl attach() { - return this.parent().withCustomImageDataDisk(this); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/DedicatedHostGroupsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/DedicatedHostGroupsClientImpl.java deleted file mode 100644 index c49443b8ac24..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/DedicatedHostGroupsClientImpl.java +++ /dev/null @@ -1,1305 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.fluent.DedicatedHostGroupsClient; -import com.azure.resourcemanager.compute.fluent.models.DedicatedHostGroupInner; -import com.azure.resourcemanager.compute.models.DedicatedHostGroupListResult; -import com.azure.resourcemanager.compute.models.DedicatedHostGroupUpdate; -import com.azure.resourcemanager.compute.models.InstanceViewTypes; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in DedicatedHostGroupsClient. */ -public final class DedicatedHostGroupsClientImpl - implements InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete, - DedicatedHostGroupsClient { - private final ClientLogger logger = new ClientLogger(DedicatedHostGroupsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final DedicatedHostGroupsService service; - - /** The service client containing this operation class. */ - private final ComputeManagementClientImpl client; - - /** - * Initializes an instance of DedicatedHostGroupsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - DedicatedHostGroupsClientImpl(ComputeManagementClientImpl client) { - this.service = - RestProxy.create(DedicatedHostGroupsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for ComputeManagementClientDedicatedHostGroups to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "ComputeManagementCli") - private interface DedicatedHostGroupsService { - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups" - + "/{hostGroupName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("hostGroupName") String hostGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") DedicatedHostGroupInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups" - + "/{hostGroupName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("hostGroupName") String hostGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") DedicatedHostGroupUpdate parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups" - + "/{hostGroupName}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("hostGroupName") String hostGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups" - + "/{hostGroupName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("hostGroupName") String hostGroupName, - @QueryParam("$expand") InstanceViewTypes expand, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/hostGroups") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Create or update a dedicated host group. For details of Dedicated Host and Dedicated Host Groups please see - * [Dedicated Host Documentation] (https://go.microsoft.com/fwlink/?linkid=2082596). - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param parameters Parameters supplied to the Create Dedicated Host Group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the dedicated host group that the dedicated hosts should be assigned to. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String hostGroupName, DedicatedHostGroupInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (hostGroupName == null) { - return Mono.error(new IllegalArgumentException("Parameter hostGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - hostGroupName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create or update a dedicated host group. For details of Dedicated Host and Dedicated Host Groups please see - * [Dedicated Host Documentation] (https://go.microsoft.com/fwlink/?linkid=2082596). - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param parameters Parameters supplied to the Create Dedicated Host Group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the dedicated host group that the dedicated hosts should be assigned to. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String hostGroupName, DedicatedHostGroupInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (hostGroupName == null) { - return Mono.error(new IllegalArgumentException("Parameter hostGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - hostGroupName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Create or update a dedicated host group. For details of Dedicated Host and Dedicated Host Groups please see - * [Dedicated Host Documentation] (https://go.microsoft.com/fwlink/?linkid=2082596). - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param parameters Parameters supplied to the Create Dedicated Host Group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the dedicated host group that the dedicated hosts should be assigned to. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, String hostGroupName, DedicatedHostGroupInner parameters) { - return createOrUpdateWithResponseAsync(resourceGroupName, hostGroupName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Create or update a dedicated host group. For details of Dedicated Host and Dedicated Host Groups please see - * [Dedicated Host Documentation] (https://go.microsoft.com/fwlink/?linkid=2082596). - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param parameters Parameters supplied to the Create Dedicated Host Group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the dedicated host group that the dedicated hosts should be assigned to. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DedicatedHostGroupInner createOrUpdate( - String resourceGroupName, String hostGroupName, DedicatedHostGroupInner parameters) { - return createOrUpdateAsync(resourceGroupName, hostGroupName, parameters).block(); - } - - /** - * Create or update a dedicated host group. For details of Dedicated Host and Dedicated Host Groups please see - * [Dedicated Host Documentation] (https://go.microsoft.com/fwlink/?linkid=2082596). - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param parameters Parameters supplied to the Create Dedicated Host Group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the dedicated host group that the dedicated hosts should be assigned to. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceGroupName, String hostGroupName, DedicatedHostGroupInner parameters, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, hostGroupName, parameters, context).block(); - } - - /** - * Update an dedicated host group. - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param parameters Parameters supplied to the Update Dedicated Host Group operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the dedicated host group that the dedicated hosts should be assigned to. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateWithResponseAsync( - String resourceGroupName, String hostGroupName, DedicatedHostGroupUpdate parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (hostGroupName == null) { - return Mono.error(new IllegalArgumentException("Parameter hostGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - resourceGroupName, - hostGroupName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Update an dedicated host group. - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param parameters Parameters supplied to the Update Dedicated Host Group operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the dedicated host group that the dedicated hosts should be assigned to. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, String hostGroupName, DedicatedHostGroupUpdate parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (hostGroupName == null) { - return Mono.error(new IllegalArgumentException("Parameter hostGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - resourceGroupName, - hostGroupName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Update an dedicated host group. - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param parameters Parameters supplied to the Update Dedicated Host Group operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the dedicated host group that the dedicated hosts should be assigned to. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync( - String resourceGroupName, String hostGroupName, DedicatedHostGroupUpdate parameters) { - return updateWithResponseAsync(resourceGroupName, hostGroupName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Update an dedicated host group. - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param parameters Parameters supplied to the Update Dedicated Host Group operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the dedicated host group that the dedicated hosts should be assigned to. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DedicatedHostGroupInner update( - String resourceGroupName, String hostGroupName, DedicatedHostGroupUpdate parameters) { - return updateAsync(resourceGroupName, hostGroupName, parameters).block(); - } - - /** - * Update an dedicated host group. - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param parameters Parameters supplied to the Update Dedicated Host Group operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the dedicated host group that the dedicated hosts should be assigned to. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, String hostGroupName, DedicatedHostGroupUpdate parameters, Context context) { - return updateWithResponseAsync(resourceGroupName, hostGroupName, parameters, context).block(); - } - - /** - * Delete a dedicated host group. - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String resourceGroupName, String hostGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (hostGroupName == null) { - return Mono.error(new IllegalArgumentException("Parameter hostGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - hostGroupName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete a dedicated host group. - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String hostGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (hostGroupName == null) { - return Mono.error(new IllegalArgumentException("Parameter hostGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - hostGroupName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Delete a dedicated host group. - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String hostGroupName) { - return deleteWithResponseAsync(resourceGroupName, hostGroupName).flatMap((Response res) -> Mono.empty()); - } - - /** - * Delete a dedicated host group. - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String hostGroupName) { - deleteAsync(resourceGroupName, hostGroupName).block(); - } - - /** - * Delete a dedicated host group. - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String hostGroupName, Context context) { - return deleteWithResponseAsync(resourceGroupName, hostGroupName, context).block(); - } - - /** - * Retrieves information about a dedicated host group. - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param expand The expand expression to apply on the operation. The response shows the list of instance view of - * the dedicated hosts under the dedicated host group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the dedicated host group that the dedicated hosts should be assigned to. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String hostGroupName, InstanceViewTypes expand) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (hostGroupName == null) { - return Mono.error(new IllegalArgumentException("Parameter hostGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - hostGroupName, - expand, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Retrieves information about a dedicated host group. - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param expand The expand expression to apply on the operation. The response shows the list of instance view of - * the dedicated hosts under the dedicated host group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the dedicated host group that the dedicated hosts should be assigned to. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String hostGroupName, InstanceViewTypes expand, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (hostGroupName == null) { - return Mono.error(new IllegalArgumentException("Parameter hostGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - hostGroupName, - expand, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Retrieves information about a dedicated host group. - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param expand The expand expression to apply on the operation. The response shows the list of instance view of - * the dedicated hosts under the dedicated host group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the dedicated host group that the dedicated hosts should be assigned to. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync( - String resourceGroupName, String hostGroupName, InstanceViewTypes expand) { - return getByResourceGroupWithResponseAsync(resourceGroupName, hostGroupName, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Retrieves information about a dedicated host group. - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the dedicated host group that the dedicated hosts should be assigned to. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync(String resourceGroupName, String hostGroupName) { - final InstanceViewTypes expand = null; - return getByResourceGroupWithResponseAsync(resourceGroupName, hostGroupName, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Retrieves information about a dedicated host group. - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the dedicated host group that the dedicated hosts should be assigned to. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DedicatedHostGroupInner getByResourceGroup(String resourceGroupName, String hostGroupName) { - final InstanceViewTypes expand = null; - return getByResourceGroupAsync(resourceGroupName, hostGroupName, expand).block(); - } - - /** - * Retrieves information about a dedicated host group. - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param expand The expand expression to apply on the operation. The response shows the list of instance view of - * the dedicated hosts under the dedicated host group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the dedicated host group that the dedicated hosts should be assigned to. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String hostGroupName, InstanceViewTypes expand, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, hostGroupName, expand, context).block(); - } - - /** - * Lists all of the dedicated host groups in the specified resource group. Use the nextLink property in the response - * to get the next page of dedicated host groups. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Dedicated Host Group with resource group response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all of the dedicated host groups in the specified resource group. Use the nextLink property in the response - * to get the next page of dedicated host groups. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Dedicated Host Group with resource group response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists all of the dedicated host groups in the specified resource group. Use the nextLink property in the response - * to get the next page of dedicated host groups. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Dedicated Host Group with resource group response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * Lists all of the dedicated host groups in the specified resource group. Use the nextLink property in the response - * to get the next page of dedicated host groups. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Dedicated Host Group with resource group response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all of the dedicated host groups in the specified resource group. Use the nextLink property in the response - * to get the next page of dedicated host groups. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Dedicated Host Group with resource group response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * Lists all of the dedicated host groups in the specified resource group. Use the nextLink property in the response - * to get the next page of dedicated host groups. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Dedicated Host Group with resource group response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * Lists all of the dedicated host groups in the subscription. Use the nextLink property in the response to get the - * next page of dedicated host groups. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Dedicated Host Group with resource group response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all of the dedicated host groups in the subscription. Use the nextLink property in the response to get the - * next page of dedicated host groups. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Dedicated Host Group with resource group response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists all of the dedicated host groups in the subscription. Use the nextLink property in the response to get the - * next page of dedicated host groups. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Dedicated Host Group with resource group response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>( - () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); - } - - /** - * Lists all of the dedicated host groups in the subscription. Use the nextLink property in the response to get the - * next page of dedicated host groups. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Dedicated Host Group with resource group response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all of the dedicated host groups in the subscription. Use the nextLink property in the response to get the - * next page of dedicated host groups. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Dedicated Host Group with resource group response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Lists all of the dedicated host groups in the subscription. Use the nextLink property in the response to get the - * next page of dedicated host groups. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Dedicated Host Group with resource group response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Dedicated Host Group with resource group response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Dedicated Host Group with resource group response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Dedicated Host Group with resource group response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Dedicated Host Group with resource group response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/DedicatedHostsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/DedicatedHostsClientImpl.java deleted file mode 100644 index 72432747abf7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/DedicatedHostsClientImpl.java +++ /dev/null @@ -1,1485 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.compute.fluent.DedicatedHostsClient; -import com.azure.resourcemanager.compute.fluent.models.DedicatedHostInner; -import com.azure.resourcemanager.compute.models.DedicatedHostListResult; -import com.azure.resourcemanager.compute.models.DedicatedHostUpdate; -import com.azure.resourcemanager.compute.models.InstanceViewTypes; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in DedicatedHostsClient. */ -public final class DedicatedHostsClientImpl implements DedicatedHostsClient { - private final ClientLogger logger = new ClientLogger(DedicatedHostsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final DedicatedHostsService service; - - /** The service client containing this operation class. */ - private final ComputeManagementClientImpl client; - - /** - * Initializes an instance of DedicatedHostsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - DedicatedHostsClientImpl(ComputeManagementClientImpl client) { - this.service = - RestProxy.create(DedicatedHostsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for ComputeManagementClientDedicatedHosts to be used by the proxy service - * to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "ComputeManagementCli") - private interface DedicatedHostsService { - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups" - + "/{hostGroupName}/hosts/{hostName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("hostGroupName") String hostGroupName, - @PathParam("hostName") String hostname, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") DedicatedHostInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups" - + "/{hostGroupName}/hosts/{hostName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("hostGroupName") String hostGroupName, - @PathParam("hostName") String hostname, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") DedicatedHostUpdate parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups" - + "/{hostGroupName}/hosts/{hostName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("hostGroupName") String hostGroupName, - @PathParam("hostName") String hostname, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups" - + "/{hostGroupName}/hosts/{hostName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("hostGroupName") String hostGroupName, - @PathParam("hostName") String hostname, - @QueryParam("$expand") InstanceViewTypes expand, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups" - + "/{hostGroupName}/hosts") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByHostGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("hostGroupName") String hostGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByHostGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Create or update a dedicated host . - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host . - * @param parameters Parameters supplied to the Create Dedicated Host. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Dedicated host. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String hostGroupName, String hostname, DedicatedHostInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (hostGroupName == null) { - return Mono.error(new IllegalArgumentException("Parameter hostGroupName is required and cannot be null.")); - } - if (hostname == null) { - return Mono.error(new IllegalArgumentException("Parameter hostname is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - hostGroupName, - hostname, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create or update a dedicated host . - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host . - * @param parameters Parameters supplied to the Create Dedicated Host. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Dedicated host. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String hostGroupName, - String hostname, - DedicatedHostInner parameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (hostGroupName == null) { - return Mono.error(new IllegalArgumentException("Parameter hostGroupName is required and cannot be null.")); - } - if (hostname == null) { - return Mono.error(new IllegalArgumentException("Parameter hostname is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - hostGroupName, - hostname, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Create or update a dedicated host . - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host . - * @param parameters Parameters supplied to the Create Dedicated Host. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Dedicated host. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, DedicatedHostInner> beginCreateOrUpdateAsync( - String resourceGroupName, String hostGroupName, String hostname, DedicatedHostInner parameters) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, hostGroupName, hostname, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - DedicatedHostInner.class, - DedicatedHostInner.class, - this.client.getContext()); - } - - /** - * Create or update a dedicated host . - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host . - * @param parameters Parameters supplied to the Create Dedicated Host. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Dedicated host. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, DedicatedHostInner> beginCreateOrUpdateAsync( - String resourceGroupName, - String hostGroupName, - String hostname, - DedicatedHostInner parameters, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, hostGroupName, hostname, parameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), DedicatedHostInner.class, DedicatedHostInner.class, context); - } - - /** - * Create or update a dedicated host . - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host . - * @param parameters Parameters supplied to the Create Dedicated Host. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Dedicated host. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, DedicatedHostInner> beginCreateOrUpdate( - String resourceGroupName, String hostGroupName, String hostname, DedicatedHostInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, hostGroupName, hostname, parameters).getSyncPoller(); - } - - /** - * Create or update a dedicated host . - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host . - * @param parameters Parameters supplied to the Create Dedicated Host. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Dedicated host. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, DedicatedHostInner> beginCreateOrUpdate( - String resourceGroupName, - String hostGroupName, - String hostname, - DedicatedHostInner parameters, - Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, hostGroupName, hostname, parameters, context) - .getSyncPoller(); - } - - /** - * Create or update a dedicated host . - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host . - * @param parameters Parameters supplied to the Create Dedicated Host. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Dedicated host. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, String hostGroupName, String hostname, DedicatedHostInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, hostGroupName, hostname, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create or update a dedicated host . - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host . - * @param parameters Parameters supplied to the Create Dedicated Host. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Dedicated host. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, - String hostGroupName, - String hostname, - DedicatedHostInner parameters, - Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, hostGroupName, hostname, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create or update a dedicated host . - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host . - * @param parameters Parameters supplied to the Create Dedicated Host. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Dedicated host. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DedicatedHostInner createOrUpdate( - String resourceGroupName, String hostGroupName, String hostname, DedicatedHostInner parameters) { - return createOrUpdateAsync(resourceGroupName, hostGroupName, hostname, parameters).block(); - } - - /** - * Create or update a dedicated host . - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host . - * @param parameters Parameters supplied to the Create Dedicated Host. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Dedicated host. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DedicatedHostInner createOrUpdate( - String resourceGroupName, - String hostGroupName, - String hostname, - DedicatedHostInner parameters, - Context context) { - return createOrUpdateAsync(resourceGroupName, hostGroupName, hostname, parameters, context).block(); - } - - /** - * Update an dedicated host . - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host . - * @param parameters Parameters supplied to the Update Dedicated Host operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Dedicated host. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateWithResponseAsync( - String resourceGroupName, String hostGroupName, String hostname, DedicatedHostUpdate parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (hostGroupName == null) { - return Mono.error(new IllegalArgumentException("Parameter hostGroupName is required and cannot be null.")); - } - if (hostname == null) { - return Mono.error(new IllegalArgumentException("Parameter hostname is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - resourceGroupName, - hostGroupName, - hostname, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Update an dedicated host . - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host . - * @param parameters Parameters supplied to the Update Dedicated Host operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Dedicated host. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, - String hostGroupName, - String hostname, - DedicatedHostUpdate parameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (hostGroupName == null) { - return Mono.error(new IllegalArgumentException("Parameter hostGroupName is required and cannot be null.")); - } - if (hostname == null) { - return Mono.error(new IllegalArgumentException("Parameter hostname is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - resourceGroupName, - hostGroupName, - hostname, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Update an dedicated host . - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host . - * @param parameters Parameters supplied to the Update Dedicated Host operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Dedicated host. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, DedicatedHostInner> beginUpdateAsync( - String resourceGroupName, String hostGroupName, String hostname, DedicatedHostUpdate parameters) { - Mono>> mono = - updateWithResponseAsync(resourceGroupName, hostGroupName, hostname, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - DedicatedHostInner.class, - DedicatedHostInner.class, - this.client.getContext()); - } - - /** - * Update an dedicated host . - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host . - * @param parameters Parameters supplied to the Update Dedicated Host operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Dedicated host. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, DedicatedHostInner> beginUpdateAsync( - String resourceGroupName, - String hostGroupName, - String hostname, - DedicatedHostUpdate parameters, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - updateWithResponseAsync(resourceGroupName, hostGroupName, hostname, parameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), DedicatedHostInner.class, DedicatedHostInner.class, context); - } - - /** - * Update an dedicated host . - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host . - * @param parameters Parameters supplied to the Update Dedicated Host operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Dedicated host. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, DedicatedHostInner> beginUpdate( - String resourceGroupName, String hostGroupName, String hostname, DedicatedHostUpdate parameters) { - return beginUpdateAsync(resourceGroupName, hostGroupName, hostname, parameters).getSyncPoller(); - } - - /** - * Update an dedicated host . - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host . - * @param parameters Parameters supplied to the Update Dedicated Host operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Dedicated host. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, DedicatedHostInner> beginUpdate( - String resourceGroupName, - String hostGroupName, - String hostname, - DedicatedHostUpdate parameters, - Context context) { - return beginUpdateAsync(resourceGroupName, hostGroupName, hostname, parameters, context).getSyncPoller(); - } - - /** - * Update an dedicated host . - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host . - * @param parameters Parameters supplied to the Update Dedicated Host operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Dedicated host. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync( - String resourceGroupName, String hostGroupName, String hostname, DedicatedHostUpdate parameters) { - return beginUpdateAsync(resourceGroupName, hostGroupName, hostname, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Update an dedicated host . - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host . - * @param parameters Parameters supplied to the Update Dedicated Host operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Dedicated host. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, - String hostGroupName, - String hostname, - DedicatedHostUpdate parameters, - Context context) { - return beginUpdateAsync(resourceGroupName, hostGroupName, hostname, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Update an dedicated host . - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host . - * @param parameters Parameters supplied to the Update Dedicated Host operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Dedicated host. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DedicatedHostInner update( - String resourceGroupName, String hostGroupName, String hostname, DedicatedHostUpdate parameters) { - return updateAsync(resourceGroupName, hostGroupName, hostname, parameters).block(); - } - - /** - * Update an dedicated host . - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host . - * @param parameters Parameters supplied to the Update Dedicated Host operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Dedicated host. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DedicatedHostInner update( - String resourceGroupName, - String hostGroupName, - String hostname, - DedicatedHostUpdate parameters, - Context context) { - return updateAsync(resourceGroupName, hostGroupName, hostname, parameters, context).block(); - } - - /** - * Delete a dedicated host. - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync( - String resourceGroupName, String hostGroupName, String hostname) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (hostGroupName == null) { - return Mono.error(new IllegalArgumentException("Parameter hostGroupName is required and cannot be null.")); - } - if (hostname == null) { - return Mono.error(new IllegalArgumentException("Parameter hostname is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - hostGroupName, - hostname, - apiVersion, - this.client.getSubscriptionId(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete a dedicated host. - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String hostGroupName, String hostname, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (hostGroupName == null) { - return Mono.error(new IllegalArgumentException("Parameter hostGroupName is required and cannot be null.")); - } - if (hostname == null) { - return Mono.error(new IllegalArgumentException("Parameter hostname is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - hostGroupName, - hostname, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Delete a dedicated host. - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String hostGroupName, String hostname) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, hostGroupName, hostname); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Delete a dedicated host. - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String hostGroupName, String hostname, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, hostGroupName, hostname, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Delete a dedicated host. - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String hostGroupName, String hostname) { - return beginDeleteAsync(resourceGroupName, hostGroupName, hostname).getSyncPoller(); - } - - /** - * Delete a dedicated host. - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String hostGroupName, String hostname, Context context) { - return beginDeleteAsync(resourceGroupName, hostGroupName, hostname, context).getSyncPoller(); - } - - /** - * Delete a dedicated host. - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String hostGroupName, String hostname) { - return beginDeleteAsync(resourceGroupName, hostGroupName, hostname) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Delete a dedicated host. - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String hostGroupName, String hostname, Context context) { - return beginDeleteAsync(resourceGroupName, hostGroupName, hostname, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Delete a dedicated host. - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String hostGroupName, String hostname) { - deleteAsync(resourceGroupName, hostGroupName, hostname).block(); - } - - /** - * Delete a dedicated host. - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String hostGroupName, String hostname, Context context) { - deleteAsync(resourceGroupName, hostGroupName, hostname, context).block(); - } - - /** - * Retrieves information about a dedicated host. - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host. - * @param expand The expand expression to apply on the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Dedicated host. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String resourceGroupName, String hostGroupName, String hostname, InstanceViewTypes expand) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (hostGroupName == null) { - return Mono.error(new IllegalArgumentException("Parameter hostGroupName is required and cannot be null.")); - } - if (hostname == null) { - return Mono.error(new IllegalArgumentException("Parameter hostname is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - resourceGroupName, - hostGroupName, - hostname, - expand, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Retrieves information about a dedicated host. - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host. - * @param expand The expand expression to apply on the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Dedicated host. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String hostGroupName, String hostname, InstanceViewTypes expand, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (hostGroupName == null) { - return Mono.error(new IllegalArgumentException("Parameter hostGroupName is required and cannot be null.")); - } - if (hostname == null) { - return Mono.error(new IllegalArgumentException("Parameter hostname is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - resourceGroupName, - hostGroupName, - hostname, - expand, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Retrieves information about a dedicated host. - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host. - * @param expand The expand expression to apply on the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Dedicated host. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync( - String resourceGroupName, String hostGroupName, String hostname, InstanceViewTypes expand) { - return getWithResponseAsync(resourceGroupName, hostGroupName, hostname, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Retrieves information about a dedicated host. - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Dedicated host. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync(String resourceGroupName, String hostGroupName, String hostname) { - final InstanceViewTypes expand = null; - return getWithResponseAsync(resourceGroupName, hostGroupName, hostname, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Retrieves information about a dedicated host. - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Dedicated host. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DedicatedHostInner get(String resourceGroupName, String hostGroupName, String hostname) { - final InstanceViewTypes expand = null; - return getAsync(resourceGroupName, hostGroupName, hostname, expand).block(); - } - - /** - * Retrieves information about a dedicated host. - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host. - * @param expand The expand expression to apply on the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Dedicated host. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String hostGroupName, String hostname, InstanceViewTypes expand, Context context) { - return getWithResponseAsync(resourceGroupName, hostGroupName, hostname, expand, context).block(); - } - - /** - * Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response - * to get the next page of dedicated hosts. - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list dedicated host operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHostGroupSinglePageAsync( - String resourceGroupName, String hostGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (hostGroupName == null) { - return Mono.error(new IllegalArgumentException("Parameter hostGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByHostGroup( - this.client.getEndpoint(), - resourceGroupName, - hostGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response - * to get the next page of dedicated hosts. - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list dedicated host operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHostGroupSinglePageAsync( - String resourceGroupName, String hostGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (hostGroupName == null) { - return Mono.error(new IllegalArgumentException("Parameter hostGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByHostGroup( - this.client.getEndpoint(), - resourceGroupName, - hostGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response - * to get the next page of dedicated hosts. - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list dedicated host operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByHostGroupAsync(String resourceGroupName, String hostGroupName) { - return new PagedFlux<>( - () -> listByHostGroupSinglePageAsync(resourceGroupName, hostGroupName), - nextLink -> listByHostGroupNextSinglePageAsync(nextLink)); - } - - /** - * Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response - * to get the next page of dedicated hosts. - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list dedicated host operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByHostGroupAsync( - String resourceGroupName, String hostGroupName, Context context) { - return new PagedFlux<>( - () -> listByHostGroupSinglePageAsync(resourceGroupName, hostGroupName, context), - nextLink -> listByHostGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response - * to get the next page of dedicated hosts. - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list dedicated host operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByHostGroup(String resourceGroupName, String hostGroupName) { - return new PagedIterable<>(listByHostGroupAsync(resourceGroupName, hostGroupName)); - } - - /** - * Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response - * to get the next page of dedicated hosts. - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list dedicated host operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByHostGroup( - String resourceGroupName, String hostGroupName, Context context) { - return new PagedIterable<>(listByHostGroupAsync(resourceGroupName, hostGroupName, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list dedicated host operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHostGroupNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByHostGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list dedicated host operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHostGroupNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByHostGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/DiskEncryptionSetsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/DiskEncryptionSetsClientImpl.java deleted file mode 100644 index 556dee441603..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/DiskEncryptionSetsClientImpl.java +++ /dev/null @@ -1,1691 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.compute.fluent.DiskEncryptionSetsClient; -import com.azure.resourcemanager.compute.fluent.models.DiskEncryptionSetInner; -import com.azure.resourcemanager.compute.models.ApiErrorException; -import com.azure.resourcemanager.compute.models.DiskEncryptionSetList; -import com.azure.resourcemanager.compute.models.DiskEncryptionSetUpdate; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in DiskEncryptionSetsClient. */ -public final class DiskEncryptionSetsClientImpl - implements InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete, - DiskEncryptionSetsClient { - private final ClientLogger logger = new ClientLogger(DiskEncryptionSetsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final DiskEncryptionSetsService service; - - /** The service client containing this operation class. */ - private final ComputeManagementClientImpl client; - - /** - * Initializes an instance of DiskEncryptionSetsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - DiskEncryptionSetsClientImpl(ComputeManagementClientImpl client) { - this.service = - RestProxy.create(DiskEncryptionSetsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for ComputeManagementClientDiskEncryptionSets to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "ComputeManagementCli") - private interface DiskEncryptionSetsService { - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/diskEncryptionSets/{diskEncryptionSetName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("diskEncryptionSetName") String diskEncryptionSetName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") DiskEncryptionSetInner diskEncryptionSet, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/diskEncryptionSets/{diskEncryptionSetName}") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono>> update( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("diskEncryptionSetName") String diskEncryptionSetName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") DiskEncryptionSetUpdate diskEncryptionSet, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/diskEncryptionSets/{diskEncryptionSetName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("diskEncryptionSetName") String diskEncryptionSetName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/diskEncryptionSets/{diskEncryptionSetName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("diskEncryptionSetName") String diskEncryptionSetName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/diskEncryptionSets") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/diskEncryptionSets") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Creates or updates a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @param diskEncryptionSet disk encryption set object supplied in the body of the Put disk encryption set - * operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk encryption set resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String diskEncryptionSetName, DiskEncryptionSetInner diskEncryptionSet) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (diskEncryptionSetName == null) { - return Mono - .error(new IllegalArgumentException("Parameter diskEncryptionSetName is required and cannot be null.")); - } - if (diskEncryptionSet == null) { - return Mono - .error(new IllegalArgumentException("Parameter diskEncryptionSet is required and cannot be null.")); - } else { - diskEncryptionSet.validate(); - } - final String apiVersion = "2019-07-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - diskEncryptionSetName, - apiVersion, - diskEncryptionSet, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @param diskEncryptionSet disk encryption set object supplied in the body of the Put disk encryption set - * operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk encryption set resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String diskEncryptionSetName, - DiskEncryptionSetInner diskEncryptionSet, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (diskEncryptionSetName == null) { - return Mono - .error(new IllegalArgumentException("Parameter diskEncryptionSetName is required and cannot be null.")); - } - if (diskEncryptionSet == null) { - return Mono - .error(new IllegalArgumentException("Parameter diskEncryptionSet is required and cannot be null.")); - } else { - diskEncryptionSet.validate(); - } - final String apiVersion = "2019-07-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - diskEncryptionSetName, - apiVersion, - diskEncryptionSet, - accept, - context); - } - - /** - * Creates or updates a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @param diskEncryptionSet disk encryption set object supplied in the body of the Put disk encryption set - * operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk encryption set resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, DiskEncryptionSetInner> beginCreateOrUpdateAsync( - String resourceGroupName, String diskEncryptionSetName, DiskEncryptionSetInner diskEncryptionSet) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - DiskEncryptionSetInner.class, - DiskEncryptionSetInner.class, - Context.NONE); - } - - /** - * Creates or updates a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @param diskEncryptionSet disk encryption set object supplied in the body of the Put disk encryption set - * operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk encryption set resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, DiskEncryptionSetInner> beginCreateOrUpdateAsync( - String resourceGroupName, - String diskEncryptionSetName, - DiskEncryptionSetInner diskEncryptionSet, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - DiskEncryptionSetInner.class, - DiskEncryptionSetInner.class, - context); - } - - /** - * Creates or updates a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @param diskEncryptionSet disk encryption set object supplied in the body of the Put disk encryption set - * operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk encryption set resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, DiskEncryptionSetInner> beginCreateOrUpdate( - String resourceGroupName, String diskEncryptionSetName, DiskEncryptionSetInner diskEncryptionSet) { - return beginCreateOrUpdateAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet).getSyncPoller(); - } - - /** - * Creates or updates a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @param diskEncryptionSet disk encryption set object supplied in the body of the Put disk encryption set - * operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk encryption set resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, DiskEncryptionSetInner> beginCreateOrUpdate( - String resourceGroupName, - String diskEncryptionSetName, - DiskEncryptionSetInner diskEncryptionSet, - Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet, context) - .getSyncPoller(); - } - - /** - * Creates or updates a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @param diskEncryptionSet disk encryption set object supplied in the body of the Put disk encryption set - * operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk encryption set resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, String diskEncryptionSetName, DiskEncryptionSetInner diskEncryptionSet) { - return beginCreateOrUpdateAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @param diskEncryptionSet disk encryption set object supplied in the body of the Put disk encryption set - * operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk encryption set resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, - String diskEncryptionSetName, - DiskEncryptionSetInner diskEncryptionSet, - Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @param diskEncryptionSet disk encryption set object supplied in the body of the Put disk encryption set - * operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk encryption set resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DiskEncryptionSetInner createOrUpdate( - String resourceGroupName, String diskEncryptionSetName, DiskEncryptionSetInner diskEncryptionSet) { - return createOrUpdateAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet).block(); - } - - /** - * Creates or updates a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @param diskEncryptionSet disk encryption set object supplied in the body of the Put disk encryption set - * operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk encryption set resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DiskEncryptionSetInner createOrUpdate( - String resourceGroupName, - String diskEncryptionSetName, - DiskEncryptionSetInner diskEncryptionSet, - Context context) { - return createOrUpdateAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet, context).block(); - } - - /** - * Updates (patches) a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @param diskEncryptionSet disk encryption set object supplied in the body of the Patch disk encryption set - * operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk encryption set resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateWithResponseAsync( - String resourceGroupName, String diskEncryptionSetName, DiskEncryptionSetUpdate diskEncryptionSet) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (diskEncryptionSetName == null) { - return Mono - .error(new IllegalArgumentException("Parameter diskEncryptionSetName is required and cannot be null.")); - } - if (diskEncryptionSet == null) { - return Mono - .error(new IllegalArgumentException("Parameter diskEncryptionSet is required and cannot be null.")); - } else { - diskEncryptionSet.validate(); - } - final String apiVersion = "2019-07-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - diskEncryptionSetName, - apiVersion, - diskEncryptionSet, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates (patches) a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @param diskEncryptionSet disk encryption set object supplied in the body of the Patch disk encryption set - * operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk encryption set resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, - String diskEncryptionSetName, - DiskEncryptionSetUpdate diskEncryptionSet, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (diskEncryptionSetName == null) { - return Mono - .error(new IllegalArgumentException("Parameter diskEncryptionSetName is required and cannot be null.")); - } - if (diskEncryptionSet == null) { - return Mono - .error(new IllegalArgumentException("Parameter diskEncryptionSet is required and cannot be null.")); - } else { - diskEncryptionSet.validate(); - } - final String apiVersion = "2019-07-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - diskEncryptionSetName, - apiVersion, - diskEncryptionSet, - accept, - context); - } - - /** - * Updates (patches) a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @param diskEncryptionSet disk encryption set object supplied in the body of the Patch disk encryption set - * operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk encryption set resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, DiskEncryptionSetInner> beginUpdateAsync( - String resourceGroupName, String diskEncryptionSetName, DiskEncryptionSetUpdate diskEncryptionSet) { - Mono>> mono = - updateWithResponseAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - DiskEncryptionSetInner.class, - DiskEncryptionSetInner.class, - Context.NONE); - } - - /** - * Updates (patches) a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @param diskEncryptionSet disk encryption set object supplied in the body of the Patch disk encryption set - * operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk encryption set resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, DiskEncryptionSetInner> beginUpdateAsync( - String resourceGroupName, - String diskEncryptionSetName, - DiskEncryptionSetUpdate diskEncryptionSet, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - updateWithResponseAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - DiskEncryptionSetInner.class, - DiskEncryptionSetInner.class, - context); - } - - /** - * Updates (patches) a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @param diskEncryptionSet disk encryption set object supplied in the body of the Patch disk encryption set - * operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk encryption set resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, DiskEncryptionSetInner> beginUpdate( - String resourceGroupName, String diskEncryptionSetName, DiskEncryptionSetUpdate diskEncryptionSet) { - return beginUpdateAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet).getSyncPoller(); - } - - /** - * Updates (patches) a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @param diskEncryptionSet disk encryption set object supplied in the body of the Patch disk encryption set - * operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk encryption set resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, DiskEncryptionSetInner> beginUpdate( - String resourceGroupName, - String diskEncryptionSetName, - DiskEncryptionSetUpdate diskEncryptionSet, - Context context) { - return beginUpdateAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet, context).getSyncPoller(); - } - - /** - * Updates (patches) a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @param diskEncryptionSet disk encryption set object supplied in the body of the Patch disk encryption set - * operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk encryption set resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync( - String resourceGroupName, String diskEncryptionSetName, DiskEncryptionSetUpdate diskEncryptionSet) { - return beginUpdateAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates (patches) a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @param diskEncryptionSet disk encryption set object supplied in the body of the Patch disk encryption set - * operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk encryption set resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, - String diskEncryptionSetName, - DiskEncryptionSetUpdate diskEncryptionSet, - Context context) { - return beginUpdateAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates (patches) a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @param diskEncryptionSet disk encryption set object supplied in the body of the Patch disk encryption set - * operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk encryption set resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DiskEncryptionSetInner update( - String resourceGroupName, String diskEncryptionSetName, DiskEncryptionSetUpdate diskEncryptionSet) { - return updateAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet).block(); - } - - /** - * Updates (patches) a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @param diskEncryptionSet disk encryption set object supplied in the body of the Patch disk encryption set - * operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk encryption set resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DiskEncryptionSetInner update( - String resourceGroupName, - String diskEncryptionSetName, - DiskEncryptionSetUpdate diskEncryptionSet, - Context context) { - return updateAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet, context).block(); - } - - /** - * Gets information about a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a disk encryption set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String diskEncryptionSetName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (diskEncryptionSetName == null) { - return Mono - .error(new IllegalArgumentException("Parameter diskEncryptionSetName is required and cannot be null.")); - } - final String apiVersion = "2019-07-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - diskEncryptionSetName, - apiVersion, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets information about a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a disk encryption set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String diskEncryptionSetName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (diskEncryptionSetName == null) { - return Mono - .error(new IllegalArgumentException("Parameter diskEncryptionSetName is required and cannot be null.")); - } - final String apiVersion = "2019-07-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - diskEncryptionSetName, - apiVersion, - accept, - context); - } - - /** - * Gets information about a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a disk encryption set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync( - String resourceGroupName, String diskEncryptionSetName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, diskEncryptionSetName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets information about a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a disk encryption set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DiskEncryptionSetInner getByResourceGroup(String resourceGroupName, String diskEncryptionSetName) { - return getByResourceGroupAsync(resourceGroupName, diskEncryptionSetName).block(); - } - - /** - * Gets information about a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a disk encryption set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String diskEncryptionSetName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, diskEncryptionSetName, context).block(); - } - - /** - * Deletes a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync( - String resourceGroupName, String diskEncryptionSetName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (diskEncryptionSetName == null) { - return Mono - .error(new IllegalArgumentException("Parameter diskEncryptionSetName is required and cannot be null.")); - } - final String apiVersion = "2019-07-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - diskEncryptionSetName, - apiVersion, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String diskEncryptionSetName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (diskEncryptionSetName == null) { - return Mono - .error(new IllegalArgumentException("Parameter diskEncryptionSetName is required and cannot be null.")); - } - final String apiVersion = "2019-07-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - diskEncryptionSetName, - apiVersion, - accept, - context); - } - - /** - * Deletes a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String diskEncryptionSetName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, diskEncryptionSetName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deletes a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String diskEncryptionSetName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, diskEncryptionSetName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete(String resourceGroupName, String diskEncryptionSetName) { - return beginDeleteAsync(resourceGroupName, diskEncryptionSetName).getSyncPoller(); - } - - /** - * Deletes a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String diskEncryptionSetName, Context context) { - return beginDeleteAsync(resourceGroupName, diskEncryptionSetName, context).getSyncPoller(); - } - - /** - * Deletes a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String diskEncryptionSetName) { - return beginDeleteAsync(resourceGroupName, diskEncryptionSetName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String diskEncryptionSetName, Context context) { - return beginDeleteAsync(resourceGroupName, diskEncryptionSetName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String diskEncryptionSetName) { - deleteAsync(resourceGroupName, diskEncryptionSetName).block(); - } - - /** - * Deletes a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String diskEncryptionSetName, Context context) { - deleteAsync(resourceGroupName, diskEncryptionSetName, context).block(); - } - - /** - * Lists all the disk encryption sets under a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List disk encryption set operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String apiVersion = "2019-07-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - apiVersion, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all the disk encryption sets under a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List disk encryption set operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String apiVersion = "2019-07-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - apiVersion, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists all the disk encryption sets under a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List disk encryption set operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * Lists all the disk encryption sets under a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List disk encryption set operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all the disk encryption sets under a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List disk encryption set operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * Lists all the disk encryption sets under a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List disk encryption set operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * Lists all the disk encryption sets under a subscription. - * - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List disk encryption set operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-07-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all the disk encryption sets under a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List disk encryption set operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-07-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists all the disk encryption sets under a subscription. - * - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List disk encryption set operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists all the disk encryption sets under a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List disk encryption set operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all the disk encryption sets under a subscription. - * - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List disk encryption set operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Lists all the disk encryption sets under a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List disk encryption set operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List disk encryption set operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List disk encryption set operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List disk encryption set operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List disk encryption set operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/DiskImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/DiskImpl.java deleted file mode 100644 index ac2b010716be..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/DiskImpl.java +++ /dev/null @@ -1,406 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.implementation; - -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.ComputeManager; -import com.azure.resourcemanager.compute.models.AccessLevel; -import com.azure.resourcemanager.compute.models.CreationData; -import com.azure.resourcemanager.compute.models.CreationSource; -import com.azure.resourcemanager.compute.models.Disk; -import com.azure.resourcemanager.compute.models.DiskCreateOption; -import com.azure.resourcemanager.compute.models.DiskSku; -import com.azure.resourcemanager.compute.models.DiskSkuTypes; -import com.azure.resourcemanager.compute.models.DiskStorageAccountTypes; -import com.azure.resourcemanager.compute.models.EncryptionSettingsCollection; -import com.azure.resourcemanager.compute.models.GrantAccessData; -import com.azure.resourcemanager.compute.models.OperatingSystemTypes; -import com.azure.resourcemanager.compute.models.Snapshot; -import com.azure.resourcemanager.compute.fluent.models.DiskInner; -import com.azure.resourcemanager.compute.models.SnapshotSkuType; -import com.azure.resourcemanager.resources.fluentcore.arm.AvailabilityZoneId; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils; -import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.GroupableResourceImpl; -import com.azure.resourcemanager.resources.fluentcore.model.Accepted; -import com.azure.resourcemanager.resources.fluentcore.model.Indexable; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.AcceptedImpl; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import com.azure.resourcemanager.storage.models.StorageAccount; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashSet; -import java.util.Set; - -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** The implementation for {@link Disk} and its create and update interfaces. */ -class DiskImpl extends GroupableResourceImpl - implements Disk, Disk.Definition, Disk.Update { - - private final ClientLogger logger = new ClientLogger(this.getClass()); - - DiskImpl(String name, DiskInner innerModel, final ComputeManager computeManager) { - super(name, innerModel, computeManager); - } - - @Override - public DiskSkuTypes sku() { - return DiskSkuTypes.fromDiskSku(this.innerModel().sku()); - } - - @Override - public DiskCreateOption creationMethod() { - return this.innerModel().creationData().createOption(); - } - - @Override - public boolean isAttachedToVirtualMachine() { - return this.virtualMachineId() != null; - } - - @Override - public String virtualMachineId() { - return this.innerModel().managedBy(); - } - - @Override - public int sizeInGB() { - return ResourceManagerUtils.toPrimitiveInt(this.innerModel().diskSizeGB()); - } - - @Override - public long sizeInByte() { - return this.innerModel().diskSizeBytes(); - } - - @Override - public OperatingSystemTypes osType() { - return this.innerModel().osType(); - } - - @Override - public CreationSource source() { - return new CreationSource(this.innerModel().creationData()); - } - - @Override - public Set availabilityZones() { - Set zones = new HashSet<>(); - if (this.innerModel().zones() != null) { - for (String zone : this.innerModel().zones()) { - zones.add(AvailabilityZoneId.fromString(zone)); - } - } - return Collections.unmodifiableSet(zones); - } - - @Override - public EncryptionSettingsCollection encryptionSettings() { - return this.innerModel().encryptionSettingsCollection(); - } - - @Override - public String grantAccess(int accessDurationInSeconds) { - return this.grantAccessAsync(accessDurationInSeconds).block(); - } - - @Override - public Mono grantAccessAsync(int accessDurationInSeconds) { - GrantAccessData grantAccessDataInner = new GrantAccessData(); - grantAccessDataInner.withAccess(AccessLevel.READ).withDurationInSeconds(accessDurationInSeconds); - - return this - .manager() - .serviceClient() - .getDisks() - .grantAccessAsync(this.resourceGroupName(), this.name(), grantAccessDataInner) - .map(accessUriInner -> accessUriInner.accessSas()); - } - - @Override - public void revokeAccess() { - this.revokeAccessAsync().block(); - } - - @Override - public Mono revokeAccessAsync() { - return this.manager().serviceClient().getDisks().revokeAccessAsync(this.resourceGroupName(), this.name()); - } - - @Override - public DiskImpl withLinuxFromVhd(String vhdUrl) { - this - .innerModel() - .withOsType(OperatingSystemTypes.LINUX) - .withCreationData(new CreationData()) - .creationData() - .withCreateOption(DiskCreateOption.IMPORT) - .withSourceUri(vhdUrl); - return this; - } - - @Override - public DiskImpl withLinuxFromDisk(String sourceDiskId) { - this - .innerModel() - .withOsType(OperatingSystemTypes.LINUX) - .withCreationData(new CreationData()) - .creationData() - .withCreateOption(DiskCreateOption.COPY) - .withSourceResourceId(sourceDiskId); - return this; - } - - @Override - public DiskImpl withLinuxFromDisk(Disk sourceDisk) { - withLinuxFromDisk(sourceDisk.id()); - if (sourceDisk.osType() != null) { - this.withOSType(sourceDisk.osType()); - } - this.withSku(sourceDisk.sku()); - return this; - } - - @Override - public DiskImpl withLinuxFromSnapshot(String sourceSnapshotId) { - this - .innerModel() - .withOsType(OperatingSystemTypes.LINUX) - .withCreationData(new CreationData()) - .creationData() - .withCreateOption(DiskCreateOption.COPY) - .withSourceResourceId(sourceSnapshotId); - return this; - } - - @Override - public DiskImpl withLinuxFromSnapshot(Snapshot sourceSnapshot) { - withLinuxFromSnapshot(sourceSnapshot.id()); - if (sourceSnapshot.osType() != null) { - this.withOSType(sourceSnapshot.osType()); - } - this.withSku(this.fromSnapshotSkuType(sourceSnapshot.skuType())); - return this; - } - - @Override - public DiskImpl withWindowsFromVhd(String vhdUrl) { - this - .innerModel() - .withOsType(OperatingSystemTypes.WINDOWS) - .withCreationData(new CreationData()) - .creationData() - .withCreateOption(DiskCreateOption.IMPORT) - .withSourceUri(vhdUrl); - return this; - } - - @Override - public DiskImpl withWindowsFromDisk(String sourceDiskId) { - this - .innerModel() - .withOsType(OperatingSystemTypes.WINDOWS) - .withCreationData(new CreationData()) - .creationData() - .withCreateOption(DiskCreateOption.COPY) - .withSourceResourceId(sourceDiskId); - return this; - } - - @Override - public DiskImpl withWindowsFromDisk(Disk sourceDisk) { - withWindowsFromDisk(sourceDisk.id()); - if (sourceDisk.osType() != null) { - this.withOSType(sourceDisk.osType()); - } - this.withSku(sourceDisk.sku()); - return this; - } - - @Override - public DiskImpl withWindowsFromSnapshot(String sourceSnapshotId) { - this - .innerModel() - .withOsType(OperatingSystemTypes.WINDOWS) - .withCreationData(new CreationData()) - .creationData() - .withCreateOption(DiskCreateOption.COPY) - .withSourceResourceId(sourceSnapshotId); - return this; - } - - @Override - public DiskImpl withWindowsFromSnapshot(Snapshot sourceSnapshot) { - withWindowsFromSnapshot(sourceSnapshot.id()); - if (sourceSnapshot.osType() != null) { - this.withOSType(sourceSnapshot.osType()); - } - this.withSku(this.fromSnapshotSkuType(sourceSnapshot.skuType())); - return this; - } - - @Override - public DiskImpl withData() { - this.innerModel().withCreationData(new CreationData()).creationData().withCreateOption(DiskCreateOption.EMPTY); - return this; - } - - @Override - public DiskImpl fromVhd(String vhdUrl) { - this - .innerModel() - .withCreationData(new CreationData()) - .creationData() - .withCreateOption(DiskCreateOption.IMPORT) - .withSourceUri(vhdUrl); - return this; - } - - @Override - public DiskImpl withUploadSizeInMB(long uploadSizeInMB) { - this - .innerModel() - .withCreationData(new CreationData()) - .creationData() - .withCreateOption(DiskCreateOption.UPLOAD) - .withUploadSizeBytes(uploadSizeInMB * 1024 * 1024 + 512); - return this; - } - - @Override - public DiskImpl fromSnapshot(String snapshotId) { - this - .innerModel() - .withCreationData(new CreationData()) - .creationData() - .withCreateOption(DiskCreateOption.COPY) - .withSourceResourceId(snapshotId); - return this; - } - - @Override - public DiskImpl fromSnapshot(Snapshot snapshot) { - return fromSnapshot(snapshot.id()); - } - - @Override - public DiskImpl fromDisk(String managedDiskId) { - this - .innerModel() - .withCreationData(new CreationData()) - .creationData() - .withCreateOption(DiskCreateOption.COPY) - .withSourceResourceId(managedDiskId); - return this; - } - - @Override - public DiskImpl fromDisk(Disk managedDisk) { - return fromDisk(managedDisk.id()).withOSType(managedDisk.osType()).withSku(managedDisk.sku()); - } - - @Override - public DiskImpl withSizeInGB(int sizeInGB) { - this.innerModel().withDiskSizeGB(sizeInGB); - return this; - } - - @Override - public DiskImpl withOSType(OperatingSystemTypes osType) { - this.innerModel().withOsType(osType); - return this; - } - - @Override - public DiskImpl withSku(DiskSkuTypes sku) { - this.innerModel().withSku((new DiskSku()).withName(sku.accountType())); - return this; - } - - @Override - public DiskImpl withStorageAccountId(String storageAccountId) { - this.innerModel().creationData().withStorageAccountId(storageAccountId); - return this; - } - - @Override - public DiskImpl withStorageAccountName(String storageAccountName) { - String id = - ResourceUtils - .constructResourceId( - this.myManager.subscriptionId(), - this.resourceGroupName(), - "Microsoft.Storage", - "storageAccounts", - storageAccountName, - ""); - return this.withStorageAccountId(id); - } - - @Override - public DiskImpl withStorageAccount(StorageAccount account) { - return this.withStorageAccountId(account.id()); - } - - @Override - public DiskImpl withAvailabilityZone(AvailabilityZoneId zoneId) { - // Note: Zone is not updatable as of now, so this is available only during definition time. - // Service return `ResourceAvailabilityZonesCannotBeModified` upon attempt to append a new - // zone or remove one. Trying to remove the last one means attempt to change resource from - // zonal to regional, which is not supported. - if (this.innerModel().zones() == null) { - this.innerModel().withZones(new ArrayList()); - } - this.innerModel().zones().add(zoneId.toString()); - return this; - } - - @Override - public Mono createResourceAsync() { - return manager() - .serviceClient() - .getDisks() - .createOrUpdateAsync(resourceGroupName(), name(), this.innerModel()) - .map(innerToFluentMap(this)); - } - - @Override - protected Mono getInnerAsync() { - return this.manager().serviceClient().getDisks().getByResourceGroupAsync(this.resourceGroupName(), this.name()); - } - - @Override - public Accepted beginCreate() { - return AcceptedImpl - .newAccepted( - logger, - this.manager().serviceClient().getHttpPipeline(), - this.manager().serviceClient().getDefaultPollInterval(), - () -> - this - .manager() - .serviceClient() - .getDisks() - .createOrUpdateWithResponseAsync(resourceGroupName(), name(), this.innerModel()) - .block(), - inner -> new DiskImpl(inner.name(), inner, this.manager()), - DiskInner.class, - () -> { - Flux dependencyTasksAsync = - taskGroup().invokeDependencyAsync(taskGroup().newInvocationContext()); - dependencyTasksAsync.blockLast(); - }, - this::setInner, - Context.NONE); - } - - private DiskSkuTypes fromSnapshotSkuType(SnapshotSkuType skuType) { - if (skuType == null) { - return null; - } - return DiskSkuTypes.fromStorageAccountType(DiskStorageAccountTypes.fromString(skuType.toString())); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/DisksClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/DisksClientImpl.java deleted file mode 100644 index 4122afa9c25a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/DisksClientImpl.java +++ /dev/null @@ -1,2098 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.compute.fluent.DisksClient; -import com.azure.resourcemanager.compute.fluent.models.AccessUriInner; -import com.azure.resourcemanager.compute.fluent.models.DiskInner; -import com.azure.resourcemanager.compute.models.DiskList; -import com.azure.resourcemanager.compute.models.DiskUpdate; -import com.azure.resourcemanager.compute.models.GrantAccessData; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in DisksClient. */ -public final class DisksClientImpl - implements InnerSupportsGet, InnerSupportsListing, InnerSupportsDelete, DisksClient { - private final ClientLogger logger = new ClientLogger(DisksClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final DisksService service; - - /** The service client containing this operation class. */ - private final ComputeManagementClientImpl client; - - /** - * Initializes an instance of DisksClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - DisksClientImpl(ComputeManagementClientImpl client) { - this.service = RestProxy.create(DisksService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for ComputeManagementClientDisks to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "ComputeManagementCli") - private interface DisksService { - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks" - + "/{diskName}") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("diskName") String diskName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") DiskInner disk, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks" - + "/{diskName}") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("diskName") String diskName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") DiskUpdate disk, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks" - + "/{diskName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("diskName") String diskName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks" - + "/{diskName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("diskName") String diskName, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/disks") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks" - + "/{diskName}/beginGetAccess") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> grantAccess( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("diskName") String diskName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") GrantAccessData grantAccessData, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks" - + "/{diskName}/endGetAccess") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> revokeAccess( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("diskName") String diskName, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Creates or updates a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param disk Disk object supplied in the body of the Put disk operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String diskName, DiskInner disk) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (diskName == null) { - return Mono.error(new IllegalArgumentException("Parameter diskName is required and cannot be null.")); - } - if (disk == null) { - return Mono.error(new IllegalArgumentException("Parameter disk is required and cannot be null.")); - } else { - disk.validate(); - } - final String apiVersion = "2019-07-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - diskName, - apiVersion, - disk, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param disk Disk object supplied in the body of the Put disk operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String diskName, DiskInner disk, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (diskName == null) { - return Mono.error(new IllegalArgumentException("Parameter diskName is required and cannot be null.")); - } - if (disk == null) { - return Mono.error(new IllegalArgumentException("Parameter disk is required and cannot be null.")); - } else { - disk.validate(); - } - final String apiVersion = "2019-07-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - diskName, - apiVersion, - disk, - accept, - context); - } - - /** - * Creates or updates a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param disk Disk object supplied in the body of the Put disk operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, DiskInner> beginCreateOrUpdateAsync( - String resourceGroupName, String diskName, DiskInner disk) { - Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, diskName, disk); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), DiskInner.class, DiskInner.class, this.client.getContext()); - } - - /** - * Creates or updates a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param disk Disk object supplied in the body of the Put disk operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, DiskInner> beginCreateOrUpdateAsync( - String resourceGroupName, String diskName, DiskInner disk, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, diskName, disk, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), DiskInner.class, DiskInner.class, context); - } - - /** - * Creates or updates a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param disk Disk object supplied in the body of the Put disk operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, DiskInner> beginCreateOrUpdate( - String resourceGroupName, String diskName, DiskInner disk) { - return beginCreateOrUpdateAsync(resourceGroupName, diskName, disk).getSyncPoller(); - } - - /** - * Creates or updates a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param disk Disk object supplied in the body of the Put disk operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, DiskInner> beginCreateOrUpdate( - String resourceGroupName, String diskName, DiskInner disk, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, diskName, disk, context).getSyncPoller(); - } - - /** - * Creates or updates a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param disk Disk object supplied in the body of the Put disk operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync(String resourceGroupName, String diskName, DiskInner disk) { - return beginCreateOrUpdateAsync(resourceGroupName, diskName, disk) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param disk Disk object supplied in the body of the Put disk operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String diskName, DiskInner disk, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, diskName, disk, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param disk Disk object supplied in the body of the Put disk operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DiskInner createOrUpdate(String resourceGroupName, String diskName, DiskInner disk) { - return createOrUpdateAsync(resourceGroupName, diskName, disk).block(); - } - - /** - * Creates or updates a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param disk Disk object supplied in the body of the Put disk operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DiskInner createOrUpdate(String resourceGroupName, String diskName, DiskInner disk, Context context) { - return createOrUpdateAsync(resourceGroupName, diskName, disk, context).block(); - } - - /** - * Updates (patches) a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param disk Disk object supplied in the body of the Patch disk operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateWithResponseAsync( - String resourceGroupName, String diskName, DiskUpdate disk) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (diskName == null) { - return Mono.error(new IllegalArgumentException("Parameter diskName is required and cannot be null.")); - } - if (disk == null) { - return Mono.error(new IllegalArgumentException("Parameter disk is required and cannot be null.")); - } else { - disk.validate(); - } - final String apiVersion = "2019-07-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - diskName, - apiVersion, - disk, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates (patches) a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param disk Disk object supplied in the body of the Patch disk operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, String diskName, DiskUpdate disk, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (diskName == null) { - return Mono.error(new IllegalArgumentException("Parameter diskName is required and cannot be null.")); - } - if (disk == null) { - return Mono.error(new IllegalArgumentException("Parameter disk is required and cannot be null.")); - } else { - disk.validate(); - } - final String apiVersion = "2019-07-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - diskName, - apiVersion, - disk, - accept, - context); - } - - /** - * Updates (patches) a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param disk Disk object supplied in the body of the Patch disk operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, DiskInner> beginUpdateAsync( - String resourceGroupName, String diskName, DiskUpdate disk) { - Mono>> mono = updateWithResponseAsync(resourceGroupName, diskName, disk); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), DiskInner.class, DiskInner.class, this.client.getContext()); - } - - /** - * Updates (patches) a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param disk Disk object supplied in the body of the Patch disk operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, DiskInner> beginUpdateAsync( - String resourceGroupName, String diskName, DiskUpdate disk, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = updateWithResponseAsync(resourceGroupName, diskName, disk, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), DiskInner.class, DiskInner.class, context); - } - - /** - * Updates (patches) a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param disk Disk object supplied in the body of the Patch disk operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, DiskInner> beginUpdate( - String resourceGroupName, String diskName, DiskUpdate disk) { - return beginUpdateAsync(resourceGroupName, diskName, disk).getSyncPoller(); - } - - /** - * Updates (patches) a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param disk Disk object supplied in the body of the Patch disk operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, DiskInner> beginUpdate( - String resourceGroupName, String diskName, DiskUpdate disk, Context context) { - return beginUpdateAsync(resourceGroupName, diskName, disk, context).getSyncPoller(); - } - - /** - * Updates (patches) a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param disk Disk object supplied in the body of the Patch disk operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync(String resourceGroupName, String diskName, DiskUpdate disk) { - return beginUpdateAsync(resourceGroupName, diskName, disk) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates (patches) a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param disk Disk object supplied in the body of the Patch disk operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String diskName, DiskUpdate disk, Context context) { - return beginUpdateAsync(resourceGroupName, diskName, disk, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates (patches) a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param disk Disk object supplied in the body of the Patch disk operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DiskInner update(String resourceGroupName, String diskName, DiskUpdate disk) { - return updateAsync(resourceGroupName, diskName, disk).block(); - } - - /** - * Updates (patches) a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param disk Disk object supplied in the body of the Patch disk operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DiskInner update(String resourceGroupName, String diskName, DiskUpdate disk, Context context) { - return updateAsync(resourceGroupName, diskName, disk, context).block(); - } - - /** - * Gets information about a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a disk. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String diskName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (diskName == null) { - return Mono.error(new IllegalArgumentException("Parameter diskName is required and cannot be null.")); - } - final String apiVersion = "2019-07-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - diskName, - apiVersion, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets information about a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a disk. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String diskName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (diskName == null) { - return Mono.error(new IllegalArgumentException("Parameter diskName is required and cannot be null.")); - } - final String apiVersion = "2019-07-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - diskName, - apiVersion, - accept, - context); - } - - /** - * Gets information about a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a disk. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync(String resourceGroupName, String diskName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, diskName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets information about a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a disk. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DiskInner getByResourceGroup(String resourceGroupName, String diskName) { - return getByResourceGroupAsync(resourceGroupName, diskName).block(); - } - - /** - * Gets information about a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a disk. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String diskName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, diskName, context).block(); - } - - /** - * Deletes a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync(String resourceGroupName, String diskName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (diskName == null) { - return Mono.error(new IllegalArgumentException("Parameter diskName is required and cannot be null.")); - } - final String apiVersion = "2019-07-01"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - diskName, - apiVersion, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String diskName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (diskName == null) { - return Mono.error(new IllegalArgumentException("Parameter diskName is required and cannot be null.")); - } - final String apiVersion = "2019-07-01"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - diskName, - apiVersion, - context); - } - - /** - * Deletes a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String diskName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, diskName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deletes a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String diskName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(resourceGroupName, diskName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete(String resourceGroupName, String diskName) { - return beginDeleteAsync(resourceGroupName, diskName).getSyncPoller(); - } - - /** - * Deletes a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete(String resourceGroupName, String diskName, Context context) { - return beginDeleteAsync(resourceGroupName, diskName, context).getSyncPoller(); - } - - /** - * Deletes a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String diskName) { - return beginDeleteAsync(resourceGroupName, diskName).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String diskName, Context context) { - return beginDeleteAsync(resourceGroupName, diskName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String diskName) { - deleteAsync(resourceGroupName, diskName).block(); - } - - /** - * Deletes a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String diskName, Context context) { - deleteAsync(resourceGroupName, diskName, context).block(); - } - - /** - * Lists all the disks under a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Disks operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String apiVersion = "2019-07-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - apiVersion, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all the disks under a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Disks operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String apiVersion = "2019-07-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - apiVersion, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists all the disks under a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Disks operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * Lists all the disks under a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Disks operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all the disks under a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Disks operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * Lists all the disks under a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Disks operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * Lists all the disks under a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Disks operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-07-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all the disks under a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Disks operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-07-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists all the disks under a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Disks operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists all the disks under a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Disks operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all the disks under a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Disks operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Lists all the disks under a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Disks operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Grants access to a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param grantAccessData Access data object supplied in the body of the get disk access operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a disk access SAS uri. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> grantAccessWithResponseAsync( - String resourceGroupName, String diskName, GrantAccessData grantAccessData) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (diskName == null) { - return Mono.error(new IllegalArgumentException("Parameter diskName is required and cannot be null.")); - } - if (grantAccessData == null) { - return Mono - .error(new IllegalArgumentException("Parameter grantAccessData is required and cannot be null.")); - } else { - grantAccessData.validate(); - } - final String apiVersion = "2019-07-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .grantAccess( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - diskName, - apiVersion, - grantAccessData, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Grants access to a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param grantAccessData Access data object supplied in the body of the get disk access operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a disk access SAS uri. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> grantAccessWithResponseAsync( - String resourceGroupName, String diskName, GrantAccessData grantAccessData, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (diskName == null) { - return Mono.error(new IllegalArgumentException("Parameter diskName is required and cannot be null.")); - } - if (grantAccessData == null) { - return Mono - .error(new IllegalArgumentException("Parameter grantAccessData is required and cannot be null.")); - } else { - grantAccessData.validate(); - } - final String apiVersion = "2019-07-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .grantAccess( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - diskName, - apiVersion, - grantAccessData, - accept, - context); - } - - /** - * Grants access to a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param grantAccessData Access data object supplied in the body of the get disk access operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a disk access SAS uri. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, AccessUriInner> beginGrantAccessAsync( - String resourceGroupName, String diskName, GrantAccessData grantAccessData) { - Mono>> mono = - grantAccessWithResponseAsync(resourceGroupName, diskName, grantAccessData); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - AccessUriInner.class, - AccessUriInner.class, - this.client.getContext()); - } - - /** - * Grants access to a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param grantAccessData Access data object supplied in the body of the get disk access operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a disk access SAS uri. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, AccessUriInner> beginGrantAccessAsync( - String resourceGroupName, String diskName, GrantAccessData grantAccessData, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - grantAccessWithResponseAsync(resourceGroupName, diskName, grantAccessData, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), AccessUriInner.class, AccessUriInner.class, context); - } - - /** - * Grants access to a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param grantAccessData Access data object supplied in the body of the get disk access operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a disk access SAS uri. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, AccessUriInner> beginGrantAccess( - String resourceGroupName, String diskName, GrantAccessData grantAccessData) { - return beginGrantAccessAsync(resourceGroupName, diskName, grantAccessData).getSyncPoller(); - } - - /** - * Grants access to a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param grantAccessData Access data object supplied in the body of the get disk access operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a disk access SAS uri. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, AccessUriInner> beginGrantAccess( - String resourceGroupName, String diskName, GrantAccessData grantAccessData, Context context) { - return beginGrantAccessAsync(resourceGroupName, diskName, grantAccessData, context).getSyncPoller(); - } - - /** - * Grants access to a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param grantAccessData Access data object supplied in the body of the get disk access operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a disk access SAS uri. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono grantAccessAsync( - String resourceGroupName, String diskName, GrantAccessData grantAccessData) { - return beginGrantAccessAsync(resourceGroupName, diskName, grantAccessData) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Grants access to a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param grantAccessData Access data object supplied in the body of the get disk access operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a disk access SAS uri. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono grantAccessAsync( - String resourceGroupName, String diskName, GrantAccessData grantAccessData, Context context) { - return beginGrantAccessAsync(resourceGroupName, diskName, grantAccessData, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Grants access to a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param grantAccessData Access data object supplied in the body of the get disk access operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a disk access SAS uri. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AccessUriInner grantAccess(String resourceGroupName, String diskName, GrantAccessData grantAccessData) { - return grantAccessAsync(resourceGroupName, diskName, grantAccessData).block(); - } - - /** - * Grants access to a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param grantAccessData Access data object supplied in the body of the get disk access operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a disk access SAS uri. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AccessUriInner grantAccess( - String resourceGroupName, String diskName, GrantAccessData grantAccessData, Context context) { - return grantAccessAsync(resourceGroupName, diskName, grantAccessData, context).block(); - } - - /** - * Revokes access to a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> revokeAccessWithResponseAsync(String resourceGroupName, String diskName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (diskName == null) { - return Mono.error(new IllegalArgumentException("Parameter diskName is required and cannot be null.")); - } - final String apiVersion = "2019-07-01"; - return FluxUtil - .withContext( - context -> - service - .revokeAccess( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - diskName, - apiVersion, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Revokes access to a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> revokeAccessWithResponseAsync( - String resourceGroupName, String diskName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (diskName == null) { - return Mono.error(new IllegalArgumentException("Parameter diskName is required and cannot be null.")); - } - final String apiVersion = "2019-07-01"; - context = this.client.mergeContext(context); - return service - .revokeAccess( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - diskName, - apiVersion, - context); - } - - /** - * Revokes access to a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginRevokeAccessAsync(String resourceGroupName, String diskName) { - Mono>> mono = revokeAccessWithResponseAsync(resourceGroupName, diskName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Revokes access to a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginRevokeAccessAsync( - String resourceGroupName, String diskName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = revokeAccessWithResponseAsync(resourceGroupName, diskName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Revokes access to a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginRevokeAccess(String resourceGroupName, String diskName) { - return beginRevokeAccessAsync(resourceGroupName, diskName).getSyncPoller(); - } - - /** - * Revokes access to a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginRevokeAccess( - String resourceGroupName, String diskName, Context context) { - return beginRevokeAccessAsync(resourceGroupName, diskName, context).getSyncPoller(); - } - - /** - * Revokes access to a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono revokeAccessAsync(String resourceGroupName, String diskName) { - return beginRevokeAccessAsync(resourceGroupName, diskName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Revokes access to a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono revokeAccessAsync(String resourceGroupName, String diskName, Context context) { - return beginRevokeAccessAsync(resourceGroupName, diskName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Revokes access to a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void revokeAccess(String resourceGroupName, String diskName) { - revokeAccessAsync(resourceGroupName, diskName).block(); - } - - /** - * Revokes access to a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void revokeAccess(String resourceGroupName, String diskName, Context context) { - revokeAccessAsync(resourceGroupName, diskName, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Disks operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Disks operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Disks operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Disks operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/DisksImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/DisksImpl.java deleted file mode 100644 index 27afec273e96..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/DisksImpl.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.implementation; - -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.ComputeManager; -import com.azure.resourcemanager.compute.models.AccessLevel; -import com.azure.resourcemanager.compute.models.Disk; -import com.azure.resourcemanager.compute.models.Disks; -import com.azure.resourcemanager.compute.models.GrantAccessData; -import com.azure.resourcemanager.compute.fluent.models.DiskInner; -import com.azure.resourcemanager.compute.fluent.DisksClient; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.TopLevelModifiableResourcesImpl; -import com.azure.resourcemanager.resources.fluentcore.model.Accepted; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.AcceptedImpl; -import reactor.core.publisher.Mono; - -import java.util.function.Function; - -/** The implementation for Disks. */ -public class DisksImpl extends TopLevelModifiableResourcesImpl - implements Disks { - - private final ClientLogger logger = new ClientLogger(this.getClass()); - - public DisksImpl(ComputeManager computeManager) { - super(computeManager.serviceClient().getDisks(), computeManager); - } - - @Override - public String grantAccess(String resourceGroupName, String diskName, AccessLevel accessLevel, int accessDuration) { - return this.grantAccessAsync(resourceGroupName, diskName, accessLevel, accessDuration).block(); - } - - @Override - public Mono grantAccessAsync( - String resourceGroupName, String diskName, AccessLevel accessLevel, int accessDuration) { - GrantAccessData grantAccessDataInner = new GrantAccessData(); - grantAccessDataInner.withAccess(accessLevel).withDurationInSeconds(accessDuration); - return this - .inner() - .grantAccessAsync(resourceGroupName, diskName, grantAccessDataInner) - .map(accessUriInner -> accessUriInner.accessSas()); - } - - @Override - public void revokeAccess(String resourceGroupName, String diskName) { - this.inner().revokeAccess(resourceGroupName, diskName); - } - - @Override - public Mono revokeAccessAsync(String resourceGroupName, String diskName) { - return this.inner().revokeAccessAsync(resourceGroupName, diskName); - } - - @Override - public Accepted beginDeleteById(String id) { - return beginDeleteByResourceGroup(ResourceUtils.groupFromResourceId(id), ResourceUtils.nameFromResourceId(id)); - } - - @Override - public Accepted beginDeleteByResourceGroup(String resourceGroupName, String name) { - return AcceptedImpl - .newAccepted( - logger, - this.manager().serviceClient().getHttpPipeline(), - this.manager().serviceClient().getDefaultPollInterval(), - () -> this.inner().deleteWithResponseAsync(resourceGroupName, name).block(), - Function.identity(), - Void.class, - null, - Context.NONE); - } - - @Override - protected DiskImpl wrapModel(String name) { - return new DiskImpl(name, new DiskInner(), this.manager()); - } - - @Override - protected DiskImpl wrapModel(DiskInner inner) { - if (inner == null) { - return null; - } - return new DiskImpl(inner.name(), inner, this.manager()); - } - - @Override - public Disk.DefinitionStages.Blank define(String name) { - return this.wrapModel(name); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/EncryptionExtensionIdentifier.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/EncryptionExtensionIdentifier.java deleted file mode 100644 index 4935d268f560..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/EncryptionExtensionIdentifier.java +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.implementation; - -import com.azure.resourcemanager.compute.models.OperatingSystemTypes; - -/** An internal type expose utility methods around encryption extension identifier. */ -class EncryptionExtensionIdentifier { - // - private static final String ENCRYPTION_EXTENSION_PUBLISHER = "Microsoft.Azure.Security"; - // - private static final String LINUX_LEGACY_ENCRYPTION_EXTENSION_VERSION = "0.1"; - private static final String LINUX_NOAAD_ENCRYPTION_EXTENSION_VERSION = "1.1"; - // - private static final String WINDOWS_LEGACY_ENCRYPTION_EXTENSION_VERSION = "1.1"; - private static final String WINDOWS_NOAAD_ENCRYPTION_EXTENSION_VERSION = "2.2"; - // - private static final String LINUX_ENCRYPTION_TYPE_NAME = "AzureDiskEncryptionForLinux"; - private static final String WINDOWS_ENCRYPTION_TYPE_NAME = "AzureDiskEncryption"; - - /** @return encryption extension publisher name */ - static String publisherName() { - return ENCRYPTION_EXTENSION_PUBLISHER; - } - - /** @return OS specific encryption extension type */ - static String typeName(OperatingSystemTypes osType) { - if (osType == OperatingSystemTypes.LINUX) { - return LINUX_ENCRYPTION_TYPE_NAME; - } else { - return WINDOWS_ENCRYPTION_TYPE_NAME; - } - } - - /** - * Given os type and no aad flag return the encryption extension version. - * - * @param osType os type - * @param isNoAAD no aad flag - * @return the encryption extension version - */ - static String version(OperatingSystemTypes osType, boolean isNoAAD) { - if (osType == OperatingSystemTypes.LINUX) { - return isNoAAD ? LINUX_NOAAD_ENCRYPTION_EXTENSION_VERSION : LINUX_LEGACY_ENCRYPTION_EXTENSION_VERSION; - } else { - return isNoAAD ? WINDOWS_NOAAD_ENCRYPTION_EXTENSION_VERSION : WINDOWS_LEGACY_ENCRYPTION_EXTENSION_VERSION; - } - } - - /** - * Checks whether the given version is a legacy extension version or no-aad extension version for the given OS type. - * - * @param osType os type - * @param version extension version - * @return true if legacy false otherwise. - */ - static boolean isNoAADVersion(OperatingSystemTypes osType, String version) { - final String majorVersion = version.split("\\.")[0]; - if (osType == OperatingSystemTypes.LINUX) { - return majorVersion.equals(LINUX_NOAAD_ENCRYPTION_EXTENSION_VERSION.split("\\.")[0]); - } else { - return majorVersion.equals(WINDOWS_NOAAD_ENCRYPTION_EXTENSION_VERSION.split("\\.")[0]); - } - } - - /** - * Checks whether the given publisher name is encryption publisher name. - * - * @param publisherName publisher name - * @return true if the given publisher name is encryption publisher name, false otherwise - */ - static boolean isEncryptionPublisherName(String publisherName) { - return publisherName.equalsIgnoreCase(EncryptionExtensionIdentifier.publisherName()); - } - - /** - * Checks whether the given type name is an encryption type name for given OS type. - * - * @param typeName type name - * @param osType the os type - * @return true if the given type name is encryption type name, false otherwise - */ - static boolean isEncryptionTypeName(String typeName, OperatingSystemTypes osType) { - return typeName.equalsIgnoreCase(EncryptionExtensionIdentifier.typeName(osType)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/EncryptionSettings.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/EncryptionSettings.java deleted file mode 100644 index d6bdb6b97b2b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/EncryptionSettings.java +++ /dev/null @@ -1,175 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.implementation; - -import com.azure.core.management.SubResource; -import com.azure.resourcemanager.compute.models.DiskEncryptionSettings; -import com.azure.resourcemanager.compute.models.DiskVolumeType; -import com.azure.resourcemanager.compute.models.KeyVaultKeyReference; -import com.azure.resourcemanager.compute.models.KeyVaultSecretReference; -import com.azure.resourcemanager.compute.models.OperatingSystemTypes; -import com.azure.resourcemanager.compute.models.VirtualMachineEncryptionConfiguration; -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.UUID; - -/** Internal base type exposing settings to enable and disable disk encryption extension. */ -abstract class EncryptionSettings { - /** @return encryption specific settings to be set on virtual machine storage profile */ - abstract DiskEncryptionSettings storageProfileEncryptionSettings(); - /** @return encryption extension public settings */ - abstract HashMap extensionPublicSettings(); - /** @return encryption extension protected settings */ - abstract HashMap extensionProtectedSettings(); - - /** - * Creates an instance of type representing settings to enable encryption. - * - * @param config the user provided encryption configuration - * @param the config type - * @return enable settings - */ - static > Enable createEnable( - final VirtualMachineEncryptionConfiguration config) { - return new Enable(config); - } - - /** - * Creates an instance of type representing settings to disable encryption. - * - * @param volumeType the disk volume that user required to disable encryption for - * @return disable settings - */ - static Disable createDisable(final DiskVolumeType volumeType) { - return new EncryptionSettings.Disable(volumeType); - } - - /** - * Internal type exposing settings for enabling disk encryption. - * - * @param - */ - static class Enable> extends EncryptionSettings { - private final VirtualMachineEncryptionConfiguration config; - - Enable(final VirtualMachineEncryptionConfiguration config) { - this.config = config; - } - - @Override - DiskEncryptionSettings storageProfileEncryptionSettings() { - KeyVaultKeyReference keyEncryptionKey = null; - if (config.keyEncryptionKeyUrl() != null) { - keyEncryptionKey = new KeyVaultKeyReference(); - keyEncryptionKey.withKeyUrl(config.keyEncryptionKeyUrl()); - if (config.keyEncryptionKeyVaultId() != null) { - keyEncryptionKey.withSourceVault(new SubResource().withId(config.keyEncryptionKeyVaultId())); - } - } - DiskEncryptionSettings diskEncryptionSettings = new DiskEncryptionSettings(); - diskEncryptionSettings - .withEnabled(true) - .withKeyEncryptionKey(keyEncryptionKey) - .withDiskEncryptionKey(new KeyVaultSecretReference()) - .diskEncryptionKey() - .withSourceVault(new SubResource().withId(config.keyVaultId())); - return diskEncryptionSettings; - } - - @Override - HashMap extensionPublicSettings() { - HashMap publicSettings = new LinkedHashMap<>(); - publicSettings.put("EncryptionOperation", "EnableEncryption"); - publicSettings.put("KeyEncryptionAlgorithm", config.volumeEncryptionKeyEncryptAlgorithm()); - publicSettings.put("KeyVaultURL", config.keyVaultUrl()); // KeyVault to hold "Disk Encryption Key". - publicSettings.put("VolumeType", config.volumeType().toString()); - publicSettings.put("SequenceVersion", UUID.randomUUID()); - if (config.keyEncryptionKeyUrl() != null) { - publicSettings - .put( - "KeyEncryptionKeyURL", - config.keyEncryptionKeyUrl()); // KeyVault to hold Key for encrypting "Disk Encryption Key" (aka - // kek). - } - if (this.requestedForLegacyEncryptExtension()) { - // Legacy-Encrypt-Extension requires AAD credentials (AADClientID in PublicSettings & AADClientSecret in - // ProtectedSettings) to access KeyVault. - publicSettings.put("AADClientID", config.aadClientId()); - } else { - // Without AAD credentials (AADClientID in PublicSettings & AADClientSecret in ProtectedSettings) to - // access KeyVault, - // ARM resource id of KeyVaults are required. - // - publicSettings.put("KeyVaultResourceId", config.keyVaultId()); - if (config.keyEncryptionKeyUrl() != null && config.keyEncryptionKeyVaultId() != null) { - publicSettings.put("KekVaultResourceId", config.keyEncryptionKeyVaultId()); - } - } - return publicSettings; - } - - @Override - HashMap extensionProtectedSettings() { - if (this.requestedForLegacyEncryptExtension()) { - HashMap protectedSettings = new LinkedHashMap<>(); - // NoAAD-Encrypt-Extension requires AAD credentials (AADClientID in PublicSettings & AADClientSecret in - // ProtectedSettings) to access KeyVault. - protectedSettings.put("AADClientSecret", config.aadSecret()); - if (config.osType() == OperatingSystemTypes.LINUX && config.linuxPassPhrase() != null) { - protectedSettings.put("Passphrase", config.linuxPassPhrase()); - } - return protectedSettings; - } else { - // No protected settings for NoAAD-Encrypt-Extension. - // - return new LinkedHashMap<>(); - } - } - - /** @return the encryption version based on user selected OS and encryption extension. */ - String encryptionExtensionVersion() { - return EncryptionExtensionIdentifier.version(this.config.osType(), requestedForNoAADEncryptExtension()); - } - - /** @return true if user requested for NoAAD-Encrypt-Extension. */ - boolean requestedForNoAADEncryptExtension() { - return this.config.aadClientId() == null && this.config.aadSecret() == null; - } - - /** @return true if user requested for Legacy-Encrypt-Extension. */ - boolean requestedForLegacyEncryptExtension() { - return !requestedForNoAADEncryptExtension(); - } - } - - /** Internal type exposing settings for disabling disk encryption. */ - static class Disable extends EncryptionSettings { - private final DiskVolumeType volumeType; - - Disable(final DiskVolumeType volumeType) { - this.volumeType = volumeType; - } - - @Override - DiskEncryptionSettings storageProfileEncryptionSettings() { - DiskEncryptionSettings diskEncryptionSettings = new DiskEncryptionSettings(); - diskEncryptionSettings.withEnabled(false); - return diskEncryptionSettings; - } - - @Override - HashMap extensionPublicSettings() { - HashMap publicSettings = new LinkedHashMap<>(); - publicSettings.put("EncryptionOperation", "DisableEncryption"); - publicSettings.put("SequenceVersion", UUID.randomUUID()); - publicSettings.put("VolumeType", this.volumeType); - return publicSettings; - } - - @Override - HashMap extensionProtectedSettings() { - return new LinkedHashMap<>(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/GalleriesClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/GalleriesClientImpl.java deleted file mode 100644 index a6932b88c360..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/GalleriesClientImpl.java +++ /dev/null @@ -1,1548 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.compute.fluent.GalleriesClient; -import com.azure.resourcemanager.compute.fluent.models.GalleryInner; -import com.azure.resourcemanager.compute.models.ApiErrorException; -import com.azure.resourcemanager.compute.models.GalleryList; -import com.azure.resourcemanager.compute.models.GalleryUpdate; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in GalleriesClient. */ -public final class GalleriesClientImpl - implements InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete, - GalleriesClient { - private final ClientLogger logger = new ClientLogger(GalleriesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final GalleriesService service; - - /** The service client containing this operation class. */ - private final ComputeManagementClientImpl client; - - /** - * Initializes an instance of GalleriesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - GalleriesClientImpl(ComputeManagementClientImpl client) { - this.service = - RestProxy.create(GalleriesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for ComputeManagementClientGalleries to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "ComputeManagementCli") - private interface GalleriesService { - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" - + "/{galleryName}") - @ExpectedResponses({200, 201, 202}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("galleryName") String galleryName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") GalleryInner gallery, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" - + "/{galleryName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono>> update( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("galleryName") String galleryName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") GalleryUpdate gallery, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" - + "/{galleryName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("galleryName") String galleryName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" - + "/{galleryName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("galleryName") String galleryName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/galleries") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Create or update a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with - * dots and periods allowed in the middle. The maximum length is 80 characters. - * @param gallery Parameters supplied to the create or update Shared Image Gallery operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Shared Image Gallery that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String galleryName, GalleryInner gallery) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (gallery == null) { - return Mono.error(new IllegalArgumentException("Parameter gallery is required and cannot be null.")); - } else { - gallery.validate(); - } - final String apiVersion = "2019-12-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - apiVersion, - gallery, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create or update a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with - * dots and periods allowed in the middle. The maximum length is 80 characters. - * @param gallery Parameters supplied to the create or update Shared Image Gallery operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Shared Image Gallery that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String galleryName, GalleryInner gallery, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (gallery == null) { - return Mono.error(new IllegalArgumentException("Parameter gallery is required and cannot be null.")); - } else { - gallery.validate(); - } - final String apiVersion = "2019-12-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - apiVersion, - gallery, - accept, - context); - } - - /** - * Create or update a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with - * dots and periods allowed in the middle. The maximum length is 80 characters. - * @param gallery Parameters supplied to the create or update Shared Image Gallery operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Shared Image Gallery that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, GalleryInner> beginCreateOrUpdateAsync( - String resourceGroupName, String galleryName, GalleryInner gallery) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, galleryName, gallery); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), GalleryInner.class, GalleryInner.class, this.client.getContext()); - } - - /** - * Create or update a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with - * dots and periods allowed in the middle. The maximum length is 80 characters. - * @param gallery Parameters supplied to the create or update Shared Image Gallery operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Shared Image Gallery that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, GalleryInner> beginCreateOrUpdateAsync( - String resourceGroupName, String galleryName, GalleryInner gallery, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, galleryName, gallery, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), GalleryInner.class, GalleryInner.class, context); - } - - /** - * Create or update a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with - * dots and periods allowed in the middle. The maximum length is 80 characters. - * @param gallery Parameters supplied to the create or update Shared Image Gallery operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Shared Image Gallery that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, GalleryInner> beginCreateOrUpdate( - String resourceGroupName, String galleryName, GalleryInner gallery) { - return beginCreateOrUpdateAsync(resourceGroupName, galleryName, gallery).getSyncPoller(); - } - - /** - * Create or update a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with - * dots and periods allowed in the middle. The maximum length is 80 characters. - * @param gallery Parameters supplied to the create or update Shared Image Gallery operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Shared Image Gallery that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, GalleryInner> beginCreateOrUpdate( - String resourceGroupName, String galleryName, GalleryInner gallery, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, galleryName, gallery, context).getSyncPoller(); - } - - /** - * Create or update a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with - * dots and periods allowed in the middle. The maximum length is 80 characters. - * @param gallery Parameters supplied to the create or update Shared Image Gallery operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Shared Image Gallery that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync(String resourceGroupName, String galleryName, GalleryInner gallery) { - return beginCreateOrUpdateAsync(resourceGroupName, galleryName, gallery) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create or update a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with - * dots and periods allowed in the middle. The maximum length is 80 characters. - * @param gallery Parameters supplied to the create or update Shared Image Gallery operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Shared Image Gallery that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String galleryName, GalleryInner gallery, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, galleryName, gallery, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create or update a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with - * dots and periods allowed in the middle. The maximum length is 80 characters. - * @param gallery Parameters supplied to the create or update Shared Image Gallery operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Shared Image Gallery that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryInner createOrUpdate(String resourceGroupName, String galleryName, GalleryInner gallery) { - return createOrUpdateAsync(resourceGroupName, galleryName, gallery).block(); - } - - /** - * Create or update a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with - * dots and periods allowed in the middle. The maximum length is 80 characters. - * @param gallery Parameters supplied to the create or update Shared Image Gallery operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Shared Image Gallery that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryInner createOrUpdate( - String resourceGroupName, String galleryName, GalleryInner gallery, Context context) { - return createOrUpdateAsync(resourceGroupName, galleryName, gallery, context).block(); - } - - /** - * Update a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with - * dots and periods allowed in the middle. The maximum length is 80 characters. - * @param gallery Parameters supplied to the update Shared Image Gallery operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Shared Image Gallery that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateWithResponseAsync( - String resourceGroupName, String galleryName, GalleryUpdate gallery) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (gallery == null) { - return Mono.error(new IllegalArgumentException("Parameter gallery is required and cannot be null.")); - } else { - gallery.validate(); - } - final String apiVersion = "2019-12-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - apiVersion, - gallery, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Update a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with - * dots and periods allowed in the middle. The maximum length is 80 characters. - * @param gallery Parameters supplied to the update Shared Image Gallery operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Shared Image Gallery that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, String galleryName, GalleryUpdate gallery, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (gallery == null) { - return Mono.error(new IllegalArgumentException("Parameter gallery is required and cannot be null.")); - } else { - gallery.validate(); - } - final String apiVersion = "2019-12-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - apiVersion, - gallery, - accept, - context); - } - - /** - * Update a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with - * dots and periods allowed in the middle. The maximum length is 80 characters. - * @param gallery Parameters supplied to the update Shared Image Gallery operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Shared Image Gallery that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, GalleryInner> beginUpdateAsync( - String resourceGroupName, String galleryName, GalleryUpdate gallery) { - Mono>> mono = updateWithResponseAsync(resourceGroupName, galleryName, gallery); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), GalleryInner.class, GalleryInner.class, this.client.getContext()); - } - - /** - * Update a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with - * dots and periods allowed in the middle. The maximum length is 80 characters. - * @param gallery Parameters supplied to the update Shared Image Gallery operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Shared Image Gallery that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, GalleryInner> beginUpdateAsync( - String resourceGroupName, String galleryName, GalleryUpdate gallery, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - updateWithResponseAsync(resourceGroupName, galleryName, gallery, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), GalleryInner.class, GalleryInner.class, context); - } - - /** - * Update a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with - * dots and periods allowed in the middle. The maximum length is 80 characters. - * @param gallery Parameters supplied to the update Shared Image Gallery operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Shared Image Gallery that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, GalleryInner> beginUpdate( - String resourceGroupName, String galleryName, GalleryUpdate gallery) { - return beginUpdateAsync(resourceGroupName, galleryName, gallery).getSyncPoller(); - } - - /** - * Update a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with - * dots and periods allowed in the middle. The maximum length is 80 characters. - * @param gallery Parameters supplied to the update Shared Image Gallery operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Shared Image Gallery that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, GalleryInner> beginUpdate( - String resourceGroupName, String galleryName, GalleryUpdate gallery, Context context) { - return beginUpdateAsync(resourceGroupName, galleryName, gallery, context).getSyncPoller(); - } - - /** - * Update a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with - * dots and periods allowed in the middle. The maximum length is 80 characters. - * @param gallery Parameters supplied to the update Shared Image Gallery operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Shared Image Gallery that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync(String resourceGroupName, String galleryName, GalleryUpdate gallery) { - return beginUpdateAsync(resourceGroupName, galleryName, gallery) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Update a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with - * dots and periods allowed in the middle. The maximum length is 80 characters. - * @param gallery Parameters supplied to the update Shared Image Gallery operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Shared Image Gallery that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, String galleryName, GalleryUpdate gallery, Context context) { - return beginUpdateAsync(resourceGroupName, galleryName, gallery, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Update a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with - * dots and periods allowed in the middle. The maximum length is 80 characters. - * @param gallery Parameters supplied to the update Shared Image Gallery operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Shared Image Gallery that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryInner update(String resourceGroupName, String galleryName, GalleryUpdate gallery) { - return updateAsync(resourceGroupName, galleryName, gallery).block(); - } - - /** - * Update a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with - * dots and periods allowed in the middle. The maximum length is 80 characters. - * @param gallery Parameters supplied to the update Shared Image Gallery operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Shared Image Gallery that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryInner update(String resourceGroupName, String galleryName, GalleryUpdate gallery, Context context) { - return updateAsync(resourceGroupName, galleryName, gallery, context).block(); - } - - /** - * Retrieves information about a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Shared Image Gallery that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String galleryName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - apiVersion, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Retrieves information about a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Shared Image Gallery that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String galleryName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - apiVersion, - accept, - context); - } - - /** - * Retrieves information about a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Shared Image Gallery that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync(String resourceGroupName, String galleryName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, galleryName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Retrieves information about a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Shared Image Gallery that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryInner getByResourceGroup(String resourceGroupName, String galleryName) { - return getByResourceGroupAsync(resourceGroupName, galleryName).block(); - } - - /** - * Retrieves information about a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Shared Image Gallery that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String galleryName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, galleryName, context).block(); - } - - /** - * Delete a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery to be deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync(String resourceGroupName, String galleryName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - apiVersion, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery to be deleted. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String galleryName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - apiVersion, - accept, - context); - } - - /** - * Delete a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery to be deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String galleryName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, galleryName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Delete a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery to be deleted. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String galleryName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(resourceGroupName, galleryName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Delete a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery to be deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete(String resourceGroupName, String galleryName) { - return beginDeleteAsync(resourceGroupName, galleryName).getSyncPoller(); - } - - /** - * Delete a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery to be deleted. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String galleryName, Context context) { - return beginDeleteAsync(resourceGroupName, galleryName, context).getSyncPoller(); - } - - /** - * Delete a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery to be deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String galleryName) { - return beginDeleteAsync(resourceGroupName, galleryName).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Delete a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery to be deleted. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String galleryName, Context context) { - return beginDeleteAsync(resourceGroupName, galleryName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Delete a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery to be deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String galleryName) { - deleteAsync(resourceGroupName, galleryName).block(); - } - - /** - * Delete a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery to be deleted. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String galleryName, Context context) { - deleteAsync(resourceGroupName, galleryName, context).block(); - } - - /** - * List galleries under a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Galleries operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - apiVersion, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List galleries under a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Galleries operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - apiVersion, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * List galleries under a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Galleries operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * List galleries under a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Galleries operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * List galleries under a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Galleries operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * List galleries under a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Galleries operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * List galleries under a subscription. - * - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Galleries operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List galleries under a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Galleries operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * List galleries under a subscription. - * - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Galleries operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List galleries under a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Galleries operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * List galleries under a subscription. - * - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Galleries operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * List galleries under a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Galleries operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Galleries operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Galleries operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Galleries operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Galleries operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/GalleriesImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/GalleriesImpl.java deleted file mode 100644 index c7572ccd1a58..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/GalleriesImpl.java +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.CoreUtils; -import com.azure.resourcemanager.compute.ComputeManager; -import com.azure.resourcemanager.compute.models.Galleries; -import com.azure.resourcemanager.compute.models.Gallery; -import com.azure.resourcemanager.compute.fluent.GalleriesClient; -import com.azure.resourcemanager.compute.fluent.models.GalleryInner; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.BatchDeletionImpl; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.GroupableResourcesImpl; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; -import com.azure.resourcemanager.resources.fluentcore.utils.PagedConverter; - -/** The implementation for Galleries. */ -public class GalleriesImpl - extends GroupableResourcesImpl - implements Galleries { - public GalleriesImpl(ComputeManager manager) { - super(manager.serviceClient().getGalleries(), manager); - } - - @Override - protected Mono getInnerAsync(String resourceGroupName, String name) { - return inner().getByResourceGroupAsync(resourceGroupName, name); - } - - @Override - protected Mono deleteInnerAsync(String resourceGroupName, String name) { - return inner().deleteAsync(resourceGroupName, name); - } - - @Override - public Flux deleteByIdsAsync(Collection ids) { - return BatchDeletionImpl.deleteByIdsAsync(ids, this::deleteInnerAsync); - } - - @Override - public Flux deleteByIdsAsync(String... ids) { - return this.deleteByIdsAsync(new ArrayList<>(Arrays.asList(ids))); - } - - @Override - public void deleteByIds(Collection ids) { - if (ids != null && !ids.isEmpty()) { - this.deleteByIdsAsync(ids).last().block(); - } - } - - @Override - public void deleteByIds(String... ids) { - this.deleteByIds(new ArrayList<>(Arrays.asList(ids))); - } - - @Override - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(this.listByResourceGroupAsync(resourceGroupName)); - } - - @Override - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - if (CoreUtils.isNullOrEmpty(resourceGroupName)) { - return new PagedFlux<>(() -> Mono.error( - new IllegalArgumentException("Parameter 'resourceGroupName' is required and cannot be null."))); - } - return PagedConverter.mapPage(inner().listByResourceGroupAsync(resourceGroupName), this::wrapModel); - } - - @Override - public PagedIterable list() { - return this.wrapList(inner().list()); - } - - @Override - public PagedFlux listAsync() { - return PagedConverter.mapPage(inner().listAsync(), this::wrapModel); - } - - @Override - public GalleryImpl define(String name) { - return wrapModel(name); - } - - @Override - protected GalleryImpl wrapModel(GalleryInner inner) { - return new GalleryImpl(inner.name(), inner, manager()); - } - - @Override - protected GalleryImpl wrapModel(String name) { - return new GalleryImpl(name, new GalleryInner(), this.manager()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/GalleryApplicationVersionsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/GalleryApplicationVersionsClientImpl.java deleted file mode 100644 index c20b80f13224..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/GalleryApplicationVersionsClientImpl.java +++ /dev/null @@ -1,1962 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.compute.fluent.GalleryApplicationVersionsClient; -import com.azure.resourcemanager.compute.fluent.models.GalleryApplicationVersionInner; -import com.azure.resourcemanager.compute.models.ApiErrorException; -import com.azure.resourcemanager.compute.models.GalleryApplicationVersionList; -import com.azure.resourcemanager.compute.models.GalleryApplicationVersionUpdate; -import com.azure.resourcemanager.compute.models.ReplicationStatusTypes; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in GalleryApplicationVersionsClient. */ -public final class GalleryApplicationVersionsClientImpl implements GalleryApplicationVersionsClient { - private final ClientLogger logger = new ClientLogger(GalleryApplicationVersionsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final GalleryApplicationVersionsService service; - - /** The service client containing this operation class. */ - private final ComputeManagementClientImpl client; - - /** - * Initializes an instance of GalleryApplicationVersionsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - GalleryApplicationVersionsClientImpl(ComputeManagementClientImpl client) { - this.service = - RestProxy - .create( - GalleryApplicationVersionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for ComputeManagementClientGalleryApplicationVersions to be used by the - * proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "ComputeManagementCli") - private interface GalleryApplicationVersionsService { - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" - + "/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}") - @ExpectedResponses({200, 201, 202}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("galleryName") String galleryName, - @PathParam("galleryApplicationName") String galleryApplicationName, - @PathParam("galleryApplicationVersionName") String galleryApplicationVersionName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") GalleryApplicationVersionInner galleryApplicationVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" - + "/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono>> update( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("galleryName") String galleryName, - @PathParam("galleryApplicationName") String galleryApplicationName, - @PathParam("galleryApplicationVersionName") String galleryApplicationVersionName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") GalleryApplicationVersionUpdate galleryApplicationVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" - + "/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("galleryName") String galleryName, - @PathParam("galleryApplicationName") String galleryApplicationName, - @PathParam("galleryApplicationVersionName") String galleryApplicationVersionName, - @QueryParam("$expand") ReplicationStatusTypes expand, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" - + "/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("galleryName") String galleryName, - @PathParam("galleryApplicationName") String galleryApplicationName, - @PathParam("galleryApplicationVersionName") String galleryApplicationVersionName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" - + "/{galleryName}/applications/{galleryApplicationName}/versions") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> listByGalleryApplication( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("galleryName") String galleryName, - @PathParam("galleryApplicationName") String galleryApplicationName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> listByGalleryApplicationNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Create or update a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is - * to be created. - * @param galleryApplicationVersionName The name of the gallery Application Version to be created. Needs to follow - * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range - * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryApplicationVersion Parameters supplied to the create or update gallery Application Version - * operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName, - GalleryApplicationVersionInner galleryApplicationVersion) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryApplicationName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); - } - if (galleryApplicationVersionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter galleryApplicationVersionName is required and cannot be null.")); - } - if (galleryApplicationVersion == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter galleryApplicationVersion is required and cannot be null.")); - } else { - galleryApplicationVersion.validate(); - } - final String apiVersion = "2019-12-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplicationVersionName, - apiVersion, - galleryApplicationVersion, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create or update a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is - * to be created. - * @param galleryApplicationVersionName The name of the gallery Application Version to be created. Needs to follow - * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range - * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryApplicationVersion Parameters supplied to the create or update gallery Application Version - * operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName, - GalleryApplicationVersionInner galleryApplicationVersion, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryApplicationName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); - } - if (galleryApplicationVersionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter galleryApplicationVersionName is required and cannot be null.")); - } - if (galleryApplicationVersion == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter galleryApplicationVersion is required and cannot be null.")); - } else { - galleryApplicationVersion.validate(); - } - final String apiVersion = "2019-12-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplicationVersionName, - apiVersion, - galleryApplicationVersion, - accept, - context); - } - - /** - * Create or update a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is - * to be created. - * @param galleryApplicationVersionName The name of the gallery Application Version to be created. Needs to follow - * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range - * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryApplicationVersion Parameters supplied to the create or update gallery Application Version - * operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, GalleryApplicationVersionInner> - beginCreateOrUpdateAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName, - GalleryApplicationVersionInner galleryApplicationVersion) { - Mono>> mono = - createOrUpdateWithResponseAsync( - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplicationVersionName, - galleryApplicationVersion); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - GalleryApplicationVersionInner.class, - GalleryApplicationVersionInner.class, - Context.NONE); - } - - /** - * Create or update a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is - * to be created. - * @param galleryApplicationVersionName The name of the gallery Application Version to be created. Needs to follow - * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range - * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryApplicationVersion Parameters supplied to the create or update gallery Application Version - * operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, GalleryApplicationVersionInner> - beginCreateOrUpdateAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName, - GalleryApplicationVersionInner galleryApplicationVersion, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync( - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplicationVersionName, - galleryApplicationVersion, - context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - GalleryApplicationVersionInner.class, - GalleryApplicationVersionInner.class, - context); - } - - /** - * Create or update a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is - * to be created. - * @param galleryApplicationVersionName The name of the gallery Application Version to be created. Needs to follow - * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range - * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryApplicationVersion Parameters supplied to the create or update gallery Application Version - * operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, GalleryApplicationVersionInner> beginCreateOrUpdate( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName, - GalleryApplicationVersionInner galleryApplicationVersion) { - return beginCreateOrUpdateAsync( - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplicationVersionName, - galleryApplicationVersion) - .getSyncPoller(); - } - - /** - * Create or update a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is - * to be created. - * @param galleryApplicationVersionName The name of the gallery Application Version to be created. Needs to follow - * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range - * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryApplicationVersion Parameters supplied to the create or update gallery Application Version - * operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, GalleryApplicationVersionInner> beginCreateOrUpdate( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName, - GalleryApplicationVersionInner galleryApplicationVersion, - Context context) { - return beginCreateOrUpdateAsync( - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplicationVersionName, - galleryApplicationVersion, - context) - .getSyncPoller(); - } - - /** - * Create or update a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is - * to be created. - * @param galleryApplicationVersionName The name of the gallery Application Version to be created. Needs to follow - * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range - * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryApplicationVersion Parameters supplied to the create or update gallery Application Version - * operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName, - GalleryApplicationVersionInner galleryApplicationVersion) { - return beginCreateOrUpdateAsync( - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplicationVersionName, - galleryApplicationVersion) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create or update a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is - * to be created. - * @param galleryApplicationVersionName The name of the gallery Application Version to be created. Needs to follow - * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range - * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryApplicationVersion Parameters supplied to the create or update gallery Application Version - * operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName, - GalleryApplicationVersionInner galleryApplicationVersion, - Context context) { - return beginCreateOrUpdateAsync( - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplicationVersionName, - galleryApplicationVersion, - context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create or update a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is - * to be created. - * @param galleryApplicationVersionName The name of the gallery Application Version to be created. Needs to follow - * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range - * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryApplicationVersion Parameters supplied to the create or update gallery Application Version - * operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryApplicationVersionInner createOrUpdate( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName, - GalleryApplicationVersionInner galleryApplicationVersion) { - return createOrUpdateAsync( - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplicationVersionName, - galleryApplicationVersion) - .block(); - } - - /** - * Create or update a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is - * to be created. - * @param galleryApplicationVersionName The name of the gallery Application Version to be created. Needs to follow - * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range - * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryApplicationVersion Parameters supplied to the create or update gallery Application Version - * operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryApplicationVersionInner createOrUpdate( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName, - GalleryApplicationVersionInner galleryApplicationVersion, - Context context) { - return createOrUpdateAsync( - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplicationVersionName, - galleryApplicationVersion, - context) - .block(); - } - - /** - * Update a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is - * to be updated. - * @param galleryApplicationVersionName The name of the gallery Application Version to be updated. Needs to follow - * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range - * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryApplicationVersion Parameters supplied to the update gallery Application Version operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateWithResponseAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName, - GalleryApplicationVersionUpdate galleryApplicationVersion) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryApplicationName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); - } - if (galleryApplicationVersionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter galleryApplicationVersionName is required and cannot be null.")); - } - if (galleryApplicationVersion == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter galleryApplicationVersion is required and cannot be null.")); - } else { - galleryApplicationVersion.validate(); - } - final String apiVersion = "2019-12-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplicationVersionName, - apiVersion, - galleryApplicationVersion, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Update a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is - * to be updated. - * @param galleryApplicationVersionName The name of the gallery Application Version to be updated. Needs to follow - * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range - * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryApplicationVersion Parameters supplied to the update gallery Application Version operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName, - GalleryApplicationVersionUpdate galleryApplicationVersion, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryApplicationName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); - } - if (galleryApplicationVersionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter galleryApplicationVersionName is required and cannot be null.")); - } - if (galleryApplicationVersion == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter galleryApplicationVersion is required and cannot be null.")); - } else { - galleryApplicationVersion.validate(); - } - final String apiVersion = "2019-12-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplicationVersionName, - apiVersion, - galleryApplicationVersion, - accept, - context); - } - - /** - * Update a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is - * to be updated. - * @param galleryApplicationVersionName The name of the gallery Application Version to be updated. Needs to follow - * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range - * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryApplicationVersion Parameters supplied to the update gallery Application Version operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, GalleryApplicationVersionInner> beginUpdateAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName, - GalleryApplicationVersionUpdate galleryApplicationVersion) { - Mono>> mono = - updateWithResponseAsync( - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplicationVersionName, - galleryApplicationVersion); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - GalleryApplicationVersionInner.class, - GalleryApplicationVersionInner.class, - Context.NONE); - } - - /** - * Update a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is - * to be updated. - * @param galleryApplicationVersionName The name of the gallery Application Version to be updated. Needs to follow - * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range - * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryApplicationVersion Parameters supplied to the update gallery Application Version operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, GalleryApplicationVersionInner> beginUpdateAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName, - GalleryApplicationVersionUpdate galleryApplicationVersion, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - updateWithResponseAsync( - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplicationVersionName, - galleryApplicationVersion, - context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - GalleryApplicationVersionInner.class, - GalleryApplicationVersionInner.class, - context); - } - - /** - * Update a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is - * to be updated. - * @param galleryApplicationVersionName The name of the gallery Application Version to be updated. Needs to follow - * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range - * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryApplicationVersion Parameters supplied to the update gallery Application Version operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, GalleryApplicationVersionInner> beginUpdate( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName, - GalleryApplicationVersionUpdate galleryApplicationVersion) { - return beginUpdateAsync( - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplicationVersionName, - galleryApplicationVersion) - .getSyncPoller(); - } - - /** - * Update a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is - * to be updated. - * @param galleryApplicationVersionName The name of the gallery Application Version to be updated. Needs to follow - * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range - * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryApplicationVersion Parameters supplied to the update gallery Application Version operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, GalleryApplicationVersionInner> beginUpdate( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName, - GalleryApplicationVersionUpdate galleryApplicationVersion, - Context context) { - return beginUpdateAsync( - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplicationVersionName, - galleryApplicationVersion, - context) - .getSyncPoller(); - } - - /** - * Update a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is - * to be updated. - * @param galleryApplicationVersionName The name of the gallery Application Version to be updated. Needs to follow - * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range - * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryApplicationVersion Parameters supplied to the update gallery Application Version operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName, - GalleryApplicationVersionUpdate galleryApplicationVersion) { - return beginUpdateAsync( - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplicationVersionName, - galleryApplicationVersion) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Update a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is - * to be updated. - * @param galleryApplicationVersionName The name of the gallery Application Version to be updated. Needs to follow - * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range - * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryApplicationVersion Parameters supplied to the update gallery Application Version operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName, - GalleryApplicationVersionUpdate galleryApplicationVersion, - Context context) { - return beginUpdateAsync( - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplicationVersionName, - galleryApplicationVersion, - context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Update a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is - * to be updated. - * @param galleryApplicationVersionName The name of the gallery Application Version to be updated. Needs to follow - * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range - * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryApplicationVersion Parameters supplied to the update gallery Application Version operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryApplicationVersionInner update( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName, - GalleryApplicationVersionUpdate galleryApplicationVersion) { - return updateAsync( - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplicationVersionName, - galleryApplicationVersion) - .block(); - } - - /** - * Update a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is - * to be updated. - * @param galleryApplicationVersionName The name of the gallery Application Version to be updated. Needs to follow - * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range - * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryApplicationVersion Parameters supplied to the update gallery Application Version operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryApplicationVersionInner update( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName, - GalleryApplicationVersionUpdate galleryApplicationVersion, - Context context) { - return updateAsync( - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplicationVersionName, - galleryApplicationVersion, - context) - .block(); - } - - /** - * Retrieves information about a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version - * resides. - * @param galleryApplicationVersionName The name of the gallery Application Version to be retrieved. - * @param expand The expand expression to apply on the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName, - ReplicationStatusTypes expand) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryApplicationName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); - } - if (galleryApplicationVersionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter galleryApplicationVersionName is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplicationVersionName, - expand, - apiVersion, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Retrieves information about a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version - * resides. - * @param galleryApplicationVersionName The name of the gallery Application Version to be retrieved. - * @param expand The expand expression to apply on the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName, - ReplicationStatusTypes expand, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryApplicationName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); - } - if (galleryApplicationVersionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter galleryApplicationVersionName is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplicationVersionName, - expand, - apiVersion, - accept, - context); - } - - /** - * Retrieves information about a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version - * resides. - * @param galleryApplicationVersionName The name of the gallery Application Version to be retrieved. - * @param expand The expand expression to apply on the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName, - ReplicationStatusTypes expand) { - return getWithResponseAsync( - resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Retrieves information about a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version - * resides. - * @param galleryApplicationVersionName The name of the gallery Application Version to be retrieved. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName) { - final ReplicationStatusTypes expand = null; - return getWithResponseAsync( - resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Retrieves information about a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version - * resides. - * @param galleryApplicationVersionName The name of the gallery Application Version to be retrieved. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryApplicationVersionInner get( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName) { - final ReplicationStatusTypes expand = null; - return getAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, expand) - .block(); - } - - /** - * Retrieves information about a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version - * resides. - * @param galleryApplicationVersionName The name of the gallery Application Version to be retrieved. - * @param expand The expand expression to apply on the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName, - ReplicationStatusTypes expand, - Context context) { - return getWithResponseAsync( - resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, expand, context) - .block(); - } - - /** - * Delete a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version - * resides. - * @param galleryApplicationVersionName The name of the gallery Application Version to be deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryApplicationName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); - } - if (galleryApplicationVersionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter galleryApplicationVersionName is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplicationVersionName, - apiVersion, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version - * resides. - * @param galleryApplicationVersionName The name of the gallery Application Version to be deleted. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryApplicationName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); - } - if (galleryApplicationVersionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter galleryApplicationVersionName is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplicationVersionName, - apiVersion, - accept, - context); - } - - /** - * Delete a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version - * resides. - * @param galleryApplicationVersionName The name of the gallery Application Version to be deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName) { - Mono>> mono = - deleteWithResponseAsync( - resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Delete a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version - * resides. - * @param galleryApplicationVersionName The name of the gallery Application Version to be deleted. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync( - resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Delete a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version - * resides. - * @param galleryApplicationVersionName The name of the gallery Application Version to be deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName) { - return beginDeleteAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName) - .getSyncPoller(); - } - - /** - * Delete a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version - * resides. - * @param galleryApplicationVersionName The name of the gallery Application Version to be deleted. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName, - Context context) { - return beginDeleteAsync( - resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, context) - .getSyncPoller(); - } - - /** - * Delete a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version - * resides. - * @param galleryApplicationVersionName The name of the gallery Application Version to be deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName) { - return beginDeleteAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Delete a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version - * resides. - * @param galleryApplicationVersionName The name of the gallery Application Version to be deleted. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName, - Context context) { - return beginDeleteAsync( - resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Delete a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version - * resides. - * @param galleryApplicationVersionName The name of the gallery Application Version to be deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName) { - deleteAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName).block(); - } - - /** - * Delete a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version - * resides. - * @param galleryApplicationVersionName The name of the gallery Application Version to be deleted. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName, - Context context) { - deleteAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, context) - .block(); - } - - /** - * List gallery Application Versions in a gallery Application Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the Shared Application Gallery Application Definition from which the - * Application Versions are to be listed. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Gallery Application version operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByGalleryApplicationSinglePageAsync( - String resourceGroupName, String galleryName, String galleryApplicationName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryApplicationName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByGalleryApplication( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryApplicationName, - apiVersion, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List gallery Application Versions in a gallery Application Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the Shared Application Gallery Application Definition from which the - * Application Versions are to be listed. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Gallery Application version operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByGalleryApplicationSinglePageAsync( - String resourceGroupName, String galleryName, String galleryApplicationName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryApplicationName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByGalleryApplication( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryApplicationName, - apiVersion, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * List gallery Application Versions in a gallery Application Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the Shared Application Gallery Application Definition from which the - * Application Versions are to be listed. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Gallery Application version operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByGalleryApplicationAsync( - String resourceGroupName, String galleryName, String galleryApplicationName) { - return new PagedFlux<>( - () -> listByGalleryApplicationSinglePageAsync(resourceGroupName, galleryName, galleryApplicationName), - nextLink -> listByGalleryApplicationNextSinglePageAsync(nextLink)); - } - - /** - * List gallery Application Versions in a gallery Application Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the Shared Application Gallery Application Definition from which the - * Application Versions are to be listed. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Gallery Application version operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByGalleryApplicationAsync( - String resourceGroupName, String galleryName, String galleryApplicationName, Context context) { - return new PagedFlux<>( - () -> - listByGalleryApplicationSinglePageAsync( - resourceGroupName, galleryName, galleryApplicationName, context), - nextLink -> listByGalleryApplicationNextSinglePageAsync(nextLink, context)); - } - - /** - * List gallery Application Versions in a gallery Application Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the Shared Application Gallery Application Definition from which the - * Application Versions are to be listed. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Gallery Application version operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByGalleryApplication( - String resourceGroupName, String galleryName, String galleryApplicationName) { - return new PagedIterable<>( - listByGalleryApplicationAsync(resourceGroupName, galleryName, galleryApplicationName)); - } - - /** - * List gallery Application Versions in a gallery Application Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the Shared Application Gallery Application Definition from which the - * Application Versions are to be listed. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Gallery Application version operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByGalleryApplication( - String resourceGroupName, String galleryName, String galleryApplicationName, Context context) { - return new PagedIterable<>( - listByGalleryApplicationAsync(resourceGroupName, galleryName, galleryApplicationName, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Gallery Application version operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByGalleryApplicationNextSinglePageAsync( - String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByGalleryApplicationNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Gallery Application version operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByGalleryApplicationNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByGalleryApplicationNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/GalleryApplicationsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/GalleryApplicationsClientImpl.java deleted file mode 100644 index a55fb43bca58..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/GalleryApplicationsClientImpl.java +++ /dev/null @@ -1,1599 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.compute.fluent.GalleryApplicationsClient; -import com.azure.resourcemanager.compute.fluent.models.GalleryApplicationInner; -import com.azure.resourcemanager.compute.models.ApiErrorException; -import com.azure.resourcemanager.compute.models.GalleryApplicationList; -import com.azure.resourcemanager.compute.models.GalleryApplicationUpdate; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in GalleryApplicationsClient. */ -public final class GalleryApplicationsClientImpl implements GalleryApplicationsClient { - private final ClientLogger logger = new ClientLogger(GalleryApplicationsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final GalleryApplicationsService service; - - /** The service client containing this operation class. */ - private final ComputeManagementClientImpl client; - - /** - * Initializes an instance of GalleryApplicationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - GalleryApplicationsClientImpl(ComputeManagementClientImpl client) { - this.service = - RestProxy.create(GalleryApplicationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for ComputeManagementClientGalleryApplications to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "ComputeManagementCli") - private interface GalleryApplicationsService { - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" - + "/{galleryName}/applications/{galleryApplicationName}") - @ExpectedResponses({200, 201, 202}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("galleryName") String galleryName, - @PathParam("galleryApplicationName") String galleryApplicationName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") GalleryApplicationInner galleryApplication, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" - + "/{galleryName}/applications/{galleryApplicationName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono>> update( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("galleryName") String galleryName, - @PathParam("galleryApplicationName") String galleryApplicationName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") GalleryApplicationUpdate galleryApplication, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" - + "/{galleryName}/applications/{galleryApplicationName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("galleryName") String galleryName, - @PathParam("galleryApplicationName") String galleryApplicationName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" - + "/{galleryName}/applications/{galleryApplicationName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("galleryName") String galleryName, - @PathParam("galleryApplicationName") String galleryApplicationName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" - + "/{galleryName}/applications") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> listByGallery( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("galleryName") String galleryName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> listByGalleryNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Create or update a gallery Application Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * created. - * @param galleryApplicationName The name of the gallery Application Definition to be created or updated. The - * allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The - * maximum length is 80 characters. - * @param galleryApplication Parameters supplied to the create or update gallery Application operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - GalleryApplicationInner galleryApplication) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryApplicationName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); - } - if (galleryApplication == null) { - return Mono - .error(new IllegalArgumentException("Parameter galleryApplication is required and cannot be null.")); - } else { - galleryApplication.validate(); - } - final String apiVersion = "2019-12-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryApplicationName, - apiVersion, - galleryApplication, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create or update a gallery Application Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * created. - * @param galleryApplicationName The name of the gallery Application Definition to be created or updated. The - * allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The - * maximum length is 80 characters. - * @param galleryApplication Parameters supplied to the create or update gallery Application operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - GalleryApplicationInner galleryApplication, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryApplicationName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); - } - if (galleryApplication == null) { - return Mono - .error(new IllegalArgumentException("Parameter galleryApplication is required and cannot be null.")); - } else { - galleryApplication.validate(); - } - final String apiVersion = "2019-12-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryApplicationName, - apiVersion, - galleryApplication, - accept, - context); - } - - /** - * Create or update a gallery Application Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * created. - * @param galleryApplicationName The name of the gallery Application Definition to be created or updated. The - * allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The - * maximum length is 80 characters. - * @param galleryApplication Parameters supplied to the create or update gallery Application operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, GalleryApplicationInner> beginCreateOrUpdateAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - GalleryApplicationInner galleryApplication) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplication); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - GalleryApplicationInner.class, - GalleryApplicationInner.class, - Context.NONE); - } - - /** - * Create or update a gallery Application Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * created. - * @param galleryApplicationName The name of the gallery Application Definition to be created or updated. The - * allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The - * maximum length is 80 characters. - * @param galleryApplication Parameters supplied to the create or update gallery Application operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, GalleryApplicationInner> beginCreateOrUpdateAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - GalleryApplicationInner galleryApplication, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync( - resourceGroupName, galleryName, galleryApplicationName, galleryApplication, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - GalleryApplicationInner.class, - GalleryApplicationInner.class, - context); - } - - /** - * Create or update a gallery Application Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * created. - * @param galleryApplicationName The name of the gallery Application Definition to be created or updated. The - * allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The - * maximum length is 80 characters. - * @param galleryApplication Parameters supplied to the create or update gallery Application operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, GalleryApplicationInner> beginCreateOrUpdate( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - GalleryApplicationInner galleryApplication) { - return beginCreateOrUpdateAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplication) - .getSyncPoller(); - } - - /** - * Create or update a gallery Application Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * created. - * @param galleryApplicationName The name of the gallery Application Definition to be created or updated. The - * allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The - * maximum length is 80 characters. - * @param galleryApplication Parameters supplied to the create or update gallery Application operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, GalleryApplicationInner> beginCreateOrUpdate( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - GalleryApplicationInner galleryApplication, - Context context) { - return beginCreateOrUpdateAsync( - resourceGroupName, galleryName, galleryApplicationName, galleryApplication, context) - .getSyncPoller(); - } - - /** - * Create or update a gallery Application Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * created. - * @param galleryApplicationName The name of the gallery Application Definition to be created or updated. The - * allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The - * maximum length is 80 characters. - * @param galleryApplication Parameters supplied to the create or update gallery Application operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - GalleryApplicationInner galleryApplication) { - return beginCreateOrUpdateAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplication) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create or update a gallery Application Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * created. - * @param galleryApplicationName The name of the gallery Application Definition to be created or updated. The - * allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The - * maximum length is 80 characters. - * @param galleryApplication Parameters supplied to the create or update gallery Application operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - GalleryApplicationInner galleryApplication, - Context context) { - return beginCreateOrUpdateAsync( - resourceGroupName, galleryName, galleryApplicationName, galleryApplication, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create or update a gallery Application Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * created. - * @param galleryApplicationName The name of the gallery Application Definition to be created or updated. The - * allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The - * maximum length is 80 characters. - * @param galleryApplication Parameters supplied to the create or update gallery Application operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryApplicationInner createOrUpdate( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - GalleryApplicationInner galleryApplication) { - return createOrUpdateAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplication).block(); - } - - /** - * Create or update a gallery Application Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * created. - * @param galleryApplicationName The name of the gallery Application Definition to be created or updated. The - * allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The - * maximum length is 80 characters. - * @param galleryApplication Parameters supplied to the create or update gallery Application operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryApplicationInner createOrUpdate( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - GalleryApplicationInner galleryApplication, - Context context) { - return createOrUpdateAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplication, context) - .block(); - } - - /** - * Update a gallery Application Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * updated. - * @param galleryApplicationName The name of the gallery Application Definition to be updated. The allowed - * characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length - * is 80 characters. - * @param galleryApplication Parameters supplied to the update gallery Application operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateWithResponseAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - GalleryApplicationUpdate galleryApplication) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryApplicationName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); - } - if (galleryApplication == null) { - return Mono - .error(new IllegalArgumentException("Parameter galleryApplication is required and cannot be null.")); - } else { - galleryApplication.validate(); - } - final String apiVersion = "2019-12-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryApplicationName, - apiVersion, - galleryApplication, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Update a gallery Application Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * updated. - * @param galleryApplicationName The name of the gallery Application Definition to be updated. The allowed - * characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length - * is 80 characters. - * @param galleryApplication Parameters supplied to the update gallery Application operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - GalleryApplicationUpdate galleryApplication, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryApplicationName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); - } - if (galleryApplication == null) { - return Mono - .error(new IllegalArgumentException("Parameter galleryApplication is required and cannot be null.")); - } else { - galleryApplication.validate(); - } - final String apiVersion = "2019-12-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryApplicationName, - apiVersion, - galleryApplication, - accept, - context); - } - - /** - * Update a gallery Application Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * updated. - * @param galleryApplicationName The name of the gallery Application Definition to be updated. The allowed - * characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length - * is 80 characters. - * @param galleryApplication Parameters supplied to the update gallery Application operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, GalleryApplicationInner> beginUpdateAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - GalleryApplicationUpdate galleryApplication) { - Mono>> mono = - updateWithResponseAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplication); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - GalleryApplicationInner.class, - GalleryApplicationInner.class, - Context.NONE); - } - - /** - * Update a gallery Application Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * updated. - * @param galleryApplicationName The name of the gallery Application Definition to be updated. The allowed - * characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length - * is 80 characters. - * @param galleryApplication Parameters supplied to the update gallery Application operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, GalleryApplicationInner> beginUpdateAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - GalleryApplicationUpdate galleryApplication, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - updateWithResponseAsync( - resourceGroupName, galleryName, galleryApplicationName, galleryApplication, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - GalleryApplicationInner.class, - GalleryApplicationInner.class, - context); - } - - /** - * Update a gallery Application Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * updated. - * @param galleryApplicationName The name of the gallery Application Definition to be updated. The allowed - * characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length - * is 80 characters. - * @param galleryApplication Parameters supplied to the update gallery Application operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, GalleryApplicationInner> beginUpdate( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - GalleryApplicationUpdate galleryApplication) { - return beginUpdateAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplication) - .getSyncPoller(); - } - - /** - * Update a gallery Application Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * updated. - * @param galleryApplicationName The name of the gallery Application Definition to be updated. The allowed - * characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length - * is 80 characters. - * @param galleryApplication Parameters supplied to the update gallery Application operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, GalleryApplicationInner> beginUpdate( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - GalleryApplicationUpdate galleryApplication, - Context context) { - return beginUpdateAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplication, context) - .getSyncPoller(); - } - - /** - * Update a gallery Application Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * updated. - * @param galleryApplicationName The name of the gallery Application Definition to be updated. The allowed - * characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length - * is 80 characters. - * @param galleryApplication Parameters supplied to the update gallery Application operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - GalleryApplicationUpdate galleryApplication) { - return beginUpdateAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplication) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Update a gallery Application Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * updated. - * @param galleryApplicationName The name of the gallery Application Definition to be updated. The allowed - * characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length - * is 80 characters. - * @param galleryApplication Parameters supplied to the update gallery Application operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - GalleryApplicationUpdate galleryApplication, - Context context) { - return beginUpdateAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplication, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Update a gallery Application Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * updated. - * @param galleryApplicationName The name of the gallery Application Definition to be updated. The allowed - * characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length - * is 80 characters. - * @param galleryApplication Parameters supplied to the update gallery Application operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryApplicationInner update( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - GalleryApplicationUpdate galleryApplication) { - return updateAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplication).block(); - } - - /** - * Update a gallery Application Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * updated. - * @param galleryApplicationName The name of the gallery Application Definition to be updated. The allowed - * characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length - * is 80 characters. - * @param galleryApplication Parameters supplied to the update gallery Application operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryApplicationInner update( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - GalleryApplicationUpdate galleryApplication, - Context context) { - return updateAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplication, context).block(); - } - - /** - * Retrieves information about a gallery Application Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery from which the Application Definitions are to be - * retrieved. - * @param galleryApplicationName The name of the gallery Application Definition to be retrieved. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String resourceGroupName, String galleryName, String galleryApplicationName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryApplicationName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryApplicationName, - apiVersion, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Retrieves information about a gallery Application Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery from which the Application Definitions are to be - * retrieved. - * @param galleryApplicationName The name of the gallery Application Definition to be retrieved. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String galleryName, String galleryApplicationName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryApplicationName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryApplicationName, - apiVersion, - accept, - context); - } - - /** - * Retrieves information about a gallery Application Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery from which the Application Definitions are to be - * retrieved. - * @param galleryApplicationName The name of the gallery Application Definition to be retrieved. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync( - String resourceGroupName, String galleryName, String galleryApplicationName) { - return getWithResponseAsync(resourceGroupName, galleryName, galleryApplicationName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Retrieves information about a gallery Application Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery from which the Application Definitions are to be - * retrieved. - * @param galleryApplicationName The name of the gallery Application Definition to be retrieved. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryApplicationInner get(String resourceGroupName, String galleryName, String galleryApplicationName) { - return getAsync(resourceGroupName, galleryName, galleryApplicationName).block(); - } - - /** - * Retrieves information about a gallery Application Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery from which the Application Definitions are to be - * retrieved. - * @param galleryApplicationName The name of the gallery Application Definition to be retrieved. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String galleryName, String galleryApplicationName, Context context) { - return getWithResponseAsync(resourceGroupName, galleryName, galleryApplicationName, context).block(); - } - - /** - * Delete a gallery Application. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * deleted. - * @param galleryApplicationName The name of the gallery Application Definition to be deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync( - String resourceGroupName, String galleryName, String galleryApplicationName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryApplicationName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryApplicationName, - apiVersion, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete a gallery Application. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * deleted. - * @param galleryApplicationName The name of the gallery Application Definition to be deleted. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String galleryName, String galleryApplicationName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryApplicationName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryApplicationName, - apiVersion, - accept, - context); - } - - /** - * Delete a gallery Application. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * deleted. - * @param galleryApplicationName The name of the gallery Application Definition to be deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String galleryName, String galleryApplicationName) { - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, galleryName, galleryApplicationName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Delete a gallery Application. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * deleted. - * @param galleryApplicationName The name of the gallery Application Definition to be deleted. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String galleryName, String galleryApplicationName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, galleryName, galleryApplicationName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Delete a gallery Application. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * deleted. - * @param galleryApplicationName The name of the gallery Application Definition to be deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String galleryName, String galleryApplicationName) { - return beginDeleteAsync(resourceGroupName, galleryName, galleryApplicationName).getSyncPoller(); - } - - /** - * Delete a gallery Application. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * deleted. - * @param galleryApplicationName The name of the gallery Application Definition to be deleted. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String galleryName, String galleryApplicationName, Context context) { - return beginDeleteAsync(resourceGroupName, galleryName, galleryApplicationName, context).getSyncPoller(); - } - - /** - * Delete a gallery Application. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * deleted. - * @param galleryApplicationName The name of the gallery Application Definition to be deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String galleryName, String galleryApplicationName) { - return beginDeleteAsync(resourceGroupName, galleryName, galleryApplicationName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Delete a gallery Application. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * deleted. - * @param galleryApplicationName The name of the gallery Application Definition to be deleted. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync( - String resourceGroupName, String galleryName, String galleryApplicationName, Context context) { - return beginDeleteAsync(resourceGroupName, galleryName, galleryApplicationName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Delete a gallery Application. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * deleted. - * @param galleryApplicationName The name of the gallery Application Definition to be deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String galleryName, String galleryApplicationName) { - deleteAsync(resourceGroupName, galleryName, galleryApplicationName).block(); - } - - /** - * Delete a gallery Application. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * deleted. - * @param galleryApplicationName The name of the gallery Application Definition to be deleted. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String galleryName, String galleryApplicationName, Context context) { - deleteAsync(resourceGroupName, galleryName, galleryApplicationName, context).block(); - } - - /** - * List gallery Application Definitions in a gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery from which Application Definitions are to be - * listed. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Gallery Applications operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByGallerySinglePageAsync( - String resourceGroupName, String galleryName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByGallery( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - apiVersion, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List gallery Application Definitions in a gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery from which Application Definitions are to be - * listed. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Gallery Applications operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByGallerySinglePageAsync( - String resourceGroupName, String galleryName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByGallery( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - apiVersion, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * List gallery Application Definitions in a gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery from which Application Definitions are to be - * listed. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Gallery Applications operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByGalleryAsync(String resourceGroupName, String galleryName) { - return new PagedFlux<>( - () -> listByGallerySinglePageAsync(resourceGroupName, galleryName), - nextLink -> listByGalleryNextSinglePageAsync(nextLink)); - } - - /** - * List gallery Application Definitions in a gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery from which Application Definitions are to be - * listed. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Gallery Applications operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByGalleryAsync( - String resourceGroupName, String galleryName, Context context) { - return new PagedFlux<>( - () -> listByGallerySinglePageAsync(resourceGroupName, galleryName, context), - nextLink -> listByGalleryNextSinglePageAsync(nextLink, context)); - } - - /** - * List gallery Application Definitions in a gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery from which Application Definitions are to be - * listed. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Gallery Applications operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByGallery(String resourceGroupName, String galleryName) { - return new PagedIterable<>(listByGalleryAsync(resourceGroupName, galleryName)); - } - - /** - * List gallery Application Definitions in a gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery from which Application Definitions are to be - * listed. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Gallery Applications operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByGallery( - String resourceGroupName, String galleryName, Context context) { - return new PagedIterable<>(listByGalleryAsync(resourceGroupName, galleryName, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Gallery Applications operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByGalleryNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByGalleryNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Gallery Applications operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByGalleryNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByGalleryNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/GalleryImageImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/GalleryImageImpl.java deleted file mode 100644 index 6550f31c8c00..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/GalleryImageImpl.java +++ /dev/null @@ -1,501 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.compute.ComputeManager; -import com.azure.resourcemanager.compute.models.Disallowed; -import com.azure.resourcemanager.compute.models.DiskSkuTypes; -import com.azure.resourcemanager.compute.models.DiskStorageAccountTypes; -import com.azure.resourcemanager.compute.models.Gallery; -import com.azure.resourcemanager.compute.models.GalleryImage; -import com.azure.resourcemanager.compute.models.GalleryImageIdentifier; -import com.azure.resourcemanager.compute.models.GalleryImageVersion; -import com.azure.resourcemanager.compute.models.ImagePurchasePlan; -import com.azure.resourcemanager.compute.models.OperatingSystemStateTypes; -import com.azure.resourcemanager.compute.models.OperatingSystemTypes; -import com.azure.resourcemanager.compute.models.RecommendedMachineConfiguration; -import com.azure.resourcemanager.compute.models.ResourceRange; -import com.azure.resourcemanager.compute.fluent.models.GalleryImageInner; -import com.azure.core.management.Region; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.CreatableUpdatableImpl; -import reactor.core.publisher.Mono; - -import java.time.OffsetDateTime; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -/** The implementation for GalleryImage and its create and update interfaces. */ -class GalleryImageImpl extends CreatableUpdatableImpl - implements GalleryImage, GalleryImage.Definition, GalleryImage.Update { - private final ComputeManager manager; - private String resourceGroupName; - private String galleryName; - private String galleryImageName; - - GalleryImageImpl(String name, ComputeManager manager) { - super(name, new GalleryImageInner()); - this.manager = manager; - // Set resource name - this.galleryImageName = name; - // - } - - GalleryImageImpl(GalleryImageInner inner, ComputeManager manager) { - super(inner.name(), inner); - this.manager = manager; - // Set resource name - this.galleryImageName = inner.name(); - // resource ancestor names - this.resourceGroupName = getValueFromIdByName(inner.id(), "resourceGroups"); - this.galleryName = getValueFromIdByName(inner.id(), "galleries"); - this.galleryImageName = getValueFromIdByName(inner.id(), "images"); - // - } - - @Override - public Mono getVersionAsync(String versionName) { - return this - .manager() - .galleryImageVersions() - .getByGalleryImageAsync(this.resourceGroupName, this.galleryName, this.galleryImageName, versionName); - } - - @Override - public GalleryImageVersion getVersion(String versionName) { - return this - .manager() - .galleryImageVersions() - .getByGalleryImage(this.resourceGroupName, this.galleryName, this.galleryImageName, versionName); - } - - @Override - public PagedFlux listVersionsAsync() { - return this - .manager() - .galleryImageVersions() - .listByGalleryImageAsync(this.resourceGroupName, this.galleryName, this.galleryImageName); - } - - @Override - public PagedIterable listVersions() { - return this - .manager() - .galleryImageVersions() - .listByGalleryImage(this.resourceGroupName, this.galleryName, this.galleryImageName); - } - - @Override - public ComputeManager manager() { - return this.manager; - } - - @Override - public Mono createResourceAsync() { - return manager() - .serviceClient() - .getGalleryImages() - .createOrUpdateAsync(this.resourceGroupName, this.galleryName, this.galleryImageName, this.innerModel()) - .map(innerToFluentMap(this)); - } - - @Override - public Mono updateResourceAsync() { - return manager() - .serviceClient() - .getGalleryImages() - .createOrUpdateAsync(this.resourceGroupName, this.galleryName, this.galleryImageName, this.innerModel()) - .map(innerToFluentMap(this)); - } - - @Override - protected Mono getInnerAsync() { - return manager() - .serviceClient() - .getGalleryImages() - .getAsync(this.resourceGroupName, this.galleryName, this.galleryImageName); - } - - @Override - public boolean isInCreateMode() { - return this.innerModel().id() == null; - } - - @Override - public String description() { - return this.innerModel().description(); - } - - @Override - public List unsupportedDiskTypes() { - if (this.innerModel().disallowed() == null || this.innerModel().disallowed().diskTypes() == null) { - return Collections.unmodifiableList(new ArrayList()); - } else { - List diskTypes = new ArrayList(); - for (String diskTypeStr : this.innerModel().disallowed().diskTypes()) { - diskTypes.add(DiskSkuTypes.fromStorageAccountType(DiskStorageAccountTypes.fromString(diskTypeStr))); - } - return Collections.unmodifiableList(diskTypes); - } - } - - @Override - public Disallowed disallowed() { - return this.innerModel().disallowed(); - } - - @Override - public OffsetDateTime endOfLifeDate() { - return this.innerModel().endOfLifeDate(); - } - - @Override - public String eula() { - return this.innerModel().eula(); - } - - @Override - public String id() { - return this.innerModel().id(); - } - - @Override - public GalleryImageIdentifier identifier() { - return this.innerModel().identifier(); - } - - @Override - public String location() { - return this.innerModel().location(); - } - - @Override - public String name() { - return this.innerModel().name(); - } - - @Override - public OperatingSystemStateTypes osState() { - return this.innerModel().osState(); - } - - @Override - public OperatingSystemTypes osType() { - return this.innerModel().osType(); - } - - @Override - public String privacyStatementUri() { - return this.innerModel().privacyStatementUri(); - } - - @Override - public String provisioningState() { - return this.innerModel().provisioningState().toString(); - } - - @Override - public ImagePurchasePlan purchasePlan() { - return this.innerModel().purchasePlan(); - } - - @Override - public RecommendedMachineConfiguration recommendedVirtualMachineConfiguration() { - return this.innerModel().recommended(); - } - - @Override - public String releaseNoteUri() { - return this.innerModel().releaseNoteUri(); - } - - @Override - public Map tags() { - return this.innerModel().tags(); - } - - @Override - public String type() { - return this.innerModel().type(); - } - - @Override - public GalleryImageImpl withExistingGallery(String resourceGroupName, String galleryName) { - this.resourceGroupName = resourceGroupName; - this.galleryName = galleryName; - return this; - } - - @Override - public GalleryImageImpl withExistingGallery(Gallery gallery) { - this.resourceGroupName = gallery.resourceGroupName(); - this.galleryName = gallery.name(); - return this; - } - - @Override - public GalleryImageImpl withLocation(String location) { - this.innerModel().withLocation(location); - return this; - } - - @Override - public GalleryImageImpl withLocation(Region location) { - this.innerModel().withLocation(location.toString()); - return this; - } - - @Override - public GalleryImageImpl withIdentifier(GalleryImageIdentifier identifier) { - this.innerModel().withIdentifier(identifier); - return this; - } - - @Override - public GalleryImageImpl withIdentifier(String publisher, String offer, String sku) { - this - .innerModel() - .withIdentifier(new GalleryImageIdentifier().withPublisher(publisher).withOffer(offer).withSku(sku)); - return this; - } - - @Override - public GalleryImageImpl withGeneralizedWindows() { - return this.withWindows(OperatingSystemStateTypes.GENERALIZED); - } - - @Override - public GalleryImageImpl withGeneralizedLinux() { - return this.withLinux(OperatingSystemStateTypes.GENERALIZED); - } - - @Override - public GalleryImageImpl withWindows(OperatingSystemStateTypes osState) { - this.innerModel().withOsType(OperatingSystemTypes.WINDOWS).withOsState(osState); - return this; - } - - @Override - public GalleryImageImpl withLinux(OperatingSystemStateTypes osState) { - this.innerModel().withOsType(OperatingSystemTypes.LINUX).withOsState(osState); - return this; - } - - @Override - public GalleryImageImpl withDescription(String description) { - this.innerModel().withDescription(description); - return this; - } - - @Override - public GalleryImageImpl withUnsupportedDiskType(DiskSkuTypes diskType) { - if (this.innerModel().disallowed() == null) { - this.innerModel().withDisallowed(new Disallowed()); - } - if (this.innerModel().disallowed().diskTypes() == null) { - this.innerModel().disallowed().withDiskTypes(new ArrayList()); - } - boolean found = false; - String newDiskTypeStr = diskType.toString(); - for (String diskTypeStr : this.innerModel().disallowed().diskTypes()) { - if (diskTypeStr.equalsIgnoreCase(newDiskTypeStr)) { - found = true; - break; - } - } - if (!found) { - this.innerModel().disallowed().diskTypes().add(diskType.toString()); - } - return this; - } - - @Override - public GalleryImageImpl withUnsupportedDiskTypes(List diskTypes) { - if (this.innerModel().disallowed() == null) { - this.innerModel().withDisallowed(new Disallowed()); - } - this.innerModel().disallowed().withDiskTypes(new ArrayList()); - for (DiskSkuTypes diskType : diskTypes) { - this.innerModel().disallowed().diskTypes().add(diskType.toString()); - } - return this; - } - - @Override - public GalleryImageImpl withoutUnsupportedDiskType(DiskSkuTypes diskType) { - if (this.innerModel().disallowed() != null && this.innerModel().disallowed().diskTypes() != null) { - int foundIndex = -1; - int i = 0; - String diskTypeToRemove = diskType.toString(); - for (String diskTypeStr : this.innerModel().disallowed().diskTypes()) { - if (diskTypeStr.equalsIgnoreCase(diskTypeToRemove)) { - foundIndex = i; - break; - } - i++; - } - if (foundIndex != -1) { - this.innerModel().disallowed().diskTypes().remove(foundIndex); - } - } - return this; - } - - @Override - public GalleryImageImpl withDisallowed(Disallowed disallowed) { - this.innerModel().withDisallowed(disallowed); - return this; - } - - @Override - public GalleryImageImpl withEndOfLifeDate(OffsetDateTime endOfLifeDate) { - this.innerModel().withEndOfLifeDate(endOfLifeDate); - return this; - } - - @Override - public GalleryImageImpl withEula(String eula) { - this.innerModel().withEula(eula); - return this; - } - - @Override - public GalleryImageImpl withOsState(OperatingSystemStateTypes osState) { - this.innerModel().withOsState(osState); - return this; - } - - @Override - public GalleryImageImpl withPrivacyStatementUri(String privacyStatementUri) { - this.innerModel().withPrivacyStatementUri(privacyStatementUri); - return this; - } - - @Override - public GalleryImageImpl withPurchasePlan(String name, String publisher, String product) { - return this - .withPurchasePlan(new ImagePurchasePlan().withName(name).withPublisher(publisher).withProduct(product)); - } - - @Override - public GalleryImageImpl withPurchasePlan(ImagePurchasePlan purchasePlan) { - this.innerModel().withPurchasePlan(purchasePlan); - return this; - } - - @Override - public GalleryImageImpl withRecommendedMinimumCPUsCountForVirtualMachine(int minCount) { - if (this.innerModel().recommended() == null) { - this.innerModel().withRecommended(new RecommendedMachineConfiguration()); - } - if (this.innerModel().recommended().vCPUs() == null) { - this.innerModel().recommended().withVCPUs(new ResourceRange()); - } - this.innerModel().recommended().vCPUs().withMin(minCount); - return this; - } - - @Override - public GalleryImageImpl withRecommendedMaximumCPUsCountForVirtualMachine(int maxCount) { - if (this.innerModel().recommended() == null) { - this.innerModel().withRecommended(new RecommendedMachineConfiguration()); - } - if (this.innerModel().recommended().vCPUs() == null) { - this.innerModel().recommended().withVCPUs(new ResourceRange()); - } - this.innerModel().recommended().vCPUs().withMax(maxCount); - return this; - } - - @Override - public GalleryImageImpl withRecommendedCPUsCountForVirtualMachine(int minCount, int maxCount) { - if (this.innerModel().recommended() == null) { - this.innerModel().withRecommended(new RecommendedMachineConfiguration()); - } - this.innerModel().recommended().withVCPUs(new ResourceRange()); - this.innerModel().recommended().vCPUs().withMin(minCount); - this.innerModel().recommended().vCPUs().withMax(maxCount); - return this; - } - - @Override - public GalleryImageImpl withRecommendedMinimumMemoryForVirtualMachine(int minMB) { - if (this.innerModel().recommended() == null) { - this.innerModel().withRecommended(new RecommendedMachineConfiguration()); - } - if (this.innerModel().recommended().memory() == null) { - this.innerModel().recommended().withMemory(new ResourceRange()); - } - this.innerModel().recommended().memory().withMin(minMB); - return this; - } - - @Override - public GalleryImageImpl withRecommendedMaximumMemoryForVirtualMachine(int maxMB) { - if (this.innerModel().recommended() == null) { - this.innerModel().withRecommended(new RecommendedMachineConfiguration()); - } - if (this.innerModel().recommended().memory() == null) { - this.innerModel().recommended().withMemory(new ResourceRange()); - } - this.innerModel().recommended().memory().withMax(maxMB); - return this; - } - - @Override - public GalleryImageImpl withRecommendedMemoryForVirtualMachine(int minMB, int maxMB) { - if (this.innerModel().recommended() == null) { - this.innerModel().withRecommended(new RecommendedMachineConfiguration()); - } - this.innerModel().recommended().withMemory(new ResourceRange()); - this.innerModel().recommended().memory().withMin(minMB); - this.innerModel().recommended().memory().withMax(maxMB); - return this; - } - - @Override - public GalleryImageImpl withRecommendedConfigurationForVirtualMachine( - RecommendedMachineConfiguration recommendedConfig) { - this.innerModel().withRecommended(recommendedConfig); - return this; - } - - @Override - public GalleryImageImpl withReleaseNoteUri(String releaseNoteUri) { - this.innerModel().withReleaseNoteUri(releaseNoteUri); - return this; - } - - @Override - public GalleryImageImpl withTags(Map tags) { - this.innerModel().withTags(tags); - return this; - } - - private static String getValueFromIdByName(String id, String name) { - if (id == null) { - return null; - } - Iterable iterable = Arrays.asList(id.split("/")); - Iterator itr = iterable.iterator(); - while (itr.hasNext()) { - String part = itr.next(); - if (part != null && !part.trim().isEmpty()) { - if (part.equalsIgnoreCase(name)) { - if (itr.hasNext()) { - return itr.next(); - } else { - return null; - } - } - } - } - return null; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/GalleryImageVersionImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/GalleryImageVersionImpl.java deleted file mode 100644 index 98b151b3c251..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/GalleryImageVersionImpl.java +++ /dev/null @@ -1,379 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.implementation; - -import com.azure.resourcemanager.compute.ComputeManager; -import com.azure.resourcemanager.compute.models.GalleryArtifactVersionSource; -import com.azure.resourcemanager.compute.models.GalleryImageVersion; -import com.azure.resourcemanager.compute.models.GalleryImageVersionPublishingProfile; -import com.azure.resourcemanager.compute.models.GalleryImageVersionStorageProfile; -import com.azure.resourcemanager.compute.models.ReplicationStatus; -import com.azure.resourcemanager.compute.models.TargetRegion; -import com.azure.resourcemanager.compute.models.VirtualMachineCustomImage; -import com.azure.resourcemanager.compute.fluent.models.GalleryImageVersionInner; -import com.azure.core.management.Region; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.CreatableUpdatableImpl; -import reactor.core.publisher.Mono; - -import java.time.OffsetDateTime; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -/** The implementation for GalleryImageVersion and its create and update interfaces. */ -class GalleryImageVersionImpl - extends CreatableUpdatableImpl - implements GalleryImageVersion, GalleryImageVersion.Definition, GalleryImageVersion.Update { - private final ComputeManager manager; - private String resourceGroupName; - private String galleryName; - private String galleryImageName; - private String galleryImageVersionName; - - GalleryImageVersionImpl(String name, ComputeManager manager) { - super(name, new GalleryImageVersionInner()); - this.manager = manager; - // Set resource name - this.galleryImageVersionName = name; - // - } - - GalleryImageVersionImpl(GalleryImageVersionInner inner, ComputeManager manager) { - super(inner.name(), inner); - this.manager = manager; - // Set resource name - this.galleryImageVersionName = inner.name(); - // resource ancestor names - this.resourceGroupName = getValueFromIdByName(inner.id(), "resourceGroups"); - this.galleryName = getValueFromIdByName(inner.id(), "galleries"); - this.galleryImageName = getValueFromIdByName(inner.id(), "images"); - this.galleryImageVersionName = getValueFromIdByName(inner.id(), "versions"); - // - } - - @Override - public ComputeManager manager() { - return this.manager; - } - - @Override - public Mono createResourceAsync() { - return manager() - .serviceClient() - .getGalleryImageVersions() - .createOrUpdateAsync( - this.resourceGroupName, - this.galleryName, - this.galleryImageName, - this.galleryImageVersionName, - this.innerModel()) - .map(innerToFluentMap(this)); - } - - @Override - public Mono updateResourceAsync() { - return manager() - .serviceClient() - .getGalleryImageVersions() - .createOrUpdateAsync( - this.resourceGroupName, - this.galleryName, - this.galleryImageName, - this.galleryImageVersionName, - this.innerModel()) - .map(innerToFluentMap(this)); - } - - @Override - protected Mono getInnerAsync() { - return manager() - .serviceClient() - .getGalleryImageVersions() - .getAsync(this.resourceGroupName, this.galleryName, this.galleryImageName, this.galleryImageVersionName); - } - - @Override - public boolean isInCreateMode() { - return this.innerModel().id() == null; - } - - @Override - public String id() { - return this.innerModel().id(); - } - - @Override - public String location() { - return this.innerModel().location(); - } - - @Override - public String name() { - return this.innerModel().name(); - } - - @Override - public String provisioningState() { - return this.innerModel().provisioningState().toString(); - } - - @Override - public GalleryImageVersionPublishingProfile publishingProfile() { - return this.innerModel().publishingProfile(); - } - - @Override - public List availableRegions() { - List regions = new ArrayList(); - if (this.innerModel().publishingProfile() != null - && this.innerModel().publishingProfile().targetRegions() != null) { - for (TargetRegion targetRegion : this.innerModel().publishingProfile().targetRegions()) { - regions - .add( - new TargetRegion() - .withName(targetRegion.name()) - .withRegionalReplicaCount(targetRegion.regionalReplicaCount())); - } - } - return Collections.unmodifiableList(regions); - } - - @Override - public OffsetDateTime endOfLifeDate() { - if (this.innerModel().publishingProfile() != null) { - return this.innerModel().publishingProfile().endOfLifeDate(); - } else { - return null; - } - } - - @Override - public Boolean isExcludedFromLatest() { - if (this.innerModel().publishingProfile() != null) { - return this.innerModel().publishingProfile().excludeFromLatest(); - } else { - return false; - } - } - - @Override - public ReplicationStatus replicationStatus() { - return this.innerModel().replicationStatus(); - } - - @Override - public GalleryImageVersionStorageProfile storageProfile() { - return this.innerModel().storageProfile(); - } - - @Override - public Map tags() { - return this.innerModel().tags(); - } - - @Override - public String type() { - return this.innerModel().type(); - } - - @Override - public GalleryImageVersionImpl withExistingImage( - String resourceGroupName, String galleryName, String galleryImageName) { - this.resourceGroupName = resourceGroupName; - this.galleryName = galleryName; - this.galleryImageName = galleryImageName; - return this; - } - - @Override - public GalleryImageVersionImpl withLocation(String location) { - this.innerModel().withLocation(location); - return this; - } - - @Override - public DefinitionStages.WithSource withLocation(Region location) { - this.innerModel().withLocation(location.toString()); - return this; - } - - @Override - public GalleryImageVersionImpl withSourceCustomImage(String customImageId) { - if (this.innerModel().storageProfile() == null) { - this.innerModel().withStorageProfile(new GalleryImageVersionStorageProfile()); - } - if (this.innerModel().storageProfile().source() == null) { - this.innerModel().storageProfile().withSource(new GalleryArtifactVersionSource()); - } - this.innerModel().storageProfile().source().withId(customImageId); - return this; - } - - @Override - public GalleryImageVersionImpl withSourceCustomImage(VirtualMachineCustomImage customImage) { - return this.withSourceCustomImage(customImage.id()); - } - - @Override - public GalleryImageVersionImpl withRegionAvailability(Region region, int replicaCount) { - if (this.innerModel().publishingProfile() == null) { - this.innerModel().withPublishingProfile(new GalleryImageVersionPublishingProfile()); - } - if (this.innerModel().publishingProfile().targetRegions() == null) { - this.innerModel().publishingProfile().withTargetRegions(new ArrayList<>()); - } - - boolean found = false; - String newRegionName = region.toString(); - String newRegionNameTrimmed = newRegionName.replaceAll("\\s", ""); - for (TargetRegion targetRegion : this.innerModel().publishingProfile().targetRegions()) { - String regionStr = targetRegion.name(); - String regionStrTrimmed = regionStr.replaceAll("\\s", ""); - if (regionStrTrimmed.equalsIgnoreCase(newRegionNameTrimmed)) { - targetRegion.withRegionalReplicaCount(replicaCount); // Update existing - found = true; - break; - } - } - if (!found) { - TargetRegion targetRegion = - new TargetRegion().withName(newRegionName).withRegionalReplicaCount(replicaCount); - this.innerModel().publishingProfile().targetRegions().add(targetRegion); - } - // - // Gallery image version publishing profile regions list must contain the location of image version. - // - found = false; - String locationTrimmed = this.location().replaceAll("\\s", ""); - for (TargetRegion targetRegion : this.innerModel().publishingProfile().targetRegions()) { - String regionStr = targetRegion.name(); - String regionStrTrimmed = regionStr.replaceAll("\\s", ""); - if (regionStrTrimmed.equalsIgnoreCase(locationTrimmed)) { - found = true; - break; - } - } - if (!found) { - TargetRegion defaultTargetRegion = - new TargetRegion() - .withName(this.location()) - .withRegionalReplicaCount(null); // null means default where service default to 1 replica - this.innerModel().publishingProfile().targetRegions().add(defaultTargetRegion); - } - // - return this; - } - - @Override - public GalleryImageVersionImpl withRegionAvailability(List targetRegions) { - if (this.innerModel().publishingProfile() == null) { - this.innerModel().withPublishingProfile(new GalleryImageVersionPublishingProfile()); - } - this.innerModel().publishingProfile().withTargetRegions(targetRegions); - // - // Gallery image version publishing profile regions list must contain the location of image version. - // - boolean found = false; - String locationTrimmed = this.location().replaceAll("\\s", ""); - for (TargetRegion targetRegion : this.innerModel().publishingProfile().targetRegions()) { - String regionStr = targetRegion.name(); - String regionStrTrimmed = regionStr.replaceAll("\\s", ""); - if (regionStrTrimmed.equalsIgnoreCase(locationTrimmed)) { - found = true; - break; - } - } - if (!found) { - TargetRegion defaultTargetRegion = - new TargetRegion() - .withName(this.location()) - .withRegionalReplicaCount(null); // null means default where service default to 1 replica - this.innerModel().publishingProfile().targetRegions().add(defaultTargetRegion); - } - // - return this; - } - - @Override - public Update withoutRegionAvailability(Region region) { - if (this.innerModel().publishingProfile() != null - && this.innerModel().publishingProfile().targetRegions() != null) { - int foundIndex = -1; - int i = 0; - String regionNameToRemove = region.toString(); - String regionNameToRemoveTrimmed = regionNameToRemove.replaceAll("\\s", ""); - - for (TargetRegion targetRegion : this.innerModel().publishingProfile().targetRegions()) { - String regionStr = targetRegion.name(); - String regionStrTrimmed = regionStr.replaceAll("\\s", ""); - if (regionStrTrimmed.equalsIgnoreCase(regionNameToRemoveTrimmed)) { - foundIndex = i; - break; - } - i++; - } - if (foundIndex != -1) { - this.innerModel().publishingProfile().targetRegions().remove(foundIndex); - } - } - return this; - } - - @Override - public GalleryImageVersionImpl withEndOfLifeDate(OffsetDateTime endOfLifeDate) { - if (this.innerModel().publishingProfile() == null) { - this.innerModel().withPublishingProfile(new GalleryImageVersionPublishingProfile()); - } - this.innerModel().publishingProfile().withEndOfLifeDate(endOfLifeDate); - return this; - } - - @Override - public GalleryImageVersionImpl withExcludedFromLatest() { - if (this.innerModel().publishingProfile() == null) { - this.innerModel().withPublishingProfile(new GalleryImageVersionPublishingProfile()); - } - this.innerModel().publishingProfile().withExcludeFromLatest(true); - return this; - } - - @Override - public GalleryImageVersionImpl withoutExcludedFromLatest() { - if (this.innerModel().publishingProfile() == null) { - this.innerModel().withPublishingProfile(new GalleryImageVersionPublishingProfile()); - } - this.innerModel().publishingProfile().withExcludeFromLatest(false); - return this; - } - - @Override - public GalleryImageVersionImpl withTags(Map tags) { - this.innerModel().withTags(tags); - return this; - } - - private static String getValueFromIdByName(String id, String name) { - if (id == null) { - return null; - } - Iterable iterable = Arrays.asList(id.split("/")); - Iterator itr = iterable.iterator(); - while (itr.hasNext()) { - String part = itr.next(); - if (part != null && !part.trim().isEmpty()) { - if (part.equalsIgnoreCase(name)) { - if (itr.hasNext()) { - return itr.next(); - } else { - return null; - } - } - } - } - return null; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/GalleryImageVersionsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/GalleryImageVersionsClientImpl.java deleted file mode 100644 index 97e432e4c7db..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/GalleryImageVersionsClientImpl.java +++ /dev/null @@ -1,1791 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.compute.fluent.GalleryImageVersionsClient; -import com.azure.resourcemanager.compute.fluent.models.GalleryImageVersionInner; -import com.azure.resourcemanager.compute.models.ApiErrorException; -import com.azure.resourcemanager.compute.models.GalleryImageVersionList; -import com.azure.resourcemanager.compute.models.GalleryImageVersionUpdate; -import com.azure.resourcemanager.compute.models.ReplicationStatusTypes; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in GalleryImageVersionsClient. */ -public final class GalleryImageVersionsClientImpl implements GalleryImageVersionsClient { - private final ClientLogger logger = new ClientLogger(GalleryImageVersionsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final GalleryImageVersionsService service; - - /** The service client containing this operation class. */ - private final ComputeManagementClientImpl client; - - /** - * Initializes an instance of GalleryImageVersionsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - GalleryImageVersionsClientImpl(ComputeManagementClientImpl client) { - this.service = - RestProxy - .create(GalleryImageVersionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for ComputeManagementClientGalleryImageVersions to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "ComputeManagementCli") - private interface GalleryImageVersionsService { - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" - + "/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}") - @ExpectedResponses({200, 201, 202}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("galleryName") String galleryName, - @PathParam("galleryImageName") String galleryImageName, - @PathParam("galleryImageVersionName") String galleryImageVersionName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") GalleryImageVersionInner galleryImageVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" - + "/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono>> update( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("galleryName") String galleryName, - @PathParam("galleryImageName") String galleryImageName, - @PathParam("galleryImageVersionName") String galleryImageVersionName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") GalleryImageVersionUpdate galleryImageVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" - + "/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("galleryName") String galleryName, - @PathParam("galleryImageName") String galleryImageName, - @PathParam("galleryImageVersionName") String galleryImageVersionName, - @QueryParam("$expand") ReplicationStatusTypes expand, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" - + "/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("galleryName") String galleryName, - @PathParam("galleryImageName") String galleryImageName, - @PathParam("galleryImageVersionName") String galleryImageVersionName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" - + "/{galleryName}/images/{galleryImageName}/versions") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> listByGalleryImage( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("galleryName") String galleryName, - @PathParam("galleryImageName") String galleryImageName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> listByGalleryImageNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Create or update a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version is to be created. - * @param galleryImageVersionName The name of the gallery Image Version to be created. Needs to follow semantic - * version name pattern: The allowed characters are digit and period. Digits must be within the range of a - * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryImageVersion Parameters supplied to the create or update gallery Image Version operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String galleryName, - String galleryImageName, - String galleryImageVersionName, - GalleryImageVersionInner galleryImageVersion) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryImageName == null) { - return Mono - .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); - } - if (galleryImageVersionName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter galleryImageVersionName is required and cannot be null.")); - } - if (galleryImageVersion == null) { - return Mono - .error(new IllegalArgumentException("Parameter galleryImageVersion is required and cannot be null.")); - } else { - galleryImageVersion.validate(); - } - final String apiVersion = "2019-12-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - apiVersion, - galleryImageVersion, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create or update a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version is to be created. - * @param galleryImageVersionName The name of the gallery Image Version to be created. Needs to follow semantic - * version name pattern: The allowed characters are digit and period. Digits must be within the range of a - * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryImageVersion Parameters supplied to the create or update gallery Image Version operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String galleryName, - String galleryImageName, - String galleryImageVersionName, - GalleryImageVersionInner galleryImageVersion, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryImageName == null) { - return Mono - .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); - } - if (galleryImageVersionName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter galleryImageVersionName is required and cannot be null.")); - } - if (galleryImageVersion == null) { - return Mono - .error(new IllegalArgumentException("Parameter galleryImageVersion is required and cannot be null.")); - } else { - galleryImageVersion.validate(); - } - final String apiVersion = "2019-12-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - apiVersion, - galleryImageVersion, - accept, - context); - } - - /** - * Create or update a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version is to be created. - * @param galleryImageVersionName The name of the gallery Image Version to be created. Needs to follow semantic - * version name pattern: The allowed characters are digit and period. Digits must be within the range of a - * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryImageVersion Parameters supplied to the create or update gallery Image Version operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, GalleryImageVersionInner> beginCreateOrUpdateAsync( - String resourceGroupName, - String galleryName, - String galleryImageName, - String galleryImageVersionName, - GalleryImageVersionInner galleryImageVersion) { - Mono>> mono = - createOrUpdateWithResponseAsync( - resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - GalleryImageVersionInner.class, - GalleryImageVersionInner.class, - Context.NONE); - } - - /** - * Create or update a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version is to be created. - * @param galleryImageVersionName The name of the gallery Image Version to be created. Needs to follow semantic - * version name pattern: The allowed characters are digit and period. Digits must be within the range of a - * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryImageVersion Parameters supplied to the create or update gallery Image Version operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, GalleryImageVersionInner> beginCreateOrUpdateAsync( - String resourceGroupName, - String galleryName, - String galleryImageName, - String galleryImageVersionName, - GalleryImageVersionInner galleryImageVersion, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync( - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - galleryImageVersion, - context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - GalleryImageVersionInner.class, - GalleryImageVersionInner.class, - context); - } - - /** - * Create or update a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version is to be created. - * @param galleryImageVersionName The name of the gallery Image Version to be created. Needs to follow semantic - * version name pattern: The allowed characters are digit and period. Digits must be within the range of a - * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryImageVersion Parameters supplied to the create or update gallery Image Version operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, GalleryImageVersionInner> beginCreateOrUpdate( - String resourceGroupName, - String galleryName, - String galleryImageName, - String galleryImageVersionName, - GalleryImageVersionInner galleryImageVersion) { - return beginCreateOrUpdateAsync( - resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion) - .getSyncPoller(); - } - - /** - * Create or update a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version is to be created. - * @param galleryImageVersionName The name of the gallery Image Version to be created. Needs to follow semantic - * version name pattern: The allowed characters are digit and period. Digits must be within the range of a - * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryImageVersion Parameters supplied to the create or update gallery Image Version operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, GalleryImageVersionInner> beginCreateOrUpdate( - String resourceGroupName, - String galleryName, - String galleryImageName, - String galleryImageVersionName, - GalleryImageVersionInner galleryImageVersion, - Context context) { - return beginCreateOrUpdateAsync( - resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, context) - .getSyncPoller(); - } - - /** - * Create or update a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version is to be created. - * @param galleryImageVersionName The name of the gallery Image Version to be created. Needs to follow semantic - * version name pattern: The allowed characters are digit and period. Digits must be within the range of a - * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryImageVersion Parameters supplied to the create or update gallery Image Version operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, - String galleryName, - String galleryImageName, - String galleryImageVersionName, - GalleryImageVersionInner galleryImageVersion) { - return beginCreateOrUpdateAsync( - resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create or update a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version is to be created. - * @param galleryImageVersionName The name of the gallery Image Version to be created. Needs to follow semantic - * version name pattern: The allowed characters are digit and period. Digits must be within the range of a - * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryImageVersion Parameters supplied to the create or update gallery Image Version operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, - String galleryName, - String galleryImageName, - String galleryImageVersionName, - GalleryImageVersionInner galleryImageVersion, - Context context) { - return beginCreateOrUpdateAsync( - resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create or update a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version is to be created. - * @param galleryImageVersionName The name of the gallery Image Version to be created. Needs to follow semantic - * version name pattern: The allowed characters are digit and period. Digits must be within the range of a - * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryImageVersion Parameters supplied to the create or update gallery Image Version operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryImageVersionInner createOrUpdate( - String resourceGroupName, - String galleryName, - String galleryImageName, - String galleryImageVersionName, - GalleryImageVersionInner galleryImageVersion) { - return createOrUpdateAsync( - resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion) - .block(); - } - - /** - * Create or update a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version is to be created. - * @param galleryImageVersionName The name of the gallery Image Version to be created. Needs to follow semantic - * version name pattern: The allowed characters are digit and period. Digits must be within the range of a - * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryImageVersion Parameters supplied to the create or update gallery Image Version operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryImageVersionInner createOrUpdate( - String resourceGroupName, - String galleryName, - String galleryImageName, - String galleryImageVersionName, - GalleryImageVersionInner galleryImageVersion, - Context context) { - return createOrUpdateAsync( - resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, context) - .block(); - } - - /** - * Update a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version is to be updated. - * @param galleryImageVersionName The name of the gallery Image Version to be updated. Needs to follow semantic - * version name pattern: The allowed characters are digit and period. Digits must be within the range of a - * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryImageVersion Parameters supplied to the update gallery Image Version operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateWithResponseAsync( - String resourceGroupName, - String galleryName, - String galleryImageName, - String galleryImageVersionName, - GalleryImageVersionUpdate galleryImageVersion) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryImageName == null) { - return Mono - .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); - } - if (galleryImageVersionName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter galleryImageVersionName is required and cannot be null.")); - } - if (galleryImageVersion == null) { - return Mono - .error(new IllegalArgumentException("Parameter galleryImageVersion is required and cannot be null.")); - } else { - galleryImageVersion.validate(); - } - final String apiVersion = "2019-12-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - apiVersion, - galleryImageVersion, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Update a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version is to be updated. - * @param galleryImageVersionName The name of the gallery Image Version to be updated. Needs to follow semantic - * version name pattern: The allowed characters are digit and period. Digits must be within the range of a - * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryImageVersion Parameters supplied to the update gallery Image Version operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, - String galleryName, - String galleryImageName, - String galleryImageVersionName, - GalleryImageVersionUpdate galleryImageVersion, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryImageName == null) { - return Mono - .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); - } - if (galleryImageVersionName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter galleryImageVersionName is required and cannot be null.")); - } - if (galleryImageVersion == null) { - return Mono - .error(new IllegalArgumentException("Parameter galleryImageVersion is required and cannot be null.")); - } else { - galleryImageVersion.validate(); - } - final String apiVersion = "2019-12-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - apiVersion, - galleryImageVersion, - accept, - context); - } - - /** - * Update a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version is to be updated. - * @param galleryImageVersionName The name of the gallery Image Version to be updated. Needs to follow semantic - * version name pattern: The allowed characters are digit and period. Digits must be within the range of a - * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryImageVersion Parameters supplied to the update gallery Image Version operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, GalleryImageVersionInner> beginUpdateAsync( - String resourceGroupName, - String galleryName, - String galleryImageName, - String galleryImageVersionName, - GalleryImageVersionUpdate galleryImageVersion) { - Mono>> mono = - updateWithResponseAsync( - resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - GalleryImageVersionInner.class, - GalleryImageVersionInner.class, - Context.NONE); - } - - /** - * Update a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version is to be updated. - * @param galleryImageVersionName The name of the gallery Image Version to be updated. Needs to follow semantic - * version name pattern: The allowed characters are digit and period. Digits must be within the range of a - * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryImageVersion Parameters supplied to the update gallery Image Version operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, GalleryImageVersionInner> beginUpdateAsync( - String resourceGroupName, - String galleryName, - String galleryImageName, - String galleryImageVersionName, - GalleryImageVersionUpdate galleryImageVersion, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - updateWithResponseAsync( - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - galleryImageVersion, - context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - GalleryImageVersionInner.class, - GalleryImageVersionInner.class, - context); - } - - /** - * Update a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version is to be updated. - * @param galleryImageVersionName The name of the gallery Image Version to be updated. Needs to follow semantic - * version name pattern: The allowed characters are digit and period. Digits must be within the range of a - * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryImageVersion Parameters supplied to the update gallery Image Version operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, GalleryImageVersionInner> beginUpdate( - String resourceGroupName, - String galleryName, - String galleryImageName, - String galleryImageVersionName, - GalleryImageVersionUpdate galleryImageVersion) { - return beginUpdateAsync( - resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion) - .getSyncPoller(); - } - - /** - * Update a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version is to be updated. - * @param galleryImageVersionName The name of the gallery Image Version to be updated. Needs to follow semantic - * version name pattern: The allowed characters are digit and period. Digits must be within the range of a - * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryImageVersion Parameters supplied to the update gallery Image Version operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, GalleryImageVersionInner> beginUpdate( - String resourceGroupName, - String galleryName, - String galleryImageName, - String galleryImageVersionName, - GalleryImageVersionUpdate galleryImageVersion, - Context context) { - return beginUpdateAsync( - resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, context) - .getSyncPoller(); - } - - /** - * Update a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version is to be updated. - * @param galleryImageVersionName The name of the gallery Image Version to be updated. Needs to follow semantic - * version name pattern: The allowed characters are digit and period. Digits must be within the range of a - * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryImageVersion Parameters supplied to the update gallery Image Version operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync( - String resourceGroupName, - String galleryName, - String galleryImageName, - String galleryImageVersionName, - GalleryImageVersionUpdate galleryImageVersion) { - return beginUpdateAsync( - resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Update a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version is to be updated. - * @param galleryImageVersionName The name of the gallery Image Version to be updated. Needs to follow semantic - * version name pattern: The allowed characters are digit and period. Digits must be within the range of a - * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryImageVersion Parameters supplied to the update gallery Image Version operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, - String galleryName, - String galleryImageName, - String galleryImageVersionName, - GalleryImageVersionUpdate galleryImageVersion, - Context context) { - return beginUpdateAsync( - resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Update a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version is to be updated. - * @param galleryImageVersionName The name of the gallery Image Version to be updated. Needs to follow semantic - * version name pattern: The allowed characters are digit and period. Digits must be within the range of a - * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryImageVersion Parameters supplied to the update gallery Image Version operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryImageVersionInner update( - String resourceGroupName, - String galleryName, - String galleryImageName, - String galleryImageVersionName, - GalleryImageVersionUpdate galleryImageVersion) { - return updateAsync( - resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion) - .block(); - } - - /** - * Update a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version is to be updated. - * @param galleryImageVersionName The name of the gallery Image Version to be updated. Needs to follow semantic - * version name pattern: The allowed characters are digit and period. Digits must be within the range of a - * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryImageVersion Parameters supplied to the update gallery Image Version operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryImageVersionInner update( - String resourceGroupName, - String galleryName, - String galleryImageName, - String galleryImageVersionName, - GalleryImageVersionUpdate galleryImageVersion, - Context context) { - return updateAsync( - resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, context) - .block(); - } - - /** - * Retrieves information about a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version resides. - * @param galleryImageVersionName The name of the gallery Image Version to be retrieved. - * @param expand The expand expression to apply on the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String resourceGroupName, - String galleryName, - String galleryImageName, - String galleryImageVersionName, - ReplicationStatusTypes expand) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryImageName == null) { - return Mono - .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); - } - if (galleryImageVersionName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter galleryImageVersionName is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - expand, - apiVersion, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Retrieves information about a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version resides. - * @param galleryImageVersionName The name of the gallery Image Version to be retrieved. - * @param expand The expand expression to apply on the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, - String galleryName, - String galleryImageName, - String galleryImageVersionName, - ReplicationStatusTypes expand, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryImageName == null) { - return Mono - .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); - } - if (galleryImageVersionName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter galleryImageVersionName is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - expand, - apiVersion, - accept, - context); - } - - /** - * Retrieves information about a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version resides. - * @param galleryImageVersionName The name of the gallery Image Version to be retrieved. - * @param expand The expand expression to apply on the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync( - String resourceGroupName, - String galleryName, - String galleryImageName, - String galleryImageVersionName, - ReplicationStatusTypes expand) { - return getWithResponseAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Retrieves information about a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version resides. - * @param galleryImageVersionName The name of the gallery Image Version to be retrieved. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync( - String resourceGroupName, String galleryName, String galleryImageName, String galleryImageVersionName) { - final ReplicationStatusTypes expand = null; - return getWithResponseAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Retrieves information about a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version resides. - * @param galleryImageVersionName The name of the gallery Image Version to be retrieved. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryImageVersionInner get( - String resourceGroupName, String galleryName, String galleryImageName, String galleryImageVersionName) { - final ReplicationStatusTypes expand = null; - return getAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, expand).block(); - } - - /** - * Retrieves information about a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version resides. - * @param galleryImageVersionName The name of the gallery Image Version to be retrieved. - * @param expand The expand expression to apply on the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, - String galleryName, - String galleryImageName, - String galleryImageVersionName, - ReplicationStatusTypes expand, - Context context) { - return getWithResponseAsync( - resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, expand, context) - .block(); - } - - /** - * Delete a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version resides. - * @param galleryImageVersionName The name of the gallery Image Version to be deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync( - String resourceGroupName, String galleryName, String galleryImageName, String galleryImageVersionName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryImageName == null) { - return Mono - .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); - } - if (galleryImageVersionName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter galleryImageVersionName is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - apiVersion, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version resides. - * @param galleryImageVersionName The name of the gallery Image Version to be deleted. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, - String galleryName, - String galleryImageName, - String galleryImageVersionName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryImageName == null) { - return Mono - .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); - } - if (galleryImageVersionName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter galleryImageVersionName is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - apiVersion, - accept, - context); - } - - /** - * Delete a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version resides. - * @param galleryImageVersionName The name of the gallery Image Version to be deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String galleryName, String galleryImageName, String galleryImageVersionName) { - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Delete a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version resides. - * @param galleryImageVersionName The name of the gallery Image Version to be deleted. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, - String galleryName, - String galleryImageName, - String galleryImageVersionName, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Delete a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version resides. - * @param galleryImageVersionName The name of the gallery Image Version to be deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String galleryName, String galleryImageName, String galleryImageVersionName) { - return beginDeleteAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName) - .getSyncPoller(); - } - - /** - * Delete a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version resides. - * @param galleryImageVersionName The name of the gallery Image Version to be deleted. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, - String galleryName, - String galleryImageName, - String galleryImageVersionName, - Context context) { - return beginDeleteAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, context) - .getSyncPoller(); - } - - /** - * Delete a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version resides. - * @param galleryImageVersionName The name of the gallery Image Version to be deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync( - String resourceGroupName, String galleryName, String galleryImageName, String galleryImageVersionName) { - return beginDeleteAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Delete a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version resides. - * @param galleryImageVersionName The name of the gallery Image Version to be deleted. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync( - String resourceGroupName, - String galleryName, - String galleryImageName, - String galleryImageVersionName, - Context context) { - return beginDeleteAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Delete a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version resides. - * @param galleryImageVersionName The name of the gallery Image Version to be deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete( - String resourceGroupName, String galleryName, String galleryImageName, String galleryImageVersionName) { - deleteAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName).block(); - } - - /** - * Delete a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version resides. - * @param galleryImageVersionName The name of the gallery Image Version to be deleted. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete( - String resourceGroupName, - String galleryName, - String galleryImageName, - String galleryImageVersionName, - Context context) { - deleteAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, context).block(); - } - - /** - * List gallery Image Versions in a gallery Image Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the Shared Image Gallery Image Definition from which the Image Versions are - * to be listed. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Gallery Image version operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByGalleryImageSinglePageAsync( - String resourceGroupName, String galleryName, String galleryImageName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryImageName == null) { - return Mono - .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByGalleryImage( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryImageName, - apiVersion, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List gallery Image Versions in a gallery Image Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the Shared Image Gallery Image Definition from which the Image Versions are - * to be listed. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Gallery Image version operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByGalleryImageSinglePageAsync( - String resourceGroupName, String galleryName, String galleryImageName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryImageName == null) { - return Mono - .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByGalleryImage( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryImageName, - apiVersion, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * List gallery Image Versions in a gallery Image Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the Shared Image Gallery Image Definition from which the Image Versions are - * to be listed. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Gallery Image version operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByGalleryImageAsync( - String resourceGroupName, String galleryName, String galleryImageName) { - return new PagedFlux<>( - () -> listByGalleryImageSinglePageAsync(resourceGroupName, galleryName, galleryImageName), - nextLink -> listByGalleryImageNextSinglePageAsync(nextLink)); - } - - /** - * List gallery Image Versions in a gallery Image Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the Shared Image Gallery Image Definition from which the Image Versions are - * to be listed. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Gallery Image version operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByGalleryImageAsync( - String resourceGroupName, String galleryName, String galleryImageName, Context context) { - return new PagedFlux<>( - () -> listByGalleryImageSinglePageAsync(resourceGroupName, galleryName, galleryImageName, context), - nextLink -> listByGalleryImageNextSinglePageAsync(nextLink, context)); - } - - /** - * List gallery Image Versions in a gallery Image Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the Shared Image Gallery Image Definition from which the Image Versions are - * to be listed. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Gallery Image version operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByGalleryImage( - String resourceGroupName, String galleryName, String galleryImageName) { - return new PagedIterable<>(listByGalleryImageAsync(resourceGroupName, galleryName, galleryImageName)); - } - - /** - * List gallery Image Versions in a gallery Image Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the Shared Image Gallery Image Definition from which the Image Versions are - * to be listed. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Gallery Image version operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByGalleryImage( - String resourceGroupName, String galleryName, String galleryImageName, Context context) { - return new PagedIterable<>(listByGalleryImageAsync(resourceGroupName, galleryName, galleryImageName, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Gallery Image version operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByGalleryImageNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByGalleryImageNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Gallery Image version operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByGalleryImageNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByGalleryImageNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/GalleryImageVersionsImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/GalleryImageVersionsImpl.java deleted file mode 100644 index ca5282df999e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/GalleryImageVersionsImpl.java +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.compute.ComputeManager; -import com.azure.resourcemanager.compute.models.GalleryImageVersion; -import com.azure.resourcemanager.compute.models.GalleryImageVersions; -import com.azure.resourcemanager.compute.fluent.models.GalleryImageVersionInner; -import com.azure.resourcemanager.compute.fluent.GalleryImageVersionsClient; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.WrapperImpl; -import reactor.core.publisher.Mono; -import com.azure.resourcemanager.resources.fluentcore.utils.PagedConverter; - -/** The implementation for GalleryImageVersions. */ -public class GalleryImageVersionsImpl extends WrapperImpl implements GalleryImageVersions { - private final ComputeManager manager; - - public GalleryImageVersionsImpl(ComputeManager manager) { - super(manager.serviceClient().getGalleryImageVersions()); - this.manager = manager; - } - - public ComputeManager manager() { - return this.manager; - } - - @Override - public GalleryImageVersionImpl define(String name) { - return wrapModel(name); - } - - private GalleryImageVersionImpl wrapModel(GalleryImageVersionInner inner) { - return new GalleryImageVersionImpl(inner, manager()); - } - - private GalleryImageVersionImpl wrapModel(String name) { - return new GalleryImageVersionImpl(name, this.manager()); - } - - @Override - public PagedFlux listByGalleryImageAsync( - final String resourceGroupName, final String galleryName, final String galleryImageName) { - return PagedConverter.mapPage(innerModel() - .listByGalleryImageAsync(resourceGroupName, galleryName, galleryImageName), - this::wrapModel); - } - - @Override - public PagedIterable listByGalleryImage( - String resourceGroupName, String galleryName, String galleryImageName) { - return PagedConverter.mapPage(innerModel() - .listByGalleryImage(resourceGroupName, galleryName, galleryImageName), - this::wrapModel); - } - - @Override - public Mono getByGalleryImageAsync( - String resourceGroupName, String galleryName, String galleryImageName, String galleryImageVersionName) { - return innerModel() - .getAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName) - .map(this::wrapModel); - } - - @Override - public GalleryImageVersion getByGalleryImage( - String resourceGroupName, String galleryName, String galleryImageName, String galleryImageVersionName) { - return this - .getByGalleryImageAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName) - .block(); - } - - @Override - public Mono deleteByGalleryImageAsync( - String resourceGroupName, String galleryName, String galleryImageName, String galleryImageVersionName) { - return innerModel().deleteAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName); - } - - @Override - public void deleteByGalleryImage( - String resourceGroupName, String galleryName, String galleryImageName, String galleryImageVersionName) { - this - .deleteByGalleryImageAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName) - .block(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/GalleryImagesClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/GalleryImagesClientImpl.java deleted file mode 100644 index cc8868a18853..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/GalleryImagesClientImpl.java +++ /dev/null @@ -1,1499 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.compute.fluent.GalleryImagesClient; -import com.azure.resourcemanager.compute.fluent.models.GalleryImageInner; -import com.azure.resourcemanager.compute.models.ApiErrorException; -import com.azure.resourcemanager.compute.models.GalleryImageList; -import com.azure.resourcemanager.compute.models.GalleryImageUpdate; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in GalleryImagesClient. */ -public final class GalleryImagesClientImpl implements GalleryImagesClient { - private final ClientLogger logger = new ClientLogger(GalleryImagesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final GalleryImagesService service; - - /** The service client containing this operation class. */ - private final ComputeManagementClientImpl client; - - /** - * Initializes an instance of GalleryImagesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - GalleryImagesClientImpl(ComputeManagementClientImpl client) { - this.service = - RestProxy.create(GalleryImagesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for ComputeManagementClientGalleryImages to be used by the proxy service - * to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "ComputeManagementCli") - private interface GalleryImagesService { - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" - + "/{galleryName}/images/{galleryImageName}") - @ExpectedResponses({200, 201, 202}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("galleryName") String galleryName, - @PathParam("galleryImageName") String galleryImageName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") GalleryImageInner galleryImage, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" - + "/{galleryName}/images/{galleryImageName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono>> update( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("galleryName") String galleryName, - @PathParam("galleryImageName") String galleryImageName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") GalleryImageUpdate galleryImage, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" - + "/{galleryName}/images/{galleryImageName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("galleryName") String galleryName, - @PathParam("galleryImageName") String galleryImageName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" - + "/{galleryName}/images/{galleryImageName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("galleryName") String galleryName, - @PathParam("galleryImageName") String galleryImageName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" - + "/{galleryName}/images") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> listByGallery( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("galleryName") String galleryName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> listByGalleryNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Create or update a gallery Image Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be created. - * @param galleryImageName The name of the gallery Image Definition to be created or updated. The allowed characters - * are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 - * characters. - * @param galleryImage Parameters supplied to the create or update gallery image operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String galleryName, String galleryImageName, GalleryImageInner galleryImage) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryImageName == null) { - return Mono - .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); - } - if (galleryImage == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryImage is required and cannot be null.")); - } else { - galleryImage.validate(); - } - final String apiVersion = "2019-12-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryImageName, - apiVersion, - galleryImage, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create or update a gallery Image Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be created. - * @param galleryImageName The name of the gallery Image Definition to be created or updated. The allowed characters - * are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 - * characters. - * @param galleryImage Parameters supplied to the create or update gallery image operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String galleryName, - String galleryImageName, - GalleryImageInner galleryImage, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryImageName == null) { - return Mono - .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); - } - if (galleryImage == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryImage is required and cannot be null.")); - } else { - galleryImage.validate(); - } - final String apiVersion = "2019-12-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryImageName, - apiVersion, - galleryImage, - accept, - context); - } - - /** - * Create or update a gallery Image Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be created. - * @param galleryImageName The name of the gallery Image Definition to be created or updated. The allowed characters - * are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 - * characters. - * @param galleryImage Parameters supplied to the create or update gallery image operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, GalleryImageInner> beginCreateOrUpdateAsync( - String resourceGroupName, String galleryName, String galleryImageName, GalleryImageInner galleryImage) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, galleryName, galleryImageName, galleryImage); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - GalleryImageInner.class, - GalleryImageInner.class, - this.client.getContext()); - } - - /** - * Create or update a gallery Image Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be created. - * @param galleryImageName The name of the gallery Image Definition to be created or updated. The allowed characters - * are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 - * characters. - * @param galleryImage Parameters supplied to the create or update gallery image operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, GalleryImageInner> beginCreateOrUpdateAsync( - String resourceGroupName, - String galleryName, - String galleryImageName, - GalleryImageInner galleryImage, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, galleryName, galleryImageName, galleryImage, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), GalleryImageInner.class, GalleryImageInner.class, context); - } - - /** - * Create or update a gallery Image Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be created. - * @param galleryImageName The name of the gallery Image Definition to be created or updated. The allowed characters - * are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 - * characters. - * @param galleryImage Parameters supplied to the create or update gallery image operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, GalleryImageInner> beginCreateOrUpdate( - String resourceGroupName, String galleryName, String galleryImageName, GalleryImageInner galleryImage) { - return beginCreateOrUpdateAsync(resourceGroupName, galleryName, galleryImageName, galleryImage).getSyncPoller(); - } - - /** - * Create or update a gallery Image Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be created. - * @param galleryImageName The name of the gallery Image Definition to be created or updated. The allowed characters - * are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 - * characters. - * @param galleryImage Parameters supplied to the create or update gallery image operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, GalleryImageInner> beginCreateOrUpdate( - String resourceGroupName, - String galleryName, - String galleryImageName, - GalleryImageInner galleryImage, - Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, galleryName, galleryImageName, galleryImage, context) - .getSyncPoller(); - } - - /** - * Create or update a gallery Image Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be created. - * @param galleryImageName The name of the gallery Image Definition to be created or updated. The allowed characters - * are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 - * characters. - * @param galleryImage Parameters supplied to the create or update gallery image operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, String galleryName, String galleryImageName, GalleryImageInner galleryImage) { - return beginCreateOrUpdateAsync(resourceGroupName, galleryName, galleryImageName, galleryImage) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create or update a gallery Image Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be created. - * @param galleryImageName The name of the gallery Image Definition to be created or updated. The allowed characters - * are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 - * characters. - * @param galleryImage Parameters supplied to the create or update gallery image operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, - String galleryName, - String galleryImageName, - GalleryImageInner galleryImage, - Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, galleryName, galleryImageName, galleryImage, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create or update a gallery Image Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be created. - * @param galleryImageName The name of the gallery Image Definition to be created or updated. The allowed characters - * are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 - * characters. - * @param galleryImage Parameters supplied to the create or update gallery image operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryImageInner createOrUpdate( - String resourceGroupName, String galleryName, String galleryImageName, GalleryImageInner galleryImage) { - return createOrUpdateAsync(resourceGroupName, galleryName, galleryImageName, galleryImage).block(); - } - - /** - * Create or update a gallery Image Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be created. - * @param galleryImageName The name of the gallery Image Definition to be created or updated. The allowed characters - * are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 - * characters. - * @param galleryImage Parameters supplied to the create or update gallery image operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryImageInner createOrUpdate( - String resourceGroupName, - String galleryName, - String galleryImageName, - GalleryImageInner galleryImage, - Context context) { - return createOrUpdateAsync(resourceGroupName, galleryName, galleryImageName, galleryImage, context).block(); - } - - /** - * Update a gallery Image Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be updated. - * @param galleryImageName The name of the gallery Image Definition to be updated. The allowed characters are - * alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 - * characters. - * @param galleryImage Parameters supplied to the update gallery image operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateWithResponseAsync( - String resourceGroupName, String galleryName, String galleryImageName, GalleryImageUpdate galleryImage) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryImageName == null) { - return Mono - .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); - } - if (galleryImage == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryImage is required and cannot be null.")); - } else { - galleryImage.validate(); - } - final String apiVersion = "2019-12-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryImageName, - apiVersion, - galleryImage, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Update a gallery Image Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be updated. - * @param galleryImageName The name of the gallery Image Definition to be updated. The allowed characters are - * alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 - * characters. - * @param galleryImage Parameters supplied to the update gallery image operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, - String galleryName, - String galleryImageName, - GalleryImageUpdate galleryImage, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryImageName == null) { - return Mono - .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); - } - if (galleryImage == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryImage is required and cannot be null.")); - } else { - galleryImage.validate(); - } - final String apiVersion = "2019-12-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryImageName, - apiVersion, - galleryImage, - accept, - context); - } - - /** - * Update a gallery Image Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be updated. - * @param galleryImageName The name of the gallery Image Definition to be updated. The allowed characters are - * alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 - * characters. - * @param galleryImage Parameters supplied to the update gallery image operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, GalleryImageInner> beginUpdateAsync( - String resourceGroupName, String galleryName, String galleryImageName, GalleryImageUpdate galleryImage) { - Mono>> mono = - updateWithResponseAsync(resourceGroupName, galleryName, galleryImageName, galleryImage); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - GalleryImageInner.class, - GalleryImageInner.class, - this.client.getContext()); - } - - /** - * Update a gallery Image Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be updated. - * @param galleryImageName The name of the gallery Image Definition to be updated. The allowed characters are - * alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 - * characters. - * @param galleryImage Parameters supplied to the update gallery image operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, GalleryImageInner> beginUpdateAsync( - String resourceGroupName, - String galleryName, - String galleryImageName, - GalleryImageUpdate galleryImage, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - updateWithResponseAsync(resourceGroupName, galleryName, galleryImageName, galleryImage, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), GalleryImageInner.class, GalleryImageInner.class, context); - } - - /** - * Update a gallery Image Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be updated. - * @param galleryImageName The name of the gallery Image Definition to be updated. The allowed characters are - * alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 - * characters. - * @param galleryImage Parameters supplied to the update gallery image operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, GalleryImageInner> beginUpdate( - String resourceGroupName, String galleryName, String galleryImageName, GalleryImageUpdate galleryImage) { - return beginUpdateAsync(resourceGroupName, galleryName, galleryImageName, galleryImage).getSyncPoller(); - } - - /** - * Update a gallery Image Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be updated. - * @param galleryImageName The name of the gallery Image Definition to be updated. The allowed characters are - * alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 - * characters. - * @param galleryImage Parameters supplied to the update gallery image operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, GalleryImageInner> beginUpdate( - String resourceGroupName, - String galleryName, - String galleryImageName, - GalleryImageUpdate galleryImage, - Context context) { - return beginUpdateAsync(resourceGroupName, galleryName, galleryImageName, galleryImage, context) - .getSyncPoller(); - } - - /** - * Update a gallery Image Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be updated. - * @param galleryImageName The name of the gallery Image Definition to be updated. The allowed characters are - * alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 - * characters. - * @param galleryImage Parameters supplied to the update gallery image operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync( - String resourceGroupName, String galleryName, String galleryImageName, GalleryImageUpdate galleryImage) { - return beginUpdateAsync(resourceGroupName, galleryName, galleryImageName, galleryImage) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Update a gallery Image Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be updated. - * @param galleryImageName The name of the gallery Image Definition to be updated. The allowed characters are - * alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 - * characters. - * @param galleryImage Parameters supplied to the update gallery image operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, - String galleryName, - String galleryImageName, - GalleryImageUpdate galleryImage, - Context context) { - return beginUpdateAsync(resourceGroupName, galleryName, galleryImageName, galleryImage, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Update a gallery Image Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be updated. - * @param galleryImageName The name of the gallery Image Definition to be updated. The allowed characters are - * alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 - * characters. - * @param galleryImage Parameters supplied to the update gallery image operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryImageInner update( - String resourceGroupName, String galleryName, String galleryImageName, GalleryImageUpdate galleryImage) { - return updateAsync(resourceGroupName, galleryName, galleryImageName, galleryImage).block(); - } - - /** - * Update a gallery Image Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be updated. - * @param galleryImageName The name of the gallery Image Definition to be updated. The allowed characters are - * alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 - * characters. - * @param galleryImage Parameters supplied to the update gallery image operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryImageInner update( - String resourceGroupName, - String galleryName, - String galleryImageName, - GalleryImageUpdate galleryImage, - Context context) { - return updateAsync(resourceGroupName, galleryName, galleryImageName, galleryImage, context).block(); - } - - /** - * Retrieves information about a gallery Image Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery from which the Image Definitions are to be retrieved. - * @param galleryImageName The name of the gallery Image Definition to be retrieved. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String resourceGroupName, String galleryName, String galleryImageName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryImageName == null) { - return Mono - .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryImageName, - apiVersion, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Retrieves information about a gallery Image Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery from which the Image Definitions are to be retrieved. - * @param galleryImageName The name of the gallery Image Definition to be retrieved. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String galleryName, String galleryImageName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryImageName == null) { - return Mono - .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryImageName, - apiVersion, - accept, - context); - } - - /** - * Retrieves information about a gallery Image Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery from which the Image Definitions are to be retrieved. - * @param galleryImageName The name of the gallery Image Definition to be retrieved. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync(String resourceGroupName, String galleryName, String galleryImageName) { - return getWithResponseAsync(resourceGroupName, galleryName, galleryImageName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Retrieves information about a gallery Image Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery from which the Image Definitions are to be retrieved. - * @param galleryImageName The name of the gallery Image Definition to be retrieved. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryImageInner get(String resourceGroupName, String galleryName, String galleryImageName) { - return getAsync(resourceGroupName, galleryName, galleryImageName).block(); - } - - /** - * Retrieves information about a gallery Image Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery from which the Image Definitions are to be retrieved. - * @param galleryImageName The name of the gallery Image Definition to be retrieved. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String galleryName, String galleryImageName, Context context) { - return getWithResponseAsync(resourceGroupName, galleryName, galleryImageName, context).block(); - } - - /** - * Delete a gallery image. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be deleted. - * @param galleryImageName The name of the gallery Image Definition to be deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync( - String resourceGroupName, String galleryName, String galleryImageName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryImageName == null) { - return Mono - .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryImageName, - apiVersion, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete a gallery image. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be deleted. - * @param galleryImageName The name of the gallery Image Definition to be deleted. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String galleryName, String galleryImageName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryImageName == null) { - return Mono - .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryImageName, - apiVersion, - accept, - context); - } - - /** - * Delete a gallery image. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be deleted. - * @param galleryImageName The name of the gallery Image Definition to be deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String galleryName, String galleryImageName) { - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, galleryName, galleryImageName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Delete a gallery image. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be deleted. - * @param galleryImageName The name of the gallery Image Definition to be deleted. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String galleryName, String galleryImageName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, galleryName, galleryImageName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Delete a gallery image. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be deleted. - * @param galleryImageName The name of the gallery Image Definition to be deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String galleryName, String galleryImageName) { - return beginDeleteAsync(resourceGroupName, galleryName, galleryImageName).getSyncPoller(); - } - - /** - * Delete a gallery image. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be deleted. - * @param galleryImageName The name of the gallery Image Definition to be deleted. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String galleryName, String galleryImageName, Context context) { - return beginDeleteAsync(resourceGroupName, galleryName, galleryImageName, context).getSyncPoller(); - } - - /** - * Delete a gallery image. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be deleted. - * @param galleryImageName The name of the gallery Image Definition to be deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String galleryName, String galleryImageName) { - return beginDeleteAsync(resourceGroupName, galleryName, galleryImageName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Delete a gallery image. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be deleted. - * @param galleryImageName The name of the gallery Image Definition to be deleted. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync( - String resourceGroupName, String galleryName, String galleryImageName, Context context) { - return beginDeleteAsync(resourceGroupName, galleryName, galleryImageName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Delete a gallery image. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be deleted. - * @param galleryImageName The name of the gallery Image Definition to be deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String galleryName, String galleryImageName) { - deleteAsync(resourceGroupName, galleryName, galleryImageName).block(); - } - - /** - * Delete a gallery image. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be deleted. - * @param galleryImageName The name of the gallery Image Definition to be deleted. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String galleryName, String galleryImageName, Context context) { - deleteAsync(resourceGroupName, galleryName, galleryImageName, context).block(); - } - - /** - * List gallery Image Definitions in a gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery from which Image Definitions are to be listed. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Gallery Images operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByGallerySinglePageAsync( - String resourceGroupName, String galleryName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByGallery( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - apiVersion, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List gallery Image Definitions in a gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery from which Image Definitions are to be listed. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Gallery Images operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByGallerySinglePageAsync( - String resourceGroupName, String galleryName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByGallery( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - apiVersion, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * List gallery Image Definitions in a gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery from which Image Definitions are to be listed. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Gallery Images operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByGalleryAsync(String resourceGroupName, String galleryName) { - return new PagedFlux<>( - () -> listByGallerySinglePageAsync(resourceGroupName, galleryName), - nextLink -> listByGalleryNextSinglePageAsync(nextLink)); - } - - /** - * List gallery Image Definitions in a gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery from which Image Definitions are to be listed. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Gallery Images operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByGalleryAsync( - String resourceGroupName, String galleryName, Context context) { - return new PagedFlux<>( - () -> listByGallerySinglePageAsync(resourceGroupName, galleryName, context), - nextLink -> listByGalleryNextSinglePageAsync(nextLink, context)); - } - - /** - * List gallery Image Definitions in a gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery from which Image Definitions are to be listed. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Gallery Images operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByGallery(String resourceGroupName, String galleryName) { - return new PagedIterable<>(listByGalleryAsync(resourceGroupName, galleryName)); - } - - /** - * List gallery Image Definitions in a gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery from which Image Definitions are to be listed. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Gallery Images operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByGallery( - String resourceGroupName, String galleryName, Context context) { - return new PagedIterable<>(listByGalleryAsync(resourceGroupName, galleryName, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Gallery Images operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByGalleryNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByGalleryNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Gallery Images operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByGalleryNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByGalleryNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/GalleryImagesImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/GalleryImagesImpl.java deleted file mode 100644 index 8ee171228428..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/GalleryImagesImpl.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.compute.ComputeManager; -import com.azure.resourcemanager.compute.models.GalleryImage; -import com.azure.resourcemanager.compute.models.GalleryImages; -import com.azure.resourcemanager.compute.fluent.models.GalleryImageInner; -import com.azure.resourcemanager.compute.fluent.GalleryImagesClient; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.WrapperImpl; -import reactor.core.publisher.Mono; -import com.azure.resourcemanager.resources.fluentcore.utils.PagedConverter; - -/** The implementation for GalleryImages. */ -public class GalleryImagesImpl extends WrapperImpl implements GalleryImages { - private final ComputeManager manager; - - public GalleryImagesImpl(ComputeManager manager) { - super(manager.serviceClient().getGalleryImages()); - this.manager = manager; - } - - public ComputeManager manager() { - return this.manager; - } - - @Override - public GalleryImageImpl define(String name) { - return wrapModel(name); - } - - private GalleryImageImpl wrapModel(GalleryImageInner inner) { - return new GalleryImageImpl(inner, manager()); - } - - private GalleryImageImpl wrapModel(String name) { - return new GalleryImageImpl(name, this.manager()); - } - - @Override - public PagedFlux listByGalleryAsync(final String resourceGroupName, final String galleryName) { - return PagedConverter.mapPage(innerModel().listByGalleryAsync(resourceGroupName, galleryName), this::wrapModel); - } - - @Override - public PagedIterable listByGallery(String resourceGroupName, String galleryName) { - return PagedConverter.mapPage(innerModel().listByGallery(resourceGroupName, galleryName), this::wrapModel); - } - - @Override - public Mono getByGalleryAsync(String resourceGroupName, String galleryName, String galleryImageName) { - return innerModel().getAsync(resourceGroupName, galleryName, galleryImageName).map(this::wrapModel); - } - - @Override - public GalleryImage getByGallery(String resourceGroupName, String galleryName, String galleryImageName) { - return this.getByGalleryAsync(resourceGroupName, galleryName, galleryImageName).block(); - } - - @Override - public Mono deleteByGalleryAsync(String resourceGroupName, String galleryName, String galleryImageName) { - return innerModel().deleteAsync(resourceGroupName, galleryName, galleryImageName); - } - - @Override - public void deleteByGallery(String resourceGroupName, String galleryName, String galleryImageName) { - this.deleteByGalleryAsync(resourceGroupName, galleryName, galleryImageName).block(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/GalleryImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/GalleryImpl.java deleted file mode 100644 index 29859cc45548..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/GalleryImpl.java +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.compute.ComputeManager; -import com.azure.resourcemanager.compute.models.Gallery; -import com.azure.resourcemanager.compute.models.GalleryImage; -import com.azure.resourcemanager.compute.fluent.models.GalleryInner; -import com.azure.resourcemanager.compute.models.GalleryUpdate; -import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.GroupableResourceImpl; -import reactor.core.publisher.Mono; - -/** The implementation for Gallery and its create and update interfaces. */ -class GalleryImpl extends GroupableResourceImpl - implements Gallery, Gallery.Definition, Gallery.Update { - - private GalleryUpdate updateParameters = new GalleryUpdate(); - - GalleryImpl(String name, GalleryInner inner, ComputeManager manager) { - super(name, inner, manager); - } - - @Override - public Mono createResourceAsync() { - return manager() - .serviceClient() - .getGalleries() - .createOrUpdateAsync(this.resourceGroupName(), this.name(), this.innerModel()) - .map(innerToFluentMap(this)); - } - - @Override - public Mono updateResourceAsync() { - if (this.innerModel().tags() != null) { - // tags is set by super - updateParameters.withTags(this.innerModel().tags()); - } - - return manager() - .serviceClient() - .getGalleries() - .updateAsync(this.resourceGroupName(), this.name(), updateParameters) - .map(innerToFluentMap(this)); - } - - @Override - public GalleryImpl update() { - updateParameters = new GalleryUpdate(); - return super.update(); - } - - @Override - protected Mono getInnerAsync() { - return manager().serviceClient().getGalleries().getByResourceGroupAsync(this.resourceGroupName(), this.name()); - } - - @Override - public boolean isInCreateMode() { - return this.innerModel().id() == null; - } - - @Override - public String description() { - return this.innerModel().description(); - } - - @Override - public String uniqueName() { - return this.innerModel().identifier().uniqueName(); - } - - @Override - public String provisioningState() { - return this.innerModel().provisioningState().toString(); - } - - @Override - public Mono getImageAsync(String imageName) { - return this.manager().galleryImages().getByGalleryAsync(this.resourceGroupName(), this.name(), imageName); - } - - @Override - public GalleryImage getImage(String imageName) { - return this.manager().galleryImages().getByGallery(this.resourceGroupName(), this.name(), imageName); - } - - @Override - public PagedFlux listImagesAsync() { - return this.manager().galleryImages().listByGalleryAsync(this.resourceGroupName(), this.name()); - } - - @Override - public PagedIterable listImages() { - return this.manager().galleryImages().listByGallery(this.resourceGroupName(), this.name()); - } - - @Override - public GalleryImpl withDescription(String description) { - if (isInCreateMode()) { - this.innerModel().withDescription(description); - } else { - updateParameters.withDescription(description); - } - return this; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/ImagesClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/ImagesClientImpl.java deleted file mode 100644 index 215955ed35bd..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/ImagesClientImpl.java +++ /dev/null @@ -1,1556 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.compute.fluent.ImagesClient; -import com.azure.resourcemanager.compute.fluent.models.ImageInner; -import com.azure.resourcemanager.compute.models.ImageListResult; -import com.azure.resourcemanager.compute.models.ImageUpdate; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ImagesClient. */ -public final class ImagesClientImpl - implements InnerSupportsGet, InnerSupportsListing, InnerSupportsDelete, ImagesClient { - private final ClientLogger logger = new ClientLogger(ImagesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final ImagesService service; - - /** The service client containing this operation class. */ - private final ComputeManagementClientImpl client; - - /** - * Initializes an instance of ImagesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ImagesClientImpl(ComputeManagementClientImpl client) { - this.service = RestProxy.create(ImagesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for ComputeManagementClientImages to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "ComputeManagementCli") - private interface ImagesService { - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images" - + "/{imageName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("imageName") String imageName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") ImageInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images" - + "/{imageName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("imageName") String imageName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") ImageUpdate parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images" - + "/{imageName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("imageName") String imageName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images" - + "/{imageName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("imageName") String imageName, - @QueryParam("$expand") String expand, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/images") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Create or update an image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @param parameters Parameters supplied to the Create Image operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source user image virtual hard disk. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String imageName, ImageInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (imageName == null) { - return Mono.error(new IllegalArgumentException("Parameter imageName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - imageName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create or update an image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @param parameters Parameters supplied to the Create Image operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source user image virtual hard disk. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String imageName, ImageInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (imageName == null) { - return Mono.error(new IllegalArgumentException("Parameter imageName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - imageName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Create or update an image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @param parameters Parameters supplied to the Create Image operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source user image virtual hard disk. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, ImageInner> beginCreateOrUpdateAsync( - String resourceGroupName, String imageName, ImageInner parameters) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, imageName, parameters); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), ImageInner.class, ImageInner.class, this.client.getContext()); - } - - /** - * Create or update an image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @param parameters Parameters supplied to the Create Image operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source user image virtual hard disk. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, ImageInner> beginCreateOrUpdateAsync( - String resourceGroupName, String imageName, ImageInner parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, imageName, parameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), ImageInner.class, ImageInner.class, context); - } - - /** - * Create or update an image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @param parameters Parameters supplied to the Create Image operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source user image virtual hard disk. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, ImageInner> beginCreateOrUpdate( - String resourceGroupName, String imageName, ImageInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, imageName, parameters).getSyncPoller(); - } - - /** - * Create or update an image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @param parameters Parameters supplied to the Create Image operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source user image virtual hard disk. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, ImageInner> beginCreateOrUpdate( - String resourceGroupName, String imageName, ImageInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, imageName, parameters, context).getSyncPoller(); - } - - /** - * Create or update an image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @param parameters Parameters supplied to the Create Image operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source user image virtual hard disk. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync(String resourceGroupName, String imageName, ImageInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, imageName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create or update an image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @param parameters Parameters supplied to the Create Image operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source user image virtual hard disk. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String imageName, ImageInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, imageName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create or update an image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @param parameters Parameters supplied to the Create Image operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source user image virtual hard disk. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ImageInner createOrUpdate(String resourceGroupName, String imageName, ImageInner parameters) { - return createOrUpdateAsync(resourceGroupName, imageName, parameters).block(); - } - - /** - * Create or update an image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @param parameters Parameters supplied to the Create Image operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source user image virtual hard disk. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ImageInner createOrUpdate( - String resourceGroupName, String imageName, ImageInner parameters, Context context) { - return createOrUpdateAsync(resourceGroupName, imageName, parameters, context).block(); - } - - /** - * Update an image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @param parameters Parameters supplied to the Update Image operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source user image virtual hard disk. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateWithResponseAsync( - String resourceGroupName, String imageName, ImageUpdate parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (imageName == null) { - return Mono.error(new IllegalArgumentException("Parameter imageName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - resourceGroupName, - imageName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Update an image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @param parameters Parameters supplied to the Update Image operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source user image virtual hard disk. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, String imageName, ImageUpdate parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (imageName == null) { - return Mono.error(new IllegalArgumentException("Parameter imageName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - resourceGroupName, - imageName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Update an image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @param parameters Parameters supplied to the Update Image operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source user image virtual hard disk. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, ImageInner> beginUpdateAsync( - String resourceGroupName, String imageName, ImageUpdate parameters) { - Mono>> mono = updateWithResponseAsync(resourceGroupName, imageName, parameters); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), ImageInner.class, ImageInner.class, this.client.getContext()); - } - - /** - * Update an image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @param parameters Parameters supplied to the Update Image operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source user image virtual hard disk. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, ImageInner> beginUpdateAsync( - String resourceGroupName, String imageName, ImageUpdate parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - updateWithResponseAsync(resourceGroupName, imageName, parameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), ImageInner.class, ImageInner.class, context); - } - - /** - * Update an image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @param parameters Parameters supplied to the Update Image operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source user image virtual hard disk. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, ImageInner> beginUpdate( - String resourceGroupName, String imageName, ImageUpdate parameters) { - return beginUpdateAsync(resourceGroupName, imageName, parameters).getSyncPoller(); - } - - /** - * Update an image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @param parameters Parameters supplied to the Update Image operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source user image virtual hard disk. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, ImageInner> beginUpdate( - String resourceGroupName, String imageName, ImageUpdate parameters, Context context) { - return beginUpdateAsync(resourceGroupName, imageName, parameters, context).getSyncPoller(); - } - - /** - * Update an image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @param parameters Parameters supplied to the Update Image operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source user image virtual hard disk. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync(String resourceGroupName, String imageName, ImageUpdate parameters) { - return beginUpdateAsync(resourceGroupName, imageName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Update an image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @param parameters Parameters supplied to the Update Image operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source user image virtual hard disk. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, String imageName, ImageUpdate parameters, Context context) { - return beginUpdateAsync(resourceGroupName, imageName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Update an image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @param parameters Parameters supplied to the Update Image operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source user image virtual hard disk. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ImageInner update(String resourceGroupName, String imageName, ImageUpdate parameters) { - return updateAsync(resourceGroupName, imageName, parameters).block(); - } - - /** - * Update an image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @param parameters Parameters supplied to the Update Image operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source user image virtual hard disk. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ImageInner update(String resourceGroupName, String imageName, ImageUpdate parameters, Context context) { - return updateAsync(resourceGroupName, imageName, parameters, context).block(); - } - - /** - * Deletes an Image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync(String resourceGroupName, String imageName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (imageName == null) { - return Mono.error(new IllegalArgumentException("Parameter imageName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - imageName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes an Image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String imageName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (imageName == null) { - return Mono.error(new IllegalArgumentException("Parameter imageName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - imageName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Deletes an Image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String imageName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, imageName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deletes an Image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String imageName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(resourceGroupName, imageName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes an Image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete(String resourceGroupName, String imageName) { - return beginDeleteAsync(resourceGroupName, imageName).getSyncPoller(); - } - - /** - * Deletes an Image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete(String resourceGroupName, String imageName, Context context) { - return beginDeleteAsync(resourceGroupName, imageName, context).getSyncPoller(); - } - - /** - * Deletes an Image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String imageName) { - return beginDeleteAsync(resourceGroupName, imageName).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes an Image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String imageName, Context context) { - return beginDeleteAsync(resourceGroupName, imageName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes an Image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String imageName) { - deleteAsync(resourceGroupName, imageName).block(); - } - - /** - * Deletes an Image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String imageName, Context context) { - deleteAsync(resourceGroupName, imageName, context).block(); - } - - /** - * Gets an image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @param expand The expand expression to apply on the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an image. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String imageName, String expand) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (imageName == null) { - return Mono.error(new IllegalArgumentException("Parameter imageName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - imageName, - expand, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets an image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @param expand The expand expression to apply on the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an image. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String imageName, String expand, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (imageName == null) { - return Mono.error(new IllegalArgumentException("Parameter imageName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - imageName, - expand, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets an image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @param expand The expand expression to apply on the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an image. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync(String resourceGroupName, String imageName, String expand) { - return getByResourceGroupWithResponseAsync(resourceGroupName, imageName, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets an image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an image. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync(String resourceGroupName, String imageName) { - final String expand = null; - return getByResourceGroupWithResponseAsync(resourceGroupName, imageName, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets an image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an image. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ImageInner getByResourceGroup(String resourceGroupName, String imageName) { - final String expand = null; - return getByResourceGroupAsync(resourceGroupName, imageName, expand).block(); - } - - /** - * Gets an image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @param expand The expand expression to apply on the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an image. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String imageName, String expand, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, imageName, expand, context).block(); - } - - /** - * Gets the list of images under a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of images under a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the list of images under a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of images under a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets the list of images under a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of images under a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * Gets the list of images under a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of images under a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets the list of images under a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of images under a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * Gets the list of images under a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of images under a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * Gets the list of Images in the subscription. Use nextLink property in the response to get the next page of - * Images. Do this till nextLink is null to fetch all the Images. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Images in the subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the list of Images in the subscription. Use nextLink property in the response to get the next page of - * Images. Do this till nextLink is null to fetch all the Images. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Images in the subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets the list of Images in the subscription. Use nextLink property in the response to get the next page of - * Images. Do this till nextLink is null to fetch all the Images. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Images in the subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets the list of Images in the subscription. Use nextLink property in the response to get the next page of - * Images. Do this till nextLink is null to fetch all the Images. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Images in the subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets the list of Images in the subscription. Use nextLink property in the response to get the next page of - * Images. Do this till nextLink is null to fetch all the Images. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Images in the subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Gets the list of Images in the subscription. Use nextLink property in the response to get the next page of - * Images. Do this till nextLink is null to fetch all the Images. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Images in the subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Image operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Image operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Image operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Image operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/LinuxDiskVolumeLegacyEncryptionMonitorImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/LinuxDiskVolumeLegacyEncryptionMonitorImpl.java deleted file mode 100644 index 10f11b048eee..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/LinuxDiskVolumeLegacyEncryptionMonitorImpl.java +++ /dev/null @@ -1,154 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.implementation; - -import com.azure.resourcemanager.compute.ComputeManager; -import com.azure.resourcemanager.compute.models.DiskVolumeEncryptionMonitor; -import com.azure.resourcemanager.compute.models.EncryptionStatus; -import com.azure.resourcemanager.compute.models.InstanceViewStatus; -import com.azure.resourcemanager.compute.models.OperatingSystemTypes; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineExtensionInner; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils; -import java.util.HashMap; -import java.util.Map; -import reactor.core.publisher.Mono; - -/** - * The implementation for DiskVolumeEncryptionStatus for Linux virtual machine. This implementation monitor status of - * encrypt-decrypt through legacy encryption extension. - */ -class LinuxDiskVolumeLegacyEncryptionMonitorImpl implements DiskVolumeEncryptionMonitor { - private final String rgName; - private final String vmName; - private final ComputeManager computeManager; - private VirtualMachineExtensionInner encryptionExtension; - - /** - * Creates LinuxDiskVolumeLegacyEncryptionMonitorImpl. - * - * @param virtualMachineId resource id of Linux virtual machine to retrieve encryption status from - * @param computeManager compute manager - */ - LinuxDiskVolumeLegacyEncryptionMonitorImpl(String virtualMachineId, ComputeManager computeManager) { - this.rgName = ResourceUtils.groupFromResourceId(virtualMachineId); - this.vmName = ResourceUtils.nameFromResourceId(virtualMachineId); - this.computeManager = computeManager; - } - - @Override - public OperatingSystemTypes osType() { - return OperatingSystemTypes.LINUX; - } - - @Override - public String progressMessage() { - if (!hasEncryptionExtension()) { - return null; - } - return LinuxEncryptionExtensionUtil.progressMessage(this.encryptionExtension.instanceView()); - } - - @Override - public EncryptionStatus osDiskStatus() { - if (!hasEncryptionExtension()) { - return EncryptionStatus.NOT_ENCRYPTED; - } - return LinuxEncryptionExtensionUtil.osDiskStatus(this.encryptionExtension.instanceView()); - } - - @Override - public EncryptionStatus dataDiskStatus() { - if (!hasEncryptionExtension()) { - return EncryptionStatus.NOT_ENCRYPTED; - } - return LinuxEncryptionExtensionUtil.dataDiskStatus(this.encryptionExtension.instanceView()); - } - - @Override - public Map diskInstanceViewEncryptionStatuses() { - // Not available for legacy based encryption - return new HashMap(); - } - - @Override - public DiskVolumeEncryptionMonitor refresh() { - return refreshAsync().block(); - } - - @Override - public Mono refreshAsync() { - // Refreshes the cached encryption extension installed in the Linux virtual machine. - final DiskVolumeEncryptionMonitor self = this; - return retrieveEncryptExtensionWithInstanceViewAsync() - .flatMap( - virtualMachineExtensionInner -> { - encryptionExtension = virtualMachineExtensionInner; - return Mono.just(self); - }) - .switchIfEmpty(Mono.just(self)); - } - - /** - * Retrieves the latest state of encryption extension in the virtual machine. - * - * @return the retrieved extension - */ - private Mono retrieveEncryptExtensionWithInstanceViewAsync() { - if (encryptionExtension != null) { - // If there is already a cached extension simply retrieve it again with instance view. - return retrieveExtensionWithInstanceViewAsync(encryptionExtension); - } else { - // Extension is not cached already so retrieve name from the virtual machine and - // then get the extension with instance view. - return retrieveEncryptExtensionWithInstanceViewFromVMAsync(); - } - } - - /** - * Retrieve the extension with latest state. If the extension could not be found then an empty observable will be - * returned. - * - * @param extension the extension name - * @return an observable that emits the retrieved extension - */ - private Mono retrieveExtensionWithInstanceViewAsync( - VirtualMachineExtensionInner extension) { - return computeManager - .serviceClient() - .getVirtualMachineExtensions() - .getAsync(rgName, vmName, extension.name(), "instanceView"); - } - - /** - * Retrieve the encryption extension from the virtual machine and then retrieve it again with instance view - * expanded. If the virtual machine does not exists then an error observable will be returned, if the extension - * could not be located then an empty observable will be returned. - * - * @return the retrieved extension - */ - private Mono retrieveEncryptExtensionWithInstanceViewFromVMAsync() { - return computeManager - .serviceClient() - .getVirtualMachines() - .getByResourceGroupAsync(rgName, vmName) - // Exception if vm not found - .flatMap( - virtualMachine -> { - if (virtualMachine.resources() != null) { - for (VirtualMachineExtensionInner extension : virtualMachine.resources()) { - if (EncryptionExtensionIdentifier.isEncryptionPublisherName(extension.publisher()) - && EncryptionExtensionIdentifier - .isEncryptionTypeName(extension.typePropertiesType(), OperatingSystemTypes.LINUX)) { - return retrieveExtensionWithInstanceViewAsync(extension); - } - } - } - return Mono.empty(); - }); - } - - private boolean hasEncryptionExtension() { - return this.encryptionExtension != null; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/LinuxDiskVolumeNoAADEncryptionMonitorImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/LinuxDiskVolumeNoAADEncryptionMonitorImpl.java deleted file mode 100644 index 29836c87cbae..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/LinuxDiskVolumeNoAADEncryptionMonitorImpl.java +++ /dev/null @@ -1,158 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.implementation; - -import com.azure.resourcemanager.compute.ComputeManager; -import com.azure.resourcemanager.compute.models.DiskInstanceView; -import com.azure.resourcemanager.compute.models.DiskVolumeEncryptionMonitor; -import com.azure.resourcemanager.compute.models.EncryptionStatus; -import com.azure.resourcemanager.compute.models.InstanceViewStatus; -import com.azure.resourcemanager.compute.models.InstanceViewTypes; -import com.azure.resourcemanager.compute.models.OperatingSystemTypes; -import com.azure.resourcemanager.compute.models.VirtualMachineExtensionInstanceView; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineInner; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils; -import reactor.core.publisher.Mono; - -import java.util.HashMap; -import java.util.Locale; -import java.util.Map; - -/** - * The implementation for DiskVolumeEncryptionStatus for Linux virtual machine. This implementation monitor status of - * encrypt-decrypt through new NoAAD encryption extension. - */ -class LinuxDiskVolumeNoAADEncryptionMonitorImpl implements DiskVolumeEncryptionMonitor { - private final String rgName; - private final String vmName; - private final ComputeManager computeManager; - private VirtualMachineInner virtualMachine; - private VirtualMachineExtensionInstanceView extensionInstanceView; - - /** - * Creates LinuxDiskVolumeNoAADEncryptionMonitorImpl. - * - * @param virtualMachineId resource id of Linux virtual machine to retrieve encryption status from - * @param computeManager compute manager - */ - LinuxDiskVolumeNoAADEncryptionMonitorImpl(String virtualMachineId, ComputeManager computeManager) { - this.rgName = ResourceUtils.groupFromResourceId(virtualMachineId); - this.vmName = ResourceUtils.nameFromResourceId(virtualMachineId); - this.computeManager = computeManager; - } - - @Override - public OperatingSystemTypes osType() { - return OperatingSystemTypes.LINUX; - } - - @Override - public String progressMessage() { - if (!hasEncryptionExtensionInstanceView()) { - return null; - } - return LinuxEncryptionExtensionUtil.progressMessage(this.extensionInstanceView); - } - - @Override - public EncryptionStatus osDiskStatus() { - if (!hasEncryptionExtensionInstanceView()) { - return EncryptionStatus.NOT_ENCRYPTED; - } - return LinuxEncryptionExtensionUtil.osDiskStatus(this.extensionInstanceView); - } - - @Override - public EncryptionStatus dataDiskStatus() { - if (!hasEncryptionExtensionInstanceView()) { - return EncryptionStatus.NOT_ENCRYPTED; - } - return LinuxEncryptionExtensionUtil.dataDiskStatus(this.extensionInstanceView); - } - - @Override - public Map diskInstanceViewEncryptionStatuses() { - if (virtualMachine.instanceView() == null || virtualMachine.instanceView().disks() == null) { - return new HashMap<>(); - } - // - HashMap div = new HashMap(); - for (DiskInstanceView diskInstanceView : virtualMachine.instanceView().disks()) { - for (InstanceViewStatus status : diskInstanceView.statuses()) { - if (encryptionStatusFromCode(status.code()) != null) { - div.put(diskInstanceView.name(), status); - break; - } - } - } - return div; - } - - @Override - public DiskVolumeEncryptionMonitor refresh() { - return refreshAsync().block(); - } - - @Override - public Mono refreshAsync() { - final LinuxDiskVolumeNoAADEncryptionMonitorImpl self = this; - // Refreshes the cached virtual machine and installed encryption extension - return retrieveVirtualMachineAsync() - .flatMap( - virtualMachine -> { - self.virtualMachine = virtualMachine; - if (virtualMachine.instanceView() != null && virtualMachine.instanceView().extensions() != null) { - for (VirtualMachineExtensionInstanceView eiv : virtualMachine.instanceView().extensions()) { - if (eiv.type() != null - && eiv - .type() - .toLowerCase(Locale.ROOT) - .startsWith(EncryptionExtensionIdentifier.publisherName().toLowerCase(Locale.ROOT)) - && eiv.name() != null - && EncryptionExtensionIdentifier.isEncryptionTypeName(eiv.name(), osType())) { - self.extensionInstanceView = eiv; - break; - } - } - } - return Mono.just(self); - }); - } - - /** - * Retrieve the virtual machine. If the virtual machine does not exists then an error observable will be returned. - * - * @return the retrieved virtual machine - */ - private Mono retrieveVirtualMachineAsync() { - return computeManager.serviceClient().getVirtualMachines() - .getByResourceGroupAsync(rgName, vmName, InstanceViewTypes.INSTANCE_VIEW); - // Exception if vm not found - } - - private boolean hasEncryptionExtensionInstanceView() { - return this.extensionInstanceView != null; - } - - /** - * Given disk instance view status code, check whether it is encryption status code if yes map it to - * EncryptionStatus. - * - * @param code the encryption status code - * @return mapped EncryptionStatus if given code is encryption status code, null otherwise. - */ - private static EncryptionStatus encryptionStatusFromCode(String code) { - if (code != null && code.toLowerCase(Locale.ROOT).startsWith("encryptionstate")) { - // e.g. "code": "EncryptionState/encrypted" - // "code": "EncryptionState/notEncrypted" - String[] parts = code.split("/", 2); - if (parts.length != 2) { - return EncryptionStatus.UNKNOWN; - } else { - return EncryptionStatus.fromString(parts[1]); - } - } - return null; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/LinuxEncryptionExtensionUtil.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/LinuxEncryptionExtensionUtil.java deleted file mode 100644 index 27c3346ebcbb..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/LinuxEncryptionExtensionUtil.java +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.implementation; - -import com.azure.resourcemanager.compute.models.EncryptionStatus; -import com.azure.resourcemanager.compute.models.InstanceViewStatus; -import com.azure.resourcemanager.compute.models.VirtualMachineExtensionInstanceView; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.MissingNode; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -class LinuxEncryptionExtensionUtil { - /** - * Gets the encryption progress message. - * - * @param instanceView encryption extension instance view - * @return the encryption progress message - */ - static String progressMessage(VirtualMachineExtensionInstanceView instanceView) { - List statuses = instanceViewStatuses(instanceView); - if (statuses.size() == 0) { - return null; - } - return statuses.get(0).message(); - } - - /** - * Retrieves the operating system disk encryption status from the given instance view. - * - * @param instanceView encryption extension instance view - * @return os disk status - */ - static EncryptionStatus osDiskStatus(VirtualMachineExtensionInstanceView instanceView) { - final JsonNode subStatusNode = instanceViewFirstSubStatus(instanceView); - if (subStatusNode == null) { - return EncryptionStatus.UNKNOWN; - } - JsonNode diskNode = subStatusNode.path("os"); - if (diskNode instanceof MissingNode) { - return EncryptionStatus.UNKNOWN; - } - return EncryptionStatus.fromString(diskNode.asText()); - } - - /** - * Retrieves the data disk encryption status from the given instance view. - * - * @param instanceView encryption extension instance view - * @return data disk status - */ - static EncryptionStatus dataDiskStatus(VirtualMachineExtensionInstanceView instanceView) { - final JsonNode subStatusNode = instanceViewFirstSubStatus(instanceView); - if (subStatusNode == null) { - return EncryptionStatus.UNKNOWN; - } - JsonNode diskNode = subStatusNode.path("data"); - if (diskNode instanceof MissingNode) { - return EncryptionStatus.UNKNOWN; - } - return EncryptionStatus.fromString(diskNode.asText()); - } - - /** - * the instance view status collection associated with the provided encryption extension. - * - * @param instanceView the extension instance view - * @return status collection - */ - static List instanceViewStatuses(VirtualMachineExtensionInstanceView instanceView) { - if (instanceView == null || instanceView.statuses() == null) { - return new ArrayList<>(); - } - return instanceView.statuses(); - } - - /** - * the first sub-status from instance view sub-status collection associated with the provided encryption extension. - * - * @param instanceView the extension instance view - * @return the first sub-status - */ - static JsonNode instanceViewFirstSubStatus(VirtualMachineExtensionInstanceView instanceView) { - if (instanceView == null || instanceView.substatuses() == null) { - return null; - } - List instanceViewSubStatuses = instanceView.substatuses(); - if (instanceViewSubStatuses.size() == 0) { - return null; - } - ObjectMapper mapper = new ObjectMapper(); - final JsonNode rootNode; - try { - rootNode = mapper.readTree(instanceViewSubStatuses.get(0).message()); - } catch (IOException exception) { - return null; - } - return rootNode; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/LogAnalyticsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/LogAnalyticsClientImpl.java deleted file mode 100644 index de44fece379d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/LogAnalyticsClientImpl.java +++ /dev/null @@ -1,608 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.compute.fluent.LogAnalyticsClient; -import com.azure.resourcemanager.compute.fluent.models.LogAnalyticsOperationResultInner; -import com.azure.resourcemanager.compute.models.RequestRateByIntervalInput; -import com.azure.resourcemanager.compute.models.ThrottledRequestsInput; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in LogAnalyticsClient. */ -public final class LogAnalyticsClientImpl implements LogAnalyticsClient { - private final ClientLogger logger = new ClientLogger(LogAnalyticsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final LogAnalyticsService service; - - /** The service client containing this operation class. */ - private final ComputeManagementClientImpl client; - - /** - * Initializes an instance of LogAnalyticsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - LogAnalyticsClientImpl(ComputeManagementClientImpl client) { - this.service = - RestProxy.create(LogAnalyticsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for ComputeManagementClientLogAnalytics to be used by the proxy service - * to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "ComputeManagementCli") - private interface LogAnalyticsService { - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/logAnalytics/apiAccess" - + "/getRequestRateByInterval") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> exportRequestRateByInterval( - @HostParam("$host") String endpoint, - @PathParam("location") String location, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") RequestRateByIntervalInput parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/logAnalytics/apiAccess" - + "/getThrottledRequests") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> exportThrottledRequests( - @HostParam("$host") String endpoint, - @PathParam("location") String location, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") ThrottledRequestsInput parameters, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Export logs that show Api requests made by this subscription in the given time window to show throttling - * activities. - * - * @param location The location upon which virtual-machine-sizes is queried. - * @param parameters Parameters supplied to the LogAnalytics getRequestRateByInterval Api. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return logAnalytics operation status response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> exportRequestRateByIntervalWithResponseAsync( - String location, RequestRateByIntervalInput parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .exportRequestRateByInterval( - this.client.getEndpoint(), - location, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Export logs that show Api requests made by this subscription in the given time window to show throttling - * activities. - * - * @param location The location upon which virtual-machine-sizes is queried. - * @param parameters Parameters supplied to the LogAnalytics getRequestRateByInterval Api. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return logAnalytics operation status response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> exportRequestRateByIntervalWithResponseAsync( - String location, RequestRateByIntervalInput parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .exportRequestRateByInterval( - this.client.getEndpoint(), - location, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Export logs that show Api requests made by this subscription in the given time window to show throttling - * activities. - * - * @param location The location upon which virtual-machine-sizes is queried. - * @param parameters Parameters supplied to the LogAnalytics getRequestRateByInterval Api. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return logAnalytics operation status response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, LogAnalyticsOperationResultInner> - beginExportRequestRateByIntervalAsync(String location, RequestRateByIntervalInput parameters) { - Mono>> mono = exportRequestRateByIntervalWithResponseAsync(location, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - LogAnalyticsOperationResultInner.class, - LogAnalyticsOperationResultInner.class, - Context.NONE); - } - - /** - * Export logs that show Api requests made by this subscription in the given time window to show throttling - * activities. - * - * @param location The location upon which virtual-machine-sizes is queried. - * @param parameters Parameters supplied to the LogAnalytics getRequestRateByInterval Api. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return logAnalytics operation status response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, LogAnalyticsOperationResultInner> - beginExportRequestRateByIntervalAsync(String location, RequestRateByIntervalInput parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - exportRequestRateByIntervalWithResponseAsync(location, parameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - LogAnalyticsOperationResultInner.class, - LogAnalyticsOperationResultInner.class, - context); - } - - /** - * Export logs that show Api requests made by this subscription in the given time window to show throttling - * activities. - * - * @param location The location upon which virtual-machine-sizes is queried. - * @param parameters Parameters supplied to the LogAnalytics getRequestRateByInterval Api. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return logAnalytics operation status response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, LogAnalyticsOperationResultInner> - beginExportRequestRateByInterval(String location, RequestRateByIntervalInput parameters) { - return beginExportRequestRateByIntervalAsync(location, parameters).getSyncPoller(); - } - - /** - * Export logs that show Api requests made by this subscription in the given time window to show throttling - * activities. - * - * @param location The location upon which virtual-machine-sizes is queried. - * @param parameters Parameters supplied to the LogAnalytics getRequestRateByInterval Api. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return logAnalytics operation status response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, LogAnalyticsOperationResultInner> - beginExportRequestRateByInterval(String location, RequestRateByIntervalInput parameters, Context context) { - return beginExportRequestRateByIntervalAsync(location, parameters, context).getSyncPoller(); - } - - /** - * Export logs that show Api requests made by this subscription in the given time window to show throttling - * activities. - * - * @param location The location upon which virtual-machine-sizes is queried. - * @param parameters Parameters supplied to the LogAnalytics getRequestRateByInterval Api. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return logAnalytics operation status response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono exportRequestRateByIntervalAsync( - String location, RequestRateByIntervalInput parameters) { - return beginExportRequestRateByIntervalAsync(location, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Export logs that show Api requests made by this subscription in the given time window to show throttling - * activities. - * - * @param location The location upon which virtual-machine-sizes is queried. - * @param parameters Parameters supplied to the LogAnalytics getRequestRateByInterval Api. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return logAnalytics operation status response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono exportRequestRateByIntervalAsync( - String location, RequestRateByIntervalInput parameters, Context context) { - return beginExportRequestRateByIntervalAsync(location, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Export logs that show Api requests made by this subscription in the given time window to show throttling - * activities. - * - * @param location The location upon which virtual-machine-sizes is queried. - * @param parameters Parameters supplied to the LogAnalytics getRequestRateByInterval Api. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return logAnalytics operation status response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public LogAnalyticsOperationResultInner exportRequestRateByInterval( - String location, RequestRateByIntervalInput parameters) { - return exportRequestRateByIntervalAsync(location, parameters).block(); - } - - /** - * Export logs that show Api requests made by this subscription in the given time window to show throttling - * activities. - * - * @param location The location upon which virtual-machine-sizes is queried. - * @param parameters Parameters supplied to the LogAnalytics getRequestRateByInterval Api. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return logAnalytics operation status response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public LogAnalyticsOperationResultInner exportRequestRateByInterval( - String location, RequestRateByIntervalInput parameters, Context context) { - return exportRequestRateByIntervalAsync(location, parameters, context).block(); - } - - /** - * Export logs that show total throttled Api requests for this subscription in the given time window. - * - * @param location The location upon which virtual-machine-sizes is queried. - * @param parameters Parameters supplied to the LogAnalytics getThrottledRequests Api. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return logAnalytics operation status response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> exportThrottledRequestsWithResponseAsync( - String location, ThrottledRequestsInput parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .exportThrottledRequests( - this.client.getEndpoint(), - location, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Export logs that show total throttled Api requests for this subscription in the given time window. - * - * @param location The location upon which virtual-machine-sizes is queried. - * @param parameters Parameters supplied to the LogAnalytics getThrottledRequests Api. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return logAnalytics operation status response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> exportThrottledRequestsWithResponseAsync( - String location, ThrottledRequestsInput parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .exportThrottledRequests( - this.client.getEndpoint(), - location, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Export logs that show total throttled Api requests for this subscription in the given time window. - * - * @param location The location upon which virtual-machine-sizes is queried. - * @param parameters Parameters supplied to the LogAnalytics getThrottledRequests Api. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return logAnalytics operation status response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, LogAnalyticsOperationResultInner> - beginExportThrottledRequestsAsync(String location, ThrottledRequestsInput parameters) { - Mono>> mono = exportThrottledRequestsWithResponseAsync(location, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - LogAnalyticsOperationResultInner.class, - LogAnalyticsOperationResultInner.class, - Context.NONE); - } - - /** - * Export logs that show total throttled Api requests for this subscription in the given time window. - * - * @param location The location upon which virtual-machine-sizes is queried. - * @param parameters Parameters supplied to the LogAnalytics getThrottledRequests Api. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return logAnalytics operation status response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, LogAnalyticsOperationResultInner> - beginExportThrottledRequestsAsync(String location, ThrottledRequestsInput parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = exportThrottledRequestsWithResponseAsync(location, parameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - LogAnalyticsOperationResultInner.class, - LogAnalyticsOperationResultInner.class, - context); - } - - /** - * Export logs that show total throttled Api requests for this subscription in the given time window. - * - * @param location The location upon which virtual-machine-sizes is queried. - * @param parameters Parameters supplied to the LogAnalytics getThrottledRequests Api. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return logAnalytics operation status response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, LogAnalyticsOperationResultInner> - beginExportThrottledRequests(String location, ThrottledRequestsInput parameters) { - return beginExportThrottledRequestsAsync(location, parameters).getSyncPoller(); - } - - /** - * Export logs that show total throttled Api requests for this subscription in the given time window. - * - * @param location The location upon which virtual-machine-sizes is queried. - * @param parameters Parameters supplied to the LogAnalytics getThrottledRequests Api. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return logAnalytics operation status response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, LogAnalyticsOperationResultInner> - beginExportThrottledRequests(String location, ThrottledRequestsInput parameters, Context context) { - return beginExportThrottledRequestsAsync(location, parameters, context).getSyncPoller(); - } - - /** - * Export logs that show total throttled Api requests for this subscription in the given time window. - * - * @param location The location upon which virtual-machine-sizes is queried. - * @param parameters Parameters supplied to the LogAnalytics getThrottledRequests Api. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return logAnalytics operation status response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono exportThrottledRequestsAsync( - String location, ThrottledRequestsInput parameters) { - return beginExportThrottledRequestsAsync(location, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Export logs that show total throttled Api requests for this subscription in the given time window. - * - * @param location The location upon which virtual-machine-sizes is queried. - * @param parameters Parameters supplied to the LogAnalytics getThrottledRequests Api. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return logAnalytics operation status response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono exportThrottledRequestsAsync( - String location, ThrottledRequestsInput parameters, Context context) { - return beginExportThrottledRequestsAsync(location, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Export logs that show total throttled Api requests for this subscription in the given time window. - * - * @param location The location upon which virtual-machine-sizes is queried. - * @param parameters Parameters supplied to the LogAnalytics getThrottledRequests Api. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return logAnalytics operation status response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public LogAnalyticsOperationResultInner exportThrottledRequests( - String location, ThrottledRequestsInput parameters) { - return exportThrottledRequestsAsync(location, parameters).block(); - } - - /** - * Export logs that show total throttled Api requests for this subscription in the given time window. - * - * @param location The location upon which virtual-machine-sizes is queried. - * @param parameters Parameters supplied to the LogAnalytics getThrottledRequests Api. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return logAnalytics operation status response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public LogAnalyticsOperationResultInner exportThrottledRequests( - String location, ThrottledRequestsInput parameters, Context context) { - return exportThrottledRequestsAsync(location, parameters, context).block(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/ManagedUnmanagedDiskErrors.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/ManagedUnmanagedDiskErrors.java deleted file mode 100644 index 0eb1d8dd706f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/ManagedUnmanagedDiskErrors.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.compute.implementation; - -/** Shared managed vs unmanaged disks errors between virtual machine and virtual machine scale set. */ -class ManagedUnmanagedDiskErrors { - static final String VM_BOTH_MANAGED_AND_UNMANAGED_DISK_NOT_ALLOWED = - "This virtual machine is based on managed disk(s), both un-managed and managed disk cannot exists together in" - + " a virtual machine"; - static final String VMSS_BOTH_MANAGED_AND_UNMANAGED_DISK_NOT_ALLOWED = - "This virtual machine scale set is based on managed disk(s), both un-managed and managed cannot exists" - + " together in a virtual machine scale set"; - static final String VM_NO_UNMANAGED_DISK_TO_UPDATE = - "This virtual machine is based on managed disk(s) and there is no un-managed disk to update"; - static final String VM_NO_MANAGED_DISK_TO_UPDATE = - "This virtual machine is based on un-managed disk(s) and there is no managed disk to update"; - static final String VMSS_NO_UNMANAGED_DISK_TO_UPDATE = - "This virtual machine scale set is based on managed disk(s) and there is no un-managed disk to update"; - static final String VMSS_NO_MANAGED_DISK_TO_UPDATE = - "This virtual machine scale set is based on un-managed disk(s) and there is no managed disk to update"; - static final String VM_BOTH_UNMANAGED_AND_MANAGED_DISK_NOT_ALLOWED = - "This virtual machine is based on un-managed disks (s), both un-managed and managed disk cannot exists" - + " together in a virtual machine"; - static final String VMSS_BOTH_UNMANAGED_AND_MANAGED_DISK_NOT_ALLOWED = - "This virtual machine scale set is based on un-managed disk(s), both un-managed and managed cannot exists" - + " together in a virtual machine scale set"; -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/OperationsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/OperationsClientImpl.java deleted file mode 100644 index 996eaa668db8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/OperationsClientImpl.java +++ /dev/null @@ -1,177 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.fluent.OperationsClient; -import com.azure.resourcemanager.compute.fluent.models.ComputeOperationValueInner; -import com.azure.resourcemanager.compute.models.ComputeOperationListResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in OperationsClient. */ -public final class OperationsClientImpl implements OperationsClient { - private final ClientLogger logger = new ClientLogger(OperationsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final OperationsService service; - - /** The service client containing this operation class. */ - private final ComputeManagementClientImpl client; - - /** - * Initializes an instance of OperationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - OperationsClientImpl(ComputeManagementClientImpl client) { - this.service = - RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for ComputeManagementClientOperations to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "ComputeManagementCli") - private interface OperationsService { - @Headers({"Content-Type: application/json"}) - @Get("/providers/Microsoft.Compute/operations") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets a list of compute operations. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of compute operations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a list of compute operations. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of compute operations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); - } - - /** - * Gets a list of compute operations. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of compute operations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync()); - } - - /** - * Gets a list of compute operations. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of compute operations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context)); - } - - /** - * Gets a list of compute operations. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of compute operations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Gets a list of compute operations. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of compute operations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/ProximityPlacementGroupImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/ProximityPlacementGroupImpl.java deleted file mode 100644 index 92a995b9f999..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/ProximityPlacementGroupImpl.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.implementation; - -import com.azure.resourcemanager.compute.models.ComputeSku; -import com.azure.resourcemanager.compute.models.ProximityPlacementGroup; -import com.azure.resourcemanager.compute.models.ProximityPlacementGroupType; -import com.azure.resourcemanager.compute.fluent.models.ProximityPlacementGroupInner; -import com.azure.resourcemanager.compute.models.SubResourceWithColocationStatus; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceId; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -/** The implementation for {@link ComputeSku}. */ -final class ProximityPlacementGroupImpl implements ProximityPlacementGroup { - private final ProximityPlacementGroupInner inner; - - ProximityPlacementGroupImpl(ProximityPlacementGroupInner inner) { - this.inner = inner; - } - - @Override - public ProximityPlacementGroupType proximityPlacementGroupType() { - return this.innerModel().proximityPlacementGroupType(); - } - - @Override - public List virtualMachineIds() { - return getStringListFromSubResourceList(this.innerModel().virtualMachines()); - } - - @Override - public List virtualMachineScaleSetIds() { - return getStringListFromSubResourceList(this.innerModel().virtualMachineScaleSets()); - } - - @Override - public List availabilitySetIds() { - return getStringListFromSubResourceList(this.innerModel().availabilitySets()); - } - - @Override - public String location() { - return this.innerModel().location(); - } - - @Override - public String resourceGroupName() { - return ResourceId.fromString(this.id()).resourceGroupName(); - } - - @Override - public String id() { - return this.innerModel().id(); - } - - @Override - public ProximityPlacementGroupInner innerModel() { - return inner; - } - - private List getStringListFromSubResourceList(List subList) { - List stringList = null; - - if (subList != null && !subList.isEmpty()) { - stringList = new ArrayList<>(); - Iterator iter = subList.iterator(); - while (iter.hasNext()) { - stringList.add(iter.next().id()); - } - } - - return stringList; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/ProximityPlacementGroupsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/ProximityPlacementGroupsClientImpl.java deleted file mode 100644 index f9ff8742269f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/ProximityPlacementGroupsClientImpl.java +++ /dev/null @@ -1,1336 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.fluent.ProximityPlacementGroupsClient; -import com.azure.resourcemanager.compute.fluent.models.ProximityPlacementGroupInner; -import com.azure.resourcemanager.compute.models.ProximityPlacementGroupListResult; -import com.azure.resourcemanager.compute.models.ProximityPlacementGroupUpdate; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ProximityPlacementGroupsClient. */ -public final class ProximityPlacementGroupsClientImpl - implements InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete, - ProximityPlacementGroupsClient { - private final ClientLogger logger = new ClientLogger(ProximityPlacementGroupsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final ProximityPlacementGroupsService service; - - /** The service client containing this operation class. */ - private final ComputeManagementClientImpl client; - - /** - * Initializes an instance of ProximityPlacementGroupsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ProximityPlacementGroupsClientImpl(ComputeManagementClientImpl client) { - this.service = - RestProxy - .create(ProximityPlacementGroupsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for ComputeManagementClientProximityPlacementGroups to be used by the - * proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "ComputeManagementCli") - private interface ProximityPlacementGroupsService { - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/proximityPlacementGroups/{proximityPlacementGroupName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("proximityPlacementGroupName") String proximityPlacementGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") ProximityPlacementGroupInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/proximityPlacementGroups/{proximityPlacementGroupName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("proximityPlacementGroupName") String proximityPlacementGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") ProximityPlacementGroupUpdate parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/proximityPlacementGroups/{proximityPlacementGroupName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("proximityPlacementGroupName") String proximityPlacementGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/proximityPlacementGroups/{proximityPlacementGroupName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("proximityPlacementGroupName") String proximityPlacementGroupName, - @QueryParam("includeColocationStatus") String includeColocationStatus, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/proximityPlacementGroups") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/proximityPlacementGroups") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Create or update a proximity placement group. - * - * @param resourceGroupName The name of the resource group. - * @param proximityPlacementGroupName The name of the proximity placement group. - * @param parameters Parameters supplied to the Create Proximity Placement Group operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the proximity placement group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String proximityPlacementGroupName, ProximityPlacementGroupInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (proximityPlacementGroupName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter proximityPlacementGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - proximityPlacementGroupName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create or update a proximity placement group. - * - * @param resourceGroupName The name of the resource group. - * @param proximityPlacementGroupName The name of the proximity placement group. - * @param parameters Parameters supplied to the Create Proximity Placement Group operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the proximity placement group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, - String proximityPlacementGroupName, - ProximityPlacementGroupInner parameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (proximityPlacementGroupName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter proximityPlacementGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - proximityPlacementGroupName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Create or update a proximity placement group. - * - * @param resourceGroupName The name of the resource group. - * @param proximityPlacementGroupName The name of the proximity placement group. - * @param parameters Parameters supplied to the Create Proximity Placement Group operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the proximity placement group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, String proximityPlacementGroupName, ProximityPlacementGroupInner parameters) { - return createOrUpdateWithResponseAsync(resourceGroupName, proximityPlacementGroupName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Create or update a proximity placement group. - * - * @param resourceGroupName The name of the resource group. - * @param proximityPlacementGroupName The name of the proximity placement group. - * @param parameters Parameters supplied to the Create Proximity Placement Group operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the proximity placement group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ProximityPlacementGroupInner createOrUpdate( - String resourceGroupName, String proximityPlacementGroupName, ProximityPlacementGroupInner parameters) { - return createOrUpdateAsync(resourceGroupName, proximityPlacementGroupName, parameters).block(); - } - - /** - * Create or update a proximity placement group. - * - * @param resourceGroupName The name of the resource group. - * @param proximityPlacementGroupName The name of the proximity placement group. - * @param parameters Parameters supplied to the Create Proximity Placement Group operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the proximity placement group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceGroupName, - String proximityPlacementGroupName, - ProximityPlacementGroupInner parameters, - Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, proximityPlacementGroupName, parameters, context) - .block(); - } - - /** - * Update a proximity placement group. - * - * @param resourceGroupName The name of the resource group. - * @param proximityPlacementGroupName The name of the proximity placement group. - * @param parameters Parameters supplied to the Update Proximity Placement Group operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the proximity placement group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateWithResponseAsync( - String resourceGroupName, String proximityPlacementGroupName, ProximityPlacementGroupUpdate parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (proximityPlacementGroupName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter proximityPlacementGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - resourceGroupName, - proximityPlacementGroupName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Update a proximity placement group. - * - * @param resourceGroupName The name of the resource group. - * @param proximityPlacementGroupName The name of the proximity placement group. - * @param parameters Parameters supplied to the Update Proximity Placement Group operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the proximity placement group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, - String proximityPlacementGroupName, - ProximityPlacementGroupUpdate parameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (proximityPlacementGroupName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter proximityPlacementGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - resourceGroupName, - proximityPlacementGroupName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Update a proximity placement group. - * - * @param resourceGroupName The name of the resource group. - * @param proximityPlacementGroupName The name of the proximity placement group. - * @param parameters Parameters supplied to the Update Proximity Placement Group operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the proximity placement group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync( - String resourceGroupName, String proximityPlacementGroupName, ProximityPlacementGroupUpdate parameters) { - return updateWithResponseAsync(resourceGroupName, proximityPlacementGroupName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Update a proximity placement group. - * - * @param resourceGroupName The name of the resource group. - * @param proximityPlacementGroupName The name of the proximity placement group. - * @param parameters Parameters supplied to the Update Proximity Placement Group operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the proximity placement group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ProximityPlacementGroupInner update( - String resourceGroupName, String proximityPlacementGroupName, ProximityPlacementGroupUpdate parameters) { - return updateAsync(resourceGroupName, proximityPlacementGroupName, parameters).block(); - } - - /** - * Update a proximity placement group. - * - * @param resourceGroupName The name of the resource group. - * @param proximityPlacementGroupName The name of the proximity placement group. - * @param parameters Parameters supplied to the Update Proximity Placement Group operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the proximity placement group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, - String proximityPlacementGroupName, - ProximityPlacementGroupUpdate parameters, - Context context) { - return updateWithResponseAsync(resourceGroupName, proximityPlacementGroupName, parameters, context).block(); - } - - /** - * Delete a proximity placement group. - * - * @param resourceGroupName The name of the resource group. - * @param proximityPlacementGroupName The name of the proximity placement group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String resourceGroupName, String proximityPlacementGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (proximityPlacementGroupName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter proximityPlacementGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - proximityPlacementGroupName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete a proximity placement group. - * - * @param resourceGroupName The name of the resource group. - * @param proximityPlacementGroupName The name of the proximity placement group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String proximityPlacementGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (proximityPlacementGroupName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter proximityPlacementGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - proximityPlacementGroupName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Delete a proximity placement group. - * - * @param resourceGroupName The name of the resource group. - * @param proximityPlacementGroupName The name of the proximity placement group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String proximityPlacementGroupName) { - return deleteWithResponseAsync(resourceGroupName, proximityPlacementGroupName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Delete a proximity placement group. - * - * @param resourceGroupName The name of the resource group. - * @param proximityPlacementGroupName The name of the proximity placement group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String proximityPlacementGroupName) { - deleteAsync(resourceGroupName, proximityPlacementGroupName).block(); - } - - /** - * Delete a proximity placement group. - * - * @param resourceGroupName The name of the resource group. - * @param proximityPlacementGroupName The name of the proximity placement group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse( - String resourceGroupName, String proximityPlacementGroupName, Context context) { - return deleteWithResponseAsync(resourceGroupName, proximityPlacementGroupName, context).block(); - } - - /** - * Retrieves information about a proximity placement group . - * - * @param resourceGroupName The name of the resource group. - * @param proximityPlacementGroupName The name of the proximity placement group. - * @param includeColocationStatus includeColocationStatus=true enables fetching the colocation status of all the - * resources in the proximity placement group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the proximity placement group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String proximityPlacementGroupName, String includeColocationStatus) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (proximityPlacementGroupName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter proximityPlacementGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - proximityPlacementGroupName, - includeColocationStatus, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Retrieves information about a proximity placement group . - * - * @param resourceGroupName The name of the resource group. - * @param proximityPlacementGroupName The name of the proximity placement group. - * @param includeColocationStatus includeColocationStatus=true enables fetching the colocation status of all the - * resources in the proximity placement group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the proximity placement group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String proximityPlacementGroupName, String includeColocationStatus, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (proximityPlacementGroupName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter proximityPlacementGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - proximityPlacementGroupName, - includeColocationStatus, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Retrieves information about a proximity placement group . - * - * @param resourceGroupName The name of the resource group. - * @param proximityPlacementGroupName The name of the proximity placement group. - * @param includeColocationStatus includeColocationStatus=true enables fetching the colocation status of all the - * resources in the proximity placement group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the proximity placement group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync( - String resourceGroupName, String proximityPlacementGroupName, String includeColocationStatus) { - return getByResourceGroupWithResponseAsync( - resourceGroupName, proximityPlacementGroupName, includeColocationStatus) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Retrieves information about a proximity placement group . - * - * @param resourceGroupName The name of the resource group. - * @param proximityPlacementGroupName The name of the proximity placement group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the proximity placement group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync( - String resourceGroupName, String proximityPlacementGroupName) { - final String includeColocationStatus = null; - return getByResourceGroupWithResponseAsync( - resourceGroupName, proximityPlacementGroupName, includeColocationStatus) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Retrieves information about a proximity placement group . - * - * @param resourceGroupName The name of the resource group. - * @param proximityPlacementGroupName The name of the proximity placement group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the proximity placement group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ProximityPlacementGroupInner getByResourceGroup( - String resourceGroupName, String proximityPlacementGroupName) { - final String includeColocationStatus = null; - return getByResourceGroupAsync(resourceGroupName, proximityPlacementGroupName, includeColocationStatus).block(); - } - - /** - * Retrieves information about a proximity placement group . - * - * @param resourceGroupName The name of the resource group. - * @param proximityPlacementGroupName The name of the proximity placement group. - * @param includeColocationStatus includeColocationStatus=true enables fetching the colocation status of all the - * resources in the proximity placement group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the proximity placement group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String proximityPlacementGroupName, String includeColocationStatus, Context context) { - return getByResourceGroupWithResponseAsync( - resourceGroupName, proximityPlacementGroupName, includeColocationStatus, context) - .block(); - } - - /** - * Lists all proximity placement groups in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Proximity Placement Group operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all proximity placement groups in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Proximity Placement Group operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists all proximity placement groups in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Proximity Placement Group operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>( - () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); - } - - /** - * Lists all proximity placement groups in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Proximity Placement Group operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all proximity placement groups in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Proximity Placement Group operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Lists all proximity placement groups in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Proximity Placement Group operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Lists all proximity placement groups in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Proximity Placement Group operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all proximity placement groups in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Proximity Placement Group operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists all proximity placement groups in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Proximity Placement Group operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * Lists all proximity placement groups in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Proximity Placement Group operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync( - String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all proximity placement groups in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Proximity Placement Group operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * Lists all proximity placement groups in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Proximity Placement Group operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Proximity Placement Group operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Proximity Placement Group operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Proximity Placement Group operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Proximity Placement Group operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/ProxyEncryptionMonitorImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/ProxyEncryptionMonitorImpl.java deleted file mode 100644 index 2de7618fc554..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/ProxyEncryptionMonitorImpl.java +++ /dev/null @@ -1,137 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.implementation; - -import com.azure.resourcemanager.compute.ComputeManager; -import com.azure.resourcemanager.compute.models.DiskVolumeEncryptionMonitor; -import com.azure.resourcemanager.compute.models.EncryptionStatus; -import com.azure.resourcemanager.compute.models.InstanceViewStatus; -import com.azure.resourcemanager.compute.models.OperatingSystemTypes; -import com.azure.resourcemanager.compute.models.VirtualMachine; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineExtensionInner; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineInner; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils; -import java.util.HashMap; -import java.util.Map; -import reactor.core.publisher.Mono; - -/** - * A proxy implementation of DiskVolumeEncryptionMonitor to resolve actual encryption monitor based on the version of - * encryption extension installed (legacy vs noAAD) on a virtual machine. - */ -class ProxyEncryptionMonitorImpl implements DiskVolumeEncryptionMonitor { - private final String vmId; - private final OperatingSystemTypes osType; - private final ComputeManager computeManager; - private DiskVolumeEncryptionMonitor resolvedEncryptionMonitor; - - /** - * Creates ProxyEncryptionMonitorImpl. - * - * @param virtualMachine the virtual machine for which encryption monitor needs to be resolved. - */ - ProxyEncryptionMonitorImpl(VirtualMachine virtualMachine) { - this.vmId = virtualMachine.id(); - this.osType = virtualMachine.osType(); - this.computeManager = virtualMachine.manager(); - } - - @Override - public OperatingSystemTypes osType() { - return this.osType; - } - - @Override - public String progressMessage() { - return this.resolvedEncryptionMonitor != null ? this.resolvedEncryptionMonitor.progressMessage() : null; - } - - @Override - public EncryptionStatus osDiskStatus() { - return this.resolvedEncryptionMonitor != null - ? this.resolvedEncryptionMonitor.osDiskStatus() - : EncryptionStatus.NOT_ENCRYPTED; - } - - @Override - public EncryptionStatus dataDiskStatus() { - return this.resolvedEncryptionMonitor != null - ? this.resolvedEncryptionMonitor.dataDiskStatus() - : EncryptionStatus.NOT_ENCRYPTED; - } - - @Override - public Map diskInstanceViewEncryptionStatuses() { - return this.resolvedEncryptionMonitor != null - ? this.resolvedEncryptionMonitor.diskInstanceViewEncryptionStatuses() - : new HashMap(); - } - - @Override - public DiskVolumeEncryptionMonitor refresh() { - return refreshAsync().block(); - } - - @Override - public Mono refreshAsync() { - if (this.resolvedEncryptionMonitor != null) { - return this.resolvedEncryptionMonitor.refreshAsync(); - } else { - final ProxyEncryptionMonitorImpl self = this; - return retrieveVirtualMachineAsync() - .flatMap( - virtualMachine -> { - VirtualMachineExtensionInner extension = encryptionExtension(virtualMachine); - if (extension != null) { - if (EncryptionExtensionIdentifier.isNoAADVersion(osType(), - extension.typeHandlerVersion())) { - self.resolvedEncryptionMonitor = (osType() == OperatingSystemTypes.LINUX) - ? new LinuxDiskVolumeNoAADEncryptionMonitorImpl(virtualMachine.id(), computeManager) - : new WindowsVolumeNoAADEncryptionMonitorImpl(virtualMachine.id(), computeManager); - } else { - self.resolvedEncryptionMonitor = (osType() == OperatingSystemTypes.LINUX) - ? new LinuxDiskVolumeLegacyEncryptionMonitorImpl( - virtualMachine.id(), computeManager) - : new WindowsVolumeLegacyEncryptionMonitorImpl(virtualMachine.id(), computeManager); - } - return self.resolvedEncryptionMonitor.refreshAsync(); - } else { - return Mono.just(self); - } - }) - .switchIfEmpty(Mono.just(self)); - } - } - - /** - * Retrieve the virtual machine. If the virtual machine does not exists then an error observable will be returned. - * - * @return the retrieved virtual machine - */ - private Mono retrieveVirtualMachineAsync() { - return computeManager - .serviceClient() - .getVirtualMachines() - .getByResourceGroupAsync(ResourceUtils.groupFromResourceId(vmId), ResourceUtils.nameFromResourceId(vmId)); - // Exception if vm not found - } - - /** - * Given virtual machine find encryption extension if exists. - * - * @param vm the virtual machine - * @return the encryption extension if exists, null otherwise. - */ - private VirtualMachineExtensionInner encryptionExtension(VirtualMachineInner vm) { - if (vm.resources() != null) { - for (VirtualMachineExtensionInner extension : vm.resources()) { - if (EncryptionExtensionIdentifier.isEncryptionPublisherName(extension.publisher()) - && EncryptionExtensionIdentifier.isEncryptionTypeName(extension.typePropertiesType(), osType())) { - return extension; - } - } - } - return null; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/ResourceSkusClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/ResourceSkusClientImpl.java deleted file mode 100644 index 3acffdd7dd8a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/ResourceSkusClientImpl.java +++ /dev/null @@ -1,314 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.fluent.ResourceSkusClient; -import com.azure.resourcemanager.compute.fluent.models.ResourceSkuInner; -import com.azure.resourcemanager.compute.models.ResourceSkusResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ResourceSkusClient. */ -public final class ResourceSkusClientImpl implements ResourceSkusClient { - private final ClientLogger logger = new ClientLogger(ResourceSkusClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final ResourceSkusService service; - - /** The service client containing this operation class. */ - private final ComputeManagementClientImpl client; - - /** - * Initializes an instance of ResourceSkusClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ResourceSkusClientImpl(ComputeManagementClientImpl client) { - this.service = - RestProxy.create(ResourceSkusService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for ComputeManagementClientResourceSkus to be used by the proxy service - * to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "ComputeManagementCli") - private interface ResourceSkusService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/skus") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("$filter") String filter, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets the list of Microsoft.Compute SKUs available for your Subscription. - * - * @param filter The filter to apply on the operation. Only **location** filter is supported currently. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Microsoft.Compute SKUs available for your Subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String filter) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-04-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - filter, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the list of Microsoft.Compute SKUs available for your Subscription. - * - * @param filter The filter to apply on the operation. Only **location** filter is supported currently. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Microsoft.Compute SKUs available for your Subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String filter, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-04-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), filter, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets the list of Microsoft.Compute SKUs available for your Subscription. - * - * @param filter The filter to apply on the operation. Only **location** filter is supported currently. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Microsoft.Compute SKUs available for your Subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String filter) { - return new PagedFlux<>(() -> listSinglePageAsync(filter), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets the list of Microsoft.Compute SKUs available for your Subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Microsoft.Compute SKUs available for your Subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - final String filter = null; - return new PagedFlux<>(() -> listSinglePageAsync(filter), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets the list of Microsoft.Compute SKUs available for your Subscription. - * - * @param filter The filter to apply on the operation. Only **location** filter is supported currently. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Microsoft.Compute SKUs available for your Subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String filter, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(filter, context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets the list of Microsoft.Compute SKUs available for your Subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Microsoft.Compute SKUs available for your Subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - final String filter = null; - return new PagedIterable<>(listAsync(filter)); - } - - /** - * Gets the list of Microsoft.Compute SKUs available for your Subscription. - * - * @param filter The filter to apply on the operation. Only **location** filter is supported currently. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Microsoft.Compute SKUs available for your Subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String filter, Context context) { - return new PagedIterable<>(listAsync(filter, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Resource Skus operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Resource Skus operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/RunCommandResultImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/RunCommandResultImpl.java deleted file mode 100644 index 0f12d27742b7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/RunCommandResultImpl.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.compute.implementation; - -import com.azure.resourcemanager.compute.models.InstanceViewStatus; -import com.azure.resourcemanager.compute.models.RunCommandResult; -import com.azure.resourcemanager.compute.fluent.models.RunCommandResultInner; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.WrapperImpl; -import java.util.List; - -/** The implementation of ComputeUsage. */ -class RunCommandResultImpl extends WrapperImpl implements RunCommandResult { - RunCommandResultImpl(RunCommandResultInner innerObject) { - super(innerObject); - } - - /** - * Get run command operation response. - * - * @return the value value - */ - @Override - public List value() { - return innerModel().value(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/SnapshotImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/SnapshotImpl.java deleted file mode 100644 index dd22ebcd618a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/SnapshotImpl.java +++ /dev/null @@ -1,335 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.implementation; - -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.ComputeManager; -import com.azure.resourcemanager.compute.models.AccessLevel; -import com.azure.resourcemanager.compute.models.CreationData; -import com.azure.resourcemanager.compute.models.CreationSource; -import com.azure.resourcemanager.compute.models.Disk; -import com.azure.resourcemanager.compute.models.DiskCreateOption; -import com.azure.resourcemanager.compute.models.DiskSkuTypes; -import com.azure.resourcemanager.compute.models.GrantAccessData; -import com.azure.resourcemanager.compute.models.OperatingSystemTypes; -import com.azure.resourcemanager.compute.models.Snapshot; -import com.azure.resourcemanager.compute.models.SnapshotSku; -import com.azure.resourcemanager.compute.models.SnapshotSkuType; -import com.azure.resourcemanager.compute.models.SnapshotStorageAccountTypes; -import com.azure.resourcemanager.compute.fluent.models.SnapshotInner; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils; -import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.GroupableResourceImpl; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import reactor.core.publisher.Mono; - -/** The implementation for Snapshot and its create and update interfaces. */ -class SnapshotImpl extends GroupableResourceImpl - implements Snapshot, Snapshot.Definition, Snapshot.Update { - - private final ClientLogger logger = new ClientLogger(SnapshotImpl.class); - - SnapshotImpl(String name, SnapshotInner innerModel, final ComputeManager computeManager) { - super(name, innerModel, computeManager); - } - - @Override - public SnapshotSkuType skuType() { - if (this.innerModel().sku() == null) { - return null; - } else { - return SnapshotSkuType.fromSnapshotSku(this.innerModel().sku()); - } - } - - @Override - public DiskCreateOption creationMethod() { - return this.innerModel().creationData().createOption(); - } - - @Override - public boolean incremental() { - return this.innerModel().incremental(); - } - - @Override - public int sizeInGB() { - return ResourceManagerUtils.toPrimitiveInt(this.innerModel().diskSizeGB()); - } - - @Override - public OperatingSystemTypes osType() { - return this.innerModel().osType(); - } - - @Override - public CreationSource source() { - return new CreationSource(this.innerModel().creationData()); - } - - @Override - public String grantAccess(int accessDurationInSeconds) { - return this.grantAccessAsync(accessDurationInSeconds).block(); - } - - @Override - public Mono grantAccessAsync(int accessDurationInSeconds) { - GrantAccessData grantAccessDataInner = new GrantAccessData(); - grantAccessDataInner.withAccess(AccessLevel.READ).withDurationInSeconds(accessDurationInSeconds); - return manager() - .serviceClient() - .getSnapshots() - .grantAccessAsync(resourceGroupName(), name(), grantAccessDataInner) - .map(accessUriInner -> accessUriInner.accessSas()); - } - - @Override - public void revokeAccess() { - this.revokeAccessAsync().block(); - } - - @Override - public Mono revokeAccessAsync() { - return this.manager().serviceClient().getSnapshots().revokeAccessAsync(this.resourceGroupName(), this.name()); - } - - @Override - public SnapshotImpl withLinuxFromVhd(String vhdUrl) { - return withLinuxFromVhd(vhdUrl, constructStorageAccountId(vhdUrl)); - } - - @Override - public SnapshotImpl withLinuxFromVhd(String vhdUrl, String storageAccountId) { - this - .innerModel() - .withOsType(OperatingSystemTypes.LINUX) - .withCreationData(new CreationData()) - .creationData() - .withCreateOption(DiskCreateOption.IMPORT) - .withSourceUri(vhdUrl) - .withStorageAccountId(storageAccountId); - return this; - } - - @Override - public SnapshotImpl withLinuxFromDisk(String sourceDiskId) { - this - .innerModel() - .withOsType(OperatingSystemTypes.LINUX) - .withCreationData(new CreationData()) - .creationData() - .withCreateOption(DiskCreateOption.COPY) - .withSourceResourceId(sourceDiskId); - return this; - } - - @Override - public SnapshotImpl withLinuxFromDisk(Disk sourceDisk) { - withLinuxFromDisk(sourceDisk.id()); - if (sourceDisk.osType() != null) { - this.withOSType(sourceDisk.osType()); - } - this.withSku(sourceDisk.sku()); - return this; - } - - @Override - public SnapshotImpl withLinuxFromSnapshot(String sourceSnapshotId) { - this - .innerModel() - .withOsType(OperatingSystemTypes.LINUX) - .withCreationData(new CreationData()) - .creationData() - .withCreateOption(DiskCreateOption.COPY) - .withSourceResourceId(sourceSnapshotId); - return this; - } - - @Override - public SnapshotImpl withLinuxFromSnapshot(Snapshot sourceSnapshot) { - withLinuxFromSnapshot(sourceSnapshot.id()); - if (sourceSnapshot.osType() != null) { - this.withOSType(sourceSnapshot.osType()); - } - this.withSku(sourceSnapshot.skuType()); - return this; - } - - @Override - public SnapshotImpl withWindowsFromVhd(String vhdUrl) { - return withWindowsFromVhd(vhdUrl, constructStorageAccountId(vhdUrl)); - } - - @Override - public SnapshotImpl withWindowsFromVhd(String vhdUrl, String storageAccountId) { - this - .innerModel() - .withOsType(OperatingSystemTypes.WINDOWS) - .withCreationData(new CreationData()) - .creationData() - .withCreateOption(DiskCreateOption.IMPORT) - .withSourceUri(vhdUrl) - .withStorageAccountId(storageAccountId); - return this; - } - - @Override - public SnapshotImpl withWindowsFromDisk(String sourceDiskId) { - this - .innerModel() - .withOsType(OperatingSystemTypes.WINDOWS) - .withCreationData(new CreationData()) - .creationData() - .withCreateOption(DiskCreateOption.COPY) - .withSourceResourceId(sourceDiskId); - return this; - } - - @Override - public SnapshotImpl withWindowsFromDisk(Disk sourceDisk) { - withWindowsFromDisk(sourceDisk.id()); - if (sourceDisk.osType() != null) { - this.withOSType(sourceDisk.osType()); - } - this.withSku(sourceDisk.sku()); - return this; - } - - @Override - public SnapshotImpl withWindowsFromSnapshot(String sourceSnapshotId) { - this - .innerModel() - .withOsType(OperatingSystemTypes.WINDOWS) - .withCreationData(new CreationData()) - .creationData() - .withCreateOption(DiskCreateOption.COPY) - .withSourceResourceId(sourceSnapshotId); - return this; - } - - @Override - public SnapshotImpl withWindowsFromSnapshot(Snapshot sourceSnapshot) { - withWindowsFromSnapshot(sourceSnapshot.id()); - if (sourceSnapshot.osType() != null) { - this.withOSType(sourceSnapshot.osType()); - } - this.withSku(sourceSnapshot.skuType()); - return this; - } - - @Override - public SnapshotImpl withDataFromVhd(String vhdUrl) { - return withDataFromVhd(vhdUrl, constructStorageAccountId(vhdUrl)); - } - - @Override - public SnapshotImpl withDataFromVhd(String vhdUrl, String storageAccountId) { - this - .innerModel() - .withCreationData(new CreationData()) - .creationData() - .withCreateOption(DiskCreateOption.IMPORT) - .withSourceUri(vhdUrl) - .withStorageAccountId(storageAccountId); - return this; - } - - @Override - public SnapshotImpl withDataFromSnapshot(String snapshotId) { - this - .innerModel() - .withCreationData(new CreationData()) - .creationData() - .withCreateOption(DiskCreateOption.COPY) - .withSourceResourceId(snapshotId); - return this; - } - - @Override - public SnapshotImpl withDataFromSnapshot(Snapshot snapshot) { - return withDataFromSnapshot(snapshot.id()); - } - - @Override - public SnapshotImpl withDataFromDisk(String managedDiskId) { - this - .innerModel() - .withCreationData(new CreationData()) - .creationData() - .withCreateOption(DiskCreateOption.COPY) - .withSourceResourceId(managedDiskId); - return this; - } - - @Override - public SnapshotImpl withDataFromDisk(Disk managedDisk) { - return withDataFromDisk(managedDisk.id()).withOSType(managedDisk.osType()).withSku(managedDisk.sku()); - } - - @Override - public SnapshotImpl withSizeInGB(int sizeInGB) { - this.innerModel().withDiskSizeGB(sizeInGB); - return this; - } - - @Override - public SnapshotImpl withIncremental(boolean enabled) { - this.innerModel().withIncremental(enabled); - return this; - } - - @Override - public SnapshotImpl withOSType(OperatingSystemTypes osType) { - this.innerModel().withOsType(osType); - return this; - } - - private SnapshotImpl withSku(DiskSkuTypes sku) { - SnapshotSku snapshotSku = new SnapshotSku(); - snapshotSku.withName(SnapshotStorageAccountTypes.fromString(sku.accountType().toString())); - this.innerModel().withSku(snapshotSku); - return this; - } - - @Override - public SnapshotImpl withSku(SnapshotSkuType sku) { - this.innerModel().withSku(new SnapshotSku().withName(sku.accountType())); - return this; - } - - @Override - public Mono createResourceAsync() { - return this - .manager() - .serviceClient() - .getSnapshots() - .createOrUpdateAsync(resourceGroupName(), name(), this.innerModel()) - .map(innerToFluentMap(this)); - } - - @Override - protected Mono getInnerAsync() { - return this - .manager() - .serviceClient() - .getSnapshots() - .getByResourceGroupAsync(this.resourceGroupName(), this.name()); - } - - private String constructStorageAccountId(String vhdUrl) { - try { - return ResourceUtils - .constructResourceId( - this.manager().subscriptionId(), - resourceGroupName(), - "Microsoft.Storage", - "storageAccounts", - vhdUrl.split("\\.")[0].replace("https://", ""), - ""); - } catch (RuntimeException ex) { - throw logger - .logExceptionAsError( - new IllegalArgumentException(String.format("%s is not valid URI of a blob to import.", vhdUrl))); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/SnapshotsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/SnapshotsClientImpl.java deleted file mode 100644 index f5cab808188e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/SnapshotsClientImpl.java +++ /dev/null @@ -1,2120 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.compute.fluent.SnapshotsClient; -import com.azure.resourcemanager.compute.fluent.models.AccessUriInner; -import com.azure.resourcemanager.compute.fluent.models.SnapshotInner; -import com.azure.resourcemanager.compute.models.GrantAccessData; -import com.azure.resourcemanager.compute.models.SnapshotList; -import com.azure.resourcemanager.compute.models.SnapshotUpdate; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in SnapshotsClient. */ -public final class SnapshotsClientImpl - implements InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete, - SnapshotsClient { - private final ClientLogger logger = new ClientLogger(SnapshotsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final SnapshotsService service; - - /** The service client containing this operation class. */ - private final ComputeManagementClientImpl client; - - /** - * Initializes an instance of SnapshotsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - SnapshotsClientImpl(ComputeManagementClientImpl client) { - this.service = - RestProxy.create(SnapshotsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for ComputeManagementClientSnapshots to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "ComputeManagementCli") - private interface SnapshotsService { - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots" - + "/{snapshotName}") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("snapshotName") String snapshotName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") SnapshotInner snapshot, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots" - + "/{snapshotName}") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("snapshotName") String snapshotName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") SnapshotUpdate snapshot, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots" - + "/{snapshotName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("snapshotName") String snapshotName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots" - + "/{snapshotName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("snapshotName") String snapshotName, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/snapshots") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots" - + "/{snapshotName}/beginGetAccess") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> grantAccess( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("snapshotName") String snapshotName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") GrantAccessData grantAccessData, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots" - + "/{snapshotName}/endGetAccess") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> revokeAccess( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("snapshotName") String snapshotName, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Creates or updates a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param snapshot Snapshot object supplied in the body of the Put disk operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return snapshot resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String snapshotName, SnapshotInner snapshot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (snapshotName == null) { - return Mono.error(new IllegalArgumentException("Parameter snapshotName is required and cannot be null.")); - } - if (snapshot == null) { - return Mono.error(new IllegalArgumentException("Parameter snapshot is required and cannot be null.")); - } else { - snapshot.validate(); - } - final String apiVersion = "2019-07-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - snapshotName, - apiVersion, - snapshot, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param snapshot Snapshot object supplied in the body of the Put disk operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return snapshot resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String snapshotName, SnapshotInner snapshot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (snapshotName == null) { - return Mono.error(new IllegalArgumentException("Parameter snapshotName is required and cannot be null.")); - } - if (snapshot == null) { - return Mono.error(new IllegalArgumentException("Parameter snapshot is required and cannot be null.")); - } else { - snapshot.validate(); - } - final String apiVersion = "2019-07-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - snapshotName, - apiVersion, - snapshot, - accept, - context); - } - - /** - * Creates or updates a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param snapshot Snapshot object supplied in the body of the Put disk operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return snapshot resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, SnapshotInner> beginCreateOrUpdateAsync( - String resourceGroupName, String snapshotName, SnapshotInner snapshot) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, snapshotName, snapshot); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - SnapshotInner.class, - SnapshotInner.class, - this.client.getContext()); - } - - /** - * Creates or updates a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param snapshot Snapshot object supplied in the body of the Put disk operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return snapshot resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, SnapshotInner> beginCreateOrUpdateAsync( - String resourceGroupName, String snapshotName, SnapshotInner snapshot, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, snapshotName, snapshot, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), SnapshotInner.class, SnapshotInner.class, context); - } - - /** - * Creates or updates a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param snapshot Snapshot object supplied in the body of the Put disk operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return snapshot resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, SnapshotInner> beginCreateOrUpdate( - String resourceGroupName, String snapshotName, SnapshotInner snapshot) { - return beginCreateOrUpdateAsync(resourceGroupName, snapshotName, snapshot).getSyncPoller(); - } - - /** - * Creates or updates a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param snapshot Snapshot object supplied in the body of the Put disk operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return snapshot resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, SnapshotInner> beginCreateOrUpdate( - String resourceGroupName, String snapshotName, SnapshotInner snapshot, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, snapshotName, snapshot, context).getSyncPoller(); - } - - /** - * Creates or updates a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param snapshot Snapshot object supplied in the body of the Put disk operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return snapshot resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, String snapshotName, SnapshotInner snapshot) { - return beginCreateOrUpdateAsync(resourceGroupName, snapshotName, snapshot) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param snapshot Snapshot object supplied in the body of the Put disk operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return snapshot resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String snapshotName, SnapshotInner snapshot, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, snapshotName, snapshot, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param snapshot Snapshot object supplied in the body of the Put disk operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return snapshot resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SnapshotInner createOrUpdate(String resourceGroupName, String snapshotName, SnapshotInner snapshot) { - return createOrUpdateAsync(resourceGroupName, snapshotName, snapshot).block(); - } - - /** - * Creates or updates a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param snapshot Snapshot object supplied in the body of the Put disk operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return snapshot resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SnapshotInner createOrUpdate( - String resourceGroupName, String snapshotName, SnapshotInner snapshot, Context context) { - return createOrUpdateAsync(resourceGroupName, snapshotName, snapshot, context).block(); - } - - /** - * Updates (patches) a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param snapshot Snapshot object supplied in the body of the Patch snapshot operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return snapshot resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateWithResponseAsync( - String resourceGroupName, String snapshotName, SnapshotUpdate snapshot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (snapshotName == null) { - return Mono.error(new IllegalArgumentException("Parameter snapshotName is required and cannot be null.")); - } - if (snapshot == null) { - return Mono.error(new IllegalArgumentException("Parameter snapshot is required and cannot be null.")); - } else { - snapshot.validate(); - } - final String apiVersion = "2019-07-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - snapshotName, - apiVersion, - snapshot, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates (patches) a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param snapshot Snapshot object supplied in the body of the Patch snapshot operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return snapshot resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, String snapshotName, SnapshotUpdate snapshot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (snapshotName == null) { - return Mono.error(new IllegalArgumentException("Parameter snapshotName is required and cannot be null.")); - } - if (snapshot == null) { - return Mono.error(new IllegalArgumentException("Parameter snapshot is required and cannot be null.")); - } else { - snapshot.validate(); - } - final String apiVersion = "2019-07-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - snapshotName, - apiVersion, - snapshot, - accept, - context); - } - - /** - * Updates (patches) a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param snapshot Snapshot object supplied in the body of the Patch snapshot operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return snapshot resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, SnapshotInner> beginUpdateAsync( - String resourceGroupName, String snapshotName, SnapshotUpdate snapshot) { - Mono>> mono = updateWithResponseAsync(resourceGroupName, snapshotName, snapshot); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - SnapshotInner.class, - SnapshotInner.class, - this.client.getContext()); - } - - /** - * Updates (patches) a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param snapshot Snapshot object supplied in the body of the Patch snapshot operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return snapshot resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, SnapshotInner> beginUpdateAsync( - String resourceGroupName, String snapshotName, SnapshotUpdate snapshot, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - updateWithResponseAsync(resourceGroupName, snapshotName, snapshot, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), SnapshotInner.class, SnapshotInner.class, context); - } - - /** - * Updates (patches) a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param snapshot Snapshot object supplied in the body of the Patch snapshot operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return snapshot resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, SnapshotInner> beginUpdate( - String resourceGroupName, String snapshotName, SnapshotUpdate snapshot) { - return beginUpdateAsync(resourceGroupName, snapshotName, snapshot).getSyncPoller(); - } - - /** - * Updates (patches) a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param snapshot Snapshot object supplied in the body of the Patch snapshot operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return snapshot resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, SnapshotInner> beginUpdate( - String resourceGroupName, String snapshotName, SnapshotUpdate snapshot, Context context) { - return beginUpdateAsync(resourceGroupName, snapshotName, snapshot, context).getSyncPoller(); - } - - /** - * Updates (patches) a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param snapshot Snapshot object supplied in the body of the Patch snapshot operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return snapshot resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync(String resourceGroupName, String snapshotName, SnapshotUpdate snapshot) { - return beginUpdateAsync(resourceGroupName, snapshotName, snapshot) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates (patches) a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param snapshot Snapshot object supplied in the body of the Patch snapshot operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return snapshot resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, String snapshotName, SnapshotUpdate snapshot, Context context) { - return beginUpdateAsync(resourceGroupName, snapshotName, snapshot, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates (patches) a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param snapshot Snapshot object supplied in the body of the Patch snapshot operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return snapshot resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SnapshotInner update(String resourceGroupName, String snapshotName, SnapshotUpdate snapshot) { - return updateAsync(resourceGroupName, snapshotName, snapshot).block(); - } - - /** - * Updates (patches) a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param snapshot Snapshot object supplied in the body of the Patch snapshot operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return snapshot resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SnapshotInner update( - String resourceGroupName, String snapshotName, SnapshotUpdate snapshot, Context context) { - return updateAsync(resourceGroupName, snapshotName, snapshot, context).block(); - } - - /** - * Gets information about a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a snapshot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String snapshotName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (snapshotName == null) { - return Mono.error(new IllegalArgumentException("Parameter snapshotName is required and cannot be null.")); - } - final String apiVersion = "2019-07-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - snapshotName, - apiVersion, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets information about a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a snapshot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String snapshotName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (snapshotName == null) { - return Mono.error(new IllegalArgumentException("Parameter snapshotName is required and cannot be null.")); - } - final String apiVersion = "2019-07-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - snapshotName, - apiVersion, - accept, - context); - } - - /** - * Gets information about a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a snapshot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync(String resourceGroupName, String snapshotName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, snapshotName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets information about a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a snapshot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SnapshotInner getByResourceGroup(String resourceGroupName, String snapshotName) { - return getByResourceGroupAsync(resourceGroupName, snapshotName).block(); - } - - /** - * Gets information about a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a snapshot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String snapshotName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, snapshotName, context).block(); - } - - /** - * Deletes a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync(String resourceGroupName, String snapshotName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (snapshotName == null) { - return Mono.error(new IllegalArgumentException("Parameter snapshotName is required and cannot be null.")); - } - final String apiVersion = "2019-07-01"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - snapshotName, - apiVersion, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String snapshotName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (snapshotName == null) { - return Mono.error(new IllegalArgumentException("Parameter snapshotName is required and cannot be null.")); - } - final String apiVersion = "2019-07-01"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - snapshotName, - apiVersion, - context); - } - - /** - * Deletes a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String snapshotName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, snapshotName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deletes a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String snapshotName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(resourceGroupName, snapshotName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete(String resourceGroupName, String snapshotName) { - return beginDeleteAsync(resourceGroupName, snapshotName).getSyncPoller(); - } - - /** - * Deletes a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String snapshotName, Context context) { - return beginDeleteAsync(resourceGroupName, snapshotName, context).getSyncPoller(); - } - - /** - * Deletes a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String snapshotName) { - return beginDeleteAsync(resourceGroupName, snapshotName).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String snapshotName, Context context) { - return beginDeleteAsync(resourceGroupName, snapshotName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String snapshotName) { - deleteAsync(resourceGroupName, snapshotName).block(); - } - - /** - * Deletes a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String snapshotName, Context context) { - deleteAsync(resourceGroupName, snapshotName, context).block(); - } - - /** - * Lists snapshots under a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Snapshots operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String apiVersion = "2019-07-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - apiVersion, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists snapshots under a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Snapshots operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String apiVersion = "2019-07-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - apiVersion, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists snapshots under a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Snapshots operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * Lists snapshots under a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Snapshots operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists snapshots under a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Snapshots operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * Lists snapshots under a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Snapshots operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * Lists snapshots under a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Snapshots operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-07-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists snapshots under a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Snapshots operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-07-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists snapshots under a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Snapshots operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists snapshots under a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Snapshots operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists snapshots under a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Snapshots operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Lists snapshots under a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Snapshots operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Grants access to a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param grantAccessData Access data object supplied in the body of the get snapshot access operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a disk access SAS uri. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> grantAccessWithResponseAsync( - String resourceGroupName, String snapshotName, GrantAccessData grantAccessData) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (snapshotName == null) { - return Mono.error(new IllegalArgumentException("Parameter snapshotName is required and cannot be null.")); - } - if (grantAccessData == null) { - return Mono - .error(new IllegalArgumentException("Parameter grantAccessData is required and cannot be null.")); - } else { - grantAccessData.validate(); - } - final String apiVersion = "2019-07-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .grantAccess( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - snapshotName, - apiVersion, - grantAccessData, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Grants access to a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param grantAccessData Access data object supplied in the body of the get snapshot access operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a disk access SAS uri. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> grantAccessWithResponseAsync( - String resourceGroupName, String snapshotName, GrantAccessData grantAccessData, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (snapshotName == null) { - return Mono.error(new IllegalArgumentException("Parameter snapshotName is required and cannot be null.")); - } - if (grantAccessData == null) { - return Mono - .error(new IllegalArgumentException("Parameter grantAccessData is required and cannot be null.")); - } else { - grantAccessData.validate(); - } - final String apiVersion = "2019-07-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .grantAccess( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - snapshotName, - apiVersion, - grantAccessData, - accept, - context); - } - - /** - * Grants access to a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param grantAccessData Access data object supplied in the body of the get snapshot access operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a disk access SAS uri. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, AccessUriInner> beginGrantAccessAsync( - String resourceGroupName, String snapshotName, GrantAccessData grantAccessData) { - Mono>> mono = - grantAccessWithResponseAsync(resourceGroupName, snapshotName, grantAccessData); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - AccessUriInner.class, - AccessUriInner.class, - this.client.getContext()); - } - - /** - * Grants access to a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param grantAccessData Access data object supplied in the body of the get snapshot access operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a disk access SAS uri. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, AccessUriInner> beginGrantAccessAsync( - String resourceGroupName, String snapshotName, GrantAccessData grantAccessData, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - grantAccessWithResponseAsync(resourceGroupName, snapshotName, grantAccessData, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), AccessUriInner.class, AccessUriInner.class, context); - } - - /** - * Grants access to a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param grantAccessData Access data object supplied in the body of the get snapshot access operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a disk access SAS uri. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, AccessUriInner> beginGrantAccess( - String resourceGroupName, String snapshotName, GrantAccessData grantAccessData) { - return beginGrantAccessAsync(resourceGroupName, snapshotName, grantAccessData).getSyncPoller(); - } - - /** - * Grants access to a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param grantAccessData Access data object supplied in the body of the get snapshot access operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a disk access SAS uri. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, AccessUriInner> beginGrantAccess( - String resourceGroupName, String snapshotName, GrantAccessData grantAccessData, Context context) { - return beginGrantAccessAsync(resourceGroupName, snapshotName, grantAccessData, context).getSyncPoller(); - } - - /** - * Grants access to a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param grantAccessData Access data object supplied in the body of the get snapshot access operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a disk access SAS uri. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono grantAccessAsync( - String resourceGroupName, String snapshotName, GrantAccessData grantAccessData) { - return beginGrantAccessAsync(resourceGroupName, snapshotName, grantAccessData) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Grants access to a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param grantAccessData Access data object supplied in the body of the get snapshot access operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a disk access SAS uri. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono grantAccessAsync( - String resourceGroupName, String snapshotName, GrantAccessData grantAccessData, Context context) { - return beginGrantAccessAsync(resourceGroupName, snapshotName, grantAccessData, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Grants access to a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param grantAccessData Access data object supplied in the body of the get snapshot access operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a disk access SAS uri. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AccessUriInner grantAccess(String resourceGroupName, String snapshotName, GrantAccessData grantAccessData) { - return grantAccessAsync(resourceGroupName, snapshotName, grantAccessData).block(); - } - - /** - * Grants access to a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param grantAccessData Access data object supplied in the body of the get snapshot access operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a disk access SAS uri. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AccessUriInner grantAccess( - String resourceGroupName, String snapshotName, GrantAccessData grantAccessData, Context context) { - return grantAccessAsync(resourceGroupName, snapshotName, grantAccessData, context).block(); - } - - /** - * Revokes access to a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> revokeAccessWithResponseAsync( - String resourceGroupName, String snapshotName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (snapshotName == null) { - return Mono.error(new IllegalArgumentException("Parameter snapshotName is required and cannot be null.")); - } - final String apiVersion = "2019-07-01"; - return FluxUtil - .withContext( - context -> - service - .revokeAccess( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - snapshotName, - apiVersion, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Revokes access to a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> revokeAccessWithResponseAsync( - String resourceGroupName, String snapshotName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (snapshotName == null) { - return Mono.error(new IllegalArgumentException("Parameter snapshotName is required and cannot be null.")); - } - final String apiVersion = "2019-07-01"; - context = this.client.mergeContext(context); - return service - .revokeAccess( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - snapshotName, - apiVersion, - context); - } - - /** - * Revokes access to a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginRevokeAccessAsync(String resourceGroupName, String snapshotName) { - Mono>> mono = revokeAccessWithResponseAsync(resourceGroupName, snapshotName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Revokes access to a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginRevokeAccessAsync( - String resourceGroupName, String snapshotName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = revokeAccessWithResponseAsync(resourceGroupName, snapshotName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Revokes access to a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginRevokeAccess(String resourceGroupName, String snapshotName) { - return beginRevokeAccessAsync(resourceGroupName, snapshotName).getSyncPoller(); - } - - /** - * Revokes access to a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginRevokeAccess( - String resourceGroupName, String snapshotName, Context context) { - return beginRevokeAccessAsync(resourceGroupName, snapshotName, context).getSyncPoller(); - } - - /** - * Revokes access to a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono revokeAccessAsync(String resourceGroupName, String snapshotName) { - return beginRevokeAccessAsync(resourceGroupName, snapshotName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Revokes access to a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono revokeAccessAsync(String resourceGroupName, String snapshotName, Context context) { - return beginRevokeAccessAsync(resourceGroupName, snapshotName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Revokes access to a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void revokeAccess(String resourceGroupName, String snapshotName) { - revokeAccessAsync(resourceGroupName, snapshotName).block(); - } - - /** - * Revokes access to a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void revokeAccess(String resourceGroupName, String snapshotName, Context context) { - revokeAccessAsync(resourceGroupName, snapshotName, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Snapshots operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Snapshots operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Snapshots operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Snapshots operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/SnapshotsImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/SnapshotsImpl.java deleted file mode 100644 index d9b2a63e5956..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/SnapshotsImpl.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.implementation; - -import com.azure.resourcemanager.compute.ComputeManager; -import com.azure.resourcemanager.compute.models.AccessLevel; -import com.azure.resourcemanager.compute.models.GrantAccessData; -import com.azure.resourcemanager.compute.models.Snapshot; -import com.azure.resourcemanager.compute.models.Snapshots; -import com.azure.resourcemanager.compute.fluent.models.SnapshotInner; -import com.azure.resourcemanager.compute.fluent.SnapshotsClient; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.TopLevelModifiableResourcesImpl; -import reactor.core.publisher.Mono; - -/** The implementation for Snapshots. */ -public class SnapshotsImpl - extends TopLevelModifiableResourcesImpl - implements Snapshots { - - public SnapshotsImpl(ComputeManager computeManager) { - super(computeManager.serviceClient().getSnapshots(), computeManager); - } - - @Override - public Mono grantAccessAsync( - String resourceGroupName, String snapshotName, AccessLevel accessLevel, int accessDuration) { - GrantAccessData grantAccessDataInner = new GrantAccessData(); - grantAccessDataInner.withAccess(accessLevel).withDurationInSeconds(accessDuration); - return inner() - .grantAccessAsync(resourceGroupName, snapshotName, grantAccessDataInner) - .map(accessUriInner -> accessUriInner.accessSas()); - } - - @Override - public String grantAccess( - String resourceGroupName, String snapshotName, AccessLevel accessLevel, int accessDuration) { - return this.grantAccessAsync(resourceGroupName, snapshotName, accessLevel, accessDuration).block(); - } - - @Override - public Mono revokeAccessAsync(String resourceGroupName, String snapName) { - return this.inner().revokeAccessAsync(resourceGroupName, snapName); - } - - @Override - public void revokeAccess(String resourceGroupName, String snapName) { - this.revokeAccessAsync(resourceGroupName, snapName).block(); - } - - @Override - protected SnapshotImpl wrapModel(String name) { - return new SnapshotImpl(name, new SnapshotInner(), this.manager()); - } - - @Override - protected SnapshotImpl wrapModel(SnapshotInner inner) { - if (inner == null) { - return null; - } - return new SnapshotImpl(inner.name(), inner, this.manager()); - } - - @Override - public Snapshot.DefinitionStages.Blank define(String name) { - return this.wrapModel(name); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/SshPublicKeysClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/SshPublicKeysClientImpl.java deleted file mode 100644 index aaafe473050c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/SshPublicKeysClientImpl.java +++ /dev/null @@ -1,1449 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.fluent.SshPublicKeysClient; -import com.azure.resourcemanager.compute.fluent.models.SshPublicKeyGenerateKeyPairResultInner; -import com.azure.resourcemanager.compute.fluent.models.SshPublicKeyResourceInner; -import com.azure.resourcemanager.compute.models.SshPublicKeyUpdateResource; -import com.azure.resourcemanager.compute.models.SshPublicKeysGroupListResult; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in SshPublicKeysClient. */ -public final class SshPublicKeysClientImpl - implements InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete, - SshPublicKeysClient { - private final ClientLogger logger = new ClientLogger(SshPublicKeysClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final SshPublicKeysService service; - - /** The service client containing this operation class. */ - private final ComputeManagementClientImpl client; - - /** - * Initializes an instance of SshPublicKeysClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - SshPublicKeysClientImpl(ComputeManagementClientImpl client) { - this.service = - RestProxy.create(SshPublicKeysService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for ComputeManagementClientSshPublicKeys to be used by the proxy service - * to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "ComputeManagementCli") - private interface SshPublicKeysService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/sshPublicKeys") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/sshPublicKeys") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/sshPublicKeys/{sshPublicKeyName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> create( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("sshPublicKeyName") String sshPublicKeyName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") SshPublicKeyResourceInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/sshPublicKeys/{sshPublicKeyName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("sshPublicKeyName") String sshPublicKeyName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") SshPublicKeyUpdateResource parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/sshPublicKeys/{sshPublicKeyName}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("sshPublicKeyName") String sshPublicKeyName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/sshPublicKeys/{sshPublicKeyName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("sshPublicKeyName") String sshPublicKeyName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/sshPublicKeys/{sshPublicKeyName}/generateKeyPair") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> generateKeyPair( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("sshPublicKeyName") String sshPublicKeyName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Lists all of the SSH public keys in the subscription. Use the nextLink property in the response to get the next - * page of SSH public keys. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list SSH public keys operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all of the SSH public keys in the subscription. Use the nextLink property in the response to get the next - * page of SSH public keys. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list SSH public keys operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists all of the SSH public keys in the subscription. Use the nextLink property in the response to get the next - * page of SSH public keys. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list SSH public keys operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>( - () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); - } - - /** - * Lists all of the SSH public keys in the subscription. Use the nextLink property in the response to get the next - * page of SSH public keys. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list SSH public keys operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all of the SSH public keys in the subscription. Use the nextLink property in the response to get the next - * page of SSH public keys. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list SSH public keys operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Lists all of the SSH public keys in the subscription. Use the nextLink property in the response to get the next - * page of SSH public keys. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list SSH public keys operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Lists all of the SSH public keys in the specified resource group. Use the nextLink property in the response to - * get the next page of SSH public keys. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list SSH public keys operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all of the SSH public keys in the specified resource group. Use the nextLink property in the response to - * get the next page of SSH public keys. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list SSH public keys operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists all of the SSH public keys in the specified resource group. Use the nextLink property in the response to - * get the next page of SSH public keys. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list SSH public keys operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * Lists all of the SSH public keys in the specified resource group. Use the nextLink property in the response to - * get the next page of SSH public keys. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list SSH public keys operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all of the SSH public keys in the specified resource group. Use the nextLink property in the response to - * get the next page of SSH public keys. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list SSH public keys operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * Lists all of the SSH public keys in the specified resource group. Use the nextLink property in the response to - * get the next page of SSH public keys. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list SSH public keys operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * Creates a new SSH public key resource. - * - * @param resourceGroupName The name of the resource group. - * @param sshPublicKeyName The name of the SSH public key. - * @param parameters Parameters supplied to create the SSH public key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the SSH public key. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createWithResponseAsync( - String resourceGroupName, String sshPublicKeyName, SshPublicKeyResourceInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (sshPublicKeyName == null) { - return Mono - .error(new IllegalArgumentException("Parameter sshPublicKeyName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .create( - this.client.getEndpoint(), - resourceGroupName, - sshPublicKeyName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates a new SSH public key resource. - * - * @param resourceGroupName The name of the resource group. - * @param sshPublicKeyName The name of the SSH public key. - * @param parameters Parameters supplied to create the SSH public key. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the SSH public key. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync( - String resourceGroupName, String sshPublicKeyName, SshPublicKeyResourceInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (sshPublicKeyName == null) { - return Mono - .error(new IllegalArgumentException("Parameter sshPublicKeyName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .create( - this.client.getEndpoint(), - resourceGroupName, - sshPublicKeyName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Creates a new SSH public key resource. - * - * @param resourceGroupName The name of the resource group. - * @param sshPublicKeyName The name of the SSH public key. - * @param parameters Parameters supplied to create the SSH public key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the SSH public key. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createAsync( - String resourceGroupName, String sshPublicKeyName, SshPublicKeyResourceInner parameters) { - return createWithResponseAsync(resourceGroupName, sshPublicKeyName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates a new SSH public key resource. - * - * @param resourceGroupName The name of the resource group. - * @param sshPublicKeyName The name of the SSH public key. - * @param parameters Parameters supplied to create the SSH public key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the SSH public key. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SshPublicKeyResourceInner create( - String resourceGroupName, String sshPublicKeyName, SshPublicKeyResourceInner parameters) { - return createAsync(resourceGroupName, sshPublicKeyName, parameters).block(); - } - - /** - * Creates a new SSH public key resource. - * - * @param resourceGroupName The name of the resource group. - * @param sshPublicKeyName The name of the SSH public key. - * @param parameters Parameters supplied to create the SSH public key. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the SSH public key. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse( - String resourceGroupName, String sshPublicKeyName, SshPublicKeyResourceInner parameters, Context context) { - return createWithResponseAsync(resourceGroupName, sshPublicKeyName, parameters, context).block(); - } - - /** - * Updates a new SSH public key resource. - * - * @param resourceGroupName The name of the resource group. - * @param sshPublicKeyName The name of the SSH public key. - * @param parameters Parameters supplied to update the SSH public key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the SSH public key. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateWithResponseAsync( - String resourceGroupName, String sshPublicKeyName, SshPublicKeyUpdateResource parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (sshPublicKeyName == null) { - return Mono - .error(new IllegalArgumentException("Parameter sshPublicKeyName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - resourceGroupName, - sshPublicKeyName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates a new SSH public key resource. - * - * @param resourceGroupName The name of the resource group. - * @param sshPublicKeyName The name of the SSH public key. - * @param parameters Parameters supplied to update the SSH public key. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the SSH public key. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, String sshPublicKeyName, SshPublicKeyUpdateResource parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (sshPublicKeyName == null) { - return Mono - .error(new IllegalArgumentException("Parameter sshPublicKeyName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - resourceGroupName, - sshPublicKeyName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Updates a new SSH public key resource. - * - * @param resourceGroupName The name of the resource group. - * @param sshPublicKeyName The name of the SSH public key. - * @param parameters Parameters supplied to update the SSH public key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the SSH public key. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync( - String resourceGroupName, String sshPublicKeyName, SshPublicKeyUpdateResource parameters) { - return updateWithResponseAsync(resourceGroupName, sshPublicKeyName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Updates a new SSH public key resource. - * - * @param resourceGroupName The name of the resource group. - * @param sshPublicKeyName The name of the SSH public key. - * @param parameters Parameters supplied to update the SSH public key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the SSH public key. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SshPublicKeyResourceInner update( - String resourceGroupName, String sshPublicKeyName, SshPublicKeyUpdateResource parameters) { - return updateAsync(resourceGroupName, sshPublicKeyName, parameters).block(); - } - - /** - * Updates a new SSH public key resource. - * - * @param resourceGroupName The name of the resource group. - * @param sshPublicKeyName The name of the SSH public key. - * @param parameters Parameters supplied to update the SSH public key. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the SSH public key. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, String sshPublicKeyName, SshPublicKeyUpdateResource parameters, Context context) { - return updateWithResponseAsync(resourceGroupName, sshPublicKeyName, parameters, context).block(); - } - - /** - * Delete an SSH public key. - * - * @param resourceGroupName The name of the resource group. - * @param sshPublicKeyName The name of the SSH public key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String resourceGroupName, String sshPublicKeyName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (sshPublicKeyName == null) { - return Mono - .error(new IllegalArgumentException("Parameter sshPublicKeyName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - sshPublicKeyName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete an SSH public key. - * - * @param resourceGroupName The name of the resource group. - * @param sshPublicKeyName The name of the SSH public key. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String sshPublicKeyName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (sshPublicKeyName == null) { - return Mono - .error(new IllegalArgumentException("Parameter sshPublicKeyName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - sshPublicKeyName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Delete an SSH public key. - * - * @param resourceGroupName The name of the resource group. - * @param sshPublicKeyName The name of the SSH public key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String sshPublicKeyName) { - return deleteWithResponseAsync(resourceGroupName, sshPublicKeyName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Delete an SSH public key. - * - * @param resourceGroupName The name of the resource group. - * @param sshPublicKeyName The name of the SSH public key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String sshPublicKeyName) { - deleteAsync(resourceGroupName, sshPublicKeyName).block(); - } - - /** - * Delete an SSH public key. - * - * @param resourceGroupName The name of the resource group. - * @param sshPublicKeyName The name of the SSH public key. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String sshPublicKeyName, Context context) { - return deleteWithResponseAsync(resourceGroupName, sshPublicKeyName, context).block(); - } - - /** - * Retrieves information about an SSH public key. - * - * @param resourceGroupName The name of the resource group. - * @param sshPublicKeyName The name of the SSH public key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the SSH public key. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String sshPublicKeyName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (sshPublicKeyName == null) { - return Mono - .error(new IllegalArgumentException("Parameter sshPublicKeyName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - sshPublicKeyName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Retrieves information about an SSH public key. - * - * @param resourceGroupName The name of the resource group. - * @param sshPublicKeyName The name of the SSH public key. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the SSH public key. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String sshPublicKeyName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (sshPublicKeyName == null) { - return Mono - .error(new IllegalArgumentException("Parameter sshPublicKeyName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - sshPublicKeyName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Retrieves information about an SSH public key. - * - * @param resourceGroupName The name of the resource group. - * @param sshPublicKeyName The name of the SSH public key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the SSH public key. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync(String resourceGroupName, String sshPublicKeyName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, sshPublicKeyName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Retrieves information about an SSH public key. - * - * @param resourceGroupName The name of the resource group. - * @param sshPublicKeyName The name of the SSH public key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the SSH public key. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SshPublicKeyResourceInner getByResourceGroup(String resourceGroupName, String sshPublicKeyName) { - return getByResourceGroupAsync(resourceGroupName, sshPublicKeyName).block(); - } - - /** - * Retrieves information about an SSH public key. - * - * @param resourceGroupName The name of the resource group. - * @param sshPublicKeyName The name of the SSH public key. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the SSH public key. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String sshPublicKeyName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, sshPublicKeyName, context).block(); - } - - /** - * Generates and returns a public/private key pair and populates the SSH public key resource with the public key. - * The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource. - * - * @param resourceGroupName The name of the resource group. - * @param sshPublicKeyName The name of the SSH public key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response from generation of an SSH key pair. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> generateKeyPairWithResponseAsync( - String resourceGroupName, String sshPublicKeyName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (sshPublicKeyName == null) { - return Mono - .error(new IllegalArgumentException("Parameter sshPublicKeyName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .generateKeyPair( - this.client.getEndpoint(), - resourceGroupName, - sshPublicKeyName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Generates and returns a public/private key pair and populates the SSH public key resource with the public key. - * The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource. - * - * @param resourceGroupName The name of the resource group. - * @param sshPublicKeyName The name of the SSH public key. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response from generation of an SSH key pair. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> generateKeyPairWithResponseAsync( - String resourceGroupName, String sshPublicKeyName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (sshPublicKeyName == null) { - return Mono - .error(new IllegalArgumentException("Parameter sshPublicKeyName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .generateKeyPair( - this.client.getEndpoint(), - resourceGroupName, - sshPublicKeyName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Generates and returns a public/private key pair and populates the SSH public key resource with the public key. - * The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource. - * - * @param resourceGroupName The name of the resource group. - * @param sshPublicKeyName The name of the SSH public key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response from generation of an SSH key pair. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono generateKeyPairAsync( - String resourceGroupName, String sshPublicKeyName) { - return generateKeyPairWithResponseAsync(resourceGroupName, sshPublicKeyName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Generates and returns a public/private key pair and populates the SSH public key resource with the public key. - * The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource. - * - * @param resourceGroupName The name of the resource group. - * @param sshPublicKeyName The name of the SSH public key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response from generation of an SSH key pair. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SshPublicKeyGenerateKeyPairResultInner generateKeyPair(String resourceGroupName, String sshPublicKeyName) { - return generateKeyPairAsync(resourceGroupName, sshPublicKeyName).block(); - } - - /** - * Generates and returns a public/private key pair and populates the SSH public key resource with the public key. - * The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource. - * - * @param resourceGroupName The name of the resource group. - * @param sshPublicKeyName The name of the SSH public key. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response from generation of an SSH key pair. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response generateKeyPairWithResponse( - String resourceGroupName, String sshPublicKeyName, Context context) { - return generateKeyPairWithResponseAsync(resourceGroupName, sshPublicKeyName, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list SSH public keys operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list SSH public keys operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list SSH public keys operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list SSH public keys operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/UnmanagedDataDiskImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/UnmanagedDataDiskImpl.java deleted file mode 100644 index f5ae61469b4a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/UnmanagedDataDiskImpl.java +++ /dev/null @@ -1,226 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.implementation; - -import com.azure.core.management.AzureEnvironment; -import com.azure.resourcemanager.compute.models.CachingTypes; -import com.azure.resourcemanager.compute.models.DataDisk; -import com.azure.resourcemanager.compute.models.DiskCreateOptionTypes; -import com.azure.resourcemanager.compute.models.VirtualHardDisk; -import com.azure.resourcemanager.compute.models.VirtualMachine; -import com.azure.resourcemanager.compute.models.VirtualMachineUnmanagedDataDisk; -import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.ChildResourceImpl; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import com.azure.resourcemanager.storage.models.StorageAccount; -import java.util.ArrayList; -import java.util.List; -import java.util.UUID; - -/** The implementation for {@link DataDisk} and its create and update interfaces. */ -class UnmanagedDataDiskImpl extends ChildResourceImpl - implements VirtualMachineUnmanagedDataDisk, - VirtualMachineUnmanagedDataDisk.DefinitionWithExistingVhd, - VirtualMachineUnmanagedDataDisk.DefinitionWithNewVhd, - VirtualMachineUnmanagedDataDisk.DefinitionWithImage, - VirtualMachineUnmanagedDataDisk.UpdateDefinitionWithExistingVhd, - VirtualMachineUnmanagedDataDisk.UpdateDefinitionWithNewVhd, - VirtualMachineUnmanagedDataDisk.Update { - - protected UnmanagedDataDiskImpl(DataDisk inner, VirtualMachineImpl parent) { - super(inner, parent); - } - - protected static UnmanagedDataDiskImpl prepareDataDisk(String name, VirtualMachineImpl parent) { - DataDisk dataDiskInner = new DataDisk(); - dataDiskInner.withLun(-1).withName(name).withVhd(null); - return new UnmanagedDataDiskImpl(dataDiskInner, parent); - } - - @Override - public String name() { - return this.innerModel().name(); - } - - @Override - public int size() { - return ResourceManagerUtils.toPrimitiveInt(this.innerModel().diskSizeGB()); - } - - @Override - public int lun() { - return ResourceManagerUtils.toPrimitiveInt(this.innerModel().lun()); - } - - @Override - public String vhdUri() { - return this.innerModel().vhd().uri(); - } - - @Override - public CachingTypes cachingType() { - return this.innerModel().caching(); - } - - @Override - public String sourceImageUri() { - if (this.innerModel().image() != null) { - return this.innerModel().image().uri(); - } - return null; - } - - @Override - public DiskCreateOptionTypes creationMethod() { - return this.innerModel().createOption(); - } - - @Override - public UnmanagedDataDiskImpl withNewVhd(int sizeInGB) { - this.innerModel().withCreateOption(DiskCreateOptionTypes.EMPTY).withDiskSizeGB(sizeInGB); - return this; - } - - @Override - public UnmanagedDataDiskImpl withExistingVhd(String storageAccountName, String containerName, String vhdName) { - this - .innerModel() - .withCreateOption(DiskCreateOptionTypes.ATTACH) - .withVhd(new VirtualHardDisk().withUri(blobUrl(storageAccountName, containerName, vhdName))); - return this; - } - - @Override - public UnmanagedDataDiskImpl fromImage(int imageLun) { - this.innerModel().withCreateOption(DiskCreateOptionTypes.FROM_IMAGE).withLun(imageLun); - return this; - } - - @Override - public UnmanagedDataDiskImpl withSizeInGB(Integer sizeInGB) { - this.innerModel().withDiskSizeGB(sizeInGB); - return this; - } - - @Override - public UnmanagedDataDiskImpl withLun(Integer lun) { - this.innerModel().withLun(lun); - return this; - } - - @Override - public UnmanagedDataDiskImpl withCaching(CachingTypes cachingType) { - this.innerModel().withCaching(cachingType); - return this; - } - - @Override - public UnmanagedDataDiskImpl storeAt(String storageAccountName, String containerName, String vhdName) { - this.innerModel().withVhd(new VirtualHardDisk()); - // URL points to where the underlying vhd needs to be stored - this.innerModel().vhd().withUri(blobUrl(storageAccountName, containerName, vhdName)); - return this; - } - - @Override - public VirtualMachineImpl attach() { - return this.parent().withUnmanagedDataDisk(this); - } - - protected static void setDataDisksDefaults(List dataDisks, String namePrefix) { - List usedLuns = new ArrayList<>(); - for (VirtualMachineUnmanagedDataDisk dataDisk : dataDisks) { - if (dataDisk.lun() != -1) { - usedLuns.add(dataDisk.lun()); - } - } - - for (VirtualMachineUnmanagedDataDisk dataDisk : dataDisks) { - if (dataDisk.lun() == -1) { - Integer i = 0; - while (usedLuns.contains(i)) { - i += 1; - } - dataDisk.innerModel().withLun(i); - usedLuns.add(i); - } - - if (dataDisk.name() == null) { - dataDisk.innerModel().withName(namePrefix + "-data-disk-" + dataDisk.lun()); - } - - if (dataDisk.innerModel().caching() == null) { - dataDisk.innerModel().withCaching(CachingTypes.READ_WRITE); - } - } - } - - protected static void ensureDisksVhdUri( - List dataDisks, StorageAccount storageAccount, String namePrefix) { - for (VirtualMachineUnmanagedDataDisk dataDisk : dataDisks) { - if (dataDisk.creationMethod() == DiskCreateOptionTypes.EMPTY - || dataDisk.creationMethod() == DiskCreateOptionTypes.FROM_IMAGE) { - // New empty and from image data disk requires Vhd Uri to be set - if (dataDisk.innerModel().vhd() == null) { - dataDisk.innerModel().withVhd(new VirtualHardDisk()); - dataDisk - .innerModel() - .vhd() - .withUri( - storageAccount.endPoints().primary().blob() - + "vhds/" - + namePrefix - + "-data-disk-" - + dataDisk.lun() - + "-" - + UUID.randomUUID().toString() - + ".vhd"); - } - } - } - } - - protected static void ensureDisksVhdUri(List dataDisks, String namePrefix) { - String containerUrl = null; - for (VirtualMachineUnmanagedDataDisk dataDisk : dataDisks) { - if (dataDisk.creationMethod() == DiskCreateOptionTypes.EMPTY && dataDisk.innerModel().vhd() != null) { - int idx = dataDisk.innerModel().vhd().uri().lastIndexOf('/'); - containerUrl = dataDisk.innerModel().vhd().uri().substring(0, idx); - break; - } - } - if (containerUrl != null) { - for (VirtualMachineUnmanagedDataDisk dataDisk : dataDisks) { - if (dataDisk.creationMethod() == DiskCreateOptionTypes.EMPTY) { - // New data disk requires Vhd Uri to be set - if (dataDisk.innerModel().vhd() == null) { - dataDisk.innerModel().withVhd(new VirtualHardDisk()); - dataDisk - .innerModel() - .vhd() - .withUri( - containerUrl - + namePrefix - + "-data-disk-" - + dataDisk.lun() - + "-" - + UUID.randomUUID().toString() - + ".vhd"); - } - } - } - } - } - - private String blobUrl(String storageAccountName, String containerName, String blobName) { - AzureEnvironment azureEnvironment = this.parent().environment(); - return "https://" - + storageAccountName - + ".blob" - + azureEnvironment.getStorageEndpointSuffix() - + "/" - + containerName - + "/" - + blobName; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/UsagesClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/UsagesClientImpl.java deleted file mode 100644 index 275f4d0ec978..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/UsagesClientImpl.java +++ /dev/null @@ -1,313 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.fluent.UsagesClient; -import com.azure.resourcemanager.compute.fluent.models.UsageInner; -import com.azure.resourcemanager.compute.models.ListUsagesResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in UsagesClient. */ -public final class UsagesClientImpl implements UsagesClient { - private final ClientLogger logger = new ClientLogger(UsagesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final UsagesService service; - - /** The service client containing this operation class. */ - private final ComputeManagementClientImpl client; - - /** - * Initializes an instance of UsagesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - UsagesClientImpl(ComputeManagementClientImpl client) { - this.service = RestProxy.create(UsagesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for ComputeManagementClientUsages to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "ComputeManagementCli") - private interface UsagesService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/usages") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("location") String location, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets, for the specified location, the current compute resource usage information as well as the limits for - * compute resources under the subscription. - * - * @param location The location for which resource usage is queried. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Usages operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String location) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - location, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets, for the specified location, the current compute resource usage information as well as the limits for - * compute resources under the subscription. - * - * @param location The location for which resource usage is queried. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Usages operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String location, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), location, apiVersion, this.client.getSubscriptionId(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets, for the specified location, the current compute resource usage information as well as the limits for - * compute resources under the subscription. - * - * @param location The location for which resource usage is queried. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Usages operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String location) { - return new PagedFlux<>(() -> listSinglePageAsync(location), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets, for the specified location, the current compute resource usage information as well as the limits for - * compute resources under the subscription. - * - * @param location The location for which resource usage is queried. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Usages operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String location, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(location, context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets, for the specified location, the current compute resource usage information as well as the limits for - * compute resources under the subscription. - * - * @param location The location for which resource usage is queried. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Usages operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String location) { - return new PagedIterable<>(listAsync(location)); - } - - /** - * Gets, for the specified location, the current compute resource usage information as well as the limits for - * compute resources under the subscription. - * - * @param location The location for which resource usage is queried. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Usages operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String location, Context context) { - return new PagedIterable<>(listAsync(location, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Usages operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Usages operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VMSSPatchPayload.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VMSSPatchPayload.java deleted file mode 100644 index fd4a01278413..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VMSSPatchPayload.java +++ /dev/null @@ -1,170 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.implementation; - -import com.azure.core.management.SubResource; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSet; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetIpConfiguration; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetNetworkConfiguration; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetUpdate; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetUpdateIpConfiguration; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetUpdateNetworkConfiguration; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetUpdateNetworkProfile; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetUpdateOSDisk; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetUpdateOSProfile; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetUpdatePublicIpAddressConfiguration; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetUpdateStorageProfile; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetUpdateVMProfile; -import java.util.ArrayList; - -class VMSSPatchPayload { - static VirtualMachineScaleSetUpdate preparePatchPayload(VirtualMachineScaleSet scaleSet) { - VirtualMachineScaleSetUpdate updateParameter = new VirtualMachineScaleSetUpdate(); - // - updateParameter.withIdentity(scaleSet.innerModel().identity()); - updateParameter.withOverprovision(scaleSet.innerModel().overprovision()); - //updateParameter.withPlan(scaleSet.innerModel().plan()); // update cannot change plan - updateParameter.withSinglePlacementGroup(scaleSet.innerModel().singlePlacementGroup()); - updateParameter.withSku(scaleSet.innerModel().sku()); - updateParameter.withTags(scaleSet.innerModel().tags()); - updateParameter.withUpgradePolicy(scaleSet.innerModel().upgradePolicy()); - updateParameter.withAdditionalCapabilities(scaleSet.innerModel().additionalCapabilities()); - // - if (scaleSet.innerModel().virtualMachineProfile() != null) { - // -- - VirtualMachineScaleSetUpdateVMProfile updateVMProfile = new VirtualMachineScaleSetUpdateVMProfile(); - updateVMProfile.withDiagnosticsProfile(scaleSet.innerModel().virtualMachineProfile().diagnosticsProfile()); - updateVMProfile.withExtensionProfile(scaleSet.innerModel().virtualMachineProfile().extensionProfile()); - updateVMProfile.withLicenseType(scaleSet.innerModel().virtualMachineProfile().licenseType()); - updateVMProfile.withBillingProfile(scaleSet.innerModel().virtualMachineProfile().billingProfile()); - // - if (scaleSet.innerModel().virtualMachineProfile().storageProfile() != null) { - // -- -- - VirtualMachineScaleSetUpdateStorageProfile storageProfile = - new VirtualMachineScaleSetUpdateStorageProfile(); - storageProfile - .withDataDisks(scaleSet.innerModel().virtualMachineProfile().storageProfile().dataDisks()); - storageProfile - .withImageReference( - scaleSet.innerModel().virtualMachineProfile().storageProfile().imageReference()); - - if (scaleSet.innerModel().virtualMachineProfile().storageProfile().osDisk() != null) { - VirtualMachineScaleSetUpdateOSDisk osDisk = new VirtualMachineScaleSetUpdateOSDisk(); - osDisk - .withCaching(scaleSet.innerModel().virtualMachineProfile().storageProfile().osDisk().caching()); - osDisk.withImage(scaleSet.innerModel().virtualMachineProfile().storageProfile().osDisk().image()); - osDisk - .withManagedDisk( - scaleSet.innerModel().virtualMachineProfile().storageProfile().osDisk().managedDisk()); - osDisk - .withVhdContainers( - scaleSet.innerModel().virtualMachineProfile().storageProfile().osDisk().vhdContainers()); - osDisk - .withWriteAcceleratorEnabled( - scaleSet - .innerModel() - .virtualMachineProfile() - .storageProfile() - .osDisk() - .writeAcceleratorEnabled()); - storageProfile.withOsDisk(osDisk); - } - updateVMProfile.withStorageProfile(storageProfile); - // -- -- - } - if (scaleSet.innerModel().virtualMachineProfile().osProfile() != null) { - // -- -- - VirtualMachineScaleSetUpdateOSProfile osProfile = new VirtualMachineScaleSetUpdateOSProfile(); - osProfile.withCustomData(scaleSet.innerModel().virtualMachineProfile().osProfile().customData()); - osProfile - .withLinuxConfiguration( - scaleSet.innerModel().virtualMachineProfile().osProfile().linuxConfiguration()); - osProfile.withSecrets(scaleSet.innerModel().virtualMachineProfile().osProfile().secrets()); - osProfile - .withWindowsConfiguration( - scaleSet.innerModel().virtualMachineProfile().osProfile().windowsConfiguration()); - updateVMProfile.withOsProfile(osProfile); - // -- -- - } - if (scaleSet.innerModel().virtualMachineProfile().networkProfile() != null) { - // -- -- - VirtualMachineScaleSetUpdateNetworkProfile networkProfile = - new VirtualMachineScaleSetUpdateNetworkProfile(); - - if (scaleSet.innerModel().virtualMachineProfile().networkProfile().networkInterfaceConfigurations() - != null) { - networkProfile - .withNetworkInterfaceConfigurations( - new ArrayList()); - for (VirtualMachineScaleSetNetworkConfiguration nicConfig - : scaleSet - .innerModel() - .virtualMachineProfile() - .networkProfile() - .networkInterfaceConfigurations()) { - VirtualMachineScaleSetUpdateNetworkConfiguration nicPatchConfig = - new VirtualMachineScaleSetUpdateNetworkConfiguration(); - nicPatchConfig.withDnsSettings(nicConfig.dnsSettings()); - nicPatchConfig.withEnableAcceleratedNetworking(nicConfig.enableAcceleratedNetworking()); - nicPatchConfig.withEnableIpForwarding(nicConfig.enableIpForwarding()); - nicPatchConfig.withName(nicConfig.name()); - nicPatchConfig.withNetworkSecurityGroup(nicConfig.networkSecurityGroup()); - nicPatchConfig.withPrimary(nicConfig.primary()); - nicPatchConfig.withId(nicConfig.id()); - if (nicConfig.ipConfigurations() != null) { - nicPatchConfig - .withIpConfigurations(new ArrayList()); - for (VirtualMachineScaleSetIpConfiguration ipConfig : nicConfig.ipConfigurations()) { - VirtualMachineScaleSetUpdateIpConfiguration patchIpConfig = - new VirtualMachineScaleSetUpdateIpConfiguration(); - patchIpConfig - .withApplicationGatewayBackendAddressPools( - ipConfig.applicationGatewayBackendAddressPools()); - patchIpConfig - .withLoadBalancerBackendAddressPools(ipConfig.loadBalancerBackendAddressPools()); - patchIpConfig.withLoadBalancerInboundNatPools(ipConfig.loadBalancerInboundNatPools()); - patchIpConfig.withName(ipConfig.name()); - patchIpConfig.withPrimary(ipConfig.primary()); - patchIpConfig.withPrivateIpAddressVersion(ipConfig.privateIpAddressVersion()); - patchIpConfig.withSubnet(ipConfig.subnet()); - patchIpConfig.withId(ipConfig.id()); - if (ipConfig.publicIpAddressConfiguration() != null) { - patchIpConfig - .withPublicIpAddressConfiguration( - new VirtualMachineScaleSetUpdatePublicIpAddressConfiguration()); - patchIpConfig - .publicIpAddressConfiguration() - .withDnsSettings(ipConfig.publicIpAddressConfiguration().dnsSettings()); - patchIpConfig - .publicIpAddressConfiguration() - .withIdleTimeoutInMinutes( - ipConfig.publicIpAddressConfiguration().idleTimeoutInMinutes()); - patchIpConfig - .publicIpAddressConfiguration() - .withName(ipConfig.publicIpAddressConfiguration().name()); - } - if (ipConfig.applicationSecurityGroups() != null) { - patchIpConfig.withApplicationSecurityGroups(new ArrayList()); - for (SubResource asg : ipConfig.applicationSecurityGroups()) { - patchIpConfig - .applicationSecurityGroups() - .add(new SubResource().withId(asg.id())); - } - } - nicPatchConfig.ipConfigurations().add(patchIpConfig); - } - } - networkProfile.networkInterfaceConfigurations().add(nicPatchConfig); - } - } - updateVMProfile.withNetworkProfile(networkProfile); - // -- -- - } - updateParameter.withVirtualMachineProfile(updateVMProfile); - // -- - } - // - return updateParameter; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineCustomImageImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineCustomImageImpl.java deleted file mode 100644 index c532ef1369f1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineCustomImageImpl.java +++ /dev/null @@ -1,292 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.implementation; - -import com.azure.core.management.SubResource; -import com.azure.resourcemanager.compute.ComputeManager; -import com.azure.resourcemanager.compute.models.CachingTypes; -import com.azure.resourcemanager.compute.models.Disk; -import com.azure.resourcemanager.compute.models.HyperVGenerationTypes; -import com.azure.resourcemanager.compute.models.ImageDataDisk; -import com.azure.resourcemanager.compute.models.ImageOSDisk; -import com.azure.resourcemanager.compute.models.ImageStorageProfile; -import com.azure.resourcemanager.compute.models.OperatingSystemStateTypes; -import com.azure.resourcemanager.compute.models.OperatingSystemTypes; -import com.azure.resourcemanager.compute.models.Snapshot; -import com.azure.resourcemanager.compute.models.VirtualMachine; -import com.azure.resourcemanager.compute.models.VirtualMachineCustomImage; -import com.azure.resourcemanager.compute.fluent.models.ImageInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.GroupableResourceImpl; -import reactor.core.publisher.Mono; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** The implementation for VirtualMachineCustomImage. */ -class VirtualMachineCustomImageImpl - extends GroupableResourceImpl - implements VirtualMachineCustomImage, VirtualMachineCustomImage.Definition { - - VirtualMachineCustomImageImpl(final String name, ImageInner innerModel, final ComputeManager computeManager) { - super(name, innerModel, computeManager); - // set the default value for the hyper-v generation - this.innerModel().withHyperVGeneration(HyperVGenerationTypes.V1); - } - - @Override - public boolean isCreatedFromVirtualMachine() { - return this.sourceVirtualMachineId() != null; - } - - @Override - public HyperVGenerationTypes hyperVGeneration() { - return this.innerModel().hyperVGeneration(); - } - - @Override - public String sourceVirtualMachineId() { - if (this.innerModel().sourceVirtualMachine() == null) { - return null; - } - return this.innerModel().sourceVirtualMachine().id(); - } - - @Override - public ImageOSDisk osDiskImage() { - if (this.innerModel().storageProfile() == null) { - return null; - } - return this.innerModel().storageProfile().osDisk(); - } - - @Override - public Map dataDiskImages() { - if (this.innerModel().storageProfile() == null || this.innerModel().storageProfile().dataDisks() == null) { - return Collections.unmodifiableMap(new HashMap<>()); - } - HashMap diskImages = new HashMap<>(); - for (ImageDataDisk dataDisk : this.innerModel().storageProfile().dataDisks()) { - diskImages.put(dataDisk.lun(), dataDisk); - } - return Collections.unmodifiableMap(diskImages); - } - - @Override - public VirtualMachineCustomImageImpl fromVirtualMachine(String virtualMachineId) { - this.innerModel().withSourceVirtualMachine(new SubResource().withId(virtualMachineId)); - return this; - } - - @Override - public VirtualMachineCustomImageImpl fromVirtualMachine(VirtualMachine virtualMachine) { - return this.fromVirtualMachine(virtualMachine.id()); - } - - @Override - public VirtualMachineCustomImageImpl withWindowsFromVhd(String sourceVhdUrl, OperatingSystemStateTypes osState) { - this - .ensureOsDiskImage() - .withOsState(osState) - .withOsType(OperatingSystemTypes.WINDOWS) - .withBlobUri(sourceVhdUrl); - return this; - } - - @Override - public VirtualMachineCustomImageImpl withLinuxFromVhd(String sourceVhdUrl, OperatingSystemStateTypes osState) { - this.ensureOsDiskImage().withOsState(osState).withOsType(OperatingSystemTypes.LINUX).withBlobUri(sourceVhdUrl); - return this; - } - - @Override - public VirtualMachineCustomImageImpl withWindowsFromSnapshot( - String sourceSnapshotId, OperatingSystemStateTypes osState) { - this - .ensureOsDiskImage() - .withOsState(osState) - .withOsType(OperatingSystemTypes.WINDOWS) - .withSnapshot(new SubResource().withId(sourceSnapshotId)); - return this; - } - - @Override - public VirtualMachineCustomImageImpl withLinuxFromSnapshot( - String sourceSnapshotId, OperatingSystemStateTypes osState) { - this - .ensureOsDiskImage() - .withOsState(osState) - .withOsType(OperatingSystemTypes.LINUX) - .withSnapshot(new SubResource().withId(sourceSnapshotId)); - - return this; - } - - @Override - public VirtualMachineCustomImageImpl withWindowsFromSnapshot( - Snapshot sourceSnapshot, OperatingSystemStateTypes osState) { - return this.withWindowsFromSnapshot(sourceSnapshot.id(), osState); - } - - @Override - public VirtualMachineCustomImageImpl withLinuxFromSnapshot( - Snapshot sourceSnapshot, OperatingSystemStateTypes osState) { - return this.withLinuxFromSnapshot(sourceSnapshot.id(), osState); - } - - @Override - public VirtualMachineCustomImageImpl withWindowsFromDisk( - String sourceManagedDiskId, OperatingSystemStateTypes osState) { - this - .ensureOsDiskImage() - .withOsState(osState) - .withOsType(OperatingSystemTypes.WINDOWS) - .withManagedDisk(new SubResource().withId(sourceManagedDiskId)); - return this; - } - - @Override - public VirtualMachineCustomImageImpl withLinuxFromDisk( - String sourceManagedDiskId, OperatingSystemStateTypes osState) { - this - .ensureOsDiskImage() - .withOsState(osState) - .withOsType(OperatingSystemTypes.LINUX) - .withManagedDisk(new SubResource().withId(sourceManagedDiskId)); - return this; - } - - @Override - public VirtualMachineCustomImageImpl withWindowsFromDisk( - Disk sourceManagedDisk, OperatingSystemStateTypes osState) { - return withWindowsFromDisk(sourceManagedDisk.id(), osState); - } - - @Override - public VirtualMachineCustomImageImpl withLinuxFromDisk(Disk sourceManagedDisk, OperatingSystemStateTypes osState) { - return withLinuxFromDisk(sourceManagedDisk.id(), osState); - } - - @Override - public VirtualMachineCustomImageImpl withDataDiskImageFromVhd(String sourceVhdUrl) { - this.defineDataDiskImage().withLun(-1).fromVhd(sourceVhdUrl).attach(); - return this; - } - - @Override - public VirtualMachineCustomImageImpl withDataDiskImageFromSnapshot(String sourceSnapshotId) { - this.defineDataDiskImage().withLun(-1).fromSnapshot(sourceSnapshotId).attach(); - return this; - } - - @Override - public VirtualMachineCustomImageImpl withDataDiskImageFromManagedDisk(String sourceManagedDiskId) { - this.defineDataDiskImage().withLun(-1).fromManagedDisk(sourceManagedDiskId).attach(); - return this; - } - - @Override - public CustomImageDataDiskImpl defineDataDiskImage() { - return new CustomImageDataDiskImpl(new ImageDataDisk(), this); - } - - @Override - public VirtualMachineCustomImageImpl withOSDiskSizeInGB(int diskSizeGB) { - this.ensureOsDiskImage().withDiskSizeGB(diskSizeGB); - return this; - } - - @Override - public VirtualMachineCustomImageImpl withOSDiskCaching(CachingTypes cachingType) { - this.ensureOsDiskImage().withCaching(cachingType); - return this; - } - - @Override - public VirtualMachineCustomImageImpl withZoneResilient() { - this.ensureStorageProfile().withZoneResilient(true); - return this; - } - - @Override - public Mono createResourceAsync() { - ensureDefaultLuns(); - return this - .manager() - .serviceClient() - .getImages() - .createOrUpdateAsync(resourceGroupName(), name(), this.innerModel()) - .map(innerToFluentMap(this)); - } - - @Override - protected Mono getInnerAsync() { - return this - .manager() - .serviceClient() - .getImages() - .getByResourceGroupAsync(this.resourceGroupName(), this.name()); - } - - private ImageOSDisk ensureOsDiskImage() { - this.ensureStorageProfile(); - if (this.innerModel().storageProfile().osDisk() == null) { - this.innerModel().storageProfile().withOsDisk(new ImageOSDisk()); - } - return this.innerModel().storageProfile().osDisk(); - } - - private ImageStorageProfile ensureStorageProfile() { - if (this.innerModel().storageProfile() == null) { - this.innerModel().withStorageProfile(new ImageStorageProfile()); - } - return this.innerModel().storageProfile(); - } - - private void ensureDefaultLuns() { - if (this.innerModel().storageProfile() != null && this.innerModel().storageProfile().dataDisks() != null) { - List imageDisks = this.innerModel().storageProfile().dataDisks(); - List usedLuns = new ArrayList<>(); - for (ImageDataDisk imageDisk : imageDisks) { - if (imageDisk.lun() != -1) { - usedLuns.add(imageDisk.lun()); - } - } - if (usedLuns.size() == imageDisks.size()) { - return; - } - for (ImageDataDisk imageDisk : imageDisks) { - if (imageDisk.lun() != -1) { - continue; - } - Integer i = 0; - while (usedLuns.contains(i)) { - i += 1; - } - imageDisk.withLun(i); - usedLuns.add(i); - } - } - } - - VirtualMachineCustomImageImpl withCustomImageDataDisk(CustomImageDataDiskImpl customImageDataDisk) { - if (this.innerModel().storageProfile() == null) { - this.innerModel().withStorageProfile(new ImageStorageProfile()); - } - if (this.innerModel().storageProfile().dataDisks() == null) { - this.innerModel().storageProfile().withDataDisks(new ArrayList()); - } - this.innerModel().storageProfile().dataDisks().add(customImageDataDisk.innerModel()); - return this; - } - - @Override - public VirtualMachineCustomImage.DefinitionStages.WithOSDiskImageSourceAltVirtualMachineSource withHyperVGeneration( - HyperVGenerationTypes hyperVGeneration) { - this.innerModel().withHyperVGeneration(hyperVGeneration); - return this; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineCustomImagesImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineCustomImagesImpl.java deleted file mode 100644 index 4bafc3e3c102..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineCustomImagesImpl.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.implementation; - -import com.azure.resourcemanager.compute.ComputeManager; -import com.azure.resourcemanager.compute.models.VirtualMachineCustomImage; -import com.azure.resourcemanager.compute.models.VirtualMachineCustomImages; -import com.azure.resourcemanager.compute.fluent.models.ImageInner; -import com.azure.resourcemanager.compute.fluent.ImagesClient; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.TopLevelModifiableResourcesImpl; - -/** The implementation for VirtualMachineCustomImages. */ -public class VirtualMachineCustomImagesImpl - extends TopLevelModifiableResourcesImpl< - VirtualMachineCustomImage, VirtualMachineCustomImageImpl, ImageInner, ImagesClient, ComputeManager> - implements VirtualMachineCustomImages { - - public VirtualMachineCustomImagesImpl(final ComputeManager computeManager) { - super(computeManager.serviceClient().getImages(), computeManager); - } - - @Override - protected VirtualMachineCustomImageImpl wrapModel(String name) { - return new VirtualMachineCustomImageImpl(name, new ImageInner(), this.manager()); - } - - @Override - protected VirtualMachineCustomImageImpl wrapModel(ImageInner inner) { - if (inner == null) { - return null; - } - return new VirtualMachineCustomImageImpl(inner.name(), inner, this.manager()); - } - - @Override - public VirtualMachineCustomImageImpl define(String name) { - return this.wrapModel(name); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineDataDiskImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineDataDiskImpl.java deleted file mode 100644 index 854825da7c21..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineDataDiskImpl.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.implementation; - -import com.azure.resourcemanager.compute.models.CachingTypes; -import com.azure.resourcemanager.compute.models.DataDisk; -import com.azure.resourcemanager.compute.models.DiskCreateOptionTypes; -import com.azure.resourcemanager.compute.models.StorageAccountTypes; -import com.azure.resourcemanager.compute.models.VirtualMachineDataDisk; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.WrapperImpl; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; - -/** The implementation for {@link VirtualMachineDataDisk} interface. */ -class VirtualMachineDataDiskImpl extends WrapperImpl implements VirtualMachineDataDisk { - - VirtualMachineDataDiskImpl(DataDisk dataDiskInner) { - super(dataDiskInner); - } - - @Override - public int size() { - return ResourceManagerUtils.toPrimitiveInt(this.innerModel().diskSizeGB()); - } - - @Override - public int lun() { - return this.innerModel().lun(); - } - - @Override - public CachingTypes cachingType() { - return this.innerModel().caching(); - } - - @Override - public DiskCreateOptionTypes creationMethod() { - return this.innerModel().createOption(); - } - - @Override - public StorageAccountTypes storageAccountType() { - if (this.innerModel().managedDisk() == null) { - return null; - } - return this.innerModel().managedDisk().storageAccountType(); - } - - @Override - public String id() { - if (this.innerModel().managedDisk() == null) { - return null; - } - return this.innerModel().managedDisk().id(); - } - - @Override - public String name() { - return this.innerModel().name(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineEncryptionHelper.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineEncryptionHelper.java deleted file mode 100644 index eb02b903ed53..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineEncryptionHelper.java +++ /dev/null @@ -1,370 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.implementation; - -import com.azure.resourcemanager.compute.models.DiskEncryptionSettings; -import com.azure.resourcemanager.compute.models.DiskVolumeEncryptionMonitor; -import com.azure.resourcemanager.compute.models.DiskVolumeType; -import com.azure.resourcemanager.compute.models.OperatingSystemTypes; -import com.azure.resourcemanager.compute.models.VirtualMachine; -import com.azure.resourcemanager.compute.models.VirtualMachineEncryptionConfiguration; -import com.azure.resourcemanager.compute.models.VirtualMachineExtension; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** Helper type to enable or disable virtual machine disk (OS, Data) encryption. */ -class VirtualMachineEncryptionHelper { - private final OperatingSystemTypes osType; - private final VirtualMachine virtualMachine; - // Error messages - private static final String ERROR_ENCRYPTION_EXTENSION_NOT_FOUND = - "Expected encryption extension not found in the VM"; - private static final String ERROR_NON_SUCCESS_PROVISIONING_STATE = - "Extension needed for disk encryption was not provisioned correctly, found ProvisioningState as '%s'"; - private static final String ERROR_EXPECTED_KEY_VAULT_URL_NOT_FOUND = - "Could not found URL pointing to the secret for disk encryption"; - private static final String ERROR_EXPECTED_ENCRYPTION_EXTENSION_STATUS_NOT_FOUND = - "Encryption extension with successful status not found in the VM"; - private static final String ERROR_ENCRYPTION_EXTENSION_STATUS_IS_EMPTY = "Encryption extension status is empty"; - private static final String ERROR_ON_LINUX_ONLY_DATA_DISK_CAN_BE_DECRYPTED = - "Only data disk is supported to disable encryption on Linux VM"; - private static final String ERROR_LEGACY_ENCRYPTION_EXTENSION_FOUND_AAD_PARAMS_REQUIRED = - "VM has Legacy Encryption Extension installed, updating it requires aadClientId and aadSecret parameters"; - private static final String ERROR_NOAAD_ENCRYPTION_EXTENSION_FOUND_AAD_PARAMS_NOT_REQUIRED = - "VM has NoAAD Encryption Extension installed, aadClientId and aadSecret parameters are not allowed for this" - + " extension."; - private static final String ERROR_NO_DECRYPT_ENCRYPTION_EXTENSION_NOT_FOUND = - ERROR_ENCRYPTION_EXTENSION_NOT_FOUND + ", no decryption to perform"; - /** - * Creates VirtualMachineEncryptionHelper. - * - * @param virtualMachine the virtual machine to enable or disable encryption - */ - VirtualMachineEncryptionHelper(final VirtualMachine virtualMachine) { - this.virtualMachine = virtualMachine; - this.osType = this.virtualMachine.osType(); - } - - /** - * Enables encryption. - * - * @param encryptionConfig the settings to be used for encryption extension - * @param the Windows or Linux encryption settings - * @return an observable that emits the encryption status - */ - > Mono enableEncryptionAsync( - final VirtualMachineEncryptionConfiguration encryptionConfig) { - final EncryptionSettings.Enable encryptSettings = EncryptionSettings.createEnable(encryptionConfig); - // If encryption extension is already installed then ensure user input aligns with state of the extension - return validateBeforeEncryptAsync(encryptSettings) - // If encryption extension is already installed then update it - .flatMap( - virtualMachineExtension -> updateEncryptionExtensionAsync(encryptSettings, virtualMachineExtension)) - // If encryption extension is not installed then install it - .switchIfEmpty(installEncryptionExtensionAsync(encryptSettings)) - .flatMap( - virtualMachine -> { - if (encryptSettings.requestedForNoAADEncryptExtension()) { - return noAADExtensionEncryptPostProcessingAsync(virtualMachine); - } else { - return legacyExtensionEncryptPostProcessingAsync(encryptSettings); - } - }); - } - - /** - * Disables encryption on the given disk volume. - * - * @param volumeType the disk volume - * @return an observable that emits the decryption status - */ - Mono disableEncryptionAsync(final DiskVolumeType volumeType) { - final EncryptionSettings.Disable encryptSettings = EncryptionSettings.createDisable(volumeType); - // - return validateBeforeDecryptAsync(volumeType) - // Update the encryption extension - .flatMap( - virtualMachineExtension -> - updateEncryptionExtensionAsync(encryptSettings, virtualMachineExtension) - .map(virtualMachine -> new VMExtTuple(virtualMachine, virtualMachineExtension))) - .flatMap( - vmExt -> { - if (EncryptionExtensionIdentifier.isNoAADVersion(osType, vmExt.encryptExtension.versionName())) { - return noAADExtensionDecryptPostProcessingAsync(vmExt.virtualMachine); - } else { - return legacyExtensionDecryptPostProcessingAsync(encryptSettings); - } - }); - } - - /** - * Perform any post processing after initiating VM encryption through NoAAD extension. - * - * @param virtualMachine the encrypted virtual machine - * @return the encryption progress monitor - */ - private Mono noAADExtensionEncryptPostProcessingAsync( - final VirtualMachine virtualMachine) { - // Gets the encryption status - return osType == OperatingSystemTypes.LINUX - ? new LinuxDiskVolumeNoAADEncryptionMonitorImpl(virtualMachine.id(), virtualMachine.manager()) - .refreshAsync() - : new WindowsVolumeNoAADEncryptionMonitorImpl(virtualMachine.id(), virtualMachine.manager()).refreshAsync(); - } - - /** - * Perform any post processing after initiating VM encryption through Legacy extension. - * - * @param encryptConfig the user provided encryption config - * @return the encryption progress monitor - */ - private > - Mono legacyExtensionEncryptPostProcessingAsync( - final EncryptionSettings.Enable encryptConfig) { - // Retrieve the encryption key URL after extension install or update - return retrieveEncryptionExtensionStatusStringAsync(ERROR_EXPECTED_KEY_VAULT_URL_NOT_FOUND) - // Update the VM's OS Disk (in storage profile) with the encryption metadata - .flatMap(keyVaultSecretUrl -> updateVMStorageProfileAsync(encryptConfig, keyVaultSecretUrl)) - // Gets the encryption status - .flatMap( - virtualMachine -> - osType == OperatingSystemTypes.LINUX - ? new LinuxDiskVolumeLegacyEncryptionMonitorImpl(virtualMachine.id(), virtualMachine.manager()) - .refreshAsync() - : new WindowsVolumeLegacyEncryptionMonitorImpl(virtualMachine.id(), virtualMachine.manager()) - .refreshAsync()); - } - - /** - * Perform any post processing after initiating VM decryption through NoAAD extension. - * - * @param virtualMachine the decrypted virtual machine - * @return the decryption progress monitor - */ - private Mono noAADExtensionDecryptPostProcessingAsync( - final VirtualMachine virtualMachine) { - // Gets the encryption status - return osType == OperatingSystemTypes.LINUX - ? new LinuxDiskVolumeNoAADEncryptionMonitorImpl(virtualMachine.id(), virtualMachine.manager()) - .refreshAsync() - : new WindowsVolumeNoAADEncryptionMonitorImpl(virtualMachine.id(), virtualMachine.manager()).refreshAsync(); - } - - /** - * Perform any post processing after initiating VM encryption through Legacy extension. - * - * @param encryptConfig the user provided encryption config - * @return the encryption progress monitor - */ - private Mono legacyExtensionDecryptPostProcessingAsync( - final EncryptionSettings.Disable encryptConfig) { - return retrieveEncryptionExtensionStatusStringAsync(ERROR_ENCRYPTION_EXTENSION_STATUS_IS_EMPTY) - // Update the VM's OS profile by marking encryption disabled - .flatMap(s -> updateVMStorageProfileAsync(encryptConfig)) - // Gets the encryption status - .flatMap( - virtualMachine -> - osType == OperatingSystemTypes.LINUX - ? new LinuxDiskVolumeLegacyEncryptionMonitorImpl(virtualMachine.id(), virtualMachine.manager()) - .refreshAsync() - : new WindowsVolumeLegacyEncryptionMonitorImpl(virtualMachine.id(), virtualMachine.manager()) - .refreshAsync()); - } - - /** - * If VM has encryption extension installed then validate that it can be updated based on user provided params, if - * invalid then return observable emitting error otherwise an observable emitting the extension. If extension is not - * installed then return empty observable. - * - * @param encryptSettings the user provided configuration - * @return observable emitting error, extension or empty. - */ - private > - Mono validateBeforeEncryptAsync(final EncryptionSettings.Enable encryptSettings) { - if (this.virtualMachine.storageProfile().osDisk().encryptionSettings() != null - && encryptSettings.requestedForNoAADEncryptExtension()) { - return Mono.error(new RuntimeException(ERROR_LEGACY_ENCRYPTION_EXTENSION_FOUND_AAD_PARAMS_REQUIRED)); - } - return getEncryptionExtensionInstalledInVMAsync() - .flatMap( - extension -> { - if (EncryptionExtensionIdentifier.isNoAADVersion(osType, extension.versionName())) { - // NoAAD-Encrypt-Extension exists so Legacy-Encrypt-Extension cannot be installed hence AAD - // params are not required. - return encryptSettings.requestedForNoAADEncryptExtension() - ? Mono.just(extension) - : Mono - .error( - new RuntimeException( - ERROR_NOAAD_ENCRYPTION_EXTENSION_FOUND_AAD_PARAMS_NOT_REQUIRED)); - } else { - // Legacy-Encrypt-Extension exists so NoAAD-Encrypt-Extension cannot be installed hence AAD - // params are required. - return encryptSettings.requestedForNoAADEncryptExtension() - ? Mono - .error( - new RuntimeException(ERROR_LEGACY_ENCRYPTION_EXTENSION_FOUND_AAD_PARAMS_REQUIRED)) - : Mono.just(extension); - } - }); - } - - /** - * Checks the given volume type in the virtual machine can be decrypted. - * - * @param volumeType the volume type to decrypt - * @return observable that emit existing encryption extension if installed else empty observable - */ - private Mono validateBeforeDecryptAsync(final DiskVolumeType volumeType) { - if (osType == OperatingSystemTypes.LINUX && volumeType != DiskVolumeType.DATA) { - return toErrorMono(ERROR_ON_LINUX_ONLY_DATA_DISK_CAN_BE_DECRYPTED); - } - return getEncryptionExtensionInstalledInVMAsync() - .switchIfEmpty(this.toErrorMono(ERROR_NO_DECRYPT_ENCRYPTION_EXTENSION_NOT_FOUND)); - } - - /** - * Retrieves encryption extension installed in the virtual machine, if the extension is not installed then return an - * empty observable. - * - * @return an observable that emits the encryption extension installed in the virtual machine - */ - private Mono getEncryptionExtensionInstalledInVMAsync() { - return virtualMachine - .listExtensionsAsync() - .flatMapMany(Flux::fromIterable) - // firstOrDefault() is used intentionally here instead of first() to ensure - // this method return empty observable if matching extension is not found. - .filter( - extension -> - EncryptionExtensionIdentifier.isEncryptionPublisherName(extension.publisherName()) - && EncryptionExtensionIdentifier.isEncryptionTypeName(extension.typeName(), osType)) - .singleOrEmpty(); - } - - /** - * Updates the encryption extension in the virtual machine using provided configuration. If extension is not - * installed then this method return empty observable. - * - * @param encryptSettings the volume encryption extension settings - * @param encryptionExtension existing encryption extension - * @return an observable that emits updated virtual machine if extension was already installed otherwise an empty - * observable. - */ - private Mono updateEncryptionExtensionAsync( - final EncryptionSettings encryptSettings, VirtualMachineExtension encryptionExtension) { - return virtualMachine - .update() - .updateExtension(encryptionExtension.name()) - .withPublicSettings(encryptSettings.extensionPublicSettings()) - .withProtectedSettings(encryptSettings.extensionProtectedSettings()) - .parent() - .applyAsync(); - } - - /** - * Prepare encryption extension using provided configuration and install it in the virtual machine. - * - * @param encryptSettings the volume encryption configuration - * @return an observable that emits updated virtual machine - */ - private > Mono installEncryptionExtensionAsync( - final EncryptionSettings.Enable encryptSettings) { - return Mono - .defer( - () -> { - final String typeName = EncryptionExtensionIdentifier.typeName(osType); - return virtualMachine - .update() - .defineNewExtension(typeName) - .withPublisher(EncryptionExtensionIdentifier.publisherName()) - .withType(typeName) - .withVersion(encryptSettings.encryptionExtensionVersion()) - .withPublicSettings(encryptSettings.extensionPublicSettings()) - .withProtectedSettings(encryptSettings.extensionProtectedSettings()) - .withMinorVersionAutoUpgrade() - .attach() - .applyAsync(); - }); - } - - /** - * Retrieves the encryption extension status from the extension instance view. An error observable will be returned - * if 1. extension is not installed 2. extension is not provisioned successfully 2. extension status could be - * retrieved (either not found or empty) - * - * @param statusEmptyErrorMessage the error message to emit if unable to locate the status - * @return an observable that emits status message - */ - private Mono retrieveEncryptionExtensionStatusStringAsync(final String statusEmptyErrorMessage) { - final VirtualMachineEncryptionHelper self = this; - return getEncryptionExtensionInstalledInVMAsync() - .switchIfEmpty(self.toErrorMono(ERROR_ENCRYPTION_EXTENSION_NOT_FOUND)) - .flatMap( - extension -> { - if (!extension.provisioningState().equalsIgnoreCase("Succeeded")) { - return self - .toErrorMono( - (String.format(ERROR_NON_SUCCESS_PROVISIONING_STATE, extension.provisioningState()))); - } - return extension.getInstanceViewAsync(); - }) - .flatMap( - instanceView -> { - String extensionStatus = instanceView.statuses().get(0).message(); - if (extensionStatus == null) { - return self.toErrorMono(statusEmptyErrorMessage); - } - return Mono.just(extensionStatus); - }) - .switchIfEmpty(self.toErrorMono(ERROR_EXPECTED_ENCRYPTION_EXTENSION_STATUS_NOT_FOUND)); - } - - /** - * Updates the virtual machine's OS Disk model with the encryption specific details so that platform can use it - * while booting the virtual machine. - * - * @param encryptSettings the configuration specific to enabling the encryption - * @param encryptionSecretKeyVaultUrl the keyVault URL pointing to secret holding disk encryption key - * @return an observable that emits updated virtual machine - */ - private Mono updateVMStorageProfileAsync( - final EncryptionSettings encryptSettings, final String encryptionSecretKeyVaultUrl) { - DiskEncryptionSettings diskEncryptionSettings = encryptSettings.storageProfileEncryptionSettings(); - diskEncryptionSettings.diskEncryptionKey().withSecretUrl(encryptionSecretKeyVaultUrl); - return virtualMachine.update().withOSDiskEncryptionSettings(diskEncryptionSettings).applyAsync(); - } - - /** - * Updates the virtual machine's OS Disk model with the encryption specific details. - * - * @param encryptSettings the configuration specific to disabling the encryption - * @return an observable that emits updated virtual machine - */ - private Mono updateVMStorageProfileAsync(final EncryptionSettings encryptSettings) { - DiskEncryptionSettings diskEncryptionSettings = encryptSettings.storageProfileEncryptionSettings(); - return virtualMachine.update().withOSDiskEncryptionSettings(diskEncryptionSettings).applyAsync(); - } - - /** - * Wraps the given message in an error Mono. - * - * @param message the error message - * @param Mono type - * @return error Mono with message wrapped - */ - private Mono toErrorMono(String message) { - return Mono.error(new Exception(message)); - } - - private static class VMExtTuple { - private final VirtualMachine virtualMachine; - private final VirtualMachineExtension encryptExtension; - // - VMExtTuple(VirtualMachine vm, VirtualMachineExtension ext) { - this.virtualMachine = vm; - this.encryptExtension = ext; - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineEncryptionImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineEncryptionImpl.java deleted file mode 100644 index 5d038ad9ce25..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineEncryptionImpl.java +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.implementation; - -import com.azure.resourcemanager.compute.models.DiskVolumeEncryptionMonitor; -import com.azure.resourcemanager.compute.models.DiskVolumeType; -import com.azure.resourcemanager.compute.models.LinuxVMDiskEncryptionConfiguration; -import com.azure.resourcemanager.compute.models.OperatingSystemTypes; -import com.azure.resourcemanager.compute.models.VirtualMachine; -import com.azure.resourcemanager.compute.models.VirtualMachineEncryption; -import com.azure.resourcemanager.compute.models.WindowsVMDiskEncryptionConfiguration; -import reactor.core.publisher.Mono; - -/** Implementation of VirtualMachineEncryption. */ -class VirtualMachineEncryptionImpl implements VirtualMachineEncryption { - private final VirtualMachine virtualMachine; - private final VirtualMachineEncryptionHelper virtualMachineEncryptionHelper; - - /** - * Creates VirtualMachineEncryptionImpl. - * - * @param virtualMachine virtual machine on which encryption related operations to be performed - */ - VirtualMachineEncryptionImpl(final VirtualMachine virtualMachine) { - this.virtualMachine = virtualMachine; - this.virtualMachineEncryptionHelper = new VirtualMachineEncryptionHelper(virtualMachine); - } - - @Override - public Mono enableAsync(String keyVaultId, String aadClientId, String aadSecret) { - if (this.virtualMachine.osType() == OperatingSystemTypes.LINUX) { - return enableAsync( - new LinuxVMDiskEncryptionConfiguration(keyVaultId, aadClientId, aadSecret, - virtualMachine.manager().environment())); - } else { - return enableAsync( - new WindowsVMDiskEncryptionConfiguration(keyVaultId, aadClientId, aadSecret, - virtualMachine.manager().environment())); - } - } - - @Override - public Mono enableAsync(String keyVaultId) { - if (this.virtualMachine.osType() == OperatingSystemTypes.LINUX) { - return enableAsync( - new LinuxVMDiskEncryptionConfiguration(keyVaultId, virtualMachine.manager().environment())); - } else { - return enableAsync( - new WindowsVMDiskEncryptionConfiguration(keyVaultId, virtualMachine.manager().environment())); - } - } - - @Override - public Mono enableAsync(WindowsVMDiskEncryptionConfiguration encryptionSettings) { - return virtualMachineEncryptionHelper.enableEncryptionAsync(encryptionSettings); - } - - @Override - public Mono enableAsync(LinuxVMDiskEncryptionConfiguration encryptionSettings) { - return virtualMachineEncryptionHelper.enableEncryptionAsync(encryptionSettings); - } - - @Override - public Mono disableAsync(final DiskVolumeType volumeType) { - return virtualMachineEncryptionHelper.disableEncryptionAsync(volumeType); - } - - @Override - public Mono getMonitorAsync() { - return new ProxyEncryptionMonitorImpl(this.virtualMachine).refreshAsync(); - } - - @Override - public DiskVolumeEncryptionMonitor enable(String keyVaultId, String aadClientId, String aadSecret) { - return enableAsync(keyVaultId, aadClientId, aadSecret).block(); - } - - @Override - public DiskVolumeEncryptionMonitor enable(String keyVaultId) { - return enableAsync(keyVaultId).block(); - } - - @Override - public DiskVolumeEncryptionMonitor enable(WindowsVMDiskEncryptionConfiguration encryptionSettings) { - return enableAsync(encryptionSettings).block(); - } - - @Override - public DiskVolumeEncryptionMonitor enable(LinuxVMDiskEncryptionConfiguration encryptionSettings) { - return enableAsync(encryptionSettings).block(); - } - - @Override - public DiskVolumeEncryptionMonitor disable(final DiskVolumeType volumeType) { - return disableAsync(volumeType).block(); - } - - @Override - public DiskVolumeEncryptionMonitor getMonitor() { - return getMonitorAsync().block(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineExtensionImageImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineExtensionImageImpl.java deleted file mode 100644 index 2b599c145b8b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineExtensionImageImpl.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.compute.implementation; - -import com.azure.resourcemanager.compute.models.ComputeRoles; -import com.azure.resourcemanager.compute.models.OperatingSystemTypes; -import com.azure.resourcemanager.compute.models.VirtualMachineExtensionImage; -import com.azure.resourcemanager.compute.models.VirtualMachineExtensionImageVersion; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineExtensionImageInner; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.WrapperImpl; - -/** The implementation for {@link VirtualMachineExtensionImage}. */ -class VirtualMachineExtensionImageImpl extends WrapperImpl - implements VirtualMachineExtensionImage { - private final VirtualMachineExtensionImageVersion version; - - VirtualMachineExtensionImageImpl( - VirtualMachineExtensionImageVersion version, VirtualMachineExtensionImageInner inner) { - super(inner); - this.version = version; - } - - @Override - public String id() { - return this.innerModel().id(); - } - - @Override - public String regionName() { - return this.innerModel().location(); - } - - @Override - public String publisherName() { - return this.version().type().publisher().name(); - } - - @Override - public String typeName() { - return this.version().type().name(); - } - - @Override - public String versionName() { - return this.version().name(); - } - - @Override - public OperatingSystemTypes osType() { - return OperatingSystemTypes.fromString(this.innerModel().operatingSystem()); - } - - @Override - public ComputeRoles computeRole() { - return ComputeRoles.fromString(this.innerModel().computeRole()); - } - - @Override - public String handlerSchema() { - return this.innerModel().handlerSchema(); - } - - @Override - public boolean supportsVirtualMachineScaleSets() { - return this.innerModel().vmScaleSetEnabled(); - } - - @Override - public boolean supportsMultipleExtensions() { - return this.innerModel().supportsMultipleExtensions(); - } - - @Override - public VirtualMachineExtensionImageVersion version() { - return this.version; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineExtensionImageTypeImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineExtensionImageTypeImpl.java deleted file mode 100644 index 5bf8d9519ea1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineExtensionImageTypeImpl.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.compute.implementation; - -import com.azure.resourcemanager.compute.models.VirtualMachineExtensionImageType; -import com.azure.resourcemanager.compute.models.VirtualMachineExtensionImageVersions; -import com.azure.resourcemanager.compute.models.VirtualMachinePublisher; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineExtensionImageInner; -import com.azure.resourcemanager.compute.fluent.VirtualMachineExtensionImagesClient; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.WrapperImpl; - -/** The implementation for VirtualMachineExtensionImageType. */ -class VirtualMachineExtensionImageTypeImpl extends WrapperImpl - implements VirtualMachineExtensionImageType { - private final VirtualMachineExtensionImagesClient client; - private final VirtualMachinePublisher publisher; - - VirtualMachineExtensionImageTypeImpl( - VirtualMachineExtensionImagesClient client, - VirtualMachinePublisher publisher, - VirtualMachineExtensionImageInner inner) { - super(inner); - this.client = client; - this.publisher = publisher; - } - - @Override - public String id() { - return this.innerModel().id(); - } - - @Override - public String name() { - return this.innerModel().name(); - } - - @Override - public String regionName() { - return this.innerModel().location(); - } - - @Override - public VirtualMachinePublisher publisher() { - return this.publisher; - } - - @Override - public VirtualMachineExtensionImageVersions versions() { - return new VirtualMachineExtensionImageVersionsImpl(this.client, this); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineExtensionImageTypesImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineExtensionImageTypesImpl.java deleted file mode 100644 index fcc77eaf0dac..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineExtensionImageTypesImpl.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.compute.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.compute.models.VirtualMachineExtensionImageType; -import com.azure.resourcemanager.compute.models.VirtualMachineExtensionImageTypes; -import com.azure.resourcemanager.compute.models.VirtualMachinePublisher; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineExtensionImageInner; -import com.azure.resourcemanager.compute.fluent.VirtualMachineExtensionImagesClient; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.ReadableWrappersImpl; -import com.azure.resourcemanager.resources.fluentcore.utils.PagedConverter; - -/** The implementation for VirtualMachineExtensionImageTypes. */ -class VirtualMachineExtensionImageTypesImpl - extends ReadableWrappersImpl< - VirtualMachineExtensionImageType, VirtualMachineExtensionImageTypeImpl, VirtualMachineExtensionImageInner> - implements VirtualMachineExtensionImageTypes { - private final VirtualMachineExtensionImagesClient client; - private final VirtualMachinePublisher publisher; - - VirtualMachineExtensionImageTypesImpl( - VirtualMachineExtensionImagesClient client, VirtualMachinePublisher publisher) { - this.client = client; - this.publisher = publisher; - } - - @Override - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - @Override - protected VirtualMachineExtensionImageTypeImpl wrapModel(VirtualMachineExtensionImageInner inner) { - if (inner == null) { - return null; - } - return new VirtualMachineExtensionImageTypeImpl(this.client, this.publisher, inner); - } - - @Override - public PagedFlux listAsync() { - return PagedConverter.mapPage(PagedConverter - .convertListToPagedFlux(client.listTypesWithResponseAsync( - this.publisher.region().toString(), this.publisher.name())), - this::wrapModel); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineExtensionImageVersionImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineExtensionImageVersionImpl.java deleted file mode 100644 index 4650f1dae600..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineExtensionImageVersionImpl.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.compute.implementation; - -import com.azure.resourcemanager.compute.models.VirtualMachineExtensionImage; -import com.azure.resourcemanager.compute.models.VirtualMachineExtensionImageType; -import com.azure.resourcemanager.compute.models.VirtualMachineExtensionImageVersion; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineExtensionImageInner; -import com.azure.resourcemanager.compute.fluent.VirtualMachineExtensionImagesClient; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.WrapperImpl; -import reactor.core.publisher.Mono; - -/** The implementation for VirtualMachineExtensionImageVersion. */ -class VirtualMachineExtensionImageVersionImpl extends WrapperImpl - implements VirtualMachineExtensionImageVersion { - private final VirtualMachineExtensionImagesClient client; - private final VirtualMachineExtensionImageType type; - - VirtualMachineExtensionImageVersionImpl( - VirtualMachineExtensionImagesClient client, - VirtualMachineExtensionImageType extensionImageType, - VirtualMachineExtensionImageInner inner) { - super(inner); - this.client = client; - this.type = extensionImageType; - } - - @Override - public String id() { - return this.innerModel().id(); - } - - @Override - public String name() { - return this.innerModel().name(); - } - - @Override - public String regionName() { - return this.innerModel().location(); - } - - @Override - public VirtualMachineExtensionImageType type() { - return this.type; - } - - @Override - public VirtualMachineExtensionImage getImage() { - VirtualMachineExtensionImageInner inner = - this.client.get(this.regionName(), this.type().publisher().name(), this.type().name(), this.name()); - if (inner == null) { - return null; - } - return new VirtualMachineExtensionImageImpl(this, inner); - } - - @Override - public Mono getImageAsync() { - final VirtualMachineExtensionImageVersionImpl self = this; - return client - .getAsync(regionName(), type().publisher().name(), type().name(), name()) - .map(inner -> new VirtualMachineExtensionImageImpl(self, inner)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineExtensionImageVersionsImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineExtensionImageVersionsImpl.java deleted file mode 100644 index 6043a20784b0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineExtensionImageVersionsImpl.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.compute.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.compute.models.VirtualMachineExtensionImageType; -import com.azure.resourcemanager.compute.models.VirtualMachineExtensionImageVersion; -import com.azure.resourcemanager.compute.models.VirtualMachineExtensionImageVersions; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineExtensionImageInner; -import com.azure.resourcemanager.compute.fluent.VirtualMachineExtensionImagesClient; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.ReadableWrappersImpl; -import com.azure.resourcemanager.resources.fluentcore.utils.PagedConverter; - -/** The implementation for VirtualMachineExtensionImageVersions. */ -public class VirtualMachineExtensionImageVersionsImpl - extends ReadableWrappersImpl< - VirtualMachineExtensionImageVersion, VirtualMachineExtensionImageVersionImpl, VirtualMachineExtensionImageInner> - implements VirtualMachineExtensionImageVersions { - private final VirtualMachineExtensionImagesClient client; - private final VirtualMachineExtensionImageType type; - - VirtualMachineExtensionImageVersionsImpl( - VirtualMachineExtensionImagesClient client, VirtualMachineExtensionImageType type) { - this.client = client; - this.type = type; - } - - @Override - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - @Override - protected VirtualMachineExtensionImageVersionImpl wrapModel(VirtualMachineExtensionImageInner inner) { - if (inner == null) { - return null; - } - return new VirtualMachineExtensionImageVersionImpl(this.client, this.type, inner); - } - - @Override - public PagedFlux listAsync() { - return PagedConverter.mapPage(PagedConverter - .convertListToPagedFlux(client.listVersionsWithResponseAsync( - type.regionName(), type.publisher().name(), type.name(), null, null, null)), - this::wrapModel); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineExtensionImagesClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineExtensionImagesClientImpl.java deleted file mode 100644 index 6c4136bca473..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineExtensionImagesClientImpl.java +++ /dev/null @@ -1,662 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.fluent.VirtualMachineExtensionImagesClient; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineExtensionImageInner; -import java.util.List; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in VirtualMachineExtensionImagesClient. */ -public final class VirtualMachineExtensionImagesClientImpl implements VirtualMachineExtensionImagesClient { - private final ClientLogger logger = new ClientLogger(VirtualMachineExtensionImagesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final VirtualMachineExtensionImagesService service; - - /** The service client containing this operation class. */ - private final ComputeManagementClientImpl client; - - /** - * Initializes an instance of VirtualMachineExtensionImagesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - VirtualMachineExtensionImagesClientImpl(ComputeManagementClientImpl client) { - this.service = - RestProxy - .create( - VirtualMachineExtensionImagesService.class, - client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for ComputeManagementClientVirtualMachineExtensionImages to be used by - * the proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "ComputeManagementCli") - private interface VirtualMachineExtensionImagesService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers" - + "/{publisherName}/artifacttypes/vmextension/types/{type}/versions/{version}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("location") String location, - @PathParam("publisherName") String publisherName, - @PathParam("type") String type, - @PathParam("version") String version, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers" - + "/{publisherName}/artifacttypes/vmextension/types") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> listTypes( - @HostParam("$host") String endpoint, - @PathParam("location") String location, - @PathParam("publisherName") String publisherName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers" - + "/{publisherName}/artifacttypes/vmextension/types/{type}/versions") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> listVersions( - @HostParam("$host") String endpoint, - @PathParam("location") String location, - @PathParam("publisherName") String publisherName, - @PathParam("type") String type, - @QueryParam("$filter") String filter, - @QueryParam("$top") Integer top, - @QueryParam("$orderby") String orderby, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets a virtual machine extension image. - * - * @param location The name of a supported Azure region. - * @param publisherName The publisherName parameter. - * @param type The type parameter. - * @param version The version parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual machine extension image. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String location, String publisherName, String type, String version) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (publisherName == null) { - return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); - } - if (type == null) { - return Mono.error(new IllegalArgumentException("Parameter type is required and cannot be null.")); - } - if (version == null) { - return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - location, - publisherName, - type, - version, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a virtual machine extension image. - * - * @param location The name of a supported Azure region. - * @param publisherName The publisherName parameter. - * @param type The type parameter. - * @param version The version parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual machine extension image. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String location, String publisherName, String type, String version, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (publisherName == null) { - return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); - } - if (type == null) { - return Mono.error(new IllegalArgumentException("Parameter type is required and cannot be null.")); - } - if (version == null) { - return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - location, - publisherName, - type, - version, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets a virtual machine extension image. - * - * @param location The name of a supported Azure region. - * @param publisherName The publisherName parameter. - * @param type The type parameter. - * @param version The version parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual machine extension image. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync( - String location, String publisherName, String type, String version) { - return getWithResponseAsync(location, publisherName, type, version) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a virtual machine extension image. - * - * @param location The name of a supported Azure region. - * @param publisherName The publisherName parameter. - * @param type The type parameter. - * @param version The version parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual machine extension image. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineExtensionImageInner get(String location, String publisherName, String type, String version) { - return getAsync(location, publisherName, type, version).block(); - } - - /** - * Gets a virtual machine extension image. - * - * @param location The name of a supported Azure region. - * @param publisherName The publisherName parameter. - * @param type The type parameter. - * @param version The version parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual machine extension image. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String location, String publisherName, String type, String version, Context context) { - return getWithResponseAsync(location, publisherName, type, version, context).block(); - } - - /** - * Gets a list of virtual machine extension image types. - * - * @param location The name of a supported Azure region. - * @param publisherName The publisherName parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of virtual machine extension image types. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> listTypesWithResponseAsync( - String location, String publisherName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (publisherName == null) { - return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listTypes( - this.client.getEndpoint(), - location, - publisherName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a list of virtual machine extension image types. - * - * @param location The name of a supported Azure region. - * @param publisherName The publisherName parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of virtual machine extension image types. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> listTypesWithResponseAsync( - String location, String publisherName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (publisherName == null) { - return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listTypes( - this.client.getEndpoint(), - location, - publisherName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets a list of virtual machine extension image types. - * - * @param location The name of a supported Azure region. - * @param publisherName The publisherName parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of virtual machine extension image types. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listTypesAsync(String location, String publisherName) { - return listTypesWithResponseAsync(location, publisherName) - .flatMap( - (Response> res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a list of virtual machine extension image types. - * - * @param location The name of a supported Azure region. - * @param publisherName The publisherName parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of virtual machine extension image types. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public List listTypes(String location, String publisherName) { - return listTypesAsync(location, publisherName).block(); - } - - /** - * Gets a list of virtual machine extension image types. - * - * @param location The name of a supported Azure region. - * @param publisherName The publisherName parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of virtual machine extension image types. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response> listTypesWithResponse( - String location, String publisherName, Context context) { - return listTypesWithResponseAsync(location, publisherName, context).block(); - } - - /** - * Gets a list of virtual machine extension image versions. - * - * @param location The name of a supported Azure region. - * @param publisherName The publisherName parameter. - * @param type The type parameter. - * @param filter The filter to apply on the operation. - * @param top The top parameter. - * @param orderby The orderby parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of virtual machine extension image versions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> listVersionsWithResponseAsync( - String location, String publisherName, String type, String filter, Integer top, String orderby) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (publisherName == null) { - return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); - } - if (type == null) { - return Mono.error(new IllegalArgumentException("Parameter type is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listVersions( - this.client.getEndpoint(), - location, - publisherName, - type, - filter, - top, - orderby, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a list of virtual machine extension image versions. - * - * @param location The name of a supported Azure region. - * @param publisherName The publisherName parameter. - * @param type The type parameter. - * @param filter The filter to apply on the operation. - * @param top The top parameter. - * @param orderby The orderby parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of virtual machine extension image versions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> listVersionsWithResponseAsync( - String location, - String publisherName, - String type, - String filter, - Integer top, - String orderby, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (publisherName == null) { - return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); - } - if (type == null) { - return Mono.error(new IllegalArgumentException("Parameter type is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listVersions( - this.client.getEndpoint(), - location, - publisherName, - type, - filter, - top, - orderby, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets a list of virtual machine extension image versions. - * - * @param location The name of a supported Azure region. - * @param publisherName The publisherName parameter. - * @param type The type parameter. - * @param filter The filter to apply on the operation. - * @param top The top parameter. - * @param orderby The orderby parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of virtual machine extension image versions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listVersionsAsync( - String location, String publisherName, String type, String filter, Integer top, String orderby) { - return listVersionsWithResponseAsync(location, publisherName, type, filter, top, orderby) - .flatMap( - (Response> res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a list of virtual machine extension image versions. - * - * @param location The name of a supported Azure region. - * @param publisherName The publisherName parameter. - * @param type The type parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of virtual machine extension image versions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listVersionsAsync( - String location, String publisherName, String type) { - final String filter = null; - final Integer top = null; - final String orderby = null; - return listVersionsWithResponseAsync(location, publisherName, type, filter, top, orderby) - .flatMap( - (Response> res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a list of virtual machine extension image versions. - * - * @param location The name of a supported Azure region. - * @param publisherName The publisherName parameter. - * @param type The type parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of virtual machine extension image versions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public List listVersions(String location, String publisherName, String type) { - final String filter = null; - final Integer top = null; - final String orderby = null; - return listVersionsAsync(location, publisherName, type, filter, top, orderby).block(); - } - - /** - * Gets a list of virtual machine extension image versions. - * - * @param location The name of a supported Azure region. - * @param publisherName The publisherName parameter. - * @param type The type parameter. - * @param filter The filter to apply on the operation. - * @param top The top parameter. - * @param orderby The orderby parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of virtual machine extension image versions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response> listVersionsWithResponse( - String location, - String publisherName, - String type, - String filter, - Integer top, - String orderby, - Context context) { - return listVersionsWithResponseAsync(location, publisherName, type, filter, top, orderby, context).block(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineExtensionImagesImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineExtensionImagesImpl.java deleted file mode 100644 index f99a977a1a6e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineExtensionImagesImpl.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.compute.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.exception.ManagementException; -import com.azure.resourcemanager.compute.models.VirtualMachineExtensionImage; -import com.azure.resourcemanager.compute.models.VirtualMachineExtensionImageVersion; -import com.azure.resourcemanager.compute.models.VirtualMachineExtensionImages; -import com.azure.resourcemanager.compute.models.VirtualMachinePublishers; -import com.azure.core.management.Region; -import com.azure.resourcemanager.resources.fluentcore.utils.PagedConverter; -import reactor.core.publisher.Flux; - -/** The implementation for {@link VirtualMachineExtensionImages}. */ -public class VirtualMachineExtensionImagesImpl implements VirtualMachineExtensionImages { - private final VirtualMachinePublishers publishers; - - public VirtualMachineExtensionImagesImpl(VirtualMachinePublishers publishers) { - this.publishers = publishers; - } - - @Override - public PagedIterable listByRegion(Region region) { - return listByRegion(region.toString()); - } - - @Override - public PagedIterable listByRegion(String regionName) { - return new PagedIterable<>(listByRegionAsync(regionName)); - } - - @Override - public PagedFlux listByRegionAsync(Region region) { - return listByRegionAsync(region.name()); - } - - @Override - public PagedFlux listByRegionAsync(String regionName) { - return PagedConverter - .flatMapPage( - publishers.listByRegionAsync(regionName), - virtualMachinePublisher -> - virtualMachinePublisher - .extensionTypes() - .listAsync() - .onErrorResume( - ManagementException.class, - e -> e.getResponse().getStatusCode() == 404 ? Flux.empty() : Flux.error(e)) - .flatMap( - virtualMachineExtensionImageType -> virtualMachineExtensionImageType.versions().listAsync()) - .flatMap(VirtualMachineExtensionImageVersion::getImageAsync)); - } - - @Override - public VirtualMachinePublishers publishers() { - return this.publishers; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineExtensionImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineExtensionImpl.java deleted file mode 100644 index a84339ac414b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineExtensionImpl.java +++ /dev/null @@ -1,315 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.compute.implementation; - -import com.azure.resourcemanager.compute.models.VirtualMachine; -import com.azure.resourcemanager.compute.models.VirtualMachineExtension; -import com.azure.resourcemanager.compute.models.VirtualMachineExtensionImage; -import com.azure.resourcemanager.compute.models.VirtualMachineExtensionInstanceView; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineExtensionInner; -import com.azure.resourcemanager.compute.fluent.VirtualMachineExtensionsClient; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils; -import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.ExternalChildResourceImpl; -import java.util.Collections; -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.TreeMap; -import reactor.core.publisher.Mono; - -/** Implementation of VirtualMachineExtension. */ -class VirtualMachineExtensionImpl - extends ExternalChildResourceImpl< - VirtualMachineExtension, VirtualMachineExtensionInner, VirtualMachineImpl, VirtualMachine> - implements VirtualMachineExtension, - VirtualMachineExtension.Definition, - VirtualMachineExtension.UpdateDefinition, - VirtualMachineExtension.Update { - private final VirtualMachineExtensionsClient client; - private HashMap publicSettings; - private HashMap protectedSettings; - - VirtualMachineExtensionImpl( - String name, - VirtualMachineImpl parent, - VirtualMachineExtensionInner inner, - VirtualMachineExtensionsClient client) { - super(name, parent, inner); - this.client = client; - initializeSettings(); - } - - protected static VirtualMachineExtensionImpl newVirtualMachineExtension( - String name, VirtualMachineImpl parent, VirtualMachineExtensionsClient client) { - VirtualMachineExtensionInner inner = new VirtualMachineExtensionInner(); - inner.withLocation(parent.regionName()); - VirtualMachineExtensionImpl extension = new VirtualMachineExtensionImpl(name, parent, inner, client); - return extension; - } - - @Override - public String id() { - return this.innerModel().id(); - } - - @Override - public String publisherName() { - return this.innerModel().publisher(); - } - - @Override - public String typeName() { - return this.innerModel().typePropertiesType(); - } - - @Override - public String versionName() { - return this.innerModel().typeHandlerVersion(); - } - - @Override - public boolean autoUpgradeMinorVersionEnabled() { - return this.innerModel().autoUpgradeMinorVersion(); - } - - @Override - public Map publicSettings() { - return Collections.unmodifiableMap(this.publicSettings); - } - - @Override - public String publicSettingsAsJsonString() { - return null; - } - - @Override - public VirtualMachineExtensionInstanceView getInstanceView() { - return getInstanceViewAsync().block(); - } - - @Override - public Mono getInstanceViewAsync() { - return this - .client - .getAsync(this.parent().resourceGroupName(), this.parent().name(), this.name(), "instanceView") - .map(inner -> inner.instanceView()); - } - - @Override - public Map tags() { - Map tags = this.innerModel().tags(); - if (tags == null) { - tags = new TreeMap<>(); - } - return Collections.unmodifiableMap(tags); - } - - @Override - public String provisioningState() { - return this.innerModel().provisioningState(); - } - - @Override - public VirtualMachineExtensionImpl withMinorVersionAutoUpgrade() { - this.innerModel().withAutoUpgradeMinorVersion(true); - return this; - } - - @Override - public VirtualMachineExtensionImpl withoutMinorVersionAutoUpgrade() { - this.innerModel().withAutoUpgradeMinorVersion(false); - return this; - } - - @Override - public VirtualMachineExtensionImpl withImage(VirtualMachineExtensionImage image) { - this - .innerModel() - .withPublisher(image.publisherName()) - .withTypePropertiesType(image.typeName()) - .withTypeHandlerVersion(image.versionName()); - return this; - } - - @Override - public VirtualMachineExtensionImpl withPublisher(String extensionImagePublisherName) { - this.innerModel().withPublisher(extensionImagePublisherName); - return this; - } - - @Override - public VirtualMachineExtensionImpl withPublicSetting(String key, Object value) { - this.publicSettings.put(key, value); - return this; - } - - @Override - public VirtualMachineExtensionImpl withProtectedSetting(String key, Object value) { - this.protectedSettings.put(key, value); - return this; - } - - @Override - public VirtualMachineExtensionImpl withPublicSettings(HashMap settings) { - this.publicSettings.clear(); - this.publicSettings.putAll(settings); - return this; - } - - @Override - public VirtualMachineExtensionImpl withProtectedSettings(HashMap settings) { - this.protectedSettings.clear(); - this.protectedSettings.putAll(settings); - return this; - } - - @Override - public VirtualMachineExtensionImpl withType(String extensionImageTypeName) { - this.innerModel().withTypePropertiesType(extensionImageTypeName); - return this; - } - - @Override - public VirtualMachineExtensionImpl withVersion(String extensionImageVersionName) { - this.innerModel().withTypeHandlerVersion(extensionImageVersionName); - return this; - } - - @Override - public final VirtualMachineExtensionImpl withTags(Map tags) { - this.innerModel().withTags(new HashMap<>(tags)); - return this; - } - - @Override - public final VirtualMachineExtensionImpl withTag(String key, String value) { - if (this.innerModel().tags() == null) { - this.innerModel().withTags(new HashMap<>()); - } - this.innerModel().tags().put(key, value); - return this; - } - - @Override - public final VirtualMachineExtensionImpl withoutTag(String key) { - if (this.innerModel().tags() != null) { - this.innerModel().tags().remove(key); - } - return this; - } - - @Override - public VirtualMachineImpl attach() { - this.nullifySettingsIfEmpty(); - return this.parent().withExtension(this); - } - - @Override - protected Mono getInnerAsync() { - String name; - if (this.isReference()) { - name = ResourceUtils.nameFromResourceId(this.innerModel().id()); - } else { - name = this.innerModel().name(); - } - return this.client.getAsync(this.parent().resourceGroupName(), this.parent().name(), name); - } - - // Implementation of ExternalChildResourceImpl createAsyncStreaming, updateAsync and deleteAsync - @Override - public Mono createResourceAsync() { - final VirtualMachineExtensionImpl self = this; - return this - .client - .createOrUpdateAsync( - this.parent().resourceGroupName(), this.parent().name(), this.name(), this.innerModel()) - .map( - inner -> { - self.setInner(inner); - self.initializeSettings(); - return self; - }); - } - - @Override - @SuppressWarnings("unchecked") - public Mono updateResourceAsync() { - this.nullifySettingsIfEmpty(); - if (this.isReference()) { - String extensionName = ResourceUtils.nameFromResourceId(this.innerModel().id()); - return this - .client - .getAsync(this.parent().resourceGroupName(), this.parent().name(), extensionName) - .flatMap( - resource -> { - innerModel() - .withPublisher(resource.publisher()) - .withTypePropertiesType(resource.typePropertiesType()) - .withTypeHandlerVersion(resource.typeHandlerVersion()); - if (innerModel().autoUpgradeMinorVersion() == null) { - innerModel().withAutoUpgradeMinorVersion(resource.autoUpgradeMinorVersion()); - } - LinkedHashMap publicSettings = - (LinkedHashMap) resource.settings(); - if (publicSettings != null && publicSettings.size() > 0) { - LinkedHashMap innerPublicSettings = - (LinkedHashMap) innerModel().settings(); - if (innerPublicSettings == null) { - innerModel().withSettings(new LinkedHashMap()); - innerPublicSettings = (LinkedHashMap) innerModel().settings(); - } - for (Map.Entry entry : publicSettings.entrySet()) { - if (!innerPublicSettings.containsKey(entry.getKey())) { - innerPublicSettings.put(entry.getKey(), entry.getValue()); - } - } - } - return createResourceAsync(); - }); - } else { - return this.createResourceAsync(); - } - } - - @Override - public Mono deleteResourceAsync() { - return this.client.deleteAsync(this.parent().resourceGroupName(), this.parent().name(), this.name()); - } - - /** - * @return true if this is just a reference to the extension. - *

An extension will present as a reference when the parent virtual machine was fetched using VM list, a GET - * on a specific VM will return fully expanded extension details. - */ - public boolean isReference() { - return this.innerModel().name() == null; - } - - // Helper methods - // - private void nullifySettingsIfEmpty() { - if (this.publicSettings.size() == 0) { - this.innerModel().withSettings(null); - } - if (this.protectedSettings.size() == 0) { - this.innerModel().withProtectedSettings(null); - } - } - - @SuppressWarnings("unchecked") - private void initializeSettings() { - if (this.innerModel().settings() == null) { - this.publicSettings = new LinkedHashMap<>(); - this.innerModel().withSettings(this.publicSettings); - } else { - this.publicSettings = (LinkedHashMap) this.innerModel().settings(); - } - - if (this.innerModel().protectedSettings() == null) { - this.protectedSettings = new LinkedHashMap<>(); - this.innerModel().withProtectedSettings(this.protectedSettings); - } else { - this.protectedSettings = (LinkedHashMap) this.innerModel().protectedSettings(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineExtensionsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineExtensionsClientImpl.java deleted file mode 100644 index 4130a75f5a58..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineExtensionsClientImpl.java +++ /dev/null @@ -1,1448 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.compute.fluent.VirtualMachineExtensionsClient; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineExtensionInner; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineExtensionsListResultInner; -import com.azure.resourcemanager.compute.models.VirtualMachineExtensionUpdate; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in VirtualMachineExtensionsClient. */ -public final class VirtualMachineExtensionsClientImpl implements VirtualMachineExtensionsClient { - private final ClientLogger logger = new ClientLogger(VirtualMachineExtensionsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final VirtualMachineExtensionsService service; - - /** The service client containing this operation class. */ - private final ComputeManagementClientImpl client; - - /** - * Initializes an instance of VirtualMachineExtensionsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - VirtualMachineExtensionsClientImpl(ComputeManagementClientImpl client) { - this.service = - RestProxy - .create(VirtualMachineExtensionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for ComputeManagementClientVirtualMachineExtensions to be used by the - * proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "ComputeManagementCli") - private interface VirtualMachineExtensionsService { - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachines/{vmName}/extensions/{vmExtensionName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmName") String vmName, - @PathParam("vmExtensionName") String vmExtensionName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VirtualMachineExtensionInner extensionParameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachines/{vmName}/extensions/{vmExtensionName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmName") String vmName, - @PathParam("vmExtensionName") String vmExtensionName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VirtualMachineExtensionUpdate extensionParameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachines/{vmName}/extensions/{vmExtensionName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmName") String vmName, - @PathParam("vmExtensionName") String vmExtensionName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachines/{vmName}/extensions/{vmExtensionName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmName") String vmName, - @PathParam("vmExtensionName") String vmExtensionName, - @QueryParam("$expand") String expand, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachines/{vmName}/extensions") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmName") String vmName, - @QueryParam("$expand") String expand, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * The operation to create or update the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be created or updated. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Create Virtual Machine Extension operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String vmName, - String vmExtensionName, - VirtualMachineExtensionInner extensionParameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (vmExtensionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter vmExtensionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (extensionParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter extensionParameters is required and cannot be null.")); - } else { - extensionParameters.validate(); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - vmName, - vmExtensionName, - apiVersion, - this.client.getSubscriptionId(), - extensionParameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * The operation to create or update the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be created or updated. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Create Virtual Machine Extension operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String vmName, - String vmExtensionName, - VirtualMachineExtensionInner extensionParameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (vmExtensionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter vmExtensionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (extensionParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter extensionParameters is required and cannot be null.")); - } else { - extensionParameters.validate(); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - vmName, - vmExtensionName, - apiVersion, - this.client.getSubscriptionId(), - extensionParameters, - accept, - context); - } - - /** - * The operation to create or update the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be created or updated. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Create Virtual Machine Extension operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, VirtualMachineExtensionInner> beginCreateOrUpdateAsync( - String resourceGroupName, - String vmName, - String vmExtensionName, - VirtualMachineExtensionInner extensionParameters) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VirtualMachineExtensionInner.class, - VirtualMachineExtensionInner.class, - Context.NONE); - } - - /** - * The operation to create or update the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be created or updated. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Create Virtual Machine Extension operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, VirtualMachineExtensionInner> beginCreateOrUpdateAsync( - String resourceGroupName, - String vmName, - String vmExtensionName, - VirtualMachineExtensionInner extensionParameters, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VirtualMachineExtensionInner.class, - VirtualMachineExtensionInner.class, - context); - } - - /** - * The operation to create or update the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be created or updated. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Create Virtual Machine Extension operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VirtualMachineExtensionInner> beginCreateOrUpdate( - String resourceGroupName, - String vmName, - String vmExtensionName, - VirtualMachineExtensionInner extensionParameters) { - return beginCreateOrUpdateAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters) - .getSyncPoller(); - } - - /** - * The operation to create or update the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be created or updated. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Create Virtual Machine Extension operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VirtualMachineExtensionInner> beginCreateOrUpdate( - String resourceGroupName, - String vmName, - String vmExtensionName, - VirtualMachineExtensionInner extensionParameters, - Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters, context) - .getSyncPoller(); - } - - /** - * The operation to create or update the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be created or updated. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Create Virtual Machine Extension operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, - String vmName, - String vmExtensionName, - VirtualMachineExtensionInner extensionParameters) { - return beginCreateOrUpdateAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * The operation to create or update the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be created or updated. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Create Virtual Machine Extension operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, - String vmName, - String vmExtensionName, - VirtualMachineExtensionInner extensionParameters, - Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * The operation to create or update the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be created or updated. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Create Virtual Machine Extension operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineExtensionInner createOrUpdate( - String resourceGroupName, - String vmName, - String vmExtensionName, - VirtualMachineExtensionInner extensionParameters) { - return createOrUpdateAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters).block(); - } - - /** - * The operation to create or update the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be created or updated. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Create Virtual Machine Extension operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineExtensionInner createOrUpdate( - String resourceGroupName, - String vmName, - String vmExtensionName, - VirtualMachineExtensionInner extensionParameters, - Context context) { - return createOrUpdateAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters, context).block(); - } - - /** - * The operation to update the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be updated. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Update Virtual Machine Extension operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateWithResponseAsync( - String resourceGroupName, - String vmName, - String vmExtensionName, - VirtualMachineExtensionUpdate extensionParameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (vmExtensionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter vmExtensionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (extensionParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter extensionParameters is required and cannot be null.")); - } else { - extensionParameters.validate(); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - resourceGroupName, - vmName, - vmExtensionName, - apiVersion, - this.client.getSubscriptionId(), - extensionParameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * The operation to update the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be updated. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Update Virtual Machine Extension operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, - String vmName, - String vmExtensionName, - VirtualMachineExtensionUpdate extensionParameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (vmExtensionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter vmExtensionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (extensionParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter extensionParameters is required and cannot be null.")); - } else { - extensionParameters.validate(); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - resourceGroupName, - vmName, - vmExtensionName, - apiVersion, - this.client.getSubscriptionId(), - extensionParameters, - accept, - context); - } - - /** - * The operation to update the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be updated. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Update Virtual Machine Extension operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, VirtualMachineExtensionInner> beginUpdateAsync( - String resourceGroupName, - String vmName, - String vmExtensionName, - VirtualMachineExtensionUpdate extensionParameters) { - Mono>> mono = - updateWithResponseAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VirtualMachineExtensionInner.class, - VirtualMachineExtensionInner.class, - Context.NONE); - } - - /** - * The operation to update the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be updated. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Update Virtual Machine Extension operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, VirtualMachineExtensionInner> beginUpdateAsync( - String resourceGroupName, - String vmName, - String vmExtensionName, - VirtualMachineExtensionUpdate extensionParameters, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - updateWithResponseAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VirtualMachineExtensionInner.class, - VirtualMachineExtensionInner.class, - context); - } - - /** - * The operation to update the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be updated. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Update Virtual Machine Extension operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VirtualMachineExtensionInner> beginUpdate( - String resourceGroupName, - String vmName, - String vmExtensionName, - VirtualMachineExtensionUpdate extensionParameters) { - return beginUpdateAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters).getSyncPoller(); - } - - /** - * The operation to update the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be updated. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Update Virtual Machine Extension operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VirtualMachineExtensionInner> beginUpdate( - String resourceGroupName, - String vmName, - String vmExtensionName, - VirtualMachineExtensionUpdate extensionParameters, - Context context) { - return beginUpdateAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters, context) - .getSyncPoller(); - } - - /** - * The operation to update the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be updated. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Update Virtual Machine Extension operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync( - String resourceGroupName, - String vmName, - String vmExtensionName, - VirtualMachineExtensionUpdate extensionParameters) { - return beginUpdateAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * The operation to update the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be updated. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Update Virtual Machine Extension operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, - String vmName, - String vmExtensionName, - VirtualMachineExtensionUpdate extensionParameters, - Context context) { - return beginUpdateAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * The operation to update the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be updated. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Update Virtual Machine Extension operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineExtensionInner update( - String resourceGroupName, - String vmName, - String vmExtensionName, - VirtualMachineExtensionUpdate extensionParameters) { - return updateAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters).block(); - } - - /** - * The operation to update the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be updated. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Update Virtual Machine Extension operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineExtensionInner update( - String resourceGroupName, - String vmName, - String vmExtensionName, - VirtualMachineExtensionUpdate extensionParameters, - Context context) { - return updateAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters, context).block(); - } - - /** - * The operation to delete the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be deleted. - * @param vmExtensionName The name of the virtual machine extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync( - String resourceGroupName, String vmName, String vmExtensionName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (vmExtensionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter vmExtensionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - vmName, - vmExtensionName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * The operation to delete the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be deleted. - * @param vmExtensionName The name of the virtual machine extension. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String vmName, String vmExtensionName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (vmExtensionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter vmExtensionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - vmName, - vmExtensionName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * The operation to delete the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be deleted. - * @param vmExtensionName The name of the virtual machine extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String vmName, String vmExtensionName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, vmName, vmExtensionName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * The operation to delete the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be deleted. - * @param vmExtensionName The name of the virtual machine extension. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String vmName, String vmExtensionName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, vmName, vmExtensionName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * The operation to delete the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be deleted. - * @param vmExtensionName The name of the virtual machine extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String vmName, String vmExtensionName) { - return beginDeleteAsync(resourceGroupName, vmName, vmExtensionName).getSyncPoller(); - } - - /** - * The operation to delete the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be deleted. - * @param vmExtensionName The name of the virtual machine extension. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String vmName, String vmExtensionName, Context context) { - return beginDeleteAsync(resourceGroupName, vmName, vmExtensionName, context).getSyncPoller(); - } - - /** - * The operation to delete the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be deleted. - * @param vmExtensionName The name of the virtual machine extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String vmName, String vmExtensionName) { - return beginDeleteAsync(resourceGroupName, vmName, vmExtensionName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * The operation to delete the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be deleted. - * @param vmExtensionName The name of the virtual machine extension. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String vmName, String vmExtensionName, Context context) { - return beginDeleteAsync(resourceGroupName, vmName, vmExtensionName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * The operation to delete the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be deleted. - * @param vmExtensionName The name of the virtual machine extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String vmName, String vmExtensionName) { - deleteAsync(resourceGroupName, vmName, vmExtensionName).block(); - } - - /** - * The operation to delete the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be deleted. - * @param vmExtensionName The name of the virtual machine extension. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String vmName, String vmExtensionName, Context context) { - deleteAsync(resourceGroupName, vmName, vmExtensionName, context).block(); - } - - /** - * The operation to get the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine containing the extension. - * @param vmExtensionName The name of the virtual machine extension. - * @param expand The expand expression to apply on the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String resourceGroupName, String vmName, String vmExtensionName, String expand) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (vmExtensionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter vmExtensionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - resourceGroupName, - vmName, - vmExtensionName, - expand, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * The operation to get the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine containing the extension. - * @param vmExtensionName The name of the virtual machine extension. - * @param expand The expand expression to apply on the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String vmName, String vmExtensionName, String expand, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (vmExtensionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter vmExtensionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - resourceGroupName, - vmName, - vmExtensionName, - expand, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * The operation to get the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine containing the extension. - * @param vmExtensionName The name of the virtual machine extension. - * @param expand The expand expression to apply on the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync( - String resourceGroupName, String vmName, String vmExtensionName, String expand) { - return getWithResponseAsync(resourceGroupName, vmName, vmExtensionName, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * The operation to get the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine containing the extension. - * @param vmExtensionName The name of the virtual machine extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync( - String resourceGroupName, String vmName, String vmExtensionName) { - final String expand = null; - return getWithResponseAsync(resourceGroupName, vmName, vmExtensionName, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * The operation to get the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine containing the extension. - * @param vmExtensionName The name of the virtual machine extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineExtensionInner get(String resourceGroupName, String vmName, String vmExtensionName) { - final String expand = null; - return getAsync(resourceGroupName, vmName, vmExtensionName, expand).block(); - } - - /** - * The operation to get the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine containing the extension. - * @param vmExtensionName The name of the virtual machine extension. - * @param expand The expand expression to apply on the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String vmName, String vmExtensionName, String expand, Context context) { - return getWithResponseAsync(resourceGroupName, vmName, vmExtensionName, expand, context).block(); - } - - /** - * The operation to get all extensions of a Virtual Machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine containing the extension. - * @param expand The expand expression to apply on the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Extension operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listWithResponseAsync( - String resourceGroupName, String vmName, String expand) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - resourceGroupName, - vmName, - expand, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * The operation to get all extensions of a Virtual Machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine containing the extension. - * @param expand The expand expression to apply on the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Extension operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync( - String resourceGroupName, String vmName, String expand, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - resourceGroupName, - vmName, - expand, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * The operation to get all extensions of a Virtual Machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine containing the extension. - * @param expand The expand expression to apply on the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Extension operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listAsync( - String resourceGroupName, String vmName, String expand) { - return listWithResponseAsync(resourceGroupName, vmName, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * The operation to get all extensions of a Virtual Machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine containing the extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Extension operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listAsync(String resourceGroupName, String vmName) { - final String expand = null; - return listWithResponseAsync(resourceGroupName, vmName, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * The operation to get all extensions of a Virtual Machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine containing the extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Extension operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineExtensionsListResultInner list(String resourceGroupName, String vmName) { - final String expand = null; - return listAsync(resourceGroupName, vmName, expand).block(); - } - - /** - * The operation to get all extensions of a Virtual Machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine containing the extension. - * @param expand The expand expression to apply on the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Extension operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse( - String resourceGroupName, String vmName, String expand, Context context) { - return listWithResponseAsync(resourceGroupName, vmName, expand, context).block(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineExtensionsImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineExtensionsImpl.java deleted file mode 100644 index 406603111bd1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineExtensionsImpl.java +++ /dev/null @@ -1,148 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.compute.implementation; - -import com.azure.resourcemanager.compute.models.VirtualMachine; -import com.azure.resourcemanager.compute.models.VirtualMachineExtension; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineExtensionInner; -import com.azure.resourcemanager.compute.fluent.VirtualMachineExtensionsClient; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.ExternalChildResourcesCachedImpl; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** Represents a extension collection associated with a virtual machine. */ -class VirtualMachineExtensionsImpl - extends ExternalChildResourcesCachedImpl< - VirtualMachineExtensionImpl, - VirtualMachineExtension, - VirtualMachineExtensionInner, - VirtualMachineImpl, - VirtualMachine> { - private final VirtualMachineExtensionsClient client; - - /** - * Creates new VirtualMachineExtensionsImpl. - * - * @param client the client to perform REST calls on extensions - * @param parent the parent virtual machine of the extensions - */ - VirtualMachineExtensionsImpl(VirtualMachineExtensionsClient client, VirtualMachineImpl parent) { - super(parent, parent.taskGroup(), "VirtualMachineExtension"); - this.client = client; - this.cacheCollection(); - } - - /** @return the extension as a map indexed by name. */ - public Map asMap() { - return this.asMapAsync().block(); - } - - /** @return an observable emits extensions in this collection as a map indexed by name. */ - public Mono> asMapAsync() { - return listAsync() - .flatMapMany(Flux::fromIterable) - .collect(Collectors.toMap(extension -> extension.name(), extension -> extension)) - .map(map -> Collections.unmodifiableMap(map)); - } - - /** @return a Mono emits extensions in this collection */ - public Mono> listAsync() { - Flux extensions = Flux.fromIterable(this.collection().values()); - // Resolve reference getExtensions - Flux resolvedExtensionsStream = - extensions - .filter(extension -> extension.isReference()) - .flatMap( - extension -> - client - .getAsync(getParent().resourceGroupName(), getParent().name(), extension.name()) - .map( - extensionInner -> - new VirtualMachineExtensionImpl( - extension.name(), getParent(), extensionInner, client))); - return resolvedExtensionsStream - .concatWith(extensions.filter(extension -> !extension.isReference())) - .collectList() - .map(list -> Collections.unmodifiableList(list)); - } - - /** - * Starts an extension definition chain. - * - * @param name the reference name of the extension to be added - * @return the extension - */ - public VirtualMachineExtensionImpl define(String name) { - VirtualMachineExtensionImpl newExtension = this.prepareInlineDefine(name); - return newExtension; - } - - /** - * Starts an extension update chain. - * - * @param name the reference name of the extension to be updated - * @return the extension - */ - public VirtualMachineExtensionImpl update(String name) { - return this.prepareInlineUpdate(name); - } - - /** - * Mark the extension with given name as to be removed. - * - * @param name the reference name of the extension to be removed - */ - public void remove(String name) { - this.prepareInlineRemove(name); - } - - /** - * Adds the extension to the collection. - * - * @param extension the extension - */ - public void addExtension(VirtualMachineExtensionImpl extension) { - this.addChildResource(extension); - } - - @Override - protected List listChildResources() { - List childResources = new ArrayList<>(); - if (getParent().innerModel().resources() != null) { - for (VirtualMachineExtensionInner inner : getParent().innerModel().resources()) { - if (inner.name() == null) { - // This extension exists in the parent VM extension collection as a reference id. - inner.withLocation(getParent().regionName()); - childResources - .add( - new VirtualMachineExtensionImpl( - ResourceUtils.nameFromResourceId(inner.id()), this.getParent(), inner, this.client)); - } else { - // This extension exists in the parent VM as a fully blown object - childResources - .add(new VirtualMachineExtensionImpl(inner.name(), this.getParent(), inner, this.client)); - } - } - } - return Collections.unmodifiableList(childResources); - } - - @Override - protected Flux listChildResourcesAsync() { - return Flux.fromIterable(listChildResources()); - } - - @Override - protected VirtualMachineExtensionImpl newChildResource(String name) { - VirtualMachineExtensionImpl extension = - VirtualMachineExtensionImpl.newVirtualMachineExtension(name, this.getParent(), this.client); - return extension; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineImageImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineImageImpl.java deleted file mode 100644 index f459caca35d1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineImageImpl.java +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.compute.implementation; - -import com.azure.resourcemanager.compute.models.DataDiskImage; -import com.azure.resourcemanager.compute.models.ImageReference; -import com.azure.resourcemanager.compute.models.OSDiskImage; -import com.azure.resourcemanager.compute.models.PurchasePlan; -import com.azure.resourcemanager.compute.models.VirtualMachineImage; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineImageInner; -import com.azure.core.management.Region; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.IndexableWrapperImpl; -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; - -/** The implementation for {@link VirtualMachineImage}. */ -class VirtualMachineImageImpl extends IndexableWrapperImpl implements VirtualMachineImage { - private final Region location; - private ImageReference imageReference; - - VirtualMachineImageImpl(Region location, String publisher, String offer, String sku, String version) { - super(null); - this.location = location; - this.imageReference = new ImageReference(); - this.imageReference.withPublisher(publisher); - this.imageReference.withOffer(offer); - this.imageReference.withSku(sku); - this.imageReference.withVersion(version); - } - - VirtualMachineImageImpl( - Region location, - String publisher, - String offer, - String sku, - String version, - VirtualMachineImageInner innerModel) { - super(innerModel); - this.location = location; - this.imageReference = new ImageReference(); - this.imageReference.withPublisher(publisher); - this.imageReference.withOffer(offer); - this.imageReference.withSku(sku); - this.imageReference.withVersion(version); - } - - @Override - public String id() { - if (this.innerModel() == null) { - return null; - } - return this.innerModel().id(); - } - - @Override - public Region location() { - return location; - } - - @Override - public String publisherName() { - return imageReference.publisher(); - } - - @Override - public String offer() { - return imageReference.offer(); - } - - @Override - public String sku() { - return imageReference.sku(); - } - - @Override - public String version() { - return imageReference.version(); - } - - @Override - public ImageReference imageReference() { - return imageReference; - } - - @Override - public PurchasePlan plan() { - return innerModel().plan(); - } - - @Override - public OSDiskImage osDiskImage() { - return innerModel().osDiskImage(); - } - - @Override - public Map dataDiskImages() { - if (innerModel().dataDiskImages() == null) { - return Collections.unmodifiableMap(new HashMap<>()); - } - HashMap diskImages = new HashMap<>(); - for (DataDiskImage diskImage : innerModel().dataDiskImages()) { - diskImages.put(diskImage.lun(), diskImage); - } - return Collections.unmodifiableMap(diskImages); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineImagesClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineImagesClientImpl.java deleted file mode 100644 index 10fe75882786..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineImagesClientImpl.java +++ /dev/null @@ -1,1014 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.fluent.VirtualMachineImagesClient; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineImageInner; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineImageResourceInner; -import java.util.List; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in VirtualMachineImagesClient. */ -public final class VirtualMachineImagesClientImpl implements VirtualMachineImagesClient { - private final ClientLogger logger = new ClientLogger(VirtualMachineImagesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final VirtualMachineImagesService service; - - /** The service client containing this operation class. */ - private final ComputeManagementClientImpl client; - - /** - * Initializes an instance of VirtualMachineImagesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - VirtualMachineImagesClientImpl(ComputeManagementClientImpl client) { - this.service = - RestProxy - .create(VirtualMachineImagesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for ComputeManagementClientVirtualMachineImages to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "ComputeManagementCli") - private interface VirtualMachineImagesService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers" - + "/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions/{version}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("location") String location, - @PathParam("publisherName") String publisherName, - @PathParam("offer") String offer, - @PathParam("skus") String skus, - @PathParam("version") String version, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers" - + "/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> list( - @HostParam("$host") String endpoint, - @PathParam("location") String location, - @PathParam("publisherName") String publisherName, - @PathParam("offer") String offer, - @PathParam("skus") String skus, - @QueryParam("$expand") String expand, - @QueryParam("$top") Integer top, - @QueryParam("$orderby") String orderby, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers" - + "/{publisherName}/artifacttypes/vmimage/offers") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> listOffers( - @HostParam("$host") String endpoint, - @PathParam("location") String location, - @PathParam("publisherName") String publisherName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> listPublishers( - @HostParam("$host") String endpoint, - @PathParam("location") String location, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers" - + "/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> listSkus( - @HostParam("$host") String endpoint, - @PathParam("location") String location, - @PathParam("publisherName") String publisherName, - @PathParam("offer") String offer, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets a virtual machine image. - * - * @param location The name of a supported Azure region. - * @param publisherName A valid image publisher. - * @param offer A valid image publisher offer. - * @param skus A valid image SKU. - * @param version A valid image SKU version. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual machine image. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String location, String publisherName, String offer, String skus, String version) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (publisherName == null) { - return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); - } - if (offer == null) { - return Mono.error(new IllegalArgumentException("Parameter offer is required and cannot be null.")); - } - if (skus == null) { - return Mono.error(new IllegalArgumentException("Parameter skus is required and cannot be null.")); - } - if (version == null) { - return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - location, - publisherName, - offer, - skus, - version, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a virtual machine image. - * - * @param location The name of a supported Azure region. - * @param publisherName A valid image publisher. - * @param offer A valid image publisher offer. - * @param skus A valid image SKU. - * @param version A valid image SKU version. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual machine image. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String location, String publisherName, String offer, String skus, String version, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (publisherName == null) { - return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); - } - if (offer == null) { - return Mono.error(new IllegalArgumentException("Parameter offer is required and cannot be null.")); - } - if (skus == null) { - return Mono.error(new IllegalArgumentException("Parameter skus is required and cannot be null.")); - } - if (version == null) { - return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - location, - publisherName, - offer, - skus, - version, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets a virtual machine image. - * - * @param location The name of a supported Azure region. - * @param publisherName A valid image publisher. - * @param offer A valid image publisher offer. - * @param skus A valid image SKU. - * @param version A valid image SKU version. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual machine image. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync( - String location, String publisherName, String offer, String skus, String version) { - return getWithResponseAsync(location, publisherName, offer, skus, version) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a virtual machine image. - * - * @param location The name of a supported Azure region. - * @param publisherName A valid image publisher. - * @param offer A valid image publisher offer. - * @param skus A valid image SKU. - * @param version A valid image SKU version. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual machine image. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineImageInner get( - String location, String publisherName, String offer, String skus, String version) { - return getAsync(location, publisherName, offer, skus, version).block(); - } - - /** - * Gets a virtual machine image. - * - * @param location The name of a supported Azure region. - * @param publisherName A valid image publisher. - * @param offer A valid image publisher offer. - * @param skus A valid image SKU. - * @param version A valid image SKU version. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual machine image. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String location, String publisherName, String offer, String skus, String version, Context context) { - return getWithResponseAsync(location, publisherName, offer, skus, version, context).block(); - } - - /** - * Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. - * - * @param location The name of a supported Azure region. - * @param publisherName A valid image publisher. - * @param offer A valid image publisher offer. - * @param skus A valid image SKU. - * @param expand The expand expression to apply on the operation. - * @param top The top parameter. - * @param orderby The orderby parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> listWithResponseAsync( - String location, String publisherName, String offer, String skus, String expand, Integer top, String orderby) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (publisherName == null) { - return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); - } - if (offer == null) { - return Mono.error(new IllegalArgumentException("Parameter offer is required and cannot be null.")); - } - if (skus == null) { - return Mono.error(new IllegalArgumentException("Parameter skus is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - location, - publisherName, - offer, - skus, - expand, - top, - orderby, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. - * - * @param location The name of a supported Azure region. - * @param publisherName A valid image publisher. - * @param offer A valid image publisher offer. - * @param skus A valid image SKU. - * @param expand The expand expression to apply on the operation. - * @param top The top parameter. - * @param orderby The orderby parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> listWithResponseAsync( - String location, - String publisherName, - String offer, - String skus, - String expand, - Integer top, - String orderby, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (publisherName == null) { - return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); - } - if (offer == null) { - return Mono.error(new IllegalArgumentException("Parameter offer is required and cannot be null.")); - } - if (skus == null) { - return Mono.error(new IllegalArgumentException("Parameter skus is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - location, - publisherName, - offer, - skus, - expand, - top, - orderby, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. - * - * @param location The name of a supported Azure region. - * @param publisherName A valid image publisher. - * @param offer A valid image publisher offer. - * @param skus A valid image SKU. - * @param expand The expand expression to apply on the operation. - * @param top The top parameter. - * @param orderby The orderby parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listAsync( - String location, String publisherName, String offer, String skus, String expand, Integer top, String orderby) { - return listWithResponseAsync(location, publisherName, offer, skus, expand, top, orderby) - .flatMap( - (Response> res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. - * - * @param location The name of a supported Azure region. - * @param publisherName A valid image publisher. - * @param offer A valid image publisher offer. - * @param skus A valid image SKU. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listAsync( - String location, String publisherName, String offer, String skus) { - final String expand = null; - final Integer top = null; - final String orderby = null; - return listWithResponseAsync(location, publisherName, offer, skus, expand, top, orderby) - .flatMap( - (Response> res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. - * - * @param location The name of a supported Azure region. - * @param publisherName A valid image publisher. - * @param offer A valid image publisher offer. - * @param skus A valid image SKU. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public List list( - String location, String publisherName, String offer, String skus) { - final String expand = null; - final Integer top = null; - final String orderby = null; - return listAsync(location, publisherName, offer, skus, expand, top, orderby).block(); - } - - /** - * Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. - * - * @param location The name of a supported Azure region. - * @param publisherName A valid image publisher. - * @param offer A valid image publisher offer. - * @param skus A valid image SKU. - * @param expand The expand expression to apply on the operation. - * @param top The top parameter. - * @param orderby The orderby parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response> listWithResponse( - String location, - String publisherName, - String offer, - String skus, - String expand, - Integer top, - String orderby, - Context context) { - return listWithResponseAsync(location, publisherName, offer, skus, expand, top, orderby, context).block(); - } - - /** - * Gets a list of virtual machine image offers for the specified location and publisher. - * - * @param location The name of a supported Azure region. - * @param publisherName A valid image publisher. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of virtual machine image offers for the specified location and publisher. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> listOffersWithResponseAsync( - String location, String publisherName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (publisherName == null) { - return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listOffers( - this.client.getEndpoint(), - location, - publisherName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a list of virtual machine image offers for the specified location and publisher. - * - * @param location The name of a supported Azure region. - * @param publisherName A valid image publisher. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of virtual machine image offers for the specified location and publisher. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> listOffersWithResponseAsync( - String location, String publisherName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (publisherName == null) { - return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listOffers( - this.client.getEndpoint(), - location, - publisherName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets a list of virtual machine image offers for the specified location and publisher. - * - * @param location The name of a supported Azure region. - * @param publisherName A valid image publisher. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of virtual machine image offers for the specified location and publisher. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listOffersAsync(String location, String publisherName) { - return listOffersWithResponseAsync(location, publisherName) - .flatMap( - (Response> res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a list of virtual machine image offers for the specified location and publisher. - * - * @param location The name of a supported Azure region. - * @param publisherName A valid image publisher. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of virtual machine image offers for the specified location and publisher. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public List listOffers(String location, String publisherName) { - return listOffersAsync(location, publisherName).block(); - } - - /** - * Gets a list of virtual machine image offers for the specified location and publisher. - * - * @param location The name of a supported Azure region. - * @param publisherName A valid image publisher. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of virtual machine image offers for the specified location and publisher. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response> listOffersWithResponse( - String location, String publisherName, Context context) { - return listOffersWithResponseAsync(location, publisherName, context).block(); - } - - /** - * Gets a list of virtual machine image publishers for the specified Azure location. - * - * @param location The name of a supported Azure region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of virtual machine image publishers for the specified Azure location. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> listPublishersWithResponseAsync(String location) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listPublishers( - this.client.getEndpoint(), - location, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a list of virtual machine image publishers for the specified Azure location. - * - * @param location The name of a supported Azure region. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of virtual machine image publishers for the specified Azure location. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> listPublishersWithResponseAsync( - String location, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listPublishers( - this.client.getEndpoint(), location, apiVersion, this.client.getSubscriptionId(), accept, context); - } - - /** - * Gets a list of virtual machine image publishers for the specified Azure location. - * - * @param location The name of a supported Azure region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of virtual machine image publishers for the specified Azure location. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listPublishersAsync(String location) { - return listPublishersWithResponseAsync(location) - .flatMap( - (Response> res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a list of virtual machine image publishers for the specified Azure location. - * - * @param location The name of a supported Azure region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of virtual machine image publishers for the specified Azure location. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public List listPublishers(String location) { - return listPublishersAsync(location).block(); - } - - /** - * Gets a list of virtual machine image publishers for the specified Azure location. - * - * @param location The name of a supported Azure region. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of virtual machine image publishers for the specified Azure location. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response> listPublishersWithResponse( - String location, Context context) { - return listPublishersWithResponseAsync(location, context).block(); - } - - /** - * Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. - * - * @param location The name of a supported Azure region. - * @param publisherName A valid image publisher. - * @param offer A valid image publisher offer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of virtual machine image SKUs for the specified location, publisher, and offer. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> listSkusWithResponseAsync( - String location, String publisherName, String offer) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (publisherName == null) { - return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); - } - if (offer == null) { - return Mono.error(new IllegalArgumentException("Parameter offer is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listSkus( - this.client.getEndpoint(), - location, - publisherName, - offer, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. - * - * @param location The name of a supported Azure region. - * @param publisherName A valid image publisher. - * @param offer A valid image publisher offer. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of virtual machine image SKUs for the specified location, publisher, and offer. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> listSkusWithResponseAsync( - String location, String publisherName, String offer, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (publisherName == null) { - return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); - } - if (offer == null) { - return Mono.error(new IllegalArgumentException("Parameter offer is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listSkus( - this.client.getEndpoint(), - location, - publisherName, - offer, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. - * - * @param location The name of a supported Azure region. - * @param publisherName A valid image publisher. - * @param offer A valid image publisher offer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of virtual machine image SKUs for the specified location, publisher, and offer. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listSkusAsync( - String location, String publisherName, String offer) { - return listSkusWithResponseAsync(location, publisherName, offer) - .flatMap( - (Response> res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. - * - * @param location The name of a supported Azure region. - * @param publisherName A valid image publisher. - * @param offer A valid image publisher offer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of virtual machine image SKUs for the specified location, publisher, and offer. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public List listSkus(String location, String publisherName, String offer) { - return listSkusAsync(location, publisherName, offer).block(); - } - - /** - * Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. - * - * @param location The name of a supported Azure region. - * @param publisherName A valid image publisher. - * @param offer A valid image publisher offer. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of virtual machine image SKUs for the specified location, publisher, and offer. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response> listSkusWithResponse( - String location, String publisherName, String offer, Context context) { - return listSkusWithResponseAsync(location, publisherName, offer, context).block(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineImagesImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineImagesImpl.java deleted file mode 100644 index 85c11c70c88d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineImagesImpl.java +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.compute.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.resourcemanager.compute.models.VirtualMachineImage; -import com.azure.resourcemanager.compute.models.VirtualMachineImages; -import com.azure.resourcemanager.compute.models.VirtualMachinePublishers; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineImageInner; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineImageResourceInner; -import com.azure.resourcemanager.compute.fluent.VirtualMachineImagesClient; -import com.azure.core.management.Region; -import com.azure.resourcemanager.resources.fluentcore.utils.PagedConverter; -import reactor.core.publisher.Flux; - -import java.util.List; - -/** The implementation for {@link VirtualMachineImages}. */ -public class VirtualMachineImagesImpl implements VirtualMachineImages { - private final VirtualMachinePublishers publishers; - private final VirtualMachineImagesClient client; - - public VirtualMachineImagesImpl(VirtualMachinePublishers publishers, VirtualMachineImagesClient client) { - this.publishers = publishers; - this.client = client; - } - - @Override - public VirtualMachineImage getImage( - Region region, String publisherName, String offerName, String skuName, String version) { - if ("latest".equalsIgnoreCase(version)) { - List innerImages = - this.client.listWithResponse(region.name(), publisherName, offerName, skuName, - null, 1, "name desc", Context.NONE).getValue(); - if (innerImages != null && !innerImages.isEmpty()) { - VirtualMachineImageResourceInner innerImageResource = innerImages.get(0); - version = innerImageResource.name(); - } - } - VirtualMachineImageInner innerImage = - this.client.get(region.name(), publisherName, offerName, skuName, version); - return (innerImage != null) - ? new VirtualMachineImageImpl(region, publisherName, offerName, skuName, version, innerImage) - : null; - } - - @Override - public VirtualMachineImage getImage( - String region, String publisherName, String offerName, String skuName, String version) { - if ("latest".equalsIgnoreCase(version)) { - List innerImages = - this.client.listWithResponse(region, publisherName, offerName, skuName, - null, 1, "name desc", Context.NONE).getValue(); - if (innerImages != null && !innerImages.isEmpty()) { - VirtualMachineImageResourceInner innerImageResource = innerImages.get(0); - version = innerImageResource.name(); - } - } - VirtualMachineImageInner innerImage = this.client.get(region, publisherName, offerName, skuName, version); - return (innerImage != null) - ? new VirtualMachineImageImpl( - Region.fromName(region), publisherName, offerName, skuName, version, innerImage) - : null; - } - - @Override - public PagedIterable listByRegion(Region location) { - return listByRegion(location.toString()); - } - - @Override - public PagedIterable listByRegion(String regionName) { - return new PagedIterable<>(listByRegionAsync(regionName)); - } - - @Override - public PagedFlux listByRegionAsync(Region region) { - return listByRegionAsync(region.name()); - } - - @Override - public PagedFlux listByRegionAsync(String regionName) { - return PagedConverter - .flatMapPage( - publishers().listByRegionAsync(regionName), - virtualMachinePublisher -> - virtualMachinePublisher - .offers() - .listAsync() - .onErrorResume( - ManagementException.class, - e -> e.getResponse().getStatusCode() == 404 ? Flux.empty() : Flux.error(e)) - .flatMap(virtualMachineOffer -> virtualMachineOffer.skus().listAsync()) - .flatMap(virtualMachineSku -> virtualMachineSku.images().listAsync())); - } - - @Override - public VirtualMachinePublishers publishers() { - return this.publishers; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineImagesInSkuImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineImagesInSkuImpl.java deleted file mode 100644 index 97a86f75eb85..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineImagesInSkuImpl.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.compute.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineImageResourceInner; -import com.azure.resourcemanager.compute.models.VirtualMachineImage; -import com.azure.resourcemanager.compute.models.VirtualMachineImagesInSku; -import com.azure.resourcemanager.compute.models.VirtualMachineSku; -import com.azure.resourcemanager.compute.fluent.VirtualMachineImagesClient; -import com.azure.resourcemanager.resources.fluentcore.utils.PagedConverter; - -/** The implementation for {@link VirtualMachineImagesInSku}. */ -class VirtualMachineImagesInSkuImpl implements VirtualMachineImagesInSku { - - private final VirtualMachineImagesClient innerCollection; - private final VirtualMachineSku sku; - - VirtualMachineImagesInSkuImpl(VirtualMachineSku sku, VirtualMachineImagesClient innerCollection) { - this.sku = sku; - this.innerCollection = innerCollection; - } - - @Override - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - @Override - public PagedFlux listAsync() { - final VirtualMachineImagesInSkuImpl self = this; - PagedFlux virtualMachineImageResourcePagedFlux - = PagedConverter.convertListToPagedFlux(innerCollection.listWithResponseAsync( - sku.region().toString(), sku.publisher().name(), sku.offer().name(), sku.name(), - null, null, null)); - return PagedConverter.flatMapPage(virtualMachineImageResourcePagedFlux, - resourceInner -> innerCollection - .getAsync( - self.sku.region().toString(), - self.sku.publisher().name(), - self.sku.offer().name(), - self.sku.name(), - resourceInner.name()) - .map( - imageInner -> - (VirtualMachineImage) - new VirtualMachineImageImpl( - self.sku.region(), - self.sku.publisher().name(), - self.sku.offer().name(), - self.sku.name(), - resourceInner.name(), - imageInner))); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineImpl.java deleted file mode 100644 index 4da58eb227b3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineImpl.java +++ /dev/null @@ -1,2802 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.compute.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.SubResource; -import com.azure.core.management.provider.IdentifierProvider; -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.serializer.SerializerAdapter; -import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.resourcemanager.compute.ComputeManager; -import com.azure.resourcemanager.compute.models.AvailabilitySet; -import com.azure.resourcemanager.compute.models.AvailabilitySetSkuTypes; -import com.azure.resourcemanager.compute.models.BillingProfile; -import com.azure.resourcemanager.compute.models.BootDiagnostics; -import com.azure.resourcemanager.compute.models.CachingTypes; -import com.azure.resourcemanager.compute.models.DataDisk; -import com.azure.resourcemanager.compute.models.DiagnosticsProfile; -import com.azure.resourcemanager.compute.models.Disk; -import com.azure.resourcemanager.compute.models.DiskCreateOptionTypes; -import com.azure.resourcemanager.compute.models.DiskEncryptionSettings; -import com.azure.resourcemanager.compute.models.HardwareProfile; -import com.azure.resourcemanager.compute.models.ImageReference; -import com.azure.resourcemanager.compute.models.InstanceViewTypes; -import com.azure.resourcemanager.compute.models.KnownLinuxVirtualMachineImage; -import com.azure.resourcemanager.compute.models.KnownWindowsVirtualMachineImage; -import com.azure.resourcemanager.compute.models.LinuxConfiguration; -import com.azure.resourcemanager.compute.models.ManagedDiskParameters; -import com.azure.resourcemanager.compute.models.NetworkInterfaceReference; -import com.azure.resourcemanager.compute.models.OSDisk; -import com.azure.resourcemanager.compute.models.OSProfile; -import com.azure.resourcemanager.compute.models.OperatingSystemTypes; -import com.azure.resourcemanager.compute.models.Plan; -import com.azure.resourcemanager.compute.models.PowerState; -import com.azure.resourcemanager.compute.models.ProximityPlacementGroup; -import com.azure.resourcemanager.compute.models.ProximityPlacementGroupType; -import com.azure.resourcemanager.compute.models.PurchasePlan; -import com.azure.resourcemanager.compute.models.ResourceIdentityType; -import com.azure.resourcemanager.compute.models.RunCommandInput; -import com.azure.resourcemanager.compute.models.RunCommandInputParameter; -import com.azure.resourcemanager.compute.models.RunCommandResult; -import com.azure.resourcemanager.compute.models.SshConfiguration; -import com.azure.resourcemanager.compute.models.SshPublicKey; -import com.azure.resourcemanager.compute.models.StorageAccountTypes; -import com.azure.resourcemanager.compute.models.StorageProfile; -import com.azure.resourcemanager.compute.models.VirtualHardDisk; -import com.azure.resourcemanager.compute.models.VirtualMachine; -import com.azure.resourcemanager.compute.models.VirtualMachineCaptureParameters; -import com.azure.resourcemanager.compute.models.VirtualMachineDataDisk; -import com.azure.resourcemanager.compute.models.VirtualMachineEncryption; -import com.azure.resourcemanager.compute.models.VirtualMachineEvictionPolicyTypes; -import com.azure.resourcemanager.compute.models.VirtualMachineExtension; -import com.azure.resourcemanager.compute.models.VirtualMachineIdentity; -import com.azure.resourcemanager.compute.models.VirtualMachineInstanceView; -import com.azure.resourcemanager.compute.models.VirtualMachineCustomImage; -import com.azure.resourcemanager.compute.models.VirtualMachinePriorityTypes; -import com.azure.resourcemanager.compute.models.VirtualMachineSize; -import com.azure.resourcemanager.compute.models.VirtualMachineSizeTypes; -import com.azure.resourcemanager.compute.models.VirtualMachineUnmanagedDataDisk; -import com.azure.resourcemanager.compute.models.WinRMConfiguration; -import com.azure.resourcemanager.compute.models.WinRMListener; -import com.azure.resourcemanager.compute.models.WindowsConfiguration; -import com.azure.resourcemanager.compute.fluent.models.ProximityPlacementGroupInner; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineInner; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineUpdateInner; -import com.azure.resourcemanager.authorization.models.BuiltInRole; -import com.azure.resourcemanager.authorization.AuthorizationManager; -import com.azure.resourcemanager.authorization.utils.RoleAssignmentHelper; -import com.azure.resourcemanager.msi.models.Identity; -import com.azure.resourcemanager.network.models.Network; -import com.azure.resourcemanager.network.models.NetworkInterface; -import com.azure.resourcemanager.network.models.PublicIpAddress; -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.resources.fluentcore.arm.AvailabilityZoneId; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceId; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils; -import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.GroupableResourceImpl; -import com.azure.resourcemanager.resources.fluentcore.model.Accepted; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.Indexable; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.AcceptedImpl; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import com.azure.resourcemanager.storage.models.StorageAccount; -import com.azure.resourcemanager.storage.StorageManager; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.introspect.Annotated; -import com.fasterxml.jackson.databind.introspect.JacksonAnnotationIntrospector; -import reactor.core.Exceptions; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -import java.io.IOException; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.UUID; -import java.util.concurrent.Callable; -import com.azure.resourcemanager.resources.fluentcore.utils.PagedConverter; - -/** The implementation for VirtualMachine and its create and update interfaces. */ -class VirtualMachineImpl - extends GroupableResourceImpl - implements VirtualMachine, - VirtualMachine.DefinitionManagedOrUnmanaged, - VirtualMachine.DefinitionManaged, - VirtualMachine.DefinitionUnmanaged, - VirtualMachine.Update, - VirtualMachine.DefinitionStages.WithSystemAssignedIdentityBasedAccessOrCreate, - VirtualMachine.UpdateStages.WithSystemAssignedIdentityBasedAccessOrUpdate { - - private final ClientLogger logger = new ClientLogger(VirtualMachineImpl.class); - - // Clients - private final StorageManager storageManager; - private final NetworkManager networkManager; - private final AuthorizationManager authorizationManager; - - // the name of the virtual machine - private final String vmName; - // used to generate unique name for any dependency resources - private final IdentifierProvider namer; - // unique key of a creatable storage account to be used for virtual machine child resources that - // requires storage [OS disk, data disk, boot diagnostics etc..] - private String creatableStorageAccountKey; - // unique key of a creatable availability set that this virtual machine to put - private String creatableAvailabilitySetKey; - // unique key of a creatable network interface that needs to be used as virtual machine's primary network interface - private String creatablePrimaryNetworkInterfaceKey; - // unique key of a creatable network interfaces that needs to be used as virtual machine's secondary network - // interface - private List creatableSecondaryNetworkInterfaceKeys; - // reference to an existing storage account to be used for virtual machine child resources that - // requires storage [OS disk, data disk, boot diagnostics etc..] - private StorageAccount existingStorageAccountToAssociate; - // reference to an existing availability set that this virtual machine to put - private AvailabilitySet existingAvailabilitySetToAssociate; - // reference to an existing network interface that needs to be used as virtual machine's primary network interface - private NetworkInterface existingPrimaryNetworkInterfaceToAssociate; - // reference to a list of existing network interfaces that needs to be used as virtual machine's secondary network - // interface - private List existingSecondaryNetworkInterfacesToAssociate; - private VirtualMachineInstanceView virtualMachineInstanceView; - private boolean isMarketplaceLinuxImage; - // Intermediate state of network interface definition to which private IP can be associated - private NetworkInterface.DefinitionStages.WithPrimaryPrivateIP nicDefinitionWithPrivateIp; - // Intermediate state of network interface definition to which subnet can be associated - private NetworkInterface.DefinitionStages.WithPrimaryNetworkSubnet nicDefinitionWithSubnet; - // Intermediate state of network interface definition to which public IP can be associated - private NetworkInterface.DefinitionStages.WithCreate nicDefinitionWithCreate; - // The entry point to manage extensions associated with the virtual machine - private VirtualMachineExtensionsImpl virtualMachineExtensions; - // Flag indicates native disk is selected for OS and Data disks - private boolean isUnmanagedDiskSelected; - // Error messages - // The native data disks associated with the virtual machine - private List unmanagedDataDisks; - // To track the managed data disks - private final ManagedDataDiskCollection managedDataDisks; - // To manage boot diagnostics specific operations - private final BootDiagnosticsHandler bootDiagnosticsHandler; - // Utility to setup MSI for the virtual machine - private VirtualMachineMsiHandler virtualMachineMsiHandler; - // Reference to the PublicIp creatable that is implicitly created - private PublicIpAddress.DefinitionStages.WithCreate implicitPipCreatable; - // Name of the new proximity placement group - private String newProximityPlacementGroupName; - // Type fo the new proximity placement group - private ProximityPlacementGroupType newProximityPlacementGroupType; - // To manage OS profile - private boolean removeOsProfile; - - // Snapshot of the updateParameter when update() is called, used to compare whether there is modification to VM during updateResourceAsync - VirtualMachineUpdateInner updateParameterSnapshotOnUpdate; - private static final SerializerAdapter SERIALIZER_ADAPTER = - SerializerFactory.createDefaultManagementSerializerAdapter(); - - private final ObjectMapper mapper; - private static final JacksonAnnotationIntrospector ANNOTATION_INTROSPECTOR = - new JacksonAnnotationIntrospector() { - @Override - public JsonProperty.Access findPropertyAccess(Annotated annotated) { - JsonProperty.Access access = super.findPropertyAccess(annotated); - if (access == JsonProperty.Access.WRITE_ONLY) { - return JsonProperty.Access.AUTO; - } - return access; - } - }; - - VirtualMachineImpl( - String name, - VirtualMachineInner innerModel, - final ComputeManager computeManager, - final StorageManager storageManager, - final NetworkManager networkManager, - final AuthorizationManager authorizationManager) { - super(name, innerModel, computeManager); - this.storageManager = storageManager; - this.networkManager = networkManager; - this.authorizationManager = authorizationManager; - this.vmName = name; - this.isMarketplaceLinuxImage = false; - this.namer = this.manager().resourceManager().internalContext().createIdentifierProvider(this.vmName); - this.creatableSecondaryNetworkInterfaceKeys = new ArrayList<>(); - this.existingSecondaryNetworkInterfacesToAssociate = new ArrayList<>(); - this.virtualMachineExtensions = - new VirtualMachineExtensionsImpl(computeManager.serviceClient().getVirtualMachineExtensions(), this); - - this.managedDataDisks = new ManagedDataDiskCollection(this); - initializeDataDisks(); - this.bootDiagnosticsHandler = new BootDiagnosticsHandler(this); - this.virtualMachineMsiHandler = new VirtualMachineMsiHandler(authorizationManager, this); - this.newProximityPlacementGroupName = null; - this.newProximityPlacementGroupType = null; - - this.mapper = new ObjectMapper(); - this.mapper.setAnnotationIntrospector(ANNOTATION_INTROSPECTOR); - } - - // Verbs - - @Override - public VirtualMachineImpl update() { - updateParameterSnapshotOnUpdate = this.deepCopyInnerToUpdateParameter(); - return super.update(); - }; - - @Override - public Mono refreshAsync() { - return super - .refreshAsync() - .map( - virtualMachine -> { - reset(virtualMachine.innerModel()); - virtualMachineExtensions.refresh(); - return virtualMachine; - }); - } - - @Override - protected Mono getInnerAsync() { - return this - .manager() - .serviceClient() - .getVirtualMachines() - .getByResourceGroupAsync(this.resourceGroupName(), this.name()); - } - - @Override - public void deallocate() { - this.deallocateAsync().block(); - } - - @Override - public Mono deallocateAsync() { - return this - .manager() - .serviceClient() - .getVirtualMachines() - .deallocateAsync(this.resourceGroupName(), this.name()) - // Refresh after deallocate to ensure the inner is updatable (due to a change in behavior in Managed Disks) - .map(aVoid -> this.refreshAsync()) - .then(); - } - - @Override - public void generalize() { - this.generalizeAsync().block(); - } - - @Override - public Mono generalizeAsync() { - return this - .manager() - .serviceClient() - .getVirtualMachines() - .generalizeAsync(this.resourceGroupName(), this.name()); - } - - @Override - public void powerOff() { - this.powerOffAsync().block(); - } - - @Override - public Mono powerOffAsync() { - return this - .manager() - .serviceClient() - .getVirtualMachines() - .powerOffAsync(this.resourceGroupName(), this.name(), null); - } - - @Override - public void restart() { - this.restartAsync().block(); - } - - @Override - public Mono restartAsync() { - return this.manager().serviceClient().getVirtualMachines().restartAsync(this.resourceGroupName(), this.name()); - } - - @Override - public void start() { - this.startAsync().block(); - } - - @Override - public Mono startAsync() { - return this.manager().serviceClient().getVirtualMachines().startAsync(this.resourceGroupName(), this.name()); - } - - @Override - public void redeploy() { - this.redeployAsync().block(); - } - - @Override - public Mono redeployAsync() { - return this.manager().serviceClient().getVirtualMachines().redeployAsync(this.resourceGroupName(), this.name()); - } - - @Override - public void simulateEviction() { - this.simulateEvictionAsync().block(); - } - - @Override - public Mono simulateEvictionAsync() { - return this - .manager() - .serviceClient() - .getVirtualMachines() - .simulateEvictionAsync(this.resourceGroupName(), this.name()); - } - - @Override - public void convertToManaged() { - this - .manager() - .serviceClient() - .getVirtualMachines() - .convertToManagedDisks(this.resourceGroupName(), this.name()); - this.refresh(); - } - - @Override - public Mono convertToManagedAsync() { - return this - .manager() - .serviceClient() - .getVirtualMachines() - .convertToManagedDisksAsync(this.resourceGroupName(), this.name()) - .flatMap(aVoid -> refreshAsync()) - .then(); - } - - @Override - public VirtualMachineEncryption diskEncryption() { - return new VirtualMachineEncryptionImpl(this); - } - - @Override - public PagedIterable availableSizes() { - return PagedConverter.mapPage(this - .manager() - .serviceClient() - .getVirtualMachines() - .listAvailableSizes(this.resourceGroupName(), this.name()), - VirtualMachineSizeImpl::new); - } - - @Override - public String capture(String containerName, String vhdPrefix, boolean overwriteVhd) { - return this.captureAsync(containerName, vhdPrefix, overwriteVhd).block(); - } - - @Override - public Mono captureAsync(String containerName, String vhdPrefix, boolean overwriteVhd) { - VirtualMachineCaptureParameters parameters = new VirtualMachineCaptureParameters(); - parameters.withDestinationContainerName(containerName); - parameters.withOverwriteVhds(overwriteVhd); - parameters.withVhdPrefix(vhdPrefix); - return this - .manager() - .serviceClient() - .getVirtualMachines() - .captureAsync(this.resourceGroupName(), this.name(), parameters) - .map( - captureResultInner -> { - try { - return mapper.writeValueAsString(captureResultInner); - } catch (JsonProcessingException ex) { - throw logger.logExceptionAsError(Exceptions.propagate(ex)); - } - }); - } - - @Override - public VirtualMachineInstanceView refreshInstanceView() { - return refreshInstanceViewAsync().block(); - } - - @Override - public Mono refreshInstanceViewAsync() { - return this - .manager() - .serviceClient() - .getVirtualMachines() - .getByResourceGroupAsync(this.resourceGroupName(), this.name(), InstanceViewTypes.INSTANCE_VIEW) - .map( - inner -> { - virtualMachineInstanceView = new VirtualMachineInstanceViewImpl(inner.instanceView()); - return virtualMachineInstanceView; - }) - .switchIfEmpty( - Mono - .defer( - () -> { - virtualMachineInstanceView = null; - return Mono.empty(); - })); - } - - @Override - public RunCommandResult runPowerShellScript( - List scriptLines, List scriptParameters) { - return this - .manager() - .virtualMachines() - .runPowerShellScript(this.resourceGroupName(), this.name(), scriptLines, scriptParameters); - } - - @Override - public Mono runPowerShellScriptAsync( - List scriptLines, List scriptParameters) { - return this - .manager() - .virtualMachines() - .runPowerShellScriptAsync(this.resourceGroupName(), this.name(), scriptLines, scriptParameters); - } - - @Override - public RunCommandResult runShellScript(List scriptLines, List scriptParameters) { - return this - .manager() - .virtualMachines() - .runShellScript(this.resourceGroupName(), this.name(), scriptLines, scriptParameters); - } - - @Override - public Mono runShellScriptAsync( - List scriptLines, List scriptParameters) { - return this - .manager() - .virtualMachines() - .runShellScriptAsync(this.resourceGroupName(), this.name(), scriptLines, scriptParameters); - } - - @Override - public RunCommandResult runCommand(RunCommandInput inputCommand) { - return this.manager().virtualMachines().runCommand(this.resourceGroupName(), this.name(), inputCommand); - } - - @Override - public Mono runCommandAsync(RunCommandInput inputCommand) { - return this.manager().virtualMachines().runCommandAsync(this.resourceGroupName(), this.name(), inputCommand); - } - - // SETTERS - - // Fluent methods for defining virtual network association for the new primary network interface - @Override - public VirtualMachineImpl withNewPrimaryNetwork(Creatable creatable) { - this.nicDefinitionWithPrivateIp = - this.preparePrimaryNetworkInterface(this.namer.getRandomName("nic", 20)).withNewPrimaryNetwork(creatable); - return this; - } - - @Override - public VirtualMachineImpl withNewPrimaryNetwork(String addressSpace) { - this.nicDefinitionWithPrivateIp = - this - .preparePrimaryNetworkInterface(this.namer.getRandomName("nic", 20)) - .withNewPrimaryNetwork(addressSpace); - return this; - } - - @Override - public VirtualMachineImpl withExistingPrimaryNetwork(Network network) { - this.nicDefinitionWithSubnet = - this - .preparePrimaryNetworkInterface(this.namer.getRandomName("nic", 20)) - .withExistingPrimaryNetwork(network); - return this; - } - - @Override - public VirtualMachineImpl withSubnet(String name) { - this.nicDefinitionWithPrivateIp = this.nicDefinitionWithSubnet.withSubnet(name); - return this; - } - - // Fluent methods for defining private IP association for the new primary network interface - @Override - public VirtualMachineImpl withPrimaryPrivateIPAddressDynamic() { - this.nicDefinitionWithCreate = this.nicDefinitionWithPrivateIp.withPrimaryPrivateIPAddressDynamic(); - return this; - } - - @Override - public VirtualMachineImpl withPrimaryPrivateIPAddressStatic(String staticPrivateIPAddress) { - this.nicDefinitionWithCreate = - this.nicDefinitionWithPrivateIp.withPrimaryPrivateIPAddressStatic(staticPrivateIPAddress); - return this; - } - - // Fluent methods for defining public IP association for the new primary network interface - @Override - public VirtualMachineImpl withNewPrimaryPublicIPAddress(Creatable creatable) { - Creatable nicCreatable = - this.nicDefinitionWithCreate.withNewPrimaryPublicIPAddress(creatable); - this.creatablePrimaryNetworkInterfaceKey = this.addDependency(nicCreatable); - return this; - } - - @Override - public VirtualMachineImpl withNewPrimaryPublicIPAddress(String leafDnsLabel) { - PublicIpAddress.DefinitionStages.WithGroup definitionWithGroup = - this - .networkManager - .publicIpAddresses() - .define(this.namer.getRandomName("pip", 15)) - .withRegion(this.regionName()); - PublicIpAddress.DefinitionStages.WithCreate definitionAfterGroup; - if (this.creatableGroup != null) { - definitionAfterGroup = definitionWithGroup.withNewResourceGroup(this.creatableGroup); - } else { - definitionAfterGroup = definitionWithGroup.withExistingResourceGroup(this.resourceGroupName()); - } - this.implicitPipCreatable = definitionAfterGroup.withLeafDomainLabel(leafDnsLabel); - // Create NIC with creatable PIP - Creatable nicCreatable = - this.nicDefinitionWithCreate.withNewPrimaryPublicIPAddress(this.implicitPipCreatable); - this.creatablePrimaryNetworkInterfaceKey = this.addDependency(nicCreatable); - return this; - } - - @Override - public VirtualMachineImpl withExistingPrimaryPublicIPAddress(PublicIpAddress publicIPAddress) { - Creatable nicCreatable = - this.nicDefinitionWithCreate.withExistingPrimaryPublicIPAddress(publicIPAddress); - this.creatablePrimaryNetworkInterfaceKey = this.addDependency(nicCreatable); - return this; - } - - @Override - public VirtualMachineImpl withoutPrimaryPublicIPAddress() { - Creatable nicCreatable = this.nicDefinitionWithCreate; - this.creatablePrimaryNetworkInterfaceKey = this.addDependency(nicCreatable); - return this; - } - - // Virtual machine primary network interface specific fluent methods - // - @Override - public VirtualMachineImpl withNewPrimaryNetworkInterface(Creatable creatable) { - this.creatablePrimaryNetworkInterfaceKey = this.addDependency(creatable); - return this; - } - - public VirtualMachineImpl withNewPrimaryNetworkInterface(String name, String publicDnsNameLabel) { - Creatable definitionCreatable = - prepareNetworkInterface(name).withNewPrimaryPublicIPAddress(publicDnsNameLabel); - return withNewPrimaryNetworkInterface(definitionCreatable); - } - - @Override - public VirtualMachineImpl withExistingPrimaryNetworkInterface(NetworkInterface networkInterface) { - this.existingPrimaryNetworkInterfaceToAssociate = networkInterface; - return this; - } - - // Virtual machine image specific fluent methods - // - @Override - public VirtualMachineImpl withStoredWindowsImage(String imageUrl) { - VirtualHardDisk userImageVhd = new VirtualHardDisk(); - userImageVhd.withUri(imageUrl); - this.innerModel().storageProfile().osDisk().withCreateOption(DiskCreateOptionTypes.FROM_IMAGE); - this.innerModel().storageProfile().osDisk().withImage(userImageVhd); - // For platform image osType will be null, azure will pick it from the image metadata. - this.innerModel().storageProfile().osDisk().withOsType(OperatingSystemTypes.WINDOWS); - this.innerModel().osProfile().withWindowsConfiguration(new WindowsConfiguration()); - // sets defaults for "Stored(User)Image" or "VM(Platform)Image" - this.innerModel().osProfile().windowsConfiguration().withProvisionVMAgent(true); - this.innerModel().osProfile().windowsConfiguration().withEnableAutomaticUpdates(true); - return this; - } - - @Override - public VirtualMachineImpl withStoredLinuxImage(String imageUrl) { - VirtualHardDisk userImageVhd = new VirtualHardDisk(); - userImageVhd.withUri(imageUrl); - this.innerModel().storageProfile().osDisk().withCreateOption(DiskCreateOptionTypes.FROM_IMAGE); - this.innerModel().storageProfile().osDisk().withImage(userImageVhd); - // For platform | custom image osType will be null, azure will pick it from the image metadata. - // But for stored image, osType needs to be specified explicitly - this.innerModel().storageProfile().osDisk().withOsType(OperatingSystemTypes.LINUX); - this.innerModel().osProfile().withLinuxConfiguration(new LinuxConfiguration()); - return this; - } - - @Override - public VirtualMachineImpl withPopularWindowsImage(KnownWindowsVirtualMachineImage knownImage) { - return withSpecificWindowsImageVersion(knownImage.imageReference()); - } - - @Override - public VirtualMachineImpl withPopularLinuxImage(KnownLinuxVirtualMachineImage knownImage) { - return withSpecificLinuxImageVersion(knownImage.imageReference()); - } - - @Override - public VirtualMachineImpl withSpecificWindowsImageVersion(ImageReference imageReference) { - this.innerModel().storageProfile().osDisk().withCreateOption(DiskCreateOptionTypes.FROM_IMAGE); - this.innerModel().storageProfile().withImageReference(imageReference); - this.innerModel().osProfile().withWindowsConfiguration(new WindowsConfiguration()); - // sets defaults for "Stored(User)Image" or "VM(Platform)Image" - this.innerModel().osProfile().windowsConfiguration().withProvisionVMAgent(true); - this.innerModel().osProfile().windowsConfiguration().withEnableAutomaticUpdates(true); - return this; - } - - @Override - public VirtualMachineImpl withSpecificLinuxImageVersion(ImageReference imageReference) { - this.innerModel().storageProfile().osDisk().withCreateOption(DiskCreateOptionTypes.FROM_IMAGE); - this.innerModel().storageProfile().withImageReference(imageReference); - this.innerModel().osProfile().withLinuxConfiguration(new LinuxConfiguration()); - this.isMarketplaceLinuxImage = true; - return this; - } - - @Override - public VirtualMachineImpl withLatestWindowsImage(String publisher, String offer, String sku) { - ImageReference imageReference = new ImageReference(); - imageReference.withPublisher(publisher); - imageReference.withOffer(offer); - imageReference.withSku(sku); - imageReference.withVersion("latest"); - return withSpecificWindowsImageVersion(imageReference); - } - - @Override - public VirtualMachineImpl withLatestLinuxImage(String publisher, String offer, String sku) { - ImageReference imageReference = new ImageReference(); - imageReference.withPublisher(publisher); - imageReference.withOffer(offer); - imageReference.withSku(sku); - imageReference.withVersion("latest"); - return withSpecificLinuxImageVersion(imageReference); - } - - @Override - public VirtualMachineImpl withGeneralizedWindowsCustomImage(String customImageId) { - ImageReference imageReferenceInner = new ImageReference(); - imageReferenceInner.withId(customImageId); - this.innerModel().storageProfile().osDisk().withCreateOption(DiskCreateOptionTypes.FROM_IMAGE); - this.innerModel().storageProfile().withImageReference(imageReferenceInner); - this.innerModel().osProfile().withWindowsConfiguration(new WindowsConfiguration()); - // sets defaults for "Stored(User)Image", "VM(Platform | Custom | Gallery)Image" - this.innerModel().osProfile().windowsConfiguration().withProvisionVMAgent(true); - this.innerModel().osProfile().windowsConfiguration().withEnableAutomaticUpdates(true); - return this; - } - - @Override - public VirtualMachineImpl withSpecializedWindowsCustomImage(String customImageId) { - this.withGeneralizedWindowsCustomImage(customImageId); - this.removeOsProfile = true; - return this; - } - - @Override - public VirtualMachineImpl withGeneralizedWindowsGalleryImageVersion(String galleryImageVersionId) { - return this.withGeneralizedWindowsCustomImage(galleryImageVersionId); - } - - @Override - public VirtualMachineImpl withSpecializedWindowsGalleryImageVersion(String galleryImageVersionId) { - return this.withSpecializedWindowsCustomImage(galleryImageVersionId); - } - - @Override - public VirtualMachineImpl withGeneralizedLinuxCustomImage(String customImageId) { - ImageReference imageReferenceInner = new ImageReference(); - imageReferenceInner.withId(customImageId); - this.innerModel().storageProfile().osDisk().withCreateOption(DiskCreateOptionTypes.FROM_IMAGE); - this.innerModel().storageProfile().withImageReference(imageReferenceInner); - this.innerModel().osProfile().withLinuxConfiguration(new LinuxConfiguration()); - this.isMarketplaceLinuxImage = true; - return this; - } - - @Override - public VirtualMachineImpl withSpecializedLinuxCustomImage(String customImageId) { - this.withGeneralizedLinuxCustomImage(customImageId); - this.removeOsProfile = true; - return this; - } - - @Override - public VirtualMachineImpl withGeneralizedLinuxGalleryImageVersion(String galleryImageVersionId) { - return this.withGeneralizedLinuxCustomImage(galleryImageVersionId); - } - - @Override - public VirtualMachineImpl withSpecializedLinuxGalleryImageVersion(String galleryImageVersionId) { - return this.withSpecializedLinuxCustomImage(galleryImageVersionId); - } - - @Override - public VirtualMachineImpl withSpecializedOSUnmanagedDisk(String osDiskUrl, OperatingSystemTypes osType) { - VirtualHardDisk osVhd = new VirtualHardDisk(); - osVhd.withUri(osDiskUrl); - this.innerModel().storageProfile().osDisk().withCreateOption(DiskCreateOptionTypes.ATTACH); - this.innerModel().storageProfile().osDisk().withVhd(osVhd); - this.innerModel().storageProfile().osDisk().withOsType(osType); - this.innerModel().storageProfile().osDisk().withManagedDisk(null); - return this; - } - - @Override - public VirtualMachineImpl withSpecializedOSDisk(Disk disk, OperatingSystemTypes osType) { - ManagedDiskParameters diskParametersInner = new ManagedDiskParameters(); - diskParametersInner.withId(disk.id()); - this.innerModel().storageProfile().osDisk().withCreateOption(DiskCreateOptionTypes.ATTACH); - this.innerModel().storageProfile().osDisk().withManagedDisk(diskParametersInner); - this.innerModel().storageProfile().osDisk().withOsType(osType); - this.innerModel().storageProfile().osDisk().withVhd(null); - return this; - } - - // Virtual machine user name fluent methods - @Override - public VirtualMachineImpl withRootUsername(String rootUserName) { - this.innerModel().osProfile().withAdminUsername(rootUserName); - return this; - } - - @Override - public VirtualMachineImpl withAdminUsername(String adminUserName) { - this.innerModel().osProfile().withAdminUsername(adminUserName); - return this; - } - - // Virtual machine optional fluent methods - @Override - public VirtualMachineImpl withSsh(String publicKeyData) { - OSProfile osProfile = this.innerModel().osProfile(); - if (osProfile.linuxConfiguration().ssh() == null) { - SshConfiguration sshConfiguration = new SshConfiguration(); - sshConfiguration.withPublicKeys(new ArrayList()); - osProfile.linuxConfiguration().withSsh(sshConfiguration); - } - SshPublicKey sshPublicKey = new SshPublicKey(); - sshPublicKey.withKeyData(publicKeyData); - sshPublicKey.withPath("/home/" + osProfile.adminUsername() + "/.ssh/authorized_keys"); - osProfile.linuxConfiguration().ssh().publicKeys().add(sshPublicKey); - return this; - } - - @Override - public VirtualMachineImpl withoutVMAgent() { - this.innerModel().osProfile().windowsConfiguration().withProvisionVMAgent(false); - return this; - } - - @Override - public VirtualMachineImpl withoutAutoUpdate() { - this.innerModel().osProfile().windowsConfiguration().withEnableAutomaticUpdates(false); - return this; - } - - @Override - public VirtualMachineImpl withTimeZone(String timeZone) { - this.innerModel().osProfile().windowsConfiguration().withTimeZone(timeZone); - return this; - } - - @Override - public VirtualMachineImpl withWinRM(WinRMListener listener) { - if (this.innerModel().osProfile().windowsConfiguration().winRM() == null) { - WinRMConfiguration winRMConfiguration = new WinRMConfiguration(); - this.innerModel().osProfile().windowsConfiguration().withWinRM(winRMConfiguration); - } - this.innerModel().osProfile().windowsConfiguration().winRM().listeners().add(listener); - return this; - } - - @Override - public VirtualMachineImpl withRootPassword(String password) { - this.innerModel().osProfile().withAdminPassword(password); - return this; - } - - @Override - public VirtualMachineImpl withAdminPassword(String password) { - this.innerModel().osProfile().withAdminPassword(password); - return this; - } - - @Override - public VirtualMachineImpl withCustomData(String base64EncodedCustomData) { - this.innerModel().osProfile().withCustomData(base64EncodedCustomData); - return this; - } - - @Override - public VirtualMachineImpl withComputerName(String computerName) { - this.innerModel().osProfile().withComputerName(computerName); - return this; - } - - @Override - public VirtualMachineImpl withSize(String sizeName) { - this.innerModel().hardwareProfile().withVmSize(VirtualMachineSizeTypes.fromString(sizeName)); - return this; - } - - @Override - public VirtualMachineImpl withSize(VirtualMachineSizeTypes size) { - this.innerModel().hardwareProfile().withVmSize(size); - return this; - } - - @Override - public VirtualMachineImpl withOSDiskCaching(CachingTypes cachingType) { - this.innerModel().storageProfile().osDisk().withCaching(cachingType); - return this; - } - - @Override - public VirtualMachineImpl withOSDiskVhdLocation(String containerName, String vhdName) { - // Sets the native (un-managed) disk backing virtual machine OS disk - if (isManagedDiskEnabled()) { - return this; - } - StorageProfile storageProfile = this.innerModel().storageProfile(); - OSDisk osDisk = storageProfile.osDisk(); - // Setting native (un-managed) disk backing virtual machine OS disk is valid only when - // the virtual machine is created from image. - if (!this.isOSDiskFromImage(osDisk)) { - return this; - } - // Exclude custom user image as they won't support using native (un-managed) disk to back - // virtual machine OS disk. - if (this.isOsDiskFromCustomImage(storageProfile)) { - return this; - } - // OS Disk from 'Platform image' requires explicit storage account to be specified. - if (this.isOSDiskFromPlatformImage(storageProfile)) { - VirtualHardDisk osVhd = new VirtualHardDisk(); - osVhd.withUri(temporaryBlobUrl(containerName, vhdName)); - this.innerModel().storageProfile().osDisk().withVhd(osVhd); - return this; - } - // 'Stored image' and 'Bring your own feature image' has a restriction that the native - // disk backing OS disk based on these images should reside in the same storage account - // as the image. - if (this.isOSDiskFromStoredImage(storageProfile)) { - VirtualHardDisk osVhd = new VirtualHardDisk(); - try { - URL sourceCustomImageUrl = new URL(osDisk.image().uri()); - URL destinationVhdUrl = - new URL( - sourceCustomImageUrl.getProtocol(), - sourceCustomImageUrl.getHost(), - "/" + containerName + "/" + vhdName); - osVhd.withUri(destinationVhdUrl.toString()); - } catch (MalformedURLException ex) { - throw logger.logExceptionAsError(new RuntimeException(ex)); - } - this.innerModel().storageProfile().osDisk().withVhd(osVhd); - } - return this; - } - - @Override - public VirtualMachineImpl withOSDiskStorageAccountType(StorageAccountTypes accountType) { - if (this.innerModel().storageProfile().osDisk().managedDisk() == null) { - this.innerModel().storageProfile().osDisk().withManagedDisk(new ManagedDiskParameters()); - } - this.innerModel().storageProfile().osDisk().managedDisk().withStorageAccountType(accountType); - return this; - } - - @Override - public VirtualMachineImpl withDataDiskDefaultCachingType(CachingTypes cachingType) { - this.managedDataDisks.setDefaultCachingType(cachingType); - return this; - } - - @Override - public VirtualMachineImpl withDataDiskDefaultStorageAccountType(StorageAccountTypes storageAccountType) { - this.managedDataDisks.setDefaultStorageAccountType(storageAccountType); - return this; - } - - @Override - public VirtualMachineImpl withOSDiskEncryptionSettings(DiskEncryptionSettings settings) { - this.innerModel().storageProfile().osDisk().withEncryptionSettings(settings); - return this; - } - - @Override - public VirtualMachineImpl withOSDiskSizeInGB(int size) { - this.innerModel().storageProfile().osDisk().withDiskSizeGB(size); - return this; - } - - @Override - public VirtualMachineImpl withOSDiskName(String name) { - this.innerModel().storageProfile().osDisk().withName(name); - return this; - } - - // Virtual machine optional native data disk fluent methods - @Override - public UnmanagedDataDiskImpl defineUnmanagedDataDisk(String name) { - throwIfManagedDiskEnabled(ManagedUnmanagedDiskErrors.VM_BOTH_MANAGED_AND_UNMANAGED_DISK_NOT_ALLOWED); - return UnmanagedDataDiskImpl.prepareDataDisk(name, this); - } - - @Override - public VirtualMachineImpl withNewUnmanagedDataDisk(Integer sizeInGB) { - throwIfManagedDiskEnabled(ManagedUnmanagedDiskErrors.VM_BOTH_MANAGED_AND_UNMANAGED_DISK_NOT_ALLOWED); - return defineUnmanagedDataDisk(null).withNewVhd(sizeInGB).attach(); - } - - @Override - public VirtualMachineImpl withExistingUnmanagedDataDisk( - String storageAccountName, String containerName, String vhdName) { - throwIfManagedDiskEnabled(ManagedUnmanagedDiskErrors.VM_BOTH_MANAGED_AND_UNMANAGED_DISK_NOT_ALLOWED); - return defineUnmanagedDataDisk(null).withExistingVhd(storageAccountName, containerName, vhdName).attach(); - } - - @Override - public VirtualMachineImpl withoutUnmanagedDataDisk(String name) { - // Its ok not to throw here, since in general 'withoutXX' can be NOP - int idx = -1; - for (VirtualMachineUnmanagedDataDisk dataDisk : this.unmanagedDataDisks) { - idx++; - if (dataDisk.name().equalsIgnoreCase(name)) { - this.unmanagedDataDisks.remove(idx); - this.innerModel().storageProfile().dataDisks().remove(idx); - break; - } - } - return this; - } - - @Override - public VirtualMachineImpl withoutUnmanagedDataDisk(int lun) { - // Its ok not to throw here, since in general 'withoutXX' can be NOP - int idx = -1; - for (VirtualMachineUnmanagedDataDisk dataDisk : this.unmanagedDataDisks) { - idx++; - if (dataDisk.lun() == lun) { - this.unmanagedDataDisks.remove(idx); - this.innerModel().storageProfile().dataDisks().remove(idx); - break; - } - } - return this; - } - - @Override - public UnmanagedDataDiskImpl updateUnmanagedDataDisk(String name) { - throwIfManagedDiskEnabled(ManagedUnmanagedDiskErrors.VM_NO_UNMANAGED_DISK_TO_UPDATE); - for (VirtualMachineUnmanagedDataDisk dataDisk : this.unmanagedDataDisks) { - if (dataDisk.name().equalsIgnoreCase(name)) { - return (UnmanagedDataDiskImpl) dataDisk; - } - } - throw logger.logExceptionAsError(new RuntimeException("A data disk with name '" + name + "' not found")); - } - - // Virtual machine optional managed data disk fluent methods - @Override - public VirtualMachineImpl withNewDataDisk(Creatable creatable) { - throwIfManagedDiskDisabled(ManagedUnmanagedDiskErrors.VM_BOTH_UNMANAGED_AND_MANAGED_DISK_NOT_ALLOWED); - this.managedDataDisks.newDisksToAttach.put(this.addDependency(creatable), new DataDisk().withLun(-1)); - return this; - } - - @Override - public VirtualMachineImpl withNewDataDisk(Creatable creatable, int lun, CachingTypes cachingType) { - throwIfManagedDiskDisabled(ManagedUnmanagedDiskErrors.VM_BOTH_UNMANAGED_AND_MANAGED_DISK_NOT_ALLOWED); - this - .managedDataDisks - .newDisksToAttach - .put(this.addDependency(creatable), new DataDisk().withLun(lun).withCaching(cachingType)); - return this; - } - - @Override - public VirtualMachineImpl withNewDataDisk(int sizeInGB) { - throwIfManagedDiskDisabled(ManagedUnmanagedDiskErrors.VM_BOTH_UNMANAGED_AND_MANAGED_DISK_NOT_ALLOWED); - this.managedDataDisks.implicitDisksToAssociate.add(new DataDisk().withLun(-1).withDiskSizeGB(sizeInGB)); - return this; - } - - @Override - public VirtualMachineImpl withNewDataDisk(int sizeInGB, int lun, CachingTypes cachingType) { - throwIfManagedDiskDisabled(ManagedUnmanagedDiskErrors.VM_BOTH_UNMANAGED_AND_MANAGED_DISK_NOT_ALLOWED); - this - .managedDataDisks - .implicitDisksToAssociate - .add(new DataDisk().withLun(lun).withDiskSizeGB(sizeInGB).withCaching(cachingType)); - return this; - } - - @Override - public VirtualMachineImpl withNewDataDisk( - int sizeInGB, int lun, CachingTypes cachingType, StorageAccountTypes storageAccountType) { - throwIfManagedDiskDisabled(ManagedUnmanagedDiskErrors.VM_BOTH_UNMANAGED_AND_MANAGED_DISK_NOT_ALLOWED); - ManagedDiskParameters managedDiskParameters = new ManagedDiskParameters(); - managedDiskParameters.withStorageAccountType(storageAccountType); - this - .managedDataDisks - .implicitDisksToAssociate - .add( - new DataDisk() - .withLun(lun) - .withDiskSizeGB(sizeInGB) - .withCaching(cachingType) - .withManagedDisk(managedDiskParameters)); - return this; - } - - @Override - public VirtualMachineImpl withExistingDataDisk(Disk disk) { - throwIfManagedDiskDisabled(ManagedUnmanagedDiskErrors.VM_BOTH_UNMANAGED_AND_MANAGED_DISK_NOT_ALLOWED); - ManagedDiskParameters managedDiskParameters = new ManagedDiskParameters(); - managedDiskParameters.withId(disk.id()); - this - .managedDataDisks - .existingDisksToAttach - .add(new DataDisk().withLun(-1).withManagedDisk(managedDiskParameters)); - return this; - } - - @Override - public VirtualMachineImpl withExistingDataDisk(Disk disk, int lun, CachingTypes cachingType) { - throwIfManagedDiskDisabled(ManagedUnmanagedDiskErrors.VM_BOTH_UNMANAGED_AND_MANAGED_DISK_NOT_ALLOWED); - ManagedDiskParameters managedDiskParameters = new ManagedDiskParameters(); - managedDiskParameters.withId(disk.id()); - this - .managedDataDisks - .existingDisksToAttach - .add(new DataDisk().withLun(lun).withManagedDisk(managedDiskParameters).withCaching(cachingType)); - return this; - } - - @Override - public VirtualMachineImpl withExistingDataDisk(Disk disk, int newSizeInGB, int lun, CachingTypes cachingType) { - throwIfManagedDiskDisabled(ManagedUnmanagedDiskErrors.VM_BOTH_UNMANAGED_AND_MANAGED_DISK_NOT_ALLOWED); - ManagedDiskParameters managedDiskParameters = new ManagedDiskParameters(); - managedDiskParameters.withId(disk.id()); - this - .managedDataDisks - .existingDisksToAttach - .add( - new DataDisk() - .withLun(lun) - .withDiskSizeGB(newSizeInGB) - .withManagedDisk(managedDiskParameters) - .withCaching(cachingType)); - return this; - } - - @Override - public VirtualMachineImpl withNewDataDiskFromImage(int imageLun) { - this.managedDataDisks.newDisksFromImage.add(new DataDisk().withLun(imageLun)); - return this; - } - - @Override - public VirtualMachineImpl withNewDataDiskFromImage(int imageLun, int newSizeInGB, CachingTypes cachingType) { - this - .managedDataDisks - .newDisksFromImage - .add(new DataDisk().withLun(imageLun).withDiskSizeGB(newSizeInGB).withCaching(cachingType)); - return this; - } - - @Override - public VirtualMachineImpl withNewDataDiskFromImage( - int imageLun, int newSizeInGB, CachingTypes cachingType, StorageAccountTypes storageAccountType) { - ManagedDiskParameters managedDiskParameters = new ManagedDiskParameters(); - managedDiskParameters.withStorageAccountType(storageAccountType); - this - .managedDataDisks - .newDisksFromImage - .add( - new DataDisk() - .withLun(imageLun) - .withDiskSizeGB(newSizeInGB) - .withManagedDisk(managedDiskParameters) - .withCaching(cachingType)); - return this; - } - - @Override - public VirtualMachineImpl withoutDataDisk(int lun) { - if (!isManagedDiskEnabled()) { - return this; - } - this.managedDataDisks.diskLunsToRemove.add(lun); - return this; - } - - // Virtual machine optional storage account fluent methods - @Override - public VirtualMachineImpl withNewStorageAccount(Creatable creatable) { - // This method's effect is NOT additive. - if (this.creatableStorageAccountKey == null) { - this.creatableStorageAccountKey = this.addDependency(creatable); - } - return this; - } - - @Override - public VirtualMachineImpl withNewStorageAccount(String name) { - StorageAccount.DefinitionStages.WithGroup definitionWithGroup = - this.storageManager.storageAccounts().define(name).withRegion(this.regionName()); - Creatable definitionAfterGroup; - if (this.creatableGroup != null) { - definitionAfterGroup = definitionWithGroup.withNewResourceGroup(this.creatableGroup); - } else { - definitionAfterGroup = definitionWithGroup.withExistingResourceGroup(this.resourceGroupName()); - } - return withNewStorageAccount(definitionAfterGroup); - } - - @Override - public VirtualMachineImpl withExistingStorageAccount(StorageAccount storageAccount) { - this.existingStorageAccountToAssociate = storageAccount; - return this; - } - - // Virtual machine optional availability set fluent methods - @Override - public VirtualMachineImpl withNewAvailabilitySet(Creatable creatable) { - // This method's effect is NOT additive. - if (this.creatableAvailabilitySetKey == null) { - this.creatableAvailabilitySetKey = this.addDependency(creatable); - } - return this; - } - - @Override - public VirtualMachineImpl withProximityPlacementGroup(String proximityPlacementGroupId) { - this.innerModel().withProximityPlacementGroup(new SubResource().withId(proximityPlacementGroupId)); - // clear the new setting - newProximityPlacementGroupName = null; - return this; - } - - @Override - public VirtualMachineImpl withNewProximityPlacementGroup( - String proximityPlacementGroupName, ProximityPlacementGroupType type) { - this.newProximityPlacementGroupName = proximityPlacementGroupName; - this.newProximityPlacementGroupType = type; - this.innerModel().withProximityPlacementGroup(null); - return this; - } - - @Override - public VirtualMachineImpl withoutProximityPlacementGroup() { - this.innerModel().withProximityPlacementGroup(null); - - return this; - } - - @Override - public VirtualMachineImpl withNewAvailabilitySet(String name) { - AvailabilitySet.DefinitionStages.WithGroup definitionWithGroup = - super.myManager.availabilitySets().define(name).withRegion(this.regionName()); - AvailabilitySet.DefinitionStages.WithSku definitionWithSku; - if (this.creatableGroup != null) { - definitionWithSku = definitionWithGroup.withNewResourceGroup(this.creatableGroup); - } else { - definitionWithSku = definitionWithGroup.withExistingResourceGroup(this.resourceGroupName()); - } - Creatable creatable; - if (isManagedDiskEnabled()) { - creatable = definitionWithSku.withSku(AvailabilitySetSkuTypes.ALIGNED); - } else { - creatable = definitionWithSku.withSku(AvailabilitySetSkuTypes.CLASSIC); - } - return withNewAvailabilitySet(creatable); - } - - @Override - public VirtualMachineImpl withExistingAvailabilitySet(AvailabilitySet availabilitySet) { - this.existingAvailabilitySetToAssociate = availabilitySet; - return this; - } - - @Override - public VirtualMachineImpl withNewSecondaryNetworkInterface(Creatable creatable) { - this.creatableSecondaryNetworkInterfaceKeys.add(this.addDependency(creatable)); - return this; - } - - @Override - public VirtualMachineImpl withExistingSecondaryNetworkInterface(NetworkInterface networkInterface) { - this.existingSecondaryNetworkInterfacesToAssociate.add(networkInterface); - return this; - } - - // Virtual machine optional extension settings - @Override - public VirtualMachineExtensionImpl defineNewExtension(String name) { - return this.virtualMachineExtensions.define(name); - } - - @Override - public VirtualMachineImpl withoutSecondaryNetworkInterface(String name) { - if (this.innerModel().networkProfile() != null - && this.innerModel().networkProfile().networkInterfaces() != null) { - int idx = -1; - for (NetworkInterfaceReference nicReference : this.innerModel().networkProfile().networkInterfaces()) { - idx++; - if (!nicReference.primary() - && name.equalsIgnoreCase(ResourceUtils.nameFromResourceId(nicReference.id()))) { - this.innerModel().networkProfile().networkInterfaces().remove(idx); - break; - } - } - } - return this; - } - - @Override - public VirtualMachineExtensionImpl updateExtension(String name) { - return this.virtualMachineExtensions.update(name); - } - - @Override - public VirtualMachineImpl withoutExtension(String name) { - this.virtualMachineExtensions.remove(name); - return this; - } - - @Override - public VirtualMachineImpl withPlan(PurchasePlan plan) { - this.innerModel().withPlan(new Plan()); - this.innerModel().plan().withPublisher(plan.publisher()).withProduct(plan.product()).withName(plan.name()); - return this; - } - - @Override - public VirtualMachineImpl withPromotionalPlan(PurchasePlan plan, String promotionCode) { - this.withPlan(plan); - this.innerModel().plan().withPromotionCode(promotionCode); - return this; - } - - @Override - public VirtualMachineImpl withUnmanagedDisks() { - this.isUnmanagedDiskSelected = true; - return this; - } - - @Override - public VirtualMachineImpl withBootDiagnosticsOnManagedStorageAccount() { - this.bootDiagnosticsHandler.withBootDiagnostics(true); - return this; - } - - @Override - public VirtualMachineImpl withBootDiagnostics() { - this.bootDiagnosticsHandler.withBootDiagnostics(false); - return this; - } - - @Override - public VirtualMachineImpl withBootDiagnostics(Creatable creatable) { - this.bootDiagnosticsHandler.withBootDiagnostics(creatable); - return this; - } - - @Override - public VirtualMachineImpl withBootDiagnostics(String storageAccountBlobEndpointUri) { - this.bootDiagnosticsHandler.withBootDiagnostics(storageAccountBlobEndpointUri); - return this; - } - - @Override - public VirtualMachineImpl withBootDiagnostics(StorageAccount storageAccount) { - this.bootDiagnosticsHandler.withBootDiagnostics(storageAccount); - return this; - } - - @Override - public VirtualMachineImpl withoutBootDiagnostics() { - this.bootDiagnosticsHandler.withoutBootDiagnostics(); - return this; - } - - @Override - public VirtualMachineImpl withPriority(VirtualMachinePriorityTypes priority) { - this.innerModel().withPriority(priority); - return this; - } - - @Override - public VirtualMachineImpl withLowPriority() { - this.withPriority(VirtualMachinePriorityTypes.LOW); - return this; - } - - @Override - public VirtualMachineImpl withLowPriority(VirtualMachineEvictionPolicyTypes policy) { - this.withLowPriority(); - this.innerModel().withEvictionPolicy(policy); - return this; - } - - @Override - public VirtualMachineImpl withSpotPriority() { - this.withPriority(VirtualMachinePriorityTypes.SPOT); - return this; - } - - @Override - public VirtualMachineImpl withSpotPriority(VirtualMachineEvictionPolicyTypes policy) { - this.withSpotPriority(); - this.innerModel().withEvictionPolicy(policy); - return this; - } - - @Override - public VirtualMachineImpl withMaxPrice(Double maxPrice) { - this.innerModel().withBillingProfile(new BillingProfile().withMaxPrice(maxPrice)); - return this; - } - - @Override - public VirtualMachineImpl withSystemAssignedManagedServiceIdentity() { - this.virtualMachineMsiHandler.withLocalManagedServiceIdentity(); - return this; - } - - @Override - public VirtualMachineImpl withoutSystemAssignedManagedServiceIdentity() { - this.virtualMachineMsiHandler.withoutLocalManagedServiceIdentity(); - return this; - } - - @Override - public VirtualMachineImpl withSystemAssignedIdentityBasedAccessTo(String resourceId, BuiltInRole role) { - this.virtualMachineMsiHandler.withAccessTo(resourceId, role); - return this; - } - - @Override - public VirtualMachineImpl withSystemAssignedIdentityBasedAccessToCurrentResourceGroup(BuiltInRole role) { - this.virtualMachineMsiHandler.withAccessToCurrentResourceGroup(role); - return this; - } - - @Override - public VirtualMachineImpl withSystemAssignedIdentityBasedAccessTo(String resourceId, String roleDefinitionId) { - this.virtualMachineMsiHandler.withAccessTo(resourceId, roleDefinitionId); - return this; - } - - @Override - public VirtualMachineImpl withSystemAssignedIdentityBasedAccessToCurrentResourceGroup(String roleDefinitionId) { - this.virtualMachineMsiHandler.withAccessToCurrentResourceGroup(roleDefinitionId); - return this; - } - - @Override - public VirtualMachineImpl withNewUserAssignedManagedServiceIdentity(Creatable creatableIdentity) { - this.virtualMachineMsiHandler.withNewExternalManagedServiceIdentity(creatableIdentity); - return this; - } - - @Override - public VirtualMachineImpl withExistingUserAssignedManagedServiceIdentity(Identity identity) { - this.virtualMachineMsiHandler.withExistingExternalManagedServiceIdentity(identity); - return this; - } - - @Override - public VirtualMachineImpl withoutUserAssignedManagedServiceIdentity(String identityId) { - this.virtualMachineMsiHandler.withoutExternalManagedServiceIdentity(identityId); - return this; - } - - @Override - public VirtualMachineImpl withLicenseType(String licenseType) { - innerModel().withLicenseType(licenseType); - return this; - } - - // GETTERS - @Override - public boolean isManagedDiskEnabled() { - if (isOsDiskFromCustomImage(this.innerModel().storageProfile())) { - return true; - } - if (isOSDiskAttachedManaged(this.innerModel().storageProfile().osDisk())) { - return true; - } - if (isOSDiskFromStoredImage(this.innerModel().storageProfile())) { - return false; - } - if (isOSDiskAttachedUnmanaged(this.innerModel().storageProfile().osDisk())) { - return false; - } - if (isOSDiskFromPlatformImage(this.innerModel().storageProfile())) { - if (this.isUnmanagedDiskSelected) { - return false; - } - } - if (isInCreateMode()) { - return true; - } else { - return this.innerModel().storageProfile().osDisk().vhd() == null; - } - } - - @Override - public String computerName() { - if (innerModel().osProfile() == null) { - // VM created by attaching a specialized OS Disk VHD will not have the osProfile. - return null; - } - return innerModel().osProfile().computerName(); - } - - @Override - public VirtualMachineSizeTypes size() { - return innerModel().hardwareProfile().vmSize(); - } - - @Override - public OperatingSystemTypes osType() { - if (innerModel().storageProfile().osDisk().osType() != null) { - return innerModel().storageProfile().osDisk().osType(); - } - if (innerModel().osProfile() != null) { - if (innerModel().osProfile().linuxConfiguration() != null) { - return OperatingSystemTypes.LINUX; - } - if (innerModel().osProfile().windowsConfiguration() != null) { - return OperatingSystemTypes.WINDOWS; - } - } - return null; - } - - @Override - public String osUnmanagedDiskVhdUri() { - if (isManagedDiskEnabled()) { - return null; - } - return innerModel().storageProfile().osDisk().vhd().uri(); - } - - @Override - public CachingTypes osDiskCachingType() { - return innerModel().storageProfile().osDisk().caching(); - } - - @Override - public int osDiskSize() { - return ResourceManagerUtils.toPrimitiveInt(innerModel().storageProfile().osDisk().diskSizeGB()); - } - - @Override - public StorageAccountTypes osDiskStorageAccountType() { - if (!isManagedDiskEnabled() || this.storageProfile().osDisk().managedDisk() == null) { - return null; - } - return this.storageProfile().osDisk().managedDisk().storageAccountType(); - } - - @Override - public String osDiskId() { - if (!isManagedDiskEnabled()) { - return null; - } - return this.storageProfile().osDisk().managedDisk().id(); - } - - @Override - public Map unmanagedDataDisks() { - Map dataDisks = new HashMap<>(); - if (!isManagedDiskEnabled()) { - for (VirtualMachineUnmanagedDataDisk dataDisk : this.unmanagedDataDisks) { - dataDisks.put(dataDisk.lun(), dataDisk); - } - } - return Collections.unmodifiableMap(dataDisks); - } - - @Override - public Map dataDisks() { - Map dataDisks = new HashMap<>(); - if (isManagedDiskEnabled()) { - List innerDataDisks = this.innerModel().storageProfile().dataDisks(); - if (innerDataDisks != null) { - for (DataDisk innerDataDisk : innerDataDisks) { - dataDisks.put(innerDataDisk.lun(), new VirtualMachineDataDiskImpl(innerDataDisk)); - } - } - } - return Collections.unmodifiableMap(dataDisks); - } - - @Override - public NetworkInterface getPrimaryNetworkInterface() { - return this.getPrimaryNetworkInterfaceAsync().block(); - } - - @Override - public Mono getPrimaryNetworkInterfaceAsync() { - return this.networkManager.networkInterfaces().getByIdAsync(primaryNetworkInterfaceId()); - } - - @Override - public PublicIpAddress getPrimaryPublicIPAddress() { - return this.getPrimaryNetworkInterface().primaryIPConfiguration().getPublicIpAddress(); - } - - @Override - public String getPrimaryPublicIPAddressId() { - return this.getPrimaryNetworkInterface().primaryIPConfiguration().publicIpAddressId(); - } - - @Override - public List networkInterfaceIds() { - List nicIds = new ArrayList<>(); - for (NetworkInterfaceReference nicRef : innerModel().networkProfile().networkInterfaces()) { - nicIds.add(nicRef.id()); - } - return nicIds; - } - - @Override - public String primaryNetworkInterfaceId() { - final List nicRefs = this.innerModel().networkProfile().networkInterfaces(); - String primaryNicRefId = null; - if (nicRefs.size() == 1) { - // One NIC so assume it to be primary - primaryNicRefId = nicRefs.get(0).id(); - } else if (nicRefs.size() == 0) { - // No NICs so null - primaryNicRefId = null; - } else { - // Find primary interface as flagged by Azure - for (NetworkInterfaceReference nicRef : innerModel().networkProfile().networkInterfaces()) { - if (nicRef.primary() != null && nicRef.primary()) { - primaryNicRefId = nicRef.id(); - break; - } - } - // If Azure didn't flag any NIC as primary then assume the first one - if (primaryNicRefId == null) { - primaryNicRefId = nicRefs.get(0).id(); - } - } - return primaryNicRefId; - } - - @Override - public String availabilitySetId() { - if (innerModel().availabilitySet() != null) { - return innerModel().availabilitySet().id(); - } - return null; - } - - @Override - public String provisioningState() { - return innerModel().provisioningState(); - } - - @Override - public String licenseType() { - return innerModel().licenseType(); - } - - @Override - public ProximityPlacementGroup proximityPlacementGroup() { - if (innerModel().proximityPlacementGroup() == null) { - return null; - } else { - ResourceId id = ResourceId.fromString(innerModel().proximityPlacementGroup().id()); - ProximityPlacementGroupInner plgInner = - manager() - .serviceClient() - .getProximityPlacementGroups() - .getByResourceGroup(id.resourceGroupName(), id.name()); - if (plgInner == null) { - return null; - } else { - return new ProximityPlacementGroupImpl(plgInner); - } - } - } - - @Override - public Mono> listExtensionsAsync() { - return this.virtualMachineExtensions.listAsync(); - } - - @Override - public Map listExtensions() { - return this.virtualMachineExtensions.asMap(); - } - - @Override - public Plan plan() { - return innerModel().plan(); - } - - @Override - public StorageProfile storageProfile() { - return innerModel().storageProfile(); - } - - @Override - public OSProfile osProfile() { - return innerModel().osProfile(); - } - - @Override - public DiagnosticsProfile diagnosticsProfile() { - return innerModel().diagnosticsProfile(); - } - - @Override - public String vmId() { - return innerModel().vmId(); - } - - @Override - public VirtualMachineInstanceView instanceView() { - if (this.virtualMachineInstanceView == null) { - this.refreshInstanceView(); - } - return this.virtualMachineInstanceView; - } - - @Override - public Set availabilityZones() { - Set zones = new HashSet<>(); - if (this.innerModel().zones() != null) { - for (String zone : this.innerModel().zones()) { - zones.add(AvailabilityZoneId.fromString(zone)); - } - } - return Collections.unmodifiableSet(zones); - } - - @Override - public PowerState powerState() { - return PowerState.fromInstanceView(this.instanceView()); - } - - @Override - public boolean isBootDiagnosticsEnabled() { - return this.bootDiagnosticsHandler.isBootDiagnosticsEnabled(); - } - - @Override - public String bootDiagnosticsStorageUri() { - return this.bootDiagnosticsHandler.bootDiagnosticsStorageUri(); - } - - @Override - public boolean isManagedServiceIdentityEnabled() { - ResourceIdentityType type = this.managedServiceIdentityType(); - return type != null && !type.equals(ResourceIdentityType.NONE); - } - - @Override - public String systemAssignedManagedServiceIdentityTenantId() { - if (this.innerModel().identity() != null) { - return this.innerModel().identity().tenantId(); - } - return null; - } - - @Override - public String systemAssignedManagedServiceIdentityPrincipalId() { - if (this.innerModel().identity() != null) { - return this.innerModel().identity().principalId(); - } - return null; - } - - @Override - public ResourceIdentityType managedServiceIdentityType() { - if (this.innerModel().identity() != null) { - return this.innerModel().identity().type(); - } - return null; - } - - @Override - public Set userAssignedManagedServiceIdentityIds() { - if (this.innerModel().identity() != null && this.innerModel().identity().userAssignedIdentities() != null) { - return Collections - .unmodifiableSet(new HashSet(this.innerModel().identity().userAssignedIdentities().keySet())); - } - return Collections.unmodifiableSet(new HashSet()); - } - - @Override - public BillingProfile billingProfile() { - return this.innerModel().billingProfile(); - } - - @Override - public VirtualMachinePriorityTypes priority() { - return this.innerModel().priority(); - } - - @Override - public VirtualMachineEvictionPolicyTypes evictionPolicy() { - return this.innerModel().evictionPolicy(); - } - - // CreateUpdateTaskGroup.ResourceCreator.beforeGroupCreateOrUpdate implementation - @Override - public void beforeGroupCreateOrUpdate() { - // [1]. StorageProfile: If implicit storage account creation is required then add Creatable. - if (creatableStorageAccountKey == null && existingStorageAccountToAssociate == null) { - if (osDiskRequiresImplicitStorageAccountCreation() || dataDisksRequiresImplicitStorageAccountCreation()) { - Creatable storageAccountCreatable = null; - if (this.creatableGroup != null) { - storageAccountCreatable = - this - .storageManager - .storageAccounts() - .define(this.namer.getRandomName("stg", 24).replace("-", "")) - .withRegion(this.regionName()) - .withNewResourceGroup(this.creatableGroup); - } else { - storageAccountCreatable = - this - .storageManager - .storageAccounts() - .define(this.namer.getRandomName("stg", 24).replace("-", "")) - .withRegion(this.regionName()) - .withExistingResourceGroup(this.resourceGroupName()); - } - this.creatableStorageAccountKey = this.addDependency(storageAccountCreatable); - } - } - // [2]. BootDiagnosticsProfile: If any implicit resource creation is required then add Creatable. - this.bootDiagnosticsHandler.prepare(); - } - - // [2]. CreateUpdateTaskGroup.ResourceCreator.createResourceAsync implementation - @Override - public Mono createResourceAsync() { - // -- set creation-time only properties - return prepareCreateResourceAsync() - .flatMap( - virtualMachine -> - this - .manager() - .serviceClient() - .getVirtualMachines() - .createOrUpdateAsync(resourceGroupName(), vmName, innerModel()) - .map( - virtualMachineInner -> { - reset(virtualMachineInner); - return this; - })); - } - - private Mono prepareCreateResourceAsync() { - setOSDiskDefaults(); - setOSProfileDefaults(); - setHardwareProfileDefaults(); - if (isManagedDiskEnabled()) { - managedDataDisks.setDataDisksDefaults(); - } else { - UnmanagedDataDiskImpl.setDataDisksDefaults(this.unmanagedDataDisks, this.vmName); - } - this.handleUnManagedOSAndDataDisksStorageSettings(); - this.bootDiagnosticsHandler.handleDiagnosticsSettings(); - this.handleNetworkSettings(); - return this - .createNewProximityPlacementGroupAsync() - .map( - virtualMachine -> { - this.handleAvailabilitySettings(); - this.virtualMachineMsiHandler.processCreatedExternalIdentities(); - this.virtualMachineMsiHandler.handleExternalIdentities(); - return virtualMachine; - }); - } - - public Accepted beginCreate() { - return AcceptedImpl - .newAccepted( - logger, - this.manager().serviceClient().getHttpPipeline(), - this.manager().serviceClient().getDefaultPollInterval(), - () -> - this - .manager() - .serviceClient() - .getVirtualMachines() - .createOrUpdateWithResponseAsync(resourceGroupName(), vmName, innerModel()) - .block(), - inner -> - new VirtualMachineImpl( - inner.name(), - inner, - this.manager(), - this.storageManager, - this.networkManager, - this.authorizationManager), - VirtualMachineInner.class, - () -> { - Flux dependencyTasksAsync = - taskGroup().invokeDependencyAsync(taskGroup().newInvocationContext()); - dependencyTasksAsync.blockLast(); - - // same as createResourceAsync - prepareCreateResourceAsync().block(); - }, - this::reset, - Context.NONE); - } - - @Override - public Mono updateResourceAsync() { - if (isManagedDiskEnabled()) { - managedDataDisks.setDataDisksDefaults(); - } else { - UnmanagedDataDiskImpl.setDataDisksDefaults(this.unmanagedDataDisks, this.vmName); - } - this.handleUnManagedOSAndDataDisksStorageSettings(); - this.bootDiagnosticsHandler.handleDiagnosticsSettings(); - this.handleNetworkSettings(); - this.handleAvailabilitySettings(); - this.virtualMachineMsiHandler.processCreatedExternalIdentities(); - - VirtualMachineUpdateInner updateParameter = new VirtualMachineUpdateInner(); - this.copyInnerToUpdateParameter(updateParameter); - this.virtualMachineMsiHandler.handleExternalIdentities(updateParameter); - - final boolean vmModified = this.isVirtualMachineModifiedDuringUpdate(updateParameter); - if (vmModified) { - return this - .manager() - .serviceClient() - .getVirtualMachines() - .updateAsync(resourceGroupName(), vmName, updateParameter) - .map( - virtualMachineInner -> { - reset(virtualMachineInner); - return this; - }); - } else { - return Mono.just(this); - } - } - - // CreateUpdateTaskGroup.ResourceCreator.afterPostRunAsync implementation - @Override - public Mono afterPostRunAsync(boolean isGroupFaulted) { - this.virtualMachineExtensions.clear(); - if (isGroupFaulted) { - return Mono.empty(); - } else { - return this.refreshAsync().then(); - } - } - - // Helpers - VirtualMachineImpl withExtension(VirtualMachineExtensionImpl extension) { - this.virtualMachineExtensions.addExtension(extension); - return this; - } - - private void reset(VirtualMachineInner inner) { - this.setInner(inner); - clearCachedRelatedResources(); - initializeDataDisks(); - virtualMachineMsiHandler.clear(); - } - - VirtualMachineImpl withUnmanagedDataDisk(UnmanagedDataDiskImpl dataDisk) { - this.innerModel().storageProfile().dataDisks().add(dataDisk.innerModel()); - this.unmanagedDataDisks.add(dataDisk); - return this; - } - - @Override - public VirtualMachineImpl withAvailabilityZone(AvailabilityZoneId zoneId) { - if (isInCreateMode()) { - // Note: Zone is not updatable as of now, so this is available only during definition time. - // Service return `ResourceAvailabilityZonesCannotBeModified` upon attempt to append a new - // zone or remove one. Trying to remove the last one means attempt to change resource from - // zonal to regional, which is not supported. - // though not updatable, still adding above 'isInCreateMode' check just as a reminder to - // take special handling of 'implicitPipCreatable' when avail zone update is supported. - if (this.innerModel().zones() == null) { - this.innerModel().withZones(new ArrayList()); - } - this.innerModel().zones().add(zoneId.toString()); - // zone aware VM can be attached to only zone aware public IP. - if (this.implicitPipCreatable != null) { - this.implicitPipCreatable.withAvailabilityZone(zoneId); - } - } - return this; - } - - AzureEnvironment environment() { - return manager().environment(); - } - - private void setOSDiskDefaults() { - if (isInUpdateMode()) { - return; - } - StorageProfile storageProfile = this.innerModel().storageProfile(); - OSDisk osDisk = storageProfile.osDisk(); - if (isOSDiskFromImage(osDisk)) { - // ODDisk CreateOption: FROM_IMAGE - if (isManagedDiskEnabled()) { - // Note: - // Managed disk - // Supported: PlatformImage and CustomImage - // UnSupported: StoredImage - if (osDisk.managedDisk() == null) { - osDisk.withManagedDisk(new ManagedDiskParameters()); - } - if (osDisk.managedDisk().storageAccountType() == null) { - osDisk.managedDisk().withStorageAccountType(StorageAccountTypes.STANDARD_LRS); - } - osDisk.withVhd(null); - // We won't set osDisk.name() explicitly for managed disk, if it is null CRP generates unique - // name for the disk resource within the resource group. - } else { - // Note: - // Native (un-managed) disk - // Supported: PlatformImage and StoredImage - // UnSupported: CustomImage - if (isOSDiskFromPlatformImage(storageProfile) || isOSDiskFromStoredImage(storageProfile)) { - if (osDisk.vhd() == null) { - String osDiskVhdContainerName = "vhds"; - String osDiskVhdName = this.vmName + "-os-disk-" + UUID.randomUUID().toString() + ".vhd"; - withOSDiskVhdLocation(osDiskVhdContainerName, osDiskVhdName); - } - osDisk.withManagedDisk(null); - } - if (osDisk.name() == null) { - withOSDiskName(this.vmName + "-os-disk"); - } - } - } else { - // ODDisk CreateOption: ATTACH - if (isManagedDiskEnabled()) { - // In case of attach, it is not allowed to change the storage account type of the - // managed disk. - if (osDisk.managedDisk() != null) { - osDisk.managedDisk().withStorageAccountType(null); - } - osDisk.withVhd(null); - } else { - osDisk.withManagedDisk(null); - if (osDisk.name() == null) { - withOSDiskName(this.vmName + "-os-disk"); - } - } - } - if (osDisk.caching() == null) { - withOSDiskCaching(CachingTypes.READ_WRITE); - } - } - - private void setOSProfileDefaults() { - if (isInUpdateMode()) { - return; - } - StorageProfile storageProfile = this.innerModel().storageProfile(); - OSDisk osDisk = storageProfile.osDisk(); - if (!removeOsProfile && isOSDiskFromImage(osDisk)) { - // ODDisk CreateOption: FROM_IMAGE - if (osDisk.osType() == OperatingSystemTypes.LINUX || this.isMarketplaceLinuxImage) { - // linux image: PlatformImage | CustomImage | StoredImage - OSProfile osProfile = this.innerModel().osProfile(); - if (osProfile.linuxConfiguration() == null) { - osProfile.withLinuxConfiguration(new LinuxConfiguration()); - } - this - .innerModel() - .osProfile() - .linuxConfiguration() - .withDisablePasswordAuthentication(osProfile.adminPassword() == null); - } - if (this.innerModel().osProfile().computerName() == null) { - // VM name cannot contain only numeric values and cannot exceed 15 chars - if (vmName.matches("[0-9]+")) { - this.innerModel().osProfile().withComputerName(namer.getRandomName("vm", 15)); - } else if (vmName.length() <= 15) { - this.innerModel().osProfile().withComputerName(vmName); - } else { - this.innerModel().osProfile().withComputerName(namer.getRandomName("vm", 15)); - } - } - } else { - // ODDisk CreateOption: ATTACH - // - // OS Profile must be set to null when an VM's OS disk is ATTACH-ed to a managed disk or - // Specialized VHD - this.innerModel().withOsProfile(null); - } - } - - private void setHardwareProfileDefaults() { - if (!isInCreateMode()) { - return; - } - HardwareProfile hardwareProfile = this.innerModel().hardwareProfile(); - if (hardwareProfile.vmSize() == null) { - hardwareProfile.withVmSize(VirtualMachineSizeTypes.BASIC_A0); - } - } - - /** Prepare virtual machine disks profile (StorageProfile). */ - private void handleUnManagedOSAndDataDisksStorageSettings() { - if (isManagedDiskEnabled()) { - // NOP if the virtual machine is based on managed disk (managed and un-managed disk cannot be mixed) - return; - } - StorageAccount storageAccount = null; - if (this.creatableStorageAccountKey != null) { - storageAccount = this.taskResult(this.creatableStorageAccountKey); - } else if (this.existingStorageAccountToAssociate != null) { - storageAccount = this.existingStorageAccountToAssociate; - } - if (isInCreateMode()) { - if (storageAccount != null) { - if (isOSDiskFromPlatformImage(innerModel().storageProfile())) { - String uri = - innerModel() - .storageProfile() - .osDisk() - .vhd() - .uri() - .replaceFirst("\\{storage-base-url}", storageAccount.endPoints().primary().blob()); - innerModel().storageProfile().osDisk().vhd().withUri(uri); - } - UnmanagedDataDiskImpl.ensureDisksVhdUri(unmanagedDataDisks, storageAccount, vmName); - } - } else { // Update Mode - if (storageAccount != null) { - UnmanagedDataDiskImpl.ensureDisksVhdUri(unmanagedDataDisks, storageAccount, vmName); - } else { - UnmanagedDataDiskImpl.ensureDisksVhdUri(unmanagedDataDisks, vmName); - } - } - } - - private Mono createNewProximityPlacementGroupAsync() { - if (isInCreateMode()) { - if (this.newProximityPlacementGroupName != null && !this.newProximityPlacementGroupName.isEmpty()) { - ProximityPlacementGroupInner plgInner = new ProximityPlacementGroupInner(); - plgInner.withProximityPlacementGroupType(this.newProximityPlacementGroupType); - plgInner.withLocation(this.innerModel().location()); - return this - .manager() - .serviceClient() - .getProximityPlacementGroups() - .createOrUpdateAsync(this.resourceGroupName(), this.newProximityPlacementGroupName, plgInner) - .map( - createdPlgInner -> { - this - .innerModel() - .withProximityPlacementGroup(new SubResource().withId(createdPlgInner.id())); - return this; - }); - } - } - return Mono.just(this); - } - - private void handleNetworkSettings() { - if (isInCreateMode()) { - NetworkInterface primaryNetworkInterface = null; - if (this.creatablePrimaryNetworkInterfaceKey != null) { - primaryNetworkInterface = this.taskResult(this.creatablePrimaryNetworkInterfaceKey); - } else if (this.existingPrimaryNetworkInterfaceToAssociate != null) { - primaryNetworkInterface = this.existingPrimaryNetworkInterfaceToAssociate; - } - - if (primaryNetworkInterface != null) { - NetworkInterfaceReference nicReference = new NetworkInterfaceReference(); - nicReference.withPrimary(true); - nicReference.withId(primaryNetworkInterface.id()); - this.innerModel().networkProfile().networkInterfaces().add(nicReference); - } - } - - // sets the virtual machine secondary network interfaces - // - for (String creatableSecondaryNetworkInterfaceKey : this.creatableSecondaryNetworkInterfaceKeys) { - NetworkInterface secondaryNetworkInterface = this.taskResult(creatableSecondaryNetworkInterfaceKey); - NetworkInterfaceReference nicReference = new NetworkInterfaceReference(); - nicReference.withPrimary(false); - nicReference.withId(secondaryNetworkInterface.id()); - this.innerModel().networkProfile().networkInterfaces().add(nicReference); - } - - for (NetworkInterface secondaryNetworkInterface : this.existingSecondaryNetworkInterfacesToAssociate) { - NetworkInterfaceReference nicReference = new NetworkInterfaceReference(); - nicReference.withPrimary(false); - nicReference.withId(secondaryNetworkInterface.id()); - this.innerModel().networkProfile().networkInterfaces().add(nicReference); - } - } - - private void handleAvailabilitySettings() { - if (!isInCreateMode()) { - return; - } - - AvailabilitySet availabilitySet = null; - if (this.creatableAvailabilitySetKey != null) { - availabilitySet = this.taskResult(this.creatableAvailabilitySetKey); - } else if (this.existingAvailabilitySetToAssociate != null) { - availabilitySet = this.existingAvailabilitySetToAssociate; - } - - if (availabilitySet != null) { - if (this.innerModel().availabilitySet() == null) { - this.innerModel().withAvailabilitySet(new SubResource()); - } - - this.innerModel().availabilitySet().withId(availabilitySet.id()); - } - } - - private boolean osDiskRequiresImplicitStorageAccountCreation() { - if (isManagedDiskEnabled()) { - return false; - } - if (this.creatableStorageAccountKey != null - || this.existingStorageAccountToAssociate != null - || !isInCreateMode()) { - return false; - } - return isOSDiskFromPlatformImage(this.innerModel().storageProfile()); - } - - private boolean dataDisksRequiresImplicitStorageAccountCreation() { - if (isManagedDiskEnabled()) { - return false; - } - if (this.creatableStorageAccountKey != null - || this.existingStorageAccountToAssociate != null - || this.unmanagedDataDisks.size() == 0) { - return false; - } - boolean hasEmptyVhd = false; - for (VirtualMachineUnmanagedDataDisk dataDisk : this.unmanagedDataDisks) { - if (dataDisk.creationMethod() == DiskCreateOptionTypes.EMPTY - || dataDisk.creationMethod() == DiskCreateOptionTypes.FROM_IMAGE) { - if (dataDisk.innerModel().vhd() == null) { - hasEmptyVhd = true; - break; - } - } - } - if (isInCreateMode()) { - return hasEmptyVhd; - } - if (hasEmptyVhd) { - // In update mode, if any of the data disk has vhd uri set then use same container - // to store this disk, no need to create a storage account implicitly. - for (VirtualMachineUnmanagedDataDisk dataDisk : this.unmanagedDataDisks) { - if (dataDisk.creationMethod() == DiskCreateOptionTypes.ATTACH && dataDisk.innerModel().vhd() != null) { - return false; - } - } - return true; - } - return false; - } - - /** - * Checks whether the OS disk is directly attached to a unmanaged VHD. - * - * @param osDisk the osDisk value in the storage profile - * @return true if the OS disk is attached to a unmanaged VHD, false otherwise - */ - private boolean isOSDiskAttachedUnmanaged(OSDisk osDisk) { - return osDisk.createOption() == DiskCreateOptionTypes.ATTACH - && osDisk.vhd() != null - && osDisk.vhd().uri() != null; - } - - /** - * Checks whether the OS disk is directly attached to a managed disk. - * - * @param osDisk the osDisk value in the storage profile - * @return true if the OS disk is attached to a managed disk, false otherwise - */ - private boolean isOSDiskAttachedManaged(OSDisk osDisk) { - return osDisk.createOption() == DiskCreateOptionTypes.ATTACH - && osDisk.managedDisk() != null - && osDisk.managedDisk().id() != null; - } - - /** - * Checks whether the OS disk is based on an image (image from PIR or custom image [captured, bringYourOwnFeature]). - * - * @param osDisk the osDisk value in the storage profile - * @return true if the OS disk is configured to use image from PIR or custom image - */ - private boolean isOSDiskFromImage(OSDisk osDisk) { - return osDisk.createOption() == DiskCreateOptionTypes.FROM_IMAGE; - } - - /** - * Checks whether the OS disk is based on an platform image (image in PIR). - * - * @param storageProfile the storage profile - * @return true if the OS disk is configured to be based on platform image. - */ - private boolean isOSDiskFromPlatformImage(StorageProfile storageProfile) { - ImageReference imageReference = storageProfile.imageReference(); - return isOSDiskFromImage(storageProfile.osDisk()) - && imageReference != null - && imageReference.publisher() != null - && imageReference.offer() != null - && imageReference.sku() != null - && imageReference.version() != null; - } - - /** - * Checks whether the OS disk is based on a CustomImage. - * - *

A custom image is represented by {@link VirtualMachineCustomImage}. - * - * @param storageProfile the storage profile - * @return true if the OS disk is configured to be based on custom image. - */ - private boolean isOsDiskFromCustomImage(StorageProfile storageProfile) { - ImageReference imageReference = storageProfile.imageReference(); - return isOSDiskFromImage(storageProfile.osDisk()) && imageReference != null && imageReference.id() != null; - } - - /** - * Checks whether the OS disk is based on a stored image ('captured' or 'bring your own feature'). - * - *

A stored image is created by calling {@link VirtualMachine#capture(String, String, boolean)}. - * - * @param storageProfile the storage profile - * @return true if the OS disk is configured to use custom image ('captured' or 'bring your own feature') - */ - private boolean isOSDiskFromStoredImage(StorageProfile storageProfile) { - OSDisk osDisk = storageProfile.osDisk(); - return isOSDiskFromImage(osDisk) && osDisk.image() != null && osDisk.image().uri() != null; - } - - private String temporaryBlobUrl(String containerName, String blobName) { - return "{storage-base-url}" + containerName + "/" + blobName; - } - - private NetworkInterface.DefinitionStages.WithPrimaryPublicIPAddress prepareNetworkInterface(String name) { - NetworkInterface.DefinitionStages.WithGroup definitionWithGroup = - this.networkManager.networkInterfaces().define(name).withRegion(this.regionName()); - NetworkInterface.DefinitionStages.WithPrimaryNetwork definitionWithNetwork; - if (this.creatableGroup != null) { - definitionWithNetwork = definitionWithGroup.withNewResourceGroup(this.creatableGroup); - } else { - definitionWithNetwork = definitionWithGroup.withExistingResourceGroup(this.resourceGroupName()); - } - return definitionWithNetwork.withNewPrimaryNetwork("vnet" + name).withPrimaryPrivateIPAddressDynamic(); - } - - private void initializeDataDisks() { - if (this.innerModel().storageProfile().dataDisks() == null) { - this.innerModel().storageProfile().withDataDisks(new ArrayList<>()); - } - - this.isUnmanagedDiskSelected = false; - this.managedDataDisks.clear(); - this.unmanagedDataDisks = new ArrayList<>(); - if (!isManagedDiskEnabled()) { - for (DataDisk dataDiskInner : this.storageProfile().dataDisks()) { - this.unmanagedDataDisks.add(new UnmanagedDataDiskImpl(dataDiskInner, this)); - } - } - } - - private NetworkInterface.DefinitionStages.WithPrimaryNetwork preparePrimaryNetworkInterface(String name) { - NetworkInterface.DefinitionStages.WithGroup definitionWithGroup = - this.networkManager.networkInterfaces().define(name).withRegion(this.regionName()); - NetworkInterface.DefinitionStages.WithPrimaryNetwork definitionAfterGroup; - if (this.creatableGroup != null) { - definitionAfterGroup = definitionWithGroup.withNewResourceGroup(this.creatableGroup); - } else { - definitionAfterGroup = definitionWithGroup.withExistingResourceGroup(this.resourceGroupName()); - } - return definitionAfterGroup; - } - - private void clearCachedRelatedResources() { - this.virtualMachineInstanceView = null; - } - - private void throwIfManagedDiskEnabled(String message) { - if (this.isManagedDiskEnabled()) { - throw logger.logExceptionAsError(new UnsupportedOperationException(message)); - } - } - - private void throwIfManagedDiskDisabled(String message) { - if (!this.isManagedDiskEnabled()) { - throw logger.logExceptionAsError(new UnsupportedOperationException(message)); - } - } - - private boolean isInUpdateMode() { - return !this.isInCreateMode(); - } - - boolean isVirtualMachineModifiedDuringUpdate(VirtualMachineUpdateInner updateParameter) { - if (updateParameterSnapshotOnUpdate == null || updateParameter == null) { - return true; - } else { - try { - String jsonStrSnapshot = - SERIALIZER_ADAPTER.serialize(updateParameterSnapshotOnUpdate, SerializerEncoding.JSON); - String jsonStr = SERIALIZER_ADAPTER.serialize(updateParameter, SerializerEncoding.JSON); - return !jsonStr.equals(jsonStrSnapshot); - } catch (IOException e) { - // ignored, treat as modified - return true; - } - } - } - - VirtualMachineUpdateInner deepCopyInnerToUpdateParameter() { - VirtualMachineUpdateInner updateParameter = new VirtualMachineUpdateInner(); - copyInnerToUpdateParameter(updateParameter); - try { - // deep copy via json - String jsonStr = SERIALIZER_ADAPTER.serialize(updateParameter, SerializerEncoding.JSON); - updateParameter = - SERIALIZER_ADAPTER.deserialize(jsonStr, VirtualMachineUpdateInner.class, SerializerEncoding.JSON); - } catch (IOException e) { - // ignored, null to signify not available - return null; - } - // deep copy identity, with userAssignedIdentities==null to signify no change - if (this.innerModel().identity() != null) { - VirtualMachineIdentity identity = new VirtualMachineIdentity(); - identity.withType(this.innerModel().identity().type()); - updateParameter.withIdentity(identity); - } - - return updateParameter; - } - - private void copyInnerToUpdateParameter(VirtualMachineUpdateInner updateParameter) { - //updateParameter.withPlan(this.innerModel().plan()); // update cannot change plan - updateParameter.withHardwareProfile(this.innerModel().hardwareProfile()); - updateParameter.withStorageProfile(this.innerModel().storageProfile()); - updateParameter.withOsProfile(this.innerModel().osProfile()); - updateParameter.withNetworkProfile(this.innerModel().networkProfile()); - updateParameter.withDiagnosticsProfile(this.innerModel().diagnosticsProfile()); - updateParameter.withBillingProfile(this.innerModel().billingProfile()); - updateParameter.withAvailabilitySet(this.innerModel().availabilitySet()); - updateParameter.withLicenseType(this.innerModel().licenseType()); - updateParameter.withZones(this.innerModel().zones()); - updateParameter.withTags(this.innerModel().tags()); - updateParameter.withProximityPlacementGroup(this.innerModel().proximityPlacementGroup()); - updateParameter.withPriority(this.innerModel().priority()); - } - - RoleAssignmentHelper.IdProvider idProvider() { - return new RoleAssignmentHelper.IdProvider() { - @Override - public String principalId() { - if (innerModel() != null && innerModel().identity() != null) { - return innerModel().identity().principalId(); - } else { - return null; - } - } - - @Override - public String resourceId() { - if (innerModel() != null) { - return innerModel().id(); - } else { - return null; - } - } - }; - } - - /** Class to manage Data disk collection. */ - private class ManagedDataDiskCollection { - private final Map newDisksToAttach = new HashMap<>(); - private final List existingDisksToAttach = new ArrayList<>(); - private final List implicitDisksToAssociate = new ArrayList<>(); - private final List diskLunsToRemove = new ArrayList<>(); - private final List newDisksFromImage = new ArrayList<>(); - private final VirtualMachineImpl vm; - private CachingTypes defaultCachingType; - private StorageAccountTypes defaultStorageAccountType; - - ManagedDataDiskCollection(VirtualMachineImpl vm) { - this.vm = vm; - } - - void setDefaultCachingType(CachingTypes cachingType) { - this.defaultCachingType = cachingType; - } - - void setDefaultStorageAccountType(StorageAccountTypes defaultStorageAccountType) { - this.defaultStorageAccountType = defaultStorageAccountType; - } - - void setDataDisksDefaults() { - VirtualMachineInner vmInner = this.vm.innerModel(); - if (isPending()) { - if (vmInner.storageProfile().dataDisks() == null) { - vmInner.storageProfile().withDataDisks(new ArrayList<>()); - } - List dataDisks = vmInner.storageProfile().dataDisks(); - final List usedLuns = new ArrayList<>(); - // Get all used luns - for (DataDisk dataDisk : dataDisks) { - if (dataDisk.lun() != -1) { - usedLuns.add(dataDisk.lun()); - } - } - for (DataDisk dataDisk : this.newDisksToAttach.values()) { - if (dataDisk.lun() != -1) { - usedLuns.add(dataDisk.lun()); - } - } - for (DataDisk dataDisk : this.existingDisksToAttach) { - if (dataDisk.lun() != -1) { - usedLuns.add(dataDisk.lun()); - } - } - for (DataDisk dataDisk : this.implicitDisksToAssociate) { - if (dataDisk.lun() != -1) { - usedLuns.add(dataDisk.lun()); - } - } - for (DataDisk dataDisk : this.newDisksFromImage) { - if (dataDisk.lun() != -1) { - usedLuns.add(dataDisk.lun()); - } - } - // Func to get the next available lun - Callable nextLun = - () -> { - Integer lun = 0; - while (usedLuns.contains(lun)) { - lun++; - } - usedLuns.add(lun); - return lun; - }; - try { - setAttachableNewDataDisks(nextLun); - setAttachableExistingDataDisks(nextLun); - setImplicitDataDisks(nextLun); - } catch (Exception ex) { - throw logger.logExceptionAsError(Exceptions.propagate(ex)); - } - setImageBasedDataDisks(); - removeDataDisks(); - } - if (vmInner.storageProfile().dataDisks() != null && vmInner.storageProfile().dataDisks().size() == 0) { - if (vm.isInCreateMode()) { - // If there is no data disks at all, then setting it to null rather than [] is necessary. - // This is for take advantage of CRP's implicit creation of the data disks if the image has - // more than one data disk image(s). - vmInner.storageProfile().withDataDisks(null); - } - } - this.clear(); - } - - private void clear() { - newDisksToAttach.clear(); - existingDisksToAttach.clear(); - implicitDisksToAssociate.clear(); - diskLunsToRemove.clear(); - newDisksFromImage.clear(); - } - - private boolean isPending() { - return newDisksToAttach.size() > 0 - || existingDisksToAttach.size() > 0 - || implicitDisksToAssociate.size() > 0 - || diskLunsToRemove.size() > 0 - || newDisksFromImage.size() > 0; - } - - private void setAttachableNewDataDisks(Callable nextLun) throws Exception { - List dataDisks = vm.innerModel().storageProfile().dataDisks(); - for (Map.Entry entry : this.newDisksToAttach.entrySet()) { - Disk managedDisk = vm.taskResult(entry.getKey()); - DataDisk dataDisk = entry.getValue(); - dataDisk.withCreateOption(DiskCreateOptionTypes.ATTACH); - if (dataDisk.lun() == -1) { - dataDisk.withLun(nextLun.call()); - } - dataDisk.withManagedDisk(new ManagedDiskParameters()); - dataDisk.managedDisk().withId(managedDisk.id()); - if (dataDisk.caching() == null) { - dataDisk.withCaching(getDefaultCachingType()); - } - // Don't set default storage account type for the attachable managed disks, it is already - // defined in the managed disk and not allowed to change. - dataDisk.withName(null); - dataDisks.add(dataDisk); - } - } - - private void setAttachableExistingDataDisks(Callable nextLun) throws Exception { - List dataDisks = vm.innerModel().storageProfile().dataDisks(); - for (DataDisk dataDisk : this.existingDisksToAttach) { - dataDisk.withCreateOption(DiskCreateOptionTypes.ATTACH); - if (dataDisk.lun() == -1) { - dataDisk.withLun(nextLun.call()); - } - if (dataDisk.caching() == null) { - dataDisk.withCaching(getDefaultCachingType()); - } - // Don't set default storage account type for the attachable managed disks, it is already - // defined in the managed disk and not allowed to change. - dataDisk.withName(null); - dataDisks.add(dataDisk); - } - } - - private void setImplicitDataDisks(Callable nextLun) throws Exception { - List dataDisks = vm.innerModel().storageProfile().dataDisks(); - for (DataDisk dataDisk : this.implicitDisksToAssociate) { - dataDisk.withCreateOption(DiskCreateOptionTypes.EMPTY); - if (dataDisk.lun() == -1) { - dataDisk.withLun(nextLun.call()); - } - if (dataDisk.caching() == null) { - dataDisk.withCaching(getDefaultCachingType()); - } - if (dataDisk.managedDisk() == null) { - dataDisk.withManagedDisk(new ManagedDiskParameters()); - } - if (dataDisk.managedDisk().storageAccountType() == null) { - dataDisk.managedDisk().withStorageAccountType(getDefaultStorageAccountType()); - } - dataDisk.withName(null); - dataDisks.add(dataDisk); - } - } - - private void setImageBasedDataDisks() { - List dataDisks = vm.innerModel().storageProfile().dataDisks(); - for (DataDisk dataDisk : this.newDisksFromImage) { - dataDisk.withCreateOption(DiskCreateOptionTypes.FROM_IMAGE); - // Don't set default storage account type for the disk, either user has to specify it explicitly or let - // CRP pick it from the image - dataDisk.withName(null); - dataDisks.add(dataDisk); - } - } - - private void removeDataDisks() { - List dataDisks = vm.innerModel().storageProfile().dataDisks(); - for (Integer lun : this.diskLunsToRemove) { - int indexToRemove = 0; - for (DataDisk dataDisk : dataDisks) { - if (dataDisk.lun() == lun) { - dataDisks.remove(indexToRemove); - break; - } - indexToRemove++; - } - } - } - - private CachingTypes getDefaultCachingType() { - if (defaultCachingType == null) { - return CachingTypes.READ_WRITE; - } - return defaultCachingType; - } - - private StorageAccountTypes getDefaultStorageAccountType() { - if (defaultStorageAccountType == null) { - return StorageAccountTypes.STANDARD_LRS; - } - return defaultStorageAccountType; - } - } - - /** Class to manage VM boot diagnostics settings. */ - private class BootDiagnosticsHandler { - private final VirtualMachineImpl vmImpl; - private String creatableDiagnosticsStorageAccountKey; - private boolean useManagedStorageAccount = false; - - BootDiagnosticsHandler(VirtualMachineImpl vmImpl) { - this.vmImpl = vmImpl; - if (isBootDiagnosticsEnabled() - && this.vmInner().diagnosticsProfile().bootDiagnostics().storageUri() == null) { - this.useManagedStorageAccount = true; - } - } - - public boolean isBootDiagnosticsEnabled() { - if (this.vmInner().diagnosticsProfile() != null - && this.vmInner().diagnosticsProfile().bootDiagnostics() != null - && this.vmInner().diagnosticsProfile().bootDiagnostics().enabled() != null) { - return this.vmInner().diagnosticsProfile().bootDiagnostics().enabled(); - } - return false; - } - - public String bootDiagnosticsStorageUri() { - // Even though diagnostics can disabled azure still keep the storage uri - if (this.vmInner().diagnosticsProfile() != null - && this.vmInner().diagnosticsProfile().bootDiagnostics() != null) { - return this.vmInner().diagnosticsProfile().bootDiagnostics().storageUri(); - } - return null; - } - - BootDiagnosticsHandler withBootDiagnostics(boolean useManagedStorageAccount) { - // Diagnostics storage uri will be set later by this.handleDiagnosticsSettings(..) - this.enableDisable(true); - this.useManagedStorageAccount = useManagedStorageAccount; - return this; - } - - BootDiagnosticsHandler withBootDiagnostics(Creatable creatable) { - // Diagnostics storage uri will be set later by this.handleDiagnosticsSettings(..) - this.enableDisable(true); - this.useManagedStorageAccount = false; - this.creatableDiagnosticsStorageAccountKey = this.vmImpl.addDependency(creatable); - return this; - } - - BootDiagnosticsHandler withBootDiagnostics(String storageAccountBlobEndpointUri) { - this.enableDisable(true); - this.useManagedStorageAccount = false; - this.vmInner().diagnosticsProfile().bootDiagnostics().withStorageUri(storageAccountBlobEndpointUri); - return this; - } - - BootDiagnosticsHandler withBootDiagnostics(StorageAccount storageAccount) { - return this.withBootDiagnostics(storageAccount.endPoints().primary().blob()); - } - - BootDiagnosticsHandler withoutBootDiagnostics() { - this.enableDisable(false); - this.useManagedStorageAccount = false; - return this; - } - - void prepare() { - if (useManagedStorageAccount) { - return; - } - - DiagnosticsProfile diagnosticsProfile = this.vmInner().diagnosticsProfile(); - if (diagnosticsProfile == null - || diagnosticsProfile.bootDiagnostics() == null - || diagnosticsProfile.bootDiagnostics().storageUri() != null) { - return; - } - boolean enableBD = ResourceManagerUtils.toPrimitiveBoolean(diagnosticsProfile.bootDiagnostics().enabled()); - if (!enableBD) { - return; - } - if (this.creatableDiagnosticsStorageAccountKey != null - || this.vmImpl.creatableStorageAccountKey != null - || this.vmImpl.existingStorageAccountToAssociate != null) { - return; - } - String accountName = this.vmImpl.namer.getRandomName("stg", 24).replace("-", ""); - Creatable storageAccountCreatable; - if (this.vmImpl.creatableGroup != null) { - storageAccountCreatable = - this - .vmImpl - .storageManager - .storageAccounts() - .define(accountName) - .withRegion(this.vmImpl.regionName()) - .withNewResourceGroup(this.vmImpl.creatableGroup); - } else { - storageAccountCreatable = - this - .vmImpl - .storageManager - .storageAccounts() - .define(accountName) - .withRegion(this.vmImpl.regionName()) - .withExistingResourceGroup(this.vmImpl.resourceGroupName()); - } - this.creatableDiagnosticsStorageAccountKey = this.vmImpl.addDependency(storageAccountCreatable); - } - - void handleDiagnosticsSettings() { - if (useManagedStorageAccount) { - return; - } - - DiagnosticsProfile diagnosticsProfile = this.vmInner().diagnosticsProfile(); - if (diagnosticsProfile == null - || diagnosticsProfile.bootDiagnostics() == null - || diagnosticsProfile.bootDiagnostics().storageUri() != null) { - return; - } - boolean enableBD = ResourceManagerUtils.toPrimitiveBoolean(diagnosticsProfile.bootDiagnostics().enabled()); - if (!enableBD) { - return; - } - StorageAccount storageAccount = null; - if (creatableDiagnosticsStorageAccountKey != null) { - storageAccount = this.vmImpl.taskResult(creatableDiagnosticsStorageAccountKey); - } else if (this.vmImpl.creatableStorageAccountKey != null) { - storageAccount = this.vmImpl.taskResult(this.vmImpl.creatableStorageAccountKey); - } else if (this.vmImpl.existingStorageAccountToAssociate != null) { - storageAccount = this.vmImpl.existingStorageAccountToAssociate; - } - if (storageAccount == null) { - throw logger - .logExceptionAsError( - new IllegalStateException( - "Unable to retrieve expected storageAccount instance for BootDiagnostics")); - } - vmInner() - .diagnosticsProfile() - .bootDiagnostics() - .withStorageUri(storageAccount.endPoints().primary().blob()); - } - - private VirtualMachineInner vmInner() { - // Inner cannot be cached as parent VirtualMachineImpl can refresh the inner in various cases - return this.vmImpl.innerModel(); - } - - private void enableDisable(boolean enable) { - if (this.vmInner().diagnosticsProfile() == null) { - this.vmInner().withDiagnosticsProfile(new DiagnosticsProfile()); - } - if (this.vmInner().diagnosticsProfile().bootDiagnostics() == null) { - this.vmInner().diagnosticsProfile().withBootDiagnostics(new BootDiagnostics()); - } - if (enable) { - this.vmInner().diagnosticsProfile().bootDiagnostics().withEnabled(true); - } else { - this.vmInner().diagnosticsProfile().bootDiagnostics().withEnabled(false); - this.vmInner().diagnosticsProfile().bootDiagnostics().withStorageUri(null); - } - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineInstanceViewImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineInstanceViewImpl.java deleted file mode 100644 index 550871140a45..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineInstanceViewImpl.java +++ /dev/null @@ -1,144 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.compute.implementation; - -import com.azure.resourcemanager.compute.models.BootDiagnosticsInstanceView; -import com.azure.resourcemanager.compute.models.DiskInstanceView; -import com.azure.resourcemanager.compute.models.InstanceViewStatus; -import com.azure.resourcemanager.compute.models.MaintenanceRedeployStatus; -import com.azure.resourcemanager.compute.models.VirtualMachineAgentInstanceView; -import com.azure.resourcemanager.compute.models.VirtualMachineExtensionInstanceView; -import com.azure.resourcemanager.compute.models.VirtualMachineInstanceView; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineInstanceViewInner; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.WrapperImpl; -import java.util.List; - -/** The implementation of ComputeUsage. */ -class VirtualMachineInstanceViewImpl extends WrapperImpl - implements VirtualMachineInstanceView { - VirtualMachineInstanceViewImpl(VirtualMachineInstanceViewInner innerObject) { - super(innerObject); - } - - /** - * Get specifies the update domain of the virtual machine. - * - * @return the platformUpdateDomain value - */ - @Override - public int platformUpdateDomain() { - return innerModel().platformUpdateDomain() == null ? 0 : innerModel().platformUpdateDomain(); - } - - /** - * Get specifies the fault domain of the virtual machine. - * - * @return the platformFaultDomain value - */ - @Override - public int platformFaultDomain() { - return innerModel().platformFaultDomain() == null ? 0 : innerModel().platformFaultDomain(); - } - - /** - * Get the computer name assigned to the virtual machine. - * - * @return the computerName value - */ - @Override - public String computerName() { - return innerModel().computerName(); - } - - /** - * Get the Operating System running on the virtual machine. - * - * @return the osName value - */ - @Override - public String osName() { - return innerModel().osName(); - } - - /** - * Get the version of Operating System running on the virtual machine. - * - * @return the osVersion value - */ - @Override - public String osVersion() { - return innerModel().osVersion(); - } - - /** - * Get the Remote desktop certificate thumbprint. - * - * @return the rdpThumbPrint value - */ - @Override - public String rdpThumbPrint() { - return innerModel().rdpThumbPrint(); - } - - /** - * Get the VM Agent running on the virtual machine. - * - * @return the vmAgent value - */ - @Override - public VirtualMachineAgentInstanceView vmAgent() { - return innerModel().vmAgent(); - } - - /** - * Get the Maintenance Operation status on the virtual machine. - * - * @return the maintenanceRedeployStatus value - */ - @Override - public MaintenanceRedeployStatus maintenanceRedeployStatus() { - return innerModel().maintenanceRedeployStatus(); - } - - /** - * Get the virtual machine disk information. - * - * @return the disks value - */ - @Override - public List disks() { - return innerModel().disks(); - } - - /** - * Get the extensions information. - * - * @return the extensions value - */ - @Override - public List extensions() { - return innerModel().extensions(); - } - - /** - * Get 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. - * - * @return the bootDiagnostics value - */ - @Override - public BootDiagnosticsInstanceView bootDiagnostics() { - return innerModel().bootDiagnostics(); - } - - /** - * Get the resource status information. - * - * @return the statuses value - */ - @Override - public List statuses() { - return innerModel().statuses(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineMsiHandler.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineMsiHandler.java deleted file mode 100644 index 6923a8967cfe..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineMsiHandler.java +++ /dev/null @@ -1,275 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.implementation; - -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.models.ResourceIdentityType; -import com.azure.resourcemanager.compute.models.VirtualMachineIdentity; -import com.azure.resourcemanager.compute.models.VirtualMachineIdentityUserAssignedIdentities; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineInner; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineUpdateInner; -import com.azure.resourcemanager.authorization.AuthorizationManager; -import com.azure.resourcemanager.authorization.utils.RoleAssignmentHelper; -import com.azure.resourcemanager.msi.models.Identity; -import com.azure.resourcemanager.resources.fluentcore.dag.TaskGroup; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** - * Utility class to set Managed Service Identity (MSI) property on a virtual machine, install or update MSI extension - * and create role assignments for the service principal associated with the virtual machine. - */ -class VirtualMachineMsiHandler extends RoleAssignmentHelper { - private final VirtualMachineImpl virtualMachine; - - private List creatableIdentityKeys; - private Map userAssignedIdentities; - private final ClientLogger logger = new ClientLogger(VirtualMachineMsiHandler.class); - - /** - * Creates VirtualMachineMsiHandler. - * - * @param authorizationManager the graph rbac manager - * @param virtualMachine the virtual machine to which MSI extension needs to be installed and for which role - * assignments needs to be created - */ - VirtualMachineMsiHandler(final AuthorizationManager authorizationManager, VirtualMachineImpl virtualMachine) { - super(authorizationManager, virtualMachine.taskGroup(), virtualMachine.idProvider()); - this.virtualMachine = virtualMachine; - this.creatableIdentityKeys = new ArrayList<>(); - this.userAssignedIdentities = new HashMap<>(); - } - - /** - * Specifies that Local Managed Service Identity needs to be enabled in the virtual machine. If MSI extension is not - * already installed then it will be installed with access token port as 50342. - * - * @return VirtualMachineMsiHandler - */ - VirtualMachineMsiHandler withLocalManagedServiceIdentity() { - this.initVMIdentity(ResourceIdentityType.SYSTEM_ASSIGNED); - return this; - } - - /** - * Specifies that Local Managed Service Identity needs to be disabled in the virtual machine. - * - * @return VirtualMachineMsiHandler - */ - VirtualMachineMsiHandler withoutLocalManagedServiceIdentity() { - if (this.virtualMachine.innerModel().identity() == null - || this.virtualMachine.innerModel().identity().type() == null - || this.virtualMachine.innerModel().identity().type().equals(ResourceIdentityType.NONE) - || this.virtualMachine.innerModel().identity().type().equals(ResourceIdentityType.USER_ASSIGNED)) { - return this; - } else if (this.virtualMachine.innerModel().identity().type().equals(ResourceIdentityType.SYSTEM_ASSIGNED)) { - this.virtualMachine.innerModel().identity().withType(ResourceIdentityType.NONE); - } else if (this - .virtualMachine - .innerModel() - .identity() - .type() - .equals(ResourceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED)) { - this.virtualMachine.innerModel().identity().withType(ResourceIdentityType.USER_ASSIGNED); - } - return this; - } - - /** - * Specifies that given identity should be set as one of the External Managed Service Identity of the virtual - * machine. - * - * @param creatableIdentity yet-to-be-created identity to be associated with the virtual machine - * @return VirtualMachineMsiHandler - */ - VirtualMachineMsiHandler withNewExternalManagedServiceIdentity(Creatable creatableIdentity) { - this.initVMIdentity(ResourceIdentityType.USER_ASSIGNED); - - TaskGroup.HasTaskGroup dependency = (TaskGroup.HasTaskGroup) creatableIdentity; - Objects.requireNonNull(dependency); - - this.virtualMachine.taskGroup().addDependency(dependency); - this.creatableIdentityKeys.add(creatableIdentity.key()); - - return this; - } - - /** - * Specifies that given identity should be set as one of the External Managed Service Identity of the virtual - * machine. - * - * @param identity an identity to associate - * @return VirtualMachineMsiHandler - */ - VirtualMachineMsiHandler withExistingExternalManagedServiceIdentity(Identity identity) { - this.initVMIdentity(ResourceIdentityType.USER_ASSIGNED); - this.userAssignedIdentities.put(identity.id(), new VirtualMachineIdentityUserAssignedIdentities()); - return this; - } - - /** - * Specifies that given identity should be removed from the list of External Managed Service Identity associated - * with the virtual machine machine. - * - * @param identityId resource id of the identity - * @return VirtualMachineMsiHandler - */ - VirtualMachineMsiHandler withoutExternalManagedServiceIdentity(String identityId) { - // mark as to be removed - this.userAssignedIdentities.put(identityId, null); - return this; - } - - void processCreatedExternalIdentities() { - for (String key : this.creatableIdentityKeys) { - Identity identity = (Identity) this.virtualMachine.taskGroup().taskResult(key); - Objects.requireNonNull(identity); - this.userAssignedIdentities.put(identity.id(), new VirtualMachineIdentityUserAssignedIdentities()); - } - this.creatableIdentityKeys.clear(); - } - - void handleExternalIdentities() { - if (!this.userAssignedIdentities.isEmpty()) { - this.virtualMachine.innerModel().identity().withUserAssignedIdentities(this.userAssignedIdentities); - } - } - - void handleExternalIdentities(VirtualMachineUpdateInner vmUpdate) { - if (this.handleRemoveAllExternalIdentitiesCase(vmUpdate)) { - return; - } else { - // At this point one of the following condition is met: - // - // 1. User don't want touch the 'VM.Identity.userAssignedIdentities' property - // [this.userAssignedIdentities.empty() == true] - // 2. User want to add some identities to 'VM.Identity.userAssignedIdentities' - // [this.userAssignedIdentities.empty() == false and this.virtualMachine.inner().identity() != null] - // 3. User want to remove some (not all) identities in 'VM.Identity.userAssignedIdentities' - // [this.userAssignedIdentities.empty() == false and this.virtualMachine.inner().identity() != null] - // Note: The scenario where this.virtualMachine.inner().identity() is null in #3 is already handled in - // handleRemoveAllExternalIdentitiesCase method - // 4. User want to add and remove (all or subset) some identities in 'VM.Identity.userAssignedIdentities' - // [this.userAssignedIdentities.empty() == false and this.virtualMachine.inner().identity() != null] - // - VirtualMachineIdentity currentIdentity = this.virtualMachine.innerModel().identity(); - vmUpdate.withIdentity(currentIdentity); - if (!this.userAssignedIdentities.isEmpty()) { - // At this point its guaranteed that 'currentIdentity' is not null so vmUpdate.identity() is. - vmUpdate.identity().withUserAssignedIdentities(this.userAssignedIdentities); - } else { - // User don't want to touch 'VM.Identity.userAssignedIdentities' property - if (currentIdentity != null) { - // and currently there is identity exists or user want to manipulate some other properties of - // identity, set identities to null so that it won't send over wire. - currentIdentity.withUserAssignedIdentities(null); - } - } - } - } - - /** Clear VirtualMachineMsiHandler post-run specific internal state. */ - void clear() { - this.userAssignedIdentities = new HashMap<>(); - } - - /** - * Method that handle the case where user request indicates all it want to do is remove all identities associated - * with the virtual machine. - * - * @param vmUpdate the vm update payload model - * @return true if user indented to remove all the identities. - */ - private boolean handleRemoveAllExternalIdentitiesCase(VirtualMachineUpdateInner vmUpdate) { - if (!this.userAssignedIdentities.isEmpty()) { - int rmCount = 0; - for (VirtualMachineIdentityUserAssignedIdentities v : this.userAssignedIdentities.values()) { - if (v == null) { - rmCount++; - } else { - break; - } - } - boolean containsRemoveOnly = rmCount > 0 && rmCount == this.userAssignedIdentities.size(); - // Check if user request contains only request for removal of identities. - if (containsRemoveOnly) { - Set currentIds = new HashSet<>(); - VirtualMachineIdentity currentIdentity = this.virtualMachine.innerModel().identity(); - if (currentIdentity != null && currentIdentity.userAssignedIdentities() != null) { - for (String id : currentIdentity.userAssignedIdentities().keySet()) { - currentIds.add(id.toLowerCase(Locale.ROOT)); - } - } - Set removeIds = new HashSet<>(); - for (Map.Entry entrySet - : this.userAssignedIdentities.entrySet()) { - if (entrySet.getValue() == null) { - removeIds.add(entrySet.getKey().toLowerCase(Locale.ROOT)); - } - } - // If so check user want to remove all the identities - boolean removeAllCurrentIds = - currentIds.size() == removeIds.size() && currentIds.containsAll(removeIds); - if (removeAllCurrentIds) { - // If so adjust the identity type [Setting type to SYSTEM_ASSIGNED orNONE will remove all the - // identities] - if (currentIdentity == null || currentIdentity.type() == null) { - vmUpdate.withIdentity(new VirtualMachineIdentity().withType(ResourceIdentityType.NONE)); - } else if (currentIdentity.type().equals(ResourceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED)) { - vmUpdate.withIdentity(currentIdentity); - vmUpdate.identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED); - } else if (currentIdentity.type().equals(ResourceIdentityType.USER_ASSIGNED)) { - vmUpdate.withIdentity(currentIdentity); - vmUpdate.identity().withType(ResourceIdentityType.NONE); - } - // and set identities property in the payload model to null so that it won't be sent - vmUpdate.identity().withUserAssignedIdentities(null); - return true; - } else { - // Check user is asking to remove identities though there is no identities currently associated - if (currentIds.size() == 0 && removeIds.size() != 0 && currentIdentity == null) { - // If so we are in a invalid state but we want to send user input to service and let service - // handle it (ignore or error). - vmUpdate.withIdentity(new VirtualMachineIdentity().withType(ResourceIdentityType.NONE)); - vmUpdate.identity().withUserAssignedIdentities(null); - return true; - } - } - } - } - return false; - } - - /** - * Initialize VM's identity property. - * - * @param identityType the identity type to set - */ - private void initVMIdentity(ResourceIdentityType identityType) { - if (!identityType.equals(ResourceIdentityType.USER_ASSIGNED) - && !identityType.equals(ResourceIdentityType.SYSTEM_ASSIGNED)) { - throw logger.logExceptionAsError(new IllegalArgumentException("Invalid argument: " + identityType)); - } - - VirtualMachineInner virtualMachineInner = this.virtualMachine.innerModel(); - if (virtualMachineInner.identity() == null) { - virtualMachineInner.withIdentity(new VirtualMachineIdentity()); - } - if (virtualMachineInner.identity().type() == null - || virtualMachineInner.identity().type().equals(ResourceIdentityType.NONE) - || virtualMachineInner.identity().type().equals(identityType)) { - virtualMachineInner.identity().withType(identityType); - } else { - virtualMachineInner.identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineOfferImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineOfferImpl.java deleted file mode 100644 index a664a71b206a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineOfferImpl.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.compute.implementation; - -import com.azure.resourcemanager.compute.models.VirtualMachineOffer; -import com.azure.resourcemanager.compute.models.VirtualMachinePublisher; -import com.azure.resourcemanager.compute.models.VirtualMachineSkus; -import com.azure.resourcemanager.compute.fluent.VirtualMachineImagesClient; -import com.azure.core.management.Region; - -/** The implementation for {@link VirtualMachineOffer}. */ -class VirtualMachineOfferImpl implements VirtualMachineOffer { - private final VirtualMachinePublisher publisher; - private final String offerName; - private final VirtualMachineSkusImpl skus; - - VirtualMachineOfferImpl(VirtualMachinePublisher publisher, String offer, VirtualMachineImagesClient client) { - this.publisher = publisher; - this.offerName = offer; - this.skus = new VirtualMachineSkusImpl(this, client); - } - - @Override - public Region region() { - return publisher.region(); - } - - @Override - public VirtualMachinePublisher publisher() { - return publisher; - } - - @Override - public String name() { - return this.offerName; - } - - @Override - public VirtualMachineSkus skus() { - return this.skus; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineOffersImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineOffersImpl.java deleted file mode 100644 index 40535a3ecd19..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineOffersImpl.java +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.compute.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.compute.models.VirtualMachineOffer; -import com.azure.resourcemanager.compute.models.VirtualMachineOffers; -import com.azure.resourcemanager.compute.models.VirtualMachinePublisher; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineImageResourceInner; -import com.azure.resourcemanager.compute.fluent.VirtualMachineImagesClient; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.ReadableWrappersImpl; -import com.azure.resourcemanager.resources.fluentcore.utils.PagedConverter; - -/** The implementation for {@link VirtualMachineOffers}. */ -class VirtualMachineOffersImpl - extends ReadableWrappersImpl - implements VirtualMachineOffers { - - private final VirtualMachineImagesClient innerCollection; - private final VirtualMachinePublisher publisher; - - VirtualMachineOffersImpl(VirtualMachineImagesClient innerCollection, VirtualMachinePublisher publisher) { - this.innerCollection = innerCollection; - this.publisher = publisher; - } - - @Override - protected VirtualMachineOfferImpl wrapModel(VirtualMachineImageResourceInner inner) { - if (inner == null) { - return null; - } - return new VirtualMachineOfferImpl(this.publisher, inner.name(), this.innerCollection); - } - - @Override - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - @Override - public PagedFlux listAsync() { - return PagedConverter.mapPage(PagedConverter - .convertListToPagedFlux(innerCollection.listOffersWithResponseAsync( - publisher.region().toString(), publisher.name())), - this::wrapModel); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachinePublisherImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachinePublisherImpl.java deleted file mode 100644 index ab5af7e84b33..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachinePublisherImpl.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.compute.implementation; - -import com.azure.resourcemanager.compute.models.VirtualMachineExtensionImageTypes; -import com.azure.resourcemanager.compute.models.VirtualMachineOffers; -import com.azure.resourcemanager.compute.models.VirtualMachinePublisher; -import com.azure.resourcemanager.compute.fluent.VirtualMachineExtensionImagesClient; -import com.azure.resourcemanager.compute.fluent.VirtualMachineImagesClient; -import com.azure.core.management.Region; - -/** The implementation for {@link VirtualMachinePublisher}. */ -class VirtualMachinePublisherImpl implements VirtualMachinePublisher { - private final Region location; - private final String publisher; - private final VirtualMachineOffers offers; - private final VirtualMachineExtensionImageTypes types; - - VirtualMachinePublisherImpl( - Region location, - String publisher, - VirtualMachineImagesClient imagesClient, - VirtualMachineExtensionImagesClient extensionsClient) { - this.location = location; - this.publisher = publisher; - this.offers = new VirtualMachineOffersImpl(imagesClient, this); - this.types = new VirtualMachineExtensionImageTypesImpl(extensionsClient, this); - } - - @Override - public Region region() { - return location; - } - - @Override - public String name() { - return publisher; - } - - @Override - public VirtualMachineOffers offers() { - return this.offers; - } - - @Override - public VirtualMachineExtensionImageTypes extensionTypes() { - return this.types; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachinePublishersImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachinePublishersImpl.java deleted file mode 100644 index 1961e4423522..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachinePublishersImpl.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.compute.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.compute.models.VirtualMachinePublisher; -import com.azure.resourcemanager.compute.models.VirtualMachinePublishers; -import com.azure.resourcemanager.compute.fluent.VirtualMachineExtensionImagesClient; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineImageResourceInner; -import com.azure.resourcemanager.compute.fluent.VirtualMachineImagesClient; -import com.azure.core.management.Region; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.ReadableWrappersImpl; -import com.azure.resourcemanager.resources.fluentcore.utils.PagedConverter; - -/** The implementation for {@link VirtualMachinePublishers}. */ -public class VirtualMachinePublishersImpl - extends ReadableWrappersImpl - implements VirtualMachinePublishers { - - private final VirtualMachineImagesClient imagesClientCollection; - private final VirtualMachineExtensionImagesClient extensionsInnerCollection; - - public VirtualMachinePublishersImpl( - VirtualMachineImagesClient imagesClientCollection, - VirtualMachineExtensionImagesClient extensionsInnerCollection) { - this.imagesClientCollection = imagesClientCollection; - this.extensionsInnerCollection = extensionsInnerCollection; - } - - @Override - public PagedIterable listByRegion(Region region) { - return listByRegion(region.toString()); - } - - @Override - protected VirtualMachinePublisherImpl wrapModel(VirtualMachineImageResourceInner inner) { - if (inner == null) { - return null; - } - return new VirtualMachinePublisherImpl( - Region.fromName(inner.location()), - inner.name(), - this.imagesClientCollection, - this.extensionsInnerCollection); - } - - @Override - public PagedIterable listByRegion(String regionName) { - return new PagedIterable<>(listByRegionAsync(regionName)); - } - - @Override - public PagedFlux listByRegionAsync(Region region) { - return listByRegionAsync(region.name()); - } - - @Override - public PagedFlux listByRegionAsync(String regionName) { - return PagedConverter.mapPage(PagedConverter - .convertListToPagedFlux(imagesClientCollection.listPublishersWithResponseAsync(regionName)), - this::wrapModel); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineRunCommandsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineRunCommandsClientImpl.java deleted file mode 100644 index ec2b25485a7e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineRunCommandsClientImpl.java +++ /dev/null @@ -1,1936 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.compute.fluent.VirtualMachineRunCommandsClient; -import com.azure.resourcemanager.compute.fluent.models.RunCommandDocumentBaseInner; -import com.azure.resourcemanager.compute.fluent.models.RunCommandDocumentInner; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineRunCommandInner; -import com.azure.resourcemanager.compute.models.ApiErrorException; -import com.azure.resourcemanager.compute.models.RunCommandListResult; -import com.azure.resourcemanager.compute.models.VirtualMachineRunCommandUpdate; -import com.azure.resourcemanager.compute.models.VirtualMachineRunCommandsListResult; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in VirtualMachineRunCommandsClient. */ -public final class VirtualMachineRunCommandsClientImpl implements VirtualMachineRunCommandsClient { - private final ClientLogger logger = new ClientLogger(VirtualMachineRunCommandsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final VirtualMachineRunCommandsService service; - - /** The service client containing this operation class. */ - private final ComputeManagementClientImpl client; - - /** - * Initializes an instance of VirtualMachineRunCommandsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - VirtualMachineRunCommandsClientImpl(ComputeManagementClientImpl client) { - this.service = - RestProxy - .create( - VirtualMachineRunCommandsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for ComputeManagementClientVirtualMachineRunCommands to be used by the - * proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "ComputeManagementCli") - private interface VirtualMachineRunCommandsService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/runCommands") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("location") String location, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/runCommands/{commandId}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("location") String location, - @PathParam("commandId") String commandId, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachines/{vmName}/runCommands/{runCommandName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmName") String vmName, - @PathParam("runCommandName") String runCommandName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VirtualMachineRunCommandInner runCommand, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachines/{vmName}/runCommands/{runCommandName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono>> update( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmName") String vmName, - @PathParam("runCommandName") String runCommandName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VirtualMachineRunCommandUpdate runCommand, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachines/{vmName}/runCommands/{runCommandName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmName") String vmName, - @PathParam("runCommandName") String runCommandName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachines/{vmName}/runCommands/{runCommandName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> getByVirtualMachine( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmName") String vmName, - @PathParam("runCommandName") String runCommandName, - @QueryParam("$expand") String expand, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachines/{vmName}/runCommands") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> listByVirtualMachine( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmName") String vmName, - @QueryParam("$expand") String expand, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> listByVirtualMachineNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Lists all available run commands for a subscription in a location. - * - * @param location The location upon which run commands is queried. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Virtual Machine operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String location) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - location, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all available run commands for a subscription in a location. - * - * @param location The location upon which run commands is queried. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Virtual Machine operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String location, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), location, apiVersion, this.client.getSubscriptionId(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists all available run commands for a subscription in a location. - * - * @param location The location upon which run commands is queried. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Virtual Machine operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String location) { - return new PagedFlux<>(() -> listSinglePageAsync(location), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists all available run commands for a subscription in a location. - * - * @param location The location upon which run commands is queried. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Virtual Machine operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String location, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(location, context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all available run commands for a subscription in a location. - * - * @param location The location upon which run commands is queried. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Virtual Machine operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String location) { - return new PagedIterable<>(listAsync(location)); - } - - /** - * Lists all available run commands for a subscription in a location. - * - * @param location The location upon which run commands is queried. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Virtual Machine operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String location, Context context) { - return new PagedIterable<>(listAsync(location, context)); - } - - /** - * Gets specific run command for a subscription in a location. - * - * @param location The location upon which run commands is queried. - * @param commandId The command id. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specific run command for a subscription in a location. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync(String location, String commandId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (commandId == null) { - return Mono.error(new IllegalArgumentException("Parameter commandId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - location, - commandId, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets specific run command for a subscription in a location. - * - * @param location The location upon which run commands is queried. - * @param commandId The command id. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specific run command for a subscription in a location. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String location, String commandId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (commandId == null) { - return Mono.error(new IllegalArgumentException("Parameter commandId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - location, - commandId, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets specific run command for a subscription in a location. - * - * @param location The location upon which run commands is queried. - * @param commandId The command id. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specific run command for a subscription in a location. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync(String location, String commandId) { - return getWithResponseAsync(location, commandId) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets specific run command for a subscription in a location. - * - * @param location The location upon which run commands is queried. - * @param commandId The command id. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specific run command for a subscription in a location. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RunCommandDocumentInner get(String location, String commandId) { - return getAsync(location, commandId).block(); - } - - /** - * Gets specific run command for a subscription in a location. - * - * @param location The location upon which run commands is queried. - * @param commandId The command id. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specific run command for a subscription in a location. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String location, String commandId, Context context) { - return getWithResponseAsync(location, commandId, context).block(); - } - - /** - * The operation to create or update the run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the run command should be created or updated. - * @param runCommandName The name of the virtual machine run command. - * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String vmName, String runCommandName, VirtualMachineRunCommandInner runCommand) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (runCommandName == null) { - return Mono.error(new IllegalArgumentException("Parameter runCommandName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (runCommand == null) { - return Mono.error(new IllegalArgumentException("Parameter runCommand is required and cannot be null.")); - } else { - runCommand.validate(); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - vmName, - runCommandName, - apiVersion, - this.client.getSubscriptionId(), - runCommand, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * The operation to create or update the run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the run command should be created or updated. - * @param runCommandName The name of the virtual machine run command. - * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String vmName, - String runCommandName, - VirtualMachineRunCommandInner runCommand, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (runCommandName == null) { - return Mono.error(new IllegalArgumentException("Parameter runCommandName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (runCommand == null) { - return Mono.error(new IllegalArgumentException("Parameter runCommand is required and cannot be null.")); - } else { - runCommand.validate(); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - vmName, - runCommandName, - apiVersion, - this.client.getSubscriptionId(), - runCommand, - accept, - context); - } - - /** - * The operation to create or update the run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the run command should be created or updated. - * @param runCommandName The name of the virtual machine run command. - * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, VirtualMachineRunCommandInner> - beginCreateOrUpdateAsync( - String resourceGroupName, String vmName, String runCommandName, VirtualMachineRunCommandInner runCommand) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, vmName, runCommandName, runCommand); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VirtualMachineRunCommandInner.class, - VirtualMachineRunCommandInner.class, - Context.NONE); - } - - /** - * The operation to create or update the run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the run command should be created or updated. - * @param runCommandName The name of the virtual machine run command. - * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, VirtualMachineRunCommandInner> - beginCreateOrUpdateAsync( - String resourceGroupName, - String vmName, - String runCommandName, - VirtualMachineRunCommandInner runCommand, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, vmName, runCommandName, runCommand, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VirtualMachineRunCommandInner.class, - VirtualMachineRunCommandInner.class, - context); - } - - /** - * The operation to create or update the run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the run command should be created or updated. - * @param runCommandName The name of the virtual machine run command. - * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VirtualMachineRunCommandInner> beginCreateOrUpdate( - String resourceGroupName, String vmName, String runCommandName, VirtualMachineRunCommandInner runCommand) { - return beginCreateOrUpdateAsync(resourceGroupName, vmName, runCommandName, runCommand).getSyncPoller(); - } - - /** - * The operation to create or update the run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the run command should be created or updated. - * @param runCommandName The name of the virtual machine run command. - * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VirtualMachineRunCommandInner> beginCreateOrUpdate( - String resourceGroupName, - String vmName, - String runCommandName, - VirtualMachineRunCommandInner runCommand, - Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, vmName, runCommandName, runCommand, context).getSyncPoller(); - } - - /** - * The operation to create or update the run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the run command should be created or updated. - * @param runCommandName The name of the virtual machine run command. - * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, String vmName, String runCommandName, VirtualMachineRunCommandInner runCommand) { - return beginCreateOrUpdateAsync(resourceGroupName, vmName, runCommandName, runCommand) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * The operation to create or update the run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the run command should be created or updated. - * @param runCommandName The name of the virtual machine run command. - * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, - String vmName, - String runCommandName, - VirtualMachineRunCommandInner runCommand, - Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, vmName, runCommandName, runCommand, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * The operation to create or update the run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the run command should be created or updated. - * @param runCommandName The name of the virtual machine run command. - * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineRunCommandInner createOrUpdate( - String resourceGroupName, String vmName, String runCommandName, VirtualMachineRunCommandInner runCommand) { - return createOrUpdateAsync(resourceGroupName, vmName, runCommandName, runCommand).block(); - } - - /** - * The operation to create or update the run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the run command should be created or updated. - * @param runCommandName The name of the virtual machine run command. - * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineRunCommandInner createOrUpdate( - String resourceGroupName, - String vmName, - String runCommandName, - VirtualMachineRunCommandInner runCommand, - Context context) { - return createOrUpdateAsync(resourceGroupName, vmName, runCommandName, runCommand, context).block(); - } - - /** - * The operation to update the run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the run command should be updated. - * @param runCommandName The name of the virtual machine run command. - * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateWithResponseAsync( - String resourceGroupName, String vmName, String runCommandName, VirtualMachineRunCommandUpdate runCommand) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (runCommandName == null) { - return Mono.error(new IllegalArgumentException("Parameter runCommandName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (runCommand == null) { - return Mono.error(new IllegalArgumentException("Parameter runCommand is required and cannot be null.")); - } else { - runCommand.validate(); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - resourceGroupName, - vmName, - runCommandName, - apiVersion, - this.client.getSubscriptionId(), - runCommand, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * The operation to update the run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the run command should be updated. - * @param runCommandName The name of the virtual machine run command. - * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, - String vmName, - String runCommandName, - VirtualMachineRunCommandUpdate runCommand, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (runCommandName == null) { - return Mono.error(new IllegalArgumentException("Parameter runCommandName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (runCommand == null) { - return Mono.error(new IllegalArgumentException("Parameter runCommand is required and cannot be null.")); - } else { - runCommand.validate(); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - resourceGroupName, - vmName, - runCommandName, - apiVersion, - this.client.getSubscriptionId(), - runCommand, - accept, - context); - } - - /** - * The operation to update the run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the run command should be updated. - * @param runCommandName The name of the virtual machine run command. - * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, VirtualMachineRunCommandInner> beginUpdateAsync( - String resourceGroupName, String vmName, String runCommandName, VirtualMachineRunCommandUpdate runCommand) { - Mono>> mono = - updateWithResponseAsync(resourceGroupName, vmName, runCommandName, runCommand); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VirtualMachineRunCommandInner.class, - VirtualMachineRunCommandInner.class, - Context.NONE); - } - - /** - * The operation to update the run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the run command should be updated. - * @param runCommandName The name of the virtual machine run command. - * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, VirtualMachineRunCommandInner> beginUpdateAsync( - String resourceGroupName, - String vmName, - String runCommandName, - VirtualMachineRunCommandUpdate runCommand, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - updateWithResponseAsync(resourceGroupName, vmName, runCommandName, runCommand, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VirtualMachineRunCommandInner.class, - VirtualMachineRunCommandInner.class, - context); - } - - /** - * The operation to update the run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the run command should be updated. - * @param runCommandName The name of the virtual machine run command. - * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VirtualMachineRunCommandInner> beginUpdate( - String resourceGroupName, String vmName, String runCommandName, VirtualMachineRunCommandUpdate runCommand) { - return beginUpdateAsync(resourceGroupName, vmName, runCommandName, runCommand).getSyncPoller(); - } - - /** - * The operation to update the run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the run command should be updated. - * @param runCommandName The name of the virtual machine run command. - * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VirtualMachineRunCommandInner> beginUpdate( - String resourceGroupName, - String vmName, - String runCommandName, - VirtualMachineRunCommandUpdate runCommand, - Context context) { - return beginUpdateAsync(resourceGroupName, vmName, runCommandName, runCommand, context).getSyncPoller(); - } - - /** - * The operation to update the run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the run command should be updated. - * @param runCommandName The name of the virtual machine run command. - * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync( - String resourceGroupName, String vmName, String runCommandName, VirtualMachineRunCommandUpdate runCommand) { - return beginUpdateAsync(resourceGroupName, vmName, runCommandName, runCommand) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * The operation to update the run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the run command should be updated. - * @param runCommandName The name of the virtual machine run command. - * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, - String vmName, - String runCommandName, - VirtualMachineRunCommandUpdate runCommand, - Context context) { - return beginUpdateAsync(resourceGroupName, vmName, runCommandName, runCommand, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * The operation to update the run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the run command should be updated. - * @param runCommandName The name of the virtual machine run command. - * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineRunCommandInner update( - String resourceGroupName, String vmName, String runCommandName, VirtualMachineRunCommandUpdate runCommand) { - return updateAsync(resourceGroupName, vmName, runCommandName, runCommand).block(); - } - - /** - * The operation to update the run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the run command should be updated. - * @param runCommandName The name of the virtual machine run command. - * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineRunCommandInner update( - String resourceGroupName, - String vmName, - String runCommandName, - VirtualMachineRunCommandUpdate runCommand, - Context context) { - return updateAsync(resourceGroupName, vmName, runCommandName, runCommand, context).block(); - } - - /** - * The operation to delete the run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the run command should be deleted. - * @param runCommandName The name of the virtual machine run command. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync( - String resourceGroupName, String vmName, String runCommandName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (runCommandName == null) { - return Mono.error(new IllegalArgumentException("Parameter runCommandName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - vmName, - runCommandName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * The operation to delete the run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the run command should be deleted. - * @param runCommandName The name of the virtual machine run command. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String vmName, String runCommandName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (runCommandName == null) { - return Mono.error(new IllegalArgumentException("Parameter runCommandName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - vmName, - runCommandName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * The operation to delete the run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the run command should be deleted. - * @param runCommandName The name of the virtual machine run command. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String vmName, String runCommandName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, vmName, runCommandName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * The operation to delete the run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the run command should be deleted. - * @param runCommandName The name of the virtual machine run command. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String vmName, String runCommandName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, vmName, runCommandName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * The operation to delete the run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the run command should be deleted. - * @param runCommandName The name of the virtual machine run command. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String vmName, String runCommandName) { - return beginDeleteAsync(resourceGroupName, vmName, runCommandName).getSyncPoller(); - } - - /** - * The operation to delete the run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the run command should be deleted. - * @param runCommandName The name of the virtual machine run command. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String vmName, String runCommandName, Context context) { - return beginDeleteAsync(resourceGroupName, vmName, runCommandName, context).getSyncPoller(); - } - - /** - * The operation to delete the run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the run command should be deleted. - * @param runCommandName The name of the virtual machine run command. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String vmName, String runCommandName) { - return beginDeleteAsync(resourceGroupName, vmName, runCommandName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * The operation to delete the run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the run command should be deleted. - * @param runCommandName The name of the virtual machine run command. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String vmName, String runCommandName, Context context) { - return beginDeleteAsync(resourceGroupName, vmName, runCommandName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * The operation to delete the run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the run command should be deleted. - * @param runCommandName The name of the virtual machine run command. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String vmName, String runCommandName) { - deleteAsync(resourceGroupName, vmName, runCommandName).block(); - } - - /** - * The operation to delete the run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the run command should be deleted. - * @param runCommandName The name of the virtual machine run command. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String vmName, String runCommandName, Context context) { - deleteAsync(resourceGroupName, vmName, runCommandName, context).block(); - } - - /** - * The operation to get the run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine containing the run command. - * @param runCommandName The name of the virtual machine run command. - * @param expand The expand expression to apply on the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByVirtualMachineWithResponseAsync( - String resourceGroupName, String vmName, String runCommandName, String expand) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (runCommandName == null) { - return Mono.error(new IllegalArgumentException("Parameter runCommandName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .getByVirtualMachine( - this.client.getEndpoint(), - resourceGroupName, - vmName, - runCommandName, - expand, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * The operation to get the run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine containing the run command. - * @param runCommandName The name of the virtual machine run command. - * @param expand The expand expression to apply on the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByVirtualMachineWithResponseAsync( - String resourceGroupName, String vmName, String runCommandName, String expand, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (runCommandName == null) { - return Mono.error(new IllegalArgumentException("Parameter runCommandName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .getByVirtualMachine( - this.client.getEndpoint(), - resourceGroupName, - vmName, - runCommandName, - expand, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * The operation to get the run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine containing the run command. - * @param runCommandName The name of the virtual machine run command. - * @param expand The expand expression to apply on the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByVirtualMachineAsync( - String resourceGroupName, String vmName, String runCommandName, String expand) { - return getByVirtualMachineWithResponseAsync(resourceGroupName, vmName, runCommandName, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * The operation to get the run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine containing the run command. - * @param runCommandName The name of the virtual machine run command. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByVirtualMachineAsync( - String resourceGroupName, String vmName, String runCommandName) { - final String expand = null; - return getByVirtualMachineWithResponseAsync(resourceGroupName, vmName, runCommandName, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * The operation to get the run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine containing the run command. - * @param runCommandName The name of the virtual machine run command. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineRunCommandInner getByVirtualMachine( - String resourceGroupName, String vmName, String runCommandName) { - final String expand = null; - return getByVirtualMachineAsync(resourceGroupName, vmName, runCommandName, expand).block(); - } - - /** - * The operation to get the run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine containing the run command. - * @param runCommandName The name of the virtual machine run command. - * @param expand The expand expression to apply on the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByVirtualMachineWithResponse( - String resourceGroupName, String vmName, String runCommandName, String expand, Context context) { - return getByVirtualMachineWithResponseAsync(resourceGroupName, vmName, runCommandName, expand, context).block(); - } - - /** - * The operation to get all run commands of a Virtual Machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine containing the run command. - * @param expand The expand expression to apply on the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List run command operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByVirtualMachineSinglePageAsync( - String resourceGroupName, String vmName, String expand) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .listByVirtualMachine( - this.client.getEndpoint(), - resourceGroupName, - vmName, - expand, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * The operation to get all run commands of a Virtual Machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine containing the run command. - * @param expand The expand expression to apply on the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List run command operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByVirtualMachineSinglePageAsync( - String resourceGroupName, String vmName, String expand, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .listByVirtualMachine( - this.client.getEndpoint(), - resourceGroupName, - vmName, - expand, - apiVersion, - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * The operation to get all run commands of a Virtual Machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine containing the run command. - * @param expand The expand expression to apply on the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List run command operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByVirtualMachineAsync( - String resourceGroupName, String vmName, String expand) { - return new PagedFlux<>( - () -> listByVirtualMachineSinglePageAsync(resourceGroupName, vmName, expand), - nextLink -> listByVirtualMachineNextSinglePageAsync(nextLink)); - } - - /** - * The operation to get all run commands of a Virtual Machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine containing the run command. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List run command operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByVirtualMachineAsync(String resourceGroupName, String vmName) { - final String expand = null; - return new PagedFlux<>( - () -> listByVirtualMachineSinglePageAsync(resourceGroupName, vmName, expand), - nextLink -> listByVirtualMachineNextSinglePageAsync(nextLink)); - } - - /** - * The operation to get all run commands of a Virtual Machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine containing the run command. - * @param expand The expand expression to apply on the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List run command operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByVirtualMachineAsync( - String resourceGroupName, String vmName, String expand, Context context) { - return new PagedFlux<>( - () -> listByVirtualMachineSinglePageAsync(resourceGroupName, vmName, expand, context), - nextLink -> listByVirtualMachineNextSinglePageAsync(nextLink, context)); - } - - /** - * The operation to get all run commands of a Virtual Machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine containing the run command. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List run command operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByVirtualMachine(String resourceGroupName, String vmName) { - final String expand = null; - return new PagedIterable<>(listByVirtualMachineAsync(resourceGroupName, vmName, expand)); - } - - /** - * The operation to get all run commands of a Virtual Machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine containing the run command. - * @param expand The expand expression to apply on the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List run command operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByVirtualMachine( - String resourceGroupName, String vmName, String expand, Context context) { - return new PagedIterable<>(listByVirtualMachineAsync(resourceGroupName, vmName, expand, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Virtual Machine operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Virtual Machine operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List run command operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByVirtualMachineNextSinglePageAsync( - String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> service.listByVirtualMachineNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List run command operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByVirtualMachineNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .listByVirtualMachineNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineScaleSetExtensionImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineScaleSetExtensionImpl.java deleted file mode 100644 index a4d38cd92d99..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineScaleSetExtensionImpl.java +++ /dev/null @@ -1,179 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.compute.implementation; - -import com.azure.resourcemanager.compute.models.VirtualMachineExtensionImage; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSet; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetExtension; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineScaleSetExtensionInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.ChildResourceImpl; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.Collections; -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.Map; - -/** Implementation of {@link VirtualMachineScaleSetExtension}. */ -public class VirtualMachineScaleSetExtensionImpl - extends ChildResourceImpl - implements VirtualMachineScaleSetExtension, - VirtualMachineScaleSetExtension.Definition, - VirtualMachineScaleSetExtension.UpdateDefinition, - VirtualMachineScaleSetExtension.Update { - - protected VirtualMachineScaleSetExtensionImpl( - VirtualMachineScaleSetExtensionInner inner, VirtualMachineScaleSetImpl parent) { - super(inner, parent); - } - - // Getters - // - @Override - public String name() { - return this.innerModel().name(); - } - - @Override - public String publisherName() { - return this.innerModel().publisher(); - } - - @Override - public String typeName() { - return this.innerModel().type(); - } - - @Override - public String versionName() { - return this.innerModel().typeHandlerVersion(); - } - - @Override - public boolean autoUpgradeMinorVersionEnabled() { - return this.innerModel().autoUpgradeMinorVersion(); - } - - @Override - @SuppressWarnings("unchecked") - public Map publicSettings() { - if (this.innerModel().settings() == null) { - return Collections.unmodifiableMap(new LinkedHashMap()); - } - return Collections.unmodifiableMap((LinkedHashMap) this.innerModel().settings()); - } - - @Override - public String publicSettingsAsJsonString() { - ObjectMapper mapper = new ObjectMapper(); - try { - return mapper.writeValueAsString(this.publicSettings()); - } catch (JsonProcessingException jex) { - return null; - } - } - - @Override - public String provisioningState() { - return this.innerModel().provisioningState(); - } - - // Withers - // - - @Override - public VirtualMachineScaleSetExtensionImpl withMinorVersionAutoUpgrade() { - this.innerModel().withAutoUpgradeMinorVersion(true); - return this; - } - - @Override - public VirtualMachineScaleSetExtensionImpl withoutMinorVersionAutoUpgrade() { - this.innerModel().withAutoUpgradeMinorVersion(false); - return this; - } - - @Override - public VirtualMachineScaleSetExtensionImpl withImage(VirtualMachineExtensionImage image) { - this - .innerModel() - .withPublisher(image.publisherName()) - .withTypePropertiesType(image.typeName()) - .withTypeHandlerVersion(image.versionName()); - return this; - } - - @Override - public VirtualMachineScaleSetExtensionImpl withPublisher(String extensionImagePublisherName) { - this.innerModel().withPublisher(extensionImagePublisherName); - return this; - } - - @Override - public VirtualMachineScaleSetExtensionImpl withPublicSetting(String key, Object value) { - this.ensurePublicSettings().put(key, value); - return this; - } - - @Override - public VirtualMachineScaleSetExtensionImpl withProtectedSetting(String key, Object value) { - this.ensureProtectedSettings().put(key, value); - return this; - } - - @Override - public VirtualMachineScaleSetExtensionImpl withPublicSettings(HashMap settings) { - this.ensurePublicSettings().clear(); - this.ensurePublicSettings().putAll(settings); - return this; - } - - @Override - public VirtualMachineScaleSetExtensionImpl withProtectedSettings(HashMap settings) { - this.ensureProtectedSettings().clear(); - this.ensureProtectedSettings().putAll(settings); - return this; - } - - @Override - public VirtualMachineScaleSetExtensionImpl withType(String extensionImageTypeName) { - this.innerModel().withTypePropertiesType(extensionImageTypeName); - return this; - } - - @Override - public VirtualMachineScaleSetExtensionImpl withVersion(String extensionImageVersionName) { - this.innerModel().withTypeHandlerVersion(extensionImageVersionName); - return this; - } - - @Override - public VirtualMachineScaleSetImpl attach() { - return this.parent().withExtension(this); - } - - // - // Note: Internal handling of VMSS extensions are different from VM extension. - // VM extensions are external child resources so only new, added or updated extensions will be committed. - // - // VMSS extensions are inline child resources hence all extensions are always part of VMSS PUT payload - // i.e including the one that user didn't choose to update. ensurePublicSettings and ensureProtectedSettings - // are used to ensure we initialize settings/protectedSettings of an extension only if user choose to update - // it. - // - @SuppressWarnings("unchecked") - private HashMap ensurePublicSettings() { - if (this.innerModel().settings() == null) { - this.innerModel().withSettings(new LinkedHashMap()); - } - return (LinkedHashMap) this.innerModel().settings(); - } - - @SuppressWarnings("unchecked") - private HashMap ensureProtectedSettings() { - if (this.innerModel().protectedSettings() == null) { - this.innerModel().withProtectedSettings(new LinkedHashMap()); - } - return (LinkedHashMap) this.innerModel().protectedSettings(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineScaleSetExtensionsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineScaleSetExtensionsClientImpl.java deleted file mode 100644 index d3c9d125df1b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineScaleSetExtensionsClientImpl.java +++ /dev/null @@ -1,1553 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.compute.fluent.VirtualMachineScaleSetExtensionsClient; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineScaleSetExtensionInner; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetExtensionListResult; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetExtensionUpdate; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in VirtualMachineScaleSetExtensionsClient. - */ -public final class VirtualMachineScaleSetExtensionsClientImpl implements VirtualMachineScaleSetExtensionsClient { - private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetExtensionsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final VirtualMachineScaleSetExtensionsService service; - - /** The service client containing this operation class. */ - private final ComputeManagementClientImpl client; - - /** - * Initializes an instance of VirtualMachineScaleSetExtensionsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - VirtualMachineScaleSetExtensionsClientImpl(ComputeManagementClientImpl client) { - this.service = - RestProxy - .create( - VirtualMachineScaleSetExtensionsService.class, - client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for ComputeManagementClientVirtualMachineScaleSetExtensions to be used by - * the proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "ComputeManagementCli") - private interface VirtualMachineScaleSetExtensionsService { - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @PathParam("vmssExtensionName") String vmssExtensionName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VirtualMachineScaleSetExtensionInner extensionParameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @PathParam("vmssExtensionName") String vmssExtensionName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VirtualMachineScaleSetExtensionUpdate extensionParameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @PathParam("vmssExtensionName") String vmssExtensionName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @PathParam("vmssExtensionName") String vmssExtensionName, - @QueryParam("$expand") String expand, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/extensions") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * The operation to create or update an extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. - * @param vmssExtensionName The name of the VM scale set extension. - * @param extensionParameters Parameters supplied to the Create VM scale set Extension operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String vmScaleSetName, - String vmssExtensionName, - VirtualMachineScaleSetExtensionInner extensionParameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (vmssExtensionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter vmssExtensionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (extensionParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter extensionParameters is required and cannot be null.")); - } else { - extensionParameters.validate(); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - vmssExtensionName, - apiVersion, - this.client.getSubscriptionId(), - extensionParameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * The operation to create or update an extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. - * @param vmssExtensionName The name of the VM scale set extension. - * @param extensionParameters Parameters supplied to the Create VM scale set Extension operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String vmScaleSetName, - String vmssExtensionName, - VirtualMachineScaleSetExtensionInner extensionParameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (vmssExtensionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter vmssExtensionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (extensionParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter extensionParameters is required and cannot be null.")); - } else { - extensionParameters.validate(); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - vmssExtensionName, - apiVersion, - this.client.getSubscriptionId(), - extensionParameters, - accept, - context); - } - - /** - * The operation to create or update an extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. - * @param vmssExtensionName The name of the VM scale set extension. - * @param extensionParameters Parameters supplied to the Create VM scale set Extension operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, VirtualMachineScaleSetExtensionInner> - beginCreateOrUpdateAsync( - String resourceGroupName, - String vmScaleSetName, - String vmssExtensionName, - VirtualMachineScaleSetExtensionInner extensionParameters) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VirtualMachineScaleSetExtensionInner.class, - VirtualMachineScaleSetExtensionInner.class, - Context.NONE); - } - - /** - * The operation to create or update an extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. - * @param vmssExtensionName The name of the VM scale set extension. - * @param extensionParameters Parameters supplied to the Create VM scale set Extension operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, VirtualMachineScaleSetExtensionInner> - beginCreateOrUpdateAsync( - String resourceGroupName, - String vmScaleSetName, - String vmssExtensionName, - VirtualMachineScaleSetExtensionInner extensionParameters, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync( - resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VirtualMachineScaleSetExtensionInner.class, - VirtualMachineScaleSetExtensionInner.class, - context); - } - - /** - * The operation to create or update an extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. - * @param vmssExtensionName The name of the VM scale set extension. - * @param extensionParameters Parameters supplied to the Create VM scale set Extension operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VirtualMachineScaleSetExtensionInner> - beginCreateOrUpdate( - String resourceGroupName, - String vmScaleSetName, - String vmssExtensionName, - VirtualMachineScaleSetExtensionInner extensionParameters) { - return beginCreateOrUpdateAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters) - .getSyncPoller(); - } - - /** - * The operation to create or update an extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. - * @param vmssExtensionName The name of the VM scale set extension. - * @param extensionParameters Parameters supplied to the Create VM scale set Extension operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VirtualMachineScaleSetExtensionInner> - beginCreateOrUpdate( - String resourceGroupName, - String vmScaleSetName, - String vmssExtensionName, - VirtualMachineScaleSetExtensionInner extensionParameters, - Context context) { - return beginCreateOrUpdateAsync( - resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters, context) - .getSyncPoller(); - } - - /** - * The operation to create or update an extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. - * @param vmssExtensionName The name of the VM scale set extension. - * @param extensionParameters Parameters supplied to the Create VM scale set Extension operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, - String vmScaleSetName, - String vmssExtensionName, - VirtualMachineScaleSetExtensionInner extensionParameters) { - return beginCreateOrUpdateAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * The operation to create or update an extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. - * @param vmssExtensionName The name of the VM scale set extension. - * @param extensionParameters Parameters supplied to the Create VM scale set Extension operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, - String vmScaleSetName, - String vmssExtensionName, - VirtualMachineScaleSetExtensionInner extensionParameters, - Context context) { - return beginCreateOrUpdateAsync( - resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * The operation to create or update an extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. - * @param vmssExtensionName The name of the VM scale set extension. - * @param extensionParameters Parameters supplied to the Create VM scale set Extension operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineScaleSetExtensionInner createOrUpdate( - String resourceGroupName, - String vmScaleSetName, - String vmssExtensionName, - VirtualMachineScaleSetExtensionInner extensionParameters) { - return createOrUpdateAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters).block(); - } - - /** - * The operation to create or update an extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. - * @param vmssExtensionName The name of the VM scale set extension. - * @param extensionParameters Parameters supplied to the Create VM scale set Extension operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineScaleSetExtensionInner createOrUpdate( - String resourceGroupName, - String vmScaleSetName, - String vmssExtensionName, - VirtualMachineScaleSetExtensionInner extensionParameters, - Context context) { - return createOrUpdateAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters, context) - .block(); - } - - /** - * The operation to update an extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be updated. - * @param vmssExtensionName The name of the VM scale set extension. - * @param extensionParameters Parameters supplied to the Update VM scale set Extension operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateWithResponseAsync( - String resourceGroupName, - String vmScaleSetName, - String vmssExtensionName, - VirtualMachineScaleSetExtensionUpdate extensionParameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (vmssExtensionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter vmssExtensionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (extensionParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter extensionParameters is required and cannot be null.")); - } else { - extensionParameters.validate(); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - vmssExtensionName, - apiVersion, - this.client.getSubscriptionId(), - extensionParameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * The operation to update an extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be updated. - * @param vmssExtensionName The name of the VM scale set extension. - * @param extensionParameters Parameters supplied to the Update VM scale set Extension operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, - String vmScaleSetName, - String vmssExtensionName, - VirtualMachineScaleSetExtensionUpdate extensionParameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (vmssExtensionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter vmssExtensionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (extensionParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter extensionParameters is required and cannot be null.")); - } else { - extensionParameters.validate(); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - vmssExtensionName, - apiVersion, - this.client.getSubscriptionId(), - extensionParameters, - accept, - context); - } - - /** - * The operation to update an extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be updated. - * @param vmssExtensionName The name of the VM scale set extension. - * @param extensionParameters Parameters supplied to the Update VM scale set Extension operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, VirtualMachineScaleSetExtensionInner> - beginUpdateAsync( - String resourceGroupName, - String vmScaleSetName, - String vmssExtensionName, - VirtualMachineScaleSetExtensionUpdate extensionParameters) { - Mono>> mono = - updateWithResponseAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VirtualMachineScaleSetExtensionInner.class, - VirtualMachineScaleSetExtensionInner.class, - Context.NONE); - } - - /** - * The operation to update an extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be updated. - * @param vmssExtensionName The name of the VM scale set extension. - * @param extensionParameters Parameters supplied to the Update VM scale set Extension operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, VirtualMachineScaleSetExtensionInner> - beginUpdateAsync( - String resourceGroupName, - String vmScaleSetName, - String vmssExtensionName, - VirtualMachineScaleSetExtensionUpdate extensionParameters, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - updateWithResponseAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VirtualMachineScaleSetExtensionInner.class, - VirtualMachineScaleSetExtensionInner.class, - context); - } - - /** - * The operation to update an extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be updated. - * @param vmssExtensionName The name of the VM scale set extension. - * @param extensionParameters Parameters supplied to the Update VM scale set Extension operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VirtualMachineScaleSetExtensionInner> - beginUpdate( - String resourceGroupName, - String vmScaleSetName, - String vmssExtensionName, - VirtualMachineScaleSetExtensionUpdate extensionParameters) { - return beginUpdateAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters) - .getSyncPoller(); - } - - /** - * The operation to update an extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be updated. - * @param vmssExtensionName The name of the VM scale set extension. - * @param extensionParameters Parameters supplied to the Update VM scale set Extension operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VirtualMachineScaleSetExtensionInner> - beginUpdate( - String resourceGroupName, - String vmScaleSetName, - String vmssExtensionName, - VirtualMachineScaleSetExtensionUpdate extensionParameters, - Context context) { - return beginUpdateAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters, context) - .getSyncPoller(); - } - - /** - * The operation to update an extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be updated. - * @param vmssExtensionName The name of the VM scale set extension. - * @param extensionParameters Parameters supplied to the Update VM scale set Extension operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync( - String resourceGroupName, - String vmScaleSetName, - String vmssExtensionName, - VirtualMachineScaleSetExtensionUpdate extensionParameters) { - return beginUpdateAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * The operation to update an extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be updated. - * @param vmssExtensionName The name of the VM scale set extension. - * @param extensionParameters Parameters supplied to the Update VM scale set Extension operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, - String vmScaleSetName, - String vmssExtensionName, - VirtualMachineScaleSetExtensionUpdate extensionParameters, - Context context) { - return beginUpdateAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * The operation to update an extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be updated. - * @param vmssExtensionName The name of the VM scale set extension. - * @param extensionParameters Parameters supplied to the Update VM scale set Extension operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineScaleSetExtensionInner update( - String resourceGroupName, - String vmScaleSetName, - String vmssExtensionName, - VirtualMachineScaleSetExtensionUpdate extensionParameters) { - return updateAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters).block(); - } - - /** - * The operation to update an extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be updated. - * @param vmssExtensionName The name of the VM scale set extension. - * @param extensionParameters Parameters supplied to the Update VM scale set Extension operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineScaleSetExtensionInner update( - String resourceGroupName, - String vmScaleSetName, - String vmssExtensionName, - VirtualMachineScaleSetExtensionUpdate extensionParameters, - Context context) { - return updateAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters, context).block(); - } - - /** - * The operation to delete the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be deleted. - * @param vmssExtensionName The name of the VM scale set extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String vmssExtensionName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (vmssExtensionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter vmssExtensionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - vmssExtensionName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * The operation to delete the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be deleted. - * @param vmssExtensionName The name of the VM scale set extension. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String vmssExtensionName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (vmssExtensionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter vmssExtensionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - vmssExtensionName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * The operation to delete the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be deleted. - * @param vmssExtensionName The name of the VM scale set extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String vmScaleSetName, String vmssExtensionName) { - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, vmScaleSetName, vmssExtensionName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * The operation to delete the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be deleted. - * @param vmssExtensionName The name of the VM scale set extension. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String vmScaleSetName, String vmssExtensionName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * The operation to delete the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be deleted. - * @param vmssExtensionName The name of the VM scale set extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String vmScaleSetName, String vmssExtensionName) { - return beginDeleteAsync(resourceGroupName, vmScaleSetName, vmssExtensionName).getSyncPoller(); - } - - /** - * The operation to delete the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be deleted. - * @param vmssExtensionName The name of the VM scale set extension. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String vmScaleSetName, String vmssExtensionName, Context context) { - return beginDeleteAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, context).getSyncPoller(); - } - - /** - * The operation to delete the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be deleted. - * @param vmssExtensionName The name of the VM scale set extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String vmScaleSetName, String vmssExtensionName) { - return beginDeleteAsync(resourceGroupName, vmScaleSetName, vmssExtensionName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * The operation to delete the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be deleted. - * @param vmssExtensionName The name of the VM scale set extension. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync( - String resourceGroupName, String vmScaleSetName, String vmssExtensionName, Context context) { - return beginDeleteAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * The operation to delete the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be deleted. - * @param vmssExtensionName The name of the VM scale set extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String vmScaleSetName, String vmssExtensionName) { - deleteAsync(resourceGroupName, vmScaleSetName, vmssExtensionName).block(); - } - - /** - * The operation to delete the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be deleted. - * @param vmssExtensionName The name of the VM scale set extension. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String vmScaleSetName, String vmssExtensionName, Context context) { - deleteAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, context).block(); - } - - /** - * The operation to get the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set containing the extension. - * @param vmssExtensionName The name of the VM scale set extension. - * @param expand The expand expression to apply on the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String vmssExtensionName, String expand) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (vmssExtensionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter vmssExtensionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - vmssExtensionName, - expand, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * The operation to get the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set containing the extension. - * @param vmssExtensionName The name of the VM scale set extension. - * @param expand The expand expression to apply on the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String vmssExtensionName, String expand, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (vmssExtensionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter vmssExtensionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - vmssExtensionName, - expand, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * The operation to get the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set containing the extension. - * @param vmssExtensionName The name of the VM scale set extension. - * @param expand The expand expression to apply on the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync( - String resourceGroupName, String vmScaleSetName, String vmssExtensionName, String expand) { - return getWithResponseAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * The operation to get the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set containing the extension. - * @param vmssExtensionName The name of the VM scale set extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync( - String resourceGroupName, String vmScaleSetName, String vmssExtensionName) { - final String expand = null; - return getWithResponseAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * The operation to get the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set containing the extension. - * @param vmssExtensionName The name of the VM scale set extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineScaleSetExtensionInner get( - String resourceGroupName, String vmScaleSetName, String vmssExtensionName) { - final String expand = null; - return getAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, expand).block(); - } - - /** - * The operation to get the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set containing the extension. - * @param vmssExtensionName The name of the VM scale set extension. - * @param expand The expand expression to apply on the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String vmScaleSetName, String vmssExtensionName, String expand, Context context) { - return getWithResponseAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, expand, context).block(); - } - - /** - * Gets a list of all extensions in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set containing the extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all extensions in a VM scale set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String vmScaleSetName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a list of all extensions in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set containing the extension. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all extensions in a VM scale set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String vmScaleSetName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets a list of all extensions in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set containing the extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all extensions in a VM scale set. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String resourceGroupName, String vmScaleSetName) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, vmScaleSetName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets a list of all extensions in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set containing the extension. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all extensions in a VM scale set. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String vmScaleSetName, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, vmScaleSetName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets a list of all extensions in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set containing the extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all extensions in a VM scale set. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String vmScaleSetName) { - return new PagedIterable<>(listAsync(resourceGroupName, vmScaleSetName)); - } - - /** - * Gets a list of all extensions in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set containing the extension. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all extensions in a VM scale set. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, String vmScaleSetName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, vmScaleSetName, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List VM scale set extension operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List VM scale set extension operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineScaleSetImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineScaleSetImpl.java deleted file mode 100644 index 37b3a5bf3bb6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineScaleSetImpl.java +++ /dev/null @@ -1,3045 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.SubResource; -import com.azure.core.management.provider.IdentifierProvider; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.ComputeManager; -import com.azure.resourcemanager.compute.models.AdditionalCapabilities; -import com.azure.resourcemanager.compute.models.ApiEntityReference; -import com.azure.resourcemanager.compute.models.BillingProfile; -import com.azure.resourcemanager.compute.models.BootDiagnostics; -import com.azure.resourcemanager.compute.models.CachingTypes; -import com.azure.resourcemanager.compute.models.DiagnosticsProfile; -import com.azure.resourcemanager.compute.models.DiskCreateOptionTypes; -import com.azure.resourcemanager.compute.models.ImageReference; -import com.azure.resourcemanager.compute.models.KnownLinuxVirtualMachineImage; -import com.azure.resourcemanager.compute.models.KnownWindowsVirtualMachineImage; -import com.azure.resourcemanager.compute.models.LinuxConfiguration; -import com.azure.resourcemanager.compute.models.OperatingSystemTypes; -import com.azure.resourcemanager.compute.models.ProximityPlacementGroup; -import com.azure.resourcemanager.compute.models.ProximityPlacementGroupType; -import com.azure.resourcemanager.compute.models.ResourceIdentityType; -import com.azure.resourcemanager.compute.models.RunCommandInput; -import com.azure.resourcemanager.compute.models.RunCommandInputParameter; -import com.azure.resourcemanager.compute.models.RunCommandResult; -import com.azure.resourcemanager.compute.models.SshConfiguration; -import com.azure.resourcemanager.compute.models.SshPublicKey; -import com.azure.resourcemanager.compute.models.StorageAccountTypes; -import com.azure.resourcemanager.compute.models.UpgradeMode; -import com.azure.resourcemanager.compute.models.UpgradePolicy; -import com.azure.resourcemanager.compute.models.VaultSecretGroup; -import com.azure.resourcemanager.compute.models.VirtualHardDisk; -import com.azure.resourcemanager.compute.models.VirtualMachineCustomImage; -import com.azure.resourcemanager.compute.models.VirtualMachineEvictionPolicyTypes; -import com.azure.resourcemanager.compute.models.VirtualMachinePriorityTypes; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSet; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetDataDisk; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetExtension; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetExtensionProfile; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetIpConfiguration; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetManagedDiskParameters; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetNetworkConfiguration; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetNetworkProfile; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetOSDisk; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetOSProfile; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetPublicIpAddressConfiguration; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetSku; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetSkuTypes; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetStorageProfile; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetUpdate; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetVMs; -import com.azure.resourcemanager.compute.models.WinRMConfiguration; -import com.azure.resourcemanager.compute.models.WinRMListener; -import com.azure.resourcemanager.compute.models.WindowsConfiguration; -import com.azure.resourcemanager.compute.fluent.models.ProximityPlacementGroupInner; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineScaleSetExtensionInner; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineScaleSetInner; -import com.azure.resourcemanager.authorization.models.BuiltInRole; -import com.azure.resourcemanager.authorization.AuthorizationManager; -import com.azure.resourcemanager.authorization.utils.RoleAssignmentHelper; -import com.azure.resourcemanager.msi.models.Identity; -import com.azure.resourcemanager.network.models.ApplicationSecurityGroup; -import com.azure.resourcemanager.network.models.LoadBalancer; -import com.azure.resourcemanager.network.models.LoadBalancerBackend; -import com.azure.resourcemanager.network.models.LoadBalancerInboundNatPool; -import com.azure.resourcemanager.network.models.LoadBalancerPrivateFrontend; -import com.azure.resourcemanager.network.models.Network; -import com.azure.resourcemanager.network.models.NetworkSecurityGroup; -import com.azure.resourcemanager.network.models.VirtualMachineScaleSetNetworkInterface; -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.resources.fluentcore.arm.AvailabilityZoneId; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceId; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils; -import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.GroupableParentResourceImpl; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import com.azure.resourcemanager.storage.models.StorageAccount; -import com.azure.resourcemanager.storage.StorageManager; -import reactor.core.Exceptions; -import reactor.core.publisher.Mono; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.Set; -import java.util.concurrent.Callable; -import com.azure.resourcemanager.resources.fluentcore.utils.PagedConverter; - -/** Implementation of VirtualMachineScaleSet. */ -public class VirtualMachineScaleSetImpl - extends GroupableParentResourceImpl< - VirtualMachineScaleSet, VirtualMachineScaleSetInner, VirtualMachineScaleSetImpl, ComputeManager> - implements VirtualMachineScaleSet, - VirtualMachineScaleSet.DefinitionManagedOrUnmanaged, - VirtualMachineScaleSet.DefinitionManaged, - VirtualMachineScaleSet.DefinitionUnmanaged, - VirtualMachineScaleSet.Update, - VirtualMachineScaleSet.DefinitionStages.WithSystemAssignedIdentityBasedAccessOrCreate, - VirtualMachineScaleSet.DefinitionStages.WithUserAssignedManagedServiceIdentity, - VirtualMachineScaleSet.UpdateStages.WithSystemAssignedIdentityBasedAccessOrApply, - VirtualMachineScaleSet.UpdateStages.WithUserAssignedManagedServiceIdentity { - // Clients - private final StorageManager storageManager; - private final NetworkManager networkManager; - // used to generate unique name for any dependency resources - private final IdentifierProvider namer; - private boolean isMarketplaceLinuxImage = false; - // name of an existing subnet in the primary network to use - private String existingPrimaryNetworkSubnetNameToAssociate; - // unique key of a creatable storage accounts to be used for virtual machines child resources that - // requires storage [OS disk] - private List creatableStorageAccountKeys = new ArrayList<>(); - // reference to an existing storage account to be used for virtual machines child resources that - // requires storage [OS disk] - private List existingStorageAccountsToAssociate = new ArrayList<>(); - // the child resource extensions - private Map extensions; - // reference to the primary and internal Internet facing load balancer - private LoadBalancer primaryInternetFacingLoadBalancer; - private LoadBalancer primaryInternalLoadBalancer; - // Load balancer specific variables used during update - private boolean removePrimaryInternetFacingLoadBalancerOnUpdate; - private boolean removePrimaryInternalLoadBalancerOnUpdate; - private LoadBalancer primaryInternetFacingLoadBalancerToAttachOnUpdate; - private LoadBalancer primaryInternalLoadBalancerToAttachOnUpdate; - private List primaryInternetFacingLBBackendsToRemoveOnUpdate = new ArrayList<>(); - private List primaryInternetFacingLBInboundNatPoolsToRemoveOnUpdate = new ArrayList<>(); - private List primaryInternalLBBackendsToRemoveOnUpdate = new ArrayList<>(); - private List primaryInternalLBInboundNatPoolsToRemoveOnUpdate = new ArrayList<>(); - private List primaryInternetFacingLBBackendsToAddOnUpdate = new ArrayList<>(); - private List primaryInternetFacingLBInboundNatPoolsToAddOnUpdate = new ArrayList<>(); - private List primaryInternalLBBackendsToAddOnUpdate = new ArrayList<>(); - private List primaryInternalLBInboundNatPoolsToAddOnUpdate = new ArrayList<>(); - // Flag indicates native disk is selected for OS and Data disks - private boolean isUnmanagedDiskSelected; - // To track the managed data disks - private final ManagedDataDiskCollection managedDataDisks; - // Utility to setup MSI for the virtual machine scale set - VirtualMachineScaleSetMsiHandler virtualMachineScaleSetMsiHandler; - // To manage boot diagnostics specific operations - private final BootDiagnosticsHandler bootDiagnosticsHandler; - // Name of the new proximity placement group - private String newProximityPlacementGroupName; - // Type fo the new proximity placement group - private ProximityPlacementGroupType newProximityPlacementGroupType; - // To manage OS profile - private boolean removeOsProfile; - private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetImpl.class); - - VirtualMachineScaleSetImpl( - String name, - VirtualMachineScaleSetInner innerModel, - final ComputeManager computeManager, - final StorageManager storageManager, - final NetworkManager networkManager, - final AuthorizationManager authorizationManager) { - super(name, innerModel, computeManager); - this.storageManager = storageManager; - this.networkManager = networkManager; - this.namer = this.manager().resourceManager().internalContext().createIdentifierProvider(this.name()); - this.managedDataDisks = new ManagedDataDiskCollection(this); - this.virtualMachineScaleSetMsiHandler = new VirtualMachineScaleSetMsiHandler(authorizationManager, this); - this.bootDiagnosticsHandler = new BootDiagnosticsHandler(this); - this.newProximityPlacementGroupName = null; - this.newProximityPlacementGroupType = null; - } - - @Override - protected void initializeChildrenFromInner() { - this.extensions = new HashMap<>(); - if (this.innerModel().virtualMachineProfile().extensionProfile() != null) { - if (this.innerModel().virtualMachineProfile().extensionProfile().extensions() != null) { - for (VirtualMachineScaleSetExtensionInner inner - : this.innerModel().virtualMachineProfile().extensionProfile().extensions()) { - this.extensions.put(inner.name(), new VirtualMachineScaleSetExtensionImpl(inner, this)); - } - } - } - } - - @Override - public VirtualMachineScaleSetVMs virtualMachines() { - return new VirtualMachineScaleSetVMsImpl( - this, this.manager().serviceClient().getVirtualMachineScaleSetVMs(), this.myManager); - } - - @Override - public PagedIterable listAvailableSkus() { - return PagedConverter.mapPage(this - .manager() - .serviceClient() - .getVirtualMachineScaleSets() - .listSkus(this.resourceGroupName(), this.name()), - VirtualMachineScaleSetSkuImpl::new); - } - - @Override - public void deallocate() { - this.deallocateAsync().block(); - } - - @Override - public Mono deallocateAsync() { - return this - .manager() - .serviceClient() - .getVirtualMachineScaleSets() - .deallocateAsync(this.resourceGroupName(), this.name(), null) - .map(aVoid -> this.refreshAsync()) - .then(); - } - - @Override - public void powerOff() { - this.powerOffAsync().block(); - } - - @Override - public Mono powerOffAsync() { - return this - .manager() - .serviceClient() - .getVirtualMachineScaleSets() - .powerOffAsync(this.resourceGroupName(), this.name(), null, null); - } - - @Override - public void restart() { - this.restartAsync().block(); - } - - @Override - public Mono restartAsync() { - return this - .manager() - .serviceClient() - .getVirtualMachineScaleSets() - .restartAsync(this.resourceGroupName(), this.name(), null); - } - - @Override - public void start() { - this.startAsync().block(); - } - - @Override - public Mono startAsync() { - return this - .manager() - .serviceClient() - .getVirtualMachineScaleSets() - .startAsync(this.resourceGroupName(), this.name(), null); - } - - @Override - public void reimage() { - this.reimageAsync().block(); - } - - @Override - public Mono reimageAsync() { - return this - .manager() - .serviceClient() - .getVirtualMachineScaleSets() - .reimageAsync(this.resourceGroupName(), this.name(), null); - } - - @Override - public RunCommandResult runPowerShellScriptInVMInstance( - String vmId, List scriptLines, List scriptParameters) { - return this - .manager() - .virtualMachineScaleSets() - .runPowerShellScriptInVMInstance( - this.resourceGroupName(), this.name(), vmId, scriptLines, scriptParameters); - } - - @Override - public Mono runPowerShellScriptInVMInstanceAsync( - String vmId, List scriptLines, List scriptParameters) { - return this - .manager() - .virtualMachineScaleSets() - .runPowerShellScriptInVMInstanceAsync( - this.resourceGroupName(), this.name(), vmId, scriptLines, scriptParameters); - } - - @Override - public RunCommandResult runShellScriptInVMInstance( - String vmId, List scriptLines, List scriptParameters) { - return this - .manager() - .virtualMachineScaleSets() - .runShellScriptInVMInstance(this.resourceGroupName(), this.name(), vmId, scriptLines, scriptParameters); - } - - @Override - public Mono runShellScriptInVMInstanceAsync( - String vmId, List scriptLines, List scriptParameters) { - return this - .manager() - .virtualMachineScaleSets() - .runShellScriptInVMInstanceAsync( - this.resourceGroupName(), this.name(), vmId, scriptLines, scriptParameters); - } - - @Override - public RunCommandResult runCommandInVMInstance(String vmId, RunCommandInput inputCommand) { - return this - .manager() - .virtualMachineScaleSets() - .runCommandInVMInstance(this.resourceGroupName(), this.name(), vmId, inputCommand); - } - - @Override - public Mono runCommandVMInstanceAsync(String vmId, RunCommandInput inputCommand) { - return this - .manager() - .virtualMachineScaleSets() - .runCommandVMInstanceAsync(this.resourceGroupName(), this.name(), vmId, inputCommand); - } - - @Override - public String computerNamePrefix() { - return this.innerModel().virtualMachineProfile().osProfile().computerNamePrefix(); - } - - @Override - public OperatingSystemTypes osType() { - return this.innerModel().virtualMachineProfile().storageProfile().osDisk().osType(); - } - - @Override - public CachingTypes osDiskCachingType() { - return this.innerModel().virtualMachineProfile().storageProfile().osDisk().caching(); - } - - @Override - public String osDiskName() { - return this.innerModel().virtualMachineProfile().storageProfile().osDisk().name(); - } - - @Override - public UpgradeMode upgradeModel() { - // upgradePolicy is a required property so no null check - return this.innerModel().upgradePolicy().mode(); - } - - @Override - public boolean overProvisionEnabled() { - return this.innerModel().overprovision(); - } - - @Override - public VirtualMachineScaleSetSkuTypes sku() { - return VirtualMachineScaleSetSkuTypes.fromSku(this.innerModel().sku()); - } - - @Override - public int capacity() { - return ResourceManagerUtils.toPrimitiveInt(this.innerModel().sku().capacity()); - } - - @Override - public Network getPrimaryNetwork() throws IOException { - String subnetId = primaryNicDefaultIpConfiguration().subnet().id(); - String virtualNetworkId = ResourceUtils.parentResourceIdFromResourceId(subnetId); - return this.networkManager.networks().getById(virtualNetworkId); - } - - @Override - public LoadBalancer getPrimaryInternetFacingLoadBalancer() throws IOException { - if (this.primaryInternetFacingLoadBalancer == null) { - loadCurrentPrimaryLoadBalancersIfAvailableAsync().block(); - } - return this.primaryInternetFacingLoadBalancer; - } - - @Override - public Map listPrimaryInternetFacingLoadBalancerBackends() throws IOException { - if (this.getPrimaryInternetFacingLoadBalancer() != null) { - return getBackendsAssociatedWithIpConfiguration( - this.primaryInternetFacingLoadBalancer, primaryNicDefaultIpConfiguration()); - } - return new HashMap<>(); - } - - @Override - public Map listPrimaryInternetFacingLoadBalancerInboundNatPools() - throws IOException { - if (this.getPrimaryInternetFacingLoadBalancer() != null) { - return getInboundNatPoolsAssociatedWithIpConfiguration( - this.primaryInternetFacingLoadBalancer, primaryNicDefaultIpConfiguration()); - } - return new HashMap<>(); - } - - @Override - public LoadBalancer getPrimaryInternalLoadBalancer() throws IOException { - if (this.primaryInternalLoadBalancer == null) { - loadCurrentPrimaryLoadBalancersIfAvailableAsync().block(); - } - return this.primaryInternalLoadBalancer; - } - - @Override - public Map listPrimaryInternalLoadBalancerBackends() throws IOException { - if (this.getPrimaryInternalLoadBalancer() != null) { - return getBackendsAssociatedWithIpConfiguration( - this.primaryInternalLoadBalancer, primaryNicDefaultIpConfiguration()); - } - return new HashMap<>(); - } - - @Override - public Map listPrimaryInternalLoadBalancerInboundNatPools() throws IOException { - if (this.getPrimaryInternalLoadBalancer() != null) { - return getInboundNatPoolsAssociatedWithIpConfiguration( - this.primaryInternalLoadBalancer, primaryNicDefaultIpConfiguration()); - } - return new HashMap<>(); - } - - @Override - public List primaryPublicIpAddressIds() throws IOException { - LoadBalancer loadBalancer = this.getPrimaryInternetFacingLoadBalancer(); - if (loadBalancer != null) { - return loadBalancer.publicIpAddressIds(); - } - return new ArrayList<>(); - } - - @Override - public List vhdContainers() { - if (this.storageProfile() != null - && this.storageProfile().osDisk() != null - && this.storageProfile().osDisk().vhdContainers() != null) { - return this.storageProfile().osDisk().vhdContainers(); - } - return new ArrayList<>(); - } - - @Override - public VirtualMachineScaleSetStorageProfile storageProfile() { - return this.innerModel().virtualMachineProfile().storageProfile(); - } - - @Override - public VirtualMachineScaleSetNetworkProfile networkProfile() { - return this.innerModel().virtualMachineProfile().networkProfile(); - } - - @Override - public Map extensions() { - return Collections.unmodifiableMap(this.extensions); - } - - @Override - public VirtualMachinePriorityTypes virtualMachinePriority() { - if (this.innerModel().virtualMachineProfile() != null) { - return this.innerModel().virtualMachineProfile().priority(); - } else { - return null; - } - } - - @Override - public BillingProfile billingProfile() { - if (this.innerModel().virtualMachineProfile() != null) { - return this.innerModel().virtualMachineProfile().billingProfile(); - } else { - return null; - } - } - - @Override - public VirtualMachineScaleSetPublicIpAddressConfiguration virtualMachinePublicIpConfig() { - VirtualMachineScaleSetIpConfiguration nicConfig = this.primaryNicDefaultIpConfiguration(); - return nicConfig.publicIpAddressConfiguration(); - } - - @Override - public VirtualMachineEvictionPolicyTypes virtualMachineEvictionPolicy() { - if (this.innerModel() != null && this.innerModel().virtualMachineProfile() != null) { - return this.innerModel().virtualMachineProfile().evictionPolicy(); - } else { - return null; - } - } - - @Override - public boolean isIpForwardingEnabled() { - VirtualMachineScaleSetNetworkConfiguration nicConfig = primaryNicConfiguration(); - if (nicConfig.enableIpForwarding() != null) { - return nicConfig.enableIpForwarding(); - } else { - return false; - } - } - - @Override - public boolean isAcceleratedNetworkingEnabled() { - VirtualMachineScaleSetNetworkConfiguration nicConfig = primaryNicConfiguration(); - if (nicConfig.enableAcceleratedNetworking() != null) { - return nicConfig.enableAcceleratedNetworking(); - } else { - return false; - } - } - - @Override - public String networkSecurityGroupId() { - VirtualMachineScaleSetNetworkConfiguration nicConfig = primaryNicConfiguration(); - if (nicConfig.networkSecurityGroup() != null) { - return nicConfig.networkSecurityGroup().id(); - } else { - return null; - } - } - - @Override - public boolean isSinglePlacementGroupEnabled() { - if (this.innerModel().singlePlacementGroup() != null) { - return this.innerModel().singlePlacementGroup(); - } else { - return false; - } - } - - @Override - public List applicationGatewayBackendAddressPoolsIds() { - VirtualMachineScaleSetIpConfiguration nicIpConfig = this.primaryNicDefaultIpConfiguration(); - List backendPools = nicIpConfig.applicationGatewayBackendAddressPools(); - List result = new ArrayList<>(); - if (backendPools != null) { - for (SubResource backendPool : backendPools) { - result.add(backendPool.id()); - } - } - return result; - } - - @Override - public List applicationSecurityGroupIds() { - VirtualMachineScaleSetIpConfiguration nicIpConfig = this.primaryNicDefaultIpConfiguration(); - List asgIds = new ArrayList<>(); - if (nicIpConfig.applicationSecurityGroups() != null) { - for (SubResource asg : nicIpConfig.applicationSecurityGroups()) { - asgIds.add(asg.id()); - } - } - return asgIds; - } - - @Override - public Boolean doNotRunExtensionsOnOverprovisionedVMs() { - return this.innerModel().doNotRunExtensionsOnOverprovisionedVMs(); - } - - @Override - public ProximityPlacementGroup proximityPlacementGroup() { - if (innerModel().proximityPlacementGroup() == null) { - return null; - } else { - ResourceId id = ResourceId.fromString(innerModel().proximityPlacementGroup().id()); - ProximityPlacementGroupInner plgInner = - manager() - .serviceClient() - .getProximityPlacementGroups() - .getByResourceGroup(id.resourceGroupName(), id.name()); - if (plgInner == null) { - return null; - } else { - return new ProximityPlacementGroupImpl(plgInner); - } - } - } - - @Override - public AdditionalCapabilities additionalCapabilities() { - return this.innerModel().additionalCapabilities(); - } - - @Override - public VirtualMachineScaleSetNetworkInterface getNetworkInterfaceByInstanceId(String instanceId, String name) { - return this - .networkManager - .networkInterfaces() - .getByVirtualMachineScaleSetInstanceId(this.resourceGroupName(), this.name(), instanceId, name); - } - - @Override - public PagedIterable listNetworkInterfaces() { - return this - .networkManager - .networkInterfaces() - .listByVirtualMachineScaleSet(this.resourceGroupName(), this.name()); - } - - @Override - public PagedIterable listNetworkInterfacesByInstanceId( - String virtualMachineInstanceId) { - return this - .networkManager - .networkInterfaces() - .listByVirtualMachineScaleSetInstanceId(this.resourceGroupName(), this.name(), virtualMachineInstanceId); - } - - @Override - public PagedFlux listNetworkInterfacesByInstanceIdAsync( - String virtualMachineInstanceId) { - return this - .networkManager - .networkInterfaces() - .listByVirtualMachineScaleSetInstanceIdAsync( - this.resourceGroupName(), this.name(), virtualMachineInstanceId); - } - - // Fluent setters - - @Override - public VirtualMachineScaleSetImpl withSku(VirtualMachineScaleSetSkuTypes skuType) { - this.innerModel().withSku(skuType.sku()); - return this; - } - - @Override - public VirtualMachineScaleSetImpl withSku(VirtualMachineScaleSetSku sku) { - return this.withSku(sku.skuType()); - } - - @Override - public VirtualMachineScaleSetImpl withExistingPrimaryNetworkSubnet(Network network, String subnetName) { - this.existingPrimaryNetworkSubnetNameToAssociate = mergePath(network.id(), "subnets", subnetName); - return this; - } - - @Override - public VirtualMachineScaleSetImpl withExistingPrimaryInternetFacingLoadBalancer(LoadBalancer loadBalancer) { - if (loadBalancer.publicIpAddressIds().isEmpty()) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Parameter loadBalancer must be an Internet facing load balancer")); - } - - if (isInCreateMode()) { - this.primaryInternetFacingLoadBalancer = loadBalancer; - associateLoadBalancerToIpConfiguration( - this.primaryInternetFacingLoadBalancer, this.primaryNicDefaultIpConfiguration()); - } else { - this.primaryInternetFacingLoadBalancerToAttachOnUpdate = loadBalancer; - } - return this; - } - - @Override - public VirtualMachineScaleSetImpl withPrimaryInternetFacingLoadBalancerBackends(String... backendNames) { - if (this.isInCreateMode()) { - VirtualMachineScaleSetIpConfiguration defaultPrimaryIpConfig = this.primaryNicDefaultIpConfiguration(); - removeAllBackendAssociationFromIpConfiguration( - this.primaryInternetFacingLoadBalancer, defaultPrimaryIpConfig); - associateBackEndsToIpConfiguration( - this.primaryInternetFacingLoadBalancer.id(), defaultPrimaryIpConfig, backendNames); - } else { - addToList(this.primaryInternetFacingLBBackendsToAddOnUpdate, backendNames); - } - return this; - } - - @Override - public VirtualMachineScaleSetImpl withPrimaryInternetFacingLoadBalancerInboundNatPools(String... natPoolNames) { - if (this.isInCreateMode()) { - VirtualMachineScaleSetIpConfiguration defaultPrimaryIpConfig = this.primaryNicDefaultIpConfiguration(); - removeAllInboundNatPoolAssociationFromIpConfiguration( - this.primaryInternetFacingLoadBalancer, defaultPrimaryIpConfig); - associateInboundNATPoolsToIpConfiguration( - this.primaryInternetFacingLoadBalancer.id(), defaultPrimaryIpConfig, natPoolNames); - } else { - addToList(this.primaryInternetFacingLBInboundNatPoolsToAddOnUpdate, natPoolNames); - } - return this; - } - - @Override - public VirtualMachineScaleSetImpl withExistingPrimaryInternalLoadBalancer(LoadBalancer loadBalancer) { - if (!loadBalancer.publicIpAddressIds().isEmpty()) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Parameter loadBalancer must be an internal load balancer")); - } - String lbNetworkId = null; - for (LoadBalancerPrivateFrontend frontEnd : loadBalancer.privateFrontends().values()) { - if (frontEnd.networkId() != null) { - lbNetworkId = frontEnd.networkId(); - } - } - - if (isInCreateMode()) { - String vmNICNetworkId = - ResourceUtils.parentResourceIdFromResourceId(this.existingPrimaryNetworkSubnetNameToAssociate); - // Azure has a really wired BUG that - it throws exception when vnet of VMSS and LB are not same - // (code: NetworkInterfaceAndInternalLoadBalancerMustUseSameVnet) but at the same time Azure update - // the VMSS's network section to refer this invalid internal LB. This makes VMSS un-usable and portal - // will show a error above VMSS profile page. - // - if (!vmNICNetworkId.equalsIgnoreCase(lbNetworkId)) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Virtual network associated with scale set virtual machines" - + " and internal load balancer must be same. " - + "'" - + vmNICNetworkId - + "'" - + "'" - + lbNetworkId)); - } - - this.primaryInternalLoadBalancer = loadBalancer; - associateLoadBalancerToIpConfiguration( - this.primaryInternalLoadBalancer, this.primaryNicDefaultIpConfiguration()); - } else { - String vmNicVnetId = - ResourceUtils.parentResourceIdFromResourceId(primaryNicDefaultIpConfiguration().subnet().id()); - if (!vmNicVnetId.equalsIgnoreCase(lbNetworkId)) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Virtual network associated with scale set virtual machines" - + " and internal load balancer must be same. " - + "'" - + vmNicVnetId - + "'" - + "'" - + lbNetworkId)); - } - this.primaryInternalLoadBalancerToAttachOnUpdate = loadBalancer; - } - return this; - } - - @Override - public VirtualMachineScaleSetImpl withPrimaryInternalLoadBalancerBackends(String... backendNames) { - if (this.isInCreateMode()) { - VirtualMachineScaleSetIpConfiguration defaultPrimaryIpConfig = primaryNicDefaultIpConfiguration(); - removeAllBackendAssociationFromIpConfiguration(this.primaryInternalLoadBalancer, defaultPrimaryIpConfig); - associateBackEndsToIpConfiguration( - this.primaryInternalLoadBalancer.id(), defaultPrimaryIpConfig, backendNames); - } else { - addToList(this.primaryInternalLBBackendsToAddOnUpdate, backendNames); - } - return this; - } - - @Override - public VirtualMachineScaleSetImpl withPrimaryInternalLoadBalancerInboundNatPools(String... natPoolNames) { - if (this.isInCreateMode()) { - VirtualMachineScaleSetIpConfiguration defaultPrimaryIpConfig = this.primaryNicDefaultIpConfiguration(); - removeAllInboundNatPoolAssociationFromIpConfiguration( - this.primaryInternalLoadBalancer, defaultPrimaryIpConfig); - associateInboundNATPoolsToIpConfiguration( - this.primaryInternalLoadBalancer.id(), defaultPrimaryIpConfig, natPoolNames); - } else { - addToList(this.primaryInternalLBInboundNatPoolsToAddOnUpdate, natPoolNames); - } - return this; - } - - @Override - public VirtualMachineScaleSetImpl withoutPrimaryInternalLoadBalancer() { - if (this.isInUpdateMode()) { - this.removePrimaryInternalLoadBalancerOnUpdate = true; - } - return this; - } - - @Override - public VirtualMachineScaleSetImpl withoutPrimaryInternetFacingLoadBalancer() { - if (this.isInUpdateMode()) { - this.removePrimaryInternetFacingLoadBalancerOnUpdate = true; - } - return this; - } - - @Override - public VirtualMachineScaleSetImpl withoutPrimaryInternetFacingLoadBalancerBackends(String... backendNames) { - addToList(this.primaryInternetFacingLBBackendsToRemoveOnUpdate, backendNames); - return this; - } - - @Override - public VirtualMachineScaleSetImpl withoutPrimaryInternalLoadBalancerBackends(String... backendNames) { - addToList(this.primaryInternalLBBackendsToRemoveOnUpdate, backendNames); - return this; - } - - @Override - public VirtualMachineScaleSetImpl withoutPrimaryInternetFacingLoadBalancerNatPools(String... natPoolNames) { - addToList(this.primaryInternetFacingLBInboundNatPoolsToRemoveOnUpdate, natPoolNames); - return this; - } - - @Override - public VirtualMachineScaleSetImpl withoutPrimaryInternalLoadBalancerNatPools(String... natPoolNames) { - addToList(this.primaryInternalLBInboundNatPoolsToRemoveOnUpdate, natPoolNames); - return this; - } - - @Override - public VirtualMachineScaleSetImpl withPopularWindowsImage(KnownWindowsVirtualMachineImage knownImage) { - return withSpecificWindowsImageVersion(knownImage.imageReference()); - } - - @Override - public VirtualMachineScaleSetImpl withLatestWindowsImage(String publisher, String offer, String sku) { - ImageReference imageReference = - new ImageReference().withPublisher(publisher).withOffer(offer).withSku(sku).withVersion("latest"); - return withSpecificWindowsImageVersion(imageReference); - } - - @Override - public VirtualMachineScaleSetImpl withSpecificWindowsImageVersion(ImageReference imageReference) { - this - .innerModel() - .virtualMachineProfile() - .storageProfile() - .osDisk() - .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE); - this.innerModel().virtualMachineProfile().storageProfile().withImageReference(imageReference); - this.innerModel().virtualMachineProfile().osProfile().withWindowsConfiguration(new WindowsConfiguration()); - // sets defaults for "Stored(Custom)Image" or "VM(Platform)Image" - this.innerModel().virtualMachineProfile().osProfile().windowsConfiguration().withProvisionVMAgent(true); - this.innerModel().virtualMachineProfile().osProfile().windowsConfiguration().withEnableAutomaticUpdates(true); - return this; - } - - @Override - public VirtualMachineScaleSetImpl withGeneralizedWindowsCustomImage(String customImageId) { - ImageReference imageReferenceInner = new ImageReference(); - imageReferenceInner.withId(customImageId); - this - .innerModel() - .virtualMachineProfile() - .storageProfile() - .osDisk() - .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE); - this.innerModel().virtualMachineProfile().storageProfile().withImageReference(imageReferenceInner); - this.innerModel().virtualMachineProfile().osProfile().withWindowsConfiguration(new WindowsConfiguration()); - // sets defaults for "Stored(Custom)Image" or "VM(Platform)Image" - this.innerModel().virtualMachineProfile().osProfile().windowsConfiguration().withProvisionVMAgent(true); - this.innerModel().virtualMachineProfile().osProfile().windowsConfiguration().withEnableAutomaticUpdates(true); - return this; - } - - @Override - public VirtualMachineScaleSetImpl withSpecializedWindowsCustomImage(String customImageId) { - this.withGeneralizedWindowsCustomImage(customImageId); - this.removeOsProfile = true; - return this; - } - - @Override - public VirtualMachineScaleSetImpl withStoredWindowsImage(String imageUrl) { - VirtualHardDisk userImageVhd = new VirtualHardDisk(); - userImageVhd.withUri(imageUrl); - this - .innerModel() - .virtualMachineProfile() - .storageProfile() - .osDisk() - .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE); - this.innerModel().virtualMachineProfile().storageProfile().osDisk().withImage(userImageVhd); - // For platform image osType will be null, azure will pick it from the image metadata. - this.innerModel().virtualMachineProfile().storageProfile().osDisk().withOsType(OperatingSystemTypes.WINDOWS); - this.innerModel().virtualMachineProfile().osProfile().withWindowsConfiguration(new WindowsConfiguration()); - // sets defaults for "Stored(Custom)Image" or "VM(Platform)Image" - this.innerModel().virtualMachineProfile().osProfile().windowsConfiguration().withProvisionVMAgent(true); - this.innerModel().virtualMachineProfile().osProfile().windowsConfiguration().withEnableAutomaticUpdates(true); - return this; - } - - @Override - public VirtualMachineScaleSetImpl withPopularLinuxImage(KnownLinuxVirtualMachineImage knownImage) { - return withSpecificLinuxImageVersion(knownImage.imageReference()); - } - - @Override - public VirtualMachineScaleSetImpl withLatestLinuxImage(String publisher, String offer, String sku) { - ImageReference imageReference = - new ImageReference().withPublisher(publisher).withOffer(offer).withSku(sku).withVersion("latest"); - return withSpecificLinuxImageVersion(imageReference); - } - - @Override - public VirtualMachineScaleSetImpl withSpecificLinuxImageVersion(ImageReference imageReference) { - this - .innerModel() - .virtualMachineProfile() - .storageProfile() - .osDisk() - .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE); - this.innerModel().virtualMachineProfile().storageProfile().withImageReference(imageReference); - this.innerModel().virtualMachineProfile().osProfile().withLinuxConfiguration(new LinuxConfiguration()); - this.isMarketplaceLinuxImage = true; - return this; - } - - @Override - public VirtualMachineScaleSetImpl withGeneralizedLinuxCustomImage(String customImageId) { - ImageReference imageReferenceInner = new ImageReference(); - imageReferenceInner.withId(customImageId); - this - .innerModel() - .virtualMachineProfile() - .storageProfile() - .osDisk() - .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE); - this.innerModel().virtualMachineProfile().storageProfile().withImageReference(imageReferenceInner); - this.innerModel().virtualMachineProfile().osProfile().withLinuxConfiguration(new LinuxConfiguration()); - this.isMarketplaceLinuxImage = true; - return this; - } - - @Override - public VirtualMachineScaleSetImpl withSpecializedLinuxCustomImage(String customImageId) { - this.withGeneralizedLinuxCustomImage(customImageId); - this.removeOsProfile = true; - return this; - } - - @Override - public VirtualMachineScaleSetImpl withStoredLinuxImage(String imageUrl) { - VirtualHardDisk userImageVhd = new VirtualHardDisk(); - userImageVhd.withUri(imageUrl); - this - .innerModel() - .virtualMachineProfile() - .storageProfile() - .osDisk() - .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE); - this.innerModel().virtualMachineProfile().storageProfile().osDisk().withImage(userImageVhd); - // For platform image osType will be null, azure will pick it from the image metadata. - this.innerModel().virtualMachineProfile().storageProfile().osDisk().withOsType(OperatingSystemTypes.LINUX); - this.innerModel().virtualMachineProfile().osProfile().withLinuxConfiguration(new LinuxConfiguration()); - return this; - } - - @Override - public VirtualMachineScaleSetImpl withAdminUsername(String adminUserName) { - this.innerModel().virtualMachineProfile().osProfile().withAdminUsername(adminUserName); - return this; - } - - @Override - public VirtualMachineScaleSetImpl withRootUsername(String adminUserName) { - this.innerModel().virtualMachineProfile().osProfile().withAdminUsername(adminUserName); - return this; - } - - @Override - public VirtualMachineScaleSetImpl withAdminPassword(String password) { - this.innerModel().virtualMachineProfile().osProfile().withAdminPassword(password); - return this; - } - - @Override - public VirtualMachineScaleSetImpl withRootPassword(String password) { - this.innerModel().virtualMachineProfile().osProfile().withAdminPassword(password); - return this; - } - - @Override - public VirtualMachineScaleSetImpl withSsh(String publicKeyData) { - VirtualMachineScaleSetOSProfile osProfile = this.innerModel().virtualMachineProfile().osProfile(); - if (osProfile.linuxConfiguration().ssh() == null) { - SshConfiguration sshConfiguration = new SshConfiguration(); - sshConfiguration.withPublicKeys(new ArrayList()); - osProfile.linuxConfiguration().withSsh(sshConfiguration); - } - SshPublicKey sshPublicKey = new SshPublicKey(); - sshPublicKey.withKeyData(publicKeyData); - sshPublicKey.withPath("/home/" + osProfile.adminUsername() + "/.ssh/authorized_keys"); - osProfile.linuxConfiguration().ssh().publicKeys().add(sshPublicKey); - return this; - } - - @Override - public VirtualMachineScaleSetImpl withVMAgent() { - this.innerModel().virtualMachineProfile().osProfile().windowsConfiguration().withProvisionVMAgent(true); - return this; - } - - @Override - public VirtualMachineScaleSetImpl withoutVMAgent() { - this.innerModel().virtualMachineProfile().osProfile().windowsConfiguration().withProvisionVMAgent(false); - return this; - } - - @Override - public VirtualMachineScaleSetImpl withAutoUpdate() { - this.innerModel().virtualMachineProfile().osProfile().windowsConfiguration().withEnableAutomaticUpdates(true); - return this; - } - - @Override - public VirtualMachineScaleSetImpl withoutAutoUpdate() { - this.innerModel().virtualMachineProfile().osProfile().windowsConfiguration().withEnableAutomaticUpdates(false); - return this; - } - - @Override - public VirtualMachineScaleSetImpl withTimeZone(String timeZone) { - this.innerModel().virtualMachineProfile().osProfile().windowsConfiguration().withTimeZone(timeZone); - return this; - } - - @Override - public VirtualMachineScaleSetImpl withWinRM(WinRMListener listener) { - if (this.innerModel().virtualMachineProfile().osProfile().windowsConfiguration().winRM() == null) { - WinRMConfiguration winRMConfiguration = new WinRMConfiguration(); - this.innerModel().virtualMachineProfile().osProfile().windowsConfiguration().withWinRM(winRMConfiguration); - } - this.innerModel().virtualMachineProfile().osProfile().windowsConfiguration().winRM().listeners().add(listener); - return this; - } - - @Override - public VirtualMachineScaleSetImpl withOSDiskCaching(CachingTypes cachingType) { - this.innerModel().virtualMachineProfile().storageProfile().osDisk().withCaching(cachingType); - return this; - } - - @Override - public VirtualMachineScaleSetImpl withOSDiskName(String name) { - this.innerModel().virtualMachineProfile().storageProfile().osDisk().withName(name); - return this; - } - - @Override - public VirtualMachineScaleSetImpl withComputerNamePrefix(String namePrefix) { - this.innerModel().virtualMachineProfile().osProfile().withComputerNamePrefix(namePrefix); - return this; - } - - @Override - public VirtualMachineScaleSetImpl withUpgradeMode(UpgradeMode upgradeMode) { - if (this.innerModel().upgradePolicy() == null) { - this.innerModel().withUpgradePolicy(new UpgradePolicy()); - } - this.innerModel().upgradePolicy().withMode(upgradeMode); - return this; - } - - @Override - public VirtualMachineScaleSetImpl withOverProvision(boolean enabled) { - this.innerModel().withOverprovision(enabled); - return this; - } - - @Override - public VirtualMachineScaleSetImpl withOverProvisioning() { - return this.withOverProvision(true); - } - - @Override - public VirtualMachineScaleSetImpl withoutOverProvisioning() { - return this.withOverProvision(false); - } - - @Override - public VirtualMachineScaleSetImpl withCapacity(long capacity) { - this.innerModel().sku().withCapacity(capacity); - return this; - } - - @Override - public VirtualMachineScaleSetImpl withNewStorageAccount(String name) { - StorageAccount.DefinitionStages.WithGroup definitionWithGroup = - this.storageManager.storageAccounts().define(name).withRegion(this.regionName()); - Creatable definitionAfterGroup; - if (this.creatableGroup != null) { - definitionAfterGroup = definitionWithGroup.withNewResourceGroup(this.creatableGroup); - } else { - definitionAfterGroup = definitionWithGroup.withExistingResourceGroup(this.resourceGroupName()); - } - return withNewStorageAccount(definitionAfterGroup); - } - - @Override - public VirtualMachineScaleSetImpl withNewStorageAccount(Creatable creatable) { - this.creatableStorageAccountKeys.add(this.addDependency(creatable)); - return this; - } - - @Override - public VirtualMachineScaleSetImpl withExistingStorageAccount(StorageAccount storageAccount) { - this.existingStorageAccountsToAssociate.add(storageAccount); - return this; - } - - @Override - public VirtualMachineScaleSetImpl withCustomData(String base64EncodedCustomData) { - this.innerModel().virtualMachineProfile().osProfile().withCustomData(base64EncodedCustomData); - return this; - } - - @Override - public VirtualMachineScaleSetImpl withSecrets(List secrets) { - this.innerModel().virtualMachineProfile().osProfile().withSecrets(secrets); - return this; - } - - @Override - public VirtualMachineScaleSetImpl withoutSecrets() { - this.innerModel().virtualMachineProfile().osProfile().withSecrets(new ArrayList()); - return this; - } - - @Override - public VirtualMachineScaleSetExtensionImpl defineNewExtension(String name) { - return new VirtualMachineScaleSetExtensionImpl(new VirtualMachineScaleSetExtensionInner().withName(name), this); - } - - protected VirtualMachineScaleSetImpl withExtension(VirtualMachineScaleSetExtensionImpl extension) { - this.extensions.put(extension.name(), extension); - return this; - } - - @Override - public VirtualMachineScaleSetExtensionImpl updateExtension(String name) { - return (VirtualMachineScaleSetExtensionImpl) this.extensions.get(name); - } - - @Override - public VirtualMachineScaleSetImpl withoutExtension(String name) { - if (this.extensions.containsKey(name)) { - this.extensions.remove(name); - } - return this; - } - - @Override - public boolean isManagedDiskEnabled() { - VirtualMachineScaleSetStorageProfile storageProfile = - this.innerModel().virtualMachineProfile().storageProfile(); - if (isOsDiskFromCustomImage(storageProfile)) { - return true; - } - if (isOSDiskFromStoredImage(storageProfile)) { - return false; - } - if (isOSDiskFromPlatformImage(storageProfile)) { - if (this.isUnmanagedDiskSelected) { - return false; - } - } - if (isInCreateMode()) { - return true; - } else { - List vhdContainers = storageProfile.osDisk().vhdContainers(); - return vhdContainers == null || vhdContainers.size() == 0; - } - } - - @Override - public boolean isManagedServiceIdentityEnabled() { - ResourceIdentityType type = this.managedServiceIdentityType(); - return type != null && !type.equals(ResourceIdentityType.NONE); - } - - @Override - public String systemAssignedManagedServiceIdentityTenantId() { - if (this.innerModel().identity() != null) { - return this.innerModel().identity().tenantId(); - } - return null; - } - - @Override - public String systemAssignedManagedServiceIdentityPrincipalId() { - if (this.innerModel().identity() != null) { - return this.innerModel().identity().principalId(); - } - return null; - } - - @Override - public ResourceIdentityType managedServiceIdentityType() { - if (this.innerModel().identity() != null) { - return this.innerModel().identity().type(); - } - return null; - } - - @Override - public Set userAssignedManagedServiceIdentityIds() { - if (this.innerModel().identity() != null && this.innerModel().identity().userAssignedIdentities() != null) { - return Collections - .unmodifiableSet(new HashSet(this.innerModel().identity().userAssignedIdentities().keySet())); - } - return Collections.unmodifiableSet(new HashSet()); - } - - @Override - public Set availabilityZones() { - Set zones = new HashSet<>(); - if (this.innerModel().zones() != null) { - for (String zone : this.innerModel().zones()) { - zones.add(AvailabilityZoneId.fromString(zone)); - } - } - return Collections.unmodifiableSet(zones); - } - - @Override - public boolean isBootDiagnosticsEnabled() { - return this.bootDiagnosticsHandler.isBootDiagnosticsEnabled(); - } - - @Override - public String bootDiagnosticsStorageUri() { - return this.bootDiagnosticsHandler.bootDiagnosticsStorageUri(); - } - - @Override - public StorageAccountTypes managedOSDiskStorageAccountType() { - if (this.innerModel().virtualMachineProfile() != null - && this.innerModel().virtualMachineProfile().storageProfile() != null - && this.innerModel().virtualMachineProfile().storageProfile().osDisk() != null - && this.innerModel().virtualMachineProfile().storageProfile().osDisk().managedDisk() != null) { - return this - .innerModel() - .virtualMachineProfile() - .storageProfile() - .osDisk() - .managedDisk() - .storageAccountType(); - } - return null; - } - - @Override - public VirtualMachineScaleSetImpl withUnmanagedDisks() { - this.isUnmanagedDiskSelected = true; - return this; - } - - @Override - public VirtualMachineScaleSetImpl withNewDataDisk(int sizeInGB) { - throwIfManagedDiskDisabled(ManagedUnmanagedDiskErrors.VMSS_BOTH_UNMANAGED_AND_MANAGED_DISK_NOT_ALLOWED); - this - .managedDataDisks - .implicitDisksToAssociate - .add(new VirtualMachineScaleSetDataDisk().withLun(-1).withDiskSizeGB(sizeInGB)); - return this; - } - - @Override - public VirtualMachineScaleSetImpl withNewDataDisk(int sizeInGB, int lun, CachingTypes cachingType) { - throwIfManagedDiskDisabled(ManagedUnmanagedDiskErrors.VMSS_BOTH_UNMANAGED_AND_MANAGED_DISK_NOT_ALLOWED); - this - .managedDataDisks - .implicitDisksToAssociate - .add(new VirtualMachineScaleSetDataDisk().withLun(lun).withDiskSizeGB(sizeInGB).withCaching(cachingType)); - return this; - } - - @Override - public VirtualMachineScaleSetImpl withNewDataDisk( - int sizeInGB, int lun, CachingTypes cachingType, StorageAccountTypes storageAccountType) { - throwIfManagedDiskDisabled(ManagedUnmanagedDiskErrors.VMSS_BOTH_UNMANAGED_AND_MANAGED_DISK_NOT_ALLOWED); - VirtualMachineScaleSetManagedDiskParameters managedDiskParameters = - new VirtualMachineScaleSetManagedDiskParameters(); - managedDiskParameters.withStorageAccountType(storageAccountType); - this - .managedDataDisks - .implicitDisksToAssociate - .add( - new VirtualMachineScaleSetDataDisk() - .withLun(lun) - .withDiskSizeGB(sizeInGB) - .withCaching(cachingType) - .withManagedDisk(managedDiskParameters)); - return this; - } - - @Override - public VirtualMachineScaleSetImpl withoutDataDisk(int lun) { - if (!isManagedDiskEnabled()) { - return this; - } - this.managedDataDisks.diskLunsToRemove.add(lun); - return this; - } - - /* TODO: Broken by change in Azure API behavior - @Override - public VirtualMachineScaleSetImpl withDataDiskUpdated(int lun, int newSizeInGB) { - throwIfManagedDiskDisabled(ManagedUnmanagedDiskErrors.VMSS_NO_MANAGED_DISK_TO_UPDATE); - VirtualMachineScaleSetDataDisk dataDisk = getDataDiskInner(lun); - if (dataDisk == null) { - throw new RuntimeException(String.format("A data disk with lun '%d' not found", lun)); - } - dataDisk - .withDiskSizeGB(newSizeInGB); - return this; - } - - @Override - public VirtualMachineScaleSetImpl withDataDiskUpdated(int lun, int newSizeInGB, CachingTypes cachingType) { - throwIfManagedDiskDisabled(ManagedUnmanagedDiskErrors.VMSS_NO_MANAGED_DISK_TO_UPDATE); - VirtualMachineScaleSetDataDisk dataDisk = getDataDiskInner(lun); - if (dataDisk == null) { - throw new RuntimeException(String.format("A data disk with lun '%d' not found", lun)); - } - dataDisk - .withDiskSizeGB(newSizeInGB) - .withCaching(cachingType); - return this; - } - - @Override - public VirtualMachineScaleSetImpl withDataDiskUpdated(int lun, - int newSizeInGB, - CachingTypes cachingType, - StorageAccountTypes storageAccountType) { - throwIfManagedDiskDisabled(ManagedUnmanagedDiskErrors.VMSS_NO_MANAGED_DISK_TO_UPDATE); - VirtualMachineScaleSetDataDisk dataDisk = getDataDiskInner(lun); - if (dataDisk == null) { - throw new RuntimeException(String.format("A data disk with lun '%d' not found", lun)); - } - dataDisk - .withDiskSizeGB(newSizeInGB) - .withCaching(cachingType) - .managedDisk() - .withStorageAccountType(storageAccountType); - return this; - } - - private VirtualMachineScaleSetDataDisk getDataDiskInner(int lun) { - VirtualMachineScaleSetStorageProfile storageProfile = this - .inner() - .virtualMachineProfile() - .storageProfile(); - List dataDisks = storageProfile - .dataDisks(); - if (dataDisks == null) { - return null; - } - for (VirtualMachineScaleSetDataDisk dataDisk : dataDisks) { - if (dataDisk.lun() == lun) { - return dataDisk; - } - } - return null; - } - */ - - @Override - public VirtualMachineScaleSetImpl withNewDataDiskFromImage(int imageLun) { - this.managedDataDisks.newDisksFromImage.add(new VirtualMachineScaleSetDataDisk().withLun(imageLun)); - return this; - } - - @Override - public VirtualMachineScaleSetImpl withNewDataDiskFromImage( - int imageLun, int newSizeInGB, CachingTypes cachingType) { - this - .managedDataDisks - .newDisksFromImage - .add( - new VirtualMachineScaleSetDataDisk() - .withLun(imageLun) - .withDiskSizeGB(newSizeInGB) - .withCaching(cachingType)); - return this; - } - - @Override - public VirtualMachineScaleSetImpl withNewDataDiskFromImage( - int imageLun, int newSizeInGB, CachingTypes cachingType, StorageAccountTypes storageAccountType) { - VirtualMachineScaleSetManagedDiskParameters managedDiskParameters = - new VirtualMachineScaleSetManagedDiskParameters(); - managedDiskParameters.withStorageAccountType(storageAccountType); - this - .managedDataDisks - .newDisksFromImage - .add( - new VirtualMachineScaleSetDataDisk() - .withLun(imageLun) - .withDiskSizeGB(newSizeInGB) - .withManagedDisk(managedDiskParameters) - .withCaching(cachingType)); - return this; - } - - @Override - public VirtualMachineScaleSetImpl withOSDiskStorageAccountType(StorageAccountTypes accountType) { - // withers is limited to VMSS based on ManagedDisk. - this - .innerModel() - .virtualMachineProfile() - .storageProfile() - .osDisk() - .withManagedDisk(new VirtualMachineScaleSetManagedDiskParameters().withStorageAccountType(accountType)); - return this; - } - - @Override - public VirtualMachineScaleSetImpl withDataDiskDefaultCachingType(CachingTypes cachingType) { - this.managedDataDisks.setDefaultCachingType(cachingType); - return this; - } - - @Override - public VirtualMachineScaleSetImpl withDataDiskDefaultStorageAccountType(StorageAccountTypes storageAccountType) { - this.managedDataDisks.setDefaultStorageAccountType(storageAccountType); - return this; - } - - @Override - public VirtualMachineScaleSetImpl withSystemAssignedManagedServiceIdentity() { - this.virtualMachineScaleSetMsiHandler.withLocalManagedServiceIdentity(); - return this; - } - - @Override - public VirtualMachineScaleSetImpl withoutSystemAssignedManagedServiceIdentity() { - this.virtualMachineScaleSetMsiHandler.withoutLocalManagedServiceIdentity(); - return this; - } - - @Override - public VirtualMachineScaleSetImpl withSystemAssignedIdentityBasedAccessTo(String resourceId, BuiltInRole role) { - this.virtualMachineScaleSetMsiHandler.withAccessTo(resourceId, role); - return this; - } - - @Override - public VirtualMachineScaleSetImpl withSystemAssignedIdentityBasedAccessToCurrentResourceGroup(BuiltInRole asRole) { - this.virtualMachineScaleSetMsiHandler.withAccessToCurrentResourceGroup(asRole); - return this; - } - - @Override - public VirtualMachineScaleSetImpl withSystemAssignedIdentityBasedAccessTo(String scope, String roleDefinitionId) { - this.virtualMachineScaleSetMsiHandler.withAccessTo(scope, roleDefinitionId); - return this; - } - - @Override - public VirtualMachineScaleSetImpl withSystemAssignedIdentityBasedAccessToCurrentResourceGroup( - String roleDefinitionId) { - this.virtualMachineScaleSetMsiHandler.withAccessToCurrentResourceGroup(roleDefinitionId); - return this; - } - - @Override - public VirtualMachineScaleSetImpl withNewUserAssignedManagedServiceIdentity(Creatable creatableIdentity) { - this.virtualMachineScaleSetMsiHandler.withNewExternalManagedServiceIdentity(creatableIdentity); - return this; - } - - @Override - public VirtualMachineScaleSetImpl withExistingUserAssignedManagedServiceIdentity(Identity identity) { - this.virtualMachineScaleSetMsiHandler.withExistingExternalManagedServiceIdentity(identity); - return this; - } - - @Override - public VirtualMachineScaleSetImpl withoutUserAssignedManagedServiceIdentity(String identityId) { - this.virtualMachineScaleSetMsiHandler.withoutExternalManagedServiceIdentity(identityId); - return this; - } - - // Create Update specific methods - // - @Override - protected void beforeCreating() { - if (this.extensions.size() > 0) { - this - .innerModel() - .virtualMachineProfile() - .withExtensionProfile(new VirtualMachineScaleSetExtensionProfile()) - .extensionProfile() - .withExtensions(innersFromWrappers(this.extensions.values())); - } - } - - @Override - protected Mono createInner() { - if (isInCreateMode()) { - this.setOSProfileDefaults(); - this.setOSDiskDefault(); - } - this.setPrimaryIpConfigurationSubnet(); - return this - .setPrimaryIpConfigurationBackendsAndInboundNatPoolsAsync() - .flatMap( - virtualMachineScaleSet -> { - if (isManagedDiskEnabled()) { - this.managedDataDisks.setDataDisksDefaults(); - } else { - List dataDisks = - this.innerModel().virtualMachineProfile().storageProfile().dataDisks(); - VirtualMachineScaleSetUnmanagedDataDiskImpl.setDataDisksDefaults(dataDisks, this.name()); - } - this.handleUnManagedOSDiskContainers(); - this.bootDiagnosticsHandler.handleDiagnosticsSettings(); - this.virtualMachineScaleSetMsiHandler.processCreatedExternalIdentities(); - this.virtualMachineScaleSetMsiHandler.handleExternalIdentities(); - this.createNewProximityPlacementGroup(); - return this - .manager() - .serviceClient() - .getVirtualMachineScaleSets() - .createOrUpdateAsync(resourceGroupName(), name(), innerModel()); - }); - } - - @Override - protected void afterCreating() { - this.clearCachedProperties(); - this.virtualMachineScaleSetMsiHandler.clear(); - } - - @Override - public Mono updateResourceAsync() { - if (this.extensions.size() > 0) { - this - .innerModel() - .virtualMachineProfile() - .withExtensionProfile(new VirtualMachineScaleSetExtensionProfile()) - .extensionProfile() - .withExtensions(innersFromWrappers(this.extensions.values())); - } - this.setPrimaryIpConfigurationSubnet(); - final VirtualMachineScaleSetImpl self = this; - return this - .setPrimaryIpConfigurationBackendsAndInboundNatPoolsAsync() - .map( - virtualMachineScaleSet -> { - if (isManagedDiskEnabled()) { - this.managedDataDisks.setDataDisksDefaults(); - } else { - List dataDisks = - this.innerModel().virtualMachineProfile().storageProfile().dataDisks(); - VirtualMachineScaleSetUnmanagedDataDiskImpl.setDataDisksDefaults(dataDisks, this.name()); - } - this.handleUnManagedOSDiskContainers(); - this.bootDiagnosticsHandler.handleDiagnosticsSettings(); - this.virtualMachineScaleSetMsiHandler.processCreatedExternalIdentities(); - // - VirtualMachineScaleSetUpdate updateParameter = VMSSPatchPayload.preparePatchPayload(this); - // - this.virtualMachineScaleSetMsiHandler.handleExternalIdentities(updateParameter); - return updateParameter; - }) - .flatMap( - updateParameter -> - this - .manager() - .serviceClient() - .getVirtualMachineScaleSets() - .updateAsync(resourceGroupName(), name(), updateParameter) - .map( - vmssInner -> { - setInner(vmssInner); - self.clearCachedProperties(); - self.initializeChildrenFromInner(); - self.virtualMachineScaleSetMsiHandler.clear(); - return self; - })); - } - - @Override - public Mono refreshAsync() { - return super - .refreshAsync() - .map( - scaleSet -> { - VirtualMachineScaleSetImpl impl = (VirtualMachineScaleSetImpl) scaleSet; - impl.clearCachedProperties(); - impl.initializeChildrenFromInner(); - return impl; - }); - } - - @Override - protected Mono getInnerAsync() { - return this - .manager() - .serviceClient() - .getVirtualMachineScaleSets() - .getByResourceGroupAsync(this.resourceGroupName(), this.name()); - } - - // Helpers - // - - private boolean isInUpdateMode() { - return !this.isInCreateMode(); - } - - private void setOSProfileDefaults() { - if (isInUpdateMode()) { - return; - } - if (this.innerModel().sku().capacity() == null) { - this.withCapacity(2); - } - if (this.innerModel().upgradePolicy() == null || this.innerModel().upgradePolicy().mode() == null) { - this.innerModel().withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.AUTOMATIC)); - } - VirtualMachineScaleSetOSProfile osProfile = this.innerModel().virtualMachineProfile().osProfile(); - VirtualMachineScaleSetOSDisk osDisk = this.innerModel().virtualMachineProfile().storageProfile().osDisk(); - if (!removeOsProfile && isOSDiskFromImage(osDisk)) { - // ODDisk CreateOption: FROM_IMAGE - // - if (this.osType() == OperatingSystemTypes.LINUX || this.isMarketplaceLinuxImage) { - if (osProfile.linuxConfiguration() == null) { - osProfile.withLinuxConfiguration(new LinuxConfiguration()); - } - osProfile.linuxConfiguration().withDisablePasswordAuthentication(osProfile.adminPassword() == null); - } - if (this.computerNamePrefix() == null) { - // VM name cannot contain only numeric values and cannot exceed 15 chars - if (this.name().matches("[0-9]+")) { - withComputerNamePrefix(this.namer.getRandomName("vmss-vm", 12)); - } else if (this.name().length() <= 12) { - withComputerNamePrefix(this.name() + "-vm"); - } else { - withComputerNamePrefix(this.namer.getRandomName("vmss-vm", 12)); - } - } - } else { - // NOP [ODDisk CreateOption: ATTACH, ATTACH is not supported for VMSS] - this.innerModel().virtualMachineProfile().withOsProfile(null); - } - } - - private void setOSDiskDefault() { - if (isInUpdateMode()) { - return; - } - VirtualMachineScaleSetStorageProfile storageProfile = - this.innerModel().virtualMachineProfile().storageProfile(); - VirtualMachineScaleSetOSDisk osDisk = storageProfile.osDisk(); - if (isOSDiskFromImage(osDisk)) { - // ODDisk CreateOption: FROM_IMAGE - // - if (isManagedDiskEnabled()) { - // Note: - // Managed disk - // Supported: PlatformImage and CustomImage - // UnSupported: StoredImage - // - if (osDisk.managedDisk() == null) { - osDisk.withManagedDisk(new VirtualMachineScaleSetManagedDiskParameters()); - } - if (osDisk.managedDisk().storageAccountType() == null) { - osDisk.managedDisk().withStorageAccountType(StorageAccountTypes.STANDARD_LRS); - } - osDisk.withVhdContainers(null); - // We won't set osDisk.name() explicitly for managed disk, if it is null CRP generates unique - // name for the disk resource within the resource group. - } else { - // Note: - // Native (un-managed) disk - // Supported: PlatformImage and StoredImage - // UnSupported: CustomImage - // - osDisk.withManagedDisk(null); - if (osDisk.name() == null) { - withOSDiskName(this.name() + "-os-disk"); - } - } - } - if (this.osDiskCachingType() == null) { - withOSDiskCaching(CachingTypes.READ_WRITE); - } - } - - @Override - public void beforeGroupCreateOrUpdate() { - // Adding delayed storage account dependency if needed - // - this.prepareOSDiskContainers(); - this.bootDiagnosticsHandler.prepare(); - } - - protected void prepareOSDiskContainers() { - if (isManagedDiskEnabled()) { - return; - } - final VirtualMachineScaleSetStorageProfile storageProfile = - innerModel().virtualMachineProfile().storageProfile(); - if (isOSDiskFromStoredImage(storageProfile)) { - // There is a restriction currently that virtual machine's disk cannot be stored in multiple storage - // accounts if scale set is based on stored image. Remove this check once azure start supporting it. - // - return; - } - if (this.isInCreateMode() - && this.creatableStorageAccountKeys.isEmpty() - && this.existingStorageAccountsToAssociate.isEmpty()) { - String accountName = this.namer.getRandomName("stg", 24).replace("-", ""); - Creatable storageAccountCreatable; - if (this.creatableGroup != null) { - storageAccountCreatable = - this - .storageManager - .storageAccounts() - .define(accountName) - .withRegion(this.regionName()) - .withNewResourceGroup(this.creatableGroup); - } else { - storageAccountCreatable = - this - .storageManager - .storageAccounts() - .define(accountName) - .withRegion(this.regionName()) - .withExistingResourceGroup(this.resourceGroupName()); - } - this.creatableStorageAccountKeys.add(this.addDependency(storageAccountCreatable)); - } - } - - private void handleUnManagedOSDiskContainers() { - final VirtualMachineScaleSetStorageProfile storageProfile = - innerModel().virtualMachineProfile().storageProfile(); - if (isManagedDiskEnabled()) { - storageProfile.osDisk().withVhdContainers(null); - return; - } - if (isOSDiskFromStoredImage(storageProfile)) { - // There is a restriction currently that virtual machine's disk cannot be stored in multiple storage - // accounts if scale set is based on stored image. Remove this check once azure start supporting it. - // - storageProfile.osDisk().vhdContainers().clear(); - return; - } - - String containerName = null; - for (String containerUrl : storageProfile.osDisk().vhdContainers()) { - containerName = containerUrl.substring(containerUrl.lastIndexOf("/") + 1); - break; - } - - if (containerName == null) { - containerName = "vhds"; - } - - if (isInCreateMode() - && this.creatableStorageAccountKeys.isEmpty() - && this.existingStorageAccountsToAssociate.isEmpty()) { - throw logger - .logExceptionAsError( - new IllegalStateException("Expected storage account(s) for VMSS OS disk containers not found")); - } - - for (String storageAccountKey : this.creatableStorageAccountKeys) { - StorageAccount storageAccount = this.taskResult(storageAccountKey); - storageProfile - .osDisk() - .vhdContainers() - .add(mergePath(storageAccount.endPoints().primary().blob(), containerName)); - } - - for (StorageAccount storageAccount : this.existingStorageAccountsToAssociate) { - storageProfile - .osDisk() - .vhdContainers() - .add(mergePath(storageAccount.endPoints().primary().blob(), containerName)); - } - this.creatableStorageAccountKeys.clear(); - this.existingStorageAccountsToAssociate.clear(); - } - - private void setPrimaryIpConfigurationSubnet() { - if (isInUpdateMode()) { - return; - } - - VirtualMachineScaleSetIpConfiguration ipConfig = this.primaryNicDefaultIpConfiguration(); - ipConfig.withSubnet(new ApiEntityReference().withId(this.existingPrimaryNetworkSubnetNameToAssociate)); - this.existingPrimaryNetworkSubnetNameToAssociate = null; - } - - private Mono setPrimaryIpConfigurationBackendsAndInboundNatPoolsAsync() { - if (isInCreateMode()) { - return Mono.just(this); - } - - try { - return this - .loadCurrentPrimaryLoadBalancersIfAvailableAsync() - .map( - virtualMachineScaleSet -> { - VirtualMachineScaleSetIpConfiguration primaryIpConfig = primaryNicDefaultIpConfiguration(); - if (this.primaryInternetFacingLoadBalancer != null) { - removeBackendsFromIpConfiguration( - this.primaryInternetFacingLoadBalancer.id(), - primaryIpConfig, - this.primaryInternetFacingLBBackendsToRemoveOnUpdate.toArray(new String[0])); - - associateBackEndsToIpConfiguration( - primaryInternetFacingLoadBalancer.id(), - primaryIpConfig, - this.primaryInternetFacingLBBackendsToAddOnUpdate.toArray(new String[0])); - - removeInboundNatPoolsFromIpConfiguration( - this.primaryInternetFacingLoadBalancer.id(), - primaryIpConfig, - this.primaryInternetFacingLBInboundNatPoolsToRemoveOnUpdate.toArray(new String[0])); - - associateInboundNATPoolsToIpConfiguration( - primaryInternetFacingLoadBalancer.id(), - primaryIpConfig, - this.primaryInternetFacingLBInboundNatPoolsToAddOnUpdate.toArray(new String[0])); - } - - if (this.primaryInternalLoadBalancer != null) { - removeBackendsFromIpConfiguration( - this.primaryInternalLoadBalancer.id(), - primaryIpConfig, - this.primaryInternalLBBackendsToRemoveOnUpdate.toArray(new String[0])); - - associateBackEndsToIpConfiguration( - primaryInternalLoadBalancer.id(), - primaryIpConfig, - this.primaryInternalLBBackendsToAddOnUpdate.toArray(new String[0])); - - removeInboundNatPoolsFromIpConfiguration( - this.primaryInternalLoadBalancer.id(), - primaryIpConfig, - this.primaryInternalLBInboundNatPoolsToRemoveOnUpdate.toArray(new String[0])); - - associateInboundNATPoolsToIpConfiguration( - primaryInternalLoadBalancer.id(), - primaryIpConfig, - this.primaryInternalLBInboundNatPoolsToAddOnUpdate.toArray(new String[0])); - } - - if (this.removePrimaryInternetFacingLoadBalancerOnUpdate) { - if (this.primaryInternetFacingLoadBalancer != null) { - removeLoadBalancerAssociationFromIpConfiguration( - this.primaryInternetFacingLoadBalancer, primaryIpConfig); - } - } - - if (this.removePrimaryInternalLoadBalancerOnUpdate) { - if (this.primaryInternalLoadBalancer != null) { - removeLoadBalancerAssociationFromIpConfiguration( - this.primaryInternalLoadBalancer, primaryIpConfig); - } - } - - if (this.primaryInternetFacingLoadBalancerToAttachOnUpdate != null) { - if (this.primaryInternetFacingLoadBalancer != null) { - removeLoadBalancerAssociationFromIpConfiguration( - this.primaryInternetFacingLoadBalancer, primaryIpConfig); - } - associateLoadBalancerToIpConfiguration( - this.primaryInternetFacingLoadBalancerToAttachOnUpdate, primaryIpConfig); - if (!this.primaryInternetFacingLBBackendsToAddOnUpdate.isEmpty()) { - removeAllBackendAssociationFromIpConfiguration( - this.primaryInternetFacingLoadBalancerToAttachOnUpdate, primaryIpConfig); - associateBackEndsToIpConfiguration( - this.primaryInternetFacingLoadBalancerToAttachOnUpdate.id(), - primaryIpConfig, - this.primaryInternetFacingLBBackendsToAddOnUpdate.toArray(new String[0])); - } - if (!this.primaryInternetFacingLBInboundNatPoolsToAddOnUpdate.isEmpty()) { - removeAllInboundNatPoolAssociationFromIpConfiguration( - this.primaryInternetFacingLoadBalancerToAttachOnUpdate, primaryIpConfig); - associateInboundNATPoolsToIpConfiguration( - this.primaryInternetFacingLoadBalancerToAttachOnUpdate.id(), - primaryIpConfig, - this.primaryInternetFacingLBInboundNatPoolsToAddOnUpdate.toArray(new String[0])); - } - } - - if (this.primaryInternalLoadBalancerToAttachOnUpdate != null) { - if (this.primaryInternalLoadBalancer != null) { - removeLoadBalancerAssociationFromIpConfiguration( - this.primaryInternalLoadBalancer, primaryIpConfig); - } - associateLoadBalancerToIpConfiguration( - this.primaryInternalLoadBalancerToAttachOnUpdate, primaryIpConfig); - if (!this.primaryInternalLBBackendsToAddOnUpdate.isEmpty()) { - removeAllBackendAssociationFromIpConfiguration( - this.primaryInternalLoadBalancerToAttachOnUpdate, primaryIpConfig); - associateBackEndsToIpConfiguration( - this.primaryInternalLoadBalancerToAttachOnUpdate.id(), - primaryIpConfig, - this.primaryInternalLBBackendsToAddOnUpdate.toArray(new String[0])); - } - - if (!this.primaryInternalLBInboundNatPoolsToAddOnUpdate.isEmpty()) { - removeAllInboundNatPoolAssociationFromIpConfiguration( - this.primaryInternalLoadBalancerToAttachOnUpdate, primaryIpConfig); - associateInboundNATPoolsToIpConfiguration( - this.primaryInternalLoadBalancerToAttachOnUpdate.id(), - primaryIpConfig, - this.primaryInternalLBInboundNatPoolsToAddOnUpdate.toArray(new String[0])); - } - } - - this.removePrimaryInternetFacingLoadBalancerOnUpdate = false; - this.removePrimaryInternalLoadBalancerOnUpdate = false; - this.primaryInternetFacingLoadBalancerToAttachOnUpdate = null; - this.primaryInternalLoadBalancerToAttachOnUpdate = null; - this.primaryInternetFacingLBBackendsToRemoveOnUpdate.clear(); - this.primaryInternetFacingLBInboundNatPoolsToRemoveOnUpdate.clear(); - this.primaryInternalLBBackendsToRemoveOnUpdate.clear(); - this.primaryInternalLBInboundNatPoolsToRemoveOnUpdate.clear(); - this.primaryInternetFacingLBBackendsToAddOnUpdate.clear(); - this.primaryInternetFacingLBInboundNatPoolsToAddOnUpdate.clear(); - this.primaryInternalLBBackendsToAddOnUpdate.clear(); - this.primaryInternalLBInboundNatPoolsToAddOnUpdate.clear(); - return this; - }); - } catch (IOException ioException) { - throw logger.logExceptionAsError(new RuntimeException(ioException)); - } - } - - private void clearCachedProperties() { - this.primaryInternetFacingLoadBalancer = null; - this.primaryInternalLoadBalancer = null; - } - - private Mono loadCurrentPrimaryLoadBalancersIfAvailableAsync() throws IOException { - Mono self = Mono.just(this); - if (this.primaryInternetFacingLoadBalancer != null && this.primaryInternalLoadBalancer != null) { - return self; - } - - String firstLoadBalancerId = null; - VirtualMachineScaleSetIpConfiguration ipConfig = primaryNicDefaultIpConfiguration(); - if (!ipConfig.loadBalancerBackendAddressPools().isEmpty()) { - firstLoadBalancerId = - ResourceUtils.parentResourceIdFromResourceId(ipConfig.loadBalancerBackendAddressPools().get(0).id()); - } - - if (firstLoadBalancerId == null && !ipConfig.loadBalancerInboundNatPools().isEmpty()) { - firstLoadBalancerId = - ResourceUtils.parentResourceIdFromResourceId(ipConfig.loadBalancerInboundNatPools().get(0).id()); - } - - if (firstLoadBalancerId == null) { - return self; - } - - self = - self - .concatWith( - Mono - .just(firstLoadBalancerId) - .flatMap( - id -> - this - .networkManager - .loadBalancers() - .getByIdAsync(id) - .map( - loadBalancer1 -> { - if (loadBalancer1.publicIpAddressIds() != null - && loadBalancer1.publicIpAddressIds().size() > 0) { - this.primaryInternetFacingLoadBalancer = loadBalancer1; - } else { - this.primaryInternalLoadBalancer = loadBalancer1; - } - return this; - }))) - .last(); - - String secondLoadBalancerId = null; - for (SubResource subResource : ipConfig.loadBalancerBackendAddressPools()) { - if (!subResource.id().toLowerCase(Locale.ROOT).startsWith(firstLoadBalancerId.toLowerCase(Locale.ROOT))) { - secondLoadBalancerId = ResourceUtils.parentResourceIdFromResourceId(subResource.id()); - break; - } - } - - if (secondLoadBalancerId == null) { - for (SubResource subResource : ipConfig.loadBalancerInboundNatPools()) { - if (!subResource - .id() - .toLowerCase(Locale.ROOT) - .startsWith(firstLoadBalancerId.toLowerCase(Locale.ROOT))) { - secondLoadBalancerId = ResourceUtils.parentResourceIdFromResourceId(subResource.id()); - break; - } - } - } - - if (secondLoadBalancerId == null) { - return self; - } - - return self - .concatWith( - Mono - .just(secondLoadBalancerId) - .flatMap( - id -> - networkManager - .loadBalancers() - .getByIdAsync(id) - .map( - loadBalancer2 -> { - if (loadBalancer2.publicIpAddressIds() != null - && loadBalancer2.publicIpAddressIds().size() > 0) { - this.primaryInternetFacingLoadBalancer = loadBalancer2; - } else { - this.primaryInternalLoadBalancer = loadBalancer2; - } - return this; - }))) - .last(); - } - - private VirtualMachineScaleSetIpConfiguration primaryNicDefaultIpConfiguration() { - List nicConfigurations = - this.innerModel().virtualMachineProfile().networkProfile().networkInterfaceConfigurations(); - - for (VirtualMachineScaleSetNetworkConfiguration nicConfiguration : nicConfigurations) { - if (nicConfiguration.primary()) { - if (nicConfiguration.ipConfigurations().size() > 0) { - VirtualMachineScaleSetIpConfiguration ipConfig = nicConfiguration.ipConfigurations().get(0); - if (ipConfig.loadBalancerBackendAddressPools() == null) { - ipConfig.withLoadBalancerBackendAddressPools(new ArrayList<>()); - } - if (ipConfig.loadBalancerInboundNatPools() == null) { - ipConfig.withLoadBalancerInboundNatPools(new ArrayList<>()); - } - return ipConfig; - } - } - } - throw logger - .logExceptionAsError( - new RuntimeException("Could not find the primary nic configuration or an IP configuration in it")); - } - - private VirtualMachineScaleSetNetworkConfiguration primaryNicConfiguration() { - List nicConfigurations = - this.innerModel().virtualMachineProfile().networkProfile().networkInterfaceConfigurations(); - - for (VirtualMachineScaleSetNetworkConfiguration nicConfiguration : nicConfigurations) { - if (nicConfiguration.primary()) { - return nicConfiguration; - } - } - throw logger.logExceptionAsError(new RuntimeException("Could not find the primary nic configuration")); - } - - private static void associateBackEndsToIpConfiguration( - String loadBalancerId, VirtualMachineScaleSetIpConfiguration ipConfig, String... backendNames) { - List backendSubResourcesToAssociate = new ArrayList<>(); - for (String backendName : backendNames) { - String backendPoolId = mergePath(loadBalancerId, "backendAddressPools", backendName); - boolean found = false; - for (SubResource subResource : ipConfig.loadBalancerBackendAddressPools()) { - if (subResource.id().equalsIgnoreCase(backendPoolId)) { - found = true; - break; - } - } - if (!found) { - backendSubResourcesToAssociate.add(new SubResource().withId(backendPoolId)); - } - } - - for (SubResource backendSubResource : backendSubResourcesToAssociate) { - ipConfig.loadBalancerBackendAddressPools().add(backendSubResource); - } - } - - private static void associateInboundNATPoolsToIpConfiguration( - String loadBalancerId, VirtualMachineScaleSetIpConfiguration ipConfig, String... inboundNatPools) { - List inboundNatPoolSubResourcesToAssociate = new ArrayList<>(); - for (String inboundNatPool : inboundNatPools) { - String inboundNatPoolId = mergePath(loadBalancerId, "inboundNatPools", inboundNatPool); - boolean found = false; - for (SubResource subResource : ipConfig.loadBalancerInboundNatPools()) { - if (subResource.id().equalsIgnoreCase(inboundNatPoolId)) { - found = true; - break; - } - } - if (!found) { - inboundNatPoolSubResourcesToAssociate.add(new SubResource().withId(inboundNatPoolId)); - } - } - - for (SubResource backendSubResource : inboundNatPoolSubResourcesToAssociate) { - ipConfig.loadBalancerInboundNatPools().add(backendSubResource); - } - } - - private static Map getBackendsAssociatedWithIpConfiguration( - LoadBalancer loadBalancer, VirtualMachineScaleSetIpConfiguration ipConfig) { - String loadBalancerId = loadBalancer.id(); - Map attachedBackends = new HashMap<>(); - Map lbBackends = loadBalancer.backends(); - for (LoadBalancerBackend lbBackend : lbBackends.values()) { - String backendId = mergePath(loadBalancerId, "backendAddressPools", lbBackend.name()); - for (SubResource subResource : ipConfig.loadBalancerBackendAddressPools()) { - if (subResource.id().equalsIgnoreCase(backendId)) { - attachedBackends.put(lbBackend.name(), lbBackend); - } - } - } - return attachedBackends; - } - - private static Map getInboundNatPoolsAssociatedWithIpConfiguration( - LoadBalancer loadBalancer, VirtualMachineScaleSetIpConfiguration ipConfig) { - String loadBalancerId = loadBalancer.id(); - Map attachedInboundNatPools = new HashMap<>(); - Map lbInboundNatPools = loadBalancer.inboundNatPools(); - for (LoadBalancerInboundNatPool lbInboundNatPool : lbInboundNatPools.values()) { - String inboundNatPoolId = mergePath(loadBalancerId, "inboundNatPools", lbInboundNatPool.name()); - for (SubResource subResource : ipConfig.loadBalancerInboundNatPools()) { - if (subResource.id().equalsIgnoreCase(inboundNatPoolId)) { - attachedInboundNatPools.put(lbInboundNatPool.name(), lbInboundNatPool); - } - } - } - return attachedInboundNatPools; - } - - private static void associateLoadBalancerToIpConfiguration( - LoadBalancer loadBalancer, VirtualMachineScaleSetIpConfiguration ipConfig) { - Collection backends = loadBalancer.backends().values(); - String[] backendNames = new String[backends.size()]; - int i = 0; - for (LoadBalancerBackend backend : backends) { - backendNames[i] = backend.name(); - i++; - } - - associateBackEndsToIpConfiguration(loadBalancer.id(), ipConfig, backendNames); - - Collection inboundNatPools = loadBalancer.inboundNatPools().values(); - String[] natPoolNames = new String[inboundNatPools.size()]; - i = 0; - for (LoadBalancerInboundNatPool inboundNatPool : inboundNatPools) { - natPoolNames[i] = inboundNatPool.name(); - i++; - } - - associateInboundNATPoolsToIpConfiguration(loadBalancer.id(), ipConfig, natPoolNames); - } - - private static void removeLoadBalancerAssociationFromIpConfiguration( - LoadBalancer loadBalancer, VirtualMachineScaleSetIpConfiguration ipConfig) { - removeAllBackendAssociationFromIpConfiguration(loadBalancer, ipConfig); - removeAllInboundNatPoolAssociationFromIpConfiguration(loadBalancer, ipConfig); - } - - private static void removeAllBackendAssociationFromIpConfiguration( - LoadBalancer loadBalancer, VirtualMachineScaleSetIpConfiguration ipConfig) { - List toRemove = new ArrayList<>(); - for (SubResource subResource : ipConfig.loadBalancerBackendAddressPools()) { - if (subResource - .id() - .toLowerCase(Locale.ROOT) - .startsWith(loadBalancer.id().toLowerCase(Locale.ROOT) + "/")) { - toRemove.add(subResource); - } - } - - for (SubResource subResource : toRemove) { - ipConfig.loadBalancerBackendAddressPools().remove(subResource); - } - } - - private static void removeAllInboundNatPoolAssociationFromIpConfiguration( - LoadBalancer loadBalancer, VirtualMachineScaleSetIpConfiguration ipConfig) { - List toRemove = new ArrayList<>(); - for (SubResource subResource : ipConfig.loadBalancerInboundNatPools()) { - if (subResource - .id() - .toLowerCase(Locale.ROOT) - .startsWith(loadBalancer.id().toLowerCase(Locale.ROOT) + "/")) { - toRemove.add(subResource); - } - } - - for (SubResource subResource : toRemove) { - ipConfig.loadBalancerInboundNatPools().remove(subResource); - } - } - - private static void removeBackendsFromIpConfiguration( - String loadBalancerId, VirtualMachineScaleSetIpConfiguration ipConfig, String... backendNames) { - List toRemove = new ArrayList<>(); - for (String backendName : backendNames) { - String backendPoolId = mergePath(loadBalancerId, "backendAddressPools", backendName); - for (SubResource subResource : ipConfig.loadBalancerBackendAddressPools()) { - if (subResource.id().equalsIgnoreCase(backendPoolId)) { - toRemove.add(subResource); - break; - } - } - } - - for (SubResource subResource : toRemove) { - ipConfig.loadBalancerBackendAddressPools().remove(subResource); - } - } - - private static void removeInboundNatPoolsFromIpConfiguration( - String loadBalancerId, VirtualMachineScaleSetIpConfiguration ipConfig, String... inboundNatPoolNames) { - List toRemove = new ArrayList<>(); - for (String natPoolName : inboundNatPoolNames) { - String inboundNatPoolId = mergePath(loadBalancerId, "inboundNatPools", natPoolName); - for (SubResource subResource : ipConfig.loadBalancerInboundNatPools()) { - if (subResource.id().equalsIgnoreCase(inboundNatPoolId)) { - toRemove.add(subResource); - break; - } - } - } - - for (SubResource subResource : toRemove) { - ipConfig.loadBalancerInboundNatPools().remove(subResource); - } - } - - private static void addToList(List list, T[] items) { - list.addAll(Arrays.asList(items)); - } - - private static String mergePath(String... segments) { - StringBuilder builder = new StringBuilder(); - for (String segment : segments) { - while (segment.length() > 1 && segment.endsWith("/")) { - segment = segment.substring(0, segment.length() - 1); - } - - if (segment.length() > 0) { - builder.append(segment); - builder.append("/"); - } - } - - String merged = builder.toString(); - if (merged.endsWith("/")) { - merged = merged.substring(0, merged.length() - 1); - } - return merged; - } - - RoleAssignmentHelper.IdProvider idProvider() { - return new RoleAssignmentHelper.IdProvider() { - @Override - public String principalId() { - if (innerModel() != null && innerModel().identity() != null) { - return innerModel().identity().principalId(); - } else { - return null; - } - } - - @Override - public String resourceId() { - if (innerModel() != null) { - return innerModel().id(); - } else { - return null; - } - } - }; - } - - protected VirtualMachineScaleSetImpl withUnmanagedDataDisk( - VirtualMachineScaleSetUnmanagedDataDiskImpl unmanagedDisk) { - if (this.innerModel().virtualMachineProfile().storageProfile().dataDisks() == null) { - this - .innerModel() - .virtualMachineProfile() - .storageProfile() - .withDataDisks(new ArrayList()); - } - List dataDisks = - this.innerModel().virtualMachineProfile().storageProfile().dataDisks(); - dataDisks.add(unmanagedDisk.innerModel()); - return this; - } - - @Override - public VirtualMachineScaleSetImpl withAvailabilityZone(AvailabilityZoneId zoneId) { - // Note: Only for virtual machine scale set, new zone can be specified, hence - // this option is available for both definition and update cases. - // - // - if (this.innerModel().zones() == null) { - this.innerModel().withZones(new ArrayList<>()); - } - this.innerModel().zones().add(zoneId.toString()); - return this; - } - - /** - * Checks whether the OS disk is based on an image (image from PIR or custom image [captured, bringYourOwnFeature]). - * - * @param osDisk the osDisk value in the storage profile - * @return true if the OS disk is configured to use image from PIR or custom image - */ - private boolean isOSDiskFromImage(VirtualMachineScaleSetOSDisk osDisk) { - return osDisk.createOption() == DiskCreateOptionTypes.FROM_IMAGE; - } - - /** - * Checks whether the OS disk is based on a CustomImage. - * - *

A custom image is represented by {@link VirtualMachineCustomImage}. - * - * @param storageProfile the storage profile - * @return true if the OS disk is configured to be based on custom image. - */ - private boolean isOsDiskFromCustomImage(VirtualMachineScaleSetStorageProfile storageProfile) { - ImageReference imageReference = storageProfile.imageReference(); - return isOSDiskFromImage(storageProfile.osDisk()) && imageReference != null && imageReference.id() != null; - } - - /** - * Checks whether the OS disk is based on an platform image (image in PIR). - * - * @param storageProfile the storage profile - * @return true if the OS disk is configured to be based on platform image. - */ - private boolean isOSDiskFromPlatformImage(VirtualMachineScaleSetStorageProfile storageProfile) { - ImageReference imageReference = storageProfile.imageReference(); - return isOSDiskFromImage(storageProfile.osDisk()) - && imageReference != null - && imageReference.publisher() != null - && imageReference.offer() != null - && imageReference.sku() != null - && imageReference.version() != null; - } - - /** - * Checks whether the OS disk is based on a stored image ('captured' or 'bring your own feature'). - * - * @param storageProfile the storage profile - * @return true if the OS disk is configured to use custom image ('captured' or 'bring your own feature') - */ - private boolean isOSDiskFromStoredImage(VirtualMachineScaleSetStorageProfile storageProfile) { - VirtualMachineScaleSetOSDisk osDisk = storageProfile.osDisk(); - return isOSDiskFromImage(osDisk) && osDisk.image() != null && osDisk.image().uri() != null; - } - - private void throwIfManagedDiskDisabled(String message) { - if (!this.isManagedDiskEnabled()) { - throw logger.logExceptionAsError(new UnsupportedOperationException(message)); - } - } - - @Override - public VirtualMachineScaleSetImpl withBootDiagnosticsOnManagedStorageAccount() { - this.bootDiagnosticsHandler.withBootDiagnostics(true); - return this; - } - - @Override - public VirtualMachineScaleSetImpl withBootDiagnostics() { - this.bootDiagnosticsHandler.withBootDiagnostics(false); - return this; - } - - @Override - public VirtualMachineScaleSetImpl withBootDiagnostics(Creatable creatable) { - this.bootDiagnosticsHandler.withBootDiagnostics(creatable); - return this; - } - - @Override - public VirtualMachineScaleSetImpl withBootDiagnostics(StorageAccount storageAccount) { - this.bootDiagnosticsHandler.withBootDiagnostics(storageAccount); - return this; - } - - @Override - public VirtualMachineScaleSetImpl withBootDiagnostics(String storageAccountBlobEndpointUri) { - this.bootDiagnosticsHandler.withBootDiagnostics(storageAccountBlobEndpointUri); - return this; - } - - @Override - public VirtualMachineScaleSetImpl withoutBootDiagnostics() { - this.bootDiagnosticsHandler.withoutBootDiagnostics(); - return this; - } - - @Override - public VirtualMachineScaleSetImpl withMaxPrice(Double maxPrice) { - this.innerModel().virtualMachineProfile().withBillingProfile(new BillingProfile().withMaxPrice(maxPrice)); - return this; - } - - @Override - public VirtualMachineScaleSetImpl withVirtualMachinePriority(VirtualMachinePriorityTypes priority) { - this.innerModel().virtualMachineProfile().withPriority(priority); - return this; - } - - @Override - public VirtualMachineScaleSetImpl withLowPriorityVirtualMachine() { - this.withVirtualMachinePriority(VirtualMachinePriorityTypes.LOW); - return this; - } - - @Override - public VirtualMachineScaleSetImpl withLowPriorityVirtualMachine(VirtualMachineEvictionPolicyTypes policy) { - this.withLowPriorityVirtualMachine(); - this.innerModel().virtualMachineProfile().withEvictionPolicy(policy); - return this; - } - - @Override - public VirtualMachineScaleSetImpl withSpotPriorityVirtualMachine() { - this.withVirtualMachinePriority(VirtualMachinePriorityTypes.SPOT); - return this; - } - - @Override - public VirtualMachineScaleSetImpl withSpotPriorityVirtualMachine(VirtualMachineEvictionPolicyTypes policy) { - this.withSpotPriorityVirtualMachine(); - this.innerModel().virtualMachineProfile().withEvictionPolicy(policy); - return this; - } - - @Override - public VirtualMachineScaleSetImpl withVirtualMachinePublicIp() { - VirtualMachineScaleSetIpConfiguration nicIpConfig = this.primaryNicDefaultIpConfiguration(); - if (nicIpConfig.publicIpAddressConfiguration() != null) { - return this; - } else { - VirtualMachineScaleSetPublicIpAddressConfiguration pipConfig = - new VirtualMachineScaleSetPublicIpAddressConfiguration(); - pipConfig.withName("pip1"); - pipConfig.withIdleTimeoutInMinutes(15); - // - nicIpConfig.withPublicIpAddressConfiguration(pipConfig); - return this; - } - } - - @Override - public VirtualMachineScaleSetImpl withVirtualMachinePublicIp(String leafDomainLabel) { - VirtualMachineScaleSetIpConfiguration nicIpConfig = this.primaryNicDefaultIpConfiguration(); - if (nicIpConfig.publicIpAddressConfiguration() != null) { - if (nicIpConfig.publicIpAddressConfiguration().dnsSettings() != null) { - nicIpConfig.publicIpAddressConfiguration().dnsSettings().withDomainNameLabel(leafDomainLabel); - } else { - nicIpConfig - .publicIpAddressConfiguration() - .withDnsSettings(new VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings()); - nicIpConfig.publicIpAddressConfiguration().dnsSettings().withDomainNameLabel(leafDomainLabel); - } - } else { - VirtualMachineScaleSetPublicIpAddressConfiguration pipConfig = - new VirtualMachineScaleSetPublicIpAddressConfiguration(); - pipConfig.withName("pip1"); - pipConfig.withIdleTimeoutInMinutes(15); - pipConfig.withDnsSettings(new VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings()); - pipConfig.dnsSettings().withDomainNameLabel(leafDomainLabel); - nicIpConfig.withPublicIpAddressConfiguration(pipConfig); - } - return this; - } - - @Override - public VirtualMachineScaleSetImpl withVirtualMachinePublicIp( - VirtualMachineScaleSetPublicIpAddressConfiguration pipConfig) { - VirtualMachineScaleSetIpConfiguration nicIpConfig = this.primaryNicDefaultIpConfiguration(); - nicIpConfig.withPublicIpAddressConfiguration(pipConfig); - return this; - } - - @Override - public VirtualMachineScaleSetImpl withAcceleratedNetworking() { - VirtualMachineScaleSetNetworkConfiguration nicConfig = this.primaryNicConfiguration(); - nicConfig.withEnableAcceleratedNetworking(true); - return this; - } - - @Override - public VirtualMachineScaleSetImpl withoutAcceleratedNetworking() { - VirtualMachineScaleSetNetworkConfiguration nicConfig = this.primaryNicConfiguration(); - nicConfig.withEnableAcceleratedNetworking(false); - return this; - } - - @Override - public VirtualMachineScaleSetImpl withIpForwarding() { - VirtualMachineScaleSetNetworkConfiguration nicConfig = this.primaryNicConfiguration(); - nicConfig.withEnableIpForwarding(true); - return this; - } - - @Override - public VirtualMachineScaleSetImpl withoutIpForwarding() { - VirtualMachineScaleSetNetworkConfiguration nicConfig = this.primaryNicConfiguration(); - nicConfig.withEnableIpForwarding(false); - return this; - } - - @Override - public VirtualMachineScaleSetImpl withExistingNetworkSecurityGroup(NetworkSecurityGroup networkSecurityGroup) { - VirtualMachineScaleSetNetworkConfiguration nicConfig = this.primaryNicConfiguration(); - nicConfig.withNetworkSecurityGroup(new SubResource().withId(networkSecurityGroup.id())); - return this; - } - - @Override - public VirtualMachineScaleSetImpl withExistingNetworkSecurityGroupId(String networkSecurityGroupId) { - VirtualMachineScaleSetNetworkConfiguration nicConfig = this.primaryNicConfiguration(); - nicConfig.withNetworkSecurityGroup(new SubResource().withId(networkSecurityGroupId)); - return this; - } - - @Override - public VirtualMachineScaleSetImpl withoutNetworkSecurityGroup() { - VirtualMachineScaleSetNetworkConfiguration nicConfig = this.primaryNicConfiguration(); - nicConfig.withNetworkSecurityGroup(null); - return this; - } - - @Override - public VirtualMachineScaleSetImpl withSinglePlacementGroup() { - this.innerModel().withSinglePlacementGroup(true); - return this; - } - - @Override - public VirtualMachineScaleSetImpl withoutSinglePlacementGroup() { - this.innerModel().withSinglePlacementGroup(false); - return this; - } - - @Override - public VirtualMachineScaleSetImpl withExistingApplicationGatewayBackendPool(String backendPoolId) { - VirtualMachineScaleSetIpConfiguration nicIpConfig = primaryNicDefaultIpConfiguration(); - if (nicIpConfig.applicationGatewayBackendAddressPools() == null) { - nicIpConfig.withApplicationGatewayBackendAddressPools(new ArrayList<>()); - } - boolean found = false; - for (SubResource backendPool : nicIpConfig.applicationGatewayBackendAddressPools()) { - if (backendPool.id().equalsIgnoreCase(backendPoolId)) { - found = true; - break; - } - } - if (!found) { - nicIpConfig.applicationGatewayBackendAddressPools().add(new SubResource().withId(backendPoolId)); - } - return this; - } - - @Override - public VirtualMachineScaleSetImpl withoutApplicationGatewayBackendPool(String backendPoolId) { - VirtualMachineScaleSetIpConfiguration nicIpConfig = primaryNicDefaultIpConfiguration(); - if (nicIpConfig.applicationGatewayBackendAddressPools() == null) { - return this; - } else { - int foundIndex = -1; - int index = -1; - for (SubResource backendPool : nicIpConfig.applicationGatewayBackendAddressPools()) { - index = index + 1; - if (backendPool.id().equalsIgnoreCase(backendPoolId)) { - foundIndex = index; - break; - } - } - if (foundIndex != -1) { - nicIpConfig.applicationGatewayBackendAddressPools().remove(foundIndex); - } - return this; - } - } - - @Override - public VirtualMachineScaleSetImpl withExistingApplicationSecurityGroup( - ApplicationSecurityGroup applicationSecurityGroup) { - return withExistingApplicationSecurityGroupId(applicationSecurityGroup.id()); - } - - @Override - public VirtualMachineScaleSetImpl withExistingApplicationSecurityGroupId(String applicationSecurityGroupId) { - VirtualMachineScaleSetIpConfiguration nicIpConfig = primaryNicDefaultIpConfiguration(); - if (nicIpConfig.applicationSecurityGroups() == null) { - nicIpConfig.withApplicationSecurityGroups(new ArrayList<>()); - } - boolean found = false; - for (SubResource asg : nicIpConfig.applicationSecurityGroups()) { - if (asg.id().equalsIgnoreCase(applicationSecurityGroupId)) { - found = true; - break; - } - } - if (!found) { - nicIpConfig.applicationSecurityGroups().add(new SubResource().withId(applicationSecurityGroupId)); - } - return this; - } - - @Override - public VirtualMachineScaleSetImpl withoutApplicationSecurityGroup(String applicationSecurityGroupId) { - VirtualMachineScaleSetIpConfiguration nicIpConfig = primaryNicDefaultIpConfiguration(); - if (nicIpConfig.applicationSecurityGroups() == null) { - return this; - } else { - int foundIndex = -1; - int index = -1; - for (SubResource asg : nicIpConfig.applicationSecurityGroups()) { - index = index + 1; - if (asg.id().equalsIgnoreCase(applicationSecurityGroupId)) { - foundIndex = index; - break; - } - } - if (foundIndex != -1) { - nicIpConfig.applicationSecurityGroups().remove(foundIndex); - } - return this; - } - } - - @Override - public VirtualMachineScaleSetImpl withProximityPlacementGroup(String proximityPlacementGroupId) { - this.innerModel().withProximityPlacementGroup(new SubResource().withId(proximityPlacementGroupId)); - this.newProximityPlacementGroupName = null; - return this; - } - - @Override - public VirtualMachineScaleSetImpl withNewProximityPlacementGroup( - String proximityPlacementGroupName, ProximityPlacementGroupType type) { - this.newProximityPlacementGroupName = proximityPlacementGroupName; - this.newProximityPlacementGroupType = type; - - this.innerModel().withProximityPlacementGroup(null); - - return this; - } - - @Override - public VirtualMachineScaleSetImpl withDoNotRunExtensionsOnOverprovisionedVMs( - Boolean doNotRunExtensionsOnOverprovisionedVMs) { - this.innerModel().withDoNotRunExtensionsOnOverprovisionedVMs(doNotRunExtensionsOnOverprovisionedVMs); - return this; - } - - @Override - public VirtualMachineScaleSetImpl withAdditionalCapabilities(AdditionalCapabilities additionalCapabilities) { - this.innerModel().withAdditionalCapabilities(additionalCapabilities); - return this; - } - - private void createNewProximityPlacementGroup() { - if (isInCreateMode()) { - if (this.newProximityPlacementGroupName != null && !this.newProximityPlacementGroupName.isEmpty()) { - ProximityPlacementGroupInner plgInner = new ProximityPlacementGroupInner(); - plgInner.withProximityPlacementGroupType(this.newProximityPlacementGroupType); - plgInner.withLocation(this.innerModel().location()); - plgInner = - this - .manager() - .serviceClient() - .getProximityPlacementGroups() - .createOrUpdate(this.resourceGroupName(), this.newProximityPlacementGroupName, plgInner); - - this.innerModel().withProximityPlacementGroup((new SubResource().withId(plgInner.id()))); - } - } - } - - /** Class to manage Data Disk collection. */ - private class ManagedDataDiskCollection { - private final List implicitDisksToAssociate = new ArrayList<>(); - private final List diskLunsToRemove = new ArrayList<>(); - private final List newDisksFromImage = new ArrayList<>(); - private final VirtualMachineScaleSetImpl vmss; - private CachingTypes defaultCachingType; - private StorageAccountTypes defaultStorageAccountType; - - ManagedDataDiskCollection(VirtualMachineScaleSetImpl vmss) { - this.vmss = vmss; - } - - void setDefaultCachingType(CachingTypes cachingType) { - this.defaultCachingType = cachingType; - } - - void setDefaultStorageAccountType(StorageAccountTypes defaultStorageAccountType) { - this.defaultStorageAccountType = defaultStorageAccountType; - } - - void setDataDisksDefaults() { - VirtualMachineScaleSetStorageProfile storageProfile = - this.vmss.innerModel().virtualMachineProfile().storageProfile(); - if (isPending()) { - if (storageProfile.dataDisks() == null) { - storageProfile.withDataDisks(new ArrayList<>()); - } - List dataDisks = storageProfile.dataDisks(); - final List usedLuns = new ArrayList<>(); - // Get all used luns - // - for (VirtualMachineScaleSetDataDisk dataDisk : dataDisks) { - if (dataDisk.lun() != -1) { - usedLuns.add(dataDisk.lun()); - } - } - for (VirtualMachineScaleSetDataDisk dataDisk : this.implicitDisksToAssociate) { - if (dataDisk.lun() != -1) { - usedLuns.add(dataDisk.lun()); - } - } - for (VirtualMachineScaleSetDataDisk dataDisk : this.newDisksFromImage) { - if (dataDisk.lun() != -1) { - usedLuns.add(dataDisk.lun()); - } - } - // Func to get the next available lun - // - Callable nextLun = - () -> { - Integer lun = 0; - while (usedLuns.contains(lun)) { - lun++; - } - usedLuns.add(lun); - return lun; - }; - try { - setImplicitDataDisks(nextLun); - } catch (Exception ex) { - throw logger.logExceptionAsError(Exceptions.propagate(ex)); - } - setImageBasedDataDisks(); - removeDataDisks(); - } - if (storageProfile.dataDisks() != null && storageProfile.dataDisks().size() == 0) { - if (vmss.isInCreateMode()) { - // If there is no data disks at all, then setting it to null rather than [] is necessary. - // This is for take advantage of CRP's implicit creation of the data disks if the image has - // more than one data disk image(s). - // - storageProfile.withDataDisks(null); - } - } - this.clear(); - } - - private void clear() { - implicitDisksToAssociate.clear(); - diskLunsToRemove.clear(); - newDisksFromImage.clear(); - } - - private boolean isPending() { - return implicitDisksToAssociate.size() > 0 || diskLunsToRemove.size() > 0 || newDisksFromImage.size() > 0; - } - - private void setImplicitDataDisks(Callable nextLun) throws Exception { - VirtualMachineScaleSetStorageProfile storageProfile = - this.vmss.innerModel().virtualMachineProfile().storageProfile(); - List dataDisks = storageProfile.dataDisks(); - for (VirtualMachineScaleSetDataDisk dataDisk : this.implicitDisksToAssociate) { - dataDisk.withCreateOption(DiskCreateOptionTypes.EMPTY); - if (dataDisk.lun() == -1) { - dataDisk.withLun(nextLun.call()); - } - if (dataDisk.managedDisk() == null) { - dataDisk.withManagedDisk(new VirtualMachineScaleSetManagedDiskParameters()); - } - if (dataDisk.caching() == null) { - dataDisk.withCaching(getDefaultCachingType()); - } - if (dataDisk.managedDisk().storageAccountType() == null) { - dataDisk.managedDisk().withStorageAccountType(getDefaultStorageAccountType()); - } - dataDisk.withName(null); - dataDisks.add(dataDisk); - } - } - - private void setImageBasedDataDisks() { - VirtualMachineScaleSetStorageProfile storageProfile = - this.vmss.innerModel().virtualMachineProfile().storageProfile(); - List dataDisks = storageProfile.dataDisks(); - for (VirtualMachineScaleSetDataDisk dataDisk : this.newDisksFromImage) { - dataDisk.withCreateOption(DiskCreateOptionTypes.FROM_IMAGE); - // Don't set default storage account type for the disk, either user has to specify it explicitly or let - // CRP pick it from the image - dataDisk.withName(null); - dataDisks.add(dataDisk); - } - } - - private void removeDataDisks() { - VirtualMachineScaleSetStorageProfile storageProfile = - this.vmss.innerModel().virtualMachineProfile().storageProfile(); - List dataDisks = storageProfile.dataDisks(); - for (Integer lun : this.diskLunsToRemove) { - int indexToRemove = 0; - for (VirtualMachineScaleSetDataDisk dataDisk : dataDisks) { - if (dataDisk.lun() == lun) { - dataDisks.remove(indexToRemove); - break; - } - indexToRemove++; - } - } - } - - private CachingTypes getDefaultCachingType() { - if (defaultCachingType == null) { - return CachingTypes.READ_WRITE; - } - return defaultCachingType; - } - - private StorageAccountTypes getDefaultStorageAccountType() { - if (defaultStorageAccountType == null) { - return StorageAccountTypes.STANDARD_LRS; - } - return defaultStorageAccountType; - } - } - - /** Class to manage VMSS boot diagnostics settings. */ - private class BootDiagnosticsHandler { - private final VirtualMachineScaleSetImpl vmssImpl; - private String creatableDiagnosticsStorageAccountKey; - private String creatableStorageAccountKey; - private StorageAccount existingStorageAccountToAssociate; - private boolean useManagedStorageAccount = false; - - BootDiagnosticsHandler(VirtualMachineScaleSetImpl vmssImpl) { - this.vmssImpl = vmssImpl; - if (isBootDiagnosticsEnabled() - && this.vmssInner().virtualMachineProfile() - .diagnosticsProfile().bootDiagnostics().storageUri() == null) { - this.useManagedStorageAccount = true; - } - } - - public boolean isBootDiagnosticsEnabled() { - DiagnosticsProfile diagnosticsProfile = this.vmssInner().virtualMachineProfile().diagnosticsProfile(); - if (diagnosticsProfile != null - && diagnosticsProfile.bootDiagnostics() != null - && diagnosticsProfile.bootDiagnostics().enabled() != null) { - return diagnosticsProfile.bootDiagnostics().enabled(); - } - return false; - } - - public String bootDiagnosticsStorageUri() { - DiagnosticsProfile diagnosticsProfile = this.vmssInner().virtualMachineProfile().diagnosticsProfile(); - // Even though diagnostics can disabled azure still keep the storage uri - if (diagnosticsProfile != null && diagnosticsProfile.bootDiagnostics() != null) { - return diagnosticsProfile.bootDiagnostics().storageUri(); - } - return null; - } - - BootDiagnosticsHandler withBootDiagnostics(boolean useManagedStorageAccount) { - // Diagnostics storage uri will be set later by this.handleDiagnosticsSettings(..) - // - this.enableDisable(true); - this.useManagedStorageAccount = useManagedStorageAccount; - return this; - } - - BootDiagnosticsHandler withBootDiagnostics(Creatable creatable) { - // Diagnostics storage uri will be set later by this.handleDiagnosticsSettings(..) - // - this.enableDisable(true); - this.useManagedStorageAccount = false; - this.creatableDiagnosticsStorageAccountKey = this.vmssImpl.addDependency(creatable); - return this; - } - - BootDiagnosticsHandler withBootDiagnostics(String storageAccountBlobEndpointUri) { - this.enableDisable(true); - this.useManagedStorageAccount = false; - this - .vmssInner() - .virtualMachineProfile() - .diagnosticsProfile() - .bootDiagnostics() - .withStorageUri(storageAccountBlobEndpointUri); - return this; - } - - BootDiagnosticsHandler withBootDiagnostics(StorageAccount storageAccount) { - return this.withBootDiagnostics(storageAccount.endPoints().primary().blob()); - } - - BootDiagnosticsHandler withoutBootDiagnostics() { - this.enableDisable(false); - this.useManagedStorageAccount = false; - return this; - } - - void prepare() { - if (useManagedStorageAccount) { - return; - } - - this.creatableStorageAccountKey = null; - this.existingStorageAccountToAssociate = null; - - DiagnosticsProfile diagnosticsProfile = this.vmssInner().virtualMachineProfile().diagnosticsProfile(); - if (diagnosticsProfile == null - || diagnosticsProfile.bootDiagnostics() == null - || diagnosticsProfile.bootDiagnostics().storageUri() != null) { - return; - } - boolean enableBD = ResourceManagerUtils.toPrimitiveBoolean(diagnosticsProfile.bootDiagnostics().enabled()); - if (!enableBD) { - return; - } - - if (this.creatableDiagnosticsStorageAccountKey != null) { - return; - } - if (!this.vmssImpl.creatableStorageAccountKeys.isEmpty()) { - this.creatableStorageAccountKey = this.vmssImpl.creatableStorageAccountKeys.get(0); - return; - } - if (!this.vmssImpl.existingStorageAccountsToAssociate.isEmpty()) { - this.existingStorageAccountToAssociate = this.vmssImpl.existingStorageAccountsToAssociate.get(0); - return; - } - - String accountName = this.vmssImpl.namer.getRandomName("stg", 24).replace("-", ""); - Creatable storageAccountCreatable; - if (this.vmssImpl.creatableGroup != null) { - storageAccountCreatable = - this - .vmssImpl - .storageManager - .storageAccounts() - .define(accountName) - .withRegion(this.vmssImpl.regionName()) - .withNewResourceGroup(this.vmssImpl.creatableGroup); - } else { - storageAccountCreatable = - this - .vmssImpl - .storageManager - .storageAccounts() - .define(accountName) - .withRegion(this.vmssImpl.regionName()) - .withExistingResourceGroup(this.vmssImpl.resourceGroupName()); - } - this.creatableDiagnosticsStorageAccountKey = this.vmssImpl.addDependency(storageAccountCreatable); - } - - void handleDiagnosticsSettings() { - if (useManagedStorageAccount) { - return; - } - - DiagnosticsProfile diagnosticsProfile = this.vmssInner().virtualMachineProfile().diagnosticsProfile(); - if (diagnosticsProfile == null - || diagnosticsProfile.bootDiagnostics() == null - || diagnosticsProfile.bootDiagnostics().storageUri() != null) { - return; - } - boolean enableBD = ResourceManagerUtils.toPrimitiveBoolean(diagnosticsProfile.bootDiagnostics().enabled()); - if (!enableBD) { - return; - } - StorageAccount storageAccount = null; - if (creatableDiagnosticsStorageAccountKey != null) { - storageAccount = this.vmssImpl.taskResult(creatableDiagnosticsStorageAccountKey); - } else if (this.creatableStorageAccountKey != null) { - storageAccount = this.vmssImpl.taskResult(this.creatableStorageAccountKey); - } else if (this.existingStorageAccountToAssociate != null) { - storageAccount = this.existingStorageAccountToAssociate; - } - if (storageAccount == null) { - throw logger - .logExceptionAsError( - new IllegalStateException( - "Unable to retrieve expected storageAccount instance for BootDiagnostics")); - } - vmssInner() - .virtualMachineProfile() - .diagnosticsProfile() - .bootDiagnostics() - .withStorageUri(storageAccount.endPoints().primary().blob()); - } - - private VirtualMachineScaleSetInner vmssInner() { - // Inner cannot be cached as parent VirtualMachineScaleSetImpl can refresh the inner in various cases - // - return this.vmssImpl.innerModel(); - } - - private void enableDisable(boolean enable) { - if (this.vmssInner().virtualMachineProfile().diagnosticsProfile() == null) { - this.vmssInner().virtualMachineProfile().withDiagnosticsProfile(new DiagnosticsProfile()); - } - if (this.vmssInner().virtualMachineProfile().diagnosticsProfile().bootDiagnostics() == null) { - this - .vmssInner() - .virtualMachineProfile() - .diagnosticsProfile() - .withBootDiagnostics(new BootDiagnostics()); - } - if (enable) { - this.vmssInner().virtualMachineProfile().diagnosticsProfile().bootDiagnostics().withEnabled(true); - } else { - this.vmssInner().virtualMachineProfile().diagnosticsProfile().bootDiagnostics().withEnabled(false); - this.vmssInner().virtualMachineProfile().diagnosticsProfile().bootDiagnostics().withStorageUri(null); - } - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineScaleSetMsiHandler.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineScaleSetMsiHandler.java deleted file mode 100644 index 5f0c5a436d4c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineScaleSetMsiHandler.java +++ /dev/null @@ -1,274 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.implementation; - -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.models.ResourceIdentityType; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetIdentity; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetIdentityUserAssignedIdentities; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetUpdate; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineScaleSetInner; -import com.azure.resourcemanager.authorization.AuthorizationManager; -import com.azure.resourcemanager.authorization.utils.RoleAssignmentHelper; -import com.azure.resourcemanager.msi.models.Identity; -import com.azure.resourcemanager.resources.fluentcore.dag.TaskGroup; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** - * Utility class to set Managed Service Identity (MSI) property on a virtual machine scale set, install or update MSI - * extension and create role assignments for the service principal (LMSI) associated with the virtual machine scale set. - */ -class VirtualMachineScaleSetMsiHandler extends RoleAssignmentHelper { - private final VirtualMachineScaleSetImpl scaleSet; - - private List creatableIdentityKeys; - private Map userAssignedIdentities; - private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetMsiHandler.class); - - /** - * Creates VirtualMachineScaleSetMsiHandler. - * - * @param authorizationManager the graph rbac manager - */ - VirtualMachineScaleSetMsiHandler(AuthorizationManager authorizationManager, VirtualMachineScaleSetImpl scaleSet) { - super(authorizationManager, scaleSet.taskGroup(), scaleSet.idProvider()); - this.scaleSet = scaleSet; - this.creatableIdentityKeys = new ArrayList<>(); - this.userAssignedIdentities = new HashMap<>(); - } - - /** - * Specifies that Local Managed Service Identity needs to be enabled in the virtual machine scale set. If MSI - * extension is not already installed then it will be installed with access token port as 50342. - * - * @return VirtualMachineScaleSetMsiHandler - */ - VirtualMachineScaleSetMsiHandler withLocalManagedServiceIdentity() { - this.initVMSSIdentity(ResourceIdentityType.SYSTEM_ASSIGNED); - return this; - } - - /** - * Specifies that Local Managed Service Identity needs to be disabled in the virtual machine scale set. - * - * @return VirtualMachineScaleSetMsiHandler - */ - VirtualMachineScaleSetMsiHandler withoutLocalManagedServiceIdentity() { - if (this.scaleSet.innerModel().identity() == null - || this.scaleSet.innerModel().identity().type() == null - || this.scaleSet.innerModel().identity().type().equals(ResourceIdentityType.NONE) - || this.scaleSet.innerModel().identity().type().equals(ResourceIdentityType.USER_ASSIGNED)) { - return this; - } else if (this.scaleSet.innerModel().identity().type().equals(ResourceIdentityType.SYSTEM_ASSIGNED)) { - this.scaleSet.innerModel().identity().withType(ResourceIdentityType.NONE); - } else if (this - .scaleSet - .innerModel() - .identity() - .type() - .equals(ResourceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED)) { - this.scaleSet.innerModel().identity().withType(ResourceIdentityType.USER_ASSIGNED); - } - return this; - } - - /** - * Specifies that given identity should be set as one of the External Managed Service Identity of the virtual - * machine scale set. - * - * @param creatableIdentity yet-to-be-created identity to be associated with the virtual machine scale set - * @return VirtualMachineScaleSetMsiHandler - */ - VirtualMachineScaleSetMsiHandler withNewExternalManagedServiceIdentity(Creatable creatableIdentity) { - this.initVMSSIdentity(ResourceIdentityType.USER_ASSIGNED); - - TaskGroup.HasTaskGroup dependency = (TaskGroup.HasTaskGroup) creatableIdentity; - Objects.requireNonNull(dependency); - - this.scaleSet.taskGroup().addDependency(dependency); - this.creatableIdentityKeys.add(creatableIdentity.key()); - return this; - } - - /** - * Specifies that given identity should be set as one of the External Managed Service Identity of the virtual - * machine scale set. - * - * @param identity an identity to associate - * @return VirtualMachineScaleSetMsiHandler - */ - VirtualMachineScaleSetMsiHandler withExistingExternalManagedServiceIdentity(Identity identity) { - this.initVMSSIdentity(ResourceIdentityType.USER_ASSIGNED); - this.userAssignedIdentities.put(identity.id(), new VirtualMachineScaleSetIdentityUserAssignedIdentities()); - return this; - } - - /** - * Specifies that given identity should be removed from the list of External Managed Service Identity associated - * with the virtual machine machine scale set. - * - * @param identityId resource id of the identity - * @return VirtualMachineScaleSetMsiHandler - */ - VirtualMachineScaleSetMsiHandler withoutExternalManagedServiceIdentity(String identityId) { - this.userAssignedIdentities.put(identityId, null); - return this; - } - - /** Update the VMSS payload model using the created External Managed Service Identities. */ - void processCreatedExternalIdentities() { - for (String key : this.creatableIdentityKeys) { - Identity identity = (Identity) this.scaleSet.taskGroup().taskResult(key); - Objects.requireNonNull(identity); - this.userAssignedIdentities.put(identity.id(), new VirtualMachineScaleSetIdentityUserAssignedIdentities()); - } - this.creatableIdentityKeys.clear(); - } - - void handleExternalIdentities() { - if (!this.userAssignedIdentities.isEmpty()) { - this.scaleSet.innerModel().identity().withUserAssignedIdentities(this.userAssignedIdentities); - } - } - - void handleExternalIdentities(VirtualMachineScaleSetUpdate vmssUpdate) { - if (this.handleRemoveAllExternalIdentitiesCase(vmssUpdate)) { - return; - } else { - // At this point one of the following condition is met: - // - // 1. User don't want touch the 'VMSS.Identity.userAssignedIdentities' property - // [this.userAssignedIdentities.empty() == true] - // 2. User want to add some identities to 'VMSS.Identity.userAssignedIdentities' - // [this.userAssignedIdentities.empty() == false and this.scaleSet.inner().identity() != null] - // 3. User want to remove some (not all) identities in 'VMSS.Identity.userAssignedIdentities' - // [this.userAssignedIdentities.empty() == false and this.scaleSet.inner().identity() != null] - // Note: The scenario where this.scaleSet.inner().identity() is null in #3 is already handled in - // handleRemoveAllExternalIdentitiesCase method - // 4. User want to add and remove (all or subset) some identities in 'VMSS.Identity.userAssignedIdentities' - // [this.userAssignedIdentities.empty() == false and this.scaleSet.inner().identity() != null] - // - VirtualMachineScaleSetIdentity currentIdentity = this.scaleSet.innerModel().identity(); - vmssUpdate.withIdentity(currentIdentity); - if (!this.userAssignedIdentities.isEmpty()) { - // At this point its guaranteed that 'currentIdentity' is not null so vmUpdate.identity() is. - vmssUpdate.identity().withUserAssignedIdentities(this.userAssignedIdentities); - } else { - // User don't want to touch 'VM.Identity.userAssignedIdentities' property - if (currentIdentity != null) { - // and currently there is identity exists or user want to manipulate some other properties of - // identity, set identities to null so that it won't send over wire. - currentIdentity.withUserAssignedIdentities(null); - } - } - } - } - - /** Clear VirtualMachineScaleSetMsiHandler post-run specific internal state. */ - void clear() { - this.userAssignedIdentities = new HashMap<>(); - } - - /** - * Method that handle the case where user request indicates all it want to do is remove all identities associated - * with the virtual machine. - * - * @param vmssUpdate the vm update payload model - * @return true if user indented to remove all the identities. - */ - private boolean handleRemoveAllExternalIdentitiesCase(VirtualMachineScaleSetUpdate vmssUpdate) { - if (!this.userAssignedIdentities.isEmpty()) { - int rmCount = 0; - for (VirtualMachineScaleSetIdentityUserAssignedIdentities v : this.userAssignedIdentities.values()) { - if (v == null) { - rmCount++; - } else { - break; - } - } - boolean containsRemoveOnly = rmCount > 0 && rmCount == this.userAssignedIdentities.size(); - // Check if user request contains only request for removal of identities. - if (containsRemoveOnly) { - Set currentIds = new HashSet<>(); - VirtualMachineScaleSetIdentity currentIdentity = this.scaleSet.innerModel().identity(); - if (currentIdentity != null && currentIdentity.userAssignedIdentities() != null) { - for (String id : currentIdentity.userAssignedIdentities().keySet()) { - currentIds.add(id.toLowerCase(Locale.ROOT)); - } - } - Set removeIds = new HashSet<>(); - for (Map.Entry entrySet - : this.userAssignedIdentities.entrySet()) { - if (entrySet.getValue() == null) { - removeIds.add(entrySet.getKey().toLowerCase(Locale.ROOT)); - } - } - // If so check user want to remove all the identities - boolean removeAllCurrentIds = - currentIds.size() == removeIds.size() && currentIds.containsAll(removeIds); - if (removeAllCurrentIds) { - // If so adjust the identity type [Setting type to SYSTEM_ASSIGNED orNONE will remove all the - // identities] - if (currentIdentity == null || currentIdentity.type() == null) { - vmssUpdate - .withIdentity(new VirtualMachineScaleSetIdentity().withType(ResourceIdentityType.NONE)); - } else if (currentIdentity.type().equals(ResourceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED)) { - vmssUpdate.withIdentity(currentIdentity); - vmssUpdate.identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED); - } else if (currentIdentity.type().equals(ResourceIdentityType.USER_ASSIGNED)) { - vmssUpdate.withIdentity(currentIdentity); - vmssUpdate.identity().withType(ResourceIdentityType.NONE); - } - // and set identities property in the payload model to null so that it won't be sent - vmssUpdate.identity().withUserAssignedIdentities(null); - return true; - } else { - // Check user is asking to remove identities though there is no identities currently associated - if (currentIds.size() == 0 && removeIds.size() != 0 && currentIdentity == null) { - // If so we are in a invalid state but we want to send user input to service and let service - // handle it (ignore or error). - vmssUpdate - .withIdentity(new VirtualMachineScaleSetIdentity().withType(ResourceIdentityType.NONE)); - vmssUpdate.identity().withUserAssignedIdentities(null); - return true; - } - } - } - } - return false; - } - - /** - * Initialize VMSS's identity property. - * - * @param identityType the identity type to set - */ - private void initVMSSIdentity(ResourceIdentityType identityType) { - if (!identityType.equals(ResourceIdentityType.USER_ASSIGNED) - && !identityType.equals(ResourceIdentityType.SYSTEM_ASSIGNED)) { - throw logger.logExceptionAsError(new IllegalArgumentException("Invalid argument: " + identityType)); - } - - final VirtualMachineScaleSetInner scaleSetInner = this.scaleSet.innerModel(); - if (scaleSetInner.identity() == null) { - scaleSetInner.withIdentity(new VirtualMachineScaleSetIdentity()); - } - if (scaleSetInner.identity().type() == null - || scaleSetInner.identity().type().equals(ResourceIdentityType.NONE) - || scaleSetInner.identity().type().equals(identityType)) { - scaleSetInner.identity().withType(identityType); - } else { - scaleSetInner.identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineScaleSetRollingUpgradesClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineScaleSetRollingUpgradesClientImpl.java deleted file mode 100644 index f9c42a0619de..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineScaleSetRollingUpgradesClientImpl.java +++ /dev/null @@ -1,988 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.compute.fluent.VirtualMachineScaleSetRollingUpgradesClient; -import com.azure.resourcemanager.compute.fluent.models.RollingUpgradeStatusInfoInner; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in - * VirtualMachineScaleSetRollingUpgradesClient. - */ -public final class VirtualMachineScaleSetRollingUpgradesClientImpl - implements VirtualMachineScaleSetRollingUpgradesClient { - private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetRollingUpgradesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final VirtualMachineScaleSetRollingUpgradesService service; - - /** The service client containing this operation class. */ - private final ComputeManagementClientImpl client; - - /** - * Initializes an instance of VirtualMachineScaleSetRollingUpgradesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - VirtualMachineScaleSetRollingUpgradesClientImpl(ComputeManagementClientImpl client) { - this.service = - RestProxy - .create( - VirtualMachineScaleSetRollingUpgradesService.class, - client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for ComputeManagementClientVirtualMachineScaleSetRollingUpgrades to be - * used by the proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "ComputeManagementCli") - private interface VirtualMachineScaleSetRollingUpgradesService { - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/rollingUpgrades/cancel") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> cancel( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/osRollingUpgrade") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> startOSUpgrade( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/extensionRollingUpgrade") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> startExtensionUpgrade( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/rollingUpgrades/latest") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getLatest( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Cancels the current virtual machine scale set rolling upgrade. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> cancelWithResponseAsync(String resourceGroupName, String vmScaleSetName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - return FluxUtil - .withContext( - context -> - service - .cancel( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Cancels the current virtual machine scale set rolling upgrade. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> cancelWithResponseAsync( - String resourceGroupName, String vmScaleSetName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - context = this.client.mergeContext(context); - return service - .cancel( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Cancels the current virtual machine scale set rolling upgrade. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginCancelAsync(String resourceGroupName, String vmScaleSetName) { - Mono>> mono = cancelWithResponseAsync(resourceGroupName, vmScaleSetName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Cancels the current virtual machine scale set rolling upgrade. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginCancelAsync( - String resourceGroupName, String vmScaleSetName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = cancelWithResponseAsync(resourceGroupName, vmScaleSetName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Cancels the current virtual machine scale set rolling upgrade. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginCancel(String resourceGroupName, String vmScaleSetName) { - return beginCancelAsync(resourceGroupName, vmScaleSetName).getSyncPoller(); - } - - /** - * Cancels the current virtual machine scale set rolling upgrade. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginCancel( - String resourceGroupName, String vmScaleSetName, Context context) { - return beginCancelAsync(resourceGroupName, vmScaleSetName, context).getSyncPoller(); - } - - /** - * Cancels the current virtual machine scale set rolling upgrade. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono cancelAsync(String resourceGroupName, String vmScaleSetName) { - return beginCancelAsync(resourceGroupName, vmScaleSetName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Cancels the current virtual machine scale set rolling upgrade. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono cancelAsync(String resourceGroupName, String vmScaleSetName, Context context) { - return beginCancelAsync(resourceGroupName, vmScaleSetName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Cancels the current virtual machine scale set rolling upgrade. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void cancel(String resourceGroupName, String vmScaleSetName) { - cancelAsync(resourceGroupName, vmScaleSetName).block(); - } - - /** - * Cancels the current virtual machine scale set rolling upgrade. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void cancel(String resourceGroupName, String vmScaleSetName, Context context) { - cancelAsync(resourceGroupName, vmScaleSetName, context).block(); - } - - /** - * Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image - * OS version. Instances which are already running the latest available OS version are not affected. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> startOSUpgradeWithResponseAsync( - String resourceGroupName, String vmScaleSetName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - return FluxUtil - .withContext( - context -> - service - .startOSUpgrade( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image - * OS version. Instances which are already running the latest available OS version are not affected. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> startOSUpgradeWithResponseAsync( - String resourceGroupName, String vmScaleSetName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - context = this.client.mergeContext(context); - return service - .startOSUpgrade( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image - * OS version. Instances which are already running the latest available OS version are not affected. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginStartOSUpgradeAsync( - String resourceGroupName, String vmScaleSetName) { - Mono>> mono = startOSUpgradeWithResponseAsync(resourceGroupName, vmScaleSetName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image - * OS version. Instances which are already running the latest available OS version are not affected. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginStartOSUpgradeAsync( - String resourceGroupName, String vmScaleSetName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - startOSUpgradeWithResponseAsync(resourceGroupName, vmScaleSetName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image - * OS version. Instances which are already running the latest available OS version are not affected. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginStartOSUpgrade(String resourceGroupName, String vmScaleSetName) { - return beginStartOSUpgradeAsync(resourceGroupName, vmScaleSetName).getSyncPoller(); - } - - /** - * Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image - * OS version. Instances which are already running the latest available OS version are not affected. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginStartOSUpgrade( - String resourceGroupName, String vmScaleSetName, Context context) { - return beginStartOSUpgradeAsync(resourceGroupName, vmScaleSetName, context).getSyncPoller(); - } - - /** - * Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image - * OS version. Instances which are already running the latest available OS version are not affected. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono startOSUpgradeAsync(String resourceGroupName, String vmScaleSetName) { - return beginStartOSUpgradeAsync(resourceGroupName, vmScaleSetName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image - * OS version. Instances which are already running the latest available OS version are not affected. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono startOSUpgradeAsync(String resourceGroupName, String vmScaleSetName, Context context) { - return beginStartOSUpgradeAsync(resourceGroupName, vmScaleSetName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image - * OS version. Instances which are already running the latest available OS version are not affected. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void startOSUpgrade(String resourceGroupName, String vmScaleSetName) { - startOSUpgradeAsync(resourceGroupName, vmScaleSetName).block(); - } - - /** - * Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image - * OS version. Instances which are already running the latest available OS version are not affected. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void startOSUpgrade(String resourceGroupName, String vmScaleSetName, Context context) { - startOSUpgradeAsync(resourceGroupName, vmScaleSetName, context).block(); - } - - /** - * Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest - * available extension version. Instances which are already running the latest extension versions are not affected. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> startExtensionUpgradeWithResponseAsync( - String resourceGroupName, String vmScaleSetName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - return FluxUtil - .withContext( - context -> - service - .startExtensionUpgrade( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest - * available extension version. Instances which are already running the latest extension versions are not affected. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> startExtensionUpgradeWithResponseAsync( - String resourceGroupName, String vmScaleSetName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - context = this.client.mergeContext(context); - return service - .startExtensionUpgrade( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest - * available extension version. Instances which are already running the latest extension versions are not affected. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginStartExtensionUpgradeAsync( - String resourceGroupName, String vmScaleSetName) { - Mono>> mono = - startExtensionUpgradeWithResponseAsync(resourceGroupName, vmScaleSetName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest - * available extension version. Instances which are already running the latest extension versions are not affected. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginStartExtensionUpgradeAsync( - String resourceGroupName, String vmScaleSetName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - startExtensionUpgradeWithResponseAsync(resourceGroupName, vmScaleSetName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest - * available extension version. Instances which are already running the latest extension versions are not affected. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginStartExtensionUpgrade( - String resourceGroupName, String vmScaleSetName) { - return beginStartExtensionUpgradeAsync(resourceGroupName, vmScaleSetName).getSyncPoller(); - } - - /** - * Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest - * available extension version. Instances which are already running the latest extension versions are not affected. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginStartExtensionUpgrade( - String resourceGroupName, String vmScaleSetName, Context context) { - return beginStartExtensionUpgradeAsync(resourceGroupName, vmScaleSetName, context).getSyncPoller(); - } - - /** - * Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest - * available extension version. Instances which are already running the latest extension versions are not affected. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono startExtensionUpgradeAsync(String resourceGroupName, String vmScaleSetName) { - return beginStartExtensionUpgradeAsync(resourceGroupName, vmScaleSetName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest - * available extension version. Instances which are already running the latest extension versions are not affected. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono startExtensionUpgradeAsync(String resourceGroupName, String vmScaleSetName, Context context) { - return beginStartExtensionUpgradeAsync(resourceGroupName, vmScaleSetName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest - * available extension version. Instances which are already running the latest extension versions are not affected. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void startExtensionUpgrade(String resourceGroupName, String vmScaleSetName) { - startExtensionUpgradeAsync(resourceGroupName, vmScaleSetName).block(); - } - - /** - * Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest - * available extension version. Instances which are already running the latest extension versions are not affected. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void startExtensionUpgrade(String resourceGroupName, String vmScaleSetName, Context context) { - startExtensionUpgradeAsync(resourceGroupName, vmScaleSetName, context).block(); - } - - /** - * Gets the status of the latest virtual machine scale set rolling upgrade. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of the latest virtual machine scale set rolling upgrade. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getLatestWithResponseAsync( - String resourceGroupName, String vmScaleSetName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getLatest( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the status of the latest virtual machine scale set rolling upgrade. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of the latest virtual machine scale set rolling upgrade. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getLatestWithResponseAsync( - String resourceGroupName, String vmScaleSetName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getLatest( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets the status of the latest virtual machine scale set rolling upgrade. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of the latest virtual machine scale set rolling upgrade. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getLatestAsync(String resourceGroupName, String vmScaleSetName) { - return getLatestWithResponseAsync(resourceGroupName, vmScaleSetName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the status of the latest virtual machine scale set rolling upgrade. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of the latest virtual machine scale set rolling upgrade. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RollingUpgradeStatusInfoInner getLatest(String resourceGroupName, String vmScaleSetName) { - return getLatestAsync(resourceGroupName, vmScaleSetName).block(); - } - - /** - * Gets the status of the latest virtual machine scale set rolling upgrade. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of the latest virtual machine scale set rolling upgrade. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getLatestWithResponse( - String resourceGroupName, String vmScaleSetName, Context context) { - return getLatestWithResponseAsync(resourceGroupName, vmScaleSetName, context).block(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineScaleSetSkuImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineScaleSetSkuImpl.java deleted file mode 100644 index 190ef44fbdd9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineScaleSetSkuImpl.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.compute.implementation; - -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetSku; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetSkuCapacity; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetSkuTypes; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineScaleSetSkuInner; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.WrapperImpl; - -/** Implementation of VirtualMachineScaleSetSku. */ -class VirtualMachineScaleSetSkuImpl extends WrapperImpl - implements VirtualMachineScaleSetSku { - VirtualMachineScaleSetSkuImpl(VirtualMachineScaleSetSkuInner inner) { - super(inner); - } - - @Override - public String resourceType() { - return this.innerModel().resourceType(); - } - - @Override - public VirtualMachineScaleSetSkuTypes skuType() { - return VirtualMachineScaleSetSkuTypes.fromSku(this.innerModel().sku()); - } - - @Override - public VirtualMachineScaleSetSkuCapacity capacity() { - return this.innerModel().capacity(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineScaleSetUnmanagedDataDiskImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineScaleSetUnmanagedDataDiskImpl.java deleted file mode 100644 index 1a8f33ff70aa..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineScaleSetUnmanagedDataDiskImpl.java +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.implementation; - -import com.azure.resourcemanager.compute.models.CachingTypes; -import com.azure.resourcemanager.compute.models.DiskCreateOptionTypes; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSet; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetDataDisk; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetUnmanagedDataDisk; -import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.ChildResourceImpl; -import java.util.ArrayList; -import java.util.List; - -/** The implementation for {@link VirtualMachineScaleSetUnmanagedDataDisk} and its create and update interfaces. */ -class VirtualMachineScaleSetUnmanagedDataDiskImpl - extends ChildResourceImpl - implements VirtualMachineScaleSetUnmanagedDataDisk.DefinitionWithNewVhd< - VirtualMachineScaleSet.DefinitionStages.WithUnmanagedCreate>, - VirtualMachineScaleSetUnmanagedDataDisk.DefinitionWithImage< - VirtualMachineScaleSet.DefinitionStages.WithUnmanagedCreate>, - VirtualMachineScaleSetUnmanagedDataDisk.UpdateDefinition, - VirtualMachineScaleSetUnmanagedDataDisk.Update, - VirtualMachineScaleSetUnmanagedDataDisk { - - protected VirtualMachineScaleSetUnmanagedDataDiskImpl( - VirtualMachineScaleSetDataDisk innerObject, VirtualMachineScaleSetImpl parent) { - super(innerObject, parent); - } - - protected static VirtualMachineScaleSetUnmanagedDataDiskImpl prepareDataDisk( - String name, VirtualMachineScaleSetImpl parent) { - VirtualMachineScaleSetDataDisk dataDiskInner = new VirtualMachineScaleSetDataDisk(); - dataDiskInner.withLun(-1).withName(name); - return new VirtualMachineScaleSetUnmanagedDataDiskImpl(dataDiskInner, parent); - } - - @Override - public VirtualMachineScaleSetUnmanagedDataDiskImpl withNewVhd(int sizeInGB) { - this.innerModel().withCreateOption(DiskCreateOptionTypes.EMPTY).withDiskSizeGB(sizeInGB); - return this; - } - - @Override - public VirtualMachineScaleSetUnmanagedDataDiskImpl fromImage(int imageLun) { - this.innerModel().withCreateOption(DiskCreateOptionTypes.FROM_IMAGE).withLun(imageLun); - return this; - } - - @Override - public VirtualMachineScaleSetUnmanagedDataDiskImpl withSizeInGB(Integer sizeInGB) { - this.innerModel().withDiskSizeGB(sizeInGB); - return this; - } - - @Override - public VirtualMachineScaleSetUnmanagedDataDiskImpl withLun(Integer lun) { - this.innerModel().withLun(lun); - return this; - } - - @Override - public VirtualMachineScaleSetUnmanagedDataDiskImpl withCaching(CachingTypes cachingType) { - this.innerModel().withCaching(cachingType); - return this; - } - - @Override - public VirtualMachineScaleSetImpl attach() { - return this.parent().withUnmanagedDataDisk(this); - } - - @Override - public String name() { - return this.innerModel().name(); - } - - protected static void setDataDisksDefaults(List dataDisks, String namePrefix) { - if (dataDisks == null) { - return; - } - List usedLuns = new ArrayList<>(); - for (VirtualMachineScaleSetDataDisk dataDisk : dataDisks) { - if (dataDisk.lun() != -1) { - usedLuns.add(dataDisk.lun()); - } - } - for (VirtualMachineScaleSetDataDisk dataDisk : dataDisks) { - if (dataDisk.lun() == -1) { - Integer i = 0; - while (usedLuns.contains(i)) { - i += 1; - } - dataDisk.withLun(i); - usedLuns.add(i); - } - if (dataDisk.name() == null) { - dataDisk.withName(namePrefix + "-data-disk-" + dataDisk.lun()); - } - if (dataDisk.caching() == null) { - dataDisk.withCaching(CachingTypes.READ_WRITE); - } - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineScaleSetVMExtensionsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineScaleSetVMExtensionsClientImpl.java deleted file mode 100644 index d3b0021c6412..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineScaleSetVMExtensionsClientImpl.java +++ /dev/null @@ -1,1607 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.compute.fluent.VirtualMachineScaleSetVMExtensionsClient; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineScaleSetVMExtensionInner; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineScaleSetVMExtensionsListResultInner; -import com.azure.resourcemanager.compute.models.ApiErrorException; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetVMExtensionUpdate; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in VirtualMachineScaleSetVMExtensionsClient. - */ -public final class VirtualMachineScaleSetVMExtensionsClientImpl implements VirtualMachineScaleSetVMExtensionsClient { - private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetVMExtensionsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final VirtualMachineScaleSetVMExtensionsService service; - - /** The service client containing this operation class. */ - private final ComputeManagementClientImpl client; - - /** - * Initializes an instance of VirtualMachineScaleSetVMExtensionsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - VirtualMachineScaleSetVMExtensionsClientImpl(ComputeManagementClientImpl client) { - this.service = - RestProxy - .create( - VirtualMachineScaleSetVMExtensionsService.class, - client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for ComputeManagementClientVirtualMachineScaleSetVMExtensions to be used - * by the proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "ComputeManagementCli") - private interface VirtualMachineScaleSetVMExtensionsService { - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @PathParam("instanceId") String instanceId, - @PathParam("vmExtensionName") String vmExtensionName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VirtualMachineScaleSetVMExtensionInner extensionParameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono>> update( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @PathParam("instanceId") String instanceId, - @PathParam("vmExtensionName") String vmExtensionName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VirtualMachineScaleSetVMExtensionUpdate extensionParameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @PathParam("instanceId") String instanceId, - @PathParam("vmExtensionName") String vmExtensionName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @PathParam("instanceId") String instanceId, - @PathParam("vmExtensionName") String vmExtensionName, - @QueryParam("$expand") String expand, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @PathParam("instanceId") String instanceId, - @QueryParam("$expand") String expand, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * The operation to create or update the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Create Virtual Machine Extension operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a VMSS VM Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String vmExtensionName, - VirtualMachineScaleSetVMExtensionInner extensionParameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (vmExtensionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter vmExtensionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (extensionParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter extensionParameters is required and cannot be null.")); - } else { - extensionParameters.validate(); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - vmExtensionName, - apiVersion, - this.client.getSubscriptionId(), - extensionParameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * The operation to create or update the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Create Virtual Machine Extension operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a VMSS VM Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String vmExtensionName, - VirtualMachineScaleSetVMExtensionInner extensionParameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (vmExtensionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter vmExtensionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (extensionParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter extensionParameters is required and cannot be null.")); - } else { - extensionParameters.validate(); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - vmExtensionName, - apiVersion, - this.client.getSubscriptionId(), - extensionParameters, - accept, - context); - } - - /** - * The operation to create or update the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Create Virtual Machine Extension operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a VMSS VM Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, VirtualMachineScaleSetVMExtensionInner> - beginCreateOrUpdateAsync( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String vmExtensionName, - VirtualMachineScaleSetVMExtensionInner extensionParameters) { - Mono>> mono = - createOrUpdateWithResponseAsync( - resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VirtualMachineScaleSetVMExtensionInner.class, - VirtualMachineScaleSetVMExtensionInner.class, - Context.NONE); - } - - /** - * The operation to create or update the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Create Virtual Machine Extension operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a VMSS VM Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, VirtualMachineScaleSetVMExtensionInner> - beginCreateOrUpdateAsync( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String vmExtensionName, - VirtualMachineScaleSetVMExtensionInner extensionParameters, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync( - resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VirtualMachineScaleSetVMExtensionInner.class, - VirtualMachineScaleSetVMExtensionInner.class, - context); - } - - /** - * The operation to create or update the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Create Virtual Machine Extension operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a VMSS VM Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VirtualMachineScaleSetVMExtensionInner> - beginCreateOrUpdate( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String vmExtensionName, - VirtualMachineScaleSetVMExtensionInner extensionParameters) { - return beginCreateOrUpdateAsync( - resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters) - .getSyncPoller(); - } - - /** - * The operation to create or update the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Create Virtual Machine Extension operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a VMSS VM Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VirtualMachineScaleSetVMExtensionInner> - beginCreateOrUpdate( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String vmExtensionName, - VirtualMachineScaleSetVMExtensionInner extensionParameters, - Context context) { - return beginCreateOrUpdateAsync( - resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters, context) - .getSyncPoller(); - } - - /** - * The operation to create or update the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Create Virtual Machine Extension operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a VMSS VM Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String vmExtensionName, - VirtualMachineScaleSetVMExtensionInner extensionParameters) { - return beginCreateOrUpdateAsync( - resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * The operation to create or update the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Create Virtual Machine Extension operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a VMSS VM Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String vmExtensionName, - VirtualMachineScaleSetVMExtensionInner extensionParameters, - Context context) { - return beginCreateOrUpdateAsync( - resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * The operation to create or update the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Create Virtual Machine Extension operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a VMSS VM Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineScaleSetVMExtensionInner createOrUpdate( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String vmExtensionName, - VirtualMachineScaleSetVMExtensionInner extensionParameters) { - return createOrUpdateAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters) - .block(); - } - - /** - * The operation to create or update the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Create Virtual Machine Extension operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a VMSS VM Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineScaleSetVMExtensionInner createOrUpdate( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String vmExtensionName, - VirtualMachineScaleSetVMExtensionInner extensionParameters, - Context context) { - return createOrUpdateAsync( - resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters, context) - .block(); - } - - /** - * The operation to update the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Update Virtual Machine Extension operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a VMSS VM Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateWithResponseAsync( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String vmExtensionName, - VirtualMachineScaleSetVMExtensionUpdate extensionParameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (vmExtensionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter vmExtensionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (extensionParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter extensionParameters is required and cannot be null.")); - } else { - extensionParameters.validate(); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - vmExtensionName, - apiVersion, - this.client.getSubscriptionId(), - extensionParameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * The operation to update the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Update Virtual Machine Extension operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a VMSS VM Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String vmExtensionName, - VirtualMachineScaleSetVMExtensionUpdate extensionParameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (vmExtensionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter vmExtensionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (extensionParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter extensionParameters is required and cannot be null.")); - } else { - extensionParameters.validate(); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - vmExtensionName, - apiVersion, - this.client.getSubscriptionId(), - extensionParameters, - accept, - context); - } - - /** - * The operation to update the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Update Virtual Machine Extension operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a VMSS VM Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, VirtualMachineScaleSetVMExtensionInner> - beginUpdateAsync( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String vmExtensionName, - VirtualMachineScaleSetVMExtensionUpdate extensionParameters) { - Mono>> mono = - updateWithResponseAsync( - resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VirtualMachineScaleSetVMExtensionInner.class, - VirtualMachineScaleSetVMExtensionInner.class, - Context.NONE); - } - - /** - * The operation to update the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Update Virtual Machine Extension operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a VMSS VM Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, VirtualMachineScaleSetVMExtensionInner> - beginUpdateAsync( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String vmExtensionName, - VirtualMachineScaleSetVMExtensionUpdate extensionParameters, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - updateWithResponseAsync( - resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VirtualMachineScaleSetVMExtensionInner.class, - VirtualMachineScaleSetVMExtensionInner.class, - context); - } - - /** - * The operation to update the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Update Virtual Machine Extension operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a VMSS VM Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VirtualMachineScaleSetVMExtensionInner> - beginUpdate( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String vmExtensionName, - VirtualMachineScaleSetVMExtensionUpdate extensionParameters) { - return beginUpdateAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters) - .getSyncPoller(); - } - - /** - * The operation to update the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Update Virtual Machine Extension operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a VMSS VM Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VirtualMachineScaleSetVMExtensionInner> - beginUpdate( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String vmExtensionName, - VirtualMachineScaleSetVMExtensionUpdate extensionParameters, - Context context) { - return beginUpdateAsync( - resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters, context) - .getSyncPoller(); - } - - /** - * The operation to update the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Update Virtual Machine Extension operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a VMSS VM Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String vmExtensionName, - VirtualMachineScaleSetVMExtensionUpdate extensionParameters) { - return beginUpdateAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * The operation to update the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Update Virtual Machine Extension operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a VMSS VM Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String vmExtensionName, - VirtualMachineScaleSetVMExtensionUpdate extensionParameters, - Context context) { - return beginUpdateAsync( - resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * The operation to update the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Update Virtual Machine Extension operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a VMSS VM Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineScaleSetVMExtensionInner update( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String vmExtensionName, - VirtualMachineScaleSetVMExtensionUpdate extensionParameters) { - return updateAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters).block(); - } - - /** - * The operation to update the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Update Virtual Machine Extension operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a VMSS VM Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineScaleSetVMExtensionInner update( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String vmExtensionName, - VirtualMachineScaleSetVMExtensionUpdate extensionParameters, - Context context) { - return updateAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters, context) - .block(); - } - - /** - * The operation to delete the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (vmExtensionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter vmExtensionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - vmExtensionName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * The operation to delete the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (vmExtensionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter vmExtensionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - vmExtensionName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * The operation to delete the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName) { - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * The operation to delete the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * The operation to delete the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName) { - return beginDeleteAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName).getSyncPoller(); - } - - /** - * The operation to delete the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName, Context context) { - return beginDeleteAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, context) - .getSyncPoller(); - } - - /** - * The operation to delete the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName) { - return beginDeleteAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * The operation to delete the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName, Context context) { - return beginDeleteAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * The operation to delete the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName) { - deleteAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName).block(); - } - - /** - * The operation to delete the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete( - String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName, Context context) { - deleteAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, context).block(); - } - - /** - * The operation to get the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param expand The expand expression to apply on the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a VMSS VM Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName, String expand) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (vmExtensionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter vmExtensionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - vmExtensionName, - expand, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * The operation to get the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param expand The expand expression to apply on the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a VMSS VM Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String vmExtensionName, - String expand, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (vmExtensionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter vmExtensionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - vmExtensionName, - expand, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * The operation to get the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param expand The expand expression to apply on the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a VMSS VM Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName, String expand) { - return getWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * The operation to get the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a VMSS VM Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName) { - final String expand = null; - return getWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * The operation to get the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a VMSS VM Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineScaleSetVMExtensionInner get( - String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName) { - final String expand = null; - return getAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, expand).block(); - } - - /** - * The operation to get the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param expand The expand expression to apply on the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a VMSS VM Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String vmExtensionName, - String expand, - Context context) { - return getWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, expand, context) - .block(); - } - - /** - * The operation to get all extensions of an instance in Virtual Machine Scaleset. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param expand The expand expression to apply on the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List VMSS VM Extension operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, String expand) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - expand, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * The operation to get all extensions of an instance in Virtual Machine Scaleset. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param expand The expand expression to apply on the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List VMSS VM Extension operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, String expand, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - expand, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * The operation to get all extensions of an instance in Virtual Machine Scaleset. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param expand The expand expression to apply on the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List VMSS VM Extension operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, String expand) { - return listWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * The operation to get all extensions of an instance in Virtual Machine Scaleset. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List VMSS VM Extension operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listAsync( - String resourceGroupName, String vmScaleSetName, String instanceId) { - final String expand = null; - return listWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * The operation to get all extensions of an instance in Virtual Machine Scaleset. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List VMSS VM Extension operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineScaleSetVMExtensionsListResultInner list( - String resourceGroupName, String vmScaleSetName, String instanceId) { - final String expand = null; - return listAsync(resourceGroupName, vmScaleSetName, instanceId, expand).block(); - } - - /** - * The operation to get all extensions of an instance in Virtual Machine Scaleset. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param expand The expand expression to apply on the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List VMSS VM Extension operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse( - String resourceGroupName, String vmScaleSetName, String instanceId, String expand, Context context) { - return listWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, expand, context).block(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineScaleSetVMImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineScaleSetVMImpl.java deleted file mode 100644 index d0292ede6d94..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineScaleSetVMImpl.java +++ /dev/null @@ -1,752 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.compute.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.ComputeManager; -import com.azure.resourcemanager.compute.models.CachingTypes; -import com.azure.resourcemanager.compute.models.DataDisk; -import com.azure.resourcemanager.compute.models.DiagnosticsProfile; -import com.azure.resourcemanager.compute.models.Disk; -import com.azure.resourcemanager.compute.models.DiskCreateOptionTypes; -import com.azure.resourcemanager.compute.models.DiskState; -import com.azure.resourcemanager.compute.models.ImageReference; -import com.azure.resourcemanager.compute.models.ManagedDiskParameters; -import com.azure.resourcemanager.compute.models.NetworkInterfaceReference; -import com.azure.resourcemanager.compute.models.OSProfile; -import com.azure.resourcemanager.compute.models.OperatingSystemTypes; -import com.azure.resourcemanager.compute.models.PowerState; -import com.azure.resourcemanager.compute.models.Sku; -import com.azure.resourcemanager.compute.models.StorageAccountTypes; -import com.azure.resourcemanager.compute.models.StorageProfile; -import com.azure.resourcemanager.compute.models.VirtualMachineCustomImage; -import com.azure.resourcemanager.compute.models.VirtualMachineDataDisk; -import com.azure.resourcemanager.compute.models.VirtualMachineImage; -import com.azure.resourcemanager.compute.models.VirtualMachineInstanceView; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSet; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetVM; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetVMInstanceExtension; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetVMNetworkProfileConfiguration; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetVMProtectionPolicy; -import com.azure.resourcemanager.compute.models.VirtualMachineSizeTypes; -import com.azure.resourcemanager.compute.models.VirtualMachineUnmanagedDataDisk; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineExtensionInner; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineInstanceViewInner; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineScaleSetVMInner; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineScaleSetVMInstanceViewInner; -import com.azure.resourcemanager.compute.fluent.VirtualMachineScaleSetVMsClient; -import com.azure.resourcemanager.network.models.VirtualMachineScaleSetNetworkInterface; -import com.azure.core.management.Region; -import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.ChildResourceImpl; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import reactor.core.publisher.Mono; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.Iterator; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; - -/** Implementation of {@link VirtualMachineScaleSetVM}. */ -class VirtualMachineScaleSetVMImpl - extends ChildResourceImpl - implements VirtualMachineScaleSetVM, VirtualMachineScaleSetVM.Update { - - private VirtualMachineInstanceView virtualMachineInstanceView; - private final VirtualMachineScaleSetVMsClient client; - private final ComputeManager computeManager; - private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetVMImpl.class); - - // To track the managed data disks - private final ManagedDataDiskCollection managedDataDisks = new ManagedDataDiskCollection(); - - VirtualMachineScaleSetVMImpl( - VirtualMachineScaleSetVMInner inner, - final VirtualMachineScaleSetImpl parent, - final VirtualMachineScaleSetVMsClient client, - final ComputeManager computeManager) { - super(inner, parent); - this.client = client; - this.computeManager = computeManager; - VirtualMachineScaleSetVMInstanceViewInner instanceViewInner = this.innerModel().instanceView(); - if (instanceViewInner != null) { - this.virtualMachineInstanceView = - new VirtualMachineInstanceViewImpl( - new VirtualMachineInstanceViewInner() - .withBootDiagnostics(instanceViewInner.bootDiagnostics()) - .withDisks(instanceViewInner.disks()) - .withExtensions(instanceViewInner.extensions()) - .withPlatformFaultDomain(instanceViewInner.platformFaultDomain()) - .withPlatformUpdateDomain(instanceViewInner.platformUpdateDomain()) - .withRdpThumbPrint(instanceViewInner.rdpThumbPrint()) - .withStatuses(instanceViewInner.statuses()) - .withVmAgent(instanceViewInner.vmAgent())); - } else { - this.virtualMachineInstanceView = null; - } - } - - @Override - public String id() { - return this.innerModel().id(); - } - - @Override - public String name() { - return this.innerModel().name(); - } - - @Override - public String regionName() { - return this.innerModel().location(); - } - - @Override - public Region region() { - return Region.fromName(this.regionName()); - } - - @Override - public String type() { - return this.innerModel().type(); - } - - @Override - public Map tags() { - if (this.innerModel().tags() == null) { - return Collections.unmodifiableMap(new LinkedHashMap<>()); - } - return Collections.unmodifiableMap(this.innerModel().tags()); - } - - @Override - public String instanceId() { - return this.innerModel().instanceId(); - } - - @Override - public Sku sku() { - return this.innerModel().sku(); - } - - @Override - public VirtualMachineSizeTypes size() { - if (this.innerModel().hardwareProfile() != null && this.innerModel().hardwareProfile().vmSize() != null) { - return this.innerModel().hardwareProfile().vmSize(); - } - if (this.sku() != null && this.sku().name() != null) { - return VirtualMachineSizeTypes.fromString(this.sku().name()); - } - return null; - } - - @Override - public boolean isLatestScaleSetUpdateApplied() { - return this.innerModel().latestModelApplied(); - } - - @Override - public boolean isOSBasedOnPlatformImage() { - ImageReference imageReference = this.innerModel().storageProfile().imageReference(); - if (imageReference != null - && imageReference.publisher() != null - && imageReference.sku() != null - && imageReference.offer() != null - && imageReference.version() != null) { - return true; - } - return false; - } - - @Override - public boolean isOSBasedOnCustomImage() { - ImageReference imageReference = this.innerModel().storageProfile().imageReference(); - if (imageReference != null && imageReference.id() != null) { - return true; - } - return false; - } - - @Override - public boolean isOSBasedOnStoredImage() { - if (this.innerModel().storageProfile().osDisk() != null - && this.innerModel().storageProfile().osDisk().image() != null) { - return this.innerModel().storageProfile().osDisk().image().uri() != null; - } - return false; - } - - @Override - public ImageReference platformImageReference() { - if (isOSBasedOnPlatformImage()) { - return this.innerModel().storageProfile().imageReference(); - } - return null; - } - - @Override - public VirtualMachineImage getOSPlatformImage() { - if (this.isOSBasedOnPlatformImage()) { - ImageReference imageReference = this.platformImageReference(); - return this - .computeManager - .virtualMachineImages() - .getImage( - this.region(), - imageReference.publisher(), - imageReference.offer(), - imageReference.sku(), - imageReference.version()); - } - return null; - } - - @Override - public VirtualMachineCustomImage getOSCustomImage() { - if (this.isOSBasedOnCustomImage()) { - ImageReference imageReference = this.innerModel().storageProfile().imageReference(); - return this.computeManager.virtualMachineCustomImages().getById(imageReference.id()); - } - return null; - } - - @Override - public String storedImageUnmanagedVhdUri() { - if (this.innerModel().storageProfile().osDisk().image() != null) { - return this.innerModel().storageProfile().osDisk().image().uri(); - } - return null; - } - - @Override - public String osDiskName() { - return this.innerModel().storageProfile().osDisk().name(); - } - - @Override - public String osUnmanagedDiskVhdUri() { - if (this.innerModel().storageProfile().osDisk().vhd() != null) { - return this.innerModel().storageProfile().osDisk().vhd().uri(); - } - return null; - } - - @Override - public String osDiskId() { - if (this.storageProfile().osDisk().managedDisk() != null) { - return this.storageProfile().osDisk().managedDisk().id(); - } - return null; - } - - @Override - public Map unmanagedDataDisks() { - Map dataDisks = new HashMap<>(); - if (!isManagedDiskEnabled()) { - List innerDataDisks = this.innerModel().storageProfile().dataDisks(); - if (innerDataDisks != null) { - for (DataDisk innerDataDisk : innerDataDisks) { - dataDisks.put(innerDataDisk.lun(), new UnmanagedDataDiskImpl(innerDataDisk, null)); - } - } - } - return Collections.unmodifiableMap(dataDisks); - } - - @Override - public Map dataDisks() { - Map dataDisks = new HashMap<>(); - if (isManagedDiskEnabled()) { - List innerDataDisks = this.innerModel().storageProfile().dataDisks(); - if (innerDataDisks != null) { - for (DataDisk innerDataDisk : innerDataDisks) { - dataDisks.put(innerDataDisk.lun(), new VirtualMachineDataDiskImpl(innerDataDisk)); - } - } - } - return Collections.unmodifiableMap(dataDisks); - } - - @Override - public CachingTypes osDiskCachingType() { - return this.innerModel().storageProfile().osDisk().caching(); - } - - @Override - public int osDiskSizeInGB() { - return ResourceManagerUtils.toPrimitiveInt(this.innerModel().storageProfile().osDisk().diskSizeGB()); - } - - @Override - public String computerName() { - return this.innerModel().osProfile().computerName(); - } - - @Override - public String administratorUserName() { - return this.innerModel().osProfile().adminUsername(); - } - - @Override - public OperatingSystemTypes osType() { - return this.innerModel().storageProfile().osDisk().osType(); - } - - @Override - public boolean isLinuxPasswordAuthenticationEnabled() { - if (this.innerModel().osProfile().linuxConfiguration() != null) { - return !ResourceManagerUtils - .toPrimitiveBoolean(this.innerModel().osProfile().linuxConfiguration().disablePasswordAuthentication()); - } - return false; - } - - @Override - public boolean isWindowsVMAgentProvisioned() { - if (this.innerModel().osProfile().windowsConfiguration() != null) { - return ResourceManagerUtils - .toPrimitiveBoolean(this.innerModel().osProfile().windowsConfiguration().provisionVMAgent()); - } - return false; - } - - @Override - public boolean isWindowsAutoUpdateEnabled() { - if (this.innerModel().osProfile().windowsConfiguration() != null) { - return ResourceManagerUtils - .toPrimitiveBoolean(this.innerModel().osProfile().windowsConfiguration().enableAutomaticUpdates()); - } - return false; - } - - @Override - public String windowsTimeZone() { - if (this.innerModel().osProfile().windowsConfiguration() != null) { - return this.innerModel().osProfile().windowsConfiguration().timeZone(); - } - return null; - } - - @Override - public boolean bootDiagnosticEnabled() { - if (this.innerModel().diagnosticsProfile() != null - && this.innerModel().diagnosticsProfile().bootDiagnostics() != null) { - return ResourceManagerUtils - .toPrimitiveBoolean(this.innerModel().diagnosticsProfile().bootDiagnostics().enabled()); - } - return false; - } - - @Override - public String bootDiagnosticStorageAccountUri() { - if (this.innerModel().diagnosticsProfile() != null - && this.innerModel().diagnosticsProfile().bootDiagnostics() != null) { - return this.innerModel().diagnosticsProfile().bootDiagnostics().storageUri(); - } - return null; - } - - @Override - public String availabilitySetId() { - if (this.innerModel().availabilitySet() != null) { - return this.innerModel().availabilitySet().id(); - } - return null; - } - - @Override - public List networkInterfaceIds() { - List resourceIds = new ArrayList<>(); - for (NetworkInterfaceReference reference : this.innerModel().networkProfile().networkInterfaces()) { - resourceIds.add(reference.id()); - } - return Collections.unmodifiableList(resourceIds); - } - - @Override - public String primaryNetworkInterfaceId() { - for (NetworkInterfaceReference reference : this.innerModel().networkProfile().networkInterfaces()) { - if (reference.primary() != null && reference.primary()) { - return reference.id(); - } - } - return null; - } - - @Override - public Map extensions() { - Map extensions = new LinkedHashMap<>(); - if (this.innerModel().resources() != null) { - for (VirtualMachineExtensionInner extensionInner : this.innerModel().resources()) { - extensions - .put( - extensionInner.name(), new VirtualMachineScaleSetVMInstanceExtensionImpl(extensionInner, this)); - } - } - return Collections.unmodifiableMap(extensions); - } - - @Override - public StorageProfile storageProfile() { - return this.innerModel().storageProfile(); - } - - @Override - public OSProfile osProfile() { - return this.innerModel().osProfile(); - } - - @Override - public DiagnosticsProfile diagnosticsProfile() { - return this.innerModel().diagnosticsProfile(); - } - - @Override - public VirtualMachineInstanceView instanceView() { - if (this.virtualMachineInstanceView == null) { - refreshInstanceView(); - } - return this.virtualMachineInstanceView; - } - - @Override - public VirtualMachineInstanceView refreshInstanceView() { - return refreshInstanceViewAsync().block(); - } - - public Mono refreshInstanceViewAsync() { - return this - .client - .getInstanceViewAsync(this.parent().resourceGroupName(), this.parent().name(), this.instanceId()) - .map( - instanceViewInner -> { - virtualMachineInstanceView = - new VirtualMachineInstanceViewImpl( - new VirtualMachineInstanceViewInner() - .withBootDiagnostics(instanceViewInner.bootDiagnostics()) - .withDisks(instanceViewInner.disks()) - .withExtensions(instanceViewInner.extensions()) - .withPlatformFaultDomain(instanceViewInner.platformFaultDomain()) - .withPlatformUpdateDomain(instanceViewInner.platformUpdateDomain()) - .withRdpThumbPrint(instanceViewInner.rdpThumbPrint()) - .withStatuses(instanceViewInner.statuses()) - .withVmAgent(instanceViewInner.vmAgent())); - return virtualMachineInstanceView; - }) - .switchIfEmpty(Mono.defer(() -> Mono.empty())); - } - - @Override - public PowerState powerState() { - return PowerState.fromInstanceView(this.instanceView()); - } - - @Override - public void reimage() { - this.reimageAsync().block(); - } - - @Override - public Mono reimageAsync() { - return this - .client - .reimageAsync(this.parent().resourceGroupName(), this.parent().name(), this.instanceId(), null); - } - - @Override - public void deallocate() { - this.deallocateAsync().block(); - } - - @Override - public Mono deallocateAsync() { - return this.client.deallocateAsync(this.parent().resourceGroupName(), this.parent().name(), this.instanceId()); - } - - @Override - public void powerOff() { - this.powerOffAsync().block(); - } - - @Override - public Mono powerOffAsync() { - return this - .client - .powerOffAsync(this.parent().resourceGroupName(), this.parent().name(), this.instanceId(), null); - } - - @Override - public void start() { - this.startAsync().block(); - } - - @Override - public Mono startAsync() { - return this.client.startAsync(this.parent().resourceGroupName(), this.parent().name(), this.instanceId()); - } - - @Override - public void restart() { - this.restartAsync().block(); - } - - @Override - public Mono restartAsync() { - return this.client.restartAsync(this.parent().resourceGroupName(), this.parent().name(), this.instanceId()); - } - - @Override - public void delete() { - deleteAsync().block(); - } - - @Override - public Mono deleteAsync() { - return this.client.deleteAsync(this.parent().resourceGroupName(), this.parent().name(), this.instanceId()); - } - - @Override - public VirtualMachineScaleSetVM refresh() { - return this.refreshAsync().block(); - } - - @Override - public Mono refreshAsync() { - final VirtualMachineScaleSetVMImpl self = this; - return this - .client - .getAsync(this.parent().resourceGroupName(), this.parent().name(), this.instanceId()) - .map( - vmInner -> { - self.setInner(vmInner); - self.clearCachedRelatedResources(); - self.initializeDataDisks(); - return self; - }); - } - - @Override - public VirtualMachineScaleSetNetworkInterface getNetworkInterface(String name) { - return this.parent().getNetworkInterfaceByInstanceId(this.instanceId(), name); - } - - @Override - public PagedIterable listNetworkInterfaces() { - return this.parent().listNetworkInterfacesByInstanceId(this.instanceId()); - } - - @Override - public PagedFlux listNetworkInterfacesAsync() { - return this.parent().listNetworkInterfacesByInstanceIdAsync(this.instanceId()); - } - - @Override - public String modelDefinitionApplied() { - return this.innerModel().modelDefinitionApplied(); - } - - @Override - public VirtualMachineScaleSetVMProtectionPolicy protectionPolicy() { - return this.innerModel().protectionPolicy(); - } - - @Override - public VirtualMachineScaleSetVMNetworkProfileConfiguration networkProfileConfiguration() { - return this.innerModel().networkProfileConfiguration(); - } - - private void clearCachedRelatedResources() { - this.virtualMachineInstanceView = null; - } - - @Override - public boolean isManagedDiskEnabled() { - if (isOSBasedOnCustomImage()) { - return true; - } - if (isOSBasedOnStoredImage()) { - return false; - } - if (isOSBasedOnPlatformImage()) { - if (this.innerModel().storageProfile().osDisk() != null - && this.innerModel().storageProfile().osDisk().vhd() != null) { - return false; - } - } - return true; - } - - @Override - public Update withExistingDataDisk(Disk dataDisk, int lun, CachingTypes cachingTypes) { - return this - .withExistingDataDisk( - dataDisk, lun, cachingTypes, StorageAccountTypes.fromString(dataDisk.sku().accountType().toString())); - } - - @Override - public Update withExistingDataDisk( - Disk dataDisk, int lun, CachingTypes cachingTypes, StorageAccountTypes storageAccountTypes) { - if (!this.isManagedDiskEnabled()) { - throw logger - .logExceptionAsError( - new IllegalStateException( - ManagedUnmanagedDiskErrors.VM_BOTH_UNMANAGED_AND_MANAGED_DISK_NOT_ALLOWED)); - } - if (dataDisk.innerModel().diskState() != DiskState.UNATTACHED) { - throw logger.logExceptionAsError(new IllegalStateException("Disk need to be in unattached state")); - } - - ManagedDiskParameters managedDiskParameters = - new ManagedDiskParameters().withStorageAccountType(storageAccountTypes); - managedDiskParameters.withId(dataDisk.id()); - - DataDisk attachDataDisk = - new DataDisk() - .withCreateOption(DiskCreateOptionTypes.ATTACH) - .withLun(lun) - .withCaching(cachingTypes) - .withManagedDisk(managedDiskParameters); - return this.withExistingDataDisk(attachDataDisk, lun); - } - - private Update withExistingDataDisk(DataDisk dataDisk, int lun) { - if (this.tryFindDataDisk(lun, this.innerModel().storageProfile().dataDisks()) != null) { - throw logger - .logExceptionAsError( - new IllegalStateException(String.format("A data disk with lun '%d' already attached", lun))); - } else if (this.tryFindDataDisk(lun, this.managedDataDisks.existingDisksToAttach) != null) { - throw logger - .logExceptionAsError( - new IllegalStateException( - String.format("A data disk with lun '%d' already scheduled to be attached", lun))); - } - this.managedDataDisks.existingDisksToAttach.add(dataDisk); - return this; - } - - @Override - public Update withoutDataDisk(int lun) { - DataDisk dataDisk = this.tryFindDataDisk(lun, this.innerModel().storageProfile().dataDisks()); - if (dataDisk == null) { - throw logger - .logExceptionAsError( - new IllegalStateException(String.format("A data disk with lun '%d' not found", lun))); - } - if (dataDisk.createOption() != DiskCreateOptionTypes.ATTACH) { - String exceptionMessage = String.format( - "A data disk with lun '%d' cannot be detached, as it is part of Virtual Machine Scale Set model", - lun - ); - throw logger.logExceptionAsError(new IllegalStateException(exceptionMessage)); - } - this.managedDataDisks.diskLunsToRemove.add(lun); - return this; - } - - @Override - public VirtualMachineScaleSetVM apply() { - return this.applyAsync().block(); - } - - @Override - public Mono applyAsync() { - return applyAsync(Context.NONE); - } - - @Override - public VirtualMachineScaleSetVM apply(Context context) { - return applyAsync(context).block(); - } - - @Override - public Mono applyAsync(Context context) { - final VirtualMachineScaleSetVMImpl self = this; - this.managedDataDisks.syncToVMDataDisks(this.innerModel().storageProfile()); - return this - .parent() - .manager() - .serviceClient() - .getVirtualMachineScaleSetVMs() - .updateAsync(this.parent().resourceGroupName(), this.parent().name(), this.instanceId(), this.innerModel()) - .contextWrite(c -> c.putAll(FluxUtil.toReactorContext(context).readOnly())) - .map( - vmInner -> { - self.setInner(vmInner); - self.clearCachedRelatedResources(); - self.initializeDataDisks(); - return self; - }); - } - - @Override - public VirtualMachineScaleSetVM.Update update() { - initializeDataDisks(); - return this; - } - - private void initializeDataDisks() { - this.managedDataDisks.clear(); - } - - private DataDisk tryFindDataDisk(int lun, List dataDisks) { - DataDisk disk = null; - if (dataDisks != null) { - for (DataDisk dataDisk : dataDisks) { - if (dataDisk.lun() == lun) { - disk = dataDisk; - break; - } - } - } - return disk; - } - - /** Class to manage data disk collection. */ - private static class ManagedDataDiskCollection { - private final List existingDisksToAttach = new ArrayList<>(); - private final List diskLunsToRemove = new ArrayList<>(); - - void syncToVMDataDisks(StorageProfile storageProfile) { - if (storageProfile != null && this.isPending()) { - // remove disks from VM inner - if (storageProfile.dataDisks() != null && !diskLunsToRemove.isEmpty()) { - Iterator iterator = storageProfile.dataDisks().iterator(); - while (iterator.hasNext()) { - DataDisk dataDisk = iterator.next(); - if (diskLunsToRemove.contains(dataDisk.lun())) { - iterator.remove(); - } - } - } - - // add disks to VM inner - if (!existingDisksToAttach.isEmpty()) { - for (DataDisk dataDisk : existingDisksToAttach) { - if (storageProfile.dataDisks() == null) { - storageProfile.withDataDisks(new ArrayList()); - } - storageProfile.dataDisks().add(dataDisk); - } - } - - // clear ManagedDataDiskCollection after it is synced into VM inner - this.clear(); - } - } - - private void clear() { - existingDisksToAttach.clear(); - diskLunsToRemove.clear(); - } - - private boolean isPending() { - return !(existingDisksToAttach.isEmpty() && diskLunsToRemove.isEmpty()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineScaleSetVMInstanceExtensionImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineScaleSetVMInstanceExtensionImpl.java deleted file mode 100644 index 4db23ce6b8a9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineScaleSetVMInstanceExtensionImpl.java +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.compute.implementation; - -import com.azure.resourcemanager.compute.models.VirtualMachineExtensionInstanceView; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetVM; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetVMInstanceExtension; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineExtensionInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.ChildResourceImpl; -import java.util.Collections; -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.Map; - -/** Implementation of {@link VirtualMachineScaleSetVMInstanceExtension}. */ -class VirtualMachineScaleSetVMInstanceExtensionImpl - extends ChildResourceImpl - implements VirtualMachineScaleSetVMInstanceExtension { - - private HashMap publicSettings; - private HashMap protectedSettings; - - VirtualMachineScaleSetVMInstanceExtensionImpl( - VirtualMachineExtensionInner inner, VirtualMachineScaleSetVMImpl parent) { - super(inner, parent); - initializeSettings(); - } - - @Override - public String name() { - return this.innerModel().name(); - } - - @Override - public String publisherName() { - return this.innerModel().publisher(); - } - - @Override - public String typeName() { - return this.innerModel().type(); - } - - @Override - public String versionName() { - return this.innerModel().typeHandlerVersion(); - } - - @Override - public boolean autoUpgradeMinorVersionEnabled() { - return this.innerModel().autoUpgradeMinorVersion(); - } - - @Override - public Map publicSettings() { - return Collections.unmodifiableMap(this.publicSettings); - } - - @Override - public String publicSettingsAsJsonString() { - return null; - } - - @Override - public String provisioningState() { - return this.innerModel().provisioningState(); - } - - @Override - public VirtualMachineExtensionInstanceView instanceView() { - return this.innerModel().instanceView(); - } - - @Override - public Map tags() { - if (this.innerModel().tags() == null) { - return Collections.unmodifiableMap(new LinkedHashMap()); - } - return Collections.unmodifiableMap(this.innerModel().tags()); - } - - @SuppressWarnings("unchecked") - private void initializeSettings() { - if (this.innerModel().settings() == null) { - this.publicSettings = new LinkedHashMap<>(); - this.innerModel().withSettings(this.publicSettings); - } else { - this.publicSettings = (LinkedHashMap) this.innerModel().settings(); - } - - if (this.innerModel().protectedSettings() == null) { - this.protectedSettings = new LinkedHashMap<>(); - this.innerModel().withProtectedSettings(this.protectedSettings); - } else { - this.protectedSettings = (LinkedHashMap) this.innerModel().protectedSettings(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineScaleSetVMRunCommandsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineScaleSetVMRunCommandsClientImpl.java deleted file mode 100644 index d1aa9f20871c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineScaleSetVMRunCommandsClientImpl.java +++ /dev/null @@ -1,1691 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.compute.fluent.VirtualMachineScaleSetVMRunCommandsClient; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineRunCommandInner; -import com.azure.resourcemanager.compute.models.ApiErrorException; -import com.azure.resourcemanager.compute.models.VirtualMachineRunCommandUpdate; -import com.azure.resourcemanager.compute.models.VirtualMachineRunCommandsListResult; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in VirtualMachineScaleSetVMRunCommandsClient. - */ -public final class VirtualMachineScaleSetVMRunCommandsClientImpl implements VirtualMachineScaleSetVMRunCommandsClient { - private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetVMRunCommandsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final VirtualMachineScaleSetVMRunCommandsService service; - - /** The service client containing this operation class. */ - private final ComputeManagementClientImpl client; - - /** - * Initializes an instance of VirtualMachineScaleSetVMRunCommandsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - VirtualMachineScaleSetVMRunCommandsClientImpl(ComputeManagementClientImpl client) { - this.service = - RestProxy - .create( - VirtualMachineScaleSetVMRunCommandsService.class, - client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for ComputeManagementClientVirtualMachineScaleSetVMRunCommands to be used - * by the proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "ComputeManagementCli") - private interface VirtualMachineScaleSetVMRunCommandsService { - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @PathParam("instanceId") String instanceId, - @PathParam("runCommandName") String runCommandName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VirtualMachineRunCommandInner runCommand, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono>> update( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @PathParam("instanceId") String instanceId, - @PathParam("runCommandName") String runCommandName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VirtualMachineRunCommandUpdate runCommand, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @PathParam("instanceId") String instanceId, - @PathParam("runCommandName") String runCommandName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @PathParam("instanceId") String instanceId, - @PathParam("runCommandName") String runCommandName, - @QueryParam("$expand") String expand, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @PathParam("instanceId") String instanceId, - @QueryParam("$expand") String expand, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * The operation to create or update the VMSS VM run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param runCommandName The name of the virtual machine run command. - * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String runCommandName, - VirtualMachineRunCommandInner runCommand) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (runCommandName == null) { - return Mono.error(new IllegalArgumentException("Parameter runCommandName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (runCommand == null) { - return Mono.error(new IllegalArgumentException("Parameter runCommand is required and cannot be null.")); - } else { - runCommand.validate(); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - runCommandName, - apiVersion, - this.client.getSubscriptionId(), - runCommand, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * The operation to create or update the VMSS VM run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param runCommandName The name of the virtual machine run command. - * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String runCommandName, - VirtualMachineRunCommandInner runCommand, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (runCommandName == null) { - return Mono.error(new IllegalArgumentException("Parameter runCommandName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (runCommand == null) { - return Mono.error(new IllegalArgumentException("Parameter runCommand is required and cannot be null.")); - } else { - runCommand.validate(); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - runCommandName, - apiVersion, - this.client.getSubscriptionId(), - runCommand, - accept, - context); - } - - /** - * The operation to create or update the VMSS VM run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param runCommandName The name of the virtual machine run command. - * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, VirtualMachineRunCommandInner> - beginCreateOrUpdateAsync( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String runCommandName, - VirtualMachineRunCommandInner runCommand) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, runCommand); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VirtualMachineRunCommandInner.class, - VirtualMachineRunCommandInner.class, - Context.NONE); - } - - /** - * The operation to create or update the VMSS VM run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param runCommandName The name of the virtual machine run command. - * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, VirtualMachineRunCommandInner> - beginCreateOrUpdateAsync( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String runCommandName, - VirtualMachineRunCommandInner runCommand, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync( - resourceGroupName, vmScaleSetName, instanceId, runCommandName, runCommand, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VirtualMachineRunCommandInner.class, - VirtualMachineRunCommandInner.class, - context); - } - - /** - * The operation to create or update the VMSS VM run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param runCommandName The name of the virtual machine run command. - * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VirtualMachineRunCommandInner> beginCreateOrUpdate( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String runCommandName, - VirtualMachineRunCommandInner runCommand) { - return beginCreateOrUpdateAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, runCommand) - .getSyncPoller(); - } - - /** - * The operation to create or update the VMSS VM run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param runCommandName The name of the virtual machine run command. - * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VirtualMachineRunCommandInner> beginCreateOrUpdate( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String runCommandName, - VirtualMachineRunCommandInner runCommand, - Context context) { - return beginCreateOrUpdateAsync( - resourceGroupName, vmScaleSetName, instanceId, runCommandName, runCommand, context) - .getSyncPoller(); - } - - /** - * The operation to create or update the VMSS VM run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param runCommandName The name of the virtual machine run command. - * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String runCommandName, - VirtualMachineRunCommandInner runCommand) { - return beginCreateOrUpdateAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, runCommand) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * The operation to create or update the VMSS VM run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param runCommandName The name of the virtual machine run command. - * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String runCommandName, - VirtualMachineRunCommandInner runCommand, - Context context) { - return beginCreateOrUpdateAsync( - resourceGroupName, vmScaleSetName, instanceId, runCommandName, runCommand, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * The operation to create or update the VMSS VM run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param runCommandName The name of the virtual machine run command. - * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineRunCommandInner createOrUpdate( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String runCommandName, - VirtualMachineRunCommandInner runCommand) { - return createOrUpdateAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, runCommand).block(); - } - - /** - * The operation to create or update the VMSS VM run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param runCommandName The name of the virtual machine run command. - * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineRunCommandInner createOrUpdate( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String runCommandName, - VirtualMachineRunCommandInner runCommand, - Context context) { - return createOrUpdateAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, runCommand, context) - .block(); - } - - /** - * The operation to update the VMSS VM run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param runCommandName The name of the virtual machine run command. - * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateWithResponseAsync( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String runCommandName, - VirtualMachineRunCommandUpdate runCommand) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (runCommandName == null) { - return Mono.error(new IllegalArgumentException("Parameter runCommandName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (runCommand == null) { - return Mono.error(new IllegalArgumentException("Parameter runCommand is required and cannot be null.")); - } else { - runCommand.validate(); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - runCommandName, - apiVersion, - this.client.getSubscriptionId(), - runCommand, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * The operation to update the VMSS VM run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param runCommandName The name of the virtual machine run command. - * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String runCommandName, - VirtualMachineRunCommandUpdate runCommand, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (runCommandName == null) { - return Mono.error(new IllegalArgumentException("Parameter runCommandName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (runCommand == null) { - return Mono.error(new IllegalArgumentException("Parameter runCommand is required and cannot be null.")); - } else { - runCommand.validate(); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - runCommandName, - apiVersion, - this.client.getSubscriptionId(), - runCommand, - accept, - context); - } - - /** - * The operation to update the VMSS VM run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param runCommandName The name of the virtual machine run command. - * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, VirtualMachineRunCommandInner> beginUpdateAsync( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String runCommandName, - VirtualMachineRunCommandUpdate runCommand) { - Mono>> mono = - updateWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, runCommand); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VirtualMachineRunCommandInner.class, - VirtualMachineRunCommandInner.class, - Context.NONE); - } - - /** - * The operation to update the VMSS VM run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param runCommandName The name of the virtual machine run command. - * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, VirtualMachineRunCommandInner> beginUpdateAsync( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String runCommandName, - VirtualMachineRunCommandUpdate runCommand, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - updateWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, runCommand, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VirtualMachineRunCommandInner.class, - VirtualMachineRunCommandInner.class, - context); - } - - /** - * The operation to update the VMSS VM run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param runCommandName The name of the virtual machine run command. - * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VirtualMachineRunCommandInner> beginUpdate( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String runCommandName, - VirtualMachineRunCommandUpdate runCommand) { - return beginUpdateAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, runCommand) - .getSyncPoller(); - } - - /** - * The operation to update the VMSS VM run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param runCommandName The name of the virtual machine run command. - * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VirtualMachineRunCommandInner> beginUpdate( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String runCommandName, - VirtualMachineRunCommandUpdate runCommand, - Context context) { - return beginUpdateAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, runCommand, context) - .getSyncPoller(); - } - - /** - * The operation to update the VMSS VM run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param runCommandName The name of the virtual machine run command. - * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String runCommandName, - VirtualMachineRunCommandUpdate runCommand) { - return beginUpdateAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, runCommand) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * The operation to update the VMSS VM run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param runCommandName The name of the virtual machine run command. - * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String runCommandName, - VirtualMachineRunCommandUpdate runCommand, - Context context) { - return beginUpdateAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, runCommand, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * The operation to update the VMSS VM run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param runCommandName The name of the virtual machine run command. - * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineRunCommandInner update( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String runCommandName, - VirtualMachineRunCommandUpdate runCommand) { - return updateAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, runCommand).block(); - } - - /** - * The operation to update the VMSS VM run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param runCommandName The name of the virtual machine run command. - * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineRunCommandInner update( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String runCommandName, - VirtualMachineRunCommandUpdate runCommand, - Context context) { - return updateAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, runCommand, context).block(); - } - - /** - * The operation to delete the VMSS VM run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param runCommandName The name of the virtual machine run command. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (runCommandName == null) { - return Mono.error(new IllegalArgumentException("Parameter runCommandName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - runCommandName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * The operation to delete the VMSS VM run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param runCommandName The name of the virtual machine run command. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (runCommandName == null) { - return Mono.error(new IllegalArgumentException("Parameter runCommandName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - runCommandName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * The operation to delete the VMSS VM run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param runCommandName The name of the virtual machine run command. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName) { - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * The operation to delete the VMSS VM run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param runCommandName The name of the virtual machine run command. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * The operation to delete the VMSS VM run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param runCommandName The name of the virtual machine run command. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName) { - return beginDeleteAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName).getSyncPoller(); - } - - /** - * The operation to delete the VMSS VM run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param runCommandName The name of the virtual machine run command. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName, Context context) { - return beginDeleteAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, context).getSyncPoller(); - } - - /** - * The operation to delete the VMSS VM run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param runCommandName The name of the virtual machine run command. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName) { - return beginDeleteAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * The operation to delete the VMSS VM run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param runCommandName The name of the virtual machine run command. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName, Context context) { - return beginDeleteAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * The operation to delete the VMSS VM run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param runCommandName The name of the virtual machine run command. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName) { - deleteAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName).block(); - } - - /** - * The operation to delete the VMSS VM run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param runCommandName The name of the virtual machine run command. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete( - String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName, Context context) { - deleteAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, context).block(); - } - - /** - * The operation to get the VMSS VM run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param runCommandName The name of the virtual machine run command. - * @param expand The expand expression to apply on the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName, String expand) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (runCommandName == null) { - return Mono.error(new IllegalArgumentException("Parameter runCommandName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - runCommandName, - expand, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * The operation to get the VMSS VM run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param runCommandName The name of the virtual machine run command. - * @param expand The expand expression to apply on the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String runCommandName, - String expand, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (runCommandName == null) { - return Mono.error(new IllegalArgumentException("Parameter runCommandName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - runCommandName, - expand, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * The operation to get the VMSS VM run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param runCommandName The name of the virtual machine run command. - * @param expand The expand expression to apply on the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName, String expand) { - return getWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * The operation to get the VMSS VM run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param runCommandName The name of the virtual machine run command. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName) { - final String expand = null; - return getWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * The operation to get the VMSS VM run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param runCommandName The name of the virtual machine run command. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineRunCommandInner get( - String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName) { - final String expand = null; - return getAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, expand).block(); - } - - /** - * The operation to get the VMSS VM run command. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param runCommandName The name of the virtual machine run command. - * @param expand The expand expression to apply on the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine run command. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String runCommandName, - String expand, - Context context) { - return getWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, expand, context) - .block(); - } - - /** - * The operation to get all run commands of an instance in Virtual Machine Scaleset. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param expand The expand expression to apply on the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List run command operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, String expand) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - expand, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * The operation to get all run commands of an instance in Virtual Machine Scaleset. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param expand The expand expression to apply on the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List run command operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, String expand, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - expand, - apiVersion, - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * The operation to get all run commands of an instance in Virtual Machine Scaleset. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param expand The expand expression to apply on the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List run command operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, String expand) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, vmScaleSetName, instanceId, expand), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * The operation to get all run commands of an instance in Virtual Machine Scaleset. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List run command operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync( - String resourceGroupName, String vmScaleSetName, String instanceId) { - final String expand = null; - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, vmScaleSetName, instanceId, expand), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * The operation to get all run commands of an instance in Virtual Machine Scaleset. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param expand The expand expression to apply on the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List run command operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, String expand, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, vmScaleSetName, instanceId, expand, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * The operation to get all run commands of an instance in Virtual Machine Scaleset. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List run command operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, String vmScaleSetName, String instanceId) { - final String expand = null; - return new PagedIterable<>(listAsync(resourceGroupName, vmScaleSetName, instanceId, expand)); - } - - /** - * The operation to get all run commands of an instance in Virtual Machine Scaleset. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param expand The expand expression to apply on the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List run command operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, String vmScaleSetName, String instanceId, String expand, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, vmScaleSetName, instanceId, expand, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List run command operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List run command operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineScaleSetVMsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineScaleSetVMsClientImpl.java deleted file mode 100644 index 9b7280b724f1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineScaleSetVMsClientImpl.java +++ /dev/null @@ -1,4477 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.compute.fluent.VirtualMachineScaleSetVMsClient; -import com.azure.resourcemanager.compute.fluent.models.RetrieveBootDiagnosticsDataResultInner; -import com.azure.resourcemanager.compute.fluent.models.RunCommandResultInner; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineScaleSetVMInner; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineScaleSetVMInstanceViewInner; -import com.azure.resourcemanager.compute.models.ApiErrorException; -import com.azure.resourcemanager.compute.models.InstanceViewTypes; -import com.azure.resourcemanager.compute.models.RunCommandInput; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetVMListResult; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetVMReimageParameters; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in VirtualMachineScaleSetVMsClient. */ -public final class VirtualMachineScaleSetVMsClientImpl implements VirtualMachineScaleSetVMsClient { - private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetVMsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final VirtualMachineScaleSetVMsService service; - - /** The service client containing this operation class. */ - private final ComputeManagementClientImpl client; - - /** - * Initializes an instance of VirtualMachineScaleSetVMsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - VirtualMachineScaleSetVMsClientImpl(ComputeManagementClientImpl client) { - this.service = - RestProxy - .create( - VirtualMachineScaleSetVMsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for ComputeManagementClientVirtualMachineScaleSetVMs to be used by the - * proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "ComputeManagementCli") - private interface VirtualMachineScaleSetVMsService { - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/reimage") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> reimage( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @PathParam("instanceId") String instanceId, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VirtualMachineScaleSetVMReimageParameters vmScaleSetVMReimageInput, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/reimageall") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> reimageAll( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @PathParam("instanceId") String instanceId, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/deallocate") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> deallocate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @PathParam("instanceId") String instanceId, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @PathParam("instanceId") String instanceId, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VirtualMachineScaleSetVMInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @PathParam("instanceId") String instanceId, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @PathParam("instanceId") String instanceId, - @QueryParam("$expand") InstanceViewTypes expand, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/instanceView") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getInstanceView( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @PathParam("instanceId") String instanceId, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualMachineScaleSetName") String virtualMachineScaleSetName, - @QueryParam("$filter") String filter, - @QueryParam("$select") String select, - @QueryParam("$expand") String expand, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/poweroff") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> powerOff( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @PathParam("instanceId") String instanceId, - @QueryParam("skipShutdown") Boolean skipShutdown, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/restart") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> restart( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @PathParam("instanceId") String instanceId, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/start") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> start( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @PathParam("instanceId") String instanceId, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/redeploy") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> redeploy( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @PathParam("instanceId") String instanceId, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/retrieveBootDiagnosticsData") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> retrieveBootDiagnosticsData( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @PathParam("instanceId") String instanceId, - @QueryParam("sasUriExpirationTimeInMinutes") Integer sasUriExpirationTimeInMinutes, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/performMaintenance") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> performMaintenance( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @PathParam("instanceId") String instanceId, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/simulateEviction") - @ExpectedResponses({204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> simulateEviction( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @PathParam("instanceId") String instanceId, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/runCommand") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> runCommand( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @PathParam("instanceId") String instanceId, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") RunCommandInput parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmScaleSetVMReimageInput Parameters for the Reimaging Virtual machine in ScaleSet. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> reimageWithResponseAsync( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - VirtualMachineScaleSetVMReimageParameters vmScaleSetVMReimageInput) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (vmScaleSetVMReimageInput != null) { - vmScaleSetVMReimageInput.validate(); - } - final String apiVersion = "2020-06-01"; - return FluxUtil - .withContext( - context -> - service - .reimage( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - apiVersion, - this.client.getSubscriptionId(), - vmScaleSetVMReimageInput, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmScaleSetVMReimageInput Parameters for the Reimaging Virtual machine in ScaleSet. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> reimageWithResponseAsync( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - VirtualMachineScaleSetVMReimageParameters vmScaleSetVMReimageInput, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (vmScaleSetVMReimageInput != null) { - vmScaleSetVMReimageInput.validate(); - } - final String apiVersion = "2020-06-01"; - context = this.client.mergeContext(context); - return service - .reimage( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - apiVersion, - this.client.getSubscriptionId(), - vmScaleSetVMReimageInput, - context); - } - - /** - * Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmScaleSetVMReimageInput Parameters for the Reimaging Virtual machine in ScaleSet. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginReimageAsync( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - VirtualMachineScaleSetVMReimageParameters vmScaleSetVMReimageInput) { - Mono>> mono = - reimageWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, vmScaleSetVMReimageInput); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmScaleSetVMReimageInput Parameters for the Reimaging Virtual machine in ScaleSet. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginReimageAsync( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - VirtualMachineScaleSetVMReimageParameters vmScaleSetVMReimageInput, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - reimageWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, vmScaleSetVMReimageInput, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmScaleSetVMReimageInput Parameters for the Reimaging Virtual machine in ScaleSet. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginReimage( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - VirtualMachineScaleSetVMReimageParameters vmScaleSetVMReimageInput) { - return beginReimageAsync(resourceGroupName, vmScaleSetName, instanceId, vmScaleSetVMReimageInput) - .getSyncPoller(); - } - - /** - * Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmScaleSetVMReimageInput Parameters for the Reimaging Virtual machine in ScaleSet. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginReimage( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - VirtualMachineScaleSetVMReimageParameters vmScaleSetVMReimageInput, - Context context) { - return beginReimageAsync(resourceGroupName, vmScaleSetName, instanceId, vmScaleSetVMReimageInput, context) - .getSyncPoller(); - } - - /** - * Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmScaleSetVMReimageInput Parameters for the Reimaging Virtual machine in ScaleSet. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono reimageAsync( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - VirtualMachineScaleSetVMReimageParameters vmScaleSetVMReimageInput) { - return beginReimageAsync(resourceGroupName, vmScaleSetName, instanceId, vmScaleSetVMReimageInput) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono reimageAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { - final VirtualMachineScaleSetVMReimageParameters vmScaleSetVMReimageInput = null; - return beginReimageAsync(resourceGroupName, vmScaleSetName, instanceId, vmScaleSetVMReimageInput) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmScaleSetVMReimageInput Parameters for the Reimaging Virtual machine in ScaleSet. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono reimageAsync( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - VirtualMachineScaleSetVMReimageParameters vmScaleSetVMReimageInput, - Context context) { - return beginReimageAsync(resourceGroupName, vmScaleSetName, instanceId, vmScaleSetVMReimageInput, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmScaleSetVMReimageInput Parameters for the Reimaging Virtual machine in ScaleSet. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void reimage( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - VirtualMachineScaleSetVMReimageParameters vmScaleSetVMReimageInput) { - reimageAsync(resourceGroupName, vmScaleSetName, instanceId, vmScaleSetVMReimageInput).block(); - } - - /** - * Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void reimage(String resourceGroupName, String vmScaleSetName, String instanceId) { - final VirtualMachineScaleSetVMReimageParameters vmScaleSetVMReimageInput = null; - reimageAsync(resourceGroupName, vmScaleSetName, instanceId, vmScaleSetVMReimageInput).block(); - } - - /** - * Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmScaleSetVMReimageInput Parameters for the Reimaging Virtual machine in ScaleSet. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void reimage( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - VirtualMachineScaleSetVMReimageParameters vmScaleSetVMReimageInput, - Context context) { - reimageAsync(resourceGroupName, vmScaleSetName, instanceId, vmScaleSetVMReimageInput, context).block(); - } - - /** - * Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is - * only supported for managed disks. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> reimageAllWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - return FluxUtil - .withContext( - context -> - service - .reimageAll( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - apiVersion, - this.client.getSubscriptionId(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is - * only supported for managed disks. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> reimageAllWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - context = this.client.mergeContext(context); - return service - .reimageAll( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is - * only supported for managed disks. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginReimageAllAsync( - String resourceGroupName, String vmScaleSetName, String instanceId) { - Mono>> mono = - reimageAllWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is - * only supported for managed disks. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginReimageAllAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - reimageAllWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is - * only supported for managed disks. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginReimageAll( - String resourceGroupName, String vmScaleSetName, String instanceId) { - return beginReimageAllAsync(resourceGroupName, vmScaleSetName, instanceId).getSyncPoller(); - } - - /** - * Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is - * only supported for managed disks. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginReimageAll( - String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - return beginReimageAllAsync(resourceGroupName, vmScaleSetName, instanceId, context).getSyncPoller(); - } - - /** - * Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is - * only supported for managed disks. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono reimageAllAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { - return beginReimageAllAsync(resourceGroupName, vmScaleSetName, instanceId) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is - * only supported for managed disks. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono reimageAllAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - return beginReimageAllAsync(resourceGroupName, vmScaleSetName, instanceId, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is - * only supported for managed disks. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void reimageAll(String resourceGroupName, String vmScaleSetName, String instanceId) { - reimageAllAsync(resourceGroupName, vmScaleSetName, instanceId).block(); - } - - /** - * Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is - * only supported for managed disks. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void reimageAll(String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - reimageAllAsync(resourceGroupName, vmScaleSetName, instanceId, context).block(); - } - - /** - * Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute - * resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deallocateWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - return FluxUtil - .withContext( - context -> - service - .deallocate( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - apiVersion, - this.client.getSubscriptionId(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute - * resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deallocateWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - context = this.client.mergeContext(context); - return service - .deallocate( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute - * resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeallocateAsync( - String resourceGroupName, String vmScaleSetName, String instanceId) { - Mono>> mono = - deallocateWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute - * resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeallocateAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - deallocateWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute - * resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDeallocate( - String resourceGroupName, String vmScaleSetName, String instanceId) { - return beginDeallocateAsync(resourceGroupName, vmScaleSetName, instanceId).getSyncPoller(); - } - - /** - * Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute - * resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDeallocate( - String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - return beginDeallocateAsync(resourceGroupName, vmScaleSetName, instanceId, context).getSyncPoller(); - } - - /** - * Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute - * resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deallocateAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { - return beginDeallocateAsync(resourceGroupName, vmScaleSetName, instanceId) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute - * resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deallocateAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - return beginDeallocateAsync(resourceGroupName, vmScaleSetName, instanceId, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute - * resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deallocate(String resourceGroupName, String vmScaleSetName, String instanceId) { - deallocateAsync(resourceGroupName, vmScaleSetName, instanceId).block(); - } - - /** - * Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute - * resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deallocate(String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - deallocateAsync(resourceGroupName, vmScaleSetName, instanceId, context).block(); - } - - /** - * Updates a virtual machine of a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. - * @param instanceId The instance ID of the virtual machine. - * @param parameters Parameters supplied to the Update Virtual Machine Scale Sets VM operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a virtual machine scale set virtual machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, VirtualMachineScaleSetVMInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates a virtual machine of a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. - * @param instanceId The instance ID of the virtual machine. - * @param parameters Parameters supplied to the Update Virtual Machine Scale Sets VM operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a virtual machine scale set virtual machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - VirtualMachineScaleSetVMInner parameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Updates a virtual machine of a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. - * @param instanceId The instance ID of the virtual machine. - * @param parameters Parameters supplied to the Update Virtual Machine Scale Sets VM operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a virtual machine scale set virtual machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, VirtualMachineScaleSetVMInner> beginUpdateAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, VirtualMachineScaleSetVMInner parameters) { - Mono>> mono = - updateWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VirtualMachineScaleSetVMInner.class, - VirtualMachineScaleSetVMInner.class, - Context.NONE); - } - - /** - * Updates a virtual machine of a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. - * @param instanceId The instance ID of the virtual machine. - * @param parameters Parameters supplied to the Update Virtual Machine Scale Sets VM operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a virtual machine scale set virtual machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, VirtualMachineScaleSetVMInner> beginUpdateAsync( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - VirtualMachineScaleSetVMInner parameters, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - updateWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, parameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VirtualMachineScaleSetVMInner.class, - VirtualMachineScaleSetVMInner.class, - context); - } - - /** - * Updates a virtual machine of a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. - * @param instanceId The instance ID of the virtual machine. - * @param parameters Parameters supplied to the Update Virtual Machine Scale Sets VM operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a virtual machine scale set virtual machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VirtualMachineScaleSetVMInner> beginUpdate( - String resourceGroupName, String vmScaleSetName, String instanceId, VirtualMachineScaleSetVMInner parameters) { - return beginUpdateAsync(resourceGroupName, vmScaleSetName, instanceId, parameters).getSyncPoller(); - } - - /** - * Updates a virtual machine of a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. - * @param instanceId The instance ID of the virtual machine. - * @param parameters Parameters supplied to the Update Virtual Machine Scale Sets VM operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a virtual machine scale set virtual machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VirtualMachineScaleSetVMInner> beginUpdate( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - VirtualMachineScaleSetVMInner parameters, - Context context) { - return beginUpdateAsync(resourceGroupName, vmScaleSetName, instanceId, parameters, context).getSyncPoller(); - } - - /** - * Updates a virtual machine of a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. - * @param instanceId The instance ID of the virtual machine. - * @param parameters Parameters supplied to the Update Virtual Machine Scale Sets VM operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a virtual machine scale set virtual machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, VirtualMachineScaleSetVMInner parameters) { - return beginUpdateAsync(resourceGroupName, vmScaleSetName, instanceId, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates a virtual machine of a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. - * @param instanceId The instance ID of the virtual machine. - * @param parameters Parameters supplied to the Update Virtual Machine Scale Sets VM operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a virtual machine scale set virtual machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - VirtualMachineScaleSetVMInner parameters, - Context context) { - return beginUpdateAsync(resourceGroupName, vmScaleSetName, instanceId, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates a virtual machine of a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. - * @param instanceId The instance ID of the virtual machine. - * @param parameters Parameters supplied to the Update Virtual Machine Scale Sets VM operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a virtual machine scale set virtual machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineScaleSetVMInner update( - String resourceGroupName, String vmScaleSetName, String instanceId, VirtualMachineScaleSetVMInner parameters) { - return updateAsync(resourceGroupName, vmScaleSetName, instanceId, parameters).block(); - } - - /** - * Updates a virtual machine of a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. - * @param instanceId The instance ID of the virtual machine. - * @param parameters Parameters supplied to the Update Virtual Machine Scale Sets VM operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a virtual machine scale set virtual machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineScaleSetVMInner update( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - VirtualMachineScaleSetVMInner parameters, - Context context) { - return updateAsync(resourceGroupName, vmScaleSetName, instanceId, parameters, context).block(); - } - - /** - * Deletes a virtual machine from a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - apiVersion, - this.client.getSubscriptionId(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a virtual machine from a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Deletes a virtual machine from a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String vmScaleSetName, String instanceId) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deletes a virtual machine from a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes a virtual machine from a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String vmScaleSetName, String instanceId) { - return beginDeleteAsync(resourceGroupName, vmScaleSetName, instanceId).getSyncPoller(); - } - - /** - * Deletes a virtual machine from a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - return beginDeleteAsync(resourceGroupName, vmScaleSetName, instanceId, context).getSyncPoller(); - } - - /** - * Deletes a virtual machine from a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { - return beginDeleteAsync(resourceGroupName, vmScaleSetName, instanceId) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a virtual machine from a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - return beginDeleteAsync(resourceGroupName, vmScaleSetName, instanceId, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a virtual machine from a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String vmScaleSetName, String instanceId) { - deleteAsync(resourceGroupName, vmScaleSetName, instanceId).block(); - } - - /** - * Deletes a virtual machine from a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - deleteAsync(resourceGroupName, vmScaleSetName, instanceId, context).block(); - } - - /** - * Gets a virtual machine from a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param expand The expand expression to apply on the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual machine from a VM scale set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, InstanceViewTypes expand) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - expand, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a virtual machine from a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param expand The expand expression to apply on the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual machine from a VM scale set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, InstanceViewTypes expand, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - expand, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets a virtual machine from a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param expand The expand expression to apply on the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual machine from a VM scale set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, InstanceViewTypes expand) { - return getWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a virtual machine from a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual machine from a VM scale set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync( - String resourceGroupName, String vmScaleSetName, String instanceId) { - final InstanceViewTypes expand = null; - return getWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a virtual machine from a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual machine from a VM scale set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineScaleSetVMInner get(String resourceGroupName, String vmScaleSetName, String instanceId) { - final InstanceViewTypes expand = null; - return getAsync(resourceGroupName, vmScaleSetName, instanceId, expand).block(); - } - - /** - * Gets a virtual machine from a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param expand The expand expression to apply on the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual machine from a VM scale set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String vmScaleSetName, String instanceId, InstanceViewTypes expand, Context context) { - return getWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, expand, context).block(); - } - - /** - * Gets the status of a virtual machine from a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of a virtual machine from a VM scale set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getInstanceViewWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getInstanceView( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the status of a virtual machine from a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of a virtual machine from a VM scale set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getInstanceViewWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getInstanceView( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets the status of a virtual machine from a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of a virtual machine from a VM scale set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getInstanceViewAsync( - String resourceGroupName, String vmScaleSetName, String instanceId) { - return getInstanceViewWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the status of a virtual machine from a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of a virtual machine from a VM scale set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineScaleSetVMInstanceViewInner getInstanceView( - String resourceGroupName, String vmScaleSetName, String instanceId) { - return getInstanceViewAsync(resourceGroupName, vmScaleSetName, instanceId).block(); - } - - /** - * Gets the status of a virtual machine from a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of a virtual machine from a VM scale set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getInstanceViewWithResponse( - String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - return getInstanceViewWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, context).block(); - } - - /** - * Gets a list of all virtual machines in a VM scale sets. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the VM scale set. - * @param filter The filter to apply to the operation. Allowed values are 'startswith(instanceView/statuses/code, - * 'PowerState') eq true', 'properties/latestModelApplied eq true', 'properties/latestModelApplied eq false'. - * @param select The list parameters. Allowed values are 'instanceView', 'instanceView/statuses'. - * @param expand The expand expression to apply to the operation. Allowed values are 'instanceView'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all virtual machines in a VM scale sets. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String virtualMachineScaleSetName, String filter, String select, String expand) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualMachineScaleSetName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualMachineScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - resourceGroupName, - virtualMachineScaleSetName, - filter, - select, - expand, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a list of all virtual machines in a VM scale sets. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the VM scale set. - * @param filter The filter to apply to the operation. Allowed values are 'startswith(instanceView/statuses/code, - * 'PowerState') eq true', 'properties/latestModelApplied eq true', 'properties/latestModelApplied eq false'. - * @param select The list parameters. Allowed values are 'instanceView', 'instanceView/statuses'. - * @param expand The expand expression to apply to the operation. Allowed values are 'instanceView'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all virtual machines in a VM scale sets. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, - String virtualMachineScaleSetName, - String filter, - String select, - String expand, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualMachineScaleSetName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualMachineScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - resourceGroupName, - virtualMachineScaleSetName, - filter, - select, - expand, - apiVersion, - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets a list of all virtual machines in a VM scale sets. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the VM scale set. - * @param filter The filter to apply to the operation. Allowed values are 'startswith(instanceView/statuses/code, - * 'PowerState') eq true', 'properties/latestModelApplied eq true', 'properties/latestModelApplied eq false'. - * @param select The list parameters. Allowed values are 'instanceView', 'instanceView/statuses'. - * @param expand The expand expression to apply to the operation. Allowed values are 'instanceView'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all virtual machines in a VM scale sets. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync( - String resourceGroupName, String virtualMachineScaleSetName, String filter, String select, String expand) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, virtualMachineScaleSetName, filter, select, expand), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets a list of all virtual machines in a VM scale sets. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all virtual machines in a VM scale sets. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync( - String resourceGroupName, String virtualMachineScaleSetName) { - final String filter = null; - final String select = null; - final String expand = null; - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, virtualMachineScaleSetName, filter, select, expand), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets a list of all virtual machines in a VM scale sets. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the VM scale set. - * @param filter The filter to apply to the operation. Allowed values are 'startswith(instanceView/statuses/code, - * 'PowerState') eq true', 'properties/latestModelApplied eq true', 'properties/latestModelApplied eq false'. - * @param select The list parameters. Allowed values are 'instanceView', 'instanceView/statuses'. - * @param expand The expand expression to apply to the operation. Allowed values are 'instanceView'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all virtual machines in a VM scale sets. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, - String virtualMachineScaleSetName, - String filter, - String select, - String expand, - Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, virtualMachineScaleSetName, filter, select, expand, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets a list of all virtual machines in a VM scale sets. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all virtual machines in a VM scale sets. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, String virtualMachineScaleSetName) { - final String filter = null; - final String select = null; - final String expand = null; - return new PagedIterable<>(listAsync(resourceGroupName, virtualMachineScaleSetName, filter, select, expand)); - } - - /** - * Gets a list of all virtual machines in a VM scale sets. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the VM scale set. - * @param filter The filter to apply to the operation. Allowed values are 'startswith(instanceView/statuses/code, - * 'PowerState') eq true', 'properties/latestModelApplied eq true', 'properties/latestModelApplied eq false'. - * @param select The list parameters. Allowed values are 'instanceView', 'instanceView/statuses'. - * @param expand The expand expression to apply to the operation. Allowed values are 'instanceView'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all virtual machines in a VM scale sets. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, - String virtualMachineScaleSetName, - String filter, - String select, - String expand, - Context context) { - return new PagedIterable<>( - listAsync(resourceGroupName, virtualMachineScaleSetName, filter, select, expand, context)); - } - - /** - * Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting - * charged for the resources. Instead, use deallocate to release resources and avoid charges. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> powerOffWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, Boolean skipShutdown) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - return FluxUtil - .withContext( - context -> - service - .powerOff( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - skipShutdown, - apiVersion, - this.client.getSubscriptionId(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting - * charged for the resources. Instead, use deallocate to release resources and avoid charges. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> powerOffWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, Boolean skipShutdown, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - context = this.client.mergeContext(context); - return service - .powerOff( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - skipShutdown, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting - * charged for the resources. Instead, use deallocate to release resources and avoid charges. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginPowerOffAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, Boolean skipShutdown) { - Mono>> mono = - powerOffWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting - * charged for the resources. Instead, use deallocate to release resources and avoid charges. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginPowerOffAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, Boolean skipShutdown, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - powerOffWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting - * charged for the resources. Instead, use deallocate to release resources and avoid charges. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginPowerOff( - String resourceGroupName, String vmScaleSetName, String instanceId, Boolean skipShutdown) { - return beginPowerOffAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown).getSyncPoller(); - } - - /** - * Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting - * charged for the resources. Instead, use deallocate to release resources and avoid charges. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginPowerOff( - String resourceGroupName, String vmScaleSetName, String instanceId, Boolean skipShutdown, Context context) { - return beginPowerOffAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown, context).getSyncPoller(); - } - - /** - * Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting - * charged for the resources. Instead, use deallocate to release resources and avoid charges. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono powerOffAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, Boolean skipShutdown) { - return beginPowerOffAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting - * charged for the resources. Instead, use deallocate to release resources and avoid charges. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono powerOffAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { - final Boolean skipShutdown = null; - return beginPowerOffAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting - * charged for the resources. Instead, use deallocate to release resources and avoid charges. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono powerOffAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, Boolean skipShutdown, Context context) { - return beginPowerOffAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting - * charged for the resources. Instead, use deallocate to release resources and avoid charges. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void powerOff(String resourceGroupName, String vmScaleSetName, String instanceId, Boolean skipShutdown) { - powerOffAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown).block(); - } - - /** - * Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting - * charged for the resources. Instead, use deallocate to release resources and avoid charges. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void powerOff(String resourceGroupName, String vmScaleSetName, String instanceId) { - final Boolean skipShutdown = null; - powerOffAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown).block(); - } - - /** - * Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting - * charged for the resources. Instead, use deallocate to release resources and avoid charges. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void powerOff( - String resourceGroupName, String vmScaleSetName, String instanceId, Boolean skipShutdown, Context context) { - powerOffAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown, context).block(); - } - - /** - * Restarts a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> restartWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - return FluxUtil - .withContext( - context -> - service - .restart( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - apiVersion, - this.client.getSubscriptionId(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Restarts a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> restartWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - context = this.client.mergeContext(context); - return service - .restart( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Restarts a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginRestartAsync( - String resourceGroupName, String vmScaleSetName, String instanceId) { - Mono>> mono = restartWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Restarts a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginRestartAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - restartWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Restarts a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginRestart( - String resourceGroupName, String vmScaleSetName, String instanceId) { - return beginRestartAsync(resourceGroupName, vmScaleSetName, instanceId).getSyncPoller(); - } - - /** - * Restarts a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginRestart( - String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - return beginRestartAsync(resourceGroupName, vmScaleSetName, instanceId, context).getSyncPoller(); - } - - /** - * Restarts a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono restartAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { - return beginRestartAsync(resourceGroupName, vmScaleSetName, instanceId) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Restarts a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono restartAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - return beginRestartAsync(resourceGroupName, vmScaleSetName, instanceId, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Restarts a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void restart(String resourceGroupName, String vmScaleSetName, String instanceId) { - restartAsync(resourceGroupName, vmScaleSetName, instanceId).block(); - } - - /** - * Restarts a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void restart(String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - restartAsync(resourceGroupName, vmScaleSetName, instanceId, context).block(); - } - - /** - * Starts a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> startWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - return FluxUtil - .withContext( - context -> - service - .start( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - apiVersion, - this.client.getSubscriptionId(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Starts a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> startWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - context = this.client.mergeContext(context); - return service - .start( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Starts a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginStartAsync( - String resourceGroupName, String vmScaleSetName, String instanceId) { - Mono>> mono = startWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Starts a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginStartAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - startWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Starts a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginStart( - String resourceGroupName, String vmScaleSetName, String instanceId) { - return beginStartAsync(resourceGroupName, vmScaleSetName, instanceId).getSyncPoller(); - } - - /** - * Starts a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginStart( - String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - return beginStartAsync(resourceGroupName, vmScaleSetName, instanceId, context).getSyncPoller(); - } - - /** - * Starts a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono startAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { - return beginStartAsync(resourceGroupName, vmScaleSetName, instanceId) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Starts a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono startAsync(String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - return beginStartAsync(resourceGroupName, vmScaleSetName, instanceId, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Starts a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void start(String resourceGroupName, String vmScaleSetName, String instanceId) { - startAsync(resourceGroupName, vmScaleSetName, instanceId).block(); - } - - /** - * Starts a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void start(String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - startAsync(resourceGroupName, vmScaleSetName, instanceId, context).block(); - } - - /** - * Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> redeployWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - return FluxUtil - .withContext( - context -> - service - .redeploy( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - apiVersion, - this.client.getSubscriptionId(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> redeployWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - context = this.client.mergeContext(context); - return service - .redeploy( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginRedeployAsync( - String resourceGroupName, String vmScaleSetName, String instanceId) { - Mono>> mono = - redeployWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginRedeployAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - redeployWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginRedeploy( - String resourceGroupName, String vmScaleSetName, String instanceId) { - return beginRedeployAsync(resourceGroupName, vmScaleSetName, instanceId).getSyncPoller(); - } - - /** - * Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginRedeploy( - String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - return beginRedeployAsync(resourceGroupName, vmScaleSetName, instanceId, context).getSyncPoller(); - } - - /** - * Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono redeployAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { - return beginRedeployAsync(resourceGroupName, vmScaleSetName, instanceId) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono redeployAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - return beginRedeployAsync(resourceGroupName, vmScaleSetName, instanceId, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void redeploy(String resourceGroupName, String vmScaleSetName, String instanceId) { - redeployAsync(resourceGroupName, vmScaleSetName, instanceId).block(); - } - - /** - * Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void redeploy(String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - redeployAsync(resourceGroupName, vmScaleSetName, instanceId, context).block(); - } - - /** - * The operation to retrieve SAS URIs of boot diagnostic logs for a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param sasUriExpirationTimeInMinutes Expiration duration in minutes for the SAS URIs with a value between 1 to - * 1440 minutes. <br><br>NOTE: If not specified, SAS URIs will be generated with a default - * expiration duration of 120 minutes. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the SAS URIs of the console screenshot and serial log blobs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> retrieveBootDiagnosticsDataWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, Integer sasUriExpirationTimeInMinutes) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .retrieveBootDiagnosticsData( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - sasUriExpirationTimeInMinutes, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * The operation to retrieve SAS URIs of boot diagnostic logs for a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param sasUriExpirationTimeInMinutes Expiration duration in minutes for the SAS URIs with a value between 1 to - * 1440 minutes. <br><br>NOTE: If not specified, SAS URIs will be generated with a default - * expiration duration of 120 minutes. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the SAS URIs of the console screenshot and serial log blobs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> retrieveBootDiagnosticsDataWithResponseAsync( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - Integer sasUriExpirationTimeInMinutes, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .retrieveBootDiagnosticsData( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - sasUriExpirationTimeInMinutes, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * The operation to retrieve SAS URIs of boot diagnostic logs for a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param sasUriExpirationTimeInMinutes Expiration duration in minutes for the SAS URIs with a value between 1 to - * 1440 minutes. <br><br>NOTE: If not specified, SAS URIs will be generated with a default - * expiration duration of 120 minutes. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the SAS URIs of the console screenshot and serial log blobs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono retrieveBootDiagnosticsDataAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, Integer sasUriExpirationTimeInMinutes) { - return retrieveBootDiagnosticsDataWithResponseAsync( - resourceGroupName, vmScaleSetName, instanceId, sasUriExpirationTimeInMinutes) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * The operation to retrieve SAS URIs of boot diagnostic logs for a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the SAS URIs of the console screenshot and serial log blobs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono retrieveBootDiagnosticsDataAsync( - String resourceGroupName, String vmScaleSetName, String instanceId) { - final Integer sasUriExpirationTimeInMinutes = null; - return retrieveBootDiagnosticsDataWithResponseAsync( - resourceGroupName, vmScaleSetName, instanceId, sasUriExpirationTimeInMinutes) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * The operation to retrieve SAS URIs of boot diagnostic logs for a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the SAS URIs of the console screenshot and serial log blobs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RetrieveBootDiagnosticsDataResultInner retrieveBootDiagnosticsData( - String resourceGroupName, String vmScaleSetName, String instanceId) { - final Integer sasUriExpirationTimeInMinutes = null; - return retrieveBootDiagnosticsDataAsync( - resourceGroupName, vmScaleSetName, instanceId, sasUriExpirationTimeInMinutes) - .block(); - } - - /** - * The operation to retrieve SAS URIs of boot diagnostic logs for a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param sasUriExpirationTimeInMinutes Expiration duration in minutes for the SAS URIs with a value between 1 to - * 1440 minutes. <br><br>NOTE: If not specified, SAS URIs will be generated with a default - * expiration duration of 120 minutes. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the SAS URIs of the console screenshot and serial log blobs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response retrieveBootDiagnosticsDataWithResponse( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - Integer sasUriExpirationTimeInMinutes, - Context context) { - return retrieveBootDiagnosticsDataWithResponseAsync( - resourceGroupName, vmScaleSetName, instanceId, sasUriExpirationTimeInMinutes, context) - .block(); - } - - /** - * Performs maintenance on a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> performMaintenanceWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - return FluxUtil - .withContext( - context -> - service - .performMaintenance( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - apiVersion, - this.client.getSubscriptionId(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Performs maintenance on a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> performMaintenanceWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - context = this.client.mergeContext(context); - return service - .performMaintenance( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Performs maintenance on a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginPerformMaintenanceAsync( - String resourceGroupName, String vmScaleSetName, String instanceId) { - Mono>> mono = - performMaintenanceWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Performs maintenance on a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginPerformMaintenanceAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - performMaintenanceWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Performs maintenance on a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginPerformMaintenance( - String resourceGroupName, String vmScaleSetName, String instanceId) { - return beginPerformMaintenanceAsync(resourceGroupName, vmScaleSetName, instanceId).getSyncPoller(); - } - - /** - * Performs maintenance on a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginPerformMaintenance( - String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - return beginPerformMaintenanceAsync(resourceGroupName, vmScaleSetName, instanceId, context).getSyncPoller(); - } - - /** - * Performs maintenance on a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono performMaintenanceAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { - return beginPerformMaintenanceAsync(resourceGroupName, vmScaleSetName, instanceId) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Performs maintenance on a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono performMaintenanceAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - return beginPerformMaintenanceAsync(resourceGroupName, vmScaleSetName, instanceId, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Performs maintenance on a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void performMaintenance(String resourceGroupName, String vmScaleSetName, String instanceId) { - performMaintenanceAsync(resourceGroupName, vmScaleSetName, instanceId).block(); - } - - /** - * Performs maintenance on a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void performMaintenance( - String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - performMaintenanceAsync(resourceGroupName, vmScaleSetName, instanceId, context).block(); - } - - /** - * The operation to simulate the eviction of spot virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> simulateEvictionWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - return FluxUtil - .withContext( - context -> - service - .simulateEviction( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - apiVersion, - this.client.getSubscriptionId(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * The operation to simulate the eviction of spot virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> simulateEvictionWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - context = this.client.mergeContext(context); - return service - .simulateEviction( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * The operation to simulate the eviction of spot virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono simulateEvictionAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { - return simulateEvictionWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * The operation to simulate the eviction of spot virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void simulateEviction(String resourceGroupName, String vmScaleSetName, String instanceId) { - simulateEvictionAsync(resourceGroupName, vmScaleSetName, instanceId).block(); - } - - /** - * The operation to simulate the eviction of spot virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response simulateEvictionWithResponse( - String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - return simulateEvictionWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, context).block(); - } - - /** - * Run command on a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param parameters Parameters supplied to the Run command operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> runCommandWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, RunCommandInput parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .runCommand( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Run command on a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param parameters Parameters supplied to the Run command operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> runCommandWithResponseAsync( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - RunCommandInput parameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .runCommand( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Run command on a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param parameters Parameters supplied to the Run command operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, RunCommandResultInner> beginRunCommandAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, RunCommandInput parameters) { - Mono>> mono = - runCommandWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - RunCommandResultInner.class, - RunCommandResultInner.class, - Context.NONE); - } - - /** - * Run command on a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param parameters Parameters supplied to the Run command operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, RunCommandResultInner> beginRunCommandAsync( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - RunCommandInput parameters, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - runCommandWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, parameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), RunCommandResultInner.class, RunCommandResultInner.class, context); - } - - /** - * Run command on a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param parameters Parameters supplied to the Run command operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, RunCommandResultInner> beginRunCommand( - String resourceGroupName, String vmScaleSetName, String instanceId, RunCommandInput parameters) { - return beginRunCommandAsync(resourceGroupName, vmScaleSetName, instanceId, parameters).getSyncPoller(); - } - - /** - * Run command on a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param parameters Parameters supplied to the Run command operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, RunCommandResultInner> beginRunCommand( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - RunCommandInput parameters, - Context context) { - return beginRunCommandAsync(resourceGroupName, vmScaleSetName, instanceId, parameters, context).getSyncPoller(); - } - - /** - * Run command on a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param parameters Parameters supplied to the Run command operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono runCommandAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, RunCommandInput parameters) { - return beginRunCommandAsync(resourceGroupName, vmScaleSetName, instanceId, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Run command on a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param parameters Parameters supplied to the Run command operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono runCommandAsync( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - RunCommandInput parameters, - Context context) { - return beginRunCommandAsync(resourceGroupName, vmScaleSetName, instanceId, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Run command on a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param parameters Parameters supplied to the Run command operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RunCommandResultInner runCommand( - String resourceGroupName, String vmScaleSetName, String instanceId, RunCommandInput parameters) { - return runCommandAsync(resourceGroupName, vmScaleSetName, instanceId, parameters).block(); - } - - /** - * Run command on a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param parameters Parameters supplied to the Run command operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RunCommandResultInner runCommand( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - RunCommandInput parameters, - Context context) { - return runCommandAsync(resourceGroupName, vmScaleSetName, instanceId, parameters, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Virtual Machine Scale Set VMs operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Virtual Machine Scale Set VMs operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineScaleSetVMsImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineScaleSetVMsImpl.java deleted file mode 100644 index f9a1edb203ea..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineScaleSetVMsImpl.java +++ /dev/null @@ -1,129 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.compute.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.compute.ComputeManager; -import com.azure.resourcemanager.compute.fluent.VirtualMachineScaleSetVMsClient; -import com.azure.resourcemanager.compute.fluent.VirtualMachineScaleSetsClient; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineScaleSetVMInner; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetVM; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetVMInstanceRequiredIDs; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetVMs; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.ReadableWrappersImpl; -import reactor.core.publisher.Mono; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.List; - -/** Implementation for {@link VirtualMachineScaleSetVMs}. */ -class VirtualMachineScaleSetVMsImpl - extends ReadableWrappersImpl - implements VirtualMachineScaleSetVMs { - - private final VirtualMachineScaleSetImpl scaleSet; - private final VirtualMachineScaleSetVMsClient client; - private final ComputeManager computeManager; - - VirtualMachineScaleSetVMsImpl( - VirtualMachineScaleSetImpl scaleSet, VirtualMachineScaleSetVMsClient client, ComputeManager computeManager) { - this.scaleSet = scaleSet; - this.client = client; - this.computeManager = computeManager; - } - - @Override - protected VirtualMachineScaleSetVMImpl wrapModel(VirtualMachineScaleSetVMInner inner) { - if (inner == null) { - return null; - } - return new VirtualMachineScaleSetVMImpl(inner, this.scaleSet, this.client, this.computeManager); - } - - @Override - public PagedIterable list() { - return super.wrapList(this.client.list(this.scaleSet.resourceGroupName(), this.scaleSet.name())); - } - - public VirtualMachineScaleSetVMsClient inner() { - return this.client; - } - - @Override - public PagedFlux listAsync() { - return super.wrapPageAsync(this.client.listAsync(this.scaleSet.resourceGroupName(), this.scaleSet.name())); - } - - @Override - public Mono deleteInstancesAsync(Collection instanceIds) { - return this.scaleSet.manager().virtualMachineScaleSets() - .deleteInstancesAsync(this.scaleSet.resourceGroupName(), this.scaleSet.name(), instanceIds); - } - - @Override - public Mono deleteInstancesAsync(String... instanceIds) { - return this.deleteInstancesAsync(new ArrayList<>(Arrays.asList(instanceIds))); - } - - @Override - public void deleteInstances(String... instanceIds) { - this.deleteInstancesAsync(instanceIds).block(); - } - - @Override - public void deleteInstances(Collection instanceIds) { - this.deleteInstancesAsync(instanceIds).block(); - } - - @Override - public VirtualMachineScaleSetVM getInstance(String instanceId) { - return this.wrapModel(client.get(this.scaleSet.resourceGroupName(), this.scaleSet.name(), instanceId)); - } - - @Override - public Mono getInstanceAsync(String instanceId) { - return this - .client - .getAsync(this.scaleSet.resourceGroupName(), this.scaleSet.name(), instanceId) - .map(this::wrapModel); - } - - @Override - public Mono updateInstancesAsync(Collection instanceIds) { - if (instanceIds == null || instanceIds.size() == 0) { - return Mono.empty(); - } - List instanceIdList = new ArrayList<>(); - for (String instanceId : instanceIds) { - instanceIdList.add(instanceId); - } - VirtualMachineScaleSetsClient scaleSetInnerManager = - this.scaleSet.manager().serviceClient().getVirtualMachineScaleSets(); - return scaleSetInnerManager - .updateInstancesAsync(this.scaleSet.resourceGroupName(), this.scaleSet.name(), - new VirtualMachineScaleSetVMInstanceRequiredIDs().withInstanceIds(instanceIdList)); - } - - @Override - public Mono updateInstancesAsync(String... instanceIds) { - return this.updateInstancesAsync(new ArrayList<>(Arrays.asList(instanceIds))); - } - - @Override - public void updateInstances(String... instanceIds) { - this.updateInstancesAsync(instanceIds).block(); - } - - @Override - public Mono simulateEvictionAsync(String instanceId) { - return this.client.simulateEvictionAsync(this.scaleSet.resourceGroupName(), this.scaleSet.name(), instanceId); - } - - @Override - public void simulateEviction(String instanceId) { - this.simulateEvictionAsync(instanceId).block(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineScaleSetsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineScaleSetsClientImpl.java deleted file mode 100644 index fce1acab146b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineScaleSetsClientImpl.java +++ /dev/null @@ -1,6226 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.compute.fluent.VirtualMachineScaleSetsClient; -import com.azure.resourcemanager.compute.fluent.models.RecoveryWalkResponseInner; -import com.azure.resourcemanager.compute.fluent.models.UpgradeOperationHistoricalStatusInfoInner; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineScaleSetInner; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineScaleSetInstanceViewInner; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineScaleSetSkuInner; -import com.azure.resourcemanager.compute.models.OrchestrationServiceStateInput; -import com.azure.resourcemanager.compute.models.VMScaleSetConvertToSinglePlacementGroupInput; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetListOSUpgradeHistory; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetListResult; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetListSkusResult; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetListWithLinkResult; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetReimageParameters; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetUpdate; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetVMInstanceIDs; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetVMInstanceRequiredIDs; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in VirtualMachineScaleSetsClient. */ -public final class VirtualMachineScaleSetsClientImpl - implements InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete, - VirtualMachineScaleSetsClient { - private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final VirtualMachineScaleSetsService service; - - /** The service client containing this operation class. */ - private final ComputeManagementClientImpl client; - - /** - * Initializes an instance of VirtualMachineScaleSetsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - VirtualMachineScaleSetsClientImpl(ComputeManagementClientImpl client) { - this.service = - RestProxy - .create(VirtualMachineScaleSetsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for ComputeManagementClientVirtualMachineScaleSets to be used by the - * proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "ComputeManagementCli") - private interface VirtualMachineScaleSetsService { - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VirtualMachineScaleSetInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VirtualMachineScaleSetUpdate parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/deallocate") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> deallocate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/delete") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> deleteInstances( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/instanceView") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getInstanceView( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachineScaleSets") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/skus") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listSkus( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/osUpgradeHistory") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getOSUpgradeHistory( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/poweroff") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> powerOff( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @QueryParam("skipShutdown") Boolean skipShutdown, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/restart") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> restart( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/start") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> start( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/redeploy") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> redeploy( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/performMaintenance") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> performMaintenance( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/manualupgrade") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> updateInstances( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/reimage") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> reimage( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/reimageall") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> reimageAll( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/forceRecoveryServiceFabricPlatformUpdateDomainWalk") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> forceRecoveryServiceFabricPlatformUpdateDomainWalk( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("platformUpdateDomain") int platformUpdateDomain, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/convertToSinglePlacementGroup") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> convertToSinglePlacementGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VMScaleSetConvertToSinglePlacementGroupInput parameters, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/setOrchestrationServiceState") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> setOrchestrationServiceState( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") OrchestrationServiceStateInput parameters, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAllNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listSkusNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getOSUpgradeHistoryNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Create or update a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set to create or update. - * @param parameters The scale set object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create or update a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set to create or update. - * @param parameters The scale set object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Create or update a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set to create or update. - * @param parameters The scale set object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, VirtualMachineScaleSetInner> beginCreateOrUpdateAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetInner parameters) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, vmScaleSetName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VirtualMachineScaleSetInner.class, - VirtualMachineScaleSetInner.class, - Context.NONE); - } - - /** - * Create or update a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set to create or update. - * @param parameters The scale set object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, VirtualMachineScaleSetInner> beginCreateOrUpdateAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetInner parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, vmScaleSetName, parameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VirtualMachineScaleSetInner.class, - VirtualMachineScaleSetInner.class, - context); - } - - /** - * Create or update a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set to create or update. - * @param parameters The scale set object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VirtualMachineScaleSetInner> beginCreateOrUpdate( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, vmScaleSetName, parameters).getSyncPoller(); - } - - /** - * Create or update a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set to create or update. - * @param parameters The scale set object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VirtualMachineScaleSetInner> beginCreateOrUpdate( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, vmScaleSetName, parameters, context).getSyncPoller(); - } - - /** - * Create or update a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set to create or update. - * @param parameters The scale set object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, vmScaleSetName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create or update a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set to create or update. - * @param parameters The scale set object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, vmScaleSetName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create or update a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set to create or update. - * @param parameters The scale set object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineScaleSetInner createOrUpdate( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetInner parameters) { - return createOrUpdateAsync(resourceGroupName, vmScaleSetName, parameters).block(); - } - - /** - * Create or update a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set to create or update. - * @param parameters The scale set object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineScaleSetInner createOrUpdate( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetInner parameters, Context context) { - return createOrUpdateAsync(resourceGroupName, vmScaleSetName, parameters, context).block(); - } - - /** - * Update a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set to create or update. - * @param parameters The scale set object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateWithResponseAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdate parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Update a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set to create or update. - * @param parameters The scale set object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdate parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Update a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set to create or update. - * @param parameters The scale set object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, VirtualMachineScaleSetInner> beginUpdateAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdate parameters) { - Mono>> mono = updateWithResponseAsync(resourceGroupName, vmScaleSetName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VirtualMachineScaleSetInner.class, - VirtualMachineScaleSetInner.class, - Context.NONE); - } - - /** - * Update a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set to create or update. - * @param parameters The scale set object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, VirtualMachineScaleSetInner> beginUpdateAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdate parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - updateWithResponseAsync(resourceGroupName, vmScaleSetName, parameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VirtualMachineScaleSetInner.class, - VirtualMachineScaleSetInner.class, - context); - } - - /** - * Update a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set to create or update. - * @param parameters The scale set object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VirtualMachineScaleSetInner> beginUpdate( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdate parameters) { - return beginUpdateAsync(resourceGroupName, vmScaleSetName, parameters).getSyncPoller(); - } - - /** - * Update a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set to create or update. - * @param parameters The scale set object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VirtualMachineScaleSetInner> beginUpdate( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdate parameters, Context context) { - return beginUpdateAsync(resourceGroupName, vmScaleSetName, parameters, context).getSyncPoller(); - } - - /** - * Update a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set to create or update. - * @param parameters The scale set object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdate parameters) { - return beginUpdateAsync(resourceGroupName, vmScaleSetName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Update a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set to create or update. - * @param parameters The scale set object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdate parameters, Context context) { - return beginUpdateAsync(resourceGroupName, vmScaleSetName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Update a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set to create or update. - * @param parameters The scale set object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineScaleSetInner update( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdate parameters) { - return updateAsync(resourceGroupName, vmScaleSetName, parameters).block(); - } - - /** - * Update a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set to create or update. - * @param parameters The scale set object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineScaleSetInner update( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdate parameters, Context context) { - return updateAsync(resourceGroupName, vmScaleSetName, parameters, context).block(); - } - - /** - * Deletes a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync(String resourceGroupName, String vmScaleSetName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String vmScaleSetName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Deletes a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String vmScaleSetName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, vmScaleSetName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deletes a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String vmScaleSetName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(resourceGroupName, vmScaleSetName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete(String resourceGroupName, String vmScaleSetName) { - return beginDeleteAsync(resourceGroupName, vmScaleSetName).getSyncPoller(); - } - - /** - * Deletes a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String vmScaleSetName, Context context) { - return beginDeleteAsync(resourceGroupName, vmScaleSetName, context).getSyncPoller(); - } - - /** - * Deletes a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String vmScaleSetName) { - return beginDeleteAsync(resourceGroupName, vmScaleSetName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String vmScaleSetName, Context context) { - return beginDeleteAsync(resourceGroupName, vmScaleSetName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String vmScaleSetName) { - deleteAsync(resourceGroupName, vmScaleSetName).block(); - } - - /** - * Deletes a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String vmScaleSetName, Context context) { - deleteAsync(resourceGroupName, vmScaleSetName, context).block(); - } - - /** - * Display information about a virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String vmScaleSetName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Display information about a virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String vmScaleSetName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Display information about a virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync(String resourceGroupName, String vmScaleSetName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, vmScaleSetName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Display information about a virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineScaleSetInner getByResourceGroup(String resourceGroupName, String vmScaleSetName) { - return getByResourceGroupAsync(resourceGroupName, vmScaleSetName).block(); - } - - /** - * Display information about a virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String vmScaleSetName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, vmScaleSetName, context).block(); - } - - /** - * Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute - * resources. You are not billed for the compute resources that this virtual machine scale set deallocates. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deallocateWithResponseAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (vmInstanceIDs != null) { - vmInstanceIDs.validate(); - } - final String apiVersion = "2020-06-01"; - return FluxUtil - .withContext( - context -> - service - .deallocate( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - vmInstanceIDs, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute - * resources. You are not billed for the compute resources that this virtual machine scale set deallocates. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deallocateWithResponseAsync( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (vmInstanceIDs != null) { - vmInstanceIDs.validate(); - } - final String apiVersion = "2020-06-01"; - context = this.client.mergeContext(context); - return service - .deallocate( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - vmInstanceIDs, - context); - } - - /** - * Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute - * resources. You are not billed for the compute resources that this virtual machine scale set deallocates. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeallocateAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { - Mono>> mono = - deallocateWithResponseAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute - * resources. You are not billed for the compute resources that this virtual machine scale set deallocates. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeallocateAsync( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - deallocateWithResponseAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute - * resources. You are not billed for the compute resources that this virtual machine scale set deallocates. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDeallocate( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { - return beginDeallocateAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs).getSyncPoller(); - } - - /** - * Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute - * resources. You are not billed for the compute resources that this virtual machine scale set deallocates. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDeallocate( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, - Context context) { - return beginDeallocateAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs, context).getSyncPoller(); - } - - /** - * Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute - * resources. You are not billed for the compute resources that this virtual machine scale set deallocates. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deallocateAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { - return beginDeallocateAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute - * resources. You are not billed for the compute resources that this virtual machine scale set deallocates. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deallocateAsync(String resourceGroupName, String vmScaleSetName) { - final VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; - return beginDeallocateAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute - * resources. You are not billed for the compute resources that this virtual machine scale set deallocates. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deallocateAsync( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, - Context context) { - return beginDeallocateAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute - * resources. You are not billed for the compute resources that this virtual machine scale set deallocates. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deallocate( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { - deallocateAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs).block(); - } - - /** - * Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute - * resources. You are not billed for the compute resources that this virtual machine scale set deallocates. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deallocate(String resourceGroupName, String vmScaleSetName) { - final VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; - deallocateAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs).block(); - } - - /** - * Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute - * resources. You are not billed for the compute resources that this virtual machine scale set deallocates. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deallocate( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, - Context context) { - deallocateAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs, context).block(); - } - - /** - * Deletes virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteInstancesWithResponseAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (vmInstanceIDs == null) { - return Mono.error(new IllegalArgumentException("Parameter vmInstanceIDs is required and cannot be null.")); - } else { - vmInstanceIDs.validate(); - } - final String apiVersion = "2020-06-01"; - return FluxUtil - .withContext( - context -> - service - .deleteInstances( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - vmInstanceIDs, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteInstancesWithResponseAsync( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (vmInstanceIDs == null) { - return Mono.error(new IllegalArgumentException("Parameter vmInstanceIDs is required and cannot be null.")); - } else { - vmInstanceIDs.validate(); - } - final String apiVersion = "2020-06-01"; - context = this.client.mergeContext(context); - return service - .deleteInstances( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - vmInstanceIDs, - context); - } - - /** - * Deletes virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteInstancesAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs) { - Mono>> mono = - deleteInstancesWithResponseAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deletes virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteInstancesAsync( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - deleteInstancesWithResponseAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDeleteInstances( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs) { - return beginDeleteInstancesAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs).getSyncPoller(); - } - - /** - * Deletes virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDeleteInstances( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs, - Context context) { - return beginDeleteInstancesAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs, context).getSyncPoller(); - } - - /** - * Deletes virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteInstancesAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs) { - return beginDeleteInstancesAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteInstancesAsync( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs, - Context context) { - return beginDeleteInstancesAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteInstances( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs) { - deleteInstancesAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs).block(); - } - - /** - * Deletes virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteInstances( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs, - Context context) { - deleteInstancesAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs, context).block(); - } - - /** - * Gets the status of a VM scale set instance. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of a VM scale set instance. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getInstanceViewWithResponseAsync( - String resourceGroupName, String vmScaleSetName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getInstanceView( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the status of a VM scale set instance. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of a VM scale set instance. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getInstanceViewWithResponseAsync( - String resourceGroupName, String vmScaleSetName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getInstanceView( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets the status of a VM scale set instance. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of a VM scale set instance. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getInstanceViewAsync( - String resourceGroupName, String vmScaleSetName) { - return getInstanceViewWithResponseAsync(resourceGroupName, vmScaleSetName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the status of a VM scale set instance. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of a VM scale set instance. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineScaleSetInstanceViewInner getInstanceView(String resourceGroupName, String vmScaleSetName) { - return getInstanceViewAsync(resourceGroupName, vmScaleSetName).block(); - } - - /** - * Gets the status of a VM scale set instance. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of a VM scale set instance. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getInstanceViewWithResponse( - String resourceGroupName, String vmScaleSetName, Context context) { - return getInstanceViewWithResponseAsync(resourceGroupName, vmScaleSetName, context).block(); - } - - /** - * Gets a list of all VM scale sets under a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all VM scale sets under a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a list of all VM scale sets under a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all VM scale sets under a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets a list of all VM scale sets under a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all VM scale sets under a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets a list of all VM scale sets under a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all VM scale sets under a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets a list of all VM scale sets under a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all VM scale sets under a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * Gets a list of all VM scale sets under a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all VM scale sets under a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink - * property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM - * Scale Sets. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all VM Scale Sets in the subscription, regardless of the associated resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink - * property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM - * Scale Sets. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all VM Scale Sets in the subscription, regardless of the associated resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink - * property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM - * Scale Sets. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all VM Scale Sets in the subscription, regardless of the associated resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listAllNextSinglePageAsync(nextLink)); - } - - /** - * Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink - * property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM - * Scale Sets. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all VM Scale Sets in the subscription, regardless of the associated resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listAllNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink - * property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM - * Scale Sets. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all VM Scale Sets in the subscription, regardless of the associated resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink - * property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM - * Scale Sets. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all VM Scale Sets in the subscription, regardless of the associated resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for - * each SKU. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed - * for each SKU. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSkusSinglePageAsync( - String resourceGroupName, String vmScaleSetName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listSkus( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for - * each SKU. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed - * for each SKU. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSkusSinglePageAsync( - String resourceGroupName, String vmScaleSetName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listSkus( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for - * each SKU. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed - * for each SKU. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listSkusAsync(String resourceGroupName, String vmScaleSetName) { - return new PagedFlux<>( - () -> listSkusSinglePageAsync(resourceGroupName, vmScaleSetName), - nextLink -> listSkusNextSinglePageAsync(nextLink)); - } - - /** - * Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for - * each SKU. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed - * for each SKU. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listSkusAsync( - String resourceGroupName, String vmScaleSetName, Context context) { - return new PagedFlux<>( - () -> listSkusSinglePageAsync(resourceGroupName, vmScaleSetName, context), - nextLink -> listSkusNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for - * each SKU. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed - * for each SKU. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listSkus(String resourceGroupName, String vmScaleSetName) { - return new PagedIterable<>(listSkusAsync(resourceGroupName, vmScaleSetName)); - } - - /** - * Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for - * each SKU. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed - * for each SKU. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listSkus( - String resourceGroupName, String vmScaleSetName, Context context) { - return new PagedIterable<>(listSkusAsync(resourceGroupName, vmScaleSetName, context)); - } - - /** - * Gets list of OS upgrades on a VM scale set instance. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of OS upgrades on a VM scale set instance. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getOSUpgradeHistorySinglePageAsync( - String resourceGroupName, String vmScaleSetName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getOSUpgradeHistory( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets list of OS upgrades on a VM scale set instance. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of OS upgrades on a VM scale set instance. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getOSUpgradeHistorySinglePageAsync( - String resourceGroupName, String vmScaleSetName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getOSUpgradeHistory( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets list of OS upgrades on a VM scale set instance. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of OS upgrades on a VM scale set instance. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux getOSUpgradeHistoryAsync( - String resourceGroupName, String vmScaleSetName) { - return new PagedFlux<>( - () -> getOSUpgradeHistorySinglePageAsync(resourceGroupName, vmScaleSetName), - nextLink -> getOSUpgradeHistoryNextSinglePageAsync(nextLink)); - } - - /** - * Gets list of OS upgrades on a VM scale set instance. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of OS upgrades on a VM scale set instance. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux getOSUpgradeHistoryAsync( - String resourceGroupName, String vmScaleSetName, Context context) { - return new PagedFlux<>( - () -> getOSUpgradeHistorySinglePageAsync(resourceGroupName, vmScaleSetName, context), - nextLink -> getOSUpgradeHistoryNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets list of OS upgrades on a VM scale set instance. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of OS upgrades on a VM scale set instance. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable getOSUpgradeHistory( - String resourceGroupName, String vmScaleSetName) { - return new PagedIterable<>(getOSUpgradeHistoryAsync(resourceGroupName, vmScaleSetName)); - } - - /** - * Gets list of OS upgrades on a VM scale set instance. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of OS upgrades on a VM scale set instance. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable getOSUpgradeHistory( - String resourceGroupName, String vmScaleSetName, Context context) { - return new PagedIterable<>(getOSUpgradeHistoryAsync(resourceGroupName, vmScaleSetName, context)); - } - - /** - * Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you - * are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> powerOffWithResponseAsync( - String resourceGroupName, - String vmScaleSetName, - Boolean skipShutdown, - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (vmInstanceIDs != null) { - vmInstanceIDs.validate(); - } - final String apiVersion = "2020-06-01"; - return FluxUtil - .withContext( - context -> - service - .powerOff( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - skipShutdown, - apiVersion, - this.client.getSubscriptionId(), - vmInstanceIDs, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you - * are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> powerOffWithResponseAsync( - String resourceGroupName, - String vmScaleSetName, - Boolean skipShutdown, - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (vmInstanceIDs != null) { - vmInstanceIDs.validate(); - } - final String apiVersion = "2020-06-01"; - context = this.client.mergeContext(context); - return service - .powerOff( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - skipShutdown, - apiVersion, - this.client.getSubscriptionId(), - vmInstanceIDs, - context); - } - - /** - * Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you - * are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginPowerOffAsync( - String resourceGroupName, - String vmScaleSetName, - Boolean skipShutdown, - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { - Mono>> mono = - powerOffWithResponseAsync(resourceGroupName, vmScaleSetName, skipShutdown, vmInstanceIDs); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you - * are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginPowerOffAsync( - String resourceGroupName, - String vmScaleSetName, - Boolean skipShutdown, - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - powerOffWithResponseAsync(resourceGroupName, vmScaleSetName, skipShutdown, vmInstanceIDs, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you - * are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginPowerOff( - String resourceGroupName, - String vmScaleSetName, - Boolean skipShutdown, - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { - return beginPowerOffAsync(resourceGroupName, vmScaleSetName, skipShutdown, vmInstanceIDs).getSyncPoller(); - } - - /** - * Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you - * are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginPowerOff( - String resourceGroupName, - String vmScaleSetName, - Boolean skipShutdown, - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, - Context context) { - return beginPowerOffAsync(resourceGroupName, vmScaleSetName, skipShutdown, vmInstanceIDs, context) - .getSyncPoller(); - } - - /** - * Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you - * are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono powerOffAsync( - String resourceGroupName, - String vmScaleSetName, - Boolean skipShutdown, - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { - return beginPowerOffAsync(resourceGroupName, vmScaleSetName, skipShutdown, vmInstanceIDs) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you - * are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono powerOffAsync(String resourceGroupName, String vmScaleSetName) { - final Boolean skipShutdown = null; - final VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; - return beginPowerOffAsync(resourceGroupName, vmScaleSetName, skipShutdown, vmInstanceIDs) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you - * are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono powerOffAsync( - String resourceGroupName, - String vmScaleSetName, - Boolean skipShutdown, - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, - Context context) { - return beginPowerOffAsync(resourceGroupName, vmScaleSetName, skipShutdown, vmInstanceIDs, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you - * are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void powerOff( - String resourceGroupName, - String vmScaleSetName, - Boolean skipShutdown, - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { - powerOffAsync(resourceGroupName, vmScaleSetName, skipShutdown, vmInstanceIDs).block(); - } - - /** - * Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you - * are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void powerOff(String resourceGroupName, String vmScaleSetName) { - final Boolean skipShutdown = null; - final VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; - powerOffAsync(resourceGroupName, vmScaleSetName, skipShutdown, vmInstanceIDs).block(); - } - - /** - * Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you - * are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void powerOff( - String resourceGroupName, - String vmScaleSetName, - Boolean skipShutdown, - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, - Context context) { - powerOffAsync(resourceGroupName, vmScaleSetName, skipShutdown, vmInstanceIDs, context).block(); - } - - /** - * Restarts one or more virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> restartWithResponseAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (vmInstanceIDs != null) { - vmInstanceIDs.validate(); - } - final String apiVersion = "2020-06-01"; - return FluxUtil - .withContext( - context -> - service - .restart( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - vmInstanceIDs, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Restarts one or more virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> restartWithResponseAsync( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (vmInstanceIDs != null) { - vmInstanceIDs.validate(); - } - final String apiVersion = "2020-06-01"; - context = this.client.mergeContext(context); - return service - .restart( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - vmInstanceIDs, - context); - } - - /** - * Restarts one or more virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginRestartAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { - Mono>> mono = - restartWithResponseAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Restarts one or more virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginRestartAsync( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - restartWithResponseAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Restarts one or more virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginRestart( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { - return beginRestartAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs).getSyncPoller(); - } - - /** - * Restarts one or more virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginRestart( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, - Context context) { - return beginRestartAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs, context).getSyncPoller(); - } - - /** - * Restarts one or more virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono restartAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { - return beginRestartAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Restarts one or more virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono restartAsync(String resourceGroupName, String vmScaleSetName) { - final VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; - return beginRestartAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Restarts one or more virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono restartAsync( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, - Context context) { - return beginRestartAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Restarts one or more virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void restart( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { - restartAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs).block(); - } - - /** - * Restarts one or more virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void restart(String resourceGroupName, String vmScaleSetName) { - final VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; - restartAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs).block(); - } - - /** - * Restarts one or more virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void restart( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, - Context context) { - restartAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs, context).block(); - } - - /** - * Starts one or more virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> startWithResponseAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (vmInstanceIDs != null) { - vmInstanceIDs.validate(); - } - final String apiVersion = "2020-06-01"; - return FluxUtil - .withContext( - context -> - service - .start( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - vmInstanceIDs, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Starts one or more virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> startWithResponseAsync( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (vmInstanceIDs != null) { - vmInstanceIDs.validate(); - } - final String apiVersion = "2020-06-01"; - context = this.client.mergeContext(context); - return service - .start( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - vmInstanceIDs, - context); - } - - /** - * Starts one or more virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginStartAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { - Mono>> mono = - startWithResponseAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Starts one or more virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginStartAsync( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - startWithResponseAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Starts one or more virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginStart( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { - return beginStartAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs).getSyncPoller(); - } - - /** - * Starts one or more virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginStart( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, - Context context) { - return beginStartAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs, context).getSyncPoller(); - } - - /** - * Starts one or more virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono startAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { - return beginStartAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Starts one or more virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono startAsync(String resourceGroupName, String vmScaleSetName) { - final VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; - return beginStartAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Starts one or more virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono startAsync( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, - Context context) { - return beginStartAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Starts one or more virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void start( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { - startAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs).block(); - } - - /** - * Starts one or more virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void start(String resourceGroupName, String vmScaleSetName) { - final VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; - startAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs).block(); - } - - /** - * Starts one or more virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void start( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, - Context context) { - startAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs, context).block(); - } - - /** - * Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them - * back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> redeployWithResponseAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (vmInstanceIDs != null) { - vmInstanceIDs.validate(); - } - final String apiVersion = "2020-06-01"; - return FluxUtil - .withContext( - context -> - service - .redeploy( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - vmInstanceIDs, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them - * back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> redeployWithResponseAsync( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (vmInstanceIDs != null) { - vmInstanceIDs.validate(); - } - final String apiVersion = "2020-06-01"; - context = this.client.mergeContext(context); - return service - .redeploy( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - vmInstanceIDs, - context); - } - - /** - * Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them - * back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginRedeployAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { - Mono>> mono = - redeployWithResponseAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them - * back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginRedeployAsync( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - redeployWithResponseAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them - * back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginRedeploy( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { - return beginRedeployAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs).getSyncPoller(); - } - - /** - * Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them - * back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginRedeploy( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, - Context context) { - return beginRedeployAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs, context).getSyncPoller(); - } - - /** - * Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them - * back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono redeployAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { - return beginRedeployAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them - * back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono redeployAsync(String resourceGroupName, String vmScaleSetName) { - final VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; - return beginRedeployAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them - * back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono redeployAsync( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, - Context context) { - return beginRedeployAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them - * back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void redeploy( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { - redeployAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs).block(); - } - - /** - * Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them - * back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void redeploy(String resourceGroupName, String vmScaleSetName) { - final VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; - redeployAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs).block(); - } - - /** - * Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them - * back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void redeploy( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, - Context context) { - redeployAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs, context).block(); - } - - /** - * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not - * eligible for perform maintenance will be failed. Please refer to best practices for more details: - * https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> performMaintenanceWithResponseAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (vmInstanceIDs != null) { - vmInstanceIDs.validate(); - } - final String apiVersion = "2020-06-01"; - return FluxUtil - .withContext( - context -> - service - .performMaintenance( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - vmInstanceIDs, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not - * eligible for perform maintenance will be failed. Please refer to best practices for more details: - * https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> performMaintenanceWithResponseAsync( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (vmInstanceIDs != null) { - vmInstanceIDs.validate(); - } - final String apiVersion = "2020-06-01"; - context = this.client.mergeContext(context); - return service - .performMaintenance( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - vmInstanceIDs, - context); - } - - /** - * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not - * eligible for perform maintenance will be failed. Please refer to best practices for more details: - * https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginPerformMaintenanceAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { - Mono>> mono = - performMaintenanceWithResponseAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not - * eligible for perform maintenance will be failed. Please refer to best practices for more details: - * https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginPerformMaintenanceAsync( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - performMaintenanceWithResponseAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not - * eligible for perform maintenance will be failed. Please refer to best practices for more details: - * https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginPerformMaintenance( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { - return beginPerformMaintenanceAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs).getSyncPoller(); - } - - /** - * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not - * eligible for perform maintenance will be failed. Please refer to best practices for more details: - * https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginPerformMaintenance( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, - Context context) { - return beginPerformMaintenanceAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs, context).getSyncPoller(); - } - - /** - * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not - * eligible for perform maintenance will be failed. Please refer to best practices for more details: - * https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono performMaintenanceAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { - return beginPerformMaintenanceAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not - * eligible for perform maintenance will be failed. Please refer to best practices for more details: - * https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono performMaintenanceAsync(String resourceGroupName, String vmScaleSetName) { - final VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; - return beginPerformMaintenanceAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not - * eligible for perform maintenance will be failed. Please refer to best practices for more details: - * https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono performMaintenanceAsync( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, - Context context) { - return beginPerformMaintenanceAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not - * eligible for perform maintenance will be failed. Please refer to best practices for more details: - * https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void performMaintenance( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { - performMaintenanceAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs).block(); - } - - /** - * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not - * eligible for perform maintenance will be failed. Please refer to best practices for more details: - * https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void performMaintenance(String resourceGroupName, String vmScaleSetName) { - final VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; - performMaintenanceAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs).block(); - } - - /** - * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not - * eligible for perform maintenance will be failed. Please refer to best practices for more details: - * https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void performMaintenance( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, - Context context) { - performMaintenanceAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs, context).block(); - } - - /** - * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateInstancesWithResponseAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (vmInstanceIDs == null) { - return Mono.error(new IllegalArgumentException("Parameter vmInstanceIDs is required and cannot be null.")); - } else { - vmInstanceIDs.validate(); - } - final String apiVersion = "2020-06-01"; - return FluxUtil - .withContext( - context -> - service - .updateInstances( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - vmInstanceIDs, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateInstancesWithResponseAsync( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (vmInstanceIDs == null) { - return Mono.error(new IllegalArgumentException("Parameter vmInstanceIDs is required and cannot be null.")); - } else { - vmInstanceIDs.validate(); - } - final String apiVersion = "2020-06-01"; - context = this.client.mergeContext(context); - return service - .updateInstances( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - vmInstanceIDs, - context); - } - - /** - * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginUpdateInstancesAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs) { - Mono>> mono = - updateInstancesWithResponseAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginUpdateInstancesAsync( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - updateInstancesWithResponseAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginUpdateInstances( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs) { - return beginUpdateInstancesAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs).getSyncPoller(); - } - - /** - * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginUpdateInstances( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs, - Context context) { - return beginUpdateInstancesAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs, context).getSyncPoller(); - } - - /** - * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateInstancesAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs) { - return beginUpdateInstancesAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateInstancesAsync( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs, - Context context) { - return beginUpdateInstancesAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void updateInstances( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs) { - updateInstancesAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs).block(); - } - - /** - * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void updateInstances( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs, - Context context) { - updateInstancesAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs, context).block(); - } - - /** - * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a - * ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial - * state. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmScaleSetReimageInput Parameters for Reimaging VM ScaleSet. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> reimageWithResponseAsync( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (vmScaleSetReimageInput != null) { - vmScaleSetReimageInput.validate(); - } - final String apiVersion = "2020-06-01"; - return FluxUtil - .withContext( - context -> - service - .reimage( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - vmScaleSetReimageInput, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a - * ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial - * state. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmScaleSetReimageInput Parameters for Reimaging VM ScaleSet. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> reimageWithResponseAsync( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (vmScaleSetReimageInput != null) { - vmScaleSetReimageInput.validate(); - } - final String apiVersion = "2020-06-01"; - context = this.client.mergeContext(context); - return service - .reimage( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - vmScaleSetReimageInput, - context); - } - - /** - * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a - * ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial - * state. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmScaleSetReimageInput Parameters for Reimaging VM ScaleSet. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginReimageAsync( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput) { - Mono>> mono = - reimageWithResponseAsync(resourceGroupName, vmScaleSetName, vmScaleSetReimageInput); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a - * ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial - * state. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmScaleSetReimageInput Parameters for Reimaging VM ScaleSet. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginReimageAsync( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - reimageWithResponseAsync(resourceGroupName, vmScaleSetName, vmScaleSetReimageInput, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a - * ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial - * state. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmScaleSetReimageInput Parameters for Reimaging VM ScaleSet. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginReimage( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput) { - return beginReimageAsync(resourceGroupName, vmScaleSetName, vmScaleSetReimageInput).getSyncPoller(); - } - - /** - * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a - * ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial - * state. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmScaleSetReimageInput Parameters for Reimaging VM ScaleSet. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginReimage( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput, - Context context) { - return beginReimageAsync(resourceGroupName, vmScaleSetName, vmScaleSetReimageInput, context).getSyncPoller(); - } - - /** - * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a - * ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial - * state. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmScaleSetReimageInput Parameters for Reimaging VM ScaleSet. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono reimageAsync( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput) { - return beginReimageAsync(resourceGroupName, vmScaleSetName, vmScaleSetReimageInput) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a - * ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial - * state. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono reimageAsync(String resourceGroupName, String vmScaleSetName) { - final VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput = null; - return beginReimageAsync(resourceGroupName, vmScaleSetName, vmScaleSetReimageInput) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a - * ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial - * state. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmScaleSetReimageInput Parameters for Reimaging VM ScaleSet. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono reimageAsync( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput, - Context context) { - return beginReimageAsync(resourceGroupName, vmScaleSetName, vmScaleSetReimageInput, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a - * ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial - * state. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmScaleSetReimageInput Parameters for Reimaging VM ScaleSet. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void reimage( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput) { - reimageAsync(resourceGroupName, vmScaleSetName, vmScaleSetReimageInput).block(); - } - - /** - * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a - * ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial - * state. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void reimage(String resourceGroupName, String vmScaleSetName) { - final VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput = null; - reimageAsync(resourceGroupName, vmScaleSetName, vmScaleSetReimageInput).block(); - } - - /** - * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a - * ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial - * state. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmScaleSetReimageInput Parameters for Reimaging VM ScaleSet. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void reimage( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput, - Context context) { - reimageAsync(resourceGroupName, vmScaleSetName, vmScaleSetReimageInput, context).block(); - } - - /** - * Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only - * supported for managed disks. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> reimageAllWithResponseAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (vmInstanceIDs != null) { - vmInstanceIDs.validate(); - } - final String apiVersion = "2020-06-01"; - return FluxUtil - .withContext( - context -> - service - .reimageAll( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - vmInstanceIDs, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only - * supported for managed disks. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> reimageAllWithResponseAsync( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (vmInstanceIDs != null) { - vmInstanceIDs.validate(); - } - final String apiVersion = "2020-06-01"; - context = this.client.mergeContext(context); - return service - .reimageAll( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - vmInstanceIDs, - context); - } - - /** - * Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only - * supported for managed disks. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginReimageAllAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { - Mono>> mono = - reimageAllWithResponseAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only - * supported for managed disks. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginReimageAllAsync( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - reimageAllWithResponseAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only - * supported for managed disks. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginReimageAll( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { - return beginReimageAllAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs).getSyncPoller(); - } - - /** - * Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only - * supported for managed disks. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginReimageAll( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, - Context context) { - return beginReimageAllAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs, context).getSyncPoller(); - } - - /** - * Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only - * supported for managed disks. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono reimageAllAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { - return beginReimageAllAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only - * supported for managed disks. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono reimageAllAsync(String resourceGroupName, String vmScaleSetName) { - final VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; - return beginReimageAllAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only - * supported for managed disks. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono reimageAllAsync( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, - Context context) { - return beginReimageAllAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only - * supported for managed disks. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void reimageAll( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { - reimageAllAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs).block(); - } - - /** - * Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only - * supported for managed disks. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void reimageAll(String resourceGroupName, String vmScaleSetName) { - final VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; - reimageAllAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs).block(); - } - - /** - * Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only - * supported for managed disks. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void reimageAll( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, - Context context) { - reimageAllAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs, context).block(); - } - - /** - * Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param platformUpdateDomain The platform update domain for which a manual recovery walk is requested. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response after calling a manual recovery walk. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> - forceRecoveryServiceFabricPlatformUpdateDomainWalkWithResponseAsync( - String resourceGroupName, String vmScaleSetName, int platformUpdateDomain) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .forceRecoveryServiceFabricPlatformUpdateDomainWalk( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - platformUpdateDomain, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param platformUpdateDomain The platform update domain for which a manual recovery walk is requested. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response after calling a manual recovery walk. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - forceRecoveryServiceFabricPlatformUpdateDomainWalkWithResponseAsync( - String resourceGroupName, String vmScaleSetName, int platformUpdateDomain, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .forceRecoveryServiceFabricPlatformUpdateDomainWalk( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - platformUpdateDomain, - accept, - context); - } - - /** - * Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param platformUpdateDomain The platform update domain for which a manual recovery walk is requested. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response after calling a manual recovery walk. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono forceRecoveryServiceFabricPlatformUpdateDomainWalkAsync( - String resourceGroupName, String vmScaleSetName, int platformUpdateDomain) { - return forceRecoveryServiceFabricPlatformUpdateDomainWalkWithResponseAsync( - resourceGroupName, vmScaleSetName, platformUpdateDomain) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param platformUpdateDomain The platform update domain for which a manual recovery walk is requested. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response after calling a manual recovery walk. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RecoveryWalkResponseInner forceRecoveryServiceFabricPlatformUpdateDomainWalk( - String resourceGroupName, String vmScaleSetName, int platformUpdateDomain) { - return forceRecoveryServiceFabricPlatformUpdateDomainWalkAsync( - resourceGroupName, vmScaleSetName, platformUpdateDomain) - .block(); - } - - /** - * Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param platformUpdateDomain The platform update domain for which a manual recovery walk is requested. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response after calling a manual recovery walk. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response forceRecoveryServiceFabricPlatformUpdateDomainWalkWithResponse( - String resourceGroupName, String vmScaleSetName, int platformUpdateDomain, Context context) { - return forceRecoveryServiceFabricPlatformUpdateDomainWalkWithResponseAsync( - resourceGroupName, vmScaleSetName, platformUpdateDomain, context) - .block(); - } - - /** - * Converts SinglePlacementGroup property to false for a existing virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the virtual machine scale set to create or update. - * @param parameters The input object for ConvertToSinglePlacementGroup API. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> convertToSinglePlacementGroupWithResponseAsync( - String resourceGroupName, String vmScaleSetName, VMScaleSetConvertToSinglePlacementGroupInput parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-06-01"; - return FluxUtil - .withContext( - context -> - service - .convertToSinglePlacementGroup( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Converts SinglePlacementGroup property to false for a existing virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the virtual machine scale set to create or update. - * @param parameters The input object for ConvertToSinglePlacementGroup API. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> convertToSinglePlacementGroupWithResponseAsync( - String resourceGroupName, - String vmScaleSetName, - VMScaleSetConvertToSinglePlacementGroupInput parameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-06-01"; - context = this.client.mergeContext(context); - return service - .convertToSinglePlacementGroup( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - context); - } - - /** - * Converts SinglePlacementGroup property to false for a existing virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the virtual machine scale set to create or update. - * @param parameters The input object for ConvertToSinglePlacementGroup API. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono convertToSinglePlacementGroupAsync( - String resourceGroupName, String vmScaleSetName, VMScaleSetConvertToSinglePlacementGroupInput parameters) { - return convertToSinglePlacementGroupWithResponseAsync(resourceGroupName, vmScaleSetName, parameters) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Converts SinglePlacementGroup property to false for a existing virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the virtual machine scale set to create or update. - * @param parameters The input object for ConvertToSinglePlacementGroup API. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void convertToSinglePlacementGroup( - String resourceGroupName, String vmScaleSetName, VMScaleSetConvertToSinglePlacementGroupInput parameters) { - convertToSinglePlacementGroupAsync(resourceGroupName, vmScaleSetName, parameters).block(); - } - - /** - * Converts SinglePlacementGroup property to false for a existing virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the virtual machine scale set to create or update. - * @param parameters The input object for ConvertToSinglePlacementGroup API. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response convertToSinglePlacementGroupWithResponse( - String resourceGroupName, - String vmScaleSetName, - VMScaleSetConvertToSinglePlacementGroupInput parameters, - Context context) { - return convertToSinglePlacementGroupWithResponseAsync(resourceGroupName, vmScaleSetName, parameters, context) - .block(); - } - - /** - * Changes ServiceState property for a given service. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the virtual machine scale set to create or update. - * @param parameters The input object for SetOrchestrationServiceState API. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> setOrchestrationServiceStateWithResponseAsync( - String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateInput parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-06-01"; - return FluxUtil - .withContext( - context -> - service - .setOrchestrationServiceState( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Changes ServiceState property for a given service. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the virtual machine scale set to create or update. - * @param parameters The input object for SetOrchestrationServiceState API. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> setOrchestrationServiceStateWithResponseAsync( - String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateInput parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-06-01"; - context = this.client.mergeContext(context); - return service - .setOrchestrationServiceState( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - context); - } - - /** - * Changes ServiceState property for a given service. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the virtual machine scale set to create or update. - * @param parameters The input object for SetOrchestrationServiceState API. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginSetOrchestrationServiceStateAsync( - String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateInput parameters) { - Mono>> mono = - setOrchestrationServiceStateWithResponseAsync(resourceGroupName, vmScaleSetName, parameters); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Changes ServiceState property for a given service. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the virtual machine scale set to create or update. - * @param parameters The input object for SetOrchestrationServiceState API. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginSetOrchestrationServiceStateAsync( - String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateInput parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - setOrchestrationServiceStateWithResponseAsync(resourceGroupName, vmScaleSetName, parameters, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Changes ServiceState property for a given service. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the virtual machine scale set to create or update. - * @param parameters The input object for SetOrchestrationServiceState API. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginSetOrchestrationServiceState( - String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateInput parameters) { - return beginSetOrchestrationServiceStateAsync(resourceGroupName, vmScaleSetName, parameters).getSyncPoller(); - } - - /** - * Changes ServiceState property for a given service. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the virtual machine scale set to create or update. - * @param parameters The input object for SetOrchestrationServiceState API. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginSetOrchestrationServiceState( - String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateInput parameters, Context context) { - return beginSetOrchestrationServiceStateAsync(resourceGroupName, vmScaleSetName, parameters, context) - .getSyncPoller(); - } - - /** - * Changes ServiceState property for a given service. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the virtual machine scale set to create or update. - * @param parameters The input object for SetOrchestrationServiceState API. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono setOrchestrationServiceStateAsync( - String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateInput parameters) { - return beginSetOrchestrationServiceStateAsync(resourceGroupName, vmScaleSetName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Changes ServiceState property for a given service. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the virtual machine scale set to create or update. - * @param parameters The input object for SetOrchestrationServiceState API. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono setOrchestrationServiceStateAsync( - String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateInput parameters, Context context) { - return beginSetOrchestrationServiceStateAsync(resourceGroupName, vmScaleSetName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Changes ServiceState property for a given service. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the virtual machine scale set to create or update. - * @param parameters The input object for SetOrchestrationServiceState API. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void setOrchestrationServiceState( - String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateInput parameters) { - setOrchestrationServiceStateAsync(resourceGroupName, vmScaleSetName, parameters).block(); - } - - /** - * Changes ServiceState property for a given service. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the virtual machine scale set to create or update. - * @param parameters The input object for SetOrchestrationServiceState API. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void setOrchestrationServiceState( - String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateInput parameters, Context context) { - setOrchestrationServiceStateAsync(resourceGroupName, vmScaleSetName, parameters, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Virtual Machine operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Virtual Machine operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Virtual Machine operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAllNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listAllNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Virtual Machine operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAllNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listAllNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Virtual Machine Scale Set List Skus operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSkusNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listSkusNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Virtual Machine Scale Set List Skus operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSkusNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listSkusNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Virtual Machine Scale Set OS Upgrade History operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getOSUpgradeHistoryNextSinglePageAsync( - String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.getOSUpgradeHistoryNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Virtual Machine Scale Set OS Upgrade History operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getOSUpgradeHistoryNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getOSUpgradeHistoryNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineScaleSetsImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineScaleSetsImpl.java deleted file mode 100644 index ab10391a4c72..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineScaleSetsImpl.java +++ /dev/null @@ -1,238 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.compute.implementation; - -import com.azure.resourcemanager.compute.ComputeManager; -import com.azure.resourcemanager.compute.models.RunCommandInput; -import com.azure.resourcemanager.compute.models.RunCommandInputParameter; -import com.azure.resourcemanager.compute.models.RunCommandResult; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSet; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetIpConfiguration; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetNetworkConfiguration; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetNetworkProfile; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetOSDisk; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetOSProfile; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetStorageProfile; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetVMInstanceRequiredIDs; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetVMProfile; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSets; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineScaleSetInner; -import com.azure.resourcemanager.compute.fluent.VirtualMachineScaleSetsClient; -import com.azure.resourcemanager.authorization.AuthorizationManager; -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.TopLevelModifiableResourcesImpl; -import com.azure.resourcemanager.storage.StorageManager; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import reactor.core.publisher.Mono; - -/** The implementation for VirtualMachineScaleSets. */ -public class VirtualMachineScaleSetsImpl - extends TopLevelModifiableResourcesImpl< - VirtualMachineScaleSet, - VirtualMachineScaleSetImpl, - VirtualMachineScaleSetInner, - VirtualMachineScaleSetsClient, - ComputeManager> - implements VirtualMachineScaleSets { - private final StorageManager storageManager; - private final NetworkManager networkManager; - private final AuthorizationManager authorizationManager; - - public VirtualMachineScaleSetsImpl( - ComputeManager computeManager, - StorageManager storageManager, - NetworkManager networkManager, - AuthorizationManager authorizationManager) { - super(computeManager.serviceClient().getVirtualMachineScaleSets(), computeManager); - this.storageManager = storageManager; - this.networkManager = networkManager; - this.authorizationManager = authorizationManager; - } - - @Override - public void deallocate(String groupName, String name) { - this.deallocateAsync(groupName, name).block(); - } - - @Override - public Mono deallocateAsync(String groupName, String name) { - return this.inner().deallocateAsync(groupName, name, null); - } - - @Override - public void powerOff(String groupName, String name) { - this.powerOffAsync(groupName, name).block(); - } - - @Override - public Mono powerOffAsync(String groupName, String name) { - return this.inner().powerOffAsync(groupName, name, null, null); - } - - @Override - public void restart(String groupName, String name) { - this.restartAsync(groupName, name).block(); - } - - @Override - public Mono restartAsync(String groupName, String name) { - return this.inner().restartAsync(groupName, name, null); - } - - @Override - public void start(String groupName, String name) { - this.startAsync(groupName, name).block(); - } - - @Override - public Mono startAsync(String groupName, String name) { - return this.inner().startAsync(groupName, name, null); - } - - @Override - public void reimage(String groupName, String name) { - this.reimageAsync(groupName, name).block(); - } - - @Override - public Mono reimageAsync(String groupName, String name) { - return this.inner().reimageAsync(groupName, name, null); - } - - @Override - public RunCommandResult runPowerShellScriptInVMInstance( - String groupName, - String scaleSetName, - String vmId, - List scriptLines, - List scriptParameters) { - return this - .runPowerShellScriptInVMInstanceAsync(groupName, scaleSetName, vmId, scriptLines, scriptParameters) - .block(); - } - - @Override - public Mono runPowerShellScriptInVMInstanceAsync( - String groupName, - String scaleSetName, - String vmId, - List scriptLines, - List scriptParameters) { - RunCommandInput inputCommand = new RunCommandInput(); - inputCommand.withCommandId("RunPowerShellScript"); - inputCommand.withScript(scriptLines); - inputCommand.withParameters(scriptParameters); - return this.runCommandVMInstanceAsync(groupName, scaleSetName, vmId, inputCommand); - } - - @Override - public RunCommandResult runShellScriptInVMInstance( - String groupName, - String scaleSetName, - String vmId, - List scriptLines, - List scriptParameters) { - return this - .runShellScriptInVMInstanceAsync(groupName, scaleSetName, vmId, scriptLines, scriptParameters) - .block(); - } - - @Override - public Mono runShellScriptInVMInstanceAsync( - String groupName, - String scaleSetName, - String vmId, - List scriptLines, - List scriptParameters) { - RunCommandInput inputCommand = new RunCommandInput(); - inputCommand.withCommandId("RunShellScript"); - inputCommand.withScript(scriptLines); - inputCommand.withParameters(scriptParameters); - return this.runCommandVMInstanceAsync(groupName, scaleSetName, vmId, inputCommand); - } - - @Override - public RunCommandResult runCommandInVMInstance( - String groupName, String scaleSetName, String vmId, RunCommandInput inputCommand) { - return this.runCommandVMInstanceAsync(groupName, scaleSetName, vmId, inputCommand).block(); - } - - @Override - public Mono runCommandVMInstanceAsync( - String groupName, String scaleSetName, String vmId, RunCommandInput inputCommand) { - return this - .manager() - .serviceClient() - .getVirtualMachineScaleSetVMs() - .runCommandAsync(groupName, scaleSetName, vmId, inputCommand) - .map(RunCommandResultImpl::new); - } - - @Override - public void deleteInstances(String groupName, String scaleSetName, Collection instanceIds) { - this.deleteInstancesAsync(groupName, scaleSetName, instanceIds).block(); - } - - @Override - public Mono deleteInstancesAsync(String groupName, String scaleSetName, Collection instanceIds) { - if (instanceIds == null || instanceIds.isEmpty()) { - return Mono.empty(); - } - return this.manager().serviceClient().getVirtualMachineScaleSets().deleteInstancesAsync(groupName, scaleSetName, - new VirtualMachineScaleSetVMInstanceRequiredIDs().withInstanceIds(new ArrayList<>(instanceIds))); - } - - @Override - public VirtualMachineScaleSetImpl define(String name) { - return wrapModel(name); - } - - @Override - protected VirtualMachineScaleSetImpl wrapModel(String name) { - VirtualMachineScaleSetInner inner = new VirtualMachineScaleSetInner(); - - inner.withVirtualMachineProfile(new VirtualMachineScaleSetVMProfile()); - inner - .virtualMachineProfile() - .withStorageProfile( - new VirtualMachineScaleSetStorageProfile() - .withOsDisk(new VirtualMachineScaleSetOSDisk().withVhdContainers(new ArrayList()))); - inner.virtualMachineProfile().withOsProfile(new VirtualMachineScaleSetOSProfile()); - - inner.virtualMachineProfile().withNetworkProfile(new VirtualMachineScaleSetNetworkProfile()); - - inner - .virtualMachineProfile() - .networkProfile() - .withNetworkInterfaceConfigurations(new ArrayList()); - - VirtualMachineScaleSetNetworkConfiguration primaryNetworkInterfaceConfiguration = - new VirtualMachineScaleSetNetworkConfiguration() - .withPrimary(true) - .withName("primary-nic-cfg") - .withIpConfigurations(new ArrayList()); - primaryNetworkInterfaceConfiguration - .ipConfigurations() - .add(new VirtualMachineScaleSetIpConfiguration().withName("primary-nic-ip-cfg")); - - inner - .virtualMachineProfile() - .networkProfile() - .networkInterfaceConfigurations() - .add(primaryNetworkInterfaceConfiguration); - - return new VirtualMachineScaleSetImpl( - name, inner, this.manager(), this.storageManager, this.networkManager, this.authorizationManager); - } - - @Override - protected VirtualMachineScaleSetImpl wrapModel(VirtualMachineScaleSetInner inner) { - if (inner == null) { - return null; - } - return new VirtualMachineScaleSetImpl( - inner.name(), inner, this.manager(), this.storageManager, this.networkManager, this.authorizationManager); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineSizeImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineSizeImpl.java deleted file mode 100644 index f429307a69ab..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineSizeImpl.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.compute.implementation; - -import com.azure.resourcemanager.compute.models.VirtualMachineSize; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineSizeInner; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; - -/** The implementation for {@link VirtualMachineSize}. */ -class VirtualMachineSizeImpl implements VirtualMachineSize { - private VirtualMachineSizeInner innerModel; - - VirtualMachineSizeImpl(VirtualMachineSizeInner innerModel) { - this.innerModel = innerModel; - } - - @Override - public String name() { - return innerModel.name(); - } - - @Override - public int numberOfCores() { - return ResourceManagerUtils.toPrimitiveInt(innerModel.numberOfCores()); - } - - @Override - public int osDiskSizeInMB() { - return ResourceManagerUtils.toPrimitiveInt(innerModel.osDiskSizeInMB()); - } - - @Override - public int resourceDiskSizeInMB() { - return ResourceManagerUtils.toPrimitiveInt(innerModel.resourceDiskSizeInMB()); - } - - @Override - public int memoryInMB() { - return ResourceManagerUtils.toPrimitiveInt(innerModel.memoryInMB()); - } - - @Override - public int maxDataDiskCount() { - return ResourceManagerUtils.toPrimitiveInt(innerModel.maxDataDiskCount()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineSizesClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineSizesClientImpl.java deleted file mode 100644 index a1163bad2bf2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineSizesClientImpl.java +++ /dev/null @@ -1,222 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.fluent.VirtualMachineSizesClient; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineSizeInner; -import com.azure.resourcemanager.compute.models.VirtualMachineSizeListResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in VirtualMachineSizesClient. */ -public final class VirtualMachineSizesClientImpl implements VirtualMachineSizesClient { - private final ClientLogger logger = new ClientLogger(VirtualMachineSizesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final VirtualMachineSizesService service; - - /** The service client containing this operation class. */ - private final ComputeManagementClientImpl client; - - /** - * Initializes an instance of VirtualMachineSizesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - VirtualMachineSizesClientImpl(ComputeManagementClientImpl client) { - this.service = - RestProxy.create(VirtualMachineSizesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for ComputeManagementClientVirtualMachineSizes to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "ComputeManagementCli") - private interface VirtualMachineSizesService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/vmSizes") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("location") String location, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * This API is deprecated. Use [Resources - * Skus](https://docs.microsoft.com/en-us/rest/api/compute/resourceskus/list). - * - * @param location The location upon which virtual-machine-sizes is queried. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Virtual Machine operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String location) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - location, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * This API is deprecated. Use [Resources - * Skus](https://docs.microsoft.com/en-us/rest/api/compute/resourceskus/list). - * - * @param location The location upon which virtual-machine-sizes is queried. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Virtual Machine operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String location, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), location, apiVersion, this.client.getSubscriptionId(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); - } - - /** - * This API is deprecated. Use [Resources - * Skus](https://docs.microsoft.com/en-us/rest/api/compute/resourceskus/list). - * - * @param location The location upon which virtual-machine-sizes is queried. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Virtual Machine operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String location) { - return new PagedFlux<>(() -> listSinglePageAsync(location)); - } - - /** - * This API is deprecated. Use [Resources - * Skus](https://docs.microsoft.com/en-us/rest/api/compute/resourceskus/list). - * - * @param location The location upon which virtual-machine-sizes is queried. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Virtual Machine operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String location, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(location, context)); - } - - /** - * This API is deprecated. Use [Resources - * Skus](https://docs.microsoft.com/en-us/rest/api/compute/resourceskus/list). - * - * @param location The location upon which virtual-machine-sizes is queried. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Virtual Machine operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String location) { - return new PagedIterable<>(listAsync(location)); - } - - /** - * This API is deprecated. Use [Resources - * Skus](https://docs.microsoft.com/en-us/rest/api/compute/resourceskus/list). - * - * @param location The location upon which virtual-machine-sizes is queried. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Virtual Machine operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String location, Context context) { - return new PagedIterable<>(listAsync(location, context)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineSizesImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineSizesImpl.java deleted file mode 100644 index 7c3ff51831d5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineSizesImpl.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.compute.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.compute.models.VirtualMachineSize; -import com.azure.resourcemanager.compute.models.VirtualMachineSizes; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineSizeInner; -import com.azure.resourcemanager.compute.fluent.VirtualMachineSizesClient; -import com.azure.core.management.Region; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.ReadableWrappersImpl; -import com.azure.resourcemanager.resources.fluentcore.utils.PagedConverter; - -/** The implementation for {@link VirtualMachineSizes}. */ -class VirtualMachineSizesImpl - extends ReadableWrappersImpl - implements VirtualMachineSizes { - private final VirtualMachineSizesClient innerCollection; - - VirtualMachineSizesImpl(VirtualMachineSizesClient innerCollection) { - this.innerCollection = innerCollection; - } - - @Override - public PagedIterable listByRegion(Region region) { - return listByRegion(region.toString()); - } - - @Override - protected VirtualMachineSizeImpl wrapModel(VirtualMachineSizeInner inner) { - if (inner == null) { - return null; - } - return new VirtualMachineSizeImpl(inner); - } - - @Override - public PagedIterable listByRegion(String regionName) { - return wrapList(innerCollection.list(regionName)); - } - - @Override - public PagedFlux listByRegionAsync(Region region) { - return listByRegionAsync(region.name()); - } - - @Override - public PagedFlux listByRegionAsync(String regionName) { - return PagedConverter.mapPage(innerCollection.listAsync(regionName), VirtualMachineSizeImpl::new); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineSkuImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineSkuImpl.java deleted file mode 100644 index 3695ac1e0aa9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineSkuImpl.java +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.compute.implementation; - -import com.azure.resourcemanager.compute.models.Sku; -import com.azure.resourcemanager.compute.models.VirtualMachineImagesInSku; -import com.azure.resourcemanager.compute.models.VirtualMachineOffer; -import com.azure.resourcemanager.compute.models.VirtualMachinePublisher; -import com.azure.resourcemanager.compute.models.VirtualMachineSku; -import com.azure.resourcemanager.compute.fluent.VirtualMachineImagesClient; -import com.azure.core.management.Region; - -/** The implementation for {@link Sku}. */ -class VirtualMachineSkuImpl implements VirtualMachineSku { - private final VirtualMachineOffer offer; - private final String skuName; - private final VirtualMachineImagesInSku imagesInSku; - - VirtualMachineSkuImpl(VirtualMachineOffer offer, String skuName, VirtualMachineImagesClient client) { - this.offer = offer; - this.skuName = skuName; - this.imagesInSku = new VirtualMachineImagesInSkuImpl(this, client); - } - - @Override - public Region region() { - return offer.region(); - } - - @Override - public VirtualMachinePublisher publisher() { - return offer.publisher(); - } - - @Override - public VirtualMachineOffer offer() { - return offer; - } - - public String name() { - return this.skuName; - } - - @Override - public VirtualMachineImagesInSku images() { - return this.imagesInSku; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineSkusImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineSkusImpl.java deleted file mode 100644 index f37cc2589a44..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineSkusImpl.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.compute.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.compute.models.VirtualMachineOffer; -import com.azure.resourcemanager.compute.models.VirtualMachineSku; -import com.azure.resourcemanager.compute.models.VirtualMachineSkus; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineImageResourceInner; -import com.azure.resourcemanager.compute.fluent.VirtualMachineImagesClient; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.ReadableWrappersImpl; -import com.azure.resourcemanager.resources.fluentcore.utils.PagedConverter; - -/** The implementation for {@link VirtualMachineSkus}. */ -class VirtualMachineSkusImpl - extends ReadableWrappersImpl - implements VirtualMachineSkus { - - private final VirtualMachineImagesClient innerCollection; - private final VirtualMachineOffer offer; - - VirtualMachineSkusImpl(VirtualMachineOffer offer, VirtualMachineImagesClient innerCollection) { - this.innerCollection = innerCollection; - this.offer = offer; - } - - @Override - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - @Override - protected VirtualMachineSkuImpl wrapModel(VirtualMachineImageResourceInner inner) { - if (inner == null) { - return null; - } - return new VirtualMachineSkuImpl(this.offer, inner.name(), innerCollection); - } - - @Override - public PagedFlux listAsync() { - return PagedConverter.mapPage(PagedConverter - .convertListToPagedFlux( - innerCollection.listSkusWithResponseAsync( - offer.region().toString(), offer.publisher().name(), offer.name())), - this::wrapModel); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachinesClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachinesClientImpl.java deleted file mode 100644 index b91d0c38c9a6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachinesClientImpl.java +++ /dev/null @@ -1,5975 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.compute.fluent.VirtualMachinesClient; -import com.azure.resourcemanager.compute.fluent.models.RetrieveBootDiagnosticsDataResultInner; -import com.azure.resourcemanager.compute.fluent.models.RunCommandResultInner; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineAssessPatchesResultInner; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineCaptureResultInner; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineInner; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineInstanceViewInner; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineSizeInner; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineUpdateInner; -import com.azure.resourcemanager.compute.models.ApiErrorException; -import com.azure.resourcemanager.compute.models.InstanceViewTypes; -import com.azure.resourcemanager.compute.models.RunCommandInput; -import com.azure.resourcemanager.compute.models.VirtualMachineCaptureParameters; -import com.azure.resourcemanager.compute.models.VirtualMachineListResult; -import com.azure.resourcemanager.compute.models.VirtualMachineReimageParameters; -import com.azure.resourcemanager.compute.models.VirtualMachineSizeListResult; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in VirtualMachinesClient. */ -public final class VirtualMachinesClientImpl - implements InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete, - VirtualMachinesClient { - private final ClientLogger logger = new ClientLogger(VirtualMachinesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final VirtualMachinesService service; - - /** The service client containing this operation class. */ - private final ComputeManagementClientImpl client; - - /** - * Initializes an instance of VirtualMachinesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - VirtualMachinesClientImpl(ComputeManagementClientImpl client) { - this.service = - RestProxy.create(VirtualMachinesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for ComputeManagementClientVirtualMachines to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "ComputeManagementCli") - private interface VirtualMachinesService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/virtualMachines") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByLocation( - @HostParam("$host") String endpoint, - @PathParam("location") String location, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachines/{vmName}/capture") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> capture( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmName") String vmName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VirtualMachineCaptureParameters parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachines/{vmName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmName") String vmName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VirtualMachineInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachines/{vmName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmName") String vmName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VirtualMachineUpdateInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachines/{vmName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmName") String vmName, - @QueryParam("forceDeletion") Boolean forceDeletion, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachines/{vmName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmName") String vmName, - @QueryParam("$expand") InstanceViewTypes expand, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachines/{vmName}/instanceView") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> instanceView( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmName") String vmName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachines/{vmName}/convertToManagedDisks") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> convertToManagedDisks( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmName") String vmName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachines/{vmName}/deallocate") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> deallocate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmName") String vmName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachines/{vmName}/generalize") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> generalize( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmName") String vmName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachines") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachines") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("statusOnly") String statusOnly, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachines/{vmName}/vmSizes") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAvailableSizes( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmName") String vmName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachines/{vmName}/powerOff") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> powerOff( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmName") String vmName, - @QueryParam("skipShutdown") Boolean skipShutdown, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachines/{vmName}/reapply") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono>> reapply( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmName") String vmName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachines/{vmName}/restart") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> restart( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmName") String vmName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachines/{vmName}/start") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> start( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmName") String vmName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachines/{vmName}/redeploy") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> redeploy( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmName") String vmName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachines/{vmName}/reimage") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> reimage( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmName") String vmName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VirtualMachineReimageParameters parameters, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachines/{vmName}/retrieveBootDiagnosticsData") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> retrieveBootDiagnosticsData( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmName") String vmName, - @QueryParam("sasUriExpirationTimeInMinutes") Integer sasUriExpirationTimeInMinutes, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachines/{vmName}/performMaintenance") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> performMaintenance( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmName") String vmName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachines/{vmName}/simulateEviction") - @ExpectedResponses({204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> simulateEviction( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmName") String vmName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachines/{vmName}/assessPatches") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono>> assessPatches( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmName") String vmName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachines/{vmName}/runCommand") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> runCommand( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmName") String vmName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") RunCommandInput parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByLocationNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAllNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets all the virtual machines under the specified subscription for the specified location. - * - * @param location The location for which virtual machines under the subscription are queried. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the virtual machines under the specified subscription for the specified location. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByLocationSinglePageAsync(String location) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByLocation( - this.client.getEndpoint(), - location, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all the virtual machines under the specified subscription for the specified location. - * - * @param location The location for which virtual machines under the subscription are queried. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the virtual machines under the specified subscription for the specified location. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByLocationSinglePageAsync(String location, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByLocation( - this.client.getEndpoint(), location, apiVersion, this.client.getSubscriptionId(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all the virtual machines under the specified subscription for the specified location. - * - * @param location The location for which virtual machines under the subscription are queried. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the virtual machines under the specified subscription for the specified location. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByLocationAsync(String location) { - return new PagedFlux<>( - () -> listByLocationSinglePageAsync(location), nextLink -> listByLocationNextSinglePageAsync(nextLink)); - } - - /** - * Gets all the virtual machines under the specified subscription for the specified location. - * - * @param location The location for which virtual machines under the subscription are queried. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the virtual machines under the specified subscription for the specified location. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByLocationAsync(String location, Context context) { - return new PagedFlux<>( - () -> listByLocationSinglePageAsync(location, context), - nextLink -> listByLocationNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all the virtual machines under the specified subscription for the specified location. - * - * @param location The location for which virtual machines under the subscription are queried. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the virtual machines under the specified subscription for the specified location. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByLocation(String location) { - return new PagedIterable<>(listByLocationAsync(location)); - } - - /** - * Gets all the virtual machines under the specified subscription for the specified location. - * - * @param location The location for which virtual machines under the subscription are queried. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the virtual machines under the specified subscription for the specified location. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByLocation(String location, Context context) { - return new PagedIterable<>(listByLocationAsync(location, context)); - } - - /** - * Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar - * VMs. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Capture Virtual Machine operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of virtual machine capture operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> captureWithResponseAsync( - String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .capture( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar - * VMs. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Capture Virtual Machine operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of virtual machine capture operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> captureWithResponseAsync( - String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .capture( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar - * VMs. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Capture Virtual Machine operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of virtual machine capture operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, VirtualMachineCaptureResultInner> beginCaptureAsync( - String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters) { - Mono>> mono = captureWithResponseAsync(resourceGroupName, vmName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VirtualMachineCaptureResultInner.class, - VirtualMachineCaptureResultInner.class, - Context.NONE); - } - - /** - * Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar - * VMs. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Capture Virtual Machine operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of virtual machine capture operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, VirtualMachineCaptureResultInner> - beginCaptureAsync( - String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - captureWithResponseAsync(resourceGroupName, vmName, parameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VirtualMachineCaptureResultInner.class, - VirtualMachineCaptureResultInner.class, - context); - } - - /** - * Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar - * VMs. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Capture Virtual Machine operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of virtual machine capture operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VirtualMachineCaptureResultInner> beginCapture( - String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters) { - return beginCaptureAsync(resourceGroupName, vmName, parameters).getSyncPoller(); - } - - /** - * Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar - * VMs. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Capture Virtual Machine operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of virtual machine capture operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VirtualMachineCaptureResultInner> beginCapture( - String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters, Context context) { - return beginCaptureAsync(resourceGroupName, vmName, parameters, context).getSyncPoller(); - } - - /** - * Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar - * VMs. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Capture Virtual Machine operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of virtual machine capture operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono captureAsync( - String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters) { - return beginCaptureAsync(resourceGroupName, vmName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar - * VMs. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Capture Virtual Machine operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of virtual machine capture operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono captureAsync( - String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters, Context context) { - return beginCaptureAsync(resourceGroupName, vmName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar - * VMs. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Capture Virtual Machine operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of virtual machine capture operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineCaptureResultInner capture( - String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters) { - return captureAsync(resourceGroupName, vmName, parameters).block(); - } - - /** - * Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar - * VMs. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Capture Virtual Machine operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of virtual machine capture operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineCaptureResultInner capture( - String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters, Context context) { - return captureAsync(resourceGroupName, vmName, parameters, context).block(); - } - - /** - * The operation to create or update a virtual machine. Please note some properties can be set only during virtual - * machine creation. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Create Virtual Machine operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String vmName, VirtualMachineInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * The operation to create or update a virtual machine. Please note some properties can be set only during virtual - * machine creation. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Create Virtual Machine operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String vmName, VirtualMachineInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * The operation to create or update a virtual machine. Please note some properties can be set only during virtual - * machine creation. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Create Virtual Machine operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, VirtualMachineInner> beginCreateOrUpdateAsync( - String resourceGroupName, String vmName, VirtualMachineInner parameters) { - Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, vmName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VirtualMachineInner.class, - VirtualMachineInner.class, - Context.NONE); - } - - /** - * The operation to create or update a virtual machine. Please note some properties can be set only during virtual - * machine creation. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Create Virtual Machine operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, VirtualMachineInner> beginCreateOrUpdateAsync( - String resourceGroupName, String vmName, VirtualMachineInner parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, vmName, parameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), VirtualMachineInner.class, VirtualMachineInner.class, context); - } - - /** - * The operation to create or update a virtual machine. Please note some properties can be set only during virtual - * machine creation. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Create Virtual Machine operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VirtualMachineInner> beginCreateOrUpdate( - String resourceGroupName, String vmName, VirtualMachineInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, vmName, parameters).getSyncPoller(); - } - - /** - * The operation to create or update a virtual machine. Please note some properties can be set only during virtual - * machine creation. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Create Virtual Machine operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VirtualMachineInner> beginCreateOrUpdate( - String resourceGroupName, String vmName, VirtualMachineInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, vmName, parameters, context).getSyncPoller(); - } - - /** - * The operation to create or update a virtual machine. Please note some properties can be set only during virtual - * machine creation. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Create Virtual Machine operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, String vmName, VirtualMachineInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, vmName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * The operation to create or update a virtual machine. Please note some properties can be set only during virtual - * machine creation. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Create Virtual Machine operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String vmName, VirtualMachineInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, vmName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * The operation to create or update a virtual machine. Please note some properties can be set only during virtual - * machine creation. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Create Virtual Machine operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineInner createOrUpdate(String resourceGroupName, String vmName, VirtualMachineInner parameters) { - return createOrUpdateAsync(resourceGroupName, vmName, parameters).block(); - } - - /** - * The operation to create or update a virtual machine. Please note some properties can be set only during virtual - * machine creation. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Create Virtual Machine operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineInner createOrUpdate( - String resourceGroupName, String vmName, VirtualMachineInner parameters, Context context) { - return createOrUpdateAsync(resourceGroupName, vmName, parameters, context).block(); - } - - /** - * The operation to update a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Update Virtual Machine operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateWithResponseAsync( - String resourceGroupName, String vmName, VirtualMachineUpdateInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * The operation to update a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Update Virtual Machine operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, String vmName, VirtualMachineUpdateInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * The operation to update a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Update Virtual Machine operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, VirtualMachineInner> beginUpdateAsync( - String resourceGroupName, String vmName, VirtualMachineUpdateInner parameters) { - Mono>> mono = updateWithResponseAsync(resourceGroupName, vmName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VirtualMachineInner.class, - VirtualMachineInner.class, - Context.NONE); - } - - /** - * The operation to update a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Update Virtual Machine operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, VirtualMachineInner> beginUpdateAsync( - String resourceGroupName, String vmName, VirtualMachineUpdateInner parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = updateWithResponseAsync(resourceGroupName, vmName, parameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), VirtualMachineInner.class, VirtualMachineInner.class, context); - } - - /** - * The operation to update a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Update Virtual Machine operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VirtualMachineInner> beginUpdate( - String resourceGroupName, String vmName, VirtualMachineUpdateInner parameters) { - return beginUpdateAsync(resourceGroupName, vmName, parameters).getSyncPoller(); - } - - /** - * The operation to update a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Update Virtual Machine operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VirtualMachineInner> beginUpdate( - String resourceGroupName, String vmName, VirtualMachineUpdateInner parameters, Context context) { - return beginUpdateAsync(resourceGroupName, vmName, parameters, context).getSyncPoller(); - } - - /** - * The operation to update a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Update Virtual Machine operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync( - String resourceGroupName, String vmName, VirtualMachineUpdateInner parameters) { - return beginUpdateAsync(resourceGroupName, vmName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * The operation to update a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Update Virtual Machine operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, String vmName, VirtualMachineUpdateInner parameters, Context context) { - return beginUpdateAsync(resourceGroupName, vmName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * The operation to update a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Update Virtual Machine operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineInner update(String resourceGroupName, String vmName, VirtualMachineUpdateInner parameters) { - return updateAsync(resourceGroupName, vmName, parameters).block(); - } - - /** - * The operation to update a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Update Virtual Machine operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineInner update( - String resourceGroupName, String vmName, VirtualMachineUpdateInner parameters, Context context) { - return updateAsync(resourceGroupName, vmName, parameters, context).block(); - } - - /** - * The operation to delete a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param forceDeletion Optional parameter to force delete virtual machines.(Feature in Preview). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync( - String resourceGroupName, String vmName, Boolean forceDeletion) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - vmName, - forceDeletion, - apiVersion, - this.client.getSubscriptionId(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * The operation to delete a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param forceDeletion Optional parameter to force delete virtual machines.(Feature in Preview). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String vmName, Boolean forceDeletion, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - vmName, - forceDeletion, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * The operation to delete a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param forceDeletion Optional parameter to force delete virtual machines.(Feature in Preview). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String vmName, Boolean forceDeletion) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, vmName, forceDeletion); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * The operation to delete a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param forceDeletion Optional parameter to force delete virtual machines.(Feature in Preview). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String vmName, Boolean forceDeletion, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, vmName, forceDeletion, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * The operation to delete a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param forceDeletion Optional parameter to force delete virtual machines.(Feature in Preview). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String vmName, Boolean forceDeletion) { - return beginDeleteAsync(resourceGroupName, vmName, forceDeletion).getSyncPoller(); - } - - /** - * The operation to delete a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param forceDeletion Optional parameter to force delete virtual machines.(Feature in Preview). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String vmName, Boolean forceDeletion, Context context) { - return beginDeleteAsync(resourceGroupName, vmName, forceDeletion, context).getSyncPoller(); - } - - /** - * The operation to delete a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param forceDeletion Optional parameter to force delete virtual machines.(Feature in Preview). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String vmName, Boolean forceDeletion) { - return beginDeleteAsync(resourceGroupName, vmName, forceDeletion) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * The operation to delete a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String vmName) { - final Boolean forceDeletion = null; - return beginDeleteAsync(resourceGroupName, vmName, forceDeletion) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * The operation to delete a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param forceDeletion Optional parameter to force delete virtual machines.(Feature in Preview). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String vmName, Boolean forceDeletion, Context context) { - return beginDeleteAsync(resourceGroupName, vmName, forceDeletion, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * The operation to delete a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param forceDeletion Optional parameter to force delete virtual machines.(Feature in Preview). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String vmName, Boolean forceDeletion) { - deleteAsync(resourceGroupName, vmName, forceDeletion).block(); - } - - /** - * The operation to delete a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String vmName) { - final Boolean forceDeletion = null; - deleteAsync(resourceGroupName, vmName, forceDeletion).block(); - } - - /** - * The operation to delete a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param forceDeletion Optional parameter to force delete virtual machines.(Feature in Preview). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String vmName, Boolean forceDeletion, Context context) { - deleteAsync(resourceGroupName, vmName, forceDeletion, context).block(); - } - - /** - * Retrieves information about the model view or the instance view of a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param expand The expand expression to apply on the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String vmName, InstanceViewTypes expand) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - vmName, - expand, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Retrieves information about the model view or the instance view of a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param expand The expand expression to apply on the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String vmName, InstanceViewTypes expand, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - vmName, - expand, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Retrieves information about the model view or the instance view of a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param expand The expand expression to apply on the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync( - String resourceGroupName, String vmName, InstanceViewTypes expand) { - return getByResourceGroupWithResponseAsync(resourceGroupName, vmName, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Retrieves information about the model view or the instance view of a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync(String resourceGroupName, String vmName) { - final InstanceViewTypes expand = null; - return getByResourceGroupWithResponseAsync(resourceGroupName, vmName, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Retrieves information about the model view or the instance view of a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineInner getByResourceGroup(String resourceGroupName, String vmName) { - final InstanceViewTypes expand = null; - return getByResourceGroupAsync(resourceGroupName, vmName, expand).block(); - } - - /** - * Retrieves information about the model view or the instance view of a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param expand The expand expression to apply on the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String vmName, InstanceViewTypes expand, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, vmName, expand, context).block(); - } - - /** - * Retrieves information about the run-time state of a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the instance view of a virtual machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> instanceViewWithResponseAsync( - String resourceGroupName, String vmName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .instanceView( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Retrieves information about the run-time state of a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the instance view of a virtual machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> instanceViewWithResponseAsync( - String resourceGroupName, String vmName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .instanceView( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Retrieves information about the run-time state of a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the instance view of a virtual machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono instanceViewAsync(String resourceGroupName, String vmName) { - return instanceViewWithResponseAsync(resourceGroupName, vmName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Retrieves information about the run-time state of a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the instance view of a virtual machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineInstanceViewInner instanceView(String resourceGroupName, String vmName) { - return instanceViewAsync(resourceGroupName, vmName).block(); - } - - /** - * Retrieves information about the run-time state of a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the instance view of a virtual machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response instanceViewWithResponse( - String resourceGroupName, String vmName, Context context) { - return instanceViewWithResponseAsync(resourceGroupName, vmName, context).block(); - } - - /** - * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before - * invoking this operation. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> convertToManagedDisksWithResponseAsync( - String resourceGroupName, String vmName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - return FluxUtil - .withContext( - context -> - service - .convertToManagedDisks( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before - * invoking this operation. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> convertToManagedDisksWithResponseAsync( - String resourceGroupName, String vmName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - context = this.client.mergeContext(context); - return service - .convertToManagedDisks( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before - * invoking this operation. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginConvertToManagedDisksAsync(String resourceGroupName, String vmName) { - Mono>> mono = convertToManagedDisksWithResponseAsync(resourceGroupName, vmName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before - * invoking this operation. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginConvertToManagedDisksAsync( - String resourceGroupName, String vmName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - convertToManagedDisksWithResponseAsync(resourceGroupName, vmName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before - * invoking this operation. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginConvertToManagedDisks(String resourceGroupName, String vmName) { - return beginConvertToManagedDisksAsync(resourceGroupName, vmName).getSyncPoller(); - } - - /** - * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before - * invoking this operation. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginConvertToManagedDisks( - String resourceGroupName, String vmName, Context context) { - return beginConvertToManagedDisksAsync(resourceGroupName, vmName, context).getSyncPoller(); - } - - /** - * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before - * invoking this operation. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono convertToManagedDisksAsync(String resourceGroupName, String vmName) { - return beginConvertToManagedDisksAsync(resourceGroupName, vmName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before - * invoking this operation. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono convertToManagedDisksAsync(String resourceGroupName, String vmName, Context context) { - return beginConvertToManagedDisksAsync(resourceGroupName, vmName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before - * invoking this operation. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void convertToManagedDisks(String resourceGroupName, String vmName) { - convertToManagedDisksAsync(resourceGroupName, vmName).block(); - } - - /** - * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before - * invoking this operation. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void convertToManagedDisks(String resourceGroupName, String vmName, Context context) { - convertToManagedDisksAsync(resourceGroupName, vmName, context).block(); - } - - /** - * Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources - * that this virtual machine uses. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deallocateWithResponseAsync(String resourceGroupName, String vmName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - return FluxUtil - .withContext( - context -> - service - .deallocate( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources - * that this virtual machine uses. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deallocateWithResponseAsync( - String resourceGroupName, String vmName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - context = this.client.mergeContext(context); - return service - .deallocate( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources - * that this virtual machine uses. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeallocateAsync(String resourceGroupName, String vmName) { - Mono>> mono = deallocateWithResponseAsync(resourceGroupName, vmName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources - * that this virtual machine uses. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeallocateAsync( - String resourceGroupName, String vmName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deallocateWithResponseAsync(resourceGroupName, vmName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources - * that this virtual machine uses. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDeallocate(String resourceGroupName, String vmName) { - return beginDeallocateAsync(resourceGroupName, vmName).getSyncPoller(); - } - - /** - * Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources - * that this virtual machine uses. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDeallocate( - String resourceGroupName, String vmName, Context context) { - return beginDeallocateAsync(resourceGroupName, vmName, context).getSyncPoller(); - } - - /** - * Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources - * that this virtual machine uses. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deallocateAsync(String resourceGroupName, String vmName) { - return beginDeallocateAsync(resourceGroupName, vmName).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources - * that this virtual machine uses. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deallocateAsync(String resourceGroupName, String vmName, Context context) { - return beginDeallocateAsync(resourceGroupName, vmName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources - * that this virtual machine uses. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deallocate(String resourceGroupName, String vmName) { - deallocateAsync(resourceGroupName, vmName).block(); - } - - /** - * Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources - * that this virtual machine uses. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deallocate(String resourceGroupName, String vmName, Context context) { - deallocateAsync(resourceGroupName, vmName, context).block(); - } - - /** - * Sets the OS state of the virtual machine to generalized. It is recommended to sysprep the virtual machine before - * performing this operation. <br>For Windows, please refer to [Create a managed image of a generalized VM in - * Azure](https://docs.microsoft.com/en-us/azure/virtual-machines/windows/capture-image-resource).<br>For - * Linux, please refer to [How to create an image of a virtual machine or - * VHD](https://docs.microsoft.com/en-us/azure/virtual-machines/linux/capture-image). - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> generalizeWithResponseAsync(String resourceGroupName, String vmName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - return FluxUtil - .withContext( - context -> - service - .generalize( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Sets the OS state of the virtual machine to generalized. It is recommended to sysprep the virtual machine before - * performing this operation. <br>For Windows, please refer to [Create a managed image of a generalized VM in - * Azure](https://docs.microsoft.com/en-us/azure/virtual-machines/windows/capture-image-resource).<br>For - * Linux, please refer to [How to create an image of a virtual machine or - * VHD](https://docs.microsoft.com/en-us/azure/virtual-machines/linux/capture-image). - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> generalizeWithResponseAsync(String resourceGroupName, String vmName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - context = this.client.mergeContext(context); - return service - .generalize( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Sets the OS state of the virtual machine to generalized. It is recommended to sysprep the virtual machine before - * performing this operation. <br>For Windows, please refer to [Create a managed image of a generalized VM in - * Azure](https://docs.microsoft.com/en-us/azure/virtual-machines/windows/capture-image-resource).<br>For - * Linux, please refer to [How to create an image of a virtual machine or - * VHD](https://docs.microsoft.com/en-us/azure/virtual-machines/linux/capture-image). - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono generalizeAsync(String resourceGroupName, String vmName) { - return generalizeWithResponseAsync(resourceGroupName, vmName).flatMap((Response res) -> Mono.empty()); - } - - /** - * Sets the OS state of the virtual machine to generalized. It is recommended to sysprep the virtual machine before - * performing this operation. <br>For Windows, please refer to [Create a managed image of a generalized VM in - * Azure](https://docs.microsoft.com/en-us/azure/virtual-machines/windows/capture-image-resource).<br>For - * Linux, please refer to [How to create an image of a virtual machine or - * VHD](https://docs.microsoft.com/en-us/azure/virtual-machines/linux/capture-image). - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void generalize(String resourceGroupName, String vmName) { - generalizeAsync(resourceGroupName, vmName).block(); - } - - /** - * Sets the OS state of the virtual machine to generalized. It is recommended to sysprep the virtual machine before - * performing this operation. <br>For Windows, please refer to [Create a managed image of a generalized VM in - * Azure](https://docs.microsoft.com/en-us/azure/virtual-machines/windows/capture-image-resource).<br>For - * Linux, please refer to [How to create an image of a virtual machine or - * VHD](https://docs.microsoft.com/en-us/azure/virtual-machines/linux/capture-image). - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response generalizeWithResponse(String resourceGroupName, String vmName, Context context) { - return generalizeWithResponseAsync(resourceGroupName, vmName, context).block(); - } - - /** - * Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to - * get the next page of virtual machines. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Virtual Machine operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to - * get the next page of virtual machines. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Virtual Machine operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to - * get the next page of virtual machines. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Virtual Machine operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to - * get the next page of virtual machines. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Virtual Machine operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to - * get the next page of virtual machines. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Virtual Machine operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to - * get the next page of virtual machines. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Virtual Machine operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get - * the next page of virtual machines. - * - * @param statusOnly statusOnly=true enables fetching run time status of all Virtual Machines in the subscription. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Virtual Machine operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String statusOnly) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - statusOnly, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get - * the next page of virtual machines. - * - * @param statusOnly statusOnly=true enables fetching run time status of all Virtual Machines in the subscription. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Virtual Machine operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String statusOnly, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), statusOnly, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get - * the next page of virtual machines. - * - * @param statusOnly statusOnly=true enables fetching run time status of all Virtual Machines in the subscription. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Virtual Machine operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String statusOnly) { - return new PagedFlux<>(() -> listSinglePageAsync(statusOnly), nextLink -> listAllNextSinglePageAsync(nextLink)); - } - - /** - * Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get - * the next page of virtual machines. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Virtual Machine operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - final String statusOnly = null; - return new PagedFlux<>(() -> listSinglePageAsync(statusOnly), nextLink -> listAllNextSinglePageAsync(nextLink)); - } - - /** - * Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get - * the next page of virtual machines. - * - * @param statusOnly statusOnly=true enables fetching run time status of all Virtual Machines in the subscription. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Virtual Machine operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String statusOnly, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(statusOnly, context), nextLink -> listAllNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get - * the next page of virtual machines. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Virtual Machine operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - final String statusOnly = null; - return new PagedIterable<>(listAsync(statusOnly)); - } - - /** - * Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get - * the next page of virtual machines. - * - * @param statusOnly statusOnly=true enables fetching run time status of all Virtual Machines in the subscription. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Virtual Machine operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String statusOnly, Context context) { - return new PagedIterable<>(listAsync(statusOnly, context)); - } - - /** - * Lists all available virtual machine sizes to which the specified virtual machine can be resized. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Virtual Machine operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAvailableSizesSinglePageAsync( - String resourceGroupName, String vmName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listAvailableSizes( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all available virtual machine sizes to which the specified virtual machine can be resized. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Virtual Machine operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAvailableSizesSinglePageAsync( - String resourceGroupName, String vmName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listAvailableSizes( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); - } - - /** - * Lists all available virtual machine sizes to which the specified virtual machine can be resized. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Virtual Machine operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAvailableSizesAsync(String resourceGroupName, String vmName) { - return new PagedFlux<>(() -> listAvailableSizesSinglePageAsync(resourceGroupName, vmName)); - } - - /** - * Lists all available virtual machine sizes to which the specified virtual machine can be resized. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Virtual Machine operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAvailableSizesAsync( - String resourceGroupName, String vmName, Context context) { - return new PagedFlux<>(() -> listAvailableSizesSinglePageAsync(resourceGroupName, vmName, context)); - } - - /** - * Lists all available virtual machine sizes to which the specified virtual machine can be resized. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Virtual Machine operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAvailableSizes(String resourceGroupName, String vmName) { - return new PagedIterable<>(listAvailableSizesAsync(resourceGroupName, vmName)); - } - - /** - * Lists all available virtual machine sizes to which the specified virtual machine can be resized. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Virtual Machine operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAvailableSizes( - String resourceGroupName, String vmName, Context context) { - return new PagedIterable<>(listAvailableSizesAsync(resourceGroupName, vmName, context)); - } - - /** - * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same - * provisioned resources. You are still charged for this virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> powerOffWithResponseAsync( - String resourceGroupName, String vmName, Boolean skipShutdown) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - return FluxUtil - .withContext( - context -> - service - .powerOff( - this.client.getEndpoint(), - resourceGroupName, - vmName, - skipShutdown, - apiVersion, - this.client.getSubscriptionId(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same - * provisioned resources. You are still charged for this virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> powerOffWithResponseAsync( - String resourceGroupName, String vmName, Boolean skipShutdown, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - context = this.client.mergeContext(context); - return service - .powerOff( - this.client.getEndpoint(), - resourceGroupName, - vmName, - skipShutdown, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same - * provisioned resources. You are still charged for this virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginPowerOffAsync( - String resourceGroupName, String vmName, Boolean skipShutdown) { - Mono>> mono = powerOffWithResponseAsync(resourceGroupName, vmName, skipShutdown); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same - * provisioned resources. You are still charged for this virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginPowerOffAsync( - String resourceGroupName, String vmName, Boolean skipShutdown, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - powerOffWithResponseAsync(resourceGroupName, vmName, skipShutdown, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same - * provisioned resources. You are still charged for this virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginPowerOff( - String resourceGroupName, String vmName, Boolean skipShutdown) { - return beginPowerOffAsync(resourceGroupName, vmName, skipShutdown).getSyncPoller(); - } - - /** - * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same - * provisioned resources. You are still charged for this virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginPowerOff( - String resourceGroupName, String vmName, Boolean skipShutdown, Context context) { - return beginPowerOffAsync(resourceGroupName, vmName, skipShutdown, context).getSyncPoller(); - } - - /** - * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same - * provisioned resources. You are still charged for this virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono powerOffAsync(String resourceGroupName, String vmName, Boolean skipShutdown) { - return beginPowerOffAsync(resourceGroupName, vmName, skipShutdown) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same - * provisioned resources. You are still charged for this virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono powerOffAsync(String resourceGroupName, String vmName) { - final Boolean skipShutdown = null; - return beginPowerOffAsync(resourceGroupName, vmName, skipShutdown) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same - * provisioned resources. You are still charged for this virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono powerOffAsync(String resourceGroupName, String vmName, Boolean skipShutdown, Context context) { - return beginPowerOffAsync(resourceGroupName, vmName, skipShutdown, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same - * provisioned resources. You are still charged for this virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void powerOff(String resourceGroupName, String vmName, Boolean skipShutdown) { - powerOffAsync(resourceGroupName, vmName, skipShutdown).block(); - } - - /** - * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same - * provisioned resources. You are still charged for this virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void powerOff(String resourceGroupName, String vmName) { - final Boolean skipShutdown = null; - powerOffAsync(resourceGroupName, vmName, skipShutdown).block(); - } - - /** - * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same - * provisioned resources. You are still charged for this virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void powerOff(String resourceGroupName, String vmName, Boolean skipShutdown, Context context) { - powerOffAsync(resourceGroupName, vmName, skipShutdown, context).block(); - } - - /** - * The operation to reapply a virtual machine's state. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> reapplyWithResponseAsync(String resourceGroupName, String vmName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .reapply( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * The operation to reapply a virtual machine's state. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> reapplyWithResponseAsync( - String resourceGroupName, String vmName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .reapply( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * The operation to reapply a virtual machine's state. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginReapplyAsync(String resourceGroupName, String vmName) { - Mono>> mono = reapplyWithResponseAsync(resourceGroupName, vmName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * The operation to reapply a virtual machine's state. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginReapplyAsync( - String resourceGroupName, String vmName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = reapplyWithResponseAsync(resourceGroupName, vmName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * The operation to reapply a virtual machine's state. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginReapply(String resourceGroupName, String vmName) { - return beginReapplyAsync(resourceGroupName, vmName).getSyncPoller(); - } - - /** - * The operation to reapply a virtual machine's state. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginReapply(String resourceGroupName, String vmName, Context context) { - return beginReapplyAsync(resourceGroupName, vmName, context).getSyncPoller(); - } - - /** - * The operation to reapply a virtual machine's state. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono reapplyAsync(String resourceGroupName, String vmName) { - return beginReapplyAsync(resourceGroupName, vmName).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * The operation to reapply a virtual machine's state. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono reapplyAsync(String resourceGroupName, String vmName, Context context) { - return beginReapplyAsync(resourceGroupName, vmName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * The operation to reapply a virtual machine's state. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void reapply(String resourceGroupName, String vmName) { - reapplyAsync(resourceGroupName, vmName).block(); - } - - /** - * The operation to reapply a virtual machine's state. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void reapply(String resourceGroupName, String vmName, Context context) { - reapplyAsync(resourceGroupName, vmName, context).block(); - } - - /** - * The operation to restart a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> restartWithResponseAsync(String resourceGroupName, String vmName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - return FluxUtil - .withContext( - context -> - service - .restart( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * The operation to restart a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> restartWithResponseAsync( - String resourceGroupName, String vmName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - context = this.client.mergeContext(context); - return service - .restart( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * The operation to restart a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginRestartAsync(String resourceGroupName, String vmName) { - Mono>> mono = restartWithResponseAsync(resourceGroupName, vmName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * The operation to restart a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginRestartAsync( - String resourceGroupName, String vmName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = restartWithResponseAsync(resourceGroupName, vmName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * The operation to restart a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginRestart(String resourceGroupName, String vmName) { - return beginRestartAsync(resourceGroupName, vmName).getSyncPoller(); - } - - /** - * The operation to restart a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginRestart(String resourceGroupName, String vmName, Context context) { - return beginRestartAsync(resourceGroupName, vmName, context).getSyncPoller(); - } - - /** - * The operation to restart a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono restartAsync(String resourceGroupName, String vmName) { - return beginRestartAsync(resourceGroupName, vmName).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * The operation to restart a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono restartAsync(String resourceGroupName, String vmName, Context context) { - return beginRestartAsync(resourceGroupName, vmName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * The operation to restart a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void restart(String resourceGroupName, String vmName) { - restartAsync(resourceGroupName, vmName).block(); - } - - /** - * The operation to restart a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void restart(String resourceGroupName, String vmName, Context context) { - restartAsync(resourceGroupName, vmName, context).block(); - } - - /** - * The operation to start a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> startWithResponseAsync(String resourceGroupName, String vmName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - return FluxUtil - .withContext( - context -> - service - .start( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * The operation to start a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> startWithResponseAsync( - String resourceGroupName, String vmName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - context = this.client.mergeContext(context); - return service - .start( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * The operation to start a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginStartAsync(String resourceGroupName, String vmName) { - Mono>> mono = startWithResponseAsync(resourceGroupName, vmName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * The operation to start a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginStartAsync( - String resourceGroupName, String vmName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = startWithResponseAsync(resourceGroupName, vmName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * The operation to start a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginStart(String resourceGroupName, String vmName) { - return beginStartAsync(resourceGroupName, vmName).getSyncPoller(); - } - - /** - * The operation to start a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginStart(String resourceGroupName, String vmName, Context context) { - return beginStartAsync(resourceGroupName, vmName, context).getSyncPoller(); - } - - /** - * The operation to start a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono startAsync(String resourceGroupName, String vmName) { - return beginStartAsync(resourceGroupName, vmName).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * The operation to start a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono startAsync(String resourceGroupName, String vmName, Context context) { - return beginStartAsync(resourceGroupName, vmName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * The operation to start a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void start(String resourceGroupName, String vmName) { - startAsync(resourceGroupName, vmName).block(); - } - - /** - * The operation to start a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void start(String resourceGroupName, String vmName, Context context) { - startAsync(resourceGroupName, vmName, context).block(); - } - - /** - * Shuts down the virtual machine, moves it to a new node, and powers it back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> redeployWithResponseAsync(String resourceGroupName, String vmName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - return FluxUtil - .withContext( - context -> - service - .redeploy( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Shuts down the virtual machine, moves it to a new node, and powers it back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> redeployWithResponseAsync( - String resourceGroupName, String vmName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - context = this.client.mergeContext(context); - return service - .redeploy( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Shuts down the virtual machine, moves it to a new node, and powers it back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginRedeployAsync(String resourceGroupName, String vmName) { - Mono>> mono = redeployWithResponseAsync(resourceGroupName, vmName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Shuts down the virtual machine, moves it to a new node, and powers it back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginRedeployAsync( - String resourceGroupName, String vmName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = redeployWithResponseAsync(resourceGroupName, vmName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Shuts down the virtual machine, moves it to a new node, and powers it back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginRedeploy(String resourceGroupName, String vmName) { - return beginRedeployAsync(resourceGroupName, vmName).getSyncPoller(); - } - - /** - * Shuts down the virtual machine, moves it to a new node, and powers it back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginRedeploy(String resourceGroupName, String vmName, Context context) { - return beginRedeployAsync(resourceGroupName, vmName, context).getSyncPoller(); - } - - /** - * Shuts down the virtual machine, moves it to a new node, and powers it back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono redeployAsync(String resourceGroupName, String vmName) { - return beginRedeployAsync(resourceGroupName, vmName).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Shuts down the virtual machine, moves it to a new node, and powers it back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono redeployAsync(String resourceGroupName, String vmName, Context context) { - return beginRedeployAsync(resourceGroupName, vmName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Shuts down the virtual machine, moves it to a new node, and powers it back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void redeploy(String resourceGroupName, String vmName) { - redeployAsync(resourceGroupName, vmName).block(); - } - - /** - * Shuts down the virtual machine, moves it to a new node, and powers it back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void redeploy(String resourceGroupName, String vmName, Context context) { - redeployAsync(resourceGroupName, vmName, context).block(); - } - - /** - * Reimages the virtual machine which has an ephemeral OS disk back to its initial state. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Reimage Virtual Machine operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> reimageWithResponseAsync( - String resourceGroupName, String vmName, VirtualMachineReimageParameters parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters != null) { - parameters.validate(); - } - final String apiVersion = "2020-06-01"; - return FluxUtil - .withContext( - context -> - service - .reimage( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Reimages the virtual machine which has an ephemeral OS disk back to its initial state. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Reimage Virtual Machine operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> reimageWithResponseAsync( - String resourceGroupName, String vmName, VirtualMachineReimageParameters parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters != null) { - parameters.validate(); - } - final String apiVersion = "2020-06-01"; - context = this.client.mergeContext(context); - return service - .reimage( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - context); - } - - /** - * Reimages the virtual machine which has an ephemeral OS disk back to its initial state. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Reimage Virtual Machine operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginReimageAsync( - String resourceGroupName, String vmName, VirtualMachineReimageParameters parameters) { - Mono>> mono = reimageWithResponseAsync(resourceGroupName, vmName, parameters); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Reimages the virtual machine which has an ephemeral OS disk back to its initial state. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Reimage Virtual Machine operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginReimageAsync( - String resourceGroupName, String vmName, VirtualMachineReimageParameters parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - reimageWithResponseAsync(resourceGroupName, vmName, parameters, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Reimages the virtual machine which has an ephemeral OS disk back to its initial state. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Reimage Virtual Machine operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginReimage( - String resourceGroupName, String vmName, VirtualMachineReimageParameters parameters) { - return beginReimageAsync(resourceGroupName, vmName, parameters).getSyncPoller(); - } - - /** - * Reimages the virtual machine which has an ephemeral OS disk back to its initial state. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Reimage Virtual Machine operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginReimage( - String resourceGroupName, String vmName, VirtualMachineReimageParameters parameters, Context context) { - return beginReimageAsync(resourceGroupName, vmName, parameters, context).getSyncPoller(); - } - - /** - * Reimages the virtual machine which has an ephemeral OS disk back to its initial state. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Reimage Virtual Machine operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono reimageAsync( - String resourceGroupName, String vmName, VirtualMachineReimageParameters parameters) { - return beginReimageAsync(resourceGroupName, vmName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Reimages the virtual machine which has an ephemeral OS disk back to its initial state. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono reimageAsync(String resourceGroupName, String vmName) { - final VirtualMachineReimageParameters parameters = null; - return beginReimageAsync(resourceGroupName, vmName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Reimages the virtual machine which has an ephemeral OS disk back to its initial state. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Reimage Virtual Machine operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono reimageAsync( - String resourceGroupName, String vmName, VirtualMachineReimageParameters parameters, Context context) { - return beginReimageAsync(resourceGroupName, vmName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Reimages the virtual machine which has an ephemeral OS disk back to its initial state. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Reimage Virtual Machine operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void reimage(String resourceGroupName, String vmName, VirtualMachineReimageParameters parameters) { - reimageAsync(resourceGroupName, vmName, parameters).block(); - } - - /** - * Reimages the virtual machine which has an ephemeral OS disk back to its initial state. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void reimage(String resourceGroupName, String vmName) { - final VirtualMachineReimageParameters parameters = null; - reimageAsync(resourceGroupName, vmName, parameters).block(); - } - - /** - * Reimages the virtual machine which has an ephemeral OS disk back to its initial state. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Reimage Virtual Machine operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void reimage( - String resourceGroupName, String vmName, VirtualMachineReimageParameters parameters, Context context) { - reimageAsync(resourceGroupName, vmName, parameters, context).block(); - } - - /** - * The operation to retrieve SAS URIs for a virtual machine's boot diagnostic logs. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param sasUriExpirationTimeInMinutes Expiration duration in minutes for the SAS URIs with a value between 1 to - * 1440 minutes. <br><br>NOTE: If not specified, SAS URIs will be generated with a default - * expiration duration of 120 minutes. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the SAS URIs of the console screenshot and serial log blobs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> retrieveBootDiagnosticsDataWithResponseAsync( - String resourceGroupName, String vmName, Integer sasUriExpirationTimeInMinutes) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .retrieveBootDiagnosticsData( - this.client.getEndpoint(), - resourceGroupName, - vmName, - sasUriExpirationTimeInMinutes, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * The operation to retrieve SAS URIs for a virtual machine's boot diagnostic logs. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param sasUriExpirationTimeInMinutes Expiration duration in minutes for the SAS URIs with a value between 1 to - * 1440 minutes. <br><br>NOTE: If not specified, SAS URIs will be generated with a default - * expiration duration of 120 minutes. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the SAS URIs of the console screenshot and serial log blobs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> retrieveBootDiagnosticsDataWithResponseAsync( - String resourceGroupName, String vmName, Integer sasUriExpirationTimeInMinutes, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .retrieveBootDiagnosticsData( - this.client.getEndpoint(), - resourceGroupName, - vmName, - sasUriExpirationTimeInMinutes, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * The operation to retrieve SAS URIs for a virtual machine's boot diagnostic logs. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param sasUriExpirationTimeInMinutes Expiration duration in minutes for the SAS URIs with a value between 1 to - * 1440 minutes. <br><br>NOTE: If not specified, SAS URIs will be generated with a default - * expiration duration of 120 minutes. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the SAS URIs of the console screenshot and serial log blobs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono retrieveBootDiagnosticsDataAsync( - String resourceGroupName, String vmName, Integer sasUriExpirationTimeInMinutes) { - return retrieveBootDiagnosticsDataWithResponseAsync(resourceGroupName, vmName, sasUriExpirationTimeInMinutes) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * The operation to retrieve SAS URIs for a virtual machine's boot diagnostic logs. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the SAS URIs of the console screenshot and serial log blobs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono retrieveBootDiagnosticsDataAsync( - String resourceGroupName, String vmName) { - final Integer sasUriExpirationTimeInMinutes = null; - return retrieveBootDiagnosticsDataWithResponseAsync(resourceGroupName, vmName, sasUriExpirationTimeInMinutes) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * The operation to retrieve SAS URIs for a virtual machine's boot diagnostic logs. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the SAS URIs of the console screenshot and serial log blobs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RetrieveBootDiagnosticsDataResultInner retrieveBootDiagnosticsData(String resourceGroupName, String vmName) { - final Integer sasUriExpirationTimeInMinutes = null; - return retrieveBootDiagnosticsDataAsync(resourceGroupName, vmName, sasUriExpirationTimeInMinutes).block(); - } - - /** - * The operation to retrieve SAS URIs for a virtual machine's boot diagnostic logs. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param sasUriExpirationTimeInMinutes Expiration duration in minutes for the SAS URIs with a value between 1 to - * 1440 minutes. <br><br>NOTE: If not specified, SAS URIs will be generated with a default - * expiration duration of 120 minutes. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the SAS URIs of the console screenshot and serial log blobs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response retrieveBootDiagnosticsDataWithResponse( - String resourceGroupName, String vmName, Integer sasUriExpirationTimeInMinutes, Context context) { - return retrieveBootDiagnosticsDataWithResponseAsync( - resourceGroupName, vmName, sasUriExpirationTimeInMinutes, context) - .block(); - } - - /** - * The operation to perform maintenance on a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> performMaintenanceWithResponseAsync( - String resourceGroupName, String vmName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - return FluxUtil - .withContext( - context -> - service - .performMaintenance( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * The operation to perform maintenance on a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> performMaintenanceWithResponseAsync( - String resourceGroupName, String vmName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - context = this.client.mergeContext(context); - return service - .performMaintenance( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * The operation to perform maintenance on a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginPerformMaintenanceAsync(String resourceGroupName, String vmName) { - Mono>> mono = performMaintenanceWithResponseAsync(resourceGroupName, vmName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * The operation to perform maintenance on a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginPerformMaintenanceAsync( - String resourceGroupName, String vmName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = performMaintenanceWithResponseAsync(resourceGroupName, vmName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * The operation to perform maintenance on a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginPerformMaintenance(String resourceGroupName, String vmName) { - return beginPerformMaintenanceAsync(resourceGroupName, vmName).getSyncPoller(); - } - - /** - * The operation to perform maintenance on a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginPerformMaintenance( - String resourceGroupName, String vmName, Context context) { - return beginPerformMaintenanceAsync(resourceGroupName, vmName, context).getSyncPoller(); - } - - /** - * The operation to perform maintenance on a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono performMaintenanceAsync(String resourceGroupName, String vmName) { - return beginPerformMaintenanceAsync(resourceGroupName, vmName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * The operation to perform maintenance on a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono performMaintenanceAsync(String resourceGroupName, String vmName, Context context) { - return beginPerformMaintenanceAsync(resourceGroupName, vmName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * The operation to perform maintenance on a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void performMaintenance(String resourceGroupName, String vmName) { - performMaintenanceAsync(resourceGroupName, vmName).block(); - } - - /** - * The operation to perform maintenance on a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void performMaintenance(String resourceGroupName, String vmName, Context context) { - performMaintenanceAsync(resourceGroupName, vmName, context).block(); - } - - /** - * The operation to simulate the eviction of spot virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> simulateEvictionWithResponseAsync(String resourceGroupName, String vmName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - return FluxUtil - .withContext( - context -> - service - .simulateEviction( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * The operation to simulate the eviction of spot virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> simulateEvictionWithResponseAsync( - String resourceGroupName, String vmName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - context = this.client.mergeContext(context); - return service - .simulateEviction( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * The operation to simulate the eviction of spot virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono simulateEvictionAsync(String resourceGroupName, String vmName) { - return simulateEvictionWithResponseAsync(resourceGroupName, vmName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * The operation to simulate the eviction of spot virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void simulateEviction(String resourceGroupName, String vmName) { - simulateEvictionAsync(resourceGroupName, vmName).block(); - } - - /** - * The operation to simulate the eviction of spot virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response simulateEvictionWithResponse(String resourceGroupName, String vmName, Context context) { - return simulateEvictionWithResponseAsync(resourceGroupName, vmName, context).block(); - } - - /** - * Assess patches on the VM. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the properties of an AssessPatches result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> assessPatchesWithResponseAsync(String resourceGroupName, String vmName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .assessPatches( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Assess patches on the VM. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the properties of an AssessPatches result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> assessPatchesWithResponseAsync( - String resourceGroupName, String vmName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .assessPatches( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Assess patches on the VM. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the properties of an AssessPatches result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, VirtualMachineAssessPatchesResultInner> - beginAssessPatchesAsync(String resourceGroupName, String vmName) { - Mono>> mono = assessPatchesWithResponseAsync(resourceGroupName, vmName); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VirtualMachineAssessPatchesResultInner.class, - VirtualMachineAssessPatchesResultInner.class, - Context.NONE); - } - - /** - * Assess patches on the VM. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the properties of an AssessPatches result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, VirtualMachineAssessPatchesResultInner> - beginAssessPatchesAsync(String resourceGroupName, String vmName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = assessPatchesWithResponseAsync(resourceGroupName, vmName, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VirtualMachineAssessPatchesResultInner.class, - VirtualMachineAssessPatchesResultInner.class, - context); - } - - /** - * Assess patches on the VM. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the properties of an AssessPatches result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VirtualMachineAssessPatchesResultInner> - beginAssessPatches(String resourceGroupName, String vmName) { - return beginAssessPatchesAsync(resourceGroupName, vmName).getSyncPoller(); - } - - /** - * Assess patches on the VM. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the properties of an AssessPatches result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VirtualMachineAssessPatchesResultInner> - beginAssessPatches(String resourceGroupName, String vmName, Context context) { - return beginAssessPatchesAsync(resourceGroupName, vmName, context).getSyncPoller(); - } - - /** - * Assess patches on the VM. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the properties of an AssessPatches result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono assessPatchesAsync(String resourceGroupName, String vmName) { - return beginAssessPatchesAsync(resourceGroupName, vmName).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Assess patches on the VM. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the properties of an AssessPatches result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono assessPatchesAsync( - String resourceGroupName, String vmName, Context context) { - return beginAssessPatchesAsync(resourceGroupName, vmName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Assess patches on the VM. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the properties of an AssessPatches result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineAssessPatchesResultInner assessPatches(String resourceGroupName, String vmName) { - return assessPatchesAsync(resourceGroupName, vmName).block(); - } - - /** - * Assess patches on the VM. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the properties of an AssessPatches result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineAssessPatchesResultInner assessPatches( - String resourceGroupName, String vmName, Context context) { - return assessPatchesAsync(resourceGroupName, vmName, context).block(); - } - - /** - * Run command on the VM. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Run command operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> runCommandWithResponseAsync( - String resourceGroupName, String vmName, RunCommandInput parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .runCommand( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Run command on the VM. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Run command operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> runCommandWithResponseAsync( - String resourceGroupName, String vmName, RunCommandInput parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-06-01"; - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .runCommand( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Run command on the VM. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Run command operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, RunCommandResultInner> beginRunCommandAsync( - String resourceGroupName, String vmName, RunCommandInput parameters) { - Mono>> mono = runCommandWithResponseAsync(resourceGroupName, vmName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - RunCommandResultInner.class, - RunCommandResultInner.class, - Context.NONE); - } - - /** - * Run command on the VM. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Run command operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, RunCommandResultInner> beginRunCommandAsync( - String resourceGroupName, String vmName, RunCommandInput parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - runCommandWithResponseAsync(resourceGroupName, vmName, parameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), RunCommandResultInner.class, RunCommandResultInner.class, context); - } - - /** - * Run command on the VM. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Run command operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, RunCommandResultInner> beginRunCommand( - String resourceGroupName, String vmName, RunCommandInput parameters) { - return beginRunCommandAsync(resourceGroupName, vmName, parameters).getSyncPoller(); - } - - /** - * Run command on the VM. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Run command operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, RunCommandResultInner> beginRunCommand( - String resourceGroupName, String vmName, RunCommandInput parameters, Context context) { - return beginRunCommandAsync(resourceGroupName, vmName, parameters, context).getSyncPoller(); - } - - /** - * Run command on the VM. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Run command operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono runCommandAsync( - String resourceGroupName, String vmName, RunCommandInput parameters) { - return beginRunCommandAsync(resourceGroupName, vmName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Run command on the VM. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Run command operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono runCommandAsync( - String resourceGroupName, String vmName, RunCommandInput parameters, Context context) { - return beginRunCommandAsync(resourceGroupName, vmName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Run command on the VM. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Run command operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RunCommandResultInner runCommand(String resourceGroupName, String vmName, RunCommandInput parameters) { - return runCommandAsync(resourceGroupName, vmName, parameters).block(); - } - - /** - * Run command on the VM. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Run command operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RunCommandResultInner runCommand( - String resourceGroupName, String vmName, RunCommandInput parameters, Context context) { - return runCommandAsync(resourceGroupName, vmName, parameters, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Virtual Machine operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByLocationNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByLocationNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Virtual Machine operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByLocationNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByLocationNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Virtual Machine operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Virtual Machine operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Virtual Machine operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAllNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listAllNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Virtual Machine operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAllNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listAllNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachinesImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachinesImpl.java deleted file mode 100644 index 38bf0c02681a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachinesImpl.java +++ /dev/null @@ -1,299 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.compute.implementation; - -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.ComputeManager; -import com.azure.resourcemanager.compute.models.HardwareProfile; -import com.azure.resourcemanager.compute.models.NetworkProfile; -import com.azure.resourcemanager.compute.models.OSDisk; -import com.azure.resourcemanager.compute.models.OSProfile; -import com.azure.resourcemanager.compute.models.RunCommandInput; -import com.azure.resourcemanager.compute.models.RunCommandInputParameter; -import com.azure.resourcemanager.compute.models.RunCommandResult; -import com.azure.resourcemanager.compute.models.StorageProfile; -import com.azure.resourcemanager.compute.models.VirtualMachine; -import com.azure.resourcemanager.compute.models.VirtualMachineCaptureParameters; -import com.azure.resourcemanager.compute.models.VirtualMachineSizes; -import com.azure.resourcemanager.compute.models.VirtualMachines; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineInner; -import com.azure.resourcemanager.compute.fluent.VirtualMachinesClient; -import com.azure.resourcemanager.authorization.AuthorizationManager; -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.TopLevelModifiableResourcesImpl; -import com.azure.resourcemanager.resources.fluentcore.model.Accepted; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.AcceptedImpl; -import com.azure.resourcemanager.storage.StorageManager; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; - -import java.util.ArrayList; -import java.util.List; -import java.util.function.Function; - -import reactor.core.Exceptions; -import reactor.core.publisher.Mono; - -/** The implementation for VirtualMachines. */ -public class VirtualMachinesImpl - extends TopLevelModifiableResourcesImpl< - VirtualMachine, VirtualMachineImpl, VirtualMachineInner, VirtualMachinesClient, ComputeManager> - implements VirtualMachines { - private final StorageManager storageManager; - private final NetworkManager networkManager; - private final AuthorizationManager authorizationManager; - private final VirtualMachineSizesImpl vmSizes; - private final ClientLogger logger = new ClientLogger(VirtualMachinesImpl.class); - - public VirtualMachinesImpl( - ComputeManager computeManager, - StorageManager storageManager, - NetworkManager networkManager, - AuthorizationManager authorizationManager) { - super(computeManager.serviceClient().getVirtualMachines(), computeManager); - this.storageManager = storageManager; - this.networkManager = networkManager; - this.authorizationManager = authorizationManager; - this.vmSizes = new VirtualMachineSizesImpl(computeManager.serviceClient().getVirtualMachineSizes()); - } - - // Actions - - @Override - public VirtualMachine.DefinitionStages.Blank define(String name) { - return wrapModel(name); - } - - @Override - public void deallocate(String groupName, String name) { - this.inner().deallocate(groupName, name); - } - - @Override - public Mono deallocateAsync(String groupName, String name) { - return this.inner().deallocateAsync(groupName, name); - } - - @Override - public void generalize(String groupName, String name) { - this.inner().generalize(groupName, name); - } - - @Override - public Mono generalizeAsync(String groupName, String name) { - return this.inner().generalizeAsync(groupName, name); - } - - @Override - public void powerOff(String groupName, String name) { - this.powerOffAsync(groupName, name).block(); - } - - @Override - public Mono powerOffAsync(String groupName, String name) { - return this.inner().powerOffAsync(groupName, name, null); - } - - @Override - public void restart(String groupName, String name) { - this.inner().restart(groupName, name); - } - - @Override - public Mono restartAsync(String groupName, String name) { - return this.inner().restartAsync(groupName, name); - } - - @Override - public void start(String groupName, String name) { - this.inner().start(groupName, name); - } - - @Override - public Mono startAsync(String groupName, String name) { - return this.inner().startAsync(groupName, name); - } - - @Override - public void redeploy(String groupName, String name) { - this.inner().redeploy(groupName, name); - } - - @Override - public Mono redeployAsync(String groupName, String name) { - return this.inner().redeployAsync(groupName, name); - } - - @Override - public String capture(String groupName, String name, String containerName, String vhdPrefix, boolean overwriteVhd) { - return this.captureAsync(groupName, name, containerName, vhdPrefix, overwriteVhd).block(); - } - - @Override - public Mono captureAsync( - String groupName, String name, String containerName, String vhdPrefix, boolean overwriteVhd) { - VirtualMachineCaptureParameters parameters = new VirtualMachineCaptureParameters(); - parameters.withDestinationContainerName(containerName); - parameters.withOverwriteVhds(overwriteVhd); - parameters.withVhdPrefix(vhdPrefix); - return this - .inner() - .captureAsync(groupName, name, parameters) - .map( - captureResultInner -> { - try { - ObjectMapper mapper = new ObjectMapper(); - return mapper.writeValueAsString(captureResultInner); - } catch (JsonProcessingException ex) { - throw logger.logExceptionAsError(Exceptions.propagate(ex)); - } - }); - } - - @Override - public void migrateToManaged(String groupName, String name) { - this.inner().convertToManagedDisks(groupName, name); - } - - @Override - public Mono migrateToManagedAsync(String groupName, String name) { - return this.inner().convertToManagedDisksAsync(groupName, name); - } - - @Override - public RunCommandResult runPowerShellScript( - String groupName, String name, List scriptLines, List scriptParameters) { - return this.runPowerShellScriptAsync(groupName, name, scriptLines, scriptParameters).block(); - } - - @Override - public Mono runPowerShellScriptAsync( - String groupName, String name, List scriptLines, List scriptParameters) { - RunCommandInput inputCommand = new RunCommandInput(); - inputCommand.withCommandId("RunPowerShellScript"); - inputCommand.withScript(scriptLines); - inputCommand.withParameters(scriptParameters); - return this.runCommandAsync(groupName, name, inputCommand); - } - - @Override - public RunCommandResult runShellScript( - String groupName, String name, List scriptLines, List scriptParameters) { - return this.runShellScriptAsync(groupName, name, scriptLines, scriptParameters).block(); - } - - @Override - public Mono runShellScriptAsync( - String groupName, String name, List scriptLines, List scriptParameters) { - RunCommandInput inputCommand = new RunCommandInput(); - inputCommand.withCommandId("RunShellScript"); - inputCommand.withScript(scriptLines); - inputCommand.withParameters(scriptParameters); - return this.runCommandAsync(groupName, name, inputCommand); - } - - @Override - public RunCommandResult runCommand(String groupName, String name, RunCommandInput inputCommand) { - return this.runCommandAsync(groupName, name, inputCommand).block(); - } - - @Override - public Mono runCommandAsync(String groupName, String name, RunCommandInput inputCommand) { - return this.inner().runCommandAsync(groupName, name, inputCommand).map(RunCommandResultImpl::new); - } - - @Override - public Accepted beginDeleteById(String id) { - return beginDeleteByResourceGroup(ResourceUtils.groupFromResourceId(id), ResourceUtils.nameFromResourceId(id)); - } - - @Override - public Accepted beginDeleteByResourceGroup(String resourceGroupName, String name) { - return AcceptedImpl - .newAccepted( - logger, - this.manager().serviceClient().getHttpPipeline(), - this.manager().serviceClient().getDefaultPollInterval(), - () -> this.inner().deleteWithResponseAsync(resourceGroupName, name, null).block(), - Function.identity(), - Void.class, - null, - Context.NONE); - } - - @Override - public void deleteById(String id, boolean forceDeletion) { - deleteByIdAsync(id, forceDeletion).block(); - } - - @Override - public Mono deleteByIdAsync(String id, boolean forceDeletion) { - return deleteByResourceGroupAsync( - ResourceUtils.groupFromResourceId(id), ResourceUtils.nameFromResourceId(id), forceDeletion); - } - - @Override - public void deleteByResourceGroup(String resourceGroupName, String name, boolean forceDeletion) { - deleteByResourceGroupAsync(resourceGroupName, name, forceDeletion).block(); - } - - @Override - public Mono deleteByResourceGroupAsync(String resourceGroupName, String name, boolean forceDeletion) { - return this.inner().deleteAsync(resourceGroupName, name, forceDeletion); - } - - @Override - public Accepted beginDeleteById(String id, boolean forceDeletion) { - return beginDeleteByResourceGroup( - ResourceUtils.groupFromResourceId(id), ResourceUtils.nameFromResourceId(id), forceDeletion); - } - - @Override - public Accepted beginDeleteByResourceGroup(String resourceGroupName, String name, boolean forceDeletion) { - return AcceptedImpl - .newAccepted( - logger, - this.manager().serviceClient().getHttpPipeline(), - this.manager().serviceClient().getDefaultPollInterval(), - () -> this.inner().deleteWithResponseAsync(resourceGroupName, name, forceDeletion).block(), - Function.identity(), - Void.class, - null, - Context.NONE); - } - - // Getters - @Override - public VirtualMachineSizes sizes() { - return this.vmSizes; - } - - // Helper methods - - @Override - protected VirtualMachineImpl wrapModel(String name) { - VirtualMachineInner inner = new VirtualMachineInner(); - inner.withStorageProfile(new StorageProfile().withOsDisk(new OSDisk()).withDataDisks(new ArrayList<>())); - inner.withOsProfile(new OSProfile()); - inner.withHardwareProfile(new HardwareProfile()); - inner.withNetworkProfile(new NetworkProfile().withNetworkInterfaces(new ArrayList<>())); - return new VirtualMachineImpl( - name, inner, this.manager(), this.storageManager, this.networkManager, this.authorizationManager); - } - - @Override - protected VirtualMachineImpl wrapModel(VirtualMachineInner virtualMachineInner) { - if (virtualMachineInner == null) { - return null; - } - return new VirtualMachineImpl( - virtualMachineInner.name(), - virtualMachineInner, - this.manager(), - this.storageManager, - this.networkManager, - this.authorizationManager); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/WindowsVolumeLegacyEncryptionMonitorImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/WindowsVolumeLegacyEncryptionMonitorImpl.java deleted file mode 100644 index f499c5030334..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/WindowsVolumeLegacyEncryptionMonitorImpl.java +++ /dev/null @@ -1,160 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.implementation; - -import com.azure.resourcemanager.compute.ComputeManager; -import com.azure.resourcemanager.compute.models.DiskEncryptionSettings; -import com.azure.resourcemanager.compute.models.DiskVolumeEncryptionMonitor; -import com.azure.resourcemanager.compute.models.EncryptionStatus; -import com.azure.resourcemanager.compute.models.InstanceViewStatus; -import com.azure.resourcemanager.compute.models.OperatingSystemTypes; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineExtensionInner; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineInner; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; - -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.Map; -import reactor.core.publisher.Mono; - -/** - * The implementation for DiskVolumeEncryptionStatus for Windows virtual machine. This implementation monitor status of - * encrypt-decrypt through legacy encryption extension. - */ -class WindowsVolumeLegacyEncryptionMonitorImpl implements DiskVolumeEncryptionMonitor { - private final String rgName; - private final String vmName; - private final ComputeManager computeManager; - private VirtualMachineExtensionInner encryptionExtension; - private VirtualMachineInner virtualMachine; - - /** - * Creates WindowsVolumeLegacyEncryptionMonitorImpl. - * - * @param virtualMachineId resource id of Windows virtual machine to retrieve encryption status from - * @param computeManager compute manager - */ - WindowsVolumeLegacyEncryptionMonitorImpl(String virtualMachineId, ComputeManager computeManager) { - this.rgName = ResourceUtils.groupFromResourceId(virtualMachineId); - this.vmName = ResourceUtils.nameFromResourceId(virtualMachineId); - this.computeManager = computeManager; - } - - @Override - public OperatingSystemTypes osType() { - return OperatingSystemTypes.WINDOWS; - } - - @Override - public String progressMessage() { - if (!hasEncryptionDetails()) { - return null; - } - return String.format("OSDisk: %s DataDisk: %s", osDiskStatus(), dataDiskStatus()); - } - - @Override - public EncryptionStatus osDiskStatus() { - if (!hasEncryptionDetails()) { - return EncryptionStatus.NOT_ENCRYPTED; - } - if (encryptionExtension.provisioningState() == null) { - return EncryptionStatus.NOT_ENCRYPTED; - } - if (!encryptionExtension.provisioningState().equalsIgnoreCase("Succeeded")) { - return EncryptionStatus.NOT_ENCRYPTED; - } - if (this.virtualMachine.storageProfile() == null - || virtualMachine.storageProfile().osDisk() == null - || virtualMachine.storageProfile().osDisk().encryptionSettings() == null) { - return EncryptionStatus.NOT_ENCRYPTED; - } - DiskEncryptionSettings encryptionSettings = virtualMachine.storageProfile().osDisk().encryptionSettings(); - if (encryptionSettings.diskEncryptionKey() != null - && encryptionSettings.diskEncryptionKey().secretUrl() != null - && ResourceManagerUtils.toPrimitiveBoolean(encryptionSettings.enabled())) { - return EncryptionStatus.ENCRYPTED; - } - return EncryptionStatus.NOT_ENCRYPTED; - } - - @Override - @SuppressWarnings("unchecked") - public EncryptionStatus dataDiskStatus() { - if (!hasEncryptionDetails()) { - return EncryptionStatus.NOT_ENCRYPTED; - } - if (encryptionExtension.provisioningState() == null) { - return EncryptionStatus.NOT_ENCRYPTED; - } - if (!encryptionExtension.provisioningState().equalsIgnoreCase("Succeeded")) { - return EncryptionStatus.NOT_ENCRYPTED; - } - HashMap publicSettings = new LinkedHashMap<>(); - if (encryptionExtension.settings() != null) { - publicSettings = (LinkedHashMap) encryptionExtension.settings(); - } - if (!publicSettings.containsKey("VolumeType") - || publicSettings.get("VolumeType") == null - || ((String) publicSettings.get("VolumeType")).isEmpty() - || ((String) publicSettings.get("VolumeType")).equalsIgnoreCase("All") - || ((String) publicSettings.get("VolumeType")).equalsIgnoreCase("Data")) { - String encryptionOperation = (String) publicSettings.get("EncryptionOperation"); - if (encryptionOperation != null && "EnableEncryption".equalsIgnoreCase(encryptionOperation)) { - return EncryptionStatus.ENCRYPTED; - } - return EncryptionStatus.NOT_ENCRYPTED; - } - return EncryptionStatus.UNKNOWN; - } - - @Override - public Map diskInstanceViewEncryptionStatuses() { - // Not available for legacy based encryption - return new HashMap(); - } - - @Override - public DiskVolumeEncryptionMonitor refresh() { - return refreshAsync().block(); - } - - @Override - public Mono refreshAsync() { - final WindowsVolumeLegacyEncryptionMonitorImpl self = this; - // Refreshes the cached Windows virtual machine and installed encryption extension - return retrieveVirtualMachineAsync() - .map( - virtualMachine -> { - self.virtualMachine = virtualMachine; - if (virtualMachine.resources() != null) { - for (VirtualMachineExtensionInner extension : virtualMachine.resources()) { - if (EncryptionExtensionIdentifier.isEncryptionPublisherName(extension.publisher()) - && EncryptionExtensionIdentifier - .isEncryptionTypeName( - extension.typePropertiesType(), OperatingSystemTypes.WINDOWS)) { - self.encryptionExtension = extension; - break; - } - } - } - return self; - }); - } - - /** - * Retrieve the virtual machine. If the virtual machine does not exists then an error observable will be returned. - * - * @return the retrieved virtual machine - */ - private Mono retrieveVirtualMachineAsync() { - return this.computeManager.serviceClient().getVirtualMachines().getByResourceGroupAsync(rgName, vmName); - // Exception if vm not found - } - - private boolean hasEncryptionDetails() { - return virtualMachine != null && this.encryptionExtension != null; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/WindowsVolumeNoAADEncryptionMonitorImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/WindowsVolumeNoAADEncryptionMonitorImpl.java deleted file mode 100644 index 44f00fa06fe1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/WindowsVolumeNoAADEncryptionMonitorImpl.java +++ /dev/null @@ -1,180 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.implementation; - -import com.azure.resourcemanager.compute.ComputeManager; -import com.azure.resourcemanager.compute.models.DiskInstanceView; -import com.azure.resourcemanager.compute.models.DiskVolumeEncryptionMonitor; -import com.azure.resourcemanager.compute.models.EncryptionStatus; -import com.azure.resourcemanager.compute.models.InstanceViewStatus; -import com.azure.resourcemanager.compute.models.InstanceViewTypes; -import com.azure.resourcemanager.compute.models.OperatingSystemTypes; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineInner; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils; -import reactor.core.publisher.Mono; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.Locale; -import java.util.Map; - -/** - * The implementation for DiskVolumeEncryptionStatus for Windows virtual machine. This implementation monitor status of - * encrypt-decrypt through new NoAAD encryption extension. - */ -class WindowsVolumeNoAADEncryptionMonitorImpl implements DiskVolumeEncryptionMonitor { - private final String rgName; - private final String vmName; - private final ComputeManager computeManager; - private VirtualMachineInner virtualMachine; - - WindowsVolumeNoAADEncryptionMonitorImpl(String virtualMachineId, ComputeManager computeManager) { - this.rgName = ResourceUtils.groupFromResourceId(virtualMachineId); - this.vmName = ResourceUtils.nameFromResourceId(virtualMachineId); - this.computeManager = computeManager; - } - - @Override - public OperatingSystemTypes osType() { - return OperatingSystemTypes.WINDOWS; - } - - @Override - public String progressMessage() { - return String.format("OSDisk: %s DataDisk: %s", osDiskStatus(), dataDiskStatus()); - } - - @Override - public EncryptionStatus osDiskStatus() { - if (virtualMachine.instanceView() == null || virtualMachine.instanceView().disks() == null) { - return EncryptionStatus.UNKNOWN; - } - for (DiskInstanceView diskInstanceView : virtualMachine.instanceView().disks()) { - // encryptionSettings will be set only for OSDisk - if (diskInstanceView.encryptionSettings() != null) { - for (InstanceViewStatus status : diskInstanceView.statuses()) { - EncryptionStatus encryptionStatus = encryptionStatusFromCode(status.code()); - if (encryptionStatus != null) { - return encryptionStatus; - } - } - break; - } - } - return EncryptionStatus.UNKNOWN; - } - - @Override - public EncryptionStatus dataDiskStatus() { - if (virtualMachine.instanceView() == null || virtualMachine.instanceView().disks() == null) { - return EncryptionStatus.UNKNOWN; - } - HashSet encryptStatuses = new HashSet<>(); - for (DiskInstanceView diskInstanceView : virtualMachine.instanceView().disks()) { - // encryptionSettings will be null for data disks and non-null for os disk. - if (diskInstanceView.encryptionSettings() != null) { - continue; - } - for (InstanceViewStatus status : diskInstanceView.statuses()) { - EncryptionStatus encryptionStatus = encryptionStatusFromCode(status.code()); - if (encryptionStatus != null) { - encryptStatuses.add(encryptionStatus); - break; - } - } - } - // Derive an overall encryption status for all data disks. - // -------------- - - if (encryptStatuses.isEmpty()) { - // Zero disks or disks without encryption state status. - return EncryptionStatus.UNKNOWN; - } else if (encryptStatuses.size() == 1) { - // Single item indicate all disks are of the same encryption state. - // - return encryptStatuses.iterator().next(); - } - // - // More than one encryptStatuses indicates multiple disks with different encryption states. - // The precedence is UNKNOWN > NOT_MOUNTED > ENCRYPTION_INPROGRESS > VM_RESTART_PENDING - if (encryptStatuses.contains(EncryptionStatus.UNKNOWN)) { - return EncryptionStatus.UNKNOWN; - } else if (encryptStatuses.contains(EncryptionStatus.NOT_MOUNTED)) { - return EncryptionStatus.NOT_MOUNTED; - } else if (encryptStatuses.contains(EncryptionStatus.ENCRYPTION_INPROGRESS)) { - return EncryptionStatus.ENCRYPTION_INPROGRESS; - } else if (encryptStatuses.contains(EncryptionStatus.VM_RESTART_PENDING)) { - return EncryptionStatus.VM_RESTART_PENDING; - } else { - return EncryptionStatus.UNKNOWN; - } - } - - @Override - public Map diskInstanceViewEncryptionStatuses() { - if (virtualMachine.instanceView() == null || virtualMachine.instanceView().disks() == null) { - return new HashMap<>(); - } - // - HashMap div = new HashMap(); - for (DiskInstanceView diskInstanceView : virtualMachine.instanceView().disks()) { - for (InstanceViewStatus status : diskInstanceView.statuses()) { - if (encryptionStatusFromCode(status.code()) != null) { - div.put(diskInstanceView.name(), status); - break; - } - } - } - return div; - } - - @Override - public DiskVolumeEncryptionMonitor refresh() { - return refreshAsync().block(); - } - - @Override - public Mono refreshAsync() { - final WindowsVolumeNoAADEncryptionMonitorImpl self = this; - // Refreshes the cached virtual machine and installed encryption extension - return retrieveVirtualMachineAsync() - .map( - virtualMachine -> { - self.virtualMachine = virtualMachine; - return self; - }); - } - - /** - * Retrieve the virtual machine. If the virtual machine does not exists then an error observable will be returned. - * - * @return the retrieved virtual machine - */ - private Mono retrieveVirtualMachineAsync() { - return this.computeManager.serviceClient().getVirtualMachines() - .getByResourceGroupAsync(rgName, vmName, InstanceViewTypes.INSTANCE_VIEW); - // Exception if vm not found - } - - /** - * Given disk instance view status code, check whether it is encryption status code if yes map it to - * EncryptionStatus. - * - * @param code the encryption status code - * @return mapped EncryptionStatus if given code is encryption status code, null otherwise. - */ - private static EncryptionStatus encryptionStatusFromCode(String code) { - if (code != null && code.toLowerCase(Locale.ROOT).startsWith("encryptionstate")) { - // e.g. "code": "EncryptionState/encrypted" - // "code": "EncryptionState/notEncrypted" - String[] parts = code.split("/", 2); - if (parts.length != 2) { - return EncryptionStatus.UNKNOWN; - } else { - return EncryptionStatus.fromString(parts[1]); - } - } - return null; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/AccessLevel.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/AccessLevel.java deleted file mode 100644 index 11c0b596c656..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/AccessLevel.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for AccessLevel. */ -public final class AccessLevel extends ExpandableStringEnum { - /** Static value None for AccessLevel. */ - public static final AccessLevel NONE = fromString("None"); - - /** Static value Read for AccessLevel. */ - public static final AccessLevel READ = fromString("Read"); - - /** Static value Write for AccessLevel. */ - public static final AccessLevel WRITE = fromString("Write"); - - /** - * Creates or finds a AccessLevel from its string representation. - * - * @param name a name to look for. - * @return the corresponding AccessLevel. - */ - @JsonCreator - public static AccessLevel fromString(String name) { - return fromString(name, AccessLevel.class); - } - - /** @return known AccessLevel values. */ - public static Collection values() { - return values(AccessLevel.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/AdditionalCapabilities.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/AdditionalCapabilities.java deleted file mode 100644 index ecc0c006e9fd..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/AdditionalCapabilities.java +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Enables or disables a capability on the virtual machine or virtual machine scale set. */ -@Fluent -public final class AdditionalCapabilities { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AdditionalCapabilities.class); - - /* - * The flag that enables or disables a capability to have one or more - * managed data disks with UltraSSD_LRS storage account type on the VM or - * VMSS. Managed disks with storage account type UltraSSD_LRS can be added - * to a virtual machine or virtual machine scale set only if this property - * is enabled. - */ - @JsonProperty(value = "ultraSSDEnabled") - private Boolean ultraSsdEnabled; - - /** - * Get the ultraSsdEnabled property: The flag that enables or disables a capability to have one or more managed data - * disks with UltraSSD_LRS storage account type on the VM or VMSS. Managed disks with storage account type - * UltraSSD_LRS can be added to a virtual machine or virtual machine scale set only if this property is enabled. - * - * @return the ultraSsdEnabled value. - */ - public Boolean ultraSsdEnabled() { - return this.ultraSsdEnabled; - } - - /** - * Set the ultraSsdEnabled property: The flag that enables or disables a capability to have one or more managed data - * disks with UltraSSD_LRS storage account type on the VM or VMSS. Managed disks with storage account type - * UltraSSD_LRS can be added to a virtual machine or virtual machine scale set only if this property is enabled. - * - * @param ultraSsdEnabled the ultraSsdEnabled value to set. - * @return the AdditionalCapabilities object itself. - */ - public AdditionalCapabilities withUltraSsdEnabled(Boolean ultraSsdEnabled) { - this.ultraSsdEnabled = ultraSsdEnabled; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/AdditionalUnattendContent.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/AdditionalUnattendContent.java deleted file mode 100644 index 2d3839b9e8d9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/AdditionalUnattendContent.java +++ /dev/null @@ -1,144 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Specifies additional XML formatted information that can be included in the Unattend.xml file, which is used by - * Windows Setup. Contents are defined by setting name, component name, and the pass in which the content is applied. - */ -@Fluent -public final class AdditionalUnattendContent { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AdditionalUnattendContent.class); - - /* - * The pass name. Currently, the only allowable value is OobeSystem. - */ - @JsonProperty(value = "passName") - private PassNames passName; - - /* - * The component name. Currently, the only allowable value is - * Microsoft-Windows-Shell-Setup. - */ - @JsonProperty(value = "componentName") - private ComponentNames componentName; - - /* - * Specifies the name of the setting to which the content applies. Possible - * values are: FirstLogonCommands and AutoLogon. - */ - @JsonProperty(value = "settingName") - private SettingNames settingName; - - /* - * Specifies the XML formatted content that is added to the unattend.xml - * file for the specified path and component. The XML must be less than 4KB - * and must include the root element for the setting or feature that is - * being inserted. - */ - @JsonProperty(value = "content") - private String content; - - /** - * Get the passName property: The pass name. Currently, the only allowable value is OobeSystem. - * - * @return the passName value. - */ - public PassNames passName() { - return this.passName; - } - - /** - * Set the passName property: The pass name. Currently, the only allowable value is OobeSystem. - * - * @param passName the passName value to set. - * @return the AdditionalUnattendContent object itself. - */ - public AdditionalUnattendContent withPassName(PassNames passName) { - this.passName = passName; - return this; - } - - /** - * Get the componentName property: The component name. Currently, the only allowable value is - * Microsoft-Windows-Shell-Setup. - * - * @return the componentName value. - */ - public ComponentNames componentName() { - return this.componentName; - } - - /** - * Set the componentName property: The component name. Currently, the only allowable value is - * Microsoft-Windows-Shell-Setup. - * - * @param componentName the componentName value to set. - * @return the AdditionalUnattendContent object itself. - */ - public AdditionalUnattendContent withComponentName(ComponentNames componentName) { - this.componentName = componentName; - return this; - } - - /** - * Get the settingName property: Specifies the name of the setting to which the content applies. Possible values - * are: FirstLogonCommands and AutoLogon. - * - * @return the settingName value. - */ - public SettingNames settingName() { - return this.settingName; - } - - /** - * Set the settingName property: Specifies the name of the setting to which the content applies. Possible values - * are: FirstLogonCommands and AutoLogon. - * - * @param settingName the settingName value to set. - * @return the AdditionalUnattendContent object itself. - */ - public AdditionalUnattendContent withSettingName(SettingNames settingName) { - this.settingName = settingName; - return this; - } - - /** - * Get the content property: Specifies the XML formatted content that is added to the unattend.xml file for the - * specified path and component. The XML must be less than 4KB and must include the root element for the setting or - * feature that is being inserted. - * - * @return the content value. - */ - public String content() { - return this.content; - } - - /** - * Set the content property: Specifies the XML formatted content that is added to the unattend.xml file for the - * specified path and component. The XML must be less than 4KB and must include the root element for the setting or - * feature that is being inserted. - * - * @param content the content value to set. - * @return the AdditionalUnattendContent object itself. - */ - public AdditionalUnattendContent withContent(String content) { - this.content = content; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/AggregatedReplicationState.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/AggregatedReplicationState.java deleted file mode 100644 index daa38dc71a8c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/AggregatedReplicationState.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for AggregatedReplicationState. */ -public final class AggregatedReplicationState extends ExpandableStringEnum { - /** Static value Unknown for AggregatedReplicationState. */ - public static final AggregatedReplicationState UNKNOWN = fromString("Unknown"); - - /** Static value InProgress for AggregatedReplicationState. */ - public static final AggregatedReplicationState IN_PROGRESS = fromString("InProgress"); - - /** Static value Completed for AggregatedReplicationState. */ - public static final AggregatedReplicationState COMPLETED = fromString("Completed"); - - /** Static value Failed for AggregatedReplicationState. */ - public static final AggregatedReplicationState FAILED = fromString("Failed"); - - /** - * Creates or finds a AggregatedReplicationState from its string representation. - * - * @param name a name to look for. - * @return the corresponding AggregatedReplicationState. - */ - @JsonCreator - public static AggregatedReplicationState fromString(String name) { - return fromString(name, AggregatedReplicationState.class); - } - - /** @return known AggregatedReplicationState values. */ - public static Collection values() { - return values(AggregatedReplicationState.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ApiEntityReference.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ApiEntityReference.java deleted file mode 100644 index 10a2203e97b7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ApiEntityReference.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The API entity reference. */ -@Fluent -public final class ApiEntityReference { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiEntityReference.class); - - /* - * The ARM resource id in the form of - * /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/... - */ - @JsonProperty(value = "id") - private String id; - - /** - * Get the id property: The ARM resource id in the form of - * /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/... - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: The ARM resource id in the form of - * /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/... - * - * @param id the id value to set. - * @return the ApiEntityReference object itself. - */ - public ApiEntityReference withId(String id) { - this.id = id; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ApiError.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ApiError.java deleted file mode 100644 index db5377979286..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ApiError.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.exception.ManagementError; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Api error. */ -@Immutable -public final class ApiError extends ManagementError { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiError.class); - - /* - * The Api inner error - */ - @JsonProperty(value = "innererror", access = JsonProperty.Access.WRITE_ONLY) - private InnerError innererror; - - /** - * Get the innererror property: The Api inner error. - * - * @return the innererror value. - */ - public InnerError getInnererror() { - return this.innererror; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (getInnererror() != null) { - getInnererror().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ApiErrorException.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ApiErrorException.java deleted file mode 100644 index 7938164e9592..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ApiErrorException.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.http.HttpResponse; -import com.azure.core.management.exception.ManagementException; - -/** Exception thrown for an invalid response with ApiError information. */ -public final class ApiErrorException extends ManagementException { - /** - * Initializes a new instance of the ApiErrorException class. - * - * @param message the exception message or the response content if a message is not available. - * @param response the HTTP response. - */ - public ApiErrorException(String message, HttpResponse response) { - super(message, response); - } - - /** - * Initializes a new instance of the ApiErrorException class. - * - * @param message the exception message or the response content if a message is not available. - * @param response the HTTP response. - * @param value the deserialized response value. - */ - public ApiErrorException(String message, HttpResponse response, ApiError value) { - super(message, response, value); - } - - @Override - public ApiError getValue() { - return (ApiError) super.getValue(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/AutomaticOSUpgradePolicy.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/AutomaticOSUpgradePolicy.java deleted file mode 100644 index ba586ed7de39..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/AutomaticOSUpgradePolicy.java +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The configuration parameters used for performing automatic OS upgrade. */ -@Fluent -public final class AutomaticOSUpgradePolicy { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AutomaticOSUpgradePolicy.class); - - /* - * Indicates whether OS upgrades should automatically be applied to scale - * set instances in a rolling fashion when a newer version of the OS image - * becomes available. Default value is false.

If this is set to - * true for Windows based scale sets, - * [enableAutomaticUpdates](https://docs.microsoft.com/dotnet/api/microsoft.azure.management.compute.models.windowsconfiguration.enableautomaticupdates?view=azure-dotnet) - * is automatically set to false and cannot be set to true. - */ - @JsonProperty(value = "enableAutomaticOSUpgrade") - private Boolean enableAutomaticOSUpgrade; - - /* - * Whether OS image rollback feature should be disabled. Default value is - * false. - */ - @JsonProperty(value = "disableAutomaticRollback") - private Boolean disableAutomaticRollback; - - /** - * Get the enableAutomaticOSUpgrade property: Indicates whether OS upgrades should automatically be applied to scale - * set instances in a rolling fashion when a newer version of the OS image becomes available. Default value is - * false. <br><br> If this is set to true for Windows based scale sets, - * [enableAutomaticUpdates](https://docs.microsoft.com/dotnet/api/microsoft.azure.management.compute.models.windowsconfiguration.enableautomaticupdates?view=azure-dotnet) - * is automatically set to false and cannot be set to true. - * - * @return the enableAutomaticOSUpgrade value. - */ - public Boolean enableAutomaticOSUpgrade() { - return this.enableAutomaticOSUpgrade; - } - - /** - * Set the enableAutomaticOSUpgrade property: Indicates whether OS upgrades should automatically be applied to scale - * set instances in a rolling fashion when a newer version of the OS image becomes available. Default value is - * false. <br><br> If this is set to true for Windows based scale sets, - * [enableAutomaticUpdates](https://docs.microsoft.com/dotnet/api/microsoft.azure.management.compute.models.windowsconfiguration.enableautomaticupdates?view=azure-dotnet) - * is automatically set to false and cannot be set to true. - * - * @param enableAutomaticOSUpgrade the enableAutomaticOSUpgrade value to set. - * @return the AutomaticOSUpgradePolicy object itself. - */ - public AutomaticOSUpgradePolicy withEnableAutomaticOSUpgrade(Boolean enableAutomaticOSUpgrade) { - this.enableAutomaticOSUpgrade = enableAutomaticOSUpgrade; - return this; - } - - /** - * Get the disableAutomaticRollback property: Whether OS image rollback feature should be disabled. Default value is - * false. - * - * @return the disableAutomaticRollback value. - */ - public Boolean disableAutomaticRollback() { - return this.disableAutomaticRollback; - } - - /** - * Set the disableAutomaticRollback property: Whether OS image rollback feature should be disabled. Default value is - * false. - * - * @param disableAutomaticRollback the disableAutomaticRollback value to set. - * @return the AutomaticOSUpgradePolicy object itself. - */ - public AutomaticOSUpgradePolicy withDisableAutomaticRollback(Boolean disableAutomaticRollback) { - this.disableAutomaticRollback = disableAutomaticRollback; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/AutomaticOSUpgradeProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/AutomaticOSUpgradeProperties.java deleted file mode 100644 index 3ac57d067f70..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/AutomaticOSUpgradeProperties.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describes automatic OS upgrade properties on the image. */ -@Fluent -public final class AutomaticOSUpgradeProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AutomaticOSUpgradeProperties.class); - - /* - * Specifies whether automatic OS upgrade is supported on the image. - */ - @JsonProperty(value = "automaticOSUpgradeSupported", required = true) - private boolean automaticOSUpgradeSupported; - - /** - * Get the automaticOSUpgradeSupported property: Specifies whether automatic OS upgrade is supported on the image. - * - * @return the automaticOSUpgradeSupported value. - */ - public boolean automaticOSUpgradeSupported() { - return this.automaticOSUpgradeSupported; - } - - /** - * Set the automaticOSUpgradeSupported property: Specifies whether automatic OS upgrade is supported on the image. - * - * @param automaticOSUpgradeSupported the automaticOSUpgradeSupported value to set. - * @return the AutomaticOSUpgradeProperties object itself. - */ - public AutomaticOSUpgradeProperties withAutomaticOSUpgradeSupported(boolean automaticOSUpgradeSupported) { - this.automaticOSUpgradeSupported = automaticOSUpgradeSupported; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/AutomaticRepairsPolicy.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/AutomaticRepairsPolicy.java deleted file mode 100644 index bd547cd22370..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/AutomaticRepairsPolicy.java +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Specifies the configuration parameters for automatic repairs on the virtual machine scale set. */ -@Fluent -public final class AutomaticRepairsPolicy { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AutomaticRepairsPolicy.class); - - /* - * Specifies whether automatic repairs should be enabled on the virtual - * machine scale set. The default value is false. - */ - @JsonProperty(value = "enabled") - private Boolean enabled; - - /* - * The amount of time for which automatic repairs are suspended due to a - * state change on VM. The grace time starts after the state change has - * completed. This helps avoid premature or accidental repairs. The time - * duration should be specified in ISO 8601 format. The minimum allowed - * grace period is 30 minutes (PT30M), which is also the default value. The - * maximum allowed grace period is 90 minutes (PT90M). - */ - @JsonProperty(value = "gracePeriod") - private String gracePeriod; - - /** - * Get the enabled property: Specifies whether automatic repairs should be enabled on the virtual machine scale set. - * The default value is false. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Specifies whether automatic repairs should be enabled on the virtual machine scale set. - * The default value is false. - * - * @param enabled the enabled value to set. - * @return the AutomaticRepairsPolicy object itself. - */ - public AutomaticRepairsPolicy withEnabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the gracePeriod property: The amount of time for which automatic repairs are suspended due to a state change - * on VM. The grace time starts after the state change has completed. This helps avoid premature or accidental - * repairs. The time duration should be specified in ISO 8601 format. The minimum allowed grace period is 30 minutes - * (PT30M), which is also the default value. The maximum allowed grace period is 90 minutes (PT90M). - * - * @return the gracePeriod value. - */ - public String gracePeriod() { - return this.gracePeriod; - } - - /** - * Set the gracePeriod property: The amount of time for which automatic repairs are suspended due to a state change - * on VM. The grace time starts after the state change has completed. This helps avoid premature or accidental - * repairs. The time duration should be specified in ISO 8601 format. The minimum allowed grace period is 30 minutes - * (PT30M), which is also the default value. The maximum allowed grace period is 90 minutes (PT90M). - * - * @param gracePeriod the gracePeriod value to set. - * @return the AutomaticRepairsPolicy object itself. - */ - public AutomaticRepairsPolicy withGracePeriod(String gracePeriod) { - this.gracePeriod = gracePeriod; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/AvailabilitySet.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/AvailabilitySet.java deleted file mode 100644 index 09d9715e0446..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/AvailabilitySet.java +++ /dev/null @@ -1,173 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.compute.ComputeManager; -import com.azure.resourcemanager.compute.fluent.models.AvailabilitySetInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.GroupableResource; -import com.azure.resourcemanager.resources.fluentcore.arm.models.Resource; -import com.azure.resourcemanager.resources.fluentcore.model.Appliable; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; -import com.azure.resourcemanager.resources.fluentcore.model.Updatable; -import java.util.List; -import java.util.Set; - -/** An immutable client-side representation of an Azure availability set. */ -@Fluent -public interface AvailabilitySet - extends GroupableResource, - Refreshable, - Updatable { - - /** @return the update domain count of this availability set */ - int updateDomainCount(); - - /** @return the fault domain count of this availability set */ - int faultDomainCount(); - - /** @return the availability set SKU */ - AvailabilitySetSkuTypes sku(); - - /** @return the resource IDs of the virtual machines in the availability set */ - Set virtualMachineIds(); - - /** - * Get specifies information about the proximity placement group that the virtual machine scale set should be - * assigned to. - * - * @return the proximityPlacementGroup. - */ - ProximityPlacementGroup proximityPlacementGroup(); - - /** @return the statuses of the existing virtual machines in the availability set */ - List statuses(); - - /** @return the virtual machine sizes supported in the availability set */ - PagedIterable listVirtualMachineSizes(); - - // Fluent interfaces - - /** Container interface for all the definitions related to an availability set. */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { - } - - /** Grouping of availability set definition stages. */ - interface DefinitionStages { - /** The first stage of an availability set definition. */ - interface Blank extends GroupableResource.DefinitionWithRegion { - } - - /** The stage of the availability set definition allowing to specify the resource group. */ - interface WithGroup extends GroupableResource.DefinitionStages.WithGroup { - } - - /** The stage of the availability set definition allowing to specify the update domain count. */ - interface WithUpdateDomainCount { - /** - * Specifies the update domain count for the availability set. - * - * @param updateDomainCount update domain count - * @return the next stage of the definition - */ - WithCreate withUpdateDomainCount(int updateDomainCount); - } - - /** The stage of the availability set definition allowing to specify the fault domain count. */ - interface WithFaultDomainCount { - /** - * Specifies the fault domain count for the availability set. - * - * @param faultDomainCount the fault domain count - * @return the next stage of the definition - */ - WithCreate withFaultDomainCount(int faultDomainCount); - } - - /** The stage of the availability set definition allowing enable or disable for managed disk. */ - interface WithSku { - /** - * Specifies the SKU type for the availability set. - * - * @param skuType the sku type - * @return the next stage of the definition - */ - WithCreate withSku(AvailabilitySetSkuTypes skuType); - } - - /** The stage of the availability set definition setting ProximityPlacementGroup. */ - interface WithProximityPlacementGroup { - /** - * Set information about the proximity placement group that the availability set should be assigned to. - * - * @param promixityPlacementGroupId The Id of the proximity placement group subResource. - * @return the next stage of the definition. - */ - WithCreate withProximityPlacementGroup(String promixityPlacementGroupId); - - /** - * Creates a new proximity placement gruup witht he specified name and then adds it to the availability set. - * - * @param proximityPlacementGroupName The name of the group to be created. - * @param type the type of the group - * @return the next stage of the definition. - */ - WithCreate withNewProximityPlacementGroup( - String proximityPlacementGroupName, ProximityPlacementGroupType type); - } - - /** - * The stage of an availability set definition which contains all the minimum required inputs for the resource - * to be created but also allows for any other optional settings to be specified. - */ - interface WithCreate - extends Creatable, - Resource.DefinitionWithTags, - WithUpdateDomainCount, - WithFaultDomainCount, - WithSku, - WithProximityPlacementGroup { - } - } - - /** Grouping of availability set update stages. */ - interface UpdateStages { - /** The stage of the availability set definition allowing to specify SKU. */ - interface WithSku { - /** - * Specifies the SKU type for the availability set. - * - * @param skuType the SKU type - * @return the next stage of the definition - */ - Update withSku(AvailabilitySetSkuTypes skuType); - } - - /** The stage of the availability set definition setting ProximityPlacementGroup. */ - interface WithProximityPlacementGroup { - /** - * Set information about the proximity placement group that the availability set should be assigned to. - * - * @param promixityPlacementGroupId The Id of the proximity placement group subResource. - * @return the next stage of the definition. - */ - Update withProximityPlacementGroup(String promixityPlacementGroupId); - - /** - * Remove the proximity placement group from the availability set. - * - * @return the next stage of the definition. - */ - Update withoutProximityPlacementGroup(); - } - } - /** The template for an availability set update operation, containing all the settings that can be modified. */ - interface Update - extends Appliable, - Resource.UpdateWithTags, - UpdateStages.WithSku, - UpdateStages.WithProximityPlacementGroup { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/AvailabilitySetListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/AvailabilitySetListResult.java deleted file mode 100644 index 0d8edfa0e81f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/AvailabilitySetListResult.java +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.fluent.models.AvailabilitySetInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The List Availability Set operation response. */ -@Fluent -public final class AvailabilitySetListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailabilitySetListResult.class); - - /* - * The list of availability sets - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * The URI to fetch the next page of AvailabilitySets. Call ListNext() with - * this URI to fetch the next page of AvailabilitySets. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: The list of availability sets. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The list of availability sets. - * - * @param value the value value to set. - * @return the AvailabilitySetListResult object itself. - */ - public AvailabilitySetListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URI to fetch the next page of AvailabilitySets. Call ListNext() with this URI to - * fetch the next page of AvailabilitySets. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The URI to fetch the next page of AvailabilitySets. Call ListNext() with this URI to - * fetch the next page of AvailabilitySets. - * - * @param nextLink the nextLink value to set. - * @return the AvailabilitySetListResult object itself. - */ - public AvailabilitySetListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model AvailabilitySetListResult")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/AvailabilitySetSkuTypes.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/AvailabilitySetSkuTypes.java deleted file mode 100644 index d64fba735c5f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/AvailabilitySetSkuTypes.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for AvailabilitySetSkuTypes. */ -public final class AvailabilitySetSkuTypes extends ExpandableStringEnum { - /** Static value Classic for AvailabilitySetSkuTypes. */ - public static final AvailabilitySetSkuTypes CLASSIC = fromString("Classic"); - - /** Static value Aligned for AvailabilitySetSkuTypes. */ - public static final AvailabilitySetSkuTypes ALIGNED = fromString("Aligned"); - - /** - * Creates or finds a AvailabilitySetSkuTypes from its string representation. - * - * @param name a name to look for. - * @return the corresponding AvailabilitySetSkuTypes. - */ - @JsonCreator - public static AvailabilitySetSkuTypes fromString(String name) { - return fromString(name, AvailabilitySetSkuTypes.class); - } - - /** @return known AvailabilitySetSkuTypes values. */ - public static Collection values() { - return values(AvailabilitySetSkuTypes.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/AvailabilitySetUpdate.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/AvailabilitySetUpdate.java deleted file mode 100644 index 5090f3fa87fd..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/AvailabilitySetUpdate.java +++ /dev/null @@ -1,190 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.fluent.models.AvailabilitySetProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** - * Specifies information about the availability set that the virtual machine should be assigned to. Only tags may be - * updated. - */ -@Fluent -public final class AvailabilitySetUpdate extends UpdateResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailabilitySetUpdate.class); - - /* - * The instance view of a resource. - */ - @JsonProperty(value = "properties") - private AvailabilitySetProperties innerProperties; - - /* - * Sku of the availability set - */ - @JsonProperty(value = "sku") - private Sku sku; - - /** - * Get the innerProperties property: The instance view of a resource. - * - * @return the innerProperties value. - */ - private AvailabilitySetProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the sku property: Sku of the availability set. - * - * @return the sku value. - */ - public Sku sku() { - return this.sku; - } - - /** - * Set the sku property: Sku of the availability set. - * - * @param sku the sku value to set. - * @return the AvailabilitySetUpdate object itself. - */ - public AvailabilitySetUpdate withSku(Sku sku) { - this.sku = sku; - return this; - } - - /** {@inheritDoc} */ - @Override - public AvailabilitySetUpdate withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the platformUpdateDomainCount property: Update Domain count. - * - * @return the platformUpdateDomainCount value. - */ - public Integer platformUpdateDomainCount() { - return this.innerProperties() == null ? null : this.innerProperties().platformUpdateDomainCount(); - } - - /** - * Set the platformUpdateDomainCount property: Update Domain count. - * - * @param platformUpdateDomainCount the platformUpdateDomainCount value to set. - * @return the AvailabilitySetUpdate object itself. - */ - public AvailabilitySetUpdate withPlatformUpdateDomainCount(Integer platformUpdateDomainCount) { - if (this.innerProperties() == null) { - this.innerProperties = new AvailabilitySetProperties(); - } - this.innerProperties().withPlatformUpdateDomainCount(platformUpdateDomainCount); - return this; - } - - /** - * Get the platformFaultDomainCount property: Fault Domain count. - * - * @return the platformFaultDomainCount value. - */ - public Integer platformFaultDomainCount() { - return this.innerProperties() == null ? null : this.innerProperties().platformFaultDomainCount(); - } - - /** - * Set the platformFaultDomainCount property: Fault Domain count. - * - * @param platformFaultDomainCount the platformFaultDomainCount value to set. - * @return the AvailabilitySetUpdate object itself. - */ - public AvailabilitySetUpdate withPlatformFaultDomainCount(Integer platformFaultDomainCount) { - if (this.innerProperties() == null) { - this.innerProperties = new AvailabilitySetProperties(); - } - this.innerProperties().withPlatformFaultDomainCount(platformFaultDomainCount); - return this; - } - - /** - * Get the virtualMachines property: A list of references to all virtual machines in the availability set. - * - * @return the virtualMachines value. - */ - public List virtualMachines() { - return this.innerProperties() == null ? null : this.innerProperties().virtualMachines(); - } - - /** - * Set the virtualMachines property: A list of references to all virtual machines in the availability set. - * - * @param virtualMachines the virtualMachines value to set. - * @return the AvailabilitySetUpdate object itself. - */ - public AvailabilitySetUpdate withVirtualMachines(List virtualMachines) { - if (this.innerProperties() == null) { - this.innerProperties = new AvailabilitySetProperties(); - } - this.innerProperties().withVirtualMachines(virtualMachines); - return this; - } - - /** - * Get the proximityPlacementGroup property: Specifies information about the proximity placement group that the - * availability set should be assigned to. <br><br>Minimum api-version: 2018-04-01. - * - * @return the proximityPlacementGroup value. - */ - public SubResource proximityPlacementGroup() { - return this.innerProperties() == null ? null : this.innerProperties().proximityPlacementGroup(); - } - - /** - * Set the proximityPlacementGroup property: Specifies information about the proximity placement group that the - * availability set should be assigned to. <br><br>Minimum api-version: 2018-04-01. - * - * @param proximityPlacementGroup the proximityPlacementGroup value to set. - * @return the AvailabilitySetUpdate object itself. - */ - public AvailabilitySetUpdate withProximityPlacementGroup(SubResource proximityPlacementGroup) { - if (this.innerProperties() == null) { - this.innerProperties = new AvailabilitySetProperties(); - } - this.innerProperties().withProximityPlacementGroup(proximityPlacementGroup); - return this; - } - - /** - * Get the statuses property: The resource status information. - * - * @return the statuses value. - */ - public List statuses() { - return this.innerProperties() == null ? null : this.innerProperties().statuses(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - if (sku() != null) { - sku().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/AvailabilitySets.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/AvailabilitySets.java deleted file mode 100644 index 442c45f6f69f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/AvailabilitySets.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.compute.ComputeManager; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsDeletingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsListingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsBatchCreation; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsCreating; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingById; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; - -/** Entry point to availability set management API. */ -@Fluent -public interface AvailabilitySets - extends SupportsListingByResourceGroup, - SupportsGettingByResourceGroup, - SupportsGettingById, - SupportsListing, - SupportsCreating, - SupportsDeletingById, - SupportsDeletingByResourceGroup, - SupportsBatchCreation, - HasManager { -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/AvailablePatchSummary.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/AvailablePatchSummary.java deleted file mode 100644 index 48cc5521bbe6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/AvailablePatchSummary.java +++ /dev/null @@ -1,160 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** Describes the properties of an virtual machine instance view for available patch summary. */ -@Immutable -public final class AvailablePatchSummary { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailablePatchSummary.class); - - /* - * The overall success or failure status of the operation. It remains - * "InProgress" until the operation completes. At that point it will become - * "Failed", "Succeeded", or "CompletedWithWarnings." - */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) - private PatchOperationStatus status; - - /* - * The activity ID of the operation that produced this result. It is used - * to correlate across CRP and extension logs. - */ - @JsonProperty(value = "assessmentActivityId", access = JsonProperty.Access.WRITE_ONLY) - private String assessmentActivityId; - - /* - * The overall reboot status of the VM. It will be true when partially - * installed patches require a reboot to complete installation but the - * reboot has not yet occurred. - */ - @JsonProperty(value = "rebootPending", access = JsonProperty.Access.WRITE_ONLY) - private Boolean rebootPending; - - /* - * The number of critical or security patches that have been detected as - * available and not yet installed. - */ - @JsonProperty(value = "criticalAndSecurityPatchCount", access = JsonProperty.Access.WRITE_ONLY) - private Integer criticalAndSecurityPatchCount; - - /* - * The number of all available patches excluding critical and security. - */ - @JsonProperty(value = "otherPatchCount", access = JsonProperty.Access.WRITE_ONLY) - private Integer otherPatchCount; - - /* - * The UTC timestamp when the operation began. - */ - @JsonProperty(value = "startTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime startTime; - - /* - * The UTC timestamp when the operation began. - */ - @JsonProperty(value = "lastModifiedTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime lastModifiedTime; - - /* - * The errors that were encountered during execution of the operation. The - * details array contains the list of them. - */ - @JsonProperty(value = "error", access = JsonProperty.Access.WRITE_ONLY) - private ApiError error; - - /** - * Get the status property: The overall success or failure status of the operation. It remains "InProgress" until - * the operation completes. At that point it will become "Failed", "Succeeded", or "CompletedWithWarnings.". - * - * @return the status value. - */ - public PatchOperationStatus status() { - return this.status; - } - - /** - * Get the assessmentActivityId property: The activity ID of the operation that produced this result. It is used to - * correlate across CRP and extension logs. - * - * @return the assessmentActivityId value. - */ - public String assessmentActivityId() { - return this.assessmentActivityId; - } - - /** - * Get the rebootPending property: The overall reboot status of the VM. It will be true when partially installed - * patches require a reboot to complete installation but the reboot has not yet occurred. - * - * @return the rebootPending value. - */ - public Boolean rebootPending() { - return this.rebootPending; - } - - /** - * Get the criticalAndSecurityPatchCount property: The number of critical or security patches that have been - * detected as available and not yet installed. - * - * @return the criticalAndSecurityPatchCount value. - */ - public Integer criticalAndSecurityPatchCount() { - return this.criticalAndSecurityPatchCount; - } - - /** - * Get the otherPatchCount property: The number of all available patches excluding critical and security. - * - * @return the otherPatchCount value. - */ - public Integer otherPatchCount() { - return this.otherPatchCount; - } - - /** - * Get the startTime property: The UTC timestamp when the operation began. - * - * @return the startTime value. - */ - public OffsetDateTime startTime() { - return this.startTime; - } - - /** - * Get the lastModifiedTime property: The UTC timestamp when the operation began. - * - * @return the lastModifiedTime value. - */ - public OffsetDateTime lastModifiedTime() { - return this.lastModifiedTime; - } - - /** - * Get the error property: The errors that were encountered during execution of the operation. The details array - * contains the list of them. - * - * @return the error value. - */ - public ApiError error() { - return this.error; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (error() != null) { - error().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/BillingProfile.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/BillingProfile.java deleted file mode 100644 index 9994c9c2f992..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/BillingProfile.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Specifies the billing related details of a Azure Spot VM or VMSS. <br><br>Minimum api-version: - * 2019-03-01. - */ -@Fluent -public final class BillingProfile { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BillingProfile.class); - - /* - * Specifies the maximum price you are willing to pay for a Azure Spot - * VM/VMSS. This price is in US Dollars.

This price will be - * compared with the current Azure Spot price for the VM size. Also, the - * prices are compared at the time of create/update of Azure Spot VM/VMSS - * and the operation will only succeed if the maxPrice is greater than the - * current Azure Spot price.

The maxPrice will also be used for - * evicting a Azure Spot VM/VMSS if the current Azure Spot price goes - * beyond the maxPrice after creation of VM/VMSS.

Possible values - * are:

- Any decimal value greater than zero. Example: 0.01538 - *

-1 – indicates default price to be up-to on-demand.

- * You can set the maxPrice to -1 to indicate that the Azure Spot VM/VMSS - * should not be evicted for price reasons. Also, the default max price is - * -1 if it is not provided by you.

Minimum api-version: - * 2019-03-01. - */ - @JsonProperty(value = "maxPrice") - private Double maxPrice; - - /** - * Get the maxPrice property: Specifies the maximum price you are willing to pay for a Azure Spot VM/VMSS. This - * price is in US Dollars. <br><br> This price will be compared with the current Azure Spot price for - * the VM size. Also, the prices are compared at the time of create/update of Azure Spot VM/VMSS and the operation - * will only succeed if the maxPrice is greater than the current Azure Spot price. <br><br> The maxPrice - * will also be used for evicting a Azure Spot VM/VMSS if the current Azure Spot price goes beyond the maxPrice - * after creation of VM/VMSS. <br><br> Possible values are: <br><br> - Any decimal value - * greater than zero. Example: 0.01538 <br><br> -1 – indicates default price to be up-to on-demand. - * <br><br> You can set the maxPrice to -1 to indicate that the Azure Spot VM/VMSS should not be evicted - * for price reasons. Also, the default max price is -1 if it is not provided by you. <br><br>Minimum - * api-version: 2019-03-01. - * - * @return the maxPrice value. - */ - public Double maxPrice() { - return this.maxPrice; - } - - /** - * Set the maxPrice property: Specifies the maximum price you are willing to pay for a Azure Spot VM/VMSS. This - * price is in US Dollars. <br><br> This price will be compared with the current Azure Spot price for - * the VM size. Also, the prices are compared at the time of create/update of Azure Spot VM/VMSS and the operation - * will only succeed if the maxPrice is greater than the current Azure Spot price. <br><br> The maxPrice - * will also be used for evicting a Azure Spot VM/VMSS if the current Azure Spot price goes beyond the maxPrice - * after creation of VM/VMSS. <br><br> Possible values are: <br><br> - Any decimal value - * greater than zero. Example: 0.01538 <br><br> -1 – indicates default price to be up-to on-demand. - * <br><br> You can set the maxPrice to -1 to indicate that the Azure Spot VM/VMSS should not be evicted - * for price reasons. Also, the default max price is -1 if it is not provided by you. <br><br>Minimum - * api-version: 2019-03-01. - * - * @param maxPrice the maxPrice value to set. - * @return the BillingProfile object itself. - */ - public BillingProfile withMaxPrice(Double maxPrice) { - this.maxPrice = maxPrice; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/BootDiagnostics.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/BootDiagnostics.java deleted file mode 100644 index aee80b9d1cc1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/BootDiagnostics.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * 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. - */ -@Fluent -public final class BootDiagnostics { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BootDiagnostics.class); - - /* - * Whether boot diagnostics should be enabled on the Virtual Machine. - */ - @JsonProperty(value = "enabled") - private Boolean enabled; - - /* - * Uri of the storage account to use for placing the console output and - * screenshot.

If storageUri is not specified while enabling boot - * diagnostics, managed storage will be used. - */ - @JsonProperty(value = "storageUri") - private String storageUri; - - /** - * Get the enabled property: Whether boot diagnostics should be enabled on the Virtual Machine. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Whether boot diagnostics should be enabled on the Virtual Machine. - * - * @param enabled the enabled value to set. - * @return the BootDiagnostics object itself. - */ - public BootDiagnostics withEnabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the storageUri property: 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. - * - * @return the storageUri value. - */ - public String storageUri() { - return this.storageUri; - } - - /** - * Set the storageUri property: 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. - * - * @param storageUri the storageUri value to set. - * @return the BootDiagnostics object itself. - */ - public BootDiagnostics withStorageUri(String storageUri) { - this.storageUri = storageUri; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/BootDiagnosticsInstanceView.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/BootDiagnosticsInstanceView.java deleted file mode 100644 index 85409dbf2aad..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/BootDiagnosticsInstanceView.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The instance view of a virtual machine boot diagnostics. */ -@Immutable -public final class BootDiagnosticsInstanceView { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BootDiagnosticsInstanceView.class); - - /* - * The console screenshot blob URI.

NOTE: This will **not** be set - * if boot diagnostics is currently enabled with managed storage. - */ - @JsonProperty(value = "consoleScreenshotBlobUri", access = JsonProperty.Access.WRITE_ONLY) - private String consoleScreenshotBlobUri; - - /* - * The serial console log blob Uri.

NOTE: This will **not** be set - * if boot diagnostics is currently enabled with managed storage. - */ - @JsonProperty(value = "serialConsoleLogBlobUri", access = JsonProperty.Access.WRITE_ONLY) - private String serialConsoleLogBlobUri; - - /* - * The boot diagnostics status information for the VM.

NOTE: It - * will be set only if there are errors encountered in enabling boot - * diagnostics. - */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) - private InstanceViewStatus status; - - /** - * Get the consoleScreenshotBlobUri property: The console screenshot blob URI. <br><br>NOTE: This will - * **not** be set if boot diagnostics is currently enabled with managed storage. - * - * @return the consoleScreenshotBlobUri value. - */ - public String consoleScreenshotBlobUri() { - return this.consoleScreenshotBlobUri; - } - - /** - * Get the serialConsoleLogBlobUri property: The serial console log blob Uri. <br><br>NOTE: This will - * **not** be set if boot diagnostics is currently enabled with managed storage. - * - * @return the serialConsoleLogBlobUri value. - */ - public String serialConsoleLogBlobUri() { - return this.serialConsoleLogBlobUri; - } - - /** - * Get the status property: The boot diagnostics status information for the VM. <br><br> NOTE: It will - * be set only if there are errors encountered in enabling boot diagnostics. - * - * @return the status value. - */ - public InstanceViewStatus status() { - return this.status; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (status() != null) { - status().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/CachingTypes.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/CachingTypes.java deleted file mode 100644 index 700599110b74..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/CachingTypes.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for CachingTypes. */ -public enum CachingTypes { - /** Enum value None. */ - NONE("None"), - - /** Enum value ReadOnly. */ - READ_ONLY("ReadOnly"), - - /** Enum value ReadWrite. */ - READ_WRITE("ReadWrite"); - - /** The actual serialized value for a CachingTypes instance. */ - private final String value; - - CachingTypes(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a CachingTypes instance. - * - * @param value the serialized value to parse. - * @return the parsed CachingTypes object, or null if unable to parse. - */ - @JsonCreator - public static CachingTypes fromString(String value) { - CachingTypes[] items = CachingTypes.values(); - for (CachingTypes item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ComponentNames.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ComponentNames.java deleted file mode 100644 index e614d833311b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ComponentNames.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for ComponentNames. */ -public enum ComponentNames { - /** Enum value Microsoft-Windows-Shell-Setup. */ - MICROSOFT_WINDOWS_SHELL_SETUP("Microsoft-Windows-Shell-Setup"); - - /** The actual serialized value for a ComponentNames instance. */ - private final String value; - - ComponentNames(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a ComponentNames instance. - * - * @param value the serialized value to parse. - * @return the parsed ComponentNames object, or null if unable to parse. - */ - @JsonCreator - public static ComponentNames fromString(String value) { - ComponentNames[] items = ComponentNames.values(); - for (ComponentNames item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ComputeOperationListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ComputeOperationListResult.java deleted file mode 100644 index 668b928cdc7e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ComputeOperationListResult.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.fluent.models.ComputeOperationValueInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The List Compute Operation operation response. */ -@Immutable -public final class ComputeOperationListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ComputeOperationListResult.class); - - /* - * The list of compute operations - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /** - * Get the value property: The list of compute operations. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ComputeResourceType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ComputeResourceType.java deleted file mode 100644 index 5b1262d0812d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ComputeResourceType.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.ExpandableStringEnum; - -import java.util.Collection; - -/** Compute resource types. */ -@Fluent -public class ComputeResourceType extends ExpandableStringEnum { - /** Static value availabilitySets for ComputeResourceType. */ - public static final ComputeResourceType AVAILABILITYSETS = fromString("availabilitySets"); - /** Static value disks for ComputeResourceType. */ - public static final ComputeResourceType DISKS = fromString("disks"); - /** Static value snapshots for ComputeResourceType. */ - public static final ComputeResourceType SNAPSHOTS = fromString("snapshots"); - /** Static value virtualMachines for ComputeResourceType. */ - public static final ComputeResourceType VIRTUALMACHINES = fromString("virtualMachines"); - - /** - * Finds or creates compute resource type based on the specified string. - * - * @param str the compute resource type in string format - * @return an instance of ComputeResourceType - */ - public static ComputeResourceType fromString(String str) { - return fromString(str, ComputeResourceType.class); - } - - /** @return known compute resource types */ - public static Collection values() { - return values(ComputeResourceType.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ComputeRoles.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ComputeRoles.java deleted file mode 100644 index 040a994c85f9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ComputeRoles.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.compute.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for ComputeRoles. */ -public enum ComputeRoles { - /** Enum value PaaS. */ - PAAS("PaaS"), - - /** Enum value IaaS. */ - IAAS("IaaS"); - - /** The actual serialized value for a ComputeRoles instance. */ - private String value; - - ComputeRoles(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a ComputeRoles instance. - * - * @param value the serialized value to parse. - * @return the parsed ComputeRoles object, or null if unable to parse. - */ - @JsonCreator - public static ComputeRoles fromString(String value) { - ComputeRoles[] items = ComputeRoles.values(); - for (ComputeRoles item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ComputeSku.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ComputeSku.java deleted file mode 100644 index 6c9b79fa49b8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ComputeSku.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.compute.fluent.models.ResourceSkuInner; -import com.azure.resourcemanager.resources.fluentcore.arm.AvailabilityZoneId; -import com.azure.core.management.Region; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import java.util.List; -import java.util.Map; -import java.util.Set; - -/** Type representing sku for an Azure compute resource. */ -@Fluent -public interface ComputeSku extends HasInnerModel { - /** @return the sku name */ - ComputeSkuName name(); - /** @return the sku tier */ - ComputeSkuTier tier(); - /** @return the compute resource type that the sku describes */ - ComputeResourceType resourceType(); - /** - * The virtual machine size type if the sku describes sku for virtual machine resource type. - * - *

The size can be used for {@link VirtualMachine.DefinitionStages.WithVMSize#withSize(VirtualMachineSizeTypes)} - * and {@link VirtualMachine.Update#withSize(VirtualMachineSizeTypes)}. - * - * @return the virtual machine size type - */ - VirtualMachineSizeTypes virtualMachineSizeType(); - /** - * The managed disk or snapshot sku type if the sku describes sku for disk or snapshot resource type. - * - *

The sku type can be used for {@link Disk.DefinitionStages.WithSku#withSku(DiskSkuTypes)}, {@link - * Disk.UpdateStages.WithSku#withSku(DiskSkuTypes)}. - * - * @return the managed disk or snapshot sku type - */ - DiskSkuTypes diskSkuType(); - /** - * The availability set sku type if the sku describes sku for availability set resource type. - * - *

The sku type can be used for {@link AvailabilitySet.DefinitionStages.WithSku#withSku(AvailabilitySetSkuTypes)} - * and {@link AvailabilitySet.UpdateStages.WithSku#withSku(AvailabilitySetSkuTypes)}. - * - * @return the availability set sku type - */ - AvailabilitySetSkuTypes availabilitySetSkuType(); - /** @return the regions that the sku is available */ - List regions(); - /** @return the availability zones supported for this sku, index by region */ - Map> zones(); - /** @return the scaling information of the sku */ - ResourceSkuCapacity capacity(); - /** @return the api versions that this sku supports */ - List apiVersions(); - /** @return the metadata for querying the sku pricing information */ - List costs(); - /** @return the capabilities of the sku */ - List capabilities(); - /** @return the restrictions because of which SKU cannot be used */ - List restrictions(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ComputeSkuName.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ComputeSkuName.java deleted file mode 100644 index 21ff7dc84e58..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ComputeSkuName.java +++ /dev/null @@ -1,393 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.ExpandableStringEnum; - -import java.util.Collection; - -/** Compute resource sku names. */ -@Fluent -public class ComputeSkuName extends ExpandableStringEnum { - /** Static value Standard_F32s_v2 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_F32S_V2 = fromString("Standard_F32s_v2"); - /** Static value Standard_DS2_v2 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_DS2_V2 = fromString("Standard_DS2_v2"); - /** Static value Standard_H16r for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_H16R = fromString("Standard_H16r"); - /** Static value Standard_H16m for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_H16M = fromString("Standard_H16m"); - /** Static value Standard_D1 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_D1 = fromString("Standard_D1"); - /** Static value Standard_F16s_v2 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_F16S_V2 = fromString("Standard_F16s_v2"); - /** Static value Standard_DS5_v2_Promo for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_DS5_V2_PROMO = fromString("Standard_DS5_v2_Promo"); - /** Static value Standard_E4s_v3 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_E4S_V3 = fromString("Standard_E4s_v3"); - /** Static value Standard_D1_v2 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_D1_V2 = fromString("Standard_D1_v2"); - /** Static value Standard_DS12_v2_Promo for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_DS12_V2_PROMO = fromString("Standard_DS12_v2_Promo"); - /** Static value Standard_D64s_v3 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_D64S_V3 = fromString("Standard_D64s_v3"); - /** Static value Standard_M128-32ms for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_M128_32MS = fromString("Standard_M128-32ms"); - /** Static value Standard_D4 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_D4 = fromString("Standard_D4"); - /** Static value Standard_D3 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_D3 = fromString("Standard_D3"); - /** Static value Standard_D2 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_D2 = fromString("Standard_D2"); - /** Static value Standard_M128s for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_M128S = fromString("Standard_M128s"); - /** Static value Standard_D4s_v3 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_D4S_V3 = fromString("Standard_D4s_v3"); - /** Static value Standard_F2s_v2 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_F2S_V2 = fromString("Standard_F2s_v2"); - /** Static value Standard_F1s for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_F1S = fromString("Standard_F1s"); - /** Static value Standard_A8m_v2 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_A8M_V2 = fromString("Standard_A8m_v2"); - /** Static value Standard_NC24 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_NC24 = fromString("Standard_NC24"); - /** Static value Standard_B1s for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_B1S = fromString("Standard_B1s"); - /** Static value Standard_E2s_v3 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_E2S_V3 = fromString("Standard_E2s_v3"); - /** Static value Standard_D8s_v3 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_D8S_V3 = fromString("Standard_D8s_v3"); - /** Static value Standard_DS14_v2 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_DS14_V2 = fromString("Standard_DS14_v2"); - /** Static value Standard_H16mr for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_H16MR = fromString("Standard_H16mr"); - /** Static value Standard_DS13_v2_Promo for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_DS13_V2_PROMO = fromString("Standard_DS13_v2_Promo"); - /** Static value Standard_ND12s for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_ND12S = fromString("Standard_ND12s"); - /** Static value Standard_DS5_v2 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_DS5_V2 = fromString("Standard_DS5_v2"); - /** Static value Standard_D15_v2 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_D15_V2 = fromString("Standard_D15_v2"); - /** Static value Standard_ND24s for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_ND24S = fromString("Standard_ND24s"); - /** Static value Standard_F4s_v2 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_F4S_V2 = fromString("Standard_F4s_v2"); - /** Static value Standard_GS5-16 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_GS5_16 = fromString("Standard_GS5-16"); - /** Static value Standard_F2s for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_F2S = fromString("Standard_F2s"); - /** Static value Standard_B2ms for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_B2MS = fromString("Standard_B2ms"); - /** Static value Standard_B2s for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_B2S = fromString("Standard_B2s"); - /** Static value Standard_E2_v3 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_E2_V3 = fromString("Standard_E2_v3"); - /** Static value Standard_A4_v2 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_A4_V2 = fromString("Standard_A4_v2"); - /** Static value Standard_DS4_v2 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_DS4_V2 = fromString("Standard_DS4_v2"); - /** Static value Standard_F8s for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_F8S = fromString("Standard_F8s"); - /** Static value Standard_D12_v2 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_D12_V2 = fromString("Standard_D12_v2"); - /** Static value Standard_A2m_v2 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_A2M_V2 = fromString("Standard_A2m_v2"); - /** Static value Standard_DS13-4_v2 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_DS13_4_V2 = fromString("Standard_DS13-4_v2"); - /** Static value Standard_M128ms for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_M128MS = fromString("Standard_M128ms"); - /** Static value Standard_DS15_v2 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_DS15_V2 = fromString("Standard_DS15_v2"); - /** Static value Standard_F2 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_F2 = fromString("Standard_F2"); - /** Static value Standard_F1 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_F1 = fromString("Standard_F1"); - /** Static value Standard_DS14_v2_Promo for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_DS14_V2_PROMO = fromString("Standard_DS14_v2_Promo"); - /** Static value Standard_GS4-8 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_GS4_8 = fromString("Standard_GS4-8"); - /** Static value Standard_E32-8s_v3 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_E32_8S_V3 = fromString("Standard_E32-8s_v3"); - /** Static value Standard_F8 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_F8 = fromString("Standard_F8"); - /** Static value Standard_F16 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_F16 = fromString("Standard_F16"); - /** Static value Standard_F4 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_F4 = fromString("Standard_F4"); - /** Static value Standard_GS4-4 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_GS4_4 = fromString("Standard_GS4-4"); - /** Static value Standard_F72s_v2 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_F72S_V2 = fromString("Standard_F72s_v2"); - /** Static value Standard_D16s_v3 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_D16S_V3 = fromString("Standard_D16s_v3"); - /** Static value Standard_D2_v2_Promo for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_D2_V2_PROMO = fromString("Standard_D2_v2_Promo"); - /** Static value Standard_A1_v2 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_A1_V2 = fromString("Standard_A1_v2"); - /** Static value Standard_NC6 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_NC6 = fromString("Standard_NC6"); - /** Static value Standard_E16s_v3 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_E16S_V3 = fromString("Standard_E16s_v3"); - /** Static value Standard_A10 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_A10 = fromString("Standard_A10"); - /** Static value Standard_A4m_v2 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_A4M_V2 = fromString("Standard_A4m_v2"); - /** Static value Standard_A11 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_A11 = fromString("Standard_A11"); - /** Static value Standard_DS12_v2 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_DS12_V2 = fromString("Standard_DS12_v2"); - /** Static value Standard_E16_v3 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_E16_V3 = fromString("Standard_E16_v3"); - /** Static value Standard_D4_v3 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_D4_V3 = fromString("Standard_D4_v3"); - /** Static value Standard_G4 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_G4 = fromString("Standard_G4"); - /** Static value Standard_G3 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_G3 = fromString("Standard_G3"); - /** Static value Standard_NC24s_v2 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_NC24S_V2 = fromString("Standard_NC24s_v2"); - /** Static value Standard_G2 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_G2 = fromString("Standard_G2"); - /** Static value Classic for ComputeSkuName. */ - public static final ComputeSkuName CLASSIC = fromString("Classic"); - /** Static value Standard_D4_v2 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_D4_V2 = fromString("Standard_D4_v2"); - /** Static value Standard_G1 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_G1 = fromString("Standard_G1"); - /** Static value Standard_E64_v3 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_E64_V3 = fromString("Standard_E64_v3"); - /** Static value Standard_DS3_v2_Promo for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_DS3_V2_PROMO = fromString("Standard_DS3_v2_Promo"); - /** Static value Standard_L4s for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_L4S = fromString("Standard_L4s"); - /** Static value Standard_E8_v3 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_E8_V3 = fromString("Standard_E8_v3"); - /** Static value Standard_G5 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_G5 = fromString("Standard_G5"); - /** Static value Standard_F8s_v2 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_F8S_V2 = fromString("Standard_F8s_v2"); - /** Static value Standard_DS11_v2_Promo for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_DS11_V2_PROMO = fromString("Standard_DS11_v2_Promo"); - /** Static value Standard_D2s_v3 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_D2S_V3 = fromString("Standard_D2s_v3"); - /** Static value Standard_D13_v2_Promo for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_D13_V2_PROMO = fromString("Standard_D13_v2_Promo"); - /** Static value Standard_NC12 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_NC12 = fromString("Standard_NC12"); - /** Static value Standard_D4_v2_Promo for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_D4_V2_PROMO = fromString("Standard_D4_v2_Promo"); - /** Static value Standard_L16s for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_L16S = fromString("Standard_L16s"); - /** Static value Standard_DS13-2_v2 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_DS13_2_V2 = fromString("Standard_DS13-2_v2"); - /** Static value Standard_DS13_v2 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_DS13_V2 = fromString("Standard_DS13_v2"); - /** Static value Standard_GS5-8 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_GS5_8 = fromString("Standard_GS5-8"); - /** Static value Standard_D5_v2 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_D5_V2 = fromString("Standard_D5_v2"); - /** Static value Standard_NC24r for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_NC24R = fromString("Standard_NC24r"); - /** Static value Standard_L32s for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_L32S = fromString("Standard_L32s"); - /** Static value Standard_D14_v2 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_D14_V2 = fromString("Standard_D14_v2"); - /** Static value Standard_E32_v3 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_E32_V3 = fromString("Standard_E32_v3"); - /** Static value Standard_ND6s for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_ND6S = fromString("Standard_ND6s"); - /** Static value Standard_H8 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_H8 = fromString("Standard_H8"); - /** Static value Basic_A4 for ComputeSkuName. */ - public static final ComputeSkuName BASIC_A4 = fromString("Basic_A4"); - /** Static value Standard_DS2_v2_Promo for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_DS2_V2_PROMO = fromString("Standard_DS2_v2_Promo"); - /** Static value Basic_A1 for ComputeSkuName. */ - public static final ComputeSkuName BASIC_A1 = fromString("Basic_A1"); - /** Static value Basic_A0 for ComputeSkuName. */ - public static final ComputeSkuName BASIC_A0 = fromString("Basic_A0"); - /** Static value Basic_A3 for ComputeSkuName. */ - public static final ComputeSkuName BASIC_A3 = fromString("Basic_A3"); - /** Static value Basic_A2 for ComputeSkuName. */ - public static final ComputeSkuName BASIC_A2 = fromString("Basic_A2"); - /** Static value Standard_D11_v2 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_D11_V2 = fromString("Standard_D11_v2"); - /** Static value Standard_DS14-8_v2 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_DS14_8_V2 = fromString("Standard_DS14-8_v2"); - /** Static value Standard_DS1_v2 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_DS1_V2 = fromString("Standard_DS1_v2"); - /** Static value Standard_E64-16s_v3 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_E64_16S_V3 = fromString("Standard_E64-16s_v3"); - /** Static value Standard_D2_v2 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_D2_V2 = fromString("Standard_D2_v2"); - /** Static value Standard_D2_v3 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_D2_V3 = fromString("Standard_D2_v3"); - /** Static value Standard_D32_v3 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_D32_V3 = fromString("Standard_D32_v3"); - /** Static value Standard_D11_v2_Promo for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_D11_V2_PROMO = fromString("Standard_D11_v2_Promo"); - /** Static value Standard_F64s_v2 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_F64S_V2 = fromString("Standard_F64s_v2"); - /** Static value Standard_A6 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_A6 = fromString("Standard_A6"); - /** Static value Standard_M128-64ms for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_M128_64MS = fromString("Standard_M128-64ms"); - /** Static value Standard_A5 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_A5 = fromString("Standard_A5"); - /** Static value Standard_A4 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_A4 = fromString("Standard_A4"); - /** Static value Standard_A3 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_A3 = fromString("Standard_A3"); - /** Static value Standard_A2 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_A2 = fromString("Standard_A2"); - /** Static value Standard_D32s_v3 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_D32S_V3 = fromString("Standard_D32s_v3"); - /** Static value Standard_A1 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_A1 = fromString("Standard_A1"); - /** Static value Standard_A0 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_A0 = fromString("Standard_A0"); - /** Static value Standard_M64-32ms for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_M64_32MS = fromString("Standard_M64-32ms"); - /** Static value Standard_A8_v2 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_A8_V2 = fromString("Standard_A8_v2"); - /** Static value Standard_B4ms for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_B4MS = fromString("Standard_B4ms"); - /** Static value Standard_GS3 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_GS3 = fromString("Standard_GS3"); - /** Static value Standard_GS2 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_GS2 = fromString("Standard_GS2"); - /** Static value Standard_GS5 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_GS5 = fromString("Standard_GS5"); - /** Static value Standard_GS4 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_GS4 = fromString("Standard_GS4"); - /** Static value Standard_B8ms for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_B8MS = fromString("Standard_B8ms"); - /** Static value Standard_D64_v3 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_D64_V3 = fromString("Standard_D64_v3"); - /** Static value Standard_A9 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_A9 = fromString("Standard_A9"); - /** Static value Standard_A8 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_A8 = fromString("Standard_A8"); - /** Static value Standard_GS1 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_GS1 = fromString("Standard_GS1"); - /** Static value Standard_A7 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_A7 = fromString("Standard_A7"); - /** Static value Standard_E64-32s_v3 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_E64_32S_V3 = fromString("Standard_E64-32s_v3"); - /** Static value Standard_NV12 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_NV12 = fromString("Standard_NV12"); - /** Static value Standard_NC6s_v2 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_NC6S_V2 = fromString("Standard_NC6s_v2"); - /** Static value Standard_NC24rs_v2 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_NC24RS_V2 = fromString("Standard_NC24rs_v2"); - /** Static value Standard_H8m for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_H8M = fromString("Standard_H8m"); - /** Static value Standard_DS11_v2 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_DS11_V2 = fromString("Standard_DS11_v2"); - /** Static value Premium_LRS for ComputeSkuName. */ - public static final ComputeSkuName PREMIUM_LRS = fromString("Premium_LRS"); - /** Static value Standard_D3_v2 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_D3_V2 = fromString("Standard_D3_v2"); - /** Static value Standard_D16_v3 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_D16_V3 = fromString("Standard_D16_v3"); - /** Static value Standard_F16s for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_F16S = fromString("Standard_F16s"); - /** Static value Standard_ND24rs for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_ND24RS = fromString("Standard_ND24rs"); - /** Static value Standard_DS13 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_DS13 = fromString("Standard_DS13"); - /** Static value Standard_NV6 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_NV6 = fromString("Standard_NV6"); - /** Static value Standard_DS12 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_DS12 = fromString("Standard_DS12"); - /** Static value Standard_E8s_v3 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_E8S_V3 = fromString("Standard_E8s_v3"); - /** Static value Standard_DS11 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_DS11 = fromString("Standard_DS11"); - /** Static value Standard_H16 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_H16 = fromString("Standard_H16"); - /** Static value Standard_DS14 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_DS14 = fromString("Standard_DS14"); - /** Static value Standard_D14 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_D14 = fromString("Standard_D14"); - /** Static value Standard_D12_v2_Promo for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_D12_V2_PROMO = fromString("Standard_D12_v2_Promo"); - /** Static value Standard_D13 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_D13 = fromString("Standard_D13"); - /** Static value Standard_D5_v2_Promo for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_D5_V2_PROMO = fromString("Standard_D5_v2_Promo"); - /** Static value Standard_DS14-4_v2 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_DS14_4_V2 = fromString("Standard_DS14-4_v2"); - /** Static value Standard_D12 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_D12 = fromString("Standard_D12"); - /** Static value Standard_D11 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_D11 = fromString("Standard_D11"); - /** Static value Standard_DS3_v2 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_DS3_V2 = fromString("Standard_DS3_v2"); - /** Static value Standard_D14_v2_Promo for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_D14_V2_PROMO = fromString("Standard_D14_v2_Promo"); - /** Static value Standard_D8_v3 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_D8_V3 = fromString("Standard_D8_v3"); - /** Static value Standard_NV24 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_NV24 = fromString("Standard_NV24"); - /** Static value Standard_DS4_v2_Promo for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_DS4_V2_PROMO = fromString("Standard_DS4_v2_Promo"); - /** Static value Standard_D13_v2 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_D13_V2 = fromString("Standard_D13_v2"); - /** Static value Standard_M64s for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_M64S = fromString("Standard_M64s"); - /** Static value Standard_M64ms for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_M64MS = fromString("Standard_M64ms"); - /** Static value Standard_E32s_v3 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_E32S_V3 = fromString("Standard_E32s_v3"); - /** Static value Standard_M64-16ms for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_M64_16MS = fromString("Standard_M64-16ms"); - /** Static value Standard_E32-16s_v3 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_E32_16S_V3 = fromString("Standard_E32-16s_v3"); - /** Static value Standard_D3_v2_Promo for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_D3_V2_PROMO = fromString("Standard_D3_v2_Promo"); - /** Static value Standard_B1ms for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_B1MS = fromString("Standard_B1ms"); - /** Static value Standard_E64s_v3 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_E64S_V3 = fromString("Standard_E64s_v3"); - /** Static value Standard_LRS for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_LRS = fromString("Standard_LRS"); - /** Static value Standard_NC12s_v2 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_NC12S_V2 = fromString("Standard_NC12s_v2"); - /** Static value Standard_L8s for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_L8S = fromString("Standard_L8s"); - /** Static value Standard_E4_v3 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_E4_V3 = fromString("Standard_E4_v3"); - /** Static value Aligned for ComputeSkuName. */ - public static final ComputeSkuName ALIGNED = fromString("Aligned"); - /** Static value Standard_DS2 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_DS2 = fromString("Standard_DS2"); - /** Static value Standard_DS1 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_DS1 = fromString("Standard_DS1"); - /** Static value Standard_F4s for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_F4S = fromString("Standard_F4s"); - /** Static value Standard_DS4 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_DS4 = fromString("Standard_DS4"); - /** Static value Standard_A2_v2 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_A2_V2 = fromString("Standard_A2_v2"); - /** Static value Standard_DS3 for ComputeSkuName. */ - public static final ComputeSkuName STANDARD_DS3 = fromString("Standard_DS3"); - - /** - * Creates or finds a ComputeSkuName from its string representation. - * - * @param name a name to look for - * @return the corresponding ComputeSkuName - */ - public static ComputeSkuName fromString(String name) { - return fromString(name, ComputeSkuName.class); - } - - /** @return known ComputeSkuName values */ - public static Collection values() { - return values(ComputeSkuName.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ComputeSkuTier.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ComputeSkuTier.java deleted file mode 100644 index cbb3a89501f2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ComputeSkuTier.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.ExpandableStringEnum; - -import java.util.Collection; - -/** Compute resource sku tier. */ -@Fluent -public class ComputeSkuTier extends ExpandableStringEnum { - /** Static value Basic for ComputeSkuTier. */ - public static final ComputeSkuTier BASIC = fromString("Basic"); - /** Static value Standard for ComputeSkuTier. */ - public static final ComputeSkuTier STANDARD = fromString("Standard"); - /** Static value Premium for ComputeSkuTier. */ - public static final ComputeSkuTier PREMIUM = fromString("Premium"); - - /** - * Creates or finds a ComputeSkuTier from its string representation. - * - * @param name a name to look for - * @return the corresponding ComputeSkuTier - */ - public static ComputeSkuTier fromString(String name) { - return fromString(name, ComputeSkuTier.class); - } - - /** @return known ComputeSkuTier values */ - public static Collection values() { - return values(ComputeSkuTier.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ComputeSkus.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ComputeSkus.java deleted file mode 100644 index c7183ddb967e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ComputeSkus.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.compute.ComputeManager; -import com.azure.core.management.Region; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListingByRegion; - -/** Entry point to compute service SKUs. */ -@Fluent -public interface ComputeSkus - extends SupportsListing, SupportsListingByRegion, HasManager { - /** - * Lists all the skus with the specified resource type. - * - * @param resourceType the compute resource type - * @return the skus list - */ - PagedIterable listByResourceType(ComputeResourceType resourceType); - - /** - * Lists all the skus with the specified resource type. - * - * @param resourceType the compute resource type - * @return an observable that emits skus - */ - PagedFlux listByResourceTypeAsync(ComputeResourceType resourceType); - - /** - * Lists all the skus with the specified resource type in the given region. - * - * @param region the region - * @param resourceType the resource type - * @return the skus list - */ - PagedIterable listByRegionAndResourceType(Region region, ComputeResourceType resourceType); - - /** - * Lists all the skus with the specified resource type in the given region. - * - * @param region the region - * @param resourceType the resource type - * @return an observable that emits skus - */ - PagedFlux listByRegionAndResourceTypeAsync(Region region, ComputeResourceType resourceType); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ComputeUsage.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ComputeUsage.java deleted file mode 100644 index ad08a1bb632e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ComputeUsage.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.compute.fluent.models.UsageInner; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; - -/** An immutable client-side representation of an Azure compute resource usage info object. */ -@Fluent -public interface ComputeUsage extends HasInnerModel { - /** @return the unit of measurement */ - ComputeUsageUnit unit(); - - /** @return the current count of the allocated resources in the subscription */ - int currentValue(); - - /** @return the maximum count of the resources that can be allocated in the subscription */ - long limit(); - - /** @return the name of the type of usage */ - UsageName name(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ComputeUsageUnit.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ComputeUsageUnit.java deleted file mode 100644 index 481f9c9db336..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ComputeUsageUnit.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.compute.models; - -import com.azure.core.util.ExpandableStringEnum; - -import java.util.Collection; - -/** Compute usage units. */ -public final class ComputeUsageUnit extends ExpandableStringEnum { - /** Static value Count for ComputeUsageUnit. */ - public static final ComputeUsageUnit COUNT = fromString("Count"); - - /** Static value Bytes for ComputeUsageUnit. */ - public static final ComputeUsageUnit BYTES = fromString("Bytes"); - - /** Static value Seconds for ComputeUsageUnit. */ - public static final ComputeUsageUnit SECONDS = fromString("Seconds"); - - /** Static value Percent for ComputeUsageUnit. */ - public static final ComputeUsageUnit PERCENT = fromString("Percent"); - - /** Static value CountsPerSecond for ComputeUsageUnit. */ - public static final ComputeUsageUnit COUNTS_PER_SECOND = fromString("CountsPerSecond"); - - /** Static value BytesPerSecond for ComputeUsageUnit. */ - public static final ComputeUsageUnit BYTES_PER_SECOND = fromString("BytesPerSecond"); - - /** - * Creates or finds a compute usage unit based on its name. - * - * @param name a name - * @return a corresponding ComputeUsageUnit - */ - public static ComputeUsageUnit fromString(String name) { - return fromString(name, ComputeUsageUnit.class); - } - - /** @return known compute usage units */ - public Collection values() { - return values(ComputeUsageUnit.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ComputeUsages.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ComputeUsages.java deleted file mode 100644 index 233d5798eb1c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ComputeUsages.java +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListingByRegion; - -/** Entry point for compute resource usage management API. */ -@Fluent -public interface ComputeUsages extends SupportsListingByRegion { -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/CreationData.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/CreationData.java deleted file mode 100644 index 251edec56e4b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/CreationData.java +++ /dev/null @@ -1,220 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Data used when creating a disk. */ -@Fluent -public final class CreationData { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CreationData.class); - - /* - * This enumerates the possible sources of a disk's creation. - */ - @JsonProperty(value = "createOption", required = true) - private DiskCreateOption createOption; - - /* - * Required if createOption is Import. The Azure Resource Manager - * identifier of the storage account containing the blob to import as a - * disk. - */ - @JsonProperty(value = "storageAccountId") - private String storageAccountId; - - /* - * Disk source information. - */ - @JsonProperty(value = "imageReference") - private ImageDiskReference imageReference; - - /* - * If createOption is Import, this is the URI of a blob to be imported into - * a managed disk. - */ - @JsonProperty(value = "sourceUri") - private String sourceUri; - - /* - * If createOption is Copy, this is the ARM id of the source snapshot or - * disk. - */ - @JsonProperty(value = "sourceResourceId") - private String sourceResourceId; - - /* - * If this field is set, this is the unique id identifying the source of - * this resource. - */ - @JsonProperty(value = "sourceUniqueId", access = JsonProperty.Access.WRITE_ONLY) - private String sourceUniqueId; - - /* - * If createOption is Upload, this is the size of the contents of the - * upload including the VHD footer. This value should be between 20972032 - * (20 MiB + 512 bytes for the VHD footer) and 35183298347520 bytes (32 TiB - * + 512 bytes for the VHD footer). - */ - @JsonProperty(value = "uploadSizeBytes") - private Long uploadSizeBytes; - - /** - * Get the createOption property: This enumerates the possible sources of a disk's creation. - * - * @return the createOption value. - */ - public DiskCreateOption createOption() { - return this.createOption; - } - - /** - * Set the createOption property: This enumerates the possible sources of a disk's creation. - * - * @param createOption the createOption value to set. - * @return the CreationData object itself. - */ - public CreationData withCreateOption(DiskCreateOption createOption) { - this.createOption = createOption; - return this; - } - - /** - * Get the storageAccountId property: Required if createOption is Import. The Azure Resource Manager identifier of - * the storage account containing the blob to import as a disk. - * - * @return the storageAccountId value. - */ - public String storageAccountId() { - return this.storageAccountId; - } - - /** - * Set the storageAccountId property: Required if createOption is Import. The Azure Resource Manager identifier of - * the storage account containing the blob to import as a disk. - * - * @param storageAccountId the storageAccountId value to set. - * @return the CreationData object itself. - */ - public CreationData withStorageAccountId(String storageAccountId) { - this.storageAccountId = storageAccountId; - return this; - } - - /** - * Get the imageReference property: Disk source information. - * - * @return the imageReference value. - */ - public ImageDiskReference imageReference() { - return this.imageReference; - } - - /** - * Set the imageReference property: Disk source information. - * - * @param imageReference the imageReference value to set. - * @return the CreationData object itself. - */ - public CreationData withImageReference(ImageDiskReference imageReference) { - this.imageReference = imageReference; - return this; - } - - /** - * Get the sourceUri property: If createOption is Import, this is the URI of a blob to be imported into a managed - * disk. - * - * @return the sourceUri value. - */ - public String sourceUri() { - return this.sourceUri; - } - - /** - * Set the sourceUri property: If createOption is Import, this is the URI of a blob to be imported into a managed - * disk. - * - * @param sourceUri the sourceUri value to set. - * @return the CreationData object itself. - */ - public CreationData withSourceUri(String sourceUri) { - this.sourceUri = sourceUri; - return this; - } - - /** - * Get the sourceResourceId property: If createOption is Copy, this is the ARM id of the source snapshot or disk. - * - * @return the sourceResourceId value. - */ - public String sourceResourceId() { - return this.sourceResourceId; - } - - /** - * Set the sourceResourceId property: If createOption is Copy, this is the ARM id of the source snapshot or disk. - * - * @param sourceResourceId the sourceResourceId value to set. - * @return the CreationData object itself. - */ - public CreationData withSourceResourceId(String sourceResourceId) { - this.sourceResourceId = sourceResourceId; - return this; - } - - /** - * Get the sourceUniqueId property: If this field is set, this is the unique id identifying the source of this - * resource. - * - * @return the sourceUniqueId value. - */ - public String sourceUniqueId() { - return this.sourceUniqueId; - } - - /** - * Get the uploadSizeBytes property: If createOption is Upload, this is the size of the contents of the upload - * including the VHD footer. This value should be between 20972032 (20 MiB + 512 bytes for the VHD footer) and - * 35183298347520 bytes (32 TiB + 512 bytes for the VHD footer). - * - * @return the uploadSizeBytes value. - */ - public Long uploadSizeBytes() { - return this.uploadSizeBytes; - } - - /** - * Set the uploadSizeBytes property: If createOption is Upload, this is the size of the contents of the upload - * including the VHD footer. This value should be between 20972032 (20 MiB + 512 bytes for the VHD footer) and - * 35183298347520 bytes (32 TiB + 512 bytes for the VHD footer). - * - * @param uploadSizeBytes the uploadSizeBytes value to set. - * @return the CreationData object itself. - */ - public CreationData withUploadSizeBytes(Long uploadSizeBytes) { - this.uploadSizeBytes = uploadSizeBytes; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (createOption() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property createOption in model CreationData")); - } - if (imageReference() != null) { - imageReference().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/CreationSource.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/CreationSource.java deleted file mode 100644 index bb4930164055..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/CreationSource.java +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.models; - -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils; - -/** The source from which managed disk or snapshot is created. */ -public class CreationSource { - private final CreationData creationData; - - /** - * Creates DiskSource. - * - * @param creationData the creation data of managed disk or snapshot - */ - public CreationSource(CreationData creationData) { - this.creationData = creationData; - } - - /** @return type of the source from which disk or snapshot is created */ - public CreationSourceType type() { - DiskCreateOption createOption = this.creationData.createOption(); - if (createOption == DiskCreateOption.FROM_IMAGE) { - ImageDiskReference imageReference = this.creationData.imageReference(); - if (imageReference.lun() == null) { - return CreationSourceType.FROM_OS_DISK_IMAGE; - } - return CreationSourceType.FROM_DATA_DISK_IMAGE; - } - if (createOption == DiskCreateOption.IMPORT) { - return CreationSourceType.IMPORTED_FROM_VHD; - } - if (createOption == DiskCreateOption.COPY) { - String sourceResourceId = this.creationData.sourceResourceId(); - if (sourceResourceId == null && this.creationData.sourceUri() != null) { - sourceResourceId = this.creationData.sourceUri(); - } - if (sourceResourceId != null) { - String resourceType = ResourceUtils.resourceTypeFromResourceId(sourceResourceId); - if ("disks".equalsIgnoreCase(resourceType)) { - return CreationSourceType.COPIED_FROM_DISK; - } - if ("snapshots".equalsIgnoreCase(resourceType)) { - return CreationSourceType.COPIED_FROM_SNAPSHOT; - } - } - } - if (createOption == DiskCreateOption.EMPTY) { - return CreationSourceType.EMPTY; - } - return CreationSourceType.UNKNOWN; - } - - /** @return ID of the source */ - public String sourceId() { - if (this.type() == CreationSourceType.FROM_OS_DISK_IMAGE - || this.type() == CreationSourceType.FROM_DATA_DISK_IMAGE) { - return this.creationData.imageReference().id(); - } - if (this.type() == CreationSourceType.IMPORTED_FROM_VHD) { - return this.creationData.sourceUri(); - } - if (this.type() == CreationSourceType.COPIED_FROM_DISK) { - String sourceResourceId = this.creationData.sourceResourceId(); - if (sourceResourceId == null) { - sourceResourceId = this.creationData.sourceUri(); - } - return sourceResourceId; - } - if (this.type() == CreationSourceType.COPIED_FROM_SNAPSHOT) { - String sourceResourceId = this.creationData.sourceResourceId(); - if (sourceResourceId == null) { - sourceResourceId = this.creationData.sourceUri(); - } - return sourceResourceId; - } - return null; - } - - /** - * @return the LUN value of the data disk image if this disk or snapshot is created from a data disk image, -1 - * otherwise - */ - public int sourceDataDiskImageLun() { - if (this.type() == CreationSourceType.FROM_DATA_DISK_IMAGE) { - return this.creationData.imageReference().lun(); - } - return -1; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/CreationSourceType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/CreationSourceType.java deleted file mode 100644 index 534fbe64c857..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/CreationSourceType.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.models; - -/** The source type of managed disk or snapshot. */ -public enum CreationSourceType { - /** - * Indicates that disk or snapshot is created from OS disk image of a virtual machine platform or virtual machine - * user image. - */ - FROM_OS_DISK_IMAGE, - /** - * Indicates that disk or snapshot is created from data disk image of a virtual machine platform or virtual machine - * user image. - */ - FROM_DATA_DISK_IMAGE, - /** Indicates that disk or snapshot is created by importing a blob in a storage account. */ - IMPORTED_FROM_VHD, - /** Indicates that disk or snapshot is created by copying a snapshot. */ - COPIED_FROM_SNAPSHOT, - /** Indicates that disk or snapshot is created by copying another managed disk. */ - COPIED_FROM_DISK, - /** Indicates that disk or snapshot is created as empty disk. */ - EMPTY, - /** Unknown source. */ - UNKNOWN -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DataDisk.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DataDisk.java deleted file mode 100644 index 3daf49d9d72a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DataDisk.java +++ /dev/null @@ -1,380 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describes a data disk. */ -@Fluent -public final class DataDisk { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DataDisk.class); - - /* - * Specifies the logical unit number of the data disk. This value is used - * to identify data disks within the VM and therefore must be unique for - * each data disk attached to a VM. - */ - @JsonProperty(value = "lun", required = true) - private int lun; - - /* - * The disk name. - */ - @JsonProperty(value = "name") - private String name; - - /* - * The virtual hard disk. - */ - @JsonProperty(value = "vhd") - private VirtualHardDisk vhd; - - /* - * The source user image virtual hard disk. The virtual hard disk will be - * copied before being attached to the virtual machine. If SourceImage is - * provided, the destination virtual hard drive must not exist. - */ - @JsonProperty(value = "image") - private VirtualHardDisk image; - - /* - * Specifies the caching requirements.

Possible values are: - *

**None**

**ReadOnly**

**ReadWrite**

- * Default: **None for Standard storage. ReadOnly for Premium storage** - */ - @JsonProperty(value = "caching") - private CachingTypes caching; - - /* - * Specifies whether writeAccelerator should be enabled or disabled on the - * disk. - */ - @JsonProperty(value = "writeAcceleratorEnabled") - private Boolean writeAcceleratorEnabled; - - /* - * Specifies how the virtual machine should be created.

Possible - * values are:

**Attach** \u2013 This value is used when you are - * using a specialized disk to create the virtual machine.

- * **FromImage** \u2013 This value is used when you are using an image to - * create the virtual machine. If you are using a platform image, you also - * use the imageReference element described above. If you are using a - * marketplace image, you also use the plan element previously described. - */ - @JsonProperty(value = "createOption", required = true) - private DiskCreateOptionTypes createOption; - - /* - * Specifies the size of an empty data disk in gigabytes. This element can - * be used to overwrite the size of the disk in a virtual machine image. - *

This value cannot be larger than 1023 GB - */ - @JsonProperty(value = "diskSizeGB") - private Integer diskSizeGB; - - /* - * The managed disk parameters. - */ - @JsonProperty(value = "managedDisk") - private ManagedDiskParameters managedDisk; - - /* - * Specifies whether the data disk is in process of detachment from the - * VirtualMachine/VirtualMachineScaleset - */ - @JsonProperty(value = "toBeDetached") - private Boolean toBeDetached; - - /* - * Specifies the Read-Write IOPS for the managed disk when - * StorageAccountType is UltraSSD_LRS. Returned only for VirtualMachine - * ScaleSet VM disks. Can be updated only via updates to the VirtualMachine - * Scale Set. - */ - @JsonProperty(value = "diskIOPSReadWrite", access = JsonProperty.Access.WRITE_ONLY) - private Long diskIopsReadWrite; - - /* - * Specifies the bandwidth in MB per second for the managed disk when - * StorageAccountType is UltraSSD_LRS. Returned only for VirtualMachine - * ScaleSet VM disks. Can be updated only via updates to the VirtualMachine - * Scale Set. - */ - @JsonProperty(value = "diskMBpsReadWrite", access = JsonProperty.Access.WRITE_ONLY) - private Long diskMBpsReadWrite; - - /** - * Get the lun property: Specifies the logical unit number of the data disk. This value is used to identify data - * disks within the VM and therefore must be unique for each data disk attached to a VM. - * - * @return the lun value. - */ - public int lun() { - return this.lun; - } - - /** - * Set the lun property: Specifies the logical unit number of the data disk. This value is used to identify data - * disks within the VM and therefore must be unique for each data disk attached to a VM. - * - * @param lun the lun value to set. - * @return the DataDisk object itself. - */ - public DataDisk withLun(int lun) { - this.lun = lun; - return this; - } - - /** - * Get the name property: The disk name. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The disk name. - * - * @param name the name value to set. - * @return the DataDisk object itself. - */ - public DataDisk withName(String name) { - this.name = name; - return this; - } - - /** - * Get the vhd property: The virtual hard disk. - * - * @return the vhd value. - */ - public VirtualHardDisk vhd() { - return this.vhd; - } - - /** - * Set the vhd property: The virtual hard disk. - * - * @param vhd the vhd value to set. - * @return the DataDisk object itself. - */ - public DataDisk withVhd(VirtualHardDisk vhd) { - this.vhd = vhd; - return this; - } - - /** - * Get the image property: The source user image virtual hard disk. The virtual hard disk will be copied before - * being attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not - * exist. - * - * @return the image value. - */ - public VirtualHardDisk image() { - return this.image; - } - - /** - * Set the image property: The source user image virtual hard disk. The virtual hard disk will be copied before - * being attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not - * exist. - * - * @param image the image value to set. - * @return the DataDisk object itself. - */ - public DataDisk withImage(VirtualHardDisk image) { - this.image = image; - return this; - } - - /** - * Get the caching property: Specifies the caching requirements. <br><br> Possible values are: - * <br><br> **None** <br><br> **ReadOnly** <br><br> **ReadWrite** - * <br><br> Default: **None for Standard storage. ReadOnly for Premium storage**. - * - * @return the caching value. - */ - public CachingTypes caching() { - return this.caching; - } - - /** - * Set the caching property: Specifies the caching requirements. <br><br> Possible values are: - * <br><br> **None** <br><br> **ReadOnly** <br><br> **ReadWrite** - * <br><br> Default: **None for Standard storage. ReadOnly for Premium storage**. - * - * @param caching the caching value to set. - * @return the DataDisk object itself. - */ - public DataDisk withCaching(CachingTypes caching) { - this.caching = caching; - return this; - } - - /** - * Get the writeAcceleratorEnabled property: Specifies whether writeAccelerator should be enabled or disabled on the - * disk. - * - * @return the writeAcceleratorEnabled value. - */ - public Boolean writeAcceleratorEnabled() { - return this.writeAcceleratorEnabled; - } - - /** - * Set the writeAcceleratorEnabled property: Specifies whether writeAccelerator should be enabled or disabled on the - * disk. - * - * @param writeAcceleratorEnabled the writeAcceleratorEnabled value to set. - * @return the DataDisk object itself. - */ - public DataDisk withWriteAcceleratorEnabled(Boolean writeAcceleratorEnabled) { - this.writeAcceleratorEnabled = writeAcceleratorEnabled; - return this; - } - - /** - * Get the createOption property: Specifies how the virtual machine should be created.<br><br> Possible - * values are:<br><br> **Attach** \u2013 This value is used when you are using a specialized disk to - * create the virtual machine.<br><br> **FromImage** \u2013 This value is used when you are using an - * image to create the virtual machine. If you are using a platform image, you also use the imageReference element - * described above. If you are using a marketplace image, you also use the plan element previously described. - * - * @return the createOption value. - */ - public DiskCreateOptionTypes createOption() { - return this.createOption; - } - - /** - * Set the createOption property: Specifies how the virtual machine should be created.<br><br> Possible - * values are:<br><br> **Attach** \u2013 This value is used when you are using a specialized disk to - * create the virtual machine.<br><br> **FromImage** \u2013 This value is used when you are using an - * image to create the virtual machine. If you are using a platform image, you also use the imageReference element - * described above. If you are using a marketplace image, you also use the plan element previously described. - * - * @param createOption the createOption value to set. - * @return the DataDisk object itself. - */ - public DataDisk withCreateOption(DiskCreateOptionTypes createOption) { - this.createOption = createOption; - return this; - } - - /** - * Get the diskSizeGB property: Specifies the size of an empty data disk in gigabytes. This element can be used to - * overwrite the size of the disk in a virtual machine image. <br><br> This value cannot be larger than - * 1023 GB. - * - * @return the diskSizeGB value. - */ - public Integer diskSizeGB() { - return this.diskSizeGB; - } - - /** - * Set the diskSizeGB property: Specifies the size of an empty data disk in gigabytes. This element can be used to - * overwrite the size of the disk in a virtual machine image. <br><br> This value cannot be larger than - * 1023 GB. - * - * @param diskSizeGB the diskSizeGB value to set. - * @return the DataDisk object itself. - */ - public DataDisk withDiskSizeGB(Integer diskSizeGB) { - this.diskSizeGB = diskSizeGB; - return this; - } - - /** - * Get the managedDisk property: The managed disk parameters. - * - * @return the managedDisk value. - */ - public ManagedDiskParameters managedDisk() { - return this.managedDisk; - } - - /** - * Set the managedDisk property: The managed disk parameters. - * - * @param managedDisk the managedDisk value to set. - * @return the DataDisk object itself. - */ - public DataDisk withManagedDisk(ManagedDiskParameters managedDisk) { - this.managedDisk = managedDisk; - return this; - } - - /** - * Get the toBeDetached property: Specifies whether the data disk is in process of detachment from the - * VirtualMachine/VirtualMachineScaleset. - * - * @return the toBeDetached value. - */ - public Boolean toBeDetached() { - return this.toBeDetached; - } - - /** - * Set the toBeDetached property: Specifies whether the data disk is in process of detachment from the - * VirtualMachine/VirtualMachineScaleset. - * - * @param toBeDetached the toBeDetached value to set. - * @return the DataDisk object itself. - */ - public DataDisk withToBeDetached(Boolean toBeDetached) { - this.toBeDetached = toBeDetached; - return this; - } - - /** - * Get the diskIopsReadWrite property: Specifies the Read-Write IOPS for the managed disk when StorageAccountType is - * UltraSSD_LRS. Returned only for VirtualMachine ScaleSet VM disks. Can be updated only via updates to the - * VirtualMachine Scale Set. - * - * @return the diskIopsReadWrite value. - */ - public Long diskIopsReadWrite() { - return this.diskIopsReadWrite; - } - - /** - * Get the diskMBpsReadWrite property: Specifies the bandwidth in MB per second for the managed disk when - * StorageAccountType is UltraSSD_LRS. Returned only for VirtualMachine ScaleSet VM disks. Can be updated only via - * updates to the VirtualMachine Scale Set. - * - * @return the diskMBpsReadWrite value. - */ - public Long diskMBpsReadWrite() { - return this.diskMBpsReadWrite; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (vhd() != null) { - vhd().validate(); - } - if (image() != null) { - image().validate(); - } - if (createOption() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property createOption in model DataDisk")); - } - if (managedDisk() != null) { - managedDisk().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DataDiskImage.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DataDiskImage.java deleted file mode 100644 index 2c75a1c2f546..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DataDiskImage.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Contains the data disk images information. */ -@Immutable -public final class DataDiskImage { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DataDiskImage.class); - - /* - * Specifies the logical unit number of the data disk. This value is used - * to identify data disks within the VM and therefore must be unique for - * each data disk attached to a VM. - */ - @JsonProperty(value = "lun", access = JsonProperty.Access.WRITE_ONLY) - private Integer lun; - - /** - * Get the lun property: Specifies the logical unit number of the data disk. This value is used to identify data - * disks within the VM and therefore must be unique for each data disk attached to a VM. - * - * @return the lun value. - */ - public Integer lun() { - return this.lun; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DataDiskImageEncryption.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DataDiskImageEncryption.java deleted file mode 100644 index c60b4cfd35a3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DataDiskImageEncryption.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Contains encryption settings for a data disk image. */ -@Fluent -public final class DataDiskImageEncryption extends DiskImageEncryption { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DataDiskImageEncryption.class); - - /* - * This property specifies the logical unit number of the data disk. This - * value is used to identify data disks within the Virtual Machine and - * therefore must be unique for each data disk attached to the Virtual - * Machine. - */ - @JsonProperty(value = "lun", required = true) - private int lun; - - /** - * Get the lun property: This property specifies the logical unit number of the data disk. This value is used to - * identify data disks within the Virtual Machine and therefore must be unique for each data disk attached to the - * Virtual Machine. - * - * @return the lun value. - */ - public int lun() { - return this.lun; - } - - /** - * Set the lun property: This property specifies the logical unit number of the data disk. This value is used to - * identify data disks within the Virtual Machine and therefore must be unique for each data disk attached to the - * Virtual Machine. - * - * @param lun the lun value to set. - * @return the DataDiskImageEncryption object itself. - */ - public DataDiskImageEncryption withLun(int lun) { - this.lun = lun; - return this; - } - - /** {@inheritDoc} */ - @Override - public DataDiskImageEncryption withDiskEncryptionSetId(String diskEncryptionSetId) { - super.withDiskEncryptionSetId(diskEncryptionSetId); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DedicatedHostAllocatableVM.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DedicatedHostAllocatableVM.java deleted file mode 100644 index 2cd5fd3a8952..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DedicatedHostAllocatableVM.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Represents the dedicated host unutilized capacity in terms of a specific VM size. */ -@Fluent -public final class DedicatedHostAllocatableVM { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DedicatedHostAllocatableVM.class); - - /* - * VM size in terms of which the unutilized capacity is represented. - */ - @JsonProperty(value = "vmSize") - private String vmSize; - - /* - * Maximum number of VMs of size vmSize that can fit in the dedicated - * host's remaining capacity. - */ - @JsonProperty(value = "count") - private Double count; - - /** - * Get the vmSize property: VM size in terms of which the unutilized capacity is represented. - * - * @return the vmSize value. - */ - public String vmSize() { - return this.vmSize; - } - - /** - * Set the vmSize property: VM size in terms of which the unutilized capacity is represented. - * - * @param vmSize the vmSize value to set. - * @return the DedicatedHostAllocatableVM object itself. - */ - public DedicatedHostAllocatableVM withVmSize(String vmSize) { - this.vmSize = vmSize; - return this; - } - - /** - * Get the count property: Maximum number of VMs of size vmSize that can fit in the dedicated host's remaining - * capacity. - * - * @return the count value. - */ - public Double count() { - return this.count; - } - - /** - * Set the count property: Maximum number of VMs of size vmSize that can fit in the dedicated host's remaining - * capacity. - * - * @param count the count value to set. - * @return the DedicatedHostAllocatableVM object itself. - */ - public DedicatedHostAllocatableVM withCount(Double count) { - this.count = count; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DedicatedHostAvailableCapacity.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DedicatedHostAvailableCapacity.java deleted file mode 100644 index bda0ffdde3a9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DedicatedHostAvailableCapacity.java +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Dedicated host unutilized capacity. */ -@Fluent -public final class DedicatedHostAvailableCapacity { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DedicatedHostAvailableCapacity.class); - - /* - * The unutilized capacity of the dedicated host represented in terms of - * each VM size that is allowed to be deployed to the dedicated host. - */ - @JsonProperty(value = "allocatableVMs") - private List allocatableVMs; - - /** - * Get the allocatableVMs property: The unutilized capacity of the dedicated host represented in terms of each VM - * size that is allowed to be deployed to the dedicated host. - * - * @return the allocatableVMs value. - */ - public List allocatableVMs() { - return this.allocatableVMs; - } - - /** - * Set the allocatableVMs property: The unutilized capacity of the dedicated host represented in terms of each VM - * size that is allowed to be deployed to the dedicated host. - * - * @param allocatableVMs the allocatableVMs value to set. - * @return the DedicatedHostAvailableCapacity object itself. - */ - public DedicatedHostAvailableCapacity withAllocatableVMs(List allocatableVMs) { - this.allocatableVMs = allocatableVMs; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (allocatableVMs() != null) { - allocatableVMs().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DedicatedHostGroupInstanceView.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DedicatedHostGroupInstanceView.java deleted file mode 100644 index 44009ca92cff..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DedicatedHostGroupInstanceView.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The DedicatedHostGroupInstanceView model. */ -@Fluent -public final class DedicatedHostGroupInstanceView { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DedicatedHostGroupInstanceView.class); - - /* - * List of instance view of the dedicated hosts under the dedicated host - * group. - */ - @JsonProperty(value = "hosts") - private List hosts; - - /** - * Get the hosts property: List of instance view of the dedicated hosts under the dedicated host group. - * - * @return the hosts value. - */ - public List hosts() { - return this.hosts; - } - - /** - * Set the hosts property: List of instance view of the dedicated hosts under the dedicated host group. - * - * @param hosts the hosts value to set. - * @return the DedicatedHostGroupInstanceView object itself. - */ - public DedicatedHostGroupInstanceView withHosts(List hosts) { - this.hosts = hosts; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (hosts() != null) { - hosts().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DedicatedHostGroupListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DedicatedHostGroupListResult.java deleted file mode 100644 index fe55a6063a5d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DedicatedHostGroupListResult.java +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.fluent.models.DedicatedHostGroupInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The List Dedicated Host Group with resource group response. */ -@Fluent -public final class DedicatedHostGroupListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DedicatedHostGroupListResult.class); - - /* - * The list of dedicated host groups - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * The URI to fetch the next page of Dedicated Host Groups. Call ListNext() - * with this URI to fetch the next page of Dedicated Host Groups. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: The list of dedicated host groups. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The list of dedicated host groups. - * - * @param value the value value to set. - * @return the DedicatedHostGroupListResult object itself. - */ - public DedicatedHostGroupListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URI to fetch the next page of Dedicated Host Groups. Call ListNext() with this URI - * to fetch the next page of Dedicated Host Groups. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The URI to fetch the next page of Dedicated Host Groups. Call ListNext() with this URI - * to fetch the next page of Dedicated Host Groups. - * - * @param nextLink the nextLink value to set. - * @return the DedicatedHostGroupListResult object itself. - */ - public DedicatedHostGroupListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property value in model DedicatedHostGroupListResult")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DedicatedHostGroupUpdate.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DedicatedHostGroupUpdate.java deleted file mode 100644 index a1626c3021f2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DedicatedHostGroupUpdate.java +++ /dev/null @@ -1,161 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.fluent.models.DedicatedHostGroupProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** - * Specifies information about the dedicated host group that the dedicated host should be assigned to. Only tags may be - * updated. - */ -@Fluent -public final class DedicatedHostGroupUpdate extends UpdateResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DedicatedHostGroupUpdate.class); - - /* - * Dedicated Host Group Properties. - */ - @JsonProperty(value = "properties") - private DedicatedHostGroupProperties innerProperties; - - /* - * Availability Zone to use for this host group. Only single zone is - * supported. The zone can be assigned only during creation. If not - * provided, the group supports all zones in the region. If provided, - * enforces each host in the group to be in the same zone. - */ - @JsonProperty(value = "zones") - private List zones; - - /** - * Get the innerProperties property: Dedicated Host Group Properties. - * - * @return the innerProperties value. - */ - private DedicatedHostGroupProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the zones property: Availability Zone to use for this host group. Only single zone is supported. The zone can - * be assigned only during creation. If not provided, the group supports all zones in the region. If provided, - * enforces each host in the group to be in the same zone. - * - * @return the zones value. - */ - public List zones() { - return this.zones; - } - - /** - * Set the zones property: Availability Zone to use for this host group. Only single zone is supported. The zone can - * be assigned only during creation. If not provided, the group supports all zones in the region. If provided, - * enforces each host in the group to be in the same zone. - * - * @param zones the zones value to set. - * @return the DedicatedHostGroupUpdate object itself. - */ - public DedicatedHostGroupUpdate withZones(List zones) { - this.zones = zones; - return this; - } - - /** {@inheritDoc} */ - @Override - public DedicatedHostGroupUpdate withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the platformFaultDomainCount property: Number of fault domains that the host group can span. - * - * @return the platformFaultDomainCount value. - */ - public Integer platformFaultDomainCount() { - return this.innerProperties() == null ? null : this.innerProperties().platformFaultDomainCount(); - } - - /** - * Set the platformFaultDomainCount property: Number of fault domains that the host group can span. - * - * @param platformFaultDomainCount the platformFaultDomainCount value to set. - * @return the DedicatedHostGroupUpdate object itself. - */ - public DedicatedHostGroupUpdate withPlatformFaultDomainCount(Integer platformFaultDomainCount) { - if (this.innerProperties() == null) { - this.innerProperties = new DedicatedHostGroupProperties(); - } - this.innerProperties().withPlatformFaultDomainCount(platformFaultDomainCount); - return this; - } - - /** - * Get the hosts property: A list of references to all dedicated hosts in the dedicated host group. - * - * @return the hosts value. - */ - public List hosts() { - return this.innerProperties() == null ? null : this.innerProperties().hosts(); - } - - /** - * Get the instanceView property: The dedicated host group instance view, which has the list of instance view of the - * dedicated hosts under the dedicated host group. - * - * @return the instanceView value. - */ - public DedicatedHostGroupInstanceView instanceView() { - return this.innerProperties() == null ? null : this.innerProperties().instanceView(); - } - - /** - * Get the supportAutomaticPlacement property: Specifies whether virtual machines or virtual machine scale sets can - * be placed automatically on the dedicated host group. Automatic placement means resources are allocated on - * dedicated hosts, that are chosen by Azure, under the dedicated host group. The value is defaulted to 'false' when - * not provided. <br><br>Minimum api-version: 2020-06-01. - * - * @return the supportAutomaticPlacement value. - */ - public Boolean supportAutomaticPlacement() { - return this.innerProperties() == null ? null : this.innerProperties().supportAutomaticPlacement(); - } - - /** - * Set the supportAutomaticPlacement property: Specifies whether virtual machines or virtual machine scale sets can - * be placed automatically on the dedicated host group. Automatic placement means resources are allocated on - * dedicated hosts, that are chosen by Azure, under the dedicated host group. The value is defaulted to 'false' when - * not provided. <br><br>Minimum api-version: 2020-06-01. - * - * @param supportAutomaticPlacement the supportAutomaticPlacement value to set. - * @return the DedicatedHostGroupUpdate object itself. - */ - public DedicatedHostGroupUpdate withSupportAutomaticPlacement(Boolean supportAutomaticPlacement) { - if (this.innerProperties() == null) { - this.innerProperties = new DedicatedHostGroupProperties(); - } - this.innerProperties().withSupportAutomaticPlacement(supportAutomaticPlacement); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DedicatedHostInstanceView.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DedicatedHostInstanceView.java deleted file mode 100644 index fefb256bff7c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DedicatedHostInstanceView.java +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The instance view of a dedicated host. */ -@Fluent -public class DedicatedHostInstanceView { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DedicatedHostInstanceView.class); - - /* - * Specifies the unique id of the dedicated physical machine on which the - * dedicated host resides. - */ - @JsonProperty(value = "assetId", access = JsonProperty.Access.WRITE_ONLY) - private String assetId; - - /* - * Unutilized capacity of the dedicated host. - */ - @JsonProperty(value = "availableCapacity") - private DedicatedHostAvailableCapacity availableCapacity; - - /* - * The resource status information. - */ - @JsonProperty(value = "statuses") - private List statuses; - - /** - * Get the assetId property: Specifies the unique id of the dedicated physical machine on which the dedicated host - * resides. - * - * @return the assetId value. - */ - public String assetId() { - return this.assetId; - } - - /** - * Get the availableCapacity property: Unutilized capacity of the dedicated host. - * - * @return the availableCapacity value. - */ - public DedicatedHostAvailableCapacity availableCapacity() { - return this.availableCapacity; - } - - /** - * Set the availableCapacity property: Unutilized capacity of the dedicated host. - * - * @param availableCapacity the availableCapacity value to set. - * @return the DedicatedHostInstanceView object itself. - */ - public DedicatedHostInstanceView withAvailableCapacity(DedicatedHostAvailableCapacity availableCapacity) { - this.availableCapacity = availableCapacity; - return this; - } - - /** - * Get the statuses property: The resource status information. - * - * @return the statuses value. - */ - public List statuses() { - return this.statuses; - } - - /** - * Set the statuses property: The resource status information. - * - * @param statuses the statuses value to set. - * @return the DedicatedHostInstanceView object itself. - */ - public DedicatedHostInstanceView withStatuses(List statuses) { - this.statuses = statuses; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (availableCapacity() != null) { - availableCapacity().validate(); - } - if (statuses() != null) { - statuses().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DedicatedHostInstanceViewWithName.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DedicatedHostInstanceViewWithName.java deleted file mode 100644 index 35b29510838f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DedicatedHostInstanceViewWithName.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** - * The instance view of a dedicated host that includes the name of the dedicated host. It is used for the response to - * the instance view of a dedicated host group. - */ -@Fluent -public final class DedicatedHostInstanceViewWithName extends DedicatedHostInstanceView { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DedicatedHostInstanceViewWithName.class); - - /* - * The name of the dedicated host. - */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) - private String name; - - /** - * Get the name property: The name of the dedicated host. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** {@inheritDoc} */ - @Override - public DedicatedHostInstanceViewWithName withAvailableCapacity(DedicatedHostAvailableCapacity availableCapacity) { - super.withAvailableCapacity(availableCapacity); - return this; - } - - /** {@inheritDoc} */ - @Override - public DedicatedHostInstanceViewWithName withStatuses(List statuses) { - super.withStatuses(statuses); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DedicatedHostLicenseTypes.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DedicatedHostLicenseTypes.java deleted file mode 100644 index 9ad58c504b2f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DedicatedHostLicenseTypes.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for DedicatedHostLicenseTypes. */ -public enum DedicatedHostLicenseTypes { - /** Enum value None. */ - NONE("None"), - - /** Enum value Windows_Server_Hybrid. */ - WINDOWS_SERVER_HYBRID("Windows_Server_Hybrid"), - - /** Enum value Windows_Server_Perpetual. */ - WINDOWS_SERVER_PERPETUAL("Windows_Server_Perpetual"); - - /** The actual serialized value for a DedicatedHostLicenseTypes instance. */ - private final String value; - - DedicatedHostLicenseTypes(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a DedicatedHostLicenseTypes instance. - * - * @param value the serialized value to parse. - * @return the parsed DedicatedHostLicenseTypes object, or null if unable to parse. - */ - @JsonCreator - public static DedicatedHostLicenseTypes fromString(String value) { - DedicatedHostLicenseTypes[] items = DedicatedHostLicenseTypes.values(); - for (DedicatedHostLicenseTypes item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DedicatedHostListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DedicatedHostListResult.java deleted file mode 100644 index cb2ef5da18f6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DedicatedHostListResult.java +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.fluent.models.DedicatedHostInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The list dedicated host operation response. */ -@Fluent -public final class DedicatedHostListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DedicatedHostListResult.class); - - /* - * The list of dedicated hosts - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * The URI to fetch the next page of dedicated hosts. Call ListNext() with - * this URI to fetch the next page of dedicated hosts. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: The list of dedicated hosts. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The list of dedicated hosts. - * - * @param value the value value to set. - * @return the DedicatedHostListResult object itself. - */ - public DedicatedHostListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URI to fetch the next page of dedicated hosts. Call ListNext() with this URI to - * fetch the next page of dedicated hosts. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The URI to fetch the next page of dedicated hosts. Call ListNext() with this URI to - * fetch the next page of dedicated hosts. - * - * @param nextLink the nextLink value to set. - * @return the DedicatedHostListResult object itself. - */ - public DedicatedHostListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model DedicatedHostListResult")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DedicatedHostUpdate.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DedicatedHostUpdate.java deleted file mode 100644 index 46528ca32a1d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DedicatedHostUpdate.java +++ /dev/null @@ -1,178 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.fluent.models.DedicatedHostProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; -import java.util.Map; - -/** Specifies information about the dedicated host. Only tags, autoReplaceOnFailure and licenseType may be updated. */ -@Fluent -public final class DedicatedHostUpdate extends UpdateResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DedicatedHostUpdate.class); - - /* - * Properties of the dedicated host. - */ - @JsonProperty(value = "properties") - private DedicatedHostProperties innerProperties; - - /** - * Get the innerProperties property: Properties of the dedicated host. - * - * @return the innerProperties value. - */ - private DedicatedHostProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public DedicatedHostUpdate withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the platformFaultDomain property: Fault domain of the dedicated host within a dedicated host group. - * - * @return the platformFaultDomain value. - */ - public Integer platformFaultDomain() { - return this.innerProperties() == null ? null : this.innerProperties().platformFaultDomain(); - } - - /** - * Set the platformFaultDomain property: Fault domain of the dedicated host within a dedicated host group. - * - * @param platformFaultDomain the platformFaultDomain value to set. - * @return the DedicatedHostUpdate object itself. - */ - public DedicatedHostUpdate withPlatformFaultDomain(Integer platformFaultDomain) { - if (this.innerProperties() == null) { - this.innerProperties = new DedicatedHostProperties(); - } - this.innerProperties().withPlatformFaultDomain(platformFaultDomain); - return this; - } - - /** - * Get the autoReplaceOnFailure property: Specifies whether the dedicated host should be replaced automatically in - * case of a failure. The value is defaulted to 'true' when not provided. - * - * @return the autoReplaceOnFailure value. - */ - public Boolean autoReplaceOnFailure() { - return this.innerProperties() == null ? null : this.innerProperties().autoReplaceOnFailure(); - } - - /** - * Set the autoReplaceOnFailure property: Specifies whether the dedicated host should be replaced automatically in - * case of a failure. The value is defaulted to 'true' when not provided. - * - * @param autoReplaceOnFailure the autoReplaceOnFailure value to set. - * @return the DedicatedHostUpdate object itself. - */ - public DedicatedHostUpdate withAutoReplaceOnFailure(Boolean autoReplaceOnFailure) { - if (this.innerProperties() == null) { - this.innerProperties = new DedicatedHostProperties(); - } - this.innerProperties().withAutoReplaceOnFailure(autoReplaceOnFailure); - return this; - } - - /** - * Get the hostId property: A unique id generated and assigned to the dedicated host by the platform. - * <br><br> Does not change throughout the lifetime of the host. - * - * @return the hostId value. - */ - public String hostId() { - return this.innerProperties() == null ? null : this.innerProperties().hostId(); - } - - /** - * Get the virtualMachines property: A list of references to all virtual machines in the Dedicated Host. - * - * @return the virtualMachines value. - */ - public List virtualMachines() { - return this.innerProperties() == null ? null : this.innerProperties().virtualMachines(); - } - - /** - * Get the licenseType property: Specifies the software license type that will be applied to the VMs deployed on the - * dedicated host. <br><br> Possible values are: <br><br> **None** <br><br> - * **Windows_Server_Hybrid** <br><br> **Windows_Server_Perpetual** <br><br> Default: - * **None**. - * - * @return the licenseType value. - */ - public DedicatedHostLicenseTypes licenseType() { - return this.innerProperties() == null ? null : this.innerProperties().licenseType(); - } - - /** - * Set the licenseType property: Specifies the software license type that will be applied to the VMs deployed on the - * dedicated host. <br><br> Possible values are: <br><br> **None** <br><br> - * **Windows_Server_Hybrid** <br><br> **Windows_Server_Perpetual** <br><br> Default: - * **None**. - * - * @param licenseType the licenseType value to set. - * @return the DedicatedHostUpdate object itself. - */ - public DedicatedHostUpdate withLicenseType(DedicatedHostLicenseTypes licenseType) { - if (this.innerProperties() == null) { - this.innerProperties = new DedicatedHostProperties(); - } - this.innerProperties().withLicenseType(licenseType); - return this; - } - - /** - * Get the provisioningTime property: The date when the host was first provisioned. - * - * @return the provisioningTime value. - */ - public OffsetDateTime provisioningTime() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningTime(); - } - - /** - * Get the provisioningState property: The provisioning state, which only appears in the response. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the instanceView property: The dedicated host instance view. - * - * @return the instanceView value. - */ - public DedicatedHostInstanceView instanceView() { - return this.innerProperties() == null ? null : this.innerProperties().instanceView(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DiagnosticsProfile.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DiagnosticsProfile.java deleted file mode 100644 index 3a548af587e0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DiagnosticsProfile.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Specifies the boot diagnostic settings state. <br><br>Minimum api-version: 2015-06-15. */ -@Fluent -public final class DiagnosticsProfile { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DiagnosticsProfile.class); - - /* - * Boot Diagnostics is a debugging feature which allows you to view Console - * Output and Screenshot to diagnose VM status.

You can easily - * view the output of your console log.

Azure also enables you to - * see a screenshot of the VM from the hypervisor. - */ - @JsonProperty(value = "bootDiagnostics") - private BootDiagnostics bootDiagnostics; - - /** - * Get the bootDiagnostics property: 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. - * - * @return the bootDiagnostics value. - */ - public BootDiagnostics bootDiagnostics() { - return this.bootDiagnostics; - } - - /** - * Set the bootDiagnostics property: 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. - * - * @param bootDiagnostics the bootDiagnostics value to set. - * @return the DiagnosticsProfile object itself. - */ - public DiagnosticsProfile withBootDiagnostics(BootDiagnostics bootDiagnostics) { - this.bootDiagnostics = bootDiagnostics; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (bootDiagnostics() != null) { - bootDiagnostics().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DiffDiskOptions.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DiffDiskOptions.java deleted file mode 100644 index 0548c706432f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DiffDiskOptions.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for DiffDiskOptions. */ -public final class DiffDiskOptions extends ExpandableStringEnum { - /** Static value Local for DiffDiskOptions. */ - public static final DiffDiskOptions LOCAL = fromString("Local"); - - /** - * Creates or finds a DiffDiskOptions from its string representation. - * - * @param name a name to look for. - * @return the corresponding DiffDiskOptions. - */ - @JsonCreator - public static DiffDiskOptions fromString(String name) { - return fromString(name, DiffDiskOptions.class); - } - - /** @return known DiffDiskOptions values. */ - public static Collection values() { - return values(DiffDiskOptions.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DiffDiskPlacement.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DiffDiskPlacement.java deleted file mode 100644 index c27b0c565300..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DiffDiskPlacement.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for DiffDiskPlacement. */ -public final class DiffDiskPlacement extends ExpandableStringEnum { - /** Static value CacheDisk for DiffDiskPlacement. */ - public static final DiffDiskPlacement CACHE_DISK = fromString("CacheDisk"); - - /** Static value ResourceDisk for DiffDiskPlacement. */ - public static final DiffDiskPlacement RESOURCE_DISK = fromString("ResourceDisk"); - - /** - * Creates or finds a DiffDiskPlacement from its string representation. - * - * @param name a name to look for. - * @return the corresponding DiffDiskPlacement. - */ - @JsonCreator - public static DiffDiskPlacement fromString(String name) { - return fromString(name, DiffDiskPlacement.class); - } - - /** @return known DiffDiskPlacement values. */ - public static Collection values() { - return values(DiffDiskPlacement.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DiffDiskSettings.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DiffDiskSettings.java deleted file mode 100644 index 295770b9b49b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DiffDiskSettings.java +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Describes the parameters of ephemeral disk settings that can be specified for operating system disk. - * <br><br> NOTE: The ephemeral disk settings can only be specified for managed disk. - */ -@Fluent -public final class DiffDiskSettings { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DiffDiskSettings.class); - - /* - * Specifies the ephemeral disk settings for operating system disk. - */ - @JsonProperty(value = "option") - private DiffDiskOptions option; - - /* - * Specifies the ephemeral disk placement for operating system - * disk.

Possible values are:

**CacheDisk**

- * **ResourceDisk**

Default: **CacheDisk** if one is configured - * for the VM size otherwise **ResourceDisk** is used.

Refer to VM - * size documentation for Windows VM at - * https://docs.microsoft.com/en-us/azure/virtual-machines/windows/sizes - * and Linux VM at - * https://docs.microsoft.com/en-us/azure/virtual-machines/linux/sizes to - * check which VM sizes exposes a cache disk. - */ - @JsonProperty(value = "placement") - private DiffDiskPlacement placement; - - /** - * Get the option property: Specifies the ephemeral disk settings for operating system disk. - * - * @return the option value. - */ - public DiffDiskOptions option() { - return this.option; - } - - /** - * Set the option property: Specifies the ephemeral disk settings for operating system disk. - * - * @param option the option value to set. - * @return the DiffDiskSettings object itself. - */ - public DiffDiskSettings withOption(DiffDiskOptions option) { - this.option = option; - return this; - } - - /** - * Get the placement property: Specifies the ephemeral disk placement for operating system disk.<br><br> - * Possible values are: <br><br> **CacheDisk** <br><br> **ResourceDisk** - * <br><br> Default: **CacheDisk** if one is configured for the VM size otherwise **ResourceDisk** is - * used.<br><br> Refer to VM size documentation for Windows VM at - * https://docs.microsoft.com/en-us/azure/virtual-machines/windows/sizes and Linux VM at - * https://docs.microsoft.com/en-us/azure/virtual-machines/linux/sizes to check which VM sizes exposes a cache disk. - * - * @return the placement value. - */ - public DiffDiskPlacement placement() { - return this.placement; - } - - /** - * Set the placement property: Specifies the ephemeral disk placement for operating system disk.<br><br> - * Possible values are: <br><br> **CacheDisk** <br><br> **ResourceDisk** - * <br><br> Default: **CacheDisk** if one is configured for the VM size otherwise **ResourceDisk** is - * used.<br><br> Refer to VM size documentation for Windows VM at - * https://docs.microsoft.com/en-us/azure/virtual-machines/windows/sizes and Linux VM at - * https://docs.microsoft.com/en-us/azure/virtual-machines/linux/sizes to check which VM sizes exposes a cache disk. - * - * @param placement the placement value to set. - * @return the DiffDiskSettings object itself. - */ - public DiffDiskSettings withPlacement(DiffDiskPlacement placement) { - this.placement = placement; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/Disallowed.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/Disallowed.java deleted file mode 100644 index 569b20761328..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/Disallowed.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Describes the disallowed disk types. */ -@Fluent -public final class Disallowed { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Disallowed.class); - - /* - * A list of disk types. - */ - @JsonProperty(value = "diskTypes") - private List diskTypes; - - /** - * Get the diskTypes property: A list of disk types. - * - * @return the diskTypes value. - */ - public List diskTypes() { - return this.diskTypes; - } - - /** - * Set the diskTypes property: A list of disk types. - * - * @param diskTypes the diskTypes value to set. - * @return the Disallowed object itself. - */ - public Disallowed withDiskTypes(List diskTypes) { - this.diskTypes = diskTypes; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DisallowedConfiguration.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DisallowedConfiguration.java deleted file mode 100644 index 6ed3544ae6ae..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DisallowedConfiguration.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Specifies the disallowed configuration for a virtual machine image. */ -@Fluent -public final class DisallowedConfiguration { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DisallowedConfiguration.class); - - /* - * VM disk types which are disallowed. - */ - @JsonProperty(value = "vmDiskType") - private VmDiskTypes vmDiskType; - - /** - * Get the vmDiskType property: VM disk types which are disallowed. - * - * @return the vmDiskType value. - */ - public VmDiskTypes vmDiskType() { - return this.vmDiskType; - } - - /** - * Set the vmDiskType property: VM disk types which are disallowed. - * - * @param vmDiskType the vmDiskType value to set. - * @return the DisallowedConfiguration object itself. - */ - public DisallowedConfiguration withVmDiskType(VmDiskTypes vmDiskType) { - this.vmDiskType = vmDiskType; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/Disk.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/Disk.java deleted file mode 100644 index 00f257bdccc5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/Disk.java +++ /dev/null @@ -1,468 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.compute.ComputeManager; -import com.azure.resourcemanager.compute.fluent.models.DiskInner; -import com.azure.resourcemanager.resources.fluentcore.arm.AvailabilityZoneId; -import com.azure.resourcemanager.resources.fluentcore.arm.models.GroupableResource; -import com.azure.resourcemanager.resources.fluentcore.arm.models.Resource; -import com.azure.resourcemanager.resources.fluentcore.model.Accepted; -import com.azure.resourcemanager.resources.fluentcore.model.Appliable; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; -import com.azure.resourcemanager.resources.fluentcore.model.Updatable; -import com.azure.resourcemanager.storage.models.StorageAccount; -import java.util.Set; -import reactor.core.publisher.Mono; - -/** An immutable client-side representation of an Azure managed disk. */ -@Fluent -public interface Disk extends GroupableResource, Refreshable, Updatable { - /** @return the disk SKU */ - DiskSkuTypes sku(); - - /** @return the disk creation method */ - DiskCreateOption creationMethod(); - - /** @return true if the disk is attached to a virtual machine, otherwise false */ - boolean isAttachedToVirtualMachine(); - - /** - * @return the resource ID of the virtual machine this disk is attached to, or null if the disk is in a detached - * state - */ - String virtualMachineId(); - - /** @return disk size in GB */ - int sizeInGB(); - - /** @return disk size in byte */ - long sizeInByte(); - - /** @return the type of the operating system on the disk */ - OperatingSystemTypes osType(); - - /** @return the details of the source from which the disk is created */ - CreationSource source(); - - /** @return the availability zones assigned to the disk */ - Set availabilityZones(); - - /** @return the disk encryption settings */ - EncryptionSettingsCollection encryptionSettings(); - - /** - * Grants access to the disk. - * - * @param accessDurationInSeconds the access duration in seconds - * @return the read-only SAS URI to the disk - */ - String grantAccess(int accessDurationInSeconds); - - /** - * Grants access to the disk asynchronously. - * - * @param accessDurationInSeconds the access duration in seconds - * @return a representation of the deferred computation of this call returning a read-only SAS URI to the disk - */ - Mono grantAccessAsync(int accessDurationInSeconds); - - /** Revokes access granted to the disk. */ - void revokeAccess(); - - /** - * Revokes access granted to the disk asynchronously. - * - * @return a representation of the deferred computation of this call - */ - Mono revokeAccessAsync(); - - /** The entirety of the managed disk definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithGroup, - DefinitionStages.WithDiskSource, - DefinitionStages.WithWindowsDiskSource, - DefinitionStages.WithLinuxDiskSource, - DefinitionStages.WithData, - DefinitionStages.WithDataDiskSource, - DefinitionStages.WithDataDiskFromVhd, - DefinitionStages.WithDataDiskFromUpload, - DefinitionStages.WithDataDiskFromDisk, - DefinitionStages.WithDataDiskFromSnapshot, - DefinitionStages.WithStorageAccount, - DefinitionStages.WithCreateAndSize, - DefinitionStages.WithCreate { - } - - /** Grouping of managed disk definition stages. */ - interface DefinitionStages { - /** The first stage of a managed disk definition. */ - interface Blank extends GroupableResource.DefinitionWithRegion { - } - - /** The stage of a managed disk definition allowing to specify the resource group. */ - interface WithGroup extends GroupableResource.DefinitionStages.WithGroup { - } - - /** The stage of a managed disk definition allowing to choose OS source or data source. */ - interface WithDiskSource extends WithWindowsDiskSource, WithLinuxDiskSource, WithData { - } - - /** The stage of a managed disk definition allowing to choose a Windows OS source. */ - interface WithWindowsDiskSource { - /** - * Specifies a source Windows OS managed disk. - * - * @param sourceDiskId source managed disk resource ID - * @return the next stage of the definition - */ - WithCreateAndSize withWindowsFromDisk(String sourceDiskId); - - /** - * Specifies a source Windows OS managed disk. - * - * @param sourceDisk source managed disk - * @return the next stage of the definition - */ - WithCreateAndSize withWindowsFromDisk(Disk sourceDisk); - - /** - * Specifies a source Windows OS managed snapshot. - * - * @param sourceSnapshotId snapshot resource ID - * @return the next stage of the definition - */ - WithCreateAndSize withWindowsFromSnapshot(String sourceSnapshotId); - - /** - * Specifies a source Windows OS managed snapshot. - * - * @param sourceSnapshot source snapshot - * @return the next stage of the definition - */ - WithCreateAndSize withWindowsFromSnapshot(Snapshot sourceSnapshot); - - /** - * Specifies a source specialized or generalized Windows OS VHD. - * - * @param vhdUrl the source VHD URL - * @return the next stage of the definition - */ - WithStorageAccount withWindowsFromVhd(String vhdUrl); - } - - /** The stage of the managed disk definition allowing to choose Linux OS source. */ - interface WithLinuxDiskSource { - /** - * Specifies the source Linux OS managed disk. - * - * @param sourceDiskId source managed disk resource ID - * @return the next stage of the definition - */ - WithCreateAndSize withLinuxFromDisk(String sourceDiskId); - - /** - * Specifies the source Linux OS managed disk. - * - * @param sourceDisk source managed disk - * @return the next stage of the definition - */ - WithCreateAndSize withLinuxFromDisk(Disk sourceDisk); - - /** - * Specifies the source Linux OS managed snapshot. - * - * @param sourceSnapshotId snapshot resource ID - * @return the next stage of the definition - */ - WithCreateAndSize withLinuxFromSnapshot(String sourceSnapshotId); - - /** - * Specifies the source Linux OS managed snapshot. - * - * @param sourceSnapshot source snapshot - * @return the next stage of the definition - */ - WithCreateAndSize withLinuxFromSnapshot(Snapshot sourceSnapshot); - - /** - * Specifies the source specialized or generalized Linux OS VHD. - * - * @param vhdUrl the source VHD URL - * @return the next stage of the definition - */ - WithStorageAccount withLinuxFromVhd(String vhdUrl); - } - - /** The stage of the managed disk definition that specifies it hold data. */ - interface WithData { - /** - * Begins definition of managed disk containing data. - * - * @return the next stage of the definition - */ - WithDataDiskSource withData(); - } - - /** The stage of the managed disk definition allowing to choose data source. */ - interface WithDataDiskSource - extends WithDataDiskFromVhd, WithDataDiskFromUpload, WithDataDiskFromDisk, WithDataDiskFromSnapshot { - /** - * Specifies the disk size for an empty disk. - * - * @param sizeInGB the disk size in GB - * @return the next stage of the definition - */ - WithCreate withSizeInGB(int sizeInGB); - } - - /** The stage of the managed disk definition allowing to choose source data disk VHD. */ - interface WithDataDiskFromVhd { - /** - * Specifies the source data VHD. - * - * @param vhdUrl the source VHD URL - * @return the next stage of the definition - */ - WithStorageAccount fromVhd(String vhdUrl); - } - - /** The stage of the managed disk definition allowing to create disk from upload. */ - interface WithDataDiskFromUpload { - /** - * Gets or sets if createOption is Upload, this is the size of the contents of the upload including the VHD - * footer. This value should be between 20 (20 MiB) and 33554432 bytes (32 TiB). - * - * @param uploadSizeInMB The size of the contents of the upload in MB - * @return The next stage of the definition. - */ - WithCreate withUploadSizeInMB(long uploadSizeInMB); - } - - /** The stage of the managed disk definition allowing to choose managed disk containing data. */ - interface WithDataDiskFromDisk { - /** - * Specifies the ID of source data managed disk. - * - * @param managedDiskId source managed disk resource ID - * @return the next stage of the definition - */ - WithCreateAndSize fromDisk(String managedDiskId); - - /** - * Specifies the source data managed disk. - * - * @param managedDisk source managed disk - * @return the next stage of the definition - */ - WithCreateAndSize fromDisk(Disk managedDisk); - } - - /** The stage of the managed disk definition allowing to choose managed snapshot containing data. */ - interface WithDataDiskFromSnapshot { - /** - * Specifies the source data managed snapshot. - * - * @param snapshotId snapshot resource ID - * @return the next stage of the definition - */ - WithCreateAndSize fromSnapshot(String snapshotId); - - /** - * Specifies the source data managed snapshot. - * - * @param snapshot snapshot resource - * @return the next stage of the definition - */ - WithCreateAndSize fromSnapshot(Snapshot snapshot); - } - - /** The stage of the managed disk definition allowing to choose source operating system image. */ - interface WithOSDiskFromImage { - /** - * Specifies the ID of an image containing the operating system. - * - * @param imageId image resource ID - * @param osType operating system type - * @return the next stage of the definition - */ - WithCreateAndSize fromImage(String imageId, OperatingSystemTypes osType); - - /** - * Specifies an image containing the operating system. - * - * @param image the image - * @return the next stage of the definition - */ - WithCreateAndSize fromImage(VirtualMachineImage image); - - /** - * Specifies a custom image containing the operating system. - * - * @param image the image - * @return the next stage of the definition - */ - WithCreateAndSize fromImage(VirtualMachineCustomImage image); - } - /** The stage of the managed disk definition allowing to choose source data disk image. */ - interface WithDataDiskFromImage { - /** - * Specifies the ID of an image containing source data disk image. - * - * @param imageId image resource ID - * @param diskLun LUN of the disk image - * @return the next stage of the definition - */ - WithCreateAndSize fromImage(String imageId, int diskLun); - - /** - * Specifies an image containing source data disk image. - * - * @param image the image - * @param diskLun LUN of the disk image - * @return the next stage of the definition - */ - WithCreateAndSize fromImage(VirtualMachineImage image, int diskLun); - - /** - * Specifies a custom image containing a source data disk image. - * - * @param image the image - * @param diskLun LUN of the disk image - * @return the next stage of the definition - */ - WithCreateAndSize fromImage(VirtualMachineCustomImage image, int diskLun); - } - - /** - * The stage of the managed disk definition allowing to specify storage account that contains disk information. - * - *

It is mandatory in import option. - */ - interface WithStorageAccount { - /** - * Specifies the storage account id. - * - * @param storageAccountId the storage account id - * @return the next stage of the definition - */ - WithCreateAndSize withStorageAccountId(String storageAccountId); - - /** - * Specifies the storage account name in same resource group. - * - * @param storageAccountName the storage account name in same resource group - * @return the next stage of the definition - */ - WithCreateAndSize withStorageAccountName(String storageAccountName); - - /** - * Specifies the storage account. - * - * @param account the storage account - * @return the next stage of the definition - */ - WithCreateAndSize withStorageAccount(StorageAccount account); - } - - /** The stage of the managed disk definition allowing to specify availability zone. */ - interface WithAvailabilityZone { - /** - * Specifies the availability zone for the managed disk. - * - * @param zoneId the zone identifier. - * @return the next stage of the definition - */ - WithCreate withAvailabilityZone(AvailabilityZoneId zoneId); - } - - /** The stage of the managed disk definition allowing to create the disk or optionally specify size. */ - interface WithCreateAndSize extends WithCreate { - /** - * Specifies the disk size. - * - * @param sizeInGB the disk size in GB - * @return the next stage of the definition - */ - WithCreate withSizeInGB(int sizeInGB); - } - - /** The stage of the managed disk definition allowing to choose account type. */ - interface WithSku { - /** - * Specifies the SKU. - * - * @param sku the SKU - * @return the next stage of the definition - */ - WithCreate withSku(DiskSkuTypes sku); - } - - /** - * The stage of the definition which contains all the minimum required inputs for the resource to be created, - * but also allows for any other optional settings to be specified. - */ - interface WithCreate - extends Creatable, - Resource.DefinitionWithTags, - WithSku, - WithAvailabilityZone { - - /** - * Begins creating the disk resource. - * - * @return the accepted create operation - */ - Accepted beginCreate(); - } - } - - /** Grouping of managed disk update stages. */ - interface UpdateStages { - /** The stage of the managed disk update allowing to choose the SKU type. */ - interface WithSku { - /** - * Specifies the SKU. - * - * @param sku a SKU - * @return the next stage of the update - */ - Update withSku(DiskSkuTypes sku); - } - - /** The stage of the managed disk definition allowing to specify new size. */ - interface WithSize { - /** - * Specifies the disk size. - * - * @param sizeInGB the disk size in GB - * @return the next stage of the update - */ - Update withSizeInGB(int sizeInGB); - } - - /** The stage of the managed disk update allowing to specify OS settings. */ - interface WithOSSettings { - /** - * Specifies the operating system. - * - * @param osType operating system type - * @return the next stage of the update - */ - Update withOSType(OperatingSystemTypes osType); - } - } - - /** The template for an update operation, containing all the settings that can be modified. */ - interface Update - extends Appliable, - Resource.UpdateWithTags, - UpdateStages.WithSku, - UpdateStages.WithSize, - UpdateStages.WithOSSettings { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DiskCreateOption.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DiskCreateOption.java deleted file mode 100644 index 071885c87aa2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DiskCreateOption.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for DiskCreateOption. */ -public final class DiskCreateOption extends ExpandableStringEnum { - /** Static value Empty for DiskCreateOption. */ - public static final DiskCreateOption EMPTY = fromString("Empty"); - - /** Static value Attach for DiskCreateOption. */ - public static final DiskCreateOption ATTACH = fromString("Attach"); - - /** Static value FromImage for DiskCreateOption. */ - public static final DiskCreateOption FROM_IMAGE = fromString("FromImage"); - - /** Static value Import for DiskCreateOption. */ - public static final DiskCreateOption IMPORT = fromString("Import"); - - /** Static value Copy for DiskCreateOption. */ - public static final DiskCreateOption COPY = fromString("Copy"); - - /** Static value Restore for DiskCreateOption. */ - public static final DiskCreateOption RESTORE = fromString("Restore"); - - /** Static value Upload for DiskCreateOption. */ - public static final DiskCreateOption UPLOAD = fromString("Upload"); - - /** - * Creates or finds a DiskCreateOption from its string representation. - * - * @param name a name to look for. - * @return the corresponding DiskCreateOption. - */ - @JsonCreator - public static DiskCreateOption fromString(String name) { - return fromString(name, DiskCreateOption.class); - } - - /** @return known DiskCreateOption values. */ - public static Collection values() { - return values(DiskCreateOption.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DiskCreateOptionTypes.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DiskCreateOptionTypes.java deleted file mode 100644 index 8e220055cc35..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DiskCreateOptionTypes.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for DiskCreateOptionTypes. */ -public final class DiskCreateOptionTypes extends ExpandableStringEnum { - /** Static value FromImage for DiskCreateOptionTypes. */ - public static final DiskCreateOptionTypes FROM_IMAGE = fromString("FromImage"); - - /** Static value Empty for DiskCreateOptionTypes. */ - public static final DiskCreateOptionTypes EMPTY = fromString("Empty"); - - /** Static value Attach for DiskCreateOptionTypes. */ - public static final DiskCreateOptionTypes ATTACH = fromString("Attach"); - - /** - * Creates or finds a DiskCreateOptionTypes from its string representation. - * - * @param name a name to look for. - * @return the corresponding DiskCreateOptionTypes. - */ - @JsonCreator - public static DiskCreateOptionTypes fromString(String name) { - return fromString(name, DiskCreateOptionTypes.class); - } - - /** @return known DiskCreateOptionTypes values. */ - public static Collection values() { - return values(DiskCreateOptionTypes.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DiskEncryptionSetIdentityType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DiskEncryptionSetIdentityType.java deleted file mode 100644 index d298d05950cc..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DiskEncryptionSetIdentityType.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for DiskEncryptionSetIdentityType. */ -public final class DiskEncryptionSetIdentityType extends ExpandableStringEnum { - /** Static value SystemAssigned for DiskEncryptionSetIdentityType. */ - public static final DiskEncryptionSetIdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); - - /** - * Creates or finds a DiskEncryptionSetIdentityType from its string representation. - * - * @param name a name to look for. - * @return the corresponding DiskEncryptionSetIdentityType. - */ - @JsonCreator - public static DiskEncryptionSetIdentityType fromString(String name) { - return fromString(name, DiskEncryptionSetIdentityType.class); - } - - /** @return known DiskEncryptionSetIdentityType values. */ - public static Collection values() { - return values(DiskEncryptionSetIdentityType.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DiskEncryptionSetList.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DiskEncryptionSetList.java deleted file mode 100644 index 87573eba28b0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DiskEncryptionSetList.java +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.fluent.models.DiskEncryptionSetInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The List disk encryption set operation response. */ -@Fluent -public final class DiskEncryptionSetList { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DiskEncryptionSetList.class); - - /* - * A list of disk encryption sets. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * The uri to fetch the next page of disk encryption sets. Call ListNext() - * with this to fetch the next page of disk encryption sets. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: A list of disk encryption sets. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: A list of disk encryption sets. - * - * @param value the value value to set. - * @return the DiskEncryptionSetList object itself. - */ - public DiskEncryptionSetList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The uri to fetch the next page of disk encryption sets. Call ListNext() with this to - * fetch the next page of disk encryption sets. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The uri to fetch the next page of disk encryption sets. Call ListNext() with this to - * fetch the next page of disk encryption sets. - * - * @param nextLink the nextLink value to set. - * @return the DiskEncryptionSetList object itself. - */ - public DiskEncryptionSetList withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model DiskEncryptionSetList")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DiskEncryptionSetParameters.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DiskEncryptionSetParameters.java deleted file mode 100644 index 42c39a094f4f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DiskEncryptionSetParameters.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; - -/** - * Describes the parameter of customer managed disk encryption set resource id that can be specified for disk. - * <br><br> NOTE: The disk encryption set resource id can only be specified for managed disk. Please refer - * https://aka.ms/mdssewithcmkoverview for more details. - */ -@Fluent -public final class DiskEncryptionSetParameters extends SubResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DiskEncryptionSetParameters.class); - - /** {@inheritDoc} */ - @Override - public DiskEncryptionSetParameters withId(String id) { - super.withId(id); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DiskEncryptionSetUpdate.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DiskEncryptionSetUpdate.java deleted file mode 100644 index d19e48f35d7c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DiskEncryptionSetUpdate.java +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.fluent.models.DiskEncryptionSetUpdateProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** disk encryption set update resource. */ -@Fluent -public final class DiskEncryptionSetUpdate { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DiskEncryptionSetUpdate.class); - - /* - * disk encryption set resource update properties. - */ - @JsonProperty(value = "properties") - private DiskEncryptionSetUpdateProperties innerProperties; - - /* - * Resource tags - */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map tags; - - /** - * Get the innerProperties property: disk encryption set resource update properties. - * - * @return the innerProperties value. - */ - private DiskEncryptionSetUpdateProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Resource tags. - * - * @param tags the tags value to set. - * @return the DiskEncryptionSetUpdate object itself. - */ - public DiskEncryptionSetUpdate withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Get the activeKey property: Key Vault Key Url and vault id of KeK, KeK is optional and when provided is used to - * unwrap the encryptionKey. - * - * @return the activeKey value. - */ - public KeyVaultAndKeyReference activeKey() { - return this.innerProperties() == null ? null : this.innerProperties().activeKey(); - } - - /** - * Set the activeKey property: Key Vault Key Url and vault id of KeK, KeK is optional and when provided is used to - * unwrap the encryptionKey. - * - * @param activeKey the activeKey value to set. - * @return the DiskEncryptionSetUpdate object itself. - */ - public DiskEncryptionSetUpdate withActiveKey(KeyVaultAndKeyReference activeKey) { - if (this.innerProperties() == null) { - this.innerProperties = new DiskEncryptionSetUpdateProperties(); - } - this.innerProperties().withActiveKey(activeKey); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DiskEncryptionSettings.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DiskEncryptionSettings.java deleted file mode 100644 index 741e32f5ed84..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DiskEncryptionSettings.java +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describes a Encryption Settings for a Disk. */ -@Fluent -public final class DiskEncryptionSettings { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DiskEncryptionSettings.class); - - /* - * Specifies the location of the disk encryption key, which is a Key Vault - * Secret. - */ - @JsonProperty(value = "diskEncryptionKey") - private KeyVaultSecretReference diskEncryptionKey; - - /* - * Specifies the location of the key encryption key in Key Vault. - */ - @JsonProperty(value = "keyEncryptionKey") - private KeyVaultKeyReference keyEncryptionKey; - - /* - * Specifies whether disk encryption should be enabled on the virtual - * machine. - */ - @JsonProperty(value = "enabled") - private Boolean enabled; - - /** - * Get the diskEncryptionKey property: Specifies the location of the disk encryption key, which is a Key Vault - * Secret. - * - * @return the diskEncryptionKey value. - */ - public KeyVaultSecretReference diskEncryptionKey() { - return this.diskEncryptionKey; - } - - /** - * Set the diskEncryptionKey property: Specifies the location of the disk encryption key, which is a Key Vault - * Secret. - * - * @param diskEncryptionKey the diskEncryptionKey value to set. - * @return the DiskEncryptionSettings object itself. - */ - public DiskEncryptionSettings withDiskEncryptionKey(KeyVaultSecretReference diskEncryptionKey) { - this.diskEncryptionKey = diskEncryptionKey; - return this; - } - - /** - * Get the keyEncryptionKey property: Specifies the location of the key encryption key in Key Vault. - * - * @return the keyEncryptionKey value. - */ - public KeyVaultKeyReference keyEncryptionKey() { - return this.keyEncryptionKey; - } - - /** - * Set the keyEncryptionKey property: Specifies the location of the key encryption key in Key Vault. - * - * @param keyEncryptionKey the keyEncryptionKey value to set. - * @return the DiskEncryptionSettings object itself. - */ - public DiskEncryptionSettings withKeyEncryptionKey(KeyVaultKeyReference keyEncryptionKey) { - this.keyEncryptionKey = keyEncryptionKey; - return this; - } - - /** - * Get the enabled property: Specifies whether disk encryption should be enabled on the virtual machine. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Specifies whether disk encryption should be enabled on the virtual machine. - * - * @param enabled the enabled value to set. - * @return the DiskEncryptionSettings object itself. - */ - public DiskEncryptionSettings withEnabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (diskEncryptionKey() != null) { - diskEncryptionKey().validate(); - } - if (keyEncryptionKey() != null) { - keyEncryptionKey().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DiskImageEncryption.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DiskImageEncryption.java deleted file mode 100644 index 37c33df6ead6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DiskImageEncryption.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** This is the disk image encryption base class. */ -@Fluent -public class DiskImageEncryption { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DiskImageEncryption.class); - - /* - * A relative URI containing the resource ID of the disk encryption set. - */ - @JsonProperty(value = "diskEncryptionSetId") - private String diskEncryptionSetId; - - /** - * Get the diskEncryptionSetId property: A relative URI containing the resource ID of the disk encryption set. - * - * @return the diskEncryptionSetId value. - */ - public String diskEncryptionSetId() { - return this.diskEncryptionSetId; - } - - /** - * Set the diskEncryptionSetId property: A relative URI containing the resource ID of the disk encryption set. - * - * @param diskEncryptionSetId the diskEncryptionSetId value to set. - * @return the DiskImageEncryption object itself. - */ - public DiskImageEncryption withDiskEncryptionSetId(String diskEncryptionSetId) { - this.diskEncryptionSetId = diskEncryptionSetId; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DiskInstanceView.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DiskInstanceView.java deleted file mode 100644 index 0acf413458a4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DiskInstanceView.java +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The instance view of the disk. */ -@Fluent -public final class DiskInstanceView { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DiskInstanceView.class); - - /* - * The disk name. - */ - @JsonProperty(value = "name") - private String name; - - /* - * Specifies the encryption settings for the OS Disk.

Minimum - * api-version: 2015-06-15 - */ - @JsonProperty(value = "encryptionSettings") - private List encryptionSettings; - - /* - * The resource status information. - */ - @JsonProperty(value = "statuses") - private List statuses; - - /** - * Get the name property: The disk name. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The disk name. - * - * @param name the name value to set. - * @return the DiskInstanceView object itself. - */ - public DiskInstanceView withName(String name) { - this.name = name; - return this; - } - - /** - * Get the encryptionSettings property: Specifies the encryption settings for the OS Disk. <br><br> - * Minimum api-version: 2015-06-15. - * - * @return the encryptionSettings value. - */ - public List encryptionSettings() { - return this.encryptionSettings; - } - - /** - * Set the encryptionSettings property: Specifies the encryption settings for the OS Disk. <br><br> - * Minimum api-version: 2015-06-15. - * - * @param encryptionSettings the encryptionSettings value to set. - * @return the DiskInstanceView object itself. - */ - public DiskInstanceView withEncryptionSettings(List encryptionSettings) { - this.encryptionSettings = encryptionSettings; - return this; - } - - /** - * Get the statuses property: The resource status information. - * - * @return the statuses value. - */ - public List statuses() { - return this.statuses; - } - - /** - * Set the statuses property: The resource status information. - * - * @param statuses the statuses value to set. - * @return the DiskInstanceView object itself. - */ - public DiskInstanceView withStatuses(List statuses) { - this.statuses = statuses; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (encryptionSettings() != null) { - encryptionSettings().forEach(e -> e.validate()); - } - if (statuses() != null) { - statuses().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DiskList.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DiskList.java deleted file mode 100644 index 9aa0ad55a2c7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DiskList.java +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.fluent.models.DiskInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The List Disks operation response. */ -@Fluent -public final class DiskList { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DiskList.class); - - /* - * A list of disks. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * The uri to fetch the next page of disks. Call ListNext() with this to - * fetch the next page of disks. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: A list of disks. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: A list of disks. - * - * @param value the value value to set. - * @return the DiskList object itself. - */ - public DiskList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The uri to fetch the next page of disks. Call ListNext() with this to fetch the next - * page of disks. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The uri to fetch the next page of disks. Call ListNext() with this to fetch the next - * page of disks. - * - * @param nextLink the nextLink value to set. - * @return the DiskList object itself. - */ - public DiskList withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError(new IllegalArgumentException("Missing required property value in model DiskList")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DiskSku.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DiskSku.java deleted file mode 100644 index 1024929adfe5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DiskSku.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The disks sku name. Can be Standard_LRS, Premium_LRS, StandardSSD_LRS, or UltraSSD_LRS. */ -@Fluent -public final class DiskSku { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DiskSku.class); - - /* - * The sku name. - */ - @JsonProperty(value = "name") - private DiskStorageAccountTypes name; - - /* - * The sku tier. - */ - @JsonProperty(value = "tier", access = JsonProperty.Access.WRITE_ONLY) - private String tier; - - /** - * Get the name property: The sku name. - * - * @return the name value. - */ - public DiskStorageAccountTypes name() { - return this.name; - } - - /** - * Set the name property: The sku name. - * - * @param name the name value to set. - * @return the DiskSku object itself. - */ - public DiskSku withName(DiskStorageAccountTypes name) { - this.name = name; - return this; - } - - /** - * Get the tier property: The sku tier. - * - * @return the tier value. - */ - public String tier() { - return this.tier; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DiskSkuTypes.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DiskSkuTypes.java deleted file mode 100644 index 61296af6ab9c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DiskSkuTypes.java +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.models; - -import java.util.Collection; -import java.util.HashMap; -import java.util.Locale; -import java.util.Map; - -/** Defines values for DiskSkuTypes. */ -// TODO: Naming: this should really be DiskSkuType -public final class DiskSkuTypes { - // This needs to be at the beginning for the initialization to happen correctly - private static final Map VALUES_BY_NAME = new HashMap<>(); - - /** Static value STANDARD_LRS for DiskSkuTypes. */ - public static final DiskSkuTypes STANDARD_LRS = new DiskSkuTypes(DiskStorageAccountTypes.STANDARD_LRS); - - /** Static value PREMIUM_LRS for DiskSkuTypes. */ - public static final DiskSkuTypes PREMIUM_LRS = new DiskSkuTypes(DiskStorageAccountTypes.PREMIUM_LRS); - - /** Static value STANDARD_SSD_LRS for DiskSkuTypes. */ - public static final DiskSkuTypes STANDARD_SSD_LRS = new DiskSkuTypes(DiskStorageAccountTypes.STANDARD_SSD_LRS); - - /** Static value ULTRA_SSD_LRS for DiskSkuTypes. */ - public static final DiskSkuTypes ULTRA_SSD_LRS = new DiskSkuTypes(DiskStorageAccountTypes.ULTRA_SSD_LRS); - - /** The actual serialized value for a DiskSkuTypes instance. */ - private final DiskStorageAccountTypes value; - - /** @return predefined disk SKU types */ - public static DiskSkuTypes[] values() { - Collection valuesCollection = VALUES_BY_NAME.values(); - return valuesCollection.toArray(new DiskSkuTypes[valuesCollection.size()]); - } - - /** - * Creates a custom value for DiskSkuTypes. - * - * @param value the custom value - */ - public DiskSkuTypes(DiskStorageAccountTypes value) { - // TODO: This constructor should be private, but keeping as is for now to keep 1.0.0 back compat - this.value = value; - if (value != null) { - VALUES_BY_NAME.put(value.toString().toLowerCase(Locale.ROOT), this); - } - } - - /** - * Parses a value into a disk SKU type and creates a new DiskSkuType instance if not found among the existing ones. - * - * @param value a disk SKU type name - * @return the parsed or created disk SKU type - */ - public static DiskSkuTypes fromStorageAccountType(DiskStorageAccountTypes value) { - if (value == null) { - return null; - } - - DiskSkuTypes result = VALUES_BY_NAME.get(value.toString().toLowerCase(Locale.ROOT)); - if (result != null) { - return result; - } else { - return new DiskSkuTypes(value); - } - } - - /** - * Parses a value into a disk SKU type and creates a new DiskSkuType instance if not found among the existing ones. - * - * @param diskSku a disk SKU type name - * @return the parsed or created disk SKU type - */ - public static DiskSkuTypes fromDiskSku(DiskSku diskSku) { - if (diskSku == null) { - return null; - } - return fromStorageAccountType(diskSku.name()); - } - - /** @return the account type associated with the SKU. */ - public DiskStorageAccountTypes accountType() { - return this.value; - } - - @Override - public int hashCode() { - return value.hashCode(); - } - - @Override - public boolean equals(Object obj) { - if (!(obj instanceof DiskSkuTypes)) { - return false; - } else if (obj == this) { - return true; - } else if (value == null) { - return ((DiskSkuTypes) obj).value == null; - } else { - return value.equals(((DiskSkuTypes) obj).value); - } - } - - @Override - public String toString() { - return value.toString(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DiskState.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DiskState.java deleted file mode 100644 index f0ca463b1db1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DiskState.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for DiskState. */ -public final class DiskState extends ExpandableStringEnum { - /** Static value Unattached for DiskState. */ - public static final DiskState UNATTACHED = fromString("Unattached"); - - /** Static value Attached for DiskState. */ - public static final DiskState ATTACHED = fromString("Attached"); - - /** Static value Reserved for DiskState. */ - public static final DiskState RESERVED = fromString("Reserved"); - - /** Static value ActiveSAS for DiskState. */ - public static final DiskState ACTIVE_SAS = fromString("ActiveSAS"); - - /** Static value ReadyToUpload for DiskState. */ - public static final DiskState READY_TO_UPLOAD = fromString("ReadyToUpload"); - - /** Static value ActiveUpload for DiskState. */ - public static final DiskState ACTIVE_UPLOAD = fromString("ActiveUpload"); - - /** - * Creates or finds a DiskState from its string representation. - * - * @param name a name to look for. - * @return the corresponding DiskState. - */ - @JsonCreator - public static DiskState fromString(String name) { - return fromString(name, DiskState.class); - } - - /** @return known DiskState values. */ - public static Collection values() { - return values(DiskState.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DiskStorageAccountTypes.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DiskStorageAccountTypes.java deleted file mode 100644 index 0fc937242e05..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DiskStorageAccountTypes.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for DiskStorageAccountTypes. */ -public final class DiskStorageAccountTypes extends ExpandableStringEnum { - /** Static value Standard_LRS for DiskStorageAccountTypes. */ - public static final DiskStorageAccountTypes STANDARD_LRS = fromString("Standard_LRS"); - - /** Static value Premium_LRS for DiskStorageAccountTypes. */ - public static final DiskStorageAccountTypes PREMIUM_LRS = fromString("Premium_LRS"); - - /** Static value StandardSSD_LRS for DiskStorageAccountTypes. */ - public static final DiskStorageAccountTypes STANDARD_SSD_LRS = fromString("StandardSSD_LRS"); - - /** Static value UltraSSD_LRS for DiskStorageAccountTypes. */ - public static final DiskStorageAccountTypes ULTRA_SSD_LRS = fromString("UltraSSD_LRS"); - - /** - * Creates or finds a DiskStorageAccountTypes from its string representation. - * - * @param name a name to look for. - * @return the corresponding DiskStorageAccountTypes. - */ - @JsonCreator - public static DiskStorageAccountTypes fromString(String name) { - return fromString(name, DiskStorageAccountTypes.class); - } - - /** @return known DiskStorageAccountTypes values. */ - public static Collection values() { - return values(DiskStorageAccountTypes.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DiskUpdate.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DiskUpdate.java deleted file mode 100644 index a4ab16d92b93..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DiskUpdate.java +++ /dev/null @@ -1,254 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.fluent.models.DiskUpdateProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** Disk update resource. */ -@Fluent -public final class DiskUpdate { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DiskUpdate.class); - - /* - * Disk resource update properties. - */ - @JsonProperty(value = "properties") - private DiskUpdateProperties innerProperties; - - /* - * Resource tags - */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map tags; - - /* - * The disks sku name. Can be Standard_LRS, Premium_LRS, StandardSSD_LRS, - * or UltraSSD_LRS. - */ - @JsonProperty(value = "sku") - private DiskSku sku; - - /** - * Get the innerProperties property: Disk resource update properties. - * - * @return the innerProperties value. - */ - private DiskUpdateProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Resource tags. - * - * @param tags the tags value to set. - * @return the DiskUpdate object itself. - */ - public DiskUpdate withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Get the sku property: The disks sku name. Can be Standard_LRS, Premium_LRS, StandardSSD_LRS, or UltraSSD_LRS. - * - * @return the sku value. - */ - public DiskSku sku() { - return this.sku; - } - - /** - * Set the sku property: The disks sku name. Can be Standard_LRS, Premium_LRS, StandardSSD_LRS, or UltraSSD_LRS. - * - * @param sku the sku value to set. - * @return the DiskUpdate object itself. - */ - public DiskUpdate withSku(DiskSku sku) { - this.sku = sku; - return this; - } - - /** - * Get the osType property: the Operating System type. - * - * @return the osType value. - */ - public OperatingSystemTypes osType() { - return this.innerProperties() == null ? null : this.innerProperties().osType(); - } - - /** - * Set the osType property: the Operating System type. - * - * @param osType the osType value to set. - * @return the DiskUpdate object itself. - */ - public DiskUpdate withOsType(OperatingSystemTypes osType) { - if (this.innerProperties() == null) { - this.innerProperties = new DiskUpdateProperties(); - } - this.innerProperties().withOsType(osType); - return this; - } - - /** - * Get the diskSizeGB property: If creationData.createOption is Empty, this field is mandatory and it indicates the - * size of the disk to create. If this field is present for updates or creation with other options, it indicates a - * resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's - * size. - * - * @return the diskSizeGB value. - */ - public Integer diskSizeGB() { - return this.innerProperties() == null ? null : this.innerProperties().diskSizeGB(); - } - - /** - * Set the diskSizeGB property: If creationData.createOption is Empty, this field is mandatory and it indicates the - * size of the disk to create. If this field is present for updates or creation with other options, it indicates a - * resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's - * size. - * - * @param diskSizeGB the diskSizeGB value to set. - * @return the DiskUpdate object itself. - */ - public DiskUpdate withDiskSizeGB(Integer diskSizeGB) { - if (this.innerProperties() == null) { - this.innerProperties = new DiskUpdateProperties(); - } - this.innerProperties().withDiskSizeGB(diskSizeGB); - return this; - } - - /** - * Get the encryptionSettingsCollection property: Encryption settings collection used be Azure Disk Encryption, can - * contain multiple encryption settings per disk or snapshot. - * - * @return the encryptionSettingsCollection value. - */ - public EncryptionSettingsCollection encryptionSettingsCollection() { - return this.innerProperties() == null ? null : this.innerProperties().encryptionSettingsCollection(); - } - - /** - * Set the encryptionSettingsCollection property: Encryption settings collection used be Azure Disk Encryption, can - * contain multiple encryption settings per disk or snapshot. - * - * @param encryptionSettingsCollection the encryptionSettingsCollection value to set. - * @return the DiskUpdate object itself. - */ - public DiskUpdate withEncryptionSettingsCollection(EncryptionSettingsCollection encryptionSettingsCollection) { - if (this.innerProperties() == null) { - this.innerProperties = new DiskUpdateProperties(); - } - this.innerProperties().withEncryptionSettingsCollection(encryptionSettingsCollection); - return this; - } - - /** - * Get the diskIopsReadWrite property: The number of IOPS allowed for this disk; only settable for UltraSSD disks. - * One operation can transfer between 4k and 256k bytes. - * - * @return the diskIopsReadWrite value. - */ - public Long diskIopsReadWrite() { - return this.innerProperties() == null ? null : this.innerProperties().diskIopsReadWrite(); - } - - /** - * Set the diskIopsReadWrite property: The number of IOPS allowed for this disk; only settable for UltraSSD disks. - * One operation can transfer between 4k and 256k bytes. - * - * @param diskIopsReadWrite the diskIopsReadWrite value to set. - * @return the DiskUpdate object itself. - */ - public DiskUpdate withDiskIopsReadWrite(Long diskIopsReadWrite) { - if (this.innerProperties() == null) { - this.innerProperties = new DiskUpdateProperties(); - } - this.innerProperties().withDiskIopsReadWrite(diskIopsReadWrite); - return this; - } - - /** - * Get the diskMBpsReadWrite property: The bandwidth allowed for this disk; only settable for UltraSSD disks. MBps - * means millions of bytes per second - MB here uses the ISO notation, of powers of 10. - * - * @return the diskMBpsReadWrite value. - */ - public Integer diskMBpsReadWrite() { - return this.innerProperties() == null ? null : this.innerProperties().diskMBpsReadWrite(); - } - - /** - * Set the diskMBpsReadWrite property: The bandwidth allowed for this disk; only settable for UltraSSD disks. MBps - * means millions of bytes per second - MB here uses the ISO notation, of powers of 10. - * - * @param diskMBpsReadWrite the diskMBpsReadWrite value to set. - * @return the DiskUpdate object itself. - */ - public DiskUpdate withDiskMBpsReadWrite(Integer diskMBpsReadWrite) { - if (this.innerProperties() == null) { - this.innerProperties = new DiskUpdateProperties(); - } - this.innerProperties().withDiskMBpsReadWrite(diskMBpsReadWrite); - return this; - } - - /** - * Get the encryption property: Encryption property can be used to encrypt data at rest with customer managed keys - * or platform managed keys. - * - * @return the encryption value. - */ - public Encryption encryption() { - return this.innerProperties() == null ? null : this.innerProperties().encryption(); - } - - /** - * Set the encryption property: Encryption property can be used to encrypt data at rest with customer managed keys - * or platform managed keys. - * - * @param encryption the encryption value to set. - * @return the DiskUpdate object itself. - */ - public DiskUpdate withEncryption(Encryption encryption) { - if (this.innerProperties() == null) { - this.innerProperties = new DiskUpdateProperties(); - } - this.innerProperties().withEncryption(encryption); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - if (sku() != null) { - sku().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DiskVolumeEncryptionMonitor.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DiskVolumeEncryptionMonitor.java deleted file mode 100644 index 7f277a5a12c9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DiskVolumeEncryptionMonitor.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.models; - -import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; -import java.util.Map; -import reactor.core.publisher.Mono; - -/** Type that can be used to monitor encryption enable and disable status of a virtual machine. */ -public interface DiskVolumeEncryptionMonitor extends Refreshable { - /** @return operating system type of the virtual machine */ - OperatingSystemTypes osType(); - /** @return the encryption progress message */ - String progressMessage(); - /** @return operating system disk encryption status */ - EncryptionStatus osDiskStatus(); - /** @return data disks encryption status */ - EncryptionStatus dataDiskStatus(); - - /** @return disks encryption status from instance view level. */ - Map diskInstanceViewEncryptionStatuses(); - - /** - * @return a representation of the deferred computation of this call returning the encryption status once the - * refresh is done - */ - Mono refreshAsync(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DiskVolumeType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DiskVolumeType.java deleted file mode 100644 index a39192c2f2fc..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DiskVolumeType.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.models; - -/** Defines values for DiskVolumeType. */ -public enum DiskVolumeType { - /** Enum value OS. */ - OS("OS"), - - /** Enum value Data. */ - DATA("Data"), - - /** Enum value All. */ - ALL("All"); - - /** The actual serialized value for a DiskVolumeTypes instance. */ - private String value; - - DiskVolumeType(String value) { - this.value = value; - } - - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/Disks.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/Disks.java deleted file mode 100644 index 3444c92c73a2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/Disks.java +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.compute.ComputeManager; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsBatchDeletion; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsDeletingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsListingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsBatchCreation; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsCreating; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingById; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; -import com.azure.resourcemanager.resources.fluentcore.model.Accepted; -import reactor.core.publisher.Mono; - -/** Entry point to managed disk management API in Azure. */ -@Fluent -public interface Disks - extends SupportsCreating, - SupportsListing, - SupportsListingByResourceGroup, - SupportsGettingByResourceGroup, - SupportsGettingById, - SupportsDeletingById, - SupportsDeletingByResourceGroup, - SupportsBatchCreation, - SupportsBatchDeletion, - HasManager { - - /** - * Grants access to a disk. - * - * @param resourceGroupName a resource group name - * @param diskName a disk name - * @param accessLevel access level - * @param accessDuration access duration - * @return the read-only SAS URI to the disk - */ - String grantAccess(String resourceGroupName, String diskName, AccessLevel accessLevel, int accessDuration); - - /** - * Grants access to the disk asynchronously. - * - * @param resourceGroupName the resource group name - * @param diskName the disk name - * @param accessLevel access level - * @param accessDuration access duration - * @return a representation of the deferred computation of this call returning a read-only SAS URI to the disk - */ - Mono grantAccessAsync( - String resourceGroupName, String diskName, AccessLevel accessLevel, int accessDuration); - - /** - * Revoke access granted to a disk. - * - * @param resourceGroupName the resource group name - * @param diskName the disk name - */ - void revokeAccess(String resourceGroupName, String diskName); - - /** - * Revoke access granted to the snapshot asynchronously. - * - * @param resourceGroupName the resource group name - * @param diskName the disk name - * @return a representation of the deferred computation of this call - */ - Mono revokeAccessAsync(String resourceGroupName, String diskName); - - /** - * Begins deleting a disk from Azure, identifying it by its resource ID. - * - * @param id the resource ID of the disk to delete - * @return the accepted deleting operation - */ - Accepted beginDeleteById(String id); - - /** - * Begins deleting a disk from Azure, identifying it by its name and its resource group. - * - * @param resourceGroupName the resource group the resource is part of - * @param name the disk name - * @return the accepted deleting operation - */ - Accepted beginDeleteByResourceGroup(String resourceGroupName, String name); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/Encryption.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/Encryption.java deleted file mode 100644 index 2a28e9dd59d4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/Encryption.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Encryption at rest settings for disk or snapshot. */ -@Fluent -public final class Encryption { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Encryption.class); - - /* - * ResourceId of the disk encryption set to use for enabling encryption at - * rest. - */ - @JsonProperty(value = "diskEncryptionSetId") - private String diskEncryptionSetId; - - /* - * The type of key used to encrypt the data of the disk. - */ - @JsonProperty(value = "type", required = true) - private EncryptionType type; - - /** - * Get the diskEncryptionSetId property: ResourceId of the disk encryption set to use for enabling encryption at - * rest. - * - * @return the diskEncryptionSetId value. - */ - public String diskEncryptionSetId() { - return this.diskEncryptionSetId; - } - - /** - * Set the diskEncryptionSetId property: ResourceId of the disk encryption set to use for enabling encryption at - * rest. - * - * @param diskEncryptionSetId the diskEncryptionSetId value to set. - * @return the Encryption object itself. - */ - public Encryption withDiskEncryptionSetId(String diskEncryptionSetId) { - this.diskEncryptionSetId = diskEncryptionSetId; - return this; - } - - /** - * Get the type property: The type of key used to encrypt the data of the disk. - * - * @return the type value. - */ - public EncryptionType type() { - return this.type; - } - - /** - * Set the type property: The type of key used to encrypt the data of the disk. - * - * @param type the type value to set. - * @return the Encryption object itself. - */ - public Encryption withType(EncryptionType type) { - this.type = type; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (type() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property type in model Encryption")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/EncryptionImages.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/EncryptionImages.java deleted file mode 100644 index 70c6840dee0d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/EncryptionImages.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** - * Optional. Allows users to provide customer managed keys for encrypting the OS and data disks in the gallery artifact. - */ -@Fluent -public final class EncryptionImages { - @JsonIgnore private final ClientLogger logger = new ClientLogger(EncryptionImages.class); - - /* - * Contains encryption settings for an OS disk image. - */ - @JsonProperty(value = "osDiskImage") - private OSDiskImageEncryption osDiskImage; - - /* - * A list of encryption specifications for data disk images. - */ - @JsonProperty(value = "dataDiskImages") - private List dataDiskImages; - - /** - * Get the osDiskImage property: Contains encryption settings for an OS disk image. - * - * @return the osDiskImage value. - */ - public OSDiskImageEncryption osDiskImage() { - return this.osDiskImage; - } - - /** - * Set the osDiskImage property: Contains encryption settings for an OS disk image. - * - * @param osDiskImage the osDiskImage value to set. - * @return the EncryptionImages object itself. - */ - public EncryptionImages withOsDiskImage(OSDiskImageEncryption osDiskImage) { - this.osDiskImage = osDiskImage; - return this; - } - - /** - * Get the dataDiskImages property: A list of encryption specifications for data disk images. - * - * @return the dataDiskImages value. - */ - public List dataDiskImages() { - return this.dataDiskImages; - } - - /** - * Set the dataDiskImages property: A list of encryption specifications for data disk images. - * - * @param dataDiskImages the dataDiskImages value to set. - * @return the EncryptionImages object itself. - */ - public EncryptionImages withDataDiskImages(List dataDiskImages) { - this.dataDiskImages = dataDiskImages; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (osDiskImage() != null) { - osDiskImage().validate(); - } - if (dataDiskImages() != null) { - dataDiskImages().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/EncryptionSetIdentity.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/EncryptionSetIdentity.java deleted file mode 100644 index dd6126aaa0be..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/EncryptionSetIdentity.java +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * The managed identity for the disk encryption set. It should be given permission on the key vault before it can be - * used to encrypt disks. - */ -@Fluent -public class EncryptionSetIdentity { - @JsonIgnore private final ClientLogger logger = new ClientLogger(EncryptionSetIdentity.class); - - /* - * The type of Managed Identity used by the DiskEncryptionSet. Only - * SystemAssigned is supported. - */ - @JsonProperty(value = "type") - private DiskEncryptionSetIdentityType type; - - /* - * The object id of the Managed Identity Resource. This will be sent to the - * RP from ARM via the x-ms-identity-principal-id header in the PUT request - * if the resource has a systemAssigned(implicit) identity - */ - @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) - private String principalId; - - /* - * The tenant id of the Managed Identity Resource. This will be sent to the - * RP from ARM via the x-ms-client-tenant-id header in the PUT request if - * the resource has a systemAssigned(implicit) identity - */ - @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) - private String tenantId; - - /** - * Get the type property: The type of Managed Identity used by the DiskEncryptionSet. Only SystemAssigned is - * supported. - * - * @return the type value. - */ - public DiskEncryptionSetIdentityType type() { - return this.type; - } - - /** - * Set the type property: The type of Managed Identity used by the DiskEncryptionSet. Only SystemAssigned is - * supported. - * - * @param type the type value to set. - * @return the EncryptionSetIdentity object itself. - */ - public EncryptionSetIdentity withType(DiskEncryptionSetIdentityType type) { - this.type = type; - return this; - } - - /** - * Get the principalId property: The object id of the Managed Identity Resource. This will be sent to the RP from - * ARM via the x-ms-identity-principal-id header in the PUT request if the resource has a systemAssigned(implicit) - * identity. - * - * @return the principalId value. - */ - public String principalId() { - return this.principalId; - } - - /** - * Get the tenantId property: The tenant id of the Managed Identity Resource. This will be sent to the RP from ARM - * via the x-ms-client-tenant-id header in the PUT request if the resource has a systemAssigned(implicit) identity. - * - * @return the tenantId value. - */ - public String tenantId() { - return this.tenantId; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/EncryptionSettingsCollection.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/EncryptionSettingsCollection.java deleted file mode 100644 index 15634e1ce2f3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/EncryptionSettingsCollection.java +++ /dev/null @@ -1,120 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Encryption settings for disk or snapshot. */ -@Fluent -public final class EncryptionSettingsCollection { - @JsonIgnore private final ClientLogger logger = new ClientLogger(EncryptionSettingsCollection.class); - - /* - * Set this flag to true and provide DiskEncryptionKey and optional - * KeyEncryptionKey to enable encryption. Set this flag to false and remove - * DiskEncryptionKey and KeyEncryptionKey to disable encryption. If - * EncryptionSettings is null in the request object, the existing settings - * remain unchanged. - */ - @JsonProperty(value = "enabled", required = true) - private boolean enabled; - - /* - * A collection of encryption settings, one for each disk volume. - */ - @JsonProperty(value = "encryptionSettings") - private List encryptionSettings; - - /* - * Describes what type of encryption is used for the disks. Once this field - * is set, it cannot be overwritten. '1.0' corresponds to Azure Disk - * Encryption with AAD app.'1.1' corresponds to Azure Disk Encryption. - */ - @JsonProperty(value = "encryptionSettingsVersion") - private String encryptionSettingsVersion; - - /** - * Get the enabled property: Set this flag to true and provide DiskEncryptionKey and optional KeyEncryptionKey to - * enable encryption. Set this flag to false and remove DiskEncryptionKey and KeyEncryptionKey to disable - * encryption. If EncryptionSettings is null in the request object, the existing settings remain unchanged. - * - * @return the enabled value. - */ - public boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Set this flag to true and provide DiskEncryptionKey and optional KeyEncryptionKey to - * enable encryption. Set this flag to false and remove DiskEncryptionKey and KeyEncryptionKey to disable - * encryption. If EncryptionSettings is null in the request object, the existing settings remain unchanged. - * - * @param enabled the enabled value to set. - * @return the EncryptionSettingsCollection object itself. - */ - public EncryptionSettingsCollection withEnabled(boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the encryptionSettings property: A collection of encryption settings, one for each disk volume. - * - * @return the encryptionSettings value. - */ - public List encryptionSettings() { - return this.encryptionSettings; - } - - /** - * Set the encryptionSettings property: A collection of encryption settings, one for each disk volume. - * - * @param encryptionSettings the encryptionSettings value to set. - * @return the EncryptionSettingsCollection object itself. - */ - public EncryptionSettingsCollection withEncryptionSettings(List encryptionSettings) { - this.encryptionSettings = encryptionSettings; - return this; - } - - /** - * Get the encryptionSettingsVersion property: Describes what type of encryption is used for the disks. Once this - * field is set, it cannot be overwritten. '1.0' corresponds to Azure Disk Encryption with AAD app.'1.1' corresponds - * to Azure Disk Encryption. - * - * @return the encryptionSettingsVersion value. - */ - public String encryptionSettingsVersion() { - return this.encryptionSettingsVersion; - } - - /** - * Set the encryptionSettingsVersion property: Describes what type of encryption is used for the disks. Once this - * field is set, it cannot be overwritten. '1.0' corresponds to Azure Disk Encryption with AAD app.'1.1' corresponds - * to Azure Disk Encryption. - * - * @param encryptionSettingsVersion the encryptionSettingsVersion value to set. - * @return the EncryptionSettingsCollection object itself. - */ - public EncryptionSettingsCollection withEncryptionSettingsVersion(String encryptionSettingsVersion) { - this.encryptionSettingsVersion = encryptionSettingsVersion; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (encryptionSettings() != null) { - encryptionSettings().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/EncryptionSettingsElement.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/EncryptionSettingsElement.java deleted file mode 100644 index 5db1ce9e7934..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/EncryptionSettingsElement.java +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Encryption settings for one disk volume. */ -@Fluent -public final class EncryptionSettingsElement { - @JsonIgnore private final ClientLogger logger = new ClientLogger(EncryptionSettingsElement.class); - - /* - * Key Vault Secret Url and vault id of the disk encryption key - */ - @JsonProperty(value = "diskEncryptionKey") - private KeyVaultAndSecretReference diskEncryptionKey; - - /* - * Key Vault Key Url and vault id of the key encryption key. - * KeyEncryptionKey is optional and when provided is used to unwrap the - * disk encryption key. - */ - @JsonProperty(value = "keyEncryptionKey") - private KeyVaultAndKeyReference keyEncryptionKey; - - /** - * Get the diskEncryptionKey property: Key Vault Secret Url and vault id of the disk encryption key. - * - * @return the diskEncryptionKey value. - */ - public KeyVaultAndSecretReference diskEncryptionKey() { - return this.diskEncryptionKey; - } - - /** - * Set the diskEncryptionKey property: Key Vault Secret Url and vault id of the disk encryption key. - * - * @param diskEncryptionKey the diskEncryptionKey value to set. - * @return the EncryptionSettingsElement object itself. - */ - public EncryptionSettingsElement withDiskEncryptionKey(KeyVaultAndSecretReference diskEncryptionKey) { - this.diskEncryptionKey = diskEncryptionKey; - return this; - } - - /** - * Get the keyEncryptionKey property: Key Vault Key Url and vault id of the key encryption key. KeyEncryptionKey is - * optional and when provided is used to unwrap the disk encryption key. - * - * @return the keyEncryptionKey value. - */ - public KeyVaultAndKeyReference keyEncryptionKey() { - return this.keyEncryptionKey; - } - - /** - * Set the keyEncryptionKey property: Key Vault Key Url and vault id of the key encryption key. KeyEncryptionKey is - * optional and when provided is used to unwrap the disk encryption key. - * - * @param keyEncryptionKey the keyEncryptionKey value to set. - * @return the EncryptionSettingsElement object itself. - */ - public EncryptionSettingsElement withKeyEncryptionKey(KeyVaultAndKeyReference keyEncryptionKey) { - this.keyEncryptionKey = keyEncryptionKey; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (diskEncryptionKey() != null) { - diskEncryptionKey().validate(); - } - if (keyEncryptionKey() != null) { - keyEncryptionKey().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/EncryptionStatus.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/EncryptionStatus.java deleted file mode 100644 index bf7731b92592..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/EncryptionStatus.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.util.ExpandableStringEnum; - -import java.util.Collection; - -/** Defines values for EncryptionStatuses. */ -public final class EncryptionStatus extends ExpandableStringEnum { - /** Static value Encrypted for EncryptionInProgress. */ - public static final EncryptionStatus ENCRYPTION_INPROGRESS = fromString("EncryptionInProgress"); - - /** Static value Encrypted for EncryptionStatuses. */ - public static final EncryptionStatus ENCRYPTED = fromString("Encrypted"); - - /** Static value NotEncrypted for EncryptionStatuses. */ - public static final EncryptionStatus NOT_ENCRYPTED = fromString("NotEncrypted"); - - /** Static value VMRestartPending for EncryptionStatuses. */ - public static final EncryptionStatus VM_RESTART_PENDING = fromString("VMRestartPending"); - - /** Static value NotMounted for EncryptionStatuses. */ - public static final EncryptionStatus NOT_MOUNTED = fromString("NotMounted"); - - /** Static value Unknown for EncryptionStatuses. */ - public static final EncryptionStatus UNKNOWN = fromString("Unknown"); - - /** - * Creates of finds an encryption status based on its name. - * - * @param name a name to look for - * @return an EncryptionStatus - */ - public static EncryptionStatus fromString(String name) { - return fromString(name, EncryptionStatus.class); - } - - /** @return known encryption statuses */ - public static Collection values() { - return values(EncryptionStatus.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/EncryptionType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/EncryptionType.java deleted file mode 100644 index 3299fc24f893..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/EncryptionType.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for EncryptionType. */ -public final class EncryptionType extends ExpandableStringEnum { - /** Static value EncryptionAtRestWithPlatformKey for EncryptionType. */ - public static final EncryptionType ENCRYPTION_AT_REST_WITH_PLATFORM_KEY = - fromString("EncryptionAtRestWithPlatformKey"); - - /** Static value EncryptionAtRestWithCustomerKey for EncryptionType. */ - public static final EncryptionType ENCRYPTION_AT_REST_WITH_CUSTOMER_KEY = - fromString("EncryptionAtRestWithCustomerKey"); - - /** - * Creates or finds a EncryptionType from its string representation. - * - * @param name a name to look for. - * @return the corresponding EncryptionType. - */ - @JsonCreator - public static EncryptionType fromString(String name) { - return fromString(name, EncryptionType.class); - } - - /** @return known EncryptionType values. */ - public static Collection values() { - return values(EncryptionType.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ExecutionState.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ExecutionState.java deleted file mode 100644 index 7215fe509883..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ExecutionState.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ExecutionState. */ -public final class ExecutionState extends ExpandableStringEnum { - /** Static value Unknown for ExecutionState. */ - public static final ExecutionState UNKNOWN = fromString("Unknown"); - - /** Static value Pending for ExecutionState. */ - public static final ExecutionState PENDING = fromString("Pending"); - - /** Static value Running for ExecutionState. */ - public static final ExecutionState RUNNING = fromString("Running"); - - /** Static value Failed for ExecutionState. */ - public static final ExecutionState FAILED = fromString("Failed"); - - /** Static value Succeeded for ExecutionState. */ - public static final ExecutionState SUCCEEDED = fromString("Succeeded"); - - /** Static value TimedOut for ExecutionState. */ - public static final ExecutionState TIMED_OUT = fromString("TimedOut"); - - /** Static value Canceled for ExecutionState. */ - public static final ExecutionState CANCELED = fromString("Canceled"); - - /** - * Creates or finds a ExecutionState from its string representation. - * - * @param name a name to look for. - * @return the corresponding ExecutionState. - */ - @JsonCreator - public static ExecutionState fromString(String name) { - return fromString(name, ExecutionState.class); - } - - /** @return known ExecutionState values. */ - public static Collection values() { - return values(ExecutionState.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/Galleries.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/Galleries.java deleted file mode 100644 index 82422c9aa5c8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/Galleries.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsBatchDeletion; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsDeletingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsListingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsCreating; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; - -/** Entry point to galleries management API in Azure. */ -@Fluent -public interface Galleries - extends SupportsCreating, - SupportsDeletingByResourceGroup, - SupportsBatchDeletion, - SupportsGettingByResourceGroup, - SupportsListingByResourceGroup, - SupportsListing { -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/Gallery.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/Gallery.java deleted file mode 100644 index 030e1427e6d8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/Gallery.java +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.compute.ComputeManager; -import com.azure.resourcemanager.compute.fluent.models.GalleryInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.GroupableResource; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.models.Resource; -import com.azure.resourcemanager.resources.fluentcore.model.Appliable; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; -import com.azure.resourcemanager.resources.fluentcore.model.Updatable; -import reactor.core.publisher.Mono; - -/** An immutable client-side representation of an Azure gallery. */ -@Fluent -public interface Gallery - extends HasInnerModel, - Resource, - GroupableResource, - HasResourceGroup, - Refreshable, - Updatable, - HasManager { - /** @return description for the gallery resource. */ - String description(); - - /** @return the unique name of the gallery resource. */ - String uniqueName(); - - /** @return the provisioning state of the gallery resource. */ - String provisioningState(); - - /** - * Retrieves information about an image in the gallery. - * - * @param imageName The name of the image. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - Mono getImageAsync(String imageName); - - /** - * Retrieves information about an image in the gallery. - * - * @param imageName The name of the image. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the gallery image - */ - GalleryImage getImage(String imageName); - - /** - * List images in the gallery. - * - * @return the observable for the request - */ - PagedFlux listImagesAsync(); - - /** - * List images in the gallery. - * - * @return the list of images in the gallery - */ - PagedIterable listImages(); - - /** The entirety of the gallery definition. */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { - } - - /** Grouping of gallery definition stages. */ - interface DefinitionStages { - /** The first stage of a gallery definition. */ - interface Blank extends GroupableResource.DefinitionWithRegion { - } - - /** The stage of the gallery definition allowing to specify the resource group. */ - interface WithGroup extends GroupableResource.DefinitionStages.WithGroup { - } - - /** The stage of the gallery definition allowing to specify description. */ - interface WithDescription { - /** - * Specifies description for the gallery. - * - * @param description The description - * @return the next definition stage - */ - WithCreate withDescription(String description); - } - - /** - * The stage of the definition which contains all the minimum required inputs for the resource to be created - * (via {@link WithCreate#create()}), but also allows for any other optional settings to be specified. - */ - interface WithCreate - extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithDescription { - } - } - /** The template for a Gallery update operation, containing all the settings that can be modified. */ - interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithDescription { - } - - /** Grouping of gallery update stages. */ - interface UpdateStages { - /** The stage of the gallery update allowing to specify description. */ - interface WithDescription { - /** - * Specifies description for the gallery. - * - * @param description The description - * @return the next update stage - */ - Update withDescription(String description); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryApplicationList.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryApplicationList.java deleted file mode 100644 index 2cac5ba287c8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryApplicationList.java +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.fluent.models.GalleryApplicationInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The List Gallery Applications operation response. */ -@Fluent -public final class GalleryApplicationList { - @JsonIgnore private final ClientLogger logger = new ClientLogger(GalleryApplicationList.class); - - /* - * A list of Gallery Applications. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * The uri to fetch the next page of Application Definitions in the - * Application Gallery. Call ListNext() with this to fetch the next page of - * gallery Application Definitions. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: A list of Gallery Applications. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: A list of Gallery Applications. - * - * @param value the value value to set. - * @return the GalleryApplicationList object itself. - */ - public GalleryApplicationList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The uri to fetch the next page of Application Definitions in the Application Gallery. - * Call ListNext() with this to fetch the next page of gallery Application Definitions. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The uri to fetch the next page of Application Definitions in the Application Gallery. - * Call ListNext() with this to fetch the next page of gallery Application Definitions. - * - * @param nextLink the nextLink value to set. - * @return the GalleryApplicationList object itself. - */ - public GalleryApplicationList withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model GalleryApplicationList")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryApplicationUpdate.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryApplicationUpdate.java deleted file mode 100644 index 4a44c5250832..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryApplicationUpdate.java +++ /dev/null @@ -1,200 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.fluent.models.GalleryApplicationProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.Map; - -/** Specifies information about the gallery Application Definition that you want to update. */ -@Fluent -public final class GalleryApplicationUpdate extends UpdateResourceDefinition { - @JsonIgnore private final ClientLogger logger = new ClientLogger(GalleryApplicationUpdate.class); - - /* - * Describes the properties of a gallery Application Definition. - */ - @JsonProperty(value = "properties") - private GalleryApplicationProperties innerProperties; - - /** - * Get the innerProperties property: Describes the properties of a gallery Application Definition. - * - * @return the innerProperties value. - */ - private GalleryApplicationProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public GalleryApplicationUpdate withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the description property: The description of this gallery Application Definition resource. This property is - * updatable. - * - * @return the description value. - */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); - } - - /** - * Set the description property: The description of this gallery Application Definition resource. This property is - * updatable. - * - * @param description the description value to set. - * @return the GalleryApplicationUpdate object itself. - */ - public GalleryApplicationUpdate withDescription(String description) { - if (this.innerProperties() == null) { - this.innerProperties = new GalleryApplicationProperties(); - } - this.innerProperties().withDescription(description); - return this; - } - - /** - * Get the eula property: The Eula agreement for the gallery Application Definition. - * - * @return the eula value. - */ - public String eula() { - return this.innerProperties() == null ? null : this.innerProperties().eula(); - } - - /** - * Set the eula property: The Eula agreement for the gallery Application Definition. - * - * @param eula the eula value to set. - * @return the GalleryApplicationUpdate object itself. - */ - public GalleryApplicationUpdate withEula(String eula) { - if (this.innerProperties() == null) { - this.innerProperties = new GalleryApplicationProperties(); - } - this.innerProperties().withEula(eula); - return this; - } - - /** - * Get the privacyStatementUri property: The privacy statement uri. - * - * @return the privacyStatementUri value. - */ - public String privacyStatementUri() { - return this.innerProperties() == null ? null : this.innerProperties().privacyStatementUri(); - } - - /** - * Set the privacyStatementUri property: The privacy statement uri. - * - * @param privacyStatementUri the privacyStatementUri value to set. - * @return the GalleryApplicationUpdate object itself. - */ - public GalleryApplicationUpdate withPrivacyStatementUri(String privacyStatementUri) { - if (this.innerProperties() == null) { - this.innerProperties = new GalleryApplicationProperties(); - } - this.innerProperties().withPrivacyStatementUri(privacyStatementUri); - return this; - } - - /** - * Get the releaseNoteUri property: The release note uri. - * - * @return the releaseNoteUri value. - */ - public String releaseNoteUri() { - return this.innerProperties() == null ? null : this.innerProperties().releaseNoteUri(); - } - - /** - * Set the releaseNoteUri property: The release note uri. - * - * @param releaseNoteUri the releaseNoteUri value to set. - * @return the GalleryApplicationUpdate object itself. - */ - public GalleryApplicationUpdate withReleaseNoteUri(String releaseNoteUri) { - if (this.innerProperties() == null) { - this.innerProperties = new GalleryApplicationProperties(); - } - this.innerProperties().withReleaseNoteUri(releaseNoteUri); - return this; - } - - /** - * Get the endOfLifeDate property: The end of life date of the gallery Application Definition. This property can be - * used for decommissioning purposes. This property is updatable. - * - * @return the endOfLifeDate value. - */ - public OffsetDateTime endOfLifeDate() { - return this.innerProperties() == null ? null : this.innerProperties().endOfLifeDate(); - } - - /** - * Set the endOfLifeDate property: The end of life date of the gallery Application Definition. This property can be - * used for decommissioning purposes. This property is updatable. - * - * @param endOfLifeDate the endOfLifeDate value to set. - * @return the GalleryApplicationUpdate object itself. - */ - public GalleryApplicationUpdate withEndOfLifeDate(OffsetDateTime endOfLifeDate) { - if (this.innerProperties() == null) { - this.innerProperties = new GalleryApplicationProperties(); - } - this.innerProperties().withEndOfLifeDate(endOfLifeDate); - return this; - } - - /** - * Get the supportedOSType property: This property allows you to specify the supported type of the OS that - * application is built for. <br><br> Possible values are: <br><br> **Windows** - * <br><br> **Linux**. - * - * @return the supportedOSType value. - */ - public OperatingSystemTypes supportedOSType() { - return this.innerProperties() == null ? null : this.innerProperties().supportedOSType(); - } - - /** - * Set the supportedOSType property: This property allows you to specify the supported type of the OS that - * application is built for. <br><br> Possible values are: <br><br> **Windows** - * <br><br> **Linux**. - * - * @param supportedOSType the supportedOSType value to set. - * @return the GalleryApplicationUpdate object itself. - */ - public GalleryApplicationUpdate withSupportedOSType(OperatingSystemTypes supportedOSType) { - if (this.innerProperties() == null) { - this.innerProperties = new GalleryApplicationProperties(); - } - this.innerProperties().withSupportedOSType(supportedOSType); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryApplicationVersionList.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryApplicationVersionList.java deleted file mode 100644 index 8d7042ad63f1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryApplicationVersionList.java +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.fluent.models.GalleryApplicationVersionInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The List Gallery Application version operation response. */ -@Fluent -public final class GalleryApplicationVersionList { - @JsonIgnore private final ClientLogger logger = new ClientLogger(GalleryApplicationVersionList.class); - - /* - * A list of gallery Application Versions. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * The uri to fetch the next page of gallery Application Versions. Call - * ListNext() with this to fetch the next page of gallery Application - * Versions. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: A list of gallery Application Versions. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: A list of gallery Application Versions. - * - * @param value the value value to set. - * @return the GalleryApplicationVersionList object itself. - */ - public GalleryApplicationVersionList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The uri to fetch the next page of gallery Application Versions. Call ListNext() with - * this to fetch the next page of gallery Application Versions. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The uri to fetch the next page of gallery Application Versions. Call ListNext() with - * this to fetch the next page of gallery Application Versions. - * - * @param nextLink the nextLink value to set. - * @return the GalleryApplicationVersionList object itself. - */ - public GalleryApplicationVersionList withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property value in model GalleryApplicationVersionList")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryApplicationVersionPropertiesProvisioningState.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryApplicationVersionPropertiesProvisioningState.java deleted file mode 100644 index 75515a2e9327..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryApplicationVersionPropertiesProvisioningState.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for GalleryApplicationVersionPropertiesProvisioningState. */ -public final class GalleryApplicationVersionPropertiesProvisioningState - extends ExpandableStringEnum { - /** Static value Creating for GalleryApplicationVersionPropertiesProvisioningState. */ - public static final GalleryApplicationVersionPropertiesProvisioningState CREATING = fromString("Creating"); - - /** Static value Updating for GalleryApplicationVersionPropertiesProvisioningState. */ - public static final GalleryApplicationVersionPropertiesProvisioningState UPDATING = fromString("Updating"); - - /** Static value Failed for GalleryApplicationVersionPropertiesProvisioningState. */ - public static final GalleryApplicationVersionPropertiesProvisioningState FAILED = fromString("Failed"); - - /** Static value Succeeded for GalleryApplicationVersionPropertiesProvisioningState. */ - public static final GalleryApplicationVersionPropertiesProvisioningState SUCCEEDED = fromString("Succeeded"); - - /** Static value Deleting for GalleryApplicationVersionPropertiesProvisioningState. */ - public static final GalleryApplicationVersionPropertiesProvisioningState DELETING = fromString("Deleting"); - - /** Static value Migrating for GalleryApplicationVersionPropertiesProvisioningState. */ - public static final GalleryApplicationVersionPropertiesProvisioningState MIGRATING = fromString("Migrating"); - - /** - * Creates or finds a GalleryApplicationVersionPropertiesProvisioningState from its string representation. - * - * @param name a name to look for. - * @return the corresponding GalleryApplicationVersionPropertiesProvisioningState. - */ - @JsonCreator - public static GalleryApplicationVersionPropertiesProvisioningState fromString(String name) { - return fromString(name, GalleryApplicationVersionPropertiesProvisioningState.class); - } - - /** @return known GalleryApplicationVersionPropertiesProvisioningState values. */ - public static Collection values() { - return values(GalleryApplicationVersionPropertiesProvisioningState.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryApplicationVersionPublishingProfile.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryApplicationVersionPublishingProfile.java deleted file mode 100644 index a576ff9f111d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryApplicationVersionPublishingProfile.java +++ /dev/null @@ -1,152 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; - -/** The publishing profile of a gallery image version. */ -@Fluent -public final class GalleryApplicationVersionPublishingProfile extends GalleryArtifactPublishingProfileBase { - @JsonIgnore private final ClientLogger logger = new ClientLogger(GalleryApplicationVersionPublishingProfile.class); - - /* - * The source image from which the Image Version is going to be created. - */ - @JsonProperty(value = "source", required = true) - private UserArtifactSource source; - - /* - * The manageActions property. - */ - @JsonProperty(value = "manageActions") - private UserArtifactManage manageActions; - - /* - * Optional. Whether or not this application reports health. - */ - @JsonProperty(value = "enableHealthCheck") - private Boolean enableHealthCheck; - - /** - * Get the source property: The source image from which the Image Version is going to be created. - * - * @return the source value. - */ - public UserArtifactSource source() { - return this.source; - } - - /** - * Set the source property: The source image from which the Image Version is going to be created. - * - * @param source the source value to set. - * @return the GalleryApplicationVersionPublishingProfile object itself. - */ - public GalleryApplicationVersionPublishingProfile withSource(UserArtifactSource source) { - this.source = source; - return this; - } - - /** - * Get the manageActions property: The manageActions property. - * - * @return the manageActions value. - */ - public UserArtifactManage manageActions() { - return this.manageActions; - } - - /** - * Set the manageActions property: The manageActions property. - * - * @param manageActions the manageActions value to set. - * @return the GalleryApplicationVersionPublishingProfile object itself. - */ - public GalleryApplicationVersionPublishingProfile withManageActions(UserArtifactManage manageActions) { - this.manageActions = manageActions; - return this; - } - - /** - * Get the enableHealthCheck property: Optional. Whether or not this application reports health. - * - * @return the enableHealthCheck value. - */ - public Boolean enableHealthCheck() { - return this.enableHealthCheck; - } - - /** - * Set the enableHealthCheck property: Optional. Whether or not this application reports health. - * - * @param enableHealthCheck the enableHealthCheck value to set. - * @return the GalleryApplicationVersionPublishingProfile object itself. - */ - public GalleryApplicationVersionPublishingProfile withEnableHealthCheck(Boolean enableHealthCheck) { - this.enableHealthCheck = enableHealthCheck; - return this; - } - - /** {@inheritDoc} */ - @Override - public GalleryApplicationVersionPublishingProfile withTargetRegions(List targetRegions) { - super.withTargetRegions(targetRegions); - return this; - } - - /** {@inheritDoc} */ - @Override - public GalleryApplicationVersionPublishingProfile withReplicaCount(Integer replicaCount) { - super.withReplicaCount(replicaCount); - return this; - } - - /** {@inheritDoc} */ - @Override - public GalleryApplicationVersionPublishingProfile withExcludeFromLatest(Boolean excludeFromLatest) { - super.withExcludeFromLatest(excludeFromLatest); - return this; - } - - /** {@inheritDoc} */ - @Override - public GalleryApplicationVersionPublishingProfile withEndOfLifeDate(OffsetDateTime endOfLifeDate) { - super.withEndOfLifeDate(endOfLifeDate); - return this; - } - - /** {@inheritDoc} */ - @Override - public GalleryApplicationVersionPublishingProfile withStorageAccountType(StorageAccountType storageAccountType) { - super.withStorageAccountType(storageAccountType); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (source() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property source in model GalleryApplicationVersionPublishingProfile")); - } else { - source().validate(); - } - if (manageActions() != null) { - manageActions().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryApplicationVersionUpdate.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryApplicationVersionUpdate.java deleted file mode 100644 index 0ea725835e4a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryApplicationVersionUpdate.java +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.fluent.models.GalleryApplicationVersionProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** Specifies information about the gallery Application Version that you want to update. */ -@Fluent -public final class GalleryApplicationVersionUpdate extends UpdateResourceDefinition { - @JsonIgnore private final ClientLogger logger = new ClientLogger(GalleryApplicationVersionUpdate.class); - - /* - * Describes the properties of a gallery Image Version. - */ - @JsonProperty(value = "properties") - private GalleryApplicationVersionProperties innerProperties; - - /** - * Get the innerProperties property: Describes the properties of a gallery Image Version. - * - * @return the innerProperties value. - */ - private GalleryApplicationVersionProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public GalleryApplicationVersionUpdate withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the publishingProfile property: The publishing profile of a gallery image version. - * - * @return the publishingProfile value. - */ - public GalleryApplicationVersionPublishingProfile publishingProfile() { - return this.innerProperties() == null ? null : this.innerProperties().publishingProfile(); - } - - /** - * Set the publishingProfile property: The publishing profile of a gallery image version. - * - * @param publishingProfile the publishingProfile value to set. - * @return the GalleryApplicationVersionUpdate object itself. - */ - public GalleryApplicationVersionUpdate withPublishingProfile( - GalleryApplicationVersionPublishingProfile publishingProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new GalleryApplicationVersionProperties(); - } - this.innerProperties().withPublishingProfile(publishingProfile); - return this; - } - - /** - * Get the provisioningState property: The current state of the gallery Application Version. The provisioning state, - * which only appears in the response. - * - * @return the provisioningState value. - */ - public GalleryApplicationVersionPropertiesProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the replicationStatus property: This is the replication status of the gallery Image Version. - * - * @return the replicationStatus value. - */ - public ReplicationStatus replicationStatus() { - return this.innerProperties() == null ? null : this.innerProperties().replicationStatus(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryArtifactPublishingProfileBase.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryArtifactPublishingProfileBase.java deleted file mode 100644 index c5c69de5fbcb..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryArtifactPublishingProfileBase.java +++ /dev/null @@ -1,190 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; - -/** Describes the basic gallery artifact publishing profile. */ -@Fluent -public class GalleryArtifactPublishingProfileBase { - @JsonIgnore private final ClientLogger logger = new ClientLogger(GalleryArtifactPublishingProfileBase.class); - - /* - * The target regions where the Image Version is going to be replicated to. - * This property is updatable. - */ - @JsonProperty(value = "targetRegions") - private List targetRegions; - - /* - * The number of replicas of the Image Version to be created per region. - * This property would take effect for a region when regionalReplicaCount - * is not specified. This property is updatable. - */ - @JsonProperty(value = "replicaCount") - private Integer replicaCount; - - /* - * If set to true, Virtual Machines deployed from the latest version of the - * Image Definition won't use this Image Version. - */ - @JsonProperty(value = "excludeFromLatest") - private Boolean excludeFromLatest; - - /* - * The timestamp for when the gallery Image Version is published. - */ - @JsonProperty(value = "publishedDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime publishedDate; - - /* - * The end of life date of the gallery Image Version. This property can be - * used for decommissioning purposes. This property is updatable. - */ - @JsonProperty(value = "endOfLifeDate") - private OffsetDateTime endOfLifeDate; - - /* - * Specifies the storage account type to be used to store the image. This - * property is not updatable. - */ - @JsonProperty(value = "storageAccountType") - private StorageAccountType storageAccountType; - - /** - * Get the targetRegions property: The target regions where the Image Version is going to be replicated to. This - * property is updatable. - * - * @return the targetRegions value. - */ - public List targetRegions() { - return this.targetRegions; - } - - /** - * Set the targetRegions property: The target regions where the Image Version is going to be replicated to. This - * property is updatable. - * - * @param targetRegions the targetRegions value to set. - * @return the GalleryArtifactPublishingProfileBase object itself. - */ - public GalleryArtifactPublishingProfileBase withTargetRegions(List targetRegions) { - this.targetRegions = targetRegions; - return this; - } - - /** - * Get the replicaCount property: The number of replicas of the Image Version to be created per region. This - * property would take effect for a region when regionalReplicaCount is not specified. This property is updatable. - * - * @return the replicaCount value. - */ - public Integer replicaCount() { - return this.replicaCount; - } - - /** - * Set the replicaCount property: The number of replicas of the Image Version to be created per region. This - * property would take effect for a region when regionalReplicaCount is not specified. This property is updatable. - * - * @param replicaCount the replicaCount value to set. - * @return the GalleryArtifactPublishingProfileBase object itself. - */ - public GalleryArtifactPublishingProfileBase withReplicaCount(Integer replicaCount) { - this.replicaCount = replicaCount; - return this; - } - - /** - * Get the excludeFromLatest property: If set to true, Virtual Machines deployed from the latest version of the - * Image Definition won't use this Image Version. - * - * @return the excludeFromLatest value. - */ - public Boolean excludeFromLatest() { - return this.excludeFromLatest; - } - - /** - * Set the excludeFromLatest property: If set to true, Virtual Machines deployed from the latest version of the - * Image Definition won't use this Image Version. - * - * @param excludeFromLatest the excludeFromLatest value to set. - * @return the GalleryArtifactPublishingProfileBase object itself. - */ - public GalleryArtifactPublishingProfileBase withExcludeFromLatest(Boolean excludeFromLatest) { - this.excludeFromLatest = excludeFromLatest; - return this; - } - - /** - * Get the publishedDate property: The timestamp for when the gallery Image Version is published. - * - * @return the publishedDate value. - */ - public OffsetDateTime publishedDate() { - return this.publishedDate; - } - - /** - * Get the endOfLifeDate property: The end of life date of the gallery Image Version. This property can be used for - * decommissioning purposes. This property is updatable. - * - * @return the endOfLifeDate value. - */ - public OffsetDateTime endOfLifeDate() { - return this.endOfLifeDate; - } - - /** - * Set the endOfLifeDate property: The end of life date of the gallery Image Version. This property can be used for - * decommissioning purposes. This property is updatable. - * - * @param endOfLifeDate the endOfLifeDate value to set. - * @return the GalleryArtifactPublishingProfileBase object itself. - */ - public GalleryArtifactPublishingProfileBase withEndOfLifeDate(OffsetDateTime endOfLifeDate) { - this.endOfLifeDate = endOfLifeDate; - return this; - } - - /** - * Get the storageAccountType property: Specifies the storage account type to be used to store the image. This - * property is not updatable. - * - * @return the storageAccountType value. - */ - public StorageAccountType storageAccountType() { - return this.storageAccountType; - } - - /** - * Set the storageAccountType property: Specifies the storage account type to be used to store the image. This - * property is not updatable. - * - * @param storageAccountType the storageAccountType value to set. - * @return the GalleryArtifactPublishingProfileBase object itself. - */ - public GalleryArtifactPublishingProfileBase withStorageAccountType(StorageAccountType storageAccountType) { - this.storageAccountType = storageAccountType; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (targetRegions() != null) { - targetRegions().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryArtifactVersionSource.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryArtifactVersionSource.java deleted file mode 100644 index 034aca7177a5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryArtifactVersionSource.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The gallery artifact version source. */ -@Fluent -public final class GalleryArtifactVersionSource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(GalleryArtifactVersionSource.class); - - /* - * The id of the gallery artifact version source. Can specify a disk uri, - * snapshot uri, or user image. - */ - @JsonProperty(value = "id") - private String id; - - /** - * Get the id property: The id of the gallery artifact version source. Can specify a disk uri, snapshot uri, or user - * image. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: The id of the gallery artifact version source. Can specify a disk uri, snapshot uri, or user - * image. - * - * @param id the id value to set. - * @return the GalleryArtifactVersionSource object itself. - */ - public GalleryArtifactVersionSource withId(String id) { - this.id = id; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryDataDiskImage.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryDataDiskImage.java deleted file mode 100644 index 28d5fa6da455..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryDataDiskImage.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** This is the data disk image. */ -@Fluent -public final class GalleryDataDiskImage extends GalleryDiskImage { - @JsonIgnore private final ClientLogger logger = new ClientLogger(GalleryDataDiskImage.class); - - /* - * This property specifies the logical unit number of the data disk. This - * value is used to identify data disks within the Virtual Machine and - * therefore must be unique for each data disk attached to the Virtual - * Machine. - */ - @JsonProperty(value = "lun", required = true) - private int lun; - - /** - * Get the lun property: This property specifies the logical unit number of the data disk. This value is used to - * identify data disks within the Virtual Machine and therefore must be unique for each data disk attached to the - * Virtual Machine. - * - * @return the lun value. - */ - public int lun() { - return this.lun; - } - - /** - * Set the lun property: This property specifies the logical unit number of the data disk. This value is used to - * identify data disks within the Virtual Machine and therefore must be unique for each data disk attached to the - * Virtual Machine. - * - * @param lun the lun value to set. - * @return the GalleryDataDiskImage object itself. - */ - public GalleryDataDiskImage withLun(int lun) { - this.lun = lun; - return this; - } - - /** {@inheritDoc} */ - @Override - public GalleryDataDiskImage withHostCaching(HostCaching hostCaching) { - super.withHostCaching(hostCaching); - return this; - } - - /** {@inheritDoc} */ - @Override - public GalleryDataDiskImage withSource(GalleryArtifactVersionSource source) { - super.withSource(source); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryDiskImage.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryDiskImage.java deleted file mode 100644 index 43cbdd470d1f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryDiskImage.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** This is the disk image base class. */ -@Fluent -public class GalleryDiskImage { - @JsonIgnore private final ClientLogger logger = new ClientLogger(GalleryDiskImage.class); - - /* - * This property indicates the size of the VHD to be created. - */ - @JsonProperty(value = "sizeInGB", access = JsonProperty.Access.WRITE_ONLY) - private Integer sizeInGB; - - /* - * The host caching of the disk. Valid values are 'None', 'ReadOnly', and - * 'ReadWrite' - */ - @JsonProperty(value = "hostCaching") - private HostCaching hostCaching; - - /* - * The gallery artifact version source. - */ - @JsonProperty(value = "source") - private GalleryArtifactVersionSource source; - - /** - * Get the sizeInGB property: This property indicates the size of the VHD to be created. - * - * @return the sizeInGB value. - */ - public Integer sizeInGB() { - return this.sizeInGB; - } - - /** - * Get the hostCaching property: The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'. - * - * @return the hostCaching value. - */ - public HostCaching hostCaching() { - return this.hostCaching; - } - - /** - * Set the hostCaching property: The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'. - * - * @param hostCaching the hostCaching value to set. - * @return the GalleryDiskImage object itself. - */ - public GalleryDiskImage withHostCaching(HostCaching hostCaching) { - this.hostCaching = hostCaching; - return this; - } - - /** - * Get the source property: The gallery artifact version source. - * - * @return the source value. - */ - public GalleryArtifactVersionSource source() { - return this.source; - } - - /** - * Set the source property: The gallery artifact version source. - * - * @param source the source value to set. - * @return the GalleryDiskImage object itself. - */ - public GalleryDiskImage withSource(GalleryArtifactVersionSource source) { - this.source = source; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (source() != null) { - source().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryIdentifier.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryIdentifier.java deleted file mode 100644 index 4a5396d1f55d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryIdentifier.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describes the gallery unique name. */ -@Immutable -public final class GalleryIdentifier { - @JsonIgnore private final ClientLogger logger = new ClientLogger(GalleryIdentifier.class); - - /* - * The unique name of the Shared Image Gallery. This name is generated - * automatically by Azure. - */ - @JsonProperty(value = "uniqueName", access = JsonProperty.Access.WRITE_ONLY) - private String uniqueName; - - /** - * Get the uniqueName property: The unique name of the Shared Image Gallery. This name is generated automatically by - * Azure. - * - * @return the uniqueName value. - */ - public String uniqueName() { - return this.uniqueName; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryImage.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryImage.java deleted file mode 100644 index 6e3441b11e5a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryImage.java +++ /dev/null @@ -1,628 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.compute.ComputeManager; -import com.azure.resourcemanager.compute.fluent.models.GalleryImageInner; -import com.azure.core.management.Region; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.model.Appliable; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.model.Indexable; -import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; -import com.azure.resourcemanager.resources.fluentcore.model.Updatable; -import java.time.OffsetDateTime; -import java.util.List; -import java.util.Map; -import reactor.core.publisher.Mono; - -/** - * An immutable client-side representation of an Azure gallery image. A gallery image resource is a container for - * multiple versions of the same image. - */ -@Fluent -public interface GalleryImage - extends HasInnerModel, - Indexable, - Refreshable, - Updatable, - HasManager { - /** @return the description of the image. */ - String description(); - - /** @return the disk types not supported by the image. */ - List unsupportedDiskTypes(); - - /** @return a description of features not supported by the image. */ - Disallowed disallowed(); - - /** @return the date indicating image's end of life. */ - OffsetDateTime endOfLifeDate(); - - /** @return the image eula. */ - String eula(); - - /** @return the ARM id of the image. */ - String id(); - - /** @return an identifier describing publisher, offer and sku of the image. */ - GalleryImageIdentifier identifier(); - - /** @return the location of the image. */ - String location(); - - /** @return the image name. */ - String name(); - - /** @return the OS state of the image. */ - OperatingSystemStateTypes osState(); - - /** @return the image OS type. */ - OperatingSystemTypes osType(); - - /** @return the uri to image privacy statement. */ - String privacyStatementUri(); - - /** @return the provisioningState of image resource. */ - String provisioningState(); - - /** @return the purchasePlan of the image. */ - ImagePurchasePlan purchasePlan(); - - /** @return the value describing recommended configuration for a virtual machine based on this image. */ - RecommendedMachineConfiguration recommendedVirtualMachineConfiguration(); - - /** @return the uri to the image release note. */ - String releaseNoteUri(); - - /** @return the tags associated with the image. */ - Map tags(); - - /** @return the type value. */ - String type(); - - /** - * Retrieves information about an image version. - * - * @param versionName The name of the image. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - Mono getVersionAsync(String versionName); - - /** - * Retrieves information about an image version. - * - * @param versionName The name of the image version. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the image version - */ - GalleryImageVersion getVersion(String versionName); - - /** - * List image versions. - * - * @return the observable for the request - */ - PagedFlux listVersionsAsync(); - - /** - * List image versions. - * - * @return the list of image versions - */ - PagedIterable listVersions(); - - /** The entirety of the gallery image definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithGallery, - DefinitionStages.WithLocation, - DefinitionStages.WithIdentifier, - DefinitionStages.WithOsTypeAndState, - DefinitionStages.WithCreate { - } - - /** Grouping of gallery image definition stages. */ - interface DefinitionStages { - /** The first stage of a gallery image definition. */ - interface Blank extends WithGallery { - } - - /** The stage of the gallery image definition allowing to specify parent gallery it belongs to. */ - interface WithGallery { - /** - * Specifies the gallery in which this image resides. - * - * @param resourceGroupName The name of the resource group - * @param galleryName The name of the gallery - * @return the next definition stage - */ - WithLocation withExistingGallery(String resourceGroupName, String galleryName); - - /** - * Specifies the gallery in which this image resides. - * - * @param gallery the gallery - * @return the next definition stage - */ - WithLocation withExistingGallery(Gallery gallery); - } - - /** The stage of the gallery image definition allowing to specify location of the image. */ - interface WithLocation { - /** - * Specifies location. - * - * @param location resource location - * @return the next definition stage - */ - WithIdentifier withLocation(String location); - - /** - * Specifies location. - * - * @param location resource location - * @return the next definition stage - */ - WithIdentifier withLocation(Region location); - } - - /** - * The stage of the gallery image definition allowing to specify identifier that identifies publisher, offer and - * sku of the image. - */ - interface WithIdentifier { - /** - * Specifies identifier (publisher, offer and sku) for the image. - * - * @param identifier the identifier parameter value - * @return the next definition stage - */ - WithOsTypeAndState withIdentifier(GalleryImageIdentifier identifier); - - /** - * Specifies an identifier (publisher, offer and sku) for the image. - * - * @param publisher image publisher name - * @param offer image offer name - * @param sku image sku name - * @return the next definition stage - */ - WithOsTypeAndState withIdentifier(String publisher, String offer, String sku); - } - - /** - * The stage of the gallery image definition allowing to specify the OS type and state. - */ - interface WithOsTypeAndState { - /** - * Specifies that image is a Windows image with OS state as generalized. - * - * @return the next definition stage - */ - WithCreate withGeneralizedWindows(); - - /** - * Specifies that image is a Linux image with OS state as generalized. - * - * @return the next definition stage - */ - WithCreate withGeneralizedLinux(); - - /** - * Specifies that image is a Windows image. - * - * @param osState operating system state - * @return the next definition stage - */ - WithCreate withWindows(OperatingSystemStateTypes osState); - - /** - * Specifies that image is a Linux image. - * - * @param osState operating system state - * @return the next definition stage - */ - WithCreate withLinux(OperatingSystemStateTypes osState); - } - - /** The stage of the gallery image definition allowing to specify description. */ - interface WithDescription { - /** - * Specifies description. - * - * @param description the description of the gallery image - * @return the next definition stage - */ - WithCreate withDescription(String description); - } - - /** - * The stage of the gallery image definition allowing to specify settings disallowed for a virtual machine based - * on the image. - */ - interface WithDisallowed { - /** - * Specifies the disk type not supported by the image. - * - * @param diskType the disk type - * @return the next definition stage - */ - WithCreate withUnsupportedDiskType(DiskSkuTypes diskType); - - /** - * Specifies the disk types not supported by the image. - * - * @param diskTypes the disk types - * @return the next definition stage - */ - WithCreate withUnsupportedDiskTypes(List diskTypes); - - /** - * Specifies disallowed settings. - * - * @param disallowed the disallowed settings - * @return the next definition stage - */ - WithCreate withDisallowed(Disallowed disallowed); - } - - /** The stage of the gallery image definition allowing to specify end of life of the version. */ - interface WithEndOfLifeDate { - /** - * Specifies end of life date of the image. - * - * @param endOfLifeDate the end of life of the gallery image - * @return the next definition stage - */ - WithCreate withEndOfLifeDate(OffsetDateTime endOfLifeDate); - } - - /** The stage of the gallery image definition allowing to specify eula. */ - interface WithEula { - /** - * Specifies eula. - * - * @param eula the Eula agreement for the gallery image - * @return the next definition stage - */ - WithCreate withEula(String eula); - } - - /** The stage of the gallery image definition allowing to specify privacy statement uri. */ - interface WithPrivacyStatementUri { - /** - * Specifies image privacy statement uri. - * - * @param privacyStatementUri The privacy statement uri - * @return the next definition stage - */ - WithCreate withPrivacyStatementUri(String privacyStatementUri); - } - - /** The stage of the gallery image definition allowing to specify purchase plan. */ - interface WithPurchasePlan { - /** - * Specifies purchase plan for this image. - * - * @param name plan name - * @param publisher publisher name - * @param product product name - * @return the next definition stage - */ - WithCreate withPurchasePlan(String name, String publisher, String product); - - /** - * Specifies purchase plan for this image. - * - * @param purchasePlan the purchase plan - * @return the next definition stage - */ - WithCreate withPurchasePlan(ImagePurchasePlan purchasePlan); - } - - /** - * The stage of the gallery image definition allowing to specify recommended configuration for the virtual - * machine. - */ - interface WithRecommendedVMConfiguration { - /** - * Specifies the recommended minimum number of virtual CUPs for the virtual machine bases on the image. - * - * @param minCount the minimum number of virtual CPUs - * @return the next definition stage - */ - WithCreate withRecommendedMinimumCPUsCountForVirtualMachine(int minCount); - - /** - * Specifies the recommended maximum number of virtual CUPs for the virtual machine bases on this image. - * - * @param maxCount the maximum number of virtual CPUs - * @return the next definition stage - */ - WithCreate withRecommendedMaximumCPUsCountForVirtualMachine(int maxCount); - - /** - * Specifies the recommended virtual CUPs for the virtual machine bases on the image. - * - * @param minCount the minimum number of virtual CPUs - * @param maxCount the maximum number of virtual CPUs - * @return the next definition stage - */ - WithCreate withRecommendedCPUsCountForVirtualMachine(int minCount, int maxCount); - - /** - * Specifies the recommended minimum memory for the virtual machine bases on the image. - * - * @param minMB the minimum memory in MB - * @return the next definition stage - */ - WithCreate withRecommendedMinimumMemoryForVirtualMachine(int minMB); - - /** - * Specifies the recommended maximum memory for the virtual machine bases on the image. - * - * @param maxMB the maximum memory in MB - * @return the next definition stage - */ - WithCreate withRecommendedMaximumMemoryForVirtualMachine(int maxMB); - - /** - * Specifies the recommended memory for the virtual machine bases on the image. - * - * @param minMB the minimum memory in MB - * @param maxMB the maximum memory in MB - * @return the next definition stage - */ - WithCreate withRecommendedMemoryForVirtualMachine(int minMB, int maxMB); - - /** - * Specifies recommended configuration for the virtual machine based on the image. - * - * @param recommendedConfig the recommended configuration - * @return the next definition stage - */ - WithCreate withRecommendedConfigurationForVirtualMachine(RecommendedMachineConfiguration recommendedConfig); - } - - /** The stage of the gallery image definition allowing to specify uri to release note. */ - interface WithReleaseNoteUri { - /** - * Specifies uri to release note. - * - * @param releaseNoteUri the release note uri - * @return the next definition stage - */ - WithCreate withReleaseNoteUri(String releaseNoteUri); - } - - /** The stage of the gallery image definition allowing to specify tags. */ - interface WithTags { - /** - * Specifies tags. - * - * @param tags resource tags - * @return the next definition stage - */ - WithCreate withTags(Map tags); - } - - /** - * The stage of the definition which contains all the minimum required inputs for the resource to be created - * (via {@link WithCreate#create()}), but also allows for any other optional settings to be specified. - */ - interface WithCreate - extends Creatable, - DefinitionStages.WithDescription, - DefinitionStages.WithDisallowed, - DefinitionStages.WithEndOfLifeDate, - DefinitionStages.WithEula, - DefinitionStages.WithPrivacyStatementUri, - DefinitionStages.WithPurchasePlan, - DefinitionStages.WithRecommendedVMConfiguration, - DefinitionStages.WithReleaseNoteUri, - DefinitionStages.WithTags { - } - } - /** The template for a gallery image update operation, containing all the settings that can be modified. */ - interface Update - extends Appliable, - UpdateStages.WithDescription, - UpdateStages.WithDisallowed, - UpdateStages.WithEndOfLifeDate, - UpdateStages.WithEula, - UpdateStages.WithOsState, - UpdateStages.WithPrivacyStatementUri, - UpdateStages.WithRecommendedVMConfiguration, - UpdateStages.WithReleaseNoteUri, - UpdateStages.WithTags { - } - - /** Grouping of gallery image update stages. */ - interface UpdateStages { - /** The stage of the gallery image update allowing to specify description. */ - interface WithDescription { - /** - * Specifies description of the gallery image resource. - * - * @param description The description - * @return the next update stage - */ - Update withDescription(String description); - } - - /** - * The stage of the gallery image update allowing to specify settings disallowed for a virtual machine based on - * the image. - */ - interface WithDisallowed { - /** - * Specifies the disk type not supported by the image. - * - * @param diskType the disk type - * @return the next update stage - */ - Update withUnsupportedDiskType(DiskSkuTypes diskType); - - /** - * Specifies the disk types not supported by the image. - * - * @param diskTypes the disk types - * @return the next update stage - */ - Update withUnsupportedDiskTypes(List diskTypes); - - /** - * Specifies the disk type should be removed from the unsupported disk type. - * - * @param diskType the disk type - * @return the next update stage - */ - Update withoutUnsupportedDiskType(DiskSkuTypes diskType); - - /** - * Specifies disallowed settings. - * - * @param disallowed the disallowed settings - * @return the next update stage - */ - Update withDisallowed(Disallowed disallowed); - } - - /** The stage of the gallery image update allowing to specify EndOfLifeDate. */ - interface WithEndOfLifeDate { - /** - * Specifies end of life date of the image. - * - * @param endOfLifeDate the end of life of the gallery image - * @return the next update stage - */ - Update withEndOfLifeDate(OffsetDateTime endOfLifeDate); - } - - /** The stage of the gallery image update allowing to specify Eula. */ - interface WithEula { - /** - * Specifies eula. - * - * @param eula the Eula agreement for the gallery image - * @return the next update stage - */ - Update withEula(String eula); - } - - /** The stage of the gallery image update allowing to specify OsState. */ - interface WithOsState { - /** - * Specifies osState. - * - * @param osState the OS State. - * @return the next update stage - */ - Update withOsState(OperatingSystemStateTypes osState); - } - - /** The stage of the gallery image update allowing to specify privacy statement uri. */ - interface WithPrivacyStatementUri { - /** - * Specifies image privacy statement uri. - * - * @param privacyStatementUri the privacy statement uri - * @return the next update stage - */ - Update withPrivacyStatementUri(String privacyStatementUri); - } - - /** - * The stage of the gallery image definition allowing to specify recommended configuration for the virtual - * machine. - */ - interface WithRecommendedVMConfiguration { - /** - * Specifies the recommended minimum number of virtual CUPs for the virtual machine bases on the image. - * - * @param minCount the minimum number of virtual CPUs - * @return the next update stage - */ - Update withRecommendedMinimumCPUsCountForVirtualMachine(int minCount); - - /** - * Specifies the recommended maximum number of virtual CUPs for the virtual machine bases on the image. - * - * @param maxCount the maximum number of virtual CPUs - * @return the next update stage - */ - Update withRecommendedMaximumCPUsCountForVirtualMachine(int maxCount); - - /** - * Specifies the recommended virtual CUPs for the virtual machine bases on the image. - * - * @param minCount the minimum number of virtual CPUs - * @param maxCount the maximum number of virtual CPUs - * @return the next update stage - */ - Update withRecommendedCPUsCountForVirtualMachine(int minCount, int maxCount); - - /** - * Specifies the recommended minimum memory for the virtual machine bases on the image. - * - * @param minMB the minimum memory in MB - * @return the next update stage - */ - Update withRecommendedMinimumMemoryForVirtualMachine(int minMB); - - /** - * Specifies the recommended maximum memory for the virtual machine bases on the image. - * - * @param maxMB the maximum memory in MB - * @return the next update stage - */ - Update withRecommendedMaximumMemoryForVirtualMachine(int maxMB); - - /** - * Specifies the recommended virtual CUPs for the virtual machine bases on the image. - * - * @param minMB the minimum memory in MB - * @param maxMB the maximum memory in MB - * @return the next update stage - */ - Update withRecommendedMemoryForVirtualMachine(int minMB, int maxMB); - - /** - * Specifies recommended configuration for the virtual machine based on the image. - * - * @param recommendedConfig the recommended configuration - * @return the next update stage - */ - Update withRecommendedConfigurationForVirtualMachine(RecommendedMachineConfiguration recommendedConfig); - } - - /** The stage of the gallery image update allowing to specify uri to release note. */ - interface WithReleaseNoteUri { - /** - * Specifies release note uri. - * - * @param releaseNoteUri the release note uri - * @return the next update stage - */ - Update withReleaseNoteUri(String releaseNoteUri); - } - - /** The stage of the gallery image update allowing to specify Tags. */ - interface WithTags { - /** - * Specifies tags. - * - * @param tags resource tags - * @return the next update stage - */ - Update withTags(Map tags); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryImageIdentifier.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryImageIdentifier.java deleted file mode 100644 index e6af6dc833cb..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryImageIdentifier.java +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** This is the gallery Image Definition identifier. */ -@Fluent -public final class GalleryImageIdentifier { - @JsonIgnore private final ClientLogger logger = new ClientLogger(GalleryImageIdentifier.class); - - /* - * The name of the gallery Image Definition publisher. - */ - @JsonProperty(value = "publisher", required = true) - private String publisher; - - /* - * The name of the gallery Image Definition offer. - */ - @JsonProperty(value = "offer", required = true) - private String offer; - - /* - * The name of the gallery Image Definition SKU. - */ - @JsonProperty(value = "sku", required = true) - private String sku; - - /** - * Get the publisher property: The name of the gallery Image Definition publisher. - * - * @return the publisher value. - */ - public String publisher() { - return this.publisher; - } - - /** - * Set the publisher property: The name of the gallery Image Definition publisher. - * - * @param publisher the publisher value to set. - * @return the GalleryImageIdentifier object itself. - */ - public GalleryImageIdentifier withPublisher(String publisher) { - this.publisher = publisher; - return this; - } - - /** - * Get the offer property: The name of the gallery Image Definition offer. - * - * @return the offer value. - */ - public String offer() { - return this.offer; - } - - /** - * Set the offer property: The name of the gallery Image Definition offer. - * - * @param offer the offer value to set. - * @return the GalleryImageIdentifier object itself. - */ - public GalleryImageIdentifier withOffer(String offer) { - this.offer = offer; - return this; - } - - /** - * Get the sku property: The name of the gallery Image Definition SKU. - * - * @return the sku value. - */ - public String sku() { - return this.sku; - } - - /** - * Set the sku property: The name of the gallery Image Definition SKU. - * - * @param sku the sku value to set. - * @return the GalleryImageIdentifier object itself. - */ - public GalleryImageIdentifier withSku(String sku) { - this.sku = sku; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (publisher() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property publisher in model GalleryImageIdentifier")); - } - if (offer() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property offer in model GalleryImageIdentifier")); - } - if (sku() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property sku in model GalleryImageIdentifier")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryImageList.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryImageList.java deleted file mode 100644 index 38285cf2ef70..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryImageList.java +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.fluent.models.GalleryImageInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The List Gallery Images operation response. */ -@Fluent -public final class GalleryImageList { - @JsonIgnore private final ClientLogger logger = new ClientLogger(GalleryImageList.class); - - /* - * A list of Shared Image Gallery images. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * The uri to fetch the next page of Image Definitions in the Shared Image - * Gallery. Call ListNext() with this to fetch the next page of gallery - * Image Definitions. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: A list of Shared Image Gallery images. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: A list of Shared Image Gallery images. - * - * @param value the value value to set. - * @return the GalleryImageList object itself. - */ - public GalleryImageList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The uri to fetch the next page of Image Definitions in the Shared Image Gallery. Call - * ListNext() with this to fetch the next page of gallery Image Definitions. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The uri to fetch the next page of Image Definitions in the Shared Image Gallery. Call - * ListNext() with this to fetch the next page of gallery Image Definitions. - * - * @param nextLink the nextLink value to set. - * @return the GalleryImageList object itself. - */ - public GalleryImageList withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model GalleryImageList")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryImagePropertiesProvisioningState.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryImagePropertiesProvisioningState.java deleted file mode 100644 index 4bfc180b3af1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryImagePropertiesProvisioningState.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for GalleryImagePropertiesProvisioningState. */ -public final class GalleryImagePropertiesProvisioningState - extends ExpandableStringEnum { - /** Static value Creating for GalleryImagePropertiesProvisioningState. */ - public static final GalleryImagePropertiesProvisioningState CREATING = fromString("Creating"); - - /** Static value Updating for GalleryImagePropertiesProvisioningState. */ - public static final GalleryImagePropertiesProvisioningState UPDATING = fromString("Updating"); - - /** Static value Failed for GalleryImagePropertiesProvisioningState. */ - public static final GalleryImagePropertiesProvisioningState FAILED = fromString("Failed"); - - /** Static value Succeeded for GalleryImagePropertiesProvisioningState. */ - public static final GalleryImagePropertiesProvisioningState SUCCEEDED = fromString("Succeeded"); - - /** Static value Deleting for GalleryImagePropertiesProvisioningState. */ - public static final GalleryImagePropertiesProvisioningState DELETING = fromString("Deleting"); - - /** Static value Migrating for GalleryImagePropertiesProvisioningState. */ - public static final GalleryImagePropertiesProvisioningState MIGRATING = fromString("Migrating"); - - /** - * Creates or finds a GalleryImagePropertiesProvisioningState from its string representation. - * - * @param name a name to look for. - * @return the corresponding GalleryImagePropertiesProvisioningState. - */ - @JsonCreator - public static GalleryImagePropertiesProvisioningState fromString(String name) { - return fromString(name, GalleryImagePropertiesProvisioningState.class); - } - - /** @return known GalleryImagePropertiesProvisioningState values. */ - public static Collection values() { - return values(GalleryImagePropertiesProvisioningState.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryImageUpdate.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryImageUpdate.java deleted file mode 100644 index abf8c6f16e11..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryImageUpdate.java +++ /dev/null @@ -1,354 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.fluent.models.GalleryImageProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.Map; - -/** Specifies information about the gallery Image Definition that you want to update. */ -@Fluent -public final class GalleryImageUpdate extends UpdateResourceDefinition { - @JsonIgnore private final ClientLogger logger = new ClientLogger(GalleryImageUpdate.class); - - /* - * Describes the properties of a gallery Image Definition. - */ - @JsonProperty(value = "properties") - private GalleryImageProperties innerProperties; - - /** - * Get the innerProperties property: Describes the properties of a gallery Image Definition. - * - * @return the innerProperties value. - */ - private GalleryImageProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public GalleryImageUpdate withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the description property: The description of this gallery Image Definition resource. This property is - * updatable. - * - * @return the description value. - */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); - } - - /** - * Set the description property: The description of this gallery Image Definition resource. This property is - * updatable. - * - * @param description the description value to set. - * @return the GalleryImageUpdate object itself. - */ - public GalleryImageUpdate withDescription(String description) { - if (this.innerProperties() == null) { - this.innerProperties = new GalleryImageProperties(); - } - this.innerProperties().withDescription(description); - return this; - } - - /** - * Get the eula property: The Eula agreement for the gallery Image Definition. - * - * @return the eula value. - */ - public String eula() { - return this.innerProperties() == null ? null : this.innerProperties().eula(); - } - - /** - * Set the eula property: The Eula agreement for the gallery Image Definition. - * - * @param eula the eula value to set. - * @return the GalleryImageUpdate object itself. - */ - public GalleryImageUpdate withEula(String eula) { - if (this.innerProperties() == null) { - this.innerProperties = new GalleryImageProperties(); - } - this.innerProperties().withEula(eula); - return this; - } - - /** - * Get the privacyStatementUri property: The privacy statement uri. - * - * @return the privacyStatementUri value. - */ - public String privacyStatementUri() { - return this.innerProperties() == null ? null : this.innerProperties().privacyStatementUri(); - } - - /** - * Set the privacyStatementUri property: The privacy statement uri. - * - * @param privacyStatementUri the privacyStatementUri value to set. - * @return the GalleryImageUpdate object itself. - */ - public GalleryImageUpdate withPrivacyStatementUri(String privacyStatementUri) { - if (this.innerProperties() == null) { - this.innerProperties = new GalleryImageProperties(); - } - this.innerProperties().withPrivacyStatementUri(privacyStatementUri); - return this; - } - - /** - * Get the releaseNoteUri property: The release note uri. - * - * @return the releaseNoteUri value. - */ - public String releaseNoteUri() { - return this.innerProperties() == null ? null : this.innerProperties().releaseNoteUri(); - } - - /** - * Set the releaseNoteUri property: The release note uri. - * - * @param releaseNoteUri the releaseNoteUri value to set. - * @return the GalleryImageUpdate object itself. - */ - public GalleryImageUpdate withReleaseNoteUri(String releaseNoteUri) { - if (this.innerProperties() == null) { - this.innerProperties = new GalleryImageProperties(); - } - this.innerProperties().withReleaseNoteUri(releaseNoteUri); - return this; - } - - /** - * Get the osType property: This property allows you to specify the type of the OS that is included in the disk when - * creating a VM from a managed image. <br><br> Possible values are: <br><br> **Windows** - * <br><br> **Linux**. - * - * @return the osType value. - */ - public OperatingSystemTypes osType() { - return this.innerProperties() == null ? null : this.innerProperties().osType(); - } - - /** - * Set the osType property: This property allows you to specify the type of the OS that is included in the disk when - * creating a VM from a managed image. <br><br> Possible values are: <br><br> **Windows** - * <br><br> **Linux**. - * - * @param osType the osType value to set. - * @return the GalleryImageUpdate object itself. - */ - public GalleryImageUpdate withOsType(OperatingSystemTypes osType) { - if (this.innerProperties() == null) { - this.innerProperties = new GalleryImageProperties(); - } - this.innerProperties().withOsType(osType); - return this; - } - - /** - * Get the osState property: This property allows the user to specify whether the virtual machines created under - * this image are 'Generalized' or 'Specialized'. - * - * @return the osState value. - */ - public OperatingSystemStateTypes osState() { - return this.innerProperties() == null ? null : this.innerProperties().osState(); - } - - /** - * Set the osState property: This property allows the user to specify whether the virtual machines created under - * this image are 'Generalized' or 'Specialized'. - * - * @param osState the osState value to set. - * @return the GalleryImageUpdate object itself. - */ - public GalleryImageUpdate withOsState(OperatingSystemStateTypes osState) { - if (this.innerProperties() == null) { - this.innerProperties = new GalleryImageProperties(); - } - this.innerProperties().withOsState(osState); - return this; - } - - /** - * Get the hyperVGeneration property: The hypervisor generation of the Virtual Machine. Applicable to OS disks only. - * - * @return the hyperVGeneration value. - */ - public HyperVGeneration hyperVGeneration() { - return this.innerProperties() == null ? null : this.innerProperties().hyperVGeneration(); - } - - /** - * Set the hyperVGeneration property: The hypervisor generation of the Virtual Machine. Applicable to OS disks only. - * - * @param hyperVGeneration the hyperVGeneration value to set. - * @return the GalleryImageUpdate object itself. - */ - public GalleryImageUpdate withHyperVGeneration(HyperVGeneration hyperVGeneration) { - if (this.innerProperties() == null) { - this.innerProperties = new GalleryImageProperties(); - } - this.innerProperties().withHyperVGeneration(hyperVGeneration); - return this; - } - - /** - * Get the endOfLifeDate property: The end of life date of the gallery Image Definition. This property can be used - * for decommissioning purposes. This property is updatable. - * - * @return the endOfLifeDate value. - */ - public OffsetDateTime endOfLifeDate() { - return this.innerProperties() == null ? null : this.innerProperties().endOfLifeDate(); - } - - /** - * Set the endOfLifeDate property: The end of life date of the gallery Image Definition. This property can be used - * for decommissioning purposes. This property is updatable. - * - * @param endOfLifeDate the endOfLifeDate value to set. - * @return the GalleryImageUpdate object itself. - */ - public GalleryImageUpdate withEndOfLifeDate(OffsetDateTime endOfLifeDate) { - if (this.innerProperties() == null) { - this.innerProperties = new GalleryImageProperties(); - } - this.innerProperties().withEndOfLifeDate(endOfLifeDate); - return this; - } - - /** - * Get the identifier property: This is the gallery Image Definition identifier. - * - * @return the identifier value. - */ - public GalleryImageIdentifier identifier() { - return this.innerProperties() == null ? null : this.innerProperties().identifier(); - } - - /** - * Set the identifier property: This is the gallery Image Definition identifier. - * - * @param identifier the identifier value to set. - * @return the GalleryImageUpdate object itself. - */ - public GalleryImageUpdate withIdentifier(GalleryImageIdentifier identifier) { - if (this.innerProperties() == null) { - this.innerProperties = new GalleryImageProperties(); - } - this.innerProperties().withIdentifier(identifier); - return this; - } - - /** - * Get the recommended property: The properties describe the recommended machine configuration for this Image - * Definition. These properties are updatable. - * - * @return the recommended value. - */ - public RecommendedMachineConfiguration recommended() { - return this.innerProperties() == null ? null : this.innerProperties().recommended(); - } - - /** - * Set the recommended property: The properties describe the recommended machine configuration for this Image - * Definition. These properties are updatable. - * - * @param recommended the recommended value to set. - * @return the GalleryImageUpdate object itself. - */ - public GalleryImageUpdate withRecommended(RecommendedMachineConfiguration recommended) { - if (this.innerProperties() == null) { - this.innerProperties = new GalleryImageProperties(); - } - this.innerProperties().withRecommended(recommended); - return this; - } - - /** - * Get the disallowed property: Describes the disallowed disk types. - * - * @return the disallowed value. - */ - public Disallowed disallowed() { - return this.innerProperties() == null ? null : this.innerProperties().disallowed(); - } - - /** - * Set the disallowed property: Describes the disallowed disk types. - * - * @param disallowed the disallowed value to set. - * @return the GalleryImageUpdate object itself. - */ - public GalleryImageUpdate withDisallowed(Disallowed disallowed) { - if (this.innerProperties() == null) { - this.innerProperties = new GalleryImageProperties(); - } - this.innerProperties().withDisallowed(disallowed); - return this; - } - - /** - * Get the purchasePlan property: Describes the gallery Image Definition purchase plan. This is used by marketplace - * images. - * - * @return the purchasePlan value. - */ - public ImagePurchasePlan purchasePlan() { - return this.innerProperties() == null ? null : this.innerProperties().purchasePlan(); - } - - /** - * Set the purchasePlan property: Describes the gallery Image Definition purchase plan. This is used by marketplace - * images. - * - * @param purchasePlan the purchasePlan value to set. - * @return the GalleryImageUpdate object itself. - */ - public GalleryImageUpdate withPurchasePlan(ImagePurchasePlan purchasePlan) { - if (this.innerProperties() == null) { - this.innerProperties = new GalleryImageProperties(); - } - this.innerProperties().withPurchasePlan(purchasePlan); - return this; - } - - /** - * Get the provisioningState property: The current state of the gallery Image Definition. The provisioning state, - * which only appears in the response. - * - * @return the provisioningState value. - */ - public GalleryImagePropertiesProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryImageVersion.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryImageVersion.java deleted file mode 100644 index 619da1740b2d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryImageVersion.java +++ /dev/null @@ -1,288 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.compute.ComputeManager; -import com.azure.resourcemanager.compute.fluent.models.GalleryImageVersionInner; -import com.azure.core.management.Region; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.model.Appliable; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.model.Indexable; -import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; -import com.azure.resourcemanager.resources.fluentcore.model.Updatable; -import java.time.OffsetDateTime; -import java.util.List; -import java.util.Map; - -/** An immutable client-side representation of an Azure gallery image version. */ -@Fluent -public interface GalleryImageVersion - extends HasInnerModel, - Indexable, - Refreshable, - Updatable, - HasManager { - /** @return the ARM id of the image version. */ - String id(); - - /** @return the default location of the image version. */ - String location(); - - /** @return the image version name. */ - String name(); - - /** @return the provisioningState of image version resource. */ - String provisioningState(); - - /** @return the publishingProfile configuration of the image version. */ - GalleryImageVersionPublishingProfile publishingProfile(); - - /** @return the regions in which the image version is available. */ - List availableRegions(); - - /** @return the date indicating image version's end of life. */ - OffsetDateTime endOfLifeDate(); - - /** - * @return true if the image version is excluded from considering as a candidate when VM is created with 'latest' - * image version, false otherwise. - */ - Boolean isExcludedFromLatest(); - - /** @return the replicationStatus of image version in published regions. */ - ReplicationStatus replicationStatus(); - - /** @return the image version storageProfile describing OS and data disks. */ - GalleryImageVersionStorageProfile storageProfile(); - - /** @return the tags associated with the image version. */ - Map tags(); - - /** @return the type. */ - String type(); - - /** The entirety of the gallery image version definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithImage, - DefinitionStages.WithLocation, - DefinitionStages.WithSource, - DefinitionStages.WithCreate { - } - - /** Grouping of gallery image version definition stages. */ - interface DefinitionStages { - /** The first stage of a gallery image version definition. */ - interface Blank extends WithImage { - } - - /** The stage of the gallery image version definition allowing to specify parent image. */ - interface WithImage { - /** - * Specifies the image container to hold this image version. - * - * @param resourceGroupName the name of the resource group - * @param galleryName the name of the gallery - * @param galleryImageName the name of the gallery image - * @return the next definition stage - */ - WithLocation withExistingImage(String resourceGroupName, String galleryName, String galleryImageName); - } - - /** The stage of the gallery image version definition allowing to specify location. */ - interface WithLocation { - /** - * Specifies the default location for the image version. - * - * @param location resource location - * @return the next definition stage - */ - WithSource withLocation(String location); - - /** - * Specifies location. - * - * @param location resource location - * @return the next definition stage - */ - WithSource withLocation(Region location); - } - - /** The stage of the image version definition allowing to specify the source. */ - interface WithSource { - /** - * Specifies that the provided custom image needs to be used as source of the image version. - * - * @param customImageId the ARM id of the custom image - * @return the next definition stage - */ - WithCreate withSourceCustomImage(String customImageId); - - /** - * Specifies that the provided custom image needs to be used as source of the image version. - * - * @param customImage the custom image - * @return the next definition stage - */ - WithCreate withSourceCustomImage(VirtualMachineCustomImage customImage); - } - - /** - * The stage of image version definition allowing to specify the regions in which the image version has to be - * available. - */ - interface WithAvailableRegion { - /** - * Specifies a region in which image version needs to be available. - * - * @param region the region - * @param replicaCount the replication count - * @return the next definition stage - */ - WithCreate withRegionAvailability(Region region, int replicaCount); - - /** - * Specifies list of regions in which image version needs to be available. - * - * @param regions the region list - * @return the next definition stage - */ - WithCreate withRegionAvailability(List regions); - } - - /** The stage of the gallery image version definition allowing to specify end of life of the version. */ - interface WithEndOfLifeDate { - /** - * Specifies end of life date of the image version. - * - * @param endOfLifeDate The end of life date - * @return the next definition stage - */ - WithCreate withEndOfLifeDate(OffsetDateTime endOfLifeDate); - } - - /** - * The stage of the gallery image version definition allowing to specify that the version should not be - * considered as a candidate version when VM is deployed with 'latest' as version of the image. - */ - interface WithExcludeFromLatest { - /** - * Specifies that this version is not a candidate to consider as latest. - * - * @return the next definition stage - */ - WithCreate withExcludedFromLatest(); - } - - /** The stage of the gallery image version definition allowing to specify Tags. */ - interface WithTags { - /** - * Specifies tags. - * - * @param tags the resource tags - * @return the next definition stage - */ - WithCreate withTags(Map tags); - } - - /** - * The stage of the definition which contains all the minimum required inputs for the resource to be created - * (via {@link WithCreate#create()}), but also allows for any other optional settings to be specified. - */ - interface WithCreate - extends Creatable, - DefinitionStages.WithAvailableRegion, - DefinitionStages.WithEndOfLifeDate, - DefinitionStages.WithExcludeFromLatest, - DefinitionStages.WithTags { - } - } - /** The template for a gallery image version update operation, containing all the settings that can be modified. */ - interface Update - extends Appliable, - UpdateStages.WithAvailableRegion, - UpdateStages.WithEndOfLifeDate, - UpdateStages.WithExcludeFromLatest, - UpdateStages.WithTags { - } - - /** Grouping of gallery image version update stages. */ - interface UpdateStages { - /** - * The stage of image version update allowing to specify the regions in which the image version has to be - * available. - */ - interface WithAvailableRegion { - /** - * Specifies a region in which image version needs to be available. - * - * @param region the region - * @param replicaCount the replication count - * @return the next update stage - */ - Update withRegionAvailability(Region region, int replicaCount); - - /** - * Specifies list of regions in which image version needs to be available. - * - * @param regions the region list - * @return the next update stage - */ - Update withRegionAvailability(List regions); - - /** - * Specifies that an image version should be removed from an existing region serving it. - * - * @param region the region - * @return the next update stage - */ - Update withoutRegionAvailability(Region region); - } - - /** The stage of the gallery image version update allowing to specify end of life of the version. */ - interface WithEndOfLifeDate { - /** - * Specifies end of life date of the image version. - * - * @param endOfLifeDate The end of life of this gallery image - * @return the next update stage - */ - Update withEndOfLifeDate(OffsetDateTime endOfLifeDate); - } - - /** - * The stage of the gallery image version definition allowing to specify whether this version should be a - * candidate version to be considered when VM is deployed with 'latest' as version of the image. - */ - interface WithExcludeFromLatest { - /** - * Specifies that this version is not a candidate to consider as latest. - * - * @return the next update stage - */ - Update withExcludedFromLatest(); - - /** - * Specifies that this version is a candidate to consider as latest. - * - * @return the next update stage - */ - Update withoutExcludedFromLatest(); - } - - /** The stage of the gallery image version update allowing to specify Tags. */ - interface WithTags { - /** - * Specifies tags. - * - * @param tags resource tags - * @return the next update stage - */ - Update withTags(Map tags); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryImageVersionList.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryImageVersionList.java deleted file mode 100644 index 5cd75fd262ff..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryImageVersionList.java +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.fluent.models.GalleryImageVersionInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The List Gallery Image version operation response. */ -@Fluent -public final class GalleryImageVersionList { - @JsonIgnore private final ClientLogger logger = new ClientLogger(GalleryImageVersionList.class); - - /* - * A list of gallery Image Versions. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * The uri to fetch the next page of gallery Image Versions. Call - * ListNext() with this to fetch the next page of gallery Image Versions. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: A list of gallery Image Versions. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: A list of gallery Image Versions. - * - * @param value the value value to set. - * @return the GalleryImageVersionList object itself. - */ - public GalleryImageVersionList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The uri to fetch the next page of gallery Image Versions. Call ListNext() with this to - * fetch the next page of gallery Image Versions. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The uri to fetch the next page of gallery Image Versions. Call ListNext() with this to - * fetch the next page of gallery Image Versions. - * - * @param nextLink the nextLink value to set. - * @return the GalleryImageVersionList object itself. - */ - public GalleryImageVersionList withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model GalleryImageVersionList")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryImageVersionPropertiesProvisioningState.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryImageVersionPropertiesProvisioningState.java deleted file mode 100644 index 86d932d66988..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryImageVersionPropertiesProvisioningState.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for GalleryImageVersionPropertiesProvisioningState. */ -public final class GalleryImageVersionPropertiesProvisioningState - extends ExpandableStringEnum { - /** Static value Creating for GalleryImageVersionPropertiesProvisioningState. */ - public static final GalleryImageVersionPropertiesProvisioningState CREATING = fromString("Creating"); - - /** Static value Updating for GalleryImageVersionPropertiesProvisioningState. */ - public static final GalleryImageVersionPropertiesProvisioningState UPDATING = fromString("Updating"); - - /** Static value Failed for GalleryImageVersionPropertiesProvisioningState. */ - public static final GalleryImageVersionPropertiesProvisioningState FAILED = fromString("Failed"); - - /** Static value Succeeded for GalleryImageVersionPropertiesProvisioningState. */ - public static final GalleryImageVersionPropertiesProvisioningState SUCCEEDED = fromString("Succeeded"); - - /** Static value Deleting for GalleryImageVersionPropertiesProvisioningState. */ - public static final GalleryImageVersionPropertiesProvisioningState DELETING = fromString("Deleting"); - - /** Static value Migrating for GalleryImageVersionPropertiesProvisioningState. */ - public static final GalleryImageVersionPropertiesProvisioningState MIGRATING = fromString("Migrating"); - - /** - * Creates or finds a GalleryImageVersionPropertiesProvisioningState from its string representation. - * - * @param name a name to look for. - * @return the corresponding GalleryImageVersionPropertiesProvisioningState. - */ - @JsonCreator - public static GalleryImageVersionPropertiesProvisioningState fromString(String name) { - return fromString(name, GalleryImageVersionPropertiesProvisioningState.class); - } - - /** @return known GalleryImageVersionPropertiesProvisioningState values. */ - public static Collection values() { - return values(GalleryImageVersionPropertiesProvisioningState.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryImageVersionPublishingProfile.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryImageVersionPublishingProfile.java deleted file mode 100644 index 59002084c124..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryImageVersionPublishingProfile.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import java.time.OffsetDateTime; -import java.util.List; - -/** The publishing profile of a gallery Image Version. */ -@Fluent -public final class GalleryImageVersionPublishingProfile extends GalleryArtifactPublishingProfileBase { - @JsonIgnore private final ClientLogger logger = new ClientLogger(GalleryImageVersionPublishingProfile.class); - - /** {@inheritDoc} */ - @Override - public GalleryImageVersionPublishingProfile withTargetRegions(List targetRegions) { - super.withTargetRegions(targetRegions); - return this; - } - - /** {@inheritDoc} */ - @Override - public GalleryImageVersionPublishingProfile withReplicaCount(Integer replicaCount) { - super.withReplicaCount(replicaCount); - return this; - } - - /** {@inheritDoc} */ - @Override - public GalleryImageVersionPublishingProfile withExcludeFromLatest(Boolean excludeFromLatest) { - super.withExcludeFromLatest(excludeFromLatest); - return this; - } - - /** {@inheritDoc} */ - @Override - public GalleryImageVersionPublishingProfile withEndOfLifeDate(OffsetDateTime endOfLifeDate) { - super.withEndOfLifeDate(endOfLifeDate); - return this; - } - - /** {@inheritDoc} */ - @Override - public GalleryImageVersionPublishingProfile withStorageAccountType(StorageAccountType storageAccountType) { - super.withStorageAccountType(storageAccountType); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryImageVersionStorageProfile.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryImageVersionStorageProfile.java deleted file mode 100644 index e83e94ba9020..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryImageVersionStorageProfile.java +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** This is the storage profile of a Gallery Image Version. */ -@Fluent -public final class GalleryImageVersionStorageProfile { - @JsonIgnore private final ClientLogger logger = new ClientLogger(GalleryImageVersionStorageProfile.class); - - /* - * The gallery artifact version source. - */ - @JsonProperty(value = "source") - private GalleryArtifactVersionSource source; - - /* - * This is the OS disk image. - */ - @JsonProperty(value = "osDiskImage") - private GalleryOSDiskImage osDiskImage; - - /* - * A list of data disk images. - */ - @JsonProperty(value = "dataDiskImages") - private List dataDiskImages; - - /** - * Get the source property: The gallery artifact version source. - * - * @return the source value. - */ - public GalleryArtifactVersionSource source() { - return this.source; - } - - /** - * Set the source property: The gallery artifact version source. - * - * @param source the source value to set. - * @return the GalleryImageVersionStorageProfile object itself. - */ - public GalleryImageVersionStorageProfile withSource(GalleryArtifactVersionSource source) { - this.source = source; - return this; - } - - /** - * Get the osDiskImage property: This is the OS disk image. - * - * @return the osDiskImage value. - */ - public GalleryOSDiskImage osDiskImage() { - return this.osDiskImage; - } - - /** - * Set the osDiskImage property: This is the OS disk image. - * - * @param osDiskImage the osDiskImage value to set. - * @return the GalleryImageVersionStorageProfile object itself. - */ - public GalleryImageVersionStorageProfile withOsDiskImage(GalleryOSDiskImage osDiskImage) { - this.osDiskImage = osDiskImage; - return this; - } - - /** - * Get the dataDiskImages property: A list of data disk images. - * - * @return the dataDiskImages value. - */ - public List dataDiskImages() { - return this.dataDiskImages; - } - - /** - * Set the dataDiskImages property: A list of data disk images. - * - * @param dataDiskImages the dataDiskImages value to set. - * @return the GalleryImageVersionStorageProfile object itself. - */ - public GalleryImageVersionStorageProfile withDataDiskImages(List dataDiskImages) { - this.dataDiskImages = dataDiskImages; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (source() != null) { - source().validate(); - } - if (osDiskImage() != null) { - osDiskImage().validate(); - } - if (dataDiskImages() != null) { - dataDiskImages().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryImageVersionUpdate.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryImageVersionUpdate.java deleted file mode 100644 index b0d817569e6d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryImageVersionUpdate.java +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.fluent.models.GalleryImageVersionProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** Specifies information about the gallery Image Version that you want to update. */ -@Fluent -public final class GalleryImageVersionUpdate extends UpdateResourceDefinition { - @JsonIgnore private final ClientLogger logger = new ClientLogger(GalleryImageVersionUpdate.class); - - /* - * Describes the properties of a gallery Image Version. - */ - @JsonProperty(value = "properties") - private GalleryImageVersionProperties innerProperties; - - /** - * Get the innerProperties property: Describes the properties of a gallery Image Version. - * - * @return the innerProperties value. - */ - private GalleryImageVersionProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public GalleryImageVersionUpdate withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the publishingProfile property: The publishing profile of a gallery Image Version. - * - * @return the publishingProfile value. - */ - public GalleryImageVersionPublishingProfile publishingProfile() { - return this.innerProperties() == null ? null : this.innerProperties().publishingProfile(); - } - - /** - * Set the publishingProfile property: The publishing profile of a gallery Image Version. - * - * @param publishingProfile the publishingProfile value to set. - * @return the GalleryImageVersionUpdate object itself. - */ - public GalleryImageVersionUpdate withPublishingProfile(GalleryImageVersionPublishingProfile publishingProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new GalleryImageVersionProperties(); - } - this.innerProperties().withPublishingProfile(publishingProfile); - return this; - } - - /** - * Get the provisioningState property: The current state of the gallery Image Version. The provisioning state, which - * only appears in the response. - * - * @return the provisioningState value. - */ - public GalleryImageVersionPropertiesProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the storageProfile property: This is the storage profile of a Gallery Image Version. - * - * @return the storageProfile value. - */ - public GalleryImageVersionStorageProfile storageProfile() { - return this.innerProperties() == null ? null : this.innerProperties().storageProfile(); - } - - /** - * Set the storageProfile property: This is the storage profile of a Gallery Image Version. - * - * @param storageProfile the storageProfile value to set. - * @return the GalleryImageVersionUpdate object itself. - */ - public GalleryImageVersionUpdate withStorageProfile(GalleryImageVersionStorageProfile storageProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new GalleryImageVersionProperties(); - } - this.innerProperties().withStorageProfile(storageProfile); - return this; - } - - /** - * Get the replicationStatus property: This is the replication status of the gallery Image Version. - * - * @return the replicationStatus value. - */ - public ReplicationStatus replicationStatus() { - return this.innerProperties() == null ? null : this.innerProperties().replicationStatus(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryImageVersions.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryImageVersions.java deleted file mode 100644 index ef9e758ab7ec..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryImageVersions.java +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsCreating; -import reactor.core.publisher.Mono; - -/** Entry point to gallery image versions management API in Azure. */ -@Fluent -public interface GalleryImageVersions extends SupportsCreating { - /** - * Retrieves information about a gallery image version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the gallery. - * @param galleryImageName The name of the gallery image. - * @param galleryImageVersionName The name of the gallery image version. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - Mono getByGalleryImageAsync( - String resourceGroupName, String galleryName, String galleryImageName, String galleryImageVersionName); - - /** - * Retrieves information about a gallery image version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the gallery. - * @param galleryImageName The name of the gallery image. - * @param galleryImageVersionName The name of the gallery image version. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the gallery image version resource - */ - GalleryImageVersion getByGalleryImage( - String resourceGroupName, String galleryName, String galleryImageName, String galleryImageVersionName); - - /** - * List gallery image versions under a gallery image. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the gallery. - * @param galleryImageName The name of the gallery image. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - PagedFlux listByGalleryImageAsync( - String resourceGroupName, String galleryName, String galleryImageName); - - /** - * List gallery image versions under a gallery image. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the gallery. - * @param galleryImageName The name of the gallery image. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return list of gallery image versions - */ - PagedIterable listByGalleryImage( - String resourceGroupName, String galleryName, String galleryImageName); - - /** - * Delete a gallery image version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the gallery. - * @param galleryImageName The name of the gallery image. - * @param galleryImageVersionName The name of the gallery image version. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the completable for the request - */ - Mono deleteByGalleryImageAsync( - String resourceGroupName, String galleryName, String galleryImageName, String galleryImageVersionName); - - /** - * Delete a gallery image version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the gallery. - * @param galleryImageName The name of the gallery image. - * @param galleryImageVersionName The name of the gallery image version. - * @throws IllegalArgumentException thrown if parameters fail the validation - */ - void deleteByGalleryImage( - String resourceGroupName, String galleryName, String galleryImageName, String galleryImageVersionName); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryImages.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryImages.java deleted file mode 100644 index f1ac94df1787..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryImages.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsCreating; -import reactor.core.publisher.Mono; - -/** Entry point to gallery images management API in Azure. */ -@Fluent -public interface GalleryImages extends SupportsCreating { - /** - * Retrieves information about an image in a gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the gallery. - * @param galleryImageName The name of the gallery image. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - Mono getByGalleryAsync(String resourceGroupName, String galleryName, String galleryImageName); - - /** - * Retrieves information about an image in a gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the gallery. - * @param galleryImageName The name of the gallery image. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the gallery image - */ - GalleryImage getByGallery(String resourceGroupName, String galleryName, String galleryImageName); - - /** - * List images under a gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the gallery. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - PagedFlux listByGalleryAsync(String resourceGroupName, String galleryName); - - /** - * List images under a gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the gallery. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the list of images in the gallery - */ - PagedIterable listByGallery(String resourceGroupName, String galleryName); - - /** - * Delete a gallery image in a gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the gallery. - * @param galleryImageName The name of the gallery image. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the completable for the request - */ - Mono deleteByGalleryAsync(String resourceGroupName, String galleryName, String galleryImageName); - - /** - * Delete an image in a gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the gallery. - * @param galleryImageName The name of the gallery image. - * @throws IllegalArgumentException thrown if parameters fail the validation - */ - void deleteByGallery(String resourceGroupName, String galleryName, String galleryImageName); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryList.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryList.java deleted file mode 100644 index ac2fb94c6806..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryList.java +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.fluent.models.GalleryInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The List Galleries operation response. */ -@Fluent -public final class GalleryList { - @JsonIgnore private final ClientLogger logger = new ClientLogger(GalleryList.class); - - /* - * A list of galleries. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * The uri to fetch the next page of galleries. Call ListNext() with this - * to fetch the next page of galleries. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: A list of galleries. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: A list of galleries. - * - * @param value the value value to set. - * @return the GalleryList object itself. - */ - public GalleryList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The uri to fetch the next page of galleries. Call ListNext() with this to fetch the - * next page of galleries. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The uri to fetch the next page of galleries. Call ListNext() with this to fetch the - * next page of galleries. - * - * @param nextLink the nextLink value to set. - * @return the GalleryList object itself. - */ - public GalleryList withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model GalleryList")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryOSDiskImage.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryOSDiskImage.java deleted file mode 100644 index fd4cd97ea4b9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryOSDiskImage.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; - -/** This is the OS disk image. */ -@Fluent -public final class GalleryOSDiskImage extends GalleryDiskImage { - @JsonIgnore private final ClientLogger logger = new ClientLogger(GalleryOSDiskImage.class); - - /** {@inheritDoc} */ - @Override - public GalleryOSDiskImage withHostCaching(HostCaching hostCaching) { - super.withHostCaching(hostCaching); - return this; - } - - /** {@inheritDoc} */ - @Override - public GalleryOSDiskImage withSource(GalleryArtifactVersionSource source) { - super.withSource(source); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryPropertiesProvisioningState.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryPropertiesProvisioningState.java deleted file mode 100644 index 077ced208657..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryPropertiesProvisioningState.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for GalleryPropertiesProvisioningState. */ -public final class GalleryPropertiesProvisioningState extends ExpandableStringEnum { - /** Static value Creating for GalleryPropertiesProvisioningState. */ - public static final GalleryPropertiesProvisioningState CREATING = fromString("Creating"); - - /** Static value Updating for GalleryPropertiesProvisioningState. */ - public static final GalleryPropertiesProvisioningState UPDATING = fromString("Updating"); - - /** Static value Failed for GalleryPropertiesProvisioningState. */ - public static final GalleryPropertiesProvisioningState FAILED = fromString("Failed"); - - /** Static value Succeeded for GalleryPropertiesProvisioningState. */ - public static final GalleryPropertiesProvisioningState SUCCEEDED = fromString("Succeeded"); - - /** Static value Deleting for GalleryPropertiesProvisioningState. */ - public static final GalleryPropertiesProvisioningState DELETING = fromString("Deleting"); - - /** Static value Migrating for GalleryPropertiesProvisioningState. */ - public static final GalleryPropertiesProvisioningState MIGRATING = fromString("Migrating"); - - /** - * Creates or finds a GalleryPropertiesProvisioningState from its string representation. - * - * @param name a name to look for. - * @return the corresponding GalleryPropertiesProvisioningState. - */ - @JsonCreator - public static GalleryPropertiesProvisioningState fromString(String name) { - return fromString(name, GalleryPropertiesProvisioningState.class); - } - - /** @return known GalleryPropertiesProvisioningState values. */ - public static Collection values() { - return values(GalleryPropertiesProvisioningState.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryUpdate.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryUpdate.java deleted file mode 100644 index 3d11330a04ba..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryUpdate.java +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.fluent.models.GalleryProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** Specifies information about the Shared Image Gallery that you want to update. */ -@Fluent -public final class GalleryUpdate extends UpdateResourceDefinition { - @JsonIgnore private final ClientLogger logger = new ClientLogger(GalleryUpdate.class); - - /* - * Describes the properties of a Shared Image Gallery. - */ - @JsonProperty(value = "properties") - private GalleryProperties innerProperties; - - /** - * Get the innerProperties property: Describes the properties of a Shared Image Gallery. - * - * @return the innerProperties value. - */ - private GalleryProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public GalleryUpdate withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the description property: The description of this Shared Image Gallery resource. This property is updatable. - * - * @return the description value. - */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); - } - - /** - * Set the description property: The description of this Shared Image Gallery resource. This property is updatable. - * - * @param description the description value to set. - * @return the GalleryUpdate object itself. - */ - public GalleryUpdate withDescription(String description) { - if (this.innerProperties() == null) { - this.innerProperties = new GalleryProperties(); - } - this.innerProperties().withDescription(description); - return this; - } - - /** - * Get the identifier property: Describes the gallery unique name. - * - * @return the identifier value. - */ - public GalleryIdentifier identifier() { - return this.innerProperties() == null ? null : this.innerProperties().identifier(); - } - - /** - * Set the identifier property: Describes the gallery unique name. - * - * @param identifier the identifier value to set. - * @return the GalleryUpdate object itself. - */ - public GalleryUpdate withIdentifier(GalleryIdentifier identifier) { - if (this.innerProperties() == null) { - this.innerProperties = new GalleryProperties(); - } - this.innerProperties().withIdentifier(identifier); - return this; - } - - /** - * Get the provisioningState property: The current state of the gallery. The provisioning state, which only appears - * in the response. - * - * @return the provisioningState value. - */ - public GalleryPropertiesProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GrantAccessData.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GrantAccessData.java deleted file mode 100644 index d450f4ad8c4f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GrantAccessData.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Data used for requesting a SAS. */ -@Fluent -public final class GrantAccessData { - @JsonIgnore private final ClientLogger logger = new ClientLogger(GrantAccessData.class); - - /* - * The access property. - */ - @JsonProperty(value = "access", required = true) - private AccessLevel access; - - /* - * Time duration in seconds until the SAS access expires. - */ - @JsonProperty(value = "durationInSeconds", required = true) - private int durationInSeconds; - - /** - * Get the access property: The access property. - * - * @return the access value. - */ - public AccessLevel access() { - return this.access; - } - - /** - * Set the access property: The access property. - * - * @param access the access value to set. - * @return the GrantAccessData object itself. - */ - public GrantAccessData withAccess(AccessLevel access) { - this.access = access; - return this; - } - - /** - * Get the durationInSeconds property: Time duration in seconds until the SAS access expires. - * - * @return the durationInSeconds value. - */ - public int durationInSeconds() { - return this.durationInSeconds; - } - - /** - * Set the durationInSeconds property: Time duration in seconds until the SAS access expires. - * - * @param durationInSeconds the durationInSeconds value to set. - * @return the GrantAccessData object itself. - */ - public GrantAccessData withDurationInSeconds(int durationInSeconds) { - this.durationInSeconds = durationInSeconds; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (access() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property access in model GrantAccessData")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/HardwareProfile.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/HardwareProfile.java deleted file mode 100644 index e52167a7f460..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/HardwareProfile.java +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Specifies the hardware settings for the virtual machine. */ -@Fluent -public final class HardwareProfile { - @JsonIgnore private final ClientLogger logger = new ClientLogger(HardwareProfile.class); - - /* - * Specifies the size of the virtual machine. For more information about - * virtual machine sizes, see [Sizes for virtual - * machines](https://docs.microsoft.com/en-us/azure/virtual-machines/sizes). - *

The available VM sizes depend on region and availability set. - * For a list of available sizes use these APIs:

[List all - * available virtual machine sizes in an availability - * set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes) - *

[List all available virtual machine sizes in a region]( - * https://docs.microsoft.com/en-us/rest/api/compute/resourceskus/list) - *

[List all available virtual machine sizes for - * resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). - *

This list of sizes is no longer updated and the - * **VirtualMachineSizeTypes** string constants will be removed from the - * subsequent REST API specification. Use [List all available virtual - * machine sizes in a region]( - * https://docs.microsoft.com/en-us/rest/api/compute/resourceskus/list) to - * get the latest sizes. - */ - @JsonProperty(value = "vmSize") - private VirtualMachineSizeTypes vmSize; - - /** - * Get the vmSize property: Specifies the size of the virtual machine. For more information about virtual machine - * sizes, see [Sizes for virtual machines](https://docs.microsoft.com/en-us/azure/virtual-machines/sizes). - * <br><br> The available VM sizes depend on region and availability set. For a list of available sizes - * use these APIs: <br><br> [List all available virtual machine sizes in an availability - * set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes) <br><br> [List - * all available virtual machine sizes in a region]( - * https://docs.microsoft.com/en-us/rest/api/compute/resourceskus/list) <br><br> [List all available - * virtual machine sizes for - * resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). <br><br> - * This list of sizes is no longer updated and the **VirtualMachineSizeTypes** string constants will be removed from - * the subsequent REST API specification. Use [List all available virtual machine sizes in a region]( - * https://docs.microsoft.com/en-us/rest/api/compute/resourceskus/list) to get the latest sizes. - * - * @return the vmSize value. - */ - public VirtualMachineSizeTypes vmSize() { - return this.vmSize; - } - - /** - * Set the vmSize property: Specifies the size of the virtual machine. For more information about virtual machine - * sizes, see [Sizes for virtual machines](https://docs.microsoft.com/en-us/azure/virtual-machines/sizes). - * <br><br> The available VM sizes depend on region and availability set. For a list of available sizes - * use these APIs: <br><br> [List all available virtual machine sizes in an availability - * set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes) <br><br> [List - * all available virtual machine sizes in a region]( - * https://docs.microsoft.com/en-us/rest/api/compute/resourceskus/list) <br><br> [List all available - * virtual machine sizes for - * resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). <br><br> - * This list of sizes is no longer updated and the **VirtualMachineSizeTypes** string constants will be removed from - * the subsequent REST API specification. Use [List all available virtual machine sizes in a region]( - * https://docs.microsoft.com/en-us/rest/api/compute/resourceskus/list) to get the latest sizes. - * - * @param vmSize the vmSize value to set. - * @return the HardwareProfile object itself. - */ - public HardwareProfile withVmSize(VirtualMachineSizeTypes vmSize) { - this.vmSize = vmSize; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/HostCaching.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/HostCaching.java deleted file mode 100644 index 41c273f5ced6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/HostCaching.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for HostCaching. */ -public enum HostCaching { - /** Enum value None. */ - NONE("None"), - - /** Enum value ReadOnly. */ - READ_ONLY("ReadOnly"), - - /** Enum value ReadWrite. */ - READ_WRITE("ReadWrite"); - - /** The actual serialized value for a HostCaching instance. */ - private final String value; - - HostCaching(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a HostCaching instance. - * - * @param value the serialized value to parse. - * @return the parsed HostCaching object, or null if unable to parse. - */ - @JsonCreator - public static HostCaching fromString(String value) { - HostCaching[] items = HostCaching.values(); - for (HostCaching item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/HyperVGeneration.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/HyperVGeneration.java deleted file mode 100644 index d976fada2884..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/HyperVGeneration.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for HyperVGeneration. */ -public final class HyperVGeneration extends ExpandableStringEnum { - /** Static value V1 for HyperVGeneration. */ - public static final HyperVGeneration V1 = fromString("V1"); - - /** Static value V2 for HyperVGeneration. */ - public static final HyperVGeneration V2 = fromString("V2"); - - /** - * Creates or finds a HyperVGeneration from its string representation. - * - * @param name a name to look for. - * @return the corresponding HyperVGeneration. - */ - @JsonCreator - public static HyperVGeneration fromString(String name) { - return fromString(name, HyperVGeneration.class); - } - - /** @return known HyperVGeneration values. */ - public static Collection values() { - return values(HyperVGeneration.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/HyperVGenerationType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/HyperVGenerationType.java deleted file mode 100644 index 1bfb98ebd3c2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/HyperVGenerationType.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for HyperVGenerationType. */ -public final class HyperVGenerationType extends ExpandableStringEnum { - /** Static value V1 for HyperVGenerationType. */ - public static final HyperVGenerationType V1 = fromString("V1"); - - /** Static value V2 for HyperVGenerationType. */ - public static final HyperVGenerationType V2 = fromString("V2"); - - /** - * Creates or finds a HyperVGenerationType from its string representation. - * - * @param name a name to look for. - * @return the corresponding HyperVGenerationType. - */ - @JsonCreator - public static HyperVGenerationType fromString(String name) { - return fromString(name, HyperVGenerationType.class); - } - - /** @return known HyperVGenerationType values. */ - public static Collection values() { - return values(HyperVGenerationType.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/HyperVGenerationTypes.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/HyperVGenerationTypes.java deleted file mode 100644 index 8a3d91cdae39..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/HyperVGenerationTypes.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for HyperVGenerationTypes. */ -public final class HyperVGenerationTypes extends ExpandableStringEnum { - /** Static value V1 for HyperVGenerationTypes. */ - public static final HyperVGenerationTypes V1 = fromString("V1"); - - /** Static value V2 for HyperVGenerationTypes. */ - public static final HyperVGenerationTypes V2 = fromString("V2"); - - /** - * Creates or finds a HyperVGenerationTypes from its string representation. - * - * @param name a name to look for. - * @return the corresponding HyperVGenerationTypes. - */ - @JsonCreator - public static HyperVGenerationTypes fromString(String name) { - return fromString(name, HyperVGenerationTypes.class); - } - - /** @return known HyperVGenerationTypes values. */ - public static Collection values() { - return values(HyperVGenerationTypes.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ImageDataDisk.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ImageDataDisk.java deleted file mode 100644 index 7d10b6516c03..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ImageDataDisk.java +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describes a data disk. */ -@Fluent -public final class ImageDataDisk extends ImageDisk { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ImageDataDisk.class); - - /* - * Specifies the logical unit number of the data disk. This value is used - * to identify data disks within the VM and therefore must be unique for - * each data disk attached to a VM. - */ - @JsonProperty(value = "lun", required = true) - private int lun; - - /** - * Get the lun property: Specifies the logical unit number of the data disk. This value is used to identify data - * disks within the VM and therefore must be unique for each data disk attached to a VM. - * - * @return the lun value. - */ - public int lun() { - return this.lun; - } - - /** - * Set the lun property: Specifies the logical unit number of the data disk. This value is used to identify data - * disks within the VM and therefore must be unique for each data disk attached to a VM. - * - * @param lun the lun value to set. - * @return the ImageDataDisk object itself. - */ - public ImageDataDisk withLun(int lun) { - this.lun = lun; - return this; - } - - /** {@inheritDoc} */ - @Override - public ImageDataDisk withSnapshot(SubResource snapshot) { - super.withSnapshot(snapshot); - return this; - } - - /** {@inheritDoc} */ - @Override - public ImageDataDisk withManagedDisk(SubResource managedDisk) { - super.withManagedDisk(managedDisk); - return this; - } - - /** {@inheritDoc} */ - @Override - public ImageDataDisk withBlobUri(String blobUri) { - super.withBlobUri(blobUri); - return this; - } - - /** {@inheritDoc} */ - @Override - public ImageDataDisk withCaching(CachingTypes caching) { - super.withCaching(caching); - return this; - } - - /** {@inheritDoc} */ - @Override - public ImageDataDisk withDiskSizeGB(Integer diskSizeGB) { - super.withDiskSizeGB(diskSizeGB); - return this; - } - - /** {@inheritDoc} */ - @Override - public ImageDataDisk withStorageAccountType(StorageAccountTypes storageAccountType) { - super.withStorageAccountType(storageAccountType); - return this; - } - - /** {@inheritDoc} */ - @Override - public ImageDataDisk withDiskEncryptionSet(DiskEncryptionSetParameters diskEncryptionSet) { - super.withDiskEncryptionSet(diskEncryptionSet); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ImageDisk.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ImageDisk.java deleted file mode 100644 index 3073bd910184..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ImageDisk.java +++ /dev/null @@ -1,229 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describes a image disk. */ -@Fluent -public class ImageDisk { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ImageDisk.class); - - /* - * The snapshot. - */ - @JsonProperty(value = "snapshot") - private SubResource snapshot; - - /* - * The managedDisk. - */ - @JsonProperty(value = "managedDisk") - private SubResource managedDisk; - - /* - * The Virtual Hard Disk. - */ - @JsonProperty(value = "blobUri") - private String blobUri; - - /* - * Specifies the caching requirements.

Possible values are: - *

**None**

**ReadOnly**

**ReadWrite**

- * Default: **None for Standard storage. ReadOnly for Premium storage** - */ - @JsonProperty(value = "caching") - private CachingTypes caching; - - /* - * Specifies the size of empty data disks in gigabytes. This element can be - * used to overwrite the name of the disk in a virtual machine image. - *

This value cannot be larger than 1023 GB - */ - @JsonProperty(value = "diskSizeGB") - private Integer diskSizeGB; - - /* - * Specifies the storage account type for the managed disk. NOTE: - * UltraSSD_LRS can only be used with data disks, it cannot be used with OS - * Disk. - */ - @JsonProperty(value = "storageAccountType") - private StorageAccountTypes storageAccountType; - - /* - * Specifies the customer managed disk encryption set resource id for the - * managed image disk. - */ - @JsonProperty(value = "diskEncryptionSet") - private DiskEncryptionSetParameters diskEncryptionSet; - - /** - * Get the snapshot property: The snapshot. - * - * @return the snapshot value. - */ - public SubResource snapshot() { - return this.snapshot; - } - - /** - * Set the snapshot property: The snapshot. - * - * @param snapshot the snapshot value to set. - * @return the ImageDisk object itself. - */ - public ImageDisk withSnapshot(SubResource snapshot) { - this.snapshot = snapshot; - return this; - } - - /** - * Get the managedDisk property: The managedDisk. - * - * @return the managedDisk value. - */ - public SubResource managedDisk() { - return this.managedDisk; - } - - /** - * Set the managedDisk property: The managedDisk. - * - * @param managedDisk the managedDisk value to set. - * @return the ImageDisk object itself. - */ - public ImageDisk withManagedDisk(SubResource managedDisk) { - this.managedDisk = managedDisk; - return this; - } - - /** - * Get the blobUri property: The Virtual Hard Disk. - * - * @return the blobUri value. - */ - public String blobUri() { - return this.blobUri; - } - - /** - * Set the blobUri property: The Virtual Hard Disk. - * - * @param blobUri the blobUri value to set. - * @return the ImageDisk object itself. - */ - public ImageDisk withBlobUri(String blobUri) { - this.blobUri = blobUri; - return this; - } - - /** - * Get the caching property: Specifies the caching requirements. <br><br> Possible values are: - * <br><br> **None** <br><br> **ReadOnly** <br><br> **ReadWrite** - * <br><br> Default: **None for Standard storage. ReadOnly for Premium storage**. - * - * @return the caching value. - */ - public CachingTypes caching() { - return this.caching; - } - - /** - * Set the caching property: Specifies the caching requirements. <br><br> Possible values are: - * <br><br> **None** <br><br> **ReadOnly** <br><br> **ReadWrite** - * <br><br> Default: **None for Standard storage. ReadOnly for Premium storage**. - * - * @param caching the caching value to set. - * @return the ImageDisk object itself. - */ - public ImageDisk withCaching(CachingTypes caching) { - this.caching = caching; - return this; - } - - /** - * Get the diskSizeGB property: Specifies the size of empty data disks in gigabytes. This element can be used to - * overwrite the name of the disk in a virtual machine image. <br><br> This value cannot be larger than - * 1023 GB. - * - * @return the diskSizeGB value. - */ - public Integer diskSizeGB() { - return this.diskSizeGB; - } - - /** - * Set the diskSizeGB property: Specifies the size of empty data disks in gigabytes. This element can be used to - * overwrite the name of the disk in a virtual machine image. <br><br> This value cannot be larger than - * 1023 GB. - * - * @param diskSizeGB the diskSizeGB value to set. - * @return the ImageDisk object itself. - */ - public ImageDisk withDiskSizeGB(Integer diskSizeGB) { - this.diskSizeGB = diskSizeGB; - return this; - } - - /** - * Get the storageAccountType property: Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS - * can only be used with data disks, it cannot be used with OS Disk. - * - * @return the storageAccountType value. - */ - public StorageAccountTypes storageAccountType() { - return this.storageAccountType; - } - - /** - * Set the storageAccountType property: Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS - * can only be used with data disks, it cannot be used with OS Disk. - * - * @param storageAccountType the storageAccountType value to set. - * @return the ImageDisk object itself. - */ - public ImageDisk withStorageAccountType(StorageAccountTypes storageAccountType) { - this.storageAccountType = storageAccountType; - return this; - } - - /** - * Get the diskEncryptionSet property: Specifies the customer managed disk encryption set resource id for the - * managed image disk. - * - * @return the diskEncryptionSet value. - */ - public DiskEncryptionSetParameters diskEncryptionSet() { - return this.diskEncryptionSet; - } - - /** - * Set the diskEncryptionSet property: Specifies the customer managed disk encryption set resource id for the - * managed image disk. - * - * @param diskEncryptionSet the diskEncryptionSet value to set. - * @return the ImageDisk object itself. - */ - public ImageDisk withDiskEncryptionSet(DiskEncryptionSetParameters diskEncryptionSet) { - this.diskEncryptionSet = diskEncryptionSet; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (diskEncryptionSet() != null) { - diskEncryptionSet().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ImageDiskReference.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ImageDiskReference.java deleted file mode 100644 index 03e71833c621..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ImageDiskReference.java +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The source image used for creating the disk. */ -@Fluent -public final class ImageDiskReference { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ImageDiskReference.class); - - /* - * A relative uri containing either a Platform Image Repository or user - * image reference. - */ - @JsonProperty(value = "id", required = true) - private String id; - - /* - * If the disk is created from an image's data disk, this is an index that - * indicates which of the data disks in the image to use. For OS disks, - * this field is null. - */ - @JsonProperty(value = "lun") - private Integer lun; - - /** - * Get the id property: A relative uri containing either a Platform Image Repository or user image reference. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: A relative uri containing either a Platform Image Repository or user image reference. - * - * @param id the id value to set. - * @return the ImageDiskReference object itself. - */ - public ImageDiskReference withId(String id) { - this.id = id; - return this; - } - - /** - * Get the lun property: If the disk is created from an image's data disk, this is an index that indicates which of - * the data disks in the image to use. For OS disks, this field is null. - * - * @return the lun value. - */ - public Integer lun() { - return this.lun; - } - - /** - * Set the lun property: If the disk is created from an image's data disk, this is an index that indicates which of - * the data disks in the image to use. For OS disks, this field is null. - * - * @param lun the lun value to set. - * @return the ImageDiskReference object itself. - */ - public ImageDiskReference withLun(Integer lun) { - this.lun = lun; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (id() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property id in model ImageDiskReference")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ImageListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ImageListResult.java deleted file mode 100644 index 6b738776d184..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ImageListResult.java +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.fluent.models.ImageInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The List Image operation response. */ -@Fluent -public final class ImageListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ImageListResult.class); - - /* - * The list of Images. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * The uri to fetch the next page of Images. Call ListNext() with this to - * fetch the next page of Images. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: The list of Images. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The list of Images. - * - * @param value the value value to set. - * @return the ImageListResult object itself. - */ - public ImageListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The uri to fetch the next page of Images. Call ListNext() with this to fetch the next - * page of Images. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The uri to fetch the next page of Images. Call ListNext() with this to fetch the next - * page of Images. - * - * @param nextLink the nextLink value to set. - * @return the ImageListResult object itself. - */ - public ImageListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model ImageListResult")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ImageOSDisk.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ImageOSDisk.java deleted file mode 100644 index 509501caa900..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ImageOSDisk.java +++ /dev/null @@ -1,144 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describes an Operating System disk. */ -@Fluent -public final class ImageOSDisk extends ImageDisk { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ImageOSDisk.class); - - /* - * This property allows you to specify the type of the OS that is included - * in the disk if creating a VM from a custom image.

Possible - * values are:

**Windows**

**Linux** - */ - @JsonProperty(value = "osType", required = true) - private OperatingSystemTypes osType; - - /* - * The OS State. - */ - @JsonProperty(value = "osState", required = true) - private OperatingSystemStateTypes osState; - - /** - * Get the osType property: This property allows you to specify the type of the OS that is included in the disk if - * creating a VM from a custom image. <br><br> Possible values are: <br><br> **Windows** - * <br><br> **Linux**. - * - * @return the osType value. - */ - public OperatingSystemTypes osType() { - return this.osType; - } - - /** - * Set the osType property: This property allows you to specify the type of the OS that is included in the disk if - * creating a VM from a custom image. <br><br> Possible values are: <br><br> **Windows** - * <br><br> **Linux**. - * - * @param osType the osType value to set. - * @return the ImageOSDisk object itself. - */ - public ImageOSDisk withOsType(OperatingSystemTypes osType) { - this.osType = osType; - return this; - } - - /** - * Get the osState property: The OS State. - * - * @return the osState value. - */ - public OperatingSystemStateTypes osState() { - return this.osState; - } - - /** - * Set the osState property: The OS State. - * - * @param osState the osState value to set. - * @return the ImageOSDisk object itself. - */ - public ImageOSDisk withOsState(OperatingSystemStateTypes osState) { - this.osState = osState; - return this; - } - - /** {@inheritDoc} */ - @Override - public ImageOSDisk withSnapshot(SubResource snapshot) { - super.withSnapshot(snapshot); - return this; - } - - /** {@inheritDoc} */ - @Override - public ImageOSDisk withManagedDisk(SubResource managedDisk) { - super.withManagedDisk(managedDisk); - return this; - } - - /** {@inheritDoc} */ - @Override - public ImageOSDisk withBlobUri(String blobUri) { - super.withBlobUri(blobUri); - return this; - } - - /** {@inheritDoc} */ - @Override - public ImageOSDisk withCaching(CachingTypes caching) { - super.withCaching(caching); - return this; - } - - /** {@inheritDoc} */ - @Override - public ImageOSDisk withDiskSizeGB(Integer diskSizeGB) { - super.withDiskSizeGB(diskSizeGB); - return this; - } - - /** {@inheritDoc} */ - @Override - public ImageOSDisk withStorageAccountType(StorageAccountTypes storageAccountType) { - super.withStorageAccountType(storageAccountType); - return this; - } - - /** {@inheritDoc} */ - @Override - public ImageOSDisk withDiskEncryptionSet(DiskEncryptionSetParameters diskEncryptionSet) { - super.withDiskEncryptionSet(diskEncryptionSet); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (osType() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property osType in model ImageOSDisk")); - } - if (osState() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property osState in model ImageOSDisk")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ImagePurchasePlan.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ImagePurchasePlan.java deleted file mode 100644 index 7956665ba49e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ImagePurchasePlan.java +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describes the gallery Image Definition purchase plan. This is used by marketplace images. */ -@Fluent -public final class ImagePurchasePlan { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ImagePurchasePlan.class); - - /* - * The plan ID. - */ - @JsonProperty(value = "name") - private String name; - - /* - * The publisher ID. - */ - @JsonProperty(value = "publisher") - private String publisher; - - /* - * The product ID. - */ - @JsonProperty(value = "product") - private String product; - - /** - * Get the name property: The plan ID. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The plan ID. - * - * @param name the name value to set. - * @return the ImagePurchasePlan object itself. - */ - public ImagePurchasePlan withName(String name) { - this.name = name; - return this; - } - - /** - * Get the publisher property: The publisher ID. - * - * @return the publisher value. - */ - public String publisher() { - return this.publisher; - } - - /** - * Set the publisher property: The publisher ID. - * - * @param publisher the publisher value to set. - * @return the ImagePurchasePlan object itself. - */ - public ImagePurchasePlan withPublisher(String publisher) { - this.publisher = publisher; - return this; - } - - /** - * Get the product property: The product ID. - * - * @return the product value. - */ - public String product() { - return this.product; - } - - /** - * Set the product property: The product ID. - * - * @param product the product value to set. - * @return the ImagePurchasePlan object itself. - */ - public ImagePurchasePlan withProduct(String product) { - this.product = product; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ImageReference.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ImageReference.java deleted file mode 100644 index e726f48f73ef..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ImageReference.java +++ /dev/null @@ -1,175 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Specifies information about the image to use. You can specify information about platform images, marketplace images, - * or virtual machine images. This element is required when you want to use a platform image, marketplace image, or - * virtual machine image, but is not used in other creation operations. NOTE: Image reference publisher and offer can - * only be set when you create the scale set. - */ -@Fluent -public final class ImageReference extends SubResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ImageReference.class); - - /* - * The image publisher. - */ - @JsonProperty(value = "publisher") - private String publisher; - - /* - * Specifies the offer of the platform image or marketplace image used to - * create the virtual machine. - */ - @JsonProperty(value = "offer") - private String offer; - - /* - * The image SKU. - */ - @JsonProperty(value = "sku") - private String sku; - - /* - * Specifies the version of the platform image or marketplace image used to - * create the virtual machine. The allowed formats are Major.Minor.Build or - * 'latest'. Major, Minor, and Build are decimal numbers. Specify 'latest' - * to use the latest version of an image available at deploy time. Even if - * you use 'latest', the VM image will not automatically update after - * deploy time even if a new version becomes available. - */ - @JsonProperty(value = "version") - private String version; - - /* - * Specifies in decimal numbers, the version of platform image or - * marketplace image used to create the virtual machine. This readonly - * field differs from 'version', only if the value specified in 'version' - * field is 'latest'. - */ - @JsonProperty(value = "exactVersion", access = JsonProperty.Access.WRITE_ONLY) - private String exactVersion; - - /** - * Get the publisher property: The image publisher. - * - * @return the publisher value. - */ - public String publisher() { - return this.publisher; - } - - /** - * Set the publisher property: The image publisher. - * - * @param publisher the publisher value to set. - * @return the ImageReference object itself. - */ - public ImageReference withPublisher(String publisher) { - this.publisher = publisher; - return this; - } - - /** - * Get the offer property: Specifies the offer of the platform image or marketplace image used to create the virtual - * machine. - * - * @return the offer value. - */ - public String offer() { - return this.offer; - } - - /** - * Set the offer property: Specifies the offer of the platform image or marketplace image used to create the virtual - * machine. - * - * @param offer the offer value to set. - * @return the ImageReference object itself. - */ - public ImageReference withOffer(String offer) { - this.offer = offer; - return this; - } - - /** - * Get the sku property: The image SKU. - * - * @return the sku value. - */ - public String sku() { - return this.sku; - } - - /** - * Set the sku property: The image SKU. - * - * @param sku the sku value to set. - * @return the ImageReference object itself. - */ - public ImageReference withSku(String sku) { - this.sku = sku; - return this; - } - - /** - * Get the version property: Specifies the version of the platform image or marketplace image used to create the - * virtual machine. The allowed formats are Major.Minor.Build or 'latest'. Major, Minor, and Build are decimal - * numbers. Specify 'latest' to use the latest version of an image available at deploy time. Even if you use - * 'latest', the VM image will not automatically update after deploy time even if a new version becomes available. - * - * @return the version value. - */ - public String version() { - return this.version; - } - - /** - * Set the version property: Specifies the version of the platform image or marketplace image used to create the - * virtual machine. The allowed formats are Major.Minor.Build or 'latest'. Major, Minor, and Build are decimal - * numbers. Specify 'latest' to use the latest version of an image available at deploy time. Even if you use - * 'latest', the VM image will not automatically update after deploy time even if a new version becomes available. - * - * @param version the version value to set. - * @return the ImageReference object itself. - */ - public ImageReference withVersion(String version) { - this.version = version; - return this; - } - - /** - * Get the exactVersion property: Specifies in decimal numbers, the version of platform image or marketplace image - * used to create the virtual machine. This readonly field differs from 'version', only if the value specified in - * 'version' field is 'latest'. - * - * @return the exactVersion value. - */ - public String exactVersion() { - return this.exactVersion; - } - - /** {@inheritDoc} */ - @Override - public ImageReference withId(String id) { - super.withId(id); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ImageStorageProfile.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ImageStorageProfile.java deleted file mode 100644 index 24f4049fc9e4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ImageStorageProfile.java +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Describes a storage profile. */ -@Fluent -public final class ImageStorageProfile { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ImageStorageProfile.class); - - /* - * Specifies information about the operating system disk used by the - * virtual machine.

For more information about disks, see [About - * disks and VHDs for Azure virtual - * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). - */ - @JsonProperty(value = "osDisk") - private ImageOSDisk osDisk; - - /* - * Specifies the parameters that are used to add a data disk to a virtual - * machine.

For more information about disks, see [About disks and - * VHDs for Azure virtual - * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). - */ - @JsonProperty(value = "dataDisks") - private List dataDisks; - - /* - * Specifies whether an image is zone resilient or not. Default is false. - * Zone resilient images can be created only in regions that provide Zone - * Redundant Storage (ZRS). - */ - @JsonProperty(value = "zoneResilient") - private Boolean zoneResilient; - - /** - * Get the osDisk property: Specifies information about the operating system disk used by the virtual machine. - * <br><br> For more information about disks, see [About disks and VHDs for Azure virtual - * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). - * - * @return the osDisk value. - */ - public ImageOSDisk osDisk() { - return this.osDisk; - } - - /** - * Set the osDisk property: Specifies information about the operating system disk used by the virtual machine. - * <br><br> For more information about disks, see [About disks and VHDs for Azure virtual - * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). - * - * @param osDisk the osDisk value to set. - * @return the ImageStorageProfile object itself. - */ - public ImageStorageProfile withOsDisk(ImageOSDisk osDisk) { - this.osDisk = osDisk; - return this; - } - - /** - * Get the dataDisks property: Specifies the parameters that are used to add a data disk to a virtual machine. - * <br><br> For more information about disks, see [About disks and VHDs for Azure virtual - * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). - * - * @return the dataDisks value. - */ - public List dataDisks() { - return this.dataDisks; - } - - /** - * Set the dataDisks property: Specifies the parameters that are used to add a data disk to a virtual machine. - * <br><br> For more information about disks, see [About disks and VHDs for Azure virtual - * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). - * - * @param dataDisks the dataDisks value to set. - * @return the ImageStorageProfile object itself. - */ - public ImageStorageProfile withDataDisks(List dataDisks) { - this.dataDisks = dataDisks; - return this; - } - - /** - * Get the zoneResilient property: Specifies whether an image is zone resilient or not. Default is false. Zone - * resilient images can be created only in regions that provide Zone Redundant Storage (ZRS). - * - * @return the zoneResilient value. - */ - public Boolean zoneResilient() { - return this.zoneResilient; - } - - /** - * Set the zoneResilient property: Specifies whether an image is zone resilient or not. Default is false. Zone - * resilient images can be created only in regions that provide Zone Redundant Storage (ZRS). - * - * @param zoneResilient the zoneResilient value to set. - * @return the ImageStorageProfile object itself. - */ - public ImageStorageProfile withZoneResilient(Boolean zoneResilient) { - this.zoneResilient = zoneResilient; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (osDisk() != null) { - osDisk().validate(); - } - if (dataDisks() != null) { - dataDisks().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ImageUpdate.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ImageUpdate.java deleted file mode 100644 index 8c25d27b9c29..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ImageUpdate.java +++ /dev/null @@ -1,132 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.fluent.models.ImageProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** The source user image virtual hard disk. Only tags may be updated. */ -@Fluent -public final class ImageUpdate extends UpdateResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ImageUpdate.class); - - /* - * Describes the properties of an Image. - */ - @JsonProperty(value = "properties") - private ImageProperties innerProperties; - - /** - * Get the innerProperties property: Describes the properties of an Image. - * - * @return the innerProperties value. - */ - private ImageProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public ImageUpdate withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the sourceVirtualMachine property: The source virtual machine from which Image is created. - * - * @return the sourceVirtualMachine value. - */ - public SubResource sourceVirtualMachine() { - return this.innerProperties() == null ? null : this.innerProperties().sourceVirtualMachine(); - } - - /** - * Set the sourceVirtualMachine property: The source virtual machine from which Image is created. - * - * @param sourceVirtualMachine the sourceVirtualMachine value to set. - * @return the ImageUpdate object itself. - */ - public ImageUpdate withSourceVirtualMachine(SubResource sourceVirtualMachine) { - if (this.innerProperties() == null) { - this.innerProperties = new ImageProperties(); - } - this.innerProperties().withSourceVirtualMachine(sourceVirtualMachine); - return this; - } - - /** - * Get the storageProfile property: Specifies the storage settings for the virtual machine disks. - * - * @return the storageProfile value. - */ - public ImageStorageProfile storageProfile() { - return this.innerProperties() == null ? null : this.innerProperties().storageProfile(); - } - - /** - * Set the storageProfile property: Specifies the storage settings for the virtual machine disks. - * - * @param storageProfile the storageProfile value to set. - * @return the ImageUpdate object itself. - */ - public ImageUpdate withStorageProfile(ImageStorageProfile storageProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new ImageProperties(); - } - this.innerProperties().withStorageProfile(storageProfile); - return this; - } - - /** - * Get the provisioningState property: The provisioning state. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the hyperVGeneration property: Gets the HyperVGenerationType of the VirtualMachine created from the image. - * - * @return the hyperVGeneration value. - */ - public HyperVGenerationTypes hyperVGeneration() { - return this.innerProperties() == null ? null : this.innerProperties().hyperVGeneration(); - } - - /** - * Set the hyperVGeneration property: Gets the HyperVGenerationType of the VirtualMachine created from the image. - * - * @param hyperVGeneration the hyperVGeneration value to set. - * @return the ImageUpdate object itself. - */ - public ImageUpdate withHyperVGeneration(HyperVGenerationTypes hyperVGeneration) { - if (this.innerProperties() == null) { - this.innerProperties = new ImageProperties(); - } - this.innerProperties().withHyperVGeneration(hyperVGeneration); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/InGuestPatchMode.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/InGuestPatchMode.java deleted file mode 100644 index 941d1f13ae2f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/InGuestPatchMode.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for InGuestPatchMode. */ -public final class InGuestPatchMode extends ExpandableStringEnum { - /** Static value Manual for InGuestPatchMode. */ - public static final InGuestPatchMode MANUAL = fromString("Manual"); - - /** Static value AutomaticByOS for InGuestPatchMode. */ - public static final InGuestPatchMode AUTOMATIC_BY_OS = fromString("AutomaticByOS"); - - /** Static value AutomaticByPlatform for InGuestPatchMode. */ - public static final InGuestPatchMode AUTOMATIC_BY_PLATFORM = fromString("AutomaticByPlatform"); - - /** - * Creates or finds a InGuestPatchMode from its string representation. - * - * @param name a name to look for. - * @return the corresponding InGuestPatchMode. - */ - @JsonCreator - public static InGuestPatchMode fromString(String name) { - return fromString(name, InGuestPatchMode.class); - } - - /** @return known InGuestPatchMode values. */ - public static Collection values() { - return values(InGuestPatchMode.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/InnerError.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/InnerError.java deleted file mode 100644 index 011dcde3a83e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/InnerError.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Inner error details. */ -@Fluent -public final class InnerError { - @JsonIgnore private final ClientLogger logger = new ClientLogger(InnerError.class); - - /* - * The exception type. - */ - @JsonProperty(value = "exceptiontype") - private String exceptiontype; - - /* - * The internal error message or exception dump. - */ - @JsonProperty(value = "errordetail") - private String errordetail; - - /** - * Get the exceptiontype property: The exception type. - * - * @return the exceptiontype value. - */ - public String exceptiontype() { - return this.exceptiontype; - } - - /** - * Set the exceptiontype property: The exception type. - * - * @param exceptiontype the exceptiontype value to set. - * @return the InnerError object itself. - */ - public InnerError withExceptiontype(String exceptiontype) { - this.exceptiontype = exceptiontype; - return this; - } - - /** - * Get the errordetail property: The internal error message or exception dump. - * - * @return the errordetail value. - */ - public String errordetail() { - return this.errordetail; - } - - /** - * Set the errordetail property: The internal error message or exception dump. - * - * @param errordetail the errordetail value to set. - * @return the InnerError object itself. - */ - public InnerError withErrordetail(String errordetail) { - this.errordetail = errordetail; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/InstanceViewStatus.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/InstanceViewStatus.java deleted file mode 100644 index 4c9ff6b58dab..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/InstanceViewStatus.java +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** Instance view status. */ -@Fluent -public final class InstanceViewStatus { - @JsonIgnore private final ClientLogger logger = new ClientLogger(InstanceViewStatus.class); - - /* - * The status code. - */ - @JsonProperty(value = "code") - private String code; - - /* - * The level code. - */ - @JsonProperty(value = "level") - private StatusLevelTypes level; - - /* - * The short localizable label for the status. - */ - @JsonProperty(value = "displayStatus") - private String displayStatus; - - /* - * The detailed status message, including for alerts and error messages. - */ - @JsonProperty(value = "message") - private String message; - - /* - * The time of the status. - */ - @JsonProperty(value = "time") - private OffsetDateTime time; - - /** - * Get the code property: The status code. - * - * @return the code value. - */ - public String code() { - return this.code; - } - - /** - * Set the code property: The status code. - * - * @param code the code value to set. - * @return the InstanceViewStatus object itself. - */ - public InstanceViewStatus withCode(String code) { - this.code = code; - return this; - } - - /** - * Get the level property: The level code. - * - * @return the level value. - */ - public StatusLevelTypes level() { - return this.level; - } - - /** - * Set the level property: The level code. - * - * @param level the level value to set. - * @return the InstanceViewStatus object itself. - */ - public InstanceViewStatus withLevel(StatusLevelTypes level) { - this.level = level; - return this; - } - - /** - * Get the displayStatus property: The short localizable label for the status. - * - * @return the displayStatus value. - */ - public String displayStatus() { - return this.displayStatus; - } - - /** - * Set the displayStatus property: The short localizable label for the status. - * - * @param displayStatus the displayStatus value to set. - * @return the InstanceViewStatus object itself. - */ - public InstanceViewStatus withDisplayStatus(String displayStatus) { - this.displayStatus = displayStatus; - return this; - } - - /** - * Get the message property: The detailed status message, including for alerts and error messages. - * - * @return the message value. - */ - public String message() { - return this.message; - } - - /** - * Set the message property: The detailed status message, including for alerts and error messages. - * - * @param message the message value to set. - * @return the InstanceViewStatus object itself. - */ - public InstanceViewStatus withMessage(String message) { - this.message = message; - return this; - } - - /** - * Get the time property: The time of the status. - * - * @return the time value. - */ - public OffsetDateTime time() { - return this.time; - } - - /** - * Set the time property: The time of the status. - * - * @param time the time value to set. - * @return the InstanceViewStatus object itself. - */ - public InstanceViewStatus withTime(OffsetDateTime time) { - this.time = time; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/InstanceViewTypes.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/InstanceViewTypes.java deleted file mode 100644 index df5e52a80b5a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/InstanceViewTypes.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for InstanceViewTypes. */ -public enum InstanceViewTypes { - /** Enum value instanceView. */ - INSTANCE_VIEW("instanceView"); - - /** The actual serialized value for a InstanceViewTypes instance. */ - private final String value; - - InstanceViewTypes(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a InstanceViewTypes instance. - * - * @param value the serialized value to parse. - * @return the parsed InstanceViewTypes object, or null if unable to parse. - */ - @JsonCreator - public static InstanceViewTypes fromString(String value) { - InstanceViewTypes[] items = InstanceViewTypes.values(); - for (InstanceViewTypes item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/IntervalInMins.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/IntervalInMins.java deleted file mode 100644 index 32c89e6a1440..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/IntervalInMins.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for IntervalInMins. */ -public enum IntervalInMins { - /** Enum value ThreeMins. */ - THREE_MINS("ThreeMins"), - - /** Enum value FiveMins. */ - FIVE_MINS("FiveMins"), - - /** Enum value ThirtyMins. */ - THIRTY_MINS("ThirtyMins"), - - /** Enum value SixtyMins. */ - SIXTY_MINS("SixtyMins"); - - /** The actual serialized value for a IntervalInMins instance. */ - private final String value; - - IntervalInMins(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a IntervalInMins instance. - * - * @param value the serialized value to parse. - * @return the parsed IntervalInMins object, or null if unable to parse. - */ - @JsonCreator - public static IntervalInMins fromString(String value) { - IntervalInMins[] items = IntervalInMins.values(); - for (IntervalInMins item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/IpVersion.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/IpVersion.java deleted file mode 100644 index 2b04b76bcbd2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/IpVersion.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for IpVersion. */ -public final class IpVersion extends ExpandableStringEnum { - /** Static value IPv4 for IpVersion. */ - public static final IpVersion IPV4 = fromString("IPv4"); - - /** Static value IPv6 for IpVersion. */ - public static final IpVersion IPV6 = fromString("IPv6"); - - /** - * Creates or finds a IpVersion from its string representation. - * - * @param name a name to look for. - * @return the corresponding IpVersion. - */ - @JsonCreator - public static IpVersion fromString(String name) { - return fromString(name, IpVersion.class); - } - - /** @return known IpVersion values. */ - public static Collection values() { - return values(IpVersion.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/KeyVaultAndKeyReference.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/KeyVaultAndKeyReference.java deleted file mode 100644 index e50d87cb3a59..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/KeyVaultAndKeyReference.java +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Key Vault Key Url and vault id of KeK, KeK is optional and when provided is used to unwrap the encryptionKey. */ -@Fluent -public final class KeyVaultAndKeyReference { - @JsonIgnore private final ClientLogger logger = new ClientLogger(KeyVaultAndKeyReference.class); - - /* - * Resource id of the KeyVault containing the key or secret - */ - @JsonProperty(value = "sourceVault", required = true) - private SourceVault sourceVault; - - /* - * Url pointing to a key or secret in KeyVault - */ - @JsonProperty(value = "keyUrl", required = true) - private String keyUrl; - - /** - * Get the sourceVault property: Resource id of the KeyVault containing the key or secret. - * - * @return the sourceVault value. - */ - public SourceVault sourceVault() { - return this.sourceVault; - } - - /** - * Set the sourceVault property: Resource id of the KeyVault containing the key or secret. - * - * @param sourceVault the sourceVault value to set. - * @return the KeyVaultAndKeyReference object itself. - */ - public KeyVaultAndKeyReference withSourceVault(SourceVault sourceVault) { - this.sourceVault = sourceVault; - return this; - } - - /** - * Get the keyUrl property: Url pointing to a key or secret in KeyVault. - * - * @return the keyUrl value. - */ - public String keyUrl() { - return this.keyUrl; - } - - /** - * Set the keyUrl property: Url pointing to a key or secret in KeyVault. - * - * @param keyUrl the keyUrl value to set. - * @return the KeyVaultAndKeyReference object itself. - */ - public KeyVaultAndKeyReference withKeyUrl(String keyUrl) { - this.keyUrl = keyUrl; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (sourceVault() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property sourceVault in model KeyVaultAndKeyReference")); - } else { - sourceVault().validate(); - } - if (keyUrl() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property keyUrl in model KeyVaultAndKeyReference")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/KeyVaultAndSecretReference.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/KeyVaultAndSecretReference.java deleted file mode 100644 index be42c6c5847a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/KeyVaultAndSecretReference.java +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Key Vault Secret Url and vault id of the encryption key. */ -@Fluent -public final class KeyVaultAndSecretReference { - @JsonIgnore private final ClientLogger logger = new ClientLogger(KeyVaultAndSecretReference.class); - - /* - * Resource id of the KeyVault containing the key or secret - */ - @JsonProperty(value = "sourceVault", required = true) - private SourceVault sourceVault; - - /* - * Url pointing to a key or secret in KeyVault - */ - @JsonProperty(value = "secretUrl", required = true) - private String secretUrl; - - /** - * Get the sourceVault property: Resource id of the KeyVault containing the key or secret. - * - * @return the sourceVault value. - */ - public SourceVault sourceVault() { - return this.sourceVault; - } - - /** - * Set the sourceVault property: Resource id of the KeyVault containing the key or secret. - * - * @param sourceVault the sourceVault value to set. - * @return the KeyVaultAndSecretReference object itself. - */ - public KeyVaultAndSecretReference withSourceVault(SourceVault sourceVault) { - this.sourceVault = sourceVault; - return this; - } - - /** - * Get the secretUrl property: Url pointing to a key or secret in KeyVault. - * - * @return the secretUrl value. - */ - public String secretUrl() { - return this.secretUrl; - } - - /** - * Set the secretUrl property: Url pointing to a key or secret in KeyVault. - * - * @param secretUrl the secretUrl value to set. - * @return the KeyVaultAndSecretReference object itself. - */ - public KeyVaultAndSecretReference withSecretUrl(String secretUrl) { - this.secretUrl = secretUrl; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (sourceVault() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property sourceVault in model KeyVaultAndSecretReference")); - } else { - sourceVault().validate(); - } - if (secretUrl() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property secretUrl in model KeyVaultAndSecretReference")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/KeyVaultKeyReference.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/KeyVaultKeyReference.java deleted file mode 100644 index 47d631ac9ca4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/KeyVaultKeyReference.java +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describes a reference to Key Vault Key. */ -@Fluent -public final class KeyVaultKeyReference { - @JsonIgnore private final ClientLogger logger = new ClientLogger(KeyVaultKeyReference.class); - - /* - * The URL referencing a key encryption key in Key Vault. - */ - @JsonProperty(value = "keyUrl", required = true) - private String keyUrl; - - /* - * The relative URL of the Key Vault containing the key. - */ - @JsonProperty(value = "sourceVault", required = true) - private SubResource sourceVault; - - /** - * Get the keyUrl property: The URL referencing a key encryption key in Key Vault. - * - * @return the keyUrl value. - */ - public String keyUrl() { - return this.keyUrl; - } - - /** - * Set the keyUrl property: The URL referencing a key encryption key in Key Vault. - * - * @param keyUrl the keyUrl value to set. - * @return the KeyVaultKeyReference object itself. - */ - public KeyVaultKeyReference withKeyUrl(String keyUrl) { - this.keyUrl = keyUrl; - return this; - } - - /** - * Get the sourceVault property: The relative URL of the Key Vault containing the key. - * - * @return the sourceVault value. - */ - public SubResource sourceVault() { - return this.sourceVault; - } - - /** - * Set the sourceVault property: The relative URL of the Key Vault containing the key. - * - * @param sourceVault the sourceVault value to set. - * @return the KeyVaultKeyReference object itself. - */ - public KeyVaultKeyReference withSourceVault(SubResource sourceVault) { - this.sourceVault = sourceVault; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (keyUrl() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property keyUrl in model KeyVaultKeyReference")); - } - if (sourceVault() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property sourceVault in model KeyVaultKeyReference")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/KeyVaultSecretReference.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/KeyVaultSecretReference.java deleted file mode 100644 index ef7194a3d698..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/KeyVaultSecretReference.java +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describes a reference to Key Vault Secret. */ -@Fluent -public final class KeyVaultSecretReference { - @JsonIgnore private final ClientLogger logger = new ClientLogger(KeyVaultSecretReference.class); - - /* - * The URL referencing a secret in a Key Vault. - */ - @JsonProperty(value = "secretUrl", required = true) - private String secretUrl; - - /* - * The relative URL of the Key Vault containing the secret. - */ - @JsonProperty(value = "sourceVault", required = true) - private SubResource sourceVault; - - /** - * Get the secretUrl property: The URL referencing a secret in a Key Vault. - * - * @return the secretUrl value. - */ - public String secretUrl() { - return this.secretUrl; - } - - /** - * Set the secretUrl property: The URL referencing a secret in a Key Vault. - * - * @param secretUrl the secretUrl value to set. - * @return the KeyVaultSecretReference object itself. - */ - public KeyVaultSecretReference withSecretUrl(String secretUrl) { - this.secretUrl = secretUrl; - return this; - } - - /** - * Get the sourceVault property: The relative URL of the Key Vault containing the secret. - * - * @return the sourceVault value. - */ - public SubResource sourceVault() { - return this.sourceVault; - } - - /** - * Set the sourceVault property: The relative URL of the Key Vault containing the secret. - * - * @param sourceVault the sourceVault value to set. - * @return the KeyVaultSecretReference object itself. - */ - public KeyVaultSecretReference withSourceVault(SubResource sourceVault) { - this.sourceVault = sourceVault; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (secretUrl() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property secretUrl in model KeyVaultSecretReference")); - } - if (sourceVault() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property sourceVault in model KeyVaultSecretReference")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/KnownLinuxVirtualMachineImage.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/KnownLinuxVirtualMachineImage.java deleted file mode 100644 index ea52a439ca6c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/KnownLinuxVirtualMachineImage.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.compute.models; - -/** The popular Azure Linux images. */ -public enum KnownLinuxVirtualMachineImage { - /** UbuntuServer 16.04LTS. */ - UBUNTU_SERVER_16_04_LTS("Canonical", "UbuntuServer", "16.04.0-LTS"), - /** UbuntuServer 18.04LTS. */ - UBUNTU_SERVER_18_04_LTS("Canonical", "UbuntuServer", "18.04-LTS"), - - /** Debian 9. */ - DEBIAN_9("credativ", "Debian", "9"), - /** Debian 10. */ - DEBIAN_10("Debian", "debian-10", "10"), - - /** CentOS 8.1. */ - CENTOS_8_1("OpenLogic", "CentOS", "8_1"), - /** CentOS 8.3. */ - CENTOS_8_3("OpenLogic", "CentOS", "8_3"), - - /** - * OpenSUSE-Leap 15.1. - * @deprecated use OPENSUSE_LEAP_15. - */ - @Deprecated - OPENSUSE_LEAP_15_1("SUSE", "openSUSE-Leap", "15-2"), - /** OpenSUSE-Leap 15. */ - OPENSUSE_LEAP_15("SUSE", "openSUSE-Leap", "15-2"), - - /** - * SLES 15-SP1-gen1. - * @deprecated use SLES_15. - */ - @Deprecated - SLES_15_SP1("SUSE", "sles-15-sp2", "gen1"), - /** SLES 15. */ - SLES_15("SUSE", "sles-15-sp2", "gen1"), - - /** RedHat RHEL 8.2. */ - REDHAT_RHEL_8_2("RedHat", "RHEL", "8.2"), - - /** Oracle Linux 8.1. */ - ORACLE_LINUX_8_1("Oracle", "Oracle-Linux", "81"); - - private final String publisher; - private final String offer; - private final String sku; - - KnownLinuxVirtualMachineImage(String publisher, String offer, String sku) { - this.publisher = publisher; - this.offer = offer; - this.sku = sku; - } - - /** @return the name of the image publisher */ - public String publisher() { - return this.publisher; - } - - /** @return the name of the image offer */ - public String offer() { - return this.offer; - } - - /** @return the name of the image SKU */ - public String sku() { - return this.sku; - } - - /** @return the image reference */ - public ImageReference imageReference() { - return new ImageReference().withPublisher(publisher()).withOffer(offer()).withSku(sku()).withVersion("latest"); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/KnownWindowsVirtualMachineImage.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/KnownWindowsVirtualMachineImage.java deleted file mode 100644 index 616fb723f5c2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/KnownWindowsVirtualMachineImage.java +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.compute.models; - -/** The popular Azure Windows images. */ -public enum KnownWindowsVirtualMachineImage { - /** Windows 10 2020 H1 Pro */ - WINDOWS_DESKTOP_10_20H1_PRO("MicrosoftWindowsDesktop", "Windows-10", "20h1-pro"), - /** Windows Server 2019 Data center. */ - WINDOWS_SERVER_2019_DATACENTER("MicrosoftWindowsServer", "WindowsServer", "2019-Datacenter"), - /** Windows Server 2019 Data center with containers. */ - WINDOWS_SERVER_2019_DATACENTER_WITH_CONTAINERS( - "MicrosoftWindowsServer", "WindowsServer", "2019-Datacenter-with-Containers"), - /** Windows Server 2016 Data center. */ - WINDOWS_SERVER_2016_DATACENTER("MicrosoftWindowsServer", "WindowsServer", "2016-Datacenter"), - /** Windows Server 2012 R2 Data center. */ - WINDOWS_SERVER_2012_R2_DATACENTER("MicrosoftWindowsServer", "WindowsServer", "2012-R2-Datacenter"); - - private final String publisher; - private final String offer; - private final String sku; - - KnownWindowsVirtualMachineImage(String publisher, String offer, String sku) { - this.publisher = publisher; - this.offer = offer; - this.sku = sku; - } - - /** @return the name of the image publisher */ - public String publisher() { - return this.publisher; - } - - /** @return the name of the image offer */ - public String offer() { - return this.offer; - } - - /** @return the name of the image SKU */ - public String sku() { - return this.sku; - } - - /** @return the image reference */ - public ImageReference imageReference() { - return new ImageReference().withPublisher(publisher()).withOffer(offer()).withSku(sku()).withVersion("latest"); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/LastPatchInstallationSummary.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/LastPatchInstallationSummary.java deleted file mode 100644 index 0ecb7d5e25c5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/LastPatchInstallationSummary.java +++ /dev/null @@ -1,248 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** Describes the properties of the last installed patch summary. */ -@Immutable -public final class LastPatchInstallationSummary { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LastPatchInstallationSummary.class); - - /* - * The overall success or failure status of the operation. It remains - * "InProgress" until the operation completes. At that point it will become - * "Failed", "Succeeded", or "CompletedWithWarnings." - */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) - private PatchOperationStatus status; - - /* - * The activity ID of the operation that produced this result. It is used - * to correlate across CRP and extension logs. - */ - @JsonProperty(value = "installationActivityId", access = JsonProperty.Access.WRITE_ONLY) - private String installationActivityId; - - /* - * Describes whether the operation ran out of time before it completed all - * its intended actions - */ - @JsonProperty(value = "maintenanceWindowExceeded", access = JsonProperty.Access.WRITE_ONLY) - private Boolean maintenanceWindowExceeded; - - /* - * The reboot status of the machine after the patch operation. It will be - * in "NotNeeded" status if reboot is not needed after the patch operation. - * "Required" will be the status once the patch is applied and machine is - * required to reboot. "Started" will be the reboot status when the machine - * has started to reboot. "Failed" will be the status if the machine is - * failed to reboot. "Completed" will be the status once the machine is - * rebooted successfully - */ - @JsonProperty(value = "rebootStatus", access = JsonProperty.Access.WRITE_ONLY) - private RebootStatus rebootStatus; - - /* - * The number of all available patches but not going to be installed - * because it didn't match a classification or inclusion list entry. - */ - @JsonProperty(value = "notSelectedPatchCount", access = JsonProperty.Access.WRITE_ONLY) - private Integer notSelectedPatchCount; - - /* - * The number of all available patches but excluded explicitly by a - * customer-specified exclusion list match. - */ - @JsonProperty(value = "excludedPatchCount", access = JsonProperty.Access.WRITE_ONLY) - private Integer excludedPatchCount; - - /* - * The number of all available patches expected to be installed over the - * course of the patch installation operation. - */ - @JsonProperty(value = "pendingPatchCount", access = JsonProperty.Access.WRITE_ONLY) - private Integer pendingPatchCount; - - /* - * The count of patches that successfully installed. - */ - @JsonProperty(value = "installedPatchCount", access = JsonProperty.Access.WRITE_ONLY) - private Integer installedPatchCount; - - /* - * The count of patches that failed installation. - */ - @JsonProperty(value = "failedPatchCount", access = JsonProperty.Access.WRITE_ONLY) - private Integer failedPatchCount; - - /* - * The UTC timestamp when the operation began. - */ - @JsonProperty(value = "startTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime startTime; - - /* - * The UTC timestamp when the operation began. - */ - @JsonProperty(value = "lastModifiedTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime lastModifiedTime; - - /* - * The person or system account that started the operation - */ - @JsonProperty(value = "startedBy", access = JsonProperty.Access.WRITE_ONLY) - private String startedBy; - - /* - * The errors that were encountered during execution of the operation. The - * details array contains the list of them. - */ - @JsonProperty(value = "error", access = JsonProperty.Access.WRITE_ONLY) - private ApiError error; - - /** - * Get the status property: The overall success or failure status of the operation. It remains "InProgress" until - * the operation completes. At that point it will become "Failed", "Succeeded", or "CompletedWithWarnings.". - * - * @return the status value. - */ - public PatchOperationStatus status() { - return this.status; - } - - /** - * Get the installationActivityId property: The activity ID of the operation that produced this result. It is used - * to correlate across CRP and extension logs. - * - * @return the installationActivityId value. - */ - public String installationActivityId() { - return this.installationActivityId; - } - - /** - * Get the maintenanceWindowExceeded property: Describes whether the operation ran out of time before it completed - * all its intended actions. - * - * @return the maintenanceWindowExceeded value. - */ - public Boolean maintenanceWindowExceeded() { - return this.maintenanceWindowExceeded; - } - - /** - * Get the rebootStatus property: The reboot status of the machine after the patch operation. It will be in - * "NotNeeded" status if reboot is not needed after the patch operation. "Required" will be the status once the - * patch is applied and machine is required to reboot. "Started" will be the reboot status when the machine has - * started to reboot. "Failed" will be the status if the machine is failed to reboot. "Completed" will be the status - * once the machine is rebooted successfully. - * - * @return the rebootStatus value. - */ - public RebootStatus rebootStatus() { - return this.rebootStatus; - } - - /** - * Get the notSelectedPatchCount property: The number of all available patches but not going to be installed because - * it didn't match a classification or inclusion list entry. - * - * @return the notSelectedPatchCount value. - */ - public Integer notSelectedPatchCount() { - return this.notSelectedPatchCount; - } - - /** - * Get the excludedPatchCount property: The number of all available patches but excluded explicitly by a - * customer-specified exclusion list match. - * - * @return the excludedPatchCount value. - */ - public Integer excludedPatchCount() { - return this.excludedPatchCount; - } - - /** - * Get the pendingPatchCount property: The number of all available patches expected to be installed over the course - * of the patch installation operation. - * - * @return the pendingPatchCount value. - */ - public Integer pendingPatchCount() { - return this.pendingPatchCount; - } - - /** - * Get the installedPatchCount property: The count of patches that successfully installed. - * - * @return the installedPatchCount value. - */ - public Integer installedPatchCount() { - return this.installedPatchCount; - } - - /** - * Get the failedPatchCount property: The count of patches that failed installation. - * - * @return the failedPatchCount value. - */ - public Integer failedPatchCount() { - return this.failedPatchCount; - } - - /** - * Get the startTime property: The UTC timestamp when the operation began. - * - * @return the startTime value. - */ - public OffsetDateTime startTime() { - return this.startTime; - } - - /** - * Get the lastModifiedTime property: The UTC timestamp when the operation began. - * - * @return the lastModifiedTime value. - */ - public OffsetDateTime lastModifiedTime() { - return this.lastModifiedTime; - } - - /** - * Get the startedBy property: The person or system account that started the operation. - * - * @return the startedBy value. - */ - public String startedBy() { - return this.startedBy; - } - - /** - * Get the error property: The errors that were encountered during execution of the operation. The details array - * contains the list of them. - * - * @return the error value. - */ - public ApiError error() { - return this.error; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (error() != null) { - error().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/LinuxConfiguration.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/LinuxConfiguration.java deleted file mode 100644 index 40a94a1e2a7a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/LinuxConfiguration.java +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Specifies the Linux operating system settings on the virtual machine. <br><br>For a list of supported - * Linux distributions, see [Linux on Azure-Endorsed - * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) - * <br><br> For running non-endorsed distributions, see [Information for Non-Endorsed - * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). - */ -@Fluent -public final class LinuxConfiguration { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LinuxConfiguration.class); - - /* - * Specifies whether password authentication should be disabled. - */ - @JsonProperty(value = "disablePasswordAuthentication") - private Boolean disablePasswordAuthentication; - - /* - * Specifies the ssh key configuration for a Linux OS. - */ - @JsonProperty(value = "ssh") - private SshConfiguration ssh; - - /* - * Indicates whether virtual machine agent should be provisioned on the - * virtual machine.

When this property is not specified in the - * request body, default behavior is to set it to true. This will ensure - * that VM Agent is installed on the VM so that extensions can be added to - * the VM later. - */ - @JsonProperty(value = "provisionVMAgent") - private Boolean provisionVMAgent; - - /** - * Get the disablePasswordAuthentication property: Specifies whether password authentication should be disabled. - * - * @return the disablePasswordAuthentication value. - */ - public Boolean disablePasswordAuthentication() { - return this.disablePasswordAuthentication; - } - - /** - * Set the disablePasswordAuthentication property: Specifies whether password authentication should be disabled. - * - * @param disablePasswordAuthentication the disablePasswordAuthentication value to set. - * @return the LinuxConfiguration object itself. - */ - public LinuxConfiguration withDisablePasswordAuthentication(Boolean disablePasswordAuthentication) { - this.disablePasswordAuthentication = disablePasswordAuthentication; - return this; - } - - /** - * Get the ssh property: Specifies the ssh key configuration for a Linux OS. - * - * @return the ssh value. - */ - public SshConfiguration ssh() { - return this.ssh; - } - - /** - * Set the ssh property: Specifies the ssh key configuration for a Linux OS. - * - * @param ssh the ssh value to set. - * @return the LinuxConfiguration object itself. - */ - public LinuxConfiguration withSsh(SshConfiguration ssh) { - this.ssh = ssh; - return this; - } - - /** - * Get the provisionVMAgent property: Indicates whether virtual machine agent should be provisioned on the virtual - * machine. <br><br> When this property is not specified in the request body, default behavior is to set - * it to true. This will ensure that VM Agent is installed on the VM so that extensions can be added to the VM - * later. - * - * @return the provisionVMAgent value. - */ - public Boolean provisionVMAgent() { - return this.provisionVMAgent; - } - - /** - * Set the provisionVMAgent property: Indicates whether virtual machine agent should be provisioned on the virtual - * machine. <br><br> When this property is not specified in the request body, default behavior is to set - * it to true. This will ensure that VM Agent is installed on the VM so that extensions can be added to the VM - * later. - * - * @param provisionVMAgent the provisionVMAgent value to set. - * @return the LinuxConfiguration object itself. - */ - public LinuxConfiguration withProvisionVMAgent(Boolean provisionVMAgent) { - this.provisionVMAgent = provisionVMAgent; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (ssh() != null) { - ssh().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/LinuxVMDiskEncryptionConfiguration.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/LinuxVMDiskEncryptionConfiguration.java deleted file mode 100644 index 09e9d08ad631..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/LinuxVMDiskEncryptionConfiguration.java +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.management.AzureEnvironment; - -/** Type representing encryption settings to be applied to a Linux virtual machine. */ -public class LinuxVMDiskEncryptionConfiguration - extends VirtualMachineEncryptionConfiguration { - /** - * Creates LinuxVMDiskEncryptionSettings. - * - * Recommend to use the alternative constructor to provide vaultUri. - * - * @param keyVaultId the resource ID of the KeyVault to store the disk encryption key - * @param aadClientId client ID of an AAD application which has permission to the KeyVault - * @param aadSecret client secret corresponding to the client ID - */ - public LinuxVMDiskEncryptionConfiguration(String keyVaultId, String aadClientId, String aadSecret) { - super(keyVaultId, null, aadClientId, aadSecret, null); - } - - /** - * Creates LinuxVMDiskEncryptionSettings. - * - * @param keyVaultId the resource ID of the KeyVault to store the disk encryption key - * @param vaultUri URI of the key vault data-plane endpoint - * @param aadClientId client ID of an AAD application which has permission to the KeyVault - * @param aadSecret client secret corresponding to the client ID - */ - public LinuxVMDiskEncryptionConfiguration(String keyVaultId, - String vaultUri, - String aadClientId, - String aadSecret) { - super(keyVaultId, vaultUri, aadClientId, aadSecret, null); - } - - /** - * Creates LinuxVMDiskEncryptionSettings. - * - * Recommend to use the alternative constructor to provide vaultUri. - * - * @param keyVaultId the resource ID of the KeyVault to store the disk encryption key - * @param aadClientId client ID of an AAD application which has permission to the KeyVault - * @param aadSecret client secret corresponding to the client ID - * @param azureEnvironment Azure environment - */ - public LinuxVMDiskEncryptionConfiguration(String keyVaultId, - String aadClientId, - String aadSecret, - AzureEnvironment azureEnvironment) { - super(keyVaultId, null, aadClientId, aadSecret, azureEnvironment); - } - - /** - * Creates LinuxVMDiskEncryptionSettings. - * - * @param keyVaultId the resource ID of the KeyVault to store the disk encryption key - */ - public LinuxVMDiskEncryptionConfiguration(String keyVaultId) { - super(keyVaultId, null, null); - } - - /** - * Creates LinuxVMDiskEncryptionSettings. - * - * @param keyVaultId the resource ID of the KeyVault to store the disk encryption key - * @param vaultUri URI of the key vault data-plane endpoint - */ - public LinuxVMDiskEncryptionConfiguration(String keyVaultId, String vaultUri) { - super(keyVaultId, vaultUri, null); - } - - /** - * Creates LinuxVMDiskEncryptionSettings. - * - * Recommend to use the alternative constructor to provide vaultUri. - * - * @param keyVaultId the resource ID of the KeyVault to store the disk encryption key - * @param azureEnvironment Azure environment - */ - public LinuxVMDiskEncryptionConfiguration(String keyVaultId, AzureEnvironment azureEnvironment) { - super(keyVaultId, null, azureEnvironment); - } - - @Override - public OperatingSystemTypes osType() { - return OperatingSystemTypes.LINUX; - } - - /** - * Specifies the pass phrase for encrypting Linux OS or data disks. - * - * @param passPhrase the pass phrase - * @return LinuxVMDiskEncryptionSettings - */ - public LinuxVMDiskEncryptionConfiguration withPassPhrase(String passPhrase) { - this.passPhrase = passPhrase; - return this; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ListUsagesResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ListUsagesResult.java deleted file mode 100644 index 024a061480f4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ListUsagesResult.java +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.fluent.models.UsageInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The List Usages operation response. */ -@Fluent -public final class ListUsagesResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ListUsagesResult.class); - - /* - * The list of compute resource usages. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * The URI to fetch the next page of compute resource usage information. - * Call ListNext() with this to fetch the next page of compute resource - * usage information. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: The list of compute resource usages. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The list of compute resource usages. - * - * @param value the value value to set. - * @return the ListUsagesResult object itself. - */ - public ListUsagesResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URI to fetch the next page of compute resource usage information. Call ListNext() - * with this to fetch the next page of compute resource usage information. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The URI to fetch the next page of compute resource usage information. Call ListNext() - * with this to fetch the next page of compute resource usage information. - * - * @param nextLink the nextLink value to set. - * @return the ListUsagesResult object itself. - */ - public ListUsagesResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model ListUsagesResult")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/LogAnalyticsInputBase.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/LogAnalyticsInputBase.java deleted file mode 100644 index 91ab56c3c5a2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/LogAnalyticsInputBase.java +++ /dev/null @@ -1,252 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** Api input base class for LogAnalytics Api. */ -@Fluent -public class LogAnalyticsInputBase { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LogAnalyticsInputBase.class); - - /* - * SAS Uri of the logging blob container to which LogAnalytics Api writes - * output logs to. - */ - @JsonProperty(value = "blobContainerSasUri", required = true) - private String blobContainerSasUri; - - /* - * From time of the query - */ - @JsonProperty(value = "fromTime", required = true) - private OffsetDateTime fromTime; - - /* - * To time of the query - */ - @JsonProperty(value = "toTime", required = true) - private OffsetDateTime toTime; - - /* - * Group query result by Throttle Policy applied. - */ - @JsonProperty(value = "groupByThrottlePolicy") - private Boolean groupByThrottlePolicy; - - /* - * Group query result by Operation Name. - */ - @JsonProperty(value = "groupByOperationName") - private Boolean groupByOperationName; - - /* - * Group query result by Resource Name. - */ - @JsonProperty(value = "groupByResourceName") - private Boolean groupByResourceName; - - /* - * Group query result by Client Application ID. - */ - @JsonProperty(value = "groupByClientApplicationId") - private Boolean groupByClientApplicationId; - - /* - * Group query result by User Agent. - */ - @JsonProperty(value = "groupByUserAgent") - private Boolean groupByUserAgent; - - /** - * Get the blobContainerSasUri property: SAS Uri of the logging blob container to which LogAnalytics Api writes - * output logs to. - * - * @return the blobContainerSasUri value. - */ - public String blobContainerSasUri() { - return this.blobContainerSasUri; - } - - /** - * Set the blobContainerSasUri property: SAS Uri of the logging blob container to which LogAnalytics Api writes - * output logs to. - * - * @param blobContainerSasUri the blobContainerSasUri value to set. - * @return the LogAnalyticsInputBase object itself. - */ - public LogAnalyticsInputBase withBlobContainerSasUri(String blobContainerSasUri) { - this.blobContainerSasUri = blobContainerSasUri; - return this; - } - - /** - * Get the fromTime property: From time of the query. - * - * @return the fromTime value. - */ - public OffsetDateTime fromTime() { - return this.fromTime; - } - - /** - * Set the fromTime property: From time of the query. - * - * @param fromTime the fromTime value to set. - * @return the LogAnalyticsInputBase object itself. - */ - public LogAnalyticsInputBase withFromTime(OffsetDateTime fromTime) { - this.fromTime = fromTime; - return this; - } - - /** - * Get the toTime property: To time of the query. - * - * @return the toTime value. - */ - public OffsetDateTime toTime() { - return this.toTime; - } - - /** - * Set the toTime property: To time of the query. - * - * @param toTime the toTime value to set. - * @return the LogAnalyticsInputBase object itself. - */ - public LogAnalyticsInputBase withToTime(OffsetDateTime toTime) { - this.toTime = toTime; - return this; - } - - /** - * Get the groupByThrottlePolicy property: Group query result by Throttle Policy applied. - * - * @return the groupByThrottlePolicy value. - */ - public Boolean groupByThrottlePolicy() { - return this.groupByThrottlePolicy; - } - - /** - * Set the groupByThrottlePolicy property: Group query result by Throttle Policy applied. - * - * @param groupByThrottlePolicy the groupByThrottlePolicy value to set. - * @return the LogAnalyticsInputBase object itself. - */ - public LogAnalyticsInputBase withGroupByThrottlePolicy(Boolean groupByThrottlePolicy) { - this.groupByThrottlePolicy = groupByThrottlePolicy; - return this; - } - - /** - * Get the groupByOperationName property: Group query result by Operation Name. - * - * @return the groupByOperationName value. - */ - public Boolean groupByOperationName() { - return this.groupByOperationName; - } - - /** - * Set the groupByOperationName property: Group query result by Operation Name. - * - * @param groupByOperationName the groupByOperationName value to set. - * @return the LogAnalyticsInputBase object itself. - */ - public LogAnalyticsInputBase withGroupByOperationName(Boolean groupByOperationName) { - this.groupByOperationName = groupByOperationName; - return this; - } - - /** - * Get the groupByResourceName property: Group query result by Resource Name. - * - * @return the groupByResourceName value. - */ - public Boolean groupByResourceName() { - return this.groupByResourceName; - } - - /** - * Set the groupByResourceName property: Group query result by Resource Name. - * - * @param groupByResourceName the groupByResourceName value to set. - * @return the LogAnalyticsInputBase object itself. - */ - public LogAnalyticsInputBase withGroupByResourceName(Boolean groupByResourceName) { - this.groupByResourceName = groupByResourceName; - return this; - } - - /** - * Get the groupByClientApplicationId property: Group query result by Client Application ID. - * - * @return the groupByClientApplicationId value. - */ - public Boolean groupByClientApplicationId() { - return this.groupByClientApplicationId; - } - - /** - * Set the groupByClientApplicationId property: Group query result by Client Application ID. - * - * @param groupByClientApplicationId the groupByClientApplicationId value to set. - * @return the LogAnalyticsInputBase object itself. - */ - public LogAnalyticsInputBase withGroupByClientApplicationId(Boolean groupByClientApplicationId) { - this.groupByClientApplicationId = groupByClientApplicationId; - return this; - } - - /** - * Get the groupByUserAgent property: Group query result by User Agent. - * - * @return the groupByUserAgent value. - */ - public Boolean groupByUserAgent() { - return this.groupByUserAgent; - } - - /** - * Set the groupByUserAgent property: Group query result by User Agent. - * - * @param groupByUserAgent the groupByUserAgent value to set. - * @return the LogAnalyticsInputBase object itself. - */ - public LogAnalyticsInputBase withGroupByUserAgent(Boolean groupByUserAgent) { - this.groupByUserAgent = groupByUserAgent; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (blobContainerSasUri() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property blobContainerSasUri in model LogAnalyticsInputBase")); - } - if (fromTime() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property fromTime in model LogAnalyticsInputBase")); - } - if (toTime() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property toTime in model LogAnalyticsInputBase")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/LogAnalyticsOutput.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/LogAnalyticsOutput.java deleted file mode 100644 index 3ace8b3030ec..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/LogAnalyticsOutput.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** LogAnalytics output properties. */ -@Immutable -public final class LogAnalyticsOutput { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LogAnalyticsOutput.class); - - /* - * Output file Uri path to blob container. - */ - @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) - private String output; - - /** - * Get the output property: Output file Uri path to blob container. - * - * @return the output value. - */ - public String output() { - return this.output; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/MaintenanceOperationResultCodeTypes.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/MaintenanceOperationResultCodeTypes.java deleted file mode 100644 index 19166b86600c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/MaintenanceOperationResultCodeTypes.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for MaintenanceOperationResultCodeTypes. */ -public enum MaintenanceOperationResultCodeTypes { - /** Enum value None. */ - NONE("None"), - - /** Enum value RetryLater. */ - RETRY_LATER("RetryLater"), - - /** Enum value MaintenanceAborted. */ - MAINTENANCE_ABORTED("MaintenanceAborted"), - - /** Enum value MaintenanceCompleted. */ - MAINTENANCE_COMPLETED("MaintenanceCompleted"); - - /** The actual serialized value for a MaintenanceOperationResultCodeTypes instance. */ - private final String value; - - MaintenanceOperationResultCodeTypes(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a MaintenanceOperationResultCodeTypes instance. - * - * @param value the serialized value to parse. - * @return the parsed MaintenanceOperationResultCodeTypes object, or null if unable to parse. - */ - @JsonCreator - public static MaintenanceOperationResultCodeTypes fromString(String value) { - MaintenanceOperationResultCodeTypes[] items = MaintenanceOperationResultCodeTypes.values(); - for (MaintenanceOperationResultCodeTypes item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/MaintenanceRedeployStatus.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/MaintenanceRedeployStatus.java deleted file mode 100644 index 27197010600c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/MaintenanceRedeployStatus.java +++ /dev/null @@ -1,209 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** Maintenance Operation Status. */ -@Fluent -public final class MaintenanceRedeployStatus { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MaintenanceRedeployStatus.class); - - /* - * True, if customer is allowed to perform Maintenance. - */ - @JsonProperty(value = "isCustomerInitiatedMaintenanceAllowed") - private Boolean isCustomerInitiatedMaintenanceAllowed; - - /* - * Start Time for the Pre Maintenance Window. - */ - @JsonProperty(value = "preMaintenanceWindowStartTime") - private OffsetDateTime preMaintenanceWindowStartTime; - - /* - * End Time for the Pre Maintenance Window. - */ - @JsonProperty(value = "preMaintenanceWindowEndTime") - private OffsetDateTime preMaintenanceWindowEndTime; - - /* - * Start Time for the Maintenance Window. - */ - @JsonProperty(value = "maintenanceWindowStartTime") - private OffsetDateTime maintenanceWindowStartTime; - - /* - * End Time for the Maintenance Window. - */ - @JsonProperty(value = "maintenanceWindowEndTime") - private OffsetDateTime maintenanceWindowEndTime; - - /* - * The Last Maintenance Operation Result Code. - */ - @JsonProperty(value = "lastOperationResultCode") - private MaintenanceOperationResultCodeTypes lastOperationResultCode; - - /* - * Message returned for the last Maintenance Operation. - */ - @JsonProperty(value = "lastOperationMessage") - private String lastOperationMessage; - - /** - * Get the isCustomerInitiatedMaintenanceAllowed property: True, if customer is allowed to perform Maintenance. - * - * @return the isCustomerInitiatedMaintenanceAllowed value. - */ - public Boolean isCustomerInitiatedMaintenanceAllowed() { - return this.isCustomerInitiatedMaintenanceAllowed; - } - - /** - * Set the isCustomerInitiatedMaintenanceAllowed property: True, if customer is allowed to perform Maintenance. - * - * @param isCustomerInitiatedMaintenanceAllowed the isCustomerInitiatedMaintenanceAllowed value to set. - * @return the MaintenanceRedeployStatus object itself. - */ - public MaintenanceRedeployStatus withIsCustomerInitiatedMaintenanceAllowed( - Boolean isCustomerInitiatedMaintenanceAllowed) { - this.isCustomerInitiatedMaintenanceAllowed = isCustomerInitiatedMaintenanceAllowed; - return this; - } - - /** - * Get the preMaintenanceWindowStartTime property: Start Time for the Pre Maintenance Window. - * - * @return the preMaintenanceWindowStartTime value. - */ - public OffsetDateTime preMaintenanceWindowStartTime() { - return this.preMaintenanceWindowStartTime; - } - - /** - * Set the preMaintenanceWindowStartTime property: Start Time for the Pre Maintenance Window. - * - * @param preMaintenanceWindowStartTime the preMaintenanceWindowStartTime value to set. - * @return the MaintenanceRedeployStatus object itself. - */ - public MaintenanceRedeployStatus withPreMaintenanceWindowStartTime(OffsetDateTime preMaintenanceWindowStartTime) { - this.preMaintenanceWindowStartTime = preMaintenanceWindowStartTime; - return this; - } - - /** - * Get the preMaintenanceWindowEndTime property: End Time for the Pre Maintenance Window. - * - * @return the preMaintenanceWindowEndTime value. - */ - public OffsetDateTime preMaintenanceWindowEndTime() { - return this.preMaintenanceWindowEndTime; - } - - /** - * Set the preMaintenanceWindowEndTime property: End Time for the Pre Maintenance Window. - * - * @param preMaintenanceWindowEndTime the preMaintenanceWindowEndTime value to set. - * @return the MaintenanceRedeployStatus object itself. - */ - public MaintenanceRedeployStatus withPreMaintenanceWindowEndTime(OffsetDateTime preMaintenanceWindowEndTime) { - this.preMaintenanceWindowEndTime = preMaintenanceWindowEndTime; - return this; - } - - /** - * Get the maintenanceWindowStartTime property: Start Time for the Maintenance Window. - * - * @return the maintenanceWindowStartTime value. - */ - public OffsetDateTime maintenanceWindowStartTime() { - return this.maintenanceWindowStartTime; - } - - /** - * Set the maintenanceWindowStartTime property: Start Time for the Maintenance Window. - * - * @param maintenanceWindowStartTime the maintenanceWindowStartTime value to set. - * @return the MaintenanceRedeployStatus object itself. - */ - public MaintenanceRedeployStatus withMaintenanceWindowStartTime(OffsetDateTime maintenanceWindowStartTime) { - this.maintenanceWindowStartTime = maintenanceWindowStartTime; - return this; - } - - /** - * Get the maintenanceWindowEndTime property: End Time for the Maintenance Window. - * - * @return the maintenanceWindowEndTime value. - */ - public OffsetDateTime maintenanceWindowEndTime() { - return this.maintenanceWindowEndTime; - } - - /** - * Set the maintenanceWindowEndTime property: End Time for the Maintenance Window. - * - * @param maintenanceWindowEndTime the maintenanceWindowEndTime value to set. - * @return the MaintenanceRedeployStatus object itself. - */ - public MaintenanceRedeployStatus withMaintenanceWindowEndTime(OffsetDateTime maintenanceWindowEndTime) { - this.maintenanceWindowEndTime = maintenanceWindowEndTime; - return this; - } - - /** - * Get the lastOperationResultCode property: The Last Maintenance Operation Result Code. - * - * @return the lastOperationResultCode value. - */ - public MaintenanceOperationResultCodeTypes lastOperationResultCode() { - return this.lastOperationResultCode; - } - - /** - * Set the lastOperationResultCode property: The Last Maintenance Operation Result Code. - * - * @param lastOperationResultCode the lastOperationResultCode value to set. - * @return the MaintenanceRedeployStatus object itself. - */ - public MaintenanceRedeployStatus withLastOperationResultCode( - MaintenanceOperationResultCodeTypes lastOperationResultCode) { - this.lastOperationResultCode = lastOperationResultCode; - return this; - } - - /** - * Get the lastOperationMessage property: Message returned for the last Maintenance Operation. - * - * @return the lastOperationMessage value. - */ - public String lastOperationMessage() { - return this.lastOperationMessage; - } - - /** - * Set the lastOperationMessage property: Message returned for the last Maintenance Operation. - * - * @param lastOperationMessage the lastOperationMessage value to set. - * @return the MaintenanceRedeployStatus object itself. - */ - public MaintenanceRedeployStatus withLastOperationMessage(String lastOperationMessage) { - this.lastOperationMessage = lastOperationMessage; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ManagedDiskParameters.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ManagedDiskParameters.java deleted file mode 100644 index 9da1545f4900..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ManagedDiskParameters.java +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The parameters of a managed disk. */ -@Fluent -public final class ManagedDiskParameters extends SubResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedDiskParameters.class); - - /* - * Specifies the storage account type for the managed disk. Managed OS disk - * storage account type can only be set when you create the scale set. - * NOTE: UltraSSD_LRS can only be used with data disks, it cannot be used - * with OS Disk. - */ - @JsonProperty(value = "storageAccountType") - private StorageAccountTypes storageAccountType; - - /* - * Specifies the customer managed disk encryption set resource id for the - * managed disk. - */ - @JsonProperty(value = "diskEncryptionSet") - private DiskEncryptionSetParameters diskEncryptionSet; - - /** - * Get the storageAccountType property: Specifies the storage account type for the managed disk. Managed OS disk - * storage account type can only be set when you create the scale set. NOTE: UltraSSD_LRS can only be used with data - * disks, it cannot be used with OS Disk. - * - * @return the storageAccountType value. - */ - public StorageAccountTypes storageAccountType() { - return this.storageAccountType; - } - - /** - * Set the storageAccountType property: Specifies the storage account type for the managed disk. Managed OS disk - * storage account type can only be set when you create the scale set. NOTE: UltraSSD_LRS can only be used with data - * disks, it cannot be used with OS Disk. - * - * @param storageAccountType the storageAccountType value to set. - * @return the ManagedDiskParameters object itself. - */ - public ManagedDiskParameters withStorageAccountType(StorageAccountTypes storageAccountType) { - this.storageAccountType = storageAccountType; - return this; - } - - /** - * Get the diskEncryptionSet property: Specifies the customer managed disk encryption set resource id for the - * managed disk. - * - * @return the diskEncryptionSet value. - */ - public DiskEncryptionSetParameters diskEncryptionSet() { - return this.diskEncryptionSet; - } - - /** - * Set the diskEncryptionSet property: Specifies the customer managed disk encryption set resource id for the - * managed disk. - * - * @param diskEncryptionSet the diskEncryptionSet value to set. - * @return the ManagedDiskParameters object itself. - */ - public ManagedDiskParameters withDiskEncryptionSet(DiskEncryptionSetParameters diskEncryptionSet) { - this.diskEncryptionSet = diskEncryptionSet; - return this; - } - - /** {@inheritDoc} */ - @Override - public ManagedDiskParameters withId(String id) { - super.withId(id); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (diskEncryptionSet() != null) { - diskEncryptionSet().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/NetworkInterfaceReference.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/NetworkInterfaceReference.java deleted file mode 100644 index 89fac81aa0ed..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/NetworkInterfaceReference.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.fluent.models.NetworkInterfaceReferenceProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describes a network interface reference. */ -@Fluent -public final class NetworkInterfaceReference extends SubResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkInterfaceReference.class); - - /* - * Describes a network interface reference properties. - */ - @JsonProperty(value = "properties") - private NetworkInterfaceReferenceProperties innerProperties; - - /** - * Get the innerProperties property: Describes a network interface reference properties. - * - * @return the innerProperties value. - */ - private NetworkInterfaceReferenceProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public NetworkInterfaceReference withId(String id) { - super.withId(id); - return this; - } - - /** - * Get the primary property: Specifies the primary network interface in case the virtual machine has more than 1 - * network interface. - * - * @return the primary value. - */ - public Boolean primary() { - return this.innerProperties() == null ? null : this.innerProperties().primary(); - } - - /** - * Set the primary property: Specifies the primary network interface in case the virtual machine has more than 1 - * network interface. - * - * @param primary the primary value to set. - * @return the NetworkInterfaceReference object itself. - */ - public NetworkInterfaceReference withPrimary(Boolean primary) { - if (this.innerProperties() == null) { - this.innerProperties = new NetworkInterfaceReferenceProperties(); - } - this.innerProperties().withPrimary(primary); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/NetworkProfile.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/NetworkProfile.java deleted file mode 100644 index 88dd03450187..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/NetworkProfile.java +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Specifies the network interfaces of the virtual machine. */ -@Fluent -public final class NetworkProfile { - @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkProfile.class); - - /* - * Specifies the list of resource Ids for the network interfaces associated - * with the virtual machine. - */ - @JsonProperty(value = "networkInterfaces") - private List networkInterfaces; - - /** - * Get the networkInterfaces property: Specifies the list of resource Ids for the network interfaces associated with - * the virtual machine. - * - * @return the networkInterfaces value. - */ - public List networkInterfaces() { - return this.networkInterfaces; - } - - /** - * Set the networkInterfaces property: Specifies the list of resource Ids for the network interfaces associated with - * the virtual machine. - * - * @param networkInterfaces the networkInterfaces value to set. - * @return the NetworkProfile object itself. - */ - public NetworkProfile withNetworkInterfaces(List networkInterfaces) { - this.networkInterfaces = networkInterfaces; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (networkInterfaces() != null) { - networkInterfaces().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/OSDisk.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/OSDisk.java deleted file mode 100644 index 306d7821ea27..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/OSDisk.java +++ /dev/null @@ -1,382 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Specifies information about the operating system disk used by the virtual machine. <br><br> For more - * information about disks, see [About disks and VHDs for Azure virtual - * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). - */ -@Fluent -public final class OSDisk { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OSDisk.class); - - /* - * This property allows you to specify the type of the OS that is included - * in the disk if creating a VM from user-image or a specialized VHD. - *

Possible values are:

**Windows**

**Linux** - */ - @JsonProperty(value = "osType") - private OperatingSystemTypes osType; - - /* - * Specifies the encryption settings for the OS Disk.

Minimum - * api-version: 2015-06-15 - */ - @JsonProperty(value = "encryptionSettings") - private DiskEncryptionSettings encryptionSettings; - - /* - * The disk name. - */ - @JsonProperty(value = "name") - private String name; - - /* - * The virtual hard disk. - */ - @JsonProperty(value = "vhd") - private VirtualHardDisk vhd; - - /* - * The source user image virtual hard disk. The virtual hard disk will be - * copied before being attached to the virtual machine. If SourceImage is - * provided, the destination virtual hard drive must not exist. - */ - @JsonProperty(value = "image") - private VirtualHardDisk image; - - /* - * Specifies the caching requirements.

Possible values are: - *

**None**

**ReadOnly**

**ReadWrite**

- * Default: **None** for Standard storage. **ReadOnly** for Premium - * storage. - */ - @JsonProperty(value = "caching") - private CachingTypes caching; - - /* - * Specifies whether writeAccelerator should be enabled or disabled on the - * disk. - */ - @JsonProperty(value = "writeAcceleratorEnabled") - private Boolean writeAcceleratorEnabled; - - /* - * Specifies the ephemeral Disk Settings for the operating system disk used - * by the virtual machine. - */ - @JsonProperty(value = "diffDiskSettings") - private DiffDiskSettings diffDiskSettings; - - /* - * Specifies how the virtual machine should be created.

Possible - * values are:

**Attach** \u2013 This value is used when you are - * using a specialized disk to create the virtual machine.

- * **FromImage** \u2013 This value is used when you are using an image to - * create the virtual machine. If you are using a platform image, you also - * use the imageReference element described above. If you are using a - * marketplace image, you also use the plan element previously described. - */ - @JsonProperty(value = "createOption", required = true) - private DiskCreateOptionTypes createOption; - - /* - * Specifies the size of an empty data disk in gigabytes. This element can - * be used to overwrite the size of the disk in a virtual machine image. - *

This value cannot be larger than 1023 GB - */ - @JsonProperty(value = "diskSizeGB") - private Integer diskSizeGB; - - /* - * The managed disk parameters. - */ - @JsonProperty(value = "managedDisk") - private ManagedDiskParameters managedDisk; - - /** - * Get the osType property: This property allows you to specify the type of the OS that is included in the disk if - * creating a VM from user-image or a specialized VHD. <br><br> Possible values are: - * <br><br> **Windows** <br><br> **Linux**. - * - * @return the osType value. - */ - public OperatingSystemTypes osType() { - return this.osType; - } - - /** - * Set the osType property: This property allows you to specify the type of the OS that is included in the disk if - * creating a VM from user-image or a specialized VHD. <br><br> Possible values are: - * <br><br> **Windows** <br><br> **Linux**. - * - * @param osType the osType value to set. - * @return the OSDisk object itself. - */ - public OSDisk withOsType(OperatingSystemTypes osType) { - this.osType = osType; - return this; - } - - /** - * Get the encryptionSettings property: Specifies the encryption settings for the OS Disk. <br><br> - * Minimum api-version: 2015-06-15. - * - * @return the encryptionSettings value. - */ - public DiskEncryptionSettings encryptionSettings() { - return this.encryptionSettings; - } - - /** - * Set the encryptionSettings property: Specifies the encryption settings for the OS Disk. <br><br> - * Minimum api-version: 2015-06-15. - * - * @param encryptionSettings the encryptionSettings value to set. - * @return the OSDisk object itself. - */ - public OSDisk withEncryptionSettings(DiskEncryptionSettings encryptionSettings) { - this.encryptionSettings = encryptionSettings; - return this; - } - - /** - * Get the name property: The disk name. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The disk name. - * - * @param name the name value to set. - * @return the OSDisk object itself. - */ - public OSDisk withName(String name) { - this.name = name; - return this; - } - - /** - * Get the vhd property: The virtual hard disk. - * - * @return the vhd value. - */ - public VirtualHardDisk vhd() { - return this.vhd; - } - - /** - * Set the vhd property: The virtual hard disk. - * - * @param vhd the vhd value to set. - * @return the OSDisk object itself. - */ - public OSDisk withVhd(VirtualHardDisk vhd) { - this.vhd = vhd; - return this; - } - - /** - * Get the image property: The source user image virtual hard disk. The virtual hard disk will be copied before - * being attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not - * exist. - * - * @return the image value. - */ - public VirtualHardDisk image() { - return this.image; - } - - /** - * Set the image property: The source user image virtual hard disk. The virtual hard disk will be copied before - * being attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not - * exist. - * - * @param image the image value to set. - * @return the OSDisk object itself. - */ - public OSDisk withImage(VirtualHardDisk image) { - this.image = image; - return this; - } - - /** - * Get the caching property: Specifies the caching requirements. <br><br> Possible values are: - * <br><br> **None** <br><br> **ReadOnly** <br><br> **ReadWrite** - * <br><br> Default: **None** for Standard storage. **ReadOnly** for Premium storage. - * - * @return the caching value. - */ - public CachingTypes caching() { - return this.caching; - } - - /** - * Set the caching property: Specifies the caching requirements. <br><br> Possible values are: - * <br><br> **None** <br><br> **ReadOnly** <br><br> **ReadWrite** - * <br><br> Default: **None** for Standard storage. **ReadOnly** for Premium storage. - * - * @param caching the caching value to set. - * @return the OSDisk object itself. - */ - public OSDisk withCaching(CachingTypes caching) { - this.caching = caching; - return this; - } - - /** - * Get the writeAcceleratorEnabled property: Specifies whether writeAccelerator should be enabled or disabled on the - * disk. - * - * @return the writeAcceleratorEnabled value. - */ - public Boolean writeAcceleratorEnabled() { - return this.writeAcceleratorEnabled; - } - - /** - * Set the writeAcceleratorEnabled property: Specifies whether writeAccelerator should be enabled or disabled on the - * disk. - * - * @param writeAcceleratorEnabled the writeAcceleratorEnabled value to set. - * @return the OSDisk object itself. - */ - public OSDisk withWriteAcceleratorEnabled(Boolean writeAcceleratorEnabled) { - this.writeAcceleratorEnabled = writeAcceleratorEnabled; - return this; - } - - /** - * Get the diffDiskSettings property: Specifies the ephemeral Disk Settings for the operating system disk used by - * the virtual machine. - * - * @return the diffDiskSettings value. - */ - public DiffDiskSettings diffDiskSettings() { - return this.diffDiskSettings; - } - - /** - * Set the diffDiskSettings property: Specifies the ephemeral Disk Settings for the operating system disk used by - * the virtual machine. - * - * @param diffDiskSettings the diffDiskSettings value to set. - * @return the OSDisk object itself. - */ - public OSDisk withDiffDiskSettings(DiffDiskSettings diffDiskSettings) { - this.diffDiskSettings = diffDiskSettings; - return this; - } - - /** - * Get the createOption property: Specifies how the virtual machine should be created.<br><br> Possible - * values are:<br><br> **Attach** \u2013 This value is used when you are using a specialized disk to - * create the virtual machine.<br><br> **FromImage** \u2013 This value is used when you are using an - * image to create the virtual machine. If you are using a platform image, you also use the imageReference element - * described above. If you are using a marketplace image, you also use the plan element previously described. - * - * @return the createOption value. - */ - public DiskCreateOptionTypes createOption() { - return this.createOption; - } - - /** - * Set the createOption property: Specifies how the virtual machine should be created.<br><br> Possible - * values are:<br><br> **Attach** \u2013 This value is used when you are using a specialized disk to - * create the virtual machine.<br><br> **FromImage** \u2013 This value is used when you are using an - * image to create the virtual machine. If you are using a platform image, you also use the imageReference element - * described above. If you are using a marketplace image, you also use the plan element previously described. - * - * @param createOption the createOption value to set. - * @return the OSDisk object itself. - */ - public OSDisk withCreateOption(DiskCreateOptionTypes createOption) { - this.createOption = createOption; - return this; - } - - /** - * Get the diskSizeGB property: Specifies the size of an empty data disk in gigabytes. This element can be used to - * overwrite the size of the disk in a virtual machine image. <br><br> This value cannot be larger than - * 1023 GB. - * - * @return the diskSizeGB value. - */ - public Integer diskSizeGB() { - return this.diskSizeGB; - } - - /** - * Set the diskSizeGB property: Specifies the size of an empty data disk in gigabytes. This element can be used to - * overwrite the size of the disk in a virtual machine image. <br><br> This value cannot be larger than - * 1023 GB. - * - * @param diskSizeGB the diskSizeGB value to set. - * @return the OSDisk object itself. - */ - public OSDisk withDiskSizeGB(Integer diskSizeGB) { - this.diskSizeGB = diskSizeGB; - return this; - } - - /** - * Get the managedDisk property: The managed disk parameters. - * - * @return the managedDisk value. - */ - public ManagedDiskParameters managedDisk() { - return this.managedDisk; - } - - /** - * Set the managedDisk property: The managed disk parameters. - * - * @param managedDisk the managedDisk value to set. - * @return the OSDisk object itself. - */ - public OSDisk withManagedDisk(ManagedDiskParameters managedDisk) { - this.managedDisk = managedDisk; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (encryptionSettings() != null) { - encryptionSettings().validate(); - } - if (vhd() != null) { - vhd().validate(); - } - if (image() != null) { - image().validate(); - } - if (diffDiskSettings() != null) { - diffDiskSettings().validate(); - } - if (createOption() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property createOption in model OSDisk")); - } - if (managedDisk() != null) { - managedDisk().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/OSDiskImage.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/OSDiskImage.java deleted file mode 100644 index 72088e80b65f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/OSDiskImage.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Contains the os disk image information. */ -@Fluent -public final class OSDiskImage { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OSDiskImage.class); - - /* - * The operating system of the osDiskImage. - */ - @JsonProperty(value = "operatingSystem", required = true) - private OperatingSystemTypes operatingSystem; - - /** - * Get the operatingSystem property: The operating system of the osDiskImage. - * - * @return the operatingSystem value. - */ - public OperatingSystemTypes operatingSystem() { - return this.operatingSystem; - } - - /** - * Set the operatingSystem property: The operating system of the osDiskImage. - * - * @param operatingSystem the operatingSystem value to set. - * @return the OSDiskImage object itself. - */ - public OSDiskImage withOperatingSystem(OperatingSystemTypes operatingSystem) { - this.operatingSystem = operatingSystem; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (operatingSystem() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property operatingSystem in model OSDiskImage")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/OSDiskImageEncryption.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/OSDiskImageEncryption.java deleted file mode 100644 index 0ec74c1dfe45..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/OSDiskImageEncryption.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; - -/** Contains encryption settings for an OS disk image. */ -@Fluent -public final class OSDiskImageEncryption extends DiskImageEncryption { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OSDiskImageEncryption.class); - - /** {@inheritDoc} */ - @Override - public OSDiskImageEncryption withDiskEncryptionSetId(String diskEncryptionSetId) { - super.withDiskEncryptionSetId(diskEncryptionSetId); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/OSProfile.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/OSProfile.java deleted file mode 100644 index 8bbac807e484..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/OSProfile.java +++ /dev/null @@ -1,410 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** - * Specifies the operating system settings for the virtual machine. Some of the settings cannot be changed once VM is - * provisioned. - */ -@Fluent -public final class OSProfile { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OSProfile.class); - - /* - * Specifies the host OS name of the virtual machine.

This name - * cannot be updated after the VM is created.

**Max-length - * (Windows):** 15 characters

**Max-length (Linux):** 64 - * characters.

For naming conventions and restrictions see [Azure - * infrastructure services implementation - * guidelines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions). - */ - @JsonProperty(value = "computerName") - private String computerName; - - /* - * Specifies the name of the administrator account.

This property - * cannot be updated after the VM is created.

**Windows-only - * restriction:** Cannot end in "."

**Disallowed values:** - * "administrator", "admin", "user", "user1", "test", "user2", "test1", - * "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", - * "aspnet", "backup", "console", "david", "guest", "john", "owner", - * "root", "server", "sql", "support", "support_388945a0", "sys", "test2", - * "test3", "user4", "user5".

**Minimum-length (Linux):** 1 - * character

**Max-length (Linux):** 64 characters

- * **Max-length (Windows):** 20 characters

  • For root access to - * the Linux VM, see [Using root privileges on Linux virtual machines in - * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • - * For a list of built-in system users on Linux that should not be used in - * this field, see [Selecting User Names for Linux on - * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) - */ - @JsonProperty(value = "adminUsername") - private String adminUsername; - - /* - * Specifies the password of the administrator account.

    - * **Minimum-length (Windows):** 8 characters

    **Minimum-length - * (Linux):** 6 characters

    **Max-length (Windows):** 123 - * characters

    **Max-length (Linux):** 72 characters

    - * **Complexity requirements:** 3 out of 4 conditions below need to be - * fulfilled
    Has lower characters
    Has upper characters
    Has a - * digit
    Has a special character (Regex match [\W_])

    - * **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", - * "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", - * "iloveyou!"

    For resetting the password, see [How to reset the - * Remote Desktop service or its login password in a Windows - * VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) - *

    For resetting root password, see [Manage users, SSH, and check - * or repair disks on Azure Linux VMs using the VMAccess - * Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) - */ - @JsonProperty(value = "adminPassword") - private String adminPassword; - - /* - * Specifies a base-64 encoded string of custom data. The base-64 encoded - * string is decoded to a binary array that is saved as a file on the - * Virtual Machine. The maximum length of the binary array is 65535 bytes. - *

    **Note: Do not pass any secrets or passwords in customData - * property**

    This property cannot be updated after the VM is - * created.

    customData is passed to the VM to be saved as a file, - * for more information see [Custom Data on Azure - * VMs](https://azure.microsoft.com/en-us/blog/custom-data-and-cloud-init-on-windows-azure/) - *

    For using cloud-init for your Linux VM, see [Using cloud-init - * to customize a Linux VM during - * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) - */ - @JsonProperty(value = "customData") - private String customData; - - /* - * Specifies Windows operating system settings on the virtual machine. - */ - @JsonProperty(value = "windowsConfiguration") - private WindowsConfiguration windowsConfiguration; - - /* - * Specifies the Linux operating system settings on the virtual machine. - *

    For a list of supported Linux distributions, see [Linux on - * Azure-Endorsed - * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) - *

    For running non-endorsed distributions, see [Information for - * Non-Endorsed - * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). - */ - @JsonProperty(value = "linuxConfiguration") - private LinuxConfiguration linuxConfiguration; - - /* - * Specifies set of certificates that should be installed onto the virtual - * machine. - */ - @JsonProperty(value = "secrets") - private List secrets; - - /* - * Specifies whether extension operations should be allowed on the virtual - * machine.

    This may only be set to False when no extensions are - * present on the virtual machine. - */ - @JsonProperty(value = "allowExtensionOperations") - private Boolean allowExtensionOperations; - - /* - * Specifies whether the guest provision signal is required to infer - * provision success of the virtual machine. **Note: This property is for - * private testing only, and all customers must not set the property to - * false.** - */ - @JsonProperty(value = "requireGuestProvisionSignal") - private Boolean requireGuestProvisionSignal; - - /** - * Get the computerName property: Specifies the host OS name of the virtual machine. <br><br> This name - * cannot be updated after the VM is created. <br><br> **Max-length (Windows):** 15 characters - * <br><br> **Max-length (Linux):** 64 characters. <br><br> For naming conventions and - * restrictions see [Azure infrastructure services implementation - * guidelines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions). - * - * @return the computerName value. - */ - public String computerName() { - return this.computerName; - } - - /** - * Set the computerName property: Specifies the host OS name of the virtual machine. <br><br> This name - * cannot be updated after the VM is created. <br><br> **Max-length (Windows):** 15 characters - * <br><br> **Max-length (Linux):** 64 characters. <br><br> For naming conventions and - * restrictions see [Azure infrastructure services implementation - * guidelines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions). - * - * @param computerName the computerName value to set. - * @return the OSProfile object itself. - */ - public OSProfile withComputerName(String computerName) { - this.computerName = computerName; - return this; - } - - /** - * Get the adminUsername property: Specifies the name of the administrator account. <br><br> This - * property cannot be updated after the VM is created. <br><br> **Windows-only restriction:** Cannot end - * in "." <br><br> **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", - * "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", - * "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", - * "user4", "user5". <br><br> **Minimum-length (Linux):** 1 character <br><br> **Max-length - * (Linux):** 64 characters <br><br> **Max-length (Windows):** 20 characters - * <br><br><li> For root access to the Linux VM, see [Using root privileges on Linux virtual - * machines in - * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)<br><li> - * For a list of built-in system users on Linux that should not be used in this field, see [Selecting User Names for - * Linux on - * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). - * - * @return the adminUsername value. - */ - public String adminUsername() { - return this.adminUsername; - } - - /** - * Set the adminUsername property: Specifies the name of the administrator account. <br><br> This - * property cannot be updated after the VM is created. <br><br> **Windows-only restriction:** Cannot end - * in "." <br><br> **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", - * "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", - * "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", - * "user4", "user5". <br><br> **Minimum-length (Linux):** 1 character <br><br> **Max-length - * (Linux):** 64 characters <br><br> **Max-length (Windows):** 20 characters - * <br><br><li> For root access to the Linux VM, see [Using root privileges on Linux virtual - * machines in - * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)<br><li> - * For a list of built-in system users on Linux that should not be used in this field, see [Selecting User Names for - * Linux on - * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). - * - * @param adminUsername the adminUsername value to set. - * @return the OSProfile object itself. - */ - public OSProfile withAdminUsername(String adminUsername) { - this.adminUsername = adminUsername; - return this; - } - - /** - * Get the adminPassword property: Specifies the password of the administrator account. <br><br> - * **Minimum-length (Windows):** 8 characters <br><br> **Minimum-length (Linux):** 6 characters - * <br><br> **Max-length (Windows):** 123 characters <br><br> **Max-length (Linux):** 72 - * characters <br><br> **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled - * <br> Has lower characters <br>Has upper characters <br> Has a digit <br> Has a special - * character (Regex match [\W_]) <br><br> **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", - * "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!" <br><br> - * For resetting the password, see [How to reset the Remote Desktop service or its login password in a Windows - * VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) - * <br><br> For resetting root password, see [Manage users, SSH, and check or repair disks on Azure - * Linux VMs using the VMAccess - * Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password). - * - * @return the adminPassword value. - */ - public String adminPassword() { - return this.adminPassword; - } - - /** - * Set the adminPassword property: Specifies the password of the administrator account. <br><br> - * **Minimum-length (Windows):** 8 characters <br><br> **Minimum-length (Linux):** 6 characters - * <br><br> **Max-length (Windows):** 123 characters <br><br> **Max-length (Linux):** 72 - * characters <br><br> **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled - * <br> Has lower characters <br>Has upper characters <br> Has a digit <br> Has a special - * character (Regex match [\W_]) <br><br> **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", - * "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!" <br><br> - * For resetting the password, see [How to reset the Remote Desktop service or its login password in a Windows - * VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) - * <br><br> For resetting root password, see [Manage users, SSH, and check or repair disks on Azure - * Linux VMs using the VMAccess - * Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password). - * - * @param adminPassword the adminPassword value to set. - * @return the OSProfile object itself. - */ - public OSProfile withAdminPassword(String adminPassword) { - this.adminPassword = adminPassword; - return this; - } - - /** - * Get the customData property: Specifies a base-64 encoded string of custom data. The base-64 encoded string is - * decoded to a binary array that is saved as a file on the Virtual Machine. The maximum length of the binary array - * is 65535 bytes. <br><br> **Note: Do not pass any secrets or passwords in customData property** - * <br><br> This property cannot be updated after the VM is created. <br><br> customData is - * passed to the VM to be saved as a file, for more information see [Custom Data on Azure - * VMs](https://azure.microsoft.com/en-us/blog/custom-data-and-cloud-init-on-windows-azure/) <br><br> - * For using cloud-init for your Linux VM, see [Using cloud-init to customize a Linux VM during - * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). - * - * @return the customData value. - */ - public String customData() { - return this.customData; - } - - /** - * Set the customData property: Specifies a base-64 encoded string of custom data. The base-64 encoded string is - * decoded to a binary array that is saved as a file on the Virtual Machine. The maximum length of the binary array - * is 65535 bytes. <br><br> **Note: Do not pass any secrets or passwords in customData property** - * <br><br> This property cannot be updated after the VM is created. <br><br> customData is - * passed to the VM to be saved as a file, for more information see [Custom Data on Azure - * VMs](https://azure.microsoft.com/en-us/blog/custom-data-and-cloud-init-on-windows-azure/) <br><br> - * For using cloud-init for your Linux VM, see [Using cloud-init to customize a Linux VM during - * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). - * - * @param customData the customData value to set. - * @return the OSProfile object itself. - */ - public OSProfile withCustomData(String customData) { - this.customData = customData; - return this; - } - - /** - * Get the windowsConfiguration property: Specifies Windows operating system settings on the virtual machine. - * - * @return the windowsConfiguration value. - */ - public WindowsConfiguration windowsConfiguration() { - return this.windowsConfiguration; - } - - /** - * Set the windowsConfiguration property: Specifies Windows operating system settings on the virtual machine. - * - * @param windowsConfiguration the windowsConfiguration value to set. - * @return the OSProfile object itself. - */ - public OSProfile withWindowsConfiguration(WindowsConfiguration windowsConfiguration) { - this.windowsConfiguration = windowsConfiguration; - return this; - } - - /** - * Get the linuxConfiguration property: Specifies the Linux operating system settings on the virtual machine. - * <br><br>For a list of supported Linux distributions, see [Linux on Azure-Endorsed - * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) - * <br><br> For running non-endorsed distributions, see [Information for Non-Endorsed - * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). - * - * @return the linuxConfiguration value. - */ - public LinuxConfiguration linuxConfiguration() { - return this.linuxConfiguration; - } - - /** - * Set the linuxConfiguration property: Specifies the Linux operating system settings on the virtual machine. - * <br><br>For a list of supported Linux distributions, see [Linux on Azure-Endorsed - * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) - * <br><br> For running non-endorsed distributions, see [Information for Non-Endorsed - * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). - * - * @param linuxConfiguration the linuxConfiguration value to set. - * @return the OSProfile object itself. - */ - public OSProfile withLinuxConfiguration(LinuxConfiguration linuxConfiguration) { - this.linuxConfiguration = linuxConfiguration; - return this; - } - - /** - * Get the secrets property: Specifies set of certificates that should be installed onto the virtual machine. - * - * @return the secrets value. - */ - public List secrets() { - return this.secrets; - } - - /** - * Set the secrets property: Specifies set of certificates that should be installed onto the virtual machine. - * - * @param secrets the secrets value to set. - * @return the OSProfile object itself. - */ - public OSProfile withSecrets(List secrets) { - this.secrets = secrets; - return this; - } - - /** - * Get the allowExtensionOperations property: Specifies whether extension operations should be allowed on the - * virtual machine. <br><br>This may only be set to False when no extensions are present on the virtual - * machine. - * - * @return the allowExtensionOperations value. - */ - public Boolean allowExtensionOperations() { - return this.allowExtensionOperations; - } - - /** - * Set the allowExtensionOperations property: Specifies whether extension operations should be allowed on the - * virtual machine. <br><br>This may only be set to False when no extensions are present on the virtual - * machine. - * - * @param allowExtensionOperations the allowExtensionOperations value to set. - * @return the OSProfile object itself. - */ - public OSProfile withAllowExtensionOperations(Boolean allowExtensionOperations) { - this.allowExtensionOperations = allowExtensionOperations; - return this; - } - - /** - * Get the requireGuestProvisionSignal property: Specifies whether the guest provision signal is required to infer - * provision success of the virtual machine. **Note: This property is for private testing only, and all customers - * must not set the property to false.**. - * - * @return the requireGuestProvisionSignal value. - */ - public Boolean requireGuestProvisionSignal() { - return this.requireGuestProvisionSignal; - } - - /** - * Set the requireGuestProvisionSignal property: Specifies whether the guest provision signal is required to infer - * provision success of the virtual machine. **Note: This property is for private testing only, and all customers - * must not set the property to false.**. - * - * @param requireGuestProvisionSignal the requireGuestProvisionSignal value to set. - * @return the OSProfile object itself. - */ - public OSProfile withRequireGuestProvisionSignal(Boolean requireGuestProvisionSignal) { - this.requireGuestProvisionSignal = requireGuestProvisionSignal; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (windowsConfiguration() != null) { - windowsConfiguration().validate(); - } - if (linuxConfiguration() != null) { - linuxConfiguration().validate(); - } - if (secrets() != null) { - secrets().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/OperatingSystemStateTypes.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/OperatingSystemStateTypes.java deleted file mode 100644 index 51500a54d1dc..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/OperatingSystemStateTypes.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for OperatingSystemStateTypes. */ -public enum OperatingSystemStateTypes { - /** Enum value Generalized. */ - GENERALIZED("Generalized"), - - /** Enum value Specialized. */ - SPECIALIZED("Specialized"); - - /** The actual serialized value for a OperatingSystemStateTypes instance. */ - private final String value; - - OperatingSystemStateTypes(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a OperatingSystemStateTypes instance. - * - * @param value the serialized value to parse. - * @return the parsed OperatingSystemStateTypes object, or null if unable to parse. - */ - @JsonCreator - public static OperatingSystemStateTypes fromString(String value) { - OperatingSystemStateTypes[] items = OperatingSystemStateTypes.values(); - for (OperatingSystemStateTypes item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/OperatingSystemTypes.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/OperatingSystemTypes.java deleted file mode 100644 index 170ce5a06929..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/OperatingSystemTypes.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for OperatingSystemTypes. */ -public enum OperatingSystemTypes { - /** Enum value Windows. */ - WINDOWS("Windows"), - - /** Enum value Linux. */ - LINUX("Linux"); - - /** The actual serialized value for a OperatingSystemTypes instance. */ - private final String value; - - OperatingSystemTypes(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a OperatingSystemTypes instance. - * - * @param value the serialized value to parse. - * @return the parsed OperatingSystemTypes object, or null if unable to parse. - */ - @JsonCreator - public static OperatingSystemTypes fromString(String value) { - OperatingSystemTypes[] items = OperatingSystemTypes.values(); - for (OperatingSystemTypes item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/OrchestrationServiceNames.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/OrchestrationServiceNames.java deleted file mode 100644 index c73007451755..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/OrchestrationServiceNames.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for OrchestrationServiceNames. */ -public final class OrchestrationServiceNames extends ExpandableStringEnum { - /** Static value AutomaticRepairs for OrchestrationServiceNames. */ - public static final OrchestrationServiceNames AUTOMATIC_REPAIRS = fromString("AutomaticRepairs"); - - /** - * Creates or finds a OrchestrationServiceNames from its string representation. - * - * @param name a name to look for. - * @return the corresponding OrchestrationServiceNames. - */ - @JsonCreator - public static OrchestrationServiceNames fromString(String name) { - return fromString(name, OrchestrationServiceNames.class); - } - - /** @return known OrchestrationServiceNames values. */ - public static Collection values() { - return values(OrchestrationServiceNames.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/OrchestrationServiceState.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/OrchestrationServiceState.java deleted file mode 100644 index 8f7ac8dff8d5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/OrchestrationServiceState.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for OrchestrationServiceState. */ -public final class OrchestrationServiceState extends ExpandableStringEnum { - /** Static value NotRunning for OrchestrationServiceState. */ - public static final OrchestrationServiceState NOT_RUNNING = fromString("NotRunning"); - - /** Static value Running for OrchestrationServiceState. */ - public static final OrchestrationServiceState RUNNING = fromString("Running"); - - /** Static value Suspended for OrchestrationServiceState. */ - public static final OrchestrationServiceState SUSPENDED = fromString("Suspended"); - - /** - * Creates or finds a OrchestrationServiceState from its string representation. - * - * @param name a name to look for. - * @return the corresponding OrchestrationServiceState. - */ - @JsonCreator - public static OrchestrationServiceState fromString(String name) { - return fromString(name, OrchestrationServiceState.class); - } - - /** @return known OrchestrationServiceState values. */ - public static Collection values() { - return values(OrchestrationServiceState.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/OrchestrationServiceStateAction.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/OrchestrationServiceStateAction.java deleted file mode 100644 index 4569f07edb7a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/OrchestrationServiceStateAction.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for OrchestrationServiceStateAction. */ -public final class OrchestrationServiceStateAction extends ExpandableStringEnum { - /** Static value Resume for OrchestrationServiceStateAction. */ - public static final OrchestrationServiceStateAction RESUME = fromString("Resume"); - - /** Static value Suspend for OrchestrationServiceStateAction. */ - public static final OrchestrationServiceStateAction SUSPEND = fromString("Suspend"); - - /** - * Creates or finds a OrchestrationServiceStateAction from its string representation. - * - * @param name a name to look for. - * @return the corresponding OrchestrationServiceStateAction. - */ - @JsonCreator - public static OrchestrationServiceStateAction fromString(String name) { - return fromString(name, OrchestrationServiceStateAction.class); - } - - /** @return known OrchestrationServiceStateAction values. */ - public static Collection values() { - return values(OrchestrationServiceStateAction.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/OrchestrationServiceStateInput.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/OrchestrationServiceStateInput.java deleted file mode 100644 index ba4653f62baf..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/OrchestrationServiceStateInput.java +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The input for OrchestrationServiceState. */ -@Fluent -public final class OrchestrationServiceStateInput { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OrchestrationServiceStateInput.class); - - /* - * The name of the service. - */ - @JsonProperty(value = "serviceName", required = true) - private OrchestrationServiceNames serviceName; - - /* - * The action to be performed. - */ - @JsonProperty(value = "action", required = true) - private OrchestrationServiceStateAction action; - - /** - * Get the serviceName property: The name of the service. - * - * @return the serviceName value. - */ - public OrchestrationServiceNames serviceName() { - return this.serviceName; - } - - /** - * Set the serviceName property: The name of the service. - * - * @param serviceName the serviceName value to set. - * @return the OrchestrationServiceStateInput object itself. - */ - public OrchestrationServiceStateInput withServiceName(OrchestrationServiceNames serviceName) { - this.serviceName = serviceName; - return this; - } - - /** - * Get the action property: The action to be performed. - * - * @return the action value. - */ - public OrchestrationServiceStateAction action() { - return this.action; - } - - /** - * Set the action property: The action to be performed. - * - * @param action the action value to set. - * @return the OrchestrationServiceStateInput object itself. - */ - public OrchestrationServiceStateInput withAction(OrchestrationServiceStateAction action) { - this.action = action; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (serviceName() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property serviceName in model OrchestrationServiceStateInput")); - } - if (action() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property action in model OrchestrationServiceStateInput")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/OrchestrationServiceSummary.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/OrchestrationServiceSummary.java deleted file mode 100644 index c1b71bfdde21..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/OrchestrationServiceSummary.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Summary for an orchestration service of a virtual machine scale set. */ -@Immutable -public final class OrchestrationServiceSummary { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OrchestrationServiceSummary.class); - - /* - * The name of the service. - */ - @JsonProperty(value = "serviceName", access = JsonProperty.Access.WRITE_ONLY) - private OrchestrationServiceNames serviceName; - - /* - * The current state of the service. - */ - @JsonProperty(value = "serviceState", access = JsonProperty.Access.WRITE_ONLY) - private OrchestrationServiceState serviceState; - - /** - * Get the serviceName property: The name of the service. - * - * @return the serviceName value. - */ - public OrchestrationServiceNames serviceName() { - return this.serviceName; - } - - /** - * Get the serviceState property: The current state of the service. - * - * @return the serviceState value. - */ - public OrchestrationServiceState serviceState() { - return this.serviceState; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/PassNames.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/PassNames.java deleted file mode 100644 index 6d5cc6fe4cb3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/PassNames.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for PassNames. */ -public enum PassNames { - /** Enum value OobeSystem. */ - OOBE_SYSTEM("OobeSystem"); - - /** The actual serialized value for a PassNames instance. */ - private final String value; - - PassNames(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a PassNames instance. - * - * @param value the serialized value to parse. - * @return the parsed PassNames object, or null if unable to parse. - */ - @JsonCreator - public static PassNames fromString(String value) { - PassNames[] items = PassNames.values(); - for (PassNames item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/PatchAssessmentState.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/PatchAssessmentState.java deleted file mode 100644 index 8dd8e2391970..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/PatchAssessmentState.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for PatchAssessmentState. */ -public final class PatchAssessmentState extends ExpandableStringEnum { - /** Static value Installed for PatchAssessmentState. */ - public static final PatchAssessmentState INSTALLED = fromString("Installed"); - - /** Static value Failed for PatchAssessmentState. */ - public static final PatchAssessmentState FAILED = fromString("Failed"); - - /** Static value Excluded for PatchAssessmentState. */ - public static final PatchAssessmentState EXCLUDED = fromString("Excluded"); - - /** Static value NotSelected for PatchAssessmentState. */ - public static final PatchAssessmentState NOT_SELECTED = fromString("NotSelected"); - - /** Static value Pending for PatchAssessmentState. */ - public static final PatchAssessmentState PENDING = fromString("Pending"); - - /** Static value Available for PatchAssessmentState. */ - public static final PatchAssessmentState AVAILABLE = fromString("Available"); - - /** - * Creates or finds a PatchAssessmentState from its string representation. - * - * @param name a name to look for. - * @return the corresponding PatchAssessmentState. - */ - @JsonCreator - public static PatchAssessmentState fromString(String name) { - return fromString(name, PatchAssessmentState.class); - } - - /** @return known PatchAssessmentState values. */ - public static Collection values() { - return values(PatchAssessmentState.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/PatchOperationStatus.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/PatchOperationStatus.java deleted file mode 100644 index fce41b8f19df..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/PatchOperationStatus.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for PatchOperationStatus. */ -public final class PatchOperationStatus extends ExpandableStringEnum { - /** Static value InProgress for PatchOperationStatus. */ - public static final PatchOperationStatus IN_PROGRESS = fromString("InProgress"); - - /** Static value Failed for PatchOperationStatus. */ - public static final PatchOperationStatus FAILED = fromString("Failed"); - - /** Static value Succeeded for PatchOperationStatus. */ - public static final PatchOperationStatus SUCCEEDED = fromString("Succeeded"); - - /** Static value CompletedWithWarnings for PatchOperationStatus. */ - public static final PatchOperationStatus COMPLETED_WITH_WARNINGS = fromString("CompletedWithWarnings"); - - /** - * Creates or finds a PatchOperationStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding PatchOperationStatus. - */ - @JsonCreator - public static PatchOperationStatus fromString(String name) { - return fromString(name, PatchOperationStatus.class); - } - - /** @return known PatchOperationStatus values. */ - public static Collection values() { - return values(PatchOperationStatus.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/PatchSettings.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/PatchSettings.java deleted file mode 100644 index 649ef08025a1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/PatchSettings.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The PatchSettings model. */ -@Fluent -public final class PatchSettings { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PatchSettings.class); - - /* - * Specifies the mode of in-guest patching to IaaS virtual machine.

    Possible values are:

    **Manual** - You control the - * application of patches to a virtual machine. You do this by applying - * patches manually inside the VM. In this mode, automatic updates are - * disabled; the property WindowsConfiguration.enableAutomaticUpdates must - * be false

    **AutomaticByOS** - The virtual machine will - * automatically be updated by the OS. The property - * WindowsConfiguration.enableAutomaticUpdates must be true.

    - * **AutomaticByPlatform** - the virtual machine will automatically updated - * by the platform. The properties provisionVMAgent and - * WindowsConfiguration.enableAutomaticUpdates must be true - */ - @JsonProperty(value = "patchMode") - private InGuestPatchMode patchMode; - - /** - * Get the patchMode property: Specifies the mode of in-guest patching to IaaS virtual machine.<br /><br - * /> Possible values are:<br /><br /> **Manual** - You control the application of patches to a - * virtual machine. You do this by applying patches manually inside the VM. In this mode, automatic updates are - * disabled; the property WindowsConfiguration.enableAutomaticUpdates must be false<br /><br /> - * **AutomaticByOS** - The virtual machine will automatically be updated by the OS. The property - * WindowsConfiguration.enableAutomaticUpdates must be true. <br /><br /> **AutomaticByPlatform** - the - * virtual machine will automatically updated by the platform. The properties provisionVMAgent and - * WindowsConfiguration.enableAutomaticUpdates must be true. - * - * @return the patchMode value. - */ - public InGuestPatchMode patchMode() { - return this.patchMode; - } - - /** - * Set the patchMode property: Specifies the mode of in-guest patching to IaaS virtual machine.<br /><br - * /> Possible values are:<br /><br /> **Manual** - You control the application of patches to a - * virtual machine. You do this by applying patches manually inside the VM. In this mode, automatic updates are - * disabled; the property WindowsConfiguration.enableAutomaticUpdates must be false<br /><br /> - * **AutomaticByOS** - The virtual machine will automatically be updated by the OS. The property - * WindowsConfiguration.enableAutomaticUpdates must be true. <br /><br /> **AutomaticByPlatform** - the - * virtual machine will automatically updated by the platform. The properties provisionVMAgent and - * WindowsConfiguration.enableAutomaticUpdates must be true. - * - * @param patchMode the patchMode value to set. - * @return the PatchSettings object itself. - */ - public PatchSettings withPatchMode(InGuestPatchMode patchMode) { - this.patchMode = patchMode; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/Plan.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/Plan.java deleted file mode 100644 index 9d95c6d233a3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/Plan.java +++ /dev/null @@ -1,136 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Specifies information about the marketplace image used to create the virtual machine. This element is only used for - * marketplace images. Before you can use a marketplace image from an API, you must enable the image for programmatic - * use. In the Azure portal, find the marketplace image that you want to use and then click **Want to deploy - * programmatically, Get Started ->**. Enter any required information and then click **Save**. - */ -@Fluent -public final class Plan { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Plan.class); - - /* - * The plan ID. - */ - @JsonProperty(value = "name") - private String name; - - /* - * The publisher ID. - */ - @JsonProperty(value = "publisher") - private String publisher; - - /* - * Specifies the product of the image from the marketplace. This is the - * same value as Offer under the imageReference element. - */ - @JsonProperty(value = "product") - private String product; - - /* - * The promotion code. - */ - @JsonProperty(value = "promotionCode") - private String promotionCode; - - /** - * Get the name property: The plan ID. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The plan ID. - * - * @param name the name value to set. - * @return the Plan object itself. - */ - public Plan withName(String name) { - this.name = name; - return this; - } - - /** - * Get the publisher property: The publisher ID. - * - * @return the publisher value. - */ - public String publisher() { - return this.publisher; - } - - /** - * Set the publisher property: The publisher ID. - * - * @param publisher the publisher value to set. - * @return the Plan object itself. - */ - public Plan withPublisher(String publisher) { - this.publisher = publisher; - return this; - } - - /** - * Get the product property: Specifies the product of the image from the marketplace. This is the same value as - * Offer under the imageReference element. - * - * @return the product value. - */ - public String product() { - return this.product; - } - - /** - * Set the product property: Specifies the product of the image from the marketplace. This is the same value as - * Offer under the imageReference element. - * - * @param product the product value to set. - * @return the Plan object itself. - */ - public Plan withProduct(String product) { - this.product = product; - return this; - } - - /** - * Get the promotionCode property: The promotion code. - * - * @return the promotionCode value. - */ - public String promotionCode() { - return this.promotionCode; - } - - /** - * Set the promotionCode property: The promotion code. - * - * @param promotionCode the promotionCode value to set. - * @return the Plan object itself. - */ - public Plan withPromotionCode(String promotionCode) { - this.promotionCode = promotionCode; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/PowerState.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/PowerState.java deleted file mode 100644 index 8acd4222abae..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/PowerState.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.compute.models; - -import com.azure.core.util.ExpandableStringEnum; - -import java.util.Collection; -import java.util.Locale; - -/** Possible power states of a virtual machine. */ -public final class PowerState extends ExpandableStringEnum { - /** Static value PowerState/running for PowerState. */ - public static final PowerState RUNNING = fromString("PowerState/running"); - - /** Static value PowerState/deallocating for PowerState. */ - public static final PowerState DEALLOCATING = fromString("PowerState/deallocating"); - - /** Static value PowerState/deallocated for PowerState. */ - public static final PowerState DEALLOCATED = fromString("PowerState/deallocated"); - - /** Static value PowerState/starting for PowerState. */ - public static final PowerState STARTING = fromString("PowerState/starting"); - - /** Static value PowerState/stopped for PowerState. */ - public static final PowerState STOPPED = fromString("PowerState/stopped"); - - /** Static value PowerState/stopping for PowerState. */ - public static final PowerState STOPPING = fromString("PowerState/stopping"); - - /** Static value PowerState/unknown for PowerState. */ - public static final PowerState UNKNOWN = fromString("PowerState/unknown"); - - /** - * Creates an instance of PowerState from the virtual machine instance view status entry corresponding to the power - * state. - * - * @param virtualMachineInstanceView the virtual machine instance view - * @return the PowerState - */ - public static PowerState fromInstanceView(VirtualMachineInstanceView virtualMachineInstanceView) { - if (virtualMachineInstanceView != null && virtualMachineInstanceView.statuses() != null) { - for (InstanceViewStatus status : virtualMachineInstanceView.statuses()) { - if (status.code() != null && status.code().toLowerCase(Locale.ROOT).startsWith("powerstate")) { - return fromString(status.code()); - } - } - } - return null; - } - - /** @return all known power states */ - public static Collection values() { - return values(PowerState.class); - } - - /** - * Finds or creates a PowerState value. - * - * @param name the value of the power state - * @return a PowerState instance - */ - public static PowerState fromString(String name) { - return fromString(name, PowerState.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ProtocolTypes.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ProtocolTypes.java deleted file mode 100644 index 2a8644462fdc..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ProtocolTypes.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for ProtocolTypes. */ -public enum ProtocolTypes { - /** Enum value Http. */ - HTTP("Http"), - - /** Enum value Https. */ - HTTPS("Https"); - - /** The actual serialized value for a ProtocolTypes instance. */ - private final String value; - - ProtocolTypes(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a ProtocolTypes instance. - * - * @param value the serialized value to parse. - * @return the parsed ProtocolTypes object, or null if unable to parse. - */ - @JsonCreator - public static ProtocolTypes fromString(String value) { - ProtocolTypes[] items = ProtocolTypes.values(); - for (ProtocolTypes item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ProximityPlacementGroup.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ProximityPlacementGroup.java deleted file mode 100644 index 2f030184a432..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ProximityPlacementGroup.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.compute.fluent.models.ProximityPlacementGroupInner; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import java.util.List; - -/** Type representing Proximity Placement Group for an Azure compute resource. */ -@Fluent -public interface ProximityPlacementGroup extends HasInnerModel { - /** - * Get specifies the type of the proximity placement group. <br><br> Possible values are: - * <br><br> **Standard** <br><br> **Ultra**. Possible values include: 'Standard', 'Ultra'. - * - * @return the proximityPlacementGroupType value - */ - ProximityPlacementGroupType proximityPlacementGroupType(); - - /** - * Get a list of references to all virtual machines in the proximity placement group. - * - * @return the virtualMachines value - */ - List virtualMachineIds(); - - /** - * Get a list of references to all virtual machine scale sets in the proximity placement group. - * - * @return the virtualMachineScaleSets value - */ - List virtualMachineScaleSetIds(); - - /** - * Get a list of references to all availability sets in the proximity placement group. - * - * @return the availabilitySets value - */ - List availabilitySetIds(); - - /** - * Gets the location of the proximity placement group. - * - * @return the location - */ - String location(); - - /** - * Gets the name of the resource group for the proximity placement group. - * - * @return the resource group name - */ - String resourceGroupName(); - - /** - * The rsource ID of the placement group. - * - * @return the resource Id. - */ - String id(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ProximityPlacementGroupListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ProximityPlacementGroupListResult.java deleted file mode 100644 index 99d881694c05..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ProximityPlacementGroupListResult.java +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.fluent.models.ProximityPlacementGroupInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The List Proximity Placement Group operation response. */ -@Fluent -public final class ProximityPlacementGroupListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ProximityPlacementGroupListResult.class); - - /* - * The list of proximity placement groups - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * The URI to fetch the next page of proximity placement groups. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: The list of proximity placement groups. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The list of proximity placement groups. - * - * @param value the value value to set. - * @return the ProximityPlacementGroupListResult object itself. - */ - public ProximityPlacementGroupListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URI to fetch the next page of proximity placement groups. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The URI to fetch the next page of proximity placement groups. - * - * @param nextLink the nextLink value to set. - * @return the ProximityPlacementGroupListResult object itself. - */ - public ProximityPlacementGroupListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property value in model ProximityPlacementGroupListResult")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ProximityPlacementGroupType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ProximityPlacementGroupType.java deleted file mode 100644 index d22e6c876804..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ProximityPlacementGroupType.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ProximityPlacementGroupType. */ -public final class ProximityPlacementGroupType extends ExpandableStringEnum { - /** Static value Standard for ProximityPlacementGroupType. */ - public static final ProximityPlacementGroupType STANDARD = fromString("Standard"); - - /** Static value Ultra for ProximityPlacementGroupType. */ - public static final ProximityPlacementGroupType ULTRA = fromString("Ultra"); - - /** - * Creates or finds a ProximityPlacementGroupType from its string representation. - * - * @param name a name to look for. - * @return the corresponding ProximityPlacementGroupType. - */ - @JsonCreator - public static ProximityPlacementGroupType fromString(String name) { - return fromString(name, ProximityPlacementGroupType.class); - } - - /** @return known ProximityPlacementGroupType values. */ - public static Collection values() { - return values(ProximityPlacementGroupType.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ProximityPlacementGroupUpdate.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ProximityPlacementGroupUpdate.java deleted file mode 100644 index 8ef7b5dc091a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ProximityPlacementGroupUpdate.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import java.util.Map; - -/** Specifies information about the proximity placement group. */ -@Fluent -public final class ProximityPlacementGroupUpdate extends UpdateResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ProximityPlacementGroupUpdate.class); - - /** {@inheritDoc} */ - @Override - public ProximityPlacementGroupUpdate withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/PurchasePlan.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/PurchasePlan.java deleted file mode 100644 index 4c8ef4876a58..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/PurchasePlan.java +++ /dev/null @@ -1,120 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Used for establishing the purchase context of any 3rd Party artifact through MarketPlace. */ -@Fluent -public final class PurchasePlan { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PurchasePlan.class); - - /* - * The publisher ID. - */ - @JsonProperty(value = "publisher", required = true) - private String publisher; - - /* - * The plan ID. - */ - @JsonProperty(value = "name", required = true) - private String name; - - /* - * Specifies the product of the image from the marketplace. This is the - * same value as Offer under the imageReference element. - */ - @JsonProperty(value = "product", required = true) - private String product; - - /** - * Get the publisher property: The publisher ID. - * - * @return the publisher value. - */ - public String publisher() { - return this.publisher; - } - - /** - * Set the publisher property: The publisher ID. - * - * @param publisher the publisher value to set. - * @return the PurchasePlan object itself. - */ - public PurchasePlan withPublisher(String publisher) { - this.publisher = publisher; - return this; - } - - /** - * Get the name property: The plan ID. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The plan ID. - * - * @param name the name value to set. - * @return the PurchasePlan object itself. - */ - public PurchasePlan withName(String name) { - this.name = name; - return this; - } - - /** - * Get the product property: Specifies the product of the image from the marketplace. This is the same value as - * Offer under the imageReference element. - * - * @return the product value. - */ - public String product() { - return this.product; - } - - /** - * Set the product property: Specifies the product of the image from the marketplace. This is the same value as - * Offer under the imageReference element. - * - * @param product the product value to set. - * @return the PurchasePlan object itself. - */ - public PurchasePlan withProduct(String product) { - this.product = product; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (publisher() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property publisher in model PurchasePlan")); - } - if (name() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property name in model PurchasePlan")); - } - if (product() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property product in model PurchasePlan")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/RebootStatus.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/RebootStatus.java deleted file mode 100644 index f61cfd352a01..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/RebootStatus.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for RebootStatus. */ -public final class RebootStatus extends ExpandableStringEnum { - /** Static value NotNeeded for RebootStatus. */ - public static final RebootStatus NOT_NEEDED = fromString("NotNeeded"); - - /** Static value Required for RebootStatus. */ - public static final RebootStatus REQUIRED = fromString("Required"); - - /** Static value Started for RebootStatus. */ - public static final RebootStatus STARTED = fromString("Started"); - - /** Static value Failed for RebootStatus. */ - public static final RebootStatus FAILED = fromString("Failed"); - - /** Static value Completed for RebootStatus. */ - public static final RebootStatus COMPLETED = fromString("Completed"); - - /** - * Creates or finds a RebootStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding RebootStatus. - */ - @JsonCreator - public static RebootStatus fromString(String name) { - return fromString(name, RebootStatus.class); - } - - /** @return known RebootStatus values. */ - public static Collection values() { - return values(RebootStatus.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/RecommendedMachineConfiguration.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/RecommendedMachineConfiguration.java deleted file mode 100644 index 2e9909216f90..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/RecommendedMachineConfiguration.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * The properties describe the recommended machine configuration for this Image Definition. These properties are - * updatable. - */ -@Fluent -public final class RecommendedMachineConfiguration { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RecommendedMachineConfiguration.class); - - /* - * Describes the resource range. - */ - @JsonProperty(value = "vCPUs") - private ResourceRange vCPUs; - - /* - * Describes the resource range. - */ - @JsonProperty(value = "memory") - private ResourceRange memory; - - /** - * Get the vCPUs property: Describes the resource range. - * - * @return the vCPUs value. - */ - public ResourceRange vCPUs() { - return this.vCPUs; - } - - /** - * Set the vCPUs property: Describes the resource range. - * - * @param vCPUs the vCPUs value to set. - * @return the RecommendedMachineConfiguration object itself. - */ - public RecommendedMachineConfiguration withVCPUs(ResourceRange vCPUs) { - this.vCPUs = vCPUs; - return this; - } - - /** - * Get the memory property: Describes the resource range. - * - * @return the memory value. - */ - public ResourceRange memory() { - return this.memory; - } - - /** - * Set the memory property: Describes the resource range. - * - * @param memory the memory value to set. - * @return the RecommendedMachineConfiguration object itself. - */ - public RecommendedMachineConfiguration withMemory(ResourceRange memory) { - this.memory = memory; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (vCPUs() != null) { - vCPUs().validate(); - } - if (memory() != null) { - memory().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/RegionalReplicationStatus.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/RegionalReplicationStatus.java deleted file mode 100644 index e72c8dd2d2f9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/RegionalReplicationStatus.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** This is the regional replication status. */ -@Immutable -public final class RegionalReplicationStatus { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RegionalReplicationStatus.class); - - /* - * The region to which the gallery Image Version is being replicated to. - */ - @JsonProperty(value = "region", access = JsonProperty.Access.WRITE_ONLY) - private String region; - - /* - * This is the regional replication state. - */ - @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) - private ReplicationState state; - - /* - * The details of the replication status. - */ - @JsonProperty(value = "details", access = JsonProperty.Access.WRITE_ONLY) - private String details; - - /* - * It indicates progress of the replication job. - */ - @JsonProperty(value = "progress", access = JsonProperty.Access.WRITE_ONLY) - private Integer progress; - - /** - * Get the region property: The region to which the gallery Image Version is being replicated to. - * - * @return the region value. - */ - public String region() { - return this.region; - } - - /** - * Get the state property: This is the regional replication state. - * - * @return the state value. - */ - public ReplicationState state() { - return this.state; - } - - /** - * Get the details property: The details of the replication status. - * - * @return the details value. - */ - public String details() { - return this.details; - } - - /** - * Get the progress property: It indicates progress of the replication job. - * - * @return the progress value. - */ - public Integer progress() { - return this.progress; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ReplicationState.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ReplicationState.java deleted file mode 100644 index 1f5b5807afbb..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ReplicationState.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ReplicationState. */ -public final class ReplicationState extends ExpandableStringEnum { - /** Static value Unknown for ReplicationState. */ - public static final ReplicationState UNKNOWN = fromString("Unknown"); - - /** Static value Replicating for ReplicationState. */ - public static final ReplicationState REPLICATING = fromString("Replicating"); - - /** Static value Completed for ReplicationState. */ - public static final ReplicationState COMPLETED = fromString("Completed"); - - /** Static value Failed for ReplicationState. */ - public static final ReplicationState FAILED = fromString("Failed"); - - /** - * Creates or finds a ReplicationState from its string representation. - * - * @param name a name to look for. - * @return the corresponding ReplicationState. - */ - @JsonCreator - public static ReplicationState fromString(String name) { - return fromString(name, ReplicationState.class); - } - - /** @return known ReplicationState values. */ - public static Collection values() { - return values(ReplicationState.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ReplicationStatus.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ReplicationStatus.java deleted file mode 100644 index 884009a09fd1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ReplicationStatus.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** This is the replication status of the gallery Image Version. */ -@Immutable -public final class ReplicationStatus { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ReplicationStatus.class); - - /* - * This is the aggregated replication status based on all the regional - * replication status flags. - */ - @JsonProperty(value = "aggregatedState", access = JsonProperty.Access.WRITE_ONLY) - private AggregatedReplicationState aggregatedState; - - /* - * This is a summary of replication status for each region. - */ - @JsonProperty(value = "summary", access = JsonProperty.Access.WRITE_ONLY) - private List summary; - - /** - * Get the aggregatedState property: This is the aggregated replication status based on all the regional replication - * status flags. - * - * @return the aggregatedState value. - */ - public AggregatedReplicationState aggregatedState() { - return this.aggregatedState; - } - - /** - * Get the summary property: This is a summary of replication status for each region. - * - * @return the summary value. - */ - public List summary() { - return this.summary; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (summary() != null) { - summary().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ReplicationStatusTypes.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ReplicationStatusTypes.java deleted file mode 100644 index 19f17e12b6be..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ReplicationStatusTypes.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ReplicationStatusTypes. */ -public final class ReplicationStatusTypes extends ExpandableStringEnum { - /** Static value ReplicationStatus for ReplicationStatusTypes. */ - public static final ReplicationStatusTypes REPLICATION_STATUS = fromString("ReplicationStatus"); - - /** - * Creates or finds a ReplicationStatusTypes from its string representation. - * - * @param name a name to look for. - * @return the corresponding ReplicationStatusTypes. - */ - @JsonCreator - public static ReplicationStatusTypes fromString(String name) { - return fromString(name, ReplicationStatusTypes.class); - } - - /** @return known ReplicationStatusTypes values. */ - public static Collection values() { - return values(ReplicationStatusTypes.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/RequestRateByIntervalInput.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/RequestRateByIntervalInput.java deleted file mode 100644 index 37441d3c5a85..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/RequestRateByIntervalInput.java +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** Api request input for LogAnalytics getRequestRateByInterval Api. */ -@Fluent -public final class RequestRateByIntervalInput extends LogAnalyticsInputBase { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RequestRateByIntervalInput.class); - - /* - * Interval value in minutes used to create LogAnalytics call rate logs. - */ - @JsonProperty(value = "intervalLength", required = true) - private IntervalInMins intervalLength; - - /** - * Get the intervalLength property: Interval value in minutes used to create LogAnalytics call rate logs. - * - * @return the intervalLength value. - */ - public IntervalInMins intervalLength() { - return this.intervalLength; - } - - /** - * Set the intervalLength property: Interval value in minutes used to create LogAnalytics call rate logs. - * - * @param intervalLength the intervalLength value to set. - * @return the RequestRateByIntervalInput object itself. - */ - public RequestRateByIntervalInput withIntervalLength(IntervalInMins intervalLength) { - this.intervalLength = intervalLength; - return this; - } - - /** {@inheritDoc} */ - @Override - public RequestRateByIntervalInput withBlobContainerSasUri(String blobContainerSasUri) { - super.withBlobContainerSasUri(blobContainerSasUri); - return this; - } - - /** {@inheritDoc} */ - @Override - public RequestRateByIntervalInput withFromTime(OffsetDateTime fromTime) { - super.withFromTime(fromTime); - return this; - } - - /** {@inheritDoc} */ - @Override - public RequestRateByIntervalInput withToTime(OffsetDateTime toTime) { - super.withToTime(toTime); - return this; - } - - /** {@inheritDoc} */ - @Override - public RequestRateByIntervalInput withGroupByThrottlePolicy(Boolean groupByThrottlePolicy) { - super.withGroupByThrottlePolicy(groupByThrottlePolicy); - return this; - } - - /** {@inheritDoc} */ - @Override - public RequestRateByIntervalInput withGroupByOperationName(Boolean groupByOperationName) { - super.withGroupByOperationName(groupByOperationName); - return this; - } - - /** {@inheritDoc} */ - @Override - public RequestRateByIntervalInput withGroupByResourceName(Boolean groupByResourceName) { - super.withGroupByResourceName(groupByResourceName); - return this; - } - - /** {@inheritDoc} */ - @Override - public RequestRateByIntervalInput withGroupByClientApplicationId(Boolean groupByClientApplicationId) { - super.withGroupByClientApplicationId(groupByClientApplicationId); - return this; - } - - /** {@inheritDoc} */ - @Override - public RequestRateByIntervalInput withGroupByUserAgent(Boolean groupByUserAgent) { - super.withGroupByUserAgent(groupByUserAgent); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (intervalLength() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property intervalLength in model RequestRateByIntervalInput")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ResourceIdentityType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ResourceIdentityType.java deleted file mode 100644 index 64f6d9c8e7e5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ResourceIdentityType.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for ResourceIdentityType. */ -public enum ResourceIdentityType { - /** Enum value SystemAssigned. */ - SYSTEM_ASSIGNED("SystemAssigned"), - - /** Enum value UserAssigned. */ - USER_ASSIGNED("UserAssigned"), - - /** Enum value SystemAssigned, UserAssigned. */ - SYSTEM_ASSIGNED_USER_ASSIGNED("SystemAssigned, UserAssigned"), - - /** Enum value None. */ - NONE("None"); - - /** The actual serialized value for a ResourceIdentityType instance. */ - private final String value; - - ResourceIdentityType(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a ResourceIdentityType instance. - * - * @param value the serialized value to parse. - * @return the parsed ResourceIdentityType object, or null if unable to parse. - */ - @JsonCreator - public static ResourceIdentityType fromString(String value) { - ResourceIdentityType[] items = ResourceIdentityType.values(); - for (ResourceIdentityType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ResourceRange.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ResourceRange.java deleted file mode 100644 index f7d4e6282a0a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ResourceRange.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describes the resource range. */ -@Fluent -public final class ResourceRange { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceRange.class); - - /* - * The minimum number of the resource. - */ - @JsonProperty(value = "min") - private Integer min; - - /* - * The maximum number of the resource. - */ - @JsonProperty(value = "max") - private Integer max; - - /** - * Get the min property: The minimum number of the resource. - * - * @return the min value. - */ - public Integer min() { - return this.min; - } - - /** - * Set the min property: The minimum number of the resource. - * - * @param min the min value to set. - * @return the ResourceRange object itself. - */ - public ResourceRange withMin(Integer min) { - this.min = min; - return this; - } - - /** - * Get the max property: The maximum number of the resource. - * - * @return the max value. - */ - public Integer max() { - return this.max; - } - - /** - * Set the max property: The maximum number of the resource. - * - * @param max the max value to set. - * @return the ResourceRange object itself. - */ - public ResourceRange withMax(Integer max) { - this.max = max; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ResourceSkuCapabilities.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ResourceSkuCapabilities.java deleted file mode 100644 index 0086e70b8d07..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ResourceSkuCapabilities.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describes The SKU capabilities object. */ -@Immutable -public final class ResourceSkuCapabilities { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceSkuCapabilities.class); - - /* - * An invariant to describe the feature. - */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) - private String name; - - /* - * An invariant if the feature is measured by quantity. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private String value; - - /** - * Get the name property: An invariant to describe the feature. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the value property: An invariant if the feature is measured by quantity. - * - * @return the value value. - */ - public String value() { - return this.value; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ResourceSkuCapacity.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ResourceSkuCapacity.java deleted file mode 100644 index d3b347cc0a52..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ResourceSkuCapacity.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describes scaling information of a SKU. */ -@Immutable -public final class ResourceSkuCapacity { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceSkuCapacity.class); - - /* - * The minimum capacity. - */ - @JsonProperty(value = "minimum", access = JsonProperty.Access.WRITE_ONLY) - private Long minimum; - - /* - * The maximum capacity that can be set. - */ - @JsonProperty(value = "maximum", access = JsonProperty.Access.WRITE_ONLY) - private Long maximum; - - /* - * The default capacity. - */ - @JsonProperty(value = "default", access = JsonProperty.Access.WRITE_ONLY) - private Long defaultProperty; - - /* - * The scale type applicable to the sku. - */ - @JsonProperty(value = "scaleType", access = JsonProperty.Access.WRITE_ONLY) - private ResourceSkuCapacityScaleType scaleType; - - /** - * Get the minimum property: The minimum capacity. - * - * @return the minimum value. - */ - public Long minimum() { - return this.minimum; - } - - /** - * Get the maximum property: The maximum capacity that can be set. - * - * @return the maximum value. - */ - public Long maximum() { - return this.maximum; - } - - /** - * Get the defaultProperty property: The default capacity. - * - * @return the defaultProperty value. - */ - public Long defaultProperty() { - return this.defaultProperty; - } - - /** - * Get the scaleType property: The scale type applicable to the sku. - * - * @return the scaleType value. - */ - public ResourceSkuCapacityScaleType scaleType() { - return this.scaleType; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ResourceSkuCapacityScaleType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ResourceSkuCapacityScaleType.java deleted file mode 100644 index b0a3491580e2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ResourceSkuCapacityScaleType.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for ResourceSkuCapacityScaleType. */ -public enum ResourceSkuCapacityScaleType { - /** Enum value Automatic. */ - AUTOMATIC("Automatic"), - - /** Enum value Manual. */ - MANUAL("Manual"), - - /** Enum value None. */ - NONE("None"); - - /** The actual serialized value for a ResourceSkuCapacityScaleType instance. */ - private final String value; - - ResourceSkuCapacityScaleType(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a ResourceSkuCapacityScaleType instance. - * - * @param value the serialized value to parse. - * @return the parsed ResourceSkuCapacityScaleType object, or null if unable to parse. - */ - @JsonCreator - public static ResourceSkuCapacityScaleType fromString(String value) { - ResourceSkuCapacityScaleType[] items = ResourceSkuCapacityScaleType.values(); - for (ResourceSkuCapacityScaleType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ResourceSkuCosts.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ResourceSkuCosts.java deleted file mode 100644 index 6e2c8ec2ada7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ResourceSkuCosts.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describes metadata for retrieving price info. */ -@Immutable -public final class ResourceSkuCosts { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceSkuCosts.class); - - /* - * Used for querying price from commerce. - */ - @JsonProperty(value = "meterID", access = JsonProperty.Access.WRITE_ONLY) - private String meterId; - - /* - * The multiplier is needed to extend the base metered cost. - */ - @JsonProperty(value = "quantity", access = JsonProperty.Access.WRITE_ONLY) - private Long quantity; - - /* - * An invariant to show the extended unit. - */ - @JsonProperty(value = "extendedUnit", access = JsonProperty.Access.WRITE_ONLY) - private String extendedUnit; - - /** - * Get the meterId property: Used for querying price from commerce. - * - * @return the meterId value. - */ - public String meterId() { - return this.meterId; - } - - /** - * Get the quantity property: The multiplier is needed to extend the base metered cost. - * - * @return the quantity value. - */ - public Long quantity() { - return this.quantity; - } - - /** - * Get the extendedUnit property: An invariant to show the extended unit. - * - * @return the extendedUnit value. - */ - public String extendedUnit() { - return this.extendedUnit; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ResourceSkuLocationInfo.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ResourceSkuLocationInfo.java deleted file mode 100644 index bc40d97f5d44..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ResourceSkuLocationInfo.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The ResourceSkuLocationInfo model. */ -@Immutable -public final class ResourceSkuLocationInfo { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceSkuLocationInfo.class); - - /* - * Location of the SKU - */ - @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) - private String location; - - /* - * List of availability zones where the SKU is supported. - */ - @JsonProperty(value = "zones", access = JsonProperty.Access.WRITE_ONLY) - private List zones; - - /* - * Details of capabilities available to a SKU in specific zones. - */ - @JsonProperty(value = "zoneDetails", access = JsonProperty.Access.WRITE_ONLY) - private List zoneDetails; - - /** - * Get the location property: Location of the SKU. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Get the zones property: List of availability zones where the SKU is supported. - * - * @return the zones value. - */ - public List zones() { - return this.zones; - } - - /** - * Get the zoneDetails property: Details of capabilities available to a SKU in specific zones. - * - * @return the zoneDetails value. - */ - public List zoneDetails() { - return this.zoneDetails; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (zoneDetails() != null) { - zoneDetails().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ResourceSkuRestrictionInfo.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ResourceSkuRestrictionInfo.java deleted file mode 100644 index 0d86ce7c6c35..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ResourceSkuRestrictionInfo.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The ResourceSkuRestrictionInfo model. */ -@Immutable -public final class ResourceSkuRestrictionInfo { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceSkuRestrictionInfo.class); - - /* - * Locations where the SKU is restricted - */ - @JsonProperty(value = "locations", access = JsonProperty.Access.WRITE_ONLY) - private List locations; - - /* - * List of availability zones where the SKU is restricted. - */ - @JsonProperty(value = "zones", access = JsonProperty.Access.WRITE_ONLY) - private List zones; - - /** - * Get the locations property: Locations where the SKU is restricted. - * - * @return the locations value. - */ - public List locations() { - return this.locations; - } - - /** - * Get the zones property: List of availability zones where the SKU is restricted. - * - * @return the zones value. - */ - public List zones() { - return this.zones; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ResourceSkuRestrictions.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ResourceSkuRestrictions.java deleted file mode 100644 index dba51dc0a082..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ResourceSkuRestrictions.java +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Describes scaling information of a SKU. */ -@Immutable -public final class ResourceSkuRestrictions { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceSkuRestrictions.class); - - /* - * The type of restrictions. - */ - @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) - private ResourceSkuRestrictionsType type; - - /* - * The value of restrictions. If the restriction type is set to location. - * This would be different locations where the SKU is restricted. - */ - @JsonProperty(value = "values", access = JsonProperty.Access.WRITE_ONLY) - private List values; - - /* - * The information about the restriction where the SKU cannot be used. - */ - @JsonProperty(value = "restrictionInfo", access = JsonProperty.Access.WRITE_ONLY) - private ResourceSkuRestrictionInfo restrictionInfo; - - /* - * The reason for restriction. - */ - @JsonProperty(value = "reasonCode", access = JsonProperty.Access.WRITE_ONLY) - private ResourceSkuRestrictionsReasonCode reasonCode; - - /** - * Get the type property: The type of restrictions. - * - * @return the type value. - */ - public ResourceSkuRestrictionsType type() { - return this.type; - } - - /** - * Get the values property: The value of restrictions. If the restriction type is set to location. This would be - * different locations where the SKU is restricted. - * - * @return the values value. - */ - public List values() { - return this.values; - } - - /** - * Get the restrictionInfo property: The information about the restriction where the SKU cannot be used. - * - * @return the restrictionInfo value. - */ - public ResourceSkuRestrictionInfo restrictionInfo() { - return this.restrictionInfo; - } - - /** - * Get the reasonCode property: The reason for restriction. - * - * @return the reasonCode value. - */ - public ResourceSkuRestrictionsReasonCode reasonCode() { - return this.reasonCode; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (restrictionInfo() != null) { - restrictionInfo().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ResourceSkuRestrictionsReasonCode.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ResourceSkuRestrictionsReasonCode.java deleted file mode 100644 index f80398c05558..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ResourceSkuRestrictionsReasonCode.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for ResourceSkuRestrictionsReasonCode. */ -public enum ResourceSkuRestrictionsReasonCode { - /** Enum value QuotaId. */ - QUOTA_ID("QuotaId"), - - /** Enum value NotAvailableForSubscription. */ - NOT_AVAILABLE_FOR_SUBSCRIPTION("NotAvailableForSubscription"); - - /** The actual serialized value for a ResourceSkuRestrictionsReasonCode instance. */ - private final String value; - - ResourceSkuRestrictionsReasonCode(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a ResourceSkuRestrictionsReasonCode instance. - * - * @param value the serialized value to parse. - * @return the parsed ResourceSkuRestrictionsReasonCode object, or null if unable to parse. - */ - @JsonCreator - public static ResourceSkuRestrictionsReasonCode fromString(String value) { - ResourceSkuRestrictionsReasonCode[] items = ResourceSkuRestrictionsReasonCode.values(); - for (ResourceSkuRestrictionsReasonCode item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ResourceSkuRestrictionsType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ResourceSkuRestrictionsType.java deleted file mode 100644 index 20ffd76b5fc7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ResourceSkuRestrictionsType.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for ResourceSkuRestrictionsType. */ -public enum ResourceSkuRestrictionsType { - /** Enum value Location. */ - LOCATION("Location"), - - /** Enum value Zone. */ - ZONE("Zone"); - - /** The actual serialized value for a ResourceSkuRestrictionsType instance. */ - private final String value; - - ResourceSkuRestrictionsType(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a ResourceSkuRestrictionsType instance. - * - * @param value the serialized value to parse. - * @return the parsed ResourceSkuRestrictionsType object, or null if unable to parse. - */ - @JsonCreator - public static ResourceSkuRestrictionsType fromString(String value) { - ResourceSkuRestrictionsType[] items = ResourceSkuRestrictionsType.values(); - for (ResourceSkuRestrictionsType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ResourceSkuZoneDetails.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ResourceSkuZoneDetails.java deleted file mode 100644 index 31ac0b5a8f1c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ResourceSkuZoneDetails.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Describes The zonal capabilities of a SKU. */ -@Immutable -public final class ResourceSkuZoneDetails { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceSkuZoneDetails.class); - - /* - * The set of zones that the SKU is available in with the specified - * capabilities. - */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) - private List name; - - /* - * A list of capabilities that are available for the SKU in the specified - * list of zones. - */ - @JsonProperty(value = "capabilities", access = JsonProperty.Access.WRITE_ONLY) - private List capabilities; - - /** - * Get the name property: The set of zones that the SKU is available in with the specified capabilities. - * - * @return the name value. - */ - public List name() { - return this.name; - } - - /** - * Get the capabilities property: A list of capabilities that are available for the SKU in the specified list of - * zones. - * - * @return the capabilities value. - */ - public List capabilities() { - return this.capabilities; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (capabilities() != null) { - capabilities().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ResourceSkusResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ResourceSkusResult.java deleted file mode 100644 index b91dbeaee6d6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ResourceSkusResult.java +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.fluent.models.ResourceSkuInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The List Resource Skus operation response. */ -@Fluent -public final class ResourceSkusResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceSkusResult.class); - - /* - * The list of skus available for the subscription. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * The URI to fetch the next page of Resource Skus. Call ListNext() with - * this URI to fetch the next page of Resource Skus - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: The list of skus available for the subscription. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The list of skus available for the subscription. - * - * @param value the value value to set. - * @return the ResourceSkusResult object itself. - */ - public ResourceSkusResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URI to fetch the next page of Resource Skus. Call ListNext() with this URI to - * fetch the next page of Resource Skus. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The URI to fetch the next page of Resource Skus. Call ListNext() with this URI to - * fetch the next page of Resource Skus. - * - * @param nextLink the nextLink value to set. - * @return the ResourceSkusResult object itself. - */ - public ResourceSkusResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model ResourceSkusResult")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/RollbackStatusInfo.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/RollbackStatusInfo.java deleted file mode 100644 index 15a21a2ffffe..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/RollbackStatusInfo.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Information about rollback on failed VM instances after a OS Upgrade operation. */ -@Immutable -public final class RollbackStatusInfo { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RollbackStatusInfo.class); - - /* - * The number of instances which have been successfully rolled back. - */ - @JsonProperty(value = "successfullyRolledbackInstanceCount", access = JsonProperty.Access.WRITE_ONLY) - private Integer successfullyRolledbackInstanceCount; - - /* - * The number of instances which failed to rollback. - */ - @JsonProperty(value = "failedRolledbackInstanceCount", access = JsonProperty.Access.WRITE_ONLY) - private Integer failedRolledbackInstanceCount; - - /* - * Error details if OS rollback failed. - */ - @JsonProperty(value = "rollbackError", access = JsonProperty.Access.WRITE_ONLY) - private ApiError rollbackError; - - /** - * Get the successfullyRolledbackInstanceCount property: The number of instances which have been successfully rolled - * back. - * - * @return the successfullyRolledbackInstanceCount value. - */ - public Integer successfullyRolledbackInstanceCount() { - return this.successfullyRolledbackInstanceCount; - } - - /** - * Get the failedRolledbackInstanceCount property: The number of instances which failed to rollback. - * - * @return the failedRolledbackInstanceCount value. - */ - public Integer failedRolledbackInstanceCount() { - return this.failedRolledbackInstanceCount; - } - - /** - * Get the rollbackError property: Error details if OS rollback failed. - * - * @return the rollbackError value. - */ - public ApiError rollbackError() { - return this.rollbackError; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (rollbackError() != null) { - rollbackError().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/RollingUpgradeActionType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/RollingUpgradeActionType.java deleted file mode 100644 index 6dd4da35afdb..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/RollingUpgradeActionType.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for RollingUpgradeActionType. */ -public enum RollingUpgradeActionType { - /** Enum value Start. */ - START("Start"), - - /** Enum value Cancel. */ - CANCEL("Cancel"); - - /** The actual serialized value for a RollingUpgradeActionType instance. */ - private final String value; - - RollingUpgradeActionType(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a RollingUpgradeActionType instance. - * - * @param value the serialized value to parse. - * @return the parsed RollingUpgradeActionType object, or null if unable to parse. - */ - @JsonCreator - public static RollingUpgradeActionType fromString(String value) { - RollingUpgradeActionType[] items = RollingUpgradeActionType.values(); - for (RollingUpgradeActionType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/RollingUpgradePolicy.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/RollingUpgradePolicy.java deleted file mode 100644 index 2087f3d1698a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/RollingUpgradePolicy.java +++ /dev/null @@ -1,162 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The configuration parameters used while performing a rolling upgrade. */ -@Fluent -public final class RollingUpgradePolicy { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RollingUpgradePolicy.class); - - /* - * The maximum percent of total virtual machine instances that will be - * upgraded simultaneously by the rolling upgrade in one batch. As this is - * a maximum, unhealthy instances in previous or future batches can cause - * the percentage of instances in a batch to decrease to ensure higher - * reliability. The default value for this parameter is 20%. - */ - @JsonProperty(value = "maxBatchInstancePercent") - private Integer maxBatchInstancePercent; - - /* - * The maximum percentage of the total virtual machine instances in the - * scale set that can be simultaneously unhealthy, either as a result of - * being upgraded, or by being found in an unhealthy state by the virtual - * machine health checks before the rolling upgrade aborts. This constraint - * will be checked prior to starting any batch. The default value for this - * parameter is 20%. - */ - @JsonProperty(value = "maxUnhealthyInstancePercent") - private Integer maxUnhealthyInstancePercent; - - /* - * The maximum percentage of upgraded virtual machine instances that can be - * found to be in an unhealthy state. This check will happen after each - * batch is upgraded. If this percentage is ever exceeded, the rolling - * update aborts. The default value for this parameter is 20%. - */ - @JsonProperty(value = "maxUnhealthyUpgradedInstancePercent") - private Integer maxUnhealthyUpgradedInstancePercent; - - /* - * The wait time between completing the update for all virtual machines in - * one batch and starting the next batch. The time duration should be - * specified in ISO 8601 format. The default value is 0 seconds (PT0S). - */ - @JsonProperty(value = "pauseTimeBetweenBatches") - private String pauseTimeBetweenBatches; - - /** - * Get the maxBatchInstancePercent property: The maximum percent of total virtual machine instances that will be - * upgraded simultaneously by the rolling upgrade in one batch. As this is a maximum, unhealthy instances in - * previous or future batches can cause the percentage of instances in a batch to decrease to ensure higher - * reliability. The default value for this parameter is 20%. - * - * @return the maxBatchInstancePercent value. - */ - public Integer maxBatchInstancePercent() { - return this.maxBatchInstancePercent; - } - - /** - * Set the maxBatchInstancePercent property: The maximum percent of total virtual machine instances that will be - * upgraded simultaneously by the rolling upgrade in one batch. As this is a maximum, unhealthy instances in - * previous or future batches can cause the percentage of instances in a batch to decrease to ensure higher - * reliability. The default value for this parameter is 20%. - * - * @param maxBatchInstancePercent the maxBatchInstancePercent value to set. - * @return the RollingUpgradePolicy object itself. - */ - public RollingUpgradePolicy withMaxBatchInstancePercent(Integer maxBatchInstancePercent) { - this.maxBatchInstancePercent = maxBatchInstancePercent; - return this; - } - - /** - * Get the maxUnhealthyInstancePercent property: The maximum percentage of the total virtual machine instances in - * the scale set that can be simultaneously unhealthy, either as a result of being upgraded, or by being found in an - * unhealthy state by the virtual machine health checks before the rolling upgrade aborts. This constraint will be - * checked prior to starting any batch. The default value for this parameter is 20%. - * - * @return the maxUnhealthyInstancePercent value. - */ - public Integer maxUnhealthyInstancePercent() { - return this.maxUnhealthyInstancePercent; - } - - /** - * Set the maxUnhealthyInstancePercent property: The maximum percentage of the total virtual machine instances in - * the scale set that can be simultaneously unhealthy, either as a result of being upgraded, or by being found in an - * unhealthy state by the virtual machine health checks before the rolling upgrade aborts. This constraint will be - * checked prior to starting any batch. The default value for this parameter is 20%. - * - * @param maxUnhealthyInstancePercent the maxUnhealthyInstancePercent value to set. - * @return the RollingUpgradePolicy object itself. - */ - public RollingUpgradePolicy withMaxUnhealthyInstancePercent(Integer maxUnhealthyInstancePercent) { - this.maxUnhealthyInstancePercent = maxUnhealthyInstancePercent; - return this; - } - - /** - * Get the maxUnhealthyUpgradedInstancePercent property: The maximum percentage of upgraded virtual machine - * instances that can be found to be in an unhealthy state. This check will happen after each batch is upgraded. If - * this percentage is ever exceeded, the rolling update aborts. The default value for this parameter is 20%. - * - * @return the maxUnhealthyUpgradedInstancePercent value. - */ - public Integer maxUnhealthyUpgradedInstancePercent() { - return this.maxUnhealthyUpgradedInstancePercent; - } - - /** - * Set the maxUnhealthyUpgradedInstancePercent property: The maximum percentage of upgraded virtual machine - * instances that can be found to be in an unhealthy state. This check will happen after each batch is upgraded. If - * this percentage is ever exceeded, the rolling update aborts. The default value for this parameter is 20%. - * - * @param maxUnhealthyUpgradedInstancePercent the maxUnhealthyUpgradedInstancePercent value to set. - * @return the RollingUpgradePolicy object itself. - */ - public RollingUpgradePolicy withMaxUnhealthyUpgradedInstancePercent(Integer maxUnhealthyUpgradedInstancePercent) { - this.maxUnhealthyUpgradedInstancePercent = maxUnhealthyUpgradedInstancePercent; - return this; - } - - /** - * Get the pauseTimeBetweenBatches property: The wait time between completing the update for all virtual machines in - * one batch and starting the next batch. The time duration should be specified in ISO 8601 format. The default - * value is 0 seconds (PT0S). - * - * @return the pauseTimeBetweenBatches value. - */ - public String pauseTimeBetweenBatches() { - return this.pauseTimeBetweenBatches; - } - - /** - * Set the pauseTimeBetweenBatches property: The wait time between completing the update for all virtual machines in - * one batch and starting the next batch. The time duration should be specified in ISO 8601 format. The default - * value is 0 seconds (PT0S). - * - * @param pauseTimeBetweenBatches the pauseTimeBetweenBatches value to set. - * @return the RollingUpgradePolicy object itself. - */ - public RollingUpgradePolicy withPauseTimeBetweenBatches(String pauseTimeBetweenBatches) { - this.pauseTimeBetweenBatches = pauseTimeBetweenBatches; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/RollingUpgradeProgressInfo.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/RollingUpgradeProgressInfo.java deleted file mode 100644 index 074c9c08d6b3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/RollingUpgradeProgressInfo.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Information about the number of virtual machine instances in each upgrade state. */ -@Immutable -public final class RollingUpgradeProgressInfo { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RollingUpgradeProgressInfo.class); - - /* - * The number of instances that have been successfully upgraded. - */ - @JsonProperty(value = "successfulInstanceCount", access = JsonProperty.Access.WRITE_ONLY) - private Integer successfulInstanceCount; - - /* - * The number of instances that have failed to be upgraded successfully. - */ - @JsonProperty(value = "failedInstanceCount", access = JsonProperty.Access.WRITE_ONLY) - private Integer failedInstanceCount; - - /* - * The number of instances that are currently being upgraded. - */ - @JsonProperty(value = "inProgressInstanceCount", access = JsonProperty.Access.WRITE_ONLY) - private Integer inProgressInstanceCount; - - /* - * The number of instances that have not yet begun to be upgraded. - */ - @JsonProperty(value = "pendingInstanceCount", access = JsonProperty.Access.WRITE_ONLY) - private Integer pendingInstanceCount; - - /** - * Get the successfulInstanceCount property: The number of instances that have been successfully upgraded. - * - * @return the successfulInstanceCount value. - */ - public Integer successfulInstanceCount() { - return this.successfulInstanceCount; - } - - /** - * Get the failedInstanceCount property: The number of instances that have failed to be upgraded successfully. - * - * @return the failedInstanceCount value. - */ - public Integer failedInstanceCount() { - return this.failedInstanceCount; - } - - /** - * Get the inProgressInstanceCount property: The number of instances that are currently being upgraded. - * - * @return the inProgressInstanceCount value. - */ - public Integer inProgressInstanceCount() { - return this.inProgressInstanceCount; - } - - /** - * Get the pendingInstanceCount property: The number of instances that have not yet begun to be upgraded. - * - * @return the pendingInstanceCount value. - */ - public Integer pendingInstanceCount() { - return this.pendingInstanceCount; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/RollingUpgradeRunningStatus.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/RollingUpgradeRunningStatus.java deleted file mode 100644 index 2b61fb62c315..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/RollingUpgradeRunningStatus.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** Information about the current running state of the overall upgrade. */ -@Immutable -public final class RollingUpgradeRunningStatus { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RollingUpgradeRunningStatus.class); - - /* - * Code indicating the current status of the upgrade. - */ - @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) - private RollingUpgradeStatusCode code; - - /* - * Start time of the upgrade. - */ - @JsonProperty(value = "startTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime startTime; - - /* - * The last action performed on the rolling upgrade. - */ - @JsonProperty(value = "lastAction", access = JsonProperty.Access.WRITE_ONLY) - private RollingUpgradeActionType lastAction; - - /* - * Last action time of the upgrade. - */ - @JsonProperty(value = "lastActionTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime lastActionTime; - - /** - * Get the code property: Code indicating the current status of the upgrade. - * - * @return the code value. - */ - public RollingUpgradeStatusCode code() { - return this.code; - } - - /** - * Get the startTime property: Start time of the upgrade. - * - * @return the startTime value. - */ - public OffsetDateTime startTime() { - return this.startTime; - } - - /** - * Get the lastAction property: The last action performed on the rolling upgrade. - * - * @return the lastAction value. - */ - public RollingUpgradeActionType lastAction() { - return this.lastAction; - } - - /** - * Get the lastActionTime property: Last action time of the upgrade. - * - * @return the lastActionTime value. - */ - public OffsetDateTime lastActionTime() { - return this.lastActionTime; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/RollingUpgradeStatusCode.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/RollingUpgradeStatusCode.java deleted file mode 100644 index 49e2e3ef4581..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/RollingUpgradeStatusCode.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for RollingUpgradeStatusCode. */ -public enum RollingUpgradeStatusCode { - /** Enum value RollingForward. */ - ROLLING_FORWARD("RollingForward"), - - /** Enum value Cancelled. */ - CANCELLED("Cancelled"), - - /** Enum value Completed. */ - COMPLETED("Completed"), - - /** Enum value Faulted. */ - FAULTED("Faulted"); - - /** The actual serialized value for a RollingUpgradeStatusCode instance. */ - private final String value; - - RollingUpgradeStatusCode(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a RollingUpgradeStatusCode instance. - * - * @param value the serialized value to parse. - * @return the parsed RollingUpgradeStatusCode object, or null if unable to parse. - */ - @JsonCreator - public static RollingUpgradeStatusCode fromString(String value) { - RollingUpgradeStatusCode[] items = RollingUpgradeStatusCode.values(); - for (RollingUpgradeStatusCode item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/RunCommandInput.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/RunCommandInput.java deleted file mode 100644 index c174f6334dce..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/RunCommandInput.java +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Capture Virtual Machine parameters. */ -@Fluent -public final class RunCommandInput { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RunCommandInput.class); - - /* - * The run command id. - */ - @JsonProperty(value = "commandId", required = true) - private String commandId; - - /* - * Optional. The script to be executed. When this value is given, the - * given script will override the default script of the command. - */ - @JsonProperty(value = "script") - private List script; - - /* - * The run command parameters. - */ - @JsonProperty(value = "parameters") - private List parameters; - - /** - * Get the commandId property: The run command id. - * - * @return the commandId value. - */ - public String commandId() { - return this.commandId; - } - - /** - * Set the commandId property: The run command id. - * - * @param commandId the commandId value to set. - * @return the RunCommandInput object itself. - */ - public RunCommandInput withCommandId(String commandId) { - this.commandId = commandId; - return this; - } - - /** - * Get the script property: Optional. The script to be executed. When this value is given, the given script will - * override the default script of the command. - * - * @return the script value. - */ - public List script() { - return this.script; - } - - /** - * Set the script property: Optional. The script to be executed. When this value is given, the given script will - * override the default script of the command. - * - * @param script the script value to set. - * @return the RunCommandInput object itself. - */ - public RunCommandInput withScript(List script) { - this.script = script; - return this; - } - - /** - * Get the parameters property: The run command parameters. - * - * @return the parameters value. - */ - public List parameters() { - return this.parameters; - } - - /** - * Set the parameters property: The run command parameters. - * - * @param parameters the parameters value to set. - * @return the RunCommandInput object itself. - */ - public RunCommandInput withParameters(List parameters) { - this.parameters = parameters; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (commandId() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property commandId in model RunCommandInput")); - } - if (parameters() != null) { - parameters().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/RunCommandInputParameter.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/RunCommandInputParameter.java deleted file mode 100644 index 226bb20d54a7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/RunCommandInputParameter.java +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describes the properties of a run command parameter. */ -@Fluent -public final class RunCommandInputParameter { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RunCommandInputParameter.class); - - /* - * The run command parameter name. - */ - @JsonProperty(value = "name", required = true) - private String name; - - /* - * The run command parameter value. - */ - @JsonProperty(value = "value", required = true) - private String value; - - /** - * Get the name property: The run command parameter name. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The run command parameter name. - * - * @param name the name value to set. - * @return the RunCommandInputParameter object itself. - */ - public RunCommandInputParameter withName(String name) { - this.name = name; - return this; - } - - /** - * Get the value property: The run command parameter value. - * - * @return the value value. - */ - public String value() { - return this.value; - } - - /** - * Set the value property: The run command parameter value. - * - * @param value the value value to set. - * @return the RunCommandInputParameter object itself. - */ - public RunCommandInputParameter withValue(String value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property name in model RunCommandInputParameter")); - } - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model RunCommandInputParameter")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/RunCommandListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/RunCommandListResult.java deleted file mode 100644 index 1e3d73c5564a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/RunCommandListResult.java +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.fluent.models.RunCommandDocumentBaseInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The List Virtual Machine operation response. */ -@Fluent -public final class RunCommandListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RunCommandListResult.class); - - /* - * The list of virtual machine run commands. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * The uri to fetch the next page of run commands. Call ListNext() with - * this to fetch the next page of run commands. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: The list of virtual machine run commands. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The list of virtual machine run commands. - * - * @param value the value value to set. - * @return the RunCommandListResult object itself. - */ - public RunCommandListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The uri to fetch the next page of run commands. Call ListNext() with this to fetch the - * next page of run commands. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The uri to fetch the next page of run commands. Call ListNext() with this to fetch the - * next page of run commands. - * - * @param nextLink the nextLink value to set. - * @return the RunCommandListResult object itself. - */ - public RunCommandListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model RunCommandListResult")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/RunCommandParameterDefinition.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/RunCommandParameterDefinition.java deleted file mode 100644 index d55a7f4f5069..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/RunCommandParameterDefinition.java +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describes the properties of a run command parameter. */ -@Fluent -public final class RunCommandParameterDefinition { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RunCommandParameterDefinition.class); - - /* - * The run command parameter name. - */ - @JsonProperty(value = "name", required = true) - private String name; - - /* - * The run command parameter type. - */ - @JsonProperty(value = "type", required = true) - private String type; - - /* - * The run command parameter default value. - */ - @JsonProperty(value = "defaultValue") - private String defaultValue; - - /* - * The run command parameter required. - */ - @JsonProperty(value = "required") - private Boolean required; - - /** - * Get the name property: The run command parameter name. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The run command parameter name. - * - * @param name the name value to set. - * @return the RunCommandParameterDefinition object itself. - */ - public RunCommandParameterDefinition withName(String name) { - this.name = name; - return this; - } - - /** - * Get the type property: The run command parameter type. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Set the type property: The run command parameter type. - * - * @param type the type value to set. - * @return the RunCommandParameterDefinition object itself. - */ - public RunCommandParameterDefinition withType(String type) { - this.type = type; - return this; - } - - /** - * Get the defaultValue property: The run command parameter default value. - * - * @return the defaultValue value. - */ - public String defaultValue() { - return this.defaultValue; - } - - /** - * Set the defaultValue property: The run command parameter default value. - * - * @param defaultValue the defaultValue value to set. - * @return the RunCommandParameterDefinition object itself. - */ - public RunCommandParameterDefinition withDefaultValue(String defaultValue) { - this.defaultValue = defaultValue; - return this; - } - - /** - * Get the required property: The run command parameter required. - * - * @return the required value. - */ - public Boolean required() { - return this.required; - } - - /** - * Set the required property: The run command parameter required. - * - * @param required the required value to set. - * @return the RunCommandParameterDefinition object itself. - */ - public RunCommandParameterDefinition withRequired(Boolean required) { - this.required = required; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property name in model RunCommandParameterDefinition")); - } - if (type() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property type in model RunCommandParameterDefinition")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/RunCommandResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/RunCommandResult.java deleted file mode 100644 index b4b15d6a4f8b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/RunCommandResult.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.compute.fluent.models.RunCommandResultInner; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import java.util.List; - -/** Type representing sku for an Azure compute resource. */ -@Fluent -public interface RunCommandResult extends HasInnerModel { - /** - * Get run command operation response. - * - * @return the value value - */ - List value(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ScaleInPolicy.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ScaleInPolicy.java deleted file mode 100644 index ee6620fe22d8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ScaleInPolicy.java +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Describes a scale-in policy for a virtual machine scale set. */ -@Fluent -public final class ScaleInPolicy { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ScaleInPolicy.class); - - /* - * The rules to be followed when scaling-in a virtual machine scale set. - *

    Possible values are:

    **Default** When a virtual - * machine scale set is scaled in, the scale set will first be balanced - * across zones if it is a zonal scale set. Then, it will be balanced - * across Fault Domains as far as possible. Within each Fault Domain, the - * virtual machines chosen for removal will be the newest ones that are not - * protected from scale-in.

    **OldestVM** When a virtual machine - * scale set is being scaled-in, the oldest virtual machines that are not - * protected from scale-in will be chosen for removal. For zonal virtual - * machine scale sets, the scale set will first be balanced across zones. - * Within each zone, the oldest virtual machines that are not protected - * will be chosen for removal.

    **NewestVM** When a virtual machine - * scale set is being scaled-in, the newest virtual machines that are not - * protected from scale-in will be chosen for removal. For zonal virtual - * machine scale sets, the scale set will first be balanced across zones. - * Within each zone, the newest virtual machines that are not protected - * will be chosen for removal.

    - */ - @JsonProperty(value = "rules") - private List rules; - - /** - * Get the rules property: The rules to be followed when scaling-in a virtual machine scale set. - * <br><br> Possible values are: <br><br> **Default** When a virtual machine scale set is - * scaled in, the scale set will first be balanced across zones if it is a zonal scale set. Then, it will be - * balanced across Fault Domains as far as possible. Within each Fault Domain, the virtual machines chosen for - * removal will be the newest ones that are not protected from scale-in. <br><br> **OldestVM** When a - * virtual machine scale set is being scaled-in, the oldest virtual machines that are not protected from scale-in - * will be chosen for removal. For zonal virtual machine scale sets, the scale set will first be balanced across - * zones. Within each zone, the oldest virtual machines that are not protected will be chosen for removal. - * <br><br> **NewestVM** When a virtual machine scale set is being scaled-in, the newest virtual - * machines that are not protected from scale-in will be chosen for removal. For zonal virtual machine scale sets, - * the scale set will first be balanced across zones. Within each zone, the newest virtual machines that are not - * protected will be chosen for removal. <br><br>. - * - * @return the rules value. - */ - public List rules() { - return this.rules; - } - - /** - * Set the rules property: The rules to be followed when scaling-in a virtual machine scale set. - * <br><br> Possible values are: <br><br> **Default** When a virtual machine scale set is - * scaled in, the scale set will first be balanced across zones if it is a zonal scale set. Then, it will be - * balanced across Fault Domains as far as possible. Within each Fault Domain, the virtual machines chosen for - * removal will be the newest ones that are not protected from scale-in. <br><br> **OldestVM** When a - * virtual machine scale set is being scaled-in, the oldest virtual machines that are not protected from scale-in - * will be chosen for removal. For zonal virtual machine scale sets, the scale set will first be balanced across - * zones. Within each zone, the oldest virtual machines that are not protected will be chosen for removal. - * <br><br> **NewestVM** When a virtual machine scale set is being scaled-in, the newest virtual - * machines that are not protected from scale-in will be chosen for removal. For zonal virtual machine scale sets, - * the scale set will first be balanced across zones. Within each zone, the newest virtual machines that are not - * protected will be chosen for removal. <br><br>. - * - * @param rules the rules value to set. - * @return the ScaleInPolicy object itself. - */ - public ScaleInPolicy withRules(List rules) { - this.rules = rules; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ScheduledEventsProfile.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ScheduledEventsProfile.java deleted file mode 100644 index 6fc1fb9ba0fb..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ScheduledEventsProfile.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The ScheduledEventsProfile model. */ -@Fluent -public final class ScheduledEventsProfile { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ScheduledEventsProfile.class); - - /* - * Specifies Terminate Scheduled Event related configurations. - */ - @JsonProperty(value = "terminateNotificationProfile") - private TerminateNotificationProfile terminateNotificationProfile; - - /** - * Get the terminateNotificationProfile property: Specifies Terminate Scheduled Event related configurations. - * - * @return the terminateNotificationProfile value. - */ - public TerminateNotificationProfile terminateNotificationProfile() { - return this.terminateNotificationProfile; - } - - /** - * Set the terminateNotificationProfile property: Specifies Terminate Scheduled Event related configurations. - * - * @param terminateNotificationProfile the terminateNotificationProfile value to set. - * @return the ScheduledEventsProfile object itself. - */ - public ScheduledEventsProfile withTerminateNotificationProfile( - TerminateNotificationProfile terminateNotificationProfile) { - this.terminateNotificationProfile = terminateNotificationProfile; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (terminateNotificationProfile() != null) { - terminateNotificationProfile().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/SecurityProfile.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/SecurityProfile.java deleted file mode 100644 index 6e2dd9a73222..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/SecurityProfile.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Specifies the Security profile settings for the virtual machine or virtual machine scale set. */ -@Fluent -public final class SecurityProfile { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SecurityProfile.class); - - /* - * This property can be used by user in the request to enable or disable - * the Host Encryption for the virtual machine or virtual machine scale - * set. This will enable the encryption for all the disks including - * Resource/Temp disk at host itself.

    Default: The Encryption at - * host will be disabled unless this property is set to true for the - * resource. - */ - @JsonProperty(value = "encryptionAtHost") - private Boolean encryptionAtHost; - - /** - * Get the encryptionAtHost property: This property can be used by user in the request to enable or disable the Host - * Encryption for the virtual machine or virtual machine scale set. This will enable the encryption for all the - * disks including Resource/Temp disk at host itself. <br><br> Default: The Encryption at host will be - * disabled unless this property is set to true for the resource. - * - * @return the encryptionAtHost value. - */ - public Boolean encryptionAtHost() { - return this.encryptionAtHost; - } - - /** - * Set the encryptionAtHost property: This property can be used by user in the request to enable or disable the Host - * Encryption for the virtual machine or virtual machine scale set. This will enable the encryption for all the - * disks including Resource/Temp disk at host itself. <br><br> Default: The Encryption at host will be - * disabled unless this property is set to true for the resource. - * - * @param encryptionAtHost the encryptionAtHost value to set. - * @return the SecurityProfile object itself. - */ - public SecurityProfile withEncryptionAtHost(Boolean encryptionAtHost) { - this.encryptionAtHost = encryptionAtHost; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/SettingNames.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/SettingNames.java deleted file mode 100644 index 3e246bfd0e73..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/SettingNames.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for SettingNames. */ -public enum SettingNames { - /** Enum value AutoLogon. */ - AUTO_LOGON("AutoLogon"), - - /** Enum value FirstLogonCommands. */ - FIRST_LOGON_COMMANDS("FirstLogonCommands"); - - /** The actual serialized value for a SettingNames instance. */ - private final String value; - - SettingNames(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a SettingNames instance. - * - * @param value the serialized value to parse. - * @return the parsed SettingNames object, or null if unable to parse. - */ - @JsonCreator - public static SettingNames fromString(String value) { - SettingNames[] items = SettingNames.values(); - for (SettingNames item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/Sku.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/Sku.java deleted file mode 100644 index a1c10afa593d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/Sku.java +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Describes a virtual machine scale set sku. NOTE: If the new VM SKU is not supported on the hardware the scale set is - * currently on, you need to deallocate the VMs in the scale set before you modify the SKU name. - */ -@Fluent -public final class Sku { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Sku.class); - - /* - * The sku name. - */ - @JsonProperty(value = "name") - private String name; - - /* - * Specifies the tier of virtual machines in a scale set.

    - * Possible Values:

    **Standard**

    **Basic** - */ - @JsonProperty(value = "tier") - private String tier; - - /* - * Specifies the number of virtual machines in the scale set. - */ - @JsonProperty(value = "capacity") - private Long capacity; - - /** - * Get the name property: The sku name. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The sku name. - * - * @param name the name value to set. - * @return the Sku object itself. - */ - public Sku withName(String name) { - this.name = name; - return this; - } - - /** - * Get the tier property: Specifies the tier of virtual machines in a scale set.<br /><br /> Possible - * Values:<br /><br /> **Standard**<br /><br /> **Basic**. - * - * @return the tier value. - */ - public String tier() { - return this.tier; - } - - /** - * Set the tier property: Specifies the tier of virtual machines in a scale set.<br /><br /> Possible - * Values:<br /><br /> **Standard**<br /><br /> **Basic**. - * - * @param tier the tier value to set. - * @return the Sku object itself. - */ - public Sku withTier(String tier) { - this.tier = tier; - return this; - } - - /** - * Get the capacity property: Specifies the number of virtual machines in the scale set. - * - * @return the capacity value. - */ - public Long capacity() { - return this.capacity; - } - - /** - * Set the capacity property: Specifies the number of virtual machines in the scale set. - * - * @param capacity the capacity value to set. - * @return the Sku object itself. - */ - public Sku withCapacity(Long capacity) { - this.capacity = capacity; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/Snapshot.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/Snapshot.java deleted file mode 100644 index cd3f3c4aa69f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/Snapshot.java +++ /dev/null @@ -1,396 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.compute.ComputeManager; -import com.azure.resourcemanager.compute.fluent.models.SnapshotInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.GroupableResource; -import com.azure.resourcemanager.resources.fluentcore.arm.models.Resource; -import com.azure.resourcemanager.resources.fluentcore.model.Appliable; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; -import com.azure.resourcemanager.resources.fluentcore.model.Updatable; -import reactor.core.publisher.Mono; - -/** An immutable client-side representation of an Azure managed snapshot. */ -@Fluent -public interface Snapshot - extends GroupableResource, Refreshable, Updatable { - /** @return the snapshot SKU type. */ - SnapshotSkuType skuType(); - - /** @return whether a snapshot is incremental */ - boolean incremental(); - - /** @return the snapshot creation method */ - DiskCreateOption creationMethod(); - - /** @return disk size in GB */ - int sizeInGB(); - - /** @return the type of operating system in the snapshot */ - OperatingSystemTypes osType(); - - /** @return the details of the source from which snapshot is created */ - CreationSource source(); - - /** - * Grants access to the snapshot. - * - * @param accessDurationInSeconds the access duration in seconds - * @return the read-only SAS URI to the snapshot - */ - String grantAccess(int accessDurationInSeconds); - - /** - * Grants access to the snapshot asynchronously. - * - * @param accessDurationInSeconds the access duration in seconds - * @return a representation of the deferred computation of this call returning a read-only SAS URI to the disk - */ - Mono grantAccessAsync(int accessDurationInSeconds); - - /** Revoke access granted to the snapshot. */ - void revokeAccess(); - - /** - * Revoke access granted to the snapshot asynchronously. - * - * @return a representation of the deferred computation of this call - */ - Mono revokeAccessAsync(); - - /** The entirety of the managed snapshot definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithGroup, - DefinitionStages.WithSnapshotSource, - DefinitionStages.WithWindowsSnapshotSource, - DefinitionStages.WithLinuxSnapshotSource, - DefinitionStages.WithDataSnapshotSource, - DefinitionStages.WithDataSnapshotFromVhd, - DefinitionStages.WithDataSnapshotFromDisk, - DefinitionStages.WithDataSnapshotFromSnapshot, - DefinitionStages.WithCreate { - } - - /** Grouping of managed snapshot definition stages. */ - interface DefinitionStages { - /** The first stage of a managed snapshot definition. */ - interface Blank extends GroupableResource.DefinitionWithRegion { - } - - /** The stage of the managed snapshot definition allowing to specify the resource group. */ - interface WithGroup extends GroupableResource.DefinitionStages.WithGroup { - } - - /** The stage of the managed snapshot definition allowing to choose OS source or data source. */ - interface WithSnapshotSource - extends WithWindowsSnapshotSource, WithLinuxSnapshotSource, WithDataSnapshotSource { - } - - /** The stage of the managed snapshot definition allowing to choose Windows OS source. */ - interface WithWindowsSnapshotSource { - /** - * Specifies the source Windows OS managed disk. - * - * @param sourceDiskId a source managed disk resource ID - * @return the next stage of the definition - */ - WithCreate withWindowsFromDisk(String sourceDiskId); - - /** - * Specifies the source Windows OS managed disk. - * - * @param sourceDisk a source managed disk - * @return the next stage of the definition - */ - WithCreate withWindowsFromDisk(Disk sourceDisk); - - /** - * Specifies the source Windows OS managed snapshot. - * - * @param sourceSnapshotId a snapshot resource ID - * @return the next stage of the definition - */ - WithCreate withWindowsFromSnapshot(String sourceSnapshotId); - - /** - * Specifies the source Windows OS managed snapshot. - * - * @param sourceSnapshot a source snapshot - * @return the next stage of the definition - */ - WithCreate withWindowsFromSnapshot(Snapshot sourceSnapshot); - - /** - * Specifies the source specialized or generalized Windows OS VHD when it belongs to the same subscription. - * - * @param vhdUrl the source VHD URL - * @return the next stage of the definition - */ - WithCreate withWindowsFromVhd(String vhdUrl); - - /** - * Specifies the source specialized or generalized Windows OS VHD and the storage account ID. - * - * @param vhdUrl the source VHD URL - * @param storageAccountId the storage account ID - * @return the next stage of the definition - */ - WithCreate withWindowsFromVhd(String vhdUrl, String storageAccountId); - } - - /** The stage of the managed snapshot definition allowing to choose a Linux OS source. */ - interface WithLinuxSnapshotSource { - /** - * Specifies the source Linux OS managed disk. - * - * @param sourceDiskId a source managed disk resource ID - * @return the next stage of the definition - */ - WithCreate withLinuxFromDisk(String sourceDiskId); - - /** - * Specifies the source Linux OS managed disk. - * - * @param sourceDisk a source managed disk - * @return the next stage of the definition - */ - WithCreate withLinuxFromDisk(Disk sourceDisk); - - /** - * Specifies the source Linux OS managed snapshot. - * - * @param sourceSnapshotId a snapshot resource ID - * @return the next stage of the definition - */ - WithCreate withLinuxFromSnapshot(String sourceSnapshotId); - - /** - * Specifies the source Linux OS managed snapshot. - * - * @param sourceSnapshot a source snapshot - * @return the next stage of the definition - */ - WithCreate withLinuxFromSnapshot(Snapshot sourceSnapshot); - - /** - * Specifies the source specialized or generalized Linux OS VHD when it belongs to the same subscription. - * - * @param vhdUrl the source VHD URL - * @return the next stage of the definition - */ - WithCreate withLinuxFromVhd(String vhdUrl); - - /** - * Specifies the source specialized or generalized Linux OS VHD and the storage account ID. - * - * @param vhdUrl the source VHD URL - * @param storageAccountId the storage account ID - * @return the next stage of the definition - */ - WithCreate withLinuxFromVhd(String vhdUrl, String storageAccountId); - } - - /** The stage of the managed snapshot definition allowing to choose data source. */ - interface WithDataSnapshotSource - extends WithDataSnapshotFromVhd, WithDataSnapshotFromDisk, WithDataSnapshotFromSnapshot { - } - - /** The stage of the managed disk definition allowing to choose source data disk VHD. */ - interface WithDataSnapshotFromVhd { - /** - * Specifies the source data VHD when it belongs to the same subscription. - * - * @param vhdUrl a source VHD URL - * @return the next stage of the definition - */ - WithCreate withDataFromVhd(String vhdUrl); - - /** - * Specifies the source data VHD and the storage account ID. - * - * @param vhdUrl a source VHD URL - * @param storageAccountId the storage account ID - * @return the next stage of the definition - */ - WithCreate withDataFromVhd(String vhdUrl, String storageAccountId); - } - - /** The stage of the managed disk definition allowing to choose managed disk containing data. */ - interface WithDataSnapshotFromDisk { - /** - * Specifies the ID of source data managed disk. - * - * @param managedDiskId source managed disk resource ID - * @return the next stage of the definition - */ - WithCreate withDataFromDisk(String managedDiskId); - - /** - * Specifies the source data managed disk. - * - * @param managedDisk a source managed disk - * @return the next stage of the definition - */ - WithCreate withDataFromDisk(Disk managedDisk); - } - - /** The stage of the managed disk definition allowing to choose managed snapshot containing data. */ - interface WithDataSnapshotFromSnapshot { - /** - * Specifies the source data managed snapshot. - * - * @param snapshotId a snapshot resource ID - * @return the next stage of the definition - */ - WithCreate withDataFromSnapshot(String snapshotId); - - /** - * Specifies the source data managed snapshot. - * - * @param snapshot a snapshot resource - * @return the next stage of the definition - */ - WithCreate withDataFromSnapshot(Snapshot snapshot); - } - - /** The stage of the managed disk definition allowing to choose a source operating system image. */ - interface WithOSSnapshotFromImage { - /** - * Specifies an image containing an operating system. - * - * @param imageId image resource ID - * @param osType operating system type - * @return the next stage of the definition - */ - WithCreate fromImage(String imageId, OperatingSystemTypes osType); - - /** - * Specifies an image containing an operating system. - * - * @param image the image - * @return the next stage of the definition - */ - WithCreate fromImage(VirtualMachineImage image); - - /** - * Specifies a custom image containing an operating system. - * - * @param image the image - * @return the next stage of the definition - */ - WithCreate fromImage(VirtualMachineCustomImage image); - } - /** The stage of the managed disk definition allowing to choose source data disk image. */ - interface WithDataSnapshotFromImage { - /** - * Specifies an image containing source data disk image. - * - * @param imageId an image resource ID - * @param diskLun LUN of the disk image - * @return the next stage of the definition - */ - WithCreate fromImage(String imageId, int diskLun); - - /** - * Specifies an image containing a source data disk image. - * - * @param image an image - * @param diskLun LUN of the disk image - * @return the next stage of the definition - */ - WithCreate fromImage(VirtualMachineImage image, int diskLun); - - /** - * Specifies a custom image containing a source data disk image. - * - * @param image the image - * @param diskLun LUN of the disk image - * @return the next stage of the definition - */ - WithCreate fromImage(VirtualMachineCustomImage image, int diskLun); - } - - /** The stage of the managed snapshot allowing to specify the size. */ - interface WithSize { - /** - * Specifies the disk size. - * - * @param sizeInGB the disk size in GB - * @return the next stage of the definition - */ - WithCreate withSizeInGB(int sizeInGB); - } - - /** The stage of the managed snapshot allowing to specify incremental snapshot. */ - interface WithIncremental { - /** - * Specifies whether a snapshot is incremental. - * - * @param enabled whether to enable incremental snapshot - * @return the next stage of the definition - */ - WithCreate withIncremental(boolean enabled); - } - - /** The stage of the snapshot definition allowing to choose account type. */ - interface WithSku { - /** - * Specifies the SKU type. - * - * @param sku SKU type - * @return the next stage of the definition - */ - WithCreate withSku(SnapshotSkuType sku); - } - - /** - * The stage of the definition which contains all the minimum required inputs for the resource to be created, - * but also allows for any other optional settings to be specified. - */ - interface WithCreate - extends Creatable, - Resource.DefinitionWithTags, - WithSize, - WithSku, - WithIncremental { - } - } - - /** Grouping of managed snapshot update stages. */ - interface UpdateStages { - /** The stage of the managed snapshot update allowing to choose account type. */ - interface WithSku { - /** - * Specifies the SKU type. - * - * @param sku SKU type - * @return the next stage of the update - */ - Update withSku(SnapshotSkuType sku); - } - - /** The stage of the managed snapshot update allowing to specify OS settings. */ - interface WithOSSettings { - /** - * Specifies the operating system type. - * - * @param osType operating system type - * @return the next stage of the update - */ - Update withOSType(OperatingSystemTypes osType); - } - } - - /** The template for an update operation, containing all the settings that can be modified. */ - interface Update - extends Appliable, - Resource.UpdateWithTags, - UpdateStages.WithSku, - UpdateStages.WithOSSettings { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/SnapshotList.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/SnapshotList.java deleted file mode 100644 index 92633ac22454..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/SnapshotList.java +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.fluent.models.SnapshotInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The List Snapshots operation response. */ -@Fluent -public final class SnapshotList { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SnapshotList.class); - - /* - * A list of snapshots. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * The uri to fetch the next page of snapshots. Call ListNext() with this - * to fetch the next page of snapshots. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: A list of snapshots. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: A list of snapshots. - * - * @param value the value value to set. - * @return the SnapshotList object itself. - */ - public SnapshotList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The uri to fetch the next page of snapshots. Call ListNext() with this to fetch the - * next page of snapshots. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The uri to fetch the next page of snapshots. Call ListNext() with this to fetch the - * next page of snapshots. - * - * @param nextLink the nextLink value to set. - * @return the SnapshotList object itself. - */ - public SnapshotList withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model SnapshotList")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/SnapshotSku.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/SnapshotSku.java deleted file mode 100644 index d377ff381cb8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/SnapshotSku.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The snapshots sku name. Can be Standard_LRS, Premium_LRS, or Standard_ZRS. */ -@Fluent -public final class SnapshotSku { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SnapshotSku.class); - - /* - * The sku name. - */ - @JsonProperty(value = "name") - private SnapshotStorageAccountTypes name; - - /* - * The sku tier. - */ - @JsonProperty(value = "tier", access = JsonProperty.Access.WRITE_ONLY) - private String tier; - - /** - * Get the name property: The sku name. - * - * @return the name value. - */ - public SnapshotStorageAccountTypes name() { - return this.name; - } - - /** - * Set the name property: The sku name. - * - * @param name the name value to set. - * @return the SnapshotSku object itself. - */ - public SnapshotSku withName(SnapshotStorageAccountTypes name) { - this.name = name; - return this; - } - - /** - * Get the tier property: The sku tier. - * - * @return the tier value. - */ - public String tier() { - return this.tier; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/SnapshotSkuType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/SnapshotSkuType.java deleted file mode 100644 index ee44cf3aba0f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/SnapshotSkuType.java +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.models; - -import java.util.Collection; -import java.util.HashMap; -import java.util.Locale; -import java.util.Map; - -/** Defines values for SnapshotSkuType. */ -public final class SnapshotSkuType { - - private static final Map VALUES_BY_NAME = new HashMap<>(); - - /** Static value STANDARD_LRS for SnapshotSkuType. */ - public static final SnapshotSkuType STANDARD_LRS = new SnapshotSkuType(SnapshotStorageAccountTypes.STANDARD_LRS); - - /** Static value PREMIUM_LRS for SnapshotSkuType. */ - public static final SnapshotSkuType PREMIUM_LRS = new SnapshotSkuType(SnapshotStorageAccountTypes.PREMIUM_LRS); - - /** Static value STANDARD_ZRS for SnapshotSkuType. */ - public static final SnapshotSkuType STANDARD_ZRS = new SnapshotSkuType(SnapshotStorageAccountTypes.STANDARD_ZRS); - - /** The actual serialized value for a SnapshotSkuType instance. */ - private final SnapshotStorageAccountTypes value; - - /** @return predefined snapshot SKU types */ - public static SnapshotSkuType[] values() { - Collection valuesCollection = VALUES_BY_NAME.values(); - return valuesCollection.toArray(new SnapshotSkuType[valuesCollection.size()]); - } - - /** - * Creates a custom value for SnapshotSkuType. - * - * @param value the custom value - */ - private SnapshotSkuType(SnapshotStorageAccountTypes value) { - this.value = value; - if (value != null) { - VALUES_BY_NAME.put(value.toString().toLowerCase(Locale.ROOT), this); - } - } - - /** - * Parses a value into a snapshot SKU type and creates a new SnapshotSkuType instance if not found among the - * existing ones. - * - * @param value a snapshot SKU type name - * @return the parsed or created snapshot SKU type - */ - public static SnapshotSkuType fromStorageAccountType(SnapshotStorageAccountTypes value) { - if (value == null) { - return null; - } - - SnapshotSkuType result = VALUES_BY_NAME.get(value.toString().toLowerCase(Locale.ROOT)); - if (result != null) { - return result; - } else { - return new SnapshotSkuType(value); - } - } - - /** - * Parses a value into a snapshot SKU type and creates a new SnapshotSkuType instance if not found among the - * existing ones. - * - * @param snapshotSku a snapshot SKU type name - * @return the parsed or created snapshot SKU type - */ - public static SnapshotSkuType fromSnapshotSku(SnapshotSku snapshotSku) { - if (snapshotSku == null || snapshotSku.name() == null) { - return null; - } else { - return fromStorageAccountType(snapshotSku.name()); - } - } - - /** @return the account type associated with the SKU. */ - public SnapshotStorageAccountTypes accountType() { - return this.value; - } - - @Override - public int hashCode() { - return value.hashCode(); - } - - @Override - public boolean equals(Object obj) { - if (!(obj instanceof SnapshotSkuType)) { - return false; - } else if (obj == this) { - return true; - } else if (value == null) { - return ((SnapshotSkuType) obj).value == null; - } else { - return value.equals(((SnapshotSkuType) obj).value); - } - } - - @Override - public String toString() { - return value.toString(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/SnapshotStorageAccountTypes.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/SnapshotStorageAccountTypes.java deleted file mode 100644 index 6412ae870e55..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/SnapshotStorageAccountTypes.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for SnapshotStorageAccountTypes. */ -public final class SnapshotStorageAccountTypes extends ExpandableStringEnum { - /** Static value Standard_LRS for SnapshotStorageAccountTypes. */ - public static final SnapshotStorageAccountTypes STANDARD_LRS = fromString("Standard_LRS"); - - /** Static value Premium_LRS for SnapshotStorageAccountTypes. */ - public static final SnapshotStorageAccountTypes PREMIUM_LRS = fromString("Premium_LRS"); - - /** Static value Standard_ZRS for SnapshotStorageAccountTypes. */ - public static final SnapshotStorageAccountTypes STANDARD_ZRS = fromString("Standard_ZRS"); - - /** - * Creates or finds a SnapshotStorageAccountTypes from its string representation. - * - * @param name a name to look for. - * @return the corresponding SnapshotStorageAccountTypes. - */ - @JsonCreator - public static SnapshotStorageAccountTypes fromString(String name) { - return fromString(name, SnapshotStorageAccountTypes.class); - } - - /** @return known SnapshotStorageAccountTypes values. */ - public static Collection values() { - return values(SnapshotStorageAccountTypes.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/SnapshotUpdate.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/SnapshotUpdate.java deleted file mode 100644 index fb7981af460b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/SnapshotUpdate.java +++ /dev/null @@ -1,204 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.fluent.models.SnapshotUpdateProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** Snapshot update resource. */ -@Fluent -public final class SnapshotUpdate { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SnapshotUpdate.class); - - /* - * Snapshot resource update properties. - */ - @JsonProperty(value = "properties") - private SnapshotUpdateProperties innerProperties; - - /* - * Resource tags - */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map tags; - - /* - * The snapshots sku name. Can be Standard_LRS, Premium_LRS, or - * Standard_ZRS. - */ - @JsonProperty(value = "sku") - private SnapshotSku sku; - - /** - * Get the innerProperties property: Snapshot resource update properties. - * - * @return the innerProperties value. - */ - private SnapshotUpdateProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Resource tags. - * - * @param tags the tags value to set. - * @return the SnapshotUpdate object itself. - */ - public SnapshotUpdate withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Get the sku property: The snapshots sku name. Can be Standard_LRS, Premium_LRS, or Standard_ZRS. - * - * @return the sku value. - */ - public SnapshotSku sku() { - return this.sku; - } - - /** - * Set the sku property: The snapshots sku name. Can be Standard_LRS, Premium_LRS, or Standard_ZRS. - * - * @param sku the sku value to set. - * @return the SnapshotUpdate object itself. - */ - public SnapshotUpdate withSku(SnapshotSku sku) { - this.sku = sku; - return this; - } - - /** - * Get the osType property: the Operating System type. - * - * @return the osType value. - */ - public OperatingSystemTypes osType() { - return this.innerProperties() == null ? null : this.innerProperties().osType(); - } - - /** - * Set the osType property: the Operating System type. - * - * @param osType the osType value to set. - * @return the SnapshotUpdate object itself. - */ - public SnapshotUpdate withOsType(OperatingSystemTypes osType) { - if (this.innerProperties() == null) { - this.innerProperties = new SnapshotUpdateProperties(); - } - this.innerProperties().withOsType(osType); - return this; - } - - /** - * Get the diskSizeGB property: If creationData.createOption is Empty, this field is mandatory and it indicates the - * size of the disk to create. If this field is present for updates or creation with other options, it indicates a - * resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's - * size. - * - * @return the diskSizeGB value. - */ - public Integer diskSizeGB() { - return this.innerProperties() == null ? null : this.innerProperties().diskSizeGB(); - } - - /** - * Set the diskSizeGB property: If creationData.createOption is Empty, this field is mandatory and it indicates the - * size of the disk to create. If this field is present for updates or creation with other options, it indicates a - * resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's - * size. - * - * @param diskSizeGB the diskSizeGB value to set. - * @return the SnapshotUpdate object itself. - */ - public SnapshotUpdate withDiskSizeGB(Integer diskSizeGB) { - if (this.innerProperties() == null) { - this.innerProperties = new SnapshotUpdateProperties(); - } - this.innerProperties().withDiskSizeGB(diskSizeGB); - return this; - } - - /** - * Get the encryptionSettingsCollection property: Encryption settings collection used be Azure Disk Encryption, can - * contain multiple encryption settings per disk or snapshot. - * - * @return the encryptionSettingsCollection value. - */ - public EncryptionSettingsCollection encryptionSettingsCollection() { - return this.innerProperties() == null ? null : this.innerProperties().encryptionSettingsCollection(); - } - - /** - * Set the encryptionSettingsCollection property: Encryption settings collection used be Azure Disk Encryption, can - * contain multiple encryption settings per disk or snapshot. - * - * @param encryptionSettingsCollection the encryptionSettingsCollection value to set. - * @return the SnapshotUpdate object itself. - */ - public SnapshotUpdate withEncryptionSettingsCollection(EncryptionSettingsCollection encryptionSettingsCollection) { - if (this.innerProperties() == null) { - this.innerProperties = new SnapshotUpdateProperties(); - } - this.innerProperties().withEncryptionSettingsCollection(encryptionSettingsCollection); - return this; - } - - /** - * Get the encryption property: Encryption property can be used to encrypt data at rest with customer managed keys - * or platform managed keys. - * - * @return the encryption value. - */ - public Encryption encryption() { - return this.innerProperties() == null ? null : this.innerProperties().encryption(); - } - - /** - * Set the encryption property: Encryption property can be used to encrypt data at rest with customer managed keys - * or platform managed keys. - * - * @param encryption the encryption value to set. - * @return the SnapshotUpdate object itself. - */ - public SnapshotUpdate withEncryption(Encryption encryption) { - if (this.innerProperties() == null) { - this.innerProperties = new SnapshotUpdateProperties(); - } - this.innerProperties().withEncryption(encryption); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - if (sku() != null) { - sku().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/Snapshots.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/Snapshots.java deleted file mode 100644 index 1849503a8fe9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/Snapshots.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.compute.ComputeManager; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsBatchDeletion; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsDeletingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsListingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsBatchCreation; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsCreating; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingById; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; -import reactor.core.publisher.Mono; - -/** Entry point to managed snapshot management API in Azure. */ -@Fluent -public interface Snapshots - extends SupportsCreating, - SupportsListing, - SupportsListingByResourceGroup, - SupportsGettingByResourceGroup, - SupportsGettingById, - SupportsDeletingById, - SupportsDeletingByResourceGroup, - SupportsBatchCreation, - SupportsBatchDeletion, - HasManager { - /** - * Grants access to the snapshot asynchronously. - * - * @param resourceGroupName the resource group name - * @param snapshotName the snapshot name - * @param accessLevel access level - * @param accessDuration access duration - * @return a representation of the deferred computation of this call returning a read-only SAS URI to the snapshot - */ - Mono grantAccessAsync( - String resourceGroupName, String snapshotName, AccessLevel accessLevel, int accessDuration); - - /** - * Grants access to a snapshot. - * - * @param resourceGroupName the resource group name - * @param snapshotName the snapshot name - * @param accessLevel access level - * @param accessDuration access duration - * @return the read-only SAS URI to the snapshot - */ - String grantAccess(String resourceGroupName, String snapshotName, AccessLevel accessLevel, int accessDuration); - - /** - * Revoke access granted to the snapshot asynchronously. - * - * @param resourceGroupName the resource group name - * @param snapName the snapshot name - * @return a representation of the deferred computation of this call - */ - Mono revokeAccessAsync(String resourceGroupName, String snapName); - - /** - * Revoke access granted to a snapshot. - * - * @param resourceGroupName the resource group name - * @param snapName the snapshot name - */ - void revokeAccess(String resourceGroupName, String snapName); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/SoftwareUpdateRebootBehavior.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/SoftwareUpdateRebootBehavior.java deleted file mode 100644 index 532a8b6f3123..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/SoftwareUpdateRebootBehavior.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for SoftwareUpdateRebootBehavior. */ -public final class SoftwareUpdateRebootBehavior extends ExpandableStringEnum { - /** Static value NeverReboots for SoftwareUpdateRebootBehavior. */ - public static final SoftwareUpdateRebootBehavior NEVER_REBOOTS = fromString("NeverReboots"); - - /** Static value AlwaysRequiresReboot for SoftwareUpdateRebootBehavior. */ - public static final SoftwareUpdateRebootBehavior ALWAYS_REQUIRES_REBOOT = fromString("AlwaysRequiresReboot"); - - /** Static value CanRequestReboot for SoftwareUpdateRebootBehavior. */ - public static final SoftwareUpdateRebootBehavior CAN_REQUEST_REBOOT = fromString("CanRequestReboot"); - - /** - * Creates or finds a SoftwareUpdateRebootBehavior from its string representation. - * - * @param name a name to look for. - * @return the corresponding SoftwareUpdateRebootBehavior. - */ - @JsonCreator - public static SoftwareUpdateRebootBehavior fromString(String name) { - return fromString(name, SoftwareUpdateRebootBehavior.class); - } - - /** @return known SoftwareUpdateRebootBehavior values. */ - public static Collection values() { - return values(SoftwareUpdateRebootBehavior.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/SourceVault.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/SourceVault.java deleted file mode 100644 index 526e89a0542a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/SourceVault.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * The vault id is an Azure Resource Manager Resource id in the form - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}. - */ -@Fluent -public final class SourceVault { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SourceVault.class); - - /* - * Resource Id - */ - @JsonProperty(value = "id") - private String id; - - /** - * Get the id property: Resource Id. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: Resource Id. - * - * @param id the id value to set. - * @return the SourceVault object itself. - */ - public SourceVault withId(String id) { - this.id = id; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/SshConfiguration.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/SshConfiguration.java deleted file mode 100644 index 630397436af4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/SshConfiguration.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** SSH configuration for Linux based VMs running on Azure. */ -@Fluent -public final class SshConfiguration { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SshConfiguration.class); - - /* - * The list of SSH public keys used to authenticate with linux based VMs. - */ - @JsonProperty(value = "publicKeys") - private List publicKeys; - - /** - * Get the publicKeys property: The list of SSH public keys used to authenticate with linux based VMs. - * - * @return the publicKeys value. - */ - public List publicKeys() { - return this.publicKeys; - } - - /** - * Set the publicKeys property: The list of SSH public keys used to authenticate with linux based VMs. - * - * @param publicKeys the publicKeys value to set. - * @return the SshConfiguration object itself. - */ - public SshConfiguration withPublicKeys(List publicKeys) { - this.publicKeys = publicKeys; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (publicKeys() != null) { - publicKeys().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/SshPublicKey.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/SshPublicKey.java deleted file mode 100644 index c8220436e8a2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/SshPublicKey.java +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Contains information about SSH certificate public key and the path on the Linux VM where the public key is placed. - */ -@Fluent -public final class SshPublicKey { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SshPublicKey.class); - - /* - * Specifies the full path on the created VM where ssh public key is - * stored. If the file already exists, the specified key is appended to the - * file. Example: /home/user/.ssh/authorized_keys - */ - @JsonProperty(value = "path") - private String path; - - /* - * SSH public key certificate used to authenticate with the VM through ssh. - * The key needs to be at least 2048-bit and in ssh-rsa format.

    - * For creating ssh keys, see [Create SSH keys on Linux and Mac for Linux - * VMs in - * Azure](https://docs.microsoft.com/en-us/azure/virtual-machines/linux/mac-create-ssh-keys?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). - */ - @JsonProperty(value = "keyData") - private String keyData; - - /** - * Get the path property: Specifies the full path on the created VM where ssh public key is stored. If the file - * already exists, the specified key is appended to the file. Example: /home/user/.ssh/authorized_keys. - * - * @return the path value. - */ - public String path() { - return this.path; - } - - /** - * Set the path property: Specifies the full path on the created VM where ssh public key is stored. If the file - * already exists, the specified key is appended to the file. Example: /home/user/.ssh/authorized_keys. - * - * @param path the path value to set. - * @return the SshPublicKey object itself. - */ - public SshPublicKey withPath(String path) { - this.path = path; - return this; - } - - /** - * Get the keyData property: SSH public key certificate used to authenticate with the VM through ssh. The key needs - * to be at least 2048-bit and in ssh-rsa format. <br><br> For creating ssh keys, see [Create SSH keys - * on Linux and Mac for Linux VMs in - * Azure](https://docs.microsoft.com/en-us/azure/virtual-machines/linux/mac-create-ssh-keys?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). - * - * @return the keyData value. - */ - public String keyData() { - return this.keyData; - } - - /** - * Set the keyData property: SSH public key certificate used to authenticate with the VM through ssh. The key needs - * to be at least 2048-bit and in ssh-rsa format. <br><br> For creating ssh keys, see [Create SSH keys - * on Linux and Mac for Linux VMs in - * Azure](https://docs.microsoft.com/en-us/azure/virtual-machines/linux/mac-create-ssh-keys?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). - * - * @param keyData the keyData value to set. - * @return the SshPublicKey object itself. - */ - public SshPublicKey withKeyData(String keyData) { - this.keyData = keyData; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/SshPublicKeyUpdateResource.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/SshPublicKeyUpdateResource.java deleted file mode 100644 index 659d282c44b9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/SshPublicKeyUpdateResource.java +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.fluent.models.SshPublicKeyResourceProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** Specifies information about the SSH public key. */ -@Fluent -public final class SshPublicKeyUpdateResource extends UpdateResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SshPublicKeyUpdateResource.class); - - /* - * Properties of the SSH public key. - */ - @JsonProperty(value = "properties") - private SshPublicKeyResourceProperties innerProperties; - - /** - * Get the innerProperties property: Properties of the SSH public key. - * - * @return the innerProperties value. - */ - private SshPublicKeyResourceProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public SshPublicKeyUpdateResource withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the publicKey property: SSH public key used to authenticate to a virtual machine through ssh. If this - * property is not initially provided when the resource is created, the publicKey property will be populated when - * generateKeyPair is called. If the public key is provided upon resource creation, the provided public key needs to - * be at least 2048-bit and in ssh-rsa format. - * - * @return the publicKey value. - */ - public String publicKey() { - return this.innerProperties() == null ? null : this.innerProperties().publicKey(); - } - - /** - * Set the publicKey property: SSH public key used to authenticate to a virtual machine through ssh. If this - * property is not initially provided when the resource is created, the publicKey property will be populated when - * generateKeyPair is called. If the public key is provided upon resource creation, the provided public key needs to - * be at least 2048-bit and in ssh-rsa format. - * - * @param publicKey the publicKey value to set. - * @return the SshPublicKeyUpdateResource object itself. - */ - public SshPublicKeyUpdateResource withPublicKey(String publicKey) { - if (this.innerProperties() == null) { - this.innerProperties = new SshPublicKeyResourceProperties(); - } - this.innerProperties().withPublicKey(publicKey); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/SshPublicKeysGroupListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/SshPublicKeysGroupListResult.java deleted file mode 100644 index 140e885b78d6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/SshPublicKeysGroupListResult.java +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.fluent.models.SshPublicKeyResourceInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The list SSH public keys operation response. */ -@Fluent -public final class SshPublicKeysGroupListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SshPublicKeysGroupListResult.class); - - /* - * The list of SSH public keys - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * The URI to fetch the next page of SSH public keys. Call ListNext() with - * this URI to fetch the next page of SSH public keys. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: The list of SSH public keys. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The list of SSH public keys. - * - * @param value the value value to set. - * @return the SshPublicKeysGroupListResult object itself. - */ - public SshPublicKeysGroupListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URI to fetch the next page of SSH public keys. Call ListNext() with this URI to - * fetch the next page of SSH public keys. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The URI to fetch the next page of SSH public keys. Call ListNext() with this URI to - * fetch the next page of SSH public keys. - * - * @param nextLink the nextLink value to set. - * @return the SshPublicKeysGroupListResult object itself. - */ - public SshPublicKeysGroupListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property value in model SshPublicKeysGroupListResult")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/StatusLevelTypes.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/StatusLevelTypes.java deleted file mode 100644 index 75098505446c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/StatusLevelTypes.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for StatusLevelTypes. */ -public enum StatusLevelTypes { - /** Enum value Info. */ - INFO("Info"), - - /** Enum value Warning. */ - WARNING("Warning"), - - /** Enum value Error. */ - ERROR("Error"); - - /** The actual serialized value for a StatusLevelTypes instance. */ - private final String value; - - StatusLevelTypes(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a StatusLevelTypes instance. - * - * @param value the serialized value to parse. - * @return the parsed StatusLevelTypes object, or null if unable to parse. - */ - @JsonCreator - public static StatusLevelTypes fromString(String value) { - StatusLevelTypes[] items = StatusLevelTypes.values(); - for (StatusLevelTypes item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/StorageAccountType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/StorageAccountType.java deleted file mode 100644 index 6b468d8004ea..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/StorageAccountType.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for StorageAccountType. */ -public final class StorageAccountType extends ExpandableStringEnum { - /** Static value Standard_LRS for StorageAccountType. */ - public static final StorageAccountType STANDARD_LRS = fromString("Standard_LRS"); - - /** Static value Standard_ZRS for StorageAccountType. */ - public static final StorageAccountType STANDARD_ZRS = fromString("Standard_ZRS"); - - /** Static value Premium_LRS for StorageAccountType. */ - public static final StorageAccountType PREMIUM_LRS = fromString("Premium_LRS"); - - /** - * Creates or finds a StorageAccountType from its string representation. - * - * @param name a name to look for. - * @return the corresponding StorageAccountType. - */ - @JsonCreator - public static StorageAccountType fromString(String name) { - return fromString(name, StorageAccountType.class); - } - - /** @return known StorageAccountType values. */ - public static Collection values() { - return values(StorageAccountType.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/StorageAccountTypes.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/StorageAccountTypes.java deleted file mode 100644 index 5a8c12606edb..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/StorageAccountTypes.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for StorageAccountTypes. */ -public final class StorageAccountTypes extends ExpandableStringEnum { - /** Static value Standard_LRS for StorageAccountTypes. */ - public static final StorageAccountTypes STANDARD_LRS = fromString("Standard_LRS"); - - /** Static value Premium_LRS for StorageAccountTypes. */ - public static final StorageAccountTypes PREMIUM_LRS = fromString("Premium_LRS"); - - /** Static value StandardSSD_LRS for StorageAccountTypes. */ - public static final StorageAccountTypes STANDARD_SSD_LRS = fromString("StandardSSD_LRS"); - - /** Static value UltraSSD_LRS for StorageAccountTypes. */ - public static final StorageAccountTypes ULTRA_SSD_LRS = fromString("UltraSSD_LRS"); - - /** - * Creates or finds a StorageAccountTypes from its string representation. - * - * @param name a name to look for. - * @return the corresponding StorageAccountTypes. - */ - @JsonCreator - public static StorageAccountTypes fromString(String name) { - return fromString(name, StorageAccountTypes.class); - } - - /** @return known StorageAccountTypes values. */ - public static Collection values() { - return values(StorageAccountTypes.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/StorageProfile.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/StorageProfile.java deleted file mode 100644 index 808a52ead87e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/StorageProfile.java +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Specifies the storage settings for the virtual machine disks. */ -@Fluent -public final class StorageProfile { - @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageProfile.class); - - /* - * Specifies information about the image to use. You can specify - * information about platform images, marketplace images, or virtual - * machine images. This element is required when you want to use a platform - * image, marketplace image, or virtual machine image, but is not used in - * other creation operations. - */ - @JsonProperty(value = "imageReference") - private ImageReference imageReference; - - /* - * Specifies information about the operating system disk used by the - * virtual machine.

    For more information about disks, see [About - * disks and VHDs for Azure virtual - * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). - */ - @JsonProperty(value = "osDisk") - private OSDisk osDisk; - - /* - * Specifies the parameters that are used to add a data disk to a virtual - * machine.

    For more information about disks, see [About disks and - * VHDs for Azure virtual - * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). - */ - @JsonProperty(value = "dataDisks") - private List dataDisks; - - /** - * Get the imageReference property: Specifies information about the image to use. You can specify information about - * platform images, marketplace images, or virtual machine images. This element is required when you want to use a - * platform image, marketplace image, or virtual machine image, but is not used in other creation operations. - * - * @return the imageReference value. - */ - public ImageReference imageReference() { - return this.imageReference; - } - - /** - * Set the imageReference property: Specifies information about the image to use. You can specify information about - * platform images, marketplace images, or virtual machine images. This element is required when you want to use a - * platform image, marketplace image, or virtual machine image, but is not used in other creation operations. - * - * @param imageReference the imageReference value to set. - * @return the StorageProfile object itself. - */ - public StorageProfile withImageReference(ImageReference imageReference) { - this.imageReference = imageReference; - return this; - } - - /** - * Get the osDisk property: Specifies information about the operating system disk used by the virtual machine. - * <br><br> For more information about disks, see [About disks and VHDs for Azure virtual - * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). - * - * @return the osDisk value. - */ - public OSDisk osDisk() { - return this.osDisk; - } - - /** - * Set the osDisk property: Specifies information about the operating system disk used by the virtual machine. - * <br><br> For more information about disks, see [About disks and VHDs for Azure virtual - * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). - * - * @param osDisk the osDisk value to set. - * @return the StorageProfile object itself. - */ - public StorageProfile withOsDisk(OSDisk osDisk) { - this.osDisk = osDisk; - return this; - } - - /** - * Get the dataDisks property: Specifies the parameters that are used to add a data disk to a virtual machine. - * <br><br> For more information about disks, see [About disks and VHDs for Azure virtual - * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). - * - * @return the dataDisks value. - */ - public List dataDisks() { - return this.dataDisks; - } - - /** - * Set the dataDisks property: Specifies the parameters that are used to add a data disk to a virtual machine. - * <br><br> For more information about disks, see [About disks and VHDs for Azure virtual - * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). - * - * @param dataDisks the dataDisks value to set. - * @return the StorageProfile object itself. - */ - public StorageProfile withDataDisks(List dataDisks) { - this.dataDisks = dataDisks; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (imageReference() != null) { - imageReference().validate(); - } - if (osDisk() != null) { - osDisk().validate(); - } - if (dataDisks() != null) { - dataDisks().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/SubResourceReadOnly.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/SubResourceReadOnly.java deleted file mode 100644 index 6b3f2ba1f1d2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/SubResourceReadOnly.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The SubResourceReadOnly model. */ -@Immutable -public class SubResourceReadOnly { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SubResourceReadOnly.class); - - /* - * Resource Id - */ - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) - private String id; - - /** - * Get the id property: Resource Id. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/SubResourceWithColocationStatus.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/SubResourceWithColocationStatus.java deleted file mode 100644 index 8d013117d63b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/SubResourceWithColocationStatus.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The SubResourceWithColocationStatus model. */ -@Fluent -public final class SubResourceWithColocationStatus extends SubResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SubResourceWithColocationStatus.class); - - /* - * Describes colocation status of a resource in the Proximity Placement - * Group. - */ - @JsonProperty(value = "colocationStatus") - private InstanceViewStatus colocationStatus; - - /** - * Get the colocationStatus property: Describes colocation status of a resource in the Proximity Placement Group. - * - * @return the colocationStatus value. - */ - public InstanceViewStatus colocationStatus() { - return this.colocationStatus; - } - - /** - * Set the colocationStatus property: Describes colocation status of a resource in the Proximity Placement Group. - * - * @param colocationStatus the colocationStatus value to set. - * @return the SubResourceWithColocationStatus object itself. - */ - public SubResourceWithColocationStatus withColocationStatus(InstanceViewStatus colocationStatus) { - this.colocationStatus = colocationStatus; - return this; - } - - /** {@inheritDoc} */ - @Override - public SubResourceWithColocationStatus withId(String id) { - super.withId(id); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (colocationStatus() != null) { - colocationStatus().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/TargetRegion.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/TargetRegion.java deleted file mode 100644 index fe9db848d854..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/TargetRegion.java +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describes the target region information. */ -@Fluent -public final class TargetRegion { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TargetRegion.class); - - /* - * The name of the region. - */ - @JsonProperty(value = "name", required = true) - private String name; - - /* - * The number of replicas of the Image Version to be created per region. - * This property is updatable. - */ - @JsonProperty(value = "regionalReplicaCount") - private Integer regionalReplicaCount; - - /* - * Specifies the storage account type to be used to store the image. This - * property is not updatable. - */ - @JsonProperty(value = "storageAccountType") - private StorageAccountType storageAccountType; - - /* - * Optional. Allows users to provide customer managed keys for encrypting - * the OS and data disks in the gallery artifact. - */ - @JsonProperty(value = "encryption") - private EncryptionImages encryption; - - /** - * Get the name property: The name of the region. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the region. - * - * @param name the name value to set. - * @return the TargetRegion object itself. - */ - public TargetRegion withName(String name) { - this.name = name; - return this; - } - - /** - * Get the regionalReplicaCount property: The number of replicas of the Image Version to be created per region. This - * property is updatable. - * - * @return the regionalReplicaCount value. - */ - public Integer regionalReplicaCount() { - return this.regionalReplicaCount; - } - - /** - * Set the regionalReplicaCount property: The number of replicas of the Image Version to be created per region. This - * property is updatable. - * - * @param regionalReplicaCount the regionalReplicaCount value to set. - * @return the TargetRegion object itself. - */ - public TargetRegion withRegionalReplicaCount(Integer regionalReplicaCount) { - this.regionalReplicaCount = regionalReplicaCount; - return this; - } - - /** - * Get the storageAccountType property: Specifies the storage account type to be used to store the image. This - * property is not updatable. - * - * @return the storageAccountType value. - */ - public StorageAccountType storageAccountType() { - return this.storageAccountType; - } - - /** - * Set the storageAccountType property: Specifies the storage account type to be used to store the image. This - * property is not updatable. - * - * @param storageAccountType the storageAccountType value to set. - * @return the TargetRegion object itself. - */ - public TargetRegion withStorageAccountType(StorageAccountType storageAccountType) { - this.storageAccountType = storageAccountType; - return this; - } - - /** - * Get the encryption property: Optional. Allows users to provide customer managed keys for encrypting the OS and - * data disks in the gallery artifact. - * - * @return the encryption value. - */ - public EncryptionImages encryption() { - return this.encryption; - } - - /** - * Set the encryption property: Optional. Allows users to provide customer managed keys for encrypting the OS and - * data disks in the gallery artifact. - * - * @param encryption the encryption value to set. - * @return the TargetRegion object itself. - */ - public TargetRegion withEncryption(EncryptionImages encryption) { - this.encryption = encryption; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property name in model TargetRegion")); - } - if (encryption() != null) { - encryption().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/TerminateNotificationProfile.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/TerminateNotificationProfile.java deleted file mode 100644 index b68e4f63edf8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/TerminateNotificationProfile.java +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The TerminateNotificationProfile model. */ -@Fluent -public final class TerminateNotificationProfile { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TerminateNotificationProfile.class); - - /* - * Configurable length of time a Virtual Machine being deleted will have to - * potentially approve the Terminate Scheduled Event before the event is - * auto approved (timed out). The configuration must be specified in ISO - * 8601 format, the default value is 5 minutes (PT5M) - */ - @JsonProperty(value = "notBeforeTimeout") - private String notBeforeTimeout; - - /* - * Specifies whether the Terminate Scheduled event is enabled or disabled. - */ - @JsonProperty(value = "enable") - private Boolean enable; - - /** - * Get the notBeforeTimeout property: Configurable length of time a Virtual Machine being deleted will have to - * potentially approve the Terminate Scheduled Event before the event is auto approved (timed out). The - * configuration must be specified in ISO 8601 format, the default value is 5 minutes (PT5M). - * - * @return the notBeforeTimeout value. - */ - public String notBeforeTimeout() { - return this.notBeforeTimeout; - } - - /** - * Set the notBeforeTimeout property: Configurable length of time a Virtual Machine being deleted will have to - * potentially approve the Terminate Scheduled Event before the event is auto approved (timed out). The - * configuration must be specified in ISO 8601 format, the default value is 5 minutes (PT5M). - * - * @param notBeforeTimeout the notBeforeTimeout value to set. - * @return the TerminateNotificationProfile object itself. - */ - public TerminateNotificationProfile withNotBeforeTimeout(String notBeforeTimeout) { - this.notBeforeTimeout = notBeforeTimeout; - return this; - } - - /** - * Get the enable property: Specifies whether the Terminate Scheduled event is enabled or disabled. - * - * @return the enable value. - */ - public Boolean enable() { - return this.enable; - } - - /** - * Set the enable property: Specifies whether the Terminate Scheduled event is enabled or disabled. - * - * @param enable the enable value to set. - * @return the TerminateNotificationProfile object itself. - */ - public TerminateNotificationProfile withEnable(Boolean enable) { - this.enable = enable; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ThrottledRequestsInput.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ThrottledRequestsInput.java deleted file mode 100644 index 36f409fdfc6f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ThrottledRequestsInput.java +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import java.time.OffsetDateTime; - -/** Api request input for LogAnalytics getThrottledRequests Api. */ -@Fluent -public final class ThrottledRequestsInput extends LogAnalyticsInputBase { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ThrottledRequestsInput.class); - - /** {@inheritDoc} */ - @Override - public ThrottledRequestsInput withBlobContainerSasUri(String blobContainerSasUri) { - super.withBlobContainerSasUri(blobContainerSasUri); - return this; - } - - /** {@inheritDoc} */ - @Override - public ThrottledRequestsInput withFromTime(OffsetDateTime fromTime) { - super.withFromTime(fromTime); - return this; - } - - /** {@inheritDoc} */ - @Override - public ThrottledRequestsInput withToTime(OffsetDateTime toTime) { - super.withToTime(toTime); - return this; - } - - /** {@inheritDoc} */ - @Override - public ThrottledRequestsInput withGroupByThrottlePolicy(Boolean groupByThrottlePolicy) { - super.withGroupByThrottlePolicy(groupByThrottlePolicy); - return this; - } - - /** {@inheritDoc} */ - @Override - public ThrottledRequestsInput withGroupByOperationName(Boolean groupByOperationName) { - super.withGroupByOperationName(groupByOperationName); - return this; - } - - /** {@inheritDoc} */ - @Override - public ThrottledRequestsInput withGroupByResourceName(Boolean groupByResourceName) { - super.withGroupByResourceName(groupByResourceName); - return this; - } - - /** {@inheritDoc} */ - @Override - public ThrottledRequestsInput withGroupByClientApplicationId(Boolean groupByClientApplicationId) { - super.withGroupByClientApplicationId(groupByClientApplicationId); - return this; - } - - /** {@inheritDoc} */ - @Override - public ThrottledRequestsInput withGroupByUserAgent(Boolean groupByUserAgent) { - super.withGroupByUserAgent(groupByUserAgent); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/UpdateResource.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/UpdateResource.java deleted file mode 100644 index d2dbdca280f9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/UpdateResource.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** The Update Resource model definition. */ -@Fluent -public class UpdateResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(UpdateResource.class); - - /* - * Resource tags - */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map tags; - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Resource tags. - * - * @param tags the tags value to set. - * @return the UpdateResource object itself. - */ - public UpdateResource withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/UpdateResourceDefinition.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/UpdateResourceDefinition.java deleted file mode 100644 index 690b4c2d3d2d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/UpdateResourceDefinition.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** The Update Resource model definition. */ -@Fluent -public class UpdateResourceDefinition extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(UpdateResourceDefinition.class); - - /* - * Resource tags - */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map tags; - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Resource tags. - * - * @param tags the tags value to set. - * @return the UpdateResourceDefinition object itself. - */ - public UpdateResourceDefinition withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/UpgradeMode.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/UpgradeMode.java deleted file mode 100644 index 6962e13f2954..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/UpgradeMode.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for UpgradeMode. */ -public enum UpgradeMode { - /** Enum value Automatic. */ - AUTOMATIC("Automatic"), - - /** Enum value Manual. */ - MANUAL("Manual"), - - /** Enum value Rolling. */ - ROLLING("Rolling"); - - /** The actual serialized value for a UpgradeMode instance. */ - private final String value; - - UpgradeMode(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a UpgradeMode instance. - * - * @param value the serialized value to parse. - * @return the parsed UpgradeMode object, or null if unable to parse. - */ - @JsonCreator - public static UpgradeMode fromString(String value) { - UpgradeMode[] items = UpgradeMode.values(); - for (UpgradeMode item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/UpgradeOperationHistoricalStatusInfoProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/UpgradeOperationHistoricalStatusInfoProperties.java deleted file mode 100644 index 092e253a751f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/UpgradeOperationHistoricalStatusInfoProperties.java +++ /dev/null @@ -1,130 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describes each OS upgrade on the Virtual Machine Scale Set. */ -@Immutable -public final class UpgradeOperationHistoricalStatusInfoProperties { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(UpgradeOperationHistoricalStatusInfoProperties.class); - - /* - * Information about the overall status of the upgrade operation. - */ - @JsonProperty(value = "runningStatus", access = JsonProperty.Access.WRITE_ONLY) - private UpgradeOperationHistoryStatus runningStatus; - - /* - * Counts of the VMs in each state. - */ - @JsonProperty(value = "progress", access = JsonProperty.Access.WRITE_ONLY) - private RollingUpgradeProgressInfo progress; - - /* - * Error Details for this upgrade if there are any. - */ - @JsonProperty(value = "error", access = JsonProperty.Access.WRITE_ONLY) - private ApiError error; - - /* - * Invoker of the Upgrade Operation - */ - @JsonProperty(value = "startedBy", access = JsonProperty.Access.WRITE_ONLY) - private UpgradeOperationInvoker startedBy; - - /* - * Image Reference details - */ - @JsonProperty(value = "targetImageReference", access = JsonProperty.Access.WRITE_ONLY) - private ImageReference targetImageReference; - - /* - * Information about OS rollback if performed - */ - @JsonProperty(value = "rollbackInfo", access = JsonProperty.Access.WRITE_ONLY) - private RollbackStatusInfo rollbackInfo; - - /** - * Get the runningStatus property: Information about the overall status of the upgrade operation. - * - * @return the runningStatus value. - */ - public UpgradeOperationHistoryStatus runningStatus() { - return this.runningStatus; - } - - /** - * Get the progress property: Counts of the VMs in each state. - * - * @return the progress value. - */ - public RollingUpgradeProgressInfo progress() { - return this.progress; - } - - /** - * Get the error property: Error Details for this upgrade if there are any. - * - * @return the error value. - */ - public ApiError error() { - return this.error; - } - - /** - * Get the startedBy property: Invoker of the Upgrade Operation. - * - * @return the startedBy value. - */ - public UpgradeOperationInvoker startedBy() { - return this.startedBy; - } - - /** - * Get the targetImageReference property: Image Reference details. - * - * @return the targetImageReference value. - */ - public ImageReference targetImageReference() { - return this.targetImageReference; - } - - /** - * Get the rollbackInfo property: Information about OS rollback if performed. - * - * @return the rollbackInfo value. - */ - public RollbackStatusInfo rollbackInfo() { - return this.rollbackInfo; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (runningStatus() != null) { - runningStatus().validate(); - } - if (progress() != null) { - progress().validate(); - } - if (error() != null) { - error().validate(); - } - if (targetImageReference() != null) { - targetImageReference().validate(); - } - if (rollbackInfo() != null) { - rollbackInfo().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/UpgradeOperationHistoryStatus.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/UpgradeOperationHistoryStatus.java deleted file mode 100644 index 01602014714e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/UpgradeOperationHistoryStatus.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** Information about the current running state of the overall upgrade. */ -@Immutable -public final class UpgradeOperationHistoryStatus { - @JsonIgnore private final ClientLogger logger = new ClientLogger(UpgradeOperationHistoryStatus.class); - - /* - * Code indicating the current status of the upgrade. - */ - @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) - private UpgradeState code; - - /* - * Start time of the upgrade. - */ - @JsonProperty(value = "startTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime startTime; - - /* - * End time of the upgrade. - */ - @JsonProperty(value = "endTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime endTime; - - /** - * Get the code property: Code indicating the current status of the upgrade. - * - * @return the code value. - */ - public UpgradeState code() { - return this.code; - } - - /** - * Get the startTime property: Start time of the upgrade. - * - * @return the startTime value. - */ - public OffsetDateTime startTime() { - return this.startTime; - } - - /** - * Get the endTime property: End time of the upgrade. - * - * @return the endTime value. - */ - public OffsetDateTime endTime() { - return this.endTime; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/UpgradeOperationInvoker.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/UpgradeOperationInvoker.java deleted file mode 100644 index 0f866f57fe33..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/UpgradeOperationInvoker.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for UpgradeOperationInvoker. */ -public enum UpgradeOperationInvoker { - /** Enum value Unknown. */ - UNKNOWN("Unknown"), - - /** Enum value User. */ - USER("User"), - - /** Enum value Platform. */ - PLATFORM("Platform"); - - /** The actual serialized value for a UpgradeOperationInvoker instance. */ - private final String value; - - UpgradeOperationInvoker(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a UpgradeOperationInvoker instance. - * - * @param value the serialized value to parse. - * @return the parsed UpgradeOperationInvoker object, or null if unable to parse. - */ - @JsonCreator - public static UpgradeOperationInvoker fromString(String value) { - UpgradeOperationInvoker[] items = UpgradeOperationInvoker.values(); - for (UpgradeOperationInvoker item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/UpgradePolicy.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/UpgradePolicy.java deleted file mode 100644 index 4d727e7984b6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/UpgradePolicy.java +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describes an upgrade policy - automatic, manual, or rolling. */ -@Fluent -public final class UpgradePolicy { - @JsonIgnore private final ClientLogger logger = new ClientLogger(UpgradePolicy.class); - - /* - * Specifies the mode of an upgrade to virtual machines in the scale - * set.

    Possible values are:

    **Manual** - You - * control the application of updates to virtual machines in the scale set. - * You do this by using the manualUpgrade action.

    **Automatic** - * - All virtual machines in the scale set are automatically updated at - * the same time. - */ - @JsonProperty(value = "mode") - private UpgradeMode mode; - - /* - * The configuration parameters used while performing a rolling upgrade. - */ - @JsonProperty(value = "rollingUpgradePolicy") - private RollingUpgradePolicy rollingUpgradePolicy; - - /* - * Configuration parameters used for performing automatic OS Upgrade. - */ - @JsonProperty(value = "automaticOSUpgradePolicy") - private AutomaticOSUpgradePolicy automaticOSUpgradePolicy; - - /** - * Get the mode property: Specifies the mode of an upgrade to virtual machines in the scale set.<br /><br - * /> Possible values are:<br /><br /> **Manual** - You control the application of updates to virtual - * machines in the scale set. You do this by using the manualUpgrade action.<br /><br /> **Automatic** - - * All virtual machines in the scale set are automatically updated at the same time. - * - * @return the mode value. - */ - public UpgradeMode mode() { - return this.mode; - } - - /** - * Set the mode property: Specifies the mode of an upgrade to virtual machines in the scale set.<br /><br - * /> Possible values are:<br /><br /> **Manual** - You control the application of updates to virtual - * machines in the scale set. You do this by using the manualUpgrade action.<br /><br /> **Automatic** - - * All virtual machines in the scale set are automatically updated at the same time. - * - * @param mode the mode value to set. - * @return the UpgradePolicy object itself. - */ - public UpgradePolicy withMode(UpgradeMode mode) { - this.mode = mode; - return this; - } - - /** - * Get the rollingUpgradePolicy property: The configuration parameters used while performing a rolling upgrade. - * - * @return the rollingUpgradePolicy value. - */ - public RollingUpgradePolicy rollingUpgradePolicy() { - return this.rollingUpgradePolicy; - } - - /** - * Set the rollingUpgradePolicy property: The configuration parameters used while performing a rolling upgrade. - * - * @param rollingUpgradePolicy the rollingUpgradePolicy value to set. - * @return the UpgradePolicy object itself. - */ - public UpgradePolicy withRollingUpgradePolicy(RollingUpgradePolicy rollingUpgradePolicy) { - this.rollingUpgradePolicy = rollingUpgradePolicy; - return this; - } - - /** - * Get the automaticOSUpgradePolicy property: Configuration parameters used for performing automatic OS Upgrade. - * - * @return the automaticOSUpgradePolicy value. - */ - public AutomaticOSUpgradePolicy automaticOSUpgradePolicy() { - return this.automaticOSUpgradePolicy; - } - - /** - * Set the automaticOSUpgradePolicy property: Configuration parameters used for performing automatic OS Upgrade. - * - * @param automaticOSUpgradePolicy the automaticOSUpgradePolicy value to set. - * @return the UpgradePolicy object itself. - */ - public UpgradePolicy withAutomaticOSUpgradePolicy(AutomaticOSUpgradePolicy automaticOSUpgradePolicy) { - this.automaticOSUpgradePolicy = automaticOSUpgradePolicy; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (rollingUpgradePolicy() != null) { - rollingUpgradePolicy().validate(); - } - if (automaticOSUpgradePolicy() != null) { - automaticOSUpgradePolicy().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/UpgradeState.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/UpgradeState.java deleted file mode 100644 index 2cbd09b32d06..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/UpgradeState.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for UpgradeState. */ -public enum UpgradeState { - /** Enum value RollingForward. */ - ROLLING_FORWARD("RollingForward"), - - /** Enum value Cancelled. */ - CANCELLED("Cancelled"), - - /** Enum value Completed. */ - COMPLETED("Completed"), - - /** Enum value Faulted. */ - FAULTED("Faulted"); - - /** The actual serialized value for a UpgradeState instance. */ - private final String value; - - UpgradeState(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a UpgradeState instance. - * - * @param value the serialized value to parse. - * @return the parsed UpgradeState object, or null if unable to parse. - */ - @JsonCreator - public static UpgradeState fromString(String value) { - UpgradeState[] items = UpgradeState.values(); - for (UpgradeState item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/UsageName.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/UsageName.java deleted file mode 100644 index 290480918f57..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/UsageName.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The Usage Names. */ -@Fluent -public final class UsageName { - @JsonIgnore private final ClientLogger logger = new ClientLogger(UsageName.class); - - /* - * The name of the resource. - */ - @JsonProperty(value = "value") - private String value; - - /* - * The localized name of the resource. - */ - @JsonProperty(value = "localizedValue") - private String localizedValue; - - /** - * Get the value property: The name of the resource. - * - * @return the value value. - */ - public String value() { - return this.value; - } - - /** - * Set the value property: The name of the resource. - * - * @param value the value value to set. - * @return the UsageName object itself. - */ - public UsageName withValue(String value) { - this.value = value; - return this; - } - - /** - * Get the localizedValue property: The localized name of the resource. - * - * @return the localizedValue value. - */ - public String localizedValue() { - return this.localizedValue; - } - - /** - * Set the localizedValue property: The localized name of the resource. - * - * @param localizedValue the localizedValue value to set. - * @return the UsageName object itself. - */ - public UsageName withLocalizedValue(String localizedValue) { - this.localizedValue = localizedValue; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/UserArtifactManage.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/UserArtifactManage.java deleted file mode 100644 index 6e6e83e34ef4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/UserArtifactManage.java +++ /dev/null @@ -1,125 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The UserArtifactManage model. */ -@Fluent -public final class UserArtifactManage { - @JsonIgnore private final ClientLogger logger = new ClientLogger(UserArtifactManage.class); - - /* - * Required. The path and arguments to install the gallery application. - * This is limited to 4096 characters. - */ - @JsonProperty(value = "install", required = true) - private String install; - - /* - * Required. The path and arguments to remove the gallery application. This - * is limited to 4096 characters. - */ - @JsonProperty(value = "remove", required = true) - private String remove; - - /* - * Optional. The path and arguments to update the gallery application. If - * not present, then update operation will invoke remove command on the - * previous version and install command on the current version of the - * gallery application. This is limited to 4096 characters. - */ - @JsonProperty(value = "update") - private String update; - - /** - * Get the install property: Required. The path and arguments to install the gallery application. This is limited to - * 4096 characters. - * - * @return the install value. - */ - public String install() { - return this.install; - } - - /** - * Set the install property: Required. The path and arguments to install the gallery application. This is limited to - * 4096 characters. - * - * @param install the install value to set. - * @return the UserArtifactManage object itself. - */ - public UserArtifactManage withInstall(String install) { - this.install = install; - return this; - } - - /** - * Get the remove property: Required. The path and arguments to remove the gallery application. This is limited to - * 4096 characters. - * - * @return the remove value. - */ - public String remove() { - return this.remove; - } - - /** - * Set the remove property: Required. The path and arguments to remove the gallery application. This is limited to - * 4096 characters. - * - * @param remove the remove value to set. - * @return the UserArtifactManage object itself. - */ - public UserArtifactManage withRemove(String remove) { - this.remove = remove; - return this; - } - - /** - * Get the update property: Optional. The path and arguments to update the gallery application. If not present, then - * update operation will invoke remove command on the previous version and install command on the current version of - * the gallery application. This is limited to 4096 characters. - * - * @return the update value. - */ - public String update() { - return this.update; - } - - /** - * Set the update property: Optional. The path and arguments to update the gallery application. If not present, then - * update operation will invoke remove command on the previous version and install command on the current version of - * the gallery application. This is limited to 4096 characters. - * - * @param update the update value to set. - * @return the UserArtifactManage object itself. - */ - public UserArtifactManage withUpdate(String update) { - this.update = update; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (install() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property install in model UserArtifactManage")); - } - if (remove() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property remove in model UserArtifactManage")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/UserArtifactSource.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/UserArtifactSource.java deleted file mode 100644 index 487e06c5515f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/UserArtifactSource.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The source image from which the Image Version is going to be created. */ -@Fluent -public final class UserArtifactSource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(UserArtifactSource.class); - - /* - * Required. The mediaLink of the artifact, must be a readable storage page - * blob. - */ - @JsonProperty(value = "mediaLink", required = true) - private String mediaLink; - - /* - * Optional. The defaultConfigurationLink of the artifact, must be a - * readable storage page blob. - */ - @JsonProperty(value = "defaultConfigurationLink") - private String defaultConfigurationLink; - - /** - * Get the mediaLink property: Required. The mediaLink of the artifact, must be a readable storage page blob. - * - * @return the mediaLink value. - */ - public String mediaLink() { - return this.mediaLink; - } - - /** - * Set the mediaLink property: Required. The mediaLink of the artifact, must be a readable storage page blob. - * - * @param mediaLink the mediaLink value to set. - * @return the UserArtifactSource object itself. - */ - public UserArtifactSource withMediaLink(String mediaLink) { - this.mediaLink = mediaLink; - return this; - } - - /** - * Get the defaultConfigurationLink property: Optional. The defaultConfigurationLink of the artifact, must be a - * readable storage page blob. - * - * @return the defaultConfigurationLink value. - */ - public String defaultConfigurationLink() { - return this.defaultConfigurationLink; - } - - /** - * Set the defaultConfigurationLink property: Optional. The defaultConfigurationLink of the artifact, must be a - * readable storage page blob. - * - * @param defaultConfigurationLink the defaultConfigurationLink value to set. - * @return the UserArtifactSource object itself. - */ - public UserArtifactSource withDefaultConfigurationLink(String defaultConfigurationLink) { - this.defaultConfigurationLink = defaultConfigurationLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (mediaLink() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property mediaLink in model UserArtifactSource")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VMScaleSetConvertToSinglePlacementGroupInput.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VMScaleSetConvertToSinglePlacementGroupInput.java deleted file mode 100644 index f6658e907eb7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VMScaleSetConvertToSinglePlacementGroupInput.java +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The VMScaleSetConvertToSinglePlacementGroupInput model. */ -@Fluent -public final class VMScaleSetConvertToSinglePlacementGroupInput { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(VMScaleSetConvertToSinglePlacementGroupInput.class); - - /* - * Id of the placement group in which you want future virtual machine - * instances to be placed. To query placement group Id, please use Virtual - * Machine Scale Set VMs - Get API. If not provided, the platform will - * choose one with maximum number of virtual machine instances. - */ - @JsonProperty(value = "activePlacementGroupId") - private String activePlacementGroupId; - - /** - * Get the activePlacementGroupId property: Id of the placement group in which you want future virtual machine - * instances to be placed. To query placement group Id, please use Virtual Machine Scale Set VMs - Get API. If not - * provided, the platform will choose one with maximum number of virtual machine instances. - * - * @return the activePlacementGroupId value. - */ - public String activePlacementGroupId() { - return this.activePlacementGroupId; - } - - /** - * Set the activePlacementGroupId property: Id of the placement group in which you want future virtual machine - * instances to be placed. To query placement group Id, please use Virtual Machine Scale Set VMs - Get API. If not - * provided, the platform will choose one with maximum number of virtual machine instances. - * - * @param activePlacementGroupId the activePlacementGroupId value to set. - * @return the VMScaleSetConvertToSinglePlacementGroupInput object itself. - */ - public VMScaleSetConvertToSinglePlacementGroupInput withActivePlacementGroupId(String activePlacementGroupId) { - this.activePlacementGroupId = activePlacementGroupId; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VaultCertificate.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VaultCertificate.java deleted file mode 100644 index fc14cd93429f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VaultCertificate.java +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describes a single certificate reference in a Key Vault, and where the certificate should reside on the VM. */ -@Fluent -public final class VaultCertificate { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VaultCertificate.class); - - /* - * This is the URL of a certificate that has been uploaded to Key Vault as - * a secret. For adding a secret to the Key Vault, see [Add a key or secret - * to the key - * vault](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add). - * In this case, your certificate needs to be It is the Base64 encoding of - * the following JSON Object which is encoded in UTF-8:

    {
    - * "data":"",
    "dataType":"pfx",
    - * "password":""
    } - */ - @JsonProperty(value = "certificateUrl") - private String certificateUrl; - - /* - * For Windows VMs, specifies the certificate store on the Virtual Machine - * to which the certificate should be added. The specified certificate - * store is implicitly in the LocalMachine account.

    For Linux VMs, - * the certificate file is placed under the /var/lib/waagent directory, - * with the file name <UppercaseThumbprint>.crt for the X509 - * certificate file and <UppercaseThumbprint>.prv for private key. - * Both of these files are .pem formatted. - */ - @JsonProperty(value = "certificateStore") - private String certificateStore; - - /** - * Get the certificateUrl property: This is the URL of a certificate that has been uploaded to Key Vault as a - * secret. For adding a secret to the Key Vault, see [Add a key or secret to the key - * vault](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add). In this case, your certificate - * needs to be It is the Base64 encoding of the following JSON Object which is encoded in UTF-8: - * <br><br> {<br> "data":"<Base64-encoded-certificate>",<br> - * "dataType":"pfx",<br> "password":"<pfx-file-password>"<br>}. - * - * @return the certificateUrl value. - */ - public String certificateUrl() { - return this.certificateUrl; - } - - /** - * Set the certificateUrl property: This is the URL of a certificate that has been uploaded to Key Vault as a - * secret. For adding a secret to the Key Vault, see [Add a key or secret to the key - * vault](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add). In this case, your certificate - * needs to be It is the Base64 encoding of the following JSON Object which is encoded in UTF-8: - * <br><br> {<br> "data":"<Base64-encoded-certificate>",<br> - * "dataType":"pfx",<br> "password":"<pfx-file-password>"<br>}. - * - * @param certificateUrl the certificateUrl value to set. - * @return the VaultCertificate object itself. - */ - public VaultCertificate withCertificateUrl(String certificateUrl) { - this.certificateUrl = certificateUrl; - return this; - } - - /** - * Get the certificateStore property: For Windows VMs, specifies the certificate store on the Virtual Machine to - * which the certificate should be added. The specified certificate store is implicitly in the LocalMachine account. - * <br><br>For Linux VMs, the certificate file is placed under the /var/lib/waagent directory, with the - * file name &lt;UppercaseThumbprint&gt;.crt for the X509 certificate file and - * &lt;UppercaseThumbprint&gt;.prv for private key. Both of these files are .pem formatted. - * - * @return the certificateStore value. - */ - public String certificateStore() { - return this.certificateStore; - } - - /** - * Set the certificateStore property: For Windows VMs, specifies the certificate store on the Virtual Machine to - * which the certificate should be added. The specified certificate store is implicitly in the LocalMachine account. - * <br><br>For Linux VMs, the certificate file is placed under the /var/lib/waagent directory, with the - * file name &lt;UppercaseThumbprint&gt;.crt for the X509 certificate file and - * &lt;UppercaseThumbprint&gt;.prv for private key. Both of these files are .pem formatted. - * - * @param certificateStore the certificateStore value to set. - * @return the VaultCertificate object itself. - */ - public VaultCertificate withCertificateStore(String certificateStore) { - this.certificateStore = certificateStore; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VaultSecretGroup.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VaultSecretGroup.java deleted file mode 100644 index 259b5e5a182a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VaultSecretGroup.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Describes a set of certificates which are all in the same Key Vault. */ -@Fluent -public final class VaultSecretGroup { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VaultSecretGroup.class); - - /* - * The relative URL of the Key Vault containing all of the certificates in - * VaultCertificates. - */ - @JsonProperty(value = "sourceVault") - private SubResource sourceVault; - - /* - * The list of key vault references in SourceVault which contain - * certificates. - */ - @JsonProperty(value = "vaultCertificates") - private List vaultCertificates; - - /** - * Get the sourceVault property: The relative URL of the Key Vault containing all of the certificates in - * VaultCertificates. - * - * @return the sourceVault value. - */ - public SubResource sourceVault() { - return this.sourceVault; - } - - /** - * Set the sourceVault property: The relative URL of the Key Vault containing all of the certificates in - * VaultCertificates. - * - * @param sourceVault the sourceVault value to set. - * @return the VaultSecretGroup object itself. - */ - public VaultSecretGroup withSourceVault(SubResource sourceVault) { - this.sourceVault = sourceVault; - return this; - } - - /** - * Get the vaultCertificates property: The list of key vault references in SourceVault which contain certificates. - * - * @return the vaultCertificates value. - */ - public List vaultCertificates() { - return this.vaultCertificates; - } - - /** - * Set the vaultCertificates property: The list of key vault references in SourceVault which contain certificates. - * - * @param vaultCertificates the vaultCertificates value to set. - * @return the VaultSecretGroup object itself. - */ - public VaultSecretGroup withVaultCertificates(List vaultCertificates) { - this.vaultCertificates = vaultCertificates; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (vaultCertificates() != null) { - vaultCertificates().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualHardDisk.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualHardDisk.java deleted file mode 100644 index 02ff1d5d7e85..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualHardDisk.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describes the uri of a disk. */ -@Fluent -public final class VirtualHardDisk { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualHardDisk.class); - - /* - * Specifies the virtual hard disk's uri. - */ - @JsonProperty(value = "uri") - private String uri; - - /** - * Get the uri property: Specifies the virtual hard disk's uri. - * - * @return the uri value. - */ - public String uri() { - return this.uri; - } - - /** - * Set the uri property: Specifies the virtual hard disk's uri. - * - * @param uri the uri value to set. - * @return the VirtualHardDisk object itself. - */ - public VirtualHardDisk withUri(String uri) { - this.uri = uri; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachine.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachine.java deleted file mode 100644 index 30b9da90c4b5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachine.java +++ /dev/null @@ -1,2231 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.compute.ComputeManager; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineInner; -import com.azure.resourcemanager.authorization.models.BuiltInRole; -import com.azure.resourcemanager.msi.models.Identity; -import com.azure.resourcemanager.network.models.Network; -import com.azure.resourcemanager.network.models.NetworkInterface; -import com.azure.resourcemanager.network.models.PublicIpAddress; -import com.azure.resourcemanager.network.models.HasNetworkInterfaces; -import com.azure.resourcemanager.resources.fluentcore.arm.AvailabilityZoneId; -import com.azure.resourcemanager.resources.fluentcore.arm.models.GroupableResource; -import com.azure.resourcemanager.resources.fluentcore.arm.models.Resource; -import com.azure.resourcemanager.resources.fluentcore.model.Accepted; -import com.azure.resourcemanager.resources.fluentcore.model.Appliable; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; -import com.azure.resourcemanager.resources.fluentcore.model.Updatable; -import com.azure.resourcemanager.storage.models.StorageAccount; -import java.util.List; -import java.util.Map; -import java.util.Set; -import reactor.core.publisher.Mono; - -/** An immutable client-side representation of an Azure virtual machine. */ -@Fluent -public interface VirtualMachine - extends GroupableResource, - Refreshable, - Updatable, - HasNetworkInterfaces { - // Actions - /** Shuts down the virtual machine and releases the compute resources. */ - void deallocate(); - - /** - * Shuts down the virtual machine and releases the compute resources asynchronously. - * - * @return a representation of the deferred computation of this call - */ - Mono deallocateAsync(); - - /** Generalizes the virtual machine. */ - void generalize(); - - /** - * Generalizes the virtual machine asynchronously. - * - * @return a representation of the deferred computation of this call - */ - Mono generalizeAsync(); - - /** Powers off (stops) the virtual machine. */ - void powerOff(); - - /** - * Powers off (stops) the virtual machine asynchronously. - * - * @return a representation of the deferred computation of this call - */ - Mono powerOffAsync(); - - /** Restarts the virtual machine. */ - void restart(); - - /** - * Restarts the virtual machine asynchronously. - * - * @return a representation of the deferred computation of this call - */ - Mono restartAsync(); - - /** Starts the virtual machine. */ - void start(); - - /** - * Starts the virtual machine asynchronously. - * - * @return a representation of the deferred computation of this call - */ - Mono startAsync(); - - /** Redeploys the virtual machine. */ - void redeploy(); - - /** - * Redeploys the virtual machine asynchronously. - * - * @return a representation of the deferred computation of this call - */ - Mono redeployAsync(); - - /** - * Simulates the eviction of spot virtual machine. The eviction will occur with 30 minutes after calling this API. - */ - void simulateEviction(); - - /** - * Simulates the eviction of spot virtual machine asynchronously. The eviction will occur with 30 minutes after - * calling this API. - * - * @return a representation of the deferred computation of this call - */ - Mono simulateEvictionAsync(); - - /** @return entry point to enabling, disabling and querying disk encryption */ - VirtualMachineEncryption diskEncryption(); - - /** Converts (migrates) the virtual machine with un-managed disks to use managed disk. */ - void convertToManaged(); - - /** - * Converts (migrates) the virtual machine with un-managed disks to use managed disk asynchronously. - * - * @return a representation of the deferred computation of this call - */ - Mono convertToManagedAsync(); - - /** - * Lists all available virtual machine sizes this virtual machine can resized to. - * - * @return the virtual machine sizes - */ - PagedIterable availableSizes(); - - /** - * Captures the virtual machine by copying virtual hard disks of the VM. - * - * @param containerName destination container name to store the captured VHD - * @param vhdPrefix the prefix for the VHD holding captured image - * @param overwriteVhd whether to overwrites destination VHD if it exists - * @return the JSON template for creating more such virtual machines - */ - String capture(String containerName, String vhdPrefix, boolean overwriteVhd); - - /** - * Captures the virtual machine by copying virtual hard disks of the VM asynchronously. - * - * @param containerName destination container name to store the captured VHD - * @param vhdPrefix the prefix for the VHD holding captured image - * @param overwriteVhd whether to overwrites destination VHD if it exists - * @return a representation of the deferred computation of this call - */ - Mono captureAsync(String containerName, String vhdPrefix, boolean overwriteVhd); - - /** - * Refreshes the virtual machine instance view to sync with Azure. - * - *

    The instance view will be cached for later retrieval using instanceView. - * - * @return the refreshed instance view - */ - VirtualMachineInstanceView refreshInstanceView(); - - /** - * Refreshes the virtual machine instance view to sync with Azure. - * - * @return an observable that emits the instance view of the virtual machine. - */ - Mono refreshInstanceViewAsync(); - - /** - * Run shell script in a virtual machine. - * - * @param scriptLines PowerShell script lines - * @param scriptParameters script parameters - * @return result of PowerShell script execution - */ - RunCommandResult runPowerShellScript(List scriptLines, List scriptParameters); - - /** - * Run shell script in the virtual machine asynchronously. - * - * @param scriptLines PowerShell script lines - * @param scriptParameters script parameters - * @return handle to the asynchronous execution - */ - Mono runPowerShellScriptAsync( - List scriptLines, List scriptParameters); - - /** - * Run shell script in the virtual machine. - * - * @param scriptLines shell script lines - * @param scriptParameters script parameters - * @return result of shell script execution - */ - RunCommandResult runShellScript(List scriptLines, List scriptParameters); - - /** - * Run shell script in the virtual machine asynchronously. - * - * @param scriptLines shell script lines - * @param scriptParameters script parameters - * @return handle to the asynchronous execution - */ - Mono runShellScriptAsync( - List scriptLines, List scriptParameters); - - /** - * Run commands in the virtual machine. - * - * @param inputCommand command input - * @return result of execution - */ - RunCommandResult runCommand(RunCommandInput inputCommand); - - /** - * Run commands in the virtual machine asynchronously. - * - * @param inputCommand command input - * @return handle to the asynchronous execution - */ - Mono runCommandAsync(RunCommandInput inputCommand); - - // Getters - // - - /** @return true if managed disks are used for the virtual machine's disks (OS, data) */ - boolean isManagedDiskEnabled(); - - /** @return name of this virtual machine */ - String computerName(); - - /** @return the virtual machine size */ - VirtualMachineSizeTypes size(); - - /** @return the operating system of this virtual machine */ - OperatingSystemTypes osType(); - - /** @return the URI to the VHD file backing this virtual machine's operating system disk */ - String osUnmanagedDiskVhdUri(); - - /** @return the operating system disk caching type */ - CachingTypes osDiskCachingType(); - - /** @return the size of the operating system disk in GB */ - int osDiskSize(); - - /** @return the storage account type of the managed disk backing OS disk */ - StorageAccountTypes osDiskStorageAccountType(); - - /** @return resource ID of the managed disk backing the OS disk */ - String osDiskId(); - - /** @return the unmanaged data disks associated with this virtual machine, indexed by LUN number */ - Map unmanagedDataDisks(); - - /** @return the managed data disks associated with this virtual machine, indexed by LUN */ - Map dataDisks(); - - /** - * Gets the public IP address associated with this virtual machine's primary network interface. - * - *

    Note that this method makes a rest API call to fetch the resource. - * - * @return the public IP of the primary network interface - */ - PublicIpAddress getPrimaryPublicIPAddress(); - - /** - * @return the resource ID of the public IP address associated with this virtual machine's primary network interface - */ - String getPrimaryPublicIPAddressId(); - - /** @return the resource ID of the availability set associated with this virtual machine */ - String availabilitySetId(); - - /** @return the provisioningState value */ - String provisioningState(); - - /** @return the licenseType value */ - String licenseType(); - - /** - * Get specifies information about the proximity placement group that the virtual machine scale set should be - * assigned to. - * - * @return the proximityPlacementGroup. - */ - ProximityPlacementGroup proximityPlacementGroup(); - - /** - * @return a representation of the deferred computation of this call, returning extensions attached to the virtual - * machine - */ - Mono> listExtensionsAsync(); - - /** @return extensions attached to the virtual machine */ - Map listExtensions(); - - /** @return the plan value */ - Plan plan(); - - /** - * Returns the storage profile of an Azure virtual machine. - * - * @return the storageProfile value - */ - StorageProfile storageProfile(); - - /** @return the operating system profile */ - OSProfile osProfile(); - - /** @return the diagnostics profile */ - DiagnosticsProfile diagnosticsProfile(); - - /** @return the virtual machine unique ID. */ - String vmId(); - - /** @return the power state of the virtual machine */ - PowerState powerState(); - - /** - * Get the virtual machine instance view. - * - *

    The instance view will be cached for later retrieval using instanceView. - * - * @return the virtual machine's instance view - */ - VirtualMachineInstanceView instanceView(); - - /** @return the availability zones assigned to the virtual machine */ - Set availabilityZones(); - - /** @return true if boot diagnostics is enabled for the virtual machine */ - boolean isBootDiagnosticsEnabled(); - - /** @return the storage blob endpoint uri if boot diagnostics is enabled for the virtual machine */ - String bootDiagnosticsStorageUri(); - - /** @return true if Managed Service Identity is enabled for the virtual machine */ - boolean isManagedServiceIdentityEnabled(); - - /** - * @return the System Assigned (Local) Managed Service Identity specific Active Directory tenant ID assigned to the - * virtual machine. - */ - String systemAssignedManagedServiceIdentityTenantId(); - - /** - * @return the System Assigned (Local) Managed Service Identity specific Active Directory service principal ID - * assigned to the virtual machine. - */ - String systemAssignedManagedServiceIdentityPrincipalId(); - - /** @return the type of Managed Service Identity used for the virtual machine. */ - ResourceIdentityType managedServiceIdentityType(); - - /** @return the resource ids of User Assigned Managed Service Identities associated with the virtual machine. */ - Set userAssignedManagedServiceIdentityIds(); - - /** @return the priority for the virtual machine. */ - VirtualMachinePriorityTypes priority(); - - /** @return the eviction policy for the virtual machine. */ - VirtualMachineEvictionPolicyTypes evictionPolicy(); - - /** @return the billing related details of a low priority virtual machine */ - BillingProfile billingProfile(); - - // Setters - // - - /** The virtual machine scale set stages shared between managed and unmanaged based virtual machine definitions. */ - interface DefinitionShared - extends DefinitionStages.Blank, - DefinitionStages.WithGroup, - DefinitionStages.WithNetwork, - DefinitionStages.WithSubnet, - DefinitionStages.WithPrivateIP, - DefinitionStages.WithPublicIPAddress, - DefinitionStages.WithPrimaryNetworkInterface, - DefinitionStages.WithOS, - DefinitionStages.WithProximityPlacementGroup, - DefinitionStages.WithCreate { - } - - /** The entirety of the virtual machine definition. */ - interface DefinitionManagedOrUnmanaged - extends DefinitionShared, - DefinitionStages.WithLinuxRootUsernameManagedOrUnmanaged, - DefinitionStages.WithLinuxRootPasswordOrPublicKeyManagedOrUnmanaged, - DefinitionStages.WithWindowsAdminUsernameManagedOrUnmanaged, - DefinitionStages.WithWindowsAdminPasswordManagedOrUnmanaged, - DefinitionStages.WithFromImageCreateOptionsManagedOrUnmanaged, - DefinitionStages.WithLinuxCreateManagedOrUnmanaged, - DefinitionStages.WithWindowsCreateManagedOrUnmanaged, - DefinitionStages.WithManagedCreate, - DefinitionStages.WithUnmanagedCreate { - } - - /** The entirety of the managed disk based virtual machine definition. */ - interface DefinitionManaged - extends DefinitionShared, - DefinitionStages.WithLinuxRootUsernameManaged, - DefinitionStages.WithLinuxRootPasswordOrPublicKeyManaged, - DefinitionStages.WithWindowsAdminUsernameManaged, - DefinitionStages.WithWindowsAdminPasswordManaged, - DefinitionStages.WithFromImageCreateOptionsManaged, - DefinitionStages.WithLinuxCreateManaged, - DefinitionStages.WithWindowsCreateManaged, - DefinitionStages.WithManagedCreate { - } - - /** The entirety of the unmanaged disk based virtual machine definition. */ - interface DefinitionUnmanaged - extends DefinitionStages.Blank, - DefinitionStages.WithGroup, - DefinitionStages.WithNetwork, - DefinitionStages.WithSubnet, - DefinitionStages.WithPrivateIP, - DefinitionStages.WithPublicIPAddress, - DefinitionStages.WithPrimaryNetworkInterface, - DefinitionStages.WithOS, - DefinitionStages.WithLinuxRootUsernameUnmanaged, - DefinitionStages.WithLinuxRootPasswordOrPublicKeyUnmanaged, - DefinitionStages.WithWindowsAdminUsernameUnmanaged, - DefinitionStages.WithWindowsAdminPasswordUnmanaged, - DefinitionStages.WithFromImageCreateOptionsUnmanaged, - DefinitionStages.WithLinuxCreateUnmanaged, - DefinitionStages.WithWindowsCreateUnmanaged, - DefinitionStages.WithUnmanagedCreate { - } - - /** Grouping of virtual machine definition stages. */ - interface DefinitionStages { - /** The first stage of a virtual machine definition. */ - interface Blank extends GroupableResource.DefinitionWithRegion { - } - - /** The stage of a virtual machine definition allowing to specify the resource group. */ - interface WithGroup extends GroupableResource.DefinitionStages.WithGroup { - } - - /** - * The stage of a virtual machine definition allowing to specify a virtual network with the new primary network - * interface. - */ - interface WithNetwork extends WithPrimaryNetworkInterface { - /** - * Creates a new virtual network to associate with the virtual machine's primary network interface, based on - * the provided definition. - * - * @param creatable a creatable definition for a new virtual network - * @return the next stage of the definition - */ - WithPrivateIP withNewPrimaryNetwork(Creatable creatable); - - /** - * Creates a new virtual network to associate with the virtual machine's primary network interface. - * - *

    The virtual network will be created in the same resource group and region as of virtual machine, it - * will be created with the specified address space and a default subnet covering the entirety of the - * network IP address space. - * - * @param addressSpace the address space for the virtual network - * @return the next stage of the definition - */ - WithPrivateIP withNewPrimaryNetwork(String addressSpace); - - /** - * Associates an existing virtual network with the virtual machine's primary network interface. - * - * @param network an existing virtual network - * @return the next stage of the definition - */ - WithSubnet withExistingPrimaryNetwork(Network network); - } - - /** - * The stage of a virtual machine definition allowing to specify the virtual network subnet for a new primary - * network interface. - */ - interface WithSubnet { - /** - * Associates a subnet with the virtual machine's primary network interface. - * - * @param name the subnet name - * @return the next stage of the definition - */ - WithPrivateIP withSubnet(String name); - } - - /** - * The stage of a virtual machine definition allowing to specify a private IP address within a virtual network - * subnet. - */ - interface WithPrivateIP { - /** - * Enables dynamic private IP address allocation within the specified existing virtual network subnet for - * the VM's primary network interface. - * - * @return the next stage of the definition - */ - WithPublicIPAddress withPrimaryPrivateIPAddressDynamic(); - - /** - * Assigns the specified static private IP address within the specified existing virtual network subnet to - * the VM's primary network interface. - * - * @param staticPrivateIPAddress a static IP address within the specified subnet - * @return the next stage of the definition - */ - WithPublicIPAddress withPrimaryPrivateIPAddressStatic(String staticPrivateIPAddress); - } - - /** - * The stage of a virtual machine definition allowing to associate a public IP address with its primary network - * interface. - */ - interface WithPublicIPAddress { - /** - * Creates a new public IP address to associate with the VM's primary network interface. - * - * @param creatable a creatable definition for a new public IP - * @return the next stage of the definition - */ - WithProximityPlacementGroup withNewPrimaryPublicIPAddress(Creatable creatable); - - /** - * Creates a new public IP address in the same region and resource group as the resource, with the specified - * DNS label and associates it with the VM's primary network interface. - * - *

    The internal name for the public IP address will be derived from the DNS label. - * - * @param leafDnsLabel a leaf domain label - * @return the next stage of the definition - */ - WithProximityPlacementGroup withNewPrimaryPublicIPAddress(String leafDnsLabel); - - /** - * Associates an existing public IP address with the VM's primary network interface. - * - * @param publicIPAddress an existing public IP address - * @return the next stage of the definition - */ - WithProximityPlacementGroup withExistingPrimaryPublicIPAddress(PublicIpAddress publicIPAddress); - - /** - * Specifies that the VM should not have a public IP address. - * - * @return the next stage of the definition - */ - WithProximityPlacementGroup withoutPrimaryPublicIPAddress(); - } - - /** The stage of a virtual machine definition allowing to specify the primary network interface. */ - interface WithPrimaryNetworkInterface { - /** - * Creates a new network interface to associate with the virtual machine as its primary network interface, - * based on the provided definition. - * - * @param creatable a creatable definition for a new network interface - * @return the next stage of the definition - */ - WithProximityPlacementGroup withNewPrimaryNetworkInterface(Creatable creatable); - - /** - * Associates an existing network interface with the virtual machine as its primary network interface. - * - * @param networkInterface an existing network interface - * @return the next stage of the definition - */ - WithProximityPlacementGroup withExistingPrimaryNetworkInterface(NetworkInterface networkInterface); - } - - /** - * The stage of a virtual machine definition allowing to set information about the proximity placement group - * that the virtual machine scale set should be assigned to. - */ - interface WithProximityPlacementGroup extends WithOS { - /** - * Set information about the proximity placement group that the virtual machine scale set should be assigned - * to. - * - * @param promixityPlacementGroupId The Id of the proximity placement group subResource. - * @return the next stage of the definition. - */ - WithOS withProximityPlacementGroup(String promixityPlacementGroupId); - - /** - * Creates a new proximity placement gruup witht he specified name and then adds it to the VM. - * - * @param proximityPlacementGroupName The name of the group to be created. - * @param type the type of the group - * @return the next stage of the definition. - */ - WithOS withNewProximityPlacementGroup(String proximityPlacementGroupName, ProximityPlacementGroupType type); - } - - /** The stage of a virtual machine definition allowing to specify the operating system image. */ - interface WithOS { - /** - * Specifies a known marketplace Windows image to be used for the virtual machine's OS. - * - * @param knownImage a known market-place image - * @return the next stage of the definition - */ - WithWindowsAdminUsernameManagedOrUnmanaged withPopularWindowsImage( - KnownWindowsVirtualMachineImage knownImage); - - /** - * Specifies that the latest version of a marketplace Windows image should to be used as the virtual - * machine's OS. - * - * @param publisher specifies the publisher of the image - * @param offer specifies the offer of the image - * @param sku specifies the SKU of the image - * @return the next stage of the definition - */ - WithWindowsAdminUsernameManagedOrUnmanaged withLatestWindowsImage( - String publisher, String offer, String sku); - - /** - * Specifies a version of a marketplace Windows image to be used as the virtual machine's OS. - * - * @param imageReference describes publisher, offer, SKU and version of the market-place image - * @return the next stage of the definition - */ - WithWindowsAdminUsernameManagedOrUnmanaged withSpecificWindowsImageVersion(ImageReference imageReference); - - /** - * Specifies the resource ID of a generalized Windows custom image to be used as the virtual machine's OS. - * - * @param customImageId the resource ID of the custom image - * @return the next stage of the definition - */ - WithWindowsAdminUsernameManaged withGeneralizedWindowsCustomImage(String customImageId); - - /** - * Specifies the resource ID of a specialized Windows custom image to be used as the virtual machine's OS. - * - * @param customImageId the resource ID of the custom image - * @return the next stage of the definition - */ - WithWindowsCreateManaged withSpecializedWindowsCustomImage(String customImageId); - - /** - * Specifies the resource ID of a generalized Windows gallery image version to be used as the virtual - * machine's OS. - * - * @param galleryImageVersionId the resource ID of the gallery image version - * @return the next stage of the definition - */ - WithWindowsAdminUsernameManaged withGeneralizedWindowsGalleryImageVersion(String galleryImageVersionId); - - /** - * Specifies the resource ID of a specialized Windows gallery image version to be used as the virtual - * machine's OS. - * - * @param galleryImageVersionId the resource ID of the gallery image version - * @return the next stage of the definition - */ - WithWindowsCreateManaged withSpecializedWindowsGalleryImageVersion(String galleryImageVersionId); - - /** - * Specifies the user (generalized) Windows image to be used for the virtual machine's OS. - * - * @param imageUrl the URL of a VHD - * @return the next stage of the definition - */ - WithWindowsAdminUsernameUnmanaged withStoredWindowsImage(String imageUrl); - - /** - * Specifies a known marketplace Linux image to be used for the virtual machine's OS. - * - * @param knownImage a known market-place image - * @return the next stage of the definition - */ - WithLinuxRootUsernameManagedOrUnmanaged withPopularLinuxImage(KnownLinuxVirtualMachineImage knownImage); - - /** - * Specifies that the latest version of a marketplace Linux image is to be used as the virtual machine's OS. - * - * @param publisher specifies the publisher of an image - * @param offer specifies an offer of the image - * @param sku specifies a SKU of the image - * @return the next stage of the definition - */ - WithLinuxRootUsernameManagedOrUnmanaged withLatestLinuxImage(String publisher, String offer, String sku); - - /** - * Specifies a version of a market-place Linux image to be used as the virtual machine's OS. - * - * @param imageReference describes the publisher, offer, SKU and version of the market-place image - * @return the next stage of the definition - */ - WithLinuxRootUsernameManagedOrUnmanaged withSpecificLinuxImageVersion(ImageReference imageReference); - - /** - * Specifies the resource ID of a generalized Linux custom image to be used as the virtual machines' OS. - * - * @param customImageId the resource ID of a custom image - * @return the next stage of the definition - */ - WithLinuxRootUsernameManaged withGeneralizedLinuxCustomImage(String customImageId); - - /** - * Specifies the resource ID of a specialized Linux custom image to be used as the virtual machines' OS. - * - * @param customImageId the resource ID of a custom image - * @return the next stage of the definition - */ - WithLinuxCreateManaged withSpecializedLinuxCustomImage(String customImageId); - - /** - * Specifies the resource ID of a generalized Linux gallery image version to be used as the virtual - * machines' OS. - * - * @param galleryImageVersionId the resource ID of a gallery image version - * @return the next stage of the definition - */ - WithLinuxRootUsernameManaged withGeneralizedLinuxGalleryImageVersion(String galleryImageVersionId); - - /** - * Specifies the resource ID of a specialized Linux gallery image version to be used as the virtual - * machines' OS. - * - * @param galleryImageVersionId the resource ID of a gallery image version - * @return the next stage of the definition - */ - WithLinuxCreateManaged withSpecializedLinuxGalleryImageVersion(String galleryImageVersionId); - - /** - * Specifies a user (generalized) Linux image to be used for the virtual machine's OS. - * - * @param imageUrl the URL of a VHD - * @return the next stage of the definition - */ - WithLinuxRootUsernameUnmanaged withStoredLinuxImage(String imageUrl); - - /** - * Specifies a specialized operating system unmanaged disk to be attached to the virtual machine. - * - * @param osDiskUrl osDiskUrl the URL to the OS disk in the Azure Storage account - * @param osType the OS type - * @return the next stage of the definition - */ - WithUnmanagedCreate withSpecializedOSUnmanagedDisk(String osDiskUrl, OperatingSystemTypes osType); - - /** - * Specifies a specialized operating system managed disk to be attached to the virtual machine. - * - * @param disk the managed disk to attach - * @param osType the OS type - * @return the next stage of the definition - */ - WithManagedCreate withSpecializedOSDisk(Disk disk, OperatingSystemTypes osType); - } - - /** The stage of a Linux virtual machine definition allowing to specify an SSH root user name. */ - interface WithLinuxRootUsernameManagedOrUnmanaged { - /** - * Specifies an SSH root user name for the Linux virtual machine. - * - * @param rootUserName a user name following the required naming convention for Linux user names - * @return the next stage of the definition - */ - WithLinuxRootPasswordOrPublicKeyManagedOrUnmanaged withRootUsername(String rootUserName); - } - - /** The stage of a Linux virtual machine definition allowing to specify an SSH root user name. */ - interface WithLinuxRootUsernameManaged { - /** - * Specifies an SSH root user name for the Linux virtual machine. - * - * @param rootUserName a user name following the required naming convention for Linux user names - * @return the next stage of the definition - */ - WithLinuxRootPasswordOrPublicKeyManaged withRootUsername(String rootUserName); - } - - /** The stage of a Linux virtual machine definition allowing to specify an SSH root user name. */ - interface WithLinuxRootUsernameUnmanaged { - /** - * Specifies an SSH root user name for the Linux virtual machine. - * - * @param rootUserName a user name following the required naming convention for Linux user names - * @return the next stage of the definition - */ - WithLinuxRootPasswordOrPublicKeyUnmanaged withRootUsername(String rootUserName); - } - - /** The stage of a Linux virtual machine definition allowing to specify an SSH root password or public key. */ - interface WithLinuxRootPasswordOrPublicKeyManagedOrUnmanaged { - /** - * Specifies the SSH root password for the Linux virtual machine. - * - * @param rootPassword a password following the complexity criteria for Azure Linux VM passwords. - * @return the next stage of the definition - */ - WithLinuxCreateManagedOrUnmanaged withRootPassword(String rootPassword); - - /** - * Specifies the SSH public key. - * - * @param publicKey an SSH public key in the PEM format. - * @return the next stage of the definition - */ - WithLinuxCreateManagedOrUnmanaged withSsh(String publicKey); - } - - /** The stage of a Linux virtual machine definition allowing to specify an SSH root password or public key. */ - interface WithLinuxRootPasswordOrPublicKeyManaged { - /** - * Specifies the SSH root password for the Linux virtual machine. - * - * @param rootPassword a password, following the complexity criteria for Azure Linux VM passwords. - * @return the next stage of the definition - */ - WithLinuxCreateManaged withRootPassword(String rootPassword); - - /** - * Specifies an SSH public key. - * - * @param publicKey an SSH public key in the PEM format. - * @return the next stage of the definition - */ - WithLinuxCreateManaged withSsh(String publicKey); - } - - /** The stage of a Linux virtual machine definition allowing to specify an SSH root password or public key. */ - interface WithLinuxRootPasswordOrPublicKeyUnmanaged { - /** - * Specifies an SSH root password for the Linux virtual machine. - * - * @param rootPassword a password following the complexity criteria for Azure Linux VM passwords. - * @return the next stage of the definition - */ - WithLinuxCreateUnmanaged withRootPassword(String rootPassword); - - /** - * Specifies an SSH public key. - * - * @param publicKey an SSH public key in the PEM format. - * @return the next stage of the definition - */ - WithLinuxCreateUnmanaged withSsh(String publicKey); - } - - /** The stage of a Windows virtual machine definition allowing to specify an administrator user name. */ - interface WithWindowsAdminUsernameManagedOrUnmanaged { - /** - * Specifies the administrator user name for the Windows virtual machine. - * - * @param adminUserName a user name following the required naming convention for Windows user names. - * @return the next stage of the definition - */ - WithWindowsAdminPasswordManagedOrUnmanaged withAdminUsername(String adminUserName); - } - - /** The stage of a Windows virtual machine definition allowing to specify an administrator user name. */ - interface WithWindowsAdminUsernameManaged { - /** - * Specifies the administrator user name for the Windows virtual machine. - * - * @param adminUserName a user name followinmg the required naming convention for Windows user names - * @return the next stage of the definition - */ - WithWindowsAdminPasswordManaged withAdminUsername(String adminUserName); - } - - /** The stage of the Windows virtual machine definition allowing to specify an administrator user name. */ - interface WithWindowsAdminUsernameUnmanaged { - /** - * Specifies the administrator user name for the Windows virtual machine. - * - * @param adminUserName a user name following the required naming convention for Windows user names - * @return the next stage of the definition - */ - WithWindowsAdminPasswordUnmanaged withAdminUsername(String adminUserName); - } - - /** The stage of a Windows virtual machine definition allowing to specify an administrator password. */ - interface WithWindowsAdminPasswordManagedOrUnmanaged { - /** - * Specifies the administrator password for the Windows virtual machine. - * - * @param adminPassword a password following the complexity criteria for Azure Windows VM passwords - * @return the next stage of the definition - */ - WithWindowsCreateManagedOrUnmanaged withAdminPassword(String adminPassword); - } - - /** The stage of a Windows virtual machine definition allowing to specify an administrator user name. */ - interface WithWindowsAdminPasswordManaged { - /** - * Specifies the administrator password for the Windows virtual machine. - * - * @param adminPassword a password following the complexity criteria for Azure Windows VM passwords. - * @return the next stage of the definition - */ - WithWindowsCreateManaged withAdminPassword(String adminPassword); - } - - /** The stage of a Windows virtual machine definition allowing to specify an administrator password. */ - interface WithWindowsAdminPasswordUnmanaged { - /** - * Specifies the administrator password for the Windows virtual machine. - * - * @param adminPassword a password following the criteria for Azure Windows VM passwords. - * @return the next stage of the definition - */ - WithWindowsCreateUnmanaged withAdminPassword(String adminPassword); - } - - /** - * The stage of a virtual machine definition containing various settings when virtual machine is created from - * image. - */ - interface WithFromImageCreateOptionsManagedOrUnmanaged extends WithFromImageCreateOptionsManaged { - /** - * Specifies that unmanaged disks will be used. - * - * @return the next stage of the definition - */ - WithFromImageCreateOptionsUnmanaged withUnmanagedDisks(); - } - - /** - * The stage of a virtual machine definition containing various settings when virtual machine is created from - * image. - */ - interface WithFromImageCreateOptionsManaged extends WithManagedCreate { - - /** - * Specifies the custom data for the virtual machine. - * - * @param base64EncodedCustomData the base64 encoded custom data - * @return the next stage of the definition - */ - WithFromImageCreateOptionsManaged withCustomData(String base64EncodedCustomData); - - /** - * Specifies the computer name for the virtual machine. - * - * @param computerName a name for the computer - * @return the next stage stage of the definition - */ - WithFromImageCreateOptionsManaged withComputerName(String computerName); - } - - /** - * The stage of a virtual machine definition containing various settings when virtual machine is created from - * image. - */ - interface WithFromImageCreateOptionsUnmanaged extends WithUnmanagedCreate { - /** - * Specifies the custom data for the virtual machine. - * - * @param base64EncodedCustomData base64 encoded custom data - * @return the next stage of the definition - */ - WithFromImageCreateOptionsUnmanaged withCustomData(String base64EncodedCustomData); - - /** - * Specifies the computer name for the virtual machine. - * - * @param computerName a computer name - * @return the next stage of the definition - */ - WithFromImageCreateOptionsUnmanaged withComputerName(String computerName); - } - - /** - * The stage of the Linux virtual machine definition which contains all the minimum required inputs for the - * resource to be created, but also allows for any other optional settings to be specified. - */ - interface WithLinuxCreateManagedOrUnmanaged extends WithFromImageCreateOptionsManagedOrUnmanaged { - /** - * Specifies an SSH public key. - * - * @param publicKey an SSH public key in the PEM format. - * @return the next stage of the definition - */ - WithLinuxCreateManagedOrUnmanaged withSsh(String publicKey); - } - - /** - * The stage of a Linux virtual machine definition which contains all the minimum required inputs for the - * resource to be created, but also allows for any other optional settings to be specified. - */ - interface WithLinuxCreateManaged extends WithFromImageCreateOptionsManaged { - /** - * Specifies the SSH public key. - * - *

    Each call to this method adds the given public key to the list of VM's public keys. - * - * @param publicKey the SSH public key in PEM format. - * @return the stage representing creatable Linux VM definition - */ - WithLinuxCreateManaged withSsh(String publicKey); - } - - /** - * The stage of a Linux virtual machine definition which contains all the minimum required inputs for the - * resource to be created, but also allows for any other optional settings to be specified. - */ - interface WithLinuxCreateUnmanaged extends WithFromImageCreateOptionsUnmanaged { - /** - * Specifies an SSH public key. - * - * @param publicKey an SSH public key in the PEM format. - * @return the next stage of the definition - */ - WithLinuxCreateUnmanaged withSsh(String publicKey); - } - - /** - * The stage of the Windows virtual machine definition allowing to enable unmanaged disks or continue the - * definition of the VM with managed disks only. - */ - interface WithWindowsCreateManagedOrUnmanaged extends WithWindowsCreateManaged { - /** - * Enables unmanaged disk support on this virtual machine. - * - * @return the next stage of the definition - */ - WithWindowsCreateUnmanaged withUnmanagedDisks(); - } - - /** - * The stage of a Windows virtual machine definition which contains all the minimum required inputs for the - * resource to be created, but also allows for any other optional settings to be specified. - */ - interface WithWindowsCreateManaged extends WithFromImageCreateOptionsManaged { - /** - * Prevents the provisioning of a VM agent. - * - * @return the next stage of the definition - */ - WithWindowsCreateManaged withoutVMAgent(); - - /** - * Disables automatic updates. - * - * @return the next stage of the definition - */ - WithWindowsCreateManaged withoutAutoUpdate(); - - /** - * Specifies the time-zone. - * - * @param timeZone a time zone - * @return the next stage of the definition - */ - WithWindowsCreateManaged withTimeZone(String timeZone); - - /** - * Specifies WinRM listener. - * - *

    Each call to this method adds the given listener to the list of the VM's WinRM listeners. - * - * @param listener a WinRM listener - * @return the next stage of the definition - */ - WithWindowsCreateManaged withWinRM(WinRMListener listener); - } - - /** - * The stage of the Windows virtual machine definition which contains all the minimum required inputs for the - * resource to be created, but also allows for any other optional settings to be specified. - */ - interface WithWindowsCreateUnmanaged extends WithFromImageCreateOptionsUnmanaged { - /** - * Specifies that VM Agent should not be provisioned. - * - * @return the stage representing creatable Windows VM definition - */ - WithWindowsCreateUnmanaged withoutVMAgent(); - - /** - * Specifies that automatic updates should be disabled. - * - * @return the stage representing creatable Windows VM definition - */ - WithWindowsCreateUnmanaged withoutAutoUpdate(); - - /** - * Specifies the time-zone. - * - * @param timeZone the timezone - * @return the stage representing creatable Windows VM definition - */ - WithWindowsCreateUnmanaged withTimeZone(String timeZone); - - /** - * Specifies the WINRM listener. - * - *

    Each call to this method adds the given listener to the list of VM's WinRM listeners. - * - * @param listener the WinRMListener - * @return the stage representing creatable Windows VM definition - */ - WithWindowsCreateUnmanaged withWinRM(WinRMListener listener); - } - - /** The stage of a virtual machine definition allowing to specify OS disk configurations. */ - interface WithOSDiskSettings { - /** - * Specifies the caching type for the OS disk. - * - * @param cachingType a caching type - * @return the next stage of the definition - */ - WithCreate withOSDiskCaching(CachingTypes cachingType); - - /** - * Specifies the encryption settings for the OS Disk. - * - * @param settings the encryption settings - * @return the next stage of the definition - */ - WithCreate withOSDiskEncryptionSettings(DiskEncryptionSettings settings); - - /** - * Specifies the size of the OSDisk in GB. - * - * @param size the VHD size - * @return the next stage of the definition - */ - WithCreate withOSDiskSizeInGB(int size); - - /** - * Specifies the name for the OS Disk. - * - * @param name an OS disk name - * @return the next stage of the definition - */ - WithCreate withOSDiskName(String name); - } - - /** The stage of a virtual machine definition allowing to select a VM size. */ - interface WithVMSize { - /** - * Selects the size of the virtual machine. - * - * @param sizeName the name of a size for the virtual machine as text - * @return the next stage of the definition - */ - WithCreate withSize(String sizeName); - - /** - * Specifies the size of the virtual machine. - * - * @param size a size from the list of available sizes for the virtual machine - * @return the next stage of the definition - */ - WithCreate withSize(VirtualMachineSizeTypes size); - } - - /** The stage of a virtual machine definition allowing to add an unmanaged data disk. */ - interface WithUnmanagedDataDisk { - /** - * Attaches a new blank unmanaged data disk to the virtual machine. - * - * @param sizeInGB the disk size in GB - * @return the next stage of the definition - */ - WithUnmanagedCreate withNewUnmanagedDataDisk(Integer sizeInGB); - - /** - * Attaches an existing unmanaged VHD as a data disk to the virtual machine. - * - * @param storageAccountName a storage account name - * @param containerName the name of the container holding the VHD file - * @param vhdName the name for the VHD file - * @return the next stage of the definition - */ - WithUnmanagedCreate withExistingUnmanagedDataDisk( - String storageAccountName, String containerName, String vhdName); - - /** - * Begins definition of an unmanaged data disk to be attached to the virtual machine. - * - * @param name the name for the data disk - * @return the first stage of an unmanaged data disk definition - */ - VirtualMachineUnmanagedDataDisk.DefinitionStages.Blank defineUnmanagedDataDisk( - String name); - } - - /** The stage of a virtual machine definition allowing to specify a managed data disk. */ - interface WithManagedDataDisk { - /** - * Specifies that a managed disk should be created explicitly with the given definition and attached to the - * virtual machine as a data disk. - * - * @param creatable a creatable disk definition - * @return the next stage of the definition - */ - WithManagedCreate withNewDataDisk(Creatable creatable); - - /** - * Specifies that a managed disk needs to be created explicitly with the given definition and attach to the - * virtual machine as data disk. - * - * @param creatable a creatable disk - * @param lun the data disk LUN - * @param cachingType a data disk caching type - * @return the next stage of the definition - */ - WithManagedCreate withNewDataDisk(Creatable creatable, int lun, CachingTypes cachingType); - - /** - * Specifies that a managed disk needs to be created implicitly with the given size. - * - * @param sizeInGB the size of the managed disk in GB - * @return the next stage of the definition - */ - WithManagedCreate withNewDataDisk(int sizeInGB); - - /** - * Specifies that a managed disk needs to be created implicitly with the given settings. - * - * @param sizeInGB the size of the managed disk in GB - * @param lun the disk LUN - * @param cachingType the caching type - * @return the next stage of the definition - */ - WithManagedCreate withNewDataDisk(int sizeInGB, int lun, CachingTypes cachingType); - - /** - * Specifies that a managed disk needs to be created implicitly with the given settings. - * - * @param sizeInGB the size of the managed disk in GB - * @param lun the disk LUN - * @param cachingType the caching type - * @param storageAccountType the storage account type - * @return the next stage of the definition - */ - WithManagedCreate withNewDataDisk( - int sizeInGB, int lun, CachingTypes cachingType, StorageAccountTypes storageAccountType); - - /** - * Associates an existing source managed disk with the virtual machine. - * - * @param disk an existing managed disk - * @return the next stage of the definition - */ - WithManagedCreate withExistingDataDisk(Disk disk); - - /** - * Associates an existing source managed disk with the virtual machine and specifies additional settings. - * - * @param disk a managed disk - * @param lun the disk LUN - * @param cachingType a caching type - * @return the next stage of the definition - */ - WithManagedCreate withExistingDataDisk(Disk disk, int lun, CachingTypes cachingType); - - /** - * Associates an existing source managed disk with the virtual machine and specifies additional settings. - * - * @param disk a managed disk - * @param newSizeInGB the disk resize size in GB - * @param lun the disk LUN - * @param cachingType a caching type - * @return the next stage of the definition - */ - WithManagedCreate withExistingDataDisk(Disk disk, int newSizeInGB, int lun, CachingTypes cachingType); - - /** - * Specifies the data disk to be created from the data disk image in the virtual machine image. - * - * @param imageLun the LUN of the source data disk image - * @return the next stage of the definition - */ - WithManagedCreate withNewDataDiskFromImage(int imageLun); - - /** - * Specifies the data disk to be created from the data disk image in the virtual machine image. - * - * @param imageLun the LUN of the source data disk image - * @param newSizeInGB the new size that overrides the default size specified in the data disk image - * @param cachingType a caching type - * @return the next stage of the definition - */ - WithManagedCreate withNewDataDiskFromImage(int imageLun, int newSizeInGB, CachingTypes cachingType); - - /** - * Specifies the data disk to be created from the data disk image in the virtual machine image. - * - * @param imageLun the LUN of the source data disk image - * @param newSizeInGB the new size that overrides the default size specified in the data disk image - * @param cachingType a caching type - * @param storageAccountType a storage account type - * @return the next stage of the definition - */ - WithManagedCreate withNewDataDiskFromImage( - int imageLun, int newSizeInGB, CachingTypes cachingType, StorageAccountTypes storageAccountType); - } - - /** The stage of the virtual machine definition allowing to specify availability set. */ - interface WithAvailabilitySet { - /** - * Specifies the name of a new availability set to associate with the virtual machine. - * - * @param name the name of an availability set - * @return the next stage of the definition - */ - WithCreate withNewAvailabilitySet(String name); - - /** - * Specifies definition of a not-yet-created availability set definition to associate the virtual machine - * with. - * - * @param creatable a creatable availability set definition - * @return the next stage of the definition - */ - WithCreate withNewAvailabilitySet(Creatable creatable); - - /** - * Specifies an existing availability set to associate with the virtual machine. - * - * @param availabilitySet an existing availability set - * @return the next stage of the definition - */ - WithCreate withExistingAvailabilitySet(AvailabilitySet availabilitySet); - } - - /** The stage of a virtual machine definition allowing to specify a storage account. */ - interface WithStorageAccount { - /** - * Specifies the name of a new storage account to put the VM's OS and data disk VHD into. - * - *

    Only an OS disk based on a marketplace image will be stored in the new storage account. An OS disk - * based on a user image will be stored in the same storage account as the user image. - * - * @param name the name for a new storage account - * @return the next stage of the definition - */ - WithCreate withNewStorageAccount(String name); - - /** - * Specifies the definition of a not-yet-created storage account to put the VM's OS and data disk VHDs into. - * - *

    Only the OS disk based on a marketplace image will be stored in the new storage account. An OS disk - * based on a user image will be stored in the same storage account as the user image. - * - * @param creatable a creatable storage account definition - * @return the next stage of the definition - */ - WithCreate withNewStorageAccount(Creatable creatable); - - /** - * Specifies an existing storage account to put the VM's OS and data disk VHD in. - * - *

    An OS disk based on a marketplace or a user image (generalized image) will be stored in this storage - * account. - * - * @param storageAccount an existing storage account - * @return the next stage of the definition - */ - WithCreate withExistingStorageAccount(StorageAccount storageAccount); - } - - /** The stage of a virtual machine definition allowing to specify additional network interfaces. */ - interface WithSecondaryNetworkInterface { - /** - * Creates a new network interface to associate with the virtual machine, based on the provided definition. - * - *

    Note this method's effect is additive, i.e. each time it is used, a new secondary network interface - * added to the virtual machine. - * - * @param creatable a creatable definition for a new network interface - * @return the next stage of the definition - */ - WithCreate withNewSecondaryNetworkInterface(Creatable creatable); - - /** - * Associates an existing network interface with the virtual machine. - * - *

    Note this method's effect is additive, i.e. each time it is used, the new secondary network interface - * added to the virtual machine. - * - * @param networkInterface an existing network interface - * @return the next stage of the definition - */ - WithCreate withExistingSecondaryNetworkInterface(NetworkInterface networkInterface); - } - - /** The stage of the virtual machine definition allowing to specify extensions. */ - interface WithExtension { - /** - * Starts the definition of an extension to be attached to the virtual machine. - * - * @param name the reference name for the extension - * @return the first stage stage of an extension definition - */ - VirtualMachineExtension.DefinitionStages.Blank defineNewExtension(String name); - } - - /** The stage of a virtual machine definition allowing to specify a purchase plan. */ - interface WithPlan { - /** - * Specifies the purchase plan for the virtual machine. - * - * @param plan a purchase plan - * @return the next stage of the definition - */ - WithCreate withPlan(PurchasePlan plan); - - /** - * Specifies the purchase plan for the virtual machine. - * - * @param plan a purchase plan - * @param promotionCode a promotion code - * @return the next stage of the definition - */ - WithCreate withPromotionalPlan(PurchasePlan plan, String promotionCode); - } - - /** The stage of the virtual machine definition allowing to enable boot diagnostics. */ - interface WithBootDiagnostics { - /** - * Specifies that boot diagnostics needs to be enabled in the virtual machine. - * Managed storage account is used. - * - * @return the next stage of the definition - */ - WithCreate withBootDiagnosticsOnManagedStorageAccount(); - - /** - * Specifies that boot diagnostics needs to be enabled in the virtual machine. - * - * @return the next stage of the definition - */ - WithCreate withBootDiagnostics(); - - /** - * Specifies that boot diagnostics needs to be enabled in the virtual machine. - * - * @param creatable the storage account to be created and used for store the boot diagnostics - * @return the next stage of the definition - */ - WithCreate withBootDiagnostics(Creatable creatable); - - /** - * Specifies that boot diagnostics needs to be enabled in the virtual machine. - * - * @param storageAccount an existing storage account to be uses to store the boot diagnostics - * @return the next stage of the definition - */ - WithCreate withBootDiagnostics(StorageAccount storageAccount); - - /** - * Specifies that boot diagnostics needs to be enabled in the virtual machine. - * - * @param storageAccountBlobEndpointUri a storage account blob endpoint to store the boot diagnostics - * @return the next stage of the definition - */ - WithCreate withBootDiagnostics(String storageAccountBlobEndpointUri); - } - - /** The stage of the virtual machine definition allowing to specify priority. */ - interface WithPriority { - /** - * Specifies the priority of the virtual machine. - * - * @param priority the priority to set - * @return the next stage of the definition - */ - WithCreate withPriority(VirtualMachinePriorityTypes priority); - - /** - * Specify that virtual machine should be low priority. - * - * @return the next stage of the definition - */ - WithCreate withLowPriority(); - - /** - * Specify that virtual machines should be low priority VMs with the provided eviction policy. - * - * @param policy eviction policy for the virtual machine - * @return the next stage of the definition - */ - WithCreate withLowPriority(VirtualMachineEvictionPolicyTypes policy); - - /** - * Specify that virtual machine should be spot priority. - * - * @return the next stage of the definition - */ - WithCreate withSpotPriority(); - - /** - * Specify that virtual machines should be spot priority VMs with the provided eviction policy. - * - * @param policy eviction policy for the virtual machine - * @return the next stage of the definition - */ - WithCreate withSpotPriority(VirtualMachineEvictionPolicyTypes policy); - } - - /** - * The stage of a virtual machine definition allowing to set the billing related details of a low priority - * virtual machine. - */ - interface WithBillingProfile { - - /** - * Set the billing related details of a low priority virtual machine. This price is in US Dollars. - * - * @param maxPrice the maxPrice value to set - * @return the next stage of the definition - */ - WithCreate withMaxPrice(Double maxPrice); - } - - /** - * The stage of the virtual machine definition allowing to enable System Assigned (Local) Managed Service - * Identity. - */ - interface WithSystemAssignedManagedServiceIdentity { - /** - * Specifies that System Assigned (Local) Managed Service Identity needs to be enabled in the virtual - * machine. - * - * @return the next stage of the definition - */ - WithSystemAssignedIdentityBasedAccessOrCreate withSystemAssignedManagedServiceIdentity(); - } - - /** - * The stage of the System Assigned (Local) Managed Service Identity enabled virtual machine allowing to set - * access role for the identity. - */ - interface WithSystemAssignedIdentityBasedAccessOrCreate extends WithCreate { - /** - * Specifies that virtual machine's system assigned (local) identity should have the given access (described - * by the role) on an ARM resource identified by the resource ID. Applications running on the virtual - * machine will have the same permission (role) on the ARM resource. - * - * @param resourceId the ARM identifier of the resource - * @param role access role to assigned to the virtual machine's local identity - * @return the next stage of the definition - */ - WithSystemAssignedIdentityBasedAccessOrCreate withSystemAssignedIdentityBasedAccessTo( - String resourceId, BuiltInRole role); - - /** - * Specifies that virtual machine's system assigned (local) identity should have the given access (described - * by the role) on the resource group that virtual machine resides. Applications running on the virtual - * machine will have the same permission (role) on the resource group. - * - * @param role access role to assigned to the virtual machine's local identity - * @return the next stage of the definition - */ - WithSystemAssignedIdentityBasedAccessOrCreate withSystemAssignedIdentityBasedAccessToCurrentResourceGroup( - BuiltInRole role); - - /** - * Specifies that virtual machine's system assigned (local) identity should have the access (described by - * the role definition) on an ARM resource identified by the resource ID. Applications running on the - * virtual machine will have the same permission (role) on the ARM resource. - * - * @param resourceId scope of the access represented in ARM resource ID format - * @param roleDefinitionId access role definition to assigned to the virtual machine's local identity - * @return the next stage of the definition - */ - WithSystemAssignedIdentityBasedAccessOrCreate withSystemAssignedIdentityBasedAccessTo( - String resourceId, String roleDefinitionId); - - /** - * Specifies that virtual machine's system assigned (local) identity should have the access (described by - * the role definition) on the resource group that virtual machine resides. Applications running on the - * virtual machine will have the same permission (role) on the resource group. - * - * @param roleDefinitionId access role definition to assigned to the virtual machine's local identity - * @return the next stage of the definition - */ - WithSystemAssignedIdentityBasedAccessOrCreate withSystemAssignedIdentityBasedAccessToCurrentResourceGroup( - String roleDefinitionId); - } - - /** - * The stage of the virtual machine definition allowing to specify User Assigned (External) Managed Service - * Identities. - */ - interface WithUserAssignedManagedServiceIdentity { - /** - * Specifies the definition of a not-yet-created user assigned identity to be associated with the virtual - * machine. - * - * @param creatableIdentity a creatable identity definition - * @return the next stage of the virtual machine definition - */ - WithCreate withNewUserAssignedManagedServiceIdentity(Creatable creatableIdentity); - - /** - * Specifies an existing user assigned identity to be associated with the virtual machine. - * - * @param identity the identity - * @return the next stage of the virtual machine definition - */ - WithCreate withExistingUserAssignedManagedServiceIdentity(Identity identity); - } - - /** - * The stage of the virtual machine definition allowing to specify that the image or disk that is being used was - * licensed on-premises. This element is only used for images that contain the Windows Server operating system. - */ - interface WithLicenseType { - /** - * Specifies that the image or disk that is being used was licensed on-premises. - * - * @param licenseType license type - * @return the next stage of the virtual machine definition - */ - WithCreate withLicenseType(String licenseType); - } - - /** The stage of the VM definition allowing to specify availability zone. */ - interface WithAvailabilityZone { - /** - * Specifies the availability zone for the virtual machine. - * - * @param zoneId the zone identifier. - * @return the next stage of the definition - */ - WithManagedCreate withAvailabilityZone(AvailabilityZoneId zoneId); - } - - /** - * The stage of the definition which contains all the minimum required inputs for the VM using managed OS disk - * to be created and optionally allow managed data disks specific settings to be specified. - */ - interface WithManagedCreate extends WithManagedDataDisk, WithAvailabilityZone, WithCreate { - /** - * Specifies the storage account type for the managed OS disk. - * - * @param accountType storage account type - * @return the next stage of the definition - */ - WithManagedCreate withOSDiskStorageAccountType(StorageAccountTypes accountType); - - /** - * Specifies the default caching type for the managed data disks. - * - * @param cachingType a caching type - * @return the next stage of teh definition - */ - WithManagedCreate withDataDiskDefaultCachingType(CachingTypes cachingType); - - /** - * Specifies the default caching type for managed data disks. - * - * @param storageAccountType a storage account type - * @return the next stage of the definition - */ - WithManagedCreate withDataDiskDefaultStorageAccountType(StorageAccountTypes storageAccountType); - } - - /** - * The stage of a virtual machine definition which contains all the minimum required inputs for the VM using - * storage account (unmanaged based OS disk to be created and optionally allow unmanaged data disk and settings - * specific to unmanaged OS disk to be specified. - */ - interface WithUnmanagedCreate extends WithUnmanagedDataDisk, WithCreate { - /** - * Specifies the name of an OS disk VHD file and its parent container. - * - * @param containerName the name of the container in the selected storage account - * @param vhdName the name for the OS disk VHD. - * @return the next stage of the definition - */ - WithUnmanagedCreate withOSDiskVhdLocation(String containerName, String vhdName); - } - - /** - * The stage of the definition which contains all the minimum required inputs for the resource to be created, - * but also allows for any other optional settings to be specified. - */ - interface WithCreate - extends Creatable, - Resource.DefinitionWithTags, - DefinitionStages.WithOSDiskSettings, - DefinitionStages.WithVMSize, - DefinitionStages.WithStorageAccount, - DefinitionStages.WithAvailabilitySet, - DefinitionStages.WithSecondaryNetworkInterface, - DefinitionStages.WithExtension, - DefinitionStages.WithPlan, - DefinitionStages.WithBootDiagnostics, - DefinitionStages.WithPriority, - DefinitionStages.WithBillingProfile, - DefinitionStages.WithSystemAssignedManagedServiceIdentity, - DefinitionStages.WithUserAssignedManagedServiceIdentity, - DefinitionStages.WithLicenseType { - - /** - * Begins creating the virtual machine resource. - * - * @return the accepted create operation - */ - Accepted beginCreate(); - } - } - - /** Grouping of virtual machine update stages. */ - interface UpdateStages { - /** - * The stage of a virtual machine update allowing to set/remove information about the proximity placement group - * that the virtual machine scale set should be assigned to. - */ - interface WithProximityPlacementGroup { - /** - * Set information about the proximity placement group that the virtual machineshould be assigned to. - * - * @param proximityPlacementGroupId The Id of the proximity placement group subResource. - * @return the next stage of the definition. - */ - Update withProximityPlacementGroup(String proximityPlacementGroupId); - - /** - * Removes the Proximity placement group from the VM. - * - * @return the next stage of the definition. - */ - Update withoutProximityPlacementGroup(); - } - - /** The stage of the virtual machine update allowing to specify billing profile. */ - interface WithBillingProfile { - /** - * Set the billing related details of a low priority virtual machine. - * - * @param maxPrice the maxPrice value to set - * @return the next stage of the update - */ - Update withMaxPrice(Double maxPrice); - } - - /** The stage of a virtual machine definition allowing to specify unmanaged data disk configuration. */ - interface WithUnmanagedDataDisk { - /** - * Specifies that a new blank unmanaged data disk needs to be attached to virtual machine. - * - * @param sizeInGB the disk size in GB - * @return the stage representing creatable VM definition - */ - Update withNewUnmanagedDataDisk(Integer sizeInGB); - - /** - * Specifies an existing VHD that needs to be attached to the virtual machine as data disk. - * - * @param storageAccountName the storage account name - * @param containerName the name of the container holding the VHD file - * @param vhdName the name for the VHD file - * @return the stage representing creatable VM definition - */ - Update withExistingUnmanagedDataDisk(String storageAccountName, String containerName, String vhdName); - - /** - * Begins the definition of a blank unmanaged data disk to be attached to the virtual machine along with its - * configuration. - * - * @param name the name for the data disk - * @return the first stage of the data disk definition - */ - VirtualMachineUnmanagedDataDisk.UpdateDefinitionStages.Blank defineUnmanagedDataDisk(String name); - - /** - * Begins the description of an update of an existing unmanaged data disk of this virtual machine. - * - * @param name the name of an existing disk - * @return the first stage of the data disk update - */ - VirtualMachineUnmanagedDataDisk.Update updateUnmanagedDataDisk(String name); - - /** - * Detaches an unmanaged data disk from the virtual machine. - * - * @param name the name of an existing data disk to remove - * @return the next stage of the update - */ - Update withoutUnmanagedDataDisk(String name); - - /** - * Detaches a unmanaged data disk from the virtual machine. - * - * @param lun the logical unit number of the data disk to remove - * @return the next stage of the update - */ - Update withoutUnmanagedDataDisk(int lun); - } - - /** The stage of a virtual machine update allowing to specify a managed data disk. */ - interface WithManagedDataDisk { - /** - * Specifies that a managed disk needs to be created explicitly with the given definition and attached to - * the virtual machine as a data disk. - * - * @param creatable a creatable disk definition - * @return the next stage of the update - */ - Update withNewDataDisk(Creatable creatable); - - /** - * Specifies that a managed disk needs to be created explicitly with the given definition and attached to - * the virtual machine as a data disk. - * - * @param creatable a creatable disk definition - * @param lun the data disk LUN - * @param cachingType a data disk caching type - * @return the next stage of the update - */ - Update withNewDataDisk(Creatable creatable, int lun, CachingTypes cachingType); - - /** - * Specifies that a managed disk needs to be created implicitly with the given size. - * - * @param sizeInGB the size of the managed disk - * @return the next stage of the update - */ - Update withNewDataDisk(int sizeInGB); - - /** - * Specifies that a managed disk needs to be created implicitly with the given settings. - * - * @param sizeInGB the size of the managed disk - * @param lun the disk LUN - * @param cachingType a caching type - * @return the next stage of the update - */ - Update withNewDataDisk(int sizeInGB, int lun, CachingTypes cachingType); - - /** - * Specifies that a managed disk needs to be created implicitly with the given settings. - * - * @param sizeInGB the size of the managed disk - * @param lun the disk LUN - * @param cachingType a caching type - * @param storageAccountType a storage account type - * @return the next stage of the update - */ - Update withNewDataDisk( - int sizeInGB, int lun, CachingTypes cachingType, StorageAccountTypes storageAccountType); - - /** - * Associates an existing source managed disk with the VM. - * - * @param disk a managed disk - * @return the next stage of the update - */ - Update withExistingDataDisk(Disk disk); - - /** - * Specifies an existing source managed disk and settings. - * - * @param disk the managed disk - * @param lun the disk LUN - * @param cachingType a caching type - * @return the next stage of the update - */ - Update withExistingDataDisk(Disk disk, int lun, CachingTypes cachingType); - - /** - * Specifies an existing source managed disk and settings. - * - * @param disk a managed disk - * @param newSizeInGB the disk resize size in GB - * @param lun the disk LUN - * @param cachingType a caching type - * @return the next stage of the update - */ - Update withExistingDataDisk(Disk disk, int newSizeInGB, int lun, CachingTypes cachingType); - - /** - * Detaches a managed data disk with the given LUN from the virtual machine. - * - * @param lun the disk LUN - * @return the next stage of the update - */ - Update withoutDataDisk(int lun); - - /** - * Updates the size of a managed data disk with the given LUN. - * - * @param lun the disk LUN - * @param newSizeInGB the new size of the disk - * @return the next stage of the update - */ - // TODO: This has been disabled by the Azure REST API - // Update withDataDiskUpdated(int lun, int newSizeInGB); - - /** - * Updates the size and caching type of a managed data disk with the given LUN. - * - * @param lun the disk LUN - * @param newSizeInGB the new size of the disk - * @param cachingType a caching type - * @return the next stage of the update - */ - // TODO: This has been disabled by the Azure REST API - // Update withDataDiskUpdated(int lun, int newSizeInGB, CachingTypes cachingType); - - /** - * Updates the size, caching type and storage account type of a managed data disk with the given LUN. - * - * @param lun the disk LUN - * @param newSizeInGB the new size of the disk - * @param cachingType a caching type - * @param storageAccountType a storage account type - * @return the next stage of the update - */ - // TODO: This has been disabled by the Azure REST API - // Update withDataDiskUpdated(int lun, - // int newSizeInGB, - // CachingTypes cachingType, - // StorageAccountTypes storageAccountType); - } - - /** The stage of a virtual machine update allowing to specify additional network interfaces. */ - interface WithSecondaryNetworkInterface { - /** - * Creates a new network interface to associate with the virtual machine. - * - *

    Note this method's effect is additive, i.e. each time it is used, the new secondary network interface - * added to the virtual machine. - * - * @param creatable a creatable definition for a new network interface - * @return the next stage of the update - */ - Update withNewSecondaryNetworkInterface(Creatable creatable); - - /** - * Associates an existing network interface with the virtual machine. - * - *

    Note this method's effect is additive, i.e. each time it is used, the new secondary network interface - * added to the virtual machine. - * - * @param networkInterface an existing network interface - * @return the next stage of the update - */ - Update withExistingSecondaryNetworkInterface(NetworkInterface networkInterface); - - /** - * Removes a secondary network interface from the virtual machine. - * - * @param name the name of a secondary network interface to remove - * @return the next stage of the update - */ - Update withoutSecondaryNetworkInterface(String name); - } - - /** The stage of a virtual machine update allowing to specify extensions. */ - interface WithExtension { - /** - * Begins the definition of an extension to be attached to the virtual machine. - * - * @param name a reference name for the extension - * @return the first stage of an extension definition - */ - VirtualMachineExtension.UpdateDefinitionStages.Blank defineNewExtension(String name); - - /** - * Begins the description of an update of an existing extension of this virtual machine. - * - * @param name the reference name of an existing extension - * @return the first stage of an extension update - */ - VirtualMachineExtension.Update updateExtension(String name); - - /** - * Detaches an extension from the virtual machine. - * - * @param name the reference name of the extension to be removed/uninstalled - * @return the next stage of the update - */ - Update withoutExtension(String name); - } - - /** The stage of the virtual machine definition allowing to enable boot diagnostics. */ - interface WithBootDiagnostics { - /** - * Specifies that boot diagnostics needs to be enabled in the virtual machine. - * Managed storage account is used. - * - * @return the next stage of the update - */ - Update withBootDiagnosticsOnManagedStorageAccount(); - - /** - * Specifies that boot diagnostics needs to be enabled in the virtual machine. - * - * @return the next stage of the update - */ - Update withBootDiagnostics(); - - /** - * Specifies that boot diagnostics needs to be enabled in the virtual machine. - * - * @param creatable the storage account to be created and used for store the boot diagnostics - * @return the next stage of the update - */ - Update withBootDiagnostics(Creatable creatable); - - /** - * Specifies that boot diagnostics needs to be enabled in the virtual machine. - * - * @param storageAccount an existing storage account to be uses to store the boot diagnostics - * @return the next stage of the update - */ - Update withBootDiagnostics(StorageAccount storageAccount); - - /** - * Specifies that boot diagnostics needs to be enabled in the virtual machine. - * - * @param storageAccountBlobEndpointUri a storage account blob endpoint to store the boot diagnostics - * @return the next stage of the update - */ - Update withBootDiagnostics(String storageAccountBlobEndpointUri); - - /** - * Specifies that boot diagnostics needs to be disabled in the virtual machine. - * - * @return the next stage of the update - */ - Update withoutBootDiagnostics(); - } - - /** - * The stage of the virtual machine update allowing to enable System Assigned (Local) Managed Service Identity. - */ - interface WithSystemAssignedManagedServiceIdentity { - /** - * Specifies that System Assigned (Local) Managed Service Identity needs to be enabled in the virtual - * machine. - * - * @return the next stage of the update - */ - WithSystemAssignedIdentityBasedAccessOrUpdate withSystemAssignedManagedServiceIdentity(); - - /** - * Specifies that System Assigned (Local) Managed Service Identity needs to be disabled. - * - * @return the next stage of the update - */ - Update withoutSystemAssignedManagedServiceIdentity(); - } - - /** - * The stage of the System Assigned (Local) Managed Service Identity enabled virtual machine allowing to set - * access role for the identity. - */ - interface WithSystemAssignedIdentityBasedAccessOrUpdate extends Update { - /** - * Specifies that virtual machine's system assigned (local) identity should have the given access (described - * by the role) on an ARM resource identified by the resource ID. Applications running on the virtual - * machine will have the same permission (role) on the ARM resource. - * - * @param resourceId the ARM identifier of the resource - * @param role access role to assigned to the virtual machine's local identity - * @return the next stage of the update - */ - WithSystemAssignedIdentityBasedAccessOrUpdate withSystemAssignedIdentityBasedAccessTo( - String resourceId, BuiltInRole role); - - /** - * Specifies that virtual machine's system assigned (local) identity should have the given access (described - * by the role) on the resource group that virtual machine resides. Applications running on the virtual - * machine will have the same permission (role) on the resource group. - * - * @param role access role to assigned to the virtual machine's local identity - * @return the next stage of the update - */ - WithSystemAssignedIdentityBasedAccessOrUpdate withSystemAssignedIdentityBasedAccessToCurrentResourceGroup( - BuiltInRole role); - - /** - * Specifies that virtual machine's system assigned (local) identity should have the access (described by - * the role definition) on an ARM resource identified by the resource ID. Applications running on the - * virtual machine will have the same permission (role) on the ARM resource. - * - * @param resourceId scope of the access represented in ARM resource ID format - * @param roleDefinitionId access role definition to assigned to the virtual machine's local identity - * @return the next stage of the update - */ - WithSystemAssignedIdentityBasedAccessOrUpdate withSystemAssignedIdentityBasedAccessTo( - String resourceId, String roleDefinitionId); - - /** - * Specifies that virtual machine's system assigned (local) identity should have the access (described by - * the role definition) on the resource group that virtual machine resides. Applications running on the - * virtual machine will have the same permission (role) on the resource group. - * - * @param roleDefinitionId access role definition to assigned to the virtual machine's local identity - * @return the next stage of the update - */ - WithSystemAssignedIdentityBasedAccessOrUpdate withSystemAssignedIdentityBasedAccessToCurrentResourceGroup( - String roleDefinitionId); - } - - /** - * The stage of the virtual machine update allowing to add or remove User Assigned (External) Managed Service - * Identities. - */ - interface WithUserAssignedManagedServiceIdentity { - /** - * Specifies the definition of a not-yet-created user assigned identity to be associated with the virtual - * machine. - * - * @param creatableIdentity a creatable identity definition - * @return the next stage of the virtual machine update - */ - Update withNewUserAssignedManagedServiceIdentity(Creatable creatableIdentity); - - /** - * Specifies an existing user assigned identity to be associated with the virtual machine. - * - * @param identity the identity - * @return the next stage of the virtual machine update - */ - Update withExistingUserAssignedManagedServiceIdentity(Identity identity); - - /** - * Specifies that an user assigned identity associated with the virtual machine should be removed. - * - * @param identityId ARM resource id of the identity - * @return the next stage of the virtual machine update - */ - Update withoutUserAssignedManagedServiceIdentity(String identityId); - } - - /** - * The stage of the virtual machine update allowing to specify that the image or disk that is being used was - * licensed on-premises. This element is only used for images that contain the Windows Server operating system. - */ - interface WithLicenseType { - /** - * Specifies that the image or disk that is being used was licensed on-premises. - * - * @param licenseType license type - * @return the next stage of the virtual machine update - */ - Update withLicenseType(String licenseType); - } - } - - /** The template for an update operation, containing all the settings that can be modified. */ - interface Update - extends Appliable, - Resource.UpdateWithTags, - UpdateStages.WithProximityPlacementGroup, - UpdateStages.WithUnmanagedDataDisk, - UpdateStages.WithManagedDataDisk, - UpdateStages.WithSecondaryNetworkInterface, - UpdateStages.WithExtension, - UpdateStages.WithBootDiagnostics, - UpdateStages.WithBillingProfile, - UpdateStages.WithSystemAssignedManagedServiceIdentity, - UpdateStages.WithUserAssignedManagedServiceIdentity, - UpdateStages.WithLicenseType { - /** - * Specifies the encryption settings for the OS Disk. - * - * @param settings the encryption settings. - * @return the stage representing creatable VM update - */ - Update withOSDiskEncryptionSettings(DiskEncryptionSettings settings); - - /** - * Specifies the default caching type for the managed data disks. - * - * @param cachingType a caching type - * @return the next stage of the update - */ - Update withDataDiskDefaultCachingType(CachingTypes cachingType); - - /** - * Specifies a storage account type. - * - * @param storageAccountType a storage account type - * @return the next stage of the update - */ - Update withDataDiskDefaultStorageAccountType(StorageAccountTypes storageAccountType); - - /** - * Specifies the caching type for the OS disk. - * - * @param cachingType a caching type. - * @return the next stage of the update - */ - Update withOSDiskCaching(CachingTypes cachingType); - - /** - * Specifies the size of the OS disk in GB. - * - *

    Only unmanaged disks may be resized as part of a VM update. Managed disks must be resized separately, - * using managed disk API. - * - * @param size a disk size. - * @return the next stage of the update - */ - Update withOSDiskSizeInGB(int size); - - /** - * Specifies a new size for the virtual machine. - * - * @param sizeName the name of a size for the virtual machine as text - * @return the next stage of the update - */ - Update withSize(String sizeName); - - /** - * Specifies a new size for the virtual machine. - * - * @param size a size from the list of available sizes for the virtual machine - * @return the next stage of the definition - */ - Update withSize(VirtualMachineSizeTypes size); - - /** - * Specifies a new priority for the virtual machine. - * - * @param priority a priority from the list of available priority types - * @return the next stage of the update - */ - Update withPriority(VirtualMachinePriorityTypes priority); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineAgentInstanceView.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineAgentInstanceView.java deleted file mode 100644 index df587cf962b5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineAgentInstanceView.java +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The instance view of the VM Agent running on the virtual machine. */ -@Fluent -public final class VirtualMachineAgentInstanceView { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineAgentInstanceView.class); - - /* - * The VM Agent full version. - */ - @JsonProperty(value = "vmAgentVersion") - private String vmAgentVersion; - - /* - * The virtual machine extension handler instance view. - */ - @JsonProperty(value = "extensionHandlers") - private List extensionHandlers; - - /* - * The resource status information. - */ - @JsonProperty(value = "statuses") - private List statuses; - - /** - * Get the vmAgentVersion property: The VM Agent full version. - * - * @return the vmAgentVersion value. - */ - public String vmAgentVersion() { - return this.vmAgentVersion; - } - - /** - * Set the vmAgentVersion property: The VM Agent full version. - * - * @param vmAgentVersion the vmAgentVersion value to set. - * @return the VirtualMachineAgentInstanceView object itself. - */ - public VirtualMachineAgentInstanceView withVmAgentVersion(String vmAgentVersion) { - this.vmAgentVersion = vmAgentVersion; - return this; - } - - /** - * Get the extensionHandlers property: The virtual machine extension handler instance view. - * - * @return the extensionHandlers value. - */ - public List extensionHandlers() { - return this.extensionHandlers; - } - - /** - * Set the extensionHandlers property: The virtual machine extension handler instance view. - * - * @param extensionHandlers the extensionHandlers value to set. - * @return the VirtualMachineAgentInstanceView object itself. - */ - public VirtualMachineAgentInstanceView withExtensionHandlers( - List extensionHandlers) { - this.extensionHandlers = extensionHandlers; - return this; - } - - /** - * Get the statuses property: The resource status information. - * - * @return the statuses value. - */ - public List statuses() { - return this.statuses; - } - - /** - * Set the statuses property: The resource status information. - * - * @param statuses the statuses value to set. - * @return the VirtualMachineAgentInstanceView object itself. - */ - public VirtualMachineAgentInstanceView withStatuses(List statuses) { - this.statuses = statuses; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (extensionHandlers() != null) { - extensionHandlers().forEach(e -> e.validate()); - } - if (statuses() != null) { - statuses().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineCaptureParameters.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineCaptureParameters.java deleted file mode 100644 index dff175d2ddf0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineCaptureParameters.java +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Capture Virtual Machine parameters. */ -@Fluent -public final class VirtualMachineCaptureParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineCaptureParameters.class); - - /* - * The captured virtual hard disk's name prefix. - */ - @JsonProperty(value = "vhdPrefix", required = true) - private String vhdPrefix; - - /* - * The destination container name. - */ - @JsonProperty(value = "destinationContainerName", required = true) - private String destinationContainerName; - - /* - * Specifies whether to overwrite the destination virtual hard disk, in - * case of conflict. - */ - @JsonProperty(value = "overwriteVhds", required = true) - private boolean overwriteVhds; - - /** - * Get the vhdPrefix property: The captured virtual hard disk's name prefix. - * - * @return the vhdPrefix value. - */ - public String vhdPrefix() { - return this.vhdPrefix; - } - - /** - * Set the vhdPrefix property: The captured virtual hard disk's name prefix. - * - * @param vhdPrefix the vhdPrefix value to set. - * @return the VirtualMachineCaptureParameters object itself. - */ - public VirtualMachineCaptureParameters withVhdPrefix(String vhdPrefix) { - this.vhdPrefix = vhdPrefix; - return this; - } - - /** - * Get the destinationContainerName property: The destination container name. - * - * @return the destinationContainerName value. - */ - public String destinationContainerName() { - return this.destinationContainerName; - } - - /** - * Set the destinationContainerName property: The destination container name. - * - * @param destinationContainerName the destinationContainerName value to set. - * @return the VirtualMachineCaptureParameters object itself. - */ - public VirtualMachineCaptureParameters withDestinationContainerName(String destinationContainerName) { - this.destinationContainerName = destinationContainerName; - return this; - } - - /** - * Get the overwriteVhds property: Specifies whether to overwrite the destination virtual hard disk, in case of - * conflict. - * - * @return the overwriteVhds value. - */ - public boolean overwriteVhds() { - return this.overwriteVhds; - } - - /** - * Set the overwriteVhds property: Specifies whether to overwrite the destination virtual hard disk, in case of - * conflict. - * - * @param overwriteVhds the overwriteVhds value to set. - * @return the VirtualMachineCaptureParameters object itself. - */ - public VirtualMachineCaptureParameters withOverwriteVhds(boolean overwriteVhds) { - this.overwriteVhds = overwriteVhds; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (vhdPrefix() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property vhdPrefix in model VirtualMachineCaptureParameters")); - } - if (destinationContainerName() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property destinationContainerName in model VirtualMachineCaptureParameters")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineCustomImage.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineCustomImage.java deleted file mode 100644 index f74fb1ac42e8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineCustomImage.java +++ /dev/null @@ -1,403 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.compute.ComputeManager; -import com.azure.resourcemanager.compute.fluent.models.ImageInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.ChildResource; -import com.azure.resourcemanager.resources.fluentcore.arm.models.GroupableResource; -import com.azure.resourcemanager.resources.fluentcore.arm.models.Resource; -import com.azure.resourcemanager.resources.fluentcore.model.Attachable; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; -import java.util.Map; - -/** An immutable client-side representation of an Azure virtual machine custom image. */ -@Fluent -public interface VirtualMachineCustomImage - extends GroupableResource, Refreshable { - /** @return true if this image was created by capturing a virtual machine */ - boolean isCreatedFromVirtualMachine(); - - /** @return the hyper v Generation */ - HyperVGenerationTypes hyperVGeneration(); - - /** @return ID of the virtual machine if this image was created by capturing that virtual machine */ - String sourceVirtualMachineId(); - - /** @return operating system disk image in this image */ - ImageOSDisk osDiskImage(); - - /** @return data disk images in this image, indexed by the disk LUN */ - Map dataDiskImages(); - - /** The entirety of the image definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithGroup, - DefinitionStages.WithHyperVGeneration, - DefinitionStages.WithOSDiskImageSourceAltVirtualMachineSource, - DefinitionStages.WithOSDiskImageSource, - DefinitionStages.WithSourceVirtualMachine, - DefinitionStages.WithCreateAndDataDiskImageOSDiskSettings { - } - - /** Grouping of image definition stages. */ - interface DefinitionStages { - /** The first stage of a image definition. */ - interface Blank extends GroupableResource.DefinitionWithRegion { - } - - /** The stage of the image definition allowing to specify the resource group. */ - interface WithGroup extends GroupableResource.DefinitionStages.WithGroup { - } - - /** - * The stage of the image definition that allows choosing between using a virtual machine as the source for OS - * and the data disk images or beginning an OS disk image definition. - */ - interface WithOSDiskImageSourceAltVirtualMachineSource extends WithOSDiskImageSource, WithSourceVirtualMachine { - } - - /** - * The stage of the image definition that allows us to choose a hyper V generation. Default, if this stage is - * not added will be hyperV gen 1. - */ - interface WithHyperVGeneration extends WithOSDiskImageSourceAltVirtualMachineSource { - /** - * Specifies the Hyper-V generation. - * - * @param hyperVGeneration the Hyper-V generation - * @return the next stage of the definition - */ - WithOSDiskImageSourceAltVirtualMachineSource withHyperVGeneration(HyperVGenerationTypes hyperVGeneration); - } - - /** The stage of the image definition allowing to choose an OS source and an OS state for the OS image. */ - interface WithOSDiskImageSource { - /** - * Specifies the Windows source native VHD for the OS disk image. - * - * @param sourceVhdUrl source Windows virtual hard disk URL - * @param osState operating system state - * @return the next stage of the definition - */ - WithCreateAndDataDiskImageOSDiskSettings withWindowsFromVhd( - String sourceVhdUrl, OperatingSystemStateTypes osState); - - /** - * Specifies the Linux source native VHD for the OS disk image. - * - * @param sourceVhdUrl source Linux virtual hard disk URL - * @param osState operating system state - * @return the next stage of the definition - */ - WithCreateAndDataDiskImageOSDiskSettings withLinuxFromVhd( - String sourceVhdUrl, OperatingSystemStateTypes osState); - - /** - * Specifies the Windows source snapshot for the OS disk image. - * - * @param sourceSnapshot source snapshot resource - * @param osState operating system state - * @return the next stage of the definition - */ - WithCreateAndDataDiskImageOSDiskSettings withWindowsFromSnapshot( - Snapshot sourceSnapshot, OperatingSystemStateTypes osState); - - /** - * Specifies the Linux source snapshot for the OS disk image. - * - * @param sourceSnapshot source snapshot resource - * @param osState operating system state - * @return the next stage of the definition - */ - WithCreateAndDataDiskImageOSDiskSettings withLinuxFromSnapshot( - Snapshot sourceSnapshot, OperatingSystemStateTypes osState); - - /** - * Specifies the Windows source snapshot for the OS disk image. - * - * @param sourceSnapshotId source snapshot resource ID - * @param osState operating system state - * @return the next stage of the definition - */ - WithCreateAndDataDiskImageOSDiskSettings withWindowsFromSnapshot( - String sourceSnapshotId, OperatingSystemStateTypes osState); - - /** - * Specifies the Linux source snapshot for the OS disk image. - * - * @param sourceSnapshotId source snapshot resource ID - * @param osState operating system state - * @return the next stage of the definition - */ - WithCreateAndDataDiskImageOSDiskSettings withLinuxFromSnapshot( - String sourceSnapshotId, OperatingSystemStateTypes osState); - - /** - * Specifies the Windows source managed disk for the OS disk image. - * - * @param sourceManagedDiskId source managed disk resource ID - * @param osState operating system state - * @return the next stage of the definition - */ - WithCreateAndDataDiskImageOSDiskSettings withWindowsFromDisk( - String sourceManagedDiskId, OperatingSystemStateTypes osState); - - /** - * Specifies the Linux source managed disk for the OS disk image. - * - * @param sourceManagedDiskId source managed disk resource ID - * @param osState operating system state - * @return the next stage of the definition - */ - WithCreateAndDataDiskImageOSDiskSettings withLinuxFromDisk( - String sourceManagedDiskId, OperatingSystemStateTypes osState); - - /** - * Specifies the Windows source managed disk for the OS disk image. - * - * @param sourceManagedDisk source managed disk - * @param osState operating system state - * @return the next stage of the definition - */ - WithCreateAndDataDiskImageOSDiskSettings withWindowsFromDisk( - Disk sourceManagedDisk, OperatingSystemStateTypes osState); - - /** - * Specifies the Linux source managed disk for the OS disk image. - * - * @param sourceManagedDisk source managed disk - * @param osState operating system state - * @return the next stage of the definition - */ - WithCreateAndDataDiskImageOSDiskSettings withLinuxFromDisk( - Disk sourceManagedDisk, OperatingSystemStateTypes osState); - } - - /** The stage of the image definition allowing to choose source virtual machine. */ - interface WithSourceVirtualMachine { - /** - * Uses the virtual machine's OS disk and data disks as the source for OS disk image and data disk images of - * this image. - * - * @param virtualMachineId source virtual machine resource ID - * @return the next stage of the definition - */ - WithCreate fromVirtualMachine(String virtualMachineId); - - /** - * Uses the virtual machine's OS and data disks as the sources for OS disk image and data disk images of - * this image. - * - * @param virtualMachine source virtual machine - * @return the next stage of the definition - */ - WithCreate fromVirtualMachine(VirtualMachine virtualMachine); - } - - /** - * The stage of an image definition allowing to create the image or add optional data disk images and configure - * OS disk settings. - */ - interface WithCreateAndDataDiskImageOSDiskSettings extends WithCreate, WithOSDiskSettings, WithDataDiskImage { - } - - /** - * The stage of an image definition allowing to specify configurations for the OS disk when it is created from - * the image's OS disk image. - */ - interface WithOSDiskSettings { - /** - * Specifies the size in GB for OS disk. - * - * @param diskSizeGB the disk size in GB - * @return the next stage of the definition - */ - WithCreateAndDataDiskImageOSDiskSettings withOSDiskSizeInGB(int diskSizeGB); - - /** - * Specifies the caching type for OS disk. - * - * @param cachingType the disk caching type - * @return the next stage of the definition - */ - WithCreateAndDataDiskImageOSDiskSettings withOSDiskCaching(CachingTypes cachingType); - } - - /** The stage of an image definition allowing to add a data disk image. */ - interface WithDataDiskImage { - /** - * Adds a data disk image with a virtual hard disk as the source. - * - * @param sourceVhdUrl source virtual hard disk URL - * @return the next stage of the definition - */ - WithCreateAndDataDiskImageOSDiskSettings withDataDiskImageFromVhd(String sourceVhdUrl); - - /** - * Adds a data disk image with an existing snapshot as the source. - * - * @param sourceSnapshotId source snapshot resource ID - * @return the next stage of the definition - */ - WithCreateAndDataDiskImageOSDiskSettings withDataDiskImageFromSnapshot(String sourceSnapshotId); - - /** - * Adds a data disk image with an existing managed disk as the source. - * - * @param sourceManagedDiskId source managed disk resource ID - * @return the next stage of the definition - */ - WithCreateAndDataDiskImageOSDiskSettings withDataDiskImageFromManagedDisk(String sourceManagedDiskId); - - /** - * Begins the definition of a new data disk image to add to the image. - * - * @return the first stage of the new data disk image definition - */ - CustomImageDataDisk.DefinitionStages.Blank defineDataDiskImage(); - } - - /** The stage of an image definition allowing to enable zone resiliency. */ - interface WithZoneResilient { - /** - * Specifies that zone resiliency should be enabled for the image. - * - * @return the next stage of the definition - */ - WithCreate withZoneResilient(); - } - - /** - * The stage of an image definition containing all the required inputs for the resource to be created, but also - * allowing for any other optional settings to be specified. - */ - interface WithCreate - extends DefinitionStages.WithZoneResilient, - Creatable, - Resource.DefinitionWithTags { - } - } - - /** An immutable client-side representation of a data disk image in an image resource. */ - @Fluent - interface CustomImageDataDisk extends HasInnerModel, ChildResource { - /** Grouping of data disk image definition stages. */ - interface DefinitionStages { - /** - * The first stage of the data disk image definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface Blank extends WithDiskLun { - } - - /** - * The stage of the image definition allowing to specify the LUN for the disk image. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithDiskLun { - /** - * Specifies the LUN for the data disk to be created from the disk image. - * - * @param lun the unique LUN for the data disk - * @return the next stage of the definition - */ - WithImageSource withLun(int lun); - } - - /** - * The stage of the image definition allowing to choose the source of the data disk image. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithImageSource { - /** - * Specifies the source VHD for the data disk image. - * - * @param sourceVhdUrl source virtual hard disk URL - * @return the next stage of the definition - */ - WithAttach fromVhd(String sourceVhdUrl); - - /** - * Specifies the source snapshot for the data disk image. - * - * @param sourceSnapshotId source snapshot resource ID - * @return the next stage of the definition - */ - WithAttach fromSnapshot(String sourceSnapshotId); - - /** - * Specifies the source managed disk for the data disk image. - * - * @param sourceManagedDiskId source managed disk resource ID - * @return the next stage of the definition - */ - WithAttach fromManagedDisk(String sourceManagedDiskId); - - /** - * Specifies the source managed disk for the data disk image. - * - * @param sourceManagedDisk source managed disk - * @return the next stage of the definition - */ - WithAttach fromManagedDisk(Disk sourceManagedDisk); - } - - /** - * The stage of data disk image definition allowing to specify configurations for the data disk when it is - * created from the same data disk image. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithDiskSettings { - /** - * Specifies the size in GB for data disk. - * - * @param diskSizeGB the disk size in GB - * @return the next stage of the definition - */ - WithAttach withDiskSizeInGB(int diskSizeGB); - - /** - * Specifies the caching type for data disk. - * - * @param cachingType the disk caching type - * @return the next stage of the definition - */ - WithAttach withDiskCaching(CachingTypes cachingType); - } - - /** - * The final stage of the data disk image definition. - * - *

    At this stage, any remaining optional settings can be specified, or the data disk definition can be - * attached to the parent image definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithAttach extends Attachable.InDefinition, WithDiskSettings { - } - } - - /** - * The entirety of a data disk image definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithDiskLun, - DefinitionStages.WithImageSource, - DefinitionStages.WithDiskSettings, - DefinitionStages.WithAttach { - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineCustomImages.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineCustomImages.java deleted file mode 100644 index 5e71661ff4fc..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineCustomImages.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.compute.ComputeManager; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsBatchDeletion; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsDeletingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsListingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsBatchCreation; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsCreating; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingById; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; - -/** Entry point to custom virtual machine image management. */ -@Fluent -public interface VirtualMachineCustomImages - extends SupportsListing, - SupportsCreating, - SupportsDeletingById, - SupportsListingByResourceGroup, - SupportsGettingByResourceGroup, - SupportsGettingById, - SupportsDeletingByResourceGroup, - SupportsBatchCreation, - SupportsBatchDeletion, - HasManager { -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineDataDisk.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineDataDisk.java deleted file mode 100644 index 79b46f11ab5c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineDataDisk.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasId; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasName; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; - -/** A managed data disk of a virtual machine. */ -@Fluent -public interface VirtualMachineDataDisk extends HasInnerModel, HasName, HasId { - /** @return the size of this data disk in GB */ - int size(); - - /** @return the logical unit number assigned to this data disk */ - int lun(); - - /** @return the disk caching type */ - CachingTypes cachingType(); - - /** @return the creation method used while creating this disk */ - DiskCreateOptionTypes creationMethod(); - - /** @return the storage account type of the disk */ - StorageAccountTypes storageAccountType(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineEncryption.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineEncryption.java deleted file mode 100644 index a8221dbd1593..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineEncryption.java +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import reactor.core.publisher.Mono; - -/** Virtual machine encryption related operations. */ -@Fluent -public interface VirtualMachineEncryption { - /** - * Enable encryption for virtual machine disks. Legacy encryption extension will be used to enable encryption. - * - * @param keyVaultId resource ID of the key vault to store the disk encryption key - * @param aadClientId client ID of an AAD application which has permission to the key vault - * @param aadSecret client secret corresponding to the aadClientId - * @return a representation of the deferred computation of this call, returning the current volume encryption status - */ - Mono enableAsync(String keyVaultId, String aadClientId, String aadSecret); - - /** - * Enable encryption for virtual machine disks. NoAAD encryption extension will be used to enable encryption. - * - * @param keyVaultId resource ID of the key vault to store the disk encryption key - * @return a representation of the deferred computation of this call, returning the current volume encryption status - */ - Mono enableAsync(String keyVaultId); - - /** - * Enable encryption for Windows virtual machine disks. - * - * @param encryptionSettings encryption settings for windows virtual machine - * @return a representation of the deferred computation of this call, returning the current volume encryption status - */ - Mono enableAsync(WindowsVMDiskEncryptionConfiguration encryptionSettings); - - /** - * Enable encryption for Linux virtual machine disks. - * - * @param encryptionSettings encryption settings for windows virtual machine - * @return a representation of the deferred computation of this call, returning the current volume encryption status - */ - Mono enableAsync(LinuxVMDiskEncryptionConfiguration encryptionSettings); - - /** - * Disable encryption for virtual machine disks. - * - * @param volumeType volume type to disable encryption - * @return a representation of the deferred computation of this call, returning the current volume decryption status - */ - Mono disableAsync(DiskVolumeType volumeType); - - /** @return observable that emits current volume encryption/decryption status */ - Mono getMonitorAsync(); - - /** - * Enable encryption for virtual machine disks. - * - * @param keyVaultId resource ID of the key vault to store the disk encryption key - * @param aadClientId client ID of an AAD application which has permission to the key vault - * @param aadSecret client secret corresponding to the aadClientId - * @return current volume decryption status - */ - DiskVolumeEncryptionMonitor enable(String keyVaultId, String aadClientId, String aadSecret); - - /** - * Enable encryption for virtual machine disks. NoAAD encryption extension will be used to enable encryption. - * - * @param keyVaultId resource ID of the key vault to store the disk encryption key - * @return current volume decryption status - */ - DiskVolumeEncryptionMonitor enable(String keyVaultId); - - /** - * Enable encryption for Windows virtual machine disks. - * - * @param encryptionSettings encryption settings for windows virtual machine - * @return current volume encryption status - */ - DiskVolumeEncryptionMonitor enable(WindowsVMDiskEncryptionConfiguration encryptionSettings); - - /** - * Enable encryption for Linux virtual machine disks. - * - * @param encryptionSettings encryption settings for windows virtual machine - * @return current volume encryption status - */ - DiskVolumeEncryptionMonitor enable(LinuxVMDiskEncryptionConfiguration encryptionSettings); - - /** - * Disable encryption for virtual machine disks. - * - * @param volumeType volume type to disable encryption - * @return current volume encryption status - */ - DiskVolumeEncryptionMonitor disable(DiskVolumeType volumeType); - - /** @return current volume decryption status */ - DiskVolumeEncryptionMonitor getMonitor(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineEncryptionConfiguration.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineEncryptionConfiguration.java deleted file mode 100644 index 4a7610cbc6e3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineEncryptionConfiguration.java +++ /dev/null @@ -1,226 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.management.AzureEnvironment; -import com.azure.core.util.CoreUtils; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils; - -import java.util.Locale; -import java.util.Objects; - -/** - * Type representing encryption configuration to be applied to a virtual machine. - * - * @param type presenting Windows or Linux specific settings - */ -public abstract class VirtualMachineEncryptionConfiguration> { - /** - * The KeyVault ID. - */ - protected final String keyVaultId; - - /** - * The AAD client ID. - */ - protected final String aadClientId; - - /** - * The AAD secret. - */ - protected final String aadSecret; - - /** - * The volume type. - */ - protected DiskVolumeType volumeType = DiskVolumeType.ALL; - - /** - * The key encryption key URL. - */ - protected String keyEncryptionKeyUrl; - - /** - * The key encryption key KeyVault ID. - */ - protected String keyEncryptionKeyVaultId; - - /** - * The encryption algorithm. - */ - protected String encryptionAlgorithm = "RSA-OAEP"; - - /** - * The pass phrase. - */ - protected String passPhrase; - - /** - * The AzureEnvironment. - */ - protected final AzureEnvironment azureEnvironment; - - /** - * The KeyVault URI. - */ - protected final String vaultUri; - - /** - * Creates VirtualMachineEncryptionConfiguration. - * - * @param keyVaultId resource ID of the KeyVault to store the disk encryption key - * @param vaultUri URI of the key vault data-plane endpoint - * @param aadClientId AAD application client ID to access the KeyVault - * @param aadSecret AAD application client secret to access the KeyVault - * @param azureEnvironment Azure environment - */ - protected VirtualMachineEncryptionConfiguration(String keyVaultId, String vaultUri, - String aadClientId, String aadSecret, - AzureEnvironment azureEnvironment) { - this.keyVaultId = - Objects - .requireNonNull( - keyVaultId, - "KeyVaultId parameter holding resource id of the KeyVault to store disk encryption key is" - + " required."); - this.aadClientId = - Objects - .requireNonNull( - aadClientId, "aadClientId parameter holding AAD client id to access the KeyVault is required."); - this.aadSecret = - Objects - .requireNonNull( - aadSecret, "aadSecret parameter holding AAD secret to access the KeyVault is required."); - this.vaultUri = vaultUri; - this.azureEnvironment = azureEnvironment; - } - - /** - * Creates VirtualMachineEncryptionConfiguration. - * - * @param keyVaultId resource ID of the KeyVault to store the disk encryption key - * @param vaultUri URI of the key vault data-plane endpoint - * @param azureEnvironment Azure environment - * */ - protected VirtualMachineEncryptionConfiguration(String keyVaultId, String vaultUri, - AzureEnvironment azureEnvironment) { - Objects - .requireNonNull( - keyVaultId, - "KeyVaultId parameter holding resource id of the keyVault to store disk encryption key is required."); - this.keyVaultId = keyVaultId; - this.aadClientId = null; - this.aadSecret = null; - this.vaultUri = vaultUri; - this.azureEnvironment = azureEnvironment; - } - - /** @return the operating system type */ - public abstract OperatingSystemTypes osType(); - - /** @return the AAD application client ID to access the key vault */ - public String aadClientId() { - return this.aadClientId; - } - - /** @return the AAD application client secret to access the key vault */ - public String aadSecret() { - return this.aadSecret; - } - - /** @return type of the volume to perform encryption operation */ - public DiskVolumeType volumeType() { - if (this.volumeType != null) { - return this.volumeType; - } - return DiskVolumeType.ALL; - } - - /** @return resource ID of the key vault to store the disk encryption key */ - public String keyVaultId() { - return this.keyVaultId; - } - - /** @return URL to the key vault to store the disk encryption key */ - public String keyVaultUrl() { - if (vaultUri != null) { - return vaultUri; - } - - String keyVaultDnsSuffix = - (azureEnvironment == null || CoreUtils.isNullOrEmpty(azureEnvironment.getKeyVaultDnsSuffix())) - ? AzureEnvironment.AZURE.getKeyVaultDnsSuffix() - : azureEnvironment.getKeyVaultDnsSuffix(); - String keyVaultName = ResourceUtils.nameFromResourceId(this.keyVaultId); - return String.format("https://%1$s%2$s", keyVaultName.toLowerCase(Locale.ROOT), keyVaultDnsSuffix); - } - - /** @return resource ID of the Key Vault holding key encryption key (KEK) */ - public String keyEncryptionKeyVaultId() { - return this.keyEncryptionKeyVaultId; - } - - /** @return key vault URL to the key (KEK) to protect (encrypt) the disk-encryption key */ - public String keyEncryptionKeyUrl() { - return this.keyEncryptionKeyUrl; - } - - /** @return the algorithm used to encrypt the disk-encryption key */ - public String volumeEncryptionKeyEncryptAlgorithm() { - return this.encryptionAlgorithm; - } - - /** @return the pass phrase to encrypt Linux OS and data disks */ - public String linuxPassPhrase() { - return this.passPhrase; - } - - /** - * Specifies the volume to encrypt. - * - * @param volumeType the volume type - * @return VirtualMachineEncryptionConfiguration - */ - @SuppressWarnings("unchecked") - public T withVolumeType(DiskVolumeType volumeType) { - this.volumeType = volumeType; - return (T) this; - } - - /** - * Specifies the Key Vault URL to the key for protecting or wrapping the disk-encryption key. - * - * @param keyEncryptionKeyUrl the key (KEK) URL - * @return VirtualMachineEncryptionConfiguration - */ - public T withVolumeEncryptionKeyEncrypted(String keyEncryptionKeyUrl) { - return withVolumeEncryptionKeyEncrypted(keyEncryptionKeyUrl, null); - } - - /** - * Specifies the and key vault Id and a vault URL to the key for protecting or wrapping the disk-encryption key. - * - * @param keyEncryptionKeyUrl the key (KEK) URL - * @param keyEncryptionKeyKevVaultId resource ID of the keyVault storing KEK - * @return VirtualMachineEncryptionConfiguration - */ - @SuppressWarnings("unchecked") - public T withVolumeEncryptionKeyEncrypted(String keyEncryptionKeyUrl, String keyEncryptionKeyKevVaultId) { - this.keyEncryptionKeyUrl = keyEncryptionKeyUrl; - this.keyEncryptionKeyVaultId = keyEncryptionKeyKevVaultId; - return (T) this; - } - - /** - * Specifies the algorithm used to encrypt the disk-encryption key. - * - * @param encryptionAlgorithm the algorithm - * @return VirtualMachineEncryptionConfiguration - */ - @SuppressWarnings("unchecked") - public T withVolumeEncryptionKeyEncryptAlgorithm(String encryptionAlgorithm) { - this.encryptionAlgorithm = encryptionAlgorithm; - return (T) this; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineEvictionPolicyTypes.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineEvictionPolicyTypes.java deleted file mode 100644 index d611fc08c4c4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineEvictionPolicyTypes.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for VirtualMachineEvictionPolicyTypes. */ -public final class VirtualMachineEvictionPolicyTypes extends ExpandableStringEnum { - /** Static value Deallocate for VirtualMachineEvictionPolicyTypes. */ - public static final VirtualMachineEvictionPolicyTypes DEALLOCATE = fromString("Deallocate"); - - /** Static value Delete for VirtualMachineEvictionPolicyTypes. */ - public static final VirtualMachineEvictionPolicyTypes DELETE = fromString("Delete"); - - /** - * Creates or finds a VirtualMachineEvictionPolicyTypes from its string representation. - * - * @param name a name to look for. - * @return the corresponding VirtualMachineEvictionPolicyTypes. - */ - @JsonCreator - public static VirtualMachineEvictionPolicyTypes fromString(String name) { - return fromString(name, VirtualMachineEvictionPolicyTypes.class); - } - - /** @return known VirtualMachineEvictionPolicyTypes values. */ - public static Collection values() { - return values(VirtualMachineEvictionPolicyTypes.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineExtension.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineExtension.java deleted file mode 100644 index 00190d2d8879..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineExtension.java +++ /dev/null @@ -1,498 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.arm.models.ExternalChildResource; -import com.azure.resourcemanager.resources.fluentcore.model.Attachable; -import com.azure.resourcemanager.resources.fluentcore.model.Settable; -import java.util.HashMap; -import java.util.Map; -import reactor.core.publisher.Mono; - -/** An immutable client-side representation of an Azure virtual machine extension. */ -@Fluent -public interface VirtualMachineExtension - extends VirtualMachineExtensionBase, ExternalChildResource { - /** - * @return a representation of the deferred computation of this call returning the virtual machine extension - * instance view - */ - Mono getInstanceViewAsync(); - - /** @return the instance view of the virtual machine extension */ - VirtualMachineExtensionInstanceView getInstanceView(); - - /** Grouping of virtual machine extension definition stages as a part of parent virtual machine definition. */ - interface DefinitionStages { - /** - * The first stage of a virtual machine extension definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface Blank extends WithImageOrPublisher { - } - - /** - * The stage of the virtual machine extension definition allowing to specify extension image or specify name of - * the virtual machine extension publisher. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithImageOrPublisher extends WithPublisher { - /** - * Specifies the virtual machine extension image to use. - * - * @param image the image - * @return the next stage of the definition - */ - WithAttach withImage(VirtualMachineExtensionImage image); - } - - /** - * The stage of the virtual machine extension definition allowing to specify the publisher of the virtual - * machine extension image this extension is based on. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithPublisher { - /** - * Specifies the name of the virtual machine extension image publisher. - * - * @param extensionImagePublisherName the publisher name - * @return the next stage of the definition - */ - WithType withPublisher(String extensionImagePublisherName); - } - - /** - * The stage of the virtual machine extension definition allowing to specify the type of the virtual machine - * extension image this extension is based on. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithType { - /** - * Specifies the type of the virtual machine extension image. - * - * @param extensionImageTypeName the image type name - * @return the next stage of the definition - */ - WithVersion withType(String extensionImageTypeName); - } - - /** - * The stage of the virtual machine extension definition allowing to specify the type of the virtual machine - * extension version this extension is based on. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithVersion { - /** - * Specifies the version of the virtual machine image extension. - * - * @param extensionImageVersionName the version name - * @return the next stage of the definition - */ - WithAttach withVersion(String extensionImageVersionName); - } - - /** - * The final stage of the virtual machine extension definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithAttach - extends Attachable.InDefinition, - WithAutoUpgradeMinorVersion, - WithSettings, - WithTags { - } - - /** - * The stage of the virtual machine extension definition allowing to enable or disable auto upgrade of the - * extension when when a new minor version of virtual machine extension image gets published. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithAutoUpgradeMinorVersion { - /** - * enables auto upgrade of the extension. - * - * @return the next stage of the definition - */ - WithAttach withMinorVersionAutoUpgrade(); - - /** - * disables auto upgrade of the extension. - * - * @return the next stage of the definition - */ - WithAttach withoutMinorVersionAutoUpgrade(); - } - - /** - * The stage of the virtual machine extension definition allowing to specify the public and private settings. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithSettings { - /** - * Specifies a public settings entry. - * - * @param key the key of a public settings entry - * @param value the value of the public settings entry - * @return the next stage of the definition - */ - WithAttach withPublicSetting(String key, Object value); - - /** - * Specifies a private settings entry. - * - * @param key the key of a private settings entry - * @param value the value of the private settings entry - * @return the next stage of the definition - */ - WithAttach withProtectedSetting(String key, Object value); - - /** - * Specifies public settings. - * - * @param settings the public settings - * @return the next stage of the definition - */ - WithAttach withPublicSettings(HashMap settings); - - /** - * Specifies private settings. - * - * @param settings the private settings - * @return the next stage of the definition - */ - WithAttach withProtectedSettings(HashMap settings); - } - - /** - * The stage of the virtual machine extension definition allowing to specify the tags. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithTags { - /** - * Specifies tags for the virtual machine extension. - * - * @param tags the tags to associate - * @return the next stage of the definition - */ - WithAttach withTags(Map tags); - - /** - * Adds a tag to the virtual machine extension. - * - * @param key the key for the tag - * @param value the value for the tag - * @return the next stage of the definition - */ - WithAttach withTag(String key, String value); - } - } - - /** - * The entirety of a virtual machine extension definition as a part of parent definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithImageOrPublisher, - DefinitionStages.WithPublisher, - DefinitionStages.WithType, - DefinitionStages.WithVersion, - DefinitionStages.WithAttach { - } - - /** Grouping of virtual machine extension definition stages as part of parent virtual machine update. */ - interface UpdateDefinitionStages { - /** - * The first stage of a virtual machine extension definition. - * - * @param the stage of the parent update to return to after attaching this definition - */ - interface Blank extends WithImageOrPublisher { - } - - /** - * The stage of the virtual machine extension allowing to specify extension image or specify name of the virtual - * machine extension publisher. - * - * @param the stage of the parent update to return to after attaching this definition - */ - interface WithImageOrPublisher extends WithPublisher { - /** - * Specifies the virtual machine extension image to use. - * - * @param image the image - * @return the next stage of the definition - */ - WithAttach withImage(VirtualMachineExtensionImage image); - } - - /** - * The stage of the virtual machine extension definition allowing to specify the publisher of the virtual - * machine extension image this extension is based on. - * - * @param the stage of the parent update to return to after attaching this definition - */ - interface WithPublisher { - /** - * Specifies the name of the virtual machine extension image publisher. - * - * @param extensionImagePublisherName the publisher name - * @return the next stage of the definition - */ - WithType withPublisher(String extensionImagePublisherName); - } - - /** - * The stage of the virtual machine extension definition allowing to specify the type of the virtual machine - * extension image this extension is based on. - * - * @param the stage of the parent update to return to after attaching this definition - */ - interface WithType { - /** - * Specifies the type of the virtual machine extension image. - * - * @param extensionImageTypeName the image type name - * @return the next stage of the definition - */ - WithVersion withType(String extensionImageTypeName); - } - - /** - * The stage of the virtual machine extension definition allowing to specify the type of the virtual machine - * extension version this extension is based on. - * - * @param the stage of the parent update to return to after attaching this definition - */ - interface WithVersion { - /** - * Specifies the version of the virtual machine image extension. - * - * @param extensionImageVersionName the version name - * @return the next stage of the definition - */ - WithAttach withVersion(String extensionImageVersionName); - } - - /** - * The final stage of the virtual machine extension definition. - * - * @param the stage of the parent update to return to after attaching this definition - */ - interface WithAttach - extends Attachable.InUpdate, - WithAutoUpgradeMinorVersion, - WithSettings, - WithTags { - } - - /** - * The stage of the virtual machine extension definition allowing to enable or disable auto upgrade of the - * extension when when a new minor version of virtual machine extension image gets published. - * - * @param the stage of the parent update to return to after attaching this definition - */ - interface WithAutoUpgradeMinorVersion { - /** - * enables auto upgrade of the extension. - * - * @return the next stage of the definition - */ - WithAttach withMinorVersionAutoUpgrade(); - - /** - * disables auto upgrade of the extension. - * - * @return the next stage of the definition - */ - WithAttach withoutMinorVersionAutoUpgrade(); - } - - /** - * The stage of the virtual machine extension definition allowing to specify the public and private settings. - * - * @param the stage of the parent update to return to after attaching this definition - */ - interface WithSettings { - /** - * Specifies a public settings entry. - * - * @param key the key of a public settings entry - * @param value the value of the public settings entry - * @return the next stage of the definition - */ - WithAttach withPublicSetting(String key, Object value); - - /** - * Specifies a private settings entry. - * - * @param key the key of a private settings entry - * @param value the value of the private settings entry - * @return the next stage of the definition - */ - WithAttach withProtectedSetting(String key, Object value); - - /** - * Specifies public settings. - * - * @param settings the public settings - * @return the next stage of the definition - */ - WithAttach withPublicSettings(HashMap settings); - - /** - * Specifies private settings. - * - * @param settings the private settings - * @return the next stage of the definition - */ - WithAttach withProtectedSettings(HashMap settings); - } - - /** - * The stage of the virtual machine extension definition allowing to specify the tags. - * - * @param the stage of the parent update to return to after attaching this definition - */ - interface WithTags { - /** - * Specifies tags for the resource. - * - * @param tags tags to associate with the resource - * @return the next stage of the definition - */ - WithAttach withTags(Map tags); - - /** - * Adds a tag to the resource. - * - * @param key the key for the tag - * @param value the value for the tag - * @return the next stage of the definition - */ - WithAttach withTag(String key, String value); - } - } - - /** - * The entirety of a virtual machine extension definition as a part of parent update. - * - * @param the stage of the parent update to return to after attaching this definition - */ - interface UpdateDefinition - extends UpdateDefinitionStages.Blank, - UpdateDefinitionStages.WithImageOrPublisher, - UpdateDefinitionStages.WithPublisher, - UpdateDefinitionStages.WithType, - UpdateDefinitionStages.WithVersion, - UpdateDefinitionStages.WithAttach { - } - - /** Grouping of virtual machine extension update stages. */ - interface UpdateStages { - /** - * The stage of the virtual machine extension update allowing to enable or disable auto upgrade of the extension - * when when a new minor version of virtual machine extension image gets published. - */ - interface WithAutoUpgradeMinorVersion { - /** - * enables auto upgrade of the extension. - * - * @return the next stage of the update - */ - Update withMinorVersionAutoUpgrade(); - - /** - * enables auto upgrade of the extension. - * - * @return the next stage of the update - */ - Update withoutMinorVersionAutoUpgrade(); - } - - /** The stage of the virtual machine extension update allowing to add or update public and private settings. */ - interface WithSettings { - /** - * Specifies a public settings entry. - * - * @param key the key of a public settings entry - * @param value the value of the public settings entry - * @return the next stage of the update - */ - Update withPublicSetting(String key, Object value); - - /** - * Specifies a private settings entry. - * - * @param key the key of a private settings entry - * @param value the value of the private settings entry - * @return the next stage of the update - */ - Update withProtectedSetting(String key, Object value); - - /** - * Specifies public settings. - * - * @param settings the public settings - * @return the next stage of the update - */ - Update withPublicSettings(HashMap settings); - - /** - * Specifies private settings. - * - * @param settings the private settings - * @return the next stage of the update - */ - Update withProtectedSettings(HashMap settings); - } - - /** The stage of the virtual machine extension update allowing to add or update tags. */ - interface WithTags { - /** - * Specifies tags for the virtual machine extension. - * - * @param tags tags indexed by name - * @return the next stage of the update - */ - Update withTags(Map tags); - - /** - * Adds a tag to the virtual machine extension. - * - * @param key the key for the tag - * @param value the value for the tag - * @return the next stage of the update - */ - Update withTag(String key, String value); - - /** - * Removes a tag from the virtual machine extension. - * - * @param key the key of the tag to remove - * @return the next stage of the update - */ - Update withoutTag(String key); - } - } - - /** The entirety of virtual machine extension update as a part of parent virtual machine update. */ - interface Update - extends Settable, - UpdateStages.WithAutoUpgradeMinorVersion, - UpdateStages.WithSettings, - UpdateStages.WithTags { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineExtensionBase.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineExtensionBase.java deleted file mode 100644 index 26d6c56b6269..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineExtensionBase.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineExtensionInner; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import java.util.Map; - -/** An immutable client-side representation of an extension associated with virtual machine. */ -@Fluent -public interface VirtualMachineExtensionBase extends HasInnerModel { - /** @return the publisher name of the virtual machine extension image this extension is created from */ - String publisherName(); - - /** @return the type name of the virtual machine extension image this extension is created from */ - String typeName(); - - /** @return the version name of the virtual machine extension image this extension is created from */ - String versionName(); - - /** - * @return true if this extension is configured to upgrade automatically when a new minor version of the extension - * image that this extension based on is published - */ - boolean autoUpgradeMinorVersionEnabled(); - - /** @return the public settings of the virtual machine extension as key value pairs */ - Map publicSettings(); - - /** @return the public settings of the virtual machine extension as a JSON string */ - String publicSettingsAsJsonString(); - - /** @return the provisioning state of the virtual machine extension */ - String provisioningState(); - - /** @return the tags for this virtual machine extension */ - Map tags(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineExtensionHandlerInstanceView.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineExtensionHandlerInstanceView.java deleted file mode 100644 index c8d34687b57e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineExtensionHandlerInstanceView.java +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The instance view of a virtual machine extension handler. */ -@Fluent -public final class VirtualMachineExtensionHandlerInstanceView { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineExtensionHandlerInstanceView.class); - - /* - * Specifies the type of the extension; an example is - * "CustomScriptExtension". - */ - @JsonProperty(value = "type") - private String type; - - /* - * Specifies the version of the script handler. - */ - @JsonProperty(value = "typeHandlerVersion") - private String typeHandlerVersion; - - /* - * The extension handler status. - */ - @JsonProperty(value = "status") - private InstanceViewStatus status; - - /** - * Get the type property: Specifies the type of the extension; an example is "CustomScriptExtension". - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Set the type property: Specifies the type of the extension; an example is "CustomScriptExtension". - * - * @param type the type value to set. - * @return the VirtualMachineExtensionHandlerInstanceView object itself. - */ - public VirtualMachineExtensionHandlerInstanceView withType(String type) { - this.type = type; - return this; - } - - /** - * Get the typeHandlerVersion property: Specifies the version of the script handler. - * - * @return the typeHandlerVersion value. - */ - public String typeHandlerVersion() { - return this.typeHandlerVersion; - } - - /** - * Set the typeHandlerVersion property: Specifies the version of the script handler. - * - * @param typeHandlerVersion the typeHandlerVersion value to set. - * @return the VirtualMachineExtensionHandlerInstanceView object itself. - */ - public VirtualMachineExtensionHandlerInstanceView withTypeHandlerVersion(String typeHandlerVersion) { - this.typeHandlerVersion = typeHandlerVersion; - return this; - } - - /** - * Get the status property: The extension handler status. - * - * @return the status value. - */ - public InstanceViewStatus status() { - return this.status; - } - - /** - * Set the status property: The extension handler status. - * - * @param status the status value to set. - * @return the VirtualMachineExtensionHandlerInstanceView object itself. - */ - public VirtualMachineExtensionHandlerInstanceView withStatus(InstanceViewStatus status) { - this.status = status; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (status() != null) { - status().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineExtensionImage.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineExtensionImage.java deleted file mode 100644 index a7899c864f3a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineExtensionImage.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineExtensionImageInner; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; - -/** - * An immutable client-side representation of an Azure virtual machine extension image. - * - *

    Note: Azure virtual machine extension image is also referred as virtual machine extension handler. - */ -@Fluent -public interface VirtualMachineExtensionImage extends HasInnerModel { - /** @return the resource ID of the extension image */ - String id(); - - /** @return the region in which virtual machine extension image is available */ - String regionName(); - - /** @return the name of the publisher of the virtual machine extension image */ - String publisherName(); - - /** @return the name of the virtual machine extension image type this image belongs to */ - String typeName(); - - /** @return the name of the virtual machine extension image version this image represents */ - String versionName(); - - /** @return the operating system this virtual machine extension image supports */ - OperatingSystemTypes osType(); - - /** @return the type of role this virtual machine extension image supports */ - ComputeRoles computeRole(); - - /** - * @return the schema defined by publisher, where extension consumers should provide settings in a matching schema - */ - String handlerSchema(); - - /** @return true if the extension can be used with virtual machine scale sets, false otherwise */ - boolean supportsVirtualMachineScaleSets(); - - /** @return true if the handler can support multiple extensions */ - boolean supportsMultipleExtensions(); - - /** @return the virtual machine extension image version this image belongs to */ - VirtualMachineExtensionImageVersion version(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineExtensionImageType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineExtensionImageType.java deleted file mode 100644 index 3eabe9cfd4d4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineExtensionImageType.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineExtensionImageInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasName; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; - -/** An immutable client-side representation of an Azure virtual machine extension image type. */ -@Fluent -public interface VirtualMachineExtensionImageType extends HasInnerModel, HasName { - /** @return the resource ID of the virtual machine extension image type */ - String id(); - - /** @return the region in which virtual machine extension image type is available */ - String regionName(); - - /** @return the publisher of this virtual machine extension image type */ - VirtualMachinePublisher publisher(); - - /** @return Virtual machine image extension versions available in this type */ - VirtualMachineExtensionImageVersions versions(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineExtensionImageTypes.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineExtensionImageTypes.java deleted file mode 100644 index c08b2da32099..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineExtensionImageTypes.java +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; - -/** Entry point to virtual machine image extension types. */ -@Fluent -public interface VirtualMachineExtensionImageTypes extends SupportsListing { -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineExtensionImageVersion.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineExtensionImageVersion.java deleted file mode 100644 index b8795e6ac9ab..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineExtensionImageVersion.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineExtensionImageInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasName; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import reactor.core.publisher.Mono; - -/** An immutable client-side representation of an Azure virtual machine extension image version. */ -@Fluent -public interface VirtualMachineExtensionImageVersion extends HasInnerModel, HasName { - /** @return the resource ID of the extension image version */ - String id(); - - /** @return the region in which virtual machine extension image version is available */ - String regionName(); - - /** @return the virtual machine extension image type this version belongs to */ - VirtualMachineExtensionImageType type(); - - /** @return virtual machine extension image this version represents */ - VirtualMachineExtensionImage getImage(); - - /** @return an observable upon subscription emits the image */ - Mono getImageAsync(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineExtensionImageVersions.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineExtensionImageVersions.java deleted file mode 100644 index 23d99b6f45ff..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineExtensionImageVersions.java +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; - -/** Entry point to virtual machine image extension versions. */ -@Fluent -public interface VirtualMachineExtensionImageVersions extends SupportsListing { -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineExtensionImages.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineExtensionImages.java deleted file mode 100644 index 8175428fd784..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineExtensionImages.java +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListingByRegion; - -/** Entry point to virtual machine extension image management. */ -@Fluent -public interface VirtualMachineExtensionImages extends SupportsListingByRegion { - /** @return entry point to virtual machine extension image publishers */ - VirtualMachinePublishers publishers(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineExtensionInstanceView.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineExtensionInstanceView.java deleted file mode 100644 index 1e90028c22cc..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineExtensionInstanceView.java +++ /dev/null @@ -1,162 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The instance view of a virtual machine extension. */ -@Fluent -public final class VirtualMachineExtensionInstanceView { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineExtensionInstanceView.class); - - /* - * The virtual machine extension name. - */ - @JsonProperty(value = "name") - private String name; - - /* - * Specifies the type of the extension; an example is - * "CustomScriptExtension". - */ - @JsonProperty(value = "type") - private String type; - - /* - * Specifies the version of the script handler. - */ - @JsonProperty(value = "typeHandlerVersion") - private String typeHandlerVersion; - - /* - * The resource status information. - */ - @JsonProperty(value = "substatuses") - private List substatuses; - - /* - * The resource status information. - */ - @JsonProperty(value = "statuses") - private List statuses; - - /** - * Get the name property: The virtual machine extension name. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The virtual machine extension name. - * - * @param name the name value to set. - * @return the VirtualMachineExtensionInstanceView object itself. - */ - public VirtualMachineExtensionInstanceView withName(String name) { - this.name = name; - return this; - } - - /** - * Get the type property: Specifies the type of the extension; an example is "CustomScriptExtension". - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Set the type property: Specifies the type of the extension; an example is "CustomScriptExtension". - * - * @param type the type value to set. - * @return the VirtualMachineExtensionInstanceView object itself. - */ - public VirtualMachineExtensionInstanceView withType(String type) { - this.type = type; - return this; - } - - /** - * Get the typeHandlerVersion property: Specifies the version of the script handler. - * - * @return the typeHandlerVersion value. - */ - public String typeHandlerVersion() { - return this.typeHandlerVersion; - } - - /** - * Set the typeHandlerVersion property: Specifies the version of the script handler. - * - * @param typeHandlerVersion the typeHandlerVersion value to set. - * @return the VirtualMachineExtensionInstanceView object itself. - */ - public VirtualMachineExtensionInstanceView withTypeHandlerVersion(String typeHandlerVersion) { - this.typeHandlerVersion = typeHandlerVersion; - return this; - } - - /** - * Get the substatuses property: The resource status information. - * - * @return the substatuses value. - */ - public List substatuses() { - return this.substatuses; - } - - /** - * Set the substatuses property: The resource status information. - * - * @param substatuses the substatuses value to set. - * @return the VirtualMachineExtensionInstanceView object itself. - */ - public VirtualMachineExtensionInstanceView withSubstatuses(List substatuses) { - this.substatuses = substatuses; - return this; - } - - /** - * Get the statuses property: The resource status information. - * - * @return the statuses value. - */ - public List statuses() { - return this.statuses; - } - - /** - * Set the statuses property: The resource status information. - * - * @param statuses the statuses value to set. - * @return the VirtualMachineExtensionInstanceView object itself. - */ - public VirtualMachineExtensionInstanceView withStatuses(List statuses) { - this.statuses = statuses; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (substatuses() != null) { - substatuses().forEach(e -> e.validate()); - } - if (statuses() != null) { - statuses().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineExtensionUpdate.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineExtensionUpdate.java deleted file mode 100644 index 41879fc28859..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineExtensionUpdate.java +++ /dev/null @@ -1,247 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineExtensionUpdateProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** Describes a Virtual Machine Extension. */ -@Fluent -public final class VirtualMachineExtensionUpdate extends UpdateResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineExtensionUpdate.class); - - /* - * Describes the properties of a Virtual Machine Extension. - */ - @JsonProperty(value = "properties") - private VirtualMachineExtensionUpdateProperties innerProperties; - - /** - * Get the innerProperties property: Describes the properties of a Virtual Machine Extension. - * - * @return the innerProperties value. - */ - private VirtualMachineExtensionUpdateProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public VirtualMachineExtensionUpdate withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the forceUpdateTag property: How the extension handler should be forced to update even if the extension - * configuration has not changed. - * - * @return the forceUpdateTag value. - */ - public String forceUpdateTag() { - return this.innerProperties() == null ? null : this.innerProperties().forceUpdateTag(); - } - - /** - * Set the forceUpdateTag property: How the extension handler should be forced to update even if the extension - * configuration has not changed. - * - * @param forceUpdateTag the forceUpdateTag value to set. - * @return the VirtualMachineExtensionUpdate object itself. - */ - public VirtualMachineExtensionUpdate withForceUpdateTag(String forceUpdateTag) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineExtensionUpdateProperties(); - } - this.innerProperties().withForceUpdateTag(forceUpdateTag); - return this; - } - - /** - * Get the publisher property: The name of the extension handler publisher. - * - * @return the publisher value. - */ - public String publisher() { - return this.innerProperties() == null ? null : this.innerProperties().publisher(); - } - - /** - * Set the publisher property: The name of the extension handler publisher. - * - * @param publisher the publisher value to set. - * @return the VirtualMachineExtensionUpdate object itself. - */ - public VirtualMachineExtensionUpdate withPublisher(String publisher) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineExtensionUpdateProperties(); - } - this.innerProperties().withPublisher(publisher); - return this; - } - - /** - * Get the type property: Specifies the type of the extension; an example is "CustomScriptExtension". - * - * @return the type value. - */ - public String type() { - return this.innerProperties() == null ? null : this.innerProperties().type(); - } - - /** - * Set the type property: Specifies the type of the extension; an example is "CustomScriptExtension". - * - * @param type the type value to set. - * @return the VirtualMachineExtensionUpdate object itself. - */ - public VirtualMachineExtensionUpdate withType(String type) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineExtensionUpdateProperties(); - } - this.innerProperties().withType(type); - return this; - } - - /** - * Get the typeHandlerVersion property: Specifies the version of the script handler. - * - * @return the typeHandlerVersion value. - */ - public String typeHandlerVersion() { - return this.innerProperties() == null ? null : this.innerProperties().typeHandlerVersion(); - } - - /** - * Set the typeHandlerVersion property: Specifies the version of the script handler. - * - * @param typeHandlerVersion the typeHandlerVersion value to set. - * @return the VirtualMachineExtensionUpdate object itself. - */ - public VirtualMachineExtensionUpdate withTypeHandlerVersion(String typeHandlerVersion) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineExtensionUpdateProperties(); - } - this.innerProperties().withTypeHandlerVersion(typeHandlerVersion); - return this; - } - - /** - * Get the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one - * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless - * redeployed, even with this property set to true. - * - * @return the autoUpgradeMinorVersion value. - */ - public Boolean autoUpgradeMinorVersion() { - return this.innerProperties() == null ? null : this.innerProperties().autoUpgradeMinorVersion(); - } - - /** - * Set the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one - * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless - * redeployed, even with this property set to true. - * - * @param autoUpgradeMinorVersion the autoUpgradeMinorVersion value to set. - * @return the VirtualMachineExtensionUpdate object itself. - */ - public VirtualMachineExtensionUpdate withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineExtensionUpdateProperties(); - } - this.innerProperties().withAutoUpgradeMinorVersion(autoUpgradeMinorVersion); - return this; - } - - /** - * Get the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the - * platform if there is a newer version of the extension available. - * - * @return the enableAutomaticUpgrade value. - */ - public Boolean enableAutomaticUpgrade() { - return this.innerProperties() == null ? null : this.innerProperties().enableAutomaticUpgrade(); - } - - /** - * Set the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the - * platform if there is a newer version of the extension available. - * - * @param enableAutomaticUpgrade the enableAutomaticUpgrade value to set. - * @return the VirtualMachineExtensionUpdate object itself. - */ - public VirtualMachineExtensionUpdate withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineExtensionUpdateProperties(); - } - this.innerProperties().withEnableAutomaticUpgrade(enableAutomaticUpgrade); - return this; - } - - /** - * Get the settings property: Json formatted public settings for the extension. - * - * @return the settings value. - */ - public Object settings() { - return this.innerProperties() == null ? null : this.innerProperties().settings(); - } - - /** - * Set the settings property: Json formatted public settings for the extension. - * - * @param settings the settings value to set. - * @return the VirtualMachineExtensionUpdate object itself. - */ - public VirtualMachineExtensionUpdate withSettings(Object settings) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineExtensionUpdateProperties(); - } - this.innerProperties().withSettings(settings); - return this; - } - - /** - * Get the protectedSettings property: The extension can contain either protectedSettings or - * protectedSettingsFromKeyVault or no protected settings at all. - * - * @return the protectedSettings value. - */ - public Object protectedSettings() { - return this.innerProperties() == null ? null : this.innerProperties().protectedSettings(); - } - - /** - * Set the protectedSettings property: The extension can contain either protectedSettings or - * protectedSettingsFromKeyVault or no protected settings at all. - * - * @param protectedSettings the protectedSettings value to set. - * @return the VirtualMachineExtensionUpdate object itself. - */ - public VirtualMachineExtensionUpdate withProtectedSettings(Object protectedSettings) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineExtensionUpdateProperties(); - } - this.innerProperties().withProtectedSettings(protectedSettings); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineHealthStatus.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineHealthStatus.java deleted file mode 100644 index 233b3675fcb6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineHealthStatus.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The health status of the VM. */ -@Immutable -public final class VirtualMachineHealthStatus { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineHealthStatus.class); - - /* - * The health status information for the VM. - */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) - private InstanceViewStatus status; - - /** - * Get the status property: The health status information for the VM. - * - * @return the status value. - */ - public InstanceViewStatus status() { - return this.status; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (status() != null) { - status().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineIdentity.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineIdentity.java deleted file mode 100644 index 7926a7e1aa0e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineIdentity.java +++ /dev/null @@ -1,138 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** Identity for the virtual machine. */ -@Fluent -public class VirtualMachineIdentity { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineIdentity.class); - - /* - * The principal id of virtual machine identity. This property will only be - * provided for a system assigned identity. - */ - @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) - private String principalId; - - /* - * The tenant id associated with the virtual machine. This property will - * only be provided for a system assigned identity. - */ - @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) - private String tenantId; - - /* - * The type of identity used for the virtual machine. The type - * 'SystemAssigned, UserAssigned' includes both an implicitly created - * identity and a set of user assigned identities. The type 'None' will - * remove any identities from the virtual machine. - */ - @JsonProperty(value = "type") - private ResourceIdentityType type; - - /* - * The list of user identities associated with the Virtual Machine. The - * user identity dictionary key references will be ARM resource ids in the - * form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - */ - @JsonProperty(value = "userAssignedIdentities") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map userAssignedIdentities; - - /** - * Get the principalId property: The principal id of virtual machine identity. This property will only be provided - * for a system assigned identity. - * - * @return the principalId value. - */ - public String principalId() { - return this.principalId; - } - - /** - * Get the tenantId property: The tenant id associated with the virtual machine. This property will only be provided - * for a system assigned identity. - * - * @return the tenantId value. - */ - public String tenantId() { - return this.tenantId; - } - - /** - * Get the type property: The type of identity used for the virtual machine. The type 'SystemAssigned, UserAssigned' - * includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove - * any identities from the virtual machine. - * - * @return the type value. - */ - public ResourceIdentityType type() { - return this.type; - } - - /** - * Set the type property: The type of identity used for the virtual machine. The type 'SystemAssigned, UserAssigned' - * includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove - * any identities from the virtual machine. - * - * @param type the type value to set. - * @return the VirtualMachineIdentity object itself. - */ - public VirtualMachineIdentity withType(ResourceIdentityType type) { - this.type = type; - return this; - } - - /** - * Get the userAssignedIdentities property: The list of user identities associated with the Virtual Machine. The - * user identity dictionary key references will be ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - * - * @return the userAssignedIdentities value. - */ - public Map userAssignedIdentities() { - return this.userAssignedIdentities; - } - - /** - * Set the userAssignedIdentities property: The list of user identities associated with the Virtual Machine. The - * user identity dictionary key references will be ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - * - * @param userAssignedIdentities the userAssignedIdentities value to set. - * @return the VirtualMachineIdentity object itself. - */ - public VirtualMachineIdentity withUserAssignedIdentities( - Map userAssignedIdentities) { - this.userAssignedIdentities = userAssignedIdentities; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (userAssignedIdentities() != null) { - userAssignedIdentities() - .values() - .forEach( - e -> { - if (e != null) { - e.validate(); - } - }); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineIdentityUserAssignedIdentities.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineIdentityUserAssignedIdentities.java deleted file mode 100644 index 5333a3de6be5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineIdentityUserAssignedIdentities.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The VirtualMachineIdentityUserAssignedIdentities model. */ -@Immutable -public final class VirtualMachineIdentityUserAssignedIdentities { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(VirtualMachineIdentityUserAssignedIdentities.class); - - /* - * The principal id of user assigned identity. - */ - @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) - private String principalId; - - /* - * The client id of user assigned identity. - */ - @JsonProperty(value = "clientId", access = JsonProperty.Access.WRITE_ONLY) - private String clientId; - - /** - * Get the principalId property: The principal id of user assigned identity. - * - * @return the principalId value. - */ - public String principalId() { - return this.principalId; - } - - /** - * Get the clientId property: The client id of user assigned identity. - * - * @return the clientId value. - */ - public String clientId() { - return this.clientId; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineImage.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineImage.java deleted file mode 100644 index f01ba85a51fc..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineImage.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineImageInner; -import com.azure.core.management.Region; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import java.util.Map; - -/** An immutable client-side representation of an Azure virtual machine image. */ -@Fluent -public interface VirtualMachineImage extends HasInnerModel { - /** @return the resource ID of this image */ - String id(); - - /** @return the region in which virtual machine image is available */ - Region location(); - - /** @return the publisher name of the virtual machine image */ - String publisherName(); - - /** @return the name of the virtual machine image offer this image is part of */ - String offer(); - - /** @return the commercial name of the virtual machine image (SKU) */ - String sku(); - - /** @return the version of the virtual machine image */ - String version(); - - /** @return the image reference representing the publisher, offer, SKU and version of the virtual machine image */ - ImageReference imageReference(); - - /** @return the purchase plan for the virtual machine image */ - PurchasePlan plan(); - - /** @return OS disk image in the virtual machine image */ - OSDiskImage osDiskImage(); - - /** @return data disk images in the virtual machine image, indexed by the disk LUN */ - Map dataDiskImages(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineImages.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineImages.java deleted file mode 100644 index a0b527de5a5f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineImages.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Region; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListingByRegion; - -/** Entry point to virtual machine image management API. */ -@Fluent -public interface VirtualMachineImages extends SupportsListingByRegion { - /** - * Gets a virtual machine image. - * - * @param region the region - * @param publisherName publisher name - * @param offerName offer name - * @param skuName SKU name - * @param version version name - * @return the virtual machine image - */ - VirtualMachineImage getImage(Region region, String publisherName, String offerName, String skuName, String version); - - /** - * Gets a virtual machine image. - * - * @param region the region - * @param publisherName publisher name - * @param offerName offer name - * @param skuName SKU name - * @param version version name - * @return the virtual machine image - */ - VirtualMachineImage getImage(String region, String publisherName, String offerName, String skuName, String version); - - /** @return entry point to virtual machine image publishers */ - VirtualMachinePublishers publishers(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineImagesInSku.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineImagesInSku.java deleted file mode 100644 index 382fd3fdb5ab..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineImagesInSku.java +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; - -/** Entry point to virtual machine SKU images. */ -@Fluent -public interface VirtualMachineImagesInSku extends SupportsListing { -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineInstanceView.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineInstanceView.java deleted file mode 100644 index 73200f35e3c9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineInstanceView.java +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineInstanceViewInner; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import java.util.List; - -/** An immutable client-side representation of an Azure VM Instance View object. */ -@Fluent -public interface VirtualMachineInstanceView extends HasInnerModel { - /** - * Get specifies the update domain of the virtual machine. - * - * @return the platformUpdateDomain value - */ - int platformUpdateDomain(); - - /** - * Get specifies the fault domain of the virtual machine. - * - * @return the platformFaultDomain value - */ - int platformFaultDomain(); - - /** - * Get the computer name assigned to the virtual machine. - * - * @return the computerName value - */ - String computerName(); - - /** - * Get the Operating System running on the virtual machine. - * - * @return the osName value - */ - String osName(); - - /** - * Get the version of Operating System running on the virtual machine. - * - * @return the osVersion value - */ - String osVersion(); - - /** - * Get the Remote desktop certificate thumbprint. - * - * @return the rdpThumbPrint value - */ - String rdpThumbPrint(); - - /** - * Get the VM Agent running on the virtual machine. - * - * @return the vmAgent value - */ - VirtualMachineAgentInstanceView vmAgent(); - - /** - * Get the Maintenance Operation status on the virtual machine. - * - * @return the maintenanceRedeployStatus value - */ - MaintenanceRedeployStatus maintenanceRedeployStatus(); - - /** - * Get the virtual machine disk information. - * - * @return the disks value - */ - List disks(); - - /** - * Get the extensions information. - * - * @return the extensions value - */ - List extensions(); - - /** - * Get 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. - * - * @return the bootDiagnostics value - */ - BootDiagnosticsInstanceView bootDiagnostics(); - - /** - * Get the resource status information. - * - * @return the statuses value - */ - List statuses(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineListResult.java deleted file mode 100644 index 968cd6f50cc6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineListResult.java +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The List Virtual Machine operation response. */ -@Fluent -public final class VirtualMachineListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineListResult.class); - - /* - * The list of virtual machines. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * The URI to fetch the next page of VMs. Call ListNext() with this URI to - * fetch the next page of Virtual Machines. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: The list of virtual machines. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The list of virtual machines. - * - * @param value the value value to set. - * @return the VirtualMachineListResult object itself. - */ - public VirtualMachineListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URI to fetch the next page of VMs. Call ListNext() with this URI to fetch the next - * page of Virtual Machines. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The URI to fetch the next page of VMs. Call ListNext() with this URI to fetch the next - * page of Virtual Machines. - * - * @param nextLink the nextLink value to set. - * @return the VirtualMachineListResult object itself. - */ - public VirtualMachineListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model VirtualMachineListResult")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineOffer.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineOffer.java deleted file mode 100644 index 1cb5c4b50d9e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineOffer.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Region; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasName; - -/** Represents a virtual machine image offer. */ -@Fluent -public interface VirtualMachineOffer extends HasName { - /** @return the region where this virtual machine image offer is available */ - Region region(); - - /** @return the publisher of this virtual machine image offer */ - VirtualMachinePublisher publisher(); - - /** @return virtual machine image SKUs available in this offer */ - VirtualMachineSkus skus(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineOffers.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineOffers.java deleted file mode 100644 index 42ad5a2638a4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineOffers.java +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; - -/** Entry point to virtual machine image offers. */ -@Fluent -public interface VirtualMachineOffers extends SupportsListing { -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachinePatchStatus.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachinePatchStatus.java deleted file mode 100644 index 7b77892966e6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachinePatchStatus.java +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The status of virtual machine patch operations. */ -@Fluent -public final class VirtualMachinePatchStatus { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachinePatchStatus.class); - - /* - * The available patch summary of the latest assessment operation for the - * virtual machine. - */ - @JsonProperty(value = "availablePatchSummary") - private AvailablePatchSummary availablePatchSummary; - - /* - * The installation summary of the latest installation operation for the - * virtual machine. - */ - @JsonProperty(value = "lastPatchInstallationSummary") - private LastPatchInstallationSummary lastPatchInstallationSummary; - - /** - * Get the availablePatchSummary property: The available patch summary of the latest assessment operation for the - * virtual machine. - * - * @return the availablePatchSummary value. - */ - public AvailablePatchSummary availablePatchSummary() { - return this.availablePatchSummary; - } - - /** - * Set the availablePatchSummary property: The available patch summary of the latest assessment operation for the - * virtual machine. - * - * @param availablePatchSummary the availablePatchSummary value to set. - * @return the VirtualMachinePatchStatus object itself. - */ - public VirtualMachinePatchStatus withAvailablePatchSummary(AvailablePatchSummary availablePatchSummary) { - this.availablePatchSummary = availablePatchSummary; - return this; - } - - /** - * Get the lastPatchInstallationSummary property: The installation summary of the latest installation operation for - * the virtual machine. - * - * @return the lastPatchInstallationSummary value. - */ - public LastPatchInstallationSummary lastPatchInstallationSummary() { - return this.lastPatchInstallationSummary; - } - - /** - * Set the lastPatchInstallationSummary property: The installation summary of the latest installation operation for - * the virtual machine. - * - * @param lastPatchInstallationSummary the lastPatchInstallationSummary value to set. - * @return the VirtualMachinePatchStatus object itself. - */ - public VirtualMachinePatchStatus withLastPatchInstallationSummary( - LastPatchInstallationSummary lastPatchInstallationSummary) { - this.lastPatchInstallationSummary = lastPatchInstallationSummary; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (availablePatchSummary() != null) { - availablePatchSummary().validate(); - } - if (lastPatchInstallationSummary() != null) { - lastPatchInstallationSummary().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachinePriorityTypes.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachinePriorityTypes.java deleted file mode 100644 index 1332ae9364c7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachinePriorityTypes.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for VirtualMachinePriorityTypes. */ -public final class VirtualMachinePriorityTypes extends ExpandableStringEnum { - /** Static value Regular for VirtualMachinePriorityTypes. */ - public static final VirtualMachinePriorityTypes REGULAR = fromString("Regular"); - - /** Static value Low for VirtualMachinePriorityTypes. */ - public static final VirtualMachinePriorityTypes LOW = fromString("Low"); - - /** Static value Spot for VirtualMachinePriorityTypes. */ - public static final VirtualMachinePriorityTypes SPOT = fromString("Spot"); - - /** - * Creates or finds a VirtualMachinePriorityTypes from its string representation. - * - * @param name a name to look for. - * @return the corresponding VirtualMachinePriorityTypes. - */ - @JsonCreator - public static VirtualMachinePriorityTypes fromString(String name) { - return fromString(name, VirtualMachinePriorityTypes.class); - } - - /** @return known VirtualMachinePriorityTypes values. */ - public static Collection values() { - return values(VirtualMachinePriorityTypes.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachinePublisher.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachinePublisher.java deleted file mode 100644 index 0df66011ce86..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachinePublisher.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Region; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasName; - -/** Represents a virtual machine image publisher. */ -@Fluent -public interface VirtualMachinePublisher extends HasName { - /** @return the region where virtual machine images from this publisher are available */ - Region region(); - - /** @return the offers from this publisher */ - VirtualMachineOffers offers(); - - /** @return the virtual machine image extensions from this publisher */ - VirtualMachineExtensionImageTypes extensionTypes(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachinePublishers.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachinePublishers.java deleted file mode 100644 index 04f9693543df..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachinePublishers.java +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListingByRegion; - -/** Entry point to virtual machine image publishers. */ -@Fluent -public interface VirtualMachinePublishers extends SupportsListingByRegion { -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineReimageParameters.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineReimageParameters.java deleted file mode 100644 index 4e62d6e4c175..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineReimageParameters.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Parameters for Reimaging Virtual Machine. NOTE: Virtual Machine OS disk will always be reimaged. */ -@Fluent -public class VirtualMachineReimageParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineReimageParameters.class); - - /* - * Specifies whether to reimage temp disk. Default value: false. Note: This - * temp disk reimage parameter is only supported for VM/VMSS with Ephemeral - * OS disk. - */ - @JsonProperty(value = "tempDisk") - private Boolean tempDisk; - - /** - * Get the tempDisk property: Specifies whether to reimage temp disk. Default value: false. Note: This temp disk - * reimage parameter is only supported for VM/VMSS with Ephemeral OS disk. - * - * @return the tempDisk value. - */ - public Boolean tempDisk() { - return this.tempDisk; - } - - /** - * Set the tempDisk property: Specifies whether to reimage temp disk. Default value: false. Note: This temp disk - * reimage parameter is only supported for VM/VMSS with Ephemeral OS disk. - * - * @param tempDisk the tempDisk value to set. - * @return the VirtualMachineReimageParameters object itself. - */ - public VirtualMachineReimageParameters withTempDisk(Boolean tempDisk) { - this.tempDisk = tempDisk; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineRunCommandInstanceView.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineRunCommandInstanceView.java deleted file mode 100644 index 15693a327bcc..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineRunCommandInstanceView.java +++ /dev/null @@ -1,237 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; - -/** The instance view of a virtual machine run command. */ -@Fluent -public final class VirtualMachineRunCommandInstanceView { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineRunCommandInstanceView.class); - - /* - * Script execution status. - */ - @JsonProperty(value = "executionState") - private ExecutionState executionState; - - /* - * Communicate script configuration errors or execution messages. - */ - @JsonProperty(value = "executionMessage") - private String executionMessage; - - /* - * Exit code returned from script execution. - */ - @JsonProperty(value = "exitCode") - private Integer exitCode; - - /* - * Script output stream. - */ - @JsonProperty(value = "output") - private String output; - - /* - * Script error stream. - */ - @JsonProperty(value = "error") - private String error; - - /* - * Script start time. - */ - @JsonProperty(value = "startTime") - private OffsetDateTime startTime; - - /* - * Script end time. - */ - @JsonProperty(value = "endTime") - private OffsetDateTime endTime; - - /* - * The resource status information. - */ - @JsonProperty(value = "statuses") - private List statuses; - - /** - * Get the executionState property: Script execution status. - * - * @return the executionState value. - */ - public ExecutionState executionState() { - return this.executionState; - } - - /** - * Set the executionState property: Script execution status. - * - * @param executionState the executionState value to set. - * @return the VirtualMachineRunCommandInstanceView object itself. - */ - public VirtualMachineRunCommandInstanceView withExecutionState(ExecutionState executionState) { - this.executionState = executionState; - return this; - } - - /** - * Get the executionMessage property: Communicate script configuration errors or execution messages. - * - * @return the executionMessage value. - */ - public String executionMessage() { - return this.executionMessage; - } - - /** - * Set the executionMessage property: Communicate script configuration errors or execution messages. - * - * @param executionMessage the executionMessage value to set. - * @return the VirtualMachineRunCommandInstanceView object itself. - */ - public VirtualMachineRunCommandInstanceView withExecutionMessage(String executionMessage) { - this.executionMessage = executionMessage; - return this; - } - - /** - * Get the exitCode property: Exit code returned from script execution. - * - * @return the exitCode value. - */ - public Integer exitCode() { - return this.exitCode; - } - - /** - * Set the exitCode property: Exit code returned from script execution. - * - * @param exitCode the exitCode value to set. - * @return the VirtualMachineRunCommandInstanceView object itself. - */ - public VirtualMachineRunCommandInstanceView withExitCode(Integer exitCode) { - this.exitCode = exitCode; - return this; - } - - /** - * Get the output property: Script output stream. - * - * @return the output value. - */ - public String output() { - return this.output; - } - - /** - * Set the output property: Script output stream. - * - * @param output the output value to set. - * @return the VirtualMachineRunCommandInstanceView object itself. - */ - public VirtualMachineRunCommandInstanceView withOutput(String output) { - this.output = output; - return this; - } - - /** - * Get the error property: Script error stream. - * - * @return the error value. - */ - public String error() { - return this.error; - } - - /** - * Set the error property: Script error stream. - * - * @param error the error value to set. - * @return the VirtualMachineRunCommandInstanceView object itself. - */ - public VirtualMachineRunCommandInstanceView withError(String error) { - this.error = error; - return this; - } - - /** - * Get the startTime property: Script start time. - * - * @return the startTime value. - */ - public OffsetDateTime startTime() { - return this.startTime; - } - - /** - * Set the startTime property: Script start time. - * - * @param startTime the startTime value to set. - * @return the VirtualMachineRunCommandInstanceView object itself. - */ - public VirtualMachineRunCommandInstanceView withStartTime(OffsetDateTime startTime) { - this.startTime = startTime; - return this; - } - - /** - * Get the endTime property: Script end time. - * - * @return the endTime value. - */ - public OffsetDateTime endTime() { - return this.endTime; - } - - /** - * Set the endTime property: Script end time. - * - * @param endTime the endTime value to set. - * @return the VirtualMachineRunCommandInstanceView object itself. - */ - public VirtualMachineRunCommandInstanceView withEndTime(OffsetDateTime endTime) { - this.endTime = endTime; - return this; - } - - /** - * Get the statuses property: The resource status information. - * - * @return the statuses value. - */ - public List statuses() { - return this.statuses; - } - - /** - * Set the statuses property: The resource status information. - * - * @param statuses the statuses value to set. - * @return the VirtualMachineRunCommandInstanceView object itself. - */ - public VirtualMachineRunCommandInstanceView withStatuses(List statuses) { - this.statuses = statuses; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (statuses() != null) { - statuses().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineRunCommandScriptSource.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineRunCommandScriptSource.java deleted file mode 100644 index 60fd18198981..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineRunCommandScriptSource.java +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describes the script sources for run command. */ -@Fluent -public final class VirtualMachineRunCommandScriptSource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineRunCommandScriptSource.class); - - /* - * Specifies the script content to be executed on the VM. - */ - @JsonProperty(value = "script") - private String script; - - /* - * Specifies the script download location. - */ - @JsonProperty(value = "scriptUri") - private String scriptUri; - - /* - * Specifies a commandId of predefined built-in script. - */ - @JsonProperty(value = "commandId") - private String commandId; - - /** - * Get the script property: Specifies the script content to be executed on the VM. - * - * @return the script value. - */ - public String script() { - return this.script; - } - - /** - * Set the script property: Specifies the script content to be executed on the VM. - * - * @param script the script value to set. - * @return the VirtualMachineRunCommandScriptSource object itself. - */ - public VirtualMachineRunCommandScriptSource withScript(String script) { - this.script = script; - return this; - } - - /** - * Get the scriptUri property: Specifies the script download location. - * - * @return the scriptUri value. - */ - public String scriptUri() { - return this.scriptUri; - } - - /** - * Set the scriptUri property: Specifies the script download location. - * - * @param scriptUri the scriptUri value to set. - * @return the VirtualMachineRunCommandScriptSource object itself. - */ - public VirtualMachineRunCommandScriptSource withScriptUri(String scriptUri) { - this.scriptUri = scriptUri; - return this; - } - - /** - * Get the commandId property: Specifies a commandId of predefined built-in script. - * - * @return the commandId value. - */ - public String commandId() { - return this.commandId; - } - - /** - * Set the commandId property: Specifies a commandId of predefined built-in script. - * - * @param commandId the commandId value to set. - * @return the VirtualMachineRunCommandScriptSource object itself. - */ - public VirtualMachineRunCommandScriptSource withCommandId(String commandId) { - this.commandId = commandId; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineRunCommandUpdate.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineRunCommandUpdate.java deleted file mode 100644 index 1820ab8cff82..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineRunCommandUpdate.java +++ /dev/null @@ -1,281 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineRunCommandProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** Describes a Virtual Machine run command. */ -@Fluent -public final class VirtualMachineRunCommandUpdate extends UpdateResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineRunCommandUpdate.class); - - /* - * Describes the properties of a Virtual Machine run command. - */ - @JsonProperty(value = "properties") - private VirtualMachineRunCommandProperties innerProperties; - - /** - * Get the innerProperties property: Describes the properties of a Virtual Machine run command. - * - * @return the innerProperties value. - */ - private VirtualMachineRunCommandProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public VirtualMachineRunCommandUpdate withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the source property: The source of the run command script. - * - * @return the source value. - */ - public VirtualMachineRunCommandScriptSource source() { - return this.innerProperties() == null ? null : this.innerProperties().source(); - } - - /** - * Set the source property: The source of the run command script. - * - * @param source the source value to set. - * @return the VirtualMachineRunCommandUpdate object itself. - */ - public VirtualMachineRunCommandUpdate withSource(VirtualMachineRunCommandScriptSource source) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineRunCommandProperties(); - } - this.innerProperties().withSource(source); - return this; - } - - /** - * Get the parameters property: The parameters used by the script. - * - * @return the parameters value. - */ - public List parameters() { - return this.innerProperties() == null ? null : this.innerProperties().parameters(); - } - - /** - * Set the parameters property: The parameters used by the script. - * - * @param parameters the parameters value to set. - * @return the VirtualMachineRunCommandUpdate object itself. - */ - public VirtualMachineRunCommandUpdate withParameters(List parameters) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineRunCommandProperties(); - } - this.innerProperties().withParameters(parameters); - return this; - } - - /** - * Get the protectedParameters property: The parameters used by the script. - * - * @return the protectedParameters value. - */ - public List protectedParameters() { - return this.innerProperties() == null ? null : this.innerProperties().protectedParameters(); - } - - /** - * Set the protectedParameters property: The parameters used by the script. - * - * @param protectedParameters the protectedParameters value to set. - * @return the VirtualMachineRunCommandUpdate object itself. - */ - public VirtualMachineRunCommandUpdate withProtectedParameters(List protectedParameters) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineRunCommandProperties(); - } - this.innerProperties().withProtectedParameters(protectedParameters); - return this; - } - - /** - * Get the asyncExecution property: Optional. If set to true, provisioning will complete as soon as the script - * starts and will not wait for script to complete. - * - * @return the asyncExecution value. - */ - public Boolean asyncExecution() { - return this.innerProperties() == null ? null : this.innerProperties().asyncExecution(); - } - - /** - * Set the asyncExecution property: Optional. If set to true, provisioning will complete as soon as the script - * starts and will not wait for script to complete. - * - * @param asyncExecution the asyncExecution value to set. - * @return the VirtualMachineRunCommandUpdate object itself. - */ - public VirtualMachineRunCommandUpdate withAsyncExecution(Boolean asyncExecution) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineRunCommandProperties(); - } - this.innerProperties().withAsyncExecution(asyncExecution); - return this; - } - - /** - * Get the runAsUser property: Specifies the user account on the VM when executing the run command. - * - * @return the runAsUser value. - */ - public String runAsUser() { - return this.innerProperties() == null ? null : this.innerProperties().runAsUser(); - } - - /** - * Set the runAsUser property: Specifies the user account on the VM when executing the run command. - * - * @param runAsUser the runAsUser value to set. - * @return the VirtualMachineRunCommandUpdate object itself. - */ - public VirtualMachineRunCommandUpdate withRunAsUser(String runAsUser) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineRunCommandProperties(); - } - this.innerProperties().withRunAsUser(runAsUser); - return this; - } - - /** - * Get the runAsPassword property: Specifies the user account password on the VM when executing the run command. - * - * @return the runAsPassword value. - */ - public String runAsPassword() { - return this.innerProperties() == null ? null : this.innerProperties().runAsPassword(); - } - - /** - * Set the runAsPassword property: Specifies the user account password on the VM when executing the run command. - * - * @param runAsPassword the runAsPassword value to set. - * @return the VirtualMachineRunCommandUpdate object itself. - */ - public VirtualMachineRunCommandUpdate withRunAsPassword(String runAsPassword) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineRunCommandProperties(); - } - this.innerProperties().withRunAsPassword(runAsPassword); - return this; - } - - /** - * Get the timeoutInSeconds property: The timeout in seconds to execute the run command. - * - * @return the timeoutInSeconds value. - */ - public Integer timeoutInSeconds() { - return this.innerProperties() == null ? null : this.innerProperties().timeoutInSeconds(); - } - - /** - * Set the timeoutInSeconds property: The timeout in seconds to execute the run command. - * - * @param timeoutInSeconds the timeoutInSeconds value to set. - * @return the VirtualMachineRunCommandUpdate object itself. - */ - public VirtualMachineRunCommandUpdate withTimeoutInSeconds(Integer timeoutInSeconds) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineRunCommandProperties(); - } - this.innerProperties().withTimeoutInSeconds(timeoutInSeconds); - return this; - } - - /** - * Get the outputBlobUri property: Specifies the Azure storage blob where script output stream will be uploaded. - * - * @return the outputBlobUri value. - */ - public String outputBlobUri() { - return this.innerProperties() == null ? null : this.innerProperties().outputBlobUri(); - } - - /** - * Set the outputBlobUri property: Specifies the Azure storage blob where script output stream will be uploaded. - * - * @param outputBlobUri the outputBlobUri value to set. - * @return the VirtualMachineRunCommandUpdate object itself. - */ - public VirtualMachineRunCommandUpdate withOutputBlobUri(String outputBlobUri) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineRunCommandProperties(); - } - this.innerProperties().withOutputBlobUri(outputBlobUri); - return this; - } - - /** - * Get the errorBlobUri property: Specifies the Azure storage blob where script error stream will be uploaded. - * - * @return the errorBlobUri value. - */ - public String errorBlobUri() { - return this.innerProperties() == null ? null : this.innerProperties().errorBlobUri(); - } - - /** - * Set the errorBlobUri property: Specifies the Azure storage blob where script error stream will be uploaded. - * - * @param errorBlobUri the errorBlobUri value to set. - * @return the VirtualMachineRunCommandUpdate object itself. - */ - public VirtualMachineRunCommandUpdate withErrorBlobUri(String errorBlobUri) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineRunCommandProperties(); - } - this.innerProperties().withErrorBlobUri(errorBlobUri); - return this; - } - - /** - * Get the provisioningState property: The provisioning state, which only appears in the response. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the instanceView property: The virtual machine run command instance view. - * - * @return the instanceView value. - */ - public VirtualMachineRunCommandInstanceView instanceView() { - return this.innerProperties() == null ? null : this.innerProperties().instanceView(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineRunCommandsListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineRunCommandsListResult.java deleted file mode 100644 index b0f16ac0852e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineRunCommandsListResult.java +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineRunCommandInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The List run command operation response. */ -@Fluent -public final class VirtualMachineRunCommandsListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineRunCommandsListResult.class); - - /* - * The list of run commands - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * The uri to fetch the next page of run commands. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: The list of run commands. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The list of run commands. - * - * @param value the value value to set. - * @return the VirtualMachineRunCommandsListResult object itself. - */ - public VirtualMachineRunCommandsListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The uri to fetch the next page of run commands. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The uri to fetch the next page of run commands. - * - * @param nextLink the nextLink value to set. - * @return the VirtualMachineRunCommandsListResult object itself. - */ - public VirtualMachineRunCommandsListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property value in model VirtualMachineRunCommandsListResult")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSet.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSet.java deleted file mode 100644 index cc817118b13e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSet.java +++ /dev/null @@ -1,2477 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.compute.ComputeManager; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineScaleSetInner; -import com.azure.resourcemanager.authorization.models.BuiltInRole; -import com.azure.resourcemanager.msi.models.Identity; -import com.azure.resourcemanager.network.models.ApplicationSecurityGroup; -import com.azure.resourcemanager.network.models.LoadBalancer; -import com.azure.resourcemanager.network.models.LoadBalancerBackend; -import com.azure.resourcemanager.network.models.LoadBalancerInboundNatPool; -import com.azure.resourcemanager.network.models.Network; -import com.azure.resourcemanager.network.models.NetworkSecurityGroup; -import com.azure.resourcemanager.network.models.VirtualMachineScaleSetNetworkInterface; -import com.azure.resourcemanager.resources.fluentcore.arm.AvailabilityZoneId; -import com.azure.resourcemanager.resources.fluentcore.arm.models.GroupableResource; -import com.azure.resourcemanager.resources.fluentcore.arm.models.Resource; -import com.azure.resourcemanager.resources.fluentcore.model.Appliable; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; -import com.azure.resourcemanager.resources.fluentcore.model.Updatable; -import com.azure.resourcemanager.storage.models.StorageAccount; -import reactor.core.publisher.Mono; - -import java.io.IOException; -import java.util.List; -import java.util.Map; -import java.util.Set; - -/** An immutable client-side representation of an Azure virtual machine scale set. */ -@Fluent -public interface VirtualMachineScaleSet - extends GroupableResource, - Refreshable, - Updatable { - // Actions - /** @return entry point to manage virtual machine instances in the scale set. */ - VirtualMachineScaleSetVMs virtualMachines(); - - /** - * @return available SKUs for the virtual machine scale set, including the minimum and maximum virtual machine - * instances allowed for a particular SKU - */ - PagedIterable listAvailableSkus(); - - /** Shuts down the virtual machines in the scale set and releases its compute resources. */ - void deallocate(); - - /** - * Shuts down the virtual machines in the scale set and releases its compute resources asynchronously. - * - * @return a representation of the deferred computation of this call - */ - Mono deallocateAsync(); - - /** Powers off (stops) the virtual machines in the scale set. */ - void powerOff(); - - /** - * Powers off (stops) the virtual machines in the scale set asynchronously. - * - * @return a representation of the deferred computation of this call - */ - Mono powerOffAsync(); - - /** Restarts the virtual machines in the scale set. */ - void restart(); - - /** - * Restarts the virtual machines in the scale set asynchronously. - * - * @return a representation of the deferred computation of this call - */ - Mono restartAsync(); - - /** Starts the virtual machines in the scale set. */ - void start(); - - /** - * Starts the virtual machines in the scale set asynchronously. - * - * @return a representation of the deferred computation of this call - */ - Mono startAsync(); - - /** Re-images (updates the version of the installed operating system) the virtual machines in the scale set. */ - void reimage(); - - /** - * Re-images (updates the version of the installed operating system) the virtual machines in the scale set - * asynchronously. - * - * @return a representation of the deferred computation of this call - */ - Mono reimageAsync(); - - /** - * Run PowerShell script in a virtual machine instance in a scale set. - * - * @param vmId the virtual machine instance id - * @param scriptLines PowerShell script lines - * @param scriptParameters script parameters - * @return result of PowerShell script execution - */ - RunCommandResult runPowerShellScriptInVMInstance( - String vmId, List scriptLines, List scriptParameters); - - /** - * Run PowerShell in a virtual machine instance in a scale set asynchronously. - * - * @param vmId the virtual machine instance id - * @param scriptLines PowerShell script lines - * @param scriptParameters script parameters - * @return handle to the asynchronous execution - */ - Mono runPowerShellScriptInVMInstanceAsync( - String vmId, List scriptLines, List scriptParameters); - - /** - * Run shell script in a virtual machine instance in a scale set. - * - * @param vmId the virtual machine instance id - * @param scriptLines shell script lines - * @param scriptParameters script parameters - * @return result of shell script execution - */ - RunCommandResult runShellScriptInVMInstance( - String vmId, List scriptLines, List scriptParameters); - - /** - * Run shell script in a virtual machine instance in a scale set asynchronously. - * - * @param vmId the virtual machine instance id - * @param scriptLines shell script lines - * @param scriptParameters script parameters - * @return handle to the asynchronous execution - */ - Mono runShellScriptInVMInstanceAsync( - String vmId, List scriptLines, List scriptParameters); - - /** - * Run commands in a virtual machine instance in a scale set. - * - * @param vmId the virtual machine instance id - * @param inputCommand command input - * @return result of execution - */ - RunCommandResult runCommandInVMInstance(String vmId, RunCommandInput inputCommand); - - /** - * Run commands in a virtual machine instance in a scale set asynchronously. - * - * @param vmId the virtual machine instance id - * @param inputCommand command input - * @return handle to the asynchronous execution - */ - Mono runCommandVMInstanceAsync(String vmId, RunCommandInput inputCommand); - - // Getters - /** @return the name prefix of the virtual machines in the scale set */ - String computerNamePrefix(); - - /** @return the operating system of the virtual machines in the scale set */ - OperatingSystemTypes osType(); - - /** @return the operating system disk caching type */ - CachingTypes osDiskCachingType(); - - /** @return the name of the OS disk of virtual machines in the scale set */ - String osDiskName(); - - /** @return the upgrade model */ - UpgradeMode upgradeModel(); - - /** @return true if over provision is enabled for the virtual machines, false otherwise */ - boolean overProvisionEnabled(); - - /** @return the SKU of the virtual machines in the scale set */ - VirtualMachineScaleSetSkuTypes sku(); - - /** @return the number of virtual machine instances in the scale set */ - int capacity(); - - /** - * @return the virtual network associated with the primary network interfaces of the virtual machines in the scale - * set. - *

    A primary internal load balancer associated with the primary network interfaces of the scale set virtual - * machine will be also belong to this network - * @throws IOException the IO exception - */ - Network getPrimaryNetwork() throws IOException; - - /** - * @return the Internet-facing load balancer associated with the primary network interface of the virtual machines - * in the scale set. - * @throws IOException the IO exception - */ - LoadBalancer getPrimaryInternetFacingLoadBalancer() throws IOException; - - /** - * @return the Internet-facing load balancer's backends associated with the primary network interface of the virtual - * machines in the scale set - * @throws IOException the IO exception - */ - Map listPrimaryInternetFacingLoadBalancerBackends() throws IOException; - - /** - * @return the Internet-facing load balancer's inbound NAT pool associated with the primary network interface of the - * virtual machines in the scale set - * @throws IOException the IO exception - */ - Map listPrimaryInternetFacingLoadBalancerInboundNatPools() throws IOException; - - /** - * @return the internal load balancer associated with the primary network interface of the virtual machines in the - * scale set - * @throws IOException the IO exception - */ - LoadBalancer getPrimaryInternalLoadBalancer() throws IOException; - - /** - * @return the internal load balancer's backends associated with the primary network interface of the virtual - * machines in the scale set - * @throws IOException the IO exception - */ - Map listPrimaryInternalLoadBalancerBackends() throws IOException; - - /** - * @return the inbound NAT pools of the internal load balancer associated with the primary network interface of the - * virtual machines in the scale set, if any. - * @throws IOException the IO exception - */ - Map listPrimaryInternalLoadBalancerInboundNatPools() throws IOException; - - /** - * @return the list of IDs of the public IP addresses associated with the primary Internet-facing load balancer of - * the scale set - * @throws IOException the IO exception - */ - List primaryPublicIpAddressIds() throws IOException; - - /** @return the URL to storage containers that store the VHDs of the virtual machines in the scale set */ - List vhdContainers(); - - /** @return the storage profile */ - VirtualMachineScaleSetStorageProfile storageProfile(); - - /** @return the network profile */ - VirtualMachineScaleSetNetworkProfile networkProfile(); - - /** @return the extensions attached to the virtual machines in the scale set */ - Map extensions(); - - /** @return the priority of virtual machines in the scale set. */ - VirtualMachinePriorityTypes virtualMachinePriority(); - - /** @return the billing related details of the low priority virtual machines in the scale set. */ - BillingProfile billingProfile(); - - /** @return the eviction policy of the virtual machines in the scale set. */ - VirtualMachineEvictionPolicyTypes virtualMachineEvictionPolicy(); - - /** - * Gets a network interface associated with a virtual machine scale set instance. - * - * @param instanceId the virtual machine scale set vm instance ID - * @param name the network interface name - * @return the network interface - */ - VirtualMachineScaleSetNetworkInterface getNetworkInterfaceByInstanceId(String instanceId, String name); - - /** @return the network interfaces associated with all virtual machine instances in a scale set */ - PagedIterable listNetworkInterfaces(); - - /** - * Lists the network interface associated with a specific virtual machine instance in the scale set. - * - * @param virtualMachineInstanceId the instance ID - * @return the network interfaces - */ - PagedIterable listNetworkInterfacesByInstanceId( - String virtualMachineInstanceId); - - /** - * Lists the network interface associated with a specific virtual machine instance in the scale set asynchronously. - * - * @param virtualMachineInstanceId the instance ID - * @return the network interfaces - */ - PagedFlux listNetworkInterfacesByInstanceIdAsync( - String virtualMachineInstanceId); - - /** @return true if managed disk is used for the virtual machine scale set's disks (os, data) */ - boolean isManagedDiskEnabled(); - - /** @return true if Managed Service Identity is enabled for the virtual machine scale set */ - boolean isManagedServiceIdentityEnabled(); - - /** - * @return the System Assigned (Local) Managed Service Identity specific Active Directory tenant ID assigned to the - * virtual machine scale set. - */ - String systemAssignedManagedServiceIdentityTenantId(); - - /** - * @return the System Assigned (Local) Managed Service Identity specific Active Directory service principal ID - * assigned to the virtual machine scale set. - */ - String systemAssignedManagedServiceIdentityPrincipalId(); - - /** @return the type of Managed Service Identity used for the virtual machine scale set. */ - ResourceIdentityType managedServiceIdentityType(); - - /** - * @return the resource ids of User Assigned Managed Service Identities associated with the virtual machine scale - * set. - */ - Set userAssignedManagedServiceIdentityIds(); - - /** @return the availability zones assigned to virtual machine scale set. */ - Set availabilityZones(); - - /** @return true if boot diagnostics is enabled for the virtual machine scale set. */ - boolean isBootDiagnosticsEnabled(); - - /** @return the storage blob endpoint uri if boot diagnostics is enabled for the virtual machine scale set. */ - String bootDiagnosticsStorageUri(); - - /** - * @return the storage account type of the OS managed disk. A null value will be returned if the virtual machine - * scale set is based on un-managed disk. - */ - StorageAccountTypes managedOSDiskStorageAccountType(); - - /** @return the public ip configuration of virtual machines in the scale set. */ - VirtualMachineScaleSetPublicIpAddressConfiguration virtualMachinePublicIpConfig(); - - /** @return true if ip forwarding is enabled for the virtual machine scale set. */ - boolean isIpForwardingEnabled(); - - /** @return true if accelerated networking is enabled for the virtual machine scale set. */ - boolean isAcceleratedNetworkingEnabled(); - - /** @return the network security group ARM id. */ - String networkSecurityGroupId(); - - /** @return true if single placement group is enabled for the virtual machine scale set. */ - boolean isSinglePlacementGroupEnabled(); - - /** @return the list of application gateway backend pool associated with the virtual machine scale set. */ - List applicationGatewayBackendAddressPoolsIds(); - - /** @return the list of application security groups associated with the virtual machine scale set. */ - List applicationSecurityGroupIds(); - - /** - * @return When Overprovision is enabled, extensions are launched only on the requested number of VMs which are - * finally kept. This property will hence ensure that the extensions do not run on the extra overprovisioned - * VMs. - */ - Boolean doNotRunExtensionsOnOverprovisionedVMs(); - - /** - * Get specifies information about the proximity placement group that the virtual machine scale set should be - * assigned to. - * - * @return the proximityPlacementGroup. - */ - ProximityPlacementGroup proximityPlacementGroup(); - - /** - * Get specifies additional capabilities enabled or disabled on the Virtual Machines in the Virtual Machine Scale - * Set. For instance: whether the Virtual Machines have the capability to support attaching managed data disks with - * UltraSSD_LRS storage account type. - * - * @return the additionalCapabilities value - */ - AdditionalCapabilities additionalCapabilities(); - - /** - * The virtual machine scale set stages shared between managed and unmanaged based virtual machine scale set - * definitions. - */ - interface DefinitionShared - extends DefinitionStages.Blank, - DefinitionStages.WithGroup, - DefinitionStages.WithSku, - DefinitionStages.WithProximityPlacementGroup, - DefinitionStages.WithNetworkSubnet, - DefinitionStages.WithPrimaryInternetFacingLoadBalancer, - DefinitionStages.WithPrimaryInternalLoadBalancer, - DefinitionStages.WithPrimaryInternetFacingLoadBalancerBackendOrNatPool, - DefinitionStages.WithInternalLoadBalancerBackendOrNatPool, - DefinitionStages.WithPrimaryInternetFacingLoadBalancerNatPool, - DefinitionStages.WithInternalInternalLoadBalancerNatPool, - DefinitionStages.WithOS, - DefinitionStages.WithCreate { - } - - /** The entirety of the virtual machine scale set definition. */ - interface DefinitionManagedOrUnmanaged - extends DefinitionShared, - DefinitionStages.WithLinuxRootUsernameManagedOrUnmanaged, - DefinitionStages.WithLinuxRootPasswordOrPublicKeyManagedOrUnmanaged, - DefinitionStages.WithWindowsAdminUsernameManagedOrUnmanaged, - DefinitionStages.WithWindowsAdminPasswordManagedOrUnmanaged, - DefinitionStages.WithLinuxCreateManagedOrUnmanaged, - DefinitionStages.WithWindowsCreateManagedOrUnmanaged, - DefinitionStages.WithManagedCreate, - DefinitionStages.WithUnmanagedCreate { - } - - /** The entirety of the managed disk based virtual machine scale set definition. */ - interface DefinitionManaged - extends DefinitionShared, - DefinitionStages.WithLinuxRootUsernameManaged, - DefinitionStages.WithLinuxRootPasswordOrPublicKeyManaged, - DefinitionStages.WithWindowsAdminUsernameManaged, - DefinitionStages.WithWindowsAdminPasswordManaged, - DefinitionStages.WithLinuxCreateManaged, - DefinitionStages.WithWindowsCreateManaged, - DefinitionStages.WithManagedCreate { - } - - /** The entirety of the unmanaged disk based virtual machine scale set definition. */ - interface DefinitionUnmanaged - extends DefinitionShared, - DefinitionStages.WithLinuxRootUsernameUnmanaged, - DefinitionStages.WithLinuxRootPasswordOrPublicKeyUnmanaged, - DefinitionStages.WithWindowsAdminUsernameUnmanaged, - DefinitionStages.WithWindowsAdminPasswordUnmanaged, - DefinitionStages.WithLinuxCreateUnmanaged, - DefinitionStages.WithWindowsCreateUnmanaged, - DefinitionStages.WithUnmanagedCreate { - } - - /** Grouping of virtual machine scale set definition stages. */ - interface DefinitionStages { - /** The first stage of a virtual machine scale set definition. */ - interface Blank - extends GroupableResource.DefinitionWithRegion { - } - - /** The stage of a virtual machine scale set definition allowing to specify the resource group. */ - interface WithGroup extends GroupableResource.DefinitionStages.WithGroup { - } - - /** The stage of a virtual machine scale set definition allowing to specify SKU for the virtual machines. */ - interface WithSku { - /** - * Specifies the SKU for the virtual machines in the scale set. - * - * @param skuType the SKU type - * @return the next stage of the definition - */ - WithProximityPlacementGroup withSku(VirtualMachineScaleSetSkuTypes skuType); - - /** - * Specifies the SKU for the virtual machines in the scale set. - * - * @param sku a SKU from the list of available sizes for the virtual machines in this scale set - * @return the next stage of the definition - */ - WithProximityPlacementGroup withSku(VirtualMachineScaleSetSku sku); - } - - /** - * The stage of a virtual machine scale set definition allowing to set information about the proximity placement - * group that the virtual machine scale set should be assigned to. - */ - interface WithProximityPlacementGroup extends WithDoNotRunExtensionsOnOverprovisionedVms { - /** - * Set information about the proximity placement group that the virtual machine scale set should be assigned - * to. - * - * @param proximityPlacementGroupId The Id of the proximity placement group subResource. - * @return the next stage of the definition. - */ - WithDoNotRunExtensionsOnOverprovisionedVms withProximityPlacementGroup(String proximityPlacementGroupId); - - /** - * Creates a new proximity placement gruup witht he specified name and then adds it to the VM scale set. - * - * @param proximityPlacementGroupName The name of the group to be created. - * @param type the type of the group - * @return the next stage of the definition. - */ - WithDoNotRunExtensionsOnOverprovisionedVms withNewProximityPlacementGroup( - String proximityPlacementGroupName, ProximityPlacementGroupType type); - } - - /** - * The stage of a virtual machine scale set definition allowing to set when Overprovision is enabled, extensions - * are launched only on the requested number of VMs which are finally kept. - */ - interface WithDoNotRunExtensionsOnOverprovisionedVms extends WithAdditionalCapabilities { - /** - * Set when Overprovision is enabled, extensions are launched only on the requested number of VMs which are - * finally kept. This property will hence ensure that the extensions do not run on the extra overprovisioned - * VMs. - * - * @param doNotRunExtensionsOnOverprovisionedVMs the doNotRunExtensionsOnOverprovisionedVMs value to set - * @return the next stage of the definition. - */ - WithAdditionalCapabilities withDoNotRunExtensionsOnOverprovisionedVMs( - Boolean doNotRunExtensionsOnOverprovisionedVMs); - } - - /** - * The stage of a virtual machine scale set definition allowing to set specifies additional capabilities enabled - * or disabled on the Virtual Machines in the Virtual Machine Scale Set. - */ - interface WithAdditionalCapabilities extends WithNetworkSubnet { - /** - * Set specifies additional capabilities enabled or disabled on the Virtual Machines in the Virtual Machine - * Scale Set. For instance: whether the Virtual Machines have the capability to support attaching managed - * data disks with UltraSSD_LRS storage account type. - * - * @param additionalCapabilities the additionalCapabilities value to set - * @return the next stage of the definition. - */ - WithNetworkSubnet withAdditionalCapabilities(AdditionalCapabilities additionalCapabilities); - } - - /** - * The stage of a virtual machine scale set definition allowing to specify the virtual network subnet for the - * primary network configuration. - */ - interface WithNetworkSubnet { - /** - * Associate an existing virtual network subnet with the primary network interface of the virtual machines - * in the scale set. - * - * @param network an existing virtual network - * @param subnetName the subnet name - * @return the next stage of the definition - */ - WithPrimaryInternetFacingLoadBalancer withExistingPrimaryNetworkSubnet(Network network, String subnetName); - } - - /** - * The stage of a virtual machine scale set definition allowing to specify an Internet-facing load balancer for - * the primary network interface of the virtual machines in the scale set. - */ - interface WithPrimaryInternetFacingLoadBalancer { - /** - * Specifies an Internet-facing load balancer whose backends and/or NAT pools can be assigned to the primary - * network interfaces of the virtual machines in the scale set. - * - *

    By default, all the backends and inbound NAT pools of the load balancer will be associated with the - * primary network interface of the scale set virtual machines. - * - * @param loadBalancer an existing Internet-facing load balancer - * @return the next stage of the definition - */ - WithPrimaryInternetFacingLoadBalancerBackendOrNatPool withExistingPrimaryInternetFacingLoadBalancer( - LoadBalancer loadBalancer); - - /** - * Specifies that no public load balancer should be associated with the virtual machine scale set. - * - * @return the next stage of the definition - */ - WithPrimaryInternalLoadBalancer withoutPrimaryInternetFacingLoadBalancer(); - } - - /** - * The stage of a virtual machine scale set definition allowing to specify an internal load balancer for the - * primary network interface of the virtual machines in the scale set. - */ - interface WithPrimaryInternalLoadBalancer { - /** - * Specifies the internal load balancer whose backends and/or NAT pools can be assigned to the primary - * network interface of the virtual machines in the scale set. - * - *

    By default all the backends and inbound NAT pools of the load balancer will be associated with the - * primary network interface of the virtual machines in the scale set, unless subset of them is selected in - * the next stages. - * - * @param loadBalancer an existing internal load balancer - * @return the next stage of the definition - */ - WithInternalLoadBalancerBackendOrNatPool withExistingPrimaryInternalLoadBalancer(LoadBalancer loadBalancer); - - /** - * Specifies that no internal load balancer should be associated with the primary network interfaces of the - * virtual machines in the scale set. - * - * @return the next stage of the definition - */ - WithOS withoutPrimaryInternalLoadBalancer(); - } - - /** - * The stage of a virtual machine scale set definition allowing to associate a backend pool and/or an inbound - * NAT pool of the selected Internet-facing load balancer with the primary network interface of the virtual - * machines in the scale set. - */ - interface WithPrimaryInternetFacingLoadBalancerBackendOrNatPool - extends WithPrimaryInternetFacingLoadBalancerNatPool { - /** - * Associates the specified backends of the selected load balancer with the primary network interface of the - * virtual machines in the scale set. - * - * @param backendNames the names of existing backends in the selected load balancer - * @return the next stage of the definition - */ - WithPrimaryInternetFacingLoadBalancerNatPool withPrimaryInternetFacingLoadBalancerBackends( - String... backendNames); - } - - /** - * The stage of a virtual machine scale set definition allowing to associate an inbound NAT pool of the selected - * Internet-facing load balancer with the primary network interface of the virtual machines in the scale set. - */ - interface WithPrimaryInternetFacingLoadBalancerNatPool extends WithPrimaryInternalLoadBalancer { - /** - * Associates the specified inbound NAT pools of the selected internal load balancer with the primary - * network interface of the virtual machines in the scale set. - * - * @param natPoolNames inbound NAT pools names existing on the selected load balancer - * @return the next stage of the definition - */ - WithPrimaryInternalLoadBalancer withPrimaryInternetFacingLoadBalancerInboundNatPools( - String... natPoolNames); - } - - /** - * The stage of a virtual machine scale set definition allowing to associate backend pools and/or inbound NAT - * pools of the selected internal load balancer with the primary network interface of the virtual machines in - * the scale set. - */ - interface WithInternalLoadBalancerBackendOrNatPool extends WithInternalInternalLoadBalancerNatPool { - /** - * Associates the specified backends of the selected load balancer with the primary network interface of the - * virtual machines in the scale set. - * - * @param backendNames names of existing backends in the selected load balancer - * @return the next stage of the definition - */ - WithInternalInternalLoadBalancerNatPool withPrimaryInternalLoadBalancerBackends(String... backendNames); - } - - /** - * The stage of the virtual machine scale set definition allowing to associate inbound NAT pools of the selected - * internal load balancer with the primary network interface of the virtual machines in the scale set. - */ - interface WithInternalInternalLoadBalancerNatPool extends WithOS { - /** - * Associate internal load balancer inbound NAT pools with the the primary network interface of the scale - * set virtual machine. - * - * @param natPoolNames inbound NAT pool names - * @return the next stage of the definition - */ - WithOS withPrimaryInternalLoadBalancerInboundNatPools(String... natPoolNames); - } - - /** The stage of the virtual machine scale set definition allowing to specify the operating system image. */ - interface WithOS { - /** - * Specifies a known marketplace Windows image used as the operating system for the virtual machines in the - * scale set. - * - * @param knownImage a known market-place image - * @return the next stage of the definition - */ - WithWindowsAdminUsernameManagedOrUnmanaged withPopularWindowsImage( - KnownWindowsVirtualMachineImage knownImage); - - /** - * Specifies that the latest version of the specified marketplace Windows image should be used. - * - * @param publisher specifies the publisher of the image - * @param offer specifies the offer of the image - * @param sku specifies the SKU of the image - * @return the next stage of the definition - */ - WithWindowsAdminUsernameManagedOrUnmanaged withLatestWindowsImage( - String publisher, String offer, String sku); - - /** - * Specifies the specific version of a marketplace Windows image needs to be used. - * - * @param imageReference describes publisher, offer, SKU and version of the marketplace image - * @return the next stage of the definition - */ - WithWindowsAdminUsernameManagedOrUnmanaged withSpecificWindowsImageVersion(ImageReference imageReference); - - /** - * Specifies the ID of a generalized Windows custom image to be used. - * - * @param customImageId the resource ID of the custom image - * @return the next stage of the definition - */ - WithWindowsAdminUsernameManaged withGeneralizedWindowsCustomImage(String customImageId); - - /** - * Specifies the ID of a specialized Windows custom image to be used. - * - * @param customImageId the resource ID of the custom image - * @return the next stage of the definition - */ - WithWindowsCreateManaged withSpecializedWindowsCustomImage(String customImageId); - - /** - * Specifies the user (custom) Windows image to be used as the operating system for the virtual machines in - * the scale set. - * - * @param imageUrl the URL of the VHD - * @return the next stage of the definition - */ - WithWindowsAdminUsernameUnmanaged withStoredWindowsImage(String imageUrl); - - /** - * Specifies a known marketplace Linux image used as the virtual machine's operating system. - * - * @param knownImage a known market-place image - * @return the next stage of the definition - */ - WithLinuxRootUsernameManagedOrUnmanaged withPopularLinuxImage(KnownLinuxVirtualMachineImage knownImage); - - /** - * Specifies that the latest version of a marketplace Linux image should be used. - * - * @param publisher the publisher of the image - * @param offer the offer of the image - * @param sku the SKU of the image - * @return the next stage of the definition - */ - WithLinuxRootUsernameManagedOrUnmanaged withLatestLinuxImage(String publisher, String offer, String sku); - - /** - * Specifies the specific version of a market-place Linux image that should be used. - * - * @param imageReference describes the publisher, offer, SKU and version of the market-place image - * @return the next stage of the definition - */ - WithLinuxRootUsernameManagedOrUnmanaged withSpecificLinuxImageVersion(ImageReference imageReference); - - /** - * Specifies the ID of a generalized Linux custom image to be used. - * - * @param customImageId the resource ID of the custom image - * @return the next stage of the definition - */ - WithLinuxRootUsernameManaged withGeneralizedLinuxCustomImage(String customImageId); - - /** - * Specifies the ID of a specialized Linux custom image to be used. - * - * @param customImageId the resource ID of the custom image - * @return the next stage of the definition - */ - WithLinuxCreateManaged withSpecializedLinuxCustomImage(String customImageId); - - /** - * Specifies the user (custom) Linux image used as the virtual machine's operating system. - * - * @param imageUrl the URL the the VHD - * @return the next stage of the definition - */ - WithLinuxRootUsernameUnmanaged withStoredLinuxImage(String imageUrl); - } - - /** The stage of the Linux virtual machine scale set definition allowing to specify SSH root user name. */ - interface WithLinuxRootUsernameManagedOrUnmanaged { - /** - * Specifies the SSH root user name for the Linux virtual machine. - * - * @param rootUserName a root user name following the required naming convention for Linux user names - * @return the next stage of the definition - */ - WithLinuxRootPasswordOrPublicKeyManagedOrUnmanaged withRootUsername(String rootUserName); - } - - /** The stage of the Linux virtual machine scale set definition allowing to specify SSH root user name. */ - interface WithLinuxRootUsernameManaged { - /** - * Specifies the SSH root user name for the Linux virtual machine. - * - * @param rootUserName a root user name following the required naming conventions for Linux user names - * @return the next stage of the definition - */ - WithLinuxRootPasswordOrPublicKeyManaged withRootUsername(String rootUserName); - } - - /** The stage of the Linux virtual machine scale set definition allowing to specify SSH root user name. */ - interface WithLinuxRootUsernameUnmanaged { - /** - * Specifies the SSH root user name for the Linux virtual machine. - * - * @param rootUserName a root user name following the required naming convention for Linux user names - * @return the next stage of the definition - */ - WithLinuxRootPasswordOrPublicKeyUnmanaged withRootUsername(String rootUserName); - } - - /** - * The stage of the Linux virtual machine scale set definition allowing to specify SSH root password or public - * key. - */ - interface WithLinuxRootPasswordOrPublicKeyManagedOrUnmanaged { - /** - * Specifies the SSH root password for the Linux virtual machine. - * - * @param rootPassword a password following the complexity criteria for Azure Linux VM passwords - * @return the next stage of the definition - */ - WithLinuxCreateManagedOrUnmanaged withRootPassword(String rootPassword); - - /** - * Specifies the SSH public key. - * - *

    Each call to this method adds the given public key to the list of VM's public keys. - * - * @param publicKey the SSH public key in PEM format. - * @return the next stage of the definition - */ - WithLinuxCreateManagedOrUnmanaged withSsh(String publicKey); - } - - /** - * The stage of the Linux virtual machine scale set definition allowing to specify SSH root password or public - * key. - */ - interface WithLinuxRootPasswordOrPublicKeyManaged { - /** - * Specifies the SSH root password for the Linux virtual machine. - * - * @param rootPassword a password following the complexity criteria for Azure Linux VM passwords - * @return the next stage of the definition - */ - WithLinuxCreateManaged withRootPassword(String rootPassword); - - /** - * Specifies the SSH public key. - * - *

    Each call to this method adds the given public key to the list of VM's public keys. - * - * @param publicKey the SSH public key in PEM format. - * @return the next stage of the definition - */ - WithLinuxCreateManaged withSsh(String publicKey); - } - - /** - * The stage of the Linux virtual machine scale set definition allowing to specify SSH root password or public - * key. - */ - interface WithLinuxRootPasswordOrPublicKeyUnmanaged { - /** - * Specifies the SSH root password for the Linux virtual machine. - * - * @param rootPassword a password following the complexity criteria for Azure Linux VM passwords - * @return the next stage of the definition - */ - WithLinuxCreateUnmanaged withRootPassword(String rootPassword); - - /** - * Specifies the SSH public key. - * - *

    Each call to this method adds the given public key to the list of VM's public keys. - * - * @param publicKey the SSH public key in PEM format. - * @return the next stage of the definition - */ - WithLinuxCreateUnmanaged withSsh(String publicKey); - } - - /** - * The stage of the Windows virtual machine scale set definition allowing to specify administrator user name. - */ - interface WithWindowsAdminUsernameManagedOrUnmanaged { - /** - * Specifies the administrator user name for the Windows virtual machine. - * - * @param adminUserName the Windows administrator user name. This must follow the required naming convention - * for Windows user name. - * @return the next stage of the definition - */ - WithWindowsAdminPasswordManagedOrUnmanaged withAdminUsername(String adminUserName); - } - - /** - * The stage of the Windows virtual machine scale set definition allowing to specify administrator user name. - */ - interface WithWindowsAdminUsernameManaged { - /** - * Specifies the administrator user name for the Windows virtual machine. - * - * @param adminUserName the Windows administrator user name. This must follow the required naming convention - * for Windows user name. - * @return the next stage of the definition - */ - WithWindowsAdminPasswordManaged withAdminUsername(String adminUserName); - } - - /** - * The stage of the Windows virtual machine scale set definition allowing to specify administrator user name. - */ - interface WithWindowsAdminUsernameUnmanaged { - /** - * Specifies the administrator user name for the Windows virtual machine. - * - * @param adminUserName the Windows administrator user name. This must follow the required naming convention - * for Windows user name. - * @return the next stage of the definition - */ - WithWindowsAdminPasswordUnmanaged withAdminUsername(String adminUserName); - } - - /** - * The stage of the Windows virtual machine scale set definition allowing to specify administrator user name. - */ - interface WithWindowsAdminPasswordManagedOrUnmanaged { - /** - * Specifies the administrator password for the Windows virtual machine. - * - * @param adminPassword the administrator password. This must follow the criteria for Azure Windows VM - * password. - * @return the stage representing creatable Windows VM definition - */ - WithWindowsCreateManagedOrUnmanaged withAdminPassword(String adminPassword); - } - - /** - * The stage of the Windows virtual machine scale set definition allowing to specify administrator user name. - */ - interface WithWindowsAdminPasswordManaged { - /** - * Specifies the administrator password for the Windows virtual machine. - * - * @param adminPassword the administrator password. This must follow the criteria for Azure Windows VM - * password. - * @return the stage representing creatable Windows VM definition - */ - WithWindowsCreateManaged withAdminPassword(String adminPassword); - } - - /** - * The stage of the Windows virtual machine scale set definition allowing to specify administrator user name. - */ - interface WithWindowsAdminPasswordUnmanaged { - /** - * Specifies the administrator password for the Windows virtual machine. - * - * @param adminPassword the administrator password. This must follow the criteria for Azure Windows VM - * password. - * @return the stage representing creatable Windows VM definition - */ - WithWindowsCreateUnmanaged withAdminPassword(String adminPassword); - } - - /** - * The stage of a Linux virtual machine scale set definition which contains all the minimum required inputs for - * the resource to be created, but also allows for any other optional settings to be specified. - */ - interface WithLinuxCreateManagedOrUnmanaged extends WithManagedCreate { - /** - * Specifies the SSH public key. - * - *

    Each call to this method adds the given public key to the list of VM's public keys. - * - * @param publicKey an SSH public key in the PEM format. - * @return the next stage of the definition - */ - WithLinuxCreateManagedOrUnmanaged withSsh(String publicKey); - - /** @return the next stage of a unmanaged disk based virtual machine scale set definition */ - WithUnmanagedCreate withUnmanagedDisks(); - } - - /** - * The stage of a Linux virtual machine scale set definition which contains all the minimum required inputs for - * the resource to be created, but also allows for any other optional settings to be specified. - */ - interface WithLinuxCreateManaged extends WithManagedCreate { - /** - * Specifies the SSH public key. - * - *

    Each call to this method adds the given public key to the list of VM's public keys. - * - * @param publicKey an SSH public key in the PEM format. - * @return the next stage of the definition - */ - WithLinuxCreateManaged withSsh(String publicKey); - } - - /** - * The stage of a Linux virtual machine scale set definition which contains all the minimum required inputs for - * the resource to be created, but also allows for any other optional settings to be specified. - */ - interface WithLinuxCreateUnmanaged extends WithUnmanagedCreate { - /** - * Specifies the SSH public key. - * - *

    Each call to this method adds the given public key to the list of VM's public keys. - * - * @param publicKey an SSH public key in the PEM format. - * @return the next stage of the definition - */ - WithLinuxCreateUnmanaged withSsh(String publicKey); - } - - /** - * The stage of a Windows virtual machine scale set definition which contains all the minimum required inputs - * for the resource to be created, but also allows for any other optional settings to be specified. - */ - interface WithWindowsCreateManagedOrUnmanaged extends WithWindowsCreateManaged { - /** - * Enables unmanaged disks. - * - * @return the next stage of the definition - */ - WithWindowsCreateUnmanaged withUnmanagedDisks(); - } - - /** - * The stage of a Windows virtual machine scale set definition which contains all the minimum required inputs - * for the resource to be created, but also allows for any other optional settings to be specified. - */ - interface WithWindowsCreateManaged extends WithManagedCreate { - /** - * Enables the VM agent. - * - * @return the next stage of the definition - */ - WithWindowsCreateManaged withVMAgent(); - - /** - * Disables the VM agent. - * - * @return the next stage of the definition - */ - WithWindowsCreateManaged withoutVMAgent(); - - /** - * Enables automatic updates. - * - * @return the next stage of the definition - */ - WithWindowsCreateManaged withAutoUpdate(); - - /** - * Disables automatic updates. - * - * @return the next stage of the definition - */ - WithWindowsCreateManaged withoutAutoUpdate(); - - /** - * Specifies the time zone for the virtual machines to use. - * - * @param timeZone a time zone - * @return the next stage of the definition - */ - WithWindowsCreateManaged withTimeZone(String timeZone); - - /** - * Specifies the WinRM listener. - * - *

    Each call to this method adds the given listener to the list of VM's WinRM listeners. - * - * @param listener a WinRM listener - * @return the next stage of the definition - */ - WithWindowsCreateManaged withWinRM(WinRMListener listener); - } - - /** - * The stage of a Windows virtual machine scale set definition which contains all the minimum required inputs - * for the resource to be created, but also allows for any other optional settings to be specified. - */ - interface WithWindowsCreateUnmanaged extends WithUnmanagedCreate { - /** - * Enables the VM agent. - * - * @return the next stage of the definition - */ - WithWindowsCreateUnmanaged withVMAgent(); - - /** - * Disables the VM agent. - * - * @return the next stage of the definition - */ - WithWindowsCreateUnmanaged withoutVMAgent(); - - /** - * Enables automatic updates. - * - * @return the next stage of the definition - */ - WithWindowsCreateUnmanaged withAutoUpdate(); - - /** - * Disables automatic updates. - * - * @return the next stage of the definition - */ - WithWindowsCreateUnmanaged withoutAutoUpdate(); - - /** - * Specifies the time zone for the virtual machines to use. - * - * @param timeZone a time zone - * @return the next stage of the definition - */ - WithWindowsCreateUnmanaged withTimeZone(String timeZone); - - /** - * Specifies the WinRM listener. - * - *

    Each call to this method adds the given listener to the list of VM's WinRM listeners. - * - * @param listener a WinRM listener - * @return the next stage of the definition - */ - WithWindowsCreateUnmanaged withWinRM(WinRMListener listener); - } - - /** The stage of a virtual machine scale set definition allowing to specify managed data disks. */ - interface WithManagedDataDisk { - /** - * Specifies that a managed disk needs to be created implicitly with the given size. - * - * @param sizeInGB the size of the managed disk - * @return the next stage of virtual machine definition - */ - WithManagedCreate withNewDataDisk(int sizeInGB); - - /** - * Specifies that a managed disk needs to be created implicitly with the given settings. - * - * @param sizeInGB the size of the managed disk - * @param lun the disk LUN - * @param cachingType the caching type - * @return the next stage of virtual machine definition - */ - WithManagedCreate withNewDataDisk(int sizeInGB, int lun, CachingTypes cachingType); - - /** - * Specifies that a managed disk needs to be created implicitly with the given settings. - * - * @param sizeInGB the size of the managed disk - * @param lun the disk LUN - * @param cachingType the caching type - * @param storageAccountType the storage account type - * @return the next stage of virtual machine definition - */ - WithManagedCreate withNewDataDisk( - int sizeInGB, int lun, CachingTypes cachingType, StorageAccountTypes storageAccountType); - - /** - * Specifies the data disk to be created from the data disk image in the virtual machine image. - * - * @param imageLun the LUN of the source data disk image - * @return the next stage of virtual machine definition - */ - WithManagedCreate withNewDataDiskFromImage(int imageLun); - - /** - * Specifies the data disk to be created from the data disk image in the virtual machine image. - * - * @param imageLun the LUN of the source data disk image - * @param newSizeInGB the new size that overrides the default size specified in the data disk image - * @param cachingType the caching type - * @return the next stage of virtual machine definition - */ - WithManagedCreate withNewDataDiskFromImage(int imageLun, int newSizeInGB, CachingTypes cachingType); - - /** - * Specifies the data disk to be created from the data disk image in the virtual machine image. - * - * @param imageLun the LUN of the source data disk image - * @param newSizeInGB the new size that overrides the default size specified in the data disk image - * @param cachingType the caching type - * @param storageAccountType the storage account type - * @return the next stage of virtual machine definition - */ - WithManagedCreate withNewDataDiskFromImage( - int imageLun, int newSizeInGB, CachingTypes cachingType, StorageAccountTypes storageAccountType); - } - - /** The optionals applicable only for managed disks. */ - interface WithManagedDiskOptionals { - /** - * Specifies the storage account type for managed OS disk. - * - * @param accountType the storage account type - * @return the stage representing creatable VM definition - */ - WithManagedCreate withOSDiskStorageAccountType(StorageAccountTypes accountType); - - /** - * Specifies the default caching type for the managed data disks. - * - * @param cachingType the caching type - * @return the stage representing creatable VM definition - */ - WithManagedCreate withDataDiskDefaultCachingType(CachingTypes cachingType); - - /** - * Specifies the default caching type for the managed data disks. - * - * @param storageAccountType the storage account type - * @return the stage representing creatable VM definition - */ - WithManagedCreate withDataDiskDefaultStorageAccountType(StorageAccountTypes storageAccountType); - } - - /** The stage of the virtual machine scale set definition allowing to specify availability zone. */ - interface WithAvailabilityZone { - /** - * Specifies the availability zone for the virtual machine scale set. - * - * @param zoneId the zone identifier. - * @return the next stage of the definition - */ - WithManagedCreate withAvailabilityZone(AvailabilityZoneId zoneId); - } - - /** - * The stage of the definition which contains all the minimum required inputs for the VM scale set to be created - * and optionally allow managed data disks specific settings to be specified. - */ - interface WithManagedCreate - extends WithManagedDataDisk, WithManagedDiskOptionals, WithAvailabilityZone, WithCreate { - } - - /** The stage of the virtual machine scale set definition allowing to specify unmanaged data disk. */ - interface WithUnmanagedDataDisk { - } - - /** - * The stage of the definition which contains all the minimum required inputs for the VM scale set to be created - * and optionally allow unmanaged data disks specific settings to be specified. - */ - interface WithUnmanagedCreate extends WithUnmanagedDataDisk, WithCreate { - } - - /** The stage of a virtual machine scale set definition allowing to specify the computer name prefix. */ - interface WithComputerNamePrefix { - /** - * Specifies the name prefix to use for auto-generating the names for the virtual machines in the scale set. - * - * @param namePrefix the prefix for the auto-generated names of the virtual machines in the scale set - * @return the next stage of the definition - */ - WithCreate withComputerNamePrefix(String namePrefix); - } - - /** - * The stage of the virtual machine scale set definition allowing to specify number of virtual machines in the - * scale set. - */ - interface WithCapacity { - /** - * Specifies the maximum number of virtual machines in the scale set. - * - * @param capacity number of virtual machines - * @return the next stage of the definition - */ - WithCreate withCapacity(long capacity); - } - - /** The stage of a virtual machine scale set definition allowing to specify the upgrade policy. */ - interface WithUpgradePolicy { - /** - * Specifies the virtual machine scale set upgrade policy mode. - * - * @param upgradeMode an upgrade policy mode - * @return the next stage of the definition - */ - WithCreate withUpgradeMode(UpgradeMode upgradeMode); - } - - /** - * The stage of a virtual machine scale set definition allowing to specify whether or not to over-provision - * virtual machines in the scale set. - */ - interface WithOverProvision { - /** - * Enables or disables over-provisioning of virtual machines in the scale set. - * - * @param enabled true if enabling over-0provisioning of virtual machines in the scale set, otherwise false - * @return the next stage of the definition - */ - WithCreate withOverProvision(boolean enabled); - - /** - * Enables over-provisioning of virtual machines. - * - * @return the next stage of the definition - */ - WithCreate withOverProvisioning(); - - /** - * Disables over-provisioning of virtual machines. - * - * @return the next stage of the definition - */ - WithCreate withoutOverProvisioning(); - } - - /** The stage of a virtual machine scale set definition allowing to specify OS disk configurations. */ - interface WithOSDiskSettings { - /** - * Specifies the caching type for the operating system disk. - * - * @param cachingType the caching type - * @return the next stage of the definition - */ - WithCreate withOSDiskCaching(CachingTypes cachingType); - - /** - * Specifies the name for the OS disk. - * - * @param name the OS disk name - * @return the next stage of the definition - */ - WithCreate withOSDiskName(String name); - } - - /** The stage of a virtual machine scale set definition allowing to specify the storage account. */ - interface WithStorageAccount { - /** - * Specifies a new storage account for the OS and data disk VHDs of the virtual machines in the scale set. - * - * @param name the name of the storage account - * @return the next stage of the definition - */ - WithCreate withNewStorageAccount(String name); - - /** - * Specifies a new storage account for the OS and data disk VHDs of the virtual machines in the scale set. - * - * @param creatable the storage account definition in a creatable stage - * @return the next stage in the definition - */ - WithCreate withNewStorageAccount(Creatable creatable); - - /** - * Specifies an existing storage account for the OS and data disk VHDs of the virtual machines in the scale - * set. - * - * @param storageAccount an existing storage account - * @return the next stage in the definition - */ - WithCreate withExistingStorageAccount(StorageAccount storageAccount); - } - - /** The stage of the virtual machine scale set definition allowing to specify the custom data. */ - interface WithCustomData { - /** - * Specifies the custom data for the virtual machine scale set. - * - * @param base64EncodedCustomData the base64 encoded custom data - * @return the next stage in the definition - */ - WithCreate withCustomData(String base64EncodedCustomData); - } - - /** The stage of the virtual machine scale set definition allowing to specify the secrets. */ - interface WithSecrets { - /** - * Specifies set of certificates that should be installed onto the virtual machine. - * - * @param secrets the secrets value to set - * @return the next stage in the definition he secrets value to set - */ - WithCreate withSecrets(List secrets); - } - - /** The stage of a virtual machine scale set definition allowing to specify extensions. */ - interface WithExtension { - /** - * Begins the definition of an extension reference to be attached to the virtual machines in the scale set. - * - * @param name the reference name for the extension - * @return the first stage of the extension reference definition - */ - VirtualMachineScaleSetExtension.DefinitionStages.Blank defineNewExtension(String name); - } - - /** - * The stage of the virtual machine scale set definition allowing to enable System Assigned (Local) Managed - * Service Identity. - */ - interface WithSystemAssignedManagedServiceIdentity { - /** - * Specifies that System Assigned (Local) Managed Service Identity needs to be enabled in the virtual - * machine scale set. - * - * @return the next stage of the definition - */ - WithSystemAssignedIdentityBasedAccessOrCreate withSystemAssignedManagedServiceIdentity(); - } - - /** - * The stage of the System Assigned (Local) Managed Service Identity enabled virtual machine scale set allowing - * to set access for the identity. - */ - interface WithSystemAssignedIdentityBasedAccessOrCreate extends WithCreate { - /** - * Specifies that virtual machine scale set's system assigned (local) identity should have the given access - * (described by the role) on an ARM resource identified by the resource ID. Applications running on the - * scale set VM instance will have the same permission (role) on the ARM resource. - * - * @param resourceId the ARM identifier of the resource - * @param role access role to assigned to the scale set local identity - * @return the next stage of the definition - */ - WithSystemAssignedIdentityBasedAccessOrCreate withSystemAssignedIdentityBasedAccessTo( - String resourceId, BuiltInRole role); - - /** - * Specifies that virtual machine scale set's local identity should have the given access (described by the - * role) on the resource group that virtual machine resides. Applications running on the scale set VM - * instance will have the same permission (role) on the resource group. - * - * @param role access role to assigned to the scale set local identity - * @return the next stage of the definition - */ - WithSystemAssignedIdentityBasedAccessOrCreate withSystemAssignedIdentityBasedAccessToCurrentResourceGroup( - BuiltInRole role); - - /** - * Specifies that virtual machine scale set's system assigned (local) identity should have the access - * (described by the role definition) on an ARM resource identified by the resource ID. Applications running - * on the scale set VM instance will have the same permission (role) on the ARM resource. - * - * @param resourceId scope of the access represented in ARM resource ID format - * @param roleDefinitionId access role definition to assigned to the scale set local identity - * @return the next stage of the definition - */ - WithSystemAssignedIdentityBasedAccessOrCreate withSystemAssignedIdentityBasedAccessTo( - String resourceId, String roleDefinitionId); - - /** - * Specifies that virtual machine scale set's system assigned (local) identity should have the access - * (described by the role definition) on the resource group that virtual machine resides. Applications - * running on the scale set VM instance will have the same permission (role) on the resource group. - * - * @param roleDefinitionId access role definition to assigned to the scale set local identity - * @return the next stage of the definition - */ - WithSystemAssignedIdentityBasedAccessOrCreate withSystemAssignedIdentityBasedAccessToCurrentResourceGroup( - String roleDefinitionId); - } - - /** - * The stage of the virtual machine scale set definition allowing to specify User Assigned (External) Managed - * Service Identities. - */ - interface WithUserAssignedManagedServiceIdentity { - /** - * Specifies the definition of a not-yet-created user assigned identity to be associated with the virtual - * machine scale set. - * - * @param creatableIdentity a creatable identity definition - * @return the next stage of the virtual machine scale set definition - */ - WithCreate withNewUserAssignedManagedServiceIdentity(Creatable creatableIdentity); - - /** - * Specifies an existing user assigned identity to be associated with the virtual machine scale set. - * - * @param identity the identity - * @return the next stage of the virtual machine scale set definition - */ - WithCreate withExistingUserAssignedManagedServiceIdentity(Identity identity); - } - - /** The stage of the virtual machine scale set definition allowing to enable boot diagnostics. */ - interface WithBootDiagnostics { - /** - * Specifies that boot diagnostics needs to be enabled in the virtual machine. - * Managed storage account is used. - * - * @return the next stage of the definition - */ - WithCreate withBootDiagnosticsOnManagedStorageAccount(); - - /** - * Specifies that boot diagnostics needs to be enabled in the virtual machine scale set. - * - * @return the next stage of the definition - */ - WithCreate withBootDiagnostics(); - - /** - * Specifies that boot diagnostics needs to be enabled in the virtual machine scale set. - * - * @param creatable the storage account to be created and used for store the boot diagnostics - * @return the next stage of the definition - */ - WithCreate withBootDiagnostics(Creatable creatable); - - /** - * Specifies that boot diagnostics needs to be enabled in the virtual machine scale set. - * - * @param storageAccount an existing storage account to be uses to store the boot diagnostics - * @return the next stage of the definition - */ - WithCreate withBootDiagnostics(StorageAccount storageAccount); - - /** - * Specifies that boot diagnostics needs to be enabled in the virtual machine scale set. - * - * @param storageAccountBlobEndpointUri a storage account blob endpoint to store the boot diagnostics - * @return the next stage of the definition - */ - WithCreate withBootDiagnostics(String storageAccountBlobEndpointUri); - } - - /** The stage of the virtual machine definition allowing to specify billing profile. */ - interface WithBillingProfile { - - /** - * Set the billing related details of the low priority virtual machines in the scale set. This price is in - * US Dollars. - * - * @param maxPrice the maxPrice value to set - * @return the next stage of the definition - */ - WithCreate withMaxPrice(Double maxPrice); - } - - /** - * The stage of the virtual machine scale set definition allowing to specify priority for vms in the scale-set. - */ - interface WithVMPriority { - /** - * Specifies the priority of the virtual machines in the scale set. - * - * @param priority the priority - * @return the next stage of the definition - */ - WithCreate withVirtualMachinePriority(VirtualMachinePriorityTypes priority); - - /** - * Specify that virtual machines in the scale set should be low priority VMs. - * - * @return the next stage of the definition - */ - WithCreate withLowPriorityVirtualMachine(); - - /** - * Specify that virtual machines in the scale set should be low priority VMs with provided eviction policy. - * - * @param policy eviction policy for the virtual machines in the scale set. - * @return the next stage of the definition - */ - WithCreate withLowPriorityVirtualMachine(VirtualMachineEvictionPolicyTypes policy); - - /** - * Specify that virtual machines in the scale set should be spot priority VMs. - * - * @return the next stage of the definition - */ - WithCreate withSpotPriorityVirtualMachine(); - - /** - * Specify that virtual machines in the scale set should be spot priority VMs with provided eviction policy. - * - * @param policy eviction policy for the virtual machines in the scale set. - * @return the next stage of the definition - */ - WithCreate withSpotPriorityVirtualMachine(VirtualMachineEvictionPolicyTypes policy); - } - - /** The stage of the virtual machine scale set definition allowing to enable public ip for vm instances. */ - interface WithVirtualMachinePublicIp { - /** - * Specify that virtual machines in the scale set should have public ip address. - * - * @return the next stage of the definition - */ - WithCreate withVirtualMachinePublicIp(); - - /** - * Specify that virtual machines in the scale set should have public ip address. - * - * @param leafDomainLabel the domain name label - * @return the next stage of the definition - */ - WithCreate withVirtualMachinePublicIp(String leafDomainLabel); - - /** - * Specify that virtual machines in the scale set should have public ip address. - * - * @param ipConfig the public ip address configuration - * @return the next stage of the definition - */ - WithCreate withVirtualMachinePublicIp(VirtualMachineScaleSetPublicIpAddressConfiguration ipConfig); - } - - /** The stage of the virtual machine scale set definition allowing to configure accelerated networking. */ - interface WithAcceleratedNetworking { - /** - * Specify that accelerated networking should be enabled for the virtual machine scale set. - * - * @return the next stage of the definition - */ - WithCreate withAcceleratedNetworking(); - - /** - * Specify that accelerated networking should be disabled for the virtual machine scale set. - * - * @return the next stage of the definition - */ - WithCreate withoutAcceleratedNetworking(); - } - - /** The stage of the virtual machine scale set definition allowing to configure ip forwarding. */ - interface WithIpForwarding { - /** - * Specify that ip forwarding should be enabled for the virtual machine scale set. - * - * @return the next stage of the definition - */ - WithCreate withIpForwarding(); - - /** - * Specify that ip forwarding should be disabled for the virtual machine scale set. - * - * @return the next stage of the definition - */ - WithCreate withoutIpForwarding(); - } - - /** The stage of the virtual machine scale set definition allowing to configure network security group. */ - interface WithNetworkSecurityGroup { - /** - * Specifies the network security group for the virtual machine scale set. - * - * @param networkSecurityGroup the network security group to associate - * @return the next stage of the definition - */ - WithCreate withExistingNetworkSecurityGroup(NetworkSecurityGroup networkSecurityGroup); - - /** - * Specifies the network security group for the virtual machine scale set. - * - * @param networkSecurityGroupId the network security group to associate - * @return the next stage of the definition - */ - WithCreate withExistingNetworkSecurityGroupId(String networkSecurityGroupId); - } - - /** The stage of the virtual machine scale set definition allowing to configure single placement group. */ - interface WithSinglePlacementGroup { - /** - * Specify that single placement group should be enabled for the virtual machine scale set. - * - * @return the next stage of the definition - */ - WithCreate withSinglePlacementGroup(); - - /** - * Specify that single placement group should be disabled for the virtual machine scale set. - * - * @return the next stage of the definition - */ - WithCreate withoutSinglePlacementGroup(); - } - - /** The stage of the virtual machine scale set definition allowing to configure application gateway. */ - interface WithApplicationGateway { - /** - * Specify that an application gateway backend pool should be associated with virtual machine scale set. - * - * @param backendPoolId an existing backend pool id of the gateway - * @return the next stage of the definition - */ - WithCreate withExistingApplicationGatewayBackendPool(String backendPoolId); - } - - /** The stage of the virtual machine scale set definition allowing to configure application security group. */ - interface WithApplicationSecurityGroup { - /** - * Specifies that provided application security group should be associated with the virtual machine scale - * set. - * - * @param applicationSecurityGroup the application security group - * @return the next stage of the definition - */ - WithCreate withExistingApplicationSecurityGroup(ApplicationSecurityGroup applicationSecurityGroup); - - /** - * Specifies that provided application security group should be associated with the virtual machine scale - * set. - * - * @param applicationSecurityGroupId the application security group id - * @return the next stage of the definition - */ - WithCreate withExistingApplicationSecurityGroupId(String applicationSecurityGroupId); - } - - /** - * The stage of a virtual machine scale set definition containing all the required inputs for the resource to be - * created, but also allowing for any other optional settings to be specified. - */ - interface WithCreate - extends Creatable, - DefinitionStages.WithOSDiskSettings, - DefinitionStages.WithComputerNamePrefix, - DefinitionStages.WithCapacity, - DefinitionStages.WithUpgradePolicy, - DefinitionStages.WithOverProvision, - DefinitionStages.WithStorageAccount, - DefinitionStages.WithCustomData, - DefinitionStages.WithExtension, - DefinitionStages.WithSystemAssignedManagedServiceIdentity, - DefinitionStages.WithUserAssignedManagedServiceIdentity, - DefinitionStages.WithBootDiagnostics, - DefinitionStages.WithBillingProfile, - DefinitionStages.WithVMPriority, - DefinitionStages.WithVirtualMachinePublicIp, - DefinitionStages.WithAcceleratedNetworking, - DefinitionStages.WithIpForwarding, - DefinitionStages.WithNetworkSecurityGroup, - DefinitionStages.WithSinglePlacementGroup, - DefinitionStages.WithApplicationGateway, - DefinitionStages.WithApplicationSecurityGroup, - DefinitionStages.WithSecrets, - Resource.DefinitionWithTags { - } - } - - /** Grouping of virtual machine scale set update stages. */ - interface UpdateStages { - /** - * The stage of a virtual machine scale set update allowing to specify load balancers for the primary network - * interface of the scale set virtual machines. - */ - interface WithPrimaryLoadBalancer extends WithPrimaryInternalLoadBalancer { - /** - * Specifies the load balancer to be used as the Internet-facing load balancer for the virtual machines in - * the scale set. - * - *

    This will replace the current Internet-facing load balancer associated with the virtual machines in - * the scale set (if any). By default all the backend and inbound NAT pool of the load balancer will be - * associated with the primary network interface of the virtual machines unless a subset of them is selected - * in the next stages - * - * @param loadBalancer the primary Internet-facing load balancer - * @return the next stage of the update - */ - WithPrimaryInternetFacingLoadBalancerBackendOrNatPool withExistingPrimaryInternetFacingLoadBalancer( - LoadBalancer loadBalancer); - } - - /** - * The stage of a virtual machine scale set update allowing to associate a backend pool and/or inbound NAT pool - * of the selected Internet-facing load balancer with the primary network interface of the virtual machines in - * the scale set. - */ - interface WithPrimaryInternetFacingLoadBalancerBackendOrNatPool - extends WithPrimaryInternetFacingLoadBalancerNatPool { - /** - * Associates the specified Internet-facing load balancer backends with the primary network interface of the - * virtual machines in the scale set. - * - * @param backendNames the backend names - * @return the next stage of the update - */ - WithPrimaryInternetFacingLoadBalancerNatPool withPrimaryInternetFacingLoadBalancerBackends( - String... backendNames); - } - - /** - * The stage of a virtual machine scale set update allowing to associate an inbound NAT pool of the selected - * Internet-facing load balancer with the primary network interface of the virtual machines in the scale set. - */ - interface WithPrimaryInternetFacingLoadBalancerNatPool extends WithPrimaryInternalLoadBalancer { - /** - * Associates inbound NAT pools of the selected Internet-facing load balancer with the primary network - * interface of the virtual machines in the scale set. - * - * @param natPoolNames the names of existing inbound NAT pools on the selected load balancer - * @return the next stage of the update - */ - WithPrimaryInternalLoadBalancer withPrimaryInternetFacingLoadBalancerInboundNatPools( - String... natPoolNames); - } - - /** - * The stage of a virtual machine scale set update allowing to specify an internal load balancer for the primary - * network interface of the scale set virtual machines. - */ - interface WithPrimaryInternalLoadBalancer extends WithApply { - /** - * Specifies the load balancer to be used as the internal load balancer for the virtual machines in the - * scale set. - * - *

    This will replace the current internal load balancer associated with the virtual machines in the scale - * set (if any). By default all the backends and inbound NAT pools of the load balancer will be associated - * with the primary network interface of the virtual machines in the scale set unless subset of them is - * selected in the next stages. - * - * @param loadBalancer the primary Internet-facing load balancer - * @return the next stage of the update - */ - WithPrimaryInternalLoadBalancerBackendOrNatPool withExistingPrimaryInternalLoadBalancer( - LoadBalancer loadBalancer); - } - - /** - * The stage of a virtual machine scale set update allowing to associate backend pools and/or inbound NAT pools - * of the selected internal load balancer with the primary network interface of the scale set virtual machines. - */ - interface WithPrimaryInternalLoadBalancerBackendOrNatPool extends WithPrimaryInternalLoadBalancerNatPool { - /** - * Associates the specified internal load balancer backends with the primary network interface of the - * virtual machines in the scale set. - * - * @param backendNames the names of existing backends on the selected load balancer - * @return the next stage of the update - */ - WithPrimaryInternalLoadBalancerNatPool withPrimaryInternalLoadBalancerBackends(String... backendNames); - } - - /** - * The stage of a virtual machine scale set update allowing to associate inbound NAT pools of the selected - * internal load balancer with the primary network interface of the virtual machines in the scale set. - */ - interface WithPrimaryInternalLoadBalancerNatPool extends WithApply { - /** - * Associates the specified internal load balancer inbound NAT pools with the the primary network interface - * of the virtual machines in the scale set. - * - * @param natPoolNames the names of existing inbound NAT pools in the selected load balancer - * @return the next stage of the update - */ - WithApply withPrimaryInternalLoadBalancerInboundNatPools(String... natPoolNames); - } - - /** - * The stage of a virtual machine scale set update allowing to set specifies additional capabilities enabled or - * disabled on the Virtual Machines in the Virtual Machine Scale Set. - */ - interface WithAdditionalCapabilities { - /** - * Set specifies additional capabilities enabled or disabled on the Virtual Machines in the Virtual Machine - * Scale Set. For instance: whether the Virtual Machines have the capability to support attaching managed - * data disks with UltraSSD_LRS storage account type. - * - * @param additionalCapabilities the additionalCapabilities value to set - * @return the next stage of the definition. - */ - WithApply withAdditionalCapabilities(AdditionalCapabilities additionalCapabilities); - } - - /** - * The stage of a virtual machine scale set update allowing to change the SKU for the virtual machines in the - * scale set. - */ - interface WithSku { - /** - * Specifies the SKU for the virtual machines in the scale set. - * - * @param skuType the SKU type - * @return the next stage of the update - */ - WithApply withSku(VirtualMachineScaleSetSkuTypes skuType); - - /** - * Specifies the SKU for the virtual machines in the scale set. - * - * @param sku a SKU from the list of available sizes for the virtual machines in this scale set - * @return the next stage of the update - */ - WithApply withSku(VirtualMachineScaleSetSku sku); - } - - /** - * The stage of a virtual machine scale set definition allowing to specify the number of virtual machines in the - * scale set. - */ - interface WithCapacity { - /** - * Specifies the new number of virtual machines in the scale set. - * - * @param capacity the virtual machine capacity of the scale set - * @return the next stage of the update - */ - WithApply withCapacity(long capacity); - } - - /** The stage of the virtual machine scale set definition allowing to specify the custom data. */ - interface WithCustomData { - /** - * Specifies the custom data for the virtual machine scale set. - * - * @param base64EncodedCustomData the base64 encoded custom data - * @return the next stage in the definition - */ - WithApply withCustomData(String base64EncodedCustomData); - } - - /** The stage of the virtual machine definition allowing to specify extensions. */ - interface WithSecrets { - /** - * The stage of a virtual machine scale set definition allowing to update secrets from virtual machines in - * the scale set. - * - * @param secrets the list of secrets - * @return the next stage of update - */ - WithApply withSecrets(List secrets); - - /** - * The stage of a virtual machine scale set definition allowing to remove secrets from virtual machines in - * the scale set. - * - * @return the next stage of update - */ - WithApply withoutSecrets(); - } - - /** The stage of the virtual machine definition allowing to specify extensions. */ - interface WithExtension { - /** - * Begins the definition of an extension reference to be attached to the virtual machines in the scale set. - * - * @param name the reference name for an extension - * @return the first stage of the extension reference definition - */ - VirtualMachineScaleSetExtension.UpdateDefinitionStages.Blank defineNewExtension(String name); - - /** - * Begins the description of an update of an existing extension assigned to the virtual machines in the - * scale set. - * - * @param name the reference name for the extension - * @return the first stage of the extension reference update - */ - VirtualMachineScaleSetExtension.Update updateExtension(String name); - - /** - * Removes the extension with the specified name from the virtual machines in the scale set. - * - * @param name the reference name of the extension to be removed/uninstalled - * @return the next stage of the update - */ - WithApply withoutExtension(String name); - } - - /** - * The stage of a virtual machine scale set update allowing to remove the public and internal load balancer from - * the primary network interface configuration. - */ - interface WithoutPrimaryLoadBalancer { - /** - * Removes the association between the Internet-facing load balancer and the primary network interface - * configuration. - * - *

    This removes the association between primary network interface configuration and all the backends and - * inbound NAT pools in the load balancer. - * - * @return the next stage of the update - */ - WithApply withoutPrimaryInternetFacingLoadBalancer(); - - /** - * Removes the association between the internal load balancer and the primary network interface - * configuration. - * - *

    This removes the association between primary network interface configuration and all the backends and - * inbound NAT pools in the load balancer. - * - * @return the next stage of the update - */ - WithApply withoutPrimaryInternalLoadBalancer(); - } - - /** - * The stage of a virtual machine scale set update allowing to remove the association between the primary - * network interface configuration and a backend of a load balancer. - */ - interface WithoutPrimaryLoadBalancerBackend { - /** - * Removes the associations between the primary network interface configuration and the specfied backends of - * the Internet-facing load balancer. - * - * @param backendNames existing backend names - * @return the next stage of the update - */ - WithApply withoutPrimaryInternetFacingLoadBalancerBackends(String... backendNames); - - /** - * Removes the associations between the primary network interface configuration and the specified backends - * of the internal load balancer. - * - * @param backendNames existing backend names - * @return the next stage of the update - */ - WithApply withoutPrimaryInternalLoadBalancerBackends(String... backendNames); - } - - /** - * A stage of the virtual machine scale set update allowing to remove the associations between the primary - * network interface configuration and the specified inbound NAT pools of the load balancer. - */ - interface WithoutPrimaryLoadBalancerNatPool { - /** - * Removes the associations between the primary network interface configuration and the specified inbound - * NAT pools of an Internet-facing load balancer. - * - * @param natPoolNames the names of existing inbound NAT pools - * @return the next stage of the update - */ - WithApply withoutPrimaryInternetFacingLoadBalancerNatPools(String... natPoolNames); - - /** - * Removes the associations between the primary network interface configuration and the specified inbound - * NAT pools of the internal load balancer. - * - * @param natPoolNames the names of existing inbound NAT pools - * @return the next stage of the update - */ - WithApply withoutPrimaryInternalLoadBalancerNatPools(String... natPoolNames); - } - - /** - * The stage of the virtual machine scale set update allowing to enable System Assigned (Local) Managed Service - * Identity. - */ - interface WithSystemAssignedManagedServiceIdentity { - /** - * Specifies that System assigned (Local) Managed Service Identity needs to be enabled in the virtual - * machine scale set. - * - * @return the next stage of the update - */ - WithSystemAssignedIdentityBasedAccessOrApply withSystemAssignedManagedServiceIdentity(); - - /** - * Specifies that System assigned (Local) Managed Service Identity needs to be disabled in the virtual - * machine scale set. - * - * @return the next stage of the update - */ - WithSystemAssignedIdentityBasedAccessOrApply withoutSystemAssignedManagedServiceIdentity(); - } - - /** - * The stage of the System Assigned (Local) Managed Service Identity enabled virtual machine scale set allowing - * to set access for the identity. - */ - interface WithSystemAssignedIdentityBasedAccessOrApply extends WithApply { - /** - * Specifies that virtual machine's system assigned (local) identity should have the given access (described - * by the role) on an ARM resource identified by the resource ID. Applications running on the scale set VM - * instance will have the same permission (role) on the ARM resource. - * - * @param resourceId the ARM identifier of the resource - * @param role access role to assigned to the scale set local identity - * @return the next stage of the update - */ - WithSystemAssignedIdentityBasedAccessOrApply withSystemAssignedIdentityBasedAccessTo( - String resourceId, BuiltInRole role); - - /** - * Specifies that virtual machine scale set's system assigned (local) identity should have the given access - * (described by the role) on the resource group that virtual machine resides. Applications running on the - * scale set VM instance will have the same permission (role) on the resource group. - * - * @param role access role to assigned to the scale set local identity - * @return the next stage of the update - */ - WithSystemAssignedIdentityBasedAccessOrApply withSystemAssignedIdentityBasedAccessToCurrentResourceGroup( - BuiltInRole role); - - /** - * Specifies that virtual machine scale set 's system assigned (local) identity should have the access - * (described by the role definition) on an ARM resource identified by the resource ID. Applications running - * on the scale set VM instance will have the same permission (role) on the ARM resource. - * - * @param resourceId scope of the access represented in ARM resource ID format - * @param roleDefinitionId access role definition to assigned to the scale set local identity - * @return the next stage of the update - */ - WithSystemAssignedIdentityBasedAccessOrApply withSystemAssignedIdentityBasedAccessTo( - String resourceId, String roleDefinitionId); - - /** - * Specifies that virtual machine scale set's system assigned (local) identity should have the access - * (described by the role definition) on the resource group that virtual machine resides. Applications - * running on the scale set VM instance will have the same permission (role) on the resource group. - * - * @param roleDefinitionId access role definition to assigned to the scale set local identity - * @return the next stage of the update - */ - WithSystemAssignedIdentityBasedAccessOrApply withSystemAssignedIdentityBasedAccessToCurrentResourceGroup( - String roleDefinitionId); - } - - /** - * The stage of the virtual machine update allowing to add or remove User Assigned (External) Managed Service - * Identities. - */ - interface WithUserAssignedManagedServiceIdentity { - /** - * Specifies the definition of a not-yet-created user assigned identity to be associated with the virtual - * machine. - * - * @param creatableIdentity a creatable identity definition - * @return the next stage of the virtual machine scale set update - */ - WithApply withNewUserAssignedManagedServiceIdentity(Creatable creatableIdentity); - - /** - * Specifies an existing user assigned identity to be associated with the virtual machine. - * - * @param identity the identity - * @return the next stage of the virtual machine scale set update - */ - WithApply withExistingUserAssignedManagedServiceIdentity(Identity identity); - - /** - * Specifies that an user assigned identity associated with the virtual machine should be removed. - * - * @param identityId ARM resource id of the identity - * @return the next stage of the virtual machine scale set update - */ - WithApply withoutUserAssignedManagedServiceIdentity(String identityId); - } - - /** The stage of the virtual machine scale set definition allowing to enable boot diagnostics. */ - interface WithBootDiagnostics { - /** - * Specifies that boot diagnostics needs to be enabled in the virtual machine. - * Managed storage account is used. - * - * @return the next stage of the update - */ - Update withBootDiagnosticsOnManagedStorageAccount(); - - /** - * Specifies that boot diagnostics needs to be enabled in the virtual machine scale set. - * - * @return the next stage of the update - */ - Update withBootDiagnostics(); - - /** - * Specifies that boot diagnostics needs to be enabled in the virtual machine scale set. - * - * @param creatable the storage account to be created and used for store the boot diagnostics - * @return the next stage of the update - */ - Update withBootDiagnostics(Creatable creatable); - - /** - * Specifies that boot diagnostics needs to be enabled in the virtual machine scale set. - * - * @param storageAccount an existing storage account to be uses to store the boot diagnostics - * @return the next stage of the update - */ - Update withBootDiagnostics(StorageAccount storageAccount); - - /** - * Specifies that boot diagnostics needs to be enabled in the virtual machine scale set. - * - * @param storageAccountBlobEndpointUri a storage account blob endpoint to store the boot diagnostics - * @return the next stage of the update - */ - Update withBootDiagnostics(String storageAccountBlobEndpointUri); - - /** - * Specifies that boot diagnostics needs to be disabled in the virtual machine scale set. - * - * @return the next stage of the update - */ - Update withoutBootDiagnostics(); - } - - /** The stage of the virtual machine scale set update allowing to specify billing profile. */ - interface WithBillingProfile { - /** - * Set the billing related details of the low priority virtual machines in the scale set. - * - * @param maxPrice max price to set - * @return the next stage of update - */ - Update withMaxPrice(Double maxPrice); - } - - /** The stage of the virtual machine scale set definition allowing to specify unmanaged data disk. */ - interface WithUnmanagedDataDisk { - } - - /** The stage of a virtual machine scale set update allowing to specify managed data disks. */ - interface WithManagedDataDisk { - /** - * Specifies that a managed disk needs to be created implicitly with the given size. - * - * @param sizeInGB the size of the managed disk - * @return the next stage of virtual machine scale set update - */ - WithApply withNewDataDisk(int sizeInGB); - - /** - * Specifies that a managed disk needs to be created implicitly with the given settings. - * - * @param sizeInGB the size of the managed disk - * @param lun the disk LUN - * @param cachingType the caching type - * @return the next stage of virtual machine scale set update - */ - WithApply withNewDataDisk(int sizeInGB, int lun, CachingTypes cachingType); - - /** - * Specifies that a managed disk needs to be created implicitly with the given settings. - * - * @param sizeInGB the size of the managed disk - * @param lun the disk LUN - * @param cachingType the caching type - * @param storageAccountType the storage account type - * @return the next stage of virtual machine scale set update - */ - WithApply withNewDataDisk( - int sizeInGB, int lun, CachingTypes cachingType, StorageAccountTypes storageAccountType); - - /** - * Detaches managed data disk with the given LUN from the virtual machine scale set instances. - * - * @param lun the disk LUN - * @return the next stage of virtual machine scale set update - */ - WithApply withoutDataDisk(int lun); - - /** - * Updates the size of a managed data disk with the given LUN. - * - * @param lun the disk LUN - * @param newSizeInGB the new size of the disk - * @return the next stage of virtual machine scale set update - */ - // TODO: Broken by Azure REST API - // WithApply withDataDiskUpdated(int lun, int newSizeInGB); - - /** - * Updates the size and caching type of a managed data disk with the given LUN. - * - * @param lun the disk LUN - * @param newSizeInGB the new size of the disk - * @param cachingType the caching type - * @return the next stage of virtual machine scale set update - */ - // TODO: Broken by Azure REST API - // WithApply withDataDiskUpdated(int lun, int newSizeInGB, CachingTypes cachingType); - - /** - * Updates the size, caching type and storage account type of a managed data disk with the given LUN. - * - * @param lun the disk LUN - * @param newSizeInGB the new size of the disk - * @param cachingType the caching type - * @param storageAccountType the storage account type - * @return the next stage of virtual machine scale set update - */ - // TODO: Broken by Azure REST API - // WithApply withDataDiskUpdated(int lun, - // int newSizeInGB, - // CachingTypes cachingType, - // StorageAccountTypes storageAccountType); - } - - /** The stage of the virtual machine scale set update allowing to specify availability zone. */ - interface WithAvailabilityZone { - /** - * Specifies the availability zone for the virtual machine scale set. - * - * @param zoneId the zone identifier. - * @return the next stage of the update - */ - WithApply withAvailabilityZone(AvailabilityZoneId zoneId); - } - - /** The stage of the virtual machine scale set update allowing to enable public ip for vm instances. */ - interface WithVirtualMachinePublicIp { - /** - * Specify that virtual machines in the scale set should have public ip address. - * - * @return the next stage of the update - */ - WithApply withVirtualMachinePublicIp(); - - /** - * Specify that virtual machines in the scale set should have public ip address. - * - * @param leafDomainLabel the domain name label - * @return the next stage of the update - */ - WithApply withVirtualMachinePublicIp(String leafDomainLabel); - - /** - * Specify that virtual machines in the scale set should have public ip address. - * - * @param ipConfig the public ip address configuration - * @return the next stage of the update - */ - WithApply withVirtualMachinePublicIp(VirtualMachineScaleSetPublicIpAddressConfiguration ipConfig); - } - - /** The stage of the virtual machine scale set update allowing to configure accelerated networking. */ - interface WithAcceleratedNetworking { - /** - * Specify that accelerated networking should be enabled for the virtual machine scale set. - * - * @return the next stage of the update - */ - WithApply withAcceleratedNetworking(); - - /** - * Specify that accelerated networking should be disabled for the virtual machine scale set. - * - * @return the next stage of the update - */ - WithApply withoutAcceleratedNetworking(); - } - - /** The stage of the virtual machine scale set update allowing to configure ip forwarding. */ - interface WithIpForwarding { - /** - * Specify that ip forwarding should be enabled for the virtual machine scale set. - * - * @return the next stage of the update - */ - WithApply withIpForwarding(); - - /** - * Specify that ip forwarding should be disabled for the virtual machine scale set. - * - * @return the next stage of the update - */ - WithApply withoutIpForwarding(); - } - - /** The stage of the virtual machine scale set update allowing to configure network security group. */ - interface WithNetworkSecurityGroup { - /** - * Specifies the network security group for the virtual machine scale set. - * - * @param networkSecurityGroup the network security group to associate - * @return the next stage of the update - */ - WithApply withExistingNetworkSecurityGroup(NetworkSecurityGroup networkSecurityGroup); - - /** - * Specifies the network security group for the virtual machine scale set. - * - * @param networkSecurityGroupId the network security group to associate - * @return the next stage of the update - */ - WithApply withExistingNetworkSecurityGroupId(String networkSecurityGroupId); - - /** - * Specifies that network security group association should be removed if exists. - * - * @return the next stage of the update - */ - WithApply withoutNetworkSecurityGroup(); - } - - /** The stage of the virtual machine scale set update allowing to configure single placement group. */ - interface WithSinglePlacementGroup { - /** - * Specify that single placement group should be enabled for the virtual machine scale set. - * - * @return the next stage of the update - */ - WithApply withSinglePlacementGroup(); - - /** - * Specify that single placement group should be disabled for the virtual machine scale set. - * - * @return the next stage of the update - */ - WithApply withoutSinglePlacementGroup(); - } - - /** The stage of the virtual machine scale set update allowing to configure application gateway. */ - interface WithApplicationGateway { - /** - * Specify that an application gateway backend pool should be associated with virtual machine scale set. - * - * @param backendPoolId an existing backend pool id of the gateway - * @return the next stage of the update - */ - WithApply withExistingApplicationGatewayBackendPool(String backendPoolId); - - /** - * Specify an existing application gateway associated should be removed from the virtual machine scale set. - * - * @param backendPoolId an existing backend pool id of the gateway - * @return the next stage of the update - */ - WithApply withoutApplicationGatewayBackendPool(String backendPoolId); - } - - /** The stage of the virtual machine scale set update allowing to configure application security group. */ - interface WithApplicationSecurityGroup { - /** - * Specifies that provided application security group should be associated with the virtual machine scale - * set. - * - * @param applicationSecurityGroup the application security group - * @return the next stage of the update - */ - WithApply withExistingApplicationSecurityGroup(ApplicationSecurityGroup applicationSecurityGroup); - - /** - * Specifies that provided application security group should be associated with the virtual machine scale - * set. - * - * @param applicationSecurityGroupId the application security group id - * @return the next stage of the update - */ - WithApply withExistingApplicationSecurityGroupId(String applicationSecurityGroupId); - - /** - * Specifies that provided application security group should be removed from the virtual machine scale set. - * - * @param applicationSecurityGroupId the application security group id - * @return the next stage of the update - */ - WithApply withoutApplicationSecurityGroup(String applicationSecurityGroupId); - } - - /** The stage of a virtual machine scale set update containing inputs for the resource to be updated. */ - interface WithApply - extends Appliable, - Resource.UpdateWithTags, - UpdateStages.WithManagedDataDisk, - UpdateStages.WithUnmanagedDataDisk, - UpdateStages.WithSku, - UpdateStages.WithAdditionalCapabilities, - UpdateStages.WithCapacity, - UpdateStages.WithCustomData, - UpdateStages.WithSecrets, - UpdateStages.WithExtension, - UpdateStages.WithoutPrimaryLoadBalancer, - UpdateStages.WithoutPrimaryLoadBalancerBackend, - UpdateStages.WithoutPrimaryLoadBalancerNatPool, - UpdateStages.WithSystemAssignedManagedServiceIdentity, - UpdateStages.WithUserAssignedManagedServiceIdentity, - UpdateStages.WithBootDiagnostics, - UpdateStages.WithBillingProfile, - UpdateStages.WithAvailabilityZone, - UpdateStages.WithVirtualMachinePublicIp, - UpdateStages.WithAcceleratedNetworking, - UpdateStages.WithIpForwarding, - UpdateStages.WithNetworkSecurityGroup, - UpdateStages.WithSinglePlacementGroup, - UpdateStages.WithApplicationGateway, - UpdateStages.WithApplicationSecurityGroup { - } - } - - /** The entirety of the virtual machine scale set update. */ - interface Update - extends UpdateStages.WithPrimaryLoadBalancer, - UpdateStages.WithPrimaryInternetFacingLoadBalancerBackendOrNatPool, - UpdateStages.WithPrimaryInternalLoadBalancerBackendOrNatPool { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetDataDisk.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetDataDisk.java deleted file mode 100644 index e1c1cfc1cf3b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetDataDisk.java +++ /dev/null @@ -1,296 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describes a virtual machine scale set data disk. */ -@Fluent -public final class VirtualMachineScaleSetDataDisk { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetDataDisk.class); - - /* - * The disk name. - */ - @JsonProperty(value = "name") - private String name; - - /* - * Specifies the logical unit number of the data disk. This value is used - * to identify data disks within the VM and therefore must be unique for - * each data disk attached to a VM. - */ - @JsonProperty(value = "lun", required = true) - private int lun; - - /* - * Specifies the caching requirements.

    Possible values are: - *

    **None**

    **ReadOnly**

    **ReadWrite**

    - * Default: **None for Standard storage. ReadOnly for Premium storage** - */ - @JsonProperty(value = "caching") - private CachingTypes caching; - - /* - * Specifies whether writeAccelerator should be enabled or disabled on the - * disk. - */ - @JsonProperty(value = "writeAcceleratorEnabled") - private Boolean writeAcceleratorEnabled; - - /* - * The create option. - */ - @JsonProperty(value = "createOption", required = true) - private DiskCreateOptionTypes createOption; - - /* - * Specifies the size of an empty data disk in gigabytes. This element can - * be used to overwrite the size of the disk in a virtual machine image. - *

    This value cannot be larger than 1023 GB - */ - @JsonProperty(value = "diskSizeGB") - private Integer diskSizeGB; - - /* - * The managed disk parameters. - */ - @JsonProperty(value = "managedDisk") - private VirtualMachineScaleSetManagedDiskParameters managedDisk; - - /* - * Specifies the Read-Write IOPS for the managed disk. Should be used only - * when StorageAccountType is UltraSSD_LRS. If not specified, a default - * value would be assigned based on diskSizeGB. - */ - @JsonProperty(value = "diskIOPSReadWrite") - private Long diskIopsReadWrite; - - /* - * Specifies the bandwidth in MB per second for the managed disk. Should be - * used only when StorageAccountType is UltraSSD_LRS. If not specified, a - * default value would be assigned based on diskSizeGB. - */ - @JsonProperty(value = "diskMBpsReadWrite") - private Long diskMBpsReadWrite; - - /** - * Get the name property: The disk name. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The disk name. - * - * @param name the name value to set. - * @return the VirtualMachineScaleSetDataDisk object itself. - */ - public VirtualMachineScaleSetDataDisk withName(String name) { - this.name = name; - return this; - } - - /** - * Get the lun property: Specifies the logical unit number of the data disk. This value is used to identify data - * disks within the VM and therefore must be unique for each data disk attached to a VM. - * - * @return the lun value. - */ - public int lun() { - return this.lun; - } - - /** - * Set the lun property: Specifies the logical unit number of the data disk. This value is used to identify data - * disks within the VM and therefore must be unique for each data disk attached to a VM. - * - * @param lun the lun value to set. - * @return the VirtualMachineScaleSetDataDisk object itself. - */ - public VirtualMachineScaleSetDataDisk withLun(int lun) { - this.lun = lun; - return this; - } - - /** - * Get the caching property: Specifies the caching requirements. <br><br> Possible values are: - * <br><br> **None** <br><br> **ReadOnly** <br><br> **ReadWrite** - * <br><br> Default: **None for Standard storage. ReadOnly for Premium storage**. - * - * @return the caching value. - */ - public CachingTypes caching() { - return this.caching; - } - - /** - * Set the caching property: Specifies the caching requirements. <br><br> Possible values are: - * <br><br> **None** <br><br> **ReadOnly** <br><br> **ReadWrite** - * <br><br> Default: **None for Standard storage. ReadOnly for Premium storage**. - * - * @param caching the caching value to set. - * @return the VirtualMachineScaleSetDataDisk object itself. - */ - public VirtualMachineScaleSetDataDisk withCaching(CachingTypes caching) { - this.caching = caching; - return this; - } - - /** - * Get the writeAcceleratorEnabled property: Specifies whether writeAccelerator should be enabled or disabled on the - * disk. - * - * @return the writeAcceleratorEnabled value. - */ - public Boolean writeAcceleratorEnabled() { - return this.writeAcceleratorEnabled; - } - - /** - * Set the writeAcceleratorEnabled property: Specifies whether writeAccelerator should be enabled or disabled on the - * disk. - * - * @param writeAcceleratorEnabled the writeAcceleratorEnabled value to set. - * @return the VirtualMachineScaleSetDataDisk object itself. - */ - public VirtualMachineScaleSetDataDisk withWriteAcceleratorEnabled(Boolean writeAcceleratorEnabled) { - this.writeAcceleratorEnabled = writeAcceleratorEnabled; - return this; - } - - /** - * Get the createOption property: The create option. - * - * @return the createOption value. - */ - public DiskCreateOptionTypes createOption() { - return this.createOption; - } - - /** - * Set the createOption property: The create option. - * - * @param createOption the createOption value to set. - * @return the VirtualMachineScaleSetDataDisk object itself. - */ - public VirtualMachineScaleSetDataDisk withCreateOption(DiskCreateOptionTypes createOption) { - this.createOption = createOption; - return this; - } - - /** - * Get the diskSizeGB property: Specifies the size of an empty data disk in gigabytes. This element can be used to - * overwrite the size of the disk in a virtual machine image. <br><br> This value cannot be larger than - * 1023 GB. - * - * @return the diskSizeGB value. - */ - public Integer diskSizeGB() { - return this.diskSizeGB; - } - - /** - * Set the diskSizeGB property: Specifies the size of an empty data disk in gigabytes. This element can be used to - * overwrite the size of the disk in a virtual machine image. <br><br> This value cannot be larger than - * 1023 GB. - * - * @param diskSizeGB the diskSizeGB value to set. - * @return the VirtualMachineScaleSetDataDisk object itself. - */ - public VirtualMachineScaleSetDataDisk withDiskSizeGB(Integer diskSizeGB) { - this.diskSizeGB = diskSizeGB; - return this; - } - - /** - * Get the managedDisk property: The managed disk parameters. - * - * @return the managedDisk value. - */ - public VirtualMachineScaleSetManagedDiskParameters managedDisk() { - return this.managedDisk; - } - - /** - * Set the managedDisk property: The managed disk parameters. - * - * @param managedDisk the managedDisk value to set. - * @return the VirtualMachineScaleSetDataDisk object itself. - */ - public VirtualMachineScaleSetDataDisk withManagedDisk(VirtualMachineScaleSetManagedDiskParameters managedDisk) { - this.managedDisk = managedDisk; - return this; - } - - /** - * Get the diskIopsReadWrite property: Specifies the Read-Write IOPS for the managed disk. Should be used only when - * StorageAccountType is UltraSSD_LRS. If not specified, a default value would be assigned based on diskSizeGB. - * - * @return the diskIopsReadWrite value. - */ - public Long diskIopsReadWrite() { - return this.diskIopsReadWrite; - } - - /** - * Set the diskIopsReadWrite property: Specifies the Read-Write IOPS for the managed disk. Should be used only when - * StorageAccountType is UltraSSD_LRS. If not specified, a default value would be assigned based on diskSizeGB. - * - * @param diskIopsReadWrite the diskIopsReadWrite value to set. - * @return the VirtualMachineScaleSetDataDisk object itself. - */ - public VirtualMachineScaleSetDataDisk withDiskIopsReadWrite(Long diskIopsReadWrite) { - this.diskIopsReadWrite = diskIopsReadWrite; - return this; - } - - /** - * Get the diskMBpsReadWrite property: Specifies the bandwidth in MB per second for the managed disk. Should be used - * only when StorageAccountType is UltraSSD_LRS. If not specified, a default value would be assigned based on - * diskSizeGB. - * - * @return the diskMBpsReadWrite value. - */ - public Long diskMBpsReadWrite() { - return this.diskMBpsReadWrite; - } - - /** - * Set the diskMBpsReadWrite property: Specifies the bandwidth in MB per second for the managed disk. Should be used - * only when StorageAccountType is UltraSSD_LRS. If not specified, a default value would be assigned based on - * diskSizeGB. - * - * @param diskMBpsReadWrite the diskMBpsReadWrite value to set. - * @return the VirtualMachineScaleSetDataDisk object itself. - */ - public VirtualMachineScaleSetDataDisk withDiskMBpsReadWrite(Long diskMBpsReadWrite) { - this.diskMBpsReadWrite = diskMBpsReadWrite; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (createOption() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property createOption in model VirtualMachineScaleSetDataDisk")); - } - if (managedDisk() != null) { - managedDisk().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetExtension.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetExtension.java deleted file mode 100644 index cc39b30b9026..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetExtension.java +++ /dev/null @@ -1,444 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineScaleSetExtensionInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.ChildResource; -import com.azure.resourcemanager.resources.fluentcore.model.Attachable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.model.Settable; -import java.util.HashMap; -import java.util.Map; - -/** An immutable client-side representation of an extension associated with virtual machines in a scale set. */ -@Fluent -public interface VirtualMachineScaleSetExtension - extends HasInnerModel, ChildResource { - /** @return the publisher name of the virtual machine scale set extension image this extension is created from */ - String publisherName(); - - /** @return the type name of the virtual machine scale set extension image this extension is created from */ - String typeName(); - - /** @return the version name of the virtual machine scale set extension image this extension is created from */ - String versionName(); - - /** - * @return true if this extension is configured to upgrade automatically when a new minor version of the extension - * image that this extension based on is published - */ - boolean autoUpgradeMinorVersionEnabled(); - - /** @return the public settings of the virtual machine scale set extension as key value pairs */ - Map publicSettings(); - - /** @return the public settings of the virtual machine extension as a JSON string */ - String publicSettingsAsJsonString(); - - /** @return the provisioning state of this virtual machine scale set extension */ - String provisioningState(); - - /** - * The entirety of a virtual machine scale set extension definition as a part of a parent definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithImageOrPublisher, - DefinitionStages.WithPublisher, - DefinitionStages.WithType, - DefinitionStages.WithVersion, - DefinitionStages.WithAttach { - } - - /** - * Grouping of virtual machine scale set extension definition stages as a part of parent virtual machine scale set - * definition. - */ - interface DefinitionStages { - /** - * The first stage of a virtual machine scale set extension definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface Blank extends WithImageOrPublisher { - } - - /** - * The stage of a virtual machines scale set extension definition allowing to specify an extension image or - * specify name of the virtual machine scale set extension publisher. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithImageOrPublisher extends WithPublisher { - /** - * Specifies the virtual machine scale set extension image to use. - * - * @param image an extension image - * @return the next stage of the definition - */ - WithAttach withImage(VirtualMachineExtensionImage image); - } - - /** - * The stage of a virtual machine scale set extension definition allowing to specify the publisher of the - * extension image this extension is based on. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithPublisher { - /** - * Specifies the name of the publisher of the virtual machine scale set extension image. - * - * @param extensionImagePublisherName a publisher name - * @return the next stage of the definition - */ - WithType withPublisher(String extensionImagePublisherName); - } - - /** - * The stage of a virtual machine scale set extension definition allowing to specify the type of the virtual - * machine scale set extension image this extension is based on. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithType { - /** - * Specifies the type of the virtual machine scale set extension image. - * - * @param extensionImageTypeName the image type name - * @return the next stage of the definition - */ - WithVersion withType(String extensionImageTypeName); - } - - /** - * The stage of a virtual machine scale set extension definition allowing to specify the type of the virtual - * machine scale set extension version this extension is based on. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithVersion { - /** - * Specifies the version of the virtual machine scale set image extension. - * - * @param extensionImageVersionName the version name - * @return the next stage of the definition - */ - WithAttach withVersion(String extensionImageVersionName); - } - - /** - * The final stage of a virtual machine scale set extension definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithAttach - extends Attachable.InDefinition, WithAutoUpgradeMinorVersion, WithSettings { - } - - /** - * The stage of a virtual machine scale set extension definition allowing to enable or disable auto upgrade of - * the extension when when a new minor version of virtual machine scale set extension image gets published. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithAutoUpgradeMinorVersion { - /** - * Enables auto upgrading of the extension with minor versions. - * - * @return the next stage of the definition - */ - WithAttach withMinorVersionAutoUpgrade(); - - /** - * Disables auto upgrading the extension with minor versions. - * - * @return the next stage of the definition - */ - WithAttach withoutMinorVersionAutoUpgrade(); - } - - /** - * The stage of a virtual machine scale set extension definition allowing to specify the public and private - * settings. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithSettings { - /** - * Specifies a public settings entry. - * - * @param key the key of a public settings entry - * @param value the value of the public settings entry - * @return the next stage of the definition - */ - WithAttach withPublicSetting(String key, Object value); - - /** - * Specifies a private settings entry. - * - * @param key the key of a private settings entry - * @param value the value of the private settings entry - * @return the next stage of the definition - */ - WithAttach withProtectedSetting(String key, Object value); - - /** - * Specifies public settings. - * - * @param settings the public settings - * @return the next stage of the definition - */ - WithAttach withPublicSettings(HashMap settings); - - /** - * Specifies private settings. - * - * @param settings the private settings - * @return the next stage of the definition - */ - WithAttach withProtectedSettings(HashMap settings); - } - } - - /** - * Grouping of virtual machine scale set extension definition stages as part of parent virtual machine scale set - * update. - */ - interface UpdateDefinitionStages { - /** - * The first stage of a virtual machine scale set extension definition. - * - * @param the stage of the parent update to return to after attaching this definition - */ - interface Blank extends WithImageOrPublisher { - } - - /** - * The stage of a virtual machine scale set extension allowing to specify an extension image or the name of the - * virtual machine extension publisher. - * - * @param the stage of the parent update to return to after attaching this definition - */ - interface WithImageOrPublisher extends WithPublisher { - /** - * Specifies the virtual machine scale set extension image to use. - * - * @param image an extension image - * @return the next stage of the definition - */ - WithAttach withImage(VirtualMachineExtensionImage image); - } - - /** - * The stage of a virtual machine scale set extension definition allowing to specify the publisher of the - * virtual machine scale set extension image this extension is based on. - * - * @param the stage of the parent update to return to after attaching this definition - */ - interface WithPublisher { - /** - * Specifies the name of the virtual machine scale set extension image publisher. - * - * @param extensionImagePublisherName the publisher name - * @return the next stage of the definition - */ - WithType withPublisher(String extensionImagePublisherName); - } - - /** - * The stage of a virtual machine scale set extension definition allowing to specify the type of the virtual - * machine scale set extension image this extension is based on. - * - * @param the stage of the parent update to return to after attaching this definition - */ - interface WithType { - /** - * Specifies the type of the virtual machine scale set extension image. - * - * @param extensionImageTypeName an image type name - * @return the next stage of the definition - */ - WithVersion withType(String extensionImageTypeName); - } - - /** - * The stage of a virtual machine scale set extension definition allowing to specify the type of the virtual - * machine scale set extension version this extension is based on. - * - * @param the stage of the parent update to return to after attaching this definition - */ - interface WithVersion { - /** - * Specifies the version of the virtual machine scale set image extension. - * - * @param extensionImageVersionName a version name - * @return the next stage of the definition - */ - WithAttach withVersion(String extensionImageVersionName); - } - - /** - * The final stage of the virtual machine scale set extension definition. - * - * @param the stage of the parent update to return to after attaching this definition - */ - interface WithAttach - extends Attachable.InUpdate, WithAutoUpgradeMinorVersion, WithSettings { - } - - /** - * The stage of a virtual machine scale set extension definition allowing to enable or disable auto upgrade of - * the extension when when a new minor version of virtual machine scale set extension image gets published. - * - * @param the stage of the parent update to return to after attaching this definition - */ - interface WithAutoUpgradeMinorVersion { - /** - * Enables auto upgrading of the extension with minor versions. - * - * @return the next stage of the definition - */ - WithAttach withMinorVersionAutoUpgrade(); - - /** - * Disables auto upgrade of the extension with minor versions. - * - * @return the next stage of the definition - */ - WithAttach withoutMinorVersionAutoUpgrade(); - } - - /** - * The stage of a virtual machine scale set extension definition allowing to specify the public and private - * settings. - * - * @param the stage of the parent update to return to after attaching this definition - */ - interface WithSettings { - /** - * Specifies a public settings entry. - * - * @param key the key of a public settings entry - * @param value the value of the public settings entry - * @return the next stage of the definition - */ - WithAttach withPublicSetting(String key, Object value); - - /** - * Specifies a private settings entry. - * - * @param key the key of a private settings entry - * @param value the value of the private settings entry - * @return the next stage of the definition - */ - WithAttach withProtectedSetting(String key, Object value); - - /** - * Specifies public settings. - * - * @param settings the public settings - * @return the next stage of the definition - */ - WithAttach withPublicSettings(HashMap settings); - - /** - * Specifies private settings. - * - * @param settings the private settings - * @return the next stage of the definition - */ - WithAttach withProtectedSettings(HashMap settings); - } - } - - /** - * The entirety of a virtual machine scale set extension definition as a part of parent update. - * - * @param the stage of the parent update to return to after attaching this definition - */ - interface UpdateDefinition - extends UpdateDefinitionStages.Blank, - UpdateDefinitionStages.WithImageOrPublisher, - UpdateDefinitionStages.WithPublisher, - UpdateDefinitionStages.WithType, - UpdateDefinitionStages.WithVersion, - UpdateDefinitionStages.WithAttach { - } - - /** Grouping of virtual machine extension update stages. */ - interface UpdateStages { - /** - * The stage of a virtual machine scale set extension update allowing to enable or disable auto upgrade of the - * extension when when a new minor version of virtual machine scale set extension image gets published. - */ - interface WithAutoUpgradeMinorVersion { - /** - * Enables auto-upgrading of the extension with minor versions. - * - * @return the next stage of the update - */ - Update withMinorVersionAutoUpgrade(); - - /** - * Disables auto upgrading of the extension with minor versions. - * - * @return the next stage of the update - */ - Update withoutMinorVersionAutoUpgrade(); - } - - /** - * The stage of a virtual machine scale set extension update allowing to add or update public and private - * settings. - */ - interface WithSettings { - /** - * Specifies a public settings entry. - * - * @param key the key of a public settings entry - * @param value the value of the public settings entry - * @return the next stage of the update - */ - Update withPublicSetting(String key, Object value); - - /** - * Specifies a private settings entry. - * - * @param key the key of a private settings entry - * @param value the value of the private settings entry - * @return the next stage of the update - */ - Update withProtectedSetting(String key, Object value); - - /** - * Specifies public settings. - * - * @param settings the public settings - * @return the next stage of the update - */ - Update withPublicSettings(HashMap settings); - - /** - * Specifies private settings. - * - * @param settings the private settings - * @return the next stage of the update - */ - Update withProtectedSettings(HashMap settings); - } - } - - /** - * The entirety of virtual machine scale set extension update as a part of parent virtual machine scale set update. - */ - interface Update - extends Settable, - UpdateStages.WithAutoUpgradeMinorVersion, - UpdateStages.WithSettings { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetExtensionListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetExtensionListResult.java deleted file mode 100644 index 6ce3fba1ba6d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetExtensionListResult.java +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineScaleSetExtensionInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The List VM scale set extension operation response. */ -@Fluent -public final class VirtualMachineScaleSetExtensionListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetExtensionListResult.class); - - /* - * The list of VM scale set extensions. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * The uri to fetch the next page of VM scale set extensions. Call - * ListNext() with this to fetch the next page of VM scale set extensions. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: The list of VM scale set extensions. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The list of VM scale set extensions. - * - * @param value the value value to set. - * @return the VirtualMachineScaleSetExtensionListResult object itself. - */ - public VirtualMachineScaleSetExtensionListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The uri to fetch the next page of VM scale set extensions. Call ListNext() with this - * to fetch the next page of VM scale set extensions. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The uri to fetch the next page of VM scale set extensions. Call ListNext() with this - * to fetch the next page of VM scale set extensions. - * - * @param nextLink the nextLink value to set. - * @return the VirtualMachineScaleSetExtensionListResult object itself. - */ - public VirtualMachineScaleSetExtensionListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property value in model VirtualMachineScaleSetExtensionListResult")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetExtensionProfile.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetExtensionProfile.java deleted file mode 100644 index d24631c07c69..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetExtensionProfile.java +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineScaleSetExtensionInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Describes a virtual machine scale set extension profile. */ -@Fluent -public final class VirtualMachineScaleSetExtensionProfile { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetExtensionProfile.class); - - /* - * The virtual machine scale set child extension resources. - */ - @JsonProperty(value = "extensions") - private List extensions; - - /* - * Specifies the time alloted for all extensions to start. The time - * duration should be between 15 minutes and 120 minutes (inclusive) and - * should be specified in ISO 8601 format. The default value is 90 minutes - * (PT1H30M).

    Minimum api-version: 2020-06-01 - */ - @JsonProperty(value = "extensionsTimeBudget") - private String extensionsTimeBudget; - - /** - * Get the extensions property: The virtual machine scale set child extension resources. - * - * @return the extensions value. - */ - public List extensions() { - return this.extensions; - } - - /** - * Set the extensions property: The virtual machine scale set child extension resources. - * - * @param extensions the extensions value to set. - * @return the VirtualMachineScaleSetExtensionProfile object itself. - */ - public VirtualMachineScaleSetExtensionProfile withExtensions( - List extensions) { - this.extensions = extensions; - return this; - } - - /** - * Get the extensionsTimeBudget property: Specifies the time alloted for all extensions to start. The time duration - * should be between 15 minutes and 120 minutes (inclusive) and should be specified in ISO 8601 format. The default - * value is 90 minutes (PT1H30M). <br><br> Minimum api-version: 2020-06-01. - * - * @return the extensionsTimeBudget value. - */ - public String extensionsTimeBudget() { - return this.extensionsTimeBudget; - } - - /** - * Set the extensionsTimeBudget property: Specifies the time alloted for all extensions to start. The time duration - * should be between 15 minutes and 120 minutes (inclusive) and should be specified in ISO 8601 format. The default - * value is 90 minutes (PT1H30M). <br><br> Minimum api-version: 2020-06-01. - * - * @param extensionsTimeBudget the extensionsTimeBudget value to set. - * @return the VirtualMachineScaleSetExtensionProfile object itself. - */ - public VirtualMachineScaleSetExtensionProfile withExtensionsTimeBudget(String extensionsTimeBudget) { - this.extensionsTimeBudget = extensionsTimeBudget; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (extensions() != null) { - extensions().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetExtensionUpdate.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetExtensionUpdate.java deleted file mode 100644 index 5c5ac5f87ffc..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetExtensionUpdate.java +++ /dev/null @@ -1,304 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineScaleSetExtensionProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Describes a Virtual Machine Scale Set Extension. */ -@Fluent -public final class VirtualMachineScaleSetExtensionUpdate extends SubResourceReadOnly { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetExtensionUpdate.class); - - /* - * The name of the extension. - */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) - private String name; - - /* - * Resource type - */ - @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) - private String type; - - /* - * Describes the properties of a Virtual Machine Scale Set Extension. - */ - @JsonProperty(value = "properties") - private VirtualMachineScaleSetExtensionProperties innerProperties; - - /** - * Get the name property: The name of the extension. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the type property: Resource type. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Get the innerProperties property: Describes the properties of a Virtual Machine Scale Set Extension. - * - * @return the innerProperties value. - */ - private VirtualMachineScaleSetExtensionProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the forceUpdateTag property: If a value is provided and is different from the previous value, the extension - * handler will be forced to update even if the extension configuration has not changed. - * - * @return the forceUpdateTag value. - */ - public String forceUpdateTag() { - return this.innerProperties() == null ? null : this.innerProperties().forceUpdateTag(); - } - - /** - * Set the forceUpdateTag property: If a value is provided and is different from the previous value, the extension - * handler will be forced to update even if the extension configuration has not changed. - * - * @param forceUpdateTag the forceUpdateTag value to set. - * @return the VirtualMachineScaleSetExtensionUpdate object itself. - */ - public VirtualMachineScaleSetExtensionUpdate withForceUpdateTag(String forceUpdateTag) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetExtensionProperties(); - } - this.innerProperties().withForceUpdateTag(forceUpdateTag); - return this; - } - - /** - * Get the publisher property: The name of the extension handler publisher. - * - * @return the publisher value. - */ - public String publisher() { - return this.innerProperties() == null ? null : this.innerProperties().publisher(); - } - - /** - * Set the publisher property: The name of the extension handler publisher. - * - * @param publisher the publisher value to set. - * @return the VirtualMachineScaleSetExtensionUpdate object itself. - */ - public VirtualMachineScaleSetExtensionUpdate withPublisher(String publisher) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetExtensionProperties(); - } - this.innerProperties().withPublisher(publisher); - return this; - } - - /** - * Get the type property: Specifies the type of the extension; an example is "CustomScriptExtension". - * - * @return the type value. - */ - public String typePropertiesType() { - return this.innerProperties() == null ? null : this.innerProperties().type(); - } - - /** - * Set the type property: Specifies the type of the extension; an example is "CustomScriptExtension". - * - * @param type the type value to set. - * @return the VirtualMachineScaleSetExtensionUpdate object itself. - */ - public VirtualMachineScaleSetExtensionUpdate withTypePropertiesType(String type) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetExtensionProperties(); - } - this.innerProperties().withType(type); - return this; - } - - /** - * Get the typeHandlerVersion property: Specifies the version of the script handler. - * - * @return the typeHandlerVersion value. - */ - public String typeHandlerVersion() { - return this.innerProperties() == null ? null : this.innerProperties().typeHandlerVersion(); - } - - /** - * Set the typeHandlerVersion property: Specifies the version of the script handler. - * - * @param typeHandlerVersion the typeHandlerVersion value to set. - * @return the VirtualMachineScaleSetExtensionUpdate object itself. - */ - public VirtualMachineScaleSetExtensionUpdate withTypeHandlerVersion(String typeHandlerVersion) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetExtensionProperties(); - } - this.innerProperties().withTypeHandlerVersion(typeHandlerVersion); - return this; - } - - /** - * Get the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one - * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless - * redeployed, even with this property set to true. - * - * @return the autoUpgradeMinorVersion value. - */ - public Boolean autoUpgradeMinorVersion() { - return this.innerProperties() == null ? null : this.innerProperties().autoUpgradeMinorVersion(); - } - - /** - * Set the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one - * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless - * redeployed, even with this property set to true. - * - * @param autoUpgradeMinorVersion the autoUpgradeMinorVersion value to set. - * @return the VirtualMachineScaleSetExtensionUpdate object itself. - */ - public VirtualMachineScaleSetExtensionUpdate withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetExtensionProperties(); - } - this.innerProperties().withAutoUpgradeMinorVersion(autoUpgradeMinorVersion); - return this; - } - - /** - * Get the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the - * platform if there is a newer version of the extension available. - * - * @return the enableAutomaticUpgrade value. - */ - public Boolean enableAutomaticUpgrade() { - return this.innerProperties() == null ? null : this.innerProperties().enableAutomaticUpgrade(); - } - - /** - * Set the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the - * platform if there is a newer version of the extension available. - * - * @param enableAutomaticUpgrade the enableAutomaticUpgrade value to set. - * @return the VirtualMachineScaleSetExtensionUpdate object itself. - */ - public VirtualMachineScaleSetExtensionUpdate withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetExtensionProperties(); - } - this.innerProperties().withEnableAutomaticUpgrade(enableAutomaticUpgrade); - return this; - } - - /** - * Get the settings property: Json formatted public settings for the extension. - * - * @return the settings value. - */ - public Object settings() { - return this.innerProperties() == null ? null : this.innerProperties().settings(); - } - - /** - * Set the settings property: Json formatted public settings for the extension. - * - * @param settings the settings value to set. - * @return the VirtualMachineScaleSetExtensionUpdate object itself. - */ - public VirtualMachineScaleSetExtensionUpdate withSettings(Object settings) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetExtensionProperties(); - } - this.innerProperties().withSettings(settings); - return this; - } - - /** - * Get the protectedSettings property: The extension can contain either protectedSettings or - * protectedSettingsFromKeyVault or no protected settings at all. - * - * @return the protectedSettings value. - */ - public Object protectedSettings() { - return this.innerProperties() == null ? null : this.innerProperties().protectedSettings(); - } - - /** - * Set the protectedSettings property: The extension can contain either protectedSettings or - * protectedSettingsFromKeyVault or no protected settings at all. - * - * @param protectedSettings the protectedSettings value to set. - * @return the VirtualMachineScaleSetExtensionUpdate object itself. - */ - public VirtualMachineScaleSetExtensionUpdate withProtectedSettings(Object protectedSettings) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetExtensionProperties(); - } - this.innerProperties().withProtectedSettings(protectedSettings); - return this; - } - - /** - * Get the provisioningState property: The provisioning state, which only appears in the response. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the provisionAfterExtensions property: Collection of extension names after which this extension needs to be - * provisioned. - * - * @return the provisionAfterExtensions value. - */ - public List provisionAfterExtensions() { - return this.innerProperties() == null ? null : this.innerProperties().provisionAfterExtensions(); - } - - /** - * Set the provisionAfterExtensions property: Collection of extension names after which this extension needs to be - * provisioned. - * - * @param provisionAfterExtensions the provisionAfterExtensions value to set. - * @return the VirtualMachineScaleSetExtensionUpdate object itself. - */ - public VirtualMachineScaleSetExtensionUpdate withProvisionAfterExtensions(List provisionAfterExtensions) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetExtensionProperties(); - } - this.innerProperties().withProvisionAfterExtensions(provisionAfterExtensions); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetIdentity.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetIdentity.java deleted file mode 100644 index 96f2e8e0dbe9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetIdentity.java +++ /dev/null @@ -1,138 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** Identity for the virtual machine scale set. */ -@Fluent -public class VirtualMachineScaleSetIdentity { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetIdentity.class); - - /* - * The principal id of virtual machine scale set identity. This property - * will only be provided for a system assigned identity. - */ - @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) - private String principalId; - - /* - * The tenant id associated with the virtual machine scale set. This - * property will only be provided for a system assigned identity. - */ - @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) - private String tenantId; - - /* - * The type of identity used for the virtual machine scale set. The type - * 'SystemAssigned, UserAssigned' includes both an implicitly created - * identity and a set of user assigned identities. The type 'None' will - * remove any identities from the virtual machine scale set. - */ - @JsonProperty(value = "type") - private ResourceIdentityType type; - - /* - * The list of user identities associated with the virtual machine scale - * set. The user identity dictionary key references will be ARM resource - * ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - */ - @JsonProperty(value = "userAssignedIdentities") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map userAssignedIdentities; - - /** - * Get the principalId property: The principal id of virtual machine scale set identity. This property will only be - * provided for a system assigned identity. - * - * @return the principalId value. - */ - public String principalId() { - return this.principalId; - } - - /** - * Get the tenantId property: The tenant id associated with the virtual machine scale set. This property will only - * be provided for a system assigned identity. - * - * @return the tenantId value. - */ - public String tenantId() { - return this.tenantId; - } - - /** - * Get the type property: The type of identity used for the virtual machine scale set. The type 'SystemAssigned, - * UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' - * will remove any identities from the virtual machine scale set. - * - * @return the type value. - */ - public ResourceIdentityType type() { - return this.type; - } - - /** - * Set the type property: The type of identity used for the virtual machine scale set. The type 'SystemAssigned, - * UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' - * will remove any identities from the virtual machine scale set. - * - * @param type the type value to set. - * @return the VirtualMachineScaleSetIdentity object itself. - */ - public VirtualMachineScaleSetIdentity withType(ResourceIdentityType type) { - this.type = type; - return this; - } - - /** - * Get the userAssignedIdentities property: The list of user identities associated with the virtual machine scale - * set. The user identity dictionary key references will be ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - * - * @return the userAssignedIdentities value. - */ - public Map userAssignedIdentities() { - return this.userAssignedIdentities; - } - - /** - * Set the userAssignedIdentities property: The list of user identities associated with the virtual machine scale - * set. The user identity dictionary key references will be ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - * - * @param userAssignedIdentities the userAssignedIdentities value to set. - * @return the VirtualMachineScaleSetIdentity object itself. - */ - public VirtualMachineScaleSetIdentity withUserAssignedIdentities( - Map userAssignedIdentities) { - this.userAssignedIdentities = userAssignedIdentities; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (userAssignedIdentities() != null) { - userAssignedIdentities() - .values() - .forEach( - e -> { - if (e != null) { - e.validate(); - } - }); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetIdentityUserAssignedIdentities.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetIdentityUserAssignedIdentities.java deleted file mode 100644 index bc4a66e6d486..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetIdentityUserAssignedIdentities.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The VirtualMachineScaleSetIdentityUserAssignedIdentities model. */ -@Immutable -public final class VirtualMachineScaleSetIdentityUserAssignedIdentities { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetIdentityUserAssignedIdentities.class); - - /* - * The principal id of user assigned identity. - */ - @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) - private String principalId; - - /* - * The client id of user assigned identity. - */ - @JsonProperty(value = "clientId", access = JsonProperty.Access.WRITE_ONLY) - private String clientId; - - /** - * Get the principalId property: The principal id of user assigned identity. - * - * @return the principalId value. - */ - public String principalId() { - return this.principalId; - } - - /** - * Get the clientId property: The client id of user assigned identity. - * - * @return the clientId value. - */ - public String clientId() { - return this.clientId; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetInstanceViewStatusesSummary.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetInstanceViewStatusesSummary.java deleted file mode 100644 index 222919ebbf3d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetInstanceViewStatusesSummary.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Instance view statuses summary for virtual machines of a virtual machine scale set. */ -@Immutable -public final class VirtualMachineScaleSetInstanceViewStatusesSummary { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetInstanceViewStatusesSummary.class); - - /* - * The extensions information. - */ - @JsonProperty(value = "statusesSummary", access = JsonProperty.Access.WRITE_ONLY) - private List statusesSummary; - - /** - * Get the statusesSummary property: The extensions information. - * - * @return the statusesSummary value. - */ - public List statusesSummary() { - return this.statusesSummary; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (statusesSummary() != null) { - statusesSummary().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetIpConfiguration.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetIpConfiguration.java deleted file mode 100644 index 73d9a76e8201..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetIpConfiguration.java +++ /dev/null @@ -1,291 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineScaleSetIpConfigurationProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Describes a virtual machine scale set network profile's IP configuration. */ -@Fluent -public final class VirtualMachineScaleSetIpConfiguration extends SubResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetIpConfiguration.class); - - /* - * The IP configuration name. - */ - @JsonProperty(value = "name", required = true) - private String name; - - /* - * Describes a virtual machine scale set network profile's IP configuration - * properties. - */ - @JsonProperty(value = "properties") - private VirtualMachineScaleSetIpConfigurationProperties innerProperties; - - /** - * Get the name property: The IP configuration name. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The IP configuration name. - * - * @param name the name value to set. - * @return the VirtualMachineScaleSetIpConfiguration object itself. - */ - public VirtualMachineScaleSetIpConfiguration withName(String name) { - this.name = name; - return this; - } - - /** - * Get the innerProperties property: Describes a virtual machine scale set network profile's IP configuration - * properties. - * - * @return the innerProperties value. - */ - private VirtualMachineScaleSetIpConfigurationProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public VirtualMachineScaleSetIpConfiguration withId(String id) { - super.withId(id); - return this; - } - - /** - * Get the subnet property: Specifies the identifier of the subnet. - * - * @return the subnet value. - */ - public ApiEntityReference subnet() { - return this.innerProperties() == null ? null : this.innerProperties().subnet(); - } - - /** - * Set the subnet property: Specifies the identifier of the subnet. - * - * @param subnet the subnet value to set. - * @return the VirtualMachineScaleSetIpConfiguration object itself. - */ - public VirtualMachineScaleSetIpConfiguration withSubnet(ApiEntityReference subnet) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetIpConfigurationProperties(); - } - this.innerProperties().withSubnet(subnet); - return this; - } - - /** - * Get the primary property: Specifies the primary network interface in case the virtual machine has more than 1 - * network interface. - * - * @return the primary value. - */ - public Boolean primary() { - return this.innerProperties() == null ? null : this.innerProperties().primary(); - } - - /** - * Set the primary property: Specifies the primary network interface in case the virtual machine has more than 1 - * network interface. - * - * @param primary the primary value to set. - * @return the VirtualMachineScaleSetIpConfiguration object itself. - */ - public VirtualMachineScaleSetIpConfiguration withPrimary(Boolean primary) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetIpConfigurationProperties(); - } - this.innerProperties().withPrimary(primary); - return this; - } - - /** - * Get the publicIpAddressConfiguration property: The publicIPAddressConfiguration. - * - * @return the publicIpAddressConfiguration value. - */ - public VirtualMachineScaleSetPublicIpAddressConfiguration publicIpAddressConfiguration() { - return this.innerProperties() == null ? null : this.innerProperties().publicIpAddressConfiguration(); - } - - /** - * Set the publicIpAddressConfiguration property: The publicIPAddressConfiguration. - * - * @param publicIpAddressConfiguration the publicIpAddressConfiguration value to set. - * @return the VirtualMachineScaleSetIpConfiguration object itself. - */ - public VirtualMachineScaleSetIpConfiguration withPublicIpAddressConfiguration( - VirtualMachineScaleSetPublicIpAddressConfiguration publicIpAddressConfiguration) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetIpConfigurationProperties(); - } - this.innerProperties().withPublicIpAddressConfiguration(publicIpAddressConfiguration); - return this; - } - - /** - * Get the privateIpAddressVersion property: Available from Api-Version 2017-03-30 onwards, it represents whether - * the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. - * - * @return the privateIpAddressVersion value. - */ - public IpVersion privateIpAddressVersion() { - return this.innerProperties() == null ? null : this.innerProperties().privateIpAddressVersion(); - } - - /** - * Set the privateIpAddressVersion property: Available from Api-Version 2017-03-30 onwards, it represents whether - * the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. - * - * @param privateIpAddressVersion the privateIpAddressVersion value to set. - * @return the VirtualMachineScaleSetIpConfiguration object itself. - */ - public VirtualMachineScaleSetIpConfiguration withPrivateIpAddressVersion(IpVersion privateIpAddressVersion) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetIpConfigurationProperties(); - } - this.innerProperties().withPrivateIpAddressVersion(privateIpAddressVersion); - return this; - } - - /** - * Get the applicationGatewayBackendAddressPools property: Specifies an array of references to backend address pools - * of application gateways. A scale set can reference backend address pools of multiple application gateways. - * Multiple scale sets cannot use the same application gateway. - * - * @return the applicationGatewayBackendAddressPools value. - */ - public List applicationGatewayBackendAddressPools() { - return this.innerProperties() == null ? null : this.innerProperties().applicationGatewayBackendAddressPools(); - } - - /** - * Set the applicationGatewayBackendAddressPools property: Specifies an array of references to backend address pools - * of application gateways. A scale set can reference backend address pools of multiple application gateways. - * Multiple scale sets cannot use the same application gateway. - * - * @param applicationGatewayBackendAddressPools the applicationGatewayBackendAddressPools value to set. - * @return the VirtualMachineScaleSetIpConfiguration object itself. - */ - public VirtualMachineScaleSetIpConfiguration withApplicationGatewayBackendAddressPools( - List applicationGatewayBackendAddressPools) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetIpConfigurationProperties(); - } - this.innerProperties().withApplicationGatewayBackendAddressPools(applicationGatewayBackendAddressPools); - return this; - } - - /** - * Get the applicationSecurityGroups property: Specifies an array of references to application security group. - * - * @return the applicationSecurityGroups value. - */ - public List applicationSecurityGroups() { - return this.innerProperties() == null ? null : this.innerProperties().applicationSecurityGroups(); - } - - /** - * Set the applicationSecurityGroups property: Specifies an array of references to application security group. - * - * @param applicationSecurityGroups the applicationSecurityGroups value to set. - * @return the VirtualMachineScaleSetIpConfiguration object itself. - */ - public VirtualMachineScaleSetIpConfiguration withApplicationSecurityGroups( - List applicationSecurityGroups) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetIpConfigurationProperties(); - } - this.innerProperties().withApplicationSecurityGroups(applicationSecurityGroups); - return this; - } - - /** - * Get the loadBalancerBackendAddressPools property: Specifies an array of references to backend address pools of - * load balancers. A scale set can reference backend address pools of one public and one internal load balancer. - * Multiple scale sets cannot use the same basic sku load balancer. - * - * @return the loadBalancerBackendAddressPools value. - */ - public List loadBalancerBackendAddressPools() { - return this.innerProperties() == null ? null : this.innerProperties().loadBalancerBackendAddressPools(); - } - - /** - * Set the loadBalancerBackendAddressPools property: Specifies an array of references to backend address pools of - * load balancers. A scale set can reference backend address pools of one public and one internal load balancer. - * Multiple scale sets cannot use the same basic sku load balancer. - * - * @param loadBalancerBackendAddressPools the loadBalancerBackendAddressPools value to set. - * @return the VirtualMachineScaleSetIpConfiguration object itself. - */ - public VirtualMachineScaleSetIpConfiguration withLoadBalancerBackendAddressPools( - List loadBalancerBackendAddressPools) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetIpConfigurationProperties(); - } - this.innerProperties().withLoadBalancerBackendAddressPools(loadBalancerBackendAddressPools); - return this; - } - - /** - * Get the loadBalancerInboundNatPools property: Specifies an array of references to inbound Nat pools of the load - * balancers. A scale set can reference inbound nat pools of one public and one internal load balancer. Multiple - * scale sets cannot use the same basic sku load balancer. - * - * @return the loadBalancerInboundNatPools value. - */ - public List loadBalancerInboundNatPools() { - return this.innerProperties() == null ? null : this.innerProperties().loadBalancerInboundNatPools(); - } - - /** - * Set the loadBalancerInboundNatPools property: Specifies an array of references to inbound Nat pools of the load - * balancers. A scale set can reference inbound nat pools of one public and one internal load balancer. Multiple - * scale sets cannot use the same basic sku load balancer. - * - * @param loadBalancerInboundNatPools the loadBalancerInboundNatPools value to set. - * @return the VirtualMachineScaleSetIpConfiguration object itself. - */ - public VirtualMachineScaleSetIpConfiguration withLoadBalancerInboundNatPools( - List loadBalancerInboundNatPools) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetIpConfigurationProperties(); - } - this.innerProperties().withLoadBalancerInboundNatPools(loadBalancerInboundNatPools); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property name in model VirtualMachineScaleSetIpConfiguration")); - } - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetIpTag.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetIpTag.java deleted file mode 100644 index 3c196d4038b0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetIpTag.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Contains the IP tag associated with the public IP address. */ -@Fluent -public final class VirtualMachineScaleSetIpTag { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetIpTag.class); - - /* - * IP tag type. Example: FirstPartyUsage. - */ - @JsonProperty(value = "ipTagType") - private String ipTagType; - - /* - * IP tag associated with the public IP. Example: SQL, Storage etc. - */ - @JsonProperty(value = "tag") - private String tag; - - /** - * Get the ipTagType property: IP tag type. Example: FirstPartyUsage. - * - * @return the ipTagType value. - */ - public String ipTagType() { - return this.ipTagType; - } - - /** - * Set the ipTagType property: IP tag type. Example: FirstPartyUsage. - * - * @param ipTagType the ipTagType value to set. - * @return the VirtualMachineScaleSetIpTag object itself. - */ - public VirtualMachineScaleSetIpTag withIpTagType(String ipTagType) { - this.ipTagType = ipTagType; - return this; - } - - /** - * Get the tag property: IP tag associated with the public IP. Example: SQL, Storage etc. - * - * @return the tag value. - */ - public String tag() { - return this.tag; - } - - /** - * Set the tag property: IP tag associated with the public IP. Example: SQL, Storage etc. - * - * @param tag the tag value to set. - * @return the VirtualMachineScaleSetIpTag object itself. - */ - public VirtualMachineScaleSetIpTag withTag(String tag) { - this.tag = tag; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetListOSUpgradeHistory.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetListOSUpgradeHistory.java deleted file mode 100644 index 267f69df8ef1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetListOSUpgradeHistory.java +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.fluent.models.UpgradeOperationHistoricalStatusInfoInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** List of Virtual Machine Scale Set OS Upgrade History operation response. */ -@Fluent -public final class VirtualMachineScaleSetListOSUpgradeHistory { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetListOSUpgradeHistory.class); - - /* - * The list of OS upgrades performed on the virtual machine scale set. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * The uri to fetch the next page of OS Upgrade History. Call ListNext() - * with this to fetch the next page of history of upgrades. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: The list of OS upgrades performed on the virtual machine scale set. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The list of OS upgrades performed on the virtual machine scale set. - * - * @param value the value value to set. - * @return the VirtualMachineScaleSetListOSUpgradeHistory object itself. - */ - public VirtualMachineScaleSetListOSUpgradeHistory withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The uri to fetch the next page of OS Upgrade History. Call ListNext() with this to - * fetch the next page of history of upgrades. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The uri to fetch the next page of OS Upgrade History. Call ListNext() with this to - * fetch the next page of history of upgrades. - * - * @param nextLink the nextLink value to set. - * @return the VirtualMachineScaleSetListOSUpgradeHistory object itself. - */ - public VirtualMachineScaleSetListOSUpgradeHistory withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property value in model VirtualMachineScaleSetListOSUpgradeHistory")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetListResult.java deleted file mode 100644 index 0d3251721ed7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetListResult.java +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineScaleSetInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The List Virtual Machine operation response. */ -@Fluent -public final class VirtualMachineScaleSetListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetListResult.class); - - /* - * The list of virtual machine scale sets. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * The uri to fetch the next page of Virtual Machine Scale Sets. Call - * ListNext() with this to fetch the next page of VMSS. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: The list of virtual machine scale sets. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The list of virtual machine scale sets. - * - * @param value the value value to set. - * @return the VirtualMachineScaleSetListResult object itself. - */ - public VirtualMachineScaleSetListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The uri to fetch the next page of Virtual Machine Scale Sets. Call ListNext() with - * this to fetch the next page of VMSS. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The uri to fetch the next page of Virtual Machine Scale Sets. Call ListNext() with - * this to fetch the next page of VMSS. - * - * @param nextLink the nextLink value to set. - * @return the VirtualMachineScaleSetListResult object itself. - */ - public VirtualMachineScaleSetListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property value in model VirtualMachineScaleSetListResult")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetListSkusResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetListSkusResult.java deleted file mode 100644 index e88526849e26..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetListSkusResult.java +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineScaleSetSkuInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The Virtual Machine Scale Set List Skus operation response. */ -@Fluent -public final class VirtualMachineScaleSetListSkusResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetListSkusResult.class); - - /* - * The list of skus available for the virtual machine scale set. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * The uri to fetch the next page of Virtual Machine Scale Set Skus. Call - * ListNext() with this to fetch the next page of VMSS Skus. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: The list of skus available for the virtual machine scale set. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The list of skus available for the virtual machine scale set. - * - * @param value the value value to set. - * @return the VirtualMachineScaleSetListSkusResult object itself. - */ - public VirtualMachineScaleSetListSkusResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The uri to fetch the next page of Virtual Machine Scale Set Skus. Call ListNext() with - * this to fetch the next page of VMSS Skus. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The uri to fetch the next page of Virtual Machine Scale Set Skus. Call ListNext() with - * this to fetch the next page of VMSS Skus. - * - * @param nextLink the nextLink value to set. - * @return the VirtualMachineScaleSetListSkusResult object itself. - */ - public VirtualMachineScaleSetListSkusResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property value in model VirtualMachineScaleSetListSkusResult")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetListWithLinkResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetListWithLinkResult.java deleted file mode 100644 index 52dcd90f8ee1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetListWithLinkResult.java +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineScaleSetInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The List Virtual Machine operation response. */ -@Fluent -public final class VirtualMachineScaleSetListWithLinkResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetListWithLinkResult.class); - - /* - * The list of virtual machine scale sets. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * The uri to fetch the next page of Virtual Machine Scale Sets. Call - * ListNext() with this to fetch the next page of Virtual Machine Scale - * Sets. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: The list of virtual machine scale sets. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The list of virtual machine scale sets. - * - * @param value the value value to set. - * @return the VirtualMachineScaleSetListWithLinkResult object itself. - */ - public VirtualMachineScaleSetListWithLinkResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The uri to fetch the next page of Virtual Machine Scale Sets. Call ListNext() with - * this to fetch the next page of Virtual Machine Scale Sets. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The uri to fetch the next page of Virtual Machine Scale Sets. Call ListNext() with - * this to fetch the next page of Virtual Machine Scale Sets. - * - * @param nextLink the nextLink value to set. - * @return the VirtualMachineScaleSetListWithLinkResult object itself. - */ - public VirtualMachineScaleSetListWithLinkResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property value in model VirtualMachineScaleSetListWithLinkResult")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetManagedDiskParameters.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetManagedDiskParameters.java deleted file mode 100644 index aa2022850a85..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetManagedDiskParameters.java +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describes the parameters of a ScaleSet managed disk. */ -@Fluent -public final class VirtualMachineScaleSetManagedDiskParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetManagedDiskParameters.class); - - /* - * Specifies the storage account type for the managed disk. NOTE: - * UltraSSD_LRS can only be used with data disks, it cannot be used with OS - * Disk. - */ - @JsonProperty(value = "storageAccountType") - private StorageAccountTypes storageAccountType; - - /* - * Specifies the customer managed disk encryption set resource id for the - * managed disk. - */ - @JsonProperty(value = "diskEncryptionSet") - private DiskEncryptionSetParameters diskEncryptionSet; - - /** - * Get the storageAccountType property: Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS - * can only be used with data disks, it cannot be used with OS Disk. - * - * @return the storageAccountType value. - */ - public StorageAccountTypes storageAccountType() { - return this.storageAccountType; - } - - /** - * Set the storageAccountType property: Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS - * can only be used with data disks, it cannot be used with OS Disk. - * - * @param storageAccountType the storageAccountType value to set. - * @return the VirtualMachineScaleSetManagedDiskParameters object itself. - */ - public VirtualMachineScaleSetManagedDiskParameters withStorageAccountType(StorageAccountTypes storageAccountType) { - this.storageAccountType = storageAccountType; - return this; - } - - /** - * Get the diskEncryptionSet property: Specifies the customer managed disk encryption set resource id for the - * managed disk. - * - * @return the diskEncryptionSet value. - */ - public DiskEncryptionSetParameters diskEncryptionSet() { - return this.diskEncryptionSet; - } - - /** - * Set the diskEncryptionSet property: Specifies the customer managed disk encryption set resource id for the - * managed disk. - * - * @param diskEncryptionSet the diskEncryptionSet value to set. - * @return the VirtualMachineScaleSetManagedDiskParameters object itself. - */ - public VirtualMachineScaleSetManagedDiskParameters withDiskEncryptionSet( - DiskEncryptionSetParameters diskEncryptionSet) { - this.diskEncryptionSet = diskEncryptionSet; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (diskEncryptionSet() != null) { - diskEncryptionSet().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetNetworkConfiguration.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetNetworkConfiguration.java deleted file mode 100644 index fbed77d68714..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetNetworkConfiguration.java +++ /dev/null @@ -1,253 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineScaleSetNetworkConfigurationProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Describes a virtual machine scale set network profile's network configurations. */ -@Fluent -public final class VirtualMachineScaleSetNetworkConfiguration extends SubResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetNetworkConfiguration.class); - - /* - * The network configuration name. - */ - @JsonProperty(value = "name", required = true) - private String name; - - /* - * Describes a virtual machine scale set network profile's IP - * configuration. - */ - @JsonProperty(value = "properties") - private VirtualMachineScaleSetNetworkConfigurationProperties innerProperties; - - /** - * Get the name property: The network configuration name. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The network configuration name. - * - * @param name the name value to set. - * @return the VirtualMachineScaleSetNetworkConfiguration object itself. - */ - public VirtualMachineScaleSetNetworkConfiguration withName(String name) { - this.name = name; - return this; - } - - /** - * Get the innerProperties property: Describes a virtual machine scale set network profile's IP configuration. - * - * @return the innerProperties value. - */ - private VirtualMachineScaleSetNetworkConfigurationProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public VirtualMachineScaleSetNetworkConfiguration withId(String id) { - super.withId(id); - return this; - } - - /** - * Get the primary property: Specifies the primary network interface in case the virtual machine has more than 1 - * network interface. - * - * @return the primary value. - */ - public Boolean primary() { - return this.innerProperties() == null ? null : this.innerProperties().primary(); - } - - /** - * Set the primary property: Specifies the primary network interface in case the virtual machine has more than 1 - * network interface. - * - * @param primary the primary value to set. - * @return the VirtualMachineScaleSetNetworkConfiguration object itself. - */ - public VirtualMachineScaleSetNetworkConfiguration withPrimary(Boolean primary) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetNetworkConfigurationProperties(); - } - this.innerProperties().withPrimary(primary); - return this; - } - - /** - * Get the enableAcceleratedNetworking property: Specifies whether the network interface is accelerated - * networking-enabled. - * - * @return the enableAcceleratedNetworking value. - */ - public Boolean enableAcceleratedNetworking() { - return this.innerProperties() == null ? null : this.innerProperties().enableAcceleratedNetworking(); - } - - /** - * Set the enableAcceleratedNetworking property: Specifies whether the network interface is accelerated - * networking-enabled. - * - * @param enableAcceleratedNetworking the enableAcceleratedNetworking value to set. - * @return the VirtualMachineScaleSetNetworkConfiguration object itself. - */ - public VirtualMachineScaleSetNetworkConfiguration withEnableAcceleratedNetworking( - Boolean enableAcceleratedNetworking) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetNetworkConfigurationProperties(); - } - this.innerProperties().withEnableAcceleratedNetworking(enableAcceleratedNetworking); - return this; - } - - /** - * Get the enableFpga property: Specifies whether the network interface is FPGA networking-enabled. - * - * @return the enableFpga value. - */ - public Boolean enableFpga() { - return this.innerProperties() == null ? null : this.innerProperties().enableFpga(); - } - - /** - * Set the enableFpga property: Specifies whether the network interface is FPGA networking-enabled. - * - * @param enableFpga the enableFpga value to set. - * @return the VirtualMachineScaleSetNetworkConfiguration object itself. - */ - public VirtualMachineScaleSetNetworkConfiguration withEnableFpga(Boolean enableFpga) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetNetworkConfigurationProperties(); - } - this.innerProperties().withEnableFpga(enableFpga); - return this; - } - - /** - * Get the networkSecurityGroup property: The network security group. - * - * @return the networkSecurityGroup value. - */ - public SubResource networkSecurityGroup() { - return this.innerProperties() == null ? null : this.innerProperties().networkSecurityGroup(); - } - - /** - * Set the networkSecurityGroup property: The network security group. - * - * @param networkSecurityGroup the networkSecurityGroup value to set. - * @return the VirtualMachineScaleSetNetworkConfiguration object itself. - */ - public VirtualMachineScaleSetNetworkConfiguration withNetworkSecurityGroup(SubResource networkSecurityGroup) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetNetworkConfigurationProperties(); - } - this.innerProperties().withNetworkSecurityGroup(networkSecurityGroup); - return this; - } - - /** - * Get the dnsSettings property: The dns settings to be applied on the network interfaces. - * - * @return the dnsSettings value. - */ - public VirtualMachineScaleSetNetworkConfigurationDnsSettings dnsSettings() { - return this.innerProperties() == null ? null : this.innerProperties().dnsSettings(); - } - - /** - * Set the dnsSettings property: The dns settings to be applied on the network interfaces. - * - * @param dnsSettings the dnsSettings value to set. - * @return the VirtualMachineScaleSetNetworkConfiguration object itself. - */ - public VirtualMachineScaleSetNetworkConfiguration withDnsSettings( - VirtualMachineScaleSetNetworkConfigurationDnsSettings dnsSettings) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetNetworkConfigurationProperties(); - } - this.innerProperties().withDnsSettings(dnsSettings); - return this; - } - - /** - * Get the ipConfigurations property: Specifies the IP configurations of the network interface. - * - * @return the ipConfigurations value. - */ - public List ipConfigurations() { - return this.innerProperties() == null ? null : this.innerProperties().ipConfigurations(); - } - - /** - * Set the ipConfigurations property: Specifies the IP configurations of the network interface. - * - * @param ipConfigurations the ipConfigurations value to set. - * @return the VirtualMachineScaleSetNetworkConfiguration object itself. - */ - public VirtualMachineScaleSetNetworkConfiguration withIpConfigurations( - List ipConfigurations) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetNetworkConfigurationProperties(); - } - this.innerProperties().withIpConfigurations(ipConfigurations); - return this; - } - - /** - * Get the enableIpForwarding property: Whether IP forwarding enabled on this NIC. - * - * @return the enableIpForwarding value. - */ - public Boolean enableIpForwarding() { - return this.innerProperties() == null ? null : this.innerProperties().enableIpForwarding(); - } - - /** - * Set the enableIpForwarding property: Whether IP forwarding enabled on this NIC. - * - * @param enableIpForwarding the enableIpForwarding value to set. - * @return the VirtualMachineScaleSetNetworkConfiguration object itself. - */ - public VirtualMachineScaleSetNetworkConfiguration withEnableIpForwarding(Boolean enableIpForwarding) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetNetworkConfigurationProperties(); - } - this.innerProperties().withEnableIpForwarding(enableIpForwarding); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property name in model VirtualMachineScaleSetNetworkConfiguration")); - } - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetNetworkConfigurationDnsSettings.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetNetworkConfigurationDnsSettings.java deleted file mode 100644 index 5a00ece477cd..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetNetworkConfigurationDnsSettings.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Describes a virtual machines scale sets network configuration's DNS settings. */ -@Fluent -public final class VirtualMachineScaleSetNetworkConfigurationDnsSettings { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetNetworkConfigurationDnsSettings.class); - - /* - * List of DNS servers IP addresses - */ - @JsonProperty(value = "dnsServers") - private List dnsServers; - - /** - * Get the dnsServers property: List of DNS servers IP addresses. - * - * @return the dnsServers value. - */ - public List dnsServers() { - return this.dnsServers; - } - - /** - * Set the dnsServers property: List of DNS servers IP addresses. - * - * @param dnsServers the dnsServers value to set. - * @return the VirtualMachineScaleSetNetworkConfigurationDnsSettings object itself. - */ - public VirtualMachineScaleSetNetworkConfigurationDnsSettings withDnsServers(List dnsServers) { - this.dnsServers = dnsServers; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetNetworkProfile.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetNetworkProfile.java deleted file mode 100644 index 9590e7cfcb94..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetNetworkProfile.java +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Describes a virtual machine scale set network profile. */ -@Fluent -public final class VirtualMachineScaleSetNetworkProfile { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetNetworkProfile.class); - - /* - * A reference to a load balancer probe used to determine the health of an - * instance in the virtual machine scale set. The reference will be in the - * form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'. - */ - @JsonProperty(value = "healthProbe") - private ApiEntityReference healthProbe; - - /* - * The list of network configurations. - */ - @JsonProperty(value = "networkInterfaceConfigurations") - private List networkInterfaceConfigurations; - - /** - * Get the healthProbe property: A reference to a load balancer probe used to determine the health of an instance in - * the virtual machine scale set. The reference will be in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'. - * - * @return the healthProbe value. - */ - public ApiEntityReference healthProbe() { - return this.healthProbe; - } - - /** - * Set the healthProbe property: A reference to a load balancer probe used to determine the health of an instance in - * the virtual machine scale set. The reference will be in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'. - * - * @param healthProbe the healthProbe value to set. - * @return the VirtualMachineScaleSetNetworkProfile object itself. - */ - public VirtualMachineScaleSetNetworkProfile withHealthProbe(ApiEntityReference healthProbe) { - this.healthProbe = healthProbe; - return this; - } - - /** - * Get the networkInterfaceConfigurations property: The list of network configurations. - * - * @return the networkInterfaceConfigurations value. - */ - public List networkInterfaceConfigurations() { - return this.networkInterfaceConfigurations; - } - - /** - * Set the networkInterfaceConfigurations property: The list of network configurations. - * - * @param networkInterfaceConfigurations the networkInterfaceConfigurations value to set. - * @return the VirtualMachineScaleSetNetworkProfile object itself. - */ - public VirtualMachineScaleSetNetworkProfile withNetworkInterfaceConfigurations( - List networkInterfaceConfigurations) { - this.networkInterfaceConfigurations = networkInterfaceConfigurations; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (healthProbe() != null) { - healthProbe().validate(); - } - if (networkInterfaceConfigurations() != null) { - networkInterfaceConfigurations().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetOSDisk.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetOSDisk.java deleted file mode 100644 index bb0105bb13f5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetOSDisk.java +++ /dev/null @@ -1,341 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Describes a virtual machine scale set operating system disk. */ -@Fluent -public final class VirtualMachineScaleSetOSDisk { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetOSDisk.class); - - /* - * The disk name. - */ - @JsonProperty(value = "name") - private String name; - - /* - * Specifies the caching requirements.

    Possible values are: - *

    **None**

    **ReadOnly**

    **ReadWrite**

    - * Default: **None for Standard storage. ReadOnly for Premium storage** - */ - @JsonProperty(value = "caching") - private CachingTypes caching; - - /* - * Specifies whether writeAccelerator should be enabled or disabled on the - * disk. - */ - @JsonProperty(value = "writeAcceleratorEnabled") - private Boolean writeAcceleratorEnabled; - - /* - * Specifies how the virtual machines in the scale set should be - * created.

    The only allowed value is: **FromImage** \u2013 This - * value is used when you are using an image to create the virtual machine. - * If you are using a platform image, you also use the imageReference - * element described above. If you are using a marketplace image, you also - * use the plan element previously described. - */ - @JsonProperty(value = "createOption", required = true) - private DiskCreateOptionTypes createOption; - - /* - * Specifies the ephemeral disk Settings for the operating system disk used - * by the virtual machine scale set. - */ - @JsonProperty(value = "diffDiskSettings") - private DiffDiskSettings diffDiskSettings; - - /* - * Specifies the size of the operating system disk in gigabytes. This - * element can be used to overwrite the size of the disk in a virtual - * machine image.

    This value cannot be larger than 1023 GB - */ - @JsonProperty(value = "diskSizeGB") - private Integer diskSizeGB; - - /* - * This property allows you to specify the type of the OS that is included - * in the disk if creating a VM from user-image or a specialized VHD. - *

    Possible values are:

    **Windows**

    **Linux** - */ - @JsonProperty(value = "osType") - private OperatingSystemTypes osType; - - /* - * Specifies information about the unmanaged user image to base the scale - * set on. - */ - @JsonProperty(value = "image") - private VirtualHardDisk image; - - /* - * Specifies the container urls that are used to store operating system - * disks for the scale set. - */ - @JsonProperty(value = "vhdContainers") - private List vhdContainers; - - /* - * The managed disk parameters. - */ - @JsonProperty(value = "managedDisk") - private VirtualMachineScaleSetManagedDiskParameters managedDisk; - - /** - * Get the name property: The disk name. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The disk name. - * - * @param name the name value to set. - * @return the VirtualMachineScaleSetOSDisk object itself. - */ - public VirtualMachineScaleSetOSDisk withName(String name) { - this.name = name; - return this; - } - - /** - * Get the caching property: Specifies the caching requirements. <br><br> Possible values are: - * <br><br> **None** <br><br> **ReadOnly** <br><br> **ReadWrite** - * <br><br> Default: **None for Standard storage. ReadOnly for Premium storage**. - * - * @return the caching value. - */ - public CachingTypes caching() { - return this.caching; - } - - /** - * Set the caching property: Specifies the caching requirements. <br><br> Possible values are: - * <br><br> **None** <br><br> **ReadOnly** <br><br> **ReadWrite** - * <br><br> Default: **None for Standard storage. ReadOnly for Premium storage**. - * - * @param caching the caching value to set. - * @return the VirtualMachineScaleSetOSDisk object itself. - */ - public VirtualMachineScaleSetOSDisk withCaching(CachingTypes caching) { - this.caching = caching; - return this; - } - - /** - * Get the writeAcceleratorEnabled property: Specifies whether writeAccelerator should be enabled or disabled on the - * disk. - * - * @return the writeAcceleratorEnabled value. - */ - public Boolean writeAcceleratorEnabled() { - return this.writeAcceleratorEnabled; - } - - /** - * Set the writeAcceleratorEnabled property: Specifies whether writeAccelerator should be enabled or disabled on the - * disk. - * - * @param writeAcceleratorEnabled the writeAcceleratorEnabled value to set. - * @return the VirtualMachineScaleSetOSDisk object itself. - */ - public VirtualMachineScaleSetOSDisk withWriteAcceleratorEnabled(Boolean writeAcceleratorEnabled) { - this.writeAcceleratorEnabled = writeAcceleratorEnabled; - return this; - } - - /** - * Get the createOption property: Specifies how the virtual machines in the scale set should be - * created.<br><br> The only allowed value is: **FromImage** \u2013 This value is used when you are - * using an image to create the virtual machine. If you are using a platform image, you also use the imageReference - * element described above. If you are using a marketplace image, you also use the plan element previously - * described. - * - * @return the createOption value. - */ - public DiskCreateOptionTypes createOption() { - return this.createOption; - } - - /** - * Set the createOption property: Specifies how the virtual machines in the scale set should be - * created.<br><br> The only allowed value is: **FromImage** \u2013 This value is used when you are - * using an image to create the virtual machine. If you are using a platform image, you also use the imageReference - * element described above. If you are using a marketplace image, you also use the plan element previously - * described. - * - * @param createOption the createOption value to set. - * @return the VirtualMachineScaleSetOSDisk object itself. - */ - public VirtualMachineScaleSetOSDisk withCreateOption(DiskCreateOptionTypes createOption) { - this.createOption = createOption; - return this; - } - - /** - * Get the diffDiskSettings property: Specifies the ephemeral disk Settings for the operating system disk used by - * the virtual machine scale set. - * - * @return the diffDiskSettings value. - */ - public DiffDiskSettings diffDiskSettings() { - return this.diffDiskSettings; - } - - /** - * Set the diffDiskSettings property: Specifies the ephemeral disk Settings for the operating system disk used by - * the virtual machine scale set. - * - * @param diffDiskSettings the diffDiskSettings value to set. - * @return the VirtualMachineScaleSetOSDisk object itself. - */ - public VirtualMachineScaleSetOSDisk withDiffDiskSettings(DiffDiskSettings diffDiskSettings) { - this.diffDiskSettings = diffDiskSettings; - return this; - } - - /** - * Get the diskSizeGB property: Specifies the size of the operating system disk in gigabytes. This element can be - * used to overwrite the size of the disk in a virtual machine image. <br><br> This value cannot be - * larger than 1023 GB. - * - * @return the diskSizeGB value. - */ - public Integer diskSizeGB() { - return this.diskSizeGB; - } - - /** - * Set the diskSizeGB property: Specifies the size of the operating system disk in gigabytes. This element can be - * used to overwrite the size of the disk in a virtual machine image. <br><br> This value cannot be - * larger than 1023 GB. - * - * @param diskSizeGB the diskSizeGB value to set. - * @return the VirtualMachineScaleSetOSDisk object itself. - */ - public VirtualMachineScaleSetOSDisk withDiskSizeGB(Integer diskSizeGB) { - this.diskSizeGB = diskSizeGB; - return this; - } - - /** - * Get the osType property: This property allows you to specify the type of the OS that is included in the disk if - * creating a VM from user-image or a specialized VHD. <br><br> Possible values are: - * <br><br> **Windows** <br><br> **Linux**. - * - * @return the osType value. - */ - public OperatingSystemTypes osType() { - return this.osType; - } - - /** - * Set the osType property: This property allows you to specify the type of the OS that is included in the disk if - * creating a VM from user-image or a specialized VHD. <br><br> Possible values are: - * <br><br> **Windows** <br><br> **Linux**. - * - * @param osType the osType value to set. - * @return the VirtualMachineScaleSetOSDisk object itself. - */ - public VirtualMachineScaleSetOSDisk withOsType(OperatingSystemTypes osType) { - this.osType = osType; - return this; - } - - /** - * Get the image property: Specifies information about the unmanaged user image to base the scale set on. - * - * @return the image value. - */ - public VirtualHardDisk image() { - return this.image; - } - - /** - * Set the image property: Specifies information about the unmanaged user image to base the scale set on. - * - * @param image the image value to set. - * @return the VirtualMachineScaleSetOSDisk object itself. - */ - public VirtualMachineScaleSetOSDisk withImage(VirtualHardDisk image) { - this.image = image; - return this; - } - - /** - * Get the vhdContainers property: Specifies the container urls that are used to store operating system disks for - * the scale set. - * - * @return the vhdContainers value. - */ - public List vhdContainers() { - return this.vhdContainers; - } - - /** - * Set the vhdContainers property: Specifies the container urls that are used to store operating system disks for - * the scale set. - * - * @param vhdContainers the vhdContainers value to set. - * @return the VirtualMachineScaleSetOSDisk object itself. - */ - public VirtualMachineScaleSetOSDisk withVhdContainers(List vhdContainers) { - this.vhdContainers = vhdContainers; - return this; - } - - /** - * Get the managedDisk property: The managed disk parameters. - * - * @return the managedDisk value. - */ - public VirtualMachineScaleSetManagedDiskParameters managedDisk() { - return this.managedDisk; - } - - /** - * Set the managedDisk property: The managed disk parameters. - * - * @param managedDisk the managedDisk value to set. - * @return the VirtualMachineScaleSetOSDisk object itself. - */ - public VirtualMachineScaleSetOSDisk withManagedDisk(VirtualMachineScaleSetManagedDiskParameters managedDisk) { - this.managedDisk = managedDisk; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (createOption() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property createOption in model VirtualMachineScaleSetOSDisk")); - } - if (diffDiskSettings() != null) { - diffDiskSettings().validate(); - } - if (image() != null) { - image().validate(); - } - if (managedDisk() != null) { - managedDisk().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetOSProfile.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetOSProfile.java deleted file mode 100644 index 23bc50cb3f31..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetOSProfile.java +++ /dev/null @@ -1,320 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Describes a virtual machine scale set OS profile. */ -@Fluent -public final class VirtualMachineScaleSetOSProfile { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetOSProfile.class); - - /* - * Specifies the computer name prefix for all of the virtual machines in - * the scale set. Computer name prefixes must be 1 to 15 characters long. - */ - @JsonProperty(value = "computerNamePrefix") - private String computerNamePrefix; - - /* - * Specifies the name of the administrator account.

    **Windows-only - * restriction:** Cannot end in "."

    **Disallowed values:** - * "administrator", "admin", "user", "user1", "test", "user2", "test1", - * "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", - * "aspnet", "backup", "console", "david", "guest", "john", "owner", - * "root", "server", "sql", "support", "support_388945a0", "sys", "test2", - * "test3", "user4", "user5".

    **Minimum-length (Linux):** 1 - * character

    **Max-length (Linux):** 64 characters

    - * **Max-length (Windows):** 20 characters

  • For root access to - * the Linux VM, see [Using root privileges on Linux virtual machines in - * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • - * For a list of built-in system users on Linux that should not be used in - * this field, see [Selecting User Names for Linux on - * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) - */ - @JsonProperty(value = "adminUsername") - private String adminUsername; - - /* - * Specifies the password of the administrator account.

    - * **Minimum-length (Windows):** 8 characters

    **Minimum-length - * (Linux):** 6 characters

    **Max-length (Windows):** 123 - * characters

    **Max-length (Linux):** 72 characters

    - * **Complexity requirements:** 3 out of 4 conditions below need to be - * fulfilled
    Has lower characters
    Has upper characters
    Has a - * digit
    Has a special character (Regex match [\W_])

    - * **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", - * "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", - * "iloveyou!"

    For resetting the password, see [How to reset the - * Remote Desktop service or its login password in a Windows - * VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) - *

    For resetting root password, see [Manage users, SSH, and check - * or repair disks on Azure Linux VMs using the VMAccess - * Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) - */ - @JsonProperty(value = "adminPassword") - private String adminPassword; - - /* - * Specifies a base-64 encoded string of custom data. The base-64 encoded - * string is decoded to a binary array that is saved as a file on the - * Virtual Machine. The maximum length of the binary array is 65535 bytes. - *

    For using cloud-init for your VM, see [Using cloud-init to - * customize a Linux VM during - * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) - */ - @JsonProperty(value = "customData") - private String customData; - - /* - * Specifies Windows operating system settings on the virtual machine. - */ - @JsonProperty(value = "windowsConfiguration") - private WindowsConfiguration windowsConfiguration; - - /* - * Specifies the Linux operating system settings on the virtual machine. - *

    For a list of supported Linux distributions, see [Linux on - * Azure-Endorsed - * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) - *

    For running non-endorsed distributions, see [Information for - * Non-Endorsed - * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). - */ - @JsonProperty(value = "linuxConfiguration") - private LinuxConfiguration linuxConfiguration; - - /* - * Specifies set of certificates that should be installed onto the virtual - * machines in the scale set. - */ - @JsonProperty(value = "secrets") - private List secrets; - - /** - * Get the computerNamePrefix property: Specifies the computer name prefix for all of the virtual machines in the - * scale set. Computer name prefixes must be 1 to 15 characters long. - * - * @return the computerNamePrefix value. - */ - public String computerNamePrefix() { - return this.computerNamePrefix; - } - - /** - * Set the computerNamePrefix property: Specifies the computer name prefix for all of the virtual machines in the - * scale set. Computer name prefixes must be 1 to 15 characters long. - * - * @param computerNamePrefix the computerNamePrefix value to set. - * @return the VirtualMachineScaleSetOSProfile object itself. - */ - public VirtualMachineScaleSetOSProfile withComputerNamePrefix(String computerNamePrefix) { - this.computerNamePrefix = computerNamePrefix; - return this; - } - - /** - * Get the adminUsername property: Specifies the name of the administrator account. <br><br> - * **Windows-only restriction:** Cannot end in "." <br><br> **Disallowed values:** "administrator", - * "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", - * "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", - * "support_388945a0", "sys", "test2", "test3", "user4", "user5". <br><br> **Minimum-length (Linux):** 1 - * character <br><br> **Max-length (Linux):** 64 characters <br><br> **Max-length - * (Windows):** 20 characters <br><br><li> For root access to the Linux VM, see [Using root - * privileges on Linux virtual machines in - * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)<br><li> - * For a list of built-in system users on Linux that should not be used in this field, see [Selecting User Names for - * Linux on - * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). - * - * @return the adminUsername value. - */ - public String adminUsername() { - return this.adminUsername; - } - - /** - * Set the adminUsername property: Specifies the name of the administrator account. <br><br> - * **Windows-only restriction:** Cannot end in "." <br><br> **Disallowed values:** "administrator", - * "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", - * "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", - * "support_388945a0", "sys", "test2", "test3", "user4", "user5". <br><br> **Minimum-length (Linux):** 1 - * character <br><br> **Max-length (Linux):** 64 characters <br><br> **Max-length - * (Windows):** 20 characters <br><br><li> For root access to the Linux VM, see [Using root - * privileges on Linux virtual machines in - * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)<br><li> - * For a list of built-in system users on Linux that should not be used in this field, see [Selecting User Names for - * Linux on - * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). - * - * @param adminUsername the adminUsername value to set. - * @return the VirtualMachineScaleSetOSProfile object itself. - */ - public VirtualMachineScaleSetOSProfile withAdminUsername(String adminUsername) { - this.adminUsername = adminUsername; - return this; - } - - /** - * Get the adminPassword property: Specifies the password of the administrator account. <br><br> - * **Minimum-length (Windows):** 8 characters <br><br> **Minimum-length (Linux):** 6 characters - * <br><br> **Max-length (Windows):** 123 characters <br><br> **Max-length (Linux):** 72 - * characters <br><br> **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled - * <br> Has lower characters <br>Has upper characters <br> Has a digit <br> Has a special - * character (Regex match [\W_]) <br><br> **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", - * "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!" <br><br> - * For resetting the password, see [How to reset the Remote Desktop service or its login password in a Windows - * VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) - * <br><br> For resetting root password, see [Manage users, SSH, and check or repair disks on Azure - * Linux VMs using the VMAccess - * Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password). - * - * @return the adminPassword value. - */ - public String adminPassword() { - return this.adminPassword; - } - - /** - * Set the adminPassword property: Specifies the password of the administrator account. <br><br> - * **Minimum-length (Windows):** 8 characters <br><br> **Minimum-length (Linux):** 6 characters - * <br><br> **Max-length (Windows):** 123 characters <br><br> **Max-length (Linux):** 72 - * characters <br><br> **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled - * <br> Has lower characters <br>Has upper characters <br> Has a digit <br> Has a special - * character (Regex match [\W_]) <br><br> **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", - * "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!" <br><br> - * For resetting the password, see [How to reset the Remote Desktop service or its login password in a Windows - * VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) - * <br><br> For resetting root password, see [Manage users, SSH, and check or repair disks on Azure - * Linux VMs using the VMAccess - * Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password). - * - * @param adminPassword the adminPassword value to set. - * @return the VirtualMachineScaleSetOSProfile object itself. - */ - public VirtualMachineScaleSetOSProfile withAdminPassword(String adminPassword) { - this.adminPassword = adminPassword; - return this; - } - - /** - * Get the customData property: Specifies a base-64 encoded string of custom data. The base-64 encoded string is - * decoded to a binary array that is saved as a file on the Virtual Machine. The maximum length of the binary array - * is 65535 bytes. <br><br> For using cloud-init for your VM, see [Using cloud-init to customize a Linux - * VM during - * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). - * - * @return the customData value. - */ - public String customData() { - return this.customData; - } - - /** - * Set the customData property: Specifies a base-64 encoded string of custom data. The base-64 encoded string is - * decoded to a binary array that is saved as a file on the Virtual Machine. The maximum length of the binary array - * is 65535 bytes. <br><br> For using cloud-init for your VM, see [Using cloud-init to customize a Linux - * VM during - * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). - * - * @param customData the customData value to set. - * @return the VirtualMachineScaleSetOSProfile object itself. - */ - public VirtualMachineScaleSetOSProfile withCustomData(String customData) { - this.customData = customData; - return this; - } - - /** - * Get the windowsConfiguration property: Specifies Windows operating system settings on the virtual machine. - * - * @return the windowsConfiguration value. - */ - public WindowsConfiguration windowsConfiguration() { - return this.windowsConfiguration; - } - - /** - * Set the windowsConfiguration property: Specifies Windows operating system settings on the virtual machine. - * - * @param windowsConfiguration the windowsConfiguration value to set. - * @return the VirtualMachineScaleSetOSProfile object itself. - */ - public VirtualMachineScaleSetOSProfile withWindowsConfiguration(WindowsConfiguration windowsConfiguration) { - this.windowsConfiguration = windowsConfiguration; - return this; - } - - /** - * Get the linuxConfiguration property: Specifies the Linux operating system settings on the virtual machine. - * <br><br>For a list of supported Linux distributions, see [Linux on Azure-Endorsed - * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) - * <br><br> For running non-endorsed distributions, see [Information for Non-Endorsed - * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). - * - * @return the linuxConfiguration value. - */ - public LinuxConfiguration linuxConfiguration() { - return this.linuxConfiguration; - } - - /** - * Set the linuxConfiguration property: Specifies the Linux operating system settings on the virtual machine. - * <br><br>For a list of supported Linux distributions, see [Linux on Azure-Endorsed - * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) - * <br><br> For running non-endorsed distributions, see [Information for Non-Endorsed - * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). - * - * @param linuxConfiguration the linuxConfiguration value to set. - * @return the VirtualMachineScaleSetOSProfile object itself. - */ - public VirtualMachineScaleSetOSProfile withLinuxConfiguration(LinuxConfiguration linuxConfiguration) { - this.linuxConfiguration = linuxConfiguration; - return this; - } - - /** - * Get the secrets property: Specifies set of certificates that should be installed onto the virtual machines in the - * scale set. - * - * @return the secrets value. - */ - public List secrets() { - return this.secrets; - } - - /** - * Set the secrets property: Specifies set of certificates that should be installed onto the virtual machines in the - * scale set. - * - * @param secrets the secrets value to set. - * @return the VirtualMachineScaleSetOSProfile object itself. - */ - public VirtualMachineScaleSetOSProfile withSecrets(List secrets) { - this.secrets = secrets; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (windowsConfiguration() != null) { - windowsConfiguration().validate(); - } - if (linuxConfiguration() != null) { - linuxConfiguration().validate(); - } - if (secrets() != null) { - secrets().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetPublicIpAddressConfiguration.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetPublicIpAddressConfiguration.java deleted file mode 100644 index ca90dbf8b15a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetPublicIpAddressConfiguration.java +++ /dev/null @@ -1,199 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineScaleSetPublicIpAddressConfigurationProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Describes a virtual machines scale set IP Configuration's PublicIPAddress configuration. */ -@Fluent -public final class VirtualMachineScaleSetPublicIpAddressConfiguration { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetPublicIpAddressConfiguration.class); - - /* - * The publicIP address configuration name. - */ - @JsonProperty(value = "name", required = true) - private String name; - - /* - * Describes a virtual machines scale set IP Configuration's - * PublicIPAddress configuration - */ - @JsonProperty(value = "properties") - private VirtualMachineScaleSetPublicIpAddressConfigurationProperties innerProperties; - - /** - * Get the name property: The publicIP address configuration name. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The publicIP address configuration name. - * - * @param name the name value to set. - * @return the VirtualMachineScaleSetPublicIpAddressConfiguration object itself. - */ - public VirtualMachineScaleSetPublicIpAddressConfiguration withName(String name) { - this.name = name; - return this; - } - - /** - * Get the innerProperties property: Describes a virtual machines scale set IP Configuration's PublicIPAddress - * configuration. - * - * @return the innerProperties value. - */ - private VirtualMachineScaleSetPublicIpAddressConfigurationProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the idleTimeoutInMinutes property: The idle timeout of the public IP address. - * - * @return the idleTimeoutInMinutes value. - */ - public Integer idleTimeoutInMinutes() { - return this.innerProperties() == null ? null : this.innerProperties().idleTimeoutInMinutes(); - } - - /** - * Set the idleTimeoutInMinutes property: The idle timeout of the public IP address. - * - * @param idleTimeoutInMinutes the idleTimeoutInMinutes value to set. - * @return the VirtualMachineScaleSetPublicIpAddressConfiguration object itself. - */ - public VirtualMachineScaleSetPublicIpAddressConfiguration withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetPublicIpAddressConfigurationProperties(); - } - this.innerProperties().withIdleTimeoutInMinutes(idleTimeoutInMinutes); - return this; - } - - /** - * Get the dnsSettings property: The dns settings to be applied on the publicIP addresses . - * - * @return the dnsSettings value. - */ - public VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings dnsSettings() { - return this.innerProperties() == null ? null : this.innerProperties().dnsSettings(); - } - - /** - * Set the dnsSettings property: The dns settings to be applied on the publicIP addresses . - * - * @param dnsSettings the dnsSettings value to set. - * @return the VirtualMachineScaleSetPublicIpAddressConfiguration object itself. - */ - public VirtualMachineScaleSetPublicIpAddressConfiguration withDnsSettings( - VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings dnsSettings) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetPublicIpAddressConfigurationProperties(); - } - this.innerProperties().withDnsSettings(dnsSettings); - return this; - } - - /** - * Get the ipTags property: The list of IP tags associated with the public IP address. - * - * @return the ipTags value. - */ - public List ipTags() { - return this.innerProperties() == null ? null : this.innerProperties().ipTags(); - } - - /** - * Set the ipTags property: The list of IP tags associated with the public IP address. - * - * @param ipTags the ipTags value to set. - * @return the VirtualMachineScaleSetPublicIpAddressConfiguration object itself. - */ - public VirtualMachineScaleSetPublicIpAddressConfiguration withIpTags(List ipTags) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetPublicIpAddressConfigurationProperties(); - } - this.innerProperties().withIpTags(ipTags); - return this; - } - - /** - * Get the publicIpPrefix property: The PublicIPPrefix from which to allocate publicIP addresses. - * - * @return the publicIpPrefix value. - */ - public SubResource publicIpPrefix() { - return this.innerProperties() == null ? null : this.innerProperties().publicIpPrefix(); - } - - /** - * Set the publicIpPrefix property: The PublicIPPrefix from which to allocate publicIP addresses. - * - * @param publicIpPrefix the publicIpPrefix value to set. - * @return the VirtualMachineScaleSetPublicIpAddressConfiguration object itself. - */ - public VirtualMachineScaleSetPublicIpAddressConfiguration withPublicIpPrefix(SubResource publicIpPrefix) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetPublicIpAddressConfigurationProperties(); - } - this.innerProperties().withPublicIpPrefix(publicIpPrefix); - return this; - } - - /** - * Get the publicIpAddressVersion property: Available from Api-Version 2019-07-01 onwards, it represents whether the - * specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. - * - * @return the publicIpAddressVersion value. - */ - public IpVersion publicIpAddressVersion() { - return this.innerProperties() == null ? null : this.innerProperties().publicIpAddressVersion(); - } - - /** - * Set the publicIpAddressVersion property: Available from Api-Version 2019-07-01 onwards, it represents whether the - * specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. - * - * @param publicIpAddressVersion the publicIpAddressVersion value to set. - * @return the VirtualMachineScaleSetPublicIpAddressConfiguration object itself. - */ - public VirtualMachineScaleSetPublicIpAddressConfiguration withPublicIpAddressVersion( - IpVersion publicIpAddressVersion) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetPublicIpAddressConfigurationProperties(); - } - this.innerProperties().withPublicIpAddressVersion(publicIpAddressVersion); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property name in model VirtualMachineScaleSetPublicIpAddressConfiguration")); - } - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings.java deleted file mode 100644 index 9b7ebe3f6eed..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describes a virtual machines scale sets network configuration's DNS settings. */ -@Fluent -public final class VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings { - @JsonIgnore - private final ClientLogger logger = - new ClientLogger(VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings.class); - - /* - * The Domain name label.The concatenation of the domain name label and vm - * index will be the domain name labels of the PublicIPAddress resources - * that will be created - */ - @JsonProperty(value = "domainNameLabel", required = true) - private String domainNameLabel; - - /** - * Get the domainNameLabel property: The Domain name label.The concatenation of the domain name label and vm index - * will be the domain name labels of the PublicIPAddress resources that will be created. - * - * @return the domainNameLabel value. - */ - public String domainNameLabel() { - return this.domainNameLabel; - } - - /** - * Set the domainNameLabel property: The Domain name label.The concatenation of the domain name label and vm index - * will be the domain name labels of the PublicIPAddress resources that will be created. - * - * @param domainNameLabel the domainNameLabel value to set. - * @return the VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings object itself. - */ - public VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings withDomainNameLabel(String domainNameLabel) { - this.domainNameLabel = domainNameLabel; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (domainNameLabel() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property domainNameLabel in model" - + " VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetReimageParameters.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetReimageParameters.java deleted file mode 100644 index 400e94f9d7e7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetReimageParameters.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Describes a Virtual Machine Scale Set VM Reimage Parameters. */ -@Fluent -public final class VirtualMachineScaleSetReimageParameters extends VirtualMachineScaleSetVMReimageParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetReimageParameters.class); - - /* - * The virtual machine scale set instance ids. Omitting the virtual machine - * scale set instance ids will result in the operation being performed on - * all virtual machines in the virtual machine scale set. - */ - @JsonProperty(value = "instanceIds") - private List instanceIds; - - /** - * Get the instanceIds property: The virtual machine scale set instance ids. Omitting the virtual machine scale set - * instance ids will result in the operation being performed on all virtual machines in the virtual machine scale - * set. - * - * @return the instanceIds value. - */ - public List instanceIds() { - return this.instanceIds; - } - - /** - * Set the instanceIds property: The virtual machine scale set instance ids. Omitting the virtual machine scale set - * instance ids will result in the operation being performed on all virtual machines in the virtual machine scale - * set. - * - * @param instanceIds the instanceIds value to set. - * @return the VirtualMachineScaleSetReimageParameters object itself. - */ - public VirtualMachineScaleSetReimageParameters withInstanceIds(List instanceIds) { - this.instanceIds = instanceIds; - return this; - } - - /** {@inheritDoc} */ - @Override - public VirtualMachineScaleSetReimageParameters withTempDisk(Boolean tempDisk) { - super.withTempDisk(tempDisk); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetScaleInRules.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetScaleInRules.java deleted file mode 100644 index a99ca0eb2565..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetScaleInRules.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for VirtualMachineScaleSetScaleInRules. */ -public final class VirtualMachineScaleSetScaleInRules extends ExpandableStringEnum { - /** Static value Default for VirtualMachineScaleSetScaleInRules. */ - public static final VirtualMachineScaleSetScaleInRules DEFAULT = fromString("Default"); - - /** Static value OldestVM for VirtualMachineScaleSetScaleInRules. */ - public static final VirtualMachineScaleSetScaleInRules OLDEST_VM = fromString("OldestVM"); - - /** Static value NewestVM for VirtualMachineScaleSetScaleInRules. */ - public static final VirtualMachineScaleSetScaleInRules NEWEST_VM = fromString("NewestVM"); - - /** - * Creates or finds a VirtualMachineScaleSetScaleInRules from its string representation. - * - * @param name a name to look for. - * @return the corresponding VirtualMachineScaleSetScaleInRules. - */ - @JsonCreator - public static VirtualMachineScaleSetScaleInRules fromString(String name) { - return fromString(name, VirtualMachineScaleSetScaleInRules.class); - } - - /** @return known VirtualMachineScaleSetScaleInRules values. */ - public static Collection values() { - return values(VirtualMachineScaleSetScaleInRules.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetSku.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetSku.java deleted file mode 100644 index 45e89c830b80..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetSku.java +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; - -/** A type representing a SKU available for virtual machines in a scale set. */ -@Fluent -public interface VirtualMachineScaleSetSku { - /** @return the type of resource the SKU applies to */ - String resourceType(); - - /** @return the SKU type */ - VirtualMachineScaleSetSkuTypes skuType(); - - /** @return available scaling information */ - VirtualMachineScaleSetSkuCapacity capacity(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetSkuCapacity.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetSkuCapacity.java deleted file mode 100644 index ae5ae67f9aa4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetSkuCapacity.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describes scaling information of a sku. */ -@Immutable -public final class VirtualMachineScaleSetSkuCapacity { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetSkuCapacity.class); - - /* - * The minimum capacity. - */ - @JsonProperty(value = "minimum", access = JsonProperty.Access.WRITE_ONLY) - private Long minimum; - - /* - * The maximum capacity that can be set. - */ - @JsonProperty(value = "maximum", access = JsonProperty.Access.WRITE_ONLY) - private Long maximum; - - /* - * The default capacity. - */ - @JsonProperty(value = "defaultCapacity", access = JsonProperty.Access.WRITE_ONLY) - private Long defaultCapacity; - - /* - * The scale type applicable to the sku. - */ - @JsonProperty(value = "scaleType", access = JsonProperty.Access.WRITE_ONLY) - private VirtualMachineScaleSetSkuScaleType scaleType; - - /** - * Get the minimum property: The minimum capacity. - * - * @return the minimum value. - */ - public Long minimum() { - return this.minimum; - } - - /** - * Get the maximum property: The maximum capacity that can be set. - * - * @return the maximum value. - */ - public Long maximum() { - return this.maximum; - } - - /** - * Get the defaultCapacity property: The default capacity. - * - * @return the defaultCapacity value. - */ - public Long defaultCapacity() { - return this.defaultCapacity; - } - - /** - * Get the scaleType property: The scale type applicable to the sku. - * - * @return the scaleType value. - */ - public VirtualMachineScaleSetSkuScaleType scaleType() { - return this.scaleType; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetSkuScaleType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetSkuScaleType.java deleted file mode 100644 index b5271ce71239..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetSkuScaleType.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for VirtualMachineScaleSetSkuScaleType. */ -public enum VirtualMachineScaleSetSkuScaleType { - /** Enum value Automatic. */ - AUTOMATIC("Automatic"), - - /** Enum value None. */ - NONE("None"); - - /** The actual serialized value for a VirtualMachineScaleSetSkuScaleType instance. */ - private final String value; - - VirtualMachineScaleSetSkuScaleType(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a VirtualMachineScaleSetSkuScaleType instance. - * - * @param value the serialized value to parse. - * @return the parsed VirtualMachineScaleSetSkuScaleType object, or null if unable to parse. - */ - @JsonCreator - public static VirtualMachineScaleSetSkuScaleType fromString(String value) { - VirtualMachineScaleSetSkuScaleType[] items = VirtualMachineScaleSetSkuScaleType.values(); - for (VirtualMachineScaleSetSkuScaleType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetSkuTypes.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetSkuTypes.java deleted file mode 100644 index feea4364cc7d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetSkuTypes.java +++ /dev/null @@ -1,367 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.models; - -import java.util.Collection; -import java.util.HashMap; -import java.util.Locale; -import java.util.Map; - -/** Scale set virtual machine SKU types. */ -// TODO: This should be called VirtualMachineScaleSetSkuType in the future (compat break from 1.0) -public class VirtualMachineScaleSetSkuTypes { - // This needs to be at the beginning for the initialization to happen correctly - private static final Map VALUES_BY_NAME = new HashMap<>(); - - /** Static value Standard_A0 for VirtualMachineScaleSetSkuTypes. */ - public static final VirtualMachineScaleSetSkuTypes STANDARD_A0 = - new VirtualMachineScaleSetSkuTypes("Standard_A0", "Standard"); - - /** Static value Standard_A1 for VirtualMachineScaleSetSkuTypes. */ - public static final VirtualMachineScaleSetSkuTypes STANDARD_A1 = - new VirtualMachineScaleSetSkuTypes("Standard_A1", "Standard"); - - /** Static value Standard_A2 for VirtualMachineScaleSetSkuTypes. */ - public static final VirtualMachineScaleSetSkuTypes STANDARD_A2 = - new VirtualMachineScaleSetSkuTypes("Standard_A2", "Standard"); - - /** Static value Standard_A3 for VirtualMachineScaleSetSkuTypes. */ - public static final VirtualMachineScaleSetSkuTypes STANDARD_A3 = - new VirtualMachineScaleSetSkuTypes("Standard_A3", "Standard"); - - /** Static value Standard_A4 for VirtualMachineScaleSetSkuTypes. */ - public static final VirtualMachineScaleSetSkuTypes STANDARD_A4 = - new VirtualMachineScaleSetSkuTypes("Standard_A4", "Standard"); - - /** Static value Standard_A5 for VirtualMachineScaleSetSkuTypes. */ - public static final VirtualMachineScaleSetSkuTypes STANDARD_A5 = - new VirtualMachineScaleSetSkuTypes("Standard_A5", "Standard"); - - /** Static value Standard_A6 for VirtualMachineScaleSetSkuTypes. */ - public static final VirtualMachineScaleSetSkuTypes STANDARD_A6 = - new VirtualMachineScaleSetSkuTypes("Standard_A6", "Standard"); - - /** Static value Standard_A7 for VirtualMachineScaleSetSkuTypes. */ - public static final VirtualMachineScaleSetSkuTypes STANDARD_A7 = - new VirtualMachineScaleSetSkuTypes("Standard_A7", "Standard"); - - /** Static value Standard_A8 for VirtualMachineScaleSetSkuTypes. */ - public static final VirtualMachineScaleSetSkuTypes STANDARD_A8 = - new VirtualMachineScaleSetSkuTypes("Standard_A8", "Standard"); - - /** Static value Standard_A9 for VirtualMachineScaleSetSkuTypes. */ - public static final VirtualMachineScaleSetSkuTypes STANDARD_A9 = - new VirtualMachineScaleSetSkuTypes("Standard_A9", "Standard"); - - /** Static value Standard_A10 for VirtualMachineScaleSetSkuTypes. */ - public static final VirtualMachineScaleSetSkuTypes STANDARD_A10 = - new VirtualMachineScaleSetSkuTypes("Standard_A10", "Standard"); - - /** Static value Standard_A11 for VirtualMachineScaleSetSkuTypes. */ - public static final VirtualMachineScaleSetSkuTypes STANDARD_A11 = - new VirtualMachineScaleSetSkuTypes("Standard_A11", "Standard"); - - /** Static value Standard_D1 for VirtualMachineScaleSetSkuTypes. */ - public static final VirtualMachineScaleSetSkuTypes STANDARD_D1 = - new VirtualMachineScaleSetSkuTypes("Standard_D1", "Standard"); - - /** Static value Standard_D2 for VirtualMachineScaleSetSkuTypes. */ - public static final VirtualMachineScaleSetSkuTypes STANDARD_D2 = - new VirtualMachineScaleSetSkuTypes("Standard_D2", "Standard"); - - /** Static value Standard_D3 for VirtualMachineScaleSetSkuTypes. */ - public static final VirtualMachineScaleSetSkuTypes STANDARD_D3 = - new VirtualMachineScaleSetSkuTypes("Standard_D3", "Standard"); - - /** Static value Standard_D4 for VirtualMachineScaleSetSkuTypes. */ - public static final VirtualMachineScaleSetSkuTypes STANDARD_D4 = - new VirtualMachineScaleSetSkuTypes("Standard_D4", "Standard"); - - /** Static value Standard_D11 for VirtualMachineScaleSetSkuTypes. */ - public static final VirtualMachineScaleSetSkuTypes STANDARD_D11 = - new VirtualMachineScaleSetSkuTypes("Standard_D11", "Standard"); - - /** Static value Standard_D12 for VirtualMachineScaleSetSkuTypes. */ - public static final VirtualMachineScaleSetSkuTypes STANDARD_D12 = - new VirtualMachineScaleSetSkuTypes("Standard_D12", "Standard"); - - /** Static value Standard_D13 for VirtualMachineScaleSetSkuTypes. */ - public static final VirtualMachineScaleSetSkuTypes STANDARD_D13 = - new VirtualMachineScaleSetSkuTypes("Standard_D13", "Standard"); - - /** Static value Standard_D14 for VirtualMachineScaleSetSkuTypes. */ - public static final VirtualMachineScaleSetSkuTypes STANDARD_D14 = - new VirtualMachineScaleSetSkuTypes("Standard_D14", "Standard"); - - /** Static value Standard_D1_v2 for VirtualMachineScaleSetSkuTypes. */ - public static final VirtualMachineScaleSetSkuTypes STANDARD_D1_V2 = - new VirtualMachineScaleSetSkuTypes("Standard_D1_v2", "Standard"); - - /** Static value Standard_D2_v2 for VirtualMachineScaleSetSkuTypes. */ - public static final VirtualMachineScaleSetSkuTypes STANDARD_D2_V2 = - new VirtualMachineScaleSetSkuTypes("Standard_D2_v2", "Standard"); - - /** Static value Standard_D3_v2 for VirtualMachineScaleSetSkuTypes. */ - public static final VirtualMachineScaleSetSkuTypes STANDARD_D3_V2 = - new VirtualMachineScaleSetSkuTypes("Standard_D3_v2", "Standard"); - - /** Static value Standard_D4_v2 for VirtualMachineScaleSetSkuTypes. */ - public static final VirtualMachineScaleSetSkuTypes STANDARD_D4_V2 = - new VirtualMachineScaleSetSkuTypes("Standard_D4_v2", "Standard"); - - /** Static value Standard_D5_v2 for VirtualMachineScaleSetSkuTypes. */ - public static final VirtualMachineScaleSetSkuTypes STANDARD_D5_V2 = - new VirtualMachineScaleSetSkuTypes("Standard_D5_v2", "Standard"); - - /** Static value Standard_D11_v2 for VirtualMachineScaleSetSkuTypes. */ - public static final VirtualMachineScaleSetSkuTypes STANDARD_D11_V2 = - new VirtualMachineScaleSetSkuTypes("Standard_D11_v2", "Standard"); - - /** Static value Standard_D12_v2 for VirtualMachineScaleSetSkuTypes. */ - public static final VirtualMachineScaleSetSkuTypes STANDARD_D12_V2 = - new VirtualMachineScaleSetSkuTypes("Standard_D12_v2", "Standard"); - - /** Static value Standard_D13_v2 for VirtualMachineScaleSetSkuTypes. */ - public static final VirtualMachineScaleSetSkuTypes STANDARD_D13_V2 = - new VirtualMachineScaleSetSkuTypes("Standard_D13_v2", "Standard"); - - /** Static value Standard_D14_v2 for VirtualMachineScaleSetSkuTypes. */ - public static final VirtualMachineScaleSetSkuTypes STANDARD_D14_V2 = - new VirtualMachineScaleSetSkuTypes("Standard_D14_v2", "Standard"); - - /** Static value Standard_D15_v2 for VirtualMachineScaleSetSkuTypes. */ - public static final VirtualMachineScaleSetSkuTypes STANDARD_D15_V2 = - new VirtualMachineScaleSetSkuTypes("Standard_D15_v2", "Standard"); - - /** Static value Standard_DS1 for VirtualMachineScaleSetSkuTypes. */ - public static final VirtualMachineScaleSetSkuTypes STANDARD_DS1 = - new VirtualMachineScaleSetSkuTypes("Standard_DS1", "Standard"); - - /** Static value Standard_DS2 for VirtualMachineScaleSetSkuTypes. */ - public static final VirtualMachineScaleSetSkuTypes STANDARD_DS2 = - new VirtualMachineScaleSetSkuTypes("Standard_DS2", "Standard"); - - /** Static value Standard_DS3 for VirtualMachineScaleSetSkuTypes. */ - public static final VirtualMachineScaleSetSkuTypes STANDARD_DS3 = - new VirtualMachineScaleSetSkuTypes("Standard_DS3", "Standard"); - - /** Static value Standard_DS4 for VirtualMachineScaleSetSkuTypes. */ - public static final VirtualMachineScaleSetSkuTypes STANDARD_DS4 = - new VirtualMachineScaleSetSkuTypes("Standard_DS4", "Standard"); - - /** Static value Standard_DS11 for VirtualMachineScaleSetSkuTypes. */ - public static final VirtualMachineScaleSetSkuTypes STANDARD_DS11 = - new VirtualMachineScaleSetSkuTypes("Standard_DS11", "Standard"); - - /** Static value Standard_DS12 for VirtualMachineScaleSetSkuTypes. */ - public static final VirtualMachineScaleSetSkuTypes STANDARD_DS12 = - new VirtualMachineScaleSetSkuTypes("Standard_DS12", "Standard"); - - /** Static value Standard_DS13 for VirtualMachineScaleSetSkuTypes. */ - public static final VirtualMachineScaleSetSkuTypes STANDARD_DS13 = - new VirtualMachineScaleSetSkuTypes("Standard_DS13", "Standard"); - - /** Static value Standard_DS14 for VirtualMachineScaleSetSkuTypes. */ - public static final VirtualMachineScaleSetSkuTypes STANDARD_DS14 = - new VirtualMachineScaleSetSkuTypes("Standard_DS14", "Standard"); - - /** Static value Standard_DS1_v2 for VirtualMachineScaleSetSkuTypes. */ - public static final VirtualMachineScaleSetSkuTypes STANDARD_DS1_V2 = - new VirtualMachineScaleSetSkuTypes("Standard_DS1_v2", "Standard"); - - /** Static value Standard_DS2_v2 for VirtualMachineScaleSetSkuTypes. */ - public static final VirtualMachineScaleSetSkuTypes STANDARD_DS2_V2 = - new VirtualMachineScaleSetSkuTypes("Standard_DS2_v2", "Standard"); - - /** Static value Standard_DS3_v2 for VirtualMachineScaleSetSkuTypes. */ - public static final VirtualMachineScaleSetSkuTypes STANDARD_DS3_V2 = - new VirtualMachineScaleSetSkuTypes("Standard_DS3_v2", "Standard"); - - /** Static value Standard_DS4_v2 for VirtualMachineScaleSetSkuTypes. */ - public static final VirtualMachineScaleSetSkuTypes STANDARD_DS4_V2 = - new VirtualMachineScaleSetSkuTypes("Standard_DS4_v2", "Standard"); - - /** Static value Standard_DS5_v2 for VirtualMachineScaleSetSkuTypes. */ - public static final VirtualMachineScaleSetSkuTypes STANDARD_DS5_V2 = - new VirtualMachineScaleSetSkuTypes("Standard_DS5_v2", "Standard"); - - /** Static value Standard_DS11_v2 for VirtualMachineScaleSetSkuTypes. */ - public static final VirtualMachineScaleSetSkuTypes STANDARD_DS11_V2 = - new VirtualMachineScaleSetSkuTypes("Standard_DS11_v2", "Standard"); - - /** Static value Standard_DS12_v2 for VirtualMachineScaleSetSkuTypes. */ - public static final VirtualMachineScaleSetSkuTypes STANDARD_DS12_V2 = - new VirtualMachineScaleSetSkuTypes("Standard_DS12_v2", "Standard"); - - /** Static value Standard_DS13_v2 for VirtualMachineScaleSetSkuTypes. */ - public static final VirtualMachineScaleSetSkuTypes STANDARD_DS13_V2 = - new VirtualMachineScaleSetSkuTypes("Standard_DS13_v2", "Standard"); - - /** Static value Standard_DS14_v2 for VirtualMachineScaleSetSkuTypes. */ - public static final VirtualMachineScaleSetSkuTypes STANDARD_DS14_V2 = - new VirtualMachineScaleSetSkuTypes("Standard_DS14_v2", "Standard"); - - /** Static value Standard_DS15_v2 for VirtualMachineScaleSetSkuTypes. */ - public static final VirtualMachineScaleSetSkuTypes STANDARD_DS15_V2 = - new VirtualMachineScaleSetSkuTypes("Standard_DS15_v2", "Standard"); - - /** Static value STANDARD_F1S for VirtualMachineScaleSetSkuTypes. */ - public static final VirtualMachineScaleSetSkuTypes STANDARD_F1S = - new VirtualMachineScaleSetSkuTypes("STANDARD_F1S", "Standard"); - - /** Static value STANDARD_F2S for VirtualMachineScaleSetSkuTypes. */ - public static final VirtualMachineScaleSetSkuTypes STANDARD_F2S = - new VirtualMachineScaleSetSkuTypes("STANDARD_F2S", "Standard"); - - /** Static value STANDARD_F4S for VirtualMachineScaleSetSkuTypes. */ - public static final VirtualMachineScaleSetSkuTypes STANDARD_F4S = - new VirtualMachineScaleSetSkuTypes("STANDARD_F4S", "Standard"); - - /** Static value STANDARD_F8S for VirtualMachineScaleSetSkuTypes. */ - public static final VirtualMachineScaleSetSkuTypes STANDARD_F8S = - new VirtualMachineScaleSetSkuTypes("STANDARD_F8S", "Standard"); - - /** Static value STANDARD_F16S for VirtualMachineScaleSetSkuTypes. */ - public static final VirtualMachineScaleSetSkuTypes STANDARD_F16S = - new VirtualMachineScaleSetSkuTypes("STANDARD_F16S", "Standard"); - - /** Static value STANDARD_F1 for VirtualMachineScaleSetSkuTypes. */ - public static final VirtualMachineScaleSetSkuTypes STANDARD_F1 = - new VirtualMachineScaleSetSkuTypes("STANDARD_F1", "Standard"); - - /** Static value STANDARD_F2 for VirtualMachineScaleSetSkuTypes. */ - public static final VirtualMachineScaleSetSkuTypes STANDARD_F2 = - new VirtualMachineScaleSetSkuTypes("STANDARD_F2", "Standard"); - - /** Static value STANDARD_F4 for VirtualMachineScaleSetSkuTypes. */ - public static final VirtualMachineScaleSetSkuTypes STANDARD_F4 = - new VirtualMachineScaleSetSkuTypes("STANDARD_F4", "Standard"); - - /** Static value STANDARD_F8 for VirtualMachineScaleSetSkuTypes. */ - public static final VirtualMachineScaleSetSkuTypes STANDARD_F8 = - new VirtualMachineScaleSetSkuTypes("STANDARD_F8", "Standard"); - - /** Static value STANDARD_F16 for VirtualMachineScaleSetSkuTypes. */ - public static final VirtualMachineScaleSetSkuTypes STANDARD_F16 = - new VirtualMachineScaleSetSkuTypes("STANDARD_F16", "Standard"); - - /** the SKU corresponding to this size. */ - private final Sku sku; - - /** The string value of the SKU. */ - private final String value; - - /** @return predefined virtual machine scale set SKU types */ - public static VirtualMachineScaleSetSkuTypes[] values() { - Collection valuesCollection = VALUES_BY_NAME.values(); - return valuesCollection.toArray(new VirtualMachineScaleSetSkuTypes[valuesCollection.size()]); - } - - /** - * Creates a custom value for VirtualMachineSizeTypes. - * - * @param skuName a SKU name - * @param skuTier a SKU tier - */ - public VirtualMachineScaleSetSkuTypes(String skuName, String skuTier) { - // TODO: This constructor should really be private - this(new Sku().withName(skuName).withTier(skuTier)); - } - - /** - * Creates a custom value for VirtualMachineSizeTypes. - * - * @param sku the SKU - */ - public VirtualMachineScaleSetSkuTypes(Sku sku) { - // TODO: This constructor should really be private - // Store Sku copy since original user provided sku can be modified - // by the user. - // - this.sku = createCopy(sku); - if (this.sku.tier() == null) { - this.value = this.sku.name(); - } else { - this.value = this.sku.name() + '_' + this.sku.tier(); - } - VALUES_BY_NAME.put(this.value.toLowerCase(Locale.ROOT), this); - } - - /** - * Parses a SKU into a VMSS SKU type and creates a new VirtualMachineScaleSetSkuType instance if not found among the - * existing ones. - * - * @param sku a VMSS SKU - * @return the parsed or created VMSS SKU type - */ - public static VirtualMachineScaleSetSkuTypes fromSku(Sku sku) { - if (sku == null) { - return null; - } - - String nameToLookFor = sku.name(); - if (sku.tier() != null) { - nameToLookFor += '_' + sku.tier(); - } - - VirtualMachineScaleSetSkuTypes result = VALUES_BY_NAME.get(nameToLookFor.toLowerCase(Locale.ROOT)); - if (result != null) { - return result; - } else { - return new VirtualMachineScaleSetSkuTypes(sku); - } - } - - /** - * Parses into a VMSS SKU type and creates a new VMSS SKU type instance if not found among the existing ones. - * - * @param skuName a SKU name - * @param skuTier a SKU tier - * @return a VMSS SKU type - */ - public static VirtualMachineScaleSetSkuTypes fromSkuNameAndTier(String skuName, String skuTier) { - return fromSku(new Sku().withName(skuName).withTier(skuTier)); - } - - /** @return the SKU */ - public Sku sku() { - // Return copy of sku to guard VirtualMachineScaleSetSkuTypes from ending up with invalid - // sku in case consumer changes the returned Sku instance. - // - return createCopy(this.sku); - } - - @Override - public String toString() { - return this.value; - } - - @Override - public int hashCode() { - return this.value.hashCode(); - } - - @Override - public boolean equals(Object obj) { - if (!(obj instanceof VirtualMachineScaleSetSkuTypes)) { - return false; - } else if (obj == this) { - return true; - } else if (value == null) { - return ((VirtualMachineScaleSetSkuTypes) obj).value == null; - } else { - return value.equalsIgnoreCase(((VirtualMachineScaleSetSkuTypes) obj).value); - } - } - - /** - * Creates a copy of the given sku. - * - * @param sku the sku to create copy of - * @return the copy - */ - private static Sku createCopy(Sku sku) { - return new Sku().withName(sku.name()).withTier(sku.tier()).withCapacity(sku.capacity()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetStorageProfile.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetStorageProfile.java deleted file mode 100644 index c387e647e364..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetStorageProfile.java +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Describes a virtual machine scale set storage profile. */ -@Fluent -public final class VirtualMachineScaleSetStorageProfile { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetStorageProfile.class); - - /* - * Specifies information about the image to use. You can specify - * information about platform images, marketplace images, or virtual - * machine images. This element is required when you want to use a platform - * image, marketplace image, or virtual machine image, but is not used in - * other creation operations. - */ - @JsonProperty(value = "imageReference") - private ImageReference imageReference; - - /* - * Specifies information about the operating system disk used by the - * virtual machines in the scale set.

    For more information about - * disks, see [About disks and VHDs for Azure virtual - * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). - */ - @JsonProperty(value = "osDisk") - private VirtualMachineScaleSetOSDisk osDisk; - - /* - * Specifies the parameters that are used to add data disks to the virtual - * machines in the scale set.

    For more information about disks, - * see [About disks and VHDs for Azure virtual - * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). - */ - @JsonProperty(value = "dataDisks") - private List dataDisks; - - /** - * Get the imageReference property: Specifies information about the image to use. You can specify information about - * platform images, marketplace images, or virtual machine images. This element is required when you want to use a - * platform image, marketplace image, or virtual machine image, but is not used in other creation operations. - * - * @return the imageReference value. - */ - public ImageReference imageReference() { - return this.imageReference; - } - - /** - * Set the imageReference property: Specifies information about the image to use. You can specify information about - * platform images, marketplace images, or virtual machine images. This element is required when you want to use a - * platform image, marketplace image, or virtual machine image, but is not used in other creation operations. - * - * @param imageReference the imageReference value to set. - * @return the VirtualMachineScaleSetStorageProfile object itself. - */ - public VirtualMachineScaleSetStorageProfile withImageReference(ImageReference imageReference) { - this.imageReference = imageReference; - return this; - } - - /** - * Get the osDisk property: Specifies information about the operating system disk used by the virtual machines in - * the scale set. <br><br> For more information about disks, see [About disks and VHDs for Azure virtual - * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). - * - * @return the osDisk value. - */ - public VirtualMachineScaleSetOSDisk osDisk() { - return this.osDisk; - } - - /** - * Set the osDisk property: Specifies information about the operating system disk used by the virtual machines in - * the scale set. <br><br> For more information about disks, see [About disks and VHDs for Azure virtual - * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). - * - * @param osDisk the osDisk value to set. - * @return the VirtualMachineScaleSetStorageProfile object itself. - */ - public VirtualMachineScaleSetStorageProfile withOsDisk(VirtualMachineScaleSetOSDisk osDisk) { - this.osDisk = osDisk; - return this; - } - - /** - * Get the dataDisks property: Specifies the parameters that are used to add data disks to the virtual machines in - * the scale set. <br><br> For more information about disks, see [About disks and VHDs for Azure virtual - * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). - * - * @return the dataDisks value. - */ - public List dataDisks() { - return this.dataDisks; - } - - /** - * Set the dataDisks property: Specifies the parameters that are used to add data disks to the virtual machines in - * the scale set. <br><br> For more information about disks, see [About disks and VHDs for Azure virtual - * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). - * - * @param dataDisks the dataDisks value to set. - * @return the VirtualMachineScaleSetStorageProfile object itself. - */ - public VirtualMachineScaleSetStorageProfile withDataDisks(List dataDisks) { - this.dataDisks = dataDisks; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (imageReference() != null) { - imageReference().validate(); - } - if (osDisk() != null) { - osDisk().validate(); - } - if (dataDisks() != null) { - dataDisks().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetUnmanagedDataDisk.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetUnmanagedDataDisk.java deleted file mode 100644 index 8e8727ec448f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetUnmanagedDataDisk.java +++ /dev/null @@ -1,241 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.arm.models.ChildResource; -import com.azure.resourcemanager.resources.fluentcore.model.Attachable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.model.Settable; - -/** Describes definition and update stages of unmanaged data disk of a scale set. */ -@Fluent -public interface VirtualMachineScaleSetUnmanagedDataDisk - extends HasInnerModel, ChildResource { - - /** Grouping of unmanaged data disk definition stages applicable as part of a virtual machine scale set creation. */ - interface DefinitionStages { - /** - * The first stage of a unmanaged data disk definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface Blank extends WithDiskSource { - } - - /** - * The stage of the unmanaged data disk definition allowing to choose the source. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithDiskSource { - /** - * specifies that unmanaged disk needs to be created with a new VHD of given size. - * - * @param sizeInGB the initial disk size in GB - * @return the next stage of unmanaged data disk definition - */ - WithNewVhdDiskSettings withNewVhd(int sizeInGB); - - /** - * Specifies the image LUN identifier of the source disk image. - * - * @param imageLun the LUN - * @return the next stage of unmanaged data disk definition - */ - WithFromImageDiskSettings fromImage(int imageLun); - } - - /** - * The stage that allows configure the unmanaged disk based on new VHD. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithNewVhdDiskSettings extends WithAttach { - /** - * Specifies the logical unit number for the unmanaged data disk. - * - * @param lun the logical unit number - * @return the next stage of unmanaged data disk definition - */ - WithNewVhdDiskSettings withLun(Integer lun); - - /** - * Specifies the caching type for the unmanaged data disk. - * - * @param cachingType the disk caching type. Possible values include: 'None', 'ReadOnly', 'ReadWrite' - * @return the next stage of unmanaged data disk definition - */ - WithNewVhdDiskSettings withCaching(CachingTypes cachingType); - } - - /** - * The stage that allows configure the unmanaged disk based on an image. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithFromImageDiskSettings extends WithAttach { - /** - * Specifies the size in GB the unmanaged disk needs to be resized. - * - * @param sizeInGB the disk size in GB - * @return the next stage of unmanaged data disk definition - */ - WithFromImageDiskSettings withSizeInGB(Integer sizeInGB); - - /** - * Specifies the caching type for the unmanaged data disk. - * - * @param cachingType the disk caching type. Possible values include: 'None', 'ReadOnly', 'ReadWrite' - * @return the next stage of unmanaged data disk definition - */ - WithFromImageDiskSettings withCaching(CachingTypes cachingType); - } - - /** - * The final stage of the unmanaged data disk definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithAttach extends Attachable.InDefinition { - } - } - - /** - * The entirety of a unmanaged data disk of a virtual machine scale set definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface DefinitionWithNewVhd - extends DefinitionStages.Blank, - DefinitionStages.WithDiskSource, - DefinitionStages.WithNewVhdDiskSettings, - DefinitionStages.WithAttach { - } - - /** - * The entirety of a unmanaged data disk of a virtual machine scale set definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface DefinitionWithImage - extends DefinitionStages.Blank, - DefinitionStages.WithDiskSource, - DefinitionStages.WithFromImageDiskSettings, - DefinitionStages.WithAttach { - } - - /** Grouping of unamanged data disk definition stages applicable as part of a virtual machine scale set update. */ - interface UpdateDefinitionStages { - /** - * The first stage of a unmanaged data disk definition. - * - * @param the stage of the parent update to return to after attaching this definition - */ - interface Blank extends WithDiskSource { - } - - /** - * The stage of the unmanaged data disk definition allowing to choose the source. - * - * @param the stage of the parent update to return to after attaching this definition - */ - interface WithDiskSource { - /** - * specifies that unmanaged disk needs to be created with a new VHD of given size. - * - * @param sizeInGB the initial disk size in GB - * @return the next stage of unmanaged data disk definition - */ - WithNewVhdDiskSettings withNewVhd(int sizeInGB); - } - - /** - * The stage that allows configure the unmanaged disk based on new VHD. - * - * @param the stage of the parent update to return to after attaching this definition - */ - interface WithNewVhdDiskSettings extends WithAttach { - /** - * Specifies the logical unit number for the unmanaged data disk. - * - * @param lun the logical unit number - * @return the next stage of unmanaged data disk definition - */ - WithNewVhdDiskSettings withLun(Integer lun); - - /** - * Specifies the caching type for the unmanaged data disk. - * - * @param cachingType the disk caching type. Possible values include: 'None', 'ReadOnly', 'ReadWrite' - * @return the next stage of unmanaged data disk definition - */ - WithNewVhdDiskSettings withCaching(CachingTypes cachingType); - } - - /** - * The final stage of the unmanaged data disk definition. - * - * @param the stage of the parent update to return to after attaching this definition - */ - interface WithAttach extends Attachable.InUpdate { - } - } - - /** - * The entirety of a unmanaged data disk of a virtual machine scale set definition. - * - * @param the stage of the parent update to return to after attaching this definition - */ - interface UpdateDefinition - extends UpdateDefinitionStages.Blank, - UpdateDefinitionStages.WithDiskSource, - UpdateDefinitionStages.WithNewVhdDiskSettings, - UpdateDefinitionStages.WithAttach { - } - - /** Grouping of unmanaged data disk update stages. */ - interface UpdateStages { - /** The stage of the unmanaged data disk update allowing to set the disk size. */ - interface WithDiskSize { - /** - * Specifies the new size in GB for data disk. - * - * @param sizeInGB the disk size in GB - * @return the next stage of unmanaged data disk update - */ - Update withSizeInGB(Integer sizeInGB); - } - - /** The stage of the unmanaged data disk update allowing to set the disk LUN. */ - interface WithDiskLun { - /** - * Specifies the new logical unit number for the unmanaged data disk. - * - * @param lun the logical unit number - * @return the next stage of unmanaged data disk update - */ - Update withLun(Integer lun); - } - - /** The stage of the unmanaged data disk update allowing to set the disk caching type. */ - interface WithDiskCaching { - /** - * Specifies the new caching type for the unmanaged data disk. - * - * @param cachingType the disk caching type. Possible values include: 'None', 'ReadOnly', 'ReadWrite' - * @return the next stage of unmanaged data disk update - */ - Update withCaching(CachingTypes cachingType); - } - } - - /** The entirety of a unmanaged data disk update as part of a virtual machine scale set update. */ - interface Update - extends UpdateStages.WithDiskSize, - UpdateStages.WithDiskLun, - UpdateStages.WithDiskCaching, - Settable { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetUpdate.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetUpdate.java deleted file mode 100644 index f0c3be292be9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetUpdate.java +++ /dev/null @@ -1,367 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineScaleSetUpdateProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** Describes a Virtual Machine Scale Set. */ -@Fluent -public final class VirtualMachineScaleSetUpdate extends UpdateResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetUpdate.class); - - /* - * The virtual machine scale set sku. - */ - @JsonProperty(value = "sku") - private Sku sku; - - /* - * The purchase plan when deploying a virtual machine scale set from VM - * Marketplace images. - */ - @JsonProperty(value = "plan") - private Plan plan; - - /* - * Describes the properties of a Virtual Machine Scale Set. - */ - @JsonProperty(value = "properties") - private VirtualMachineScaleSetUpdateProperties innerProperties; - - /* - * The identity of the virtual machine scale set, if configured. - */ - @JsonProperty(value = "identity") - private VirtualMachineScaleSetIdentity identity; - - /** - * Get the sku property: The virtual machine scale set sku. - * - * @return the sku value. - */ - public Sku sku() { - return this.sku; - } - - /** - * Set the sku property: The virtual machine scale set sku. - * - * @param sku the sku value to set. - * @return the VirtualMachineScaleSetUpdate object itself. - */ - public VirtualMachineScaleSetUpdate withSku(Sku sku) { - this.sku = sku; - return this; - } - - /** - * Get the plan property: The purchase plan when deploying a virtual machine scale set from VM Marketplace images. - * - * @return the plan value. - */ - public Plan plan() { - return this.plan; - } - - /** - * Set the plan property: The purchase plan when deploying a virtual machine scale set from VM Marketplace images. - * - * @param plan the plan value to set. - * @return the VirtualMachineScaleSetUpdate object itself. - */ - public VirtualMachineScaleSetUpdate withPlan(Plan plan) { - this.plan = plan; - return this; - } - - /** - * Get the innerProperties property: Describes the properties of a Virtual Machine Scale Set. - * - * @return the innerProperties value. - */ - private VirtualMachineScaleSetUpdateProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the identity property: The identity of the virtual machine scale set, if configured. - * - * @return the identity value. - */ - public VirtualMachineScaleSetIdentity identity() { - return this.identity; - } - - /** - * Set the identity property: The identity of the virtual machine scale set, if configured. - * - * @param identity the identity value to set. - * @return the VirtualMachineScaleSetUpdate object itself. - */ - public VirtualMachineScaleSetUpdate withIdentity(VirtualMachineScaleSetIdentity identity) { - this.identity = identity; - return this; - } - - /** {@inheritDoc} */ - @Override - public VirtualMachineScaleSetUpdate withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the upgradePolicy property: The upgrade policy. - * - * @return the upgradePolicy value. - */ - public UpgradePolicy upgradePolicy() { - return this.innerProperties() == null ? null : this.innerProperties().upgradePolicy(); - } - - /** - * Set the upgradePolicy property: The upgrade policy. - * - * @param upgradePolicy the upgradePolicy value to set. - * @return the VirtualMachineScaleSetUpdate object itself. - */ - public VirtualMachineScaleSetUpdate withUpgradePolicy(UpgradePolicy upgradePolicy) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetUpdateProperties(); - } - this.innerProperties().withUpgradePolicy(upgradePolicy); - return this; - } - - /** - * Get the automaticRepairsPolicy property: Policy for automatic repairs. - * - * @return the automaticRepairsPolicy value. - */ - public AutomaticRepairsPolicy automaticRepairsPolicy() { - return this.innerProperties() == null ? null : this.innerProperties().automaticRepairsPolicy(); - } - - /** - * Set the automaticRepairsPolicy property: Policy for automatic repairs. - * - * @param automaticRepairsPolicy the automaticRepairsPolicy value to set. - * @return the VirtualMachineScaleSetUpdate object itself. - */ - public VirtualMachineScaleSetUpdate withAutomaticRepairsPolicy(AutomaticRepairsPolicy automaticRepairsPolicy) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetUpdateProperties(); - } - this.innerProperties().withAutomaticRepairsPolicy(automaticRepairsPolicy); - return this; - } - - /** - * Get the virtualMachineProfile property: The virtual machine profile. - * - * @return the virtualMachineProfile value. - */ - public VirtualMachineScaleSetUpdateVMProfile virtualMachineProfile() { - return this.innerProperties() == null ? null : this.innerProperties().virtualMachineProfile(); - } - - /** - * Set the virtualMachineProfile property: The virtual machine profile. - * - * @param virtualMachineProfile the virtualMachineProfile value to set. - * @return the VirtualMachineScaleSetUpdate object itself. - */ - public VirtualMachineScaleSetUpdate withVirtualMachineProfile( - VirtualMachineScaleSetUpdateVMProfile virtualMachineProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetUpdateProperties(); - } - this.innerProperties().withVirtualMachineProfile(virtualMachineProfile); - return this; - } - - /** - * Get the overprovision property: Specifies whether the Virtual Machine Scale Set should be overprovisioned. - * - * @return the overprovision value. - */ - public Boolean overprovision() { - return this.innerProperties() == null ? null : this.innerProperties().overprovision(); - } - - /** - * Set the overprovision property: Specifies whether the Virtual Machine Scale Set should be overprovisioned. - * - * @param overprovision the overprovision value to set. - * @return the VirtualMachineScaleSetUpdate object itself. - */ - public VirtualMachineScaleSetUpdate withOverprovision(Boolean overprovision) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetUpdateProperties(); - } - this.innerProperties().withOverprovision(overprovision); - return this; - } - - /** - * Get the doNotRunExtensionsOnOverprovisionedVMs property: When Overprovision is enabled, extensions are launched - * only on the requested number of VMs which are finally kept. This property will hence ensure that the extensions - * do not run on the extra overprovisioned VMs. - * - * @return the doNotRunExtensionsOnOverprovisionedVMs value. - */ - public Boolean doNotRunExtensionsOnOverprovisionedVMs() { - return this.innerProperties() == null ? null : this.innerProperties().doNotRunExtensionsOnOverprovisionedVMs(); - } - - /** - * Set the doNotRunExtensionsOnOverprovisionedVMs property: When Overprovision is enabled, extensions are launched - * only on the requested number of VMs which are finally kept. This property will hence ensure that the extensions - * do not run on the extra overprovisioned VMs. - * - * @param doNotRunExtensionsOnOverprovisionedVMs the doNotRunExtensionsOnOverprovisionedVMs value to set. - * @return the VirtualMachineScaleSetUpdate object itself. - */ - public VirtualMachineScaleSetUpdate withDoNotRunExtensionsOnOverprovisionedVMs( - Boolean doNotRunExtensionsOnOverprovisionedVMs) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetUpdateProperties(); - } - this.innerProperties().withDoNotRunExtensionsOnOverprovisionedVMs(doNotRunExtensionsOnOverprovisionedVMs); - return this; - } - - /** - * Get the singlePlacementGroup property: When true this limits the scale set to a single placement group, of max - * size 100 virtual machines. NOTE: If singlePlacementGroup is true, it may be modified to false. However, if - * singlePlacementGroup is false, it may not be modified to true. - * - * @return the singlePlacementGroup value. - */ - public Boolean singlePlacementGroup() { - return this.innerProperties() == null ? null : this.innerProperties().singlePlacementGroup(); - } - - /** - * Set the singlePlacementGroup property: When true this limits the scale set to a single placement group, of max - * size 100 virtual machines. NOTE: If singlePlacementGroup is true, it may be modified to false. However, if - * singlePlacementGroup is false, it may not be modified to true. - * - * @param singlePlacementGroup the singlePlacementGroup value to set. - * @return the VirtualMachineScaleSetUpdate object itself. - */ - public VirtualMachineScaleSetUpdate withSinglePlacementGroup(Boolean singlePlacementGroup) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetUpdateProperties(); - } - this.innerProperties().withSinglePlacementGroup(singlePlacementGroup); - return this; - } - - /** - * Get the additionalCapabilities property: Specifies additional capabilities enabled or disabled on the Virtual - * Machines in the Virtual Machine Scale Set. For instance: whether the Virtual Machines have the capability to - * support attaching managed data disks with UltraSSD_LRS storage account type. - * - * @return the additionalCapabilities value. - */ - public AdditionalCapabilities additionalCapabilities() { - return this.innerProperties() == null ? null : this.innerProperties().additionalCapabilities(); - } - - /** - * Set the additionalCapabilities property: Specifies additional capabilities enabled or disabled on the Virtual - * Machines in the Virtual Machine Scale Set. For instance: whether the Virtual Machines have the capability to - * support attaching managed data disks with UltraSSD_LRS storage account type. - * - * @param additionalCapabilities the additionalCapabilities value to set. - * @return the VirtualMachineScaleSetUpdate object itself. - */ - public VirtualMachineScaleSetUpdate withAdditionalCapabilities(AdditionalCapabilities additionalCapabilities) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetUpdateProperties(); - } - this.innerProperties().withAdditionalCapabilities(additionalCapabilities); - return this; - } - - /** - * Get the scaleInPolicy property: Specifies the scale-in policy that decides which virtual machines are chosen for - * removal when a Virtual Machine Scale Set is scaled-in. - * - * @return the scaleInPolicy value. - */ - public ScaleInPolicy scaleInPolicy() { - return this.innerProperties() == null ? null : this.innerProperties().scaleInPolicy(); - } - - /** - * Set the scaleInPolicy property: Specifies the scale-in policy that decides which virtual machines are chosen for - * removal when a Virtual Machine Scale Set is scaled-in. - * - * @param scaleInPolicy the scaleInPolicy value to set. - * @return the VirtualMachineScaleSetUpdate object itself. - */ - public VirtualMachineScaleSetUpdate withScaleInPolicy(ScaleInPolicy scaleInPolicy) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetUpdateProperties(); - } - this.innerProperties().withScaleInPolicy(scaleInPolicy); - return this; - } - - /** - * Get the proximityPlacementGroup property: Specifies information about the proximity placement group that the - * virtual machine scale set should be assigned to. <br><br>Minimum api-version: 2018-04-01. - * - * @return the proximityPlacementGroup value. - */ - public SubResource proximityPlacementGroup() { - return this.innerProperties() == null ? null : this.innerProperties().proximityPlacementGroup(); - } - - /** - * Set the proximityPlacementGroup property: Specifies information about the proximity placement group that the - * virtual machine scale set should be assigned to. <br><br>Minimum api-version: 2018-04-01. - * - * @param proximityPlacementGroup the proximityPlacementGroup value to set. - * @return the VirtualMachineScaleSetUpdate object itself. - */ - public VirtualMachineScaleSetUpdate withProximityPlacementGroup(SubResource proximityPlacementGroup) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetUpdateProperties(); - } - this.innerProperties().withProximityPlacementGroup(proximityPlacementGroup); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (sku() != null) { - sku().validate(); - } - if (plan() != null) { - plan().validate(); - } - if (innerProperties() != null) { - innerProperties().validate(); - } - if (identity() != null) { - identity().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetUpdateIpConfiguration.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetUpdateIpConfiguration.java deleted file mode 100644 index a3b64d042a42..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetUpdateIpConfiguration.java +++ /dev/null @@ -1,276 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineScaleSetUpdateIpConfigurationProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** - * Describes a virtual machine scale set network profile's IP configuration. NOTE: The subnet of a scale set may be - * modified as long as the original subnet and the new subnet are in the same virtual network. - */ -@Fluent -public final class VirtualMachineScaleSetUpdateIpConfiguration extends SubResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetUpdateIpConfiguration.class); - - /* - * The IP configuration name. - */ - @JsonProperty(value = "name") - private String name; - - /* - * Describes a virtual machine scale set network profile's IP configuration - * properties. - */ - @JsonProperty(value = "properties") - private VirtualMachineScaleSetUpdateIpConfigurationProperties innerProperties; - - /** - * Get the name property: The IP configuration name. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The IP configuration name. - * - * @param name the name value to set. - * @return the VirtualMachineScaleSetUpdateIpConfiguration object itself. - */ - public VirtualMachineScaleSetUpdateIpConfiguration withName(String name) { - this.name = name; - return this; - } - - /** - * Get the innerProperties property: Describes a virtual machine scale set network profile's IP configuration - * properties. - * - * @return the innerProperties value. - */ - private VirtualMachineScaleSetUpdateIpConfigurationProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public VirtualMachineScaleSetUpdateIpConfiguration withId(String id) { - super.withId(id); - return this; - } - - /** - * Get the subnet property: The subnet. - * - * @return the subnet value. - */ - public ApiEntityReference subnet() { - return this.innerProperties() == null ? null : this.innerProperties().subnet(); - } - - /** - * Set the subnet property: The subnet. - * - * @param subnet the subnet value to set. - * @return the VirtualMachineScaleSetUpdateIpConfiguration object itself. - */ - public VirtualMachineScaleSetUpdateIpConfiguration withSubnet(ApiEntityReference subnet) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetUpdateIpConfigurationProperties(); - } - this.innerProperties().withSubnet(subnet); - return this; - } - - /** - * Get the primary property: Specifies the primary IP Configuration in case the network interface has more than one - * IP Configuration. - * - * @return the primary value. - */ - public Boolean primary() { - return this.innerProperties() == null ? null : this.innerProperties().primary(); - } - - /** - * Set the primary property: Specifies the primary IP Configuration in case the network interface has more than one - * IP Configuration. - * - * @param primary the primary value to set. - * @return the VirtualMachineScaleSetUpdateIpConfiguration object itself. - */ - public VirtualMachineScaleSetUpdateIpConfiguration withPrimary(Boolean primary) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetUpdateIpConfigurationProperties(); - } - this.innerProperties().withPrimary(primary); - return this; - } - - /** - * Get the publicIpAddressConfiguration property: The publicIPAddressConfiguration. - * - * @return the publicIpAddressConfiguration value. - */ - public VirtualMachineScaleSetUpdatePublicIpAddressConfiguration publicIpAddressConfiguration() { - return this.innerProperties() == null ? null : this.innerProperties().publicIpAddressConfiguration(); - } - - /** - * Set the publicIpAddressConfiguration property: The publicIPAddressConfiguration. - * - * @param publicIpAddressConfiguration the publicIpAddressConfiguration value to set. - * @return the VirtualMachineScaleSetUpdateIpConfiguration object itself. - */ - public VirtualMachineScaleSetUpdateIpConfiguration withPublicIpAddressConfiguration( - VirtualMachineScaleSetUpdatePublicIpAddressConfiguration publicIpAddressConfiguration) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetUpdateIpConfigurationProperties(); - } - this.innerProperties().withPublicIpAddressConfiguration(publicIpAddressConfiguration); - return this; - } - - /** - * Get the privateIpAddressVersion property: Available from Api-Version 2017-03-30 onwards, it represents whether - * the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. - * - * @return the privateIpAddressVersion value. - */ - public IpVersion privateIpAddressVersion() { - return this.innerProperties() == null ? null : this.innerProperties().privateIpAddressVersion(); - } - - /** - * Set the privateIpAddressVersion property: Available from Api-Version 2017-03-30 onwards, it represents whether - * the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. - * - * @param privateIpAddressVersion the privateIpAddressVersion value to set. - * @return the VirtualMachineScaleSetUpdateIpConfiguration object itself. - */ - public VirtualMachineScaleSetUpdateIpConfiguration withPrivateIpAddressVersion(IpVersion privateIpAddressVersion) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetUpdateIpConfigurationProperties(); - } - this.innerProperties().withPrivateIpAddressVersion(privateIpAddressVersion); - return this; - } - - /** - * Get the applicationGatewayBackendAddressPools property: The application gateway backend address pools. - * - * @return the applicationGatewayBackendAddressPools value. - */ - public List applicationGatewayBackendAddressPools() { - return this.innerProperties() == null ? null : this.innerProperties().applicationGatewayBackendAddressPools(); - } - - /** - * Set the applicationGatewayBackendAddressPools property: The application gateway backend address pools. - * - * @param applicationGatewayBackendAddressPools the applicationGatewayBackendAddressPools value to set. - * @return the VirtualMachineScaleSetUpdateIpConfiguration object itself. - */ - public VirtualMachineScaleSetUpdateIpConfiguration withApplicationGatewayBackendAddressPools( - List applicationGatewayBackendAddressPools) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetUpdateIpConfigurationProperties(); - } - this.innerProperties().withApplicationGatewayBackendAddressPools(applicationGatewayBackendAddressPools); - return this; - } - - /** - * Get the applicationSecurityGroups property: Specifies an array of references to application security group. - * - * @return the applicationSecurityGroups value. - */ - public List applicationSecurityGroups() { - return this.innerProperties() == null ? null : this.innerProperties().applicationSecurityGroups(); - } - - /** - * Set the applicationSecurityGroups property: Specifies an array of references to application security group. - * - * @param applicationSecurityGroups the applicationSecurityGroups value to set. - * @return the VirtualMachineScaleSetUpdateIpConfiguration object itself. - */ - public VirtualMachineScaleSetUpdateIpConfiguration withApplicationSecurityGroups( - List applicationSecurityGroups) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetUpdateIpConfigurationProperties(); - } - this.innerProperties().withApplicationSecurityGroups(applicationSecurityGroups); - return this; - } - - /** - * Get the loadBalancerBackendAddressPools property: The load balancer backend address pools. - * - * @return the loadBalancerBackendAddressPools value. - */ - public List loadBalancerBackendAddressPools() { - return this.innerProperties() == null ? null : this.innerProperties().loadBalancerBackendAddressPools(); - } - - /** - * Set the loadBalancerBackendAddressPools property: The load balancer backend address pools. - * - * @param loadBalancerBackendAddressPools the loadBalancerBackendAddressPools value to set. - * @return the VirtualMachineScaleSetUpdateIpConfiguration object itself. - */ - public VirtualMachineScaleSetUpdateIpConfiguration withLoadBalancerBackendAddressPools( - List loadBalancerBackendAddressPools) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetUpdateIpConfigurationProperties(); - } - this.innerProperties().withLoadBalancerBackendAddressPools(loadBalancerBackendAddressPools); - return this; - } - - /** - * Get the loadBalancerInboundNatPools property: The load balancer inbound nat pools. - * - * @return the loadBalancerInboundNatPools value. - */ - public List loadBalancerInboundNatPools() { - return this.innerProperties() == null ? null : this.innerProperties().loadBalancerInboundNatPools(); - } - - /** - * Set the loadBalancerInboundNatPools property: The load balancer inbound nat pools. - * - * @param loadBalancerInboundNatPools the loadBalancerInboundNatPools value to set. - * @return the VirtualMachineScaleSetUpdateIpConfiguration object itself. - */ - public VirtualMachineScaleSetUpdateIpConfiguration withLoadBalancerInboundNatPools( - List loadBalancerInboundNatPools) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetUpdateIpConfigurationProperties(); - } - this.innerProperties().withLoadBalancerInboundNatPools(loadBalancerInboundNatPools); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetUpdateNetworkConfiguration.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetUpdateNetworkConfiguration.java deleted file mode 100644 index 6eaa31acf943..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetUpdateNetworkConfiguration.java +++ /dev/null @@ -1,248 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineScaleSetUpdateNetworkConfigurationProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Describes a virtual machine scale set network profile's network configurations. */ -@Fluent -public final class VirtualMachineScaleSetUpdateNetworkConfiguration extends SubResource { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetUpdateNetworkConfiguration.class); - - /* - * The network configuration name. - */ - @JsonProperty(value = "name") - private String name; - - /* - * Describes a virtual machine scale set updatable network profile's IP - * configuration.Use this object for updating network profile's IP - * Configuration. - */ - @JsonProperty(value = "properties") - private VirtualMachineScaleSetUpdateNetworkConfigurationProperties innerProperties; - - /** - * Get the name property: The network configuration name. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The network configuration name. - * - * @param name the name value to set. - * @return the VirtualMachineScaleSetUpdateNetworkConfiguration object itself. - */ - public VirtualMachineScaleSetUpdateNetworkConfiguration withName(String name) { - this.name = name; - return this; - } - - /** - * Get the innerProperties property: Describes a virtual machine scale set updatable network profile's IP - * configuration.Use this object for updating network profile's IP Configuration. - * - * @return the innerProperties value. - */ - private VirtualMachineScaleSetUpdateNetworkConfigurationProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public VirtualMachineScaleSetUpdateNetworkConfiguration withId(String id) { - super.withId(id); - return this; - } - - /** - * Get the primary property: Whether this is a primary NIC on a virtual machine. - * - * @return the primary value. - */ - public Boolean primary() { - return this.innerProperties() == null ? null : this.innerProperties().primary(); - } - - /** - * Set the primary property: Whether this is a primary NIC on a virtual machine. - * - * @param primary the primary value to set. - * @return the VirtualMachineScaleSetUpdateNetworkConfiguration object itself. - */ - public VirtualMachineScaleSetUpdateNetworkConfiguration withPrimary(Boolean primary) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetUpdateNetworkConfigurationProperties(); - } - this.innerProperties().withPrimary(primary); - return this; - } - - /** - * Get the enableAcceleratedNetworking property: Specifies whether the network interface is accelerated - * networking-enabled. - * - * @return the enableAcceleratedNetworking value. - */ - public Boolean enableAcceleratedNetworking() { - return this.innerProperties() == null ? null : this.innerProperties().enableAcceleratedNetworking(); - } - - /** - * Set the enableAcceleratedNetworking property: Specifies whether the network interface is accelerated - * networking-enabled. - * - * @param enableAcceleratedNetworking the enableAcceleratedNetworking value to set. - * @return the VirtualMachineScaleSetUpdateNetworkConfiguration object itself. - */ - public VirtualMachineScaleSetUpdateNetworkConfiguration withEnableAcceleratedNetworking( - Boolean enableAcceleratedNetworking) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetUpdateNetworkConfigurationProperties(); - } - this.innerProperties().withEnableAcceleratedNetworking(enableAcceleratedNetworking); - return this; - } - - /** - * Get the enableFpga property: Specifies whether the network interface is FPGA networking-enabled. - * - * @return the enableFpga value. - */ - public Boolean enableFpga() { - return this.innerProperties() == null ? null : this.innerProperties().enableFpga(); - } - - /** - * Set the enableFpga property: Specifies whether the network interface is FPGA networking-enabled. - * - * @param enableFpga the enableFpga value to set. - * @return the VirtualMachineScaleSetUpdateNetworkConfiguration object itself. - */ - public VirtualMachineScaleSetUpdateNetworkConfiguration withEnableFpga(Boolean enableFpga) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetUpdateNetworkConfigurationProperties(); - } - this.innerProperties().withEnableFpga(enableFpga); - return this; - } - - /** - * Get the networkSecurityGroup property: The network security group. - * - * @return the networkSecurityGroup value. - */ - public SubResource networkSecurityGroup() { - return this.innerProperties() == null ? null : this.innerProperties().networkSecurityGroup(); - } - - /** - * Set the networkSecurityGroup property: The network security group. - * - * @param networkSecurityGroup the networkSecurityGroup value to set. - * @return the VirtualMachineScaleSetUpdateNetworkConfiguration object itself. - */ - public VirtualMachineScaleSetUpdateNetworkConfiguration withNetworkSecurityGroup(SubResource networkSecurityGroup) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetUpdateNetworkConfigurationProperties(); - } - this.innerProperties().withNetworkSecurityGroup(networkSecurityGroup); - return this; - } - - /** - * Get the dnsSettings property: The dns settings to be applied on the network interfaces. - * - * @return the dnsSettings value. - */ - public VirtualMachineScaleSetNetworkConfigurationDnsSettings dnsSettings() { - return this.innerProperties() == null ? null : this.innerProperties().dnsSettings(); - } - - /** - * Set the dnsSettings property: The dns settings to be applied on the network interfaces. - * - * @param dnsSettings the dnsSettings value to set. - * @return the VirtualMachineScaleSetUpdateNetworkConfiguration object itself. - */ - public VirtualMachineScaleSetUpdateNetworkConfiguration withDnsSettings( - VirtualMachineScaleSetNetworkConfigurationDnsSettings dnsSettings) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetUpdateNetworkConfigurationProperties(); - } - this.innerProperties().withDnsSettings(dnsSettings); - return this; - } - - /** - * Get the ipConfigurations property: The virtual machine scale set IP Configuration. - * - * @return the ipConfigurations value. - */ - public List ipConfigurations() { - return this.innerProperties() == null ? null : this.innerProperties().ipConfigurations(); - } - - /** - * Set the ipConfigurations property: The virtual machine scale set IP Configuration. - * - * @param ipConfigurations the ipConfigurations value to set. - * @return the VirtualMachineScaleSetUpdateNetworkConfiguration object itself. - */ - public VirtualMachineScaleSetUpdateNetworkConfiguration withIpConfigurations( - List ipConfigurations) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetUpdateNetworkConfigurationProperties(); - } - this.innerProperties().withIpConfigurations(ipConfigurations); - return this; - } - - /** - * Get the enableIpForwarding property: Whether IP forwarding enabled on this NIC. - * - * @return the enableIpForwarding value. - */ - public Boolean enableIpForwarding() { - return this.innerProperties() == null ? null : this.innerProperties().enableIpForwarding(); - } - - /** - * Set the enableIpForwarding property: Whether IP forwarding enabled on this NIC. - * - * @param enableIpForwarding the enableIpForwarding value to set. - * @return the VirtualMachineScaleSetUpdateNetworkConfiguration object itself. - */ - public VirtualMachineScaleSetUpdateNetworkConfiguration withEnableIpForwarding(Boolean enableIpForwarding) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetUpdateNetworkConfigurationProperties(); - } - this.innerProperties().withEnableIpForwarding(enableIpForwarding); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetUpdateNetworkProfile.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetUpdateNetworkProfile.java deleted file mode 100644 index 142d463db388..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetUpdateNetworkProfile.java +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Describes a virtual machine scale set network profile. */ -@Fluent -public final class VirtualMachineScaleSetUpdateNetworkProfile { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetUpdateNetworkProfile.class); - - /* - * A reference to a load balancer probe used to determine the health of an - * instance in the virtual machine scale set. The reference will be in the - * form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'. - */ - @JsonProperty(value = "healthProbe") - private ApiEntityReference healthProbe; - - /* - * The list of network configurations. - */ - @JsonProperty(value = "networkInterfaceConfigurations") - private List networkInterfaceConfigurations; - - /** - * Get the healthProbe property: A reference to a load balancer probe used to determine the health of an instance in - * the virtual machine scale set. The reference will be in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'. - * - * @return the healthProbe value. - */ - public ApiEntityReference healthProbe() { - return this.healthProbe; - } - - /** - * Set the healthProbe property: A reference to a load balancer probe used to determine the health of an instance in - * the virtual machine scale set. The reference will be in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'. - * - * @param healthProbe the healthProbe value to set. - * @return the VirtualMachineScaleSetUpdateNetworkProfile object itself. - */ - public VirtualMachineScaleSetUpdateNetworkProfile withHealthProbe(ApiEntityReference healthProbe) { - this.healthProbe = healthProbe; - return this; - } - - /** - * Get the networkInterfaceConfigurations property: The list of network configurations. - * - * @return the networkInterfaceConfigurations value. - */ - public List networkInterfaceConfigurations() { - return this.networkInterfaceConfigurations; - } - - /** - * Set the networkInterfaceConfigurations property: The list of network configurations. - * - * @param networkInterfaceConfigurations the networkInterfaceConfigurations value to set. - * @return the VirtualMachineScaleSetUpdateNetworkProfile object itself. - */ - public VirtualMachineScaleSetUpdateNetworkProfile withNetworkInterfaceConfigurations( - List networkInterfaceConfigurations) { - this.networkInterfaceConfigurations = networkInterfaceConfigurations; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (healthProbe() != null) { - healthProbe().validate(); - } - if (networkInterfaceConfigurations() != null) { - networkInterfaceConfigurations().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetUpdateOSDisk.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetUpdateOSDisk.java deleted file mode 100644 index d9cdad2a6529..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetUpdateOSDisk.java +++ /dev/null @@ -1,205 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** - * Describes virtual machine scale set operating system disk Update Object. This should be used for Updating VMSS OS - * Disk. - */ -@Fluent -public final class VirtualMachineScaleSetUpdateOSDisk { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetUpdateOSDisk.class); - - /* - * The caching type. - */ - @JsonProperty(value = "caching") - private CachingTypes caching; - - /* - * Specifies whether writeAccelerator should be enabled or disabled on the - * disk. - */ - @JsonProperty(value = "writeAcceleratorEnabled") - private Boolean writeAcceleratorEnabled; - - /* - * Specifies the size of the operating system disk in gigabytes. This - * element can be used to overwrite the size of the disk in a virtual - * machine image.

    This value cannot be larger than 1023 GB - */ - @JsonProperty(value = "diskSizeGB") - private Integer diskSizeGB; - - /* - * The Source User Image VirtualHardDisk. This VirtualHardDisk will be - * copied before using it to attach to the Virtual Machine. If SourceImage - * is provided, the destination VirtualHardDisk should not exist. - */ - @JsonProperty(value = "image") - private VirtualHardDisk image; - - /* - * The list of virtual hard disk container uris. - */ - @JsonProperty(value = "vhdContainers") - private List vhdContainers; - - /* - * The managed disk parameters. - */ - @JsonProperty(value = "managedDisk") - private VirtualMachineScaleSetManagedDiskParameters managedDisk; - - /** - * Get the caching property: The caching type. - * - * @return the caching value. - */ - public CachingTypes caching() { - return this.caching; - } - - /** - * Set the caching property: The caching type. - * - * @param caching the caching value to set. - * @return the VirtualMachineScaleSetUpdateOSDisk object itself. - */ - public VirtualMachineScaleSetUpdateOSDisk withCaching(CachingTypes caching) { - this.caching = caching; - return this; - } - - /** - * Get the writeAcceleratorEnabled property: Specifies whether writeAccelerator should be enabled or disabled on the - * disk. - * - * @return the writeAcceleratorEnabled value. - */ - public Boolean writeAcceleratorEnabled() { - return this.writeAcceleratorEnabled; - } - - /** - * Set the writeAcceleratorEnabled property: Specifies whether writeAccelerator should be enabled or disabled on the - * disk. - * - * @param writeAcceleratorEnabled the writeAcceleratorEnabled value to set. - * @return the VirtualMachineScaleSetUpdateOSDisk object itself. - */ - public VirtualMachineScaleSetUpdateOSDisk withWriteAcceleratorEnabled(Boolean writeAcceleratorEnabled) { - this.writeAcceleratorEnabled = writeAcceleratorEnabled; - return this; - } - - /** - * Get the diskSizeGB property: Specifies the size of the operating system disk in gigabytes. This element can be - * used to overwrite the size of the disk in a virtual machine image. <br><br> This value cannot be - * larger than 1023 GB. - * - * @return the diskSizeGB value. - */ - public Integer diskSizeGB() { - return this.diskSizeGB; - } - - /** - * Set the diskSizeGB property: Specifies the size of the operating system disk in gigabytes. This element can be - * used to overwrite the size of the disk in a virtual machine image. <br><br> This value cannot be - * larger than 1023 GB. - * - * @param diskSizeGB the diskSizeGB value to set. - * @return the VirtualMachineScaleSetUpdateOSDisk object itself. - */ - public VirtualMachineScaleSetUpdateOSDisk withDiskSizeGB(Integer diskSizeGB) { - this.diskSizeGB = diskSizeGB; - return this; - } - - /** - * Get the image property: The Source User Image VirtualHardDisk. This VirtualHardDisk will be copied before using - * it to attach to the Virtual Machine. If SourceImage is provided, the destination VirtualHardDisk should not - * exist. - * - * @return the image value. - */ - public VirtualHardDisk image() { - return this.image; - } - - /** - * Set the image property: The Source User Image VirtualHardDisk. This VirtualHardDisk will be copied before using - * it to attach to the Virtual Machine. If SourceImage is provided, the destination VirtualHardDisk should not - * exist. - * - * @param image the image value to set. - * @return the VirtualMachineScaleSetUpdateOSDisk object itself. - */ - public VirtualMachineScaleSetUpdateOSDisk withImage(VirtualHardDisk image) { - this.image = image; - return this; - } - - /** - * Get the vhdContainers property: The list of virtual hard disk container uris. - * - * @return the vhdContainers value. - */ - public List vhdContainers() { - return this.vhdContainers; - } - - /** - * Set the vhdContainers property: The list of virtual hard disk container uris. - * - * @param vhdContainers the vhdContainers value to set. - * @return the VirtualMachineScaleSetUpdateOSDisk object itself. - */ - public VirtualMachineScaleSetUpdateOSDisk withVhdContainers(List vhdContainers) { - this.vhdContainers = vhdContainers; - return this; - } - - /** - * Get the managedDisk property: The managed disk parameters. - * - * @return the managedDisk value. - */ - public VirtualMachineScaleSetManagedDiskParameters managedDisk() { - return this.managedDisk; - } - - /** - * Set the managedDisk property: The managed disk parameters. - * - * @param managedDisk the managedDisk value to set. - * @return the VirtualMachineScaleSetUpdateOSDisk object itself. - */ - public VirtualMachineScaleSetUpdateOSDisk withManagedDisk(VirtualMachineScaleSetManagedDiskParameters managedDisk) { - this.managedDisk = managedDisk; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (image() != null) { - image().validate(); - } - if (managedDisk() != null) { - managedDisk().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetUpdateOSProfile.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetUpdateOSProfile.java deleted file mode 100644 index 03082f0fbe00..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetUpdateOSProfile.java +++ /dev/null @@ -1,138 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Describes a virtual machine scale set OS profile. */ -@Fluent -public final class VirtualMachineScaleSetUpdateOSProfile { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetUpdateOSProfile.class); - - /* - * A base-64 encoded string of custom data. - */ - @JsonProperty(value = "customData") - private String customData; - - /* - * The Windows Configuration of the OS profile. - */ - @JsonProperty(value = "windowsConfiguration") - private WindowsConfiguration windowsConfiguration; - - /* - * The Linux Configuration of the OS profile. - */ - @JsonProperty(value = "linuxConfiguration") - private LinuxConfiguration linuxConfiguration; - - /* - * The List of certificates for addition to the VM. - */ - @JsonProperty(value = "secrets") - private List secrets; - - /** - * Get the customData property: A base-64 encoded string of custom data. - * - * @return the customData value. - */ - public String customData() { - return this.customData; - } - - /** - * Set the customData property: A base-64 encoded string of custom data. - * - * @param customData the customData value to set. - * @return the VirtualMachineScaleSetUpdateOSProfile object itself. - */ - public VirtualMachineScaleSetUpdateOSProfile withCustomData(String customData) { - this.customData = customData; - return this; - } - - /** - * Get the windowsConfiguration property: The Windows Configuration of the OS profile. - * - * @return the windowsConfiguration value. - */ - public WindowsConfiguration windowsConfiguration() { - return this.windowsConfiguration; - } - - /** - * Set the windowsConfiguration property: The Windows Configuration of the OS profile. - * - * @param windowsConfiguration the windowsConfiguration value to set. - * @return the VirtualMachineScaleSetUpdateOSProfile object itself. - */ - public VirtualMachineScaleSetUpdateOSProfile withWindowsConfiguration(WindowsConfiguration windowsConfiguration) { - this.windowsConfiguration = windowsConfiguration; - return this; - } - - /** - * Get the linuxConfiguration property: The Linux Configuration of the OS profile. - * - * @return the linuxConfiguration value. - */ - public LinuxConfiguration linuxConfiguration() { - return this.linuxConfiguration; - } - - /** - * Set the linuxConfiguration property: The Linux Configuration of the OS profile. - * - * @param linuxConfiguration the linuxConfiguration value to set. - * @return the VirtualMachineScaleSetUpdateOSProfile object itself. - */ - public VirtualMachineScaleSetUpdateOSProfile withLinuxConfiguration(LinuxConfiguration linuxConfiguration) { - this.linuxConfiguration = linuxConfiguration; - return this; - } - - /** - * Get the secrets property: The List of certificates for addition to the VM. - * - * @return the secrets value. - */ - public List secrets() { - return this.secrets; - } - - /** - * Set the secrets property: The List of certificates for addition to the VM. - * - * @param secrets the secrets value to set. - * @return the VirtualMachineScaleSetUpdateOSProfile object itself. - */ - public VirtualMachineScaleSetUpdateOSProfile withSecrets(List secrets) { - this.secrets = secrets; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (windowsConfiguration() != null) { - windowsConfiguration().validate(); - } - if (linuxConfiguration() != null) { - linuxConfiguration().validate(); - } - if (secrets() != null) { - secrets().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetUpdatePublicIpAddressConfiguration.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetUpdatePublicIpAddressConfiguration.java deleted file mode 100644 index 7886f53bf291..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetUpdatePublicIpAddressConfiguration.java +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineScaleSetUpdatePublicIpAddressConfigurationProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describes a virtual machines scale set IP Configuration's PublicIPAddress configuration. */ -@Fluent -public final class VirtualMachineScaleSetUpdatePublicIpAddressConfiguration { - @JsonIgnore - private final ClientLogger logger = - new ClientLogger(VirtualMachineScaleSetUpdatePublicIpAddressConfiguration.class); - - /* - * The publicIP address configuration name. - */ - @JsonProperty(value = "name") - private String name; - - /* - * Describes a virtual machines scale set IP Configuration's - * PublicIPAddress configuration - */ - @JsonProperty(value = "properties") - private VirtualMachineScaleSetUpdatePublicIpAddressConfigurationProperties innerProperties; - - /** - * Get the name property: The publicIP address configuration name. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The publicIP address configuration name. - * - * @param name the name value to set. - * @return the VirtualMachineScaleSetUpdatePublicIpAddressConfiguration object itself. - */ - public VirtualMachineScaleSetUpdatePublicIpAddressConfiguration withName(String name) { - this.name = name; - return this; - } - - /** - * Get the innerProperties property: Describes a virtual machines scale set IP Configuration's PublicIPAddress - * configuration. - * - * @return the innerProperties value. - */ - private VirtualMachineScaleSetUpdatePublicIpAddressConfigurationProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the idleTimeoutInMinutes property: The idle timeout of the public IP address. - * - * @return the idleTimeoutInMinutes value. - */ - public Integer idleTimeoutInMinutes() { - return this.innerProperties() == null ? null : this.innerProperties().idleTimeoutInMinutes(); - } - - /** - * Set the idleTimeoutInMinutes property: The idle timeout of the public IP address. - * - * @param idleTimeoutInMinutes the idleTimeoutInMinutes value to set. - * @return the VirtualMachineScaleSetUpdatePublicIpAddressConfiguration object itself. - */ - public VirtualMachineScaleSetUpdatePublicIpAddressConfiguration withIdleTimeoutInMinutes( - Integer idleTimeoutInMinutes) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetUpdatePublicIpAddressConfigurationProperties(); - } - this.innerProperties().withIdleTimeoutInMinutes(idleTimeoutInMinutes); - return this; - } - - /** - * Get the dnsSettings property: The dns settings to be applied on the publicIP addresses . - * - * @return the dnsSettings value. - */ - public VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings dnsSettings() { - return this.innerProperties() == null ? null : this.innerProperties().dnsSettings(); - } - - /** - * Set the dnsSettings property: The dns settings to be applied on the publicIP addresses . - * - * @param dnsSettings the dnsSettings value to set. - * @return the VirtualMachineScaleSetUpdatePublicIpAddressConfiguration object itself. - */ - public VirtualMachineScaleSetUpdatePublicIpAddressConfiguration withDnsSettings( - VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings dnsSettings) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineScaleSetUpdatePublicIpAddressConfigurationProperties(); - } - this.innerProperties().withDnsSettings(dnsSettings); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetUpdateStorageProfile.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetUpdateStorageProfile.java deleted file mode 100644 index 2692ee7c4654..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetUpdateStorageProfile.java +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Describes a virtual machine scale set storage profile. */ -@Fluent -public final class VirtualMachineScaleSetUpdateStorageProfile { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetUpdateStorageProfile.class); - - /* - * The image reference. - */ - @JsonProperty(value = "imageReference") - private ImageReference imageReference; - - /* - * The OS disk. - */ - @JsonProperty(value = "osDisk") - private VirtualMachineScaleSetUpdateOSDisk osDisk; - - /* - * The data disks. - */ - @JsonProperty(value = "dataDisks") - private List dataDisks; - - /** - * Get the imageReference property: The image reference. - * - * @return the imageReference value. - */ - public ImageReference imageReference() { - return this.imageReference; - } - - /** - * Set the imageReference property: The image reference. - * - * @param imageReference the imageReference value to set. - * @return the VirtualMachineScaleSetUpdateStorageProfile object itself. - */ - public VirtualMachineScaleSetUpdateStorageProfile withImageReference(ImageReference imageReference) { - this.imageReference = imageReference; - return this; - } - - /** - * Get the osDisk property: The OS disk. - * - * @return the osDisk value. - */ - public VirtualMachineScaleSetUpdateOSDisk osDisk() { - return this.osDisk; - } - - /** - * Set the osDisk property: The OS disk. - * - * @param osDisk the osDisk value to set. - * @return the VirtualMachineScaleSetUpdateStorageProfile object itself. - */ - public VirtualMachineScaleSetUpdateStorageProfile withOsDisk(VirtualMachineScaleSetUpdateOSDisk osDisk) { - this.osDisk = osDisk; - return this; - } - - /** - * Get the dataDisks property: The data disks. - * - * @return the dataDisks value. - */ - public List dataDisks() { - return this.dataDisks; - } - - /** - * Set the dataDisks property: The data disks. - * - * @param dataDisks the dataDisks value to set. - * @return the VirtualMachineScaleSetUpdateStorageProfile object itself. - */ - public VirtualMachineScaleSetUpdateStorageProfile withDataDisks(List dataDisks) { - this.dataDisks = dataDisks; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (imageReference() != null) { - imageReference().validate(); - } - if (osDisk() != null) { - osDisk().validate(); - } - if (dataDisks() != null) { - dataDisks().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetUpdateVMProfile.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetUpdateVMProfile.java deleted file mode 100644 index 971321d5007a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetUpdateVMProfile.java +++ /dev/null @@ -1,289 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describes a virtual machine scale set virtual machine profile. */ -@Fluent -public final class VirtualMachineScaleSetUpdateVMProfile { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetUpdateVMProfile.class); - - /* - * The virtual machine scale set OS profile. - */ - @JsonProperty(value = "osProfile") - private VirtualMachineScaleSetUpdateOSProfile osProfile; - - /* - * The virtual machine scale set storage profile. - */ - @JsonProperty(value = "storageProfile") - private VirtualMachineScaleSetUpdateStorageProfile storageProfile; - - /* - * The virtual machine scale set network profile. - */ - @JsonProperty(value = "networkProfile") - private VirtualMachineScaleSetUpdateNetworkProfile networkProfile; - - /* - * The virtual machine scale set Security profile - */ - @JsonProperty(value = "securityProfile") - private SecurityProfile securityProfile; - - /* - * The virtual machine scale set diagnostics profile. - */ - @JsonProperty(value = "diagnosticsProfile") - private DiagnosticsProfile diagnosticsProfile; - - /* - * The virtual machine scale set extension profile. - */ - @JsonProperty(value = "extensionProfile") - private VirtualMachineScaleSetExtensionProfile extensionProfile; - - /* - * The license type, which is for bring your own license scenario. - */ - @JsonProperty(value = "licenseType") - private String licenseType; - - /* - * Specifies the billing related details of a Azure Spot VMSS. - *

    Minimum api-version: 2019-03-01. - */ - @JsonProperty(value = "billingProfile") - private BillingProfile billingProfile; - - /* - * Specifies Scheduled Event related configurations. - */ - @JsonProperty(value = "scheduledEventsProfile") - private ScheduledEventsProfile scheduledEventsProfile; - - /** - * Get the osProfile property: The virtual machine scale set OS profile. - * - * @return the osProfile value. - */ - public VirtualMachineScaleSetUpdateOSProfile osProfile() { - return this.osProfile; - } - - /** - * Set the osProfile property: The virtual machine scale set OS profile. - * - * @param osProfile the osProfile value to set. - * @return the VirtualMachineScaleSetUpdateVMProfile object itself. - */ - public VirtualMachineScaleSetUpdateVMProfile withOsProfile(VirtualMachineScaleSetUpdateOSProfile osProfile) { - this.osProfile = osProfile; - return this; - } - - /** - * Get the storageProfile property: The virtual machine scale set storage profile. - * - * @return the storageProfile value. - */ - public VirtualMachineScaleSetUpdateStorageProfile storageProfile() { - return this.storageProfile; - } - - /** - * Set the storageProfile property: The virtual machine scale set storage profile. - * - * @param storageProfile the storageProfile value to set. - * @return the VirtualMachineScaleSetUpdateVMProfile object itself. - */ - public VirtualMachineScaleSetUpdateVMProfile withStorageProfile( - VirtualMachineScaleSetUpdateStorageProfile storageProfile) { - this.storageProfile = storageProfile; - return this; - } - - /** - * Get the networkProfile property: The virtual machine scale set network profile. - * - * @return the networkProfile value. - */ - public VirtualMachineScaleSetUpdateNetworkProfile networkProfile() { - return this.networkProfile; - } - - /** - * Set the networkProfile property: The virtual machine scale set network profile. - * - * @param networkProfile the networkProfile value to set. - * @return the VirtualMachineScaleSetUpdateVMProfile object itself. - */ - public VirtualMachineScaleSetUpdateVMProfile withNetworkProfile( - VirtualMachineScaleSetUpdateNetworkProfile networkProfile) { - this.networkProfile = networkProfile; - return this; - } - - /** - * Get the securityProfile property: The virtual machine scale set Security profile. - * - * @return the securityProfile value. - */ - public SecurityProfile securityProfile() { - return this.securityProfile; - } - - /** - * Set the securityProfile property: The virtual machine scale set Security profile. - * - * @param securityProfile the securityProfile value to set. - * @return the VirtualMachineScaleSetUpdateVMProfile object itself. - */ - public VirtualMachineScaleSetUpdateVMProfile withSecurityProfile(SecurityProfile securityProfile) { - this.securityProfile = securityProfile; - return this; - } - - /** - * Get the diagnosticsProfile property: The virtual machine scale set diagnostics profile. - * - * @return the diagnosticsProfile value. - */ - public DiagnosticsProfile diagnosticsProfile() { - return this.diagnosticsProfile; - } - - /** - * Set the diagnosticsProfile property: The virtual machine scale set diagnostics profile. - * - * @param diagnosticsProfile the diagnosticsProfile value to set. - * @return the VirtualMachineScaleSetUpdateVMProfile object itself. - */ - public VirtualMachineScaleSetUpdateVMProfile withDiagnosticsProfile(DiagnosticsProfile diagnosticsProfile) { - this.diagnosticsProfile = diagnosticsProfile; - return this; - } - - /** - * Get the extensionProfile property: The virtual machine scale set extension profile. - * - * @return the extensionProfile value. - */ - public VirtualMachineScaleSetExtensionProfile extensionProfile() { - return this.extensionProfile; - } - - /** - * Set the extensionProfile property: The virtual machine scale set extension profile. - * - * @param extensionProfile the extensionProfile value to set. - * @return the VirtualMachineScaleSetUpdateVMProfile object itself. - */ - public VirtualMachineScaleSetUpdateVMProfile withExtensionProfile( - VirtualMachineScaleSetExtensionProfile extensionProfile) { - this.extensionProfile = extensionProfile; - return this; - } - - /** - * Get the licenseType property: The license type, which is for bring your own license scenario. - * - * @return the licenseType value. - */ - public String licenseType() { - return this.licenseType; - } - - /** - * Set the licenseType property: The license type, which is for bring your own license scenario. - * - * @param licenseType the licenseType value to set. - * @return the VirtualMachineScaleSetUpdateVMProfile object itself. - */ - public VirtualMachineScaleSetUpdateVMProfile withLicenseType(String licenseType) { - this.licenseType = licenseType; - return this; - } - - /** - * Get the billingProfile property: Specifies the billing related details of a Azure Spot VMSS. - * <br><br>Minimum api-version: 2019-03-01. - * - * @return the billingProfile value. - */ - public BillingProfile billingProfile() { - return this.billingProfile; - } - - /** - * Set the billingProfile property: Specifies the billing related details of a Azure Spot VMSS. - * <br><br>Minimum api-version: 2019-03-01. - * - * @param billingProfile the billingProfile value to set. - * @return the VirtualMachineScaleSetUpdateVMProfile object itself. - */ - public VirtualMachineScaleSetUpdateVMProfile withBillingProfile(BillingProfile billingProfile) { - this.billingProfile = billingProfile; - return this; - } - - /** - * Get the scheduledEventsProfile property: Specifies Scheduled Event related configurations. - * - * @return the scheduledEventsProfile value. - */ - public ScheduledEventsProfile scheduledEventsProfile() { - return this.scheduledEventsProfile; - } - - /** - * Set the scheduledEventsProfile property: Specifies Scheduled Event related configurations. - * - * @param scheduledEventsProfile the scheduledEventsProfile value to set. - * @return the VirtualMachineScaleSetUpdateVMProfile object itself. - */ - public VirtualMachineScaleSetUpdateVMProfile withScheduledEventsProfile( - ScheduledEventsProfile scheduledEventsProfile) { - this.scheduledEventsProfile = scheduledEventsProfile; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (osProfile() != null) { - osProfile().validate(); - } - if (storageProfile() != null) { - storageProfile().validate(); - } - if (networkProfile() != null) { - networkProfile().validate(); - } - if (securityProfile() != null) { - securityProfile().validate(); - } - if (diagnosticsProfile() != null) { - diagnosticsProfile().validate(); - } - if (extensionProfile() != null) { - extensionProfile().validate(); - } - if (billingProfile() != null) { - billingProfile().validate(); - } - if (scheduledEventsProfile() != null) { - scheduledEventsProfile().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetVM.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetVM.java deleted file mode 100644 index fe71b54dbbff..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetVM.java +++ /dev/null @@ -1,293 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineScaleSetVMInner; -import com.azure.resourcemanager.network.models.VirtualMachineScaleSetNetworkInterface; -import com.azure.resourcemanager.resources.fluentcore.arm.models.ChildResource; -import com.azure.resourcemanager.resources.fluentcore.arm.models.Resource; -import com.azure.resourcemanager.resources.fluentcore.model.Appliable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; -import com.azure.resourcemanager.resources.fluentcore.model.Updatable; -import java.util.List; -import java.util.Map; -import reactor.core.publisher.Mono; - -/** An immutable client-side representation of a virtual machine instance in an Azure virtual machine scale set. */ -@Fluent -public interface VirtualMachineScaleSetVM - extends Resource, - ChildResource, - Refreshable, - Updatable, - HasInnerModel { - /** @return the instance ID assigned to this virtual machine instance */ - String instanceId(); - - /** - * @return the SKU of the virtual machine instance, this will be SKU used while creating the parent virtual machine - * scale set - */ - Sku sku(); - - /** @return virtual machine instance size */ - VirtualMachineSizeTypes size(); - - /** @return true if the latest scale set model changes are applied to the virtual machine instance */ - boolean isLatestScaleSetUpdateApplied(); - - /** @return true if the operating system of the virtual machine instance is based on platform image */ - boolean isOSBasedOnPlatformImage(); - - /** @return true if the operating system of the virtual machine instance is based on custom image */ - boolean isOSBasedOnCustomImage(); - - /** @return true if the operating system of the virtual machine instance is based on stored image */ - boolean isOSBasedOnStoredImage(); - - /** - * @return reference to the platform image that the virtual machine instance operating system is based on, null will - * be returned if the operating system is based on custom image - */ - ImageReference platformImageReference(); - - /** - * @return the platform image that the virtual machine instance operating system is based on, null be returned - * otherwise - */ - VirtualMachineImage getOSPlatformImage(); - - /** - * @return the custom image that the virtual machine instance operating system is based on, null be returned - * otherwise - */ - VirtualMachineCustomImage getOSCustomImage(); - - /** - * @return VHD URI of the custom image that the virtual machine instance operating system is based on, null will be - * returned if the operating system is based on platform image - */ - String storedImageUnmanagedVhdUri(); - - /** @return the name of the operating system disk */ - String osDiskName(); - - /** @return VHD URI to the operating system disk */ - String osUnmanagedDiskVhdUri(); - - /** @return resource ID of the managed disk backing OS disk */ - String osDiskId(); - - /** @return the unmanaged data disks associated with this virtual machine instance, indexed by LUN */ - Map unmanagedDataDisks(); - - /** @return the managed data disks associated with this virtual machine instance, indexed by LUN */ - Map dataDisks(); - - /** @return the caching type of the operating system disk */ - CachingTypes osDiskCachingType(); - - /** @return the size of the operating system disk */ - int osDiskSizeInGB(); - - /** @return the virtual machine instance computer name with the VM scale set prefix. */ - String computerName(); - - /** @return the name of the admin user */ - String administratorUserName(); - - /** @return the operating system type */ - OperatingSystemTypes osType(); - - /** @return true if this is a Linux virtual machine and password based login is enabled, false otherwise */ - boolean isLinuxPasswordAuthenticationEnabled(); - - /** @return true if this is a Windows virtual machine and VM agent is provisioned, false otherwise */ - boolean isWindowsVMAgentProvisioned(); - - /** @return true if this is a Windows virtual machine and automatic update is turned on, false otherwise */ - boolean isWindowsAutoUpdateEnabled(); - - /** @return the time zone of the Windows virtual machine */ - String windowsTimeZone(); - - /** @return true if the boot diagnostic is enabled, false otherwise */ - boolean bootDiagnosticEnabled(); - - /** @return the URI to the storage account storing boot diagnostics log */ - String bootDiagnosticStorageAccountUri(); - - /** @return the resource ID of the availability set that this virtual machine instance belongs to */ - String availabilitySetId(); - - /** @return the list of resource ID of network interface associated with the virtual machine instance */ - List networkInterfaceIds(); - - /** @return resource ID of primary network interface associated with virtual machine instance */ - String primaryNetworkInterfaceId(); - - /** @return the extensions associated with the virtual machine instance, indexed by name */ - Map extensions(); - - /** @return the storage profile of the virtual machine instance */ - StorageProfile storageProfile(); - - /** @return the operating system profile of an virtual machine instance */ - OSProfile osProfile(); - - /** @return the diagnostics profile of the virtual machine instance */ - DiagnosticsProfile diagnosticsProfile(); - - /** @return true if managed disk is used for the virtual machine's disks (os, data) */ - boolean isManagedDiskEnabled(); - - /** Updates the version of the installed operating system in the virtual machine instance. */ - void reimage(); - - /** - * Updates the version of the installed operating system in the virtual machine instance. - * - * @return a representation of the deferred computation of this call - */ - Mono reimageAsync(); - - /** Shuts down the virtual machine instance and releases the associated compute resources. */ - void deallocate(); - - /** - * Shuts down the virtual machine instance and releases the associated compute resources. - * - * @return a representation of the deferred computation of this call - */ - Mono deallocateAsync(); - - /** Stops the virtual machine instance. */ - void powerOff(); - - /** - * Stops the virtual machine instance. - * - * @return a representation of the deferred computation of this call - */ - Mono powerOffAsync(); - - /** Starts the virtual machine instance. */ - void start(); - - /** - * Starts the virtual machine instance. - * - * @return a representation of the deferred computation of this call - */ - Mono startAsync(); - - /** Restarts the virtual machine instance. */ - void restart(); - - /** - * Restarts the virtual machine instance. - * - * @return a representation of the deferred computation of this call - */ - Mono restartAsync(); - - /** Deletes the virtual machine instance. */ - void delete(); - - /** - * Deletes the virtual machine instance. - * - * @return a representation of the deferred computation of this call - */ - Mono deleteAsync(); - - /** - * Gets the instance view of the virtual machine instance. - * - *

    To get the latest instance view use refreshInstanceView(). - * - * @return the instance view - */ - VirtualMachineInstanceView instanceView(); - - /** - * Refreshes the instance view. - * - * @return the instance view - */ - VirtualMachineInstanceView refreshInstanceView(); - - /** - * Refreshes the instance view. - * - * @return an observable that emits the instance view of the virtual machine instance. - */ - Mono refreshInstanceViewAsync(); - - /** @return the power state of the virtual machine instance */ - PowerState powerState(); - - /** - * Gets a network interface associated with this virtual machine instance. - * - * @param name the name of the network interface - * @return the network interface - */ - VirtualMachineScaleSetNetworkInterface getNetworkInterface(String name); - - /** @return the network interfaces associated with this virtual machine instance. */ - PagedIterable listNetworkInterfaces(); - - /** @return the network interfaces associated with this virtual machine instance. */ - PagedFlux listNetworkInterfacesAsync(); - - /** - * @return Get specifies whether the model applied to the virtual machine is the model of the virtual machine scale - * set or the customized model for the virtual machine. - */ - String modelDefinitionApplied(); - - /** @return The specific protection policy for the vm. */ - VirtualMachineScaleSetVMProtectionPolicy protectionPolicy(); - - /** @return The network profile config for the vm. */ - VirtualMachineScaleSetVMNetworkProfileConfiguration networkProfileConfiguration(); - - /** The template for an update operation, containing all the settings that can be modified. */ - interface Update extends Appliable { - /** - * Attaches an existing data disk to this VMSS virtual machine. - * - * @param dataDisk data disk, need to be in DiskState.UNATTACHED state - * @param lun the disk LUN, cannot conflict with existing LUNs - * @param cachingTypes the caching type - * @return the next stage of the update - */ - Update withExistingDataDisk(Disk dataDisk, int lun, CachingTypes cachingTypes); - - /** - * Attaches an existing data disk to this VMSS virtual machine. - * - * @param dataDisk data disk, need to be in DiskState.UNATTACHED state - * @param lun the disk LUN, cannot conflict with existing LUNs - * @param cachingTypes the caching type - * @param storageAccountTypes the storage account type - * @return the next stage of the update - */ - Update withExistingDataDisk( - Disk dataDisk, int lun, CachingTypes cachingTypes, StorageAccountTypes storageAccountTypes); - - /** - * Detaches an existing data disk from this VMSS virtual machine. - * - * @param lun the disk LUN - * @return the next stage of the update - */ - Update withoutDataDisk(int lun); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetVMExtensionUpdate.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetVMExtensionUpdate.java deleted file mode 100644 index 876fd118c146..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetVMExtensionUpdate.java +++ /dev/null @@ -1,269 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineExtensionUpdateProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describes a VMSS VM Extension. */ -@Fluent -public final class VirtualMachineScaleSetVMExtensionUpdate extends SubResourceReadOnly { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetVMExtensionUpdate.class); - - /* - * The name of the extension. - */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) - private String name; - - /* - * Resource type - */ - @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) - private String type; - - /* - * Describes the properties of a Virtual Machine Extension. - */ - @JsonProperty(value = "properties") - private VirtualMachineExtensionUpdateProperties innerProperties; - - /** - * Get the name property: The name of the extension. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the type property: Resource type. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Get the innerProperties property: Describes the properties of a Virtual Machine Extension. - * - * @return the innerProperties value. - */ - private VirtualMachineExtensionUpdateProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the forceUpdateTag property: How the extension handler should be forced to update even if the extension - * configuration has not changed. - * - * @return the forceUpdateTag value. - */ - public String forceUpdateTag() { - return this.innerProperties() == null ? null : this.innerProperties().forceUpdateTag(); - } - - /** - * Set the forceUpdateTag property: How the extension handler should be forced to update even if the extension - * configuration has not changed. - * - * @param forceUpdateTag the forceUpdateTag value to set. - * @return the VirtualMachineScaleSetVMExtensionUpdate object itself. - */ - public VirtualMachineScaleSetVMExtensionUpdate withForceUpdateTag(String forceUpdateTag) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineExtensionUpdateProperties(); - } - this.innerProperties().withForceUpdateTag(forceUpdateTag); - return this; - } - - /** - * Get the publisher property: The name of the extension handler publisher. - * - * @return the publisher value. - */ - public String publisher() { - return this.innerProperties() == null ? null : this.innerProperties().publisher(); - } - - /** - * Set the publisher property: The name of the extension handler publisher. - * - * @param publisher the publisher value to set. - * @return the VirtualMachineScaleSetVMExtensionUpdate object itself. - */ - public VirtualMachineScaleSetVMExtensionUpdate withPublisher(String publisher) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineExtensionUpdateProperties(); - } - this.innerProperties().withPublisher(publisher); - return this; - } - - /** - * Get the type property: Specifies the type of the extension; an example is "CustomScriptExtension". - * - * @return the type value. - */ - public String typePropertiesType() { - return this.innerProperties() == null ? null : this.innerProperties().type(); - } - - /** - * Set the type property: Specifies the type of the extension; an example is "CustomScriptExtension". - * - * @param type the type value to set. - * @return the VirtualMachineScaleSetVMExtensionUpdate object itself. - */ - public VirtualMachineScaleSetVMExtensionUpdate withTypePropertiesType(String type) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineExtensionUpdateProperties(); - } - this.innerProperties().withType(type); - return this; - } - - /** - * Get the typeHandlerVersion property: Specifies the version of the script handler. - * - * @return the typeHandlerVersion value. - */ - public String typeHandlerVersion() { - return this.innerProperties() == null ? null : this.innerProperties().typeHandlerVersion(); - } - - /** - * Set the typeHandlerVersion property: Specifies the version of the script handler. - * - * @param typeHandlerVersion the typeHandlerVersion value to set. - * @return the VirtualMachineScaleSetVMExtensionUpdate object itself. - */ - public VirtualMachineScaleSetVMExtensionUpdate withTypeHandlerVersion(String typeHandlerVersion) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineExtensionUpdateProperties(); - } - this.innerProperties().withTypeHandlerVersion(typeHandlerVersion); - return this; - } - - /** - * Get the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one - * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless - * redeployed, even with this property set to true. - * - * @return the autoUpgradeMinorVersion value. - */ - public Boolean autoUpgradeMinorVersion() { - return this.innerProperties() == null ? null : this.innerProperties().autoUpgradeMinorVersion(); - } - - /** - * Set the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one - * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless - * redeployed, even with this property set to true. - * - * @param autoUpgradeMinorVersion the autoUpgradeMinorVersion value to set. - * @return the VirtualMachineScaleSetVMExtensionUpdate object itself. - */ - public VirtualMachineScaleSetVMExtensionUpdate withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineExtensionUpdateProperties(); - } - this.innerProperties().withAutoUpgradeMinorVersion(autoUpgradeMinorVersion); - return this; - } - - /** - * Get the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the - * platform if there is a newer version of the extension available. - * - * @return the enableAutomaticUpgrade value. - */ - public Boolean enableAutomaticUpgrade() { - return this.innerProperties() == null ? null : this.innerProperties().enableAutomaticUpgrade(); - } - - /** - * Set the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the - * platform if there is a newer version of the extension available. - * - * @param enableAutomaticUpgrade the enableAutomaticUpgrade value to set. - * @return the VirtualMachineScaleSetVMExtensionUpdate object itself. - */ - public VirtualMachineScaleSetVMExtensionUpdate withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineExtensionUpdateProperties(); - } - this.innerProperties().withEnableAutomaticUpgrade(enableAutomaticUpgrade); - return this; - } - - /** - * Get the settings property: Json formatted public settings for the extension. - * - * @return the settings value. - */ - public Object settings() { - return this.innerProperties() == null ? null : this.innerProperties().settings(); - } - - /** - * Set the settings property: Json formatted public settings for the extension. - * - * @param settings the settings value to set. - * @return the VirtualMachineScaleSetVMExtensionUpdate object itself. - */ - public VirtualMachineScaleSetVMExtensionUpdate withSettings(Object settings) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineExtensionUpdateProperties(); - } - this.innerProperties().withSettings(settings); - return this; - } - - /** - * Get the protectedSettings property: The extension can contain either protectedSettings or - * protectedSettingsFromKeyVault or no protected settings at all. - * - * @return the protectedSettings value. - */ - public Object protectedSettings() { - return this.innerProperties() == null ? null : this.innerProperties().protectedSettings(); - } - - /** - * Set the protectedSettings property: The extension can contain either protectedSettings or - * protectedSettingsFromKeyVault or no protected settings at all. - * - * @param protectedSettings the protectedSettings value to set. - * @return the VirtualMachineScaleSetVMExtensionUpdate object itself. - */ - public VirtualMachineScaleSetVMExtensionUpdate withProtectedSettings(Object protectedSettings) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineExtensionUpdateProperties(); - } - this.innerProperties().withProtectedSettings(protectedSettings); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetVMExtensionsSummary.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetVMExtensionsSummary.java deleted file mode 100644 index 312f9b202b13..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetVMExtensionsSummary.java +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Extensions summary for virtual machines of a virtual machine scale set. */ -@Immutable -public final class VirtualMachineScaleSetVMExtensionsSummary { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetVMExtensionsSummary.class); - - /* - * The extension name. - */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) - private String name; - - /* - * The extensions information. - */ - @JsonProperty(value = "statusesSummary", access = JsonProperty.Access.WRITE_ONLY) - private List statusesSummary; - - /** - * Get the name property: The extension name. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the statusesSummary property: The extensions information. - * - * @return the statusesSummary value. - */ - public List statusesSummary() { - return this.statusesSummary; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (statusesSummary() != null) { - statusesSummary().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetVMInstanceExtension.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetVMInstanceExtension.java deleted file mode 100644 index d134139d8d2c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetVMInstanceExtension.java +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.arm.models.ChildResource; - -/** An immutable client-side representation of an extension associated with virtual machine instance in a scale set. */ -@Fluent -public interface VirtualMachineScaleSetVMInstanceExtension - extends VirtualMachineExtensionBase, ChildResource { - /** @return the instance view of the scale set virtual machine extension */ - VirtualMachineExtensionInstanceView instanceView(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetVMInstanceIDs.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetVMInstanceIDs.java deleted file mode 100644 index 25b68309504a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetVMInstanceIDs.java +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Specifies a list of virtual machine instance IDs from the VM scale set. */ -@Fluent -public final class VirtualMachineScaleSetVMInstanceIDs { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetVMInstanceIDs.class); - - /* - * The virtual machine scale set instance ids. Omitting the virtual machine - * scale set instance ids will result in the operation being performed on - * all virtual machines in the virtual machine scale set. - */ - @JsonProperty(value = "instanceIds") - private List instanceIds; - - /** - * Get the instanceIds property: The virtual machine scale set instance ids. Omitting the virtual machine scale set - * instance ids will result in the operation being performed on all virtual machines in the virtual machine scale - * set. - * - * @return the instanceIds value. - */ - public List instanceIds() { - return this.instanceIds; - } - - /** - * Set the instanceIds property: The virtual machine scale set instance ids. Omitting the virtual machine scale set - * instance ids will result in the operation being performed on all virtual machines in the virtual machine scale - * set. - * - * @param instanceIds the instanceIds value to set. - * @return the VirtualMachineScaleSetVMInstanceIDs object itself. - */ - public VirtualMachineScaleSetVMInstanceIDs withInstanceIds(List instanceIds) { - this.instanceIds = instanceIds; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetVMInstanceRequiredIDs.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetVMInstanceRequiredIDs.java deleted file mode 100644 index b1a339d77b1a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetVMInstanceRequiredIDs.java +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Specifies a list of virtual machine instance IDs from the VM scale set. */ -@Fluent -public final class VirtualMachineScaleSetVMInstanceRequiredIDs { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetVMInstanceRequiredIDs.class); - - /* - * The virtual machine scale set instance ids. - */ - @JsonProperty(value = "instanceIds", required = true) - private List instanceIds; - - /** - * Get the instanceIds property: The virtual machine scale set instance ids. - * - * @return the instanceIds value. - */ - public List instanceIds() { - return this.instanceIds; - } - - /** - * Set the instanceIds property: The virtual machine scale set instance ids. - * - * @param instanceIds the instanceIds value to set. - * @return the VirtualMachineScaleSetVMInstanceRequiredIDs object itself. - */ - public VirtualMachineScaleSetVMInstanceRequiredIDs withInstanceIds(List instanceIds) { - this.instanceIds = instanceIds; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (instanceIds() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property instanceIds in model VirtualMachineScaleSetVMInstanceRequiredIDs")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetVMListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetVMListResult.java deleted file mode 100644 index ff44cf29c5b7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetVMListResult.java +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineScaleSetVMInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The List Virtual Machine Scale Set VMs operation response. */ -@Fluent -public final class VirtualMachineScaleSetVMListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetVMListResult.class); - - /* - * The list of virtual machine scale sets VMs. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * The uri to fetch the next page of Virtual Machine Scale Set VMs. Call - * ListNext() with this to fetch the next page of VMSS VMs - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: The list of virtual machine scale sets VMs. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The list of virtual machine scale sets VMs. - * - * @param value the value value to set. - * @return the VirtualMachineScaleSetVMListResult object itself. - */ - public VirtualMachineScaleSetVMListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The uri to fetch the next page of Virtual Machine Scale Set VMs. Call ListNext() with - * this to fetch the next page of VMSS VMs. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The uri to fetch the next page of Virtual Machine Scale Set VMs. Call ListNext() with - * this to fetch the next page of VMSS VMs. - * - * @param nextLink the nextLink value to set. - * @return the VirtualMachineScaleSetVMListResult object itself. - */ - public VirtualMachineScaleSetVMListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property value in model VirtualMachineScaleSetVMListResult")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetVMNetworkProfileConfiguration.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetVMNetworkProfileConfiguration.java deleted file mode 100644 index 5a16fb9ccd96..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetVMNetworkProfileConfiguration.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Describes a virtual machine scale set VM network profile. */ -@Fluent -public final class VirtualMachineScaleSetVMNetworkProfileConfiguration { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetVMNetworkProfileConfiguration.class); - - /* - * The list of network configurations. - */ - @JsonProperty(value = "networkInterfaceConfigurations") - private List networkInterfaceConfigurations; - - /** - * Get the networkInterfaceConfigurations property: The list of network configurations. - * - * @return the networkInterfaceConfigurations value. - */ - public List networkInterfaceConfigurations() { - return this.networkInterfaceConfigurations; - } - - /** - * Set the networkInterfaceConfigurations property: The list of network configurations. - * - * @param networkInterfaceConfigurations the networkInterfaceConfigurations value to set. - * @return the VirtualMachineScaleSetVMNetworkProfileConfiguration object itself. - */ - public VirtualMachineScaleSetVMNetworkProfileConfiguration withNetworkInterfaceConfigurations( - List networkInterfaceConfigurations) { - this.networkInterfaceConfigurations = networkInterfaceConfigurations; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (networkInterfaceConfigurations() != null) { - networkInterfaceConfigurations().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetVMProfile.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetVMProfile.java deleted file mode 100644 index 95b78d1016a0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetVMProfile.java +++ /dev/null @@ -1,390 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describes a virtual machine scale set virtual machine profile. */ -@Fluent -public final class VirtualMachineScaleSetVMProfile { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetVMProfile.class); - - /* - * Specifies the operating system settings for the virtual machines in the - * scale set. - */ - @JsonProperty(value = "osProfile") - private VirtualMachineScaleSetOSProfile osProfile; - - /* - * Specifies the storage settings for the virtual machine disks. - */ - @JsonProperty(value = "storageProfile") - private VirtualMachineScaleSetStorageProfile storageProfile; - - /* - * Specifies properties of the network interfaces of the virtual machines - * in the scale set. - */ - @JsonProperty(value = "networkProfile") - private VirtualMachineScaleSetNetworkProfile networkProfile; - - /* - * Specifies the Security related profile settings for the virtual machines - * in the scale set. - */ - @JsonProperty(value = "securityProfile") - private SecurityProfile securityProfile; - - /* - * Specifies the boot diagnostic settings state.

    Minimum - * api-version: 2015-06-15. - */ - @JsonProperty(value = "diagnosticsProfile") - private DiagnosticsProfile diagnosticsProfile; - - /* - * Specifies a collection of settings for extensions installed on virtual - * machines in the scale set. - */ - @JsonProperty(value = "extensionProfile") - private VirtualMachineScaleSetExtensionProfile extensionProfile; - - /* - * Specifies that the image or disk that is being used was licensed - * on-premises.

    Possible values for Windows Server operating - * system are:

    Windows_Client

    Windows_Server

    - * Possible values for Linux Server operating system are:

    - * RHEL_BYOS (for RHEL)

    SLES_BYOS (for SUSE)

    For more - * information, see [Azure Hybrid Use Benefit for Windows - * Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) - *

    [Azure Hybrid Use Benefit for Linux - * Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) - *

    Minimum api-version: 2015-06-15 - */ - @JsonProperty(value = "licenseType") - private String licenseType; - - /* - * Specifies the priority for the virtual machines in the scale set. - *

    Minimum api-version: 2017-10-30-preview - */ - @JsonProperty(value = "priority") - private VirtualMachinePriorityTypes priority; - - /* - * Specifies the eviction policy for the Azure Spot virtual machine and - * Azure Spot scale set.

    For Azure Spot virtual machines, both - * 'Deallocate' and 'Delete' are supported and the minimum api-version is - * 2019-03-01.

    For Azure Spot scale sets, both 'Deallocate' and - * 'Delete' are supported and the minimum api-version is - * 2017-10-30-preview. - */ - @JsonProperty(value = "evictionPolicy") - private VirtualMachineEvictionPolicyTypes evictionPolicy; - - /* - * Specifies the billing related details of a Azure Spot VMSS. - *

    Minimum api-version: 2019-03-01. - */ - @JsonProperty(value = "billingProfile") - private BillingProfile billingProfile; - - /* - * Specifies Scheduled Event related configurations. - */ - @JsonProperty(value = "scheduledEventsProfile") - private ScheduledEventsProfile scheduledEventsProfile; - - /** - * Get the osProfile property: Specifies the operating system settings for the virtual machines in the scale set. - * - * @return the osProfile value. - */ - public VirtualMachineScaleSetOSProfile osProfile() { - return this.osProfile; - } - - /** - * Set the osProfile property: Specifies the operating system settings for the virtual machines in the scale set. - * - * @param osProfile the osProfile value to set. - * @return the VirtualMachineScaleSetVMProfile object itself. - */ - public VirtualMachineScaleSetVMProfile withOsProfile(VirtualMachineScaleSetOSProfile osProfile) { - this.osProfile = osProfile; - return this; - } - - /** - * Get the storageProfile property: Specifies the storage settings for the virtual machine disks. - * - * @return the storageProfile value. - */ - public VirtualMachineScaleSetStorageProfile storageProfile() { - return this.storageProfile; - } - - /** - * Set the storageProfile property: Specifies the storage settings for the virtual machine disks. - * - * @param storageProfile the storageProfile value to set. - * @return the VirtualMachineScaleSetVMProfile object itself. - */ - public VirtualMachineScaleSetVMProfile withStorageProfile(VirtualMachineScaleSetStorageProfile storageProfile) { - this.storageProfile = storageProfile; - return this; - } - - /** - * Get the networkProfile property: Specifies properties of the network interfaces of the virtual machines in the - * scale set. - * - * @return the networkProfile value. - */ - public VirtualMachineScaleSetNetworkProfile networkProfile() { - return this.networkProfile; - } - - /** - * Set the networkProfile property: Specifies properties of the network interfaces of the virtual machines in the - * scale set. - * - * @param networkProfile the networkProfile value to set. - * @return the VirtualMachineScaleSetVMProfile object itself. - */ - public VirtualMachineScaleSetVMProfile withNetworkProfile(VirtualMachineScaleSetNetworkProfile networkProfile) { - this.networkProfile = networkProfile; - return this; - } - - /** - * Get the securityProfile property: Specifies the Security related profile settings for the virtual machines in the - * scale set. - * - * @return the securityProfile value. - */ - public SecurityProfile securityProfile() { - return this.securityProfile; - } - - /** - * Set the securityProfile property: Specifies the Security related profile settings for the virtual machines in the - * scale set. - * - * @param securityProfile the securityProfile value to set. - * @return the VirtualMachineScaleSetVMProfile object itself. - */ - public VirtualMachineScaleSetVMProfile withSecurityProfile(SecurityProfile securityProfile) { - this.securityProfile = securityProfile; - return this; - } - - /** - * Get the diagnosticsProfile property: Specifies the boot diagnostic settings state. <br><br>Minimum - * api-version: 2015-06-15. - * - * @return the diagnosticsProfile value. - */ - public DiagnosticsProfile diagnosticsProfile() { - return this.diagnosticsProfile; - } - - /** - * Set the diagnosticsProfile property: Specifies the boot diagnostic settings state. <br><br>Minimum - * api-version: 2015-06-15. - * - * @param diagnosticsProfile the diagnosticsProfile value to set. - * @return the VirtualMachineScaleSetVMProfile object itself. - */ - public VirtualMachineScaleSetVMProfile withDiagnosticsProfile(DiagnosticsProfile diagnosticsProfile) { - this.diagnosticsProfile = diagnosticsProfile; - return this; - } - - /** - * Get the extensionProfile property: Specifies a collection of settings for extensions installed on virtual - * machines in the scale set. - * - * @return the extensionProfile value. - */ - public VirtualMachineScaleSetExtensionProfile extensionProfile() { - return this.extensionProfile; - } - - /** - * Set the extensionProfile property: Specifies a collection of settings for extensions installed on virtual - * machines in the scale set. - * - * @param extensionProfile the extensionProfile value to set. - * @return the VirtualMachineScaleSetVMProfile object itself. - */ - public VirtualMachineScaleSetVMProfile withExtensionProfile( - VirtualMachineScaleSetExtensionProfile extensionProfile) { - this.extensionProfile = extensionProfile; - return this; - } - - /** - * Get the licenseType property: Specifies that the image or disk that is being used was licensed on-premises. - * <br><br> Possible values for Windows Server operating system are: <br><br> Windows_Client - * <br><br> Windows_Server <br><br> Possible values for Linux Server operating system are: - * <br><br> RHEL_BYOS (for RHEL) <br><br> SLES_BYOS (for SUSE) <br><br> For more - * information, see [Azure Hybrid Use Benefit for Windows - * Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) - * <br><br> [Azure Hybrid Use Benefit for Linux - * Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) <br><br> - * Minimum api-version: 2015-06-15. - * - * @return the licenseType value. - */ - public String licenseType() { - return this.licenseType; - } - - /** - * Set the licenseType property: Specifies that the image or disk that is being used was licensed on-premises. - * <br><br> Possible values for Windows Server operating system are: <br><br> Windows_Client - * <br><br> Windows_Server <br><br> Possible values for Linux Server operating system are: - * <br><br> RHEL_BYOS (for RHEL) <br><br> SLES_BYOS (for SUSE) <br><br> For more - * information, see [Azure Hybrid Use Benefit for Windows - * Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) - * <br><br> [Azure Hybrid Use Benefit for Linux - * Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) <br><br> - * Minimum api-version: 2015-06-15. - * - * @param licenseType the licenseType value to set. - * @return the VirtualMachineScaleSetVMProfile object itself. - */ - public VirtualMachineScaleSetVMProfile withLicenseType(String licenseType) { - this.licenseType = licenseType; - return this; - } - - /** - * Get the priority property: Specifies the priority for the virtual machines in the scale set. - * <br><br>Minimum api-version: 2017-10-30-preview. - * - * @return the priority value. - */ - public VirtualMachinePriorityTypes priority() { - return this.priority; - } - - /** - * Set the priority property: Specifies the priority for the virtual machines in the scale set. - * <br><br>Minimum api-version: 2017-10-30-preview. - * - * @param priority the priority value to set. - * @return the VirtualMachineScaleSetVMProfile object itself. - */ - public VirtualMachineScaleSetVMProfile withPriority(VirtualMachinePriorityTypes priority) { - this.priority = priority; - return this; - } - - /** - * Get the evictionPolicy property: Specifies the eviction policy for the Azure Spot virtual machine and Azure Spot - * scale set. <br><br>For Azure Spot virtual machines, both 'Deallocate' and 'Delete' are supported and - * the minimum api-version is 2019-03-01. <br><br>For Azure Spot scale sets, both 'Deallocate' and - * 'Delete' are supported and the minimum api-version is 2017-10-30-preview. - * - * @return the evictionPolicy value. - */ - public VirtualMachineEvictionPolicyTypes evictionPolicy() { - return this.evictionPolicy; - } - - /** - * Set the evictionPolicy property: Specifies the eviction policy for the Azure Spot virtual machine and Azure Spot - * scale set. <br><br>For Azure Spot virtual machines, both 'Deallocate' and 'Delete' are supported and - * the minimum api-version is 2019-03-01. <br><br>For Azure Spot scale sets, both 'Deallocate' and - * 'Delete' are supported and the minimum api-version is 2017-10-30-preview. - * - * @param evictionPolicy the evictionPolicy value to set. - * @return the VirtualMachineScaleSetVMProfile object itself. - */ - public VirtualMachineScaleSetVMProfile withEvictionPolicy(VirtualMachineEvictionPolicyTypes evictionPolicy) { - this.evictionPolicy = evictionPolicy; - return this; - } - - /** - * Get the billingProfile property: Specifies the billing related details of a Azure Spot VMSS. - * <br><br>Minimum api-version: 2019-03-01. - * - * @return the billingProfile value. - */ - public BillingProfile billingProfile() { - return this.billingProfile; - } - - /** - * Set the billingProfile property: Specifies the billing related details of a Azure Spot VMSS. - * <br><br>Minimum api-version: 2019-03-01. - * - * @param billingProfile the billingProfile value to set. - * @return the VirtualMachineScaleSetVMProfile object itself. - */ - public VirtualMachineScaleSetVMProfile withBillingProfile(BillingProfile billingProfile) { - this.billingProfile = billingProfile; - return this; - } - - /** - * Get the scheduledEventsProfile property: Specifies Scheduled Event related configurations. - * - * @return the scheduledEventsProfile value. - */ - public ScheduledEventsProfile scheduledEventsProfile() { - return this.scheduledEventsProfile; - } - - /** - * Set the scheduledEventsProfile property: Specifies Scheduled Event related configurations. - * - * @param scheduledEventsProfile the scheduledEventsProfile value to set. - * @return the VirtualMachineScaleSetVMProfile object itself. - */ - public VirtualMachineScaleSetVMProfile withScheduledEventsProfile(ScheduledEventsProfile scheduledEventsProfile) { - this.scheduledEventsProfile = scheduledEventsProfile; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (osProfile() != null) { - osProfile().validate(); - } - if (storageProfile() != null) { - storageProfile().validate(); - } - if (networkProfile() != null) { - networkProfile().validate(); - } - if (securityProfile() != null) { - securityProfile().validate(); - } - if (diagnosticsProfile() != null) { - diagnosticsProfile().validate(); - } - if (extensionProfile() != null) { - extensionProfile().validate(); - } - if (billingProfile() != null) { - billingProfile().validate(); - } - if (scheduledEventsProfile() != null) { - scheduledEventsProfile().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetVMProtectionPolicy.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetVMProtectionPolicy.java deleted file mode 100644 index ea2b44bc0810..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetVMProtectionPolicy.java +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The protection policy of a virtual machine scale set VM. */ -@Fluent -public final class VirtualMachineScaleSetVMProtectionPolicy { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetVMProtectionPolicy.class); - - /* - * Indicates that the virtual machine scale set VM shouldn't be considered - * for deletion during a scale-in operation. - */ - @JsonProperty(value = "protectFromScaleIn") - private Boolean protectFromScaleIn; - - /* - * Indicates that model updates or actions (including scale-in) initiated - * on the virtual machine scale set should not be applied to the virtual - * machine scale set VM. - */ - @JsonProperty(value = "protectFromScaleSetActions") - private Boolean protectFromScaleSetActions; - - /** - * Get the protectFromScaleIn property: Indicates that the virtual machine scale set VM shouldn't be considered for - * deletion during a scale-in operation. - * - * @return the protectFromScaleIn value. - */ - public Boolean protectFromScaleIn() { - return this.protectFromScaleIn; - } - - /** - * Set the protectFromScaleIn property: Indicates that the virtual machine scale set VM shouldn't be considered for - * deletion during a scale-in operation. - * - * @param protectFromScaleIn the protectFromScaleIn value to set. - * @return the VirtualMachineScaleSetVMProtectionPolicy object itself. - */ - public VirtualMachineScaleSetVMProtectionPolicy withProtectFromScaleIn(Boolean protectFromScaleIn) { - this.protectFromScaleIn = protectFromScaleIn; - return this; - } - - /** - * Get the protectFromScaleSetActions property: Indicates that model updates or actions (including scale-in) - * initiated on the virtual machine scale set should not be applied to the virtual machine scale set VM. - * - * @return the protectFromScaleSetActions value. - */ - public Boolean protectFromScaleSetActions() { - return this.protectFromScaleSetActions; - } - - /** - * Set the protectFromScaleSetActions property: Indicates that model updates or actions (including scale-in) - * initiated on the virtual machine scale set should not be applied to the virtual machine scale set VM. - * - * @param protectFromScaleSetActions the protectFromScaleSetActions value to set. - * @return the VirtualMachineScaleSetVMProtectionPolicy object itself. - */ - public VirtualMachineScaleSetVMProtectionPolicy withProtectFromScaleSetActions(Boolean protectFromScaleSetActions) { - this.protectFromScaleSetActions = protectFromScaleSetActions; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetVMReimageParameters.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetVMReimageParameters.java deleted file mode 100644 index d4fc68e680bf..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetVMReimageParameters.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; - -/** Describes a Virtual Machine Scale Set VM Reimage Parameters. */ -@Fluent -public class VirtualMachineScaleSetVMReimageParameters extends VirtualMachineReimageParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetVMReimageParameters.class); - - /** {@inheritDoc} */ - @Override - public VirtualMachineScaleSetVMReimageParameters withTempDisk(Boolean tempDisk) { - super.withTempDisk(tempDisk); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetVMs.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetVMs.java deleted file mode 100644 index 42936aeb2ded..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetVMs.java +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; -import java.util.Collection; -import reactor.core.publisher.Mono; - -/** Entry point to virtual machine scale set instance management API. */ -@Fluent -public interface VirtualMachineScaleSetVMs extends SupportsListing { - /** - * Deletes the specified virtual machine instances from the scale set. - * - * @param instanceIds instance IDs of the virtual machine scale set instances to be deleted - * @return a representation of the deferred computation of this call. - */ - Mono deleteInstancesAsync(Collection instanceIds); - - /** - * Deletes the specified virtual machine instances from the scale set. - * - * @param instanceIds instance IDs of the virtual machine scale set instances to be deleted - * @return a representation of the deferred computation of this call. - */ - Mono deleteInstancesAsync(String... instanceIds); - - /** - * Deletes the specified virtual machine instances from the scale set. - * - * @param instanceIds instance IDs of the virtual machine scale set instances to be deleted - */ - void deleteInstances(String... instanceIds); - - /** - * Deletes the specified virtual machine instances from the scale set. - * - * @param instanceIds instance IDs of the virtual machine scale set instances to be deleted - */ - void deleteInstances(Collection instanceIds); - - /** - * Get the specified virtual machine instance from the scale set. - * - * @param instanceId instance ID of the virtual machine scale set instance to be fetched - * @return the virtual machine scale set instance. - */ - VirtualMachineScaleSetVM getInstance(String instanceId); - - /** - * Get the specified virtual machine instance from the scale set. - * - * @param instanceId instance ID of the virtual machine scale set instance to be fetched. - * @return the virtual machine scale set instance. - */ - Mono getInstanceAsync(String instanceId); - - /** - * Updates the specified virtual machine instances from the scale set. - * - * @param instanceIds instance IDs of the virtual machine scale set instances to be updated - * @return a representation of the deferred computation of this call. - */ - Mono updateInstancesAsync(Collection instanceIds); - - /** - * Updates the specified virtual machine instances from the scale set. - * - * @param instanceIds instance IDs of the virtual machine scale set instances to be updated - * @return a representation of the deferred computation of this call. - */ - Mono updateInstancesAsync(String... instanceIds); - - /** - * Updates the specified virtual machine instances from the scale set. - * - * @param instanceIds instance IDs of the virtual machine scale set instances to be updated - */ - void updateInstances(String... instanceIds); - - /** - * Simulates the eviction of the specified spot virtual machine in the scale set asynchronously. The eviction will - * occur with 30 minutes after calling this API. - * - * @param instanceId The instance ID of the virtual machine. - * @return a representation of the deferred computation of this call - */ - Mono simulateEvictionAsync(String instanceId); - - /** - * Simulates the eviction of the specified spot virtual machine in the scale set. The eviction will occur with 30 - * minutes after calling this API. - * - * @param instanceId The instance ID of the virtual machine. - */ - void simulateEviction(String instanceId); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSets.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSets.java deleted file mode 100644 index 17df197dc997..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSets.java +++ /dev/null @@ -1,249 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.exception.ManagementException; -import com.azure.resourcemanager.compute.ComputeManager; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsBatchDeletion; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsDeletingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsListingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsBatchCreation; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsCreating; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingById; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; -import java.io.IOException; -import java.util.Collection; -import java.util.List; - -import reactor.core.publisher.Mono; - -/** Entry point to virtual machine scale set management API. */ -@Fluent -public interface VirtualMachineScaleSets - extends SupportsListing, - SupportsListingByResourceGroup, - SupportsGettingByResourceGroup, - SupportsGettingById, - SupportsCreating, - SupportsDeletingById, - SupportsDeletingByResourceGroup, - SupportsBatchCreation, - SupportsBatchDeletion, - HasManager { - /** - * Shuts down the virtual machines in the scale set and releases the compute resources. - * - * @param groupName the name of the resource group the virtual machine scale set is in - * @param name the name of the virtual machine scale set - * @throws ManagementException thrown for an invalid response from the service. - * @throws IOException exception thrown from serialization/deserialization - * @throws InterruptedException exception thrown when the operation is interrupted - */ - void deallocate(String groupName, String name) throws ManagementException, IOException, InterruptedException; - - /** - * Shuts down the virtual machines in the scale set and releases the compute resources asynchronously. - * - * @param groupName the name of the resource group the virtual machine scale set is in - * @param name the name of the virtual machine scale set - * @return a representation of the deferred computation of this call - */ - Mono deallocateAsync(String groupName, String name); - - /** - * Powers off (stops) the virtual machines in the scale set. - * - * @param groupName the name of the resource group the virtual machine scale set is in - * @param name the name of the virtual machine scale set - * @throws ManagementException thrown for an invalid response from the service. - * @throws IOException exception thrown from serialization/deserialization - * @throws InterruptedException exception thrown when the operation is interrupted - */ - void powerOff(String groupName, String name) throws ManagementException, IOException, InterruptedException; - - /** - * Powers off (stops) the virtual machines in the scale set asynchronously. - * - * @param groupName the name of the resource group the virtual machine in the scale set is in - * @param name the name of the virtual machine scale set - * @return a representation of the deferred computation of this call - */ - Mono powerOffAsync(String groupName, String name); - - /** - * Restarts the virtual machines in the scale set. - * - * @param groupName the name of the resource group the virtual machine scale set is in - * @param name the name of the virtual machine scale set - * @throws ManagementException thrown for an invalid response from the service. - * @throws IOException exception thrown from serialization/deserialization - * @throws InterruptedException exception thrown when the operation is interrupted - */ - void restart(String groupName, String name) throws ManagementException, IOException, InterruptedException; - - /** - * Restarts the virtual machines in the scale set asynchronously. - * - * @param groupName the name of the resource group the virtual machine scale set is in - * @param name the virtual machine scale set name - * @return a representation of the deferred computation of this call - */ - Mono restartAsync(String groupName, String name); - - /** - * Starts the virtual machines in the scale set. - * - * @param groupName the name of the resource group the virtual machine scale set is in - * @param name the name of the virtual machine scale set - * @throws ManagementException thrown for an invalid response from the service. - * @throws IOException exception thrown from serialization/deserialization - * @throws InterruptedException exception thrown when the operation is interrupted - */ - void start(String groupName, String name) throws ManagementException, IOException, InterruptedException; - - /** - * Starts the virtual machines in the scale set asynchronously. - * - * @param groupName the name of the resource group the virtual machine scale set is in - * @param name the name of the virtual machine scale set - * @return a representation of the deferred computation of this call - */ - Mono startAsync(String groupName, String name); - - /** - * Re-images (updates the version of the installed operating system) the virtual machines in the scale set. - * - * @param groupName the name of the resource group the virtual machine scale set is in - * @param name the name of the virtual machine scale set - * @throws ManagementException thrown for an invalid response from the service. - * @throws IOException exception thrown from serialization/deserialization - * @throws InterruptedException exception thrown when the operation is interrupted - */ - void reimage(String groupName, String name) throws ManagementException, IOException, InterruptedException; - - /** - * Re-images (updates the version of the installed operating system) the virtual machines in the scale set - * asynchronously. - * - * @param groupName the name of the resource group the virtual machine scale set is in - * @param name the name of the virtual machine scale set - * @return a representation of the deferred computation of this call - */ - Mono reimageAsync(String groupName, String name); - - /** - * Run PowerShell script in a virtual machine instance in a scale set. - * - * @param groupName the resource group name - * @param scaleSetName the virtual machine scale set name - * @param vmId the virtual machine instance id - * @param scriptLines PowerShell script lines - * @param scriptParameters script parameters - * @return result of PowerShell script execution - */ - RunCommandResult runPowerShellScriptInVMInstance( - String groupName, - String scaleSetName, - String vmId, - List scriptLines, - List scriptParameters); - - /** - * Run PowerShell in a virtual machine instance in a scale set asynchronously. - * - * @param groupName the resource group name - * @param scaleSetName the virtual machine scale set name - * @param vmId the virtual machine instance id - * @param scriptLines PowerShell script lines - * @param scriptParameters script parameters - * @return handle to the asynchronous execution - */ - Mono runPowerShellScriptInVMInstanceAsync( - String groupName, - String scaleSetName, - String vmId, - List scriptLines, - List scriptParameters); - - /** - * Run shell script in a virtual machine instance in a scale set. - * - * @param groupName the resource group name - * @param scaleSetName the virtual machine scale set name - * @param vmId the virtual machine instance id - * @param scriptLines shell script lines - * @param scriptParameters script parameters - * @return result of shell script execution - */ - RunCommandResult runShellScriptInVMInstance( - String groupName, - String scaleSetName, - String vmId, - List scriptLines, - List scriptParameters); - - /** - * Run shell script in a virtual machine instance in a scale set asynchronously. - * - * @param groupName the resource group name - * @param scaleSetName the virtual machine scale set name - * @param vmId the virtual machine instance id - * @param scriptLines shell script lines - * @param scriptParameters script parameters - * @return handle to the asynchronous execution - */ - Mono runShellScriptInVMInstanceAsync( - String groupName, - String scaleSetName, - String vmId, - List scriptLines, - List scriptParameters); - - /** - * Run commands in a virtual machine instance in a scale set. - * - * @param groupName the resource group name - * @param scaleSetName the virtual machine scale set name - * @param vmId the virtual machine instance id - * @param inputCommand command input - * @return result of execution - */ - RunCommandResult runCommandInVMInstance( - String groupName, String scaleSetName, String vmId, RunCommandInput inputCommand); - - /** - * Run commands in a virtual machine instance in a scale set asynchronously. - * - * @param groupName the resource group name - * @param scaleSetName the virtual machine scale set name - * @param vmId the virtual machine instance id - * @param inputCommand command input - * @return handle to the asynchronous execution - */ - Mono runCommandVMInstanceAsync( - String groupName, String scaleSetName, String vmId, RunCommandInput inputCommand); - - /** - * Delete virtual machine instances. - * - * @param groupName the resource group name - * @param scaleSetName the virtual machine scale set name - * @param instanceIds instance IDs - */ - void deleteInstances(String groupName, String scaleSetName, Collection instanceIds); - - /** - * Delete virtual machine instances. - * - * @param groupName the resource group name - * @param scaleSetName the virtual machine scale set name - * @param instanceIds instance IDs - * @return a representation of the deferred computation of this call - */ - Mono deleteInstancesAsync(String groupName, String scaleSetName, Collection instanceIds); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineSize.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineSize.java deleted file mode 100644 index d03ed9769792..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineSize.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasName; - -/** A type representing virtual machine size available for a subscription in a region. */ -@Fluent -public interface VirtualMachineSize extends HasName { - /** @return the number of cores supported by the VM size */ - int numberOfCores(); - - /** @return the OS disk size allowed by the VM size */ - int osDiskSizeInMB(); - - /** @return the resource disk size allowed by the VM size */ - int resourceDiskSizeInMB(); - - /** @return the memory size supported by the VM size */ - int memoryInMB(); - - /** @return the maximum number of data disks allowed by a VM size */ - int maxDataDiskCount(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineSizeListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineSizeListResult.java deleted file mode 100644 index ce9223d3fdd2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineSizeListResult.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineSizeInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The List Virtual Machine operation response. */ -@Fluent -public final class VirtualMachineSizeListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineSizeListResult.class); - - /* - * The list of virtual machine sizes. - */ - @JsonProperty(value = "value") - private List value; - - /** - * Get the value property: The list of virtual machine sizes. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The list of virtual machine sizes. - * - * @param value the value value to set. - * @return the VirtualMachineSizeListResult object itself. - */ - public VirtualMachineSizeListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineSizeTypes.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineSizeTypes.java deleted file mode 100644 index 4141f7f464a3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineSizeTypes.java +++ /dev/null @@ -1,526 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for VirtualMachineSizeTypes. */ -public final class VirtualMachineSizeTypes extends ExpandableStringEnum { - /** Static value Basic_A0 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes BASIC_A0 = fromString("Basic_A0"); - - /** Static value Basic_A1 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes BASIC_A1 = fromString("Basic_A1"); - - /** Static value Basic_A2 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes BASIC_A2 = fromString("Basic_A2"); - - /** Static value Basic_A3 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes BASIC_A3 = fromString("Basic_A3"); - - /** Static value Basic_A4 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes BASIC_A4 = fromString("Basic_A4"); - - /** Static value Standard_A0 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_A0 = fromString("Standard_A0"); - - /** Static value Standard_A1 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_A1 = fromString("Standard_A1"); - - /** Static value Standard_A2 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_A2 = fromString("Standard_A2"); - - /** Static value Standard_A3 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_A3 = fromString("Standard_A3"); - - /** Static value Standard_A4 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_A4 = fromString("Standard_A4"); - - /** Static value Standard_A5 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_A5 = fromString("Standard_A5"); - - /** Static value Standard_A6 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_A6 = fromString("Standard_A6"); - - /** Static value Standard_A7 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_A7 = fromString("Standard_A7"); - - /** Static value Standard_A8 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_A8 = fromString("Standard_A8"); - - /** Static value Standard_A9 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_A9 = fromString("Standard_A9"); - - /** Static value Standard_A10 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_A10 = fromString("Standard_A10"); - - /** Static value Standard_A11 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_A11 = fromString("Standard_A11"); - - /** Static value Standard_A1_v2 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_A1_V2 = fromString("Standard_A1_v2"); - - /** Static value Standard_A2_v2 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_A2_V2 = fromString("Standard_A2_v2"); - - /** Static value Standard_A4_v2 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_A4_V2 = fromString("Standard_A4_v2"); - - /** Static value Standard_A8_v2 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_A8_V2 = fromString("Standard_A8_v2"); - - /** Static value Standard_A2m_v2 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_A2M_V2 = fromString("Standard_A2m_v2"); - - /** Static value Standard_A4m_v2 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_A4M_V2 = fromString("Standard_A4m_v2"); - - /** Static value Standard_A8m_v2 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_A8M_V2 = fromString("Standard_A8m_v2"); - - /** Static value Standard_B1s for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_B1S = fromString("Standard_B1s"); - - /** Static value Standard_B1ms for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_B1MS = fromString("Standard_B1ms"); - - /** Static value Standard_B2s for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_B2S = fromString("Standard_B2s"); - - /** Static value Standard_B2ms for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_B2MS = fromString("Standard_B2ms"); - - /** Static value Standard_B4ms for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_B4MS = fromString("Standard_B4ms"); - - /** Static value Standard_B8ms for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_B8MS = fromString("Standard_B8ms"); - - /** Static value Standard_D1 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_D1 = fromString("Standard_D1"); - - /** Static value Standard_D2 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_D2 = fromString("Standard_D2"); - - /** Static value Standard_D3 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_D3 = fromString("Standard_D3"); - - /** Static value Standard_D4 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_D4 = fromString("Standard_D4"); - - /** Static value Standard_D11 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_D11 = fromString("Standard_D11"); - - /** Static value Standard_D12 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_D12 = fromString("Standard_D12"); - - /** Static value Standard_D13 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_D13 = fromString("Standard_D13"); - - /** Static value Standard_D14 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_D14 = fromString("Standard_D14"); - - /** Static value Standard_D1_v2 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_D1_V2 = fromString("Standard_D1_v2"); - - /** Static value Standard_D2_v2 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_D2_V2 = fromString("Standard_D2_v2"); - - /** Static value Standard_D3_v2 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_D3_V2 = fromString("Standard_D3_v2"); - - /** Static value Standard_D4_v2 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_D4_V2 = fromString("Standard_D4_v2"); - - /** Static value Standard_D5_v2 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_D5_V2 = fromString("Standard_D5_v2"); - - /** Static value Standard_D2_v3 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_D2_V3 = fromString("Standard_D2_v3"); - - /** Static value Standard_D4_v3 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_D4_V3 = fromString("Standard_D4_v3"); - - /** Static value Standard_D8_v3 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_D8_V3 = fromString("Standard_D8_v3"); - - /** Static value Standard_D16_v3 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_D16_V3 = fromString("Standard_D16_v3"); - - /** Static value Standard_D32_v3 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_D32_V3 = fromString("Standard_D32_v3"); - - /** Static value Standard_D64_v3 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_D64_V3 = fromString("Standard_D64_v3"); - - /** Static value Standard_D2s_v3 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_D2S_V3 = fromString("Standard_D2s_v3"); - - /** Static value Standard_D4s_v3 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_D4S_V3 = fromString("Standard_D4s_v3"); - - /** Static value Standard_D8s_v3 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_D8S_V3 = fromString("Standard_D8s_v3"); - - /** Static value Standard_D16s_v3 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_D16S_V3 = fromString("Standard_D16s_v3"); - - /** Static value Standard_D32s_v3 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_D32S_V3 = fromString("Standard_D32s_v3"); - - /** Static value Standard_D64s_v3 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_D64S_V3 = fromString("Standard_D64s_v3"); - - /** Static value Standard_D11_v2 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_D11_V2 = fromString("Standard_D11_v2"); - - /** Static value Standard_D12_v2 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_D12_V2 = fromString("Standard_D12_v2"); - - /** Static value Standard_D13_v2 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_D13_V2 = fromString("Standard_D13_v2"); - - /** Static value Standard_D14_v2 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_D14_V2 = fromString("Standard_D14_v2"); - - /** Static value Standard_D15_v2 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_D15_V2 = fromString("Standard_D15_v2"); - - /** Static value Standard_DS1 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_DS1 = fromString("Standard_DS1"); - - /** Static value Standard_DS2 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_DS2 = fromString("Standard_DS2"); - - /** Static value Standard_DS3 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_DS3 = fromString("Standard_DS3"); - - /** Static value Standard_DS4 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_DS4 = fromString("Standard_DS4"); - - /** Static value Standard_DS11 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_DS11 = fromString("Standard_DS11"); - - /** Static value Standard_DS12 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_DS12 = fromString("Standard_DS12"); - - /** Static value Standard_DS13 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_DS13 = fromString("Standard_DS13"); - - /** Static value Standard_DS14 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_DS14 = fromString("Standard_DS14"); - - /** Static value Standard_DS1_v2 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_DS1_V2 = fromString("Standard_DS1_v2"); - - /** Static value Standard_DS2_v2 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_DS2_V2 = fromString("Standard_DS2_v2"); - - /** Static value Standard_DS3_v2 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_DS3_V2 = fromString("Standard_DS3_v2"); - - /** Static value Standard_DS4_v2 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_DS4_V2 = fromString("Standard_DS4_v2"); - - /** Static value Standard_DS5_v2 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_DS5_V2 = fromString("Standard_DS5_v2"); - - /** Static value Standard_DS11_v2 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_DS11_V2 = fromString("Standard_DS11_v2"); - - /** Static value Standard_DS12_v2 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_DS12_V2 = fromString("Standard_DS12_v2"); - - /** Static value Standard_DS13_v2 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_DS13_V2 = fromString("Standard_DS13_v2"); - - /** Static value Standard_DS14_v2 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_DS14_V2 = fromString("Standard_DS14_v2"); - - /** Static value Standard_DS15_v2 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_DS15_V2 = fromString("Standard_DS15_v2"); - - /** Static value Standard_DS13-4_v2 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_DS13_4_V2 = fromString("Standard_DS13-4_v2"); - - /** Static value Standard_DS13-2_v2 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_DS13_2_V2 = fromString("Standard_DS13-2_v2"); - - /** Static value Standard_DS14-8_v2 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_DS14_8_V2 = fromString("Standard_DS14-8_v2"); - - /** Static value Standard_DS14-4_v2 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_DS14_4_V2 = fromString("Standard_DS14-4_v2"); - - /** Static value Standard_E2_v3 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_E2_V3 = fromString("Standard_E2_v3"); - - /** Static value Standard_E4_v3 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_E4_V3 = fromString("Standard_E4_v3"); - - /** Static value Standard_E8_v3 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_E8_V3 = fromString("Standard_E8_v3"); - - /** Static value Standard_E16_v3 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_E16_V3 = fromString("Standard_E16_v3"); - - /** Static value Standard_E32_v3 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_E32_V3 = fromString("Standard_E32_v3"); - - /** Static value Standard_E64_v3 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_E64_V3 = fromString("Standard_E64_v3"); - - /** Static value Standard_E2s_v3 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_E2S_V3 = fromString("Standard_E2s_v3"); - - /** Static value Standard_E4s_v3 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_E4S_V3 = fromString("Standard_E4s_v3"); - - /** Static value Standard_E8s_v3 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_E8S_V3 = fromString("Standard_E8s_v3"); - - /** Static value Standard_E16s_v3 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_E16S_V3 = fromString("Standard_E16s_v3"); - - /** Static value Standard_E32s_v3 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_E32S_V3 = fromString("Standard_E32s_v3"); - - /** Static value Standard_E64s_v3 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_E64S_V3 = fromString("Standard_E64s_v3"); - - /** Static value Standard_E32-16_v3 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_E32_16_V3 = fromString("Standard_E32-16_v3"); - - /** Static value Standard_E32-8s_v3 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_E32_8S_V3 = fromString("Standard_E32-8s_v3"); - - /** Static value Standard_E64-32s_v3 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_E64_32S_V3 = fromString("Standard_E64-32s_v3"); - - /** Static value Standard_E64-16s_v3 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_E64_16S_V3 = fromString("Standard_E64-16s_v3"); - - /** Static value Standard_F1 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_F1 = fromString("Standard_F1"); - - /** Static value Standard_F2 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_F2 = fromString("Standard_F2"); - - /** Static value Standard_F4 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_F4 = fromString("Standard_F4"); - - /** Static value Standard_F8 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_F8 = fromString("Standard_F8"); - - /** Static value Standard_F16 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_F16 = fromString("Standard_F16"); - - /** Static value Standard_F1s for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_F1S = fromString("Standard_F1s"); - - /** Static value Standard_F2s for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_F2S = fromString("Standard_F2s"); - - /** Static value Standard_F4s for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_F4S = fromString("Standard_F4s"); - - /** Static value Standard_F8s for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_F8S = fromString("Standard_F8s"); - - /** Static value Standard_F16s for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_F16S = fromString("Standard_F16s"); - - /** Static value Standard_F2s_v2 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_F2S_V2 = fromString("Standard_F2s_v2"); - - /** Static value Standard_F4s_v2 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_F4S_V2 = fromString("Standard_F4s_v2"); - - /** Static value Standard_F8s_v2 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_F8S_V2 = fromString("Standard_F8s_v2"); - - /** Static value Standard_F16s_v2 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_F16S_V2 = fromString("Standard_F16s_v2"); - - /** Static value Standard_F32s_v2 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_F32S_V2 = fromString("Standard_F32s_v2"); - - /** Static value Standard_F64s_v2 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_F64S_V2 = fromString("Standard_F64s_v2"); - - /** Static value Standard_F72s_v2 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_F72S_V2 = fromString("Standard_F72s_v2"); - - /** Static value Standard_G1 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_G1 = fromString("Standard_G1"); - - /** Static value Standard_G2 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_G2 = fromString("Standard_G2"); - - /** Static value Standard_G3 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_G3 = fromString("Standard_G3"); - - /** Static value Standard_G4 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_G4 = fromString("Standard_G4"); - - /** Static value Standard_G5 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_G5 = fromString("Standard_G5"); - - /** Static value Standard_GS1 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_GS1 = fromString("Standard_GS1"); - - /** Static value Standard_GS2 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_GS2 = fromString("Standard_GS2"); - - /** Static value Standard_GS3 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_GS3 = fromString("Standard_GS3"); - - /** Static value Standard_GS4 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_GS4 = fromString("Standard_GS4"); - - /** Static value Standard_GS5 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_GS5 = fromString("Standard_GS5"); - - /** Static value Standard_GS4-8 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_GS4_8 = fromString("Standard_GS4-8"); - - /** Static value Standard_GS4-4 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_GS4_4 = fromString("Standard_GS4-4"); - - /** Static value Standard_GS5-16 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_GS5_16 = fromString("Standard_GS5-16"); - - /** Static value Standard_GS5-8 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_GS5_8 = fromString("Standard_GS5-8"); - - /** Static value Standard_H8 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_H8 = fromString("Standard_H8"); - - /** Static value Standard_H16 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_H16 = fromString("Standard_H16"); - - /** Static value Standard_H8m for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_H8M = fromString("Standard_H8m"); - - /** Static value Standard_H16m for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_H16M = fromString("Standard_H16m"); - - /** Static value Standard_H16r for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_H16R = fromString("Standard_H16r"); - - /** Static value Standard_H16mr for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_H16MR = fromString("Standard_H16mr"); - - /** Static value Standard_L4s for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_L4S = fromString("Standard_L4s"); - - /** Static value Standard_L8s for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_L8S = fromString("Standard_L8s"); - - /** Static value Standard_L16s for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_L16S = fromString("Standard_L16s"); - - /** Static value Standard_L32s for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_L32S = fromString("Standard_L32s"); - - /** Static value Standard_M64s for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_M64S = fromString("Standard_M64s"); - - /** Static value Standard_M64ms for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_M64MS = fromString("Standard_M64ms"); - - /** Static value Standard_M128s for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_M128S = fromString("Standard_M128s"); - - /** Static value Standard_M128ms for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_M128MS = fromString("Standard_M128ms"); - - /** Static value Standard_M64-32ms for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_M64_32MS = fromString("Standard_M64-32ms"); - - /** Static value Standard_M64-16ms for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_M64_16MS = fromString("Standard_M64-16ms"); - - /** Static value Standard_M128-64ms for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_M128_64MS = fromString("Standard_M128-64ms"); - - /** Static value Standard_M128-32ms for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_M128_32MS = fromString("Standard_M128-32ms"); - - /** Static value Standard_NC6 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_NC6 = fromString("Standard_NC6"); - - /** Static value Standard_NC12 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_NC12 = fromString("Standard_NC12"); - - /** Static value Standard_NC24 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_NC24 = fromString("Standard_NC24"); - - /** Static value Standard_NC24r for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_NC24R = fromString("Standard_NC24r"); - - /** Static value Standard_NC6s_v2 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_NC6S_V2 = fromString("Standard_NC6s_v2"); - - /** Static value Standard_NC12s_v2 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_NC12S_V2 = fromString("Standard_NC12s_v2"); - - /** Static value Standard_NC24s_v2 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_NC24S_V2 = fromString("Standard_NC24s_v2"); - - /** Static value Standard_NC24rs_v2 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_NC24RS_V2 = fromString("Standard_NC24rs_v2"); - - /** Static value Standard_NC6s_v3 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_NC6S_V3 = fromString("Standard_NC6s_v3"); - - /** Static value Standard_NC12s_v3 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_NC12S_V3 = fromString("Standard_NC12s_v3"); - - /** Static value Standard_NC24s_v3 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_NC24S_V3 = fromString("Standard_NC24s_v3"); - - /** Static value Standard_NC24rs_v3 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_NC24RS_V3 = fromString("Standard_NC24rs_v3"); - - /** Static value Standard_ND6s for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_ND6S = fromString("Standard_ND6s"); - - /** Static value Standard_ND12s for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_ND12S = fromString("Standard_ND12s"); - - /** Static value Standard_ND24s for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_ND24S = fromString("Standard_ND24s"); - - /** Static value Standard_ND24rs for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_ND24RS = fromString("Standard_ND24rs"); - - /** Static value Standard_NV6 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_NV6 = fromString("Standard_NV6"); - - /** Static value Standard_NV12 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_NV12 = fromString("Standard_NV12"); - - /** Static value Standard_NV24 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_NV24 = fromString("Standard_NV24"); - - /** - * Creates or finds a VirtualMachineSizeTypes from its string representation. - * - * @param name a name to look for. - * @return the corresponding VirtualMachineSizeTypes. - */ - @JsonCreator - public static VirtualMachineSizeTypes fromString(String name) { - return fromString(name, VirtualMachineSizeTypes.class); - } - - /** @return known VirtualMachineSizeTypes values. */ - public static Collection values() { - return values(VirtualMachineSizeTypes.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineSizes.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineSizes.java deleted file mode 100644 index 231b7b2ebe21..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineSizes.java +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListingByRegion; - -/** Entry point to virtual machine sizes API. */ -@Fluent -public interface VirtualMachineSizes extends SupportsListingByRegion { -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineSku.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineSku.java deleted file mode 100644 index 5e309ee9e758..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineSku.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Region; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasName; - -/** Represents a virtual machine image SKU. */ -@Fluent -public interface VirtualMachineSku extends HasName { - /** @return the region where this virtual machine image offer SKU is available */ - Region region(); - - /** @return the publisher of this virtual machine image offer SKU */ - VirtualMachinePublisher publisher(); - - /** @return the virtual machine offer name that this SKU belongs to */ - VirtualMachineOffer offer(); - - /** @return virtual machine images in the SKU */ - VirtualMachineImagesInSku images(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineSkus.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineSkus.java deleted file mode 100644 index 06bb4b742b4f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineSkus.java +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; - -/** Entry point to virtual machine image offer SKUs. */ -@Fluent -public interface VirtualMachineSkus extends SupportsListing { -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineSoftwarePatchProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineSoftwarePatchProperties.java deleted file mode 100644 index 6434d1e7d7f8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineSoftwarePatchProperties.java +++ /dev/null @@ -1,179 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; - -/** Describes the properties of a Virtual Machine software patch. */ -@Immutable -public final class VirtualMachineSoftwarePatchProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineSoftwarePatchProperties.class); - - /* - * A unique identifier for the patch. - */ - @JsonProperty(value = "patchId", access = JsonProperty.Access.WRITE_ONLY) - private String patchId; - - /* - * The friendly name of the patch. - */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) - private String name; - - /* - * The version number of the patch. This property applies only to Linux - * patches. - */ - @JsonProperty(value = "version", access = JsonProperty.Access.WRITE_ONLY) - private String version; - - /* - * The KBID of the patch. Only applies to Windows patches. - */ - @JsonProperty(value = "kbid", access = JsonProperty.Access.WRITE_ONLY) - private String kbid; - - /* - * The classification(s) of the patch as provided by the patch publisher. - */ - @JsonProperty(value = "classifications", access = JsonProperty.Access.WRITE_ONLY) - private List classifications; - - /* - * Describes the reboot requirements of the patch. - */ - @JsonProperty(value = "rebootBehavior", access = JsonProperty.Access.WRITE_ONLY) - private SoftwareUpdateRebootBehavior rebootBehavior; - - /* - * The activity ID of the operation that produced this result. It is used - * to correlate across CRP and extension logs. - */ - @JsonProperty(value = "activityId", access = JsonProperty.Access.WRITE_ONLY) - private String activityId; - - /* - * The UTC timestamp when the repository published this patch. - */ - @JsonProperty(value = "publishedDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime publishedDate; - - /* - * The UTC timestamp of the last update to this patch record. - */ - @JsonProperty(value = "lastModifiedDateTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime lastModifiedDateTime; - - /* - * Describes the outcome of an install operation for a given patch. - */ - @JsonProperty(value = "assessmentState", access = JsonProperty.Access.WRITE_ONLY) - private PatchAssessmentState assessmentState; - - /** - * Get the patchId property: A unique identifier for the patch. - * - * @return the patchId value. - */ - public String patchId() { - return this.patchId; - } - - /** - * Get the name property: The friendly name of the patch. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the version property: The version number of the patch. This property applies only to Linux patches. - * - * @return the version value. - */ - public String version() { - return this.version; - } - - /** - * Get the kbid property: The KBID of the patch. Only applies to Windows patches. - * - * @return the kbid value. - */ - public String kbid() { - return this.kbid; - } - - /** - * Get the classifications property: The classification(s) of the patch as provided by the patch publisher. - * - * @return the classifications value. - */ - public List classifications() { - return this.classifications; - } - - /** - * Get the rebootBehavior property: Describes the reboot requirements of the patch. - * - * @return the rebootBehavior value. - */ - public SoftwareUpdateRebootBehavior rebootBehavior() { - return this.rebootBehavior; - } - - /** - * Get the activityId property: The activity ID of the operation that produced this result. It is used to correlate - * across CRP and extension logs. - * - * @return the activityId value. - */ - public String activityId() { - return this.activityId; - } - - /** - * Get the publishedDate property: The UTC timestamp when the repository published this patch. - * - * @return the publishedDate value. - */ - public OffsetDateTime publishedDate() { - return this.publishedDate; - } - - /** - * Get the lastModifiedDateTime property: The UTC timestamp of the last update to this patch record. - * - * @return the lastModifiedDateTime value. - */ - public OffsetDateTime lastModifiedDateTime() { - return this.lastModifiedDateTime; - } - - /** - * Get the assessmentState property: Describes the outcome of an install operation for a given patch. - * - * @return the assessmentState value. - */ - public PatchAssessmentState assessmentState() { - return this.assessmentState; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineStatusCodeCount.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineStatusCodeCount.java deleted file mode 100644 index 6850e9744de7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineStatusCodeCount.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The status code and count of the virtual machine scale set instance view status summary. */ -@Immutable -public final class VirtualMachineStatusCodeCount { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineStatusCodeCount.class); - - /* - * The instance view status code. - */ - @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) - private String code; - - /* - * The number of instances having a particular status code. - */ - @JsonProperty(value = "count", access = JsonProperty.Access.WRITE_ONLY) - private Integer count; - - /** - * Get the code property: The instance view status code. - * - * @return the code value. - */ - public String code() { - return this.code; - } - - /** - * Get the count property: The number of instances having a particular status code. - * - * @return the count value. - */ - public Integer count() { - return this.count; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineUnmanagedDataDisk.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineUnmanagedDataDisk.java deleted file mode 100644 index b79f9ba5903c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineUnmanagedDataDisk.java +++ /dev/null @@ -1,406 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.arm.models.ChildResource; -import com.azure.resourcemanager.resources.fluentcore.model.Attachable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.model.Settable; - -/** A native data disk of a virtual machine. */ -@Fluent -public interface VirtualMachineUnmanagedDataDisk extends HasInnerModel, ChildResource { - /** @return the size of this data disk in GB */ - int size(); - - /** @return the logical unit number assigned to this data disk */ - int lun(); - - /** @return URI to the virtual hard disk backing this data disk */ - String vhdUri(); - - /** - * Gets the disk caching type. - * - *

    possible values are: 'None', 'ReadOnly', 'ReadWrite' - * - * @return the caching type - */ - CachingTypes cachingType(); - - /** - * Uri to the source virtual hard disk user image from which this disk was created. - * - *

    null will be returned if this disk is not based on an image - * - * @return the URI of the source VHD image - */ - String sourceImageUri(); - - /** @return the creation method used while creating this disk */ - DiskCreateOptionTypes creationMethod(); - - /** Grouping of data disk definition stages applicable as part of a virtual machine creation. */ - interface DefinitionStages { - /** - * The first stage of a data disk definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface Blank extends WithDiskSource { - } - - /** - * The stage of the data disk definition allowing to choose the source. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithDiskSource { - /** - * Specifies the existing source VHD of the disk. - * - * @param storageAccountName the storage account name - * @param containerName the name of the container holding VHD file - * @param vhdName the name of the VHD file to attach - * @return the next stage of data disk definition - */ - WithVhdAttachedDiskSettings withExistingVhd( - String storageAccountName, String containerName, String vhdName); - /** - * specifies that disk needs to be created with a new VHD of given size. - * - * @param sizeInGB the initial disk size in GB - * @return the next stage of data disk definition - */ - WithNewVhdDiskSettings withNewVhd(int sizeInGB); - - /** - * Specifies the image LUN identifier of the source disk image. - * - * @param imageLun the LUN - * @return the next stage of data disk definition - */ - WithFromImageDiskSettings fromImage(int imageLun); - } - - /** - * The stage that allows configure the disk based on existing VHD. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithVhdAttachedDiskSettings extends WithAttach { - /** - * Specifies the size in GB the disk needs to be resized. - * - * @param sizeInGB the disk size in GB - * @return the next stage of data disk definition - */ - WithVhdAttachedDiskSettings withSizeInGB(Integer sizeInGB); - - /** - * Specifies the logical unit number for the data disk. - * - * @param lun the logical unit number - * @return the next stage of data disk definition - */ - WithVhdAttachedDiskSettings withLun(Integer lun); - - /** - * Specifies the caching type for the data disk. - * - * @param cachingType the disk caching type. Possible values include: 'None', 'ReadOnly', 'ReadWrite' - * @return the next stage of data disk definition - */ - WithVhdAttachedDiskSettings withCaching(CachingTypes cachingType); - } - - /** - * The stage that allows configure the disk based on new VHD. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithNewVhdDiskSettings extends WithAttach { - /** - * Specifies the logical unit number for the data disk. - * - * @param lun the logical unit number - * @return the next stage of data disk definition - */ - WithNewVhdDiskSettings withLun(Integer lun); - - /** - * Specifies the caching type for the data disk. - * - * @param cachingType the disk caching type. Possible values include: 'None', 'ReadOnly', 'ReadWrite' - * @return the next stage of data disk definition - */ - WithNewVhdDiskSettings withCaching(CachingTypes cachingType); - - /** - * Specifies where the VHD associated with the new blank data disk needs to be stored. - * - * @param storageAccountName the storage account name - * @param containerName the name of the container to hold the new VHD file - * @param vhdName the name for the new VHD file - * @return the next stage of data disk definition - */ - WithNewVhdDiskSettings storeAt(String storageAccountName, String containerName, String vhdName); - } - - /** - * The stage that allows configure the disk based on an image. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithFromImageDiskSettings extends WithAttach { - /** - * Specifies the size in GB the disk needs to be resized. - * - * @param sizeInGB the disk size in GB - * @return the next stage of data disk definition - */ - WithFromImageDiskSettings withSizeInGB(Integer sizeInGB); - - /** - * Specifies the caching type for the data disk. - * - * @param cachingType the disk caching type. Possible values include: 'None', 'ReadOnly', 'ReadWrite' - * @return the next stage of data disk definition - */ - WithFromImageDiskSettings withCaching(CachingTypes cachingType); - - /** - * Specifies where the VHD associated with the new blank data disk needs to be stored. - * - * @param storageAccountName the storage account name - * @param containerName the name of the container to hold the new VHD file - * @param vhdName the name for the new VHD file - * @return the next stage of data disk definition - */ - WithFromImageDiskSettings storeAt(String storageAccountName, String containerName, String vhdName); - } - - /** - * The final stage of the data disk definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithAttach extends Attachable.InDefinition { - } - } - - /** - * The entirety of a unmanaged data disk of a virtual machine scale set definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface DefinitionWithExistingVhd - extends DefinitionStages.Blank, - DefinitionStages.WithDiskSource, - DefinitionStages.WithVhdAttachedDiskSettings, - DefinitionStages.WithAttach { - } - - /** - * The entirety of a unmanaged data disk of a virtual machine scale set definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface DefinitionWithNewVhd - extends DefinitionStages.Blank, - DefinitionStages.WithDiskSource, - DefinitionStages.WithNewVhdDiskSettings, - DefinitionStages.WithAttach { - } - - /** - * The entirety of a unmanaged data disk of a virtual machine scale set definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface DefinitionWithImage - extends DefinitionStages.Blank, - DefinitionStages.WithDiskSource, - DefinitionStages.WithFromImageDiskSettings, - DefinitionStages.WithAttach { - } - - /** Grouping of data disk definition stages applicable as part of a virtual machine update. */ - interface UpdateDefinitionStages { - /** - * The first stage of a data disk definition. - * - * @param the stage of the parent update to return to after attaching this definition - */ - interface Blank extends WithDiskSource { - } - - /** - * The stage of the data disk definition allowing to choose the source. - * - * @param the stage of the parent update to return to after attaching this definition - */ - interface WithDiskSource { - /** - * Specifies the existing source VHD of the disk. - * - * @param storageAccountName the storage account name - * @param containerName the name of the container holding VHD file - * @param vhdName the name of the VHD file to attach - * @return the next stage of data disk definition - */ - WithVhdAttachedDiskSettings withExistingVhd( - String storageAccountName, String containerName, String vhdName); - - /** - * specifies that disk needs to be created with a new VHD of given size. - * - * @param sizeInGB the initial disk size in GB - * @return the next stage of data disk definition - */ - WithNewVhdDiskSettings withNewVhd(int sizeInGB); - } - - /** - * The stage that allows configure the disk based on existing VHD. - * - * @param the stage of the parent update to return to after attaching this definition - */ - interface WithVhdAttachedDiskSettings extends WithAttach { - /** - * Specifies the size in GB the disk needs to be resized. - * - * @param sizeInGB the disk size in GB - * @return the next stage of data disk definition - */ - WithVhdAttachedDiskSettings withSizeInGB(Integer sizeInGB); - - /** - * Specifies the logical unit number for the data disk. - * - * @param lun the logical unit number - * @return the next stage of data disk definition - */ - WithVhdAttachedDiskSettings withLun(Integer lun); - - /** - * Specifies the caching type for the data disk. - * - * @param cachingType the disk caching type. Possible values include: 'None', 'ReadOnly', 'ReadWrite' - * @return the next stage of data disk definition - */ - WithVhdAttachedDiskSettings withCaching(CachingTypes cachingType); - } - - /** - * The stage that allows configure the disk based on new VHD. - * - * @param the stage of the parent update to return to after attaching this definition - */ - interface WithNewVhdDiskSettings extends WithAttach { - /** - * Specifies the logical unit number for the data disk. - * - * @param lun the logical unit number - * @return the next stage of data disk definition - */ - WithNewVhdDiskSettings withLun(Integer lun); - - /** - * Specifies the caching type for the data disk. - * - * @param cachingType the disk caching type. Possible values include: 'None', 'ReadOnly', 'ReadWrite' - * @return the next stage of data disk definition - */ - WithNewVhdDiskSettings withCaching(CachingTypes cachingType); - - /** - * Specifies where the VHD associated with the new blank data disk needs to be stored. - * - * @param storageAccountName the storage account name - * @param containerName the name of the container to hold the new VHD file - * @param vhdName the name for the new VHD file - * @return the next stage of data disk definition - */ - WithNewVhdDiskSettings storeAt(String storageAccountName, String containerName, String vhdName); - } - - /** - * The final stage of the data disk definition. - * - * @param the stage of the parent update to return to after attaching this definition - */ - interface WithAttach extends Attachable.InUpdate { - } - } - - /** - * The entirety of a unmanaged data disk of a virtual machine scale set update. - * - * @param the stage of the parent update to return to after attaching this definition - */ - interface UpdateDefinitionWithExistingVhd - extends UpdateDefinitionStages.Blank, - UpdateDefinitionStages.WithDiskSource, - UpdateDefinitionStages.WithVhdAttachedDiskSettings, - UpdateDefinitionStages.WithAttach { - } - - /** - * The entirety of a unmanaged data disk of a virtual machine scale set update. - * - * @param the stage of the parent update to return to after attaching this definition - */ - interface UpdateDefinitionWithNewVhd - extends UpdateDefinitionStages.Blank, - UpdateDefinitionStages.WithDiskSource, - UpdateDefinitionStages.WithNewVhdDiskSettings, - UpdateDefinitionStages.WithAttach { - } - - /** Grouping of data disk update stages. */ - interface UpdateStages { - /** The stage of the virtual machine data disk update allowing to set the disk size. */ - interface WithDiskSize { - /** - * Specifies the new size in GB for data disk. - * - * @param sizeInGB the disk size in GB - * @return the next stage of data disk update - */ - Update withSizeInGB(Integer sizeInGB); - } - - /** The stage of the virtual machine data disk update allowing to set the disk LUN. */ - interface WithDiskLun { - /** - * Specifies the new logical unit number for the data disk. - * - * @param lun the logical unit number - * @return the next stage of data disk update - */ - Update withLun(Integer lun); - } - - /** The stage of the virtual machine data disk update allowing to set the disk caching type. */ - interface WithDiskCaching { - /** - * Specifies the new caching type for the data disk. - * - * @param cachingType the disk caching type. Possible values include: 'None', 'ReadOnly', 'ReadWrite' - * @return the next stage of data disk update - */ - Update withCaching(CachingTypes cachingType); - } - } - - /** The entirety of a data disk update as part of a virtual machine update. */ - interface Update - extends UpdateStages.WithDiskSize, - UpdateStages.WithDiskLun, - UpdateStages.WithDiskCaching, - Settable { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachines.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachines.java deleted file mode 100644 index 7712e4b1daf7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachines.java +++ /dev/null @@ -1,321 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.models; - -import com.azure.resourcemanager.compute.ComputeManager; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsBatchDeletion; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsDeletingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsListingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsBatchCreation; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsCreating; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingById; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; -import com.azure.resourcemanager.resources.fluentcore.model.Accepted; -import java.util.List; -import reactor.core.publisher.Mono; - -/** Entry point to virtual machine management API. */ -public interface VirtualMachines - extends SupportsListing, - SupportsListingByResourceGroup, - SupportsGettingByResourceGroup, - SupportsGettingById, - SupportsCreating, - SupportsDeletingById, - SupportsDeletingByResourceGroup, - SupportsBatchCreation, - SupportsBatchDeletion, - HasManager { - - /** @return available virtual machine sizes */ - VirtualMachineSizes sizes(); - - /** - * Shuts down the virtual machine and releases the compute resources. - * - * @param groupName the name of the resource group the virtual machine is in - * @param name the virtual machine name - */ - void deallocate(String groupName, String name); - - /** - * Shuts down the virtual machine and releases the compute resources asynchronously. - * - * @param groupName the name of the resource group the virtual machine is in - * @param name the virtual machine name - * @return a representation of the deferred computation of this call - */ - Mono deallocateAsync(String groupName, String name); - - /** - * Generalizes the virtual machine. - * - * @param groupName the name of the resource group the virtual machine is in - * @param name the virtual machine name - */ - void generalize(String groupName, String name); - - /** - * Generalizes the virtual machine asynchronously. - * - * @param groupName the name of the resource group the virtual machine is in - * @param name the virtual machine name - * @return a representation of the deferred computation of this call - */ - Mono generalizeAsync(String groupName, String name); - - /** - * Powers off (stops) a virtual machine. - * - * @param groupName the name of the resource group the virtual machine is in - * @param name the virtual machine name - */ - void powerOff(String groupName, String name); - - /** - * Powers off (stops) the virtual machine asynchronously. - * - * @param groupName the name of the resource group the virtual machine is in - * @param name the virtual machine name - * @return a representation of the deferred computation of this call - */ - Mono powerOffAsync(String groupName, String name); - - /** - * Restarts a virtual machine. - * - * @param groupName the name of the resource group the virtual machine is in - * @param name the virtual machine name - */ - void restart(String groupName, String name); - - /** - * Restarts the virtual machine asynchronously. - * - * @param groupName the name of the resource group the virtual machine is in - * @param name the virtual machine name - * @return a representation of the deferred computation of this call - */ - Mono restartAsync(String groupName, String name); - - /** - * Starts a virtual machine. - * - * @param groupName the name of the resource group the virtual machine is in - * @param name the virtual machine name - */ - void start(String groupName, String name); - - /** - * Starts the virtual machine asynchronously. - * - * @param groupName the name of the resource group the virtual machine is in - * @param name the virtual machine name - * @return a representation of the deferred computation of this call - */ - Mono startAsync(String groupName, String name); - - /** - * Redeploys a virtual machine. - * - * @param groupName the name of the resource group the virtual machine is in - * @param name the virtual machine name - */ - void redeploy(String groupName, String name); - - /** - * Redeploys the virtual machine asynchronously. - * - * @param groupName the name of the resource group the virtual machine is in - * @param name the virtual machine name - * @return a representation of the deferred computation of this call - */ - Mono redeployAsync(String groupName, String name); - - /** - * Captures the virtual machine by copying virtual hard disks of the VM and returns template as a JSON string that - * can be used to create similar VMs. - * - * @param groupName the resource group name - * @param name the virtual machine name - * @param containerName destination container name to store the captured VHD - * @param vhdPrefix the prefix for the VHD holding captured image - * @param overwriteVhd whether to overwrites destination VHD if it exists - * @return the template as JSON string - */ - String capture(String groupName, String name, String containerName, String vhdPrefix, boolean overwriteVhd); - - /** - * Captures the virtual machine by copying virtual hard disks of the VM asynchronously. - * - * @param groupName the resource group name - * @param name the virtual machine name - * @param containerName destination container name to store the captured VHD - * @param vhdPrefix the prefix for the VHD holding captured image - * @param overwriteVhd whether to overwrites destination VHD if it exists - * @return a representation of the deferred computation of this call - */ - Mono captureAsync( - String groupName, String name, String containerName, String vhdPrefix, boolean overwriteVhd); - - /** - * Migrates the virtual machine with unmanaged disks to use managed disks. - * - * @param groupName the resource group name - * @param name the virtual machine name - */ - void migrateToManaged(String groupName, String name); - - /** - * Converts (migrates) the virtual machine with un-managed disks to use managed disk asynchronously. - * - * @param groupName the resource group name - * @param name the virtual machine name - * @return a representation of the deferred computation of this call - */ - Mono migrateToManagedAsync(String groupName, String name); - - /** - * Run shell script in a virtual machine. - * - * @param groupName the resource group name - * @param name the virtual machine name - * @param scriptLines PowerShell script lines - * @param scriptParameters script parameters - * @return result of PowerShell script execution - */ - RunCommandResult runPowerShellScript( - String groupName, String name, List scriptLines, List scriptParameters); - - /** - * Run shell script in a virtual machine asynchronously. - * - * @param groupName the resource group name - * @param name the virtual machine name - * @param scriptLines PowerShell script lines - * @param scriptParameters script parameters - * @return handle to the asynchronous execution - */ - Mono runPowerShellScriptAsync( - String groupName, String name, List scriptLines, List scriptParameters); - - /** - * Run shell script in a virtual machine. - * - * @param groupName the resource group name - * @param name the virtual machine name - * @param scriptLines shell script lines - * @param scriptParameters script parameters - * @return result of shell script execution - */ - RunCommandResult runShellScript( - String groupName, String name, List scriptLines, List scriptParameters); - - /** - * Run shell script in a virtual machine asynchronously. - * - * @param groupName the resource group name - * @param name the virtual machine name - * @param scriptLines shell script lines - * @param scriptParameters script parameters - * @return handle to the asynchronous execution - */ - Mono runShellScriptAsync( - String groupName, String name, List scriptLines, List scriptParameters); - - /** - * Run commands in a virtual machine. - * - * @param groupName the resource group name - * @param name the virtual machine name - * @param inputCommand command input - * @return result of execution - */ - RunCommandResult runCommand(String groupName, String name, RunCommandInput inputCommand); - - /** - * Run commands in a virtual machine asynchronously. - * - * @param groupName the resource group name - * @param name the virtual machine name - * @param inputCommand command input - * @return handle to the asynchronous execution - */ - Mono runCommandAsync(String groupName, String name, RunCommandInput inputCommand); - - /** - * Begins deleting a virtual machine from Azure, identifying it by its resource ID. - * - * @param id the resource ID of the virtual machine to delete - * @return the accepted deleting operation - */ - Accepted beginDeleteById(String id); - - /** - * Begins deleting a virtual machine from Azure, identifying it by its name and its resource group. - * - * @param resourceGroupName the resource group the resource is part of - * @param name the virtual machine name - * @return the accepted deleting operation - */ - Accepted beginDeleteByResourceGroup(String resourceGroupName, String name); - - /** - * Force delete a resource from Azure, identifying it by its resource ID. - * - * @param id the resource ID of the resource to delete - * @param forceDeletion force delete without graceful shutdown - */ - void deleteById(String id, boolean forceDeletion); - - /** - * Asynchronously force delete a resource from Azure, identifying it by its resource ID. - * - * @param id the resource ID of the resource to delete - * @param forceDeletion force delete without graceful shutdown - * @return a representation of the deferred computation of this call - */ - Mono deleteByIdAsync(String id, boolean forceDeletion); - - /** - * Force delete a resource from Azure, identifying it by its name and its resource group. - * - * @param resourceGroupName the resource group the resource is part of - * @param name the name of the resource - * @param forceDeletion force delete without graceful shutdown - */ - void deleteByResourceGroup(String resourceGroupName, String name, boolean forceDeletion); - - /** - * Asynchronously force delete a resource from Azure, identifying it by its name and its resource group. - * - * @param resourceGroupName the resource group the resource is part of - * @param name the name of the resource - * @param forceDeletion force delete without graceful shutdown - * @return a representation of the deferred computation of this call - */ - Mono deleteByResourceGroupAsync(String resourceGroupName, String name, boolean forceDeletion); - - /** - * Begins force deleting a virtual machine from Azure, identifying it by its resource ID. - * - * @param id the resource ID of the virtual machine to delete - * @param forceDeletion force delete without graceful shutdown - * @return the accepted deleting operation - */ - Accepted beginDeleteById(String id, boolean forceDeletion); - - /** - * Begins force deleting a virtual machine from Azure, identifying it by its name and its resource group. - * - * @param resourceGroupName the resource group the resource is part of - * @param name the virtual machine name - * @param forceDeletion force delete without graceful shutdown - * @return the accepted deleting operation - */ - Accepted beginDeleteByResourceGroup(String resourceGroupName, String name, boolean forceDeletion); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VmDiskTypes.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VmDiskTypes.java deleted file mode 100644 index f9dbb5930bf7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VmDiskTypes.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for VmDiskTypes. */ -public final class VmDiskTypes extends ExpandableStringEnum { - /** Static value None for VmDiskTypes. */ - public static final VmDiskTypes NONE = fromString("None"); - - /** Static value Unmanaged for VmDiskTypes. */ - public static final VmDiskTypes UNMANAGED = fromString("Unmanaged"); - - /** - * Creates or finds a VmDiskTypes from its string representation. - * - * @param name a name to look for. - * @return the corresponding VmDiskTypes. - */ - @JsonCreator - public static VmDiskTypes fromString(String name) { - return fromString(name, VmDiskTypes.class); - } - - /** @return known VmDiskTypes values. */ - public static Collection values() { - return values(VmDiskTypes.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/WinRMConfiguration.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/WinRMConfiguration.java deleted file mode 100644 index f01843f12815..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/WinRMConfiguration.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Describes Windows Remote Management configuration of the VM. */ -@Fluent -public final class WinRMConfiguration { - @JsonIgnore private final ClientLogger logger = new ClientLogger(WinRMConfiguration.class); - - /* - * The list of Windows Remote Management listeners - */ - @JsonProperty(value = "listeners") - private List listeners; - - /** - * Get the listeners property: The list of Windows Remote Management listeners. - * - * @return the listeners value. - */ - public List listeners() { - return this.listeners; - } - - /** - * Set the listeners property: The list of Windows Remote Management listeners. - * - * @param listeners the listeners value to set. - * @return the WinRMConfiguration object itself. - */ - public WinRMConfiguration withListeners(List listeners) { - this.listeners = listeners; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (listeners() != null) { - listeners().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/WinRMListener.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/WinRMListener.java deleted file mode 100644 index d4c06f2cf613..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/WinRMListener.java +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describes Protocol and thumbprint of Windows Remote Management listener. */ -@Fluent -public final class WinRMListener { - @JsonIgnore private final ClientLogger logger = new ClientLogger(WinRMListener.class); - - /* - * Specifies the protocol of WinRM listener.

    Possible values are: - *
    **http**

    **https** - */ - @JsonProperty(value = "protocol") - private ProtocolTypes protocol; - - /* - * This is the URL of a certificate that has been uploaded to Key Vault as - * a secret. For adding a secret to the Key Vault, see [Add a key or secret - * to the key - * vault](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add). - * In this case, your certificate needs to be It is the Base64 encoding of - * the following JSON Object which is encoded in UTF-8:

    {
    - * "data":"",
    "dataType":"pfx",
    - * "password":""
    } - */ - @JsonProperty(value = "certificateUrl") - private String certificateUrl; - - /** - * Get the protocol property: Specifies the protocol of WinRM listener. <br><br> Possible values are: - * <br>**http** <br><br> **https**. - * - * @return the protocol value. - */ - public ProtocolTypes protocol() { - return this.protocol; - } - - /** - * Set the protocol property: Specifies the protocol of WinRM listener. <br><br> Possible values are: - * <br>**http** <br><br> **https**. - * - * @param protocol the protocol value to set. - * @return the WinRMListener object itself. - */ - public WinRMListener withProtocol(ProtocolTypes protocol) { - this.protocol = protocol; - return this; - } - - /** - * Get the certificateUrl property: This is the URL of a certificate that has been uploaded to Key Vault as a - * secret. For adding a secret to the Key Vault, see [Add a key or secret to the key - * vault](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add). In this case, your certificate - * needs to be It is the Base64 encoding of the following JSON Object which is encoded in UTF-8: - * <br><br> {<br> "data":"<Base64-encoded-certificate>",<br> - * "dataType":"pfx",<br> "password":"<pfx-file-password>"<br>}. - * - * @return the certificateUrl value. - */ - public String certificateUrl() { - return this.certificateUrl; - } - - /** - * Set the certificateUrl property: This is the URL of a certificate that has been uploaded to Key Vault as a - * secret. For adding a secret to the Key Vault, see [Add a key or secret to the key - * vault](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add). In this case, your certificate - * needs to be It is the Base64 encoding of the following JSON Object which is encoded in UTF-8: - * <br><br> {<br> "data":"<Base64-encoded-certificate>",<br> - * "dataType":"pfx",<br> "password":"<pfx-file-password>"<br>}. - * - * @param certificateUrl the certificateUrl value to set. - * @return the WinRMListener object itself. - */ - public WinRMListener withCertificateUrl(String certificateUrl) { - this.certificateUrl = certificateUrl; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/WindowsConfiguration.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/WindowsConfiguration.java deleted file mode 100644 index 609015a8083d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/WindowsConfiguration.java +++ /dev/null @@ -1,226 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Specifies Windows operating system settings on the virtual machine. */ -@Fluent -public final class WindowsConfiguration { - @JsonIgnore private final ClientLogger logger = new ClientLogger(WindowsConfiguration.class); - - /* - * Indicates whether virtual machine agent should be provisioned on the - * virtual machine.

    When this property is not specified in the - * request body, default behavior is to set it to true. This will ensure - * that VM Agent is installed on the VM so that extensions can be added to - * the VM later. - */ - @JsonProperty(value = "provisionVMAgent") - private Boolean provisionVMAgent; - - /* - * Indicates whether Automatic Updates is enabled for the Windows virtual - * machine. Default value is true.

    For virtual machine scale sets, - * this property can be updated and updates will take effect on OS - * reprovisioning. - */ - @JsonProperty(value = "enableAutomaticUpdates") - private Boolean enableAutomaticUpdates; - - /* - * Specifies the time zone of the virtual machine. e.g. "Pacific Standard - * Time".

    Possible values can be - * [TimeZoneInfo.Id](https://docs.microsoft.com/en-us/dotnet/api/system.timezoneinfo.id?#System_TimeZoneInfo_Id) - * value from time zones returned by - * [TimeZoneInfo.GetSystemTimeZones](https://docs.microsoft.com/en-us/dotnet/api/system.timezoneinfo.getsystemtimezones). - */ - @JsonProperty(value = "timeZone") - private String timeZone; - - /* - * Specifies additional base-64 encoded XML formatted information that can - * be included in the Unattend.xml file, which is used by Windows Setup. - */ - @JsonProperty(value = "additionalUnattendContent") - private List additionalUnattendContent; - - /* - * Specifies settings related to in-guest patching (KBs). - */ - @JsonProperty(value = "patchSettings") - private PatchSettings patchSettings; - - /* - * Specifies the Windows Remote Management listeners. This enables remote - * Windows PowerShell. - */ - @JsonProperty(value = "winRM") - private WinRMConfiguration winRM; - - /** - * Get the provisionVMAgent property: Indicates whether virtual machine agent should be provisioned on the virtual - * machine. <br><br> When this property is not specified in the request body, default behavior is to set - * it to true. This will ensure that VM Agent is installed on the VM so that extensions can be added to the VM - * later. - * - * @return the provisionVMAgent value. - */ - public Boolean provisionVMAgent() { - return this.provisionVMAgent; - } - - /** - * Set the provisionVMAgent property: Indicates whether virtual machine agent should be provisioned on the virtual - * machine. <br><br> When this property is not specified in the request body, default behavior is to set - * it to true. This will ensure that VM Agent is installed on the VM so that extensions can be added to the VM - * later. - * - * @param provisionVMAgent the provisionVMAgent value to set. - * @return the WindowsConfiguration object itself. - */ - public WindowsConfiguration withProvisionVMAgent(Boolean provisionVMAgent) { - this.provisionVMAgent = provisionVMAgent; - return this; - } - - /** - * Get the enableAutomaticUpdates property: Indicates whether Automatic Updates is enabled for the Windows virtual - * machine. Default value is true. <br><br> For virtual machine scale sets, this property can be updated - * and updates will take effect on OS reprovisioning. - * - * @return the enableAutomaticUpdates value. - */ - public Boolean enableAutomaticUpdates() { - return this.enableAutomaticUpdates; - } - - /** - * Set the enableAutomaticUpdates property: Indicates whether Automatic Updates is enabled for the Windows virtual - * machine. Default value is true. <br><br> For virtual machine scale sets, this property can be updated - * and updates will take effect on OS reprovisioning. - * - * @param enableAutomaticUpdates the enableAutomaticUpdates value to set. - * @return the WindowsConfiguration object itself. - */ - public WindowsConfiguration withEnableAutomaticUpdates(Boolean enableAutomaticUpdates) { - this.enableAutomaticUpdates = enableAutomaticUpdates; - return this; - } - - /** - * Get the timeZone property: Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time". - * <br><br> Possible values can be - * [TimeZoneInfo.Id](https://docs.microsoft.com/en-us/dotnet/api/system.timezoneinfo.id?#System_TimeZoneInfo_Id) - * value from time zones returned by - * [TimeZoneInfo.GetSystemTimeZones](https://docs.microsoft.com/en-us/dotnet/api/system.timezoneinfo.getsystemtimezones). - * - * @return the timeZone value. - */ - public String timeZone() { - return this.timeZone; - } - - /** - * Set the timeZone property: Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time". - * <br><br> Possible values can be - * [TimeZoneInfo.Id](https://docs.microsoft.com/en-us/dotnet/api/system.timezoneinfo.id?#System_TimeZoneInfo_Id) - * value from time zones returned by - * [TimeZoneInfo.GetSystemTimeZones](https://docs.microsoft.com/en-us/dotnet/api/system.timezoneinfo.getsystemtimezones). - * - * @param timeZone the timeZone value to set. - * @return the WindowsConfiguration object itself. - */ - public WindowsConfiguration withTimeZone(String timeZone) { - this.timeZone = timeZone; - return this; - } - - /** - * Get the additionalUnattendContent property: Specifies additional base-64 encoded XML formatted information that - * can be included in the Unattend.xml file, which is used by Windows Setup. - * - * @return the additionalUnattendContent value. - */ - public List additionalUnattendContent() { - return this.additionalUnattendContent; - } - - /** - * Set the additionalUnattendContent property: Specifies additional base-64 encoded XML formatted information that - * can be included in the Unattend.xml file, which is used by Windows Setup. - * - * @param additionalUnattendContent the additionalUnattendContent value to set. - * @return the WindowsConfiguration object itself. - */ - public WindowsConfiguration withAdditionalUnattendContent( - List additionalUnattendContent) { - this.additionalUnattendContent = additionalUnattendContent; - return this; - } - - /** - * Get the patchSettings property: Specifies settings related to in-guest patching (KBs). - * - * @return the patchSettings value. - */ - public PatchSettings patchSettings() { - return this.patchSettings; - } - - /** - * Set the patchSettings property: Specifies settings related to in-guest patching (KBs). - * - * @param patchSettings the patchSettings value to set. - * @return the WindowsConfiguration object itself. - */ - public WindowsConfiguration withPatchSettings(PatchSettings patchSettings) { - this.patchSettings = patchSettings; - return this; - } - - /** - * Get the winRM property: Specifies the Windows Remote Management listeners. This enables remote Windows - * PowerShell. - * - * @return the winRM value. - */ - public WinRMConfiguration winRM() { - return this.winRM; - } - - /** - * Set the winRM property: Specifies the Windows Remote Management listeners. This enables remote Windows - * PowerShell. - * - * @param winRM the winRM value to set. - * @return the WindowsConfiguration object itself. - */ - public WindowsConfiguration withWinRM(WinRMConfiguration winRM) { - this.winRM = winRM; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (additionalUnattendContent() != null) { - additionalUnattendContent().forEach(e -> e.validate()); - } - if (patchSettings() != null) { - patchSettings().validate(); - } - if (winRM() != null) { - winRM().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/WindowsVMDiskEncryptionConfiguration.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/WindowsVMDiskEncryptionConfiguration.java deleted file mode 100644 index 0e8d89bf0537..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/WindowsVMDiskEncryptionConfiguration.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.models; - -import com.azure.core.management.AzureEnvironment; - -/** Type representing encryption configuration to be applied to a Windows virtual machine. */ -public class WindowsVMDiskEncryptionConfiguration - extends VirtualMachineEncryptionConfiguration { - /** - * Creates WindowsVMDiskEncryptionConfiguration. - * - * Recommend to use the alternative constructor to provide vaultUri. - * - * @param keyVaultId the resource ID of the key vault to store the disk encryption key - * @param aadClientId client ID of an AAD application which has permission to the key vault - * @param aadSecret client secret corresponding to the aadClientId - */ - public WindowsVMDiskEncryptionConfiguration(String keyVaultId, String aadClientId, String aadSecret) { - super(keyVaultId, null, aadClientId, aadSecret, null); - } - - /** - * Creates WindowsVMDiskEncryptionConfiguration. - * - * @param keyVaultId the resource ID of the key vault to store the disk encryption key - * @param vaultUri URI of the key vault data-plane endpoint - * @param aadClientId client ID of an AAD application which has permission to the key vault - * @param aadSecret client secret corresponding to the aadClientId - */ - public WindowsVMDiskEncryptionConfiguration(String keyVaultId, - String vaultUri, - String aadClientId, - String aadSecret) { - super(keyVaultId, vaultUri, aadClientId, aadSecret, null); - } - - /** - * Creates WindowsVMDiskEncryptionConfiguration. - * - * Recommend to use the alternative constructor to provide vaultUri. - * - * @param keyVaultId the resource ID of the key vault to store the disk encryption key - * @param aadClientId client ID of an AAD application which has permission to the key vault - * @param aadSecret client secret corresponding to the aadClientId - * @param azureEnvironment Azure environment - */ - public WindowsVMDiskEncryptionConfiguration(String keyVaultId, - String aadClientId, - String aadSecret, - AzureEnvironment azureEnvironment) { - super(keyVaultId, null, aadClientId, aadSecret, azureEnvironment); - } - - /** - * Creates WindowsVMDiskEncryptionConfiguration. - * - * Recommend to use the alternative constructor to provide vaultUri. - * - * @param keyVaultId the resource ID of the key vault to store the disk encryption key - */ - public WindowsVMDiskEncryptionConfiguration(String keyVaultId) { - super(keyVaultId, null, null); - } - - /** - * Creates WindowsVMDiskEncryptionConfiguration. - * - * @param keyVaultId the resource ID of the key vault to store the disk encryption key - * @param vaultUri URI of the key vault data-plane endpoint - */ - public WindowsVMDiskEncryptionConfiguration(String keyVaultId, - String vaultUri) { - super(keyVaultId, vaultUri, null); - } - - /** - * Creates WindowsVMDiskEncryptionConfiguration. - * - * Recommend to use the alternative constructor to provide vaultUri. - * - * @param keyVaultId the resource ID of the key vault to store the disk encryption key - * @param azureEnvironment Azure environment - */ - public WindowsVMDiskEncryptionConfiguration(String keyVaultId, - AzureEnvironment azureEnvironment) { - super(keyVaultId, null, azureEnvironment); - } - - @Override - public OperatingSystemTypes osType() { - return OperatingSystemTypes.WINDOWS; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/package-info.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/package-info.java deleted file mode 100644 index b1104ffa4f64..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** Package containing the data models for ComputeManagementClient. Compute Client. */ -package com.azure.resourcemanager.compute.models; diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/package-info.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/package-info.java deleted file mode 100644 index c614edf99bb8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** Package containing the classes for ComputeManagementClient. Compute Client. */ -package com.azure.resourcemanager.compute; diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/module-info.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/module-info.java deleted file mode 100644 index 06fa7ea57141..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/module-info.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -module com.azure.resourcemanager.compute { - requires transitive com.azure.resourcemanager.resources; - requires transitive com.azure.resourcemanager.msi; - requires transitive com.azure.resourcemanager.network; - requires transitive com.azure.resourcemanager.storage; - - // export public APIs of compute - exports com.azure.resourcemanager.compute; - exports com.azure.resourcemanager.compute.fluent; - exports com.azure.resourcemanager.compute.fluent.models; - exports com.azure.resourcemanager.compute.models; - - // open packages specifically for azure core and jackson - opens com.azure.resourcemanager.compute.fluent.models to - com.azure.core, - com.fasterxml.jackson.databind; - opens com.azure.resourcemanager.compute.models to - com.azure.core, - com.fasterxml.jackson.databind; -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/samples/java/com/azure/resourcemanager/compute/ReadmeSamples.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/samples/java/com/azure/resourcemanager/compute/ReadmeSamples.java deleted file mode 100644 index f3dd9249f637..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/samples/java/com/azure/resourcemanager/compute/ReadmeSamples.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute; - -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpMethod; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.util.serializer.JacksonAdapter; -import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.identity.DefaultAzureCredentialBuilder; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.ArrayNode; - -import java.io.IOException; -import java.util.HashMap; - -public class ReadmeSamples { - - public void authenticate() { - // BEGIN: com.azure.resourcemanager.compute.authenticate - String armEndpoint = "https://management.."; - AzureProfile profile = new AzureProfile(getAzureEnvironmentFromArmEndpoint(armEndpoint)); - TokenCredential credential = new DefaultAzureCredentialBuilder() - .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) - .build(); - ComputeManager manager = ComputeManager - .authenticate(credential, profile); - // END: com.azure.resourcemanager.compute.authenticate - } - - // BEGIN: com.azure.resourcemanager.compute.getazureenvironment - private static AzureEnvironment getAzureEnvironmentFromArmEndpoint(String armEndpoint) { - // Create HTTP client and request - HttpClient httpClient = HttpClient.createDefault(); - - HttpRequest request = new HttpRequest(HttpMethod.GET, - String.format("%s/metadata/endpoints?api-version=2019-10-01", armEndpoint)) - .setHeader("accept", "application/json"); - - // Execute the request and read the response - HttpResponse response = httpClient.send(request).block(); - if (response.getStatusCode() != 200) { - throw new RuntimeException("Failed : HTTP error code : " + response.getStatusCode()); - } - String body = response.getBodyAsString().block(); - try { - ArrayNode metadataArray = JacksonAdapter.createDefaultSerializerAdapter() - .deserialize(body, ArrayNode.class, SerializerEncoding.JSON); - - if (metadataArray == null || metadataArray.isEmpty()) { - throw new RuntimeException("Failed to find metadata : " + body); - } - - JsonNode metadata = metadataArray.iterator().next(); - AzureEnvironment azureEnvironment = new AzureEnvironment(new HashMap() { - { - put("managementEndpointUrl", metadata.at("/authentication/audiences/0").asText()); - put("resourceManagerEndpointUrl", armEndpoint); - put("galleryEndpointUrl", metadata.at("/gallery").asText()); - put("activeDirectoryEndpointUrl", metadata.at("/authentication/loginEndpoint").asText()); - put("activeDirectoryResourceId", metadata.at("/authentication/audiences/0").asText()); - put("activeDirectoryGraphResourceId", metadata.at("/graph").asText()); - put("storageEndpointSuffix", "." + metadata.at("/suffixes/storage").asText()); - put("keyVaultDnsSuffix", "." + metadata.at("/suffixes/keyVaultDns").asText()); - } - }); - return azureEnvironment; - } catch (IOException ioe) { - ioe.printStackTrace(); - throw new RuntimeException(ioe); - } - } - // END: com.azure.resourcemanager.compute.getazureenvironment -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/assets/install_apache.sh b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/assets/install_apache.sh deleted file mode 100644 index 1789520c570e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/assets/install_apache.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -sudo apt-get update - -# install apache -sudo apt-get -y install apache2 - -# restart Apache -sudo service apache2 restart \ No newline at end of file diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/ComputeManagementTest.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/ComputeManagementTest.java deleted file mode 100644 index 38a66eda046f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/ComputeManagementTest.java +++ /dev/null @@ -1,331 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute; - -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.policy.HttpLogOptions; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.resourcemanager.authorization.AuthorizationManager; -import com.azure.resourcemanager.compute.models.RunCommandInput; -import com.azure.resourcemanager.compute.models.VirtualMachine; -import com.azure.resourcemanager.keyvault.KeyVaultManager; -import com.azure.resourcemanager.msi.MsiManager; -import com.azure.resourcemanager.network.models.LoadBalancer; -import com.azure.resourcemanager.network.models.LoadBalancerSkuType; -import com.azure.resourcemanager.network.models.Network; -import com.azure.resourcemanager.network.models.PublicIpAddress; -import com.azure.resourcemanager.network.models.PublicIPSkuType; -import com.azure.resourcemanager.network.models.TransportProtocol; -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.resources.fluentcore.utils.HttpPipelineProvider; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import com.azure.resourcemanager.resources.models.ResourceGroup; -import com.azure.core.management.Region; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.resources.ResourceManager; -import com.azure.resourcemanager.storage.StorageManager; -import com.azure.resourcemanager.test.ResourceManagerTestBase; -import com.azure.resourcemanager.test.utils.TestDelayProvider; -import com.azure.resourcemanager.test.utils.TestIdentifierProvider; -import com.jcraft.jsch.JSch; - -import java.time.Duration; -import java.time.temporal.ChronoUnit; -import java.util.Collections; -import java.util.List; -import org.junit.jupiter.api.Assertions; - -public abstract class ComputeManagementTest extends ResourceManagerTestBase { - - protected ResourceManager resourceManager; - protected ComputeManager computeManager; - protected NetworkManager networkManager; - protected StorageManager storageManager; - protected AuthorizationManager authorizationManager; - protected KeyVaultManager keyVaultManager; - protected MsiManager msiManager; - - @Override - protected HttpPipeline buildHttpPipeline( - TokenCredential credential, - AzureProfile profile, - HttpLogOptions httpLogOptions, - List policies, - HttpClient httpClient) { - return HttpPipelineProvider.buildHttpPipeline( - credential, - profile, - null, - httpLogOptions, - null, - new RetryPolicy("Retry-After", ChronoUnit.SECONDS), - policies, - httpClient); - } - - @Override - protected void initializeClients(HttpPipeline httpPipeline, AzureProfile profile) { - ResourceManagerUtils.InternalRuntimeContext.setDelayProvider(new TestDelayProvider(!isPlaybackMode())); - ResourceManagerUtils.InternalRuntimeContext internalContext = new ResourceManagerUtils.InternalRuntimeContext(); - internalContext.setIdentifierFunction(name -> new TestIdentifierProvider(testResourceNamer)); - computeManager = buildManager(ComputeManager.class, httpPipeline, profile); - networkManager = buildManager(NetworkManager.class, httpPipeline, profile); - storageManager = buildManager(StorageManager.class, httpPipeline, profile); - keyVaultManager = buildManager(KeyVaultManager.class, httpPipeline, profile); - authorizationManager = buildManager(AuthorizationManager.class, httpPipeline, profile); - msiManager = buildManager(MsiManager.class, httpPipeline, profile); - resourceManager = computeManager.resourceManager(); - setInternalContext(internalContext, computeManager, networkManager, keyVaultManager, msiManager); - } - - @Override - protected void cleanUpResources() { - } - - protected void deprovisionAgentInLinuxVM(VirtualMachine virtualMachine) { - System.out.println("Trying to de-provision"); - - virtualMachine.manager().serviceClient().getVirtualMachines().beginRunCommand( - virtualMachine.resourceGroupName(), virtualMachine.name(), - new RunCommandInput() - .withCommandId("RunShellScript") - .withScript(Collections.singletonList("sudo waagent -deprovision+user --force"))); - - // wait as above command will not return as sync - ResourceManagerUtils.sleep(Duration.ofMinutes(1)); - } - - protected void ensureCanDoSsh(String fqdn, int sshPort, String uname, String password) { - if (isPlaybackMode()) { - return; - } - JSch jsch = new JSch(); - com.jcraft.jsch.Session session = null; - try { - java.util.Properties config = new java.util.Properties(); - config.put("StrictHostKeyChecking", "no"); - session = jsch.getSession(uname, fqdn, sshPort); - session.setPassword(password); - session.setConfig(config); - session.connect(); - } catch (Exception e) { - Assertions.fail("SSH connection failed" + e.getMessage()); - } finally { - if (session != null) { - session.disconnect(); - } - } - } - - protected void sleep(long milli) { - if (isPlaybackMode()) { - return; - } - try { - Thread.sleep(milli); - } catch (InterruptedException exception) { - } - } - - protected LoadBalancer createHttpLoadBalancers(Region region, ResourceGroup resourceGroup, String id) - throws Exception { - final String loadBalancerName = generateRandomResourceName("extlb" + id + "-", 18); - final String publicIpName = "pip-" + loadBalancerName; - final String frontendName = loadBalancerName + "-FE1"; - final String backendPoolName = loadBalancerName + "-BAP1"; - final String natPoolName = loadBalancerName + "-INP1"; - - PublicIpAddress publicIPAddress = - this - .networkManager - .publicIpAddresses() - .define(publicIpName) - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .withLeafDomainLabel(publicIpName) - .create(); - - LoadBalancer loadBalancer = - this - .networkManager - .loadBalancers() - .define(loadBalancerName) - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - // Add two rules that uses above backend and probe - .defineLoadBalancingRule("httpRule") - .withProtocol(TransportProtocol.TCP) - .fromFrontend(frontendName) - .fromFrontendPort(80) - .toBackend(backendPoolName) - .withProbe("httpProbe") - .attach() - .defineInboundNatPool(natPoolName) - .withProtocol(TransportProtocol.TCP) - .fromFrontend(frontendName) - .fromFrontendPortRange(5000, 5099) - .toBackendPort(22) - .attach() - // Explicitly define the frontend - .definePublicFrontend(frontendName) - .withExistingPublicIpAddress(publicIPAddress) - .attach() - // Add an HTTP probe - .defineHttpProbe("httpProbe") - .withRequestPath("/") - .attach() - .create(); - return loadBalancer; - } - - protected LoadBalancer createInternetFacingLoadBalancer( - Region region, ResourceGroup resourceGroup, String id, LoadBalancerSkuType lbSkuType) throws Exception { - final String loadBalancerName = generateRandomResourceName("extlb" + id + "-", 18); - final String publicIPName = "pip-" + loadBalancerName; - final String frontendName = loadBalancerName + "-FE1"; - final String backendPoolName1 = loadBalancerName + "-BAP1"; - final String backendPoolName2 = loadBalancerName + "-BAP2"; - final String natPoolName1 = loadBalancerName + "-INP1"; - final String natPoolName2 = loadBalancerName + "-INP2"; - - // Sku of PublicIP and LoadBalancer must match - // - PublicIPSkuType publicIPSkuType = - lbSkuType.equals(LoadBalancerSkuType.BASIC) ? PublicIPSkuType.BASIC : PublicIPSkuType.STANDARD; - - PublicIpAddress publicIPAddress = - this - .networkManager - .publicIpAddresses() - .define(publicIPName) - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .withLeafDomainLabel(publicIPName) - // Optionals - .withStaticIP() - .withSku(publicIPSkuType) - // Create - .create(); - - LoadBalancer loadBalancer = - this - .networkManager - .loadBalancers() - .define(loadBalancerName) - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - - // Add two rules that uses above backend and probe - .defineLoadBalancingRule("httpRule") - .withProtocol(TransportProtocol.TCP) - .fromFrontend(frontendName) - .fromFrontendPort(80) - .toBackend(backendPoolName1) - .withProbe("httpProbe") - .attach() - .defineLoadBalancingRule("httpsRule") - .withProtocol(TransportProtocol.TCP) - .fromFrontend(frontendName) - .fromFrontendPort(443) - .toBackend(backendPoolName2) - .withProbe("httpsProbe") - .attach() - - // Add two nat pools to enable direct VM connectivity to port SSH and 23 - .defineInboundNatPool(natPoolName1) - .withProtocol(TransportProtocol.TCP) - .fromFrontend(frontendName) - .fromFrontendPortRange(5000, 5099) - .toBackendPort(22) - .attach() - .defineInboundNatPool(natPoolName2) - .withProtocol(TransportProtocol.TCP) - .fromFrontend(frontendName) - .fromFrontendPortRange(6000, 6099) - .toBackendPort(23) - .attach() - - // Explicitly define the frontend - .definePublicFrontend(frontendName) - .withExistingPublicIpAddress(publicIPAddress) // Frontend with PIP means internet-facing load-balancer - .attach() - - // Add two probes one per rule - .defineHttpProbe("httpProbe") - .withRequestPath("/") - .attach() - .defineHttpProbe("httpsProbe") - .withRequestPath("/") - .attach() - .withSku(lbSkuType) - .create(); - return loadBalancer; - } - - protected LoadBalancer createInternalLoadBalancer( - Region region, ResourceGroup resourceGroup, Network network, String id) throws Exception { - final String loadBalancerName = generateRandomResourceName("InternalLb" + id + "-", 18); - final String privateFrontEndName = loadBalancerName + "-FE1"; - final String backendPoolName1 = loadBalancerName + "-BAP1"; - final String backendPoolName2 = loadBalancerName + "-BAP2"; - final String natPoolName1 = loadBalancerName + "-INP1"; - final String natPoolName2 = loadBalancerName + "-INP2"; - final String subnetName = "subnet1"; - - LoadBalancer loadBalancer = - this - .networkManager - .loadBalancers() - .define(loadBalancerName) - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - // Add two rules that uses above backend and probe - .defineLoadBalancingRule("httpRule") - .withProtocol(TransportProtocol.TCP) - .fromFrontend(privateFrontEndName) - .fromFrontendPort(1000) - .toBackend(backendPoolName1) - .withProbe("httpProbe") - .attach() - .defineLoadBalancingRule("httpsRule") - .withProtocol(TransportProtocol.TCP) - .fromFrontend(privateFrontEndName) - .fromFrontendPort(1001) - .toBackend(backendPoolName2) - .withProbe("httpsProbe") - .attach() - - // Add two NAT pools to enable direct VM connectivity to port 44 and 45 - .defineInboundNatPool(natPoolName1) - .withProtocol(TransportProtocol.TCP) - .fromFrontend(privateFrontEndName) - .fromFrontendPortRange(8000, 8099) - .toBackendPort(44) - .attach() - .defineInboundNatPool(natPoolName2) - .withProtocol(TransportProtocol.TCP) - .fromFrontend(privateFrontEndName) - .fromFrontendPortRange(9000, 9099) - .toBackendPort(45) - .attach() - - // Explicitly define the frontend - .definePrivateFrontend(privateFrontEndName) - .withExistingSubnet(network, subnetName) // Frontend with VNET means internal load-balancer - .attach() - - // Add two probes one per rule - .defineHttpProbe("httpProbe") - .withRequestPath("/") - .attach() - .defineHttpProbe("httpsProbe") - .withRequestPath("/") - .attach() - .create(); - return loadBalancer; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/ComputeSkuTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/ComputeSkuTests.java deleted file mode 100644 index 613ae5d2a506..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/ComputeSkuTests.java +++ /dev/null @@ -1,141 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute; - -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.compute.models.ComputeResourceType; -import com.azure.resourcemanager.compute.models.ComputeSku; -import com.azure.resourcemanager.test.utils.TestUtilities; -import com.azure.resourcemanager.resources.fluentcore.arm.AvailabilityZoneId; -import com.azure.core.management.Region; -import java.util.Map; -import java.util.Set; - -import com.azure.core.management.profile.AzureProfile; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public class ComputeSkuTests extends ComputeManagementTest { - @Override - protected void initializeClients(HttpPipeline httpPipeline, AzureProfile profile) { - super.initializeClients(httpPipeline, profile); - } - -// @Test -// public void foo() { -// HashSet s = new HashSet<>(); -// s.add(EncryptionStatus.NOT_ENCRYPTED); -// s.add(EncryptionStatus.NOT_ENCRYPTED); -// -// System.out.println(s.contains(EncryptionStatus.fromString("notEncrypted"))); -// } - - @Test - public void canListSkus() throws Exception { - PagedIterable skus = this.computeManager.computeSkus().list(); - - boolean atleastOneVirtualMachineResourceSku = false; - boolean atleastOneAvailabilitySetResourceSku = false; - boolean atleastOneDiskResourceSku = false; - boolean atleastOneSnapshotResourceSku = false; - boolean atleastOneRegionWithZones = false; - for (ComputeSku sku : skus) { - Assertions.assertNotNull(sku.resourceType()); - Assertions.assertNotNull(sku.regions()); - if (sku.resourceType().equals(ComputeResourceType.VIRTUALMACHINES)) { - Assertions.assertNotNull(sku.virtualMachineSizeType()); - Assertions - .assertEquals( - sku.virtualMachineSizeType().toString().toLowerCase(), sku.name().toString().toLowerCase()); - Assertions.assertNull(sku.availabilitySetSkuType()); - Assertions.assertNull(sku.diskSkuType()); - atleastOneVirtualMachineResourceSku = true; - - for (Map.Entry> zoneMapEntry : sku.zones().entrySet()) { - Region region = zoneMapEntry.getKey(); - Assertions.assertNotNull(region); - Set zones = zoneMapEntry.getValue(); - if (zones.size() > 0) { - atleastOneRegionWithZones = true; - } - } - } - if (sku.resourceType().equals(ComputeResourceType.AVAILABILITYSETS)) { - Assertions.assertNotNull(sku.availabilitySetSkuType()); - Assertions - .assertEquals( - sku.availabilitySetSkuType().toString().toLowerCase(), sku.name().toString().toLowerCase()); - Assertions.assertNull(sku.virtualMachineSizeType()); - Assertions.assertNull(sku.diskSkuType()); - atleastOneAvailabilitySetResourceSku = true; - } - if (sku.resourceType().equals(ComputeResourceType.DISKS)) { - Assertions.assertNotNull(sku.diskSkuType().toString()); - Assertions - .assertEquals(sku.diskSkuType().toString().toLowerCase(), sku.name().toString().toLowerCase()); - Assertions.assertNull(sku.virtualMachineSizeType()); - Assertions.assertNull(sku.availabilitySetSkuType()); - atleastOneDiskResourceSku = true; - } - if (sku.resourceType().equals(ComputeResourceType.SNAPSHOTS)) { - Assertions.assertNotNull(sku.diskSkuType()); - Assertions - .assertEquals(sku.diskSkuType().toString().toLowerCase(), sku.name().toString().toLowerCase()); - Assertions.assertNull(sku.virtualMachineSizeType()); - Assertions.assertNull(sku.availabilitySetSkuType()); - atleastOneSnapshotResourceSku = true; - } - } - Assertions.assertTrue(atleastOneVirtualMachineResourceSku); - Assertions.assertTrue(atleastOneAvailabilitySetResourceSku); - Assertions.assertTrue(atleastOneDiskResourceSku); - Assertions.assertTrue(atleastOneSnapshotResourceSku); - Assertions.assertTrue(atleastOneRegionWithZones); - } - - @Test - public void canListSkusByRegion() throws Exception { - PagedIterable skus = this.computeManager.computeSkus().listByRegion(locationOrDefault(Region.US_EAST2)); - for (ComputeSku sku : skus) { - Assertions.assertTrue(sku.regions().contains(locationOrDefault(Region.US_EAST2))); - } - - skus = this.computeManager.computeSkus().listByRegion(Region.fromName("Unknown")); - Assertions.assertEquals(0, TestUtilities.getSize(skus)); - } - - @Test - public void canListSkusByResourceType() throws Exception { - PagedIterable skus = - this.computeManager.computeSkus().listByResourceType(ComputeResourceType.VIRTUALMACHINES); - for (ComputeSku sku : skus) { - Assertions.assertTrue(sku.resourceType().equals(ComputeResourceType.VIRTUALMACHINES)); - } - - skus = this.computeManager.computeSkus().listByResourceType(ComputeResourceType.fromString("Unknown")); - Assertions.assertEquals(0, TestUtilities.getSize(skus)); - } - - @Test - public void canListSkusByRegionAndResourceType() throws Exception { - PagedIterable skus = - this - .computeManager - .computeSkus() - .listByRegionAndResourceType(locationOrDefault(Region.US_EAST2), ComputeResourceType.VIRTUALMACHINES); - for (ComputeSku sku : skus) { - Assertions.assertTrue(sku.resourceType().equals(ComputeResourceType.VIRTUALMACHINES)); - Assertions.assertTrue(sku.regions().contains(locationOrDefault(Region.US_EAST2))); - } - - skus = - this - .computeManager - .computeSkus() - .listByRegionAndResourceType(locationOrDefault(Region.US_EAST2), ComputeResourceType.fromString("Unknown")); - Assertions.assertNotNull(skus); - Assertions.assertEquals(0, TestUtilities.getSize(skus)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/ComputeUsageOperationsTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/ComputeUsageOperationsTests.java deleted file mode 100644 index cbfee9e7e04b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/ComputeUsageOperationsTests.java +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.compute.models.ComputeUsage; -import com.azure.resourcemanager.test.utils.TestUtilities; -import com.azure.core.management.Region; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public class ComputeUsageOperationsTests extends ComputeManagementTest { - @Test - public void canListComputeUsages() throws Exception { - PagedIterable usages = computeManager.usages().listByRegion(locationOrDefault(Region.US_EAST)); - Assertions.assertTrue(TestUtilities.getSize(usages) > 0); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/ManagedDiskOperationsTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/ManagedDiskOperationsTests.java deleted file mode 100644 index aa5af534d30f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/ManagedDiskOperationsTests.java +++ /dev/null @@ -1,240 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute; - -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.compute.models.CreationSourceType; -import com.azure.resourcemanager.compute.models.Disk; -import com.azure.resourcemanager.compute.models.DiskCreateOption; -import com.azure.resourcemanager.compute.models.DiskSkuTypes; -import com.azure.resourcemanager.compute.models.Snapshot; -import com.azure.resourcemanager.compute.models.SnapshotSkuType; -import com.azure.resourcemanager.resources.models.ResourceGroup; -import com.azure.resourcemanager.test.utils.TestUtilities; -import com.azure.core.management.Region; -import com.azure.core.management.profile.AzureProfile; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public class ManagedDiskOperationsTests extends ComputeManagementTest { - private String rgName = ""; - private Region region = locationOrDefault(Region.US_WEST_CENTRAL); - - @Override - protected void initializeClients(HttpPipeline httpPipeline, AzureProfile profile) { - rgName = generateRandomResourceName("javacsmrg", 15); - super.initializeClients(httpPipeline, profile); - } - - @Override - protected void cleanUpResources() { - resourceManager.resourceGroups().beginDeleteByName(rgName); - } - - @Test - public void canOperateOnEmptyManagedDisk() { - final String diskName = generateRandomResourceName("md-empty-", 20); - final DiskSkuTypes updateTo = DiskSkuTypes.STANDARD_LRS; - - ResourceGroup resourceGroup = resourceManager.resourceGroups().define(rgName).withRegion(region).create(); - - // Create an empty managed disk - // - Disk disk = - computeManager - .disks() - .define(diskName) - .withRegion(region) - .withExistingResourceGroup(resourceGroup.name()) - .withData() - .withSizeInGB(100) - // Start option - .withSku(DiskSkuTypes.STANDARD_LRS) - .withTag("tkey1", "tval1") - // End option - .create(); - - Assertions.assertNotNull(disk.id()); - Assertions.assertTrue(disk.name().equalsIgnoreCase(diskName)); - Assertions.assertEquals(disk.sku(), DiskSkuTypes.STANDARD_LRS); - Assertions.assertEquals(disk.creationMethod(), DiskCreateOption.EMPTY); - Assertions.assertFalse(disk.isAttachedToVirtualMachine()); - Assertions.assertEquals(disk.sizeInGB(), 100); - Assertions.assertNull(disk.osType()); - Assertions.assertNotNull(disk.source()); - Assertions.assertEquals(disk.source().type(), CreationSourceType.EMPTY); - Assertions.assertNull(disk.source().sourceId()); - - // Resize and change storage account type - // - disk = disk.update().withSku(updateTo).withSizeInGB(200).apply(); - - Assertions.assertEquals(disk.sku(), updateTo); - Assertions.assertEquals(disk.sizeInGB(), 200); - - disk = computeManager.disks().getByResourceGroup(disk.resourceGroupName(), disk.name()); - Assertions.assertNotNull(disk); - - PagedIterable myDisks = computeManager.disks().listByResourceGroup(disk.resourceGroupName()); - Assertions.assertNotNull(myDisks); - Assertions.assertTrue(TestUtilities.getSize(myDisks) > 0); - - String sasUrl = disk.grantAccess(100); - Assertions.assertTrue(sasUrl != null && sasUrl != ""); - - // Requires access to be revoked before deleting the disk - // - disk.revokeAccess(); - computeManager.disks().deleteById(disk.id()); - } - - @Test - public void canOperateOnManagedDiskFromDisk() { - final String diskName1 = generateRandomResourceName("md-1", 20); - final String diskName2 = generateRandomResourceName("md-2", 20); - - ResourceGroup resourceGroup = resourceManager.resourceGroups().define(rgName).withRegion(region).create(); - - // Create an empty managed disk - // - Disk emptyDisk = - computeManager - .disks() - .define(diskName1) - .withRegion(region) - .withExistingResourceGroup(resourceGroup.name()) - .withData() - .withSizeInGB(100) - .create(); - - // Create a managed disk from existing managed disk - // - Disk disk = - computeManager - .disks() - .define(diskName2) - .withRegion(region) - .withExistingResourceGroup(resourceGroup.name()) - .withData() - .fromDisk(emptyDisk) - // Start Option - .withSizeInGB(200) - .withSku(DiskSkuTypes.STANDARD_LRS) - // End Option - .create(); - - disk = computeManager.disks().getById(disk.id()); - - Assertions.assertNotNull(disk.id()); - Assertions.assertTrue(disk.name().equalsIgnoreCase(diskName2)); - Assertions.assertEquals(disk.sku(), DiskSkuTypes.STANDARD_LRS); - Assertions.assertEquals(disk.creationMethod(), DiskCreateOption.COPY); - Assertions.assertFalse(disk.isAttachedToVirtualMachine()); - Assertions.assertEquals(disk.sizeInGB(), 200); - Assertions.assertNull(disk.osType()); - Assertions.assertNotNull(disk.source()); - Assertions.assertEquals(disk.source().type(), CreationSourceType.COPIED_FROM_DISK); - Assertions.assertTrue(disk.source().sourceId().equalsIgnoreCase(emptyDisk.id())); - - computeManager.disks().deleteById(emptyDisk.id()); - computeManager.disks().deleteById(disk.id()); - } - - @Test - public void canOperateOnManagedDiskFromUpload() { - final String diskName = generateRandomResourceName("md-2", 20); - - ResourceGroup resourceGroup = resourceManager.resourceGroups().define(rgName).withRegion(region).create(); - - // Create a managed disk from upload - // - Disk disk = - computeManager - .disks() - .define(diskName) - .withRegion(region) - .withExistingResourceGroup(resourceGroup.name()) - .withData() - .withUploadSizeInMB(1000) - .withSku(DiskSkuTypes.STANDARD_LRS) - // End Option - .create(); - - disk = computeManager.disks().getById(disk.id()); - - Assertions.assertNotNull(disk.id()); - Assertions.assertTrue(disk.name().equalsIgnoreCase(diskName)); - Assertions.assertEquals(disk.sku(), DiskSkuTypes.STANDARD_LRS); - Assertions.assertEquals(disk.creationMethod(), DiskCreateOption.UPLOAD); - Assertions.assertFalse(disk.isAttachedToVirtualMachine()); - Assertions.assertEquals(disk.sizeInGB(), 0); - Assertions.assertNull(disk.osType()); - Assertions.assertNotNull(disk.source()); - Assertions.assertEquals(disk.source().type(), CreationSourceType.UNKNOWN); - - computeManager.disks().deleteById(disk.id()); - } - - @Test - public void canOperateOnManagedDiskFromSnapshot() { - final String emptyDiskName = generateRandomResourceName("md-empty-", 20); - final String snapshotBasedDiskName = generateRandomResourceName("md-snp-", 20); - final String snapshotName = generateRandomResourceName("snp-", 20); - - ResourceGroup resourceGroup = resourceManager.resourceGroups().define(rgName).withRegion(region).create(); - - Disk emptyDisk = - computeManager - .disks() - .define(emptyDiskName) - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .withData() - .withSizeInGB(100) - .create(); - - Snapshot snapshot = - computeManager - .snapshots() - .define(snapshotName) - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .withDataFromDisk(emptyDisk) - .withSizeInGB(200) - .withSku(SnapshotSkuType.STANDARD_LRS) - .create(); - - Assertions.assertNotNull(snapshot.id()); - Assertions.assertTrue(snapshot.name().equalsIgnoreCase(snapshotName)); - Assertions.assertEquals(snapshot.skuType().toString(), DiskSkuTypes.STANDARD_LRS.toString()); - Assertions.assertEquals(snapshot.creationMethod(), DiskCreateOption.COPY); - Assertions.assertEquals(snapshot.sizeInGB(), 200); - Assertions.assertNull(snapshot.osType()); - Assertions.assertNotNull(snapshot.source()); - Assertions.assertEquals(snapshot.source().type(), CreationSourceType.COPIED_FROM_DISK); - Assertions.assertTrue(snapshot.source().sourceId().equalsIgnoreCase(emptyDisk.id())); - - Disk fromSnapshotDisk = - computeManager - .disks() - .define(snapshotBasedDiskName) - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .withData() - .fromSnapshot(snapshot) - .withSizeInGB(300) - .create(); - - Assertions.assertNotNull(fromSnapshotDisk.id()); - Assertions.assertTrue(fromSnapshotDisk.name().equalsIgnoreCase(snapshotBasedDiskName)); - Assertions.assertEquals(fromSnapshotDisk.sku(), DiskSkuTypes.STANDARD_LRS); - Assertions.assertEquals(fromSnapshotDisk.creationMethod(), DiskCreateOption.COPY); - Assertions.assertEquals(fromSnapshotDisk.sizeInGB(), 300); - Assertions.assertNull(fromSnapshotDisk.osType()); - Assertions.assertNotNull(fromSnapshotDisk.source()); - Assertions.assertEquals(fromSnapshotDisk.source().type(), CreationSourceType.COPIED_FROM_SNAPSHOT); - Assertions.assertTrue(fromSnapshotDisk.source().sourceId().equalsIgnoreCase(snapshot.id())); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/SharedGalleryImageTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/SharedGalleryImageTests.java deleted file mode 100644 index 391e5c0cedbf..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/SharedGalleryImageTests.java +++ /dev/null @@ -1,353 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute; - -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.compute.models.CachingTypes; -import com.azure.resourcemanager.compute.models.DiskSkuTypes; -import com.azure.resourcemanager.compute.models.Gallery; -import com.azure.resourcemanager.compute.models.GalleryImage; -import com.azure.resourcemanager.compute.models.GalleryImageVersion; -import com.azure.resourcemanager.compute.models.KnownLinuxVirtualMachineImage; -import com.azure.resourcemanager.compute.models.OperatingSystemStateTypes; -import com.azure.resourcemanager.compute.models.OperatingSystemTypes; -import com.azure.resourcemanager.compute.models.TargetRegion; -import com.azure.resourcemanager.compute.models.VirtualMachine; -import com.azure.resourcemanager.compute.models.VirtualMachineCustomImage; -import com.azure.resourcemanager.compute.models.VirtualMachineSizeTypes; -import com.azure.resourcemanager.compute.models.VirtualMachineUnmanagedDataDisk; -import com.azure.resourcemanager.test.utils.TestUtilities; -import com.azure.core.management.Region; -import com.azure.core.management.profile.AzureProfile; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public class SharedGalleryImageTests extends ComputeManagementTest { - private String rgName = ""; - private final Region region = locationOrDefault(Region.US_WEST_CENTRAL); - private final String vmName = "javavm"; - - @Override - protected void initializeClients(HttpPipeline httpPipeline, AzureProfile profile) { - rgName = generateRandomResourceName("javacsmrg", 15); - super.initializeClients(httpPipeline, profile); - } - - @Override - protected void cleanUpResources() { - resourceManager.resourceGroups().beginDeleteByName(rgName); - } - - @Test - public void canCreateUpdateListGetDeleteGallery() { - // Create a gallery - // - Gallery javaGallery = - this - .computeManager - .galleries() - .define("JavaImageGallery") - .withRegion(region) - .withNewResourceGroup(rgName) - // Optionals - Start - .withDescription("java's image gallery") - // Optionals - End - .create(); - - Assertions.assertNotNull(javaGallery.uniqueName()); - Assertions.assertEquals("JavaImageGallery", javaGallery.name()); - Assertions.assertEquals("java's image gallery", javaGallery.description()); - Assertions.assertNotNull(javaGallery.provisioningState()); - // - // Update the gallery - // - javaGallery.update().withDescription("updated java's image gallery").withTag("jdk", "openjdk").apply(); - - Assertions.assertEquals("updated java's image gallery", javaGallery.description()); - Assertions.assertNotNull(javaGallery.tags()); - Assertions.assertEquals(1, javaGallery.tags().size()); - // - // List galleries - // - PagedIterable galleries = this.computeManager.galleries().listByResourceGroup(rgName); - Assertions.assertEquals(1, TestUtilities.getSize(galleries)); - galleries = this.computeManager.galleries().list(); - Assertions.assertTrue(TestUtilities.getSize(galleries) > 0); - // - this.computeManager.galleries().deleteByResourceGroup(javaGallery.resourceGroupName(), javaGallery.name()); - } - - @Test - public void canCreateUpdateGetDeleteGalleryImage() { - final String galleryName = generateRandomResourceName("jsim", 15); - final String galleryImageName = "JavaImages"; - - // Create a gallery - // - Gallery javaGallery = - this - .computeManager - .galleries() - .define(galleryName) - .withRegion(locationOrDefault(Region.US_WEST_CENTRAL)) - .withNewResourceGroup(rgName) - .withDescription("java's image gallery") - .create(); - // - // Create an image in the gallery - // - GalleryImage galleryImage = - this - .computeManager - .galleryImages() - .define(galleryImageName) - .withExistingGallery(javaGallery) - .withLocation(region) - .withIdentifier("JavaSDKTeam", "JDK", "Jdk-9") - .withGeneralizedWindows() - // Optionals - Start - .withUnsupportedDiskType(DiskSkuTypes.STANDARD_LRS) - .withUnsupportedDiskType(DiskSkuTypes.PREMIUM_LRS) - .withRecommendedMaximumCPUsCountForVirtualMachine(25) - .withRecommendedMaximumMemoryForVirtualMachine(3200) - // Options - End - .create(); - - Assertions.assertNotNull(galleryImage); - Assertions.assertNotNull(galleryImage.innerModel()); - Assertions.assertTrue(galleryImage.location().equalsIgnoreCase(region.toString())); - Assertions.assertTrue(galleryImage.osType().equals(OperatingSystemTypes.WINDOWS)); - Assertions.assertTrue(galleryImage.osState().equals(OperatingSystemStateTypes.GENERALIZED)); - Assertions.assertEquals(2, galleryImage.unsupportedDiskTypes().size()); - Assertions.assertNotNull(galleryImage.identifier()); - Assertions.assertEquals("JavaSDKTeam", galleryImage.identifier().publisher()); - Assertions.assertEquals("JDK", galleryImage.identifier().offer()); - Assertions.assertEquals("Jdk-9", galleryImage.identifier().sku()); - Assertions.assertNotNull(galleryImage.recommendedVirtualMachineConfiguration()); - Assertions.assertNotNull(galleryImage.recommendedVirtualMachineConfiguration().vCPUs()); - Assertions.assertNotNull(galleryImage.recommendedVirtualMachineConfiguration().vCPUs().max()); - Assertions.assertEquals(25, galleryImage.recommendedVirtualMachineConfiguration().vCPUs().max().intValue()); - Assertions.assertNotNull(galleryImage.recommendedVirtualMachineConfiguration().memory()); - Assertions.assertNotNull(galleryImage.recommendedVirtualMachineConfiguration().memory().max()); - Assertions.assertEquals(3200, galleryImage.recommendedVirtualMachineConfiguration().memory().max().intValue()); - // - // Update an image in the gallery - // - galleryImage - .update() - .withoutUnsupportedDiskType(DiskSkuTypes.PREMIUM_LRS) - .withRecommendedMinimumCPUsCountForVirtualMachine(15) - .withRecommendedMemoryForVirtualMachine(2200, 3200) - .apply(); - - Assertions.assertEquals(1, galleryImage.unsupportedDiskTypes().size()); - Assertions.assertNotNull(galleryImage.recommendedVirtualMachineConfiguration()); - Assertions.assertNotNull(galleryImage.recommendedVirtualMachineConfiguration().vCPUs()); - Assertions.assertNotNull(galleryImage.recommendedVirtualMachineConfiguration().vCPUs().max()); - Assertions.assertEquals(25, galleryImage.recommendedVirtualMachineConfiguration().vCPUs().max().intValue()); - Assertions.assertNotNull(galleryImage.recommendedVirtualMachineConfiguration().vCPUs().min()); - Assertions.assertEquals(15, galleryImage.recommendedVirtualMachineConfiguration().vCPUs().min().intValue()); - Assertions.assertNotNull(galleryImage.recommendedVirtualMachineConfiguration().memory()); - Assertions.assertNotNull(galleryImage.recommendedVirtualMachineConfiguration().memory().max()); - Assertions.assertEquals(3200, galleryImage.recommendedVirtualMachineConfiguration().memory().max().intValue()); - Assertions.assertNotNull(galleryImage.recommendedVirtualMachineConfiguration().memory().min()); - Assertions.assertEquals(2200, galleryImage.recommendedVirtualMachineConfiguration().memory().min().intValue()); - // - // List images in the gallery - // - PagedIterable images = this.computeManager.galleryImages().listByGallery(rgName, galleryName); - - Assertions.assertEquals(1, TestUtilities.getSize(images)); - // - // Get image from gallery - // - galleryImage = this.computeManager.galleryImages().getByGallery(rgName, galleryName, galleryImageName); - - Assertions.assertNotNull(galleryImage); - Assertions.assertNotNull(galleryImage.innerModel()); - // - // Delete an image from gallery - // - this.computeManager.galleryImages().deleteByGallery(rgName, galleryName, galleryImageName); - } - - @Test - @Disabled( - "Service consistently fail with error 'Replication job not completed at region:XXXXX', reported to service" - + " team, ") - public void canCreateUpdateGetDeleteGalleryImageVersion() { - // - // Create { - // "startTime": "2018-09-18T19:19:33.6467692+00:00", - // "endTime": "2018-09-18T19:27:34.3244427+00:00", - // "status": "Failed", - // "error": { - // "code": "CrpPirReplicationJobsNotCompleted", - // "message": "Replication job not completed at region: westcentralus" - // }, - // "name": "971500cb-f79e-4303-9f6a-df90010a7cc1" - // }a gallery - // - final String galleryName = generateRandomResourceName("jsim", 15); // "jsim94f154754"; - - Gallery gallery = - this - .computeManager - .galleries() - .define(galleryName) - .withRegion(locationOrDefault(Region.US_WEST_CENTRAL)) - .withNewResourceGroup(rgName) - .withDescription("java's image gallery") - .create(); - // - // Create an image in the gallery (a container to hold custom linux image) - // - final String galleryImageName = "SampleImages"; - - GalleryImage galleryImage = - this - .computeManager - .galleryImages() - .define(galleryImageName) - .withExistingGallery(gallery) - .withLocation(region) - .withIdentifier("JavaSDKTeam", "JDK", "Jdk-9") - .withGeneralizedLinux() - .create(); - // - // Create a custom image to base the version on - // - VirtualMachineCustomImage customImage = prepareCustomImage(rgName, region, computeManager); - // String customImageId = - // "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/javacsmrg91482/providers/Microsoft.Compute/images/img96429090dee3"; - // - // Create a image version based on the custom image - // - - final String versionName = "0.0.4"; - - GalleryImageVersion imageVersion = - this - .computeManager - .galleryImageVersions() - .define(versionName) - .withExistingImage(rgName, gallery.name(), galleryImage.name()) - .withLocation(region.toString()) - .withSourceCustomImage(customImage) - // Options - Start - .withRegionAvailability(locationOrDefault(Region.US_WEST2), 1) - // Options - End - .create(); - - Assertions.assertNotNull(imageVersion); - Assertions.assertNotNull(imageVersion.innerModel()); - Assertions.assertNotNull(imageVersion.availableRegions()); - Assertions.assertEquals(2, imageVersion.availableRegions().size()); - boolean found = false; - String expectedRegion = "westus2"; - for (TargetRegion targetRegion : imageVersion.availableRegions()) { - if (targetRegion.name().replaceAll("\\s", "").equalsIgnoreCase(expectedRegion)) { - found = true; - break; - } - } - Assertions.assertTrue(found, "expected region" + expectedRegion + " not found"); - Assertions.assertFalse(imageVersion.isExcludedFromLatest()); - - // - // Update image version - // - imageVersion.update().withoutRegionAvailability(locationOrDefault(Region.US_WEST2)).apply(); - - Assertions.assertNotNull(imageVersion.availableRegions()); - Assertions.assertEquals(1, imageVersion.availableRegions().size()); - Assertions.assertFalse(imageVersion.isExcludedFromLatest()); - - // - // List image versions - // - PagedIterable versions = galleryImage.listVersions(); - - Assertions.assertNotNull(versions); - Assertions.assertTrue(TestUtilities.getSize(versions) > 0); - - // - // Delete the image version - // - this - .computeManager - .galleryImageVersions() - .deleteByGalleryImage(rgName, galleryName, galleryImageName, versionName); - } - - private VirtualMachineCustomImage prepareCustomImage(String rgName, Region region, ComputeManager computeManager) { - VirtualMachine linuxVM = - prepareGeneralizedVmWith2EmptyDataDisks( - rgName, generateRandomResourceName("muldvm", 15), region, computeManager); - - final String vhdBasedImageName = generateRandomResourceName("img", 20); - // - VirtualMachineCustomImage.DefinitionStages.WithCreateAndDataDiskImageOSDiskSettings creatableDisk = - computeManager - .virtualMachineCustomImages() - .define(vhdBasedImageName) - .withRegion(region) - .withNewResourceGroup(rgName) - .withLinuxFromVhd(linuxVM.osUnmanagedDiskVhdUri(), OperatingSystemStateTypes.GENERALIZED) - .withOSDiskCaching(linuxVM.osDiskCachingType()); - for (VirtualMachineUnmanagedDataDisk disk : linuxVM.unmanagedDataDisks().values()) { - creatableDisk - .defineDataDiskImage() - .withLun(disk.lun()) - .fromVhd(disk.vhdUri()) - .withDiskCaching(disk.cachingType()) - .withDiskSizeInGB(disk.size() + 10) // Resize each data disk image by +10GB - .attach(); - } - // - VirtualMachineCustomImage customImage = creatableDisk.create(); - return customImage; - } - - private VirtualMachine prepareGeneralizedVmWith2EmptyDataDisks( - String rgName, String vmName, Region region, ComputeManager computeManager) { - final String uname = "javauser"; - final String password = password(); - final KnownLinuxVirtualMachineImage linuxImage = KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS; - final String publicIpDnsLabel = generateRandomResourceName("pip", 20); - - VirtualMachine virtualMachine = - computeManager - .virtualMachines() - .define(vmName) - .withRegion(region) - .withNewResourceGroup(rgName) - .withNewPrimaryNetwork("10.0.0.0/28") - .withPrimaryPrivateIPAddressDynamic() - .withNewPrimaryPublicIPAddress(publicIpDnsLabel) - .withPopularLinuxImage(linuxImage) - .withRootUsername(uname) - .withSsh(sshPublicKey()) - .withUnmanagedDisks() - .defineUnmanagedDataDisk("disk-1") - .withNewVhd(30) - .withCaching(CachingTypes.READ_WRITE) - .attach() - .defineUnmanagedDataDisk("disk-2") - .withNewVhd(60) - .withCaching(CachingTypes.READ_ONLY) - .attach() - .withSize(VirtualMachineSizeTypes.fromString("Standard_D2a_v4")) - .withNewStorageAccount(generateRandomResourceName("stg", 17)) - .withOSDiskCaching(CachingTypes.READ_WRITE) - .create(); - // - deprovisionAgentInLinuxVM(virtualMachine); - virtualMachine.deallocate(); - virtualMachine.generalize(); - return virtualMachine; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/VirtualMachineAvailabilityZoneOperationsTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/VirtualMachineAvailabilityZoneOperationsTests.java deleted file mode 100644 index 6e638d3e88c6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/VirtualMachineAvailabilityZoneOperationsTests.java +++ /dev/null @@ -1,572 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute; - -import com.azure.core.http.HttpPipeline; -import com.azure.resourcemanager.compute.models.CachingTypes; -import com.azure.resourcemanager.compute.models.Disk; -import com.azure.resourcemanager.compute.models.KnownLinuxVirtualMachineImage; -import com.azure.resourcemanager.compute.models.ProximityPlacementGroupType; -import com.azure.resourcemanager.compute.models.VirtualMachine; -import com.azure.resourcemanager.compute.models.VirtualMachineDataDisk; -import com.azure.resourcemanager.compute.models.VirtualMachineSizeTypes; -import com.azure.resourcemanager.network.models.LoadBalancer; -import com.azure.resourcemanager.network.models.LoadBalancerFrontend; -import com.azure.resourcemanager.network.models.LoadBalancerPublicFrontend; -import com.azure.resourcemanager.network.models.LoadBalancerSkuType; -import com.azure.resourcemanager.network.models.LoadBalancingRule; -import com.azure.resourcemanager.network.models.Network; -import com.azure.resourcemanager.network.models.PublicIpAddress; -import com.azure.resourcemanager.network.models.PublicIPSkuType; -import com.azure.resourcemanager.network.models.Subnet; -import com.azure.resourcemanager.network.models.TransportProtocol; -import com.azure.resourcemanager.resources.models.ResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.AvailabilityZoneId; -import com.azure.core.management.Region; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.CreatedResources; -import java.util.Iterator; -import java.util.Map; - -import com.azure.core.management.profile.AzureProfile; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public class VirtualMachineAvailabilityZoneOperationsTests extends ComputeManagementTest { - private String rgName = ""; - private final Region region = locationOrDefault(Region.US_EAST2); - private final String vmName = "javavm"; - - @Override - protected void initializeClients(HttpPipeline httpPipeline, AzureProfile profile) { - rgName = generateRandomResourceName("javacsmrg", 15); - super.initializeClients(httpPipeline, profile); - } - - @Override - protected void cleanUpResources() { - resourceManager.resourceGroups().beginDeleteByName(rgName); - } - - @Test - public void canCreateZonedVirtualMachineWithImplicitZoneForRelatedResources() throws Exception { - final String pipDnsLabel = generateRandomResourceName("pip", 10); - final String proxyGroupName = "plg1Test"; - // Create a zoned virtual machine - // - VirtualMachine virtualMachine = - computeManager - .virtualMachines() - .define(vmName) - .withRegion(region) - .withNewResourceGroup(rgName) - .withNewPrimaryNetwork("10.0.0.0/28") - .withPrimaryPrivateIPAddressDynamic() - .withNewPrimaryPublicIPAddress(pipDnsLabel) - .withNewProximityPlacementGroup(proxyGroupName, ProximityPlacementGroupType.STANDARD) - .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) - .withRootUsername("Foo12") - .withSsh(sshPublicKey()) - // Optionals - .withAvailabilityZone(AvailabilityZoneId.ZONE_1) - .withSize(VirtualMachineSizeTypes.fromString("Standard_D2a_v4")) - .withOSDiskCaching(CachingTypes.READ_WRITE) - // Create VM - .create(); - - // Checks the zone assigned to the virtual machine - // - Assertions.assertNotNull(virtualMachine.availabilityZones()); - Assertions.assertFalse(virtualMachine.availabilityZones().isEmpty()); - Assertions.assertTrue(virtualMachine.availabilityZones().contains(AvailabilityZoneId.ZONE_1)); - - // Check the proximity placement group information - Assertions.assertNotNull(virtualMachine.proximityPlacementGroup()); - Assertions - .assertEquals( - ProximityPlacementGroupType.STANDARD, - virtualMachine.proximityPlacementGroup().proximityPlacementGroupType()); - Assertions.assertNotNull(virtualMachine.proximityPlacementGroup().virtualMachineIds()); - Assertions - .assertTrue( - virtualMachine - .id() - .equalsIgnoreCase(virtualMachine.proximityPlacementGroup().virtualMachineIds().get(0))); - - // Checks the zone assigned to the implicitly created public IP address. - // Implicitly created PIP will be BASIC - // - PublicIpAddress publicIPAddress = virtualMachine.getPrimaryPublicIPAddress(); - Assertions.assertNotNull(publicIPAddress.availabilityZones()); - Assertions.assertFalse(publicIPAddress.availabilityZones().isEmpty()); - Assertions.assertTrue(publicIPAddress.availabilityZones().contains(AvailabilityZoneId.ZONE_1)); - // Checks the zone assigned to the implicitly created managed OS disk. - // - String osDiskId = virtualMachine.osDiskId(); // Only VM based on managed disk can have zone assigned - Assertions.assertNotNull(osDiskId); - Assertions.assertFalse(osDiskId.isEmpty()); - Disk osDisk = computeManager.disks().getById(osDiskId); - Assertions.assertNotNull(osDisk); - // Checks the zone assigned to the implicitly created managed OS disk. - // - Assertions.assertNotNull(osDisk.availabilityZones()); - Assertions.assertFalse(osDisk.availabilityZones().isEmpty()); - Assertions.assertTrue(osDisk.availabilityZones().contains(AvailabilityZoneId.ZONE_1)); - } - - @Test - public void canCreateZonedVirtualMachineWithExplicitZoneForRelatedResources() throws Exception { - // Create zoned public IP for the virtual machine - // - final String pipDnsLabel = generateRandomResourceName("pip", 10); - PublicIpAddress publicIPAddress = - networkManager - .publicIpAddresses() - .define(pipDnsLabel) - .withRegion(region) - .withNewResourceGroup(rgName) - .withStaticIP() - // Optionals - .withAvailabilityZone( - AvailabilityZoneId.ZONE_1) // since the SKU is BASIC and VM is zoned, PIP must be zoned - .withSku( - PublicIPSkuType - .BASIC) // Basic sku is never zone resilient, so if you want it zoned, specify explicitly as - // above. - // Create PIP - .create(); - // Create a zoned data disk for the virtual machine - // - final String diskName = generateRandomResourceName("dsk", 10); - Disk dataDisk = - computeManager - .disks() - .define(diskName) - .withRegion(region) - .withExistingResourceGroup(rgName) - .withData() - .withSizeInGB(100) - // Optionals - .withAvailabilityZone(AvailabilityZoneId.ZONE_1) - // Create Disk - .create(); - // Create a zoned virtual machine - // - VirtualMachine virtualMachine = - computeManager - .virtualMachines() - .define(vmName) - .withRegion(region) - .withNewResourceGroup(rgName) - .withNewPrimaryNetwork("10.0.0.0/28") - .withPrimaryPrivateIPAddressDynamic() - .withExistingPrimaryPublicIPAddress(publicIPAddress) - .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) - .withRootUsername("Foo12") - .withSsh(sshPublicKey()) - // Optionals - .withAvailabilityZone(AvailabilityZoneId.ZONE_1) - .withExistingDataDisk(dataDisk) - .withSize(VirtualMachineSizeTypes.fromString("Standard_D2a_v4")) - // Create VM - .create(); - // Checks the zone assigned to the virtual machine - // - Assertions.assertNotNull(virtualMachine.availabilityZones()); - Assertions.assertFalse(virtualMachine.availabilityZones().isEmpty()); - Assertions.assertTrue(virtualMachine.availabilityZones().contains(AvailabilityZoneId.ZONE_1)); - // Checks the zone assigned to the explicitly created public IP address. - // - publicIPAddress = virtualMachine.getPrimaryPublicIPAddress(); - Assertions.assertNotNull(publicIPAddress.sku()); - Assertions.assertTrue(publicIPAddress.sku().equals(PublicIPSkuType.BASIC)); - Assertions.assertNotNull(publicIPAddress.availabilityZones()); - Assertions.assertFalse(publicIPAddress.availabilityZones().isEmpty()); - Assertions.assertTrue(publicIPAddress.availabilityZones().contains(AvailabilityZoneId.ZONE_1)); - // Check the zone assigned to the explicitly created data disk - // - Map dataDisks = virtualMachine.dataDisks(); - Assertions.assertNotNull(dataDisks); - Assertions.assertFalse(dataDisks.isEmpty()); - VirtualMachineDataDisk dataDisk1 = dataDisks.values().iterator().next(); - Assertions.assertNotNull(dataDisk1.id()); - dataDisk = computeManager.disks().getById(dataDisk1.id()); - Assertions.assertNotNull(dataDisk); - Assertions.assertNotNull(dataDisk.availabilityZones()); - Assertions.assertFalse(dataDisk.availabilityZones().isEmpty()); - Assertions.assertTrue(dataDisk.availabilityZones().contains(AvailabilityZoneId.ZONE_1)); - // Checks the zone assigned to the implicitly created managed OS disk. - // - String osDiskId = virtualMachine.osDiskId(); // Only VM based on managed disk can have zone assigned - Assertions.assertNotNull(osDiskId); - Assertions.assertFalse(osDiskId.isEmpty()); - Disk osDisk = computeManager.disks().getById(osDiskId); - Assertions.assertNotNull(osDisk); - // Checks the zone assigned to the implicitly created managed OS disk. - // - Assertions.assertNotNull(osDisk.availabilityZones()); - Assertions.assertFalse(osDisk.availabilityZones().isEmpty()); - Assertions.assertTrue(osDisk.availabilityZones().contains(AvailabilityZoneId.ZONE_1)); - } - - @Test - public void canCreateZonedVirtualMachineWithZoneResilientPublicIP() throws Exception { - // Create zone resilient public IP for the virtual machine - // - final String pipDnsLabel = generateRandomResourceName("pip", 10); - PublicIpAddress publicIPAddress = - networkManager - .publicIpAddresses() - .define(pipDnsLabel) - .withRegion(region) - .withNewResourceGroup(rgName) - .withStaticIP() - // Optionals - .withSku( - PublicIPSkuType - .STANDARD) // No zone selected, STANDARD SKU is zone resilient [zone resilient: resources - // deployed in all zones by the service and it will be served by all AZs all the - // time] - // Create PIP - .create(); - // Create a zoned virtual machine - // - VirtualMachine virtualMachine = - computeManager - .virtualMachines() - .define(vmName) - .withRegion(region) - .withNewResourceGroup(rgName) - .withNewPrimaryNetwork("10.0.0.0/28") - .withPrimaryPrivateIPAddressDynamic() - .withExistingPrimaryPublicIPAddress(publicIPAddress) - .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) - .withRootUsername("Foo12") - .withSsh(sshPublicKey()) - // Optionals - .withAvailabilityZone(AvailabilityZoneId.ZONE_1) - .withSize(VirtualMachineSizeTypes.fromString("Standard_D2a_v4")) - // Create VM - .create(); - // Checks the zone assigned to the virtual machine - // - Assertions.assertNotNull(virtualMachine.availabilityZones()); - Assertions.assertFalse(virtualMachine.availabilityZones().isEmpty()); - Assertions.assertTrue(virtualMachine.availabilityZones().contains(AvailabilityZoneId.ZONE_1)); - // Check the zone resilient PIP - // - publicIPAddress = virtualMachine.getPrimaryPublicIPAddress(); - Assertions.assertNotNull(publicIPAddress.sku()); - Assertions.assertTrue(publicIPAddress.sku().equals(PublicIPSkuType.STANDARD)); - Assertions - .assertNotNull( - publicIPAddress - .availabilityZones()); // Though zone-resilient, this property won't be populated by the service. - Assertions.assertTrue(publicIPAddress.availabilityZones().isEmpty()); - } - - @Test - @Disabled("Though valid scenario, ignoring it due to network service bug") - @SuppressWarnings("unchecked") - public void - canCreateRegionalNonAvailSetVirtualMachinesAndAssociateThemWithSingleBackendPoolOfZoneResilientLoadBalancer() - throws Exception { - final String networkName = generateRandomResourceName("net", 10); - Network network = - networkManager - .networks() - .define(networkName) - .withRegion(region) - .withNewResourceGroup(rgName) - .withAddressSpace("10.0.0.0/28") - .withSubnet("subnet1", "10.0.0.0/29") - .withSubnet("subnet2", "10.0.0.8/29") - .create(); - - // create two regional virtual machine, which does not belongs to any availability set - // - Iterator subnets = network.subnets().values().iterator(); - // Define first regional virtual machine - // - Creatable creatableVM1 = - computeManager - .virtualMachines() - .define(generateRandomResourceName("vm1", 10)) - .withRegion(region) - .withExistingResourceGroup(rgName) - .withExistingPrimaryNetwork(network) - .withSubnet(subnets.next().name()) // Put VM in first subnet - .withPrimaryPrivateIPAddressDynamic() - .withoutPrimaryPublicIPAddress() - .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) - .withRootUsername("Foo12") - .withSsh(sshPublicKey()) - // Optionals - .withSize(VirtualMachineSizeTypes.fromString("Standard_D2a_v4")); - - // Define second regional virtual machine - // - Creatable creatableVM2 = - computeManager - .virtualMachines() - .define(generateRandomResourceName("vm2", 10)) - .withRegion(region) - .withExistingResourceGroup(rgName) - .withExistingPrimaryNetwork(network) - .withSubnet(subnets.next().name()) // Put VM in second subnet - .withPrimaryPrivateIPAddressDynamic() - .withoutPrimaryPublicIPAddress() - .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) - .withRootUsername("Foo12") - .withSsh(sshPublicKey()) - // Optionals - .withSize(VirtualMachineSizeTypes.fromString("Standard_D2a_v4")); - - CreatedResources createdVMs = - computeManager.virtualMachines().create(creatableVM1, creatableVM2); - - VirtualMachine firstVirtualMachine = createdVMs.get(creatableVM1.key()); - VirtualMachine secondVirtualMachine = createdVMs.get(creatableVM2.key()); - - // Work around bug in the network service - // Once the fix is deployed remove below code to powerOff and deallocate VMs - // - // Completable completable1 = - // firstVirtualMachine.powerOffAsync().concatWith(firstVirtualMachine.deallocateAsync()); - // Completable completable2 = - // secondVirtualMachine.powerOffAsync().concatWith(secondVirtualMachine.deallocateAsync()); - // Completable.merge(completable1, completable2).await(); - - // Creates a public IP address for the internet-facing load-balancer - // - final String pipDnsLabel = generateRandomResourceName("pip", 10); - PublicIpAddress publicIPAddress = - networkManager - .publicIpAddresses() - .define(pipDnsLabel) - .withRegion(region) - .withExistingResourceGroup(rgName) - .withStaticIP() - // Optionals - .withSku(PublicIPSkuType.STANDARD) // STANDARD LB requires STANDARD PIP - // Create PIP - .create(); - - // Creates a Internet-Facing LoadBalancer with one front-end IP configuration and - // two backend pool associated with this IP Config - // - final String lbName = generateRandomResourceName("lb", 10); - LoadBalancer lb = - this - .networkManager - .loadBalancers() - .define(lbName) - .withRegion(region) - .withExistingResourceGroup(rgName) - .defineLoadBalancingRule("rule-1") - .withProtocol(TransportProtocol.TCP) - .fromFrontend("front-end-1") - .fromFrontendPort(80) - .toExistingVirtualMachines(firstVirtualMachine, secondVirtualMachine) - .withProbe("tcpProbe-1") - .attach() - .definePublicFrontend("front-end-1") // Define the frontend IP configuration used by the LB rule - .withExistingPublicIpAddress(publicIPAddress) - .attach() - .defineTcpProbe("tcpProbe-1") // Define the Probe used by the LB rule - .withPort(25) - .withIntervalInSeconds(15) - .withNumberOfProbes(5) - .attach() - .withSku( - LoadBalancerSkuType - .STANDARD) // "zone-resilient LB" which don't have the constraint that all VMs needs to be in - // the same availability set - .create(); - - // Zone resilient LB does not care VMs are zoned or regional, in the above cases VMs are regional. - // - // rx.Completable.merge(firstVirtualMachine.startAsync(), secondVirtualMachine.startAsync()).await(); - - // Verify frontends - Assertions.assertEquals(1, lb.frontends().size()); - Assertions.assertEquals(1, lb.publicFrontends().size()); - Assertions.assertEquals(0, lb.privateFrontends().size()); - LoadBalancerFrontend frontend = lb.frontends().values().iterator().next(); - Assertions.assertTrue(frontend.isPublic()); - LoadBalancerPublicFrontend publicFrontend = (LoadBalancerPublicFrontend) frontend; - Assertions.assertTrue(publicIPAddress.id().equalsIgnoreCase(publicFrontend.publicIpAddressId())); - - // Verify backends - Assertions.assertEquals(1, lb.backends().size()); - - // Verify probes - Assertions.assertEquals(1, lb.tcpProbes().size()); - Assertions.assertTrue(lb.tcpProbes().containsKey("tcpProbe-1")); - - // Verify rules - Assertions.assertEquals(1, lb.loadBalancingRules().size()); - Assertions.assertTrue(lb.loadBalancingRules().containsKey("rule-1")); - LoadBalancingRule rule = lb.loadBalancingRules().get("rule-1"); - Assertions.assertNotNull(rule.backend()); - Assertions.assertTrue(rule.probe().name().equalsIgnoreCase("tcpProbe-1")); - - // Note that above configuration is not possible for BASIC LB, BASIC LB has following limitation - // It supports VMs only in a single availability Set in a backend pool, though multiple backend pool - // can be associated with VMs in the single availability set, you cannot create a set of VMs in another - // availability set and put it in a different backend pool. - - // Start the VM [This can be removed once the fix is deployed] - // rx.Completable.merge(firstVirtualMachine.startAsync(), secondVirtualMachine.startAsync()).await(); - } - - @Test - @Disabled("Though valid scenario, ignoring it due to network service bug") - @SuppressWarnings("unchecked") - public void canCreateZonedVirtualMachinesAndAssociateThemWithSingleBackendPoolOfZoneResilientLoadBalancer() - throws Exception { - final String networkName = generateRandomResourceName("net", 10); - Network network = - networkManager - .networks() - .define(networkName) - .withRegion(region) - .withNewResourceGroup(rgName) - .withAddressSpace("10.0.0.0/28") - .withSubnet("subnet1", "10.0.0.0/29") - .withSubnet("subnet2", "10.0.0.8/29") - .create(); - - // create two regional virtual machine, which does not belongs to any availability set - // - Iterator subnets = network.subnets().values().iterator(); - // Define first regional virtual machine - // - Creatable creatableVM1 = - computeManager - .virtualMachines() - .define(generateRandomResourceName("vm1", 10)) - .withRegion(region) - .withExistingResourceGroup(rgName) - .withExistingPrimaryNetwork(network) - .withSubnet(subnets.next().name()) // Put VM in first subnet - .withPrimaryPrivateIPAddressDynamic() - .withoutPrimaryPublicIPAddress() - .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) - .withRootUsername("Foo12") - .withSsh(sshPublicKey()) - .withAvailabilityZone(AvailabilityZoneId.ZONE_1) - // Optionals - .withSize(VirtualMachineSizeTypes.fromString("Standard_D2a_v4")); - - // Define second regional virtual machine - // - Creatable creatableVM2 = - computeManager - .virtualMachines() - .define(generateRandomResourceName("vm2", 10)) - .withRegion(region) - .withExistingResourceGroup(rgName) - .withExistingPrimaryNetwork(network) - .withSubnet(subnets.next().name()) // Put VM in second subnet - .withPrimaryPrivateIPAddressDynamic() - .withoutPrimaryPublicIPAddress() - .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) - .withRootUsername("Foo12") - .withSsh(sshPublicKey()) - .withAvailabilityZone(AvailabilityZoneId.ZONE_1) - // Optionals - .withSize(VirtualMachineSizeTypes.fromString("Standard_D2a_v4")); - - CreatedResources createdVMs = - computeManager.virtualMachines().create(creatableVM1, creatableVM2); - - // Creates a public IP address for the internet-facing load-balancer - // - final String pipDnsLabel = generateRandomResourceName("pip", 10); - PublicIpAddress publicIPAddress = - networkManager - .publicIpAddresses() - .define(pipDnsLabel) - .withRegion(region) - .withExistingResourceGroup(rgName) - .withStaticIP() - // Optionals - .withSku(PublicIPSkuType.STANDARD) // STANDARD LB requires STANDARD PIP - // Create PIP - .create(); - - ResourceGroup resourceGroup = this.resourceManager.resourceGroups().getByName(network.resourceGroupName()); - - // Creates a Internet-Facing LoadBalancer with one front-end IP configuration and - // two backend pool associated with this IP Config - // - final String loadBalancerName = generateRandomResourceName("extlb" + "1" + "-", 18); - final String publicIPName = "pip-" + loadBalancerName; - final String frontendName = loadBalancerName + "-FE1"; - - // Sku of PublicIP and LoadBalancer must match - // - - PublicIpAddress lbPip = - this - .networkManager - .publicIpAddresses() - .define(publicIPName) - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .withLeafDomainLabel(publicIPName) - // Optionals - .withStaticIP() - .withSku(PublicIPSkuType.STANDARD) - // Create - .create(); - - LoadBalancer loadBalancer = - this - .networkManager - .loadBalancers() - .define(loadBalancerName) - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - - // Add two rules that uses above backend and probe - .defineLoadBalancingRule("httpRule") - .withProtocol(TransportProtocol.TCP) - .fromFrontend(frontendName) - .fromFrontendPort(80) - .toExistingVirtualMachines(createdVMs.get(creatableVM1.key())) - .withProbe("httpProbe") - .attach() - .defineLoadBalancingRule("httpsRule") - .withProtocol(TransportProtocol.TCP) - .fromFrontend(frontendName) - .fromFrontendPort(443) - .toExistingVirtualMachines(createdVMs.get(creatableVM2.key())) - .withProbe("httpsProbe") - .attach() - // Explicitly define the frontend - .definePublicFrontend(frontendName) - .withExistingPublicIpAddress(publicIPAddress) // Frontend with PIP means internet-facing load-balancer - .attach() - - // Add two probes one per rule - .defineHttpProbe("httpProbe") - .withRequestPath("/") - .attach() - .defineHttpProbe("httpsProbe") - .withRequestPath("/") - .attach() - .withSku(LoadBalancerSkuType.STANDARD) - .create(); - // Zone resilient LB does not care VMs are zoned or regional, in the above cases VMs are zoned. - // - - // Note that above configuration is not possible for BASIC LB, BASIC LB has following limitation - // It supports VMs only in a single availability Set in a backend pool, though multiple backend pool - // can be associated with VMs in the single availability set, you cannot create a set of VMs in another - // availability set and put it in a different backend pool. - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/VirtualMachineBootDiagnosticsTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/VirtualMachineBootDiagnosticsTests.java deleted file mode 100644 index 44f4e4806c09..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/VirtualMachineBootDiagnosticsTests.java +++ /dev/null @@ -1,320 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute; - -import com.azure.core.http.HttpPipeline; -import com.azure.resourcemanager.compute.models.KnownLinuxVirtualMachineImage; -import com.azure.resourcemanager.compute.models.OperatingSystemTypes; -import com.azure.resourcemanager.compute.models.VirtualMachine; -import com.azure.core.management.Region; -import com.azure.resourcemanager.compute.models.VirtualMachineSizeTypes; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.storage.models.StorageAccount; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public class VirtualMachineBootDiagnosticsTests extends ComputeManagementTest { - private String rgName = ""; - private final Region region = locationOrDefault(Region.US_EAST); - private final String vmName = "javavm"; - - @Override - protected void initializeClients(HttpPipeline httpPipeline, AzureProfile profile) { - rgName = generateRandomResourceName("javacsmrg", 15); - super.initializeClients(httpPipeline, profile); - } - - @Override - protected void cleanUpResources() { - resourceManager.resourceGroups().beginDeleteByName(rgName); - } - - @Test - public void canEnableBootDiagnosticsWithImplicitStorageOnManagedVMCreation() { - VirtualMachine virtualMachine = - computeManager - .virtualMachines() - .define(vmName) - .withRegion(region) - .withNewResourceGroup(rgName) - .withNewPrimaryNetwork("10.0.0.0/28") - .withPrimaryPrivateIPAddressDynamic() - .withoutPrimaryPublicIPAddress() - .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) - .withRootUsername("Foo12") - .withSsh(sshPublicKey()) - .withBootDiagnostics() - .create(); - - Assertions.assertNotNull(virtualMachine); - Assertions.assertTrue(virtualMachine.isBootDiagnosticsEnabled()); - Assertions.assertNotNull(virtualMachine.bootDiagnosticsStorageUri()); - } - - @Test - public void canEnableBootDiagnosticsWithCreatableStorageOnManagedVMCreation() { - final String storageName = generateRandomResourceName("st", 14); - Creatable creatableStorageAccount = - storageManager.storageAccounts().define(storageName).withRegion(region).withNewResourceGroup(rgName); - - VirtualMachine virtualMachine = - computeManager - .virtualMachines() - .define(vmName) - .withRegion(region) - .withNewResourceGroup(rgName) - .withNewPrimaryNetwork("10.0.0.0/28") - .withPrimaryPrivateIPAddressDynamic() - .withoutPrimaryPublicIPAddress() - .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) - .withRootUsername("Foo12") - .withSsh(sshPublicKey()) - .withBootDiagnostics(creatableStorageAccount) - .create(); - Assertions.assertNotNull(virtualMachine); - Assertions.assertTrue(virtualMachine.isBootDiagnosticsEnabled()); - Assertions.assertNotNull(virtualMachine.bootDiagnosticsStorageUri()); - Assertions.assertTrue(virtualMachine.bootDiagnosticsStorageUri().contains(storageName)); - } - - @Test - public void canEnableBootDiagnosticsWithExplicitStorageOnManagedVMCreation() { - final String storageName = generateRandomResourceName("st", 14); - StorageAccount storageAccount = - storageManager - .storageAccounts() - .define(storageName) - .withRegion(region) - .withNewResourceGroup(rgName) - .create(); - - VirtualMachine virtualMachine = - computeManager - .virtualMachines() - .define(vmName) - .withRegion(region) - .withNewResourceGroup(rgName) - .withNewPrimaryNetwork("10.0.0.0/28") - .withPrimaryPrivateIPAddressDynamic() - .withoutPrimaryPublicIPAddress() - .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) - .withRootUsername("Foo12") - .withSsh(sshPublicKey()) - .withBootDiagnostics(storageAccount) - .create(); - - Assertions.assertNotNull(virtualMachine); - Assertions.assertTrue(virtualMachine.isBootDiagnosticsEnabled()); - Assertions.assertNotNull(virtualMachine.bootDiagnosticsStorageUri()); - Assertions.assertTrue(virtualMachine.bootDiagnosticsStorageUri().contains(storageName)); - } - - @Test - public void canDisableBootDiagnostics() { - VirtualMachine virtualMachine = - computeManager - .virtualMachines() - .define(vmName) - .withRegion(region) - .withNewResourceGroup(rgName) - .withNewPrimaryNetwork("10.0.0.0/28") - .withPrimaryPrivateIPAddressDynamic() - .withoutPrimaryPublicIPAddress() - .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) - .withRootUsername("Foo12") - .withSsh(sshPublicKey()) - .withBootDiagnostics() - .create(); - - Assertions.assertNotNull(virtualMachine); - Assertions.assertTrue(virtualMachine.isBootDiagnosticsEnabled()); - Assertions.assertNotNull(virtualMachine.bootDiagnosticsStorageUri()); - - virtualMachine.update().withoutBootDiagnostics().apply(); - - Assertions.assertFalse(virtualMachine.isBootDiagnosticsEnabled()); - // Disabling boot diagnostics will not remove the storage uri from the vm payload. - Assertions.assertNotNull(virtualMachine.bootDiagnosticsStorageUri()); - } - - @Test - public void bootDiagnosticsShouldUsesOSUnManagedDiskImplicitStorage() { - VirtualMachine virtualMachine = - computeManager - .virtualMachines() - .define(vmName) - .withRegion(region) - .withNewResourceGroup(rgName) - .withNewPrimaryNetwork("10.0.0.0/28") - .withPrimaryPrivateIPAddressDynamic() - .withoutPrimaryPublicIPAddress() - .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) - .withRootUsername("Foo12") - .withSsh(sshPublicKey()) - .withUnmanagedDisks() // The implicit storage account for OS disk should be used for boot diagnostics as - // well - .withBootDiagnostics() - .create(); - - Assertions.assertNotNull(virtualMachine); - Assertions.assertTrue(virtualMachine.isBootDiagnosticsEnabled()); - Assertions.assertNotNull(virtualMachine.bootDiagnosticsStorageUri()); - Assertions.assertNotNull(virtualMachine.osUnmanagedDiskVhdUri()); - Assertions - .assertTrue( - virtualMachine - .osUnmanagedDiskVhdUri() - .toLowerCase() - .startsWith(virtualMachine.bootDiagnosticsStorageUri().toLowerCase())); - } - - @Test - public void bootDiagnosticsShouldUseUnManagedDisksExplicitStorage() { - final String storageName = generateRandomResourceName("st", 14); - StorageAccount storageAccount = - storageManager - .storageAccounts() - .define(storageName) - .withRegion(region) - .withNewResourceGroup(rgName) - .create(); - - VirtualMachine virtualMachine = - computeManager - .virtualMachines() - .define(vmName) - .withRegion(region) - .withNewResourceGroup(rgName) - .withNewPrimaryNetwork("10.0.0.0/28") - .withPrimaryPrivateIPAddressDynamic() - .withoutPrimaryPublicIPAddress() - .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) - .withRootUsername("Foo12") - .withSsh(sshPublicKey()) - .withUnmanagedDisks() - .withBootDiagnostics() - .withExistingStorageAccount( - storageAccount) // This storage account must be shared by disk and boot diagnostics - .create(); - - Assertions.assertNotNull(virtualMachine); - Assertions.assertTrue(virtualMachine.isBootDiagnosticsEnabled()); - Assertions.assertNotNull(virtualMachine.bootDiagnosticsStorageUri()); - Assertions.assertTrue(virtualMachine.bootDiagnosticsStorageUri().contains(storageName)); - } - - @Test - public void canEnableBootDiagnosticsWithImplicitStorageOnUnManagedVMCreation() { - VirtualMachine virtualMachine1 = - computeManager - .virtualMachines() - .define(vmName) - .withRegion(region) - .withNewResourceGroup(rgName) - .withNewPrimaryNetwork("10.0.0.0/28") - .withPrimaryPrivateIPAddressDynamic() - .withoutPrimaryPublicIPAddress() - .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) - .withRootUsername("Foo12") - .withSsh(sshPublicKey()) - .withUnmanagedDisks() - .create(); - - String osDiskVhd = virtualMachine1.osUnmanagedDiskVhdUri(); - Assertions.assertNotNull(osDiskVhd); - computeManager.virtualMachines().deleteById(virtualMachine1.id()); - - VirtualMachine virtualMachine2 = - computeManager - .virtualMachines() - .define(vmName) - .withRegion(region) - .withNewResourceGroup(rgName) - .withNewPrimaryNetwork("10.0.0.0/28") - .withPrimaryPrivateIPAddressDynamic() - .withoutPrimaryPublicIPAddress() - .withSpecializedOSUnmanagedDisk(osDiskVhd, OperatingSystemTypes.LINUX) - .withBootDiagnostics() // A new storage account should be created and used - .create(); - - Assertions.assertNotNull(virtualMachine2); - Assertions.assertTrue(virtualMachine2.isBootDiagnosticsEnabled()); - Assertions.assertNotNull(virtualMachine2.bootDiagnosticsStorageUri()); - Assertions.assertNotNull(virtualMachine2.osUnmanagedDiskVhdUri()); - Assertions - .assertFalse( - virtualMachine2 - .osUnmanagedDiskVhdUri() - .toLowerCase() - .startsWith(virtualMachine2.bootDiagnosticsStorageUri().toLowerCase())); - } - - @Test - public void canEnableBootDiagnosticsWithCreatableStorageOnUnManagedVMCreation() { - final String storageName = generateRandomResourceName("st", 14); - Creatable creatableStorageAccount = - storageManager.storageAccounts().define(storageName).withRegion(region).withNewResourceGroup(rgName); - - VirtualMachine virtualMachine = - computeManager - .virtualMachines() - .define(vmName) - .withRegion(region) - .withNewResourceGroup(rgName) - .withNewPrimaryNetwork("10.0.0.0/28") - .withPrimaryPrivateIPAddressDynamic() - .withoutPrimaryPublicIPAddress() - .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) - .withRootUsername("Foo12") - .withSsh(sshPublicKey()) - .withUnmanagedDisks() - .withBootDiagnostics( - creatableStorageAccount) // This storage account should be used for BDiagnostics not OS disk storage - // account - .create(); - Assertions.assertNotNull(virtualMachine); - Assertions.assertTrue(virtualMachine.isBootDiagnosticsEnabled()); - Assertions.assertNotNull(virtualMachine.bootDiagnosticsStorageUri()); - Assertions.assertTrue(virtualMachine.bootDiagnosticsStorageUri().contains(storageName)); - // There should be a different storage account created for the OS Disk - Assertions - .assertFalse( - virtualMachine - .osUnmanagedDiskVhdUri() - .toLowerCase() - .startsWith(virtualMachine.bootDiagnosticsStorageUri().toLowerCase())); - } - - @Test - public void canEnableBootDiagnosticsOnManagedStorageAccount() { - VirtualMachine virtualMachine = - computeManager - .virtualMachines() - .define(vmName) - .withRegion(region) - .withNewResourceGroup(rgName) - .withNewPrimaryNetwork("10.0.0.0/28") - .withPrimaryPrivateIPAddressDynamic() - .withoutPrimaryPublicIPAddress() - .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) - .withRootUsername("jvuser") - .withSsh(sshPublicKey()) - .withBootDiagnosticsOnManagedStorageAccount() - .withSize(VirtualMachineSizeTypes.fromString("Standard_D2a_v4")) - .create(); - - Assertions.assertNotNull(virtualMachine); - Assertions.assertTrue(virtualMachine.isBootDiagnosticsEnabled()); - Assertions.assertNull(virtualMachine.bootDiagnosticsStorageUri()); - - virtualMachine = computeManager.virtualMachines().getById(virtualMachine.id()); - virtualMachine.update() - .withNewDataDisk(10) - .apply(); - - Assertions.assertTrue(virtualMachine.isBootDiagnosticsEnabled()); - Assertions.assertNull(virtualMachine.bootDiagnosticsStorageUri()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/VirtualMachineCustomImageOperationsTest.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/VirtualMachineCustomImageOperationsTest.java deleted file mode 100644 index e322af5a7575..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/VirtualMachineCustomImageOperationsTest.java +++ /dev/null @@ -1,383 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute; - -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.compute.models.CachingTypes; -import com.azure.resourcemanager.compute.models.Disk; -import com.azure.resourcemanager.compute.models.HyperVGenerationTypes; -import com.azure.resourcemanager.compute.models.ImageDataDisk; -import com.azure.resourcemanager.compute.models.KnownLinuxVirtualMachineImage; -import com.azure.resourcemanager.compute.models.OperatingSystemStateTypes; -import com.azure.resourcemanager.compute.models.OperatingSystemTypes; -import com.azure.resourcemanager.compute.models.VirtualMachine; -import com.azure.resourcemanager.compute.models.VirtualMachineCustomImage; -import com.azure.resourcemanager.compute.models.VirtualMachineDataDisk; -import com.azure.resourcemanager.compute.models.VirtualMachineSizeTypes; -import com.azure.resourcemanager.compute.models.VirtualMachineUnmanagedDataDisk; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import com.azure.resourcemanager.test.utils.TestUtilities; -import com.azure.core.management.Region; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.storage.models.StorageAccount; -import java.io.IOException; -import java.time.Duration; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public class VirtualMachineCustomImageOperationsTest extends ComputeManagementTest { - private String rgName = ""; - private Region region = locationOrDefault(Region.US_WEST); - - @Override - protected void initializeClients(HttpPipeline httpPipeline, AzureProfile profile) { - rgName = generateRandomResourceName("javacsmrg", 15); - super.initializeClients(httpPipeline, profile); - } - - @Override - protected void cleanUpResources() { - resourceManager.resourceGroups().beginDeleteByName(rgName); - } - - @Test - public void canCreateImageFromNativeVhd() throws IOException { - final String vhdBasedImageName = generateRandomResourceName("img", 20); - - VirtualMachine linuxVM = - prepareGeneralizedVmWith2EmptyDataDisks( - rgName, generateRandomResourceName("muldvm", 15), region, computeManager); - // - VirtualMachineCustomImage.DefinitionStages.WithCreateAndDataDiskImageOSDiskSettings creatableDisk = - computeManager - .virtualMachineCustomImages() - .define(vhdBasedImageName) - .withRegion(region) - .withNewResourceGroup(rgName) - .withLinuxFromVhd(linuxVM.osUnmanagedDiskVhdUri(), OperatingSystemStateTypes.GENERALIZED) - .withOSDiskCaching(linuxVM.osDiskCachingType()); - for (VirtualMachineUnmanagedDataDisk disk : linuxVM.unmanagedDataDisks().values()) { - creatableDisk - .defineDataDiskImage() - .withLun(disk.lun()) - .fromVhd(disk.vhdUri()) - .withDiskCaching(disk.cachingType()) - .withDiskSizeInGB(disk.size() + 10) // Resize each data disk image by +10GB - .attach(); - } - VirtualMachineCustomImage customImage = creatableDisk.create(); - Assertions.assertNotNull(customImage.id()); - Assertions.assertEquals(customImage.name(), vhdBasedImageName); - Assertions.assertFalse(customImage.isCreatedFromVirtualMachine()); - Assertions.assertNull(customImage.sourceVirtualMachineId()); - Assertions.assertNotNull(customImage.osDiskImage()); - Assertions.assertNotNull(customImage.osDiskImage().blobUri()); - Assertions.assertEquals(customImage.osDiskImage().caching(), CachingTypes.READ_WRITE); - Assertions.assertEquals(customImage.osDiskImage().osState(), OperatingSystemStateTypes.GENERALIZED); - Assertions.assertEquals(customImage.osDiskImage().osType(), OperatingSystemTypes.LINUX); - Assertions.assertNotNull(customImage.dataDiskImages()); - Assertions.assertEquals(customImage.dataDiskImages().size(), linuxVM.unmanagedDataDisks().size()); - Assertions.assertTrue(customImage.hyperVGeneration().equals(HyperVGenerationTypes.V1)); - for (ImageDataDisk diskImage : customImage.dataDiskImages().values()) { - VirtualMachineUnmanagedDataDisk matchedDisk = null; - for (VirtualMachineUnmanagedDataDisk vmDisk : linuxVM.unmanagedDataDisks().values()) { - if (vmDisk.lun() == diskImage.lun()) { - matchedDisk = vmDisk; - break; - } - } - Assertions.assertNotNull(matchedDisk); - Assertions.assertEquals(matchedDisk.cachingType(), diskImage.caching()); - Assertions.assertEquals(matchedDisk.vhdUri(), diskImage.blobUri()); - Assertions.assertEquals((long) matchedDisk.size() + 10, (long) diskImage.diskSizeGB()); - } - VirtualMachineCustomImage image = - computeManager.virtualMachineCustomImages().getByResourceGroup(rgName, vhdBasedImageName); - Assertions.assertNotNull(image); - PagedIterable images = - computeManager.virtualMachineCustomImages().listByResourceGroup(rgName); - Assertions.assertTrue(TestUtilities.getSize(images) > 0); - - // Create virtual machine from custom image - // - VirtualMachine virtualMachine = - computeManager - .virtualMachines() - .define(generateRandomResourceName("cusvm", 15)) - .withRegion(region) - .withNewResourceGroup(rgName) - .withNewPrimaryNetwork("10.0.0.0/28") - .withPrimaryPrivateIPAddressDynamic() - .withoutPrimaryPublicIPAddress() - .withGeneralizedLinuxCustomImage(image.id()) - .withRootUsername("javauser") - .withSsh(sshPublicKey()) - .withSize(VirtualMachineSizeTypes.fromString("Standard_D2a_v4")) - .withOSDiskCaching(CachingTypes.READ_WRITE) - .create(); - - Map dataDisks = virtualMachine.dataDisks(); - Assertions.assertNotNull(dataDisks); - Assertions.assertEquals(dataDisks.size(), image.dataDiskImages().size()); - - // Create a hyperv Gen2 image - VirtualMachineCustomImage.DefinitionStages.WithCreateAndDataDiskImageOSDiskSettings creatableDiskGen2 = - computeManager - .virtualMachineCustomImages() - .define(vhdBasedImageName + "Gen2") - .withRegion(region) - .withNewResourceGroup(rgName) - .withHyperVGeneration(HyperVGenerationTypes.V2) - .withLinuxFromVhd(linuxVM.osUnmanagedDiskVhdUri(), OperatingSystemStateTypes.GENERALIZED) - .withOSDiskCaching(linuxVM.osDiskCachingType()); - for (VirtualMachineUnmanagedDataDisk disk : linuxVM.unmanagedDataDisks().values()) { - creatableDisk - .defineDataDiskImage() - .withLun(disk.lun()) - .fromVhd(disk.vhdUri()) - .withDiskCaching(disk.cachingType()) - .withDiskSizeInGB(disk.size() + 10) // Resize each data disk image by +10GB - .attach(); - } - VirtualMachineCustomImage customImageGen2 = creatableDiskGen2.create(); - Assertions.assertNotNull(customImageGen2.id()); - Assertions.assertEquals(customImageGen2.name(), vhdBasedImageName + "Gen2"); - Assertions.assertFalse(customImageGen2.isCreatedFromVirtualMachine()); - Assertions.assertNull(customImageGen2.sourceVirtualMachineId()); - Assertions.assertNotNull(customImageGen2.osDiskImage()); - Assertions.assertNotNull(customImageGen2.osDiskImage().blobUri()); - Assertions.assertEquals(customImageGen2.osDiskImage().caching(), CachingTypes.READ_WRITE); - Assertions.assertEquals(customImageGen2.osDiskImage().osState(), OperatingSystemStateTypes.GENERALIZED); - Assertions.assertEquals(customImageGen2.osDiskImage().osType(), OperatingSystemTypes.LINUX); - Assertions.assertNotNull(customImageGen2.dataDiskImages()); - Assertions.assertEquals(customImageGen2.dataDiskImages().size(), 0); - Assertions.assertTrue(customImageGen2.hyperVGeneration().equals(HyperVGenerationTypes.V2)); - } - - @Test - public void canCreateImageByCapturingVM() { - final String vmName = generateRandomResourceName("vm67-", 20); - final String imageName = generateRandomResourceName("img", 15); - - VirtualMachine vm = prepareGeneralizedVmWith2EmptyDataDisks(rgName, vmName, region, computeManager); - // - VirtualMachineCustomImage customImage = - computeManager - .virtualMachineCustomImages() - .define(imageName) - .withRegion(region) - .withNewResourceGroup(rgName) - .withHyperVGeneration(HyperVGenerationTypes.V1) - .fromVirtualMachine(vm.id()) - .create(); - - Assertions.assertTrue(customImage.name().equalsIgnoreCase(imageName)); - Assertions.assertNotNull(customImage.osDiskImage()); - Assertions.assertEquals(customImage.osDiskImage().osState(), OperatingSystemStateTypes.GENERALIZED); - Assertions.assertEquals(customImage.osDiskImage().osType(), OperatingSystemTypes.LINUX); - Assertions.assertNotNull(customImage.dataDiskImages()); - Assertions.assertEquals(customImage.dataDiskImages().size(), 2); - Assertions.assertNotNull(customImage.sourceVirtualMachineId()); - Assertions.assertTrue(customImage.sourceVirtualMachineId().equalsIgnoreCase(vm.id())); - Assertions.assertTrue(customImage.hyperVGeneration().equals(HyperVGenerationTypes.V1)); - - for (VirtualMachineUnmanagedDataDisk vmDisk : vm.unmanagedDataDisks().values()) { - Assertions.assertTrue(customImage.dataDiskImages().containsKey(vmDisk.lun())); - ImageDataDisk diskImage = customImage.dataDiskImages().get(vmDisk.lun()); - Assertions.assertEquals(diskImage.caching(), vmDisk.cachingType()); - Assertions.assertEquals((long) diskImage.diskSizeGB(), vmDisk.size()); - Assertions.assertNotNull(diskImage.blobUri()); - diskImage.blobUri().equalsIgnoreCase(vmDisk.vhdUri()); - } - - customImage = computeManager.virtualMachineCustomImages().getByResourceGroup(rgName, imageName); - Assertions.assertNotNull(customImage); - Assertions.assertNotNull(customImage.innerModel()); - computeManager.virtualMachineCustomImages().deleteById(customImage.id()); - } - - @Test - public void canCreateImageFromManagedDisk() { - final String vmName = generateRandomResourceName("vm7-", 20); - final String storageAccountName = generateRandomResourceName("stg", 17); - final String uname = "juser"; - final String password = password(); - - VirtualMachine nativeVm = - computeManager - .virtualMachines() - .define(vmName) - .withRegion(region) - .withNewResourceGroup(rgName) - .withNewPrimaryNetwork("10.0.0.0/28") - .withPrimaryPrivateIPAddressDynamic() - .withoutPrimaryPublicIPAddress() - .withLatestLinuxImage("Canonical", "UbuntuServer", "14.04.2-LTS") - .withRootUsername(uname) - .withSsh(sshPublicKey()) - .withUnmanagedDisks() /* UN-MANAGED OS and DATA DISKS */ - .defineUnmanagedDataDisk("disk1") - .withNewVhd(100) - .withCaching(CachingTypes.READ_ONLY) - .attach() - .withNewUnmanagedDataDisk(100) - .withSize(VirtualMachineSizeTypes.fromString("Standard_D2a_v4")) - .withNewStorageAccount(storageAccountName) - .withOSDiskCaching(CachingTypes.READ_WRITE) - .create(); - - Assertions.assertFalse(nativeVm.isManagedDiskEnabled()); - String osVhdUri = nativeVm.osUnmanagedDiskVhdUri(); - Assertions.assertNotNull(osVhdUri); - Map dataDisks = nativeVm.unmanagedDataDisks(); - Assertions.assertEquals(dataDisks.size(), 2); - - computeManager.virtualMachines().deleteById(nativeVm.id()); - - final String osDiskName = generateRandomResourceName("dsk", 15); - // Create managed disk with Os from vm's Os disk - // - Disk managedOsDisk = - computeManager - .disks() - .define(osDiskName) - .withRegion(region) - .withNewResourceGroup(rgName) - .withLinuxFromVhd(osVhdUri) - .withStorageAccountName(storageAccountName) - .create(); - - // Create managed disk with Data from vm's lun0 data disk - // - StorageAccount storageAccount = - storageManager.storageAccounts().getByResourceGroup(rgName, storageAccountName); - - final String dataDiskName1 = generateRandomResourceName("dsk", 15); - VirtualMachineUnmanagedDataDisk vmNativeDataDisk1 = dataDisks.get(0); - Disk managedDataDisk1 = - computeManager - .disks() - .define(dataDiskName1) - .withRegion(region) - .withNewResourceGroup(rgName) - .withData() - .fromVhd(vmNativeDataDisk1.vhdUri()) - .withStorageAccount(storageAccount) - .create(); - - // Create managed disk with Data from vm's lun1 data disk - // - final String dataDiskName2 = generateRandomResourceName("dsk", 15); - VirtualMachineUnmanagedDataDisk vmNativeDataDisk2 = dataDisks.get(1); - Disk managedDataDisk2 = - computeManager - .disks() - .define(dataDiskName2) - .withRegion(region) - .withNewResourceGroup(rgName) - .withData() - .fromVhd(vmNativeDataDisk2.vhdUri()) - .withStorageAccountId(storageAccount.id()) - .create(); - - // Create an image from the above managed disks - // Note that this is not a direct user scenario, but including this as per CRP team request - // - final String imageName = generateRandomResourceName("img", 15); - VirtualMachineCustomImage customImage = - computeManager - .virtualMachineCustomImages() - .define(imageName) - .withRegion(region) - .withNewResourceGroup(rgName) - .withLinuxFromDisk(managedOsDisk, OperatingSystemStateTypes.GENERALIZED) - .defineDataDiskImage() - .withLun(vmNativeDataDisk1.lun()) - .fromManagedDisk(managedDataDisk1) - .withDiskCaching(vmNativeDataDisk1.cachingType()) - .withDiskSizeInGB(vmNativeDataDisk1.size() + 10) - .attach() - .defineDataDiskImage() - .withLun(vmNativeDataDisk2.lun()) - .fromManagedDisk(managedDataDisk2) - .withDiskSizeInGB(vmNativeDataDisk2.size() + 10) - .attach() - .create(); - - Assertions.assertNotNull(customImage); - Assertions.assertTrue(customImage.name().equalsIgnoreCase(imageName)); - Assertions.assertNotNull(customImage.osDiskImage()); - Assertions.assertEquals(customImage.osDiskImage().osState(), OperatingSystemStateTypes.GENERALIZED); - Assertions.assertEquals(customImage.osDiskImage().osType(), OperatingSystemTypes.LINUX); - Assertions.assertNotNull(customImage.dataDiskImages()); - Assertions.assertEquals(customImage.dataDiskImages().size(), 2); - Assertions.assertTrue(customImage.hyperVGeneration().equals(HyperVGenerationTypes.V1)); - Assertions.assertNull(customImage.sourceVirtualMachineId()); - - Assertions.assertTrue(customImage.dataDiskImages().containsKey(vmNativeDataDisk1.lun())); - Assertions - .assertEquals( - customImage.dataDiskImages().get(vmNativeDataDisk1.lun()).caching(), vmNativeDataDisk1.cachingType()); - Assertions.assertTrue(customImage.dataDiskImages().containsKey(vmNativeDataDisk2.lun())); - Assertions.assertEquals(customImage.dataDiskImages().get(vmNativeDataDisk2.lun()).caching(), CachingTypes.NONE); - - for (VirtualMachineUnmanagedDataDisk vmDisk : dataDisks.values()) { - Assertions.assertTrue(customImage.dataDiskImages().containsKey(vmDisk.lun())); - ImageDataDisk diskImage = customImage.dataDiskImages().get(vmDisk.lun()); - Assertions.assertEquals((long) diskImage.diskSizeGB(), vmDisk.size() + 10); - Assertions.assertNull(diskImage.blobUri()); - Assertions.assertNotNull(diskImage.managedDisk()); - Assertions - .assertTrue( - diskImage.managedDisk().id().equalsIgnoreCase(managedDataDisk1.id()) - || diskImage.managedDisk().id().equalsIgnoreCase(managedDataDisk2.id())); - } - computeManager.disks().deleteById(managedOsDisk.id()); - computeManager.disks().deleteById(managedDataDisk1.id()); - computeManager.disks().deleteById(managedDataDisk2.id()); - computeManager.virtualMachineCustomImages().deleteById(customImage.id()); - } - - private VirtualMachine prepareGeneralizedVmWith2EmptyDataDisks( - String rgName, String vmName, Region region, ComputeManager computeManager) { - final String uname = "javauser"; - final String password = password(); - final KnownLinuxVirtualMachineImage linuxImage = KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS; - final String publicIpDnsLabel = generateRandomResourceName("pip", 20); - - VirtualMachine virtualMachine = - computeManager - .virtualMachines() - .define(vmName) - .withRegion(region) - .withNewResourceGroup(rgName) - .withNewPrimaryNetwork("10.0.0.0/28") - .withPrimaryPrivateIPAddressDynamic() - .withNewPrimaryPublicIPAddress(publicIpDnsLabel) - .withPopularLinuxImage(linuxImage) - .withRootUsername(uname) - .withSsh(sshPublicKey()) - .withUnmanagedDisks() - .defineUnmanagedDataDisk("disk-1") - .withNewVhd(30) - .withCaching(CachingTypes.READ_WRITE) - .attach() - .defineUnmanagedDataDisk("disk-2") - .withNewVhd(60) - .withCaching(CachingTypes.READ_ONLY) - .attach() - .withSize(VirtualMachineSizeTypes.fromString("Standard_D2a_v4")) - .withNewStorageAccount(generateRandomResourceName("stg", 17)) - .withOSDiskCaching(CachingTypes.READ_WRITE) - .create(); - // - ResourceManagerUtils.sleep(Duration.ofMinutes(1)); - deprovisionAgentInLinuxVM(virtualMachine); - virtualMachine.deallocate(); - virtualMachine.generalize(); - return virtualMachine; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/VirtualMachineEMSILMSIOperationsTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/VirtualMachineEMSILMSIOperationsTests.java deleted file mode 100644 index fbee1f1c43a7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/VirtualMachineEMSILMSIOperationsTests.java +++ /dev/null @@ -1,521 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.compute.models.KnownLinuxVirtualMachineImage; -import com.azure.resourcemanager.compute.models.ResourceIdentityType; -import com.azure.resourcemanager.compute.models.VirtualMachine; -import com.azure.resourcemanager.authorization.models.BuiltInRole; -import com.azure.resourcemanager.authorization.models.RoleAssignment; -import com.azure.resourcemanager.msi.models.Identity; -import com.azure.resourcemanager.network.models.Network; -import com.azure.resourcemanager.resources.models.ResourceGroup; -import com.azure.core.management.Region; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import java.util.Iterator; -import java.util.Set; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public class VirtualMachineEMSILMSIOperationsTests extends ComputeManagementTest { - private String rgName = ""; - private Region region = locationOrDefault(Region.fromName("East US 2")); - private final String vmName = "javavm"; - - @Override - protected void cleanUpResources() { - this.resourceManager.resourceGroups().beginDeleteByName(rgName); - } - - @Test - public void canCreateUpdateVirtualMachineWithEMSI() { - // this.resourceManager.resourceGroups().beginDeleteByName("41522c6e938c4f6"); - - rgName = generateRandomResourceName("java-emsi-c-rg", 15); - String identityName1 = generateRandomResourceName("msi-id", 15); - String identityName2 = generateRandomResourceName("msi-id", 15); - String networkName = generateRandomResourceName("nw", 10); - - // Prepare a definition for yet-to-be-created resource group - // - Creatable creatableRG = resourceManager.resourceGroups().define(rgName).withRegion(region); - - // Create a virtual network residing in the above RG - // - final Network network = - networkManager.networks().define(networkName).withRegion(region).withNewResourceGroup(creatableRG).create(); - - // Create an "User Assigned (External) MSI" residing in the above RG and assign reader access to the virtual - // network - // - final Identity createdIdentity = - msiManager - .identities() - .define(identityName1) - .withRegion(region) - .withNewResourceGroup(creatableRG) - .withAccessTo(network, BuiltInRole.READER) - .create(); - - // Prepare a definition for yet-to-be-created "User Assigned (External) MSI" with contributor access to the - // resource group - // it resides - // - Creatable creatableIdentity = - msiManager - .identities() - .define(identityName2) - .withRegion(region) - .withNewResourceGroup(creatableRG) - .withAccessToCurrentResourceGroup(BuiltInRole.CONTRIBUTOR); - - // Create a virtual machine and associate it with existing and yet-t-be-created identities - // - VirtualMachine virtualMachine = - computeManager - .virtualMachines() - .define(vmName) - .withRegion(region) - .withNewResourceGroup(rgName) - .withNewPrimaryNetwork("10.0.0.0/28") - .withPrimaryPrivateIPAddressDynamic() - .withoutPrimaryPublicIPAddress() - .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) - .withRootUsername("Foo12") - .withSsh(sshPublicKey()) - .withExistingUserAssignedManagedServiceIdentity(createdIdentity) - .withNewUserAssignedManagedServiceIdentity(creatableIdentity) - .create(); - - Assertions.assertNotNull(virtualMachine); - Assertions.assertNotNull(virtualMachine.innerModel()); - Assertions.assertTrue(virtualMachine.isManagedServiceIdentityEnabled()); - Assertions.assertNull(virtualMachine.systemAssignedManagedServiceIdentityPrincipalId()); // No Local MSI enabled - Assertions.assertNull(virtualMachine.systemAssignedManagedServiceIdentityTenantId()); // No Local MSI enabled - - // Ensure the "User Assigned (External) MSI" id can be retrieved from the virtual machine - // - Set emsiIds = virtualMachine.userAssignedManagedServiceIdentityIds(); - Assertions.assertNotNull(emsiIds); - Assertions.assertEquals(2, emsiIds.size()); - - // Ensure the "User Assigned (External) MSI"s matches with the those provided as part of VM create - // - Identity implicitlyCreatedIdentity = null; - for (String emsiId : emsiIds) { - Identity identity = msiManager.identities().getById(emsiId); - Assertions.assertNotNull(identity); - Assertions - .assertTrue( - identity.name().equalsIgnoreCase(identityName1) || identity.name().equalsIgnoreCase(identityName2)); - Assertions.assertNotNull(identity.principalId()); - - if (identity.name().equalsIgnoreCase(identityName2)) { - implicitlyCreatedIdentity = identity; - } - } - Assertions.assertNotNull(implicitlyCreatedIdentity); - - // Ensure expected role assignment exists for explicitly created EMSI - // - PagedIterable roleAssignmentsForNetwork = - this.msiManager.authorizationManager().roleAssignments().listByScope(network.id()); - boolean found = false; - for (RoleAssignment roleAssignment : roleAssignmentsForNetwork) { - if (roleAssignment.principalId() != null - && roleAssignment.principalId().equalsIgnoreCase(createdIdentity.principalId())) { - found = true; - break; - } - } - Assertions - .assertTrue( - found, - "Expected role assignment not found for the virtual network for identity" + createdIdentity.name()); - - RoleAssignment assignment = - lookupRoleAssignmentUsingScopeAndRoleAsync(network.id(), BuiltInRole.READER, createdIdentity.principalId()) - .block(); - - Assertions - .assertNotNull( - assignment, "Expected role assignment with ROLE not found for the virtual network for identity"); - - // Ensure expected role assignment exists for explicitly created EMSI - // - ResourceGroup resourceGroup = resourceManager.resourceGroups().getByName(virtualMachine.resourceGroupName()); - Assertions.assertNotNull(resourceGroup); - - PagedIterable roleAssignmentsForResourceGroup = - this.msiManager.authorizationManager().roleAssignments().listByScope(resourceGroup.id()); - found = false; - for (RoleAssignment roleAssignment : roleAssignmentsForResourceGroup) { - if (roleAssignment.principalId() != null - && roleAssignment.principalId().equalsIgnoreCase(implicitlyCreatedIdentity.principalId())) { - found = true; - break; - } - } - Assertions - .assertTrue( - found, - "Expected role assignment not found for the resource group for identity" - + implicitlyCreatedIdentity.name()); - - assignment = - lookupRoleAssignmentUsingScopeAndRoleAsync( - resourceGroup.id(), BuiltInRole.CONTRIBUTOR, implicitlyCreatedIdentity.principalId()) - .block(); - - Assertions - .assertNotNull( - assignment, "Expected role assignment with ROLE not found for the resource group for identity"); - - emsiIds = virtualMachine.userAssignedManagedServiceIdentityIds(); - Iterator itr = emsiIds.iterator(); - // Remove both (all) identities - virtualMachine - .update() - .withoutUserAssignedManagedServiceIdentity(itr.next()) - .withoutUserAssignedManagedServiceIdentity(itr.next()) - .apply(); - // - Assertions.assertEquals(0, virtualMachine.userAssignedManagedServiceIdentityIds().size()); - if (virtualMachine.managedServiceIdentityType() != null) { - Assertions.assertTrue(virtualMachine.managedServiceIdentityType().equals(ResourceIdentityType.NONE)); - } - // fetch vm again and validate - virtualMachine.refresh(); - // - Assertions.assertEquals(0, virtualMachine.userAssignedManagedServiceIdentityIds().size()); - if (virtualMachine.managedServiceIdentityType() != null) { - Assertions.assertTrue(virtualMachine.managedServiceIdentityType().equals(ResourceIdentityType.NONE)); - } - // - itr = emsiIds.iterator(); - Identity identity1 = msiManager.identities().getById(itr.next()); - Identity identity2 = msiManager.identities().getById(itr.next()); - // - // Update VM by enabling System-MSI and add two identities - virtualMachine - .update() - .withSystemAssignedManagedServiceIdentity() - .withExistingUserAssignedManagedServiceIdentity(identity1) - .withExistingUserAssignedManagedServiceIdentity(identity2) - .apply(); - - Assertions.assertNotNull(virtualMachine.userAssignedManagedServiceIdentityIds()); - Assertions.assertEquals(2, virtualMachine.userAssignedManagedServiceIdentityIds().size()); - Assertions.assertNotNull(virtualMachine.managedServiceIdentityType()); - Assertions - .assertTrue( - virtualMachine.managedServiceIdentityType().equals(ResourceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED)); - // - Assertions.assertNotNull(virtualMachine.systemAssignedManagedServiceIdentityPrincipalId()); - Assertions.assertNotNull(virtualMachine.systemAssignedManagedServiceIdentityTenantId()); - // - virtualMachine.refresh(); - Assertions.assertNotNull(virtualMachine.userAssignedManagedServiceIdentityIds()); - Assertions.assertEquals(2, virtualMachine.userAssignedManagedServiceIdentityIds().size()); - Assertions.assertNotNull(virtualMachine.managedServiceIdentityType()); - Assertions - .assertTrue( - virtualMachine.managedServiceIdentityType().equals(ResourceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED)); - // - Assertions.assertNotNull(virtualMachine.systemAssignedManagedServiceIdentityPrincipalId()); - Assertions.assertNotNull(virtualMachine.systemAssignedManagedServiceIdentityTenantId()); - // - itr = emsiIds.iterator(); - // Remove identities one by one (first one) - virtualMachine.update().withoutUserAssignedManagedServiceIdentity(itr.next()).apply(); - // - Assertions.assertNotNull(virtualMachine.userAssignedManagedServiceIdentityIds()); - Assertions.assertEquals(1, virtualMachine.userAssignedManagedServiceIdentityIds().size()); - Assertions.assertNotNull(virtualMachine.managedServiceIdentityType()); - Assertions - .assertTrue( - virtualMachine.managedServiceIdentityType().equals(ResourceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED)); - Assertions.assertNotNull(virtualMachine.systemAssignedManagedServiceIdentityPrincipalId()); - Assertions.assertNotNull(virtualMachine.systemAssignedManagedServiceIdentityTenantId()); - // Remove identities one by one (second one) - virtualMachine.update().withoutUserAssignedManagedServiceIdentity(itr.next()).apply(); - // - Assertions.assertEquals(0, virtualMachine.userAssignedManagedServiceIdentityIds().size()); - Assertions.assertNotNull(virtualMachine.managedServiceIdentityType()); - Assertions.assertTrue(virtualMachine.managedServiceIdentityType().equals(ResourceIdentityType.SYSTEM_ASSIGNED)); - // - } - - @Test - public void canCreateVirtualMachineWithLMSIAndEMSI() { - rgName = generateRandomResourceName("java-emsi-c-rg", 15); - String identityName1 = generateRandomResourceName("msi-id", 15); - String networkName = generateRandomResourceName("nw", 10); - - // Create a resource group - // - ResourceGroup resourceGroup = resourceManager.resourceGroups().define(rgName).withRegion(region).create(); - - // Create a virtual network - // - Network network = - networkManager - .networks() - .define(networkName) - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .create(); - - // Prepare a definition for yet-to-be-created "User Assigned (External) MSI" with contributor access to the - // resource group - // it resides - // - Creatable creatableIdentity = - msiManager - .identities() - .define(identityName1) - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .withAccessToCurrentResourceGroup(BuiltInRole.CONTRIBUTOR); - - // Create a virtual machine and associate it with existing and yet-to-be-created identities - // - VirtualMachine virtualMachine = - computeManager - .virtualMachines() - .define(vmName) - .withRegion(region) - .withNewResourceGroup(rgName) - .withNewPrimaryNetwork("10.0.0.0/28") - .withPrimaryPrivateIPAddressDynamic() - .withoutPrimaryPublicIPAddress() - .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) - .withRootUsername("Foo12") - .withSsh(sshPublicKey()) - .withSystemAssignedManagedServiceIdentity() - .withSystemAssignedIdentityBasedAccessTo(network.id(), BuiltInRole.CONTRIBUTOR) - .withNewUserAssignedManagedServiceIdentity(creatableIdentity) - .create(); - - Assertions.assertNotNull(virtualMachine); - Assertions.assertNotNull(virtualMachine.innerModel()); - Assertions.assertTrue(virtualMachine.isManagedServiceIdentityEnabled()); - Assertions.assertNotNull(virtualMachine.systemAssignedManagedServiceIdentityPrincipalId()); - Assertions.assertNotNull(virtualMachine.systemAssignedManagedServiceIdentityTenantId()); - - // Ensure the "User Assigned (External) MSI" id can be retrieved from the virtual machine - // - Set emsiIds = virtualMachine.userAssignedManagedServiceIdentityIds(); - Assertions.assertNotNull(emsiIds); - Assertions.assertEquals(1, emsiIds.size()); - - Identity identity = msiManager.identities().getById(emsiIds.iterator().next()); - Assertions.assertNotNull(identity); - Assertions.assertTrue(identity.name().equalsIgnoreCase(identityName1)); - - // Ensure expected role assignment exists for LMSI - // - PagedIterable roleAssignmentsForNetwork = - this.msiManager.authorizationManager().roleAssignments().listByScope(network.id()); - - boolean found = false; - for (RoleAssignment roleAssignment : roleAssignmentsForNetwork) { - if (roleAssignment.principalId() != null - && roleAssignment - .principalId() - .equalsIgnoreCase(virtualMachine.systemAssignedManagedServiceIdentityPrincipalId())) { - found = true; - break; - } - } - Assertions - .assertTrue( - found, - "Expected role assignment not found for the virtual network for local identity" - + virtualMachine.systemAssignedManagedServiceIdentityPrincipalId()); - - RoleAssignment assignment = - lookupRoleAssignmentUsingScopeAndRoleAsync( - network.id(), - BuiltInRole.CONTRIBUTOR, - virtualMachine.systemAssignedManagedServiceIdentityPrincipalId()) - .block(); - - Assertions - .assertNotNull( - assignment, - "Expected role assignment with ROLE not found for the virtual network for system assigned identity"); - - // Ensure expected role assignment exists for EMSI - // - ResourceGroup resourceGroup1 = resourceManager.resourceGroups().getByName(virtualMachine.resourceGroupName()); - - PagedIterable roleAssignmentsForResourceGroup = - this.msiManager.authorizationManager().roleAssignments().listByScope(resourceGroup1.id()); - found = false; - for (RoleAssignment roleAssignment : roleAssignmentsForResourceGroup) { - if (roleAssignment.principalId() != null - && roleAssignment.principalId().equalsIgnoreCase(identity.principalId())) { - found = true; - break; - } - } - Assertions - .assertTrue( - found, "Expected role assignment not found for the resource group for identity" + identity.name()); - - assignment = - lookupRoleAssignmentUsingScopeAndRoleAsync( - resourceGroup1.id(), BuiltInRole.CONTRIBUTOR, identity.principalId()) - .block(); - - Assertions - .assertNotNull( - assignment, - "Expected role assignment with ROLE not found for the resource group for system assigned identity"); - } - - @Test - public void canUpdateVirtualMachineWithEMSIAndLMSI() throws Exception { - rgName = generateRandomResourceName("java-emsi-c-rg", 15); - String identityName1 = generateRandomResourceName("msi-id-1", 15); - String identityName2 = generateRandomResourceName("msi-id-2", 15); - - // Create a virtual machine with no EMSI & LMSI - // - VirtualMachine virtualMachine = - computeManager - .virtualMachines() - .define(vmName) - .withRegion(region) - .withNewResourceGroup(rgName) - .withNewPrimaryNetwork("10.0.0.0/28") - .withPrimaryPrivateIPAddressDynamic() - .withoutPrimaryPublicIPAddress() - .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) - .withRootUsername("Foo12") - .withSsh(sshPublicKey()) - .create(); - - // Prepare a definition for yet-to-be-created "User Assigned (External) MSI" with contributor access to the - // resource group - // it resides - // - Creatable creatableIdentity = - msiManager - .identities() - .define(identityName1) - .withRegion(region) - .withExistingResourceGroup(virtualMachine.resourceGroupName()) - .withAccessToCurrentResourceGroup(BuiltInRole.CONTRIBUTOR); - - // Update virtual machine so that it depends on the EMSI - // - virtualMachine = virtualMachine.update().withNewUserAssignedManagedServiceIdentity(creatableIdentity).apply(); - - // Ensure the "User Assigned (External) MSI" id can be retrieved from the virtual machine - // - Set emsiIds = virtualMachine.userAssignedManagedServiceIdentityIds(); - Assertions.assertNotNull(emsiIds); - Assertions.assertEquals(1, emsiIds.size()); - - Identity identity = msiManager.identities().getById(emsiIds.iterator().next()); - Assertions.assertNotNull(identity); - Assertions.assertTrue(identity.name().equalsIgnoreCase(identityName1)); - - // Update VM without modify MSI - virtualMachine.update() - .withNewDataDisk(10) - .apply(); - emsiIds = virtualMachine.userAssignedManagedServiceIdentityIds(); - Assertions.assertNotNull(emsiIds); - Assertions.assertEquals(1, emsiIds.size()); - - // Creates an EMSI - // - Identity createdIdentity = - msiManager - .identities() - .define(identityName2) - .withRegion(region) - .withExistingResourceGroup(virtualMachine.resourceGroupName()) - .withAccessToCurrentResourceGroup(BuiltInRole.CONTRIBUTOR) - .create(); - - // Update the virtual machine by removing the an EMSI and adding existing EMSI - // - virtualMachine = - virtualMachine - .update() - .withoutUserAssignedManagedServiceIdentity(identity.id()) - .withExistingUserAssignedManagedServiceIdentity(createdIdentity) - .apply(); - - // Ensure the "User Assigned (External) MSI" id can be retrieved from the virtual machine - // - emsiIds = virtualMachine.userAssignedManagedServiceIdentityIds(); - Assertions.assertNotNull(emsiIds); - Assertions.assertEquals(1, emsiIds.size()); - - identity = msiManager.identities().getById(emsiIds.iterator().next()); - Assertions.assertNotNull(identity); - Assertions.assertTrue(identity.name().equalsIgnoreCase(identityName2)); - - // Update the virtual machine by enabling "LMSI" - - virtualMachine.update().withSystemAssignedManagedServiceIdentity().apply(); - // - Assertions.assertNotNull(virtualMachine); - Assertions.assertNotNull(virtualMachine.innerModel()); - Assertions.assertTrue(virtualMachine.isManagedServiceIdentityEnabled()); - Assertions.assertNotNull(virtualMachine.managedServiceIdentityType()); - Assertions - .assertTrue( - virtualMachine.managedServiceIdentityType().equals(ResourceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED)); - Assertions.assertNotNull(virtualMachine.systemAssignedManagedServiceIdentityPrincipalId()); - Assertions.assertNotNull(virtualMachine.systemAssignedManagedServiceIdentityTenantId()); - Assertions.assertEquals(1, virtualMachine.userAssignedManagedServiceIdentityIds().size()); - // - virtualMachine.update().withoutSystemAssignedManagedServiceIdentity().apply(); - - Assertions.assertTrue(virtualMachine.isManagedServiceIdentityEnabled()); - Assertions.assertNotNull(virtualMachine.managedServiceIdentityType()); - Assertions.assertTrue(virtualMachine.managedServiceIdentityType().equals(ResourceIdentityType.USER_ASSIGNED)); - Assertions.assertNull(virtualMachine.systemAssignedManagedServiceIdentityPrincipalId()); - Assertions.assertNull(virtualMachine.systemAssignedManagedServiceIdentityTenantId()); - Assertions.assertEquals(1, virtualMachine.userAssignedManagedServiceIdentityIds().size()); - // - virtualMachine.update().withoutUserAssignedManagedServiceIdentity(identity.id()).apply(); - Assertions.assertFalse(virtualMachine.isManagedServiceIdentityEnabled()); - if (virtualMachine.managedServiceIdentityType() != null) { - Assertions.assertTrue(virtualMachine.managedServiceIdentityType().equals(ResourceIdentityType.NONE)); - } - Assertions.assertNull(virtualMachine.systemAssignedManagedServiceIdentityPrincipalId()); - Assertions.assertNull(virtualMachine.systemAssignedManagedServiceIdentityTenantId()); - Assertions.assertEquals(0, virtualMachine.userAssignedManagedServiceIdentityIds().size()); - } - - private Mono lookupRoleAssignmentUsingScopeAndRoleAsync( - final String scope, BuiltInRole role, final String principalId) { - return this - .msiManager - .authorizationManager() - .roleDefinitions() - .getByScopeAndRoleNameAsync(scope, role.toString()) - .flatMap( - roleDefinition -> - msiManager - .authorizationManager() - .roleAssignments() - .listByScopeAsync(scope) - .filter( - roleAssignment -> - roleAssignment.roleDefinitionId().equalsIgnoreCase(roleDefinition.id()) - && roleAssignment.principalId().equalsIgnoreCase(principalId)) - .singleOrEmpty()) - .switchIfEmpty(Mono.defer(() -> Mono.empty())); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/VirtualMachineEncryptionOperationsTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/VirtualMachineEncryptionOperationsTests.java deleted file mode 100644 index 5ac6c74b0bcf..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/VirtualMachineEncryptionOperationsTests.java +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute; - -import com.azure.core.http.HttpPipeline; -import com.azure.resourcemanager.compute.models.CachingTypes; -import com.azure.resourcemanager.compute.models.DiskVolumeEncryptionMonitor; -import com.azure.resourcemanager.compute.models.EncryptionStatus; -import com.azure.resourcemanager.compute.models.KnownLinuxVirtualMachineImage; -import com.azure.resourcemanager.compute.models.LinuxVMDiskEncryptionConfiguration; -import com.azure.resourcemanager.compute.models.VirtualMachine; -import com.azure.resourcemanager.compute.models.VirtualMachineSizeTypes; -import com.azure.core.management.Region; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.keyvault.models.Vault; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public class VirtualMachineEncryptionOperationsTests extends ComputeManagementTest { - private String rgName = ""; - private final Region region = locationOrDefault(Region.US_EAST); - - @Override - protected void initializeClients(HttpPipeline httpPipeline, AzureProfile profile) { - rgName = generateRandomResourceName("vmencryptst", 18); - super.initializeClients(httpPipeline, profile); - } - - @Override - protected void cleanUpResources() { - resourceManager.resourceGroups().beginDeleteByName(rgName); - } - - @Test - @Disabled("Requires manually creating service principal and setting SP credentials in the test") - public void canEncryptVirtualMachineLegacy() { - // https://docs.microsoft.com/azure/virtual-machines/linux/disk-encryption-overview - // - // KeyVault Resource ID - String keyVaultId = "KEY_VAULT_ID_HERE"; - // Azure AD service principal client (application) ID - String aadClientId = "AAD_APPLICATION_ID_HERE"; - // Azure AD service principal client secret - String aadSecret = "AAD_CLIENT_SECRET_HERE"; - - final String vmName1 = "myvm1"; - final String uname = "juser"; - VirtualMachine virtualMachine = - computeManager - .virtualMachines() - .define(vmName1) - .withRegion(region) - .withNewResourceGroup(rgName) - .withNewPrimaryNetwork("10.0.0.0/28") - .withPrimaryPrivateIPAddressDynamic() - .withoutPrimaryPublicIPAddress() - .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_18_04_LTS) - .withRootUsername(uname) - .withSsh(sshPublicKey()) - .withSize(VirtualMachineSizeTypes.fromString("Standard_D2a_v4")) - .withOSDiskCaching(CachingTypes.READ_WRITE) - .create(); - - DiskVolumeEncryptionMonitor monitor1 = virtualMachine.diskEncryption().getMonitor(); - Assertions.assertNotNull(monitor1); - Assertions.assertNotNull(monitor1.osDiskStatus()); - Assertions.assertNotNull(monitor1.dataDiskStatus()); - Assertions.assertEquals(EncryptionStatus.NOT_ENCRYPTED, monitor1.osDiskStatus()); - Assertions.assertEquals(EncryptionStatus.NOT_ENCRYPTED, monitor1.dataDiskStatus()); - DiskVolumeEncryptionMonitor monitor2 = - virtualMachine.diskEncryption().enable(keyVaultId, aadClientId, aadSecret); - Assertions.assertNotNull(monitor2); - Assertions.assertNotNull(monitor2.osDiskStatus()); - Assertions.assertNotNull(monitor2.dataDiskStatus()); - monitor1.refresh(); - Assertions.assertEquals(monitor1.osDiskStatus(), monitor2.osDiskStatus()); - Assertions.assertEquals(monitor1.dataDiskStatus(), monitor2.dataDiskStatus()); - monitor2.refresh(); - Assertions.assertNotEquals(EncryptionStatus.NOT_ENCRYPTED, monitor2.osDiskStatus()); - } - - - @Test - public void canEncryptVirtualMachine() { - // https://docs.microsoft.com/azure/virtual-machines/linux/disk-encryption-overview - - final String vmName1 = "myvm1"; - final String uname = "juser"; - VirtualMachine virtualMachine = computeManager.virtualMachines() - .define(vmName1) - .withRegion(region) - .withNewResourceGroup(rgName) - .withNewPrimaryNetwork("10.0.0.0/28") - .withPrimaryPrivateIPAddressDynamic() - .withoutPrimaryPublicIPAddress() - .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_18_04_LTS) - .withRootUsername(uname) - .withSsh(sshPublicKey()) - .withSize(VirtualMachineSizeTypes.fromString("Standard_D2a_v4")) // ADE need 8GB - .withOSDiskCaching(CachingTypes.READ_WRITE) - .create(); - - final String vaultName = generateRandomResourceName("vault", 20); - Vault vault = keyVaultManager.vaults().define(vaultName) - .withRegion(region) - .withExistingResourceGroup(rgName) - .withEmptyAccessPolicy() - .withDiskEncryptionEnabled() - .create(); - final String vaultId = vault.id(); - final String vaultUri = vault.vaultUri(); - - DiskVolumeEncryptionMonitor monitor1 = virtualMachine.diskEncryption().getMonitor(); - Assertions.assertNotNull(monitor1); - Assertions.assertNotNull(monitor1.osDiskStatus()); - Assertions.assertNotNull(monitor1.dataDiskStatus()); - Assertions.assertEquals(EncryptionStatus.NOT_ENCRYPTED, monitor1.osDiskStatus()); - Assertions.assertEquals(EncryptionStatus.NOT_ENCRYPTED, monitor1.dataDiskStatus()); - DiskVolumeEncryptionMonitor monitor2 = virtualMachine - .diskEncryption() - .enable(new LinuxVMDiskEncryptionConfiguration(vaultId, vaultUri)); - Assertions.assertNotNull(monitor2); - Assertions.assertNotNull(monitor2.osDiskStatus()); - Assertions.assertNotNull(monitor2.dataDiskStatus()); - monitor1.refresh(); - Assertions.assertEquals(monitor1.osDiskStatus(), monitor2.osDiskStatus()); - Assertions.assertEquals(monitor1.dataDiskStatus(), monitor2.dataDiskStatus()); - monitor2.refresh(); - Assertions.assertNotEquals(EncryptionStatus.NOT_ENCRYPTED, monitor2.osDiskStatus()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/VirtualMachineExtensionImageOperationsTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/VirtualMachineExtensionImageOperationsTests.java deleted file mode 100644 index fdd38ed81aee..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/VirtualMachineExtensionImageOperationsTests.java +++ /dev/null @@ -1,125 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.compute.models.OperatingSystemTypes; -import com.azure.resourcemanager.compute.models.VirtualMachineExtensionImage; -import com.azure.resourcemanager.compute.models.VirtualMachineExtensionImageType; -import com.azure.resourcemanager.compute.models.VirtualMachineExtensionImageTypes; -import com.azure.resourcemanager.compute.models.VirtualMachineExtensionImageVersion; -import com.azure.resourcemanager.compute.models.VirtualMachineExtensionImageVersions; -import com.azure.resourcemanager.compute.models.VirtualMachinePublisher; -import com.azure.resourcemanager.test.utils.TestUtilities; -import com.azure.core.management.Region; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public class VirtualMachineExtensionImageOperationsTests extends ComputeManagementTest { - @Test - public void canListExtensionImages() throws Exception { - final int maxListing = 20; - int count = 0; - PagedIterable extensionImages = - computeManager.virtualMachineExtensionImages().listByRegion(locationOrDefault(Region.US_EAST)); - // Lazy listing - for (VirtualMachineExtensionImage extensionImage : extensionImages) { - Assertions.assertNotNull(extensionImage); - count++; - if (count >= maxListing) { - break; - } - } - Assertions.assertTrue(count == maxListing); - } - - @Test - public void canGetExtensionTypeVersionAndImage() throws Exception { - PagedIterable extensionImages = - computeManager.virtualMachineExtensionImages().listByRegion(locationOrDefault(Region.US_EAST)); - - final String dockerExtensionPublisherName = "Microsoft.Azure.Extensions"; - final String dockerExtensionImageTypeName = "DockerExtension"; - - // Lookup Azure docker extension publisher - // - PagedIterable publishers = - computeManager.virtualMachineExtensionImages().publishers().listByRegion(locationOrDefault(Region.US_EAST)); - - VirtualMachinePublisher azureDockerExtensionPublisher = null; - for (VirtualMachinePublisher publisher : publishers) { - if (publisher.name().equalsIgnoreCase(dockerExtensionPublisherName)) { - azureDockerExtensionPublisher = publisher; - break; - } - } - Assertions.assertNotNull(azureDockerExtensionPublisher); - - // Lookup Azure docker extension type - // - VirtualMachineExtensionImageTypes extensionImageTypes = azureDockerExtensionPublisher.extensionTypes(); - Assertions.assertTrue(TestUtilities.getSize(extensionImageTypes.list()) > 0); - - VirtualMachineExtensionImageType dockerExtensionImageType = null; - for (VirtualMachineExtensionImageType extensionImageType : extensionImageTypes.list()) { - if (extensionImageType.name().equalsIgnoreCase(dockerExtensionImageTypeName)) { - dockerExtensionImageType = extensionImageType; - break; - } - } - Assertions.assertNotNull(dockerExtensionImageType); - - Assertions.assertNotNull(dockerExtensionImageType.id()); - Assertions.assertTrue(dockerExtensionImageType.name().equalsIgnoreCase(dockerExtensionImageTypeName)); - Assertions.assertTrue(dockerExtensionImageType.regionName().equalsIgnoreCase(locationOrDefault(Region.US_EAST).toString())); - Assertions - .assertTrue( - dockerExtensionImageType - .id() - .toLowerCase() - .endsWith( - "/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.Azure.Extensions/ArtifactTypes/VMExtension/Types/DockerExtension" - .toLowerCase())); - Assertions.assertNotNull(dockerExtensionImageType.publisher()); - Assertions - .assertTrue(dockerExtensionImageType.publisher().name().equalsIgnoreCase(dockerExtensionPublisherName)); - - // Fetch Azure docker extension versions - // - VirtualMachineExtensionImageVersions extensionImageVersions = dockerExtensionImageType.versions(); - Assertions.assertTrue(TestUtilities.getSize(extensionImageVersions.list()) > 0); - - VirtualMachineExtensionImageVersion extensionImageFirstVersion = null; - for (VirtualMachineExtensionImageVersion extensionImageVersion : extensionImageVersions.list()) { - extensionImageFirstVersion = extensionImageVersion; - break; - } - - Assertions.assertNotNull(extensionImageFirstVersion); - String versionName = extensionImageFirstVersion.name(); - Assertions - .assertTrue( - extensionImageFirstVersion - .id() - .toLowerCase() - .endsWith( - ("/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.Azure.Extensions/ArtifactTypes/VMExtension/Types/DockerExtension/Versions/" - + versionName) - .toLowerCase())); - Assertions.assertNotNull(extensionImageFirstVersion.type()); - - // Fetch the Azure docker extension image - // - VirtualMachineExtensionImage dockerExtensionImage = extensionImageFirstVersion.getImage(); - - Assertions.assertTrue(dockerExtensionImage.regionName().equalsIgnoreCase(locationOrDefault(Region.US_EAST).toString())); - Assertions.assertTrue(dockerExtensionImage.publisherName().equalsIgnoreCase(dockerExtensionPublisherName)); - Assertions.assertTrue(dockerExtensionImage.typeName().equalsIgnoreCase(dockerExtensionImageTypeName)); - Assertions.assertTrue(dockerExtensionImage.versionName().equalsIgnoreCase(versionName)); - Assertions - .assertTrue( - dockerExtensionImage.osType() == OperatingSystemTypes.LINUX - || dockerExtensionImage.osType() == OperatingSystemTypes.WINDOWS); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/VirtualMachineExtensionOperationsTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/VirtualMachineExtensionOperationsTests.java deleted file mode 100644 index 47c23f6e526a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/VirtualMachineExtensionOperationsTests.java +++ /dev/null @@ -1,281 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute; - -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.compute.models.KnownLinuxVirtualMachineImage; -import com.azure.resourcemanager.compute.models.VirtualMachine; -import com.azure.resourcemanager.compute.models.VirtualMachineExtension; -import com.azure.resourcemanager.compute.models.VirtualMachineSizeTypes; -import com.azure.core.management.Region; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.storage.models.StorageAccount; -import com.fasterxml.jackson.databind.ObjectMapper; -import java.io.InputStream; -import java.util.Base64; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public class VirtualMachineExtensionOperationsTests extends ComputeManagementTest { - private String rgName = ""; - private Region region = locationOrDefault(Region.US_EAST); - - @Override - protected void initializeClients(HttpPipeline httpPipeline, AzureProfile profile) { - rgName = generateRandomResourceName("vmexttest", 15); - super.initializeClients(httpPipeline, profile); - } - - @Override - protected void cleanUpResources() { - resourceManager.resourceGroups().beginDeleteByName(rgName); - } - - @Test - public void canEnableDiagnosticsExtension() throws Exception { - final String storageAccountName = generateRandomResourceName("stg", 15); - final String vmName = "javavm1"; - - // Creates a storage account - StorageAccount storageAccount = - storageManager - .storageAccounts() - .define(storageAccountName) - .withRegion(region) - .withNewResourceGroup(rgName) - .create(); - - // Create a Linux VM - // - VirtualMachine vm = - computeManager - .virtualMachines() - .define(vmName) - .withRegion(region) - .withExistingResourceGroup(rgName) - .withNewPrimaryNetwork("10.0.0.0/28") - .withPrimaryPrivateIPAddressDynamic() - .withoutPrimaryPublicIPAddress() - .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_18_04_LTS) - .withRootUsername("Foo12") - .withSsh(sshPublicKey()) - .withSize(VirtualMachineSizeTypes.fromString("Standard_D2a_v4")) - .withExistingStorageAccount(storageAccount) - .create(); - - final InputStream embeddedJsonConfig = - VirtualMachineExtensionOperationsTests.class.getResourceAsStream("/linux_diagnostics_public_config.json"); - String jsonConfig = ((new ObjectMapper()).readTree(embeddedJsonConfig)).toString(); - jsonConfig = jsonConfig.replace("%VirtualMachineResourceId%", vm.id()); - - // Update Linux VM to enable Diagnostics - vm - .update() - .defineNewExtension("LinuxDiagnostic") - .withPublisher("Microsoft.OSTCExtensions") - .withType("LinuxDiagnostic") - .withVersion("2.3") - .withPublicSetting("ladCfg", new String(Base64.getEncoder().encode(jsonConfig.getBytes()))) - .withPublicSetting("storageAccount", storageAccount.name()) - .withProtectedSetting("storageAccountName", storageAccount.name()) - .withProtectedSetting("storageAccountKey", storageAccount.getKeys().get(0).value()) - .withProtectedSetting("storageAccountEndPoint", "https://core.windows.net:443/") - .attach() - .apply(); - - Map extensions = vm.listExtensions(); - Assertions.assertNotNull(extensions); - Assertions.assertFalse(extensions.isEmpty()); - VirtualMachineExtension diagExtension = extensions.get("LinuxDiagnostic"); - Assertions.assertNotNull(diagExtension); - Assertions.assertNotNull(diagExtension.publicSettings()); - Assertions.assertFalse(diagExtension.publicSettings().isEmpty()); - - vm.refresh(); - extensions = vm.listExtensions(); - Assertions.assertNotNull(extensions); - Assertions.assertFalse(extensions.isEmpty()); - diagExtension = extensions.get("LinuxDiagnostic"); - Assertions.assertNotNull(diagExtension); - Assertions.assertNotNull(diagExtension.publicSettings()); - Assertions.assertFalse(diagExtension.publicSettings().isEmpty()); - } - - @Test - public void canResetPasswordUsingVMAccessExtension() throws Exception { - final String vmName = "javavm2"; - - // Create a Linux VM - // - VirtualMachine vm = - computeManager - .virtualMachines() - .define(vmName) - .withRegion(region) - .withNewResourceGroup(rgName) - .withNewPrimaryNetwork("10.0.0.0/28") - .withPrimaryPrivateIPAddressDynamic() - .withoutPrimaryPublicIPAddress() - .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) - .withRootUsername("Foo12") - .withSsh(sshPublicKey()) - .withSize(VirtualMachineSizeTypes.fromString("Standard_D2a_v4")) - .create(); - - // Using VMAccess Linux extension to reset the password for the existing user 'Foo12' - // https://github.com/Azure/azure-linux-extensions/blob/master/VMAccess/README.md - // - vm - .update() - .defineNewExtension("VMAccessForLinux") - .withPublisher("Microsoft.OSTCExtensions") - .withType("VMAccessForLinux") - .withVersion("1.4") - .withProtectedSetting("username", "Foo12") - .withProtectedSetting("password", "B12a6@12xyz!") - .withProtectedSetting("reset_ssh", "true") - .attach() - .apply(); - - Assertions.assertTrue(vm.listExtensions().size() > 0); - Assertions.assertTrue(vm.listExtensions().containsKey("VMAccessForLinux")); - - // Update the VMAccess Linux extension to reset password again for the user 'Foo12' - // - vm - .update() - .updateExtension("VMAccessForLinux") - .withProtectedSetting("username", "Foo12") - .withProtectedSetting("password", "muy!234OR") - .withProtectedSetting("reset_ssh", "true") - .parent() - .apply(); - } - - @Test - public void canInstallUninstallCustomExtension() throws Exception { - final String vmName = "javavm3"; - - final String installCommand = "sudo -- sh -c 'apt-get update && apt-get -y install mysql-server'"; - - // Create Linux VM with a custom extension to install MySQL - // - VirtualMachine vm = - computeManager - .virtualMachines() - .define(vmName) - .withRegion(region) - .withNewResourceGroup(rgName) - .withNewPrimaryNetwork("10.0.0.0/28") - .withPrimaryPrivateIPAddressDynamic() - .withoutPrimaryPublicIPAddress() - .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_18_04_LTS) - .withRootUsername("Foo12") - .withSsh(sshPublicKey()) - .withSize(VirtualMachineSizeTypes.fromString("Standard_D2a_v4")) - .defineNewExtension("CustomScriptForLinux") - .withPublisher("Microsoft.OSTCExtensions") - .withType("CustomScriptForLinux") - .withVersion("1.4") - .withMinorVersionAutoUpgrade() - .withPublicSetting("commandToExecute", installCommand) - .attach() - .create(); - - Assertions.assertTrue(vm.listExtensions().size() > 0); - Assertions.assertTrue(vm.listExtensions().containsKey("CustomScriptForLinux")); - VirtualMachineExtension customScriptExtension = vm.listExtensions().get("CustomScriptForLinux"); - Assertions.assertEquals(customScriptExtension.publisherName(), "Microsoft.OSTCExtensions"); - Assertions.assertEquals(customScriptExtension.typeName(), "CustomScriptForLinux"); - Assertions.assertTrue(customScriptExtension.autoUpgradeMinorVersionEnabled()); - - // Remove the custom extension - // - vm.update().withoutExtension("CustomScriptForLinux").apply(); - - Assertions.assertTrue(vm.listExtensions().isEmpty()); - - vm.refresh(); - Assertions.assertTrue(vm.listExtensions().isEmpty()); - } - - @Test - public void canHandleExtensionReference() throws Exception { - final String vmName = "javavm4"; - - // Create a Linux VM - // - VirtualMachine vm = - computeManager - .virtualMachines() - .define(vmName) - .withRegion(region) - .withNewResourceGroup(rgName) - .withNewPrimaryNetwork("10.0.0.0/28") - .withPrimaryPrivateIPAddressDynamic() - .withoutPrimaryPublicIPAddress() - .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_18_04_LTS) - .withRootUsername("Foo12") - .withSsh(sshPublicKey()) - .withSize(VirtualMachineSizeTypes.fromString("Standard_D2a_v4")) - .defineNewExtension("VMAccessForLinux") - .withPublisher("Microsoft.OSTCExtensions") - .withType("VMAccessForLinux") - .withVersion("1.4") - .withProtectedSetting("username", "Foo12") - .withProtectedSetting("password", "B12a6@12xyz!") - .withProtectedSetting("reset_ssh", "true") - .attach() - .create(); - - Assertions.assertTrue(vm.listExtensions().size() > 0); - - // Get the created virtual machine via VM List not by VM GET - PagedIterable virtualMachines = computeManager.virtualMachines().listByResourceGroup(rgName); - VirtualMachine vmWithExtensionReference = null; - for (VirtualMachine virtualMachine : virtualMachines) { - if (virtualMachine.name().equalsIgnoreCase(vmName)) { - vmWithExtensionReference = virtualMachine; - break; - } - } - // The VM retrieved from the list will contain extensions as reference (i.e. with only id) - Assertions.assertNotNull(vmWithExtensionReference); - - // Update the extension - VirtualMachine vmWithExtensionUpdated = - vmWithExtensionReference - .update() - .updateExtension("VMAccessForLinux") - .withProtectedSetting("username", "Foo12") - .withProtectedSetting("password", "muy!234OR") - .withProtectedSetting("reset_ssh", "true") - .parent() - .apply(); - - // Again getting VM with extension reference - virtualMachines = computeManager.virtualMachines().listByResourceGroup(rgName); - vmWithExtensionReference = null; - for (VirtualMachine virtualMachine : virtualMachines) { - vmWithExtensionReference = virtualMachine; - } - Assertions.assertNotNull(vmWithExtensionReference); - - VirtualMachineExtension accessExtension = null; - for (VirtualMachineExtension extension : vmWithExtensionReference.listExtensions().values()) { - if (extension.name().equalsIgnoreCase("VMAccessForLinux")) { - accessExtension = extension; - break; - } - } - // Even though VM's inner contain just extension reference VirtualMachine::getExtensions() - // should resolve the reference and get full extension. - Assertions.assertNotNull(accessExtension); - Assertions.assertNotNull(accessExtension.publisherName()); - Assertions.assertNotNull(accessExtension.typeName()); - Assertions.assertNotNull(accessExtension.versionName()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/VirtualMachineImageOperationsTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/VirtualMachineImageOperationsTests.java deleted file mode 100644 index 901500d3bd6a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/VirtualMachineImageOperationsTests.java +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.compute.models.DataDiskImage; -import com.azure.resourcemanager.compute.models.VirtualMachineImage; -import com.azure.resourcemanager.compute.models.VirtualMachineOffer; -import com.azure.resourcemanager.compute.models.VirtualMachinePublisher; -import com.azure.resourcemanager.compute.models.VirtualMachineSku; -import com.azure.core.management.Region; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public class VirtualMachineImageOperationsTests extends ComputeManagementTest { - @Test - public void canListVirtualMachineImages() throws Exception { - /* - PagedIterable images = computeManager.virtualMachineImages().listByRegion(locationOrDefault(Region.US_EAST)); - Assertions.assertTrue(TestUtilities.getSize(images) > 0); - */ - - PagedIterable publishers = - computeManager.virtualMachineImages().publishers().listByRegion(locationOrDefault(Region.US_EAST)); - - VirtualMachinePublisher canonicalPublisher = null; - for (VirtualMachinePublisher publisher : publishers) { - if (publisher.name().equalsIgnoreCase("Canonical")) { - canonicalPublisher = publisher; - break; - } - } - - Assertions.assertNotNull(canonicalPublisher); - VirtualMachineImage firstVMImage = null; - for (VirtualMachineOffer offer : canonicalPublisher.offers().list()) { - for (VirtualMachineSku sku : offer.skus().list()) { - for (VirtualMachineImage image : sku.images().list()) { - System.out.println(image.version()); - firstVMImage = image; - break; - } - if (firstVMImage != null) { - break; - } - } - if (firstVMImage != null) { - break; - } - } - - Assertions.assertNotNull(firstVMImage); - for (DataDiskImage diskImage : firstVMImage.dataDiskImages().values()) { - Assertions.assertNotNull(diskImage.lun()); - } - - VirtualMachineImage vmImage = - computeManager - .virtualMachineImages() - .getImage( - locationOrDefault(Region.US_EAST), - firstVMImage.publisherName(), - firstVMImage.offer(), - firstVMImage.sku(), - firstVMImage.version()); - Assertions.assertNotNull(vmImage); - - vmImage = - computeManager - .virtualMachineImages() - .getImage( - locationOrDefault("eastus"), - firstVMImage.publisherName(), - firstVMImage.offer(), - firstVMImage.sku(), - firstVMImage.version()); - Assertions.assertNotNull(vmImage); - - vmImage = - computeManager - .virtualMachineImages() - .getImage(locationOrDefault("eastus"), firstVMImage.publisherName(), firstVMImage.offer(), firstVMImage.sku(), "latest"); - Assertions.assertNotNull(vmImage); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/VirtualMachineManagedDiskOperationsTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/VirtualMachineManagedDiskOperationsTests.java deleted file mode 100644 index 9aab033afaea..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/VirtualMachineManagedDiskOperationsTests.java +++ /dev/null @@ -1,603 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute; - -import com.azure.core.http.HttpPipeline; -import com.azure.resourcemanager.compute.models.AvailabilitySet; -import com.azure.resourcemanager.compute.models.AvailabilitySetSkuTypes; -import com.azure.resourcemanager.compute.models.CachingTypes; -import com.azure.resourcemanager.compute.models.Disk; -import com.azure.resourcemanager.compute.models.ImageDataDisk; -import com.azure.resourcemanager.compute.models.KnownLinuxVirtualMachineImage; -import com.azure.resourcemanager.compute.models.OperatingSystemStateTypes; -import com.azure.resourcemanager.compute.models.OperatingSystemTypes; -import com.azure.resourcemanager.compute.models.StorageAccountTypes; -import com.azure.resourcemanager.compute.models.VirtualMachine; -import com.azure.resourcemanager.compute.models.VirtualMachineCustomImage; -import com.azure.resourcemanager.compute.models.VirtualMachineDataDisk; -import com.azure.resourcemanager.compute.models.VirtualMachineSizeTypes; -import com.azure.resourcemanager.resources.models.ResourceGroup; -import com.azure.core.management.Region; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import java.util.Map; - -import com.azure.core.management.profile.AzureProfile; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public class VirtualMachineManagedDiskOperationsTests extends ComputeManagementTest { - private String rgName = ""; - private Region region = locationOrDefault(Region.US_EAST); - private KnownLinuxVirtualMachineImage linuxImage = KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS; - - @Override - protected void initializeClients(HttpPipeline httpPipeline, AzureProfile profile) { - rgName = generateRandomResourceName("javacsmrg", 15); - super.initializeClients(httpPipeline, profile); - } - - @Override - protected void cleanUpResources() { - resourceManager.resourceGroups().beginDeleteByName(rgName); - } - - @Test - public void canCreateVirtualMachineFromPIRImageWithManagedOsDisk() { - final String vmName1 = "myvm1"; - final String publicIpDnsLabel = generateRandomResourceName("pip", 20); - final String uname = "juser"; - final String password = password(); - - VirtualMachine virtualMachine = - computeManager - .virtualMachines() - .define(vmName1) - .withRegion(region) - .withNewResourceGroup(rgName) - .withNewPrimaryNetwork("10.0.0.0/28") - .withPrimaryPrivateIPAddressDynamic() - .withNewPrimaryPublicIPAddress(publicIpDnsLabel) - .withPopularLinuxImage(linuxImage) - .withRootUsername(uname) - .withSsh(sshPublicKey()) - .withSize(VirtualMachineSizeTypes.fromString("Standard_D2a_v4")) - .withOSDiskCaching(CachingTypes.READ_WRITE) - .create(); - // Ensure default to managed disk - // - Assertions.assertTrue(virtualMachine.isManagedDiskEnabled()); - // Validate caching, size and the default storage account type set for the managed disk - // backing os disk - // - Assertions.assertNotNull(virtualMachine.osDiskStorageAccountType()); - Assertions.assertEquals(virtualMachine.osDiskCachingType(), CachingTypes.READ_WRITE); - // Assertions.assertEquals(virtualMachine.size(), VirtualMachineSizeTypes.fromString("Standard_D2a_v4")); - // Validate the implicit managed disk created by CRP to back the os disk - // - Assertions.assertNotNull(virtualMachine.osDiskId()); - Disk osDisk = computeManager.disks().getById(virtualMachine.osDiskId()); - Assertions.assertTrue(osDisk.isAttachedToVirtualMachine()); - Assertions.assertEquals(osDisk.osType(), OperatingSystemTypes.LINUX); - // Check the auto created public ip - // - String publicIpId = virtualMachine.getPrimaryPublicIPAddressId(); - Assertions.assertNotNull(publicIpId); - // Validates the options which are valid only for native disks - // - Assertions.assertNull(virtualMachine.osUnmanagedDiskVhdUri()); - Assertions.assertNotNull(virtualMachine.unmanagedDataDisks()); - Assertions.assertTrue(virtualMachine.unmanagedDataDisks().size() == 0); - } - - @Test - public void canCreateUpdateVirtualMachineWithEmptyManagedDataDisks() { - final String publicIpDnsLabel = generateRandomResourceName("pip", 20); - final String uname = "juser"; - final String password = password(); - // Create with implicit + explicit empty disks, check default and override - // - final String vmName1 = "myvm1"; - final String explicitlyCreatedEmptyDiskName1 = generateRandomResourceName(vmName1 + "_mdisk_", 25); - final String explicitlyCreatedEmptyDiskName2 = generateRandomResourceName(vmName1 + "_mdisk_", 25); - final String explicitlyCreatedEmptyDiskName3 = generateRandomResourceName(vmName1 + "_mdisk_", 25); - - ResourceGroup resourceGroup = resourceManager.resourceGroups().define(rgName).withRegion(region).create(); - - Creatable creatableEmptyDisk1 = - computeManager - .disks() - .define(explicitlyCreatedEmptyDiskName1) - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .withData() - .withSizeInGB(150); - - Creatable creatableEmptyDisk2 = - computeManager - .disks() - .define(explicitlyCreatedEmptyDiskName2) - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .withData() - .withSizeInGB(150); - - Creatable creatableEmptyDisk3 = - computeManager - .disks() - .define(explicitlyCreatedEmptyDiskName3) - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .withData() - .withSizeInGB(150); - - VirtualMachine virtualMachine = - computeManager - .virtualMachines() - .define(vmName1) - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .withNewPrimaryNetwork("10.0.0.0/28") - .withPrimaryPrivateIPAddressDynamic() - .withNewPrimaryPublicIPAddress(publicIpDnsLabel) - .withPopularLinuxImage(linuxImage) - .withRootUsername(uname) - .withSsh(sshPublicKey()) - // Start: Add 5 empty managed disks - .withNewDataDisk(100) // CreateOption: EMPTY - .withNewDataDisk(100, 1, CachingTypes.READ_ONLY) // CreateOption: EMPTY - .withNewDataDisk(creatableEmptyDisk1) // CreateOption: ATTACH - .withNewDataDisk(creatableEmptyDisk2, 2, CachingTypes.NONE) // CreateOption: ATTACH - .withNewDataDisk(creatableEmptyDisk3, 3, CachingTypes.NONE) // CreateOption: ATTACH - // End : Add 5 empty managed disks - .withSize(VirtualMachineSizeTypes.fromString("Standard_D4a_v4")) - .withOSDiskCaching(CachingTypes.READ_WRITE) - .create(); - - Assertions.assertTrue(virtualMachine.isManagedDiskEnabled()); - // There should not be any un-managed data disks - // - Assertions.assertNotNull(virtualMachine.unmanagedDataDisks()); - Assertions.assertEquals(virtualMachine.unmanagedDataDisks().size(), 0); - // Validate the managed data disks - // - Map dataDisks = virtualMachine.dataDisks(); - Assertions.assertNotNull(dataDisks); - Assertions.assertTrue(dataDisks.size() == 5); - Assertions.assertTrue(dataDisks.containsKey(1)); - VirtualMachineDataDisk dataDiskLun1 = dataDisks.get(1); - Assertions.assertNotNull(dataDiskLun1.id()); - Assertions.assertEquals(dataDiskLun1.cachingType(), CachingTypes.READ_ONLY); - Assertions.assertEquals(dataDiskLun1.size(), 100); - - Assertions.assertTrue(dataDisks.containsKey(2)); - VirtualMachineDataDisk dataDiskLun2 = dataDisks.get(2); - Assertions.assertNotNull(dataDiskLun2.id()); - Assertions.assertEquals(dataDiskLun2.cachingType(), CachingTypes.NONE); - Assertions.assertEquals(dataDiskLun2.size(), 150); - - Assertions.assertTrue(dataDisks.containsKey(3)); - VirtualMachineDataDisk dataDiskLun3 = dataDisks.get(3); - Assertions.assertNotNull(dataDiskLun3.id()); - Assertions.assertEquals(dataDiskLun3.cachingType(), CachingTypes.NONE); - Assertions.assertEquals(dataDiskLun3.size(), 150); - // Validate the defaults assigned - // - for (VirtualMachineDataDisk dataDisk : dataDisks.values()) { - if (dataDisk.lun() != 1 && dataDisk.lun() != 2 && dataDisk.lun() != 3) { - Assertions.assertEquals(dataDisk.cachingType(), CachingTypes.READ_WRITE); - Assertions.assertEquals(dataDisk.storageAccountType(), StorageAccountTypes.STANDARD_LRS); - } - } - - // Updating and adding disk as part of VM Update seems consistency failing, CRP is aware of - // this, hence until it is fixed comment-out the test - // - // { - // "startTime": "2017-01-26T05:48:59.9290573+00:00", - // "endTime": "2017-01-26T05:49:02.2884052+00:00", - // "status": "Failed", - // "error": { - // "code": "InternalExecutionError", - // "message": "An internal execution error occurred." - // }, - // "name": "bc8072a7-38bb-445b-ae59-f16cf125342c" - // } - // - // virtualMachine.deallocate(); - // - // virtualMachine.update() - // .withDataDiskUpdated(1, 200) - // .withDataDiskUpdated(2, 200, CachingTypes.READ_WRITE) - // .withNewDataDisk(60) - // .apply(); - // - // Assertions.assertTrue(virtualMachine.isManagedDiskEnabled()); - // // There should not be any un-managed data disks - // // - // Assertions.assertNotNull(virtualMachine.unmanagedDataDisks()); - // Assertions.assertEquals(virtualMachine.unmanagedDataDisks().size(), 0); - // - // // Validate the managed data disks - // // - // dataDisks = virtualMachine.dataDisks(); - // Assertions.assertNotNull(dataDisks); - // Assertions.assertTrue(dataDisks.size() == 6); - // Assertions.assertTrue(dataDisks.containsKey(1)); - // dataDiskLun1 = dataDisks.get(1); - // Assertions.assertNotNull(dataDiskLun1.id()); - // Assertions.assertEquals(dataDiskLun1.cachingType(), CachingTypes.READ_ONLY); - // Assertions.assertEquals(dataDiskLun1.size(), 200); // 100 -> 200 - // - // Assertions.assertTrue(dataDisks.containsKey(2)); - // dataDiskLun2 = dataDisks.get(2); - // Assertions.assertNotNull(dataDiskLun2.id()); - // Assertions.assertEquals(dataDiskLun2.cachingType(), CachingTypes.READ_WRITE); // NONE -> READ_WRITE - // Assertions.assertEquals(dataDiskLun2.size(), 200); // 150 -> 200 - // - // Assertions.assertTrue(dataDisks.containsKey(3)); - // dataDiskLun3 = dataDisks.get(3); - // Assertions.assertNotNull(dataDiskLun3.id()); - // Assertions.assertEquals(dataDiskLun3.cachingType(), CachingTypes.NONE); - // Assertions.assertEquals(dataDiskLun3.size(), 150); - // - // // Ensure defaults of other disks are not affected - // for (VirtualMachineDataDisk dataDisk : dataDisks.values()) { - // if (dataDisk.lun() != 1 && dataDisk.lun() != 3) { - // Assertions.assertEquals(dataDisk.cachingType(), CachingTypes.READ_WRITE); - // Assertions.assertEquals(dataDisk.storageAccountType(), StorageAccountTypes.STANDARD_LRS); - // } - // } - } - - @Test - public void canCreateVirtualMachineFromCustomImageWithManagedDisks() { - final String publicIpDnsLabel = generateRandomResourceName("pip", 20); - final String uname = "juser"; - final String password = password(); - // Create with implicit + explicit empty disks, check default and override - // - final String vmName1 = "myvm1"; - final String explicitlyCreatedEmptyDiskName1 = generateRandomResourceName(vmName1 + "_mdisk_", 25); - final String explicitlyCreatedEmptyDiskName2 = generateRandomResourceName(vmName1 + "_mdisk_", 25); - final String explicitlyCreatedEmptyDiskName3 = generateRandomResourceName(vmName1 + "_mdisk_", 25); - - ResourceGroup resourceGroup = resourceManager.resourceGroups().define(rgName).withRegion(region).create(); - - Creatable creatableEmptyDisk1 = - computeManager - .disks() - .define(explicitlyCreatedEmptyDiskName1) - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .withData() - .withSizeInGB(150); - - Creatable creatableEmptyDisk2 = - computeManager - .disks() - .define(explicitlyCreatedEmptyDiskName2) - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .withData() - .withSizeInGB(150); - - Creatable creatableEmptyDisk3 = - computeManager - .disks() - .define(explicitlyCreatedEmptyDiskName3) - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .withData() - .withSizeInGB(150); - - VirtualMachine virtualMachine1 = - computeManager - .virtualMachines() - .define(vmName1) - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .withNewPrimaryNetwork("10.0.0.0/28") - .withPrimaryPrivateIPAddressDynamic() - .withNewPrimaryPublicIPAddress(publicIpDnsLabel) - .withPopularLinuxImage(linuxImage) - .withRootUsername(uname) - .withSsh(sshPublicKey()) - // Start: Add bunch of empty managed disks - .withNewDataDisk(100) // CreateOption: EMPTY - .withNewDataDisk(100, 1, CachingTypes.READ_ONLY) // CreateOption: EMPTY - .withNewDataDisk(creatableEmptyDisk1) // CreateOption: ATTACH - .withNewDataDisk(creatableEmptyDisk2, 2, CachingTypes.NONE) // CreateOption: ATTACH - .withNewDataDisk(creatableEmptyDisk3, 3, CachingTypes.NONE) // CreateOption: ATTACH - // End : Add bunch of empty managed disks - .withSize(VirtualMachineSizeTypes.fromString("Standard_D4a_v4")) - .withOSDiskCaching(CachingTypes.READ_WRITE) - .create(); - System.out.println("Waiting for some time before de-provision"); - sleep(60 * 1000); // Wait for some time to ensure vm is publicly accessible - deprovisionAgentInLinuxVM(virtualMachine1); - - virtualMachine1.deallocate(); - virtualMachine1.generalize(); - - final String customImageName = generateRandomResourceName("img-", 10); - VirtualMachineCustomImage customImage = - computeManager - .virtualMachineCustomImages() - .define(customImageName) - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .fromVirtualMachine(virtualMachine1) - .create(); - Assertions.assertNotNull(customImage); - Assertions.assertNotNull(customImage.sourceVirtualMachineId()); - Assertions - .assertTrue(customImage.sourceVirtualMachineId().equalsIgnoreCase(virtualMachine1.id().toLowerCase())); - Assertions.assertNotNull(customImage.osDiskImage()); - Assertions.assertEquals(customImage.osDiskImage().osState(), OperatingSystemStateTypes.GENERALIZED); - Assertions.assertEquals(customImage.osDiskImage().osType(), OperatingSystemTypes.LINUX); - Assertions.assertNotNull(customImage.dataDiskImages()); - Assertions.assertEquals(customImage.dataDiskImages().size(), 5); - for (ImageDataDisk imageDataDisk : customImage.dataDiskImages().values()) { - Assertions.assertNull(imageDataDisk.blobUri()); - Assertions.assertNotNull(imageDataDisk.managedDisk().id()); - } - - // Create virtual machine from the custom image - // This one relies on CRP's capability to create implicit data disks from the virtual machine - // image data disk images. - // - final String vmName2 = "myvm2"; - VirtualMachine virtualMachine2 = - computeManager - .virtualMachines() - .define(vmName2) - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .withNewPrimaryNetwork("10.0.0.0/28") - .withPrimaryPrivateIPAddressDynamic() - .withoutPrimaryPublicIPAddress() - .withGeneralizedLinuxCustomImage(customImage.id()) - .withRootUsername(uname) - .withSsh(sshPublicKey()) - // No explicit data disks, let CRP create it from the image's data disk images - .withSize(VirtualMachineSizeTypes.fromString("Standard_D4a_v4")) - .withOSDiskCaching(CachingTypes.READ_WRITE) - .create(); - - Map dataDisks = virtualMachine2.dataDisks(); - Assertions.assertNotNull(dataDisks); - Assertions.assertEquals(dataDisks.size(), customImage.dataDiskImages().size()); - for (ImageDataDisk imageDataDisk : customImage.dataDiskImages().values()) { - Assertions.assertTrue(dataDisks.containsKey(imageDataDisk.lun())); - VirtualMachineDataDisk dataDisk = dataDisks.get(imageDataDisk.lun()); - Assertions.assertEquals(dataDisk.cachingType(), imageDataDisk.caching()); - // Fails due to CRP bug: Managed disk size is not returned on gets. - // Assertions.assertEquals(dataDisk.size(), (long) imageDataDisk.diskSizeGB()); - } - - // Create virtual machine from the custom image - // This one override the size and caching type of data disks from data disk images and - // adds one additional disk - // - - final String vmName3 = "myvm3"; - VirtualMachine.DefinitionStages.WithManagedCreate creatableVirtualMachine3 = - computeManager - .virtualMachines() - .define(vmName3) - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .withNewPrimaryNetwork("10.0.0.0/28") - .withPrimaryPrivateIPAddressDynamic() - .withoutPrimaryPublicIPAddress() - .withGeneralizedLinuxCustomImage(customImage.id()) - .withRootUsername(uname) - .withSsh(sshPublicKey()); - for (ImageDataDisk dataDiskImage : customImage.dataDiskImages().values()) { - // Explicitly override the properties of the data disks created from disk image - // - // CreateOption: FROM_IMAGE - VirtualMachineDataDisk dataDisk = dataDisks.get(dataDiskImage.lun()); - creatableVirtualMachine3 - .withNewDataDiskFromImage( - dataDiskImage.lun(), - dataDisk.size() + 10, // increase size by 10 GB - CachingTypes.READ_ONLY); - } - VirtualMachine virtualMachine3 = - creatableVirtualMachine3 - .withNewDataDisk(200) // CreateOption: EMPTY - .withSize(VirtualMachineSizeTypes.fromString("Standard_D4a_v4")) - .withOSDiskCaching(CachingTypes.READ_WRITE) - .create(); - - dataDisks = virtualMachine3.dataDisks(); - Assertions.assertNotNull(dataDisks); - Assertions - .assertEquals(dataDisks.size(), customImage.dataDiskImages().size() + 1 /* count one extra empty disk */); - for (ImageDataDisk imageDataDisk : customImage.dataDiskImages().values()) { - Assertions.assertTrue(dataDisks.containsKey(imageDataDisk.lun())); - VirtualMachineDataDisk dataDisk = dataDisks.get(imageDataDisk.lun()); - Assertions.assertEquals(dataDisk.cachingType(), CachingTypes.READ_ONLY); - // Fails due to CRP bug: Managed disk size is not returned on gets. - // Assertions.assertEquals(dataDisk.size(), (long) imageDataDisk.diskSizeGB() + 10); - } - } - - @Test - public void canUpdateVirtualMachineByAddingAndRemovingManagedDisks() { - final String publicIpDnsLabel = generateRandomResourceName("pip", 20); - final String uname = "juser"; - final String password = password(); - // Create with implicit + explicit empty disks, check default and override - // - final String vmName1 = "myvm1"; - final String explicitlyCreatedEmptyDiskName1 = generateRandomResourceName(vmName1 + "_mdisk_", 25); - final String explicitlyCreatedEmptyDiskName2 = generateRandomResourceName(vmName1 + "_mdisk_", 25); - final String explicitlyCreatedEmptyDiskName3 = generateRandomResourceName(vmName1 + "_mdisk_", 25); - - ResourceGroup resourceGroup = resourceManager.resourceGroups().define(rgName).withRegion(region).create(); - - Creatable creatableEmptyDisk1 = - computeManager - .disks() - .define(explicitlyCreatedEmptyDiskName1) - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .withData() - .withSizeInGB(150); - - Creatable creatableEmptyDisk2 = - computeManager - .disks() - .define(explicitlyCreatedEmptyDiskName2) - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .withData() - .withSizeInGB(150); - - Creatable creatableEmptyDisk3 = - computeManager - .disks() - .define(explicitlyCreatedEmptyDiskName3) - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .withData() - .withSizeInGB(150); - - VirtualMachine virtualMachine1 = - computeManager - .virtualMachines() - .define(vmName1) - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .withNewPrimaryNetwork("10.0.0.0/28") - .withPrimaryPrivateIPAddressDynamic() - .withNewPrimaryPublicIPAddress(publicIpDnsLabel) - .withPopularLinuxImage(linuxImage) - .withRootUsername(uname) - .withSsh(sshPublicKey()) - // Start: Add bunch of empty managed disks - .withNewDataDisk(100) // CreateOption: EMPTY - .withNewDataDisk(100, 1, CachingTypes.READ_WRITE) // CreateOption: EMPTY - .withNewDataDisk(creatableEmptyDisk1) // CreateOption: ATTACH - .withNewDataDisk(creatableEmptyDisk2, 2, CachingTypes.NONE) // CreateOption: ATTACH - .withNewDataDisk(creatableEmptyDisk3, 3, CachingTypes.NONE) // CreateOption: ATTACH - // End : Add bunch of empty managed disks - .withDataDiskDefaultCachingType(CachingTypes.READ_ONLY) - .withDataDiskDefaultStorageAccountType(StorageAccountTypes.STANDARD_LRS) - .withSize(VirtualMachineSizeTypes.fromString("Standard_D4a_v4")) - .withOSDiskCaching(CachingTypes.READ_WRITE) - .create(); - - virtualMachine1 - .update() - .withoutDataDisk(1) - .withNewDataDisk(100, 6, CachingTypes.READ_WRITE) // CreateOption: EMPTY - .apply(); - - Map dataDisks = virtualMachine1.dataDisks(); - Assertions.assertNotNull(dataDisks); - Assertions.assertEquals(dataDisks.size(), 5); // Removed one added another - Assertions.assertTrue(dataDisks.containsKey(6)); - Assertions.assertFalse(dataDisks.containsKey(1)); - } - - @Test - public void canCreateVirtualMachineByAttachingManagedOsDisk() { - final String uname = "juser"; - final String password = password(); - final String vmName = "myvm6"; - final String storageAccountName = generateRandomResourceName("stg", 17); - - // Creates a native virtual machine - // - VirtualMachine nativeVm = - computeManager - .virtualMachines() - .define(vmName) - .withRegion(region) - .withNewResourceGroup(rgName) - .withNewPrimaryNetwork("10.0.0.0/28") - .withPrimaryPrivateIPAddressDynamic() - .withoutPrimaryPublicIPAddress() - .withLatestLinuxImage("Canonical", "UbuntuServer", "14.04.2-LTS") - .withRootUsername(uname) - .withSsh(sshPublicKey()) - .withUnmanagedDisks() /* UN-MANAGED OS and DATA DISKS */ - .withSize(VirtualMachineSizeTypes.fromString("Standard_D2a_v4")) - .withNewStorageAccount(storageAccountName) - .withOSDiskCaching(CachingTypes.READ_WRITE) - .create(); - - Assertions.assertFalse(nativeVm.isManagedDiskEnabled()); - String osVhdUri = nativeVm.osUnmanagedDiskVhdUri(); - Assertions.assertNotNull(osVhdUri); - - computeManager.virtualMachines().deleteById(nativeVm.id()); - - final String diskName = generateRandomResourceName("dsk-", 15); - Disk osDisk = - computeManager - .disks() - .define(diskName) - .withRegion(region) - .withExistingResourceGroup(rgName) - .withLinuxFromVhd(osVhdUri) - .withStorageAccountName(storageAccountName) - .create(); - - // Creates a managed virtual machine - // - VirtualMachine managedVm = - computeManager - .virtualMachines() - .define(vmName) - .withRegion(region) - .withExistingResourceGroup(rgName) - .withNewPrimaryNetwork("10.0.0.0/28") - .withPrimaryPrivateIPAddressDynamic() - .withoutPrimaryPublicIPAddress() - .withSpecializedOSDisk(osDisk, OperatingSystemTypes.LINUX) - .withSize(VirtualMachineSizeTypes.fromString("Standard_D2a_v4")) - .withOSDiskCaching(CachingTypes.READ_WRITE) - .create(); - - Assertions.assertTrue(managedVm.isManagedDiskEnabled()); - Assertions.assertTrue(managedVm.osDiskId().equalsIgnoreCase(osDisk.id().toLowerCase())); - } - - @Test - public void canCreateVirtualMachineWithManagedDiskInManagedAvailabilitySet() { - final String availSetName = generateRandomResourceName("av-", 15); - final String uname = "juser"; - final String password = password(); - final String vmName = "myvm6"; - - VirtualMachine managedVm = - computeManager - .virtualMachines() - .define(vmName) - .withRegion(region) - .withNewResourceGroup(rgName) - .withNewPrimaryNetwork("10.0.0.0/28") - .withPrimaryPrivateIPAddressDynamic() - .withoutPrimaryPublicIPAddress() - .withPopularLinuxImage(linuxImage) - .withRootUsername(uname) - .withSsh(sshPublicKey()) - .withNewDataDisk(100) - .withNewDataDisk(100, 1, CachingTypes.READ_ONLY) - .withNewDataDisk(100, 2, CachingTypes.READ_WRITE, StorageAccountTypes.STANDARD_LRS) - .withNewAvailabilitySet(availSetName) // Default to managed availability set - .withSize(VirtualMachineSizeTypes.fromString("Standard_D2a_v4")) - .withOSDiskCaching(CachingTypes.READ_WRITE) - .create(); - - Assertions.assertNotNull(managedVm.availabilitySetId()); - AvailabilitySet availabilitySet = computeManager.availabilitySets().getById(managedVm.availabilitySetId()); - Assertions.assertTrue(availabilitySet.virtualMachineIds().size() > 0); - Assertions.assertEquals(availabilitySet.sku(), AvailabilitySetSkuTypes.ALIGNED); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/VirtualMachineManagedServiceIdentityOperationsTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/VirtualMachineManagedServiceIdentityOperationsTests.java deleted file mode 100644 index 0d44587a2d29..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/VirtualMachineManagedServiceIdentityOperationsTests.java +++ /dev/null @@ -1,327 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute; - -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.authorization.models.BuiltInRole; -import com.azure.resourcemanager.authorization.models.RoleAssignment; -import com.azure.resourcemanager.compute.models.CachingTypes; -import com.azure.resourcemanager.compute.models.KnownLinuxVirtualMachineImage; -import com.azure.resourcemanager.compute.models.ResourceIdentityType; -import com.azure.resourcemanager.compute.models.VirtualMachine; -import com.azure.resourcemanager.compute.models.VirtualMachineSizeTypes; -import com.azure.core.management.Region; -import com.azure.resourcemanager.resources.models.ResourceGroup; -import com.azure.resourcemanager.storage.models.StorageAccount; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public class VirtualMachineManagedServiceIdentityOperationsTests extends ComputeManagementTest { - private String rgName = ""; - private final Region region = locationOrDefault(Region.US_EAST); - private final String vmName = "javavm"; - - @Override - protected void initializeClients(HttpPipeline httpPipeline, AzureProfile profile) { - rgName = generateRandomResourceName("javacsmrg", 15); - super.initializeClients(httpPipeline, profile); - } - - @Override - protected void cleanUpResources() { - resourceManager.resourceGroups().beginDeleteByName(rgName); - } - - @Test - public void canSetMSIOnNewOrExistingVMWithoutRoleAssignment() throws Exception { - // Create a virtual machine with just MSI enabled without role and scope. - // - VirtualMachine virtualMachine = - computeManager - .virtualMachines() - .define(vmName) - .withRegion(region) - .withNewResourceGroup(rgName) - .withNewPrimaryNetwork("10.0.0.0/28") - .withPrimaryPrivateIPAddressDynamic() - .withoutPrimaryPublicIPAddress() - .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) - .withRootUsername("Foo12") - .withSsh(sshPublicKey()) - .withSize(VirtualMachineSizeTypes.fromString("Standard_D2a_v4")) - .withOSDiskCaching(CachingTypes.READ_WRITE) - .withSystemAssignedManagedServiceIdentity() - .create(); - - Assertions.assertNotNull(virtualMachine); - Assertions.assertNotNull(virtualMachine.innerModel()); - Assertions.assertTrue(virtualMachine.isManagedServiceIdentityEnabled()); - Assertions.assertNotNull(virtualMachine.systemAssignedManagedServiceIdentityPrincipalId()); - Assertions.assertNotNull(virtualMachine.systemAssignedManagedServiceIdentityTenantId()); - - // Ensure NO role assigned for resource group - // - ResourceGroup resourceGroup = - this.resourceManager.resourceGroups().getByName(virtualMachine.resourceGroupName()); - PagedIterable rgRoleAssignments1 = - authorizationManager.roleAssignments().listByScope(resourceGroup.id()); - Assertions.assertNotNull(rgRoleAssignments1); - boolean found = false; - for (RoleAssignment roleAssignment : rgRoleAssignments1) { - if (roleAssignment.principalId() != null - && roleAssignment - .principalId() - .equalsIgnoreCase(virtualMachine.systemAssignedManagedServiceIdentityPrincipalId())) { - found = true; - break; - } - } - Assertions - .assertFalse(found, "Resource group should not have a role assignment with virtual machine MSI principal"); - - virtualMachine = virtualMachine.update().withSystemAssignedManagedServiceIdentity().apply(); - - Assertions.assertNotNull(virtualMachine); - Assertions.assertNotNull(virtualMachine.innerModel()); - Assertions.assertTrue(virtualMachine.isManagedServiceIdentityEnabled()); - Assertions.assertNotNull(virtualMachine.systemAssignedManagedServiceIdentityPrincipalId()); - Assertions.assertNotNull(virtualMachine.systemAssignedManagedServiceIdentityTenantId()); - - // Ensure NO role assigned for resource group - // - rgRoleAssignments1 = authorizationManager.roleAssignments().listByScope(resourceGroup.id()); - Assertions.assertNotNull(rgRoleAssignments1); - found = false; - for (RoleAssignment roleAssignment : rgRoleAssignments1) { - if (roleAssignment.principalId() != null - && roleAssignment - .principalId() - .equalsIgnoreCase(virtualMachine.systemAssignedManagedServiceIdentityPrincipalId())) { - found = true; - break; - } - } - Assertions - .assertFalse(found, "Resource group should not have a role assignment with virtual machine MSI principal"); - } - - @Test - public void canSetMSIOnNewVMWithRoleAssignedToCurrentResourceGroup() throws Exception { - VirtualMachine virtualMachine = - computeManager - .virtualMachines() - .define(vmName) - .withRegion(region) - .withNewResourceGroup(rgName) - .withNewPrimaryNetwork("10.0.0.0/28") - .withPrimaryPrivateIPAddressDynamic() - .withoutPrimaryPublicIPAddress() - .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) - .withRootUsername("Foo12") - .withSsh(sshPublicKey()) - .withSize(VirtualMachineSizeTypes.fromString("Standard_D2a_v4")) - .withOSDiskCaching(CachingTypes.READ_WRITE) - .withSystemAssignedManagedServiceIdentity() - .withSystemAssignedIdentityBasedAccessToCurrentResourceGroup(BuiltInRole.CONTRIBUTOR) - .create(); - - Assertions.assertNotNull(virtualMachine); - Assertions.assertNotNull(virtualMachine.innerModel()); - Assertions.assertTrue(virtualMachine.isManagedServiceIdentityEnabled()); - Assertions.assertNotNull(virtualMachine.systemAssignedManagedServiceIdentityPrincipalId()); - Assertions.assertNotNull(virtualMachine.systemAssignedManagedServiceIdentityTenantId()); - - // Validate service created service principal - // TODO: Renable the below code snippet: https://github.com/Azure/azure-libraries-for-net/issues/739 - // ServicePrincipal servicePrincipal = authorizationManager - // .servicePrincipals() - // .getById(virtualMachine.systemAssignedManagedServiceIdentityPrincipalId()); - // - // Assertions.assertNotNull(servicePrincipal); - // Assertions.assertNotNull(servicePrincipal.inner()); - - // Ensure role assigned - // - ResourceGroup resourceGroup = - this.resourceManager.resourceGroups().getByName(virtualMachine.resourceGroupName()); - PagedIterable rgRoleAssignments = authorizationManager.roleAssignments().listByScope(resourceGroup.id()); - boolean found = false; - for (RoleAssignment rgRoleAssignment : rgRoleAssignments) { - if (rgRoleAssignment.principalId() != null - && rgRoleAssignment - .principalId() - .equalsIgnoreCase(virtualMachine.systemAssignedManagedServiceIdentityPrincipalId())) { - found = true; - break; - } - } - - Assertions.assertTrue(found, "Resource group should have a role assignment with virtual machine MSI principal"); - } - - @Test - public void canSetMSIOnNewVMWithMultipleRoleAssignments() throws Exception { - String storageAccountName = generateRandomResourceName("javacsrg", 15); - - StorageAccount storageAccount = - storageManager - .storageAccounts() - .define(storageAccountName) - .withRegion(locationOrDefault(Region.US_EAST2)) - .withNewResourceGroup(rgName) - .create(); - - ResourceGroup resourceGroup = - this.resourceManager.resourceGroups().getByName(storageAccount.resourceGroupName()); - - VirtualMachine virtualMachine = - computeManager - .virtualMachines() - .define(vmName) - .withRegion(region) - .withExistingResourceGroup(rgName) - .withNewPrimaryNetwork("10.0.0.0/28") - .withPrimaryPrivateIPAddressDynamic() - .withoutPrimaryPublicIPAddress() - .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) - .withRootUsername("Foo12") - .withSsh(sshPublicKey()) - .withSize(VirtualMachineSizeTypes.fromString("Standard_D2a_v4")) - .withOSDiskCaching(CachingTypes.READ_WRITE) - .withSystemAssignedManagedServiceIdentity() - .withSystemAssignedIdentityBasedAccessTo(resourceGroup.id(), BuiltInRole.CONTRIBUTOR) - .withSystemAssignedIdentityBasedAccessTo(storageAccount.id(), BuiltInRole.CONTRIBUTOR) - .create(); - - // Validate service created service principal - // - - // TODO: Renable the below code snippet: https://github.com/Azure/azure-libraries-for-net/issues/739 - - // ServicePrincipal servicePrincipal = authorizationManager - // .servicePrincipals() - // .getById(virtualMachine.systemAssignedManagedServiceIdentityPrincipalId()); - // - // Assertions.assertNotNull(servicePrincipal); - // Assertions.assertNotNull(servicePrincipal.inner()); - - // Ensure role assigned for resource group - // - PagedIterable rgRoleAssignments = authorizationManager.roleAssignments().listByScope(resourceGroup.id()); - Assertions.assertNotNull(rgRoleAssignments); - boolean found = false; - for (RoleAssignment roleAssignment : rgRoleAssignments) { - if (roleAssignment.principalId() != null - && roleAssignment - .principalId() - .equalsIgnoreCase(virtualMachine.systemAssignedManagedServiceIdentityPrincipalId())) { - found = true; - break; - } - } - Assertions.assertTrue(found, "Resource group should have a role assignment with virtual machine MSI principal"); - - // Ensure role assigned for storage account - // - PagedIterable stgRoleAssignments = - authorizationManager.roleAssignments().listByScope(storageAccount.id()); - Assertions.assertNotNull(stgRoleAssignments); - found = false; - for (RoleAssignment roleAssignment : stgRoleAssignments) { - if (roleAssignment.principalId() != null - && roleAssignment - .principalId() - .equalsIgnoreCase(virtualMachine.systemAssignedManagedServiceIdentityPrincipalId())) { - found = true; - break; - } - } - Assertions - .assertTrue(found, "Storage account should have a role assignment with virtual machine MSI principal"); - } - - @Test - public void canSetMSIOnExistingVMWithRoleAssignments() throws Exception { - VirtualMachine virtualMachine = - computeManager - .virtualMachines() - .define(vmName) - .withRegion(region) - .withNewResourceGroup(rgName) - .withNewPrimaryNetwork("10.0.0.0/28") - .withPrimaryPrivateIPAddressDynamic() - .withoutPrimaryPublicIPAddress() - .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) - .withRootUsername("Foo12") - .withSsh(sshPublicKey()) - .withSize(VirtualMachineSizeTypes.fromString("Standard_D2a_v4")) - .withOSDiskCaching(CachingTypes.READ_WRITE) - .withSystemAssignedManagedServiceIdentity() - .create(); - - Assertions.assertNotNull(virtualMachine); - Assertions.assertNotNull(virtualMachine.innerModel()); - Assertions.assertTrue(virtualMachine.isManagedServiceIdentityEnabled()); - Assertions.assertNotNull(virtualMachine.systemAssignedManagedServiceIdentityPrincipalId()); - Assertions.assertNotNull(virtualMachine.systemAssignedManagedServiceIdentityTenantId()); - - Assertions.assertNotNull(virtualMachine.managedServiceIdentityType()); - Assertions.assertTrue(virtualMachine.managedServiceIdentityType().equals(ResourceIdentityType.SYSTEM_ASSIGNED)); - - // Ensure NO role assigned for resource group - // - ResourceGroup resourceGroup = - this.resourceManager.resourceGroups().getByName(virtualMachine.resourceGroupName()); - PagedIterable rgRoleAssignments1 = - authorizationManager.roleAssignments().listByScope(resourceGroup.id()); - Assertions.assertNotNull(rgRoleAssignments1); - boolean found = false; - for (RoleAssignment roleAssignment : rgRoleAssignments1) { - if (roleAssignment.principalId() != null - && roleAssignment - .principalId() - .equalsIgnoreCase(virtualMachine.systemAssignedManagedServiceIdentityPrincipalId())) { - found = true; - break; - } - } - Assertions - .assertFalse(found, "Resource group should not have a role assignment with virtual machine MSI principal"); - - virtualMachine - .update() - .withSystemAssignedManagedServiceIdentity() - .withSystemAssignedIdentityBasedAccessToCurrentResourceGroup(BuiltInRole.CONTRIBUTOR) - .apply(); - - // Ensure role assigned for resource group - // - PagedIterable roleAssignments2 = authorizationManager.roleAssignments().listByScope(resourceGroup.id()); - Assertions.assertNotNull(roleAssignments2); - for (RoleAssignment roleAssignment : roleAssignments2) { - if (roleAssignment.principalId() != null - && roleAssignment - .principalId() - .equalsIgnoreCase(virtualMachine.systemAssignedManagedServiceIdentityPrincipalId())) { - found = true; - break; - } - } - Assertions.assertTrue(found, "Resource group should have a role assignment with virtual machine MSI principal"); - } - - private static Integer objectToInteger(Object obj) { - Integer result = null; - if (obj != null) { - if (obj instanceof Integer) { - result = (Integer) obj; - } else { - result = Integer.valueOf((String) obj); - } - } - return result; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/VirtualMachineOperationsTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/VirtualMachineOperationsTests.java deleted file mode 100644 index 663dc95f3eeb..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/VirtualMachineOperationsTests.java +++ /dev/null @@ -1,984 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute; - -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.annotation.DoNotRecord; -import com.azure.core.util.polling.LongRunningOperationStatus; -import com.azure.core.util.polling.PollResponse; -import com.azure.resourcemanager.compute.models.AvailabilitySet; -import com.azure.resourcemanager.compute.models.CachingTypes; -import com.azure.resourcemanager.compute.models.Disk; -import com.azure.resourcemanager.compute.models.DiskState; -import com.azure.resourcemanager.compute.models.KnownLinuxVirtualMachineImage; -import com.azure.resourcemanager.compute.models.KnownWindowsVirtualMachineImage; -import com.azure.resourcemanager.compute.models.PowerState; -import com.azure.resourcemanager.compute.models.ProximityPlacementGroupType; -import com.azure.resourcemanager.compute.models.RunCommandInputParameter; -import com.azure.resourcemanager.compute.models.RunCommandResult; -import com.azure.resourcemanager.compute.models.VirtualMachine; -import com.azure.resourcemanager.compute.models.VirtualMachineEvictionPolicyTypes; -import com.azure.resourcemanager.compute.models.VirtualMachineInstanceView; -import com.azure.resourcemanager.compute.models.VirtualMachinePriorityTypes; -import com.azure.resourcemanager.compute.models.VirtualMachineSizeTypes; -import com.azure.resourcemanager.compute.models.VirtualMachineUnmanagedDataDisk; -import com.azure.resourcemanager.network.models.Network; -import com.azure.resourcemanager.network.models.NetworkInterface; -import com.azure.resourcemanager.network.models.NetworkSecurityGroup; -import com.azure.resourcemanager.network.models.NicIpConfiguration; -import com.azure.resourcemanager.network.models.PublicIpAddress; -import com.azure.resourcemanager.network.models.SecurityRuleProtocol; -import com.azure.resourcemanager.network.models.Subnet; -import com.azure.core.management.Region; -import com.azure.resourcemanager.resources.fluentcore.arm.models.Resource; -import com.azure.resourcemanager.resources.fluentcore.model.Accepted; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.CreatedResources; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import com.azure.resourcemanager.resources.models.ResourceGroup; -import com.azure.resourcemanager.storage.models.StorageAccount; -import com.azure.resourcemanager.storage.models.StorageAccountSkuType; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -import java.time.Duration; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.concurrent.atomic.AtomicInteger; - -public class VirtualMachineOperationsTests extends ComputeManagementTest { - private String rgName = ""; - private String rgName2 = ""; - private final Region region = locationOrDefault(Region.US_EAST); - private final Region regionProxPlacementGroup = locationOrDefault(Region.US_WEST); - private final Region regionProxPlacementGroup2 = locationOrDefault(Region.US_EAST); - private final String vmName = "javavm"; - private final String proxGroupName = "testproxgroup1"; - private final String proxGroupName2 = "testproxgroup2"; - private final String availabilitySetName = "availset1"; - private final String availabilitySetName2 = "availset2"; - private final ProximityPlacementGroupType proxGroupType = ProximityPlacementGroupType.STANDARD; - - @Override - protected void initializeClients(HttpPipeline httpPipeline, AzureProfile profile) { - rgName = generateRandomResourceName("javacsmrg", 15); - rgName2 = generateRandomResourceName("javacsmrg2", 15); - super.initializeClients(httpPipeline, profile); - } - - @Override - protected void cleanUpResources() { - resourceManager.resourceGroups().beginDeleteByName(rgName); - } - - @Test - public void canCreateVirtualMachineWithNetworking() throws Exception { - NetworkSecurityGroup nsg = - this - .networkManager - .networkSecurityGroups() - .define("nsg") - .withRegion(region) - .withNewResourceGroup(rgName) - .defineRule("rule1") - .allowInbound() - .fromAnyAddress() - .fromPort(80) - .toAnyAddress() - .toPort(80) - .withProtocol(SecurityRuleProtocol.TCP) - .attach() - .create(); - - Creatable networkDefinition = - this - .networkManager - .networks() - .define("network1") - .withRegion(region) - .withNewResourceGroup(rgName) - .withAddressSpace("10.0.0.0/28") - .defineSubnet("subnet1") - .withAddressPrefix("10.0.0.0/29") - .withExistingNetworkSecurityGroup(nsg) - .attach(); - - // Create - VirtualMachine vm = - computeManager - .virtualMachines() - .define(vmName) - .withRegion(region) - .withNewResourceGroup(rgName) - .withNewPrimaryNetwork(networkDefinition) - .withPrimaryPrivateIPAddressDynamic() - .withoutPrimaryPublicIPAddress() - .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) - .withRootUsername("Foo12") - .withSsh(sshPublicKey()) - .create(); - - NetworkInterface primaryNic = vm.getPrimaryNetworkInterface(); - Assertions.assertNotNull(primaryNic); - NicIpConfiguration primaryIpConfig = primaryNic.primaryIPConfiguration(); - Assertions.assertNotNull(primaryIpConfig); - - // Fetch the NSG the way before v1.2 - Assertions.assertNotNull(primaryIpConfig.networkId()); - Network network = primaryIpConfig.getNetwork(); - Assertions.assertNotNull(primaryIpConfig.subnetName()); - Subnet subnet = network.subnets().get(primaryIpConfig.subnetName()); - Assertions.assertNotNull(subnet); - nsg = subnet.getNetworkSecurityGroup(); - Assertions.assertNotNull(nsg); - Assertions.assertEquals("nsg", nsg.name()); - Assertions.assertEquals(1, nsg.securityRules().size()); - - // Fetch the NSG the v1.2 way - nsg = primaryIpConfig.getNetworkSecurityGroup(); - Assertions.assertEquals("nsg", nsg.name()); - } - - @Test - public void canCreateVirtualMachine() throws Exception { - // Create - computeManager - .virtualMachines() - .define(vmName) - .withRegion(region) - .withNewResourceGroup(rgName) - .withNewPrimaryNetwork("10.0.0.0/28") - .withPrimaryPrivateIPAddressDynamic() - .withoutPrimaryPublicIPAddress() - .withPopularWindowsImage(KnownWindowsVirtualMachineImage.WINDOWS_SERVER_2012_R2_DATACENTER) - .withAdminUsername("Foo12") - .withAdminPassword(password()) - .withUnmanagedDisks() - .withSize(VirtualMachineSizeTypes.fromString("Standard_D2a_v4")) - .withOSDiskCaching(CachingTypes.READ_WRITE) - .withOSDiskName("javatest") - .withLicenseType("Windows_Server") - .create(); - - VirtualMachine foundVM = null; - PagedIterable vms = computeManager.virtualMachines().listByResourceGroup(rgName); - for (VirtualMachine vm1 : vms) { - if (vm1.name().equals(vmName)) { - foundVM = vm1; - break; - } - } - Assertions.assertNotNull(foundVM); - Assertions.assertEquals(region, foundVM.region()); - // Get - foundVM = computeManager.virtualMachines().getByResourceGroup(rgName, vmName); - Assertions.assertNotNull(foundVM); - Assertions.assertEquals(region, foundVM.region()); - Assertions.assertEquals("Windows_Server", foundVM.licenseType()); - - // Fetch instance view - PowerState powerState = foundVM.powerState(); - Assertions.assertEquals(powerState, PowerState.RUNNING); - VirtualMachineInstanceView instanceView = foundVM.instanceView(); - Assertions.assertNotNull(instanceView); - Assertions.assertNotNull(instanceView.statuses().size() > 0); - - // Delete VM - computeManager.virtualMachines().deleteById(foundVM.id()); - } - - @Test - public void canCreateVirtualMachineSyncPoll() throws Exception { - final long defaultDelayInMillis = 10 * 1000; - - Accepted acceptedVirtualMachine = computeManager - .virtualMachines() - .define(vmName) - .withRegion(region) - .withNewResourceGroup(rgName) - .withNewPrimaryNetwork("10.0.0.0/28") - .withPrimaryPrivateIPAddressDynamic() - .withoutPrimaryPublicIPAddress() - .withPopularWindowsImage(KnownWindowsVirtualMachineImage.WINDOWS_SERVER_2016_DATACENTER) - .withAdminUsername("Foo12") - .withAdminPassword(password()) - .withUnmanagedDisks() - .withSize(VirtualMachineSizeTypes.fromString("Standard_D2a_v4")) - .withOSDiskCaching(CachingTypes.READ_WRITE) - .withOSDiskName("javatest") - .withLicenseType("Windows_Server") - .beginCreate(); - VirtualMachine createdVirtualMachine = acceptedVirtualMachine.getActivationResponse().getValue(); - Assertions.assertNotEquals("Succeeded", createdVirtualMachine.provisioningState()); - - LongRunningOperationStatus pollStatus = acceptedVirtualMachine.getActivationResponse().getStatus(); - long delayInMills = acceptedVirtualMachine.getActivationResponse().getRetryAfter() == null - ? defaultDelayInMillis - : acceptedVirtualMachine.getActivationResponse().getRetryAfter().toMillis(); - while (!pollStatus.isComplete()) { - ResourceManagerUtils.sleep(Duration.ofMillis(delayInMills)); - - PollResponse pollResponse = acceptedVirtualMachine.getSyncPoller().poll(); - pollStatus = pollResponse.getStatus(); - delayInMills = pollResponse.getRetryAfter() == null - ? defaultDelayInMillis - : pollResponse.getRetryAfter().toMillis(); - } - Assertions.assertEquals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, pollStatus); - VirtualMachine virtualMachine = acceptedVirtualMachine.getFinalResult(); - Assertions.assertEquals("Succeeded", virtualMachine.provisioningState()); - - Accepted acceptedDelete = computeManager.virtualMachines() - .beginDeleteByResourceGroup(virtualMachine.resourceGroupName(), virtualMachine.name()); - - pollStatus = acceptedDelete.getActivationResponse().getStatus(); - delayInMills = acceptedDelete.getActivationResponse().getRetryAfter() == null - ? defaultDelayInMillis - : (int) acceptedDelete.getActivationResponse().getRetryAfter().toMillis(); - - while (!pollStatus.isComplete()) { - ResourceManagerUtils.sleep(Duration.ofMillis(delayInMills)); - - PollResponse pollResponse = acceptedDelete.getSyncPoller().poll(); - pollStatus = pollResponse.getStatus(); - delayInMills = pollResponse.getRetryAfter() == null - ? defaultDelayInMillis - : (int) pollResponse.getRetryAfter().toMillis(); - } - - boolean deleted = false; - try { - computeManager.virtualMachines().getById(virtualMachine.id()); - } catch (ManagementException e) { - if (e.getResponse().getStatusCode() == 404 - && ("NotFound".equals(e.getValue().getCode()) || "ResourceNotFound".equals(e.getValue().getCode()))) { - deleted = true; - } - } - Assertions.assertTrue(deleted); - } - - @Test - @Disabled("Low priority virtual machines won't always be scheduled.") - public void canCreateUpdatePriorityAndPrice() throws Exception { - // Create - computeManager - .virtualMachines() - .define(vmName) - .withRegion(region) - .withNewResourceGroup(rgName) - .withNewPrimaryNetwork("10.0.0.0/28") - .withPrimaryPrivateIPAddressDynamic() - .withoutPrimaryPublicIPAddress() - .withPopularWindowsImage(KnownWindowsVirtualMachineImage.WINDOWS_SERVER_2016_DATACENTER) - .withAdminUsername("Foo12") - .withAdminPassword(password()) - .withUnmanagedDisks() - .withSize(VirtualMachineSizeTypes.fromString("Standard_D2a_v4")) - .withOSDiskCaching(CachingTypes.READ_WRITE) - .withOSDiskName("javatest") - .withLowPriority(VirtualMachineEvictionPolicyTypes.DEALLOCATE) - .withMaxPrice(1000.0) - .withLicenseType("Windows_Server") - .create(); - - VirtualMachine foundVM = null; - PagedIterable vms = computeManager.virtualMachines().listByResourceGroup(rgName); - for (VirtualMachine vm1 : vms) { - if (vm1.name().equals(vmName)) { - foundVM = vm1; - break; - } - } - Assertions.assertNotNull(foundVM); - Assertions.assertEquals(region, foundVM.region()); - // Get - foundVM = computeManager.virtualMachines().getByResourceGroup(rgName, vmName); - Assertions.assertNotNull(foundVM); - Assertions.assertEquals(region, foundVM.region()); - Assertions.assertEquals("Windows_Server", foundVM.licenseType()); - Assertions.assertEquals((Double) 1000.0, foundVM.billingProfile().maxPrice()); - Assertions.assertEquals(VirtualMachineEvictionPolicyTypes.DEALLOCATE, foundVM.evictionPolicy()); - - // change max price - try { - foundVM.update().withMaxPrice(1500.0).apply(); - // not run to assert - Assertions.assertEquals((Double) 1500.0, foundVM.billingProfile().maxPrice()); - Assertions.fail(); - } catch (ManagementException e) { - } // cannot change max price when vm is running - - foundVM.deallocate(); - foundVM.update().withMaxPrice(2000.0).apply(); - foundVM.start(); - - Assertions.assertEquals((Double) 2000.0, foundVM.billingProfile().maxPrice()); - - // change priority types - foundVM = foundVM.update().withPriority(VirtualMachinePriorityTypes.SPOT).apply(); - - Assertions.assertEquals(VirtualMachinePriorityTypes.SPOT, foundVM.priority()); - - foundVM = foundVM.update().withPriority(VirtualMachinePriorityTypes.LOW).apply(); - - Assertions.assertEquals(VirtualMachinePriorityTypes.LOW, foundVM.priority()); - try { - foundVM.update().withPriority(VirtualMachinePriorityTypes.REGULAR).apply(); - // not run to assert - Assertions.assertEquals(VirtualMachinePriorityTypes.REGULAR, foundVM.priority()); - Assertions.fail(); - } catch (ManagementException e) { - } // cannot change priority from low to regular - - // Delete VM - computeManager.virtualMachines().deleteById(foundVM.id()); - } - - @Test - public void cannotUpdateProximityPlacementGroupForVirtualMachine() throws Exception { - AvailabilitySet setCreated = - computeManager - .availabilitySets() - .define(availabilitySetName) - .withRegion(regionProxPlacementGroup) - .withNewResourceGroup(rgName) - .withNewProximityPlacementGroup(proxGroupName, proxGroupType) - .create(); - - Assertions.assertEquals(availabilitySetName, setCreated.name()); - Assertions.assertNotNull(setCreated.proximityPlacementGroup()); - Assertions.assertEquals(proxGroupType, setCreated.proximityPlacementGroup().proximityPlacementGroupType()); - Assertions.assertNotNull(setCreated.proximityPlacementGroup().availabilitySetIds()); - Assertions.assertFalse(setCreated.proximityPlacementGroup().availabilitySetIds().isEmpty()); - Assertions - .assertTrue( - setCreated.id().equalsIgnoreCase(setCreated.proximityPlacementGroup().availabilitySetIds().get(0))); - Assertions.assertEquals(setCreated.regionName(), setCreated.proximityPlacementGroup().location()); - - AvailabilitySet setCreated2 = - computeManager - .availabilitySets() - .define(availabilitySetName2) - .withRegion(regionProxPlacementGroup2) - .withNewResourceGroup(rgName2) - .withNewProximityPlacementGroup(proxGroupName2, proxGroupType) - .create(); - - Assertions.assertEquals(availabilitySetName2, setCreated2.name()); - Assertions.assertNotNull(setCreated2.proximityPlacementGroup()); - Assertions.assertEquals(proxGroupType, setCreated2.proximityPlacementGroup().proximityPlacementGroupType()); - Assertions.assertNotNull(setCreated2.proximityPlacementGroup().availabilitySetIds()); - Assertions.assertFalse(setCreated2.proximityPlacementGroup().availabilitySetIds().isEmpty()); - Assertions - .assertTrue( - setCreated2.id().equalsIgnoreCase(setCreated2.proximityPlacementGroup().availabilitySetIds().get(0))); - Assertions.assertEquals(setCreated2.regionName(), setCreated2.proximityPlacementGroup().location()); - - // Create - computeManager - .virtualMachines() - .define(vmName) - .withRegion(regionProxPlacementGroup) - .withExistingResourceGroup(rgName) - .withNewPrimaryNetwork("10.0.0.0/28") - .withPrimaryPrivateIPAddressDynamic() - .withoutPrimaryPublicIPAddress() - .withProximityPlacementGroup(setCreated.proximityPlacementGroup().id()) - .withPopularWindowsImage(KnownWindowsVirtualMachineImage.WINDOWS_SERVER_2019_DATACENTER) - .withAdminUsername("Foo12") - .withAdminPassword(password()) - .withUnmanagedDisks() - .withSize(VirtualMachineSizeTypes.fromString("Standard_D2a_v4")) - .withOSDiskCaching(CachingTypes.READ_WRITE) - .withOSDiskName("javatest") - .withLicenseType("Windows_Server") - .create(); - - VirtualMachine foundVM = null; - PagedIterable vms = computeManager.virtualMachines().listByResourceGroup(rgName); - for (VirtualMachine vm1 : vms) { - if (vm1.name().equals(vmName)) { - foundVM = vm1; - break; - } - } - Assertions.assertNotNull(foundVM); - Assertions.assertEquals(regionProxPlacementGroup, foundVM.region()); - // Get - foundVM = computeManager.virtualMachines().getByResourceGroup(rgName, vmName); - Assertions.assertNotNull(foundVM); - Assertions.assertEquals(regionProxPlacementGroup, foundVM.region()); - Assertions.assertEquals("Windows_Server", foundVM.licenseType()); - - // Fetch instance view - PowerState powerState = foundVM.powerState(); - Assertions.assertEquals(powerState, PowerState.RUNNING); - VirtualMachineInstanceView instanceView = foundVM.instanceView(); - Assertions.assertNotNull(instanceView); - Assertions.assertNotNull(instanceView.statuses().size() > 0); - - Assertions.assertNotNull(foundVM.proximityPlacementGroup()); - Assertions.assertEquals(proxGroupType, foundVM.proximityPlacementGroup().proximityPlacementGroupType()); - Assertions.assertNotNull(foundVM.proximityPlacementGroup().availabilitySetIds()); - Assertions.assertFalse(foundVM.proximityPlacementGroup().availabilitySetIds().isEmpty()); - Assertions - .assertTrue( - setCreated.id().equalsIgnoreCase(foundVM.proximityPlacementGroup().availabilitySetIds().get(0))); - Assertions.assertNotNull(foundVM.proximityPlacementGroup().virtualMachineIds()); - Assertions.assertFalse(foundVM.proximityPlacementGroup().virtualMachineIds().isEmpty()); - Assertions - .assertTrue(foundVM.id().equalsIgnoreCase(setCreated.proximityPlacementGroup().virtualMachineIds().get(0))); - - try { - // Update Vm to remove it from proximity placement group - VirtualMachine updatedVm = - foundVM.update().withProximityPlacementGroup(setCreated2.proximityPlacementGroup().id()).apply(); - } catch (ManagementException clEx) { - Assertions - .assertTrue( - clEx - .getMessage() - .contains( - "Updating proximity placement group of VM javavm is not allowed while the VM is running." - + " Please stop/deallocate the VM and retry the operation.")); - } - - // Delete VM - computeManager.virtualMachines().deleteById(foundVM.id()); - computeManager.availabilitySets().deleteById(setCreated.id()); - } - - @Test - public void canCreateVirtualMachinesAndAvailabilitySetInSameProximityPlacementGroup() throws Exception { - AvailabilitySet setCreated = - computeManager - .availabilitySets() - .define(availabilitySetName) - .withRegion(regionProxPlacementGroup) - .withNewResourceGroup(rgName) - .withNewProximityPlacementGroup(proxGroupName, proxGroupType) - .create(); - - Assertions.assertEquals(availabilitySetName, setCreated.name()); - Assertions.assertNotNull(setCreated.proximityPlacementGroup()); - Assertions.assertEquals(proxGroupType, setCreated.proximityPlacementGroup().proximityPlacementGroupType()); - Assertions.assertNotNull(setCreated.proximityPlacementGroup().availabilitySetIds()); - Assertions.assertFalse(setCreated.proximityPlacementGroup().availabilitySetIds().isEmpty()); - Assertions - .assertTrue( - setCreated.id().equalsIgnoreCase(setCreated.proximityPlacementGroup().availabilitySetIds().get(0))); - Assertions.assertEquals(setCreated.regionName(), setCreated.proximityPlacementGroup().location()); - - // Create - computeManager - .virtualMachines() - .define(vmName) - .withRegion(regionProxPlacementGroup) - .withExistingResourceGroup(rgName) - .withNewPrimaryNetwork("10.0.0.0/28") - .withPrimaryPrivateIPAddressDynamic() - .withoutPrimaryPublicIPAddress() - .withProximityPlacementGroup(setCreated.proximityPlacementGroup().id()) - .withPopularWindowsImage(KnownWindowsVirtualMachineImage.WINDOWS_SERVER_2019_DATACENTER) - .withAdminUsername("Foo12") - .withAdminPassword(password()) - .withUnmanagedDisks() - .withSize(VirtualMachineSizeTypes.fromString("Standard_D2a_v4")) - .withOSDiskCaching(CachingTypes.READ_WRITE) - .withOSDiskName("javatest") - .withLicenseType("Windows_Server") - .create(); - - VirtualMachine foundVM = null; - PagedIterable vms = computeManager.virtualMachines().listByResourceGroup(rgName); - for (VirtualMachine vm1 : vms) { - if (vm1.name().equals(vmName)) { - foundVM = vm1; - break; - } - } - Assertions.assertNotNull(foundVM); - Assertions.assertEquals(regionProxPlacementGroup, foundVM.region()); - // Get - foundVM = computeManager.virtualMachines().getByResourceGroup(rgName, vmName); - Assertions.assertNotNull(foundVM); - Assertions.assertEquals(regionProxPlacementGroup, foundVM.region()); - Assertions.assertEquals("Windows_Server", foundVM.licenseType()); - - // Fetch instance view - PowerState powerState = foundVM.powerState(); - Assertions.assertEquals(powerState, PowerState.RUNNING); - VirtualMachineInstanceView instanceView = foundVM.instanceView(); - Assertions.assertNotNull(instanceView); - Assertions.assertNotNull(instanceView.statuses().size() > 0); - - Assertions.assertNotNull(foundVM.proximityPlacementGroup()); - Assertions.assertEquals(proxGroupType, foundVM.proximityPlacementGroup().proximityPlacementGroupType()); - Assertions.assertNotNull(foundVM.proximityPlacementGroup().availabilitySetIds()); - Assertions.assertFalse(foundVM.proximityPlacementGroup().availabilitySetIds().isEmpty()); - Assertions - .assertTrue( - setCreated.id().equalsIgnoreCase(foundVM.proximityPlacementGroup().availabilitySetIds().get(0))); - Assertions.assertNotNull(foundVM.proximityPlacementGroup().virtualMachineIds()); - Assertions.assertFalse(foundVM.proximityPlacementGroup().virtualMachineIds().isEmpty()); - Assertions - .assertTrue(foundVM.id().equalsIgnoreCase(setCreated.proximityPlacementGroup().virtualMachineIds().get(0))); - - // Update Vm to remove it from proximity placement group - VirtualMachine updatedVm = foundVM.update().withoutProximityPlacementGroup().apply(); - - Assertions.assertNotNull(updatedVm.proximityPlacementGroup()); - Assertions.assertEquals(proxGroupType, updatedVm.proximityPlacementGroup().proximityPlacementGroupType()); - Assertions.assertNotNull(updatedVm.proximityPlacementGroup().availabilitySetIds()); - Assertions.assertFalse(updatedVm.proximityPlacementGroup().availabilitySetIds().isEmpty()); - Assertions - .assertTrue( - setCreated.id().equalsIgnoreCase(updatedVm.proximityPlacementGroup().availabilitySetIds().get(0))); - - // TODO: this does not work... can not remove cvm from the placement group - // Assertions.assertNull(foundVM.proximityPlacementGroup().virtualMachineIds()); - - // Delete VM - computeManager.virtualMachines().deleteById(foundVM.id()); - computeManager.availabilitySets().deleteById(setCreated.id()); - } - - @Test - public void canCreateVirtualMachinesAndRelatedResourcesInParallel() throws Exception { - String vmNamePrefix = "vmz"; - String publicIpNamePrefix = generateRandomResourceName("pip-", 15); - String networkNamePrefix = generateRandomResourceName("vnet-", 15); - int count = 5; - - CreatablesInfo creatablesInfo = - prepareCreatableVirtualMachines(region, vmNamePrefix, networkNamePrefix, publicIpNamePrefix, count); - List> virtualMachineCreatables = creatablesInfo.virtualMachineCreatables; - List networkCreatableKeys = creatablesInfo.networkCreatableKeys; - List publicIpCreatableKeys = creatablesInfo.publicIpCreatableKeys; - - CreatedResources createdVirtualMachines = - computeManager.virtualMachines().create(virtualMachineCreatables); - Assertions.assertTrue(createdVirtualMachines.size() == count); - - Set virtualMachineNames = new HashSet<>(); - for (int i = 0; i < count; i++) { - virtualMachineNames.add(String.format("%s-%d", vmNamePrefix, i)); - } - for (VirtualMachine virtualMachine : createdVirtualMachines.values()) { - Assertions.assertTrue(virtualMachineNames.contains(virtualMachine.name())); - Assertions.assertNotNull(virtualMachine.id()); - } - - Set networkNames = new HashSet<>(); - for (int i = 0; i < count; i++) { - networkNames.add(String.format("%s-%d", networkNamePrefix, i)); - } - for (String networkCreatableKey : networkCreatableKeys) { - Network createdNetwork = (Network) createdVirtualMachines.createdRelatedResource(networkCreatableKey); - Assertions.assertNotNull(createdNetwork); - Assertions.assertTrue(networkNames.contains(createdNetwork.name())); - } - - Set publicIPAddressNames = new HashSet<>(); - for (int i = 0; i < count; i++) { - publicIPAddressNames.add(String.format("%s-%d", publicIpNamePrefix, i)); - } - for (String publicIpCreatableKey : publicIpCreatableKeys) { - PublicIpAddress createdPublicIpAddress = - (PublicIpAddress) createdVirtualMachines.createdRelatedResource(publicIpCreatableKey); - Assertions.assertNotNull(createdPublicIpAddress); - Assertions.assertTrue(publicIPAddressNames.contains(createdPublicIpAddress.name())); - } - } - - @Test - public void canStreamParallelCreatedVirtualMachinesAndRelatedResources() throws Exception { - String vmNamePrefix = "vmz"; - String publicIpNamePrefix = generateRandomResourceName("pip-", 15); - String networkNamePrefix = generateRandomResourceName("vnet-", 15); - int count = 5; - - final Set virtualMachineNames = new HashSet<>(); - for (int i = 0; i < count; i++) { - virtualMachineNames.add(String.format("%s-%d", vmNamePrefix, i)); - } - - final Set networkNames = new HashSet<>(); - for (int i = 0; i < count; i++) { - networkNames.add(String.format("%s-%d", networkNamePrefix, i)); - } - - final Set publicIPAddressNames = new HashSet<>(); - for (int i = 0; i < count; i++) { - publicIPAddressNames.add(String.format("%s-%d", publicIpNamePrefix, i)); - } - - final CreatablesInfo creatablesInfo = - prepareCreatableVirtualMachines(region, vmNamePrefix, networkNamePrefix, publicIpNamePrefix, count); - final AtomicInteger resourceCount = new AtomicInteger(0); - List> virtualMachineCreatables = creatablesInfo.virtualMachineCreatables; - computeManager - .virtualMachines() - .createAsync(virtualMachineCreatables) - .map( - createdResource -> { - if (createdResource instanceof Resource) { - Resource resource = (Resource) createdResource; - System.out.println("Created: " + resource.id()); - if (resource instanceof VirtualMachine) { - VirtualMachine virtualMachine = (VirtualMachine) resource; - Assertions.assertTrue(virtualMachineNames.contains(virtualMachine.name())); - Assertions.assertNotNull(virtualMachine.id()); - } else if (resource instanceof Network) { - Network network = (Network) resource; - Assertions.assertTrue(networkNames.contains(network.name())); - Assertions.assertNotNull(network.id()); - } else if (resource instanceof PublicIpAddress) { - PublicIpAddress publicIPAddress = (PublicIpAddress) resource; - Assertions.assertTrue(publicIPAddressNames.contains(publicIPAddress.name())); - Assertions.assertNotNull(publicIPAddress.id()); - } - } - resourceCount.incrementAndGet(); - return createdResource; - }) - .blockLast(); - - networkNames.forEach(name -> { - Assertions.assertNotNull(networkManager.networks().getByResourceGroup(rgName, name)); - }); - - publicIPAddressNames.forEach(name -> { - Assertions.assertNotNull(networkManager.publicIpAddresses().getByResourceGroup(rgName, name)); - }); - - Assertions.assertEquals(1, storageManager.storageAccounts().listByResourceGroup(rgName).stream().count()); - Assertions.assertEquals(count, networkManager.networkInterfaces().listByResourceGroup(rgName).stream().count()); - - Assertions.assertEquals(count, resourceCount.get()); - } - - @Test - public void canSetStorageAccountForUnmanagedDisk() { - final String storageName = generateRandomResourceName("st", 14); - // Create a premium storage account for virtual machine data disk - // - StorageAccount storageAccount = - storageManager - .storageAccounts() - .define(storageName) - .withRegion(region) - .withNewResourceGroup(rgName) - .withSku(StorageAccountSkuType.PREMIUM_LRS) - .create(); - - // Creates a virtual machine with an unmanaged data disk that gets stored in the above - // premium storage account - // - VirtualMachine virtualMachine = - computeManager - .virtualMachines() - .define(vmName) - .withRegion(region) - .withExistingResourceGroup(rgName) - .withNewPrimaryNetwork("10.0.0.0/28") - .withPrimaryPrivateIPAddressDynamic() - .withoutPrimaryPublicIPAddress() - .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) - .withRootUsername("Foo12") - .withSsh(sshPublicKey()) - .withUnmanagedDisks() - .defineUnmanagedDataDisk("disk1") - .withNewVhd(100) - .withLun(2) - .storeAt(storageAccount.name(), "diskvhds", "datadisk1vhd.vhd") - .attach() - .defineUnmanagedDataDisk("disk2") - .withNewVhd(100) - .withLun(3) - .storeAt(storageAccount.name(), "diskvhds", "datadisk2vhd.vhd") - .attach() - .withSize(VirtualMachineSizeTypes.fromString("Standard_D2as_v4")) - .withOSDiskCaching(CachingTypes.READ_WRITE) - .create(); - - // Validate the unmanaged data disks - // - Map unmanagedDataDisks = virtualMachine.unmanagedDataDisks(); - Assertions.assertNotNull(unmanagedDataDisks); - Assertions.assertEquals(2, unmanagedDataDisks.size()); - VirtualMachineUnmanagedDataDisk firstUnmanagedDataDisk = unmanagedDataDisks.get(2); - Assertions.assertNotNull(firstUnmanagedDataDisk); - VirtualMachineUnmanagedDataDisk secondUnmanagedDataDisk = unmanagedDataDisks.get(3); - Assertions.assertNotNull(secondUnmanagedDataDisk); - String createdVhdUri1 = firstUnmanagedDataDisk.vhdUri(); - String createdVhdUri2 = secondUnmanagedDataDisk.vhdUri(); - Assertions.assertNotNull(createdVhdUri1); - Assertions.assertNotNull(createdVhdUri2); - // delete the virtual machine - // - computeManager.virtualMachines().deleteById(virtualMachine.id()); - // Creates another virtual machine by attaching existing unmanaged data disk detached from the - // above virtual machine. - // - virtualMachine = - computeManager - .virtualMachines() - .define(vmName) - .withRegion(region) - .withExistingResourceGroup(rgName) - .withNewPrimaryNetwork("10.0.0.0/28") - .withPrimaryPrivateIPAddressDynamic() - .withoutPrimaryPublicIPAddress() - .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) - .withRootUsername("Foo12") - .withSsh(sshPublicKey()) - .withUnmanagedDisks() - .withExistingUnmanagedDataDisk(storageAccount.name(), "diskvhds", "datadisk1vhd.vhd") - .withSize(VirtualMachineSizeTypes.fromString("Standard_D2as_v4")) - .create(); - // Gets the vm - // - virtualMachine = computeManager.virtualMachines().getById(virtualMachine.id()); - // Validate the unmanaged data disks - // - unmanagedDataDisks = virtualMachine.unmanagedDataDisks(); - Assertions.assertNotNull(unmanagedDataDisks); - Assertions.assertEquals(1, unmanagedDataDisks.size()); - firstUnmanagedDataDisk = null; - for (VirtualMachineUnmanagedDataDisk unmanagedDisk : unmanagedDataDisks.values()) { - firstUnmanagedDataDisk = unmanagedDisk; - break; - } - Assertions.assertNotNull(firstUnmanagedDataDisk.vhdUri()); - Assertions.assertTrue(firstUnmanagedDataDisk.vhdUri().equalsIgnoreCase(createdVhdUri1)); - // Update the VM by attaching another existing data disk - // - virtualMachine - .update() - .withExistingUnmanagedDataDisk(storageAccount.name(), "diskvhds", "datadisk2vhd.vhd") - .apply(); - // Gets the vm - // - virtualMachine = computeManager.virtualMachines().getById(virtualMachine.id()); - // Validate the unmanaged data disks - // - unmanagedDataDisks = virtualMachine.unmanagedDataDisks(); - Assertions.assertNotNull(unmanagedDataDisks); - Assertions.assertEquals(2, unmanagedDataDisks.size()); - } - - @Test - public void canUpdateTagsOnVM() { - // Create - VirtualMachine virtualMachine = - computeManager - .virtualMachines() - .define(vmName) - .withRegion(region) - .withNewResourceGroup(rgName) - .withNewPrimaryNetwork("10.0.0.0/28") - .withPrimaryPrivateIPAddressDynamic() - .withoutPrimaryPublicIPAddress() - .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) - .withRootUsername("firstuser") - .withSsh(sshPublicKey()) - .withSize(VirtualMachineSizeTypes.fromString("Standard_D2a_v4")) - .create(); - - // checking to see if withTag correctly update - virtualMachine.update().withTag("test", "testValue").apply(); - Assertions.assertEquals("testValue", virtualMachine.innerModel().tags().get("test")); - - // checking to see if withTags correctly updates - Map testTags = new HashMap(); - testTags.put("testTag", "testValue"); - virtualMachine.update().withTags(testTags).apply(); - Assertions.assertEquals(testTags.get("testTag"), virtualMachine.innerModel().tags().get("testTag")); - } - - @Test - public void canRunScriptOnVM() { - // Create - VirtualMachine virtualMachine = - computeManager - .virtualMachines() - .define(vmName) - .withRegion(region) - .withNewResourceGroup(rgName) - .withNewPrimaryNetwork("10.0.0.0/28") - .withPrimaryPrivateIPAddressDynamic() - .withoutPrimaryPublicIPAddress() - .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) - .withRootUsername("firstuser") - .withSsh(sshPublicKey()) - .create(); - - List installGit = new ArrayList<>(); - installGit.add("sudo apt-get update"); - installGit.add("sudo apt-get install -y git"); - - RunCommandResult runResult = - virtualMachine.runShellScript(installGit, new ArrayList()); - Assertions.assertNotNull(runResult); - Assertions.assertNotNull(runResult.value()); - Assertions.assertTrue(runResult.value().size() > 0); - } - - @Test - @DoNotRecord(skipInPlayback = true) - public void canPerformSimulateEvictionOnSpotVirtualMachine() { - VirtualMachine virtualMachine = computeManager.virtualMachines() - .define(vmName) - .withRegion(region) - .withNewResourceGroup(rgName) - .withNewPrimaryNetwork("10.0.0.0/28") - .withPrimaryPrivateIPAddressDynamic() - .withoutPrimaryPublicIPAddress() - .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) - .withRootUsername("firstuser") - .withSsh(sshPublicKey()) - .withSpotPriority(VirtualMachineEvictionPolicyTypes.DEALLOCATE) - .withSize(VirtualMachineSizeTypes.fromString("Standard_D2a_v4")) - .create(); - - Assertions.assertNotNull(virtualMachine.osDiskStorageAccountType()); - Assertions.assertTrue(virtualMachine.osDiskSize() > 0); - Disk disk = computeManager.disks().getById(virtualMachine.osDiskId()); - Assertions.assertNotNull(disk); - Assertions.assertEquals(DiskState.ATTACHED, disk.innerModel().diskState()); - - // call simulate eviction - virtualMachine.simulateEviction(); - boolean deallocated = false; - int pollIntervalInMinutes = 5; - for (int i = 0; i < 30; i += pollIntervalInMinutes) { - ResourceManagerUtils.sleep(Duration.ofMinutes(pollIntervalInMinutes)); - - virtualMachine = computeManager.virtualMachines().getById(virtualMachine.id()); - if (virtualMachine.powerState() == PowerState.DEALLOCATED) { - deallocated = true; - break; - } - } - Assertions.assertTrue(deallocated); - - virtualMachine = computeManager.virtualMachines().getById(virtualMachine.id()); - Assertions.assertNotNull(virtualMachine); - Assertions.assertNull(virtualMachine.osDiskStorageAccountType()); - Assertions.assertEquals(0, virtualMachine.osDiskSize()); - disk = computeManager.disks().getById(virtualMachine.osDiskId()); - Assertions.assertEquals(DiskState.RESERVED, disk.innerModel().diskState()); - } - - @Test - @Disabled("'Force deletion of VM is not supported in this region' error while running") - public void canForceDeleteVirtualMachine() { - // Create - computeManager.virtualMachines() - .define(vmName) - .withRegion(locationOrDefault("eastus2euap")) - .withNewResourceGroup(rgName) - .withNewPrimaryNetwork("10.0.0.0/28") - .withPrimaryPrivateIPAddressDynamic() - .withoutPrimaryPublicIPAddress() - .withPopularWindowsImage(KnownWindowsVirtualMachineImage.WINDOWS_SERVER_2012_R2_DATACENTER) - .withAdminUsername("Foo12") - .withAdminPassword("abc!@#F0orL") - .create(); - // Get - VirtualMachine virtualMachine = computeManager.virtualMachines().getByResourceGroup(rgName, vmName); - Assertions.assertNotNull(virtualMachine); - Assertions.assertEquals(locationOrDefault(Region.fromName("eastus2euap")), virtualMachine.region()); - String nicId = virtualMachine.primaryNetworkInterfaceId(); - - // Force delete - computeManager.virtualMachines().deleteById(virtualMachine.id(), true); - - try { - virtualMachine = computeManager.virtualMachines().getById(virtualMachine.id()); - } catch (ManagementException ex) { - virtualMachine = null; - Assertions.assertEquals(404, ex.getResponse().getStatusCode()); - } - Assertions.assertNull(virtualMachine); - - // check if nic exists after force delete vm - NetworkInterface nic = networkManager.networkInterfaces().getById(nicId); - Assertions.assertNotNull(nic); - } - - private CreatablesInfo prepareCreatableVirtualMachines( - Region region, String vmNamePrefix, String networkNamePrefix, String publicIpNamePrefix, int vmCount) { - - Creatable resourceGroupCreatable = - resourceManager.resourceGroups().define(rgName).withRegion(region); - - Creatable storageAccountCreatable = - storageManager - .storageAccounts() - .define(generateRandomResourceName("stg", 20)) - .withRegion(region) - .withNewResourceGroup(resourceGroupCreatable); - - List networkCreatableKeys = new ArrayList<>(); - List publicIpCreatableKeys = new ArrayList<>(); - List> virtualMachineCreatables = new ArrayList<>(); - for (int i = 0; i < vmCount; i++) { - Creatable networkCreatable = - networkManager - .networks() - .define(String.format("%s-%d", networkNamePrefix, i)) - .withRegion(region) - .withNewResourceGroup(resourceGroupCreatable) - .withAddressSpace("10.0.0.0/28"); - networkCreatableKeys.add(networkCreatable.key()); - - Creatable publicIPAddressCreatable = - networkManager - .publicIpAddresses() - .define(String.format("%s-%d", publicIpNamePrefix, i)) - .withRegion(region) - .withNewResourceGroup(resourceGroupCreatable); - publicIpCreatableKeys.add(publicIPAddressCreatable.key()); - - Creatable virtualMachineCreatable = - computeManager - .virtualMachines() - .define(String.format("%s-%d", vmNamePrefix, i)) - .withRegion(region) - .withNewResourceGroup(resourceGroupCreatable) - .withNewPrimaryNetwork(networkCreatable) - .withPrimaryPrivateIPAddressDynamic() - .withNewPrimaryPublicIPAddress(publicIPAddressCreatable) - .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) - .withRootUsername("tirekicker") - .withSsh(sshPublicKey()) - .withUnmanagedDisks() - .withNewStorageAccount(storageAccountCreatable); - - virtualMachineCreatables.add(virtualMachineCreatable); - } - CreatablesInfo creatablesInfo = new CreatablesInfo(); - creatablesInfo.virtualMachineCreatables = virtualMachineCreatables; - creatablesInfo.networkCreatableKeys = networkCreatableKeys; - creatablesInfo.publicIpCreatableKeys = publicIpCreatableKeys; - return creatablesInfo; - } - - class CreatablesInfo { - private List> virtualMachineCreatables; - List networkCreatableKeys; - List publicIpCreatableKeys; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/VirtualMachinePopularImageTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/VirtualMachinePopularImageTests.java deleted file mode 100644 index 47cfdfc56e13..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/VirtualMachinePopularImageTests.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute; - -import com.azure.core.test.annotation.DoNotRecord; -import com.azure.resourcemanager.compute.models.KnownLinuxVirtualMachineImage; -import com.azure.resourcemanager.compute.models.KnownWindowsVirtualMachineImage; -import com.azure.resourcemanager.compute.models.VirtualMachine; -import com.azure.resourcemanager.compute.models.VirtualMachineSizeTypes; -import com.azure.core.management.Region; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.stream.Collectors; - -public class VirtualMachinePopularImageTests extends ComputeManagementTest { - private String rgName = ""; - - @Test - @DoNotRecord - public void canCreateAllPopularImageVM() { - if (skipInPlayback()) { - return; - } - - rgName = generateRandomResourceName("rg", 10); - List> vmMonos = new ArrayList<>(); - for (KnownWindowsVirtualMachineImage image : KnownWindowsVirtualMachineImage.values()) { - Mono mono = computeManager.virtualMachines() - .define(generateRandomResourceName("vm", 10)) - .withRegion(locationOrDefault(Region.US_SOUTH_CENTRAL)) - .withNewResourceGroup(rgName) - .withNewPrimaryNetwork("10.0.0.0/24") - .withPrimaryPrivateIPAddressDynamic() - .withoutPrimaryPublicIPAddress() - .withPopularWindowsImage(image) - .withAdminUsername("testUser") - .withAdminPassword(password()) - .withSize(VirtualMachineSizeTypes.fromString("Standard_D2a_v4")) - .createAsync(); - vmMonos.add(mono); - } - - for (KnownLinuxVirtualMachineImage image : Arrays.stream(KnownLinuxVirtualMachineImage.values()) - .filter(image -> image != KnownLinuxVirtualMachineImage.OPENSUSE_LEAP_15_1 && image != KnownLinuxVirtualMachineImage.SLES_15_SP1) - .collect(Collectors.toList())) { - - Mono mono = computeManager.virtualMachines() - .define(generateRandomResourceName("vm", 10)) - .withRegion(locationOrDefault(Region.US_SOUTH_CENTRAL)) - .withNewResourceGroup(rgName) - .withNewPrimaryNetwork("10.0.0.0/24") - .withPrimaryPrivateIPAddressDynamic() - .withoutPrimaryPublicIPAddress() - .withPopularLinuxImage(image) - .withRootUsername("testUser") - .withSsh(sshPublicKey()) - .withSize(VirtualMachineSizeTypes.fromString("Standard_D2a_v4")) - .createAsync(); - vmMonos.add(mono); - } - - Flux.merge(vmMonos).blockLast(); - } - - @Override - protected void cleanUpResources() { - resourceManager.resourceGroups().beginDeleteByName(rgName); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/VirtualMachineRelatedResourcesDeletionTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/VirtualMachineRelatedResourcesDeletionTests.java deleted file mode 100644 index 458fefd5f90d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/VirtualMachineRelatedResourcesDeletionTests.java +++ /dev/null @@ -1,262 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute; - -import com.azure.core.http.HttpPipeline; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.test.annotation.DoNotRecord; -import com.azure.resourcemanager.compute.models.AvailabilitySet; -import com.azure.resourcemanager.compute.models.KnownLinuxVirtualMachineImage; -import com.azure.resourcemanager.compute.models.VirtualMachine; -import com.azure.resourcemanager.compute.models.VirtualMachineSizeTypes; -import com.azure.resourcemanager.network.models.Network; -import com.azure.resourcemanager.network.models.NetworkInterface; -import com.azure.resourcemanager.network.models.PublicIpAddress; -import com.azure.resourcemanager.resources.models.ResourceGroup; -import com.azure.resourcemanager.test.utils.TestUtilities; -import com.azure.core.management.Region; -import com.azure.resourcemanager.resources.fluentcore.arm.models.Resource; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.storage.models.StorageAccount; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public class VirtualMachineRelatedResourcesDeletionTests extends ComputeManagementTest { - - private String rgName = ""; - - @Override - protected void initializeClients(HttpPipeline httpPipeline, AzureProfile profile) { - rgName = generateRandomResourceName("javacsmrg", 15); - super.initializeClients(httpPipeline, profile); - } - - @Override - protected void cleanUpResources() { - if (resourceManager != null) { - resourceManager.resourceGroups().beginDeleteByName(rgName); - } - } - - @Test - @DoNotRecord - public void canDeleteRelatedResourcesFromFailedParallelVMCreations() { - if (skipInPlayback()) { - return; - } - - final int desiredVMCount = 40; - final Region region = locationOrDefault(Region.US_EAST); - final String resourceGroupName = rgName; - - // Create one resource group for everything, to ensure no reliance on resource groups - ResourceGroup resourceGroup = - resourceManager.resourceGroups().define(resourceGroupName).withRegion(region).create(); - - // Needed for tracking related resources - final Map>> vmNonNicResourceDefinitions = new HashMap<>(); - final Map> nicDefinitions = - new HashMap<>(); // Tracking NICs separately because they have to be deleted first - final Map> vmDefinitions = new HashMap<>(); - final Map createdResourceIds = new HashMap<>(); - final List errors = new ArrayList<>(); - - // Prepare a number of VM definitions along with their related resource definitions - for (int i = 0; i < desiredVMCount; i++) { - Collection> relatedDefinitions = new ArrayList<>(); - - // Define a network for each VM - String networkName = generateRandomResourceName("net", 14); - Creatable networkDefinition = - networkManager - .networks() - .define(networkName) - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .withAddressSpace("10.0." + i + ".0/29"); - relatedDefinitions.add(networkDefinition); - - // Define a PIP for each VM - String pipName = generateRandomResourceName("pip", 14); - PublicIpAddress.DefinitionStages.WithCreate pipDefinition = - this - .networkManager - .publicIpAddresses() - .define(pipName) - .withRegion(region) - .withExistingResourceGroup(resourceGroup); - relatedDefinitions.add(pipDefinition); - - // Define a NIC for each VM - String nicName = generateRandomResourceName("nic", 14); - Creatable nicDefinition = - networkManager - .networkInterfaces() - .define(nicName) - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .withNewPrimaryNetwork(networkDefinition) - .withPrimaryPrivateIPAddressDynamic() - .withNewPrimaryPublicIPAddress(pipDefinition); - - // Define a storage account for each VM - String storageAccountName = generateRandomResourceName("st", 14); - Creatable storageAccountDefinition = - storageManager - .storageAccounts() - .define(storageAccountName) - .withRegion(region) - .withExistingResourceGroup(resourceGroup); - relatedDefinitions.add(storageAccountDefinition); - - // Define an availability set for each VM - String availabilitySetName = generateRandomResourceName("as", 14); - Creatable availabilitySetDefinition = - computeManager - .availabilitySets() - .define(availabilitySetName) - .withRegion(region) - .withExistingResourceGroup(resourceGroup); - relatedDefinitions.add(availabilitySetDefinition); - - String vmName = generateRandomResourceName("vm", 14); - - // Define a VM - String userName; - if (i == desiredVMCount / 2) { - // Intentionally cause a failure in one of the VMs - userName = ""; - } else { - userName = "tester"; - } - Creatable vmDefinition = - computeManager - .virtualMachines() - .define(vmName) - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .withNewPrimaryNetworkInterface(nicDefinition) - .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) - .withRootUsername(userName) - .withSsh(sshPublicKey()) - .withNewStorageAccount(storageAccountDefinition) - .withSize(VirtualMachineSizeTypes.fromString("Standard_D2a_v4")) - .withNewAvailabilitySet(availabilitySetDefinition); - - // Keep track of all the related resource definitions based on the VM definition - vmNonNicResourceDefinitions.put(vmDefinition.key(), relatedDefinitions); - nicDefinitions.put(vmDefinition.key(), nicDefinition); - vmDefinitions.put(vmDefinition.key(), vmDefinition); - } - - // Start the parallel creation of everything - computeManager - .virtualMachines() - .createAsync(new ArrayList<>(vmDefinitions.values())) - .map( - createdResource -> { - if (createdResource instanceof Resource) { - Resource resource = (Resource) createdResource; - System.out.println("Created: " + resource.id()); - if (resource instanceof VirtualMachine) { - VirtualMachine virtualMachine = (VirtualMachine) resource; - - // Record that this VM was created successfully - vmDefinitions.remove(virtualMachine.key()); - - // Remove the associated resources from cleanup list - vmNonNicResourceDefinitions.remove(virtualMachine.key()); - - // Remove the associated NIC from cleanup list - nicDefinitions.remove(virtualMachine.key()); - } else { - // Add this related resource to potential cleanup list - createdResourceIds.put(resource.key(), resource.id()); - } - } - return createdResource; - }) - .onErrorResume( - e -> { - errors.add(e); - return Mono.empty(); - }) - .singleOrEmpty(); - - // Delete remaining successfully created NICs of failed VM creations - Collection nicIdsToDelete = new ArrayList<>(); - for (Creatable nicDefinition : nicDefinitions.values()) { - String nicId = createdResourceIds.get(nicDefinition.key()); - if (nicId != null) { - nicIdsToDelete.add(nicId); - } - } - if (!nicIdsToDelete.isEmpty()) { - networkManager.networkInterfaces().deleteByIds(nicIdsToDelete); - } - - // Delete remaining successfully created resources of failed VM creations - Collection> deleteObservables = new ArrayList<>(); - for (Collection> relatedResources : vmNonNicResourceDefinitions.values()) { - for (Creatable resource : relatedResources) { - String createdResourceId = createdResourceIds.get(resource.key()); - if (createdResourceId != null) { - deleteObservables.add(resourceManager.genericResources().deleteByIdAsync(createdResourceId)); - } - } - } - - // Delete as much as possible, postponing the errors till the end - Flux.mergeSequentialDelayError(deleteObservables, 5, 3); - - // Show any errors - for (Throwable error : errors) { - System.out.println("\n### ERROR ###\n"); - if (error instanceof ManagementException) { - ManagementException ce = (ManagementException) error; - System.out.println("CLOUD EXCEPTION: " + ce.getMessage()); - } else { - error.printStackTrace(); - } - } - - System.out.println("Number of failed/cleaned up VM creations: " + vmNonNicResourceDefinitions.size()); - - // Verifications - final int successfulVMCount = desiredVMCount - vmNonNicResourceDefinitions.size(); - final int actualVMCount = - TestUtilities.getSize(computeManager.virtualMachines().listByResourceGroup(resourceGroupName)); - System.out.println("Number of actual successful VMs: " + actualVMCount); - - Assertions.assertEquals(successfulVMCount, actualVMCount); - final int actualNicCount = - TestUtilities.getSize(networkManager.networkInterfaces().listByResourceGroup(resourceGroupName)); - Assertions.assertEquals(successfulVMCount, actualNicCount); - final int actualNetworkCount = - TestUtilities.getSize(networkManager.networks().listByResourceGroup(resourceGroupName)); - Assertions.assertEquals(successfulVMCount, actualNetworkCount); - final int actualPipCount = - TestUtilities.getSize(networkManager.publicIpAddresses().listByResourceGroup(resourceGroupName)); - Assertions.assertEquals(successfulVMCount, actualPipCount); - final int actualAvailabilitySetCount = - TestUtilities.getSize(computeManager.availabilitySets().listByResourceGroup(resourceGroupName)); - Assertions.assertEquals(successfulVMCount, actualAvailabilitySetCount); - final int actualStorageAccountCount = - TestUtilities.getSize(storageManager.storageAccounts().listByResourceGroup(resourceGroupName)); - Assertions.assertEquals(successfulVMCount, actualStorageAccountCount); - - // Verify that at least one VM failed. - // TODO: Ideally only one, but today the internal RX logic terminates eagerly -- need to change that for - // parallel creation to terminate more "lazily" in the future - Assertions.assertTrue(successfulVMCount < desiredVMCount); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/VirtualMachineScaleSetBootDiagnosticsTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/VirtualMachineScaleSetBootDiagnosticsTests.java deleted file mode 100644 index a54607461fcc..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/VirtualMachineScaleSetBootDiagnosticsTests.java +++ /dev/null @@ -1,507 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute; - -import com.azure.core.http.HttpPipeline; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineScaleSetInner; -import com.azure.resourcemanager.compute.models.KnownLinuxVirtualMachineImage; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSet; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetSkuTypes; -import com.azure.resourcemanager.network.models.LoadBalancer; -import com.azure.resourcemanager.network.models.LoadBalancerSkuType; -import com.azure.resourcemanager.network.models.Network; -import com.azure.resourcemanager.resources.models.ResourceGroup; -import com.azure.core.management.Region; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.storage.models.StorageAccount; -import java.util.ArrayList; -import java.util.List; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public class VirtualMachineScaleSetBootDiagnosticsTests extends ComputeManagementTest { - private String rgName = ""; - private final Region region = locationOrDefault(Region.US_SOUTH_CENTRAL); - private final String vmName = "javavm"; - - @Override - protected void initializeClients(HttpPipeline httpPipeline, AzureProfile profile) { - rgName = generateRandomResourceName("javacsmrg", 15); - super.initializeClients(httpPipeline, profile); - } - - @Override - protected void cleanUpResources() { - resourceManager.resourceGroups().beginDeleteByName(rgName); - } - - @Test - public void canEnableBootDiagnosticsWithImplicitStorageOnManagedVMSSCreation() throws Exception { - final String vmssName = generateRandomResourceName("vmss", 10); - - ResourceGroup resourceGroup = this.resourceManager.resourceGroups().define(rgName).withRegion(region).create(); - - Network network = - this - .networkManager - .networks() - .define("vmssvnet") - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .withAddressSpace("10.0.0.0/28") - .withSubnet("subnet1", "10.0.0.0/28") - .create(); - - LoadBalancer publicLoadBalancer = - createInternetFacingLoadBalancer(region, resourceGroup, "1", LoadBalancerSkuType.BASIC); - - List backends = new ArrayList<>(); - for (String backend : publicLoadBalancer.backends().keySet()) { - backends.add(backend); - } - Assertions.assertTrue(backends.size() == 2); - - VirtualMachineScaleSet virtualMachineScaleSet = - this - .computeManager - .virtualMachineScaleSets() - .define(vmssName) - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .withSku(VirtualMachineScaleSetSkuTypes.STANDARD_A0) - .withExistingPrimaryNetworkSubnet(network, "subnet1") - .withExistingPrimaryInternetFacingLoadBalancer(publicLoadBalancer) - .withPrimaryInternetFacingLoadBalancerBackends(backends.get(0), backends.get(1)) - .withoutPrimaryInternalLoadBalancer() - .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) - .withRootUsername("jvuser") - .withSsh(sshPublicKey()) - .withBootDiagnostics() - .create(); - - Assertions.assertNotNull(virtualMachineScaleSet); - Assertions.assertTrue(virtualMachineScaleSet.isBootDiagnosticsEnabled()); - Assertions.assertNotNull(virtualMachineScaleSet.bootDiagnosticsStorageUri()); - } - - @Test - public void canEnableBootDiagnosticsWithCreatableStorageOnManagedVMSSCreation() throws Exception { - final String vmssName = generateRandomResourceName("vmss", 10); - final String storageName = generateRandomResourceName("st", 14); - - ResourceGroup resourceGroup = this.resourceManager.resourceGroups().define(rgName).withRegion(region).create(); - - Network network = - this - .networkManager - .networks() - .define("vmssvnet") - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .withAddressSpace("10.0.0.0/28") - .withSubnet("subnet1", "10.0.0.0/28") - .create(); - - LoadBalancer publicLoadBalancer = - createInternetFacingLoadBalancer(region, resourceGroup, "1", LoadBalancerSkuType.BASIC); - - List backends = new ArrayList<>(); - for (String backend : publicLoadBalancer.backends().keySet()) { - backends.add(backend); - } - Assertions.assertTrue(backends.size() == 2); - - Creatable creatableStorageAccount = - storageManager.storageAccounts().define(storageName).withRegion(region).withExistingResourceGroup(rgName); - - VirtualMachineScaleSet virtualMachineScaleSet = - this - .computeManager - .virtualMachineScaleSets() - .define(vmssName) - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .withSku(VirtualMachineScaleSetSkuTypes.STANDARD_A0) - .withExistingPrimaryNetworkSubnet(network, "subnet1") - .withExistingPrimaryInternetFacingLoadBalancer(publicLoadBalancer) - .withPrimaryInternetFacingLoadBalancerBackends(backends.get(0), backends.get(1)) - .withoutPrimaryInternalLoadBalancer() - .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) - .withRootUsername("jvuser") - .withSsh(sshPublicKey()) - .withBootDiagnostics(creatableStorageAccount) - .create(); - - Assertions.assertNotNull(virtualMachineScaleSet); - Assertions.assertTrue(virtualMachineScaleSet.isBootDiagnosticsEnabled()); - Assertions.assertNotNull(virtualMachineScaleSet.bootDiagnosticsStorageUri()); - Assertions.assertTrue(virtualMachineScaleSet.bootDiagnosticsStorageUri().contains(storageName)); - } - - @Test - public void canEnableBootDiagnosticsWithExplicitStorageOnManagedVMSSCreation() throws Exception { - final String vmssName = generateRandomResourceName("vmss", 10); - final String storageName = generateRandomResourceName("st", 14); - - ResourceGroup resourceGroup = this.resourceManager.resourceGroups().define(rgName).withRegion(region).create(); - - Network network = - this - .networkManager - .networks() - .define("vmssvnet") - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .withAddressSpace("10.0.0.0/28") - .withSubnet("subnet1", "10.0.0.0/28") - .create(); - - LoadBalancer publicLoadBalancer = - createInternetFacingLoadBalancer(region, resourceGroup, "1", LoadBalancerSkuType.BASIC); - - List backends = new ArrayList<>(); - for (String backend : publicLoadBalancer.backends().keySet()) { - backends.add(backend); - } - Assertions.assertTrue(backends.size() == 2); - - StorageAccount storageAccount = - storageManager - .storageAccounts() - .define(storageName) - .withRegion(region) - .withNewResourceGroup(rgName) - .create(); - - VirtualMachineScaleSet virtualMachineScaleSet = - this - .computeManager - .virtualMachineScaleSets() - .define(vmssName) - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .withSku(VirtualMachineScaleSetSkuTypes.STANDARD_A0) - .withExistingPrimaryNetworkSubnet(network, "subnet1") - .withExistingPrimaryInternetFacingLoadBalancer(publicLoadBalancer) - .withPrimaryInternetFacingLoadBalancerBackends(backends.get(0), backends.get(1)) - .withoutPrimaryInternalLoadBalancer() - .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) - .withRootUsername("jvuser") - .withSsh(sshPublicKey()) - .withBootDiagnostics(storageAccount) - .create(); - - Assertions.assertNotNull(virtualMachineScaleSet); - Assertions.assertTrue(virtualMachineScaleSet.isBootDiagnosticsEnabled()); - Assertions.assertNotNull(virtualMachineScaleSet.bootDiagnosticsStorageUri()); - Assertions.assertTrue(virtualMachineScaleSet.bootDiagnosticsStorageUri().contains(storageName)); - } - - @Test - public void canDisableVMSSBootDiagnostics() throws Exception { - final String vmssName = generateRandomResourceName("vmss", 10); - - ResourceGroup resourceGroup = this.resourceManager.resourceGroups().define(rgName).withRegion(region).create(); - - Network network = - this - .networkManager - .networks() - .define("vmssvnet") - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .withAddressSpace("10.0.0.0/28") - .withSubnet("subnet1", "10.0.0.0/28") - .create(); - - LoadBalancer publicLoadBalancer = - createInternetFacingLoadBalancer(region, resourceGroup, "1", LoadBalancerSkuType.BASIC); - - List backends = new ArrayList<>(); - for (String backend : publicLoadBalancer.backends().keySet()) { - backends.add(backend); - } - Assertions.assertTrue(backends.size() == 2); - - VirtualMachineScaleSet virtualMachineScaleSet = - this - .computeManager - .virtualMachineScaleSets() - .define(vmssName) - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .withSku(VirtualMachineScaleSetSkuTypes.STANDARD_A0) - .withExistingPrimaryNetworkSubnet(network, "subnet1") - .withExistingPrimaryInternetFacingLoadBalancer(publicLoadBalancer) - .withPrimaryInternetFacingLoadBalancerBackends(backends.get(0), backends.get(1)) - .withoutPrimaryInternalLoadBalancer() - .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) - .withRootUsername("jvuser") - .withSsh(sshPublicKey()) - .withBootDiagnostics() - .create(); - - Assertions.assertNotNull(virtualMachineScaleSet); - Assertions.assertTrue(virtualMachineScaleSet.isBootDiagnosticsEnabled()); - Assertions.assertNotNull(virtualMachineScaleSet.bootDiagnosticsStorageUri()); - - virtualMachineScaleSet.update().withoutBootDiagnostics().apply(); - - Assertions.assertFalse(virtualMachineScaleSet.isBootDiagnosticsEnabled()); - // Disabling boot diagnostics will not remove the storage uri from the vm payload. - Assertions.assertNotNull(virtualMachineScaleSet.bootDiagnosticsStorageUri()); - } - - @Test - public void bootDiagnosticsShouldUsesVMSSOSUnManagedDiskImplicitStorage() throws Exception { - final String vmssName = generateRandomResourceName("vmss", 10); - - ResourceGroup resourceGroup = this.resourceManager.resourceGroups().define(rgName).withRegion(region).create(); - - Network network = - this - .networkManager - .networks() - .define("vmssvnet") - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .withAddressSpace("10.0.0.0/28") - .withSubnet("subnet1", "10.0.0.0/28") - .create(); - - LoadBalancer publicLoadBalancer = - createInternetFacingLoadBalancer(region, resourceGroup, "1", LoadBalancerSkuType.BASIC); - - List backends = new ArrayList<>(); - for (String backend : publicLoadBalancer.backends().keySet()) { - backends.add(backend); - } - Assertions.assertTrue(backends.size() == 2); - - VirtualMachineScaleSet virtualMachineScaleSet = - this - .computeManager - .virtualMachineScaleSets() - .define(vmssName) - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .withSku(VirtualMachineScaleSetSkuTypes.STANDARD_A0) - .withExistingPrimaryNetworkSubnet(network, "subnet1") - .withExistingPrimaryInternetFacingLoadBalancer(publicLoadBalancer) - .withPrimaryInternetFacingLoadBalancerBackends(backends.get(0), backends.get(1)) - .withoutPrimaryInternalLoadBalancer() - .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) - .withRootUsername("jvuser") - .withSsh(sshPublicKey()) - .withUnmanagedDisks() - .withBootDiagnostics() - .create(); - - Assertions.assertNotNull(virtualMachineScaleSet); - Assertions.assertTrue(virtualMachineScaleSet.isBootDiagnosticsEnabled()); - Assertions.assertNotNull(virtualMachineScaleSet.bootDiagnosticsStorageUri()); - - VirtualMachineScaleSetInner inner = virtualMachineScaleSet.innerModel(); - Assertions.assertNotNull(inner); - Assertions.assertNotNull(inner.virtualMachineProfile()); - Assertions.assertNotNull(inner.virtualMachineProfile().storageProfile()); - Assertions.assertNotNull(inner.virtualMachineProfile().storageProfile().osDisk()); - List containers = inner.virtualMachineProfile().storageProfile().osDisk().vhdContainers(); - Assertions.assertFalse(containers.isEmpty()); - // Boot diagnostics should share storage used for os/disk containers - boolean found = false; - for (String containerStorageUri : containers) { - if (containerStorageUri - .toLowerCase() - .startsWith(virtualMachineScaleSet.bootDiagnosticsStorageUri().toLowerCase())) { - found = true; - break; - } - } - Assertions.assertTrue(found); - } - - @Test - public void bootDiagnosticsShouldUseVMSSUnManagedDisksExplicitStorage() throws Exception { - final String storageName = generateRandomResourceName("st", 14); - final String vmssName = generateRandomResourceName("vmss", 10); - - ResourceGroup resourceGroup = this.resourceManager.resourceGroups().define(rgName).withRegion(region).create(); - - Network network = - this - .networkManager - .networks() - .define("vmssvnet") - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .withAddressSpace("10.0.0.0/28") - .withSubnet("subnet1", "10.0.0.0/28") - .create(); - - LoadBalancer publicLoadBalancer = - createInternetFacingLoadBalancer(region, resourceGroup, "1", LoadBalancerSkuType.BASIC); - - List backends = new ArrayList<>(); - for (String backend : publicLoadBalancer.backends().keySet()) { - backends.add(backend); - } - Assertions.assertTrue(backends.size() == 2); - - StorageAccount storageAccount = - storageManager - .storageAccounts() - .define(storageName) - .withRegion(region) - .withNewResourceGroup(rgName) - .create(); - - VirtualMachineScaleSet virtualMachineScaleSet = - this - .computeManager - .virtualMachineScaleSets() - .define(vmssName) - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .withSku(VirtualMachineScaleSetSkuTypes.STANDARD_A0) - .withExistingPrimaryNetworkSubnet(network, "subnet1") - .withExistingPrimaryInternetFacingLoadBalancer(publicLoadBalancer) - .withPrimaryInternetFacingLoadBalancerBackends(backends.get(0), backends.get(1)) - .withoutPrimaryInternalLoadBalancer() - .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) - .withRootUsername("jvuser") - .withSsh(sshPublicKey()) - .withUnmanagedDisks() - .withBootDiagnostics() - .withExistingStorageAccount( - storageAccount) // This storage account must be shared by disk and boot diagnostics - .create(); - - Assertions.assertNotNull(virtualMachineScaleSet); - Assertions.assertTrue(virtualMachineScaleSet.isBootDiagnosticsEnabled()); - Assertions.assertNotNull(virtualMachineScaleSet.bootDiagnosticsStorageUri()); - Assertions.assertTrue(virtualMachineScaleSet.bootDiagnosticsStorageUri().contains(storageName)); - - VirtualMachineScaleSetInner inner = virtualMachineScaleSet.innerModel(); - Assertions.assertNotNull(inner); - Assertions.assertNotNull(inner.virtualMachineProfile()); - Assertions.assertNotNull(inner.virtualMachineProfile().storageProfile()); - Assertions.assertNotNull(inner.virtualMachineProfile().storageProfile().osDisk()); - List containers = inner.virtualMachineProfile().storageProfile().osDisk().vhdContainers(); - Assertions.assertFalse(containers.isEmpty()); - } - - @Test - public void canEnableBootDiagnosticsWithCreatableStorageOnUnManagedVMSSCreation() throws Exception { - final String storageName = generateRandomResourceName("st", 14); - final String vmssName = generateRandomResourceName("vmss", 10); - - ResourceGroup resourceGroup = this.resourceManager.resourceGroups().define(rgName).withRegion(region).create(); - - Network network = - this - .networkManager - .networks() - .define("vmssvnet") - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .withAddressSpace("10.0.0.0/28") - .withSubnet("subnet1", "10.0.0.0/28") - .create(); - - LoadBalancer publicLoadBalancer = - createInternetFacingLoadBalancer(region, resourceGroup, "1", LoadBalancerSkuType.BASIC); - - List backends = new ArrayList<>(); - for (String backend : publicLoadBalancer.backends().keySet()) { - backends.add(backend); - } - Assertions.assertTrue(backends.size() == 2); - - Creatable creatableStorageAccount = - storageManager.storageAccounts().define(storageName).withRegion(region).withExistingResourceGroup(rgName); - - VirtualMachineScaleSet virtualMachineScaleSet = - this - .computeManager - .virtualMachineScaleSets() - .define(vmssName) - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .withSku(VirtualMachineScaleSetSkuTypes.STANDARD_A0) - .withExistingPrimaryNetworkSubnet(network, "subnet1") - .withExistingPrimaryInternetFacingLoadBalancer(publicLoadBalancer) - .withPrimaryInternetFacingLoadBalancerBackends(backends.get(0), backends.get(1)) - .withoutPrimaryInternalLoadBalancer() - .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) - .withRootUsername("jvuser") - .withSsh(sshPublicKey()) - .withUnmanagedDisks() - .withBootDiagnostics( - creatableStorageAccount) // This storage account should be used for BDiagnostics not OS disk storage - // account - .create(); - - Assertions.assertNotNull(virtualMachineScaleSet); - Assertions.assertTrue(virtualMachineScaleSet.isBootDiagnosticsEnabled()); - Assertions.assertNotNull(virtualMachineScaleSet.bootDiagnosticsStorageUri()); - Assertions.assertTrue(virtualMachineScaleSet.bootDiagnosticsStorageUri().contains(storageName)); - // There should be a different storage account created for VMSS OS Disk - - VirtualMachineScaleSetInner inner = virtualMachineScaleSet.innerModel(); - Assertions.assertNotNull(inner); - Assertions.assertNotNull(inner.virtualMachineProfile()); - Assertions.assertNotNull(inner.virtualMachineProfile().storageProfile()); - Assertions.assertNotNull(inner.virtualMachineProfile().storageProfile().osDisk()); - List containers = inner.virtualMachineProfile().storageProfile().osDisk().vhdContainers(); - Assertions.assertFalse(containers.isEmpty()); - boolean notFound = true; - for (String containerStorageUri : containers) { - if (containerStorageUri - .toLowerCase() - .startsWith(virtualMachineScaleSet.bootDiagnosticsStorageUri().toLowerCase())) { - notFound = false; - break; - } - } - Assertions.assertTrue(notFound); - } - - - @Test - public void canEnableBootDiagnosticsOnManagedStorageAccount() { - Network network = - this - .networkManager - .networks() - .define("vmssvnet") - .withRegion(region) - .withNewResourceGroup(rgName) - .withAddressSpace("10.0.0.0/28") - .withSubnet("subnet1", "10.0.0.0/28") - .create(); - - VirtualMachineScaleSet virtualMachineScaleSet = - this - .computeManager - .virtualMachineScaleSets() - .define(vmName) - .withRegion(region) - .withExistingResourceGroup(rgName) - .withSku(VirtualMachineScaleSetSkuTypes.STANDARD_A0) - .withExistingPrimaryNetworkSubnet(network, "subnet1") - .withoutPrimaryInternetFacingLoadBalancer() - .withoutPrimaryInternalLoadBalancer() - .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) - .withRootUsername("jvuser") - .withSsh(sshPublicKey()) - .withBootDiagnosticsOnManagedStorageAccount() - .create(); - - Assertions.assertNotNull(virtualMachineScaleSet); - Assertions.assertTrue(virtualMachineScaleSet.isBootDiagnosticsEnabled()); - Assertions.assertNull(virtualMachineScaleSet.bootDiagnosticsStorageUri()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/VirtualMachineScaleSetEMSILMSIOperationsTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/VirtualMachineScaleSetEMSILMSIOperationsTests.java deleted file mode 100644 index dd402b5c8592..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/VirtualMachineScaleSetEMSILMSIOperationsTests.java +++ /dev/null @@ -1,581 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.compute.models.KnownLinuxVirtualMachineImage; -import com.azure.resourcemanager.compute.models.ResourceIdentityType; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSet; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetSkuTypes; -import com.azure.resourcemanager.authorization.models.BuiltInRole; -import com.azure.resourcemanager.authorization.models.RoleAssignment; -import com.azure.resourcemanager.msi.models.Identity; -import com.azure.resourcemanager.network.models.LoadBalancer; -import com.azure.resourcemanager.network.models.Network; -import com.azure.resourcemanager.resources.models.ResourceGroup; -import com.azure.core.management.Region; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import java.util.Iterator; -import java.util.Set; - -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public class VirtualMachineScaleSetEMSILMSIOperationsTests extends ComputeManagementTest { - private String rgName = ""; - private Region region = locationOrDefault(Region.fromName("East US 2")); - private final String vmssName = "javavmss"; - - @Override - protected void cleanUpResources() { - this.resourceManager.resourceGroups().beginDeleteByName(rgName); - } - - @Test - public void canCreateUpdateVirtualMachineScaleSetWithEMSI() throws Exception { - rgName = generateRandomResourceName("java-ems-c-rg", 15); - String identityName1 = generateRandomResourceName("msi-id", 15); - String identityName2 = generateRandomResourceName("msi-id", 15); - String networkName = generateRandomResourceName("nw", 10); - - ResourceGroup resourceGroup = this.resourceManager.resourceGroups().define(rgName).withRegion(region).create(); - - // Create a virtual network to which we will assign "EMSI" with reader access - // - Network network = - networkManager - .networks() - .define(networkName) - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .create(); - - // Create an "User Assigned (External) MSI" residing in the above RG and assign reader access to the virtual - // network - // - Identity createdIdentity = - msiManager - .identities() - .define(identityName1) - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .withAccessTo(network, BuiltInRole.READER) - .create(); - - // Prepare a definition for yet-to-be-created "User Assigned (External) MSI" with contributor access to the - // resource group - // it resides - // - Creatable creatableIdentity = - msiManager - .identities() - .define(identityName2) - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .withAccessToCurrentResourceGroup(BuiltInRole.CONTRIBUTOR); - - // Create a virtual network for VMSS - // - Network vmssNetwork = - this - .networkManager - .networks() - .define("vmssvnet") - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .withAddressSpace("10.0.0.0/28") - .withSubnet("subnet1", "10.0.0.0/28") - .create(); - - // Create a Load balancer for VMSS - // - LoadBalancer vmssInternalLoadBalancer = createInternalLoadBalancer(region, resourceGroup, vmssNetwork, "1"); - - VirtualMachineScaleSet virtualMachineScaleSet = - this - .computeManager - .virtualMachineScaleSets() - .define(vmssName) - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .withSku(VirtualMachineScaleSetSkuTypes.STANDARD_A0) - .withExistingPrimaryNetworkSubnet(vmssNetwork, "subnet1") - .withoutPrimaryInternetFacingLoadBalancer() - .withExistingPrimaryInternalLoadBalancer(vmssInternalLoadBalancer) - .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) - .withRootUsername("jvuser") - .withSsh(sshPublicKey()) - .withExistingUserAssignedManagedServiceIdentity(createdIdentity) - .withNewUserAssignedManagedServiceIdentity(creatableIdentity) - .create(); - - Assertions.assertNotNull(virtualMachineScaleSet); - Assertions.assertNotNull(virtualMachineScaleSet.innerModel()); - Assertions.assertTrue(virtualMachineScaleSet.isManagedServiceIdentityEnabled()); - Assertions - .assertNull( - virtualMachineScaleSet.systemAssignedManagedServiceIdentityPrincipalId()); // No Local MSI enabled - Assertions - .assertNull(virtualMachineScaleSet.systemAssignedManagedServiceIdentityTenantId()); // No Local MSI enabled - - // Ensure the "User Assigned (External) MSI" id can be retrieved from the virtual machine scale set - // - Set emsiIds = virtualMachineScaleSet.userAssignedManagedServiceIdentityIds(); - Assertions.assertNotNull(emsiIds); - Assertions.assertEquals(2, emsiIds.size()); - - // Ensure the "User Assigned (External) MSI"s matches with the those provided as part of VMSS create - // - Identity implicitlyCreatedIdentity = null; - for (String emsiId : emsiIds) { - Identity identity = msiManager.identities().getById(emsiId); - Assertions.assertNotNull(identity); - Assertions - .assertTrue( - identity.name().equalsIgnoreCase(identityName1) || identity.name().equalsIgnoreCase(identityName2)); - Assertions.assertNotNull(identity.principalId()); - - if (identity.name().equalsIgnoreCase(identityName2)) { - implicitlyCreatedIdentity = identity; - } - } - Assertions.assertNotNull(implicitlyCreatedIdentity); - - // Ensure expected role assignment exists for explicitly created EMSI - // - PagedIterable roleAssignmentsForNetwork = - this.msiManager.authorizationManager().roleAssignments().listByScope(network.id()); - boolean found = false; - for (RoleAssignment roleAssignment : roleAssignmentsForNetwork) { - if (roleAssignment.principalId() != null - && roleAssignment.principalId().equalsIgnoreCase(createdIdentity.principalId())) { - found = true; - break; - } - } - Assertions - .assertTrue( - found, - "Expected role assignment not found for the virtual network for identity" + createdIdentity.name()); - - RoleAssignment assignment = - lookupRoleAssignmentUsingScopeAndRoleAsync(network.id(), BuiltInRole.READER, createdIdentity.principalId()) - .block(); - - Assertions - .assertNotNull( - assignment, "Expected role assignment with ROLE not found for the virtual network for identity"); - - // Ensure expected role assignment exists for explicitly created EMSI - // - PagedIterable roleAssignmentsForResourceGroup = - this.msiManager.authorizationManager().roleAssignments().listByScope(resourceGroup.id()); - - found = false; - for (RoleAssignment roleAssignment : roleAssignmentsForResourceGroup) { - if (roleAssignment.principalId() != null - && roleAssignment.principalId().equalsIgnoreCase(implicitlyCreatedIdentity.principalId())) { - found = true; - break; - } - } - Assertions - .assertTrue( - found, - "Expected role assignment not found for the resource group for identity" - + implicitlyCreatedIdentity.name()); - - assignment = - lookupRoleAssignmentUsingScopeAndRoleAsync( - resourceGroup.id(), BuiltInRole.CONTRIBUTOR, implicitlyCreatedIdentity.principalId()) - .block(); - - Assertions - .assertNotNull( - assignment, "Expected role assignment with ROLE not found for the resource group for identity"); - - emsiIds = virtualMachineScaleSet.userAssignedManagedServiceIdentityIds(); - Iterator itr = emsiIds.iterator(); - // Remove both (all) identities - virtualMachineScaleSet - .update() - .withoutUserAssignedManagedServiceIdentity(itr.next()) - .withoutUserAssignedManagedServiceIdentity(itr.next()) - .apply(); - - // - Assertions.assertEquals(0, virtualMachineScaleSet.userAssignedManagedServiceIdentityIds().size()); - if (virtualMachineScaleSet.managedServiceIdentityType() != null) { - Assertions - .assertTrue(virtualMachineScaleSet.managedServiceIdentityType().equals(ResourceIdentityType.NONE)); - } - // fetch vm again and validate - virtualMachineScaleSet.refresh(); - // - Assertions.assertEquals(0, virtualMachineScaleSet.userAssignedManagedServiceIdentityIds().size()); - if (virtualMachineScaleSet.managedServiceIdentityType() != null) { - Assertions - .assertTrue(virtualMachineScaleSet.managedServiceIdentityType().equals(ResourceIdentityType.NONE)); - } - // - // - itr = emsiIds.iterator(); - Identity identity1 = msiManager.identities().getById(itr.next()); - Identity identity2 = msiManager.identities().getById(itr.next()); - // - // Update VM by enabling System-MSI and add two identities - virtualMachineScaleSet - .update() - .withSystemAssignedManagedServiceIdentity() - .withExistingUserAssignedManagedServiceIdentity(identity1) - .withExistingUserAssignedManagedServiceIdentity(identity2) - .apply(); - - Assertions.assertNotNull(virtualMachineScaleSet.userAssignedManagedServiceIdentityIds()); - Assertions.assertEquals(2, virtualMachineScaleSet.userAssignedManagedServiceIdentityIds().size()); - Assertions.assertNotNull(virtualMachineScaleSet.managedServiceIdentityType()); - Assertions - .assertTrue( - virtualMachineScaleSet - .managedServiceIdentityType() - .equals(ResourceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED)); - // - Assertions.assertNotNull(virtualMachineScaleSet.systemAssignedManagedServiceIdentityPrincipalId()); - Assertions.assertNotNull(virtualMachineScaleSet.systemAssignedManagedServiceIdentityTenantId()); - // - virtualMachineScaleSet.refresh(); - Assertions.assertNotNull(virtualMachineScaleSet.userAssignedManagedServiceIdentityIds()); - Assertions.assertEquals(2, virtualMachineScaleSet.userAssignedManagedServiceIdentityIds().size()); - Assertions.assertNotNull(virtualMachineScaleSet.managedServiceIdentityType()); - Assertions - .assertTrue( - virtualMachineScaleSet - .managedServiceIdentityType() - .equals(ResourceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED)); - // - Assertions.assertNotNull(virtualMachineScaleSet.systemAssignedManagedServiceIdentityPrincipalId()); - Assertions.assertNotNull(virtualMachineScaleSet.systemAssignedManagedServiceIdentityTenantId()); - // - itr = emsiIds.iterator(); - // Remove identities one by one (first one) - virtualMachineScaleSet.update().withoutUserAssignedManagedServiceIdentity(itr.next()).apply(); - // - Assertions.assertNotNull(virtualMachineScaleSet.userAssignedManagedServiceIdentityIds()); - Assertions.assertEquals(1, virtualMachineScaleSet.userAssignedManagedServiceIdentityIds().size()); - Assertions.assertNotNull(virtualMachineScaleSet.managedServiceIdentityType()); - Assertions - .assertTrue( - virtualMachineScaleSet - .managedServiceIdentityType() - .equals(ResourceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED)); - Assertions.assertNotNull(virtualMachineScaleSet.systemAssignedManagedServiceIdentityPrincipalId()); - Assertions.assertNotNull(virtualMachineScaleSet.systemAssignedManagedServiceIdentityTenantId()); - // Remove identities one by one (second one) - virtualMachineScaleSet.update().withoutUserAssignedManagedServiceIdentity(itr.next()).apply(); - // - Assertions.assertEquals(0, virtualMachineScaleSet.userAssignedManagedServiceIdentityIds().size()); - Assertions.assertNotNull(virtualMachineScaleSet.managedServiceIdentityType()); - Assertions - .assertTrue( - virtualMachineScaleSet.managedServiceIdentityType().equals(ResourceIdentityType.SYSTEM_ASSIGNED)); - // - virtualMachineScaleSet.update().withoutSystemAssignedManagedServiceIdentity().apply(); - Assertions.assertEquals(0, virtualMachineScaleSet.userAssignedManagedServiceIdentityIds().size()); - if (virtualMachineScaleSet.managedServiceIdentityType() != null) { - Assertions - .assertTrue(virtualMachineScaleSet.managedServiceIdentityType().equals(ResourceIdentityType.NONE)); - } - Assertions.assertNull(virtualMachineScaleSet.systemAssignedManagedServiceIdentityPrincipalId()); - Assertions.assertNull(virtualMachineScaleSet.systemAssignedManagedServiceIdentityTenantId()); - } - - @Test - public void canCreateVirtualMachineScaleSetWithLMSIAndEMSI() throws Exception { - rgName = generateRandomResourceName("java-emsi-c-rg", 15); - String identityName1 = generateRandomResourceName("msi-id", 15); - String networkName = generateRandomResourceName("nw", 10); - - // Create a resource group - // - ResourceGroup resourceGroup = resourceManager.resourceGroups().define(rgName).withRegion(region).create(); - - // Create a virtual network to which we will assign "EMSI" with reader access - // - Network network = - networkManager - .networks() - .define(networkName) - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .create(); - - // Prepare a definition for yet-to-be-created "User Assigned (External) MSI" with contributor access to the - // resource group - // it resides - // - Creatable creatableIdentity = - msiManager - .identities() - .define(identityName1) - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .withAccessToCurrentResourceGroup(BuiltInRole.CONTRIBUTOR); - - // Create a virtual network for VMSS - // - Network vmssNetwork = - this - .networkManager - .networks() - .define("vmssvnet") - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .withAddressSpace("10.0.0.0/28") - .withSubnet("subnet1", "10.0.0.0/28") - .create(); - - // Create a Load balancer for VMSS - // - LoadBalancer vmssInternalLoadBalancer = createInternalLoadBalancer(region, resourceGroup, vmssNetwork, "1"); - - VirtualMachineScaleSet virtualMachineScaleSet = - this - .computeManager - .virtualMachineScaleSets() - .define(vmssName) - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .withSku(VirtualMachineScaleSetSkuTypes.STANDARD_A0) - .withExistingPrimaryNetworkSubnet(vmssNetwork, "subnet1") - .withoutPrimaryInternetFacingLoadBalancer() - .withExistingPrimaryInternalLoadBalancer(vmssInternalLoadBalancer) - .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) - .withRootUsername("jvuser") - .withSsh(sshPublicKey()) - .withSystemAssignedManagedServiceIdentity() - .withSystemAssignedIdentityBasedAccessTo(network.id(), BuiltInRole.CONTRIBUTOR) - .withNewUserAssignedManagedServiceIdentity(creatableIdentity) - .create(); - - Assertions.assertNotNull(virtualMachineScaleSet); - Assertions.assertNotNull(virtualMachineScaleSet.innerModel()); - Assertions.assertTrue(virtualMachineScaleSet.isManagedServiceIdentityEnabled()); - Assertions.assertNotNull(virtualMachineScaleSet.systemAssignedManagedServiceIdentityPrincipalId()); - Assertions.assertNotNull(virtualMachineScaleSet.systemAssignedManagedServiceIdentityTenantId()); - - // Ensure the "User Assigned (External) MSI" id can be retrieved from the virtual machine - // - Set emsiIds = virtualMachineScaleSet.userAssignedManagedServiceIdentityIds(); - Assertions.assertNotNull(emsiIds); - Assertions.assertEquals(1, emsiIds.size()); - - Identity identity = msiManager.identities().getById(emsiIds.iterator().next()); - Assertions.assertNotNull(identity); - Assertions.assertTrue(identity.name().equalsIgnoreCase(identityName1)); - - // Ensure expected role assignment exists for LMSI - // - PagedIterable roleAssignmentsForNetwork = - this.msiManager.authorizationManager().roleAssignments().listByScope(network.id()); - boolean found = false; - for (RoleAssignment roleAssignment : roleAssignmentsForNetwork) { - if (roleAssignment.principalId() != null - && roleAssignment - .principalId() - .equalsIgnoreCase(virtualMachineScaleSet.systemAssignedManagedServiceIdentityPrincipalId())) { - found = true; - break; - } - } - Assertions - .assertTrue( - found, - "Expected role assignment not found for the virtual network for local identity" - + virtualMachineScaleSet.systemAssignedManagedServiceIdentityPrincipalId()); - - RoleAssignment assignment = - lookupRoleAssignmentUsingScopeAndRoleAsync( - network.id(), - BuiltInRole.CONTRIBUTOR, - virtualMachineScaleSet.systemAssignedManagedServiceIdentityPrincipalId()) - .block(); - - Assertions - .assertNotNull( - assignment, - "Expected role assignment with ROLE not found for the virtual network for system assigned identity"); - - // Ensure expected role assignment exists for EMSI - // - PagedIterable roleAssignmentsForResourceGroup = - this - .msiManager - .authorizationManager() - .roleAssignments() - .listByScope( - resourceManager.resourceGroups().getByName(virtualMachineScaleSet.resourceGroupName()).id()); - found = false; - for (RoleAssignment roleAssignment : roleAssignmentsForResourceGroup) { - if (roleAssignment.principalId() != null - && roleAssignment.principalId().equalsIgnoreCase(identity.principalId())) { - found = true; - break; - } - } - Assertions - .assertTrue( - found, "Expected role assignment not found for the resource group for identity" + identity.name()); - - assignment = - lookupRoleAssignmentUsingScopeAndRoleAsync( - resourceGroup.id(), BuiltInRole.CONTRIBUTOR, identity.principalId()) - .block(); - - Assertions - .assertNotNull( - assignment, - "Expected role assignment with ROLE not found for the resource group for system assigned identity"); - } - - @Test - public void canUpdateVirtualMachineScaleSetWithEMSIAndLMSI() throws Exception { - rgName = generateRandomResourceName("java-emsi-c-rg", 15); - String identityName1 = generateRandomResourceName("msi-id-1", 15); - String identityName2 = generateRandomResourceName("msi-id-2", 15); - - // Create a resource group - // - ResourceGroup resourceGroup = resourceManager.resourceGroups().define(rgName).withRegion(region).create(); - - // Create a virtual network for VMSS - // - Network vmssNetwork = - this - .networkManager - .networks() - .define("vmssvnet") - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .withAddressSpace("10.0.0.0/28") - .withSubnet("subnet1", "10.0.0.0/28") - .create(); - - // Create a Load balancer for VMSS - // - LoadBalancer vmssInternalLoadBalancer = createInternalLoadBalancer(region, resourceGroup, vmssNetwork, "1"); - - VirtualMachineScaleSet virtualMachineScaleSet = - this - .computeManager - .virtualMachineScaleSets() - .define(vmssName) - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .withSku(VirtualMachineScaleSetSkuTypes.STANDARD_A0) - .withExistingPrimaryNetworkSubnet(vmssNetwork, "subnet1") - .withoutPrimaryInternetFacingLoadBalancer() - .withExistingPrimaryInternalLoadBalancer(vmssInternalLoadBalancer) - .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) - .withRootUsername("jvuser") - .withSsh(sshPublicKey()) - .create(); - - // Prepare a definition for yet-to-be-created "User Assigned (External) MSI" with contributor access to the - // resource group - // it resides - // - Creatable creatableIdentity = - msiManager - .identities() - .define(identityName1) - .withRegion(region) - .withExistingResourceGroup(virtualMachineScaleSet.resourceGroupName()) - .withAccessToCurrentResourceGroup(BuiltInRole.CONTRIBUTOR); - - // Update virtual machine so that it depends on the EMSI - // - virtualMachineScaleSet = - virtualMachineScaleSet.update().withNewUserAssignedManagedServiceIdentity(creatableIdentity).apply(); - - // Ensure the "User Assigned (External) MSI" id can be retrieved from the virtual machine - // - Set emsiIds = virtualMachineScaleSet.userAssignedManagedServiceIdentityIds(); - Assertions.assertNotNull(emsiIds); - Assertions.assertEquals(1, emsiIds.size()); - - Identity identity = msiManager.identities().getById(emsiIds.iterator().next()); - Assertions.assertNotNull(identity); - Assertions.assertTrue(identity.name().equalsIgnoreCase(identityName1)); - - // Update VMSS without modify MSI - virtualMachineScaleSet.update() - .withNewDataDisk(10) - .apply(); - emsiIds = virtualMachineScaleSet.userAssignedManagedServiceIdentityIds(); - Assertions.assertNotNull(emsiIds); - Assertions.assertEquals(1, emsiIds.size()); - - // Creates an EMSI - // - Identity createdIdentity = - msiManager - .identities() - .define(identityName2) - .withRegion(region) - .withExistingResourceGroup(virtualMachineScaleSet.resourceGroupName()) - .withAccessToCurrentResourceGroup(BuiltInRole.CONTRIBUTOR) - .create(); - - // Update the virtual machine by removing the an EMSI and adding existing EMSI - // - virtualMachineScaleSet = - virtualMachineScaleSet - .update() - .withoutUserAssignedManagedServiceIdentity(identity.id()) - .withExistingUserAssignedManagedServiceIdentity(createdIdentity) - .apply(); - - // Ensure the "User Assigned (External) MSI" id can be retrieved from the virtual machine - // - emsiIds = virtualMachineScaleSet.userAssignedManagedServiceIdentityIds(); - Assertions.assertNotNull(emsiIds); - Assertions.assertEquals(1, emsiIds.size()); - - identity = msiManager.identities().getById(emsiIds.iterator().next()); - Assertions.assertNotNull(identity); - Assertions.assertTrue(identity.name().equalsIgnoreCase(identityName2)); - - // Update the virtual machine by enabling "LMSI" - - virtualMachineScaleSet.update().withSystemAssignedManagedServiceIdentity().apply(); - - Assertions.assertNotNull(virtualMachineScaleSet); - Assertions.assertNotNull(virtualMachineScaleSet.innerModel()); - Assertions.assertTrue(virtualMachineScaleSet.isManagedServiceIdentityEnabled()); - Assertions.assertNotNull(virtualMachineScaleSet.systemAssignedManagedServiceIdentityPrincipalId()); - Assertions.assertNotNull(virtualMachineScaleSet.systemAssignedManagedServiceIdentityTenantId()); - } - - private Mono lookupRoleAssignmentUsingScopeAndRoleAsync( - final String scope, BuiltInRole role, final String principalId) { - return this - .msiManager - .authorizationManager() - .roleDefinitions() - .getByScopeAndRoleNameAsync(scope, role.toString()) - .flatMap( - roleDefinition -> - msiManager - .authorizationManager() - .roleAssignments() - .listByScopeAsync(scope) - .filter( - roleAssignment -> - roleAssignment.roleDefinitionId().equalsIgnoreCase(roleDefinition.id()) - && roleAssignment.principalId().equalsIgnoreCase(principalId)) - .singleOrEmpty()) - .switchIfEmpty(Mono.defer(() -> Mono.empty())); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/VirtualMachineScaleSetManagedDiskOperationsTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/VirtualMachineScaleSetManagedDiskOperationsTests.java deleted file mode 100644 index 659611f08276..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/VirtualMachineScaleSetManagedDiskOperationsTests.java +++ /dev/null @@ -1,337 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute; - -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.compute.models.CachingTypes; -import com.azure.resourcemanager.compute.models.Disk; -import com.azure.resourcemanager.compute.models.KnownLinuxVirtualMachineImage; -import com.azure.resourcemanager.compute.models.StorageAccountTypes; -import com.azure.resourcemanager.compute.models.VirtualMachine; -import com.azure.resourcemanager.compute.models.VirtualMachineCustomImage; -import com.azure.resourcemanager.compute.models.VirtualMachineDataDisk; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSet; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetSkuTypes; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetVM; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetVMs; -import com.azure.resourcemanager.compute.models.VirtualMachineSizeTypes; -import com.azure.resourcemanager.network.models.LoadBalancer; -import com.azure.resourcemanager.network.models.Network; -import com.azure.resourcemanager.resources.models.ResourceGroup; -import com.azure.resourcemanager.test.utils.TestUtilities; -import com.azure.core.management.Region; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; - -import java.time.Duration; -import java.util.Iterator; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public class VirtualMachineScaleSetManagedDiskOperationsTests extends ComputeManagementTest { - private String rgName = ""; - private Region region = locationOrDefault(Region.US_EAST); - - @Override - protected void initializeClients(HttpPipeline httpPipeline, AzureProfile profile) { - rgName = generateRandomResourceName("javacsmrg", 15); - super.initializeClients(httpPipeline, profile); - } - - @Override - protected void cleanUpResources() { - resourceManager.resourceGroups().beginDeleteByName(rgName); - } - - @Test - public void canCreateUpdateVirtualMachineScaleSetFromPIRWithManagedDisk() throws Exception { - final String vmssName = generateRandomResourceName("vmss", 10); - - ResourceGroup resourceGroup = this.resourceManager.resourceGroups().define(rgName).withRegion(region).create(); - - Network network = - this - .networkManager - .networks() - .define(generateRandomResourceName("vmssvnet", 15)) - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .withAddressSpace("10.0.0.0/28") - .withSubnet("subnet1", "10.0.0.0/28") - .create(); - - LoadBalancer publicLoadBalancer = createHttpLoadBalancers(region, resourceGroup, "1"); - VirtualMachineScaleSet vmScaleSet = - this - .computeManager - .virtualMachineScaleSets() - .define(vmssName) - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .withSku(VirtualMachineScaleSetSkuTypes.STANDARD_DS1_V2) - .withExistingPrimaryNetworkSubnet(network, "subnet1") - .withExistingPrimaryInternetFacingLoadBalancer(publicLoadBalancer) - .withoutPrimaryInternalLoadBalancer() - .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) - .withRootUsername("jvuser") - .withSsh(sshPublicKey()) - .withNewDataDisk(100) - .withNewDataDisk(100, 1, CachingTypes.READ_WRITE) - .withNewDataDisk(100, 2, CachingTypes.READ_ONLY) - .withOSDiskStorageAccountType(StorageAccountTypes.PREMIUM_LRS) // Override the default STANDARD_LRS - .create(); - - Assertions.assertTrue(vmScaleSet.managedOSDiskStorageAccountType().equals(StorageAccountTypes.PREMIUM_LRS)); - VirtualMachineScaleSetVMs virtualMachineScaleSetVMs = vmScaleSet.virtualMachines(); - PagedIterable virtualMachines = virtualMachineScaleSetVMs.list(); - Assertions.assertEquals(TestUtilities.getSize(virtualMachines), vmScaleSet.capacity()); - for (VirtualMachineScaleSetVM vm : virtualMachines) { - Assertions.assertTrue(vm.isOSBasedOnPlatformImage()); - Assertions.assertFalse(vm.isOSBasedOnCustomImage()); - Assertions.assertFalse(vm.isOSBasedOnStoredImage()); - Assertions.assertTrue(vm.isManagedDiskEnabled()); - Assertions.assertNotNull(vm.unmanagedDataDisks()); - Assertions.assertEquals(vm.unmanagedDataDisks().size(), 0); - Assertions.assertNotNull(vm.dataDisks()); - Assertions.assertEquals(vm.dataDisks().size(), 3); - } - vmScaleSet.update().withoutDataDisk(0).withNewDataDisk(50).apply(); - - virtualMachineScaleSetVMs = vmScaleSet.virtualMachines(); - virtualMachines = virtualMachineScaleSetVMs.list(); - - ResourceManagerUtils.sleep(Duration.ofMinutes(1)); - - Assertions.assertEquals(TestUtilities.getSize(virtualMachines), vmScaleSet.capacity()); - for (VirtualMachineScaleSetVM vm : virtualMachines) { - Assertions.assertNotNull(vm.dataDisks()); - Assertions.assertEquals(vm.dataDisks().size(), 3); - } - - // test attach/detach data disk to single instance - final String diskName = generateRandomResourceName("disk", 10); - Disk disk0 = - this - .computeManager - .disks() - .define(diskName) - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .withData() - .withSizeInGB(32) - .create(); - - Iterator vmIterator = virtualMachines.iterator(); - VirtualMachineScaleSetVM vm0 = vmIterator.next(); - VirtualMachineScaleSetVM vm1 = vmIterator.next(); - final int existDiskLun = 2; - final int newDiskLun = 10; - // cannot detach non-exist disk - Exception expectedException = null; - try { - vm0.update().withoutDataDisk(newDiskLun); - } catch (IllegalStateException e) { - expectedException = e; - } - Assertions.assertNotNull(expectedException); - // cannot detach disk from VMSS model - expectedException = null; - try { - vm0.update().withoutDataDisk(existDiskLun); - } catch (IllegalStateException e) { - expectedException = e; - } - Assertions.assertNotNull(expectedException); - // cannot attach disk with same lun - expectedException = null; - try { - vm0.update().withExistingDataDisk(disk0, existDiskLun, CachingTypes.NONE); - } catch (IllegalStateException e) { - expectedException = e; - } - Assertions.assertNotNull(expectedException); - // cannot attach disk with same lun - expectedException = null; - try { - vm0 - .update() - .withExistingDataDisk(disk0, newDiskLun, CachingTypes.NONE) - .withExistingDataDisk(disk0, newDiskLun, CachingTypes.NONE); - } catch (IllegalStateException e) { - expectedException = e; - } - Assertions.assertNotNull(expectedException); - - // attach disk - final int vmssModelDiskCount = vm0.dataDisks().size(); - vm0.update().withExistingDataDisk(disk0, newDiskLun, CachingTypes.READ_WRITE).apply(); - Assertions.assertEquals(vmssModelDiskCount + 1, vm0.dataDisks().size()); - - // cannot attach disk that already attached - disk0.refresh(); - expectedException = null; - try { - vm1.update().withExistingDataDisk(disk0, newDiskLun, CachingTypes.NONE).apply(); - } catch (IllegalStateException e) { - expectedException = e; - } - Assertions.assertNotNull(expectedException); - - // detach disk - vm0.update().withoutDataDisk(newDiskLun).apply(); - Assertions.assertEquals(vmssModelDiskCount, vm0.dataDisks().size()); - } - - @Test - public void canCreateVirtualMachineScaleSetFromCustomImageWithManagedDisk() throws Exception { - final String userName = "tirekicker"; - final String password = password(); - final String publicIpDnsLabel = generateRandomResourceName("pip", 10); - final String customImageName = generateRandomResourceName("img", 10); - final String vmssName = generateRandomResourceName("vmss", 10); - - ResourceGroup resourceGroup = this.resourceManager.resourceGroups().define(rgName).withRegion(region).create(); - - VirtualMachine vm = - this - .computeManager - .virtualMachines() - .define(generateRandomResourceName("vm", 10)) - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .withNewPrimaryNetwork("10.0.0.0/28") - .withPrimaryPrivateIPAddressDynamic() - .withNewPrimaryPublicIPAddress(publicIpDnsLabel) - .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) - .withRootUsername(userName) - .withSsh(sshPublicKey()) - .withUnmanagedDisks() - .defineUnmanagedDataDisk("disk-1") - .withNewVhd(100) - .withLun(1) - .attach() - .defineUnmanagedDataDisk("disk-2") - .withNewVhd(50) - .withLun(2) - .attach() - .withSize(VirtualMachineSizeTypes.fromString("Standard_D2a_v4")) - .create(); - - Assertions.assertNotNull(vm); - - // Waiting for pip to be reachable - // - ResourceManagerUtils.sleep(Duration.ofSeconds(40)); - - deprovisionAgentInLinuxVM(vm); - vm.deallocate(); - vm.generalize(); - - VirtualMachineCustomImage virtualMachineCustomImage = - this - .computeManager - .virtualMachineCustomImages() - .define(customImageName) - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .fromVirtualMachine(vm) - .create(); - - Assertions.assertNotNull(virtualMachineCustomImage); - - Network network = - this - .networkManager - .networks() - .define(generateRandomResourceName("vmssvnet", 15)) - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .withAddressSpace("10.0.0.0/28") - .withSubnet("subnet1", "10.0.0.0/28") - .create(); - - LoadBalancer publicLoadBalancer = createHttpLoadBalancers(region, resourceGroup, "1"); - VirtualMachineScaleSet vmScaleSet = - this - .computeManager - .virtualMachineScaleSets() - .define(vmssName) - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .withSku(VirtualMachineScaleSetSkuTypes.STANDARD_D1_V2) - .withExistingPrimaryNetworkSubnet(network, "subnet1") - .withExistingPrimaryInternetFacingLoadBalancer(publicLoadBalancer) - .withoutPrimaryInternalLoadBalancer() - .withGeneralizedLinuxCustomImage(virtualMachineCustomImage.id()) - .withRootUsername(userName) - .withSsh(sshPublicKey()) - .create(); - - VirtualMachineScaleSetVMs virtualMachineScaleSetVMs = vmScaleSet.virtualMachines(); - PagedIterable virtualMachines = virtualMachineScaleSetVMs.list(); - Assertions.assertEquals(TestUtilities.getSize(virtualMachines), vmScaleSet.capacity()); - for (VirtualMachineScaleSetVM vm1 : virtualMachines) { - Assertions.assertTrue(vm1.isOSBasedOnCustomImage()); - Assertions.assertFalse(vm1.isOSBasedOnPlatformImage()); - Assertions.assertFalse(vm1.isOSBasedOnStoredImage()); - Assertions.assertTrue(vm1.isManagedDiskEnabled()); - Assertions.assertNotNull(vm1.unmanagedDataDisks()); - Assertions.assertEquals(vm1.unmanagedDataDisks().size(), 0); - Assertions.assertNotNull(vm1.dataDisks()); - Assertions.assertEquals(vm1.dataDisks().size(), 2); // Disks from data disk image from custom image - Assertions.assertTrue(vm1.dataDisks().containsKey(1)); - VirtualMachineDataDisk disk = vm1.dataDisks().get(1); - Assertions.assertEquals(disk.size(), 100); - Assertions.assertTrue(vm1.dataDisks().containsKey(2)); - disk = vm1.dataDisks().get(2); - Assertions.assertEquals(disk.size(), 50); - } - - vmScaleSet.deallocate(); - - // Updating and adding disk as part of VMSS Update seems consistency failing, CRP is aware of - // this, hence until it is fixed comment-out the test - // - // { - // "startTime": "2017-01-25T06:10:55.2243509+00:00", - // "endTime": "2017-01-25T06:11:07.8649525+00:00", - // "status": "Failed", - // "error": { - // "code": "InternalExecutionError", - // "message": "An internal execution error occurred." - // }, - // "name": "6786df83-ed3f-4d7a-bf58-d295b96fef46" - // } - // - // vmScaleSet.update() - // .withDataDiskUpdated(1, 200) // update not supported - // .withNewDataDisk(100) - // .apply(); - // - // vmScaleSet.start(); - // - // virtualMachineScaleSetVMs = vmScaleSet.virtualMachines(); - // virtualMachines = virtualMachineScaleSetVMs.list(); - // for (VirtualMachineScaleSetVM vm1 : virtualMachines) { - // Assertions.assertTrue(vm1.isOSBasedOnCustomImage()); - // Assertions.assertFalse(vm1.isOSBasedOnPlatformImage()); - // Assertions.assertFalse(vm1.isOSBasedOnStoredImage()); - // Assertions.assertTrue(vm1.isManagedDiskEnabled()); - // Assertions.assertNotNull(vm1.unmanagedDataDisks()); - // Assertions.assertEquals(vm1.unmanagedDataDisks().size(), 0); - // Assertions.assertNotNull(vm1.dataDisks()); - // Assertions.assertEquals(vm1.dataDisks().size(), 3); - // Assertions.assertTrue(vm1.dataDisks().containsKey(1)); - // VirtualMachineDataDisk disk = vm1.dataDisks().get(1); - // Assertions.assertEquals(disk.size(), 200); - // Assertions.assertTrue(vm1.dataDisks().containsKey(2)); - // disk = vm1.dataDisks().get(2); - // Assertions.assertEquals(disk.size(), 50); - // Assertions.assertTrue(vm1.dataDisks().containsKey(0)); - // disk = vm1.dataDisks().get(0); - // Assertions.assertEquals(disk.size(), 100); - // } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/VirtualMachineScaleSetOperationsTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/VirtualMachineScaleSetOperationsTests.java deleted file mode 100644 index 94cecf2fdb49..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/VirtualMachineScaleSetOperationsTests.java +++ /dev/null @@ -1,1404 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute; - -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpMethod; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.netty.NettyAsyncHttpClientBuilder; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.Region; -import com.azure.core.management.SubResource; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.authorization.models.BuiltInRole; -import com.azure.resourcemanager.authorization.models.RoleAssignment; -import com.azure.resourcemanager.compute.models.KnownLinuxVirtualMachineImage; -import com.azure.resourcemanager.compute.models.OperatingSystemTypes; -import com.azure.resourcemanager.compute.models.PowerState; -import com.azure.resourcemanager.compute.models.ResourceIdentityType; -import com.azure.resourcemanager.compute.models.Sku; -import com.azure.resourcemanager.compute.models.UpgradeMode; -import com.azure.resourcemanager.compute.models.VaultCertificate; -import com.azure.resourcemanager.compute.models.VaultSecretGroup; -import com.azure.resourcemanager.compute.models.VirtualMachineEvictionPolicyTypes; -import com.azure.resourcemanager.compute.models.VirtualMachineImage; -import com.azure.resourcemanager.compute.models.VirtualMachinePriorityTypes; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSet; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetExtension; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetPublicIpAddressConfiguration; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetSkuTypes; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetVM; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetVMs; -import com.azure.resourcemanager.keyvault.models.Secret; -import com.azure.resourcemanager.keyvault.models.Vault; -import com.azure.resourcemanager.network.models.ApplicationSecurityGroup; -import com.azure.resourcemanager.network.models.LoadBalancer; -import com.azure.resourcemanager.network.models.LoadBalancerBackend; -import com.azure.resourcemanager.network.models.LoadBalancerInboundNatRule; -import com.azure.resourcemanager.network.models.LoadBalancerSkuType; -import com.azure.resourcemanager.network.models.LoadBalancingRule; -import com.azure.resourcemanager.network.models.Network; -import com.azure.resourcemanager.network.models.NetworkSecurityGroup; -import com.azure.resourcemanager.network.models.PublicIpAddress; -import com.azure.resourcemanager.network.models.SecurityRuleProtocol; -import com.azure.resourcemanager.network.models.VirtualMachineScaleSetNetworkInterface; -import com.azure.resourcemanager.network.models.VirtualMachineScaleSetNicIpConfiguration; -import com.azure.resourcemanager.resources.fluentcore.arm.AvailabilityZoneId; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import com.azure.resourcemanager.resources.models.ResourceGroup; -import com.azure.resourcemanager.storage.models.StorageAccount; -import com.azure.resourcemanager.storage.models.StorageAccountKey; -import com.azure.resourcemanager.test.utils.TestUtilities; -import org.apache.commons.io.IOUtils; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - - -import java.io.InputStream; -import java.nio.charset.StandardCharsets; -import java.time.Duration; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -public class VirtualMachineScaleSetOperationsTests extends ComputeManagementTest { - private String rgName = ""; - private final Region region = locationOrDefault(Region.US_EAST2); - - @Override - protected void initializeClients(HttpPipeline httpPipeline, AzureProfile profile) { - rgName = generateRandomResourceName("javacsmrg", 15); - super.initializeClients(httpPipeline, profile); - } - - @Override - protected void cleanUpResources() { - if (rgName != null) { - resourceManager.resourceGroups().beginDeleteByName(rgName); - } - } - - @Test - public void canUpdateVirtualMachineScaleSetWithExtensionProtectedSettings() throws Exception { - final String vmssName = generateRandomResourceName("vmss", 10); - final String uname = "jvuser"; - final String password = password(); - - ResourceGroup resourceGroup = this.resourceManager.resourceGroups().define(rgName).withRegion(region).create(); - - StorageAccount storageAccount = - this - .storageManager - .storageAccounts() - .define(generateRandomResourceName("stg", 15)) - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .create(); - - List keys = storageAccount.getKeys(); - Assertions.assertNotNull(keys); - Assertions.assertTrue(keys.size() > 0); - String storageAccountKey = keys.get(0).value(); - - Network network = - this - .networkManager - .networks() - .define(generateRandomResourceName("vmssvnet", 15)) - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .withAddressSpace("10.0.0.0/28") - .withSubnet("subnet1", "10.0.0.0/28") - .create(); - - VirtualMachineScaleSet virtualMachineScaleSet = - this - .computeManager - .virtualMachineScaleSets() - .define(vmssName) - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .withSku(VirtualMachineScaleSetSkuTypes.STANDARD_A0) - .withExistingPrimaryNetworkSubnet(network, "subnet1") - .withoutPrimaryInternetFacingLoadBalancer() - .withoutPrimaryInternalLoadBalancer() - .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) - .withRootUsername(uname) - .withSsh(sshPublicKey()) - .withUnmanagedDisks() - .withNewStorageAccount(generateRandomResourceName("stg", 15)) - .withExistingStorageAccount(storageAccount) - .defineNewExtension("CustomScriptForLinux") - .withPublisher("Microsoft.OSTCExtensions") - .withType("CustomScriptForLinux") - .withVersion("1.4") - .withMinorVersionAutoUpgrade() - .withPublicSetting("commandToExecute", "ls") - .withProtectedSetting("storageAccountName", storageAccount.name()) - .withProtectedSetting("storageAccountKey", storageAccountKey) - .attach() - .create(); - // Validate extensions after create - // - Map extensions = virtualMachineScaleSet.extensions(); - Assertions.assertNotNull(extensions); - Assertions.assertTrue(extensions.size() > 0); - Assertions.assertTrue(extensions.containsKey("CustomScriptForLinux")); - VirtualMachineScaleSetExtension extension = extensions.get("CustomScriptForLinux"); - Assertions.assertNotNull(extension.publicSettings()); - Assertions.assertEquals(1, extension.publicSettings().size()); - Assertions.assertNotNull(extension.publicSettingsAsJsonString()); - // Retrieve scale set - VirtualMachineScaleSet scaleSet = - this.computeManager.virtualMachineScaleSets().getById(virtualMachineScaleSet.id()); - // Validate extensions after get - // - extensions = scaleSet.extensions(); - Assertions.assertNotNull(extensions); - Assertions.assertTrue(extensions.size() > 0); - Assertions.assertTrue(extensions.containsKey("CustomScriptForLinux")); - extension = extensions.get("CustomScriptForLinux"); - Assertions.assertNotNull(extension.publicSettings()); - Assertions.assertEquals(1, extension.publicSettings().size()); - Assertions.assertNotNull(extension.publicSettingsAsJsonString()); - // Update VMSS capacity - // - int newCapacity = scaleSet.capacity() + 1; - virtualMachineScaleSet.update().withCapacity(newCapacity).apply(); - // Validate extensions after update - // - extensions = virtualMachineScaleSet.extensions(); - Assertions.assertNotNull(extensions); - Assertions.assertTrue(extensions.size() > 0); - Assertions.assertTrue(extensions.containsKey("CustomScriptForLinux")); - extension = extensions.get("CustomScriptForLinux"); - Assertions.assertNotNull(extension.publicSettings()); - Assertions.assertEquals(1, extension.publicSettings().size()); - Assertions.assertNotNull(extension.publicSettingsAsJsonString()); - } - - @Test - public void canCreateVirtualMachineScaleSetWithCustomScriptExtension() throws Exception { - final String vmssName = generateRandomResourceName("vmss", 10); - final String uname = "jvuser"; - final String password = password(); - - ResourceGroup resourceGroup = this.resourceManager.resourceGroups().define(rgName).withRegion(region).create(); - - Network network = - this - .networkManager - .networks() - .define(generateRandomResourceName("vmssvnet", 15)) - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .withAddressSpace("10.0.0.0/28") - .withSubnet("subnet1", "10.0.0.0/28") - .create(); - - LoadBalancer publicLoadBalancer = createHttpLoadBalancers(region, resourceGroup, "1"); - VirtualMachineScaleSet virtualMachineScaleSet = - this - .computeManager - .virtualMachineScaleSets() - .define(vmssName) - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .withSku(VirtualMachineScaleSetSkuTypes.STANDARD_A0) - .withExistingPrimaryNetworkSubnet(network, "subnet1") - .withExistingPrimaryInternetFacingLoadBalancer(publicLoadBalancer) - .withoutPrimaryInternalLoadBalancer() - .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) - .withRootUsername(uname) - .withSsh(sshPublicKey()) - .withUnmanagedDisks() - .withNewStorageAccount(generateRandomResourceName("stg", 15)) - .withNewStorageAccount(generateRandomResourceName("stg", 15)) - .defineNewExtension("CustomScriptForLinux") - .withPublisher("Microsoft.OSTCExtensions") - .withType("CustomScriptForLinux") - .withVersion("1.4") - .withMinorVersionAutoUpgrade() - .withPublicSetting("commandToExecute", "ls") - .attach() - .withUpgradeMode(UpgradeMode.MANUAL) - .create(); - - checkVMInstances(virtualMachineScaleSet); - - List publicIPAddressIds = virtualMachineScaleSet.primaryPublicIpAddressIds(); - PublicIpAddress publicIPAddress = this.networkManager.publicIpAddresses().getById(publicIPAddressIds.get(0)); - - String fqdn = publicIPAddress.fqdn(); - // Assert public load balancing connection - if (!isPlaybackMode()) { - HttpClient client = new NettyAsyncHttpClientBuilder().build(); - HttpRequest request = new HttpRequest(HttpMethod.GET, "http://" + fqdn); - HttpResponse response = client.send(request).block(); - Assertions.assertEquals(response.getStatusCode(), 200); - } - - // Check SSH to VM instances via Nat rule - // - for (VirtualMachineScaleSetVM vm : virtualMachineScaleSet.virtualMachines().list()) { - PagedIterable networkInterfaces = vm.listNetworkInterfaces(); - Assertions.assertEquals(TestUtilities.getSize(networkInterfaces), 1); - VirtualMachineScaleSetNetworkInterface networkInterface = networkInterfaces.iterator().next(); - VirtualMachineScaleSetNicIpConfiguration primaryIpConfig = null; - primaryIpConfig = networkInterface.primaryIPConfiguration(); - Assertions.assertNotNull(primaryIpConfig); - Integer sshFrontendPort = null; - List natRules = primaryIpConfig.listAssociatedLoadBalancerInboundNatRules(); - for (LoadBalancerInboundNatRule natRule : natRules) { - if (natRule.backendPort() == 22) { - sshFrontendPort = natRule.frontendPort(); - break; - } - } - Assertions.assertNotNull(sshFrontendPort); - - this.sleep(1000 * 60); // Wait some time for VM to be available - this.ensureCanDoSsh(fqdn, sshFrontendPort, uname, password); - } - } - - @Test - public void canCreateVirtualMachineScaleSetWithOptionalNetworkSettings() throws Exception { - final String vmssName = generateRandomResourceName("vmss", 10); - final String vmssVmDnsLabel = generateRandomResourceName("pip", 10); - final String nsgName = generateRandomResourceName("nsg", 10); - final String asgName = generateRandomResourceName("asg", 8); - - ResourceGroup resourceGroup = this.resourceManager.resourceGroups().define(rgName).withRegion(region).create(); - - Network network = - this - .networkManager - .networks() - .define("vmssvnet") - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .withAddressSpace("10.0.0.0/28") - .withSubnet("subnet1", "10.0.0.0/28") - .create(); - - ApplicationSecurityGroup asg = - this - .networkManager - .applicationSecurityGroups() - .define(asgName) - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .create(); - - // Create VMSS with instance public ip - VirtualMachineScaleSet virtualMachineScaleSet = - this - .computeManager - .virtualMachineScaleSets() - .define(vmssName) - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .withSku(VirtualMachineScaleSetSkuTypes.STANDARD_D3_V2) - .withExistingPrimaryNetworkSubnet(network, "subnet1") - .withoutPrimaryInternetFacingLoadBalancer() - .withoutPrimaryInternalLoadBalancer() - .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) - .withRootUsername("jvuser") - .withSsh(sshPublicKey()) - .withVirtualMachinePublicIp(vmssVmDnsLabel) - .withExistingApplicationSecurityGroup(asg) - .create(); - - VirtualMachineScaleSetPublicIpAddressConfiguration currentIpConfig = - virtualMachineScaleSet.virtualMachinePublicIpConfig(); - - Assertions.assertNotNull(currentIpConfig); - Assertions.assertNotNull(currentIpConfig.dnsSettings()); - Assertions.assertNotNull(currentIpConfig.dnsSettings().domainNameLabel()); - - currentIpConfig.withIdleTimeoutInMinutes(20); - - virtualMachineScaleSet.update().withVirtualMachinePublicIp(currentIpConfig).apply(); - - currentIpConfig = virtualMachineScaleSet.virtualMachinePublicIpConfig(); - Assertions.assertNotNull(currentIpConfig); - Assertions.assertNotNull(currentIpConfig.idleTimeoutInMinutes()); - Assertions.assertEquals((long) 20, (long) currentIpConfig.idleTimeoutInMinutes()); - - virtualMachineScaleSet.refresh(); - currentIpConfig = virtualMachineScaleSet.virtualMachinePublicIpConfig(); - Assertions.assertNotNull(currentIpConfig); - Assertions.assertNotNull(currentIpConfig.idleTimeoutInMinutes()); - Assertions.assertEquals((long) 20, (long) currentIpConfig.idleTimeoutInMinutes()); - - List asgIds = virtualMachineScaleSet.applicationSecurityGroupIds(); - Assertions.assertNotNull(asgIds); - Assertions.assertEquals(1, asgIds.size()); - - NetworkSecurityGroup nsg = - networkManager - .networkSecurityGroups() - .define(nsgName) - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .defineRule("rule1") - .allowOutbound() - .fromAnyAddress() - .fromPort(80) - .toAnyAddress() - .toPort(80) - .withProtocol(SecurityRuleProtocol.TCP) - .attach() - .create(); - virtualMachineScaleSet.deallocate(); - virtualMachineScaleSet - .update() - .withIpForwarding() - .withAcceleratedNetworking() - .withExistingNetworkSecurityGroup(nsg) - .apply(); - - Assertions.assertTrue(virtualMachineScaleSet.isIpForwardingEnabled()); - Assertions.assertTrue(virtualMachineScaleSet.isAcceleratedNetworkingEnabled()); - Assertions.assertNotNull(virtualMachineScaleSet.networkSecurityGroupId()); - // - virtualMachineScaleSet.refresh(); - // - Assertions.assertTrue(virtualMachineScaleSet.isIpForwardingEnabled()); - Assertions.assertTrue(virtualMachineScaleSet.isAcceleratedNetworkingEnabled()); - Assertions.assertNotNull(virtualMachineScaleSet.networkSecurityGroupId()); - - virtualMachineScaleSet - .update() - .withoutIpForwarding() - .withoutAcceleratedNetworking() - .withoutNetworkSecurityGroup() - .apply(); - Assertions.assertFalse(virtualMachineScaleSet.isIpForwardingEnabled()); - Assertions.assertFalse(virtualMachineScaleSet.isAcceleratedNetworkingEnabled()); - Assertions.assertNull(virtualMachineScaleSet.networkSecurityGroupId()); - } - - @Test - @Disabled("Mock framework doesn't support data plane") - public void canCreateVirtualMachineScaleSetWithSecret() throws Exception { - final String vmssName = generateRandomResourceName("vmss", 10); - final String vaultName = generateRandomResourceName("vlt", 10); - final String secretName = generateRandomResourceName("srt", 10); - - ResourceGroup resourceGroup = this.resourceManager.resourceGroups().define(rgName).withRegion(region).create(); - - Network network = - this - .networkManager - .networks() - .define("vmssvnet") - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .withAddressSpace("10.0.0.0/28") - .withSubnet("subnet1", "10.0.0.0/28") - .create(); - - LoadBalancer publicLoadBalancer = - createInternetFacingLoadBalancer(region, resourceGroup, "1", LoadBalancerSkuType.BASIC); - - List backends = new ArrayList<>(); - for (String backend : publicLoadBalancer.backends().keySet()) { - backends.add(backend); - } - Assertions.assertTrue(backends.size() == 2); - - Vault vault = - this - .keyVaultManager - .vaults() - .define(vaultName) - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .defineAccessPolicy() - .forServicePrincipal(clientIdFromFile()) - .allowSecretAllPermissions() - .attach() - .withDeploymentEnabled() - .create(); - final InputStream embeddedJsonConfig = - VirtualMachineExtensionOperationsTests.class.getResourceAsStream("/myTest.txt"); - String secretValue = IOUtils.toString(embeddedJsonConfig, StandardCharsets.UTF_8); - Secret secret = vault.secrets().define(secretName).withValue(secretValue).create(); - List certs = new ArrayList<>(); - certs.add(new VaultCertificate().withCertificateUrl(secret.id())); - List group = new ArrayList<>(); - group - .add( - new VaultSecretGroup() - .withSourceVault(new SubResource().withId(vault.id())) - .withVaultCertificates(certs)); - - VirtualMachineScaleSet virtualMachineScaleSet = - this - .computeManager - .virtualMachineScaleSets() - .define(vmssName) - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .withSku(VirtualMachineScaleSetSkuTypes.STANDARD_A0) - .withExistingPrimaryNetworkSubnet(network, "subnet1") - .withExistingPrimaryInternetFacingLoadBalancer(publicLoadBalancer) - .withPrimaryInternetFacingLoadBalancerBackends(backends.get(0), backends.get(1)) - .withoutPrimaryInternalLoadBalancer() - .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) - .withRootUsername("jvuser") - .withSsh(sshPublicKey()) - .withSecrets(group) - .withNewStorageAccount(generateRandomResourceName("stg", 15)) - .withNewStorageAccount(generateRandomResourceName("stg3", 15)) - .withUpgradeMode(UpgradeMode.MANUAL) - .create(); - - for (VirtualMachineScaleSetVM vm : virtualMachineScaleSet.virtualMachines().list()) { - Assertions.assertTrue(vm.osProfile().secrets().size() > 0); - } - - virtualMachineScaleSet.update().withoutSecrets().apply(); - - for (VirtualMachineScaleSetVM vm : virtualMachineScaleSet.virtualMachines().list()) { - Assertions.assertTrue(vm.osProfile().secrets().size() == 0); - } - } - - public void canCreateVirtualMachineScaleSet() throws Exception { - final String vmssName = generateRandomResourceName("vmss", 10); - ResourceGroup resourceGroup = this.resourceManager.resourceGroups().define(rgName).withRegion(region).create(); - - Network network = - this - .networkManager - .networks() - .define("vmssvnet") - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .withAddressSpace("10.0.0.0/28") - .withSubnet("subnet1", "10.0.0.0/28") - .create(); - - LoadBalancer publicLoadBalancer = - createInternetFacingLoadBalancer(region, resourceGroup, "1", LoadBalancerSkuType.BASIC); - List backends = new ArrayList<>(); - for (String backend : publicLoadBalancer.backends().keySet()) { - backends.add(backend); - } - Assertions.assertTrue(backends.size() == 2); - - VirtualMachineScaleSet virtualMachineScaleSet = - this - .computeManager - .virtualMachineScaleSets() - .define(vmssName) - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .withSku(VirtualMachineScaleSetSkuTypes.STANDARD_A0) - .withExistingPrimaryNetworkSubnet(network, "subnet1") - .withExistingPrimaryInternetFacingLoadBalancer(publicLoadBalancer) - .withPrimaryInternetFacingLoadBalancerBackends(backends.get(0), backends.get(1)) - .withoutPrimaryInternalLoadBalancer() - .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) - .withRootUsername("jvuser") - .withSsh(sshPublicKey()) - .withUnmanagedDisks() - .withNewStorageAccount(generateRandomResourceName("stg", 15)) - .withNewStorageAccount(generateRandomResourceName("stg", 15)) - .create(); - - // Validate Network specific properties (LB, VNet, NIC, IPConfig etc..) - // - Assertions.assertNull(virtualMachineScaleSet.getPrimaryInternalLoadBalancer()); - Assertions.assertTrue(virtualMachineScaleSet.listPrimaryInternalLoadBalancerBackends().size() == 0); - Assertions.assertTrue(virtualMachineScaleSet.listPrimaryInternalLoadBalancerInboundNatPools().size() == 0); - - Assertions.assertNotNull(virtualMachineScaleSet.getPrimaryInternetFacingLoadBalancer()); - Assertions.assertTrue(virtualMachineScaleSet.listPrimaryInternetFacingLoadBalancerBackends().size() == 2); - Assertions - .assertTrue(virtualMachineScaleSet.listPrimaryInternetFacingLoadBalancerInboundNatPools().size() == 2); - - Network primaryNetwork = virtualMachineScaleSet.getPrimaryNetwork(); - Assertions.assertNotNull(primaryNetwork.id()); - - PagedIterable nics = virtualMachineScaleSet.listNetworkInterfaces(); - int nicCount = 0; - for (VirtualMachineScaleSetNetworkInterface nic : nics) { - nicCount++; - Assertions.assertNotNull(nic.id()); - Assertions - .assertTrue(nic.virtualMachineId().toLowerCase().startsWith(virtualMachineScaleSet.id().toLowerCase())); - Assertions.assertNotNull(nic.macAddress()); - Assertions.assertNotNull(nic.dnsServers()); - Assertions.assertNotNull(nic.appliedDnsServers()); - Map ipConfigs = nic.ipConfigurations(); - Assertions.assertEquals(ipConfigs.size(), 1); - for (Map.Entry entry : ipConfigs.entrySet()) { - VirtualMachineScaleSetNicIpConfiguration ipConfig = entry.getValue(); - Assertions.assertNotNull(ipConfig); - Assertions.assertTrue(ipConfig.isPrimary()); - Assertions.assertNotNull(ipConfig.subnetName()); - Assertions.assertTrue(primaryNetwork.id().toLowerCase().equalsIgnoreCase(ipConfig.networkId())); - Assertions.assertNotNull(ipConfig.privateIpAddress()); - Assertions.assertNotNull(ipConfig.privateIpAddressVersion()); - Assertions.assertNotNull(ipConfig.privateIpAllocationMethod()); - List lbBackends = ipConfig.listAssociatedLoadBalancerBackends(); - // VMSS is created with a internet facing LB with two Backend pools so there will be two - // backends in ip-config as well - Assertions.assertEquals(lbBackends.size(), 2); - for (LoadBalancerBackend lbBackend : lbBackends) { - Map lbRules = lbBackend.loadBalancingRules(); - Assertions.assertEquals(lbRules.size(), 1); - for (Map.Entry ruleEntry : lbRules.entrySet()) { - LoadBalancingRule rule = ruleEntry.getValue(); - Assertions.assertNotNull(rule); - Assertions - .assertTrue( - (rule.frontendPort() == 80 && rule.backendPort() == 80) - || (rule.frontendPort() == 443 && rule.backendPort() == 443)); - } - } - List lbNatRules = ipConfig.listAssociatedLoadBalancerInboundNatRules(); - // VMSS is created with a internet facing LB with two nat pools so there will be two - // nat rules in ip-config as well - Assertions.assertEquals(lbNatRules.size(), 2); - for (LoadBalancerInboundNatRule lbNatRule : lbNatRules) { - Assertions - .assertTrue( - (lbNatRule.frontendPort() >= 5000 && lbNatRule.frontendPort() <= 5099) - || (lbNatRule.frontendPort() >= 6000 && lbNatRule.frontendPort() <= 6099)); - Assertions.assertTrue(lbNatRule.backendPort() == 22 || lbNatRule.backendPort() == 23); - } - } - } - Assertions.assertTrue(nicCount > 0); - - // Validate other properties - // - Assertions.assertEquals(virtualMachineScaleSet.vhdContainers().size(), 2); - Assertions.assertEquals(virtualMachineScaleSet.sku(), VirtualMachineScaleSetSkuTypes.STANDARD_A0); - // Check defaults - Assertions.assertTrue(virtualMachineScaleSet.upgradeModel() == UpgradeMode.AUTOMATIC); - Assertions.assertEquals(virtualMachineScaleSet.capacity(), 2); - // Fetch the primary Virtual network - primaryNetwork = virtualMachineScaleSet.getPrimaryNetwork(); - - String inboundNatPoolToRemove = null; - for (String inboundNatPoolName - : virtualMachineScaleSet.listPrimaryInternetFacingLoadBalancerInboundNatPools().keySet()) { - inboundNatPoolToRemove = inboundNatPoolName; - break; - } - - LoadBalancer internalLoadBalancer = createInternalLoadBalancer(region, resourceGroup, primaryNetwork, "1"); - - virtualMachineScaleSet - .update() - .withExistingPrimaryInternalLoadBalancer(internalLoadBalancer) - .withoutPrimaryInternetFacingLoadBalancerNatPools(inboundNatPoolToRemove) // Remove one NatPool - .apply(); - - virtualMachineScaleSet = this.computeManager.virtualMachineScaleSets().getByResourceGroup(rgName, vmssName); - - // Check LB after update - // - Assertions.assertNotNull(virtualMachineScaleSet.getPrimaryInternetFacingLoadBalancer()); - Assertions.assertTrue(virtualMachineScaleSet.listPrimaryInternetFacingLoadBalancerBackends().size() == 2); - Assertions - .assertTrue(virtualMachineScaleSet.listPrimaryInternetFacingLoadBalancerInboundNatPools().size() == 1); - - Assertions.assertNotNull(virtualMachineScaleSet.getPrimaryInternalLoadBalancer()); - Assertions.assertTrue(virtualMachineScaleSet.listPrimaryInternalLoadBalancerBackends().size() == 2); - Assertions.assertTrue(virtualMachineScaleSet.listPrimaryInternalLoadBalancerInboundNatPools().size() == 2); - - // Check NIC + IpConfig after update - // - nics = virtualMachineScaleSet.listNetworkInterfaces(); - nicCount = 0; - for (VirtualMachineScaleSetNetworkInterface nic : nics) { - nicCount++; - Map ipConfigs = nic.ipConfigurations(); - Assertions.assertEquals(ipConfigs.size(), 1); - for (Map.Entry entry : ipConfigs.entrySet()) { - VirtualMachineScaleSetNicIpConfiguration ipConfig = entry.getValue(); - Assertions.assertNotNull(ipConfig); - List lbBackends = ipConfig.listAssociatedLoadBalancerBackends(); - Assertions.assertNotNull(lbBackends); - // Updated VMSS has a internet facing LB with two backend pools and a internal LB with two - // backend pools so there should be 4 backends in ip-config - // #1: But this is not always happening, it seems update is really happening only - // for subset of vms [TODO: Report this to network team] - // Assertions.True(lbBackends.Count == 4); - // Assertions.assertEquals(lbBackends.size(), 4); - for (LoadBalancerBackend lbBackend : lbBackends) { - Map lbRules = lbBackend.loadBalancingRules(); - Assertions.assertEquals(lbRules.size(), 1); - for (Map.Entry ruleEntry : lbRules.entrySet()) { - LoadBalancingRule rule = ruleEntry.getValue(); - Assertions.assertNotNull(rule); - Assertions - .assertTrue( - (rule.frontendPort() == 80 && rule.backendPort() == 80) - || (rule.frontendPort() == 443 && rule.backendPort() == 443) - || (rule.frontendPort() == 1000 && rule.backendPort() == 1000) - || (rule.frontendPort() == 1001 && rule.backendPort() == 1001)); - } - } - List lbNatRules = ipConfig.listAssociatedLoadBalancerInboundNatRules(); - // Updated VMSS has a internet facing LB with one nat pool and a internal LB with two - // nat pools so there should be 3 nat rule in ip-config - // Same issue as above #1 - // But this is not always happening, it seems update is really happening only - // for subset of vms [TODO: Report this to network team] - // Assertions.assertEquals(lbNatRules.size(), 3); - for (LoadBalancerInboundNatRule lbNatRule : lbNatRules) { - // As mentioned above some chnages are not propgating to all VM instances 6000+ should be there - Assertions - .assertTrue( - (lbNatRule.frontendPort() >= 6000 && lbNatRule.frontendPort() <= 6099) - || (lbNatRule.frontendPort() >= 5000 && lbNatRule.frontendPort() <= 5099) - || (lbNatRule.frontendPort() >= 8000 && lbNatRule.frontendPort() <= 8099) - || (lbNatRule.frontendPort() >= 9000 && lbNatRule.frontendPort() <= 9099)); - // Same as above - Assertions - .assertTrue( - lbNatRule.backendPort() == 23 - || lbNatRule.backendPort() == 22 - || lbNatRule.backendPort() == 44 - || lbNatRule.backendPort() == 45); - } - } - } - Assertions.assertTrue(nicCount > 0); - } - - /* - * Previously name - * canCreateTwoRegionalVirtualMachineScaleSetsAndAssociateEachWithDifferentBackendPoolOfZoneResilientLoadBalancer - * but this was too long for some OSes and would cause git checkout to fail. - */ - @Test - public void - canCreateTwoRegionalVMScaleSetsWithDifferentPoolOfZoneResilientLoadBalancer() - throws Exception { - // Zone resilient resource -> resources deployed in all zones by the service and it will be served by all AZs - // all the time. - // ZoneResilientLoadBalancer -> STANDARD LB -> [Since service deploy them to all zones, user don't have to set - // zone explicitly, even if he does its a constrain as user can set only one zone at this time] - - Region region2 = locationOrDefault(Region.US_EAST2); - - ResourceGroup resourceGroup = - this.resourceManager.resourceGroups().define(rgName).withRegion(region2).create(); - - Network network = - this - .networkManager - .networks() - .define("vmssvnet") - .withRegion(region2) - .withExistingResourceGroup(resourceGroup) - .withAddressSpace("10.0.0.0/28") - .withSubnet("subnet1", "10.0.0.0/28") - .create(); - - // Creates a STANDARD LB with one public frontend ip configuration with two backend pools - // Each address pool of STANDARD LB can hold different VMSS resource. - // - LoadBalancer publicLoadBalancer = - createInternetFacingLoadBalancer(region2, resourceGroup, "1", LoadBalancerSkuType.STANDARD); - - // With default LB SKU BASIC, an attempt to associate two different VMSS to different - // backend pool will cause below error (more accurately, while trying to put second VMSS) - // { - // "startTime": "2017-09-06T14:27:22.1849435+00:00", - // "endTime": "2017-09-06T14:27:45.8885142+00:00", - // "status": "Failed", - // "error": { - // "code": "VmIsNotInSameAvailabilitySetAsLb", - // "message": "Virtual Machine - // /subscriptions//resourceGroups//providers/Microsoft.Compute/virtualMachines/|providers|Microsoft.Compute|virtualMachineScaleSets||virtualMachines| is using different Availability Set than other Virtual Machines connected to the Load Balancer(s) ." - // }, - // "name": "97531d64-db37-4d21-a1cb-9c53aad7c342" - // } - - List backends = new ArrayList<>(); - for (String backend : publicLoadBalancer.backends().keySet()) { - backends.add(backend); - } - Assertions.assertTrue(backends.size() == 2); - - List natpools = new ArrayList<>(); - for (String natPool : publicLoadBalancer.inboundNatPools().keySet()) { - natpools.add(natPool); - } - Assertions.assertTrue(natpools.size() == 2); - - final String vmssName1 = generateRandomResourceName("vmss1", 10); - // HTTP goes to this virtual machine scale set - // - VirtualMachineScaleSet virtualMachineScaleSet1 = - this - .computeManager - .virtualMachineScaleSets() - .define(vmssName1) - .withRegion(region2) - .withExistingResourceGroup(resourceGroup) - .withSku(VirtualMachineScaleSetSkuTypes.STANDARD_A0) - .withExistingPrimaryNetworkSubnet(network, "subnet1") - .withExistingPrimaryInternetFacingLoadBalancer(publicLoadBalancer) - .withPrimaryInternetFacingLoadBalancerBackends(backends.get(0)) // This VMSS in the first backend pool - .withPrimaryInternetFacingLoadBalancerInboundNatPools(natpools.get(0)) - .withoutPrimaryInternalLoadBalancer() - .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) - .withRootUsername("jvuser") - .withSsh(sshPublicKey()) - .create(); - - final String vmssName2 = generateRandomResourceName("vmss2", 10); - // HTTPS goes to this virtual machine scale set - // - VirtualMachineScaleSet virtualMachineScaleSet2 = - this - .computeManager - .virtualMachineScaleSets() - .define(vmssName2) - .withRegion(region2) - .withExistingResourceGroup(resourceGroup) - .withSku(VirtualMachineScaleSetSkuTypes.STANDARD_A0) - .withExistingPrimaryNetworkSubnet(network, "subnet1") - .withExistingPrimaryInternetFacingLoadBalancer(publicLoadBalancer) - .withPrimaryInternetFacingLoadBalancerBackends(backends.get(1)) // This VMSS in the second backend pool - .withPrimaryInternetFacingLoadBalancerInboundNatPools(natpools.get(1)) - .withoutPrimaryInternalLoadBalancer() - .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) - .withRootUsername("jvuser") - .withSsh(sshPublicKey()) - .create(); - - // Validate Network specific properties (LB, VNet, NIC, IPConfig etc..) - // - Assertions.assertNull(virtualMachineScaleSet1.getPrimaryInternalLoadBalancer()); - Assertions.assertTrue(virtualMachineScaleSet1.listPrimaryInternalLoadBalancerBackends().size() == 0); - Assertions.assertTrue(virtualMachineScaleSet1.listPrimaryInternalLoadBalancerInboundNatPools().size() == 0); - - Assertions.assertNotNull(virtualMachineScaleSet1.getPrimaryInternetFacingLoadBalancer()); - Assertions.assertTrue(virtualMachineScaleSet1.listPrimaryInternetFacingLoadBalancerBackends().size() == 1); - - Assertions.assertNull(virtualMachineScaleSet2.getPrimaryInternalLoadBalancer()); - Assertions.assertTrue(virtualMachineScaleSet2.listPrimaryInternalLoadBalancerBackends().size() == 0); - Assertions.assertTrue(virtualMachineScaleSet2.listPrimaryInternalLoadBalancerInboundNatPools().size() == 0); - - Assertions.assertNotNull(virtualMachineScaleSet2.getPrimaryInternetFacingLoadBalancer()); - Assertions.assertTrue(virtualMachineScaleSet2.listPrimaryInternetFacingLoadBalancerBackends().size() == 1); - } - - @Test - public void canCreateZoneRedundantVirtualMachineScaleSetWithZoneResilientLoadBalancer() throws Exception { - // Zone redundant VMSS is the one with multiple zones - // - - Region region2 = locationOrDefault(Region.US_EAST2); - - ResourceGroup resourceGroup = - this.resourceManager.resourceGroups().define(rgName).withRegion(region2).create(); - - Network network = - this - .networkManager - .networks() - .define("vmssvnet") - .withRegion(region2) - .withExistingResourceGroup(resourceGroup) - .withAddressSpace("10.0.0.0/28") - .withSubnet("subnet1", "10.0.0.0/28") - .create(); - - // Zone redundant VMSS requires STANDARD LB - // - // Creates a STANDARD LB with one public frontend ip configuration with two backend pools - // Each address pool of STANDARD LB can hold different VMSS resource. - // - LoadBalancer publicLoadBalancer = - createInternetFacingLoadBalancer(region2, resourceGroup, "1", LoadBalancerSkuType.STANDARD); - - List backends = new ArrayList<>(); - for (String backend : publicLoadBalancer.backends().keySet()) { - backends.add(backend); - } - Assertions.assertTrue(backends.size() == 2); - - final String vmssName = generateRandomResourceName("vmss", 10); - // HTTP & HTTPS traffic on port 80, 443 of Internet-facing LB goes to corresponding port in virtual machine - // scale set - // - VirtualMachineScaleSet virtualMachineScaleSet = - this - .computeManager - .virtualMachineScaleSets() - .define(vmssName) - .withRegion(region2) - .withExistingResourceGroup(resourceGroup) - .withSku(VirtualMachineScaleSetSkuTypes.STANDARD_D3_V2) - .withExistingPrimaryNetworkSubnet(network, "subnet1") - .withExistingPrimaryInternetFacingLoadBalancer(publicLoadBalancer) - .withPrimaryInternetFacingLoadBalancerBackends(backends.get(0), backends.get(1)) - .withoutPrimaryInternalLoadBalancer() - .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) - .withRootUsername("jvuser") - .withSsh(sshPublicKey()) - .withAvailabilityZone(AvailabilityZoneId.ZONE_1) // Zone redundant - zone 1 + zone 2 - .withAvailabilityZone(AvailabilityZoneId.ZONE_2) - .create(); - - // Check zones - // - Assertions.assertNotNull(virtualMachineScaleSet.availabilityZones()); - Assertions.assertEquals(2, virtualMachineScaleSet.availabilityZones().size()); - - // Validate Network specific properties (LB, VNet, NIC, IPConfig etc..) - // - Assertions.assertNull(virtualMachineScaleSet.getPrimaryInternalLoadBalancer()); - Assertions.assertTrue(virtualMachineScaleSet.listPrimaryInternalLoadBalancerBackends().size() == 0); - Assertions.assertTrue(virtualMachineScaleSet.listPrimaryInternalLoadBalancerInboundNatPools().size() == 0); - - Assertions.assertNotNull(virtualMachineScaleSet.getPrimaryInternetFacingLoadBalancer()); - Assertions.assertTrue(virtualMachineScaleSet.listPrimaryInternetFacingLoadBalancerBackends().size() == 2); - Assertions - .assertTrue(virtualMachineScaleSet.listPrimaryInternetFacingLoadBalancerInboundNatPools().size() == 2); - - Network primaryNetwork = virtualMachineScaleSet.getPrimaryNetwork(); - Assertions.assertNotNull(primaryNetwork.id()); - } - - @Test - public void canEnableMSIOnVirtualMachineScaleSetWithoutRoleAssignment() throws Exception { - final String vmssName = generateRandomResourceName("vmss", 10); - ResourceGroup resourceGroup = this.resourceManager.resourceGroups().define(rgName).withRegion(region).create(); - - Network network = - this - .networkManager - .networks() - .define("vmssvnet") - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .withAddressSpace("10.0.0.0/28") - .withSubnet("subnet1", "10.0.0.0/28") - .create(); - - LoadBalancer publicLoadBalancer = - createInternetFacingLoadBalancer(region, resourceGroup, "1", LoadBalancerSkuType.BASIC); - List backends = new ArrayList<>(); - for (String backend : publicLoadBalancer.backends().keySet()) { - backends.add(backend); - } - Assertions.assertTrue(backends.size() == 2); - - VirtualMachineScaleSet virtualMachineScaleSet = - this - .computeManager - .virtualMachineScaleSets() - .define(vmssName) - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .withSku(VirtualMachineScaleSetSkuTypes.STANDARD_A0) - .withExistingPrimaryNetworkSubnet(network, "subnet1") - .withExistingPrimaryInternetFacingLoadBalancer(publicLoadBalancer) - .withPrimaryInternetFacingLoadBalancerBackends(backends.get(0), backends.get(1)) - .withoutPrimaryInternalLoadBalancer() - .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) - .withRootUsername("jvuser") - .withSsh(sshPublicKey()) - .withSystemAssignedManagedServiceIdentity() - .create(); - - // Validate service created service principal - // - // TODO: Renable the below code snippet: https://github.com/Azure/azure-libraries-for-net/issues/739 - - // ServicePrincipal servicePrincipal = authorizationManager - // .servicePrincipals() - // .getById(virtualMachineScaleSet.systemAssignedManagedServiceIdentityPrincipalId()); - // - // Assertions.assertNotNull(servicePrincipal); - // Assertions.assertNotNull(servicePrincipal.inner()); - - // Ensure role assigned for resource group - // - PagedIterable rgRoleAssignments = authorizationManager.roleAssignments().listByScope(resourceGroup.id()); - Assertions.assertNotNull(rgRoleAssignments); - boolean found = false; - for (RoleAssignment roleAssignment : rgRoleAssignments) { - if (roleAssignment.principalId() != null - && roleAssignment - .principalId() - .equalsIgnoreCase(virtualMachineScaleSet.systemAssignedManagedServiceIdentityPrincipalId())) { - found = true; - break; - } - } - Assertions - .assertFalse( - found, "Resource group should not have a role assignment with virtual machine scale set MSI principal"); - } - - @Test - public void canEnableMSIOnVirtualMachineScaleSetWithMultipleRoleAssignment() throws Exception { - final String vmssName = generateRandomResourceName("vmss", 10); - ResourceGroup resourceGroup = this.resourceManager.resourceGroups().define(rgName).withRegion(region).create(); - - Network network = - this - .networkManager - .networks() - .define("vmssvnet") - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .withAddressSpace("10.0.0.0/28") - .withSubnet("subnet1", "10.0.0.0/28") - .create(); - - LoadBalancer publicLoadBalancer = - createInternetFacingLoadBalancer(region, resourceGroup, "1", LoadBalancerSkuType.BASIC); - List backends = new ArrayList<>(); - for (String backend : publicLoadBalancer.backends().keySet()) { - backends.add(backend); - } - Assertions.assertTrue(backends.size() == 2); - - StorageAccount storageAccount = - this - .storageManager - .storageAccounts() - .define(generateRandomResourceName("jvcsrg", 10)) - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .create(); - - VirtualMachineScaleSet virtualMachineScaleSet = - this - .computeManager - .virtualMachineScaleSets() - .define(vmssName) - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .withSku(VirtualMachineScaleSetSkuTypes.STANDARD_A0) - .withExistingPrimaryNetworkSubnet(network, "subnet1") - .withExistingPrimaryInternetFacingLoadBalancer(publicLoadBalancer) - .withPrimaryInternetFacingLoadBalancerBackends(backends.get(0), backends.get(1)) - .withoutPrimaryInternalLoadBalancer() - .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) - .withRootUsername("jvuser") - .withSsh(sshPublicKey()) - .withSystemAssignedManagedServiceIdentity() - .withSystemAssignedIdentityBasedAccessToCurrentResourceGroup(BuiltInRole.CONTRIBUTOR) - .withSystemAssignedIdentityBasedAccessTo(storageAccount.id(), BuiltInRole.CONTRIBUTOR) - .create(); - - Assertions.assertNotNull(virtualMachineScaleSet.managedServiceIdentityType()); - Assertions - .assertTrue( - virtualMachineScaleSet.managedServiceIdentityType().equals(ResourceIdentityType.SYSTEM_ASSIGNED)); - - // Validate service created service principal - // - // TODO: Renable the below code snippet: https://github.com/Azure/azure-libraries-for-net/issues/739 - - // ServicePrincipal servicePrincipal = authorizationManager - // .servicePrincipals() - // .getById(virtualMachineScaleSet.systemAssignedManagedServiceIdentityPrincipalId()); - // - // Assertions.assertNotNull(servicePrincipal); - // Assertions.assertNotNull(servicePrincipal.inner()); - - // Ensure role assigned for resource group - // - PagedIterable rgRoleAssignments = authorizationManager.roleAssignments().listByScope(resourceGroup.id()); - Assertions.assertNotNull(rgRoleAssignments); - boolean found = false; - for (RoleAssignment roleAssignment : rgRoleAssignments) { - if (roleAssignment.principalId() != null - && roleAssignment - .principalId() - .equalsIgnoreCase(virtualMachineScaleSet.systemAssignedManagedServiceIdentityPrincipalId())) { - found = true; - break; - } - } - Assertions - .assertTrue( - found, "Resource group should have a role assignment with virtual machine scale set MSI principal"); - - // Ensure role assigned for storage account - // - PagedIterable stgRoleAssignments = - authorizationManager.roleAssignments().listByScope(storageAccount.id()); - Assertions.assertNotNull(stgRoleAssignments); - found = false; - for (RoleAssignment roleAssignment : stgRoleAssignments) { - if (roleAssignment.principalId() != null - && roleAssignment - .principalId() - .equalsIgnoreCase(virtualMachineScaleSet.systemAssignedManagedServiceIdentityPrincipalId())) { - found = true; - break; - } - } - Assertions - .assertTrue( - found, "Storage account should have a role assignment with virtual machine scale set MSI principal"); - } - - @Test - public void canGetSingleVMSSInstance() throws Exception { - - final String vmssName = generateRandomResourceName("vmss", 10); - ResourceGroup resourceGroup = this.resourceManager.resourceGroups().define(rgName).withRegion(region).create(); - - Network network = - this - .networkManager - .networks() - .define("vmssvnet") - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .withAddressSpace("10.0.0.0/28") - .withSubnet("subnet1", "10.0.0.0/28") - .create(); - - LoadBalancer publicLoadBalancer = - createInternetFacingLoadBalancer(region, resourceGroup, "1", LoadBalancerSkuType.BASIC); - - List backends = new ArrayList<>(); - for (String backend : publicLoadBalancer.backends().keySet()) { - backends.add(backend); - } - Assertions.assertTrue(backends.size() == 2); - - this - .computeManager - .virtualMachineScaleSets() - .define(vmssName) - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .withSku(VirtualMachineScaleSetSkuTypes.STANDARD_A0) - .withExistingPrimaryNetworkSubnet(network, "subnet1") - .withExistingPrimaryInternetFacingLoadBalancer(publicLoadBalancer) - .withPrimaryInternetFacingLoadBalancerBackends(backends.get(0), backends.get(1)) - .withoutPrimaryInternalLoadBalancer() - .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) - .withRootUsername("jvuser") - .withSsh(sshPublicKey()) - .withNewStorageAccount(generateRandomResourceName("stg", 15)) - .withNewStorageAccount(generateRandomResourceName("stg3", 15)) - .withUpgradeMode(UpgradeMode.MANUAL) - .create(); - - VirtualMachineScaleSet virtualMachineScaleSet = - this.computeManager.virtualMachineScaleSets().getByResourceGroup(rgName, vmssName); - VirtualMachineScaleSetVMs virtualMachineScaleSetVMs = virtualMachineScaleSet.virtualMachines(); - VirtualMachineScaleSetVM firstVm = virtualMachineScaleSetVMs.list().iterator().next(); - VirtualMachineScaleSetVM fetchedVm = virtualMachineScaleSetVMs.getInstance(firstVm.instanceId()); - this.checkVmsEqual(firstVm, fetchedVm); - VirtualMachineScaleSetVM fetchedAsyncVm = - virtualMachineScaleSetVMs.getInstanceAsync(firstVm.instanceId()).block(); - this.checkVmsEqual(firstVm, fetchedAsyncVm); - } - - @Test - @Disabled("Low priority virtual machines won't always be scheduled.") - public void canCreateLowPriorityVMSSInstance() throws Exception { - final String vmssName = generateRandomResourceName("vmss", 10); - ResourceGroup resourceGroup = this.resourceManager.resourceGroups().define(rgName).withRegion(region).create(); - - Network network = - this - .networkManager - .networks() - .define("vmssvnet") - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .withAddressSpace("10.0.0.0/28") - .withSubnet("subnet1", "10.0.0.0/28") - .create(); - - LoadBalancer publicLoadBalancer = - createInternetFacingLoadBalancer(region, resourceGroup, "1", LoadBalancerSkuType.STANDARD); - - List backends = new ArrayList<>(); - for (String backend : publicLoadBalancer.backends().keySet()) { - backends.add(backend); - } - Assertions.assertTrue(backends.size() == 2); - - VirtualMachineScaleSet vmss = - this - .computeManager - .virtualMachineScaleSets() - .define(vmssName) - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .withSku(VirtualMachineScaleSetSkuTypes.STANDARD_D1_V2) - .withExistingPrimaryNetworkSubnet(network, "subnet1") - .withExistingPrimaryInternetFacingLoadBalancer(publicLoadBalancer) - .withPrimaryInternetFacingLoadBalancerBackends(backends.get(0), backends.get(1)) - .withoutPrimaryInternalLoadBalancer() - .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) - .withRootUsername("jvuser") - .withSsh(sshPublicKey()) - .withNewStorageAccount(generateRandomResourceName("stg", 15)) - .withNewStorageAccount(generateRandomResourceName("stg3", 15)) - .withUpgradeMode(UpgradeMode.MANUAL) - .withLowPriorityVirtualMachine(VirtualMachineEvictionPolicyTypes.DEALLOCATE) - .withMaxPrice(-1.0) - .create(); - - Assertions.assertEquals(vmss.virtualMachinePriority(), VirtualMachinePriorityTypes.LOW); - Assertions.assertEquals(vmss.virtualMachineEvictionPolicy(), VirtualMachineEvictionPolicyTypes.DEALLOCATE); - Assertions.assertEquals(vmss.billingProfile().maxPrice(), (Double) (-1.0)); - - vmss.update().withMaxPrice(2000.0).apply(); - Assertions.assertEquals(vmss.billingProfile().maxPrice(), (Double) 2000.0); - } - - @Test - @Disabled("Low priority virtual machines won't always be scheduled.") - public void canPerformSimulateEvictionOnSpotVMSSInstance() { - final String vmssName = generateRandomResourceName("vmss", 10); - - ResourceGroup resourceGroup = this.resourceManager.resourceGroups() - .define(rgName) - .withRegion(region) - .create(); - - Network network = this.networkManager - .networks() - .define("vmssvnet") - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .withAddressSpace("10.0.0.0/28") - .withSubnet("subnet1", "10.0.0.0/28") - .create(); - - VirtualMachineScaleSet vmss = computeManager.virtualMachineScaleSets() - .define(vmssName) - .withRegion(region) - .withExistingResourceGroup(rgName) - .withSku(VirtualMachineScaleSetSkuTypes.STANDARD_D3_V2) - .withExistingPrimaryNetworkSubnet(network, "subnet1") - .withoutPrimaryInternetFacingLoadBalancer() - .withoutPrimaryInternalLoadBalancer() - .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) - .withRootUsername("jvuser") - .withSsh(sshPublicKey()) - .withSpotPriorityVirtualMachine(VirtualMachineEvictionPolicyTypes.DEALLOCATE) - .create(); - - PagedIterable vmInstances = vmss.virtualMachines().list(); - for (VirtualMachineScaleSetVM instance: vmInstances) { - Assertions.assertTrue(instance.osDiskSizeInGB() > 0); - // call simulate eviction - vmss.virtualMachines().simulateEviction(instance.instanceId()); - } - - boolean deallocated = false; - int pollIntervalInMinutes = 5; - for (int i = 0; i < 30; i += pollIntervalInMinutes) { - ResourceManagerUtils.sleep(Duration.ofMinutes(pollIntervalInMinutes)); - - deallocated = true; - for (VirtualMachineScaleSetVM instance: vmInstances) { - instance.refresh(); - - if (instance.powerState() != PowerState.DEALLOCATED) { - deallocated = false; - } - } - - if (deallocated) { - break; - } - } - Assertions.assertTrue(deallocated); - - for (VirtualMachineScaleSetVM instance: vmInstances) { - instance.refresh(); - Assertions.assertEquals(0, instance.osDiskSizeInGB()); - } - } - - private void checkVmsEqual(VirtualMachineScaleSetVM original, VirtualMachineScaleSetVM fetched) { - Assertions.assertEquals(original.administratorUserName(), fetched.administratorUserName()); - Assertions.assertEquals(original.availabilitySetId(), fetched.availabilitySetId()); - Assertions.assertEquals(original.bootDiagnosticEnabled(), fetched.bootDiagnosticEnabled()); - Assertions.assertEquals(original.bootDiagnosticStorageAccountUri(), fetched.bootDiagnosticStorageAccountUri()); - Assertions.assertEquals(original.computerName(), fetched.computerName()); - Assertions.assertEquals(original.dataDisks().size(), fetched.dataDisks().size()); - Assertions.assertEquals(original.extensions().size(), fetched.extensions().size()); - Assertions.assertEquals(original.instanceId(), fetched.instanceId()); - Assertions.assertEquals(original.isLatestScaleSetUpdateApplied(), fetched.isLatestScaleSetUpdateApplied()); - Assertions.assertEquals(original.isLinuxPasswordAuthenticationEnabled(), fetched.isLinuxPasswordAuthenticationEnabled()); - Assertions.assertEquals(original.isManagedDiskEnabled(), fetched.isManagedDiskEnabled()); - Assertions.assertEquals(original.isOSBasedOnCustomImage(), fetched.isOSBasedOnCustomImage()); - Assertions.assertEquals(original.isOSBasedOnPlatformImage(), fetched.isOSBasedOnPlatformImage()); - Assertions.assertEquals(original.isOSBasedOnStoredImage(), fetched.isOSBasedOnStoredImage()); - Assertions.assertEquals(original.isWindowsAutoUpdateEnabled(), fetched.isWindowsAutoUpdateEnabled()); - Assertions.assertEquals(original.isWindowsVMAgentProvisioned(), original.isWindowsVMAgentProvisioned()); - Assertions.assertEquals(original.networkInterfaceIds().size(), fetched.networkInterfaceIds().size()); - Assertions.assertEquals(original.osDiskCachingType(), fetched.osDiskCachingType()); - Assertions.assertEquals(original.osDiskId(), fetched.osDiskId()); - Assertions.assertEquals(original.osDiskName(), fetched.osDiskName()); - Assertions.assertEquals(original.osDiskSizeInGB(), fetched.osDiskSizeInGB()); - Assertions.assertEquals(original.osType(), fetched.osType()); - Assertions.assertEquals(original.osUnmanagedDiskVhdUri(), fetched.osUnmanagedDiskVhdUri()); - Assertions.assertEquals(original.powerState(), fetched.powerState()); - Assertions.assertEquals(original.primaryNetworkInterfaceId(), fetched.primaryNetworkInterfaceId()); - Assertions.assertEquals(original.size(), fetched.size()); - Assertions.assertEquals(original.sku().name(), fetched.sku().name()); - Assertions.assertEquals(original.storedImageUnmanagedVhdUri(), fetched.storedImageUnmanagedVhdUri()); - Assertions.assertEquals(original.unmanagedDataDisks().size(), fetched.unmanagedDataDisks().size()); - Assertions.assertEquals(original.windowsTimeZone(), fetched.windowsTimeZone()); - } - - private void checkVMInstances(VirtualMachineScaleSet vmScaleSet) { - VirtualMachineScaleSetVMs virtualMachineScaleSetVMs = vmScaleSet.virtualMachines(); - PagedIterable virtualMachines = virtualMachineScaleSetVMs.list(); - - Assertions.assertEquals(TestUtilities.getSize(virtualMachines), vmScaleSet.capacity()); - Assertions.assertTrue(TestUtilities.getSize(virtualMachines) > 0); - virtualMachineScaleSetVMs.updateInstances(virtualMachines.iterator().next().instanceId()); - - for (VirtualMachineScaleSetVM vm : virtualMachines) { - Assertions.assertNotNull(vm.size()); - Assertions.assertEquals(vm.osType(), OperatingSystemTypes.LINUX); - Assertions.assertNotNull(vm.computerName().startsWith(vmScaleSet.computerNamePrefix())); - Assertions.assertTrue(vm.isOSBasedOnPlatformImage()); - Assertions.assertNull(vm.osDiskId()); // VMSS is un-managed, so osDiskId must be null - Assertions.assertNotNull(vm.osUnmanagedDiskVhdUri()); // VMSS is un-managed, so osVhd should not be null - Assertions.assertNull(vm.storedImageUnmanagedVhdUri()); - Assertions.assertFalse(vm.isWindowsAutoUpdateEnabled()); - Assertions.assertFalse(vm.isWindowsVMAgentProvisioned()); - Assertions.assertTrue(vm.administratorUserName().equalsIgnoreCase("jvuser")); - VirtualMachineImage vmImage = vm.getOSPlatformImage(); - Assertions.assertNotNull(vmImage); - Assertions.assertEquals(vm.extensions().size(), vmScaleSet.extensions().size()); - Assertions.assertNotNull(vm.powerState()); - vm.refreshInstanceView(); - } - - // Check actions - VirtualMachineScaleSetVM virtualMachineScaleSetVM = virtualMachines.iterator().next(); - Assertions.assertNotNull(virtualMachineScaleSetVM); - virtualMachineScaleSetVM.restart(); - virtualMachineScaleSetVM.powerOff(); - virtualMachineScaleSetVM.refreshInstanceView(); - Assertions.assertEquals(virtualMachineScaleSetVM.powerState(), PowerState.STOPPED); - virtualMachineScaleSetVM.start(); - - // Check Instance NICs - // - for (VirtualMachineScaleSetVM vm : virtualMachines) { - PagedIterable nics = - vmScaleSet.listNetworkInterfacesByInstanceId(vm.instanceId()); - Assertions.assertNotNull(nics); - Assertions.assertEquals(TestUtilities.getSize(nics), 1); - VirtualMachineScaleSetNetworkInterface nic = nics.iterator().next(); - Assertions.assertNotNull(nic.virtualMachineId()); - Assertions.assertTrue(nic.virtualMachineId().toLowerCase().equalsIgnoreCase(vm.id())); - Assertions.assertNotNull(vm.listNetworkInterfaces()); - VirtualMachineScaleSetNetworkInterface nicA = - vmScaleSet.getNetworkInterfaceByInstanceId(vm.instanceId(), nic.name()); - Assertions.assertNotNull(nicA); - VirtualMachineScaleSetNetworkInterface nicB = vm.getNetworkInterface(nic.name()); - Assertions.assertNotNull(nicB); - } - } - - @Test - public void testVirtualMachineScaleSetSkuTypes() { - rgName = null; - VirtualMachineScaleSetSkuTypes skuType = VirtualMachineScaleSetSkuTypes.STANDARD_A0; - Assertions.assertNull(skuType.sku().capacity()); - // first copy of sku - Sku sku1 = skuType.sku(); - Assertions.assertNull(sku1.capacity()); - sku1.withCapacity(1L); - Assertions.assertEquals(sku1.capacity().longValue(), 1); - // Ensure the original is not affected - Assertions.assertNull(skuType.sku().capacity()); - // second copy of sku - Sku sku2 = skuType.sku(); - Assertions.assertNull(sku2.capacity()); - sku2.withCapacity(2L); - Assertions.assertEquals(sku2.capacity().longValue(), 2); - // Ensure the original is not affected - Assertions.assertNull(skuType.sku().capacity()); - // Ensure previous copy is not affected due to change in first copy - Assertions.assertEquals(sku1.capacity().longValue(), 1); - } - - @Test - public void canDeleteVMSSInstance() throws Exception { - String region = locationOrDefault("westus"); - final String vmssName = generateRandomResourceName("vmss", 10); - ResourceGroup resourceGroup = this.resourceManager.resourceGroups().define(rgName) - .withRegion(region) - .create(); - - Network network = - this - .networkManager - .networks() - .define("vmssvnet") - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .withAddressSpace("10.0.0.0/28") - .withSubnet("subnet1", "10.0.0.0/28") - .create(); - - VirtualMachineScaleSet vmss = this - .computeManager - .virtualMachineScaleSets() - .define(vmssName) - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .withSku(VirtualMachineScaleSetSkuTypes.STANDARD_A0) - .withExistingPrimaryNetworkSubnet(network, "subnet1") - .withoutPrimaryInternetFacingLoadBalancer() - .withoutPrimaryInternalLoadBalancer() - .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) - .withRootUsername("jvuser") - .withSsh(sshPublicKey()) - .withCapacity(4) // 4 instances - .create(); - - Assertions.assertEquals(4, vmss.virtualMachines().list().stream().count()); - - // delete first 2 instances - List firstTwoIds = vmss.virtualMachines().list().stream() - .limit(2) - .map(VirtualMachineScaleSetVM::instanceId) - .collect(Collectors.toList()); - vmss.virtualMachines().deleteInstances(firstTwoIds); - - Assertions.assertEquals(2, vmss.virtualMachines().list().stream().count()); - - // delete next 1 instance - vmss.virtualMachines().deleteInstances(Collections.singleton(vmss.virtualMachines().list().stream().findFirst().get().instanceId())); - - Assertions.assertEquals(1, vmss.virtualMachines().list().stream().count()); - - // delete next 1 instance - computeManager.virtualMachineScaleSets().deleteInstances(rgName, vmssName, Collections.singleton(vmss.virtualMachines().list().stream().findFirst().get().instanceId())); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/implementation/SerializationTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/implementation/SerializationTests.java deleted file mode 100644 index 2bea46431d20..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/implementation/SerializationTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.compute.implementation; - -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerAdapter; -import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.resourcemanager.compute.models.VirtualMachineIdentity; -import com.azure.resourcemanager.compute.models.VirtualMachineIdentityUserAssignedIdentities; -import com.azure.resourcemanager.compute.fluent.models.VirtualMachineInner; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Test; - -public class SerializationTests { - @Test - public void testIdentity() throws IOException { - SerializerAdapter adapter = SerializerFactory.createDefaultManagementSerializerAdapter(); - - Map userAssignedIdentities = new HashMap<>(); - userAssignedIdentities.put("af.B/C", new VirtualMachineIdentityUserAssignedIdentities()); - userAssignedIdentities.put("af.B/D", new VirtualMachineIdentityUserAssignedIdentities()); - - VirtualMachineIdentity identity = new VirtualMachineIdentity(); - identity.withUserAssignedIdentities(userAssignedIdentities); - - VirtualMachineInner virtualMachine = new VirtualMachineInner(); - virtualMachine.withIdentity(identity); - - virtualMachine.withLicenseType("abs"); - - String serialized = adapter.serialize(virtualMachine, SerializerEncoding.JSON); - - System.out.println(serialized); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/implementation/VirtualMachineUpdateTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/implementation/VirtualMachineUpdateTests.java deleted file mode 100644 index 5a025cf0a63a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/implementation/VirtualMachineUpdateTests.java +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.compute.implementation; - - -import com.azure.core.http.HttpPipeline; -import com.azure.core.management.Region; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.authorization.models.BuiltInRole; -import com.azure.resourcemanager.compute.ComputeManagementTest; -import com.azure.resourcemanager.compute.models.CachingTypes; -import com.azure.resourcemanager.compute.models.ResourceIdentityType; -import com.azure.resourcemanager.compute.models.VirtualMachine; -import com.azure.resourcemanager.compute.models.VirtualMachineExtension; -import com.azure.resourcemanager.compute.models.VirtualMachineSizeTypes; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -public class VirtualMachineUpdateTests extends ComputeManagementTest { - - private String rgName = ""; - - @Override - protected void initializeClients(HttpPipeline httpPipeline, AzureProfile profile) { - rgName = generateRandomResourceName("javacsmrg", 15); - super.initializeClients(httpPipeline, profile); - } - - @Override - protected void cleanUpResources() { - resourceManager.resourceGroups().beginDeleteByName(rgName); - } - - @Test - public void testVirtualMachineUpdate() { - final String vmname = "javavm1"; - - final String mySqlInstallScript = "https://raw.githubusercontent.com/Azure/azure-quickstart-templates/4397e808d07df60ff3cdfd1ae40999f0130eb1b3/mysql-standalone-server-ubuntu/scripts/install_mysql_server_5.6.sh"; - final String installCommand = "bash install_mysql_server_5.6.sh Abc.123x("; - List fileUris = new ArrayList<>(); - fileUris.add(mySqlInstallScript); - - VirtualMachine vm = computeManager.virtualMachines() - .define(vmname) - .withRegion(locationOrDefault(Region.US_EAST)) - .withNewResourceGroup(rgName) - .withNewPrimaryNetwork("10.0.0.0/28") - .withPrimaryPrivateIPAddressDynamic() - .withoutPrimaryPublicIPAddress() - .withLatestLinuxImage("Canonical", "UbuntuServer", "14.04.4-LTS") - .withRootUsername("Foo12") - .withSsh(sshPublicKey()) - .withSize(VirtualMachineSizeTypes.fromString("Standard_D2a_v4")) - .create(); - - VirtualMachine.Update vmUpdate = vm.update(); - Assertions.assertFalse(this.isVirtualMachineModifiedDuringUpdate(vm)); - - vmUpdate = vmUpdate.defineNewExtension("CustomScriptForLinux") - .withPublisher("Microsoft.OSTCExtensions") - .withType("CustomScriptForLinux") - .withVersion("1.4") - .withMinorVersionAutoUpgrade() - .withPublicSetting("fileUris", fileUris) - .withPublicSetting("commandToExecute", installCommand) - .attach(); - // extension added, but VM not modified - Assertions.assertFalse(this.isVirtualMachineModifiedDuringUpdate(vm)); - - // modified disk caching - vmUpdate = vmUpdate.withOSDiskCaching(CachingTypes.READ_ONLY); - Assertions.assertTrue(this.isVirtualMachineModifiedDuringUpdate(vm)); - - vmUpdate = vmUpdate.withOSDiskCaching(CachingTypes.READ_WRITE); - Assertions.assertFalse(this.isVirtualMachineModifiedDuringUpdate(vm)); - - // modified tag - vmUpdate = vmUpdate.withTag("key1", "value1"); - Assertions.assertTrue(this.isVirtualMachineModifiedDuringUpdate(vm)); - - vm = vmUpdate.apply(); - - // verify extensions - Map extensions = vm.listExtensions(); - Assertions.assertNotNull(extensions); - Assertions.assertFalse(extensions.isEmpty()); - VirtualMachineExtension customScriptExtension = extensions.get("CustomScriptForLinux"); - Assertions.assertNotNull(customScriptExtension); - - // verify tags - Assertions.assertEquals("value1", vm.tags().get("key1")); - - // modify msi - vm.update() - .withSystemAssignedManagedServiceIdentity() - .withSystemAssignedIdentityBasedAccessToCurrentResourceGroup(BuiltInRole.CONTRIBUTOR) - .apply(); - Assertions.assertTrue(this.isVirtualMachineModifiedDuringUpdate(vm)); - - // verify msi - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, vm.managedServiceIdentityType()); - Assertions.assertNotNull(vm.systemAssignedManagedServiceIdentityPrincipalId()); - } - - private boolean isVirtualMachineModifiedDuringUpdate(VirtualMachine vm) { - VirtualMachineImpl vmImpl = (VirtualMachineImpl) vm; - // this parameter is not correct for managed identities - return vmImpl.isVirtualMachineModifiedDuringUpdate(vmImpl.deepCopyInnerToUpdateParameter()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/resources/install_apache.sh b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/resources/install_apache.sh deleted file mode 100644 index d5387701d2c0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/resources/install_apache.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -sudo apt-get install -f - -sudo apt-get update - -# install apache -sudo apt-get -y install apache2 - -# restart Apache -sudo apachectl restart \ No newline at end of file diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/resources/junit-platform.properties b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/resources/junit-platform.properties deleted file mode 100644 index 202d099b3ee8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/resources/junit-platform.properties +++ /dev/null @@ -1,4 +0,0 @@ -junit.jupiter.execution.parallel.enabled=true -junit.jupiter.execution.parallel.mode.default=concurrent -junit.jupiter.execution.parallel.config.strategy=fixed -junit.jupiter.execution.parallel.config.fixed.parallelism=32 diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/resources/linux_diagnostics_public_config.json b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/resources/linux_diagnostics_public_config.json deleted file mode 100644 index 13e200af600d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/resources/linux_diagnostics_public_config.json +++ /dev/null @@ -1 +0,0 @@ -{"diagnosticMonitorConfiguration":{"metrics":{"resourceId":"%VirtualMachineResourceId%","metricAggregation":[{"scheduledTransferPeriod":"PT1H"},{"scheduledTransferPeriod":"PT1M"}]},"performanceCounters":{"performanceCounterConfiguration":[{"class":"Memory","counterSpecifier":"PercentAvailableMemory","table":"LinuxMemory"},{"class":"Memory","counterSpecifier":"AvailableMemory","table":"LinuxMemory"},{"class":"Memory","counterSpecifier":"UsedMemory","table":"LinuxMemory"},{"class":"Memory","counterSpecifier":"PercentUsedSwap","table":"LinuxMemory"},{"class":"Processor","counterSpecifier":"PercentProcessorTime","table":"LinuxCpu"},{"class":"Processor","counterSpecifier":"PercentIOWaitTime","table":"LinuxCpu"},{"class":"Processor","counterSpecifier":"PercentIdleTime","table":"LinuxCpu"},{"class":"PhysicalDisk","counterSpecifier":"AverageWriteTime","table":"LinuxDisk"},{"class":"PhysicalDisk","counterSpecifier":"AverageReadTime","table":"LinuxDisk"},{"class":"PhysicalDisk","counterSpecifier":"ReadBytesPerSecond","table":"LinuxDisk"},{"class":"PhysicalDisk","counterSpecifier":"WriteBytesPerSecond","table":"LinuxDisk"}]}}} \ No newline at end of file diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/resources/myTest.txt b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/resources/myTest.txt deleted file mode 100644 index a206b01f36a5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/resources/myTest.txt +++ /dev/null @@ -1 +0,0 @@ -ew0KICAgICJkYXRhIjogIk1JSUpwQUlCQXpDQ0NWNEdDU3FHU0liM0RRRUhBYUNDQ1U4RWdnbExNSUlKUnpDQ0JZd0dDU3FHU0liM0RRRUhBYUNDQlgwRWdnVjVNSUlGZFRDQ0JYRUdDeXFHU0liM0RRRU1DZ0VDb0lJRStqQ0NCUFl3S0FZS0tvWklodmNOQVF3QkF6QWFCQlRBazZLNnpCa1dodUhUTWRJUzZ6c203NDROWHdJQ0JBQUVnZ1RJYytwUVZrMlgwQ0g2TmNjWUtzdk00WXp1UUFpVUJ4dmljWnpCK0lsL0JHUnJLMFY5Myt1cUFHWlIvdG5aM3VrcEVUbm5rS1NaRWJHd2lPeXVBR2JKQTR4MkRZTktTUFRoYnlOdjJiWWRUZEIwUm9BOWNlbE9MaDZZMnozVjJTQUhtVGFhTHpRUVo3SUFxZWRBOVc0WnF0MGJGTElSRVYvSXZ6YkV3NC9PV3FCcjJCMkVSOUkzRlRXd0VjSHRzcS8zQlBIUUU3SHIxRFoveVpEdzlENGY1NUdCQ29oRElVeldzbk1IT0J1QkpIa3NKTjBIUjZ3OTVDVVZ2WGV5WGUwUUd3VTRQdmF0d21kOVpaSjh4MlhYcnd5SGpHSGRLNERrdXZSWGQrNHFZenc5YUJhblpsMzFpNlN6eWFITWVNc2NVVitFOXNsUnRiUGhCaks1MTJVYW82UThySytTYjFNaEZZeEpnOG1HaWNudFUvMUV4Y3Y2NTBmVk03L3VZTmEvaWR4NFU0dU5mMEdCeTFlSjcwaUlCaVRNZlRlUzZBcGp6dGZvY0dmbUpIUi9nQXV0SGVLd0NGV0lUbEtTUjd2dEhsTWZPcU5Ydkw1MFk5Yll1Y3B3eGZXd1NhQ3VRbnl5RUhMTkdLc1RLM3ozV0Q3LzBTcU1jRlorbnVkOXJnY0trMXJqNUpsNmFFK2ZTN0FDMlR2dnM1bG5JOTNpQm9SaWQrNnBKcGJOV1dWb2VtN3lzVTBWNFhoazVlK0FJSlFIV0x1UU9iUVpBdVZJLzhOakF6dHZ4bmpjcDFOdEtYdVZsNlRxY3BmSERRdlNjRFYrQ2pXRE1kTnQ0NDlGRVV0VFV1UjIrT0dCMjJyNmhKVlUrZ0trSWxPLy9CT1dOMXpwcGZYOUV1aHRSZzl4SjdwaVFFTzZmT05MdVByaUVrb3Vpd29mRnRXME9oYlJtUzZsOFlXMkFGNFZGUTg0dnVFUTNveFVqUkpuMWxJVVprMVRrODFpbTlCYjdKYlp1NmxtaG9LS2RUb2NVYk5iRDM0MG5aMXNPUm8ycFB1bHJpNlRjcTdzVW1xRHIxMnpOQUM2OGhwRTJoelZmNXExd3Y1cUt0eHJhWTJ4SUoyTGxKT0F1U3RxdllacU1IR3hNR0kyMHRpZkJoeDRpQ1lKbXplQ1I1WFBZdDkxblJlSzVSMldLYzBkVnJROGpaMnRxNzJQWnRrVGhMeWdWam4rSTZvODhoRE44N1djRGE5R0Npc0QwU25FMlArSG4xVi9vSERCOXRoZmhLeHdCMmtoT1JPeGZEdDR6Qk9TNHBUYjgvOThheWE0Qzh2aVRBcXY3WDVuTXFrbTdHbmpOVXZObk9OalozRmVmWCtXcHh5UWIwQ3NYYi9oc3dqR2ZScU5HaGxZV2xnQ2JpNmJPV0FEMnZhb1NvT1hHVXJQVzNJQWViVklCQldUV1F1bms2S0EvUkxHVm1JUXh0K3JxOUUyeFlmNHFpbUd1V2FZVkRmbUtQdTBJbnd0WmZjSEpFMjh6VldOakRyTmNsYlFaV2g4Z2FnUzZZU1d5ZXltaExJY1h4S3dBQy8yKzU0NDg1VU1wcXlPSXg0blVObUt2cklsTmc5S0M5VXRtVFNnVTdoRlArREdpL255TUtNNDJYYVhZWFRIRkNkdGNCWkw4UnJLVS9NQ3I2VXdXMEJkNjhQdzc1WEtCN2paT3dkM0d2ZDhXTXUzbk1EUTZCTGUvZWY4OTdIV25HRnN4MHhGM01pNzZaN1NlOVhTa2E4QTBuQnlReGJrTDF2UW5nLzJZMEhoMURjTWtOdjFyQWxmRFU0cnEyb05oWHJrZXNzRWZFczEvTWN1RWxoSGJqSHJxaTR0bGZaZ1dWZ25QUzc4YVpTWHNhZDhUWHZqTTd3aTBjWWZNcUtXa1A2ZXA1VWpoL2dWdStlOWFlNGdHbDBjUDdDRnpMUVJvWXpVU1RJSVF3U3hVSHpBaVdVUGhkc25RZXZiRzBJcDZEclZjQ3pKTytuTWp1QlA0cHJWRlc1MFMvNW9vZXlibWZFbTErb21PUjB2b0RkNkVSWVdZaHRydmJSeDQzQXUwdDZRK1ZQQURGazUwd2hHNXQ1VkFoZEZqQjJ6TVNYUFdOb1VvUjlJdTBjaXRwK3g0dWxRVHFZaXJJV01hcXhWTVdRd1B3WUpLb1pJaHZjTkFRa1VNVEllTUFCM0FHa0FiZ0JrQUc4QWR3QnpBR0VBZWdCMUFISUFaUUJ5QUdVQWJRQnZBSFFBWlFCaEFHTUFZd0JsQUhNQWN6QWhCZ2txaGtpRzl3MEJDUlV4RkFRU1ZHbHRaU0F4TkRjNE9URXpNakEyT1RneE1JSURzd1lKS29aSWh2Y05BUWNHb0lJRHBEQ0NBNkFDQVFBd2dnT1pCZ2txaGtpRzl3MEJCd0V3S0FZS0tvWklodmNOQVF3QkJqQWFCQlI3Ump3UTNWdWpLcWczeGN4M1Fmandub1hNaWdJQ0JBQ0FnZ05neDYxRHlyK0Z4WWU4aElPQTA5blZSODFXbEFENll5NkdWTlc1S1J1anc3dUpwSmJMWTZub0VhTmJpTWNLNWNVMGNaakpveVdXc2ZuVklnQ1dnVjU1Um1Yck5mbEhTV2pRek1JVVlkMGI2MFc3cTR5VnJ5R2dKbHZIdzBCWmNLbVNOdTNiYlBJSFljNDdxMHpMUlprdFNJTzkrbnptQlpab1VTSmkyZUswbTRiNGpPdmduZWtrVG9PT3NPRnUxNFYzUTZYOFlTSmlMSHVuS0VkRWpuTkZlZlJrOW0vTGgzOGJOdEpueVowSVUwU1JXbzFYMktZVWcybThlRGxmWGNTek41U0JmNkJIeEJzb1dqS0JmUVlNa2l1eFBvVGpPZERyUTFSeVN4dHJ4eXNrOWhxa2JwcytpN1VWemJxZlc1RWFVbmpIK1BxUms3QmZKdlV1MnZqSjVXblIwRW10dFlRcDhaZm1QSW1wOGJVNkZaWDMreFRpQ2VLZDlyZFdrSXlDSm5KQnRWdDN3VHVZMzh2R3oxR2I0d2x1REdQMmtRZGxTb1NnQXAzbVExdmx1Y1ZCK2phazNlVncrd0UwZ2pzRk14cXlaRlNSekhpVGxPK3RZbExwOFd5eXk0bGhDZlhiZ1FlSmY0QlRtdmxwTDZTUGczbDlUMnZTajZCSGpUOVhOZm0vcmFpcnFIaWFYa2tMVHd5eUpLNXJWRHBxYkRlWG5aT0krS1dhcVNOcnJFaHVMbHdvZjFoSlJaM1lCVU5UWU9wMWVQNmU5UW5NdXpEMzNSOSt4TzRBWkllVXFKKzhqalVYT1dFN1lqUkM2clJoYVJRNVp5UkpVV1FCRDNQTzVMVm5aVWRxdW9xL0ttTVE0SG5lL2UzeWRNV2l4TzF4OExiZkZYV3pJOHoyQlVRaEwvYUcyVzdYSmJzUGJ0ZEZySWluNW5ZTStONytQK1E0Q29Sekt0L010a2I5SDRBNWtrZmVmdGhwbTMySEw5bkRlR0V4K2RRaHBpekVMNjRMRis5ZWV6QTFxMFNacTNqQjl4cHlHeWxZNWJXMHBNR1lUYjdpdUdvVWlUK1hRNFNhRnJ5K05hdXNQbGcvQzBSUWt5dWliY1AzdDBsVjhaOHc2WXFyKzhlUnJHdFhlbkhMZGZxTVBxQ0FkR1M0Q3grbHh0Qy9UTGFUZnRURWQ0Q3d1QTNCUVo5S1pYS0hhOWVBbUhxM1FKU1Eyb1B6b1pJWWVtdmZ3N3RIYS9IaENnbXZ0R2FST2hFN2xjSThOeWhqNlJxQjJzZllBOEpjSHBQQUZTRG1zMlJlY05BeEM4NjdJVmE3aHNhbDNJa2tiMFdHVnU0Q04vbDEySDdqUlVaaHhRUENVVDlPS0tvMzFMbC9nMUhGN2pYdlIyU2VXSlIwekxXN3dNVHNGV2VtaFZvamFhQ0RwVmVMVmdWOGk5RWNSck50RDRSVWJmTEZFTDBHSVY2QXhvNWFKdzZ6QTVLeE9INWFXa2tvVTUveWFwbFdUamt6OGRJMTBjRlA0cTAyTUQwd0lUQUpCZ1VyRGdNQ0dnVUFCQlJtelZSd0hzUjk5YWlVWm1ERUhEK3JNYjVsZ1FRVXNVSWFsaW9vcWVscWpOeEdTVENvaHBIZDZyRUNBZ1FBIiwNCiAgICAiZGF0YVR5cGUiOiAicGZ4IiwNCiAgICAicGFzc3dvcmQiOiAiQWJjMTIzIg0KfQ== \ No newline at end of file diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/resources/windows_diagnostics_public_config.xml b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/resources/windows_diagnostics_public_config.xml deleted file mode 100644 index 72d1eb7cef74..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/test/resources/windows_diagnostics_public_config.xml +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/CHANGELOG.md b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/CHANGELOG.md deleted file mode 100644 index 5ad4d9420fe0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/CHANGELOG.md +++ /dev/null @@ -1,8 +0,0 @@ -# Release History - -## 1.0.0-hybrid (2022-01-12) - -- Azure Resource Manager Containerregistry client library for Java (Hybrid) using API Profiles to allow building hybrid cloud solutions -that target both Azure and Azure Stack Hub. -- Supports api versions in the 2020-09-01-hybrid api profile -- Requires Azure Stack Update 2102+ diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/README.md b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/README.md deleted file mode 100644 index b3c085f02e48..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/README.md +++ /dev/null @@ -1,135 +0,0 @@ -# Azure Resource Manager Containerregistry client library for Java (Hybrid) - -Azure Resource Manager Containerregistry client library for Java (Hybrid) using [API Profiles][api_profile] to allow building hybrid cloud solutions -that target both Azure and Azure Stack Hub. - -For documentation on how to use this package, please see [Azure Management Libraries for Java (Hybrid)][resourcemanagerhybrid_lib]. - -## Getting started - -### Prerequisites - -- [Java Development Kit (JDK)][jdk] with version 8 or above -- [Azure Subscription][azure_subscription] - -### Adding the package to your product - -```xml - - com.azure.resourcemanager - azure-resourcemanager-containerregistry - 1.0.0-hybrid - -``` - -### Include the recommended packages - -Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. - -[Azure Identity][azure_identity] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation. - -### Authentication - -By default, Azure Active Directory token authentication depends on correct configure of following environment variables. - -- `AZURE_CLIENT_ID` for Azure client ID. -- `AZURE_TENANT_ID` for Azure tenant ID. -- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. - -In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`. - -With above configuration, `azure` client can be authenticated by following code: - -```java com.azure.resourcemanager.containerregistry.authenticate -String armEndpoint = "https://management.."; -AzureProfile profile = new AzureProfile(getAzureEnvironmentFromArmEndpoint(armEndpoint)); -TokenCredential credential = new DefaultAzureCredentialBuilder() - .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) - .build(); -ContainerRegistryManager manager = ContainerRegistryManager - .authenticate(credential, profile); -``` - -Change `armEndpoint` to point to the Azure Resource Manager endpoint of your Azure Stack Hub. The azure environment's -properties above can be populated with the following example: - -```java com.azure.resourcemanager.containerregistry.getazureenvironment -private static AzureEnvironment getAzureEnvironmentFromArmEndpoint(String armEndpoint) { - // Create HTTP client and request - HttpClient httpClient = HttpClient.createDefault(); - - HttpRequest request = new HttpRequest(HttpMethod.GET, - String.format("%s/metadata/endpoints?api-version=2019-10-01", armEndpoint)) - .setHeader("accept", "application/json"); - - // Execute the request and read the response - HttpResponse response = httpClient.send(request).block(); - if (response.getStatusCode() != 200) { - throw new RuntimeException("Failed : HTTP error code : " + response.getStatusCode()); - } - String body = response.getBodyAsString().block(); - try { - ArrayNode metadataArray = JacksonAdapter.createDefaultSerializerAdapter() - .deserialize(body, ArrayNode.class, SerializerEncoding.JSON); - - if (metadataArray == null || metadataArray.isEmpty()) { - throw new RuntimeException("Failed to find metadata : " + body); - } - - JsonNode metadata = metadataArray.iterator().next(); - AzureEnvironment azureEnvironment = new AzureEnvironment(new HashMap() { - { - put("managementEndpointUrl", metadata.at("/authentication/audiences/0").asText()); - put("resourceManagerEndpointUrl", armEndpoint); - put("galleryEndpointUrl", metadata.at("/gallery").asText()); - put("activeDirectoryEndpointUrl", metadata.at("/authentication/loginEndpoint").asText()); - put("activeDirectoryResourceId", metadata.at("/authentication/audiences/0").asText()); - put("activeDirectoryGraphResourceId", metadata.at("/graph").asText()); - put("storageEndpointSuffix", "." + metadata.at("/suffixes/storage").asText()); - put("keyVaultDnsSuffix", "." + metadata.at("/suffixes/keyVaultDns").asText()); - } - }); - return azureEnvironment; - } catch (IOException ioe) { - ioe.printStackTrace(); - throw new RuntimeException(ioe); - } -} -``` - -When targeting a hybrid solution to global Azure instead of your Azure Stack Hub, `AzureEnvironment.AZURE` can be used instead. - -See [Authentication][authenticate] for more options. - -## Key concepts - -See [API design][design] for general introduction on design and key concepts on Azure Management Libraries. - -## Examples - -See [Samples][sample] for code snippets and samples. - -## Troubleshooting - -## Next steps - -## Contributing - -For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). - -1. Fork it -1. Create your feature branch (`git checkout -b my-new-feature`) -1. Commit your changes (`git commit -am 'Add some feature'`) -1. Push to the branch (`git push origin my-new-feature`) -1. Create new Pull Request - - -[jdk]: https://learn.microsoft.com/java/azure/jdk/ -[azure_subscription]: https://azure.microsoft.com/free/ -[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity -[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty -[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md -[sample]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/SAMPLE.md -[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md -[api_profile]: https://learn.microsoft.com/azure-stack/user/azure-stack-version-profiles -[resourcemanagerhybrid_lib]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanagerhybrid diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/pom.xml b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/pom.xml deleted file mode 100644 index 255e49c6159e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/pom.xml +++ /dev/null @@ -1,137 +0,0 @@ - - - 4.0.0 - - com.azure - azure-client-sdk-parent - 1.7.0 - ../../parents/azure-client-sdk-parent - - - com.azure.resourcemanager - azure-resourcemanager-containerregistry - 1.0.0-hybrid - jar - - Microsoft Azure SDK for Container Registry Management (Hybrid) - This package contains Microsoft Azure Container Registry Hybrid SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt - https://github.com/Azure/azure-sdk-for-java - - - - The MIT License (MIT) - http://opensource.org/licenses/MIT - repo - - - - - https://github.com/Azure/azure-sdk-for-java - scm:git:git@github.com:Azure/azure-sdk-for-java.git - HEAD - - - - - 0.10 - 0.05 - - - --add-opens com.azure.resourcemanager.containerregistry/com.azure.resourcemanager.containerregistry=ALL-UNNAMED - --add-opens com.azure.core/com.azure.core.implementation.jackson=ALL-UNNAMED - - - - - - microsoft - Microsoft - - - - - - com.azure.resourcemanager - azure-resourcemanager-resources - 1.0.0-hybrid - - - com.azure.resourcemanager - azure-resourcemanager-storage - 1.0.0-hybrid - - - org.slf4j - slf4j-simple - 1.7.36 - test - - - org.junit.jupiter - junit-jupiter-engine - 5.13.4 - test - - - org.junit.jupiter - junit-jupiter-api - 5.13.4 - test - - - com.azure - azure-core-http-netty - 1.16.2 - test - - - - - azure-mgmt-sdk-test-jar - - - !maven.test.skip - - - - - com.azure.resourcemanager - azure-resourcemanager-test - 1.0.0-hybrid - test - - - - - - - - org.apache.maven.plugins - maven-jar-plugin - 3.4.2 - - - - true - true - - - - - - - org.jacoco - jacoco-maven-plugin - 0.8.13 - - - com/azure/resourcemanager/**/fluent/**/* - com/azure/resourcemanager/**/models/**/* - com/azure/resourcemanager/**/implementation/*ClientImpl* - com/azure/resourcemanager/**/implementation/*ClientBuilder* - - - - - - diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/ContainerRegistryManager.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/ContainerRegistryManager.java deleted file mode 100644 index 3f6c4d748d6e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/ContainerRegistryManager.java +++ /dev/null @@ -1,138 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.containerregistry; - -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpPipeline; -import com.azure.resourcemanager.containerregistry.fluent.ContainerRegistryManagementClient; -import com.azure.resourcemanager.containerregistry.implementation.ContainerRegistryManagementClientBuilder; -import com.azure.resourcemanager.containerregistry.implementation.RegistriesImpl; -import com.azure.resourcemanager.containerregistry.implementation.RegistryTaskRunsImpl; -import com.azure.resourcemanager.containerregistry.implementation.RegistryTasksImpl; -import com.azure.resourcemanager.containerregistry.models.Registries; -import com.azure.resourcemanager.containerregistry.models.RegistryTaskRuns; -import com.azure.resourcemanager.containerregistry.models.RegistryTasks; -import com.azure.resourcemanager.resources.fluentcore.arm.AzureConfigurable; -import com.azure.resourcemanager.resources.fluentcore.arm.implementation.AzureConfigurableImpl; -import com.azure.resourcemanager.resources.fluentcore.arm.Manager; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.resources.fluentcore.utils.HttpPipelineProvider; -import com.azure.resourcemanager.storage.StorageManager; - -import java.util.Objects; - -/** Entry point to Azure container registry management. */ -public final class ContainerRegistryManager - extends Manager { - // The service managers - private RegistriesImpl registries; - private final StorageManager storageManager; - private RegistryTasksImpl tasks; - private RegistryTaskRunsImpl registryTaskRuns; - - /** - * Get a Configurable instance that can be used to create ContainerRegistryManager with optional configuration. - * - * @return Configurable - */ - public static Configurable configure() { - return new ContainerRegistryManager.ConfigurableImpl(); - } - - /** - * Creates an instance of ContainerRegistryManager that exposes Registry resource management API entry points. - * - * @param credential the credential to use - * @param profile the profile to use - * @return the ContainerRegistryManager - */ - public static ContainerRegistryManager authenticate(TokenCredential credential, AzureProfile profile) { - Objects.requireNonNull(credential, "'credential' cannot be null."); - Objects.requireNonNull(profile, "'profile' cannot be null."); - return authenticate(HttpPipelineProvider.buildHttpPipeline(credential, profile), profile); - } - - /** - * Creates an instance of ContainerRegistryManager that exposes Registry resource management API entry points. - * - * @param httpPipeline the HttpPipeline to be used for API calls. - * @param profile the profile to use - * @return the ContainerRegistryManager - */ - public static ContainerRegistryManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { - Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); - Objects.requireNonNull(profile, "'profile' cannot be null."); - return new ContainerRegistryManager(httpPipeline, profile); - } - - /** The interface allowing configurations to be set. */ - public interface Configurable extends AzureConfigurable { - /** - * Creates an instance of ContainerRegistryManager that exposes Registry resource management API entry points. - * - * @param credential the credential to use - * @param profile the profile to use - * @return the ContainerRegistryManager - */ - ContainerRegistryManager authenticate(TokenCredential credential, AzureProfile profile); - } - - /** The implementation for Configurable interface. */ - private static final class ConfigurableImpl extends AzureConfigurableImpl implements Configurable { - @Override - public ContainerRegistryManager authenticate(TokenCredential credential, AzureProfile profile) { - return ContainerRegistryManager.authenticate(buildHttpPipeline(credential, profile), profile); - } - } - - /** - * Creates a ContainerRegistryManager. - * - * @param httpPipeline the HttpPipeline used to authenticate through ContainerRegistryManager. - * @param profile the profile to use - */ - private ContainerRegistryManager(HttpPipeline httpPipeline, AzureProfile profile) { - super( - httpPipeline, - profile, - new ContainerRegistryManagementClientBuilder() - .pipeline(httpPipeline) - .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) - .subscriptionId(profile.getSubscriptionId()) - .buildClient()); - storageManager = StorageManager.authenticate(httpPipeline, profile); - } - - /** @return the availability set resource management API entry point */ - public Registries containerRegistries() { - if (this.registries == null) { - this.registries = new RegistriesImpl(this, this.storageManager); - } - return this.registries; - } - - /** - * Gets the current instance of ContainerRegistryManager's tasks. - * - * @return the tasks of the current instance of ContainerRegistryManager. - */ - public RegistryTasks containerRegistryTasks() { - if (this.tasks == null) { - this.tasks = new RegistryTasksImpl(this); - } - return this.tasks; - } - - /** - * Gets the current instance of ContainerRegistryManager's registry task runs. - * - * @return the registry task runs of the current instance of ContainerRegistryManager. - */ - public RegistryTaskRuns registryTaskRuns() { - if (this.registryTaskRuns == null) { - this.registryTaskRuns = new RegistryTaskRunsImpl(this); - } - return this.registryTaskRuns; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/ContainerRegistryManagementClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/ContainerRegistryManagementClient.java deleted file mode 100644 index 2239b151d9a1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/ContainerRegistryManagementClient.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.fluent; - -import com.azure.core.http.HttpPipeline; -import java.time.Duration; - -/** The interface for ContainerRegistryManagementClient class. */ -public interface ContainerRegistryManagementClient { - /** - * Gets The Microsoft Azure subscription ID. - * - * @return the subscriptionId value. - */ - String getSubscriptionId(); - - /** - * Gets server parameter. - * - * @return the endpoint value. - */ - String getEndpoint(); - - /** - * Gets The HTTP pipeline to send requests through. - * - * @return the httpPipeline value. - */ - HttpPipeline getHttpPipeline(); - - /** - * Gets The default poll interval for long-running operation. - * - * @return the defaultPollInterval value. - */ - Duration getDefaultPollInterval(); - - /** - * Gets the RegistriesClient object to access its operations. - * - * @return the RegistriesClient object. - */ - RegistriesClient getRegistries(); - - /** - * Gets the OperationsClient object to access its operations. - * - * @return the OperationsClient object. - */ - OperationsClient getOperations(); - - /** - * Gets the ReplicationsClient object to access its operations. - * - * @return the ReplicationsClient object. - */ - ReplicationsClient getReplications(); - - /** - * Gets the WebhooksClient object to access its operations. - * - * @return the WebhooksClient object. - */ - WebhooksClient getWebhooks(); - - /** - * Gets the RunsClient object to access its operations. - * - * @return the RunsClient object. - */ - RunsClient getRuns(); - - /** - * Gets the TasksClient object to access its operations. - * - * @return the TasksClient object. - */ - TasksClient getTasks(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/OperationsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/OperationsClient.java deleted file mode 100644 index ec2a67bf4281..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/OperationsClient.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.containerregistry.fluent.models.OperationDefinitionInner; - -/** An instance of this class provides access to all the operations defined in OperationsClient. */ -public interface OperationsClient { - /** - * Lists all of the available Azure Container Registry REST API operations. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list container registry operations as paginated response with {@link - * PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Lists all of the available Azure Container Registry REST API operations. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list container registry operations as paginated response with {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Lists all of the available Azure Container Registry REST API operations. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list container registry operations as paginated response with {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/RegistriesClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/RegistriesClient.java deleted file mode 100644 index 7e04714d4d62..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/RegistriesClient.java +++ /dev/null @@ -1,972 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.containerregistry.fluent.models.RegistryInner; -import com.azure.resourcemanager.containerregistry.fluent.models.RegistryListCredentialsResultInner; -import com.azure.resourcemanager.containerregistry.fluent.models.RegistryNameStatusInner; -import com.azure.resourcemanager.containerregistry.fluent.models.RegistryUsageListResultInner; -import com.azure.resourcemanager.containerregistry.fluent.models.RunInner; -import com.azure.resourcemanager.containerregistry.fluent.models.SourceUploadDefinitionInner; -import com.azure.resourcemanager.containerregistry.models.ImportImageParameters; -import com.azure.resourcemanager.containerregistry.models.RegenerateCredentialParameters; -import com.azure.resourcemanager.containerregistry.models.RegistryNameCheckRequest; -import com.azure.resourcemanager.containerregistry.models.RegistryUpdateParameters; -import com.azure.resourcemanager.containerregistry.models.RunRequest; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in RegistriesClient. */ -public interface RegistriesClient - extends InnerSupportsGet, InnerSupportsListing, InnerSupportsDelete { - /** - * Copies an image to this container registry from the specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param parameters The parameters specifying the image to copy and the source container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> importImageWithResponseAsync( - String resourceGroupName, String registryName, ImportImageParameters parameters); - - /** - * Copies an image to this container registry from the specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param parameters The parameters specifying the image to copy and the source container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, Void> beginImportImageAsync( - String resourceGroupName, String registryName, ImportImageParameters parameters); - - /** - * Copies an image to this container registry from the specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param parameters The parameters specifying the image to copy and the source container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginImportImage( - String resourceGroupName, String registryName, ImportImageParameters parameters); - - /** - * Copies an image to this container registry from the specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param parameters The parameters specifying the image to copy and the source container registry. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginImportImage( - String resourceGroupName, String registryName, ImportImageParameters parameters, Context context); - - /** - * Copies an image to this container registry from the specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param parameters The parameters specifying the image to copy and the source container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono importImageAsync(String resourceGroupName, String registryName, ImportImageParameters parameters); - - /** - * Copies an image to this container registry from the specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param parameters The parameters specifying the image to copy and the source container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void importImage(String resourceGroupName, String registryName, ImportImageParameters parameters); - - /** - * Copies an image to this container registry from the specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param parameters The parameters specifying the image to copy and the source container registry. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void importImage(String resourceGroupName, String registryName, ImportImageParameters parameters, Context context); - - /** - * Checks whether the container registry name is available for use. The name must contain only alphanumeric - * characters, be globally unique, and between 5 and 50 characters in length. - * - * @param registryNameCheckRequest The object containing information for the availability request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to check the availability of a container registry name along with {@link - * Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> checkNameAvailabilityWithResponseAsync( - RegistryNameCheckRequest registryNameCheckRequest); - - /** - * Checks whether the container registry name is available for use. The name must contain only alphanumeric - * characters, be globally unique, and between 5 and 50 characters in length. - * - * @param registryNameCheckRequest The object containing information for the availability request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to check the availability of a container registry name on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono checkNameAvailabilityAsync(RegistryNameCheckRequest registryNameCheckRequest); - - /** - * Checks whether the container registry name is available for use. The name must contain only alphanumeric - * characters, be globally unique, and between 5 and 50 characters in length. - * - * @param registryNameCheckRequest The object containing information for the availability request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to check the availability of a container registry name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RegistryNameStatusInner checkNameAvailability(RegistryNameCheckRequest registryNameCheckRequest); - - /** - * Checks whether the container registry name is available for use. The name must contain only alphanumeric - * characters, be globally unique, and between 5 and 50 characters in length. - * - * @param registryNameCheckRequest The object containing information for the availability request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to check the availability of a container registry name along with {@link - * Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response checkNameAvailabilityWithResponse( - RegistryNameCheckRequest registryNameCheckRequest, Context context); - - /** - * Gets the properties of the specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the specified container registry along with {@link Response} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String registryName); - - /** - * Gets the properties of the specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the specified container registry on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync(String resourceGroupName, String registryName); - - /** - * Gets the properties of the specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the specified container registry. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RegistryInner getByResourceGroup(String resourceGroupName, String registryName); - - /** - * Gets the properties of the specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the specified container registry along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String registryName, Context context); - - /** - * Creates a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param registry The parameters for creating a container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object that represents a container registry along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createWithResponseAsync( - String resourceGroupName, String registryName, RegistryInner registry); - - /** - * Creates a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param registry The parameters for creating a container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of an object that represents a container registry. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, RegistryInner> beginCreateAsync( - String resourceGroupName, String registryName, RegistryInner registry); - - /** - * Creates a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param registry The parameters for creating a container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of an object that represents a container registry. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, RegistryInner> beginCreate( - String resourceGroupName, String registryName, RegistryInner registry); - - /** - * Creates a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param registry The parameters for creating a container registry. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of an object that represents a container registry. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, RegistryInner> beginCreate( - String resourceGroupName, String registryName, RegistryInner registry, Context context); - - /** - * Creates a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param registry The parameters for creating a container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object that represents a container registry on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createAsync(String resourceGroupName, String registryName, RegistryInner registry); - - /** - * Creates a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param registry The parameters for creating a container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object that represents a container registry. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RegistryInner create(String resourceGroupName, String registryName, RegistryInner registry); - - /** - * Creates a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param registry The parameters for creating a container registry. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object that represents a container registry. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RegistryInner create(String resourceGroupName, String registryName, RegistryInner registry, Context context); - - /** - * Deletes a container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync(String resourceGroupName, String registryName); - - /** - * Deletes a container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String registryName); - - /** - * Deletes a container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String registryName); - - /** - * Deletes a container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, Context context); - - /** - * Deletes a container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String registryName); - - /** - * Deletes a container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String registryName); - - /** - * Deletes a container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String registryName, Context context); - - /** - * Updates a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param registryUpdateParameters The parameters for updating a container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object that represents a container registry along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> updateWithResponseAsync( - String resourceGroupName, String registryName, RegistryUpdateParameters registryUpdateParameters); - - /** - * Updates a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param registryUpdateParameters The parameters for updating a container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of an object that represents a container registry. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, RegistryInner> beginUpdateAsync( - String resourceGroupName, String registryName, RegistryUpdateParameters registryUpdateParameters); - - /** - * Updates a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param registryUpdateParameters The parameters for updating a container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of an object that represents a container registry. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, RegistryInner> beginUpdate( - String resourceGroupName, String registryName, RegistryUpdateParameters registryUpdateParameters); - - /** - * Updates a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param registryUpdateParameters The parameters for updating a container registry. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of an object that represents a container registry. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, RegistryInner> beginUpdate( - String resourceGroupName, - String registryName, - RegistryUpdateParameters registryUpdateParameters, - Context context); - - /** - * Updates a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param registryUpdateParameters The parameters for updating a container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object that represents a container registry on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAsync( - String resourceGroupName, String registryName, RegistryUpdateParameters registryUpdateParameters); - - /** - * Updates a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param registryUpdateParameters The parameters for updating a container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object that represents a container registry. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RegistryInner update( - String resourceGroupName, String registryName, RegistryUpdateParameters registryUpdateParameters); - - /** - * Updates a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param registryUpdateParameters The parameters for updating a container registry. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object that represents a container registry. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RegistryInner update( - String resourceGroupName, - String registryName, - RegistryUpdateParameters registryUpdateParameters, - Context context); - - /** - * Lists all the container registries under the specified resource group. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list container registries as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName); - - /** - * Lists all the container registries under the specified resource group. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list container registries as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Lists all the container registries under the specified resource group. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list container registries as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * Lists all the container registries under the specified subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list container registries as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Lists all the container registries under the specified subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list container registries as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Lists all the container registries under the specified subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list container registries as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Lists the login credentials for the specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the ListCredentials operation along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listCredentialsWithResponseAsync( - String resourceGroupName, String registryName); - - /** - * Lists the login credentials for the specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the ListCredentials operation on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listCredentialsAsync(String resourceGroupName, String registryName); - - /** - * Lists the login credentials for the specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the ListCredentials operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RegistryListCredentialsResultInner listCredentials(String resourceGroupName, String registryName); - - /** - * Lists the login credentials for the specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the ListCredentials operation along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listCredentialsWithResponse( - String resourceGroupName, String registryName, Context context); - - /** - * Regenerates one of the login credentials for the specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param regenerateCredentialParameters Specifies name of the password which should be regenerated -- password or - * password2. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the ListCredentials operation along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> regenerateCredentialWithResponseAsync( - String resourceGroupName, String registryName, RegenerateCredentialParameters regenerateCredentialParameters); - - /** - * Regenerates one of the login credentials for the specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param regenerateCredentialParameters Specifies name of the password which should be regenerated -- password or - * password2. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the ListCredentials operation on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono regenerateCredentialAsync( - String resourceGroupName, String registryName, RegenerateCredentialParameters regenerateCredentialParameters); - - /** - * Regenerates one of the login credentials for the specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param regenerateCredentialParameters Specifies name of the password which should be regenerated -- password or - * password2. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the ListCredentials operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RegistryListCredentialsResultInner regenerateCredential( - String resourceGroupName, String registryName, RegenerateCredentialParameters regenerateCredentialParameters); - - /** - * Regenerates one of the login credentials for the specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param regenerateCredentialParameters Specifies name of the password which should be regenerated -- password or - * password2. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the ListCredentials operation along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response regenerateCredentialWithResponse( - String resourceGroupName, - String registryName, - RegenerateCredentialParameters regenerateCredentialParameters, - Context context); - - /** - * Gets the quota usages for the specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the quota usages for the specified container registry along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listUsagesWithResponseAsync( - String resourceGroupName, String registryName); - - /** - * Gets the quota usages for the specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the quota usages for the specified container registry on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listUsagesAsync(String resourceGroupName, String registryName); - - /** - * Gets the quota usages for the specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the quota usages for the specified container registry. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RegistryUsageListResultInner listUsages(String resourceGroupName, String registryName); - - /** - * Gets the quota usages for the specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the quota usages for the specified container registry along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listUsagesWithResponse( - String resourceGroupName, String registryName, Context context); - - /** - * Schedules a new run based on the request parameters and add it to the run queue. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runRequest The parameters of a run that needs to scheduled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return run resource properties along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> scheduleRunWithResponseAsync( - String resourceGroupName, String registryName, RunRequest runRequest); - - /** - * Schedules a new run based on the request parameters and add it to the run queue. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runRequest The parameters of a run that needs to scheduled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of run resource properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, RunInner> beginScheduleRunAsync( - String resourceGroupName, String registryName, RunRequest runRequest); - - /** - * Schedules a new run based on the request parameters and add it to the run queue. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runRequest The parameters of a run that needs to scheduled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of run resource properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, RunInner> beginScheduleRun( - String resourceGroupName, String registryName, RunRequest runRequest); - - /** - * Schedules a new run based on the request parameters and add it to the run queue. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runRequest The parameters of a run that needs to scheduled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of run resource properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, RunInner> beginScheduleRun( - String resourceGroupName, String registryName, RunRequest runRequest, Context context); - - /** - * Schedules a new run based on the request parameters and add it to the run queue. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runRequest The parameters of a run that needs to scheduled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return run resource properties on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono scheduleRunAsync(String resourceGroupName, String registryName, RunRequest runRequest); - - /** - * Schedules a new run based on the request parameters and add it to the run queue. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runRequest The parameters of a run that needs to scheduled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return run resource properties. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RunInner scheduleRun(String resourceGroupName, String registryName, RunRequest runRequest); - - /** - * Schedules a new run based on the request parameters and add it to the run queue. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runRequest The parameters of a run that needs to scheduled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return run resource properties. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RunInner scheduleRun(String resourceGroupName, String registryName, RunRequest runRequest, Context context); - - /** - * Get the upload location for the user to be able to upload the source. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the upload location for the user to be able to upload the source along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getBuildSourceUploadUrlWithResponseAsync( - String resourceGroupName, String registryName); - - /** - * Get the upload location for the user to be able to upload the source. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the upload location for the user to be able to upload the source on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getBuildSourceUploadUrlAsync(String resourceGroupName, String registryName); - - /** - * Get the upload location for the user to be able to upload the source. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the upload location for the user to be able to upload the source. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SourceUploadDefinitionInner getBuildSourceUploadUrl(String resourceGroupName, String registryName); - - /** - * Get the upload location for the user to be able to upload the source. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the upload location for the user to be able to upload the source along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getBuildSourceUploadUrlWithResponse( - String resourceGroupName, String registryName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/ReplicationsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/ReplicationsClient.java deleted file mode 100644 index 0df63288f111..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/ReplicationsClient.java +++ /dev/null @@ -1,491 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.containerregistry.fluent.models.ReplicationInner; -import com.azure.resourcemanager.containerregistry.models.ReplicationUpdateParameters; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ReplicationsClient. */ -public interface ReplicationsClient { - /** - * Gets the properties of the specified replication. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param replicationName The name of the replication. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the specified replication along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync( - String resourceGroupName, String registryName, String replicationName); - - /** - * Gets the properties of the specified replication. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param replicationName The name of the replication. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the specified replication on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync(String resourceGroupName, String registryName, String replicationName); - - /** - * Gets the properties of the specified replication. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param replicationName The name of the replication. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the specified replication. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ReplicationInner get(String resourceGroupName, String registryName, String replicationName); - - /** - * Gets the properties of the specified replication. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param replicationName The name of the replication. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the specified replication along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String registryName, String replicationName, Context context); - - /** - * Creates a replication for a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param replicationName The name of the replication. - * @param replication The parameters for creating a replication. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object that represents a replication for a container registry along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createWithResponseAsync( - String resourceGroupName, String registryName, String replicationName, ReplicationInner replication); - - /** - * Creates a replication for a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param replicationName The name of the replication. - * @param replication The parameters for creating a replication. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of an object that represents a replication for a container registry. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, ReplicationInner> beginCreateAsync( - String resourceGroupName, String registryName, String replicationName, ReplicationInner replication); - - /** - * Creates a replication for a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param replicationName The name of the replication. - * @param replication The parameters for creating a replication. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of an object that represents a replication for a container registry. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ReplicationInner> beginCreate( - String resourceGroupName, String registryName, String replicationName, ReplicationInner replication); - - /** - * Creates a replication for a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param replicationName The name of the replication. - * @param replication The parameters for creating a replication. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of an object that represents a replication for a container registry. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ReplicationInner> beginCreate( - String resourceGroupName, - String registryName, - String replicationName, - ReplicationInner replication, - Context context); - - /** - * Creates a replication for a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param replicationName The name of the replication. - * @param replication The parameters for creating a replication. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object that represents a replication for a container registry on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createAsync( - String resourceGroupName, String registryName, String replicationName, ReplicationInner replication); - - /** - * Creates a replication for a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param replicationName The name of the replication. - * @param replication The parameters for creating a replication. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object that represents a replication for a container registry. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ReplicationInner create( - String resourceGroupName, String registryName, String replicationName, ReplicationInner replication); - - /** - * Creates a replication for a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param replicationName The name of the replication. - * @param replication The parameters for creating a replication. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object that represents a replication for a container registry. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ReplicationInner create( - String resourceGroupName, - String registryName, - String replicationName, - ReplicationInner replication, - Context context); - - /** - * Deletes a replication from a container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param replicationName The name of the replication. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync( - String resourceGroupName, String registryName, String replicationName); - - /** - * Deletes a replication from a container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param replicationName The name of the replication. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String registryName, String replicationName); - - /** - * Deletes a replication from a container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param replicationName The name of the replication. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete( - String resourceGroupName, String registryName, String replicationName); - - /** - * Deletes a replication from a container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param replicationName The name of the replication. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete( - String resourceGroupName, String registryName, String replicationName, Context context); - - /** - * Deletes a replication from a container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param replicationName The name of the replication. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String registryName, String replicationName); - - /** - * Deletes a replication from a container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param replicationName The name of the replication. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String registryName, String replicationName); - - /** - * Deletes a replication from a container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param replicationName The name of the replication. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String registryName, String replicationName, Context context); - - /** - * Updates a replication for a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param replicationName The name of the replication. - * @param replicationUpdateParameters The parameters for updating a replication. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object that represents a replication for a container registry along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> updateWithResponseAsync( - String resourceGroupName, - String registryName, - String replicationName, - ReplicationUpdateParameters replicationUpdateParameters); - - /** - * Updates a replication for a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param replicationName The name of the replication. - * @param replicationUpdateParameters The parameters for updating a replication. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of an object that represents a replication for a container registry. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, ReplicationInner> beginUpdateAsync( - String resourceGroupName, - String registryName, - String replicationName, - ReplicationUpdateParameters replicationUpdateParameters); - - /** - * Updates a replication for a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param replicationName The name of the replication. - * @param replicationUpdateParameters The parameters for updating a replication. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of an object that represents a replication for a container registry. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ReplicationInner> beginUpdate( - String resourceGroupName, - String registryName, - String replicationName, - ReplicationUpdateParameters replicationUpdateParameters); - - /** - * Updates a replication for a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param replicationName The name of the replication. - * @param replicationUpdateParameters The parameters for updating a replication. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of an object that represents a replication for a container registry. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ReplicationInner> beginUpdate( - String resourceGroupName, - String registryName, - String replicationName, - ReplicationUpdateParameters replicationUpdateParameters, - Context context); - - /** - * Updates a replication for a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param replicationName The name of the replication. - * @param replicationUpdateParameters The parameters for updating a replication. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object that represents a replication for a container registry on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAsync( - String resourceGroupName, - String registryName, - String replicationName, - ReplicationUpdateParameters replicationUpdateParameters); - - /** - * Updates a replication for a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param replicationName The name of the replication. - * @param replicationUpdateParameters The parameters for updating a replication. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object that represents a replication for a container registry. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ReplicationInner update( - String resourceGroupName, - String registryName, - String replicationName, - ReplicationUpdateParameters replicationUpdateParameters); - - /** - * Updates a replication for a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param replicationName The name of the replication. - * @param replicationUpdateParameters The parameters for updating a replication. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object that represents a replication for a container registry. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ReplicationInner update( - String resourceGroupName, - String registryName, - String replicationName, - ReplicationUpdateParameters replicationUpdateParameters, - Context context); - - /** - * Lists all the replications for the specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list replications for a container registry as paginated response with {@link - * PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String resourceGroupName, String registryName); - - /** - * Lists all the replications for the specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list replications for a container registry as paginated response with {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String registryName); - - /** - * Lists all the replications for the specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list replications for a container registry as paginated response with {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String registryName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/RunsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/RunsClient.java deleted file mode 100644 index 66c93898acb0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/RunsClient.java +++ /dev/null @@ -1,423 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.containerregistry.fluent.models.RunGetLogResultInner; -import com.azure.resourcemanager.containerregistry.fluent.models.RunInner; -import com.azure.resourcemanager.containerregistry.models.RunUpdateParameters; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in RunsClient. */ -public interface RunsClient { - /** - * Gets all the runs for a registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param filter The runs filter to apply on the operation. Arithmetic operators are not supported. The allowed - * string function is 'contains'. All logical operators except 'Not', 'Has', 'All' are allowed. - * @param top $top is supported for get list of runs, which limits the maximum number of runs to return. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the runs for a registry as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String resourceGroupName, String registryName, String filter, Integer top); - - /** - * Gets all the runs for a registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the runs for a registry as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String resourceGroupName, String registryName); - - /** - * Gets all the runs for a registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the runs for a registry as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String registryName); - - /** - * Gets all the runs for a registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param filter The runs filter to apply on the operation. Arithmetic operators are not supported. The allowed - * string function is 'contains'. All logical operators except 'Not', 'Has', 'All' are allowed. - * @param top $top is supported for get list of runs, which limits the maximum number of runs to return. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the runs for a registry as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String resourceGroupName, String registryName, String filter, Integer top, Context context); - - /** - * Gets the detailed information for a given run. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runId The run ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the detailed information for a given run along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync(String resourceGroupName, String registryName, String runId); - - /** - * Gets the detailed information for a given run. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runId The run ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the detailed information for a given run on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync(String resourceGroupName, String registryName, String runId); - - /** - * Gets the detailed information for a given run. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runId The run ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the detailed information for a given run. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RunInner get(String resourceGroupName, String registryName, String runId); - - /** - * Gets the detailed information for a given run. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runId The run ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the detailed information for a given run along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String registryName, String runId, Context context); - - /** - * Patch the run properties. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runId The run ID. - * @param runUpdateParameters The run update properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return run resource properties along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> updateWithResponseAsync( - String resourceGroupName, String registryName, String runId, RunUpdateParameters runUpdateParameters); - - /** - * Patch the run properties. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runId The run ID. - * @param runUpdateParameters The run update properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of run resource properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, RunInner> beginUpdateAsync( - String resourceGroupName, String registryName, String runId, RunUpdateParameters runUpdateParameters); - - /** - * Patch the run properties. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runId The run ID. - * @param runUpdateParameters The run update properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of run resource properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, RunInner> beginUpdate( - String resourceGroupName, String registryName, String runId, RunUpdateParameters runUpdateParameters); - - /** - * Patch the run properties. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runId The run ID. - * @param runUpdateParameters The run update properties. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of run resource properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, RunInner> beginUpdate( - String resourceGroupName, - String registryName, - String runId, - RunUpdateParameters runUpdateParameters, - Context context); - - /** - * Patch the run properties. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runId The run ID. - * @param runUpdateParameters The run update properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return run resource properties on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAsync( - String resourceGroupName, String registryName, String runId, RunUpdateParameters runUpdateParameters); - - /** - * Patch the run properties. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runId The run ID. - * @param runUpdateParameters The run update properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return run resource properties. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RunInner update( - String resourceGroupName, String registryName, String runId, RunUpdateParameters runUpdateParameters); - - /** - * Patch the run properties. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runId The run ID. - * @param runUpdateParameters The run update properties. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return run resource properties. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RunInner update( - String resourceGroupName, - String registryName, - String runId, - RunUpdateParameters runUpdateParameters, - Context context); - - /** - * Gets a link to download the run logs. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runId The run ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a link to download the run logs along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getLogSasUrlWithResponseAsync( - String resourceGroupName, String registryName, String runId); - - /** - * Gets a link to download the run logs. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runId The run ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a link to download the run logs on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getLogSasUrlAsync(String resourceGroupName, String registryName, String runId); - - /** - * Gets a link to download the run logs. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runId The run ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a link to download the run logs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RunGetLogResultInner getLogSasUrl(String resourceGroupName, String registryName, String runId); - - /** - * Gets a link to download the run logs. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runId The run ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a link to download the run logs along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getLogSasUrlWithResponse( - String resourceGroupName, String registryName, String runId, Context context); - - /** - * Cancel an existing run. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runId The run ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> cancelWithResponseAsync( - String resourceGroupName, String registryName, String runId); - - /** - * Cancel an existing run. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runId The run ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, Void> beginCancelAsync(String resourceGroupName, String registryName, String runId); - - /** - * Cancel an existing run. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runId The run ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginCancel(String resourceGroupName, String registryName, String runId); - - /** - * Cancel an existing run. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runId The run ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginCancel( - String resourceGroupName, String registryName, String runId, Context context); - - /** - * Cancel an existing run. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runId The run ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono cancelAsync(String resourceGroupName, String registryName, String runId); - - /** - * Cancel an existing run. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runId The run ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void cancel(String resourceGroupName, String registryName, String runId); - - /** - * Cancel an existing run. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runId The run ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void cancel(String resourceGroupName, String registryName, String runId, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/TasksClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/TasksClient.java deleted file mode 100644 index f4784e14af67..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/TasksClient.java +++ /dev/null @@ -1,526 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.containerregistry.fluent.models.TaskInner; -import com.azure.resourcemanager.containerregistry.models.TaskUpdateParameters; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in TasksClient. */ -public interface TasksClient { - /** - * Lists all the tasks for a specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the collection of tasks as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String resourceGroupName, String registryName); - - /** - * Lists all the tasks for a specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the collection of tasks as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String registryName); - - /** - * Lists all the tasks for a specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the collection of tasks as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String registryName, Context context); - - /** - * Get the properties of a specified task. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a specified task along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync(String resourceGroupName, String registryName, String taskName); - - /** - * Get the properties of a specified task. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a specified task on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync(String resourceGroupName, String registryName, String taskName); - - /** - * Get the properties of a specified task. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a specified task. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - TaskInner get(String resourceGroupName, String registryName, String taskName); - - /** - * Get the properties of a specified task. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a specified task along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String registryName, String taskName, Context context); - - /** - * Creates a task for a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @param taskCreateParameters The parameters for creating a task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the task that has the ARM resource and task properties along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createWithResponseAsync( - String resourceGroupName, String registryName, String taskName, TaskInner taskCreateParameters); - - /** - * Creates a task for a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @param taskCreateParameters The parameters for creating a task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of the task that has the ARM resource and task properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, TaskInner> beginCreateAsync( - String resourceGroupName, String registryName, String taskName, TaskInner taskCreateParameters); - - /** - * Creates a task for a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @param taskCreateParameters The parameters for creating a task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of the task that has the ARM resource and task properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, TaskInner> beginCreate( - String resourceGroupName, String registryName, String taskName, TaskInner taskCreateParameters); - - /** - * Creates a task for a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @param taskCreateParameters The parameters for creating a task. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of the task that has the ARM resource and task properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, TaskInner> beginCreate( - String resourceGroupName, - String registryName, - String taskName, - TaskInner taskCreateParameters, - Context context); - - /** - * Creates a task for a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @param taskCreateParameters The parameters for creating a task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the task that has the ARM resource and task properties on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createAsync( - String resourceGroupName, String registryName, String taskName, TaskInner taskCreateParameters); - - /** - * Creates a task for a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @param taskCreateParameters The parameters for creating a task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the task that has the ARM resource and task properties. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - TaskInner create(String resourceGroupName, String registryName, String taskName, TaskInner taskCreateParameters); - - /** - * Creates a task for a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @param taskCreateParameters The parameters for creating a task. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the task that has the ARM resource and task properties. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - TaskInner create( - String resourceGroupName, - String registryName, - String taskName, - TaskInner taskCreateParameters, - Context context); - - /** - * Deletes a specified task. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync( - String resourceGroupName, String registryName, String taskName); - - /** - * Deletes a specified task. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String registryName, String taskName); - - /** - * Deletes a specified task. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, String taskName); - - /** - * Deletes a specified task. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete( - String resourceGroupName, String registryName, String taskName, Context context); - - /** - * Deletes a specified task. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String registryName, String taskName); - - /** - * Deletes a specified task. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String registryName, String taskName); - - /** - * Deletes a specified task. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String registryName, String taskName, Context context); - - /** - * Updates a task with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @param taskUpdateParameters The parameters for updating a task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the task that has the ARM resource and task properties along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> updateWithResponseAsync( - String resourceGroupName, String registryName, String taskName, TaskUpdateParameters taskUpdateParameters); - - /** - * Updates a task with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @param taskUpdateParameters The parameters for updating a task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of the task that has the ARM resource and task properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, TaskInner> beginUpdateAsync( - String resourceGroupName, String registryName, String taskName, TaskUpdateParameters taskUpdateParameters); - - /** - * Updates a task with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @param taskUpdateParameters The parameters for updating a task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of the task that has the ARM resource and task properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, TaskInner> beginUpdate( - String resourceGroupName, String registryName, String taskName, TaskUpdateParameters taskUpdateParameters); - - /** - * Updates a task with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @param taskUpdateParameters The parameters for updating a task. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of the task that has the ARM resource and task properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, TaskInner> beginUpdate( - String resourceGroupName, - String registryName, - String taskName, - TaskUpdateParameters taskUpdateParameters, - Context context); - - /** - * Updates a task with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @param taskUpdateParameters The parameters for updating a task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the task that has the ARM resource and task properties on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAsync( - String resourceGroupName, String registryName, String taskName, TaskUpdateParameters taskUpdateParameters); - - /** - * Updates a task with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @param taskUpdateParameters The parameters for updating a task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the task that has the ARM resource and task properties. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - TaskInner update( - String resourceGroupName, String registryName, String taskName, TaskUpdateParameters taskUpdateParameters); - - /** - * Updates a task with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @param taskUpdateParameters The parameters for updating a task. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the task that has the ARM resource and task properties. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - TaskInner update( - String resourceGroupName, - String registryName, - String taskName, - TaskUpdateParameters taskUpdateParameters, - Context context); - - /** - * Returns a task with extended information that includes all secrets. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the task that has the ARM resource and task properties along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getDetailsWithResponseAsync( - String resourceGroupName, String registryName, String taskName); - - /** - * Returns a task with extended information that includes all secrets. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the task that has the ARM resource and task properties on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getDetailsAsync(String resourceGroupName, String registryName, String taskName); - - /** - * Returns a task with extended information that includes all secrets. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the task that has the ARM resource and task properties. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - TaskInner getDetails(String resourceGroupName, String registryName, String taskName); - - /** - * Returns a task with extended information that includes all secrets. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the task that has the ARM resource and task properties along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getDetailsWithResponse( - String resourceGroupName, String registryName, String taskName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/WebhooksClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/WebhooksClient.java deleted file mode 100644 index 8e85605bd57b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/WebhooksClient.java +++ /dev/null @@ -1,671 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.containerregistry.fluent.models.CallbackConfigInner; -import com.azure.resourcemanager.containerregistry.fluent.models.EventInfoInner; -import com.azure.resourcemanager.containerregistry.fluent.models.EventInner; -import com.azure.resourcemanager.containerregistry.fluent.models.WebhookInner; -import com.azure.resourcemanager.containerregistry.models.WebhookCreateParameters; -import com.azure.resourcemanager.containerregistry.models.WebhookUpdateParameters; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in WebhooksClient. */ -public interface WebhooksClient { - /** - * Gets the properties of the specified webhook. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the specified webhook along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync( - String resourceGroupName, String registryName, String webhookName); - - /** - * Gets the properties of the specified webhook. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the specified webhook on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync(String resourceGroupName, String registryName, String webhookName); - - /** - * Gets the properties of the specified webhook. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the specified webhook. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - WebhookInner get(String resourceGroupName, String registryName, String webhookName); - - /** - * Gets the properties of the specified webhook. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the specified webhook along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String registryName, String webhookName, Context context); - - /** - * Creates a webhook for a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @param webhookCreateParameters The parameters for creating a webhook. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object that represents a webhook for a container registry along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createWithResponseAsync( - String resourceGroupName, - String registryName, - String webhookName, - WebhookCreateParameters webhookCreateParameters); - - /** - * Creates a webhook for a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @param webhookCreateParameters The parameters for creating a webhook. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of an object that represents a webhook for a container registry. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, WebhookInner> beginCreateAsync( - String resourceGroupName, - String registryName, - String webhookName, - WebhookCreateParameters webhookCreateParameters); - - /** - * Creates a webhook for a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @param webhookCreateParameters The parameters for creating a webhook. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of an object that represents a webhook for a container registry. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, WebhookInner> beginCreate( - String resourceGroupName, - String registryName, - String webhookName, - WebhookCreateParameters webhookCreateParameters); - - /** - * Creates a webhook for a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @param webhookCreateParameters The parameters for creating a webhook. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of an object that represents a webhook for a container registry. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, WebhookInner> beginCreate( - String resourceGroupName, - String registryName, - String webhookName, - WebhookCreateParameters webhookCreateParameters, - Context context); - - /** - * Creates a webhook for a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @param webhookCreateParameters The parameters for creating a webhook. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object that represents a webhook for a container registry on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createAsync( - String resourceGroupName, - String registryName, - String webhookName, - WebhookCreateParameters webhookCreateParameters); - - /** - * Creates a webhook for a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @param webhookCreateParameters The parameters for creating a webhook. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object that represents a webhook for a container registry. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - WebhookInner create( - String resourceGroupName, - String registryName, - String webhookName, - WebhookCreateParameters webhookCreateParameters); - - /** - * Creates a webhook for a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @param webhookCreateParameters The parameters for creating a webhook. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object that represents a webhook for a container registry. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - WebhookInner create( - String resourceGroupName, - String registryName, - String webhookName, - WebhookCreateParameters webhookCreateParameters, - Context context); - - /** - * Deletes a webhook from a container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync( - String resourceGroupName, String registryName, String webhookName); - - /** - * Deletes a webhook from a container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String registryName, String webhookName); - - /** - * Deletes a webhook from a container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, String webhookName); - - /** - * Deletes a webhook from a container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete( - String resourceGroupName, String registryName, String webhookName, Context context); - - /** - * Deletes a webhook from a container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String registryName, String webhookName); - - /** - * Deletes a webhook from a container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String registryName, String webhookName); - - /** - * Deletes a webhook from a container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String registryName, String webhookName, Context context); - - /** - * Updates a webhook with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @param webhookUpdateParameters The parameters for updating a webhook. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object that represents a webhook for a container registry along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> updateWithResponseAsync( - String resourceGroupName, - String registryName, - String webhookName, - WebhookUpdateParameters webhookUpdateParameters); - - /** - * Updates a webhook with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @param webhookUpdateParameters The parameters for updating a webhook. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of an object that represents a webhook for a container registry. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, WebhookInner> beginUpdateAsync( - String resourceGroupName, - String registryName, - String webhookName, - WebhookUpdateParameters webhookUpdateParameters); - - /** - * Updates a webhook with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @param webhookUpdateParameters The parameters for updating a webhook. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of an object that represents a webhook for a container registry. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, WebhookInner> beginUpdate( - String resourceGroupName, - String registryName, - String webhookName, - WebhookUpdateParameters webhookUpdateParameters); - - /** - * Updates a webhook with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @param webhookUpdateParameters The parameters for updating a webhook. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of an object that represents a webhook for a container registry. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, WebhookInner> beginUpdate( - String resourceGroupName, - String registryName, - String webhookName, - WebhookUpdateParameters webhookUpdateParameters, - Context context); - - /** - * Updates a webhook with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @param webhookUpdateParameters The parameters for updating a webhook. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object that represents a webhook for a container registry on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAsync( - String resourceGroupName, - String registryName, - String webhookName, - WebhookUpdateParameters webhookUpdateParameters); - - /** - * Updates a webhook with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @param webhookUpdateParameters The parameters for updating a webhook. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object that represents a webhook for a container registry. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - WebhookInner update( - String resourceGroupName, - String registryName, - String webhookName, - WebhookUpdateParameters webhookUpdateParameters); - - /** - * Updates a webhook with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @param webhookUpdateParameters The parameters for updating a webhook. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object that represents a webhook for a container registry. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - WebhookInner update( - String resourceGroupName, - String registryName, - String webhookName, - WebhookUpdateParameters webhookUpdateParameters, - Context context); - - /** - * Lists all the webhooks for the specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list webhooks for a container registry as paginated response with {@link - * PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String resourceGroupName, String registryName); - - /** - * Lists all the webhooks for the specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list webhooks for a container registry as paginated response with {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String registryName); - - /** - * Lists all the webhooks for the specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list webhooks for a container registry as paginated response with {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String registryName, Context context); - - /** - * Triggers a ping event to be sent to the webhook. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the basic information of an event along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> pingWithResponseAsync( - String resourceGroupName, String registryName, String webhookName); - - /** - * Triggers a ping event to be sent to the webhook. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the basic information of an event on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono pingAsync(String resourceGroupName, String registryName, String webhookName); - - /** - * Triggers a ping event to be sent to the webhook. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the basic information of an event. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - EventInfoInner ping(String resourceGroupName, String registryName, String webhookName); - - /** - * Triggers a ping event to be sent to the webhook. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the basic information of an event along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response pingWithResponse( - String resourceGroupName, String registryName, String webhookName, Context context); - - /** - * Gets the configuration of service URI and custom headers for the webhook. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the configuration of service URI and custom headers for the webhook along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getCallbackConfigWithResponseAsync( - String resourceGroupName, String registryName, String webhookName); - - /** - * Gets the configuration of service URI and custom headers for the webhook. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the configuration of service URI and custom headers for the webhook on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getCallbackConfigAsync(String resourceGroupName, String registryName, String webhookName); - - /** - * Gets the configuration of service URI and custom headers for the webhook. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the configuration of service URI and custom headers for the webhook. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - CallbackConfigInner getCallbackConfig(String resourceGroupName, String registryName, String webhookName); - - /** - * Gets the configuration of service URI and custom headers for the webhook. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the configuration of service URI and custom headers for the webhook along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getCallbackConfigWithResponse( - String resourceGroupName, String registryName, String webhookName, Context context); - - /** - * Lists recent events for the specified webhook. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list events for a webhook as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listEventsAsync(String resourceGroupName, String registryName, String webhookName); - - /** - * Lists recent events for the specified webhook. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list events for a webhook as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listEvents(String resourceGroupName, String registryName, String webhookName); - - /** - * Lists recent events for the specified webhook. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list events for a webhook as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listEvents( - String resourceGroupName, String registryName, String webhookName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/CallbackConfigInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/CallbackConfigInner.java deleted file mode 100644 index 5cad5a98b268..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/CallbackConfigInner.java +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** The configuration of service URI and custom headers for the webhook. */ -@Fluent -public final class CallbackConfigInner { - /* - * The service URI for the webhook to post notifications. - */ - @JsonProperty(value = "serviceUri", required = true) - private String serviceUri; - - /* - * Custom headers that will be added to the webhook notifications. - */ - @JsonProperty(value = "customHeaders") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map customHeaders; - - /** - * Get the serviceUri property: The service URI for the webhook to post notifications. - * - * @return the serviceUri value. - */ - public String serviceUri() { - return this.serviceUri; - } - - /** - * Set the serviceUri property: The service URI for the webhook to post notifications. - * - * @param serviceUri the serviceUri value to set. - * @return the CallbackConfigInner object itself. - */ - public CallbackConfigInner withServiceUri(String serviceUri) { - this.serviceUri = serviceUri; - return this; - } - - /** - * Get the customHeaders property: Custom headers that will be added to the webhook notifications. - * - * @return the customHeaders value. - */ - public Map customHeaders() { - return this.customHeaders; - } - - /** - * Set the customHeaders property: Custom headers that will be added to the webhook notifications. - * - * @param customHeaders the customHeaders value to set. - * @return the CallbackConfigInner object itself. - */ - public CallbackConfigInner withCustomHeaders(Map customHeaders) { - this.customHeaders = customHeaders; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (serviceUri() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property serviceUri in model CallbackConfigInner")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(CallbackConfigInner.class); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/EventInfoInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/EventInfoInner.java deleted file mode 100644 index b7c9800c0904..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/EventInfoInner.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The basic information of an event. */ -@Fluent -public class EventInfoInner { - /* - * The event ID. - */ - @JsonProperty(value = "id") - private String id; - - /** - * Get the id property: The event ID. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: The event ID. - * - * @param id the id value to set. - * @return the EventInfoInner object itself. - */ - public EventInfoInner withId(String id) { - this.id = id; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/EventInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/EventInner.java deleted file mode 100644 index 73e12442d9dc..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/EventInner.java +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.containerregistry.models.EventRequestMessage; -import com.azure.resourcemanager.containerregistry.models.EventResponseMessage; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The event for a webhook. */ -@Fluent -public final class EventInner extends EventInfoInner { - /* - * The event request message sent to the service URI. - */ - @JsonProperty(value = "eventRequestMessage") - private EventRequestMessage eventRequestMessage; - - /* - * The event response message received from the service URI. - */ - @JsonProperty(value = "eventResponseMessage") - private EventResponseMessage eventResponseMessage; - - /** - * Get the eventRequestMessage property: The event request message sent to the service URI. - * - * @return the eventRequestMessage value. - */ - public EventRequestMessage eventRequestMessage() { - return this.eventRequestMessage; - } - - /** - * Set the eventRequestMessage property: The event request message sent to the service URI. - * - * @param eventRequestMessage the eventRequestMessage value to set. - * @return the EventInner object itself. - */ - public EventInner withEventRequestMessage(EventRequestMessage eventRequestMessage) { - this.eventRequestMessage = eventRequestMessage; - return this; - } - - /** - * Get the eventResponseMessage property: The event response message received from the service URI. - * - * @return the eventResponseMessage value. - */ - public EventResponseMessage eventResponseMessage() { - return this.eventResponseMessage; - } - - /** - * Set the eventResponseMessage property: The event response message received from the service URI. - * - * @param eventResponseMessage the eventResponseMessage value to set. - * @return the EventInner object itself. - */ - public EventInner withEventResponseMessage(EventResponseMessage eventResponseMessage) { - this.eventResponseMessage = eventResponseMessage; - return this; - } - - /** {@inheritDoc} */ - @Override - public EventInner withId(String id) { - super.withId(id); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (eventRequestMessage() != null) { - eventRequestMessage().validate(); - } - if (eventResponseMessage() != null) { - eventResponseMessage().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/OperationDefinitionInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/OperationDefinitionInner.java deleted file mode 100644 index a3355d9c8cc9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/OperationDefinitionInner.java +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.containerregistry.models.OperationDisplayDefinition; -import com.azure.resourcemanager.containerregistry.models.OperationServiceSpecificationDefinition; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The definition of a container registry operation. */ -@Fluent -public final class OperationDefinitionInner { - /* - * The origin information of the container registry operation. - */ - @JsonProperty(value = "origin") - private String origin; - - /* - * Operation name: {provider}/{resource}/{operation}. - */ - @JsonProperty(value = "name") - private String name; - - /* - * The display information for the container registry operation. - */ - @JsonProperty(value = "display") - private OperationDisplayDefinition display; - - /* - * The properties information for the container registry operation. - */ - @JsonProperty(value = "properties") - private OperationPropertiesDefinition innerProperties; - - /** - * Get the origin property: The origin information of the container registry operation. - * - * @return the origin value. - */ - public String origin() { - return this.origin; - } - - /** - * Set the origin property: The origin information of the container registry operation. - * - * @param origin the origin value to set. - * @return the OperationDefinitionInner object itself. - */ - public OperationDefinitionInner withOrigin(String origin) { - this.origin = origin; - return this; - } - - /** - * Get the name property: Operation name: {provider}/{resource}/{operation}. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Operation name: {provider}/{resource}/{operation}. - * - * @param name the name value to set. - * @return the OperationDefinitionInner object itself. - */ - public OperationDefinitionInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the display property: The display information for the container registry operation. - * - * @return the display value. - */ - public OperationDisplayDefinition display() { - return this.display; - } - - /** - * Set the display property: The display information for the container registry operation. - * - * @param display the display value to set. - * @return the OperationDefinitionInner object itself. - */ - public OperationDefinitionInner withDisplay(OperationDisplayDefinition display) { - this.display = display; - return this; - } - - /** - * Get the innerProperties property: The properties information for the container registry operation. - * - * @return the innerProperties value. - */ - private OperationPropertiesDefinition innerProperties() { - return this.innerProperties; - } - - /** - * Get the serviceSpecification property: The definition of Azure Monitoring service. - * - * @return the serviceSpecification value. - */ - public OperationServiceSpecificationDefinition serviceSpecification() { - return this.innerProperties() == null ? null : this.innerProperties().serviceSpecification(); - } - - /** - * Set the serviceSpecification property: The definition of Azure Monitoring service. - * - * @param serviceSpecification the serviceSpecification value to set. - * @return the OperationDefinitionInner object itself. - */ - public OperationDefinitionInner withServiceSpecification( - OperationServiceSpecificationDefinition serviceSpecification) { - if (this.innerProperties() == null) { - this.innerProperties = new OperationPropertiesDefinition(); - } - this.innerProperties().withServiceSpecification(serviceSpecification); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (display() != null) { - display().validate(); - } - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/OperationPropertiesDefinition.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/OperationPropertiesDefinition.java deleted file mode 100644 index 55169511e006..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/OperationPropertiesDefinition.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.containerregistry.models.OperationServiceSpecificationDefinition; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The definition of Azure Monitoring properties. */ -@Fluent -public final class OperationPropertiesDefinition { - /* - * The definition of Azure Monitoring service. - */ - @JsonProperty(value = "serviceSpecification") - private OperationServiceSpecificationDefinition serviceSpecification; - - /** - * Get the serviceSpecification property: The definition of Azure Monitoring service. - * - * @return the serviceSpecification value. - */ - public OperationServiceSpecificationDefinition serviceSpecification() { - return this.serviceSpecification; - } - - /** - * Set the serviceSpecification property: The definition of Azure Monitoring service. - * - * @param serviceSpecification the serviceSpecification value to set. - * @return the OperationPropertiesDefinition object itself. - */ - public OperationPropertiesDefinition withServiceSpecification( - OperationServiceSpecificationDefinition serviceSpecification) { - this.serviceSpecification = serviceSpecification; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (serviceSpecification() != null) { - serviceSpecification().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/RegistryInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/RegistryInner.java deleted file mode 100644 index 8c476cb1979c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/RegistryInner.java +++ /dev/null @@ -1,228 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.containerregistry.models.NetworkRuleSet; -import com.azure.resourcemanager.containerregistry.models.Policies; -import com.azure.resourcemanager.containerregistry.models.ProvisioningState; -import com.azure.resourcemanager.containerregistry.models.Sku; -import com.azure.resourcemanager.containerregistry.models.Status; -import com.azure.resourcemanager.containerregistry.models.StorageAccountProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.Map; - -/** An object that represents a container registry. */ -@Fluent -public final class RegistryInner extends Resource { - /* - * The SKU of the container registry. - */ - @JsonProperty(value = "sku", required = true) - private Sku sku; - - /* - * The properties of the container registry. - */ - @JsonProperty(value = "properties") - private RegistryProperties innerProperties; - - /** - * Get the sku property: The SKU of the container registry. - * - * @return the sku value. - */ - public Sku sku() { - return this.sku; - } - - /** - * Set the sku property: The SKU of the container registry. - * - * @param sku the sku value to set. - * @return the RegistryInner object itself. - */ - public RegistryInner withSku(Sku sku) { - this.sku = sku; - return this; - } - - /** - * Get the innerProperties property: The properties of the container registry. - * - * @return the innerProperties value. - */ - private RegistryProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public RegistryInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public RegistryInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the loginServer property: The URL that can be used to log into the container registry. - * - * @return the loginServer value. - */ - public String loginServer() { - return this.innerProperties() == null ? null : this.innerProperties().loginServer(); - } - - /** - * Get the creationDate property: The creation date of the container registry in ISO8601 format. - * - * @return the creationDate value. - */ - public OffsetDateTime creationDate() { - return this.innerProperties() == null ? null : this.innerProperties().creationDate(); - } - - /** - * Get the provisioningState property: The provisioning state of the container registry at the time the operation - * was called. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the status property: The status of the container registry at the time the operation was called. - * - * @return the status value. - */ - public Status status() { - return this.innerProperties() == null ? null : this.innerProperties().status(); - } - - /** - * Get the adminUserEnabled property: The value that indicates whether the admin user is enabled. - * - * @return the adminUserEnabled value. - */ - public Boolean adminUserEnabled() { - return this.innerProperties() == null ? null : this.innerProperties().adminUserEnabled(); - } - - /** - * Set the adminUserEnabled property: The value that indicates whether the admin user is enabled. - * - * @param adminUserEnabled the adminUserEnabled value to set. - * @return the RegistryInner object itself. - */ - public RegistryInner withAdminUserEnabled(Boolean adminUserEnabled) { - if (this.innerProperties() == null) { - this.innerProperties = new RegistryProperties(); - } - this.innerProperties().withAdminUserEnabled(adminUserEnabled); - return this; - } - - /** - * Get the storageAccount property: The properties of the storage account for the container registry. Only - * applicable to Classic SKU. - * - * @return the storageAccount value. - */ - public StorageAccountProperties storageAccount() { - return this.innerProperties() == null ? null : this.innerProperties().storageAccount(); - } - - /** - * Set the storageAccount property: The properties of the storage account for the container registry. Only - * applicable to Classic SKU. - * - * @param storageAccount the storageAccount value to set. - * @return the RegistryInner object itself. - */ - public RegistryInner withStorageAccount(StorageAccountProperties storageAccount) { - if (this.innerProperties() == null) { - this.innerProperties = new RegistryProperties(); - } - this.innerProperties().withStorageAccount(storageAccount); - return this; - } - - /** - * Get the networkRuleSet property: The network rule set for a container registry. - * - * @return the networkRuleSet value. - */ - public NetworkRuleSet networkRuleSet() { - return this.innerProperties() == null ? null : this.innerProperties().networkRuleSet(); - } - - /** - * Set the networkRuleSet property: The network rule set for a container registry. - * - * @param networkRuleSet the networkRuleSet value to set. - * @return the RegistryInner object itself. - */ - public RegistryInner withNetworkRuleSet(NetworkRuleSet networkRuleSet) { - if (this.innerProperties() == null) { - this.innerProperties = new RegistryProperties(); - } - this.innerProperties().withNetworkRuleSet(networkRuleSet); - return this; - } - - /** - * Get the policies property: The policies for a container registry. - * - * @return the policies value. - */ - public Policies policies() { - return this.innerProperties() == null ? null : this.innerProperties().policies(); - } - - /** - * Set the policies property: The policies for a container registry. - * - * @param policies the policies value to set. - * @return the RegistryInner object itself. - */ - public RegistryInner withPolicies(Policies policies) { - if (this.innerProperties() == null) { - this.innerProperties = new RegistryProperties(); - } - this.innerProperties().withPolicies(policies); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (sku() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property sku in model RegistryInner")); - } else { - sku().validate(); - } - if (innerProperties() != null) { - innerProperties().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(RegistryInner.class); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/RegistryListCredentialsResultInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/RegistryListCredentialsResultInner.java deleted file mode 100644 index d357e86b1a0d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/RegistryListCredentialsResultInner.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.containerregistry.models.RegistryPassword; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The response from the ListCredentials operation. */ -@Fluent -public final class RegistryListCredentialsResultInner { - /* - * The username for a container registry. - */ - @JsonProperty(value = "username") - private String username; - - /* - * The list of passwords for a container registry. - */ - @JsonProperty(value = "passwords") - private List passwords; - - /** - * Get the username property: The username for a container registry. - * - * @return the username value. - */ - public String username() { - return this.username; - } - - /** - * Set the username property: The username for a container registry. - * - * @param username the username value to set. - * @return the RegistryListCredentialsResultInner object itself. - */ - public RegistryListCredentialsResultInner withUsername(String username) { - this.username = username; - return this; - } - - /** - * Get the passwords property: The list of passwords for a container registry. - * - * @return the passwords value. - */ - public List passwords() { - return this.passwords; - } - - /** - * Set the passwords property: The list of passwords for a container registry. - * - * @param passwords the passwords value to set. - * @return the RegistryListCredentialsResultInner object itself. - */ - public RegistryListCredentialsResultInner withPasswords(List passwords) { - this.passwords = passwords; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (passwords() != null) { - passwords().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/RegistryNameStatusInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/RegistryNameStatusInner.java deleted file mode 100644 index 4ae0639ea8f3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/RegistryNameStatusInner.java +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The result of a request to check the availability of a container registry name. */ -@Fluent -public final class RegistryNameStatusInner { - /* - * The value that indicates whether the name is available. - */ - @JsonProperty(value = "nameAvailable") - private Boolean nameAvailable; - - /* - * If any, the reason that the name is not available. - */ - @JsonProperty(value = "reason") - private String reason; - - /* - * If any, the error message that provides more detail for the reason that - * the name is not available. - */ - @JsonProperty(value = "message") - private String message; - - /** - * Get the nameAvailable property: The value that indicates whether the name is available. - * - * @return the nameAvailable value. - */ - public Boolean nameAvailable() { - return this.nameAvailable; - } - - /** - * Set the nameAvailable property: The value that indicates whether the name is available. - * - * @param nameAvailable the nameAvailable value to set. - * @return the RegistryNameStatusInner object itself. - */ - public RegistryNameStatusInner withNameAvailable(Boolean nameAvailable) { - this.nameAvailable = nameAvailable; - return this; - } - - /** - * Get the reason property: If any, the reason that the name is not available. - * - * @return the reason value. - */ - public String reason() { - return this.reason; - } - - /** - * Set the reason property: If any, the reason that the name is not available. - * - * @param reason the reason value to set. - * @return the RegistryNameStatusInner object itself. - */ - public RegistryNameStatusInner withReason(String reason) { - this.reason = reason; - return this; - } - - /** - * Get the message property: If any, the error message that provides more detail for the reason that the name is not - * available. - * - * @return the message value. - */ - public String message() { - return this.message; - } - - /** - * Set the message property: If any, the error message that provides more detail for the reason that the name is not - * available. - * - * @param message the message value to set. - * @return the RegistryNameStatusInner object itself. - */ - public RegistryNameStatusInner withMessage(String message) { - this.message = message; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/RegistryProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/RegistryProperties.java deleted file mode 100644 index 372c0f2ccc90..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/RegistryProperties.java +++ /dev/null @@ -1,208 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.containerregistry.models.NetworkRuleSet; -import com.azure.resourcemanager.containerregistry.models.Policies; -import com.azure.resourcemanager.containerregistry.models.ProvisioningState; -import com.azure.resourcemanager.containerregistry.models.Status; -import com.azure.resourcemanager.containerregistry.models.StorageAccountProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** The properties of a container registry. */ -@Fluent -public final class RegistryProperties { - /* - * The URL that can be used to log into the container registry. - */ - @JsonProperty(value = "loginServer", access = JsonProperty.Access.WRITE_ONLY) - private String loginServer; - - /* - * The creation date of the container registry in ISO8601 format. - */ - @JsonProperty(value = "creationDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime creationDate; - - /* - * The provisioning state of the container registry at the time the - * operation was called. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private ProvisioningState provisioningState; - - /* - * The status of the container registry at the time the operation was - * called. - */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) - private Status status; - - /* - * The value that indicates whether the admin user is enabled. - */ - @JsonProperty(value = "adminUserEnabled") - private Boolean adminUserEnabled; - - /* - * The properties of the storage account for the container registry. Only - * applicable to Classic SKU. - */ - @JsonProperty(value = "storageAccount") - private StorageAccountProperties storageAccount; - - /* - * The network rule set for a container registry. - */ - @JsonProperty(value = "networkRuleSet") - private NetworkRuleSet networkRuleSet; - - /* - * The policies for a container registry. - */ - @JsonProperty(value = "policies") - private Policies policies; - - /** - * Get the loginServer property: The URL that can be used to log into the container registry. - * - * @return the loginServer value. - */ - public String loginServer() { - return this.loginServer; - } - - /** - * Get the creationDate property: The creation date of the container registry in ISO8601 format. - * - * @return the creationDate value. - */ - public OffsetDateTime creationDate() { - return this.creationDate; - } - - /** - * Get the provisioningState property: The provisioning state of the container registry at the time the operation - * was called. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Get the status property: The status of the container registry at the time the operation was called. - * - * @return the status value. - */ - public Status status() { - return this.status; - } - - /** - * Get the adminUserEnabled property: The value that indicates whether the admin user is enabled. - * - * @return the adminUserEnabled value. - */ - public Boolean adminUserEnabled() { - return this.adminUserEnabled; - } - - /** - * Set the adminUserEnabled property: The value that indicates whether the admin user is enabled. - * - * @param adminUserEnabled the adminUserEnabled value to set. - * @return the RegistryProperties object itself. - */ - public RegistryProperties withAdminUserEnabled(Boolean adminUserEnabled) { - this.adminUserEnabled = adminUserEnabled; - return this; - } - - /** - * Get the storageAccount property: The properties of the storage account for the container registry. Only - * applicable to Classic SKU. - * - * @return the storageAccount value. - */ - public StorageAccountProperties storageAccount() { - return this.storageAccount; - } - - /** - * Set the storageAccount property: The properties of the storage account for the container registry. Only - * applicable to Classic SKU. - * - * @param storageAccount the storageAccount value to set. - * @return the RegistryProperties object itself. - */ - public RegistryProperties withStorageAccount(StorageAccountProperties storageAccount) { - this.storageAccount = storageAccount; - return this; - } - - /** - * Get the networkRuleSet property: The network rule set for a container registry. - * - * @return the networkRuleSet value. - */ - public NetworkRuleSet networkRuleSet() { - return this.networkRuleSet; - } - - /** - * Set the networkRuleSet property: The network rule set for a container registry. - * - * @param networkRuleSet the networkRuleSet value to set. - * @return the RegistryProperties object itself. - */ - public RegistryProperties withNetworkRuleSet(NetworkRuleSet networkRuleSet) { - this.networkRuleSet = networkRuleSet; - return this; - } - - /** - * Get the policies property: The policies for a container registry. - * - * @return the policies value. - */ - public Policies policies() { - return this.policies; - } - - /** - * Set the policies property: The policies for a container registry. - * - * @param policies the policies value to set. - * @return the RegistryProperties object itself. - */ - public RegistryProperties withPolicies(Policies policies) { - this.policies = policies; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (status() != null) { - status().validate(); - } - if (storageAccount() != null) { - storageAccount().validate(); - } - if (networkRuleSet() != null) { - networkRuleSet().validate(); - } - if (policies() != null) { - policies().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/RegistryPropertiesUpdateParameters.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/RegistryPropertiesUpdateParameters.java deleted file mode 100644 index 47f567e4d172..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/RegistryPropertiesUpdateParameters.java +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.containerregistry.models.NetworkRuleSet; -import com.azure.resourcemanager.containerregistry.models.Policies; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The parameters for updating the properties of a container registry. */ -@Fluent -public final class RegistryPropertiesUpdateParameters { - /* - * The value that indicates whether the admin user is enabled. - */ - @JsonProperty(value = "adminUserEnabled") - private Boolean adminUserEnabled; - - /* - * The network rule set for a container registry. - */ - @JsonProperty(value = "networkRuleSet") - private NetworkRuleSet networkRuleSet; - - /* - * The policies for a container registry. - */ - @JsonProperty(value = "policies") - private Policies policies; - - /** - * Get the adminUserEnabled property: The value that indicates whether the admin user is enabled. - * - * @return the adminUserEnabled value. - */ - public Boolean adminUserEnabled() { - return this.adminUserEnabled; - } - - /** - * Set the adminUserEnabled property: The value that indicates whether the admin user is enabled. - * - * @param adminUserEnabled the adminUserEnabled value to set. - * @return the RegistryPropertiesUpdateParameters object itself. - */ - public RegistryPropertiesUpdateParameters withAdminUserEnabled(Boolean adminUserEnabled) { - this.adminUserEnabled = adminUserEnabled; - return this; - } - - /** - * Get the networkRuleSet property: The network rule set for a container registry. - * - * @return the networkRuleSet value. - */ - public NetworkRuleSet networkRuleSet() { - return this.networkRuleSet; - } - - /** - * Set the networkRuleSet property: The network rule set for a container registry. - * - * @param networkRuleSet the networkRuleSet value to set. - * @return the RegistryPropertiesUpdateParameters object itself. - */ - public RegistryPropertiesUpdateParameters withNetworkRuleSet(NetworkRuleSet networkRuleSet) { - this.networkRuleSet = networkRuleSet; - return this; - } - - /** - * Get the policies property: The policies for a container registry. - * - * @return the policies value. - */ - public Policies policies() { - return this.policies; - } - - /** - * Set the policies property: The policies for a container registry. - * - * @param policies the policies value to set. - * @return the RegistryPropertiesUpdateParameters object itself. - */ - public RegistryPropertiesUpdateParameters withPolicies(Policies policies) { - this.policies = policies; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (networkRuleSet() != null) { - networkRuleSet().validate(); - } - if (policies() != null) { - policies().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/RegistryUsageListResultInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/RegistryUsageListResultInner.java deleted file mode 100644 index 9b539563e53e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/RegistryUsageListResultInner.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.containerregistry.models.RegistryUsage; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The result of a request to get container registry quota usages. */ -@Fluent -public final class RegistryUsageListResultInner { - /* - * The list of container registry quota usages. - */ - @JsonProperty(value = "value") - private List value; - - /** - * Get the value property: The list of container registry quota usages. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The list of container registry quota usages. - * - * @param value the value value to set. - * @return the RegistryUsageListResultInner object itself. - */ - public RegistryUsageListResultInner withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/ReplicationInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/ReplicationInner.java deleted file mode 100644 index 50da29177459..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/ReplicationInner.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.resourcemanager.containerregistry.models.ProvisioningState; -import com.azure.resourcemanager.containerregistry.models.Status; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** An object that represents a replication for a container registry. */ -@Fluent -public final class ReplicationInner extends Resource { - /* - * The properties of the replication. - */ - @JsonProperty(value = "properties") - private ReplicationProperties innerProperties; - - /** - * Get the innerProperties property: The properties of the replication. - * - * @return the innerProperties value. - */ - private ReplicationProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public ReplicationInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public ReplicationInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the replication at the time the operation was - * called. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the status property: The status of the replication at the time the operation was called. - * - * @return the status value. - */ - public Status status() { - return this.innerProperties() == null ? null : this.innerProperties().status(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/ReplicationProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/ReplicationProperties.java deleted file mode 100644 index 400774ef1cd7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/ReplicationProperties.java +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.resourcemanager.containerregistry.models.ProvisioningState; -import com.azure.resourcemanager.containerregistry.models.Status; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The properties of a replication. */ -@Immutable -public final class ReplicationProperties { - /* - * The provisioning state of the replication at the time the operation was - * called. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private ProvisioningState provisioningState; - - /* - * The status of the replication at the time the operation was called. - */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) - private Status status; - - /** - * Get the provisioningState property: The provisioning state of the replication at the time the operation was - * called. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Get the status property: The status of the replication at the time the operation was called. - * - * @return the status value. - */ - public Status status() { - return this.status; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (status() != null) { - status().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/RunGetLogResultInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/RunGetLogResultInner.java deleted file mode 100644 index 77c9d6f9ceb9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/RunGetLogResultInner.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The result of get log link operation. */ -@Fluent -public final class RunGetLogResultInner { - /* - * The link to logs for a run on a azure container registry. - */ - @JsonProperty(value = "logLink") - private String logLink; - - /** - * Get the logLink property: The link to logs for a run on a azure container registry. - * - * @return the logLink value. - */ - public String logLink() { - return this.logLink; - } - - /** - * Set the logLink property: The link to logs for a run on a azure container registry. - * - * @param logLink the logLink value to set. - * @return the RunGetLogResultInner object itself. - */ - public RunGetLogResultInner withLogLink(String logLink) { - this.logLink = logLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/RunInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/RunInner.java deleted file mode 100644 index 92ece71d8770..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/RunInner.java +++ /dev/null @@ -1,479 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.resourcemanager.containerregistry.models.AgentProperties; -import com.azure.resourcemanager.containerregistry.models.ImageDescriptor; -import com.azure.resourcemanager.containerregistry.models.ImageUpdateTrigger; -import com.azure.resourcemanager.containerregistry.models.PlatformProperties; -import com.azure.resourcemanager.containerregistry.models.ProvisioningState; -import com.azure.resourcemanager.containerregistry.models.RunStatus; -import com.azure.resourcemanager.containerregistry.models.RunType; -import com.azure.resourcemanager.containerregistry.models.SourceTriggerDescriptor; -import com.azure.resourcemanager.containerregistry.models.TimerTriggerDescriptor; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; - -/** Run resource properties. */ -@Fluent -public final class RunInner extends ProxyResource { - /* - * The properties of a run. - */ - @JsonProperty(value = "properties") - private RunProperties innerProperties; - - /** - * Get the innerProperties property: The properties of a run. - * - * @return the innerProperties value. - */ - private RunProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the runId property: The unique identifier for the run. - * - * @return the runId value. - */ - public String runId() { - return this.innerProperties() == null ? null : this.innerProperties().runId(); - } - - /** - * Set the runId property: The unique identifier for the run. - * - * @param runId the runId value to set. - * @return the RunInner object itself. - */ - public RunInner withRunId(String runId) { - if (this.innerProperties() == null) { - this.innerProperties = new RunProperties(); - } - this.innerProperties().withRunId(runId); - return this; - } - - /** - * Get the status property: The current status of the run. - * - * @return the status value. - */ - public RunStatus status() { - return this.innerProperties() == null ? null : this.innerProperties().status(); - } - - /** - * Set the status property: The current status of the run. - * - * @param status the status value to set. - * @return the RunInner object itself. - */ - public RunInner withStatus(RunStatus status) { - if (this.innerProperties() == null) { - this.innerProperties = new RunProperties(); - } - this.innerProperties().withStatus(status); - return this; - } - - /** - * Get the lastUpdatedTime property: The last updated time for the run. - * - * @return the lastUpdatedTime value. - */ - public OffsetDateTime lastUpdatedTime() { - return this.innerProperties() == null ? null : this.innerProperties().lastUpdatedTime(); - } - - /** - * Set the lastUpdatedTime property: The last updated time for the run. - * - * @param lastUpdatedTime the lastUpdatedTime value to set. - * @return the RunInner object itself. - */ - public RunInner withLastUpdatedTime(OffsetDateTime lastUpdatedTime) { - if (this.innerProperties() == null) { - this.innerProperties = new RunProperties(); - } - this.innerProperties().withLastUpdatedTime(lastUpdatedTime); - return this; - } - - /** - * Get the runType property: The type of run. - * - * @return the runType value. - */ - public RunType runType() { - return this.innerProperties() == null ? null : this.innerProperties().runType(); - } - - /** - * Set the runType property: The type of run. - * - * @param runType the runType value to set. - * @return the RunInner object itself. - */ - public RunInner withRunType(RunType runType) { - if (this.innerProperties() == null) { - this.innerProperties = new RunProperties(); - } - this.innerProperties().withRunType(runType); - return this; - } - - /** - * Get the createTime property: The time the run was scheduled. - * - * @return the createTime value. - */ - public OffsetDateTime createTime() { - return this.innerProperties() == null ? null : this.innerProperties().createTime(); - } - - /** - * Set the createTime property: The time the run was scheduled. - * - * @param createTime the createTime value to set. - * @return the RunInner object itself. - */ - public RunInner withCreateTime(OffsetDateTime createTime) { - if (this.innerProperties() == null) { - this.innerProperties = new RunProperties(); - } - this.innerProperties().withCreateTime(createTime); - return this; - } - - /** - * Get the startTime property: The time the run started. - * - * @return the startTime value. - */ - public OffsetDateTime startTime() { - return this.innerProperties() == null ? null : this.innerProperties().startTime(); - } - - /** - * Set the startTime property: The time the run started. - * - * @param startTime the startTime value to set. - * @return the RunInner object itself. - */ - public RunInner withStartTime(OffsetDateTime startTime) { - if (this.innerProperties() == null) { - this.innerProperties = new RunProperties(); - } - this.innerProperties().withStartTime(startTime); - return this; - } - - /** - * Get the finishTime property: The time the run finished. - * - * @return the finishTime value. - */ - public OffsetDateTime finishTime() { - return this.innerProperties() == null ? null : this.innerProperties().finishTime(); - } - - /** - * Set the finishTime property: The time the run finished. - * - * @param finishTime the finishTime value to set. - * @return the RunInner object itself. - */ - public RunInner withFinishTime(OffsetDateTime finishTime) { - if (this.innerProperties() == null) { - this.innerProperties = new RunProperties(); - } - this.innerProperties().withFinishTime(finishTime); - return this; - } - - /** - * Get the outputImages property: The list of all images that were generated from the run. This is applicable if the - * run generates base image dependencies. - * - * @return the outputImages value. - */ - public List outputImages() { - return this.innerProperties() == null ? null : this.innerProperties().outputImages(); - } - - /** - * Set the outputImages property: The list of all images that were generated from the run. This is applicable if the - * run generates base image dependencies. - * - * @param outputImages the outputImages value to set. - * @return the RunInner object itself. - */ - public RunInner withOutputImages(List outputImages) { - if (this.innerProperties() == null) { - this.innerProperties = new RunProperties(); - } - this.innerProperties().withOutputImages(outputImages); - return this; - } - - /** - * Get the task property: The task against which run was scheduled. - * - * @return the task value. - */ - public String task() { - return this.innerProperties() == null ? null : this.innerProperties().task(); - } - - /** - * Set the task property: The task against which run was scheduled. - * - * @param task the task value to set. - * @return the RunInner object itself. - */ - public RunInner withTask(String task) { - if (this.innerProperties() == null) { - this.innerProperties = new RunProperties(); - } - this.innerProperties().withTask(task); - return this; - } - - /** - * Get the imageUpdateTrigger property: The image update trigger that caused the run. This is applicable if the task - * has base image trigger configured. - * - * @return the imageUpdateTrigger value. - */ - public ImageUpdateTrigger imageUpdateTrigger() { - return this.innerProperties() == null ? null : this.innerProperties().imageUpdateTrigger(); - } - - /** - * Set the imageUpdateTrigger property: The image update trigger that caused the run. This is applicable if the task - * has base image trigger configured. - * - * @param imageUpdateTrigger the imageUpdateTrigger value to set. - * @return the RunInner object itself. - */ - public RunInner withImageUpdateTrigger(ImageUpdateTrigger imageUpdateTrigger) { - if (this.innerProperties() == null) { - this.innerProperties = new RunProperties(); - } - this.innerProperties().withImageUpdateTrigger(imageUpdateTrigger); - return this; - } - - /** - * Get the sourceTrigger property: The source trigger that caused the run. - * - * @return the sourceTrigger value. - */ - public SourceTriggerDescriptor sourceTrigger() { - return this.innerProperties() == null ? null : this.innerProperties().sourceTrigger(); - } - - /** - * Set the sourceTrigger property: The source trigger that caused the run. - * - * @param sourceTrigger the sourceTrigger value to set. - * @return the RunInner object itself. - */ - public RunInner withSourceTrigger(SourceTriggerDescriptor sourceTrigger) { - if (this.innerProperties() == null) { - this.innerProperties = new RunProperties(); - } - this.innerProperties().withSourceTrigger(sourceTrigger); - return this; - } - - /** - * Get the platform property: The platform properties against which the run will happen. - * - * @return the platform value. - */ - public PlatformProperties platform() { - return this.innerProperties() == null ? null : this.innerProperties().platform(); - } - - /** - * Set the platform property: The platform properties against which the run will happen. - * - * @param platform the platform value to set. - * @return the RunInner object itself. - */ - public RunInner withPlatform(PlatformProperties platform) { - if (this.innerProperties() == null) { - this.innerProperties = new RunProperties(); - } - this.innerProperties().withPlatform(platform); - return this; - } - - /** - * Get the agentConfiguration property: The machine configuration of the run agent. - * - * @return the agentConfiguration value. - */ - public AgentProperties agentConfiguration() { - return this.innerProperties() == null ? null : this.innerProperties().agentConfiguration(); - } - - /** - * Set the agentConfiguration property: The machine configuration of the run agent. - * - * @param agentConfiguration the agentConfiguration value to set. - * @return the RunInner object itself. - */ - public RunInner withAgentConfiguration(AgentProperties agentConfiguration) { - if (this.innerProperties() == null) { - this.innerProperties = new RunProperties(); - } - this.innerProperties().withAgentConfiguration(agentConfiguration); - return this; - } - - /** - * Get the sourceRegistryAuth property: The scope of the credentials that were used to login to the source registry - * during this run. - * - * @return the sourceRegistryAuth value. - */ - public String sourceRegistryAuth() { - return this.innerProperties() == null ? null : this.innerProperties().sourceRegistryAuth(); - } - - /** - * Set the sourceRegistryAuth property: The scope of the credentials that were used to login to the source registry - * during this run. - * - * @param sourceRegistryAuth the sourceRegistryAuth value to set. - * @return the RunInner object itself. - */ - public RunInner withSourceRegistryAuth(String sourceRegistryAuth) { - if (this.innerProperties() == null) { - this.innerProperties = new RunProperties(); - } - this.innerProperties().withSourceRegistryAuth(sourceRegistryAuth); - return this; - } - - /** - * Get the customRegistries property: The list of custom registries that were logged in during this run. - * - * @return the customRegistries value. - */ - public List customRegistries() { - return this.innerProperties() == null ? null : this.innerProperties().customRegistries(); - } - - /** - * Set the customRegistries property: The list of custom registries that were logged in during this run. - * - * @param customRegistries the customRegistries value to set. - * @return the RunInner object itself. - */ - public RunInner withCustomRegistries(List customRegistries) { - if (this.innerProperties() == null) { - this.innerProperties = new RunProperties(); - } - this.innerProperties().withCustomRegistries(customRegistries); - return this; - } - - /** - * Get the runErrorMessage property: The error message received from backend systems after the run is scheduled. - * - * @return the runErrorMessage value. - */ - public String runErrorMessage() { - return this.innerProperties() == null ? null : this.innerProperties().runErrorMessage(); - } - - /** - * Get the provisioningState property: The provisioning state of a run. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Set the provisioningState property: The provisioning state of a run. - * - * @param provisioningState the provisioningState value to set. - * @return the RunInner object itself. - */ - public RunInner withProvisioningState(ProvisioningState provisioningState) { - if (this.innerProperties() == null) { - this.innerProperties = new RunProperties(); - } - this.innerProperties().withProvisioningState(provisioningState); - return this; - } - - /** - * Get the isArchiveEnabled property: The value that indicates whether archiving is enabled or not. - * - * @return the isArchiveEnabled value. - */ - public Boolean isArchiveEnabled() { - return this.innerProperties() == null ? null : this.innerProperties().isArchiveEnabled(); - } - - /** - * Set the isArchiveEnabled property: The value that indicates whether archiving is enabled or not. - * - * @param isArchiveEnabled the isArchiveEnabled value to set. - * @return the RunInner object itself. - */ - public RunInner withIsArchiveEnabled(Boolean isArchiveEnabled) { - if (this.innerProperties() == null) { - this.innerProperties = new RunProperties(); - } - this.innerProperties().withIsArchiveEnabled(isArchiveEnabled); - return this; - } - - /** - * Get the timerTrigger property: The timer trigger that caused the run. - * - * @return the timerTrigger value. - */ - public TimerTriggerDescriptor timerTrigger() { - return this.innerProperties() == null ? null : this.innerProperties().timerTrigger(); - } - - /** - * Set the timerTrigger property: The timer trigger that caused the run. - * - * @param timerTrigger the timerTrigger value to set. - * @return the RunInner object itself. - */ - public RunInner withTimerTrigger(TimerTriggerDescriptor timerTrigger) { - if (this.innerProperties() == null) { - this.innerProperties = new RunProperties(); - } - this.innerProperties().withTimerTrigger(timerTrigger); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/RunProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/RunProperties.java deleted file mode 100644 index cf702b86b427..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/RunProperties.java +++ /dev/null @@ -1,542 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.containerregistry.models.AgentProperties; -import com.azure.resourcemanager.containerregistry.models.ImageDescriptor; -import com.azure.resourcemanager.containerregistry.models.ImageUpdateTrigger; -import com.azure.resourcemanager.containerregistry.models.PlatformProperties; -import com.azure.resourcemanager.containerregistry.models.ProvisioningState; -import com.azure.resourcemanager.containerregistry.models.RunStatus; -import com.azure.resourcemanager.containerregistry.models.RunType; -import com.azure.resourcemanager.containerregistry.models.SourceTriggerDescriptor; -import com.azure.resourcemanager.containerregistry.models.TimerTriggerDescriptor; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; - -/** The properties for a run. */ -@Fluent -public final class RunProperties { - /* - * The unique identifier for the run. - */ - @JsonProperty(value = "runId") - private String runId; - - /* - * The current status of the run. - */ - @JsonProperty(value = "status") - private RunStatus status; - - /* - * The last updated time for the run. - */ - @JsonProperty(value = "lastUpdatedTime") - private OffsetDateTime lastUpdatedTime; - - /* - * The type of run. - */ - @JsonProperty(value = "runType") - private RunType runType; - - /* - * The time the run was scheduled. - */ - @JsonProperty(value = "createTime") - private OffsetDateTime createTime; - - /* - * The time the run started. - */ - @JsonProperty(value = "startTime") - private OffsetDateTime startTime; - - /* - * The time the run finished. - */ - @JsonProperty(value = "finishTime") - private OffsetDateTime finishTime; - - /* - * The list of all images that were generated from the run. This is - * applicable if the run generates base image dependencies. - */ - @JsonProperty(value = "outputImages") - private List outputImages; - - /* - * The task against which run was scheduled. - */ - @JsonProperty(value = "task") - private String task; - - /* - * The image update trigger that caused the run. This is applicable if the - * task has base image trigger configured. - */ - @JsonProperty(value = "imageUpdateTrigger") - private ImageUpdateTrigger imageUpdateTrigger; - - /* - * The source trigger that caused the run. - */ - @JsonProperty(value = "sourceTrigger") - private SourceTriggerDescriptor sourceTrigger; - - /* - * The platform properties against which the run will happen. - */ - @JsonProperty(value = "platform") - private PlatformProperties platform; - - /* - * The machine configuration of the run agent. - */ - @JsonProperty(value = "agentConfiguration") - private AgentProperties agentConfiguration; - - /* - * The scope of the credentials that were used to login to the source - * registry during this run. - */ - @JsonProperty(value = "sourceRegistryAuth") - private String sourceRegistryAuth; - - /* - * The list of custom registries that were logged in during this run. - */ - @JsonProperty(value = "customRegistries") - private List customRegistries; - - /* - * The error message received from backend systems after the run is - * scheduled. - */ - @JsonProperty(value = "runErrorMessage", access = JsonProperty.Access.WRITE_ONLY) - private String runErrorMessage; - - /* - * The provisioning state of a run. - */ - @JsonProperty(value = "provisioningState") - private ProvisioningState provisioningState; - - /* - * The value that indicates whether archiving is enabled or not. - */ - @JsonProperty(value = "isArchiveEnabled") - private Boolean isArchiveEnabled; - - /* - * The timer trigger that caused the run. - */ - @JsonProperty(value = "timerTrigger") - private TimerTriggerDescriptor timerTrigger; - - /** - * Get the runId property: The unique identifier for the run. - * - * @return the runId value. - */ - public String runId() { - return this.runId; - } - - /** - * Set the runId property: The unique identifier for the run. - * - * @param runId the runId value to set. - * @return the RunProperties object itself. - */ - public RunProperties withRunId(String runId) { - this.runId = runId; - return this; - } - - /** - * Get the status property: The current status of the run. - * - * @return the status value. - */ - public RunStatus status() { - return this.status; - } - - /** - * Set the status property: The current status of the run. - * - * @param status the status value to set. - * @return the RunProperties object itself. - */ - public RunProperties withStatus(RunStatus status) { - this.status = status; - return this; - } - - /** - * Get the lastUpdatedTime property: The last updated time for the run. - * - * @return the lastUpdatedTime value. - */ - public OffsetDateTime lastUpdatedTime() { - return this.lastUpdatedTime; - } - - /** - * Set the lastUpdatedTime property: The last updated time for the run. - * - * @param lastUpdatedTime the lastUpdatedTime value to set. - * @return the RunProperties object itself. - */ - public RunProperties withLastUpdatedTime(OffsetDateTime lastUpdatedTime) { - this.lastUpdatedTime = lastUpdatedTime; - return this; - } - - /** - * Get the runType property: The type of run. - * - * @return the runType value. - */ - public RunType runType() { - return this.runType; - } - - /** - * Set the runType property: The type of run. - * - * @param runType the runType value to set. - * @return the RunProperties object itself. - */ - public RunProperties withRunType(RunType runType) { - this.runType = runType; - return this; - } - - /** - * Get the createTime property: The time the run was scheduled. - * - * @return the createTime value. - */ - public OffsetDateTime createTime() { - return this.createTime; - } - - /** - * Set the createTime property: The time the run was scheduled. - * - * @param createTime the createTime value to set. - * @return the RunProperties object itself. - */ - public RunProperties withCreateTime(OffsetDateTime createTime) { - this.createTime = createTime; - return this; - } - - /** - * Get the startTime property: The time the run started. - * - * @return the startTime value. - */ - public OffsetDateTime startTime() { - return this.startTime; - } - - /** - * Set the startTime property: The time the run started. - * - * @param startTime the startTime value to set. - * @return the RunProperties object itself. - */ - public RunProperties withStartTime(OffsetDateTime startTime) { - this.startTime = startTime; - return this; - } - - /** - * Get the finishTime property: The time the run finished. - * - * @return the finishTime value. - */ - public OffsetDateTime finishTime() { - return this.finishTime; - } - - /** - * Set the finishTime property: The time the run finished. - * - * @param finishTime the finishTime value to set. - * @return the RunProperties object itself. - */ - public RunProperties withFinishTime(OffsetDateTime finishTime) { - this.finishTime = finishTime; - return this; - } - - /** - * Get the outputImages property: The list of all images that were generated from the run. This is applicable if the - * run generates base image dependencies. - * - * @return the outputImages value. - */ - public List outputImages() { - return this.outputImages; - } - - /** - * Set the outputImages property: The list of all images that were generated from the run. This is applicable if the - * run generates base image dependencies. - * - * @param outputImages the outputImages value to set. - * @return the RunProperties object itself. - */ - public RunProperties withOutputImages(List outputImages) { - this.outputImages = outputImages; - return this; - } - - /** - * Get the task property: The task against which run was scheduled. - * - * @return the task value. - */ - public String task() { - return this.task; - } - - /** - * Set the task property: The task against which run was scheduled. - * - * @param task the task value to set. - * @return the RunProperties object itself. - */ - public RunProperties withTask(String task) { - this.task = task; - return this; - } - - /** - * Get the imageUpdateTrigger property: The image update trigger that caused the run. This is applicable if the task - * has base image trigger configured. - * - * @return the imageUpdateTrigger value. - */ - public ImageUpdateTrigger imageUpdateTrigger() { - return this.imageUpdateTrigger; - } - - /** - * Set the imageUpdateTrigger property: The image update trigger that caused the run. This is applicable if the task - * has base image trigger configured. - * - * @param imageUpdateTrigger the imageUpdateTrigger value to set. - * @return the RunProperties object itself. - */ - public RunProperties withImageUpdateTrigger(ImageUpdateTrigger imageUpdateTrigger) { - this.imageUpdateTrigger = imageUpdateTrigger; - return this; - } - - /** - * Get the sourceTrigger property: The source trigger that caused the run. - * - * @return the sourceTrigger value. - */ - public SourceTriggerDescriptor sourceTrigger() { - return this.sourceTrigger; - } - - /** - * Set the sourceTrigger property: The source trigger that caused the run. - * - * @param sourceTrigger the sourceTrigger value to set. - * @return the RunProperties object itself. - */ - public RunProperties withSourceTrigger(SourceTriggerDescriptor sourceTrigger) { - this.sourceTrigger = sourceTrigger; - return this; - } - - /** - * Get the platform property: The platform properties against which the run will happen. - * - * @return the platform value. - */ - public PlatformProperties platform() { - return this.platform; - } - - /** - * Set the platform property: The platform properties against which the run will happen. - * - * @param platform the platform value to set. - * @return the RunProperties object itself. - */ - public RunProperties withPlatform(PlatformProperties platform) { - this.platform = platform; - return this; - } - - /** - * Get the agentConfiguration property: The machine configuration of the run agent. - * - * @return the agentConfiguration value. - */ - public AgentProperties agentConfiguration() { - return this.agentConfiguration; - } - - /** - * Set the agentConfiguration property: The machine configuration of the run agent. - * - * @param agentConfiguration the agentConfiguration value to set. - * @return the RunProperties object itself. - */ - public RunProperties withAgentConfiguration(AgentProperties agentConfiguration) { - this.agentConfiguration = agentConfiguration; - return this; - } - - /** - * Get the sourceRegistryAuth property: The scope of the credentials that were used to login to the source registry - * during this run. - * - * @return the sourceRegistryAuth value. - */ - public String sourceRegistryAuth() { - return this.sourceRegistryAuth; - } - - /** - * Set the sourceRegistryAuth property: The scope of the credentials that were used to login to the source registry - * during this run. - * - * @param sourceRegistryAuth the sourceRegistryAuth value to set. - * @return the RunProperties object itself. - */ - public RunProperties withSourceRegistryAuth(String sourceRegistryAuth) { - this.sourceRegistryAuth = sourceRegistryAuth; - return this; - } - - /** - * Get the customRegistries property: The list of custom registries that were logged in during this run. - * - * @return the customRegistries value. - */ - public List customRegistries() { - return this.customRegistries; - } - - /** - * Set the customRegistries property: The list of custom registries that were logged in during this run. - * - * @param customRegistries the customRegistries value to set. - * @return the RunProperties object itself. - */ - public RunProperties withCustomRegistries(List customRegistries) { - this.customRegistries = customRegistries; - return this; - } - - /** - * Get the runErrorMessage property: The error message received from backend systems after the run is scheduled. - * - * @return the runErrorMessage value. - */ - public String runErrorMessage() { - return this.runErrorMessage; - } - - /** - * Get the provisioningState property: The provisioning state of a run. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Set the provisioningState property: The provisioning state of a run. - * - * @param provisioningState the provisioningState value to set. - * @return the RunProperties object itself. - */ - public RunProperties withProvisioningState(ProvisioningState provisioningState) { - this.provisioningState = provisioningState; - return this; - } - - /** - * Get the isArchiveEnabled property: The value that indicates whether archiving is enabled or not. - * - * @return the isArchiveEnabled value. - */ - public Boolean isArchiveEnabled() { - return this.isArchiveEnabled; - } - - /** - * Set the isArchiveEnabled property: The value that indicates whether archiving is enabled or not. - * - * @param isArchiveEnabled the isArchiveEnabled value to set. - * @return the RunProperties object itself. - */ - public RunProperties withIsArchiveEnabled(Boolean isArchiveEnabled) { - this.isArchiveEnabled = isArchiveEnabled; - return this; - } - - /** - * Get the timerTrigger property: The timer trigger that caused the run. - * - * @return the timerTrigger value. - */ - public TimerTriggerDescriptor timerTrigger() { - return this.timerTrigger; - } - - /** - * Set the timerTrigger property: The timer trigger that caused the run. - * - * @param timerTrigger the timerTrigger value to set. - * @return the RunProperties object itself. - */ - public RunProperties withTimerTrigger(TimerTriggerDescriptor timerTrigger) { - this.timerTrigger = timerTrigger; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (outputImages() != null) { - outputImages().forEach(e -> e.validate()); - } - if (imageUpdateTrigger() != null) { - imageUpdateTrigger().validate(); - } - if (sourceTrigger() != null) { - sourceTrigger().validate(); - } - if (platform() != null) { - platform().validate(); - } - if (agentConfiguration() != null) { - agentConfiguration().validate(); - } - if (timerTrigger() != null) { - timerTrigger().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/SourceUploadDefinitionInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/SourceUploadDefinitionInner.java deleted file mode 100644 index dfbee3e7ec69..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/SourceUploadDefinitionInner.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The properties of a response to source upload request. */ -@Fluent -public final class SourceUploadDefinitionInner { - /* - * The URL where the client can upload the source. - */ - @JsonProperty(value = "uploadUrl") - private String uploadUrl; - - /* - * The relative path to the source. This is used to submit the subsequent - * queue build request. - */ - @JsonProperty(value = "relativePath") - private String relativePath; - - /** - * Get the uploadUrl property: The URL where the client can upload the source. - * - * @return the uploadUrl value. - */ - public String uploadUrl() { - return this.uploadUrl; - } - - /** - * Set the uploadUrl property: The URL where the client can upload the source. - * - * @param uploadUrl the uploadUrl value to set. - * @return the SourceUploadDefinitionInner object itself. - */ - public SourceUploadDefinitionInner withUploadUrl(String uploadUrl) { - this.uploadUrl = uploadUrl; - return this; - } - - /** - * Get the relativePath property: The relative path to the source. This is used to submit the subsequent queue build - * request. - * - * @return the relativePath value. - */ - public String relativePath() { - return this.relativePath; - } - - /** - * Set the relativePath property: The relative path to the source. This is used to submit the subsequent queue build - * request. - * - * @param relativePath the relativePath value to set. - * @return the SourceUploadDefinitionInner object itself. - */ - public SourceUploadDefinitionInner withRelativePath(String relativePath) { - this.relativePath = relativePath; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/TaskInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/TaskInner.java deleted file mode 100644 index 9ccea3be6e77..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/TaskInner.java +++ /dev/null @@ -1,276 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.resourcemanager.containerregistry.models.AgentProperties; -import com.azure.resourcemanager.containerregistry.models.Credentials; -import com.azure.resourcemanager.containerregistry.models.IdentityProperties; -import com.azure.resourcemanager.containerregistry.models.PlatformProperties; -import com.azure.resourcemanager.containerregistry.models.ProvisioningState; -import com.azure.resourcemanager.containerregistry.models.TaskStatus; -import com.azure.resourcemanager.containerregistry.models.TaskStepProperties; -import com.azure.resourcemanager.containerregistry.models.TriggerProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.Map; - -/** - * The task that has the ARM resource and task properties. The task will have all information to schedule a run against - * it. - */ -@Fluent -public final class TaskInner extends Resource { - /* - * Identity for the resource. - */ - @JsonProperty(value = "identity") - private IdentityProperties identity; - - /* - * The properties of a task. - */ - @JsonProperty(value = "properties") - private TaskProperties innerProperties; - - /** - * Get the identity property: Identity for the resource. - * - * @return the identity value. - */ - public IdentityProperties identity() { - return this.identity; - } - - /** - * Set the identity property: Identity for the resource. - * - * @param identity the identity value to set. - * @return the TaskInner object itself. - */ - public TaskInner withIdentity(IdentityProperties identity) { - this.identity = identity; - return this; - } - - /** - * Get the innerProperties property: The properties of a task. - * - * @return the innerProperties value. - */ - private TaskProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public TaskInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public TaskInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the task. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the creationDate property: The creation date of task. - * - * @return the creationDate value. - */ - public OffsetDateTime creationDate() { - return this.innerProperties() == null ? null : this.innerProperties().creationDate(); - } - - /** - * Get the status property: The current status of task. - * - * @return the status value. - */ - public TaskStatus status() { - return this.innerProperties() == null ? null : this.innerProperties().status(); - } - - /** - * Set the status property: The current status of task. - * - * @param status the status value to set. - * @return the TaskInner object itself. - */ - public TaskInner withStatus(TaskStatus status) { - if (this.innerProperties() == null) { - this.innerProperties = new TaskProperties(); - } - this.innerProperties().withStatus(status); - return this; - } - - /** - * Get the platform property: The platform properties against which the run has to happen. - * - * @return the platform value. - */ - public PlatformProperties platform() { - return this.innerProperties() == null ? null : this.innerProperties().platform(); - } - - /** - * Set the platform property: The platform properties against which the run has to happen. - * - * @param platform the platform value to set. - * @return the TaskInner object itself. - */ - public TaskInner withPlatform(PlatformProperties platform) { - if (this.innerProperties() == null) { - this.innerProperties = new TaskProperties(); - } - this.innerProperties().withPlatform(platform); - return this; - } - - /** - * Get the agentConfiguration property: The machine configuration of the run agent. - * - * @return the agentConfiguration value. - */ - public AgentProperties agentConfiguration() { - return this.innerProperties() == null ? null : this.innerProperties().agentConfiguration(); - } - - /** - * Set the agentConfiguration property: The machine configuration of the run agent. - * - * @param agentConfiguration the agentConfiguration value to set. - * @return the TaskInner object itself. - */ - public TaskInner withAgentConfiguration(AgentProperties agentConfiguration) { - if (this.innerProperties() == null) { - this.innerProperties = new TaskProperties(); - } - this.innerProperties().withAgentConfiguration(agentConfiguration); - return this; - } - - /** - * Get the timeout property: Run timeout in seconds. - * - * @return the timeout value. - */ - public Integer timeout() { - return this.innerProperties() == null ? null : this.innerProperties().timeout(); - } - - /** - * Set the timeout property: Run timeout in seconds. - * - * @param timeout the timeout value to set. - * @return the TaskInner object itself. - */ - public TaskInner withTimeout(Integer timeout) { - if (this.innerProperties() == null) { - this.innerProperties = new TaskProperties(); - } - this.innerProperties().withTimeout(timeout); - return this; - } - - /** - * Get the step property: The properties of a task step. - * - * @return the step value. - */ - public TaskStepProperties step() { - return this.innerProperties() == null ? null : this.innerProperties().step(); - } - - /** - * Set the step property: The properties of a task step. - * - * @param step the step value to set. - * @return the TaskInner object itself. - */ - public TaskInner withStep(TaskStepProperties step) { - if (this.innerProperties() == null) { - this.innerProperties = new TaskProperties(); - } - this.innerProperties().withStep(step); - return this; - } - - /** - * Get the trigger property: The properties that describe all triggers for the task. - * - * @return the trigger value. - */ - public TriggerProperties trigger() { - return this.innerProperties() == null ? null : this.innerProperties().trigger(); - } - - /** - * Set the trigger property: The properties that describe all triggers for the task. - * - * @param trigger the trigger value to set. - * @return the TaskInner object itself. - */ - public TaskInner withTrigger(TriggerProperties trigger) { - if (this.innerProperties() == null) { - this.innerProperties = new TaskProperties(); - } - this.innerProperties().withTrigger(trigger); - return this; - } - - /** - * Get the credentials property: The properties that describes a set of credentials that will be used when this run - * is invoked. - * - * @return the credentials value. - */ - public Credentials credentials() { - return this.innerProperties() == null ? null : this.innerProperties().credentials(); - } - - /** - * Set the credentials property: The properties that describes a set of credentials that will be used when this run - * is invoked. - * - * @param credentials the credentials value to set. - * @return the TaskInner object itself. - */ - public TaskInner withCredentials(Credentials credentials) { - if (this.innerProperties() == null) { - this.innerProperties = new TaskProperties(); - } - this.innerProperties().withCredentials(credentials); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (identity() != null) { - identity().validate(); - } - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/TaskProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/TaskProperties.java deleted file mode 100644 index 8dd657702fdd..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/TaskProperties.java +++ /dev/null @@ -1,269 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.containerregistry.models.AgentProperties; -import com.azure.resourcemanager.containerregistry.models.Credentials; -import com.azure.resourcemanager.containerregistry.models.PlatformProperties; -import com.azure.resourcemanager.containerregistry.models.ProvisioningState; -import com.azure.resourcemanager.containerregistry.models.TaskStatus; -import com.azure.resourcemanager.containerregistry.models.TaskStepProperties; -import com.azure.resourcemanager.containerregistry.models.TriggerProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** The properties of a task. */ -@Fluent -public final class TaskProperties { - /* - * The provisioning state of the task. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private ProvisioningState provisioningState; - - /* - * The creation date of task. - */ - @JsonProperty(value = "creationDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime creationDate; - - /* - * The current status of task. - */ - @JsonProperty(value = "status") - private TaskStatus status; - - /* - * The platform properties against which the run has to happen. - */ - @JsonProperty(value = "platform", required = true) - private PlatformProperties platform; - - /* - * The machine configuration of the run agent. - */ - @JsonProperty(value = "agentConfiguration") - private AgentProperties agentConfiguration; - - /* - * Run timeout in seconds. - */ - @JsonProperty(value = "timeout") - private Integer timeout; - - /* - * The properties of a task step. - */ - @JsonProperty(value = "step", required = true) - private TaskStepProperties step; - - /* - * The properties that describe all triggers for the task. - */ - @JsonProperty(value = "trigger") - private TriggerProperties trigger; - - /* - * The properties that describes a set of credentials that will be used - * when this run is invoked. - */ - @JsonProperty(value = "credentials") - private Credentials credentials; - - /** - * Get the provisioningState property: The provisioning state of the task. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Get the creationDate property: The creation date of task. - * - * @return the creationDate value. - */ - public OffsetDateTime creationDate() { - return this.creationDate; - } - - /** - * Get the status property: The current status of task. - * - * @return the status value. - */ - public TaskStatus status() { - return this.status; - } - - /** - * Set the status property: The current status of task. - * - * @param status the status value to set. - * @return the TaskProperties object itself. - */ - public TaskProperties withStatus(TaskStatus status) { - this.status = status; - return this; - } - - /** - * Get the platform property: The platform properties against which the run has to happen. - * - * @return the platform value. - */ - public PlatformProperties platform() { - return this.platform; - } - - /** - * Set the platform property: The platform properties against which the run has to happen. - * - * @param platform the platform value to set. - * @return the TaskProperties object itself. - */ - public TaskProperties withPlatform(PlatformProperties platform) { - this.platform = platform; - return this; - } - - /** - * Get the agentConfiguration property: The machine configuration of the run agent. - * - * @return the agentConfiguration value. - */ - public AgentProperties agentConfiguration() { - return this.agentConfiguration; - } - - /** - * Set the agentConfiguration property: The machine configuration of the run agent. - * - * @param agentConfiguration the agentConfiguration value to set. - * @return the TaskProperties object itself. - */ - public TaskProperties withAgentConfiguration(AgentProperties agentConfiguration) { - this.agentConfiguration = agentConfiguration; - return this; - } - - /** - * Get the timeout property: Run timeout in seconds. - * - * @return the timeout value. - */ - public Integer timeout() { - return this.timeout; - } - - /** - * Set the timeout property: Run timeout in seconds. - * - * @param timeout the timeout value to set. - * @return the TaskProperties object itself. - */ - public TaskProperties withTimeout(Integer timeout) { - this.timeout = timeout; - return this; - } - - /** - * Get the step property: The properties of a task step. - * - * @return the step value. - */ - public TaskStepProperties step() { - return this.step; - } - - /** - * Set the step property: The properties of a task step. - * - * @param step the step value to set. - * @return the TaskProperties object itself. - */ - public TaskProperties withStep(TaskStepProperties step) { - this.step = step; - return this; - } - - /** - * Get the trigger property: The properties that describe all triggers for the task. - * - * @return the trigger value. - */ - public TriggerProperties trigger() { - return this.trigger; - } - - /** - * Set the trigger property: The properties that describe all triggers for the task. - * - * @param trigger the trigger value to set. - * @return the TaskProperties object itself. - */ - public TaskProperties withTrigger(TriggerProperties trigger) { - this.trigger = trigger; - return this; - } - - /** - * Get the credentials property: The properties that describes a set of credentials that will be used when this run - * is invoked. - * - * @return the credentials value. - */ - public Credentials credentials() { - return this.credentials; - } - - /** - * Set the credentials property: The properties that describes a set of credentials that will be used when this run - * is invoked. - * - * @param credentials the credentials value to set. - * @return the TaskProperties object itself. - */ - public TaskProperties withCredentials(Credentials credentials) { - this.credentials = credentials; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (platform() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property platform in model TaskProperties")); - } else { - platform().validate(); - } - if (agentConfiguration() != null) { - agentConfiguration().validate(); - } - if (step() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property step in model TaskProperties")); - } else { - step().validate(); - } - if (trigger() != null) { - trigger().validate(); - } - if (credentials() != null) { - credentials().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(TaskProperties.class); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/TaskPropertiesUpdateParameters.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/TaskPropertiesUpdateParameters.java deleted file mode 100644 index 3388319e900d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/TaskPropertiesUpdateParameters.java +++ /dev/null @@ -1,226 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.containerregistry.models.AgentProperties; -import com.azure.resourcemanager.containerregistry.models.Credentials; -import com.azure.resourcemanager.containerregistry.models.PlatformUpdateParameters; -import com.azure.resourcemanager.containerregistry.models.TaskStatus; -import com.azure.resourcemanager.containerregistry.models.TaskStepUpdateParameters; -import com.azure.resourcemanager.containerregistry.models.TriggerUpdateParameters; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The properties for updating a task. */ -@Fluent -public final class TaskPropertiesUpdateParameters { - /* - * The current status of task. - */ - @JsonProperty(value = "status") - private TaskStatus status; - - /* - * The platform properties against which the run has to happen. - */ - @JsonProperty(value = "platform") - private PlatformUpdateParameters platform; - - /* - * The machine configuration of the run agent. - */ - @JsonProperty(value = "agentConfiguration") - private AgentProperties agentConfiguration; - - /* - * Run timeout in seconds. - */ - @JsonProperty(value = "timeout") - private Integer timeout; - - /* - * The properties for updating a task step. - */ - @JsonProperty(value = "step") - private TaskStepUpdateParameters step; - - /* - * The properties for updating trigger properties. - */ - @JsonProperty(value = "trigger") - private TriggerUpdateParameters trigger; - - /* - * The parameters that describes a set of credentials that will be used - * when this run is invoked. - */ - @JsonProperty(value = "credentials") - private Credentials credentials; - - /** - * Get the status property: The current status of task. - * - * @return the status value. - */ - public TaskStatus status() { - return this.status; - } - - /** - * Set the status property: The current status of task. - * - * @param status the status value to set. - * @return the TaskPropertiesUpdateParameters object itself. - */ - public TaskPropertiesUpdateParameters withStatus(TaskStatus status) { - this.status = status; - return this; - } - - /** - * Get the platform property: The platform properties against which the run has to happen. - * - * @return the platform value. - */ - public PlatformUpdateParameters platform() { - return this.platform; - } - - /** - * Set the platform property: The platform properties against which the run has to happen. - * - * @param platform the platform value to set. - * @return the TaskPropertiesUpdateParameters object itself. - */ - public TaskPropertiesUpdateParameters withPlatform(PlatformUpdateParameters platform) { - this.platform = platform; - return this; - } - - /** - * Get the agentConfiguration property: The machine configuration of the run agent. - * - * @return the agentConfiguration value. - */ - public AgentProperties agentConfiguration() { - return this.agentConfiguration; - } - - /** - * Set the agentConfiguration property: The machine configuration of the run agent. - * - * @param agentConfiguration the agentConfiguration value to set. - * @return the TaskPropertiesUpdateParameters object itself. - */ - public TaskPropertiesUpdateParameters withAgentConfiguration(AgentProperties agentConfiguration) { - this.agentConfiguration = agentConfiguration; - return this; - } - - /** - * Get the timeout property: Run timeout in seconds. - * - * @return the timeout value. - */ - public Integer timeout() { - return this.timeout; - } - - /** - * Set the timeout property: Run timeout in seconds. - * - * @param timeout the timeout value to set. - * @return the TaskPropertiesUpdateParameters object itself. - */ - public TaskPropertiesUpdateParameters withTimeout(Integer timeout) { - this.timeout = timeout; - return this; - } - - /** - * Get the step property: The properties for updating a task step. - * - * @return the step value. - */ - public TaskStepUpdateParameters step() { - return this.step; - } - - /** - * Set the step property: The properties for updating a task step. - * - * @param step the step value to set. - * @return the TaskPropertiesUpdateParameters object itself. - */ - public TaskPropertiesUpdateParameters withStep(TaskStepUpdateParameters step) { - this.step = step; - return this; - } - - /** - * Get the trigger property: The properties for updating trigger properties. - * - * @return the trigger value. - */ - public TriggerUpdateParameters trigger() { - return this.trigger; - } - - /** - * Set the trigger property: The properties for updating trigger properties. - * - * @param trigger the trigger value to set. - * @return the TaskPropertiesUpdateParameters object itself. - */ - public TaskPropertiesUpdateParameters withTrigger(TriggerUpdateParameters trigger) { - this.trigger = trigger; - return this; - } - - /** - * Get the credentials property: The parameters that describes a set of credentials that will be used when this run - * is invoked. - * - * @return the credentials value. - */ - public Credentials credentials() { - return this.credentials; - } - - /** - * Set the credentials property: The parameters that describes a set of credentials that will be used when this run - * is invoked. - * - * @param credentials the credentials value to set. - * @return the TaskPropertiesUpdateParameters object itself. - */ - public TaskPropertiesUpdateParameters withCredentials(Credentials credentials) { - this.credentials = credentials; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (platform() != null) { - platform().validate(); - } - if (agentConfiguration() != null) { - agentConfiguration().validate(); - } - if (step() != null) { - step().validate(); - } - if (trigger() != null) { - trigger().validate(); - } - if (credentials() != null) { - credentials().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/WebhookInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/WebhookInner.java deleted file mode 100644 index f8724408c2c2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/WebhookInner.java +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.resourcemanager.containerregistry.models.ProvisioningState; -import com.azure.resourcemanager.containerregistry.models.WebhookAction; -import com.azure.resourcemanager.containerregistry.models.WebhookStatus; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** An object that represents a webhook for a container registry. */ -@Fluent -public final class WebhookInner extends Resource { - /* - * The properties of the webhook. - */ - @JsonProperty(value = "properties") - private WebhookProperties innerProperties; - - /** - * Get the innerProperties property: The properties of the webhook. - * - * @return the innerProperties value. - */ - private WebhookProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public WebhookInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public WebhookInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the status property: The status of the webhook at the time the operation was called. - * - * @return the status value. - */ - public WebhookStatus status() { - return this.innerProperties() == null ? null : this.innerProperties().status(); - } - - /** - * Set the status property: The status of the webhook at the time the operation was called. - * - * @param status the status value to set. - * @return the WebhookInner object itself. - */ - public WebhookInner withStatus(WebhookStatus status) { - if (this.innerProperties() == null) { - this.innerProperties = new WebhookProperties(); - } - this.innerProperties().withStatus(status); - return this; - } - - /** - * Get the scope property: The scope of repositories where the event can be triggered. For example, 'foo:*' means - * events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to - * 'foo:latest'. Empty means all events. - * - * @return the scope value. - */ - public String scope() { - return this.innerProperties() == null ? null : this.innerProperties().scope(); - } - - /** - * Set the scope property: The scope of repositories where the event can be triggered. For example, 'foo:*' means - * events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to - * 'foo:latest'. Empty means all events. - * - * @param scope the scope value to set. - * @return the WebhookInner object itself. - */ - public WebhookInner withScope(String scope) { - if (this.innerProperties() == null) { - this.innerProperties = new WebhookProperties(); - } - this.innerProperties().withScope(scope); - return this; - } - - /** - * Get the actions property: The list of actions that trigger the webhook to post notifications. - * - * @return the actions value. - */ - public List actions() { - return this.innerProperties() == null ? null : this.innerProperties().actions(); - } - - /** - * Set the actions property: The list of actions that trigger the webhook to post notifications. - * - * @param actions the actions value to set. - * @return the WebhookInner object itself. - */ - public WebhookInner withActions(List actions) { - if (this.innerProperties() == null) { - this.innerProperties = new WebhookProperties(); - } - this.innerProperties().withActions(actions); - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the webhook at the time the operation was called. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/WebhookProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/WebhookProperties.java deleted file mode 100644 index 28fcee17fab9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/WebhookProperties.java +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.containerregistry.models.ProvisioningState; -import com.azure.resourcemanager.containerregistry.models.WebhookAction; -import com.azure.resourcemanager.containerregistry.models.WebhookStatus; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The properties of a webhook. */ -@Fluent -public final class WebhookProperties { - /* - * The status of the webhook at the time the operation was called. - */ - @JsonProperty(value = "status") - private WebhookStatus status; - - /* - * The scope of repositories where the event can be triggered. For example, - * 'foo:*' means events for all tags under repository 'foo'. 'foo:bar' - * means events for 'foo:bar' only. 'foo' is equivalent to 'foo:latest'. - * Empty means all events. - */ - @JsonProperty(value = "scope") - private String scope; - - /* - * The list of actions that trigger the webhook to post notifications. - */ - @JsonProperty(value = "actions", required = true) - private List actions; - - /* - * The provisioning state of the webhook at the time the operation was - * called. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private ProvisioningState provisioningState; - - /** - * Get the status property: The status of the webhook at the time the operation was called. - * - * @return the status value. - */ - public WebhookStatus status() { - return this.status; - } - - /** - * Set the status property: The status of the webhook at the time the operation was called. - * - * @param status the status value to set. - * @return the WebhookProperties object itself. - */ - public WebhookProperties withStatus(WebhookStatus status) { - this.status = status; - return this; - } - - /** - * Get the scope property: The scope of repositories where the event can be triggered. For example, 'foo:*' means - * events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to - * 'foo:latest'. Empty means all events. - * - * @return the scope value. - */ - public String scope() { - return this.scope; - } - - /** - * Set the scope property: The scope of repositories where the event can be triggered. For example, 'foo:*' means - * events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to - * 'foo:latest'. Empty means all events. - * - * @param scope the scope value to set. - * @return the WebhookProperties object itself. - */ - public WebhookProperties withScope(String scope) { - this.scope = scope; - return this; - } - - /** - * Get the actions property: The list of actions that trigger the webhook to post notifications. - * - * @return the actions value. - */ - public List actions() { - return this.actions; - } - - /** - * Set the actions property: The list of actions that trigger the webhook to post notifications. - * - * @param actions the actions value to set. - * @return the WebhookProperties object itself. - */ - public WebhookProperties withActions(List actions) { - this.actions = actions; - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the webhook at the time the operation was called. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (actions() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property actions in model WebhookProperties")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(WebhookProperties.class); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/WebhookPropertiesCreateParameters.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/WebhookPropertiesCreateParameters.java deleted file mode 100644 index d3871e633961..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/WebhookPropertiesCreateParameters.java +++ /dev/null @@ -1,178 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.containerregistry.models.WebhookAction; -import com.azure.resourcemanager.containerregistry.models.WebhookStatus; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** The parameters for creating the properties of a webhook. */ -@Fluent -public final class WebhookPropertiesCreateParameters { - /* - * The service URI for the webhook to post notifications. - */ - @JsonProperty(value = "serviceUri", required = true) - private String serviceUri; - - /* - * Custom headers that will be added to the webhook notifications. - */ - @JsonProperty(value = "customHeaders") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map customHeaders; - - /* - * The status of the webhook at the time the operation was called. - */ - @JsonProperty(value = "status") - private WebhookStatus status; - - /* - * The scope of repositories where the event can be triggered. For example, - * 'foo:*' means events for all tags under repository 'foo'. 'foo:bar' - * means events for 'foo:bar' only. 'foo' is equivalent to 'foo:latest'. - * Empty means all events. - */ - @JsonProperty(value = "scope") - private String scope; - - /* - * The list of actions that trigger the webhook to post notifications. - */ - @JsonProperty(value = "actions", required = true) - private List actions; - - /** - * Get the serviceUri property: The service URI for the webhook to post notifications. - * - * @return the serviceUri value. - */ - public String serviceUri() { - return this.serviceUri; - } - - /** - * Set the serviceUri property: The service URI for the webhook to post notifications. - * - * @param serviceUri the serviceUri value to set. - * @return the WebhookPropertiesCreateParameters object itself. - */ - public WebhookPropertiesCreateParameters withServiceUri(String serviceUri) { - this.serviceUri = serviceUri; - return this; - } - - /** - * Get the customHeaders property: Custom headers that will be added to the webhook notifications. - * - * @return the customHeaders value. - */ - public Map customHeaders() { - return this.customHeaders; - } - - /** - * Set the customHeaders property: Custom headers that will be added to the webhook notifications. - * - * @param customHeaders the customHeaders value to set. - * @return the WebhookPropertiesCreateParameters object itself. - */ - public WebhookPropertiesCreateParameters withCustomHeaders(Map customHeaders) { - this.customHeaders = customHeaders; - return this; - } - - /** - * Get the status property: The status of the webhook at the time the operation was called. - * - * @return the status value. - */ - public WebhookStatus status() { - return this.status; - } - - /** - * Set the status property: The status of the webhook at the time the operation was called. - * - * @param status the status value to set. - * @return the WebhookPropertiesCreateParameters object itself. - */ - public WebhookPropertiesCreateParameters withStatus(WebhookStatus status) { - this.status = status; - return this; - } - - /** - * Get the scope property: The scope of repositories where the event can be triggered. For example, 'foo:*' means - * events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to - * 'foo:latest'. Empty means all events. - * - * @return the scope value. - */ - public String scope() { - return this.scope; - } - - /** - * Set the scope property: The scope of repositories where the event can be triggered. For example, 'foo:*' means - * events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to - * 'foo:latest'. Empty means all events. - * - * @param scope the scope value to set. - * @return the WebhookPropertiesCreateParameters object itself. - */ - public WebhookPropertiesCreateParameters withScope(String scope) { - this.scope = scope; - return this; - } - - /** - * Get the actions property: The list of actions that trigger the webhook to post notifications. - * - * @return the actions value. - */ - public List actions() { - return this.actions; - } - - /** - * Set the actions property: The list of actions that trigger the webhook to post notifications. - * - * @param actions the actions value to set. - * @return the WebhookPropertiesCreateParameters object itself. - */ - public WebhookPropertiesCreateParameters withActions(List actions) { - this.actions = actions; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (serviceUri() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property serviceUri in model WebhookPropertiesCreateParameters")); - } - if (actions() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property actions in model WebhookPropertiesCreateParameters")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(WebhookPropertiesCreateParameters.class); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/WebhookPropertiesUpdateParameters.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/WebhookPropertiesUpdateParameters.java deleted file mode 100644 index 9405941bf0f7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/WebhookPropertiesUpdateParameters.java +++ /dev/null @@ -1,163 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.containerregistry.models.WebhookAction; -import com.azure.resourcemanager.containerregistry.models.WebhookStatus; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** The parameters for updating the properties of a webhook. */ -@Fluent -public final class WebhookPropertiesUpdateParameters { - /* - * The service URI for the webhook to post notifications. - */ - @JsonProperty(value = "serviceUri") - private String serviceUri; - - /* - * Custom headers that will be added to the webhook notifications. - */ - @JsonProperty(value = "customHeaders") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map customHeaders; - - /* - * The status of the webhook at the time the operation was called. - */ - @JsonProperty(value = "status") - private WebhookStatus status; - - /* - * The scope of repositories where the event can be triggered. For example, - * 'foo:*' means events for all tags under repository 'foo'. 'foo:bar' - * means events for 'foo:bar' only. 'foo' is equivalent to 'foo:latest'. - * Empty means all events. - */ - @JsonProperty(value = "scope") - private String scope; - - /* - * The list of actions that trigger the webhook to post notifications. - */ - @JsonProperty(value = "actions") - private List actions; - - /** - * Get the serviceUri property: The service URI for the webhook to post notifications. - * - * @return the serviceUri value. - */ - public String serviceUri() { - return this.serviceUri; - } - - /** - * Set the serviceUri property: The service URI for the webhook to post notifications. - * - * @param serviceUri the serviceUri value to set. - * @return the WebhookPropertiesUpdateParameters object itself. - */ - public WebhookPropertiesUpdateParameters withServiceUri(String serviceUri) { - this.serviceUri = serviceUri; - return this; - } - - /** - * Get the customHeaders property: Custom headers that will be added to the webhook notifications. - * - * @return the customHeaders value. - */ - public Map customHeaders() { - return this.customHeaders; - } - - /** - * Set the customHeaders property: Custom headers that will be added to the webhook notifications. - * - * @param customHeaders the customHeaders value to set. - * @return the WebhookPropertiesUpdateParameters object itself. - */ - public WebhookPropertiesUpdateParameters withCustomHeaders(Map customHeaders) { - this.customHeaders = customHeaders; - return this; - } - - /** - * Get the status property: The status of the webhook at the time the operation was called. - * - * @return the status value. - */ - public WebhookStatus status() { - return this.status; - } - - /** - * Set the status property: The status of the webhook at the time the operation was called. - * - * @param status the status value to set. - * @return the WebhookPropertiesUpdateParameters object itself. - */ - public WebhookPropertiesUpdateParameters withStatus(WebhookStatus status) { - this.status = status; - return this; - } - - /** - * Get the scope property: The scope of repositories where the event can be triggered. For example, 'foo:*' means - * events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to - * 'foo:latest'. Empty means all events. - * - * @return the scope value. - */ - public String scope() { - return this.scope; - } - - /** - * Set the scope property: The scope of repositories where the event can be triggered. For example, 'foo:*' means - * events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to - * 'foo:latest'. Empty means all events. - * - * @param scope the scope value to set. - * @return the WebhookPropertiesUpdateParameters object itself. - */ - public WebhookPropertiesUpdateParameters withScope(String scope) { - this.scope = scope; - return this; - } - - /** - * Get the actions property: The list of actions that trigger the webhook to post notifications. - * - * @return the actions value. - */ - public List actions() { - return this.actions; - } - - /** - * Set the actions property: The list of actions that trigger the webhook to post notifications. - * - * @param actions the actions value to set. - * @return the WebhookPropertiesUpdateParameters object itself. - */ - public WebhookPropertiesUpdateParameters withActions(List actions) { - this.actions = actions; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/package-info.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/package-info.java deleted file mode 100644 index 7fcc5da82669..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** Package containing the inner data models for ContainerRegistryManagementClient. null. */ -package com.azure.resourcemanager.containerregistry.fluent.models; diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/package-info.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/package-info.java deleted file mode 100644 index e2a8fd5b7f2b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** Package containing the service clients for ContainerRegistryManagementClient. null. */ -package com.azure.resourcemanager.containerregistry.fluent; diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/CheckNameAvailabilityResultImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/CheckNameAvailabilityResultImpl.java deleted file mode 100644 index 84cec7f4c510..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/CheckNameAvailabilityResultImpl.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.containerregistry.implementation; - -import com.azure.resourcemanager.containerregistry.models.CheckNameAvailabilityResult; -import com.azure.resourcemanager.containerregistry.fluent.models.RegistryNameStatusInner; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.WrapperImpl; - -/** Implementation for CheckNameAvailabilityResult. */ -public class CheckNameAvailabilityResultImpl extends WrapperImpl - implements CheckNameAvailabilityResult { - /** - * Creates an instance of the check name availability result object. - * - * @param inner the inner object - */ - CheckNameAvailabilityResultImpl(RegistryNameStatusInner inner) { - super(inner); - } - - @Override - public boolean isAvailable() { - return innerModel().nameAvailable(); - } - - @Override - public String unavailabilityReason() { - return innerModel().reason(); - } - - @Override - public String unavailabilityMessage() { - return innerModel().message(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/ContainerRegistryManagementClientBuilder.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/ContainerRegistryManagementClientBuilder.java deleted file mode 100644 index d384b5aad405..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/ContainerRegistryManagementClientBuilder.java +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.implementation; - -import com.azure.core.annotation.ServiceClientBuilder; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerAdapter; -import java.time.Duration; - -/** A builder for creating a new instance of the ContainerRegistryManagementClientImpl type. */ -@ServiceClientBuilder(serviceClients = {ContainerRegistryManagementClientImpl.class}) -public final class ContainerRegistryManagementClientBuilder { - /* - * The Microsoft Azure subscription ID. - */ - private String subscriptionId; - - /** - * Sets The Microsoft Azure subscription ID. - * - * @param subscriptionId the subscriptionId value. - * @return the ContainerRegistryManagementClientBuilder. - */ - public ContainerRegistryManagementClientBuilder subscriptionId(String subscriptionId) { - this.subscriptionId = subscriptionId; - return this; - } - - /* - * server parameter - */ - private String endpoint; - - /** - * Sets server parameter. - * - * @param endpoint the endpoint value. - * @return the ContainerRegistryManagementClientBuilder. - */ - public ContainerRegistryManagementClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * The environment to connect to - */ - private AzureEnvironment environment; - - /** - * Sets The environment to connect to. - * - * @param environment the environment value. - * @return the ContainerRegistryManagementClientBuilder. - */ - public ContainerRegistryManagementClientBuilder environment(AzureEnvironment environment) { - this.environment = environment; - return this; - } - - /* - * The HTTP pipeline to send requests through - */ - private HttpPipeline pipeline; - - /** - * Sets The HTTP pipeline to send requests through. - * - * @param pipeline the pipeline value. - * @return the ContainerRegistryManagementClientBuilder. - */ - public ContainerRegistryManagementClientBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; - return this; - } - - /* - * The default poll interval for long-running operation - */ - private Duration defaultPollInterval; - - /** - * Sets The default poll interval for long-running operation. - * - * @param defaultPollInterval the defaultPollInterval value. - * @return the ContainerRegistryManagementClientBuilder. - */ - public ContainerRegistryManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = defaultPollInterval; - return this; - } - - /* - * The serializer to serialize an object into a string - */ - private SerializerAdapter serializerAdapter; - - /** - * Sets The serializer to serialize an object into a string. - * - * @param serializerAdapter the serializerAdapter value. - * @return the ContainerRegistryManagementClientBuilder. - */ - public ContainerRegistryManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { - this.serializerAdapter = serializerAdapter; - return this; - } - - /** - * Builds an instance of ContainerRegistryManagementClientImpl with the provided parameters. - * - * @return an instance of ContainerRegistryManagementClientImpl. - */ - public ContainerRegistryManagementClientImpl buildClient() { - if (endpoint == null) { - this.endpoint = "https://management.azure.com"; - } - if (environment == null) { - this.environment = AzureEnvironment.AZURE; - } - if (pipeline == null) { - this.pipeline = new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); - } - if (defaultPollInterval == null) { - this.defaultPollInterval = Duration.ofSeconds(30); - } - if (serializerAdapter == null) { - this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); - } - ContainerRegistryManagementClientImpl client = - new ContainerRegistryManagementClientImpl( - pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); - return client; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/ContainerRegistryManagementClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/ContainerRegistryManagementClientImpl.java deleted file mode 100644 index 0c32b060c647..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/ContainerRegistryManagementClientImpl.java +++ /dev/null @@ -1,187 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.implementation; - -import com.azure.core.annotation.ServiceClient; -import com.azure.core.http.HttpPipeline; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.util.serializer.SerializerAdapter; -import com.azure.resourcemanager.containerregistry.fluent.ContainerRegistryManagementClient; -import com.azure.resourcemanager.containerregistry.fluent.OperationsClient; -import com.azure.resourcemanager.containerregistry.fluent.RegistriesClient; -import com.azure.resourcemanager.containerregistry.fluent.ReplicationsClient; -import com.azure.resourcemanager.containerregistry.fluent.RunsClient; -import com.azure.resourcemanager.containerregistry.fluent.TasksClient; -import com.azure.resourcemanager.containerregistry.fluent.WebhooksClient; -import com.azure.resourcemanager.resources.fluentcore.AzureServiceClient; -import java.time.Duration; - -/** Initializes a new instance of the ContainerRegistryManagementClientImpl type. */ -@ServiceClient(builder = ContainerRegistryManagementClientBuilder.class) -public final class ContainerRegistryManagementClientImpl extends AzureServiceClient - implements ContainerRegistryManagementClient { - /** The Microsoft Azure subscription ID. */ - private final String subscriptionId; - - /** - * Gets The Microsoft Azure subscription ID. - * - * @return the subscriptionId value. - */ - public String getSubscriptionId() { - return this.subscriptionId; - } - - /** server parameter. */ - private final String endpoint; - - /** - * Gets server parameter. - * - * @return the endpoint value. - */ - public String getEndpoint() { - return this.endpoint; - } - - /** The HTTP pipeline to send requests through. */ - private final HttpPipeline httpPipeline; - - /** - * Gets The HTTP pipeline to send requests through. - * - * @return the httpPipeline value. - */ - public HttpPipeline getHttpPipeline() { - return this.httpPipeline; - } - - /** The serializer to serialize an object into a string. */ - private final SerializerAdapter serializerAdapter; - - /** - * Gets The serializer to serialize an object into a string. - * - * @return the serializerAdapter value. - */ - SerializerAdapter getSerializerAdapter() { - return this.serializerAdapter; - } - - /** The default poll interval for long-running operation. */ - private final Duration defaultPollInterval; - - /** - * Gets The default poll interval for long-running operation. - * - * @return the defaultPollInterval value. - */ - public Duration getDefaultPollInterval() { - return this.defaultPollInterval; - } - - /** The RegistriesClient object to access its operations. */ - private final RegistriesClient registries; - - /** - * Gets the RegistriesClient object to access its operations. - * - * @return the RegistriesClient object. - */ - public RegistriesClient getRegistries() { - return this.registries; - } - - /** The OperationsClient object to access its operations. */ - private final OperationsClient operations; - - /** - * Gets the OperationsClient object to access its operations. - * - * @return the OperationsClient object. - */ - public OperationsClient getOperations() { - return this.operations; - } - - /** The ReplicationsClient object to access its operations. */ - private final ReplicationsClient replications; - - /** - * Gets the ReplicationsClient object to access its operations. - * - * @return the ReplicationsClient object. - */ - public ReplicationsClient getReplications() { - return this.replications; - } - - /** The WebhooksClient object to access its operations. */ - private final WebhooksClient webhooks; - - /** - * Gets the WebhooksClient object to access its operations. - * - * @return the WebhooksClient object. - */ - public WebhooksClient getWebhooks() { - return this.webhooks; - } - - /** The RunsClient object to access its operations. */ - private final RunsClient runs; - - /** - * Gets the RunsClient object to access its operations. - * - * @return the RunsClient object. - */ - public RunsClient getRuns() { - return this.runs; - } - - /** The TasksClient object to access its operations. */ - private final TasksClient tasks; - - /** - * Gets the TasksClient object to access its operations. - * - * @return the TasksClient object. - */ - public TasksClient getTasks() { - return this.tasks; - } - - /** - * Initializes an instance of ContainerRegistryManagementClient client. - * - * @param httpPipeline The HTTP pipeline to send requests through. - * @param serializerAdapter The serializer to serialize an object into a string. - * @param defaultPollInterval The default poll interval for long-running operation. - * @param environment The Azure environment. - * @param subscriptionId The Microsoft Azure subscription ID. - * @param endpoint server parameter. - */ - ContainerRegistryManagementClientImpl( - HttpPipeline httpPipeline, - SerializerAdapter serializerAdapter, - Duration defaultPollInterval, - AzureEnvironment environment, - String subscriptionId, - String endpoint) { - super(httpPipeline, serializerAdapter, environment); - this.httpPipeline = httpPipeline; - this.serializerAdapter = serializerAdapter; - this.defaultPollInterval = defaultPollInterval; - this.subscriptionId = subscriptionId; - this.endpoint = endpoint; - this.registries = new RegistriesClientImpl(this); - this.operations = new OperationsClientImpl(this); - this.replications = new ReplicationsClientImpl(this); - this.webhooks = new WebhooksClientImpl(this); - this.runs = new RunsClientImpl(this); - this.tasks = new TasksClientImpl(this); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/OperationsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/OperationsClientImpl.java deleted file mode 100644 index 73c2e20b75d1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/OperationsClientImpl.java +++ /dev/null @@ -1,275 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.containerregistry.fluent.OperationsClient; -import com.azure.resourcemanager.containerregistry.fluent.models.OperationDefinitionInner; -import com.azure.resourcemanager.containerregistry.models.OperationListResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in OperationsClient. */ -public final class OperationsClientImpl implements OperationsClient { - /** The proxy service used to perform REST calls. */ - private final OperationsService service; - - /** The service client containing this operation class. */ - private final ContainerRegistryManagementClientImpl client; - - /** - * Initializes an instance of OperationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - OperationsClientImpl(ContainerRegistryManagementClientImpl client) { - this.service = - RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for ContainerRegistryManagementClientOperations to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "ContainerRegistryMan") - private interface OperationsService { - @Headers({"Content-Type: application/json"}) - @Get("/providers/Microsoft.ContainerRegistry/operations") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Lists all of the available Azure Container Registry REST API operations. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list container registry operations along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String apiVersion = "2019-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all of the available Azure Container Registry REST API operations. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list container registry operations along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String apiVersion = "2019-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists all of the available Azure Container Registry REST API operations. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list container registry operations as paginated response with {@link - * PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists all of the available Azure Container Registry REST API operations. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list container registry operations as paginated response with {@link - * PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all of the available Azure Container Registry REST API operations. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list container registry operations as paginated response with {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Lists all of the available Azure Container Registry REST API operations. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list container registry operations as paginated response with {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list container registry operations along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list container registry operations along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistriesClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistriesClientImpl.java deleted file mode 100644 index 566e66df9784..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistriesClientImpl.java +++ /dev/null @@ -1,2964 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.containerregistry.fluent.RegistriesClient; -import com.azure.resourcemanager.containerregistry.fluent.models.RegistryInner; -import com.azure.resourcemanager.containerregistry.fluent.models.RegistryListCredentialsResultInner; -import com.azure.resourcemanager.containerregistry.fluent.models.RegistryNameStatusInner; -import com.azure.resourcemanager.containerregistry.fluent.models.RegistryUsageListResultInner; -import com.azure.resourcemanager.containerregistry.fluent.models.RunInner; -import com.azure.resourcemanager.containerregistry.fluent.models.SourceUploadDefinitionInner; -import com.azure.resourcemanager.containerregistry.models.ImportImageParameters; -import com.azure.resourcemanager.containerregistry.models.RegenerateCredentialParameters; -import com.azure.resourcemanager.containerregistry.models.RegistryListResult; -import com.azure.resourcemanager.containerregistry.models.RegistryNameCheckRequest; -import com.azure.resourcemanager.containerregistry.models.RegistryUpdateParameters; -import com.azure.resourcemanager.containerregistry.models.RunRequest; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in RegistriesClient. */ -public final class RegistriesClientImpl - implements InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete, - RegistriesClient { - /** The proxy service used to perform REST calls. */ - private final RegistriesService service; - - /** The service client containing this operation class. */ - private final ContainerRegistryManagementClientImpl client; - - /** - * Initializes an instance of RegistriesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - RegistriesClientImpl(ContainerRegistryManagementClientImpl client) { - this.service = - RestProxy.create(RegistriesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for ContainerRegistryManagementClientRegistries to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "ContainerRegistryMan") - private interface RegistriesService { - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" - + "/registries/{registryName}/importImage") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> importImage( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("registryName") String registryName, - @BodyParam("application/json") ImportImageParameters parameters, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post("/subscriptions/{subscriptionId}/providers/Microsoft.ContainerRegistry/checkNameAvailability") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> checkNameAvailability( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") RegistryNameCheckRequest registryNameCheckRequest, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" - + "/registries/{registryName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("registryName") String registryName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" - + "/registries/{registryName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> create( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("registryName") String registryName, - @BodyParam("application/json") RegistryInner registry, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" - + "/registries/{registryName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("registryName") String registryName, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" - + "/registries/{registryName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("registryName") String registryName, - @BodyParam("application/json") RegistryUpdateParameters registryUpdateParameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" - + "/registries") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ContainerRegistry/registries") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" - + "/registries/{registryName}/listCredentials") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listCredentials( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("registryName") String registryName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" - + "/registries/{registryName}/regenerateCredential") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> regenerateCredential( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("registryName") String registryName, - @BodyParam("application/json") RegenerateCredentialParameters regenerateCredentialParameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" - + "/registries/{registryName}/listUsages") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listUsages( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("registryName") String registryName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" - + "/registries/{registryName}/scheduleRun") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> scheduleRun( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("registryName") String registryName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") RunRequest runRequest, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" - + "/registries/{registryName}/listBuildSourceUploadUrl") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getBuildSourceUploadUrl( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("registryName") String registryName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Copies an image to this container registry from the specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param parameters The parameters specifying the image to copy and the source container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> importImageWithResponseAsync( - String resourceGroupName, String registryName, ImportImageParameters parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (registryName == null) { - return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2019-05-01"; - return FluxUtil - .withContext( - context -> - service - .importImage( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - registryName, - parameters, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Copies an image to this container registry from the specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param parameters The parameters specifying the image to copy and the source container registry. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> importImageWithResponseAsync( - String resourceGroupName, String registryName, ImportImageParameters parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (registryName == null) { - return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2019-05-01"; - context = this.client.mergeContext(context); - return service - .importImage( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - registryName, - parameters, - context); - } - - /** - * Copies an image to this container registry from the specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param parameters The parameters specifying the image to copy and the source container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, Void> beginImportImageAsync( - String resourceGroupName, String registryName, ImportImageParameters parameters) { - Mono>> mono = - importImageWithResponseAsync(resourceGroupName, registryName, parameters); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Copies an image to this container registry from the specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param parameters The parameters specifying the image to copy and the source container registry. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginImportImageAsync( - String resourceGroupName, String registryName, ImportImageParameters parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - importImageWithResponseAsync(resourceGroupName, registryName, parameters, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Copies an image to this container registry from the specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param parameters The parameters specifying the image to copy and the source container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginImportImage( - String resourceGroupName, String registryName, ImportImageParameters parameters) { - return beginImportImageAsync(resourceGroupName, registryName, parameters).getSyncPoller(); - } - - /** - * Copies an image to this container registry from the specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param parameters The parameters specifying the image to copy and the source container registry. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginImportImage( - String resourceGroupName, String registryName, ImportImageParameters parameters, Context context) { - return beginImportImageAsync(resourceGroupName, registryName, parameters, context).getSyncPoller(); - } - - /** - * Copies an image to this container registry from the specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param parameters The parameters specifying the image to copy and the source container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono importImageAsync( - String resourceGroupName, String registryName, ImportImageParameters parameters) { - return beginImportImageAsync(resourceGroupName, registryName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Copies an image to this container registry from the specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param parameters The parameters specifying the image to copy and the source container registry. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono importImageAsync( - String resourceGroupName, String registryName, ImportImageParameters parameters, Context context) { - return beginImportImageAsync(resourceGroupName, registryName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Copies an image to this container registry from the specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param parameters The parameters specifying the image to copy and the source container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void importImage(String resourceGroupName, String registryName, ImportImageParameters parameters) { - importImageAsync(resourceGroupName, registryName, parameters).block(); - } - - /** - * Copies an image to this container registry from the specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param parameters The parameters specifying the image to copy and the source container registry. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void importImage( - String resourceGroupName, String registryName, ImportImageParameters parameters, Context context) { - importImageAsync(resourceGroupName, registryName, parameters, context).block(); - } - - /** - * Checks whether the container registry name is available for use. The name must contain only alphanumeric - * characters, be globally unique, and between 5 and 50 characters in length. - * - * @param registryNameCheckRequest The object containing information for the availability request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to check the availability of a container registry name along with {@link - * Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> checkNameAvailabilityWithResponseAsync( - RegistryNameCheckRequest registryNameCheckRequest) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (registryNameCheckRequest == null) { - return Mono - .error( - new IllegalArgumentException("Parameter registryNameCheckRequest is required and cannot be null.")); - } else { - registryNameCheckRequest.validate(); - } - final String apiVersion = "2019-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .checkNameAvailability( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - registryNameCheckRequest, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Checks whether the container registry name is available for use. The name must contain only alphanumeric - * characters, be globally unique, and between 5 and 50 characters in length. - * - * @param registryNameCheckRequest The object containing information for the availability request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to check the availability of a container registry name along with {@link - * Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> checkNameAvailabilityWithResponseAsync( - RegistryNameCheckRequest registryNameCheckRequest, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (registryNameCheckRequest == null) { - return Mono - .error( - new IllegalArgumentException("Parameter registryNameCheckRequest is required and cannot be null.")); - } else { - registryNameCheckRequest.validate(); - } - final String apiVersion = "2019-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .checkNameAvailability( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - registryNameCheckRequest, - accept, - context); - } - - /** - * Checks whether the container registry name is available for use. The name must contain only alphanumeric - * characters, be globally unique, and between 5 and 50 characters in length. - * - * @param registryNameCheckRequest The object containing information for the availability request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to check the availability of a container registry name on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono checkNameAvailabilityAsync(RegistryNameCheckRequest registryNameCheckRequest) { - return checkNameAvailabilityWithResponseAsync(registryNameCheckRequest) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Checks whether the container registry name is available for use. The name must contain only alphanumeric - * characters, be globally unique, and between 5 and 50 characters in length. - * - * @param registryNameCheckRequest The object containing information for the availability request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to check the availability of a container registry name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RegistryNameStatusInner checkNameAvailability(RegistryNameCheckRequest registryNameCheckRequest) { - return checkNameAvailabilityAsync(registryNameCheckRequest).block(); - } - - /** - * Checks whether the container registry name is available for use. The name must contain only alphanumeric - * characters, be globally unique, and between 5 and 50 characters in length. - * - * @param registryNameCheckRequest The object containing information for the availability request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to check the availability of a container registry name along with {@link - * Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response checkNameAvailabilityWithResponse( - RegistryNameCheckRequest registryNameCheckRequest, Context context) { - return checkNameAvailabilityWithResponseAsync(registryNameCheckRequest, context).block(); - } - - /** - * Gets the properties of the specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the specified container registry along with {@link Response} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String registryName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (registryName == null) { - return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); - } - final String apiVersion = "2019-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - registryName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the properties of the specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the specified container registry along with {@link Response} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String registryName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (registryName == null) { - return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); - } - final String apiVersion = "2019-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - registryName, - accept, - context); - } - - /** - * Gets the properties of the specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the specified container registry on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync(String resourceGroupName, String registryName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, registryName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets the properties of the specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the specified container registry. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RegistryInner getByResourceGroup(String resourceGroupName, String registryName) { - return getByResourceGroupAsync(resourceGroupName, registryName).block(); - } - - /** - * Gets the properties of the specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the specified container registry along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String registryName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, registryName, context).block(); - } - - /** - * Creates a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param registry The parameters for creating a container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object that represents a container registry along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createWithResponseAsync( - String resourceGroupName, String registryName, RegistryInner registry) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (registryName == null) { - return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); - } - if (registry == null) { - return Mono.error(new IllegalArgumentException("Parameter registry is required and cannot be null.")); - } else { - registry.validate(); - } - final String apiVersion = "2019-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .create( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - registryName, - registry, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param registry The parameters for creating a container registry. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object that represents a container registry along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createWithResponseAsync( - String resourceGroupName, String registryName, RegistryInner registry, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (registryName == null) { - return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); - } - if (registry == null) { - return Mono.error(new IllegalArgumentException("Parameter registry is required and cannot be null.")); - } else { - registry.validate(); - } - final String apiVersion = "2019-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .create( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - registryName, - registry, - accept, - context); - } - - /** - * Creates a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param registry The parameters for creating a container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of an object that represents a container registry. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, RegistryInner> beginCreateAsync( - String resourceGroupName, String registryName, RegistryInner registry) { - Mono>> mono = createWithResponseAsync(resourceGroupName, registryName, registry); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - RegistryInner.class, - RegistryInner.class, - this.client.getContext()); - } - - /** - * Creates a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param registry The parameters for creating a container registry. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of an object that represents a container registry. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, RegistryInner> beginCreateAsync( - String resourceGroupName, String registryName, RegistryInner registry, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createWithResponseAsync(resourceGroupName, registryName, registry, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), RegistryInner.class, RegistryInner.class, context); - } - - /** - * Creates a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param registry The parameters for creating a container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of an object that represents a container registry. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, RegistryInner> beginCreate( - String resourceGroupName, String registryName, RegistryInner registry) { - return beginCreateAsync(resourceGroupName, registryName, registry).getSyncPoller(); - } - - /** - * Creates a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param registry The parameters for creating a container registry. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of an object that represents a container registry. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, RegistryInner> beginCreate( - String resourceGroupName, String registryName, RegistryInner registry, Context context) { - return beginCreateAsync(resourceGroupName, registryName, registry, context).getSyncPoller(); - } - - /** - * Creates a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param registry The parameters for creating a container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object that represents a container registry on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createAsync(String resourceGroupName, String registryName, RegistryInner registry) { - return beginCreateAsync(resourceGroupName, registryName, registry) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param registry The parameters for creating a container registry. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object that represents a container registry on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync( - String resourceGroupName, String registryName, RegistryInner registry, Context context) { - return beginCreateAsync(resourceGroupName, registryName, registry, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param registry The parameters for creating a container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object that represents a container registry. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RegistryInner create(String resourceGroupName, String registryName, RegistryInner registry) { - return createAsync(resourceGroupName, registryName, registry).block(); - } - - /** - * Creates a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param registry The parameters for creating a container registry. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object that represents a container registry. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RegistryInner create( - String resourceGroupName, String registryName, RegistryInner registry, Context context) { - return createAsync(resourceGroupName, registryName, registry, context).block(); - } - - /** - * Deletes a container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync(String resourceGroupName, String registryName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (registryName == null) { - return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); - } - final String apiVersion = "2019-05-01"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - registryName, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String registryName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (registryName == null) { - return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); - } - final String apiVersion = "2019-05-01"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - registryName, - context); - } - - /** - * Deletes a container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String registryName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, registryName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deletes a container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String registryName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(resourceGroupName, registryName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes a container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String registryName) { - return beginDeleteAsync(resourceGroupName, registryName).getSyncPoller(); - } - - /** - * Deletes a container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String registryName, Context context) { - return beginDeleteAsync(resourceGroupName, registryName, context).getSyncPoller(); - } - - /** - * Deletes a container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String registryName) { - return beginDeleteAsync(resourceGroupName, registryName).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String registryName, Context context) { - return beginDeleteAsync(resourceGroupName, registryName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String registryName) { - deleteAsync(resourceGroupName, registryName).block(); - } - - /** - * Deletes a container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String registryName, Context context) { - deleteAsync(resourceGroupName, registryName, context).block(); - } - - /** - * Updates a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param registryUpdateParameters The parameters for updating a container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object that represents a container registry along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateWithResponseAsync( - String resourceGroupName, String registryName, RegistryUpdateParameters registryUpdateParameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (registryName == null) { - return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); - } - if (registryUpdateParameters == null) { - return Mono - .error( - new IllegalArgumentException("Parameter registryUpdateParameters is required and cannot be null.")); - } else { - registryUpdateParameters.validate(); - } - final String apiVersion = "2019-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - registryName, - registryUpdateParameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param registryUpdateParameters The parameters for updating a container registry. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object that represents a container registry along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, - String registryName, - RegistryUpdateParameters registryUpdateParameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (registryName == null) { - return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); - } - if (registryUpdateParameters == null) { - return Mono - .error( - new IllegalArgumentException("Parameter registryUpdateParameters is required and cannot be null.")); - } else { - registryUpdateParameters.validate(); - } - final String apiVersion = "2019-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - registryName, - registryUpdateParameters, - accept, - context); - } - - /** - * Updates a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param registryUpdateParameters The parameters for updating a container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of an object that represents a container registry. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, RegistryInner> beginUpdateAsync( - String resourceGroupName, String registryName, RegistryUpdateParameters registryUpdateParameters) { - Mono>> mono = - updateWithResponseAsync(resourceGroupName, registryName, registryUpdateParameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - RegistryInner.class, - RegistryInner.class, - this.client.getContext()); - } - - /** - * Updates a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param registryUpdateParameters The parameters for updating a container registry. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of an object that represents a container registry. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, RegistryInner> beginUpdateAsync( - String resourceGroupName, - String registryName, - RegistryUpdateParameters registryUpdateParameters, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - updateWithResponseAsync(resourceGroupName, registryName, registryUpdateParameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), RegistryInner.class, RegistryInner.class, context); - } - - /** - * Updates a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param registryUpdateParameters The parameters for updating a container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of an object that represents a container registry. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, RegistryInner> beginUpdate( - String resourceGroupName, String registryName, RegistryUpdateParameters registryUpdateParameters) { - return beginUpdateAsync(resourceGroupName, registryName, registryUpdateParameters).getSyncPoller(); - } - - /** - * Updates a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param registryUpdateParameters The parameters for updating a container registry. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of an object that represents a container registry. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, RegistryInner> beginUpdate( - String resourceGroupName, - String registryName, - RegistryUpdateParameters registryUpdateParameters, - Context context) { - return beginUpdateAsync(resourceGroupName, registryName, registryUpdateParameters, context).getSyncPoller(); - } - - /** - * Updates a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param registryUpdateParameters The parameters for updating a container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object that represents a container registry on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync( - String resourceGroupName, String registryName, RegistryUpdateParameters registryUpdateParameters) { - return beginUpdateAsync(resourceGroupName, registryName, registryUpdateParameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param registryUpdateParameters The parameters for updating a container registry. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object that represents a container registry on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, - String registryName, - RegistryUpdateParameters registryUpdateParameters, - Context context) { - return beginUpdateAsync(resourceGroupName, registryName, registryUpdateParameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param registryUpdateParameters The parameters for updating a container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object that represents a container registry. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RegistryInner update( - String resourceGroupName, String registryName, RegistryUpdateParameters registryUpdateParameters) { - return updateAsync(resourceGroupName, registryName, registryUpdateParameters).block(); - } - - /** - * Updates a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param registryUpdateParameters The parameters for updating a container registry. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object that represents a container registry. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RegistryInner update( - String resourceGroupName, - String registryName, - RegistryUpdateParameters registryUpdateParameters, - Context context) { - return updateAsync(resourceGroupName, registryName, registryUpdateParameters, context).block(); - } - - /** - * Lists all the container registries under the specified resource group. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list container registries along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String apiVersion = "2019-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all the container registries under the specified resource group. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list container registries along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String apiVersion = "2019-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists all the container registries under the specified resource group. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list container registries as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * Lists all the container registries under the specified resource group. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list container registries as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all the container registries under the specified resource group. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list container registries as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * Lists all the container registries under the specified resource group. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list container registries as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * Lists all the container registries under the specified subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list container registries along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all the container registries under the specified subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list container registries along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists all the container registries under the specified subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list container registries as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists all the container registries under the specified subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list container registries as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all the container registries under the specified subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list container registries as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Lists all the container registries under the specified subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list container registries as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Lists the login credentials for the specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the ListCredentials operation along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listCredentialsWithResponseAsync( - String resourceGroupName, String registryName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (registryName == null) { - return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); - } - final String apiVersion = "2019-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listCredentials( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - registryName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists the login credentials for the specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the ListCredentials operation along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listCredentialsWithResponseAsync( - String resourceGroupName, String registryName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (registryName == null) { - return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); - } - final String apiVersion = "2019-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listCredentials( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - registryName, - accept, - context); - } - - /** - * Lists the login credentials for the specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the ListCredentials operation on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listCredentialsAsync( - String resourceGroupName, String registryName) { - return listCredentialsWithResponseAsync(resourceGroupName, registryName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Lists the login credentials for the specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the ListCredentials operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RegistryListCredentialsResultInner listCredentials(String resourceGroupName, String registryName) { - return listCredentialsAsync(resourceGroupName, registryName).block(); - } - - /** - * Lists the login credentials for the specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the ListCredentials operation along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listCredentialsWithResponse( - String resourceGroupName, String registryName, Context context) { - return listCredentialsWithResponseAsync(resourceGroupName, registryName, context).block(); - } - - /** - * Regenerates one of the login credentials for the specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param regenerateCredentialParameters Specifies name of the password which should be regenerated -- password or - * password2. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the ListCredentials operation along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> regenerateCredentialWithResponseAsync( - String resourceGroupName, String registryName, RegenerateCredentialParameters regenerateCredentialParameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (registryName == null) { - return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); - } - if (regenerateCredentialParameters == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter regenerateCredentialParameters is required and cannot be null.")); - } else { - regenerateCredentialParameters.validate(); - } - final String apiVersion = "2019-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .regenerateCredential( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - registryName, - regenerateCredentialParameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Regenerates one of the login credentials for the specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param regenerateCredentialParameters Specifies name of the password which should be regenerated -- password or - * password2. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the ListCredentials operation along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> regenerateCredentialWithResponseAsync( - String resourceGroupName, - String registryName, - RegenerateCredentialParameters regenerateCredentialParameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (registryName == null) { - return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); - } - if (regenerateCredentialParameters == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter regenerateCredentialParameters is required and cannot be null.")); - } else { - regenerateCredentialParameters.validate(); - } - final String apiVersion = "2019-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .regenerateCredential( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - registryName, - regenerateCredentialParameters, - accept, - context); - } - - /** - * Regenerates one of the login credentials for the specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param regenerateCredentialParameters Specifies name of the password which should be regenerated -- password or - * password2. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the ListCredentials operation on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono regenerateCredentialAsync( - String resourceGroupName, String registryName, RegenerateCredentialParameters regenerateCredentialParameters) { - return regenerateCredentialWithResponseAsync(resourceGroupName, registryName, regenerateCredentialParameters) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Regenerates one of the login credentials for the specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param regenerateCredentialParameters Specifies name of the password which should be regenerated -- password or - * password2. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the ListCredentials operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RegistryListCredentialsResultInner regenerateCredential( - String resourceGroupName, String registryName, RegenerateCredentialParameters regenerateCredentialParameters) { - return regenerateCredentialAsync(resourceGroupName, registryName, regenerateCredentialParameters).block(); - } - - /** - * Regenerates one of the login credentials for the specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param regenerateCredentialParameters Specifies name of the password which should be regenerated -- password or - * password2. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the ListCredentials operation along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response regenerateCredentialWithResponse( - String resourceGroupName, - String registryName, - RegenerateCredentialParameters regenerateCredentialParameters, - Context context) { - return regenerateCredentialWithResponseAsync( - resourceGroupName, registryName, regenerateCredentialParameters, context) - .block(); - } - - /** - * Gets the quota usages for the specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the quota usages for the specified container registry along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listUsagesWithResponseAsync( - String resourceGroupName, String registryName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (registryName == null) { - return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); - } - final String apiVersion = "2019-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listUsages( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - registryName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the quota usages for the specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the quota usages for the specified container registry along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listUsagesWithResponseAsync( - String resourceGroupName, String registryName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (registryName == null) { - return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); - } - final String apiVersion = "2019-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listUsages( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - registryName, - accept, - context); - } - - /** - * Gets the quota usages for the specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the quota usages for the specified container registry on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listUsagesAsync(String resourceGroupName, String registryName) { - return listUsagesWithResponseAsync(resourceGroupName, registryName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets the quota usages for the specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the quota usages for the specified container registry. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RegistryUsageListResultInner listUsages(String resourceGroupName, String registryName) { - return listUsagesAsync(resourceGroupName, registryName).block(); - } - - /** - * Gets the quota usages for the specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the quota usages for the specified container registry along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listUsagesWithResponse( - String resourceGroupName, String registryName, Context context) { - return listUsagesWithResponseAsync(resourceGroupName, registryName, context).block(); - } - - /** - * Schedules a new run based on the request parameters and add it to the run queue. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runRequest The parameters of a run that needs to scheduled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return run resource properties along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> scheduleRunWithResponseAsync( - String resourceGroupName, String registryName, RunRequest runRequest) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (registryName == null) { - return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); - } - if (runRequest == null) { - return Mono.error(new IllegalArgumentException("Parameter runRequest is required and cannot be null.")); - } else { - runRequest.validate(); - } - final String apiVersion = "2019-04-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .scheduleRun( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - registryName, - apiVersion, - runRequest, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Schedules a new run based on the request parameters and add it to the run queue. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runRequest The parameters of a run that needs to scheduled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return run resource properties along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> scheduleRunWithResponseAsync( - String resourceGroupName, String registryName, RunRequest runRequest, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (registryName == null) { - return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); - } - if (runRequest == null) { - return Mono.error(new IllegalArgumentException("Parameter runRequest is required and cannot be null.")); - } else { - runRequest.validate(); - } - final String apiVersion = "2019-04-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .scheduleRun( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - registryName, - apiVersion, - runRequest, - accept, - context); - } - - /** - * Schedules a new run based on the request parameters and add it to the run queue. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runRequest The parameters of a run that needs to scheduled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of run resource properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, RunInner> beginScheduleRunAsync( - String resourceGroupName, String registryName, RunRequest runRequest) { - Mono>> mono = - scheduleRunWithResponseAsync(resourceGroupName, registryName, runRequest); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), RunInner.class, RunInner.class, this.client.getContext()); - } - - /** - * Schedules a new run based on the request parameters and add it to the run queue. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runRequest The parameters of a run that needs to scheduled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of run resource properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, RunInner> beginScheduleRunAsync( - String resourceGroupName, String registryName, RunRequest runRequest, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - scheduleRunWithResponseAsync(resourceGroupName, registryName, runRequest, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), RunInner.class, RunInner.class, context); - } - - /** - * Schedules a new run based on the request parameters and add it to the run queue. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runRequest The parameters of a run that needs to scheduled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of run resource properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, RunInner> beginScheduleRun( - String resourceGroupName, String registryName, RunRequest runRequest) { - return beginScheduleRunAsync(resourceGroupName, registryName, runRequest).getSyncPoller(); - } - - /** - * Schedules a new run based on the request parameters and add it to the run queue. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runRequest The parameters of a run that needs to scheduled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of run resource properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, RunInner> beginScheduleRun( - String resourceGroupName, String registryName, RunRequest runRequest, Context context) { - return beginScheduleRunAsync(resourceGroupName, registryName, runRequest, context).getSyncPoller(); - } - - /** - * Schedules a new run based on the request parameters and add it to the run queue. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runRequest The parameters of a run that needs to scheduled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return run resource properties on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono scheduleRunAsync(String resourceGroupName, String registryName, RunRequest runRequest) { - return beginScheduleRunAsync(resourceGroupName, registryName, runRequest) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Schedules a new run based on the request parameters and add it to the run queue. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runRequest The parameters of a run that needs to scheduled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return run resource properties on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono scheduleRunAsync( - String resourceGroupName, String registryName, RunRequest runRequest, Context context) { - return beginScheduleRunAsync(resourceGroupName, registryName, runRequest, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Schedules a new run based on the request parameters and add it to the run queue. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runRequest The parameters of a run that needs to scheduled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return run resource properties. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RunInner scheduleRun(String resourceGroupName, String registryName, RunRequest runRequest) { - return scheduleRunAsync(resourceGroupName, registryName, runRequest).block(); - } - - /** - * Schedules a new run based on the request parameters and add it to the run queue. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runRequest The parameters of a run that needs to scheduled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return run resource properties. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RunInner scheduleRun(String resourceGroupName, String registryName, RunRequest runRequest, Context context) { - return scheduleRunAsync(resourceGroupName, registryName, runRequest, context).block(); - } - - /** - * Get the upload location for the user to be able to upload the source. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the upload location for the user to be able to upload the source along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getBuildSourceUploadUrlWithResponseAsync( - String resourceGroupName, String registryName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (registryName == null) { - return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); - } - final String apiVersion = "2019-04-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getBuildSourceUploadUrl( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - registryName, - apiVersion, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the upload location for the user to be able to upload the source. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the upload location for the user to be able to upload the source along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getBuildSourceUploadUrlWithResponseAsync( - String resourceGroupName, String registryName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (registryName == null) { - return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); - } - final String apiVersion = "2019-04-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getBuildSourceUploadUrl( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - registryName, - apiVersion, - accept, - context); - } - - /** - * Get the upload location for the user to be able to upload the source. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the upload location for the user to be able to upload the source on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getBuildSourceUploadUrlAsync( - String resourceGroupName, String registryName) { - return getBuildSourceUploadUrlWithResponseAsync(resourceGroupName, registryName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get the upload location for the user to be able to upload the source. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the upload location for the user to be able to upload the source. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SourceUploadDefinitionInner getBuildSourceUploadUrl(String resourceGroupName, String registryName) { - return getBuildSourceUploadUrlAsync(resourceGroupName, registryName).block(); - } - - /** - * Get the upload location for the user to be able to upload the source. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the upload location for the user to be able to upload the source along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getBuildSourceUploadUrlWithResponse( - String resourceGroupName, String registryName, Context context) { - return getBuildSourceUploadUrlWithResponseAsync(resourceGroupName, registryName, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list container registries along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list container registries along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list container registries along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list container registries along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistriesImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistriesImpl.java deleted file mode 100644 index f15ecbfdf638..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistriesImpl.java +++ /dev/null @@ -1,195 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.containerregistry.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.CoreUtils; -import com.azure.resourcemanager.containerregistry.ContainerRegistryManager; -import com.azure.resourcemanager.containerregistry.fluent.RegistriesClient; -import com.azure.resourcemanager.containerregistry.fluent.models.RegistryInner; -import com.azure.resourcemanager.containerregistry.fluent.models.RegistryUsageListResultInner; -import com.azure.resourcemanager.containerregistry.models.AccessKeyType; -import com.azure.resourcemanager.containerregistry.models.CheckNameAvailabilityResult; -import com.azure.resourcemanager.containerregistry.models.PasswordName; -import com.azure.resourcemanager.containerregistry.models.RegenerateCredentialParameters; -import com.azure.resourcemanager.containerregistry.models.Registries; -import com.azure.resourcemanager.containerregistry.models.Registry; -import com.azure.resourcemanager.containerregistry.models.RegistryCredentials; -import com.azure.resourcemanager.containerregistry.models.RegistryNameCheckRequest; -import com.azure.resourcemanager.containerregistry.models.RegistryUsage; -import com.azure.resourcemanager.containerregistry.models.SourceUploadDefinition; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.GroupableResourcesImpl; -import com.azure.resourcemanager.resources.fluentcore.utils.PagedConverter; -import com.azure.resourcemanager.storage.StorageManager; -import reactor.core.publisher.Mono; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; - -/** Implementation for Registries. */ -public class RegistriesImpl - extends GroupableResourcesImpl - implements Registries { - private final StorageManager storageManager; - - public RegistriesImpl(final ContainerRegistryManager manager, final StorageManager storageManager) { - super(manager.serviceClient().getRegistries(), manager); - this.storageManager = storageManager; - } - - @Override - public PagedIterable list() { - return new PagedIterable<>(this.listAsync()); - } - - @Override - public PagedFlux listAsync() { - return PagedConverter.mapPage(this - .inner() - .listAsync(), - inner -> new RegistryImpl(inner.name(), inner, this.manager(), this.storageManager)); - } - - @Override - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - if (CoreUtils.isNullOrEmpty(resourceGroupName)) { - return new PagedFlux<>(() -> Mono.error( - new IllegalArgumentException("Parameter 'resourceGroupName' is required and cannot be null."))); - } - return wrapPageAsync(this.inner().listByResourceGroupAsync(resourceGroupName)); - } - - @Override - public PagedIterable listByResourceGroup(String groupName) { - return new PagedIterable<>(this.listByResourceGroupAsync(groupName)); - } - - @Override - protected Mono getInnerAsync(String resourceGroupName, String name) { - return this.inner().getByResourceGroupAsync(resourceGroupName, name); - } - - @Override - public RegistryImpl define(String name) { - return wrapModel(name); - } - - @Override - protected Mono deleteInnerAsync(String groupName, String name) { - return this.inner().deleteAsync(groupName, name); - } - - /************************************************************** - * Fluent model helpers. - **************************************************************/ - - @Override - protected RegistryImpl wrapModel(String name) { - return new RegistryImpl(name, new RegistryInner(), this.manager(), this.storageManager); - } - - @Override - protected RegistryImpl wrapModel(RegistryInner containerServiceInner) { - if (containerServiceInner == null) { - return null; - } - - return new RegistryImpl( - containerServiceInner.name(), containerServiceInner, this.manager(), this.storageManager); - } - - @Override - public RegistryCredentials getCredentials(String resourceGroupName, String registryName) { - return new RegistryCredentialsImpl(this.inner().listCredentials(resourceGroupName, registryName)); - } - - @Override - public Mono getCredentialsAsync(String resourceGroupName, String registryName) { - return this - .inner() - .listCredentialsAsync(resourceGroupName, registryName) - .map(registryListCredentialsResultInner -> new RegistryCredentialsImpl(registryListCredentialsResultInner)); - } - - @Override - public RegistryCredentials regenerateCredential( - String resourceGroupName, String registryName, AccessKeyType accessKeyType) { - return new RegistryCredentialsImpl( - this - .inner() - .regenerateCredential( - resourceGroupName, registryName, - new RegenerateCredentialParameters().withName(PasswordName.fromString(accessKeyType.toString())))); - } - - @Override - public Mono regenerateCredentialAsync( - String resourceGroupName, String registryName, AccessKeyType accessKeyType) { - return this - .inner() - .regenerateCredentialAsync( - resourceGroupName, registryName, - new RegenerateCredentialParameters().withName(PasswordName.fromString(accessKeyType.toString()))) - .map(RegistryCredentialsImpl::new); - } - - @Override - public Collection listQuotaUsages(String resourceGroupName, String registryName) { - RegistryUsageListResultInner resultInner = this.inner().listUsages(resourceGroupName, registryName); - - return Collections - .unmodifiableList( - resultInner != null && resultInner.value() != null - ? resultInner.value() - : new ArrayList<>()); - } - - @Override - public PagedFlux listQuotaUsagesAsync(String resourceGroupName, String registryName) { - return PagedConverter - .convertListToPagedFlux( - this - .inner() - .listUsagesWithResponseAsync(resourceGroupName, registryName) - .map(r -> new SimpleResponse<>( - r.getRequest(), r.getStatusCode(), r.getHeaders(), - r.getValue().value() == null ? Collections.emptyList() : r.getValue().value()))); - } - - @Override - public CheckNameAvailabilityResult checkNameAvailability(String name) { - return new CheckNameAvailabilityResultImpl(this.inner() - .checkNameAvailability(new RegistryNameCheckRequest().withName(name))); - } - - @Override - public Mono checkNameAvailabilityAsync(String name) { - return this - .inner() - .checkNameAvailabilityAsync(new RegistryNameCheckRequest().withName(name)) - .map(registryNameStatusInner -> new CheckNameAvailabilityResultImpl(registryNameStatusInner)); - } - - @Override - public SourceUploadDefinition getBuildSourceUploadUrl(String rgName, String acrName) { - return this.getBuildSourceUploadUrlAsync(rgName, acrName).block(); - } - - @Override - public Mono getBuildSourceUploadUrlAsync(String rgName, String acrName) { - return this - .manager() - .serviceClient() - .getRegistries() - .getBuildSourceUploadUrlAsync(rgName, acrName) - .map(sourceUploadDefinitionInner -> new SourceUploadDefinitionImpl(sourceUploadDefinitionInner)); - } - - public WebhooksClient webhooks() { - return new RegistriesWebhooksClientImpl(this.manager(), null); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistriesWebhooksClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistriesWebhooksClientImpl.java deleted file mode 100644 index 6116377287c0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistriesWebhooksClientImpl.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.containerregistry.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.containerregistry.ContainerRegistryManager; -import com.azure.resourcemanager.containerregistry.fluent.WebhooksClient; -import com.azure.resourcemanager.containerregistry.models.Registries; -import com.azure.resourcemanager.containerregistry.models.Webhook; -import com.azure.resourcemanager.resources.fluentcore.utils.PagedConverter; -import reactor.core.publisher.Mono; - -/** Represents a webhook collection associated with a container registry. */ -public class RegistriesWebhooksClientImpl implements Registries.WebhooksClient { - private final ContainerRegistryManager containerRegistryManager; - private final RegistryImpl containerRegistry; - - RegistriesWebhooksClientImpl(ContainerRegistryManager containerRegistryManager, RegistryImpl containerRegistry) { - this.containerRegistryManager = containerRegistryManager; - this.containerRegistry = containerRegistry; - } - - @Override - public Webhook get(final String resourceGroupName, final String registryName, final String webhookName) { - return this.getAsync(resourceGroupName, registryName, webhookName).block(); - } - - @Override - public Mono getAsync(final String resourceGroupName, final String registryName, final String webhookName) { - final WebhooksClient webhooksInner = this.containerRegistryManager.serviceClient().getWebhooks(); - - return webhooksInner - .getAsync(resourceGroupName, registryName, webhookName) - .map( - webhookInner -> { - if (this.containerRegistry != null) { - return new WebhookImpl( - webhookName, this.containerRegistry, webhookInner, this.containerRegistryManager); - } else { - return new WebhookImpl( - resourceGroupName, registryName, webhookName, webhookInner, this.containerRegistryManager); - } - }) - .flatMap(WebhookImpl::setCallbackConfigAsync); - } - - @Override - public void delete(final String resourceGroupName, final String registryName, final String webhookName) { - this - .containerRegistryManager - .serviceClient() - .getWebhooks() - .delete(resourceGroupName, registryName, webhookName); - } - - @Override - public Mono deleteAsync(final String resourceGroupName, final String registryName, final String webhookName) { - return this - .containerRegistryManager - .serviceClient() - .getWebhooks() - .deleteAsync(resourceGroupName, registryName, webhookName); - } - - @Override - public PagedIterable list(final String resourceGroupName, final String registryName) { - return new PagedIterable<>(this.listAsync(resourceGroupName, registryName)); - } - - @Override - public PagedFlux listAsync(final String resourceGroupName, final String registryName) { - final WebhooksClient webhooksInner = this.containerRegistryManager.serviceClient().getWebhooks(); - - return PagedConverter - .flatMapPage( - PagedConverter - .mapPage( - webhooksInner.listAsync(resourceGroupName, registryName), - inner -> { - if (this.containerRegistry != null) { - return new WebhookImpl( - inner.name(), this.containerRegistry, inner, this.containerRegistryManager); - } else { - return new WebhookImpl( - resourceGroupName, - registryName, - inner.name(), - inner, - this.containerRegistryManager); - } - }), - WebhookImpl::setCallbackConfigAsync); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryCredentialsImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryCredentialsImpl.java deleted file mode 100644 index e8e75d7230a0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryCredentialsImpl.java +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.containerregistry.implementation; - -import com.azure.resourcemanager.containerregistry.models.AccessKeyType; -import com.azure.resourcemanager.containerregistry.models.RegistryCredentials; -import com.azure.resourcemanager.containerregistry.models.RegistryPassword; -import com.azure.resourcemanager.containerregistry.fluent.models.RegistryListCredentialsResultInner; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.WrapperImpl; -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; - -/** Implementation for RegistryCredentials. */ -public class RegistryCredentialsImpl extends WrapperImpl - implements RegistryCredentials { - private Map accessKeys; - - protected RegistryCredentialsImpl(RegistryListCredentialsResultInner innerObject) { - super(innerObject); - - this.accessKeys = new HashMap<>(); - if (this.innerModel().passwords() != null) { - for (RegistryPassword registryPassword : this.innerModel().passwords()) { - switch (registryPassword.name()) { - case PASSWORD: - this.accessKeys.put(AccessKeyType.PRIMARY, registryPassword.value()); - break; - case PASSWORD2: - this.accessKeys.put(AccessKeyType.SECONDARY, registryPassword.value()); - break; - default: - break; - } - } - } - } - - @Override - public Map accessKeys() { - return Collections.unmodifiableMap(this.accessKeys); - } - - @Override - public String username() { - return this.innerModel().username(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryDockerTaskRunRequestImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryDockerTaskRunRequestImpl.java deleted file mode 100644 index fad8ee6e0a0c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryDockerTaskRunRequestImpl.java +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.containerregistry.implementation; - -import com.azure.resourcemanager.containerregistry.models.Argument; -import com.azure.resourcemanager.containerregistry.models.DockerBuildRequest; -import com.azure.resourcemanager.containerregistry.models.OverridingArgument; -import com.azure.resourcemanager.containerregistry.models.PlatformProperties; -import com.azure.resourcemanager.containerregistry.models.RegistryDockerTaskRunRequest; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -class RegistryDockerTaskRunRequestImpl - implements RegistryDockerTaskRunRequest, - RegistryDockerTaskRunRequest.Definition, - HasInnerModel { - - private DockerBuildRequest inner; - private RegistryTaskRunImpl registryTaskRunImpl; - - @Override - public int timeout() { - return ResourceManagerUtils.toPrimitiveInt(this.inner.timeout()); - } - - @Override - public PlatformProperties platform() { - return this.inner.platform(); - } - - @Override - public int cpuCount() { - if (this.inner.agentConfiguration() == null) { - return 0; - } - return ResourceManagerUtils.toPrimitiveInt(this.inner.agentConfiguration().cpu()); - } - - @Override - public String sourceLocation() { - return this.inner.sourceLocation(); - } - - @Override - public boolean isArchiveEnabled() { - return ResourceManagerUtils.toPrimitiveBoolean(this.inner.isArchiveEnabled()); - } - - RegistryDockerTaskRunRequestImpl(RegistryTaskRunImpl registryTaskRunImpl) { - this.inner = new DockerBuildRequest(); - this.registryTaskRunImpl = registryTaskRunImpl; - } - - @Override - public RegistryDockerTaskRunRequestImpl defineDockerTaskStep() { - return this; - } - - @Override - public RegistryDockerTaskRunRequestImpl withDockerFilePath(String path) { - this.inner.withDockerFilePath(path); - return this; - } - - @Override - public RegistryDockerTaskRunRequestImpl withImageNames(List imageNames) { - this.inner.withImageNames(imageNames); - return this; - } - - @Override - public RegistryDockerTaskRunRequestImpl withPushEnabled(boolean enabled) { - this.inner.withIsPushEnabled(enabled); - return this; - } - - @Override - public RegistryDockerTaskRunRequestImpl withCacheEnabled(boolean enabled) { - this.inner.withNoCache(enabled); - return this; - } - - @Override - public RegistryDockerTaskRunRequestImpl withOverridingArguments( - Map overridingArguments) { - if (overridingArguments.size() == 0) { - return this; - } - List overridingArgumentsList = new ArrayList(); - for (Map.Entry entry : overridingArguments.entrySet()) { - Argument argument = new Argument(); - argument.withName(entry.getKey()); - argument.withValue(entry.getValue().value()); - argument.withIsSecret(entry.getValue().isSecret()); - overridingArgumentsList.add(argument); - } - this.inner.withArguments(overridingArgumentsList); - return this; - } - - @Override - public DefinitionStages.DockerTaskRunRequestStepAttachable withOverridingArgument( - String name, OverridingArgument overridingArgument) { - if (this.inner.arguments() == null) { - this.inner.withArguments(new ArrayList()); - } - Argument argument = new Argument(); - argument.withName(name); - argument.withValue(overridingArgument.value()); - argument.withIsSecret(overridingArgument.isSecret()); - this.inner.arguments().add(argument); - return this; - } - - @Override - public RegistryTaskRunImpl attach() { - this.registryTaskRunImpl.withDockerTaskRunRequest(this.inner); - return this.registryTaskRunImpl; - } - - @Override - public DockerBuildRequest innerModel() { - return this.inner; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryDockerTaskStepImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryDockerTaskStepImpl.java deleted file mode 100644 index 11320f4eb890..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryDockerTaskStepImpl.java +++ /dev/null @@ -1,186 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.containerregistry.implementation; - -import com.azure.resourcemanager.containerregistry.models.Argument; -import com.azure.resourcemanager.containerregistry.models.DockerBuildStepUpdateParameters; -import com.azure.resourcemanager.containerregistry.models.DockerTaskStep; -import com.azure.resourcemanager.containerregistry.models.OverridingArgument; -import com.azure.resourcemanager.containerregistry.models.RegistryDockerTaskStep; -import com.azure.resourcemanager.containerregistry.models.RegistryTask; -import com.azure.resourcemanager.containerregistry.models.TaskStepProperties; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Map; - -class RegistryDockerTaskStepImpl extends RegistryTaskStepImpl - implements RegistryDockerTaskStep, - RegistryDockerTaskStep.Definition, - RegistryDockerTaskStep.Update, - HasInnerModel { - - private DockerTaskStep inner; - private DockerBuildStepUpdateParameters dockerTaskStepUpdateParameters; - private RegistryTaskImpl taskImpl; - - RegistryDockerTaskStepImpl(RegistryTaskImpl taskImpl) { - super(taskImpl.innerModel().step()); - this.inner = new DockerTaskStep(); - if (taskImpl.innerModel().step() != null && !(taskImpl.innerModel().step() instanceof DockerTaskStep)) { - throw new IllegalArgumentException( - "Constructor for RegistryDockerTaskStepImpl invoked for class that is not DockerTaskStep"); - } - this.taskImpl = taskImpl; - this.dockerTaskStepUpdateParameters = new DockerBuildStepUpdateParameters(); - } - - @Override - public List imageNames() { - DockerTaskStep dockerTaskStep = dockerTaskStep(); - if (dockerTaskStep.imageNames() == null) { - return Collections.unmodifiableList(new ArrayList()); - } - return Collections.unmodifiableList(dockerTaskStep.imageNames()); - } - - @Override - public boolean isPushEnabled() { - DockerTaskStep dockerTaskStep = dockerTaskStep(); - return ResourceManagerUtils.toPrimitiveBoolean(dockerTaskStep.isPushEnabled()); - } - - @Override - public boolean noCache() { - DockerTaskStep dockerTaskStep = dockerTaskStep(); - return ResourceManagerUtils.toPrimitiveBoolean(dockerTaskStep.noCache()); - } - - @Override - public String dockerFilePath() { - DockerTaskStep dockerTaskStep = dockerTaskStep(); - return dockerTaskStep.dockerFilePath(); - } - - @Override - public List arguments() { - DockerTaskStep dockerTaskStep = dockerTaskStep(); - if (dockerTaskStep.arguments() == null) { - return Collections.unmodifiableList(new ArrayList()); - } - return Collections.unmodifiableList(dockerTaskStep.arguments()); - } - - private DockerTaskStep dockerTaskStep() { - TaskStepProperties step = this.taskImpl.innerModel().step(); - if (step instanceof DockerTaskStep) { - return (DockerTaskStep) step; - } else { - return new DockerTaskStep(); - } - } - - @Override - public RegistryDockerTaskStepImpl withDockerFilePath(String path) { - if (isInCreateMode()) { - this.inner.withDockerFilePath(path); - } else { - this.dockerTaskStepUpdateParameters.withDockerFilePath(path); - } - return this; - } - - @Override - public RegistryDockerTaskStepImpl withImageNames(List imageNames) { - if (isInCreateMode()) { - this.inner.withImageNames(imageNames); - } else { - this.dockerTaskStepUpdateParameters.withImageNames(imageNames); - } - return this; - } - - @Override - public RegistryDockerTaskStepImpl withPushEnabled(boolean enabled) { - if (isInCreateMode()) { - this.inner.withIsPushEnabled(enabled); - } else { - this.dockerTaskStepUpdateParameters.withIsPushEnabled(enabled); - } - return this; - } - - @Override - public RegistryDockerTaskStepImpl withCacheEnabled(boolean enabled) { - if (isInCreateMode()) { - this.inner.withNoCache(!enabled); - } else { - this.dockerTaskStepUpdateParameters.withNoCache(!enabled); - } - return this; - } - - @Override - public RegistryDockerTaskStepImpl withOverridingArguments(Map overridingArguments) { - if (overridingArguments.size() == 0) { - return this; - } - List overridingValuesList = new ArrayList(); - for (Map.Entry entry : overridingArguments.entrySet()) { - Argument value = new Argument(); - value.withName(entry.getKey()); - value.withValue(entry.getValue().value()); - value.withIsSecret(entry.getValue().isSecret()); - overridingValuesList.add(value); - } - if (isInCreateMode()) { - this.inner.withArguments(overridingValuesList); - } else { - this.dockerTaskStepUpdateParameters.withArguments(overridingValuesList); - } - return this; - } - - @Override - public RegistryDockerTaskStepImpl withOverridingArgument(String name, OverridingArgument overridingArgument) { - if (this.inner.arguments() == null) { - this.inner.withArguments(new ArrayList()); - } - Argument value = new Argument(); - value.withName(name); - value.withValue(overridingArgument.value()); - value.withIsSecret(overridingArgument.isSecret()); - if (isInCreateMode()) { - this.inner.arguments().add(value); - } else { - this.dockerTaskStepUpdateParameters.arguments().add(value); - } - return this; - } - - @Override - public RegistryTask.DefinitionStages.SourceTriggerDefinition attach() { - this.taskImpl.withDockerTaskStepCreateParameters(inner); - return this.taskImpl; - } - - @Override - public RegistryTask.Update parent() { - this.taskImpl.withDockerTaskStepUpdateParameters(dockerTaskStepUpdateParameters); - return this.taskImpl; - } - - @Override - public DockerTaskStep innerModel() { - return this.inner; - } - - private boolean isInCreateMode() { - if (this.taskImpl.innerModel().id() == null) { - return true; - } - return false; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryEncodedTaskRunRequestImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryEncodedTaskRunRequestImpl.java deleted file mode 100644 index 2e7ab196b9eb..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryEncodedTaskRunRequestImpl.java +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.containerregistry.implementation; - -import com.azure.resourcemanager.containerregistry.models.EncodedTaskRunRequest; -import com.azure.resourcemanager.containerregistry.models.OverridingValue; -import com.azure.resourcemanager.containerregistry.models.PlatformProperties; -import com.azure.resourcemanager.containerregistry.models.RegistryEncodedTaskRunRequest; -import com.azure.resourcemanager.containerregistry.models.SetValue; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -class RegistryEncodedTaskRunRequestImpl - implements RegistryEncodedTaskRunRequest, - RegistryEncodedTaskRunRequest.Definition, - HasInnerModel { - - private EncodedTaskRunRequest inner; - private RegistryTaskRunImpl registryTaskRunImpl; - - @Override - public int timeout() { - return ResourceManagerUtils.toPrimitiveInt(this.inner.timeout()); - } - - @Override - public PlatformProperties platform() { - return this.inner.platform(); - } - - @Override - public int cpuCount() { - if (this.inner.agentConfiguration() == null) { - return 0; - } - return ResourceManagerUtils.toPrimitiveInt(this.inner.agentConfiguration().cpu()); - } - - @Override - public String sourceLocation() { - return this.inner.sourceLocation(); - } - - @Override - public boolean isArchiveEnabled() { - return ResourceManagerUtils.toPrimitiveBoolean(this.inner.isArchiveEnabled()); - } - - RegistryEncodedTaskRunRequestImpl(RegistryTaskRunImpl registryTaskRunImpl) { - this.inner = new EncodedTaskRunRequest(); - this.registryTaskRunImpl = registryTaskRunImpl; - } - - @Override - public RegistryEncodedTaskRunRequestImpl defineEncodedTaskStep() { - return this; - } - - @Override - public RegistryEncodedTaskRunRequestImpl withBase64EncodedTaskContent(String encodedTaskContent) { - this.inner.withEncodedTaskContent(encodedTaskContent); - return this; - } - - @Override - public RegistryEncodedTaskRunRequestImpl withBase64EncodedValueContent(String encodedValueContent) { - this.inner.withEncodedValuesContent(encodedValueContent); - return this; - } - - @Override - public RegistryEncodedTaskRunRequestImpl withOverridingValues(Map overridingValues) { - if (overridingValues.size() == 0) { - return this; - } - List overridingValuesList = new ArrayList(); - for (Map.Entry entry : overridingValues.entrySet()) { - SetValue value = new SetValue(); - value.withName(entry.getKey()); - value.withValue(entry.getValue().value()); - value.withIsSecret(entry.getValue().isSecret()); - overridingValuesList.add(value); - } - this.inner.withValues(overridingValuesList); - return this; - } - - @Override - public RegistryEncodedTaskRunRequestImpl withOverridingValue(String name, OverridingValue overridingValue) { - if (this.inner.values() == null) { - this.inner.withValues(new ArrayList()); - } - SetValue value = new SetValue(); - value.withName(name); - value.withValue(overridingValue.value()); - value.withIsSecret(overridingValue.isSecret()); - this.inner.values().add(value); - return this; - } - - @Override - public RegistryTaskRunImpl attach() { - this.registryTaskRunImpl.withEncodedTaskRunRequest(this.inner); - return this.registryTaskRunImpl; - } - - @Override - public EncodedTaskRunRequest innerModel() { - return this.inner; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryEncodedTaskStepImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryEncodedTaskStepImpl.java deleted file mode 100644 index 01b63aad4195..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryEncodedTaskStepImpl.java +++ /dev/null @@ -1,151 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.containerregistry.implementation; - -import com.azure.resourcemanager.containerregistry.models.EncodedTaskStep; -import com.azure.resourcemanager.containerregistry.models.EncodedTaskStepUpdateParameters; -import com.azure.resourcemanager.containerregistry.models.OverridingValue; -import com.azure.resourcemanager.containerregistry.models.RegistryEncodedTaskStep; -import com.azure.resourcemanager.containerregistry.models.RegistryTask; -import com.azure.resourcemanager.containerregistry.models.SetValue; -import com.azure.resourcemanager.containerregistry.models.TaskStepProperties; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Map; - -class RegistryEncodedTaskStepImpl extends RegistryTaskStepImpl - implements RegistryEncodedTaskStep, - RegistryEncodedTaskStep.Definition, - RegistryEncodedTaskStep.Update, - HasInnerModel { - - private EncodedTaskStep inner; - private EncodedTaskStepUpdateParameters encodedTaskStepUpdateParameters; - private RegistryTaskImpl taskImpl; - - RegistryEncodedTaskStepImpl(RegistryTaskImpl taskImpl) { - super(taskImpl.innerModel().step()); - this.inner = new EncodedTaskStep(); - if (taskImpl.innerModel().step() != null && !(taskImpl.innerModel().step() instanceof EncodedTaskStep)) { - throw new IllegalArgumentException( - "Constructor for RegistryEncodedTaskStepImpl invoked for class that is not an EncodedTaskStep"); - } - this.taskImpl = taskImpl; - this.encodedTaskStepUpdateParameters = new EncodedTaskStepUpdateParameters(); - } - - @Override - public String encodedTaskContent() { - EncodedTaskStep encodedTaskStep = encodedTaskStep(); - return encodedTaskStep.encodedTaskContent(); - } - - @Override - public String encodedValuesContent() { - EncodedTaskStep encodedTaskStep = encodedTaskStep(); - return encodedTaskStep.encodedValuesContent(); - } - - @Override - public List values() { - EncodedTaskStep encodedTaskStep = encodedTaskStep(); - if (encodedTaskStep.values() == null) { - return Collections.unmodifiableList(new ArrayList()); - } - return Collections.unmodifiableList(encodedTaskStep.values()); - } - - private EncodedTaskStep encodedTaskStep() { - TaskStepProperties step = this.taskImpl.innerModel().step(); - if (step instanceof EncodedTaskStep) { - return (EncodedTaskStep) step; - } else { - return new EncodedTaskStep(); - } - } - - @Override - public RegistryEncodedTaskStepImpl withBase64EncodedTaskContent(String encodedTaskContent) { - if (isInCreateMode()) { - this.inner.withEncodedTaskContent(encodedTaskContent); - } else { - this.encodedTaskStepUpdateParameters.withEncodedTaskContent(encodedTaskContent); - } - return this; - } - - @Override - public RegistryEncodedTaskStepImpl withBase64EncodedValueContent(String encodedValueContent) { - if (isInCreateMode()) { - this.inner.withEncodedValuesContent(encodedValueContent); - } else { - this.encodedTaskStepUpdateParameters.withEncodedValuesContent(encodedValueContent); - } - return this; - } - - @Override - public RegistryEncodedTaskStepImpl withOverridingValues(Map overridingValues) { - if (overridingValues.size() == 0) { - return this; - } - List overridingValuesList = new ArrayList(); - for (Map.Entry entry : overridingValues.entrySet()) { - SetValue value = new SetValue(); - value.withName(entry.getKey()); - value.withValue(entry.getValue().value()); - value.withIsSecret(entry.getValue().isSecret()); - overridingValuesList.add(value); - } - if (isInCreateMode()) { - this.inner.withValues(overridingValuesList); - } else { - this.encodedTaskStepUpdateParameters.withValues(overridingValuesList); - } - return this; - } - - @Override - public RegistryEncodedTaskStepImpl withOverridingValue(String name, OverridingValue overridingValue) { - if (this.inner.values() == null) { - this.inner.withValues(new ArrayList()); - } - SetValue value = new SetValue(); - value.withName(name); - value.withValue(overridingValue.value()); - value.withIsSecret(overridingValue.isSecret()); - if (isInCreateMode()) { - this.inner.values().add(value); - } else { - this.encodedTaskStepUpdateParameters.values().add(value); - } - return this; - } - - @Override - public RegistryTask.DefinitionStages.SourceTriggerDefinition attach() { - this.taskImpl.withEncodedTaskStepCreateParameters(this.inner); - return this.taskImpl; - } - - @Override - public RegistryTask.Update parent() { - this.taskImpl.withEncodedTaskStepUpdateParameters(this.encodedTaskStepUpdateParameters); - return this.taskImpl; - } - - @Override - public EncodedTaskStep innerModel() { - return this.inner; - } - - private boolean isInCreateMode() { - if (this.taskImpl.innerModel().id() == null) { - return true; - } - return false; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryFileTaskRunRequestImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryFileTaskRunRequestImpl.java deleted file mode 100644 index 7ef64ca4f899..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryFileTaskRunRequestImpl.java +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.containerregistry.implementation; - -import com.azure.resourcemanager.containerregistry.models.FileTaskRunRequest; -import com.azure.resourcemanager.containerregistry.models.OverridingValue; -import com.azure.resourcemanager.containerregistry.models.PlatformProperties; -import com.azure.resourcemanager.containerregistry.models.RegistryFileTaskRunRequest; -import com.azure.resourcemanager.containerregistry.models.SetValue; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -class RegistryFileTaskRunRequestImpl - implements RegistryFileTaskRunRequest, RegistryFileTaskRunRequest.Definition, HasInnerModel { - - private FileTaskRunRequest inner; - private RegistryTaskRunImpl registryTaskRunImpl; - - @Override - public int timeout() { - return ResourceManagerUtils.toPrimitiveInt(this.inner.timeout()); - } - - @Override - public PlatformProperties platform() { - return this.inner.platform(); - } - - @Override - public int cpuCount() { - if (this.inner.agentConfiguration() == null) { - return 0; - } - return ResourceManagerUtils.toPrimitiveInt(this.inner.agentConfiguration().cpu()); - } - - @Override - public String sourceLocation() { - return this.inner.sourceLocation(); - } - - @Override - public boolean isArchiveEnabled() { - return ResourceManagerUtils.toPrimitiveBoolean(this.inner.isArchiveEnabled()); - } - - RegistryFileTaskRunRequestImpl(RegistryTaskRunImpl registryTaskRunImpl) { - this.inner = new FileTaskRunRequest(); - this.registryTaskRunImpl = registryTaskRunImpl; - } - - @Override - public RegistryFileTaskRunRequestImpl defineFileTaskStep() { - return this; - } - - @Override - public RegistryFileTaskRunRequestImpl withTaskPath(String taskPath) { - this.inner.withTaskFilePath(taskPath); - return this; - } - - @Override - public RegistryFileTaskRunRequestImpl withValuesPath(String valuesPath) { - this.inner.withValuesFilePath(valuesPath); - return this; - } - - @Override - public RegistryFileTaskRunRequestImpl withOverridingValues(Map overridingValues) { - if (overridingValues.size() == 0) { - return this; - } - List overridingValuesList = new ArrayList(); - for (Map.Entry entry : overridingValues.entrySet()) { - SetValue value = new SetValue(); - value.withName(entry.getKey()); - value.withValue(entry.getValue().value()); - value.withIsSecret(entry.getValue().isSecret()); - overridingValuesList.add(value); - } - this.inner.withValues(overridingValuesList); - return this; - } - - @Override - public RegistryFileTaskRunRequestImpl withOverridingValue(String name, OverridingValue overridingValue) { - if (this.inner.values() == null) { - this.inner.withValues(new ArrayList()); - } - SetValue value = new SetValue(); - value.withName(name); - value.withValue(overridingValue.value()); - value.withIsSecret(overridingValue.isSecret()); - this.inner.values().add(value); - return this; - } - - @Override - public RegistryTaskRunImpl attach() { - this.registryTaskRunImpl.withFileTaskRunRequest(this.inner); - return this.registryTaskRunImpl; - } - - @Override - public FileTaskRunRequest innerModel() { - return this.inner; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryFileTaskStepImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryFileTaskStepImpl.java deleted file mode 100644 index 01a4c6e9487e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryFileTaskStepImpl.java +++ /dev/null @@ -1,151 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.containerregistry.implementation; - -import com.azure.resourcemanager.containerregistry.models.FileTaskStep; -import com.azure.resourcemanager.containerregistry.models.FileTaskStepUpdateParameters; -import com.azure.resourcemanager.containerregistry.models.OverridingValue; -import com.azure.resourcemanager.containerregistry.models.RegistryFileTaskStep; -import com.azure.resourcemanager.containerregistry.models.RegistryTask; -import com.azure.resourcemanager.containerregistry.models.SetValue; -import com.azure.resourcemanager.containerregistry.models.TaskStepProperties; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Map; - -class RegistryFileTaskStepImpl extends RegistryTaskStepImpl - implements RegistryFileTaskStep, - RegistryFileTaskStep.Definition, - RegistryFileTaskStep.Update, - HasInnerModel { - - private FileTaskStep inner; - private FileTaskStepUpdateParameters fileTaskStepUpdateParameters; - private RegistryTaskImpl taskImpl; - - RegistryFileTaskStepImpl(RegistryTaskImpl taskImpl) { - super(taskImpl.innerModel().step()); - this.inner = new FileTaskStep(); - if (taskImpl.innerModel().step() != null && !(taskImpl.innerModel().step() instanceof FileTaskStep)) { - throw new IllegalArgumentException( - "Constructor for RegistryFileTaskStepImpl invoked for class that is not FileTaskStep"); - } - this.taskImpl = taskImpl; - this.fileTaskStepUpdateParameters = new FileTaskStepUpdateParameters(); - } - - @Override - public String taskFilePath() { - FileTaskStep fileTaskStep = fileTaskStep(); - return fileTaskStep.taskFilePath(); - } - - @Override - public String valuesFilePath() { - FileTaskStep fileTaskStep = fileTaskStep(); - return fileTaskStep.valuesFilePath(); - } - - @Override - public List values() { - FileTaskStep fileTaskStep = fileTaskStep(); - if (fileTaskStep.values() == null) { - return Collections.unmodifiableList(new ArrayList()); - } - return Collections.unmodifiableList(fileTaskStep.values()); - } - - private FileTaskStep fileTaskStep() { - TaskStepProperties step = this.taskImpl.innerModel().step(); - if (step instanceof FileTaskStep) { - return (FileTaskStep) step; - } else { - return new FileTaskStep(); - } - } - - @Override - public RegistryFileTaskStepImpl withTaskPath(String path) { - if (isInCreateMode()) { - this.inner.withTaskFilePath(path); - } else { - this.fileTaskStepUpdateParameters.withTaskFilePath(path); - } - return this; - } - - @Override - public RegistryFileTaskStepImpl withValuesPath(String path) { - if (isInCreateMode()) { - this.inner.withValuesFilePath(path); - } else { - this.fileTaskStepUpdateParameters.withValuesFilePath(path); - } - return this; - } - - @Override - public RegistryFileTaskStepImpl withOverridingValues(Map overridingValues) { - if (overridingValues.size() == 0) { - return this; - } - List overridingValuesList = new ArrayList(); - for (Map.Entry entry : overridingValues.entrySet()) { - SetValue value = new SetValue(); - value.withName(entry.getKey()); - value.withValue(entry.getValue().value()); - value.withIsSecret(entry.getValue().isSecret()); - overridingValuesList.add(value); - } - if (isInCreateMode()) { - this.inner.withValues(overridingValuesList); - } else { - this.fileTaskStepUpdateParameters.withValues(overridingValuesList); - } - return this; - } - - @Override - public RegistryFileTaskStepImpl withOverridingValue(String name, OverridingValue overridingValue) { - if (this.inner.values() == null) { - this.inner.withValues(new ArrayList()); - } - SetValue value = new SetValue(); - value.withName(name); - value.withValue(overridingValue.value()); - value.withIsSecret(overridingValue.isSecret()); - if (isInCreateMode()) { - this.inner.values().add(value); - } else { - this.fileTaskStepUpdateParameters.values().add(value); - } - return this; - } - - @Override - public RegistryTask.DefinitionStages.SourceTriggerDefinition attach() { - this.taskImpl.withFileTaskStepCreateParameters(this.inner); - return this.taskImpl; - } - - @Override - public RegistryTask.Update parent() { - this.taskImpl.withFileTaskStepUpdateParameters(this.fileTaskStepUpdateParameters); - return this.taskImpl; - } - - @Override - public FileTaskStep innerModel() { - return this.inner; - } - - private boolean isInCreateMode() { - if (this.taskImpl.innerModel().id() == null) { - return true; - } - return false; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryImpl.java deleted file mode 100644 index 2ab3ad523fe8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryImpl.java +++ /dev/null @@ -1,325 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.containerregistry.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.resourcemanager.containerregistry.ContainerRegistryManager; -import com.azure.resourcemanager.containerregistry.fluent.models.RegistryInner; -import com.azure.resourcemanager.containerregistry.fluent.models.RunInner; -import com.azure.resourcemanager.containerregistry.models.AccessKeyType; -import com.azure.resourcemanager.containerregistry.models.Registry; -import com.azure.resourcemanager.containerregistry.models.RegistryCredentials; -import com.azure.resourcemanager.containerregistry.models.RegistryTaskRun; -import com.azure.resourcemanager.containerregistry.models.RegistryUpdateParameters; -import com.azure.resourcemanager.containerregistry.models.RegistryUsage; -import com.azure.resourcemanager.containerregistry.models.Sku; -import com.azure.resourcemanager.containerregistry.models.SkuName; -import com.azure.resourcemanager.containerregistry.models.SourceUploadDefinition; -import com.azure.resourcemanager.containerregistry.models.StorageAccountProperties; -import com.azure.resourcemanager.containerregistry.models.WebhookOperations; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils; -import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.GroupableResourceImpl; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.storage.StorageManager; -import com.azure.resourcemanager.storage.models.StorageAccount; -import reactor.core.publisher.Mono; - -import java.time.OffsetDateTime; -import java.util.Collection; - -/** Implementation for Registry and its create and update interfaces. */ -public class RegistryImpl extends GroupableResourceImpl - implements Registry, Registry.Definition, Registry.Update { - - private RegistryUpdateParameters updateParameters; - private final StorageManager storageManager; - private String storageAccountId; - private String creatableStorageAccountKey; - private WebhooksImpl webhooks; - // private QueuedBuildOperations queuedBuilds; - // private BuildTaskOperations buildTasks; - - protected RegistryImpl( - String name, RegistryInner innerObject, ContainerRegistryManager manager, final StorageManager storageManager) { - super(name, innerObject, manager); - this.storageManager = storageManager; - - this.storageAccountId = null; - this.webhooks = new WebhooksImpl(this, "Webhook"); - } - - @Override - protected Mono getInnerAsync() { - return this.manager().serviceClient().getRegistries() - .getByResourceGroupAsync(this.resourceGroupName(), this.name()); - } - - @Override - public RegistryImpl update() { - updateParameters = new RegistryUpdateParameters(); - return super.update(); - } - - @Override - public Mono createResourceAsync() { - final RegistryImpl self = this; - if (isInCreateMode()) { - if (self.creatableStorageAccountKey != null) { - StorageAccount storageAccount = self.taskResult(this.creatableStorageAccountKey); - self.innerModel().storageAccount().withId(storageAccount.id()); - } else if (storageAccountId != null) { - self.innerModel().storageAccount().withId(storageAccountId); - } - - return manager() - .serviceClient() - .getRegistries() - .createAsync(self.resourceGroupName(), self.name(), self.innerModel()) - .map(innerToFluentMap(this)); - } else { - updateParameters.withTags(innerModel().tags()); - return manager() - .serviceClient() - .getRegistries() - .updateAsync(self.resourceGroupName(), self.name(), self.updateParameters) - .map(innerToFluentMap(this)); - } - } - - @Override - public Mono afterPostRunAsync(boolean isGroupFaulted) { - this.webhooks.clear(); - return Mono.empty(); - } - - @Override - public Sku sku() { - return this.innerModel().sku(); - } - - @Override - public String loginServerUrl() { - return this.innerModel().loginServer(); - } - - @Override - public OffsetDateTime creationDate() { - return this.innerModel().creationDate(); - } - - @Override - public boolean adminUserEnabled() { - return this.innerModel().adminUserEnabled(); - } - - @Override - public String storageAccountName() { - if (this.innerModel().storageAccount() == null) { - return null; - } - - return ResourceUtils.nameFromResourceId(this.innerModel().storageAccount().id()); - } - - @Override - public String storageAccountId() { - if (this.innerModel().storageAccount() == null) { - return null; - } - - return this.innerModel().storageAccount().id(); - } - - @Override - public RegistryImpl withClassicSku() { - if (this.isInCreateMode()) { - this.innerModel().withSku(new Sku().withName(SkuName.CLASSIC)); - this.innerModel().withStorageAccount(new StorageAccountProperties()); - } - - return this; - } - - @Override - public RegistryImpl withBasicSku() { - return setManagedSku(new Sku().withName(SkuName.BASIC)); - } - - @Override - public RegistryImpl withStandardSku() { - return setManagedSku(new Sku().withName(SkuName.STANDARD)); - } - - @Override - public RegistryImpl withPremiumSku() { - return setManagedSku(new Sku().withName(SkuName.PREMIUM)); - } - - private RegistryImpl setManagedSku(Sku sku) { - if (this.isInCreateMode()) { - this.innerModel().withSku(sku); - this.innerModel().withStorageAccount(null); - } else { - this.updateParameters.withSku(sku); - } - - return this; - } - - @Override - public RegistryImpl withExistingStorageAccount(StorageAccount storageAccount) { - this.storageAccountId = storageAccount.id(); - - return this; - } - - @Override - public RegistryImpl withExistingStorageAccount(String id) { - this.storageAccountId = id; - - return this; - } - - @Override - public RegistryImpl withNewStorageAccount(String storageAccountName) { - this.storageAccountId = null; - - StorageAccount.DefinitionStages.WithGroup definitionWithGroup = - this.storageManager.storageAccounts().define(storageAccountName).withRegion(this.regionName()); - Creatable definitionAfterGroup; - if (this.creatableGroup != null) { - definitionAfterGroup = definitionWithGroup.withNewResourceGroup(this.creatableGroup); - } else { - definitionAfterGroup = definitionWithGroup.withExistingResourceGroup(this.resourceGroupName()); - } - - return withNewStorageAccount(definitionAfterGroup); - } - - @Override - public RegistryImpl withNewStorageAccount(Creatable creatable) { - this.storageAccountId = null; - - if (this.creatableStorageAccountKey == null) { - this.creatableStorageAccountKey = this.addDependency(creatable); - } - return this; - } - - @Override - public RegistryImpl withRegistryNameAsAdminUser() { - if (this.isInCreateMode()) { - this.innerModel().withAdminUserEnabled(true); - } else { - this.updateParameters.withAdminUserEnabled(true); - } - - return this; - } - - @Override - public RegistryImpl withoutRegistryNameAsAdminUser() { - if (this.isInCreateMode()) { - this.innerModel().withAdminUserEnabled(false); - } else { - this.updateParameters.withAdminUserEnabled(false); - } - - return this; - } - - @Override - public RegistryCredentials getCredentials() { - return this.manager().containerRegistries().getCredentials(this.resourceGroupName(), this.name()); - } - - @Override - public Mono getCredentialsAsync() { - return this.manager().containerRegistries().getCredentialsAsync(this.resourceGroupName(), this.name()); - } - - @Override - public RegistryCredentials regenerateCredential(AccessKeyType accessKeyType) { - return this - .manager() - .containerRegistries() - .regenerateCredential(this.resourceGroupName(), this.name(), accessKeyType); - } - - @Override - public Mono regenerateCredentialAsync(AccessKeyType accessKeyType) { - return this - .manager() - .containerRegistries() - .regenerateCredentialAsync(this.resourceGroupName(), this.name(), accessKeyType); - } - - @Override - public Collection listQuotaUsages() { - return this.manager().containerRegistries().listQuotaUsages(this.resourceGroupName(), this.name()); - } - - @Override - public PagedFlux listQuotaUsagesAsync() { - return this.manager().containerRegistries().listQuotaUsagesAsync(this.resourceGroupName(), this.name()); - } - - @Override - public WebhookOperations webhooks() { - return new WebhookOperationsImpl(this); - } - - @Override - public RegistryTaskRun.DefinitionStages.BlankFromRegistry scheduleRun() { - return new RegistryTaskRunImpl(this.manager(), new RunInner()) - .withExistingRegistry(this.resourceGroupName(), this.name()); - } - - // @Override - // public QueuedBuildOperations queuedBuilds() { - // if (this.queuedBuilds == null) { - // this.queuedBuilds = new QueuedBuildOperationsImpl(this); - // } - // return this.queuedBuilds; - // } - - // @Override - // public BuildTaskOperations buildTasks() { - // if (this.buildTasks == null) { - // this.buildTasks = new BuildTaskOperationsImpl(this); - // } - // return this.buildTasks; - // } - - @Override - public SourceUploadDefinition getBuildSourceUploadUrl() { - return this.getBuildSourceUploadUrlAsync().block(); - } - - @Override - public Mono getBuildSourceUploadUrlAsync() { - return this - .manager() - .serviceClient() - .getRegistries() - .getBuildSourceUploadUrlAsync(this.resourceGroupName(), this.name()) - .map(sourceUploadDefinitionInner -> new SourceUploadDefinitionImpl(sourceUploadDefinitionInner)); - } - - @Override - public RegistryImpl withoutWebhook(String name) { - webhooks.withoutWebhook(name); - return this; - } - - @Override - public WebhookImpl updateWebhook(String name) { - return webhooks.updateWebhook(name); - } - - @Override - public WebhookImpl defineWebhook(String name) { - return webhooks.defineWebhook(name); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistrySourceTriggerImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistrySourceTriggerImpl.java deleted file mode 100644 index 71caf0563656..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistrySourceTriggerImpl.java +++ /dev/null @@ -1,276 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.containerregistry.implementation; - -import com.azure.resourcemanager.containerregistry.models.AuthInfo; -import com.azure.resourcemanager.containerregistry.models.AuthInfoUpdateParameters; -import com.azure.resourcemanager.containerregistry.models.RegistrySourceTrigger; -import com.azure.resourcemanager.containerregistry.models.RegistryTask; -import com.azure.resourcemanager.containerregistry.models.SourceControlType; -import com.azure.resourcemanager.containerregistry.models.SourceProperties; -import com.azure.resourcemanager.containerregistry.models.SourceTrigger; -import com.azure.resourcemanager.containerregistry.models.SourceTriggerEvent; -import com.azure.resourcemanager.containerregistry.models.SourceTriggerUpdateParameters; -import com.azure.resourcemanager.containerregistry.models.SourceUpdateParameters; -import com.azure.resourcemanager.containerregistry.models.TokenType; -import com.azure.resourcemanager.containerregistry.models.TriggerStatus; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import java.util.ArrayList; -import java.util.List; - -class RegistrySourceTriggerImpl - implements RegistrySourceTrigger, - RegistrySourceTrigger.Definition, - RegistrySourceTrigger.Update, - RegistrySourceTrigger.UpdateDefinition, - HasInnerModel { - private SourceTrigger inner; - private RegistryTaskImpl registryTaskImpl; - private SourceTriggerUpdateParameters sourceTriggerUpdateParameters; - - RegistrySourceTriggerImpl(String sourceTriggerName, RegistryTaskImpl registryTaskImpl, boolean creation) { - if (creation) { - this.registryTaskImpl = registryTaskImpl; - if (registryTaskImpl.innerModel().id() == null) { - this.inner = new SourceTrigger(); - this.inner.withSourceRepository(new SourceProperties()); - this.inner.withName(sourceTriggerName); - } else { - this.sourceTriggerUpdateParameters = new SourceTriggerUpdateParameters(); - this.sourceTriggerUpdateParameters.withSourceRepository(new SourceUpdateParameters()); - this.sourceTriggerUpdateParameters.withName(sourceTriggerName); - } - } else { - this.registryTaskImpl = registryTaskImpl; - this.inner = new SourceTrigger(); - this.inner.withSourceRepository(new SourceProperties()); - - boolean foundSourceTrigger = false; - for (SourceTriggerUpdateParameters stup - : registryTaskImpl.taskUpdateParameters.trigger().sourceTriggers()) { - if (stup.name().equals(sourceTriggerName)) { - this.sourceTriggerUpdateParameters = stup; - foundSourceTrigger = true; - } - } - - if (!foundSourceTrigger) { - throw new IllegalArgumentException( - "The trigger you are trying to update does not exist. If you are trying to define a new trigger" - + " while updating a task, please use the defineSourceTrigger function instead."); - } - } - } - - @Override - public SourceControlType sourceControlType() { - return this.inner.sourceRepository().sourceControlType(); - } - - @Override - public String sourceControlRepositoryUrl() { - return this.inner.sourceRepository().repositoryUrl(); - } - - @Override - public List sourceTriggerEvents() { - return this.inner.sourceTriggerEvents(); - } - - @Override - public String sourceControlBranch() { - return this.inner.sourceRepository().branch(); - } - - @Override - public TriggerStatus status() { - return this.inner.status(); - } - - @Override - public RegistrySourceTriggerImpl withGithubAsSourceControl() { - if (isInCreateMode()) { - this.inner.sourceRepository().withSourceControlType(SourceControlType.GITHUB); - } else { - this.sourceTriggerUpdateParameters.sourceRepository().withSourceControlType(SourceControlType.GITHUB); - } - return this; - } - - @Override - public RegistrySourceTriggerImpl withAzureDevOpsAsSourceControl() { - if (isInCreateMode()) { - this.inner.sourceRepository().withSourceControlType(SourceControlType.VISUAL_STUDIO_TEAM_SERVICE); - } else { - this - .sourceTriggerUpdateParameters - .sourceRepository() - .withSourceControlType(SourceControlType.VISUAL_STUDIO_TEAM_SERVICE); - } - return this; - } - - @Override - public RegistrySourceTriggerImpl withSourceControl(SourceControlType sourceControl) { - if (isInCreateMode()) { - this.inner.sourceRepository().withSourceControlType(SourceControlType.fromString(sourceControl.toString())); - } else { - this - .sourceTriggerUpdateParameters - .sourceRepository() - .withSourceControlType(SourceControlType.fromString(sourceControl.toString())); - } - return this; - } - - @Override - public RegistrySourceTriggerImpl withSourceControlRepositoryUrl(String sourceControlRepositoryUrl) { - if (isInCreateMode()) { - this.inner.sourceRepository().withRepositoryUrl(sourceControlRepositoryUrl); - } else { - this.sourceTriggerUpdateParameters.sourceRepository().withRepositoryUrl(sourceControlRepositoryUrl); - } - return this; - } - - @Override - public RegistrySourceTriggerImpl withRepositoryBranch(String branch) { - if (isInCreateMode()) { - this.inner.sourceRepository().withBranch(branch); - } else { - this.sourceTriggerUpdateParameters.sourceRepository().withBranch(branch); - } - return this; - } - - @Override - public RegistrySourceTriggerImpl withRepositoryAuthentication(TokenType tokenType, String token) { - if (isInCreateMode()) { - AuthInfo authInfo = new AuthInfo().withTokenType(tokenType).withToken(token); - this.inner.sourceRepository().withSourceControlAuthProperties(authInfo); - } else { - AuthInfoUpdateParameters authInfoUpdateParameters = - new AuthInfoUpdateParameters().withTokenType(tokenType).withToken(token); - this - .sourceTriggerUpdateParameters - .sourceRepository() - .withSourceControlAuthProperties(authInfoUpdateParameters); - } - return this; - } - - @Override - public RegistrySourceTriggerImpl withRepositoryAuthentication( - TokenType tokenType, String token, String refreshToken, String scope, int expiresIn) { - if (isInCreateMode()) { - AuthInfo authInfo = - new AuthInfo() - .withTokenType(tokenType) - .withToken(token) - .withRefreshToken(refreshToken) - .withScope(scope) - .withExpiresIn(expiresIn); - this.inner.sourceRepository().withSourceControlAuthProperties(authInfo); - } else { - AuthInfoUpdateParameters authInfoUpdateParameters = - new AuthInfoUpdateParameters() - .withTokenType(tokenType) - .withToken(token) - .withRefreshToken(refreshToken) - .withScope(scope) - .withExpiresIn(expiresIn); - this - .sourceTriggerUpdateParameters - .sourceRepository() - .withSourceControlAuthProperties(authInfoUpdateParameters); - } - return this; - } - - @Override - public RegistrySourceTriggerImpl withCommitTriggerEvent() { - return this.withTriggerEvent(SourceTriggerEvent.COMMIT); - } - - @Override - public RegistrySourceTriggerImpl withPullTriggerEvent() { - return this.withTriggerEvent(SourceTriggerEvent.PULLREQUEST); - } - - @Override - public RegistrySourceTriggerImpl withTriggerEvent(SourceTriggerEvent sourceTriggerEvent) { - if (this.inner != null) { - if (this.inner.sourceTriggerEvents() == null) { - this.inner.withSourceTriggerEvents(new ArrayList()); - } - List sourceTriggerEvents = this.inner.sourceTriggerEvents(); - if (sourceTriggerEvents.contains(sourceTriggerEvent)) { - return this; - } - sourceTriggerEvents.add(SourceTriggerEvent.fromString(sourceTriggerEvent.toString())); - if (isInCreateMode()) { - this.inner.withSourceTriggerEvents(sourceTriggerEvents); - } else { - this.sourceTriggerUpdateParameters.withSourceTriggerEvents(sourceTriggerEvents); - } - } else { - if (this.sourceTriggerUpdateParameters.sourceTriggerEvents() == null) { - this.sourceTriggerUpdateParameters.withSourceTriggerEvents(new ArrayList()); - } - List sourceTriggerEvents = this.sourceTriggerUpdateParameters.sourceTriggerEvents(); - if (sourceTriggerEvents.contains(sourceTriggerEvent)) { - return this; - } - sourceTriggerEvents.add(SourceTriggerEvent.fromString(sourceTriggerEvent.toString())); - this.sourceTriggerUpdateParameters.withSourceTriggerEvents(sourceTriggerEvents); - } - return this; - } - - @Override - public RegistrySourceTriggerImpl withTriggerStatusEnabled() { - return this.withTriggerStatus(TriggerStatus.ENABLED); - } - - @Override - public RegistrySourceTriggerImpl withTriggerStatusDisabled() { - return this.withTriggerStatus(TriggerStatus.DISABLED); - } - - @Override - public RegistrySourceTriggerImpl withTriggerStatus(TriggerStatus triggerStatus) { - if (isInCreateMode()) { - this.inner.withStatus(TriggerStatus.fromString(triggerStatus.toString())); - } else { - this.sourceTriggerUpdateParameters.withStatus(TriggerStatus.fromString(triggerStatus.toString())); - } - return this; - } - - @Override - public RegistryTaskImpl attach() { - if (isInCreateMode()) { - this.registryTaskImpl.withSourceTriggerCreateParameters(this.inner); - } else { - this.registryTaskImpl.withSourceTriggerUpdateParameters(this.sourceTriggerUpdateParameters); - } - return this.registryTaskImpl; - } - - @Override - public SourceTrigger innerModel() { - return this.inner; - } - - private boolean isInCreateMode() { - if (this.registryTaskImpl.innerModel().id() == null) { - return true; - } - return false; - } - - @Override - public RegistryTask.Update parent() { - return this.registryTaskImpl; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryTaskImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryTaskImpl.java deleted file mode 100644 index 50293bb628d3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryTaskImpl.java +++ /dev/null @@ -1,664 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.containerregistry.implementation; - -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.containerregistry.ContainerRegistryManager; -import com.azure.resourcemanager.containerregistry.fluent.TasksClient; -import com.azure.resourcemanager.containerregistry.fluent.models.TaskInner; -import com.azure.resourcemanager.containerregistry.models.AgentProperties; -import com.azure.resourcemanager.containerregistry.models.Architecture; -import com.azure.resourcemanager.containerregistry.models.BaseImageTrigger; -import com.azure.resourcemanager.containerregistry.models.BaseImageTriggerType; -import com.azure.resourcemanager.containerregistry.models.BaseImageTriggerUpdateParameters; -import com.azure.resourcemanager.containerregistry.models.DockerBuildStepUpdateParameters; -import com.azure.resourcemanager.containerregistry.models.DockerTaskStep; -import com.azure.resourcemanager.containerregistry.models.EncodedTaskStep; -import com.azure.resourcemanager.containerregistry.models.EncodedTaskStepUpdateParameters; -import com.azure.resourcemanager.containerregistry.models.FileTaskStep; -import com.azure.resourcemanager.containerregistry.models.FileTaskStepUpdateParameters; -import com.azure.resourcemanager.containerregistry.models.OS; -import com.azure.resourcemanager.containerregistry.models.PlatformProperties; -import com.azure.resourcemanager.containerregistry.models.PlatformUpdateParameters; -import com.azure.resourcemanager.containerregistry.models.ProvisioningState; -import com.azure.resourcemanager.containerregistry.models.RegistryDockerTaskStep; -import com.azure.resourcemanager.containerregistry.models.RegistryEncodedTaskStep; -import com.azure.resourcemanager.containerregistry.models.RegistryFileTaskStep; -import com.azure.resourcemanager.containerregistry.models.RegistrySourceTrigger; -import com.azure.resourcemanager.containerregistry.models.RegistryTask; -import com.azure.resourcemanager.containerregistry.models.RegistryTaskStep; -import com.azure.resourcemanager.containerregistry.models.SourceProperties; -import com.azure.resourcemanager.containerregistry.models.SourceTrigger; -import com.azure.resourcemanager.containerregistry.models.SourceTriggerUpdateParameters; -import com.azure.resourcemanager.containerregistry.models.SourceUpdateParameters; -import com.azure.resourcemanager.containerregistry.models.TaskStatus; -import com.azure.resourcemanager.containerregistry.models.TaskUpdateParameters; -import com.azure.resourcemanager.containerregistry.models.TriggerProperties; -import com.azure.resourcemanager.containerregistry.models.TriggerStatus; -import com.azure.resourcemanager.containerregistry.models.TriggerUpdateParameters; -import com.azure.resourcemanager.containerregistry.models.Variant; -import com.azure.core.management.Region; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import reactor.core.publisher.Mono; - -import java.time.OffsetDateTime; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.UUID; - -class RegistryTaskImpl implements RegistryTask, RegistryTask.Definition, RegistryTask.Update { - - private final ClientLogger logger = new ClientLogger(getClass()); - private final TasksClient tasksInner; - private final String taskName; - private final String key = UUID.randomUUID().toString(); - private String resourceGroupName; - private String registryName; - private TaskInner inner; - TaskUpdateParameters taskUpdateParameters; - private RegistryTaskStep registryTaskStep; - - @Override - public String id() { - return this.innerModel().id(); - } - - @Override - public String name() { - return this.innerModel().name(); - } - - @Override - public String type() { - return this.innerModel().type(); - } - - @Override - public String regionName() { - return this.innerModel().location(); - } - - @Override - public Region region() { - return Region.fromName(this.regionName()); - } - - @Override - public Map tags() { - return this.innerModel().tags(); - } - - @Override - public String resourceGroupName() { - return ResourceUtils.groupFromResourceId(this.id()); - } - - @Override - public String parentRegistryId() { - return ResourceUtils.parentResourceIdFromResourceId(this.id()); - } - - @Override - public ProvisioningState provisioningState() { - return this.inner.provisioningState(); - } - - @Override - public OffsetDateTime creationDate() { - return this.inner.creationDate(); - } - - @Override - public TaskStatus status() { - return this.inner.status(); - } - - @Override - public TaskInner innerModel() { - return this.inner; - } - - @Override - public String key() { - return this.key; - } - - @Override - public RegistryTaskStep registryTaskStep() { - if (this.registryTaskStep != null) { - return this.registryTaskStep; - } - if (this.inner.step() instanceof FileTaskStep) { - this.registryTaskStep = new RegistryFileTaskStepImpl(this); - } else if (this.inner.step() instanceof EncodedTaskStep) { - this.registryTaskStep = new RegistryEncodedTaskStepImpl(this); - } else if (this.inner.step() instanceof DockerTaskStep) { - this.registryTaskStep = new RegistryDockerTaskStepImpl(this); - } - return this.registryTaskStep; - } - - @Override - public int timeout() { - return ResourceManagerUtils.toPrimitiveInt(this.inner.timeout()); - } - - @Override - public PlatformProperties platform() { - return this.inner.platform(); - } - - @Override - public int cpuCount() { - if (this.inner.agentConfiguration() == null) { - return 0; - } - return ResourceManagerUtils.toPrimitiveInt(this.inner.agentConfiguration().cpu()); - } - - @Override - public TriggerProperties trigger() { - return this.inner.trigger(); - } - - @Override - public Map sourceTriggers() { - Map sourceTriggerMap = new HashMap(); - for (SourceTrigger sourceTrigger : this.inner.trigger().sourceTriggers()) { - sourceTriggerMap - .put(sourceTrigger.name(), new RegistrySourceTriggerImpl(sourceTrigger.name(), this, false)); - } - return sourceTriggerMap; - } - - RegistryTaskImpl(ContainerRegistryManager registryManager, String taskName) { - this.tasksInner = registryManager.serviceClient().getTasks(); - this.taskName = taskName; - this.inner = new TaskInner(); - this.taskUpdateParameters = new TaskUpdateParameters(); - } - - RegistryTaskImpl(ContainerRegistryManager registryManager, TaskInner inner) { - this.tasksInner = registryManager.serviceClient().getTasks(); - this.taskName = inner.name(); - this.inner = inner; - this.resourceGroupName = ResourceUtils.groupFromResourceId(this.inner.id()); - this.registryName = - ResourceUtils.nameFromResourceId(ResourceUtils.parentResourceIdFromResourceId(this.inner.id())); - this.taskUpdateParameters = new TaskUpdateParameters(); - setTaskUpdateParameterTriggers(); - } - - @Override - public DefinitionStages.Location withExistingRegistry(String resourceGroupName, String registryName) { - this.resourceGroupName = resourceGroupName; - this.registryName = registryName; - return this; - } - - @Override - public RegistryFileTaskStep.DefinitionStages.Blank defineFileTaskStep() { - return new RegistryFileTaskStepImpl(this); - } - - @Override - public RegistryEncodedTaskStep.DefinitionStages.Blank defineEncodedTaskStep() { - return new RegistryEncodedTaskStepImpl(this); - } - - @Override - public RegistryDockerTaskStep.DefinitionStages.Blank defineDockerTaskStep() { - return new RegistryDockerTaskStepImpl(this); - } - - @Override - public DefinitionStages.Platform withLocation(String location) { - this.inner.withLocation(location); - return this; - } - - @Override - public DefinitionStages.Platform withLocation(Region location) { - this.inner.withLocation(location.toString()); - return this; - } - - @Override - public RegistryTaskImpl withLinux() { - if (isInCreateMode()) { - if (this.inner.platform() == null) { - this.inner.withPlatform(new PlatformProperties()); - } - this.inner.platform().withOs(OS.LINUX); - } else { - if (this.taskUpdateParameters.platform() == null) { - this.taskUpdateParameters.withPlatform(new PlatformUpdateParameters()); - } - this.taskUpdateParameters.platform().withOs(OS.LINUX); - } - return this; - } - - @Override - public RegistryTaskImpl withWindows() { - if (isInCreateMode()) { - if (this.inner.platform() == null) { - this.inner.withPlatform(new PlatformProperties()); - } - this.inner.platform().withOs(OS.WINDOWS); - } else { - if (this.taskUpdateParameters.platform() == null) { - this.taskUpdateParameters.withPlatform(new PlatformUpdateParameters()); - } - this.taskUpdateParameters.platform().withOs(OS.WINDOWS); - } - return this; - } - - @Override - public RegistryTaskImpl withLinux(Architecture architecture) { - if (isInCreateMode()) { - if (this.inner.platform() == null) { - this.inner.withPlatform(new PlatformProperties()); - } - this.inner.platform().withOs(OS.LINUX).withArchitecture(architecture); - } else { - if (this.taskUpdateParameters.platform() == null) { - this.taskUpdateParameters.withPlatform(new PlatformUpdateParameters()); - } - this.taskUpdateParameters.platform().withOs(OS.LINUX).withArchitecture(architecture); - } - return this; - } - - @Override - public RegistryTaskImpl withWindows(Architecture architecture) { - if (isInCreateMode()) { - if (this.inner.platform() == null) { - this.inner.withPlatform(new PlatformProperties()); - } - this.inner.platform().withOs(OS.WINDOWS).withArchitecture(architecture); - } else { - if (this.taskUpdateParameters.platform() == null) { - this.taskUpdateParameters.withPlatform(new PlatformUpdateParameters()); - } - this.taskUpdateParameters.platform().withOs(OS.WINDOWS).withArchitecture(architecture); - } - return this; - } - - @Override - public RegistryTaskImpl withLinux(Architecture architecture, Variant variant) { - if (isInCreateMode()) { - if (this.inner.platform() == null) { - this.inner.withPlatform(new PlatformProperties()); - } - this.inner.platform().withOs(OS.LINUX).withArchitecture(architecture).withVariant(variant); - } else { - if (this.taskUpdateParameters.platform() == null) { - this.taskUpdateParameters.withPlatform(new PlatformUpdateParameters()); - } - this.taskUpdateParameters.platform().withOs(OS.LINUX).withArchitecture(architecture).withVariant(variant); - } - return this; - } - - @Override - public RegistryTaskImpl withWindows(Architecture architecture, Variant variant) { - if (isInCreateMode()) { - if (this.inner.platform() == null) { - this.inner.withPlatform(new PlatformProperties()); - } - this.inner.platform().withOs(OS.WINDOWS).withArchitecture(architecture).withVariant(variant); - } else { - if (this.taskUpdateParameters.platform() == null) { - this.taskUpdateParameters.withPlatform(new PlatformUpdateParameters()); - } - this.taskUpdateParameters.platform().withOs(OS.WINDOWS).withArchitecture(architecture).withVariant(variant); - } - return this; - } - - @Override - public RegistryTaskImpl withPlatform(PlatformProperties platformProperties) { - this.inner.withPlatform(platformProperties); - return this; - } - - @Override - public RegistryTaskImpl withPlatform(PlatformUpdateParameters platformProperties) { - this.taskUpdateParameters.withPlatform(platformProperties); - return this; - } - - @Override - public RegistrySourceTriggerImpl defineSourceTrigger(String sourceTriggerName) { - if (isInCreateMode()) { - if (this.inner.trigger() == null) { - this.inner.withTrigger(new TriggerProperties()); - } - if (this.inner.trigger().sourceTriggers() == null) { - this.inner.trigger().withSourceTriggers(new ArrayList()); - } - return new RegistrySourceTriggerImpl(sourceTriggerName, this, true); - } else { - this.taskUpdateParameters = new TaskUpdateParameters(); - this.setTaskUpdateParameterTriggers(); - return new RegistrySourceTriggerImpl(sourceTriggerName, this, true); - } - } - - @Override - public DefinitionStages.TaskCreatable withBaseImageTrigger( - String baseImageTriggerName, BaseImageTriggerType baseImageTriggerType) { - if (this.inner.trigger() == null) { - this.inner.withTrigger(new TriggerProperties()); - } - this - .inner - .trigger() - .withBaseImageTrigger( - new BaseImageTrigger().withBaseImageTriggerType(baseImageTriggerType).withName(baseImageTriggerName)); - return this; - } - - @Override - public DefinitionStages.TaskCreatable withBaseImageTrigger( - String baseImageTriggerName, BaseImageTriggerType baseImageTriggerType, TriggerStatus triggerStatus) { - if (this.inner.trigger() == null) { - this.inner.withTrigger(new TriggerProperties()); - } - this - .inner - .trigger() - .withBaseImageTrigger( - new BaseImageTrigger() - .withBaseImageTriggerType(baseImageTriggerType) - .withName(baseImageTriggerName) - .withStatus(triggerStatus)); - return this; - } - - @Override - public RegistryTaskImpl withCpuCount(int count) { - if (isInCreateMode()) { - if (this.inner.agentConfiguration() == null) { - this.inner.withAgentConfiguration(new AgentProperties()); - } - this.inner.agentConfiguration().withCpu(count); - } else { - if (this.taskUpdateParameters.agentConfiguration() == null) { - this.taskUpdateParameters.withAgentConfiguration(new AgentProperties()); - } - this.taskUpdateParameters.agentConfiguration().withCpu(count); - } - return this; - } - - @Override - public RegistryTaskImpl withTimeout(int timeout) { - if (isInCreateMode()) { - this.inner.withTimeout(timeout); - } else { - this.taskUpdateParameters.withTimeout(timeout); - } - return this; - } - - @Override - public RegistryTask create() { - return createAsync().block(); - } - - @Override - public Mono createAsync() { - return createAsync(Context.NONE); - } - - @Override - public RegistryTask create(Context context) { - return createAsync(context).block(); - } - - @Override - public Mono createAsync(Context context) { - final RegistryTaskImpl self = this; - return this - .tasksInner - .createAsync(this.resourceGroupName, this.registryName, this.taskName, this.inner) - .contextWrite(c -> c.putAll(FluxUtil.toReactorContext(context).readOnly())) - .flatMap( - taskInner -> { - self.inner = taskInner; - self.taskUpdateParameters = new TaskUpdateParameters(); - self.setTaskUpdateParameterTriggers(); - return Mono.just(self); - }); - } - - @Override - public RegistryTask refresh() { - return refreshAsync().block(); - } - - @Override - public Mono refreshAsync() { - final RegistryTaskImpl self = this; - return this - .tasksInner - .getAsync(this.resourceGroupName, this.registryName, this.taskName) - .map( - taskInner -> { - self.inner = taskInner; - self.taskUpdateParameters = new TaskUpdateParameters(); - self.setTaskUpdateParameterTriggers(); - return self; - }); - } - - @Override - public RegistryFileTaskStep.Update updateFileTaskStep() { - if (!(this.inner.step() instanceof FileTaskStep)) { - throw logger.logExceptionAsError(new UnsupportedOperationException( - "Calling updateFileTaskStep on a RegistryTask that is of type " - + this.inner.step().getClass().getName() - + ".")); - } - return new RegistryFileTaskStepImpl(this); - } - - @Override - public RegistryEncodedTaskStep.Update updateEncodedTaskStep() { - if (!(this.inner.step() instanceof EncodedTaskStep)) { - throw logger.logExceptionAsError(new UnsupportedOperationException( - "Calling updateEncodedTaskStep on a RegistryTask that is of type " - + this.inner.step().getClass().getName() - + ".")); - } - return new RegistryEncodedTaskStepImpl(this); - } - - @Override - public RegistryDockerTaskStep.Update updateDockerTaskStep() { - if (!(this.inner.step() instanceof DockerTaskStep)) { - throw logger.logExceptionAsError(new UnsupportedOperationException( - "Calling updateDockerTaskStep on a RegistryTask that is of type " - + this.inner.step().getClass().getName() - + ".")); - } - return new RegistryDockerTaskStepImpl(this); - } - - @Override - public RegistrySourceTrigger.Update updateSourceTrigger(String sourceTriggerName) { - return new RegistrySourceTriggerImpl(sourceTriggerName, this, false); - } - - @Override - public Update updateBaseImageTrigger(String baseImageTriggerName, BaseImageTriggerType baseImageTriggerType) { - this - .taskUpdateParameters - .trigger() - .withBaseImageTrigger( - new BaseImageTriggerUpdateParameters() - .withBaseImageTriggerType(baseImageTriggerType) - .withName(baseImageTriggerName)); - return this; - } - - @Override - public Update updateBaseImageTrigger( - String baseImageTriggerName, BaseImageTriggerType baseImageTriggerType, TriggerStatus triggerStatus) { - this - .taskUpdateParameters - .trigger() - .withBaseImageTrigger( - new BaseImageTriggerUpdateParameters() - .withBaseImageTriggerType(baseImageTriggerType) - .withName(baseImageTriggerName) - .withStatus(triggerStatus)); - return this; - } - - @Override - public Update update() { - return this; - } - - @Override - public RegistryTask apply() { - return applyAsync().block(); - } - - @Override - public Mono applyAsync() { - return applyAsync(Context.NONE); - } - - @Override - public RegistryTask apply(Context context) { - return applyAsync(context).block(); - } - - @Override - public Mono applyAsync(Context context) { - final RegistryTaskImpl self = this; - return this - .tasksInner - .updateAsync(this.resourceGroupName, this.registryName, this.taskName, this.taskUpdateParameters) - .contextWrite(c -> c.putAll(FluxUtil.toReactorContext(context).readOnly())) - .map( - taskInner -> { - self.inner = taskInner; - self.taskUpdateParameters = new TaskUpdateParameters(); - self.registryTaskStep = null; - self.taskUpdateParameters = new TaskUpdateParameters(); - self.setTaskUpdateParameterTriggers(); - return self; - }); - } - - private boolean isInCreateMode() { - if (this.innerModel().id() == null) { - return true; - } - return false; - } - - void withFileTaskStepCreateParameters(FileTaskStep fileTaskStep) { - this.inner.withStep(fileTaskStep); - } - - void withFileTaskStepUpdateParameters(FileTaskStepUpdateParameters fileTaskStepUpdateParameters) { - this.taskUpdateParameters.withStep(fileTaskStepUpdateParameters); - } - - void withEncodedTaskStepCreateParameters(EncodedTaskStep encodedTaskStep) { - this.inner.withStep(encodedTaskStep); - } - - void withEncodedTaskStepUpdateParameters(EncodedTaskStepUpdateParameters encodedTaskStepUpdateParameters) { - this.taskUpdateParameters.withStep(encodedTaskStepUpdateParameters); - } - - void withDockerTaskStepCreateParameters(DockerTaskStep dockerTaskStep) { - this.inner.withStep(dockerTaskStep); - } - - void withDockerTaskStepUpdateParameters(DockerBuildStepUpdateParameters dockerTaskStepUpdateParameters) { - this.taskUpdateParameters.withStep(dockerTaskStepUpdateParameters); - } - - void withSourceTriggerCreateParameters(SourceTrigger sourceTrigger) { - List sourceTriggers = this.inner.trigger().sourceTriggers(); - sourceTriggers.add(sourceTrigger); - this.inner.trigger().withSourceTriggers(sourceTriggers); - } - - void withSourceTriggerUpdateParameters(SourceTriggerUpdateParameters sourceTriggerUpdateParameters) { - List sourceTriggerUpdateParametersList = - this.taskUpdateParameters.trigger().sourceTriggers(); - sourceTriggerUpdateParametersList.add(sourceTriggerUpdateParameters); - this.taskUpdateParameters.trigger().withSourceTriggers(sourceTriggerUpdateParametersList); - } - - void setTaskUpdateParameterTriggers() { - if (this.taskUpdateParameters.trigger() == null) { - this.taskUpdateParameters.withTrigger(new TriggerUpdateParameters()); - } - // Clone the source triggers - if (this.inner.trigger() == null) { - return; - } - if (this.inner.trigger().sourceTriggers() != null) { - List sourceTriggerUpdateParameters = - new ArrayList(); - for (SourceTrigger sourceTrigger : this.inner.trigger().sourceTriggers()) { - sourceTriggerUpdateParameters.add(sourceTriggerToSourceTriggerUpdateParameters(sourceTrigger)); - } - this.taskUpdateParameters.trigger().withSourceTriggers(sourceTriggerUpdateParameters); - } - // Clone the base image trigger - if (this.inner.trigger().baseImageTrigger() != null) { - this.taskUpdateParameters.trigger().withBaseImageTrigger(setTaskUpdateParameterBaseImageTrigger()); - } - } - - BaseImageTriggerUpdateParameters setTaskUpdateParameterBaseImageTrigger() { - BaseImageTriggerUpdateParameters baseImageTriggerUpdateParameters = new BaseImageTriggerUpdateParameters(); - baseImageTriggerUpdateParameters.withName(this.inner.trigger().baseImageTrigger().name()); - baseImageTriggerUpdateParameters - .withBaseImageTriggerType(this.inner.trigger().baseImageTrigger().baseImageTriggerType()); - baseImageTriggerUpdateParameters.withStatus(this.inner.trigger().baseImageTrigger().status()); - return baseImageTriggerUpdateParameters; - } - - SourceTriggerUpdateParameters sourceTriggerToSourceTriggerUpdateParameters(SourceTrigger sourceTrigger) { - SourceTriggerUpdateParameters sourceTriggerUpdateParameters = new SourceTriggerUpdateParameters(); - - sourceTriggerUpdateParameters.withName(sourceTrigger.name()); - sourceTriggerUpdateParameters - .withSourceRepository(sourcePropertiesToSourceUpdateParameters(sourceTrigger.sourceRepository())); - sourceTriggerUpdateParameters.withStatus(sourceTrigger.status()); - sourceTriggerUpdateParameters.withSourceTriggerEvents(sourceTrigger.sourceTriggerEvents()); - - return sourceTriggerUpdateParameters; - } - - SourceUpdateParameters sourcePropertiesToSourceUpdateParameters(SourceProperties sourceProperties) { - SourceUpdateParameters sourceUpdateParameters = new SourceUpdateParameters(); - - sourceUpdateParameters.withSourceControlType(sourceProperties.sourceControlType()); - sourceUpdateParameters.withRepositoryUrl(sourceProperties.repositoryUrl()); - sourceUpdateParameters.withBranch(sourceProperties.branch()); - sourceUpdateParameters.withSourceControlAuthProperties(null); - - return sourceUpdateParameters; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryTaskRunImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryTaskRunImpl.java deleted file mode 100644 index 46f1d0611ab4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryTaskRunImpl.java +++ /dev/null @@ -1,370 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.containerregistry.implementation; - -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.containerregistry.ContainerRegistryManager; -import com.azure.resourcemanager.containerregistry.fluent.RegistriesClient; -import com.azure.resourcemanager.containerregistry.fluent.models.RunInner; -import com.azure.resourcemanager.containerregistry.models.AgentProperties; -import com.azure.resourcemanager.containerregistry.models.Architecture; -import com.azure.resourcemanager.containerregistry.models.DockerBuildRequest; -import com.azure.resourcemanager.containerregistry.models.EncodedTaskRunRequest; -import com.azure.resourcemanager.containerregistry.models.FileTaskRunRequest; -import com.azure.resourcemanager.containerregistry.models.OS; -import com.azure.resourcemanager.containerregistry.models.OverridingValue; -import com.azure.resourcemanager.containerregistry.models.PlatformProperties; -import com.azure.resourcemanager.containerregistry.models.ProvisioningState; -import com.azure.resourcemanager.containerregistry.models.RegistryTaskRun; -import com.azure.resourcemanager.containerregistry.models.RunStatus; -import com.azure.resourcemanager.containerregistry.models.RunType; -import com.azure.resourcemanager.containerregistry.models.SetValue; -import com.azure.resourcemanager.containerregistry.models.TaskRunRequest; -import com.azure.resourcemanager.containerregistry.models.Variant; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import reactor.core.publisher.Mono; - -import java.time.OffsetDateTime; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.UUID; - -class RegistryTaskRunImpl implements RegistryTaskRun, RegistryTaskRun.Definition { - - private final ClientLogger logger = new ClientLogger(getClass()); - private final ContainerRegistryManager registryManager; - private final String key = UUID.randomUUID().toString(); - private String resourceGroupName; - private String registryName; - private RunInner inner; - private RegistriesClient registriesInner; - private FileTaskRunRequest fileTaskRunRequest; - private EncodedTaskRunRequest encodedTaskRunRequest; - private DockerBuildRequest dockerTaskRunRequest; - private TaskRunRequest taskRunRequest; - private PlatformProperties platform; - - @Override - public String resourceGroupName() { - return this.resourceGroupName; - } - - @Override - public String registryName() { - return this.registryName; - } - - @Override - public String taskName() { - return this.inner.task(); - } - - @Override - public RunStatus status() { - return this.inner.status(); - } - - @Override - public RunType runType() { - return this.inner.runType(); - } - - @Override - public OffsetDateTime lastUpdatedTime() { - return this.inner.lastUpdatedTime(); - } - - @Override - public OffsetDateTime createTime() { - return this.inner.createTime(); - } - - @Override - public boolean isArchiveEnabled() { - return ResourceManagerUtils.toPrimitiveBoolean(this.inner.isArchiveEnabled()); - } - - @Override - public PlatformProperties platform() { - return this.inner.platform(); - } - - @Override - public int cpu() { - if (this.inner.agentConfiguration() == null) { - return 0; - } - return ResourceManagerUtils.toPrimitiveInt(this.inner.agentConfiguration().cpu()); - } - - @Override - public ProvisioningState provisioningState() { - return this.inner.provisioningState(); - } - - @Override - public String runId() { - return this.inner.runId(); - } - - RegistryTaskRunImpl(ContainerRegistryManager registryManager, RunInner runInner) { - this.registryManager = registryManager; - this.registriesInner = registryManager.serviceClient().getRegistries(); - this.platform = new PlatformProperties(); - this.inner = runInner; - } - - @Override - public RegistryTaskRunImpl withExistingRegistry(String resourceGroupName, String registryName) { - this.resourceGroupName = resourceGroupName; - this.registryName = registryName; - return this; - } - - @Override - public RegistryFileTaskRunRequestImpl withFileTaskRunRequest() { - return new RegistryFileTaskRunRequestImpl(this); - } - - @Override - public RegistryEncodedTaskRunRequestImpl withEncodedTaskRunRequest() { - return new RegistryEncodedTaskRunRequestImpl(this); - } - - @Override - public RegistryDockerTaskRunRequestImpl withDockerTaskRunRequest() { - return new RegistryDockerTaskRunRequestImpl(this); - } - - @Override - public RegistryTaskRunImpl withTaskRunRequest(String taskName) { - this.taskRunRequest = new TaskRunRequest(); - this.taskRunRequest.withTaskName(taskName); - this.inner.withTask(taskName); - return this; - } - - @Override - public RegistryTaskRunImpl withCpuCount(int count) { - if (this.fileTaskRunRequest != null) { - if (this.fileTaskRunRequest.agentConfiguration() == null) { - this.fileTaskRunRequest.withAgentConfiguration(new AgentProperties()); - } - this.fileTaskRunRequest.agentConfiguration().withCpu(count); - } else if (this.encodedTaskRunRequest != null) { - if (this.encodedTaskRunRequest.agentConfiguration() == null) { - this.encodedTaskRunRequest.withAgentConfiguration(new AgentProperties()); - } - this.encodedTaskRunRequest.agentConfiguration().withCpu(count); - } else if (this.dockerTaskRunRequest != null) { - if (this.dockerTaskRunRequest.agentConfiguration() == null) { - this.dockerTaskRunRequest.withAgentConfiguration(new AgentProperties()); - } - this.dockerTaskRunRequest.agentConfiguration().withCpu(count); - } - return this; - } - - @Override - public RegistryTaskRunImpl withSourceLocation(String location) { - if (this.fileTaskRunRequest != null) { - this.fileTaskRunRequest.withSourceLocation(location); - } else if (this.encodedTaskRunRequest != null) { - this.encodedTaskRunRequest.withSourceLocation(location); - } else if (this.dockerTaskRunRequest != null) { - this.dockerTaskRunRequest.withSourceLocation(location); - } - return this; - } - - @Override - public RegistryTaskRunImpl withTimeout(int timeout) { - if (this.fileTaskRunRequest != null) { - this.fileTaskRunRequest.withTimeout(timeout); - } else if (this.encodedTaskRunRequest != null) { - this.encodedTaskRunRequest.withTimeout(timeout); - } else if (this.dockerTaskRunRequest != null) { - this.dockerTaskRunRequest.withTimeout(timeout); - } - return this; - } - - @Override - public RegistryTaskRunImpl withOverridingValues(Map overridingValues) { - if (overridingValues.size() == 0) { - return this; - } - List overridingValuesList = new ArrayList(); - for (Map.Entry entry : overridingValues.entrySet()) { - SetValue value = new SetValue(); - value.withName(entry.getKey()); - value.withValue(entry.getValue().value()); - value.withIsSecret(entry.getValue().isSecret()); - overridingValuesList.add(value); - } - this.taskRunRequest.withValues(overridingValuesList); - return this; - } - - @Override - public RegistryTaskRunImpl withOverridingValue(String name, OverridingValue overridingValue) { - if (this.taskRunRequest.values() == null) { - this.taskRunRequest.withValues(new ArrayList()); - } - SetValue value = new SetValue(); - value.withName(name); - value.withValue(overridingValue.value()); - value.withIsSecret(overridingValue.isSecret()); - this.taskRunRequest.values().add(value); - return this; - } - - @Override - public RegistryTaskRunImpl withArchiveEnabled(boolean enabled) { - if (this.fileTaskRunRequest != null) { - this.fileTaskRunRequest.withIsArchiveEnabled(enabled); - } else if (this.encodedTaskRunRequest != null) { - this.encodedTaskRunRequest.withIsArchiveEnabled(enabled); - } else if (this.dockerTaskRunRequest != null) { - this.dockerTaskRunRequest.withIsArchiveEnabled(enabled); - } else if (this.taskRunRequest != null) { - this.taskRunRequest.withIsArchiveEnabled(enabled); - } - return this; - } - - @Override - public RegistryTaskRunImpl withLinux() { - this.platform.withOs(OS.LINUX); - return this; - } - - @Override - public RegistryTaskRunImpl withWindows() { - this.platform.withOs(OS.WINDOWS); - return this; - } - - @Override - public RegistryTaskRunImpl withLinux(Architecture architecture) { - this.platform.withOs(OS.LINUX).withArchitecture(architecture); - return this; - } - - @Override - public RegistryTaskRunImpl withWindows(Architecture architecture) { - this.platform.withOs(OS.WINDOWS).withArchitecture(architecture); - return this; - } - - @Override - public RegistryTaskRunImpl withLinux(Architecture architecture, Variant variant) { - this.platform.withOs(OS.LINUX).withArchitecture(architecture).withVariant(variant); - return this; - } - - @Override - public RegistryTaskRunImpl withWindows(Architecture architecture, Variant variant) { - this.platform.withOs(OS.WINDOWS).withArchitecture(architecture).withVariant(variant); - return this; - } - - @Override - public RegistryTaskRunImpl withPlatform(PlatformProperties platformProperties) { - this.platform = platformProperties; - return this; - } - - @Override - public RegistryTaskRun execute() { - return executeAsync().block(); - } - - @Override - public Mono executeAsync() { - final RegistryTaskRunImpl self = this; - if (this.fileTaskRunRequest != null) { - return this - .registriesInner - .scheduleRunAsync(this.resourceGroupName, this.registryName, this.fileTaskRunRequest) - .map( - runInner -> { - self.inner = runInner; - return self; - }); - } else if (this.encodedTaskRunRequest != null) { - return this - .registriesInner - .scheduleRunAsync(this.resourceGroupName, this.registryName, this.encodedTaskRunRequest) - .map( - runInner -> { - self.inner = runInner; - return self; - }); - } else if (this.dockerTaskRunRequest != null) { - return this - .registriesInner - .scheduleRunAsync(this.resourceGroupName, this.registryName, this.dockerTaskRunRequest) - .map( - runInner -> { - self.inner = runInner; - return self; - }); - } else if (this.taskRunRequest != null) { - return this - .registriesInner - .scheduleRunAsync(this.resourceGroupName, this.registryName, this.taskRunRequest) - .map( - runInner -> { - self.inner = runInner; - return self; - }); - } - throw logger.logExceptionAsError(new RuntimeException("Unsupported file task run request")); - } - - @Override - public RunInner innerModel() { - return this.inner; - } - - @Override - public String key() { - return this.key; - } - - void withFileTaskRunRequest(FileTaskRunRequest fileTaskRunRequest) { - this.fileTaskRunRequest = fileTaskRunRequest; - this.fileTaskRunRequest.withPlatform(this.platform); - } - - void withEncodedTaskRunRequest(EncodedTaskRunRequest encodedTaskRunRequest) { - this.encodedTaskRunRequest = encodedTaskRunRequest; - this.encodedTaskRunRequest.withPlatform(this.platform); - } - - void withDockerTaskRunRequest(DockerBuildRequest dockerTaskRunRequest) { - this.dockerTaskRunRequest = dockerTaskRunRequest; - this.dockerTaskRunRequest.withPlatform(this.platform); - } - - @Override - public RegistryTaskRun refresh() { - return refreshAsync().block(); - } - - @Override - public Mono refreshAsync() { - final RegistryTaskRunImpl self = this; - return registryManager - .serviceClient() - .getRuns() - .getAsync(this.resourceGroupName, this.registryName, this.inner.runId()) - .map( - runInner -> { - self.inner = runInner; - return self; - }); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryTaskRunsImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryTaskRunsImpl.java deleted file mode 100644 index 9859834b6c66..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryTaskRunsImpl.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.containerregistry.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.containerregistry.ContainerRegistryManager; -import com.azure.resourcemanager.containerregistry.models.RegistryTaskRun; -import com.azure.resourcemanager.containerregistry.models.RegistryTaskRuns; -import com.azure.resourcemanager.containerregistry.fluent.models.RunInner; -import reactor.core.publisher.Mono; -import com.azure.resourcemanager.resources.fluentcore.utils.PagedConverter; - -public class RegistryTaskRunsImpl implements RegistryTaskRuns { - - private ContainerRegistryManager registryManager; - - public RegistryTaskRunsImpl(ContainerRegistryManager registryManager) { - this.registryManager = registryManager; - } - - @Override - public RegistryTaskRun.DefinitionStages.BlankFromRuns scheduleRun() { - return new RegistryTaskRunImpl(registryManager, new RunInner()); - } - - @Override - public PagedFlux listByRegistryAsync(String rgName, String acrName) { - return PagedConverter.mapPage(this.registryManager.serviceClient().getRuns().listAsync(rgName, acrName), - inner -> wrapModel(inner)); - } - - @Override - public PagedIterable listByRegistry(String rgName, String acrName) { - return new PagedIterable<>(this.listByRegistryAsync(rgName, acrName)); - } - - @Override - public Mono getLogSasUrlAsync(String rgName, String acrName, String runId) { - return this - .registryManager - .serviceClient() - .getRuns() - .getLogSasUrlAsync(rgName, acrName, runId) - .map(runGetLogResultInner -> runGetLogResultInner.logLink()); - } - - @Override - public String getLogSasUrl(String rgName, String acrName, String runId) { - return this.getLogSasUrlAsync(rgName, acrName, runId).block(); - } - - @Override - public Mono cancelAsync(String rgName, String acrName, String runId) { - return this.registryManager.serviceClient().getRuns().cancelAsync(rgName, acrName, runId); - } - - @Override - public void cancel(String rgName, String acrName, String runId) { - this.cancelAsync(rgName, acrName, runId).block(); - } - - private RegistryTaskRunImpl wrapModel(RunInner innerModel) { - return new RegistryTaskRunImpl(registryManager, innerModel); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryTaskStepImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryTaskStepImpl.java deleted file mode 100644 index 207e7ee3b060..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryTaskStepImpl.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.containerregistry.implementation; - -import com.azure.resourcemanager.containerregistry.models.BaseImageDependency; -import com.azure.resourcemanager.containerregistry.models.RegistryTaskStep; -import com.azure.resourcemanager.containerregistry.models.TaskStepProperties; -import java.util.List; - -abstract class RegistryTaskStepImpl implements RegistryTaskStep { - private final TaskStepProperties taskStepProperties; - - RegistryTaskStepImpl(TaskStepProperties taskStepProperties) { - this.taskStepProperties = taskStepProperties; - } - - @Override - public List baseImageDependencies() { - return taskStepProperties.baseImageDependencies(); - } - - @Override - public String contextPath() { - return taskStepProperties.contextPath(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryTasksImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryTasksImpl.java deleted file mode 100644 index 2b5127f21f6d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryTasksImpl.java +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.containerregistry.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.containerregistry.ContainerRegistryManager; -import com.azure.resourcemanager.containerregistry.fluent.TasksClient; -import com.azure.resourcemanager.containerregistry.fluent.models.TaskInner; -import com.azure.resourcemanager.containerregistry.models.RegistryTask; -import com.azure.resourcemanager.containerregistry.models.RegistryTasks; -import reactor.core.publisher.Mono; -import com.azure.resourcemanager.resources.fluentcore.utils.PagedConverter; - -public class RegistryTasksImpl implements RegistryTasks { - - private final ContainerRegistryManager registryManager; - - public RegistryTasksImpl(ContainerRegistryManager registryManager) { - this.registryManager = registryManager; - } - - @Override - public RegistryTask.DefinitionStages.Blank define(String name) { - return new RegistryTaskImpl(this.registryManager, name); - } - - @Override - public PagedFlux listByRegistryAsync(String resourceGroupName, String registryName) { - return PagedConverter.mapPage(this - .registryManager - .serviceClient() - .getTasks() - .listAsync(resourceGroupName, registryName), - inner -> wrapModel(inner)); - } - - @Override - public PagedIterable listByRegistry(String resourceGroupName, String registryName) { - return new PagedIterable<>(this.listByRegistryAsync(resourceGroupName, registryName)); - } - - @Override - public Mono getByRegistryAsync( - String resourceGroupName, String registryName, String taskName, boolean includeSecrets) { - if (includeSecrets) { - return this - .registryManager - .serviceClient() - .getTasks() - .getDetailsAsync(resourceGroupName, registryName, taskName) - .map(taskInner -> new RegistryTaskImpl(registryManager, taskInner)); - } else { - return this - .registryManager - .serviceClient() - .getTasks() - .getAsync(resourceGroupName, registryName, taskName) - .map(taskInner -> new RegistryTaskImpl(registryManager, taskInner)); - } - } - - @Override - public RegistryTask getByRegistry( - String resourceGroupName, String registryName, String taskName, boolean includeSecrets) { - return this.getByRegistryAsync(resourceGroupName, registryName, taskName, includeSecrets).block(); - } - - @Override - public Mono deleteByRegistryAsync(String resourceGroupName, String registryName, String taskName) { - return this.registryManager.serviceClient().getTasks().deleteAsync(resourceGroupName, registryName, taskName); - } - - @Override - public void deleteByRegistry(String resourceGroupName, String registryName, String taskName) { - this.deleteByRegistryAsync(resourceGroupName, registryName, taskName).block(); - } - - private RegistryTaskImpl wrapModel(TaskInner innerModel) { - return new RegistryTaskImpl(this.registryManager, innerModel); - } - - public TasksClient inner() { - return this.registryManager.serviceClient().getTasks(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/ReplicationsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/ReplicationsClientImpl.java deleted file mode 100644 index 20194d7b5c17..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/ReplicationsClientImpl.java +++ /dev/null @@ -1,1481 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.containerregistry.fluent.ReplicationsClient; -import com.azure.resourcemanager.containerregistry.fluent.models.ReplicationInner; -import com.azure.resourcemanager.containerregistry.models.ReplicationListResult; -import com.azure.resourcemanager.containerregistry.models.ReplicationUpdateParameters; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ReplicationsClient. */ -public final class ReplicationsClientImpl implements ReplicationsClient { - /** The proxy service used to perform REST calls. */ - private final ReplicationsService service; - - /** The service client containing this operation class. */ - private final ContainerRegistryManagementClientImpl client; - - /** - * Initializes an instance of ReplicationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ReplicationsClientImpl(ContainerRegistryManagementClientImpl client) { - this.service = - RestProxy.create(ReplicationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for ContainerRegistryManagementClientReplications to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "ContainerRegistryMan") - private interface ReplicationsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" - + "/registries/{registryName}/replications/{replicationName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("registryName") String registryName, - @PathParam("replicationName") String replicationName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" - + "/registries/{registryName}/replications/{replicationName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> create( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("registryName") String registryName, - @PathParam("replicationName") String replicationName, - @BodyParam("application/json") ReplicationInner replication, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" - + "/registries/{registryName}/replications/{replicationName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("registryName") String registryName, - @PathParam("replicationName") String replicationName, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" - + "/registries/{registryName}/replications/{replicationName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("registryName") String registryName, - @PathParam("replicationName") String replicationName, - @BodyParam("application/json") ReplicationUpdateParameters replicationUpdateParameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" - + "/registries/{registryName}/replications") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("registryName") String registryName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets the properties of the specified replication. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param replicationName The name of the replication. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the specified replication along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String resourceGroupName, String registryName, String replicationName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (registryName == null) { - return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); - } - if (replicationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter replicationName is required and cannot be null.")); - } - final String apiVersion = "2019-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - registryName, - replicationName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the properties of the specified replication. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param replicationName The name of the replication. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the specified replication along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String registryName, String replicationName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (registryName == null) { - return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); - } - if (replicationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter replicationName is required and cannot be null.")); - } - final String apiVersion = "2019-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - registryName, - replicationName, - accept, - context); - } - - /** - * Gets the properties of the specified replication. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param replicationName The name of the replication. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the specified replication on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync(String resourceGroupName, String registryName, String replicationName) { - return getWithResponseAsync(resourceGroupName, registryName, replicationName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets the properties of the specified replication. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param replicationName The name of the replication. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the specified replication. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ReplicationInner get(String resourceGroupName, String registryName, String replicationName) { - return getAsync(resourceGroupName, registryName, replicationName).block(); - } - - /** - * Gets the properties of the specified replication. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param replicationName The name of the replication. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the specified replication along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String registryName, String replicationName, Context context) { - return getWithResponseAsync(resourceGroupName, registryName, replicationName, context).block(); - } - - /** - * Creates a replication for a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param replicationName The name of the replication. - * @param replication The parameters for creating a replication. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object that represents a replication for a container registry along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createWithResponseAsync( - String resourceGroupName, String registryName, String replicationName, ReplicationInner replication) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (registryName == null) { - return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); - } - if (replicationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter replicationName is required and cannot be null.")); - } - if (replication == null) { - return Mono.error(new IllegalArgumentException("Parameter replication is required and cannot be null.")); - } else { - replication.validate(); - } - final String apiVersion = "2019-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .create( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - registryName, - replicationName, - replication, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates a replication for a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param replicationName The name of the replication. - * @param replication The parameters for creating a replication. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object that represents a replication for a container registry along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createWithResponseAsync( - String resourceGroupName, - String registryName, - String replicationName, - ReplicationInner replication, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (registryName == null) { - return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); - } - if (replicationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter replicationName is required and cannot be null.")); - } - if (replication == null) { - return Mono.error(new IllegalArgumentException("Parameter replication is required and cannot be null.")); - } else { - replication.validate(); - } - final String apiVersion = "2019-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .create( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - registryName, - replicationName, - replication, - accept, - context); - } - - /** - * Creates a replication for a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param replicationName The name of the replication. - * @param replication The parameters for creating a replication. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of an object that represents a replication for a container registry. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, ReplicationInner> beginCreateAsync( - String resourceGroupName, String registryName, String replicationName, ReplicationInner replication) { - Mono>> mono = - createWithResponseAsync(resourceGroupName, registryName, replicationName, replication); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ReplicationInner.class, - ReplicationInner.class, - this.client.getContext()); - } - - /** - * Creates a replication for a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param replicationName The name of the replication. - * @param replication The parameters for creating a replication. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of an object that represents a replication for a container registry. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ReplicationInner> beginCreateAsync( - String resourceGroupName, - String registryName, - String replicationName, - ReplicationInner replication, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createWithResponseAsync(resourceGroupName, registryName, replicationName, replication, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), ReplicationInner.class, ReplicationInner.class, context); - } - - /** - * Creates a replication for a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param replicationName The name of the replication. - * @param replication The parameters for creating a replication. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of an object that represents a replication for a container registry. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ReplicationInner> beginCreate( - String resourceGroupName, String registryName, String replicationName, ReplicationInner replication) { - return beginCreateAsync(resourceGroupName, registryName, replicationName, replication).getSyncPoller(); - } - - /** - * Creates a replication for a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param replicationName The name of the replication. - * @param replication The parameters for creating a replication. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of an object that represents a replication for a container registry. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ReplicationInner> beginCreate( - String resourceGroupName, - String registryName, - String replicationName, - ReplicationInner replication, - Context context) { - return beginCreateAsync(resourceGroupName, registryName, replicationName, replication, context).getSyncPoller(); - } - - /** - * Creates a replication for a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param replicationName The name of the replication. - * @param replication The parameters for creating a replication. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object that represents a replication for a container registry on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createAsync( - String resourceGroupName, String registryName, String replicationName, ReplicationInner replication) { - return beginCreateAsync(resourceGroupName, registryName, replicationName, replication) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates a replication for a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param replicationName The name of the replication. - * @param replication The parameters for creating a replication. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object that represents a replication for a container registry on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync( - String resourceGroupName, - String registryName, - String replicationName, - ReplicationInner replication, - Context context) { - return beginCreateAsync(resourceGroupName, registryName, replicationName, replication, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates a replication for a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param replicationName The name of the replication. - * @param replication The parameters for creating a replication. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object that represents a replication for a container registry. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ReplicationInner create( - String resourceGroupName, String registryName, String replicationName, ReplicationInner replication) { - return createAsync(resourceGroupName, registryName, replicationName, replication).block(); - } - - /** - * Creates a replication for a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param replicationName The name of the replication. - * @param replication The parameters for creating a replication. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object that represents a replication for a container registry. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ReplicationInner create( - String resourceGroupName, - String registryName, - String replicationName, - ReplicationInner replication, - Context context) { - return createAsync(resourceGroupName, registryName, replicationName, replication, context).block(); - } - - /** - * Deletes a replication from a container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param replicationName The name of the replication. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync( - String resourceGroupName, String registryName, String replicationName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (registryName == null) { - return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); - } - if (replicationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter replicationName is required and cannot be null.")); - } - final String apiVersion = "2019-05-01"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - registryName, - replicationName, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a replication from a container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param replicationName The name of the replication. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String registryName, String replicationName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (registryName == null) { - return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); - } - if (replicationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter replicationName is required and cannot be null.")); - } - final String apiVersion = "2019-05-01"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - registryName, - replicationName, - context); - } - - /** - * Deletes a replication from a container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param replicationName The name of the replication. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String registryName, String replicationName) { - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, registryName, replicationName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deletes a replication from a container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param replicationName The name of the replication. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String registryName, String replicationName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, registryName, replicationName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes a replication from a container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param replicationName The name of the replication. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String registryName, String replicationName) { - return beginDeleteAsync(resourceGroupName, registryName, replicationName).getSyncPoller(); - } - - /** - * Deletes a replication from a container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param replicationName The name of the replication. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String registryName, String replicationName, Context context) { - return beginDeleteAsync(resourceGroupName, registryName, replicationName, context).getSyncPoller(); - } - - /** - * Deletes a replication from a container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param replicationName The name of the replication. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String registryName, String replicationName) { - return beginDeleteAsync(resourceGroupName, registryName, replicationName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a replication from a container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param replicationName The name of the replication. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync( - String resourceGroupName, String registryName, String replicationName, Context context) { - return beginDeleteAsync(resourceGroupName, registryName, replicationName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a replication from a container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param replicationName The name of the replication. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String registryName, String replicationName) { - deleteAsync(resourceGroupName, registryName, replicationName).block(); - } - - /** - * Deletes a replication from a container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param replicationName The name of the replication. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String registryName, String replicationName, Context context) { - deleteAsync(resourceGroupName, registryName, replicationName, context).block(); - } - - /** - * Updates a replication for a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param replicationName The name of the replication. - * @param replicationUpdateParameters The parameters for updating a replication. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object that represents a replication for a container registry along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateWithResponseAsync( - String resourceGroupName, - String registryName, - String replicationName, - ReplicationUpdateParameters replicationUpdateParameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (registryName == null) { - return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); - } - if (replicationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter replicationName is required and cannot be null.")); - } - if (replicationUpdateParameters == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter replicationUpdateParameters is required and cannot be null.")); - } else { - replicationUpdateParameters.validate(); - } - final String apiVersion = "2019-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - registryName, - replicationName, - replicationUpdateParameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates a replication for a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param replicationName The name of the replication. - * @param replicationUpdateParameters The parameters for updating a replication. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object that represents a replication for a container registry along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, - String registryName, - String replicationName, - ReplicationUpdateParameters replicationUpdateParameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (registryName == null) { - return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); - } - if (replicationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter replicationName is required and cannot be null.")); - } - if (replicationUpdateParameters == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter replicationUpdateParameters is required and cannot be null.")); - } else { - replicationUpdateParameters.validate(); - } - final String apiVersion = "2019-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - registryName, - replicationName, - replicationUpdateParameters, - accept, - context); - } - - /** - * Updates a replication for a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param replicationName The name of the replication. - * @param replicationUpdateParameters The parameters for updating a replication. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of an object that represents a replication for a container registry. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, ReplicationInner> beginUpdateAsync( - String resourceGroupName, - String registryName, - String replicationName, - ReplicationUpdateParameters replicationUpdateParameters) { - Mono>> mono = - updateWithResponseAsync(resourceGroupName, registryName, replicationName, replicationUpdateParameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ReplicationInner.class, - ReplicationInner.class, - this.client.getContext()); - } - - /** - * Updates a replication for a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param replicationName The name of the replication. - * @param replicationUpdateParameters The parameters for updating a replication. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of an object that represents a replication for a container registry. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ReplicationInner> beginUpdateAsync( - String resourceGroupName, - String registryName, - String replicationName, - ReplicationUpdateParameters replicationUpdateParameters, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - updateWithResponseAsync( - resourceGroupName, registryName, replicationName, replicationUpdateParameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), ReplicationInner.class, ReplicationInner.class, context); - } - - /** - * Updates a replication for a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param replicationName The name of the replication. - * @param replicationUpdateParameters The parameters for updating a replication. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of an object that represents a replication for a container registry. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ReplicationInner> beginUpdate( - String resourceGroupName, - String registryName, - String replicationName, - ReplicationUpdateParameters replicationUpdateParameters) { - return beginUpdateAsync(resourceGroupName, registryName, replicationName, replicationUpdateParameters) - .getSyncPoller(); - } - - /** - * Updates a replication for a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param replicationName The name of the replication. - * @param replicationUpdateParameters The parameters for updating a replication. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of an object that represents a replication for a container registry. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ReplicationInner> beginUpdate( - String resourceGroupName, - String registryName, - String replicationName, - ReplicationUpdateParameters replicationUpdateParameters, - Context context) { - return beginUpdateAsync(resourceGroupName, registryName, replicationName, replicationUpdateParameters, context) - .getSyncPoller(); - } - - /** - * Updates a replication for a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param replicationName The name of the replication. - * @param replicationUpdateParameters The parameters for updating a replication. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object that represents a replication for a container registry on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync( - String resourceGroupName, - String registryName, - String replicationName, - ReplicationUpdateParameters replicationUpdateParameters) { - return beginUpdateAsync(resourceGroupName, registryName, replicationName, replicationUpdateParameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates a replication for a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param replicationName The name of the replication. - * @param replicationUpdateParameters The parameters for updating a replication. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object that represents a replication for a container registry on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, - String registryName, - String replicationName, - ReplicationUpdateParameters replicationUpdateParameters, - Context context) { - return beginUpdateAsync(resourceGroupName, registryName, replicationName, replicationUpdateParameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates a replication for a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param replicationName The name of the replication. - * @param replicationUpdateParameters The parameters for updating a replication. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object that represents a replication for a container registry. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ReplicationInner update( - String resourceGroupName, - String registryName, - String replicationName, - ReplicationUpdateParameters replicationUpdateParameters) { - return updateAsync(resourceGroupName, registryName, replicationName, replicationUpdateParameters).block(); - } - - /** - * Updates a replication for a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param replicationName The name of the replication. - * @param replicationUpdateParameters The parameters for updating a replication. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object that represents a replication for a container registry. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ReplicationInner update( - String resourceGroupName, - String registryName, - String replicationName, - ReplicationUpdateParameters replicationUpdateParameters, - Context context) { - return updateAsync(resourceGroupName, registryName, replicationName, replicationUpdateParameters, context) - .block(); - } - - /** - * Lists all the replications for the specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list replications for a container registry along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String registryName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (registryName == null) { - return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); - } - final String apiVersion = "2019-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - registryName, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all the replications for the specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list replications for a container registry along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String registryName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (registryName == null) { - return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); - } - final String apiVersion = "2019-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - registryName, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists all the replications for the specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list replications for a container registry as paginated response with {@link - * PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String resourceGroupName, String registryName) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, registryName), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists all the replications for the specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list replications for a container registry as paginated response with {@link - * PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String registryName, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, registryName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all the replications for the specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list replications for a container registry as paginated response with {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String registryName) { - return new PagedIterable<>(listAsync(resourceGroupName, registryName)); - } - - /** - * Lists all the replications for the specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list replications for a container registry as paginated response with {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String registryName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, registryName, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list replications for a container registry along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list replications for a container registry along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RunsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RunsClientImpl.java deleted file mode 100644 index d74e385d3e1a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RunsClientImpl.java +++ /dev/null @@ -1,1320 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.containerregistry.fluent.RunsClient; -import com.azure.resourcemanager.containerregistry.fluent.models.RunGetLogResultInner; -import com.azure.resourcemanager.containerregistry.fluent.models.RunInner; -import com.azure.resourcemanager.containerregistry.models.RunListResult; -import com.azure.resourcemanager.containerregistry.models.RunUpdateParameters; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in RunsClient. */ -public final class RunsClientImpl implements RunsClient { - /** The proxy service used to perform REST calls. */ - private final RunsService service; - - /** The service client containing this operation class. */ - private final ContainerRegistryManagementClientImpl client; - - /** - * Initializes an instance of RunsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - RunsClientImpl(ContainerRegistryManagementClientImpl client) { - this.service = RestProxy.create(RunsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for ContainerRegistryManagementClientRuns to be used by the proxy service - * to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "ContainerRegistryMan") - private interface RunsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" - + "/registries/{registryName}/runs") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("registryName") String registryName, - @QueryParam("api-version") String apiVersion, - @QueryParam("$filter") String filter, - @QueryParam("$top") Integer top, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" - + "/registries/{registryName}/runs/{runId}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("registryName") String registryName, - @QueryParam("api-version") String apiVersion, - @PathParam("runId") String runId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" - + "/registries/{registryName}/runs/{runId}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("registryName") String registryName, - @QueryParam("api-version") String apiVersion, - @PathParam("runId") String runId, - @BodyParam("application/json") RunUpdateParameters runUpdateParameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" - + "/registries/{registryName}/runs/{runId}/listLogSasUrl") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getLogSasUrl( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("registryName") String registryName, - @QueryParam("api-version") String apiVersion, - @PathParam("runId") String runId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" - + "/registries/{registryName}/runs/{runId}/cancel") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> cancel( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("registryName") String registryName, - @QueryParam("api-version") String apiVersion, - @PathParam("runId") String runId, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets all the runs for a registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param filter The runs filter to apply on the operation. Arithmetic operators are not supported. The allowed - * string function is 'contains'. All logical operators except 'Not', 'Has', 'All' are allowed. - * @param top $top is supported for get list of runs, which limits the maximum number of runs to return. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the runs for a registry along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String registryName, String filter, Integer top) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (registryName == null) { - return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); - } - final String apiVersion = "2019-04-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - registryName, - apiVersion, - filter, - top, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all the runs for a registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param filter The runs filter to apply on the operation. Arithmetic operators are not supported. The allowed - * string function is 'contains'. All logical operators except 'Not', 'Has', 'All' are allowed. - * @param top $top is supported for get list of runs, which limits the maximum number of runs to return. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the runs for a registry along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String registryName, String filter, Integer top, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (registryName == null) { - return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); - } - final String apiVersion = "2019-04-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - registryName, - apiVersion, - filter, - top, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all the runs for a registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param filter The runs filter to apply on the operation. Arithmetic operators are not supported. The allowed - * string function is 'contains'. All logical operators except 'Not', 'Has', 'All' are allowed. - * @param top $top is supported for get list of runs, which limits the maximum number of runs to return. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the runs for a registry as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String resourceGroupName, String registryName, String filter, Integer top) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, registryName, filter, top), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets all the runs for a registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the runs for a registry as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String resourceGroupName, String registryName) { - final String filter = null; - final Integer top = null; - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, registryName, filter, top), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets all the runs for a registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param filter The runs filter to apply on the operation. Arithmetic operators are not supported. The allowed - * string function is 'contains'. All logical operators except 'Not', 'Has', 'All' are allowed. - * @param top $top is supported for get list of runs, which limits the maximum number of runs to return. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the runs for a registry as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String registryName, String filter, Integer top, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, registryName, filter, top, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all the runs for a registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the runs for a registry as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String registryName) { - final String filter = null; - final Integer top = null; - return new PagedIterable<>(listAsync(resourceGroupName, registryName, filter, top)); - } - - /** - * Gets all the runs for a registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param filter The runs filter to apply on the operation. Arithmetic operators are not supported. The allowed - * string function is 'contains'. All logical operators except 'Not', 'Has', 'All' are allowed. - * @param top $top is supported for get list of runs, which limits the maximum number of runs to return. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the runs for a registry as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, String registryName, String filter, Integer top, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, registryName, filter, top, context)); - } - - /** - * Gets the detailed information for a given run. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runId The run ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the detailed information for a given run along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync(String resourceGroupName, String registryName, String runId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (registryName == null) { - return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); - } - if (runId == null) { - return Mono.error(new IllegalArgumentException("Parameter runId is required and cannot be null.")); - } - final String apiVersion = "2019-04-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - registryName, - apiVersion, - runId, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the detailed information for a given run. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runId The run ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the detailed information for a given run along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String registryName, String runId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (registryName == null) { - return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); - } - if (runId == null) { - return Mono.error(new IllegalArgumentException("Parameter runId is required and cannot be null.")); - } - final String apiVersion = "2019-04-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - registryName, - apiVersion, - runId, - accept, - context); - } - - /** - * Gets the detailed information for a given run. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runId The run ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the detailed information for a given run on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync(String resourceGroupName, String registryName, String runId) { - return getWithResponseAsync(resourceGroupName, registryName, runId) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets the detailed information for a given run. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runId The run ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the detailed information for a given run. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RunInner get(String resourceGroupName, String registryName, String runId) { - return getAsync(resourceGroupName, registryName, runId).block(); - } - - /** - * Gets the detailed information for a given run. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runId The run ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the detailed information for a given run along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String registryName, String runId, Context context) { - return getWithResponseAsync(resourceGroupName, registryName, runId, context).block(); - } - - /** - * Patch the run properties. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runId The run ID. - * @param runUpdateParameters The run update properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return run resource properties along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateWithResponseAsync( - String resourceGroupName, String registryName, String runId, RunUpdateParameters runUpdateParameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (registryName == null) { - return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); - } - if (runId == null) { - return Mono.error(new IllegalArgumentException("Parameter runId is required and cannot be null.")); - } - if (runUpdateParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter runUpdateParameters is required and cannot be null.")); - } else { - runUpdateParameters.validate(); - } - final String apiVersion = "2019-04-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - registryName, - apiVersion, - runId, - runUpdateParameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Patch the run properties. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runId The run ID. - * @param runUpdateParameters The run update properties. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return run resource properties along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, - String registryName, - String runId, - RunUpdateParameters runUpdateParameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (registryName == null) { - return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); - } - if (runId == null) { - return Mono.error(new IllegalArgumentException("Parameter runId is required and cannot be null.")); - } - if (runUpdateParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter runUpdateParameters is required and cannot be null.")); - } else { - runUpdateParameters.validate(); - } - final String apiVersion = "2019-04-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - registryName, - apiVersion, - runId, - runUpdateParameters, - accept, - context); - } - - /** - * Patch the run properties. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runId The run ID. - * @param runUpdateParameters The run update properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of run resource properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, RunInner> beginUpdateAsync( - String resourceGroupName, String registryName, String runId, RunUpdateParameters runUpdateParameters) { - Mono>> mono = - updateWithResponseAsync(resourceGroupName, registryName, runId, runUpdateParameters); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), RunInner.class, RunInner.class, this.client.getContext()); - } - - /** - * Patch the run properties. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runId The run ID. - * @param runUpdateParameters The run update properties. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of run resource properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, RunInner> beginUpdateAsync( - String resourceGroupName, - String registryName, - String runId, - RunUpdateParameters runUpdateParameters, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - updateWithResponseAsync(resourceGroupName, registryName, runId, runUpdateParameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), RunInner.class, RunInner.class, context); - } - - /** - * Patch the run properties. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runId The run ID. - * @param runUpdateParameters The run update properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of run resource properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, RunInner> beginUpdate( - String resourceGroupName, String registryName, String runId, RunUpdateParameters runUpdateParameters) { - return beginUpdateAsync(resourceGroupName, registryName, runId, runUpdateParameters).getSyncPoller(); - } - - /** - * Patch the run properties. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runId The run ID. - * @param runUpdateParameters The run update properties. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of run resource properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, RunInner> beginUpdate( - String resourceGroupName, - String registryName, - String runId, - RunUpdateParameters runUpdateParameters, - Context context) { - return beginUpdateAsync(resourceGroupName, registryName, runId, runUpdateParameters, context).getSyncPoller(); - } - - /** - * Patch the run properties. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runId The run ID. - * @param runUpdateParameters The run update properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return run resource properties on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync( - String resourceGroupName, String registryName, String runId, RunUpdateParameters runUpdateParameters) { - return beginUpdateAsync(resourceGroupName, registryName, runId, runUpdateParameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Patch the run properties. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runId The run ID. - * @param runUpdateParameters The run update properties. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return run resource properties on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, - String registryName, - String runId, - RunUpdateParameters runUpdateParameters, - Context context) { - return beginUpdateAsync(resourceGroupName, registryName, runId, runUpdateParameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Patch the run properties. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runId The run ID. - * @param runUpdateParameters The run update properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return run resource properties. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RunInner update( - String resourceGroupName, String registryName, String runId, RunUpdateParameters runUpdateParameters) { - return updateAsync(resourceGroupName, registryName, runId, runUpdateParameters).block(); - } - - /** - * Patch the run properties. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runId The run ID. - * @param runUpdateParameters The run update properties. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return run resource properties. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RunInner update( - String resourceGroupName, - String registryName, - String runId, - RunUpdateParameters runUpdateParameters, - Context context) { - return updateAsync(resourceGroupName, registryName, runId, runUpdateParameters, context).block(); - } - - /** - * Gets a link to download the run logs. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runId The run ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a link to download the run logs along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getLogSasUrlWithResponseAsync( - String resourceGroupName, String registryName, String runId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (registryName == null) { - return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); - } - if (runId == null) { - return Mono.error(new IllegalArgumentException("Parameter runId is required and cannot be null.")); - } - final String apiVersion = "2019-04-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getLogSasUrl( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - registryName, - apiVersion, - runId, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a link to download the run logs. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runId The run ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a link to download the run logs along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getLogSasUrlWithResponseAsync( - String resourceGroupName, String registryName, String runId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (registryName == null) { - return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); - } - if (runId == null) { - return Mono.error(new IllegalArgumentException("Parameter runId is required and cannot be null.")); - } - final String apiVersion = "2019-04-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getLogSasUrl( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - registryName, - apiVersion, - runId, - accept, - context); - } - - /** - * Gets a link to download the run logs. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runId The run ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a link to download the run logs on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getLogSasUrlAsync(String resourceGroupName, String registryName, String runId) { - return getLogSasUrlWithResponseAsync(resourceGroupName, registryName, runId) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets a link to download the run logs. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runId The run ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a link to download the run logs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RunGetLogResultInner getLogSasUrl(String resourceGroupName, String registryName, String runId) { - return getLogSasUrlAsync(resourceGroupName, registryName, runId).block(); - } - - /** - * Gets a link to download the run logs. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runId The run ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a link to download the run logs along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getLogSasUrlWithResponse( - String resourceGroupName, String registryName, String runId, Context context) { - return getLogSasUrlWithResponseAsync(resourceGroupName, registryName, runId, context).block(); - } - - /** - * Cancel an existing run. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runId The run ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> cancelWithResponseAsync( - String resourceGroupName, String registryName, String runId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (registryName == null) { - return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); - } - if (runId == null) { - return Mono.error(new IllegalArgumentException("Parameter runId is required and cannot be null.")); - } - final String apiVersion = "2019-04-01"; - return FluxUtil - .withContext( - context -> - service - .cancel( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - registryName, - apiVersion, - runId, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Cancel an existing run. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runId The run ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> cancelWithResponseAsync( - String resourceGroupName, String registryName, String runId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (registryName == null) { - return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); - } - if (runId == null) { - return Mono.error(new IllegalArgumentException("Parameter runId is required and cannot be null.")); - } - final String apiVersion = "2019-04-01"; - context = this.client.mergeContext(context); - return service - .cancel( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - registryName, - apiVersion, - runId, - context); - } - - /** - * Cancel an existing run. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runId The run ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, Void> beginCancelAsync( - String resourceGroupName, String registryName, String runId) { - Mono>> mono = cancelWithResponseAsync(resourceGroupName, registryName, runId); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Cancel an existing run. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runId The run ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginCancelAsync( - String resourceGroupName, String registryName, String runId, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - cancelWithResponseAsync(resourceGroupName, registryName, runId, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Cancel an existing run. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runId The run ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginCancel(String resourceGroupName, String registryName, String runId) { - return beginCancelAsync(resourceGroupName, registryName, runId).getSyncPoller(); - } - - /** - * Cancel an existing run. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runId The run ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginCancel( - String resourceGroupName, String registryName, String runId, Context context) { - return beginCancelAsync(resourceGroupName, registryName, runId, context).getSyncPoller(); - } - - /** - * Cancel an existing run. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runId The run ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono cancelAsync(String resourceGroupName, String registryName, String runId) { - return beginCancelAsync(resourceGroupName, registryName, runId) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Cancel an existing run. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runId The run ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono cancelAsync(String resourceGroupName, String registryName, String runId, Context context) { - return beginCancelAsync(resourceGroupName, registryName, runId, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Cancel an existing run. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runId The run ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void cancel(String resourceGroupName, String registryName, String runId) { - cancelAsync(resourceGroupName, registryName, runId).block(); - } - - /** - * Cancel an existing run. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runId The run ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void cancel(String resourceGroupName, String registryName, String runId, Context context) { - cancelAsync(resourceGroupName, registryName, runId, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of runs along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of runs along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/SourceUploadDefinitionImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/SourceUploadDefinitionImpl.java deleted file mode 100644 index 13ababd25c59..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/SourceUploadDefinitionImpl.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.containerregistry.implementation; - -import com.azure.resourcemanager.containerregistry.models.SourceUploadDefinition; -import com.azure.resourcemanager.containerregistry.fluent.models.SourceUploadDefinitionInner; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.WrapperImpl; - -/** Implementation for SourceUploadDefinition. */ -public class SourceUploadDefinitionImpl extends WrapperImpl - implements SourceUploadDefinition { - - /** - * Creates an instance of the SourceUploadDefinition object. - * - * @param innerObject the inner object - */ - SourceUploadDefinitionImpl(SourceUploadDefinitionInner innerObject) { - super(innerObject); - } - - @Override - public String uploadUrl() { - return this.innerModel().uploadUrl(); - } - - @Override - public String relativePath() { - return this.innerModel().relativePath(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/TasksClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/TasksClientImpl.java deleted file mode 100644 index 05e038662bbb..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/TasksClientImpl.java +++ /dev/null @@ -1,1605 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.containerregistry.fluent.TasksClient; -import com.azure.resourcemanager.containerregistry.fluent.models.TaskInner; -import com.azure.resourcemanager.containerregistry.models.TaskListResult; -import com.azure.resourcemanager.containerregistry.models.TaskUpdateParameters; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in TasksClient. */ -public final class TasksClientImpl implements TasksClient { - /** The proxy service used to perform REST calls. */ - private final TasksService service; - - /** The service client containing this operation class. */ - private final ContainerRegistryManagementClientImpl client; - - /** - * Initializes an instance of TasksClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - TasksClientImpl(ContainerRegistryManagementClientImpl client) { - this.service = RestProxy.create(TasksService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for ContainerRegistryManagementClientTasks to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "ContainerRegistryMan") - private interface TasksService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" - + "/registries/{registryName}/tasks") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("registryName") String registryName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" - + "/registries/{registryName}/tasks/{taskName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("registryName") String registryName, - @QueryParam("api-version") String apiVersion, - @PathParam("taskName") String taskName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" - + "/registries/{registryName}/tasks/{taskName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> create( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("registryName") String registryName, - @QueryParam("api-version") String apiVersion, - @PathParam("taskName") String taskName, - @BodyParam("application/json") TaskInner taskCreateParameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" - + "/registries/{registryName}/tasks/{taskName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("registryName") String registryName, - @QueryParam("api-version") String apiVersion, - @PathParam("taskName") String taskName, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" - + "/registries/{registryName}/tasks/{taskName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("registryName") String registryName, - @QueryParam("api-version") String apiVersion, - @PathParam("taskName") String taskName, - @BodyParam("application/json") TaskUpdateParameters taskUpdateParameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" - + "/registries/{registryName}/tasks/{taskName}/listDetails") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getDetails( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("registryName") String registryName, - @QueryParam("api-version") String apiVersion, - @PathParam("taskName") String taskName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Lists all the tasks for a specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the collection of tasks along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String registryName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (registryName == null) { - return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); - } - final String apiVersion = "2019-04-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - registryName, - apiVersion, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all the tasks for a specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the collection of tasks along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String registryName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (registryName == null) { - return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); - } - final String apiVersion = "2019-04-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - registryName, - apiVersion, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists all the tasks for a specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the collection of tasks as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String resourceGroupName, String registryName) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, registryName), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists all the tasks for a specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the collection of tasks as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String registryName, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, registryName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all the tasks for a specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the collection of tasks as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String registryName) { - return new PagedIterable<>(listAsync(resourceGroupName, registryName)); - } - - /** - * Lists all the tasks for a specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the collection of tasks as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String registryName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, registryName, context)); - } - - /** - * Get the properties of a specified task. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a specified task along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String resourceGroupName, String registryName, String taskName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (registryName == null) { - return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); - } - if (taskName == null) { - return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); - } - final String apiVersion = "2019-04-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - registryName, - apiVersion, - taskName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the properties of a specified task. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a specified task along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String registryName, String taskName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (registryName == null) { - return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); - } - if (taskName == null) { - return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); - } - final String apiVersion = "2019-04-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - registryName, - apiVersion, - taskName, - accept, - context); - } - - /** - * Get the properties of a specified task. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a specified task on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync(String resourceGroupName, String registryName, String taskName) { - return getWithResponseAsync(resourceGroupName, registryName, taskName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get the properties of a specified task. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a specified task. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public TaskInner get(String resourceGroupName, String registryName, String taskName) { - return getAsync(resourceGroupName, registryName, taskName).block(); - } - - /** - * Get the properties of a specified task. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a specified task along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String registryName, String taskName, Context context) { - return getWithResponseAsync(resourceGroupName, registryName, taskName, context).block(); - } - - /** - * Creates a task for a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @param taskCreateParameters The parameters for creating a task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the task that has the ARM resource and task properties along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createWithResponseAsync( - String resourceGroupName, String registryName, String taskName, TaskInner taskCreateParameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (registryName == null) { - return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); - } - if (taskName == null) { - return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); - } - if (taskCreateParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter taskCreateParameters is required and cannot be null.")); - } else { - taskCreateParameters.validate(); - } - final String apiVersion = "2019-04-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .create( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - registryName, - apiVersion, - taskName, - taskCreateParameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates a task for a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @param taskCreateParameters The parameters for creating a task. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the task that has the ARM resource and task properties along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createWithResponseAsync( - String resourceGroupName, - String registryName, - String taskName, - TaskInner taskCreateParameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (registryName == null) { - return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); - } - if (taskName == null) { - return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); - } - if (taskCreateParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter taskCreateParameters is required and cannot be null.")); - } else { - taskCreateParameters.validate(); - } - final String apiVersion = "2019-04-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .create( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - registryName, - apiVersion, - taskName, - taskCreateParameters, - accept, - context); - } - - /** - * Creates a task for a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @param taskCreateParameters The parameters for creating a task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of the task that has the ARM resource and task properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, TaskInner> beginCreateAsync( - String resourceGroupName, String registryName, String taskName, TaskInner taskCreateParameters) { - Mono>> mono = - createWithResponseAsync(resourceGroupName, registryName, taskName, taskCreateParameters); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), TaskInner.class, TaskInner.class, this.client.getContext()); - } - - /** - * Creates a task for a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @param taskCreateParameters The parameters for creating a task. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of the task that has the ARM resource and task properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, TaskInner> beginCreateAsync( - String resourceGroupName, - String registryName, - String taskName, - TaskInner taskCreateParameters, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createWithResponseAsync(resourceGroupName, registryName, taskName, taskCreateParameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), TaskInner.class, TaskInner.class, context); - } - - /** - * Creates a task for a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @param taskCreateParameters The parameters for creating a task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of the task that has the ARM resource and task properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, TaskInner> beginCreate( - String resourceGroupName, String registryName, String taskName, TaskInner taskCreateParameters) { - return beginCreateAsync(resourceGroupName, registryName, taskName, taskCreateParameters).getSyncPoller(); - } - - /** - * Creates a task for a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @param taskCreateParameters The parameters for creating a task. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of the task that has the ARM resource and task properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, TaskInner> beginCreate( - String resourceGroupName, - String registryName, - String taskName, - TaskInner taskCreateParameters, - Context context) { - return beginCreateAsync(resourceGroupName, registryName, taskName, taskCreateParameters, context) - .getSyncPoller(); - } - - /** - * Creates a task for a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @param taskCreateParameters The parameters for creating a task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the task that has the ARM resource and task properties on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createAsync( - String resourceGroupName, String registryName, String taskName, TaskInner taskCreateParameters) { - return beginCreateAsync(resourceGroupName, registryName, taskName, taskCreateParameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates a task for a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @param taskCreateParameters The parameters for creating a task. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the task that has the ARM resource and task properties on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync( - String resourceGroupName, - String registryName, - String taskName, - TaskInner taskCreateParameters, - Context context) { - return beginCreateAsync(resourceGroupName, registryName, taskName, taskCreateParameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates a task for a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @param taskCreateParameters The parameters for creating a task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the task that has the ARM resource and task properties. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public TaskInner create( - String resourceGroupName, String registryName, String taskName, TaskInner taskCreateParameters) { - return createAsync(resourceGroupName, registryName, taskName, taskCreateParameters).block(); - } - - /** - * Creates a task for a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @param taskCreateParameters The parameters for creating a task. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the task that has the ARM resource and task properties. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public TaskInner create( - String resourceGroupName, - String registryName, - String taskName, - TaskInner taskCreateParameters, - Context context) { - return createAsync(resourceGroupName, registryName, taskName, taskCreateParameters, context).block(); - } - - /** - * Deletes a specified task. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync( - String resourceGroupName, String registryName, String taskName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (registryName == null) { - return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); - } - if (taskName == null) { - return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); - } - final String apiVersion = "2019-04-01"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - registryName, - apiVersion, - taskName, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a specified task. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String registryName, String taskName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (registryName == null) { - return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); - } - if (taskName == null) { - return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); - } - final String apiVersion = "2019-04-01"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - registryName, - apiVersion, - taskName, - context); - } - - /** - * Deletes a specified task. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String registryName, String taskName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, registryName, taskName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deletes a specified task. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String registryName, String taskName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, registryName, taskName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes a specified task. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String registryName, String taskName) { - return beginDeleteAsync(resourceGroupName, registryName, taskName).getSyncPoller(); - } - - /** - * Deletes a specified task. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String registryName, String taskName, Context context) { - return beginDeleteAsync(resourceGroupName, registryName, taskName, context).getSyncPoller(); - } - - /** - * Deletes a specified task. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String registryName, String taskName) { - return beginDeleteAsync(resourceGroupName, registryName, taskName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a specified task. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String registryName, String taskName, Context context) { - return beginDeleteAsync(resourceGroupName, registryName, taskName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a specified task. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String registryName, String taskName) { - deleteAsync(resourceGroupName, registryName, taskName).block(); - } - - /** - * Deletes a specified task. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String registryName, String taskName, Context context) { - deleteAsync(resourceGroupName, registryName, taskName, context).block(); - } - - /** - * Updates a task with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @param taskUpdateParameters The parameters for updating a task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the task that has the ARM resource and task properties along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateWithResponseAsync( - String resourceGroupName, String registryName, String taskName, TaskUpdateParameters taskUpdateParameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (registryName == null) { - return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); - } - if (taskName == null) { - return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); - } - if (taskUpdateParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter taskUpdateParameters is required and cannot be null.")); - } else { - taskUpdateParameters.validate(); - } - final String apiVersion = "2019-04-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - registryName, - apiVersion, - taskName, - taskUpdateParameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates a task with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @param taskUpdateParameters The parameters for updating a task. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the task that has the ARM resource and task properties along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, - String registryName, - String taskName, - TaskUpdateParameters taskUpdateParameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (registryName == null) { - return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); - } - if (taskName == null) { - return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); - } - if (taskUpdateParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter taskUpdateParameters is required and cannot be null.")); - } else { - taskUpdateParameters.validate(); - } - final String apiVersion = "2019-04-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - registryName, - apiVersion, - taskName, - taskUpdateParameters, - accept, - context); - } - - /** - * Updates a task with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @param taskUpdateParameters The parameters for updating a task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of the task that has the ARM resource and task properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, TaskInner> beginUpdateAsync( - String resourceGroupName, String registryName, String taskName, TaskUpdateParameters taskUpdateParameters) { - Mono>> mono = - updateWithResponseAsync(resourceGroupName, registryName, taskName, taskUpdateParameters); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), TaskInner.class, TaskInner.class, this.client.getContext()); - } - - /** - * Updates a task with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @param taskUpdateParameters The parameters for updating a task. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of the task that has the ARM resource and task properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, TaskInner> beginUpdateAsync( - String resourceGroupName, - String registryName, - String taskName, - TaskUpdateParameters taskUpdateParameters, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - updateWithResponseAsync(resourceGroupName, registryName, taskName, taskUpdateParameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), TaskInner.class, TaskInner.class, context); - } - - /** - * Updates a task with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @param taskUpdateParameters The parameters for updating a task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of the task that has the ARM resource and task properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, TaskInner> beginUpdate( - String resourceGroupName, String registryName, String taskName, TaskUpdateParameters taskUpdateParameters) { - return beginUpdateAsync(resourceGroupName, registryName, taskName, taskUpdateParameters).getSyncPoller(); - } - - /** - * Updates a task with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @param taskUpdateParameters The parameters for updating a task. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of the task that has the ARM resource and task properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, TaskInner> beginUpdate( - String resourceGroupName, - String registryName, - String taskName, - TaskUpdateParameters taskUpdateParameters, - Context context) { - return beginUpdateAsync(resourceGroupName, registryName, taskName, taskUpdateParameters, context) - .getSyncPoller(); - } - - /** - * Updates a task with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @param taskUpdateParameters The parameters for updating a task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the task that has the ARM resource and task properties on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync( - String resourceGroupName, String registryName, String taskName, TaskUpdateParameters taskUpdateParameters) { - return beginUpdateAsync(resourceGroupName, registryName, taskName, taskUpdateParameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates a task with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @param taskUpdateParameters The parameters for updating a task. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the task that has the ARM resource and task properties on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, - String registryName, - String taskName, - TaskUpdateParameters taskUpdateParameters, - Context context) { - return beginUpdateAsync(resourceGroupName, registryName, taskName, taskUpdateParameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates a task with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @param taskUpdateParameters The parameters for updating a task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the task that has the ARM resource and task properties. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public TaskInner update( - String resourceGroupName, String registryName, String taskName, TaskUpdateParameters taskUpdateParameters) { - return updateAsync(resourceGroupName, registryName, taskName, taskUpdateParameters).block(); - } - - /** - * Updates a task with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @param taskUpdateParameters The parameters for updating a task. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the task that has the ARM resource and task properties. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public TaskInner update( - String resourceGroupName, - String registryName, - String taskName, - TaskUpdateParameters taskUpdateParameters, - Context context) { - return updateAsync(resourceGroupName, registryName, taskName, taskUpdateParameters, context).block(); - } - - /** - * Returns a task with extended information that includes all secrets. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the task that has the ARM resource and task properties along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getDetailsWithResponseAsync( - String resourceGroupName, String registryName, String taskName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (registryName == null) { - return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); - } - if (taskName == null) { - return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); - } - final String apiVersion = "2019-04-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getDetails( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - registryName, - apiVersion, - taskName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns a task with extended information that includes all secrets. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the task that has the ARM resource and task properties along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getDetailsWithResponseAsync( - String resourceGroupName, String registryName, String taskName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (registryName == null) { - return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); - } - if (taskName == null) { - return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); - } - final String apiVersion = "2019-04-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getDetails( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - registryName, - apiVersion, - taskName, - accept, - context); - } - - /** - * Returns a task with extended information that includes all secrets. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the task that has the ARM resource and task properties on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getDetailsAsync(String resourceGroupName, String registryName, String taskName) { - return getDetailsWithResponseAsync(resourceGroupName, registryName, taskName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Returns a task with extended information that includes all secrets. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the task that has the ARM resource and task properties. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public TaskInner getDetails(String resourceGroupName, String registryName, String taskName) { - return getDetailsAsync(resourceGroupName, registryName, taskName).block(); - } - - /** - * Returns a task with extended information that includes all secrets. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the task that has the ARM resource and task properties along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getDetailsWithResponse( - String resourceGroupName, String registryName, String taskName, Context context) { - return getDetailsWithResponseAsync(resourceGroupName, registryName, taskName, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the collection of tasks along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the collection of tasks along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/WebhookEventInfoImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/WebhookEventInfoImpl.java deleted file mode 100644 index 9696519d1f1e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/WebhookEventInfoImpl.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.containerregistry.implementation; - -import com.azure.resourcemanager.containerregistry.models.EventRequestMessage; -import com.azure.resourcemanager.containerregistry.models.EventResponseMessage; -import com.azure.resourcemanager.containerregistry.models.WebhookEventInfo; -import com.azure.resourcemanager.containerregistry.fluent.models.EventInner; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.WrapperImpl; - -/** Response containing the webhook event info. */ -public class WebhookEventInfoImpl extends WrapperImpl implements WebhookEventInfo { - protected WebhookEventInfoImpl(EventInner innerObject) { - super(innerObject); - } - - @Override - public EventRequestMessage eventRequestMessage() { - return this.innerModel().eventRequestMessage(); - } - - @Override - public EventResponseMessage eventResponseMessage() { - return this.innerModel().eventResponseMessage(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/WebhookImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/WebhookImpl.java deleted file mode 100644 index 086f8be508b3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/WebhookImpl.java +++ /dev/null @@ -1,489 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.containerregistry.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.containerregistry.ContainerRegistryManager; -import com.azure.resourcemanager.containerregistry.fluent.WebhooksClient; -import com.azure.resourcemanager.containerregistry.fluent.models.CallbackConfigInner; -import com.azure.resourcemanager.containerregistry.fluent.models.WebhookInner; -import com.azure.resourcemanager.containerregistry.models.ProvisioningState; -import com.azure.resourcemanager.containerregistry.models.Registry; -import com.azure.resourcemanager.containerregistry.models.Webhook; -import com.azure.resourcemanager.containerregistry.models.WebhookAction; -import com.azure.resourcemanager.containerregistry.models.WebhookCreateParameters; -import com.azure.resourcemanager.containerregistry.models.WebhookEventInfo; -import com.azure.resourcemanager.containerregistry.models.WebhookStatus; -import com.azure.resourcemanager.containerregistry.models.WebhookUpdateParameters; -import com.azure.core.management.Region; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils; -import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.ExternalChildResourceImpl; -import reactor.core.publisher.Mono; - -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.Locale; -import java.util.Map; -import java.util.TreeMap; -import com.azure.resourcemanager.resources.fluentcore.utils.PagedConverter; - -/** Implementation for Webhook. */ -public class WebhookImpl extends ExternalChildResourceImpl - implements Webhook, - Webhook.WebhookDefinition, - Webhook.UpdateDefinition, - Webhook.UpdateResource, - Webhook.Update { - - private WebhookCreateParameters webhookCreateParametersInner; - private WebhookUpdateParameters webhookUpdateParametersInner; - - private Map tags; - private Map customHeaders; - private String serviceUri; - private boolean isInCreateMode; - - private ContainerRegistryManager containerRegistryManager; - private String resourceGroupName; - private String registryName; - - /** - * Creates an instance of external child resource in-memory. - * - * @param name the name of this external child resource - * @param parent reference to the parent of this external child resource - * @param innerObject reference to the inner object representing this external child resource - * @param containerRegistryManager reference to the container registry manager that accesses web hook operations - */ - WebhookImpl( - String name, RegistryImpl parent, WebhookInner innerObject, ContainerRegistryManager containerRegistryManager) { - super(name, parent, innerObject); - this.containerRegistryManager = containerRegistryManager; - if (parent != null) { - this.resourceGroupName = parent.resourceGroupName(); - this.registryName = parent.name(); - } - - this.initCreateUpdateParams(); - } - - /** - * Creates an instance of external child resource in-memory. - * - * @param resourceGroupName the resource group name - * @param registryName the registry name - * @param name the name of this external child resource - * @param innerObject reference to the inner object representing this external child resource - * @param containerRegistryManager reference to the container registry manager that accesses web hook operations - */ - WebhookImpl( - String resourceGroupName, - String registryName, - String name, - WebhookInner innerObject, - ContainerRegistryManager containerRegistryManager) { - super(name, null, innerObject); - this.containerRegistryManager = containerRegistryManager; - this.resourceGroupName = resourceGroupName; - this.registryName = registryName; - - this.initCreateUpdateParams(); - } - - private void initCreateUpdateParams() { - this.webhookCreateParametersInner = null; - this.webhookUpdateParametersInner = null; - this.isInCreateMode = false; - } - - @Override - public String id() { - return this.innerModel().id(); - } - - @Override - public String type() { - return this.innerModel().type(); - } - - @Override - public String regionName() { - return this.innerModel().location(); - } - - @Override - public Region region() { - return findByLabelOrName(this.regionName()); - } - - private static Region findByLabelOrName(String labelOrName) { - if (labelOrName == null) { - return null; - } - String nameLowerCase = labelOrName.toLowerCase(Locale.ROOT).replace(" ", ""); - return Region.values().stream() - .filter(r -> nameLowerCase.equals(r.name().toLowerCase(Locale.ROOT))) - .findFirst() - .orElse(null); - } - - @Override - public Map tags() { - Map tags = this.innerModel().tags(); - if (tags == null) { - tags = new TreeMap<>(); - } - return Collections.unmodifiableMap(tags); - } - - @Override - public boolean isEnabled() { - return this.innerModel().status().equals(WebhookStatus.ENABLED); - } - - @Override - public String scope() { - return this.innerModel().scope(); - } - - @Override - public String serviceUri() { - return this.serviceUri; - } - - @Override - public Map customHeaders() { - return Collections.unmodifiableMap(this.customHeaders); - } - - @Override - public Collection triggers() { - return Collections.unmodifiableCollection(this.innerModel().actions()); - } - - @Override - public ProvisioningState provisioningState() { - return this.innerModel().provisioningState(); - } - - @Override - public String parentId() { - return ResourceUtils.parentResourceIdFromResourceId(this.id()); - } - - @Override - public void enable() { - this.update().enabled(true).apply(); - } - - @Override - public Mono enableAsync() { - return this.update().enabled(true).applyAsync().then(Mono.empty()); - } - - @Override - public void disable() { - this.update().enabled(false).apply(); - } - - @Override - public Mono disableAsync() { - return this.update().enabled(false).applyAsync().then(Mono.empty()); - } - - @Override - public String ping() { - return this - .containerRegistryManager - .serviceClient() - .getWebhooks() - .ping(this.resourceGroupName, this.registryName, name()) - .id(); - } - - @Override - public Mono pingAsync() { - return this - .containerRegistryManager - .serviceClient() - .getWebhooks() - .pingAsync(this.resourceGroupName, this.registryName, name()) - .map(eventInfoInner -> eventInfoInner.id()); - } - - @Override - public PagedIterable listEvents() { - return new PagedIterable<>(this.listEventsAsync()); - } - - @Override - public PagedFlux listEventsAsync() { - final WebhookImpl self = this; - - return PagedConverter.mapPage(this - .containerRegistryManager - .serviceClient() - .getWebhooks() - .listEventsAsync(self.resourceGroupName, self.registryName, self.name()), - inner -> new WebhookEventInfoImpl(inner)); - } - - @Override - public Mono createResourceAsync() { - final WebhookImpl self = this; - if (webhookCreateParametersInner != null) { - return this - .containerRegistryManager - .serviceClient() - .getWebhooks() - .createAsync(self.resourceGroupName, this.registryName, this.name(), this.webhookCreateParametersInner) - .map( - inner -> { - self.webhookCreateParametersInner = null; - self.setInner(inner); - return self; - }) - .flatMap(webhook -> self.setCallbackConfigAsync()); - } else { - return Mono.just(this); - } - } - - WebhookImpl setCallbackConfig(CallbackConfigInner callbackConfigInner) { - this.serviceUri = callbackConfigInner.serviceUri(); - this.customHeaders = - callbackConfigInner.customHeaders() != null - ? callbackConfigInner.customHeaders() - : new HashMap(); - return this; - } - - Mono setCallbackConfigAsync() { - final WebhookImpl self = this; - - return this - .containerRegistryManager - .serviceClient() - .getWebhooks() - .getCallbackConfigAsync(self.resourceGroupName, self.registryName, self.name()) - .map( - callbackConfigInner -> { - setCallbackConfig(callbackConfigInner); - return self; - }); - } - - @Override - public Mono updateResourceAsync() { - final WebhookImpl self = this; - if (webhookUpdateParametersInner != null) { - return this - .containerRegistryManager - .serviceClient() - .getWebhooks() - .updateAsync(self.resourceGroupName, self.registryName, self.name(), self.webhookUpdateParametersInner) - .map( - inner -> { - self.setInner(inner); - self.webhookUpdateParametersInner = null; - return self; - }) - .flatMap(webhook -> self.setCallbackConfigAsync()); - } else { - return Mono.just(this); - } - } - - @Override - public Mono deleteResourceAsync() { - return this - .containerRegistryManager - .serviceClient() - .getWebhooks() - .deleteAsync(this.resourceGroupName, this.registryName, this.name()); - } - - @Override - protected Mono getInnerAsync() { - final WebhookImpl self = this; - final WebhooksClient webhooksInner = this.containerRegistryManager.serviceClient().getWebhooks(); - return webhooksInner - .getAsync(this.resourceGroupName, this.registryName, this.name()) - .flatMap( - webhookInner -> { - self.setInner(webhookInner); - return webhooksInner.getCallbackConfigAsync(self.resourceGroupName, self.registryName, self.name()); - }) - .map(callbackConfigInner -> setCallbackConfig(callbackConfigInner).innerModel()); - } - - @Override - public Webhook apply() { - return this.applyAsync().block(); - } - - @Override - public Mono applyAsync() { - return this.updateResourceAsync(); - } - - @Override - public WebhookImpl update() { - setCreateMode(false); - - return this; - } - - @Override - public RegistryImpl attach() { - return this.parent(); - } - - WebhookImpl setCreateMode(boolean isInCreateMode) { - this.isInCreateMode = isInCreateMode; - - if (this.isInCreateMode && parent() != null) { - this.webhookCreateParametersInner = new WebhookCreateParameters().withLocation(parent().regionName()); - } else { - this.webhookUpdateParametersInner = new WebhookUpdateParameters(); - } - - return this; - } - - @Override - public WebhookImpl withTags(Map tags) { - if (tags != null) { - this.tags = null; - ensureValidTags(); - for (Map.Entry entry : innerModel().tags().entrySet()) { - this.tags.put(entry.getKey(), entry.getValue()); - } - } - return this; - } - - @Override - public WebhookImpl withTag(String key, String value) { - if (key != null && value != null) { - ensureValidTags().put(key, value); - } - return this; - } - - @Override - public WebhookImpl withoutTag(String key) { - if (key != null && this.tags != null) { - this.tags.remove(key); - } - return this; - } - - @Override - public WebhookImpl withTriggerWhen(WebhookAction... webhookActions) { - if (webhookActions != null) { - if (this.isInCreateMode) { - ensureWebhookCreateParametersInner().withActions(Arrays.asList(webhookActions)); - } else { - ensureWebhookUpdateParametersInner().withActions(Arrays.asList(webhookActions)); - } - } - return this; - } - - @Override - public WebhookImpl withServiceUri(String serviceUri) { - if (serviceUri != null) { - if (this.isInCreateMode) { - ensureWebhookCreateParametersInner().withServiceUri(serviceUri); - } else { - ensureWebhookUpdateParametersInner().withServiceUri(serviceUri); - } - } - return this; - } - - @Override - public WebhookImpl withCustomHeader(String name, String value) { - if (name != null && value != null) { - ensureValidCustomHeaders().put(name, value); - } - return this; - } - - @Override - public WebhookImpl withCustomHeaders(Map customHeaders) { - if (customHeaders != null) { - this.customHeaders = null; - ensureValidCustomHeaders(); - for (Map.Entry entry : innerModel().tags().entrySet()) { - this.customHeaders.put(entry.getKey(), entry.getValue()); - } - } - return this; - } - - @Override - public WebhookImpl withRepositoriesScope(String repositoriesScope) { - if (repositoriesScope != null) { - if (this.isInCreateMode) { - ensureWebhookCreateParametersInner().withScope(repositoriesScope); - } else { - ensureWebhookUpdateParametersInner().withScope(repositoriesScope); - } - } - return this; - } - - @Override - public WebhookImpl enabled(boolean defaultStatus) { - WebhookStatus status = defaultStatus ? WebhookStatus.ENABLED : WebhookStatus.DISABLED; - if (this.isInCreateMode) { - ensureWebhookCreateParametersInner().withStatus(status); - } else { - ensureWebhookUpdateParametersInner().withStatus(status); - } - return this; - } - - private WebhookCreateParameters ensureWebhookCreateParametersInner() { - if (this.webhookCreateParametersInner == null && parent() != null) { - this.webhookCreateParametersInner = new WebhookCreateParameters().withLocation(parent().regionName()); - } - return this.webhookCreateParametersInner; - } - - private WebhookUpdateParameters ensureWebhookUpdateParametersInner() { - if (this.webhookUpdateParametersInner == null && parent() != null) { - this.webhookUpdateParametersInner = new WebhookUpdateParameters(); - } - return this.webhookUpdateParametersInner; - } - - private Map ensureValidTags() { - if (this.tags == null) { - this.tags = new HashMap<>(); - if (this.isInCreateMode) { - this.ensureWebhookCreateParametersInner().withTags(this.tags); - } else { - this.ensureWebhookUpdateParametersInner().withTags(this.tags); - } - } - return this.tags; - } - - private Map ensureValidCustomHeaders() { - if (this.customHeaders == null) { - this.customHeaders = new HashMap<>(); - if (this.isInCreateMode) { - this.ensureWebhookCreateParametersInner().withCustomHeaders(this.customHeaders); - } else { - this.ensureWebhookUpdateParametersInner().withCustomHeaders(this.customHeaders); - } - } - return this.customHeaders; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/WebhookOperationsImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/WebhookOperationsImpl.java deleted file mode 100644 index 4f2b9e89141e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/WebhookOperationsImpl.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.containerregistry.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.containerregistry.models.Webhook; -import com.azure.resourcemanager.containerregistry.models.WebhookOperations; -import reactor.core.publisher.Mono; - -/** Represents a webhook collection associated with a container registry. */ -public class WebhookOperationsImpl implements WebhookOperations { - private final RegistryImpl containerRegistry; - private final RegistriesWebhooksClientImpl webhooksClient; - - WebhookOperationsImpl(RegistryImpl containerRegistry) { - this.containerRegistry = containerRegistry; - if (containerRegistry != null) { - this.webhooksClient = new RegistriesWebhooksClientImpl(containerRegistry.manager(), containerRegistry); - } else { - this.webhooksClient = null; - } - } - - @Override - public Webhook get(final String webhookName) { - return this.getAsync(webhookName).block(); - } - - @Override - public Mono getAsync(final String webhookName) { - if (this.containerRegistry == null) { - return null; - } - return webhooksClient - .getAsync(this.containerRegistry.resourceGroupName(), this.containerRegistry.name(), webhookName); - } - - @Override - public void delete(final String webhookName) { - if (this.containerRegistry == null) { - return; - } - this - .webhooksClient - .delete(this.containerRegistry.resourceGroupName(), this.containerRegistry.name(), webhookName); - } - - @Override - public Mono deleteAsync(final String webhookName) { - if (this.containerRegistry == null) { - return null; - } - return this - .webhooksClient - .deleteAsync(this.containerRegistry.resourceGroupName(), this.containerRegistry.name(), webhookName); - } - - @Override - public PagedIterable list() { - if (this.containerRegistry == null) { - return null; - } - return this.webhooksClient.list(this.containerRegistry.resourceGroupName(), this.containerRegistry.name()); - } - - @Override - public PagedFlux listAsync() { - if (this.containerRegistry == null) { - return null; - } - return this.webhooksClient.listAsync(this.containerRegistry.resourceGroupName(), this.containerRegistry.name()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/WebhooksClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/WebhooksClientImpl.java deleted file mode 100644 index ae3e94e867d5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/WebhooksClientImpl.java +++ /dev/null @@ -1,2126 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.containerregistry.fluent.WebhooksClient; -import com.azure.resourcemanager.containerregistry.fluent.models.CallbackConfigInner; -import com.azure.resourcemanager.containerregistry.fluent.models.EventInfoInner; -import com.azure.resourcemanager.containerregistry.fluent.models.EventInner; -import com.azure.resourcemanager.containerregistry.fluent.models.WebhookInner; -import com.azure.resourcemanager.containerregistry.models.EventListResult; -import com.azure.resourcemanager.containerregistry.models.WebhookCreateParameters; -import com.azure.resourcemanager.containerregistry.models.WebhookListResult; -import com.azure.resourcemanager.containerregistry.models.WebhookUpdateParameters; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in WebhooksClient. */ -public final class WebhooksClientImpl implements WebhooksClient { - /** The proxy service used to perform REST calls. */ - private final WebhooksService service; - - /** The service client containing this operation class. */ - private final ContainerRegistryManagementClientImpl client; - - /** - * Initializes an instance of WebhooksClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - WebhooksClientImpl(ContainerRegistryManagementClientImpl client) { - this.service = RestProxy.create(WebhooksService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for ContainerRegistryManagementClientWebhooks to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "ContainerRegistryMan") - private interface WebhooksService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" - + "/registries/{registryName}/webhooks/{webhookName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("registryName") String registryName, - @PathParam("webhookName") String webhookName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" - + "/registries/{registryName}/webhooks/{webhookName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> create( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("registryName") String registryName, - @PathParam("webhookName") String webhookName, - @BodyParam("application/json") WebhookCreateParameters webhookCreateParameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" - + "/registries/{registryName}/webhooks/{webhookName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("registryName") String registryName, - @PathParam("webhookName") String webhookName, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" - + "/registries/{registryName}/webhooks/{webhookName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("registryName") String registryName, - @PathParam("webhookName") String webhookName, - @BodyParam("application/json") WebhookUpdateParameters webhookUpdateParameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" - + "/registries/{registryName}/webhooks") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("registryName") String registryName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" - + "/registries/{registryName}/webhooks/{webhookName}/ping") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> ping( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("registryName") String registryName, - @PathParam("webhookName") String webhookName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" - + "/registries/{registryName}/webhooks/{webhookName}/getCallbackConfig") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getCallbackConfig( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("registryName") String registryName, - @PathParam("webhookName") String webhookName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" - + "/registries/{registryName}/webhooks/{webhookName}/listEvents") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listEvents( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("registryName") String registryName, - @PathParam("webhookName") String webhookName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listEventsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets the properties of the specified webhook. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the specified webhook along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String resourceGroupName, String registryName, String webhookName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (registryName == null) { - return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); - } - if (webhookName == null) { - return Mono.error(new IllegalArgumentException("Parameter webhookName is required and cannot be null.")); - } - final String apiVersion = "2019-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - registryName, - webhookName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the properties of the specified webhook. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the specified webhook along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String registryName, String webhookName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (registryName == null) { - return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); - } - if (webhookName == null) { - return Mono.error(new IllegalArgumentException("Parameter webhookName is required and cannot be null.")); - } - final String apiVersion = "2019-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - registryName, - webhookName, - accept, - context); - } - - /** - * Gets the properties of the specified webhook. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the specified webhook on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync(String resourceGroupName, String registryName, String webhookName) { - return getWithResponseAsync(resourceGroupName, registryName, webhookName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets the properties of the specified webhook. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the specified webhook. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public WebhookInner get(String resourceGroupName, String registryName, String webhookName) { - return getAsync(resourceGroupName, registryName, webhookName).block(); - } - - /** - * Gets the properties of the specified webhook. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the specified webhook along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String registryName, String webhookName, Context context) { - return getWithResponseAsync(resourceGroupName, registryName, webhookName, context).block(); - } - - /** - * Creates a webhook for a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @param webhookCreateParameters The parameters for creating a webhook. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object that represents a webhook for a container registry along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createWithResponseAsync( - String resourceGroupName, - String registryName, - String webhookName, - WebhookCreateParameters webhookCreateParameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (registryName == null) { - return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); - } - if (webhookName == null) { - return Mono.error(new IllegalArgumentException("Parameter webhookName is required and cannot be null.")); - } - if (webhookCreateParameters == null) { - return Mono - .error( - new IllegalArgumentException("Parameter webhookCreateParameters is required and cannot be null.")); - } else { - webhookCreateParameters.validate(); - } - final String apiVersion = "2019-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .create( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - registryName, - webhookName, - webhookCreateParameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates a webhook for a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @param webhookCreateParameters The parameters for creating a webhook. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object that represents a webhook for a container registry along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createWithResponseAsync( - String resourceGroupName, - String registryName, - String webhookName, - WebhookCreateParameters webhookCreateParameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (registryName == null) { - return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); - } - if (webhookName == null) { - return Mono.error(new IllegalArgumentException("Parameter webhookName is required and cannot be null.")); - } - if (webhookCreateParameters == null) { - return Mono - .error( - new IllegalArgumentException("Parameter webhookCreateParameters is required and cannot be null.")); - } else { - webhookCreateParameters.validate(); - } - final String apiVersion = "2019-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .create( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - registryName, - webhookName, - webhookCreateParameters, - accept, - context); - } - - /** - * Creates a webhook for a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @param webhookCreateParameters The parameters for creating a webhook. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of an object that represents a webhook for a container registry. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, WebhookInner> beginCreateAsync( - String resourceGroupName, - String registryName, - String webhookName, - WebhookCreateParameters webhookCreateParameters) { - Mono>> mono = - createWithResponseAsync(resourceGroupName, registryName, webhookName, webhookCreateParameters); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), WebhookInner.class, WebhookInner.class, this.client.getContext()); - } - - /** - * Creates a webhook for a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @param webhookCreateParameters The parameters for creating a webhook. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of an object that represents a webhook for a container registry. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, WebhookInner> beginCreateAsync( - String resourceGroupName, - String registryName, - String webhookName, - WebhookCreateParameters webhookCreateParameters, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createWithResponseAsync(resourceGroupName, registryName, webhookName, webhookCreateParameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), WebhookInner.class, WebhookInner.class, context); - } - - /** - * Creates a webhook for a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @param webhookCreateParameters The parameters for creating a webhook. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of an object that represents a webhook for a container registry. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, WebhookInner> beginCreate( - String resourceGroupName, - String registryName, - String webhookName, - WebhookCreateParameters webhookCreateParameters) { - return beginCreateAsync(resourceGroupName, registryName, webhookName, webhookCreateParameters).getSyncPoller(); - } - - /** - * Creates a webhook for a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @param webhookCreateParameters The parameters for creating a webhook. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of an object that represents a webhook for a container registry. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, WebhookInner> beginCreate( - String resourceGroupName, - String registryName, - String webhookName, - WebhookCreateParameters webhookCreateParameters, - Context context) { - return beginCreateAsync(resourceGroupName, registryName, webhookName, webhookCreateParameters, context) - .getSyncPoller(); - } - - /** - * Creates a webhook for a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @param webhookCreateParameters The parameters for creating a webhook. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object that represents a webhook for a container registry on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createAsync( - String resourceGroupName, - String registryName, - String webhookName, - WebhookCreateParameters webhookCreateParameters) { - return beginCreateAsync(resourceGroupName, registryName, webhookName, webhookCreateParameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates a webhook for a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @param webhookCreateParameters The parameters for creating a webhook. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object that represents a webhook for a container registry on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync( - String resourceGroupName, - String registryName, - String webhookName, - WebhookCreateParameters webhookCreateParameters, - Context context) { - return beginCreateAsync(resourceGroupName, registryName, webhookName, webhookCreateParameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates a webhook for a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @param webhookCreateParameters The parameters for creating a webhook. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object that represents a webhook for a container registry. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public WebhookInner create( - String resourceGroupName, - String registryName, - String webhookName, - WebhookCreateParameters webhookCreateParameters) { - return createAsync(resourceGroupName, registryName, webhookName, webhookCreateParameters).block(); - } - - /** - * Creates a webhook for a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @param webhookCreateParameters The parameters for creating a webhook. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object that represents a webhook for a container registry. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public WebhookInner create( - String resourceGroupName, - String registryName, - String webhookName, - WebhookCreateParameters webhookCreateParameters, - Context context) { - return createAsync(resourceGroupName, registryName, webhookName, webhookCreateParameters, context).block(); - } - - /** - * Deletes a webhook from a container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync( - String resourceGroupName, String registryName, String webhookName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (registryName == null) { - return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); - } - if (webhookName == null) { - return Mono.error(new IllegalArgumentException("Parameter webhookName is required and cannot be null.")); - } - final String apiVersion = "2019-05-01"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - registryName, - webhookName, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a webhook from a container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String registryName, String webhookName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (registryName == null) { - return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); - } - if (webhookName == null) { - return Mono.error(new IllegalArgumentException("Parameter webhookName is required and cannot be null.")); - } - final String apiVersion = "2019-05-01"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - registryName, - webhookName, - context); - } - - /** - * Deletes a webhook from a container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String registryName, String webhookName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, registryName, webhookName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deletes a webhook from a container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String registryName, String webhookName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, registryName, webhookName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes a webhook from a container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String registryName, String webhookName) { - return beginDeleteAsync(resourceGroupName, registryName, webhookName).getSyncPoller(); - } - - /** - * Deletes a webhook from a container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String registryName, String webhookName, Context context) { - return beginDeleteAsync(resourceGroupName, registryName, webhookName, context).getSyncPoller(); - } - - /** - * Deletes a webhook from a container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String registryName, String webhookName) { - return beginDeleteAsync(resourceGroupName, registryName, webhookName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a webhook from a container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String registryName, String webhookName, Context context) { - return beginDeleteAsync(resourceGroupName, registryName, webhookName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a webhook from a container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String registryName, String webhookName) { - deleteAsync(resourceGroupName, registryName, webhookName).block(); - } - - /** - * Deletes a webhook from a container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String registryName, String webhookName, Context context) { - deleteAsync(resourceGroupName, registryName, webhookName, context).block(); - } - - /** - * Updates a webhook with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @param webhookUpdateParameters The parameters for updating a webhook. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object that represents a webhook for a container registry along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateWithResponseAsync( - String resourceGroupName, - String registryName, - String webhookName, - WebhookUpdateParameters webhookUpdateParameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (registryName == null) { - return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); - } - if (webhookName == null) { - return Mono.error(new IllegalArgumentException("Parameter webhookName is required and cannot be null.")); - } - if (webhookUpdateParameters == null) { - return Mono - .error( - new IllegalArgumentException("Parameter webhookUpdateParameters is required and cannot be null.")); - } else { - webhookUpdateParameters.validate(); - } - final String apiVersion = "2019-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - registryName, - webhookName, - webhookUpdateParameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates a webhook with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @param webhookUpdateParameters The parameters for updating a webhook. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object that represents a webhook for a container registry along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, - String registryName, - String webhookName, - WebhookUpdateParameters webhookUpdateParameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (registryName == null) { - return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); - } - if (webhookName == null) { - return Mono.error(new IllegalArgumentException("Parameter webhookName is required and cannot be null.")); - } - if (webhookUpdateParameters == null) { - return Mono - .error( - new IllegalArgumentException("Parameter webhookUpdateParameters is required and cannot be null.")); - } else { - webhookUpdateParameters.validate(); - } - final String apiVersion = "2019-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - registryName, - webhookName, - webhookUpdateParameters, - accept, - context); - } - - /** - * Updates a webhook with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @param webhookUpdateParameters The parameters for updating a webhook. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of an object that represents a webhook for a container registry. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, WebhookInner> beginUpdateAsync( - String resourceGroupName, - String registryName, - String webhookName, - WebhookUpdateParameters webhookUpdateParameters) { - Mono>> mono = - updateWithResponseAsync(resourceGroupName, registryName, webhookName, webhookUpdateParameters); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), WebhookInner.class, WebhookInner.class, this.client.getContext()); - } - - /** - * Updates a webhook with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @param webhookUpdateParameters The parameters for updating a webhook. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of an object that represents a webhook for a container registry. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, WebhookInner> beginUpdateAsync( - String resourceGroupName, - String registryName, - String webhookName, - WebhookUpdateParameters webhookUpdateParameters, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - updateWithResponseAsync(resourceGroupName, registryName, webhookName, webhookUpdateParameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), WebhookInner.class, WebhookInner.class, context); - } - - /** - * Updates a webhook with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @param webhookUpdateParameters The parameters for updating a webhook. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of an object that represents a webhook for a container registry. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, WebhookInner> beginUpdate( - String resourceGroupName, - String registryName, - String webhookName, - WebhookUpdateParameters webhookUpdateParameters) { - return beginUpdateAsync(resourceGroupName, registryName, webhookName, webhookUpdateParameters).getSyncPoller(); - } - - /** - * Updates a webhook with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @param webhookUpdateParameters The parameters for updating a webhook. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of an object that represents a webhook for a container registry. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, WebhookInner> beginUpdate( - String resourceGroupName, - String registryName, - String webhookName, - WebhookUpdateParameters webhookUpdateParameters, - Context context) { - return beginUpdateAsync(resourceGroupName, registryName, webhookName, webhookUpdateParameters, context) - .getSyncPoller(); - } - - /** - * Updates a webhook with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @param webhookUpdateParameters The parameters for updating a webhook. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object that represents a webhook for a container registry on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync( - String resourceGroupName, - String registryName, - String webhookName, - WebhookUpdateParameters webhookUpdateParameters) { - return beginUpdateAsync(resourceGroupName, registryName, webhookName, webhookUpdateParameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates a webhook with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @param webhookUpdateParameters The parameters for updating a webhook. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object that represents a webhook for a container registry on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, - String registryName, - String webhookName, - WebhookUpdateParameters webhookUpdateParameters, - Context context) { - return beginUpdateAsync(resourceGroupName, registryName, webhookName, webhookUpdateParameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates a webhook with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @param webhookUpdateParameters The parameters for updating a webhook. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object that represents a webhook for a container registry. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public WebhookInner update( - String resourceGroupName, - String registryName, - String webhookName, - WebhookUpdateParameters webhookUpdateParameters) { - return updateAsync(resourceGroupName, registryName, webhookName, webhookUpdateParameters).block(); - } - - /** - * Updates a webhook with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @param webhookUpdateParameters The parameters for updating a webhook. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object that represents a webhook for a container registry. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public WebhookInner update( - String resourceGroupName, - String registryName, - String webhookName, - WebhookUpdateParameters webhookUpdateParameters, - Context context) { - return updateAsync(resourceGroupName, registryName, webhookName, webhookUpdateParameters, context).block(); - } - - /** - * Lists all the webhooks for the specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list webhooks for a container registry along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String registryName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (registryName == null) { - return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); - } - final String apiVersion = "2019-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - registryName, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all the webhooks for the specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list webhooks for a container registry along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String registryName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (registryName == null) { - return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); - } - final String apiVersion = "2019-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - registryName, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists all the webhooks for the specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list webhooks for a container registry as paginated response with {@link - * PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String resourceGroupName, String registryName) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, registryName), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists all the webhooks for the specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list webhooks for a container registry as paginated response with {@link - * PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String registryName, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, registryName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all the webhooks for the specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list webhooks for a container registry as paginated response with {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String registryName) { - return new PagedIterable<>(listAsync(resourceGroupName, registryName)); - } - - /** - * Lists all the webhooks for the specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list webhooks for a container registry as paginated response with {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String registryName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, registryName, context)); - } - - /** - * Triggers a ping event to be sent to the webhook. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the basic information of an event along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> pingWithResponseAsync( - String resourceGroupName, String registryName, String webhookName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (registryName == null) { - return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); - } - if (webhookName == null) { - return Mono.error(new IllegalArgumentException("Parameter webhookName is required and cannot be null.")); - } - final String apiVersion = "2019-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .ping( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - registryName, - webhookName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Triggers a ping event to be sent to the webhook. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the basic information of an event along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> pingWithResponseAsync( - String resourceGroupName, String registryName, String webhookName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (registryName == null) { - return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); - } - if (webhookName == null) { - return Mono.error(new IllegalArgumentException("Parameter webhookName is required and cannot be null.")); - } - final String apiVersion = "2019-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .ping( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - registryName, - webhookName, - accept, - context); - } - - /** - * Triggers a ping event to be sent to the webhook. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the basic information of an event on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono pingAsync(String resourceGroupName, String registryName, String webhookName) { - return pingWithResponseAsync(resourceGroupName, registryName, webhookName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Triggers a ping event to be sent to the webhook. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the basic information of an event. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public EventInfoInner ping(String resourceGroupName, String registryName, String webhookName) { - return pingAsync(resourceGroupName, registryName, webhookName).block(); - } - - /** - * Triggers a ping event to be sent to the webhook. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the basic information of an event along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response pingWithResponse( - String resourceGroupName, String registryName, String webhookName, Context context) { - return pingWithResponseAsync(resourceGroupName, registryName, webhookName, context).block(); - } - - /** - * Gets the configuration of service URI and custom headers for the webhook. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the configuration of service URI and custom headers for the webhook along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getCallbackConfigWithResponseAsync( - String resourceGroupName, String registryName, String webhookName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (registryName == null) { - return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); - } - if (webhookName == null) { - return Mono.error(new IllegalArgumentException("Parameter webhookName is required and cannot be null.")); - } - final String apiVersion = "2019-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getCallbackConfig( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - registryName, - webhookName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the configuration of service URI and custom headers for the webhook. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the configuration of service URI and custom headers for the webhook along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getCallbackConfigWithResponseAsync( - String resourceGroupName, String registryName, String webhookName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (registryName == null) { - return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); - } - if (webhookName == null) { - return Mono.error(new IllegalArgumentException("Parameter webhookName is required and cannot be null.")); - } - final String apiVersion = "2019-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getCallbackConfig( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - registryName, - webhookName, - accept, - context); - } - - /** - * Gets the configuration of service URI and custom headers for the webhook. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the configuration of service URI and custom headers for the webhook on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getCallbackConfigAsync( - String resourceGroupName, String registryName, String webhookName) { - return getCallbackConfigWithResponseAsync(resourceGroupName, registryName, webhookName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets the configuration of service URI and custom headers for the webhook. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the configuration of service URI and custom headers for the webhook. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CallbackConfigInner getCallbackConfig(String resourceGroupName, String registryName, String webhookName) { - return getCallbackConfigAsync(resourceGroupName, registryName, webhookName).block(); - } - - /** - * Gets the configuration of service URI and custom headers for the webhook. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the configuration of service URI and custom headers for the webhook along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getCallbackConfigWithResponse( - String resourceGroupName, String registryName, String webhookName, Context context) { - return getCallbackConfigWithResponseAsync(resourceGroupName, registryName, webhookName, context).block(); - } - - /** - * Lists recent events for the specified webhook. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list events for a webhook along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listEventsSinglePageAsync( - String resourceGroupName, String registryName, String webhookName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (registryName == null) { - return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); - } - if (webhookName == null) { - return Mono.error(new IllegalArgumentException("Parameter webhookName is required and cannot be null.")); - } - final String apiVersion = "2019-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listEvents( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - registryName, - webhookName, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists recent events for the specified webhook. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list events for a webhook along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listEventsSinglePageAsync( - String resourceGroupName, String registryName, String webhookName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (registryName == null) { - return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); - } - if (webhookName == null) { - return Mono.error(new IllegalArgumentException("Parameter webhookName is required and cannot be null.")); - } - final String apiVersion = "2019-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listEvents( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - registryName, - webhookName, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists recent events for the specified webhook. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list events for a webhook as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listEventsAsync(String resourceGroupName, String registryName, String webhookName) { - return new PagedFlux<>( - () -> listEventsSinglePageAsync(resourceGroupName, registryName, webhookName), - nextLink -> listEventsNextSinglePageAsync(nextLink)); - } - - /** - * Lists recent events for the specified webhook. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list events for a webhook as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listEventsAsync( - String resourceGroupName, String registryName, String webhookName, Context context) { - return new PagedFlux<>( - () -> listEventsSinglePageAsync(resourceGroupName, registryName, webhookName, context), - nextLink -> listEventsNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists recent events for the specified webhook. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list events for a webhook as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listEvents(String resourceGroupName, String registryName, String webhookName) { - return new PagedIterable<>(listEventsAsync(resourceGroupName, registryName, webhookName)); - } - - /** - * Lists recent events for the specified webhook. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param webhookName The name of the webhook. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list events for a webhook as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listEvents( - String resourceGroupName, String registryName, String webhookName, Context context) { - return new PagedIterable<>(listEventsAsync(resourceGroupName, registryName, webhookName, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list webhooks for a container registry along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list webhooks for a container registry along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list events for a webhook along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listEventsNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listEventsNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list events for a webhook along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listEventsNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listEventsNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/WebhooksImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/WebhooksImpl.java deleted file mode 100644 index 8332b8a51c22..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/WebhooksImpl.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.containerregistry.implementation; - -import com.azure.resourcemanager.containerregistry.models.Registry; -import com.azure.resourcemanager.containerregistry.models.Webhook; -import com.azure.resourcemanager.containerregistry.fluent.models.WebhookInner; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.ExternalChildResourcesNonCachedImpl; - -/** Represents a webhook collection associated with a container registry. */ -public class WebhooksImpl - extends ExternalChildResourcesNonCachedImpl { - - /** - * Creates a new ExternalNonInlineChildResourcesImpl. - * - * @param parent the parent Azure resource - * @param childResourceName the child resource name - */ - protected WebhooksImpl(RegistryImpl parent, String childResourceName) { - super(parent, parent.taskGroup(), childResourceName); - } - - WebhookImpl defineWebhook(String name) { - return prepareInlineDefine( - new WebhookImpl(name, this.getParent(), new WebhookInner(), this.getParent().manager()) - .setCreateMode(true)); - } - - WebhookImpl updateWebhook(String name) { - return prepareInlineUpdate( - new WebhookImpl(name, this.getParent(), new WebhookInner(), this.getParent().manager()) - .setCreateMode(false)); - } - - void withoutWebhook(String name) { - prepareInlineRemove( - new WebhookImpl(name, this.getParent(), new WebhookInner(), this.getParent().manager()) - .setCreateMode(false)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/AccessKeyType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/AccessKeyType.java deleted file mode 100644 index 6b759b6d9ba7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/AccessKeyType.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** Defines values for admin user access key names. */ -public class AccessKeyType extends ExpandableStringEnum { - /** Primary key. */ - public static final AccessKeyType PRIMARY = fromString(PasswordName.PASSWORD.toString()); - - /** Secondary key. */ - public static final AccessKeyType SECONDARY = fromString(PasswordName.PASSWORD2.toString()); - - /** - * Finds or creates an access key name based on the provided name. - * - * @param name a name - * @return a AccessKeyType instance - */ - public static AccessKeyType fromString(String name) { - return fromString(name, AccessKeyType.class); - } - - /** @return known admin user access key names */ - public static Collection values() { - return values(AccessKeyType.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/Action.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/Action.java deleted file mode 100644 index 8d87fe832b2b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/Action.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for Action. */ -public final class Action extends ExpandableStringEnum { - /** Static value Allow for Action. */ - public static final Action ALLOW = fromString("Allow"); - - /** - * Creates or finds a Action from its string representation. - * - * @param name a name to look for. - * @return the corresponding Action. - */ - @JsonCreator - public static Action fromString(String name) { - return fromString(name, Action.class); - } - - /** - * Gets known Action values. - * - * @return known Action values. - */ - public static Collection values() { - return values(Action.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/Actor.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/Actor.java deleted file mode 100644 index d93f88add80a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/Actor.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * The agent that initiated the event. For most situations, this could be from the authorization context of the request. - */ -@Fluent -public final class Actor { - /* - * The subject or username associated with the request context that - * generated the event. - */ - @JsonProperty(value = "name") - private String name; - - /** - * Get the name property: The subject or username associated with the request context that generated the event. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The subject or username associated with the request context that generated the event. - * - * @param name the name value to set. - * @return the Actor object itself. - */ - public Actor withName(String name) { - this.name = name; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/AgentProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/AgentProperties.java deleted file mode 100644 index b932123212a0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/AgentProperties.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The properties that determine the run agent configuration. */ -@Fluent -public final class AgentProperties { - /* - * The CPU configuration in terms of number of cores required for the run. - */ - @JsonProperty(value = "cpu") - private Integer cpu; - - /** - * Get the cpu property: The CPU configuration in terms of number of cores required for the run. - * - * @return the cpu value. - */ - public Integer cpu() { - return this.cpu; - } - - /** - * Set the cpu property: The CPU configuration in terms of number of cores required for the run. - * - * @param cpu the cpu value to set. - * @return the AgentProperties object itself. - */ - public AgentProperties withCpu(Integer cpu) { - this.cpu = cpu; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/Architecture.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/Architecture.java deleted file mode 100644 index 5d4a3eb2c212..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/Architecture.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for Architecture. */ -public final class Architecture extends ExpandableStringEnum { - /** Static value amd64 for Architecture. */ - public static final Architecture AMD64 = fromString("amd64"); - - /** Static value x86 for Architecture. */ - public static final Architecture X86 = fromString("x86"); - - /** Static value arm for Architecture. */ - public static final Architecture ARM = fromString("arm"); - - /** - * Creates or finds a Architecture from its string representation. - * - * @param name a name to look for. - * @return the corresponding Architecture. - */ - @JsonCreator - public static Architecture fromString(String name) { - return fromString(name, Architecture.class); - } - - /** - * Gets known Architecture values. - * - * @return known Architecture values. - */ - public static Collection values() { - return values(Architecture.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/Argument.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/Argument.java deleted file mode 100644 index 03e031790f57..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/Argument.java +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The properties of a run argument. */ -@Fluent -public final class Argument { - /* - * The name of the argument. - */ - @JsonProperty(value = "name", required = true) - private String name; - - /* - * The value of the argument. - */ - @JsonProperty(value = "value", required = true) - private String value; - - /* - * Flag to indicate whether the argument represents a secret and want to be - * removed from build logs. - */ - @JsonProperty(value = "isSecret") - private Boolean isSecret; - - /** - * Get the name property: The name of the argument. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the argument. - * - * @param name the name value to set. - * @return the Argument object itself. - */ - public Argument withName(String name) { - this.name = name; - return this; - } - - /** - * Get the value property: The value of the argument. - * - * @return the value value. - */ - public String value() { - return this.value; - } - - /** - * Set the value property: The value of the argument. - * - * @param value the value value to set. - * @return the Argument object itself. - */ - public Argument withValue(String value) { - this.value = value; - return this; - } - - /** - * Get the isSecret property: Flag to indicate whether the argument represents a secret and want to be removed from - * build logs. - * - * @return the isSecret value. - */ - public Boolean isSecret() { - return this.isSecret; - } - - /** - * Set the isSecret property: Flag to indicate whether the argument represents a secret and want to be removed from - * build logs. - * - * @param isSecret the isSecret value to set. - * @return the Argument object itself. - */ - public Argument withIsSecret(Boolean isSecret) { - this.isSecret = isSecret; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() == null) { - throw LOGGER - .logExceptionAsError(new IllegalArgumentException("Missing required property name in model Argument")); - } - if (value() == null) { - throw LOGGER - .logExceptionAsError(new IllegalArgumentException("Missing required property value in model Argument")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(Argument.class); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/AuthInfo.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/AuthInfo.java deleted file mode 100644 index 9948ab566fe9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/AuthInfo.java +++ /dev/null @@ -1,162 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The authorization properties for accessing the source code repository. */ -@Fluent -public final class AuthInfo { - /* - * The type of Auth token. - */ - @JsonProperty(value = "tokenType", required = true) - private TokenType tokenType; - - /* - * The access token used to access the source control provider. - */ - @JsonProperty(value = "token", required = true) - private String token; - - /* - * The refresh token used to refresh the access token. - */ - @JsonProperty(value = "refreshToken") - private String refreshToken; - - /* - * The scope of the access token. - */ - @JsonProperty(value = "scope") - private String scope; - - /* - * Time in seconds that the token remains valid - */ - @JsonProperty(value = "expiresIn") - private Integer expiresIn; - - /** - * Get the tokenType property: The type of Auth token. - * - * @return the tokenType value. - */ - public TokenType tokenType() { - return this.tokenType; - } - - /** - * Set the tokenType property: The type of Auth token. - * - * @param tokenType the tokenType value to set. - * @return the AuthInfo object itself. - */ - public AuthInfo withTokenType(TokenType tokenType) { - this.tokenType = tokenType; - return this; - } - - /** - * Get the token property: The access token used to access the source control provider. - * - * @return the token value. - */ - public String token() { - return this.token; - } - - /** - * Set the token property: The access token used to access the source control provider. - * - * @param token the token value to set. - * @return the AuthInfo object itself. - */ - public AuthInfo withToken(String token) { - this.token = token; - return this; - } - - /** - * Get the refreshToken property: The refresh token used to refresh the access token. - * - * @return the refreshToken value. - */ - public String refreshToken() { - return this.refreshToken; - } - - /** - * Set the refreshToken property: The refresh token used to refresh the access token. - * - * @param refreshToken the refreshToken value to set. - * @return the AuthInfo object itself. - */ - public AuthInfo withRefreshToken(String refreshToken) { - this.refreshToken = refreshToken; - return this; - } - - /** - * Get the scope property: The scope of the access token. - * - * @return the scope value. - */ - public String scope() { - return this.scope; - } - - /** - * Set the scope property: The scope of the access token. - * - * @param scope the scope value to set. - * @return the AuthInfo object itself. - */ - public AuthInfo withScope(String scope) { - this.scope = scope; - return this; - } - - /** - * Get the expiresIn property: Time in seconds that the token remains valid. - * - * @return the expiresIn value. - */ - public Integer expiresIn() { - return this.expiresIn; - } - - /** - * Set the expiresIn property: Time in seconds that the token remains valid. - * - * @param expiresIn the expiresIn value to set. - * @return the AuthInfo object itself. - */ - public AuthInfo withExpiresIn(Integer expiresIn) { - this.expiresIn = expiresIn; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (tokenType() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property tokenType in model AuthInfo")); - } - if (token() == null) { - throw LOGGER - .logExceptionAsError(new IllegalArgumentException("Missing required property token in model AuthInfo")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(AuthInfo.class); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/AuthInfoUpdateParameters.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/AuthInfoUpdateParameters.java deleted file mode 100644 index c6218252e0fa..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/AuthInfoUpdateParameters.java +++ /dev/null @@ -1,150 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The authorization properties for accessing the source code repository. */ -@Fluent -public final class AuthInfoUpdateParameters { - /* - * The type of Auth token. - */ - @JsonProperty(value = "tokenType") - private TokenType tokenType; - - /* - * The access token used to access the source control provider. - */ - @JsonProperty(value = "token") - private String token; - - /* - * The refresh token used to refresh the access token. - */ - @JsonProperty(value = "refreshToken") - private String refreshToken; - - /* - * The scope of the access token. - */ - @JsonProperty(value = "scope") - private String scope; - - /* - * Time in seconds that the token remains valid - */ - @JsonProperty(value = "expiresIn") - private Integer expiresIn; - - /** - * Get the tokenType property: The type of Auth token. - * - * @return the tokenType value. - */ - public TokenType tokenType() { - return this.tokenType; - } - - /** - * Set the tokenType property: The type of Auth token. - * - * @param tokenType the tokenType value to set. - * @return the AuthInfoUpdateParameters object itself. - */ - public AuthInfoUpdateParameters withTokenType(TokenType tokenType) { - this.tokenType = tokenType; - return this; - } - - /** - * Get the token property: The access token used to access the source control provider. - * - * @return the token value. - */ - public String token() { - return this.token; - } - - /** - * Set the token property: The access token used to access the source control provider. - * - * @param token the token value to set. - * @return the AuthInfoUpdateParameters object itself. - */ - public AuthInfoUpdateParameters withToken(String token) { - this.token = token; - return this; - } - - /** - * Get the refreshToken property: The refresh token used to refresh the access token. - * - * @return the refreshToken value. - */ - public String refreshToken() { - return this.refreshToken; - } - - /** - * Set the refreshToken property: The refresh token used to refresh the access token. - * - * @param refreshToken the refreshToken value to set. - * @return the AuthInfoUpdateParameters object itself. - */ - public AuthInfoUpdateParameters withRefreshToken(String refreshToken) { - this.refreshToken = refreshToken; - return this; - } - - /** - * Get the scope property: The scope of the access token. - * - * @return the scope value. - */ - public String scope() { - return this.scope; - } - - /** - * Set the scope property: The scope of the access token. - * - * @param scope the scope value to set. - * @return the AuthInfoUpdateParameters object itself. - */ - public AuthInfoUpdateParameters withScope(String scope) { - this.scope = scope; - return this; - } - - /** - * Get the expiresIn property: Time in seconds that the token remains valid. - * - * @return the expiresIn value. - */ - public Integer expiresIn() { - return this.expiresIn; - } - - /** - * Set the expiresIn property: Time in seconds that the token remains valid. - * - * @param expiresIn the expiresIn value to set. - * @return the AuthInfoUpdateParameters object itself. - */ - public AuthInfoUpdateParameters withExpiresIn(Integer expiresIn) { - this.expiresIn = expiresIn; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/BaseImageDependency.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/BaseImageDependency.java deleted file mode 100644 index 046661d15aed..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/BaseImageDependency.java +++ /dev/null @@ -1,150 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Properties that describe a base image dependency. */ -@Fluent -public final class BaseImageDependency { - /* - * The type of the base image dependency. - */ - @JsonProperty(value = "type") - private BaseImageDependencyType type; - - /* - * The registry login server. - */ - @JsonProperty(value = "registry") - private String registry; - - /* - * The repository name. - */ - @JsonProperty(value = "repository") - private String repository; - - /* - * The tag name. - */ - @JsonProperty(value = "tag") - private String tag; - - /* - * The sha256-based digest of the image manifest. - */ - @JsonProperty(value = "digest") - private String digest; - - /** - * Get the type property: The type of the base image dependency. - * - * @return the type value. - */ - public BaseImageDependencyType type() { - return this.type; - } - - /** - * Set the type property: The type of the base image dependency. - * - * @param type the type value to set. - * @return the BaseImageDependency object itself. - */ - public BaseImageDependency withType(BaseImageDependencyType type) { - this.type = type; - return this; - } - - /** - * Get the registry property: The registry login server. - * - * @return the registry value. - */ - public String registry() { - return this.registry; - } - - /** - * Set the registry property: The registry login server. - * - * @param registry the registry value to set. - * @return the BaseImageDependency object itself. - */ - public BaseImageDependency withRegistry(String registry) { - this.registry = registry; - return this; - } - - /** - * Get the repository property: The repository name. - * - * @return the repository value. - */ - public String repository() { - return this.repository; - } - - /** - * Set the repository property: The repository name. - * - * @param repository the repository value to set. - * @return the BaseImageDependency object itself. - */ - public BaseImageDependency withRepository(String repository) { - this.repository = repository; - return this; - } - - /** - * Get the tag property: The tag name. - * - * @return the tag value. - */ - public String tag() { - return this.tag; - } - - /** - * Set the tag property: The tag name. - * - * @param tag the tag value to set. - * @return the BaseImageDependency object itself. - */ - public BaseImageDependency withTag(String tag) { - this.tag = tag; - return this; - } - - /** - * Get the digest property: The sha256-based digest of the image manifest. - * - * @return the digest value. - */ - public String digest() { - return this.digest; - } - - /** - * Set the digest property: The sha256-based digest of the image manifest. - * - * @param digest the digest value to set. - * @return the BaseImageDependency object itself. - */ - public BaseImageDependency withDigest(String digest) { - this.digest = digest; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/BaseImageDependencyType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/BaseImageDependencyType.java deleted file mode 100644 index 3acbcc6815b0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/BaseImageDependencyType.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for BaseImageDependencyType. */ -public final class BaseImageDependencyType extends ExpandableStringEnum { - /** Static value BuildTime for BaseImageDependencyType. */ - public static final BaseImageDependencyType BUILD_TIME = fromString("BuildTime"); - - /** Static value RunTime for BaseImageDependencyType. */ - public static final BaseImageDependencyType RUN_TIME = fromString("RunTime"); - - /** - * Creates or finds a BaseImageDependencyType from its string representation. - * - * @param name a name to look for. - * @return the corresponding BaseImageDependencyType. - */ - @JsonCreator - public static BaseImageDependencyType fromString(String name) { - return fromString(name, BaseImageDependencyType.class); - } - - /** - * Gets known BaseImageDependencyType values. - * - * @return known BaseImageDependencyType values. - */ - public static Collection values() { - return values(BaseImageDependencyType.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/BaseImageTrigger.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/BaseImageTrigger.java deleted file mode 100644 index aa451aa833e1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/BaseImageTrigger.java +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The trigger based on base image dependency. */ -@Fluent -public final class BaseImageTrigger { - /* - * The type of the auto trigger for base image dependency updates. - */ - @JsonProperty(value = "baseImageTriggerType", required = true) - private BaseImageTriggerType baseImageTriggerType; - - /* - * The current status of trigger. - */ - @JsonProperty(value = "status") - private TriggerStatus status; - - /* - * The name of the trigger. - */ - @JsonProperty(value = "name", required = true) - private String name; - - /** - * Get the baseImageTriggerType property: The type of the auto trigger for base image dependency updates. - * - * @return the baseImageTriggerType value. - */ - public BaseImageTriggerType baseImageTriggerType() { - return this.baseImageTriggerType; - } - - /** - * Set the baseImageTriggerType property: The type of the auto trigger for base image dependency updates. - * - * @param baseImageTriggerType the baseImageTriggerType value to set. - * @return the BaseImageTrigger object itself. - */ - public BaseImageTrigger withBaseImageTriggerType(BaseImageTriggerType baseImageTriggerType) { - this.baseImageTriggerType = baseImageTriggerType; - return this; - } - - /** - * Get the status property: The current status of trigger. - * - * @return the status value. - */ - public TriggerStatus status() { - return this.status; - } - - /** - * Set the status property: The current status of trigger. - * - * @param status the status value to set. - * @return the BaseImageTrigger object itself. - */ - public BaseImageTrigger withStatus(TriggerStatus status) { - this.status = status; - return this; - } - - /** - * Get the name property: The name of the trigger. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the trigger. - * - * @param name the name value to set. - * @return the BaseImageTrigger object itself. - */ - public BaseImageTrigger withName(String name) { - this.name = name; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (baseImageTriggerType() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property baseImageTriggerType in model BaseImageTrigger")); - } - if (name() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property name in model BaseImageTrigger")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(BaseImageTrigger.class); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/BaseImageTriggerType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/BaseImageTriggerType.java deleted file mode 100644 index ffa3956d5af7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/BaseImageTriggerType.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for BaseImageTriggerType. */ -public final class BaseImageTriggerType extends ExpandableStringEnum { - /** Static value All for BaseImageTriggerType. */ - public static final BaseImageTriggerType ALL = fromString("All"); - - /** Static value Runtime for BaseImageTriggerType. */ - public static final BaseImageTriggerType RUNTIME = fromString("Runtime"); - - /** - * Creates or finds a BaseImageTriggerType from its string representation. - * - * @param name a name to look for. - * @return the corresponding BaseImageTriggerType. - */ - @JsonCreator - public static BaseImageTriggerType fromString(String name) { - return fromString(name, BaseImageTriggerType.class); - } - - /** - * Gets known BaseImageTriggerType values. - * - * @return known BaseImageTriggerType values. - */ - public static Collection values() { - return values(BaseImageTriggerType.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/BaseImageTriggerUpdateParameters.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/BaseImageTriggerUpdateParameters.java deleted file mode 100644 index 7612498f6f43..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/BaseImageTriggerUpdateParameters.java +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The properties for updating base image dependency trigger. */ -@Fluent -public final class BaseImageTriggerUpdateParameters { - /* - * The type of the auto trigger for base image dependency updates. - */ - @JsonProperty(value = "baseImageTriggerType") - private BaseImageTriggerType baseImageTriggerType; - - /* - * The current status of trigger. - */ - @JsonProperty(value = "status") - private TriggerStatus status; - - /* - * The name of the trigger. - */ - @JsonProperty(value = "name", required = true) - private String name; - - /** - * Get the baseImageTriggerType property: The type of the auto trigger for base image dependency updates. - * - * @return the baseImageTriggerType value. - */ - public BaseImageTriggerType baseImageTriggerType() { - return this.baseImageTriggerType; - } - - /** - * Set the baseImageTriggerType property: The type of the auto trigger for base image dependency updates. - * - * @param baseImageTriggerType the baseImageTriggerType value to set. - * @return the BaseImageTriggerUpdateParameters object itself. - */ - public BaseImageTriggerUpdateParameters withBaseImageTriggerType(BaseImageTriggerType baseImageTriggerType) { - this.baseImageTriggerType = baseImageTriggerType; - return this; - } - - /** - * Get the status property: The current status of trigger. - * - * @return the status value. - */ - public TriggerStatus status() { - return this.status; - } - - /** - * Set the status property: The current status of trigger. - * - * @param status the status value to set. - * @return the BaseImageTriggerUpdateParameters object itself. - */ - public BaseImageTriggerUpdateParameters withStatus(TriggerStatus status) { - this.status = status; - return this; - } - - /** - * Get the name property: The name of the trigger. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the trigger. - * - * @param name the name value to set. - * @return the BaseImageTriggerUpdateParameters object itself. - */ - public BaseImageTriggerUpdateParameters withName(String name) { - this.name = name; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property name in model BaseImageTriggerUpdateParameters")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(BaseImageTriggerUpdateParameters.class); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/CheckNameAvailabilityResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/CheckNameAvailabilityResult.java deleted file mode 100644 index 4e3d7ea80ed9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/CheckNameAvailabilityResult.java +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.containerregistry.fluent.models.RegistryNameStatusInner; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; - -/** The result of checking for container registry name availability. */ -@Fluent -public interface CheckNameAvailabilityResult extends HasInnerModel { - /** @return true if the specified name is valid and available for use, otherwise false */ - boolean isAvailable(); - /** @return the reason why the user-provided name for the container registry could not be used */ - String unavailabilityReason(); - - /** @return the error message that provides more detail for the reason why the name is not available */ - String unavailabilityMessage(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/Credentials.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/Credentials.java deleted file mode 100644 index f3b2d23790bb..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/Credentials.java +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** The parameters that describes a set of credentials that will be used when a run is invoked. */ -@Fluent -public final class Credentials { - /* - * Describes the credential parameters for accessing the source registry. - */ - @JsonProperty(value = "sourceRegistry") - private SourceRegistryCredentials sourceRegistry; - - /* - * Describes the credential parameters for accessing other custom - * registries. The key - * for the dictionary item will be the registry login server - * (myregistry.azurecr.io) and - * the value of the item will be the registry credentials for accessing the - * registry. - */ - @JsonProperty(value = "customRegistries") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map customRegistries; - - /** - * Get the sourceRegistry property: Describes the credential parameters for accessing the source registry. - * - * @return the sourceRegistry value. - */ - public SourceRegistryCredentials sourceRegistry() { - return this.sourceRegistry; - } - - /** - * Set the sourceRegistry property: Describes the credential parameters for accessing the source registry. - * - * @param sourceRegistry the sourceRegistry value to set. - * @return the Credentials object itself. - */ - public Credentials withSourceRegistry(SourceRegistryCredentials sourceRegistry) { - this.sourceRegistry = sourceRegistry; - return this; - } - - /** - * Get the customRegistries property: Describes the credential parameters for accessing other custom registries. The - * key for the dictionary item will be the registry login server (myregistry.azurecr.io) and the value of the item - * will be the registry credentials for accessing the registry. - * - * @return the customRegistries value. - */ - public Map customRegistries() { - return this.customRegistries; - } - - /** - * Set the customRegistries property: Describes the credential parameters for accessing other custom registries. The - * key for the dictionary item will be the registry login server (myregistry.azurecr.io) and the value of the item - * will be the registry credentials for accessing the registry. - * - * @param customRegistries the customRegistries value to set. - * @return the Credentials object itself. - */ - public Credentials withCustomRegistries(Map customRegistries) { - this.customRegistries = customRegistries; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (sourceRegistry() != null) { - sourceRegistry().validate(); - } - if (customRegistries() != null) { - customRegistries() - .values() - .forEach( - e -> { - if (e != null) { - e.validate(); - } - }); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/CustomRegistryCredentials.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/CustomRegistryCredentials.java deleted file mode 100644 index 76fd4b7ccaf5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/CustomRegistryCredentials.java +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describes the credentials that will be used to access a custom registry during a run. */ -@Fluent -public final class CustomRegistryCredentials { - /* - * The username for logging into the custom registry. - */ - @JsonProperty(value = "userName") - private SecretObject username; - - /* - * The password for logging into the custom registry. The password is a - * secret - * object that allows multiple ways of providing the value for it. - */ - @JsonProperty(value = "password") - private SecretObject password; - - /* - * Indicates the managed identity assigned to the custom credential. If a - * user-assigned identity - * this value is the Client ID. If a system-assigned identity, the value - * will be `system`. In - * the case of a system-assigned identity, the Client ID will be determined - * by the runner. This - * identity may be used to authenticate to key vault to retrieve - * credentials or it may be the only - * source of authentication used for accessing the registry. - */ - @JsonProperty(value = "identity") - private String identity; - - /** - * Get the username property: The username for logging into the custom registry. - * - * @return the username value. - */ - public SecretObject username() { - return this.username; - } - - /** - * Set the username property: The username for logging into the custom registry. - * - * @param username the username value to set. - * @return the CustomRegistryCredentials object itself. - */ - public CustomRegistryCredentials withUsername(SecretObject username) { - this.username = username; - return this; - } - - /** - * Get the password property: The password for logging into the custom registry. The password is a secret object - * that allows multiple ways of providing the value for it. - * - * @return the password value. - */ - public SecretObject password() { - return this.password; - } - - /** - * Set the password property: The password for logging into the custom registry. The password is a secret object - * that allows multiple ways of providing the value for it. - * - * @param password the password value to set. - * @return the CustomRegistryCredentials object itself. - */ - public CustomRegistryCredentials withPassword(SecretObject password) { - this.password = password; - return this; - } - - /** - * Get the identity property: Indicates the managed identity assigned to the custom credential. If a user-assigned - * identity this value is the Client ID. If a system-assigned identity, the value will be `system`. In the case of a - * system-assigned identity, the Client ID will be determined by the runner. This identity may be used to - * authenticate to key vault to retrieve credentials or it may be the only source of authentication used for - * accessing the registry. - * - * @return the identity value. - */ - public String identity() { - return this.identity; - } - - /** - * Set the identity property: Indicates the managed identity assigned to the custom credential. If a user-assigned - * identity this value is the Client ID. If a system-assigned identity, the value will be `system`. In the case of a - * system-assigned identity, the Client ID will be determined by the runner. This identity may be used to - * authenticate to key vault to retrieve credentials or it may be the only source of authentication used for - * accessing the registry. - * - * @param identity the identity value to set. - * @return the CustomRegistryCredentials object itself. - */ - public CustomRegistryCredentials withIdentity(String identity) { - this.identity = identity; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (username() != null) { - username().validate(); - } - if (password() != null) { - password().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/DefaultAction.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/DefaultAction.java deleted file mode 100644 index cc5e5745f030..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/DefaultAction.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for DefaultAction. */ -public final class DefaultAction extends ExpandableStringEnum { - /** Static value Allow for DefaultAction. */ - public static final DefaultAction ALLOW = fromString("Allow"); - - /** Static value Deny for DefaultAction. */ - public static final DefaultAction DENY = fromString("Deny"); - - /** - * Creates or finds a DefaultAction from its string representation. - * - * @param name a name to look for. - * @return the corresponding DefaultAction. - */ - @JsonCreator - public static DefaultAction fromString(String name) { - return fromString(name, DefaultAction.class); - } - - /** - * Gets known DefaultAction values. - * - * @return known DefaultAction values. - */ - public static Collection values() { - return values(DefaultAction.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/DockerBuildRequest.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/DockerBuildRequest.java deleted file mode 100644 index caa81f0cc387..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/DockerBuildRequest.java +++ /dev/null @@ -1,359 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.util.List; - -/** The parameters for a docker quick build. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") -@JsonTypeName("DockerBuildRequest") -@Fluent -public final class DockerBuildRequest extends RunRequest { - /* - * The fully qualified image names including the repository and tag. - */ - @JsonProperty(value = "imageNames") - private List imageNames; - - /* - * The value of this property indicates whether the image built should be - * pushed to the registry or not. - */ - @JsonProperty(value = "isPushEnabled") - private Boolean isPushEnabled; - - /* - * The value of this property indicates whether the image cache is enabled - * or not. - */ - @JsonProperty(value = "noCache") - private Boolean noCache; - - /* - * The Docker file path relative to the source location. - */ - @JsonProperty(value = "dockerFilePath", required = true) - private String dockerFilePath; - - /* - * The name of the target build stage for the docker build. - */ - @JsonProperty(value = "target") - private String target; - - /* - * The collection of override arguments to be used when executing the run. - */ - @JsonProperty(value = "arguments") - private List arguments; - - /* - * Run timeout in seconds. - */ - @JsonProperty(value = "timeout") - private Integer timeout; - - /* - * The platform properties against which the run has to happen. - */ - @JsonProperty(value = "platform", required = true) - private PlatformProperties platform; - - /* - * The machine configuration of the run agent. - */ - @JsonProperty(value = "agentConfiguration") - private AgentProperties agentConfiguration; - - /* - * The URL(absolute or relative) of the source context. It can be an URL to - * a tar or git repository. - * If it is relative URL, the relative path should be obtained from calling - * listBuildSourceUploadUrl API. - */ - @JsonProperty(value = "sourceLocation") - private String sourceLocation; - - /* - * The properties that describes a set of credentials that will be used - * when this run is invoked. - */ - @JsonProperty(value = "credentials") - private Credentials credentials; - - /** - * Get the imageNames property: The fully qualified image names including the repository and tag. - * - * @return the imageNames value. - */ - public List imageNames() { - return this.imageNames; - } - - /** - * Set the imageNames property: The fully qualified image names including the repository and tag. - * - * @param imageNames the imageNames value to set. - * @return the DockerBuildRequest object itself. - */ - public DockerBuildRequest withImageNames(List imageNames) { - this.imageNames = imageNames; - return this; - } - - /** - * Get the isPushEnabled property: The value of this property indicates whether the image built should be pushed to - * the registry or not. - * - * @return the isPushEnabled value. - */ - public Boolean isPushEnabled() { - return this.isPushEnabled; - } - - /** - * Set the isPushEnabled property: The value of this property indicates whether the image built should be pushed to - * the registry or not. - * - * @param isPushEnabled the isPushEnabled value to set. - * @return the DockerBuildRequest object itself. - */ - public DockerBuildRequest withIsPushEnabled(Boolean isPushEnabled) { - this.isPushEnabled = isPushEnabled; - return this; - } - - /** - * Get the noCache property: The value of this property indicates whether the image cache is enabled or not. - * - * @return the noCache value. - */ - public Boolean noCache() { - return this.noCache; - } - - /** - * Set the noCache property: The value of this property indicates whether the image cache is enabled or not. - * - * @param noCache the noCache value to set. - * @return the DockerBuildRequest object itself. - */ - public DockerBuildRequest withNoCache(Boolean noCache) { - this.noCache = noCache; - return this; - } - - /** - * Get the dockerFilePath property: The Docker file path relative to the source location. - * - * @return the dockerFilePath value. - */ - public String dockerFilePath() { - return this.dockerFilePath; - } - - /** - * Set the dockerFilePath property: The Docker file path relative to the source location. - * - * @param dockerFilePath the dockerFilePath value to set. - * @return the DockerBuildRequest object itself. - */ - public DockerBuildRequest withDockerFilePath(String dockerFilePath) { - this.dockerFilePath = dockerFilePath; - return this; - } - - /** - * Get the target property: The name of the target build stage for the docker build. - * - * @return the target value. - */ - public String target() { - return this.target; - } - - /** - * Set the target property: The name of the target build stage for the docker build. - * - * @param target the target value to set. - * @return the DockerBuildRequest object itself. - */ - public DockerBuildRequest withTarget(String target) { - this.target = target; - return this; - } - - /** - * Get the arguments property: The collection of override arguments to be used when executing the run. - * - * @return the arguments value. - */ - public List arguments() { - return this.arguments; - } - - /** - * Set the arguments property: The collection of override arguments to be used when executing the run. - * - * @param arguments the arguments value to set. - * @return the DockerBuildRequest object itself. - */ - public DockerBuildRequest withArguments(List arguments) { - this.arguments = arguments; - return this; - } - - /** - * Get the timeout property: Run timeout in seconds. - * - * @return the timeout value. - */ - public Integer timeout() { - return this.timeout; - } - - /** - * Set the timeout property: Run timeout in seconds. - * - * @param timeout the timeout value to set. - * @return the DockerBuildRequest object itself. - */ - public DockerBuildRequest withTimeout(Integer timeout) { - this.timeout = timeout; - return this; - } - - /** - * Get the platform property: The platform properties against which the run has to happen. - * - * @return the platform value. - */ - public PlatformProperties platform() { - return this.platform; - } - - /** - * Set the platform property: The platform properties against which the run has to happen. - * - * @param platform the platform value to set. - * @return the DockerBuildRequest object itself. - */ - public DockerBuildRequest withPlatform(PlatformProperties platform) { - this.platform = platform; - return this; - } - - /** - * Get the agentConfiguration property: The machine configuration of the run agent. - * - * @return the agentConfiguration value. - */ - public AgentProperties agentConfiguration() { - return this.agentConfiguration; - } - - /** - * Set the agentConfiguration property: The machine configuration of the run agent. - * - * @param agentConfiguration the agentConfiguration value to set. - * @return the DockerBuildRequest object itself. - */ - public DockerBuildRequest withAgentConfiguration(AgentProperties agentConfiguration) { - this.agentConfiguration = agentConfiguration; - return this; - } - - /** - * Get the sourceLocation property: The URL(absolute or relative) of the source context. It can be an URL to a tar - * or git repository. If it is relative URL, the relative path should be obtained from calling - * listBuildSourceUploadUrl API. - * - * @return the sourceLocation value. - */ - public String sourceLocation() { - return this.sourceLocation; - } - - /** - * Set the sourceLocation property: The URL(absolute or relative) of the source context. It can be an URL to a tar - * or git repository. If it is relative URL, the relative path should be obtained from calling - * listBuildSourceUploadUrl API. - * - * @param sourceLocation the sourceLocation value to set. - * @return the DockerBuildRequest object itself. - */ - public DockerBuildRequest withSourceLocation(String sourceLocation) { - this.sourceLocation = sourceLocation; - return this; - } - - /** - * Get the credentials property: The properties that describes a set of credentials that will be used when this run - * is invoked. - * - * @return the credentials value. - */ - public Credentials credentials() { - return this.credentials; - } - - /** - * Set the credentials property: The properties that describes a set of credentials that will be used when this run - * is invoked. - * - * @param credentials the credentials value to set. - * @return the DockerBuildRequest object itself. - */ - public DockerBuildRequest withCredentials(Credentials credentials) { - this.credentials = credentials; - return this; - } - - /** {@inheritDoc} */ - @Override - public DockerBuildRequest withIsArchiveEnabled(Boolean isArchiveEnabled) { - super.withIsArchiveEnabled(isArchiveEnabled); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (dockerFilePath() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property dockerFilePath in model DockerBuildRequest")); - } - if (arguments() != null) { - arguments().forEach(e -> e.validate()); - } - if (platform() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property platform in model DockerBuildRequest")); - } else { - platform().validate(); - } - if (agentConfiguration() != null) { - agentConfiguration().validate(); - } - if (credentials() != null) { - credentials().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(DockerBuildRequest.class); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/DockerBuildStepUpdateParameters.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/DockerBuildStepUpdateParameters.java deleted file mode 100644 index 934334a2e67c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/DockerBuildStepUpdateParameters.java +++ /dev/null @@ -1,205 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.util.List; - -/** The properties for updating a docker build step. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") -@JsonTypeName("Docker") -@Fluent -public final class DockerBuildStepUpdateParameters extends TaskStepUpdateParameters { - /* - * The fully qualified image names including the repository and tag. - */ - @JsonProperty(value = "imageNames") - private List imageNames; - - /* - * The value of this property indicates whether the image built should be - * pushed to the registry or not. - */ - @JsonProperty(value = "isPushEnabled") - private Boolean isPushEnabled; - - /* - * The value of this property indicates whether the image cache is enabled - * or not. - */ - @JsonProperty(value = "noCache") - private Boolean noCache; - - /* - * The Docker file path relative to the source context. - */ - @JsonProperty(value = "dockerFilePath") - private String dockerFilePath; - - /* - * The collection of override arguments to be used when executing this - * build step. - */ - @JsonProperty(value = "arguments") - private List arguments; - - /* - * The name of the target build stage for the docker build. - */ - @JsonProperty(value = "target") - private String target; - - /** - * Get the imageNames property: The fully qualified image names including the repository and tag. - * - * @return the imageNames value. - */ - public List imageNames() { - return this.imageNames; - } - - /** - * Set the imageNames property: The fully qualified image names including the repository and tag. - * - * @param imageNames the imageNames value to set. - * @return the DockerBuildStepUpdateParameters object itself. - */ - public DockerBuildStepUpdateParameters withImageNames(List imageNames) { - this.imageNames = imageNames; - return this; - } - - /** - * Get the isPushEnabled property: The value of this property indicates whether the image built should be pushed to - * the registry or not. - * - * @return the isPushEnabled value. - */ - public Boolean isPushEnabled() { - return this.isPushEnabled; - } - - /** - * Set the isPushEnabled property: The value of this property indicates whether the image built should be pushed to - * the registry or not. - * - * @param isPushEnabled the isPushEnabled value to set. - * @return the DockerBuildStepUpdateParameters object itself. - */ - public DockerBuildStepUpdateParameters withIsPushEnabled(Boolean isPushEnabled) { - this.isPushEnabled = isPushEnabled; - return this; - } - - /** - * Get the noCache property: The value of this property indicates whether the image cache is enabled or not. - * - * @return the noCache value. - */ - public Boolean noCache() { - return this.noCache; - } - - /** - * Set the noCache property: The value of this property indicates whether the image cache is enabled or not. - * - * @param noCache the noCache value to set. - * @return the DockerBuildStepUpdateParameters object itself. - */ - public DockerBuildStepUpdateParameters withNoCache(Boolean noCache) { - this.noCache = noCache; - return this; - } - - /** - * Get the dockerFilePath property: The Docker file path relative to the source context. - * - * @return the dockerFilePath value. - */ - public String dockerFilePath() { - return this.dockerFilePath; - } - - /** - * Set the dockerFilePath property: The Docker file path relative to the source context. - * - * @param dockerFilePath the dockerFilePath value to set. - * @return the DockerBuildStepUpdateParameters object itself. - */ - public DockerBuildStepUpdateParameters withDockerFilePath(String dockerFilePath) { - this.dockerFilePath = dockerFilePath; - return this; - } - - /** - * Get the arguments property: The collection of override arguments to be used when executing this build step. - * - * @return the arguments value. - */ - public List arguments() { - return this.arguments; - } - - /** - * Set the arguments property: The collection of override arguments to be used when executing this build step. - * - * @param arguments the arguments value to set. - * @return the DockerBuildStepUpdateParameters object itself. - */ - public DockerBuildStepUpdateParameters withArguments(List arguments) { - this.arguments = arguments; - return this; - } - - /** - * Get the target property: The name of the target build stage for the docker build. - * - * @return the target value. - */ - public String target() { - return this.target; - } - - /** - * Set the target property: The name of the target build stage for the docker build. - * - * @param target the target value to set. - * @return the DockerBuildStepUpdateParameters object itself. - */ - public DockerBuildStepUpdateParameters withTarget(String target) { - this.target = target; - return this; - } - - /** {@inheritDoc} */ - @Override - public DockerBuildStepUpdateParameters withContextPath(String contextPath) { - super.withContextPath(contextPath); - return this; - } - - /** {@inheritDoc} */ - @Override - public DockerBuildStepUpdateParameters withContextAccessToken(String contextAccessToken) { - super.withContextAccessToken(contextAccessToken); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (arguments() != null) { - arguments().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/DockerTaskStep.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/DockerTaskStep.java deleted file mode 100644 index 8bc0fbfa3642..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/DockerTaskStep.java +++ /dev/null @@ -1,213 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.util.List; - -/** The Docker build step. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") -@JsonTypeName("Docker") -@Fluent -public final class DockerTaskStep extends TaskStepProperties { - /* - * The fully qualified image names including the repository and tag. - */ - @JsonProperty(value = "imageNames") - private List imageNames; - - /* - * The value of this property indicates whether the image built should be - * pushed to the registry or not. - */ - @JsonProperty(value = "isPushEnabled") - private Boolean isPushEnabled; - - /* - * The value of this property indicates whether the image cache is enabled - * or not. - */ - @JsonProperty(value = "noCache") - private Boolean noCache; - - /* - * The Docker file path relative to the source context. - */ - @JsonProperty(value = "dockerFilePath", required = true) - private String dockerFilePath; - - /* - * The name of the target build stage for the docker build. - */ - @JsonProperty(value = "target") - private String target; - - /* - * The collection of override arguments to be used when executing this - * build step. - */ - @JsonProperty(value = "arguments") - private List arguments; - - /** - * Get the imageNames property: The fully qualified image names including the repository and tag. - * - * @return the imageNames value. - */ - public List imageNames() { - return this.imageNames; - } - - /** - * Set the imageNames property: The fully qualified image names including the repository and tag. - * - * @param imageNames the imageNames value to set. - * @return the DockerTaskStep object itself. - */ - public DockerTaskStep withImageNames(List imageNames) { - this.imageNames = imageNames; - return this; - } - - /** - * Get the isPushEnabled property: The value of this property indicates whether the image built should be pushed to - * the registry or not. - * - * @return the isPushEnabled value. - */ - public Boolean isPushEnabled() { - return this.isPushEnabled; - } - - /** - * Set the isPushEnabled property: The value of this property indicates whether the image built should be pushed to - * the registry or not. - * - * @param isPushEnabled the isPushEnabled value to set. - * @return the DockerTaskStep object itself. - */ - public DockerTaskStep withIsPushEnabled(Boolean isPushEnabled) { - this.isPushEnabled = isPushEnabled; - return this; - } - - /** - * Get the noCache property: The value of this property indicates whether the image cache is enabled or not. - * - * @return the noCache value. - */ - public Boolean noCache() { - return this.noCache; - } - - /** - * Set the noCache property: The value of this property indicates whether the image cache is enabled or not. - * - * @param noCache the noCache value to set. - * @return the DockerTaskStep object itself. - */ - public DockerTaskStep withNoCache(Boolean noCache) { - this.noCache = noCache; - return this; - } - - /** - * Get the dockerFilePath property: The Docker file path relative to the source context. - * - * @return the dockerFilePath value. - */ - public String dockerFilePath() { - return this.dockerFilePath; - } - - /** - * Set the dockerFilePath property: The Docker file path relative to the source context. - * - * @param dockerFilePath the dockerFilePath value to set. - * @return the DockerTaskStep object itself. - */ - public DockerTaskStep withDockerFilePath(String dockerFilePath) { - this.dockerFilePath = dockerFilePath; - return this; - } - - /** - * Get the target property: The name of the target build stage for the docker build. - * - * @return the target value. - */ - public String target() { - return this.target; - } - - /** - * Set the target property: The name of the target build stage for the docker build. - * - * @param target the target value to set. - * @return the DockerTaskStep object itself. - */ - public DockerTaskStep withTarget(String target) { - this.target = target; - return this; - } - - /** - * Get the arguments property: The collection of override arguments to be used when executing this build step. - * - * @return the arguments value. - */ - public List arguments() { - return this.arguments; - } - - /** - * Set the arguments property: The collection of override arguments to be used when executing this build step. - * - * @param arguments the arguments value to set. - * @return the DockerTaskStep object itself. - */ - public DockerTaskStep withArguments(List arguments) { - this.arguments = arguments; - return this; - } - - /** {@inheritDoc} */ - @Override - public DockerTaskStep withContextPath(String contextPath) { - super.withContextPath(contextPath); - return this; - } - - /** {@inheritDoc} */ - @Override - public DockerTaskStep withContextAccessToken(String contextAccessToken) { - super.withContextAccessToken(contextAccessToken); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (dockerFilePath() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property dockerFilePath in model DockerTaskStep")); - } - if (arguments() != null) { - arguments().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(DockerTaskStep.class); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/EncodedTaskRunRequest.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/EncodedTaskRunRequest.java deleted file mode 100644 index 632ff6d47036..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/EncodedTaskRunRequest.java +++ /dev/null @@ -1,278 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.util.List; - -/** The parameters for a quick task run request. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") -@JsonTypeName("EncodedTaskRunRequest") -@Fluent -public final class EncodedTaskRunRequest extends RunRequest { - /* - * Base64 encoded value of the template/definition file content. - */ - @JsonProperty(value = "encodedTaskContent", required = true) - private String encodedTaskContent; - - /* - * Base64 encoded value of the parameters/values file content. - */ - @JsonProperty(value = "encodedValuesContent") - private String encodedValuesContent; - - /* - * The collection of overridable values that can be passed when running a - * task. - */ - @JsonProperty(value = "values") - private List values; - - /* - * Run timeout in seconds. - */ - @JsonProperty(value = "timeout") - private Integer timeout; - - /* - * The platform properties against which the run has to happen. - */ - @JsonProperty(value = "platform", required = true) - private PlatformProperties platform; - - /* - * The machine configuration of the run agent. - */ - @JsonProperty(value = "agentConfiguration") - private AgentProperties agentConfiguration; - - /* - * The URL(absolute or relative) of the source context. It can be an URL to - * a tar or git repository. - * If it is relative URL, the relative path should be obtained from calling - * listBuildSourceUploadUrl API. - */ - @JsonProperty(value = "sourceLocation") - private String sourceLocation; - - /* - * The properties that describes a set of credentials that will be used - * when this run is invoked. - */ - @JsonProperty(value = "credentials") - private Credentials credentials; - - /** - * Get the encodedTaskContent property: Base64 encoded value of the template/definition file content. - * - * @return the encodedTaskContent value. - */ - public String encodedTaskContent() { - return this.encodedTaskContent; - } - - /** - * Set the encodedTaskContent property: Base64 encoded value of the template/definition file content. - * - * @param encodedTaskContent the encodedTaskContent value to set. - * @return the EncodedTaskRunRequest object itself. - */ - public EncodedTaskRunRequest withEncodedTaskContent(String encodedTaskContent) { - this.encodedTaskContent = encodedTaskContent; - return this; - } - - /** - * Get the encodedValuesContent property: Base64 encoded value of the parameters/values file content. - * - * @return the encodedValuesContent value. - */ - public String encodedValuesContent() { - return this.encodedValuesContent; - } - - /** - * Set the encodedValuesContent property: Base64 encoded value of the parameters/values file content. - * - * @param encodedValuesContent the encodedValuesContent value to set. - * @return the EncodedTaskRunRequest object itself. - */ - public EncodedTaskRunRequest withEncodedValuesContent(String encodedValuesContent) { - this.encodedValuesContent = encodedValuesContent; - return this; - } - - /** - * Get the values property: The collection of overridable values that can be passed when running a task. - * - * @return the values value. - */ - public List values() { - return this.values; - } - - /** - * Set the values property: The collection of overridable values that can be passed when running a task. - * - * @param values the values value to set. - * @return the EncodedTaskRunRequest object itself. - */ - public EncodedTaskRunRequest withValues(List values) { - this.values = values; - return this; - } - - /** - * Get the timeout property: Run timeout in seconds. - * - * @return the timeout value. - */ - public Integer timeout() { - return this.timeout; - } - - /** - * Set the timeout property: Run timeout in seconds. - * - * @param timeout the timeout value to set. - * @return the EncodedTaskRunRequest object itself. - */ - public EncodedTaskRunRequest withTimeout(Integer timeout) { - this.timeout = timeout; - return this; - } - - /** - * Get the platform property: The platform properties against which the run has to happen. - * - * @return the platform value. - */ - public PlatformProperties platform() { - return this.platform; - } - - /** - * Set the platform property: The platform properties against which the run has to happen. - * - * @param platform the platform value to set. - * @return the EncodedTaskRunRequest object itself. - */ - public EncodedTaskRunRequest withPlatform(PlatformProperties platform) { - this.platform = platform; - return this; - } - - /** - * Get the agentConfiguration property: The machine configuration of the run agent. - * - * @return the agentConfiguration value. - */ - public AgentProperties agentConfiguration() { - return this.agentConfiguration; - } - - /** - * Set the agentConfiguration property: The machine configuration of the run agent. - * - * @param agentConfiguration the agentConfiguration value to set. - * @return the EncodedTaskRunRequest object itself. - */ - public EncodedTaskRunRequest withAgentConfiguration(AgentProperties agentConfiguration) { - this.agentConfiguration = agentConfiguration; - return this; - } - - /** - * Get the sourceLocation property: The URL(absolute or relative) of the source context. It can be an URL to a tar - * or git repository. If it is relative URL, the relative path should be obtained from calling - * listBuildSourceUploadUrl API. - * - * @return the sourceLocation value. - */ - public String sourceLocation() { - return this.sourceLocation; - } - - /** - * Set the sourceLocation property: The URL(absolute or relative) of the source context. It can be an URL to a tar - * or git repository. If it is relative URL, the relative path should be obtained from calling - * listBuildSourceUploadUrl API. - * - * @param sourceLocation the sourceLocation value to set. - * @return the EncodedTaskRunRequest object itself. - */ - public EncodedTaskRunRequest withSourceLocation(String sourceLocation) { - this.sourceLocation = sourceLocation; - return this; - } - - /** - * Get the credentials property: The properties that describes a set of credentials that will be used when this run - * is invoked. - * - * @return the credentials value. - */ - public Credentials credentials() { - return this.credentials; - } - - /** - * Set the credentials property: The properties that describes a set of credentials that will be used when this run - * is invoked. - * - * @param credentials the credentials value to set. - * @return the EncodedTaskRunRequest object itself. - */ - public EncodedTaskRunRequest withCredentials(Credentials credentials) { - this.credentials = credentials; - return this; - } - - /** {@inheritDoc} */ - @Override - public EncodedTaskRunRequest withIsArchiveEnabled(Boolean isArchiveEnabled) { - super.withIsArchiveEnabled(isArchiveEnabled); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (encodedTaskContent() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property encodedTaskContent in model EncodedTaskRunRequest")); - } - if (values() != null) { - values().forEach(e -> e.validate()); - } - if (platform() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property platform in model EncodedTaskRunRequest")); - } else { - platform().validate(); - } - if (agentConfiguration() != null) { - agentConfiguration().validate(); - } - if (credentials() != null) { - credentials().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(EncodedTaskRunRequest.class); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/EncodedTaskStep.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/EncodedTaskStep.java deleted file mode 100644 index e965e8ac8b5c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/EncodedTaskStep.java +++ /dev/null @@ -1,132 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.util.List; - -/** The properties of a encoded task step. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") -@JsonTypeName("EncodedTask") -@Fluent -public final class EncodedTaskStep extends TaskStepProperties { - /* - * Base64 encoded value of the template/definition file content. - */ - @JsonProperty(value = "encodedTaskContent", required = true) - private String encodedTaskContent; - - /* - * Base64 encoded value of the parameters/values file content. - */ - @JsonProperty(value = "encodedValuesContent") - private String encodedValuesContent; - - /* - * The collection of overridable values that can be passed when running a - * task. - */ - @JsonProperty(value = "values") - private List values; - - /** - * Get the encodedTaskContent property: Base64 encoded value of the template/definition file content. - * - * @return the encodedTaskContent value. - */ - public String encodedTaskContent() { - return this.encodedTaskContent; - } - - /** - * Set the encodedTaskContent property: Base64 encoded value of the template/definition file content. - * - * @param encodedTaskContent the encodedTaskContent value to set. - * @return the EncodedTaskStep object itself. - */ - public EncodedTaskStep withEncodedTaskContent(String encodedTaskContent) { - this.encodedTaskContent = encodedTaskContent; - return this; - } - - /** - * Get the encodedValuesContent property: Base64 encoded value of the parameters/values file content. - * - * @return the encodedValuesContent value. - */ - public String encodedValuesContent() { - return this.encodedValuesContent; - } - - /** - * Set the encodedValuesContent property: Base64 encoded value of the parameters/values file content. - * - * @param encodedValuesContent the encodedValuesContent value to set. - * @return the EncodedTaskStep object itself. - */ - public EncodedTaskStep withEncodedValuesContent(String encodedValuesContent) { - this.encodedValuesContent = encodedValuesContent; - return this; - } - - /** - * Get the values property: The collection of overridable values that can be passed when running a task. - * - * @return the values value. - */ - public List values() { - return this.values; - } - - /** - * Set the values property: The collection of overridable values that can be passed when running a task. - * - * @param values the values value to set. - * @return the EncodedTaskStep object itself. - */ - public EncodedTaskStep withValues(List values) { - this.values = values; - return this; - } - - /** {@inheritDoc} */ - @Override - public EncodedTaskStep withContextPath(String contextPath) { - super.withContextPath(contextPath); - return this; - } - - /** {@inheritDoc} */ - @Override - public EncodedTaskStep withContextAccessToken(String contextAccessToken) { - super.withContextAccessToken(contextAccessToken); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (encodedTaskContent() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property encodedTaskContent in model EncodedTaskStep")); - } - if (values() != null) { - values().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(EncodedTaskStep.class); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/EncodedTaskStepUpdateParameters.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/EncodedTaskStepUpdateParameters.java deleted file mode 100644 index 33777f5094d4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/EncodedTaskStepUpdateParameters.java +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.util.List; - -/** The properties for updating encoded task step. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") -@JsonTypeName("EncodedTask") -@Fluent -public final class EncodedTaskStepUpdateParameters extends TaskStepUpdateParameters { - /* - * Base64 encoded value of the template/definition file content. - */ - @JsonProperty(value = "encodedTaskContent") - private String encodedTaskContent; - - /* - * Base64 encoded value of the parameters/values file content. - */ - @JsonProperty(value = "encodedValuesContent") - private String encodedValuesContent; - - /* - * The collection of overridable values that can be passed when running a - * task. - */ - @JsonProperty(value = "values") - private List values; - - /** - * Get the encodedTaskContent property: Base64 encoded value of the template/definition file content. - * - * @return the encodedTaskContent value. - */ - public String encodedTaskContent() { - return this.encodedTaskContent; - } - - /** - * Set the encodedTaskContent property: Base64 encoded value of the template/definition file content. - * - * @param encodedTaskContent the encodedTaskContent value to set. - * @return the EncodedTaskStepUpdateParameters object itself. - */ - public EncodedTaskStepUpdateParameters withEncodedTaskContent(String encodedTaskContent) { - this.encodedTaskContent = encodedTaskContent; - return this; - } - - /** - * Get the encodedValuesContent property: Base64 encoded value of the parameters/values file content. - * - * @return the encodedValuesContent value. - */ - public String encodedValuesContent() { - return this.encodedValuesContent; - } - - /** - * Set the encodedValuesContent property: Base64 encoded value of the parameters/values file content. - * - * @param encodedValuesContent the encodedValuesContent value to set. - * @return the EncodedTaskStepUpdateParameters object itself. - */ - public EncodedTaskStepUpdateParameters withEncodedValuesContent(String encodedValuesContent) { - this.encodedValuesContent = encodedValuesContent; - return this; - } - - /** - * Get the values property: The collection of overridable values that can be passed when running a task. - * - * @return the values value. - */ - public List values() { - return this.values; - } - - /** - * Set the values property: The collection of overridable values that can be passed when running a task. - * - * @param values the values value to set. - * @return the EncodedTaskStepUpdateParameters object itself. - */ - public EncodedTaskStepUpdateParameters withValues(List values) { - this.values = values; - return this; - } - - /** {@inheritDoc} */ - @Override - public EncodedTaskStepUpdateParameters withContextPath(String contextPath) { - super.withContextPath(contextPath); - return this; - } - - /** {@inheritDoc} */ - @Override - public EncodedTaskStepUpdateParameters withContextAccessToken(String contextAccessToken) { - super.withContextAccessToken(contextAccessToken); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (values() != null) { - values().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/EventContent.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/EventContent.java deleted file mode 100644 index 7e0b0947bf12..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/EventContent.java +++ /dev/null @@ -1,221 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** The content of the event request message. */ -@Fluent -public final class EventContent { - /* - * The event ID. - */ - @JsonProperty(value = "id") - private String id; - - /* - * The time at which the event occurred. - */ - @JsonProperty(value = "timestamp") - private OffsetDateTime timestamp; - - /* - * The action that encompasses the provided event. - */ - @JsonProperty(value = "action") - private String action; - - /* - * The target of the event. - */ - @JsonProperty(value = "target") - private Target target; - - /* - * The request that generated the event. - */ - @JsonProperty(value = "request") - private Request request; - - /* - * The agent that initiated the event. For most situations, this could be - * from the authorization context of the request. - */ - @JsonProperty(value = "actor") - private Actor actor; - - /* - * The registry node that generated the event. Put differently, while the - * actor initiates the event, the source generates it. - */ - @JsonProperty(value = "source") - private Source source; - - /** - * Get the id property: The event ID. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: The event ID. - * - * @param id the id value to set. - * @return the EventContent object itself. - */ - public EventContent withId(String id) { - this.id = id; - return this; - } - - /** - * Get the timestamp property: The time at which the event occurred. - * - * @return the timestamp value. - */ - public OffsetDateTime timestamp() { - return this.timestamp; - } - - /** - * Set the timestamp property: The time at which the event occurred. - * - * @param timestamp the timestamp value to set. - * @return the EventContent object itself. - */ - public EventContent withTimestamp(OffsetDateTime timestamp) { - this.timestamp = timestamp; - return this; - } - - /** - * Get the action property: The action that encompasses the provided event. - * - * @return the action value. - */ - public String action() { - return this.action; - } - - /** - * Set the action property: The action that encompasses the provided event. - * - * @param action the action value to set. - * @return the EventContent object itself. - */ - public EventContent withAction(String action) { - this.action = action; - return this; - } - - /** - * Get the target property: The target of the event. - * - * @return the target value. - */ - public Target target() { - return this.target; - } - - /** - * Set the target property: The target of the event. - * - * @param target the target value to set. - * @return the EventContent object itself. - */ - public EventContent withTarget(Target target) { - this.target = target; - return this; - } - - /** - * Get the request property: The request that generated the event. - * - * @return the request value. - */ - public Request request() { - return this.request; - } - - /** - * Set the request property: The request that generated the event. - * - * @param request the request value to set. - * @return the EventContent object itself. - */ - public EventContent withRequest(Request request) { - this.request = request; - return this; - } - - /** - * Get the actor property: The agent that initiated the event. For most situations, this could be from the - * authorization context of the request. - * - * @return the actor value. - */ - public Actor actor() { - return this.actor; - } - - /** - * Set the actor property: The agent that initiated the event. For most situations, this could be from the - * authorization context of the request. - * - * @param actor the actor value to set. - * @return the EventContent object itself. - */ - public EventContent withActor(Actor actor) { - this.actor = actor; - return this; - } - - /** - * Get the source property: The registry node that generated the event. Put differently, while the actor initiates - * the event, the source generates it. - * - * @return the source value. - */ - public Source source() { - return this.source; - } - - /** - * Set the source property: The registry node that generated the event. Put differently, while the actor initiates - * the event, the source generates it. - * - * @param source the source value to set. - * @return the EventContent object itself. - */ - public EventContent withSource(Source source) { - this.source = source; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (target() != null) { - target().validate(); - } - if (request() != null) { - request().validate(); - } - if (actor() != null) { - actor().validate(); - } - if (source() != null) { - source().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/EventListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/EventListResult.java deleted file mode 100644 index 8cabf1b9abec..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/EventListResult.java +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.containerregistry.fluent.models.EventInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The result of a request to list events for a webhook. */ -@Fluent -public final class EventListResult { - /* - * The list of events. Since this list may be incomplete, the nextLink - * field should be used to request the next list of events. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URI that can be used to request the next list of events. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: The list of events. Since this list may be incomplete, the nextLink field should be used - * to request the next list of events. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The list of events. Since this list may be incomplete, the nextLink field should be used - * to request the next list of events. - * - * @param value the value value to set. - * @return the EventListResult object itself. - */ - public EventListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URI that can be used to request the next list of events. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The URI that can be used to request the next list of events. - * - * @param nextLink the nextLink value to set. - * @return the EventListResult object itself. - */ - public EventListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/EventRequestMessage.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/EventRequestMessage.java deleted file mode 100644 index 820e931b4870..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/EventRequestMessage.java +++ /dev/null @@ -1,156 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** The event request message sent to the service URI. */ -@Fluent -public final class EventRequestMessage { - /* - * The content of the event request message. - */ - @JsonProperty(value = "content") - private EventContent content; - - /* - * The headers of the event request message. - */ - @JsonProperty(value = "headers") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map headers; - - /* - * The HTTP method used to send the event request message. - */ - @JsonProperty(value = "method") - private String method; - - /* - * The URI used to send the event request message. - */ - @JsonProperty(value = "requestUri") - private String requestUri; - - /* - * The HTTP message version. - */ - @JsonProperty(value = "version") - private String version; - - /** - * Get the content property: The content of the event request message. - * - * @return the content value. - */ - public EventContent content() { - return this.content; - } - - /** - * Set the content property: The content of the event request message. - * - * @param content the content value to set. - * @return the EventRequestMessage object itself. - */ - public EventRequestMessage withContent(EventContent content) { - this.content = content; - return this; - } - - /** - * Get the headers property: The headers of the event request message. - * - * @return the headers value. - */ - public Map headers() { - return this.headers; - } - - /** - * Set the headers property: The headers of the event request message. - * - * @param headers the headers value to set. - * @return the EventRequestMessage object itself. - */ - public EventRequestMessage withHeaders(Map headers) { - this.headers = headers; - return this; - } - - /** - * Get the method property: The HTTP method used to send the event request message. - * - * @return the method value. - */ - public String method() { - return this.method; - } - - /** - * Set the method property: The HTTP method used to send the event request message. - * - * @param method the method value to set. - * @return the EventRequestMessage object itself. - */ - public EventRequestMessage withMethod(String method) { - this.method = method; - return this; - } - - /** - * Get the requestUri property: The URI used to send the event request message. - * - * @return the requestUri value. - */ - public String requestUri() { - return this.requestUri; - } - - /** - * Set the requestUri property: The URI used to send the event request message. - * - * @param requestUri the requestUri value to set. - * @return the EventRequestMessage object itself. - */ - public EventRequestMessage withRequestUri(String requestUri) { - this.requestUri = requestUri; - return this; - } - - /** - * Get the version property: The HTTP message version. - * - * @return the version value. - */ - public String version() { - return this.version; - } - - /** - * Set the version property: The HTTP message version. - * - * @param version the version value to set. - * @return the EventRequestMessage object itself. - */ - public EventRequestMessage withVersion(String version) { - this.version = version; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (content() != null) { - content().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/EventResponseMessage.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/EventResponseMessage.java deleted file mode 100644 index f7c642700899..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/EventResponseMessage.java +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** The event response message received from the service URI. */ -@Fluent -public final class EventResponseMessage { - /* - * The content of the event response message. - */ - @JsonProperty(value = "content") - private String content; - - /* - * The headers of the event response message. - */ - @JsonProperty(value = "headers") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map headers; - - /* - * The reason phrase of the event response message. - */ - @JsonProperty(value = "reasonPhrase") - private String reasonPhrase; - - /* - * The status code of the event response message. - */ - @JsonProperty(value = "statusCode") - private String statusCode; - - /* - * The HTTP message version. - */ - @JsonProperty(value = "version") - private String version; - - /** - * Get the content property: The content of the event response message. - * - * @return the content value. - */ - public String content() { - return this.content; - } - - /** - * Set the content property: The content of the event response message. - * - * @param content the content value to set. - * @return the EventResponseMessage object itself. - */ - public EventResponseMessage withContent(String content) { - this.content = content; - return this; - } - - /** - * Get the headers property: The headers of the event response message. - * - * @return the headers value. - */ - public Map headers() { - return this.headers; - } - - /** - * Set the headers property: The headers of the event response message. - * - * @param headers the headers value to set. - * @return the EventResponseMessage object itself. - */ - public EventResponseMessage withHeaders(Map headers) { - this.headers = headers; - return this; - } - - /** - * Get the reasonPhrase property: The reason phrase of the event response message. - * - * @return the reasonPhrase value. - */ - public String reasonPhrase() { - return this.reasonPhrase; - } - - /** - * Set the reasonPhrase property: The reason phrase of the event response message. - * - * @param reasonPhrase the reasonPhrase value to set. - * @return the EventResponseMessage object itself. - */ - public EventResponseMessage withReasonPhrase(String reasonPhrase) { - this.reasonPhrase = reasonPhrase; - return this; - } - - /** - * Get the statusCode property: The status code of the event response message. - * - * @return the statusCode value. - */ - public String statusCode() { - return this.statusCode; - } - - /** - * Set the statusCode property: The status code of the event response message. - * - * @param statusCode the statusCode value to set. - * @return the EventResponseMessage object itself. - */ - public EventResponseMessage withStatusCode(String statusCode) { - this.statusCode = statusCode; - return this; - } - - /** - * Get the version property: The HTTP message version. - * - * @return the version value. - */ - public String version() { - return this.version; - } - - /** - * Set the version property: The HTTP message version. - * - * @param version the version value to set. - * @return the EventResponseMessage object itself. - */ - public EventResponseMessage withVersion(String version) { - this.version = version; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/FileTaskRunRequest.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/FileTaskRunRequest.java deleted file mode 100644 index a330ea43d3b0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/FileTaskRunRequest.java +++ /dev/null @@ -1,277 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.util.List; - -/** The request parameters for a scheduling run against a task file. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") -@JsonTypeName("FileTaskRunRequest") -@Fluent -public final class FileTaskRunRequest extends RunRequest { - /* - * The template/definition file path relative to the source. - */ - @JsonProperty(value = "taskFilePath", required = true) - private String taskFilePath; - - /* - * The values/parameters file path relative to the source. - */ - @JsonProperty(value = "valuesFilePath") - private String valuesFilePath; - - /* - * The collection of overridable values that can be passed when running a - * task. - */ - @JsonProperty(value = "values") - private List values; - - /* - * Run timeout in seconds. - */ - @JsonProperty(value = "timeout") - private Integer timeout; - - /* - * The platform properties against which the run has to happen. - */ - @JsonProperty(value = "platform", required = true) - private PlatformProperties platform; - - /* - * The machine configuration of the run agent. - */ - @JsonProperty(value = "agentConfiguration") - private AgentProperties agentConfiguration; - - /* - * The URL(absolute or relative) of the source context. It can be an URL to - * a tar or git repository. - * If it is relative URL, the relative path should be obtained from calling - * listBuildSourceUploadUrl API. - */ - @JsonProperty(value = "sourceLocation") - private String sourceLocation; - - /* - * The properties that describes a set of credentials that will be used - * when this run is invoked. - */ - @JsonProperty(value = "credentials") - private Credentials credentials; - - /** - * Get the taskFilePath property: The template/definition file path relative to the source. - * - * @return the taskFilePath value. - */ - public String taskFilePath() { - return this.taskFilePath; - } - - /** - * Set the taskFilePath property: The template/definition file path relative to the source. - * - * @param taskFilePath the taskFilePath value to set. - * @return the FileTaskRunRequest object itself. - */ - public FileTaskRunRequest withTaskFilePath(String taskFilePath) { - this.taskFilePath = taskFilePath; - return this; - } - - /** - * Get the valuesFilePath property: The values/parameters file path relative to the source. - * - * @return the valuesFilePath value. - */ - public String valuesFilePath() { - return this.valuesFilePath; - } - - /** - * Set the valuesFilePath property: The values/parameters file path relative to the source. - * - * @param valuesFilePath the valuesFilePath value to set. - * @return the FileTaskRunRequest object itself. - */ - public FileTaskRunRequest withValuesFilePath(String valuesFilePath) { - this.valuesFilePath = valuesFilePath; - return this; - } - - /** - * Get the values property: The collection of overridable values that can be passed when running a task. - * - * @return the values value. - */ - public List values() { - return this.values; - } - - /** - * Set the values property: The collection of overridable values that can be passed when running a task. - * - * @param values the values value to set. - * @return the FileTaskRunRequest object itself. - */ - public FileTaskRunRequest withValues(List values) { - this.values = values; - return this; - } - - /** - * Get the timeout property: Run timeout in seconds. - * - * @return the timeout value. - */ - public Integer timeout() { - return this.timeout; - } - - /** - * Set the timeout property: Run timeout in seconds. - * - * @param timeout the timeout value to set. - * @return the FileTaskRunRequest object itself. - */ - public FileTaskRunRequest withTimeout(Integer timeout) { - this.timeout = timeout; - return this; - } - - /** - * Get the platform property: The platform properties against which the run has to happen. - * - * @return the platform value. - */ - public PlatformProperties platform() { - return this.platform; - } - - /** - * Set the platform property: The platform properties against which the run has to happen. - * - * @param platform the platform value to set. - * @return the FileTaskRunRequest object itself. - */ - public FileTaskRunRequest withPlatform(PlatformProperties platform) { - this.platform = platform; - return this; - } - - /** - * Get the agentConfiguration property: The machine configuration of the run agent. - * - * @return the agentConfiguration value. - */ - public AgentProperties agentConfiguration() { - return this.agentConfiguration; - } - - /** - * Set the agentConfiguration property: The machine configuration of the run agent. - * - * @param agentConfiguration the agentConfiguration value to set. - * @return the FileTaskRunRequest object itself. - */ - public FileTaskRunRequest withAgentConfiguration(AgentProperties agentConfiguration) { - this.agentConfiguration = agentConfiguration; - return this; - } - - /** - * Get the sourceLocation property: The URL(absolute or relative) of the source context. It can be an URL to a tar - * or git repository. If it is relative URL, the relative path should be obtained from calling - * listBuildSourceUploadUrl API. - * - * @return the sourceLocation value. - */ - public String sourceLocation() { - return this.sourceLocation; - } - - /** - * Set the sourceLocation property: The URL(absolute or relative) of the source context. It can be an URL to a tar - * or git repository. If it is relative URL, the relative path should be obtained from calling - * listBuildSourceUploadUrl API. - * - * @param sourceLocation the sourceLocation value to set. - * @return the FileTaskRunRequest object itself. - */ - public FileTaskRunRequest withSourceLocation(String sourceLocation) { - this.sourceLocation = sourceLocation; - return this; - } - - /** - * Get the credentials property: The properties that describes a set of credentials that will be used when this run - * is invoked. - * - * @return the credentials value. - */ - public Credentials credentials() { - return this.credentials; - } - - /** - * Set the credentials property: The properties that describes a set of credentials that will be used when this run - * is invoked. - * - * @param credentials the credentials value to set. - * @return the FileTaskRunRequest object itself. - */ - public FileTaskRunRequest withCredentials(Credentials credentials) { - this.credentials = credentials; - return this; - } - - /** {@inheritDoc} */ - @Override - public FileTaskRunRequest withIsArchiveEnabled(Boolean isArchiveEnabled) { - super.withIsArchiveEnabled(isArchiveEnabled); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (taskFilePath() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property taskFilePath in model FileTaskRunRequest")); - } - if (values() != null) { - values().forEach(e -> e.validate()); - } - if (platform() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property platform in model FileTaskRunRequest")); - } else { - platform().validate(); - } - if (agentConfiguration() != null) { - agentConfiguration().validate(); - } - if (credentials() != null) { - credentials().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(FileTaskRunRequest.class); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/FileTaskStep.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/FileTaskStep.java deleted file mode 100644 index 00e02f1150c5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/FileTaskStep.java +++ /dev/null @@ -1,131 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.util.List; - -/** The properties of a task step. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") -@JsonTypeName("FileTask") -@Fluent -public final class FileTaskStep extends TaskStepProperties { - /* - * The task template/definition file path relative to the source context. - */ - @JsonProperty(value = "taskFilePath", required = true) - private String taskFilePath; - - /* - * The task values/parameters file path relative to the source context. - */ - @JsonProperty(value = "valuesFilePath") - private String valuesFilePath; - - /* - * The collection of overridable values that can be passed when running a - * task. - */ - @JsonProperty(value = "values") - private List values; - - /** - * Get the taskFilePath property: The task template/definition file path relative to the source context. - * - * @return the taskFilePath value. - */ - public String taskFilePath() { - return this.taskFilePath; - } - - /** - * Set the taskFilePath property: The task template/definition file path relative to the source context. - * - * @param taskFilePath the taskFilePath value to set. - * @return the FileTaskStep object itself. - */ - public FileTaskStep withTaskFilePath(String taskFilePath) { - this.taskFilePath = taskFilePath; - return this; - } - - /** - * Get the valuesFilePath property: The task values/parameters file path relative to the source context. - * - * @return the valuesFilePath value. - */ - public String valuesFilePath() { - return this.valuesFilePath; - } - - /** - * Set the valuesFilePath property: The task values/parameters file path relative to the source context. - * - * @param valuesFilePath the valuesFilePath value to set. - * @return the FileTaskStep object itself. - */ - public FileTaskStep withValuesFilePath(String valuesFilePath) { - this.valuesFilePath = valuesFilePath; - return this; - } - - /** - * Get the values property: The collection of overridable values that can be passed when running a task. - * - * @return the values value. - */ - public List values() { - return this.values; - } - - /** - * Set the values property: The collection of overridable values that can be passed when running a task. - * - * @param values the values value to set. - * @return the FileTaskStep object itself. - */ - public FileTaskStep withValues(List values) { - this.values = values; - return this; - } - - /** {@inheritDoc} */ - @Override - public FileTaskStep withContextPath(String contextPath) { - super.withContextPath(contextPath); - return this; - } - - /** {@inheritDoc} */ - @Override - public FileTaskStep withContextAccessToken(String contextAccessToken) { - super.withContextAccessToken(contextAccessToken); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (taskFilePath() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property taskFilePath in model FileTaskStep")); - } - if (values() != null) { - values().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(FileTaskStep.class); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/FileTaskStepUpdateParameters.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/FileTaskStepUpdateParameters.java deleted file mode 100644 index fcd85d076c94..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/FileTaskStepUpdateParameters.java +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.util.List; - -/** The properties of updating a task step. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") -@JsonTypeName("FileTask") -@Fluent -public final class FileTaskStepUpdateParameters extends TaskStepUpdateParameters { - /* - * The task template/definition file path relative to the source context. - */ - @JsonProperty(value = "taskFilePath") - private String taskFilePath; - - /* - * The values/parameters file path relative to the source context. - */ - @JsonProperty(value = "valuesFilePath") - private String valuesFilePath; - - /* - * The collection of overridable values that can be passed when running a - * task. - */ - @JsonProperty(value = "values") - private List values; - - /** - * Get the taskFilePath property: The task template/definition file path relative to the source context. - * - * @return the taskFilePath value. - */ - public String taskFilePath() { - return this.taskFilePath; - } - - /** - * Set the taskFilePath property: The task template/definition file path relative to the source context. - * - * @param taskFilePath the taskFilePath value to set. - * @return the FileTaskStepUpdateParameters object itself. - */ - public FileTaskStepUpdateParameters withTaskFilePath(String taskFilePath) { - this.taskFilePath = taskFilePath; - return this; - } - - /** - * Get the valuesFilePath property: The values/parameters file path relative to the source context. - * - * @return the valuesFilePath value. - */ - public String valuesFilePath() { - return this.valuesFilePath; - } - - /** - * Set the valuesFilePath property: The values/parameters file path relative to the source context. - * - * @param valuesFilePath the valuesFilePath value to set. - * @return the FileTaskStepUpdateParameters object itself. - */ - public FileTaskStepUpdateParameters withValuesFilePath(String valuesFilePath) { - this.valuesFilePath = valuesFilePath; - return this; - } - - /** - * Get the values property: The collection of overridable values that can be passed when running a task. - * - * @return the values value. - */ - public List values() { - return this.values; - } - - /** - * Set the values property: The collection of overridable values that can be passed when running a task. - * - * @param values the values value to set. - * @return the FileTaskStepUpdateParameters object itself. - */ - public FileTaskStepUpdateParameters withValues(List values) { - this.values = values; - return this; - } - - /** {@inheritDoc} */ - @Override - public FileTaskStepUpdateParameters withContextPath(String contextPath) { - super.withContextPath(contextPath); - return this; - } - - /** {@inheritDoc} */ - @Override - public FileTaskStepUpdateParameters withContextAccessToken(String contextAccessToken) { - super.withContextAccessToken(contextAccessToken); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (values() != null) { - values().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/IdentityProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/IdentityProperties.java deleted file mode 100644 index 8e8ebf78734f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/IdentityProperties.java +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** Managed identity for the resource. */ -@Fluent -public final class IdentityProperties { - /* - * The principal ID of resource identity. - */ - @JsonProperty(value = "principalId") - private String principalId; - - /* - * The tenant ID of resource. - */ - @JsonProperty(value = "tenantId") - private String tenantId; - - /* - * The identity type. - */ - @JsonProperty(value = "type") - private ResourceIdentityType type; - - /* - * The list of user identities associated with the resource. The user - * identity - * dictionary key references will be ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/ - * providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - */ - @JsonProperty(value = "userAssignedIdentities") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map userAssignedIdentities; - - /** - * Get the principalId property: The principal ID of resource identity. - * - * @return the principalId value. - */ - public String principalId() { - return this.principalId; - } - - /** - * Set the principalId property: The principal ID of resource identity. - * - * @param principalId the principalId value to set. - * @return the IdentityProperties object itself. - */ - public IdentityProperties withPrincipalId(String principalId) { - this.principalId = principalId; - return this; - } - - /** - * Get the tenantId property: The tenant ID of resource. - * - * @return the tenantId value. - */ - public String tenantId() { - return this.tenantId; - } - - /** - * Set the tenantId property: The tenant ID of resource. - * - * @param tenantId the tenantId value to set. - * @return the IdentityProperties object itself. - */ - public IdentityProperties withTenantId(String tenantId) { - this.tenantId = tenantId; - return this; - } - - /** - * Get the type property: The identity type. - * - * @return the type value. - */ - public ResourceIdentityType type() { - return this.type; - } - - /** - * Set the type property: The identity type. - * - * @param type the type value to set. - * @return the IdentityProperties object itself. - */ - public IdentityProperties withType(ResourceIdentityType type) { - this.type = type; - return this; - } - - /** - * Get the userAssignedIdentities property: The list of user identities associated with the resource. The user - * identity dictionary key references will be ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/ - * providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - * - * @return the userAssignedIdentities value. - */ - public Map userAssignedIdentities() { - return this.userAssignedIdentities; - } - - /** - * Set the userAssignedIdentities property: The list of user identities associated with the resource. The user - * identity dictionary key references will be ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/ - * providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - * - * @param userAssignedIdentities the userAssignedIdentities value to set. - * @return the IdentityProperties object itself. - */ - public IdentityProperties withUserAssignedIdentities(Map userAssignedIdentities) { - this.userAssignedIdentities = userAssignedIdentities; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (userAssignedIdentities() != null) { - userAssignedIdentities() - .values() - .forEach( - e -> { - if (e != null) { - e.validate(); - } - }); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/ImageDescriptor.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/ImageDescriptor.java deleted file mode 100644 index 0dacec1d7cf7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/ImageDescriptor.java +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Properties for a registry image. */ -@Fluent -public final class ImageDescriptor { - /* - * The registry login server. - */ - @JsonProperty(value = "registry") - private String registry; - - /* - * The repository name. - */ - @JsonProperty(value = "repository") - private String repository; - - /* - * The tag name. - */ - @JsonProperty(value = "tag") - private String tag; - - /* - * The sha256-based digest of the image manifest. - */ - @JsonProperty(value = "digest") - private String digest; - - /** - * Get the registry property: The registry login server. - * - * @return the registry value. - */ - public String registry() { - return this.registry; - } - - /** - * Set the registry property: The registry login server. - * - * @param registry the registry value to set. - * @return the ImageDescriptor object itself. - */ - public ImageDescriptor withRegistry(String registry) { - this.registry = registry; - return this; - } - - /** - * Get the repository property: The repository name. - * - * @return the repository value. - */ - public String repository() { - return this.repository; - } - - /** - * Set the repository property: The repository name. - * - * @param repository the repository value to set. - * @return the ImageDescriptor object itself. - */ - public ImageDescriptor withRepository(String repository) { - this.repository = repository; - return this; - } - - /** - * Get the tag property: The tag name. - * - * @return the tag value. - */ - public String tag() { - return this.tag; - } - - /** - * Set the tag property: The tag name. - * - * @param tag the tag value to set. - * @return the ImageDescriptor object itself. - */ - public ImageDescriptor withTag(String tag) { - this.tag = tag; - return this; - } - - /** - * Get the digest property: The sha256-based digest of the image manifest. - * - * @return the digest value. - */ - public String digest() { - return this.digest; - } - - /** - * Set the digest property: The sha256-based digest of the image manifest. - * - * @param digest the digest value to set. - * @return the ImageDescriptor object itself. - */ - public ImageDescriptor withDigest(String digest) { - this.digest = digest; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/ImageUpdateTrigger.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/ImageUpdateTrigger.java deleted file mode 100644 index 4f63814868d0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/ImageUpdateTrigger.java +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; - -/** The image update trigger that caused a build. */ -@Fluent -public final class ImageUpdateTrigger { - /* - * The unique ID of the trigger. - */ - @JsonProperty(value = "id") - private String id; - - /* - * The timestamp when the image update happened. - */ - @JsonProperty(value = "timestamp") - private OffsetDateTime timestamp; - - /* - * The list of image updates that caused the build. - */ - @JsonProperty(value = "images") - private List images; - - /** - * Get the id property: The unique ID of the trigger. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: The unique ID of the trigger. - * - * @param id the id value to set. - * @return the ImageUpdateTrigger object itself. - */ - public ImageUpdateTrigger withId(String id) { - this.id = id; - return this; - } - - /** - * Get the timestamp property: The timestamp when the image update happened. - * - * @return the timestamp value. - */ - public OffsetDateTime timestamp() { - return this.timestamp; - } - - /** - * Set the timestamp property: The timestamp when the image update happened. - * - * @param timestamp the timestamp value to set. - * @return the ImageUpdateTrigger object itself. - */ - public ImageUpdateTrigger withTimestamp(OffsetDateTime timestamp) { - this.timestamp = timestamp; - return this; - } - - /** - * Get the images property: The list of image updates that caused the build. - * - * @return the images value. - */ - public List images() { - return this.images; - } - - /** - * Set the images property: The list of image updates that caused the build. - * - * @param images the images value to set. - * @return the ImageUpdateTrigger object itself. - */ - public ImageUpdateTrigger withImages(List images) { - this.images = images; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (images() != null) { - images().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/ImportImageParameters.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/ImportImageParameters.java deleted file mode 100644 index 6140200f7b7a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/ImportImageParameters.java +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The ImportImageParameters model. */ -@Fluent -public final class ImportImageParameters { - /* - * The source of the image. - */ - @JsonProperty(value = "source", required = true) - private ImportSource source; - - /* - * List of strings of the form repo[:tag]. When tag is omitted the source - * will be used (or 'latest' if source tag is also omitted). - */ - @JsonProperty(value = "targetTags") - private List targetTags; - - /* - * List of strings of repository names to do a manifest only copy. No tag - * will be created. - */ - @JsonProperty(value = "untaggedTargetRepositories") - private List untaggedTargetRepositories; - - /* - * When Force, any existing target tags will be overwritten. When NoForce, - * any existing target tags will fail the operation before any copying - * begins. - */ - @JsonProperty(value = "mode") - private ImportMode mode; - - /** - * Get the source property: The source of the image. - * - * @return the source value. - */ - public ImportSource source() { - return this.source; - } - - /** - * Set the source property: The source of the image. - * - * @param source the source value to set. - * @return the ImportImageParameters object itself. - */ - public ImportImageParameters withSource(ImportSource source) { - this.source = source; - return this; - } - - /** - * Get the targetTags property: List of strings of the form repo[:tag]. When tag is omitted the source will be used - * (or 'latest' if source tag is also omitted). - * - * @return the targetTags value. - */ - public List targetTags() { - return this.targetTags; - } - - /** - * Set the targetTags property: List of strings of the form repo[:tag]. When tag is omitted the source will be used - * (or 'latest' if source tag is also omitted). - * - * @param targetTags the targetTags value to set. - * @return the ImportImageParameters object itself. - */ - public ImportImageParameters withTargetTags(List targetTags) { - this.targetTags = targetTags; - return this; - } - - /** - * Get the untaggedTargetRepositories property: List of strings of repository names to do a manifest only copy. No - * tag will be created. - * - * @return the untaggedTargetRepositories value. - */ - public List untaggedTargetRepositories() { - return this.untaggedTargetRepositories; - } - - /** - * Set the untaggedTargetRepositories property: List of strings of repository names to do a manifest only copy. No - * tag will be created. - * - * @param untaggedTargetRepositories the untaggedTargetRepositories value to set. - * @return the ImportImageParameters object itself. - */ - public ImportImageParameters withUntaggedTargetRepositories(List untaggedTargetRepositories) { - this.untaggedTargetRepositories = untaggedTargetRepositories; - return this; - } - - /** - * Get the mode property: When Force, any existing target tags will be overwritten. When NoForce, any existing - * target tags will fail the operation before any copying begins. - * - * @return the mode value. - */ - public ImportMode mode() { - return this.mode; - } - - /** - * Set the mode property: When Force, any existing target tags will be overwritten. When NoForce, any existing - * target tags will fail the operation before any copying begins. - * - * @param mode the mode value to set. - * @return the ImportImageParameters object itself. - */ - public ImportImageParameters withMode(ImportMode mode) { - this.mode = mode; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (source() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property source in model ImportImageParameters")); - } else { - source().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ImportImageParameters.class); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/ImportMode.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/ImportMode.java deleted file mode 100644 index 1cb53cf8e813..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/ImportMode.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ImportMode. */ -public final class ImportMode extends ExpandableStringEnum { - /** Static value NoForce for ImportMode. */ - public static final ImportMode NO_FORCE = fromString("NoForce"); - - /** Static value Force for ImportMode. */ - public static final ImportMode FORCE = fromString("Force"); - - /** - * Creates or finds a ImportMode from its string representation. - * - * @param name a name to look for. - * @return the corresponding ImportMode. - */ - @JsonCreator - public static ImportMode fromString(String name) { - return fromString(name, ImportMode.class); - } - - /** - * Gets known ImportMode values. - * - * @return known ImportMode values. - */ - public static Collection values() { - return values(ImportMode.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/ImportSource.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/ImportSource.java deleted file mode 100644 index be9d97c9d139..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/ImportSource.java +++ /dev/null @@ -1,144 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The ImportSource model. */ -@Fluent -public final class ImportSource { - /* - * The resource identifier of the source Azure Container Registry. - */ - @JsonProperty(value = "resourceId") - private String resourceId; - - /* - * The address of the source registry (e.g. 'mcr.microsoft.com'). - */ - @JsonProperty(value = "registryUri") - private String registryUri; - - /* - * Credentials used when importing from a registry uri. - */ - @JsonProperty(value = "credentials") - private ImportSourceCredentials credentials; - - /* - * Repository name of the source image. - * Specify an image by repository ('hello-world'). This will use the - * 'latest' tag. - * Specify an image by tag ('hello-world:latest'). - * Specify an image by sha256-based manifest digest - * ('hello-world@sha256:abc123'). - */ - @JsonProperty(value = "sourceImage", required = true) - private String sourceImage; - - /** - * Get the resourceId property: The resource identifier of the source Azure Container Registry. - * - * @return the resourceId value. - */ - public String resourceId() { - return this.resourceId; - } - - /** - * Set the resourceId property: The resource identifier of the source Azure Container Registry. - * - * @param resourceId the resourceId value to set. - * @return the ImportSource object itself. - */ - public ImportSource withResourceId(String resourceId) { - this.resourceId = resourceId; - return this; - } - - /** - * Get the registryUri property: The address of the source registry (e.g. 'mcr.microsoft.com'). - * - * @return the registryUri value. - */ - public String registryUri() { - return this.registryUri; - } - - /** - * Set the registryUri property: The address of the source registry (e.g. 'mcr.microsoft.com'). - * - * @param registryUri the registryUri value to set. - * @return the ImportSource object itself. - */ - public ImportSource withRegistryUri(String registryUri) { - this.registryUri = registryUri; - return this; - } - - /** - * Get the credentials property: Credentials used when importing from a registry uri. - * - * @return the credentials value. - */ - public ImportSourceCredentials credentials() { - return this.credentials; - } - - /** - * Set the credentials property: Credentials used when importing from a registry uri. - * - * @param credentials the credentials value to set. - * @return the ImportSource object itself. - */ - public ImportSource withCredentials(ImportSourceCredentials credentials) { - this.credentials = credentials; - return this; - } - - /** - * Get the sourceImage property: Repository name of the source image. Specify an image by repository - * ('hello-world'). This will use the 'latest' tag. Specify an image by tag ('hello-world:latest'). Specify an image - * by sha256-based manifest digest ('hello-world@sha256:abc123'). - * - * @return the sourceImage value. - */ - public String sourceImage() { - return this.sourceImage; - } - - /** - * Set the sourceImage property: Repository name of the source image. Specify an image by repository - * ('hello-world'). This will use the 'latest' tag. Specify an image by tag ('hello-world:latest'). Specify an image - * by sha256-based manifest digest ('hello-world@sha256:abc123'). - * - * @param sourceImage the sourceImage value to set. - * @return the ImportSource object itself. - */ - public ImportSource withSourceImage(String sourceImage) { - this.sourceImage = sourceImage; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (credentials() != null) { - credentials().validate(); - } - if (sourceImage() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property sourceImage in model ImportSource")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ImportSource.class); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/ImportSourceCredentials.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/ImportSourceCredentials.java deleted file mode 100644 index 3d9b028d68b3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/ImportSourceCredentials.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The ImportSourceCredentials model. */ -@Fluent -public final class ImportSourceCredentials { - /* - * The username to authenticate with the source registry. - */ - @JsonProperty(value = "username") - private String username; - - /* - * The password used to authenticate with the source registry. - */ - @JsonProperty(value = "password", required = true) - private String password; - - /** - * Get the username property: The username to authenticate with the source registry. - * - * @return the username value. - */ - public String username() { - return this.username; - } - - /** - * Set the username property: The username to authenticate with the source registry. - * - * @param username the username value to set. - * @return the ImportSourceCredentials object itself. - */ - public ImportSourceCredentials withUsername(String username) { - this.username = username; - return this; - } - - /** - * Get the password property: The password used to authenticate with the source registry. - * - * @return the password value. - */ - public String password() { - return this.password; - } - - /** - * Set the password property: The password used to authenticate with the source registry. - * - * @param password the password value to set. - * @return the ImportSourceCredentials object itself. - */ - public ImportSourceCredentials withPassword(String password) { - this.password = password; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (password() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property password in model ImportSourceCredentials")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ImportSourceCredentials.class); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/IpRule.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/IpRule.java deleted file mode 100644 index 942f73aa1c1c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/IpRule.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** IP rule with specific IP or IP range in CIDR format. */ -@Fluent -public final class IpRule { - /* - * The action of IP ACL rule. - */ - @JsonProperty(value = "action") - private Action action; - - /* - * Specifies the IP or IP range in CIDR format. Only IPV4 address is - * allowed. - */ - @JsonProperty(value = "value", required = true) - private String ipAddressOrRange; - - /** - * Get the action property: The action of IP ACL rule. - * - * @return the action value. - */ - public Action action() { - return this.action; - } - - /** - * Set the action property: The action of IP ACL rule. - * - * @param action the action value to set. - * @return the IpRule object itself. - */ - public IpRule withAction(Action action) { - this.action = action; - return this; - } - - /** - * Get the ipAddressOrRange property: Specifies the IP or IP range in CIDR format. Only IPV4 address is allowed. - * - * @return the ipAddressOrRange value. - */ - public String ipAddressOrRange() { - return this.ipAddressOrRange; - } - - /** - * Set the ipAddressOrRange property: Specifies the IP or IP range in CIDR format. Only IPV4 address is allowed. - * - * @param ipAddressOrRange the ipAddressOrRange value to set. - * @return the IpRule object itself. - */ - public IpRule withIpAddressOrRange(String ipAddressOrRange) { - this.ipAddressOrRange = ipAddressOrRange; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (ipAddressOrRange() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property ipAddressOrRange in model IpRule")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(IpRule.class); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/NetworkRuleSet.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/NetworkRuleSet.java deleted file mode 100644 index 3c31c250dfdc..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/NetworkRuleSet.java +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The network rule set for a container registry. */ -@Fluent -public final class NetworkRuleSet { - /* - * The default action of allow or deny when no other rules match. - */ - @JsonProperty(value = "defaultAction", required = true) - private DefaultAction defaultAction; - - /* - * The virtual network rules. - */ - @JsonProperty(value = "virtualNetworkRules") - private List virtualNetworkRules; - - /* - * The IP ACL rules. - */ - @JsonProperty(value = "ipRules") - private List ipRules; - - /** - * Get the defaultAction property: The default action of allow or deny when no other rules match. - * - * @return the defaultAction value. - */ - public DefaultAction defaultAction() { - return this.defaultAction; - } - - /** - * Set the defaultAction property: The default action of allow or deny when no other rules match. - * - * @param defaultAction the defaultAction value to set. - * @return the NetworkRuleSet object itself. - */ - public NetworkRuleSet withDefaultAction(DefaultAction defaultAction) { - this.defaultAction = defaultAction; - return this; - } - - /** - * Get the virtualNetworkRules property: The virtual network rules. - * - * @return the virtualNetworkRules value. - */ - public List virtualNetworkRules() { - return this.virtualNetworkRules; - } - - /** - * Set the virtualNetworkRules property: The virtual network rules. - * - * @param virtualNetworkRules the virtualNetworkRules value to set. - * @return the NetworkRuleSet object itself. - */ - public NetworkRuleSet withVirtualNetworkRules(List virtualNetworkRules) { - this.virtualNetworkRules = virtualNetworkRules; - return this; - } - - /** - * Get the ipRules property: The IP ACL rules. - * - * @return the ipRules value. - */ - public List ipRules() { - return this.ipRules; - } - - /** - * Set the ipRules property: The IP ACL rules. - * - * @param ipRules the ipRules value to set. - * @return the NetworkRuleSet object itself. - */ - public NetworkRuleSet withIpRules(List ipRules) { - this.ipRules = ipRules; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (defaultAction() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property defaultAction in model NetworkRuleSet")); - } - if (virtualNetworkRules() != null) { - virtualNetworkRules().forEach(e -> e.validate()); - } - if (ipRules() != null) { - ipRules().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(NetworkRuleSet.class); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/OS.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/OS.java deleted file mode 100644 index ada13dac32cb..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/OS.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for OS. */ -public final class OS extends ExpandableStringEnum { - /** Static value Windows for OS. */ - public static final OS WINDOWS = fromString("Windows"); - - /** Static value Linux for OS. */ - public static final OS LINUX = fromString("Linux"); - - /** - * Creates or finds a OS from its string representation. - * - * @param name a name to look for. - * @return the corresponding OS. - */ - @JsonCreator - public static OS fromString(String name) { - return fromString(name, OS.class); - } - - /** - * Gets known OS values. - * - * @return known OS values. - */ - public static Collection values() { - return values(OS.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/OperationDisplayDefinition.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/OperationDisplayDefinition.java deleted file mode 100644 index bb85919dc356..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/OperationDisplayDefinition.java +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The display information for a container registry operation. */ -@Fluent -public final class OperationDisplayDefinition { - /* - * The resource provider name: Microsoft.ContainerRegistry. - */ - @JsonProperty(value = "provider") - private String provider; - - /* - * The resource on which the operation is performed. - */ - @JsonProperty(value = "resource") - private String resource; - - /* - * The operation that users can perform. - */ - @JsonProperty(value = "operation") - private String operation; - - /* - * The description for the operation. - */ - @JsonProperty(value = "description") - private String description; - - /** - * Get the provider property: The resource provider name: Microsoft.ContainerRegistry. - * - * @return the provider value. - */ - public String provider() { - return this.provider; - } - - /** - * Set the provider property: The resource provider name: Microsoft.ContainerRegistry. - * - * @param provider the provider value to set. - * @return the OperationDisplayDefinition object itself. - */ - public OperationDisplayDefinition withProvider(String provider) { - this.provider = provider; - return this; - } - - /** - * Get the resource property: The resource on which the operation is performed. - * - * @return the resource value. - */ - public String resource() { - return this.resource; - } - - /** - * Set the resource property: The resource on which the operation is performed. - * - * @param resource the resource value to set. - * @return the OperationDisplayDefinition object itself. - */ - public OperationDisplayDefinition withResource(String resource) { - this.resource = resource; - return this; - } - - /** - * Get the operation property: The operation that users can perform. - * - * @return the operation value. - */ - public String operation() { - return this.operation; - } - - /** - * Set the operation property: The operation that users can perform. - * - * @param operation the operation value to set. - * @return the OperationDisplayDefinition object itself. - */ - public OperationDisplayDefinition withOperation(String operation) { - this.operation = operation; - return this; - } - - /** - * Get the description property: The description for the operation. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: The description for the operation. - * - * @param description the description value to set. - * @return the OperationDisplayDefinition object itself. - */ - public OperationDisplayDefinition withDescription(String description) { - this.description = description; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/OperationListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/OperationListResult.java deleted file mode 100644 index 326e7649eae1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/OperationListResult.java +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.containerregistry.fluent.models.OperationDefinitionInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The result of a request to list container registry operations. */ -@Fluent -public final class OperationListResult { - /* - * The list of container registry operations. Since this list may be - * incomplete, the nextLink field should be used to request the next list - * of operations. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URI that can be used to request the next list of container registry - * operations. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: The list of container registry operations. Since this list may be incomplete, the - * nextLink field should be used to request the next list of operations. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The list of container registry operations. Since this list may be incomplete, the - * nextLink field should be used to request the next list of operations. - * - * @param value the value value to set. - * @return the OperationListResult object itself. - */ - public OperationListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URI that can be used to request the next list of container registry operations. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The URI that can be used to request the next list of container registry operations. - * - * @param nextLink the nextLink value to set. - * @return the OperationListResult object itself. - */ - public OperationListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/OperationMetricSpecificationDefinition.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/OperationMetricSpecificationDefinition.java deleted file mode 100644 index 7471ba51efa5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/OperationMetricSpecificationDefinition.java +++ /dev/null @@ -1,176 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The definition of Azure Monitoring metric. */ -@Fluent -public final class OperationMetricSpecificationDefinition { - /* - * Metric name. - */ - @JsonProperty(value = "name") - private String name; - - /* - * Metric display name. - */ - @JsonProperty(value = "displayName") - private String displayName; - - /* - * Metric description. - */ - @JsonProperty(value = "displayDescription") - private String displayDescription; - - /* - * Metric unit. - */ - @JsonProperty(value = "unit") - private String unit; - - /* - * Metric aggregation type. - */ - @JsonProperty(value = "aggregationType") - private String aggregationType; - - /* - * Internal metric name. - */ - @JsonProperty(value = "internalMetricName") - private String internalMetricName; - - /** - * Get the name property: Metric name. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Metric name. - * - * @param name the name value to set. - * @return the OperationMetricSpecificationDefinition object itself. - */ - public OperationMetricSpecificationDefinition withName(String name) { - this.name = name; - return this; - } - - /** - * Get the displayName property: Metric display name. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Set the displayName property: Metric display name. - * - * @param displayName the displayName value to set. - * @return the OperationMetricSpecificationDefinition object itself. - */ - public OperationMetricSpecificationDefinition withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - - /** - * Get the displayDescription property: Metric description. - * - * @return the displayDescription value. - */ - public String displayDescription() { - return this.displayDescription; - } - - /** - * Set the displayDescription property: Metric description. - * - * @param displayDescription the displayDescription value to set. - * @return the OperationMetricSpecificationDefinition object itself. - */ - public OperationMetricSpecificationDefinition withDisplayDescription(String displayDescription) { - this.displayDescription = displayDescription; - return this; - } - - /** - * Get the unit property: Metric unit. - * - * @return the unit value. - */ - public String unit() { - return this.unit; - } - - /** - * Set the unit property: Metric unit. - * - * @param unit the unit value to set. - * @return the OperationMetricSpecificationDefinition object itself. - */ - public OperationMetricSpecificationDefinition withUnit(String unit) { - this.unit = unit; - return this; - } - - /** - * Get the aggregationType property: Metric aggregation type. - * - * @return the aggregationType value. - */ - public String aggregationType() { - return this.aggregationType; - } - - /** - * Set the aggregationType property: Metric aggregation type. - * - * @param aggregationType the aggregationType value to set. - * @return the OperationMetricSpecificationDefinition object itself. - */ - public OperationMetricSpecificationDefinition withAggregationType(String aggregationType) { - this.aggregationType = aggregationType; - return this; - } - - /** - * Get the internalMetricName property: Internal metric name. - * - * @return the internalMetricName value. - */ - public String internalMetricName() { - return this.internalMetricName; - } - - /** - * Set the internalMetricName property: Internal metric name. - * - * @param internalMetricName the internalMetricName value to set. - * @return the OperationMetricSpecificationDefinition object itself. - */ - public OperationMetricSpecificationDefinition withInternalMetricName(String internalMetricName) { - this.internalMetricName = internalMetricName; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/OperationServiceSpecificationDefinition.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/OperationServiceSpecificationDefinition.java deleted file mode 100644 index 73d9a8f52d1f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/OperationServiceSpecificationDefinition.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The definition of Azure Monitoring list. */ -@Fluent -public final class OperationServiceSpecificationDefinition { - /* - * A list of Azure Monitoring metrics definition. - */ - @JsonProperty(value = "metricSpecifications") - private List metricSpecifications; - - /** - * Get the metricSpecifications property: A list of Azure Monitoring metrics definition. - * - * @return the metricSpecifications value. - */ - public List metricSpecifications() { - return this.metricSpecifications; - } - - /** - * Set the metricSpecifications property: A list of Azure Monitoring metrics definition. - * - * @param metricSpecifications the metricSpecifications value to set. - * @return the OperationServiceSpecificationDefinition object itself. - */ - public OperationServiceSpecificationDefinition withMetricSpecifications( - List metricSpecifications) { - this.metricSpecifications = metricSpecifications; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (metricSpecifications() != null) { - metricSpecifications().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/OverridingArgument.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/OverridingArgument.java deleted file mode 100644 index 11443ae31413..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/OverridingArgument.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.containerregistry.models; - -/** - * Defines an overriding argument that overrides arguments passed in for RegistryDockerTaskStep and - * RegistryDockerTaskRunRequest. - */ -public class OverridingArgument { - private final String value; - private final boolean isSecret; - - /** - * Constructor that defines an OverridingArgument. - * - * @param value the value of the overriding argument. - * @param isSecret whether the overriding argument will be secret. - */ - public OverridingArgument(String value, boolean isSecret) { - this.value = value; - this.isSecret = isSecret; - } - - /** @return the value of the overriding argument. */ - public String value() { - return this.value; - } - - /** @return whether the overriding argument is secret or not. */ - public boolean isSecret() { - return this.isSecret; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/OverridingValue.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/OverridingValue.java deleted file mode 100644 index 45c8f56957f6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/OverridingValue.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.containerregistry.models; - -/** - * Defines an overriding value that overrides values passed in for RegistryFileTaskStep, RegistryFileTaskRunRequest, - * RegistryEncodedTaskStep, and RegistryEncodedTaskRunRequest. - */ -public class OverridingValue { - private final String value; - private final boolean isSecret; - - /** - * Constructor that defines an OverridingValue. - * - * @param value the value of the overriding value. - * @param isSecret whether the overriding value will be secret. - */ - public OverridingValue(String value, boolean isSecret) { - this.value = value; - this.isSecret = isSecret; - } - - /** @return the value of the overriding value. */ - public String value() { - return this.value; - } - - /** @return whether the overriding value is secret or not. */ - public boolean isSecret() { - return this.isSecret; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/PasswordName.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/PasswordName.java deleted file mode 100644 index ea39504693a9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/PasswordName.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for PasswordName. */ -public enum PasswordName { - /** Enum value password. */ - PASSWORD("password"), - - /** Enum value password2. */ - PASSWORD2("password2"); - - /** The actual serialized value for a PasswordName instance. */ - private final String value; - - PasswordName(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a PasswordName instance. - * - * @param value the serialized value to parse. - * @return the parsed PasswordName object, or null if unable to parse. - */ - @JsonCreator - public static PasswordName fromString(String value) { - PasswordName[] items = PasswordName.values(); - for (PasswordName item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/PlatformProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/PlatformProperties.java deleted file mode 100644 index 996025321ee0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/PlatformProperties.java +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The platform properties against which the run has to happen. */ -@Fluent -public final class PlatformProperties { - /* - * The operating system type required for the run. - */ - @JsonProperty(value = "os", required = true) - private OS os; - - /* - * The OS architecture. - */ - @JsonProperty(value = "architecture") - private Architecture architecture; - - /* - * Variant of the CPU. - */ - @JsonProperty(value = "variant") - private Variant variant; - - /** - * Get the os property: The operating system type required for the run. - * - * @return the os value. - */ - public OS os() { - return this.os; - } - - /** - * Set the os property: The operating system type required for the run. - * - * @param os the os value to set. - * @return the PlatformProperties object itself. - */ - public PlatformProperties withOs(OS os) { - this.os = os; - return this; - } - - /** - * Get the architecture property: The OS architecture. - * - * @return the architecture value. - */ - public Architecture architecture() { - return this.architecture; - } - - /** - * Set the architecture property: The OS architecture. - * - * @param architecture the architecture value to set. - * @return the PlatformProperties object itself. - */ - public PlatformProperties withArchitecture(Architecture architecture) { - this.architecture = architecture; - return this; - } - - /** - * Get the variant property: Variant of the CPU. - * - * @return the variant value. - */ - public Variant variant() { - return this.variant; - } - - /** - * Set the variant property: Variant of the CPU. - * - * @param variant the variant value to set. - * @return the PlatformProperties object itself. - */ - public PlatformProperties withVariant(Variant variant) { - this.variant = variant; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (os() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property os in model PlatformProperties")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(PlatformProperties.class); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/PlatformUpdateParameters.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/PlatformUpdateParameters.java deleted file mode 100644 index 41356841f863..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/PlatformUpdateParameters.java +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The properties for updating the platform configuration. */ -@Fluent -public final class PlatformUpdateParameters { - /* - * The operating system type required for the run. - */ - @JsonProperty(value = "os") - private OS os; - - /* - * The OS architecture. - */ - @JsonProperty(value = "architecture") - private Architecture architecture; - - /* - * Variant of the CPU. - */ - @JsonProperty(value = "variant") - private Variant variant; - - /** - * Get the os property: The operating system type required for the run. - * - * @return the os value. - */ - public OS os() { - return this.os; - } - - /** - * Set the os property: The operating system type required for the run. - * - * @param os the os value to set. - * @return the PlatformUpdateParameters object itself. - */ - public PlatformUpdateParameters withOs(OS os) { - this.os = os; - return this; - } - - /** - * Get the architecture property: The OS architecture. - * - * @return the architecture value. - */ - public Architecture architecture() { - return this.architecture; - } - - /** - * Set the architecture property: The OS architecture. - * - * @param architecture the architecture value to set. - * @return the PlatformUpdateParameters object itself. - */ - public PlatformUpdateParameters withArchitecture(Architecture architecture) { - this.architecture = architecture; - return this; - } - - /** - * Get the variant property: Variant of the CPU. - * - * @return the variant value. - */ - public Variant variant() { - return this.variant; - } - - /** - * Set the variant property: Variant of the CPU. - * - * @param variant the variant value to set. - * @return the PlatformUpdateParameters object itself. - */ - public PlatformUpdateParameters withVariant(Variant variant) { - this.variant = variant; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/Policies.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/Policies.java deleted file mode 100644 index 188c8e34c0bf..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/Policies.java +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The policies for a container registry. */ -@Fluent -public final class Policies { - /* - * The quarantine policy for a container registry. - */ - @JsonProperty(value = "quarantinePolicy") - private QuarantinePolicy quarantinePolicy; - - /* - * The content trust policy for a container registry. - */ - @JsonProperty(value = "trustPolicy") - private TrustPolicy trustPolicy; - - /* - * The retention policy for a container registry. - */ - @JsonProperty(value = "retentionPolicy") - private RetentionPolicy retentionPolicy; - - /** - * Get the quarantinePolicy property: The quarantine policy for a container registry. - * - * @return the quarantinePolicy value. - */ - public QuarantinePolicy quarantinePolicy() { - return this.quarantinePolicy; - } - - /** - * Set the quarantinePolicy property: The quarantine policy for a container registry. - * - * @param quarantinePolicy the quarantinePolicy value to set. - * @return the Policies object itself. - */ - public Policies withQuarantinePolicy(QuarantinePolicy quarantinePolicy) { - this.quarantinePolicy = quarantinePolicy; - return this; - } - - /** - * Get the trustPolicy property: The content trust policy for a container registry. - * - * @return the trustPolicy value. - */ - public TrustPolicy trustPolicy() { - return this.trustPolicy; - } - - /** - * Set the trustPolicy property: The content trust policy for a container registry. - * - * @param trustPolicy the trustPolicy value to set. - * @return the Policies object itself. - */ - public Policies withTrustPolicy(TrustPolicy trustPolicy) { - this.trustPolicy = trustPolicy; - return this; - } - - /** - * Get the retentionPolicy property: The retention policy for a container registry. - * - * @return the retentionPolicy value. - */ - public RetentionPolicy retentionPolicy() { - return this.retentionPolicy; - } - - /** - * Set the retentionPolicy property: The retention policy for a container registry. - * - * @param retentionPolicy the retentionPolicy value to set. - * @return the Policies object itself. - */ - public Policies withRetentionPolicy(RetentionPolicy retentionPolicy) { - this.retentionPolicy = retentionPolicy; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (quarantinePolicy() != null) { - quarantinePolicy().validate(); - } - if (trustPolicy() != null) { - trustPolicy().validate(); - } - if (retentionPolicy() != null) { - retentionPolicy().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/PolicyStatus.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/PolicyStatus.java deleted file mode 100644 index 2f1072b5e050..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/PolicyStatus.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for PolicyStatus. */ -public final class PolicyStatus extends ExpandableStringEnum { - /** Static value enabled for PolicyStatus. */ - public static final PolicyStatus ENABLED = fromString("enabled"); - - /** Static value disabled for PolicyStatus. */ - public static final PolicyStatus DISABLED = fromString("disabled"); - - /** - * Creates or finds a PolicyStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding PolicyStatus. - */ - @JsonCreator - public static PolicyStatus fromString(String name) { - return fromString(name, PolicyStatus.class); - } - - /** - * Gets known PolicyStatus values. - * - * @return known PolicyStatus values. - */ - public static Collection values() { - return values(PolicyStatus.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/ProvisioningState.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/ProvisioningState.java deleted file mode 100644 index af6b286d0a88..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/ProvisioningState.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ProvisioningState. */ -public final class ProvisioningState extends ExpandableStringEnum { - /** Static value Creating for ProvisioningState. */ - public static final ProvisioningState CREATING = fromString("Creating"); - - /** Static value Updating for ProvisioningState. */ - public static final ProvisioningState UPDATING = fromString("Updating"); - - /** Static value Deleting for ProvisioningState. */ - public static final ProvisioningState DELETING = fromString("Deleting"); - - /** Static value Succeeded for ProvisioningState. */ - public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); - - /** Static value Failed for ProvisioningState. */ - public static final ProvisioningState FAILED = fromString("Failed"); - - /** Static value Canceled for ProvisioningState. */ - public static final ProvisioningState CANCELED = fromString("Canceled"); - - /** - * Creates or finds a ProvisioningState from its string representation. - * - * @param name a name to look for. - * @return the corresponding ProvisioningState. - */ - @JsonCreator - public static ProvisioningState fromString(String name) { - return fromString(name, ProvisioningState.class); - } - - /** - * Gets known ProvisioningState values. - * - * @return known ProvisioningState values. - */ - public static Collection values() { - return values(ProvisioningState.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/QuarantinePolicy.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/QuarantinePolicy.java deleted file mode 100644 index 878e9ab47cde..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/QuarantinePolicy.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The quarantine policy for a container registry. */ -@Fluent -public final class QuarantinePolicy { - /* - * The value that indicates whether the policy is enabled or not. - */ - @JsonProperty(value = "status") - private PolicyStatus status; - - /** - * Get the status property: The value that indicates whether the policy is enabled or not. - * - * @return the status value. - */ - public PolicyStatus status() { - return this.status; - } - - /** - * Set the status property: The value that indicates whether the policy is enabled or not. - * - * @param status the status value to set. - * @return the QuarantinePolicy object itself. - */ - public QuarantinePolicy withStatus(PolicyStatus status) { - this.status = status; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RegenerateCredentialParameters.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RegenerateCredentialParameters.java deleted file mode 100644 index b027f1167833..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RegenerateCredentialParameters.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The parameters used to regenerate the login credential. */ -@Fluent -public final class RegenerateCredentialParameters { - /* - * Specifies name of the password which should be regenerated -- password - * or password2. - */ - @JsonProperty(value = "name", required = true) - private PasswordName name; - - /** - * Get the name property: Specifies name of the password which should be regenerated -- password or password2. - * - * @return the name value. - */ - public PasswordName name() { - return this.name; - } - - /** - * Set the name property: Specifies name of the password which should be regenerated -- password or password2. - * - * @param name the name value to set. - * @return the RegenerateCredentialParameters object itself. - */ - public RegenerateCredentialParameters withName(PasswordName name) { - this.name = name; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property name in model RegenerateCredentialParameters")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(RegenerateCredentialParameters.class); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/Registries.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/Registries.java deleted file mode 100644 index 666d2ab5505d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/Registries.java +++ /dev/null @@ -1,194 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.containerregistry.ContainerRegistryManager; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsDeletingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsListingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsBatchCreation; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsCreating; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingById; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; -import reactor.core.publisher.Mono; - -import java.util.Collection; - -/** Entry point to the registry management API. */ -@Fluent() -public interface Registries - extends SupportsCreating, - HasManager, - SupportsBatchCreation, - SupportsGettingById, - SupportsDeletingById, - SupportsDeletingByResourceGroup, - SupportsListingByResourceGroup, - SupportsGettingByResourceGroup, - SupportsListing { - - /** - * Gets the login credentials for the specified container registry. - * - * @param resourceGroupName the resource group name - * @param registryName the registry name - * @return the container registry's login credentials - */ - RegistryCredentials getCredentials(String resourceGroupName, String registryName); - - /** - * Gets the login credentials for the specified container registry. - * - * @param resourceGroupName the resource group name - * @param registryName the registry name - * @return a representation of the future computation of this call, returning the container registry's login - * credentials - */ - Mono getCredentialsAsync(String resourceGroupName, String registryName); - - /** - * Regenerates the value for one of the admin user access key for the specified container registry. - * - * @param resourceGroupName the resource group name - * @param registryName the registry name - * @param accessKeyType the admin user access key name to regenerate the value for - * @return the container registry's login credentials - */ - RegistryCredentials regenerateCredential( - String resourceGroupName, String registryName, AccessKeyType accessKeyType); - - /** - * Regenerates the value for one of the admin user access key for the specified container registry. - * - * @param resourceGroupName the resource group name - * @param registryName the registry name - * @param accessKeyType the admin user access key name to regenerate the value for - * @return a representation of the future computation of this call, returning the container registry's login - * credentials - */ - Mono regenerateCredentialAsync( - String resourceGroupName, String registryName, AccessKeyType accessKeyType); - - /** - * Lists the quota usages for the specified container registry. - * - * @param resourceGroupName the resource group name - * @param registryName the registry name - * @return the list of container registry's quota usages - */ - Collection listQuotaUsages(String resourceGroupName, String registryName); - - /** - * Lists the quota usages for the specified container registry. - * - * @param resourceGroupName the resource group name - * @param registryName the registry name - * @return a representation of the future computation of this call, returning the list of container registry's quota - * usages - */ - PagedFlux listQuotaUsagesAsync(String resourceGroupName, String registryName); - - /** - * Checks if the specified container registry name is valid and available. - * - * @param name the container registry name to check - * @return whether the name is available and other info if not - */ - CheckNameAvailabilityResult checkNameAvailability(String name); - - /** - * Checks if container registry name is valid and is not in use asynchronously. - * - * @param name the container registry name to check - * @return a representation of the future computation of this call, returning whether the name is available or other - * info if not - */ - Mono checkNameAvailabilityAsync(String name); - - /** - * The function that gets the URL of the build source upload. - * - * @param rgName the name of the resource group. - * @param acrName the name of the container. - * @return the URL of the build source upload. - */ - SourceUploadDefinition getBuildSourceUploadUrl(String rgName, String acrName); - - /** - * The function that gets the URL of the build source upload ashnchronously. - * - * @param rgName the name of the resource group. - * @param acrName the name of the container. - * @return the URL of the build source upload. - */ - Mono getBuildSourceUploadUrlAsync(String rgName, String acrName); - - /** @return returns entry point to manage container registry webhooks. */ - WebhooksClient webhooks(); - - /** Grouping of registry webhook actions. */ - interface WebhooksClient { - /** - * Gets the properties of the specified webhook. - * - * @param resourceGroupName the resource group name - * @param registryName the registry name - * @param webhookName the name of the webhook - * @return the Webhook object if successful - */ - Webhook get(String resourceGroupName, String registryName, String webhookName); - - /** - * Gets the properties of the specified webhook. - * - * @param resourceGroupName the resource group name - * @param registryName the registry name - * @param webhookName the name of the webhook - * @return a representation of the future computation of this call, returning the Webhook object - */ - Mono getAsync(String resourceGroupName, String registryName, String webhookName); - - /** - * Deletes a webhook from the container registry. - * - * @param resourceGroupName the resource group name - * @param registryName the registry name - * @param webhookName the name of the webhook - */ - void delete(String resourceGroupName, String registryName, String webhookName); - - /** - * Deletes a webhook from the container registry. - * - * @param resourceGroupName the resource group name - * @param registryName the registry name - * @param webhookName the name of the webhook - * @return a representation of the future computation of this call - */ - Mono deleteAsync(String resourceGroupName, String registryName, String webhookName); - - /** - * Lists all the webhooks for the container registry. - * - * @param resourceGroupName the resource group name - * @param registryName the registry name - * @return the list of all the webhooks for the specified container registry - */ - PagedIterable list(String resourceGroupName, String registryName); - - /** - * Lists all the webhooks for the container registry. - * - * @param resourceGroupName the resource group name - * @param registryName the registry name - * @return a representation of the future computation of this call, returning the list of all the webhooks for - * the specified container registry - */ - PagedFlux listAsync(String resourceGroupName, String registryName); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/Registry.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/Registry.java deleted file mode 100644 index 41598d2c9269..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/Registry.java +++ /dev/null @@ -1,315 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.http.rest.PagedFlux; -import com.azure.resourcemanager.containerregistry.ContainerRegistryManager; -import com.azure.resourcemanager.containerregistry.fluent.models.RegistryInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.GroupableResource; -import com.azure.resourcemanager.resources.fluentcore.arm.models.Resource; -import com.azure.resourcemanager.resources.fluentcore.model.Appliable; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; -import com.azure.resourcemanager.resources.fluentcore.model.Updatable; -import com.azure.resourcemanager.storage.models.StorageAccount; -import java.time.OffsetDateTime; -import java.util.Collection; -import reactor.core.publisher.Mono; - -/** An immutable client-side representation of an Azure registry. */ -@Fluent -public interface Registry - extends GroupableResource, - Refreshable, - Updatable { - - /** @return the SKU of the container registry. */ - Sku sku(); - - /** @return the URL that can be used to log into the container registry */ - String loginServerUrl(); - - /** @return the creation date of the container registry in ISO8601 format */ - OffsetDateTime creationDate(); - - /** @return the value that indicates whether the admin user is enabled */ - boolean adminUserEnabled(); - - /** - * @return the name of the storage account for the container registry; 'null' if container register SKU a managed - * tier - */ - String storageAccountName(); - - /** - * @return the ID of the storage account for the container registry; 'null' if container register SKU a managed tier - */ - String storageAccountId(); - - /** @return the login credentials for the specified container registry */ - RegistryCredentials getCredentials(); - - /** @return a representation of the future computation of this call */ - Mono getCredentialsAsync(); - - /** - * Regenerates one of the login credentials for the specified container registry. - * - * @param accessKeyType the admin user access key name to regenerate the value for - * @return the result of the regeneration - */ - RegistryCredentials regenerateCredential(AccessKeyType accessKeyType); - - /** - * Regenerates one of the login credentials for the specified container registry. - * - * @param accessKeyType the admin user access key name to regenerate the value for - * @return a representation of the future computation of this call - */ - Mono regenerateCredentialAsync(AccessKeyType accessKeyType); - - /** - * Lists the quota usages for the specified container registry. - * - * @return the list of container registry's quota usages - */ - Collection listQuotaUsages(); - - /** - * Lists the quota usages for the specified container registry. - * - * @return a representation of the future computation of this call - */ - PagedFlux listQuotaUsagesAsync(); - - /** @return returns the upload location for the user to be able to upload the source. */ - SourceUploadDefinition getBuildSourceUploadUrl(); - - /** - * Gets the upload location for the user to be able to upload the source asynchronously. - * - * @return a representation of the future computation of this call - */ - Mono getBuildSourceUploadUrlAsync(); - - /** @return returns entry point to manage container registry webhooks. */ - WebhookOperations webhooks(); - - /** - * @return returns entry point to manage the builds such as queued quick builds and queued build tasks for the - * container registry. - */ - // @Beta(SinceVersion.V1_14_0) - // QueuedBuildOperations queuedBuilds(); - - /** @return returns entry point to manage the build tasks for the container registry. */ - // @Beta(SinceVersion.V1_14_0) - // BuildTaskOperations buildTasks(); - - RegistryTaskRun.DefinitionStages.BlankFromRegistry scheduleRun(); - - /** Container interface for all the definitions related to a registry. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithGroup, - DefinitionStages.WithSku, - DefinitionStages.WithStorageAccount, - DefinitionStages.WithCreate { - } - - /** Grouping of registry definition stages. */ - interface DefinitionStages { - /** The first stage of a container registry definition. */ - interface Blank extends GroupableResource.DefinitionWithRegion { - } - - /** The stage of the container service definition allowing to specify the resource group. */ - interface WithGroup extends GroupableResource.DefinitionStages.WithGroup { - } - - /** The stage of the registry definition allowing to specify the SKU type. */ - interface WithSku { - /** - * Creates a container registry with a 'Classic' SKU type. - * - * @return the next stage of the definition - */ - WithStorageAccount withClassicSku(); - - /** - * Creates a 'managed' registry with a 'Basic' SKU type. - * - * @return the next stage of the definition - */ - WithCreate withBasicSku(); - - /** - * Creates a 'managed' registry with a 'Standard' SKU type. - * - * @return the next stage of the definition - */ - WithCreate withStandardSku(); - - /** - * Creates a 'managed' registry with a 'Premium' SKU type. - * - * @return the next stage of the definition - */ - WithCreate withPremiumSku(); - } - - /** The stage of the registry definition allowing to specify the storage account. */ - interface WithStorageAccount { - /** - * The parameters of a storage account for the container registry. - * - *

    If specified, the storage account must be in the same physical location as the container registry. - * - * @param storageAccount the storage account - * @return the next stage - */ - WithCreate withExistingStorageAccount(StorageAccount storageAccount); - - /** - * The ID of an existing storage account for the container registry. - * - *

    If specified, the storage account must be in the same physical location as the container registry. - * - * @param id the resource ID of the storage account; must be in the same physical location as the container - * registry - * @return the next stage - */ - WithCreate withExistingStorageAccount(String id); - - /** - * The parameters for a storage account for the container registry. - * - *

    A new storage account with default setting and specified name will be created. - * - * @param storageAccountName the name of the storage account - * @return the next stage - */ - WithCreate withNewStorageAccount(String storageAccountName); - - /** - * The parameters for a storage account for the container registry. - * - *

    If specified, the storage account must be in the same physical location as the container registry. - * - * @param creatable the storage account to create - * @return the next stage - */ - WithCreate withNewStorageAccount(Creatable creatable); - } - - /** The stage of the registry definition allowing to enable admin user. */ - interface WithAdminUserEnabled { - /** - * Enable admin user. - * - * @return the next stage of the definition - */ - WithCreate withRegistryNameAsAdminUser(); - } - - /** The stage of the container registry definition allowing to add or remove a webhook. */ - interface WithWebhook { - /** - * Begins the definition of a new webhook to be added to this container registry. - * - * @param name the name of the new webhook - * @return the first stage of the new webhook definition - */ - Webhook.DefinitionStages.Blank defineWebhook(String name); - } - - /** - * The stage of the definition which contains all the minimum required inputs for the resource to be created, - * but also allows for any other optional settings to be specified. - */ - interface WithCreate - extends Creatable, WithAdminUserEnabled, WithWebhook, Resource.DefinitionWithTags { - } - } - - /** The template for an update operation, containing all the settings that can be modified. */ - interface Update - extends Resource.UpdateWithTags, - Appliable, - UpdateStages.WithAdminUserEnabled, - UpdateStages.WithSku, - UpdateStages.WithWebhook { - } - - /** Grouping of container service update stages. */ - interface UpdateStages { - /** The stage of the registry update allowing to enable admin user. */ - interface WithAdminUserEnabled { - /** - * Enable admin user. - * - * @return the next stage of the definition - */ - Update withRegistryNameAsAdminUser(); - - /** - * Disable admin user. - * - * @return the next stage of the definition - */ - Update withoutRegistryNameAsAdminUser(); - } - - /** The stage of the registry definition allowing to specify the SKU type. */ - interface WithSku { - /** - * Updates the current container registry to a 'managed' registry with a 'Basic' SKU type. - * - * @return the next stage of the definition - */ - Update withBasicSku(); - - /** - * Updates the current container registry to a 'managed' registry with a 'Standard' SKU type. - * - * @return the next stage of the definition - */ - Update withStandardSku(); - - /** - * Updates the current container registry to a 'managed' registry with a 'Premium' SKU type. - * - * @return the next stage of the definition - */ - Update withPremiumSku(); - } - - /** The stage of the container registry update allowing to add or remove a webhook. */ - interface WithWebhook { - /** - * Begins the definition of a new webhook to be added to this container registry. - * - * @param name the name of the new webhook - * @return the first stage of the new webhook definition - */ - Webhook.UpdateDefinitionStages.Blank defineWebhook(String name); - - /** - * Removes a webhook from the container registry. - * - * @param name name of the webhook to remove - * @return the next stage of the container registry update - */ - Update withoutWebhook(String name); - - /** - * Begins the description of an update of an existing webhook of this container registry. - * - * @param name the name of an existing webhook - * @return the first stage of the webhook update description - */ - Webhook.UpdateResourceStages.Blank updateWebhook(String name); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RegistryCredentials.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RegistryCredentials.java deleted file mode 100644 index b8f54da516d9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RegistryCredentials.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import java.util.Map; - -/** Response containing the login credentials for a container registry. */ -@Fluent -public interface RegistryCredentials { - /** - * The admin user access key names and values which can be used to login into the container registry. - * - * @return the admin user access keys - */ - Map accessKeys(); - - /** - * Get the username value which can be used to login into the container registry. - * - * @return the username value - */ - String username(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RegistryDockerTaskRunRequest.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RegistryDockerTaskRunRequest.java deleted file mode 100644 index b69754ee2ea7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RegistryDockerTaskRunRequest.java +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.model.Attachable; -import java.util.List; -import java.util.Map; - -/** An immutable client-side representation of an Azure registry Docker task run request. */ -@Fluent() -public interface RegistryDockerTaskRunRequest { - /** @return the length of the timeout. */ - int timeout(); - - /** @return the properties of the platform. */ - PlatformProperties platform(); - - /** @return the number of CPUs. */ - int cpuCount(); - - /** @return the location of the source control. */ - String sourceLocation(); - - /** @return whether archive is enabled. */ - boolean isArchiveEnabled(); - - /** Container interface for all the definitions related to a registry Docker task run request. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.DockerFilePath, - DefinitionStages.DockerTaskRunRequestStepAttachable { - } - - /** Grouping of registry Docker task run request definition stages. */ - interface DefinitionStages { - /** The first stage of a container registry Docker task run request definition. */ - interface Blank { - /** - * The function that begins the definition of the Docker task step in the task run request. - * - * @return the next stage of the container Docker task run request definition. - */ - DockerFilePath defineDockerTaskStep(); - } - - /** The stage of the container Docker task run request definition that specifies the path to the Docker file. */ - interface DockerFilePath { - /** - * The function that specifies the path to the Docker file. - * - * @param path the path to the Docker file. - * @return the next stage of the container Docker task run request definition. - */ - DockerTaskRunRequestStepAttachable withDockerFilePath(String path); - } - - /** - * The stage of the definition which contains all the minimum required inputs for the resource to be attached, - * but also allows for any other optional settings to be specified. - */ - interface DockerTaskRunRequestStepAttachable - extends Attachable { - /** - * The function that specifies the list of image names. - * - * @param imageNames the list of image names. - * @return the next stage of the container Docker task run request definition. - */ - DockerTaskRunRequestStepAttachable withImageNames(List imageNames); - - /** - * The function that specifies push is enabled or not. - * - * @param enabled whether push is enabled. - * @return the next stage of the container Docker task run request definition. - */ - DockerTaskRunRequestStepAttachable withPushEnabled(boolean enabled); - - /** - * The function that specifies a cache will be used or not. - * - * @param enabled whether caching is enabled or not. - * @return the next stage of the container Docker task run request definition. - */ - DockerTaskRunRequestStepAttachable withCacheEnabled(boolean enabled); - - /** - * The function that specifies the overriding arguments and what they will override. - * - * @param overridingArguments map with key of the name of the argument to be overridden and value - * OverridingArgument specifying the content of the overriding argument. - * @return the next stage of the container Docker task run request definition. - */ - DockerTaskRunRequestStepAttachable withOverridingArguments( - Map overridingArguments); - - /** - * The function that specifies the overriding argument and what it will override. - * - * @param name the name of the value to be overridden. - * @param overridingArgument the content of the overriding argument. - * @return the next stage of the container Docker task run request definition. - */ - DockerTaskRunRequestStepAttachable withOverridingArgument( - String name, OverridingArgument overridingArgument); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RegistryDockerTaskStep.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RegistryDockerTaskStep.java deleted file mode 100644 index 0a9c49db938d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RegistryDockerTaskStep.java +++ /dev/null @@ -1,188 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.model.Attachable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.model.Settable; -import java.util.List; -import java.util.Map; - -/** An immutable client-side representation of an Azure RegistryDockerTaskStep registry task. */ -@Fluent() -public interface RegistryDockerTaskStep extends HasInnerModel, RegistryTaskStep { - /** @return the image names of this Docker task step */ - List imageNames(); - - /** @return whether push is enabled for this Docker task step */ - boolean isPushEnabled(); - - /** @return whether there is no cache for this Docker task step */ - boolean noCache(); - - /** @return Docker file path for this Docker task step */ - String dockerFilePath(); - - /** @return the arguments this Docker task step */ - List arguments(); - - /** Container interface for all the definitions related to a RegistryDockerTaskStep. */ - interface Definition - extends RegistryDockerTaskStep.DefinitionStages.Blank, - RegistryDockerTaskStep.DefinitionStages.DockerFilePath, - RegistryDockerTaskStep.DefinitionStages.DockerTaskStepAttachable { - } - - /** Container interface for all the updates related to a RegistryDockerTaskStep. */ - interface Update - extends RegistryDockerTaskStep.UpdateStages.DockerFilePath, - RegistryDockerTaskStep.UpdateStages.ImageNames, - RegistryDockerTaskStep.UpdateStages.Push, - RegistryDockerTaskStep.UpdateStages.Cache, - RegistryDockerTaskStep.UpdateStages.OverridingArgumentUpdate, - Settable { - } - - /** Grouping of registry Docker task definition stages. */ - interface DefinitionStages { - - /** The first stage of a DockerFileTaskStep definition. */ - interface Blank extends DockerFilePath { - } - - /** - * The stage of the container registry DockerTaskStep definition allowing to specify the path to the Docker - * file. - */ - interface DockerFilePath { - /** - * The function that specifies the path to the Docker file. - * - * @param path the path to the Docker file. - * @return the next stage of the container registry DockerTaskStep definition. - */ - DockerTaskStepAttachable withDockerFilePath(String path); - } - - /** - * The stage of the definition which contains all the minimum required inputs for the resource to be attached, - * but also allows for any other optional settings to be specified. - */ - interface DockerTaskStepAttachable extends Attachable { - /** - * The function that specifies the list of image names. - * - * @param imageNames the image names. - * @return the next step of the container registry DockerTaskStep definition. - */ - DockerTaskStepAttachable withImageNames(List imageNames); - - /** - * The function that enables push depending on user input parameter. - * - * @param enabled whether push will be enabled - * @return the next step of the container registry DockerTaskStep definition. - */ - DockerTaskStepAttachable withPushEnabled(boolean enabled); - - /** - * The function that specifies the use of a cache based on user input parameter. - * - * @param enabled whether caching will be enabled. - * @return the next step of the container registry DockerTaskStep definition. - */ - DockerTaskStepAttachable withCacheEnabled(boolean enabled); - - /** - * The function that specifies the overriding arguments and what they will override. - * - * @param overridingArguments map with key of the name of the value to be overridden and value - * OverridingArgument specifying the content of the overriding argument. - * @return the next stage of the container Docker task step definition. - */ - DockerTaskStepAttachable withOverridingArguments(Map overridingArguments); - - /** - * The function that specifies the overriding argument and what it will override. - * - * @param name the name of the value to be overridden. - * @param overridingArgument the content of the overriding argument. - * @return the next stage of the container Docker task step definition. - */ - DockerTaskStepAttachable withOverridingArgument(String name, OverridingArgument overridingArgument); - } - } - - /** Grouping of registry Docker task update stages. */ - interface UpdateStages { - /** The stage of the container registry DockerTaskStep update allowing to specify the Docker file path. */ - interface DockerFilePath { - /** - * The function that specifies the path to the Docker file. - * - * @param path the path to the Docker file. - * @return the next stage of the container registry DockerTaskStep update. - */ - Update withDockerFilePath(String path); - } - - /** The stage of the container registry DockerTaskStep update allowing to specify the image names. */ - interface ImageNames { - /** - * The function that specifies the image names. - * - * @param imageNames the list of the names of the images. - * @return the next stage of the container registry DockerTaskStep update. - */ - Update withImageNames(List imageNames); - } - - /** - * The stage of the container registry DockerTaskStep update allowing to specify whether push is enabled or not. - */ - interface Push { - /** - * The function that specifies push is enabled. - * - * @param enabled whether push is enabled. - * @return the next stage of the container registry DockerTaskStep update. - */ - Update withPushEnabled(boolean enabled); - } - - /** - * The stage of the container registry DockerTaskStep update allowing to specify whether to have a cache or not. - */ - interface Cache { - /** - * The function that specifies the task has a cache. - * - * @param enabled whether caching is enabled. - * @return the next stage of the container registry DockerTaskStep update. - */ - Update withCacheEnabled(boolean enabled); - } - - /** The stage of the container registry DockerTaskStep update allowing to specify any overriding arguments. */ - interface OverridingArgumentUpdate { - /** - * The function that specifies the overriding arguments and what they will override. - * - * @param overridingArguments map with key of the name of the value to be overridden and value - * OverridingArgument specifying the content of the overriding argument. - * @return the next stage of the container Docker task step update. - */ - Update withOverridingArguments(Map overridingArguments); - - /** - * The function that specifies the overriding argument and what it will override. - * - * @param name the name of the value to be overridden. - * @param overridingArgument the content of the overriding argument. - * @return the next stage of the container Docker task step update. - */ - Update withOverridingArgument(String name, OverridingArgument overridingArgument); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RegistryEncodedTaskRunRequest.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RegistryEncodedTaskRunRequest.java deleted file mode 100644 index d5370849679b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RegistryEncodedTaskRunRequest.java +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.model.Attachable; -import java.util.Map; - -/** An immutable client-side representation of an Azure registry Encoded task run request. */ -@Fluent() -public interface RegistryEncodedTaskRunRequest { - /** @return the length of the timeout. */ - int timeout(); - - /** @return the properties of the platform. */ - PlatformProperties platform(); - - /** @return the number of CPUs. */ - int cpuCount(); - - /** @return the location of the source control. */ - String sourceLocation(); - - /** @return whether archive is enabled. */ - boolean isArchiveEnabled(); - - /** Container interface for all the definitions related to a registry Encoded task run request. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.EncodedTaskContent, - DefinitionStages.EncodedTaskRunRequestStepAttachable { - } - - /** Grouping of registry encoded task run request definition stages. */ - interface DefinitionStages { - /** The first stage of an encoded task run request definition. */ - interface Blank { - /** - * The function that begins the definition of the encoded task step in the task run request. - * - * @return the next stage of the container encoded task run request definition. - */ - EncodedTaskContent defineEncodedTaskStep(); - } - - /** - * The stage of the container encoded task run request definition that specifies the base64 encoded task - * content. - */ - interface EncodedTaskContent { - /** - * The function that specifies the base64 encoded task content. - * - * @param encodedTaskContent the base64 encoded task content. - * @return the next stage of the container encoded task run request definition. - */ - EncodedTaskRunRequestStepAttachable withBase64EncodedTaskContent(String encodedTaskContent); - } - - /** - * The stage of the definition which contains all the minimum required inputs for the resource to be attached, - * but also allows for any other optional settings to be specified. - */ - interface EncodedTaskRunRequestStepAttachable - extends Attachable { - /** - * The function that specifies the base64 encoded values content. - * - * @param encodedValueContent the base64 encoded values content. - * @return the next stage of the container encoded task run request definition. - */ - EncodedTaskRunRequestStepAttachable withBase64EncodedValueContent(String encodedValueContent); - - /** - * The function that specifies the overriding values and what they will override. - * - * @param overridingValues map with key of the name of the value to be overridden and value OverridingValue - * specifying the content of the overriding value. - * @return the next stage of the container encoded task run request definition. - */ - EncodedTaskRunRequestStepAttachable withOverridingValues(Map overridingValues); - - /** - * The function that specifies the overriding value and what it will override. - * - * @param name the name of the value to be overridden. - * @param overridingValue the content of the overriding value. - * @return the next stage of the container encoded task run request definition. - */ - EncodedTaskRunRequestStepAttachable withOverridingValue(String name, OverridingValue overridingValue); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RegistryEncodedTaskStep.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RegistryEncodedTaskStep.java deleted file mode 100644 index b7ce4381d898..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RegistryEncodedTaskStep.java +++ /dev/null @@ -1,141 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.model.Attachable; -import com.azure.resourcemanager.resources.fluentcore.model.Settable; -import java.util.List; -import java.util.Map; - -/** An immutable client-side representation of an Azure RegistryEncodedTaskStep registry task. */ -@Fluent() -public interface RegistryEncodedTaskStep extends RegistryTaskStep { - /** @return the encoded task content of this encoded task step */ - String encodedTaskContent(); - - /** @return the encoded values content of this encoded task step */ - String encodedValuesContent(); - - /** @return the values of this encoded task step */ - List values(); - - /** Container interface for all the definitions related to a RegistryEncodedTaskStep. */ - interface Definition - extends RegistryEncodedTaskStep.DefinitionStages.Blank, - RegistryEncodedTaskStep.DefinitionStages.EncodedTaskContent, - RegistryEncodedTaskStep.DefinitionStages.EncodedTaskStepAttachable { - } - - /** Container interface for all the updates related to a RegistryEncodedTaskStep. */ - interface Update - extends RegistryEncodedTaskStep.UpdateStages.EncodedTaskContent, - RegistryEncodedTaskStep.UpdateStages.ValuePath, - RegistryEncodedTaskStep.UpdateStages.OverridingValues, - Settable { - } - - /** Grouping of registry encoded task definition stages. */ - interface DefinitionStages { - /** The first stage of a RegistryEncodedTaskStep definition. */ - interface Blank extends EncodedTaskContent { - } - - /** - * The stage of the container registry EncodedTaskStep definition allowing to specify the base64 encoded task - * content. - */ - interface EncodedTaskContent { - /** - * The function that specifies the base64 encoded task content. - * - * @param encodedTaskContent the base64 encoded task content. - * @return the next stage of the container registry EncodedTaskStep definition. - */ - EncodedTaskStepAttachable withBase64EncodedTaskContent(String encodedTaskContent); - } - - /** - * The stage of the definition which contains all the minimum required inputs for the resource to be attached, - * but also allows for any other optional settings to be specified. - */ - interface EncodedTaskStepAttachable extends Attachable { - /** - * The function that specifies the base64 encoded value content. - * - * @param encodedValueContent the base64 encoded value content. - * @return the next stage of the container registry EncodedTaskStep definition. - */ - EncodedTaskStepAttachable withBase64EncodedValueContent(String encodedValueContent); - - /** - * The function that specifies the values that override the corresponding values specified under the - * function withBase64EncodedValueContent(). - * - * @param overridingValues a map which contains the values that will override the corresponding values - * specified under the function withBase64EncodedValueContent(). - * @return the next stage of the container registry EncodedTaskStep definition. - */ - EncodedTaskStepAttachable withOverridingValues(Map overridingValues); - - /** - * The function that specifies a single value that will override the corresponding value specified under the - * function withBase64EncodedValueContent(). - * - * @param name the name of the value to be overridden. - * @param overridingValue the value of the value to be overridden. - * @return the next stage of the container registry EncodedTaskStep definition. - */ - EncodedTaskStepAttachable withOverridingValue(String name, OverridingValue overridingValue); - } - } - - /** Grouping of registry encoded task update stages. */ - interface UpdateStages { - /** The stage of the container registry EncodedTaskStep update allowing to specify the task path. */ - interface EncodedTaskContent { - /** - * The function that specifies the path to the base64 encoded task content. - * - * @param encodedTaskContent the path to the base64 encoded task content. - * @return the next stage of the container registry EncodedTaskStep update. - */ - Update withBase64EncodedTaskContent(String encodedTaskContent); - } - - /** The stage of the container registry EncodedTaskStep update allowing to specify the path to the values. */ - interface ValuePath { - /** - * The function that specifies the path to the base64 encoded value content. - * - * @param encodedValueContent the path to the base64 encoded value content. - * @return the next stage of the container registry EncodedTaskStep update. - */ - Update withBase64EncodedValueContent(String encodedValueContent); - } - - /** The stage of the container registry EncodedTaskStep update allowing to specify the overriding values. */ - interface OverridingValues { - /** - * The function that specifies the values that override the corresponding values specified under the - * function withBase64EncodedValueContent(). - * - * @param overridingValues a map which contains the values that will override the corresponding values - * specified under the function withBase64EncodedValueContent(). - * @return the next stage of the container registry EncodedTaskStep update. - */ - Update withOverridingValues(Map overridingValues); - - /** - * The function that specifies a single value that will override the corresponding value specified under the - * function withBase64EncodedValueContent(). - * - * @param name the name of the value to be overridden. - * @param overridingValue the value of the value to be overridden. - * @return the next stage of the container registry EncodedTaskStep update. - */ - Update withOverridingValue(String name, OverridingValue overridingValue); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RegistryFileTaskRunRequest.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RegistryFileTaskRunRequest.java deleted file mode 100644 index d2df53cb675c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RegistryFileTaskRunRequest.java +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.model.Attachable; -import java.util.Map; - -/** An immutable client-side representation of an Azure registry file task run request. */ -@Fluent() -public interface RegistryFileTaskRunRequest { - /** @return the length of the timeout. */ - int timeout(); - - /** @return the properties of the platform. */ - PlatformProperties platform(); - - /** @return the number of CPUs. */ - int cpuCount(); - - /** @return the location of the source control. */ - String sourceLocation(); - - /** @return whether archive is enabled. */ - boolean isArchiveEnabled(); - - /** Container interface for all the definitions related to a registry file task run request. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.FileTaskPath, - DefinitionStages.FileTaskRunRequestStepAttachable { - } - - /** Grouping of registry file task run request definition stages. */ - interface DefinitionStages { - /** The first stage of a file task run request definition. */ - interface Blank { - /** - * The function that begins the definition of the file task step in the task run request. - * - * @return the next stage of the container file task run request definition. - */ - FileTaskPath defineFileTaskStep(); - } - - /** The stage of the container file task run request definition that specifies the path to the task file. */ - interface FileTaskPath { - /** - * The function that specifies the path to the task file. - * - * @param taskPath the path to the task file. - * @return the next stage of the container file task run request definition. - */ - FileTaskRunRequestStepAttachable withTaskPath(String taskPath); - } - - /** - * The stage of the definition which contains all the minimum required inputs for the resource to be attached, - * but also allows for any other optional settings to be specified. - */ - interface FileTaskRunRequestStepAttachable - extends Attachable { - /** - * The function that specifies the path to the values file. - * - * @param valuesPath the path to the values file. - * @return the next stage of the container file task run request definition. - */ - FileTaskRunRequestStepAttachable withValuesPath(String valuesPath); - - /** - * The function that specifies the overriding values and what they will override. - * - * @param overridingValues map with key of the name of the value to be overridden and value OverridingValue - * specifying the content of the overriding value. - * @return the next stage of the container file task run request definition. - */ - FileTaskRunRequestStepAttachable withOverridingValues(Map overridingValues); - - /** - * The function that specifies the overriding value and what it will override. - * - * @param name the name of the value to be overridden. - * @param overridingValue the content of the overriding value. - * @return the next stage of the container file task run request definition. - */ - FileTaskRunRequestStepAttachable withOverridingValue(String name, OverridingValue overridingValue); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RegistryFileTaskStep.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RegistryFileTaskStep.java deleted file mode 100644 index 8384796b4747..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RegistryFileTaskStep.java +++ /dev/null @@ -1,139 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.model.Attachable; -import com.azure.resourcemanager.resources.fluentcore.model.Settable; -import java.util.List; -import java.util.Map; - -/** An immutable client-side representation of an Azure RegistryFileTaskStep registry task. */ -@Fluent() -public interface RegistryFileTaskStep extends RegistryTaskStep { - /** @return the task file path of this file task step */ - String taskFilePath(); - - /** @return the values file path of this file task step */ - String valuesFilePath(); - - /** @return the values of this file task step */ - List values(); - - /** Container interface for all the definitions related to a RegistryFileTaskStep. */ - interface Definition - extends RegistryFileTaskStep.DefinitionStages.Blank, - RegistryFileTaskStep.DefinitionStages.FileTaskPath, - RegistryFileTaskStep.DefinitionStages.FileTaskStepAttachable { - } - - /** Container interface for all the updates related to a RegistryFileTaskStep. */ - interface Update - extends RegistryFileTaskStep.UpdateStages.FileTaskPath, - RegistryFileTaskStep.UpdateStages.ValuePath, - RegistryFileTaskStep.UpdateStages.OverridingValues, - Settable { - } - - /** Grouping of registry file task definition stages. */ - interface DefinitionStages { - - /** The first stage of a RegistryFileTaskStep definition. */ - interface Blank extends FileTaskPath { - } - - /** The stage of the container registry FileTaskStep definition allowing to specify the task path. */ - interface FileTaskPath { - /** - * The function that specifies the path to the task file. - * - * @param path the path to the task file. - * @return the next stage of the container registry FileTaskStep definition. - */ - FileTaskStepAttachable withTaskPath(String path); - } - - /** - * The stage of the definition which contains all the minimum required inputs for the resource to be attached, - * but also allows for any other optional settings to be specified. - */ - interface FileTaskStepAttachable extends Attachable { - /** - * The function that specifies the path to the values. - * - * @param path the path to the values. - * @return the next stage of the container registry FileTaskStep definition. - */ - FileTaskStepAttachable withValuesPath(String path); - - /** - * The function that specifies the values that override the corresponding values specified under the - * function withValuesPath(). - * - * @param overridingValues a map which contains the values that will override the corresponding values - * specified under the function withValuesPath(). - * @return the next stage of the container registry FileTaskStep definition. - */ - FileTaskStepAttachable withOverridingValues(Map overridingValues); - - /** - * The function that specifies a single value that will override the corresponding value specified under the - * function withValuesPath(). - * - * @param name the name of the value to be overridden. - * @param overridingValue the value of the value to be overridden. - * @return the next stage of the container registry FileTaskStep definition. - */ - FileTaskStepAttachable withOverridingValue(String name, OverridingValue overridingValue); - } - } - - /** Grouping of registry file task update stages. */ - interface UpdateStages { - /** The stage of the container registry FileTaskStep update allowing to specify the task path. */ - interface FileTaskPath { - /** - * The function that specifies the path to the task file. - * - * @param path the path to the task file. - * @return the next stage of the container registry FileTaskStep update. - */ - Update withTaskPath(String path); - } - - /** The stage of the container registry FileTaskStep update allowing to specify the path to the values. */ - interface ValuePath { - /** - * The function that specifies the path to the values. - * - * @param path the path to the values. - * @return the next stage of the container registry FileTaskStep update. - */ - Update withValuesPath(String path); - } - - /** The stage of the container registry FileTaskStep update allowing to specify the overriding values. */ - interface OverridingValues { - /** - * The function that specifies the values that override the corresponding values specified under the - * function withValuesPath(). - * - * @param overridingValues a map which contains the values that will override the corresponding values - * specified under the function withValuesPath(). - * @return the next stage of the container registry FileTaskStep update. - */ - Update withOverridingValues(Map overridingValues); - - /** - * The function that specifies a single value that will override the corresponding value specified under the - * function withValuesPath(). - * - * @param name the name of the value to be overridden. - * @param overridingValue the value of the value to be overridden. - * @return the next stage of the container registry FileTaskStep update. - */ - Update withOverridingValue(String name, OverridingValue overridingValue); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RegistryListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RegistryListResult.java deleted file mode 100644 index 7c971b43351f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RegistryListResult.java +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.containerregistry.fluent.models.RegistryInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The result of a request to list container registries. */ -@Fluent -public final class RegistryListResult { - /* - * The list of container registries. Since this list may be incomplete, the - * nextLink field should be used to request the next list of container - * registries. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URI that can be used to request the next list of container - * registries. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: The list of container registries. Since this list may be incomplete, the nextLink field - * should be used to request the next list of container registries. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The list of container registries. Since this list may be incomplete, the nextLink field - * should be used to request the next list of container registries. - * - * @param value the value value to set. - * @return the RegistryListResult object itself. - */ - public RegistryListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URI that can be used to request the next list of container registries. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The URI that can be used to request the next list of container registries. - * - * @param nextLink the nextLink value to set. - * @return the RegistryListResult object itself. - */ - public RegistryListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RegistryNameCheckRequest.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RegistryNameCheckRequest.java deleted file mode 100644 index c558f5bbd775..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RegistryNameCheckRequest.java +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** A request to check whether a container registry name is available. */ -@Fluent -public final class RegistryNameCheckRequest { - /* - * The name of the container registry. - */ - @JsonProperty(value = "name", required = true) - private String name; - - /* - * The resource type of the container registry. This field must be set to - * 'Microsoft.ContainerRegistry/registries'. - */ - @JsonProperty(value = "type", required = true) - private String type = "Microsoft.ContainerRegistry/registries"; - - /** Creates an instance of RegistryNameCheckRequest class. */ - public RegistryNameCheckRequest() { - type = "Microsoft.ContainerRegistry/registries"; - } - - /** - * Get the name property: The name of the container registry. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the container registry. - * - * @param name the name value to set. - * @return the RegistryNameCheckRequest object itself. - */ - public RegistryNameCheckRequest withName(String name) { - this.name = name; - return this; - } - - /** - * Get the type property: The resource type of the container registry. This field must be set to - * 'Microsoft.ContainerRegistry/registries'. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Set the type property: The resource type of the container registry. This field must be set to - * 'Microsoft.ContainerRegistry/registries'. - * - * @param type the type value to set. - * @return the RegistryNameCheckRequest object itself. - */ - public RegistryNameCheckRequest withType(String type) { - this.type = type; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property name in model RegistryNameCheckRequest")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(RegistryNameCheckRequest.class); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RegistryPassword.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RegistryPassword.java deleted file mode 100644 index 00a3f8061549..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RegistryPassword.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The login password for the container registry. */ -@Fluent -public final class RegistryPassword { - /* - * The password name. - */ - @JsonProperty(value = "name") - private PasswordName name; - - /* - * The password value. - */ - @JsonProperty(value = "value") - private String value; - - /** - * Get the name property: The password name. - * - * @return the name value. - */ - public PasswordName name() { - return this.name; - } - - /** - * Set the name property: The password name. - * - * @param name the name value to set. - * @return the RegistryPassword object itself. - */ - public RegistryPassword withName(PasswordName name) { - this.name = name; - return this; - } - - /** - * Get the value property: The password value. - * - * @return the value value. - */ - public String value() { - return this.value; - } - - /** - * Set the value property: The password value. - * - * @param value the value value to set. - * @return the RegistryPassword object itself. - */ - public RegistryPassword withValue(String value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RegistrySourceTrigger.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RegistrySourceTrigger.java deleted file mode 100644 index 79e08056147d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RegistrySourceTrigger.java +++ /dev/null @@ -1,488 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.model.Attachable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.model.Settable; -import java.util.List; - -/** An immutable client-side representation of a Container Registry source trigger. */ -@Fluent() -public interface RegistrySourceTrigger extends HasInnerModel { - - /** @return Returns the type of source control this trigger uses. I.e., Github, AzureDevOps etc. */ - SourceControlType sourceControlType(); - - /** @return the URL of the repository used as source control. */ - String sourceControlRepositoryUrl(); - - /** @return the list of actions that trigger an event. I.e., a commit, a pull request etc. */ - List sourceTriggerEvents(); - - /** @return the branch of the repository that is being used as source control. I.e., master. */ - String sourceControlBranch(); - - /** @return the source trigger status. I.e., enabled, disabled. */ - TriggerStatus status(); - - /** Container interface for all of the definitions related to a container registry source trigger. */ - interface Definition - extends RegistrySourceTrigger.DefinitionStages.Blank, - RegistrySourceTrigger.DefinitionStages.RepositoryUrl, - RegistrySourceTrigger.DefinitionStages.TriggerEventsDefinition, - RegistrySourceTrigger.DefinitionStages.RepositoryBranchAndAuth, - RegistrySourceTrigger.DefinitionStages.TriggerStatusDefinition, - RegistrySourceTrigger.DefinitionStages.SourceTriggerAttachable { - } - - /** Container interface for all of the updates related to a container registry source trigger. */ - interface Update - extends RegistrySourceTrigger.UpdateStages.SourceControlType, - RegistrySourceTrigger.UpdateStages.RepositoryUrl, - RegistrySourceTrigger.UpdateStages.TriggerEventsDefinition, - RegistrySourceTrigger.UpdateStages.RepositoryBranchAndAuth, - RegistrySourceTrigger.UpdateStages.TriggerStatusDefinition, - Settable { - } - - /** Container interface for defining a new trigger during a task update. */ - interface UpdateDefinition - extends RegistrySourceTrigger.UpdateDefinitionStages.Blank, - RegistrySourceTrigger.UpdateDefinitionStages.RepositoryUrl, - RegistrySourceTrigger.UpdateDefinitionStages.TriggerEventsDefinition, - RegistrySourceTrigger.UpdateDefinitionStages.RepositoryBranchAndAuth, - RegistrySourceTrigger.UpdateDefinitionStages.TriggerStatusDefinition, - RegistrySourceTrigger.UpdateDefinitionStages.SourceTriggerAttachable, - Settable { - } - - /** Grouping of source trigger definition stages. */ - interface DefinitionStages { - - /** The first stage of a source trigger definition. */ - interface Blank { - /** - * The function that specifies Github will be used as the type of source control. - * - * @return the next stage of the container registry source trigger definition. - */ - RepositoryUrl withGithubAsSourceControl(); - - /** - * The function that specifies Azure DevOps will be used as the type of source control. - * - * @return the next stage of the container registry source trigger definition. - */ - RepositoryUrl withAzureDevOpsAsSourceControl(); - - /** - * The function that allows the user to input their own kind of source control. - * - * @param sourceControl the source control the user wishes to use. - * @return the next stage of the container registry source trigger definition. - */ - RepositoryUrl withSourceControl(SourceControlType sourceControl); - } - - /** - * The stage of the container registry source trigger definition allowing to specify the URL of the source - * control repository. - */ - interface RepositoryUrl { - /** - * The function that specifies the URL of the source control repository. - * - * @param sourceControlRepositoryUrl the URL of the source control repository. - * @return the next stage of the container registry source trigger definition. - */ - TriggerEventsDefinition withSourceControlRepositoryUrl(String sourceControlRepositoryUrl); - } - - /** - * The stage of the container registry source trigger definition allowing to specify the type of actions that - * will trigger a run. - */ - interface TriggerEventsDefinition { - /** - * The function that specifies a commit action will trigger a run. - * - * @return the next stage of the container registry source trigger definition. - */ - SourceTriggerAttachable withCommitTriggerEvent(); - - /** - * The function that specifies a pull action will trigger a run. - * - * @return the next stage of the container registry source trigger definition. - */ - SourceTriggerAttachable withPullTriggerEvent(); - - /** - * The function that allows the user to specify an action that will trigger a run when it is executed. - * - * @param sourceTriggerEvent the action that will trigger a run. - * @return the next stage of the container registry source trigger definition. - */ - SourceTriggerAttachable withTriggerEvent(SourceTriggerEvent sourceTriggerEvent); - } - - /** - * The stage of the container registry source trigger definition allowing to specify the branch of the - * repository and authentication credentials if needed to interact with the source control repository. - */ - interface RepositoryBranchAndAuth { - /** - * The function that specifies the branch of the respository to use. - * - * @param branch the repository branch. - * @return the next stage of the container registry source trigger definition. - */ - SourceTriggerAttachable withRepositoryBranch(String branch); - - /** - * The function that allows the user to input the type of the token used for authentication and the token - * itself to authenticate to the source control repository. - * - * @param tokenType the type of the token used to authenticate to the source control repository. - * @param token the token used to authenticate to the source control repository. - * @return the next stage of the container registry source trigger definition. - */ - SourceTriggerAttachable withRepositoryAuthentication(TokenType tokenType, String token); - - /** - * The function that allows the user to input the type of the token used for authentication and the token - * itself to authenticate to the source control repository. - * - * @param tokenType the type of the token used to authenticate to the source control repository. - * @param token the token used to authenticate to the source control repository. - * @param refreshToken the token that is used to refresh the access token. - * @param scope the scope of the access token. - * @param expiresIn time in seconds that the token remains valid. - * @return the next stage of the container registry source trigger definition. - */ - SourceTriggerAttachable withRepositoryAuthentication( - TokenType tokenType, String token, String refreshToken, String scope, int expiresIn); - } - - /** - * The stage of the container registry source trigger definition allowing to specify the status of the trigger. - */ - interface TriggerStatusDefinition { - /** - * The function that sets the trigger status to be enabled. - * - * @return the next stage of the container registry source trigger definition. - */ - SourceTriggerAttachable withTriggerStatusEnabled(); - - /** - * The function that sets the trigger status to be disabled. - * - * @return the next stage of the container registry source trigger definition. - */ - SourceTriggerAttachable withTriggerStatusDisabled(); - - /** - * The function that allows the user to input the state of the trigger status. - * - * @param triggerStatus the user's choice for the trigger status. - * @return the next stage of the container registry source trigger definition. - */ - SourceTriggerAttachable withTriggerStatus(TriggerStatus triggerStatus); - } - - /** - * The stage of the definition which contains all the minimum required inputs for the resource to be attached, - * but also allows for any other optional settings to be specified. - */ - interface SourceTriggerAttachable - extends RepositoryBranchAndAuth, - TriggerEventsDefinition, - TriggerStatusDefinition, - Attachable.InDefinition { - } - } - - /** Grouping of source trigger update stages. */ - interface UpdateStages { - /** The stage of the container registry source trigger update allowing to specify the type of source control. */ - interface SourceControlType { - /** - * The function that specifies Github will be used as the type of source control. - * - * @return the next stage of the container registry source trigger definition. - */ - Update withGithubAsSourceControl(); - - /** - * The function that specifies Azure DevOps will be used as the type of source control. - * - * @return the next stage of the container registry source trigger definition. - */ - Update withAzureDevOpsAsSourceControl(); - - /** - * The function that allows the user to input their own kind of source control. - * - * @param sourceControl the source control the user wishes to use. - * @return the next stage of the container registry source trigger definition. - */ - Update withSourceControl( - com.azure.resourcemanager.containerregistry.models.SourceControlType sourceControl); - } - - /** - * The stage of the container registry source trigger update allowing to specify the URL of the source control - * repository. - */ - interface RepositoryUrl { - /** - * The function that specifies the URL of the source control repository. - * - * @param sourceControlRepositoryUrl the URL of the source control repository. - * @return the next stage of the container registry source trigger definition. - */ - Update withSourceControlRepositoryUrl(String sourceControlRepositoryUrl); - } - - /** - * The stage of the container registry source trigger update allowing to specify the type of actions that will - * trigger a run. - */ - interface TriggerEventsDefinition { - /** - * The function that specifies a commit action will trigger a run. - * - * @return the next stage of the container registry source trigger definition. - */ - Update withCommitTriggerEvent(); - - /** - * The function that specifies a pull action will trigger a run. - * - * @return the next stage of the container registry source trigger definition. - */ - Update withPullTriggerEvent(); - - /** - * The function that allows the user to specify an action that will trigger a run when it is executed. - * - * @param sourceTriggerEvent the action that will trigger a run. - * @return the next stage of the container registry source trigger definition. - */ - Update withTriggerEvent(SourceTriggerEvent sourceTriggerEvent); - } - - /** - * The stage of the container registry source trigger update allowing to specify the branch of the repository - * and authentication credentials if needed to interact with the source control repository. - */ - interface RepositoryBranchAndAuth { - /** - * The function that specifies the branch of the respository to use. - * - * @param branch the repository branch. - * @return the next stage of the container registry source trigger definition. - */ - Update withRepositoryBranch(String branch); - - /** - * The function that allows the user to input the type of the token used for authentication and the token - * itself to authenticate to the source control repository. - * - * @param tokenType the type of the token used to authenticate to the source control repository. - * @param token the token used to authenticate to the source control repository. - * @return the next stage of the container registry source trigger definition. - */ - Update withRepositoryAuthentication(TokenType tokenType, String token); - - /** - * The function that allows the user to input the type of the token used for authentication and the token - * itself to authenticate to the source control repository. - * - * @param tokenType the type of the token used to authenticate to the source control repository. - * @param token the token used to authenticate to the source control repository. - * @param refreshToken the token that is used to refresh the access token. - * @param scope the scope of the access token. - * @param expiresIn time in seconds that the token remains valid. - * @return the next stage of the container registry source trigger definition. - */ - Update withRepositoryAuthentication( - TokenType tokenType, String token, String refreshToken, String scope, int expiresIn); - } - - /** The stage of the container registry source trigger update allowing to specify the status of the trigger. */ - interface TriggerStatusDefinition { - /** - * The function that sets the trigger status to be enabled. - * - * @return the next stage of the container registry source trigger definition. - */ - Update withTriggerStatusEnabled(); - - /** - * The function that sets the trigger status to be disabled. - * - * @return the next stage of the container registry source trigger definition. - */ - Update withTriggerStatusDisabled(); - - /** - * The function that allows the user to input the state of the trigger status. - * - * @param triggerStatus the user's choice for the trigger status. - * @return the next stage of the container registry source trigger definition. - */ - Update withTriggerStatus(TriggerStatus triggerStatus); - } - } - - /** Grouping of source trigger update definition stages. */ - interface UpdateDefinitionStages { - - /** The first stage of a source trigger definition. */ - interface Blank { - /** - * The function that specifies Github will be used as the type of source control. - * - * @return the next stage of the container registry source trigger definition. - */ - RepositoryUrl withGithubAsSourceControl(); - - /** - * The function that specifies Azure DevOps will be used as the type of source control. - * - * @return the next stage of the container registry source trigger definition. - */ - RepositoryUrl withAzureDevOpsAsSourceControl(); - - /** - * The function that allows the user to input their own kind of source control. - * - * @param sourceControl the source control the user wishes to use. - * @return the next stage of the container registry source trigger definition. - */ - RepositoryUrl withSourceControl(SourceControlType sourceControl); - } - - /** - * The stage of the container registry source trigger definition allowing to specify the URL of the source - * control repository. - */ - interface RepositoryUrl { - /** - * The function that specifies the URL of the source control repository. - * - * @param sourceControlRepositoryUrl the URL of the source control repository. - * @return the next stage of the container registry source trigger definition. - */ - TriggerEventsDefinition withSourceControlRepositoryUrl(String sourceControlRepositoryUrl); - } - - /** - * The stage of the container registry source trigger definition allowing to specify the type of actions that - * will trigger a run. - */ - interface TriggerEventsDefinition { - /** - * The function that specifies a commit action will trigger a run. - * - * @return the next stage of the container registry source trigger definition. - */ - SourceTriggerAttachable withCommitTriggerEvent(); - - /** - * The function that specifies a pull action will trigger a run. - * - * @return the next stage of the container registry source trigger definition. - */ - SourceTriggerAttachable withPullTriggerEvent(); - - /** - * The function that allows the user to specify an action that will trigger a run when it is executed. - * - * @param sourceTriggerEvent the action that will trigger a run. - * @return the next stage of the container registry source trigger definition. - */ - SourceTriggerAttachable withTriggerEvent(SourceTriggerEvent sourceTriggerEvent); - } - - /** - * The stage of the container registry source trigger definition allowing to specify the branch of the - * repository and authentication credentials if needed to interact with the source control repository. - */ - interface RepositoryBranchAndAuth { - /** - * The function that specifies the branch of the respository to use. - * - * @param branch the repository branch. - * @return the next stage of the container registry source trigger definition. - */ - SourceTriggerAttachable withRepositoryBranch(String branch); - - /** - * The function that allows the user to input the type of the token used for authentication and the token - * itself to authenticate to the source control repository. - * - * @param tokenType the type of the token used to authenticate to the source control repository. - * @param token the token used to authenticate to the source control repository. - * @return the next stage of the container registry source trigger definition. - */ - SourceTriggerAttachable withRepositoryAuthentication(TokenType tokenType, String token); - - /** - * The function that allows the user to input the type of the token used for authentication and the token - * itself to authenticate to the source control repository. - * - * @param tokenType the type of the token used to authenticate to the source control repository. - * @param token the token used to authenticate to the source control repository. - * @param refreshToken the token that is used to refresh the access token. - * @param scope the scope of the access token. - * @param expiresIn time in seconds that the token remains valid. - * @return the next stage of the container registry source trigger definition. - */ - SourceTriggerAttachable withRepositoryAuthentication( - TokenType tokenType, String token, String refreshToken, String scope, int expiresIn); - } - - /** - * The stage of the container registry source trigger definition allowing to specify the status of the trigger. - */ - interface TriggerStatusDefinition { - /** - * The function that sets the trigger status to be enabled. - * - * @return the next stage of the container registry source trigger definition. - */ - SourceTriggerAttachable withTriggerStatusEnabled(); - - /** - * The function that sets the trigger status to be disabled. - * - * @return the next stage of the container registry source trigger definition. - */ - SourceTriggerAttachable withTriggerStatusDisabled(); - - /** - * The function that allows the user to input the state of the trigger status. - * - * @param triggerStatus the user's choice for the trigger status. - * @return the next stage of the container registry source trigger definition. - */ - SourceTriggerAttachable withTriggerStatus(TriggerStatus triggerStatus); - } - - /** - * The stage of the definition which contains all the minimum required inputs for the resource to be attached, - * but also allows for any other optional settings to be specified. - */ - interface SourceTriggerAttachable - extends RepositoryBranchAndAuth, - TriggerEventsDefinition, - TriggerStatusDefinition, - Attachable.InUpdate { - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RegistryTask.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RegistryTask.java deleted file mode 100644 index 710852684362..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RegistryTask.java +++ /dev/null @@ -1,438 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.containerregistry.fluent.models.TaskInner; -import com.azure.core.management.Region; -import com.azure.resourcemanager.resources.fluentcore.arm.models.Resource; -import com.azure.resourcemanager.resources.fluentcore.model.Appliable; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; -import com.azure.resourcemanager.resources.fluentcore.model.Updatable; -import java.time.OffsetDateTime; -import java.util.Map; - -/** An immutable client-side representation of an Azure registry task. */ -@Fluent() -public interface RegistryTask - extends Resource, HasInnerModel, Refreshable, Updatable { - - /** @return the name of the resource's resource group */ - String resourceGroupName(); - - /** @return the parent ID of this resource */ - String parentRegistryId(); - - /** @return the provisioning state of the build task */ - ProvisioningState provisioningState(); - - /** @return the creation date of build task */ - OffsetDateTime creationDate(); - - /** @return the current status of build task */ - TaskStatus status(); - - /** @return the RegistryTaskStep of the current task */ - RegistryTaskStep registryTaskStep(); - - /** @return the build timeout settings in seconds */ - int timeout(); - - /** @return the build timeout settings in seconds */ - PlatformProperties platform(); - - /** @return the CPU count */ - int cpuCount(); - - /** @return the trigger of the task */ - TriggerProperties trigger(); - - /** @return the source triggers of the task. */ - Map sourceTriggers(); - - /** Container interface for all the definitions related to a registry task. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.Location, - DefinitionStages.Platform, - DefinitionStages.TaskStepType, - DefinitionStages.SourceTriggerDefinition, - DefinitionStages.TriggerTypes, - DefinitionStages.TaskCreatable { - } - - /** Container interface for all the updates related to a registry task. */ - interface Update - extends UpdateStages.Platform, - UpdateStages.TriggerTypes, - UpdateStages.AgentConfiguration, - UpdateStages.Timeout, - UpdateStages.TaskStepType, - Appliable { - } - - /** Grouping of registry task definition stages. */ - interface DefinitionStages { - /** The first stage of a container registry task definition. */ - interface Blank { - /** - * The parameters referencing an existing container registry under which this task resides. - * - * @param resourceGroupName the name of the parent container registry resource group. - * @param registryName the name of the existing container registry. - * @return the next stage of the container registry task definition. - */ - Location withExistingRegistry(String resourceGroupName, String registryName); - } - - /** The stage of the container registry task definition allowing to specify location. */ - interface Location { - /** - * The parameters specifying location of the container registry task. - * - * @param location the location of the container registry task. - * @return the next stage of the container registry task definition. - */ - Platform withLocation(String location); - - /** - * The parameters specifying location of the container registry task. - * - * @param location the location of the container registry task. - * @return the next stage of the container registry task definition. - */ - Platform withLocation(Region location); - } - - /** The stage of the container registry task definition allowing to specify the platform. */ - interface Platform { - /** - * The function that specifies a Linux OS system for the platform. - * - * @return the next stage of the container registry task definition. - */ - TaskStepType withLinux(); - - /** - * The function that specifies a Windows OS system for the platform. - * - * @return the next stage of the container registry task definition. - */ - TaskStepType withWindows(); - - /** - * The function that specifies a Linux OS system and architecture for the platform. - * - * @param architecture the CPU architecture. - * @return the next stage of the container registry task definition. - */ - TaskStepType withLinux(Architecture architecture); - - /** - * The function that specifies a Windows OS system and architecture for the platform. - * - * @param architecture the CPU architecture - * @return the next stage of the container registry task definition. - */ - TaskStepType withWindows(Architecture architecture); - - /** - * The function that specifies a Linux OS system, architecture, and CPU variant. - * - * @param architecture the CPU architecture. - * @param variant the CPU variant. - * @return the next stage of the container registry task definition. - */ - TaskStepType withLinux(Architecture architecture, Variant variant); - - /** - * The function that specifies a Windows OS system, architecture, and CPU variant. - * - * @param architecture the CPU architecture. - * @param variant the CPU variant. - * @return the next stage of the container registry task definition. - */ - TaskStepType withWindows(Architecture architecture, Variant variant); - - /** - * The function that specifies a platform. - * - * @param platformProperties the properties of the platform. - * @return the next stage of the container registry task definition. - */ - TaskStepType withPlatform(PlatformProperties platformProperties); - } - - /** The stage of the container registry task definition that specifies the type of task step. */ - interface TaskStepType { - /** - * The function that specifies a task step of type FileTaskStep. - * - * @return the first stage of the FileTaskStep definition. - */ - RegistryFileTaskStep.DefinitionStages.Blank defineFileTaskStep(); - - /** - * The function that specifies a task step of type EncodedTaskStep. - * - * @return the first stage of the EncodedTaskStep definition. - */ - RegistryEncodedTaskStep.DefinitionStages.Blank defineEncodedTaskStep(); - - /** - * The function that specifies a task step of type DockerTaskStep. - * - * @return the first stage of the DockerTaskStep definition. - */ - RegistryDockerTaskStep.DefinitionStages.Blank defineDockerTaskStep(); - } - - /** The stage of the container registry task definition that allows users to define a source trigger. */ - interface SourceTriggerDefinition { - /** - * The function that begins the definition of a source trigger. - * - * @param sourceTriggerName the name of the source trigger we are defining. - * @return the first stage of the RegistrySourceTrigger definition. - */ - RegistrySourceTrigger.DefinitionStages.Blank defineSourceTrigger(String sourceTriggerName); - } - - /** - * The stage of the container registry task definition that allows users to define either a source trigger - * and/or a base image trigger. - */ - interface TriggerTypes { - /** - * The function that begins the definition of a source trigger. - * - * @param sourceTriggerName the name of the source trigger we are defining. - * @return the first stage of the RegistrySourceTrigger definition. - */ - RegistrySourceTrigger.DefinitionStages.Blank defineSourceTrigger(String sourceTriggerName); - - /** - * The function that defines a base image trigger with the two parameters required for base image trigger - * creation. - * - * @param baseImageTriggerName the name of the base image trigger. - * @param baseImageTriggerType the trigger type for the base image. Can be "All", "Runtime", or something - * else that the user inputs. - * @return the next stage of the container registry task definition. - */ - TaskCreatable withBaseImageTrigger(String baseImageTriggerName, BaseImageTriggerType baseImageTriggerType); - - /** - * The function that defines a base image trigger with all possible parameters for base image trigger - * creation. - * - * @param baseImageTriggerName the name of the base image trigger. - * @param baseImageTriggerType the trigger type for the base image. Can be "All", "Runtime", or something - * else that the user inputs. - * @param triggerStatus the status for the trigger. Can be enabled, disabled, or something else that the - * user inputs. - * @return the next stage of the container registry task definition. - */ - TaskCreatable withBaseImageTrigger( - String baseImageTriggerName, BaseImageTriggerType baseImageTriggerType, TriggerStatus triggerStatus); - } - - /** - * The stage of the container registry task definition that specifies the AgentConfiguration for the container - * registry task. - */ - interface AgentConfiguration { - /** - * The function that specifies the count of the CPU. - * - * @param count the CPU count. - * @return the next stage of the container registry task definition. - */ - TaskCreatable withCpuCount(int count); - } - - /** - * The stage of the container registry task definition that specifies the timeout for the container registry - * task. - */ - interface Timeout { - /** - * The function that sets the timeout time. - * - * @param timeout the time for timeout. - * @return the next stage of the container registry task definition. - */ - TaskCreatable withTimeout(int timeout); - } - - /** - * The stage of the definition which contains all the minimum required inputs for the resource to be created, - * but also allows for any other optional settings to be specified. - */ - interface TaskCreatable - extends AgentConfiguration, Timeout, SourceTriggerDefinition, TriggerTypes, Creatable { - } - } - - /** Grouping of registry task update stages. */ - interface UpdateStages { - - /** The stage of the container registry task definition that specifies the type of task step. */ - interface TaskStepType { - /** - * The function that specifies a task step of type FileTaskStep. - * - * @return the first stage of the FileTaskStep update. - */ - RegistryFileTaskStep.Update updateFileTaskStep(); - - /** - * The function that specifies a task step of type EncodedTaskStep. - * - * @return the first stage of the EncodedTaskStep update. - */ - RegistryEncodedTaskStep.Update updateEncodedTaskStep(); - - /** - * The function that specifies a task step of type DockerTaskStep. - * - * @return the first stage of the DockerTaskStep update. - */ - RegistryDockerTaskStep.Update updateDockerTaskStep(); - } - - /** The stage of the container registry task update allowing to update the platform. */ - interface Platform { - /** - * The function that specifies a Linux OS system for the platform. - * - * @return the next stage of the container registry task update. - */ - Update withLinux(); - - /** - * The function that specifies a Windows OS system for the platform. - * - * @return the next stage of the container registry task update. - */ - Update withWindows(); - - /** - * The function that specifies a Linux OS system and architecture for the platform. - * - * @param architecture the CPU architecture. - * @return the next stage of the container registry task update. - */ - Update withLinux(Architecture architecture); - - /** - * The function that specifies a Windows OS system and architecture for the platform. - * - * @param architecture the CPU architecture - * @return the next stage of the container registry task update. - */ - Update withWindows(Architecture architecture); - - /** - * The function that specifies a Linux OS system, architecture, and CPU variant. - * - * @param architecture the CPU architecture. - * @param variant the CPU variant. - * @return the next stage of the container registry task update. - */ - Update withLinux(Architecture architecture, Variant variant); - - /** - * The function that specifies a Windows OS system, architecture, and CPU variant. - * - * @param architecture the CPU architecture. - * @param variant the CPU variant. - * @return the next stage of the container registry task update. - */ - Update withWindows(Architecture architecture, Variant variant); - - /** - * The function that specifies a platform. - * - * @param platformProperties the properties of the platform. - * @return the next stage of the container registry task update. - */ - Update withPlatform(PlatformUpdateParameters platformProperties); - } - - /** - * The stage of the container registry task update that allows users to update either a source trigger and/or a - * base image trigger. - */ - interface TriggerTypes { - /** - * The function that begins the definition of a source trigger. - * - * @param sourceTriggerName the name of the source trigger. - * @return the next stage of the RegistrySourceTrigger update. - */ - RegistrySourceTrigger.Update updateSourceTrigger(String sourceTriggerName); - - /** - * The function that allows us to define a new source trigger in a registry task update. - * - * @param sourceTriggerName the name of the source trigger. - * @return the next stage of the RegistrySourceTrigger update. - */ - RegistrySourceTrigger.UpdateDefinitionStages.Blank defineSourceTrigger(String sourceTriggerName); - - /** - * The function that defines a base image trigger with the two parameters required for base image trigger - * update. - * - * @param baseImageTriggerName the name of the base image trigger. - * @param baseImageTriggerType the trigger type for the base image. Can be "All", "Runtime", or something - * else that the user inputs. - * @return the next stage of the container registry task update. - */ - Update updateBaseImageTrigger(String baseImageTriggerName, BaseImageTriggerType baseImageTriggerType); - - /** - * The function that defines a base image trigger with all possible parameters for base image trigger - * update. - * - * @param baseImageTriggerName the name of the base image trigger. - * @param baseImageTriggerType the trigger type for the base image. Can be "All", "Runtime", or something - * else that the user inputs. - * @param triggerStatus the status for the trigger. Can be enabled, disabled, or something else that the - * user inputs. - * @return the next stage of the container registry task update. - */ - Update updateBaseImageTrigger( - String baseImageTriggerName, BaseImageTriggerType baseImageTriggerType, TriggerStatus triggerStatus); - } - - /** - * The stage of the container registry task update that updates the AgentConfiguration for the container - * registry task. - */ - interface AgentConfiguration { - /** - * The function that updates the count of the CPU. - * - * @param count the CPU count. - * @return the next stage of the container registry task update. - */ - Update withCpuCount(int count); - } - - /** The stage of the container registry task update that updates the timeout for the container registry task. */ - interface Timeout { - /** - * The function that updates the timeout time. - * - * @param timeout the time for timeout. - * @return the next stage of the container registry task update. - */ - Update withTimeout(int timeout); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RegistryTaskRun.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RegistryTaskRun.java deleted file mode 100644 index 4a96de8b9366..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RegistryTaskRun.java +++ /dev/null @@ -1,281 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.containerregistry.fluent.models.RunInner; -import com.azure.resourcemanager.resources.fluentcore.model.Executable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; -import java.time.OffsetDateTime; -import java.util.Map; - -/** An immutable client-side representation of an Azure RegistryDockerTaskRunRequest registry task run request. */ -@Fluent() -public interface RegistryTaskRun extends HasInnerModel, Refreshable { - /** @return the name of the resource group for this task run request */ - String resourceGroupName(); - - /** @return the registry name of this task run request */ - String registryName(); - - /** - * @return the name of the task in the case of a TaskRunRequest (or null if task is still queued), null in other - * cases - */ - String taskName(); - - /** @return the status of the run request */ - RunStatus status(); - - /** @return the run type of the run request */ - RunType runType(); - - /** @return the last time the run request was updated */ - OffsetDateTime lastUpdatedTime(); - - /** @return the time when the run request was created */ - OffsetDateTime createTime(); - - /** @return whether archiving is enabled for the run request */ - boolean isArchiveEnabled(); - - /** @return the platform properties of the run request */ - PlatformProperties platform(); - - /** @return the numbers of cpu */ - int cpu(); - - /** @return the provisioning state of the run request */ - ProvisioningState provisioningState(); - - /** @return the id of the run */ - String runId(); - - /** Container interface for all the definitions related to a RegistryTaskRun. */ - interface Definition - extends DefinitionStages.BlankFromRegistry, - DefinitionStages.BlankFromRuns, - DefinitionStages.Platform, - DefinitionStages.PlatformAltTaskRunRequest, - DefinitionStages.RegistryTaskRunRequest, - DefinitionStages.RunRequestType, - DefinitionStages.RunRequestExecutableWithSourceLocation, - DefinitionStages.RunRequestExecutable { - } - - /** Grouping of registry task run definition stages. */ - interface DefinitionStages { - /** The first stage of a a RegistryTaskRun definition if originating from a call on a registry. */ - interface BlankFromRegistry extends PlatformAltTaskRunRequest { - } - - /** - * The first stage of a RegistryTaskRun definition if definition is originating from a call on an existing - * RegistryTaskRun. - */ - interface BlankFromRuns { - /** - * The function that specifies the registry this task run is called on. - * - * @param resourceGroupName the name of the resource group of the registry. - * @param registryName the name of the registry. - * @return the next stage of the container registry task run definition. - */ - PlatformAltTaskRunRequest withExistingRegistry(String resourceGroupName, String registryName); - } - - /** - * The stage of the container registry task run definition that allows to specify the task run is going to be - * run with a TaskRunRequest. - */ - interface PlatformAltTaskRunRequest extends Platform { - /** - * The function that specifies the name of the existing task to run. - * - * @param taskName the name of the created task to pass into the task run request. - * @return the next stage of the container registry task run definition. - */ - RegistryTaskRunRequest withTaskRunRequest(String taskName); - } - - /** - * The stage of the container registry task definition for TaskRunRequests that allows the user to specify - * overriding values and whether archiving is enabled or not. - */ - interface RegistryTaskRunRequest extends RunRequestExecutable { - /** - * The function that specifies whether there are any values that will be overridden and what they will be - * overridden by. - * - * @param overridingValues a map that has the name of the value to be overridden as the key and the value is - * an OverridingValue. - * @return the next stage of the container registry task run definition. - */ - RegistryTaskRunRequest withOverridingValues(Map overridingValues); - - /** - * The function that specifies whether a single value will be overridden and what it will be overridden by. - * - * @param name the name of the value to be overridden. - * @param overridingValue the OverridingValue specifying what the value will be overridden with. - * @return the next stage of the container registry task run definition. - */ - RegistryTaskRunRequest withOverridingValue(String name, OverridingValue overridingValue); - - /** - * The function that specifies archiving will or will not be enabled. - * - * @param enabled whether archive will be enabled. - * @return the next stage of the container registry task run definition. - */ - RegistryTaskRunRequest withArchiveEnabled(boolean enabled); - } - - /** - * The stage of the container registry task definition that specifies the platform for the container registry - * task run. - */ - interface Platform { - /** - * The function that specifies the platform will have a Linux OS. - * - * @return the next stage of the container registry task run definition. - */ - RunRequestType withLinux(); - - /** - * The function that specifies the platform will have a Windows OS. - * - * @return the next stage of the container registry task run definition. - */ - RunRequestType withWindows(); - - /** - * The function that specifies the platform will have a Linux OS with Architecture architecture. - * - * @param architecture the architecture the platform will have. - * @return the next stage of the container registry task run definition. - */ - RunRequestType withLinux(Architecture architecture); - - /** - * The function that specifies the platform will have a Windows OS with Architecture architecture. - * - * @param architecture the architecture the platform will have. - * @return the next stage of the container registry task run definition. - */ - RunRequestType withWindows(Architecture architecture); - - /** - * The function that specifies the platform will have a Linux OS with Architecture architecture and Variant - * variant. - * - * @param architecture the architecture the platform will have. - * @param variant the variant the platform will have. - * @return the next stage of the container registry task run definition. - */ - RunRequestType withLinux(Architecture architecture, Variant variant); - - /** - * The function that specifies the platform will have a Windows OS with Architecture architecture and - * Variant variant. - * - * @param architecture the architecture the platform will have. - * @param variant the variant the platform will have. - * @return the next stage of the container registry task run definition. - */ - RunRequestType withWindows(Architecture architecture, Variant variant); - - /** - * The function that specifies the platform properties of the registry task run. - * - * @param platformProperties the properties of the platform. - * @return the next stage of the container registry task run definition. - */ - RunRequestType withPlatform(PlatformProperties platformProperties); - } - - /** The stage of the definition that specifies the task run request type. */ - interface RunRequestType { - /** - * The function that specifies the task run request type will be a file task. - * - * @return the next stage of the container registry task run definition. - */ - RegistryFileTaskRunRequest.DefinitionStages.Blank withFileTaskRunRequest(); - - /** - * The function that specifies the task run request type will be an encoded task. - * - * @return the next stage of the container registry task run definition. - */ - RegistryEncodedTaskRunRequest.DefinitionStages.Blank withEncodedTaskRunRequest(); - - /** - * The function that specifies the task run request type will be a Docker task. - * - * @return the next stage of the container registry task run definition. - */ - RegistryDockerTaskRunRequest.DefinitionStages.Blank withDockerTaskRunRequest(); - } - - /** - * The stage of the container registry task run that specifies the AgentConfiguration for the container registry - * task run. - */ - interface AgentConfiguration { - /** - * The function that specifies the count of the CPU. - * - * @param count the CPU count. - * @return the next stage of the container registry task run definition. - */ - RunRequestExecutable withCpuCount(int count); - } - - /** - * The stage of the container registry task run definition that specifies the enabling and disabling of - * archiving. - */ - interface Archive { - /** - * The function that specifies archiving is enabled or disabled. - * - * @param enabled whether archiving is enabled or not. - * @return the next stage of the container registry task run definition. - */ - RunRequestExecutable withArchiveEnabled(boolean enabled); - } - - /** - * The stage of the container registry task run definition which contains all the minimum required inputs for - * the resource to be executed if the task run request type is either file, encoded, or Docker, but also allows - * for any other optional settings to be specified. - */ - interface RunRequestExecutableWithSourceLocation extends AgentConfiguration, RunRequestExecutable { - /** - * The function that specifies the location of the source control. - * - * @param location the location of the source control. - * @return the next stage of the container registry task run definition. - */ - RunRequestExecutableWithSourceLocation withSourceLocation(String location); - - /** - * The function that specifies the timeout. - * - * @param timeout the time the timeout lasts. - * @return the next stage of the container registry task run definition. - */ - RunRequestExecutableWithSourceLocation withTimeout(int timeout); - } - - /** - * The stage of the definition in the case of using a TaskRunRequest which contains all the minimum required - * inputs for the resource to be executed, but also allows for any other optional settings to be specified. - */ - interface RunRequestExecutable extends Archive, Executable { - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RegistryTaskRuns.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RegistryTaskRuns.java deleted file mode 100644 index 4bd3d485e52d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RegistryTaskRuns.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import reactor.core.publisher.Mono; - -/** An immutable client-side representation of collection of Azure registry task runs. */ -@Fluent() -public interface RegistryTaskRuns { - /** - * The function that begins the steps to schedule a run. - * - * @return the next step in the execution of a run. - */ - RegistryTaskRun.DefinitionStages.BlankFromRuns scheduleRun(); - - /** - * The function that lists the RegistryTaskRun instances in a registry asynchronously. - * - * @param rgName the resource group of the parent registry. - * @param acrName the name of the parent registry. - * @return the list of RegistryTaskRun instances. - */ - PagedFlux listByRegistryAsync(String rgName, String acrName); - - /** - * The function that lists the RegistryTaskRun instances in a registry asynch. - * - * @param rgName the resource group of the parent registry. - * @param acrName the name of the parent registry. - * @return the list of RegistryTaskRun instances. - */ - PagedIterable listByRegistry(String rgName, String acrName); - - /** - * The function that returns the URI to the task run logs asynchronously. - * - * @param rgName the resource group of the parent registry. - * @param acrName the name of the parent registry. - * @param runId the id of the task run. - * @return the URI to the task run logs. - */ - Mono getLogSasUrlAsync(String rgName, String acrName, String runId); - - /** - * The function that returns the URI to the task run logs. - * - * @param rgName the resource group of the parent registry. - * @param acrName the name of the parent registry. - * @param runId the id of the task run. - * @return the URI to the task run logs. - */ - String getLogSasUrl(String rgName, String acrName, String runId); - - /** - * The function that cancels a task run asynchronously. - * - * @param rgName the resource group of the parent registry. - * @param acrName the name of the parent registry. - * @param runId the id of the task run. - * @return handle to the request. - */ - Mono cancelAsync(String rgName, String acrName, String runId); - - /** - * The function that cancels a task run. - * - * @param rgName the resource group of the parent registry. - * @param acrName the name of the parent registry. - * @param runId the id of the task run. - */ - void cancel(String rgName, String acrName, String runId); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RegistryTaskStep.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RegistryTaskStep.java deleted file mode 100644 index b44efc685d46..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RegistryTaskStep.java +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import java.util.List; - -/** An immutable client-side representation of an Azure RegistryTaskStep registry task. */ -@Fluent() -public interface RegistryTaskStep { - /** @return the base image dependencies of this RegistryTaskStep */ - List baseImageDependencies(); - - /** @return the context path of this RegistryTaskStep */ - String contextPath(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RegistryTasks.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RegistryTasks.java deleted file mode 100644 index 7b4e1cf69883..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RegistryTasks.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsCreating; -import reactor.core.publisher.Mono; - -/** Interface to define the RegistryTasks collection. */ -@Fluent() -public interface RegistryTasks extends SupportsCreating { - /** - * Lists the tasks in a registry asynchronously. - * - * @param resourceGroupName the resource group of the parent registry. - * @param registryName the name of the parent registry. - * @return the tasks with parent registry registry. - */ - PagedFlux listByRegistryAsync(String resourceGroupName, String registryName); - - /** - * Lists the tasks in a registry. - * - * @param resourceGroupName the resource group of the parent registry. - * @param registryName the name of the parent registry. - * @return the tasks with parent registry registry. - */ - PagedIterable listByRegistry(String resourceGroupName, String registryName); - - /** - * Gets a task in a registry asynchronously. - * - * @param resourceGroupName the resource group of the parent registry. - * @param registryName the name of the parent registry. - * @param taskName the name of the task. - * @param includeSecrets whether to include secrets or not. - * @return the task - */ - Mono getByRegistryAsync( - String resourceGroupName, String registryName, String taskName, boolean includeSecrets); - - /** - * Gets a task in a registry. - * - * @param resourceGroupName the resource group of the parent registry. - * @param registryName the name of the parent registry. - * @param taskName the name of the task. - * @param includeSecrets whether to include secrets or not. - * @return the task - */ - RegistryTask getByRegistry(String resourceGroupName, String registryName, String taskName, boolean includeSecrets); - - /** - * Deletes a task in a registry asynchronously. - * - * @param resourceGroupName the resource group of the parent registry. - * @param registryName the name of the parent registry. - * @param taskName the name of the task. - * @return the handle to the request. - */ - Mono deleteByRegistryAsync(String resourceGroupName, String registryName, String taskName); - - /** - * Deletes a task in a registry. - * - * @param resourceGroupName the resource group of the parent registry. - * @param registryName the name of the parent registry. - * @param taskName the name of the task. - */ - void deleteByRegistry(String resourceGroupName, String registryName, String taskName); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RegistryUpdateParameters.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RegistryUpdateParameters.java deleted file mode 100644 index d4a189dc695c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RegistryUpdateParameters.java +++ /dev/null @@ -1,166 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.containerregistry.fluent.models.RegistryPropertiesUpdateParameters; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** The parameters for updating a container registry. */ -@Fluent -public final class RegistryUpdateParameters { - /* - * The tags for the container registry. - */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map tags; - - /* - * The SKU of the container registry. - */ - @JsonProperty(value = "sku") - private Sku sku; - - /* - * The properties that the container registry will be updated with. - */ - @JsonProperty(value = "properties") - private RegistryPropertiesUpdateParameters innerProperties; - - /** - * Get the tags property: The tags for the container registry. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: The tags for the container registry. - * - * @param tags the tags value to set. - * @return the RegistryUpdateParameters object itself. - */ - public RegistryUpdateParameters withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Get the sku property: The SKU of the container registry. - * - * @return the sku value. - */ - public Sku sku() { - return this.sku; - } - - /** - * Set the sku property: The SKU of the container registry. - * - * @param sku the sku value to set. - * @return the RegistryUpdateParameters object itself. - */ - public RegistryUpdateParameters withSku(Sku sku) { - this.sku = sku; - return this; - } - - /** - * Get the innerProperties property: The properties that the container registry will be updated with. - * - * @return the innerProperties value. - */ - private RegistryPropertiesUpdateParameters innerProperties() { - return this.innerProperties; - } - - /** - * Get the adminUserEnabled property: The value that indicates whether the admin user is enabled. - * - * @return the adminUserEnabled value. - */ - public Boolean adminUserEnabled() { - return this.innerProperties() == null ? null : this.innerProperties().adminUserEnabled(); - } - - /** - * Set the adminUserEnabled property: The value that indicates whether the admin user is enabled. - * - * @param adminUserEnabled the adminUserEnabled value to set. - * @return the RegistryUpdateParameters object itself. - */ - public RegistryUpdateParameters withAdminUserEnabled(Boolean adminUserEnabled) { - if (this.innerProperties() == null) { - this.innerProperties = new RegistryPropertiesUpdateParameters(); - } - this.innerProperties().withAdminUserEnabled(adminUserEnabled); - return this; - } - - /** - * Get the networkRuleSet property: The network rule set for a container registry. - * - * @return the networkRuleSet value. - */ - public NetworkRuleSet networkRuleSet() { - return this.innerProperties() == null ? null : this.innerProperties().networkRuleSet(); - } - - /** - * Set the networkRuleSet property: The network rule set for a container registry. - * - * @param networkRuleSet the networkRuleSet value to set. - * @return the RegistryUpdateParameters object itself. - */ - public RegistryUpdateParameters withNetworkRuleSet(NetworkRuleSet networkRuleSet) { - if (this.innerProperties() == null) { - this.innerProperties = new RegistryPropertiesUpdateParameters(); - } - this.innerProperties().withNetworkRuleSet(networkRuleSet); - return this; - } - - /** - * Get the policies property: The policies for a container registry. - * - * @return the policies value. - */ - public Policies policies() { - return this.innerProperties() == null ? null : this.innerProperties().policies(); - } - - /** - * Set the policies property: The policies for a container registry. - * - * @param policies the policies value to set. - * @return the RegistryUpdateParameters object itself. - */ - public RegistryUpdateParameters withPolicies(Policies policies) { - if (this.innerProperties() == null) { - this.innerProperties = new RegistryPropertiesUpdateParameters(); - } - this.innerProperties().withPolicies(policies); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (sku() != null) { - sku().validate(); - } - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RegistryUsage.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RegistryUsage.java deleted file mode 100644 index 8b39b66ae18f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RegistryUsage.java +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The quota usage for a container registry. */ -@Fluent -public final class RegistryUsage { - /* - * The name of the usage. - */ - @JsonProperty(value = "name") - private String name; - - /* - * The limit of the usage. - */ - @JsonProperty(value = "limit") - private Long limit; - - /* - * The current value of the usage. - */ - @JsonProperty(value = "currentValue") - private Long currentValue; - - /* - * The unit of measurement. - */ - @JsonProperty(value = "unit") - private RegistryUsageUnit unit; - - /** - * Get the name property: The name of the usage. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the usage. - * - * @param name the name value to set. - * @return the RegistryUsage object itself. - */ - public RegistryUsage withName(String name) { - this.name = name; - return this; - } - - /** - * Get the limit property: The limit of the usage. - * - * @return the limit value. - */ - public Long limit() { - return this.limit; - } - - /** - * Set the limit property: The limit of the usage. - * - * @param limit the limit value to set. - * @return the RegistryUsage object itself. - */ - public RegistryUsage withLimit(Long limit) { - this.limit = limit; - return this; - } - - /** - * Get the currentValue property: The current value of the usage. - * - * @return the currentValue value. - */ - public Long currentValue() { - return this.currentValue; - } - - /** - * Set the currentValue property: The current value of the usage. - * - * @param currentValue the currentValue value to set. - * @return the RegistryUsage object itself. - */ - public RegistryUsage withCurrentValue(Long currentValue) { - this.currentValue = currentValue; - return this; - } - - /** - * Get the unit property: The unit of measurement. - * - * @return the unit value. - */ - public RegistryUsageUnit unit() { - return this.unit; - } - - /** - * Set the unit property: The unit of measurement. - * - * @param unit the unit value to set. - * @return the RegistryUsage object itself. - */ - public RegistryUsage withUnit(RegistryUsageUnit unit) { - this.unit = unit; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RegistryUsageUnit.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RegistryUsageUnit.java deleted file mode 100644 index f08e42a0c1ba..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RegistryUsageUnit.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for RegistryUsageUnit. */ -public final class RegistryUsageUnit extends ExpandableStringEnum { - /** Static value Count for RegistryUsageUnit. */ - public static final RegistryUsageUnit COUNT = fromString("Count"); - - /** Static value Bytes for RegistryUsageUnit. */ - public static final RegistryUsageUnit BYTES = fromString("Bytes"); - - /** - * Creates or finds a RegistryUsageUnit from its string representation. - * - * @param name a name to look for. - * @return the corresponding RegistryUsageUnit. - */ - @JsonCreator - public static RegistryUsageUnit fromString(String name) { - return fromString(name, RegistryUsageUnit.class); - } - - /** - * Gets known RegistryUsageUnit values. - * - * @return known RegistryUsageUnit values. - */ - public static Collection values() { - return values(RegistryUsageUnit.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/ReplicationListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/ReplicationListResult.java deleted file mode 100644 index 4c45b214a3ea..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/ReplicationListResult.java +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.containerregistry.fluent.models.ReplicationInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The result of a request to list replications for a container registry. */ -@Fluent -public final class ReplicationListResult { - /* - * The list of replications. Since this list may be incomplete, the - * nextLink field should be used to request the next list of replications. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URI that can be used to request the next list of replications. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: The list of replications. Since this list may be incomplete, the nextLink field should be - * used to request the next list of replications. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The list of replications. Since this list may be incomplete, the nextLink field should be - * used to request the next list of replications. - * - * @param value the value value to set. - * @return the ReplicationListResult object itself. - */ - public ReplicationListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URI that can be used to request the next list of replications. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The URI that can be used to request the next list of replications. - * - * @param nextLink the nextLink value to set. - * @return the ReplicationListResult object itself. - */ - public ReplicationListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/ReplicationUpdateParameters.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/ReplicationUpdateParameters.java deleted file mode 100644 index 38526615aecb..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/ReplicationUpdateParameters.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** The parameters for updating a replication. */ -@Fluent -public final class ReplicationUpdateParameters { - /* - * The tags for the replication. - */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map tags; - - /** - * Get the tags property: The tags for the replication. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: The tags for the replication. - * - * @param tags the tags value to set. - * @return the ReplicationUpdateParameters object itself. - */ - public ReplicationUpdateParameters withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/Request.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/Request.java deleted file mode 100644 index 750a3ffa3fbf..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/Request.java +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The request that generated the event. */ -@Fluent -public final class Request { - /* - * The ID of the request that initiated the event. - */ - @JsonProperty(value = "id") - private String id; - - /* - * The IP or hostname and possibly port of the client connection that - * initiated the event. This is the RemoteAddr from the standard http - * request. - */ - @JsonProperty(value = "addr") - private String addr; - - /* - * The externally accessible hostname of the registry instance, as - * specified by the http host header on incoming requests. - */ - @JsonProperty(value = "host") - private String host; - - /* - * The request method that generated the event. - */ - @JsonProperty(value = "method") - private String method; - - /* - * The user agent header of the request. - */ - @JsonProperty(value = "useragent") - private String useragent; - - /** - * Get the id property: The ID of the request that initiated the event. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: The ID of the request that initiated the event. - * - * @param id the id value to set. - * @return the Request object itself. - */ - public Request withId(String id) { - this.id = id; - return this; - } - - /** - * Get the addr property: The IP or hostname and possibly port of the client connection that initiated the event. - * This is the RemoteAddr from the standard http request. - * - * @return the addr value. - */ - public String addr() { - return this.addr; - } - - /** - * Set the addr property: The IP or hostname and possibly port of the client connection that initiated the event. - * This is the RemoteAddr from the standard http request. - * - * @param addr the addr value to set. - * @return the Request object itself. - */ - public Request withAddr(String addr) { - this.addr = addr; - return this; - } - - /** - * Get the host property: The externally accessible hostname of the registry instance, as specified by the http host - * header on incoming requests. - * - * @return the host value. - */ - public String host() { - return this.host; - } - - /** - * Set the host property: The externally accessible hostname of the registry instance, as specified by the http host - * header on incoming requests. - * - * @param host the host value to set. - * @return the Request object itself. - */ - public Request withHost(String host) { - this.host = host; - return this; - } - - /** - * Get the method property: The request method that generated the event. - * - * @return the method value. - */ - public String method() { - return this.method; - } - - /** - * Set the method property: The request method that generated the event. - * - * @param method the method value to set. - * @return the Request object itself. - */ - public Request withMethod(String method) { - this.method = method; - return this; - } - - /** - * Get the useragent property: The user agent header of the request. - * - * @return the useragent value. - */ - public String useragent() { - return this.useragent; - } - - /** - * Set the useragent property: The user agent header of the request. - * - * @param useragent the useragent value to set. - * @return the Request object itself. - */ - public Request withUseragent(String useragent) { - this.useragent = useragent; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/ResourceIdentityType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/ResourceIdentityType.java deleted file mode 100644 index 0f708ec9afe5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/ResourceIdentityType.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for ResourceIdentityType. */ -public enum ResourceIdentityType { - /** Enum value SystemAssigned. */ - SYSTEM_ASSIGNED("SystemAssigned"), - - /** Enum value UserAssigned. */ - USER_ASSIGNED("UserAssigned"), - - /** Enum value SystemAssigned, UserAssigned. */ - SYSTEM_ASSIGNED_USER_ASSIGNED("SystemAssigned, UserAssigned"), - - /** Enum value None. */ - NONE("None"); - - /** The actual serialized value for a ResourceIdentityType instance. */ - private final String value; - - ResourceIdentityType(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a ResourceIdentityType instance. - * - * @param value the serialized value to parse. - * @return the parsed ResourceIdentityType object, or null if unable to parse. - */ - @JsonCreator - public static ResourceIdentityType fromString(String value) { - ResourceIdentityType[] items = ResourceIdentityType.values(); - for (ResourceIdentityType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RetentionPolicy.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RetentionPolicy.java deleted file mode 100644 index 88ae83fbbb28..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RetentionPolicy.java +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** The retention policy for a container registry. */ -@Fluent -public final class RetentionPolicy { - /* - * The number of days to retain an untagged manifest after which it gets - * purged. - */ - @JsonProperty(value = "days") - private Integer days; - - /* - * The timestamp when the policy was last updated. - */ - @JsonProperty(value = "lastUpdatedTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime lastUpdatedTime; - - /* - * The value that indicates whether the policy is enabled or not. - */ - @JsonProperty(value = "status") - private PolicyStatus status; - - /** - * Get the days property: The number of days to retain an untagged manifest after which it gets purged. - * - * @return the days value. - */ - public Integer days() { - return this.days; - } - - /** - * Set the days property: The number of days to retain an untagged manifest after which it gets purged. - * - * @param days the days value to set. - * @return the RetentionPolicy object itself. - */ - public RetentionPolicy withDays(Integer days) { - this.days = days; - return this; - } - - /** - * Get the lastUpdatedTime property: The timestamp when the policy was last updated. - * - * @return the lastUpdatedTime value. - */ - public OffsetDateTime lastUpdatedTime() { - return this.lastUpdatedTime; - } - - /** - * Get the status property: The value that indicates whether the policy is enabled or not. - * - * @return the status value. - */ - public PolicyStatus status() { - return this.status; - } - - /** - * Set the status property: The value that indicates whether the policy is enabled or not. - * - * @param status the status value to set. - * @return the RetentionPolicy object itself. - */ - public RetentionPolicy withStatus(PolicyStatus status) { - this.status = status; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RunListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RunListResult.java deleted file mode 100644 index d86638c205f4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RunListResult.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.containerregistry.fluent.models.RunInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Collection of runs. */ -@Fluent -public final class RunListResult { - /* - * The collection value. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URI that can be used to request the next set of paged results. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: The collection value. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The collection value. - * - * @param value the value value to set. - * @return the RunListResult object itself. - */ - public RunListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URI that can be used to request the next set of paged results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The URI that can be used to request the next set of paged results. - * - * @param nextLink the nextLink value to set. - * @return the RunListResult object itself. - */ - public RunListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RunRequest.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RunRequest.java deleted file mode 100644 index 093882aa191a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RunRequest.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** The request parameters for scheduling a run. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "type", - defaultImpl = RunRequest.class) -@JsonTypeName("RunRequest") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "DockerBuildRequest", value = DockerBuildRequest.class), - @JsonSubTypes.Type(name = "FileTaskRunRequest", value = FileTaskRunRequest.class), - @JsonSubTypes.Type(name = "TaskRunRequest", value = TaskRunRequest.class), - @JsonSubTypes.Type(name = "EncodedTaskRunRequest", value = EncodedTaskRunRequest.class) -}) -@Fluent -public class RunRequest { - /* - * The value that indicates whether archiving is enabled for the run or - * not. - */ - @JsonProperty(value = "isArchiveEnabled") - private Boolean isArchiveEnabled; - - /** - * Get the isArchiveEnabled property: The value that indicates whether archiving is enabled for the run or not. - * - * @return the isArchiveEnabled value. - */ - public Boolean isArchiveEnabled() { - return this.isArchiveEnabled; - } - - /** - * Set the isArchiveEnabled property: The value that indicates whether archiving is enabled for the run or not. - * - * @param isArchiveEnabled the isArchiveEnabled value to set. - * @return the RunRequest object itself. - */ - public RunRequest withIsArchiveEnabled(Boolean isArchiveEnabled) { - this.isArchiveEnabled = isArchiveEnabled; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RunStatus.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RunStatus.java deleted file mode 100644 index 934de8d29082..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RunStatus.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for RunStatus. */ -public final class RunStatus extends ExpandableStringEnum { - /** Static value Queued for RunStatus. */ - public static final RunStatus QUEUED = fromString("Queued"); - - /** Static value Started for RunStatus. */ - public static final RunStatus STARTED = fromString("Started"); - - /** Static value Running for RunStatus. */ - public static final RunStatus RUNNING = fromString("Running"); - - /** Static value Succeeded for RunStatus. */ - public static final RunStatus SUCCEEDED = fromString("Succeeded"); - - /** Static value Failed for RunStatus. */ - public static final RunStatus FAILED = fromString("Failed"); - - /** Static value Canceled for RunStatus. */ - public static final RunStatus CANCELED = fromString("Canceled"); - - /** Static value Error for RunStatus. */ - public static final RunStatus ERROR = fromString("Error"); - - /** Static value Timeout for RunStatus. */ - public static final RunStatus TIMEOUT = fromString("Timeout"); - - /** - * Creates or finds a RunStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding RunStatus. - */ - @JsonCreator - public static RunStatus fromString(String name) { - return fromString(name, RunStatus.class); - } - - /** - * Gets known RunStatus values. - * - * @return known RunStatus values. - */ - public static Collection values() { - return values(RunStatus.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RunType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RunType.java deleted file mode 100644 index 295f70e97a98..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RunType.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for RunType. */ -public final class RunType extends ExpandableStringEnum { - /** Static value QuickBuild for RunType. */ - public static final RunType QUICK_BUILD = fromString("QuickBuild"); - - /** Static value QuickRun for RunType. */ - public static final RunType QUICK_RUN = fromString("QuickRun"); - - /** Static value AutoBuild for RunType. */ - public static final RunType AUTO_BUILD = fromString("AutoBuild"); - - /** Static value AutoRun for RunType. */ - public static final RunType AUTO_RUN = fromString("AutoRun"); - - /** - * Creates or finds a RunType from its string representation. - * - * @param name a name to look for. - * @return the corresponding RunType. - */ - @JsonCreator - public static RunType fromString(String name) { - return fromString(name, RunType.class); - } - - /** - * Gets known RunType values. - * - * @return known RunType values. - */ - public static Collection values() { - return values(RunType.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RunUpdateParameters.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RunUpdateParameters.java deleted file mode 100644 index 67a881c2f392..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RunUpdateParameters.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The set of run properties that can be updated. */ -@Fluent -public final class RunUpdateParameters { - /* - * The value that indicates whether archiving is enabled or not. - */ - @JsonProperty(value = "isArchiveEnabled") - private Boolean isArchiveEnabled; - - /** - * Get the isArchiveEnabled property: The value that indicates whether archiving is enabled or not. - * - * @return the isArchiveEnabled value. - */ - public Boolean isArchiveEnabled() { - return this.isArchiveEnabled; - } - - /** - * Set the isArchiveEnabled property: The value that indicates whether archiving is enabled or not. - * - * @param isArchiveEnabled the isArchiveEnabled value to set. - * @return the RunUpdateParameters object itself. - */ - public RunUpdateParameters withIsArchiveEnabled(Boolean isArchiveEnabled) { - this.isArchiveEnabled = isArchiveEnabled; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SecretObject.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SecretObject.java deleted file mode 100644 index 3b5f316f7f22..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SecretObject.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describes the properties of a secret object value. */ -@Fluent -public final class SecretObject { - /* - * The value of the secret. The format of this value will be determined - * based on the type of the secret object. If the type is Opaque, the value - * will be - * used as is without any modification. - */ - @JsonProperty(value = "value") - private String value; - - /* - * The type of the secret object which determines how the value of the - * secret object has to be - * interpreted. - */ - @JsonProperty(value = "type") - private SecretObjectType type; - - /** - * Get the value property: The value of the secret. The format of this value will be determined based on the type of - * the secret object. If the type is Opaque, the value will be used as is without any modification. - * - * @return the value value. - */ - public String value() { - return this.value; - } - - /** - * Set the value property: The value of the secret. The format of this value will be determined based on the type of - * the secret object. If the type is Opaque, the value will be used as is without any modification. - * - * @param value the value value to set. - * @return the SecretObject object itself. - */ - public SecretObject withValue(String value) { - this.value = value; - return this; - } - - /** - * Get the type property: The type of the secret object which determines how the value of the secret object has to - * be interpreted. - * - * @return the type value. - */ - public SecretObjectType type() { - return this.type; - } - - /** - * Set the type property: The type of the secret object which determines how the value of the secret object has to - * be interpreted. - * - * @param type the type value to set. - * @return the SecretObject object itself. - */ - public SecretObject withType(SecretObjectType type) { - this.type = type; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SecretObjectType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SecretObjectType.java deleted file mode 100644 index c14f2a234292..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SecretObjectType.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for SecretObjectType. */ -public final class SecretObjectType extends ExpandableStringEnum { - /** Static value Opaque for SecretObjectType. */ - public static final SecretObjectType OPAQUE = fromString("Opaque"); - - /** Static value Vaultsecret for SecretObjectType. */ - public static final SecretObjectType VAULTSECRET = fromString("Vaultsecret"); - - /** - * Creates or finds a SecretObjectType from its string representation. - * - * @param name a name to look for. - * @return the corresponding SecretObjectType. - */ - @JsonCreator - public static SecretObjectType fromString(String name) { - return fromString(name, SecretObjectType.class); - } - - /** - * Gets known SecretObjectType values. - * - * @return known SecretObjectType values. - */ - public static Collection values() { - return values(SecretObjectType.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SetValue.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SetValue.java deleted file mode 100644 index 3caa2fbb3bc6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SetValue.java +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The properties of a overridable value that can be passed to a task template. */ -@Fluent -public final class SetValue { - /* - * The name of the overridable value. - */ - @JsonProperty(value = "name", required = true) - private String name; - - /* - * The overridable value. - */ - @JsonProperty(value = "value", required = true) - private String value; - - /* - * Flag to indicate whether the value represents a secret or not. - */ - @JsonProperty(value = "isSecret") - private Boolean isSecret; - - /** - * Get the name property: The name of the overridable value. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the overridable value. - * - * @param name the name value to set. - * @return the SetValue object itself. - */ - public SetValue withName(String name) { - this.name = name; - return this; - } - - /** - * Get the value property: The overridable value. - * - * @return the value value. - */ - public String value() { - return this.value; - } - - /** - * Set the value property: The overridable value. - * - * @param value the value value to set. - * @return the SetValue object itself. - */ - public SetValue withValue(String value) { - this.value = value; - return this; - } - - /** - * Get the isSecret property: Flag to indicate whether the value represents a secret or not. - * - * @return the isSecret value. - */ - public Boolean isSecret() { - return this.isSecret; - } - - /** - * Set the isSecret property: Flag to indicate whether the value represents a secret or not. - * - * @param isSecret the isSecret value to set. - * @return the SetValue object itself. - */ - public SetValue withIsSecret(Boolean isSecret) { - this.isSecret = isSecret; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() == null) { - throw LOGGER - .logExceptionAsError(new IllegalArgumentException("Missing required property name in model SetValue")); - } - if (value() == null) { - throw LOGGER - .logExceptionAsError(new IllegalArgumentException("Missing required property value in model SetValue")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(SetValue.class); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/Sku.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/Sku.java deleted file mode 100644 index cfd5db20fb7c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/Sku.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The SKU of a container registry. */ -@Fluent -public final class Sku { - /* - * The SKU name of the container registry. Required for registry creation. - */ - @JsonProperty(value = "name", required = true) - private SkuName name; - - /* - * The SKU tier based on the SKU name. - */ - @JsonProperty(value = "tier", access = JsonProperty.Access.WRITE_ONLY) - private SkuTier tier; - - /** - * Get the name property: The SKU name of the container registry. Required for registry creation. - * - * @return the name value. - */ - public SkuName name() { - return this.name; - } - - /** - * Set the name property: The SKU name of the container registry. Required for registry creation. - * - * @param name the name value to set. - * @return the Sku object itself. - */ - public Sku withName(SkuName name) { - this.name = name; - return this; - } - - /** - * Get the tier property: The SKU tier based on the SKU name. - * - * @return the tier value. - */ - public SkuTier tier() { - return this.tier; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() == null) { - throw LOGGER - .logExceptionAsError(new IllegalArgumentException("Missing required property name in model Sku")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(Sku.class); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SkuName.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SkuName.java deleted file mode 100644 index ac05e0f0048f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SkuName.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for SkuName. */ -public final class SkuName extends ExpandableStringEnum { - /** Static value Classic for SkuName. */ - public static final SkuName CLASSIC = fromString("Classic"); - - /** Static value Basic for SkuName. */ - public static final SkuName BASIC = fromString("Basic"); - - /** Static value Standard for SkuName. */ - public static final SkuName STANDARD = fromString("Standard"); - - /** Static value Premium for SkuName. */ - public static final SkuName PREMIUM = fromString("Premium"); - - /** - * Creates or finds a SkuName from its string representation. - * - * @param name a name to look for. - * @return the corresponding SkuName. - */ - @JsonCreator - public static SkuName fromString(String name) { - return fromString(name, SkuName.class); - } - - /** - * Gets known SkuName values. - * - * @return known SkuName values. - */ - public static Collection values() { - return values(SkuName.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SkuTier.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SkuTier.java deleted file mode 100644 index af594a0bb584..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SkuTier.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for SkuTier. */ -public final class SkuTier extends ExpandableStringEnum { - /** Static value Classic for SkuTier. */ - public static final SkuTier CLASSIC = fromString("Classic"); - - /** Static value Basic for SkuTier. */ - public static final SkuTier BASIC = fromString("Basic"); - - /** Static value Standard for SkuTier. */ - public static final SkuTier STANDARD = fromString("Standard"); - - /** Static value Premium for SkuTier. */ - public static final SkuTier PREMIUM = fromString("Premium"); - - /** - * Creates or finds a SkuTier from its string representation. - * - * @param name a name to look for. - * @return the corresponding SkuTier. - */ - @JsonCreator - public static SkuTier fromString(String name) { - return fromString(name, SkuTier.class); - } - - /** - * Gets known SkuTier values. - * - * @return known SkuTier values. - */ - public static Collection values() { - return values(SkuTier.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/Source.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/Source.java deleted file mode 100644 index 3c64bedb66cd..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/Source.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * The registry node that generated the event. Put differently, while the actor initiates the event, the source - * generates it. - */ -@Fluent -public final class Source { - /* - * The IP or hostname and the port of the registry node that generated the - * event. Generally, this will be resolved by os.Hostname() along with the - * running port. - */ - @JsonProperty(value = "addr") - private String addr; - - /* - * The running instance of an application. Changes after each restart. - */ - @JsonProperty(value = "instanceID") - private String instanceId; - - /** - * Get the addr property: The IP or hostname and the port of the registry node that generated the event. Generally, - * this will be resolved by os.Hostname() along with the running port. - * - * @return the addr value. - */ - public String addr() { - return this.addr; - } - - /** - * Set the addr property: The IP or hostname and the port of the registry node that generated the event. Generally, - * this will be resolved by os.Hostname() along with the running port. - * - * @param addr the addr value to set. - * @return the Source object itself. - */ - public Source withAddr(String addr) { - this.addr = addr; - return this; - } - - /** - * Get the instanceId property: The running instance of an application. Changes after each restart. - * - * @return the instanceId value. - */ - public String instanceId() { - return this.instanceId; - } - - /** - * Set the instanceId property: The running instance of an application. Changes after each restart. - * - * @param instanceId the instanceId value to set. - * @return the Source object itself. - */ - public Source withInstanceId(String instanceId) { - this.instanceId = instanceId; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SourceControlType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SourceControlType.java deleted file mode 100644 index fa67f2e53911..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SourceControlType.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for SourceControlType. */ -public final class SourceControlType extends ExpandableStringEnum { - /** Static value Github for SourceControlType. */ - public static final SourceControlType GITHUB = fromString("Github"); - - /** Static value VisualStudioTeamService for SourceControlType. */ - public static final SourceControlType VISUAL_STUDIO_TEAM_SERVICE = fromString("VisualStudioTeamService"); - - /** - * Creates or finds a SourceControlType from its string representation. - * - * @param name a name to look for. - * @return the corresponding SourceControlType. - */ - @JsonCreator - public static SourceControlType fromString(String name) { - return fromString(name, SourceControlType.class); - } - - /** - * Gets known SourceControlType values. - * - * @return known SourceControlType values. - */ - public static Collection values() { - return values(SourceControlType.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SourceProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SourceProperties.java deleted file mode 100644 index 974a1ffaede4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SourceProperties.java +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The properties of the source code repository. */ -@Fluent -public final class SourceProperties { - /* - * The type of source control service. - */ - @JsonProperty(value = "sourceControlType", required = true) - private SourceControlType sourceControlType; - - /* - * The full URL to the source code repository - */ - @JsonProperty(value = "repositoryUrl", required = true) - private String repositoryUrl; - - /* - * The branch name of the source code. - */ - @JsonProperty(value = "branch") - private String branch; - - /* - * The authorization properties for accessing the source code repository - * and to set up - * webhooks for notifications. - */ - @JsonProperty(value = "sourceControlAuthProperties") - private AuthInfo sourceControlAuthProperties; - - /** - * Get the sourceControlType property: The type of source control service. - * - * @return the sourceControlType value. - */ - public SourceControlType sourceControlType() { - return this.sourceControlType; - } - - /** - * Set the sourceControlType property: The type of source control service. - * - * @param sourceControlType the sourceControlType value to set. - * @return the SourceProperties object itself. - */ - public SourceProperties withSourceControlType(SourceControlType sourceControlType) { - this.sourceControlType = sourceControlType; - return this; - } - - /** - * Get the repositoryUrl property: The full URL to the source code repository. - * - * @return the repositoryUrl value. - */ - public String repositoryUrl() { - return this.repositoryUrl; - } - - /** - * Set the repositoryUrl property: The full URL to the source code repository. - * - * @param repositoryUrl the repositoryUrl value to set. - * @return the SourceProperties object itself. - */ - public SourceProperties withRepositoryUrl(String repositoryUrl) { - this.repositoryUrl = repositoryUrl; - return this; - } - - /** - * Get the branch property: The branch name of the source code. - * - * @return the branch value. - */ - public String branch() { - return this.branch; - } - - /** - * Set the branch property: The branch name of the source code. - * - * @param branch the branch value to set. - * @return the SourceProperties object itself. - */ - public SourceProperties withBranch(String branch) { - this.branch = branch; - return this; - } - - /** - * Get the sourceControlAuthProperties property: The authorization properties for accessing the source code - * repository and to set up webhooks for notifications. - * - * @return the sourceControlAuthProperties value. - */ - public AuthInfo sourceControlAuthProperties() { - return this.sourceControlAuthProperties; - } - - /** - * Set the sourceControlAuthProperties property: The authorization properties for accessing the source code - * repository and to set up webhooks for notifications. - * - * @param sourceControlAuthProperties the sourceControlAuthProperties value to set. - * @return the SourceProperties object itself. - */ - public SourceProperties withSourceControlAuthProperties(AuthInfo sourceControlAuthProperties) { - this.sourceControlAuthProperties = sourceControlAuthProperties; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (sourceControlType() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property sourceControlType in model SourceProperties")); - } - if (repositoryUrl() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property repositoryUrl in model SourceProperties")); - } - if (sourceControlAuthProperties() != null) { - sourceControlAuthProperties().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(SourceProperties.class); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SourceRegistryCredentials.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SourceRegistryCredentials.java deleted file mode 100644 index db38227274c9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SourceRegistryCredentials.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describes the credential parameters for accessing the source registry. */ -@Fluent -public final class SourceRegistryCredentials { - /* - * The authentication mode which determines the source registry login - * scope. The credentials for the source registry - * will be generated using the given scope. These credentials will be used - * to login to - * the source registry during the run. - */ - @JsonProperty(value = "loginMode") - private SourceRegistryLoginMode loginMode; - - /** - * Get the loginMode property: The authentication mode which determines the source registry login scope. The - * credentials for the source registry will be generated using the given scope. These credentials will be used to - * login to the source registry during the run. - * - * @return the loginMode value. - */ - public SourceRegistryLoginMode loginMode() { - return this.loginMode; - } - - /** - * Set the loginMode property: The authentication mode which determines the source registry login scope. The - * credentials for the source registry will be generated using the given scope. These credentials will be used to - * login to the source registry during the run. - * - * @param loginMode the loginMode value to set. - * @return the SourceRegistryCredentials object itself. - */ - public SourceRegistryCredentials withLoginMode(SourceRegistryLoginMode loginMode) { - this.loginMode = loginMode; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SourceRegistryLoginMode.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SourceRegistryLoginMode.java deleted file mode 100644 index d03470d4a8df..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SourceRegistryLoginMode.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for SourceRegistryLoginMode. */ -public final class SourceRegistryLoginMode extends ExpandableStringEnum { - /** Static value None for SourceRegistryLoginMode. */ - public static final SourceRegistryLoginMode NONE = fromString("None"); - - /** Static value Default for SourceRegistryLoginMode. */ - public static final SourceRegistryLoginMode DEFAULT = fromString("Default"); - - /** - * Creates or finds a SourceRegistryLoginMode from its string representation. - * - * @param name a name to look for. - * @return the corresponding SourceRegistryLoginMode. - */ - @JsonCreator - public static SourceRegistryLoginMode fromString(String name) { - return fromString(name, SourceRegistryLoginMode.class); - } - - /** - * Gets known SourceRegistryLoginMode values. - * - * @return known SourceRegistryLoginMode values. - */ - public static Collection values() { - return values(SourceRegistryLoginMode.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SourceTrigger.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SourceTrigger.java deleted file mode 100644 index 200513df772d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SourceTrigger.java +++ /dev/null @@ -1,146 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The properties of a source based trigger. */ -@Fluent -public final class SourceTrigger { - /* - * The properties that describes the source(code) for the task. - */ - @JsonProperty(value = "sourceRepository", required = true) - private SourceProperties sourceRepository; - - /* - * The source event corresponding to the trigger. - */ - @JsonProperty(value = "sourceTriggerEvents", required = true) - private List sourceTriggerEvents; - - /* - * The current status of trigger. - */ - @JsonProperty(value = "status") - private TriggerStatus status; - - /* - * The name of the trigger. - */ - @JsonProperty(value = "name", required = true) - private String name; - - /** - * Get the sourceRepository property: The properties that describes the source(code) for the task. - * - * @return the sourceRepository value. - */ - public SourceProperties sourceRepository() { - return this.sourceRepository; - } - - /** - * Set the sourceRepository property: The properties that describes the source(code) for the task. - * - * @param sourceRepository the sourceRepository value to set. - * @return the SourceTrigger object itself. - */ - public SourceTrigger withSourceRepository(SourceProperties sourceRepository) { - this.sourceRepository = sourceRepository; - return this; - } - - /** - * Get the sourceTriggerEvents property: The source event corresponding to the trigger. - * - * @return the sourceTriggerEvents value. - */ - public List sourceTriggerEvents() { - return this.sourceTriggerEvents; - } - - /** - * Set the sourceTriggerEvents property: The source event corresponding to the trigger. - * - * @param sourceTriggerEvents the sourceTriggerEvents value to set. - * @return the SourceTrigger object itself. - */ - public SourceTrigger withSourceTriggerEvents(List sourceTriggerEvents) { - this.sourceTriggerEvents = sourceTriggerEvents; - return this; - } - - /** - * Get the status property: The current status of trigger. - * - * @return the status value. - */ - public TriggerStatus status() { - return this.status; - } - - /** - * Set the status property: The current status of trigger. - * - * @param status the status value to set. - * @return the SourceTrigger object itself. - */ - public SourceTrigger withStatus(TriggerStatus status) { - this.status = status; - return this; - } - - /** - * Get the name property: The name of the trigger. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the trigger. - * - * @param name the name value to set. - * @return the SourceTrigger object itself. - */ - public SourceTrigger withName(String name) { - this.name = name; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (sourceRepository() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property sourceRepository in model SourceTrigger")); - } else { - sourceRepository().validate(); - } - if (sourceTriggerEvents() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property sourceTriggerEvents in model SourceTrigger")); - } - if (name() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property name in model SourceTrigger")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(SourceTrigger.class); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SourceTriggerDescriptor.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SourceTriggerDescriptor.java deleted file mode 100644 index c0e75e56e466..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SourceTriggerDescriptor.java +++ /dev/null @@ -1,202 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The source trigger that caused a run. */ -@Fluent -public final class SourceTriggerDescriptor { - /* - * The unique ID of the trigger. - */ - @JsonProperty(value = "id") - private String id; - - /* - * The event type of the trigger. - */ - @JsonProperty(value = "eventType") - private String eventType; - - /* - * The unique ID that identifies a commit. - */ - @JsonProperty(value = "commitId") - private String commitId; - - /* - * The unique ID that identifies pull request. - */ - @JsonProperty(value = "pullRequestId") - private String pullRequestId; - - /* - * The repository URL. - */ - @JsonProperty(value = "repositoryUrl") - private String repositoryUrl; - - /* - * The branch name in the repository. - */ - @JsonProperty(value = "branchName") - private String branchName; - - /* - * The source control provider type. - */ - @JsonProperty(value = "providerType") - private String providerType; - - /** - * Get the id property: The unique ID of the trigger. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: The unique ID of the trigger. - * - * @param id the id value to set. - * @return the SourceTriggerDescriptor object itself. - */ - public SourceTriggerDescriptor withId(String id) { - this.id = id; - return this; - } - - /** - * Get the eventType property: The event type of the trigger. - * - * @return the eventType value. - */ - public String eventType() { - return this.eventType; - } - - /** - * Set the eventType property: The event type of the trigger. - * - * @param eventType the eventType value to set. - * @return the SourceTriggerDescriptor object itself. - */ - public SourceTriggerDescriptor withEventType(String eventType) { - this.eventType = eventType; - return this; - } - - /** - * Get the commitId property: The unique ID that identifies a commit. - * - * @return the commitId value. - */ - public String commitId() { - return this.commitId; - } - - /** - * Set the commitId property: The unique ID that identifies a commit. - * - * @param commitId the commitId value to set. - * @return the SourceTriggerDescriptor object itself. - */ - public SourceTriggerDescriptor withCommitId(String commitId) { - this.commitId = commitId; - return this; - } - - /** - * Get the pullRequestId property: The unique ID that identifies pull request. - * - * @return the pullRequestId value. - */ - public String pullRequestId() { - return this.pullRequestId; - } - - /** - * Set the pullRequestId property: The unique ID that identifies pull request. - * - * @param pullRequestId the pullRequestId value to set. - * @return the SourceTriggerDescriptor object itself. - */ - public SourceTriggerDescriptor withPullRequestId(String pullRequestId) { - this.pullRequestId = pullRequestId; - return this; - } - - /** - * Get the repositoryUrl property: The repository URL. - * - * @return the repositoryUrl value. - */ - public String repositoryUrl() { - return this.repositoryUrl; - } - - /** - * Set the repositoryUrl property: The repository URL. - * - * @param repositoryUrl the repositoryUrl value to set. - * @return the SourceTriggerDescriptor object itself. - */ - public SourceTriggerDescriptor withRepositoryUrl(String repositoryUrl) { - this.repositoryUrl = repositoryUrl; - return this; - } - - /** - * Get the branchName property: The branch name in the repository. - * - * @return the branchName value. - */ - public String branchName() { - return this.branchName; - } - - /** - * Set the branchName property: The branch name in the repository. - * - * @param branchName the branchName value to set. - * @return the SourceTriggerDescriptor object itself. - */ - public SourceTriggerDescriptor withBranchName(String branchName) { - this.branchName = branchName; - return this; - } - - /** - * Get the providerType property: The source control provider type. - * - * @return the providerType value. - */ - public String providerType() { - return this.providerType; - } - - /** - * Set the providerType property: The source control provider type. - * - * @param providerType the providerType value to set. - * @return the SourceTriggerDescriptor object itself. - */ - public SourceTriggerDescriptor withProviderType(String providerType) { - this.providerType = providerType; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SourceTriggerEvent.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SourceTriggerEvent.java deleted file mode 100644 index 0b78cd5ece87..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SourceTriggerEvent.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for SourceTriggerEvent. */ -public final class SourceTriggerEvent extends ExpandableStringEnum { - /** Static value commit for SourceTriggerEvent. */ - public static final SourceTriggerEvent COMMIT = fromString("commit"); - - /** Static value pullrequest for SourceTriggerEvent. */ - public static final SourceTriggerEvent PULLREQUEST = fromString("pullrequest"); - - /** - * Creates or finds a SourceTriggerEvent from its string representation. - * - * @param name a name to look for. - * @return the corresponding SourceTriggerEvent. - */ - @JsonCreator - public static SourceTriggerEvent fromString(String name) { - return fromString(name, SourceTriggerEvent.class); - } - - /** - * Gets known SourceTriggerEvent values. - * - * @return known SourceTriggerEvent values. - */ - public static Collection values() { - return values(SourceTriggerEvent.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SourceTriggerUpdateParameters.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SourceTriggerUpdateParameters.java deleted file mode 100644 index 917e8c3e095a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SourceTriggerUpdateParameters.java +++ /dev/null @@ -1,137 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The properties for updating a source based trigger. */ -@Fluent -public final class SourceTriggerUpdateParameters { - /* - * The properties that describes the source(code) for the task. - */ - @JsonProperty(value = "sourceRepository") - private SourceUpdateParameters sourceRepository; - - /* - * The source event corresponding to the trigger. - */ - @JsonProperty(value = "sourceTriggerEvents") - private List sourceTriggerEvents; - - /* - * The current status of trigger. - */ - @JsonProperty(value = "status") - private TriggerStatus status; - - /* - * The name of the trigger. - */ - @JsonProperty(value = "name", required = true) - private String name; - - /** - * Get the sourceRepository property: The properties that describes the source(code) for the task. - * - * @return the sourceRepository value. - */ - public SourceUpdateParameters sourceRepository() { - return this.sourceRepository; - } - - /** - * Set the sourceRepository property: The properties that describes the source(code) for the task. - * - * @param sourceRepository the sourceRepository value to set. - * @return the SourceTriggerUpdateParameters object itself. - */ - public SourceTriggerUpdateParameters withSourceRepository(SourceUpdateParameters sourceRepository) { - this.sourceRepository = sourceRepository; - return this; - } - - /** - * Get the sourceTriggerEvents property: The source event corresponding to the trigger. - * - * @return the sourceTriggerEvents value. - */ - public List sourceTriggerEvents() { - return this.sourceTriggerEvents; - } - - /** - * Set the sourceTriggerEvents property: The source event corresponding to the trigger. - * - * @param sourceTriggerEvents the sourceTriggerEvents value to set. - * @return the SourceTriggerUpdateParameters object itself. - */ - public SourceTriggerUpdateParameters withSourceTriggerEvents(List sourceTriggerEvents) { - this.sourceTriggerEvents = sourceTriggerEvents; - return this; - } - - /** - * Get the status property: The current status of trigger. - * - * @return the status value. - */ - public TriggerStatus status() { - return this.status; - } - - /** - * Set the status property: The current status of trigger. - * - * @param status the status value to set. - * @return the SourceTriggerUpdateParameters object itself. - */ - public SourceTriggerUpdateParameters withStatus(TriggerStatus status) { - this.status = status; - return this; - } - - /** - * Get the name property: The name of the trigger. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the trigger. - * - * @param name the name value to set. - * @return the SourceTriggerUpdateParameters object itself. - */ - public SourceTriggerUpdateParameters withName(String name) { - this.name = name; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (sourceRepository() != null) { - sourceRepository().validate(); - } - if (name() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property name in model SourceTriggerUpdateParameters")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(SourceTriggerUpdateParameters.class); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SourceUpdateParameters.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SourceUpdateParameters.java deleted file mode 100644 index fdb8359e0e0b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SourceUpdateParameters.java +++ /dev/null @@ -1,132 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The properties for updating the source code repository. */ -@Fluent -public final class SourceUpdateParameters { - /* - * The type of source control service. - */ - @JsonProperty(value = "sourceControlType") - private SourceControlType sourceControlType; - - /* - * The full URL to the source code repository - */ - @JsonProperty(value = "repositoryUrl") - private String repositoryUrl; - - /* - * The branch name of the source code. - */ - @JsonProperty(value = "branch") - private String branch; - - /* - * The authorization properties for accessing the source code repository - * and to set up - * webhooks for notifications. - */ - @JsonProperty(value = "sourceControlAuthProperties") - private AuthInfoUpdateParameters sourceControlAuthProperties; - - /** - * Get the sourceControlType property: The type of source control service. - * - * @return the sourceControlType value. - */ - public SourceControlType sourceControlType() { - return this.sourceControlType; - } - - /** - * Set the sourceControlType property: The type of source control service. - * - * @param sourceControlType the sourceControlType value to set. - * @return the SourceUpdateParameters object itself. - */ - public SourceUpdateParameters withSourceControlType(SourceControlType sourceControlType) { - this.sourceControlType = sourceControlType; - return this; - } - - /** - * Get the repositoryUrl property: The full URL to the source code repository. - * - * @return the repositoryUrl value. - */ - public String repositoryUrl() { - return this.repositoryUrl; - } - - /** - * Set the repositoryUrl property: The full URL to the source code repository. - * - * @param repositoryUrl the repositoryUrl value to set. - * @return the SourceUpdateParameters object itself. - */ - public SourceUpdateParameters withRepositoryUrl(String repositoryUrl) { - this.repositoryUrl = repositoryUrl; - return this; - } - - /** - * Get the branch property: The branch name of the source code. - * - * @return the branch value. - */ - public String branch() { - return this.branch; - } - - /** - * Set the branch property: The branch name of the source code. - * - * @param branch the branch value to set. - * @return the SourceUpdateParameters object itself. - */ - public SourceUpdateParameters withBranch(String branch) { - this.branch = branch; - return this; - } - - /** - * Get the sourceControlAuthProperties property: The authorization properties for accessing the source code - * repository and to set up webhooks for notifications. - * - * @return the sourceControlAuthProperties value. - */ - public AuthInfoUpdateParameters sourceControlAuthProperties() { - return this.sourceControlAuthProperties; - } - - /** - * Set the sourceControlAuthProperties property: The authorization properties for accessing the source code - * repository and to set up webhooks for notifications. - * - * @param sourceControlAuthProperties the sourceControlAuthProperties value to set. - * @return the SourceUpdateParameters object itself. - */ - public SourceUpdateParameters withSourceControlAuthProperties( - AuthInfoUpdateParameters sourceControlAuthProperties) { - this.sourceControlAuthProperties = sourceControlAuthProperties; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (sourceControlAuthProperties() != null) { - sourceControlAuthProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SourceUploadDefinition.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SourceUploadDefinition.java deleted file mode 100644 index 4a54f9b125c2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SourceUploadDefinition.java +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.containerregistry.fluent.models.SourceUploadDefinitionInner; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; - -/** The source repository properties for a build task. */ -@Fluent -public interface SourceUploadDefinition extends HasInnerModel { - /** @return the URL where the client can upload the source */ - String uploadUrl(); - - /** @return the the relative path to the source; this is used to submit the subsequent queue build request */ - String relativePath(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/Status.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/Status.java deleted file mode 100644 index 7d05f980e426..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/Status.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** The status of an Azure resource at the time the operation was called. */ -@Immutable -public final class Status { - /* - * The short label for the status. - */ - @JsonProperty(value = "displayStatus", access = JsonProperty.Access.WRITE_ONLY) - private String displayStatus; - - /* - * The detailed message for the status, including alerts and error - * messages. - */ - @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) - private String message; - - /* - * The timestamp when the status was changed to the current value. - */ - @JsonProperty(value = "timestamp", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime timestamp; - - /** - * Get the displayStatus property: The short label for the status. - * - * @return the displayStatus value. - */ - public String displayStatus() { - return this.displayStatus; - } - - /** - * Get the message property: The detailed message for the status, including alerts and error messages. - * - * @return the message value. - */ - public String message() { - return this.message; - } - - /** - * Get the timestamp property: The timestamp when the status was changed to the current value. - * - * @return the timestamp value. - */ - public OffsetDateTime timestamp() { - return this.timestamp; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/StepType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/StepType.java deleted file mode 100644 index 46cd4a2001e4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/StepType.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for StepType. */ -public final class StepType extends ExpandableStringEnum { - /** Static value Docker for StepType. */ - public static final StepType DOCKER = fromString("Docker"); - - /** Static value FileTask for StepType. */ - public static final StepType FILE_TASK = fromString("FileTask"); - - /** Static value EncodedTask for StepType. */ - public static final StepType ENCODED_TASK = fromString("EncodedTask"); - - /** - * Creates or finds a StepType from its string representation. - * - * @param name a name to look for. - * @return the corresponding StepType. - */ - @JsonCreator - public static StepType fromString(String name) { - return fromString(name, StepType.class); - } - - /** - * Gets known StepType values. - * - * @return known StepType values. - */ - public static Collection values() { - return values(StepType.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/StorageAccountProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/StorageAccountProperties.java deleted file mode 100644 index fd8431e033bb..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/StorageAccountProperties.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The properties of a storage account for a container registry. Only applicable to Classic SKU. */ -@Fluent -public final class StorageAccountProperties { - /* - * The resource ID of the storage account. - */ - @JsonProperty(value = "id", required = true) - private String id; - - /** - * Get the id property: The resource ID of the storage account. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: The resource ID of the storage account. - * - * @param id the id value to set. - * @return the StorageAccountProperties object itself. - */ - public StorageAccountProperties withId(String id) { - this.id = id; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (id() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property id in model StorageAccountProperties")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(StorageAccountProperties.class); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/Target.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/Target.java deleted file mode 100644 index 34e26a1a9f7b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/Target.java +++ /dev/null @@ -1,255 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The target of the event. */ -@Fluent -public final class Target { - /* - * The MIME type of the referenced object. - */ - @JsonProperty(value = "mediaType") - private String mediaType; - - /* - * The number of bytes of the content. Same as Length field. - */ - @JsonProperty(value = "size") - private Long size; - - /* - * The digest of the content, as defined by the Registry V2 HTTP API - * Specification. - */ - @JsonProperty(value = "digest") - private String digest; - - /* - * The number of bytes of the content. Same as Size field. - */ - @JsonProperty(value = "length") - private Long length; - - /* - * The repository name. - */ - @JsonProperty(value = "repository") - private String repository; - - /* - * The direct URL to the content. - */ - @JsonProperty(value = "url") - private String url; - - /* - * The tag name. - */ - @JsonProperty(value = "tag") - private String tag; - - /* - * The name of the artifact. - */ - @JsonProperty(value = "name") - private String name; - - /* - * The version of the artifact. - */ - @JsonProperty(value = "version") - private String version; - - /** - * Get the mediaType property: The MIME type of the referenced object. - * - * @return the mediaType value. - */ - public String mediaType() { - return this.mediaType; - } - - /** - * Set the mediaType property: The MIME type of the referenced object. - * - * @param mediaType the mediaType value to set. - * @return the Target object itself. - */ - public Target withMediaType(String mediaType) { - this.mediaType = mediaType; - return this; - } - - /** - * Get the size property: The number of bytes of the content. Same as Length field. - * - * @return the size value. - */ - public Long size() { - return this.size; - } - - /** - * Set the size property: The number of bytes of the content. Same as Length field. - * - * @param size the size value to set. - * @return the Target object itself. - */ - public Target withSize(Long size) { - this.size = size; - return this; - } - - /** - * Get the digest property: The digest of the content, as defined by the Registry V2 HTTP API Specification. - * - * @return the digest value. - */ - public String digest() { - return this.digest; - } - - /** - * Set the digest property: The digest of the content, as defined by the Registry V2 HTTP API Specification. - * - * @param digest the digest value to set. - * @return the Target object itself. - */ - public Target withDigest(String digest) { - this.digest = digest; - return this; - } - - /** - * Get the length property: The number of bytes of the content. Same as Size field. - * - * @return the length value. - */ - public Long length() { - return this.length; - } - - /** - * Set the length property: The number of bytes of the content. Same as Size field. - * - * @param length the length value to set. - * @return the Target object itself. - */ - public Target withLength(Long length) { - this.length = length; - return this; - } - - /** - * Get the repository property: The repository name. - * - * @return the repository value. - */ - public String repository() { - return this.repository; - } - - /** - * Set the repository property: The repository name. - * - * @param repository the repository value to set. - * @return the Target object itself. - */ - public Target withRepository(String repository) { - this.repository = repository; - return this; - } - - /** - * Get the url property: The direct URL to the content. - * - * @return the url value. - */ - public String url() { - return this.url; - } - - /** - * Set the url property: The direct URL to the content. - * - * @param url the url value to set. - * @return the Target object itself. - */ - public Target withUrl(String url) { - this.url = url; - return this; - } - - /** - * Get the tag property: The tag name. - * - * @return the tag value. - */ - public String tag() { - return this.tag; - } - - /** - * Set the tag property: The tag name. - * - * @param tag the tag value to set. - * @return the Target object itself. - */ - public Target withTag(String tag) { - this.tag = tag; - return this; - } - - /** - * Get the name property: The name of the artifact. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the artifact. - * - * @param name the name value to set. - * @return the Target object itself. - */ - public Target withName(String name) { - this.name = name; - return this; - } - - /** - * Get the version property: The version of the artifact. - * - * @return the version value. - */ - public String version() { - return this.version; - } - - /** - * Set the version property: The version of the artifact. - * - * @param version the version value to set. - * @return the Target object itself. - */ - public Target withVersion(String version) { - this.version = version; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TaskListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TaskListResult.java deleted file mode 100644 index e1f91401524c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TaskListResult.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.containerregistry.fluent.models.TaskInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The collection of tasks. */ -@Fluent -public final class TaskListResult { - /* - * The collection value. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URI that can be used to request the next set of paged results. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: The collection value. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The collection value. - * - * @param value the value value to set. - * @return the TaskListResult object itself. - */ - public TaskListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URI that can be used to request the next set of paged results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The URI that can be used to request the next set of paged results. - * - * @param nextLink the nextLink value to set. - * @return the TaskListResult object itself. - */ - public TaskListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TaskRunRequest.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TaskRunRequest.java deleted file mode 100644 index 74768877201a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TaskRunRequest.java +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.util.List; - -/** The parameters for a task run request. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") -@JsonTypeName("TaskRunRequest") -@Fluent -public final class TaskRunRequest extends RunRequest { - /* - * The name of task against which run has to be queued. - */ - @JsonProperty(value = "taskName", required = true) - private String taskName; - - /* - * The collection of overridable values that can be passed when running a - * task. - */ - @JsonProperty(value = "values") - private List values; - - /** - * Get the taskName property: The name of task against which run has to be queued. - * - * @return the taskName value. - */ - public String taskName() { - return this.taskName; - } - - /** - * Set the taskName property: The name of task against which run has to be queued. - * - * @param taskName the taskName value to set. - * @return the TaskRunRequest object itself. - */ - public TaskRunRequest withTaskName(String taskName) { - this.taskName = taskName; - return this; - } - - /** - * Get the values property: The collection of overridable values that can be passed when running a task. - * - * @return the values value. - */ - public List values() { - return this.values; - } - - /** - * Set the values property: The collection of overridable values that can be passed when running a task. - * - * @param values the values value to set. - * @return the TaskRunRequest object itself. - */ - public TaskRunRequest withValues(List values) { - this.values = values; - return this; - } - - /** {@inheritDoc} */ - @Override - public TaskRunRequest withIsArchiveEnabled(Boolean isArchiveEnabled) { - super.withIsArchiveEnabled(isArchiveEnabled); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (taskName() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property taskName in model TaskRunRequest")); - } - if (values() != null) { - values().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(TaskRunRequest.class); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TaskStatus.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TaskStatus.java deleted file mode 100644 index b29d5c565597..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TaskStatus.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for TaskStatus. */ -public final class TaskStatus extends ExpandableStringEnum { - /** Static value Disabled for TaskStatus. */ - public static final TaskStatus DISABLED = fromString("Disabled"); - - /** Static value Enabled for TaskStatus. */ - public static final TaskStatus ENABLED = fromString("Enabled"); - - /** - * Creates or finds a TaskStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding TaskStatus. - */ - @JsonCreator - public static TaskStatus fromString(String name) { - return fromString(name, TaskStatus.class); - } - - /** - * Gets known TaskStatus values. - * - * @return known TaskStatus values. - */ - public static Collection values() { - return values(TaskStatus.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TaskStepProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TaskStepProperties.java deleted file mode 100644 index de3a5960f55f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TaskStepProperties.java +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.util.List; - -/** Base properties for any task step. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "type", - defaultImpl = TaskStepProperties.class) -@JsonTypeName("TaskStepProperties") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "FileTask", value = FileTaskStep.class), - @JsonSubTypes.Type(name = "EncodedTask", value = EncodedTaskStep.class), - @JsonSubTypes.Type(name = "Docker", value = DockerTaskStep.class) -}) -@Fluent -public class TaskStepProperties { - /* - * List of base image dependencies for a step. - */ - @JsonProperty(value = "baseImageDependencies", access = JsonProperty.Access.WRITE_ONLY) - private List baseImageDependencies; - - /* - * The URL(absolute or relative) of the source context for the task step. - */ - @JsonProperty(value = "contextPath") - private String contextPath; - - /* - * The token (git PAT or SAS token of storage account blob) associated with - * the context for a step. - */ - @JsonProperty(value = "contextAccessToken") - private String contextAccessToken; - - /** - * Get the baseImageDependencies property: List of base image dependencies for a step. - * - * @return the baseImageDependencies value. - */ - public List baseImageDependencies() { - return this.baseImageDependencies; - } - - /** - * Get the contextPath property: The URL(absolute or relative) of the source context for the task step. - * - * @return the contextPath value. - */ - public String contextPath() { - return this.contextPath; - } - - /** - * Set the contextPath property: The URL(absolute or relative) of the source context for the task step. - * - * @param contextPath the contextPath value to set. - * @return the TaskStepProperties object itself. - */ - public TaskStepProperties withContextPath(String contextPath) { - this.contextPath = contextPath; - return this; - } - - /** - * Get the contextAccessToken property: The token (git PAT or SAS token of storage account blob) associated with the - * context for a step. - * - * @return the contextAccessToken value. - */ - public String contextAccessToken() { - return this.contextAccessToken; - } - - /** - * Set the contextAccessToken property: The token (git PAT or SAS token of storage account blob) associated with the - * context for a step. - * - * @param contextAccessToken the contextAccessToken value to set. - * @return the TaskStepProperties object itself. - */ - public TaskStepProperties withContextAccessToken(String contextAccessToken) { - this.contextAccessToken = contextAccessToken; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (baseImageDependencies() != null) { - baseImageDependencies().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TaskStepUpdateParameters.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TaskStepUpdateParameters.java deleted file mode 100644 index f0b1cb58da7a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TaskStepUpdateParameters.java +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** Base properties for updating any task step. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "type", - defaultImpl = TaskStepUpdateParameters.class) -@JsonTypeName("TaskStepUpdateParameters") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "Docker", value = DockerBuildStepUpdateParameters.class), - @JsonSubTypes.Type(name = "FileTask", value = FileTaskStepUpdateParameters.class), - @JsonSubTypes.Type(name = "EncodedTask", value = EncodedTaskStepUpdateParameters.class) -}) -@Fluent -public class TaskStepUpdateParameters { - /* - * The URL(absolute or relative) of the source context for the task step. - */ - @JsonProperty(value = "contextPath") - private String contextPath; - - /* - * The token (git PAT or SAS token of storage account blob) associated with - * the context for a step. - */ - @JsonProperty(value = "contextAccessToken") - private String contextAccessToken; - - /** - * Get the contextPath property: The URL(absolute or relative) of the source context for the task step. - * - * @return the contextPath value. - */ - public String contextPath() { - return this.contextPath; - } - - /** - * Set the contextPath property: The URL(absolute or relative) of the source context for the task step. - * - * @param contextPath the contextPath value to set. - * @return the TaskStepUpdateParameters object itself. - */ - public TaskStepUpdateParameters withContextPath(String contextPath) { - this.contextPath = contextPath; - return this; - } - - /** - * Get the contextAccessToken property: The token (git PAT or SAS token of storage account blob) associated with the - * context for a step. - * - * @return the contextAccessToken value. - */ - public String contextAccessToken() { - return this.contextAccessToken; - } - - /** - * Set the contextAccessToken property: The token (git PAT or SAS token of storage account blob) associated with the - * context for a step. - * - * @param contextAccessToken the contextAccessToken value to set. - * @return the TaskStepUpdateParameters object itself. - */ - public TaskStepUpdateParameters withContextAccessToken(String contextAccessToken) { - this.contextAccessToken = contextAccessToken; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TaskUpdateParameters.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TaskUpdateParameters.java deleted file mode 100644 index e83320b72bab..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TaskUpdateParameters.java +++ /dev/null @@ -1,260 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.containerregistry.fluent.models.TaskPropertiesUpdateParameters; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** The parameters for updating a task. */ -@Fluent -public final class TaskUpdateParameters { - /* - * Identity for the resource. - */ - @JsonProperty(value = "identity") - private IdentityProperties identity; - - /* - * The properties for updating a task. - */ - @JsonProperty(value = "properties") - private TaskPropertiesUpdateParameters innerProperties; - - /* - * The ARM resource tags. - */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map tags; - - /** - * Get the identity property: Identity for the resource. - * - * @return the identity value. - */ - public IdentityProperties identity() { - return this.identity; - } - - /** - * Set the identity property: Identity for the resource. - * - * @param identity the identity value to set. - * @return the TaskUpdateParameters object itself. - */ - public TaskUpdateParameters withIdentity(IdentityProperties identity) { - this.identity = identity; - return this; - } - - /** - * Get the innerProperties property: The properties for updating a task. - * - * @return the innerProperties value. - */ - private TaskPropertiesUpdateParameters innerProperties() { - return this.innerProperties; - } - - /** - * Get the tags property: The ARM resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: The ARM resource tags. - * - * @param tags the tags value to set. - * @return the TaskUpdateParameters object itself. - */ - public TaskUpdateParameters withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Get the status property: The current status of task. - * - * @return the status value. - */ - public TaskStatus status() { - return this.innerProperties() == null ? null : this.innerProperties().status(); - } - - /** - * Set the status property: The current status of task. - * - * @param status the status value to set. - * @return the TaskUpdateParameters object itself. - */ - public TaskUpdateParameters withStatus(TaskStatus status) { - if (this.innerProperties() == null) { - this.innerProperties = new TaskPropertiesUpdateParameters(); - } - this.innerProperties().withStatus(status); - return this; - } - - /** - * Get the platform property: The platform properties against which the run has to happen. - * - * @return the platform value. - */ - public PlatformUpdateParameters platform() { - return this.innerProperties() == null ? null : this.innerProperties().platform(); - } - - /** - * Set the platform property: The platform properties against which the run has to happen. - * - * @param platform the platform value to set. - * @return the TaskUpdateParameters object itself. - */ - public TaskUpdateParameters withPlatform(PlatformUpdateParameters platform) { - if (this.innerProperties() == null) { - this.innerProperties = new TaskPropertiesUpdateParameters(); - } - this.innerProperties().withPlatform(platform); - return this; - } - - /** - * Get the agentConfiguration property: The machine configuration of the run agent. - * - * @return the agentConfiguration value. - */ - public AgentProperties agentConfiguration() { - return this.innerProperties() == null ? null : this.innerProperties().agentConfiguration(); - } - - /** - * Set the agentConfiguration property: The machine configuration of the run agent. - * - * @param agentConfiguration the agentConfiguration value to set. - * @return the TaskUpdateParameters object itself. - */ - public TaskUpdateParameters withAgentConfiguration(AgentProperties agentConfiguration) { - if (this.innerProperties() == null) { - this.innerProperties = new TaskPropertiesUpdateParameters(); - } - this.innerProperties().withAgentConfiguration(agentConfiguration); - return this; - } - - /** - * Get the timeout property: Run timeout in seconds. - * - * @return the timeout value. - */ - public Integer timeout() { - return this.innerProperties() == null ? null : this.innerProperties().timeout(); - } - - /** - * Set the timeout property: Run timeout in seconds. - * - * @param timeout the timeout value to set. - * @return the TaskUpdateParameters object itself. - */ - public TaskUpdateParameters withTimeout(Integer timeout) { - if (this.innerProperties() == null) { - this.innerProperties = new TaskPropertiesUpdateParameters(); - } - this.innerProperties().withTimeout(timeout); - return this; - } - - /** - * Get the step property: The properties for updating a task step. - * - * @return the step value. - */ - public TaskStepUpdateParameters step() { - return this.innerProperties() == null ? null : this.innerProperties().step(); - } - - /** - * Set the step property: The properties for updating a task step. - * - * @param step the step value to set. - * @return the TaskUpdateParameters object itself. - */ - public TaskUpdateParameters withStep(TaskStepUpdateParameters step) { - if (this.innerProperties() == null) { - this.innerProperties = new TaskPropertiesUpdateParameters(); - } - this.innerProperties().withStep(step); - return this; - } - - /** - * Get the trigger property: The properties for updating trigger properties. - * - * @return the trigger value. - */ - public TriggerUpdateParameters trigger() { - return this.innerProperties() == null ? null : this.innerProperties().trigger(); - } - - /** - * Set the trigger property: The properties for updating trigger properties. - * - * @param trigger the trigger value to set. - * @return the TaskUpdateParameters object itself. - */ - public TaskUpdateParameters withTrigger(TriggerUpdateParameters trigger) { - if (this.innerProperties() == null) { - this.innerProperties = new TaskPropertiesUpdateParameters(); - } - this.innerProperties().withTrigger(trigger); - return this; - } - - /** - * Get the credentials property: The parameters that describes a set of credentials that will be used when this run - * is invoked. - * - * @return the credentials value. - */ - public Credentials credentials() { - return this.innerProperties() == null ? null : this.innerProperties().credentials(); - } - - /** - * Set the credentials property: The parameters that describes a set of credentials that will be used when this run - * is invoked. - * - * @param credentials the credentials value to set. - * @return the TaskUpdateParameters object itself. - */ - public TaskUpdateParameters withCredentials(Credentials credentials) { - if (this.innerProperties() == null) { - this.innerProperties = new TaskPropertiesUpdateParameters(); - } - this.innerProperties().withCredentials(credentials); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (identity() != null) { - identity().validate(); - } - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TimerTrigger.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TimerTrigger.java deleted file mode 100644 index bf68c31defa2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TimerTrigger.java +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The properties of a timer trigger. */ -@Fluent -public final class TimerTrigger { - /* - * The CRON expression for the task schedule - */ - @JsonProperty(value = "schedule", required = true) - private String schedule; - - /* - * The current status of trigger. - */ - @JsonProperty(value = "status") - private TriggerStatus status; - - /* - * The name of the trigger. - */ - @JsonProperty(value = "name", required = true) - private String name; - - /** - * Get the schedule property: The CRON expression for the task schedule. - * - * @return the schedule value. - */ - public String schedule() { - return this.schedule; - } - - /** - * Set the schedule property: The CRON expression for the task schedule. - * - * @param schedule the schedule value to set. - * @return the TimerTrigger object itself. - */ - public TimerTrigger withSchedule(String schedule) { - this.schedule = schedule; - return this; - } - - /** - * Get the status property: The current status of trigger. - * - * @return the status value. - */ - public TriggerStatus status() { - return this.status; - } - - /** - * Set the status property: The current status of trigger. - * - * @param status the status value to set. - * @return the TimerTrigger object itself. - */ - public TimerTrigger withStatus(TriggerStatus status) { - this.status = status; - return this; - } - - /** - * Get the name property: The name of the trigger. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the trigger. - * - * @param name the name value to set. - * @return the TimerTrigger object itself. - */ - public TimerTrigger withName(String name) { - this.name = name; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (schedule() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property schedule in model TimerTrigger")); - } - if (name() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property name in model TimerTrigger")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(TimerTrigger.class); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TimerTriggerDescriptor.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TimerTriggerDescriptor.java deleted file mode 100644 index 696e47a84ca6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TimerTriggerDescriptor.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The TimerTriggerDescriptor model. */ -@Fluent -public final class TimerTriggerDescriptor { - /* - * The timer trigger name that caused the run. - */ - @JsonProperty(value = "timerTriggerName") - private String timerTriggerName; - - /* - * The occurrence that triggered the run. - */ - @JsonProperty(value = "scheduleOccurrence") - private String scheduleOccurrence; - - /** - * Get the timerTriggerName property: The timer trigger name that caused the run. - * - * @return the timerTriggerName value. - */ - public String timerTriggerName() { - return this.timerTriggerName; - } - - /** - * Set the timerTriggerName property: The timer trigger name that caused the run. - * - * @param timerTriggerName the timerTriggerName value to set. - * @return the TimerTriggerDescriptor object itself. - */ - public TimerTriggerDescriptor withTimerTriggerName(String timerTriggerName) { - this.timerTriggerName = timerTriggerName; - return this; - } - - /** - * Get the scheduleOccurrence property: The occurrence that triggered the run. - * - * @return the scheduleOccurrence value. - */ - public String scheduleOccurrence() { - return this.scheduleOccurrence; - } - - /** - * Set the scheduleOccurrence property: The occurrence that triggered the run. - * - * @param scheduleOccurrence the scheduleOccurrence value to set. - * @return the TimerTriggerDescriptor object itself. - */ - public TimerTriggerDescriptor withScheduleOccurrence(String scheduleOccurrence) { - this.scheduleOccurrence = scheduleOccurrence; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TimerTriggerUpdateParameters.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TimerTriggerUpdateParameters.java deleted file mode 100644 index 8918e3a00a27..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TimerTriggerUpdateParameters.java +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The properties for updating a timer trigger. */ -@Fluent -public final class TimerTriggerUpdateParameters { - /* - * The CRON expression for the task schedule - */ - @JsonProperty(value = "schedule") - private String schedule; - - /* - * The current status of trigger. - */ - @JsonProperty(value = "status") - private TriggerStatus status; - - /* - * The name of the trigger. - */ - @JsonProperty(value = "name", required = true) - private String name; - - /** - * Get the schedule property: The CRON expression for the task schedule. - * - * @return the schedule value. - */ - public String schedule() { - return this.schedule; - } - - /** - * Set the schedule property: The CRON expression for the task schedule. - * - * @param schedule the schedule value to set. - * @return the TimerTriggerUpdateParameters object itself. - */ - public TimerTriggerUpdateParameters withSchedule(String schedule) { - this.schedule = schedule; - return this; - } - - /** - * Get the status property: The current status of trigger. - * - * @return the status value. - */ - public TriggerStatus status() { - return this.status; - } - - /** - * Set the status property: The current status of trigger. - * - * @param status the status value to set. - * @return the TimerTriggerUpdateParameters object itself. - */ - public TimerTriggerUpdateParameters withStatus(TriggerStatus status) { - this.status = status; - return this; - } - - /** - * Get the name property: The name of the trigger. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the trigger. - * - * @param name the name value to set. - * @return the TimerTriggerUpdateParameters object itself. - */ - public TimerTriggerUpdateParameters withName(String name) { - this.name = name; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property name in model TimerTriggerUpdateParameters")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(TimerTriggerUpdateParameters.class); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TokenType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TokenType.java deleted file mode 100644 index 99e87f6398be..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TokenType.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for TokenType. */ -public final class TokenType extends ExpandableStringEnum { - /** Static value PAT for TokenType. */ - public static final TokenType PAT = fromString("PAT"); - - /** Static value OAuth for TokenType. */ - public static final TokenType OAUTH = fromString("OAuth"); - - /** - * Creates or finds a TokenType from its string representation. - * - * @param name a name to look for. - * @return the corresponding TokenType. - */ - @JsonCreator - public static TokenType fromString(String name) { - return fromString(name, TokenType.class); - } - - /** - * Gets known TokenType values. - * - * @return known TokenType values. - */ - public static Collection values() { - return values(TokenType.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TriggerProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TriggerProperties.java deleted file mode 100644 index a4382bbc3820..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TriggerProperties.java +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The properties of a trigger. */ -@Fluent -public final class TriggerProperties { - /* - * The collection of timer triggers. - */ - @JsonProperty(value = "timerTriggers") - private List timerTriggers; - - /* - * The collection of triggers based on source code repository. - */ - @JsonProperty(value = "sourceTriggers") - private List sourceTriggers; - - /* - * The trigger based on base image dependencies. - */ - @JsonProperty(value = "baseImageTrigger") - private BaseImageTrigger baseImageTrigger; - - /** - * Get the timerTriggers property: The collection of timer triggers. - * - * @return the timerTriggers value. - */ - public List timerTriggers() { - return this.timerTriggers; - } - - /** - * Set the timerTriggers property: The collection of timer triggers. - * - * @param timerTriggers the timerTriggers value to set. - * @return the TriggerProperties object itself. - */ - public TriggerProperties withTimerTriggers(List timerTriggers) { - this.timerTriggers = timerTriggers; - return this; - } - - /** - * Get the sourceTriggers property: The collection of triggers based on source code repository. - * - * @return the sourceTriggers value. - */ - public List sourceTriggers() { - return this.sourceTriggers; - } - - /** - * Set the sourceTriggers property: The collection of triggers based on source code repository. - * - * @param sourceTriggers the sourceTriggers value to set. - * @return the TriggerProperties object itself. - */ - public TriggerProperties withSourceTriggers(List sourceTriggers) { - this.sourceTriggers = sourceTriggers; - return this; - } - - /** - * Get the baseImageTrigger property: The trigger based on base image dependencies. - * - * @return the baseImageTrigger value. - */ - public BaseImageTrigger baseImageTrigger() { - return this.baseImageTrigger; - } - - /** - * Set the baseImageTrigger property: The trigger based on base image dependencies. - * - * @param baseImageTrigger the baseImageTrigger value to set. - * @return the TriggerProperties object itself. - */ - public TriggerProperties withBaseImageTrigger(BaseImageTrigger baseImageTrigger) { - this.baseImageTrigger = baseImageTrigger; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (timerTriggers() != null) { - timerTriggers().forEach(e -> e.validate()); - } - if (sourceTriggers() != null) { - sourceTriggers().forEach(e -> e.validate()); - } - if (baseImageTrigger() != null) { - baseImageTrigger().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TriggerStatus.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TriggerStatus.java deleted file mode 100644 index 08a0e13545c8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TriggerStatus.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for TriggerStatus. */ -public final class TriggerStatus extends ExpandableStringEnum { - /** Static value Disabled for TriggerStatus. */ - public static final TriggerStatus DISABLED = fromString("Disabled"); - - /** Static value Enabled for TriggerStatus. */ - public static final TriggerStatus ENABLED = fromString("Enabled"); - - /** - * Creates or finds a TriggerStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding TriggerStatus. - */ - @JsonCreator - public static TriggerStatus fromString(String name) { - return fromString(name, TriggerStatus.class); - } - - /** - * Gets known TriggerStatus values. - * - * @return known TriggerStatus values. - */ - public static Collection values() { - return values(TriggerStatus.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TriggerUpdateParameters.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TriggerUpdateParameters.java deleted file mode 100644 index 0bd9510fa91c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TriggerUpdateParameters.java +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The properties for updating triggers. */ -@Fluent -public final class TriggerUpdateParameters { - /* - * The collection of timer triggers. - */ - @JsonProperty(value = "timerTriggers") - private List timerTriggers; - - /* - * The collection of triggers based on source code repository. - */ - @JsonProperty(value = "sourceTriggers") - private List sourceTriggers; - - /* - * The trigger based on base image dependencies. - */ - @JsonProperty(value = "baseImageTrigger") - private BaseImageTriggerUpdateParameters baseImageTrigger; - - /** - * Get the timerTriggers property: The collection of timer triggers. - * - * @return the timerTriggers value. - */ - public List timerTriggers() { - return this.timerTriggers; - } - - /** - * Set the timerTriggers property: The collection of timer triggers. - * - * @param timerTriggers the timerTriggers value to set. - * @return the TriggerUpdateParameters object itself. - */ - public TriggerUpdateParameters withTimerTriggers(List timerTriggers) { - this.timerTriggers = timerTriggers; - return this; - } - - /** - * Get the sourceTriggers property: The collection of triggers based on source code repository. - * - * @return the sourceTriggers value. - */ - public List sourceTriggers() { - return this.sourceTriggers; - } - - /** - * Set the sourceTriggers property: The collection of triggers based on source code repository. - * - * @param sourceTriggers the sourceTriggers value to set. - * @return the TriggerUpdateParameters object itself. - */ - public TriggerUpdateParameters withSourceTriggers(List sourceTriggers) { - this.sourceTriggers = sourceTriggers; - return this; - } - - /** - * Get the baseImageTrigger property: The trigger based on base image dependencies. - * - * @return the baseImageTrigger value. - */ - public BaseImageTriggerUpdateParameters baseImageTrigger() { - return this.baseImageTrigger; - } - - /** - * Set the baseImageTrigger property: The trigger based on base image dependencies. - * - * @param baseImageTrigger the baseImageTrigger value to set. - * @return the TriggerUpdateParameters object itself. - */ - public TriggerUpdateParameters withBaseImageTrigger(BaseImageTriggerUpdateParameters baseImageTrigger) { - this.baseImageTrigger = baseImageTrigger; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (timerTriggers() != null) { - timerTriggers().forEach(e -> e.validate()); - } - if (sourceTriggers() != null) { - sourceTriggers().forEach(e -> e.validate()); - } - if (baseImageTrigger() != null) { - baseImageTrigger().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TrustPolicy.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TrustPolicy.java deleted file mode 100644 index ec316501b4bc..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TrustPolicy.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The content trust policy for a container registry. */ -@Fluent -public final class TrustPolicy { - /* - * The type of trust policy. - */ - @JsonProperty(value = "type") - private TrustPolicyType type; - - /* - * The value that indicates whether the policy is enabled or not. - */ - @JsonProperty(value = "status") - private PolicyStatus status; - - /** - * Get the type property: The type of trust policy. - * - * @return the type value. - */ - public TrustPolicyType type() { - return this.type; - } - - /** - * Set the type property: The type of trust policy. - * - * @param type the type value to set. - * @return the TrustPolicy object itself. - */ - public TrustPolicy withType(TrustPolicyType type) { - this.type = type; - return this; - } - - /** - * Get the status property: The value that indicates whether the policy is enabled or not. - * - * @return the status value. - */ - public PolicyStatus status() { - return this.status; - } - - /** - * Set the status property: The value that indicates whether the policy is enabled or not. - * - * @param status the status value to set. - * @return the TrustPolicy object itself. - */ - public TrustPolicy withStatus(PolicyStatus status) { - this.status = status; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TrustPolicyType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TrustPolicyType.java deleted file mode 100644 index 81b18565a212..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TrustPolicyType.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for TrustPolicyType. */ -public final class TrustPolicyType extends ExpandableStringEnum { - /** Static value Notary for TrustPolicyType. */ - public static final TrustPolicyType NOTARY = fromString("Notary"); - - /** - * Creates or finds a TrustPolicyType from its string representation. - * - * @param name a name to look for. - * @return the corresponding TrustPolicyType. - */ - @JsonCreator - public static TrustPolicyType fromString(String name) { - return fromString(name, TrustPolicyType.class); - } - - /** - * Gets known TrustPolicyType values. - * - * @return known TrustPolicyType values. - */ - public static Collection values() { - return values(TrustPolicyType.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/UserIdentityProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/UserIdentityProperties.java deleted file mode 100644 index 554411aeaa3a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/UserIdentityProperties.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The UserIdentityProperties model. */ -@Fluent -public final class UserIdentityProperties { - /* - * The principal id of user assigned identity. - */ - @JsonProperty(value = "principalId") - private String principalId; - - /* - * The client id of user assigned identity. - */ - @JsonProperty(value = "clientId") - private String clientId; - - /** - * Get the principalId property: The principal id of user assigned identity. - * - * @return the principalId value. - */ - public String principalId() { - return this.principalId; - } - - /** - * Set the principalId property: The principal id of user assigned identity. - * - * @param principalId the principalId value to set. - * @return the UserIdentityProperties object itself. - */ - public UserIdentityProperties withPrincipalId(String principalId) { - this.principalId = principalId; - return this; - } - - /** - * Get the clientId property: The client id of user assigned identity. - * - * @return the clientId value. - */ - public String clientId() { - return this.clientId; - } - - /** - * Set the clientId property: The client id of user assigned identity. - * - * @param clientId the clientId value to set. - * @return the UserIdentityProperties object itself. - */ - public UserIdentityProperties withClientId(String clientId) { - this.clientId = clientId; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/Variant.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/Variant.java deleted file mode 100644 index db61846e2454..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/Variant.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for Variant. */ -public final class Variant extends ExpandableStringEnum { - /** Static value v6 for Variant. */ - public static final Variant V6 = fromString("v6"); - - /** Static value v7 for Variant. */ - public static final Variant V7 = fromString("v7"); - - /** Static value v8 for Variant. */ - public static final Variant V8 = fromString("v8"); - - /** - * Creates or finds a Variant from its string representation. - * - * @param name a name to look for. - * @return the corresponding Variant. - */ - @JsonCreator - public static Variant fromString(String name) { - return fromString(name, Variant.class); - } - - /** - * Gets known Variant values. - * - * @return known Variant values. - */ - public static Collection values() { - return values(Variant.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/VirtualNetworkRule.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/VirtualNetworkRule.java deleted file mode 100644 index d48e61372860..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/VirtualNetworkRule.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Virtual network rule. */ -@Fluent -public final class VirtualNetworkRule { - /* - * The action of virtual network rule. - */ - @JsonProperty(value = "action") - private Action action; - - /* - * Resource ID of a subnet, for example: - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. - */ - @JsonProperty(value = "id", required = true) - private String virtualNetworkResourceId; - - /** - * Get the action property: The action of virtual network rule. - * - * @return the action value. - */ - public Action action() { - return this.action; - } - - /** - * Set the action property: The action of virtual network rule. - * - * @param action the action value to set. - * @return the VirtualNetworkRule object itself. - */ - public VirtualNetworkRule withAction(Action action) { - this.action = action; - return this; - } - - /** - * Get the virtualNetworkResourceId property: Resource ID of a subnet, for example: - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. - * - * @return the virtualNetworkResourceId value. - */ - public String virtualNetworkResourceId() { - return this.virtualNetworkResourceId; - } - - /** - * Set the virtualNetworkResourceId property: Resource ID of a subnet, for example: - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. - * - * @param virtualNetworkResourceId the virtualNetworkResourceId value to set. - * @return the VirtualNetworkRule object itself. - */ - public VirtualNetworkRule withVirtualNetworkResourceId(String virtualNetworkResourceId) { - this.virtualNetworkResourceId = virtualNetworkResourceId; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (virtualNetworkResourceId() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property virtualNetworkResourceId in model VirtualNetworkRule")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(VirtualNetworkRule.class); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/Webhook.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/Webhook.java deleted file mode 100644 index 0004d2d0b9df..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/Webhook.java +++ /dev/null @@ -1,634 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.containerregistry.fluent.models.WebhookInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.ExternalChildResource; -import com.azure.resourcemanager.resources.fluentcore.arm.models.Resource; -import com.azure.resourcemanager.resources.fluentcore.model.Appliable; -import com.azure.resourcemanager.resources.fluentcore.model.Attachable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; -import com.azure.resourcemanager.resources.fluentcore.model.Settable; -import com.azure.resourcemanager.resources.fluentcore.model.Updatable; -import java.util.Collection; -import java.util.Map; -import reactor.core.publisher.Mono; - -/** An object that represents a webhook for a container registry. */ -@Fluent -public interface Webhook - extends ExternalChildResource, - Resource, - HasInnerModel, - Refreshable, - Updatable { - - /** @return the status of the webhook */ - boolean isEnabled(); - - /** - * @return the scope of repositories where the event can be triggered - *

    For example: - 'foo:*' means events for all tags under repository 'foo' - 'foo:bar' means events for - * 'foo:bar' only - 'foo' is equivalent to 'foo:latest' - empty means all events - */ - String scope(); - - /** @return the service URI for the webhook to post notifications */ - String serviceUri(); - - /** @return the Custom headers that will be added to the webhook notifications */ - Map customHeaders(); - - /** @return the list of actions that trigger the webhook to post notifications */ - Collection triggers(); - - /** @return the provisioning state of the webhook */ - ProvisioningState provisioningState(); - - /** @return the webhook parent ID */ - String parentId(); - - /** Changes the status of the webhook to "enabled". */ - void enable(); - - /** - * Changes the status of the webhook to "enabled". - * - * @return a representation of the future computation of this call - */ - Mono enableAsync(); - - /** Changes the status of the webhook to "disabled". */ - void disable(); - - /** - * Changes the status of the webhook to "disabled". - * - * @return a representation of the future computation of this call - */ - Mono disableAsync(); - - /** @return the id on an event info resource */ - String ping(); - - /** @return a representation of the future computation of this call, returning the id on an event info resource */ - Mono pingAsync(); - - /** @return the list of event info object */ - PagedIterable listEvents(); - - /** @return a representation of the future computation of this call, returning the list of event info object */ - PagedFlux listEventsAsync(); - - /** Grouping of webhook definition stages. */ - interface DefinitionStages { - /** - * The first stage of the webhook definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface Blank extends WithTriggerWhen { - } - - /** - * The stage of the webhook definition allowing to specify the actions that will trigger the webhook - * notifications. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithTriggerWhen { - /** - * Specifies the actions that will trigger the webhook notifications. - * - * @param webhookActions the webhook actions - * @return the next stage of the definition - */ - WithServiceUri withTriggerWhen(WebhookAction... webhookActions); - } - - /** - * The stage of the webhook definition allowing to specify the service URI for post notifications. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithServiceUri { - /** - * Specifies the service URI for post notifications. - * - * @param serviceUri the service URI for the post notifications - * @return the next stage of the definition - */ - WithAttach withServiceUri(String serviceUri); - } - - /** - * The stage of the webhook definition allowing to specify the custom headers that will be added to the - * notifications. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithCustomHeaders { - /** - * Specifies a custom header that will be added to notifications. - * - *

    Consecutive calls to this method will add additional headers. - * - * @param name of the optional header - * @param value of the optional header - * @return the next stage of the definition - */ - WithAttach withCustomHeader(String name, String value); - - /** - * Specifies the custom headers that will be added to the notifications. - * - * @param customHeaders the "Name=Value" custom headers. - * @return the next stage of the definition - */ - WithAttach withCustomHeaders(Map customHeaders); - } - - /** - * The stage of the webhook definition allowing to specify the scope of repositories where the event can be - * triggered. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithRepositoriesScope { - /** - * Specifies the scope of repositories where the event can be triggered. - * - *

    For example, 'foo:*' means events for all tags under repository 'foo'. 'foo:bar' means events for - * 'foo:bar' only. 'foo' is equivalent to 'foo:latest', empty means all events. - * - * @param repositoriesScope the scope of repositories where the event can be triggered; empty means all - * events - * @return the next stage of the definition - */ - WithAttach withRepositoriesScope(String repositoriesScope); - } - - /** - * The stage of the webhook definition allowing to specify the default status of the webhook after being - * created. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithDefaultStatus { - /** - * Specifies the default status of the webhook; default is "enabled". - * - * @param defaultStatus indicates whether the webhook is enabled or disabled after being created - * @return the next stage of the definition - */ - WithAttach enabled(boolean defaultStatus); - } - - /** - * The final stage of the webhook definition. - * - *

    At this stage, any remaining optional settings can be specified, or the webhook definition can be attached - * to the parent container group definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithAttach - extends WithCustomHeaders, - WithRepositoriesScope, - WithDefaultStatus, - DefinitionWithTags>, - Attachable.InDefinition { - } - } - - /** - * Grouping of the container register webhook definitions. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WebhookDefinition - extends DefinitionStages.Blank, - DefinitionStages.WithTriggerWhen, - DefinitionStages.WithServiceUri, - DefinitionStages.WithAttach { - } - - /** Grouping of webhook update definition stages. */ - interface UpdateDefinitionStages { - /** - * The first stage of the webhook definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface Blank extends WithTriggerWhen { - } - - /** - * The stage of the webhook definition allowing to specify the actions that will trigger the webhook - * notifications. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithTriggerWhen { - /** - * Specifies the actions that will trigger the webhook notifications. - * - * @param webhookActions the webhook actions - * @return the next stage of the definition - */ - WithServiceUri withTriggerWhen(WebhookAction... webhookActions); - } - - /** - * The stage of the webhook definition allowing to specify the service URI for post notifications. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithServiceUri { - /** - * Specifies the service URI for post notifications. - * - * @param serviceUri the service URI for the post notifications - * @return the next stage of the definition - */ - WithAttach withServiceUri(String serviceUri); - } - - /** - * The stage of the webhook definition allowing to specify the custom headers that will be added to the - * notifications. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithCustomHeaders { - /** - * Specifies a custom header that will be added to notifications. - * - *

    Consecutive calls to this method will add additional headers. - * - * @param name of the optional header - * @param value of the optional header - * @return the next stage of the definition - */ - WithAttach withCustomHeader(String name, String value); - - /** - * Specifies the custom headers that will be added to the notifications. - * - * @param customHeaders the "Name=Value" custom headers. - * @return the next stage of the definition - */ - WithAttach withCustomHeaders(Map customHeaders); - } - - /** - * The stage of the webhook definition allowing to specify the scope of repositories where the event can be - * triggered. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithRepositoriesScope { - /** - * Specifies the scope of repositories where the event can be triggered. - * - *

    For example, 'foo:*' means events for all tags under repository 'foo'. 'foo:bar' means events for - * 'foo:bar' only. 'foo' is equivalent to 'foo:latest', empty means all events. - * - * @param repositoriesScope the scope of repositories where the event can be triggered; empty means all - * events - * @return the next stage of the definition - */ - WithAttach withRepositoriesScope(String repositoriesScope); - } - - /** - * The stage of the webhook definition allowing to specify the default status of the webhook after being - * created. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithDefaultStatus { - /** - * Specifies the default status of the webhook; default is "enabled". - * - * @param defaultStatus indicates whether the webhook is enabled or disabled after being created - * @return the next stage of the definition - */ - WithAttach enabled(boolean defaultStatus); - } - - /** - * The stage of the webhook definition allowing to specify the tags. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithTags { - /** - * Specifies tags for the webhook. - * - * @param tags a {@link Map} of tags - * @return the next stage of the definition - */ - WithAttach withTags(Map tags); - - /** - * Adds a tag to the webhook. - * - * @param key the key for the tag - * @param value the value for the tag - * @return the next stage of the definition - */ - WithAttach withTag(String key, String value); - } - - /** - * The final stage of the webhook definition. - * - *

    At this stage, any remaining optional settings can be specified, or the webhook definition can be attached - * to the parent container group definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithAttach - extends WithCustomHeaders, - WithRepositoriesScope, - WithDefaultStatus, - WithTags, - Attachable.InUpdate { - } - } - - /** - * Grouping of the container registry's webhook update definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface UpdateDefinition - extends UpdateDefinitionStages.Blank, - UpdateDefinitionStages.WithTriggerWhen, - UpdateDefinitionStages.WithServiceUri, - UpdateDefinitionStages.WithAttach { - } - - /** The entirety of a webhook update. */ - interface Update - extends UpdateStages.WithTriggerWhen, - UpdateStages.WithServiceUri, - UpdateStages.WithCustomHeaders, - UpdateStages.WithRepositoriesScope, - UpdateStages.WithDefaultStatus, - Resource.UpdateWithTags, - Appliable { - } - - /** Grouping of webhook update stages. */ - interface UpdateStages { - /** - * The stage of the webhook definition allowing to specify actions that trigger the webhook. - */ - interface WithTriggerWhen { - /** - * Specifies the actions that will trigger the webhook notifications. - * - * @param webhookActions the webhook actions - * @return the next stage of the resource update - */ - Update withTriggerWhen(WebhookAction... webhookActions); - } - - /** The stage of the webhook definition allowing to specify the service URI for post notifications. */ - interface WithServiceUri { - /** - * Specifies the service URI for post notifications. - * - * @param serviceUri the service URI for the post notifications - * @return the next stage of the resource update - */ - Update withServiceUri(String serviceUri); - } - - /** - * The stage of the webhook definition allowing to specify the custom headers that will be added to the - * notifications. - */ - interface WithCustomHeaders { - /** - * Specifies a custom header that will be added to notifications. - * - *

    Consecutive calls to this method will add additional headers. - * - * @param name of the optional header - * @param value of the optional header - * @return the next stage of the resource update - */ - Update withCustomHeader(String name, String value); - - /** - * Specifies custom headers that will be added to the notifications. - * - * @param customHeaders the "Name=Value" custom headers. - * @return the next stage of the resource update - */ - Update withCustomHeaders(Map customHeaders); - } - - /** - * The stage of the webhook definition allowing to specify the scope of repositories where the event can be - * triggered. - */ - interface WithRepositoriesScope { - /** - * Specifies the scope of repositories where the event can be triggered. - * - *

    For example, 'foo:*' means events for all tags under repository 'foo'. 'foo:bar' means events for - * 'foo:bar' only. 'foo' is equivalent to 'foo:latest', empty means all events. - * - * @param repositoriesScope the scope of repositories where the event can be triggered; empty means all - * events - * @return the next stage of the resource update - */ - Update withRepositoriesScope(String repositoriesScope); - } - - /** - * The stage of the webhook definition allowing to specify the default status of the webhook after being - * created. - */ - interface WithDefaultStatus { - /** - * Specifies the default status of the webhook; default is "enabled". - * - * @param defaultStatus indicates whether the webhook is enabled or disabled after being created - * @return the next stage of the resource update - */ - Update enabled(boolean defaultStatus); - } - } - - /** - * The entirety of a webhook resource update as part of a container registry update. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface UpdateResource - extends UpdateResourceStages.Blank, UpdateResourceStages.WithAttach { - } - - /** Grouping of webhook update stages applicable as part of a container registry update. */ - interface UpdateResourceStages { - /** - * The first stage of the webhook definition. - * - * @param the stage of the parent definition to return to after attaching this update definition - */ - interface Blank extends WithAttach { - } - - /** - * The stage of the webhook definition allowing to specify actions that trigger the webhook. - * - * @param the stage of the parent definition to return to after attaching this update definition - */ - interface WithTriggerWhen { - /** - * Specifies the actions that will trigger the webhook notifications. - * - * @param webhookActions the webhook actions - * @return the next stage of the resource update - */ - WithAttach withTriggerWhen(WebhookAction... webhookActions); - } - - /** - * The stage of the webhook definition allowing to specify the service URI for post notifications. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithServiceUri { - /** - * Specifies the service URI for post notifications. - * - * @param serviceUri the service URI for the post notifications - * @return the next stage of the resource update - */ - WithAttach withServiceUri(String serviceUri); - } - - /** - * The stage of the webhook definition allowing to specify the custom headers that will be added to the - * notifications. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithCustomHeaders { - /** - * Specifies a custom header that will be added to notifications. - * - *

    Consecutive calls to this method will add additional headers. - * - * @param name of the optional header - * @param value of the optional header - * @return the next stage of the resource update - */ - WithAttach withCustomHeader(String name, String value); - - /** - * Specifies the custom headers that will be added to the notifications. - * - * @param customHeaders the "Name=Value" custom headers. - * @return the next stage of the resource update - */ - WithAttach withCustomHeaders(Map customHeaders); - } - - /** - * The stage of the webhook definition allowing to specify the scope of repositories where the event can be - * triggered. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithRepositoriesScope { - /** - * Updates the scope of repositories where the event can be triggered. - * - *

    For example, 'foo:*' means events for all tags under repository 'foo'. 'foo:bar' means events for - * 'foo:bar' only. 'foo' is equivalent to 'foo:latest', empty means all events. - * - * @param repositoriesScope the scope of repositories where the event can be triggered; empty means all - * events - * @return the next stage of the resource update - */ - WithAttach withRepositoriesScope(String repositoriesScope); - } - - /** - * The stage of the webhook definition allowing to specify the default status of the webhook after being - * created. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithDefaultStatus { - /** - * Updates the default status of the webhook. - * - * @param defaultStatus indicates whether the webhook is enabled or disabled after being created - * @return the next stage of the resource update - */ - WithAttach enabled(boolean defaultStatus); - } - - /** - * The stage of the webhook definition allowing to specify the tags. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithOrWithoutTags { - /** - * Specifies tags for the webhook. - * - * @param tags a {@link Map} of tags - * @return the next stage of the resource update - */ - WithAttach withTags(Map tags); - - /** - * Adds a tag to the webhook. - * - * @param key the key for the tag - * @param value the value for the tag - * @return the next stage of the resource update - */ - WithAttach withTag(String key, String value); - - /** - * Removes a tag from the resource. - * - * @param key the key of the tag to remove - * @return the next stage of the resource update - */ - WithAttach withoutTag(String key); - } - - /** - * The final stage of the webhook definition. - * - *

    At this stage, any remaining optional settings can be specified, or the webhook definition can be attached - * to the parent container registry definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithAttach - extends WithTriggerWhen, - WithServiceUri, - WithCustomHeaders, - WithRepositoriesScope, - WithDefaultStatus, - WithOrWithoutTags, - Settable { - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/WebhookAction.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/WebhookAction.java deleted file mode 100644 index 5f2fa83c4a75..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/WebhookAction.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for WebhookAction. */ -public final class WebhookAction extends ExpandableStringEnum { - /** Static value push for WebhookAction. */ - public static final WebhookAction PUSH = fromString("push"); - - /** Static value delete for WebhookAction. */ - public static final WebhookAction DELETE = fromString("delete"); - - /** Static value quarantine for WebhookAction. */ - public static final WebhookAction QUARANTINE = fromString("quarantine"); - - /** Static value chart_push for WebhookAction. */ - public static final WebhookAction CHART_PUSH = fromString("chart_push"); - - /** Static value chart_delete for WebhookAction. */ - public static final WebhookAction CHART_DELETE = fromString("chart_delete"); - - /** - * Creates or finds a WebhookAction from its string representation. - * - * @param name a name to look for. - * @return the corresponding WebhookAction. - */ - @JsonCreator - public static WebhookAction fromString(String name) { - return fromString(name, WebhookAction.class); - } - - /** - * Gets known WebhookAction values. - * - * @return known WebhookAction values. - */ - public static Collection values() { - return values(WebhookAction.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/WebhookCreateParameters.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/WebhookCreateParameters.java deleted file mode 100644 index 2c422db732c6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/WebhookCreateParameters.java +++ /dev/null @@ -1,224 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.containerregistry.fluent.models.WebhookPropertiesCreateParameters; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** The parameters for creating a webhook. */ -@Fluent -public final class WebhookCreateParameters { - /* - * The tags for the webhook. - */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map tags; - - /* - * The location of the webhook. This cannot be changed after the resource - * is created. - */ - @JsonProperty(value = "location", required = true) - private String location; - - /* - * The properties that the webhook will be created with. - */ - @JsonProperty(value = "properties") - private WebhookPropertiesCreateParameters innerProperties; - - /** - * Get the tags property: The tags for the webhook. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: The tags for the webhook. - * - * @param tags the tags value to set. - * @return the WebhookCreateParameters object itself. - */ - public WebhookCreateParameters withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Get the location property: The location of the webhook. This cannot be changed after the resource is created. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Set the location property: The location of the webhook. This cannot be changed after the resource is created. - * - * @param location the location value to set. - * @return the WebhookCreateParameters object itself. - */ - public WebhookCreateParameters withLocation(String location) { - this.location = location; - return this; - } - - /** - * Get the innerProperties property: The properties that the webhook will be created with. - * - * @return the innerProperties value. - */ - private WebhookPropertiesCreateParameters innerProperties() { - return this.innerProperties; - } - - /** - * Get the serviceUri property: The service URI for the webhook to post notifications. - * - * @return the serviceUri value. - */ - public String serviceUri() { - return this.innerProperties() == null ? null : this.innerProperties().serviceUri(); - } - - /** - * Set the serviceUri property: The service URI for the webhook to post notifications. - * - * @param serviceUri the serviceUri value to set. - * @return the WebhookCreateParameters object itself. - */ - public WebhookCreateParameters withServiceUri(String serviceUri) { - if (this.innerProperties() == null) { - this.innerProperties = new WebhookPropertiesCreateParameters(); - } - this.innerProperties().withServiceUri(serviceUri); - return this; - } - - /** - * Get the customHeaders property: Custom headers that will be added to the webhook notifications. - * - * @return the customHeaders value. - */ - public Map customHeaders() { - return this.innerProperties() == null ? null : this.innerProperties().customHeaders(); - } - - /** - * Set the customHeaders property: Custom headers that will be added to the webhook notifications. - * - * @param customHeaders the customHeaders value to set. - * @return the WebhookCreateParameters object itself. - */ - public WebhookCreateParameters withCustomHeaders(Map customHeaders) { - if (this.innerProperties() == null) { - this.innerProperties = new WebhookPropertiesCreateParameters(); - } - this.innerProperties().withCustomHeaders(customHeaders); - return this; - } - - /** - * Get the status property: The status of the webhook at the time the operation was called. - * - * @return the status value. - */ - public WebhookStatus status() { - return this.innerProperties() == null ? null : this.innerProperties().status(); - } - - /** - * Set the status property: The status of the webhook at the time the operation was called. - * - * @param status the status value to set. - * @return the WebhookCreateParameters object itself. - */ - public WebhookCreateParameters withStatus(WebhookStatus status) { - if (this.innerProperties() == null) { - this.innerProperties = new WebhookPropertiesCreateParameters(); - } - this.innerProperties().withStatus(status); - return this; - } - - /** - * Get the scope property: The scope of repositories where the event can be triggered. For example, 'foo:*' means - * events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to - * 'foo:latest'. Empty means all events. - * - * @return the scope value. - */ - public String scope() { - return this.innerProperties() == null ? null : this.innerProperties().scope(); - } - - /** - * Set the scope property: The scope of repositories where the event can be triggered. For example, 'foo:*' means - * events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to - * 'foo:latest'. Empty means all events. - * - * @param scope the scope value to set. - * @return the WebhookCreateParameters object itself. - */ - public WebhookCreateParameters withScope(String scope) { - if (this.innerProperties() == null) { - this.innerProperties = new WebhookPropertiesCreateParameters(); - } - this.innerProperties().withScope(scope); - return this; - } - - /** - * Get the actions property: The list of actions that trigger the webhook to post notifications. - * - * @return the actions value. - */ - public List actions() { - return this.innerProperties() == null ? null : this.innerProperties().actions(); - } - - /** - * Set the actions property: The list of actions that trigger the webhook to post notifications. - * - * @param actions the actions value to set. - * @return the WebhookCreateParameters object itself. - */ - public WebhookCreateParameters withActions(List actions) { - if (this.innerProperties() == null) { - this.innerProperties = new WebhookPropertiesCreateParameters(); - } - this.innerProperties().withActions(actions); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (location() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property location in model WebhookCreateParameters")); - } - if (innerProperties() != null) { - innerProperties().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(WebhookCreateParameters.class); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/WebhookEventInfo.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/WebhookEventInfo.java deleted file mode 100644 index 176e598148a4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/WebhookEventInfo.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; - -/** Response containing the primary and secondary admin API keys for a given Azure Search service. */ -@Fluent -public interface WebhookEventInfo { - /** - * Gets the event request object. - * - * @return the event request message value - */ - EventRequestMessage eventRequestMessage(); - - /** - * Gets the event response object. - * - * @return the event response message value - */ - EventResponseMessage eventResponseMessage(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/WebhookListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/WebhookListResult.java deleted file mode 100644 index b71684a8e025..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/WebhookListResult.java +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.containerregistry.fluent.models.WebhookInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The result of a request to list webhooks for a container registry. */ -@Fluent -public final class WebhookListResult { - /* - * The list of webhooks. Since this list may be incomplete, the nextLink - * field should be used to request the next list of webhooks. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URI that can be used to request the next list of webhooks. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: The list of webhooks. Since this list may be incomplete, the nextLink field should be - * used to request the next list of webhooks. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The list of webhooks. Since this list may be incomplete, the nextLink field should be - * used to request the next list of webhooks. - * - * @param value the value value to set. - * @return the WebhookListResult object itself. - */ - public WebhookListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URI that can be used to request the next list of webhooks. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The URI that can be used to request the next list of webhooks. - * - * @param nextLink the nextLink value to set. - * @return the WebhookListResult object itself. - */ - public WebhookListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/WebhookOperations.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/WebhookOperations.java deleted file mode 100644 index 0dbc938b6356..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/WebhookOperations.java +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import reactor.core.publisher.Mono; - -/** Grouping of container registry webhook actions. */ -@Fluent -public interface WebhookOperations { - /** - * Gets the properties of the specified webhook. - * - * @param webhookName the name of the webhook - * @return the Webhook object if successful - */ - Webhook get(String webhookName); - - /** - * Gets the properties of the specified webhook. - * - * @param webhookName the name of the webhook - * @return a representation of the future computation of this call, returning the Webhook object - */ - Mono getAsync(String webhookName); - - /** - * Deletes a webhook from the container registry. - * - * @param webhookName the name of the webhook - */ - void delete(String webhookName); - - /** - * Deletes a webhook from the container registry. - * - * @param webhookName the name of the webhook - * @return a representation of the future computation of this call - */ - Mono deleteAsync(String webhookName); - - /** - * Lists all the webhooks for the container registry. - * - * @return the list of all the webhooks for the specified container registry - */ - PagedIterable list(); - - /** - * Lists all the webhooks for the container registry. - * - * @return a representation of the future computation of this call, returning the list of all the webhooks for the - * specified container registry - */ - PagedFlux listAsync(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/WebhookStatus.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/WebhookStatus.java deleted file mode 100644 index 9e65c509051f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/WebhookStatus.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for WebhookStatus. */ -public final class WebhookStatus extends ExpandableStringEnum { - /** Static value enabled for WebhookStatus. */ - public static final WebhookStatus ENABLED = fromString("enabled"); - - /** Static value disabled for WebhookStatus. */ - public static final WebhookStatus DISABLED = fromString("disabled"); - - /** - * Creates or finds a WebhookStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding WebhookStatus. - */ - @JsonCreator - public static WebhookStatus fromString(String name) { - return fromString(name, WebhookStatus.class); - } - - /** - * Gets known WebhookStatus values. - * - * @return known WebhookStatus values. - */ - public static Collection values() { - return values(WebhookStatus.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/WebhookUpdateParameters.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/WebhookUpdateParameters.java deleted file mode 100644 index ccc624a734eb..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/WebhookUpdateParameters.java +++ /dev/null @@ -1,188 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.containerregistry.fluent.models.WebhookPropertiesUpdateParameters; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** The parameters for updating a webhook. */ -@Fluent -public final class WebhookUpdateParameters { - /* - * The tags for the webhook. - */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map tags; - - /* - * The properties that the webhook will be updated with. - */ - @JsonProperty(value = "properties") - private WebhookPropertiesUpdateParameters innerProperties; - - /** - * Get the tags property: The tags for the webhook. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: The tags for the webhook. - * - * @param tags the tags value to set. - * @return the WebhookUpdateParameters object itself. - */ - public WebhookUpdateParameters withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Get the innerProperties property: The properties that the webhook will be updated with. - * - * @return the innerProperties value. - */ - private WebhookPropertiesUpdateParameters innerProperties() { - return this.innerProperties; - } - - /** - * Get the serviceUri property: The service URI for the webhook to post notifications. - * - * @return the serviceUri value. - */ - public String serviceUri() { - return this.innerProperties() == null ? null : this.innerProperties().serviceUri(); - } - - /** - * Set the serviceUri property: The service URI for the webhook to post notifications. - * - * @param serviceUri the serviceUri value to set. - * @return the WebhookUpdateParameters object itself. - */ - public WebhookUpdateParameters withServiceUri(String serviceUri) { - if (this.innerProperties() == null) { - this.innerProperties = new WebhookPropertiesUpdateParameters(); - } - this.innerProperties().withServiceUri(serviceUri); - return this; - } - - /** - * Get the customHeaders property: Custom headers that will be added to the webhook notifications. - * - * @return the customHeaders value. - */ - public Map customHeaders() { - return this.innerProperties() == null ? null : this.innerProperties().customHeaders(); - } - - /** - * Set the customHeaders property: Custom headers that will be added to the webhook notifications. - * - * @param customHeaders the customHeaders value to set. - * @return the WebhookUpdateParameters object itself. - */ - public WebhookUpdateParameters withCustomHeaders(Map customHeaders) { - if (this.innerProperties() == null) { - this.innerProperties = new WebhookPropertiesUpdateParameters(); - } - this.innerProperties().withCustomHeaders(customHeaders); - return this; - } - - /** - * Get the status property: The status of the webhook at the time the operation was called. - * - * @return the status value. - */ - public WebhookStatus status() { - return this.innerProperties() == null ? null : this.innerProperties().status(); - } - - /** - * Set the status property: The status of the webhook at the time the operation was called. - * - * @param status the status value to set. - * @return the WebhookUpdateParameters object itself. - */ - public WebhookUpdateParameters withStatus(WebhookStatus status) { - if (this.innerProperties() == null) { - this.innerProperties = new WebhookPropertiesUpdateParameters(); - } - this.innerProperties().withStatus(status); - return this; - } - - /** - * Get the scope property: The scope of repositories where the event can be triggered. For example, 'foo:*' means - * events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to - * 'foo:latest'. Empty means all events. - * - * @return the scope value. - */ - public String scope() { - return this.innerProperties() == null ? null : this.innerProperties().scope(); - } - - /** - * Set the scope property: The scope of repositories where the event can be triggered. For example, 'foo:*' means - * events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to - * 'foo:latest'. Empty means all events. - * - * @param scope the scope value to set. - * @return the WebhookUpdateParameters object itself. - */ - public WebhookUpdateParameters withScope(String scope) { - if (this.innerProperties() == null) { - this.innerProperties = new WebhookPropertiesUpdateParameters(); - } - this.innerProperties().withScope(scope); - return this; - } - - /** - * Get the actions property: The list of actions that trigger the webhook to post notifications. - * - * @return the actions value. - */ - public List actions() { - return this.innerProperties() == null ? null : this.innerProperties().actions(); - } - - /** - * Set the actions property: The list of actions that trigger the webhook to post notifications. - * - * @param actions the actions value to set. - * @return the WebhookUpdateParameters object itself. - */ - public WebhookUpdateParameters withActions(List actions) { - if (this.innerProperties() == null) { - this.innerProperties = new WebhookPropertiesUpdateParameters(); - } - this.innerProperties().withActions(actions); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/package-info.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/package-info.java deleted file mode 100644 index c4a178996100..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** Package containing the data models for ContainerRegistryManagementClient. null. */ -package com.azure.resourcemanager.containerregistry.models; diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/package-info.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/package-info.java deleted file mode 100644 index e6b472220062..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** Package containing the classes for ContainerRegistryManagementClient. null. */ -package com.azure.resourcemanager.containerregistry; diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/module-info.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/module-info.java deleted file mode 100644 index 0c4cb5fb96f0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/module-info.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -module com.azure.resourcemanager.containerregistry { - requires transitive com.azure.resourcemanager.resources; - requires transitive com.azure.resourcemanager.storage; - - // export public APIs of containerregistry - exports com.azure.resourcemanager.containerregistry; - exports com.azure.resourcemanager.containerregistry.fluent; - exports com.azure.resourcemanager.containerregistry.fluent.models; - exports com.azure.resourcemanager.containerregistry.models; - - // open packages specifically for azure core and jackson - opens com.azure.resourcemanager.containerregistry.fluent.models to - com.azure.core, - com.fasterxml.jackson.databind; - opens com.azure.resourcemanager.containerregistry.models to - com.azure.core, - com.fasterxml.jackson.databind; -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/samples/java/com/azure/resourcemanager/containerregistry/ReadmeSamples.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/samples/java/com/azure/resourcemanager/containerregistry/ReadmeSamples.java deleted file mode 100644 index d8780a435bce..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/samples/java/com/azure/resourcemanager/containerregistry/ReadmeSamples.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.containerregistry; - -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpMethod; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.util.serializer.JacksonAdapter; -import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.identity.DefaultAzureCredentialBuilder; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.ArrayNode; - -import java.io.IOException; -import java.util.HashMap; - -public class ReadmeSamples { - - public void authenticate() { - // BEGIN: com.azure.resourcemanager.containerregistry.authenticate - String armEndpoint = "https://management.."; - AzureProfile profile = new AzureProfile(getAzureEnvironmentFromArmEndpoint(armEndpoint)); - TokenCredential credential = new DefaultAzureCredentialBuilder() - .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) - .build(); - ContainerRegistryManager manager = ContainerRegistryManager - .authenticate(credential, profile); - // END: com.azure.resourcemanager.containerregistry.authenticate - } - - // BEGIN: com.azure.resourcemanager.containerregistry.getazureenvironment - private static AzureEnvironment getAzureEnvironmentFromArmEndpoint(String armEndpoint) { - // Create HTTP client and request - HttpClient httpClient = HttpClient.createDefault(); - - HttpRequest request = new HttpRequest(HttpMethod.GET, - String.format("%s/metadata/endpoints?api-version=2019-10-01", armEndpoint)) - .setHeader("accept", "application/json"); - - // Execute the request and read the response - HttpResponse response = httpClient.send(request).block(); - if (response.getStatusCode() != 200) { - throw new RuntimeException("Failed : HTTP error code : " + response.getStatusCode()); - } - String body = response.getBodyAsString().block(); - try { - ArrayNode metadataArray = JacksonAdapter.createDefaultSerializerAdapter() - .deserialize(body, ArrayNode.class, SerializerEncoding.JSON); - - if (metadataArray == null || metadataArray.isEmpty()) { - throw new RuntimeException("Failed to find metadata : " + body); - } - - JsonNode metadata = metadataArray.iterator().next(); - AzureEnvironment azureEnvironment = new AzureEnvironment(new HashMap() { - { - put("managementEndpointUrl", metadata.at("/authentication/audiences/0").asText()); - put("resourceManagerEndpointUrl", armEndpoint); - put("galleryEndpointUrl", metadata.at("/gallery").asText()); - put("activeDirectoryEndpointUrl", metadata.at("/authentication/loginEndpoint").asText()); - put("activeDirectoryResourceId", metadata.at("/authentication/audiences/0").asText()); - put("activeDirectoryGraphResourceId", metadata.at("/graph").asText()); - put("storageEndpointSuffix", "." + metadata.at("/suffixes/storage").asText()); - put("keyVaultDnsSuffix", "." + metadata.at("/suffixes/keyVaultDns").asText()); - } - }); - return azureEnvironment; - } catch (IOException ioe) { - ioe.printStackTrace(); - throw new RuntimeException(ioe); - } - } - // END: com.azure.resourcemanager.containerregistry.getazureenvironment -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/test/java/com/azure/resourcemanager/containerregistry/RegistryTaskTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/test/java/com/azure/resourcemanager/containerregistry/RegistryTaskTests.java deleted file mode 100644 index f6abcf5ab887..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/test/java/com/azure/resourcemanager/containerregistry/RegistryTaskTests.java +++ /dev/null @@ -1,1372 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.containerregistry; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.containerregistry.models.Architecture; -import com.azure.resourcemanager.containerregistry.models.BaseImageTriggerType; -import com.azure.resourcemanager.containerregistry.models.OS; -import com.azure.resourcemanager.containerregistry.models.Registry; -import com.azure.resourcemanager.containerregistry.models.RegistryDockerTaskStep; -import com.azure.resourcemanager.containerregistry.models.RegistryEncodedTaskStep; -import com.azure.resourcemanager.containerregistry.models.RegistryFileTaskStep; -import com.azure.resourcemanager.containerregistry.models.RegistryTask; -import com.azure.resourcemanager.containerregistry.models.RegistryTaskRun; -import com.azure.resourcemanager.containerregistry.models.RunStatus; -import com.azure.resourcemanager.containerregistry.models.SourceControlType; -import com.azure.resourcemanager.containerregistry.models.SourceTriggerEvent; -import com.azure.resourcemanager.containerregistry.models.SourceUploadDefinition; -import com.azure.resourcemanager.containerregistry.models.TokenType; -import com.azure.resourcemanager.containerregistry.models.TriggerStatus; -import com.azure.core.management.Region; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import java.io.File; -import java.io.FileInputStream; -import java.time.Duration; -import java.util.Arrays; -import java.util.Base64; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public class RegistryTaskTests extends RegistryTest { - - @Test - @Disabled("Needs personal tokens to run") - public void fileTaskTest() { - final String acrName = generateRandomResourceName("acr", 10); - String githubRepoUrl = "Replace with your github repository url, eg: https://github.com/Azure/acr.git"; - String githubBranch = "Replace with your github repositoty branch, eg: master"; - String githubPAT = - "Replace with your github personal access token which should have the scopes: admin:repo_hook and repo"; - String taskFilePath = "Path to your task file that is relative to the githubRepoUrl"; - - Registry registry = - registryManager - .containerRegistries() - .define(acrName) - .withRegion(locationOrDefault(Region.US_WEST_CENTRAL)) - .withNewResourceGroup(rgName) - .withPremiumSku() - .withRegistryNameAsAdminUser() - .withTag("tag1", "value1") - .create(); - - String taskName = generateRandomResourceName("ft", 10); - RegistryTask registryTask = - registryManager - .containerRegistryTasks() - .define(taskName) - .withExistingRegistry(rgName, acrName) - .withLocation(locationOrDefault(Region.US_WEST_CENTRAL).name()) - .withLinux(Architecture.AMD64) - .defineFileTaskStep() - .withTaskPath(taskFilePath) - .attach() - .defineSourceTrigger("SampleSourceTrigger") - .withGithubAsSourceControl() - .withSourceControlRepositoryUrl(githubRepoUrl) - .withCommitTriggerEvent() - .withPullTriggerEvent() - .withRepositoryBranch(githubBranch) - .withRepositoryAuthentication(TokenType.PAT, githubPAT) - .attach() - .withBaseImageTrigger("SampleBaseImageTrigger", BaseImageTriggerType.RUNTIME) - .withCpuCount(2) - .create(); - - RegistryFileTaskStep registryFileTaskStep = (RegistryFileTaskStep) registryTask.registryTaskStep(); - - // Assert the name of the registryTask is correct - Assertions.assertEquals(taskName, registryTask.name()); - - // Assert the resource group name is correct - Assertions.assertEquals(rgName, registryTask.resourceGroupName()); - - // Assert location is correct - Assertions.assertEquals(locationOrDefault(Region.US_WEST_CENTRAL).name(), registryTask.regionName()); - - // Assert OS is correct - Assertions.assertEquals(OS.LINUX, registryTask.platform().os()); - - // Assert architecture is correct - Assertions.assertEquals(Architecture.AMD64, registryTask.platform().architecture()); - - // Assert that the registryTask file path is correct - Assertions.assertEquals(taskFilePath, registryFileTaskStep.taskFilePath()); - - // Assert CPU count is correct - Assertions.assertEquals(2, registryTask.cpuCount()); - - // Assert the length of the source triggers array list is correct - Assertions.assertTrue(registryTask.trigger().sourceTriggers().size() == 1); - - // Assert source triggers are correct - Assertions.assertEquals("SampleSourceTrigger", registryTask.trigger().sourceTriggers().get(0).name()); - - // Assert base image trigger is correct - Assertions.assertEquals("SampleBaseImageTrigger", registryTask.trigger().baseImageTrigger().name()); - } - - @Test - @Disabled("Needs personal tokens to run") - public void fileTaskUpdateTest() { - final String acrName = generateRandomResourceName("acr", 10); - String githubRepoUrl = "Replace with your github repository url, eg: https://github.com/Azure/acr.git"; - String githubBranch = "Replace with your github repositoty branch, eg: master"; - String githubPAT = - "Replace with your github personal access token which should have the scopes: admin:repo_hook and repo"; - String taskFilePath = "Path to your task file that is relative to the githubRepoUrl"; - String taskFileUpdatePath = "Path to your update task file that is relative to the githubRepoUrl"; - - Registry registry = - registryManager - .containerRegistries() - .define(acrName) - .withRegion(locationOrDefault(Region.US_WEST_CENTRAL)) - .withNewResourceGroup(rgName) - .withPremiumSku() - .withRegistryNameAsAdminUser() - .withTag("tag1", "value1") - .create(); - - String taskName = generateRandomResourceName("ft", 10); - RegistryTask registryTask = - registryManager - .containerRegistryTasks() - .define(taskName) - .withExistingRegistry(rgName, acrName) - .withLocation(locationOrDefault(Region.US_WEST_CENTRAL).name()) - .withLinux(Architecture.AMD64) - .defineFileTaskStep() - .withTaskPath(taskFilePath) - .attach() - .defineSourceTrigger("SampleSourceTrigger") - .withGithubAsSourceControl() - .withSourceControlRepositoryUrl(githubRepoUrl) - .withCommitTriggerEvent() - .withPullTriggerEvent() - .withRepositoryBranch(githubBranch) - .withRepositoryAuthentication(TokenType.PAT, githubPAT) - .attach() - .withBaseImageTrigger("SampleBaseImageTrigger", BaseImageTriggerType.RUNTIME) - .withCpuCount(2) - .create(); - - registryTask.update().updateFileTaskStep().withTaskPath(taskFileUpdatePath).parent().apply(); - - RegistryFileTaskStep registryFileTaskStep = (RegistryFileTaskStep) registryTask.registryTaskStep(); - - // Assert the name of the registryTask is correct - Assertions.assertEquals(taskName, registryTask.name()); - - // Assert the resource group name is correct - Assertions.assertEquals(rgName, registryTask.resourceGroupName()); - - // Assert location is correct - Assertions.assertEquals(locationOrDefault(Region.US_WEST_CENTRAL).name(), registryTask.regionName()); - - // Assert OS is correct - Assertions.assertEquals(OS.LINUX, registryTask.platform().os()); - - // Assert architecture is correct - Assertions.assertEquals(Architecture.AMD64, registryTask.platform().architecture()); - - // Assert CPU count is correct - Assertions.assertEquals(2, registryTask.cpuCount()); - - // Assert the length of the source triggers array list is correct - Assertions.assertTrue(registryTask.trigger().sourceTriggers().size() == 1); - - // Assert source triggers are correct - Assertions.assertEquals("SampleSourceTrigger", registryTask.trigger().sourceTriggers().get(0).name()); - - // Assert base image trigger is correct - Assertions.assertEquals("SampleBaseImageTrigger", registryTask.trigger().baseImageTrigger().name()); - - // Checking to see whether file path name is updated correctly - Assertions.assertEquals(taskFileUpdatePath, registryFileTaskStep.taskFilePath()); - - boolean errorRaised = false; - try { - registryTask.update().updateEncodedTaskStep().parent().apply(); - } catch (UnsupportedOperationException e) { - errorRaised = true; - } - - // Checking to see whether error is raised if update is called on the incorrect registryTask step type. - Assertions.assertTrue(errorRaised); - } - - @Test - @Disabled("Needs personal tokens to run") - public void encodedTaskTest() { - final String acrName = generateRandomResourceName("acr", 10); - String githubRepoUrl = "Replace with your github repository url, eg: https://github.com/Azure/acr.git"; - String githubBranch = "Replace with your github repositoty branch, eg: master"; - String githubPAT = - "Replace with your github personal access token which should have the scopes: admin:repo_hook and repo"; - String encodedTaskContent = "Base64 encoded task content"; - - Registry registry = - registryManager - .containerRegistries() - .define(acrName) - .withRegion(locationOrDefault(Region.US_WEST_CENTRAL)) - .withNewResourceGroup(rgName) - .withPremiumSku() - .withRegistryNameAsAdminUser() - .withTag("tag1", "value1") - .create(); - - String taskName = generateRandomResourceName("ft", 10); - - RegistryTask registryTask = - registryManager - .containerRegistryTasks() - .define(taskName) - .withExistingRegistry(rgName, acrName) - .withLocation(locationOrDefault(Region.US_WEST_CENTRAL).name()) - .withLinux(Architecture.AMD64) - .defineEncodedTaskStep() - .withBase64EncodedTaskContent(encodedTaskContent) - .attach() - .defineSourceTrigger("SampleSourceTrigger") - .withGithubAsSourceControl() - .withSourceControlRepositoryUrl(githubRepoUrl) - .withCommitTriggerEvent() - .withPullTriggerEvent() - .withRepositoryBranch(githubBranch) - .withRepositoryAuthentication(TokenType.PAT, githubPAT) - .attach() - .withBaseImageTrigger("SampleBaseImageTrigger", BaseImageTriggerType.RUNTIME) - .withCpuCount(2) - .create(); - - RegistryEncodedTaskStep registryEncodedTaskStep = (RegistryEncodedTaskStep) registryTask.registryTaskStep(); - - // Assert the name of the registryTask is correct - Assertions.assertEquals(taskName, registryTask.name()); - - // Assert the resource group name is correct - Assertions.assertEquals(rgName, registryTask.resourceGroupName()); - - // Assert location is correct - Assertions.assertEquals(locationOrDefault(Region.US_WEST_CENTRAL).name(), registryTask.regionName()); - - // Assert OS is correct - Assertions.assertEquals(OS.LINUX, registryTask.platform().os()); - - // Assert architecture is correct - Assertions.assertEquals(Architecture.AMD64, registryTask.platform().architecture()); - - // Assert that the registryTask file path is correct - Assertions.assertEquals(encodedTaskContent, registryEncodedTaskStep.encodedTaskContent()); - - // Assert CPU count is correct - Assertions.assertEquals(2, registryTask.cpuCount()); - - // Assert the length of the source triggers array list is correct - Assertions.assertTrue(registryTask.trigger().sourceTriggers().size() == 1); - - // Assert source triggers are correct - Assertions.assertEquals("SampleSourceTrigger", registryTask.trigger().sourceTriggers().get(0).name()); - - // Assert base image trigger is correct - Assertions.assertEquals("SampleBaseImageTrigger", registryTask.trigger().baseImageTrigger().name()); - } - - @Test - @Disabled("Needs personal tokens to run") - public void encodedTaskUpdateTest() { - final String acrName = generateRandomResourceName("acr", 10); - String githubRepoUrl = "Replace with your github repository url, eg: https://github.com/Azure/acr.git"; - String githubBranch = "Replace with your github repositoty branch, eg: master"; - String githubPAT = - "Replace with your github personal access token which should have the scopes: admin:repo_hook and repo"; - String encodedTaskContent = "Base64 encoded task content"; - String encodedTaskContentUpdate = "Base64 encoded task content that we want to update to"; - - Registry registry = - registryManager - .containerRegistries() - .define(acrName) - .withRegion(locationOrDefault(Region.US_WEST_CENTRAL)) - .withNewResourceGroup(rgName) - .withPremiumSku() - .withRegistryNameAsAdminUser() - .withTag("tag1", "value1") - .create(); - - String taskName = generateRandomResourceName("ft", 10); - - RegistryTask registryTask = - registryManager - .containerRegistryTasks() - .define(taskName) - .withExistingRegistry(rgName, acrName) - .withLocation(locationOrDefault(Region.US_WEST_CENTRAL).name()) - .withLinux(Architecture.AMD64) - .defineEncodedTaskStep() - .withBase64EncodedTaskContent(encodedTaskContent) - .attach() - .defineSourceTrigger("SampleSourceTrigger") - .withGithubAsSourceControl() - .withSourceControlRepositoryUrl(githubRepoUrl) - .withCommitTriggerEvent() - .withPullTriggerEvent() - .withRepositoryBranch(githubBranch) - .withRepositoryAuthentication(TokenType.PAT, githubPAT) - .attach() - .withBaseImageTrigger("SampleBaseImageTrigger", BaseImageTriggerType.RUNTIME) - .withCpuCount(2) - .create(); - - registryTask - .update() - .updateEncodedTaskStep() - .withBase64EncodedTaskContent(encodedTaskContentUpdate) - .parent() - .apply(); - - RegistryEncodedTaskStep registryEncodedTaskStep = (RegistryEncodedTaskStep) registryTask.registryTaskStep(); - - // Assert the name of the registryTask is correct - Assertions.assertEquals(taskName, registryTask.name()); - - // Assert the resource group name is correct - Assertions.assertEquals(rgName, registryTask.resourceGroupName()); - - // Assert location is correct - Assertions.assertEquals(locationOrDefault(Region.US_WEST_CENTRAL).name(), registryTask.regionName()); - - // Assert OS is correct - Assertions.assertEquals(OS.LINUX, registryTask.platform().os()); - - // Assert architecture is correct - Assertions.assertEquals(Architecture.AMD64, registryTask.platform().architecture()); - - // Assert that the registryTask file path is correct - Assertions.assertEquals(encodedTaskContentUpdate, registryEncodedTaskStep.encodedTaskContent()); - - // Assert CPU count is correct - Assertions.assertEquals(1, registryTask.cpuCount()); - - // Assert the length of the source triggers array list is correct - Assertions.assertTrue(registryTask.trigger().sourceTriggers().size() == 1); - - // Assert source triggers are correct - Assertions.assertEquals("SampleSourceTrigger", registryTask.trigger().sourceTriggers().get(0).name()); - - // Assert base image trigger is correct - Assertions.assertEquals("SampleBaseImageTrigger", registryTask.trigger().baseImageTrigger().name()); - - boolean errorRaised = false; - try { - registryTask.update().updateDockerTaskStep().parent().apply(); - } catch (UnsupportedOperationException e) { - errorRaised = true; - } - - // Checking to see whether error is raised if update is called on the incorrect registryTask step type. - Assertions.assertTrue(errorRaised); - } - - @Test - @Disabled("Needs personal tokens to run") - public void dockerTaskTest() { - final String acrName = generateRandomResourceName("acr", 10); - String githubRepoUrl = "Replace with your github repository url, eg: https://github.com/Azure/acr.git"; - String githubBranch = "Replace with your github repositoty branch, eg: master"; - String githubPAT = - "Replace with your github personal access token which should have the scopes: admin:repo_hook and repo"; - String dockerFilePath = "Replace with your docker file path relative to githubContext, eg: Dockerfile"; - String imageName = "Replace with the name of your image."; - - Registry registry = - registryManager - .containerRegistries() - .define(acrName) - .withRegion(locationOrDefault(Region.US_WEST_CENTRAL)) - .withNewResourceGroup(rgName) - .withPremiumSku() - .withRegistryNameAsAdminUser() - .withTag("tag1", "value1") - .create(); - - String taskName = generateRandomResourceName("ft", 10); - RegistryTask registryTask = - registryManager - .containerRegistryTasks() - .define(taskName) - .withExistingRegistry(rgName, acrName) - .withLocation(locationOrDefault(Region.US_WEST_CENTRAL).name()) - .withLinux(Architecture.AMD64) - .defineDockerTaskStep() - .withDockerFilePath(dockerFilePath) - .withImageNames(Arrays.asList(imageName)) - .withCacheEnabled(true) - .withPushEnabled(true) - .attach() - .defineSourceTrigger("SampleSourceTrigger") - .withGithubAsSourceControl() - .withSourceControlRepositoryUrl(githubRepoUrl) - .withCommitTriggerEvent() - .withPullTriggerEvent() - .withRepositoryBranch(githubBranch) - .withRepositoryAuthentication(TokenType.PAT, githubPAT) - .attach() - .withBaseImageTrigger("SampleBaseImageTrigger", BaseImageTriggerType.RUNTIME) - .withCpuCount(2) - .create(); - - RegistryDockerTaskStep registryDockerTaskStep = (RegistryDockerTaskStep) registryTask.registryTaskStep(); - - // Assert the name of the registryTask is correct - Assertions.assertEquals(taskName, registryTask.name()); - - // Assert the resource group name is correct - Assertions.assertEquals(rgName, registryTask.resourceGroupName()); - - // Assert location is correct - Assertions.assertEquals(locationOrDefault(Region.US_WEST_CENTRAL).name(), registryTask.regionName()); - - // Assert OS is correct - Assertions.assertEquals(OS.LINUX, registryTask.platform().os()); - - // Assert architecture is correct - Assertions.assertEquals(Architecture.AMD64, registryTask.platform().architecture()); - - // Assert that the registryTask file path is correct - Assertions.assertEquals(dockerFilePath, registryDockerTaskStep.dockerFilePath()); - - // Assert that the image name array is correct - Assertions.assertEquals(imageName, registryDockerTaskStep.imageNames().get(0)); - - // Assert that with cache works - Assertions.assertTrue(!registryDockerTaskStep.noCache()); - - // Assert that push is enabled - Assertions.assertTrue(registryDockerTaskStep.isPushEnabled()); - - // Assert CPU count is correct - Assertions.assertEquals(2, registryTask.cpuCount()); - - // Assert the length of the source triggers array list is correct - Assertions.assertTrue(registryTask.trigger().sourceTriggers().size() == 1); - - // Assert source triggers are correct - Assertions.assertEquals("SampleSourceTrigger", registryTask.trigger().sourceTriggers().get(0).name()); - - // Assert base image trigger is correct - Assertions.assertEquals("SampleBaseImageTrigger", registryTask.trigger().baseImageTrigger().name()); - } - - @Test - @Disabled("Needs personal tokens to run") - public void dsockerTaskUpdateTest() { - final String acrName = generateRandomResourceName("acr", 10); - String githubRepoUrl = "Replace with your github repository url, eg: https://github.com/Azure/acr.git"; - String githubBranch = "Replace with your github repositoty branch, eg: master"; - String githubPAT = - "Replace with your github personal access token which should have the scopes: admin:repo_hook and repo"; - String dockerFilePath = "Replace with your docker file path relative to githubContext, eg: Dockerfile"; - String dockerFilePathUpdate = - "Replace this with your docker file path that you updated your registryTask to, if you did update your" - + " docker file path"; - String imageName = "Replace with the name of your image."; - - Registry registry = - registryManager - .containerRegistries() - .define(acrName) - .withRegion(locationOrDefault(Region.US_WEST_CENTRAL)) - .withNewResourceGroup(rgName) - .withPremiumSku() - .withRegistryNameAsAdminUser() - .withTag("tag1", "value1") - .create(); - - String taskName = generateRandomResourceName("ft", 10); - RegistryTask registryTask = - registryManager - .containerRegistryTasks() - .define(taskName) - .withExistingRegistry(rgName, acrName) - .withLocation(locationOrDefault(Region.US_WEST_CENTRAL).name()) - .withLinux(Architecture.AMD64) - .defineDockerTaskStep() - .withDockerFilePath(dockerFilePath) - .withImageNames(Arrays.asList(imageName)) - .withCacheEnabled(true) - .withPushEnabled(true) - .attach() - .defineSourceTrigger("SampleSourceTrigger") - .withGithubAsSourceControl() - .withSourceControlRepositoryUrl(githubRepoUrl) - .withCommitTriggerEvent() - .withPullTriggerEvent() - .withRepositoryBranch(githubBranch) - .withRepositoryAuthentication(TokenType.PAT, githubPAT) - .attach() - .withBaseImageTrigger("SampleBaseImageTrigger", BaseImageTriggerType.RUNTIME) - .withCpuCount(2) - .create(); - - registryTask - .update() - .updateDockerTaskStep() - .withDockerFilePath(dockerFilePathUpdate) - .withCacheEnabled(false) - .withPushEnabled(false) - .parent() - .apply(); - - RegistryDockerTaskStep registryDockerTaskStep = (RegistryDockerTaskStep) registryTask.registryTaskStep(); - - // Assert the name of the registryTask is correct - Assertions.assertEquals(taskName, registryTask.name()); - - // Assert the resource group name is correct - Assertions.assertEquals(rgName, registryTask.resourceGroupName()); - - // Assert location is correct - Assertions.assertEquals(locationOrDefault(Region.US_WEST_CENTRAL).name(), registryTask.regionName()); - - // Assert OS is correct - Assertions.assertEquals(OS.LINUX, registryTask.platform().os()); - - // Assert architecture is correct - Assertions.assertEquals(Architecture.AMD64, registryTask.platform().architecture()); - - // Assert that the registryTask file path is correct - Assertions.assertEquals(dockerFilePathUpdate, registryDockerTaskStep.dockerFilePath()); - - // Assert that the image name array is correct - Assertions.assertEquals(imageName, registryDockerTaskStep.imageNames().get(0)); - - // Assert that with no cache works - Assertions.assertTrue(registryDockerTaskStep.noCache()); - - // Assert that push is disabled - Assertions.assertTrue(!registryDockerTaskStep.isPushEnabled()); - - // Assert the length of the source triggers array list is correct - Assertions.assertTrue(registryTask.trigger().sourceTriggers().size() == 1); - - // Assert source triggers are correct - Assertions.assertEquals("SampleSourceTrigger", registryTask.trigger().sourceTriggers().get(0).name()); - - // Assert base image trigger is correct - Assertions.assertEquals("SampleBaseImageTrigger", registryTask.trigger().baseImageTrigger().name()); - - boolean errorRaised = false; - try { - registryTask.update().updateFileTaskStep().parent().apply(); - } catch (UnsupportedOperationException e) { - errorRaised = true; - } - - // Checking to see whether error is raised if update is called on the incorrect registryTask step type. - Assertions.assertTrue(errorRaised); - } - - @Test - public void fileTaskRunRequestFromRegistry() { - final String acrName = generateRandomResourceName("acr", 10); - String sourceLocation = "https://github.com/Azure/acr.git"; - String taskFilePath = "samples/java/task/acb.yaml"; - - Registry registry = - registryManager - .containerRegistries() - .define(acrName) - .withRegion(locationOrDefault(Region.US_WEST_CENTRAL)) - .withNewResourceGroup(rgName) - .withPremiumSku() - .withRegistryNameAsAdminUser() - .withTag("tag1", "value1") - .create(); - - RegistryTaskRun registryTaskRun = - registry - .scheduleRun() - .withWindows() - .withFileTaskRunRequest() - .defineFileTaskStep() - .withTaskPath(taskFilePath) - .attach() - .withSourceLocation(sourceLocation) - .withArchiveEnabled(true) - .execute(); - - registryTaskRun.refresh(); - Assertions.assertEquals(registry.resourceGroupName(), registryTaskRun.resourceGroupName()); - Assertions.assertEquals(acrName, registryTaskRun.registryName()); - Assertions.assertTrue(registryTaskRun.isArchiveEnabled()); - Assertions.assertEquals(OS.WINDOWS, registryTaskRun.platform().os()); - - PagedIterable registryTaskRuns = - registryManager.registryTaskRuns().listByRegistry(rgName, acrName); - RegistryTaskRun registryTaskRunFromList = registryTaskRuns.stream().findFirst().get(); - Assertions.assertTrue(registryTaskRunFromList.status() != null); - Assertions.assertEquals("QuickRun", registryTaskRunFromList.runType().toString()); - Assertions.assertTrue(registryTaskRunFromList.isArchiveEnabled()); - Assertions.assertEquals(OS.WINDOWS, registryTaskRunFromList.platform().os()); - Assertions.assertEquals("Succeeded", registryTaskRunFromList.provisioningState().toString()); - } - - @Test - public void fileTaskRunRequestFromRuns() { - final String acrName = generateRandomResourceName("acr", 10); - String sourceLocation = "https://github.com/Azure/acr.git"; - String taskFilePath = "samples/java/task/acb.yaml"; - - Registry registry = - registryManager - .containerRegistries() - .define(acrName) - .withRegion(locationOrDefault(Region.US_WEST_CENTRAL)) - .withNewResourceGroup(rgName) - .withPremiumSku() - .withRegistryNameAsAdminUser() - .withTag("tag1", "value1") - .create(); - - RegistryTaskRun registryTaskRun = - registryManager - .registryTaskRuns() - .scheduleRun() - .withExistingRegistry(rgName, acrName) - .withLinux() - .withFileTaskRunRequest() - .defineFileTaskStep() - .withTaskPath(taskFilePath) - .attach() - .withSourceLocation(sourceLocation) - .withArchiveEnabled(true) - .execute(); - - registryTaskRun.refresh(); - Assertions.assertEquals(registry.resourceGroupName(), registryTaskRun.resourceGroupName()); - Assertions.assertEquals(acrName, registryTaskRun.registryName()); - Assertions.assertTrue(registryTaskRun.isArchiveEnabled()); - Assertions.assertEquals(OS.LINUX, registryTaskRun.platform().os()); - - PagedIterable registryTaskRuns = - registryManager.registryTaskRuns().listByRegistry(rgName, acrName); - RegistryTaskRun registryTaskRunFromList = registryTaskRuns.stream().findFirst().get(); - Assertions.assertTrue(registryTaskRunFromList.status() != null); - Assertions.assertEquals("QuickRun", registryTaskRunFromList.runType().toString()); - Assertions.assertTrue(registryTaskRunFromList.isArchiveEnabled()); - Assertions.assertEquals(OS.LINUX, registryTaskRunFromList.platform().os()); - Assertions.assertEquals("Succeeded", registryTaskRunFromList.provisioningState().toString()); - } - - @Test - public void encodedTaskRunRequestFromRegistry() throws Exception { - final String acrName = generateRandomResourceName("acr", 10); - String sourceLocation = "https://github.com/Azure/acr.git"; - String encodedTaskContent = Base64.getEncoder().encodeToString(readTaskYaml()); - - Registry registry = - registryManager - .containerRegistries() - .define(acrName) - .withRegion(locationOrDefault(Region.US_WEST_CENTRAL)) - .withNewResourceGroup(rgName) - .withPremiumSku() - .withRegistryNameAsAdminUser() - .withTag("tag1", "value1") - .create(); - - RegistryTaskRun registryTaskRun = - registry - .scheduleRun() - .withLinux() - .withEncodedTaskRunRequest() - .defineEncodedTaskStep() - .withBase64EncodedTaskContent(encodedTaskContent) - .attach() - .withSourceLocation(sourceLocation) - .withArchiveEnabled(true) - .execute(); - - registryTaskRun.refresh(); - - Assertions.assertEquals(registry.resourceGroupName(), registryTaskRun.resourceGroupName()); - Assertions.assertEquals(acrName, registryTaskRun.registryName()); - Assertions.assertTrue(registryTaskRun.isArchiveEnabled()); - Assertions.assertEquals(OS.LINUX, registryTaskRun.platform().os()); - - PagedIterable registryTaskRuns = - registryManager.registryTaskRuns().listByRegistry(rgName, acrName); - RegistryTaskRun registryTaskRunFromList = registryTaskRuns.stream().findFirst().get(); - Assertions.assertTrue(registryTaskRunFromList.status() != null); - Assertions.assertEquals("QuickRun", registryTaskRunFromList.runType().toString()); - Assertions.assertTrue(registryTaskRunFromList.isArchiveEnabled()); - Assertions.assertEquals(OS.LINUX, registryTaskRunFromList.platform().os()); - Assertions.assertEquals("Succeeded", registryTaskRunFromList.provisioningState().toString()); - } - - @Test - public void encodedTaskRunRequestFromRuns() throws Exception { - final String acrName = generateRandomResourceName("acr", 10); - String sourceLocation = "https://github.com/Azure/acr.git#master:samples/java/task"; - String encodedTaskContent = Base64.getEncoder().encodeToString(readTaskYaml()); - - Registry registry = - registryManager - .containerRegistries() - .define(acrName) - .withRegion(locationOrDefault(Region.US_WEST_CENTRAL)) - .withNewResourceGroup(rgName) - .withPremiumSku() - .withRegistryNameAsAdminUser() - .withTag("tag1", "value1") - .create(); - - RegistryTaskRun registryTaskRun = - registryManager - .registryTaskRuns() - .scheduleRun() - .withExistingRegistry(rgName, acrName) - .withLinux() - .withEncodedTaskRunRequest() - .defineEncodedTaskStep() - .withBase64EncodedTaskContent(encodedTaskContent) - .attach() - .withSourceLocation(sourceLocation) - .withArchiveEnabled(true) - .execute(); - - registryTaskRun.refresh(); - - Assertions.assertEquals(registry.resourceGroupName(), registryTaskRun.resourceGroupName()); - Assertions.assertEquals(acrName, registryTaskRun.registryName()); - Assertions.assertTrue(registryTaskRun.isArchiveEnabled()); - Assertions.assertEquals(OS.LINUX, registryTaskRun.platform().os()); - - PagedIterable registryTaskRuns = - registryManager.registryTaskRuns().listByRegistry(rgName, acrName); - RegistryTaskRun registryTaskRunFromList = registryTaskRuns.stream().findFirst().get(); - Assertions.assertTrue(registryTaskRunFromList.status() != null); - Assertions.assertEquals("QuickRun", registryTaskRunFromList.runType().toString()); - Assertions.assertTrue(registryTaskRunFromList.isArchiveEnabled()); - Assertions.assertEquals(OS.LINUX, registryTaskRunFromList.platform().os()); - Assertions.assertEquals("Succeeded", registryTaskRunFromList.provisioningState().toString()); - } - - @Test - public void dockerTaskRunRequestFromRegistry() { - final String acrName = generateRandomResourceName("acr", 10); - String dockerFilePath = "Dockerfile"; - String imageName = "test"; - String sourceLocation = "https://github.com/Azure/acr.git#master:samples/java/task"; - - Registry registry = - registryManager - .containerRegistries() - .define(acrName) - .withRegion(locationOrDefault(Region.US_WEST_CENTRAL)) - .withNewResourceGroup(rgName) - .withPremiumSku() - .withRegistryNameAsAdminUser() - .withTag("tag1", "value1") - .create(); - - RegistryTaskRun registryTaskRun = - registry - .scheduleRun() - .withLinux() - .withDockerTaskRunRequest() - .defineDockerTaskStep() - .withDockerFilePath(dockerFilePath) - .withImageNames(Arrays.asList(imageName)) - .withCacheEnabled(true) - .withPushEnabled(true) - .attach() - .withSourceLocation(sourceLocation) - .withArchiveEnabled(true) - .execute(); - - registryTaskRun.refresh(); - Assertions.assertEquals(registry.resourceGroupName(), registryTaskRun.resourceGroupName()); - Assertions.assertEquals(acrName, registryTaskRun.registryName()); - Assertions.assertTrue(registryTaskRun.isArchiveEnabled()); - Assertions.assertEquals(OS.LINUX, registryTaskRun.platform().os()); - - PagedIterable registryTaskRuns = - registryManager.registryTaskRuns().listByRegistry(rgName, acrName); - RegistryTaskRun registryTaskRunFromList = registryTaskRuns.stream().findFirst().get(); - Assertions.assertTrue(registryTaskRunFromList.status() != null); - Assertions.assertEquals("QuickRun", registryTaskRunFromList.runType().toString()); - Assertions.assertTrue(registryTaskRunFromList.isArchiveEnabled()); - Assertions.assertEquals(OS.LINUX, registryTaskRunFromList.platform().os()); - Assertions.assertEquals("Succeeded", registryTaskRunFromList.provisioningState().toString()); - } - - @Test - public void dockerTaskRunRequestFromRuns() { - final String acrName = generateRandomResourceName("acr", 10); - String dockerFilePath = "Dockerfile"; - String imageName = "test"; - String sourceLocation = "https://github.com/Azure/acr.git#master:samples/java/task"; - - Registry registry = - registryManager - .containerRegistries() - .define(acrName) - .withRegion(locationOrDefault(Region.US_WEST_CENTRAL)) - .withNewResourceGroup(rgName) - .withPremiumSku() - .withRegistryNameAsAdminUser() - .withTag("tag1", "value1") - .create(); - - RegistryTaskRun registryTaskRun = - registryManager - .registryTaskRuns() - .scheduleRun() - .withExistingRegistry(rgName, acrName) - .withLinux() - .withDockerTaskRunRequest() - .defineDockerTaskStep() - .withDockerFilePath(dockerFilePath) - .withImageNames(Arrays.asList(imageName)) - .withCacheEnabled(true) - .withPushEnabled(true) - .attach() - .withSourceLocation(sourceLocation) - .withArchiveEnabled(true) - .execute(); - - registryTaskRun.refresh(); - Assertions.assertEquals(registry.resourceGroupName(), registryTaskRun.resourceGroupName()); - Assertions.assertEquals(acrName, registryTaskRun.registryName()); - - Assertions.assertTrue(registryTaskRun.isArchiveEnabled()); - Assertions.assertEquals(OS.LINUX, registryTaskRun.platform().os()); - - PagedIterable registryTaskRuns = - registryManager.registryTaskRuns().listByRegistry(rgName, acrName); - RegistryTaskRun registryTaskRunFromList = registryTaskRuns.stream().findFirst().get(); - Assertions.assertTrue(registryTaskRunFromList.status() != null); - Assertions.assertEquals("QuickRun", registryTaskRunFromList.runType().toString()); - Assertions.assertTrue(registryTaskRunFromList.isArchiveEnabled()); - Assertions.assertEquals(OS.LINUX, registryTaskRunFromList.platform().os()); - Assertions.assertEquals("Succeeded", registryTaskRunFromList.provisioningState().toString()); - } - - @Test - @Disabled("Needs personal tokens to run") - public void taskRunRequestFromRegistry() { - final String acrName = generateRandomResourceName("acr", 10); - String imageName = "Replace with the name of your image."; - String taskName = generateRandomResourceName("ft", 10); - String dockerFilePath = "Replace with your docker file path relative to githubContext, eg: Dockerfile"; - String githubRepoUrl = "Replace with your github repository url, eg: https://github.com/Azure/acr.git"; - String githubBranch = "Replace with your github repositoty branch, eg: master"; - String githubPAT = - "Replace with your github personal access token which should have the scopes: admin:repo_hook and repo"; - - Registry registry = - registryManager - .containerRegistries() - .define(acrName) - .withRegion(locationOrDefault(Region.US_WEST_CENTRAL)) - .withNewResourceGroup(rgName) - .withPremiumSku() - .withRegistryNameAsAdminUser() - .withTag("tag1", "value1") - .create(); - - RegistryTask registryTask = - registryManager - .containerRegistryTasks() - .define(taskName) - .withExistingRegistry(rgName, acrName) - .withLocation(locationOrDefault(Region.US_WEST_CENTRAL).name()) - .withLinux(Architecture.AMD64) - .defineDockerTaskStep() - .withDockerFilePath(dockerFilePath) - .withImageNames(Arrays.asList(imageName)) - .withCacheEnabled(true) - .withPushEnabled(true) - .attach() - .defineSourceTrigger("SampleSourceTrigger") - .withGithubAsSourceControl() - .withSourceControlRepositoryUrl(githubRepoUrl) - .withCommitTriggerEvent() - .withPullTriggerEvent() - .withRepositoryBranch(githubBranch) - .withRepositoryAuthentication(TokenType.PAT, githubPAT) - .attach() - .withBaseImageTrigger("SampleBaseImageTrigger", BaseImageTriggerType.RUNTIME) - .withCpuCount(2) - .create(); - - RegistryTaskRun registryTaskRun = - registry.scheduleRun().withTaskRunRequest(taskName).withArchiveEnabled(true).execute(); - - boolean stillQueued = true; - while (stillQueued) { - registryTaskRun.refresh(); - if (registryTaskRun.status() != RunStatus.QUEUED) { - stillQueued = false; - } - if (registryTaskRun.status() == RunStatus.FAILED) { - System - .out - .println(registryManager.registryTaskRuns().getLogSasUrl(rgName, acrName, registryTaskRun.runId())); - stillQueued = false; - } - ResourceManagerUtils.sleep(Duration.ofSeconds(10)); - } - - Assertions.assertEquals(registry.resourceGroupName(), registryTaskRun.resourceGroupName()); - Assertions.assertEquals(acrName, registryTaskRun.registryName()); - Assertions.assertEquals(taskName, registryTaskRun.taskName()); - Assertions.assertTrue(registryTaskRun.isArchiveEnabled()); - Assertions.assertEquals(OS.LINUX, registryTaskRun.platform().os()); - - PagedIterable registryTaskRuns = - registryManager.registryTaskRuns().listByRegistry(rgName, acrName); - RegistryTaskRun registryTaskRunFromList = registryTaskRuns.stream().findFirst().get(); - Assertions.assertTrue(registryTaskRunFromList.status() != null); - Assertions.assertEquals("QuickRun", registryTaskRunFromList.runType().toString()); - Assertions.assertTrue(registryTaskRunFromList.isArchiveEnabled()); - Assertions.assertEquals(OS.LINUX, registryTaskRunFromList.platform().os()); - Assertions.assertEquals("Succeeded", registryTaskRunFromList.provisioningState().toString()); - Assertions.assertEquals(taskName, registryTaskRunFromList.taskName()); - } - - @Test - @Disabled("Needs personal tokens to run") - public void taskRunRequestFromRuns() { - final String acrName = generateRandomResourceName("acr", 10); - String imageName = "Replace with the name of your image."; - String taskName = generateRandomResourceName("ft", 10); - String githubRepoUrl = "Replace with your github repository url, eg: https://github.com/Azure/acr.git"; - String githubBranch = "Replace with your github repositoty branch, eg: master"; - String githubPAT = - "Replace with your github personal access token which should have the scopes: admin:repo_hook and repo"; - String dockerFilePath = "Replace with your docker file path relative to githubContext, eg: Dockerfile"; - - Registry registry = - registryManager - .containerRegistries() - .define(acrName) - .withRegion(locationOrDefault(Region.US_WEST_CENTRAL)) - .withNewResourceGroup(rgName) - .withPremiumSku() - .withRegistryNameAsAdminUser() - .withTag("tag1", "value1") - .create(); - - RegistryTask registryTask = - registryManager - .containerRegistryTasks() - .define(taskName) - .withExistingRegistry(rgName, acrName) - .withLocation(locationOrDefault(Region.US_WEST_CENTRAL).name()) - .withLinux(Architecture.AMD64) - .defineDockerTaskStep() - .withDockerFilePath(dockerFilePath) - .withImageNames(Arrays.asList(imageName)) - .withCacheEnabled(true) - .withPushEnabled(true) - .attach() - .defineSourceTrigger("SampleSourceTrigger") - .withGithubAsSourceControl() - .withSourceControlRepositoryUrl(githubRepoUrl) - .withCommitTriggerEvent() - .withPullTriggerEvent() - .withRepositoryBranch(githubBranch) - .withRepositoryAuthentication(TokenType.PAT, githubPAT) - .attach() - .withBaseImageTrigger("SampleBaseImageTrigger", BaseImageTriggerType.RUNTIME) - .withCpuCount(2) - .create(); - - RegistryTaskRun registryTaskRun = - registryManager - .registryTaskRuns() - .scheduleRun() - .withExistingRegistry(rgName, acrName) - .withTaskRunRequest(taskName) - .withArchiveEnabled(true) - .execute(); - - boolean stillQueued = true; - while (stillQueued) { - registryTaskRun.refresh(); - if (registryTaskRun.status() != RunStatus.QUEUED) { - stillQueued = false; - } - if (registryTaskRun.status() == RunStatus.FAILED) { - System - .out - .println(registryManager.registryTaskRuns().getLogSasUrl(rgName, acrName, registryTaskRun.runId())); - stillQueued = false; - } - ResourceManagerUtils.sleep(Duration.ofSeconds(10)); - } - Assertions.assertEquals(registry.resourceGroupName(), registryTaskRun.resourceGroupName()); - Assertions.assertEquals(acrName, registryTaskRun.registryName()); - Assertions.assertEquals(taskName, registryTaskRun.taskName()); - Assertions.assertTrue(registryTaskRun.isArchiveEnabled()); - Assertions.assertEquals(OS.LINUX, registryTaskRun.platform().os()); - - PagedIterable registryTaskRuns = - registryManager.registryTaskRuns().listByRegistry(rgName, acrName); - RegistryTaskRun registryTaskRunFromList = registryTaskRuns.stream().findFirst().get(); - Assertions.assertTrue(registryTaskRunFromList.status() != null); - Assertions.assertEquals("QuickRun", registryTaskRunFromList.runType().toString()); - Assertions.assertTrue(registryTaskRunFromList.isArchiveEnabled()); - Assertions.assertEquals(OS.LINUX, registryTaskRunFromList.platform().os()); - Assertions.assertEquals("Succeeded", registryTaskRunFromList.provisioningState().toString()); - Assertions.assertEquals(taskName, registryTaskRunFromList.taskName()); - } - - @Test - public void getBuildSourceUploadUrlFromRegistryAndRegistries() { - final String acrName = generateRandomResourceName("acr", 10); - - Registry registry = - registryManager - .containerRegistries() - .define(acrName) - .withRegion(locationOrDefault(Region.US_WEST_CENTRAL)) - .withNewResourceGroup(rgName) - .withPremiumSku() - .withRegistryNameAsAdminUser() - .withTag("tag1", "value1") - .create(); - - // Calling getBuildSourceUploadUrl from Registry - SourceUploadDefinition buildSourceUploadUrlRegistry = registry.getBuildSourceUploadUrl(); - Assertions.assertNotNull(buildSourceUploadUrlRegistry.relativePath()); - Assertions.assertNotNull(buildSourceUploadUrlRegistry.uploadUrl()); - - // Calling getBuildSourceUploadUrl from Registries - SourceUploadDefinition buildSourceUploadUrlRegistries = - registryManager.containerRegistries().getBuildSourceUploadUrl(rgName, acrName); - Assertions.assertNotNull(buildSourceUploadUrlRegistries.relativePath()); - Assertions.assertNotNull(buildSourceUploadUrlRegistries.uploadUrl()); - } - - @Test - @Disabled("Needs personal tokens to run.") - public void cancelAndDeleteRunsAndTasks() { - final String acrName = generateRandomResourceName("acr", 10); - String taskName = generateRandomResourceName("ft", 10); - String dockerFilePath = "Replace with your docker file path relative to githubContext, eg: Dockerfile"; - String imageName = "Replace with the name of your image."; - String githubRepoUrl = "Replace with your github repository url, eg: https://github.com/Azure/acr.git"; - String githubBranch = "Replace with your github repositoty branch, eg: master"; - String githubPAT = - "Replace with your github personal access token which should have the scopes: admin:repo_hook and repo"; - - Registry registry = - registryManager - .containerRegistries() - .define(acrName) - .withRegion(locationOrDefault(Region.US_WEST_CENTRAL)) - .withNewResourceGroup(rgName) - .withPremiumSku() - .withRegistryNameAsAdminUser() - .withTag("tag1", "value1") - .create(); - - RegistryTask registryTask = - registryManager - .containerRegistryTasks() - .define(taskName) - .withExistingRegistry(rgName, acrName) - .withLocation(locationOrDefault(Region.US_WEST_CENTRAL).name()) - .withLinux(Architecture.AMD64) - .defineDockerTaskStep() - .withDockerFilePath(dockerFilePath) - .withImageNames(Arrays.asList(imageName)) - .withCacheEnabled(true) - .withPushEnabled(true) - .attach() - .defineSourceTrigger("SampleSourceTrigger") - .withGithubAsSourceControl() - .withSourceControlRepositoryUrl(githubRepoUrl) - .withCommitTriggerEvent() - .withPullTriggerEvent() - .withRepositoryBranch(githubBranch) - .withRepositoryAuthentication(TokenType.PAT, githubPAT) - .attach() - .withBaseImageTrigger("SampleBaseImageTrigger", BaseImageTriggerType.RUNTIME) - .withCpuCount(2) - .create(); - - RegistryTaskRun registryTaskRun = - registry.scheduleRun().withTaskRunRequest(taskName).withArchiveEnabled(true).execute(); - - boolean stillQueued = true; - while (stillQueued) { - registryTaskRun.refresh(); - if (registryTaskRun.status() != RunStatus.QUEUED) { - stillQueued = false; - } - if (registryTaskRun.status() == RunStatus.FAILED) { - System - .out - .println(registryManager.registryTaskRuns().getLogSasUrl(rgName, acrName, registryTaskRun.runId())); - Assertions.fail("Registry registryTask run failed"); - } - ResourceManagerUtils.sleep(Duration.ofSeconds(10)); - } - - Assertions.assertTrue(registryManager.registryTaskRuns().listByRegistry(rgName, acrName).stream().count() == 1); - - // cancelling the run we just created - registryManager.serviceClient().getRuns().cancel(rgName, acrName, registryTaskRun.runId()); - - boolean notCanceled = true; - while (notCanceled) { - registryTaskRun.refresh(); - if (registryTaskRun.status() == RunStatus.CANCELED) { - notCanceled = false; - } - if (registryTaskRun.status() == RunStatus.FAILED) { - System - .out - .println(registryManager.registryTaskRuns().getLogSasUrl(rgName, acrName, registryTaskRun.runId())); - Assertions.fail("Registry registryTask run failed"); - } - ResourceManagerUtils.sleep(Duration.ofSeconds(10)); - } - - PagedIterable registryTaskRuns = - registryManager.registryTaskRuns().listByRegistry(rgName, acrName); - - for (RegistryTaskRun rtr : registryTaskRuns) { - Assertions.assertTrue(rtr.status() == RunStatus.CANCELED); - } - - // deleting the run we just cancelled - for (RegistryTaskRun rtr : registryTaskRuns) { - registryManager.containerRegistryTasks().deleteByRegistry(rgName, acrName, taskName); - } - - registryTaskRuns = registryManager.registryTaskRuns().listByRegistry(rgName, acrName); - // Test is set to 1 because there is a server side issue that results in task runs not actually being deleted. - // Test will fail once the server side issue is fixed. - Assertions - .assertTrue(registryManager.containerRegistryTasks().listByRegistry(rgName, acrName).stream().count() == 1); - } - - @Test - public void getLogSasUrl() { - final String acrName = generateRandomResourceName("acr", 10); - String dockerFilePath = "Dockerfile"; - String imageName = "test"; - String sourceLocation = "https://github.com/Azure/acr.git#master:samples/java/task"; - - Registry registry = - registryManager - .containerRegistries() - .define(acrName) - .withRegion(locationOrDefault(Region.US_WEST_CENTRAL)) - .withNewResourceGroup(rgName) - .withPremiumSku() - .withRegistryNameAsAdminUser() - .withTag("tag1", "value1") - .create(); - - RegistryTaskRun registryTaskRun = - registryManager - .registryTaskRuns() - .scheduleRun() - .withExistingRegistry(rgName, acrName) - .withLinux() - .withDockerTaskRunRequest() - .defineDockerTaskStep() - .withDockerFilePath(dockerFilePath) - .withImageNames(Arrays.asList(imageName)) - .withCacheEnabled(true) - .withPushEnabled(true) - .attach() - .withSourceLocation(sourceLocation) - .withArchiveEnabled(true) - .execute(); - - String sasUrl = registryManager.registryTaskRuns().getLogSasUrl(rgName, acrName, registryTaskRun.runId()); - Assertions.assertNotNull(sasUrl); - Assertions.assertNotEquals("", sasUrl); - } - - @Test - @Disabled("Needs personal tokens to run.") - public void updateTriggers() { - final String acrName = generateRandomResourceName("acr", 10); - String githubRepoUrl = "Replace with your github repository url, eg: https://github.com/Azure/acr.git"; - String githubBranch = "Replace with your github repositoty branch, eg: master"; - String githubPAT = - "Replace with your github personal access token which should have the scopes: admin:repo_hook and repo"; - String taskFilePath = "Path to your task file that is relative to the githubRepoUrl"; - String githubRepoUrlUpdate = - "Replace with your github repository url to update to, eg: https://github.com/Azure/acr.git"; - - Registry registry = - registryManager - .containerRegistries() - .define(acrName) - .withRegion(locationOrDefault(Region.US_WEST_CENTRAL)) - .withNewResourceGroup(rgName) - .withPremiumSku() - .withRegistryNameAsAdminUser() - .withTag("tag1", "value1") - .create(); - - String taskName = generateRandomResourceName("ft", 10); - RegistryTask registryTask = - registryManager - .containerRegistryTasks() - .define(taskName) - .withExistingRegistry(rgName, acrName) - .withLocation(locationOrDefault(Region.US_WEST_CENTRAL).name()) - .withLinux(Architecture.AMD64) - .defineFileTaskStep() - .withTaskPath(taskFilePath) - .attach() - .defineSourceTrigger("SampleSourceTrigger") - .withGithubAsSourceControl() - .withSourceControlRepositoryUrl(githubRepoUrl) - .withCommitTriggerEvent() - .withPullTriggerEvent() - .withRepositoryBranch(githubBranch) - .withRepositoryAuthentication(TokenType.PAT, githubPAT) - .withTriggerStatusEnabled() - .attach() - .withBaseImageTrigger("SampleBaseImageTrigger", BaseImageTriggerType.RUNTIME) - .withCpuCount(2) - .create(); - - // Assert there is the correct number of source triggers - Assertions.assertTrue(registryTask.trigger().sourceTriggers().size() == 1); - - // Assert source control is correct - Assertions - .assertEquals( - SourceControlType.GITHUB.toString(), - registryTask.trigger().sourceTriggers().get(0).sourceRepository().sourceControlType().toString()); - - // Assert source control repository url is correct - Assertions - .assertEquals( - githubRepoUrl, registryTask.trigger().sourceTriggers().get(0).sourceRepository().repositoryUrl()); - - // Ignore because of server-side error regarding pull request - // Assert source control source trigger event list is of correct size - - // Assertions.assertTrue(registryTask.trigger().sourceTriggers().get(0).sourceTriggerEvents().size() == - // 2); - // - // Temporarily set size to 1 so when pull request functionality is added back, there is a test alert - Assertions.assertTrue(registryTask.trigger().sourceTriggers().get(0).sourceTriggerEvents().size() == 1); - - // Assert source trigger event list contains commit - Assertions - .assertTrue( - registryTask - .trigger() - .sourceTriggers() - .get(0) - .sourceTriggerEvents() - .contains(SourceTriggerEvent.COMMIT)); - // - // //Assert source trigger event list contains pull request - // - // Assertions.assertTrue(registryTask.trigger().sourceTriggers().get(0).sourceTriggerEvents().contains(SourceTriggerEvent.PULLREQUEST)); - - // Assert source control repository branch is correct - Assertions - .assertEquals(githubBranch, registryTask.trigger().sourceTriggers().get(0).sourceRepository().branch()); - - // Assert trigger status is correct - Assertions - .assertEquals( - TriggerStatus.ENABLED.toString(), registryTask.trigger().sourceTriggers().get(0).status().toString()); - - // Assert name of the base image trigger is correct - Assertions.assertEquals("SampleBaseImageTrigger", registryTask.trigger().baseImageTrigger().name()); - - // Assert that the base image trigger type is correct - Assertions - .assertEquals( - BaseImageTriggerType.RUNTIME.toString(), - registryTask.trigger().baseImageTrigger().baseImageTriggerType().toString()); - - registryTask - .update() - .updateSourceTrigger("SampleSourceTrigger") - .withGithubAsSourceControl() - .withSourceControlRepositoryUrl(githubRepoUrlUpdate) - .withCommitTriggerEvent() - .withRepositoryAuthentication(TokenType.PAT, githubPAT) - .withTriggerStatusDisabled() - .parent() - .updateBaseImageTrigger("SampleBaseImageTriggerUpdate", BaseImageTriggerType.ALL) - .apply(); - - // Assert source triggers are correct - Assertions.assertEquals("SampleSourceTrigger", registryTask.trigger().sourceTriggers().get(0).name()); - - // Assert source control is correct - Assertions - .assertEquals( - SourceControlType.GITHUB.toString(), - registryTask.trigger().sourceTriggers().get(0).sourceRepository().sourceControlType().toString()); - - // Assert source control repository url is correct - Assertions - .assertEquals( - githubRepoUrlUpdate, registryTask.trigger().sourceTriggers().get(0).sourceRepository().repositoryUrl()); - - // Assert source trigger has correct number of trigger events - Assertions.assertTrue(registryTask.trigger().sourceTriggers().size() == 1); - - // Assert source trigger event list contains commit - Assertions - .assertTrue( - registryTask - .trigger() - .sourceTriggers() - .get(0) - .sourceTriggerEvents() - .contains(SourceTriggerEvent.COMMIT)); - - // Assert trigger status is correct - Assertions - .assertEquals( - TriggerStatus.DISABLED.toString(), registryTask.trigger().sourceTriggers().get(0).status().toString()); - - // Assert name of the base image trigger is correct - Assertions.assertEquals("SampleBaseImageTriggerUpdate", registryTask.trigger().baseImageTrigger().name()); - - // Assert that the base image trigger type is correct - Assertions - .assertEquals( - BaseImageTriggerType.ALL.toString(), - registryTask.trigger().baseImageTrigger().baseImageTriggerType().toString()); - } - - @Override - protected void cleanUpResources() { - resourceManager.resourceGroups().beginDeleteByName(rgName); - } - - private byte[] readTaskYaml() throws Exception { - File taskFile = new File(getClass().getClassLoader().getResource("task.yaml").getFile()); - FileInputStream taskFileInput = new FileInputStream(taskFile); - byte[] data = new byte[(int) taskFile.length()]; - taskFileInput.read(data); - return data; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/test/java/com/azure/resourcemanager/containerregistry/RegistryTest.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/test/java/com/azure/resourcemanager/containerregistry/RegistryTest.java deleted file mode 100644 index e07c6b4c7a81..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/test/java/com/azure/resourcemanager/containerregistry/RegistryTest.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.containerregistry; - -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.policy.HttpLogOptions; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.resources.ResourceManager; -import com.azure.resourcemanager.resources.fluentcore.utils.HttpPipelineProvider; -import com.azure.resourcemanager.test.ResourceManagerTestBase; - -import java.time.temporal.ChronoUnit; -import java.util.List; - -/** The base for storage manager tests. */ -public abstract class RegistryTest extends ResourceManagerTestBase { - protected ResourceManager resourceManager; - protected ContainerRegistryManager registryManager; - protected String rgName; - - @Override - protected HttpPipeline buildHttpPipeline( - TokenCredential credential, - AzureProfile profile, - HttpLogOptions httpLogOptions, - List policies, - HttpClient httpClient) { - return HttpPipelineProvider.buildHttpPipeline( - credential, - profile, - null, - httpLogOptions, - null, - new RetryPolicy("Retry-After", ChronoUnit.SECONDS), - policies, - httpClient); - } - - @Override - protected void initializeClients(HttpPipeline httpPipeline, AzureProfile profile) { - registryManager = buildManager(ContainerRegistryManager.class, httpPipeline, profile); - resourceManager = registryManager.resourceManager(); - rgName = generateRandomResourceName("rgacr", 10); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/test/resources/junit-platform.properties b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/test/resources/junit-platform.properties deleted file mode 100644 index 202d099b3ee8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/test/resources/junit-platform.properties +++ /dev/null @@ -1,4 +0,0 @@ -junit.jupiter.execution.parallel.enabled=true -junit.jupiter.execution.parallel.mode.default=concurrent -junit.jupiter.execution.parallel.config.strategy=fixed -junit.jupiter.execution.parallel.config.fixed.parallelism=32 diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/test/resources/task.yaml b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/test/resources/task.yaml deleted file mode 100644 index 6541c36db9ae..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/test/resources/task.yaml +++ /dev/null @@ -1,6 +0,0 @@ -version: v1.0.0 -steps: - - build: -t {{.Run.Registry}}/java-sample:{{.Run.ID}} . - workingDirectory: samples/java/task - - push: - - {{.Run.Registry}}/java-sample:{{.Run.ID}} \ No newline at end of file diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/CHANGELOG.md b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/CHANGELOG.md deleted file mode 100644 index f49353cee6a0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/CHANGELOG.md +++ /dev/null @@ -1,8 +0,0 @@ -# Release History - -## 1.0.0-hybrid (2022-01-12) - -- Azure Resource Manager Containerservice client library for Java (Hybrid) using API Profiles to allow building hybrid cloud solutions -that target both Azure and Azure Stack Hub. -- Supports api versions in the 2020-09-01-hybrid api profile -- Requires Azure Stack Update 2102+ diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/README.md b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/README.md deleted file mode 100644 index b4bac09fb5a7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/README.md +++ /dev/null @@ -1,135 +0,0 @@ -# Azure Resource Manager Containerservice client library for Java (Hybrid) - -Azure Resource Manager Containerservice client library for Java (Hybrid) using [API Profiles][api_profile] to allow building hybrid cloud solutions -that target both Azure and Azure Stack Hub. - -For documentation on how to use this package, please see [Azure Management Libraries for Java (Hybrid)][resourcemanagerhybrid_lib]. - -## Getting started - -### Prerequisites - -- [Java Development Kit (JDK)][jdk] with version 8 or above -- [Azure Subscription][azure_subscription] - -### Adding the package to your product - -```xml - - com.azure.resourcemanager - azure-resourcemanager-containerservice - 1.0.0-hybrid - -``` - -### Include the recommended packages - -Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. - -[Azure Identity][azure_identity] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation. - -### Authentication - -By default, Azure Active Directory token authentication depends on correct configure of following environment variables. - -- `AZURE_CLIENT_ID` for Azure client ID. -- `AZURE_TENANT_ID` for Azure tenant ID. -- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. - -In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`. - -With above configuration, `azure` client can be authenticated by following code: - -```java com.azure.resourcemanager.containerservice.authenticate -String armEndpoint = "https://management.."; -AzureProfile profile = new AzureProfile(getAzureEnvironmentFromArmEndpoint(armEndpoint)); -TokenCredential credential = new DefaultAzureCredentialBuilder() - .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) - .build(); -ContainerServiceManager manager = ContainerServiceManager - .authenticate(credential, profile); -``` - -Change `armEndpoint` to point to the Azure Resource Manager endpoint of your Azure Stack Hub. The azure environment's -properties above can be populated with the following example: - -```java com.azure.resourcemanager.containerservice.getazureenvironment -private static AzureEnvironment getAzureEnvironmentFromArmEndpoint(String armEndpoint) { - // Create HTTP client and request - HttpClient httpClient = HttpClient.createDefault(); - - HttpRequest request = new HttpRequest(HttpMethod.GET, - String.format("%s/metadata/endpoints?api-version=2019-10-01", armEndpoint)) - .setHeader("accept", "application/json"); - - // Execute the request and read the response - HttpResponse response = httpClient.send(request).block(); - if (response.getStatusCode() != 200) { - throw new RuntimeException("Failed : HTTP error code : " + response.getStatusCode()); - } - String body = response.getBodyAsString().block(); - try { - ArrayNode metadataArray = JacksonAdapter.createDefaultSerializerAdapter() - .deserialize(body, ArrayNode.class, SerializerEncoding.JSON); - - if (metadataArray == null || metadataArray.isEmpty()) { - throw new RuntimeException("Failed to find metadata : " + body); - } - - JsonNode metadata = metadataArray.iterator().next(); - AzureEnvironment azureEnvironment = new AzureEnvironment(new HashMap() { - { - put("managementEndpointUrl", metadata.at("/authentication/audiences/0").asText()); - put("resourceManagerEndpointUrl", armEndpoint); - put("galleryEndpointUrl", metadata.at("/gallery").asText()); - put("activeDirectoryEndpointUrl", metadata.at("/authentication/loginEndpoint").asText()); - put("activeDirectoryResourceId", metadata.at("/authentication/audiences/0").asText()); - put("activeDirectoryGraphResourceId", metadata.at("/graph").asText()); - put("storageEndpointSuffix", "." + metadata.at("/suffixes/storage").asText()); - put("keyVaultDnsSuffix", "." + metadata.at("/suffixes/keyVaultDns").asText()); - } - }); - return azureEnvironment; - } catch (IOException ioe) { - ioe.printStackTrace(); - throw new RuntimeException(ioe); - } -} -``` - -When targeting a hybrid solution to global Azure instead of your Azure Stack Hub, `AzureEnvironment.AZURE` can be used instead. - -See [Authentication][authenticate] for more options. - -## Key concepts - -See [API design][design] for general introduction on design and key concepts on Azure Management Libraries. - -## Examples - -See [Samples][sample] for code snippets and samples. - -## Troubleshooting - -## Next steps - -## Contributing - -For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). - -1. Fork it -1. Create your feature branch (`git checkout -b my-new-feature`) -1. Commit your changes (`git commit -am 'Add some feature'`) -1. Push to the branch (`git push origin my-new-feature`) -1. Create new Pull Request - - -[jdk]: https://learn.microsoft.com/java/azure/jdk/ -[azure_subscription]: https://azure.microsoft.com/free/ -[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity -[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty -[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md -[sample]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/SAMPLE.md -[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md -[api_profile]: https://learn.microsoft.com/azure-stack/user/azure-stack-version-profiles -[resourcemanagerhybrid_lib]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanagerhybrid diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/pom.xml b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/pom.xml deleted file mode 100644 index 07f84bdf6658..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/pom.xml +++ /dev/null @@ -1,133 +0,0 @@ - - - 4.0.0 - - com.azure - azure-client-sdk-parent - 1.7.0 - ../../parents/azure-client-sdk-parent - - - com.azure.resourcemanager - azure-resourcemanager-containerservice - 1.0.0-hybrid - jar - - Microsoft Azure SDK for Container Service Management (Hybrid) - This package contains Microsoft Azure Container Service Hybrid SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt - https://github.com/Azure/azure-sdk-for-java - - - - The MIT License (MIT) - http://opensource.org/licenses/MIT - repo - - - - - https://github.com/Azure/azure-sdk-for-java - scm:git:git@github.com:Azure/azure-sdk-for-java.git - HEAD - - - - - 0.10 - 0.10 - - - --add-opens com.azure.resourcemanager.containerservice/com.azure.resourcemanager.containerservice=ALL-UNNAMED - --add-opens com.azure.resourcemanager.containerservice/com.azure.resourcemanager.containerservice.implementation=ALL-UNNAMED - --add-opens com.azure.core/com.azure.core.implementation.jackson=ALL-UNNAMED - - - - - - microsoft - Microsoft - - - - - - com.azure.resourcemanager - azure-resourcemanager-resources - 1.0.0-hybrid - - - org.junit.jupiter - junit-jupiter-engine - 5.13.4 - test - - - org.junit.jupiter - junit-jupiter-api - 5.13.4 - test - - - org.slf4j - slf4j-simple - 1.7.36 - test - - - com.azure - azure-core-http-netty - 1.16.2 - test - - - - - azure-mgmt-sdk-test-jar - - - !maven.test.skip - - - - - com.azure.resourcemanager - azure-resourcemanager-test - 1.0.0-hybrid - test - - - - - - - - org.apache.maven.plugins - maven-jar-plugin - 3.4.2 - - - - true - true - - - - - - - org.jacoco - jacoco-maven-plugin - 0.8.13 - - - com/azure/resourcemanager/**/fluent/**/* - com/azure/resourcemanager/**/models/**/* - com/azure/resourcemanager/**/implementation/*ClientImpl* - com/azure/resourcemanager/**/implementation/*ClientBuilder* - - - - - - diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/ContainerServiceManager.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/ContainerServiceManager.java deleted file mode 100644 index 8deb7a81b307..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/ContainerServiceManager.java +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.containerservice; - -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpPipeline; -import com.azure.resourcemanager.containerservice.fluent.ContainerServiceManagementClient; -import com.azure.resourcemanager.containerservice.implementation.ContainerServiceManagementClientBuilder; -import com.azure.resourcemanager.containerservice.implementation.KubernetesClustersImpl; -import com.azure.resourcemanager.containerservice.models.KubernetesClusters; -import com.azure.resourcemanager.resources.fluentcore.arm.AzureConfigurable; -import com.azure.resourcemanager.resources.fluentcore.arm.implementation.AzureConfigurableImpl; -import com.azure.resourcemanager.resources.fluentcore.arm.Manager; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.resources.fluentcore.utils.HttpPipelineProvider; - -import java.util.Objects; - -/** Entry point to Azure Container Service management. */ -public final class ContainerServiceManager - extends Manager { - // The service managers - private KubernetesClustersImpl kubernetesClusters; - - /** - * Get a Configurable instance that can be used to create ContainerServiceManager with optional configuration. - * - * @return Configurable - */ - public static Configurable configure() { - return new ContainerServiceManager.ConfigurableImpl(); - } - - /** - * Creates an instance of ContainerServiceManager that exposes Azure Container Service resource management API entry - * points. - * - * @param credential the credential to use - * @param profile the profile to use - * @return the ContainerServiceManager - */ - public static ContainerServiceManager authenticate(TokenCredential credential, AzureProfile profile) { - Objects.requireNonNull(credential, "'credential' cannot be null."); - Objects.requireNonNull(profile, "'profile' cannot be null."); - return authenticate(HttpPipelineProvider.buildHttpPipeline(credential, profile), profile); - } - - /** - * Creates an instance of ContainerServiceManager that exposes Service resource management API entry points. - * - * @param httpPipeline the HttpPipeline to be used for API calls. - * @param profile the profile to use - * @return the ContainerServiceManager - */ - public static ContainerServiceManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { - Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); - Objects.requireNonNull(profile, "'profile' cannot be null."); - return new ContainerServiceManager(httpPipeline, profile); - } - - /** The interface allowing configurations to be set. */ - public interface Configurable extends AzureConfigurable { - /** - * Creates an instance of ContainerServiceManager that exposes Service resource management API entry points. - * - * @param credential the credential to use - * @param profile the profile to use - * @return the ContainerServiceManager - */ - ContainerServiceManager authenticate(TokenCredential credential, AzureProfile profile); - } - - /** The implementation for Configurable interface. */ - private static final class ConfigurableImpl extends AzureConfigurableImpl implements Configurable { - @Override - public ContainerServiceManager authenticate(TokenCredential credential, AzureProfile profile) { - return ContainerServiceManager.authenticate(buildHttpPipeline(credential, profile), profile); - } - } - - private ContainerServiceManager(HttpPipeline httpPipeline, AzureProfile profile) { - super( - httpPipeline, - profile, - new ContainerServiceManagementClientBuilder() - .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) - .pipeline(httpPipeline) - .subscriptionId(profile.getSubscriptionId()) - .buildClient()); - } - - /** @return the Azure Kubernetes cluster resource management API entry point */ - public KubernetesClusters kubernetesClusters() { - if (this.kubernetesClusters == null) { - this.kubernetesClusters = new KubernetesClustersImpl(this); - } - return this.kubernetesClusters; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/AgentPoolsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/AgentPoolsClient.java deleted file mode 100644 index fa1a964903e5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/AgentPoolsClient.java +++ /dev/null @@ -1,576 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.containerservice.fluent.models.AgentPoolAvailableVersionsInner; -import com.azure.resourcemanager.containerservice.fluent.models.AgentPoolInner; -import com.azure.resourcemanager.containerservice.fluent.models.AgentPoolUpgradeProfileInner; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in AgentPoolsClient. */ -public interface AgentPoolsClient { - /** - * Gets a list of agent pools in the specified managed cluster. The operation returns properties of each agent pool. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of agent pools in the specified managed cluster. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String resourceGroupName, String resourceName); - - /** - * Gets a list of agent pools in the specified managed cluster. The operation returns properties of each agent pool. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of agent pools in the specified managed cluster. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String resourceName); - - /** - * Gets a list of agent pools in the specified managed cluster. The operation returns properties of each agent pool. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of agent pools in the specified managed cluster. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String resourceName, Context context); - - /** - * Gets the details of the agent pool by managed cluster and resource group. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param agentPoolName The name of the agent pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of the agent pool by managed cluster and resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync( - String resourceGroupName, String resourceName, String agentPoolName); - - /** - * Gets the details of the agent pool by managed cluster and resource group. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param agentPoolName The name of the agent pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of the agent pool by managed cluster and resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync(String resourceGroupName, String resourceName, String agentPoolName); - - /** - * Gets the details of the agent pool by managed cluster and resource group. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param agentPoolName The name of the agent pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of the agent pool by managed cluster and resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AgentPoolInner get(String resourceGroupName, String resourceName, String agentPoolName); - - /** - * Gets the details of the agent pool by managed cluster and resource group. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param agentPoolName The name of the agent pool. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of the agent pool by managed cluster and resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String resourceName, String agentPoolName, Context context); - - /** - * Creates or updates an agent pool in the specified managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param agentPoolName The name of the agent pool. - * @param parameters Parameters supplied to the Create or Update an agent pool operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return agent Pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String resourceName, String agentPoolName, AgentPoolInner parameters); - - /** - * Creates or updates an agent pool in the specified managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param agentPoolName The name of the agent pool. - * @param parameters Parameters supplied to the Create or Update an agent pool operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return agent Pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, AgentPoolInner> beginCreateOrUpdateAsync( - String resourceGroupName, String resourceName, String agentPoolName, AgentPoolInner parameters); - - /** - * Creates or updates an agent pool in the specified managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param agentPoolName The name of the agent pool. - * @param parameters Parameters supplied to the Create or Update an agent pool operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return agent Pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, AgentPoolInner> beginCreateOrUpdate( - String resourceGroupName, String resourceName, String agentPoolName, AgentPoolInner parameters); - - /** - * Creates or updates an agent pool in the specified managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param agentPoolName The name of the agent pool. - * @param parameters Parameters supplied to the Create or Update an agent pool operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return agent Pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, AgentPoolInner> beginCreateOrUpdate( - String resourceGroupName, - String resourceName, - String agentPoolName, - AgentPoolInner parameters, - Context context); - - /** - * Creates or updates an agent pool in the specified managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param agentPoolName The name of the agent pool. - * @param parameters Parameters supplied to the Create or Update an agent pool operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return agent Pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, String resourceName, String agentPoolName, AgentPoolInner parameters); - - /** - * Creates or updates an agent pool in the specified managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param agentPoolName The name of the agent pool. - * @param parameters Parameters supplied to the Create or Update an agent pool operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return agent Pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AgentPoolInner createOrUpdate( - String resourceGroupName, String resourceName, String agentPoolName, AgentPoolInner parameters); - - /** - * Creates or updates an agent pool in the specified managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param agentPoolName The name of the agent pool. - * @param parameters Parameters supplied to the Create or Update an agent pool operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return agent Pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AgentPoolInner createOrUpdate( - String resourceGroupName, - String resourceName, - String agentPoolName, - AgentPoolInner parameters, - Context context); - - /** - * Deletes the agent pool in the specified managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param agentPoolName The name of the agent pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync( - String resourceGroupName, String resourceName, String agentPoolName); - - /** - * Deletes the agent pool in the specified managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param agentPoolName The name of the agent pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String resourceName, String agentPoolName); - - /** - * Deletes the agent pool in the specified managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param agentPoolName The name of the agent pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName, String agentPoolName); - - /** - * Deletes the agent pool in the specified managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param agentPoolName The name of the agent pool. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String resourceName, String agentPoolName, Context context); - - /** - * Deletes the agent pool in the specified managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param agentPoolName The name of the agent pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String resourceName, String agentPoolName); - - /** - * Deletes the agent pool in the specified managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param agentPoolName The name of the agent pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String resourceName, String agentPoolName); - - /** - * Deletes the agent pool in the specified managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param agentPoolName The name of the agent pool. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String resourceName, String agentPoolName, Context context); - - /** - * Gets the details of the upgrade profile for an agent pool with a specified resource group and managed cluster - * name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param agentPoolName The name of the agent pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of the upgrade profile for an agent pool with a specified resource group and managed cluster - * name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getUpgradeProfileWithResponseAsync( - String resourceGroupName, String resourceName, String agentPoolName); - - /** - * Gets the details of the upgrade profile for an agent pool with a specified resource group and managed cluster - * name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param agentPoolName The name of the agent pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of the upgrade profile for an agent pool with a specified resource group and managed cluster - * name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getUpgradeProfileAsync( - String resourceGroupName, String resourceName, String agentPoolName); - - /** - * Gets the details of the upgrade profile for an agent pool with a specified resource group and managed cluster - * name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param agentPoolName The name of the agent pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of the upgrade profile for an agent pool with a specified resource group and managed cluster - * name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AgentPoolUpgradeProfileInner getUpgradeProfile(String resourceGroupName, String resourceName, String agentPoolName); - - /** - * Gets the details of the upgrade profile for an agent pool with a specified resource group and managed cluster - * name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param agentPoolName The name of the agent pool. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of the upgrade profile for an agent pool with a specified resource group and managed cluster - * name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getUpgradeProfileWithResponse( - String resourceGroupName, String resourceName, String agentPoolName, Context context); - - /** - * Gets a list of supported versions for the specified agent pool. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of supported versions for the specified agent pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getAvailableAgentPoolVersionsWithResponseAsync( - String resourceGroupName, String resourceName); - - /** - * Gets a list of supported versions for the specified agent pool. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of supported versions for the specified agent pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAvailableAgentPoolVersionsAsync( - String resourceGroupName, String resourceName); - - /** - * Gets a list of supported versions for the specified agent pool. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of supported versions for the specified agent pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AgentPoolAvailableVersionsInner getAvailableAgentPoolVersions(String resourceGroupName, String resourceName); - - /** - * Gets a list of supported versions for the specified agent pool. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of supported versions for the specified agent pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getAvailableAgentPoolVersionsWithResponse( - String resourceGroupName, String resourceName, Context context); - - /** - * Upgrade node image version of an agent pool to the latest. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param agentPoolName The name of the agent pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> upgradeNodeImageVersionWithResponseAsync( - String resourceGroupName, String resourceName, String agentPoolName); - - /** - * Upgrade node image version of an agent pool to the latest. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param agentPoolName The name of the agent pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, AgentPoolInner> beginUpgradeNodeImageVersionAsync( - String resourceGroupName, String resourceName, String agentPoolName); - - /** - * Upgrade node image version of an agent pool to the latest. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param agentPoolName The name of the agent pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, AgentPoolInner> beginUpgradeNodeImageVersion( - String resourceGroupName, String resourceName, String agentPoolName); - - /** - * Upgrade node image version of an agent pool to the latest. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param agentPoolName The name of the agent pool. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, AgentPoolInner> beginUpgradeNodeImageVersion( - String resourceGroupName, String resourceName, String agentPoolName, Context context); - - /** - * Upgrade node image version of an agent pool to the latest. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param agentPoolName The name of the agent pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono upgradeNodeImageVersionAsync( - String resourceGroupName, String resourceName, String agentPoolName); - - /** - * Upgrade node image version of an agent pool to the latest. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param agentPoolName The name of the agent pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AgentPoolInner upgradeNodeImageVersion(String resourceGroupName, String resourceName, String agentPoolName); - - /** - * Upgrade node image version of an agent pool to the latest. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param agentPoolName The name of the agent pool. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AgentPoolInner upgradeNodeImageVersion( - String resourceGroupName, String resourceName, String agentPoolName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/ContainerServiceManagementClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/ContainerServiceManagementClient.java deleted file mode 100644 index 6100bdf92e0a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/ContainerServiceManagementClient.java +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.fluent; - -import com.azure.core.http.HttpPipeline; -import java.time.Duration; - -/** The interface for ContainerServiceManagementClient class. */ -public interface ContainerServiceManagementClient { - /** - * Gets Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms - * part of the URI for every service call. - * - * @return the subscriptionId value. - */ - String getSubscriptionId(); - - /** - * Gets server parameter. - * - * @return the endpoint value. - */ - String getEndpoint(); - - /** - * Gets The HTTP pipeline to send requests through. - * - * @return the httpPipeline value. - */ - HttpPipeline getHttpPipeline(); - - /** - * Gets The default poll interval for long-running operation. - * - * @return the defaultPollInterval value. - */ - Duration getDefaultPollInterval(); - - /** - * Gets the OpenShiftManagedClustersClient object to access its operations. - * - * @return the OpenShiftManagedClustersClient object. - */ - OpenShiftManagedClustersClient getOpenShiftManagedClusters(); - - /** - * Gets the OperationsClient object to access its operations. - * - * @return the OperationsClient object. - */ - OperationsClient getOperations(); - - /** - * Gets the ManagedClustersClient object to access its operations. - * - * @return the ManagedClustersClient object. - */ - ManagedClustersClient getManagedClusters(); - - /** - * Gets the AgentPoolsClient object to access its operations. - * - * @return the AgentPoolsClient object. - */ - AgentPoolsClient getAgentPools(); - - /** - * Gets the PrivateEndpointConnectionsClient object to access its operations. - * - * @return the PrivateEndpointConnectionsClient object. - */ - PrivateEndpointConnectionsClient getPrivateEndpointConnections(); - - /** - * Gets the PrivateLinkResourcesClient object to access its operations. - * - * @return the PrivateLinkResourcesClient object. - */ - PrivateLinkResourcesClient getPrivateLinkResources(); - - /** - * Gets the ResolvePrivateLinkServiceIdsClient object to access its operations. - * - * @return the ResolvePrivateLinkServiceIdsClient object. - */ - ResolvePrivateLinkServiceIdsClient getResolvePrivateLinkServiceIds(); - - /** - * Gets the ContainerServicesClient object to access its operations. - * - * @return the ContainerServicesClient object. - */ - ContainerServicesClient getContainerServices(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/ContainerServicesClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/ContainerServicesClient.java deleted file mode 100644 index 1101f0a45869..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/ContainerServicesClient.java +++ /dev/null @@ -1,461 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.containerservice.fluent.models.ContainerServiceInner; -import com.azure.resourcemanager.containerservice.fluent.models.OrchestratorVersionProfileListResultInner; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ContainerServicesClient. */ -public interface ContainerServicesClient - extends InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete { - /** - * Gets a list of supported orchestrators in the specified subscription. The operation returns properties of each - * orchestrator including version, available upgrades and whether that version or upgrades are in preview. - * - * @param location The name of a supported Azure region. - * @param resourceType resource type for which the list of orchestrators needs to be returned. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of supported orchestrators in the specified subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listOrchestratorsWithResponseAsync( - String location, String resourceType); - - /** - * Gets a list of supported orchestrators in the specified subscription. The operation returns properties of each - * orchestrator including version, available upgrades and whether that version or upgrades are in preview. - * - * @param location The name of a supported Azure region. - * @param resourceType resource type for which the list of orchestrators needs to be returned. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of supported orchestrators in the specified subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listOrchestratorsAsync(String location, String resourceType); - - /** - * Gets a list of supported orchestrators in the specified subscription. The operation returns properties of each - * orchestrator including version, available upgrades and whether that version or upgrades are in preview. - * - * @param location The name of a supported Azure region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of supported orchestrators in the specified subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listOrchestratorsAsync(String location); - - /** - * Gets a list of supported orchestrators in the specified subscription. The operation returns properties of each - * orchestrator including version, available upgrades and whether that version or upgrades are in preview. - * - * @param location The name of a supported Azure region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of supported orchestrators in the specified subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - OrchestratorVersionProfileListResultInner listOrchestrators(String location); - - /** - * Gets a list of supported orchestrators in the specified subscription. The operation returns properties of each - * orchestrator including version, available upgrades and whether that version or upgrades are in preview. - * - * @param location The name of a supported Azure region. - * @param resourceType resource type for which the list of orchestrators needs to be returned. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of supported orchestrators in the specified subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listOrchestratorsWithResponse( - String location, String resourceType, Context context); - - /** - * Gets a list of container services in the specified subscription. The operation returns properties of each - * container service including state, orchestrator, number of masters and agents, and FQDNs of masters and agents. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of container services in the specified subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Gets a list of container services in the specified subscription. The operation returns properties of each - * container service including state, orchestrator, number of masters and agents, and FQDNs of masters and agents. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of container services in the specified subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Gets a list of container services in the specified subscription. The operation returns properties of each - * container service including state, orchestrator, number of masters and agents, and FQDNs of masters and agents. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of container services in the specified subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Creates or updates a container service with the specified configuration of orchestrator, masters, and agents. - * - * @param resourceGroupName The name of the resource group. - * @param containerServiceName The name of the container service in the specified subscription and resource group. - * @param parameters Parameters supplied to the Create or Update a Container Service operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return container service. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String containerServiceName, ContainerServiceInner parameters); - - /** - * Creates or updates a container service with the specified configuration of orchestrator, masters, and agents. - * - * @param resourceGroupName The name of the resource group. - * @param containerServiceName The name of the container service in the specified subscription and resource group. - * @param parameters Parameters supplied to the Create or Update a Container Service operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return container service. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, ContainerServiceInner> beginCreateOrUpdateAsync( - String resourceGroupName, String containerServiceName, ContainerServiceInner parameters); - - /** - * Creates or updates a container service with the specified configuration of orchestrator, masters, and agents. - * - * @param resourceGroupName The name of the resource group. - * @param containerServiceName The name of the container service in the specified subscription and resource group. - * @param parameters Parameters supplied to the Create or Update a Container Service operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return container service. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ContainerServiceInner> beginCreateOrUpdate( - String resourceGroupName, String containerServiceName, ContainerServiceInner parameters); - - /** - * Creates or updates a container service with the specified configuration of orchestrator, masters, and agents. - * - * @param resourceGroupName The name of the resource group. - * @param containerServiceName The name of the container service in the specified subscription and resource group. - * @param parameters Parameters supplied to the Create or Update a Container Service operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return container service. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ContainerServiceInner> beginCreateOrUpdate( - String resourceGroupName, String containerServiceName, ContainerServiceInner parameters, Context context); - - /** - * Creates or updates a container service with the specified configuration of orchestrator, masters, and agents. - * - * @param resourceGroupName The name of the resource group. - * @param containerServiceName The name of the container service in the specified subscription and resource group. - * @param parameters Parameters supplied to the Create or Update a Container Service operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return container service. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, String containerServiceName, ContainerServiceInner parameters); - - /** - * Creates or updates a container service with the specified configuration of orchestrator, masters, and agents. - * - * @param resourceGroupName The name of the resource group. - * @param containerServiceName The name of the container service in the specified subscription and resource group. - * @param parameters Parameters supplied to the Create or Update a Container Service operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return container service. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ContainerServiceInner createOrUpdate( - String resourceGroupName, String containerServiceName, ContainerServiceInner parameters); - - /** - * Creates or updates a container service with the specified configuration of orchestrator, masters, and agents. - * - * @param resourceGroupName The name of the resource group. - * @param containerServiceName The name of the container service in the specified subscription and resource group. - * @param parameters Parameters supplied to the Create or Update a Container Service operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return container service. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ContainerServiceInner createOrUpdate( - String resourceGroupName, String containerServiceName, ContainerServiceInner parameters, Context context); - - /** - * Gets the properties of the specified container service in the specified subscription and resource group. The - * operation returns the properties including state, orchestrator, number of masters and agents, and FQDNs of - * masters and agents. - * - * @param resourceGroupName The name of the resource group. - * @param containerServiceName The name of the container service in the specified subscription and resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the specified container service in the specified subscription and resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String containerServiceName); - - /** - * Gets the properties of the specified container service in the specified subscription and resource group. The - * operation returns the properties including state, orchestrator, number of masters and agents, and FQDNs of - * masters and agents. - * - * @param resourceGroupName The name of the resource group. - * @param containerServiceName The name of the container service in the specified subscription and resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the specified container service in the specified subscription and resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync(String resourceGroupName, String containerServiceName); - - /** - * Gets the properties of the specified container service in the specified subscription and resource group. The - * operation returns the properties including state, orchestrator, number of masters and agents, and FQDNs of - * masters and agents. - * - * @param resourceGroupName The name of the resource group. - * @param containerServiceName The name of the container service in the specified subscription and resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the specified container service in the specified subscription and resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ContainerServiceInner getByResourceGroup(String resourceGroupName, String containerServiceName); - - /** - * Gets the properties of the specified container service in the specified subscription and resource group. The - * operation returns the properties including state, orchestrator, number of masters and agents, and FQDNs of - * masters and agents. - * - * @param resourceGroupName The name of the resource group. - * @param containerServiceName The name of the container service in the specified subscription and resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the specified container service in the specified subscription and resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String containerServiceName, Context context); - - /** - * Deletes the specified container service in the specified subscription and resource group. The operation does not - * delete other resources created as part of creating a container service, including storage accounts, VMs, and - * availability sets. All the other resources created with the container service are part of the same resource group - * and can be deleted individually. - * - * @param resourceGroupName The name of the resource group. - * @param containerServiceName The name of the container service in the specified subscription and resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync(String resourceGroupName, String containerServiceName); - - /** - * Deletes the specified container service in the specified subscription and resource group. The operation does not - * delete other resources created as part of creating a container service, including storage accounts, VMs, and - * availability sets. All the other resources created with the container service are part of the same resource group - * and can be deleted individually. - * - * @param resourceGroupName The name of the resource group. - * @param containerServiceName The name of the container service in the specified subscription and resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String containerServiceName); - - /** - * Deletes the specified container service in the specified subscription and resource group. The operation does not - * delete other resources created as part of creating a container service, including storage accounts, VMs, and - * availability sets. All the other resources created with the container service are part of the same resource group - * and can be deleted individually. - * - * @param resourceGroupName The name of the resource group. - * @param containerServiceName The name of the container service in the specified subscription and resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String containerServiceName); - - /** - * Deletes the specified container service in the specified subscription and resource group. The operation does not - * delete other resources created as part of creating a container service, including storage accounts, VMs, and - * availability sets. All the other resources created with the container service are part of the same resource group - * and can be deleted individually. - * - * @param resourceGroupName The name of the resource group. - * @param containerServiceName The name of the container service in the specified subscription and resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String containerServiceName, Context context); - - /** - * Deletes the specified container service in the specified subscription and resource group. The operation does not - * delete other resources created as part of creating a container service, including storage accounts, VMs, and - * availability sets. All the other resources created with the container service are part of the same resource group - * and can be deleted individually. - * - * @param resourceGroupName The name of the resource group. - * @param containerServiceName The name of the container service in the specified subscription and resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String containerServiceName); - - /** - * Deletes the specified container service in the specified subscription and resource group. The operation does not - * delete other resources created as part of creating a container service, including storage accounts, VMs, and - * availability sets. All the other resources created with the container service are part of the same resource group - * and can be deleted individually. - * - * @param resourceGroupName The name of the resource group. - * @param containerServiceName The name of the container service in the specified subscription and resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String containerServiceName); - - /** - * Deletes the specified container service in the specified subscription and resource group. The operation does not - * delete other resources created as part of creating a container service, including storage accounts, VMs, and - * availability sets. All the other resources created with the container service are part of the same resource group - * and can be deleted individually. - * - * @param resourceGroupName The name of the resource group. - * @param containerServiceName The name of the container service in the specified subscription and resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String containerServiceName, Context context); - - /** - * Gets a list of container services in the specified subscription and resource group. The operation returns - * properties of each container service including state, orchestrator, number of masters and agents, and FQDNs of - * masters and agents. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of container services in the specified subscription and resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName); - - /** - * Gets a list of container services in the specified subscription and resource group. The operation returns - * properties of each container service including state, orchestrator, number of masters and agents, and FQDNs of - * masters and agents. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of container services in the specified subscription and resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Gets a list of container services in the specified subscription and resource group. The operation returns - * properties of each container service including state, orchestrator, number of masters and agents, and FQDNs of - * masters and agents. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of container services in the specified subscription and resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/ManagedClustersClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/ManagedClustersClient.java deleted file mode 100644 index 6fef99b172a3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/ManagedClustersClient.java +++ /dev/null @@ -1,1261 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.containerservice.fluent.models.CredentialResultsInner; -import com.azure.resourcemanager.containerservice.fluent.models.ManagedClusterAccessProfileInner; -import com.azure.resourcemanager.containerservice.fluent.models.ManagedClusterInner; -import com.azure.resourcemanager.containerservice.fluent.models.ManagedClusterUpgradeProfileInner; -import com.azure.resourcemanager.containerservice.models.ManagedClusterAadProfile; -import com.azure.resourcemanager.containerservice.models.ManagedClusterServicePrincipalProfile; -import com.azure.resourcemanager.containerservice.models.TagsObject; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ManagedClustersClient. */ -public interface ManagedClustersClient - extends InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete { - /** - * Gets a list of managed clusters in the specified subscription. The operation returns properties of each managed - * cluster. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of managed clusters in the specified subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Gets a list of managed clusters in the specified subscription. The operation returns properties of each managed - * cluster. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of managed clusters in the specified subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Gets a list of managed clusters in the specified subscription. The operation returns properties of each managed - * cluster. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of managed clusters in the specified subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Lists managed clusters in the specified subscription and resource group. The operation returns properties of each - * managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the List Managed Clusters operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName); - - /** - * Lists managed clusters in the specified subscription and resource group. The operation returns properties of each - * managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the List Managed Clusters operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Lists managed clusters in the specified subscription and resource group. The operation returns properties of each - * managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the List Managed Clusters operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * Gets the details of the upgrade profile for a managed cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of the upgrade profile for a managed cluster with a specified resource group and name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getUpgradeProfileWithResponseAsync( - String resourceGroupName, String resourceName); - - /** - * Gets the details of the upgrade profile for a managed cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of the upgrade profile for a managed cluster with a specified resource group and name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getUpgradeProfileAsync(String resourceGroupName, String resourceName); - - /** - * Gets the details of the upgrade profile for a managed cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of the upgrade profile for a managed cluster with a specified resource group and name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ManagedClusterUpgradeProfileInner getUpgradeProfile(String resourceGroupName, String resourceName); - - /** - * Gets the details of the upgrade profile for a managed cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of the upgrade profile for a managed cluster with a specified resource group and name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getUpgradeProfileWithResponse( - String resourceGroupName, String resourceName, Context context); - - /** - * Gets the accessProfile for the specified role name of the managed cluster with a specified resource group and - * name. **WARNING**: This API will be deprecated. Instead use - * [ListClusterUserCredentials](https://docs.microsoft.com/en-us/rest/api/aks/managedclusters/listclusterusercredentials) - * or - * [ListClusterAdminCredentials](https://docs.microsoft.com/en-us/rest/api/aks/managedclusters/listclusteradmincredentials) - * . - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param roleName The name of the role for managed cluster accessProfile resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the accessProfile for the specified role name of the managed cluster with a specified resource group and - * name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getAccessProfileWithResponseAsync( - String resourceGroupName, String resourceName, String roleName); - - /** - * Gets the accessProfile for the specified role name of the managed cluster with a specified resource group and - * name. **WARNING**: This API will be deprecated. Instead use - * [ListClusterUserCredentials](https://docs.microsoft.com/en-us/rest/api/aks/managedclusters/listclusterusercredentials) - * or - * [ListClusterAdminCredentials](https://docs.microsoft.com/en-us/rest/api/aks/managedclusters/listclusteradmincredentials) - * . - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param roleName The name of the role for managed cluster accessProfile resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the accessProfile for the specified role name of the managed cluster with a specified resource group and - * name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAccessProfileAsync( - String resourceGroupName, String resourceName, String roleName); - - /** - * Gets the accessProfile for the specified role name of the managed cluster with a specified resource group and - * name. **WARNING**: This API will be deprecated. Instead use - * [ListClusterUserCredentials](https://docs.microsoft.com/en-us/rest/api/aks/managedclusters/listclusterusercredentials) - * or - * [ListClusterAdminCredentials](https://docs.microsoft.com/en-us/rest/api/aks/managedclusters/listclusteradmincredentials) - * . - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param roleName The name of the role for managed cluster accessProfile resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the accessProfile for the specified role name of the managed cluster with a specified resource group and - * name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ManagedClusterAccessProfileInner getAccessProfile(String resourceGroupName, String resourceName, String roleName); - - /** - * Gets the accessProfile for the specified role name of the managed cluster with a specified resource group and - * name. **WARNING**: This API will be deprecated. Instead use - * [ListClusterUserCredentials](https://docs.microsoft.com/en-us/rest/api/aks/managedclusters/listclusterusercredentials) - * or - * [ListClusterAdminCredentials](https://docs.microsoft.com/en-us/rest/api/aks/managedclusters/listclusteradmincredentials) - * . - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param roleName The name of the role for managed cluster accessProfile resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the accessProfile for the specified role name of the managed cluster with a specified resource group and - * name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getAccessProfileWithResponse( - String resourceGroupName, String resourceName, String roleName, Context context); - - /** - * Gets cluster admin credential of the managed cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cluster admin credential of the managed cluster with a specified resource group and name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listClusterAdminCredentialsWithResponseAsync( - String resourceGroupName, String resourceName); - - /** - * Gets cluster admin credential of the managed cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cluster admin credential of the managed cluster with a specified resource group and name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listClusterAdminCredentialsAsync(String resourceGroupName, String resourceName); - - /** - * Gets cluster admin credential of the managed cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cluster admin credential of the managed cluster with a specified resource group and name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - CredentialResultsInner listClusterAdminCredentials(String resourceGroupName, String resourceName); - - /** - * Gets cluster admin credential of the managed cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cluster admin credential of the managed cluster with a specified resource group and name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listClusterAdminCredentialsWithResponse( - String resourceGroupName, String resourceName, Context context); - - /** - * Gets cluster user credential of the managed cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cluster user credential of the managed cluster with a specified resource group and name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listClusterUserCredentialsWithResponseAsync( - String resourceGroupName, String resourceName); - - /** - * Gets cluster user credential of the managed cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cluster user credential of the managed cluster with a specified resource group and name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listClusterUserCredentialsAsync(String resourceGroupName, String resourceName); - - /** - * Gets cluster user credential of the managed cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cluster user credential of the managed cluster with a specified resource group and name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - CredentialResultsInner listClusterUserCredentials(String resourceGroupName, String resourceName); - - /** - * Gets cluster user credential of the managed cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cluster user credential of the managed cluster with a specified resource group and name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listClusterUserCredentialsWithResponse( - String resourceGroupName, String resourceName, Context context); - - /** - * Gets cluster monitoring user credential of the managed cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cluster monitoring user credential of the managed cluster with a specified resource group and name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listClusterMonitoringUserCredentialsWithResponseAsync( - String resourceGroupName, String resourceName); - - /** - * Gets cluster monitoring user credential of the managed cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cluster monitoring user credential of the managed cluster with a specified resource group and name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listClusterMonitoringUserCredentialsAsync( - String resourceGroupName, String resourceName); - - /** - * Gets cluster monitoring user credential of the managed cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cluster monitoring user credential of the managed cluster with a specified resource group and name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - CredentialResultsInner listClusterMonitoringUserCredentials(String resourceGroupName, String resourceName); - - /** - * Gets cluster monitoring user credential of the managed cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cluster monitoring user credential of the managed cluster with a specified resource group and name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listClusterMonitoringUserCredentialsWithResponse( - String resourceGroupName, String resourceName, Context context); - - /** - * Gets the details of the managed cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of the managed cluster with a specified resource group and name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String resourceName); - - /** - * Gets the details of the managed cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of the managed cluster with a specified resource group and name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync(String resourceGroupName, String resourceName); - - /** - * Gets the details of the managed cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of the managed cluster with a specified resource group and name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ManagedClusterInner getByResourceGroup(String resourceGroupName, String resourceName); - - /** - * Gets the details of the managed cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of the managed cluster with a specified resource group and name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String resourceName, Context context); - - /** - * Creates or updates a managed cluster with the specified configuration for agents and Kubernetes version. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param parameters Parameters supplied to the Create or Update a Managed Cluster operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String resourceName, ManagedClusterInner parameters); - - /** - * Creates or updates a managed cluster with the specified configuration for agents and Kubernetes version. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param parameters Parameters supplied to the Create or Update a Managed Cluster operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, ManagedClusterInner> beginCreateOrUpdateAsync( - String resourceGroupName, String resourceName, ManagedClusterInner parameters); - - /** - * Creates or updates a managed cluster with the specified configuration for agents and Kubernetes version. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param parameters Parameters supplied to the Create or Update a Managed Cluster operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ManagedClusterInner> beginCreateOrUpdate( - String resourceGroupName, String resourceName, ManagedClusterInner parameters); - - /** - * Creates or updates a managed cluster with the specified configuration for agents and Kubernetes version. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param parameters Parameters supplied to the Create or Update a Managed Cluster operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ManagedClusterInner> beginCreateOrUpdate( - String resourceGroupName, String resourceName, ManagedClusterInner parameters, Context context); - - /** - * Creates or updates a managed cluster with the specified configuration for agents and Kubernetes version. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param parameters Parameters supplied to the Create or Update a Managed Cluster operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, String resourceName, ManagedClusterInner parameters); - - /** - * Creates or updates a managed cluster with the specified configuration for agents and Kubernetes version. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param parameters Parameters supplied to the Create or Update a Managed Cluster operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ManagedClusterInner createOrUpdate(String resourceGroupName, String resourceName, ManagedClusterInner parameters); - - /** - * Creates or updates a managed cluster with the specified configuration for agents and Kubernetes version. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param parameters Parameters supplied to the Create or Update a Managed Cluster operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ManagedClusterInner createOrUpdate( - String resourceGroupName, String resourceName, ManagedClusterInner parameters, Context context); - - /** - * Updates a managed cluster with the specified tags. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param parameters Parameters supplied to the Update Managed Cluster Tags operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> updateTagsWithResponseAsync( - String resourceGroupName, String resourceName, TagsObject parameters); - - /** - * Updates a managed cluster with the specified tags. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param parameters Parameters supplied to the Update Managed Cluster Tags operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, ManagedClusterInner> beginUpdateTagsAsync( - String resourceGroupName, String resourceName, TagsObject parameters); - - /** - * Updates a managed cluster with the specified tags. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param parameters Parameters supplied to the Update Managed Cluster Tags operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ManagedClusterInner> beginUpdateTags( - String resourceGroupName, String resourceName, TagsObject parameters); - - /** - * Updates a managed cluster with the specified tags. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param parameters Parameters supplied to the Update Managed Cluster Tags operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ManagedClusterInner> beginUpdateTags( - String resourceGroupName, String resourceName, TagsObject parameters, Context context); - - /** - * Updates a managed cluster with the specified tags. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param parameters Parameters supplied to the Update Managed Cluster Tags operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateTagsAsync(String resourceGroupName, String resourceName, TagsObject parameters); - - /** - * Updates a managed cluster with the specified tags. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param parameters Parameters supplied to the Update Managed Cluster Tags operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ManagedClusterInner updateTags(String resourceGroupName, String resourceName, TagsObject parameters); - - /** - * Updates a managed cluster with the specified tags. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param parameters Parameters supplied to the Update Managed Cluster Tags operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ManagedClusterInner updateTags( - String resourceGroupName, String resourceName, TagsObject parameters, Context context); - - /** - * Deletes the managed cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync(String resourceGroupName, String resourceName); - - /** - * Deletes the managed cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String resourceName); - - /** - * Deletes the managed cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName); - - /** - * Deletes the managed cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName, Context context); - - /** - * Deletes the managed cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String resourceName); - - /** - * Deletes the managed cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String resourceName); - - /** - * Deletes the managed cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String resourceName, Context context); - - /** - * Update the service principal Profile for a managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param parameters Parameters supplied to the Reset Service Principal Profile operation for a Managed Cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> resetServicePrincipalProfileWithResponseAsync( - String resourceGroupName, String resourceName, ManagedClusterServicePrincipalProfile parameters); - - /** - * Update the service principal Profile for a managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param parameters Parameters supplied to the Reset Service Principal Profile operation for a Managed Cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginResetServicePrincipalProfileAsync( - String resourceGroupName, String resourceName, ManagedClusterServicePrincipalProfile parameters); - - /** - * Update the service principal Profile for a managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param parameters Parameters supplied to the Reset Service Principal Profile operation for a Managed Cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginResetServicePrincipalProfile( - String resourceGroupName, String resourceName, ManagedClusterServicePrincipalProfile parameters); - - /** - * Update the service principal Profile for a managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param parameters Parameters supplied to the Reset Service Principal Profile operation for a Managed Cluster. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginResetServicePrincipalProfile( - String resourceGroupName, - String resourceName, - ManagedClusterServicePrincipalProfile parameters, - Context context); - - /** - * Update the service principal Profile for a managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param parameters Parameters supplied to the Reset Service Principal Profile operation for a Managed Cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono resetServicePrincipalProfileAsync( - String resourceGroupName, String resourceName, ManagedClusterServicePrincipalProfile parameters); - - /** - * Update the service principal Profile for a managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param parameters Parameters supplied to the Reset Service Principal Profile operation for a Managed Cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void resetServicePrincipalProfile( - String resourceGroupName, String resourceName, ManagedClusterServicePrincipalProfile parameters); - - /** - * Update the service principal Profile for a managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param parameters Parameters supplied to the Reset Service Principal Profile operation for a Managed Cluster. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void resetServicePrincipalProfile( - String resourceGroupName, - String resourceName, - ManagedClusterServicePrincipalProfile parameters, - Context context); - - /** - * Update the AAD Profile for a managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param parameters Parameters supplied to the Reset AAD Profile operation for a Managed Cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> resetAadProfileWithResponseAsync( - String resourceGroupName, String resourceName, ManagedClusterAadProfile parameters); - - /** - * Update the AAD Profile for a managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param parameters Parameters supplied to the Reset AAD Profile operation for a Managed Cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginResetAadProfileAsync( - String resourceGroupName, String resourceName, ManagedClusterAadProfile parameters); - - /** - * Update the AAD Profile for a managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param parameters Parameters supplied to the Reset AAD Profile operation for a Managed Cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginResetAadProfile( - String resourceGroupName, String resourceName, ManagedClusterAadProfile parameters); - - /** - * Update the AAD Profile for a managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param parameters Parameters supplied to the Reset AAD Profile operation for a Managed Cluster. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginResetAadProfile( - String resourceGroupName, String resourceName, ManagedClusterAadProfile parameters, Context context); - - /** - * Update the AAD Profile for a managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param parameters Parameters supplied to the Reset AAD Profile operation for a Managed Cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono resetAadProfileAsync(String resourceGroupName, String resourceName, ManagedClusterAadProfile parameters); - - /** - * Update the AAD Profile for a managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param parameters Parameters supplied to the Reset AAD Profile operation for a Managed Cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void resetAadProfile(String resourceGroupName, String resourceName, ManagedClusterAadProfile parameters); - - /** - * Update the AAD Profile for a managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param parameters Parameters supplied to the Reset AAD Profile operation for a Managed Cluster. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void resetAadProfile( - String resourceGroupName, String resourceName, ManagedClusterAadProfile parameters, Context context); - - /** - * Rotate certificates of a managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> rotateClusterCertificatesWithResponseAsync( - String resourceGroupName, String resourceName); - - /** - * Rotate certificates of a managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginRotateClusterCertificatesAsync( - String resourceGroupName, String resourceName); - - /** - * Rotate certificates of a managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginRotateClusterCertificates(String resourceGroupName, String resourceName); - - /** - * Rotate certificates of a managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginRotateClusterCertificates( - String resourceGroupName, String resourceName, Context context); - - /** - * Rotate certificates of a managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono rotateClusterCertificatesAsync(String resourceGroupName, String resourceName); - - /** - * Rotate certificates of a managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void rotateClusterCertificates(String resourceGroupName, String resourceName); - - /** - * Rotate certificates of a managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void rotateClusterCertificates(String resourceGroupName, String resourceName, Context context); - - /** - * Stops a Running Managed Cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> stopWithResponseAsync(String resourceGroupName, String resourceName); - - /** - * Stops a Running Managed Cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginStopAsync(String resourceGroupName, String resourceName); - - /** - * Stops a Running Managed Cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginStop(String resourceGroupName, String resourceName); - - /** - * Stops a Running Managed Cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginStop(String resourceGroupName, String resourceName, Context context); - - /** - * Stops a Running Managed Cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono stopAsync(String resourceGroupName, String resourceName); - - /** - * Stops a Running Managed Cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void stop(String resourceGroupName, String resourceName); - - /** - * Stops a Running Managed Cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void stop(String resourceGroupName, String resourceName, Context context); - - /** - * Starts a Stopped Managed Cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> startWithResponseAsync(String resourceGroupName, String resourceName); - - /** - * Starts a Stopped Managed Cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginStartAsync(String resourceGroupName, String resourceName); - - /** - * Starts a Stopped Managed Cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginStart(String resourceGroupName, String resourceName); - - /** - * Starts a Stopped Managed Cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginStart(String resourceGroupName, String resourceName, Context context); - - /** - * Starts a Stopped Managed Cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono startAsync(String resourceGroupName, String resourceName); - - /** - * Starts a Stopped Managed Cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void start(String resourceGroupName, String resourceName); - - /** - * Starts a Stopped Managed Cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void start(String resourceGroupName, String resourceName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/OpenShiftManagedClustersClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/OpenShiftManagedClustersClient.java deleted file mode 100644 index bfee65e3370c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/OpenShiftManagedClustersClient.java +++ /dev/null @@ -1,463 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.containerservice.fluent.models.OpenShiftManagedClusterInner; -import com.azure.resourcemanager.containerservice.models.TagsObject; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in OpenShiftManagedClustersClient. */ -public interface OpenShiftManagedClustersClient - extends InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete { - /** - * Gets a list of OpenShift managed clusters in the specified subscription. The operation returns properties of each - * OpenShift managed cluster. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of OpenShift managed clusters in the specified subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Gets a list of OpenShift managed clusters in the specified subscription. The operation returns properties of each - * OpenShift managed cluster. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of OpenShift managed clusters in the specified subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Gets a list of OpenShift managed clusters in the specified subscription. The operation returns properties of each - * OpenShift managed cluster. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of OpenShift managed clusters in the specified subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Lists OpenShift managed clusters in the specified subscription and resource group. The operation returns - * properties of each OpenShift managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the List OpenShift Managed Clusters operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName); - - /** - * Lists OpenShift managed clusters in the specified subscription and resource group. The operation returns - * properties of each OpenShift managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the List OpenShift Managed Clusters operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Lists OpenShift managed clusters in the specified subscription and resource group. The operation returns - * properties of each OpenShift managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the List OpenShift Managed Clusters operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * Gets the details of the managed OpenShift cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the OpenShift managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of the managed OpenShift cluster with a specified resource group and name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String resourceName); - - /** - * Gets the details of the managed OpenShift cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the OpenShift managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of the managed OpenShift cluster with a specified resource group and name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync(String resourceGroupName, String resourceName); - - /** - * Gets the details of the managed OpenShift cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the OpenShift managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of the managed OpenShift cluster with a specified resource group and name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - OpenShiftManagedClusterInner getByResourceGroup(String resourceGroupName, String resourceName); - - /** - * Gets the details of the managed OpenShift cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the OpenShift managed cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of the managed OpenShift cluster with a specified resource group and name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String resourceName, Context context); - - /** - * Creates or updates a OpenShift managed cluster with the specified configuration for agents and OpenShift version. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the OpenShift managed cluster resource. - * @param parameters Parameters supplied to the Create or Update an OpenShift Managed Cluster operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return openShift Managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String resourceName, OpenShiftManagedClusterInner parameters); - - /** - * Creates or updates a OpenShift managed cluster with the specified configuration for agents and OpenShift version. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the OpenShift managed cluster resource. - * @param parameters Parameters supplied to the Create or Update an OpenShift Managed Cluster operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return openShift Managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, OpenShiftManagedClusterInner> beginCreateOrUpdateAsync( - String resourceGroupName, String resourceName, OpenShiftManagedClusterInner parameters); - - /** - * Creates or updates a OpenShift managed cluster with the specified configuration for agents and OpenShift version. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the OpenShift managed cluster resource. - * @param parameters Parameters supplied to the Create or Update an OpenShift Managed Cluster operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return openShift Managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, OpenShiftManagedClusterInner> beginCreateOrUpdate( - String resourceGroupName, String resourceName, OpenShiftManagedClusterInner parameters); - - /** - * Creates or updates a OpenShift managed cluster with the specified configuration for agents and OpenShift version. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the OpenShift managed cluster resource. - * @param parameters Parameters supplied to the Create or Update an OpenShift Managed Cluster operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return openShift Managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, OpenShiftManagedClusterInner> beginCreateOrUpdate( - String resourceGroupName, String resourceName, OpenShiftManagedClusterInner parameters, Context context); - - /** - * Creates or updates a OpenShift managed cluster with the specified configuration for agents and OpenShift version. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the OpenShift managed cluster resource. - * @param parameters Parameters supplied to the Create or Update an OpenShift Managed Cluster operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return openShift Managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, String resourceName, OpenShiftManagedClusterInner parameters); - - /** - * Creates or updates a OpenShift managed cluster with the specified configuration for agents and OpenShift version. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the OpenShift managed cluster resource. - * @param parameters Parameters supplied to the Create or Update an OpenShift Managed Cluster operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return openShift Managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - OpenShiftManagedClusterInner createOrUpdate( - String resourceGroupName, String resourceName, OpenShiftManagedClusterInner parameters); - - /** - * Creates or updates a OpenShift managed cluster with the specified configuration for agents and OpenShift version. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the OpenShift managed cluster resource. - * @param parameters Parameters supplied to the Create or Update an OpenShift Managed Cluster operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return openShift Managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - OpenShiftManagedClusterInner createOrUpdate( - String resourceGroupName, String resourceName, OpenShiftManagedClusterInner parameters, Context context); - - /** - * Updates an OpenShift managed cluster with the specified tags. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the OpenShift managed cluster resource. - * @param parameters Parameters supplied to the Update OpenShift Managed Cluster Tags operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return openShift Managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> updateTagsWithResponseAsync( - String resourceGroupName, String resourceName, TagsObject parameters); - - /** - * Updates an OpenShift managed cluster with the specified tags. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the OpenShift managed cluster resource. - * @param parameters Parameters supplied to the Update OpenShift Managed Cluster Tags operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return openShift Managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, OpenShiftManagedClusterInner> beginUpdateTagsAsync( - String resourceGroupName, String resourceName, TagsObject parameters); - - /** - * Updates an OpenShift managed cluster with the specified tags. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the OpenShift managed cluster resource. - * @param parameters Parameters supplied to the Update OpenShift Managed Cluster Tags operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return openShift Managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, OpenShiftManagedClusterInner> beginUpdateTags( - String resourceGroupName, String resourceName, TagsObject parameters); - - /** - * Updates an OpenShift managed cluster with the specified tags. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the OpenShift managed cluster resource. - * @param parameters Parameters supplied to the Update OpenShift Managed Cluster Tags operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return openShift Managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, OpenShiftManagedClusterInner> beginUpdateTags( - String resourceGroupName, String resourceName, TagsObject parameters, Context context); - - /** - * Updates an OpenShift managed cluster with the specified tags. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the OpenShift managed cluster resource. - * @param parameters Parameters supplied to the Update OpenShift Managed Cluster Tags operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return openShift Managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateTagsAsync( - String resourceGroupName, String resourceName, TagsObject parameters); - - /** - * Updates an OpenShift managed cluster with the specified tags. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the OpenShift managed cluster resource. - * @param parameters Parameters supplied to the Update OpenShift Managed Cluster Tags operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return openShift Managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - OpenShiftManagedClusterInner updateTags(String resourceGroupName, String resourceName, TagsObject parameters); - - /** - * Updates an OpenShift managed cluster with the specified tags. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the OpenShift managed cluster resource. - * @param parameters Parameters supplied to the Update OpenShift Managed Cluster Tags operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return openShift Managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - OpenShiftManagedClusterInner updateTags( - String resourceGroupName, String resourceName, TagsObject parameters, Context context); - - /** - * Deletes the OpenShift managed cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the OpenShift managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync(String resourceGroupName, String resourceName); - - /** - * Deletes the OpenShift managed cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the OpenShift managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String resourceName); - - /** - * Deletes the OpenShift managed cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the OpenShift managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName); - - /** - * Deletes the OpenShift managed cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the OpenShift managed cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName, Context context); - - /** - * Deletes the OpenShift managed cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the OpenShift managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String resourceName); - - /** - * Deletes the OpenShift managed cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the OpenShift managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String resourceName); - - /** - * Deletes the OpenShift managed cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the OpenShift managed cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String resourceName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/OperationsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/OperationsClient.java deleted file mode 100644 index 21d40ed01e76..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/OperationsClient.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.containerservice.fluent.models.OperationValueInner; - -/** An instance of this class provides access to all the operations defined in OperationsClient. */ -public interface OperationsClient { - /** - * Gets a list of compute operations. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of compute operations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Gets a list of compute operations. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of compute operations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Gets a list of compute operations. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of compute operations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/PrivateEndpointConnectionsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/PrivateEndpointConnectionsClient.java deleted file mode 100644 index a36bf5f0b30f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/PrivateEndpointConnectionsClient.java +++ /dev/null @@ -1,321 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.containerservice.fluent.models.PrivateEndpointConnectionInner; -import com.azure.resourcemanager.containerservice.fluent.models.PrivateEndpointConnectionListResultInner; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. */ -public interface PrivateEndpointConnectionsClient { - /** - * Gets a list of private endpoint connections in the specified managed cluster. The operation returns properties of - * each private endpoint connection. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of private endpoint connections in the specified managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listWithResponseAsync( - String resourceGroupName, String resourceName); - - /** - * Gets a list of private endpoint connections in the specified managed cluster. The operation returns properties of - * each private endpoint connection. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of private endpoint connections in the specified managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listAsync(String resourceGroupName, String resourceName); - - /** - * Gets a list of private endpoint connections in the specified managed cluster. The operation returns properties of - * each private endpoint connection. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of private endpoint connections in the specified managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PrivateEndpointConnectionListResultInner list(String resourceGroupName, String resourceName); - - /** - * Gets a list of private endpoint connections in the specified managed cluster. The operation returns properties of - * each private endpoint connection. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of private endpoint connections in the specified managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listWithResponse( - String resourceGroupName, String resourceName, Context context); - - /** - * Gets the details of the private endpoint connection by managed cluster and resource group. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of the private endpoint connection by managed cluster and resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync( - String resourceGroupName, String resourceName, String privateEndpointConnectionName); - - /** - * Gets the details of the private endpoint connection by managed cluster and resource group. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of the private endpoint connection by managed cluster and resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync( - String resourceGroupName, String resourceName, String privateEndpointConnectionName); - - /** - * Gets the details of the private endpoint connection by managed cluster and resource group. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of the private endpoint connection by managed cluster and resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PrivateEndpointConnectionInner get( - String resourceGroupName, String resourceName, String privateEndpointConnectionName); - - /** - * Gets the details of the private endpoint connection by managed cluster and resource group. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of the private endpoint connection by managed cluster and resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String resourceName, String privateEndpointConnectionName, Context context); - - /** - * Updates a private endpoint connection in the specified managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param parameters Parameters supplied to the Update a private endpoint connection operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateWithResponseAsync( - String resourceGroupName, - String resourceName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner parameters); - - /** - * Updates a private endpoint connection in the specified managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param parameters Parameters supplied to the Update a private endpoint connection operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAsync( - String resourceGroupName, - String resourceName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner parameters); - - /** - * Updates a private endpoint connection in the specified managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param parameters Parameters supplied to the Update a private endpoint connection operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PrivateEndpointConnectionInner update( - String resourceGroupName, - String resourceName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner parameters); - - /** - * Updates a private endpoint connection in the specified managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param parameters Parameters supplied to the Update a private endpoint connection operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String resourceGroupName, - String resourceName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner parameters, - Context context); - - /** - * Deletes the private endpoint connection in the specified managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync( - String resourceGroupName, String resourceName, String privateEndpointConnectionName); - - /** - * Deletes the private endpoint connection in the specified managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String resourceName, String privateEndpointConnectionName); - - /** - * Deletes the private endpoint connection in the specified managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String resourceName, String privateEndpointConnectionName); - - /** - * Deletes the private endpoint connection in the specified managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String resourceName, String privateEndpointConnectionName, Context context); - - /** - * Deletes the private endpoint connection in the specified managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String resourceName, String privateEndpointConnectionName); - - /** - * Deletes the private endpoint connection in the specified managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String resourceName, String privateEndpointConnectionName); - - /** - * Deletes the private endpoint connection in the specified managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String resourceName, String privateEndpointConnectionName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/PrivateLinkResourcesClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/PrivateLinkResourcesClient.java deleted file mode 100644 index c7a5462ecd0e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/PrivateLinkResourcesClient.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.containerservice.fluent.models.PrivateLinkResourcesListResultInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. */ -public interface PrivateLinkResourcesClient { - /** - * Gets a list of private link resources in the specified managed cluster. The operation returns properties of each - * private link resource. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of private link resources in the specified managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listWithResponseAsync( - String resourceGroupName, String resourceName); - - /** - * Gets a list of private link resources in the specified managed cluster. The operation returns properties of each - * private link resource. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of private link resources in the specified managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listAsync(String resourceGroupName, String resourceName); - - /** - * Gets a list of private link resources in the specified managed cluster. The operation returns properties of each - * private link resource. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of private link resources in the specified managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PrivateLinkResourcesListResultInner list(String resourceGroupName, String resourceName); - - /** - * Gets a list of private link resources in the specified managed cluster. The operation returns properties of each - * private link resource. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of private link resources in the specified managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listWithResponse( - String resourceGroupName, String resourceName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/ResolvePrivateLinkServiceIdsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/ResolvePrivateLinkServiceIdsClient.java deleted file mode 100644 index 5dbb51be881f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/ResolvePrivateLinkServiceIdsClient.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.containerservice.fluent.models.PrivateLinkResourceInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ResolvePrivateLinkServiceIdsClient. */ -public interface ResolvePrivateLinkServiceIdsClient { - /** - * Gets the private link service ID the specified managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param parameters Parameters (name, groupId) supplied in order to resolve a private link service ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link service ID the specified managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> postWithResponseAsync( - String resourceGroupName, String resourceName, PrivateLinkResourceInner parameters); - - /** - * Gets the private link service ID the specified managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param parameters Parameters (name, groupId) supplied in order to resolve a private link service ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link service ID the specified managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono postAsync( - String resourceGroupName, String resourceName, PrivateLinkResourceInner parameters); - - /** - * Gets the private link service ID the specified managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param parameters Parameters (name, groupId) supplied in order to resolve a private link service ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link service ID the specified managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PrivateLinkResourceInner post(String resourceGroupName, String resourceName, PrivateLinkResourceInner parameters); - - /** - * Gets the private link service ID the specified managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param parameters Parameters (name, groupId) supplied in order to resolve a private link service ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link service ID the specified managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response postWithResponse( - String resourceGroupName, String resourceName, PrivateLinkResourceInner parameters, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/models/AccessProfile.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/models/AccessProfile.java deleted file mode 100644 index 0b45e4966dd3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/models/AccessProfile.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Profile for enabling a user to access a managed cluster. */ -@Fluent -public final class AccessProfile { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AccessProfile.class); - - /* - * Base64-encoded Kubernetes configuration file. - */ - @JsonProperty(value = "kubeConfig") - private byte[] kubeConfig; - - /** - * Get the kubeConfig property: Base64-encoded Kubernetes configuration file. - * - * @return the kubeConfig value. - */ - public byte[] kubeConfig() { - return CoreUtils.clone(this.kubeConfig); - } - - /** - * Set the kubeConfig property: Base64-encoded Kubernetes configuration file. - * - * @param kubeConfig the kubeConfig value to set. - * @return the AccessProfile object itself. - */ - public AccessProfile withKubeConfig(byte[] kubeConfig) { - this.kubeConfig = CoreUtils.clone(kubeConfig); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/models/AgentPoolAvailableVersionsInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/models/AgentPoolAvailableVersionsInner.java deleted file mode 100644 index c0b8e38ef457..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/models/AgentPoolAvailableVersionsInner.java +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.containerservice.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The list of available versions for an agent pool. */ -@Fluent -public final class AgentPoolAvailableVersionsInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AgentPoolAvailableVersionsInner.class); - - /* - * Id of the agent pool available versions. - */ - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) - private String id; - - /* - * Name of the agent pool available versions. - */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) - private String name; - - /* - * Type of the agent pool available versions. - */ - @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) - private String type; - - /* - * Properties of agent pool available versions. - */ - @JsonProperty(value = "properties", required = true) - private AgentPoolAvailableVersionsProperties innerProperties = new AgentPoolAvailableVersionsProperties(); - - /** - * Get the id property: Id of the agent pool available versions. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Get the name property: Name of the agent pool available versions. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the type property: Type of the agent pool available versions. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Get the innerProperties property: Properties of agent pool available versions. - * - * @return the innerProperties value. - */ - private AgentPoolAvailableVersionsProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the agentPoolVersions property: List of versions available for agent pool. - * - * @return the agentPoolVersions value. - */ - public List agentPoolVersions() { - return this.innerProperties() == null ? null : this.innerProperties().agentPoolVersions(); - } - - /** - * Set the agentPoolVersions property: List of versions available for agent pool. - * - * @param agentPoolVersions the agentPoolVersions value to set. - * @return the AgentPoolAvailableVersionsInner object itself. - */ - public AgentPoolAvailableVersionsInner withAgentPoolVersions( - List agentPoolVersions) { - if (this.innerProperties() == null) { - this.innerProperties = new AgentPoolAvailableVersionsProperties(); - } - this.innerProperties().withAgentPoolVersions(agentPoolVersions); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property innerProperties in model AgentPoolAvailableVersionsInner")); - } else { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/models/AgentPoolAvailableVersionsProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/models/AgentPoolAvailableVersionsProperties.java deleted file mode 100644 index 7d9ad21fbda0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/models/AgentPoolAvailableVersionsProperties.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.containerservice.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The list of available agent pool versions. */ -@Fluent -public final class AgentPoolAvailableVersionsProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AgentPoolAvailableVersionsProperties.class); - - /* - * List of versions available for agent pool. - */ - @JsonProperty(value = "agentPoolVersions") - private List agentPoolVersions; - - /** - * Get the agentPoolVersions property: List of versions available for agent pool. - * - * @return the agentPoolVersions value. - */ - public List agentPoolVersions() { - return this.agentPoolVersions; - } - - /** - * Set the agentPoolVersions property: List of versions available for agent pool. - * - * @param agentPoolVersions the agentPoolVersions value to set. - * @return the AgentPoolAvailableVersionsProperties object itself. - */ - public AgentPoolAvailableVersionsProperties withAgentPoolVersions( - List agentPoolVersions) { - this.agentPoolVersions = agentPoolVersions; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (agentPoolVersions() != null) { - agentPoolVersions().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/models/AgentPoolInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/models/AgentPoolInner.java deleted file mode 100644 index b26729a18fae..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/models/AgentPoolInner.java +++ /dev/null @@ -1,743 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.containerservice.models.AgentPoolMode; -import com.azure.resourcemanager.containerservice.models.AgentPoolType; -import com.azure.resourcemanager.containerservice.models.AgentPoolUpgradeSettings; -import com.azure.resourcemanager.containerservice.models.ContainerServiceVMSizeTypes; -import com.azure.resourcemanager.containerservice.models.KubeletConfig; -import com.azure.resourcemanager.containerservice.models.LinuxOSConfig; -import com.azure.resourcemanager.containerservice.models.OSDiskType; -import com.azure.resourcemanager.containerservice.models.OSType; -import com.azure.resourcemanager.containerservice.models.PowerState; -import com.azure.resourcemanager.containerservice.models.ScaleSetEvictionPolicy; -import com.azure.resourcemanager.containerservice.models.ScaleSetPriority; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** Agent Pool. */ -@Fluent -public final class AgentPoolInner extends SubResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AgentPoolInner.class); - - /* - * Properties of an agent pool. - */ - @JsonProperty(value = "properties") - private ManagedClusterAgentPoolProfileProperties innerProperties; - - /* - * The name of the resource that is unique within a resource group. This - * name can be used to access the resource. - */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) - private String name; - - /* - * Resource type - */ - @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) - private String type; - - /** - * Get the innerProperties property: Properties of an agent pool. - * - * @return the innerProperties value. - */ - private ManagedClusterAgentPoolProfileProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the name property: The name of the resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the type property: Resource type. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** {@inheritDoc} */ - @Override - public AgentPoolInner withId(String id) { - super.withId(id); - return this; - } - - /** - * Get the count property: Number of agents (VMs) to host docker containers. Allowed values must be in the range of - * 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for system pools. The default value - * is 1. - * - * @return the count value. - */ - public Integer count() { - return this.innerProperties() == null ? null : this.innerProperties().count(); - } - - /** - * Set the count property: Number of agents (VMs) to host docker containers. Allowed values must be in the range of - * 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for system pools. The default value - * is 1. - * - * @param count the count value to set. - * @return the AgentPoolInner object itself. - */ - public AgentPoolInner withCount(Integer count) { - if (this.innerProperties() == null) { - this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); - } - this.innerProperties().withCount(count); - return this; - } - - /** - * Get the vmSize property: Size of agent VMs. - * - * @return the vmSize value. - */ - public ContainerServiceVMSizeTypes vmSize() { - return this.innerProperties() == null ? null : this.innerProperties().vmSize(); - } - - /** - * Set the vmSize property: Size of agent VMs. - * - * @param vmSize the vmSize value to set. - * @return the AgentPoolInner object itself. - */ - public AgentPoolInner withVmSize(ContainerServiceVMSizeTypes vmSize) { - if (this.innerProperties() == null) { - this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); - } - this.innerProperties().withVmSize(vmSize); - return this; - } - - /** - * Get the osDiskSizeGB property: OS Disk Size in GB to be used to specify the disk size for every machine in this - * master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified. - * - * @return the osDiskSizeGB value. - */ - public Integer osDiskSizeGB() { - return this.innerProperties() == null ? null : this.innerProperties().osDiskSizeGB(); - } - - /** - * Set the osDiskSizeGB property: OS Disk Size in GB to be used to specify the disk size for every machine in this - * master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified. - * - * @param osDiskSizeGB the osDiskSizeGB value to set. - * @return the AgentPoolInner object itself. - */ - public AgentPoolInner withOsDiskSizeGB(Integer osDiskSizeGB) { - if (this.innerProperties() == null) { - this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); - } - this.innerProperties().withOsDiskSizeGB(osDiskSizeGB); - return this; - } - - /** - * Get the osDiskType property: OS disk type to be used for machines in a given agent pool. Allowed values are - * 'Ephemeral' and 'Managed'. If unspecified, defaults to 'Ephemeral' when the VM supports ephemeral OS and has a - * cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed after - * creation. - * - * @return the osDiskType value. - */ - public OSDiskType osDiskType() { - return this.innerProperties() == null ? null : this.innerProperties().osDiskType(); - } - - /** - * Set the osDiskType property: OS disk type to be used for machines in a given agent pool. Allowed values are - * 'Ephemeral' and 'Managed'. If unspecified, defaults to 'Ephemeral' when the VM supports ephemeral OS and has a - * cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed after - * creation. - * - * @param osDiskType the osDiskType value to set. - * @return the AgentPoolInner object itself. - */ - public AgentPoolInner withOsDiskType(OSDiskType osDiskType) { - if (this.innerProperties() == null) { - this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); - } - this.innerProperties().withOsDiskType(osDiskType); - return this; - } - - /** - * Get the vnetSubnetId property: VNet SubnetID specifies the VNet's subnet identifier for nodes and maybe pods. - * - * @return the vnetSubnetId value. - */ - public String vnetSubnetId() { - return this.innerProperties() == null ? null : this.innerProperties().vnetSubnetId(); - } - - /** - * Set the vnetSubnetId property: VNet SubnetID specifies the VNet's subnet identifier for nodes and maybe pods. - * - * @param vnetSubnetId the vnetSubnetId value to set. - * @return the AgentPoolInner object itself. - */ - public AgentPoolInner withVnetSubnetId(String vnetSubnetId) { - if (this.innerProperties() == null) { - this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); - } - this.innerProperties().withVnetSubnetId(vnetSubnetId); - return this; - } - - /** - * Get the podSubnetId property: Pod SubnetID specifies the VNet's subnet identifier for pods. - * - * @return the podSubnetId value. - */ - public String podSubnetId() { - return this.innerProperties() == null ? null : this.innerProperties().podSubnetId(); - } - - /** - * Set the podSubnetId property: Pod SubnetID specifies the VNet's subnet identifier for pods. - * - * @param podSubnetId the podSubnetId value to set. - * @return the AgentPoolInner object itself. - */ - public AgentPoolInner withPodSubnetId(String podSubnetId) { - if (this.innerProperties() == null) { - this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); - } - this.innerProperties().withPodSubnetId(podSubnetId); - return this; - } - - /** - * Get the maxPods property: Maximum number of pods that can run on a node. - * - * @return the maxPods value. - */ - public Integer maxPods() { - return this.innerProperties() == null ? null : this.innerProperties().maxPods(); - } - - /** - * Set the maxPods property: Maximum number of pods that can run on a node. - * - * @param maxPods the maxPods value to set. - * @return the AgentPoolInner object itself. - */ - public AgentPoolInner withMaxPods(Integer maxPods) { - if (this.innerProperties() == null) { - this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); - } - this.innerProperties().withMaxPods(maxPods); - return this; - } - - /** - * Get the osType property: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. - * - * @return the osType value. - */ - public OSType osType() { - return this.innerProperties() == null ? null : this.innerProperties().osType(); - } - - /** - * Set the osType property: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. - * - * @param osType the osType value to set. - * @return the AgentPoolInner object itself. - */ - public AgentPoolInner withOsType(OSType osType) { - if (this.innerProperties() == null) { - this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); - } - this.innerProperties().withOsType(osType); - return this; - } - - /** - * Get the maxCount property: Maximum number of nodes for auto-scaling. - * - * @return the maxCount value. - */ - public Integer maxCount() { - return this.innerProperties() == null ? null : this.innerProperties().maxCount(); - } - - /** - * Set the maxCount property: Maximum number of nodes for auto-scaling. - * - * @param maxCount the maxCount value to set. - * @return the AgentPoolInner object itself. - */ - public AgentPoolInner withMaxCount(Integer maxCount) { - if (this.innerProperties() == null) { - this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); - } - this.innerProperties().withMaxCount(maxCount); - return this; - } - - /** - * Get the minCount property: Minimum number of nodes for auto-scaling. - * - * @return the minCount value. - */ - public Integer minCount() { - return this.innerProperties() == null ? null : this.innerProperties().minCount(); - } - - /** - * Set the minCount property: Minimum number of nodes for auto-scaling. - * - * @param minCount the minCount value to set. - * @return the AgentPoolInner object itself. - */ - public AgentPoolInner withMinCount(Integer minCount) { - if (this.innerProperties() == null) { - this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); - } - this.innerProperties().withMinCount(minCount); - return this; - } - - /** - * Get the enableAutoScaling property: Whether to enable auto-scaler. - * - * @return the enableAutoScaling value. - */ - public Boolean enableAutoScaling() { - return this.innerProperties() == null ? null : this.innerProperties().enableAutoScaling(); - } - - /** - * Set the enableAutoScaling property: Whether to enable auto-scaler. - * - * @param enableAutoScaling the enableAutoScaling value to set. - * @return the AgentPoolInner object itself. - */ - public AgentPoolInner withEnableAutoScaling(Boolean enableAutoScaling) { - if (this.innerProperties() == null) { - this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); - } - this.innerProperties().withEnableAutoScaling(enableAutoScaling); - return this; - } - - /** - * Get the type property: AgentPoolType represents types of an agent pool. - * - * @return the type value. - */ - public AgentPoolType typePropertiesType() { - return this.innerProperties() == null ? null : this.innerProperties().type(); - } - - /** - * Set the type property: AgentPoolType represents types of an agent pool. - * - * @param type the type value to set. - * @return the AgentPoolInner object itself. - */ - public AgentPoolInner withTypePropertiesType(AgentPoolType type) { - if (this.innerProperties() == null) { - this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); - } - this.innerProperties().withType(type); - return this; - } - - /** - * Get the mode property: AgentPoolMode represents mode of an agent pool. - * - * @return the mode value. - */ - public AgentPoolMode mode() { - return this.innerProperties() == null ? null : this.innerProperties().mode(); - } - - /** - * Set the mode property: AgentPoolMode represents mode of an agent pool. - * - * @param mode the mode value to set. - * @return the AgentPoolInner object itself. - */ - public AgentPoolInner withMode(AgentPoolMode mode) { - if (this.innerProperties() == null) { - this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); - } - this.innerProperties().withMode(mode); - return this; - } - - /** - * Get the orchestratorVersion property: Version of orchestrator specified when creating the managed cluster. - * - * @return the orchestratorVersion value. - */ - public String orchestratorVersion() { - return this.innerProperties() == null ? null : this.innerProperties().orchestratorVersion(); - } - - /** - * Set the orchestratorVersion property: Version of orchestrator specified when creating the managed cluster. - * - * @param orchestratorVersion the orchestratorVersion value to set. - * @return the AgentPoolInner object itself. - */ - public AgentPoolInner withOrchestratorVersion(String orchestratorVersion) { - if (this.innerProperties() == null) { - this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); - } - this.innerProperties().withOrchestratorVersion(orchestratorVersion); - return this; - } - - /** - * Get the nodeImageVersion property: Version of node image. - * - * @return the nodeImageVersion value. - */ - public String nodeImageVersion() { - return this.innerProperties() == null ? null : this.innerProperties().nodeImageVersion(); - } - - /** - * Get the upgradeSettings property: Settings for upgrading the agentpool. - * - * @return the upgradeSettings value. - */ - public AgentPoolUpgradeSettings upgradeSettings() { - return this.innerProperties() == null ? null : this.innerProperties().upgradeSettings(); - } - - /** - * Set the upgradeSettings property: Settings for upgrading the agentpool. - * - * @param upgradeSettings the upgradeSettings value to set. - * @return the AgentPoolInner object itself. - */ - public AgentPoolInner withUpgradeSettings(AgentPoolUpgradeSettings upgradeSettings) { - if (this.innerProperties() == null) { - this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); - } - this.innerProperties().withUpgradeSettings(upgradeSettings); - return this; - } - - /** - * Get the provisioningState property: The current deployment or provisioning state, which only appears in the - * response. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the powerState property: Describes whether the Agent Pool is Running or Stopped. - * - * @return the powerState value. - */ - public PowerState powerState() { - return this.innerProperties() == null ? null : this.innerProperties().powerState(); - } - - /** - * Get the availabilityZones property: Availability zones for nodes. Must use VirtualMachineScaleSets AgentPoolType. - * - * @return the availabilityZones value. - */ - public List availabilityZones() { - return this.innerProperties() == null ? null : this.innerProperties().availabilityZones(); - } - - /** - * Set the availabilityZones property: Availability zones for nodes. Must use VirtualMachineScaleSets AgentPoolType. - * - * @param availabilityZones the availabilityZones value to set. - * @return the AgentPoolInner object itself. - */ - public AgentPoolInner withAvailabilityZones(List availabilityZones) { - if (this.innerProperties() == null) { - this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); - } - this.innerProperties().withAvailabilityZones(availabilityZones); - return this; - } - - /** - * Get the enableNodePublicIp property: Enable public IP for nodes. - * - * @return the enableNodePublicIp value. - */ - public Boolean enableNodePublicIp() { - return this.innerProperties() == null ? null : this.innerProperties().enableNodePublicIp(); - } - - /** - * Set the enableNodePublicIp property: Enable public IP for nodes. - * - * @param enableNodePublicIp the enableNodePublicIp value to set. - * @return the AgentPoolInner object itself. - */ - public AgentPoolInner withEnableNodePublicIp(Boolean enableNodePublicIp) { - if (this.innerProperties() == null) { - this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); - } - this.innerProperties().withEnableNodePublicIp(enableNodePublicIp); - return this; - } - - /** - * Get the scaleSetPriority property: ScaleSetPriority to be used to specify virtual machine scale set priority. - * Default to regular. - * - * @return the scaleSetPriority value. - */ - public ScaleSetPriority scaleSetPriority() { - return this.innerProperties() == null ? null : this.innerProperties().scaleSetPriority(); - } - - /** - * Set the scaleSetPriority property: ScaleSetPriority to be used to specify virtual machine scale set priority. - * Default to regular. - * - * @param scaleSetPriority the scaleSetPriority value to set. - * @return the AgentPoolInner object itself. - */ - public AgentPoolInner withScaleSetPriority(ScaleSetPriority scaleSetPriority) { - if (this.innerProperties() == null) { - this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); - } - this.innerProperties().withScaleSetPriority(scaleSetPriority); - return this; - } - - /** - * Get the scaleSetEvictionPolicy property: ScaleSetEvictionPolicy to be used to specify eviction policy for Spot - * virtual machine scale set. Default to Delete. - * - * @return the scaleSetEvictionPolicy value. - */ - public ScaleSetEvictionPolicy scaleSetEvictionPolicy() { - return this.innerProperties() == null ? null : this.innerProperties().scaleSetEvictionPolicy(); - } - - /** - * Set the scaleSetEvictionPolicy property: ScaleSetEvictionPolicy to be used to specify eviction policy for Spot - * virtual machine scale set. Default to Delete. - * - * @param scaleSetEvictionPolicy the scaleSetEvictionPolicy value to set. - * @return the AgentPoolInner object itself. - */ - public AgentPoolInner withScaleSetEvictionPolicy(ScaleSetEvictionPolicy scaleSetEvictionPolicy) { - if (this.innerProperties() == null) { - this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); - } - this.innerProperties().withScaleSetEvictionPolicy(scaleSetEvictionPolicy); - return this; - } - - /** - * Get the spotMaxPrice property: SpotMaxPrice to be used to specify the maximum price you are willing to pay in US - * Dollars. Possible values are any decimal value greater than zero or -1 which indicates default price to be up-to - * on-demand. - * - * @return the spotMaxPrice value. - */ - public Float spotMaxPrice() { - return this.innerProperties() == null ? null : this.innerProperties().spotMaxPrice(); - } - - /** - * Set the spotMaxPrice property: SpotMaxPrice to be used to specify the maximum price you are willing to pay in US - * Dollars. Possible values are any decimal value greater than zero or -1 which indicates default price to be up-to - * on-demand. - * - * @param spotMaxPrice the spotMaxPrice value to set. - * @return the AgentPoolInner object itself. - */ - public AgentPoolInner withSpotMaxPrice(Float spotMaxPrice) { - if (this.innerProperties() == null) { - this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); - } - this.innerProperties().withSpotMaxPrice(spotMaxPrice); - return this; - } - - /** - * Get the tags property: Agent pool tags to be persisted on the agent pool virtual machine scale set. - * - * @return the tags value. - */ - public Map tags() { - return this.innerProperties() == null ? null : this.innerProperties().tags(); - } - - /** - * Set the tags property: Agent pool tags to be persisted on the agent pool virtual machine scale set. - * - * @param tags the tags value to set. - * @return the AgentPoolInner object itself. - */ - public AgentPoolInner withTags(Map tags) { - if (this.innerProperties() == null) { - this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); - } - this.innerProperties().withTags(tags); - return this; - } - - /** - * Get the nodeLabels property: Agent pool node labels to be persisted across all nodes in agent pool. - * - * @return the nodeLabels value. - */ - public Map nodeLabels() { - return this.innerProperties() == null ? null : this.innerProperties().nodeLabels(); - } - - /** - * Set the nodeLabels property: Agent pool node labels to be persisted across all nodes in agent pool. - * - * @param nodeLabels the nodeLabels value to set. - * @return the AgentPoolInner object itself. - */ - public AgentPoolInner withNodeLabels(Map nodeLabels) { - if (this.innerProperties() == null) { - this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); - } - this.innerProperties().withNodeLabels(nodeLabels); - return this; - } - - /** - * Get the nodeTaints property: Taints added to new nodes during node pool create and scale. For example, - * key=value:NoSchedule. - * - * @return the nodeTaints value. - */ - public List nodeTaints() { - return this.innerProperties() == null ? null : this.innerProperties().nodeTaints(); - } - - /** - * Set the nodeTaints property: Taints added to new nodes during node pool create and scale. For example, - * key=value:NoSchedule. - * - * @param nodeTaints the nodeTaints value to set. - * @return the AgentPoolInner object itself. - */ - public AgentPoolInner withNodeTaints(List nodeTaints) { - if (this.innerProperties() == null) { - this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); - } - this.innerProperties().withNodeTaints(nodeTaints); - return this; - } - - /** - * Get the proximityPlacementGroupId property: The ID for Proximity Placement Group. - * - * @return the proximityPlacementGroupId value. - */ - public String proximityPlacementGroupId() { - return this.innerProperties() == null ? null : this.innerProperties().proximityPlacementGroupId(); - } - - /** - * Set the proximityPlacementGroupId property: The ID for Proximity Placement Group. - * - * @param proximityPlacementGroupId the proximityPlacementGroupId value to set. - * @return the AgentPoolInner object itself. - */ - public AgentPoolInner withProximityPlacementGroupId(String proximityPlacementGroupId) { - if (this.innerProperties() == null) { - this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); - } - this.innerProperties().withProximityPlacementGroupId(proximityPlacementGroupId); - return this; - } - - /** - * Get the kubeletConfig property: KubeletConfig specifies the configuration of kubelet on agent nodes. - * - * @return the kubeletConfig value. - */ - public KubeletConfig kubeletConfig() { - return this.innerProperties() == null ? null : this.innerProperties().kubeletConfig(); - } - - /** - * Set the kubeletConfig property: KubeletConfig specifies the configuration of kubelet on agent nodes. - * - * @param kubeletConfig the kubeletConfig value to set. - * @return the AgentPoolInner object itself. - */ - public AgentPoolInner withKubeletConfig(KubeletConfig kubeletConfig) { - if (this.innerProperties() == null) { - this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); - } - this.innerProperties().withKubeletConfig(kubeletConfig); - return this; - } - - /** - * Get the linuxOSConfig property: LinuxOSConfig specifies the OS configuration of linux agent nodes. - * - * @return the linuxOSConfig value. - */ - public LinuxOSConfig linuxOSConfig() { - return this.innerProperties() == null ? null : this.innerProperties().linuxOSConfig(); - } - - /** - * Set the linuxOSConfig property: LinuxOSConfig specifies the OS configuration of linux agent nodes. - * - * @param linuxOSConfig the linuxOSConfig value to set. - * @return the AgentPoolInner object itself. - */ - public AgentPoolInner withLinuxOSConfig(LinuxOSConfig linuxOSConfig) { - if (this.innerProperties() == null) { - this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); - } - this.innerProperties().withLinuxOSConfig(linuxOSConfig); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/models/AgentPoolUpgradeProfileInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/models/AgentPoolUpgradeProfileInner.java deleted file mode 100644 index b8b0328655e9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/models/AgentPoolUpgradeProfileInner.java +++ /dev/null @@ -1,187 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.containerservice.models.AgentPoolUpgradeProfilePropertiesUpgradesItem; -import com.azure.resourcemanager.containerservice.models.OSType; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The list of available upgrades for an agent pool. */ -@Fluent -public final class AgentPoolUpgradeProfileInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AgentPoolUpgradeProfileInner.class); - - /* - * Id of the agent pool upgrade profile. - */ - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) - private String id; - - /* - * Name of the agent pool upgrade profile. - */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) - private String name; - - /* - * Type of the agent pool upgrade profile. - */ - @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) - private String type; - - /* - * Properties of agent pool upgrade profile. - */ - @JsonProperty(value = "properties", required = true) - private AgentPoolUpgradeProfileProperties innerProperties = new AgentPoolUpgradeProfileProperties(); - - /** - * Get the id property: Id of the agent pool upgrade profile. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Get the name property: Name of the agent pool upgrade profile. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the type property: Type of the agent pool upgrade profile. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Get the innerProperties property: Properties of agent pool upgrade profile. - * - * @return the innerProperties value. - */ - private AgentPoolUpgradeProfileProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the kubernetesVersion property: Kubernetes version (major, minor, patch). - * - * @return the kubernetesVersion value. - */ - public String kubernetesVersion() { - return this.innerProperties() == null ? null : this.innerProperties().kubernetesVersion(); - } - - /** - * Set the kubernetesVersion property: Kubernetes version (major, minor, patch). - * - * @param kubernetesVersion the kubernetesVersion value to set. - * @return the AgentPoolUpgradeProfileInner object itself. - */ - public AgentPoolUpgradeProfileInner withKubernetesVersion(String kubernetesVersion) { - if (this.innerProperties() == null) { - this.innerProperties = new AgentPoolUpgradeProfileProperties(); - } - this.innerProperties().withKubernetesVersion(kubernetesVersion); - return this; - } - - /** - * Get the osType property: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. - * - * @return the osType value. - */ - public OSType osType() { - return this.innerProperties() == null ? null : this.innerProperties().osType(); - } - - /** - * Set the osType property: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. - * - * @param osType the osType value to set. - * @return the AgentPoolUpgradeProfileInner object itself. - */ - public AgentPoolUpgradeProfileInner withOsType(OSType osType) { - if (this.innerProperties() == null) { - this.innerProperties = new AgentPoolUpgradeProfileProperties(); - } - this.innerProperties().withOsType(osType); - return this; - } - - /** - * Get the upgrades property: List of orchestrator types and versions available for upgrade. - * - * @return the upgrades value. - */ - public List upgrades() { - return this.innerProperties() == null ? null : this.innerProperties().upgrades(); - } - - /** - * Set the upgrades property: List of orchestrator types and versions available for upgrade. - * - * @param upgrades the upgrades value to set. - * @return the AgentPoolUpgradeProfileInner object itself. - */ - public AgentPoolUpgradeProfileInner withUpgrades(List upgrades) { - if (this.innerProperties() == null) { - this.innerProperties = new AgentPoolUpgradeProfileProperties(); - } - this.innerProperties().withUpgrades(upgrades); - return this; - } - - /** - * Get the latestNodeImageVersion property: LatestNodeImageVersion is the latest AKS supported node image version. - * - * @return the latestNodeImageVersion value. - */ - public String latestNodeImageVersion() { - return this.innerProperties() == null ? null : this.innerProperties().latestNodeImageVersion(); - } - - /** - * Set the latestNodeImageVersion property: LatestNodeImageVersion is the latest AKS supported node image version. - * - * @param latestNodeImageVersion the latestNodeImageVersion value to set. - * @return the AgentPoolUpgradeProfileInner object itself. - */ - public AgentPoolUpgradeProfileInner withLatestNodeImageVersion(String latestNodeImageVersion) { - if (this.innerProperties() == null) { - this.innerProperties = new AgentPoolUpgradeProfileProperties(); - } - this.innerProperties().withLatestNodeImageVersion(latestNodeImageVersion); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property innerProperties in model AgentPoolUpgradeProfileInner")); - } else { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/models/AgentPoolUpgradeProfileProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/models/AgentPoolUpgradeProfileProperties.java deleted file mode 100644 index 799deacbcd51..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/models/AgentPoolUpgradeProfileProperties.java +++ /dev/null @@ -1,148 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.containerservice.models.AgentPoolUpgradeProfilePropertiesUpgradesItem; -import com.azure.resourcemanager.containerservice.models.OSType; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The list of available upgrade versions. */ -@Fluent -public final class AgentPoolUpgradeProfileProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AgentPoolUpgradeProfileProperties.class); - - /* - * Kubernetes version (major, minor, patch). - */ - @JsonProperty(value = "kubernetesVersion", required = true) - private String kubernetesVersion; - - /* - * OsType to be used to specify os type. Choose from Linux and Windows. - * Default to Linux. - */ - @JsonProperty(value = "osType", required = true) - private OSType osType; - - /* - * List of orchestrator types and versions available for upgrade. - */ - @JsonProperty(value = "upgrades") - private List upgrades; - - /* - * LatestNodeImageVersion is the latest AKS supported node image version. - */ - @JsonProperty(value = "latestNodeImageVersion") - private String latestNodeImageVersion; - - /** - * Get the kubernetesVersion property: Kubernetes version (major, minor, patch). - * - * @return the kubernetesVersion value. - */ - public String kubernetesVersion() { - return this.kubernetesVersion; - } - - /** - * Set the kubernetesVersion property: Kubernetes version (major, minor, patch). - * - * @param kubernetesVersion the kubernetesVersion value to set. - * @return the AgentPoolUpgradeProfileProperties object itself. - */ - public AgentPoolUpgradeProfileProperties withKubernetesVersion(String kubernetesVersion) { - this.kubernetesVersion = kubernetesVersion; - return this; - } - - /** - * Get the osType property: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. - * - * @return the osType value. - */ - public OSType osType() { - return this.osType; - } - - /** - * Set the osType property: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. - * - * @param osType the osType value to set. - * @return the AgentPoolUpgradeProfileProperties object itself. - */ - public AgentPoolUpgradeProfileProperties withOsType(OSType osType) { - this.osType = osType; - return this; - } - - /** - * Get the upgrades property: List of orchestrator types and versions available for upgrade. - * - * @return the upgrades value. - */ - public List upgrades() { - return this.upgrades; - } - - /** - * Set the upgrades property: List of orchestrator types and versions available for upgrade. - * - * @param upgrades the upgrades value to set. - * @return the AgentPoolUpgradeProfileProperties object itself. - */ - public AgentPoolUpgradeProfileProperties withUpgrades( - List upgrades) { - this.upgrades = upgrades; - return this; - } - - /** - * Get the latestNodeImageVersion property: LatestNodeImageVersion is the latest AKS supported node image version. - * - * @return the latestNodeImageVersion value. - */ - public String latestNodeImageVersion() { - return this.latestNodeImageVersion; - } - - /** - * Set the latestNodeImageVersion property: LatestNodeImageVersion is the latest AKS supported node image version. - * - * @param latestNodeImageVersion the latestNodeImageVersion value to set. - * @return the AgentPoolUpgradeProfileProperties object itself. - */ - public AgentPoolUpgradeProfileProperties withLatestNodeImageVersion(String latestNodeImageVersion) { - this.latestNodeImageVersion = latestNodeImageVersion; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (kubernetesVersion() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property kubernetesVersion in model AgentPoolUpgradeProfileProperties")); - } - if (osType() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property osType in model AgentPoolUpgradeProfileProperties")); - } - if (upgrades() != null) { - upgrades().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/models/ContainerServiceInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/models/ContainerServiceInner.java deleted file mode 100644 index 75df925939d8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/models/ContainerServiceInner.java +++ /dev/null @@ -1,263 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.containerservice.models.ContainerServiceAgentPoolProfile; -import com.azure.resourcemanager.containerservice.models.ContainerServiceCustomProfile; -import com.azure.resourcemanager.containerservice.models.ContainerServiceDiagnosticsProfile; -import com.azure.resourcemanager.containerservice.models.ContainerServiceLinuxProfile; -import com.azure.resourcemanager.containerservice.models.ContainerServiceMasterProfile; -import com.azure.resourcemanager.containerservice.models.ContainerServiceOrchestratorProfile; -import com.azure.resourcemanager.containerservice.models.ContainerServicePrincipalProfile; -import com.azure.resourcemanager.containerservice.models.ContainerServiceWindowsProfile; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** Container service. */ -@Fluent -public final class ContainerServiceInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ContainerServiceInner.class); - - /* - * Properties of the container service. - */ - @JsonProperty(value = "properties") - private ContainerServiceProperties innerProperties; - - /** - * Get the innerProperties property: Properties of the container service. - * - * @return the innerProperties value. - */ - private ContainerServiceProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public ContainerServiceInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public ContainerServiceInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the provisioningState property: The current deployment or provisioning state, which only appears in the - * response. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the orchestratorProfile property: Profile for the container service orchestrator. - * - * @return the orchestratorProfile value. - */ - public ContainerServiceOrchestratorProfile orchestratorProfile() { - return this.innerProperties() == null ? null : this.innerProperties().orchestratorProfile(); - } - - /** - * Set the orchestratorProfile property: Profile for the container service orchestrator. - * - * @param orchestratorProfile the orchestratorProfile value to set. - * @return the ContainerServiceInner object itself. - */ - public ContainerServiceInner withOrchestratorProfile(ContainerServiceOrchestratorProfile orchestratorProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new ContainerServiceProperties(); - } - this.innerProperties().withOrchestratorProfile(orchestratorProfile); - return this; - } - - /** - * Get the customProfile property: Properties to configure a custom container service cluster. - * - * @return the customProfile value. - */ - public ContainerServiceCustomProfile customProfile() { - return this.innerProperties() == null ? null : this.innerProperties().customProfile(); - } - - /** - * Set the customProfile property: Properties to configure a custom container service cluster. - * - * @param customProfile the customProfile value to set. - * @return the ContainerServiceInner object itself. - */ - public ContainerServiceInner withCustomProfile(ContainerServiceCustomProfile customProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new ContainerServiceProperties(); - } - this.innerProperties().withCustomProfile(customProfile); - return this; - } - - /** - * Get the servicePrincipalProfile property: Information about a service principal identity for the cluster to use - * for manipulating Azure APIs. Exact one of secret or keyVaultSecretRef need to be specified. - * - * @return the servicePrincipalProfile value. - */ - public ContainerServicePrincipalProfile servicePrincipalProfile() { - return this.innerProperties() == null ? null : this.innerProperties().servicePrincipalProfile(); - } - - /** - * Set the servicePrincipalProfile property: Information about a service principal identity for the cluster to use - * for manipulating Azure APIs. Exact one of secret or keyVaultSecretRef need to be specified. - * - * @param servicePrincipalProfile the servicePrincipalProfile value to set. - * @return the ContainerServiceInner object itself. - */ - public ContainerServiceInner withServicePrincipalProfile(ContainerServicePrincipalProfile servicePrincipalProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new ContainerServiceProperties(); - } - this.innerProperties().withServicePrincipalProfile(servicePrincipalProfile); - return this; - } - - /** - * Get the masterProfile property: Profile for the container service master. - * - * @return the masterProfile value. - */ - public ContainerServiceMasterProfile masterProfile() { - return this.innerProperties() == null ? null : this.innerProperties().masterProfile(); - } - - /** - * Set the masterProfile property: Profile for the container service master. - * - * @param masterProfile the masterProfile value to set. - * @return the ContainerServiceInner object itself. - */ - public ContainerServiceInner withMasterProfile(ContainerServiceMasterProfile masterProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new ContainerServiceProperties(); - } - this.innerProperties().withMasterProfile(masterProfile); - return this; - } - - /** - * Get the agentPoolProfiles property: Properties of the agent pool. - * - * @return the agentPoolProfiles value. - */ - public List agentPoolProfiles() { - return this.innerProperties() == null ? null : this.innerProperties().agentPoolProfiles(); - } - - /** - * Set the agentPoolProfiles property: Properties of the agent pool. - * - * @param agentPoolProfiles the agentPoolProfiles value to set. - * @return the ContainerServiceInner object itself. - */ - public ContainerServiceInner withAgentPoolProfiles(List agentPoolProfiles) { - if (this.innerProperties() == null) { - this.innerProperties = new ContainerServiceProperties(); - } - this.innerProperties().withAgentPoolProfiles(agentPoolProfiles); - return this; - } - - /** - * Get the windowsProfile property: Profile for Windows VMs in the container service cluster. - * - * @return the windowsProfile value. - */ - public ContainerServiceWindowsProfile windowsProfile() { - return this.innerProperties() == null ? null : this.innerProperties().windowsProfile(); - } - - /** - * Set the windowsProfile property: Profile for Windows VMs in the container service cluster. - * - * @param windowsProfile the windowsProfile value to set. - * @return the ContainerServiceInner object itself. - */ - public ContainerServiceInner withWindowsProfile(ContainerServiceWindowsProfile windowsProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new ContainerServiceProperties(); - } - this.innerProperties().withWindowsProfile(windowsProfile); - return this; - } - - /** - * Get the linuxProfile property: Profile for Linux VMs in the container service cluster. - * - * @return the linuxProfile value. - */ - public ContainerServiceLinuxProfile linuxProfile() { - return this.innerProperties() == null ? null : this.innerProperties().linuxProfile(); - } - - /** - * Set the linuxProfile property: Profile for Linux VMs in the container service cluster. - * - * @param linuxProfile the linuxProfile value to set. - * @return the ContainerServiceInner object itself. - */ - public ContainerServiceInner withLinuxProfile(ContainerServiceLinuxProfile linuxProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new ContainerServiceProperties(); - } - this.innerProperties().withLinuxProfile(linuxProfile); - return this; - } - - /** - * Get the diagnosticsProfile property: Profile for diagnostics in the container service cluster. - * - * @return the diagnosticsProfile value. - */ - public ContainerServiceDiagnosticsProfile diagnosticsProfile() { - return this.innerProperties() == null ? null : this.innerProperties().diagnosticsProfile(); - } - - /** - * Set the diagnosticsProfile property: Profile for diagnostics in the container service cluster. - * - * @param diagnosticsProfile the diagnosticsProfile value to set. - * @return the ContainerServiceInner object itself. - */ - public ContainerServiceInner withDiagnosticsProfile(ContainerServiceDiagnosticsProfile diagnosticsProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new ContainerServiceProperties(); - } - this.innerProperties().withDiagnosticsProfile(diagnosticsProfile); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/models/ContainerServiceProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/models/ContainerServiceProperties.java deleted file mode 100644 index ef5418485203..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/models/ContainerServiceProperties.java +++ /dev/null @@ -1,302 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.containerservice.models.ContainerServiceAgentPoolProfile; -import com.azure.resourcemanager.containerservice.models.ContainerServiceCustomProfile; -import com.azure.resourcemanager.containerservice.models.ContainerServiceDiagnosticsProfile; -import com.azure.resourcemanager.containerservice.models.ContainerServiceLinuxProfile; -import com.azure.resourcemanager.containerservice.models.ContainerServiceMasterProfile; -import com.azure.resourcemanager.containerservice.models.ContainerServiceOrchestratorProfile; -import com.azure.resourcemanager.containerservice.models.ContainerServicePrincipalProfile; -import com.azure.resourcemanager.containerservice.models.ContainerServiceWindowsProfile; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Properties of the container service. */ -@Fluent -public final class ContainerServiceProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ContainerServiceProperties.class); - - /* - * The current deployment or provisioning state, which only appears in the - * response. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; - - /* - * Profile for the container service orchestrator. - */ - @JsonProperty(value = "orchestratorProfile", required = true) - private ContainerServiceOrchestratorProfile orchestratorProfile; - - /* - * Properties to configure a custom container service cluster. - */ - @JsonProperty(value = "customProfile") - private ContainerServiceCustomProfile customProfile; - - /* - * Information about a service principal identity for the cluster to use - * for manipulating Azure APIs. Exact one of secret or keyVaultSecretRef - * need to be specified. - */ - @JsonProperty(value = "servicePrincipalProfile") - private ContainerServicePrincipalProfile servicePrincipalProfile; - - /* - * Profile for the container service master. - */ - @JsonProperty(value = "masterProfile", required = true) - private ContainerServiceMasterProfile masterProfile; - - /* - * Properties of the agent pool. - */ - @JsonProperty(value = "agentPoolProfiles") - private List agentPoolProfiles; - - /* - * Profile for Windows VMs in the container service cluster. - */ - @JsonProperty(value = "windowsProfile") - private ContainerServiceWindowsProfile windowsProfile; - - /* - * Profile for Linux VMs in the container service cluster. - */ - @JsonProperty(value = "linuxProfile", required = true) - private ContainerServiceLinuxProfile linuxProfile; - - /* - * Profile for diagnostics in the container service cluster. - */ - @JsonProperty(value = "diagnosticsProfile") - private ContainerServiceDiagnosticsProfile diagnosticsProfile; - - /** - * Get the provisioningState property: The current deployment or provisioning state, which only appears in the - * response. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Get the orchestratorProfile property: Profile for the container service orchestrator. - * - * @return the orchestratorProfile value. - */ - public ContainerServiceOrchestratorProfile orchestratorProfile() { - return this.orchestratorProfile; - } - - /** - * Set the orchestratorProfile property: Profile for the container service orchestrator. - * - * @param orchestratorProfile the orchestratorProfile value to set. - * @return the ContainerServiceProperties object itself. - */ - public ContainerServiceProperties withOrchestratorProfile(ContainerServiceOrchestratorProfile orchestratorProfile) { - this.orchestratorProfile = orchestratorProfile; - return this; - } - - /** - * Get the customProfile property: Properties to configure a custom container service cluster. - * - * @return the customProfile value. - */ - public ContainerServiceCustomProfile customProfile() { - return this.customProfile; - } - - /** - * Set the customProfile property: Properties to configure a custom container service cluster. - * - * @param customProfile the customProfile value to set. - * @return the ContainerServiceProperties object itself. - */ - public ContainerServiceProperties withCustomProfile(ContainerServiceCustomProfile customProfile) { - this.customProfile = customProfile; - return this; - } - - /** - * Get the servicePrincipalProfile property: Information about a service principal identity for the cluster to use - * for manipulating Azure APIs. Exact one of secret or keyVaultSecretRef need to be specified. - * - * @return the servicePrincipalProfile value. - */ - public ContainerServicePrincipalProfile servicePrincipalProfile() { - return this.servicePrincipalProfile; - } - - /** - * Set the servicePrincipalProfile property: Information about a service principal identity for the cluster to use - * for manipulating Azure APIs. Exact one of secret or keyVaultSecretRef need to be specified. - * - * @param servicePrincipalProfile the servicePrincipalProfile value to set. - * @return the ContainerServiceProperties object itself. - */ - public ContainerServiceProperties withServicePrincipalProfile( - ContainerServicePrincipalProfile servicePrincipalProfile) { - this.servicePrincipalProfile = servicePrincipalProfile; - return this; - } - - /** - * Get the masterProfile property: Profile for the container service master. - * - * @return the masterProfile value. - */ - public ContainerServiceMasterProfile masterProfile() { - return this.masterProfile; - } - - /** - * Set the masterProfile property: Profile for the container service master. - * - * @param masterProfile the masterProfile value to set. - * @return the ContainerServiceProperties object itself. - */ - public ContainerServiceProperties withMasterProfile(ContainerServiceMasterProfile masterProfile) { - this.masterProfile = masterProfile; - return this; - } - - /** - * Get the agentPoolProfiles property: Properties of the agent pool. - * - * @return the agentPoolProfiles value. - */ - public List agentPoolProfiles() { - return this.agentPoolProfiles; - } - - /** - * Set the agentPoolProfiles property: Properties of the agent pool. - * - * @param agentPoolProfiles the agentPoolProfiles value to set. - * @return the ContainerServiceProperties object itself. - */ - public ContainerServiceProperties withAgentPoolProfiles(List agentPoolProfiles) { - this.agentPoolProfiles = agentPoolProfiles; - return this; - } - - /** - * Get the windowsProfile property: Profile for Windows VMs in the container service cluster. - * - * @return the windowsProfile value. - */ - public ContainerServiceWindowsProfile windowsProfile() { - return this.windowsProfile; - } - - /** - * Set the windowsProfile property: Profile for Windows VMs in the container service cluster. - * - * @param windowsProfile the windowsProfile value to set. - * @return the ContainerServiceProperties object itself. - */ - public ContainerServiceProperties withWindowsProfile(ContainerServiceWindowsProfile windowsProfile) { - this.windowsProfile = windowsProfile; - return this; - } - - /** - * Get the linuxProfile property: Profile for Linux VMs in the container service cluster. - * - * @return the linuxProfile value. - */ - public ContainerServiceLinuxProfile linuxProfile() { - return this.linuxProfile; - } - - /** - * Set the linuxProfile property: Profile for Linux VMs in the container service cluster. - * - * @param linuxProfile the linuxProfile value to set. - * @return the ContainerServiceProperties object itself. - */ - public ContainerServiceProperties withLinuxProfile(ContainerServiceLinuxProfile linuxProfile) { - this.linuxProfile = linuxProfile; - return this; - } - - /** - * Get the diagnosticsProfile property: Profile for diagnostics in the container service cluster. - * - * @return the diagnosticsProfile value. - */ - public ContainerServiceDiagnosticsProfile diagnosticsProfile() { - return this.diagnosticsProfile; - } - - /** - * Set the diagnosticsProfile property: Profile for diagnostics in the container service cluster. - * - * @param diagnosticsProfile the diagnosticsProfile value to set. - * @return the ContainerServiceProperties object itself. - */ - public ContainerServiceProperties withDiagnosticsProfile(ContainerServiceDiagnosticsProfile diagnosticsProfile) { - this.diagnosticsProfile = diagnosticsProfile; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (orchestratorProfile() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property orchestratorProfile in model ContainerServiceProperties")); - } else { - orchestratorProfile().validate(); - } - if (customProfile() != null) { - customProfile().validate(); - } - if (servicePrincipalProfile() != null) { - servicePrincipalProfile().validate(); - } - if (masterProfile() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property masterProfile in model ContainerServiceProperties")); - } else { - masterProfile().validate(); - } - if (agentPoolProfiles() != null) { - agentPoolProfiles().forEach(e -> e.validate()); - } - if (windowsProfile() != null) { - windowsProfile().validate(); - } - if (linuxProfile() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property linuxProfile in model ContainerServiceProperties")); - } else { - linuxProfile().validate(); - } - if (diagnosticsProfile() != null) { - diagnosticsProfile().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/models/CredentialResultsInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/models/CredentialResultsInner.java deleted file mode 100644 index 28ba1146ea70..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/models/CredentialResultsInner.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.containerservice.models.CredentialResult; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The list of credential result response. */ -@Immutable -public final class CredentialResultsInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CredentialResultsInner.class); - - /* - * Base64-encoded Kubernetes configuration file. - */ - @JsonProperty(value = "kubeconfigs", access = JsonProperty.Access.WRITE_ONLY) - private List kubeconfigs; - - /** - * Get the kubeconfigs property: Base64-encoded Kubernetes configuration file. - * - * @return the kubeconfigs value. - */ - public List kubeconfigs() { - return this.kubeconfigs; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (kubeconfigs() != null) { - kubeconfigs().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/models/ManagedClusterAccessProfileInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/models/ManagedClusterAccessProfileInner.java deleted file mode 100644 index 8710d60a982d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/models/ManagedClusterAccessProfileInner.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** Managed cluster Access Profile. */ -@Fluent -public final class ManagedClusterAccessProfileInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedClusterAccessProfileInner.class); - - /* - * AccessProfile of a managed cluster. - */ - @JsonProperty(value = "properties") - private AccessProfile innerProperties; - - /** - * Get the innerProperties property: AccessProfile of a managed cluster. - * - * @return the innerProperties value. - */ - private AccessProfile innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public ManagedClusterAccessProfileInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public ManagedClusterAccessProfileInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the kubeConfig property: Base64-encoded Kubernetes configuration file. - * - * @return the kubeConfig value. - */ - public byte[] kubeConfig() { - return this.innerProperties() == null ? null : this.innerProperties().kubeConfig(); - } - - /** - * Set the kubeConfig property: Base64-encoded Kubernetes configuration file. - * - * @param kubeConfig the kubeConfig value to set. - * @return the ManagedClusterAccessProfileInner object itself. - */ - public ManagedClusterAccessProfileInner withKubeConfig(byte[] kubeConfig) { - if (this.innerProperties() == null) { - this.innerProperties = new AccessProfile(); - } - this.innerProperties().withKubeConfig(kubeConfig); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/models/ManagedClusterAgentPoolProfileProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/models/ManagedClusterAgentPoolProfileProperties.java deleted file mode 100644 index e057f2b916b5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/models/ManagedClusterAgentPoolProfileProperties.java +++ /dev/null @@ -1,815 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.containerservice.models.AgentPoolMode; -import com.azure.resourcemanager.containerservice.models.AgentPoolType; -import com.azure.resourcemanager.containerservice.models.AgentPoolUpgradeSettings; -import com.azure.resourcemanager.containerservice.models.ContainerServiceVMSizeTypes; -import com.azure.resourcemanager.containerservice.models.KubeletConfig; -import com.azure.resourcemanager.containerservice.models.LinuxOSConfig; -import com.azure.resourcemanager.containerservice.models.OSDiskType; -import com.azure.resourcemanager.containerservice.models.OSType; -import com.azure.resourcemanager.containerservice.models.PowerState; -import com.azure.resourcemanager.containerservice.models.ScaleSetEvictionPolicy; -import com.azure.resourcemanager.containerservice.models.ScaleSetPriority; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** Properties for the container service agent pool profile. */ -@Fluent -public class ManagedClusterAgentPoolProfileProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedClusterAgentPoolProfileProperties.class); - - /* - * Number of agents (VMs) to host docker containers. Allowed values must be - * in the range of 0 to 100 (inclusive) for user pools and in the range of - * 1 to 100 (inclusive) for system pools. The default value is 1. - */ - @JsonProperty(value = "count") - private Integer count; - - /* - * Size of agent VMs. - */ - @JsonProperty(value = "vmSize") - private ContainerServiceVMSizeTypes vmSize; - - /* - * OS Disk Size in GB to be used to specify the disk size for every machine - * in this master/agent pool. If you specify 0, it will apply the default - * osDisk size according to the vmSize specified. - */ - @JsonProperty(value = "osDiskSizeGB") - private Integer osDiskSizeGB; - - /* - * OS disk type to be used for machines in a given agent pool. Allowed - * values are 'Ephemeral' and 'Managed'. If unspecified, defaults to - * 'Ephemeral' when the VM supports ephemeral OS and has a cache disk - * larger than the requested OSDiskSizeGB. Otherwise, defaults to - * 'Managed'. May not be changed after creation. - */ - @JsonProperty(value = "osDiskType") - private OSDiskType osDiskType; - - /* - * VNet SubnetID specifies the VNet's subnet identifier for nodes and maybe - * pods - */ - @JsonProperty(value = "vnetSubnetID") - private String vnetSubnetId; - - /* - * Pod SubnetID specifies the VNet's subnet identifier for pods. - */ - @JsonProperty(value = "podSubnetID") - private String podSubnetId; - - /* - * Maximum number of pods that can run on a node. - */ - @JsonProperty(value = "maxPods") - private Integer maxPods; - - /* - * OsType to be used to specify os type. Choose from Linux and Windows. - * Default to Linux. - */ - @JsonProperty(value = "osType") - private OSType osType; - - /* - * Maximum number of nodes for auto-scaling - */ - @JsonProperty(value = "maxCount") - private Integer maxCount; - - /* - * Minimum number of nodes for auto-scaling - */ - @JsonProperty(value = "minCount") - private Integer minCount; - - /* - * Whether to enable auto-scaler - */ - @JsonProperty(value = "enableAutoScaling") - private Boolean enableAutoScaling; - - /* - * AgentPoolType represents types of an agent pool - */ - @JsonProperty(value = "type") - private AgentPoolType type; - - /* - * AgentPoolMode represents mode of an agent pool - */ - @JsonProperty(value = "mode") - private AgentPoolMode mode; - - /* - * Version of orchestrator specified when creating the managed cluster. - */ - @JsonProperty(value = "orchestratorVersion") - private String orchestratorVersion; - - /* - * Version of node image - */ - @JsonProperty(value = "nodeImageVersion", access = JsonProperty.Access.WRITE_ONLY) - private String nodeImageVersion; - - /* - * Settings for upgrading the agentpool - */ - @JsonProperty(value = "upgradeSettings") - private AgentPoolUpgradeSettings upgradeSettings; - - /* - * The current deployment or provisioning state, which only appears in the - * response. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; - - /* - * Describes whether the Agent Pool is Running or Stopped - */ - @JsonProperty(value = "powerState", access = JsonProperty.Access.WRITE_ONLY) - private PowerState powerState; - - /* - * Availability zones for nodes. Must use VirtualMachineScaleSets - * AgentPoolType. - */ - @JsonProperty(value = "availabilityZones") - private List availabilityZones; - - /* - * Enable public IP for nodes - */ - @JsonProperty(value = "enableNodePublicIP") - private Boolean enableNodePublicIp; - - /* - * ScaleSetPriority to be used to specify virtual machine scale set - * priority. Default to regular. - */ - @JsonProperty(value = "scaleSetPriority") - private ScaleSetPriority scaleSetPriority; - - /* - * ScaleSetEvictionPolicy to be used to specify eviction policy for Spot - * virtual machine scale set. Default to Delete. - */ - @JsonProperty(value = "scaleSetEvictionPolicy") - private ScaleSetEvictionPolicy scaleSetEvictionPolicy; - - /* - * SpotMaxPrice to be used to specify the maximum price you are willing to - * pay in US Dollars. Possible values are any decimal value greater than - * zero or -1 which indicates default price to be up-to on-demand. - */ - @JsonProperty(value = "spotMaxPrice") - private Float spotMaxPrice; - - /* - * Agent pool tags to be persisted on the agent pool virtual machine scale - * set. - */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map tags; - - /* - * Agent pool node labels to be persisted across all nodes in agent pool. - */ - @JsonProperty(value = "nodeLabels") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map nodeLabels; - - /* - * Taints added to new nodes during node pool create and scale. For - * example, key=value:NoSchedule. - */ - @JsonProperty(value = "nodeTaints") - private List nodeTaints; - - /* - * The ID for Proximity Placement Group. - */ - @JsonProperty(value = "proximityPlacementGroupID") - private String proximityPlacementGroupId; - - /* - * KubeletConfig specifies the configuration of kubelet on agent nodes. - */ - @JsonProperty(value = "kubeletConfig") - private KubeletConfig kubeletConfig; - - /* - * LinuxOSConfig specifies the OS configuration of linux agent nodes. - */ - @JsonProperty(value = "linuxOSConfig") - private LinuxOSConfig linuxOSConfig; - - /** - * Get the count property: Number of agents (VMs) to host docker containers. Allowed values must be in the range of - * 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for system pools. The default value - * is 1. - * - * @return the count value. - */ - public Integer count() { - return this.count; - } - - /** - * Set the count property: Number of agents (VMs) to host docker containers. Allowed values must be in the range of - * 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for system pools. The default value - * is 1. - * - * @param count the count value to set. - * @return the ManagedClusterAgentPoolProfileProperties object itself. - */ - public ManagedClusterAgentPoolProfileProperties withCount(Integer count) { - this.count = count; - return this; - } - - /** - * Get the vmSize property: Size of agent VMs. - * - * @return the vmSize value. - */ - public ContainerServiceVMSizeTypes vmSize() { - return this.vmSize; - } - - /** - * Set the vmSize property: Size of agent VMs. - * - * @param vmSize the vmSize value to set. - * @return the ManagedClusterAgentPoolProfileProperties object itself. - */ - public ManagedClusterAgentPoolProfileProperties withVmSize(ContainerServiceVMSizeTypes vmSize) { - this.vmSize = vmSize; - return this; - } - - /** - * Get the osDiskSizeGB property: OS Disk Size in GB to be used to specify the disk size for every machine in this - * master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified. - * - * @return the osDiskSizeGB value. - */ - public Integer osDiskSizeGB() { - return this.osDiskSizeGB; - } - - /** - * Set the osDiskSizeGB property: OS Disk Size in GB to be used to specify the disk size for every machine in this - * master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified. - * - * @param osDiskSizeGB the osDiskSizeGB value to set. - * @return the ManagedClusterAgentPoolProfileProperties object itself. - */ - public ManagedClusterAgentPoolProfileProperties withOsDiskSizeGB(Integer osDiskSizeGB) { - this.osDiskSizeGB = osDiskSizeGB; - return this; - } - - /** - * Get the osDiskType property: OS disk type to be used for machines in a given agent pool. Allowed values are - * 'Ephemeral' and 'Managed'. If unspecified, defaults to 'Ephemeral' when the VM supports ephemeral OS and has a - * cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed after - * creation. - * - * @return the osDiskType value. - */ - public OSDiskType osDiskType() { - return this.osDiskType; - } - - /** - * Set the osDiskType property: OS disk type to be used for machines in a given agent pool. Allowed values are - * 'Ephemeral' and 'Managed'. If unspecified, defaults to 'Ephemeral' when the VM supports ephemeral OS and has a - * cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed after - * creation. - * - * @param osDiskType the osDiskType value to set. - * @return the ManagedClusterAgentPoolProfileProperties object itself. - */ - public ManagedClusterAgentPoolProfileProperties withOsDiskType(OSDiskType osDiskType) { - this.osDiskType = osDiskType; - return this; - } - - /** - * Get the vnetSubnetId property: VNet SubnetID specifies the VNet's subnet identifier for nodes and maybe pods. - * - * @return the vnetSubnetId value. - */ - public String vnetSubnetId() { - return this.vnetSubnetId; - } - - /** - * Set the vnetSubnetId property: VNet SubnetID specifies the VNet's subnet identifier for nodes and maybe pods. - * - * @param vnetSubnetId the vnetSubnetId value to set. - * @return the ManagedClusterAgentPoolProfileProperties object itself. - */ - public ManagedClusterAgentPoolProfileProperties withVnetSubnetId(String vnetSubnetId) { - this.vnetSubnetId = vnetSubnetId; - return this; - } - - /** - * Get the podSubnetId property: Pod SubnetID specifies the VNet's subnet identifier for pods. - * - * @return the podSubnetId value. - */ - public String podSubnetId() { - return this.podSubnetId; - } - - /** - * Set the podSubnetId property: Pod SubnetID specifies the VNet's subnet identifier for pods. - * - * @param podSubnetId the podSubnetId value to set. - * @return the ManagedClusterAgentPoolProfileProperties object itself. - */ - public ManagedClusterAgentPoolProfileProperties withPodSubnetId(String podSubnetId) { - this.podSubnetId = podSubnetId; - return this; - } - - /** - * Get the maxPods property: Maximum number of pods that can run on a node. - * - * @return the maxPods value. - */ - public Integer maxPods() { - return this.maxPods; - } - - /** - * Set the maxPods property: Maximum number of pods that can run on a node. - * - * @param maxPods the maxPods value to set. - * @return the ManagedClusterAgentPoolProfileProperties object itself. - */ - public ManagedClusterAgentPoolProfileProperties withMaxPods(Integer maxPods) { - this.maxPods = maxPods; - return this; - } - - /** - * Get the osType property: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. - * - * @return the osType value. - */ - public OSType osType() { - return this.osType; - } - - /** - * Set the osType property: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. - * - * @param osType the osType value to set. - * @return the ManagedClusterAgentPoolProfileProperties object itself. - */ - public ManagedClusterAgentPoolProfileProperties withOsType(OSType osType) { - this.osType = osType; - return this; - } - - /** - * Get the maxCount property: Maximum number of nodes for auto-scaling. - * - * @return the maxCount value. - */ - public Integer maxCount() { - return this.maxCount; - } - - /** - * Set the maxCount property: Maximum number of nodes for auto-scaling. - * - * @param maxCount the maxCount value to set. - * @return the ManagedClusterAgentPoolProfileProperties object itself. - */ - public ManagedClusterAgentPoolProfileProperties withMaxCount(Integer maxCount) { - this.maxCount = maxCount; - return this; - } - - /** - * Get the minCount property: Minimum number of nodes for auto-scaling. - * - * @return the minCount value. - */ - public Integer minCount() { - return this.minCount; - } - - /** - * Set the minCount property: Minimum number of nodes for auto-scaling. - * - * @param minCount the minCount value to set. - * @return the ManagedClusterAgentPoolProfileProperties object itself. - */ - public ManagedClusterAgentPoolProfileProperties withMinCount(Integer minCount) { - this.minCount = minCount; - return this; - } - - /** - * Get the enableAutoScaling property: Whether to enable auto-scaler. - * - * @return the enableAutoScaling value. - */ - public Boolean enableAutoScaling() { - return this.enableAutoScaling; - } - - /** - * Set the enableAutoScaling property: Whether to enable auto-scaler. - * - * @param enableAutoScaling the enableAutoScaling value to set. - * @return the ManagedClusterAgentPoolProfileProperties object itself. - */ - public ManagedClusterAgentPoolProfileProperties withEnableAutoScaling(Boolean enableAutoScaling) { - this.enableAutoScaling = enableAutoScaling; - return this; - } - - /** - * Get the type property: AgentPoolType represents types of an agent pool. - * - * @return the type value. - */ - public AgentPoolType type() { - return this.type; - } - - /** - * Set the type property: AgentPoolType represents types of an agent pool. - * - * @param type the type value to set. - * @return the ManagedClusterAgentPoolProfileProperties object itself. - */ - public ManagedClusterAgentPoolProfileProperties withType(AgentPoolType type) { - this.type = type; - return this; - } - - /** - * Get the mode property: AgentPoolMode represents mode of an agent pool. - * - * @return the mode value. - */ - public AgentPoolMode mode() { - return this.mode; - } - - /** - * Set the mode property: AgentPoolMode represents mode of an agent pool. - * - * @param mode the mode value to set. - * @return the ManagedClusterAgentPoolProfileProperties object itself. - */ - public ManagedClusterAgentPoolProfileProperties withMode(AgentPoolMode mode) { - this.mode = mode; - return this; - } - - /** - * Get the orchestratorVersion property: Version of orchestrator specified when creating the managed cluster. - * - * @return the orchestratorVersion value. - */ - public String orchestratorVersion() { - return this.orchestratorVersion; - } - - /** - * Set the orchestratorVersion property: Version of orchestrator specified when creating the managed cluster. - * - * @param orchestratorVersion the orchestratorVersion value to set. - * @return the ManagedClusterAgentPoolProfileProperties object itself. - */ - public ManagedClusterAgentPoolProfileProperties withOrchestratorVersion(String orchestratorVersion) { - this.orchestratorVersion = orchestratorVersion; - return this; - } - - /** - * Get the nodeImageVersion property: Version of node image. - * - * @return the nodeImageVersion value. - */ - public String nodeImageVersion() { - return this.nodeImageVersion; - } - - /** - * Get the upgradeSettings property: Settings for upgrading the agentpool. - * - * @return the upgradeSettings value. - */ - public AgentPoolUpgradeSettings upgradeSettings() { - return this.upgradeSettings; - } - - /** - * Set the upgradeSettings property: Settings for upgrading the agentpool. - * - * @param upgradeSettings the upgradeSettings value to set. - * @return the ManagedClusterAgentPoolProfileProperties object itself. - */ - public ManagedClusterAgentPoolProfileProperties withUpgradeSettings(AgentPoolUpgradeSettings upgradeSettings) { - this.upgradeSettings = upgradeSettings; - return this; - } - - /** - * Get the provisioningState property: The current deployment or provisioning state, which only appears in the - * response. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Get the powerState property: Describes whether the Agent Pool is Running or Stopped. - * - * @return the powerState value. - */ - public PowerState powerState() { - return this.powerState; - } - - /** - * Get the availabilityZones property: Availability zones for nodes. Must use VirtualMachineScaleSets AgentPoolType. - * - * @return the availabilityZones value. - */ - public List availabilityZones() { - return this.availabilityZones; - } - - /** - * Set the availabilityZones property: Availability zones for nodes. Must use VirtualMachineScaleSets AgentPoolType. - * - * @param availabilityZones the availabilityZones value to set. - * @return the ManagedClusterAgentPoolProfileProperties object itself. - */ - public ManagedClusterAgentPoolProfileProperties withAvailabilityZones(List availabilityZones) { - this.availabilityZones = availabilityZones; - return this; - } - - /** - * Get the enableNodePublicIp property: Enable public IP for nodes. - * - * @return the enableNodePublicIp value. - */ - public Boolean enableNodePublicIp() { - return this.enableNodePublicIp; - } - - /** - * Set the enableNodePublicIp property: Enable public IP for nodes. - * - * @param enableNodePublicIp the enableNodePublicIp value to set. - * @return the ManagedClusterAgentPoolProfileProperties object itself. - */ - public ManagedClusterAgentPoolProfileProperties withEnableNodePublicIp(Boolean enableNodePublicIp) { - this.enableNodePublicIp = enableNodePublicIp; - return this; - } - - /** - * Get the scaleSetPriority property: ScaleSetPriority to be used to specify virtual machine scale set priority. - * Default to regular. - * - * @return the scaleSetPriority value. - */ - public ScaleSetPriority scaleSetPriority() { - return this.scaleSetPriority; - } - - /** - * Set the scaleSetPriority property: ScaleSetPriority to be used to specify virtual machine scale set priority. - * Default to regular. - * - * @param scaleSetPriority the scaleSetPriority value to set. - * @return the ManagedClusterAgentPoolProfileProperties object itself. - */ - public ManagedClusterAgentPoolProfileProperties withScaleSetPriority(ScaleSetPriority scaleSetPriority) { - this.scaleSetPriority = scaleSetPriority; - return this; - } - - /** - * Get the scaleSetEvictionPolicy property: ScaleSetEvictionPolicy to be used to specify eviction policy for Spot - * virtual machine scale set. Default to Delete. - * - * @return the scaleSetEvictionPolicy value. - */ - public ScaleSetEvictionPolicy scaleSetEvictionPolicy() { - return this.scaleSetEvictionPolicy; - } - - /** - * Set the scaleSetEvictionPolicy property: ScaleSetEvictionPolicy to be used to specify eviction policy for Spot - * virtual machine scale set. Default to Delete. - * - * @param scaleSetEvictionPolicy the scaleSetEvictionPolicy value to set. - * @return the ManagedClusterAgentPoolProfileProperties object itself. - */ - public ManagedClusterAgentPoolProfileProperties withScaleSetEvictionPolicy( - ScaleSetEvictionPolicy scaleSetEvictionPolicy) { - this.scaleSetEvictionPolicy = scaleSetEvictionPolicy; - return this; - } - - /** - * Get the spotMaxPrice property: SpotMaxPrice to be used to specify the maximum price you are willing to pay in US - * Dollars. Possible values are any decimal value greater than zero or -1 which indicates default price to be up-to - * on-demand. - * - * @return the spotMaxPrice value. - */ - public Float spotMaxPrice() { - return this.spotMaxPrice; - } - - /** - * Set the spotMaxPrice property: SpotMaxPrice to be used to specify the maximum price you are willing to pay in US - * Dollars. Possible values are any decimal value greater than zero or -1 which indicates default price to be up-to - * on-demand. - * - * @param spotMaxPrice the spotMaxPrice value to set. - * @return the ManagedClusterAgentPoolProfileProperties object itself. - */ - public ManagedClusterAgentPoolProfileProperties withSpotMaxPrice(Float spotMaxPrice) { - this.spotMaxPrice = spotMaxPrice; - return this; - } - - /** - * Get the tags property: Agent pool tags to be persisted on the agent pool virtual machine scale set. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Agent pool tags to be persisted on the agent pool virtual machine scale set. - * - * @param tags the tags value to set. - * @return the ManagedClusterAgentPoolProfileProperties object itself. - */ - public ManagedClusterAgentPoolProfileProperties withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Get the nodeLabels property: Agent pool node labels to be persisted across all nodes in agent pool. - * - * @return the nodeLabels value. - */ - public Map nodeLabels() { - return this.nodeLabels; - } - - /** - * Set the nodeLabels property: Agent pool node labels to be persisted across all nodes in agent pool. - * - * @param nodeLabels the nodeLabels value to set. - * @return the ManagedClusterAgentPoolProfileProperties object itself. - */ - public ManagedClusterAgentPoolProfileProperties withNodeLabels(Map nodeLabels) { - this.nodeLabels = nodeLabels; - return this; - } - - /** - * Get the nodeTaints property: Taints added to new nodes during node pool create and scale. For example, - * key=value:NoSchedule. - * - * @return the nodeTaints value. - */ - public List nodeTaints() { - return this.nodeTaints; - } - - /** - * Set the nodeTaints property: Taints added to new nodes during node pool create and scale. For example, - * key=value:NoSchedule. - * - * @param nodeTaints the nodeTaints value to set. - * @return the ManagedClusterAgentPoolProfileProperties object itself. - */ - public ManagedClusterAgentPoolProfileProperties withNodeTaints(List nodeTaints) { - this.nodeTaints = nodeTaints; - return this; - } - - /** - * Get the proximityPlacementGroupId property: The ID for Proximity Placement Group. - * - * @return the proximityPlacementGroupId value. - */ - public String proximityPlacementGroupId() { - return this.proximityPlacementGroupId; - } - - /** - * Set the proximityPlacementGroupId property: The ID for Proximity Placement Group. - * - * @param proximityPlacementGroupId the proximityPlacementGroupId value to set. - * @return the ManagedClusterAgentPoolProfileProperties object itself. - */ - public ManagedClusterAgentPoolProfileProperties withProximityPlacementGroupId(String proximityPlacementGroupId) { - this.proximityPlacementGroupId = proximityPlacementGroupId; - return this; - } - - /** - * Get the kubeletConfig property: KubeletConfig specifies the configuration of kubelet on agent nodes. - * - * @return the kubeletConfig value. - */ - public KubeletConfig kubeletConfig() { - return this.kubeletConfig; - } - - /** - * Set the kubeletConfig property: KubeletConfig specifies the configuration of kubelet on agent nodes. - * - * @param kubeletConfig the kubeletConfig value to set. - * @return the ManagedClusterAgentPoolProfileProperties object itself. - */ - public ManagedClusterAgentPoolProfileProperties withKubeletConfig(KubeletConfig kubeletConfig) { - this.kubeletConfig = kubeletConfig; - return this; - } - - /** - * Get the linuxOSConfig property: LinuxOSConfig specifies the OS configuration of linux agent nodes. - * - * @return the linuxOSConfig value. - */ - public LinuxOSConfig linuxOSConfig() { - return this.linuxOSConfig; - } - - /** - * Set the linuxOSConfig property: LinuxOSConfig specifies the OS configuration of linux agent nodes. - * - * @param linuxOSConfig the linuxOSConfig value to set. - * @return the ManagedClusterAgentPoolProfileProperties object itself. - */ - public ManagedClusterAgentPoolProfileProperties withLinuxOSConfig(LinuxOSConfig linuxOSConfig) { - this.linuxOSConfig = linuxOSConfig; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (upgradeSettings() != null) { - upgradeSettings().validate(); - } - if (powerState() != null) { - powerState().validate(); - } - if (kubeletConfig() != null) { - kubeletConfig().validate(); - } - if (linuxOSConfig() != null) { - linuxOSConfig().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/models/ManagedClusterInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/models/ManagedClusterInner.java deleted file mode 100644 index 552fc76843b0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/models/ManagedClusterInner.java +++ /dev/null @@ -1,600 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.containerservice.models.ContainerServiceLinuxProfile; -import com.azure.resourcemanager.containerservice.models.ContainerServiceNetworkProfile; -import com.azure.resourcemanager.containerservice.models.ManagedClusterAadProfile; -import com.azure.resourcemanager.containerservice.models.ManagedClusterAddonProfile; -import com.azure.resourcemanager.containerservice.models.ManagedClusterAgentPoolProfile; -import com.azure.resourcemanager.containerservice.models.ManagedClusterApiServerAccessProfile; -import com.azure.resourcemanager.containerservice.models.ManagedClusterAutoUpgradeProfile; -import com.azure.resourcemanager.containerservice.models.ManagedClusterIdentity; -import com.azure.resourcemanager.containerservice.models.ManagedClusterPodIdentityProfile; -import com.azure.resourcemanager.containerservice.models.ManagedClusterPropertiesAutoScalerProfile; -import com.azure.resourcemanager.containerservice.models.ManagedClusterPropertiesIdentityProfile; -import com.azure.resourcemanager.containerservice.models.ManagedClusterServicePrincipalProfile; -import com.azure.resourcemanager.containerservice.models.ManagedClusterSku; -import com.azure.resourcemanager.containerservice.models.ManagedClusterWindowsProfile; -import com.azure.resourcemanager.containerservice.models.PowerState; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** Managed cluster. */ -@Fluent -public final class ManagedClusterInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedClusterInner.class); - - /* - * The managed cluster SKU. - */ - @JsonProperty(value = "sku") - private ManagedClusterSku sku; - - /* - * Properties of a managed cluster. - */ - @JsonProperty(value = "properties") - private ManagedClusterProperties innerProperties; - - /* - * The identity of the managed cluster, if configured. - */ - @JsonProperty(value = "identity") - private ManagedClusterIdentity identity; - - /** - * Get the sku property: The managed cluster SKU. - * - * @return the sku value. - */ - public ManagedClusterSku sku() { - return this.sku; - } - - /** - * Set the sku property: The managed cluster SKU. - * - * @param sku the sku value to set. - * @return the ManagedClusterInner object itself. - */ - public ManagedClusterInner withSku(ManagedClusterSku sku) { - this.sku = sku; - return this; - } - - /** - * Get the innerProperties property: Properties of a managed cluster. - * - * @return the innerProperties value. - */ - private ManagedClusterProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the identity property: The identity of the managed cluster, if configured. - * - * @return the identity value. - */ - public ManagedClusterIdentity identity() { - return this.identity; - } - - /** - * Set the identity property: The identity of the managed cluster, if configured. - * - * @param identity the identity value to set. - * @return the ManagedClusterInner object itself. - */ - public ManagedClusterInner withIdentity(ManagedClusterIdentity identity) { - this.identity = identity; - return this; - } - - /** {@inheritDoc} */ - @Override - public ManagedClusterInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public ManagedClusterInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the provisioningState property: The current deployment or provisioning state, which only appears in the - * response. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the powerState property: Represents the Power State of the cluster. - * - * @return the powerState value. - */ - public PowerState powerState() { - return this.innerProperties() == null ? null : this.innerProperties().powerState(); - } - - /** - * Get the maxAgentPools property: The max number of agent pools for the managed cluster. - * - * @return the maxAgentPools value. - */ - public Integer maxAgentPools() { - return this.innerProperties() == null ? null : this.innerProperties().maxAgentPools(); - } - - /** - * Get the kubernetesVersion property: Version of Kubernetes specified when creating the managed cluster. - * - * @return the kubernetesVersion value. - */ - public String kubernetesVersion() { - return this.innerProperties() == null ? null : this.innerProperties().kubernetesVersion(); - } - - /** - * Set the kubernetesVersion property: Version of Kubernetes specified when creating the managed cluster. - * - * @param kubernetesVersion the kubernetesVersion value to set. - * @return the ManagedClusterInner object itself. - */ - public ManagedClusterInner withKubernetesVersion(String kubernetesVersion) { - if (this.innerProperties() == null) { - this.innerProperties = new ManagedClusterProperties(); - } - this.innerProperties().withKubernetesVersion(kubernetesVersion); - return this; - } - - /** - * Get the dnsPrefix property: DNS prefix specified when creating the managed cluster. - * - * @return the dnsPrefix value. - */ - public String dnsPrefix() { - return this.innerProperties() == null ? null : this.innerProperties().dnsPrefix(); - } - - /** - * Set the dnsPrefix property: DNS prefix specified when creating the managed cluster. - * - * @param dnsPrefix the dnsPrefix value to set. - * @return the ManagedClusterInner object itself. - */ - public ManagedClusterInner withDnsPrefix(String dnsPrefix) { - if (this.innerProperties() == null) { - this.innerProperties = new ManagedClusterProperties(); - } - this.innerProperties().withDnsPrefix(dnsPrefix); - return this; - } - - /** - * Get the fqdn property: FQDN for the master pool. - * - * @return the fqdn value. - */ - public String fqdn() { - return this.innerProperties() == null ? null : this.innerProperties().fqdn(); - } - - /** - * Get the privateFqdn property: FQDN of private cluster. - * - * @return the privateFqdn value. - */ - public String privateFqdn() { - return this.innerProperties() == null ? null : this.innerProperties().privateFqdn(); - } - - /** - * Get the agentPoolProfiles property: Properties of the agent pool. - * - * @return the agentPoolProfiles value. - */ - public List agentPoolProfiles() { - return this.innerProperties() == null ? null : this.innerProperties().agentPoolProfiles(); - } - - /** - * Set the agentPoolProfiles property: Properties of the agent pool. - * - * @param agentPoolProfiles the agentPoolProfiles value to set. - * @return the ManagedClusterInner object itself. - */ - public ManagedClusterInner withAgentPoolProfiles(List agentPoolProfiles) { - if (this.innerProperties() == null) { - this.innerProperties = new ManagedClusterProperties(); - } - this.innerProperties().withAgentPoolProfiles(agentPoolProfiles); - return this; - } - - /** - * Get the linuxProfile property: Profile for Linux VMs in the container service cluster. - * - * @return the linuxProfile value. - */ - public ContainerServiceLinuxProfile linuxProfile() { - return this.innerProperties() == null ? null : this.innerProperties().linuxProfile(); - } - - /** - * Set the linuxProfile property: Profile for Linux VMs in the container service cluster. - * - * @param linuxProfile the linuxProfile value to set. - * @return the ManagedClusterInner object itself. - */ - public ManagedClusterInner withLinuxProfile(ContainerServiceLinuxProfile linuxProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new ManagedClusterProperties(); - } - this.innerProperties().withLinuxProfile(linuxProfile); - return this; - } - - /** - * Get the windowsProfile property: Profile for Windows VMs in the container service cluster. - * - * @return the windowsProfile value. - */ - public ManagedClusterWindowsProfile windowsProfile() { - return this.innerProperties() == null ? null : this.innerProperties().windowsProfile(); - } - - /** - * Set the windowsProfile property: Profile for Windows VMs in the container service cluster. - * - * @param windowsProfile the windowsProfile value to set. - * @return the ManagedClusterInner object itself. - */ - public ManagedClusterInner withWindowsProfile(ManagedClusterWindowsProfile windowsProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new ManagedClusterProperties(); - } - this.innerProperties().withWindowsProfile(windowsProfile); - return this; - } - - /** - * Get the servicePrincipalProfile property: Information about a service principal identity for the cluster to use - * for manipulating Azure APIs. - * - * @return the servicePrincipalProfile value. - */ - public ManagedClusterServicePrincipalProfile servicePrincipalProfile() { - return this.innerProperties() == null ? null : this.innerProperties().servicePrincipalProfile(); - } - - /** - * Set the servicePrincipalProfile property: Information about a service principal identity for the cluster to use - * for manipulating Azure APIs. - * - * @param servicePrincipalProfile the servicePrincipalProfile value to set. - * @return the ManagedClusterInner object itself. - */ - public ManagedClusterInner withServicePrincipalProfile( - ManagedClusterServicePrincipalProfile servicePrincipalProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new ManagedClusterProperties(); - } - this.innerProperties().withServicePrincipalProfile(servicePrincipalProfile); - return this; - } - - /** - * Get the addonProfiles property: Profile of managed cluster add-on. - * - * @return the addonProfiles value. - */ - public Map addonProfiles() { - return this.innerProperties() == null ? null : this.innerProperties().addonProfiles(); - } - - /** - * Set the addonProfiles property: Profile of managed cluster add-on. - * - * @param addonProfiles the addonProfiles value to set. - * @return the ManagedClusterInner object itself. - */ - public ManagedClusterInner withAddonProfiles(Map addonProfiles) { - if (this.innerProperties() == null) { - this.innerProperties = new ManagedClusterProperties(); - } - this.innerProperties().withAddonProfiles(addonProfiles); - return this; - } - - /** - * Get the podIdentityProfile property: Profile of managed cluster pod identity. - * - * @return the podIdentityProfile value. - */ - public ManagedClusterPodIdentityProfile podIdentityProfile() { - return this.innerProperties() == null ? null : this.innerProperties().podIdentityProfile(); - } - - /** - * Set the podIdentityProfile property: Profile of managed cluster pod identity. - * - * @param podIdentityProfile the podIdentityProfile value to set. - * @return the ManagedClusterInner object itself. - */ - public ManagedClusterInner withPodIdentityProfile(ManagedClusterPodIdentityProfile podIdentityProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new ManagedClusterProperties(); - } - this.innerProperties().withPodIdentityProfile(podIdentityProfile); - return this; - } - - /** - * Get the nodeResourceGroup property: Name of the resource group containing agent pool nodes. - * - * @return the nodeResourceGroup value. - */ - public String nodeResourceGroup() { - return this.innerProperties() == null ? null : this.innerProperties().nodeResourceGroup(); - } - - /** - * Set the nodeResourceGroup property: Name of the resource group containing agent pool nodes. - * - * @param nodeResourceGroup the nodeResourceGroup value to set. - * @return the ManagedClusterInner object itself. - */ - public ManagedClusterInner withNodeResourceGroup(String nodeResourceGroup) { - if (this.innerProperties() == null) { - this.innerProperties = new ManagedClusterProperties(); - } - this.innerProperties().withNodeResourceGroup(nodeResourceGroup); - return this; - } - - /** - * Get the enableRbac property: Whether to enable Kubernetes Role-Based Access Control. - * - * @return the enableRbac value. - */ - public Boolean enableRbac() { - return this.innerProperties() == null ? null : this.innerProperties().enableRbac(); - } - - /** - * Set the enableRbac property: Whether to enable Kubernetes Role-Based Access Control. - * - * @param enableRbac the enableRbac value to set. - * @return the ManagedClusterInner object itself. - */ - public ManagedClusterInner withEnableRbac(Boolean enableRbac) { - if (this.innerProperties() == null) { - this.innerProperties = new ManagedClusterProperties(); - } - this.innerProperties().withEnableRbac(enableRbac); - return this; - } - - /** - * Get the enablePodSecurityPolicy property: (DEPRECATING) Whether to enable Kubernetes pod security policy - * (preview). This feature is set for removal on October 15th, 2020. Learn more at aka.ms/aks/azpodpolicy. - * - * @return the enablePodSecurityPolicy value. - */ - public Boolean enablePodSecurityPolicy() { - return this.innerProperties() == null ? null : this.innerProperties().enablePodSecurityPolicy(); - } - - /** - * Set the enablePodSecurityPolicy property: (DEPRECATING) Whether to enable Kubernetes pod security policy - * (preview). This feature is set for removal on October 15th, 2020. Learn more at aka.ms/aks/azpodpolicy. - * - * @param enablePodSecurityPolicy the enablePodSecurityPolicy value to set. - * @return the ManagedClusterInner object itself. - */ - public ManagedClusterInner withEnablePodSecurityPolicy(Boolean enablePodSecurityPolicy) { - if (this.innerProperties() == null) { - this.innerProperties = new ManagedClusterProperties(); - } - this.innerProperties().withEnablePodSecurityPolicy(enablePodSecurityPolicy); - return this; - } - - /** - * Get the networkProfile property: Profile of network configuration. - * - * @return the networkProfile value. - */ - public ContainerServiceNetworkProfile networkProfile() { - return this.innerProperties() == null ? null : this.innerProperties().networkProfile(); - } - - /** - * Set the networkProfile property: Profile of network configuration. - * - * @param networkProfile the networkProfile value to set. - * @return the ManagedClusterInner object itself. - */ - public ManagedClusterInner withNetworkProfile(ContainerServiceNetworkProfile networkProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new ManagedClusterProperties(); - } - this.innerProperties().withNetworkProfile(networkProfile); - return this; - } - - /** - * Get the aadProfile property: Profile of Azure Active Directory configuration. - * - * @return the aadProfile value. - */ - public ManagedClusterAadProfile aadProfile() { - return this.innerProperties() == null ? null : this.innerProperties().aadProfile(); - } - - /** - * Set the aadProfile property: Profile of Azure Active Directory configuration. - * - * @param aadProfile the aadProfile value to set. - * @return the ManagedClusterInner object itself. - */ - public ManagedClusterInner withAadProfile(ManagedClusterAadProfile aadProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new ManagedClusterProperties(); - } - this.innerProperties().withAadProfile(aadProfile); - return this; - } - - /** - * Get the autoUpgradeProfile property: Profile of auto upgrade configuration. - * - * @return the autoUpgradeProfile value. - */ - public ManagedClusterAutoUpgradeProfile autoUpgradeProfile() { - return this.innerProperties() == null ? null : this.innerProperties().autoUpgradeProfile(); - } - - /** - * Set the autoUpgradeProfile property: Profile of auto upgrade configuration. - * - * @param autoUpgradeProfile the autoUpgradeProfile value to set. - * @return the ManagedClusterInner object itself. - */ - public ManagedClusterInner withAutoUpgradeProfile(ManagedClusterAutoUpgradeProfile autoUpgradeProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new ManagedClusterProperties(); - } - this.innerProperties().withAutoUpgradeProfile(autoUpgradeProfile); - return this; - } - - /** - * Get the autoScalerProfile property: Parameters to be applied to the cluster-autoscaler when enabled. - * - * @return the autoScalerProfile value. - */ - public ManagedClusterPropertiesAutoScalerProfile autoScalerProfile() { - return this.innerProperties() == null ? null : this.innerProperties().autoScalerProfile(); - } - - /** - * Set the autoScalerProfile property: Parameters to be applied to the cluster-autoscaler when enabled. - * - * @param autoScalerProfile the autoScalerProfile value to set. - * @return the ManagedClusterInner object itself. - */ - public ManagedClusterInner withAutoScalerProfile(ManagedClusterPropertiesAutoScalerProfile autoScalerProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new ManagedClusterProperties(); - } - this.innerProperties().withAutoScalerProfile(autoScalerProfile); - return this; - } - - /** - * Get the apiServerAccessProfile property: Access profile for managed cluster API server. - * - * @return the apiServerAccessProfile value. - */ - public ManagedClusterApiServerAccessProfile apiServerAccessProfile() { - return this.innerProperties() == null ? null : this.innerProperties().apiServerAccessProfile(); - } - - /** - * Set the apiServerAccessProfile property: Access profile for managed cluster API server. - * - * @param apiServerAccessProfile the apiServerAccessProfile value to set. - * @return the ManagedClusterInner object itself. - */ - public ManagedClusterInner withApiServerAccessProfile(ManagedClusterApiServerAccessProfile apiServerAccessProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new ManagedClusterProperties(); - } - this.innerProperties().withApiServerAccessProfile(apiServerAccessProfile); - return this; - } - - /** - * Get the diskEncryptionSetId property: ResourceId of the disk encryption set to use for enabling encryption at - * rest. - * - * @return the diskEncryptionSetId value. - */ - public String diskEncryptionSetId() { - return this.innerProperties() == null ? null : this.innerProperties().diskEncryptionSetId(); - } - - /** - * Set the diskEncryptionSetId property: ResourceId of the disk encryption set to use for enabling encryption at - * rest. - * - * @param diskEncryptionSetId the diskEncryptionSetId value to set. - * @return the ManagedClusterInner object itself. - */ - public ManagedClusterInner withDiskEncryptionSetId(String diskEncryptionSetId) { - if (this.innerProperties() == null) { - this.innerProperties = new ManagedClusterProperties(); - } - this.innerProperties().withDiskEncryptionSetId(diskEncryptionSetId); - return this; - } - - /** - * Get the identityProfile property: Identities associated with the cluster. - * - * @return the identityProfile value. - */ - public Map identityProfile() { - return this.innerProperties() == null ? null : this.innerProperties().identityProfile(); - } - - /** - * Set the identityProfile property: Identities associated with the cluster. - * - * @param identityProfile the identityProfile value to set. - * @return the ManagedClusterInner object itself. - */ - public ManagedClusterInner withIdentityProfile( - Map identityProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new ManagedClusterProperties(); - } - this.innerProperties().withIdentityProfile(identityProfile); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (sku() != null) { - sku().validate(); - } - if (innerProperties() != null) { - innerProperties().validate(); - } - if (identity() != null) { - identity().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/models/ManagedClusterProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/models/ManagedClusterProperties.java deleted file mode 100644 index b018e65b7fa6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/models/ManagedClusterProperties.java +++ /dev/null @@ -1,653 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.containerservice.models.ContainerServiceLinuxProfile; -import com.azure.resourcemanager.containerservice.models.ContainerServiceNetworkProfile; -import com.azure.resourcemanager.containerservice.models.ManagedClusterAadProfile; -import com.azure.resourcemanager.containerservice.models.ManagedClusterAddonProfile; -import com.azure.resourcemanager.containerservice.models.ManagedClusterAgentPoolProfile; -import com.azure.resourcemanager.containerservice.models.ManagedClusterApiServerAccessProfile; -import com.azure.resourcemanager.containerservice.models.ManagedClusterAutoUpgradeProfile; -import com.azure.resourcemanager.containerservice.models.ManagedClusterPodIdentityProfile; -import com.azure.resourcemanager.containerservice.models.ManagedClusterPropertiesAutoScalerProfile; -import com.azure.resourcemanager.containerservice.models.ManagedClusterPropertiesIdentityProfile; -import com.azure.resourcemanager.containerservice.models.ManagedClusterServicePrincipalProfile; -import com.azure.resourcemanager.containerservice.models.ManagedClusterWindowsProfile; -import com.azure.resourcemanager.containerservice.models.PowerState; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** Properties of the managed cluster. */ -@Fluent -public final class ManagedClusterProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedClusterProperties.class); - - /* - * The current deployment or provisioning state, which only appears in the - * response. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; - - /* - * Represents the Power State of the cluster - */ - @JsonProperty(value = "powerState", access = JsonProperty.Access.WRITE_ONLY) - private PowerState powerState; - - /* - * The max number of agent pools for the managed cluster. - */ - @JsonProperty(value = "maxAgentPools", access = JsonProperty.Access.WRITE_ONLY) - private Integer maxAgentPools; - - /* - * Version of Kubernetes specified when creating the managed cluster. - */ - @JsonProperty(value = "kubernetesVersion") - private String kubernetesVersion; - - /* - * DNS prefix specified when creating the managed cluster. - */ - @JsonProperty(value = "dnsPrefix") - private String dnsPrefix; - - /* - * FQDN for the master pool. - */ - @JsonProperty(value = "fqdn", access = JsonProperty.Access.WRITE_ONLY) - private String fqdn; - - /* - * FQDN of private cluster. - */ - @JsonProperty(value = "privateFQDN", access = JsonProperty.Access.WRITE_ONLY) - private String privateFqdn; - - /* - * Properties of the agent pool. - */ - @JsonProperty(value = "agentPoolProfiles") - private List agentPoolProfiles; - - /* - * Profile for Linux VMs in the container service cluster. - */ - @JsonProperty(value = "linuxProfile") - private ContainerServiceLinuxProfile linuxProfile; - - /* - * Profile for Windows VMs in the container service cluster. - */ - @JsonProperty(value = "windowsProfile") - private ManagedClusterWindowsProfile windowsProfile; - - /* - * Information about a service principal identity for the cluster to use - * for manipulating Azure APIs. - */ - @JsonProperty(value = "servicePrincipalProfile") - private ManagedClusterServicePrincipalProfile servicePrincipalProfile; - - /* - * Profile of managed cluster add-on. - */ - @JsonProperty(value = "addonProfiles") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map addonProfiles; - - /* - * Profile of managed cluster pod identity. - */ - @JsonProperty(value = "podIdentityProfile") - private ManagedClusterPodIdentityProfile podIdentityProfile; - - /* - * Name of the resource group containing agent pool nodes. - */ - @JsonProperty(value = "nodeResourceGroup") - private String nodeResourceGroup; - - /* - * Whether to enable Kubernetes Role-Based Access Control. - */ - @JsonProperty(value = "enableRBAC") - private Boolean enableRbac; - - /* - * (DEPRECATING) Whether to enable Kubernetes pod security policy - * (preview). This feature is set for removal on October 15th, 2020. Learn - * more at aka.ms/aks/azpodpolicy. - */ - @JsonProperty(value = "enablePodSecurityPolicy") - private Boolean enablePodSecurityPolicy; - - /* - * Profile of network configuration. - */ - @JsonProperty(value = "networkProfile") - private ContainerServiceNetworkProfile networkProfile; - - /* - * Profile of Azure Active Directory configuration. - */ - @JsonProperty(value = "aadProfile") - private ManagedClusterAadProfile aadProfile; - - /* - * Profile of auto upgrade configuration. - */ - @JsonProperty(value = "autoUpgradeProfile") - private ManagedClusterAutoUpgradeProfile autoUpgradeProfile; - - /* - * Parameters to be applied to the cluster-autoscaler when enabled - */ - @JsonProperty(value = "autoScalerProfile") - private ManagedClusterPropertiesAutoScalerProfile autoScalerProfile; - - /* - * Access profile for managed cluster API server. - */ - @JsonProperty(value = "apiServerAccessProfile") - private ManagedClusterApiServerAccessProfile apiServerAccessProfile; - - /* - * ResourceId of the disk encryption set to use for enabling encryption at - * rest. - */ - @JsonProperty(value = "diskEncryptionSetID") - private String diskEncryptionSetId; - - /* - * Identities associated with the cluster. - */ - @JsonProperty(value = "identityProfile") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map identityProfile; - - /** - * Get the provisioningState property: The current deployment or provisioning state, which only appears in the - * response. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Get the powerState property: Represents the Power State of the cluster. - * - * @return the powerState value. - */ - public PowerState powerState() { - return this.powerState; - } - - /** - * Get the maxAgentPools property: The max number of agent pools for the managed cluster. - * - * @return the maxAgentPools value. - */ - public Integer maxAgentPools() { - return this.maxAgentPools; - } - - /** - * Get the kubernetesVersion property: Version of Kubernetes specified when creating the managed cluster. - * - * @return the kubernetesVersion value. - */ - public String kubernetesVersion() { - return this.kubernetesVersion; - } - - /** - * Set the kubernetesVersion property: Version of Kubernetes specified when creating the managed cluster. - * - * @param kubernetesVersion the kubernetesVersion value to set. - * @return the ManagedClusterProperties object itself. - */ - public ManagedClusterProperties withKubernetesVersion(String kubernetesVersion) { - this.kubernetesVersion = kubernetesVersion; - return this; - } - - /** - * Get the dnsPrefix property: DNS prefix specified when creating the managed cluster. - * - * @return the dnsPrefix value. - */ - public String dnsPrefix() { - return this.dnsPrefix; - } - - /** - * Set the dnsPrefix property: DNS prefix specified when creating the managed cluster. - * - * @param dnsPrefix the dnsPrefix value to set. - * @return the ManagedClusterProperties object itself. - */ - public ManagedClusterProperties withDnsPrefix(String dnsPrefix) { - this.dnsPrefix = dnsPrefix; - return this; - } - - /** - * Get the fqdn property: FQDN for the master pool. - * - * @return the fqdn value. - */ - public String fqdn() { - return this.fqdn; - } - - /** - * Get the privateFqdn property: FQDN of private cluster. - * - * @return the privateFqdn value. - */ - public String privateFqdn() { - return this.privateFqdn; - } - - /** - * Get the agentPoolProfiles property: Properties of the agent pool. - * - * @return the agentPoolProfiles value. - */ - public List agentPoolProfiles() { - return this.agentPoolProfiles; - } - - /** - * Set the agentPoolProfiles property: Properties of the agent pool. - * - * @param agentPoolProfiles the agentPoolProfiles value to set. - * @return the ManagedClusterProperties object itself. - */ - public ManagedClusterProperties withAgentPoolProfiles(List agentPoolProfiles) { - this.agentPoolProfiles = agentPoolProfiles; - return this; - } - - /** - * Get the linuxProfile property: Profile for Linux VMs in the container service cluster. - * - * @return the linuxProfile value. - */ - public ContainerServiceLinuxProfile linuxProfile() { - return this.linuxProfile; - } - - /** - * Set the linuxProfile property: Profile for Linux VMs in the container service cluster. - * - * @param linuxProfile the linuxProfile value to set. - * @return the ManagedClusterProperties object itself. - */ - public ManagedClusterProperties withLinuxProfile(ContainerServiceLinuxProfile linuxProfile) { - this.linuxProfile = linuxProfile; - return this; - } - - /** - * Get the windowsProfile property: Profile for Windows VMs in the container service cluster. - * - * @return the windowsProfile value. - */ - public ManagedClusterWindowsProfile windowsProfile() { - return this.windowsProfile; - } - - /** - * Set the windowsProfile property: Profile for Windows VMs in the container service cluster. - * - * @param windowsProfile the windowsProfile value to set. - * @return the ManagedClusterProperties object itself. - */ - public ManagedClusterProperties withWindowsProfile(ManagedClusterWindowsProfile windowsProfile) { - this.windowsProfile = windowsProfile; - return this; - } - - /** - * Get the servicePrincipalProfile property: Information about a service principal identity for the cluster to use - * for manipulating Azure APIs. - * - * @return the servicePrincipalProfile value. - */ - public ManagedClusterServicePrincipalProfile servicePrincipalProfile() { - return this.servicePrincipalProfile; - } - - /** - * Set the servicePrincipalProfile property: Information about a service principal identity for the cluster to use - * for manipulating Azure APIs. - * - * @param servicePrincipalProfile the servicePrincipalProfile value to set. - * @return the ManagedClusterProperties object itself. - */ - public ManagedClusterProperties withServicePrincipalProfile( - ManagedClusterServicePrincipalProfile servicePrincipalProfile) { - this.servicePrincipalProfile = servicePrincipalProfile; - return this; - } - - /** - * Get the addonProfiles property: Profile of managed cluster add-on. - * - * @return the addonProfiles value. - */ - public Map addonProfiles() { - return this.addonProfiles; - } - - /** - * Set the addonProfiles property: Profile of managed cluster add-on. - * - * @param addonProfiles the addonProfiles value to set. - * @return the ManagedClusterProperties object itself. - */ - public ManagedClusterProperties withAddonProfiles(Map addonProfiles) { - this.addonProfiles = addonProfiles; - return this; - } - - /** - * Get the podIdentityProfile property: Profile of managed cluster pod identity. - * - * @return the podIdentityProfile value. - */ - public ManagedClusterPodIdentityProfile podIdentityProfile() { - return this.podIdentityProfile; - } - - /** - * Set the podIdentityProfile property: Profile of managed cluster pod identity. - * - * @param podIdentityProfile the podIdentityProfile value to set. - * @return the ManagedClusterProperties object itself. - */ - public ManagedClusterProperties withPodIdentityProfile(ManagedClusterPodIdentityProfile podIdentityProfile) { - this.podIdentityProfile = podIdentityProfile; - return this; - } - - /** - * Get the nodeResourceGroup property: Name of the resource group containing agent pool nodes. - * - * @return the nodeResourceGroup value. - */ - public String nodeResourceGroup() { - return this.nodeResourceGroup; - } - - /** - * Set the nodeResourceGroup property: Name of the resource group containing agent pool nodes. - * - * @param nodeResourceGroup the nodeResourceGroup value to set. - * @return the ManagedClusterProperties object itself. - */ - public ManagedClusterProperties withNodeResourceGroup(String nodeResourceGroup) { - this.nodeResourceGroup = nodeResourceGroup; - return this; - } - - /** - * Get the enableRbac property: Whether to enable Kubernetes Role-Based Access Control. - * - * @return the enableRbac value. - */ - public Boolean enableRbac() { - return this.enableRbac; - } - - /** - * Set the enableRbac property: Whether to enable Kubernetes Role-Based Access Control. - * - * @param enableRbac the enableRbac value to set. - * @return the ManagedClusterProperties object itself. - */ - public ManagedClusterProperties withEnableRbac(Boolean enableRbac) { - this.enableRbac = enableRbac; - return this; - } - - /** - * Get the enablePodSecurityPolicy property: (DEPRECATING) Whether to enable Kubernetes pod security policy - * (preview). This feature is set for removal on October 15th, 2020. Learn more at aka.ms/aks/azpodpolicy. - * - * @return the enablePodSecurityPolicy value. - */ - public Boolean enablePodSecurityPolicy() { - return this.enablePodSecurityPolicy; - } - - /** - * Set the enablePodSecurityPolicy property: (DEPRECATING) Whether to enable Kubernetes pod security policy - * (preview). This feature is set for removal on October 15th, 2020. Learn more at aka.ms/aks/azpodpolicy. - * - * @param enablePodSecurityPolicy the enablePodSecurityPolicy value to set. - * @return the ManagedClusterProperties object itself. - */ - public ManagedClusterProperties withEnablePodSecurityPolicy(Boolean enablePodSecurityPolicy) { - this.enablePodSecurityPolicy = enablePodSecurityPolicy; - return this; - } - - /** - * Get the networkProfile property: Profile of network configuration. - * - * @return the networkProfile value. - */ - public ContainerServiceNetworkProfile networkProfile() { - return this.networkProfile; - } - - /** - * Set the networkProfile property: Profile of network configuration. - * - * @param networkProfile the networkProfile value to set. - * @return the ManagedClusterProperties object itself. - */ - public ManagedClusterProperties withNetworkProfile(ContainerServiceNetworkProfile networkProfile) { - this.networkProfile = networkProfile; - return this; - } - - /** - * Get the aadProfile property: Profile of Azure Active Directory configuration. - * - * @return the aadProfile value. - */ - public ManagedClusterAadProfile aadProfile() { - return this.aadProfile; - } - - /** - * Set the aadProfile property: Profile of Azure Active Directory configuration. - * - * @param aadProfile the aadProfile value to set. - * @return the ManagedClusterProperties object itself. - */ - public ManagedClusterProperties withAadProfile(ManagedClusterAadProfile aadProfile) { - this.aadProfile = aadProfile; - return this; - } - - /** - * Get the autoUpgradeProfile property: Profile of auto upgrade configuration. - * - * @return the autoUpgradeProfile value. - */ - public ManagedClusterAutoUpgradeProfile autoUpgradeProfile() { - return this.autoUpgradeProfile; - } - - /** - * Set the autoUpgradeProfile property: Profile of auto upgrade configuration. - * - * @param autoUpgradeProfile the autoUpgradeProfile value to set. - * @return the ManagedClusterProperties object itself. - */ - public ManagedClusterProperties withAutoUpgradeProfile(ManagedClusterAutoUpgradeProfile autoUpgradeProfile) { - this.autoUpgradeProfile = autoUpgradeProfile; - return this; - } - - /** - * Get the autoScalerProfile property: Parameters to be applied to the cluster-autoscaler when enabled. - * - * @return the autoScalerProfile value. - */ - public ManagedClusterPropertiesAutoScalerProfile autoScalerProfile() { - return this.autoScalerProfile; - } - - /** - * Set the autoScalerProfile property: Parameters to be applied to the cluster-autoscaler when enabled. - * - * @param autoScalerProfile the autoScalerProfile value to set. - * @return the ManagedClusterProperties object itself. - */ - public ManagedClusterProperties withAutoScalerProfile(ManagedClusterPropertiesAutoScalerProfile autoScalerProfile) { - this.autoScalerProfile = autoScalerProfile; - return this; - } - - /** - * Get the apiServerAccessProfile property: Access profile for managed cluster API server. - * - * @return the apiServerAccessProfile value. - */ - public ManagedClusterApiServerAccessProfile apiServerAccessProfile() { - return this.apiServerAccessProfile; - } - - /** - * Set the apiServerAccessProfile property: Access profile for managed cluster API server. - * - * @param apiServerAccessProfile the apiServerAccessProfile value to set. - * @return the ManagedClusterProperties object itself. - */ - public ManagedClusterProperties withApiServerAccessProfile( - ManagedClusterApiServerAccessProfile apiServerAccessProfile) { - this.apiServerAccessProfile = apiServerAccessProfile; - return this; - } - - /** - * Get the diskEncryptionSetId property: ResourceId of the disk encryption set to use for enabling encryption at - * rest. - * - * @return the diskEncryptionSetId value. - */ - public String diskEncryptionSetId() { - return this.diskEncryptionSetId; - } - - /** - * Set the diskEncryptionSetId property: ResourceId of the disk encryption set to use for enabling encryption at - * rest. - * - * @param diskEncryptionSetId the diskEncryptionSetId value to set. - * @return the ManagedClusterProperties object itself. - */ - public ManagedClusterProperties withDiskEncryptionSetId(String diskEncryptionSetId) { - this.diskEncryptionSetId = diskEncryptionSetId; - return this; - } - - /** - * Get the identityProfile property: Identities associated with the cluster. - * - * @return the identityProfile value. - */ - public Map identityProfile() { - return this.identityProfile; - } - - /** - * Set the identityProfile property: Identities associated with the cluster. - * - * @param identityProfile the identityProfile value to set. - * @return the ManagedClusterProperties object itself. - */ - public ManagedClusterProperties withIdentityProfile( - Map identityProfile) { - this.identityProfile = identityProfile; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (powerState() != null) { - powerState().validate(); - } - if (agentPoolProfiles() != null) { - agentPoolProfiles().forEach(e -> e.validate()); - } - if (linuxProfile() != null) { - linuxProfile().validate(); - } - if (windowsProfile() != null) { - windowsProfile().validate(); - } - if (servicePrincipalProfile() != null) { - servicePrincipalProfile().validate(); - } - if (addonProfiles() != null) { - addonProfiles() - .values() - .forEach( - e -> { - if (e != null) { - e.validate(); - } - }); - } - if (podIdentityProfile() != null) { - podIdentityProfile().validate(); - } - if (networkProfile() != null) { - networkProfile().validate(); - } - if (aadProfile() != null) { - aadProfile().validate(); - } - if (autoUpgradeProfile() != null) { - autoUpgradeProfile().validate(); - } - if (autoScalerProfile() != null) { - autoScalerProfile().validate(); - } - if (apiServerAccessProfile() != null) { - apiServerAccessProfile().validate(); - } - if (identityProfile() != null) { - identityProfile() - .values() - .forEach( - e -> { - if (e != null) { - e.validate(); - } - }); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/models/ManagedClusterUpgradeProfileInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/models/ManagedClusterUpgradeProfileInner.java deleted file mode 100644 index 64d2a0bca00d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/models/ManagedClusterUpgradeProfileInner.java +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.containerservice.models.ManagedClusterPoolUpgradeProfile; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The list of available upgrades for compute pools. */ -@Fluent -public final class ManagedClusterUpgradeProfileInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedClusterUpgradeProfileInner.class); - - /* - * Id of upgrade profile. - */ - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) - private String id; - - /* - * Name of upgrade profile. - */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) - private String name; - - /* - * Type of upgrade profile. - */ - @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) - private String type; - - /* - * Properties of upgrade profile. - */ - @JsonProperty(value = "properties", required = true) - private ManagedClusterUpgradeProfileProperties innerProperties = new ManagedClusterUpgradeProfileProperties(); - - /** - * Get the id property: Id of upgrade profile. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Get the name property: Name of upgrade profile. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the type property: Type of upgrade profile. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Get the innerProperties property: Properties of upgrade profile. - * - * @return the innerProperties value. - */ - private ManagedClusterUpgradeProfileProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the controlPlaneProfile property: The list of available upgrade versions for the control plane. - * - * @return the controlPlaneProfile value. - */ - public ManagedClusterPoolUpgradeProfile controlPlaneProfile() { - return this.innerProperties() == null ? null : this.innerProperties().controlPlaneProfile(); - } - - /** - * Set the controlPlaneProfile property: The list of available upgrade versions for the control plane. - * - * @param controlPlaneProfile the controlPlaneProfile value to set. - * @return the ManagedClusterUpgradeProfileInner object itself. - */ - public ManagedClusterUpgradeProfileInner withControlPlaneProfile( - ManagedClusterPoolUpgradeProfile controlPlaneProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new ManagedClusterUpgradeProfileProperties(); - } - this.innerProperties().withControlPlaneProfile(controlPlaneProfile); - return this; - } - - /** - * Get the agentPoolProfiles property: The list of available upgrade versions for agent pools. - * - * @return the agentPoolProfiles value. - */ - public List agentPoolProfiles() { - return this.innerProperties() == null ? null : this.innerProperties().agentPoolProfiles(); - } - - /** - * Set the agentPoolProfiles property: The list of available upgrade versions for agent pools. - * - * @param agentPoolProfiles the agentPoolProfiles value to set. - * @return the ManagedClusterUpgradeProfileInner object itself. - */ - public ManagedClusterUpgradeProfileInner withAgentPoolProfiles( - List agentPoolProfiles) { - if (this.innerProperties() == null) { - this.innerProperties = new ManagedClusterUpgradeProfileProperties(); - } - this.innerProperties().withAgentPoolProfiles(agentPoolProfiles); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property innerProperties in model ManagedClusterUpgradeProfileInner")); - } else { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/models/ManagedClusterUpgradeProfileProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/models/ManagedClusterUpgradeProfileProperties.java deleted file mode 100644 index 8bb07c39b4bd..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/models/ManagedClusterUpgradeProfileProperties.java +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.containerservice.models.ManagedClusterPoolUpgradeProfile; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Control plane and agent pool upgrade profiles. */ -@Fluent -public final class ManagedClusterUpgradeProfileProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedClusterUpgradeProfileProperties.class); - - /* - * The list of available upgrade versions for the control plane. - */ - @JsonProperty(value = "controlPlaneProfile", required = true) - private ManagedClusterPoolUpgradeProfile controlPlaneProfile; - - /* - * The list of available upgrade versions for agent pools. - */ - @JsonProperty(value = "agentPoolProfiles", required = true) - private List agentPoolProfiles; - - /** - * Get the controlPlaneProfile property: The list of available upgrade versions for the control plane. - * - * @return the controlPlaneProfile value. - */ - public ManagedClusterPoolUpgradeProfile controlPlaneProfile() { - return this.controlPlaneProfile; - } - - /** - * Set the controlPlaneProfile property: The list of available upgrade versions for the control plane. - * - * @param controlPlaneProfile the controlPlaneProfile value to set. - * @return the ManagedClusterUpgradeProfileProperties object itself. - */ - public ManagedClusterUpgradeProfileProperties withControlPlaneProfile( - ManagedClusterPoolUpgradeProfile controlPlaneProfile) { - this.controlPlaneProfile = controlPlaneProfile; - return this; - } - - /** - * Get the agentPoolProfiles property: The list of available upgrade versions for agent pools. - * - * @return the agentPoolProfiles value. - */ - public List agentPoolProfiles() { - return this.agentPoolProfiles; - } - - /** - * Set the agentPoolProfiles property: The list of available upgrade versions for agent pools. - * - * @param agentPoolProfiles the agentPoolProfiles value to set. - * @return the ManagedClusterUpgradeProfileProperties object itself. - */ - public ManagedClusterUpgradeProfileProperties withAgentPoolProfiles( - List agentPoolProfiles) { - this.agentPoolProfiles = agentPoolProfiles; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (controlPlaneProfile() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property controlPlaneProfile in model" - + " ManagedClusterUpgradeProfileProperties")); - } else { - controlPlaneProfile().validate(); - } - if (agentPoolProfiles() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property agentPoolProfiles in model ManagedClusterUpgradeProfileProperties")); - } else { - agentPoolProfiles().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/models/OpenShiftManagedClusterInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/models/OpenShiftManagedClusterInner.java deleted file mode 100644 index 807b82ba5965..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/models/OpenShiftManagedClusterInner.java +++ /dev/null @@ -1,271 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.containerservice.models.NetworkProfile; -import com.azure.resourcemanager.containerservice.models.OpenShiftManagedClusterAgentPoolProfile; -import com.azure.resourcemanager.containerservice.models.OpenShiftManagedClusterAuthProfile; -import com.azure.resourcemanager.containerservice.models.OpenShiftManagedClusterMasterPoolProfile; -import com.azure.resourcemanager.containerservice.models.OpenShiftRouterProfile; -import com.azure.resourcemanager.containerservice.models.PurchasePlan; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** OpenShift Managed cluster. */ -@Fluent -public final class OpenShiftManagedClusterInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OpenShiftManagedClusterInner.class); - - /* - * Define the resource plan as required by ARM for billing purposes - */ - @JsonProperty(value = "plan") - private PurchasePlan plan; - - /* - * Properties of a OpenShift managed cluster. - */ - @JsonProperty(value = "properties") - private OpenShiftManagedClusterProperties innerProperties; - - /** - * Get the plan property: Define the resource plan as required by ARM for billing purposes. - * - * @return the plan value. - */ - public PurchasePlan plan() { - return this.plan; - } - - /** - * Set the plan property: Define the resource plan as required by ARM for billing purposes. - * - * @param plan the plan value to set. - * @return the OpenShiftManagedClusterInner object itself. - */ - public OpenShiftManagedClusterInner withPlan(PurchasePlan plan) { - this.plan = plan; - return this; - } - - /** - * Get the innerProperties property: Properties of a OpenShift managed cluster. - * - * @return the innerProperties value. - */ - private OpenShiftManagedClusterProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public OpenShiftManagedClusterInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public OpenShiftManagedClusterInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the provisioningState property: The current deployment or provisioning state, which only appears in the - * response. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the openShiftVersion property: Version of OpenShift specified when creating the cluster. - * - * @return the openShiftVersion value. - */ - public String openShiftVersion() { - return this.innerProperties() == null ? null : this.innerProperties().openShiftVersion(); - } - - /** - * Set the openShiftVersion property: Version of OpenShift specified when creating the cluster. - * - * @param openShiftVersion the openShiftVersion value to set. - * @return the OpenShiftManagedClusterInner object itself. - */ - public OpenShiftManagedClusterInner withOpenShiftVersion(String openShiftVersion) { - if (this.innerProperties() == null) { - this.innerProperties = new OpenShiftManagedClusterProperties(); - } - this.innerProperties().withOpenShiftVersion(openShiftVersion); - return this; - } - - /** - * Get the clusterVersion property: Version of OpenShift specified when creating the cluster. - * - * @return the clusterVersion value. - */ - public String clusterVersion() { - return this.innerProperties() == null ? null : this.innerProperties().clusterVersion(); - } - - /** - * Get the publicHostname property: Service generated FQDN for OpenShift API server. - * - * @return the publicHostname value. - */ - public String publicHostname() { - return this.innerProperties() == null ? null : this.innerProperties().publicHostname(); - } - - /** - * Get the fqdn property: Service generated FQDN for OpenShift API server loadbalancer internal hostname. - * - * @return the fqdn value. - */ - public String fqdn() { - return this.innerProperties() == null ? null : this.innerProperties().fqdn(); - } - - /** - * Get the networkProfile property: Configuration for OpenShift networking. - * - * @return the networkProfile value. - */ - public NetworkProfile networkProfile() { - return this.innerProperties() == null ? null : this.innerProperties().networkProfile(); - } - - /** - * Set the networkProfile property: Configuration for OpenShift networking. - * - * @param networkProfile the networkProfile value to set. - * @return the OpenShiftManagedClusterInner object itself. - */ - public OpenShiftManagedClusterInner withNetworkProfile(NetworkProfile networkProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new OpenShiftManagedClusterProperties(); - } - this.innerProperties().withNetworkProfile(networkProfile); - return this; - } - - /** - * Get the routerProfiles property: Configuration for OpenShift router(s). - * - * @return the routerProfiles value. - */ - public List routerProfiles() { - return this.innerProperties() == null ? null : this.innerProperties().routerProfiles(); - } - - /** - * Set the routerProfiles property: Configuration for OpenShift router(s). - * - * @param routerProfiles the routerProfiles value to set. - * @return the OpenShiftManagedClusterInner object itself. - */ - public OpenShiftManagedClusterInner withRouterProfiles(List routerProfiles) { - if (this.innerProperties() == null) { - this.innerProperties = new OpenShiftManagedClusterProperties(); - } - this.innerProperties().withRouterProfiles(routerProfiles); - return this; - } - - /** - * Get the masterPoolProfile property: Configuration for OpenShift master VMs. - * - * @return the masterPoolProfile value. - */ - public OpenShiftManagedClusterMasterPoolProfile masterPoolProfile() { - return this.innerProperties() == null ? null : this.innerProperties().masterPoolProfile(); - } - - /** - * Set the masterPoolProfile property: Configuration for OpenShift master VMs. - * - * @param masterPoolProfile the masterPoolProfile value to set. - * @return the OpenShiftManagedClusterInner object itself. - */ - public OpenShiftManagedClusterInner withMasterPoolProfile( - OpenShiftManagedClusterMasterPoolProfile masterPoolProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new OpenShiftManagedClusterProperties(); - } - this.innerProperties().withMasterPoolProfile(masterPoolProfile); - return this; - } - - /** - * Get the agentPoolProfiles property: Configuration of OpenShift cluster VMs. - * - * @return the agentPoolProfiles value. - */ - public List agentPoolProfiles() { - return this.innerProperties() == null ? null : this.innerProperties().agentPoolProfiles(); - } - - /** - * Set the agentPoolProfiles property: Configuration of OpenShift cluster VMs. - * - * @param agentPoolProfiles the agentPoolProfiles value to set. - * @return the OpenShiftManagedClusterInner object itself. - */ - public OpenShiftManagedClusterInner withAgentPoolProfiles( - List agentPoolProfiles) { - if (this.innerProperties() == null) { - this.innerProperties = new OpenShiftManagedClusterProperties(); - } - this.innerProperties().withAgentPoolProfiles(agentPoolProfiles); - return this; - } - - /** - * Get the authProfile property: Configures OpenShift authentication. - * - * @return the authProfile value. - */ - public OpenShiftManagedClusterAuthProfile authProfile() { - return this.innerProperties() == null ? null : this.innerProperties().authProfile(); - } - - /** - * Set the authProfile property: Configures OpenShift authentication. - * - * @param authProfile the authProfile value to set. - * @return the OpenShiftManagedClusterInner object itself. - */ - public OpenShiftManagedClusterInner withAuthProfile(OpenShiftManagedClusterAuthProfile authProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new OpenShiftManagedClusterProperties(); - } - this.innerProperties().withAuthProfile(authProfile); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (plan() != null) { - plan().validate(); - } - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/models/OpenShiftManagedClusterProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/models/OpenShiftManagedClusterProperties.java deleted file mode 100644 index 07bdbbbbc611..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/models/OpenShiftManagedClusterProperties.java +++ /dev/null @@ -1,272 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.containerservice.models.NetworkProfile; -import com.azure.resourcemanager.containerservice.models.OpenShiftManagedClusterAgentPoolProfile; -import com.azure.resourcemanager.containerservice.models.OpenShiftManagedClusterAuthProfile; -import com.azure.resourcemanager.containerservice.models.OpenShiftManagedClusterMasterPoolProfile; -import com.azure.resourcemanager.containerservice.models.OpenShiftRouterProfile; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Properties of the OpenShift managed cluster. */ -@Fluent -public final class OpenShiftManagedClusterProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OpenShiftManagedClusterProperties.class); - - /* - * The current deployment or provisioning state, which only appears in the - * response. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; - - /* - * Version of OpenShift specified when creating the cluster. - */ - @JsonProperty(value = "openShiftVersion", required = true) - private String openShiftVersion; - - /* - * Version of OpenShift specified when creating the cluster. - */ - @JsonProperty(value = "clusterVersion", access = JsonProperty.Access.WRITE_ONLY) - private String clusterVersion; - - /* - * Service generated FQDN for OpenShift API server. - */ - @JsonProperty(value = "publicHostname", access = JsonProperty.Access.WRITE_ONLY) - private String publicHostname; - - /* - * Service generated FQDN for OpenShift API server loadbalancer internal - * hostname. - */ - @JsonProperty(value = "fqdn", access = JsonProperty.Access.WRITE_ONLY) - private String fqdn; - - /* - * Configuration for OpenShift networking. - */ - @JsonProperty(value = "networkProfile") - private NetworkProfile networkProfile; - - /* - * Configuration for OpenShift router(s). - */ - @JsonProperty(value = "routerProfiles") - private List routerProfiles; - - /* - * Configuration for OpenShift master VMs. - */ - @JsonProperty(value = "masterPoolProfile") - private OpenShiftManagedClusterMasterPoolProfile masterPoolProfile; - - /* - * Configuration of OpenShift cluster VMs. - */ - @JsonProperty(value = "agentPoolProfiles") - private List agentPoolProfiles; - - /* - * Configures OpenShift authentication. - */ - @JsonProperty(value = "authProfile") - private OpenShiftManagedClusterAuthProfile authProfile; - - /** - * Get the provisioningState property: The current deployment or provisioning state, which only appears in the - * response. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Get the openShiftVersion property: Version of OpenShift specified when creating the cluster. - * - * @return the openShiftVersion value. - */ - public String openShiftVersion() { - return this.openShiftVersion; - } - - /** - * Set the openShiftVersion property: Version of OpenShift specified when creating the cluster. - * - * @param openShiftVersion the openShiftVersion value to set. - * @return the OpenShiftManagedClusterProperties object itself. - */ - public OpenShiftManagedClusterProperties withOpenShiftVersion(String openShiftVersion) { - this.openShiftVersion = openShiftVersion; - return this; - } - - /** - * Get the clusterVersion property: Version of OpenShift specified when creating the cluster. - * - * @return the clusterVersion value. - */ - public String clusterVersion() { - return this.clusterVersion; - } - - /** - * Get the publicHostname property: Service generated FQDN for OpenShift API server. - * - * @return the publicHostname value. - */ - public String publicHostname() { - return this.publicHostname; - } - - /** - * Get the fqdn property: Service generated FQDN for OpenShift API server loadbalancer internal hostname. - * - * @return the fqdn value. - */ - public String fqdn() { - return this.fqdn; - } - - /** - * Get the networkProfile property: Configuration for OpenShift networking. - * - * @return the networkProfile value. - */ - public NetworkProfile networkProfile() { - return this.networkProfile; - } - - /** - * Set the networkProfile property: Configuration for OpenShift networking. - * - * @param networkProfile the networkProfile value to set. - * @return the OpenShiftManagedClusterProperties object itself. - */ - public OpenShiftManagedClusterProperties withNetworkProfile(NetworkProfile networkProfile) { - this.networkProfile = networkProfile; - return this; - } - - /** - * Get the routerProfiles property: Configuration for OpenShift router(s). - * - * @return the routerProfiles value. - */ - public List routerProfiles() { - return this.routerProfiles; - } - - /** - * Set the routerProfiles property: Configuration for OpenShift router(s). - * - * @param routerProfiles the routerProfiles value to set. - * @return the OpenShiftManagedClusterProperties object itself. - */ - public OpenShiftManagedClusterProperties withRouterProfiles(List routerProfiles) { - this.routerProfiles = routerProfiles; - return this; - } - - /** - * Get the masterPoolProfile property: Configuration for OpenShift master VMs. - * - * @return the masterPoolProfile value. - */ - public OpenShiftManagedClusterMasterPoolProfile masterPoolProfile() { - return this.masterPoolProfile; - } - - /** - * Set the masterPoolProfile property: Configuration for OpenShift master VMs. - * - * @param masterPoolProfile the masterPoolProfile value to set. - * @return the OpenShiftManagedClusterProperties object itself. - */ - public OpenShiftManagedClusterProperties withMasterPoolProfile( - OpenShiftManagedClusterMasterPoolProfile masterPoolProfile) { - this.masterPoolProfile = masterPoolProfile; - return this; - } - - /** - * Get the agentPoolProfiles property: Configuration of OpenShift cluster VMs. - * - * @return the agentPoolProfiles value. - */ - public List agentPoolProfiles() { - return this.agentPoolProfiles; - } - - /** - * Set the agentPoolProfiles property: Configuration of OpenShift cluster VMs. - * - * @param agentPoolProfiles the agentPoolProfiles value to set. - * @return the OpenShiftManagedClusterProperties object itself. - */ - public OpenShiftManagedClusterProperties withAgentPoolProfiles( - List agentPoolProfiles) { - this.agentPoolProfiles = agentPoolProfiles; - return this; - } - - /** - * Get the authProfile property: Configures OpenShift authentication. - * - * @return the authProfile value. - */ - public OpenShiftManagedClusterAuthProfile authProfile() { - return this.authProfile; - } - - /** - * Set the authProfile property: Configures OpenShift authentication. - * - * @param authProfile the authProfile value to set. - * @return the OpenShiftManagedClusterProperties object itself. - */ - public OpenShiftManagedClusterProperties withAuthProfile(OpenShiftManagedClusterAuthProfile authProfile) { - this.authProfile = authProfile; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (openShiftVersion() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property openShiftVersion in model OpenShiftManagedClusterProperties")); - } - if (networkProfile() != null) { - networkProfile().validate(); - } - if (routerProfiles() != null) { - routerProfiles().forEach(e -> e.validate()); - } - if (masterPoolProfile() != null) { - masterPoolProfile().validate(); - } - if (agentPoolProfiles() != null) { - agentPoolProfiles().forEach(e -> e.validate()); - } - if (authProfile() != null) { - authProfile().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/models/OperationValueDisplay.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/models/OperationValueDisplay.java deleted file mode 100644 index 70e5129eb9de..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/models/OperationValueDisplay.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describes the properties of a Compute Operation Value Display. */ -@Immutable -public final class OperationValueDisplay { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationValueDisplay.class); - - /* - * The display name of the compute operation. - */ - @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) - private String operation; - - /* - * The display name of the resource the operation applies to. - */ - @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) - private String resource; - - /* - * The description of the operation. - */ - @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) - private String description; - - /* - * The resource provider for the operation. - */ - @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) - private String provider; - - /** - * Get the operation property: The display name of the compute operation. - * - * @return the operation value. - */ - public String operation() { - return this.operation; - } - - /** - * Get the resource property: The display name of the resource the operation applies to. - * - * @return the resource value. - */ - public String resource() { - return this.resource; - } - - /** - * Get the description property: The description of the operation. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Get the provider property: The resource provider for the operation. - * - * @return the provider value. - */ - public String provider() { - return this.provider; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/models/OperationValueInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/models/OperationValueInner.java deleted file mode 100644 index 176fc85bbdfa..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/models/OperationValueInner.java +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describes the properties of a Compute Operation value. */ -@Fluent -public final class OperationValueInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationValueInner.class); - - /* - * The origin of the compute operation. - */ - @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) - private String origin; - - /* - * The name of the compute operation. - */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) - private String name; - - /* - * Describes the properties of a Compute Operation Value Display. - */ - @JsonProperty(value = "display") - private OperationValueDisplay innerDisplay; - - /** - * Get the origin property: The origin of the compute operation. - * - * @return the origin value. - */ - public String origin() { - return this.origin; - } - - /** - * Get the name property: The name of the compute operation. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the innerDisplay property: Describes the properties of a Compute Operation Value Display. - * - * @return the innerDisplay value. - */ - private OperationValueDisplay innerDisplay() { - return this.innerDisplay; - } - - /** - * Get the operation property: The display name of the compute operation. - * - * @return the operation value. - */ - public String operation() { - return this.innerDisplay() == null ? null : this.innerDisplay().operation(); - } - - /** - * Get the resource property: The display name of the resource the operation applies to. - * - * @return the resource value. - */ - public String resource() { - return this.innerDisplay() == null ? null : this.innerDisplay().resource(); - } - - /** - * Get the description property: The description of the operation. - * - * @return the description value. - */ - public String description() { - return this.innerDisplay() == null ? null : this.innerDisplay().description(); - } - - /** - * Get the provider property: The resource provider for the operation. - * - * @return the provider value. - */ - public String provider() { - return this.innerDisplay() == null ? null : this.innerDisplay().provider(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerDisplay() != null) { - innerDisplay().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/models/OrchestratorVersionProfileListResultInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/models/OrchestratorVersionProfileListResultInner.java deleted file mode 100644 index 9ed81d81af37..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/models/OrchestratorVersionProfileListResultInner.java +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.containerservice.models.OrchestratorVersionProfile; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The list of versions for supported orchestrators. */ -@Fluent -public final class OrchestratorVersionProfileListResultInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OrchestratorVersionProfileListResultInner.class); - - /* - * Id of the orchestrator version profile list result. - */ - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) - private String id; - - /* - * Name of the orchestrator version profile list result. - */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) - private String name; - - /* - * Type of the orchestrator version profile list result. - */ - @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) - private String type; - - /* - * The properties of an orchestrator version profile. - */ - @JsonProperty(value = "properties", required = true) - private OrchestratorVersionProfileProperties innerProperties = new OrchestratorVersionProfileProperties(); - - /** - * Get the id property: Id of the orchestrator version profile list result. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Get the name property: Name of the orchestrator version profile list result. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the type property: Type of the orchestrator version profile list result. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Get the innerProperties property: The properties of an orchestrator version profile. - * - * @return the innerProperties value. - */ - private OrchestratorVersionProfileProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the orchestrators property: List of orchestrator version profiles. - * - * @return the orchestrators value. - */ - public List orchestrators() { - return this.innerProperties() == null ? null : this.innerProperties().orchestrators(); - } - - /** - * Set the orchestrators property: List of orchestrator version profiles. - * - * @param orchestrators the orchestrators value to set. - * @return the OrchestratorVersionProfileListResultInner object itself. - */ - public OrchestratorVersionProfileListResultInner withOrchestrators(List orchestrators) { - if (this.innerProperties() == null) { - this.innerProperties = new OrchestratorVersionProfileProperties(); - } - this.innerProperties().withOrchestrators(orchestrators); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property innerProperties in model" - + " OrchestratorVersionProfileListResultInner")); - } else { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/models/OrchestratorVersionProfileProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/models/OrchestratorVersionProfileProperties.java deleted file mode 100644 index 56b94d3f5a36..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/models/OrchestratorVersionProfileProperties.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.containerservice.models.OrchestratorVersionProfile; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The properties of an orchestrator version profile. */ -@Fluent -public final class OrchestratorVersionProfileProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OrchestratorVersionProfileProperties.class); - - /* - * List of orchestrator version profiles. - */ - @JsonProperty(value = "orchestrators", required = true) - private List orchestrators; - - /** - * Get the orchestrators property: List of orchestrator version profiles. - * - * @return the orchestrators value. - */ - public List orchestrators() { - return this.orchestrators; - } - - /** - * Set the orchestrators property: List of orchestrator version profiles. - * - * @param orchestrators the orchestrators value to set. - * @return the OrchestratorVersionProfileProperties object itself. - */ - public OrchestratorVersionProfileProperties withOrchestrators(List orchestrators) { - this.orchestrators = orchestrators; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (orchestrators() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property orchestrators in model OrchestratorVersionProfileProperties")); - } else { - orchestrators().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/models/PrivateEndpointConnectionInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/models/PrivateEndpointConnectionInner.java deleted file mode 100644 index 0713084a3393..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/models/PrivateEndpointConnectionInner.java +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.containerservice.models.PrivateEndpoint; -import com.azure.resourcemanager.containerservice.models.PrivateEndpointConnectionProvisioningState; -import com.azure.resourcemanager.containerservice.models.PrivateLinkServiceConnectionState; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** A private endpoint connection. */ -@Fluent -public final class PrivateEndpointConnectionInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionInner.class); - - /* - * The properties of a private endpoint connection. - */ - @JsonProperty(value = "properties") - private PrivateEndpointConnectionProperties innerProperties; - - /** - * Get the innerProperties property: The properties of a private endpoint connection. - * - * @return the innerProperties value. - */ - private PrivateEndpointConnectionProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the provisioningState property: The current provisioning state. - * - * @return the provisioningState value. - */ - public PrivateEndpointConnectionProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the privateEndpoint property: The resource of private endpoint. - * - * @return the privateEndpoint value. - */ - public PrivateEndpoint privateEndpoint() { - return this.innerProperties() == null ? null : this.innerProperties().privateEndpoint(); - } - - /** - * Set the privateEndpoint property: The resource of private endpoint. - * - * @param privateEndpoint the privateEndpoint value to set. - * @return the PrivateEndpointConnectionInner object itself. - */ - public PrivateEndpointConnectionInner withPrivateEndpoint(PrivateEndpoint privateEndpoint) { - if (this.innerProperties() == null) { - this.innerProperties = new PrivateEndpointConnectionProperties(); - } - this.innerProperties().withPrivateEndpoint(privateEndpoint); - return this; - } - - /** - * Get the privateLinkServiceConnectionState property: A collection of information about the state of the connection - * between service consumer and provider. - * - * @return the privateLinkServiceConnectionState value. - */ - public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { - return this.innerProperties() == null ? null : this.innerProperties().privateLinkServiceConnectionState(); - } - - /** - * Set the privateLinkServiceConnectionState property: A collection of information about the state of the connection - * between service consumer and provider. - * - * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. - * @return the PrivateEndpointConnectionInner object itself. - */ - public PrivateEndpointConnectionInner withPrivateLinkServiceConnectionState( - PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { - if (this.innerProperties() == null) { - this.innerProperties = new PrivateEndpointConnectionProperties(); - } - this.innerProperties().withPrivateLinkServiceConnectionState(privateLinkServiceConnectionState); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/models/PrivateEndpointConnectionListResultInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/models/PrivateEndpointConnectionListResultInner.java deleted file mode 100644 index 131a188452fa..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/models/PrivateEndpointConnectionListResultInner.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** A list of private endpoint connections. */ -@Fluent -public final class PrivateEndpointConnectionListResultInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionListResultInner.class); - - /* - * The collection value. - */ - @JsonProperty(value = "value") - private List value; - - /** - * Get the value property: The collection value. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The collection value. - * - * @param value the value value to set. - * @return the PrivateEndpointConnectionListResultInner object itself. - */ - public PrivateEndpointConnectionListResultInner withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/models/PrivateEndpointConnectionProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/models/PrivateEndpointConnectionProperties.java deleted file mode 100644 index aeb4b0911efa..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/models/PrivateEndpointConnectionProperties.java +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.containerservice.models.PrivateEndpoint; -import com.azure.resourcemanager.containerservice.models.PrivateEndpointConnectionProvisioningState; -import com.azure.resourcemanager.containerservice.models.PrivateLinkServiceConnectionState; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Properties of a private endpoint connection. */ -@Fluent -public final class PrivateEndpointConnectionProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionProperties.class); - - /* - * The current provisioning state. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private PrivateEndpointConnectionProvisioningState provisioningState; - - /* - * The resource of private endpoint. - */ - @JsonProperty(value = "privateEndpoint") - private PrivateEndpoint privateEndpoint; - - /* - * A collection of information about the state of the connection between - * service consumer and provider. - */ - @JsonProperty(value = "privateLinkServiceConnectionState", required = true) - private PrivateLinkServiceConnectionState privateLinkServiceConnectionState; - - /** - * Get the provisioningState property: The current provisioning state. - * - * @return the provisioningState value. - */ - public PrivateEndpointConnectionProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Get the privateEndpoint property: The resource of private endpoint. - * - * @return the privateEndpoint value. - */ - public PrivateEndpoint privateEndpoint() { - return this.privateEndpoint; - } - - /** - * Set the privateEndpoint property: The resource of private endpoint. - * - * @param privateEndpoint the privateEndpoint value to set. - * @return the PrivateEndpointConnectionProperties object itself. - */ - public PrivateEndpointConnectionProperties withPrivateEndpoint(PrivateEndpoint privateEndpoint) { - this.privateEndpoint = privateEndpoint; - return this; - } - - /** - * Get the privateLinkServiceConnectionState property: A collection of information about the state of the connection - * between service consumer and provider. - * - * @return the privateLinkServiceConnectionState value. - */ - public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { - return this.privateLinkServiceConnectionState; - } - - /** - * Set the privateLinkServiceConnectionState property: A collection of information about the state of the connection - * between service consumer and provider. - * - * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. - * @return the PrivateEndpointConnectionProperties object itself. - */ - public PrivateEndpointConnectionProperties withPrivateLinkServiceConnectionState( - PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { - this.privateLinkServiceConnectionState = privateLinkServiceConnectionState; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (privateEndpoint() != null) { - privateEndpoint().validate(); - } - if (privateLinkServiceConnectionState() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property privateLinkServiceConnectionState in model" - + " PrivateEndpointConnectionProperties")); - } else { - privateLinkServiceConnectionState().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/models/PrivateLinkResourceInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/models/PrivateLinkResourceInner.java deleted file mode 100644 index 2a998d1c19ac..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/models/PrivateLinkResourceInner.java +++ /dev/null @@ -1,172 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** A private link resource. */ -@Fluent -public final class PrivateLinkResourceInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkResourceInner.class); - - /* - * The ID of the private link resource. - */ - @JsonProperty(value = "id") - private String id; - - /* - * The name of the private link resource. - */ - @JsonProperty(value = "name") - private String name; - - /* - * The resource type. - */ - @JsonProperty(value = "type") - private String type; - - /* - * The group ID of the resource. - */ - @JsonProperty(value = "groupId") - private String groupId; - - /* - * RequiredMembers of the resource - */ - @JsonProperty(value = "requiredMembers") - private List requiredMembers; - - /* - * The private link service ID of the resource, this field is exposed only - * to NRP internally. - */ - @JsonProperty(value = "privateLinkServiceID", access = JsonProperty.Access.WRITE_ONLY) - private String privateLinkServiceId; - - /** - * Get the id property: The ID of the private link resource. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: The ID of the private link resource. - * - * @param id the id value to set. - * @return the PrivateLinkResourceInner object itself. - */ - public PrivateLinkResourceInner withId(String id) { - this.id = id; - return this; - } - - /** - * Get the name property: The name of the private link resource. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the private link resource. - * - * @param name the name value to set. - * @return the PrivateLinkResourceInner object itself. - */ - public PrivateLinkResourceInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the type property: The resource type. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Set the type property: The resource type. - * - * @param type the type value to set. - * @return the PrivateLinkResourceInner object itself. - */ - public PrivateLinkResourceInner withType(String type) { - this.type = type; - return this; - } - - /** - * Get the groupId property: The group ID of the resource. - * - * @return the groupId value. - */ - public String groupId() { - return this.groupId; - } - - /** - * Set the groupId property: The group ID of the resource. - * - * @param groupId the groupId value to set. - * @return the PrivateLinkResourceInner object itself. - */ - public PrivateLinkResourceInner withGroupId(String groupId) { - this.groupId = groupId; - return this; - } - - /** - * Get the requiredMembers property: RequiredMembers of the resource. - * - * @return the requiredMembers value. - */ - public List requiredMembers() { - return this.requiredMembers; - } - - /** - * Set the requiredMembers property: RequiredMembers of the resource. - * - * @param requiredMembers the requiredMembers value to set. - * @return the PrivateLinkResourceInner object itself. - */ - public PrivateLinkResourceInner withRequiredMembers(List requiredMembers) { - this.requiredMembers = requiredMembers; - return this; - } - - /** - * Get the privateLinkServiceId property: The private link service ID of the resource, this field is exposed only to - * NRP internally. - * - * @return the privateLinkServiceId value. - */ - public String privateLinkServiceId() { - return this.privateLinkServiceId; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/models/PrivateLinkResourcesListResultInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/models/PrivateLinkResourcesListResultInner.java deleted file mode 100644 index a925845b7f4b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/models/PrivateLinkResourcesListResultInner.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** A list of private link resources. */ -@Fluent -public final class PrivateLinkResourcesListResultInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkResourcesListResultInner.class); - - /* - * The collection value. - */ - @JsonProperty(value = "value") - private List value; - - /** - * Get the value property: The collection value. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The collection value. - * - * @param value the value value to set. - * @return the PrivateLinkResourcesListResultInner object itself. - */ - public PrivateLinkResourcesListResultInner withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/models/package-info.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/models/package-info.java deleted file mode 100644 index 668cbdfe85ff..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/models/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** Package containing the inner data models for ContainerServiceManagementClient. Container Service Client. */ -package com.azure.resourcemanager.containerservice.fluent.models; diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/package-info.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/package-info.java deleted file mode 100644 index fb46cffc6cb0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** Package containing the service clients for ContainerServiceManagementClient. Container Service Client. */ -package com.azure.resourcemanager.containerservice.fluent; diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/implementation/AgentPoolsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/implementation/AgentPoolsClientImpl.java deleted file mode 100644 index a87ee53a1e19..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/implementation/AgentPoolsClientImpl.java +++ /dev/null @@ -1,1763 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.containerservice.fluent.AgentPoolsClient; -import com.azure.resourcemanager.containerservice.fluent.models.AgentPoolAvailableVersionsInner; -import com.azure.resourcemanager.containerservice.fluent.models.AgentPoolInner; -import com.azure.resourcemanager.containerservice.fluent.models.AgentPoolUpgradeProfileInner; -import com.azure.resourcemanager.containerservice.models.AgentPoolListResult; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in AgentPoolsClient. */ -public final class AgentPoolsClientImpl implements AgentPoolsClient { - private final ClientLogger logger = new ClientLogger(AgentPoolsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final AgentPoolsService service; - - /** The service client containing this operation class. */ - private final ContainerServiceManagementClientImpl client; - - /** - * Initializes an instance of AgentPoolsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - AgentPoolsClientImpl(ContainerServiceManagementClientImpl client) { - this.service = - RestProxy.create(AgentPoolsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for ContainerServiceManagementClientAgentPools to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "ContainerServiceMana") - private interface AgentPoolsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" - + "/managedClusters/{resourceName}/agentPools") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("resourceName") String resourceName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" - + "/managedClusters/{resourceName}/agentPools/{agentPoolName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("resourceName") String resourceName, - @PathParam("agentPoolName") String agentPoolName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" - + "/managedClusters/{resourceName}/agentPools/{agentPoolName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("resourceName") String resourceName, - @PathParam("agentPoolName") String agentPoolName, - @BodyParam("application/json") AgentPoolInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" - + "/managedClusters/{resourceName}/agentPools/{agentPoolName}") - @ExpectedResponses({202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("resourceName") String resourceName, - @PathParam("agentPoolName") String agentPoolName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" - + "/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getUpgradeProfile( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("resourceName") String resourceName, - @PathParam("agentPoolName") String agentPoolName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" - + "/managedClusters/{resourceName}/availableAgentPoolVersions") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getAvailableAgentPoolVersions( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("resourceName") String resourceName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" - + "/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> upgradeNodeImageVersion( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("resourceName") String resourceName, - @PathParam("agentPoolName") String agentPoolName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets a list of agent pools in the specified managed cluster. The operation returns properties of each agent pool. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of agent pools in the specified managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String resourceName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String apiVersion = "2020-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - resourceName, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a list of agent pools in the specified managed cluster. The operation returns properties of each agent pool. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of agent pools in the specified managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String resourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String apiVersion = "2020-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - resourceName, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets a list of agent pools in the specified managed cluster. The operation returns properties of each agent pool. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of agent pools in the specified managed cluster. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String resourceGroupName, String resourceName) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, resourceName), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets a list of agent pools in the specified managed cluster. The operation returns properties of each agent pool. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of agent pools in the specified managed cluster. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String resourceName, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, resourceName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets a list of agent pools in the specified managed cluster. The operation returns properties of each agent pool. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of agent pools in the specified managed cluster. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String resourceName) { - return new PagedIterable<>(listAsync(resourceGroupName, resourceName)); - } - - /** - * Gets a list of agent pools in the specified managed cluster. The operation returns properties of each agent pool. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of agent pools in the specified managed cluster. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String resourceName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, resourceName, context)); - } - - /** - * Gets the details of the agent pool by managed cluster and resource group. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param agentPoolName The name of the agent pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of the agent pool by managed cluster and resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String resourceGroupName, String resourceName, String agentPoolName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (agentPoolName == null) { - return Mono.error(new IllegalArgumentException("Parameter agentPoolName is required and cannot be null.")); - } - final String apiVersion = "2020-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - resourceName, - agentPoolName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the details of the agent pool by managed cluster and resource group. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param agentPoolName The name of the agent pool. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of the agent pool by managed cluster and resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String resourceName, String agentPoolName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (agentPoolName == null) { - return Mono.error(new IllegalArgumentException("Parameter agentPoolName is required and cannot be null.")); - } - final String apiVersion = "2020-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - resourceName, - agentPoolName, - accept, - context); - } - - /** - * Gets the details of the agent pool by managed cluster and resource group. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param agentPoolName The name of the agent pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of the agent pool by managed cluster and resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync(String resourceGroupName, String resourceName, String agentPoolName) { - return getWithResponseAsync(resourceGroupName, resourceName, agentPoolName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the details of the agent pool by managed cluster and resource group. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param agentPoolName The name of the agent pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of the agent pool by managed cluster and resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AgentPoolInner get(String resourceGroupName, String resourceName, String agentPoolName) { - return getAsync(resourceGroupName, resourceName, agentPoolName).block(); - } - - /** - * Gets the details of the agent pool by managed cluster and resource group. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param agentPoolName The name of the agent pool. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of the agent pool by managed cluster and resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String resourceName, String agentPoolName, Context context) { - return getWithResponseAsync(resourceGroupName, resourceName, agentPoolName, context).block(); - } - - /** - * Creates or updates an agent pool in the specified managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param agentPoolName The name of the agent pool. - * @param parameters Parameters supplied to the Create or Update an agent pool operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return agent Pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String resourceName, String agentPoolName, AgentPoolInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (agentPoolName == null) { - return Mono.error(new IllegalArgumentException("Parameter agentPoolName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - resourceName, - agentPoolName, - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates an agent pool in the specified managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param agentPoolName The name of the agent pool. - * @param parameters Parameters supplied to the Create or Update an agent pool operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return agent Pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String resourceName, - String agentPoolName, - AgentPoolInner parameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (agentPoolName == null) { - return Mono.error(new IllegalArgumentException("Parameter agentPoolName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - resourceName, - agentPoolName, - parameters, - accept, - context); - } - - /** - * Creates or updates an agent pool in the specified managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param agentPoolName The name of the agent pool. - * @param parameters Parameters supplied to the Create or Update an agent pool operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return agent Pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, AgentPoolInner> beginCreateOrUpdateAsync( - String resourceGroupName, String resourceName, String agentPoolName, AgentPoolInner parameters) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, resourceName, agentPoolName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - AgentPoolInner.class, - AgentPoolInner.class, - this.client.getContext()); - } - - /** - * Creates or updates an agent pool in the specified managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param agentPoolName The name of the agent pool. - * @param parameters Parameters supplied to the Create or Update an agent pool operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return agent Pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, AgentPoolInner> beginCreateOrUpdateAsync( - String resourceGroupName, - String resourceName, - String agentPoolName, - AgentPoolInner parameters, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, resourceName, agentPoolName, parameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), AgentPoolInner.class, AgentPoolInner.class, context); - } - - /** - * Creates or updates an agent pool in the specified managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param agentPoolName The name of the agent pool. - * @param parameters Parameters supplied to the Create or Update an agent pool operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return agent Pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, AgentPoolInner> beginCreateOrUpdate( - String resourceGroupName, String resourceName, String agentPoolName, AgentPoolInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, resourceName, agentPoolName, parameters).getSyncPoller(); - } - - /** - * Creates or updates an agent pool in the specified managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param agentPoolName The name of the agent pool. - * @param parameters Parameters supplied to the Create or Update an agent pool operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return agent Pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, AgentPoolInner> beginCreateOrUpdate( - String resourceGroupName, - String resourceName, - String agentPoolName, - AgentPoolInner parameters, - Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, resourceName, agentPoolName, parameters, context) - .getSyncPoller(); - } - - /** - * Creates or updates an agent pool in the specified managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param agentPoolName The name of the agent pool. - * @param parameters Parameters supplied to the Create or Update an agent pool operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return agent Pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, String resourceName, String agentPoolName, AgentPoolInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, resourceName, agentPoolName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates an agent pool in the specified managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param agentPoolName The name of the agent pool. - * @param parameters Parameters supplied to the Create or Update an agent pool operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return agent Pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, - String resourceName, - String agentPoolName, - AgentPoolInner parameters, - Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, resourceName, agentPoolName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates an agent pool in the specified managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param agentPoolName The name of the agent pool. - * @param parameters Parameters supplied to the Create or Update an agent pool operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return agent Pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AgentPoolInner createOrUpdate( - String resourceGroupName, String resourceName, String agentPoolName, AgentPoolInner parameters) { - return createOrUpdateAsync(resourceGroupName, resourceName, agentPoolName, parameters).block(); - } - - /** - * Creates or updates an agent pool in the specified managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param agentPoolName The name of the agent pool. - * @param parameters Parameters supplied to the Create or Update an agent pool operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return agent Pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AgentPoolInner createOrUpdate( - String resourceGroupName, - String resourceName, - String agentPoolName, - AgentPoolInner parameters, - Context context) { - return createOrUpdateAsync(resourceGroupName, resourceName, agentPoolName, parameters, context).block(); - } - - /** - * Deletes the agent pool in the specified managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param agentPoolName The name of the agent pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync( - String resourceGroupName, String resourceName, String agentPoolName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (agentPoolName == null) { - return Mono.error(new IllegalArgumentException("Parameter agentPoolName is required and cannot be null.")); - } - final String apiVersion = "2020-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - resourceName, - agentPoolName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the agent pool in the specified managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param agentPoolName The name of the agent pool. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String resourceName, String agentPoolName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (agentPoolName == null) { - return Mono.error(new IllegalArgumentException("Parameter agentPoolName is required and cannot be null.")); - } - final String apiVersion = "2020-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - resourceName, - agentPoolName, - accept, - context); - } - - /** - * Deletes the agent pool in the specified managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param agentPoolName The name of the agent pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String resourceName, String agentPoolName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, resourceName, agentPoolName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deletes the agent pool in the specified managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param agentPoolName The name of the agent pool. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String resourceName, String agentPoolName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, resourceName, agentPoolName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes the agent pool in the specified managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param agentPoolName The name of the agent pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String resourceName, String agentPoolName) { - return beginDeleteAsync(resourceGroupName, resourceName, agentPoolName).getSyncPoller(); - } - - /** - * Deletes the agent pool in the specified managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param agentPoolName The name of the agent pool. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String resourceName, String agentPoolName, Context context) { - return beginDeleteAsync(resourceGroupName, resourceName, agentPoolName, context).getSyncPoller(); - } - - /** - * Deletes the agent pool in the specified managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param agentPoolName The name of the agent pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String resourceName, String agentPoolName) { - return beginDeleteAsync(resourceGroupName, resourceName, agentPoolName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the agent pool in the specified managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param agentPoolName The name of the agent pool. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync( - String resourceGroupName, String resourceName, String agentPoolName, Context context) { - return beginDeleteAsync(resourceGroupName, resourceName, agentPoolName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the agent pool in the specified managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param agentPoolName The name of the agent pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String resourceName, String agentPoolName) { - deleteAsync(resourceGroupName, resourceName, agentPoolName).block(); - } - - /** - * Deletes the agent pool in the specified managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param agentPoolName The name of the agent pool. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String resourceName, String agentPoolName, Context context) { - deleteAsync(resourceGroupName, resourceName, agentPoolName, context).block(); - } - - /** - * Gets the details of the upgrade profile for an agent pool with a specified resource group and managed cluster - * name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param agentPoolName The name of the agent pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of the upgrade profile for an agent pool with a specified resource group and managed cluster - * name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getUpgradeProfileWithResponseAsync( - String resourceGroupName, String resourceName, String agentPoolName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (agentPoolName == null) { - return Mono.error(new IllegalArgumentException("Parameter agentPoolName is required and cannot be null.")); - } - final String apiVersion = "2020-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getUpgradeProfile( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - resourceName, - agentPoolName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the details of the upgrade profile for an agent pool with a specified resource group and managed cluster - * name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param agentPoolName The name of the agent pool. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of the upgrade profile for an agent pool with a specified resource group and managed cluster - * name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getUpgradeProfileWithResponseAsync( - String resourceGroupName, String resourceName, String agentPoolName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (agentPoolName == null) { - return Mono.error(new IllegalArgumentException("Parameter agentPoolName is required and cannot be null.")); - } - final String apiVersion = "2020-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getUpgradeProfile( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - resourceName, - agentPoolName, - accept, - context); - } - - /** - * Gets the details of the upgrade profile for an agent pool with a specified resource group and managed cluster - * name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param agentPoolName The name of the agent pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of the upgrade profile for an agent pool with a specified resource group and managed cluster - * name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getUpgradeProfileAsync( - String resourceGroupName, String resourceName, String agentPoolName) { - return getUpgradeProfileWithResponseAsync(resourceGroupName, resourceName, agentPoolName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the details of the upgrade profile for an agent pool with a specified resource group and managed cluster - * name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param agentPoolName The name of the agent pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of the upgrade profile for an agent pool with a specified resource group and managed cluster - * name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AgentPoolUpgradeProfileInner getUpgradeProfile( - String resourceGroupName, String resourceName, String agentPoolName) { - return getUpgradeProfileAsync(resourceGroupName, resourceName, agentPoolName).block(); - } - - /** - * Gets the details of the upgrade profile for an agent pool with a specified resource group and managed cluster - * name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param agentPoolName The name of the agent pool. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of the upgrade profile for an agent pool with a specified resource group and managed cluster - * name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getUpgradeProfileWithResponse( - String resourceGroupName, String resourceName, String agentPoolName, Context context) { - return getUpgradeProfileWithResponseAsync(resourceGroupName, resourceName, agentPoolName, context).block(); - } - - /** - * Gets a list of supported versions for the specified agent pool. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of supported versions for the specified agent pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getAvailableAgentPoolVersionsWithResponseAsync( - String resourceGroupName, String resourceName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String apiVersion = "2020-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getAvailableAgentPoolVersions( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - resourceName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a list of supported versions for the specified agent pool. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of supported versions for the specified agent pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getAvailableAgentPoolVersionsWithResponseAsync( - String resourceGroupName, String resourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String apiVersion = "2020-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getAvailableAgentPoolVersions( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - resourceName, - accept, - context); - } - - /** - * Gets a list of supported versions for the specified agent pool. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of supported versions for the specified agent pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAvailableAgentPoolVersionsAsync( - String resourceGroupName, String resourceName) { - return getAvailableAgentPoolVersionsWithResponseAsync(resourceGroupName, resourceName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a list of supported versions for the specified agent pool. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of supported versions for the specified agent pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AgentPoolAvailableVersionsInner getAvailableAgentPoolVersions( - String resourceGroupName, String resourceName) { - return getAvailableAgentPoolVersionsAsync(resourceGroupName, resourceName).block(); - } - - /** - * Gets a list of supported versions for the specified agent pool. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of supported versions for the specified agent pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getAvailableAgentPoolVersionsWithResponse( - String resourceGroupName, String resourceName, Context context) { - return getAvailableAgentPoolVersionsWithResponseAsync(resourceGroupName, resourceName, context).block(); - } - - /** - * Upgrade node image version of an agent pool to the latest. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param agentPoolName The name of the agent pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> upgradeNodeImageVersionWithResponseAsync( - String resourceGroupName, String resourceName, String agentPoolName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (agentPoolName == null) { - return Mono.error(new IllegalArgumentException("Parameter agentPoolName is required and cannot be null.")); - } - final String apiVersion = "2020-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .upgradeNodeImageVersion( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - resourceName, - agentPoolName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Upgrade node image version of an agent pool to the latest. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param agentPoolName The name of the agent pool. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> upgradeNodeImageVersionWithResponseAsync( - String resourceGroupName, String resourceName, String agentPoolName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (agentPoolName == null) { - return Mono.error(new IllegalArgumentException("Parameter agentPoolName is required and cannot be null.")); - } - final String apiVersion = "2020-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .upgradeNodeImageVersion( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - resourceName, - agentPoolName, - accept, - context); - } - - /** - * Upgrade node image version of an agent pool to the latest. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param agentPoolName The name of the agent pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, AgentPoolInner> beginUpgradeNodeImageVersionAsync( - String resourceGroupName, String resourceName, String agentPoolName) { - Mono>> mono = - upgradeNodeImageVersionWithResponseAsync(resourceGroupName, resourceName, agentPoolName); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - AgentPoolInner.class, - AgentPoolInner.class, - this.client.getContext()); - } - - /** - * Upgrade node image version of an agent pool to the latest. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param agentPoolName The name of the agent pool. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, AgentPoolInner> beginUpgradeNodeImageVersionAsync( - String resourceGroupName, String resourceName, String agentPoolName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - upgradeNodeImageVersionWithResponseAsync(resourceGroupName, resourceName, agentPoolName, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), AgentPoolInner.class, AgentPoolInner.class, context); - } - - /** - * Upgrade node image version of an agent pool to the latest. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param agentPoolName The name of the agent pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, AgentPoolInner> beginUpgradeNodeImageVersion( - String resourceGroupName, String resourceName, String agentPoolName) { - return beginUpgradeNodeImageVersionAsync(resourceGroupName, resourceName, agentPoolName).getSyncPoller(); - } - - /** - * Upgrade node image version of an agent pool to the latest. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param agentPoolName The name of the agent pool. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, AgentPoolInner> beginUpgradeNodeImageVersion( - String resourceGroupName, String resourceName, String agentPoolName, Context context) { - return beginUpgradeNodeImageVersionAsync(resourceGroupName, resourceName, agentPoolName, context) - .getSyncPoller(); - } - - /** - * Upgrade node image version of an agent pool to the latest. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param agentPoolName The name of the agent pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono upgradeNodeImageVersionAsync( - String resourceGroupName, String resourceName, String agentPoolName) { - return beginUpgradeNodeImageVersionAsync(resourceGroupName, resourceName, agentPoolName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Upgrade node image version of an agent pool to the latest. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param agentPoolName The name of the agent pool. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono upgradeNodeImageVersionAsync( - String resourceGroupName, String resourceName, String agentPoolName, Context context) { - return beginUpgradeNodeImageVersionAsync(resourceGroupName, resourceName, agentPoolName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Upgrade node image version of an agent pool to the latest. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param agentPoolName The name of the agent pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AgentPoolInner upgradeNodeImageVersion(String resourceGroupName, String resourceName, String agentPoolName) { - return upgradeNodeImageVersionAsync(resourceGroupName, resourceName, agentPoolName).block(); - } - - /** - * Upgrade node image version of an agent pool to the latest. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param agentPoolName The name of the agent pool. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AgentPoolInner upgradeNodeImageVersion( - String resourceGroupName, String resourceName, String agentPoolName, Context context) { - return upgradeNodeImageVersionAsync(resourceGroupName, resourceName, agentPoolName, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the List Agent Pools operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the List Agent Pools operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/implementation/ContainerServiceManagementClientBuilder.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/implementation/ContainerServiceManagementClientBuilder.java deleted file mode 100644 index 59f579c098d4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/implementation/ContainerServiceManagementClientBuilder.java +++ /dev/null @@ -1,149 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.implementation; - -import com.azure.core.annotation.ServiceClientBuilder; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.policy.CookiePolicy; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerAdapter; -import java.time.Duration; - -/** A builder for creating a new instance of the ContainerServiceManagementClientImpl type. */ -@ServiceClientBuilder(serviceClients = {ContainerServiceManagementClientImpl.class}) -public final class ContainerServiceManagementClientBuilder { - /* - * Subscription credentials which uniquely identify Microsoft Azure - * subscription. The subscription ID forms part of the URI for every - * service call. - */ - private String subscriptionId; - - /** - * Sets Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms - * part of the URI for every service call. - * - * @param subscriptionId the subscriptionId value. - * @return the ContainerServiceManagementClientBuilder. - */ - public ContainerServiceManagementClientBuilder subscriptionId(String subscriptionId) { - this.subscriptionId = subscriptionId; - return this; - } - - /* - * server parameter - */ - private String endpoint; - - /** - * Sets server parameter. - * - * @param endpoint the endpoint value. - * @return the ContainerServiceManagementClientBuilder. - */ - public ContainerServiceManagementClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * The environment to connect to - */ - private AzureEnvironment environment; - - /** - * Sets The environment to connect to. - * - * @param environment the environment value. - * @return the ContainerServiceManagementClientBuilder. - */ - public ContainerServiceManagementClientBuilder environment(AzureEnvironment environment) { - this.environment = environment; - return this; - } - - /* - * The default poll interval for long-running operation - */ - private Duration defaultPollInterval; - - /** - * Sets The default poll interval for long-running operation. - * - * @param defaultPollInterval the defaultPollInterval value. - * @return the ContainerServiceManagementClientBuilder. - */ - public ContainerServiceManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = defaultPollInterval; - return this; - } - - /* - * The HTTP pipeline to send requests through - */ - private HttpPipeline pipeline; - - /** - * Sets The HTTP pipeline to send requests through. - * - * @param pipeline the pipeline value. - * @return the ContainerServiceManagementClientBuilder. - */ - public ContainerServiceManagementClientBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; - return this; - } - - /* - * The serializer to serialize an object into a string - */ - private SerializerAdapter serializerAdapter; - - /** - * Sets The serializer to serialize an object into a string. - * - * @param serializerAdapter the serializerAdapter value. - * @return the ContainerServiceManagementClientBuilder. - */ - public ContainerServiceManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { - this.serializerAdapter = serializerAdapter; - return this; - } - - /** - * Builds an instance of ContainerServiceManagementClientImpl with the provided parameters. - * - * @return an instance of ContainerServiceManagementClientImpl. - */ - public ContainerServiceManagementClientImpl buildClient() { - if (endpoint == null) { - this.endpoint = "https://management.azure.com"; - } - if (environment == null) { - this.environment = AzureEnvironment.AZURE; - } - if (defaultPollInterval == null) { - this.defaultPollInterval = Duration.ofSeconds(30); - } - if (pipeline == null) { - this.pipeline = - new HttpPipelineBuilder() - .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) - .build(); - } - if (serializerAdapter == null) { - this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); - } - ContainerServiceManagementClientImpl client = - new ContainerServiceManagementClientImpl( - pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); - return client; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/implementation/ContainerServiceManagementClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/implementation/ContainerServiceManagementClientImpl.java deleted file mode 100644 index 65acc0db02de..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/implementation/ContainerServiceManagementClientImpl.java +++ /dev/null @@ -1,223 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.implementation; - -import com.azure.core.annotation.ServiceClient; -import com.azure.core.http.HttpPipeline; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.serializer.SerializerAdapter; -import com.azure.resourcemanager.containerservice.fluent.AgentPoolsClient; -import com.azure.resourcemanager.containerservice.fluent.ContainerServiceManagementClient; -import com.azure.resourcemanager.containerservice.fluent.ContainerServicesClient; -import com.azure.resourcemanager.containerservice.fluent.ManagedClustersClient; -import com.azure.resourcemanager.containerservice.fluent.OpenShiftManagedClustersClient; -import com.azure.resourcemanager.containerservice.fluent.OperationsClient; -import com.azure.resourcemanager.containerservice.fluent.PrivateEndpointConnectionsClient; -import com.azure.resourcemanager.containerservice.fluent.PrivateLinkResourcesClient; -import com.azure.resourcemanager.containerservice.fluent.ResolvePrivateLinkServiceIdsClient; -import com.azure.resourcemanager.resources.fluentcore.AzureServiceClient; -import java.time.Duration; - -/** Initializes a new instance of the ContainerServiceManagementClientImpl type. */ -@ServiceClient(builder = ContainerServiceManagementClientBuilder.class) -public final class ContainerServiceManagementClientImpl extends AzureServiceClient - implements ContainerServiceManagementClient { - private final ClientLogger logger = new ClientLogger(ContainerServiceManagementClientImpl.class); - - /** - * Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of - * the URI for every service call. - */ - private final String subscriptionId; - - /** - * Gets Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms - * part of the URI for every service call. - * - * @return the subscriptionId value. - */ - public String getSubscriptionId() { - return this.subscriptionId; - } - - /** server parameter. */ - private final String endpoint; - - /** - * Gets server parameter. - * - * @return the endpoint value. - */ - public String getEndpoint() { - return this.endpoint; - } - - /** The HTTP pipeline to send requests through. */ - private final HttpPipeline httpPipeline; - - /** - * Gets The HTTP pipeline to send requests through. - * - * @return the httpPipeline value. - */ - public HttpPipeline getHttpPipeline() { - return this.httpPipeline; - } - - /** The serializer to serialize an object into a string. */ - private final SerializerAdapter serializerAdapter; - - /** - * Gets The serializer to serialize an object into a string. - * - * @return the serializerAdapter value. - */ - SerializerAdapter getSerializerAdapter() { - return this.serializerAdapter; - } - - /** The default poll interval for long-running operation. */ - private final Duration defaultPollInterval; - - /** - * Gets The default poll interval for long-running operation. - * - * @return the defaultPollInterval value. - */ - public Duration getDefaultPollInterval() { - return this.defaultPollInterval; - } - - /** The OpenShiftManagedClustersClient object to access its operations. */ - private final OpenShiftManagedClustersClient openShiftManagedClusters; - - /** - * Gets the OpenShiftManagedClustersClient object to access its operations. - * - * @return the OpenShiftManagedClustersClient object. - */ - public OpenShiftManagedClustersClient getOpenShiftManagedClusters() { - return this.openShiftManagedClusters; - } - - /** The OperationsClient object to access its operations. */ - private final OperationsClient operations; - - /** - * Gets the OperationsClient object to access its operations. - * - * @return the OperationsClient object. - */ - public OperationsClient getOperations() { - return this.operations; - } - - /** The ManagedClustersClient object to access its operations. */ - private final ManagedClustersClient managedClusters; - - /** - * Gets the ManagedClustersClient object to access its operations. - * - * @return the ManagedClustersClient object. - */ - public ManagedClustersClient getManagedClusters() { - return this.managedClusters; - } - - /** The AgentPoolsClient object to access its operations. */ - private final AgentPoolsClient agentPools; - - /** - * Gets the AgentPoolsClient object to access its operations. - * - * @return the AgentPoolsClient object. - */ - public AgentPoolsClient getAgentPools() { - return this.agentPools; - } - - /** The PrivateEndpointConnectionsClient object to access its operations. */ - private final PrivateEndpointConnectionsClient privateEndpointConnections; - - /** - * Gets the PrivateEndpointConnectionsClient object to access its operations. - * - * @return the PrivateEndpointConnectionsClient object. - */ - public PrivateEndpointConnectionsClient getPrivateEndpointConnections() { - return this.privateEndpointConnections; - } - - /** The PrivateLinkResourcesClient object to access its operations. */ - private final PrivateLinkResourcesClient privateLinkResources; - - /** - * Gets the PrivateLinkResourcesClient object to access its operations. - * - * @return the PrivateLinkResourcesClient object. - */ - public PrivateLinkResourcesClient getPrivateLinkResources() { - return this.privateLinkResources; - } - - /** The ResolvePrivateLinkServiceIdsClient object to access its operations. */ - private final ResolvePrivateLinkServiceIdsClient resolvePrivateLinkServiceIds; - - /** - * Gets the ResolvePrivateLinkServiceIdsClient object to access its operations. - * - * @return the ResolvePrivateLinkServiceIdsClient object. - */ - public ResolvePrivateLinkServiceIdsClient getResolvePrivateLinkServiceIds() { - return this.resolvePrivateLinkServiceIds; - } - - /** The ContainerServicesClient object to access its operations. */ - private final ContainerServicesClient containerServices; - - /** - * Gets the ContainerServicesClient object to access its operations. - * - * @return the ContainerServicesClient object. - */ - public ContainerServicesClient getContainerServices() { - return this.containerServices; - } - - /** - * Initializes an instance of ContainerServiceManagementClient client. - * - * @param httpPipeline The HTTP pipeline to send requests through. - * @param serializerAdapter The serializer to serialize an object into a string. - * @param defaultPollInterval The default poll interval for long-running operation. - * @param environment The Azure environment. - * @param subscriptionId Subscription credentials which uniquely identify Microsoft Azure subscription. The - * subscription ID forms part of the URI for every service call. - * @param endpoint server parameter. - */ - ContainerServiceManagementClientImpl( - HttpPipeline httpPipeline, - SerializerAdapter serializerAdapter, - Duration defaultPollInterval, - AzureEnvironment environment, - String subscriptionId, - String endpoint) { - super(httpPipeline, serializerAdapter, environment); - this.httpPipeline = httpPipeline; - this.serializerAdapter = serializerAdapter; - this.defaultPollInterval = defaultPollInterval; - this.subscriptionId = subscriptionId; - this.endpoint = endpoint; - this.openShiftManagedClusters = new OpenShiftManagedClustersClientImpl(this); - this.operations = new OperationsClientImpl(this); - this.managedClusters = new ManagedClustersClientImpl(this); - this.agentPools = new AgentPoolsClientImpl(this); - this.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(this); - this.privateLinkResources = new PrivateLinkResourcesClientImpl(this); - this.resolvePrivateLinkServiceIds = new ResolvePrivateLinkServiceIdsClientImpl(this); - this.containerServices = new ContainerServicesClientImpl(this); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/implementation/ContainerServicesClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/implementation/ContainerServicesClientImpl.java deleted file mode 100644 index 6b28fc6f6fe0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/implementation/ContainerServicesClientImpl.java +++ /dev/null @@ -1,1508 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.containerservice.fluent.ContainerServicesClient; -import com.azure.resourcemanager.containerservice.fluent.models.ContainerServiceInner; -import com.azure.resourcemanager.containerservice.fluent.models.OrchestratorVersionProfileListResultInner; -import com.azure.resourcemanager.containerservice.models.ContainerServiceListResult; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ContainerServicesClient. */ -public final class ContainerServicesClientImpl - implements InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete, - ContainerServicesClient { - private final ClientLogger logger = new ClientLogger(ContainerServicesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final ContainerServicesService service; - - /** The service client containing this operation class. */ - private final ContainerServiceManagementClientImpl client; - - /** - * Initializes an instance of ContainerServicesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ContainerServicesClientImpl(ContainerServiceManagementClientImpl client) { - this.service = - RestProxy.create(ContainerServicesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for ContainerServiceManagementClientContainerServices to be used by the - * proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "ContainerServiceMana") - private interface ContainerServicesService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/orchestrators") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listOrchestrators( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("location") String location, - @QueryParam("resource-type") String resourceType, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/containerServices") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" - + "/containerServices/{containerServiceName}") - @ExpectedResponses({200, 201, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("containerServiceName") String containerServiceName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") ContainerServiceInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" - + "/containerServices/{containerServiceName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("containerServiceName") String containerServiceName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" - + "/containerServices/{containerServiceName}") - @ExpectedResponses({202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("containerServiceName") String containerServiceName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" - + "/containerServices") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets a list of supported orchestrators in the specified subscription. The operation returns properties of each - * orchestrator including version, available upgrades and whether that version or upgrades are in preview. - * - * @param location The name of a supported Azure region. - * @param resourceType resource type for which the list of orchestrators needs to be returned. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of supported orchestrators in the specified subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listOrchestratorsWithResponseAsync( - String location, String resourceType) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - final String apiVersion = "2019-04-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listOrchestrators( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - location, - resourceType, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a list of supported orchestrators in the specified subscription. The operation returns properties of each - * orchestrator including version, available upgrades and whether that version or upgrades are in preview. - * - * @param location The name of a supported Azure region. - * @param resourceType resource type for which the list of orchestrators needs to be returned. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of supported orchestrators in the specified subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listOrchestratorsWithResponseAsync( - String location, String resourceType, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - final String apiVersion = "2019-04-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listOrchestrators( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - location, - resourceType, - accept, - context); - } - - /** - * Gets a list of supported orchestrators in the specified subscription. The operation returns properties of each - * orchestrator including version, available upgrades and whether that version or upgrades are in preview. - * - * @param location The name of a supported Azure region. - * @param resourceType resource type for which the list of orchestrators needs to be returned. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of supported orchestrators in the specified subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listOrchestratorsAsync( - String location, String resourceType) { - return listOrchestratorsWithResponseAsync(location, resourceType) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a list of supported orchestrators in the specified subscription. The operation returns properties of each - * orchestrator including version, available upgrades and whether that version or upgrades are in preview. - * - * @param location The name of a supported Azure region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of supported orchestrators in the specified subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listOrchestratorsAsync(String location) { - final String resourceType = null; - return listOrchestratorsWithResponseAsync(location, resourceType) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a list of supported orchestrators in the specified subscription. The operation returns properties of each - * orchestrator including version, available upgrades and whether that version or upgrades are in preview. - * - * @param location The name of a supported Azure region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of supported orchestrators in the specified subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public OrchestratorVersionProfileListResultInner listOrchestrators(String location) { - final String resourceType = null; - return listOrchestratorsAsync(location, resourceType).block(); - } - - /** - * Gets a list of supported orchestrators in the specified subscription. The operation returns properties of each - * orchestrator including version, available upgrades and whether that version or upgrades are in preview. - * - * @param location The name of a supported Azure region. - * @param resourceType resource type for which the list of orchestrators needs to be returned. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of supported orchestrators in the specified subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listOrchestratorsWithResponse( - String location, String resourceType, Context context) { - return listOrchestratorsWithResponseAsync(location, resourceType, context).block(); - } - - /** - * Gets a list of container services in the specified subscription. The operation returns properties of each - * container service including state, orchestrator, number of masters and agents, and FQDNs of masters and agents. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of container services in the specified subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-07-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a list of container services in the specified subscription. The operation returns properties of each - * container service including state, orchestrator, number of masters and agents, and FQDNs of masters and agents. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of container services in the specified subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-07-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets a list of container services in the specified subscription. The operation returns properties of each - * container service including state, orchestrator, number of masters and agents, and FQDNs of masters and agents. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of container services in the specified subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets a list of container services in the specified subscription. The operation returns properties of each - * container service including state, orchestrator, number of masters and agents, and FQDNs of masters and agents. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of container services in the specified subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets a list of container services in the specified subscription. The operation returns properties of each - * container service including state, orchestrator, number of masters and agents, and FQDNs of masters and agents. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of container services in the specified subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Gets a list of container services in the specified subscription. The operation returns properties of each - * container service including state, orchestrator, number of masters and agents, and FQDNs of masters and agents. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of container services in the specified subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Creates or updates a container service with the specified configuration of orchestrator, masters, and agents. - * - * @param resourceGroupName The name of the resource group. - * @param containerServiceName The name of the container service in the specified subscription and resource group. - * @param parameters Parameters supplied to the Create or Update a Container Service operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return container service. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String containerServiceName, ContainerServiceInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (containerServiceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter containerServiceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2017-07-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - containerServiceName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a container service with the specified configuration of orchestrator, masters, and agents. - * - * @param resourceGroupName The name of the resource group. - * @param containerServiceName The name of the container service in the specified subscription and resource group. - * @param parameters Parameters supplied to the Create or Update a Container Service operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return container service. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String containerServiceName, ContainerServiceInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (containerServiceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter containerServiceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2017-07-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - containerServiceName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Creates or updates a container service with the specified configuration of orchestrator, masters, and agents. - * - * @param resourceGroupName The name of the resource group. - * @param containerServiceName The name of the container service in the specified subscription and resource group. - * @param parameters Parameters supplied to the Create or Update a Container Service operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return container service. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, ContainerServiceInner> beginCreateOrUpdateAsync( - String resourceGroupName, String containerServiceName, ContainerServiceInner parameters) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, containerServiceName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ContainerServiceInner.class, - ContainerServiceInner.class, - Context.NONE); - } - - /** - * Creates or updates a container service with the specified configuration of orchestrator, masters, and agents. - * - * @param resourceGroupName The name of the resource group. - * @param containerServiceName The name of the container service in the specified subscription and resource group. - * @param parameters Parameters supplied to the Create or Update a Container Service operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return container service. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, ContainerServiceInner> beginCreateOrUpdateAsync( - String resourceGroupName, String containerServiceName, ContainerServiceInner parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, containerServiceName, parameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), ContainerServiceInner.class, ContainerServiceInner.class, context); - } - - /** - * Creates or updates a container service with the specified configuration of orchestrator, masters, and agents. - * - * @param resourceGroupName The name of the resource group. - * @param containerServiceName The name of the container service in the specified subscription and resource group. - * @param parameters Parameters supplied to the Create or Update a Container Service operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return container service. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, ContainerServiceInner> beginCreateOrUpdate( - String resourceGroupName, String containerServiceName, ContainerServiceInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, containerServiceName, parameters).getSyncPoller(); - } - - /** - * Creates or updates a container service with the specified configuration of orchestrator, masters, and agents. - * - * @param resourceGroupName The name of the resource group. - * @param containerServiceName The name of the container service in the specified subscription and resource group. - * @param parameters Parameters supplied to the Create or Update a Container Service operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return container service. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, ContainerServiceInner> beginCreateOrUpdate( - String resourceGroupName, String containerServiceName, ContainerServiceInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, containerServiceName, parameters, context).getSyncPoller(); - } - - /** - * Creates or updates a container service with the specified configuration of orchestrator, masters, and agents. - * - * @param resourceGroupName The name of the resource group. - * @param containerServiceName The name of the container service in the specified subscription and resource group. - * @param parameters Parameters supplied to the Create or Update a Container Service operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return container service. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, String containerServiceName, ContainerServiceInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, containerServiceName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a container service with the specified configuration of orchestrator, masters, and agents. - * - * @param resourceGroupName The name of the resource group. - * @param containerServiceName The name of the container service in the specified subscription and resource group. - * @param parameters Parameters supplied to the Create or Update a Container Service operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return container service. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String containerServiceName, ContainerServiceInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, containerServiceName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a container service with the specified configuration of orchestrator, masters, and agents. - * - * @param resourceGroupName The name of the resource group. - * @param containerServiceName The name of the container service in the specified subscription and resource group. - * @param parameters Parameters supplied to the Create or Update a Container Service operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return container service. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ContainerServiceInner createOrUpdate( - String resourceGroupName, String containerServiceName, ContainerServiceInner parameters) { - return createOrUpdateAsync(resourceGroupName, containerServiceName, parameters).block(); - } - - /** - * Creates or updates a container service with the specified configuration of orchestrator, masters, and agents. - * - * @param resourceGroupName The name of the resource group. - * @param containerServiceName The name of the container service in the specified subscription and resource group. - * @param parameters Parameters supplied to the Create or Update a Container Service operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return container service. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ContainerServiceInner createOrUpdate( - String resourceGroupName, String containerServiceName, ContainerServiceInner parameters, Context context) { - return createOrUpdateAsync(resourceGroupName, containerServiceName, parameters, context).block(); - } - - /** - * Gets the properties of the specified container service in the specified subscription and resource group. The - * operation returns the properties including state, orchestrator, number of masters and agents, and FQDNs of - * masters and agents. - * - * @param resourceGroupName The name of the resource group. - * @param containerServiceName The name of the container service in the specified subscription and resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the specified container service in the specified subscription and resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String containerServiceName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (containerServiceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter containerServiceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-07-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - containerServiceName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the properties of the specified container service in the specified subscription and resource group. The - * operation returns the properties including state, orchestrator, number of masters and agents, and FQDNs of - * masters and agents. - * - * @param resourceGroupName The name of the resource group. - * @param containerServiceName The name of the container service in the specified subscription and resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the specified container service in the specified subscription and resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String containerServiceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (containerServiceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter containerServiceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-07-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - containerServiceName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets the properties of the specified container service in the specified subscription and resource group. The - * operation returns the properties including state, orchestrator, number of masters and agents, and FQDNs of - * masters and agents. - * - * @param resourceGroupName The name of the resource group. - * @param containerServiceName The name of the container service in the specified subscription and resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the specified container service in the specified subscription and resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync(String resourceGroupName, String containerServiceName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, containerServiceName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the properties of the specified container service in the specified subscription and resource group. The - * operation returns the properties including state, orchestrator, number of masters and agents, and FQDNs of - * masters and agents. - * - * @param resourceGroupName The name of the resource group. - * @param containerServiceName The name of the container service in the specified subscription and resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the specified container service in the specified subscription and resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ContainerServiceInner getByResourceGroup(String resourceGroupName, String containerServiceName) { - return getByResourceGroupAsync(resourceGroupName, containerServiceName).block(); - } - - /** - * Gets the properties of the specified container service in the specified subscription and resource group. The - * operation returns the properties including state, orchestrator, number of masters and agents, and FQDNs of - * masters and agents. - * - * @param resourceGroupName The name of the resource group. - * @param containerServiceName The name of the container service in the specified subscription and resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the specified container service in the specified subscription and resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String containerServiceName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, containerServiceName, context).block(); - } - - /** - * Deletes the specified container service in the specified subscription and resource group. The operation does not - * delete other resources created as part of creating a container service, including storage accounts, VMs, and - * availability sets. All the other resources created with the container service are part of the same resource group - * and can be deleted individually. - * - * @param resourceGroupName The name of the resource group. - * @param containerServiceName The name of the container service in the specified subscription and resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync( - String resourceGroupName, String containerServiceName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (containerServiceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter containerServiceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-07-01"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - containerServiceName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the specified container service in the specified subscription and resource group. The operation does not - * delete other resources created as part of creating a container service, including storage accounts, VMs, and - * availability sets. All the other resources created with the container service are part of the same resource group - * and can be deleted individually. - * - * @param resourceGroupName The name of the resource group. - * @param containerServiceName The name of the container service in the specified subscription and resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String containerServiceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (containerServiceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter containerServiceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-07-01"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - containerServiceName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Deletes the specified container service in the specified subscription and resource group. The operation does not - * delete other resources created as part of creating a container service, including storage accounts, VMs, and - * availability sets. All the other resources created with the container service are part of the same resource group - * and can be deleted individually. - * - * @param resourceGroupName The name of the resource group. - * @param containerServiceName The name of the container service in the specified subscription and resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String containerServiceName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, containerServiceName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deletes the specified container service in the specified subscription and resource group. The operation does not - * delete other resources created as part of creating a container service, including storage accounts, VMs, and - * availability sets. All the other resources created with the container service are part of the same resource group - * and can be deleted individually. - * - * @param resourceGroupName The name of the resource group. - * @param containerServiceName The name of the container service in the specified subscription and resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String containerServiceName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, containerServiceName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes the specified container service in the specified subscription and resource group. The operation does not - * delete other resources created as part of creating a container service, including storage accounts, VMs, and - * availability sets. All the other resources created with the container service are part of the same resource group - * and can be deleted individually. - * - * @param resourceGroupName The name of the resource group. - * @param containerServiceName The name of the container service in the specified subscription and resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete(String resourceGroupName, String containerServiceName) { - return beginDeleteAsync(resourceGroupName, containerServiceName).getSyncPoller(); - } - - /** - * Deletes the specified container service in the specified subscription and resource group. The operation does not - * delete other resources created as part of creating a container service, including storage accounts, VMs, and - * availability sets. All the other resources created with the container service are part of the same resource group - * and can be deleted individually. - * - * @param resourceGroupName The name of the resource group. - * @param containerServiceName The name of the container service in the specified subscription and resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String containerServiceName, Context context) { - return beginDeleteAsync(resourceGroupName, containerServiceName, context).getSyncPoller(); - } - - /** - * Deletes the specified container service in the specified subscription and resource group. The operation does not - * delete other resources created as part of creating a container service, including storage accounts, VMs, and - * availability sets. All the other resources created with the container service are part of the same resource group - * and can be deleted individually. - * - * @param resourceGroupName The name of the resource group. - * @param containerServiceName The name of the container service in the specified subscription and resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String containerServiceName) { - return beginDeleteAsync(resourceGroupName, containerServiceName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified container service in the specified subscription and resource group. The operation does not - * delete other resources created as part of creating a container service, including storage accounts, VMs, and - * availability sets. All the other resources created with the container service are part of the same resource group - * and can be deleted individually. - * - * @param resourceGroupName The name of the resource group. - * @param containerServiceName The name of the container service in the specified subscription and resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String containerServiceName, Context context) { - return beginDeleteAsync(resourceGroupName, containerServiceName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified container service in the specified subscription and resource group. The operation does not - * delete other resources created as part of creating a container service, including storage accounts, VMs, and - * availability sets. All the other resources created with the container service are part of the same resource group - * and can be deleted individually. - * - * @param resourceGroupName The name of the resource group. - * @param containerServiceName The name of the container service in the specified subscription and resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String containerServiceName) { - deleteAsync(resourceGroupName, containerServiceName).block(); - } - - /** - * Deletes the specified container service in the specified subscription and resource group. The operation does not - * delete other resources created as part of creating a container service, including storage accounts, VMs, and - * availability sets. All the other resources created with the container service are part of the same resource group - * and can be deleted individually. - * - * @param resourceGroupName The name of the resource group. - * @param containerServiceName The name of the container service in the specified subscription and resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String containerServiceName, Context context) { - deleteAsync(resourceGroupName, containerServiceName, context).block(); - } - - /** - * Gets a list of container services in the specified subscription and resource group. The operation returns - * properties of each container service including state, orchestrator, number of masters and agents, and FQDNs of - * masters and agents. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of container services in the specified subscription and resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-07-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a list of container services in the specified subscription and resource group. The operation returns - * properties of each container service including state, orchestrator, number of masters and agents, and FQDNs of - * masters and agents. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of container services in the specified subscription and resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-07-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets a list of container services in the specified subscription and resource group. The operation returns - * properties of each container service including state, orchestrator, number of masters and agents, and FQDNs of - * masters and agents. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of container services in the specified subscription and resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * Gets a list of container services in the specified subscription and resource group. The operation returns - * properties of each container service including state, orchestrator, number of masters and agents, and FQDNs of - * masters and agents. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of container services in the specified subscription and resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets a list of container services in the specified subscription and resource group. The operation returns - * properties of each container service including state, orchestrator, number of masters and agents, and FQDNs of - * masters and agents. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of container services in the specified subscription and resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * Gets a list of container services in the specified subscription and resource group. The operation returns - * properties of each container service including state, orchestrator, number of masters and agents, and FQDNs of - * masters and agents. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of container services in the specified subscription and resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the List Container Services operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the List Container Services operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the List Container Services operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the List Container Services operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/implementation/KubernetesClusterAgentPoolImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/implementation/KubernetesClusterAgentPoolImpl.java deleted file mode 100644 index 70139646bf37..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/implementation/KubernetesClusterAgentPoolImpl.java +++ /dev/null @@ -1,320 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.containerservice.implementation; - -import com.azure.resourcemanager.containerservice.fluent.models.AgentPoolInner; -import com.azure.resourcemanager.containerservice.models.AgentPoolMode; -import com.azure.resourcemanager.containerservice.models.AgentPoolType; -import com.azure.resourcemanager.containerservice.models.ContainerServiceVMSizeTypes; -import com.azure.resourcemanager.containerservice.models.KubernetesCluster; -import com.azure.resourcemanager.containerservice.models.KubernetesClusterAgentPool; -import com.azure.resourcemanager.containerservice.models.ManagedClusterAgentPoolProfile; -import com.azure.resourcemanager.containerservice.models.OSDiskType; -import com.azure.resourcemanager.containerservice.models.OSType; -import com.azure.resourcemanager.containerservice.models.PowerState; -import com.azure.resourcemanager.containerservice.models.ScaleSetEvictionPolicy; -import com.azure.resourcemanager.containerservice.models.ScaleSetPriority; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils; -import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.ChildResourceImpl; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; - -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.TreeMap; -import java.util.stream.Collectors; - -/** The implementation for KubernetesClusterAgentPool and its create and update interfaces. */ -public class KubernetesClusterAgentPoolImpl - extends ChildResourceImpl - implements KubernetesClusterAgentPool, - KubernetesClusterAgentPool.Definition, - KubernetesClusterAgentPool.Update { - - private String subnetName; - - KubernetesClusterAgentPoolImpl(ManagedClusterAgentPoolProfile inner, KubernetesClusterImpl parent) { - super(inner, parent); - String subnetId = (inner != null) ? this.innerModel().vnetSubnetId() : null; - this.subnetName = ResourceUtils.nameFromResourceId(subnetId); - } - - @Override - public String name() { - return this.innerModel().name(); - } - - @Override - public String provisioningState() { - return this.innerModel().provisioningState(); - } - - @Override - public int count() { - return this.innerModel().count(); - } - - @Override - public ContainerServiceVMSizeTypes vmSize() { - return this.innerModel().vmSize(); - } - - @Override - public int osDiskSizeInGB() { - return this.innerModel().osDiskSizeGB(); - } - - @Override - public OSType osType() { - return this.innerModel().osType(); - } - - @Override - public AgentPoolType type() { - return this.innerModel().type(); - } - - @Override - public AgentPoolMode mode() { - return this.innerModel().mode(); - } - - @Override - public String subnetName() { - if (this.subnetName != null) { - return this.subnetName; - } else { - return ResourceUtils.nameFromResourceId(this.innerModel().vnetSubnetId()); - } - } - - @Override - public String networkId() { - String subnetId = (this.innerModel() != null) ? this.innerModel().vnetSubnetId() : null; - return (subnetId != null) ? ResourceUtils.parentResourceIdFromResourceId(subnetId) : null; - } - - @Override - public List availabilityZones() { - return innerModel().availabilityZones(); - } - - @Override - public Map nodeLabels() { - return innerModel().nodeLabels() == null ? null : Collections.unmodifiableMap(innerModel().nodeLabels()); - } - - @Override - public List nodeTaints() { - return innerModel().nodeTaints() == null ? null : Collections.unmodifiableList(innerModel().nodeTaints()); - } - - @Override - public PowerState powerState() { - return innerModel().powerState(); - } - - @Override - public boolean isAutoScalingEnabled() { - return ResourceManagerUtils.toPrimitiveBoolean(innerModel().enableAutoScaling()); - } - - @Override - public int nodeSize() { - return ResourceManagerUtils.toPrimitiveInt(innerModel().count()); - } - - @Override - public int maximumPodsPerNode() { - return ResourceManagerUtils.toPrimitiveInt(innerModel().maxPods()); - } - - @Override - public int minimumNodeSize() { - return ResourceManagerUtils.toPrimitiveInt(innerModel().minCount()); - } - - @Override - public int maximumNodeSize() { - return ResourceManagerUtils.toPrimitiveInt(innerModel().maxCount()); - } - - @Override - public ScaleSetPriority virtualMachinePriority() { - return innerModel().scaleSetPriority(); - } - - @Override - public ScaleSetEvictionPolicy virtualMachineEvictionPolicy() { - return innerModel().scaleSetEvictionPolicy(); - } - - @Override - public Double virtualMachineMaximumPrice() { - return innerModel().spotMaxPrice().doubleValue(); - } - - @Override - public OSDiskType osDiskType() { - return innerModel().osDiskType(); - } - - - @Override - public KubernetesClusterAgentPoolImpl withVirtualMachineSize(ContainerServiceVMSizeTypes vmSize) { - this.innerModel().withVmSize(vmSize); - return this; - } - - @Override - public KubernetesClusterAgentPoolImpl withOSType(OSType osType) { - this.innerModel().withOsType(osType); - return this; - } - - @Override - public KubernetesClusterAgentPoolImpl withOSDiskSizeInGB(int osDiskSizeInGB) { - this.innerModel().withOsDiskSizeGB(osDiskSizeInGB); - return this; - } - - @Override - public KubernetesClusterAgentPoolImpl withAgentPoolType(AgentPoolType agentPoolType) { - this.innerModel().withType(agentPoolType); - return this; - } - - @Override - public KubernetesClusterAgentPoolImpl withAgentPoolTypeName(String agentPoolTypeName) { - this.innerModel().withType(AgentPoolType.fromString(agentPoolTypeName)); - return this; - } - - @Override - public KubernetesClusterAgentPoolImpl withAgentPoolVirtualMachineCount(int count) { - this.innerModel().withCount(count); - return this; - } - - @Override - public KubernetesClusterAgentPoolImpl withMaxPodsCount(int podsCount) { - this.innerModel().withMaxPods(podsCount); - return this; - } - - @Override - public KubernetesClusterAgentPoolImpl withVirtualNetwork(String virtualNetworkId, String subnetName) { - String vnetSubnetId = virtualNetworkId + "/subnets/" + subnetName; - this.subnetName = subnetName; - this.innerModel().withVnetSubnetId(vnetSubnetId); - return this; - } - - @Override - public KubernetesClusterImpl attach() { - return this.parent().addNewAgentPool(this); - } - - public AgentPoolInner getAgentPoolInner() { - AgentPoolInner agentPoolInner = new AgentPoolInner(); - agentPoolInner.withCount(innerModel().count()); - agentPoolInner.withVmSize(innerModel().vmSize()); - agentPoolInner.withOsDiskSizeGB(innerModel().osDiskSizeGB()); - agentPoolInner.withVnetSubnetId(innerModel().vnetSubnetId()); - agentPoolInner.withMaxPods(innerModel().maxPods()); - agentPoolInner.withOsType(innerModel().osType()); - agentPoolInner.withMaxCount(innerModel().maxCount()); - agentPoolInner.withMinCount(innerModel().minCount()); - agentPoolInner.withEnableAutoScaling(innerModel().enableAutoScaling()); - agentPoolInner.withTypePropertiesType(innerModel().type()); - agentPoolInner.withMode(innerModel().mode()); - agentPoolInner.withOrchestratorVersion(innerModel().orchestratorVersion()); - // nodeImageVersion is readOnly now -// agentPoolInner.withNodeImageVersion(innerModel().nodeImageVersion()); - agentPoolInner.withUpgradeSettings(innerModel().upgradeSettings()); - agentPoolInner.withAvailabilityZones(innerModel().availabilityZones()); - agentPoolInner.withEnableNodePublicIp(innerModel().enableNodePublicIp()); - agentPoolInner.withScaleSetPriority(innerModel().scaleSetPriority()); - agentPoolInner.withScaleSetEvictionPolicy(innerModel().scaleSetEvictionPolicy()); - agentPoolInner.withSpotMaxPrice(innerModel().spotMaxPrice()); - agentPoolInner.withTags(innerModel().tags()); - agentPoolInner.withNodeLabels(innerModel().nodeLabels()); - agentPoolInner.withNodeTaints(innerModel().nodeTaints()); - agentPoolInner.withProximityPlacementGroupId(innerModel().proximityPlacementGroupId()); - agentPoolInner.withKubeletConfig(innerModel().kubeletConfig()); - agentPoolInner.withLinuxOSConfig(innerModel().linuxOSConfig()); - return agentPoolInner; - } - - @Override - public KubernetesClusterAgentPoolImpl withAgentPoolMode(AgentPoolMode agentPoolMode) { - innerModel().withMode(agentPoolMode); - return this; - } - - @Override - public KubernetesClusterAgentPoolImpl withAutoScaling(int minimumNodeSize, int maximumNodeSize) { - innerModel().withEnableAutoScaling(true); - innerModel().withMinCount(minimumNodeSize); - innerModel().withMaxCount(maximumNodeSize); - return this; - } - - @Override - public Update withoutAutoScaling() { - innerModel().withEnableAutoScaling(false); - innerModel().withMinCount(null); - innerModel().withMaxCount(null); - return this; - } - - @Override - public KubernetesClusterAgentPoolImpl withAvailabilityZones(Integer... zones) { - innerModel().withAvailabilityZones(Arrays.stream(zones).map(String::valueOf).collect(Collectors.toList())); - return this; - } - - @Override - public KubernetesClusterAgentPoolImpl withNodeLabels(Map nodeLabels) { - innerModel().withNodeLabels(nodeLabels == null ? null : new TreeMap<>(nodeLabels)); - return this; - } - - @Override - public KubernetesClusterAgentPoolImpl withNodeTaints(List nodeTaints) { - innerModel().withNodeTaints(nodeTaints); - return this; - } - - @Override - public KubernetesClusterAgentPoolImpl withVirtualMachinePriority(ScaleSetPriority priority) { - innerModel().withScaleSetPriority(priority); - return this; - } - - @Override - public KubernetesClusterAgentPoolImpl withSpotPriorityVirtualMachine() { - innerModel().withScaleSetPriority(ScaleSetPriority.SPOT); - return this; - } - - @Override - public KubernetesClusterAgentPoolImpl withSpotPriorityVirtualMachine(ScaleSetEvictionPolicy policy) { - innerModel().withScaleSetPriority(ScaleSetPriority.SPOT); - innerModel().withScaleSetEvictionPolicy(policy); - return this; - } - - @Override - public KubernetesClusterAgentPoolImpl withVirtualMachineMaximumPrice(Double maxPriceInUsDollars) { - innerModel().withSpotMaxPrice(maxPriceInUsDollars.floatValue()); - return this; - } - - @Override - public KubernetesClusterAgentPoolImpl withOSDiskType(OSDiskType osDiskType) { - innerModel().withOsDiskType(osDiskType); - return this; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/implementation/KubernetesClusterImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/implementation/KubernetesClusterImpl.java deleted file mode 100644 index ea2e7c994d3c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/implementation/KubernetesClusterImpl.java +++ /dev/null @@ -1,564 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.containerservice.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.containerservice.ContainerServiceManager; -import com.azure.resourcemanager.containerservice.fluent.models.ManagedClusterInner; -import com.azure.resourcemanager.containerservice.fluent.models.PrivateEndpointConnectionInner; -import com.azure.resourcemanager.containerservice.fluent.models.PrivateLinkResourceInner; -import com.azure.resourcemanager.containerservice.models.ContainerServiceLinuxProfile; -import com.azure.resourcemanager.containerservice.models.ContainerServiceNetworkProfile; -import com.azure.resourcemanager.containerservice.models.ContainerServiceSshConfiguration; -import com.azure.resourcemanager.containerservice.models.ContainerServiceSshPublicKey; -import com.azure.resourcemanager.containerservice.models.CredentialResult; -import com.azure.resourcemanager.containerservice.models.KubernetesCluster; -import com.azure.resourcemanager.containerservice.models.KubernetesClusterAgentPool; -import com.azure.resourcemanager.containerservice.models.ManagedClusterAddonProfile; -import com.azure.resourcemanager.containerservice.models.ManagedClusterAgentPoolProfile; -import com.azure.resourcemanager.containerservice.models.ManagedClusterApiServerAccessProfile; -import com.azure.resourcemanager.containerservice.models.ManagedClusterIdentity; -import com.azure.resourcemanager.containerservice.models.ManagedClusterPropertiesAutoScalerProfile; -import com.azure.resourcemanager.containerservice.models.ManagedClusterServicePrincipalProfile; -import com.azure.resourcemanager.containerservice.models.PowerState; -import com.azure.resourcemanager.containerservice.models.ResourceIdentityType; -import com.azure.resourcemanager.containerservice.models.UserAssignedIdentity; -import com.azure.resourcemanager.resources.fluentcore.arm.models.PrivateEndpoint; -import com.azure.resourcemanager.resources.fluentcore.arm.models.PrivateEndpointConnection; -import com.azure.resourcemanager.resources.fluentcore.arm.models.PrivateEndpointConnectionProvisioningState; -import com.azure.resourcemanager.resources.fluentcore.arm.models.PrivateLinkResource; -import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.GroupableResourceImpl; -import com.azure.resourcemanager.resources.fluentcore.utils.PagedConverter; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -/** The implementation for KubernetesCluster and its create and update interfaces. */ -public class KubernetesClusterImpl - extends GroupableResourceImpl< - KubernetesCluster, ManagedClusterInner, KubernetesClusterImpl, ContainerServiceManager> - implements KubernetesCluster, KubernetesCluster.Definition, KubernetesCluster.Update { - private final ClientLogger logger = new ClientLogger(getClass()); - - private List adminKubeConfigs; - private List userKubeConfigs; - - protected KubernetesClusterImpl(String name, ManagedClusterInner innerObject, ContainerServiceManager manager) { - super(name, innerObject, manager); - if (this.innerModel().agentPoolProfiles() == null) { - this.innerModel().withAgentPoolProfiles(new ArrayList<>()); - } - - this.adminKubeConfigs = null; - this.userKubeConfigs = null; - } - - @Override - public String provisioningState() { - return this.innerModel().provisioningState(); - } - - @Override - public String dnsPrefix() { - return this.innerModel().dnsPrefix(); - } - - @Override - public String fqdn() { - return this.innerModel().fqdn(); - } - - @Override - public String version() { - return this.innerModel().kubernetesVersion(); - } - - @Override - public List adminKubeConfigs() { - if (this.adminKubeConfigs == null || this.adminKubeConfigs.size() == 0) { - this.adminKubeConfigs = - this.manager().kubernetesClusters().listAdminKubeConfigContent(this.resourceGroupName(), this.name()); - } - return Collections.unmodifiableList(this.adminKubeConfigs); - } - - @Override - public List userKubeConfigs() { - if (this.userKubeConfigs == null || this.userKubeConfigs.size() == 0) { - this.userKubeConfigs = - this.manager().kubernetesClusters().listUserKubeConfigContent(this.resourceGroupName(), this.name()); - } - return Collections.unmodifiableList(this.userKubeConfigs); - } - - @Override - public byte[] adminKubeConfigContent() { - for (CredentialResult config : adminKubeConfigs()) { - return config.value(); - } - return new byte[0]; - } - - @Override - public byte[] userKubeConfigContent() { - for (CredentialResult config : userKubeConfigs()) { - return config.value(); - } - return new byte[0]; - } - - @Override - public String servicePrincipalClientId() { - if (this.innerModel().servicePrincipalProfile() != null) { - return this.innerModel().servicePrincipalProfile().clientId(); - } else { - return null; - } - } - - @Override - public String servicePrincipalSecret() { - if (this.innerModel().servicePrincipalProfile() != null) { - return this.innerModel().servicePrincipalProfile().secret(); - } else { - return null; - } - } - - @Override - public String linuxRootUsername() { - if (this.innerModel().linuxProfile() != null) { - return this.innerModel().linuxProfile().adminUsername(); - } else { - return null; - } - } - - @Override - public String sshKey() { - if (this.innerModel().linuxProfile() == null - || this.innerModel().linuxProfile().ssh() == null - || this.innerModel().linuxProfile().ssh().publicKeys() == null - || this.innerModel().linuxProfile().ssh().publicKeys().size() == 0) { - return null; - } else { - return this.innerModel().linuxProfile().ssh().publicKeys().get(0).keyData(); - } - } - - @Override - public Map agentPools() { - Map agentPoolMap = new HashMap<>(); - if (this.innerModel().agentPoolProfiles() != null && this.innerModel().agentPoolProfiles().size() > 0) { - for (ManagedClusterAgentPoolProfile agentPoolProfile : this.innerModel().agentPoolProfiles()) { - agentPoolMap.put(agentPoolProfile.name(), new KubernetesClusterAgentPoolImpl(agentPoolProfile, this)); - } - } - - return Collections.unmodifiableMap(agentPoolMap); - } - - @Override - public ContainerServiceNetworkProfile networkProfile() { - return this.innerModel().networkProfile(); - } - - @Override - public Map addonProfiles() { - return Collections.unmodifiableMap(this.innerModel().addonProfiles()); - } - - @Override - public String nodeResourceGroup() { - return this.innerModel().nodeResourceGroup(); - } - - @Override - public boolean enableRBAC() { - return this.innerModel().enableRbac(); - } - - @Override - public PowerState powerState() { - return this.innerModel().powerState(); - } - - @Override - public String systemAssignedManagedServiceIdentityPrincipalId() { - String objectId = null; - if (this.innerModel().identityProfile() != null) { - UserAssignedIdentity identity = - this.innerModel().identityProfile().get("kubeletidentity"); - if (identity != null) { - objectId = identity.objectId(); - } - } - return objectId; - } - - @Override - public void start() { - this.startAsync().block(); - } - - @Override - public Mono startAsync() { - return manager().kubernetesClusters().startAsync(this.resourceGroupName(), this.name()); - } - - @Override - public void stop() { - this.stopAsync().block(); - } - - @Override - public Mono stopAsync() { - return manager().kubernetesClusters().stopAsync(this.resourceGroupName(), this.name()); - } - - private Mono> listAdminConfig(final KubernetesClusterImpl self) { - return this - .manager() - .kubernetesClusters() - .listAdminKubeConfigContentAsync(self.resourceGroupName(), self.name()) - .map( - kubeConfigs -> { - self.adminKubeConfigs = kubeConfigs; - return self.adminKubeConfigs; - }); - } - - private Mono> listUserConfig(final KubernetesClusterImpl self) { - return this - .manager() - .kubernetesClusters() - .listUserKubeConfigContentAsync(self.resourceGroupName(), self.name()) - .map( - kubeConfigs -> { - self.userKubeConfigs = kubeConfigs; - return self.userKubeConfigs; - }); - } - - @Override - protected Mono getInnerAsync() { - final KubernetesClusterImpl self = this; - final Mono> adminConfig = listAdminConfig(self); - final Mono> userConfig = listUserConfig(self); - return this - .manager() - .serviceClient() - .getManagedClusters() - .getByResourceGroupAsync(this.resourceGroupName(), this.name()) - .flatMap( - managedClusterInner -> Flux.merge(adminConfig, userConfig).last().map(bytes -> managedClusterInner)); - } - - @Override - public Mono createResourceAsync() { - final KubernetesClusterImpl self = this; - if (!this.isInCreateMode()) { - this.innerModel().withServicePrincipalProfile(null); - } - final Mono> adminConfig = listAdminConfig(self); - final Mono> userConfig = listUserConfig(self); - - return this - .manager() - .serviceClient() - .getManagedClusters() - .createOrUpdateAsync(self.resourceGroupName(), self.name(), self.innerModel()) - .flatMap( - inner -> - Flux - .merge(adminConfig, userConfig) - .last() - .map( - bytes -> { - self.setInner(inner); - return self; - })); - } - - @Override - public KubernetesClusterImpl withVersion(String kubernetesVersion) { - this.innerModel().withKubernetesVersion(kubernetesVersion); - return this; - } - - @Override - public KubernetesClusterImpl withDefaultVersion() { - this.innerModel().withKubernetesVersion(""); - return this; - } - - @Override - public KubernetesClusterImpl withRootUsername(String rootUserName) { - if (this.innerModel().linuxProfile() == null) { - this.innerModel().withLinuxProfile(new ContainerServiceLinuxProfile()); - } - this.innerModel().linuxProfile().withAdminUsername(rootUserName); - - return this; - } - - @Override - public KubernetesClusterImpl withSshKey(String sshKeyData) { - this - .innerModel() - .linuxProfile() - .withSsh( - new ContainerServiceSshConfiguration().withPublicKeys(new ArrayList())); - this.innerModel().linuxProfile().ssh().publicKeys().add( - new ContainerServiceSshPublicKey().withKeyData(sshKeyData)); - - return this; - } - - @Override - public KubernetesClusterImpl withServicePrincipalClientId(String clientId) { - this.innerModel().withServicePrincipalProfile( - new ManagedClusterServicePrincipalProfile().withClientId(clientId)); - return this; - } - - @Override - public KubernetesClusterImpl withSystemAssignedManagedServiceIdentity() { - this.innerModel().withIdentity(new ManagedClusterIdentity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)); - return this; - } - -// @Override -// public KubernetesClusterImpl enableRoleBasedAccessControl() { -// this.innerModel().withEnableRbac(true); -// return this; -// } - - @Override - public KubernetesClusterImpl withServicePrincipalSecret(String secret) { - this.innerModel().servicePrincipalProfile().withSecret(secret); - return this; - } - - @Override - public KubernetesClusterImpl withDnsPrefix(String dnsPrefix) { - this.innerModel().withDnsPrefix(dnsPrefix); - return this; - } - - @Override - public KubernetesClusterAgentPoolImpl defineAgentPool(String name) { - ManagedClusterAgentPoolProfile innerPoolProfile = new ManagedClusterAgentPoolProfile(); - innerPoolProfile.withName(name); - return new KubernetesClusterAgentPoolImpl(innerPoolProfile, this); - } - - @Override - public KubernetesClusterAgentPoolImpl updateAgentPool(String name) { - for (ManagedClusterAgentPoolProfile agentPoolProfile : innerModel().agentPoolProfiles()) { - if (agentPoolProfile.name().equals(name)) { - return new KubernetesClusterAgentPoolImpl(agentPoolProfile, this); - } - } - throw logger.logExceptionAsError(new IllegalArgumentException(String.format( - "Cannot get agent pool named %s", name))); - } - - @Override - public Update withoutAgentPool(String name) { - if (innerModel().agentPoolProfiles() != null) { - innerModel().withAgentPoolProfiles( - innerModel().agentPoolProfiles().stream() - .filter(p -> !name.equals(p.name())) - .collect(Collectors.toList())); - - this.addDependency(context -> - manager().serviceClient().getAgentPools().deleteAsync(resourceGroupName(), name(), name) - .then(context.voidMono())); - } - return this; - } - - @Override - public KubernetesCluster.DefinitionStages.NetworkProfileDefinitionStages.Blank< - KubernetesCluster.DefinitionStages.WithCreate> - defineNetworkProfile() { - return new KubernetesClusterNetworkProfileImpl(this); - } - - @Override - public KubernetesClusterImpl withAddOnProfiles(Map addOnProfileMap) { - this.innerModel().withAddonProfiles(addOnProfileMap); - return this; - } - - @Override - public KubernetesClusterImpl withNetworkProfile(ContainerServiceNetworkProfile networkProfile) { - this.innerModel().withNetworkProfile(networkProfile); - return this; - } - - @Override - public KubernetesClusterImpl withRBACEnabled() { - this.innerModel().withEnableRbac(true); - return this; - } - - @Override - public KubernetesClusterImpl withRBACDisabled() { - this.innerModel().withEnableRbac(false); - return this; - } - - public KubernetesClusterImpl addNewAgentPool(KubernetesClusterAgentPoolImpl agentPool) { - if (!isInCreateMode()) { - this.addDependency(context -> - manager().serviceClient().getAgentPools().createOrUpdateAsync( - resourceGroupName(), name(), agentPool.name(), agentPool.getAgentPoolInner()) - .then(context.voidMono())); - } - innerModel().agentPoolProfiles().add(agentPool.innerModel()); - return this; - } - - @Override - public KubernetesClusterImpl withAutoScalerProfile(ManagedClusterPropertiesAutoScalerProfile autoScalerProfile) { - this.innerModel().withAutoScalerProfile(autoScalerProfile); - return this; - } - - @Override - public KubernetesClusterImpl enablePrivateCluster() { - if (innerModel().apiServerAccessProfile() == null) { - innerModel().withApiServerAccessProfile(new ManagedClusterApiServerAccessProfile()); - } - innerModel().apiServerAccessProfile().withEnablePrivateCluster(true); - return this; - } - - @Override - public PagedIterable listPrivateLinkResources() { - return new PagedIterable<>(listPrivateLinkResourcesAsync()); - } - - @Override - public PagedFlux listPrivateLinkResourcesAsync() { - Mono>> retList = this.manager().serviceClient().getPrivateLinkResources() - .listWithResponseAsync(this.resourceGroupName(), this.name()) - .map(response -> new SimpleResponse<>(response, response.getValue().value().stream() - .map(PrivateLinkResourceImpl::new) - .collect(Collectors.toList()))); - - return PagedConverter.convertListToPagedFlux(retList); - } - - @Override - public PagedIterable listPrivateEndpointConnections() { - return new PagedIterable<>(listPrivateEndpointConnectionsAsync()); - } - - @Override - public PagedFlux listPrivateEndpointConnectionsAsync() { - Mono>> retList = this.manager().serviceClient() - .getPrivateEndpointConnections() - .listWithResponseAsync(this.resourceGroupName(), this.name()) - .map(response -> new SimpleResponse<>(response, response.getValue().value().stream() - .map(PrivateEndpointConnectionImpl::new) - .collect(Collectors.toList()))); - - return PagedConverter.convertListToPagedFlux(retList); - } - - private static final class PrivateLinkResourceImpl implements PrivateLinkResource { - private final PrivateLinkResourceInner innerModel; - - private PrivateLinkResourceImpl(PrivateLinkResourceInner innerModel) { - this.innerModel = innerModel; - } - - @Override - public String groupId() { - return innerModel.groupId(); - } - - @Override - public List requiredMemberNames() { - return Collections.unmodifiableList(innerModel.requiredMembers()); - } - - @Override - public List requiredDnsZoneNames() { - return Collections.emptyList(); - } - } - - private static final class PrivateEndpointConnectionImpl implements PrivateEndpointConnection { - private final PrivateEndpointConnectionInner innerModel; - - private final PrivateEndpoint privateEndpoint; - private final com.azure.resourcemanager.resources.fluentcore.arm.models.PrivateLinkServiceConnectionState - privateLinkServiceConnectionState; - private final PrivateEndpointConnectionProvisioningState provisioningState; - - private PrivateEndpointConnectionImpl(PrivateEndpointConnectionInner innerModel) { - this.innerModel = innerModel; - - this.privateEndpoint = innerModel.privateEndpoint() == null - ? null - : new PrivateEndpoint(innerModel.privateEndpoint().id()); - this.privateLinkServiceConnectionState = innerModel.privateLinkServiceConnectionState() == null - ? null - : new com.azure.resourcemanager.resources.fluentcore.arm.models.PrivateLinkServiceConnectionState( - innerModel.privateLinkServiceConnectionState().status() == null - ? null - : com.azure.resourcemanager.resources.fluentcore.arm.models.PrivateEndpointServiceConnectionStatus - .fromString(innerModel.privateLinkServiceConnectionState().status().toString()), - innerModel.privateLinkServiceConnectionState().description(), - ""); - this.provisioningState = innerModel.provisioningState() == null - ? null - : PrivateEndpointConnectionProvisioningState.fromString(innerModel.provisioningState().toString()); - } - - @Override - public String id() { - return innerModel.id(); - } - - @Override - public String name() { - return innerModel.name(); - } - - @Override - public String type() { - return innerModel.type(); - } - - @Override - public PrivateEndpoint privateEndpoint() { - return privateEndpoint; - } - - @Override - public com.azure.resourcemanager.resources.fluentcore.arm.models.PrivateLinkServiceConnectionState - privateLinkServiceConnectionState() { - return privateLinkServiceConnectionState; - } - - @Override - public PrivateEndpointConnectionProvisioningState provisioningState() { - return provisioningState; - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/implementation/KubernetesClusterNetworkProfileImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/implementation/KubernetesClusterNetworkProfileImpl.java deleted file mode 100644 index b8cdec409953..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/implementation/KubernetesClusterNetworkProfileImpl.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.containerservice.implementation; - -import com.azure.resourcemanager.containerservice.models.ContainerServiceNetworkProfile; -import com.azure.resourcemanager.containerservice.models.KubernetesCluster; -import com.azure.resourcemanager.containerservice.models.LoadBalancerSku; -import com.azure.resourcemanager.containerservice.models.NetworkPlugin; -import com.azure.resourcemanager.containerservice.models.NetworkPolicy; - -/** The implementation for KubernetesClusterAgentPool and its create and update interfaces. */ -public class KubernetesClusterNetworkProfileImpl - implements KubernetesCluster.DefinitionStages.NetworkProfileDefinition< - KubernetesCluster.DefinitionStages.WithCreate> { - - KubernetesClusterImpl parentKubernetesCluster; - - KubernetesClusterNetworkProfileImpl(KubernetesClusterImpl parent) { - this.parentKubernetesCluster = parent; - } - - @Override - public KubernetesClusterNetworkProfileImpl withNetworkPlugin(NetworkPlugin networkPlugin) { - ensureNetworkProfile().withNetworkPlugin(networkPlugin); - return this; - } - - @Override - public KubernetesClusterNetworkProfileImpl withNetworkPolicy(NetworkPolicy networkPolicy) { - ensureNetworkProfile().withNetworkPolicy(networkPolicy); - return this; - } - - @Override - public KubernetesClusterNetworkProfileImpl withPodCidr(String podCidr) { - ensureNetworkProfile().withPodCidr(podCidr); - return this; - } - - @Override - public KubernetesClusterNetworkProfileImpl withServiceCidr(String serviceCidr) { - ensureNetworkProfile().withServiceCidr(serviceCidr); - return this; - } - - @Override - public KubernetesClusterNetworkProfileImpl withDnsServiceIP(String dnsServiceIP) { - ensureNetworkProfile().withDnsServiceIp(dnsServiceIP); - return this; - } - - @Override - public KubernetesClusterNetworkProfileImpl withDockerBridgeCidr(String dockerBridgeCidr) { - ensureNetworkProfile().withDockerBridgeCidr(dockerBridgeCidr); - return this; - } - - @Override - public KubernetesClusterNetworkProfileImpl withLoadBalancerSku(LoadBalancerSku loadBalancerSku) { - ensureNetworkProfile().withLoadBalancerSku(loadBalancerSku); - return this; - } - - @Override - public KubernetesClusterImpl attach() { - return parentKubernetesCluster; - } - - private ContainerServiceNetworkProfile ensureNetworkProfile() { - if (this.parentKubernetesCluster.innerModel().networkProfile() == null) { - this.parentKubernetesCluster.innerModel().withNetworkProfile(new ContainerServiceNetworkProfile()); - } - return this.parentKubernetesCluster.innerModel().networkProfile(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/implementation/KubernetesClustersImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/implementation/KubernetesClustersImpl.java deleted file mode 100644 index eb5099ac6a65..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/implementation/KubernetesClustersImpl.java +++ /dev/null @@ -1,210 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.containerservice.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.util.CoreUtils; -import com.azure.resourcemanager.containerservice.ContainerServiceManager; -import com.azure.resourcemanager.containerservice.fluent.ManagedClustersClient; -import com.azure.resourcemanager.containerservice.fluent.models.CredentialResultsInner; -import com.azure.resourcemanager.containerservice.fluent.models.ManagedClusterInner; -import com.azure.resourcemanager.containerservice.fluent.models.OrchestratorVersionProfileListResultInner; -import com.azure.resourcemanager.containerservice.models.ContainerServiceResourceTypes; -import com.azure.resourcemanager.containerservice.models.CredentialResult; -import com.azure.resourcemanager.containerservice.models.KubernetesCluster; -import com.azure.resourcemanager.containerservice.models.KubernetesClusters; -import com.azure.resourcemanager.containerservice.models.OrchestratorVersionProfile; -import com.azure.core.management.Region; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.GroupableResourcesImpl; -import reactor.core.publisher.Mono; - -import java.util.Collections; -import java.util.List; -import java.util.Set; -import java.util.TreeSet; -import com.azure.resourcemanager.resources.fluentcore.utils.PagedConverter; - -/** The implementation for KubernetesClusters. */ -public class KubernetesClustersImpl - extends GroupableResourcesImpl< - KubernetesCluster, KubernetesClusterImpl, ManagedClusterInner, ManagedClustersClient, ContainerServiceManager> - implements KubernetesClusters { - - public KubernetesClustersImpl(final ContainerServiceManager containerServiceManager) { - super(containerServiceManager.serviceClient().getManagedClusters(), containerServiceManager); - } - - @Override - public PagedIterable list() { - return new PagedIterable<>(this.listAsync()); - } - - @Override - public PagedFlux listAsync() { - return PagedConverter.mapPage(this.inner().listAsync(), inner -> new KubernetesClusterImpl(inner.name(), inner, manager())); - } - - @Override - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(this.listByResourceGroupAsync(resourceGroupName)); - } - - @Override - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - if (CoreUtils.isNullOrEmpty(resourceGroupName)) { - return new PagedFlux<>(() -> Mono.error( - new IllegalArgumentException("Parameter 'resourceGroupName' is required and cannot be null."))); - } - return wrapPageAsync(this.inner().listByResourceGroupAsync(resourceGroupName)); - } - - @Override - protected Mono getInnerAsync(String resourceGroupName, String name) { - return this.inner().getByResourceGroupAsync(resourceGroupName, name); - } - - @Override - protected Mono deleteInnerAsync(String resourceGroupName, String name) { - return this.inner().deleteAsync(resourceGroupName, name); - } - - /************************************************************** - * Fluent model helpers. - **************************************************************/ - - @Override - protected KubernetesClusterImpl wrapModel(String name) { - return new KubernetesClusterImpl(name, new ManagedClusterInner(), this.manager()); - } - - @Override - protected KubernetesClusterImpl wrapModel(ManagedClusterInner inner) { - if (inner == null) { - return null; - } - - return new KubernetesClusterImpl(inner.name(), inner, this.manager()); - } - - @Override - public KubernetesClusterImpl define(String name) { - return this.wrapModel(name); - } - - @Override - public Set listKubernetesVersions(Region region) { - TreeSet kubernetesVersions = new TreeSet<>(); - OrchestratorVersionProfileListResultInner inner = - this.manager().serviceClient().getContainerServices().listOrchestrators(region.name()); - - if (inner != null && inner.orchestrators() != null && inner.orchestrators().size() > 0) { - for (OrchestratorVersionProfile orchestrator : inner.orchestrators()) { - if (orchestrator.orchestratorType().equals("Kubernetes")) { - kubernetesVersions.add(orchestrator.orchestratorVersion()); - } - } - } - - return Collections.unmodifiableSet(kubernetesVersions); - } - - @Override - public Mono> listKubernetesVersionsAsync(Region region) { - return this - .manager() - .serviceClient() - .getContainerServices() - .listOrchestratorsAsync(region.name()) - .map( - inner -> { - Set kubernetesVersions = new TreeSet<>(); - if (inner != null && inner.orchestrators() != null && inner.orchestrators().size() > 0) { - for (OrchestratorVersionProfile orchestrator : inner.orchestrators()) { - if (orchestrator.orchestratorType().equals("Kubernetes")) { - kubernetesVersions.add(orchestrator.orchestratorVersion()); - } - } - } - return Collections.unmodifiableSet(kubernetesVersions); - }); - } - - @Override - public PagedIterable listOrchestrators(Region region, - ContainerServiceResourceTypes resourceTypes) { - return new PagedIterable<>(this.listOrchestratorsAsync(region, resourceTypes)); - } - - @Override - public PagedFlux listOrchestratorsAsync(Region region, - ContainerServiceResourceTypes resourceTypes) { - return new PagedFlux<>(() -> this.manager().serviceClient().getContainerServices() - .listOrchestratorsWithResponseAsync(region.name(), resourceTypes.toString()) - .map(response -> new PagedResponseBase( - response.getRequest(), - response.getStatusCode(), - response.getHeaders(), - (response.getValue() == null || response.getValue().orchestrators() == null) - ? Collections.emptyList() - : response.getValue().orchestrators(), - null, - null - ))); - } - - @Override - public List listAdminKubeConfigContent(String resourceGroupName, String kubernetesClusterName) { - return listAdminKubeConfigContentAsync(resourceGroupName, kubernetesClusterName).block(); - } - - @Override - public Mono> listAdminKubeConfigContentAsync( - String resourceGroupName, String kubernetesClusterName) { - return this - .manager() - .serviceClient() - .getManagedClusters() - .listClusterAdminCredentialsAsync(resourceGroupName, kubernetesClusterName) - .map(CredentialResultsInner::kubeconfigs); - } - - @Override - public List listUserKubeConfigContent(String resourceGroupName, String kubernetesClusterName) { - return listUserKubeConfigContentAsync(resourceGroupName, kubernetesClusterName).block(); - } - - @Override - public Mono> listUserKubeConfigContentAsync( - String resourceGroupName, String kubernetesClusterName) { - return this - .manager() - .serviceClient() - .getManagedClusters() - .listClusterUserCredentialsAsync(resourceGroupName, kubernetesClusterName) - .map(CredentialResultsInner::kubeconfigs); - } - - @Override - public void start(String resourceGroupName, String kubernetesClusterName) { - this.startAsync(resourceGroupName, kubernetesClusterName).block(); - } - - @Override - public Mono startAsync(String resourceGroupName, String kubernetesClusterName) { - return this.manager().serviceClient().getManagedClusters() - .startAsync(resourceGroupName, kubernetesClusterName); - } - - @Override - public void stop(String resourceGroupName, String kubernetesClusterName) { - this.stopAsync(resourceGroupName, kubernetesClusterName).block(); - } - - @Override - public Mono stopAsync(String resourceGroupName, String kubernetesClusterName) { - return this.manager().serviceClient().getManagedClusters() - .stopAsync(resourceGroupName, kubernetesClusterName); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/implementation/ManagedClustersClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/implementation/ManagedClustersClientImpl.java deleted file mode 100644 index a3ffa5dfc572..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/implementation/ManagedClustersClientImpl.java +++ /dev/null @@ -1,3751 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.containerservice.fluent.ManagedClustersClient; -import com.azure.resourcemanager.containerservice.fluent.models.CredentialResultsInner; -import com.azure.resourcemanager.containerservice.fluent.models.ManagedClusterAccessProfileInner; -import com.azure.resourcemanager.containerservice.fluent.models.ManagedClusterInner; -import com.azure.resourcemanager.containerservice.fluent.models.ManagedClusterUpgradeProfileInner; -import com.azure.resourcemanager.containerservice.models.ManagedClusterAadProfile; -import com.azure.resourcemanager.containerservice.models.ManagedClusterListResult; -import com.azure.resourcemanager.containerservice.models.ManagedClusterServicePrincipalProfile; -import com.azure.resourcemanager.containerservice.models.TagsObject; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ManagedClustersClient. */ -public final class ManagedClustersClientImpl - implements InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete, - ManagedClustersClient { - private final ClientLogger logger = new ClientLogger(ManagedClustersClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final ManagedClustersService service; - - /** The service client containing this operation class. */ - private final ContainerServiceManagementClientImpl client; - - /** - * Initializes an instance of ManagedClustersClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ManagedClustersClientImpl(ContainerServiceManagementClientImpl client) { - this.service = - RestProxy.create(ManagedClustersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for ContainerServiceManagementClientManagedClusters to be used by the - * proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "ContainerServiceMana") - private interface ManagedClustersService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" - + "/managedClusters") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" - + "/managedClusters/{resourceName}/upgradeProfiles/default") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getUpgradeProfile( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("resourceName") String resourceName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" - + "/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getAccessProfile( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("resourceName") String resourceName, - @PathParam("roleName") String roleName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" - + "/managedClusters/{resourceName}/listClusterAdminCredential") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listClusterAdminCredentials( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("resourceName") String resourceName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" - + "/managedClusters/{resourceName}/listClusterUserCredential") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listClusterUserCredentials( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("resourceName") String resourceName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" - + "/managedClusters/{resourceName}/listClusterMonitoringUserCredential") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listClusterMonitoringUserCredentials( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("resourceName") String resourceName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" - + "/managedClusters/{resourceName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("resourceName") String resourceName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" - + "/managedClusters/{resourceName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("resourceName") String resourceName, - @BodyParam("application/json") ManagedClusterInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" - + "/managedClusters/{resourceName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> updateTags( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("resourceName") String resourceName, - @BodyParam("application/json") TagsObject parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" - + "/managedClusters/{resourceName}") - @ExpectedResponses({202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("resourceName") String resourceName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" - + "/managedClusters/{resourceName}/resetServicePrincipalProfile") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> resetServicePrincipalProfile( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("resourceName") String resourceName, - @BodyParam("application/json") ManagedClusterServicePrincipalProfile parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" - + "/managedClusters/{resourceName}/resetAADProfile") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> resetAadProfile( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("resourceName") String resourceName, - @BodyParam("application/json") ManagedClusterAadProfile parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" - + "/managedClusters/{resourceName}/rotateClusterCertificates") - @ExpectedResponses({202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> rotateClusterCertificates( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("resourceName") String resourceName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" - + "/managedClusters/{resourceName}/stop") - @ExpectedResponses({202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> stop( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("resourceName") String resourceName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" - + "/managedClusters/{resourceName}/start") - @ExpectedResponses({202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> start( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("resourceName") String resourceName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets a list of managed clusters in the specified subscription. The operation returns properties of each managed - * cluster. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of managed clusters in the specified subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a list of managed clusters in the specified subscription. The operation returns properties of each managed - * cluster. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of managed clusters in the specified subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets a list of managed clusters in the specified subscription. The operation returns properties of each managed - * cluster. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of managed clusters in the specified subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets a list of managed clusters in the specified subscription. The operation returns properties of each managed - * cluster. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of managed clusters in the specified subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets a list of managed clusters in the specified subscription. The operation returns properties of each managed - * cluster. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of managed clusters in the specified subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Gets a list of managed clusters in the specified subscription. The operation returns properties of each managed - * cluster. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of managed clusters in the specified subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Lists managed clusters in the specified subscription and resource group. The operation returns properties of each - * managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the List Managed Clusters operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String apiVersion = "2020-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists managed clusters in the specified subscription and resource group. The operation returns properties of each - * managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the List Managed Clusters operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String apiVersion = "2020-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists managed clusters in the specified subscription and resource group. The operation returns properties of each - * managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the List Managed Clusters operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * Lists managed clusters in the specified subscription and resource group. The operation returns properties of each - * managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the List Managed Clusters operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists managed clusters in the specified subscription and resource group. The operation returns properties of each - * managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the List Managed Clusters operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * Lists managed clusters in the specified subscription and resource group. The operation returns properties of each - * managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the List Managed Clusters operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * Gets the details of the upgrade profile for a managed cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of the upgrade profile for a managed cluster with a specified resource group and name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getUpgradeProfileWithResponseAsync( - String resourceGroupName, String resourceName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String apiVersion = "2020-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getUpgradeProfile( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - resourceName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the details of the upgrade profile for a managed cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of the upgrade profile for a managed cluster with a specified resource group and name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getUpgradeProfileWithResponseAsync( - String resourceGroupName, String resourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String apiVersion = "2020-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getUpgradeProfile( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - resourceName, - accept, - context); - } - - /** - * Gets the details of the upgrade profile for a managed cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of the upgrade profile for a managed cluster with a specified resource group and name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getUpgradeProfileAsync( - String resourceGroupName, String resourceName) { - return getUpgradeProfileWithResponseAsync(resourceGroupName, resourceName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the details of the upgrade profile for a managed cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of the upgrade profile for a managed cluster with a specified resource group and name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ManagedClusterUpgradeProfileInner getUpgradeProfile(String resourceGroupName, String resourceName) { - return getUpgradeProfileAsync(resourceGroupName, resourceName).block(); - } - - /** - * Gets the details of the upgrade profile for a managed cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of the upgrade profile for a managed cluster with a specified resource group and name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getUpgradeProfileWithResponse( - String resourceGroupName, String resourceName, Context context) { - return getUpgradeProfileWithResponseAsync(resourceGroupName, resourceName, context).block(); - } - - /** - * Gets the accessProfile for the specified role name of the managed cluster with a specified resource group and - * name. **WARNING**: This API will be deprecated. Instead use - * [ListClusterUserCredentials](https://docs.microsoft.com/en-us/rest/api/aks/managedclusters/listclusterusercredentials) - * or - * [ListClusterAdminCredentials](https://docs.microsoft.com/en-us/rest/api/aks/managedclusters/listclusteradmincredentials) - * . - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param roleName The name of the role for managed cluster accessProfile resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the accessProfile for the specified role name of the managed cluster with a specified resource group and - * name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getAccessProfileWithResponseAsync( - String resourceGroupName, String resourceName, String roleName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (roleName == null) { - return Mono.error(new IllegalArgumentException("Parameter roleName is required and cannot be null.")); - } - final String apiVersion = "2020-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getAccessProfile( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - resourceName, - roleName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the accessProfile for the specified role name of the managed cluster with a specified resource group and - * name. **WARNING**: This API will be deprecated. Instead use - * [ListClusterUserCredentials](https://docs.microsoft.com/en-us/rest/api/aks/managedclusters/listclusterusercredentials) - * or - * [ListClusterAdminCredentials](https://docs.microsoft.com/en-us/rest/api/aks/managedclusters/listclusteradmincredentials) - * . - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param roleName The name of the role for managed cluster accessProfile resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the accessProfile for the specified role name of the managed cluster with a specified resource group and - * name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getAccessProfileWithResponseAsync( - String resourceGroupName, String resourceName, String roleName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (roleName == null) { - return Mono.error(new IllegalArgumentException("Parameter roleName is required and cannot be null.")); - } - final String apiVersion = "2020-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getAccessProfile( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - resourceName, - roleName, - accept, - context); - } - - /** - * Gets the accessProfile for the specified role name of the managed cluster with a specified resource group and - * name. **WARNING**: This API will be deprecated. Instead use - * [ListClusterUserCredentials](https://docs.microsoft.com/en-us/rest/api/aks/managedclusters/listclusterusercredentials) - * or - * [ListClusterAdminCredentials](https://docs.microsoft.com/en-us/rest/api/aks/managedclusters/listclusteradmincredentials) - * . - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param roleName The name of the role for managed cluster accessProfile resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the accessProfile for the specified role name of the managed cluster with a specified resource group and - * name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAccessProfileAsync( - String resourceGroupName, String resourceName, String roleName) { - return getAccessProfileWithResponseAsync(resourceGroupName, resourceName, roleName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the accessProfile for the specified role name of the managed cluster with a specified resource group and - * name. **WARNING**: This API will be deprecated. Instead use - * [ListClusterUserCredentials](https://docs.microsoft.com/en-us/rest/api/aks/managedclusters/listclusterusercredentials) - * or - * [ListClusterAdminCredentials](https://docs.microsoft.com/en-us/rest/api/aks/managedclusters/listclusteradmincredentials) - * . - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param roleName The name of the role for managed cluster accessProfile resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the accessProfile for the specified role name of the managed cluster with a specified resource group and - * name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ManagedClusterAccessProfileInner getAccessProfile( - String resourceGroupName, String resourceName, String roleName) { - return getAccessProfileAsync(resourceGroupName, resourceName, roleName).block(); - } - - /** - * Gets the accessProfile for the specified role name of the managed cluster with a specified resource group and - * name. **WARNING**: This API will be deprecated. Instead use - * [ListClusterUserCredentials](https://docs.microsoft.com/en-us/rest/api/aks/managedclusters/listclusterusercredentials) - * or - * [ListClusterAdminCredentials](https://docs.microsoft.com/en-us/rest/api/aks/managedclusters/listclusteradmincredentials) - * . - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param roleName The name of the role for managed cluster accessProfile resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the accessProfile for the specified role name of the managed cluster with a specified resource group and - * name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getAccessProfileWithResponse( - String resourceGroupName, String resourceName, String roleName, Context context) { - return getAccessProfileWithResponseAsync(resourceGroupName, resourceName, roleName, context).block(); - } - - /** - * Gets cluster admin credential of the managed cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cluster admin credential of the managed cluster with a specified resource group and name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listClusterAdminCredentialsWithResponseAsync( - String resourceGroupName, String resourceName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String apiVersion = "2020-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listClusterAdminCredentials( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - resourceName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets cluster admin credential of the managed cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cluster admin credential of the managed cluster with a specified resource group and name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listClusterAdminCredentialsWithResponseAsync( - String resourceGroupName, String resourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String apiVersion = "2020-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listClusterAdminCredentials( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - resourceName, - accept, - context); - } - - /** - * Gets cluster admin credential of the managed cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cluster admin credential of the managed cluster with a specified resource group and name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listClusterAdminCredentialsAsync( - String resourceGroupName, String resourceName) { - return listClusterAdminCredentialsWithResponseAsync(resourceGroupName, resourceName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets cluster admin credential of the managed cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cluster admin credential of the managed cluster with a specified resource group and name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CredentialResultsInner listClusterAdminCredentials(String resourceGroupName, String resourceName) { - return listClusterAdminCredentialsAsync(resourceGroupName, resourceName).block(); - } - - /** - * Gets cluster admin credential of the managed cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cluster admin credential of the managed cluster with a specified resource group and name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listClusterAdminCredentialsWithResponse( - String resourceGroupName, String resourceName, Context context) { - return listClusterAdminCredentialsWithResponseAsync(resourceGroupName, resourceName, context).block(); - } - - /** - * Gets cluster user credential of the managed cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cluster user credential of the managed cluster with a specified resource group and name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listClusterUserCredentialsWithResponseAsync( - String resourceGroupName, String resourceName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String apiVersion = "2020-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listClusterUserCredentials( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - resourceName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets cluster user credential of the managed cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cluster user credential of the managed cluster with a specified resource group and name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listClusterUserCredentialsWithResponseAsync( - String resourceGroupName, String resourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String apiVersion = "2020-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listClusterUserCredentials( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - resourceName, - accept, - context); - } - - /** - * Gets cluster user credential of the managed cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cluster user credential of the managed cluster with a specified resource group and name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listClusterUserCredentialsAsync(String resourceGroupName, String resourceName) { - return listClusterUserCredentialsWithResponseAsync(resourceGroupName, resourceName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets cluster user credential of the managed cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cluster user credential of the managed cluster with a specified resource group and name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CredentialResultsInner listClusterUserCredentials(String resourceGroupName, String resourceName) { - return listClusterUserCredentialsAsync(resourceGroupName, resourceName).block(); - } - - /** - * Gets cluster user credential of the managed cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cluster user credential of the managed cluster with a specified resource group and name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listClusterUserCredentialsWithResponse( - String resourceGroupName, String resourceName, Context context) { - return listClusterUserCredentialsWithResponseAsync(resourceGroupName, resourceName, context).block(); - } - - /** - * Gets cluster monitoring user credential of the managed cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cluster monitoring user credential of the managed cluster with a specified resource group and name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listClusterMonitoringUserCredentialsWithResponseAsync( - String resourceGroupName, String resourceName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String apiVersion = "2020-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listClusterMonitoringUserCredentials( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - resourceName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets cluster monitoring user credential of the managed cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cluster monitoring user credential of the managed cluster with a specified resource group and name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listClusterMonitoringUserCredentialsWithResponseAsync( - String resourceGroupName, String resourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String apiVersion = "2020-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listClusterMonitoringUserCredentials( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - resourceName, - accept, - context); - } - - /** - * Gets cluster monitoring user credential of the managed cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cluster monitoring user credential of the managed cluster with a specified resource group and name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listClusterMonitoringUserCredentialsAsync( - String resourceGroupName, String resourceName) { - return listClusterMonitoringUserCredentialsWithResponseAsync(resourceGroupName, resourceName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets cluster monitoring user credential of the managed cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cluster monitoring user credential of the managed cluster with a specified resource group and name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CredentialResultsInner listClusterMonitoringUserCredentials(String resourceGroupName, String resourceName) { - return listClusterMonitoringUserCredentialsAsync(resourceGroupName, resourceName).block(); - } - - /** - * Gets cluster monitoring user credential of the managed cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cluster monitoring user credential of the managed cluster with a specified resource group and name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listClusterMonitoringUserCredentialsWithResponse( - String resourceGroupName, String resourceName, Context context) { - return listClusterMonitoringUserCredentialsWithResponseAsync(resourceGroupName, resourceName, context).block(); - } - - /** - * Gets the details of the managed cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of the managed cluster with a specified resource group and name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String resourceName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String apiVersion = "2020-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - resourceName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the details of the managed cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of the managed cluster with a specified resource group and name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String resourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String apiVersion = "2020-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - resourceName, - accept, - context); - } - - /** - * Gets the details of the managed cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of the managed cluster with a specified resource group and name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync(String resourceGroupName, String resourceName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, resourceName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the details of the managed cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of the managed cluster with a specified resource group and name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ManagedClusterInner getByResourceGroup(String resourceGroupName, String resourceName) { - return getByResourceGroupAsync(resourceGroupName, resourceName).block(); - } - - /** - * Gets the details of the managed cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of the managed cluster with a specified resource group and name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String resourceName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, resourceName, context).block(); - } - - /** - * Creates or updates a managed cluster with the specified configuration for agents and Kubernetes version. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param parameters Parameters supplied to the Create or Update a Managed Cluster operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String resourceName, ManagedClusterInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - resourceName, - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a managed cluster with the specified configuration for agents and Kubernetes version. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param parameters Parameters supplied to the Create or Update a Managed Cluster operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String resourceName, ManagedClusterInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - resourceName, - parameters, - accept, - context); - } - - /** - * Creates or updates a managed cluster with the specified configuration for agents and Kubernetes version. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param parameters Parameters supplied to the Create or Update a Managed Cluster operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, ManagedClusterInner> beginCreateOrUpdateAsync( - String resourceGroupName, String resourceName, ManagedClusterInner parameters) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, resourceName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ManagedClusterInner.class, - ManagedClusterInner.class, - Context.NONE); - } - - /** - * Creates or updates a managed cluster with the specified configuration for agents and Kubernetes version. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param parameters Parameters supplied to the Create or Update a Managed Cluster operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, ManagedClusterInner> beginCreateOrUpdateAsync( - String resourceGroupName, String resourceName, ManagedClusterInner parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, resourceName, parameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), ManagedClusterInner.class, ManagedClusterInner.class, context); - } - - /** - * Creates or updates a managed cluster with the specified configuration for agents and Kubernetes version. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param parameters Parameters supplied to the Create or Update a Managed Cluster operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, ManagedClusterInner> beginCreateOrUpdate( - String resourceGroupName, String resourceName, ManagedClusterInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, resourceName, parameters).getSyncPoller(); - } - - /** - * Creates or updates a managed cluster with the specified configuration for agents and Kubernetes version. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param parameters Parameters supplied to the Create or Update a Managed Cluster operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, ManagedClusterInner> beginCreateOrUpdate( - String resourceGroupName, String resourceName, ManagedClusterInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, resourceName, parameters, context).getSyncPoller(); - } - - /** - * Creates or updates a managed cluster with the specified configuration for agents and Kubernetes version. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param parameters Parameters supplied to the Create or Update a Managed Cluster operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, String resourceName, ManagedClusterInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, resourceName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a managed cluster with the specified configuration for agents and Kubernetes version. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param parameters Parameters supplied to the Create or Update a Managed Cluster operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String resourceName, ManagedClusterInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, resourceName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a managed cluster with the specified configuration for agents and Kubernetes version. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param parameters Parameters supplied to the Create or Update a Managed Cluster operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ManagedClusterInner createOrUpdate( - String resourceGroupName, String resourceName, ManagedClusterInner parameters) { - return createOrUpdateAsync(resourceGroupName, resourceName, parameters).block(); - } - - /** - * Creates or updates a managed cluster with the specified configuration for agents and Kubernetes version. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param parameters Parameters supplied to the Create or Update a Managed Cluster operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ManagedClusterInner createOrUpdate( - String resourceGroupName, String resourceName, ManagedClusterInner parameters, Context context) { - return createOrUpdateAsync(resourceGroupName, resourceName, parameters, context).block(); - } - - /** - * Updates a managed cluster with the specified tags. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param parameters Parameters supplied to the Update Managed Cluster Tags operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateTagsWithResponseAsync( - String resourceGroupName, String resourceName, TagsObject parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updateTags( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - resourceName, - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates a managed cluster with the specified tags. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param parameters Parameters supplied to the Update Managed Cluster Tags operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateTagsWithResponseAsync( - String resourceGroupName, String resourceName, TagsObject parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updateTags( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - resourceName, - parameters, - accept, - context); - } - - /** - * Updates a managed cluster with the specified tags. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param parameters Parameters supplied to the Update Managed Cluster Tags operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, ManagedClusterInner> beginUpdateTagsAsync( - String resourceGroupName, String resourceName, TagsObject parameters) { - Mono>> mono = - updateTagsWithResponseAsync(resourceGroupName, resourceName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ManagedClusterInner.class, - ManagedClusterInner.class, - Context.NONE); - } - - /** - * Updates a managed cluster with the specified tags. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param parameters Parameters supplied to the Update Managed Cluster Tags operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, ManagedClusterInner> beginUpdateTagsAsync( - String resourceGroupName, String resourceName, TagsObject parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - updateTagsWithResponseAsync(resourceGroupName, resourceName, parameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), ManagedClusterInner.class, ManagedClusterInner.class, context); - } - - /** - * Updates a managed cluster with the specified tags. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param parameters Parameters supplied to the Update Managed Cluster Tags operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, ManagedClusterInner> beginUpdateTags( - String resourceGroupName, String resourceName, TagsObject parameters) { - return beginUpdateTagsAsync(resourceGroupName, resourceName, parameters).getSyncPoller(); - } - - /** - * Updates a managed cluster with the specified tags. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param parameters Parameters supplied to the Update Managed Cluster Tags operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, ManagedClusterInner> beginUpdateTags( - String resourceGroupName, String resourceName, TagsObject parameters, Context context) { - return beginUpdateTagsAsync(resourceGroupName, resourceName, parameters, context).getSyncPoller(); - } - - /** - * Updates a managed cluster with the specified tags. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param parameters Parameters supplied to the Update Managed Cluster Tags operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateTagsAsync( - String resourceGroupName, String resourceName, TagsObject parameters) { - return beginUpdateTagsAsync(resourceGroupName, resourceName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates a managed cluster with the specified tags. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param parameters Parameters supplied to the Update Managed Cluster Tags operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateTagsAsync( - String resourceGroupName, String resourceName, TagsObject parameters, Context context) { - return beginUpdateTagsAsync(resourceGroupName, resourceName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates a managed cluster with the specified tags. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param parameters Parameters supplied to the Update Managed Cluster Tags operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ManagedClusterInner updateTags(String resourceGroupName, String resourceName, TagsObject parameters) { - return updateTagsAsync(resourceGroupName, resourceName, parameters).block(); - } - - /** - * Updates a managed cluster with the specified tags. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param parameters Parameters supplied to the Update Managed Cluster Tags operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ManagedClusterInner updateTags( - String resourceGroupName, String resourceName, TagsObject parameters, Context context) { - return updateTagsAsync(resourceGroupName, resourceName, parameters, context).block(); - } - - /** - * Deletes the managed cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync(String resourceGroupName, String resourceName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String apiVersion = "2020-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - resourceName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the managed cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String resourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String apiVersion = "2020-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - resourceName, - accept, - context); - } - - /** - * Deletes the managed cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String resourceName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, resourceName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deletes the managed cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String resourceName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(resourceGroupName, resourceName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes the managed cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName) { - return beginDeleteAsync(resourceGroupName, resourceName).getSyncPoller(); - } - - /** - * Deletes the managed cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String resourceName, Context context) { - return beginDeleteAsync(resourceGroupName, resourceName, context).getSyncPoller(); - } - - /** - * Deletes the managed cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String resourceName) { - return beginDeleteAsync(resourceGroupName, resourceName).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the managed cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String resourceName, Context context) { - return beginDeleteAsync(resourceGroupName, resourceName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the managed cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String resourceName) { - deleteAsync(resourceGroupName, resourceName).block(); - } - - /** - * Deletes the managed cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String resourceName, Context context) { - deleteAsync(resourceGroupName, resourceName, context).block(); - } - - /** - * Update the service principal Profile for a managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param parameters Parameters supplied to the Reset Service Principal Profile operation for a Managed Cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> resetServicePrincipalProfileWithResponseAsync( - String resourceGroupName, String resourceName, ManagedClusterServicePrincipalProfile parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .resetServicePrincipalProfile( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - resourceName, - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Update the service principal Profile for a managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param parameters Parameters supplied to the Reset Service Principal Profile operation for a Managed Cluster. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> resetServicePrincipalProfileWithResponseAsync( - String resourceGroupName, - String resourceName, - ManagedClusterServicePrincipalProfile parameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .resetServicePrincipalProfile( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - resourceName, - parameters, - accept, - context); - } - - /** - * Update the service principal Profile for a managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param parameters Parameters supplied to the Reset Service Principal Profile operation for a Managed Cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginResetServicePrincipalProfileAsync( - String resourceGroupName, String resourceName, ManagedClusterServicePrincipalProfile parameters) { - Mono>> mono = - resetServicePrincipalProfileWithResponseAsync(resourceGroupName, resourceName, parameters); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Update the service principal Profile for a managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param parameters Parameters supplied to the Reset Service Principal Profile operation for a Managed Cluster. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginResetServicePrincipalProfileAsync( - String resourceGroupName, - String resourceName, - ManagedClusterServicePrincipalProfile parameters, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - resetServicePrincipalProfileWithResponseAsync(resourceGroupName, resourceName, parameters, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Update the service principal Profile for a managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param parameters Parameters supplied to the Reset Service Principal Profile operation for a Managed Cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginResetServicePrincipalProfile( - String resourceGroupName, String resourceName, ManagedClusterServicePrincipalProfile parameters) { - return beginResetServicePrincipalProfileAsync(resourceGroupName, resourceName, parameters).getSyncPoller(); - } - - /** - * Update the service principal Profile for a managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param parameters Parameters supplied to the Reset Service Principal Profile operation for a Managed Cluster. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginResetServicePrincipalProfile( - String resourceGroupName, - String resourceName, - ManagedClusterServicePrincipalProfile parameters, - Context context) { - return beginResetServicePrincipalProfileAsync(resourceGroupName, resourceName, parameters, context) - .getSyncPoller(); - } - - /** - * Update the service principal Profile for a managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param parameters Parameters supplied to the Reset Service Principal Profile operation for a Managed Cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono resetServicePrincipalProfileAsync( - String resourceGroupName, String resourceName, ManagedClusterServicePrincipalProfile parameters) { - return beginResetServicePrincipalProfileAsync(resourceGroupName, resourceName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Update the service principal Profile for a managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param parameters Parameters supplied to the Reset Service Principal Profile operation for a Managed Cluster. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono resetServicePrincipalProfileAsync( - String resourceGroupName, - String resourceName, - ManagedClusterServicePrincipalProfile parameters, - Context context) { - return beginResetServicePrincipalProfileAsync(resourceGroupName, resourceName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Update the service principal Profile for a managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param parameters Parameters supplied to the Reset Service Principal Profile operation for a Managed Cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void resetServicePrincipalProfile( - String resourceGroupName, String resourceName, ManagedClusterServicePrincipalProfile parameters) { - resetServicePrincipalProfileAsync(resourceGroupName, resourceName, parameters).block(); - } - - /** - * Update the service principal Profile for a managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param parameters Parameters supplied to the Reset Service Principal Profile operation for a Managed Cluster. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void resetServicePrincipalProfile( - String resourceGroupName, - String resourceName, - ManagedClusterServicePrincipalProfile parameters, - Context context) { - resetServicePrincipalProfileAsync(resourceGroupName, resourceName, parameters, context).block(); - } - - /** - * Update the AAD Profile for a managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param parameters Parameters supplied to the Reset AAD Profile operation for a Managed Cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> resetAadProfileWithResponseAsync( - String resourceGroupName, String resourceName, ManagedClusterAadProfile parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .resetAadProfile( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - resourceName, - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Update the AAD Profile for a managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param parameters Parameters supplied to the Reset AAD Profile operation for a Managed Cluster. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> resetAadProfileWithResponseAsync( - String resourceGroupName, String resourceName, ManagedClusterAadProfile parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .resetAadProfile( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - resourceName, - parameters, - accept, - context); - } - - /** - * Update the AAD Profile for a managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param parameters Parameters supplied to the Reset AAD Profile operation for a Managed Cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginResetAadProfileAsync( - String resourceGroupName, String resourceName, ManagedClusterAadProfile parameters) { - Mono>> mono = - resetAadProfileWithResponseAsync(resourceGroupName, resourceName, parameters); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Update the AAD Profile for a managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param parameters Parameters supplied to the Reset AAD Profile operation for a Managed Cluster. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginResetAadProfileAsync( - String resourceGroupName, String resourceName, ManagedClusterAadProfile parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - resetAadProfileWithResponseAsync(resourceGroupName, resourceName, parameters, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Update the AAD Profile for a managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param parameters Parameters supplied to the Reset AAD Profile operation for a Managed Cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginResetAadProfile( - String resourceGroupName, String resourceName, ManagedClusterAadProfile parameters) { - return beginResetAadProfileAsync(resourceGroupName, resourceName, parameters).getSyncPoller(); - } - - /** - * Update the AAD Profile for a managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param parameters Parameters supplied to the Reset AAD Profile operation for a Managed Cluster. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginResetAadProfile( - String resourceGroupName, String resourceName, ManagedClusterAadProfile parameters, Context context) { - return beginResetAadProfileAsync(resourceGroupName, resourceName, parameters, context).getSyncPoller(); - } - - /** - * Update the AAD Profile for a managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param parameters Parameters supplied to the Reset AAD Profile operation for a Managed Cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono resetAadProfileAsync( - String resourceGroupName, String resourceName, ManagedClusterAadProfile parameters) { - return beginResetAadProfileAsync(resourceGroupName, resourceName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Update the AAD Profile for a managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param parameters Parameters supplied to the Reset AAD Profile operation for a Managed Cluster. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono resetAadProfileAsync( - String resourceGroupName, String resourceName, ManagedClusterAadProfile parameters, Context context) { - return beginResetAadProfileAsync(resourceGroupName, resourceName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Update the AAD Profile for a managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param parameters Parameters supplied to the Reset AAD Profile operation for a Managed Cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void resetAadProfile(String resourceGroupName, String resourceName, ManagedClusterAadProfile parameters) { - resetAadProfileAsync(resourceGroupName, resourceName, parameters).block(); - } - - /** - * Update the AAD Profile for a managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param parameters Parameters supplied to the Reset AAD Profile operation for a Managed Cluster. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void resetAadProfile( - String resourceGroupName, String resourceName, ManagedClusterAadProfile parameters, Context context) { - resetAadProfileAsync(resourceGroupName, resourceName, parameters, context).block(); - } - - /** - * Rotate certificates of a managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> rotateClusterCertificatesWithResponseAsync( - String resourceGroupName, String resourceName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String apiVersion = "2020-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .rotateClusterCertificates( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - resourceName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Rotate certificates of a managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> rotateClusterCertificatesWithResponseAsync( - String resourceGroupName, String resourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String apiVersion = "2020-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .rotateClusterCertificates( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - resourceName, - accept, - context); - } - - /** - * Rotate certificates of a managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginRotateClusterCertificatesAsync( - String resourceGroupName, String resourceName) { - Mono>> mono = - rotateClusterCertificatesWithResponseAsync(resourceGroupName, resourceName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Rotate certificates of a managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginRotateClusterCertificatesAsync( - String resourceGroupName, String resourceName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - rotateClusterCertificatesWithResponseAsync(resourceGroupName, resourceName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Rotate certificates of a managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginRotateClusterCertificates( - String resourceGroupName, String resourceName) { - return beginRotateClusterCertificatesAsync(resourceGroupName, resourceName).getSyncPoller(); - } - - /** - * Rotate certificates of a managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginRotateClusterCertificates( - String resourceGroupName, String resourceName, Context context) { - return beginRotateClusterCertificatesAsync(resourceGroupName, resourceName, context).getSyncPoller(); - } - - /** - * Rotate certificates of a managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono rotateClusterCertificatesAsync(String resourceGroupName, String resourceName) { - return beginRotateClusterCertificatesAsync(resourceGroupName, resourceName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Rotate certificates of a managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono rotateClusterCertificatesAsync(String resourceGroupName, String resourceName, Context context) { - return beginRotateClusterCertificatesAsync(resourceGroupName, resourceName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Rotate certificates of a managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void rotateClusterCertificates(String resourceGroupName, String resourceName) { - rotateClusterCertificatesAsync(resourceGroupName, resourceName).block(); - } - - /** - * Rotate certificates of a managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void rotateClusterCertificates(String resourceGroupName, String resourceName, Context context) { - rotateClusterCertificatesAsync(resourceGroupName, resourceName, context).block(); - } - - /** - * Stops a Running Managed Cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> stopWithResponseAsync(String resourceGroupName, String resourceName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String apiVersion = "2020-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .stop( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - resourceName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Stops a Running Managed Cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> stopWithResponseAsync( - String resourceGroupName, String resourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String apiVersion = "2020-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .stop( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - resourceName, - accept, - context); - } - - /** - * Stops a Running Managed Cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginStopAsync(String resourceGroupName, String resourceName) { - Mono>> mono = stopWithResponseAsync(resourceGroupName, resourceName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Stops a Running Managed Cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginStopAsync( - String resourceGroupName, String resourceName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = stopWithResponseAsync(resourceGroupName, resourceName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Stops a Running Managed Cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginStop(String resourceGroupName, String resourceName) { - return beginStopAsync(resourceGroupName, resourceName).getSyncPoller(); - } - - /** - * Stops a Running Managed Cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginStop( - String resourceGroupName, String resourceName, Context context) { - return beginStopAsync(resourceGroupName, resourceName, context).getSyncPoller(); - } - - /** - * Stops a Running Managed Cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono stopAsync(String resourceGroupName, String resourceName) { - return beginStopAsync(resourceGroupName, resourceName).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Stops a Running Managed Cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono stopAsync(String resourceGroupName, String resourceName, Context context) { - return beginStopAsync(resourceGroupName, resourceName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Stops a Running Managed Cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void stop(String resourceGroupName, String resourceName) { - stopAsync(resourceGroupName, resourceName).block(); - } - - /** - * Stops a Running Managed Cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void stop(String resourceGroupName, String resourceName, Context context) { - stopAsync(resourceGroupName, resourceName, context).block(); - } - - /** - * Starts a Stopped Managed Cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> startWithResponseAsync(String resourceGroupName, String resourceName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String apiVersion = "2020-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .start( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - resourceName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Starts a Stopped Managed Cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> startWithResponseAsync( - String resourceGroupName, String resourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String apiVersion = "2020-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .start( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - resourceName, - accept, - context); - } - - /** - * Starts a Stopped Managed Cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginStartAsync(String resourceGroupName, String resourceName) { - Mono>> mono = startWithResponseAsync(resourceGroupName, resourceName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Starts a Stopped Managed Cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginStartAsync( - String resourceGroupName, String resourceName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = startWithResponseAsync(resourceGroupName, resourceName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Starts a Stopped Managed Cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginStart(String resourceGroupName, String resourceName) { - return beginStartAsync(resourceGroupName, resourceName).getSyncPoller(); - } - - /** - * Starts a Stopped Managed Cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginStart( - String resourceGroupName, String resourceName, Context context) { - return beginStartAsync(resourceGroupName, resourceName, context).getSyncPoller(); - } - - /** - * Starts a Stopped Managed Cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono startAsync(String resourceGroupName, String resourceName) { - return beginStartAsync(resourceGroupName, resourceName).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Starts a Stopped Managed Cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono startAsync(String resourceGroupName, String resourceName, Context context) { - return beginStartAsync(resourceGroupName, resourceName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Starts a Stopped Managed Cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void start(String resourceGroupName, String resourceName) { - startAsync(resourceGroupName, resourceName).block(); - } - - /** - * Starts a Stopped Managed Cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void start(String resourceGroupName, String resourceName, Context context) { - startAsync(resourceGroupName, resourceName, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the List Managed Clusters operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the List Managed Clusters operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the List Managed Clusters operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the List Managed Clusters operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/implementation/OpenShiftManagedClustersClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/implementation/OpenShiftManagedClustersClientImpl.java deleted file mode 100644 index a5ec47d1fba4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/implementation/OpenShiftManagedClustersClientImpl.java +++ /dev/null @@ -1,1569 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.containerservice.fluent.OpenShiftManagedClustersClient; -import com.azure.resourcemanager.containerservice.fluent.models.OpenShiftManagedClusterInner; -import com.azure.resourcemanager.containerservice.models.OpenShiftManagedClusterListResult; -import com.azure.resourcemanager.containerservice.models.TagsObject; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in OpenShiftManagedClustersClient. */ -public final class OpenShiftManagedClustersClientImpl - implements InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete, - OpenShiftManagedClustersClient { - private final ClientLogger logger = new ClientLogger(OpenShiftManagedClustersClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final OpenShiftManagedClustersService service; - - /** The service client containing this operation class. */ - private final ContainerServiceManagementClientImpl client; - - /** - * Initializes an instance of OpenShiftManagedClustersClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - OpenShiftManagedClustersClientImpl(ContainerServiceManagementClientImpl client) { - this.service = - RestProxy - .create(OpenShiftManagedClustersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for ContainerServiceManagementClientOpenShiftManagedClusters to be used - * by the proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "ContainerServiceMana") - private interface OpenShiftManagedClustersService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/openShiftManagedClusters") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" - + "/openShiftManagedClusters") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" - + "/openShiftManagedClusters/{resourceName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("resourceName") String resourceName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" - + "/openShiftManagedClusters/{resourceName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("resourceName") String resourceName, - @BodyParam("application/json") OpenShiftManagedClusterInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" - + "/openShiftManagedClusters/{resourceName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> updateTags( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("resourceName") String resourceName, - @BodyParam("application/json") TagsObject parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" - + "/openShiftManagedClusters/{resourceName}") - @ExpectedResponses({202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("resourceName") String resourceName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets a list of OpenShift managed clusters in the specified subscription. The operation returns properties of each - * OpenShift managed cluster. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of OpenShift managed clusters in the specified subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-04-30"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a list of OpenShift managed clusters in the specified subscription. The operation returns properties of each - * OpenShift managed cluster. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of OpenShift managed clusters in the specified subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-04-30"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets a list of OpenShift managed clusters in the specified subscription. The operation returns properties of each - * OpenShift managed cluster. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of OpenShift managed clusters in the specified subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets a list of OpenShift managed clusters in the specified subscription. The operation returns properties of each - * OpenShift managed cluster. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of OpenShift managed clusters in the specified subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets a list of OpenShift managed clusters in the specified subscription. The operation returns properties of each - * OpenShift managed cluster. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of OpenShift managed clusters in the specified subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Gets a list of OpenShift managed clusters in the specified subscription. The operation returns properties of each - * OpenShift managed cluster. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of OpenShift managed clusters in the specified subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Lists OpenShift managed clusters in the specified subscription and resource group. The operation returns - * properties of each OpenShift managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the List OpenShift Managed Clusters operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String apiVersion = "2019-04-30"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists OpenShift managed clusters in the specified subscription and resource group. The operation returns - * properties of each OpenShift managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the List OpenShift Managed Clusters operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String apiVersion = "2019-04-30"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists OpenShift managed clusters in the specified subscription and resource group. The operation returns - * properties of each OpenShift managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the List OpenShift Managed Clusters operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * Lists OpenShift managed clusters in the specified subscription and resource group. The operation returns - * properties of each OpenShift managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the List OpenShift Managed Clusters operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync( - String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists OpenShift managed clusters in the specified subscription and resource group. The operation returns - * properties of each OpenShift managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the List OpenShift Managed Clusters operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * Lists OpenShift managed clusters in the specified subscription and resource group. The operation returns - * properties of each OpenShift managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the List OpenShift Managed Clusters operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * Gets the details of the managed OpenShift cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the OpenShift managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of the managed OpenShift cluster with a specified resource group and name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String resourceName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String apiVersion = "2019-04-30"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - resourceName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the details of the managed OpenShift cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the OpenShift managed cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of the managed OpenShift cluster with a specified resource group and name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String resourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String apiVersion = "2019-04-30"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - resourceName, - accept, - context); - } - - /** - * Gets the details of the managed OpenShift cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the OpenShift managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of the managed OpenShift cluster with a specified resource group and name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync(String resourceGroupName, String resourceName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, resourceName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the details of the managed OpenShift cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the OpenShift managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of the managed OpenShift cluster with a specified resource group and name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public OpenShiftManagedClusterInner getByResourceGroup(String resourceGroupName, String resourceName) { - return getByResourceGroupAsync(resourceGroupName, resourceName).block(); - } - - /** - * Gets the details of the managed OpenShift cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the OpenShift managed cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of the managed OpenShift cluster with a specified resource group and name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String resourceName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, resourceName, context).block(); - } - - /** - * Creates or updates a OpenShift managed cluster with the specified configuration for agents and OpenShift version. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the OpenShift managed cluster resource. - * @param parameters Parameters supplied to the Create or Update an OpenShift Managed Cluster operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return openShift Managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String resourceName, OpenShiftManagedClusterInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2019-04-30"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - resourceName, - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a OpenShift managed cluster with the specified configuration for agents and OpenShift version. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the OpenShift managed cluster resource. - * @param parameters Parameters supplied to the Create or Update an OpenShift Managed Cluster operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return openShift Managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String resourceName, OpenShiftManagedClusterInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2019-04-30"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - resourceName, - parameters, - accept, - context); - } - - /** - * Creates or updates a OpenShift managed cluster with the specified configuration for agents and OpenShift version. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the OpenShift managed cluster resource. - * @param parameters Parameters supplied to the Create or Update an OpenShift Managed Cluster operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return openShift Managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, OpenShiftManagedClusterInner> beginCreateOrUpdateAsync( - String resourceGroupName, String resourceName, OpenShiftManagedClusterInner parameters) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, resourceName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - OpenShiftManagedClusterInner.class, - OpenShiftManagedClusterInner.class, - Context.NONE); - } - - /** - * Creates or updates a OpenShift managed cluster with the specified configuration for agents and OpenShift version. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the OpenShift managed cluster resource. - * @param parameters Parameters supplied to the Create or Update an OpenShift Managed Cluster operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return openShift Managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, OpenShiftManagedClusterInner> beginCreateOrUpdateAsync( - String resourceGroupName, String resourceName, OpenShiftManagedClusterInner parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, resourceName, parameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - OpenShiftManagedClusterInner.class, - OpenShiftManagedClusterInner.class, - context); - } - - /** - * Creates or updates a OpenShift managed cluster with the specified configuration for agents and OpenShift version. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the OpenShift managed cluster resource. - * @param parameters Parameters supplied to the Create or Update an OpenShift Managed Cluster operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return openShift Managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, OpenShiftManagedClusterInner> beginCreateOrUpdate( - String resourceGroupName, String resourceName, OpenShiftManagedClusterInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, resourceName, parameters).getSyncPoller(); - } - - /** - * Creates or updates a OpenShift managed cluster with the specified configuration for agents and OpenShift version. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the OpenShift managed cluster resource. - * @param parameters Parameters supplied to the Create or Update an OpenShift Managed Cluster operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return openShift Managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, OpenShiftManagedClusterInner> beginCreateOrUpdate( - String resourceGroupName, String resourceName, OpenShiftManagedClusterInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, resourceName, parameters, context).getSyncPoller(); - } - - /** - * Creates or updates a OpenShift managed cluster with the specified configuration for agents and OpenShift version. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the OpenShift managed cluster resource. - * @param parameters Parameters supplied to the Create or Update an OpenShift Managed Cluster operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return openShift Managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, String resourceName, OpenShiftManagedClusterInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, resourceName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a OpenShift managed cluster with the specified configuration for agents and OpenShift version. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the OpenShift managed cluster resource. - * @param parameters Parameters supplied to the Create or Update an OpenShift Managed Cluster operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return openShift Managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String resourceName, OpenShiftManagedClusterInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, resourceName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a OpenShift managed cluster with the specified configuration for agents and OpenShift version. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the OpenShift managed cluster resource. - * @param parameters Parameters supplied to the Create or Update an OpenShift Managed Cluster operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return openShift Managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public OpenShiftManagedClusterInner createOrUpdate( - String resourceGroupName, String resourceName, OpenShiftManagedClusterInner parameters) { - return createOrUpdateAsync(resourceGroupName, resourceName, parameters).block(); - } - - /** - * Creates or updates a OpenShift managed cluster with the specified configuration for agents and OpenShift version. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the OpenShift managed cluster resource. - * @param parameters Parameters supplied to the Create or Update an OpenShift Managed Cluster operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return openShift Managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public OpenShiftManagedClusterInner createOrUpdate( - String resourceGroupName, String resourceName, OpenShiftManagedClusterInner parameters, Context context) { - return createOrUpdateAsync(resourceGroupName, resourceName, parameters, context).block(); - } - - /** - * Updates an OpenShift managed cluster with the specified tags. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the OpenShift managed cluster resource. - * @param parameters Parameters supplied to the Update OpenShift Managed Cluster Tags operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return openShift Managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateTagsWithResponseAsync( - String resourceGroupName, String resourceName, TagsObject parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2019-04-30"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updateTags( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - resourceName, - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates an OpenShift managed cluster with the specified tags. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the OpenShift managed cluster resource. - * @param parameters Parameters supplied to the Update OpenShift Managed Cluster Tags operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return openShift Managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateTagsWithResponseAsync( - String resourceGroupName, String resourceName, TagsObject parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2019-04-30"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updateTags( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - resourceName, - parameters, - accept, - context); - } - - /** - * Updates an OpenShift managed cluster with the specified tags. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the OpenShift managed cluster resource. - * @param parameters Parameters supplied to the Update OpenShift Managed Cluster Tags operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return openShift Managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, OpenShiftManagedClusterInner> beginUpdateTagsAsync( - String resourceGroupName, String resourceName, TagsObject parameters) { - Mono>> mono = - updateTagsWithResponseAsync(resourceGroupName, resourceName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - OpenShiftManagedClusterInner.class, - OpenShiftManagedClusterInner.class, - Context.NONE); - } - - /** - * Updates an OpenShift managed cluster with the specified tags. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the OpenShift managed cluster resource. - * @param parameters Parameters supplied to the Update OpenShift Managed Cluster Tags operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return openShift Managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, OpenShiftManagedClusterInner> beginUpdateTagsAsync( - String resourceGroupName, String resourceName, TagsObject parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - updateTagsWithResponseAsync(resourceGroupName, resourceName, parameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - OpenShiftManagedClusterInner.class, - OpenShiftManagedClusterInner.class, - context); - } - - /** - * Updates an OpenShift managed cluster with the specified tags. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the OpenShift managed cluster resource. - * @param parameters Parameters supplied to the Update OpenShift Managed Cluster Tags operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return openShift Managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, OpenShiftManagedClusterInner> beginUpdateTags( - String resourceGroupName, String resourceName, TagsObject parameters) { - return beginUpdateTagsAsync(resourceGroupName, resourceName, parameters).getSyncPoller(); - } - - /** - * Updates an OpenShift managed cluster with the specified tags. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the OpenShift managed cluster resource. - * @param parameters Parameters supplied to the Update OpenShift Managed Cluster Tags operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return openShift Managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, OpenShiftManagedClusterInner> beginUpdateTags( - String resourceGroupName, String resourceName, TagsObject parameters, Context context) { - return beginUpdateTagsAsync(resourceGroupName, resourceName, parameters, context).getSyncPoller(); - } - - /** - * Updates an OpenShift managed cluster with the specified tags. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the OpenShift managed cluster resource. - * @param parameters Parameters supplied to the Update OpenShift Managed Cluster Tags operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return openShift Managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateTagsAsync( - String resourceGroupName, String resourceName, TagsObject parameters) { - return beginUpdateTagsAsync(resourceGroupName, resourceName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates an OpenShift managed cluster with the specified tags. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the OpenShift managed cluster resource. - * @param parameters Parameters supplied to the Update OpenShift Managed Cluster Tags operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return openShift Managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateTagsAsync( - String resourceGroupName, String resourceName, TagsObject parameters, Context context) { - return beginUpdateTagsAsync(resourceGroupName, resourceName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates an OpenShift managed cluster with the specified tags. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the OpenShift managed cluster resource. - * @param parameters Parameters supplied to the Update OpenShift Managed Cluster Tags operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return openShift Managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public OpenShiftManagedClusterInner updateTags( - String resourceGroupName, String resourceName, TagsObject parameters) { - return updateTagsAsync(resourceGroupName, resourceName, parameters).block(); - } - - /** - * Updates an OpenShift managed cluster with the specified tags. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the OpenShift managed cluster resource. - * @param parameters Parameters supplied to the Update OpenShift Managed Cluster Tags operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return openShift Managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public OpenShiftManagedClusterInner updateTags( - String resourceGroupName, String resourceName, TagsObject parameters, Context context) { - return updateTagsAsync(resourceGroupName, resourceName, parameters, context).block(); - } - - /** - * Deletes the OpenShift managed cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the OpenShift managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync(String resourceGroupName, String resourceName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String apiVersion = "2019-04-30"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - resourceName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the OpenShift managed cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the OpenShift managed cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String resourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String apiVersion = "2019-04-30"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - resourceName, - accept, - context); - } - - /** - * Deletes the OpenShift managed cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the OpenShift managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String resourceName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, resourceName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deletes the OpenShift managed cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the OpenShift managed cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String resourceName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(resourceGroupName, resourceName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes the OpenShift managed cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the OpenShift managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName) { - return beginDeleteAsync(resourceGroupName, resourceName).getSyncPoller(); - } - - /** - * Deletes the OpenShift managed cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the OpenShift managed cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String resourceName, Context context) { - return beginDeleteAsync(resourceGroupName, resourceName, context).getSyncPoller(); - } - - /** - * Deletes the OpenShift managed cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the OpenShift managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String resourceName) { - return beginDeleteAsync(resourceGroupName, resourceName).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the OpenShift managed cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the OpenShift managed cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String resourceName, Context context) { - return beginDeleteAsync(resourceGroupName, resourceName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the OpenShift managed cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the OpenShift managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String resourceName) { - deleteAsync(resourceGroupName, resourceName).block(); - } - - /** - * Deletes the OpenShift managed cluster with a specified resource group and name. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the OpenShift managed cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String resourceName, Context context) { - deleteAsync(resourceGroupName, resourceName, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the List OpenShift Managed Clusters operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the List OpenShift Managed Clusters operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the List OpenShift Managed Clusters operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the List OpenShift Managed Clusters operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/implementation/OperationsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/implementation/OperationsClientImpl.java deleted file mode 100644 index a70b7771a557..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/implementation/OperationsClientImpl.java +++ /dev/null @@ -1,177 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.containerservice.fluent.OperationsClient; -import com.azure.resourcemanager.containerservice.fluent.models.OperationValueInner; -import com.azure.resourcemanager.containerservice.models.OperationListResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in OperationsClient. */ -public final class OperationsClientImpl implements OperationsClient { - private final ClientLogger logger = new ClientLogger(OperationsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final OperationsService service; - - /** The service client containing this operation class. */ - private final ContainerServiceManagementClientImpl client; - - /** - * Initializes an instance of OperationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - OperationsClientImpl(ContainerServiceManagementClientImpl client) { - this.service = - RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for ContainerServiceManagementClientOperations to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "ContainerServiceMana") - private interface OperationsService { - @Headers({"Content-Type: application/json"}) - @Get("/providers/Microsoft.ContainerService/operations") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets a list of compute operations. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of compute operations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String apiVersion = "2020-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a list of compute operations. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of compute operations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String apiVersion = "2020-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); - } - - /** - * Gets a list of compute operations. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of compute operations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync()); - } - - /** - * Gets a list of compute operations. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of compute operations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context)); - } - - /** - * Gets a list of compute operations. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of compute operations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Gets a list of compute operations. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of compute operations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/implementation/PrivateEndpointConnectionsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/implementation/PrivateEndpointConnectionsClientImpl.java deleted file mode 100644 index 633eeb828959..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/implementation/PrivateEndpointConnectionsClientImpl.java +++ /dev/null @@ -1,931 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.containerservice.fluent.PrivateEndpointConnectionsClient; -import com.azure.resourcemanager.containerservice.fluent.models.PrivateEndpointConnectionInner; -import com.azure.resourcemanager.containerservice.fluent.models.PrivateEndpointConnectionListResultInner; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. */ -public final class PrivateEndpointConnectionsClientImpl implements PrivateEndpointConnectionsClient { - private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final PrivateEndpointConnectionsService service; - - /** The service client containing this operation class. */ - private final ContainerServiceManagementClientImpl client; - - /** - * Initializes an instance of PrivateEndpointConnectionsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - PrivateEndpointConnectionsClientImpl(ContainerServiceManagementClientImpl client) { - this.service = - RestProxy - .create( - PrivateEndpointConnectionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for ContainerServiceManagementClientPrivateEndpointConnections to be used - * by the proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "ContainerServiceMana") - private interface PrivateEndpointConnectionsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" - + "/managedClusters/{resourceName}/privateEndpointConnections") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("resourceName") String resourceName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" - + "/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("resourceName") String resourceName, - @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" - + "/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("resourceName") String resourceName, - @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, - @BodyParam("application/json") PrivateEndpointConnectionInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" - + "/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("resourceName") String resourceName, - @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets a list of private endpoint connections in the specified managed cluster. The operation returns properties of - * each private endpoint connection. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of private endpoint connections in the specified managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listWithResponseAsync( - String resourceGroupName, String resourceName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String apiVersion = "2020-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - resourceName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a list of private endpoint connections in the specified managed cluster. The operation returns properties of - * each private endpoint connection. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of private endpoint connections in the specified managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync( - String resourceGroupName, String resourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String apiVersion = "2020-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - resourceName, - accept, - context); - } - - /** - * Gets a list of private endpoint connections in the specified managed cluster. The operation returns properties of - * each private endpoint connection. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of private endpoint connections in the specified managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listAsync(String resourceGroupName, String resourceName) { - return listWithResponseAsync(resourceGroupName, resourceName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a list of private endpoint connections in the specified managed cluster. The operation returns properties of - * each private endpoint connection. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of private endpoint connections in the specified managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateEndpointConnectionListResultInner list(String resourceGroupName, String resourceName) { - return listAsync(resourceGroupName, resourceName).block(); - } - - /** - * Gets a list of private endpoint connections in the specified managed cluster. The operation returns properties of - * each private endpoint connection. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of private endpoint connections in the specified managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse( - String resourceGroupName, String resourceName, Context context) { - return listWithResponseAsync(resourceGroupName, resourceName, context).block(); - } - - /** - * Gets the details of the private endpoint connection by managed cluster and resource group. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of the private endpoint connection by managed cluster and resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String resourceGroupName, String resourceName, String privateEndpointConnectionName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); - } - final String apiVersion = "2020-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - resourceName, - privateEndpointConnectionName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the details of the private endpoint connection by managed cluster and resource group. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of the private endpoint connection by managed cluster and resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String resourceName, String privateEndpointConnectionName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); - } - final String apiVersion = "2020-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - resourceName, - privateEndpointConnectionName, - accept, - context); - } - - /** - * Gets the details of the private endpoint connection by managed cluster and resource group. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of the private endpoint connection by managed cluster and resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync( - String resourceGroupName, String resourceName, String privateEndpointConnectionName) { - return getWithResponseAsync(resourceGroupName, resourceName, privateEndpointConnectionName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the details of the private endpoint connection by managed cluster and resource group. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of the private endpoint connection by managed cluster and resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateEndpointConnectionInner get( - String resourceGroupName, String resourceName, String privateEndpointConnectionName) { - return getAsync(resourceGroupName, resourceName, privateEndpointConnectionName).block(); - } - - /** - * Gets the details of the private endpoint connection by managed cluster and resource group. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of the private endpoint connection by managed cluster and resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String resourceName, String privateEndpointConnectionName, Context context) { - return getWithResponseAsync(resourceGroupName, resourceName, privateEndpointConnectionName, context).block(); - } - - /** - * Updates a private endpoint connection in the specified managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param parameters Parameters supplied to the Update a private endpoint connection operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateWithResponseAsync( - String resourceGroupName, - String resourceName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - resourceName, - privateEndpointConnectionName, - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates a private endpoint connection in the specified managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param parameters Parameters supplied to the Update a private endpoint connection operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, - String resourceName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner parameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - resourceName, - privateEndpointConnectionName, - parameters, - accept, - context); - } - - /** - * Updates a private endpoint connection in the specified managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param parameters Parameters supplied to the Update a private endpoint connection operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync( - String resourceGroupName, - String resourceName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner parameters) { - return updateWithResponseAsync(resourceGroupName, resourceName, privateEndpointConnectionName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Updates a private endpoint connection in the specified managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param parameters Parameters supplied to the Update a private endpoint connection operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateEndpointConnectionInner update( - String resourceGroupName, - String resourceName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner parameters) { - return updateAsync(resourceGroupName, resourceName, privateEndpointConnectionName, parameters).block(); - } - - /** - * Updates a private endpoint connection in the specified managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param parameters Parameters supplied to the Update a private endpoint connection operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, - String resourceName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner parameters, - Context context) { - return updateWithResponseAsync( - resourceGroupName, resourceName, privateEndpointConnectionName, parameters, context) - .block(); - } - - /** - * Deletes the private endpoint connection in the specified managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync( - String resourceGroupName, String resourceName, String privateEndpointConnectionName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); - } - final String apiVersion = "2020-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - resourceName, - privateEndpointConnectionName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the private endpoint connection in the specified managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String resourceName, String privateEndpointConnectionName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); - } - final String apiVersion = "2020-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - resourceName, - privateEndpointConnectionName, - accept, - context); - } - - /** - * Deletes the private endpoint connection in the specified managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String resourceName, String privateEndpointConnectionName) { - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, resourceName, privateEndpointConnectionName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deletes the private endpoint connection in the specified managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String resourceName, String privateEndpointConnectionName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, resourceName, privateEndpointConnectionName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes the private endpoint connection in the specified managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String resourceName, String privateEndpointConnectionName) { - return beginDeleteAsync(resourceGroupName, resourceName, privateEndpointConnectionName).getSyncPoller(); - } - - /** - * Deletes the private endpoint connection in the specified managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String resourceName, String privateEndpointConnectionName, Context context) { - return beginDeleteAsync(resourceGroupName, resourceName, privateEndpointConnectionName, context) - .getSyncPoller(); - } - - /** - * Deletes the private endpoint connection in the specified managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String resourceName, String privateEndpointConnectionName) { - return beginDeleteAsync(resourceGroupName, resourceName, privateEndpointConnectionName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the private endpoint connection in the specified managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync( - String resourceGroupName, String resourceName, String privateEndpointConnectionName, Context context) { - return beginDeleteAsync(resourceGroupName, resourceName, privateEndpointConnectionName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the private endpoint connection in the specified managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String resourceName, String privateEndpointConnectionName) { - deleteAsync(resourceGroupName, resourceName, privateEndpointConnectionName).block(); - } - - /** - * Deletes the private endpoint connection in the specified managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete( - String resourceGroupName, String resourceName, String privateEndpointConnectionName, Context context) { - deleteAsync(resourceGroupName, resourceName, privateEndpointConnectionName, context).block(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/implementation/PrivateLinkResourcesClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/implementation/PrivateLinkResourcesClientImpl.java deleted file mode 100644 index 9eb584b89b56..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/implementation/PrivateLinkResourcesClientImpl.java +++ /dev/null @@ -1,229 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.containerservice.fluent.PrivateLinkResourcesClient; -import com.azure.resourcemanager.containerservice.fluent.models.PrivateLinkResourcesListResultInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. */ -public final class PrivateLinkResourcesClientImpl implements PrivateLinkResourcesClient { - private final ClientLogger logger = new ClientLogger(PrivateLinkResourcesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final PrivateLinkResourcesService service; - - /** The service client containing this operation class. */ - private final ContainerServiceManagementClientImpl client; - - /** - * Initializes an instance of PrivateLinkResourcesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - PrivateLinkResourcesClientImpl(ContainerServiceManagementClientImpl client) { - this.service = - RestProxy - .create(PrivateLinkResourcesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for ContainerServiceManagementClientPrivateLinkResources to be used by - * the proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "ContainerServiceMana") - private interface PrivateLinkResourcesService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" - + "/managedClusters/{resourceName}/privateLinkResources") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("resourceName") String resourceName, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets a list of private link resources in the specified managed cluster. The operation returns properties of each - * private link resource. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of private link resources in the specified managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listWithResponseAsync( - String resourceGroupName, String resourceName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String apiVersion = "2020-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - resourceName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a list of private link resources in the specified managed cluster. The operation returns properties of each - * private link resource. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of private link resources in the specified managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync( - String resourceGroupName, String resourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String apiVersion = "2020-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - resourceName, - accept, - context); - } - - /** - * Gets a list of private link resources in the specified managed cluster. The operation returns properties of each - * private link resource. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of private link resources in the specified managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listAsync(String resourceGroupName, String resourceName) { - return listWithResponseAsync(resourceGroupName, resourceName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a list of private link resources in the specified managed cluster. The operation returns properties of each - * private link resource. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of private link resources in the specified managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateLinkResourcesListResultInner list(String resourceGroupName, String resourceName) { - return listAsync(resourceGroupName, resourceName).block(); - } - - /** - * Gets a list of private link resources in the specified managed cluster. The operation returns properties of each - * private link resource. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of private link resources in the specified managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse( - String resourceGroupName, String resourceName, Context context) { - return listWithResponseAsync(resourceGroupName, resourceName, context).block(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/implementation/ResolvePrivateLinkServiceIdsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/implementation/ResolvePrivateLinkServiceIdsClientImpl.java deleted file mode 100644 index a64d1aef1645..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/implementation/ResolvePrivateLinkServiceIdsClientImpl.java +++ /dev/null @@ -1,246 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.containerservice.fluent.ResolvePrivateLinkServiceIdsClient; -import com.azure.resourcemanager.containerservice.fluent.models.PrivateLinkResourceInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ResolvePrivateLinkServiceIdsClient. */ -public final class ResolvePrivateLinkServiceIdsClientImpl implements ResolvePrivateLinkServiceIdsClient { - private final ClientLogger logger = new ClientLogger(ResolvePrivateLinkServiceIdsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final ResolvePrivateLinkServiceIdsService service; - - /** The service client containing this operation class. */ - private final ContainerServiceManagementClientImpl client; - - /** - * Initializes an instance of ResolvePrivateLinkServiceIdsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ResolvePrivateLinkServiceIdsClientImpl(ContainerServiceManagementClientImpl client) { - this.service = - RestProxy - .create( - ResolvePrivateLinkServiceIdsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for ContainerServiceManagementClientResolvePrivateLinkServiceIds to be - * used by the proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "ContainerServiceMana") - private interface ResolvePrivateLinkServiceIdsService { - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" - + "/managedClusters/{resourceName}/resolvePrivateLinkServiceId") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> post( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("resourceName") String resourceName, - @BodyParam("application/json") PrivateLinkResourceInner parameters, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets the private link service ID the specified managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param parameters Parameters (name, groupId) supplied in order to resolve a private link service ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link service ID the specified managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> postWithResponseAsync( - String resourceGroupName, String resourceName, PrivateLinkResourceInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .post( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - resourceName, - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the private link service ID the specified managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param parameters Parameters (name, groupId) supplied in order to resolve a private link service ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link service ID the specified managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> postWithResponseAsync( - String resourceGroupName, String resourceName, PrivateLinkResourceInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .post( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - resourceName, - parameters, - accept, - context); - } - - /** - * Gets the private link service ID the specified managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param parameters Parameters (name, groupId) supplied in order to resolve a private link service ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link service ID the specified managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono postAsync( - String resourceGroupName, String resourceName, PrivateLinkResourceInner parameters) { - return postWithResponseAsync(resourceGroupName, resourceName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the private link service ID the specified managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param parameters Parameters (name, groupId) supplied in order to resolve a private link service ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link service ID the specified managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateLinkResourceInner post( - String resourceGroupName, String resourceName, PrivateLinkResourceInner parameters) { - return postAsync(resourceGroupName, resourceName, parameters).block(); - } - - /** - * Gets the private link service ID the specified managed cluster. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param parameters Parameters (name, groupId) supplied in order to resolve a private link service ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link service ID the specified managed cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response postWithResponse( - String resourceGroupName, String resourceName, PrivateLinkResourceInner parameters, Context context) { - return postWithResponseAsync(resourceGroupName, resourceName, parameters, context).block(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem.java deleted file mode 100644 index b9577a2062dc..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem.java +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem model. */ -@Fluent -public final class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem { - @JsonIgnore - private final ClientLogger logger = - new ClientLogger(AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem.class); - - /* - * Whether this version is the default agent pool version. - */ - @JsonProperty(value = "default") - private Boolean defaultProperty; - - /* - * Kubernetes version (major, minor, patch). - */ - @JsonProperty(value = "kubernetesVersion") - private String kubernetesVersion; - - /* - * Whether Kubernetes version is currently in preview. - */ - @JsonProperty(value = "isPreview") - private Boolean isPreview; - - /** - * Get the defaultProperty property: Whether this version is the default agent pool version. - * - * @return the defaultProperty value. - */ - public Boolean defaultProperty() { - return this.defaultProperty; - } - - /** - * Set the defaultProperty property: Whether this version is the default agent pool version. - * - * @param defaultProperty the defaultProperty value to set. - * @return the AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem object itself. - */ - public AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem withDefaultProperty(Boolean defaultProperty) { - this.defaultProperty = defaultProperty; - return this; - } - - /** - * Get the kubernetesVersion property: Kubernetes version (major, minor, patch). - * - * @return the kubernetesVersion value. - */ - public String kubernetesVersion() { - return this.kubernetesVersion; - } - - /** - * Set the kubernetesVersion property: Kubernetes version (major, minor, patch). - * - * @param kubernetesVersion the kubernetesVersion value to set. - * @return the AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem object itself. - */ - public AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem withKubernetesVersion(String kubernetesVersion) { - this.kubernetesVersion = kubernetesVersion; - return this; - } - - /** - * Get the isPreview property: Whether Kubernetes version is currently in preview. - * - * @return the isPreview value. - */ - public Boolean isPreview() { - return this.isPreview; - } - - /** - * Set the isPreview property: Whether Kubernetes version is currently in preview. - * - * @param isPreview the isPreview value to set. - * @return the AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem object itself. - */ - public AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem withIsPreview(Boolean isPreview) { - this.isPreview = isPreview; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/AgentPoolListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/AgentPoolListResult.java deleted file mode 100644 index 505a74f038f0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/AgentPoolListResult.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.containerservice.fluent.models.AgentPoolInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The response from the List Agent Pools operation. */ -@Fluent -public final class AgentPoolListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AgentPoolListResult.class); - - /* - * The list of agent pools. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to get the next set of agent pool results. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: The list of agent pools. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The list of agent pools. - * - * @param value the value value to set. - * @return the AgentPoolListResult object itself. - */ - public AgentPoolListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to get the next set of agent pool results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/AgentPoolMode.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/AgentPoolMode.java deleted file mode 100644 index d8b7de58766f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/AgentPoolMode.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for AgentPoolMode. */ -public final class AgentPoolMode extends ExpandableStringEnum { - /** Static value System for AgentPoolMode. */ - public static final AgentPoolMode SYSTEM = fromString("System"); - - /** Static value User for AgentPoolMode. */ - public static final AgentPoolMode USER = fromString("User"); - - /** - * Creates or finds a AgentPoolMode from its string representation. - * - * @param name a name to look for. - * @return the corresponding AgentPoolMode. - */ - @JsonCreator - public static AgentPoolMode fromString(String name) { - return fromString(name, AgentPoolMode.class); - } - - /** @return known AgentPoolMode values. */ - public static Collection values() { - return values(AgentPoolMode.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/AgentPoolType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/AgentPoolType.java deleted file mode 100644 index 2e49481c39f6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/AgentPoolType.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for AgentPoolType. */ -public final class AgentPoolType extends ExpandableStringEnum { - /** Static value VirtualMachineScaleSets for AgentPoolType. */ - public static final AgentPoolType VIRTUAL_MACHINE_SCALE_SETS = fromString("VirtualMachineScaleSets"); - - /** Static value AvailabilitySet for AgentPoolType. */ - public static final AgentPoolType AVAILABILITY_SET = fromString("AvailabilitySet"); - - /** - * Creates or finds a AgentPoolType from its string representation. - * - * @param name a name to look for. - * @return the corresponding AgentPoolType. - */ - @JsonCreator - public static AgentPoolType fromString(String name) { - return fromString(name, AgentPoolType.class); - } - - /** @return known AgentPoolType values. */ - public static Collection values() { - return values(AgentPoolType.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/AgentPoolUpgradeProfilePropertiesUpgradesItem.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/AgentPoolUpgradeProfilePropertiesUpgradesItem.java deleted file mode 100644 index 2524f05b8cc7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/AgentPoolUpgradeProfilePropertiesUpgradesItem.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The AgentPoolUpgradeProfilePropertiesUpgradesItem model. */ -@Fluent -public final class AgentPoolUpgradeProfilePropertiesUpgradesItem { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(AgentPoolUpgradeProfilePropertiesUpgradesItem.class); - - /* - * Kubernetes version (major, minor, patch). - */ - @JsonProperty(value = "kubernetesVersion") - private String kubernetesVersion; - - /* - * Whether Kubernetes version is currently in preview. - */ - @JsonProperty(value = "isPreview") - private Boolean isPreview; - - /** - * Get the kubernetesVersion property: Kubernetes version (major, minor, patch). - * - * @return the kubernetesVersion value. - */ - public String kubernetesVersion() { - return this.kubernetesVersion; - } - - /** - * Set the kubernetesVersion property: Kubernetes version (major, minor, patch). - * - * @param kubernetesVersion the kubernetesVersion value to set. - * @return the AgentPoolUpgradeProfilePropertiesUpgradesItem object itself. - */ - public AgentPoolUpgradeProfilePropertiesUpgradesItem withKubernetesVersion(String kubernetesVersion) { - this.kubernetesVersion = kubernetesVersion; - return this; - } - - /** - * Get the isPreview property: Whether Kubernetes version is currently in preview. - * - * @return the isPreview value. - */ - public Boolean isPreview() { - return this.isPreview; - } - - /** - * Set the isPreview property: Whether Kubernetes version is currently in preview. - * - * @param isPreview the isPreview value to set. - * @return the AgentPoolUpgradeProfilePropertiesUpgradesItem object itself. - */ - public AgentPoolUpgradeProfilePropertiesUpgradesItem withIsPreview(Boolean isPreview) { - this.isPreview = isPreview; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/AgentPoolUpgradeSettings.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/AgentPoolUpgradeSettings.java deleted file mode 100644 index 520dc706d4ae..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/AgentPoolUpgradeSettings.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Settings for upgrading an agentpool. */ -@Fluent -public final class AgentPoolUpgradeSettings { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AgentPoolUpgradeSettings.class); - - /* - * Count or percentage of additional nodes to be added during upgrade. If - * empty uses AKS default - */ - @JsonProperty(value = "maxSurge") - private String maxSurge; - - /** - * Get the maxSurge property: Count or percentage of additional nodes to be added during upgrade. If empty uses AKS - * default. - * - * @return the maxSurge value. - */ - public String maxSurge() { - return this.maxSurge; - } - - /** - * Set the maxSurge property: Count or percentage of additional nodes to be added during upgrade. If empty uses AKS - * default. - * - * @param maxSurge the maxSurge value to set. - * @return the AgentPoolUpgradeSettings object itself. - */ - public AgentPoolUpgradeSettings withMaxSurge(String maxSurge) { - this.maxSurge = maxSurge; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/BaseManagedCluster.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/BaseManagedCluster.java deleted file mode 100644 index bcc853431e47..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/BaseManagedCluster.java +++ /dev/null @@ -1,542 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.containerservice.fluent.models.ManagedClusterProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** The BaseManagedCluster model. */ -@Fluent -public class BaseManagedCluster { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BaseManagedCluster.class); - - /* - * Properties of a managed cluster. - */ - @JsonProperty(value = "properties") - private ManagedClusterProperties innerProperties; - - /* - * The identity of the managed cluster, if configured. - */ - @JsonProperty(value = "identity") - private ManagedClusterIdentity identity; - - /** - * Get the innerProperties property: Properties of a managed cluster. - * - * @return the innerProperties value. - */ - private ManagedClusterProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the identity property: The identity of the managed cluster, if configured. - * - * @return the identity value. - */ - public ManagedClusterIdentity identity() { - return this.identity; - } - - /** - * Set the identity property: The identity of the managed cluster, if configured. - * - * @param identity the identity value to set. - * @return the BaseManagedCluster object itself. - */ - public BaseManagedCluster withIdentity(ManagedClusterIdentity identity) { - this.identity = identity; - return this; - } - - /** - * Get the provisioningState property: The current deployment or provisioning state, which only appears in the - * response. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the powerState property: Represents the Power State of the cluster. - * - * @return the powerState value. - */ - public PowerState powerState() { - return this.innerProperties() == null ? null : this.innerProperties().powerState(); - } - - /** - * Get the maxAgentPools property: The max number of agent pools for the managed cluster. - * - * @return the maxAgentPools value. - */ - public Integer maxAgentPools() { - return this.innerProperties() == null ? null : this.innerProperties().maxAgentPools(); - } - - /** - * Get the kubernetesVersion property: Version of Kubernetes specified when creating the managed cluster. - * - * @return the kubernetesVersion value. - */ - public String kubernetesVersion() { - return this.innerProperties() == null ? null : this.innerProperties().kubernetesVersion(); - } - - /** - * Set the kubernetesVersion property: Version of Kubernetes specified when creating the managed cluster. - * - * @param kubernetesVersion the kubernetesVersion value to set. - * @return the BaseManagedCluster object itself. - */ - public BaseManagedCluster withKubernetesVersion(String kubernetesVersion) { - if (this.innerProperties() == null) { - this.innerProperties = new ManagedClusterProperties(); - } - this.innerProperties().withKubernetesVersion(kubernetesVersion); - return this; - } - - /** - * Get the dnsPrefix property: DNS prefix specified when creating the managed cluster. - * - * @return the dnsPrefix value. - */ - public String dnsPrefix() { - return this.innerProperties() == null ? null : this.innerProperties().dnsPrefix(); - } - - /** - * Set the dnsPrefix property: DNS prefix specified when creating the managed cluster. - * - * @param dnsPrefix the dnsPrefix value to set. - * @return the BaseManagedCluster object itself. - */ - public BaseManagedCluster withDnsPrefix(String dnsPrefix) { - if (this.innerProperties() == null) { - this.innerProperties = new ManagedClusterProperties(); - } - this.innerProperties().withDnsPrefix(dnsPrefix); - return this; - } - - /** - * Get the fqdn property: FQDN for the master pool. - * - * @return the fqdn value. - */ - public String fqdn() { - return this.innerProperties() == null ? null : this.innerProperties().fqdn(); - } - - /** - * Get the privateFqdn property: FQDN of private cluster. - * - * @return the privateFqdn value. - */ - public String privateFqdn() { - return this.innerProperties() == null ? null : this.innerProperties().privateFqdn(); - } - - /** - * Get the agentPoolProfiles property: Properties of the agent pool. - * - * @return the agentPoolProfiles value. - */ - public List agentPoolProfiles() { - return this.innerProperties() == null ? null : this.innerProperties().agentPoolProfiles(); - } - - /** - * Set the agentPoolProfiles property: Properties of the agent pool. - * - * @param agentPoolProfiles the agentPoolProfiles value to set. - * @return the BaseManagedCluster object itself. - */ - public BaseManagedCluster withAgentPoolProfiles(List agentPoolProfiles) { - if (this.innerProperties() == null) { - this.innerProperties = new ManagedClusterProperties(); - } - this.innerProperties().withAgentPoolProfiles(agentPoolProfiles); - return this; - } - - /** - * Get the linuxProfile property: Profile for Linux VMs in the container service cluster. - * - * @return the linuxProfile value. - */ - public ContainerServiceLinuxProfile linuxProfile() { - return this.innerProperties() == null ? null : this.innerProperties().linuxProfile(); - } - - /** - * Set the linuxProfile property: Profile for Linux VMs in the container service cluster. - * - * @param linuxProfile the linuxProfile value to set. - * @return the BaseManagedCluster object itself. - */ - public BaseManagedCluster withLinuxProfile(ContainerServiceLinuxProfile linuxProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new ManagedClusterProperties(); - } - this.innerProperties().withLinuxProfile(linuxProfile); - return this; - } - - /** - * Get the windowsProfile property: Profile for Windows VMs in the container service cluster. - * - * @return the windowsProfile value. - */ - public ManagedClusterWindowsProfile windowsProfile() { - return this.innerProperties() == null ? null : this.innerProperties().windowsProfile(); - } - - /** - * Set the windowsProfile property: Profile for Windows VMs in the container service cluster. - * - * @param windowsProfile the windowsProfile value to set. - * @return the BaseManagedCluster object itself. - */ - public BaseManagedCluster withWindowsProfile(ManagedClusterWindowsProfile windowsProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new ManagedClusterProperties(); - } - this.innerProperties().withWindowsProfile(windowsProfile); - return this; - } - - /** - * Get the servicePrincipalProfile property: Information about a service principal identity for the cluster to use - * for manipulating Azure APIs. - * - * @return the servicePrincipalProfile value. - */ - public ManagedClusterServicePrincipalProfile servicePrincipalProfile() { - return this.innerProperties() == null ? null : this.innerProperties().servicePrincipalProfile(); - } - - /** - * Set the servicePrincipalProfile property: Information about a service principal identity for the cluster to use - * for manipulating Azure APIs. - * - * @param servicePrincipalProfile the servicePrincipalProfile value to set. - * @return the BaseManagedCluster object itself. - */ - public BaseManagedCluster withServicePrincipalProfile( - ManagedClusterServicePrincipalProfile servicePrincipalProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new ManagedClusterProperties(); - } - this.innerProperties().withServicePrincipalProfile(servicePrincipalProfile); - return this; - } - - /** - * Get the addonProfiles property: Profile of managed cluster add-on. - * - * @return the addonProfiles value. - */ - public Map addonProfiles() { - return this.innerProperties() == null ? null : this.innerProperties().addonProfiles(); - } - - /** - * Set the addonProfiles property: Profile of managed cluster add-on. - * - * @param addonProfiles the addonProfiles value to set. - * @return the BaseManagedCluster object itself. - */ - public BaseManagedCluster withAddonProfiles(Map addonProfiles) { - if (this.innerProperties() == null) { - this.innerProperties = new ManagedClusterProperties(); - } - this.innerProperties().withAddonProfiles(addonProfiles); - return this; - } - - /** - * Get the podIdentityProfile property: Profile of managed cluster pod identity. - * - * @return the podIdentityProfile value. - */ - public ManagedClusterPodIdentityProfile podIdentityProfile() { - return this.innerProperties() == null ? null : this.innerProperties().podIdentityProfile(); - } - - /** - * Set the podIdentityProfile property: Profile of managed cluster pod identity. - * - * @param podIdentityProfile the podIdentityProfile value to set. - * @return the BaseManagedCluster object itself. - */ - public BaseManagedCluster withPodIdentityProfile(ManagedClusterPodIdentityProfile podIdentityProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new ManagedClusterProperties(); - } - this.innerProperties().withPodIdentityProfile(podIdentityProfile); - return this; - } - - /** - * Get the nodeResourceGroup property: Name of the resource group containing agent pool nodes. - * - * @return the nodeResourceGroup value. - */ - public String nodeResourceGroup() { - return this.innerProperties() == null ? null : this.innerProperties().nodeResourceGroup(); - } - - /** - * Set the nodeResourceGroup property: Name of the resource group containing agent pool nodes. - * - * @param nodeResourceGroup the nodeResourceGroup value to set. - * @return the BaseManagedCluster object itself. - */ - public BaseManagedCluster withNodeResourceGroup(String nodeResourceGroup) { - if (this.innerProperties() == null) { - this.innerProperties = new ManagedClusterProperties(); - } - this.innerProperties().withNodeResourceGroup(nodeResourceGroup); - return this; - } - - /** - * Get the enableRbac property: Whether to enable Kubernetes Role-Based Access Control. - * - * @return the enableRbac value. - */ - public Boolean enableRbac() { - return this.innerProperties() == null ? null : this.innerProperties().enableRbac(); - } - - /** - * Set the enableRbac property: Whether to enable Kubernetes Role-Based Access Control. - * - * @param enableRbac the enableRbac value to set. - * @return the BaseManagedCluster object itself. - */ - public BaseManagedCluster withEnableRbac(Boolean enableRbac) { - if (this.innerProperties() == null) { - this.innerProperties = new ManagedClusterProperties(); - } - this.innerProperties().withEnableRbac(enableRbac); - return this; - } - - /** - * Get the enablePodSecurityPolicy property: (DEPRECATING) Whether to enable Kubernetes pod security policy - * (preview). This feature is set for removal on October 15th, 2020. Learn more at aka.ms/aks/azpodpolicy. - * - * @return the enablePodSecurityPolicy value. - */ - public Boolean enablePodSecurityPolicy() { - return this.innerProperties() == null ? null : this.innerProperties().enablePodSecurityPolicy(); - } - - /** - * Set the enablePodSecurityPolicy property: (DEPRECATING) Whether to enable Kubernetes pod security policy - * (preview). This feature is set for removal on October 15th, 2020. Learn more at aka.ms/aks/azpodpolicy. - * - * @param enablePodSecurityPolicy the enablePodSecurityPolicy value to set. - * @return the BaseManagedCluster object itself. - */ - public BaseManagedCluster withEnablePodSecurityPolicy(Boolean enablePodSecurityPolicy) { - if (this.innerProperties() == null) { - this.innerProperties = new ManagedClusterProperties(); - } - this.innerProperties().withEnablePodSecurityPolicy(enablePodSecurityPolicy); - return this; - } - - /** - * Get the networkProfile property: Profile of network configuration. - * - * @return the networkProfile value. - */ - public ContainerServiceNetworkProfile networkProfile() { - return this.innerProperties() == null ? null : this.innerProperties().networkProfile(); - } - - /** - * Set the networkProfile property: Profile of network configuration. - * - * @param networkProfile the networkProfile value to set. - * @return the BaseManagedCluster object itself. - */ - public BaseManagedCluster withNetworkProfile(ContainerServiceNetworkProfile networkProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new ManagedClusterProperties(); - } - this.innerProperties().withNetworkProfile(networkProfile); - return this; - } - - /** - * Get the aadProfile property: Profile of Azure Active Directory configuration. - * - * @return the aadProfile value. - */ - public ManagedClusterAadProfile aadProfile() { - return this.innerProperties() == null ? null : this.innerProperties().aadProfile(); - } - - /** - * Set the aadProfile property: Profile of Azure Active Directory configuration. - * - * @param aadProfile the aadProfile value to set. - * @return the BaseManagedCluster object itself. - */ - public BaseManagedCluster withAadProfile(ManagedClusterAadProfile aadProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new ManagedClusterProperties(); - } - this.innerProperties().withAadProfile(aadProfile); - return this; - } - - /** - * Get the autoUpgradeProfile property: Profile of auto upgrade configuration. - * - * @return the autoUpgradeProfile value. - */ - public ManagedClusterAutoUpgradeProfile autoUpgradeProfile() { - return this.innerProperties() == null ? null : this.innerProperties().autoUpgradeProfile(); - } - - /** - * Set the autoUpgradeProfile property: Profile of auto upgrade configuration. - * - * @param autoUpgradeProfile the autoUpgradeProfile value to set. - * @return the BaseManagedCluster object itself. - */ - public BaseManagedCluster withAutoUpgradeProfile(ManagedClusterAutoUpgradeProfile autoUpgradeProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new ManagedClusterProperties(); - } - this.innerProperties().withAutoUpgradeProfile(autoUpgradeProfile); - return this; - } - - /** - * Get the autoScalerProfile property: Parameters to be applied to the cluster-autoscaler when enabled. - * - * @return the autoScalerProfile value. - */ - public ManagedClusterPropertiesAutoScalerProfile autoScalerProfile() { - return this.innerProperties() == null ? null : this.innerProperties().autoScalerProfile(); - } - - /** - * Set the autoScalerProfile property: Parameters to be applied to the cluster-autoscaler when enabled. - * - * @param autoScalerProfile the autoScalerProfile value to set. - * @return the BaseManagedCluster object itself. - */ - public BaseManagedCluster withAutoScalerProfile(ManagedClusterPropertiesAutoScalerProfile autoScalerProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new ManagedClusterProperties(); - } - this.innerProperties().withAutoScalerProfile(autoScalerProfile); - return this; - } - - /** - * Get the apiServerAccessProfile property: Access profile for managed cluster API server. - * - * @return the apiServerAccessProfile value. - */ - public ManagedClusterApiServerAccessProfile apiServerAccessProfile() { - return this.innerProperties() == null ? null : this.innerProperties().apiServerAccessProfile(); - } - - /** - * Set the apiServerAccessProfile property: Access profile for managed cluster API server. - * - * @param apiServerAccessProfile the apiServerAccessProfile value to set. - * @return the BaseManagedCluster object itself. - */ - public BaseManagedCluster withApiServerAccessProfile(ManagedClusterApiServerAccessProfile apiServerAccessProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new ManagedClusterProperties(); - } - this.innerProperties().withApiServerAccessProfile(apiServerAccessProfile); - return this; - } - - /** - * Get the diskEncryptionSetId property: ResourceId of the disk encryption set to use for enabling encryption at - * rest. - * - * @return the diskEncryptionSetId value. - */ - public String diskEncryptionSetId() { - return this.innerProperties() == null ? null : this.innerProperties().diskEncryptionSetId(); - } - - /** - * Set the diskEncryptionSetId property: ResourceId of the disk encryption set to use for enabling encryption at - * rest. - * - * @param diskEncryptionSetId the diskEncryptionSetId value to set. - * @return the BaseManagedCluster object itself. - */ - public BaseManagedCluster withDiskEncryptionSetId(String diskEncryptionSetId) { - if (this.innerProperties() == null) { - this.innerProperties = new ManagedClusterProperties(); - } - this.innerProperties().withDiskEncryptionSetId(diskEncryptionSetId); - return this; - } - - /** - * Get the identityProfile property: Identities associated with the cluster. - * - * @return the identityProfile value. - */ - public Map identityProfile() { - return this.innerProperties() == null ? null : this.innerProperties().identityProfile(); - } - - /** - * Set the identityProfile property: Identities associated with the cluster. - * - * @param identityProfile the identityProfile value to set. - * @return the BaseManagedCluster object itself. - */ - public BaseManagedCluster withIdentityProfile( - Map identityProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new ManagedClusterProperties(); - } - this.innerProperties().withIdentityProfile(identityProfile); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - if (identity() != null) { - identity().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/Code.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/Code.java deleted file mode 100644 index 021b83d76fc1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/Code.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for Code. */ -public final class Code extends ExpandableStringEnum { - /** Static value Running for Code. */ - public static final Code RUNNING = fromString("Running"); - - /** Static value Stopped for Code. */ - public static final Code STOPPED = fromString("Stopped"); - - /** - * Creates or finds a Code from its string representation. - * - * @param name a name to look for. - * @return the corresponding Code. - */ - @JsonCreator - public static Code fromString(String name) { - return fromString(name, Code.class); - } - - /** @return known Code values. */ - public static Collection values() { - return values(Code.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ConnectionStatus.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ConnectionStatus.java deleted file mode 100644 index e3ed9d24f7cb..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ConnectionStatus.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ConnectionStatus. */ -public final class ConnectionStatus extends ExpandableStringEnum { - /** Static value Pending for ConnectionStatus. */ - public static final ConnectionStatus PENDING = fromString("Pending"); - - /** Static value Approved for ConnectionStatus. */ - public static final ConnectionStatus APPROVED = fromString("Approved"); - - /** Static value Rejected for ConnectionStatus. */ - public static final ConnectionStatus REJECTED = fromString("Rejected"); - - /** Static value Disconnected for ConnectionStatus. */ - public static final ConnectionStatus DISCONNECTED = fromString("Disconnected"); - - /** - * Creates or finds a ConnectionStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding ConnectionStatus. - */ - @JsonCreator - public static ConnectionStatus fromString(String name) { - return fromString(name, ConnectionStatus.class); - } - - /** @return known ConnectionStatus values. */ - public static Collection values() { - return values(ConnectionStatus.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ContainerServiceAgentPoolProfile.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ContainerServiceAgentPoolProfile.java deleted file mode 100644 index a829b93f70b5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ContainerServiceAgentPoolProfile.java +++ /dev/null @@ -1,304 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Profile for the container service agent pool. */ -@Fluent -public final class ContainerServiceAgentPoolProfile { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ContainerServiceAgentPoolProfile.class); - - /* - * Unique name of the agent pool profile in the context of the subscription - * and resource group. - */ - @JsonProperty(value = "name", required = true) - private String name; - - /* - * Number of agents (VMs) to host docker containers. Allowed values must be - * in the range of 1 to 100 (inclusive). The default value is 1. - */ - @JsonProperty(value = "count") - private Integer count; - - /* - * Size of agent VMs. - */ - @JsonProperty(value = "vmSize", required = true) - private ContainerServiceVMSizeTypes vmSize; - - /* - * OS Disk Size in GB to be used to specify the disk size for every machine - * in this master/agent pool. If you specify 0, it will apply the default - * osDisk size according to the vmSize specified. - */ - @JsonProperty(value = "osDiskSizeGB") - private Integer osDiskSizeGB; - - /* - * DNS prefix to be used to create the FQDN for the agent pool. - */ - @JsonProperty(value = "dnsPrefix") - private String dnsPrefix; - - /* - * FQDN for the agent pool. - */ - @JsonProperty(value = "fqdn", access = JsonProperty.Access.WRITE_ONLY) - private String fqdn; - - /* - * Ports number array used to expose on this agent pool. The default opened - * ports are different based on your choice of orchestrator. - */ - @JsonProperty(value = "ports") - private List ports; - - /* - * Storage profile specifies what kind of storage used. Choose from - * StorageAccount and ManagedDisks. Leave it empty, we will choose for you - * based on the orchestrator choice. - */ - @JsonProperty(value = "storageProfile") - private ContainerServiceStorageProfileTypes storageProfile; - - /* - * VNet SubnetID specifies the VNet's subnet identifier. - */ - @JsonProperty(value = "vnetSubnetID") - private String vnetSubnetId; - - /* - * OsType to be used to specify os type. Choose from Linux and Windows. - * Default to Linux. - */ - @JsonProperty(value = "osType") - private OSType osType; - - /** - * Get the name property: Unique name of the agent pool profile in the context of the subscription and resource - * group. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Unique name of the agent pool profile in the context of the subscription and resource - * group. - * - * @param name the name value to set. - * @return the ContainerServiceAgentPoolProfile object itself. - */ - public ContainerServiceAgentPoolProfile withName(String name) { - this.name = name; - return this; - } - - /** - * Get the count property: Number of agents (VMs) to host docker containers. Allowed values must be in the range of - * 1 to 100 (inclusive). The default value is 1. - * - * @return the count value. - */ - public Integer count() { - return this.count; - } - - /** - * Set the count property: Number of agents (VMs) to host docker containers. Allowed values must be in the range of - * 1 to 100 (inclusive). The default value is 1. - * - * @param count the count value to set. - * @return the ContainerServiceAgentPoolProfile object itself. - */ - public ContainerServiceAgentPoolProfile withCount(Integer count) { - this.count = count; - return this; - } - - /** - * Get the vmSize property: Size of agent VMs. - * - * @return the vmSize value. - */ - public ContainerServiceVMSizeTypes vmSize() { - return this.vmSize; - } - - /** - * Set the vmSize property: Size of agent VMs. - * - * @param vmSize the vmSize value to set. - * @return the ContainerServiceAgentPoolProfile object itself. - */ - public ContainerServiceAgentPoolProfile withVmSize(ContainerServiceVMSizeTypes vmSize) { - this.vmSize = vmSize; - return this; - } - - /** - * Get the osDiskSizeGB property: OS Disk Size in GB to be used to specify the disk size for every machine in this - * master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified. - * - * @return the osDiskSizeGB value. - */ - public Integer osDiskSizeGB() { - return this.osDiskSizeGB; - } - - /** - * Set the osDiskSizeGB property: OS Disk Size in GB to be used to specify the disk size for every machine in this - * master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified. - * - * @param osDiskSizeGB the osDiskSizeGB value to set. - * @return the ContainerServiceAgentPoolProfile object itself. - */ - public ContainerServiceAgentPoolProfile withOsDiskSizeGB(Integer osDiskSizeGB) { - this.osDiskSizeGB = osDiskSizeGB; - return this; - } - - /** - * Get the dnsPrefix property: DNS prefix to be used to create the FQDN for the agent pool. - * - * @return the dnsPrefix value. - */ - public String dnsPrefix() { - return this.dnsPrefix; - } - - /** - * Set the dnsPrefix property: DNS prefix to be used to create the FQDN for the agent pool. - * - * @param dnsPrefix the dnsPrefix value to set. - * @return the ContainerServiceAgentPoolProfile object itself. - */ - public ContainerServiceAgentPoolProfile withDnsPrefix(String dnsPrefix) { - this.dnsPrefix = dnsPrefix; - return this; - } - - /** - * Get the fqdn property: FQDN for the agent pool. - * - * @return the fqdn value. - */ - public String fqdn() { - return this.fqdn; - } - - /** - * Get the ports property: Ports number array used to expose on this agent pool. The default opened ports are - * different based on your choice of orchestrator. - * - * @return the ports value. - */ - public List ports() { - return this.ports; - } - - /** - * Set the ports property: Ports number array used to expose on this agent pool. The default opened ports are - * different based on your choice of orchestrator. - * - * @param ports the ports value to set. - * @return the ContainerServiceAgentPoolProfile object itself. - */ - public ContainerServiceAgentPoolProfile withPorts(List ports) { - this.ports = ports; - return this; - } - - /** - * Get the storageProfile property: Storage profile specifies what kind of storage used. Choose from StorageAccount - * and ManagedDisks. Leave it empty, we will choose for you based on the orchestrator choice. - * - * @return the storageProfile value. - */ - public ContainerServiceStorageProfileTypes storageProfile() { - return this.storageProfile; - } - - /** - * Set the storageProfile property: Storage profile specifies what kind of storage used. Choose from StorageAccount - * and ManagedDisks. Leave it empty, we will choose for you based on the orchestrator choice. - * - * @param storageProfile the storageProfile value to set. - * @return the ContainerServiceAgentPoolProfile object itself. - */ - public ContainerServiceAgentPoolProfile withStorageProfile(ContainerServiceStorageProfileTypes storageProfile) { - this.storageProfile = storageProfile; - return this; - } - - /** - * Get the vnetSubnetId property: VNet SubnetID specifies the VNet's subnet identifier. - * - * @return the vnetSubnetId value. - */ - public String vnetSubnetId() { - return this.vnetSubnetId; - } - - /** - * Set the vnetSubnetId property: VNet SubnetID specifies the VNet's subnet identifier. - * - * @param vnetSubnetId the vnetSubnetId value to set. - * @return the ContainerServiceAgentPoolProfile object itself. - */ - public ContainerServiceAgentPoolProfile withVnetSubnetId(String vnetSubnetId) { - this.vnetSubnetId = vnetSubnetId; - return this; - } - - /** - * Get the osType property: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. - * - * @return the osType value. - */ - public OSType osType() { - return this.osType; - } - - /** - * Set the osType property: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. - * - * @param osType the osType value to set. - * @return the ContainerServiceAgentPoolProfile object itself. - */ - public ContainerServiceAgentPoolProfile withOsType(OSType osType) { - this.osType = osType; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property name in model ContainerServiceAgentPoolProfile")); - } - if (vmSize() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property vmSize in model ContainerServiceAgentPoolProfile")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ContainerServiceCustomProfile.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ContainerServiceCustomProfile.java deleted file mode 100644 index c7a137bb2c6a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ContainerServiceCustomProfile.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Properties to configure a custom container service cluster. */ -@Fluent -public final class ContainerServiceCustomProfile { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ContainerServiceCustomProfile.class); - - /* - * The name of the custom orchestrator to use. - */ - @JsonProperty(value = "orchestrator", required = true) - private String orchestrator; - - /** - * Get the orchestrator property: The name of the custom orchestrator to use. - * - * @return the orchestrator value. - */ - public String orchestrator() { - return this.orchestrator; - } - - /** - * Set the orchestrator property: The name of the custom orchestrator to use. - * - * @param orchestrator the orchestrator value to set. - * @return the ContainerServiceCustomProfile object itself. - */ - public ContainerServiceCustomProfile withOrchestrator(String orchestrator) { - this.orchestrator = orchestrator; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (orchestrator() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property orchestrator in model ContainerServiceCustomProfile")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ContainerServiceDiagnosticsProfile.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ContainerServiceDiagnosticsProfile.java deleted file mode 100644 index eea96b72fe1f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ContainerServiceDiagnosticsProfile.java +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Profile for diagnostics on the container service cluster. */ -@Fluent -public final class ContainerServiceDiagnosticsProfile { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ContainerServiceDiagnosticsProfile.class); - - /* - * Profile for diagnostics on the container service VMs. - */ - @JsonProperty(value = "vmDiagnostics", required = true) - private ContainerServiceVMDiagnostics vmDiagnostics; - - /** - * Get the vmDiagnostics property: Profile for diagnostics on the container service VMs. - * - * @return the vmDiagnostics value. - */ - public ContainerServiceVMDiagnostics vmDiagnostics() { - return this.vmDiagnostics; - } - - /** - * Set the vmDiagnostics property: Profile for diagnostics on the container service VMs. - * - * @param vmDiagnostics the vmDiagnostics value to set. - * @return the ContainerServiceDiagnosticsProfile object itself. - */ - public ContainerServiceDiagnosticsProfile withVmDiagnostics(ContainerServiceVMDiagnostics vmDiagnostics) { - this.vmDiagnostics = vmDiagnostics; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (vmDiagnostics() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property vmDiagnostics in model ContainerServiceDiagnosticsProfile")); - } else { - vmDiagnostics().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ContainerServiceLinuxProfile.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ContainerServiceLinuxProfile.java deleted file mode 100644 index 544f02cd4166..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ContainerServiceLinuxProfile.java +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Profile for Linux VMs in the container service cluster. */ -@Fluent -public final class ContainerServiceLinuxProfile { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ContainerServiceLinuxProfile.class); - - /* - * The administrator username to use for Linux VMs. - */ - @JsonProperty(value = "adminUsername", required = true) - private String adminUsername; - - /* - * SSH configuration for Linux-based VMs running on Azure. - */ - @JsonProperty(value = "ssh", required = true) - private ContainerServiceSshConfiguration ssh; - - /** - * Get the adminUsername property: The administrator username to use for Linux VMs. - * - * @return the adminUsername value. - */ - public String adminUsername() { - return this.adminUsername; - } - - /** - * Set the adminUsername property: The administrator username to use for Linux VMs. - * - * @param adminUsername the adminUsername value to set. - * @return the ContainerServiceLinuxProfile object itself. - */ - public ContainerServiceLinuxProfile withAdminUsername(String adminUsername) { - this.adminUsername = adminUsername; - return this; - } - - /** - * Get the ssh property: SSH configuration for Linux-based VMs running on Azure. - * - * @return the ssh value. - */ - public ContainerServiceSshConfiguration ssh() { - return this.ssh; - } - - /** - * Set the ssh property: SSH configuration for Linux-based VMs running on Azure. - * - * @param ssh the ssh value to set. - * @return the ContainerServiceLinuxProfile object itself. - */ - public ContainerServiceLinuxProfile withSsh(ContainerServiceSshConfiguration ssh) { - this.ssh = ssh; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (adminUsername() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property adminUsername in model ContainerServiceLinuxProfile")); - } - if (ssh() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property ssh in model ContainerServiceLinuxProfile")); - } else { - ssh().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ContainerServiceListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ContainerServiceListResult.java deleted file mode 100644 index 4f4c02e15eb6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ContainerServiceListResult.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.containerservice.fluent.models.ContainerServiceInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The response from the List Container Services operation. */ -@Fluent -public final class ContainerServiceListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ContainerServiceListResult.class); - - /* - * The list of container services. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to get the next set of container service results. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: The list of container services. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The list of container services. - * - * @param value the value value to set. - * @return the ContainerServiceListResult object itself. - */ - public ContainerServiceListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to get the next set of container service results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ContainerServiceMasterProfile.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ContainerServiceMasterProfile.java deleted file mode 100644 index b94aa041de53..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ContainerServiceMasterProfile.java +++ /dev/null @@ -1,246 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Profile for the container service master. */ -@Fluent -public final class ContainerServiceMasterProfile { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ContainerServiceMasterProfile.class); - - /* - * Number of masters (VMs) in the container service cluster. Allowed values - * are 1, 3, and 5. The default value is 1. - */ - @JsonProperty(value = "count") - private Count count; - - /* - * DNS prefix to be used to create the FQDN for the master pool. - */ - @JsonProperty(value = "dnsPrefix", required = true) - private String dnsPrefix; - - /* - * Size of agent VMs. - */ - @JsonProperty(value = "vmSize", required = true) - private ContainerServiceVMSizeTypes vmSize; - - /* - * OS Disk Size in GB to be used to specify the disk size for every machine - * in this master/agent pool. If you specify 0, it will apply the default - * osDisk size according to the vmSize specified. - */ - @JsonProperty(value = "osDiskSizeGB") - private Integer osDiskSizeGB; - - /* - * VNet SubnetID specifies the VNet's subnet identifier. - */ - @JsonProperty(value = "vnetSubnetID") - private String vnetSubnetId; - - /* - * FirstConsecutiveStaticIP used to specify the first static ip of masters. - */ - @JsonProperty(value = "firstConsecutiveStaticIP") - private String firstConsecutiveStaticIp; - - /* - * Storage profile specifies what kind of storage used. Choose from - * StorageAccount and ManagedDisks. Leave it empty, we will choose for you - * based on the orchestrator choice. - */ - @JsonProperty(value = "storageProfile") - private ContainerServiceStorageProfileTypes storageProfile; - - /* - * FQDN for the master pool. - */ - @JsonProperty(value = "fqdn", access = JsonProperty.Access.WRITE_ONLY) - private String fqdn; - - /** - * Get the count property: Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, and 5. - * The default value is 1. - * - * @return the count value. - */ - public Count count() { - return this.count; - } - - /** - * Set the count property: Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, and 5. - * The default value is 1. - * - * @param count the count value to set. - * @return the ContainerServiceMasterProfile object itself. - */ - public ContainerServiceMasterProfile withCount(Count count) { - this.count = count; - return this; - } - - /** - * Get the dnsPrefix property: DNS prefix to be used to create the FQDN for the master pool. - * - * @return the dnsPrefix value. - */ - public String dnsPrefix() { - return this.dnsPrefix; - } - - /** - * Set the dnsPrefix property: DNS prefix to be used to create the FQDN for the master pool. - * - * @param dnsPrefix the dnsPrefix value to set. - * @return the ContainerServiceMasterProfile object itself. - */ - public ContainerServiceMasterProfile withDnsPrefix(String dnsPrefix) { - this.dnsPrefix = dnsPrefix; - return this; - } - - /** - * Get the vmSize property: Size of agent VMs. - * - * @return the vmSize value. - */ - public ContainerServiceVMSizeTypes vmSize() { - return this.vmSize; - } - - /** - * Set the vmSize property: Size of agent VMs. - * - * @param vmSize the vmSize value to set. - * @return the ContainerServiceMasterProfile object itself. - */ - public ContainerServiceMasterProfile withVmSize(ContainerServiceVMSizeTypes vmSize) { - this.vmSize = vmSize; - return this; - } - - /** - * Get the osDiskSizeGB property: OS Disk Size in GB to be used to specify the disk size for every machine in this - * master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified. - * - * @return the osDiskSizeGB value. - */ - public Integer osDiskSizeGB() { - return this.osDiskSizeGB; - } - - /** - * Set the osDiskSizeGB property: OS Disk Size in GB to be used to specify the disk size for every machine in this - * master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified. - * - * @param osDiskSizeGB the osDiskSizeGB value to set. - * @return the ContainerServiceMasterProfile object itself. - */ - public ContainerServiceMasterProfile withOsDiskSizeGB(Integer osDiskSizeGB) { - this.osDiskSizeGB = osDiskSizeGB; - return this; - } - - /** - * Get the vnetSubnetId property: VNet SubnetID specifies the VNet's subnet identifier. - * - * @return the vnetSubnetId value. - */ - public String vnetSubnetId() { - return this.vnetSubnetId; - } - - /** - * Set the vnetSubnetId property: VNet SubnetID specifies the VNet's subnet identifier. - * - * @param vnetSubnetId the vnetSubnetId value to set. - * @return the ContainerServiceMasterProfile object itself. - */ - public ContainerServiceMasterProfile withVnetSubnetId(String vnetSubnetId) { - this.vnetSubnetId = vnetSubnetId; - return this; - } - - /** - * Get the firstConsecutiveStaticIp property: FirstConsecutiveStaticIP used to specify the first static ip of - * masters. - * - * @return the firstConsecutiveStaticIp value. - */ - public String firstConsecutiveStaticIp() { - return this.firstConsecutiveStaticIp; - } - - /** - * Set the firstConsecutiveStaticIp property: FirstConsecutiveStaticIP used to specify the first static ip of - * masters. - * - * @param firstConsecutiveStaticIp the firstConsecutiveStaticIp value to set. - * @return the ContainerServiceMasterProfile object itself. - */ - public ContainerServiceMasterProfile withFirstConsecutiveStaticIp(String firstConsecutiveStaticIp) { - this.firstConsecutiveStaticIp = firstConsecutiveStaticIp; - return this; - } - - /** - * Get the storageProfile property: Storage profile specifies what kind of storage used. Choose from StorageAccount - * and ManagedDisks. Leave it empty, we will choose for you based on the orchestrator choice. - * - * @return the storageProfile value. - */ - public ContainerServiceStorageProfileTypes storageProfile() { - return this.storageProfile; - } - - /** - * Set the storageProfile property: Storage profile specifies what kind of storage used. Choose from StorageAccount - * and ManagedDisks. Leave it empty, we will choose for you based on the orchestrator choice. - * - * @param storageProfile the storageProfile value to set. - * @return the ContainerServiceMasterProfile object itself. - */ - public ContainerServiceMasterProfile withStorageProfile(ContainerServiceStorageProfileTypes storageProfile) { - this.storageProfile = storageProfile; - return this; - } - - /** - * Get the fqdn property: FQDN for the master pool. - * - * @return the fqdn value. - */ - public String fqdn() { - return this.fqdn; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (dnsPrefix() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property dnsPrefix in model ContainerServiceMasterProfile")); - } - if (vmSize() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property vmSize in model ContainerServiceMasterProfile")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ContainerServiceNetworkProfile.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ContainerServiceNetworkProfile.java deleted file mode 100644 index 4ed9209ae0c3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ContainerServiceNetworkProfile.java +++ /dev/null @@ -1,299 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Profile of network configuration. */ -@Fluent -public final class ContainerServiceNetworkProfile { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ContainerServiceNetworkProfile.class); - - /* - * Network plugin used for building Kubernetes network. - */ - @JsonProperty(value = "networkPlugin") - private NetworkPlugin networkPlugin; - - /* - * Network policy used for building Kubernetes network. - */ - @JsonProperty(value = "networkPolicy") - private NetworkPolicy networkPolicy; - - /* - * Network mode used for building Kubernetes network. - */ - @JsonProperty(value = "networkMode") - private NetworkMode networkMode; - - /* - * A CIDR notation IP range from which to assign pod IPs when kubenet is - * used. - */ - @JsonProperty(value = "podCidr") - private String podCidr; - - /* - * A CIDR notation IP range from which to assign service cluster IPs. It - * must not overlap with any Subnet IP ranges. - */ - @JsonProperty(value = "serviceCidr") - private String serviceCidr; - - /* - * An IP address assigned to the Kubernetes DNS service. It must be within - * the Kubernetes service address range specified in serviceCidr. - */ - @JsonProperty(value = "dnsServiceIP") - private String dnsServiceIp; - - /* - * A CIDR notation IP range assigned to the Docker bridge network. It must - * not overlap with any Subnet IP ranges or the Kubernetes service address - * range. - */ - @JsonProperty(value = "dockerBridgeCidr") - private String dockerBridgeCidr; - - /* - * The outbound (egress) routing method. - */ - @JsonProperty(value = "outboundType") - private OutboundType outboundType; - - /* - * The load balancer sku for the managed cluster. - */ - @JsonProperty(value = "loadBalancerSku") - private LoadBalancerSku loadBalancerSku; - - /* - * Profile of the cluster load balancer. - */ - @JsonProperty(value = "loadBalancerProfile") - private ManagedClusterLoadBalancerProfile loadBalancerProfile; - - /** - * Get the networkPlugin property: Network plugin used for building Kubernetes network. - * - * @return the networkPlugin value. - */ - public NetworkPlugin networkPlugin() { - return this.networkPlugin; - } - - /** - * Set the networkPlugin property: Network plugin used for building Kubernetes network. - * - * @param networkPlugin the networkPlugin value to set. - * @return the ContainerServiceNetworkProfile object itself. - */ - public ContainerServiceNetworkProfile withNetworkPlugin(NetworkPlugin networkPlugin) { - this.networkPlugin = networkPlugin; - return this; - } - - /** - * Get the networkPolicy property: Network policy used for building Kubernetes network. - * - * @return the networkPolicy value. - */ - public NetworkPolicy networkPolicy() { - return this.networkPolicy; - } - - /** - * Set the networkPolicy property: Network policy used for building Kubernetes network. - * - * @param networkPolicy the networkPolicy value to set. - * @return the ContainerServiceNetworkProfile object itself. - */ - public ContainerServiceNetworkProfile withNetworkPolicy(NetworkPolicy networkPolicy) { - this.networkPolicy = networkPolicy; - return this; - } - - /** - * Get the networkMode property: Network mode used for building Kubernetes network. - * - * @return the networkMode value. - */ - public NetworkMode networkMode() { - return this.networkMode; - } - - /** - * Set the networkMode property: Network mode used for building Kubernetes network. - * - * @param networkMode the networkMode value to set. - * @return the ContainerServiceNetworkProfile object itself. - */ - public ContainerServiceNetworkProfile withNetworkMode(NetworkMode networkMode) { - this.networkMode = networkMode; - return this; - } - - /** - * Get the podCidr property: A CIDR notation IP range from which to assign pod IPs when kubenet is used. - * - * @return the podCidr value. - */ - public String podCidr() { - return this.podCidr; - } - - /** - * Set the podCidr property: A CIDR notation IP range from which to assign pod IPs when kubenet is used. - * - * @param podCidr the podCidr value to set. - * @return the ContainerServiceNetworkProfile object itself. - */ - public ContainerServiceNetworkProfile withPodCidr(String podCidr) { - this.podCidr = podCidr; - return this; - } - - /** - * Get the serviceCidr property: A CIDR notation IP range from which to assign service cluster IPs. It must not - * overlap with any Subnet IP ranges. - * - * @return the serviceCidr value. - */ - public String serviceCidr() { - return this.serviceCidr; - } - - /** - * Set the serviceCidr property: A CIDR notation IP range from which to assign service cluster IPs. It must not - * overlap with any Subnet IP ranges. - * - * @param serviceCidr the serviceCidr value to set. - * @return the ContainerServiceNetworkProfile object itself. - */ - public ContainerServiceNetworkProfile withServiceCidr(String serviceCidr) { - this.serviceCidr = serviceCidr; - return this; - } - - /** - * Get the dnsServiceIp property: An IP address assigned to the Kubernetes DNS service. It must be within the - * Kubernetes service address range specified in serviceCidr. - * - * @return the dnsServiceIp value. - */ - public String dnsServiceIp() { - return this.dnsServiceIp; - } - - /** - * Set the dnsServiceIp property: An IP address assigned to the Kubernetes DNS service. It must be within the - * Kubernetes service address range specified in serviceCidr. - * - * @param dnsServiceIp the dnsServiceIp value to set. - * @return the ContainerServiceNetworkProfile object itself. - */ - public ContainerServiceNetworkProfile withDnsServiceIp(String dnsServiceIp) { - this.dnsServiceIp = dnsServiceIp; - return this; - } - - /** - * Get the dockerBridgeCidr property: A CIDR notation IP range assigned to the Docker bridge network. It must not - * overlap with any Subnet IP ranges or the Kubernetes service address range. - * - * @return the dockerBridgeCidr value. - */ - public String dockerBridgeCidr() { - return this.dockerBridgeCidr; - } - - /** - * Set the dockerBridgeCidr property: A CIDR notation IP range assigned to the Docker bridge network. It must not - * overlap with any Subnet IP ranges or the Kubernetes service address range. - * - * @param dockerBridgeCidr the dockerBridgeCidr value to set. - * @return the ContainerServiceNetworkProfile object itself. - */ - public ContainerServiceNetworkProfile withDockerBridgeCidr(String dockerBridgeCidr) { - this.dockerBridgeCidr = dockerBridgeCidr; - return this; - } - - /** - * Get the outboundType property: The outbound (egress) routing method. - * - * @return the outboundType value. - */ - public OutboundType outboundType() { - return this.outboundType; - } - - /** - * Set the outboundType property: The outbound (egress) routing method. - * - * @param outboundType the outboundType value to set. - * @return the ContainerServiceNetworkProfile object itself. - */ - public ContainerServiceNetworkProfile withOutboundType(OutboundType outboundType) { - this.outboundType = outboundType; - return this; - } - - /** - * Get the loadBalancerSku property: The load balancer sku for the managed cluster. - * - * @return the loadBalancerSku value. - */ - public LoadBalancerSku loadBalancerSku() { - return this.loadBalancerSku; - } - - /** - * Set the loadBalancerSku property: The load balancer sku for the managed cluster. - * - * @param loadBalancerSku the loadBalancerSku value to set. - * @return the ContainerServiceNetworkProfile object itself. - */ - public ContainerServiceNetworkProfile withLoadBalancerSku(LoadBalancerSku loadBalancerSku) { - this.loadBalancerSku = loadBalancerSku; - return this; - } - - /** - * Get the loadBalancerProfile property: Profile of the cluster load balancer. - * - * @return the loadBalancerProfile value. - */ - public ManagedClusterLoadBalancerProfile loadBalancerProfile() { - return this.loadBalancerProfile; - } - - /** - * Set the loadBalancerProfile property: Profile of the cluster load balancer. - * - * @param loadBalancerProfile the loadBalancerProfile value to set. - * @return the ContainerServiceNetworkProfile object itself. - */ - public ContainerServiceNetworkProfile withLoadBalancerProfile( - ManagedClusterLoadBalancerProfile loadBalancerProfile) { - this.loadBalancerProfile = loadBalancerProfile; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (loadBalancerProfile() != null) { - loadBalancerProfile().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ContainerServiceOrchestratorProfile.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ContainerServiceOrchestratorProfile.java deleted file mode 100644 index 8d71a89d1061..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ContainerServiceOrchestratorProfile.java +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Profile for the container service orchestrator. */ -@Fluent -public final class ContainerServiceOrchestratorProfile { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ContainerServiceOrchestratorProfile.class); - - /* - * The orchestrator to use to manage container service cluster resources. - * Valid values are Kubernetes, Swarm, DCOS, DockerCE and Custom. - */ - @JsonProperty(value = "orchestratorType", required = true) - private ContainerServiceOrchestratorTypes orchestratorType; - - /* - * The version of the orchestrator to use. You can specify the - * major.minor.patch part of the actual version.For example, you can - * specify version as "1.6.11". - */ - @JsonProperty(value = "orchestratorVersion") - private String orchestratorVersion; - - /** - * Get the orchestratorType property: The orchestrator to use to manage container service cluster resources. Valid - * values are Kubernetes, Swarm, DCOS, DockerCE and Custom. - * - * @return the orchestratorType value. - */ - public ContainerServiceOrchestratorTypes orchestratorType() { - return this.orchestratorType; - } - - /** - * Set the orchestratorType property: The orchestrator to use to manage container service cluster resources. Valid - * values are Kubernetes, Swarm, DCOS, DockerCE and Custom. - * - * @param orchestratorType the orchestratorType value to set. - * @return the ContainerServiceOrchestratorProfile object itself. - */ - public ContainerServiceOrchestratorProfile withOrchestratorType( - ContainerServiceOrchestratorTypes orchestratorType) { - this.orchestratorType = orchestratorType; - return this; - } - - /** - * Get the orchestratorVersion property: The version of the orchestrator to use. You can specify the - * major.minor.patch part of the actual version.For example, you can specify version as "1.6.11". - * - * @return the orchestratorVersion value. - */ - public String orchestratorVersion() { - return this.orchestratorVersion; - } - - /** - * Set the orchestratorVersion property: The version of the orchestrator to use. You can specify the - * major.minor.patch part of the actual version.For example, you can specify version as "1.6.11". - * - * @param orchestratorVersion the orchestratorVersion value to set. - * @return the ContainerServiceOrchestratorProfile object itself. - */ - public ContainerServiceOrchestratorProfile withOrchestratorVersion(String orchestratorVersion) { - this.orchestratorVersion = orchestratorVersion; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (orchestratorType() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property orchestratorType in model ContainerServiceOrchestratorProfile")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ContainerServiceOrchestratorTypes.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ContainerServiceOrchestratorTypes.java deleted file mode 100644 index fd4222682d26..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ContainerServiceOrchestratorTypes.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ContainerServiceOrchestratorTypes. */ -public final class ContainerServiceOrchestratorTypes extends ExpandableStringEnum { - /** Static value Kubernetes for ContainerServiceOrchestratorTypes. */ - public static final ContainerServiceOrchestratorTypes KUBERNETES = fromString("Kubernetes"); - - /** Static value Swarm for ContainerServiceOrchestratorTypes. */ - public static final ContainerServiceOrchestratorTypes SWARM = fromString("Swarm"); - - /** Static value DCOS for ContainerServiceOrchestratorTypes. */ - public static final ContainerServiceOrchestratorTypes DCOS = fromString("DCOS"); - - /** Static value DockerCE for ContainerServiceOrchestratorTypes. */ - public static final ContainerServiceOrchestratorTypes DOCKER_CE = fromString("DockerCE"); - - /** Static value Custom for ContainerServiceOrchestratorTypes. */ - public static final ContainerServiceOrchestratorTypes CUSTOM = fromString("Custom"); - - /** - * Creates or finds a ContainerServiceOrchestratorTypes from its string representation. - * - * @param name a name to look for. - * @return the corresponding ContainerServiceOrchestratorTypes. - */ - @JsonCreator - public static ContainerServiceOrchestratorTypes fromString(String name) { - return fromString(name, ContainerServiceOrchestratorTypes.class); - } - - /** @return known ContainerServiceOrchestratorTypes values. */ - public static Collection values() { - return values(ContainerServiceOrchestratorTypes.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ContainerServicePrincipalProfile.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ContainerServicePrincipalProfile.java deleted file mode 100644 index 21108923b4e4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ContainerServicePrincipalProfile.java +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Information about a service principal identity for the cluster to use for manipulating Azure APIs. Either secret or - * keyVaultSecretRef must be specified. - */ -@Fluent -public final class ContainerServicePrincipalProfile { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ContainerServicePrincipalProfile.class); - - /* - * The ID for the service principal. - */ - @JsonProperty(value = "clientId", required = true) - private String clientId; - - /* - * The secret password associated with the service principal in plain text. - */ - @JsonProperty(value = "secret") - private String secret; - - /* - * Reference to a secret stored in Azure Key Vault. - */ - @JsonProperty(value = "keyVaultSecretRef") - private KeyVaultSecretRef keyVaultSecretRef; - - /** - * Get the clientId property: The ID for the service principal. - * - * @return the clientId value. - */ - public String clientId() { - return this.clientId; - } - - /** - * Set the clientId property: The ID for the service principal. - * - * @param clientId the clientId value to set. - * @return the ContainerServicePrincipalProfile object itself. - */ - public ContainerServicePrincipalProfile withClientId(String clientId) { - this.clientId = clientId; - return this; - } - - /** - * Get the secret property: The secret password associated with the service principal in plain text. - * - * @return the secret value. - */ - public String secret() { - return this.secret; - } - - /** - * Set the secret property: The secret password associated with the service principal in plain text. - * - * @param secret the secret value to set. - * @return the ContainerServicePrincipalProfile object itself. - */ - public ContainerServicePrincipalProfile withSecret(String secret) { - this.secret = secret; - return this; - } - - /** - * Get the keyVaultSecretRef property: Reference to a secret stored in Azure Key Vault. - * - * @return the keyVaultSecretRef value. - */ - public KeyVaultSecretRef keyVaultSecretRef() { - return this.keyVaultSecretRef; - } - - /** - * Set the keyVaultSecretRef property: Reference to a secret stored in Azure Key Vault. - * - * @param keyVaultSecretRef the keyVaultSecretRef value to set. - * @return the ContainerServicePrincipalProfile object itself. - */ - public ContainerServicePrincipalProfile withKeyVaultSecretRef(KeyVaultSecretRef keyVaultSecretRef) { - this.keyVaultSecretRef = keyVaultSecretRef; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (clientId() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property clientId in model ContainerServicePrincipalProfile")); - } - if (keyVaultSecretRef() != null) { - keyVaultSecretRef().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ContainerServiceResourceTypes.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ContainerServiceResourceTypes.java deleted file mode 100644 index 3360a8596265..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ContainerServiceResourceTypes.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; - -import java.util.Collection; - -/** Defines values for resource types from container service. */ -public class ContainerServiceResourceTypes extends ExpandableStringEnum { - - /** Static value managedClusters for ContainerServiceResourceTypes. */ - public static final ContainerServiceResourceTypes MANAGED_CLUSTERS = fromString("managedClusters"); - - /** - * Creates or finds a ContainerServiceResourceTypes from its string representation. - * - * @param name a name to look for. - * @return the corresponding ContainerServiceResourceTypes. - */ - @JsonCreator - public static ContainerServiceResourceTypes fromString(String name) { - return fromString(name, ContainerServiceResourceTypes.class); - } - - /** @return known ExtendedLocationTypes values. */ - public static Collection values() { - return values(ContainerServiceResourceTypes.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ContainerServiceSshConfiguration.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ContainerServiceSshConfiguration.java deleted file mode 100644 index 501ddafad981..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ContainerServiceSshConfiguration.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** SSH configuration for Linux-based VMs running on Azure. */ -@Fluent -public final class ContainerServiceSshConfiguration { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ContainerServiceSshConfiguration.class); - - /* - * The list of SSH public keys used to authenticate with Linux-based VMs. - * Only expect one key specified. - */ - @JsonProperty(value = "publicKeys", required = true) - private List publicKeys; - - /** - * Get the publicKeys property: The list of SSH public keys used to authenticate with Linux-based VMs. Only expect - * one key specified. - * - * @return the publicKeys value. - */ - public List publicKeys() { - return this.publicKeys; - } - - /** - * Set the publicKeys property: The list of SSH public keys used to authenticate with Linux-based VMs. Only expect - * one key specified. - * - * @param publicKeys the publicKeys value to set. - * @return the ContainerServiceSshConfiguration object itself. - */ - public ContainerServiceSshConfiguration withPublicKeys(List publicKeys) { - this.publicKeys = publicKeys; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (publicKeys() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property publicKeys in model ContainerServiceSshConfiguration")); - } else { - publicKeys().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ContainerServiceSshPublicKey.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ContainerServiceSshPublicKey.java deleted file mode 100644 index 3ea68b2fcd96..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ContainerServiceSshPublicKey.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Contains information about SSH certificate public key data. */ -@Fluent -public final class ContainerServiceSshPublicKey { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ContainerServiceSshPublicKey.class); - - /* - * Certificate public key used to authenticate with VMs through SSH. The - * certificate must be in PEM format with or without headers. - */ - @JsonProperty(value = "keyData", required = true) - private String keyData; - - /** - * Get the keyData property: Certificate public key used to authenticate with VMs through SSH. The certificate must - * be in PEM format with or without headers. - * - * @return the keyData value. - */ - public String keyData() { - return this.keyData; - } - - /** - * Set the keyData property: Certificate public key used to authenticate with VMs through SSH. The certificate must - * be in PEM format with or without headers. - * - * @param keyData the keyData value to set. - * @return the ContainerServiceSshPublicKey object itself. - */ - public ContainerServiceSshPublicKey withKeyData(String keyData) { - this.keyData = keyData; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (keyData() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property keyData in model ContainerServiceSshPublicKey")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ContainerServiceStorageProfileTypes.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ContainerServiceStorageProfileTypes.java deleted file mode 100644 index e178e072f8d5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ContainerServiceStorageProfileTypes.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ContainerServiceStorageProfileTypes. */ -public final class ContainerServiceStorageProfileTypes - extends ExpandableStringEnum { - /** Static value StorageAccount for ContainerServiceStorageProfileTypes. */ - public static final ContainerServiceStorageProfileTypes STORAGE_ACCOUNT = fromString("StorageAccount"); - - /** Static value ManagedDisks for ContainerServiceStorageProfileTypes. */ - public static final ContainerServiceStorageProfileTypes MANAGED_DISKS = fromString("ManagedDisks"); - - /** - * Creates or finds a ContainerServiceStorageProfileTypes from its string representation. - * - * @param name a name to look for. - * @return the corresponding ContainerServiceStorageProfileTypes. - */ - @JsonCreator - public static ContainerServiceStorageProfileTypes fromString(String name) { - return fromString(name, ContainerServiceStorageProfileTypes.class); - } - - /** @return known ContainerServiceStorageProfileTypes values. */ - public static Collection values() { - return values(ContainerServiceStorageProfileTypes.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ContainerServiceVMDiagnostics.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ContainerServiceVMDiagnostics.java deleted file mode 100644 index 868336c6119e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ContainerServiceVMDiagnostics.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Profile for diagnostics on the container service VMs. */ -@Fluent -public final class ContainerServiceVMDiagnostics { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ContainerServiceVMDiagnostics.class); - - /* - * Whether the VM diagnostic agent is provisioned on the VM. - */ - @JsonProperty(value = "enabled", required = true) - private boolean enabled; - - /* - * The URI of the storage account where diagnostics are stored. - */ - @JsonProperty(value = "storageUri", access = JsonProperty.Access.WRITE_ONLY) - private String storageUri; - - /** - * Get the enabled property: Whether the VM diagnostic agent is provisioned on the VM. - * - * @return the enabled value. - */ - public boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Whether the VM diagnostic agent is provisioned on the VM. - * - * @param enabled the enabled value to set. - * @return the ContainerServiceVMDiagnostics object itself. - */ - public ContainerServiceVMDiagnostics withEnabled(boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the storageUri property: The URI of the storage account where diagnostics are stored. - * - * @return the storageUri value. - */ - public String storageUri() { - return this.storageUri; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ContainerServiceVMSizeTypes.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ContainerServiceVMSizeTypes.java deleted file mode 100644 index 4f80a13ed41c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ContainerServiceVMSizeTypes.java +++ /dev/null @@ -1,550 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ContainerServiceVMSizeTypes. */ -public final class ContainerServiceVMSizeTypes extends ExpandableStringEnum { - /** Static value Standard_A1 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_A1 = fromString("Standard_A1"); - - /** Static value Standard_A10 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_A10 = fromString("Standard_A10"); - - /** Static value Standard_A11 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_A11 = fromString("Standard_A11"); - - /** Static value Standard_A1_v2 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_A1_V2 = fromString("Standard_A1_v2"); - - /** Static value Standard_A2 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_A2 = fromString("Standard_A2"); - - /** Static value Standard_A2_v2 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_A2_V2 = fromString("Standard_A2_v2"); - - /** Static value Standard_A2m_v2 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_A2M_V2 = fromString("Standard_A2m_v2"); - - /** Static value Standard_A3 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_A3 = fromString("Standard_A3"); - - /** Static value Standard_A4 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_A4 = fromString("Standard_A4"); - - /** Static value Standard_A4_v2 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_A4_V2 = fromString("Standard_A4_v2"); - - /** Static value Standard_A4m_v2 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_A4M_V2 = fromString("Standard_A4m_v2"); - - /** Static value Standard_A5 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_A5 = fromString("Standard_A5"); - - /** Static value Standard_A6 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_A6 = fromString("Standard_A6"); - - /** Static value Standard_A7 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_A7 = fromString("Standard_A7"); - - /** Static value Standard_A8 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_A8 = fromString("Standard_A8"); - - /** Static value Standard_A8_v2 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_A8_V2 = fromString("Standard_A8_v2"); - - /** Static value Standard_A8m_v2 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_A8M_V2 = fromString("Standard_A8m_v2"); - - /** Static value Standard_A9 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_A9 = fromString("Standard_A9"); - - /** Static value Standard_B2ms for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_B2MS = fromString("Standard_B2ms"); - - /** Static value Standard_B2s for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_B2S = fromString("Standard_B2s"); - - /** Static value Standard_B4ms for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_B4MS = fromString("Standard_B4ms"); - - /** Static value Standard_B8ms for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_B8MS = fromString("Standard_B8ms"); - - /** Static value Standard_D1 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_D1 = fromString("Standard_D1"); - - /** Static value Standard_D11 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_D11 = fromString("Standard_D11"); - - /** Static value Standard_D11_v2 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_D11_V2 = fromString("Standard_D11_v2"); - - /** Static value Standard_D11_v2_Promo for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_D11_V2_PROMO = fromString("Standard_D11_v2_Promo"); - - /** Static value Standard_D12 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_D12 = fromString("Standard_D12"); - - /** Static value Standard_D12_v2 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_D12_V2 = fromString("Standard_D12_v2"); - - /** Static value Standard_D12_v2_Promo for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_D12_V2_PROMO = fromString("Standard_D12_v2_Promo"); - - /** Static value Standard_D13 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_D13 = fromString("Standard_D13"); - - /** Static value Standard_D13_v2 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_D13_V2 = fromString("Standard_D13_v2"); - - /** Static value Standard_D13_v2_Promo for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_D13_V2_PROMO = fromString("Standard_D13_v2_Promo"); - - /** Static value Standard_D14 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_D14 = fromString("Standard_D14"); - - /** Static value Standard_D14_v2 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_D14_V2 = fromString("Standard_D14_v2"); - - /** Static value Standard_D14_v2_Promo for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_D14_V2_PROMO = fromString("Standard_D14_v2_Promo"); - - /** Static value Standard_D15_v2 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_D15_V2 = fromString("Standard_D15_v2"); - - /** Static value Standard_D16_v3 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_D16_V3 = fromString("Standard_D16_v3"); - - /** Static value Standard_D16s_v3 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_D16S_V3 = fromString("Standard_D16s_v3"); - - /** Static value Standard_D1_v2 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_D1_V2 = fromString("Standard_D1_v2"); - - /** Static value Standard_D2 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_D2 = fromString("Standard_D2"); - - /** Static value Standard_D2_v2 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_D2_V2 = fromString("Standard_D2_v2"); - - /** Static value Standard_D2_v2_Promo for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_D2_V2_PROMO = fromString("Standard_D2_v2_Promo"); - - /** Static value Standard_D2_v3 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_D2_V3 = fromString("Standard_D2_v3"); - - /** Static value Standard_D2s_v3 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_D2S_V3 = fromString("Standard_D2s_v3"); - - /** Static value Standard_D3 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_D3 = fromString("Standard_D3"); - - /** Static value Standard_D32_v3 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_D32_V3 = fromString("Standard_D32_v3"); - - /** Static value Standard_D32s_v3 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_D32S_V3 = fromString("Standard_D32s_v3"); - - /** Static value Standard_D3_v2 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_D3_V2 = fromString("Standard_D3_v2"); - - /** Static value Standard_D3_v2_Promo for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_D3_V2_PROMO = fromString("Standard_D3_v2_Promo"); - - /** Static value Standard_D4 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_D4 = fromString("Standard_D4"); - - /** Static value Standard_D4_v2 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_D4_V2 = fromString("Standard_D4_v2"); - - /** Static value Standard_D4_v2_Promo for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_D4_V2_PROMO = fromString("Standard_D4_v2_Promo"); - - /** Static value Standard_D4_v3 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_D4_V3 = fromString("Standard_D4_v3"); - - /** Static value Standard_D4s_v3 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_D4S_V3 = fromString("Standard_D4s_v3"); - - /** Static value Standard_D5_v2 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_D5_V2 = fromString("Standard_D5_v2"); - - /** Static value Standard_D5_v2_Promo for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_D5_V2_PROMO = fromString("Standard_D5_v2_Promo"); - - /** Static value Standard_D64_v3 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_D64_V3 = fromString("Standard_D64_v3"); - - /** Static value Standard_D64s_v3 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_D64S_V3 = fromString("Standard_D64s_v3"); - - /** Static value Standard_D8_v3 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_D8_V3 = fromString("Standard_D8_v3"); - - /** Static value Standard_D8s_v3 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_D8S_V3 = fromString("Standard_D8s_v3"); - - /** Static value Standard_DS1 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_DS1 = fromString("Standard_DS1"); - - /** Static value Standard_DS11 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_DS11 = fromString("Standard_DS11"); - - /** Static value Standard_DS11_v2 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_DS11_V2 = fromString("Standard_DS11_v2"); - - /** Static value Standard_DS11_v2_Promo for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_DS11_V2_PROMO = fromString("Standard_DS11_v2_Promo"); - - /** Static value Standard_DS12 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_DS12 = fromString("Standard_DS12"); - - /** Static value Standard_DS12_v2 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_DS12_V2 = fromString("Standard_DS12_v2"); - - /** Static value Standard_DS12_v2_Promo for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_DS12_V2_PROMO = fromString("Standard_DS12_v2_Promo"); - - /** Static value Standard_DS13 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_DS13 = fromString("Standard_DS13"); - - /** Static value Standard_DS13-2_v2 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_DS13_2_V2 = fromString("Standard_DS13-2_v2"); - - /** Static value Standard_DS13-4_v2 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_DS13_4_V2 = fromString("Standard_DS13-4_v2"); - - /** Static value Standard_DS13_v2 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_DS13_V2 = fromString("Standard_DS13_v2"); - - /** Static value Standard_DS13_v2_Promo for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_DS13_V2_PROMO = fromString("Standard_DS13_v2_Promo"); - - /** Static value Standard_DS14 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_DS14 = fromString("Standard_DS14"); - - /** Static value Standard_DS14-4_v2 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_DS14_4_V2 = fromString("Standard_DS14-4_v2"); - - /** Static value Standard_DS14-8_v2 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_DS14_8_V2 = fromString("Standard_DS14-8_v2"); - - /** Static value Standard_DS14_v2 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_DS14_V2 = fromString("Standard_DS14_v2"); - - /** Static value Standard_DS14_v2_Promo for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_DS14_V2_PROMO = fromString("Standard_DS14_v2_Promo"); - - /** Static value Standard_DS15_v2 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_DS15_V2 = fromString("Standard_DS15_v2"); - - /** Static value Standard_DS1_v2 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_DS1_V2 = fromString("Standard_DS1_v2"); - - /** Static value Standard_DS2 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_DS2 = fromString("Standard_DS2"); - - /** Static value Standard_DS2_v2 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_DS2_V2 = fromString("Standard_DS2_v2"); - - /** Static value Standard_DS2_v2_Promo for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_DS2_V2_PROMO = fromString("Standard_DS2_v2_Promo"); - - /** Static value Standard_DS3 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_DS3 = fromString("Standard_DS3"); - - /** Static value Standard_DS3_v2 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_DS3_V2 = fromString("Standard_DS3_v2"); - - /** Static value Standard_DS3_v2_Promo for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_DS3_V2_PROMO = fromString("Standard_DS3_v2_Promo"); - - /** Static value Standard_DS4 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_DS4 = fromString("Standard_DS4"); - - /** Static value Standard_DS4_v2 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_DS4_V2 = fromString("Standard_DS4_v2"); - - /** Static value Standard_DS4_v2_Promo for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_DS4_V2_PROMO = fromString("Standard_DS4_v2_Promo"); - - /** Static value Standard_DS5_v2 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_DS5_V2 = fromString("Standard_DS5_v2"); - - /** Static value Standard_DS5_v2_Promo for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_DS5_V2_PROMO = fromString("Standard_DS5_v2_Promo"); - - /** Static value Standard_E16_v3 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_E16_V3 = fromString("Standard_E16_v3"); - - /** Static value Standard_E16s_v3 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_E16S_V3 = fromString("Standard_E16s_v3"); - - /** Static value Standard_E2_v3 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_E2_V3 = fromString("Standard_E2_v3"); - - /** Static value Standard_E2s_v3 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_E2S_V3 = fromString("Standard_E2s_v3"); - - /** Static value Standard_E32-16s_v3 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_E32_16S_V3 = fromString("Standard_E32-16s_v3"); - - /** Static value Standard_E32-8s_v3 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_E32_8S_V3 = fromString("Standard_E32-8s_v3"); - - /** Static value Standard_E32_v3 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_E32_V3 = fromString("Standard_E32_v3"); - - /** Static value Standard_E32s_v3 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_E32S_V3 = fromString("Standard_E32s_v3"); - - /** Static value Standard_E4_v3 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_E4_V3 = fromString("Standard_E4_v3"); - - /** Static value Standard_E4s_v3 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_E4S_V3 = fromString("Standard_E4s_v3"); - - /** Static value Standard_E64-16s_v3 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_E64_16S_V3 = fromString("Standard_E64-16s_v3"); - - /** Static value Standard_E64-32s_v3 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_E64_32S_V3 = fromString("Standard_E64-32s_v3"); - - /** Static value Standard_E64_v3 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_E64_V3 = fromString("Standard_E64_v3"); - - /** Static value Standard_E64s_v3 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_E64S_V3 = fromString("Standard_E64s_v3"); - - /** Static value Standard_E8_v3 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_E8_V3 = fromString("Standard_E8_v3"); - - /** Static value Standard_E8s_v3 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_E8S_V3 = fromString("Standard_E8s_v3"); - - /** Static value Standard_F1 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_F1 = fromString("Standard_F1"); - - /** Static value Standard_F16 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_F16 = fromString("Standard_F16"); - - /** Static value Standard_F16s for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_F16S = fromString("Standard_F16s"); - - /** Static value Standard_F16s_v2 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_F16S_V2 = fromString("Standard_F16s_v2"); - - /** Static value Standard_F1s for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_F1S = fromString("Standard_F1s"); - - /** Static value Standard_F2 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_F2 = fromString("Standard_F2"); - - /** Static value Standard_F2s for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_F2S = fromString("Standard_F2s"); - - /** Static value Standard_F2s_v2 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_F2S_V2 = fromString("Standard_F2s_v2"); - - /** Static value Standard_F32s_v2 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_F32S_V2 = fromString("Standard_F32s_v2"); - - /** Static value Standard_F4 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_F4 = fromString("Standard_F4"); - - /** Static value Standard_F4s for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_F4S = fromString("Standard_F4s"); - - /** Static value Standard_F4s_v2 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_F4S_V2 = fromString("Standard_F4s_v2"); - - /** Static value Standard_F64s_v2 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_F64S_V2 = fromString("Standard_F64s_v2"); - - /** Static value Standard_F72s_v2 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_F72S_V2 = fromString("Standard_F72s_v2"); - - /** Static value Standard_F8 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_F8 = fromString("Standard_F8"); - - /** Static value Standard_F8s for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_F8S = fromString("Standard_F8s"); - - /** Static value Standard_F8s_v2 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_F8S_V2 = fromString("Standard_F8s_v2"); - - /** Static value Standard_G1 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_G1 = fromString("Standard_G1"); - - /** Static value Standard_G2 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_G2 = fromString("Standard_G2"); - - /** Static value Standard_G3 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_G3 = fromString("Standard_G3"); - - /** Static value Standard_G4 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_G4 = fromString("Standard_G4"); - - /** Static value Standard_G5 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_G5 = fromString("Standard_G5"); - - /** Static value Standard_GS1 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_GS1 = fromString("Standard_GS1"); - - /** Static value Standard_GS2 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_GS2 = fromString("Standard_GS2"); - - /** Static value Standard_GS3 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_GS3 = fromString("Standard_GS3"); - - /** Static value Standard_GS4 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_GS4 = fromString("Standard_GS4"); - - /** Static value Standard_GS4-4 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_GS4_4 = fromString("Standard_GS4-4"); - - /** Static value Standard_GS4-8 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_GS4_8 = fromString("Standard_GS4-8"); - - /** Static value Standard_GS5 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_GS5 = fromString("Standard_GS5"); - - /** Static value Standard_GS5-16 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_GS5_16 = fromString("Standard_GS5-16"); - - /** Static value Standard_GS5-8 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_GS5_8 = fromString("Standard_GS5-8"); - - /** Static value Standard_H16 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_H16 = fromString("Standard_H16"); - - /** Static value Standard_H16m for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_H16M = fromString("Standard_H16m"); - - /** Static value Standard_H16mr for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_H16MR = fromString("Standard_H16mr"); - - /** Static value Standard_H16r for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_H16R = fromString("Standard_H16r"); - - /** Static value Standard_H8 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_H8 = fromString("Standard_H8"); - - /** Static value Standard_H8m for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_H8M = fromString("Standard_H8m"); - - /** Static value Standard_L16s for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_L16S = fromString("Standard_L16s"); - - /** Static value Standard_L32s for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_L32S = fromString("Standard_L32s"); - - /** Static value Standard_L4s for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_L4S = fromString("Standard_L4s"); - - /** Static value Standard_L8s for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_L8S = fromString("Standard_L8s"); - - /** Static value Standard_M128-32ms for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_M128_32MS = fromString("Standard_M128-32ms"); - - /** Static value Standard_M128-64ms for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_M128_64MS = fromString("Standard_M128-64ms"); - - /** Static value Standard_M128ms for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_M128MS = fromString("Standard_M128ms"); - - /** Static value Standard_M128s for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_M128S = fromString("Standard_M128s"); - - /** Static value Standard_M64-16ms for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_M64_16MS = fromString("Standard_M64-16ms"); - - /** Static value Standard_M64-32ms for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_M64_32MS = fromString("Standard_M64-32ms"); - - /** Static value Standard_M64ms for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_M64MS = fromString("Standard_M64ms"); - - /** Static value Standard_M64s for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_M64S = fromString("Standard_M64s"); - - /** Static value Standard_NC12 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_NC12 = fromString("Standard_NC12"); - - /** Static value Standard_NC12s_v2 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_NC12S_V2 = fromString("Standard_NC12s_v2"); - - /** Static value Standard_NC12s_v3 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_NC12S_V3 = fromString("Standard_NC12s_v3"); - - /** Static value Standard_NC24 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_NC24 = fromString("Standard_NC24"); - - /** Static value Standard_NC24r for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_NC24R = fromString("Standard_NC24r"); - - /** Static value Standard_NC24rs_v2 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_NC24RS_V2 = fromString("Standard_NC24rs_v2"); - - /** Static value Standard_NC24rs_v3 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_NC24RS_V3 = fromString("Standard_NC24rs_v3"); - - /** Static value Standard_NC24s_v2 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_NC24S_V2 = fromString("Standard_NC24s_v2"); - - /** Static value Standard_NC24s_v3 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_NC24S_V3 = fromString("Standard_NC24s_v3"); - - /** Static value Standard_NC6 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_NC6 = fromString("Standard_NC6"); - - /** Static value Standard_NC6s_v2 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_NC6S_V2 = fromString("Standard_NC6s_v2"); - - /** Static value Standard_NC6s_v3 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_NC6S_V3 = fromString("Standard_NC6s_v3"); - - /** Static value Standard_ND12s for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_ND12S = fromString("Standard_ND12s"); - - /** Static value Standard_ND24rs for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_ND24RS = fromString("Standard_ND24rs"); - - /** Static value Standard_ND24s for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_ND24S = fromString("Standard_ND24s"); - - /** Static value Standard_ND6s for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_ND6S = fromString("Standard_ND6s"); - - /** Static value Standard_NV12 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_NV12 = fromString("Standard_NV12"); - - /** Static value Standard_NV24 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_NV24 = fromString("Standard_NV24"); - - /** Static value Standard_NV6 for ContainerServiceVMSizeTypes. */ - public static final ContainerServiceVMSizeTypes STANDARD_NV6 = fromString("Standard_NV6"); - - /** - * Creates or finds a ContainerServiceVMSizeTypes from its string representation. - * - * @param name a name to look for. - * @return the corresponding ContainerServiceVMSizeTypes. - */ - @JsonCreator - public static ContainerServiceVMSizeTypes fromString(String name) { - return fromString(name, ContainerServiceVMSizeTypes.class); - } - - /** @return known ContainerServiceVMSizeTypes values. */ - public static Collection values() { - return values(ContainerServiceVMSizeTypes.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ContainerServiceWindowsProfile.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ContainerServiceWindowsProfile.java deleted file mode 100644 index 196b6b617034..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ContainerServiceWindowsProfile.java +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Profile for Windows VMs in the container service cluster. */ -@Fluent -public final class ContainerServiceWindowsProfile { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ContainerServiceWindowsProfile.class); - - /* - * The administrator username to use for Windows VMs. - */ - @JsonProperty(value = "adminUsername", required = true) - private String adminUsername; - - /* - * The administrator password to use for Windows VMs. - */ - @JsonProperty(value = "adminPassword", required = true) - private String adminPassword; - - /** - * Get the adminUsername property: The administrator username to use for Windows VMs. - * - * @return the adminUsername value. - */ - public String adminUsername() { - return this.adminUsername; - } - - /** - * Set the adminUsername property: The administrator username to use for Windows VMs. - * - * @param adminUsername the adminUsername value to set. - * @return the ContainerServiceWindowsProfile object itself. - */ - public ContainerServiceWindowsProfile withAdminUsername(String adminUsername) { - this.adminUsername = adminUsername; - return this; - } - - /** - * Get the adminPassword property: The administrator password to use for Windows VMs. - * - * @return the adminPassword value. - */ - public String adminPassword() { - return this.adminPassword; - } - - /** - * Set the adminPassword property: The administrator password to use for Windows VMs. - * - * @param adminPassword the adminPassword value to set. - * @return the ContainerServiceWindowsProfile object itself. - */ - public ContainerServiceWindowsProfile withAdminPassword(String adminPassword) { - this.adminPassword = adminPassword; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (adminUsername() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property adminUsername in model ContainerServiceWindowsProfile")); - } - if (adminPassword() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property adminPassword in model ContainerServiceWindowsProfile")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/Count.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/Count.java deleted file mode 100644 index 2c452cc0f0d5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/Count.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for Count. */ -public enum Count { - /** Enum value 1. */ - ONE(1), - - /** Enum value 3. */ - THREE(3), - - /** Enum value 5. */ - FIVE(5); - - /** The actual serialized value for a Count instance. */ - private final int value; - - Count(int value) { - this.value = value; - } - - /** - * Parses a serialized value to a Count instance. - * - * @param value the serialized value to parse. - * @return the parsed Count object, or null if unable to parse. - */ - @JsonCreator - public static Count fromInt(int value) { - Count[] items = Count.values(); - for (Count item : items) { - if (item.toInt() == value) { - return item; - } - } - return null; - } - - /** - * De-serializes the instance to int value. - * - * @return the int value. - */ - @JsonValue - public int toInt() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/CredentialResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/CredentialResult.java deleted file mode 100644 index 07337aaf61e8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/CredentialResult.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.CoreUtils; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The credential result response. */ -@Immutable -public final class CredentialResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CredentialResult.class); - - /* - * The name of the credential. - */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) - private String name; - - /* - * Base64-encoded Kubernetes configuration file. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private byte[] value; - - /** - * Get the name property: The name of the credential. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the value property: Base64-encoded Kubernetes configuration file. - * - * @return the value value. - */ - public byte[] value() { - return CoreUtils.clone(this.value); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/Expander.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/Expander.java deleted file mode 100644 index 63c2a0f1c3e2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/Expander.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for Expander. */ -public final class Expander extends ExpandableStringEnum { - /** Static value least-waste for Expander. */ - public static final Expander LEAST_WASTE = fromString("least-waste"); - - /** Static value most-pods for Expander. */ - public static final Expander MOST_PODS = fromString("most-pods"); - - /** Static value random for Expander. */ - public static final Expander RANDOM = fromString("random"); - - /** - * Creates or finds a Expander from its string representation. - * - * @param name a name to look for. - * @return the corresponding Expander. - */ - @JsonCreator - public static Expander fromString(String name) { - return fromString(name, Expander.class); - } - - /** @return known Expander values. */ - public static Collection values() { - return values(Expander.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/KeyVaultSecretRef.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/KeyVaultSecretRef.java deleted file mode 100644 index 902088e8271d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/KeyVaultSecretRef.java +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Reference to a secret stored in Azure Key Vault. */ -@Fluent -public final class KeyVaultSecretRef { - @JsonIgnore private final ClientLogger logger = new ClientLogger(KeyVaultSecretRef.class); - - /* - * Key vault identifier. - */ - @JsonProperty(value = "vaultID", required = true) - private String vaultId; - - /* - * The secret name. - */ - @JsonProperty(value = "secretName", required = true) - private String secretName; - - /* - * The secret version. - */ - @JsonProperty(value = "version") - private String version; - - /** - * Get the vaultId property: Key vault identifier. - * - * @return the vaultId value. - */ - public String vaultId() { - return this.vaultId; - } - - /** - * Set the vaultId property: Key vault identifier. - * - * @param vaultId the vaultId value to set. - * @return the KeyVaultSecretRef object itself. - */ - public KeyVaultSecretRef withVaultId(String vaultId) { - this.vaultId = vaultId; - return this; - } - - /** - * Get the secretName property: The secret name. - * - * @return the secretName value. - */ - public String secretName() { - return this.secretName; - } - - /** - * Set the secretName property: The secret name. - * - * @param secretName the secretName value to set. - * @return the KeyVaultSecretRef object itself. - */ - public KeyVaultSecretRef withSecretName(String secretName) { - this.secretName = secretName; - return this; - } - - /** - * Get the version property: The secret version. - * - * @return the version value. - */ - public String version() { - return this.version; - } - - /** - * Set the version property: The secret version. - * - * @param version the version value to set. - * @return the KeyVaultSecretRef object itself. - */ - public KeyVaultSecretRef withVersion(String version) { - this.version = version; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (vaultId() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property vaultId in model KeyVaultSecretRef")); - } - if (secretName() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property secretName in model KeyVaultSecretRef")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/KubeletConfig.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/KubeletConfig.java deleted file mode 100644 index 58920a588419..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/KubeletConfig.java +++ /dev/null @@ -1,242 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Kubelet configurations of agent nodes. */ -@Fluent -public final class KubeletConfig { - @JsonIgnore private final ClientLogger logger = new ClientLogger(KubeletConfig.class); - - /* - * CPU Manager policy to use. - */ - @JsonProperty(value = "cpuManagerPolicy") - private String cpuManagerPolicy; - - /* - * Enable CPU CFS quota enforcement for containers that specify CPU limits. - */ - @JsonProperty(value = "cpuCfsQuota") - private Boolean cpuCfsQuota; - - /* - * Sets CPU CFS quota period value. - */ - @JsonProperty(value = "cpuCfsQuotaPeriod") - private String cpuCfsQuotaPeriod; - - /* - * The percent of disk usage after which image garbage collection is always - * run. - */ - @JsonProperty(value = "imageGcHighThreshold") - private Integer imageGcHighThreshold; - - /* - * The percent of disk usage before which image garbage collection is never - * run. - */ - @JsonProperty(value = "imageGcLowThreshold") - private Integer imageGcLowThreshold; - - /* - * Topology Manager policy to use. - */ - @JsonProperty(value = "topologyManagerPolicy") - private String topologyManagerPolicy; - - /* - * Allowlist of unsafe sysctls or unsafe sysctl patterns (ending in `*`). - */ - @JsonProperty(value = "allowedUnsafeSysctls") - private List allowedUnsafeSysctls; - - /* - * If set to true it will make the Kubelet fail to start if swap is enabled - * on the node. - */ - @JsonProperty(value = "failSwapOn") - private Boolean failSwapOn; - - /** - * Get the cpuManagerPolicy property: CPU Manager policy to use. - * - * @return the cpuManagerPolicy value. - */ - public String cpuManagerPolicy() { - return this.cpuManagerPolicy; - } - - /** - * Set the cpuManagerPolicy property: CPU Manager policy to use. - * - * @param cpuManagerPolicy the cpuManagerPolicy value to set. - * @return the KubeletConfig object itself. - */ - public KubeletConfig withCpuManagerPolicy(String cpuManagerPolicy) { - this.cpuManagerPolicy = cpuManagerPolicy; - return this; - } - - /** - * Get the cpuCfsQuota property: Enable CPU CFS quota enforcement for containers that specify CPU limits. - * - * @return the cpuCfsQuota value. - */ - public Boolean cpuCfsQuota() { - return this.cpuCfsQuota; - } - - /** - * Set the cpuCfsQuota property: Enable CPU CFS quota enforcement for containers that specify CPU limits. - * - * @param cpuCfsQuota the cpuCfsQuota value to set. - * @return the KubeletConfig object itself. - */ - public KubeletConfig withCpuCfsQuota(Boolean cpuCfsQuota) { - this.cpuCfsQuota = cpuCfsQuota; - return this; - } - - /** - * Get the cpuCfsQuotaPeriod property: Sets CPU CFS quota period value. - * - * @return the cpuCfsQuotaPeriod value. - */ - public String cpuCfsQuotaPeriod() { - return this.cpuCfsQuotaPeriod; - } - - /** - * Set the cpuCfsQuotaPeriod property: Sets CPU CFS quota period value. - * - * @param cpuCfsQuotaPeriod the cpuCfsQuotaPeriod value to set. - * @return the KubeletConfig object itself. - */ - public KubeletConfig withCpuCfsQuotaPeriod(String cpuCfsQuotaPeriod) { - this.cpuCfsQuotaPeriod = cpuCfsQuotaPeriod; - return this; - } - - /** - * Get the imageGcHighThreshold property: The percent of disk usage after which image garbage collection is always - * run. - * - * @return the imageGcHighThreshold value. - */ - public Integer imageGcHighThreshold() { - return this.imageGcHighThreshold; - } - - /** - * Set the imageGcHighThreshold property: The percent of disk usage after which image garbage collection is always - * run. - * - * @param imageGcHighThreshold the imageGcHighThreshold value to set. - * @return the KubeletConfig object itself. - */ - public KubeletConfig withImageGcHighThreshold(Integer imageGcHighThreshold) { - this.imageGcHighThreshold = imageGcHighThreshold; - return this; - } - - /** - * Get the imageGcLowThreshold property: The percent of disk usage before which image garbage collection is never - * run. - * - * @return the imageGcLowThreshold value. - */ - public Integer imageGcLowThreshold() { - return this.imageGcLowThreshold; - } - - /** - * Set the imageGcLowThreshold property: The percent of disk usage before which image garbage collection is never - * run. - * - * @param imageGcLowThreshold the imageGcLowThreshold value to set. - * @return the KubeletConfig object itself. - */ - public KubeletConfig withImageGcLowThreshold(Integer imageGcLowThreshold) { - this.imageGcLowThreshold = imageGcLowThreshold; - return this; - } - - /** - * Get the topologyManagerPolicy property: Topology Manager policy to use. - * - * @return the topologyManagerPolicy value. - */ - public String topologyManagerPolicy() { - return this.topologyManagerPolicy; - } - - /** - * Set the topologyManagerPolicy property: Topology Manager policy to use. - * - * @param topologyManagerPolicy the topologyManagerPolicy value to set. - * @return the KubeletConfig object itself. - */ - public KubeletConfig withTopologyManagerPolicy(String topologyManagerPolicy) { - this.topologyManagerPolicy = topologyManagerPolicy; - return this; - } - - /** - * Get the allowedUnsafeSysctls property: Allowlist of unsafe sysctls or unsafe sysctl patterns (ending in `*`). - * - * @return the allowedUnsafeSysctls value. - */ - public List allowedUnsafeSysctls() { - return this.allowedUnsafeSysctls; - } - - /** - * Set the allowedUnsafeSysctls property: Allowlist of unsafe sysctls or unsafe sysctl patterns (ending in `*`). - * - * @param allowedUnsafeSysctls the allowedUnsafeSysctls value to set. - * @return the KubeletConfig object itself. - */ - public KubeletConfig withAllowedUnsafeSysctls(List allowedUnsafeSysctls) { - this.allowedUnsafeSysctls = allowedUnsafeSysctls; - return this; - } - - /** - * Get the failSwapOn property: If set to true it will make the Kubelet fail to start if swap is enabled on the - * node. - * - * @return the failSwapOn value. - */ - public Boolean failSwapOn() { - return this.failSwapOn; - } - - /** - * Set the failSwapOn property: If set to true it will make the Kubelet fail to start if swap is enabled on the - * node. - * - * @param failSwapOn the failSwapOn value to set. - * @return the KubeletConfig object itself. - */ - public KubeletConfig withFailSwapOn(Boolean failSwapOn) { - this.failSwapOn = failSwapOn; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/KubernetesCluster.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/KubernetesCluster.java deleted file mode 100644 index 0bde76267fd6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/KubernetesCluster.java +++ /dev/null @@ -1,579 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.containerservice.ContainerServiceManager; -import com.azure.resourcemanager.containerservice.fluent.models.ManagedClusterInner; -import com.azure.core.management.Region; -import com.azure.resourcemanager.resources.fluentcore.arm.models.GroupableResource; -import com.azure.resourcemanager.resources.fluentcore.arm.models.Resource; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListingPrivateEndpointConnection; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListingPrivateLinkResource; -import com.azure.resourcemanager.resources.fluentcore.model.Appliable; -import com.azure.resourcemanager.resources.fluentcore.model.Attachable; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; -import com.azure.resourcemanager.resources.fluentcore.model.Updatable; -import reactor.core.publisher.Mono; - -import java.util.List; -import java.util.Map; - -/** A client-side representation for a managed Kubernetes cluster. */ -@Fluent -public interface KubernetesCluster - extends GroupableResource, - Refreshable, - Updatable, - SupportsListingPrivateLinkResource, - SupportsListingPrivateEndpointConnection { - - /** @return the provisioning state of the Kubernetes cluster */ - String provisioningState(); - - /** @return the DNS prefix which was specified at creation time */ - String dnsPrefix(); - - /** @return the FQDN for the master pool */ - String fqdn(); - - /** @return the Kubernetes version */ - String version(); - - /** @return the Kubernetes configuration file content with administrative privileges to the cluster */ - byte[] adminKubeConfigContent(); - - /** @return the Kubernetes configuration file content with user-level privileges to the cluster */ - byte[] userKubeConfigContent(); - - /** @return the Kubernetes credentials with administrative privileges to the cluster */ - List adminKubeConfigs(); - - /** @return the Kubernetes credentials with user-level privileges to the cluster */ - List userKubeConfigs(); - - /** @return the service principal client ID */ - String servicePrincipalClientId(); - - /** @return the service principal secret */ - String servicePrincipalSecret(); - - /** @return the Linux root username */ - String linuxRootUsername(); - - /** @return the Linux SSH key */ - String sshKey(); - - /** @return the agent pools in the Kubernetes cluster */ - Map agentPools(); - - /** @return the network profile settings for the cluster */ - ContainerServiceNetworkProfile networkProfile(); - - /** @return the cluster's add-on's profiles */ - Map addonProfiles(); - - /** @return the name of the resource group containing agent pool nodes */ - String nodeResourceGroup(); - - /** @return true if Kubernetes Role-Based Access Control is enabled */ - boolean enableRBAC(); - - /** @return the power state */ - PowerState powerState(); - - /** - * @return the System Assigned Managed Service Identity specific Active Directory service principal ID - * assigned to the Kubernetes cluster. - */ - String systemAssignedManagedServiceIdentityPrincipalId(); - - // Actions - - /** - * Starts a stopped Kubernetes cluster. - */ - void start(); - - /** - * Starts a stopped Kubernetes cluster. - * - * @return the completion. - */ - Mono startAsync(); - - /** - * Stops a running Kubernetes cluster. - */ - void stop(); - - /** - * Stops a running Kubernetes cluster. - * - * @return the completion. - */ - Mono stopAsync(); - - // Fluent interfaces - - /** Interface for all the definitions related to a Kubernetes cluster. */ - interface Definition - extends KubernetesCluster.DefinitionStages.Blank, - KubernetesCluster.DefinitionStages.WithGroup, - KubernetesCluster.DefinitionStages.WithVersion, - DefinitionStages.WithLinuxRootUsername, - DefinitionStages.WithLinuxSshKey, - DefinitionStages.WithServicePrincipalClientId, - DefinitionStages.WithServicePrincipalProfile, - DefinitionStages.WithDnsPrefix, - DefinitionStages.WithAgentPool, - DefinitionStages.WithNetworkProfile, - DefinitionStages.WithAddOnProfiles, - KubernetesCluster.DefinitionStages.WithCreate { - } - - /** Grouping of Kubernetes cluster definition stages. */ - interface DefinitionStages { - /** - * The first stage of a container service definition. - */ - interface Blank extends DefinitionWithRegion { - } - - /** - * The stage of the Kubernetes cluster definition allowing to specify the resource group. - */ - interface WithGroup extends GroupableResource.DefinitionStages.WithGroup { - } - - /** - * The stage of the Kubernetes cluster definition allowing to specify orchestration type. - */ - interface WithVersion { - /** - * Specifies the version for the Kubernetes cluster. - * Could retrieve from {@link KubernetesClusters#listKubernetesVersions(Region)} - * - * @param kubernetesVersion the kubernetes version - * @return the next stage of the definition - */ - WithLinuxRootUsername withVersion(String kubernetesVersion); - - /** - * Uses the default version for the Kubernetes cluster. - * - * @return the next stage of the definition - */ - WithLinuxRootUsername withDefaultVersion(); - } - - /** - * The stage of the Kubernetes cluster definition allowing to specific the Linux root username. - */ - interface WithLinuxRootUsername { - /** - * Begins the definition to specify Linux root username. - * - * @param rootUserName the root username - * @return the next stage of the definition - */ - WithLinuxSshKey withRootUsername(String rootUserName); - } - - /** - * The stage of the Kubernetes cluster definition allowing to specific the Linux SSH key. - */ - interface WithLinuxSshKey { - /** - * Begins the definition to specify Linux ssh key. - * - * @param sshKeyData the SSH key data - * @return the next stage of the definition - */ - WithServicePrincipalClientId withSshKey(String sshKeyData); - } - - /** - * The stage of the Kubernetes cluster definition allowing to specify the service principal client ID. - */ - interface WithServicePrincipalClientId extends WithManagedServiceIdentity { - /** - * Properties for Kubernetes cluster service principal. - * - * @param clientId the ID for the service principal - * @return the next stage - */ - WithServicePrincipalProfile withServicePrincipalClientId(String clientId); - } - - /** - * The stage of the Kubernetes cluster definition allowing to specify the service principal secret. - */ - interface WithServicePrincipalProfile { - /** - * Properties for service principal. - * - * @param secret the secret password associated with the service principal - * @return the next stage - */ - WithAgentPool withServicePrincipalSecret(String secret); - } - - /** - * The stage of the Kubernetes cluster definition allowing to specify an agent pool profile. - */ - interface WithAgentPool { - /** - * Begins the definition of an agent pool profile to be attached to the Kubernetes cluster. - * - * @param name the name for the agent pool profile - * @return the stage representing configuration for the agent pool profile - */ - KubernetesClusterAgentPool.DefinitionStages.Blank defineAgentPool(String name); - } - - /** - * The stage of the Kubernetes cluster definition allowing to specify a network profile. - */ - interface WithNetworkProfile { - /** - * Begins the definition of a network profile to be attached to the Kubernetes cluster. - * - * @return the stage representing configuration for the network profile - */ - NetworkProfileDefinitionStages.Blank defineNetworkProfile(); - } - - /** The Kubernetes cluster definition allowing to specify a network profile. */ - interface NetworkProfileDefinitionStages { - /** - * The first stage of a network profile definition. - * - * @param the stage of the Kubernetes cluster network profile definition to return to after - * attaching this definition - */ - interface Blank extends WithAttach { - /** - * Specifies the network plugin type to be used for building the Kubernetes network. - * - * @param networkPlugin the network plugin type to be used for building the Kubernetes network - * @return the next stage of the definition - */ - WithAttach withNetworkPlugin(NetworkPlugin networkPlugin); - } - - /** - * The stage of a network profile definition allowing to specify the network policy. - * - * @param the stage of the network profile definition to return to after attaching this definition - */ - interface WithNetworkPolicy { - /** - * Specifies the network policy to be used for building the Kubernetes network. - * - * @param networkPolicy the network policy to be used for building the Kubernetes network - * @return the next stage of the definition - */ - WithAttach withNetworkPolicy(NetworkPolicy networkPolicy); - } - - /** - * The stage of a network profile definition allowing to specify a CIDR notation IP range from which to - * assign pod IPs when kubenet is used. - * - * @param the stage of the network profile definition to return to after attaching this definition - */ - interface WithPodCidr { - /** - * Specifies a CIDR notation IP range from which to assign pod IPs when kubenet is used. - * - * @param podCidr the CIDR notation IP range from which to assign pod IPs when kubenet is used - * @return the next stage of the definition - */ - WithAttach withPodCidr(String podCidr); - } - - /** - * The stage of a network profile definition allowing to specify a CIDR notation IP range from which to - * assign service cluster IPs. - * - * @param the stage of the network profile definition to return to after attaching this definition - */ - interface WithServiceCidr { - /** - * Specifies a CIDR notation IP range from which to assign service cluster IPs; must not overlap with - * any subnet IP ranges. - * - * @param serviceCidr the CIDR notation IP range from which to assign service cluster IPs; it must not - * overlap with any Subnet IP ranges - * @return the next stage of the definition - */ - WithAttach withServiceCidr(String serviceCidr); - } - - /** - * The stage of a network profile definition allowing to specify an IP address assigned to the Kubernetes - * DNS service. - * - * @param the stage of the network profile definition to return to after attaching this definition - */ - interface WithDnsServiceIP { - /** - * Specifies an IP address assigned to the Kubernetes DNS service; it must be within the Kubernetes - * service address range specified in the service CIDR. - * - * @param dnsServiceIP the IP address assigned to the Kubernetes DNS service; it must be within the - * Kubernetes service address range specified in the service CIDR - * @return the next stage of the definition - */ - WithAttach withDnsServiceIP(String dnsServiceIP); - } - - /** - * The stage of a network profile definition allowing to specify a CIDR notation IP range assigned to the - * Docker bridge network. - * - * @param the stage of the network profile definition to return to after attaching this definition - */ - interface WithDockerBridgeCidr { - /** - * Specifies a CIDR notation IP range assigned to the Docker bridge network; it must not overlap with - * any subnet IP ranges or the Kubernetes service address range. - * - * @param dockerBridgeCidr the CIDR notation IP range assigned to the Docker bridge network; it must not - * overlap with any subnet IP ranges or the Kubernetes service address range - * @return the next stage of the definition - */ - WithAttach withDockerBridgeCidr(String dockerBridgeCidr); - } - - /** - * The stage of a network profile definition allowing to specify load balancer profile. - * - * @param the stage of the network profile definition to return to after attaching this definition - */ - interface WithLoadBalancerProfile { - /** - * Specifies the load balancer SKU. - * - * @param loadBalancerSku the load balancer SKU. - * @return the next stage of the definition - */ - WithAttach withLoadBalancerSku(LoadBalancerSku loadBalancerSku); - } - - /** - * The final stage of a network profile definition. At this stage, any remaining optional settings can be - * specified, or the container service agent pool can be attached to the parent container service - * definition. - * - * @param the stage of the container service definition to return to after attaching this - * definition - */ - interface WithAttach - extends NetworkProfileDefinitionStages.WithNetworkPolicy, - NetworkProfileDefinitionStages.WithPodCidr, - NetworkProfileDefinitionStages.WithServiceCidr, - NetworkProfileDefinitionStages.WithDnsServiceIP, - NetworkProfileDefinitionStages.WithDockerBridgeCidr, - NetworkProfileDefinitionStages.WithLoadBalancerProfile, - Attachable.InDefinition { - } - } - - /** - * The Kubernetes cluster network profile definition. The entirety of a Kubernetes cluster network profile - * definition as a part of a parent definition. - * - * @param the stage of the container service definition to return to after attaching this definition - */ - interface NetworkProfileDefinition - extends NetworkProfileDefinitionStages.Blank, - NetworkProfileDefinitionStages.WithNetworkPolicy, - NetworkProfileDefinitionStages.WithPodCidr, - NetworkProfileDefinitionStages.WithServiceCidr, - NetworkProfileDefinitionStages.WithDnsServiceIP, - NetworkProfileDefinitionStages.WithDockerBridgeCidr, - NetworkProfileDefinitionStages.WithAttach { - } - - /** The stage of the Kubernetes cluster definition allowing to specify the DNS prefix label. */ - interface WithDnsPrefix { - /** - * Specifies the DNS prefix to be used to create the FQDN for the master pool. - * - * @param dnsPrefix the DNS prefix to be used to create the FQDN for the master pool - * @return the next stage of the definition - */ - KubernetesCluster.DefinitionStages.WithCreate withDnsPrefix(String dnsPrefix); - } - - /** The stage of the Kubernetes cluster definition allowing to specify the cluster's add-on's profiles. */ - interface WithAddOnProfiles { - /** - * Specifies the cluster's add-on's profiles. - * - * @param addOnProfileMap the cluster's add-on's profiles - * @return the next stage of the definition - */ - WithCreate withAddOnProfiles(Map addOnProfileMap); - } - - /** The stage of the Kubernetes cluster definition allowing to specify the cluster's access profiles. */ - interface WithAccessProfiles { - /** - * Enables private cluster. - * - * @return the next stage of the definition - */ - WithCreate enablePrivateCluster(); - } - - /** The stage of the Kubernetes cluster definition allowing to specify the auto-scale profile. */ - interface WithAutoScalerProfile { - /** - * Specifies the auto-scale profile. - * - * @param autoScalerProfile the auto-scale profile - * @return the next stage - */ - WithCreate withAutoScalerProfile(ManagedClusterPropertiesAutoScalerProfile autoScalerProfile); - } - - /** The stage of the Kubernetes cluster definition allowing to specify the auto-scale profile. */ - interface WithManagedServiceIdentity { - /** - * Specifies that System Assigned Managed Service Identity needs to be enabled in the cluster. - * - * @return the next stage of the web app definition - */ - WithCreate withSystemAssignedManagedServiceIdentity(); - } - -// /** The stage of the Kubernetes cluster definition allowing to specify Kubernetes Role-Based Access Control. */ -// interface WithRoleBasedAccessControl { -// /** -// * Enables Kubernetes Role-Based Access Control. -// * -// * @return the next stage -// */ -// WithCreate enableRoleBasedAccessControl(); -// } - - /** - * The stage of the definition which contains all the minimum required inputs for the resource to be created, - * but also allows for any other optional settings to be specified. - */ - interface WithCreate - extends Creatable, - WithAgentPool, - WithNetworkProfile, - WithDnsPrefix, - WithAddOnProfiles, - WithAccessProfiles, - WithAutoScalerProfile, - WithManagedServiceIdentity, -// WithRoleBasedAccessControl, - Resource.DefinitionWithTags { - } - } - - /** The template for an update operation, containing all the settings that can be modified. */ - interface Update - extends UpdateStages.WithAgentPool, - UpdateStages.WithAddOnProfiles, - UpdateStages.WithNetworkProfile, - UpdateStages.WithRBAC, - UpdateStages.WithAutoScalerProfile, - Resource.UpdateWithTags, - Appliable { - } - - /** Grouping of the Kubernetes cluster update stages. */ - interface UpdateStages { - /** - * The stage of the Kubernetes cluster update definition allowing to specify the agent poll in the cluster. - */ - interface WithAgentPool { - /** - * Begins the definition of an agent pool profile to be attached to the Kubernetes cluster. - * - * @param name the name for the agent pool profile - * @return the stage representing configuration for the agent pool profile - */ - KubernetesClusterAgentPool.DefinitionStages.Blank defineAgentPool(String name); - - /** - * Begins the definition of an agent pool profile to be attached to the Kubernetes cluster. - * - * @param name the name for the agent pool profile - * @return the stage representing configuration for the agent pool profile - */ - KubernetesClusterAgentPool.Update updateAgentPool(String name); - - /** - * Removes an agent pool profile from the Kubernetes cluster. - * - * @param name the name for the agent pool profile - * @return the next stage of the update - */ - Update withoutAgentPool(String name); - } - - /** - * The stage of the Kubernetes cluster update definition allowing to specify the cluster's add-on's profiles. - */ - interface WithAddOnProfiles { - /** - * Updates the cluster's add-on's profiles. - * - * @param addOnProfileMap the cluster's add-on's profiles - * @return the next stage of the update - */ - KubernetesCluster.Update withAddOnProfiles(Map addOnProfileMap); - } - - /** The stage of the Kubernetes cluster update definition allowing to specify the cluster's network profile. */ - interface WithNetworkProfile { - /** - * Updates the cluster's network profile. - * - * @param networkProfile the cluster's networkProfile - * @return the next stage of the update - */ - KubernetesCluster.Update withNetworkProfile(ContainerServiceNetworkProfile networkProfile); - } - - /** - * The stage of the Kubernetes cluster update definition allowing to specify if Kubernetes Role-Based Access - * Control is enabled or disabled. - */ - interface WithRBAC { - /** - * Updates the cluster to specify the Kubernetes Role-Based Access Control is enabled. - * - * @return the next stage of the update - */ - KubernetesCluster.Update withRBACEnabled(); - - /** - * Updates the cluster to specify the Kubernetes Role-Based Access Control is disabled. - * - * @return the next stage of the update - */ - KubernetesCluster.Update withRBACDisabled(); - } - - /** The stage of the Kubernetes cluster update allowing to specify the auto-scale profile. */ - interface WithAutoScalerProfile { - /** - * Specifies the auto-scale profile. - * - * @param autoScalerProfile the auto-scale profile - * @return the next stage - */ - Update withAutoScalerProfile(ManagedClusterPropertiesAutoScalerProfile autoScalerProfile); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/KubernetesClusterAgentPool.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/KubernetesClusterAgentPool.java deleted file mode 100644 index 842b80690a12..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/KubernetesClusterAgentPool.java +++ /dev/null @@ -1,461 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.arm.models.ChildResource; -import com.azure.resourcemanager.resources.fluentcore.model.Attachable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.model.Settable; - -import java.util.List; -import java.util.Map; - -/** A client-side representation for a Kubernetes cluster agent pool. */ -@Fluent -public interface KubernetesClusterAgentPool - extends ChildResource, HasInnerModel { - - /** @return the provisioning state of the agent pool */ - String provisioningState(); - - /** @return the number of agents (virtual machines) to host docker containers */ - int count(); - - /** @return size of each agent virtual machine in the agent pool */ - ContainerServiceVMSizeTypes vmSize(); - - /** @return OS disk size in GB set for each virtual machine in the agent pool */ - int osDiskSizeInGB(); - - /** @return OS of each virtual machine in the agent pool */ - OSType osType(); - - /** @return agent pool type */ - AgentPoolType type(); - - /** @return agent pool mode */ - AgentPoolMode mode(); - - /** @return the name of the subnet used by each virtual machine in the agent pool */ - String subnetName(); - - /** @return the ID of the virtual network used by each virtual machine in the agent pool */ - String networkId(); - - /** @return the list of availability zones */ - List availabilityZones(); - - /** @return the map of node labels */ - Map nodeLabels(); - - /** @return the list of node taints */ - List nodeTaints(); - - /** @return the power state, Running or Stopped */ - PowerState powerState(); - - /** @return the number of agents (VMs) to host docker containers */ - int nodeSize(); - - /** @return the maximum number of pods per node */ - int maximumPodsPerNode(); - - /** @return whether auto-scaling is enabled */ - boolean isAutoScalingEnabled(); - - /** @return the minimum number of nodes for auto-scaling */ - int minimumNodeSize(); - - /** @return the maximum number of nodes for auto-scaling */ - int maximumNodeSize(); - - /** @return the priority of each virtual machines in the agent pool */ - ScaleSetPriority virtualMachinePriority(); - - /** @return the eviction policy of each virtual machines in the agent pool */ - ScaleSetEvictionPolicy virtualMachineEvictionPolicy(); - - /** @return the maximum price of each spot virtual machines in the agent pool, -1 means pay-as-you-go prices */ - Double virtualMachineMaximumPrice(); - - /** - * @return the OS disk type to be used for machines in the agent pool - */ - OSDiskType osDiskType(); - - // Fluent interfaces - - /** - * The entirety of a container service agent pool definition as a part of a parent definition. - * - * @param the stage of the container service definition to return to after attaching this definition - */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithOSType, - DefinitionStages.WithOSDiskSize, - DefinitionStages.WithAgentPoolType, - DefinitionStages.WithAgentPoolVirtualMachineCount, - DefinitionStages.WithMaxPodsCount, - DefinitionStages.WithVirtualNetwork, - DefinitionStages.WithAttach { - } - - /** Grouping of container service agent pool definition stages as a part of parent container service definition. */ - interface DefinitionStages { - - /** - * The first stage of a container service agent pool definition allowing to specify the agent virtual machine - * size. - * - * @param the stage of the container service definition to return to after attaching this definition - */ - interface Blank { - /** - * Specifies the size of the virtual machines to be used as agents. - * - * @param vmSize the size of each virtual machine in the agent pool - * @return the next stage of the definition - */ - WithAgentPoolVirtualMachineCount withVirtualMachineSize(ContainerServiceVMSizeTypes vmSize); - } - - /** - * The stage of a container service agent pool definition allowing to specify the agent pool OS type. - * - * @param the stage of the container service definition to return to after attaching this definition - */ - interface WithOSType { - /** - * OS type to be used for each virtual machine in the agent pool. - * - *

    Default is Linux. - * - * @param osType OS type to be used for each virtual machine in the agent pool - * @return the next stage of the definition - */ - WithAttach withOSType(OSType osType); - } - - /** - * The stage of a container service agent pool definition allowing to specify the agent pool OS disk size. - * - * @param the stage of the container service definition to return to after attaching this definition - */ - interface WithOSDiskSize { - /** - * OS disk size in GB to be used for each virtual machine in the agent pool. - * - * @param osDiskSizeInGB OS Disk Size in GB to be used for every machine in the agent pool - * @return the next stage of the definition - */ - WithAttach withOSDiskSizeInGB(int osDiskSizeInGB); - } - - /** - * The stage of a container service agent pool definition allowing to specify the type of agent pool. Allowed - * values could be seen in AgentPoolType Class. - * - * @param the stage of the container service definition to return to after attaching this definition - */ - interface WithAgentPoolType { - /** - * Set agent pool type to every virtual machine in the agent pool. - * - * @param agentPoolType the agent pool type for every machine in the agent pool - * @return the next stage of the definition - */ - WithAttach withAgentPoolType(AgentPoolType agentPoolType); - - /** - * Set agent pool type by type name. - * - * @param agentPoolTypeName the agent pool type name in string format - * @return the next stage of the definition - */ - WithAttach withAgentPoolTypeName(String agentPoolTypeName); - } - - /** - * The stage of a container service agent pool definition allowing to specify the number of agents (Virtual - * Machines) to host docker containers. - * - *

    Allowed values must be in the range of 1 to 100 (inclusive); the default value is 1. - * - * @param the stage of the container service definition to return to after attaching this definition - */ - interface WithAgentPoolVirtualMachineCount { - /** - * Specifies the number of agents (Virtual Machines) to host docker containers. - * - * @param count the number of agents (VMs) to host docker containers. Allowed values must be in the range of - * 1 to 100 (inclusive); the default value is 1. - * @return the next stage of the definition - */ - WithAttach withAgentPoolVirtualMachineCount(int count); - } - - /** - * The stage of a container service agent pool definition allowing to specify the maximum number of pods that - * can run on a node. - * - * @param the stage of the container service definition to return to after attaching this definition - */ - interface WithMaxPodsCount { - /** - * Specifies the maximum number of pods that can run on a node. - * - * @param podsCount the maximum number of pods that can run on a node - * @return the next stage of the definition - */ - WithAttach withMaxPodsCount(int podsCount); - } - - /** - * The stage of a container service agent pool definition allowing to specify auto-scaling. - * - * @param the stage of the container service definition to return to after attaching this definition - */ - interface WithAutoScaling { - /** - * Enables the auto-scaling with maximum/minimum number of nodes. - * - * @param minimumNodeSize the minimum number of nodes for auto-scaling. - * @param maximumNodeSize the maximum number of nodes for auto-scaling. - * @return the next stage of the definition - */ - WithAttach withAutoScaling(int minimumNodeSize, int maximumNodeSize); - } - - /** - * The stage of a container service agent pool definition allowing to specify availability zones. - * - * @param the stage of the container service definition to return to after attaching this definition - */ - interface WithAvailabilityZones { - /** - * Specifies the availability zones. - * - * @param zones the availability zones, can be 1, 2, 3. - * @return the next stage of the definition - */ - WithAttach withAvailabilityZones(Integer... zones); - } - - /** - * The stage of a container service agent pool definition allowing to specify node labels and taints. - * - * @param the stage of the container service definition to return to after attaching this definition - */ - interface WithNodeLabelsTaints { - /** - * Specifies the node labels for all nodes. - * - * @param nodeLabels the node labels. - * @return the next stage of the definition - */ - WithAttach withNodeLabels(Map nodeLabels); - - /** - * Specifies the node labels. - * - * @param nodeTaints the node taints for new nodes. - * @return the next stage of the definition - */ - WithAttach withNodeTaints(List nodeTaints); - } - - /** - * The stage of a container service agent pool definition allowing to specify a virtual network to be used for - * the agents. - * - * @param the stage of the container service definition to return to after attaching this definition - */ - interface WithVirtualNetwork { - /** - * Specifies the virtual network to be used for the agents. - * - * @param virtualNetworkId the ID of a virtual network - * @param subnetName the name of the subnet within the virtual network.; the subnet must have the service - * endpoints enabled for 'Microsoft.ContainerService'. - * @return the next stage - */ - WithAttach withVirtualNetwork(String virtualNetworkId, String subnetName); - } - - /** - * The stage of a container service agent pool definition allowing to specify the agent pool mode. - * - * @param the stage of the container service definition to return to after attaching this definition - */ - interface WithAgentPoolMode { - /** - * Specifies the agent pool mode for the agents. - * - * @param agentPoolMode the agent pool mode - * @return the next stage of the definition - */ - WithAttach withAgentPoolMode(AgentPoolMode agentPoolMode); - } - - /** - * The stage of a container service agent pool definition allowing to specify the priority of the virtual - * machine. - * - * @param the stage of the container service definition to return to after attaching this definition - */ - interface WithVMPriority { - /** - * Specifies the priority of the virtual machines. - * - * @param priority the priority - * @return the next stage of the definition - */ - WithAttach withVirtualMachinePriority(ScaleSetPriority priority); - - /** - * Specify that virtual machines should be spot priority VMs. - * - * @return the next stage of the definition - */ - WithAttach withSpotPriorityVirtualMachine(); - - /** - * Specify that virtual machines should be spot priority VMs with provided eviction policy. - * - * @param policy eviction policy for the virtual machines. - * @return the next stage of the definition - */ - WithAttach withSpotPriorityVirtualMachine(ScaleSetEvictionPolicy policy); - } - - /** - * The stage of a container service agent pool definition allowing to specify the agent pool mode. - * - * @param the stage of the container service definition to return to after attaching this definition - */ - interface WithBillingProfile { - /** - * Sets the maximum price for virtual machine in agent pool. This price is in US Dollars. - * - * Default is -1 if not specified, as up to pay-as-you-go prices. - * - * @param maxPriceInUsDollars the maximum price in US Dollars - * @return the next stage of the definition - */ - WithAttach withVirtualMachineMaximumPrice(Double maxPriceInUsDollars); - } - - /** - * The stage of a container service agent pool definition allowing to specify the agent pool disk type. - * - * @param the stage of the container service definition to return to after attaching this definition - */ - interface WithDiskType { - /** - * The OS disk type to be used for machines in the agent pool. - * - * The default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested - * OSDiskSizeGB. Otherwise, defaults to 'Managed'. - * - * @param osDiskType the OS disk type to be used for machines in the agent pool - * @return the next stage of the definition - */ - WithAttach withOSDiskType(OSDiskType osDiskType); - } - - /** - * The final stage of a container service agent pool definition. At this stage, any remaining optional settings - * can be specified, or the container service agent pool can be attached to the parent container service - * definition. - * - * @param the stage of the container service definition to return to after attaching this definition - */ - interface WithAttach - extends WithOSType, - WithOSDiskSize, - WithAgentPoolType, - WithAgentPoolVirtualMachineCount, - WithMaxPodsCount, - WithVirtualNetwork, - WithAgentPoolMode, - WithAutoScaling, - WithAvailabilityZones, - WithNodeLabelsTaints, - WithVMPriority, - WithBillingProfile, - WithDiskType, - Attachable.InDefinition { - } - } - - /** The template for an update operation, containing all the settings that can be modified. */ - interface Update - extends Settable, - UpdateStages.WithAgentPoolVirtualMachineCount, - UpdateStages.WithAutoScaling, - UpdateStages.WithAgentPoolMode - { - } - - /** Grouping of agent pool update stages. */ - interface UpdateStages { - /** - * The stage of a container service agent pool update allowing to specify the number of agents (Virtual - * Machines) to host docker containers. - * - *

    Allowed values must be in the range of 1 to 100 (inclusive); the default value is 1. - * - * @param the stage of the container service definition to return to after attaching this definition - */ - interface WithAgentPoolVirtualMachineCount { - /** - * Specifies the number of agents (Virtual Machines) to host docker containers. - * - * @param count the number of agents (VMs) to host docker containers. Allowed values must be in the range of - * 1 to 100 (inclusive); the default value is 1. - * @return the next stage of the update - */ - Update withAgentPoolVirtualMachineCount(int count); - } - - /** - * The stage of a container service agent pool update allowing to specify the agent pool mode. - * - * @param the stage of the container service definition to return to after attaching this definition - */ - interface WithAgentPoolMode { - /** - * Specifies the agent pool mode for the agents. - * - * @param agentPoolMode the agent pool mode - * @return the next stage of the update - */ - Update withAgentPoolMode(AgentPoolMode agentPoolMode); - } - - /** - * The stage of a container service agent pool update allowing to specify auto-scaling. - * - * @param the stage of the container service definition to return to after attaching this definition - */ - interface WithAutoScaling { - /** - * Enables the auto-scaling with maximum/minimum number of nodes. - * - * @param minimumNodeCount the minimum number of nodes for auto-scaling. - * @param maximumNodeCount the maximum number of nodes for auto-scaling. - * @return the next stage of the update - */ - Update withAutoScaling(int minimumNodeCount, int maximumNodeCount); - - /** - * Disables the auto-scaling with maximum/minimum number of nodes. - * - * @return the next stage of the update - */ - Update withoutAutoScaling(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/KubernetesClusterUpgradeProfile.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/KubernetesClusterUpgradeProfile.java deleted file mode 100644 index db8e12be3818..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/KubernetesClusterUpgradeProfile.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.containerservice.fluent.models.ManagedClusterUpgradeProfileInner; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; - -/** The result of checking for the Kubernetes cluster's upgrade profile. */ -@Fluent() -public interface KubernetesClusterUpgradeProfile extends HasInnerModel { - /** @return the ID of the Kubernetes cluster upgrade profile */ - String id(); - - /** @return the name of the Kubernetes cluster upgrade profile */ - String name(); - - /** @return the type of the Kubernetes cluster upgrade profile. */ - String type(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/KubernetesClusters.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/KubernetesClusters.java deleted file mode 100644 index 8c82242d0089..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/KubernetesClusters.java +++ /dev/null @@ -1,144 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.containerservice.ContainerServiceManager; -import com.azure.core.management.Region; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsDeletingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsListingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsBatchCreation; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsCreating; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingById; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; -import reactor.core.publisher.Mono; - -import java.util.List; -import java.util.Set; - -/** Entry point to managed Kubernetes service management API. */ -@Fluent() -public interface KubernetesClusters - extends HasManager, - SupportsCreating, - SupportsBatchCreation, - SupportsListing, - SupportsGettingById, - SupportsDeletingById, - SupportsDeletingByResourceGroup, - SupportsListingByResourceGroup, - SupportsGettingByResourceGroup { - - /** - * Returns the list of available Kubernetes versions available for the given Azure region. - * - * @param region the Azure region to query into - * @return a set of Kubernetes versions which can be used when creating a service in this region - */ - Set listKubernetesVersions(Region region); - - /** - * Returns the list of available Kubernetes versions available for the given Azure region. - * - * @param region the Azure region to query into - * @return a future representation of a set of Kubernetes versions which can be used when creating a service in this - * region - */ - Mono> listKubernetesVersionsAsync(Region region); - - /** - * Returns the list of available orchestrators for the given Azure region. - * - * @param region the Azure region to query into - * @param resourceTypes the resource type of container service - * @return a list of orchestrators which can be used when creating a service in this region - */ - PagedIterable listOrchestrators(Region region, - ContainerServiceResourceTypes resourceTypes); - - /** - * Returns the list of available orchestrators for the given Azure region. - * - * @param region the Azure region to query into - * @param resourceTypes the resource type of container service - * @return a list of orchestrators which can be used when creating a service in this region - */ - PagedFlux listOrchestratorsAsync(Region region, - ContainerServiceResourceTypes resourceTypes); - - /** - * Returns the admin Kube.config content which can be used with a Kubernetes client. - * - * @param resourceGroupName the resource group name where the cluster is - * @param kubernetesClusterName the managed cluster name - * @return the Kube.config content which can be used with a Kubernetes client - */ - List listAdminKubeConfigContent(String resourceGroupName, String kubernetesClusterName); - - /** - * Returns asynchronously the admin Kube.config content which can be used with a Kubernetes client. - * - * @param resourceGroupName the resource group name where the cluster is - * @param kubernetesClusterName the managed cluster name - * @return a future representation of the Kube.config content which can be used with a Kubernetes client - */ - Mono> listAdminKubeConfigContentAsync( - String resourceGroupName, String kubernetesClusterName); - - /** - * Returns the user Kube.config content which can be used with a Kubernetes client. - * - * @param resourceGroupName the resource group name where the cluster is - * @param kubernetesClusterName the managed cluster name - * @return the Kube.config content which can be used with a Kubernetes client - */ - List listUserKubeConfigContent(String resourceGroupName, String kubernetesClusterName); - - /** - * Returns asynchronously the user Kube.config content which can be used with a Kubernetes client. - * - * @param resourceGroupName the resource group name where the cluster is - * @param kubernetesClusterName the managed cluster name - * @return a future representation of the Kube.config content which can be used with a Kubernetes client - */ - Mono> listUserKubeConfigContentAsync(String resourceGroupName, String kubernetesClusterName); - - /** - * Starts a stopped Kubernetes cluster. - * - * @param resourceGroupName The name of the resource group. - * @param kubernetesClusterName The name of the managed cluster resource. - */ - void start(String resourceGroupName, String kubernetesClusterName); - - /** - * Starts a stopped Kubernetes cluster. - * - * @param resourceGroupName The name of the resource group. - * @param kubernetesClusterName The name of the managed cluster resource. - * @return the completion. - */ - Mono startAsync(String resourceGroupName, String kubernetesClusterName); - - /** - * Stops a running Kubernetes cluster. - * - * @param resourceGroupName The name of the resource group. - * @param kubernetesClusterName The name of the managed cluster resource. - */ - void stop(String resourceGroupName, String kubernetesClusterName); - - /** - * Stops a running Kubernetes cluster. - * - * @param resourceGroupName The name of the resource group. - * @param kubernetesClusterName The name of the managed cluster resource. - * @return the completion. - */ - Mono stopAsync(String resourceGroupName, String kubernetesClusterName); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/LicenseType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/LicenseType.java deleted file mode 100644 index b25c6ef59e0d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/LicenseType.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for LicenseType. */ -public final class LicenseType extends ExpandableStringEnum { - /** Static value None for LicenseType. */ - public static final LicenseType NONE = fromString("None"); - - /** Static value Windows_Server for LicenseType. */ - public static final LicenseType WINDOWS_SERVER = fromString("Windows_Server"); - - /** - * Creates or finds a LicenseType from its string representation. - * - * @param name a name to look for. - * @return the corresponding LicenseType. - */ - @JsonCreator - public static LicenseType fromString(String name) { - return fromString(name, LicenseType.class); - } - - /** @return known LicenseType values. */ - public static Collection values() { - return values(LicenseType.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/LinuxOSConfig.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/LinuxOSConfig.java deleted file mode 100644 index 3634ee1143b2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/LinuxOSConfig.java +++ /dev/null @@ -1,132 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** OS configurations of Linux agent nodes. */ -@Fluent -public final class LinuxOSConfig { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LinuxOSConfig.class); - - /* - * Sysctl settings for Linux agent nodes. - */ - @JsonProperty(value = "sysctls") - private SysctlConfig sysctls; - - /* - * Transparent Huge Page enabled configuration. - */ - @JsonProperty(value = "transparentHugePageEnabled") - private String transparentHugePageEnabled; - - /* - * Transparent Huge Page defrag configuration. - */ - @JsonProperty(value = "transparentHugePageDefrag") - private String transparentHugePageDefrag; - - /* - * SwapFileSizeMB specifies size in MB of a swap file will be created on - * each node. - */ - @JsonProperty(value = "swapFileSizeMB") - private Integer swapFileSizeMB; - - /** - * Get the sysctls property: Sysctl settings for Linux agent nodes. - * - * @return the sysctls value. - */ - public SysctlConfig sysctls() { - return this.sysctls; - } - - /** - * Set the sysctls property: Sysctl settings for Linux agent nodes. - * - * @param sysctls the sysctls value to set. - * @return the LinuxOSConfig object itself. - */ - public LinuxOSConfig withSysctls(SysctlConfig sysctls) { - this.sysctls = sysctls; - return this; - } - - /** - * Get the transparentHugePageEnabled property: Transparent Huge Page enabled configuration. - * - * @return the transparentHugePageEnabled value. - */ - public String transparentHugePageEnabled() { - return this.transparentHugePageEnabled; - } - - /** - * Set the transparentHugePageEnabled property: Transparent Huge Page enabled configuration. - * - * @param transparentHugePageEnabled the transparentHugePageEnabled value to set. - * @return the LinuxOSConfig object itself. - */ - public LinuxOSConfig withTransparentHugePageEnabled(String transparentHugePageEnabled) { - this.transparentHugePageEnabled = transparentHugePageEnabled; - return this; - } - - /** - * Get the transparentHugePageDefrag property: Transparent Huge Page defrag configuration. - * - * @return the transparentHugePageDefrag value. - */ - public String transparentHugePageDefrag() { - return this.transparentHugePageDefrag; - } - - /** - * Set the transparentHugePageDefrag property: Transparent Huge Page defrag configuration. - * - * @param transparentHugePageDefrag the transparentHugePageDefrag value to set. - * @return the LinuxOSConfig object itself. - */ - public LinuxOSConfig withTransparentHugePageDefrag(String transparentHugePageDefrag) { - this.transparentHugePageDefrag = transparentHugePageDefrag; - return this; - } - - /** - * Get the swapFileSizeMB property: SwapFileSizeMB specifies size in MB of a swap file will be created on each node. - * - * @return the swapFileSizeMB value. - */ - public Integer swapFileSizeMB() { - return this.swapFileSizeMB; - } - - /** - * Set the swapFileSizeMB property: SwapFileSizeMB specifies size in MB of a swap file will be created on each node. - * - * @param swapFileSizeMB the swapFileSizeMB value to set. - * @return the LinuxOSConfig object itself. - */ - public LinuxOSConfig withSwapFileSizeMB(Integer swapFileSizeMB) { - this.swapFileSizeMB = swapFileSizeMB; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (sysctls() != null) { - sysctls().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/LoadBalancerSku.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/LoadBalancerSku.java deleted file mode 100644 index 4a19c46f843b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/LoadBalancerSku.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for LoadBalancerSku. */ -public final class LoadBalancerSku extends ExpandableStringEnum { - /** Static value standard for LoadBalancerSku. */ - public static final LoadBalancerSku STANDARD = fromString("standard"); - - /** Static value basic for LoadBalancerSku. */ - public static final LoadBalancerSku BASIC = fromString("basic"); - - /** - * Creates or finds a LoadBalancerSku from its string representation. - * - * @param name a name to look for. - * @return the corresponding LoadBalancerSku. - */ - @JsonCreator - public static LoadBalancerSku fromString(String name) { - return fromString(name, LoadBalancerSku.class); - } - - /** @return known LoadBalancerSku values. */ - public static Collection values() { - return values(LoadBalancerSku.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterAadProfile.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterAadProfile.java deleted file mode 100644 index 5f746d502078..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterAadProfile.java +++ /dev/null @@ -1,210 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** AADProfile specifies attributes for Azure Active Directory integration. */ -@Fluent -public final class ManagedClusterAadProfile { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedClusterAadProfile.class); - - /* - * Whether to enable managed AAD. - */ - @JsonProperty(value = "managed") - private Boolean managed; - - /* - * Whether to enable Azure RBAC for Kubernetes authorization. - */ - @JsonProperty(value = "enableAzureRBAC") - private Boolean enableAzureRbac; - - /* - * AAD group object IDs that will have admin role of the cluster. - */ - @JsonProperty(value = "adminGroupObjectIDs") - private List adminGroupObjectIDs; - - /* - * The client AAD application ID. - */ - @JsonProperty(value = "clientAppID") - private String clientAppId; - - /* - * The server AAD application ID. - */ - @JsonProperty(value = "serverAppID") - private String serverAppId; - - /* - * The server AAD application secret. - */ - @JsonProperty(value = "serverAppSecret") - private String serverAppSecret; - - /* - * The AAD tenant ID to use for authentication. If not specified, will use - * the tenant of the deployment subscription. - */ - @JsonProperty(value = "tenantID") - private String tenantId; - - /** - * Get the managed property: Whether to enable managed AAD. - * - * @return the managed value. - */ - public Boolean managed() { - return this.managed; - } - - /** - * Set the managed property: Whether to enable managed AAD. - * - * @param managed the managed value to set. - * @return the ManagedClusterAadProfile object itself. - */ - public ManagedClusterAadProfile withManaged(Boolean managed) { - this.managed = managed; - return this; - } - - /** - * Get the enableAzureRbac property: Whether to enable Azure RBAC for Kubernetes authorization. - * - * @return the enableAzureRbac value. - */ - public Boolean enableAzureRbac() { - return this.enableAzureRbac; - } - - /** - * Set the enableAzureRbac property: Whether to enable Azure RBAC for Kubernetes authorization. - * - * @param enableAzureRbac the enableAzureRbac value to set. - * @return the ManagedClusterAadProfile object itself. - */ - public ManagedClusterAadProfile withEnableAzureRbac(Boolean enableAzureRbac) { - this.enableAzureRbac = enableAzureRbac; - return this; - } - - /** - * Get the adminGroupObjectIDs property: AAD group object IDs that will have admin role of the cluster. - * - * @return the adminGroupObjectIDs value. - */ - public List adminGroupObjectIDs() { - return this.adminGroupObjectIDs; - } - - /** - * Set the adminGroupObjectIDs property: AAD group object IDs that will have admin role of the cluster. - * - * @param adminGroupObjectIDs the adminGroupObjectIDs value to set. - * @return the ManagedClusterAadProfile object itself. - */ - public ManagedClusterAadProfile withAdminGroupObjectIDs(List adminGroupObjectIDs) { - this.adminGroupObjectIDs = adminGroupObjectIDs; - return this; - } - - /** - * Get the clientAppId property: The client AAD application ID. - * - * @return the clientAppId value. - */ - public String clientAppId() { - return this.clientAppId; - } - - /** - * Set the clientAppId property: The client AAD application ID. - * - * @param clientAppId the clientAppId value to set. - * @return the ManagedClusterAadProfile object itself. - */ - public ManagedClusterAadProfile withClientAppId(String clientAppId) { - this.clientAppId = clientAppId; - return this; - } - - /** - * Get the serverAppId property: The server AAD application ID. - * - * @return the serverAppId value. - */ - public String serverAppId() { - return this.serverAppId; - } - - /** - * Set the serverAppId property: The server AAD application ID. - * - * @param serverAppId the serverAppId value to set. - * @return the ManagedClusterAadProfile object itself. - */ - public ManagedClusterAadProfile withServerAppId(String serverAppId) { - this.serverAppId = serverAppId; - return this; - } - - /** - * Get the serverAppSecret property: The server AAD application secret. - * - * @return the serverAppSecret value. - */ - public String serverAppSecret() { - return this.serverAppSecret; - } - - /** - * Set the serverAppSecret property: The server AAD application secret. - * - * @param serverAppSecret the serverAppSecret value to set. - * @return the ManagedClusterAadProfile object itself. - */ - public ManagedClusterAadProfile withServerAppSecret(String serverAppSecret) { - this.serverAppSecret = serverAppSecret; - return this; - } - - /** - * Get the tenantId property: The AAD tenant ID to use for authentication. If not specified, will use the tenant of - * the deployment subscription. - * - * @return the tenantId value. - */ - public String tenantId() { - return this.tenantId; - } - - /** - * Set the tenantId property: The AAD tenant ID to use for authentication. If not specified, will use the tenant of - * the deployment subscription. - * - * @param tenantId the tenantId value to set. - * @return the ManagedClusterAadProfile object itself. - */ - public ManagedClusterAadProfile withTenantId(String tenantId) { - this.tenantId = tenantId; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterAddonProfile.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterAddonProfile.java deleted file mode 100644 index e4c9363e38e6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterAddonProfile.java +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** A Kubernetes add-on profile for a managed cluster. */ -@Fluent -public final class ManagedClusterAddonProfile { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedClusterAddonProfile.class); - - /* - * Whether the add-on is enabled or not. - */ - @JsonProperty(value = "enabled", required = true) - private boolean enabled; - - /* - * Key-value pairs for configuring an add-on. - */ - @JsonProperty(value = "config") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map config; - - /* - * Information of user assigned identity used by this add-on. - */ - @JsonProperty(value = "identity", access = JsonProperty.Access.WRITE_ONLY) - private ManagedClusterAddonProfileIdentity identity; - - /** - * Get the enabled property: Whether the add-on is enabled or not. - * - * @return the enabled value. - */ - public boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Whether the add-on is enabled or not. - * - * @param enabled the enabled value to set. - * @return the ManagedClusterAddonProfile object itself. - */ - public ManagedClusterAddonProfile withEnabled(boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the config property: Key-value pairs for configuring an add-on. - * - * @return the config value. - */ - public Map config() { - return this.config; - } - - /** - * Set the config property: Key-value pairs for configuring an add-on. - * - * @param config the config value to set. - * @return the ManagedClusterAddonProfile object itself. - */ - public ManagedClusterAddonProfile withConfig(Map config) { - this.config = config; - return this; - } - - /** - * Get the identity property: Information of user assigned identity used by this add-on. - * - * @return the identity value. - */ - public ManagedClusterAddonProfileIdentity identity() { - return this.identity; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (identity() != null) { - identity().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterAddonProfileIdentity.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterAddonProfileIdentity.java deleted file mode 100644 index 2611fab6a73a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterAddonProfileIdentity.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; - -/** Information of user assigned identity used by this add-on. */ -@Fluent -public class ManagedClusterAddonProfileIdentity extends UserAssignedIdentity { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedClusterAddonProfileIdentity.class); - - /** {@inheritDoc} */ - @Override - public ManagedClusterAddonProfileIdentity withResourceId(String resourceId) { - super.withResourceId(resourceId); - return this; - } - - /** {@inheritDoc} */ - @Override - public ManagedClusterAddonProfileIdentity withClientId(String clientId) { - super.withClientId(clientId); - return this; - } - - /** {@inheritDoc} */ - @Override - public ManagedClusterAddonProfileIdentity withObjectId(String objectId) { - super.withObjectId(objectId); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterAgentPoolProfile.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterAgentPoolProfile.java deleted file mode 100644 index 0a16d39540fd..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterAgentPoolProfile.java +++ /dev/null @@ -1,246 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.containerservice.fluent.models.ManagedClusterAgentPoolProfileProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** Profile for the container service agent pool. */ -@Fluent -public final class ManagedClusterAgentPoolProfile extends ManagedClusterAgentPoolProfileProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedClusterAgentPoolProfile.class); - - /* - * Unique name of the agent pool profile in the context of the subscription - * and resource group. - */ - @JsonProperty(value = "name", required = true) - private String name; - - /** - * Get the name property: Unique name of the agent pool profile in the context of the subscription and resource - * group. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Unique name of the agent pool profile in the context of the subscription and resource - * group. - * - * @param name the name value to set. - * @return the ManagedClusterAgentPoolProfile object itself. - */ - public ManagedClusterAgentPoolProfile withName(String name) { - this.name = name; - return this; - } - - /** {@inheritDoc} */ - @Override - public ManagedClusterAgentPoolProfile withCount(Integer count) { - super.withCount(count); - return this; - } - - /** {@inheritDoc} */ - @Override - public ManagedClusterAgentPoolProfile withVmSize(ContainerServiceVMSizeTypes vmSize) { - super.withVmSize(vmSize); - return this; - } - - /** {@inheritDoc} */ - @Override - public ManagedClusterAgentPoolProfile withOsDiskSizeGB(Integer osDiskSizeGB) { - super.withOsDiskSizeGB(osDiskSizeGB); - return this; - } - - /** {@inheritDoc} */ - @Override - public ManagedClusterAgentPoolProfile withOsDiskType(OSDiskType osDiskType) { - super.withOsDiskType(osDiskType); - return this; - } - - /** {@inheritDoc} */ - @Override - public ManagedClusterAgentPoolProfile withVnetSubnetId(String vnetSubnetId) { - super.withVnetSubnetId(vnetSubnetId); - return this; - } - - /** {@inheritDoc} */ - @Override - public ManagedClusterAgentPoolProfile withPodSubnetId(String podSubnetId) { - super.withPodSubnetId(podSubnetId); - return this; - } - - /** {@inheritDoc} */ - @Override - public ManagedClusterAgentPoolProfile withMaxPods(Integer maxPods) { - super.withMaxPods(maxPods); - return this; - } - - /** {@inheritDoc} */ - @Override - public ManagedClusterAgentPoolProfile withOsType(OSType osType) { - super.withOsType(osType); - return this; - } - - /** {@inheritDoc} */ - @Override - public ManagedClusterAgentPoolProfile withMaxCount(Integer maxCount) { - super.withMaxCount(maxCount); - return this; - } - - /** {@inheritDoc} */ - @Override - public ManagedClusterAgentPoolProfile withMinCount(Integer minCount) { - super.withMinCount(minCount); - return this; - } - - /** {@inheritDoc} */ - @Override - public ManagedClusterAgentPoolProfile withEnableAutoScaling(Boolean enableAutoScaling) { - super.withEnableAutoScaling(enableAutoScaling); - return this; - } - - /** {@inheritDoc} */ - @Override - public ManagedClusterAgentPoolProfile withType(AgentPoolType type) { - super.withType(type); - return this; - } - - /** {@inheritDoc} */ - @Override - public ManagedClusterAgentPoolProfile withMode(AgentPoolMode mode) { - super.withMode(mode); - return this; - } - - /** {@inheritDoc} */ - @Override - public ManagedClusterAgentPoolProfile withOrchestratorVersion(String orchestratorVersion) { - super.withOrchestratorVersion(orchestratorVersion); - return this; - } - - /** {@inheritDoc} */ - @Override - public ManagedClusterAgentPoolProfile withUpgradeSettings(AgentPoolUpgradeSettings upgradeSettings) { - super.withUpgradeSettings(upgradeSettings); - return this; - } - - /** {@inheritDoc} */ - @Override - public ManagedClusterAgentPoolProfile withAvailabilityZones(List availabilityZones) { - super.withAvailabilityZones(availabilityZones); - return this; - } - - /** {@inheritDoc} */ - @Override - public ManagedClusterAgentPoolProfile withEnableNodePublicIp(Boolean enableNodePublicIp) { - super.withEnableNodePublicIp(enableNodePublicIp); - return this; - } - - /** {@inheritDoc} */ - @Override - public ManagedClusterAgentPoolProfile withScaleSetPriority(ScaleSetPriority scaleSetPriority) { - super.withScaleSetPriority(scaleSetPriority); - return this; - } - - /** {@inheritDoc} */ - @Override - public ManagedClusterAgentPoolProfile withScaleSetEvictionPolicy(ScaleSetEvictionPolicy scaleSetEvictionPolicy) { - super.withScaleSetEvictionPolicy(scaleSetEvictionPolicy); - return this; - } - - /** {@inheritDoc} */ - @Override - public ManagedClusterAgentPoolProfile withSpotMaxPrice(Float spotMaxPrice) { - super.withSpotMaxPrice(spotMaxPrice); - return this; - } - - /** {@inheritDoc} */ - @Override - public ManagedClusterAgentPoolProfile withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** {@inheritDoc} */ - @Override - public ManagedClusterAgentPoolProfile withNodeLabels(Map nodeLabels) { - super.withNodeLabels(nodeLabels); - return this; - } - - /** {@inheritDoc} */ - @Override - public ManagedClusterAgentPoolProfile withNodeTaints(List nodeTaints) { - super.withNodeTaints(nodeTaints); - return this; - } - - /** {@inheritDoc} */ - @Override - public ManagedClusterAgentPoolProfile withProximityPlacementGroupId(String proximityPlacementGroupId) { - super.withProximityPlacementGroupId(proximityPlacementGroupId); - return this; - } - - /** {@inheritDoc} */ - @Override - public ManagedClusterAgentPoolProfile withKubeletConfig(KubeletConfig kubeletConfig) { - super.withKubeletConfig(kubeletConfig); - return this; - } - - /** {@inheritDoc} */ - @Override - public ManagedClusterAgentPoolProfile withLinuxOSConfig(LinuxOSConfig linuxOSConfig) { - super.withLinuxOSConfig(linuxOSConfig); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (name() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property name in model ManagedClusterAgentPoolProfile")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterApiServerAccessProfile.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterApiServerAccessProfile.java deleted file mode 100644 index ab9770322394..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterApiServerAccessProfile.java +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Access profile for managed cluster API server. */ -@Fluent -public final class ManagedClusterApiServerAccessProfile { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedClusterApiServerAccessProfile.class); - - /* - * Authorized IP Ranges to kubernetes API server. - */ - @JsonProperty(value = "authorizedIPRanges") - private List authorizedIpRanges; - - /* - * Whether to create the cluster as a private cluster or not. - */ - @JsonProperty(value = "enablePrivateCluster") - private Boolean enablePrivateCluster; - - /* - * Private dns zone mode for private cluster. - */ - @JsonProperty(value = "privateDNSZone") - private String privateDnsZone; - - /** - * Get the authorizedIpRanges property: Authorized IP Ranges to kubernetes API server. - * - * @return the authorizedIpRanges value. - */ - public List authorizedIpRanges() { - return this.authorizedIpRanges; - } - - /** - * Set the authorizedIpRanges property: Authorized IP Ranges to kubernetes API server. - * - * @param authorizedIpRanges the authorizedIpRanges value to set. - * @return the ManagedClusterApiServerAccessProfile object itself. - */ - public ManagedClusterApiServerAccessProfile withAuthorizedIpRanges(List authorizedIpRanges) { - this.authorizedIpRanges = authorizedIpRanges; - return this; - } - - /** - * Get the enablePrivateCluster property: Whether to create the cluster as a private cluster or not. - * - * @return the enablePrivateCluster value. - */ - public Boolean enablePrivateCluster() { - return this.enablePrivateCluster; - } - - /** - * Set the enablePrivateCluster property: Whether to create the cluster as a private cluster or not. - * - * @param enablePrivateCluster the enablePrivateCluster value to set. - * @return the ManagedClusterApiServerAccessProfile object itself. - */ - public ManagedClusterApiServerAccessProfile withEnablePrivateCluster(Boolean enablePrivateCluster) { - this.enablePrivateCluster = enablePrivateCluster; - return this; - } - - /** - * Get the privateDnsZone property: Private dns zone mode for private cluster. - * - * @return the privateDnsZone value. - */ - public String privateDnsZone() { - return this.privateDnsZone; - } - - /** - * Set the privateDnsZone property: Private dns zone mode for private cluster. - * - * @param privateDnsZone the privateDnsZone value to set. - * @return the ManagedClusterApiServerAccessProfile object itself. - */ - public ManagedClusterApiServerAccessProfile withPrivateDnsZone(String privateDnsZone) { - this.privateDnsZone = privateDnsZone; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterAutoUpgradeProfile.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterAutoUpgradeProfile.java deleted file mode 100644 index 10ea5ab0ce09..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterAutoUpgradeProfile.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Auto upgrade profile for a managed cluster. */ -@Fluent -public final class ManagedClusterAutoUpgradeProfile { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedClusterAutoUpgradeProfile.class); - - /* - * upgrade channel for auto upgrade. - */ - @JsonProperty(value = "upgradeChannel") - private UpgradeChannel upgradeChannel; - - /** - * Get the upgradeChannel property: upgrade channel for auto upgrade. - * - * @return the upgradeChannel value. - */ - public UpgradeChannel upgradeChannel() { - return this.upgradeChannel; - } - - /** - * Set the upgradeChannel property: upgrade channel for auto upgrade. - * - * @param upgradeChannel the upgradeChannel value to set. - * @return the ManagedClusterAutoUpgradeProfile object itself. - */ - public ManagedClusterAutoUpgradeProfile withUpgradeChannel(UpgradeChannel upgradeChannel) { - this.upgradeChannel = upgradeChannel; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterIdentity.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterIdentity.java deleted file mode 100644 index 701fd0c6b729..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterIdentity.java +++ /dev/null @@ -1,141 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** Identity for the managed cluster. */ -@Fluent -public class ManagedClusterIdentity { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedClusterIdentity.class); - - /* - * The principal id of the system assigned identity which is used by master - * components. - */ - @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) - private String principalId; - - /* - * The tenant id of the system assigned identity which is used by master - * components. - */ - @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) - private String tenantId; - - /* - * The type of identity used for the managed cluster. Type 'SystemAssigned' - * will use an implicitly created identity in master components and an - * auto-created user assigned identity in MC_ resource group in agent - * nodes. Type 'None' will not use MSI for the managed cluster, service - * principal will be used instead. - */ - @JsonProperty(value = "type") - private ResourceIdentityType type; - - /* - * The user identity associated with the managed cluster. This identity - * will be used in control plane and only one user assigned identity is - * allowed. The user identity dictionary key references will be ARM - * resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - */ - @JsonProperty(value = "userAssignedIdentities") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map userAssignedIdentities; - - /** - * Get the principalId property: The principal id of the system assigned identity which is used by master - * components. - * - * @return the principalId value. - */ - public String principalId() { - return this.principalId; - } - - /** - * Get the tenantId property: The tenant id of the system assigned identity which is used by master components. - * - * @return the tenantId value. - */ - public String tenantId() { - return this.tenantId; - } - - /** - * Get the type property: The type of identity used for the managed cluster. Type 'SystemAssigned' will use an - * implicitly created identity in master components and an auto-created user assigned identity in MC_ resource group - * in agent nodes. Type 'None' will not use MSI for the managed cluster, service principal will be used instead. - * - * @return the type value. - */ - public ResourceIdentityType type() { - return this.type; - } - - /** - * Set the type property: The type of identity used for the managed cluster. Type 'SystemAssigned' will use an - * implicitly created identity in master components and an auto-created user assigned identity in MC_ resource group - * in agent nodes. Type 'None' will not use MSI for the managed cluster, service principal will be used instead. - * - * @param type the type value to set. - * @return the ManagedClusterIdentity object itself. - */ - public ManagedClusterIdentity withType(ResourceIdentityType type) { - this.type = type; - return this; - } - - /** - * Get the userAssignedIdentities property: The user identity associated with the managed cluster. This identity - * will be used in control plane and only one user assigned identity is allowed. The user identity dictionary key - * references will be ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - * - * @return the userAssignedIdentities value. - */ - public Map userAssignedIdentities() { - return this.userAssignedIdentities; - } - - /** - * Set the userAssignedIdentities property: The user identity associated with the managed cluster. This identity - * will be used in control plane and only one user assigned identity is allowed. The user identity dictionary key - * references will be ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - * - * @param userAssignedIdentities the userAssignedIdentities value to set. - * @return the ManagedClusterIdentity object itself. - */ - public ManagedClusterIdentity withUserAssignedIdentities( - Map userAssignedIdentities) { - this.userAssignedIdentities = userAssignedIdentities; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (userAssignedIdentities() != null) { - userAssignedIdentities() - .values() - .forEach( - e -> { - if (e != null) { - e.validate(); - } - }); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterIdentityUserAssignedIdentities.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterIdentityUserAssignedIdentities.java deleted file mode 100644 index b5b4a1279388..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterIdentityUserAssignedIdentities.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The ManagedClusterIdentityUserAssignedIdentities model. */ -@Immutable -public final class ManagedClusterIdentityUserAssignedIdentities { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(ManagedClusterIdentityUserAssignedIdentities.class); - - /* - * The principal id of user assigned identity. - */ - @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) - private String principalId; - - /* - * The client id of user assigned identity. - */ - @JsonProperty(value = "clientId", access = JsonProperty.Access.WRITE_ONLY) - private String clientId; - - /** - * Get the principalId property: The principal id of user assigned identity. - * - * @return the principalId value. - */ - public String principalId() { - return this.principalId; - } - - /** - * Get the clientId property: The client id of user assigned identity. - * - * @return the clientId value. - */ - public String clientId() { - return this.clientId; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterListResult.java deleted file mode 100644 index cfaadc71bf28..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterListResult.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.containerservice.fluent.models.ManagedClusterInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The response from the List Managed Clusters operation. */ -@Fluent -public final class ManagedClusterListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedClusterListResult.class); - - /* - * The list of managed clusters. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to get the next set of managed cluster results. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: The list of managed clusters. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The list of managed clusters. - * - * @param value the value value to set. - * @return the ManagedClusterListResult object itself. - */ - public ManagedClusterListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to get the next set of managed cluster results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterLoadBalancerProfile.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterLoadBalancerProfile.java deleted file mode 100644 index 84485a1858de..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterLoadBalancerProfile.java +++ /dev/null @@ -1,202 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Profile of the managed cluster load balancer. */ -@Fluent -public final class ManagedClusterLoadBalancerProfile { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedClusterLoadBalancerProfile.class); - - /* - * Desired managed outbound IPs for the cluster load balancer. - */ - @JsonProperty(value = "managedOutboundIPs") - private ManagedClusterLoadBalancerProfileManagedOutboundIPs managedOutboundIPs; - - /* - * Desired outbound IP Prefix resources for the cluster load balancer. - */ - @JsonProperty(value = "outboundIPPrefixes") - private ManagedClusterLoadBalancerProfileOutboundIpPrefixes outboundIpPrefixes; - - /* - * Desired outbound IP resources for the cluster load balancer. - */ - @JsonProperty(value = "outboundIPs") - private ManagedClusterLoadBalancerProfileOutboundIPs outboundIPs; - - /* - * The effective outbound IP resources of the cluster load balancer. - */ - @JsonProperty(value = "effectiveOutboundIPs") - private List effectiveOutboundIPs; - - /* - * Desired number of allocated SNAT ports per VM. Allowed values must be in - * the range of 0 to 64000 (inclusive). The default value is 0 which - * results in Azure dynamically allocating ports. - */ - @JsonProperty(value = "allocatedOutboundPorts") - private Integer allocatedOutboundPorts; - - /* - * Desired outbound flow idle timeout in minutes. Allowed values must be in - * the range of 4 to 120 (inclusive). The default value is 30 minutes. - */ - @JsonProperty(value = "idleTimeoutInMinutes") - private Integer idleTimeoutInMinutes; - - /** - * Get the managedOutboundIPs property: Desired managed outbound IPs for the cluster load balancer. - * - * @return the managedOutboundIPs value. - */ - public ManagedClusterLoadBalancerProfileManagedOutboundIPs managedOutboundIPs() { - return this.managedOutboundIPs; - } - - /** - * Set the managedOutboundIPs property: Desired managed outbound IPs for the cluster load balancer. - * - * @param managedOutboundIPs the managedOutboundIPs value to set. - * @return the ManagedClusterLoadBalancerProfile object itself. - */ - public ManagedClusterLoadBalancerProfile withManagedOutboundIPs( - ManagedClusterLoadBalancerProfileManagedOutboundIPs managedOutboundIPs) { - this.managedOutboundIPs = managedOutboundIPs; - return this; - } - - /** - * Get the outboundIpPrefixes property: Desired outbound IP Prefix resources for the cluster load balancer. - * - * @return the outboundIpPrefixes value. - */ - public ManagedClusterLoadBalancerProfileOutboundIpPrefixes outboundIpPrefixes() { - return this.outboundIpPrefixes; - } - - /** - * Set the outboundIpPrefixes property: Desired outbound IP Prefix resources for the cluster load balancer. - * - * @param outboundIpPrefixes the outboundIpPrefixes value to set. - * @return the ManagedClusterLoadBalancerProfile object itself. - */ - public ManagedClusterLoadBalancerProfile withOutboundIpPrefixes( - ManagedClusterLoadBalancerProfileOutboundIpPrefixes outboundIpPrefixes) { - this.outboundIpPrefixes = outboundIpPrefixes; - return this; - } - - /** - * Get the outboundIPs property: Desired outbound IP resources for the cluster load balancer. - * - * @return the outboundIPs value. - */ - public ManagedClusterLoadBalancerProfileOutboundIPs outboundIPs() { - return this.outboundIPs; - } - - /** - * Set the outboundIPs property: Desired outbound IP resources for the cluster load balancer. - * - * @param outboundIPs the outboundIPs value to set. - * @return the ManagedClusterLoadBalancerProfile object itself. - */ - public ManagedClusterLoadBalancerProfile withOutboundIPs(ManagedClusterLoadBalancerProfileOutboundIPs outboundIPs) { - this.outboundIPs = outboundIPs; - return this; - } - - /** - * Get the effectiveOutboundIPs property: The effective outbound IP resources of the cluster load balancer. - * - * @return the effectiveOutboundIPs value. - */ - public List effectiveOutboundIPs() { - return this.effectiveOutboundIPs; - } - - /** - * Set the effectiveOutboundIPs property: The effective outbound IP resources of the cluster load balancer. - * - * @param effectiveOutboundIPs the effectiveOutboundIPs value to set. - * @return the ManagedClusterLoadBalancerProfile object itself. - */ - public ManagedClusterLoadBalancerProfile withEffectiveOutboundIPs(List effectiveOutboundIPs) { - this.effectiveOutboundIPs = effectiveOutboundIPs; - return this; - } - - /** - * Get the allocatedOutboundPorts property: Desired number of allocated SNAT ports per VM. Allowed values must be in - * the range of 0 to 64000 (inclusive). The default value is 0 which results in Azure dynamically allocating ports. - * - * @return the allocatedOutboundPorts value. - */ - public Integer allocatedOutboundPorts() { - return this.allocatedOutboundPorts; - } - - /** - * Set the allocatedOutboundPorts property: Desired number of allocated SNAT ports per VM. Allowed values must be in - * the range of 0 to 64000 (inclusive). The default value is 0 which results in Azure dynamically allocating ports. - * - * @param allocatedOutboundPorts the allocatedOutboundPorts value to set. - * @return the ManagedClusterLoadBalancerProfile object itself. - */ - public ManagedClusterLoadBalancerProfile withAllocatedOutboundPorts(Integer allocatedOutboundPorts) { - this.allocatedOutboundPorts = allocatedOutboundPorts; - return this; - } - - /** - * Get the idleTimeoutInMinutes property: Desired outbound flow idle timeout in minutes. Allowed values must be in - * the range of 4 to 120 (inclusive). The default value is 30 minutes. - * - * @return the idleTimeoutInMinutes value. - */ - public Integer idleTimeoutInMinutes() { - return this.idleTimeoutInMinutes; - } - - /** - * Set the idleTimeoutInMinutes property: Desired outbound flow idle timeout in minutes. Allowed values must be in - * the range of 4 to 120 (inclusive). The default value is 30 minutes. - * - * @param idleTimeoutInMinutes the idleTimeoutInMinutes value to set. - * @return the ManagedClusterLoadBalancerProfile object itself. - */ - public ManagedClusterLoadBalancerProfile withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes) { - this.idleTimeoutInMinutes = idleTimeoutInMinutes; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (managedOutboundIPs() != null) { - managedOutboundIPs().validate(); - } - if (outboundIpPrefixes() != null) { - outboundIpPrefixes().validate(); - } - if (outboundIPs() != null) { - outboundIPs().validate(); - } - if (effectiveOutboundIPs() != null) { - effectiveOutboundIPs().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterLoadBalancerProfileManagedOutboundIPs.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterLoadBalancerProfileManagedOutboundIPs.java deleted file mode 100644 index 58523c220a28..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterLoadBalancerProfileManagedOutboundIPs.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Desired managed outbound IPs for the cluster load balancer. */ -@Fluent -public final class ManagedClusterLoadBalancerProfileManagedOutboundIPs { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(ManagedClusterLoadBalancerProfileManagedOutboundIPs.class); - - /* - * Desired number of outbound IP created/managed by Azure for the cluster - * load balancer. Allowed values must be in the range of 1 to 100 - * (inclusive). The default value is 1. - */ - @JsonProperty(value = "count") - private Integer count; - - /** - * Get the count property: Desired number of outbound IP created/managed by Azure for the cluster load balancer. - * Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. - * - * @return the count value. - */ - public Integer count() { - return this.count; - } - - /** - * Set the count property: Desired number of outbound IP created/managed by Azure for the cluster load balancer. - * Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. - * - * @param count the count value to set. - * @return the ManagedClusterLoadBalancerProfileManagedOutboundIPs object itself. - */ - public ManagedClusterLoadBalancerProfileManagedOutboundIPs withCount(Integer count) { - this.count = count; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterLoadBalancerProfileOutboundIPs.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterLoadBalancerProfileOutboundIPs.java deleted file mode 100644 index 483754468813..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterLoadBalancerProfileOutboundIPs.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Desired outbound IP resources for the cluster load balancer. */ -@Fluent -public final class ManagedClusterLoadBalancerProfileOutboundIPs { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(ManagedClusterLoadBalancerProfileOutboundIPs.class); - - /* - * A list of public IP resources. - */ - @JsonProperty(value = "publicIPs") - private List publicIPs; - - /** - * Get the publicIPs property: A list of public IP resources. - * - * @return the publicIPs value. - */ - public List publicIPs() { - return this.publicIPs; - } - - /** - * Set the publicIPs property: A list of public IP resources. - * - * @param publicIPs the publicIPs value to set. - * @return the ManagedClusterLoadBalancerProfileOutboundIPs object itself. - */ - public ManagedClusterLoadBalancerProfileOutboundIPs withPublicIPs(List publicIPs) { - this.publicIPs = publicIPs; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (publicIPs() != null) { - publicIPs().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterLoadBalancerProfileOutboundIpPrefixes.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterLoadBalancerProfileOutboundIpPrefixes.java deleted file mode 100644 index 4ab7e8d28a21..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterLoadBalancerProfileOutboundIpPrefixes.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Desired outbound IP Prefix resources for the cluster load balancer. */ -@Fluent -public final class ManagedClusterLoadBalancerProfileOutboundIpPrefixes { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(ManagedClusterLoadBalancerProfileOutboundIpPrefixes.class); - - /* - * A list of public IP prefix resources. - */ - @JsonProperty(value = "publicIPPrefixes") - private List publicIpPrefixes; - - /** - * Get the publicIpPrefixes property: A list of public IP prefix resources. - * - * @return the publicIpPrefixes value. - */ - public List publicIpPrefixes() { - return this.publicIpPrefixes; - } - - /** - * Set the publicIpPrefixes property: A list of public IP prefix resources. - * - * @param publicIpPrefixes the publicIpPrefixes value to set. - * @return the ManagedClusterLoadBalancerProfileOutboundIpPrefixes object itself. - */ - public ManagedClusterLoadBalancerProfileOutboundIpPrefixes withPublicIpPrefixes( - List publicIpPrefixes) { - this.publicIpPrefixes = publicIpPrefixes; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (publicIpPrefixes() != null) { - publicIpPrefixes().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterPodIdentity.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterPodIdentity.java deleted file mode 100644 index 076fd73775ef..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterPodIdentity.java +++ /dev/null @@ -1,154 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The ManagedClusterPodIdentity model. */ -@Fluent -public class ManagedClusterPodIdentity { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedClusterPodIdentity.class); - - /* - * Name of the pod identity. - */ - @JsonProperty(value = "name", required = true) - private String name; - - /* - * Namespace of the pod identity. - */ - @JsonProperty(value = "namespace", required = true) - private String namespace; - - /* - * Information of the user assigned identity. - */ - @JsonProperty(value = "identity", required = true) - private UserAssignedIdentity identity; - - /* - * The current provisioning state of the pod identity. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private ManagedClusterPodIdentityProvisioningState provisioningState; - - /* - * The provisioningInfo property. - */ - @JsonProperty(value = "provisioningInfo", access = JsonProperty.Access.WRITE_ONLY) - private ManagedClusterPodIdentityProvisioningInfo provisioningInfo; - - /** - * Get the name property: Name of the pod identity. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Name of the pod identity. - * - * @param name the name value to set. - * @return the ManagedClusterPodIdentity object itself. - */ - public ManagedClusterPodIdentity withName(String name) { - this.name = name; - return this; - } - - /** - * Get the namespace property: Namespace of the pod identity. - * - * @return the namespace value. - */ - public String namespace() { - return this.namespace; - } - - /** - * Set the namespace property: Namespace of the pod identity. - * - * @param namespace the namespace value to set. - * @return the ManagedClusterPodIdentity object itself. - */ - public ManagedClusterPodIdentity withNamespace(String namespace) { - this.namespace = namespace; - return this; - } - - /** - * Get the identity property: Information of the user assigned identity. - * - * @return the identity value. - */ - public UserAssignedIdentity identity() { - return this.identity; - } - - /** - * Set the identity property: Information of the user assigned identity. - * - * @param identity the identity value to set. - * @return the ManagedClusterPodIdentity object itself. - */ - public ManagedClusterPodIdentity withIdentity(UserAssignedIdentity identity) { - this.identity = identity; - return this; - } - - /** - * Get the provisioningState property: The current provisioning state of the pod identity. - * - * @return the provisioningState value. - */ - public ManagedClusterPodIdentityProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Get the provisioningInfo property: The provisioningInfo property. - * - * @return the provisioningInfo value. - */ - public ManagedClusterPodIdentityProvisioningInfo provisioningInfo() { - return this.provisioningInfo; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property name in model ManagedClusterPodIdentity")); - } - if (namespace() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property namespace in model ManagedClusterPodIdentity")); - } - if (identity() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property identity in model ManagedClusterPodIdentity")); - } else { - identity().validate(); - } - if (provisioningInfo() != null) { - provisioningInfo().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterPodIdentityException.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterPodIdentityException.java deleted file mode 100644 index b362c1672b7b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterPodIdentityException.java +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** The ManagedClusterPodIdentityException model. */ -@Fluent -public final class ManagedClusterPodIdentityException { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedClusterPodIdentityException.class); - - /* - * Name of the pod identity exception. - */ - @JsonProperty(value = "name", required = true) - private String name; - - /* - * Namespace of the pod identity exception. - */ - @JsonProperty(value = "namespace", required = true) - private String namespace; - - /* - * Pod labels to match. - */ - @JsonProperty(value = "podLabels", required = true) - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map podLabels; - - /** - * Get the name property: Name of the pod identity exception. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Name of the pod identity exception. - * - * @param name the name value to set. - * @return the ManagedClusterPodIdentityException object itself. - */ - public ManagedClusterPodIdentityException withName(String name) { - this.name = name; - return this; - } - - /** - * Get the namespace property: Namespace of the pod identity exception. - * - * @return the namespace value. - */ - public String namespace() { - return this.namespace; - } - - /** - * Set the namespace property: Namespace of the pod identity exception. - * - * @param namespace the namespace value to set. - * @return the ManagedClusterPodIdentityException object itself. - */ - public ManagedClusterPodIdentityException withNamespace(String namespace) { - this.namespace = namespace; - return this; - } - - /** - * Get the podLabels property: Pod labels to match. - * - * @return the podLabels value. - */ - public Map podLabels() { - return this.podLabels; - } - - /** - * Set the podLabels property: Pod labels to match. - * - * @param podLabels the podLabels value to set. - * @return the ManagedClusterPodIdentityException object itself. - */ - public ManagedClusterPodIdentityException withPodLabels(Map podLabels) { - this.podLabels = podLabels; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property name in model ManagedClusterPodIdentityException")); - } - if (namespace() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property namespace in model ManagedClusterPodIdentityException")); - } - if (podLabels() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property podLabels in model ManagedClusterPodIdentityException")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterPodIdentityProfile.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterPodIdentityProfile.java deleted file mode 100644 index ac0d12a2738b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterPodIdentityProfile.java +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The ManagedClusterPodIdentityProfile model. */ -@Fluent -public final class ManagedClusterPodIdentityProfile { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedClusterPodIdentityProfile.class); - - /* - * Whether the pod identity addon is enabled. - */ - @JsonProperty(value = "enabled") - private Boolean enabled; - - /* - * User assigned pod identity settings. - */ - @JsonProperty(value = "userAssignedIdentities") - private List userAssignedIdentities; - - /* - * User assigned pod identity exception settings. - */ - @JsonProperty(value = "userAssignedIdentityExceptions") - private List userAssignedIdentityExceptions; - - /** - * Get the enabled property: Whether the pod identity addon is enabled. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Whether the pod identity addon is enabled. - * - * @param enabled the enabled value to set. - * @return the ManagedClusterPodIdentityProfile object itself. - */ - public ManagedClusterPodIdentityProfile withEnabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the userAssignedIdentities property: User assigned pod identity settings. - * - * @return the userAssignedIdentities value. - */ - public List userAssignedIdentities() { - return this.userAssignedIdentities; - } - - /** - * Set the userAssignedIdentities property: User assigned pod identity settings. - * - * @param userAssignedIdentities the userAssignedIdentities value to set. - * @return the ManagedClusterPodIdentityProfile object itself. - */ - public ManagedClusterPodIdentityProfile withUserAssignedIdentities( - List userAssignedIdentities) { - this.userAssignedIdentities = userAssignedIdentities; - return this; - } - - /** - * Get the userAssignedIdentityExceptions property: User assigned pod identity exception settings. - * - * @return the userAssignedIdentityExceptions value. - */ - public List userAssignedIdentityExceptions() { - return this.userAssignedIdentityExceptions; - } - - /** - * Set the userAssignedIdentityExceptions property: User assigned pod identity exception settings. - * - * @param userAssignedIdentityExceptions the userAssignedIdentityExceptions value to set. - * @return the ManagedClusterPodIdentityProfile object itself. - */ - public ManagedClusterPodIdentityProfile withUserAssignedIdentityExceptions( - List userAssignedIdentityExceptions) { - this.userAssignedIdentityExceptions = userAssignedIdentityExceptions; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (userAssignedIdentities() != null) { - userAssignedIdentities().forEach(e -> e.validate()); - } - if (userAssignedIdentityExceptions() != null) { - userAssignedIdentityExceptions().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterPodIdentityProvisioningInfo.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterPodIdentityProvisioningInfo.java deleted file mode 100644 index 3f99704defb2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterPodIdentityProvisioningInfo.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.exception.ManagementError; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The ManagedClusterPodIdentityProvisioningInfo model. */ -@Fluent -public final class ManagedClusterPodIdentityProvisioningInfo { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedClusterPodIdentityProvisioningInfo.class); - - /* - * Pod identity assignment error (if any). - */ - @JsonProperty(value = "error") - private ManagementError error; - - /** - * Get the error property: Pod identity assignment error (if any). - * - * @return the error value. - */ - public ManagementError error() { - return this.error; - } - - /** - * Set the error property: Pod identity assignment error (if any). - * - * @param error the error value to set. - * @return the ManagedClusterPodIdentityProvisioningInfo object itself. - */ - public ManagedClusterPodIdentityProvisioningInfo withError(ManagementError error) { - this.error = error; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterPodIdentityProvisioningState.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterPodIdentityProvisioningState.java deleted file mode 100644 index 2a3a3836fbb3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterPodIdentityProvisioningState.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ManagedClusterPodIdentityProvisioningState. */ -public final class ManagedClusterPodIdentityProvisioningState - extends ExpandableStringEnum { - /** Static value Assigned for ManagedClusterPodIdentityProvisioningState. */ - public static final ManagedClusterPodIdentityProvisioningState ASSIGNED = fromString("Assigned"); - - /** Static value Updating for ManagedClusterPodIdentityProvisioningState. */ - public static final ManagedClusterPodIdentityProvisioningState UPDATING = fromString("Updating"); - - /** Static value Deleting for ManagedClusterPodIdentityProvisioningState. */ - public static final ManagedClusterPodIdentityProvisioningState DELETING = fromString("Deleting"); - - /** Static value Failed for ManagedClusterPodIdentityProvisioningState. */ - public static final ManagedClusterPodIdentityProvisioningState FAILED = fromString("Failed"); - - /** - * Creates or finds a ManagedClusterPodIdentityProvisioningState from its string representation. - * - * @param name a name to look for. - * @return the corresponding ManagedClusterPodIdentityProvisioningState. - */ - @JsonCreator - public static ManagedClusterPodIdentityProvisioningState fromString(String name) { - return fromString(name, ManagedClusterPodIdentityProvisioningState.class); - } - - /** @return known ManagedClusterPodIdentityProvisioningState values. */ - public static Collection values() { - return values(ManagedClusterPodIdentityProvisioningState.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterPoolUpgradeProfile.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterPoolUpgradeProfile.java deleted file mode 100644 index 386099c99510..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterPoolUpgradeProfile.java +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The list of available upgrade versions. */ -@Fluent -public final class ManagedClusterPoolUpgradeProfile { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedClusterPoolUpgradeProfile.class); - - /* - * Kubernetes version (major, minor, patch). - */ - @JsonProperty(value = "kubernetesVersion", required = true) - private String kubernetesVersion; - - /* - * Pool name. - */ - @JsonProperty(value = "name") - private String name; - - /* - * OsType to be used to specify os type. Choose from Linux and Windows. - * Default to Linux. - */ - @JsonProperty(value = "osType", required = true) - private OSType osType; - - /* - * List of orchestrator types and versions available for upgrade. - */ - @JsonProperty(value = "upgrades") - private List upgrades; - - /** - * Get the kubernetesVersion property: Kubernetes version (major, minor, patch). - * - * @return the kubernetesVersion value. - */ - public String kubernetesVersion() { - return this.kubernetesVersion; - } - - /** - * Set the kubernetesVersion property: Kubernetes version (major, minor, patch). - * - * @param kubernetesVersion the kubernetesVersion value to set. - * @return the ManagedClusterPoolUpgradeProfile object itself. - */ - public ManagedClusterPoolUpgradeProfile withKubernetesVersion(String kubernetesVersion) { - this.kubernetesVersion = kubernetesVersion; - return this; - } - - /** - * Get the name property: Pool name. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Pool name. - * - * @param name the name value to set. - * @return the ManagedClusterPoolUpgradeProfile object itself. - */ - public ManagedClusterPoolUpgradeProfile withName(String name) { - this.name = name; - return this; - } - - /** - * Get the osType property: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. - * - * @return the osType value. - */ - public OSType osType() { - return this.osType; - } - - /** - * Set the osType property: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. - * - * @param osType the osType value to set. - * @return the ManagedClusterPoolUpgradeProfile object itself. - */ - public ManagedClusterPoolUpgradeProfile withOsType(OSType osType) { - this.osType = osType; - return this; - } - - /** - * Get the upgrades property: List of orchestrator types and versions available for upgrade. - * - * @return the upgrades value. - */ - public List upgrades() { - return this.upgrades; - } - - /** - * Set the upgrades property: List of orchestrator types and versions available for upgrade. - * - * @param upgrades the upgrades value to set. - * @return the ManagedClusterPoolUpgradeProfile object itself. - */ - public ManagedClusterPoolUpgradeProfile withUpgrades(List upgrades) { - this.upgrades = upgrades; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (kubernetesVersion() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property kubernetesVersion in model ManagedClusterPoolUpgradeProfile")); - } - if (osType() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property osType in model ManagedClusterPoolUpgradeProfile")); - } - if (upgrades() != null) { - upgrades().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterPoolUpgradeProfileUpgradesItem.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterPoolUpgradeProfileUpgradesItem.java deleted file mode 100644 index 6dfe9b19ee82..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterPoolUpgradeProfileUpgradesItem.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The ManagedClusterPoolUpgradeProfileUpgradesItem model. */ -@Fluent -public final class ManagedClusterPoolUpgradeProfileUpgradesItem { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(ManagedClusterPoolUpgradeProfileUpgradesItem.class); - - /* - * Kubernetes version (major, minor, patch). - */ - @JsonProperty(value = "kubernetesVersion") - private String kubernetesVersion; - - /* - * Whether Kubernetes version is currently in preview. - */ - @JsonProperty(value = "isPreview") - private Boolean isPreview; - - /** - * Get the kubernetesVersion property: Kubernetes version (major, minor, patch). - * - * @return the kubernetesVersion value. - */ - public String kubernetesVersion() { - return this.kubernetesVersion; - } - - /** - * Set the kubernetesVersion property: Kubernetes version (major, minor, patch). - * - * @param kubernetesVersion the kubernetesVersion value to set. - * @return the ManagedClusterPoolUpgradeProfileUpgradesItem object itself. - */ - public ManagedClusterPoolUpgradeProfileUpgradesItem withKubernetesVersion(String kubernetesVersion) { - this.kubernetesVersion = kubernetesVersion; - return this; - } - - /** - * Get the isPreview property: Whether Kubernetes version is currently in preview. - * - * @return the isPreview value. - */ - public Boolean isPreview() { - return this.isPreview; - } - - /** - * Set the isPreview property: Whether Kubernetes version is currently in preview. - * - * @param isPreview the isPreview value to set. - * @return the ManagedClusterPoolUpgradeProfileUpgradesItem object itself. - */ - public ManagedClusterPoolUpgradeProfileUpgradesItem withIsPreview(Boolean isPreview) { - this.isPreview = isPreview; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterPropertiesAutoScalerProfile.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterPropertiesAutoScalerProfile.java deleted file mode 100644 index 56fb866af3d8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterPropertiesAutoScalerProfile.java +++ /dev/null @@ -1,441 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Parameters to be applied to the cluster-autoscaler when enabled. */ -@Fluent -public final class ManagedClusterPropertiesAutoScalerProfile { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedClusterPropertiesAutoScalerProfile.class); - - /* - * The balance-similar-node-groups property. - */ - @JsonProperty(value = "balance-similar-node-groups") - private String balanceSimilarNodeGroups; - - /* - * The expander property. - */ - @JsonProperty(value = "expander") - private Expander expander; - - /* - * The max-empty-bulk-delete property. - */ - @JsonProperty(value = "max-empty-bulk-delete") - private String maxEmptyBulkDelete; - - /* - * The max-graceful-termination-sec property. - */ - @JsonProperty(value = "max-graceful-termination-sec") - private String maxGracefulTerminationSec; - - /* - * The max-total-unready-percentage property. - */ - @JsonProperty(value = "max-total-unready-percentage") - private String maxTotalUnreadyPercentage; - - /* - * The new-pod-scale-up-delay property. - */ - @JsonProperty(value = "new-pod-scale-up-delay") - private String newPodScaleUpDelay; - - /* - * The ok-total-unready-count property. - */ - @JsonProperty(value = "ok-total-unready-count") - private String okTotalUnreadyCount; - - /* - * The scan-interval property. - */ - @JsonProperty(value = "scan-interval") - private String scanInterval; - - /* - * The scale-down-delay-after-add property. - */ - @JsonProperty(value = "scale-down-delay-after-add") - private String scaleDownDelayAfterAdd; - - /* - * The scale-down-delay-after-delete property. - */ - @JsonProperty(value = "scale-down-delay-after-delete") - private String scaleDownDelayAfterDelete; - - /* - * The scale-down-delay-after-failure property. - */ - @JsonProperty(value = "scale-down-delay-after-failure") - private String scaleDownDelayAfterFailure; - - /* - * The scale-down-unneeded-time property. - */ - @JsonProperty(value = "scale-down-unneeded-time") - private String scaleDownUnneededTime; - - /* - * The scale-down-unready-time property. - */ - @JsonProperty(value = "scale-down-unready-time") - private String scaleDownUnreadyTime; - - /* - * The scale-down-utilization-threshold property. - */ - @JsonProperty(value = "scale-down-utilization-threshold") - private String scaleDownUtilizationThreshold; - - /* - * The skip-nodes-with-local-storage property. - */ - @JsonProperty(value = "skip-nodes-with-local-storage") - private String skipNodesWithLocalStorage; - - /* - * The skip-nodes-with-system-pods property. - */ - @JsonProperty(value = "skip-nodes-with-system-pods") - private String skipNodesWithSystemPods; - - /** - * Get the balanceSimilarNodeGroups property: The balance-similar-node-groups property. - * - * @return the balanceSimilarNodeGroups value. - */ - public String balanceSimilarNodeGroups() { - return this.balanceSimilarNodeGroups; - } - - /** - * Set the balanceSimilarNodeGroups property: The balance-similar-node-groups property. - * - * @param balanceSimilarNodeGroups the balanceSimilarNodeGroups value to set. - * @return the ManagedClusterPropertiesAutoScalerProfile object itself. - */ - public ManagedClusterPropertiesAutoScalerProfile withBalanceSimilarNodeGroups(String balanceSimilarNodeGroups) { - this.balanceSimilarNodeGroups = balanceSimilarNodeGroups; - return this; - } - - /** - * Get the expander property: The expander property. - * - * @return the expander value. - */ - public Expander expander() { - return this.expander; - } - - /** - * Set the expander property: The expander property. - * - * @param expander the expander value to set. - * @return the ManagedClusterPropertiesAutoScalerProfile object itself. - */ - public ManagedClusterPropertiesAutoScalerProfile withExpander(Expander expander) { - this.expander = expander; - return this; - } - - /** - * Get the maxEmptyBulkDelete property: The max-empty-bulk-delete property. - * - * @return the maxEmptyBulkDelete value. - */ - public String maxEmptyBulkDelete() { - return this.maxEmptyBulkDelete; - } - - /** - * Set the maxEmptyBulkDelete property: The max-empty-bulk-delete property. - * - * @param maxEmptyBulkDelete the maxEmptyBulkDelete value to set. - * @return the ManagedClusterPropertiesAutoScalerProfile object itself. - */ - public ManagedClusterPropertiesAutoScalerProfile withMaxEmptyBulkDelete(String maxEmptyBulkDelete) { - this.maxEmptyBulkDelete = maxEmptyBulkDelete; - return this; - } - - /** - * Get the maxGracefulTerminationSec property: The max-graceful-termination-sec property. - * - * @return the maxGracefulTerminationSec value. - */ - public String maxGracefulTerminationSec() { - return this.maxGracefulTerminationSec; - } - - /** - * Set the maxGracefulTerminationSec property: The max-graceful-termination-sec property. - * - * @param maxGracefulTerminationSec the maxGracefulTerminationSec value to set. - * @return the ManagedClusterPropertiesAutoScalerProfile object itself. - */ - public ManagedClusterPropertiesAutoScalerProfile withMaxGracefulTerminationSec(String maxGracefulTerminationSec) { - this.maxGracefulTerminationSec = maxGracefulTerminationSec; - return this; - } - - /** - * Get the maxTotalUnreadyPercentage property: The max-total-unready-percentage property. - * - * @return the maxTotalUnreadyPercentage value. - */ - public String maxTotalUnreadyPercentage() { - return this.maxTotalUnreadyPercentage; - } - - /** - * Set the maxTotalUnreadyPercentage property: The max-total-unready-percentage property. - * - * @param maxTotalUnreadyPercentage the maxTotalUnreadyPercentage value to set. - * @return the ManagedClusterPropertiesAutoScalerProfile object itself. - */ - public ManagedClusterPropertiesAutoScalerProfile withMaxTotalUnreadyPercentage(String maxTotalUnreadyPercentage) { - this.maxTotalUnreadyPercentage = maxTotalUnreadyPercentage; - return this; - } - - /** - * Get the newPodScaleUpDelay property: The new-pod-scale-up-delay property. - * - * @return the newPodScaleUpDelay value. - */ - public String newPodScaleUpDelay() { - return this.newPodScaleUpDelay; - } - - /** - * Set the newPodScaleUpDelay property: The new-pod-scale-up-delay property. - * - * @param newPodScaleUpDelay the newPodScaleUpDelay value to set. - * @return the ManagedClusterPropertiesAutoScalerProfile object itself. - */ - public ManagedClusterPropertiesAutoScalerProfile withNewPodScaleUpDelay(String newPodScaleUpDelay) { - this.newPodScaleUpDelay = newPodScaleUpDelay; - return this; - } - - /** - * Get the okTotalUnreadyCount property: The ok-total-unready-count property. - * - * @return the okTotalUnreadyCount value. - */ - public String okTotalUnreadyCount() { - return this.okTotalUnreadyCount; - } - - /** - * Set the okTotalUnreadyCount property: The ok-total-unready-count property. - * - * @param okTotalUnreadyCount the okTotalUnreadyCount value to set. - * @return the ManagedClusterPropertiesAutoScalerProfile object itself. - */ - public ManagedClusterPropertiesAutoScalerProfile withOkTotalUnreadyCount(String okTotalUnreadyCount) { - this.okTotalUnreadyCount = okTotalUnreadyCount; - return this; - } - - /** - * Get the scanInterval property: The scan-interval property. - * - * @return the scanInterval value. - */ - public String scanInterval() { - return this.scanInterval; - } - - /** - * Set the scanInterval property: The scan-interval property. - * - * @param scanInterval the scanInterval value to set. - * @return the ManagedClusterPropertiesAutoScalerProfile object itself. - */ - public ManagedClusterPropertiesAutoScalerProfile withScanInterval(String scanInterval) { - this.scanInterval = scanInterval; - return this; - } - - /** - * Get the scaleDownDelayAfterAdd property: The scale-down-delay-after-add property. - * - * @return the scaleDownDelayAfterAdd value. - */ - public String scaleDownDelayAfterAdd() { - return this.scaleDownDelayAfterAdd; - } - - /** - * Set the scaleDownDelayAfterAdd property: The scale-down-delay-after-add property. - * - * @param scaleDownDelayAfterAdd the scaleDownDelayAfterAdd value to set. - * @return the ManagedClusterPropertiesAutoScalerProfile object itself. - */ - public ManagedClusterPropertiesAutoScalerProfile withScaleDownDelayAfterAdd(String scaleDownDelayAfterAdd) { - this.scaleDownDelayAfterAdd = scaleDownDelayAfterAdd; - return this; - } - - /** - * Get the scaleDownDelayAfterDelete property: The scale-down-delay-after-delete property. - * - * @return the scaleDownDelayAfterDelete value. - */ - public String scaleDownDelayAfterDelete() { - return this.scaleDownDelayAfterDelete; - } - - /** - * Set the scaleDownDelayAfterDelete property: The scale-down-delay-after-delete property. - * - * @param scaleDownDelayAfterDelete the scaleDownDelayAfterDelete value to set. - * @return the ManagedClusterPropertiesAutoScalerProfile object itself. - */ - public ManagedClusterPropertiesAutoScalerProfile withScaleDownDelayAfterDelete(String scaleDownDelayAfterDelete) { - this.scaleDownDelayAfterDelete = scaleDownDelayAfterDelete; - return this; - } - - /** - * Get the scaleDownDelayAfterFailure property: The scale-down-delay-after-failure property. - * - * @return the scaleDownDelayAfterFailure value. - */ - public String scaleDownDelayAfterFailure() { - return this.scaleDownDelayAfterFailure; - } - - /** - * Set the scaleDownDelayAfterFailure property: The scale-down-delay-after-failure property. - * - * @param scaleDownDelayAfterFailure the scaleDownDelayAfterFailure value to set. - * @return the ManagedClusterPropertiesAutoScalerProfile object itself. - */ - public ManagedClusterPropertiesAutoScalerProfile withScaleDownDelayAfterFailure(String scaleDownDelayAfterFailure) { - this.scaleDownDelayAfterFailure = scaleDownDelayAfterFailure; - return this; - } - - /** - * Get the scaleDownUnneededTime property: The scale-down-unneeded-time property. - * - * @return the scaleDownUnneededTime value. - */ - public String scaleDownUnneededTime() { - return this.scaleDownUnneededTime; - } - - /** - * Set the scaleDownUnneededTime property: The scale-down-unneeded-time property. - * - * @param scaleDownUnneededTime the scaleDownUnneededTime value to set. - * @return the ManagedClusterPropertiesAutoScalerProfile object itself. - */ - public ManagedClusterPropertiesAutoScalerProfile withScaleDownUnneededTime(String scaleDownUnneededTime) { - this.scaleDownUnneededTime = scaleDownUnneededTime; - return this; - } - - /** - * Get the scaleDownUnreadyTime property: The scale-down-unready-time property. - * - * @return the scaleDownUnreadyTime value. - */ - public String scaleDownUnreadyTime() { - return this.scaleDownUnreadyTime; - } - - /** - * Set the scaleDownUnreadyTime property: The scale-down-unready-time property. - * - * @param scaleDownUnreadyTime the scaleDownUnreadyTime value to set. - * @return the ManagedClusterPropertiesAutoScalerProfile object itself. - */ - public ManagedClusterPropertiesAutoScalerProfile withScaleDownUnreadyTime(String scaleDownUnreadyTime) { - this.scaleDownUnreadyTime = scaleDownUnreadyTime; - return this; - } - - /** - * Get the scaleDownUtilizationThreshold property: The scale-down-utilization-threshold property. - * - * @return the scaleDownUtilizationThreshold value. - */ - public String scaleDownUtilizationThreshold() { - return this.scaleDownUtilizationThreshold; - } - - /** - * Set the scaleDownUtilizationThreshold property: The scale-down-utilization-threshold property. - * - * @param scaleDownUtilizationThreshold the scaleDownUtilizationThreshold value to set. - * @return the ManagedClusterPropertiesAutoScalerProfile object itself. - */ - public ManagedClusterPropertiesAutoScalerProfile withScaleDownUtilizationThreshold( - String scaleDownUtilizationThreshold) { - this.scaleDownUtilizationThreshold = scaleDownUtilizationThreshold; - return this; - } - - /** - * Get the skipNodesWithLocalStorage property: The skip-nodes-with-local-storage property. - * - * @return the skipNodesWithLocalStorage value. - */ - public String skipNodesWithLocalStorage() { - return this.skipNodesWithLocalStorage; - } - - /** - * Set the skipNodesWithLocalStorage property: The skip-nodes-with-local-storage property. - * - * @param skipNodesWithLocalStorage the skipNodesWithLocalStorage value to set. - * @return the ManagedClusterPropertiesAutoScalerProfile object itself. - */ - public ManagedClusterPropertiesAutoScalerProfile withSkipNodesWithLocalStorage(String skipNodesWithLocalStorage) { - this.skipNodesWithLocalStorage = skipNodesWithLocalStorage; - return this; - } - - /** - * Get the skipNodesWithSystemPods property: The skip-nodes-with-system-pods property. - * - * @return the skipNodesWithSystemPods value. - */ - public String skipNodesWithSystemPods() { - return this.skipNodesWithSystemPods; - } - - /** - * Set the skipNodesWithSystemPods property: The skip-nodes-with-system-pods property. - * - * @param skipNodesWithSystemPods the skipNodesWithSystemPods value to set. - * @return the ManagedClusterPropertiesAutoScalerProfile object itself. - */ - public ManagedClusterPropertiesAutoScalerProfile withSkipNodesWithSystemPods(String skipNodesWithSystemPods) { - this.skipNodesWithSystemPods = skipNodesWithSystemPods; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterPropertiesIdentityProfile.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterPropertiesIdentityProfile.java deleted file mode 100644 index 941cfa407037..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterPropertiesIdentityProfile.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; - -/** The ManagedClusterPropertiesIdentityProfile model. */ -@Fluent -public final class ManagedClusterPropertiesIdentityProfile extends UserAssignedIdentity { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedClusterPropertiesIdentityProfile.class); - - /** {@inheritDoc} */ - @Override - public ManagedClusterPropertiesIdentityProfile withResourceId(String resourceId) { - super.withResourceId(resourceId); - return this; - } - - /** {@inheritDoc} */ - @Override - public ManagedClusterPropertiesIdentityProfile withClientId(String clientId) { - super.withClientId(clientId); - return this; - } - - /** {@inheritDoc} */ - @Override - public ManagedClusterPropertiesIdentityProfile withObjectId(String objectId) { - super.withObjectId(objectId); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterServicePrincipalProfile.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterServicePrincipalProfile.java deleted file mode 100644 index 26ba4daad7a7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterServicePrincipalProfile.java +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Information about a service principal identity for the cluster to use for manipulating Azure APIs. */ -@Fluent -public final class ManagedClusterServicePrincipalProfile { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedClusterServicePrincipalProfile.class); - - /* - * The ID for the service principal. - */ - @JsonProperty(value = "clientId", required = true) - private String clientId; - - /* - * The secret password associated with the service principal in plain text. - */ - @JsonProperty(value = "secret") - private String secret; - - /** - * Get the clientId property: The ID for the service principal. - * - * @return the clientId value. - */ - public String clientId() { - return this.clientId; - } - - /** - * Set the clientId property: The ID for the service principal. - * - * @param clientId the clientId value to set. - * @return the ManagedClusterServicePrincipalProfile object itself. - */ - public ManagedClusterServicePrincipalProfile withClientId(String clientId) { - this.clientId = clientId; - return this; - } - - /** - * Get the secret property: The secret password associated with the service principal in plain text. - * - * @return the secret value. - */ - public String secret() { - return this.secret; - } - - /** - * Set the secret property: The secret password associated with the service principal in plain text. - * - * @param secret the secret value to set. - * @return the ManagedClusterServicePrincipalProfile object itself. - */ - public ManagedClusterServicePrincipalProfile withSecret(String secret) { - this.secret = secret; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (clientId() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property clientId in model ManagedClusterServicePrincipalProfile")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterSku.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterSku.java deleted file mode 100644 index 0ce9bd8afb4b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterSku.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The ManagedClusterSku model. */ -@Fluent -public final class ManagedClusterSku { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedClusterSku.class); - - /* - * Name of a managed cluster SKU. - */ - @JsonProperty(value = "name") - private ManagedClusterSkuName name; - - /* - * Tier of a managed cluster SKU. - */ - @JsonProperty(value = "tier") - private ManagedClusterSkuTier tier; - - /** - * Get the name property: Name of a managed cluster SKU. - * - * @return the name value. - */ - public ManagedClusterSkuName name() { - return this.name; - } - - /** - * Set the name property: Name of a managed cluster SKU. - * - * @param name the name value to set. - * @return the ManagedClusterSku object itself. - */ - public ManagedClusterSku withName(ManagedClusterSkuName name) { - this.name = name; - return this; - } - - /** - * Get the tier property: Tier of a managed cluster SKU. - * - * @return the tier value. - */ - public ManagedClusterSkuTier tier() { - return this.tier; - } - - /** - * Set the tier property: Tier of a managed cluster SKU. - * - * @param tier the tier value to set. - * @return the ManagedClusterSku object itself. - */ - public ManagedClusterSku withTier(ManagedClusterSkuTier tier) { - this.tier = tier; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterSkuName.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterSkuName.java deleted file mode 100644 index 5cf140d520f7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterSkuName.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ManagedClusterSkuName. */ -public final class ManagedClusterSkuName extends ExpandableStringEnum { - /** Static value Basic for ManagedClusterSkuName. */ - public static final ManagedClusterSkuName BASIC = fromString("Basic"); - - /** - * Creates or finds a ManagedClusterSkuName from its string representation. - * - * @param name a name to look for. - * @return the corresponding ManagedClusterSkuName. - */ - @JsonCreator - public static ManagedClusterSkuName fromString(String name) { - return fromString(name, ManagedClusterSkuName.class); - } - - /** @return known ManagedClusterSkuName values. */ - public static Collection values() { - return values(ManagedClusterSkuName.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterSkuTier.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterSkuTier.java deleted file mode 100644 index c26b89b75415..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterSkuTier.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ManagedClusterSkuTier. */ -public final class ManagedClusterSkuTier extends ExpandableStringEnum { - /** Static value Paid for ManagedClusterSkuTier. */ - public static final ManagedClusterSkuTier PAID = fromString("Paid"); - - /** Static value Free for ManagedClusterSkuTier. */ - public static final ManagedClusterSkuTier FREE = fromString("Free"); - - /** - * Creates or finds a ManagedClusterSkuTier from its string representation. - * - * @param name a name to look for. - * @return the corresponding ManagedClusterSkuTier. - */ - @JsonCreator - public static ManagedClusterSkuTier fromString(String name) { - return fromString(name, ManagedClusterSkuTier.class); - } - - /** @return known ManagedClusterSkuTier values. */ - public static Collection values() { - return values(ManagedClusterSkuTier.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterWindowsProfile.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterWindowsProfile.java deleted file mode 100644 index b0a9755e6b2b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterWindowsProfile.java +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Profile for Windows VMs in the container service cluster. */ -@Fluent -public final class ManagedClusterWindowsProfile { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedClusterWindowsProfile.class); - - /* - * Specifies the name of the administrator account.

    - * **restriction:** Cannot end in "."

    **Disallowed values:** - * "administrator", "admin", "user", "user1", "test", "user2", "test1", - * "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", - * "aspnet", "backup", "console", "david", "guest", "john", "owner", - * "root", "server", "sql", "support", "support_388945a0", "sys", "test2", - * "test3", "user4", "user5".

    **Minimum-length:** 1 character - *

    **Max-length:** 20 characters - */ - @JsonProperty(value = "adminUsername", required = true) - private String adminUsername; - - /* - * Specifies the password of the administrator account.

    - * **Minimum-length:** 8 characters

    **Max-length:** 123 characters - *

    **Complexity requirements:** 3 out of 4 conditions below need - * to be fulfilled
    Has lower characters
    Has upper characters
    - * Has a digit
    Has a special character (Regex match [\W_])

    - * **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", - * "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", - * "iloveyou!" - */ - @JsonProperty(value = "adminPassword") - private String adminPassword; - - /* - * The licenseType to use for Windows VMs. Windows_Server is used to enable - * Azure Hybrid User Benefits for Windows VMs. - */ - @JsonProperty(value = "licenseType") - private LicenseType licenseType; - - /** - * Get the adminUsername property: Specifies the name of the administrator account. <br><br> - * **restriction:** Cannot end in "." <br><br> **Disallowed values:** "administrator", "admin", "user", - * "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", - * "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", - * "sys", "test2", "test3", "user4", "user5". <br><br> **Minimum-length:** 1 character - * <br><br> **Max-length:** 20 characters. - * - * @return the adminUsername value. - */ - public String adminUsername() { - return this.adminUsername; - } - - /** - * Set the adminUsername property: Specifies the name of the administrator account. <br><br> - * **restriction:** Cannot end in "." <br><br> **Disallowed values:** "administrator", "admin", "user", - * "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", - * "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", - * "sys", "test2", "test3", "user4", "user5". <br><br> **Minimum-length:** 1 character - * <br><br> **Max-length:** 20 characters. - * - * @param adminUsername the adminUsername value to set. - * @return the ManagedClusterWindowsProfile object itself. - */ - public ManagedClusterWindowsProfile withAdminUsername(String adminUsername) { - this.adminUsername = adminUsername; - return this; - } - - /** - * Get the adminPassword property: Specifies the password of the administrator account. <br><br> - * **Minimum-length:** 8 characters <br><br> **Max-length:** 123 characters <br><br> - * **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled <br> Has lower characters - * <br>Has upper characters <br> Has a digit <br> Has a special character (Regex match [\W_]) - * <br><br> **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", - * "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". - * - * @return the adminPassword value. - */ - public String adminPassword() { - return this.adminPassword; - } - - /** - * Set the adminPassword property: Specifies the password of the administrator account. <br><br> - * **Minimum-length:** 8 characters <br><br> **Max-length:** 123 characters <br><br> - * **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled <br> Has lower characters - * <br>Has upper characters <br> Has a digit <br> Has a special character (Regex match [\W_]) - * <br><br> **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", - * "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". - * - * @param adminPassword the adminPassword value to set. - * @return the ManagedClusterWindowsProfile object itself. - */ - public ManagedClusterWindowsProfile withAdminPassword(String adminPassword) { - this.adminPassword = adminPassword; - return this; - } - - /** - * Get the licenseType property: The licenseType to use for Windows VMs. Windows_Server is used to enable Azure - * Hybrid User Benefits for Windows VMs. - * - * @return the licenseType value. - */ - public LicenseType licenseType() { - return this.licenseType; - } - - /** - * Set the licenseType property: The licenseType to use for Windows VMs. Windows_Server is used to enable Azure - * Hybrid User Benefits for Windows VMs. - * - * @param licenseType the licenseType value to set. - * @return the ManagedClusterWindowsProfile object itself. - */ - public ManagedClusterWindowsProfile withLicenseType(LicenseType licenseType) { - this.licenseType = licenseType; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (adminUsername() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property adminUsername in model ManagedClusterWindowsProfile")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/NetworkMode.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/NetworkMode.java deleted file mode 100644 index 413f7f7847c8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/NetworkMode.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for NetworkMode. */ -public final class NetworkMode extends ExpandableStringEnum { - /** Static value transparent for NetworkMode. */ - public static final NetworkMode TRANSPARENT = fromString("transparent"); - - /** Static value bridge for NetworkMode. */ - public static final NetworkMode BRIDGE = fromString("bridge"); - - /** - * Creates or finds a NetworkMode from its string representation. - * - * @param name a name to look for. - * @return the corresponding NetworkMode. - */ - @JsonCreator - public static NetworkMode fromString(String name) { - return fromString(name, NetworkMode.class); - } - - /** @return known NetworkMode values. */ - public static Collection values() { - return values(NetworkMode.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/NetworkPlugin.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/NetworkPlugin.java deleted file mode 100644 index ac1c710536e9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/NetworkPlugin.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for NetworkPlugin. */ -public final class NetworkPlugin extends ExpandableStringEnum { - /** Static value azure for NetworkPlugin. */ - public static final NetworkPlugin AZURE = fromString("azure"); - - /** Static value kubenet for NetworkPlugin. */ - public static final NetworkPlugin KUBENET = fromString("kubenet"); - - /** - * Creates or finds a NetworkPlugin from its string representation. - * - * @param name a name to look for. - * @return the corresponding NetworkPlugin. - */ - @JsonCreator - public static NetworkPlugin fromString(String name) { - return fromString(name, NetworkPlugin.class); - } - - /** @return known NetworkPlugin values. */ - public static Collection values() { - return values(NetworkPlugin.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/NetworkPolicy.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/NetworkPolicy.java deleted file mode 100644 index 589aa7b6efce..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/NetworkPolicy.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for NetworkPolicy. */ -public final class NetworkPolicy extends ExpandableStringEnum { - /** Static value calico for NetworkPolicy. */ - public static final NetworkPolicy CALICO = fromString("calico"); - - /** Static value azure for NetworkPolicy. */ - public static final NetworkPolicy AZURE = fromString("azure"); - - /** - * Creates or finds a NetworkPolicy from its string representation. - * - * @param name a name to look for. - * @return the corresponding NetworkPolicy. - */ - @JsonCreator - public static NetworkPolicy fromString(String name) { - return fromString(name, NetworkPolicy.class); - } - - /** @return known NetworkPolicy values. */ - public static Collection values() { - return values(NetworkPolicy.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/NetworkProfile.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/NetworkProfile.java deleted file mode 100644 index 51941493cacd..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/NetworkProfile.java +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Represents the OpenShift networking configuration. */ -@Fluent -public final class NetworkProfile { - @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkProfile.class); - - /* - * CIDR for the OpenShift Vnet. - */ - @JsonProperty(value = "vnetCidr") - private String vnetCidr; - - /* - * CIDR of the Vnet to peer. - */ - @JsonProperty(value = "peerVnetId") - private String peerVnetId; - - /* - * ID of the Vnet created for OSA cluster. - */ - @JsonProperty(value = "vnetId") - private String vnetId; - - /** - * Get the vnetCidr property: CIDR for the OpenShift Vnet. - * - * @return the vnetCidr value. - */ - public String vnetCidr() { - return this.vnetCidr; - } - - /** - * Set the vnetCidr property: CIDR for the OpenShift Vnet. - * - * @param vnetCidr the vnetCidr value to set. - * @return the NetworkProfile object itself. - */ - public NetworkProfile withVnetCidr(String vnetCidr) { - this.vnetCidr = vnetCidr; - return this; - } - - /** - * Get the peerVnetId property: CIDR of the Vnet to peer. - * - * @return the peerVnetId value. - */ - public String peerVnetId() { - return this.peerVnetId; - } - - /** - * Set the peerVnetId property: CIDR of the Vnet to peer. - * - * @param peerVnetId the peerVnetId value to set. - * @return the NetworkProfile object itself. - */ - public NetworkProfile withPeerVnetId(String peerVnetId) { - this.peerVnetId = peerVnetId; - return this; - } - - /** - * Get the vnetId property: ID of the Vnet created for OSA cluster. - * - * @return the vnetId value. - */ - public String vnetId() { - return this.vnetId; - } - - /** - * Set the vnetId property: ID of the Vnet created for OSA cluster. - * - * @param vnetId the vnetId value to set. - * @return the NetworkProfile object itself. - */ - public NetworkProfile withVnetId(String vnetId) { - this.vnetId = vnetId; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/OSDiskType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/OSDiskType.java deleted file mode 100644 index ed8f2d97a17f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/OSDiskType.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for OSDiskType. */ -public final class OSDiskType extends ExpandableStringEnum { - /** Static value Managed for OSDiskType. */ - public static final OSDiskType MANAGED = fromString("Managed"); - - /** Static value Ephemeral for OSDiskType. */ - public static final OSDiskType EPHEMERAL = fromString("Ephemeral"); - - /** - * Creates or finds a OSDiskType from its string representation. - * - * @param name a name to look for. - * @return the corresponding OSDiskType. - */ - @JsonCreator - public static OSDiskType fromString(String name) { - return fromString(name, OSDiskType.class); - } - - /** @return known OSDiskType values. */ - public static Collection values() { - return values(OSDiskType.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/OSType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/OSType.java deleted file mode 100644 index 32f43df296f4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/OSType.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for OSType. */ -public final class OSType extends ExpandableStringEnum { - /** Static value Linux for OSType. */ - public static final OSType LINUX = fromString("Linux"); - - /** Static value Windows for OSType. */ - public static final OSType WINDOWS = fromString("Windows"); - - /** - * Creates or finds a OSType from its string representation. - * - * @param name a name to look for. - * @return the corresponding OSType. - */ - @JsonCreator - public static OSType fromString(String name) { - return fromString(name, OSType.class); - } - - /** @return known OSType values. */ - public static Collection values() { - return values(OSType.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/OpenShiftAgentPoolProfileRole.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/OpenShiftAgentPoolProfileRole.java deleted file mode 100644 index 30cf8ce70ab4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/OpenShiftAgentPoolProfileRole.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for OpenShiftAgentPoolProfileRole. */ -public final class OpenShiftAgentPoolProfileRole extends ExpandableStringEnum { - /** Static value compute for OpenShiftAgentPoolProfileRole. */ - public static final OpenShiftAgentPoolProfileRole COMPUTE = fromString("compute"); - - /** Static value infra for OpenShiftAgentPoolProfileRole. */ - public static final OpenShiftAgentPoolProfileRole INFRA = fromString("infra"); - - /** - * Creates or finds a OpenShiftAgentPoolProfileRole from its string representation. - * - * @param name a name to look for. - * @return the corresponding OpenShiftAgentPoolProfileRole. - */ - @JsonCreator - public static OpenShiftAgentPoolProfileRole fromString(String name) { - return fromString(name, OpenShiftAgentPoolProfileRole.class); - } - - /** @return known OpenShiftAgentPoolProfileRole values. */ - public static Collection values() { - return values(OpenShiftAgentPoolProfileRole.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/OpenShiftContainerServiceVMSize.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/OpenShiftContainerServiceVMSize.java deleted file mode 100644 index db86bf626a68..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/OpenShiftContainerServiceVMSize.java +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for OpenShiftContainerServiceVMSize. */ -public final class OpenShiftContainerServiceVMSize extends ExpandableStringEnum { - /** Static value Standard_D2s_v3 for OpenShiftContainerServiceVMSize. */ - public static final OpenShiftContainerServiceVMSize STANDARD_D2S_V3 = fromString("Standard_D2s_v3"); - - /** Static value Standard_D4s_v3 for OpenShiftContainerServiceVMSize. */ - public static final OpenShiftContainerServiceVMSize STANDARD_D4S_V3 = fromString("Standard_D4s_v3"); - - /** Static value Standard_D8s_v3 for OpenShiftContainerServiceVMSize. */ - public static final OpenShiftContainerServiceVMSize STANDARD_D8S_V3 = fromString("Standard_D8s_v3"); - - /** Static value Standard_D16s_v3 for OpenShiftContainerServiceVMSize. */ - public static final OpenShiftContainerServiceVMSize STANDARD_D16S_V3 = fromString("Standard_D16s_v3"); - - /** Static value Standard_D32s_v3 for OpenShiftContainerServiceVMSize. */ - public static final OpenShiftContainerServiceVMSize STANDARD_D32S_V3 = fromString("Standard_D32s_v3"); - - /** Static value Standard_D64s_v3 for OpenShiftContainerServiceVMSize. */ - public static final OpenShiftContainerServiceVMSize STANDARD_D64S_V3 = fromString("Standard_D64s_v3"); - - /** Static value Standard_DS4_v2 for OpenShiftContainerServiceVMSize. */ - public static final OpenShiftContainerServiceVMSize STANDARD_DS4_V2 = fromString("Standard_DS4_v2"); - - /** Static value Standard_DS5_v2 for OpenShiftContainerServiceVMSize. */ - public static final OpenShiftContainerServiceVMSize STANDARD_DS5_V2 = fromString("Standard_DS5_v2"); - - /** Static value Standard_F8s_v2 for OpenShiftContainerServiceVMSize. */ - public static final OpenShiftContainerServiceVMSize STANDARD_F8S_V2 = fromString("Standard_F8s_v2"); - - /** Static value Standard_F16s_v2 for OpenShiftContainerServiceVMSize. */ - public static final OpenShiftContainerServiceVMSize STANDARD_F16S_V2 = fromString("Standard_F16s_v2"); - - /** Static value Standard_F32s_v2 for OpenShiftContainerServiceVMSize. */ - public static final OpenShiftContainerServiceVMSize STANDARD_F32S_V2 = fromString("Standard_F32s_v2"); - - /** Static value Standard_F64s_v2 for OpenShiftContainerServiceVMSize. */ - public static final OpenShiftContainerServiceVMSize STANDARD_F64S_V2 = fromString("Standard_F64s_v2"); - - /** Static value Standard_F72s_v2 for OpenShiftContainerServiceVMSize. */ - public static final OpenShiftContainerServiceVMSize STANDARD_F72S_V2 = fromString("Standard_F72s_v2"); - - /** Static value Standard_F8s for OpenShiftContainerServiceVMSize. */ - public static final OpenShiftContainerServiceVMSize STANDARD_F8S = fromString("Standard_F8s"); - - /** Static value Standard_F16s for OpenShiftContainerServiceVMSize. */ - public static final OpenShiftContainerServiceVMSize STANDARD_F16S = fromString("Standard_F16s"); - - /** Static value Standard_E4s_v3 for OpenShiftContainerServiceVMSize. */ - public static final OpenShiftContainerServiceVMSize STANDARD_E4S_V3 = fromString("Standard_E4s_v3"); - - /** Static value Standard_E8s_v3 for OpenShiftContainerServiceVMSize. */ - public static final OpenShiftContainerServiceVMSize STANDARD_E8S_V3 = fromString("Standard_E8s_v3"); - - /** Static value Standard_E16s_v3 for OpenShiftContainerServiceVMSize. */ - public static final OpenShiftContainerServiceVMSize STANDARD_E16S_V3 = fromString("Standard_E16s_v3"); - - /** Static value Standard_E20s_v3 for OpenShiftContainerServiceVMSize. */ - public static final OpenShiftContainerServiceVMSize STANDARD_E20S_V3 = fromString("Standard_E20s_v3"); - - /** Static value Standard_E32s_v3 for OpenShiftContainerServiceVMSize. */ - public static final OpenShiftContainerServiceVMSize STANDARD_E32S_V3 = fromString("Standard_E32s_v3"); - - /** Static value Standard_E64s_v3 for OpenShiftContainerServiceVMSize. */ - public static final OpenShiftContainerServiceVMSize STANDARD_E64S_V3 = fromString("Standard_E64s_v3"); - - /** Static value Standard_GS2 for OpenShiftContainerServiceVMSize. */ - public static final OpenShiftContainerServiceVMSize STANDARD_GS2 = fromString("Standard_GS2"); - - /** Static value Standard_GS3 for OpenShiftContainerServiceVMSize. */ - public static final OpenShiftContainerServiceVMSize STANDARD_GS3 = fromString("Standard_GS3"); - - /** Static value Standard_GS4 for OpenShiftContainerServiceVMSize. */ - public static final OpenShiftContainerServiceVMSize STANDARD_GS4 = fromString("Standard_GS4"); - - /** Static value Standard_GS5 for OpenShiftContainerServiceVMSize. */ - public static final OpenShiftContainerServiceVMSize STANDARD_GS5 = fromString("Standard_GS5"); - - /** Static value Standard_DS12_v2 for OpenShiftContainerServiceVMSize. */ - public static final OpenShiftContainerServiceVMSize STANDARD_DS12_V2 = fromString("Standard_DS12_v2"); - - /** Static value Standard_DS13_v2 for OpenShiftContainerServiceVMSize. */ - public static final OpenShiftContainerServiceVMSize STANDARD_DS13_V2 = fromString("Standard_DS13_v2"); - - /** Static value Standard_DS14_v2 for OpenShiftContainerServiceVMSize. */ - public static final OpenShiftContainerServiceVMSize STANDARD_DS14_V2 = fromString("Standard_DS14_v2"); - - /** Static value Standard_DS15_v2 for OpenShiftContainerServiceVMSize. */ - public static final OpenShiftContainerServiceVMSize STANDARD_DS15_V2 = fromString("Standard_DS15_v2"); - - /** Static value Standard_L4s for OpenShiftContainerServiceVMSize. */ - public static final OpenShiftContainerServiceVMSize STANDARD_L4S = fromString("Standard_L4s"); - - /** Static value Standard_L8s for OpenShiftContainerServiceVMSize. */ - public static final OpenShiftContainerServiceVMSize STANDARD_L8S = fromString("Standard_L8s"); - - /** Static value Standard_L16s for OpenShiftContainerServiceVMSize. */ - public static final OpenShiftContainerServiceVMSize STANDARD_L16S = fromString("Standard_L16s"); - - /** Static value Standard_L32s for OpenShiftContainerServiceVMSize. */ - public static final OpenShiftContainerServiceVMSize STANDARD_L32S = fromString("Standard_L32s"); - - /** - * Creates or finds a OpenShiftContainerServiceVMSize from its string representation. - * - * @param name a name to look for. - * @return the corresponding OpenShiftContainerServiceVMSize. - */ - @JsonCreator - public static OpenShiftContainerServiceVMSize fromString(String name) { - return fromString(name, OpenShiftContainerServiceVMSize.class); - } - - /** @return known OpenShiftContainerServiceVMSize values. */ - public static Collection values() { - return values(OpenShiftContainerServiceVMSize.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/OpenShiftManagedClusterAadIdentityProvider.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/OpenShiftManagedClusterAadIdentityProvider.java deleted file mode 100644 index 5e02081ae11c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/OpenShiftManagedClusterAadIdentityProvider.java +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** Defines the Identity provider for MS AAD. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") -@JsonTypeName("AADIdentityProvider") -@Fluent -public final class OpenShiftManagedClusterAadIdentityProvider extends OpenShiftManagedClusterBaseIdentityProvider { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OpenShiftManagedClusterAadIdentityProvider.class); - - /* - * The clientId password associated with the provider. - */ - @JsonProperty(value = "clientId") - private String clientId; - - /* - * The secret password associated with the provider. - */ - @JsonProperty(value = "secret") - private String secret; - - /* - * The tenantId associated with the provider. - */ - @JsonProperty(value = "tenantId") - private String tenantId; - - /* - * The groupId to be granted cluster admin role. - */ - @JsonProperty(value = "customerAdminGroupId") - private String customerAdminGroupId; - - /** - * Get the clientId property: The clientId password associated with the provider. - * - * @return the clientId value. - */ - public String clientId() { - return this.clientId; - } - - /** - * Set the clientId property: The clientId password associated with the provider. - * - * @param clientId the clientId value to set. - * @return the OpenShiftManagedClusterAadIdentityProvider object itself. - */ - public OpenShiftManagedClusterAadIdentityProvider withClientId(String clientId) { - this.clientId = clientId; - return this; - } - - /** - * Get the secret property: The secret password associated with the provider. - * - * @return the secret value. - */ - public String secret() { - return this.secret; - } - - /** - * Set the secret property: The secret password associated with the provider. - * - * @param secret the secret value to set. - * @return the OpenShiftManagedClusterAadIdentityProvider object itself. - */ - public OpenShiftManagedClusterAadIdentityProvider withSecret(String secret) { - this.secret = secret; - return this; - } - - /** - * Get the tenantId property: The tenantId associated with the provider. - * - * @return the tenantId value. - */ - public String tenantId() { - return this.tenantId; - } - - /** - * Set the tenantId property: The tenantId associated with the provider. - * - * @param tenantId the tenantId value to set. - * @return the OpenShiftManagedClusterAadIdentityProvider object itself. - */ - public OpenShiftManagedClusterAadIdentityProvider withTenantId(String tenantId) { - this.tenantId = tenantId; - return this; - } - - /** - * Get the customerAdminGroupId property: The groupId to be granted cluster admin role. - * - * @return the customerAdminGroupId value. - */ - public String customerAdminGroupId() { - return this.customerAdminGroupId; - } - - /** - * Set the customerAdminGroupId property: The groupId to be granted cluster admin role. - * - * @param customerAdminGroupId the customerAdminGroupId value to set. - * @return the OpenShiftManagedClusterAadIdentityProvider object itself. - */ - public OpenShiftManagedClusterAadIdentityProvider withCustomerAdminGroupId(String customerAdminGroupId) { - this.customerAdminGroupId = customerAdminGroupId; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/OpenShiftManagedClusterAgentPoolProfile.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/OpenShiftManagedClusterAgentPoolProfile.java deleted file mode 100644 index 96fe4bea9b8b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/OpenShiftManagedClusterAgentPoolProfile.java +++ /dev/null @@ -1,194 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Defines the configuration of the OpenShift cluster VMs. */ -@Fluent -public final class OpenShiftManagedClusterAgentPoolProfile { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OpenShiftManagedClusterAgentPoolProfile.class); - - /* - * Unique name of the pool profile in the context of the subscription and - * resource group. - */ - @JsonProperty(value = "name", required = true) - private String name; - - /* - * Number of agents (VMs) to host docker containers. - */ - @JsonProperty(value = "count", required = true) - private int count; - - /* - * Size of agent VMs. - */ - @JsonProperty(value = "vmSize", required = true) - private OpenShiftContainerServiceVMSize vmSize; - - /* - * Subnet CIDR for the peering. - */ - @JsonProperty(value = "subnetCidr") - private String subnetCidr; - - /* - * OsType to be used to specify os type. Choose from Linux and Windows. - * Default to Linux. - */ - @JsonProperty(value = "osType") - private OSType osType; - - /* - * Define the role of the AgentPoolProfile. - */ - @JsonProperty(value = "role") - private OpenShiftAgentPoolProfileRole role; - - /** - * Get the name property: Unique name of the pool profile in the context of the subscription and resource group. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Unique name of the pool profile in the context of the subscription and resource group. - * - * @param name the name value to set. - * @return the OpenShiftManagedClusterAgentPoolProfile object itself. - */ - public OpenShiftManagedClusterAgentPoolProfile withName(String name) { - this.name = name; - return this; - } - - /** - * Get the count property: Number of agents (VMs) to host docker containers. - * - * @return the count value. - */ - public int count() { - return this.count; - } - - /** - * Set the count property: Number of agents (VMs) to host docker containers. - * - * @param count the count value to set. - * @return the OpenShiftManagedClusterAgentPoolProfile object itself. - */ - public OpenShiftManagedClusterAgentPoolProfile withCount(int count) { - this.count = count; - return this; - } - - /** - * Get the vmSize property: Size of agent VMs. - * - * @return the vmSize value. - */ - public OpenShiftContainerServiceVMSize vmSize() { - return this.vmSize; - } - - /** - * Set the vmSize property: Size of agent VMs. - * - * @param vmSize the vmSize value to set. - * @return the OpenShiftManagedClusterAgentPoolProfile object itself. - */ - public OpenShiftManagedClusterAgentPoolProfile withVmSize(OpenShiftContainerServiceVMSize vmSize) { - this.vmSize = vmSize; - return this; - } - - /** - * Get the subnetCidr property: Subnet CIDR for the peering. - * - * @return the subnetCidr value. - */ - public String subnetCidr() { - return this.subnetCidr; - } - - /** - * Set the subnetCidr property: Subnet CIDR for the peering. - * - * @param subnetCidr the subnetCidr value to set. - * @return the OpenShiftManagedClusterAgentPoolProfile object itself. - */ - public OpenShiftManagedClusterAgentPoolProfile withSubnetCidr(String subnetCidr) { - this.subnetCidr = subnetCidr; - return this; - } - - /** - * Get the osType property: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. - * - * @return the osType value. - */ - public OSType osType() { - return this.osType; - } - - /** - * Set the osType property: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. - * - * @param osType the osType value to set. - * @return the OpenShiftManagedClusterAgentPoolProfile object itself. - */ - public OpenShiftManagedClusterAgentPoolProfile withOsType(OSType osType) { - this.osType = osType; - return this; - } - - /** - * Get the role property: Define the role of the AgentPoolProfile. - * - * @return the role value. - */ - public OpenShiftAgentPoolProfileRole role() { - return this.role; - } - - /** - * Set the role property: Define the role of the AgentPoolProfile. - * - * @param role the role value to set. - * @return the OpenShiftManagedClusterAgentPoolProfile object itself. - */ - public OpenShiftManagedClusterAgentPoolProfile withRole(OpenShiftAgentPoolProfileRole role) { - this.role = role; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property name in model OpenShiftManagedClusterAgentPoolProfile")); - } - if (vmSize() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property vmSize in model OpenShiftManagedClusterAgentPoolProfile")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/OpenShiftManagedClusterAuthProfile.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/OpenShiftManagedClusterAuthProfile.java deleted file mode 100644 index 075cd8847bb4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/OpenShiftManagedClusterAuthProfile.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Defines all possible authentication profiles for the OpenShift cluster. */ -@Fluent -public final class OpenShiftManagedClusterAuthProfile { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OpenShiftManagedClusterAuthProfile.class); - - /* - * Type of authentication profile to use. - */ - @JsonProperty(value = "identityProviders") - private List identityProviders; - - /** - * Get the identityProviders property: Type of authentication profile to use. - * - * @return the identityProviders value. - */ - public List identityProviders() { - return this.identityProviders; - } - - /** - * Set the identityProviders property: Type of authentication profile to use. - * - * @param identityProviders the identityProviders value to set. - * @return the OpenShiftManagedClusterAuthProfile object itself. - */ - public OpenShiftManagedClusterAuthProfile withIdentityProviders( - List identityProviders) { - this.identityProviders = identityProviders; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (identityProviders() != null) { - identityProviders().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/OpenShiftManagedClusterBaseIdentityProvider.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/OpenShiftManagedClusterBaseIdentityProvider.java deleted file mode 100644 index 9a5865048e6b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/OpenShiftManagedClusterBaseIdentityProvider.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** Structure for any Identity provider. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "kind", - defaultImpl = OpenShiftManagedClusterBaseIdentityProvider.class) -@JsonTypeName("OpenShiftManagedClusterBaseIdentityProvider") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "AADIdentityProvider", value = OpenShiftManagedClusterAadIdentityProvider.class) -}) -@Immutable -public class OpenShiftManagedClusterBaseIdentityProvider { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OpenShiftManagedClusterBaseIdentityProvider.class); - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/OpenShiftManagedClusterIdentityProvider.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/OpenShiftManagedClusterIdentityProvider.java deleted file mode 100644 index 8107ed3f3d0c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/OpenShiftManagedClusterIdentityProvider.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Defines the configuration of the identity providers to be used in the OpenShift cluster. */ -@Fluent -public final class OpenShiftManagedClusterIdentityProvider { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OpenShiftManagedClusterIdentityProvider.class); - - /* - * Name of the provider. - */ - @JsonProperty(value = "name") - private String name; - - /* - * Configuration of the provider. - */ - @JsonProperty(value = "provider") - private OpenShiftManagedClusterBaseIdentityProvider provider; - - /** - * Get the name property: Name of the provider. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Name of the provider. - * - * @param name the name value to set. - * @return the OpenShiftManagedClusterIdentityProvider object itself. - */ - public OpenShiftManagedClusterIdentityProvider withName(String name) { - this.name = name; - return this; - } - - /** - * Get the provider property: Configuration of the provider. - * - * @return the provider value. - */ - public OpenShiftManagedClusterBaseIdentityProvider provider() { - return this.provider; - } - - /** - * Set the provider property: Configuration of the provider. - * - * @param provider the provider value to set. - * @return the OpenShiftManagedClusterIdentityProvider object itself. - */ - public OpenShiftManagedClusterIdentityProvider withProvider(OpenShiftManagedClusterBaseIdentityProvider provider) { - this.provider = provider; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (provider() != null) { - provider().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/OpenShiftManagedClusterListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/OpenShiftManagedClusterListResult.java deleted file mode 100644 index 8cf64fd6e14e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/OpenShiftManagedClusterListResult.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.containerservice.fluent.models.OpenShiftManagedClusterInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The response from the List OpenShift Managed Clusters operation. */ -@Fluent -public final class OpenShiftManagedClusterListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OpenShiftManagedClusterListResult.class); - - /* - * The list of OpenShift managed clusters. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to get the next set of OpenShift managed cluster results. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: The list of OpenShift managed clusters. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The list of OpenShift managed clusters. - * - * @param value the value value to set. - * @return the OpenShiftManagedClusterListResult object itself. - */ - public OpenShiftManagedClusterListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to get the next set of OpenShift managed cluster results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/OpenShiftManagedClusterMasterPoolProfile.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/OpenShiftManagedClusterMasterPoolProfile.java deleted file mode 100644 index bf352e77c29d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/OpenShiftManagedClusterMasterPoolProfile.java +++ /dev/null @@ -1,165 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** OpenShiftManagedClusterMaterPoolProfile contains configuration for OpenShift master VMs. */ -@Fluent -public final class OpenShiftManagedClusterMasterPoolProfile { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OpenShiftManagedClusterMasterPoolProfile.class); - - /* - * Unique name of the master pool profile in the context of the - * subscription and resource group. - */ - @JsonProperty(value = "name") - private String name; - - /* - * Number of masters (VMs) to host docker containers. The default value is - * 3. - */ - @JsonProperty(value = "count", required = true) - private int count; - - /* - * Size of agent VMs. - */ - @JsonProperty(value = "vmSize", required = true) - private OpenShiftContainerServiceVMSize vmSize; - - /* - * Subnet CIDR for the peering. - */ - @JsonProperty(value = "subnetCidr") - private String subnetCidr; - - /* - * OsType to be used to specify os type. Choose from Linux and Windows. - * Default to Linux. - */ - @JsonProperty(value = "osType") - private OSType osType; - - /** - * Get the name property: Unique name of the master pool profile in the context of the subscription and resource - * group. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Unique name of the master pool profile in the context of the subscription and resource - * group. - * - * @param name the name value to set. - * @return the OpenShiftManagedClusterMasterPoolProfile object itself. - */ - public OpenShiftManagedClusterMasterPoolProfile withName(String name) { - this.name = name; - return this; - } - - /** - * Get the count property: Number of masters (VMs) to host docker containers. The default value is 3. - * - * @return the count value. - */ - public int count() { - return this.count; - } - - /** - * Set the count property: Number of masters (VMs) to host docker containers. The default value is 3. - * - * @param count the count value to set. - * @return the OpenShiftManagedClusterMasterPoolProfile object itself. - */ - public OpenShiftManagedClusterMasterPoolProfile withCount(int count) { - this.count = count; - return this; - } - - /** - * Get the vmSize property: Size of agent VMs. - * - * @return the vmSize value. - */ - public OpenShiftContainerServiceVMSize vmSize() { - return this.vmSize; - } - - /** - * Set the vmSize property: Size of agent VMs. - * - * @param vmSize the vmSize value to set. - * @return the OpenShiftManagedClusterMasterPoolProfile object itself. - */ - public OpenShiftManagedClusterMasterPoolProfile withVmSize(OpenShiftContainerServiceVMSize vmSize) { - this.vmSize = vmSize; - return this; - } - - /** - * Get the subnetCidr property: Subnet CIDR for the peering. - * - * @return the subnetCidr value. - */ - public String subnetCidr() { - return this.subnetCidr; - } - - /** - * Set the subnetCidr property: Subnet CIDR for the peering. - * - * @param subnetCidr the subnetCidr value to set. - * @return the OpenShiftManagedClusterMasterPoolProfile object itself. - */ - public OpenShiftManagedClusterMasterPoolProfile withSubnetCidr(String subnetCidr) { - this.subnetCidr = subnetCidr; - return this; - } - - /** - * Get the osType property: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. - * - * @return the osType value. - */ - public OSType osType() { - return this.osType; - } - - /** - * Set the osType property: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. - * - * @param osType the osType value to set. - * @return the OpenShiftManagedClusterMasterPoolProfile object itself. - */ - public OpenShiftManagedClusterMasterPoolProfile withOsType(OSType osType) { - this.osType = osType; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (vmSize() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property vmSize in model OpenShiftManagedClusterMasterPoolProfile")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/OpenShiftRouterProfile.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/OpenShiftRouterProfile.java deleted file mode 100644 index 24541c38aa60..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/OpenShiftRouterProfile.java +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Represents an OpenShift router. */ -@Fluent -public final class OpenShiftRouterProfile { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OpenShiftRouterProfile.class); - - /* - * Name of the router profile. - */ - @JsonProperty(value = "name") - private String name; - - /* - * DNS subdomain for OpenShift router. - */ - @JsonProperty(value = "publicSubdomain", access = JsonProperty.Access.WRITE_ONLY) - private String publicSubdomain; - - /* - * Auto-allocated FQDN for the OpenShift router. - */ - @JsonProperty(value = "fqdn", access = JsonProperty.Access.WRITE_ONLY) - private String fqdn; - - /** - * Get the name property: Name of the router profile. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Name of the router profile. - * - * @param name the name value to set. - * @return the OpenShiftRouterProfile object itself. - */ - public OpenShiftRouterProfile withName(String name) { - this.name = name; - return this; - } - - /** - * Get the publicSubdomain property: DNS subdomain for OpenShift router. - * - * @return the publicSubdomain value. - */ - public String publicSubdomain() { - return this.publicSubdomain; - } - - /** - * Get the fqdn property: Auto-allocated FQDN for the OpenShift router. - * - * @return the fqdn value. - */ - public String fqdn() { - return this.fqdn; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/OperationListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/OperationListResult.java deleted file mode 100644 index d37ac3b5bd88..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/OperationListResult.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.containerservice.fluent.models.OperationValueInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The List Compute Operation operation response. */ -@Immutable -public final class OperationListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationListResult.class); - - /* - * The list of compute operations - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /** - * Get the value property: The list of compute operations. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/OrchestratorProfile.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/OrchestratorProfile.java deleted file mode 100644 index 6cebd53cdcdf..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/OrchestratorProfile.java +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Contains information about orchestrator. */ -@Fluent -public final class OrchestratorProfile { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OrchestratorProfile.class); - - /* - * Orchestrator type. - */ - @JsonProperty(value = "orchestratorType") - private String orchestratorType; - - /* - * Orchestrator version (major, minor, patch). - */ - @JsonProperty(value = "orchestratorVersion", required = true) - private String orchestratorVersion; - - /* - * Whether Kubernetes version is currently in preview. - */ - @JsonProperty(value = "isPreview") - private Boolean isPreview; - - /** - * Get the orchestratorType property: Orchestrator type. - * - * @return the orchestratorType value. - */ - public String orchestratorType() { - return this.orchestratorType; - } - - /** - * Set the orchestratorType property: Orchestrator type. - * - * @param orchestratorType the orchestratorType value to set. - * @return the OrchestratorProfile object itself. - */ - public OrchestratorProfile withOrchestratorType(String orchestratorType) { - this.orchestratorType = orchestratorType; - return this; - } - - /** - * Get the orchestratorVersion property: Orchestrator version (major, minor, patch). - * - * @return the orchestratorVersion value. - */ - public String orchestratorVersion() { - return this.orchestratorVersion; - } - - /** - * Set the orchestratorVersion property: Orchestrator version (major, minor, patch). - * - * @param orchestratorVersion the orchestratorVersion value to set. - * @return the OrchestratorProfile object itself. - */ - public OrchestratorProfile withOrchestratorVersion(String orchestratorVersion) { - this.orchestratorVersion = orchestratorVersion; - return this; - } - - /** - * Get the isPreview property: Whether Kubernetes version is currently in preview. - * - * @return the isPreview value. - */ - public Boolean isPreview() { - return this.isPreview; - } - - /** - * Set the isPreview property: Whether Kubernetes version is currently in preview. - * - * @param isPreview the isPreview value to set. - * @return the OrchestratorProfile object itself. - */ - public OrchestratorProfile withIsPreview(Boolean isPreview) { - this.isPreview = isPreview; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (orchestratorVersion() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property orchestratorVersion in model OrchestratorProfile")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/OrchestratorVersionProfile.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/OrchestratorVersionProfile.java deleted file mode 100644 index 5fa6907e128c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/OrchestratorVersionProfile.java +++ /dev/null @@ -1,170 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The profile of an orchestrator and its available versions. */ -@Fluent -public final class OrchestratorVersionProfile { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OrchestratorVersionProfile.class); - - /* - * Orchestrator type. - */ - @JsonProperty(value = "orchestratorType", required = true) - private String orchestratorType; - - /* - * Orchestrator version (major, minor, patch). - */ - @JsonProperty(value = "orchestratorVersion", required = true) - private String orchestratorVersion; - - /* - * Installed by default if version is not specified. - */ - @JsonProperty(value = "default") - private Boolean defaultProperty; - - /* - * Whether Kubernetes version is currently in preview. - */ - @JsonProperty(value = "isPreview") - private Boolean isPreview; - - /* - * The list of available upgrade versions. - */ - @JsonProperty(value = "upgrades") - private List upgrades; - - /** - * Get the orchestratorType property: Orchestrator type. - * - * @return the orchestratorType value. - */ - public String orchestratorType() { - return this.orchestratorType; - } - - /** - * Set the orchestratorType property: Orchestrator type. - * - * @param orchestratorType the orchestratorType value to set. - * @return the OrchestratorVersionProfile object itself. - */ - public OrchestratorVersionProfile withOrchestratorType(String orchestratorType) { - this.orchestratorType = orchestratorType; - return this; - } - - /** - * Get the orchestratorVersion property: Orchestrator version (major, minor, patch). - * - * @return the orchestratorVersion value. - */ - public String orchestratorVersion() { - return this.orchestratorVersion; - } - - /** - * Set the orchestratorVersion property: Orchestrator version (major, minor, patch). - * - * @param orchestratorVersion the orchestratorVersion value to set. - * @return the OrchestratorVersionProfile object itself. - */ - public OrchestratorVersionProfile withOrchestratorVersion(String orchestratorVersion) { - this.orchestratorVersion = orchestratorVersion; - return this; - } - - /** - * Get the defaultProperty property: Installed by default if version is not specified. - * - * @return the defaultProperty value. - */ - public Boolean defaultProperty() { - return this.defaultProperty; - } - - /** - * Set the defaultProperty property: Installed by default if version is not specified. - * - * @param defaultProperty the defaultProperty value to set. - * @return the OrchestratorVersionProfile object itself. - */ - public OrchestratorVersionProfile withDefaultProperty(Boolean defaultProperty) { - this.defaultProperty = defaultProperty; - return this; - } - - /** - * Get the isPreview property: Whether Kubernetes version is currently in preview. - * - * @return the isPreview value. - */ - public Boolean isPreview() { - return this.isPreview; - } - - /** - * Set the isPreview property: Whether Kubernetes version is currently in preview. - * - * @param isPreview the isPreview value to set. - * @return the OrchestratorVersionProfile object itself. - */ - public OrchestratorVersionProfile withIsPreview(Boolean isPreview) { - this.isPreview = isPreview; - return this; - } - - /** - * Get the upgrades property: The list of available upgrade versions. - * - * @return the upgrades value. - */ - public List upgrades() { - return this.upgrades; - } - - /** - * Set the upgrades property: The list of available upgrade versions. - * - * @param upgrades the upgrades value to set. - * @return the OrchestratorVersionProfile object itself. - */ - public OrchestratorVersionProfile withUpgrades(List upgrades) { - this.upgrades = upgrades; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (orchestratorType() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property orchestratorType in model OrchestratorVersionProfile")); - } - if (orchestratorVersion() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property orchestratorVersion in model OrchestratorVersionProfile")); - } - if (upgrades() != null) { - upgrades().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/OutboundType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/OutboundType.java deleted file mode 100644 index 1b3ef47fbe76..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/OutboundType.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for OutboundType. */ -public final class OutboundType extends ExpandableStringEnum { - /** Static value loadBalancer for OutboundType. */ - public static final OutboundType LOAD_BALANCER = fromString("loadBalancer"); - - /** Static value userDefinedRouting for OutboundType. */ - public static final OutboundType USER_DEFINED_ROUTING = fromString("userDefinedRouting"); - - /** - * Creates or finds a OutboundType from its string representation. - * - * @param name a name to look for. - * @return the corresponding OutboundType. - */ - @JsonCreator - public static OutboundType fromString(String name) { - return fromString(name, OutboundType.class); - } - - /** @return known OutboundType values. */ - public static Collection values() { - return values(OutboundType.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/PowerState.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/PowerState.java deleted file mode 100644 index c7a3e43207d1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/PowerState.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describes the Power State of the cluster. */ -@Fluent -public final class PowerState { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PowerState.class); - - /* - * Tells whether the cluster is Running or Stopped - */ - @JsonProperty(value = "code") - private Code code; - - /** - * Get the code property: Tells whether the cluster is Running or Stopped. - * - * @return the code value. - */ - public Code code() { - return this.code; - } - - /** - * Set the code property: Tells whether the cluster is Running or Stopped. - * - * @param code the code value to set. - * @return the PowerState object itself. - */ - public PowerState withCode(Code code) { - this.code = code; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/PrivateEndpoint.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/PrivateEndpoint.java deleted file mode 100644 index 0db30bcc26b3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/PrivateEndpoint.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Private endpoint which a connection belongs to. */ -@Fluent -public final class PrivateEndpoint { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpoint.class); - - /* - * The resource Id for private endpoint - */ - @JsonProperty(value = "id") - private String id; - - /** - * Get the id property: The resource Id for private endpoint. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: The resource Id for private endpoint. - * - * @param id the id value to set. - * @return the PrivateEndpoint object itself. - */ - public PrivateEndpoint withId(String id) { - this.id = id; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/PrivateEndpointConnectionProvisioningState.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/PrivateEndpointConnectionProvisioningState.java deleted file mode 100644 index 7591f449c86c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/PrivateEndpointConnectionProvisioningState.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for PrivateEndpointConnectionProvisioningState. */ -public final class PrivateEndpointConnectionProvisioningState - extends ExpandableStringEnum { - /** Static value Succeeded for PrivateEndpointConnectionProvisioningState. */ - public static final PrivateEndpointConnectionProvisioningState SUCCEEDED = fromString("Succeeded"); - - /** Static value Creating for PrivateEndpointConnectionProvisioningState. */ - public static final PrivateEndpointConnectionProvisioningState CREATING = fromString("Creating"); - - /** Static value Deleting for PrivateEndpointConnectionProvisioningState. */ - public static final PrivateEndpointConnectionProvisioningState DELETING = fromString("Deleting"); - - /** Static value Failed for PrivateEndpointConnectionProvisioningState. */ - public static final PrivateEndpointConnectionProvisioningState FAILED = fromString("Failed"); - - /** - * Creates or finds a PrivateEndpointConnectionProvisioningState from its string representation. - * - * @param name a name to look for. - * @return the corresponding PrivateEndpointConnectionProvisioningState. - */ - @JsonCreator - public static PrivateEndpointConnectionProvisioningState fromString(String name) { - return fromString(name, PrivateEndpointConnectionProvisioningState.class); - } - - /** @return known PrivateEndpointConnectionProvisioningState values. */ - public static Collection values() { - return values(PrivateEndpointConnectionProvisioningState.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/PrivateLinkServiceConnectionState.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/PrivateLinkServiceConnectionState.java deleted file mode 100644 index db1027f8d450..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/PrivateLinkServiceConnectionState.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The state of a private link service connection. */ -@Fluent -public final class PrivateLinkServiceConnectionState { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkServiceConnectionState.class); - - /* - * The private link service connection status. - */ - @JsonProperty(value = "status") - private ConnectionStatus status; - - /* - * The private link service connection description. - */ - @JsonProperty(value = "description") - private String description; - - /** - * Get the status property: The private link service connection status. - * - * @return the status value. - */ - public ConnectionStatus status() { - return this.status; - } - - /** - * Set the status property: The private link service connection status. - * - * @param status the status value to set. - * @return the PrivateLinkServiceConnectionState object itself. - */ - public PrivateLinkServiceConnectionState withStatus(ConnectionStatus status) { - this.status = status; - return this; - } - - /** - * Get the description property: The private link service connection description. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: The private link service connection description. - * - * @param description the description value to set. - * @return the PrivateLinkServiceConnectionState object itself. - */ - public PrivateLinkServiceConnectionState withDescription(String description) { - this.description = description; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/PurchasePlan.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/PurchasePlan.java deleted file mode 100644 index 3daf85495c99..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/PurchasePlan.java +++ /dev/null @@ -1,131 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Used for establishing the purchase context of any 3rd Party artifact through MarketPlace. */ -@Fluent -public final class PurchasePlan { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PurchasePlan.class); - - /* - * The plan ID. - */ - @JsonProperty(value = "name") - private String name; - - /* - * Specifies the product of the image from the marketplace. This is the - * same value as Offer under the imageReference element. - */ - @JsonProperty(value = "product") - private String product; - - /* - * The promotion code. - */ - @JsonProperty(value = "promotionCode") - private String promotionCode; - - /* - * The plan ID. - */ - @JsonProperty(value = "publisher") - private String publisher; - - /** - * Get the name property: The plan ID. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The plan ID. - * - * @param name the name value to set. - * @return the PurchasePlan object itself. - */ - public PurchasePlan withName(String name) { - this.name = name; - return this; - } - - /** - * Get the product property: Specifies the product of the image from the marketplace. This is the same value as - * Offer under the imageReference element. - * - * @return the product value. - */ - public String product() { - return this.product; - } - - /** - * Set the product property: Specifies the product of the image from the marketplace. This is the same value as - * Offer under the imageReference element. - * - * @param product the product value to set. - * @return the PurchasePlan object itself. - */ - public PurchasePlan withProduct(String product) { - this.product = product; - return this; - } - - /** - * Get the promotionCode property: The promotion code. - * - * @return the promotionCode value. - */ - public String promotionCode() { - return this.promotionCode; - } - - /** - * Set the promotionCode property: The promotion code. - * - * @param promotionCode the promotionCode value to set. - * @return the PurchasePlan object itself. - */ - public PurchasePlan withPromotionCode(String promotionCode) { - this.promotionCode = promotionCode; - return this; - } - - /** - * Get the publisher property: The plan ID. - * - * @return the publisher value. - */ - public String publisher() { - return this.publisher; - } - - /** - * Set the publisher property: The plan ID. - * - * @param publisher the publisher value to set. - * @return the PurchasePlan object itself. - */ - public PurchasePlan withPublisher(String publisher) { - this.publisher = publisher; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ResourceIdentityType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ResourceIdentityType.java deleted file mode 100644 index 69b484764973..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ResourceIdentityType.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for ResourceIdentityType. */ -public enum ResourceIdentityType { - /** Enum value SystemAssigned. */ - SYSTEM_ASSIGNED("SystemAssigned"), - - /** Enum value UserAssigned. */ - USER_ASSIGNED("UserAssigned"), - - /** Enum value None. */ - NONE("None"); - - /** The actual serialized value for a ResourceIdentityType instance. */ - private final String value; - - ResourceIdentityType(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a ResourceIdentityType instance. - * - * @param value the serialized value to parse. - * @return the parsed ResourceIdentityType object, or null if unable to parse. - */ - @JsonCreator - public static ResourceIdentityType fromString(String value) { - ResourceIdentityType[] items = ResourceIdentityType.values(); - for (ResourceIdentityType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ResourceReference.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ResourceReference.java deleted file mode 100644 index ee077845dc5d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ResourceReference.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** A reference to an Azure resource. */ -@Fluent -public final class ResourceReference { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceReference.class); - - /* - * The fully qualified Azure resource id. - */ - @JsonProperty(value = "id") - private String id; - - /** - * Get the id property: The fully qualified Azure resource id. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: The fully qualified Azure resource id. - * - * @param id the id value to set. - * @return the ResourceReference object itself. - */ - public ResourceReference withId(String id) { - this.id = id; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ScaleSetEvictionPolicy.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ScaleSetEvictionPolicy.java deleted file mode 100644 index 4af126ef9d61..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ScaleSetEvictionPolicy.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ScaleSetEvictionPolicy. */ -public final class ScaleSetEvictionPolicy extends ExpandableStringEnum { - /** Static value Delete for ScaleSetEvictionPolicy. */ - public static final ScaleSetEvictionPolicy DELETE = fromString("Delete"); - - /** Static value Deallocate for ScaleSetEvictionPolicy. */ - public static final ScaleSetEvictionPolicy DEALLOCATE = fromString("Deallocate"); - - /** - * Creates or finds a ScaleSetEvictionPolicy from its string representation. - * - * @param name a name to look for. - * @return the corresponding ScaleSetEvictionPolicy. - */ - @JsonCreator - public static ScaleSetEvictionPolicy fromString(String name) { - return fromString(name, ScaleSetEvictionPolicy.class); - } - - /** @return known ScaleSetEvictionPolicy values. */ - public static Collection values() { - return values(ScaleSetEvictionPolicy.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ScaleSetPriority.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ScaleSetPriority.java deleted file mode 100644 index 4f1b8b4fba2f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ScaleSetPriority.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ScaleSetPriority. */ -public final class ScaleSetPriority extends ExpandableStringEnum { - /** Static value Spot for ScaleSetPriority. */ - public static final ScaleSetPriority SPOT = fromString("Spot"); - - /** Static value Regular for ScaleSetPriority. */ - public static final ScaleSetPriority REGULAR = fromString("Regular"); - - /** - * Creates or finds a ScaleSetPriority from its string representation. - * - * @param name a name to look for. - * @return the corresponding ScaleSetPriority. - */ - @JsonCreator - public static ScaleSetPriority fromString(String name) { - return fromString(name, ScaleSetPriority.class); - } - - /** @return known ScaleSetPriority values. */ - public static Collection values() { - return values(ScaleSetPriority.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/SysctlConfig.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/SysctlConfig.java deleted file mode 100644 index 100f9f26d526..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/SysctlConfig.java +++ /dev/null @@ -1,752 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Sysctl settings for Linux agent nodes. */ -@Fluent -public final class SysctlConfig { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SysctlConfig.class); - - /* - * Sysctl setting net.core.somaxconn. - */ - @JsonProperty(value = "netCoreSomaxconn") - private Integer netCoreSomaxconn; - - /* - * Sysctl setting net.core.netdev_max_backlog. - */ - @JsonProperty(value = "netCoreNetdevMaxBacklog") - private Integer netCoreNetdevMaxBacklog; - - /* - * Sysctl setting net.core.rmem_max. - */ - @JsonProperty(value = "netCoreRmemMax") - private Integer netCoreRmemMax; - - /* - * Sysctl setting net.core.wmem_max. - */ - @JsonProperty(value = "netCoreWmemMax") - private Integer netCoreWmemMax; - - /* - * Sysctl setting net.core.optmem_max. - */ - @JsonProperty(value = "netCoreOptmemMax") - private Integer netCoreOptmemMax; - - /* - * Sysctl setting net.ipv4.tcp_max_syn_backlog. - */ - @JsonProperty(value = "netIpv4TcpMaxSynBacklog") - private Integer netIpv4TcpMaxSynBacklog; - - /* - * Sysctl setting net.ipv4.tcp_max_tw_buckets. - */ - @JsonProperty(value = "netIpv4TcpMaxTwBuckets") - private Integer netIpv4TcpMaxTwBuckets; - - /* - * Sysctl setting net.ipv4.tcp_fin_timeout. - */ - @JsonProperty(value = "netIpv4TcpFinTimeout") - private Integer netIpv4TcpFinTimeout; - - /* - * Sysctl setting net.ipv4.tcp_keepalive_time. - */ - @JsonProperty(value = "netIpv4TcpKeepaliveTime") - private Integer netIpv4TcpKeepaliveTime; - - /* - * Sysctl setting net.ipv4.tcp_keepalive_probes. - */ - @JsonProperty(value = "netIpv4TcpKeepaliveProbes") - private Integer netIpv4TcpKeepaliveProbes; - - /* - * Sysctl setting net.ipv4.tcp_keepalive_intvl. - */ - @JsonProperty(value = "netIpv4TcpkeepaliveIntvl") - private Integer netIpv4TcpkeepaliveIntvl; - - /* - * Sysctl setting net.ipv4.tcp_rmem. - */ - @JsonProperty(value = "netIpv4TcpRmem") - private Integer netIpv4TcpRmem; - - /* - * Sysctl setting net.ipv4.tcp_wmem. - */ - @JsonProperty(value = "netIpv4TcpWmem") - private Integer netIpv4TcpWmem; - - /* - * Sysctl setting net.ipv4.tcp_tw_reuse. - */ - @JsonProperty(value = "netIpv4TcpTwReuse") - private Boolean netIpv4TcpTwReuse; - - /* - * Sysctl setting net.ipv4.ip_local_port_range. - */ - @JsonProperty(value = "netIpv4IpLocalPortRange") - private String netIpv4IpLocalPortRange; - - /* - * Sysctl setting net.ipv4.neigh.default.gc_thresh1. - */ - @JsonProperty(value = "netIpv4NeighDefaultGcThresh1") - private Integer netIpv4NeighDefaultGcThresh1; - - /* - * Sysctl setting net.ipv4.neigh.default.gc_thresh2. - */ - @JsonProperty(value = "netIpv4NeighDefaultGcThresh2") - private Integer netIpv4NeighDefaultGcThresh2; - - /* - * Sysctl setting net.ipv4.neigh.default.gc_thresh3. - */ - @JsonProperty(value = "netIpv4NeighDefaultGcThresh3") - private Integer netIpv4NeighDefaultGcThresh3; - - /* - * Sysctl setting net.netfilter.nf_conntrack_max. - */ - @JsonProperty(value = "netNetfilterNfConntrackMax") - private Integer netNetfilterNfConntrackMax; - - /* - * Sysctl setting net.netfilter.nf_conntrack_buckets. - */ - @JsonProperty(value = "netNetfilterNfConntrackBuckets") - private Integer netNetfilterNfConntrackBuckets; - - /* - * Sysctl setting fs.inotify.max_user_watches. - */ - @JsonProperty(value = "fsInotifyMaxUserWatches") - private Integer fsInotifyMaxUserWatches; - - /* - * Sysctl setting fs.file-max. - */ - @JsonProperty(value = "fsFileMax") - private Integer fsFileMax; - - /* - * Sysctl setting fs.aio-max-nr. - */ - @JsonProperty(value = "fsAioMaxNr") - private Integer fsAioMaxNr; - - /* - * Sysctl setting fs.nr_open. - */ - @JsonProperty(value = "fsNrOpen") - private Integer fsNrOpen; - - /* - * Sysctl setting kernel.threads-max. - */ - @JsonProperty(value = "kernelThreadsMax") - private Integer kernelThreadsMax; - - /* - * Sysctl setting vm.max_map_count. - */ - @JsonProperty(value = "vmMaxMapCount") - private Integer vmMaxMapCount; - - /* - * Sysctl setting vm.swappiness. - */ - @JsonProperty(value = "vmSwappiness") - private Integer vmSwappiness; - - /* - * Sysctl setting vm.vfs_cache_pressure. - */ - @JsonProperty(value = "vmVfsCachePressure") - private Integer vmVfsCachePressure; - - /** - * Get the netCoreSomaxconn property: Sysctl setting net.core.somaxconn. - * - * @return the netCoreSomaxconn value. - */ - public Integer netCoreSomaxconn() { - return this.netCoreSomaxconn; - } - - /** - * Set the netCoreSomaxconn property: Sysctl setting net.core.somaxconn. - * - * @param netCoreSomaxconn the netCoreSomaxconn value to set. - * @return the SysctlConfig object itself. - */ - public SysctlConfig withNetCoreSomaxconn(Integer netCoreSomaxconn) { - this.netCoreSomaxconn = netCoreSomaxconn; - return this; - } - - /** - * Get the netCoreNetdevMaxBacklog property: Sysctl setting net.core.netdev_max_backlog. - * - * @return the netCoreNetdevMaxBacklog value. - */ - public Integer netCoreNetdevMaxBacklog() { - return this.netCoreNetdevMaxBacklog; - } - - /** - * Set the netCoreNetdevMaxBacklog property: Sysctl setting net.core.netdev_max_backlog. - * - * @param netCoreNetdevMaxBacklog the netCoreNetdevMaxBacklog value to set. - * @return the SysctlConfig object itself. - */ - public SysctlConfig withNetCoreNetdevMaxBacklog(Integer netCoreNetdevMaxBacklog) { - this.netCoreNetdevMaxBacklog = netCoreNetdevMaxBacklog; - return this; - } - - /** - * Get the netCoreRmemMax property: Sysctl setting net.core.rmem_max. - * - * @return the netCoreRmemMax value. - */ - public Integer netCoreRmemMax() { - return this.netCoreRmemMax; - } - - /** - * Set the netCoreRmemMax property: Sysctl setting net.core.rmem_max. - * - * @param netCoreRmemMax the netCoreRmemMax value to set. - * @return the SysctlConfig object itself. - */ - public SysctlConfig withNetCoreRmemMax(Integer netCoreRmemMax) { - this.netCoreRmemMax = netCoreRmemMax; - return this; - } - - /** - * Get the netCoreWmemMax property: Sysctl setting net.core.wmem_max. - * - * @return the netCoreWmemMax value. - */ - public Integer netCoreWmemMax() { - return this.netCoreWmemMax; - } - - /** - * Set the netCoreWmemMax property: Sysctl setting net.core.wmem_max. - * - * @param netCoreWmemMax the netCoreWmemMax value to set. - * @return the SysctlConfig object itself. - */ - public SysctlConfig withNetCoreWmemMax(Integer netCoreWmemMax) { - this.netCoreWmemMax = netCoreWmemMax; - return this; - } - - /** - * Get the netCoreOptmemMax property: Sysctl setting net.core.optmem_max. - * - * @return the netCoreOptmemMax value. - */ - public Integer netCoreOptmemMax() { - return this.netCoreOptmemMax; - } - - /** - * Set the netCoreOptmemMax property: Sysctl setting net.core.optmem_max. - * - * @param netCoreOptmemMax the netCoreOptmemMax value to set. - * @return the SysctlConfig object itself. - */ - public SysctlConfig withNetCoreOptmemMax(Integer netCoreOptmemMax) { - this.netCoreOptmemMax = netCoreOptmemMax; - return this; - } - - /** - * Get the netIpv4TcpMaxSynBacklog property: Sysctl setting net.ipv4.tcp_max_syn_backlog. - * - * @return the netIpv4TcpMaxSynBacklog value. - */ - public Integer netIpv4TcpMaxSynBacklog() { - return this.netIpv4TcpMaxSynBacklog; - } - - /** - * Set the netIpv4TcpMaxSynBacklog property: Sysctl setting net.ipv4.tcp_max_syn_backlog. - * - * @param netIpv4TcpMaxSynBacklog the netIpv4TcpMaxSynBacklog value to set. - * @return the SysctlConfig object itself. - */ - public SysctlConfig withNetIpv4TcpMaxSynBacklog(Integer netIpv4TcpMaxSynBacklog) { - this.netIpv4TcpMaxSynBacklog = netIpv4TcpMaxSynBacklog; - return this; - } - - /** - * Get the netIpv4TcpMaxTwBuckets property: Sysctl setting net.ipv4.tcp_max_tw_buckets. - * - * @return the netIpv4TcpMaxTwBuckets value. - */ - public Integer netIpv4TcpMaxTwBuckets() { - return this.netIpv4TcpMaxTwBuckets; - } - - /** - * Set the netIpv4TcpMaxTwBuckets property: Sysctl setting net.ipv4.tcp_max_tw_buckets. - * - * @param netIpv4TcpMaxTwBuckets the netIpv4TcpMaxTwBuckets value to set. - * @return the SysctlConfig object itself. - */ - public SysctlConfig withNetIpv4TcpMaxTwBuckets(Integer netIpv4TcpMaxTwBuckets) { - this.netIpv4TcpMaxTwBuckets = netIpv4TcpMaxTwBuckets; - return this; - } - - /** - * Get the netIpv4TcpFinTimeout property: Sysctl setting net.ipv4.tcp_fin_timeout. - * - * @return the netIpv4TcpFinTimeout value. - */ - public Integer netIpv4TcpFinTimeout() { - return this.netIpv4TcpFinTimeout; - } - - /** - * Set the netIpv4TcpFinTimeout property: Sysctl setting net.ipv4.tcp_fin_timeout. - * - * @param netIpv4TcpFinTimeout the netIpv4TcpFinTimeout value to set. - * @return the SysctlConfig object itself. - */ - public SysctlConfig withNetIpv4TcpFinTimeout(Integer netIpv4TcpFinTimeout) { - this.netIpv4TcpFinTimeout = netIpv4TcpFinTimeout; - return this; - } - - /** - * Get the netIpv4TcpKeepaliveTime property: Sysctl setting net.ipv4.tcp_keepalive_time. - * - * @return the netIpv4TcpKeepaliveTime value. - */ - public Integer netIpv4TcpKeepaliveTime() { - return this.netIpv4TcpKeepaliveTime; - } - - /** - * Set the netIpv4TcpKeepaliveTime property: Sysctl setting net.ipv4.tcp_keepalive_time. - * - * @param netIpv4TcpKeepaliveTime the netIpv4TcpKeepaliveTime value to set. - * @return the SysctlConfig object itself. - */ - public SysctlConfig withNetIpv4TcpKeepaliveTime(Integer netIpv4TcpKeepaliveTime) { - this.netIpv4TcpKeepaliveTime = netIpv4TcpKeepaliveTime; - return this; - } - - /** - * Get the netIpv4TcpKeepaliveProbes property: Sysctl setting net.ipv4.tcp_keepalive_probes. - * - * @return the netIpv4TcpKeepaliveProbes value. - */ - public Integer netIpv4TcpKeepaliveProbes() { - return this.netIpv4TcpKeepaliveProbes; - } - - /** - * Set the netIpv4TcpKeepaliveProbes property: Sysctl setting net.ipv4.tcp_keepalive_probes. - * - * @param netIpv4TcpKeepaliveProbes the netIpv4TcpKeepaliveProbes value to set. - * @return the SysctlConfig object itself. - */ - public SysctlConfig withNetIpv4TcpKeepaliveProbes(Integer netIpv4TcpKeepaliveProbes) { - this.netIpv4TcpKeepaliveProbes = netIpv4TcpKeepaliveProbes; - return this; - } - - /** - * Get the netIpv4TcpkeepaliveIntvl property: Sysctl setting net.ipv4.tcp_keepalive_intvl. - * - * @return the netIpv4TcpkeepaliveIntvl value. - */ - public Integer netIpv4TcpkeepaliveIntvl() { - return this.netIpv4TcpkeepaliveIntvl; - } - - /** - * Set the netIpv4TcpkeepaliveIntvl property: Sysctl setting net.ipv4.tcp_keepalive_intvl. - * - * @param netIpv4TcpkeepaliveIntvl the netIpv4TcpkeepaliveIntvl value to set. - * @return the SysctlConfig object itself. - */ - public SysctlConfig withNetIpv4TcpkeepaliveIntvl(Integer netIpv4TcpkeepaliveIntvl) { - this.netIpv4TcpkeepaliveIntvl = netIpv4TcpkeepaliveIntvl; - return this; - } - - /** - * Get the netIpv4TcpRmem property: Sysctl setting net.ipv4.tcp_rmem. - * - * @return the netIpv4TcpRmem value. - */ - public Integer netIpv4TcpRmem() { - return this.netIpv4TcpRmem; - } - - /** - * Set the netIpv4TcpRmem property: Sysctl setting net.ipv4.tcp_rmem. - * - * @param netIpv4TcpRmem the netIpv4TcpRmem value to set. - * @return the SysctlConfig object itself. - */ - public SysctlConfig withNetIpv4TcpRmem(Integer netIpv4TcpRmem) { - this.netIpv4TcpRmem = netIpv4TcpRmem; - return this; - } - - /** - * Get the netIpv4TcpWmem property: Sysctl setting net.ipv4.tcp_wmem. - * - * @return the netIpv4TcpWmem value. - */ - public Integer netIpv4TcpWmem() { - return this.netIpv4TcpWmem; - } - - /** - * Set the netIpv4TcpWmem property: Sysctl setting net.ipv4.tcp_wmem. - * - * @param netIpv4TcpWmem the netIpv4TcpWmem value to set. - * @return the SysctlConfig object itself. - */ - public SysctlConfig withNetIpv4TcpWmem(Integer netIpv4TcpWmem) { - this.netIpv4TcpWmem = netIpv4TcpWmem; - return this; - } - - /** - * Get the netIpv4TcpTwReuse property: Sysctl setting net.ipv4.tcp_tw_reuse. - * - * @return the netIpv4TcpTwReuse value. - */ - public Boolean netIpv4TcpTwReuse() { - return this.netIpv4TcpTwReuse; - } - - /** - * Set the netIpv4TcpTwReuse property: Sysctl setting net.ipv4.tcp_tw_reuse. - * - * @param netIpv4TcpTwReuse the netIpv4TcpTwReuse value to set. - * @return the SysctlConfig object itself. - */ - public SysctlConfig withNetIpv4TcpTwReuse(Boolean netIpv4TcpTwReuse) { - this.netIpv4TcpTwReuse = netIpv4TcpTwReuse; - return this; - } - - /** - * Get the netIpv4IpLocalPortRange property: Sysctl setting net.ipv4.ip_local_port_range. - * - * @return the netIpv4IpLocalPortRange value. - */ - public String netIpv4IpLocalPortRange() { - return this.netIpv4IpLocalPortRange; - } - - /** - * Set the netIpv4IpLocalPortRange property: Sysctl setting net.ipv4.ip_local_port_range. - * - * @param netIpv4IpLocalPortRange the netIpv4IpLocalPortRange value to set. - * @return the SysctlConfig object itself. - */ - public SysctlConfig withNetIpv4IpLocalPortRange(String netIpv4IpLocalPortRange) { - this.netIpv4IpLocalPortRange = netIpv4IpLocalPortRange; - return this; - } - - /** - * Get the netIpv4NeighDefaultGcThresh1 property: Sysctl setting net.ipv4.neigh.default.gc_thresh1. - * - * @return the netIpv4NeighDefaultGcThresh1 value. - */ - public Integer netIpv4NeighDefaultGcThresh1() { - return this.netIpv4NeighDefaultGcThresh1; - } - - /** - * Set the netIpv4NeighDefaultGcThresh1 property: Sysctl setting net.ipv4.neigh.default.gc_thresh1. - * - * @param netIpv4NeighDefaultGcThresh1 the netIpv4NeighDefaultGcThresh1 value to set. - * @return the SysctlConfig object itself. - */ - public SysctlConfig withNetIpv4NeighDefaultGcThresh1(Integer netIpv4NeighDefaultGcThresh1) { - this.netIpv4NeighDefaultGcThresh1 = netIpv4NeighDefaultGcThresh1; - return this; - } - - /** - * Get the netIpv4NeighDefaultGcThresh2 property: Sysctl setting net.ipv4.neigh.default.gc_thresh2. - * - * @return the netIpv4NeighDefaultGcThresh2 value. - */ - public Integer netIpv4NeighDefaultGcThresh2() { - return this.netIpv4NeighDefaultGcThresh2; - } - - /** - * Set the netIpv4NeighDefaultGcThresh2 property: Sysctl setting net.ipv4.neigh.default.gc_thresh2. - * - * @param netIpv4NeighDefaultGcThresh2 the netIpv4NeighDefaultGcThresh2 value to set. - * @return the SysctlConfig object itself. - */ - public SysctlConfig withNetIpv4NeighDefaultGcThresh2(Integer netIpv4NeighDefaultGcThresh2) { - this.netIpv4NeighDefaultGcThresh2 = netIpv4NeighDefaultGcThresh2; - return this; - } - - /** - * Get the netIpv4NeighDefaultGcThresh3 property: Sysctl setting net.ipv4.neigh.default.gc_thresh3. - * - * @return the netIpv4NeighDefaultGcThresh3 value. - */ - public Integer netIpv4NeighDefaultGcThresh3() { - return this.netIpv4NeighDefaultGcThresh3; - } - - /** - * Set the netIpv4NeighDefaultGcThresh3 property: Sysctl setting net.ipv4.neigh.default.gc_thresh3. - * - * @param netIpv4NeighDefaultGcThresh3 the netIpv4NeighDefaultGcThresh3 value to set. - * @return the SysctlConfig object itself. - */ - public SysctlConfig withNetIpv4NeighDefaultGcThresh3(Integer netIpv4NeighDefaultGcThresh3) { - this.netIpv4NeighDefaultGcThresh3 = netIpv4NeighDefaultGcThresh3; - return this; - } - - /** - * Get the netNetfilterNfConntrackMax property: Sysctl setting net.netfilter.nf_conntrack_max. - * - * @return the netNetfilterNfConntrackMax value. - */ - public Integer netNetfilterNfConntrackMax() { - return this.netNetfilterNfConntrackMax; - } - - /** - * Set the netNetfilterNfConntrackMax property: Sysctl setting net.netfilter.nf_conntrack_max. - * - * @param netNetfilterNfConntrackMax the netNetfilterNfConntrackMax value to set. - * @return the SysctlConfig object itself. - */ - public SysctlConfig withNetNetfilterNfConntrackMax(Integer netNetfilterNfConntrackMax) { - this.netNetfilterNfConntrackMax = netNetfilterNfConntrackMax; - return this; - } - - /** - * Get the netNetfilterNfConntrackBuckets property: Sysctl setting net.netfilter.nf_conntrack_buckets. - * - * @return the netNetfilterNfConntrackBuckets value. - */ - public Integer netNetfilterNfConntrackBuckets() { - return this.netNetfilterNfConntrackBuckets; - } - - /** - * Set the netNetfilterNfConntrackBuckets property: Sysctl setting net.netfilter.nf_conntrack_buckets. - * - * @param netNetfilterNfConntrackBuckets the netNetfilterNfConntrackBuckets value to set. - * @return the SysctlConfig object itself. - */ - public SysctlConfig withNetNetfilterNfConntrackBuckets(Integer netNetfilterNfConntrackBuckets) { - this.netNetfilterNfConntrackBuckets = netNetfilterNfConntrackBuckets; - return this; - } - - /** - * Get the fsInotifyMaxUserWatches property: Sysctl setting fs.inotify.max_user_watches. - * - * @return the fsInotifyMaxUserWatches value. - */ - public Integer fsInotifyMaxUserWatches() { - return this.fsInotifyMaxUserWatches; - } - - /** - * Set the fsInotifyMaxUserWatches property: Sysctl setting fs.inotify.max_user_watches. - * - * @param fsInotifyMaxUserWatches the fsInotifyMaxUserWatches value to set. - * @return the SysctlConfig object itself. - */ - public SysctlConfig withFsInotifyMaxUserWatches(Integer fsInotifyMaxUserWatches) { - this.fsInotifyMaxUserWatches = fsInotifyMaxUserWatches; - return this; - } - - /** - * Get the fsFileMax property: Sysctl setting fs.file-max. - * - * @return the fsFileMax value. - */ - public Integer fsFileMax() { - return this.fsFileMax; - } - - /** - * Set the fsFileMax property: Sysctl setting fs.file-max. - * - * @param fsFileMax the fsFileMax value to set. - * @return the SysctlConfig object itself. - */ - public SysctlConfig withFsFileMax(Integer fsFileMax) { - this.fsFileMax = fsFileMax; - return this; - } - - /** - * Get the fsAioMaxNr property: Sysctl setting fs.aio-max-nr. - * - * @return the fsAioMaxNr value. - */ - public Integer fsAioMaxNr() { - return this.fsAioMaxNr; - } - - /** - * Set the fsAioMaxNr property: Sysctl setting fs.aio-max-nr. - * - * @param fsAioMaxNr the fsAioMaxNr value to set. - * @return the SysctlConfig object itself. - */ - public SysctlConfig withFsAioMaxNr(Integer fsAioMaxNr) { - this.fsAioMaxNr = fsAioMaxNr; - return this; - } - - /** - * Get the fsNrOpen property: Sysctl setting fs.nr_open. - * - * @return the fsNrOpen value. - */ - public Integer fsNrOpen() { - return this.fsNrOpen; - } - - /** - * Set the fsNrOpen property: Sysctl setting fs.nr_open. - * - * @param fsNrOpen the fsNrOpen value to set. - * @return the SysctlConfig object itself. - */ - public SysctlConfig withFsNrOpen(Integer fsNrOpen) { - this.fsNrOpen = fsNrOpen; - return this; - } - - /** - * Get the kernelThreadsMax property: Sysctl setting kernel.threads-max. - * - * @return the kernelThreadsMax value. - */ - public Integer kernelThreadsMax() { - return this.kernelThreadsMax; - } - - /** - * Set the kernelThreadsMax property: Sysctl setting kernel.threads-max. - * - * @param kernelThreadsMax the kernelThreadsMax value to set. - * @return the SysctlConfig object itself. - */ - public SysctlConfig withKernelThreadsMax(Integer kernelThreadsMax) { - this.kernelThreadsMax = kernelThreadsMax; - return this; - } - - /** - * Get the vmMaxMapCount property: Sysctl setting vm.max_map_count. - * - * @return the vmMaxMapCount value. - */ - public Integer vmMaxMapCount() { - return this.vmMaxMapCount; - } - - /** - * Set the vmMaxMapCount property: Sysctl setting vm.max_map_count. - * - * @param vmMaxMapCount the vmMaxMapCount value to set. - * @return the SysctlConfig object itself. - */ - public SysctlConfig withVmMaxMapCount(Integer vmMaxMapCount) { - this.vmMaxMapCount = vmMaxMapCount; - return this; - } - - /** - * Get the vmSwappiness property: Sysctl setting vm.swappiness. - * - * @return the vmSwappiness value. - */ - public Integer vmSwappiness() { - return this.vmSwappiness; - } - - /** - * Set the vmSwappiness property: Sysctl setting vm.swappiness. - * - * @param vmSwappiness the vmSwappiness value to set. - * @return the SysctlConfig object itself. - */ - public SysctlConfig withVmSwappiness(Integer vmSwappiness) { - this.vmSwappiness = vmSwappiness; - return this; - } - - /** - * Get the vmVfsCachePressure property: Sysctl setting vm.vfs_cache_pressure. - * - * @return the vmVfsCachePressure value. - */ - public Integer vmVfsCachePressure() { - return this.vmVfsCachePressure; - } - - /** - * Set the vmVfsCachePressure property: Sysctl setting vm.vfs_cache_pressure. - * - * @param vmVfsCachePressure the vmVfsCachePressure value to set. - * @return the SysctlConfig object itself. - */ - public SysctlConfig withVmVfsCachePressure(Integer vmVfsCachePressure) { - this.vmVfsCachePressure = vmVfsCachePressure; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/TagsObject.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/TagsObject.java deleted file mode 100644 index 55e8685e1e6a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/TagsObject.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** Tags object for patch operations. */ -@Fluent -public final class TagsObject { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TagsObject.class); - - /* - * Resource tags. - */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map tags; - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Resource tags. - * - * @param tags the tags value to set. - * @return the TagsObject object itself. - */ - public TagsObject withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/UpgradeChannel.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/UpgradeChannel.java deleted file mode 100644 index ce4b5a16b61d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/UpgradeChannel.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for UpgradeChannel. */ -public final class UpgradeChannel extends ExpandableStringEnum { - /** Static value rapid for UpgradeChannel. */ - public static final UpgradeChannel RAPID = fromString("rapid"); - - /** Static value stable for UpgradeChannel. */ - public static final UpgradeChannel STABLE = fromString("stable"); - - /** Static value patch for UpgradeChannel. */ - public static final UpgradeChannel PATCH = fromString("patch"); - - /** Static value none for UpgradeChannel. */ - public static final UpgradeChannel NONE = fromString("none"); - - /** - * Creates or finds a UpgradeChannel from its string representation. - * - * @param name a name to look for. - * @return the corresponding UpgradeChannel. - */ - @JsonCreator - public static UpgradeChannel fromString(String name) { - return fromString(name, UpgradeChannel.class); - } - - /** @return known UpgradeChannel values. */ - public static Collection values() { - return values(UpgradeChannel.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/UserAssignedIdentity.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/UserAssignedIdentity.java deleted file mode 100644 index f5bc583d71e0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/UserAssignedIdentity.java +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservice.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The UserAssignedIdentity model. */ -@Fluent -public class UserAssignedIdentity { - @JsonIgnore private final ClientLogger logger = new ClientLogger(UserAssignedIdentity.class); - - /* - * The resource id of the user assigned identity. - */ - @JsonProperty(value = "resourceId") - private String resourceId; - - /* - * The client id of the user assigned identity. - */ - @JsonProperty(value = "clientId") - private String clientId; - - /* - * The object id of the user assigned identity. - */ - @JsonProperty(value = "objectId") - private String objectId; - - /** - * Get the resourceId property: The resource id of the user assigned identity. - * - * @return the resourceId value. - */ - public String resourceId() { - return this.resourceId; - } - - /** - * Set the resourceId property: The resource id of the user assigned identity. - * - * @param resourceId the resourceId value to set. - * @return the UserAssignedIdentity object itself. - */ - public UserAssignedIdentity withResourceId(String resourceId) { - this.resourceId = resourceId; - return this; - } - - /** - * Get the clientId property: The client id of the user assigned identity. - * - * @return the clientId value. - */ - public String clientId() { - return this.clientId; - } - - /** - * Set the clientId property: The client id of the user assigned identity. - * - * @param clientId the clientId value to set. - * @return the UserAssignedIdentity object itself. - */ - public UserAssignedIdentity withClientId(String clientId) { - this.clientId = clientId; - return this; - } - - /** - * Get the objectId property: The object id of the user assigned identity. - * - * @return the objectId value. - */ - public String objectId() { - return this.objectId; - } - - /** - * Set the objectId property: The object id of the user assigned identity. - * - * @param objectId the objectId value to set. - * @return the UserAssignedIdentity object itself. - */ - public UserAssignedIdentity withObjectId(String objectId) { - this.objectId = objectId; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/package-info.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/package-info.java deleted file mode 100644 index 6fc2377b793a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** Package containing the data models for ContainerServiceManagementClient. Container Service Client. */ -package com.azure.resourcemanager.containerservice.models; diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/package-info.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/package-info.java deleted file mode 100644 index 0580d2047157..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** Package containing the classes for ContainerServiceManagementClient. Container Service Client. */ -package com.azure.resourcemanager.containerservice; diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/module-info.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/module-info.java deleted file mode 100644 index 3dfe0656343e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/main/java/module-info.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -module com.azure.resourcemanager.containerservice { - requires transitive com.azure.resourcemanager.resources; - - // export public APIs of containerservice - exports com.azure.resourcemanager.containerservice; - exports com.azure.resourcemanager.containerservice.fluent; - exports com.azure.resourcemanager.containerservice.fluent.models; - exports com.azure.resourcemanager.containerservice.models; - - // open packages specifically for azure core and jackson - opens com.azure.resourcemanager.containerservice.fluent.models to - com.azure.core, - com.fasterxml.jackson.databind; - opens com.azure.resourcemanager.containerservice.models to - com.azure.core, - com.fasterxml.jackson.databind; -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/samples/java/com/azure/resourcemanager/containerservice/ReadmeSamples.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/samples/java/com/azure/resourcemanager/containerservice/ReadmeSamples.java deleted file mode 100644 index b1ef1779f56e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/samples/java/com/azure/resourcemanager/containerservice/ReadmeSamples.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.containerservice; - -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpMethod; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.util.serializer.JacksonAdapter; -import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.identity.DefaultAzureCredentialBuilder; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.ArrayNode; - -import java.io.IOException; -import java.util.HashMap; - -public class ReadmeSamples { - - public void authenticate() { - // BEGIN: com.azure.resourcemanager.containerservice.authenticate - String armEndpoint = "https://management.."; - AzureProfile profile = new AzureProfile(getAzureEnvironmentFromArmEndpoint(armEndpoint)); - TokenCredential credential = new DefaultAzureCredentialBuilder() - .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) - .build(); - ContainerServiceManager manager = ContainerServiceManager - .authenticate(credential, profile); - // END: com.azure.resourcemanager.containerservice.authenticate - } - - // BEGIN: com.azure.resourcemanager.containerservice.getazureenvironment - private static AzureEnvironment getAzureEnvironmentFromArmEndpoint(String armEndpoint) { - // Create HTTP client and request - HttpClient httpClient = HttpClient.createDefault(); - - HttpRequest request = new HttpRequest(HttpMethod.GET, - String.format("%s/metadata/endpoints?api-version=2019-10-01", armEndpoint)) - .setHeader("accept", "application/json"); - - // Execute the request and read the response - HttpResponse response = httpClient.send(request).block(); - if (response.getStatusCode() != 200) { - throw new RuntimeException("Failed : HTTP error code : " + response.getStatusCode()); - } - String body = response.getBodyAsString().block(); - try { - ArrayNode metadataArray = JacksonAdapter.createDefaultSerializerAdapter() - .deserialize(body, ArrayNode.class, SerializerEncoding.JSON); - - if (metadataArray == null || metadataArray.isEmpty()) { - throw new RuntimeException("Failed to find metadata : " + body); - } - - JsonNode metadata = metadataArray.iterator().next(); - AzureEnvironment azureEnvironment = new AzureEnvironment(new HashMap() { - { - put("managementEndpointUrl", metadata.at("/authentication/audiences/0").asText()); - put("resourceManagerEndpointUrl", armEndpoint); - put("galleryEndpointUrl", metadata.at("/gallery").asText()); - put("activeDirectoryEndpointUrl", metadata.at("/authentication/loginEndpoint").asText()); - put("activeDirectoryResourceId", metadata.at("/authentication/audiences/0").asText()); - put("activeDirectoryGraphResourceId", metadata.at("/graph").asText()); - put("storageEndpointSuffix", "." + metadata.at("/suffixes/storage").asText()); - put("keyVaultDnsSuffix", "." + metadata.at("/suffixes/keyVaultDns").asText()); - } - }); - return azureEnvironment; - } catch (IOException ioe) { - ioe.printStackTrace(); - throw new RuntimeException(ioe); - } - } - // END: com.azure.resourcemanager.containerservice.getazureenvironment -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/test/java/com/azure/resourcemanager/containerservice/ContainerServiceManagementTest.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/test/java/com/azure/resourcemanager/containerservice/ContainerServiceManagementTest.java deleted file mode 100644 index 6a99c3eec8b7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/test/java/com/azure/resourcemanager/containerservice/ContainerServiceManagementTest.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.containerservice; - -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.policy.HttpLogOptions; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.management.Region; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.resources.ResourceManager; -import com.azure.resourcemanager.resources.fluentcore.utils.HttpPipelineProvider; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import com.azure.resourcemanager.test.ResourceManagerTestBase; -import com.azure.resourcemanager.test.utils.TestDelayProvider; - -import java.time.temporal.ChronoUnit; -import java.util.List; - -public class ContainerServiceManagementTest extends ResourceManagerTestBase { - protected ResourceManager resourceManager; - protected ContainerServiceManager containerServiceManager; - protected String rgName = ""; - - @Override - protected HttpPipeline buildHttpPipeline( - TokenCredential credential, - AzureProfile profile, - HttpLogOptions httpLogOptions, - List policies, - HttpClient httpClient) { - return HttpPipelineProvider.buildHttpPipeline( - credential, - profile, - null, - httpLogOptions, - null, - new RetryPolicy("Retry-After", ChronoUnit.SECONDS), - policies, - httpClient); - } - - @Override - protected void initializeClients(HttpPipeline httpPipeline, AzureProfile profile) { - ResourceManagerUtils.InternalRuntimeContext.setDelayProvider(new TestDelayProvider(!isPlaybackMode())); - rgName = generateRandomResourceName("javaacsrg", 15); - containerServiceManager = buildManager(ContainerServiceManager.class, httpPipeline, profile); - resourceManager = containerServiceManager.resourceManager(); - resourceManager.resourceGroups().define(rgName).withRegion(locationOrDefault(Region.US_EAST)).create(); - } - - @Override - protected void cleanUpResources() { - resourceManager.resourceGroups().beginDeleteByName(rgName); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/test/java/com/azure/resourcemanager/containerservice/KubernetesClustersTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/test/java/com/azure/resourcemanager/containerservice/KubernetesClustersTests.java deleted file mode 100644 index 179199efb103..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/test/java/com/azure/resourcemanager/containerservice/KubernetesClustersTests.java +++ /dev/null @@ -1,370 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.containerservice; - -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.policy.AddHeadersFromContextPolicy; -import com.azure.core.util.Context; -import com.azure.core.util.serializer.JacksonAdapter; -import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.resourcemanager.containerservice.models.AgentPoolMode; -import com.azure.resourcemanager.containerservice.models.AgentPoolType; -import com.azure.resourcemanager.containerservice.models.Code; -import com.azure.resourcemanager.containerservice.models.ContainerServiceVMSizeTypes; -import com.azure.resourcemanager.containerservice.models.KubernetesCluster; -import com.azure.resourcemanager.containerservice.models.KubernetesClusterAgentPool; -import com.azure.core.management.Region; -import com.azure.resourcemanager.containerservice.models.ManagedClusterPropertiesAutoScalerProfile; -import com.azure.resourcemanager.containerservice.models.OSDiskType; -import com.azure.resourcemanager.containerservice.models.ScaleSetEvictionPolicy; -import com.azure.resourcemanager.containerservice.models.ScaleSetPriority; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -import java.io.File; -import java.io.FileInputStream; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.util.Arrays; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Properties; -import java.util.Map; - - -public class KubernetesClustersTests extends ContainerServiceManagementTest { - private static final String SSH_KEY = sshPublicKey(); - - @Test - public void canCRUDKubernetesCluster() throws Exception { - // enable preview feature of ACR Teleport for AKS - Context context = new Context( - AddHeadersFromContextPolicy.AZURE_REQUEST_HTTP_HEADERS_KEY, - new HttpHeaders().set("EnableACRTeleport", "true")); - - String aksName = generateRandomResourceName("aks", 15); - String dnsPrefix = generateRandomResourceName("dns", 10); - String agentPoolName = generateRandomResourceName("ap0", 10); - String agentPoolName1 = generateRandomResourceName("ap1", 10); - String agentPoolName2 = generateRandomResourceName("ap2", 10); - String servicePrincipalClientId = "spId"; - String servicePrincipalSecret = "spSecret"; - - // aks can use another azure auth rather than original client auth to access azure service. - // Thus, set it to AZURE_AUTH_LOCATION_2 when you want. - String envSecondaryServicePrincipal = System.getenv("AZURE_AUTH_LOCATION_2"); - if (envSecondaryServicePrincipal == null - || envSecondaryServicePrincipal.isEmpty() - || !(new File(envSecondaryServicePrincipal).exists())) { - envSecondaryServicePrincipal = System.getenv("AZURE_AUTH_LOCATION"); - } - - if (!isPlaybackMode()) { - HashMap credentialsMap = parseAuthFile(envSecondaryServicePrincipal); - servicePrincipalClientId = credentialsMap.get("clientId"); - servicePrincipalSecret = credentialsMap.get("clientSecret"); - } - - /* - KubeletDiskType requires registering following preview feature: - azure.features().register("Microsoft.ContainerService", "KubeletDisk"); - */ - - // create - KubernetesCluster kubernetesCluster = - containerServiceManager - .kubernetesClusters() - .define(aksName) - .withRegion(locationOrDefault(Region.US_CENTRAL)) - .withExistingResourceGroup(rgName) - .withDefaultVersion() - .withRootUsername("testaks") - .withSshKey(SSH_KEY) - .withServicePrincipalClientId(servicePrincipalClientId) - .withServicePrincipalSecret(servicePrincipalSecret) - .defineAgentPool(agentPoolName) - .withVirtualMachineSize(ContainerServiceVMSizeTypes.STANDARD_F4S_V2) - .withAgentPoolVirtualMachineCount(1) - .withOSDiskSizeInGB(30) - .withOSDiskType(OSDiskType.EPHEMERAL) - .withAgentPoolType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) - .withAgentPoolMode(AgentPoolMode.SYSTEM) - .attach() - .defineAgentPool(agentPoolName1) - .withVirtualMachineSize(ContainerServiceVMSizeTypes.STANDARD_A2_V2) - .withAgentPoolVirtualMachineCount(1) - .attach() - .withDnsPrefix("mp1" + dnsPrefix) - .withTag("tag1", "value1") - .create(context); - - Assertions.assertNotNull(kubernetesCluster.id()); - Assertions.assertEquals(locationOrDefault(Region.US_CENTRAL), kubernetesCluster.region()); - Assertions.assertEquals("testaks", kubernetesCluster.linuxRootUsername()); - Assertions.assertEquals(2, kubernetesCluster.agentPools().size()); - - KubernetesClusterAgentPool agentPool = kubernetesCluster.agentPools().get(agentPoolName); - Assertions.assertNotNull(agentPool); - Assertions.assertEquals(1, agentPool.count()); - Assertions.assertEquals(ContainerServiceVMSizeTypes.STANDARD_F4S_V2, agentPool.vmSize()); - Assertions.assertEquals(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS, agentPool.type()); - Assertions.assertEquals(AgentPoolMode.SYSTEM, agentPool.mode()); - Assertions.assertEquals(OSDiskType.EPHEMERAL, agentPool.osDiskType()); - Assertions.assertEquals(30, agentPool.osDiskSizeInGB()); - - agentPool = kubernetesCluster.agentPools().get(agentPoolName1); - Assertions.assertNotNull(agentPool); - Assertions.assertEquals(1, agentPool.count()); - Assertions.assertEquals(ContainerServiceVMSizeTypes.STANDARD_A2_V2, agentPool.vmSize()); - Assertions.assertEquals(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS, agentPool.type()); - - Assertions.assertNotNull(kubernetesCluster.tags().get("tag1")); - - // stop - kubernetesCluster.stop(); - kubernetesCluster.refresh(); - Assertions.assertEquals(Code.STOPPED, kubernetesCluster.powerState().code()); - - // start - kubernetesCluster.start(); - kubernetesCluster.refresh(); - Assertions.assertEquals(Code.RUNNING, kubernetesCluster.powerState().code()); - - // update - kubernetesCluster = - kubernetesCluster - .update() - .updateAgentPool(agentPoolName1) - .withAgentPoolMode(AgentPoolMode.SYSTEM) - .withAgentPoolVirtualMachineCount(2) - .parent() - .defineAgentPool(agentPoolName2) - .withVirtualMachineSize(ContainerServiceVMSizeTypes.STANDARD_A2_V2) - .withAgentPoolVirtualMachineCount(1) - .attach() - .withTag("tag2", "value2") - .withTag("tag3", "value3") - .withoutTag("tag1") - .apply(context); - - Assertions.assertEquals(3, kubernetesCluster.agentPools().size()); - - agentPool = kubernetesCluster.agentPools().get(agentPoolName1); - Assertions.assertEquals(2, agentPool.count()); - Assertions.assertEquals(AgentPoolMode.SYSTEM, agentPool.mode()); - - agentPool = kubernetesCluster.agentPools().get(agentPoolName2); - Assertions.assertNotNull(agentPool); - Assertions.assertEquals(ContainerServiceVMSizeTypes.STANDARD_A2_V2, agentPool.vmSize()); - Assertions.assertEquals(1, agentPool.count()); - - Assertions.assertEquals("value2", kubernetesCluster.tags().get("tag2")); - Assertions.assertFalse(kubernetesCluster.tags().containsKey("tag1")); - } - - @Test - public void canAutoScaleKubernetesCluster() throws Exception { - String aksName = generateRandomResourceName("aks", 15); - String dnsPrefix = generateRandomResourceName("dns", 10); - String agentPoolName = generateRandomResourceName("ap0", 10); - String agentPoolName1 = generateRandomResourceName("ap1", 10); - String agentPoolName2 = generateRandomResourceName("ap2", 10); - String agentPoolName3 = generateRandomResourceName("ap2", 10); - String servicePrincipalClientId = "spId"; - String servicePrincipalSecret = "spSecret"; - - // aks can use another azure auth rather than original client auth to access azure service. - // Thus, set it to AZURE_AUTH_LOCATION_2 when you want. - String envSecondaryServicePrincipal = System.getenv("AZURE_AUTH_LOCATION_2"); - if (envSecondaryServicePrincipal == null - || envSecondaryServicePrincipal.isEmpty() - || !(new File(envSecondaryServicePrincipal).exists())) { - envSecondaryServicePrincipal = System.getenv("AZURE_AUTH_LOCATION"); - } - - if (!isPlaybackMode()) { - HashMap credentialsMap = parseAuthFile(envSecondaryServicePrincipal); - servicePrincipalClientId = credentialsMap.get("clientId"); - servicePrincipalSecret = credentialsMap.get("clientSecret"); - } - - Map nodeLables = new HashMap<>(2); - nodeLables.put("environment", "dev"); - nodeLables.put("app.1", "spring"); - - List nodeTaints = new ArrayList<>(1); - nodeTaints.add("key=value:NoSchedule"); - - // create cluster - KubernetesCluster kubernetesCluster = containerServiceManager.kubernetesClusters().define(aksName) - .withRegion(locationOrDefault(Region.US_CENTRAL)) - .withExistingResourceGroup(rgName) - .withDefaultVersion() - .withRootUsername("testaks") - .withSshKey(SSH_KEY) - .withServicePrincipalClientId(servicePrincipalClientId) - .withServicePrincipalSecret(servicePrincipalSecret) - // zone redundancy - .defineAgentPool(agentPoolName) - .withVirtualMachineSize(ContainerServiceVMSizeTypes.STANDARD_D2_V2) - .withAgentPoolVirtualMachineCount(3) - .withAgentPoolType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) - .withAgentPoolMode(AgentPoolMode.SYSTEM) - .withAvailabilityZones(1, 2, 3) - .attach() - // auto-scaling - // labels and taints - .defineAgentPool(agentPoolName1) - .withVirtualMachineSize(ContainerServiceVMSizeTypes.STANDARD_A2_V2) - .withAgentPoolVirtualMachineCount(1) - .withAutoScaling(1, 3) - .withNodeLabels(Collections.unmodifiableMap(nodeLables)) - .withNodeTaints(Collections.unmodifiableList(nodeTaints)) - .attach() - // number of nodes = 0 - .defineAgentPool(agentPoolName2) - .withVirtualMachineSize(ContainerServiceVMSizeTypes.STANDARD_A2_V2) - .withAgentPoolVirtualMachineCount(0) - .withMaxPodsCount(10) - .attach() - .withDnsPrefix("mp1" + dnsPrefix) - .withAutoScalerProfile(new ManagedClusterPropertiesAutoScalerProfile().withScanInterval("30s")) - .create(); - - // print config - System.out.println(new String(kubernetesCluster.adminKubeConfigContent(), StandardCharsets.UTF_8)); - - Assertions.assertEquals(Code.RUNNING, kubernetesCluster.powerState().code()); - - KubernetesClusterAgentPool agentPoolProfile = kubernetesCluster.agentPools().get(agentPoolName); - Assertions.assertEquals(3, agentPoolProfile.nodeSize()); - Assertions.assertFalse(agentPoolProfile.isAutoScalingEnabled()); - Assertions.assertEquals(Arrays.asList("1", "2", "3"), agentPoolProfile.availabilityZones()); - Assertions.assertEquals(Code.RUNNING, agentPoolProfile.powerState().code()); - - KubernetesClusterAgentPool agentPoolProfile1 = kubernetesCluster.agentPools().get(agentPoolName1); - Assertions.assertEquals(1, agentPoolProfile1.nodeSize()); - Assertions.assertTrue(agentPoolProfile1.isAutoScalingEnabled()); - Assertions.assertEquals(1, agentPoolProfile1.minimumNodeSize()); - Assertions.assertEquals(3, agentPoolProfile1.maximumNodeSize()); - Assertions.assertEquals(Collections.unmodifiableMap(nodeLables), agentPoolProfile1.nodeLabels()); - Assertions.assertEquals("key=value:NoSchedule", agentPoolProfile1.nodeTaints().iterator().next()); - - KubernetesClusterAgentPool agentPoolProfile2 = kubernetesCluster.agentPools().get(agentPoolName2); - Assertions.assertEquals(0, agentPoolProfile2.nodeSize()); - Assertions.assertEquals(10, agentPoolProfile2.maximumPodsPerNode()); - - // disable auto-scaling - kubernetesCluster.update() - .updateAgentPool(agentPoolName1) - .withoutAutoScaling() - .parent() - .apply(); - - // remove agent pool - kubernetesCluster.update() - .withoutAgentPool(agentPoolName1) - .withoutAgentPool(agentPoolName2) - .defineAgentPool(agentPoolName3) - .withVirtualMachineSize(ContainerServiceVMSizeTypes.STANDARD_A2_V2) - .withAgentPoolVirtualMachineCount(0) - .attach() - .apply(); - - Assertions.assertEquals(2, kubernetesCluster.agentPools().size()); - - KubernetesClusterAgentPool agentPoolProfile3 = kubernetesCluster.agentPools().get(agentPoolName3); - Assertions.assertEquals(0, agentPoolProfile3.nodeSize()); - } - - @Test - @Disabled("Azure Spot VMs are not guaranteed to be scheduled.") - public void canCreateClusterWithSpotVM() throws Exception { - String aksName = generateRandomResourceName("aks", 15); - String dnsPrefix = generateRandomResourceName("dns", 10); - String agentPoolName = generateRandomResourceName("ap0", 10); - String agentPoolName1 = generateRandomResourceName("ap1", 10); - String agentPoolName2 = generateRandomResourceName("ap2", 10); - - // create cluster - KubernetesCluster kubernetesCluster = containerServiceManager.kubernetesClusters().define(aksName) - .withRegion(locationOrDefault(Region.US_CENTRAL)) - .withExistingResourceGroup(rgName) - .withDefaultVersion() - .withRootUsername("testaks") - .withSshKey(SSH_KEY) - .withSystemAssignedManagedServiceIdentity() - .defineAgentPool(agentPoolName) - .withVirtualMachineSize(ContainerServiceVMSizeTypes.STANDARD_D2_V2) - .withAgentPoolVirtualMachineCount(1) - .withAgentPoolType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) - .withAgentPoolMode(AgentPoolMode.SYSTEM) - .attach() - // spot vm - .defineAgentPool(agentPoolName1) - .withVirtualMachineSize(ContainerServiceVMSizeTypes.STANDARD_A2_V2) - .withAgentPoolVirtualMachineCount(1) - .withSpotPriorityVirtualMachine() - .attach() - .withDnsPrefix("mp1" + dnsPrefix) - .create(); - - // print config - System.out.println(new String(kubernetesCluster.adminKubeConfigContent(), StandardCharsets.UTF_8)); - - KubernetesClusterAgentPool agentPoolProfile = kubernetesCluster.agentPools().get(agentPoolName); - Assertions.assertTrue(agentPoolProfile.virtualMachinePriority() == null || agentPoolProfile.virtualMachinePriority() == ScaleSetPriority.REGULAR); - - KubernetesClusterAgentPool agentPoolProfile1 = kubernetesCluster.agentPools().get(agentPoolName1); - Assertions.assertEquals(ScaleSetPriority.SPOT, agentPoolProfile1.virtualMachinePriority()); - Assertions.assertEquals(ScaleSetEvictionPolicy.DELETE, agentPoolProfile1.virtualMachineEvictionPolicy()); - Assertions.assertEquals(-1.0, agentPoolProfile1.virtualMachineMaximumPrice()); - - kubernetesCluster.update() - .defineAgentPool(agentPoolName2) - .withVirtualMachineSize(ContainerServiceVMSizeTypes.STANDARD_A2_V2) - .withAgentPoolVirtualMachineCount(1) - .withSpotPriorityVirtualMachine(ScaleSetEvictionPolicy.DEALLOCATE) - .withVirtualMachineMaximumPrice(100.0) - .attach() - .apply(); - - KubernetesClusterAgentPool agentPoolProfile2 = kubernetesCluster.agentPools().get(agentPoolName2); - Assertions.assertEquals(ScaleSetPriority.SPOT, agentPoolProfile2.virtualMachinePriority()); - Assertions.assertEquals(ScaleSetEvictionPolicy.DEALLOCATE, agentPoolProfile2.virtualMachineEvictionPolicy()); - Assertions.assertEquals(100.0, agentPoolProfile2.virtualMachineMaximumPrice()); - } - - /** - * Parse azure auth to hashmap - * - * @param authFilename the azure auth location - * @return all fields in azure auth json - * @throws Exception exception - */ - private static HashMap parseAuthFile(String authFilename) throws Exception { - String content = new String(Files.readAllBytes(new File(authFilename).toPath()), StandardCharsets.UTF_8).trim(); - HashMap auth = new HashMap<>(); - if (isJsonBased(content)) { - auth = new JacksonAdapter().deserialize(content, auth.getClass(), SerializerEncoding.JSON); - } else { - Properties authSettings = new Properties(); - FileInputStream credentialsFileStream = new FileInputStream(new File(authFilename)); - authSettings.load(credentialsFileStream); - credentialsFileStream.close(); - - for (final String authName : authSettings.stringPropertyNames()) { - auth.put(authName, authSettings.getProperty(authName)); - } - } - return auth; - } - - private static boolean isJsonBased(String content) { - return content.startsWith("{"); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/test/resources/junit-platform.properties b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/test/resources/junit-platform.properties deleted file mode 100644 index 202d099b3ee8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/src/test/resources/junit-platform.properties +++ /dev/null @@ -1,4 +0,0 @@ -junit.jupiter.execution.parallel.enabled=true -junit.jupiter.execution.parallel.mode.default=concurrent -junit.jupiter.execution.parallel.config.strategy=fixed -junit.jupiter.execution.parallel.config.fixed.parallelism=32 diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/CHANGELOG.md b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/CHANGELOG.md deleted file mode 100644 index 56941e81cce6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/CHANGELOG.md +++ /dev/null @@ -1,8 +0,0 @@ -# Release History - -## 1.0.0-hybrid (2022-01-12) - -- Azure Resource Manager dns client library for Java (Hybrid) using API Profiles to allow building hybrid cloud solutions -that target both Azure and Azure Stack Hub. -- Supports api versions in the 2020-09-01-hybrid api profile -- Requires Azure Stack Update 2102+ diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/README.md b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/README.md deleted file mode 100644 index fe9f6ee1f51d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/README.md +++ /dev/null @@ -1,135 +0,0 @@ -# Azure Resource Manager dns client library for Java (Hybrid) - -Azure Resource Manager dns client library for Java (Hybrid) using [API Profiles][api_profile] to allow building hybrid cloud solutions -that target both Azure and Azure Stack Hub. - -For documentation on how to use this package, please see [Azure Management Libraries for Java (Hybrid)][resourcemanagerhybrid_lib]. - -## Getting started - -### Prerequisites - -- [Java Development Kit (JDK)][jdk] with version 8 or above -- [Azure Subscription][azure_subscription] - -### Adding the package to your product - -```xml - - com.azure.resourcemanager - azure-resourcemanager-dns - 1.0.0-hybrid - -``` - -### Include the recommended packages - -Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. - -[Azure Identity][azure_identity] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation. - -### Authentication - -By default, Azure Active Directory token authentication depends on correct configure of following environment variables. - -- `AZURE_CLIENT_ID` for Azure client ID. -- `AZURE_TENANT_ID` for Azure tenant ID. -- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. - -In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`. - -With above configuration, `azure` client can be authenticated by following code: - -```java com.azure.resourcemanager.dns.authenticate -String armEndpoint = "https://management.."; -AzureProfile profile = new AzureProfile(getAzureEnvironmentFromArmEndpoint(armEndpoint)); -TokenCredential credential = new DefaultAzureCredentialBuilder() - .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) - .build(); -DnsZoneManager manager = DnsZoneManager - .authenticate(credential, profile); -``` - -Change `armEndpoint` to point to the Azure Resource Manager endpoint of your Azure Stack Hub. The azure environment's -properties above can be populated with the following example: - -```java com.azure.resourcemanager.dns.getazureenvironment -private static AzureEnvironment getAzureEnvironmentFromArmEndpoint(String armEndpoint) { - // Create HTTP client and request - HttpClient httpClient = HttpClient.createDefault(); - - HttpRequest request = new HttpRequest(HttpMethod.GET, - String.format("%s/metadata/endpoints?api-version=2019-10-01", armEndpoint)) - .setHeader("accept", "application/json"); - - // Execute the request and read the response - HttpResponse response = httpClient.send(request).block(); - if (response.getStatusCode() != 200) { - throw new RuntimeException("Failed : HTTP error code : " + response.getStatusCode()); - } - String body = response.getBodyAsString().block(); - try { - ArrayNode metadataArray = JacksonAdapter.createDefaultSerializerAdapter() - .deserialize(body, ArrayNode.class, SerializerEncoding.JSON); - - if (metadataArray == null || metadataArray.isEmpty()) { - throw new RuntimeException("Failed to find metadata : " + body); - } - - JsonNode metadata = metadataArray.iterator().next(); - AzureEnvironment azureEnvironment = new AzureEnvironment(new HashMap() { - { - put("managementEndpointUrl", metadata.at("/authentication/audiences/0").asText()); - put("resourceManagerEndpointUrl", armEndpoint); - put("galleryEndpointUrl", metadata.at("/gallery").asText()); - put("activeDirectoryEndpointUrl", metadata.at("/authentication/loginEndpoint").asText()); - put("activeDirectoryResourceId", metadata.at("/authentication/audiences/0").asText()); - put("activeDirectoryGraphResourceId", metadata.at("/graph").asText()); - put("storageEndpointSuffix", "." + metadata.at("/suffixes/storage").asText()); - put("keyVaultDnsSuffix", "." + metadata.at("/suffixes/keyVaultDns").asText()); - } - }); - return azureEnvironment; - } catch (IOException ioe) { - ioe.printStackTrace(); - throw new RuntimeException(ioe); - } -} -``` - -When targeting a hybrid solution to global Azure instead of your Azure Stack Hub, `AzureEnvironment.AZURE` can be used instead. - -See [Authentication][authenticate] for more options. - -## Key concepts - -See [API design][design] for general introduction on design and key concepts on Azure Management Libraries. - -## Examples - -See [Samples][sample] for code snippets and samples. - -## Troubleshooting - -## Next steps - -## Contributing - -For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). - -1. Fork it -1. Create your feature branch (`git checkout -b my-new-feature`) -1. Commit your changes (`git commit -am 'Add some feature'`) -1. Push to the branch (`git push origin my-new-feature`) -1. Create new Pull Request - - -[jdk]: https://learn.microsoft.com/java/azure/jdk/ -[azure_subscription]: https://azure.microsoft.com/free/ -[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity -[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty -[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md -[sample]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/SAMPLE.md -[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md -[api_profile]: https://learn.microsoft.com/azure-stack/user/azure-stack-version-profiles -[resourcemanagerhybrid_lib]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanagerhybrid diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/pom.xml b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/pom.xml deleted file mode 100644 index 868b3613d16f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/pom.xml +++ /dev/null @@ -1,142 +0,0 @@ - - - 4.0.0 - - com.azure - azure-client-sdk-parent - 1.7.0 - ../../parents/azure-client-sdk-parent - - - com.azure.resourcemanager - azure-resourcemanager-dns - 1.0.0-hybrid - jar - - Microsoft Azure SDK for DNS Management (Hybrid) - This package contains Microsoft Azure DNS Management Hybrid SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt - https://github.com/Azure/azure-sdk-for-java - - - - The MIT License (MIT) - http://opensource.org/licenses/MIT - repo - - - - - https://github.com/Azure/azure-sdk-for-java - scm:git:git@github.com:Azure/azure-sdk-for-java.git - HEAD - - - - - 0.10 - 0.05 - - - --add-opens com.azure.resourcemanager.dns/com.azure.resourcemanager.dns=ALL-UNNAMED - --add-opens com.azure.core/com.azure.core.implementation.jackson=ALL-UNNAMED - - - - - - microsoft - Microsoft - - - - - - com.azure.resourcemanager - azure-resourcemanager-resources - 1.0.0-hybrid - - - commons-io - commons-io - 2.17.0 - test - - - org.slf4j - slf4j-simple - 1.7.36 - test - - - org.junit.jupiter - junit-jupiter-engine - 5.13.4 - test - - - org.junit.jupiter - junit-jupiter-api - 5.13.4 - test - - - com.azure - azure-core-http-netty - 1.16.2 - test - - - - - azure-mgmt-sdk-test-jar - - - !maven.test.skip - - - - - com.azure.resourcemanager - azure-resourcemanager-test - 1.0.0-hybrid - test - - - - - - - - org.apache.maven.plugins - maven-jar-plugin - 3.4.2 - - - - true - true - - - - - - - org.jacoco - jacoco-maven-plugin - 0.8.13 - - - com/azure/resourcemanager/**/fluent/**/* - com/azure/resourcemanager/**/models/**/* - com/azure/resourcemanager/**/implementation/*ClientImpl* - com/azure/resourcemanager/**/implementation/*ClientBuilder* - - - - - - diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/DnsZoneManager.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/DnsZoneManager.java deleted file mode 100644 index cf726d5eaaeb..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/DnsZoneManager.java +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.dns; - -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpPipeline; -import com.azure.resourcemanager.dns.fluent.DnsManagementClient; -import com.azure.resourcemanager.dns.implementation.DnsManagementClientBuilder; -import com.azure.resourcemanager.dns.implementation.DnsZonesImpl; -import com.azure.resourcemanager.dns.models.DnsZones; -import com.azure.resourcemanager.resources.fluentcore.arm.AzureConfigurable; -import com.azure.resourcemanager.resources.fluentcore.arm.implementation.AzureConfigurableImpl; -import com.azure.resourcemanager.resources.fluentcore.arm.Manager; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.resources.fluentcore.utils.HttpPipelineProvider; - -import java.util.Objects; - -/** Entry point to Azure DNS zone management. */ -public final class DnsZoneManager extends Manager { - // Collections - private DnsZones zones; - - /** - * Get a Configurable instance that can be used to create {@link DnsZoneManager} with optional configuration. - * - * @return the instance allowing configurations - */ - public static Configurable configure() { - return new DnsZoneManager.ConfigurableImpl(); - } - - /** - * Creates an instance of DnsZoneManager that exposes DNS zone management API entry points. - * - * @param credential the credential to use - * @param profile the profile to use - * @return the DnsZoneManager - */ - public static DnsZoneManager authenticate(TokenCredential credential, AzureProfile profile) { - Objects.requireNonNull(credential, "'credential' cannot be null."); - Objects.requireNonNull(profile, "'profile' cannot be null."); - return authenticate(HttpPipelineProvider.buildHttpPipeline(credential, profile), profile); - } - - /** - * Creates an instance of DnsZoneManager that exposes DNS zone management API entry points. - * - * @param httpPipeline the HttpPipeline to be used for API calls. - * @param profile the profile to use - * @return the DnsZoneManager - */ - public static DnsZoneManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { - Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); - Objects.requireNonNull(profile, "'profile' cannot be null."); - return new DnsZoneManager(httpPipeline, profile); - } - - /** The interface allowing configurations to be set. */ - public interface Configurable extends AzureConfigurable { - /** - * Creates an instance of DnsZoneManager that exposes DNS zone API entry points. - * - * @param credential the credential to use - * @param profile the profile to use - * @return the interface exposing DNS zone management API entry points that work across subscriptions - */ - DnsZoneManager authenticate(TokenCredential credential, AzureProfile profile); - } - - /** The implementation for Configurable interface. */ - private static class ConfigurableImpl extends AzureConfigurableImpl implements Configurable { - - public DnsZoneManager authenticate(TokenCredential credential, AzureProfile profile) { - return DnsZoneManager.authenticate(buildHttpPipeline(credential, profile), profile); - } - } - - private DnsZoneManager(HttpPipeline httpPipeline, AzureProfile profile) { - super( - httpPipeline, - profile, - new DnsManagementClientBuilder() - .pipeline(httpPipeline) - .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) - .subscriptionId(profile.getSubscriptionId()) - .buildClient()); - } - - /** @return entry point to DNS zone manager zone management */ - public DnsZones zones() { - if (this.zones == null) { - this.zones = new DnsZonesImpl(this); - } - return this.zones; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/fluent/DnsManagementClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/fluent/DnsManagementClient.java deleted file mode 100644 index 2c710240dbfd..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/fluent/DnsManagementClient.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.dns.fluent; - -import com.azure.core.http.HttpPipeline; -import java.time.Duration; - -/** The interface for DnsManagementClient class. */ -public interface DnsManagementClient { - /** - * Gets The ID of the target subscription. - * - * @return the subscriptionId value. - */ - String getSubscriptionId(); - - /** - * Gets server parameter. - * - * @return the endpoint value. - */ - String getEndpoint(); - - /** - * Gets Api Version. - * - * @return the apiVersion value. - */ - String getApiVersion(); - - /** - * Gets The HTTP pipeline to send requests through. - * - * @return the httpPipeline value. - */ - HttpPipeline getHttpPipeline(); - - /** - * Gets The default poll interval for long-running operation. - * - * @return the defaultPollInterval value. - */ - Duration getDefaultPollInterval(); - - /** - * Gets the RecordSetsClient object to access its operations. - * - * @return the RecordSetsClient object. - */ - RecordSetsClient getRecordSets(); - - /** - * Gets the ZonesClient object to access its operations. - * - * @return the ZonesClient object. - */ - ZonesClient getZones(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/fluent/RecordSetsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/fluent/RecordSetsClient.java deleted file mode 100644 index 3bf1d6c7e3e4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/fluent/RecordSetsClient.java +++ /dev/null @@ -1,562 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.dns.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.dns.fluent.models.RecordSetInner; -import com.azure.resourcemanager.dns.models.RecordType; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in RecordSetsClient. */ -public interface RecordSetsClient { - /** - * Updates a record set within a DNS zone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @param recordType The type of DNS record in this record set. - * @param parameters Parameters supplied to the Update operation. - * @param ifMatch The etag of the record set. Omit this value to always overwrite the current record set. Specify - * the last-seen etag value to prevent accidentally overwriting concurrent changes. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a DNS record set (a collection of DNS records with the same name and type). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateWithResponseAsync( - String resourceGroupName, - String zoneName, - String relativeRecordSetName, - RecordType recordType, - RecordSetInner parameters, - String ifMatch); - - /** - * Updates a record set within a DNS zone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @param recordType The type of DNS record in this record set. - * @param parameters Parameters supplied to the Update operation. - * @param ifMatch The etag of the record set. Omit this value to always overwrite the current record set. Specify - * the last-seen etag value to prevent accidentally overwriting concurrent changes. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a DNS record set (a collection of DNS records with the same name and type). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAsync( - String resourceGroupName, - String zoneName, - String relativeRecordSetName, - RecordType recordType, - RecordSetInner parameters, - String ifMatch); - - /** - * Updates a record set within a DNS zone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @param recordType The type of DNS record in this record set. - * @param parameters Parameters supplied to the Update operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a DNS record set (a collection of DNS records with the same name and type). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAsync( - String resourceGroupName, - String zoneName, - String relativeRecordSetName, - RecordType recordType, - RecordSetInner parameters); - - /** - * Updates a record set within a DNS zone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @param recordType The type of DNS record in this record set. - * @param parameters Parameters supplied to the Update operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a DNS record set (a collection of DNS records with the same name and type). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RecordSetInner update( - String resourceGroupName, - String zoneName, - String relativeRecordSetName, - RecordType recordType, - RecordSetInner parameters); - - /** - * Updates a record set within a DNS zone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @param recordType The type of DNS record in this record set. - * @param parameters Parameters supplied to the Update operation. - * @param ifMatch The etag of the record set. Omit this value to always overwrite the current record set. Specify - * the last-seen etag value to prevent accidentally overwriting concurrent changes. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a DNS record set (a collection of DNS records with the same name and type). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String resourceGroupName, - String zoneName, - String relativeRecordSetName, - RecordType recordType, - RecordSetInner parameters, - String ifMatch, - Context context); - - /** - * Creates or updates a record set within a DNS zone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @param recordType The type of DNS record in this record set. Record sets of type SOA can be updated but not - * created (they are created when the DNS zone is created). - * @param parameters Parameters supplied to the CreateOrUpdate operation. - * @param ifMatch The etag of the record set. Omit this value to always overwrite the current record set. Specify - * the last-seen etag value to prevent accidentally overwriting any concurrent changes. - * @param ifNoneMatch Set to '*' to allow a new record set to be created, but to prevent updating an existing record - * set. Other values will be ignored. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a DNS record set (a collection of DNS records with the same name and type). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, - String zoneName, - String relativeRecordSetName, - RecordType recordType, - RecordSetInner parameters, - String ifMatch, - String ifNoneMatch); - - /** - * Creates or updates a record set within a DNS zone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @param recordType The type of DNS record in this record set. Record sets of type SOA can be updated but not - * created (they are created when the DNS zone is created). - * @param parameters Parameters supplied to the CreateOrUpdate operation. - * @param ifMatch The etag of the record set. Omit this value to always overwrite the current record set. Specify - * the last-seen etag value to prevent accidentally overwriting any concurrent changes. - * @param ifNoneMatch Set to '*' to allow a new record set to be created, but to prevent updating an existing record - * set. Other values will be ignored. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a DNS record set (a collection of DNS records with the same name and type). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, - String zoneName, - String relativeRecordSetName, - RecordType recordType, - RecordSetInner parameters, - String ifMatch, - String ifNoneMatch); - - /** - * Creates or updates a record set within a DNS zone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @param recordType The type of DNS record in this record set. Record sets of type SOA can be updated but not - * created (they are created when the DNS zone is created). - * @param parameters Parameters supplied to the CreateOrUpdate operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a DNS record set (a collection of DNS records with the same name and type). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, - String zoneName, - String relativeRecordSetName, - RecordType recordType, - RecordSetInner parameters); - - /** - * Creates or updates a record set within a DNS zone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @param recordType The type of DNS record in this record set. Record sets of type SOA can be updated but not - * created (they are created when the DNS zone is created). - * @param parameters Parameters supplied to the CreateOrUpdate operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a DNS record set (a collection of DNS records with the same name and type). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RecordSetInner createOrUpdate( - String resourceGroupName, - String zoneName, - String relativeRecordSetName, - RecordType recordType, - RecordSetInner parameters); - - /** - * Creates or updates a record set within a DNS zone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @param recordType The type of DNS record in this record set. Record sets of type SOA can be updated but not - * created (they are created when the DNS zone is created). - * @param parameters Parameters supplied to the CreateOrUpdate operation. - * @param ifMatch The etag of the record set. Omit this value to always overwrite the current record set. Specify - * the last-seen etag value to prevent accidentally overwriting any concurrent changes. - * @param ifNoneMatch Set to '*' to allow a new record set to be created, but to prevent updating an existing record - * set. Other values will be ignored. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a DNS record set (a collection of DNS records with the same name and type). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, - String zoneName, - String relativeRecordSetName, - RecordType recordType, - RecordSetInner parameters, - String ifMatch, - String ifNoneMatch, - Context context); - - /** - * Deletes a record set from a DNS zone. This operation cannot be undone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @param recordType The type of DNS record in this record set. Record sets of type SOA cannot be deleted (they are - * deleted when the DNS zone is deleted). - * @param ifMatch The etag of the record set. Omit this value to always delete the current record set. Specify the - * last-seen etag value to prevent accidentally deleting any concurrent changes. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteWithResponseAsync( - String resourceGroupName, String zoneName, String relativeRecordSetName, RecordType recordType, String ifMatch); - - /** - * Deletes a record set from a DNS zone. This operation cannot be undone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @param recordType The type of DNS record in this record set. Record sets of type SOA cannot be deleted (they are - * deleted when the DNS zone is deleted). - * @param ifMatch The etag of the record set. Omit this value to always delete the current record set. Specify the - * last-seen etag value to prevent accidentally deleting any concurrent changes. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync( - String resourceGroupName, String zoneName, String relativeRecordSetName, RecordType recordType, String ifMatch); - - /** - * Deletes a record set from a DNS zone. This operation cannot be undone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @param recordType The type of DNS record in this record set. Record sets of type SOA cannot be deleted (they are - * deleted when the DNS zone is deleted). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync( - String resourceGroupName, String zoneName, String relativeRecordSetName, RecordType recordType); - - /** - * Deletes a record set from a DNS zone. This operation cannot be undone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @param recordType The type of DNS record in this record set. Record sets of type SOA cannot be deleted (they are - * deleted when the DNS zone is deleted). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String zoneName, String relativeRecordSetName, RecordType recordType); - - /** - * Deletes a record set from a DNS zone. This operation cannot be undone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @param recordType The type of DNS record in this record set. Record sets of type SOA cannot be deleted (they are - * deleted when the DNS zone is deleted). - * @param ifMatch The etag of the record set. Omit this value to always delete the current record set. Specify the - * last-seen etag value to prevent accidentally deleting any concurrent changes. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse( - String resourceGroupName, - String zoneName, - String relativeRecordSetName, - RecordType recordType, - String ifMatch, - Context context); - - /** - * Gets a record set. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @param recordType The type of DNS record in this record set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a record set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync( - String resourceGroupName, String zoneName, String relativeRecordSetName, RecordType recordType); - - /** - * Gets a record set. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @param recordType The type of DNS record in this record set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a record set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync( - String resourceGroupName, String zoneName, String relativeRecordSetName, RecordType recordType); - - /** - * Gets a record set. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @param recordType The type of DNS record in this record set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a record set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RecordSetInner get(String resourceGroupName, String zoneName, String relativeRecordSetName, RecordType recordType); - - /** - * Gets a record set. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @param recordType The type of DNS record in this record set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a record set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, - String zoneName, - String relativeRecordSetName, - RecordType recordType, - Context context); - - /** - * Lists the record sets of a specified type in a DNS zone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param recordType The type of record sets to enumerate. - * @param top The maximum number of record sets to return. If not specified, returns up to 100 record sets. - * @param recordsetnamesuffix The suffix label of the record set name that has to be used to filter the record set - * enumerations. If this parameter is specified, Enumeration will return only records that end with - * .<recordSetNameSuffix>. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a record set List operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByTypeAsync( - String resourceGroupName, String zoneName, RecordType recordType, Integer top, String recordsetnamesuffix); - - /** - * Lists the record sets of a specified type in a DNS zone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param recordType The type of record sets to enumerate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a record set List operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByTypeAsync(String resourceGroupName, String zoneName, RecordType recordType); - - /** - * Lists the record sets of a specified type in a DNS zone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param recordType The type of record sets to enumerate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a record set List operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByType(String resourceGroupName, String zoneName, RecordType recordType); - - /** - * Lists the record sets of a specified type in a DNS zone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param recordType The type of record sets to enumerate. - * @param top The maximum number of record sets to return. If not specified, returns up to 100 record sets. - * @param recordsetnamesuffix The suffix label of the record set name that has to be used to filter the record set - * enumerations. If this parameter is specified, Enumeration will return only records that end with - * .<recordSetNameSuffix>. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a record set List operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByType( - String resourceGroupName, - String zoneName, - RecordType recordType, - Integer top, - String recordsetnamesuffix, - Context context); - - /** - * Lists all record sets in a DNS zone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param top The maximum number of record sets to return. If not specified, returns up to 100 record sets. - * @param recordsetnamesuffix The suffix label of the record set name that has to be used to filter the record set - * enumerations. If this parameter is specified, Enumeration will return only records that end with - * .<recordSetNameSuffix>. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a record set List operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByDnsZoneAsync( - String resourceGroupName, String zoneName, Integer top, String recordsetnamesuffix); - - /** - * Lists all record sets in a DNS zone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a record set List operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByDnsZoneAsync(String resourceGroupName, String zoneName); - - /** - * Lists all record sets in a DNS zone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a record set List operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByDnsZone(String resourceGroupName, String zoneName); - - /** - * Lists all record sets in a DNS zone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param top The maximum number of record sets to return. If not specified, returns up to 100 record sets. - * @param recordsetnamesuffix The suffix label of the record set name that has to be used to filter the record set - * enumerations. If this parameter is specified, Enumeration will return only records that end with - * .<recordSetNameSuffix>. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a record set List operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByDnsZone( - String resourceGroupName, String zoneName, Integer top, String recordsetnamesuffix, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/fluent/ZonesClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/fluent/ZonesClient.java deleted file mode 100644 index 0ecf1556ac8f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/fluent/ZonesClient.java +++ /dev/null @@ -1,403 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.dns.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.dns.fluent.models.ZoneDeleteResultInner; -import com.azure.resourcemanager.dns.fluent.models.ZoneInner; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ZonesClient. */ -public interface ZonesClient - extends InnerSupportsGet, InnerSupportsListing, InnerSupportsDelete { - /** - * Creates or updates a DNS zone. Does not modify DNS records within the zone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param parameters Parameters supplied to the CreateOrUpdate operation. - * @param ifMatch The etag of the DNS zone. Omit this value to always overwrite the current zone. Specify the - * last-seen etag value to prevent accidentally overwriting any concurrent changes. - * @param ifNoneMatch Set to '*' to allow a new DNS zone to be created, but to prevent updating an existing zone. - * Other values will be ignored. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a DNS zone. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String zoneName, ZoneInner parameters, String ifMatch, String ifNoneMatch); - - /** - * Creates or updates a DNS zone. Does not modify DNS records within the zone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param parameters Parameters supplied to the CreateOrUpdate operation. - * @param ifMatch The etag of the DNS zone. Omit this value to always overwrite the current zone. Specify the - * last-seen etag value to prevent accidentally overwriting any concurrent changes. - * @param ifNoneMatch Set to '*' to allow a new DNS zone to be created, but to prevent updating an existing zone. - * Other values will be ignored. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a DNS zone. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, String zoneName, ZoneInner parameters, String ifMatch, String ifNoneMatch); - - /** - * Creates or updates a DNS zone. Does not modify DNS records within the zone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param parameters Parameters supplied to the CreateOrUpdate operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a DNS zone. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync(String resourceGroupName, String zoneName, ZoneInner parameters); - - /** - * Creates or updates a DNS zone. Does not modify DNS records within the zone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param parameters Parameters supplied to the CreateOrUpdate operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a DNS zone. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ZoneInner createOrUpdate(String resourceGroupName, String zoneName, ZoneInner parameters); - - /** - * Creates or updates a DNS zone. Does not modify DNS records within the zone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param parameters Parameters supplied to the CreateOrUpdate operation. - * @param ifMatch The etag of the DNS zone. Omit this value to always overwrite the current zone. Specify the - * last-seen etag value to prevent accidentally overwriting any concurrent changes. - * @param ifNoneMatch Set to '*' to allow a new DNS zone to be created, but to prevent updating an existing zone. - * Other values will be ignored. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a DNS zone. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, - String zoneName, - ZoneInner parameters, - String ifMatch, - String ifNoneMatch, - Context context); - - /** - * Deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be undone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param ifMatch The etag of the DNS zone. Omit this value to always delete the current zone. Specify the last-seen - * etag value to prevent accidentally deleting any concurrent changes. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a Zone Delete operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync(String resourceGroupName, String zoneName, String ifMatch); - - /** - * Deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be undone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param ifMatch The etag of the DNS zone. Omit this value to always delete the current zone. Specify the last-seen - * etag value to prevent accidentally deleting any concurrent changes. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a Zone Delete operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, ZoneDeleteResultInner> beginDeleteAsync( - String resourceGroupName, String zoneName, String ifMatch); - - /** - * Deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be undone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param ifMatch The etag of the DNS zone. Omit this value to always delete the current zone. Specify the last-seen - * etag value to prevent accidentally deleting any concurrent changes. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a Zone Delete operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ZoneDeleteResultInner> beginDelete( - String resourceGroupName, String zoneName, String ifMatch); - - /** - * Deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be undone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param ifMatch The etag of the DNS zone. Omit this value to always delete the current zone. Specify the last-seen - * etag value to prevent accidentally deleting any concurrent changes. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a Zone Delete operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ZoneDeleteResultInner> beginDelete( - String resourceGroupName, String zoneName, String ifMatch, Context context); - - /** - * Deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be undone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param ifMatch The etag of the DNS zone. Omit this value to always delete the current zone. Specify the last-seen - * etag value to prevent accidentally deleting any concurrent changes. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a Zone Delete operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String zoneName, String ifMatch); - - /** - * Deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be undone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a Zone Delete operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String zoneName); - - /** - * Deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be undone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param ifMatch The etag of the DNS zone. Omit this value to always delete the current zone. Specify the last-seen - * etag value to prevent accidentally deleting any concurrent changes. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a Zone Delete operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ZoneDeleteResultInner delete(String resourceGroupName, String zoneName, String ifMatch); - - /** - * Deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be undone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a Zone Delete operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ZoneDeleteResultInner delete(String resourceGroupName, String zoneName); - - /** - * Deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be undone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param ifMatch The etag of the DNS zone. Omit this value to always delete the current zone. Specify the last-seen - * etag value to prevent accidentally deleting any concurrent changes. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a Zone Delete operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ZoneDeleteResultInner delete(String resourceGroupName, String zoneName, String ifMatch, Context context); - - /** - * Gets a DNS zone. Retrieves the zone properties, but not the record sets within the zone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DNS zone. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String zoneName); - - /** - * Gets a DNS zone. Retrieves the zone properties, but not the record sets within the zone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DNS zone. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync(String resourceGroupName, String zoneName); - - /** - * Gets a DNS zone. Retrieves the zone properties, but not the record sets within the zone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DNS zone. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ZoneInner getByResourceGroup(String resourceGroupName, String zoneName); - - /** - * Gets a DNS zone. Retrieves the zone properties, but not the record sets within the zone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DNS zone. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse(String resourceGroupName, String zoneName, Context context); - - /** - * Lists the DNS zones within a resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param top The maximum number of record sets to return. If not specified, returns up to 100 record sets. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a Zone List or ListAll operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName, Integer top); - - /** - * Lists the DNS zones within a resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a Zone List or ListAll operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName); - - /** - * Lists the DNS zones within a resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a Zone List or ListAll operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Lists the DNS zones within a resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param top The maximum number of record sets to return. If not specified, returns up to 100 record sets. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a Zone List or ListAll operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Integer top, Context context); - - /** - * Lists the DNS zones in all resource groups in a subscription. - * - * @param top The maximum number of DNS zones to return. If not specified, returns up to 100 zones. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a Zone List or ListAll operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(Integer top); - - /** - * Lists the DNS zones in all resource groups in a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a Zone List or ListAll operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Lists the DNS zones in all resource groups in a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a Zone List or ListAll operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Lists the DNS zones in all resource groups in a subscription. - * - * @param top The maximum number of DNS zones to return. If not specified, returns up to 100 zones. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a Zone List or ListAll operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Integer top, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/fluent/models/RecordSetInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/fluent/models/RecordSetInner.java deleted file mode 100644 index 43940c43fa79..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/fluent/models/RecordSetInner.java +++ /dev/null @@ -1,420 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.dns.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.dns.models.ARecord; -import com.azure.resourcemanager.dns.models.AaaaRecord; -import com.azure.resourcemanager.dns.models.CnameRecord; -import com.azure.resourcemanager.dns.models.MxRecord; -import com.azure.resourcemanager.dns.models.NsRecord; -import com.azure.resourcemanager.dns.models.PtrRecord; -import com.azure.resourcemanager.dns.models.SoaRecord; -import com.azure.resourcemanager.dns.models.SrvRecord; -import com.azure.resourcemanager.dns.models.TxtRecord; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** Describes a DNS record set (a collection of DNS records with the same name and type). */ -@Fluent -public final class RecordSetInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RecordSetInner.class); - - /* - * The ID of the record set. - */ - @JsonProperty(value = "id") - private String id; - - /* - * The name of the record set. - */ - @JsonProperty(value = "name") - private String name; - - /* - * The type of the record set. - */ - @JsonProperty(value = "type") - private String type; - - /* - * The etag of the record set. - */ - @JsonProperty(value = "etag") - private String etag; - - /* - * The properties of the record set. - */ - @JsonProperty(value = "properties") - private RecordSetProperties innerProperties; - - /** - * Get the id property: The ID of the record set. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: The ID of the record set. - * - * @param id the id value to set. - * @return the RecordSetInner object itself. - */ - public RecordSetInner withId(String id) { - this.id = id; - return this; - } - - /** - * Get the name property: The name of the record set. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the record set. - * - * @param name the name value to set. - * @return the RecordSetInner object itself. - */ - public RecordSetInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the type property: The type of the record set. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Set the type property: The type of the record set. - * - * @param type the type value to set. - * @return the RecordSetInner object itself. - */ - public RecordSetInner withType(String type) { - this.type = type; - return this; - } - - /** - * Get the etag property: The etag of the record set. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: The etag of the record set. - * - * @param etag the etag value to set. - * @return the RecordSetInner object itself. - */ - public RecordSetInner withEtag(String etag) { - this.etag = etag; - return this; - } - - /** - * Get the innerProperties property: The properties of the record set. - * - * @return the innerProperties value. - */ - private RecordSetProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the metadata property: The metadata attached to the record set. - * - * @return the metadata value. - */ - public Map metadata() { - return this.innerProperties() == null ? null : this.innerProperties().metadata(); - } - - /** - * Set the metadata property: The metadata attached to the record set. - * - * @param metadata the metadata value to set. - * @return the RecordSetInner object itself. - */ - public RecordSetInner withMetadata(Map metadata) { - if (this.innerProperties() == null) { - this.innerProperties = new RecordSetProperties(); - } - this.innerProperties().withMetadata(metadata); - return this; - } - - /** - * Get the ttl property: The TTL (time-to-live) of the records in the record set. - * - * @return the ttl value. - */ - public Long ttl() { - return this.innerProperties() == null ? null : this.innerProperties().ttl(); - } - - /** - * Set the ttl property: The TTL (time-to-live) of the records in the record set. - * - * @param ttl the ttl value to set. - * @return the RecordSetInner object itself. - */ - public RecordSetInner withTtl(Long ttl) { - if (this.innerProperties() == null) { - this.innerProperties = new RecordSetProperties(); - } - this.innerProperties().withTtl(ttl); - return this; - } - - /** - * Get the fqdn property: Fully qualified domain name of the record set. - * - * @return the fqdn value. - */ - public String fqdn() { - return this.innerProperties() == null ? null : this.innerProperties().fqdn(); - } - - /** - * Get the aRecords property: The list of A records in the record set. - * - * @return the aRecords value. - */ - public List aRecords() { - return this.innerProperties() == null ? null : this.innerProperties().aRecords(); - } - - /** - * Set the aRecords property: The list of A records in the record set. - * - * @param aRecords the aRecords value to set. - * @return the RecordSetInner object itself. - */ - public RecordSetInner withARecords(List aRecords) { - if (this.innerProperties() == null) { - this.innerProperties = new RecordSetProperties(); - } - this.innerProperties().withARecords(aRecords); - return this; - } - - /** - * Get the aaaaRecords property: The list of AAAA records in the record set. - * - * @return the aaaaRecords value. - */ - public List aaaaRecords() { - return this.innerProperties() == null ? null : this.innerProperties().aaaaRecords(); - } - - /** - * Set the aaaaRecords property: The list of AAAA records in the record set. - * - * @param aaaaRecords the aaaaRecords value to set. - * @return the RecordSetInner object itself. - */ - public RecordSetInner withAaaaRecords(List aaaaRecords) { - if (this.innerProperties() == null) { - this.innerProperties = new RecordSetProperties(); - } - this.innerProperties().withAaaaRecords(aaaaRecords); - return this; - } - - /** - * Get the mxRecords property: The list of MX records in the record set. - * - * @return the mxRecords value. - */ - public List mxRecords() { - return this.innerProperties() == null ? null : this.innerProperties().mxRecords(); - } - - /** - * Set the mxRecords property: The list of MX records in the record set. - * - * @param mxRecords the mxRecords value to set. - * @return the RecordSetInner object itself. - */ - public RecordSetInner withMxRecords(List mxRecords) { - if (this.innerProperties() == null) { - this.innerProperties = new RecordSetProperties(); - } - this.innerProperties().withMxRecords(mxRecords); - return this; - } - - /** - * Get the nsRecords property: The list of NS records in the record set. - * - * @return the nsRecords value. - */ - public List nsRecords() { - return this.innerProperties() == null ? null : this.innerProperties().nsRecords(); - } - - /** - * Set the nsRecords property: The list of NS records in the record set. - * - * @param nsRecords the nsRecords value to set. - * @return the RecordSetInner object itself. - */ - public RecordSetInner withNsRecords(List nsRecords) { - if (this.innerProperties() == null) { - this.innerProperties = new RecordSetProperties(); - } - this.innerProperties().withNsRecords(nsRecords); - return this; - } - - /** - * Get the ptrRecords property: The list of PTR records in the record set. - * - * @return the ptrRecords value. - */ - public List ptrRecords() { - return this.innerProperties() == null ? null : this.innerProperties().ptrRecords(); - } - - /** - * Set the ptrRecords property: The list of PTR records in the record set. - * - * @param ptrRecords the ptrRecords value to set. - * @return the RecordSetInner object itself. - */ - public RecordSetInner withPtrRecords(List ptrRecords) { - if (this.innerProperties() == null) { - this.innerProperties = new RecordSetProperties(); - } - this.innerProperties().withPtrRecords(ptrRecords); - return this; - } - - /** - * Get the srvRecords property: The list of SRV records in the record set. - * - * @return the srvRecords value. - */ - public List srvRecords() { - return this.innerProperties() == null ? null : this.innerProperties().srvRecords(); - } - - /** - * Set the srvRecords property: The list of SRV records in the record set. - * - * @param srvRecords the srvRecords value to set. - * @return the RecordSetInner object itself. - */ - public RecordSetInner withSrvRecords(List srvRecords) { - if (this.innerProperties() == null) { - this.innerProperties = new RecordSetProperties(); - } - this.innerProperties().withSrvRecords(srvRecords); - return this; - } - - /** - * Get the txtRecords property: The list of TXT records in the record set. - * - * @return the txtRecords value. - */ - public List txtRecords() { - return this.innerProperties() == null ? null : this.innerProperties().txtRecords(); - } - - /** - * Set the txtRecords property: The list of TXT records in the record set. - * - * @param txtRecords the txtRecords value to set. - * @return the RecordSetInner object itself. - */ - public RecordSetInner withTxtRecords(List txtRecords) { - if (this.innerProperties() == null) { - this.innerProperties = new RecordSetProperties(); - } - this.innerProperties().withTxtRecords(txtRecords); - return this; - } - - /** - * Get the cnameRecord property: The CNAME record in the record set. - * - * @return the cnameRecord value. - */ - public CnameRecord cnameRecord() { - return this.innerProperties() == null ? null : this.innerProperties().cnameRecord(); - } - - /** - * Set the cnameRecord property: The CNAME record in the record set. - * - * @param cnameRecord the cnameRecord value to set. - * @return the RecordSetInner object itself. - */ - public RecordSetInner withCnameRecord(CnameRecord cnameRecord) { - if (this.innerProperties() == null) { - this.innerProperties = new RecordSetProperties(); - } - this.innerProperties().withCnameRecord(cnameRecord); - return this; - } - - /** - * Get the soaRecord property: The SOA record in the record set. - * - * @return the soaRecord value. - */ - public SoaRecord soaRecord() { - return this.innerProperties() == null ? null : this.innerProperties().soaRecord(); - } - - /** - * Set the soaRecord property: The SOA record in the record set. - * - * @param soaRecord the soaRecord value to set. - * @return the RecordSetInner object itself. - */ - public RecordSetInner withSoaRecord(SoaRecord soaRecord) { - if (this.innerProperties() == null) { - this.innerProperties = new RecordSetProperties(); - } - this.innerProperties().withSoaRecord(soaRecord); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/fluent/models/RecordSetProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/fluent/models/RecordSetProperties.java deleted file mode 100644 index 4ebf69fd4c24..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/fluent/models/RecordSetProperties.java +++ /dev/null @@ -1,365 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.dns.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.dns.models.ARecord; -import com.azure.resourcemanager.dns.models.AaaaRecord; -import com.azure.resourcemanager.dns.models.CnameRecord; -import com.azure.resourcemanager.dns.models.MxRecord; -import com.azure.resourcemanager.dns.models.NsRecord; -import com.azure.resourcemanager.dns.models.PtrRecord; -import com.azure.resourcemanager.dns.models.SoaRecord; -import com.azure.resourcemanager.dns.models.SrvRecord; -import com.azure.resourcemanager.dns.models.TxtRecord; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** Represents the properties of the records in the record set. */ -@Fluent -public final class RecordSetProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RecordSetProperties.class); - - /* - * The metadata attached to the record set. - */ - @JsonProperty(value = "metadata") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map metadata; - - /* - * The TTL (time-to-live) of the records in the record set. - */ - @JsonProperty(value = "TTL") - private Long ttl; - - /* - * Fully qualified domain name of the record set. - */ - @JsonProperty(value = "fqdn", access = JsonProperty.Access.WRITE_ONLY) - private String fqdn; - - /* - * The list of A records in the record set. - */ - @JsonProperty(value = "ARecords") - private List aRecords; - - /* - * The list of AAAA records in the record set. - */ - @JsonProperty(value = "AAAARecords") - private List aaaaRecords; - - /* - * The list of MX records in the record set. - */ - @JsonProperty(value = "MXRecords") - private List mxRecords; - - /* - * The list of NS records in the record set. - */ - @JsonProperty(value = "NSRecords") - private List nsRecords; - - /* - * The list of PTR records in the record set. - */ - @JsonProperty(value = "PTRRecords") - private List ptrRecords; - - /* - * The list of SRV records in the record set. - */ - @JsonProperty(value = "SRVRecords") - private List srvRecords; - - /* - * The list of TXT records in the record set. - */ - @JsonProperty(value = "TXTRecords") - private List txtRecords; - - /* - * The CNAME record in the record set. - */ - @JsonProperty(value = "CNAMERecord") - private CnameRecord cnameRecord; - - /* - * The SOA record in the record set. - */ - @JsonProperty(value = "SOARecord") - private SoaRecord soaRecord; - - /** - * Get the metadata property: The metadata attached to the record set. - * - * @return the metadata value. - */ - public Map metadata() { - return this.metadata; - } - - /** - * Set the metadata property: The metadata attached to the record set. - * - * @param metadata the metadata value to set. - * @return the RecordSetProperties object itself. - */ - public RecordSetProperties withMetadata(Map metadata) { - this.metadata = metadata; - return this; - } - - /** - * Get the ttl property: The TTL (time-to-live) of the records in the record set. - * - * @return the ttl value. - */ - public Long ttl() { - return this.ttl; - } - - /** - * Set the ttl property: The TTL (time-to-live) of the records in the record set. - * - * @param ttl the ttl value to set. - * @return the RecordSetProperties object itself. - */ - public RecordSetProperties withTtl(Long ttl) { - this.ttl = ttl; - return this; - } - - /** - * Get the fqdn property: Fully qualified domain name of the record set. - * - * @return the fqdn value. - */ - public String fqdn() { - return this.fqdn; - } - - /** - * Get the aRecords property: The list of A records in the record set. - * - * @return the aRecords value. - */ - public List aRecords() { - return this.aRecords; - } - - /** - * Set the aRecords property: The list of A records in the record set. - * - * @param aRecords the aRecords value to set. - * @return the RecordSetProperties object itself. - */ - public RecordSetProperties withARecords(List aRecords) { - this.aRecords = aRecords; - return this; - } - - /** - * Get the aaaaRecords property: The list of AAAA records in the record set. - * - * @return the aaaaRecords value. - */ - public List aaaaRecords() { - return this.aaaaRecords; - } - - /** - * Set the aaaaRecords property: The list of AAAA records in the record set. - * - * @param aaaaRecords the aaaaRecords value to set. - * @return the RecordSetProperties object itself. - */ - public RecordSetProperties withAaaaRecords(List aaaaRecords) { - this.aaaaRecords = aaaaRecords; - return this; - } - - /** - * Get the mxRecords property: The list of MX records in the record set. - * - * @return the mxRecords value. - */ - public List mxRecords() { - return this.mxRecords; - } - - /** - * Set the mxRecords property: The list of MX records in the record set. - * - * @param mxRecords the mxRecords value to set. - * @return the RecordSetProperties object itself. - */ - public RecordSetProperties withMxRecords(List mxRecords) { - this.mxRecords = mxRecords; - return this; - } - - /** - * Get the nsRecords property: The list of NS records in the record set. - * - * @return the nsRecords value. - */ - public List nsRecords() { - return this.nsRecords; - } - - /** - * Set the nsRecords property: The list of NS records in the record set. - * - * @param nsRecords the nsRecords value to set. - * @return the RecordSetProperties object itself. - */ - public RecordSetProperties withNsRecords(List nsRecords) { - this.nsRecords = nsRecords; - return this; - } - - /** - * Get the ptrRecords property: The list of PTR records in the record set. - * - * @return the ptrRecords value. - */ - public List ptrRecords() { - return this.ptrRecords; - } - - /** - * Set the ptrRecords property: The list of PTR records in the record set. - * - * @param ptrRecords the ptrRecords value to set. - * @return the RecordSetProperties object itself. - */ - public RecordSetProperties withPtrRecords(List ptrRecords) { - this.ptrRecords = ptrRecords; - return this; - } - - /** - * Get the srvRecords property: The list of SRV records in the record set. - * - * @return the srvRecords value. - */ - public List srvRecords() { - return this.srvRecords; - } - - /** - * Set the srvRecords property: The list of SRV records in the record set. - * - * @param srvRecords the srvRecords value to set. - * @return the RecordSetProperties object itself. - */ - public RecordSetProperties withSrvRecords(List srvRecords) { - this.srvRecords = srvRecords; - return this; - } - - /** - * Get the txtRecords property: The list of TXT records in the record set. - * - * @return the txtRecords value. - */ - public List txtRecords() { - return this.txtRecords; - } - - /** - * Set the txtRecords property: The list of TXT records in the record set. - * - * @param txtRecords the txtRecords value to set. - * @return the RecordSetProperties object itself. - */ - public RecordSetProperties withTxtRecords(List txtRecords) { - this.txtRecords = txtRecords; - return this; - } - - /** - * Get the cnameRecord property: The CNAME record in the record set. - * - * @return the cnameRecord value. - */ - public CnameRecord cnameRecord() { - return this.cnameRecord; - } - - /** - * Set the cnameRecord property: The CNAME record in the record set. - * - * @param cnameRecord the cnameRecord value to set. - * @return the RecordSetProperties object itself. - */ - public RecordSetProperties withCnameRecord(CnameRecord cnameRecord) { - this.cnameRecord = cnameRecord; - return this; - } - - /** - * Get the soaRecord property: The SOA record in the record set. - * - * @return the soaRecord value. - */ - public SoaRecord soaRecord() { - return this.soaRecord; - } - - /** - * Set the soaRecord property: The SOA record in the record set. - * - * @param soaRecord the soaRecord value to set. - * @return the RecordSetProperties object itself. - */ - public RecordSetProperties withSoaRecord(SoaRecord soaRecord) { - this.soaRecord = soaRecord; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (aRecords() != null) { - aRecords().forEach(e -> e.validate()); - } - if (aaaaRecords() != null) { - aaaaRecords().forEach(e -> e.validate()); - } - if (mxRecords() != null) { - mxRecords().forEach(e -> e.validate()); - } - if (nsRecords() != null) { - nsRecords().forEach(e -> e.validate()); - } - if (ptrRecords() != null) { - ptrRecords().forEach(e -> e.validate()); - } - if (srvRecords() != null) { - srvRecords().forEach(e -> e.validate()); - } - if (txtRecords() != null) { - txtRecords().forEach(e -> e.validate()); - } - if (cnameRecord() != null) { - cnameRecord().validate(); - } - if (soaRecord() != null) { - soaRecord().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/fluent/models/ZoneDeleteResultInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/fluent/models/ZoneDeleteResultInner.java deleted file mode 100644 index 3e45477e82b0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/fluent/models/ZoneDeleteResultInner.java +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.dns.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.dns.models.HttpStatusCode; -import com.azure.resourcemanager.dns.models.OperationStatus; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The response to a Zone Delete operation. */ -@Fluent -public final class ZoneDeleteResultInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ZoneDeleteResultInner.class); - - /* - * Users can perform a Get on Azure-AsyncOperation to get the status of - * their delete Zone operations. - */ - @JsonProperty(value = "azureAsyncOperation") - private String azureAsyncOperation; - - /* - * The status property. - */ - @JsonProperty(value = "status") - private OperationStatus status; - - /* - * The statusCode property. - */ - @JsonProperty(value = "statusCode") - private HttpStatusCode statusCode; - - /* - * The requestId property. - */ - @JsonProperty(value = "requestId") - private String requestId; - - /** - * Get the azureAsyncOperation property: Users can perform a Get on Azure-AsyncOperation to get the status of their - * delete Zone operations. - * - * @return the azureAsyncOperation value. - */ - public String azureAsyncOperation() { - return this.azureAsyncOperation; - } - - /** - * Set the azureAsyncOperation property: Users can perform a Get on Azure-AsyncOperation to get the status of their - * delete Zone operations. - * - * @param azureAsyncOperation the azureAsyncOperation value to set. - * @return the ZoneDeleteResultInner object itself. - */ - public ZoneDeleteResultInner withAzureAsyncOperation(String azureAsyncOperation) { - this.azureAsyncOperation = azureAsyncOperation; - return this; - } - - /** - * Get the status property: The status property. - * - * @return the status value. - */ - public OperationStatus status() { - return this.status; - } - - /** - * Set the status property: The status property. - * - * @param status the status value to set. - * @return the ZoneDeleteResultInner object itself. - */ - public ZoneDeleteResultInner withStatus(OperationStatus status) { - this.status = status; - return this; - } - - /** - * Get the statusCode property: The statusCode property. - * - * @return the statusCode value. - */ - public HttpStatusCode statusCode() { - return this.statusCode; - } - - /** - * Set the statusCode property: The statusCode property. - * - * @param statusCode the statusCode value to set. - * @return the ZoneDeleteResultInner object itself. - */ - public ZoneDeleteResultInner withStatusCode(HttpStatusCode statusCode) { - this.statusCode = statusCode; - return this; - } - - /** - * Get the requestId property: The requestId property. - * - * @return the requestId value. - */ - public String requestId() { - return this.requestId; - } - - /** - * Set the requestId property: The requestId property. - * - * @param requestId the requestId value to set. - * @return the ZoneDeleteResultInner object itself. - */ - public ZoneDeleteResultInner withRequestId(String requestId) { - this.requestId = requestId; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/fluent/models/ZoneInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/fluent/models/ZoneInner.java deleted file mode 100644 index 7a440ed2ad51..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/fluent/models/ZoneInner.java +++ /dev/null @@ -1,179 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.dns.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.dns.models.ZoneType; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** Describes a DNS zone. */ -@Fluent -public final class ZoneInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ZoneInner.class); - - /* - * The etag of the zone. - */ - @JsonProperty(value = "etag") - private String etag; - - /* - * The properties of the zone. - */ - @JsonProperty(value = "properties") - private ZoneProperties innerProperties; - - /** - * Get the etag property: The etag of the zone. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: The etag of the zone. - * - * @param etag the etag value to set. - * @return the ZoneInner object itself. - */ - public ZoneInner withEtag(String etag) { - this.etag = etag; - return this; - } - - /** - * Get the innerProperties property: The properties of the zone. - * - * @return the innerProperties value. - */ - private ZoneProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public ZoneInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public ZoneInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the maxNumberOfRecordSets property: The maximum number of record sets that can be created in this DNS zone. - * This is a read-only property and any attempt to set this value will be ignored. - * - * @return the maxNumberOfRecordSets value. - */ - public Long maxNumberOfRecordSets() { - return this.innerProperties() == null ? null : this.innerProperties().maxNumberOfRecordSets(); - } - - /** - * Set the maxNumberOfRecordSets property: The maximum number of record sets that can be created in this DNS zone. - * This is a read-only property and any attempt to set this value will be ignored. - * - * @param maxNumberOfRecordSets the maxNumberOfRecordSets value to set. - * @return the ZoneInner object itself. - */ - public ZoneInner withMaxNumberOfRecordSets(Long maxNumberOfRecordSets) { - if (this.innerProperties() == null) { - this.innerProperties = new ZoneProperties(); - } - this.innerProperties().withMaxNumberOfRecordSets(maxNumberOfRecordSets); - return this; - } - - /** - * Get the maxNumberOfRecordsPerRecordSet property: The maximum number of records per record set that can be created - * in this DNS zone. This is a read-only property and any attempt to set this value will be ignored. - * - * @return the maxNumberOfRecordsPerRecordSet value. - */ - public Long maxNumberOfRecordsPerRecordSet() { - return this.innerProperties() == null ? null : this.innerProperties().maxNumberOfRecordsPerRecordSet(); - } - - /** - * Get the numberOfRecordSets property: The current number of record sets in this DNS zone. This is a read-only - * property and any attempt to set this value will be ignored. - * - * @return the numberOfRecordSets value. - */ - public Long numberOfRecordSets() { - return this.innerProperties() == null ? null : this.innerProperties().numberOfRecordSets(); - } - - /** - * Set the numberOfRecordSets property: The current number of record sets in this DNS zone. This is a read-only - * property and any attempt to set this value will be ignored. - * - * @param numberOfRecordSets the numberOfRecordSets value to set. - * @return the ZoneInner object itself. - */ - public ZoneInner withNumberOfRecordSets(Long numberOfRecordSets) { - if (this.innerProperties() == null) { - this.innerProperties = new ZoneProperties(); - } - this.innerProperties().withNumberOfRecordSets(numberOfRecordSets); - return this; - } - - /** - * Get the nameServers property: The name servers for this DNS zone. This is a read-only property and any attempt to - * set this value will be ignored. - * - * @return the nameServers value. - */ - public List nameServers() { - return this.innerProperties() == null ? null : this.innerProperties().nameServers(); - } - - /** - * Get the zoneType property: The type of this DNS zone (Public or Private). - * - * @return the zoneType value. - */ - public ZoneType zoneType() { - return this.innerProperties() == null ? null : this.innerProperties().zoneType(); - } - - /** - * Set the zoneType property: The type of this DNS zone (Public or Private). - * - * @param zoneType the zoneType value to set. - * @return the ZoneInner object itself. - */ - public ZoneInner withZoneType(ZoneType zoneType) { - if (this.innerProperties() == null) { - this.innerProperties = new ZoneProperties(); - } - this.innerProperties().withZoneType(zoneType); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/fluent/models/ZoneProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/fluent/models/ZoneProperties.java deleted file mode 100644 index fd935e081508..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/fluent/models/ZoneProperties.java +++ /dev/null @@ -1,146 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.dns.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.dns.models.ZoneType; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Represents the properties of the zone. */ -@Fluent -public final class ZoneProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ZoneProperties.class); - - /* - * The maximum number of record sets that can be created in this DNS zone. - * This is a read-only property and any attempt to set this value will be - * ignored. - */ - @JsonProperty(value = "maxNumberOfRecordSets") - private Long maxNumberOfRecordSets; - - /* - * The maximum number of records per record set that can be created in this - * DNS zone. This is a read-only property and any attempt to set this - * value will be ignored. - */ - @JsonProperty(value = "maxNumberOfRecordsPerRecordSet", access = JsonProperty.Access.WRITE_ONLY) - private Long maxNumberOfRecordsPerRecordSet; - - /* - * The current number of record sets in this DNS zone. This is a read-only - * property and any attempt to set this value will be ignored. - */ - @JsonProperty(value = "numberOfRecordSets") - private Long numberOfRecordSets; - - /* - * The name servers for this DNS zone. This is a read-only property and any - * attempt to set this value will be ignored. - */ - @JsonProperty(value = "nameServers", access = JsonProperty.Access.WRITE_ONLY) - private List nameServers; - - /* - * The type of this DNS zone (Public or Private). - */ - @JsonProperty(value = "zoneType") - private ZoneType zoneType; - - /** - * Get the maxNumberOfRecordSets property: The maximum number of record sets that can be created in this DNS zone. - * This is a read-only property and any attempt to set this value will be ignored. - * - * @return the maxNumberOfRecordSets value. - */ - public Long maxNumberOfRecordSets() { - return this.maxNumberOfRecordSets; - } - - /** - * Set the maxNumberOfRecordSets property: The maximum number of record sets that can be created in this DNS zone. - * This is a read-only property and any attempt to set this value will be ignored. - * - * @param maxNumberOfRecordSets the maxNumberOfRecordSets value to set. - * @return the ZoneProperties object itself. - */ - public ZoneProperties withMaxNumberOfRecordSets(Long maxNumberOfRecordSets) { - this.maxNumberOfRecordSets = maxNumberOfRecordSets; - return this; - } - - /** - * Get the maxNumberOfRecordsPerRecordSet property: The maximum number of records per record set that can be created - * in this DNS zone. This is a read-only property and any attempt to set this value will be ignored. - * - * @return the maxNumberOfRecordsPerRecordSet value. - */ - public Long maxNumberOfRecordsPerRecordSet() { - return this.maxNumberOfRecordsPerRecordSet; - } - - /** - * Get the numberOfRecordSets property: The current number of record sets in this DNS zone. This is a read-only - * property and any attempt to set this value will be ignored. - * - * @return the numberOfRecordSets value. - */ - public Long numberOfRecordSets() { - return this.numberOfRecordSets; - } - - /** - * Set the numberOfRecordSets property: The current number of record sets in this DNS zone. This is a read-only - * property and any attempt to set this value will be ignored. - * - * @param numberOfRecordSets the numberOfRecordSets value to set. - * @return the ZoneProperties object itself. - */ - public ZoneProperties withNumberOfRecordSets(Long numberOfRecordSets) { - this.numberOfRecordSets = numberOfRecordSets; - return this; - } - - /** - * Get the nameServers property: The name servers for this DNS zone. This is a read-only property and any attempt to - * set this value will be ignored. - * - * @return the nameServers value. - */ - public List nameServers() { - return this.nameServers; - } - - /** - * Get the zoneType property: The type of this DNS zone (Public or Private). - * - * @return the zoneType value. - */ - public ZoneType zoneType() { - return this.zoneType; - } - - /** - * Set the zoneType property: The type of this DNS zone (Public or Private). - * - * @param zoneType the zoneType value to set. - * @return the ZoneProperties object itself. - */ - public ZoneProperties withZoneType(ZoneType zoneType) { - this.zoneType = zoneType; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/fluent/models/package-info.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/fluent/models/package-info.java deleted file mode 100644 index 35adb1f08296..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/fluent/models/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** Package containing the inner data models for DnsManagementClient. The DNS Management Client. */ -package com.azure.resourcemanager.dns.fluent.models; diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/fluent/package-info.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/fluent/package-info.java deleted file mode 100644 index c726d2032c63..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/fluent/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** Package containing the service clients for DnsManagementClient. The DNS Management Client. */ -package com.azure.resourcemanager.dns.fluent; diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/implementation/ARecordSetImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/implementation/ARecordSetImpl.java deleted file mode 100644 index 8f24fd0b4d15..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/implementation/ARecordSetImpl.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.dns.implementation; - -import com.azure.resourcemanager.dns.models.ARecord; -import com.azure.resourcemanager.dns.models.ARecordSet; -import com.azure.resourcemanager.dns.models.RecordType; -import com.azure.resourcemanager.dns.fluent.models.RecordSetInner; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -/** Implementation of ARecordSet. */ -class ARecordSetImpl extends DnsRecordSetImpl implements ARecordSet { - ARecordSetImpl(final String name, final DnsZoneImpl parent, final RecordSetInner innerModel) { - super(name, RecordType.A.toString(), parent, innerModel); - } - - static ARecordSetImpl newRecordSet(final String name, final DnsZoneImpl parent) { - return new ARecordSetImpl(name, parent, new RecordSetInner().withARecords(new ArrayList<>())); - } - - @Override - public List ipv4Addresses() { - List ipv4Addresses = new ArrayList<>(); - if (this.innerModel().aRecords() != null) { - for (ARecord aRecord : this.innerModel().aRecords()) { - ipv4Addresses.add(aRecord.ipv4Address()); - } - } - return Collections.unmodifiableList(ipv4Addresses); - } - - @Override - protected RecordSetInner prepareForUpdate(RecordSetInner resource) { - if (this.innerModel().aRecords() != null && this.innerModel().aRecords().size() > 0) { - if (resource.aRecords() == null) { - resource.withARecords(new ArrayList<>()); - } - - resource.aRecords().addAll(this.innerModel().aRecords()); - this.innerModel().aRecords().clear(); - } - - if (this.recordSetRemoveInfo.aRecords().size() > 0) { - if (resource.aRecords() != null) { - for (ARecord recordToRemove : this.recordSetRemoveInfo.aRecords()) { - for (ARecord record : resource.aRecords()) { - if (record.ipv4Address().equalsIgnoreCase(recordToRemove.ipv4Address())) { - resource.aRecords().remove(record); - break; - } - } - } - } - this.recordSetRemoveInfo.aRecords().clear(); - } - return resource; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/implementation/ARecordSetsImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/implementation/ARecordSetsImpl.java deleted file mode 100644 index f8a2d795175a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/implementation/ARecordSetsImpl.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.dns.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.dns.models.ARecordSet; -import com.azure.resourcemanager.dns.models.ARecordSets; -import com.azure.resourcemanager.dns.models.RecordType; -import com.azure.resourcemanager.dns.fluent.models.RecordSetInner; -import reactor.core.publisher.Mono; - -/** Implementation of ARecordSets. */ -class ARecordSetsImpl extends DnsRecordSetsBaseImpl implements ARecordSets { - - ARecordSetsImpl(DnsZoneImpl dnsZone) { - super(dnsZone, RecordType.A); - } - - @Override - public ARecordSet getByName(String name) { - return getByNameAsync(name).block(); - } - - @Override - public Mono getByNameAsync(String name) { - return this - .parent() - .manager() - .serviceClient() - .getRecordSets() - .getAsync(this.dnsZone.resourceGroupName(), this.dnsZone.name(), name, this.recordType) - .map(this::wrapModel); - } - - @Override - protected PagedIterable listIntern(String recordSetNameSuffix, Integer pageSize) { - return super - .wrapList( - this - .parent() - .manager() - .serviceClient() - .getRecordSets() - .listByType( - this.dnsZone.resourceGroupName(), - this.dnsZone.name(), - this.recordType, - pageSize, - recordSetNameSuffix, - Context.NONE)); - } - - @Override - protected PagedFlux listInternAsync(String recordSetNameSuffix, Integer pageSize) { - return wrapPageAsync( - this - .parent() - .manager() - .serviceClient() - .getRecordSets() - .listByTypeAsync(this.dnsZone.resourceGroupName(), this.dnsZone.name(), this.recordType)); - } - - @Override - protected ARecordSetImpl wrapModel(RecordSetInner inner) { - return new ARecordSetImpl(inner.name(), this.dnsZone, inner); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/implementation/AaaaRecordSetImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/implementation/AaaaRecordSetImpl.java deleted file mode 100644 index 6e5bf27eac9c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/implementation/AaaaRecordSetImpl.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.dns.implementation; - -import com.azure.resourcemanager.dns.models.AaaaRecord; -import com.azure.resourcemanager.dns.models.AaaaRecordSet; -import com.azure.resourcemanager.dns.models.RecordType; -import com.azure.resourcemanager.dns.fluent.models.RecordSetInner; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -/** Implementation of AaaaRecordSet. */ -class AaaaRecordSetImpl extends DnsRecordSetImpl implements AaaaRecordSet { - - AaaaRecordSetImpl(final String name, final DnsZoneImpl parent, final RecordSetInner innerModel) { - super(name, RecordType.AAAA.toString(), parent, innerModel); - } - - static AaaaRecordSetImpl newRecordSet(final String name, final DnsZoneImpl parent) { - return new AaaaRecordSetImpl(name, parent, new RecordSetInner().withAaaaRecords(new ArrayList<>())); - } - - @Override - public List ipv6Addresses() { - List ipv6Addresses = new ArrayList<>(); - if (this.innerModel().aaaaRecords() != null) { - for (AaaaRecord aaaaRecord : this.innerModel().aaaaRecords()) { - ipv6Addresses.add(aaaaRecord.ipv6Address()); - } - } - return Collections.unmodifiableList(ipv6Addresses); - } - - @Override - protected RecordSetInner prepareForUpdate(RecordSetInner resource) { - if (this.innerModel().aaaaRecords() != null && this.innerModel().aaaaRecords().size() > 0) { - if (resource.aaaaRecords() == null) { - resource.withAaaaRecords(new ArrayList<>()); - } - - resource.aaaaRecords().addAll(this.innerModel().aaaaRecords()); - this.innerModel().aaaaRecords().clear(); - } - - if (this.recordSetRemoveInfo.aaaaRecords().size() > 0) { - if (resource.aaaaRecords() != null) { - for (AaaaRecord recordToRemove : this.recordSetRemoveInfo.aaaaRecords()) { - for (AaaaRecord record : resource.aaaaRecords()) { - if (record.ipv6Address().equalsIgnoreCase(recordToRemove.ipv6Address())) { - resource.aaaaRecords().remove(record); - break; - } - } - } - } - this.recordSetRemoveInfo.aaaaRecords().clear(); - } - return resource; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/implementation/AaaaRecordSetsImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/implementation/AaaaRecordSetsImpl.java deleted file mode 100644 index 8ee915368f82..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/implementation/AaaaRecordSetsImpl.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.dns.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.dns.models.AaaaRecordSet; -import com.azure.resourcemanager.dns.models.AaaaRecordSets; -import com.azure.resourcemanager.dns.models.RecordType; -import com.azure.resourcemanager.dns.fluent.models.RecordSetInner; -import reactor.core.publisher.Mono; - -/** Implementation of AaaaRecordSets. */ -class AaaaRecordSetsImpl extends DnsRecordSetsBaseImpl implements AaaaRecordSets { - - AaaaRecordSetsImpl(DnsZoneImpl dnsZone) { - super(dnsZone, RecordType.AAAA); - } - - @Override - public AaaaRecordSet getByName(String name) { - return getByNameAsync(name).block(); - } - - @Override - public Mono getByNameAsync(String name) { - return this - .parent() - .manager() - .serviceClient() - .getRecordSets() - .getAsync(this.dnsZone.resourceGroupName(), this.dnsZone.name(), name, this.recordType) - .map(this::wrapModel); - } - - @Override - protected PagedIterable listIntern(String recordSetNameSuffix, Integer pageSize) { - return new PagedIterable<>(listInternAsync(recordSetNameSuffix, pageSize)); - } - - @Override - protected PagedFlux listInternAsync(String recordSetNameSuffix, Integer pageSize) { - return wrapPageAsync( - this - .parent() - .manager() - .serviceClient() - .getRecordSets() - .listByTypeAsync( - this.dnsZone.resourceGroupName(), - this.dnsZone.name(), - this.recordType, - pageSize, - recordSetNameSuffix)); - } - - @Override - protected AaaaRecordSetImpl wrapModel(RecordSetInner inner) { - if (inner == null) { - return null; - } - return new AaaaRecordSetImpl(inner.name(), this.dnsZone, inner); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/implementation/CnameRecordSetImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/implementation/CnameRecordSetImpl.java deleted file mode 100644 index 92b6eec2c82a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/implementation/CnameRecordSetImpl.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.dns.implementation; - -import com.azure.resourcemanager.dns.models.CnameRecordSet; -import com.azure.resourcemanager.dns.models.CnameRecord; -import com.azure.resourcemanager.dns.models.RecordType; -import com.azure.resourcemanager.dns.fluent.models.RecordSetInner; - -/** Implementation of CnameRecordSet. */ -class CnameRecordSetImpl extends DnsRecordSetImpl implements CnameRecordSet { - CnameRecordSetImpl(final String name, final DnsZoneImpl parent, final RecordSetInner innerModel) { - super(name, RecordType.CNAME.toString(), parent, innerModel); - } - - static CnameRecordSetImpl newRecordSet(final String name, final DnsZoneImpl parent) { - return new CnameRecordSetImpl(name, parent, new RecordSetInner().withCnameRecord(new CnameRecord())); - } - - @Override - public String canonicalName() { - if (this.innerModel().cnameRecord() != null) { - return this.innerModel().cnameRecord().cname(); - } - return null; - } - - @Override - protected RecordSetInner prepareForUpdate(RecordSetInner resource) { - if (resource.cnameRecord() == null) { - resource.withCnameRecord(new CnameRecord()); - } - if (innerModel().cnameRecord().cname() != null) { - resource.cnameRecord().withCname(innerModel().cnameRecord().cname()); - } - innerModel().withCnameRecord(new CnameRecord()); - return resource; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/implementation/CnameRecordSetsImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/implementation/CnameRecordSetsImpl.java deleted file mode 100644 index 2c3f5ce34482..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/implementation/CnameRecordSetsImpl.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.dns.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.dns.models.CnameRecordSet; -import com.azure.resourcemanager.dns.models.CnameRecordSets; -import com.azure.resourcemanager.dns.models.RecordType; -import com.azure.resourcemanager.dns.fluent.models.RecordSetInner; -import reactor.core.publisher.Mono; - -/** Implementation of CnameRecordSets. */ -class CnameRecordSetsImpl extends DnsRecordSetsBaseImpl implements CnameRecordSets { - - CnameRecordSetsImpl(DnsZoneImpl dnsZone) { - super(dnsZone, RecordType.CNAME); - } - - @Override - public CnameRecordSet getByName(String name) { - return getByNameAsync(name).block(); - } - - @Override - public Mono getByNameAsync(String name) { - return this - .parent() - .manager() - .serviceClient() - .getRecordSets() - .getAsync(this.dnsZone.resourceGroupName(), this.dnsZone.name(), name, this.recordType) - .map(this::wrapModel); - } - - @Override - protected PagedIterable listIntern(String recordSetNameSuffix, Integer pageSize) { - return super - .wrapList( - this - .parent() - .manager() - .serviceClient() - .getRecordSets() - .listByType( - this.dnsZone.resourceGroupName(), - this.dnsZone.name(), - this.recordType, - pageSize, - recordSetNameSuffix, - Context.NONE)); - } - - @Override - protected PagedFlux listInternAsync(String recordSetNameSuffix, Integer pageSize) { - return wrapPageAsync( - this - .parent() - .manager() - .serviceClient() - .getRecordSets() - .listByTypeAsync(this.dnsZone.resourceGroupName(), this.dnsZone.name(), this.recordType)); - } - - @Override - protected CnameRecordSetImpl wrapModel(RecordSetInner inner) { - if (inner == null) { - return null; - } - return new CnameRecordSetImpl(inner.name(), this.dnsZone, inner); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/implementation/DnsManagementClientBuilder.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/implementation/DnsManagementClientBuilder.java deleted file mode 100644 index 2965a20ddf11..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/implementation/DnsManagementClientBuilder.java +++ /dev/null @@ -1,146 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.dns.implementation; - -import com.azure.core.annotation.ServiceClientBuilder; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.policy.CookiePolicy; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerAdapter; -import java.time.Duration; - -/** A builder for creating a new instance of the DnsManagementClientImpl type. */ -@ServiceClientBuilder(serviceClients = {DnsManagementClientImpl.class}) -public final class DnsManagementClientBuilder { - /* - * The ID of the target subscription. - */ - private String subscriptionId; - - /** - * Sets The ID of the target subscription. - * - * @param subscriptionId the subscriptionId value. - * @return the DnsManagementClientBuilder. - */ - public DnsManagementClientBuilder subscriptionId(String subscriptionId) { - this.subscriptionId = subscriptionId; - return this; - } - - /* - * server parameter - */ - private String endpoint; - - /** - * Sets server parameter. - * - * @param endpoint the endpoint value. - * @return the DnsManagementClientBuilder. - */ - public DnsManagementClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * The environment to connect to - */ - private AzureEnvironment environment; - - /** - * Sets The environment to connect to. - * - * @param environment the environment value. - * @return the DnsManagementClientBuilder. - */ - public DnsManagementClientBuilder environment(AzureEnvironment environment) { - this.environment = environment; - return this; - } - - /* - * The default poll interval for long-running operation - */ - private Duration defaultPollInterval; - - /** - * Sets The default poll interval for long-running operation. - * - * @param defaultPollInterval the defaultPollInterval value. - * @return the DnsManagementClientBuilder. - */ - public DnsManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = defaultPollInterval; - return this; - } - - /* - * The HTTP pipeline to send requests through - */ - private HttpPipeline pipeline; - - /** - * Sets The HTTP pipeline to send requests through. - * - * @param pipeline the pipeline value. - * @return the DnsManagementClientBuilder. - */ - public DnsManagementClientBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; - return this; - } - - /* - * The serializer to serialize an object into a string - */ - private SerializerAdapter serializerAdapter; - - /** - * Sets The serializer to serialize an object into a string. - * - * @param serializerAdapter the serializerAdapter value. - * @return the DnsManagementClientBuilder. - */ - public DnsManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { - this.serializerAdapter = serializerAdapter; - return this; - } - - /** - * Builds an instance of DnsManagementClientImpl with the provided parameters. - * - * @return an instance of DnsManagementClientImpl. - */ - public DnsManagementClientImpl buildClient() { - if (endpoint == null) { - this.endpoint = "https://management.azure.com"; - } - if (environment == null) { - this.environment = AzureEnvironment.AZURE; - } - if (defaultPollInterval == null) { - this.defaultPollInterval = Duration.ofSeconds(30); - } - if (pipeline == null) { - this.pipeline = - new HttpPipelineBuilder() - .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) - .build(); - } - if (serializerAdapter == null) { - this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); - } - DnsManagementClientImpl client = - new DnsManagementClientImpl( - pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); - return client; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/implementation/DnsManagementClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/implementation/DnsManagementClientImpl.java deleted file mode 100644 index 83bae8cc4db5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/implementation/DnsManagementClientImpl.java +++ /dev/null @@ -1,146 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.dns.implementation; - -import com.azure.core.annotation.ServiceClient; -import com.azure.core.http.HttpPipeline; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.serializer.SerializerAdapter; -import com.azure.resourcemanager.dns.fluent.DnsManagementClient; -import com.azure.resourcemanager.dns.fluent.RecordSetsClient; -import com.azure.resourcemanager.dns.fluent.ZonesClient; -import com.azure.resourcemanager.resources.fluentcore.AzureServiceClient; -import java.time.Duration; - -/** Initializes a new instance of the DnsManagementClientImpl type. */ -@ServiceClient(builder = DnsManagementClientBuilder.class) -public final class DnsManagementClientImpl extends AzureServiceClient implements DnsManagementClient { - private final ClientLogger logger = new ClientLogger(DnsManagementClientImpl.class); - - /** The ID of the target subscription. */ - private final String subscriptionId; - - /** - * Gets The ID of the target subscription. - * - * @return the subscriptionId value. - */ - public String getSubscriptionId() { - return this.subscriptionId; - } - - /** server parameter. */ - private final String endpoint; - - /** - * Gets server parameter. - * - * @return the endpoint value. - */ - public String getEndpoint() { - return this.endpoint; - } - - /** Api Version. */ - private final String apiVersion; - - /** - * Gets Api Version. - * - * @return the apiVersion value. - */ - public String getApiVersion() { - return this.apiVersion; - } - - /** The HTTP pipeline to send requests through. */ - private final HttpPipeline httpPipeline; - - /** - * Gets The HTTP pipeline to send requests through. - * - * @return the httpPipeline value. - */ - public HttpPipeline getHttpPipeline() { - return this.httpPipeline; - } - - /** The serializer to serialize an object into a string. */ - private final SerializerAdapter serializerAdapter; - - /** - * Gets The serializer to serialize an object into a string. - * - * @return the serializerAdapter value. - */ - SerializerAdapter getSerializerAdapter() { - return this.serializerAdapter; - } - - /** The default poll interval for long-running operation. */ - private final Duration defaultPollInterval; - - /** - * Gets The default poll interval for long-running operation. - * - * @return the defaultPollInterval value. - */ - public Duration getDefaultPollInterval() { - return this.defaultPollInterval; - } - - /** The RecordSetsClient object to access its operations. */ - private final RecordSetsClient recordSets; - - /** - * Gets the RecordSetsClient object to access its operations. - * - * @return the RecordSetsClient object. - */ - public RecordSetsClient getRecordSets() { - return this.recordSets; - } - - /** The ZonesClient object to access its operations. */ - private final ZonesClient zones; - - /** - * Gets the ZonesClient object to access its operations. - * - * @return the ZonesClient object. - */ - public ZonesClient getZones() { - return this.zones; - } - - /** - * Initializes an instance of DnsManagementClient client. - * - * @param httpPipeline The HTTP pipeline to send requests through. - * @param serializerAdapter The serializer to serialize an object into a string. - * @param defaultPollInterval The default poll interval for long-running operation. - * @param environment The Azure environment. - * @param subscriptionId The ID of the target subscription. - * @param endpoint server parameter. - */ - DnsManagementClientImpl( - HttpPipeline httpPipeline, - SerializerAdapter serializerAdapter, - Duration defaultPollInterval, - AzureEnvironment environment, - String subscriptionId, - String endpoint) { - super(httpPipeline, serializerAdapter, environment); - this.httpPipeline = httpPipeline; - this.serializerAdapter = serializerAdapter; - this.defaultPollInterval = defaultPollInterval; - this.subscriptionId = subscriptionId; - this.endpoint = endpoint; - this.apiVersion = "2016-04-01"; - this.recordSets = new RecordSetsClientImpl(this); - this.zones = new ZonesClientImpl(this); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/implementation/DnsRecordSetImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/implementation/DnsRecordSetImpl.java deleted file mode 100644 index 07fed427706f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/implementation/DnsRecordSetImpl.java +++ /dev/null @@ -1,391 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.dns.implementation; - -import com.azure.resourcemanager.dns.models.ARecord; -import com.azure.resourcemanager.dns.models.AaaaRecord; -import com.azure.resourcemanager.dns.models.CnameRecord; -import com.azure.resourcemanager.dns.models.DnsRecordSet; -import com.azure.resourcemanager.dns.models.DnsZone; -import com.azure.resourcemanager.dns.models.MxRecord; -import com.azure.resourcemanager.dns.models.NsRecord; -import com.azure.resourcemanager.dns.models.PtrRecord; -import com.azure.resourcemanager.dns.models.RecordType; -import com.azure.resourcemanager.dns.models.SrvRecord; -import com.azure.resourcemanager.dns.models.TxtRecord; -import com.azure.resourcemanager.dns.fluent.models.RecordSetInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.ExternalChildResourceImpl; -import com.azure.resourcemanager.resources.fluentcore.utils.ETagState; -import reactor.core.publisher.Mono; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; - -/** Implementation of DnsRecordSet. */ -class DnsRecordSetImpl extends ExternalChildResourceImpl - implements DnsRecordSet, - DnsRecordSet.Definition, - DnsRecordSet.UpdateDefinition, - DnsRecordSet.UpdateCombined { - protected final RecordSetInner recordSetRemoveInfo; - protected final String type; - private final ETagState etagState = new ETagState(); - - protected DnsRecordSetImpl(String name, String type, final DnsZoneImpl parent, final RecordSetInner innerModel) { - super(name, parent, innerModel); - this.type = type; - this.recordSetRemoveInfo = - new RecordSetInner() - .withARecords(new ArrayList<>()) - .withAaaaRecords(new ArrayList<>()) - .withCnameRecord(new CnameRecord()) - .withMxRecords(new ArrayList<>()) - .withNsRecords(new ArrayList<>()) - .withPtrRecords(new ArrayList<>()) - .withSrvRecords(new ArrayList<>()) - .withTxtRecords(new ArrayList<>()) - .withMetadata(new LinkedHashMap<>()); - } - - @Override - public String id() { - return innerModel().id(); - } - - @Override - public RecordType recordType() { - String fullyQualifiedType = this.type; - String[] parts = fullyQualifiedType.split("/"); - return RecordType.fromString(parts[parts.length - 1]); - } - - @Override - public long timeToLive() { - return this.innerModel().ttl(); - } - - @Override - public Map metadata() { - if (this.innerModel().metadata() == null) { - return Collections.unmodifiableMap(new LinkedHashMap()); - } - return Collections.unmodifiableMap(this.innerModel().metadata()); - } - - @Override - public String fqdn() { - return this.innerModel().fqdn(); - } - - @Override - public String etag() { - return this.innerModel().etag(); - } - - // Setters - - @Override - public DnsRecordSetImpl withIPv4Address(String ipv4Address) { - this.innerModel().aRecords().add(new ARecord().withIpv4Address(ipv4Address)); - return this; - } - - @Override - public DnsRecordSetImpl withoutIPv4Address(String ipv4Address) { - this.recordSetRemoveInfo.aRecords().add(new ARecord().withIpv4Address(ipv4Address)); - return this; - } - - @Override - public DnsRecordSetImpl withIPv6Address(String ipv6Address) { - this.innerModel().aaaaRecords().add(new AaaaRecord().withIpv6Address(ipv6Address)); - return this; - } - - @Override - public DnsRecordSetImpl withoutIPv6Address(String ipv6Address) { - this.recordSetRemoveInfo.aaaaRecords().add(new AaaaRecord().withIpv6Address(ipv6Address)); - return this; - } - - @Override - public DnsRecordSetImpl withAlias(String alias) { - this.innerModel().cnameRecord().withCname(alias); - return this; - } - - @Override - public DnsRecordSetImpl withMailExchange(String mailExchangeHostName, int priority) { - this.innerModel().mxRecords().add(new MxRecord().withExchange(mailExchangeHostName).withPreference(priority)); - return this; - } - - @Override - public DnsRecordSetImpl withoutMailExchange(String mailExchangeHostName, int priority) { - this - .recordSetRemoveInfo - .mxRecords() - .add(new MxRecord().withExchange(mailExchangeHostName).withPreference(priority)); - return this; - } - - @Override - public DnsRecordSetImpl withNameServer(String nameServerHostName) { - this.innerModel().nsRecords().add(new NsRecord().withNsdname(nameServerHostName)); - return this; - } - - @Override - public DnsRecordSetImpl withoutNameServer(String nameServerHostName) { - this.recordSetRemoveInfo.nsRecords().add(new NsRecord().withNsdname(nameServerHostName)); - return this; - } - - @Override - public DnsRecordSetImpl withTargetDomainName(String targetDomainName) { - this.innerModel().ptrRecords().add(new PtrRecord().withPtrdname(targetDomainName)); - return this; - } - - @Override - public DnsRecordSetImpl withoutTargetDomainName(String targetDomainName) { - this.recordSetRemoveInfo.ptrRecords().add(new PtrRecord().withPtrdname(targetDomainName)); - return this; - } - - @Override - public DnsRecordSetImpl withRecord(String target, int port, int priority, int weight) { - this - .innerModel() - .srvRecords() - .add(new SrvRecord().withTarget(target).withPort(port).withPriority(priority).withWeight(weight)); - return this; - } - - @Override - public DnsRecordSetImpl withoutRecord(String target, int port, int priority, int weight) { - this - .recordSetRemoveInfo - .srvRecords() - .add(new SrvRecord().withTarget(target).withPort(port).withPriority(priority).withWeight(weight)); - return this; - } - - @Override - public DnsRecordSetImpl withText(String text) { - if (text == null) { - return this; - } - List chunks = new ArrayList<>(); - for (String chunk : text.split("(?<=\\G.{250})")) { - chunks.add(chunk); - } - this.innerModel().txtRecords().add(new TxtRecord().withValue(chunks)); - return this; - } - - @Override - public DnsRecordSetImpl withoutText(String text) { - if (text == null) { - return this; - } - List chunks = new ArrayList<>(); - chunks.add(text); - return withoutText(chunks); - } - - @Override - public DnsRecordSetImpl withoutText(List textChunks) { - this.recordSetRemoveInfo.txtRecords().add(new TxtRecord().withValue(textChunks)); - return this; - } - - @Override - public DnsRecordSetImpl withEmailServer(String emailServerHostName) { - this.innerModel().soaRecord().withEmail(emailServerHostName); - return this; - } - - @Override - public DnsRecordSetImpl withRefreshTimeInSeconds(long refreshTimeInSeconds) { - this.innerModel().soaRecord().withRefreshTime(refreshTimeInSeconds); - return this; - } - - @Override - public DnsRecordSetImpl withRetryTimeInSeconds(long retryTimeInSeconds) { - this.innerModel().soaRecord().withRetryTime(retryTimeInSeconds); - return this; - } - - @Override - public DnsRecordSetImpl withExpireTimeInSeconds(long expireTimeInSeconds) { - this.innerModel().soaRecord().withExpireTime(expireTimeInSeconds); - return this; - } - - @Override - public DnsRecordSetImpl withNegativeResponseCachingTimeToLiveInSeconds(long negativeCachingTimeToLive) { - this.innerModel().soaRecord().withMinimumTtl(negativeCachingTimeToLive); - return this; - } - - @Override - public DnsRecordSetImpl withSerialNumber(long serialNumber) { - this.innerModel().soaRecord().withSerialNumber(serialNumber); - return this; - } - - @Override - public DnsRecordSetImpl withTimeToLive(long ttlInSeconds) { - this.innerModel().withTtl(ttlInSeconds); - return this; - } - - @Override - public DnsRecordSetImpl withMetadata(String key, String value) { - if (this.innerModel().metadata() == null) { - this.innerModel().withMetadata(new LinkedHashMap()); - } - this.innerModel().metadata().put(key, value); - return this; - } - - @Override - public DnsRecordSetImpl withoutMetadata(String key) { - this.recordSetRemoveInfo.metadata().put(key, null); - return this; - } - - @Override - public DnsRecordSetImpl withETagCheck() { - this.etagState.withImplicitETagCheckOnCreateOrUpdate(this.isInCreateMode()); - return this; - } - - @Override - public DnsRecordSetImpl withETagCheck(String etagValue) { - this.etagState.withExplicitETagCheckOnUpdate(etagValue); - return this; - } - - // - - @Override - public Mono createResourceAsync() { - return createOrUpdateAsync(this.innerModel()); - } - - @Override - public Mono updateResourceAsync() { - return this - .parent() - .manager() - .serviceClient() - .getRecordSets() - .getAsync(this.parent().resourceGroupName(), this.parent().name(), this.name(), this.recordType()) - .map(recordSetInner -> prepare(recordSetInner)) - .flatMap(recordSetInner -> createOrUpdateAsync(recordSetInner)); - } - - @Override - public Mono deleteResourceAsync() { - return this - .parent() - .manager() - .serviceClient() - .getRecordSets() - .deleteAsync( - this.parent().resourceGroupName(), - this.parent().name(), - this.name(), - this.recordType(), - this.etagState.ifMatchValueOnDelete()); - } - - @Override - public DnsZoneImpl attach() { - return this.parent(); - } - - @Override - public String childResourceKey() { - return this.name() + "_" + this.recordType().toString(); - } - - @Override - protected Mono getInnerAsync() { - return this - .parent() - .manager() - .serviceClient() - .getRecordSets() - .getAsync(this.parent().resourceGroupName(), this.parent().name(), this.name(), this.recordType()); - } - - private Mono createOrUpdateAsync(RecordSetInner resource) { - final DnsRecordSetImpl self = this; - return this - .parent() - .manager() - .serviceClient() - .getRecordSets() - .createOrUpdateAsync( - this.parent().resourceGroupName(), - this.parent().name(), - this.name(), - this.recordType(), - resource, - etagState.ifMatchValueOnUpdate(resource.etag()), - etagState.ifNonMatchValueOnCreate()) - .map( - recordSetInner -> { - setInner(recordSetInner); - self.etagState.clear(); - return self; - }); - } - - private RecordSetInner prepare(RecordSetInner resource) { - if (this.recordSetRemoveInfo.metadata().size() > 0) { - if (resource.metadata() != null) { - for (String key : this.recordSetRemoveInfo.metadata().keySet()) { - resource.metadata().remove(key); - } - } - this.recordSetRemoveInfo.metadata().clear(); - } - if (this.innerModel().metadata() != null && this.innerModel().metadata().size() > 0) { - if (resource.metadata() == null) { - resource.withMetadata(new LinkedHashMap<>()); - } - for (Map.Entry keyVal : this.innerModel().metadata().entrySet()) { - resource.metadata().put(keyVal.getKey(), keyVal.getValue()); - } - this.innerModel().metadata().clear(); - } - - if (this.innerModel().ttl() != null) { - resource.withTtl(this.innerModel().ttl()); - this.innerModel().withTtl(null); - } - - return prepareForUpdate(resource); - } - - protected RecordSetInner prepareForUpdate(RecordSetInner resource) { - return resource; - } - - DnsRecordSetImpl withETagOnDelete(String etagValue) { - this.etagState.withExplicitETagCheckOnDelete(etagValue); - return this; - } - - private boolean isInCreateMode() { - return this.innerModel().id() == null; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/implementation/DnsRecordSetsBaseImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/implementation/DnsRecordSetsBaseImpl.java deleted file mode 100644 index f078cda2a50e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/implementation/DnsRecordSetsBaseImpl.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.dns.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.dns.models.DnsRecordSets; -import com.azure.resourcemanager.dns.models.RecordType; -import com.azure.resourcemanager.dns.fluent.models.RecordSetInner; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.ReadableWrappersImpl; - -/** The base implementation for Dns Record sets. */ -abstract class DnsRecordSetsBaseImpl - extends ReadableWrappersImpl implements DnsRecordSets { - /** the parent DNS zone of the record set. */ - protected final DnsZoneImpl dnsZone; - /** the record type in the record set. */ - protected final RecordType recordType; - - /** - * Creates DnsRecordSetsBaseImpl. - * - * @param parent the parent DNS zone of the record set - * @param recordType the record type in the record set - */ - DnsRecordSetsBaseImpl(DnsZoneImpl parent, RecordType recordType) { - this.dnsZone = parent; - this.recordType = recordType; - } - - @Override - public PagedIterable list() { - return listIntern(null, null); - } - - @Override - public PagedIterable list(String recordSetNameSuffix) { - return listIntern(recordSetNameSuffix, null); - } - - @Override - public PagedIterable list(int pageSize) { - return listIntern(null, pageSize); - } - - @Override - public PagedIterable list(String recordSetNameSuffix, int pageSize) { - return listIntern(recordSetNameSuffix, pageSize); - } - - @Override - public PagedFlux listAsync() { - return listInternAsync(null, null); - } - - @Override - public PagedFlux listAsync(String recordSetNameSuffix) { - return listInternAsync(recordSetNameSuffix, null); - } - - @Override - public PagedFlux listAsync(int pageSize) { - return listInternAsync(null, pageSize); - } - - @Override - public PagedFlux listAsync(String recordSetNameSuffix, int pageSize) { - return listInternAsync(recordSetNameSuffix, pageSize); - } - - @Override - public DnsZoneImpl parent() { - return this.dnsZone; - } - - protected abstract PagedIterable listIntern(String recordSetNameSuffix, Integer pageSize); - - protected abstract PagedFlux listInternAsync(String recordSetNameSuffix, Integer pageSize); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/implementation/DnsRecordSetsImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/implementation/DnsRecordSetsImpl.java deleted file mode 100644 index e3cd7c313543..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/implementation/DnsRecordSetsImpl.java +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.dns.implementation; - -import com.azure.resourcemanager.dns.models.DnsRecordSet; -import com.azure.resourcemanager.dns.models.DnsZone; -import com.azure.resourcemanager.dns.fluent.models.RecordSetInner; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.ExternalChildResourcesNonCachedImpl; - -/** Represents an record set collection associated with a DNS zone. */ -class DnsRecordSetsImpl - extends ExternalChildResourcesNonCachedImpl { - /** The default record set ttl in seconds. */ - private static final long DEFAULT_TTL_IN_SECONDS = 3600; - - /** - * Creates new DnsRecordSetsImpl. - * - * @param parent the parent DNS zone of the record set - */ - DnsRecordSetsImpl(DnsZoneImpl parent) { - super(parent, parent.taskGroup(), "RecordSet"); - } - - DnsRecordSetImpl defineARecordSet(String name) { - return setDefaults(prepareInlineDefine(ARecordSetImpl.newRecordSet(name, this.getParent()))); - } - - DnsRecordSetImpl defineAaaaRecordSet(String name) { - return setDefaults(prepareInlineDefine(AaaaRecordSetImpl.newRecordSet(name, this.getParent()))); - } - - void withCNameRecordSet(String name, String alias) { - CnameRecordSetImpl recordSet = CnameRecordSetImpl.newRecordSet(name, this.getParent()); - recordSet.innerModel().cnameRecord().withCname(alias); - setDefaults(prepareInlineDefine(recordSet.withTimeToLive(DEFAULT_TTL_IN_SECONDS))); - } - - DnsRecordSetImpl defineCNameRecordSet(String name) { - return setDefaults(prepareInlineDefine(CnameRecordSetImpl.newRecordSet(name, this.getParent()))); - } - - DnsRecordSetImpl defineMXRecordSet(String name) { - return setDefaults(prepareInlineDefine(MxRecordSetImpl.newRecordSet(name, this.getParent()))); - } - - DnsRecordSetImpl defineNSRecordSet(String name) { - return setDefaults(prepareInlineDefine(NsRecordSetImpl.newRecordSet(name, this.getParent()))); - } - - DnsRecordSetImpl definePtrRecordSet(String name) { - return setDefaults(prepareInlineDefine(PtrRecordSetImpl.newRecordSet(name, this.getParent()))); - } - - DnsRecordSetImpl defineSrvRecordSet(String name) { - return setDefaults(prepareInlineDefine(SrvRecordSetImpl.newRecordSet(name, this.getParent()))); - } - - DnsRecordSetImpl defineTxtRecordSet(String name) { - return setDefaults(prepareInlineDefine(TxtRecordSetImpl.newRecordSet(name, this.getParent()))); - } - - DnsRecordSetImpl updateARecordSet(String name) { - return prepareInlineUpdate(ARecordSetImpl.newRecordSet(name, this.getParent())); - } - - DnsRecordSetImpl updateAaaaRecordSet(String name) { - return prepareInlineUpdate(AaaaRecordSetImpl.newRecordSet(name, this.getParent())); - } - - DnsRecordSetImpl updateMXRecordSet(String name) { - return prepareInlineUpdate(MxRecordSetImpl.newRecordSet(name, this.getParent())); - } - - DnsRecordSetImpl updateCNameRecordSet(String name) { - return prepareInlineUpdate(CnameRecordSetImpl.newRecordSet(name, this.getParent())); - } - - DnsRecordSetImpl updateNSRecordSet(String name) { - return prepareInlineUpdate(NsRecordSetImpl.newRecordSet(name, this.getParent())); - } - - DnsRecordSetImpl updatePtrRecordSet(String name) { - return prepareInlineUpdate(PtrRecordSetImpl.newRecordSet(name, this.getParent())); - } - - DnsRecordSetImpl updateSrvRecordSet(String name) { - return prepareInlineUpdate(SrvRecordSetImpl.newRecordSet(name, this.getParent())); - } - - DnsRecordSetImpl updateTxtRecordSet(String name) { - return prepareInlineUpdate(TxtRecordSetImpl.newRecordSet(name, this.getParent())); - } - - DnsRecordSetImpl updateSoaRecordSet() { - return prepareInlineUpdate(SoaRecordSetImpl.newRecordSet(this.getParent())); - } - - void withoutARecordSet(String name, String eTagValue) { - prepareInlineRemove(ARecordSetImpl.newRecordSet(name, this.getParent()).withETagOnDelete(eTagValue)); - } - - void withoutAaaaRecordSet(String name, String eTagValue) { - prepareInlineRemove(AaaaRecordSetImpl.newRecordSet(name, this.getParent()).withETagOnDelete(eTagValue)); - } - - void withoutCNameRecordSet(String name, String eTagValue) { - prepareInlineRemove(CnameRecordSetImpl.newRecordSet(name, this.getParent()).withETagOnDelete(eTagValue)); - } - - void withoutMXRecordSet(String name, String eTagValue) { - prepareInlineRemove(MxRecordSetImpl.newRecordSet(name, this.getParent()).withETagOnDelete(eTagValue)); - } - - void withoutNSRecordSet(String name, String eTagValue) { - prepareInlineRemove(NsRecordSetImpl.newRecordSet(name, this.getParent()).withETagOnDelete(eTagValue)); - } - - void withoutPtrRecordSet(String name, String eTagValue) { - prepareInlineRemove(PtrRecordSetImpl.newRecordSet(name, this.getParent()).withETagOnDelete(eTagValue)); - } - - void withoutSrvRecordSet(String name, String eTagValue) { - prepareInlineRemove(SrvRecordSetImpl.newRecordSet(name, this.getParent()).withETagOnDelete(eTagValue)); - } - - void withoutTxtRecordSet(String name, String eTagValue) { - prepareInlineRemove(TxtRecordSetImpl.newRecordSet(name, this.getParent()).withETagOnDelete(eTagValue)); - } - - private DnsRecordSetImpl setDefaults(DnsRecordSetImpl recordSet) { - return recordSet.withTimeToLive(DEFAULT_TTL_IN_SECONDS); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/implementation/DnsZoneImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/implementation/DnsZoneImpl.java deleted file mode 100644 index 8fb820946e0a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/implementation/DnsZoneImpl.java +++ /dev/null @@ -1,450 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.dns.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.dns.DnsZoneManager; -import com.azure.resourcemanager.dns.models.ARecordSets; -import com.azure.resourcemanager.dns.models.AaaaRecordSets; -import com.azure.resourcemanager.dns.models.CnameRecordSets; -import com.azure.resourcemanager.dns.models.DnsRecordSet; -import com.azure.resourcemanager.dns.models.DnsZone; -import com.azure.resourcemanager.dns.models.MxRecordSets; -import com.azure.resourcemanager.dns.models.NsRecordSets; -import com.azure.resourcemanager.dns.models.PtrRecordSets; -import com.azure.resourcemanager.dns.models.RecordType; -import com.azure.resourcemanager.dns.models.SoaRecordSet; -import com.azure.resourcemanager.dns.models.SrvRecordSets; -import com.azure.resourcemanager.dns.models.TxtRecordSets; -import com.azure.resourcemanager.dns.models.ZoneType; -import com.azure.resourcemanager.dns.fluent.models.RecordSetInner; -import com.azure.resourcemanager.dns.fluent.models.ZoneInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.GroupableResourceImpl; -import com.azure.resourcemanager.resources.fluentcore.utils.ETagState; -import com.azure.resourcemanager.resources.fluentcore.utils.PagedConverter; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import reactor.core.publisher.Mono; - -import java.util.ArrayList; -import java.util.List; - -/** Implementation for {@link DnsZone}. */ -public class DnsZoneImpl extends GroupableResourceImpl - implements DnsZone, DnsZone.Definition, DnsZone.Update { - - private ARecordSets aRecordSets; - private AaaaRecordSets aaaaRecordSets; - private CnameRecordSets cnameRecordSets; - private MxRecordSets mxRecordSets; - private NsRecordSets nsRecordSets; - private PtrRecordSets ptrRecordSets; - private SrvRecordSets srvRecordSets; - private TxtRecordSets txtRecordSets; - private DnsRecordSetsImpl recordSets; - private final ETagState etagState = new ETagState(); - - DnsZoneImpl(String name, final ZoneInner innerModel, final DnsZoneManager manager) { - super(name, innerModel, manager); - this.recordSets = new DnsRecordSetsImpl(this); - initRecordSets(); - if (isInCreateMode()) { - // Set the zone type to Public by default - this.innerModel().withZoneType(ZoneType.PUBLIC); - } - } - - @Override - public long maxNumberOfRecordSets() { - return ResourceManagerUtils.toPrimitiveLong(this.innerModel().maxNumberOfRecordSets()); - } - - @Override - public long numberOfRecordSets() { - return ResourceManagerUtils.toPrimitiveLong(this.innerModel().numberOfRecordSets()); - } - - @Override - public String etag() { - return this.innerModel().etag(); - } - - @Override - public ZoneType accessType() { - return this.innerModel().zoneType(); - } - - @Override - public PagedIterable listRecordSets() { - return this.listRecordSetsIntern(null, null); - } - - @Override - public PagedIterable listRecordSets(String recordSetNameSuffix) { - return this.listRecordSetsIntern(recordSetNameSuffix, null); - } - - @Override - public PagedIterable listRecordSets(int pageSize) { - return this.listRecordSetsIntern(null, pageSize); - } - - @Override - public PagedIterable listRecordSets(String recordSetNameSuffix, int pageSize) { - return this.listRecordSetsIntern(recordSetNameSuffix, pageSize); - } - - @Override - public List nameServers() { - if (this.innerModel() == null) { - return new ArrayList<>(); - } - return this.innerModel().nameServers(); - } - - @Override - public ARecordSets aRecordSets() { - return this.aRecordSets; - } - - @Override - public AaaaRecordSets aaaaRecordSets() { - return this.aaaaRecordSets; - } - - @Override - public CnameRecordSets cNameRecordSets() { - return this.cnameRecordSets; - } - - @Override - public MxRecordSets mxRecordSets() { - return this.mxRecordSets; - } - - @Override - public NsRecordSets nsRecordSets() { - return this.nsRecordSets; - } - - @Override - public PtrRecordSets ptrRecordSets() { - return this.ptrRecordSets; - } - - @Override - public SrvRecordSets srvRecordSets() { - return this.srvRecordSets; - } - - @Override - public TxtRecordSets txtRecordSets() { - return this.txtRecordSets; - } - - @Override - public SoaRecordSet getSoaRecordSet() { - RecordSetInner inner = this.manager().serviceClient().getRecordSets() - .get(this.resourceGroupName(), this.name(), "@", RecordType.SOA); - if (inner == null) { - return null; - } - return new SoaRecordSetImpl(inner.name(), this, inner); - } - - // Setters - - @Override - public DnsRecordSetImpl defineARecordSet(String name) { - return recordSets.defineARecordSet(name); - } - - @Override - public DnsRecordSetImpl defineAaaaRecordSet(String name) { - return recordSets.defineAaaaRecordSet(name); - } - - @Override - public DnsZoneImpl withCNameRecordSet(String name, String alias) { - recordSets.withCNameRecordSet(name, alias); - return this; - } - - @Override - public DnsRecordSetImpl defineCNameRecordSet(String name) { - return recordSets.defineCNameRecordSet(name); - } - - @Override - public DnsRecordSetImpl defineMXRecordSet(String name) { - return recordSets.defineMXRecordSet(name); - } - - @Override - public DnsRecordSetImpl defineNSRecordSet(String name) { - return recordSets.defineNSRecordSet(name); - } - - @Override - public DnsRecordSetImpl definePtrRecordSet(String name) { - return recordSets.definePtrRecordSet(name); - } - - @Override - public DnsRecordSetImpl defineSrvRecordSet(String name) { - return recordSets.defineSrvRecordSet(name); - } - - @Override - public DnsRecordSetImpl defineTxtRecordSet(String name) { - return recordSets.defineTxtRecordSet(name); - } - - @Override - public DnsRecordSetImpl updateARecordSet(String name) { - return recordSets.updateARecordSet(name); - } - - @Override - public DnsRecordSetImpl updateAaaaRecordSet(String name) { - return recordSets.updateAaaaRecordSet(name); - } - - @Override - public DnsRecordSetImpl updateMXRecordSet(String name) { - return recordSets.updateMXRecordSet(name); - } - - @Override - public DnsRecordSetImpl updateCNameRecordSet(String name) { - return recordSets.updateCNameRecordSet(name); - } - - @Override - public DnsRecordSetImpl updateNSRecordSet(String name) { - return recordSets.updateNSRecordSet(name); - } - - @Override - public DnsRecordSetImpl updatePtrRecordSet(String name) { - return recordSets.updatePtrRecordSet(name); - } - - @Override - public DnsRecordSetImpl updateSrvRecordSet(String name) { - return recordSets.updateSrvRecordSet(name); - } - - @Override - public DnsRecordSetImpl updateTxtRecordSet(String name) { - return recordSets.updateTxtRecordSet(name); - } - - @Override - public DnsRecordSetImpl updateSoaRecord() { - return recordSets.updateSoaRecordSet(); - } - - @Override - public DnsZoneImpl withoutARecordSet(String name) { - return this.withoutARecordSet(name, null); - } - - @Override - public DnsZoneImpl withoutARecordSet(String name, String etag) { - recordSets.withoutARecordSet(name, etag); - return this; - } - - @Override - public DnsZoneImpl withoutAaaaRecordSet(String name) { - return this.withoutAaaaRecordSet(name, null); - } - - @Override - public DnsZoneImpl withoutAaaaRecordSet(String name, String etag) { - recordSets.withoutAaaaRecordSet(name, etag); - return this; - } - - @Override - public DnsZoneImpl withoutCNameRecordSet(String name) { - return this.withoutCNameRecordSet(name, null); - } - - @Override - public DnsZoneImpl withoutCNameRecordSet(String name, String etag) { - recordSets.withoutCNameRecordSet(name, etag); - return this; - } - - @Override - public DnsZoneImpl withoutMXRecordSet(String name) { - return this.withoutMXRecordSet(name, null); - } - - @Override - public DnsZoneImpl withoutMXRecordSet(String name, String etag) { - recordSets.withoutMXRecordSet(name, etag); - return this; - } - - @Override - public DnsZoneImpl withoutNSRecordSet(String name) { - return this.withoutNSRecordSet(name, null); - } - - @Override - public DnsZoneImpl withoutNSRecordSet(String name, String etag) { - recordSets.withoutNSRecordSet(name, etag); - return this; - } - - @Override - public DnsZoneImpl withoutPtrRecordSet(String name) { - return this.withoutPtrRecordSet(name, null); - } - - @Override - public DnsZoneImpl withoutPtrRecordSet(String name, String etag) { - recordSets.withoutPtrRecordSet(name, etag); - return this; - } - - @Override - public DnsZoneImpl withoutSrvRecordSet(String name) { - return this.withoutSrvRecordSet(name, null); - } - - @Override - public DnsZoneImpl withoutSrvRecordSet(String name, String etag) { - recordSets.withoutSrvRecordSet(name, etag); - return this; - } - - @Override - public DnsZoneImpl withoutTxtRecordSet(String name) { - return this.withoutTxtRecordSet(name, null); - } - - @Override - public DnsZoneImpl withoutTxtRecordSet(String name, String etag) { - recordSets.withoutTxtRecordSet(name, etag); - return this; - } - - @Override - public DnsZoneImpl withETagCheck() { - this.etagState.withImplicitETagCheckOnCreateOrUpdate(this.isInCreateMode()); - return this; - } - - @Override - public DnsZoneImpl withETagCheck(String etagValue) { - this.etagState.withExplicitETagCheckOnUpdate(etagValue); - return this; - } - - @Override - public Mono createResourceAsync() { - return Mono - .just(this) - .flatMap( - self -> - self - .manager() - .serviceClient() - .getZones() - .createOrUpdateAsync( - self.resourceGroupName(), - self.name(), - self.innerModel(), - etagState.ifMatchValueOnUpdate(self.innerModel().etag()), - etagState.ifNonMatchValueOnCreate())) - .map(innerToFluentMap(this)) - .map( - dnsZone -> { - this.etagState.clear(); - return dnsZone; - }); - } - - @Override - public Mono afterPostRunAsync(boolean isGroupFaulted) { - return Mono - .just(true) - .map( - ignored -> { - recordSets.clear(); - return ignored; - }) - .then(); - } - - @Override - public Mono refreshAsync() { - return super - .refreshAsync() - .map( - dnsZone -> { - DnsZoneImpl impl = (DnsZoneImpl) dnsZone; - impl.initRecordSets(); - return impl; - }); - } - - @Override - protected Mono getInnerAsync() { - return this.manager().serviceClient().getZones().getByResourceGroupAsync(this.resourceGroupName(), this.name()); - } - - private void initRecordSets() { - this.aRecordSets = new ARecordSetsImpl(this); - this.aaaaRecordSets = new AaaaRecordSetsImpl(this); - this.cnameRecordSets = new CnameRecordSetsImpl(this); - this.mxRecordSets = new MxRecordSetsImpl(this); - this.nsRecordSets = new NsRecordSetsImpl(this); - this.ptrRecordSets = new PtrRecordSetsImpl(this); - this.srvRecordSets = new SrvRecordSetsImpl(this); - this.txtRecordSets = new TxtRecordSetsImpl(this); - this.recordSets.clear(); - } - - private PagedIterable listRecordSetsIntern(String recordSetSuffix, Integer pageSize) { - final DnsZoneImpl self = this; - PagedFlux recordSets = - PagedConverter - .flatMapPage( - this - .manager() - .serviceClient() - .getRecordSets() - .listByDnsZoneAsync(this.resourceGroupName(), this.name(), pageSize, recordSetSuffix), - inner -> { - DnsRecordSet recordSet = new DnsRecordSetImpl(inner.name(), inner.type(), self, inner); - switch (recordSet.recordType()) { - case A: - return Mono.just(new ARecordSetImpl(inner.name(), self, inner)); - case AAAA: - return Mono.just(new AaaaRecordSetImpl(inner.name(), self, inner)); - case CNAME: - return Mono.just(new CnameRecordSetImpl(inner.name(), self, inner)); - case MX: - return Mono.just(new MxRecordSetImpl(inner.name(), self, inner)); - case NS: - return Mono.just(new NsRecordSetImpl(inner.name(), self, inner)); - case PTR: - return Mono.just(new PtrRecordSetImpl(inner.name(), self, inner)); - case SOA: - return Mono.just(new SoaRecordSetImpl(inner.name(), self, inner)); - case SRV: - return Mono.just(new SrvRecordSetImpl(inner.name(), self, inner)); - case TXT: - return Mono.just(new TxtRecordSetImpl(inner.name(), self, inner)); - default: - return Mono.just(recordSet); - } - }); - return new PagedIterable<>(recordSets); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/implementation/DnsZonesImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/implementation/DnsZonesImpl.java deleted file mode 100644 index c1f36a5ca664..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/implementation/DnsZonesImpl.java +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.dns.implementation; - -import com.azure.resourcemanager.dns.DnsZoneManager; -import com.azure.resourcemanager.dns.fluent.ZonesClient; -import com.azure.resourcemanager.dns.fluent.models.ZoneInner; -import com.azure.resourcemanager.dns.models.DnsZone; -import com.azure.resourcemanager.dns.models.DnsZones; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.TopLevelModifiableResourcesImpl; -import reactor.core.publisher.Mono; - -/** Implementation of DnsZones. */ -public class DnsZonesImpl - extends TopLevelModifiableResourcesImpl - implements DnsZones { - - public DnsZonesImpl(final DnsZoneManager dnsZoneManager) { - super(dnsZoneManager.serviceClient().getZones(), dnsZoneManager); - } - - @Override - public DnsZoneImpl define(String name) { - return setDefaults(wrapModel(name)); - } - - @Override - protected DnsZoneImpl wrapModel(String name) { - return new DnsZoneImpl(name, new ZoneInner(), this.manager()); - } - - @Override - protected DnsZoneImpl wrapModel(ZoneInner inner) { - if (inner == null) { - return null; - } - return new DnsZoneImpl(inner.name(), inner, this.manager()); - } - - private DnsZoneImpl setDefaults(DnsZoneImpl dnsZone) { - // Zone location must be 'global' irrespective of region of the resource group it resides. - dnsZone.innerModel().withLocation("global"); - return dnsZone; - } - - @Override - public Mono deleteByResourceGroupNameAsync(String resourceGroupName, String zoneName) { - return this.manager().serviceClient().getZones().deleteAsync(resourceGroupName, zoneName).then(); - } - - @Override - public Mono deleteByResourceGroupNameAsync(String resourceGroupName, String zoneName, String eTagValue) { - return this.manager().serviceClient().getZones().deleteAsync(resourceGroupName, zoneName, eTagValue).then(); - } - - @Override - public Mono deleteByIdAsync(String id) { - return deleteByResourceGroupNameAsync( - ResourceUtils.groupFromResourceId(id), ResourceUtils.nameFromResourceId(id)); - } - - @Override - public Mono deleteByIdAsync(String id, String eTagValue) { - return deleteByResourceGroupNameAsync( - ResourceUtils.groupFromResourceId(id), ResourceUtils.nameFromResourceId(id), eTagValue); - } - - @Override - public void deleteByResourceGroupName(String resourceGroupName, String zoneName) { - deleteByResourceGroupNameAsync(resourceGroupName, zoneName).block(); - } - - @Override - public void deleteByResourceGroupName(String resourceGroupName, String zoneName, String eTagValue) { - deleteByResourceGroupNameAsync(resourceGroupName, zoneName, eTagValue).block(); - } - - @Override - public void deleteById(String id) { - deleteByIdAsync(id).block(); - } - - @Override - public void deleteById(String id, String eTagValue) { - deleteByIdAsync(id, eTagValue).block(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/implementation/MxRecordSetImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/implementation/MxRecordSetImpl.java deleted file mode 100644 index e1e346cc5d0c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/implementation/MxRecordSetImpl.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.dns.implementation; - -import com.azure.resourcemanager.dns.models.MxRecordSet; -import com.azure.resourcemanager.dns.models.MxRecord; -import com.azure.resourcemanager.dns.models.RecordType; -import com.azure.resourcemanager.dns.fluent.models.RecordSetInner; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -/** Implementation of MxRecordSet. */ -class MxRecordSetImpl extends DnsRecordSetImpl implements MxRecordSet { - MxRecordSetImpl(final String name, final DnsZoneImpl parent, final RecordSetInner innerModel) { - super(name, RecordType.MX.toString(), parent, innerModel); - } - - static MxRecordSetImpl newRecordSet(final String name, final DnsZoneImpl parent) { - return new MxRecordSetImpl(name, parent, new RecordSetInner().withMxRecords(new ArrayList<>())); - } - - @Override - public List records() { - if (this.innerModel().mxRecords() != null) { - return Collections.unmodifiableList(this.innerModel().mxRecords()); - } - return Collections.unmodifiableList(new ArrayList<>()); - } - - @Override - protected RecordSetInner prepareForUpdate(RecordSetInner resource) { - if (this.innerModel().mxRecords() != null && this.innerModel().mxRecords().size() > 0) { - if (resource.mxRecords() == null) { - resource.withMxRecords(new ArrayList<>()); - } - - resource.mxRecords().addAll(this.innerModel().mxRecords()); - this.innerModel().mxRecords().clear(); - } - - if (this.recordSetRemoveInfo.mxRecords().size() > 0) { - if (resource.mxRecords() != null) { - for (MxRecord recordToRemove : this.recordSetRemoveInfo.mxRecords()) { - for (MxRecord record : resource.mxRecords()) { - if (record.exchange().equalsIgnoreCase(recordToRemove.exchange()) - && (record.preference() != null - && record.preference().equals(recordToRemove.preference()))) { - resource.mxRecords().remove(record); - break; - } - } - } - } - this.recordSetRemoveInfo.mxRecords().clear(); - } - return resource; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/implementation/MxRecordSetsImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/implementation/MxRecordSetsImpl.java deleted file mode 100644 index 186df6dba191..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/implementation/MxRecordSetsImpl.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.dns.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.dns.models.MxRecordSet; -import com.azure.resourcemanager.dns.models.MxRecordSets; -import com.azure.resourcemanager.dns.models.RecordType; -import com.azure.resourcemanager.dns.fluent.models.RecordSetInner; -import reactor.core.publisher.Mono; - -/** Implementation of MxRecordSets. */ -class MxRecordSetsImpl extends DnsRecordSetsBaseImpl implements MxRecordSets { - - MxRecordSetsImpl(DnsZoneImpl dnsZone) { - super(dnsZone, RecordType.MX); - } - - @Override - public MxRecordSet getByName(String name) { - return getByNameAsync(name).block(); - } - - @Override - public Mono getByNameAsync(String name) { - return this - .parent() - .manager() - .serviceClient() - .getRecordSets() - .getAsync(this.dnsZone.resourceGroupName(), this.dnsZone.name(), name, this.recordType) - .map(this::wrapModel); - } - - @Override - public PagedIterable list() { - return super - .wrapList( - this - .parent() - .manager() - .serviceClient() - .getRecordSets() - .listByType(this.dnsZone.resourceGroupName(), this.dnsZone.name(), this.recordType)); - } - - @Override - protected PagedIterable listIntern(String recordSetNameSuffix, Integer pageSize) { - return super - .wrapList( - this - .parent() - .manager() - .serviceClient() - .getRecordSets() - .listByType( - this.dnsZone.resourceGroupName(), - this.dnsZone.name(), - this.recordType, - pageSize, - recordSetNameSuffix, - Context.NONE)); - } - - @Override - protected PagedFlux listInternAsync(String recordSetNameSuffix, Integer pageSize) { - return wrapPageAsync( - this - .parent() - .manager() - .serviceClient() - .getRecordSets() - .listByTypeAsync(this.dnsZone.resourceGroupName(), this.dnsZone.name(), this.recordType)); - } - - @Override - protected MxRecordSetImpl wrapModel(RecordSetInner inner) { - if (inner == null) { - return null; - } - return new MxRecordSetImpl(inner.name(), this.dnsZone, inner); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/implementation/NsRecordSetImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/implementation/NsRecordSetImpl.java deleted file mode 100644 index fa7f258a0ff3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/implementation/NsRecordSetImpl.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.dns.implementation; - -import com.azure.resourcemanager.dns.models.NsRecordSet; -import com.azure.resourcemanager.dns.models.NsRecord; -import com.azure.resourcemanager.dns.models.RecordType; -import com.azure.resourcemanager.dns.fluent.models.RecordSetInner; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -/** Implementation of NsRecordSet. */ -class NsRecordSetImpl extends DnsRecordSetImpl implements NsRecordSet { - NsRecordSetImpl(final String name, final DnsZoneImpl parent, final RecordSetInner innerModel) { - super(name, RecordType.NS.toString(), parent, innerModel); - } - - static NsRecordSetImpl newRecordSet(final String name, final DnsZoneImpl parent) { - return new NsRecordSetImpl(name, parent, new RecordSetInner().withNsRecords(new ArrayList())); - } - - @Override - public List nameServers() { - List nameServers = new ArrayList<>(); - if (this.innerModel().nsRecords() != null) { - for (NsRecord nsRecord : this.innerModel().nsRecords()) { - nameServers.add(nsRecord.nsdname()); - } - } - return Collections.unmodifiableList(nameServers); - } - - @Override - protected RecordSetInner prepareForUpdate(RecordSetInner resource) { - if (this.innerModel().nsRecords() != null && this.innerModel().nsRecords().size() > 0) { - if (resource.nsRecords() == null) { - resource.withNsRecords(new ArrayList()); - } - - for (NsRecord record : this.innerModel().nsRecords()) { - resource.nsRecords().add(record); - } - this.innerModel().nsRecords().clear(); - } - - if (this.recordSetRemoveInfo.nsRecords().size() > 0) { - if (resource.nsRecords() != null) { - for (NsRecord recordToRemove : this.recordSetRemoveInfo.nsRecords()) { - for (NsRecord record : resource.nsRecords()) { - if (record.nsdname().equalsIgnoreCase(recordToRemove.nsdname())) { - resource.nsRecords().remove(record); - break; - } - } - } - } - this.recordSetRemoveInfo.nsRecords().clear(); - } - return resource; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/implementation/NsRecordSetsImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/implementation/NsRecordSetsImpl.java deleted file mode 100644 index 82e937c72098..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/implementation/NsRecordSetsImpl.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.dns.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.dns.models.NsRecordSet; -import com.azure.resourcemanager.dns.models.NsRecordSets; -import com.azure.resourcemanager.dns.models.RecordType; -import com.azure.resourcemanager.dns.fluent.models.RecordSetInner; -import reactor.core.publisher.Mono; - -/** Implementation of NsRecordSets. */ -class NsRecordSetsImpl extends DnsRecordSetsBaseImpl implements NsRecordSets { - - NsRecordSetsImpl(DnsZoneImpl dnsZone) { - super(dnsZone, RecordType.NS); - } - - @Override - public NsRecordSet getByName(String name) { - return getByNameAsync(name).block(); - } - - @Override - public Mono getByNameAsync(String name) { - return this - .parent() - .manager() - .serviceClient() - .getRecordSets() - .getAsync(this.dnsZone.resourceGroupName(), this.dnsZone.name(), name, this.recordType) - .map(this::wrapModel); - } - - @Override - protected PagedIterable listIntern(String recordSetNameSuffix, Integer pageSize) { - return super - .wrapList( - this - .parent() - .manager() - .serviceClient() - .getRecordSets() - .listByType( - this.dnsZone.resourceGroupName(), - this.dnsZone.name(), - this.recordType, - pageSize, - recordSetNameSuffix, - Context.NONE)); - } - - @Override - protected PagedFlux listInternAsync(String recordSetNameSuffix, Integer pageSize) { - return wrapPageAsync( - this - .parent() - .manager() - .serviceClient() - .getRecordSets() - .listByTypeAsync(this.dnsZone.resourceGroupName(), this.dnsZone.name(), this.recordType)); - } - - @Override - protected NsRecordSetImpl wrapModel(RecordSetInner inner) { - if (inner == null) { - return null; - } - return new NsRecordSetImpl(inner.name(), this.dnsZone, inner); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/implementation/PtrRecordSetImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/implementation/PtrRecordSetImpl.java deleted file mode 100644 index ee85b949ae94..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/implementation/PtrRecordSetImpl.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.dns.implementation; - -import com.azure.resourcemanager.dns.models.PtrRecord; -import com.azure.resourcemanager.dns.models.PtrRecordSet; -import com.azure.resourcemanager.dns.models.RecordType; -import com.azure.resourcemanager.dns.fluent.models.RecordSetInner; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -/** Implementation of {@link PtrRecordSet}. */ -class PtrRecordSetImpl extends DnsRecordSetImpl implements PtrRecordSet { - PtrRecordSetImpl(final String name, final DnsZoneImpl parent, final RecordSetInner innerModel) { - super(name, RecordType.PTR.toString(), parent, innerModel); - } - - static PtrRecordSetImpl newRecordSet(final String name, final DnsZoneImpl parent) { - return new PtrRecordSetImpl(name, parent, new RecordSetInner().withPtrRecords(new ArrayList<>())); - } - - @Override - public List targetDomainNames() { - List targetDomainNames = new ArrayList<>(); - if (this.innerModel().ptrRecords() != null) { - for (PtrRecord ptrRecord : this.innerModel().ptrRecords()) { - targetDomainNames.add(ptrRecord.ptrdname()); - } - } - return Collections.unmodifiableList(targetDomainNames); - } - - @Override - protected RecordSetInner prepareForUpdate(RecordSetInner resource) { - if (this.innerModel().ptrRecords() != null && this.innerModel().ptrRecords().size() > 0) { - if (resource.ptrRecords() == null) { - resource.withPtrRecords(new ArrayList<>()); - } - - resource.ptrRecords().addAll(this.innerModel().ptrRecords()); - this.innerModel().ptrRecords().clear(); - } - - if (this.recordSetRemoveInfo.ptrRecords().size() > 0) { - if (resource.ptrRecords() != null) { - for (PtrRecord recordToRemove : this.recordSetRemoveInfo.ptrRecords()) { - for (PtrRecord record : resource.ptrRecords()) { - if (record.ptrdname().equalsIgnoreCase(recordToRemove.ptrdname())) { - resource.ptrRecords().remove(record); - break; - } - } - } - } - this.recordSetRemoveInfo.ptrRecords().clear(); - } - return resource; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/implementation/PtrRecordSetsImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/implementation/PtrRecordSetsImpl.java deleted file mode 100644 index 78486e74bf05..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/implementation/PtrRecordSetsImpl.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.dns.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.dns.models.PtrRecordSet; -import com.azure.resourcemanager.dns.models.PtrRecordSets; -import com.azure.resourcemanager.dns.models.RecordType; -import com.azure.resourcemanager.dns.fluent.models.RecordSetInner; -import reactor.core.publisher.Mono; - -/** Implementation of PtrRecordSets. */ -class PtrRecordSetsImpl extends DnsRecordSetsBaseImpl implements PtrRecordSets { - - PtrRecordSetsImpl(DnsZoneImpl dnsZone) { - super(dnsZone, RecordType.PTR); - } - - @Override - public PtrRecordSet getByName(String name) { - return getByNameAsync(name).block(); - } - - @Override - public Mono getByNameAsync(String name) { - return this - .parent() - .manager() - .serviceClient() - .getRecordSets() - .getAsync(this.dnsZone.resourceGroupName(), this.dnsZone.name(), name, this.recordType) - .map(this::wrapModel); - } - - @Override - protected PagedIterable listIntern(String recordSetNameSuffix, Integer pageSize) { - return super - .wrapList( - this - .parent() - .manager() - .serviceClient() - .getRecordSets() - .listByType( - this.dnsZone.resourceGroupName(), - this.dnsZone.name(), - recordType, - pageSize, - recordSetNameSuffix, - Context.NONE)); - } - - @Override - protected PagedFlux listInternAsync(String recordSetNameSuffix, Integer pageSize) { - return wrapPageAsync( - this - .parent() - .manager() - .serviceClient() - .getRecordSets() - .listByTypeAsync(this.dnsZone.resourceGroupName(), this.dnsZone.name(), this.recordType)); - } - - @Override - protected PtrRecordSetImpl wrapModel(RecordSetInner inner) { - if (inner == null) { - return null; - } - return new PtrRecordSetImpl(inner.name(), this.dnsZone, inner); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/implementation/RecordSetsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/implementation/RecordSetsClientImpl.java deleted file mode 100644 index 3d0c4ef16872..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/implementation/RecordSetsClientImpl.java +++ /dev/null @@ -1,1803 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.dns.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.dns.fluent.RecordSetsClient; -import com.azure.resourcemanager.dns.fluent.models.RecordSetInner; -import com.azure.resourcemanager.dns.models.RecordSetListResult; -import com.azure.resourcemanager.dns.models.RecordType; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in RecordSetsClient. */ -public final class RecordSetsClientImpl implements RecordSetsClient { - private final ClientLogger logger = new ClientLogger(RecordSetsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final RecordSetsService service; - - /** The service client containing this operation class. */ - private final DnsManagementClientImpl client; - - /** - * Initializes an instance of RecordSetsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - RecordSetsClientImpl(DnsManagementClientImpl client) { - this.service = - RestProxy.create(RecordSetsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for DnsManagementClientRecordSets to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "DnsManagementClientR") - private interface RecordSetsService { - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones" - + "/{zoneName}/{recordType}/{relativeRecordSetName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("zoneName") String zoneName, - @PathParam(value = "relativeRecordSetName", encoded = true) String relativeRecordSetName, - @PathParam("recordType") RecordType recordType, - @HeaderParam("If-Match") String ifMatch, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") RecordSetInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones" - + "/{zoneName}/{recordType}/{relativeRecordSetName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("zoneName") String zoneName, - @PathParam(value = "relativeRecordSetName", encoded = true) String relativeRecordSetName, - @PathParam("recordType") RecordType recordType, - @HeaderParam("If-Match") String ifMatch, - @HeaderParam("If-None-Match") String ifNoneMatch, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") RecordSetInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones" - + "/{zoneName}/{recordType}/{relativeRecordSetName}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("zoneName") String zoneName, - @PathParam(value = "relativeRecordSetName", encoded = true) String relativeRecordSetName, - @PathParam("recordType") RecordType recordType, - @HeaderParam("If-Match") String ifMatch, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones" - + "/{zoneName}/{recordType}/{relativeRecordSetName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("zoneName") String zoneName, - @PathParam(value = "relativeRecordSetName", encoded = true) String relativeRecordSetName, - @PathParam("recordType") RecordType recordType, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones" - + "/{zoneName}/{recordType}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByType( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("zoneName") String zoneName, - @PathParam("recordType") RecordType recordType, - @QueryParam("$top") Integer top, - @QueryParam("$recordsetnamesuffix") String recordsetnamesuffix, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones" - + "/{zoneName}/recordsets") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByDnsZone( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("zoneName") String zoneName, - @QueryParam("$top") Integer top, - @QueryParam("$recordsetnamesuffix") String recordsetnamesuffix, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByTypeNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByDnsZoneNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Updates a record set within a DNS zone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @param recordType The type of DNS record in this record set. - * @param parameters Parameters supplied to the Update operation. - * @param ifMatch The etag of the record set. Omit this value to always overwrite the current record set. Specify - * the last-seen etag value to prevent accidentally overwriting concurrent changes. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a DNS record set (a collection of DNS records with the same name and type). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateWithResponseAsync( - String resourceGroupName, - String zoneName, - String relativeRecordSetName, - RecordType recordType, - RecordSetInner parameters, - String ifMatch) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (zoneName == null) { - return Mono.error(new IllegalArgumentException("Parameter zoneName is required and cannot be null.")); - } - if (relativeRecordSetName == null) { - return Mono - .error(new IllegalArgumentException("Parameter relativeRecordSetName is required and cannot be null.")); - } - if (recordType == null) { - return Mono.error(new IllegalArgumentException("Parameter recordType is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - resourceGroupName, - zoneName, - relativeRecordSetName, - recordType, - ifMatch, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates a record set within a DNS zone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @param recordType The type of DNS record in this record set. - * @param parameters Parameters supplied to the Update operation. - * @param ifMatch The etag of the record set. Omit this value to always overwrite the current record set. Specify - * the last-seen etag value to prevent accidentally overwriting concurrent changes. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a DNS record set (a collection of DNS records with the same name and type). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, - String zoneName, - String relativeRecordSetName, - RecordType recordType, - RecordSetInner parameters, - String ifMatch, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (zoneName == null) { - return Mono.error(new IllegalArgumentException("Parameter zoneName is required and cannot be null.")); - } - if (relativeRecordSetName == null) { - return Mono - .error(new IllegalArgumentException("Parameter relativeRecordSetName is required and cannot be null.")); - } - if (recordType == null) { - return Mono.error(new IllegalArgumentException("Parameter recordType is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - resourceGroupName, - zoneName, - relativeRecordSetName, - recordType, - ifMatch, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Updates a record set within a DNS zone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @param recordType The type of DNS record in this record set. - * @param parameters Parameters supplied to the Update operation. - * @param ifMatch The etag of the record set. Omit this value to always overwrite the current record set. Specify - * the last-seen etag value to prevent accidentally overwriting concurrent changes. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a DNS record set (a collection of DNS records with the same name and type). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync( - String resourceGroupName, - String zoneName, - String relativeRecordSetName, - RecordType recordType, - RecordSetInner parameters, - String ifMatch) { - return updateWithResponseAsync( - resourceGroupName, zoneName, relativeRecordSetName, recordType, parameters, ifMatch) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Updates a record set within a DNS zone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @param recordType The type of DNS record in this record set. - * @param parameters Parameters supplied to the Update operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a DNS record set (a collection of DNS records with the same name and type). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync( - String resourceGroupName, - String zoneName, - String relativeRecordSetName, - RecordType recordType, - RecordSetInner parameters) { - final String ifMatch = null; - return updateWithResponseAsync( - resourceGroupName, zoneName, relativeRecordSetName, recordType, parameters, ifMatch) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Updates a record set within a DNS zone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @param recordType The type of DNS record in this record set. - * @param parameters Parameters supplied to the Update operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a DNS record set (a collection of DNS records with the same name and type). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RecordSetInner update( - String resourceGroupName, - String zoneName, - String relativeRecordSetName, - RecordType recordType, - RecordSetInner parameters) { - final String ifMatch = null; - return updateAsync(resourceGroupName, zoneName, relativeRecordSetName, recordType, parameters, ifMatch).block(); - } - - /** - * Updates a record set within a DNS zone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @param recordType The type of DNS record in this record set. - * @param parameters Parameters supplied to the Update operation. - * @param ifMatch The etag of the record set. Omit this value to always overwrite the current record set. Specify - * the last-seen etag value to prevent accidentally overwriting concurrent changes. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a DNS record set (a collection of DNS records with the same name and type). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, - String zoneName, - String relativeRecordSetName, - RecordType recordType, - RecordSetInner parameters, - String ifMatch, - Context context) { - return updateWithResponseAsync( - resourceGroupName, zoneName, relativeRecordSetName, recordType, parameters, ifMatch, context) - .block(); - } - - /** - * Creates or updates a record set within a DNS zone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @param recordType The type of DNS record in this record set. Record sets of type SOA can be updated but not - * created (they are created when the DNS zone is created). - * @param parameters Parameters supplied to the CreateOrUpdate operation. - * @param ifMatch The etag of the record set. Omit this value to always overwrite the current record set. Specify - * the last-seen etag value to prevent accidentally overwriting any concurrent changes. - * @param ifNoneMatch Set to '*' to allow a new record set to be created, but to prevent updating an existing record - * set. Other values will be ignored. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a DNS record set (a collection of DNS records with the same name and type). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, - String zoneName, - String relativeRecordSetName, - RecordType recordType, - RecordSetInner parameters, - String ifMatch, - String ifNoneMatch) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (zoneName == null) { - return Mono.error(new IllegalArgumentException("Parameter zoneName is required and cannot be null.")); - } - if (relativeRecordSetName == null) { - return Mono - .error(new IllegalArgumentException("Parameter relativeRecordSetName is required and cannot be null.")); - } - if (recordType == null) { - return Mono.error(new IllegalArgumentException("Parameter recordType is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - zoneName, - relativeRecordSetName, - recordType, - ifMatch, - ifNoneMatch, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a record set within a DNS zone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @param recordType The type of DNS record in this record set. Record sets of type SOA can be updated but not - * created (they are created when the DNS zone is created). - * @param parameters Parameters supplied to the CreateOrUpdate operation. - * @param ifMatch The etag of the record set. Omit this value to always overwrite the current record set. Specify - * the last-seen etag value to prevent accidentally overwriting any concurrent changes. - * @param ifNoneMatch Set to '*' to allow a new record set to be created, but to prevent updating an existing record - * set. Other values will be ignored. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a DNS record set (a collection of DNS records with the same name and type). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, - String zoneName, - String relativeRecordSetName, - RecordType recordType, - RecordSetInner parameters, - String ifMatch, - String ifNoneMatch, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (zoneName == null) { - return Mono.error(new IllegalArgumentException("Parameter zoneName is required and cannot be null.")); - } - if (relativeRecordSetName == null) { - return Mono - .error(new IllegalArgumentException("Parameter relativeRecordSetName is required and cannot be null.")); - } - if (recordType == null) { - return Mono.error(new IllegalArgumentException("Parameter recordType is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - zoneName, - relativeRecordSetName, - recordType, - ifMatch, - ifNoneMatch, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Creates or updates a record set within a DNS zone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @param recordType The type of DNS record in this record set. Record sets of type SOA can be updated but not - * created (they are created when the DNS zone is created). - * @param parameters Parameters supplied to the CreateOrUpdate operation. - * @param ifMatch The etag of the record set. Omit this value to always overwrite the current record set. Specify - * the last-seen etag value to prevent accidentally overwriting any concurrent changes. - * @param ifNoneMatch Set to '*' to allow a new record set to be created, but to prevent updating an existing record - * set. Other values will be ignored. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a DNS record set (a collection of DNS records with the same name and type). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, - String zoneName, - String relativeRecordSetName, - RecordType recordType, - RecordSetInner parameters, - String ifMatch, - String ifNoneMatch) { - return createOrUpdateWithResponseAsync( - resourceGroupName, zoneName, relativeRecordSetName, recordType, parameters, ifMatch, ifNoneMatch) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates or updates a record set within a DNS zone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @param recordType The type of DNS record in this record set. Record sets of type SOA can be updated but not - * created (they are created when the DNS zone is created). - * @param parameters Parameters supplied to the CreateOrUpdate operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a DNS record set (a collection of DNS records with the same name and type). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, - String zoneName, - String relativeRecordSetName, - RecordType recordType, - RecordSetInner parameters) { - final String ifMatch = null; - final String ifNoneMatch = null; - return createOrUpdateWithResponseAsync( - resourceGroupName, zoneName, relativeRecordSetName, recordType, parameters, ifMatch, ifNoneMatch) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates or updates a record set within a DNS zone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @param recordType The type of DNS record in this record set. Record sets of type SOA can be updated but not - * created (they are created when the DNS zone is created). - * @param parameters Parameters supplied to the CreateOrUpdate operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a DNS record set (a collection of DNS records with the same name and type). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RecordSetInner createOrUpdate( - String resourceGroupName, - String zoneName, - String relativeRecordSetName, - RecordType recordType, - RecordSetInner parameters) { - final String ifMatch = null; - final String ifNoneMatch = null; - return createOrUpdateAsync( - resourceGroupName, zoneName, relativeRecordSetName, recordType, parameters, ifMatch, ifNoneMatch) - .block(); - } - - /** - * Creates or updates a record set within a DNS zone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @param recordType The type of DNS record in this record set. Record sets of type SOA can be updated but not - * created (they are created when the DNS zone is created). - * @param parameters Parameters supplied to the CreateOrUpdate operation. - * @param ifMatch The etag of the record set. Omit this value to always overwrite the current record set. Specify - * the last-seen etag value to prevent accidentally overwriting any concurrent changes. - * @param ifNoneMatch Set to '*' to allow a new record set to be created, but to prevent updating an existing record - * set. Other values will be ignored. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a DNS record set (a collection of DNS records with the same name and type). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceGroupName, - String zoneName, - String relativeRecordSetName, - RecordType recordType, - RecordSetInner parameters, - String ifMatch, - String ifNoneMatch, - Context context) { - return createOrUpdateWithResponseAsync( - resourceGroupName, - zoneName, - relativeRecordSetName, - recordType, - parameters, - ifMatch, - ifNoneMatch, - context) - .block(); - } - - /** - * Deletes a record set from a DNS zone. This operation cannot be undone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @param recordType The type of DNS record in this record set. Record sets of type SOA cannot be deleted (they are - * deleted when the DNS zone is deleted). - * @param ifMatch The etag of the record set. Omit this value to always delete the current record set. Specify the - * last-seen etag value to prevent accidentally deleting any concurrent changes. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync( - String resourceGroupName, - String zoneName, - String relativeRecordSetName, - RecordType recordType, - String ifMatch) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (zoneName == null) { - return Mono.error(new IllegalArgumentException("Parameter zoneName is required and cannot be null.")); - } - if (relativeRecordSetName == null) { - return Mono - .error(new IllegalArgumentException("Parameter relativeRecordSetName is required and cannot be null.")); - } - if (recordType == null) { - return Mono.error(new IllegalArgumentException("Parameter recordType is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - zoneName, - relativeRecordSetName, - recordType, - ifMatch, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a record set from a DNS zone. This operation cannot be undone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @param recordType The type of DNS record in this record set. Record sets of type SOA cannot be deleted (they are - * deleted when the DNS zone is deleted). - * @param ifMatch The etag of the record set. Omit this value to always delete the current record set. Specify the - * last-seen etag value to prevent accidentally deleting any concurrent changes. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, - String zoneName, - String relativeRecordSetName, - RecordType recordType, - String ifMatch, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (zoneName == null) { - return Mono.error(new IllegalArgumentException("Parameter zoneName is required and cannot be null.")); - } - if (relativeRecordSetName == null) { - return Mono - .error(new IllegalArgumentException("Parameter relativeRecordSetName is required and cannot be null.")); - } - if (recordType == null) { - return Mono.error(new IllegalArgumentException("Parameter recordType is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - zoneName, - relativeRecordSetName, - recordType, - ifMatch, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Deletes a record set from a DNS zone. This operation cannot be undone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @param recordType The type of DNS record in this record set. Record sets of type SOA cannot be deleted (they are - * deleted when the DNS zone is deleted). - * @param ifMatch The etag of the record set. Omit this value to always delete the current record set. Specify the - * last-seen etag value to prevent accidentally deleting any concurrent changes. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync( - String resourceGroupName, - String zoneName, - String relativeRecordSetName, - RecordType recordType, - String ifMatch) { - return deleteWithResponseAsync(resourceGroupName, zoneName, relativeRecordSetName, recordType, ifMatch) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes a record set from a DNS zone. This operation cannot be undone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @param recordType The type of DNS record in this record set. Record sets of type SOA cannot be deleted (they are - * deleted when the DNS zone is deleted). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync( - String resourceGroupName, String zoneName, String relativeRecordSetName, RecordType recordType) { - final String ifMatch = null; - return deleteWithResponseAsync(resourceGroupName, zoneName, relativeRecordSetName, recordType, ifMatch) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes a record set from a DNS zone. This operation cannot be undone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @param recordType The type of DNS record in this record set. Record sets of type SOA cannot be deleted (they are - * deleted when the DNS zone is deleted). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String zoneName, String relativeRecordSetName, RecordType recordType) { - final String ifMatch = null; - deleteAsync(resourceGroupName, zoneName, relativeRecordSetName, recordType, ifMatch).block(); - } - - /** - * Deletes a record set from a DNS zone. This operation cannot be undone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @param recordType The type of DNS record in this record set. Record sets of type SOA cannot be deleted (they are - * deleted when the DNS zone is deleted). - * @param ifMatch The etag of the record set. Omit this value to always delete the current record set. Specify the - * last-seen etag value to prevent accidentally deleting any concurrent changes. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse( - String resourceGroupName, - String zoneName, - String relativeRecordSetName, - RecordType recordType, - String ifMatch, - Context context) { - return deleteWithResponseAsync(resourceGroupName, zoneName, relativeRecordSetName, recordType, ifMatch, context) - .block(); - } - - /** - * Gets a record set. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @param recordType The type of DNS record in this record set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a record set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String resourceGroupName, String zoneName, String relativeRecordSetName, RecordType recordType) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (zoneName == null) { - return Mono.error(new IllegalArgumentException("Parameter zoneName is required and cannot be null.")); - } - if (relativeRecordSetName == null) { - return Mono - .error(new IllegalArgumentException("Parameter relativeRecordSetName is required and cannot be null.")); - } - if (recordType == null) { - return Mono.error(new IllegalArgumentException("Parameter recordType is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - resourceGroupName, - zoneName, - relativeRecordSetName, - recordType, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a record set. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @param recordType The type of DNS record in this record set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a record set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, - String zoneName, - String relativeRecordSetName, - RecordType recordType, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (zoneName == null) { - return Mono.error(new IllegalArgumentException("Parameter zoneName is required and cannot be null.")); - } - if (relativeRecordSetName == null) { - return Mono - .error(new IllegalArgumentException("Parameter relativeRecordSetName is required and cannot be null.")); - } - if (recordType == null) { - return Mono.error(new IllegalArgumentException("Parameter recordType is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - resourceGroupName, - zoneName, - relativeRecordSetName, - recordType, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets a record set. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @param recordType The type of DNS record in this record set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a record set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync( - String resourceGroupName, String zoneName, String relativeRecordSetName, RecordType recordType) { - return getWithResponseAsync(resourceGroupName, zoneName, relativeRecordSetName, recordType) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a record set. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @param recordType The type of DNS record in this record set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a record set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RecordSetInner get( - String resourceGroupName, String zoneName, String relativeRecordSetName, RecordType recordType) { - return getAsync(resourceGroupName, zoneName, relativeRecordSetName, recordType).block(); - } - - /** - * Gets a record set. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @param recordType The type of DNS record in this record set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a record set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, - String zoneName, - String relativeRecordSetName, - RecordType recordType, - Context context) { - return getWithResponseAsync(resourceGroupName, zoneName, relativeRecordSetName, recordType, context).block(); - } - - /** - * Lists the record sets of a specified type in a DNS zone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param recordType The type of record sets to enumerate. - * @param top The maximum number of record sets to return. If not specified, returns up to 100 record sets. - * @param recordsetnamesuffix The suffix label of the record set name that has to be used to filter the record set - * enumerations. If this parameter is specified, Enumeration will return only records that end with - * .<recordSetNameSuffix>. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a record set List operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByTypeSinglePageAsync( - String resourceGroupName, String zoneName, RecordType recordType, Integer top, String recordsetnamesuffix) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (zoneName == null) { - return Mono.error(new IllegalArgumentException("Parameter zoneName is required and cannot be null.")); - } - if (recordType == null) { - return Mono.error(new IllegalArgumentException("Parameter recordType is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByType( - this.client.getEndpoint(), - resourceGroupName, - zoneName, - recordType, - top, - recordsetnamesuffix, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists the record sets of a specified type in a DNS zone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param recordType The type of record sets to enumerate. - * @param top The maximum number of record sets to return. If not specified, returns up to 100 record sets. - * @param recordsetnamesuffix The suffix label of the record set name that has to be used to filter the record set - * enumerations. If this parameter is specified, Enumeration will return only records that end with - * .<recordSetNameSuffix>. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a record set List operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByTypeSinglePageAsync( - String resourceGroupName, - String zoneName, - RecordType recordType, - Integer top, - String recordsetnamesuffix, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (zoneName == null) { - return Mono.error(new IllegalArgumentException("Parameter zoneName is required and cannot be null.")); - } - if (recordType == null) { - return Mono.error(new IllegalArgumentException("Parameter recordType is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByType( - this.client.getEndpoint(), - resourceGroupName, - zoneName, - recordType, - top, - recordsetnamesuffix, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists the record sets of a specified type in a DNS zone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param recordType The type of record sets to enumerate. - * @param top The maximum number of record sets to return. If not specified, returns up to 100 record sets. - * @param recordsetnamesuffix The suffix label of the record set name that has to be used to filter the record set - * enumerations. If this parameter is specified, Enumeration will return only records that end with - * .<recordSetNameSuffix>. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a record set List operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByTypeAsync( - String resourceGroupName, String zoneName, RecordType recordType, Integer top, String recordsetnamesuffix) { - return new PagedFlux<>( - () -> listByTypeSinglePageAsync(resourceGroupName, zoneName, recordType, top, recordsetnamesuffix), - nextLink -> listByTypeNextSinglePageAsync(nextLink)); - } - - /** - * Lists the record sets of a specified type in a DNS zone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param recordType The type of record sets to enumerate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a record set List operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByTypeAsync(String resourceGroupName, String zoneName, RecordType recordType) { - final Integer top = null; - final String recordsetnamesuffix = null; - return new PagedFlux<>( - () -> listByTypeSinglePageAsync(resourceGroupName, zoneName, recordType, top, recordsetnamesuffix), - nextLink -> listByTypeNextSinglePageAsync(nextLink)); - } - - /** - * Lists the record sets of a specified type in a DNS zone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param recordType The type of record sets to enumerate. - * @param top The maximum number of record sets to return. If not specified, returns up to 100 record sets. - * @param recordsetnamesuffix The suffix label of the record set name that has to be used to filter the record set - * enumerations. If this parameter is specified, Enumeration will return only records that end with - * .<recordSetNameSuffix>. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a record set List operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByTypeAsync( - String resourceGroupName, - String zoneName, - RecordType recordType, - Integer top, - String recordsetnamesuffix, - Context context) { - return new PagedFlux<>( - () -> listByTypeSinglePageAsync(resourceGroupName, zoneName, recordType, top, recordsetnamesuffix, context), - nextLink -> listByTypeNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists the record sets of a specified type in a DNS zone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param recordType The type of record sets to enumerate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a record set List operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByType(String resourceGroupName, String zoneName, RecordType recordType) { - final Integer top = null; - final String recordsetnamesuffix = null; - return new PagedIterable<>(listByTypeAsync(resourceGroupName, zoneName, recordType, top, recordsetnamesuffix)); - } - - /** - * Lists the record sets of a specified type in a DNS zone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param recordType The type of record sets to enumerate. - * @param top The maximum number of record sets to return. If not specified, returns up to 100 record sets. - * @param recordsetnamesuffix The suffix label of the record set name that has to be used to filter the record set - * enumerations. If this parameter is specified, Enumeration will return only records that end with - * .<recordSetNameSuffix>. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a record set List operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByType( - String resourceGroupName, - String zoneName, - RecordType recordType, - Integer top, - String recordsetnamesuffix, - Context context) { - return new PagedIterable<>( - listByTypeAsync(resourceGroupName, zoneName, recordType, top, recordsetnamesuffix, context)); - } - - /** - * Lists all record sets in a DNS zone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param top The maximum number of record sets to return. If not specified, returns up to 100 record sets. - * @param recordsetnamesuffix The suffix label of the record set name that has to be used to filter the record set - * enumerations. If this parameter is specified, Enumeration will return only records that end with - * .<recordSetNameSuffix>. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a record set List operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByDnsZoneSinglePageAsync( - String resourceGroupName, String zoneName, Integer top, String recordsetnamesuffix) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (zoneName == null) { - return Mono.error(new IllegalArgumentException("Parameter zoneName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByDnsZone( - this.client.getEndpoint(), - resourceGroupName, - zoneName, - top, - recordsetnamesuffix, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all record sets in a DNS zone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param top The maximum number of record sets to return. If not specified, returns up to 100 record sets. - * @param recordsetnamesuffix The suffix label of the record set name that has to be used to filter the record set - * enumerations. If this parameter is specified, Enumeration will return only records that end with - * .<recordSetNameSuffix>. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a record set List operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByDnsZoneSinglePageAsync( - String resourceGroupName, String zoneName, Integer top, String recordsetnamesuffix, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (zoneName == null) { - return Mono.error(new IllegalArgumentException("Parameter zoneName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByDnsZone( - this.client.getEndpoint(), - resourceGroupName, - zoneName, - top, - recordsetnamesuffix, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists all record sets in a DNS zone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param top The maximum number of record sets to return. If not specified, returns up to 100 record sets. - * @param recordsetnamesuffix The suffix label of the record set name that has to be used to filter the record set - * enumerations. If this parameter is specified, Enumeration will return only records that end with - * .<recordSetNameSuffix>. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a record set List operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByDnsZoneAsync( - String resourceGroupName, String zoneName, Integer top, String recordsetnamesuffix) { - return new PagedFlux<>( - () -> listByDnsZoneSinglePageAsync(resourceGroupName, zoneName, top, recordsetnamesuffix), - nextLink -> listByDnsZoneNextSinglePageAsync(nextLink)); - } - - /** - * Lists all record sets in a DNS zone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a record set List operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByDnsZoneAsync(String resourceGroupName, String zoneName) { - final Integer top = null; - final String recordsetnamesuffix = null; - return new PagedFlux<>( - () -> listByDnsZoneSinglePageAsync(resourceGroupName, zoneName, top, recordsetnamesuffix), - nextLink -> listByDnsZoneNextSinglePageAsync(nextLink)); - } - - /** - * Lists all record sets in a DNS zone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param top The maximum number of record sets to return. If not specified, returns up to 100 record sets. - * @param recordsetnamesuffix The suffix label of the record set name that has to be used to filter the record set - * enumerations. If this parameter is specified, Enumeration will return only records that end with - * .<recordSetNameSuffix>. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a record set List operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByDnsZoneAsync( - String resourceGroupName, String zoneName, Integer top, String recordsetnamesuffix, Context context) { - return new PagedFlux<>( - () -> listByDnsZoneSinglePageAsync(resourceGroupName, zoneName, top, recordsetnamesuffix, context), - nextLink -> listByDnsZoneNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all record sets in a DNS zone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a record set List operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByDnsZone(String resourceGroupName, String zoneName) { - final Integer top = null; - final String recordsetnamesuffix = null; - return new PagedIterable<>(listByDnsZoneAsync(resourceGroupName, zoneName, top, recordsetnamesuffix)); - } - - /** - * Lists all record sets in a DNS zone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param top The maximum number of record sets to return. If not specified, returns up to 100 record sets. - * @param recordsetnamesuffix The suffix label of the record set name that has to be used to filter the record set - * enumerations. If this parameter is specified, Enumeration will return only records that end with - * .<recordSetNameSuffix>. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a record set List operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByDnsZone( - String resourceGroupName, String zoneName, Integer top, String recordsetnamesuffix, Context context) { - return new PagedIterable<>(listByDnsZoneAsync(resourceGroupName, zoneName, top, recordsetnamesuffix, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a record set List operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByTypeNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByTypeNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a record set List operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByTypeNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByTypeNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a record set List operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByDnsZoneNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByDnsZoneNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a record set List operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByDnsZoneNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByDnsZoneNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/implementation/SoaRecordSetImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/implementation/SoaRecordSetImpl.java deleted file mode 100644 index 741c7fccd72b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/implementation/SoaRecordSetImpl.java +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.dns.implementation; - -import com.azure.resourcemanager.dns.models.RecordType; -import com.azure.resourcemanager.dns.models.SoaRecord; -import com.azure.resourcemanager.dns.models.SoaRecordSet; -import com.azure.resourcemanager.dns.fluent.models.RecordSetInner; - -/** Implementation of SoaRecordSet. */ -class SoaRecordSetImpl extends DnsRecordSetImpl implements SoaRecordSet { - SoaRecordSetImpl(final String name, final DnsZoneImpl parent, final RecordSetInner innerModel) { - super(name, RecordType.SOA.toString(), parent, innerModel); - } - - static SoaRecordSetImpl newRecordSet(final DnsZoneImpl parent) { - return new SoaRecordSetImpl("@", parent, new RecordSetInner().withSoaRecord(new SoaRecord())); - } - - @Override - public SoaRecord record() { - return this.innerModel().soaRecord(); - } - - @Override - protected RecordSetInner prepareForUpdate(RecordSetInner resource) { - if (resource.soaRecord() == null) { - resource.withSoaRecord(new SoaRecord()); - } - - if (this.innerModel().soaRecord().email() != null) { - resource.soaRecord().withEmail(this.innerModel().soaRecord().email()); - } - - if (this.innerModel().soaRecord().expireTime() != null) { - resource.soaRecord().withExpireTime(this.innerModel().soaRecord().expireTime()); - } - - if (this.innerModel().soaRecord().minimumTtl() != null) { - resource.soaRecord().withMinimumTtl(this.innerModel().soaRecord().minimumTtl()); - } - - if (this.innerModel().soaRecord().refreshTime() != null) { - resource.soaRecord().withRefreshTime(this.innerModel().soaRecord().refreshTime()); - } - - if (this.innerModel().soaRecord().retryTime() != null) { - resource.soaRecord().withRetryTime(this.innerModel().soaRecord().retryTime()); - } - - if (this.innerModel().soaRecord().serialNumber() != null) { - resource.soaRecord().withSerialNumber(this.innerModel().soaRecord().serialNumber()); - } - - this.innerModel().withSoaRecord(new SoaRecord()); - return resource; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/implementation/SrvRecordSetImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/implementation/SrvRecordSetImpl.java deleted file mode 100644 index 56911fd1bc8f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/implementation/SrvRecordSetImpl.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.dns.implementation; - -import com.azure.resourcemanager.dns.models.RecordType; -import com.azure.resourcemanager.dns.models.SrvRecord; -import com.azure.resourcemanager.dns.models.SrvRecordSet; -import com.azure.resourcemanager.dns.fluent.models.RecordSetInner; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -/** Implementation of SrvRecordSet. */ -class SrvRecordSetImpl extends DnsRecordSetImpl implements SrvRecordSet { - SrvRecordSetImpl(final String name, final DnsZoneImpl parent, final RecordSetInner innerModel) { - super(name, RecordType.SRV.toString(), parent, innerModel); - } - - static SrvRecordSetImpl newRecordSet(final String name, final DnsZoneImpl parent) { - return new SrvRecordSetImpl(name, parent, new RecordSetInner().withSrvRecords(new ArrayList<>())); - } - - @Override - public List records() { - if (this.innerModel().srvRecords() != null) { - return Collections.unmodifiableList(this.innerModel().srvRecords()); - } - return Collections.unmodifiableList(new ArrayList<>()); - } - - @Override - protected RecordSetInner prepareForUpdate(RecordSetInner resource) { - if (this.innerModel().srvRecords() != null && this.innerModel().srvRecords().size() > 0) { - if (resource.srvRecords() == null) { - resource.withSrvRecords(new ArrayList<>()); - } - - resource.srvRecords().addAll(this.innerModel().srvRecords()); - this.innerModel().srvRecords().clear(); - } - - if (this.recordSetRemoveInfo.srvRecords().size() > 0) { - if (resource.srvRecords() != null) { - for (SrvRecord recordToRemove : this.recordSetRemoveInfo.srvRecords()) { - for (SrvRecord record : resource.srvRecords()) { - if (record.target().equalsIgnoreCase(recordToRemove.target()) - && (record.port().intValue() == recordToRemove.port().intValue()) - && (record.weight().intValue() == recordToRemove.weight().intValue()) - && (record.priority().intValue() == recordToRemove.priority().intValue())) { - resource.srvRecords().remove(record); - break; - } - } - } - } - this.recordSetRemoveInfo.srvRecords().clear(); - } - return resource; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/implementation/SrvRecordSetsImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/implementation/SrvRecordSetsImpl.java deleted file mode 100644 index 2d101d5997aa..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/implementation/SrvRecordSetsImpl.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.dns.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.dns.models.RecordType; -import com.azure.resourcemanager.dns.models.SrvRecordSet; -import com.azure.resourcemanager.dns.models.SrvRecordSets; -import com.azure.resourcemanager.dns.fluent.models.RecordSetInner; -import reactor.core.publisher.Mono; - -/** Implementation of SrvRecordSets. */ -class SrvRecordSetsImpl extends DnsRecordSetsBaseImpl implements SrvRecordSets { - - SrvRecordSetsImpl(DnsZoneImpl dnsZone) { - super(dnsZone, RecordType.SRV); - } - - @Override - public SrvRecordSet getByName(String name) { - return getByNameAsync(name).block(); - } - - @Override - public Mono getByNameAsync(String name) { - return this - .parent() - .manager() - .serviceClient() - .getRecordSets() - .getAsync(this.dnsZone.resourceGroupName(), this.dnsZone.name(), name, this.recordType) - .map(this::wrapModel); - } - - @Override - protected PagedIterable listIntern(String recordSetNameSuffix, Integer pageSize) { - return super - .wrapList( - this - .parent() - .manager() - .serviceClient() - .getRecordSets() - .listByType( - this.dnsZone.resourceGroupName(), - this.dnsZone.name(), - this.recordType, - pageSize, - recordSetNameSuffix, - Context.NONE)); - } - - @Override - protected PagedFlux listInternAsync(String recordSetNameSuffix, Integer pageSize) { - return wrapPageAsync( - this - .parent() - .manager() - .serviceClient() - .getRecordSets() - .listByTypeAsync(this.dnsZone.resourceGroupName(), this.dnsZone.name(), this.recordType)); - } - - @Override - protected SrvRecordSetImpl wrapModel(RecordSetInner inner) { - if (inner == null) { - return null; - } - return new SrvRecordSetImpl(inner.name(), this.dnsZone, inner); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/implementation/TxtRecordSetImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/implementation/TxtRecordSetImpl.java deleted file mode 100644 index ea18ebafb6d8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/implementation/TxtRecordSetImpl.java +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.dns.implementation; - -import com.azure.resourcemanager.dns.models.RecordType; -import com.azure.resourcemanager.dns.models.TxtRecord; -import com.azure.resourcemanager.dns.models.TxtRecordSet; -import com.azure.resourcemanager.dns.fluent.models.RecordSetInner; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -/** Implementation of TxtRecordSet. */ -class TxtRecordSetImpl extends DnsRecordSetImpl implements TxtRecordSet { - TxtRecordSetImpl(final String name, final DnsZoneImpl parent, final RecordSetInner innerModel) { - super(name, RecordType.TXT.toString(), parent, innerModel); - } - - static TxtRecordSetImpl newRecordSet(final String name, final DnsZoneImpl parent) { - return new TxtRecordSetImpl(name, parent, new RecordSetInner().withTxtRecords(new ArrayList<>())); - } - - @Override - public List records() { - if (this.innerModel().txtRecords() != null) { - return Collections.unmodifiableList(this.innerModel().txtRecords()); - } - return Collections.unmodifiableList(new ArrayList<>()); - } - - @Override - protected RecordSetInner prepareForUpdate(RecordSetInner resource) { - if (this.innerModel().txtRecords() != null && this.innerModel().txtRecords().size() > 0) { - if (resource.txtRecords() == null) { - resource.withTxtRecords(new ArrayList<>()); - } - - resource.txtRecords().addAll(this.innerModel().txtRecords()); - this.innerModel().txtRecords().clear(); - } - - if (this.recordSetRemoveInfo.txtRecords().size() > 0) { - if (resource.txtRecords() != null) { - for (TxtRecord recordToRemove : this.recordSetRemoveInfo.txtRecords()) { - for (TxtRecord record : resource.txtRecords()) { - boolean exists = record.value().equals(recordToRemove.value()); - if (exists) { - resource.txtRecords().remove(record); - break; - } - } - } - } - this.recordSetRemoveInfo.txtRecords().clear(); - } - return resource; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/implementation/TxtRecordSetsImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/implementation/TxtRecordSetsImpl.java deleted file mode 100644 index b599b8e4852d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/implementation/TxtRecordSetsImpl.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.dns.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.dns.models.RecordType; -import com.azure.resourcemanager.dns.models.TxtRecordSet; -import com.azure.resourcemanager.dns.models.TxtRecordSets; -import com.azure.resourcemanager.dns.fluent.models.RecordSetInner; -import reactor.core.publisher.Mono; - -/** Implementation of TxtRecordSets. */ -class TxtRecordSetsImpl extends DnsRecordSetsBaseImpl implements TxtRecordSets { - - TxtRecordSetsImpl(DnsZoneImpl dnsZone) { - super(dnsZone, RecordType.TXT); - } - - @Override - public TxtRecordSet getByName(String name) { - return getByNameAsync(name).block(); - } - - @Override - public Mono getByNameAsync(String name) { - return this - .parent() - .manager() - .serviceClient() - .getRecordSets() - .getAsync(this.dnsZone.resourceGroupName(), this.dnsZone.name(), name, this.recordType) - .map(this::wrapModel); - } - - @Override - protected PagedIterable listIntern(String recordSetNameSuffix, Integer pageSize) { - return super - .wrapList( - this - .parent() - .manager() - .serviceClient() - .getRecordSets() - .listByType( - this.dnsZone.resourceGroupName(), - this.dnsZone.name(), - recordType, - pageSize, - recordSetNameSuffix, - Context.NONE)); - } - - @Override - protected PagedFlux listInternAsync(String recordSetNameSuffix, Integer pageSize) { - return wrapPageAsync( - this - .parent() - .manager() - .serviceClient() - .getRecordSets() - .listByTypeAsync(this.dnsZone.resourceGroupName(), this.dnsZone.name(), recordType)); - } - - @Override - protected TxtRecordSetImpl wrapModel(RecordSetInner inner) { - if (inner == null) { - return null; - } - return new TxtRecordSetImpl(inner.name(), this.dnsZone, inner); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/implementation/ZonesClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/implementation/ZonesClientImpl.java deleted file mode 100644 index 2052d2cea471..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/implementation/ZonesClientImpl.java +++ /dev/null @@ -1,1335 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.dns.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.dns.fluent.ZonesClient; -import com.azure.resourcemanager.dns.fluent.models.ZoneDeleteResultInner; -import com.azure.resourcemanager.dns.fluent.models.ZoneInner; -import com.azure.resourcemanager.dns.models.ZoneListResult; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ZonesClient. */ -public final class ZonesClientImpl - implements InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete, - ZonesClient { - private final ClientLogger logger = new ClientLogger(ZonesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final ZonesService service; - - /** The service client containing this operation class. */ - private final DnsManagementClientImpl client; - - /** - * Initializes an instance of ZonesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ZonesClientImpl(DnsManagementClientImpl client) { - this.service = RestProxy.create(ZonesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for DnsManagementClientZones to be used by the proxy service to perform - * REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "DnsManagementClientZ") - private interface ZonesService { - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones" - + "/{zoneName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("zoneName") String zoneName, - @HeaderParam("If-Match") String ifMatch, - @HeaderParam("If-None-Match") String ifNoneMatch, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") ZoneInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones" - + "/{zoneName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("zoneName") String zoneName, - @HeaderParam("If-Match") String ifMatch, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones" - + "/{zoneName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("zoneName") String zoneName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("$top") Integer top, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/dnszones") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("$top") Integer top, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Creates or updates a DNS zone. Does not modify DNS records within the zone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param parameters Parameters supplied to the CreateOrUpdate operation. - * @param ifMatch The etag of the DNS zone. Omit this value to always overwrite the current zone. Specify the - * last-seen etag value to prevent accidentally overwriting any concurrent changes. - * @param ifNoneMatch Set to '*' to allow a new DNS zone to be created, but to prevent updating an existing zone. - * Other values will be ignored. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a DNS zone. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String zoneName, ZoneInner parameters, String ifMatch, String ifNoneMatch) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (zoneName == null) { - return Mono.error(new IllegalArgumentException("Parameter zoneName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - zoneName, - ifMatch, - ifNoneMatch, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a DNS zone. Does not modify DNS records within the zone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param parameters Parameters supplied to the CreateOrUpdate operation. - * @param ifMatch The etag of the DNS zone. Omit this value to always overwrite the current zone. Specify the - * last-seen etag value to prevent accidentally overwriting any concurrent changes. - * @param ifNoneMatch Set to '*' to allow a new DNS zone to be created, but to prevent updating an existing zone. - * Other values will be ignored. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a DNS zone. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, - String zoneName, - ZoneInner parameters, - String ifMatch, - String ifNoneMatch, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (zoneName == null) { - return Mono.error(new IllegalArgumentException("Parameter zoneName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - zoneName, - ifMatch, - ifNoneMatch, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Creates or updates a DNS zone. Does not modify DNS records within the zone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param parameters Parameters supplied to the CreateOrUpdate operation. - * @param ifMatch The etag of the DNS zone. Omit this value to always overwrite the current zone. Specify the - * last-seen etag value to prevent accidentally overwriting any concurrent changes. - * @param ifNoneMatch Set to '*' to allow a new DNS zone to be created, but to prevent updating an existing zone. - * Other values will be ignored. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a DNS zone. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, String zoneName, ZoneInner parameters, String ifMatch, String ifNoneMatch) { - return createOrUpdateWithResponseAsync(resourceGroupName, zoneName, parameters, ifMatch, ifNoneMatch) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates or updates a DNS zone. Does not modify DNS records within the zone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param parameters Parameters supplied to the CreateOrUpdate operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a DNS zone. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync(String resourceGroupName, String zoneName, ZoneInner parameters) { - final String ifMatch = null; - final String ifNoneMatch = null; - return createOrUpdateWithResponseAsync(resourceGroupName, zoneName, parameters, ifMatch, ifNoneMatch) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates or updates a DNS zone. Does not modify DNS records within the zone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param parameters Parameters supplied to the CreateOrUpdate operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a DNS zone. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ZoneInner createOrUpdate(String resourceGroupName, String zoneName, ZoneInner parameters) { - final String ifMatch = null; - final String ifNoneMatch = null; - return createOrUpdateAsync(resourceGroupName, zoneName, parameters, ifMatch, ifNoneMatch).block(); - } - - /** - * Creates or updates a DNS zone. Does not modify DNS records within the zone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param parameters Parameters supplied to the CreateOrUpdate operation. - * @param ifMatch The etag of the DNS zone. Omit this value to always overwrite the current zone. Specify the - * last-seen etag value to prevent accidentally overwriting any concurrent changes. - * @param ifNoneMatch Set to '*' to allow a new DNS zone to be created, but to prevent updating an existing zone. - * Other values will be ignored. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a DNS zone. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceGroupName, - String zoneName, - ZoneInner parameters, - String ifMatch, - String ifNoneMatch, - Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, zoneName, parameters, ifMatch, ifNoneMatch, context) - .block(); - } - - /** - * Deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be undone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param ifMatch The etag of the DNS zone. Omit this value to always delete the current zone. Specify the last-seen - * etag value to prevent accidentally deleting any concurrent changes. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a Zone Delete operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync( - String resourceGroupName, String zoneName, String ifMatch) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (zoneName == null) { - return Mono.error(new IllegalArgumentException("Parameter zoneName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - zoneName, - ifMatch, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be undone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param ifMatch The etag of the DNS zone. Omit this value to always delete the current zone. Specify the last-seen - * etag value to prevent accidentally deleting any concurrent changes. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a Zone Delete operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String zoneName, String ifMatch, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (zoneName == null) { - return Mono.error(new IllegalArgumentException("Parameter zoneName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - zoneName, - ifMatch, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be undone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param ifMatch The etag of the DNS zone. Omit this value to always delete the current zone. Specify the last-seen - * etag value to prevent accidentally deleting any concurrent changes. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a Zone Delete operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, ZoneDeleteResultInner> beginDeleteAsync( - String resourceGroupName, String zoneName, String ifMatch) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, zoneName, ifMatch); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ZoneDeleteResultInner.class, - ZoneDeleteResultInner.class, - Context.NONE); - } - - /** - * Deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be undone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param ifMatch The etag of the DNS zone. Omit this value to always delete the current zone. Specify the last-seen - * etag value to prevent accidentally deleting any concurrent changes. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a Zone Delete operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, ZoneDeleteResultInner> beginDeleteAsync( - String resourceGroupName, String zoneName, String ifMatch, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(resourceGroupName, zoneName, ifMatch, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), ZoneDeleteResultInner.class, ZoneDeleteResultInner.class, context); - } - - /** - * Deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be undone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param ifMatch The etag of the DNS zone. Omit this value to always delete the current zone. Specify the last-seen - * etag value to prevent accidentally deleting any concurrent changes. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a Zone Delete operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, ZoneDeleteResultInner> beginDelete( - String resourceGroupName, String zoneName, String ifMatch) { - return beginDeleteAsync(resourceGroupName, zoneName, ifMatch).getSyncPoller(); - } - - /** - * Deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be undone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param ifMatch The etag of the DNS zone. Omit this value to always delete the current zone. Specify the last-seen - * etag value to prevent accidentally deleting any concurrent changes. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a Zone Delete operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, ZoneDeleteResultInner> beginDelete( - String resourceGroupName, String zoneName, String ifMatch, Context context) { - return beginDeleteAsync(resourceGroupName, zoneName, ifMatch, context).getSyncPoller(); - } - - /** - * Deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be undone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param ifMatch The etag of the DNS zone. Omit this value to always delete the current zone. Specify the last-seen - * etag value to prevent accidentally deleting any concurrent changes. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a Zone Delete operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String zoneName, String ifMatch) { - return beginDeleteAsync(resourceGroupName, zoneName, ifMatch) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be undone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a Zone Delete operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String zoneName) { - final String ifMatch = null; - return beginDeleteAsync(resourceGroupName, zoneName, ifMatch) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be undone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param ifMatch The etag of the DNS zone. Omit this value to always delete the current zone. Specify the last-seen - * etag value to prevent accidentally deleting any concurrent changes. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a Zone Delete operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync( - String resourceGroupName, String zoneName, String ifMatch, Context context) { - return beginDeleteAsync(resourceGroupName, zoneName, ifMatch, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be undone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param ifMatch The etag of the DNS zone. Omit this value to always delete the current zone. Specify the last-seen - * etag value to prevent accidentally deleting any concurrent changes. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a Zone Delete operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ZoneDeleteResultInner delete(String resourceGroupName, String zoneName, String ifMatch) { - return deleteAsync(resourceGroupName, zoneName, ifMatch).block(); - } - - /** - * Deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be undone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a Zone Delete operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ZoneDeleteResultInner delete(String resourceGroupName, String zoneName) { - final String ifMatch = null; - return deleteAsync(resourceGroupName, zoneName, ifMatch).block(); - } - - /** - * Deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be undone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param ifMatch The etag of the DNS zone. Omit this value to always delete the current zone. Specify the last-seen - * etag value to prevent accidentally deleting any concurrent changes. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a Zone Delete operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ZoneDeleteResultInner delete(String resourceGroupName, String zoneName, String ifMatch, Context context) { - return deleteAsync(resourceGroupName, zoneName, ifMatch, context).block(); - } - - /** - * Gets a DNS zone. Retrieves the zone properties, but not the record sets within the zone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DNS zone. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String zoneName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (zoneName == null) { - return Mono.error(new IllegalArgumentException("Parameter zoneName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - zoneName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a DNS zone. Retrieves the zone properties, but not the record sets within the zone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DNS zone. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String zoneName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (zoneName == null) { - return Mono.error(new IllegalArgumentException("Parameter zoneName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - zoneName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets a DNS zone. Retrieves the zone properties, but not the record sets within the zone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DNS zone. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync(String resourceGroupName, String zoneName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, zoneName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a DNS zone. Retrieves the zone properties, but not the record sets within the zone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DNS zone. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ZoneInner getByResourceGroup(String resourceGroupName, String zoneName) { - return getByResourceGroupAsync(resourceGroupName, zoneName).block(); - } - - /** - * Gets a DNS zone. Retrieves the zone properties, but not the record sets within the zone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param zoneName The name of the DNS zone (without a terminating dot). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DNS zone. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String zoneName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, zoneName, context).block(); - } - - /** - * Lists the DNS zones within a resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param top The maximum number of record sets to return. If not specified, returns up to 100 record sets. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a Zone List or ListAll operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, Integer top) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - top, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists the DNS zones within a resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param top The maximum number of record sets to return. If not specified, returns up to 100 record sets. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a Zone List or ListAll operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Integer top, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - top, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists the DNS zones within a resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param top The maximum number of record sets to return. If not specified, returns up to 100 record sets. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a Zone List or ListAll operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName, Integer top) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, top), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * Lists the DNS zones within a resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a Zone List or ListAll operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - final Integer top = null; - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, top), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * Lists the DNS zones within a resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param top The maximum number of record sets to return. If not specified, returns up to 100 record sets. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a Zone List or ListAll operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Integer top, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, top, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists the DNS zones within a resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a Zone List or ListAll operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - final Integer top = null; - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, top)); - } - - /** - * Lists the DNS zones within a resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param top The maximum number of record sets to return. If not specified, returns up to 100 record sets. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a Zone List or ListAll operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Integer top, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, top, context)); - } - - /** - * Lists the DNS zones in all resource groups in a subscription. - * - * @param top The maximum number of DNS zones to return. If not specified, returns up to 100 zones. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a Zone List or ListAll operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Integer top) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - top, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists the DNS zones in all resource groups in a subscription. - * - * @param top The maximum number of DNS zones to return. If not specified, returns up to 100 zones. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a Zone List or ListAll operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Integer top, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - top, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists the DNS zones in all resource groups in a subscription. - * - * @param top The maximum number of DNS zones to return. If not specified, returns up to 100 zones. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a Zone List or ListAll operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(Integer top) { - return new PagedFlux<>(() -> listSinglePageAsync(top), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists the DNS zones in all resource groups in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a Zone List or ListAll operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - final Integer top = null; - return new PagedFlux<>(() -> listSinglePageAsync(top), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists the DNS zones in all resource groups in a subscription. - * - * @param top The maximum number of DNS zones to return. If not specified, returns up to 100 zones. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a Zone List or ListAll operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Integer top, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(top, context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists the DNS zones in all resource groups in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a Zone List or ListAll operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - final Integer top = null; - return new PagedIterable<>(listAsync(top)); - } - - /** - * Lists the DNS zones in all resource groups in a subscription. - * - * @param top The maximum number of DNS zones to return. If not specified, returns up to 100 zones. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a Zone List or ListAll operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Integer top, Context context) { - return new PagedIterable<>(listAsync(top, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a Zone List or ListAll operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a Zone List or ListAll operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a Zone List or ListAll operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a Zone List or ListAll operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/ARecord.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/ARecord.java deleted file mode 100644 index 09ea4a235922..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/ARecord.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.dns.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** An A record. */ -@Fluent -public final class ARecord { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ARecord.class); - - /* - * The IPv4 address of this A record. - */ - @JsonProperty(value = "ipv4Address") - private String ipv4Address; - - /** - * Get the ipv4Address property: The IPv4 address of this A record. - * - * @return the ipv4Address value. - */ - public String ipv4Address() { - return this.ipv4Address; - } - - /** - * Set the ipv4Address property: The IPv4 address of this A record. - * - * @param ipv4Address the ipv4Address value to set. - * @return the ARecord object itself. - */ - public ARecord withIpv4Address(String ipv4Address) { - this.ipv4Address = ipv4Address; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/ARecordSet.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/ARecordSet.java deleted file mode 100644 index 472e21716a46..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/ARecordSet.java +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.dns.models; - -import com.azure.core.annotation.Fluent; -import java.util.List; - -/** An immutable client-side representation of a A (IPv4) record set in Azure DNS Zone. */ -@Fluent -public interface ARecordSet extends DnsRecordSet { - /** @return the IP v4 addresses of A records in this record set */ - List ipv4Addresses(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/ARecordSets.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/ARecordSets.java deleted file mode 100644 index 323922a3079d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/ARecordSets.java +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.dns.models; - -import com.azure.core.annotation.Fluent; - -/** Entry point to A record sets in a DNS zone. */ -@Fluent -public interface ARecordSets extends DnsRecordSets { -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/AaaaRecord.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/AaaaRecord.java deleted file mode 100644 index 70eb3a5a3e9c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/AaaaRecord.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.dns.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** An AAAA record. */ -@Fluent -public final class AaaaRecord { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AaaaRecord.class); - - /* - * The IPv6 address of this AAAA record. - */ - @JsonProperty(value = "ipv6Address") - private String ipv6Address; - - /** - * Get the ipv6Address property: The IPv6 address of this AAAA record. - * - * @return the ipv6Address value. - */ - public String ipv6Address() { - return this.ipv6Address; - } - - /** - * Set the ipv6Address property: The IPv6 address of this AAAA record. - * - * @param ipv6Address the ipv6Address value to set. - * @return the AaaaRecord object itself. - */ - public AaaaRecord withIpv6Address(String ipv6Address) { - this.ipv6Address = ipv6Address; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/AaaaRecordSet.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/AaaaRecordSet.java deleted file mode 100644 index 2e22b13aa15e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/AaaaRecordSet.java +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.dns.models; - -import com.azure.core.annotation.Fluent; -import java.util.List; - -/** An immutable client-side representation of a AAAA (IPv6) record set in Azure DNS Zone. */ -@Fluent -public interface AaaaRecordSet extends DnsRecordSet { - /** @return the IPv6 addresses of AAAA records in this record set */ - List ipv6Addresses(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/AaaaRecordSets.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/AaaaRecordSets.java deleted file mode 100644 index 642f50019455..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/AaaaRecordSets.java +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.dns.models; - -import com.azure.core.annotation.Fluent; - -/** Entry point to AAAA record sets in a DNS zone. */ -@Fluent -public interface AaaaRecordSets extends DnsRecordSets { -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/CnameRecord.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/CnameRecord.java deleted file mode 100644 index f6c7b922aabf..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/CnameRecord.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.dns.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** A CNAME record. */ -@Fluent -public final class CnameRecord { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CnameRecord.class); - - /* - * The canonical name for this CNAME record. - */ - @JsonProperty(value = "cname") - private String cname; - - /** - * Get the cname property: The canonical name for this CNAME record. - * - * @return the cname value. - */ - public String cname() { - return this.cname; - } - - /** - * Set the cname property: The canonical name for this CNAME record. - * - * @param cname the cname value to set. - * @return the CnameRecord object itself. - */ - public CnameRecord withCname(String cname) { - this.cname = cname; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/CnameRecordSet.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/CnameRecordSet.java deleted file mode 100644 index ecba54c29ffb..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/CnameRecordSet.java +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.dns.models; - -import com.azure.core.annotation.Fluent; - -/** An immutable client-side representation of a CNAME (canonical name) record set in Azure DNS Zone. */ -@Fluent -public interface CnameRecordSet extends DnsRecordSet { - /** @return the canonical name (without a terminating dot) of CName record in this record set */ - String canonicalName(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/CnameRecordSets.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/CnameRecordSets.java deleted file mode 100644 index a1d56bb5ba19..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/CnameRecordSets.java +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.dns.models; - -import com.azure.core.annotation.Fluent; - -/** Entry point to CNAME record sets in a DNS zone. */ -@Fluent -public interface CnameRecordSets extends DnsRecordSets { -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/DnsRecordSet.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/DnsRecordSet.java deleted file mode 100644 index f49c7faf67a2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/DnsRecordSet.java +++ /dev/null @@ -1,1083 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.dns.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.dns.fluent.models.RecordSetInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.ExternalChildResource; -import com.azure.resourcemanager.resources.fluentcore.model.Attachable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.model.Settable; -import java.util.List; -import java.util.Map; - -/** An immutable client-side representation of a record set in Azure DNS Zone. */ -@Fluent -public interface DnsRecordSet extends ExternalChildResource, HasInnerModel { - - /** @return the type of records in this record set */ - RecordType recordType(); - - /** @return TTL of the records in this record set */ - long timeToLive(); - - /** @return the metadata associated with this record set. */ - Map metadata(); - - /** @return the fully qualified domain name of the record set. */ - String fqdn(); - - /** @return the etag associated with the record set. */ - String etag(); - - /** - * The entirety of a DNS zone record set definition as a part of parent definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface Definition - extends DefinitionStages.ARecordSetBlank, - DefinitionStages.WithARecordIPv4Address, - DefinitionStages.WithARecordIPv4AddressOrAttachable, - DefinitionStages.AaaaRecordSetBlank, - DefinitionStages.WithAaaaRecordIPv6Address, - DefinitionStages.WithAaaaRecordIPv6AddressOrAttachable, - DefinitionStages.CNameRecordSetBlank, - DefinitionStages.WithCNameRecordAlias, - DefinitionStages.WithCNameRecordSetAttachable, - DefinitionStages.MXRecordSetBlank, - DefinitionStages.WithMXRecordMailExchange, - DefinitionStages.WithMXRecordMailExchangeOrAttachable, - DefinitionStages.NSRecordSetBlank, - DefinitionStages.WithNSRecordNameServer, - DefinitionStages.WithNSRecordNameServerOrAttachable, - DefinitionStages.PtrRecordSetBlank, - DefinitionStages.WithPtrRecordTargetDomainName, - DefinitionStages.WithPtrRecordTargetDomainNameOrAttachable, - DefinitionStages.SrvRecordSetBlank, - DefinitionStages.WithSrvRecordEntry, - DefinitionStages.WithSrvRecordEntryOrAttachable, - DefinitionStages.TxtRecordSetBlank, - DefinitionStages.WithTxtRecordTextValue, - DefinitionStages.WithTxtRecordTextValueOrAttachable, - DefinitionStages.WithAttach { - } - - /** Grouping of DNS zone record set definition stages as a part of parent DNS zone definition. */ - interface DefinitionStages { - /** - * The first stage of an A record definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface ARecordSetBlank extends WithARecordIPv4Address { - } - - /** - * The stage of the A record set definition allowing to add first A record. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithARecordIPv4Address { - /** - * Creates an A record with the provided IPv4 address in this record set. - * - * @param ipv4Address the IPv4 address - * @return the next stage of the definition - */ - WithARecordIPv4AddressOrAttachable withIPv4Address(String ipv4Address); - } - - /** - * The stage of the A record set definition allowing to add additional A records or attach the record set to the - * parent. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithARecordIPv4AddressOrAttachable - extends WithARecordIPv4Address, WithAttach { - } - - /** - * The first stage of a AAAA record definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface AaaaRecordSetBlank extends WithAaaaRecordIPv6Address { - } - - /** - * The stage of the AAAA record set definition allowing to add first AAAA record. - * - * @param the return type of {@link WithAttach#attach()} - */ - interface WithAaaaRecordIPv6Address { - /** - * Creates an AAAA record with the provided IPv6 address in this record set. - * - * @param ipv6Address an IPv6 address - * @return the next stage of the definition - */ - WithAaaaRecordIPv6AddressOrAttachable withIPv6Address(String ipv6Address); - } - - /** - * The stage of the AAAA record set definition allowing to add additional AAAA records or attach the record set - * to the parent. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithAaaaRecordIPv6AddressOrAttachable - extends WithAaaaRecordIPv6Address, WithAttach { - } - - /** - * The first stage of a CNAME record set definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface CNameRecordSetBlank extends WithCNameRecordAlias { - } - - /** - * The stage of a CNAME record definition allowing to add alias. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithCNameRecordAlias { - /** - * Creates a CNAME record with the provided alias. - * - * @param alias the alias - * @return the next stage of the definition - */ - WithCNameRecordSetAttachable withAlias(String alias); - } - - /** - * The stage of the CNAME record set definition allowing attach the record set to the parent. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithCNameRecordSetAttachable extends WithAttach { - } - - /** - * The first stage of a MX record definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface MXRecordSetBlank extends WithMXRecordMailExchange { - } - - /** - * The stage of the MX record set definition allowing to add first MX record. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithMXRecordMailExchange { - /** - * Creates and assigns priority to a MX record with the provided mail exchange server in this record set. - * - * @param mailExchangeHostName the host name of the mail exchange server - * @param priority the priority for the mail exchange host, lower the value higher the priority - * @return the next stage of the definition - */ - WithMXRecordMailExchangeOrAttachable withMailExchange(String mailExchangeHostName, int priority); - } - - /** - * The stage of the MX record set definition allowing to add additional MX records or attach the record set to - * the parent. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithMXRecordMailExchangeOrAttachable - extends WithMXRecordMailExchange, WithAttach { - } - - /** - * The first stage of a NS record definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface NSRecordSetBlank extends WithNSRecordNameServer { - } - - /** - * The stage of the NS record set definition allowing to add a NS record. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithNSRecordNameServer { - /** - * Creates a NS record with the provided name server in this record set. - * - * @param nameServerHostName the name server host name - * @return the next stage of the definition - */ - WithNSRecordNameServerOrAttachable withNameServer(String nameServerHostName); - } - - /** - * The stage of the NS record set definition allowing to add additional NS records or attach the record set to - * the parent. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithNSRecordNameServerOrAttachable - extends WithNSRecordNameServer, WithAttach { - } - - /** - * The first stage of a PTR record definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface PtrRecordSetBlank extends WithPtrRecordTargetDomainName { - } - - /** - * The stage of the PTR record set definition allowing to add first CNAME record. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithPtrRecordTargetDomainName { - /** - * Creates a PTR record with the provided target domain name in this record set. - * - * @param targetDomainName the target domain name - * @return the next stage of the definition - */ - WithPtrRecordTargetDomainNameOrAttachable withTargetDomainName(String targetDomainName); - } - - /** - * The stage of the PTR record set definition allowing to add additional PTR records or attach the record set to - * the parent. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithPtrRecordTargetDomainNameOrAttachable - extends WithPtrRecordTargetDomainName, WithAttach { - } - - /** - * The first stage of a SRV record definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface SrvRecordSetBlank extends WithSrvRecordEntry { - } - - /** - * The stage of the SRV record definition allowing to add first service record. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithSrvRecordEntry { - /** - * Specifies a service record for a service. - * - * @param target the canonical name of the target host running the service - * @param port the port on which the service is bounded - * @param priority the priority of the target host, lower the value higher the priority - * @param weight the relative weight (preference) of the records with the same priority, higher the value - * more the preference - * @return the next stage of the definition - */ - WithSrvRecordEntryOrAttachable withRecord(String target, int port, int priority, int weight); - } - - /** - * The stage of the SRV record set definition allowing to add additional SRV records or attach the record set to - * the parent. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithSrvRecordEntryOrAttachable extends WithSrvRecordEntry, WithAttach { - } - - /** - * The first stage of a TXT record definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface TxtRecordSetBlank extends WithTxtRecordTextValue { - } - - /** - * The stage of the TXT record definition allowing to add first TXT record. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithTxtRecordTextValue { - /** - * Creates a Txt record with the given text in this record set. - * - * @param text the text value - * @return the next stage of the definition - */ - WithTxtRecordTextValueOrAttachable withText(String text); - } - - /** - * The stage of the TXT record set definition allowing to add additional TXT records or attach the record set to - * the parent. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithTxtRecordTextValueOrAttachable - extends WithTxtRecordTextValue, WithAttach { - } - - /** - * The stage of the record set definition allowing to specify the Time To Live (TTL) for the records in this - * record set. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithTtl { - /** - * Specifies the Time To Live for the records in the record set. - * - * @param ttlInSeconds TTL in seconds - * @return the next stage of the definition - */ - WithAttach withTimeToLive(long ttlInSeconds); - } - - /** - * The stage of the record set definition allowing to specify metadata. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithMetadata { - /** - * Adds a metadata to the resource. - * - * @param key the key for the metadata - * @param value the value for the metadata - * @return the next stage of the definition - */ - WithAttach withMetadata(String key, String value); - } - - /** - * The stage of the record set definition allowing to enable ETag validation. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithETagCheck { - /** - * Specifies that If-None-Match header needs to set to * to prevent updating an existing record set. - * - * @return the next stage of the definition - */ - WithAttach withETagCheck(); - } - - /** - * The final stage of the DNS zone record set definition. - * - *

    At this stage, any remaining optional settings can be specified, or the DNS zone record set definition can - * be attached to the parent traffic manager profile definition using {@link - * DnsRecordSet.DefinitionStages.WithAttach#attach()}. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithAttach - extends Attachable.InDefinition, - DefinitionStages.WithTtl, - DefinitionStages.WithMetadata, - DefinitionStages.WithETagCheck { - } - } - - /** - * The entirety of a DNS zone record set definition as a part of parent update. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface UpdateDefinition - extends UpdateDefinitionStages.ARecordSetBlank, - UpdateDefinitionStages.WithARecordIPv4Address, - UpdateDefinitionStages.WithARecordIPv4AddressOrAttachable, - UpdateDefinitionStages.AaaaRecordSetBlank, - UpdateDefinitionStages.WithAaaaRecordIPv6Address, - UpdateDefinitionStages.WithAaaaRecordIPv6AddressOrAttachable, - UpdateDefinitionStages.CNameRecordSetBlank, - UpdateDefinitionStages.WithCNameRecordAlias, - UpdateDefinitionStages.WithCNameRecordSetAttachable, - UpdateDefinitionStages.MXRecordSetBlank, - UpdateDefinitionStages.WithMXRecordMailExchange, - UpdateDefinitionStages.WithMXRecordMailExchangeOrAttachable, - UpdateDefinitionStages.NSRecordSetBlank, - UpdateDefinitionStages.WithNSRecordNameServer, - UpdateDefinitionStages.WithNSRecordNameServerOrAttachable, - UpdateDefinitionStages.PtrRecordSetBlank, - UpdateDefinitionStages.WithPtrRecordTargetDomainName, - UpdateDefinitionStages.WithPtrRecordTargetDomainNameOrAttachable, - UpdateDefinitionStages.SrvRecordSetBlank, - UpdateDefinitionStages.WithSrvRecordEntry, - UpdateDefinitionStages.WithSrvRecordEntryOrAttachable, - UpdateDefinitionStages.TxtRecordSetBlank, - UpdateDefinitionStages.WithTxtRecordTextValue, - UpdateDefinitionStages.WithTxtRecordTextValueOrAttachable, - UpdateDefinitionStages.WithAttach { - } - - /** Grouping of DNS zone record set definition stages as a part of parent DNS zone update. */ - interface UpdateDefinitionStages { - /** - * The first stage of a A record definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface ARecordSetBlank extends WithARecordIPv4Address { - } - - /** - * The stage of the A record set definition allowing to add first A record. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithARecordIPv4Address { - /** - * Creates an A record with the provided IPv4 address in this record set. - * - * @param ipv4Address the IPv4 address - * @return the next stage of the definition - */ - WithARecordIPv4AddressOrAttachable withIPv4Address(String ipv4Address); - } - - /** - * The stage of the A record set definition allowing to add additional A records or attach the record set to the - * parent. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithARecordIPv4AddressOrAttachable - extends WithARecordIPv4Address, WithAttach { - } - - /** - * The first stage of a AAAA record definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface AaaaRecordSetBlank extends WithAaaaRecordIPv6Address { - } - - /** - * The stage of the AAAA record set definition allowing to add first AAAA record. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithAaaaRecordIPv6Address { - /** - * Creates an AAAA record with the provided IPv6 address in this record set. - * - * @param ipv6Address the IPv6 address - * @return the next stage of the definition - */ - WithAaaaRecordIPv6AddressOrAttachable withIPv6Address(String ipv6Address); - } - - /** - * The stage of the AAAA record set definition allowing to add additional A records or attach the record set to - * the parent. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithAaaaRecordIPv6AddressOrAttachable - extends WithAaaaRecordIPv6Address, WithAttach { - } - - /** - * The first stage of a CNAME record set definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface CNameRecordSetBlank extends WithCNameRecordAlias { - } - - /** - * The stage of a CNAME record definition allowing to add alias. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithCNameRecordAlias { - /** - * Creates a CNAME record with the provided alias. - * - * @param alias the alias - * @return the next stage of the definition - */ - WithCNameRecordSetAttachable withAlias(String alias); - } - - /** - * The stage of the CNAME record set definition allowing attach the record set to the parent. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithCNameRecordSetAttachable extends WithAttach { - } - - /** - * The first stage of an MX record definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface MXRecordSetBlank extends WithMXRecordMailExchange { - } - - /** - * The stage of the MX record set definition allowing to add first MX record. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithMXRecordMailExchange { - /** - * Creates and assigns priority to a MX record with the provided mail exchange server in this record set. - * - * @param mailExchangeHostName the host name of the mail exchange server - * @param priority the priority for the mail exchange host, lower the value higher the priority - * @return the next stage of the definition - */ - WithMXRecordMailExchangeOrAttachable withMailExchange(String mailExchangeHostName, int priority); - } - - /** - * The stage of the MX record set definition allowing to add additional MX records or attach the record set to - * the parent. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithMXRecordMailExchangeOrAttachable - extends WithMXRecordMailExchange, WithAttach { - } - - /** - * The first stage of a NS record definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface NSRecordSetBlank extends WithNSRecordNameServer { - } - - /** - * The stage of the NS record set definition allowing to add a NS record. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithNSRecordNameServer { - /** - * Creates a NS record with the provided name server in this record set. - * - * @param nameServerHostName the name server host name - * @return the next stage of the definition - */ - WithNSRecordNameServerOrAttachable withNameServer(String nameServerHostName); - } - - /** - * The stage of the NS record set definition allowing to add additional NS records or attach the record set to - * the parent. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithNSRecordNameServerOrAttachable - extends WithNSRecordNameServer, WithAttach { - } - - /** - * The first stage of a PTR record definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface PtrRecordSetBlank extends WithPtrRecordTargetDomainName { - } - - /** - * The stage of the PTR record set definition allowing to add first CNAME record. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithPtrRecordTargetDomainName { - /** - * Creates a PTR record with the provided target domain name in this record set. - * - * @param targetDomainName the target domain name - * @return the next stage of the definition - */ - WithPtrRecordTargetDomainNameOrAttachable withTargetDomainName(String targetDomainName); - } - - /** - * The stage of the PTR record set definition allowing to add additional PTR records or attach the record set to - * the parent. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithPtrRecordTargetDomainNameOrAttachable - extends WithPtrRecordTargetDomainName, WithAttach { - } - - /** - * The first stage of a SRV record definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface SrvRecordSetBlank extends WithSrvRecordEntry { - } - - /** - * The stage of the SRV record definition allowing to add first service record. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithSrvRecordEntry { - /** - * Specifies a service record for a service. - * - * @param target the canonical name of the target host running the service - * @param port the port on which the service is bounded - * @param priority the priority of the target host, lower the value higher the priority - * @param weight the relative weight (preference) of the records with the same priority, higher the value - * more the preference - * @return the next stage of the definition - */ - WithSrvRecordEntryOrAttachable withRecord(String target, int port, int priority, int weight); - } - - /** - * The stage of the SRV record set definition allowing to add additional SRV records or attach the record set to - * the parent. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithSrvRecordEntryOrAttachable extends WithSrvRecordEntry, WithAttach { - } - - /** - * The first stage of a TXT record definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface TxtRecordSetBlank extends WithTxtRecordTextValue { - } - - /** - * The stage of the TXT record definition allowing to add first Txt record. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithTxtRecordTextValue { - /** - * Creates a TXT record with the given text in this record set. - * - * @param text the text value - * @return the next stage of the definition - */ - WithTxtRecordTextValueOrAttachable withText(String text); - } - - /** - * The stage of the TXT record set definition allowing to add additional TXT records or attach the record set to - * the parent. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithTxtRecordTextValueOrAttachable - extends WithTxtRecordTextValue, WithAttach { - } - - /** - * The stage of the record set definition allowing to specify TTL for the records in this record set. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithTtl { - /** - * Specifies the TTL for the records in the record set. - * - * @param ttlInSeconds TTL in seconds - * @return the next stage of the definition - */ - WithAttach withTimeToLive(long ttlInSeconds); - } - - /** - * The stage of the record set definition allowing to specify metadata. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithMetadata { - /** - * Adds a tag to the resource. - * - * @param key the key for the metadata - * @param value the value for the metadata - * @return the next stage of the definition - */ - WithAttach withMetadata(String key, String value); - } - - /** - * The stage of the record set definition allowing to enable ETag validation. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithETagCheck { - /** - * Specifies that If-None-Match header needs to set to * to prevent updating an existing record set. - * - * @return the next stage of the definition - */ - WithAttach withETagCheck(); - } - - /** - * The final stage of the DNS zone record set definition. - * - *

    At this stage, any remaining optional settings can be specified, or the DNS zone record set definition can - * be attached to the parent traffic manager profile definition using {@link - * DnsRecordSet.UpdateDefinitionStages.WithAttach#attach()}. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithAttach - extends Attachable.InUpdate, - UpdateDefinitionStages.WithTtl, - UpdateDefinitionStages.WithMetadata, - UpdateDefinitionStages.WithETagCheck { - } - } - - /** The entirety of a record sets update as a part of parent DNS zone update. */ - interface UpdateCombined - extends UpdateARecordSet, - UpdateAaaaRecordSet, - UpdateCNameRecordSet, - UpdateMXRecordSet, - UpdatePtrRecordSet, - UpdateNSRecordSet, - UpdateSrvRecordSet, - UpdateTxtRecordSet, - UpdateSoaRecord, - Update { - } - - /** The entirety of an A record set update as a part of parent DNS zone update. */ - interface UpdateARecordSet extends UpdateStages.WithARecordIPv4Address, Update { - } - - /** The entirety of an AAAA record set update as a part of parent DNS zone update. */ - interface UpdateAaaaRecordSet extends UpdateStages.WithAaaaRecordIPv6Address, Update { - } - - /** The entirety of CNAME record set update as part of parent DNS zone update. */ - interface UpdateCNameRecordSet extends UpdateStages.WithCNameRecordAlias, Update { - } - - /** The entirety of a MX record set update as a part of parent DNS zone update. */ - interface UpdateMXRecordSet extends UpdateStages.WithMXRecordMailExchange, Update { - } - - /** The entirety of a NS record set update as a part of parent DNS zone update. */ - interface UpdateNSRecordSet extends UpdateStages.WithNSRecordNameServer, Update { - } - - /** The entirety of a PTR record set update as a part of parent DNS zone update. */ - interface UpdatePtrRecordSet extends UpdateStages.WithPtrRecordTargetDomainName, Update { - } - - /** The entirety of a SRV record set update as a part of parent DNS zone update. */ - interface UpdateSrvRecordSet extends UpdateStages.WithSrvRecordEntry, Update { - } - - /** The entirety of a TXT record set update as a part of parent DNS zone update. */ - interface UpdateTxtRecordSet extends UpdateStages.WithTxtRecordTextValue, Update { - } - - /** The entirety of a SOA record update as a part of parent DNS zone update. */ - interface UpdateSoaRecord extends UpdateStages.WithSoaRecordAttributes, Update { - } - - /** - * the set of configurations that can be updated for DNS record set irrespective of their type {@link RecordType}. - */ - interface Update - extends Settable, UpdateStages.WithTtl, UpdateStages.WithMetadata, UpdateStages.WithETagCheck { - } - - /** Grouping of DNS zone record set update stages. */ - interface UpdateStages { - /** The stage of the A record set update allowing to add or remove A record. */ - interface WithARecordIPv4Address { - /** - * Creates an A record with the provided IPv4 address in the record set. - * - * @param ipv4Address an IPv4 address - * @return the next stage of the record set update - */ - UpdateARecordSet withIPv4Address(String ipv4Address); - - /** - * Removes the A record with the provided IPv4 address from the record set. - * - * @param ipv4Address an IPv4 address - * @return the next stage of the record set update - */ - UpdateARecordSet withoutIPv4Address(String ipv4Address); - } - - /** The stage of the AAAA record set update allowing to add or remove AAAA record. */ - interface WithAaaaRecordIPv6Address { - /** - * Creates an AAAA record with the provided IPv6 address in this record set. - * - * @param ipv6Address the IPv6 address - * @return the next stage of the record set update - */ - UpdateAaaaRecordSet withIPv6Address(String ipv6Address); - - /** - * Removes an AAAA record with the provided IPv6 address from this record set. - * - * @param ipv6Address the IPv6 address - * @return the next stage of the record set update - */ - UpdateAaaaRecordSet withoutIPv6Address(String ipv6Address); - } - - /** The stage of the CNAME record set update allowing to update the CNAME record. */ - interface WithCNameRecordAlias { - /** - * The new alias for the CNAME record set. - * - * @param alias the alias - * @return the next stage of the record set update - */ - UpdateCNameRecordSet withAlias(String alias); - } - - /** The stage of the MX record set definition allowing to add or remove MX record. */ - interface WithMXRecordMailExchange { - /** - * Creates and assigns priority to a MX record with the provided mail exchange server in this record set. - * - * @param mailExchangeHostName the host name of the mail exchange server - * @param priority the priority for the mail exchange host, lower the value higher the priority - * @return the next stage of the record set update - */ - UpdateMXRecordSet withMailExchange(String mailExchangeHostName, int priority); - - /** - * Removes MX record with the provided mail exchange server and priority from this record set. - * - * @param mailExchangeHostName the host name of the mail exchange server - * @param priority the priority for the mail exchange host, lower the value higher the priority - * @return the next stage of the record set update - */ - UpdateMXRecordSet withoutMailExchange(String mailExchangeHostName, int priority); - } - - /** The stage of the NS record set definition allowing to add or remove a NS record. */ - interface WithNSRecordNameServer { - /** - * Creates a NS record with the provided name server in this record set. - * - * @param nameServerHostName the name server host name - * @return the next stage of the record set update - */ - UpdateNSRecordSet withNameServer(String nameServerHostName); - - /** - * Rmoves a NS record with the provided name server from this record set. - * - * @param nameServerHostName the name server host name - * @return the next stage of the record set update - */ - UpdateNSRecordSet withoutNameServer(String nameServerHostName); - } - - /** The stage of the CName record set definition allowing to add or remove CName record. */ - interface WithPtrRecordTargetDomainName { - /** - * Creates a CName record with the provided canonical name in this record set. - * - * @param targetDomainName the target domain name - * @return the next stage of the record set update - */ - UpdatePtrRecordSet withTargetDomainName(String targetDomainName); - - /** - * Removes the CName record with the provided canonical name from this record set. - * - * @param targetDomainName the target domain name - * @return the next stage of the record set update - */ - UpdatePtrRecordSet withoutTargetDomainName(String targetDomainName); - } - - /** The stage of the SRV record definition allowing to add or remove service record. */ - interface WithSrvRecordEntry { - /** - * Specifies a service record for a service. - * - * @param target the canonical name of the target host running the service - * @param port the port on which the service is bounded - * @param priority the priority of the target host, lower the value higher the priority - * @param weight the relative weight (preference) of the records with the same priority, higher the value - * more the preference - * @return the next stage of the record set update - */ - UpdateSrvRecordSet withRecord(String target, int port, int priority, int weight); - - /** - * Removes a service record for a service. - * - * @param target the canonical name of the target host running the service - * @param port the port on which the service is bounded - * @param priority the priority of the target host - * @param weight the relative weight (preference) of the records - * @return the next stage of the record set update - */ - UpdateSrvRecordSet withoutRecord(String target, int port, int priority, int weight); - } - - /** The stage of the Txt record definition allowing to add or remove TXT record. */ - interface WithTxtRecordTextValue { - /** - * Creates a Txt record with the given text in this record set. - * - * @param text the text value - * @return the next stage of the record set update - */ - UpdateTxtRecordSet withText(String text); - - /** - * Removes a Txt record with the given text from this record set. - * - * @param text the text value - * @return the next stage of the record set update - */ - UpdateTxtRecordSet withoutText(String text); - - /** - * Removes a Txt record with the given text (split into 255 char chunks) from this record set. - * - * @param textChunks the text value as list - * @return the next stage of the record set update - */ - UpdateTxtRecordSet withoutText(List textChunks); - } - - /** The stage of the SOA record definition allowing to update its attributes. */ - interface WithSoaRecordAttributes { - /** - * Specifies the email server associated with the SOA record. - * - * @param emailServerHostName the email server - * @return the next stage of the record set update - */ - UpdateSoaRecord withEmailServer(String emailServerHostName); - - /** - * Specifies time in seconds that a secondary name server should wait before trying to contact the the - * primary name server for a zone file update. - * - * @param refreshTimeInSeconds the refresh time in seconds - * @return the next stage of the record set update - */ - UpdateSoaRecord withRefreshTimeInSeconds(long refreshTimeInSeconds); - - /** - * Specifies the time in seconds that a secondary name server should wait before trying to contact the - * primary name server again after a failed attempt to check for a zone file update. - * - * @param refreshTimeInSeconds the retry time in seconds - * @return the next stage of the record set update - */ - UpdateSoaRecord withRetryTimeInSeconds(long refreshTimeInSeconds); - - /** - * Specifies the time in seconds that a secondary name server will treat its cached zone file as valid when - * the primary name server cannot be contacted. - * - * @param expireTimeInSeconds the expire time in seconds - * @return the next stage of the record set update - */ - UpdateSoaRecord withExpireTimeInSeconds(long expireTimeInSeconds); - - /** - * Specifies the time in seconds that any name server or resolver should cache a negative response. - * - * @param negativeCachingTimeToLive the TTL for cached negative response - * @return the next stage of the record set update - */ - UpdateSoaRecord withNegativeResponseCachingTimeToLiveInSeconds(long negativeCachingTimeToLive); - - /** - * Specifies the serial number for the zone file. - * - * @param serialNumber the serial number - * @return the next stage of the record set update - */ - UpdateSoaRecord withSerialNumber(long serialNumber); - } - - /** The stage of the record set update allowing to specify TTL for the records in this record set. */ - interface WithTtl { - /** - * Specifies the TTL for the records in the record set. - * - * @param ttlInSeconds TTL in seconds - * @return the next stage of the record set update - */ - Update withTimeToLive(long ttlInSeconds); - } - - /** An update allowing metadata to be modified for the resource. */ - interface WithMetadata { - /** - * Adds a metadata to the record set. - * - * @param key the key for the metadata - * @param value the value for the metadata - * @return the next stage of the record set update - */ - Update withMetadata(String key, String value); - - /** - * Removes a metadata from the record set. - * - * @param key the key of the metadata to remove - * @return the next stage of the record set update - */ - Update withoutMetadata(String key); - } - - /** The stage of the record set update allowing to enable ETag validation. */ - interface WithETagCheck { - /** - * Specifies that If-Match header needs to set to the current etag value associated with the record set. - * - * @return the next stage of the update - */ - Update withETagCheck(); - - /** - * Specifies that if-Match header needs to set to the given etag value. - * - * @param etagValue the etag value - * @return the next stage of the update - */ - Update withETagCheck(String etagValue); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/DnsRecordSets.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/DnsRecordSets.java deleted file mode 100644 index f3571fd4f780..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/DnsRecordSets.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.dns.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingByName; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasParent; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; - -/** - * Base interface for all record sets. - * - * @param the record set type - */ -@Fluent -public interface DnsRecordSets - extends SupportsListing, SupportsGettingByName, HasParent { - /** - * Lists all the record sets with the given suffix. - * - * @param recordSetNameSuffix the record set name suffix - * @return list of record sets - */ - PagedIterable list(String recordSetNameSuffix); - /** - * Lists all the record sets, with number of entries in each page limited to given size. - * - * @param pageSize the maximum number of record sets in a page - * @return list of record sets - */ - PagedIterable list(int pageSize); - /** - * Lists all the record sets with the given suffix, also limits the number of entries per page to the given page - * size. - * - * @param recordSetNameSuffix the record set name suffix - * @param pageSize the maximum number of record sets in a page - * @return the record sets - */ - PagedIterable list(String recordSetNameSuffix, int pageSize); - /** - * Lists all the record sets with the given suffix. - * - * @param recordSetNameSuffix the record set name suffix - * @return an observable that emits record sets - */ - PagedFlux listAsync(String recordSetNameSuffix); - /** - * Lists all the record sets, with number of entries in each page limited to given size. - * - * @param pageSize the maximum number of record sets in a page - * @return an observable that emits record sets - */ - PagedFlux listAsync(int pageSize); - /** - * Lists all the record sets with the given suffix, also limits the number of entries per page to the given page - * size. - * - * @param recordSetNameSuffix the record set name suffix - * @param pageSize the maximum number of record sets in a page - * @return an observable that emits record sets - */ - PagedFlux listAsync(String recordSetNameSuffix, int pageSize); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/DnsZone.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/DnsZone.java deleted file mode 100644 index 066504127bcd..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/DnsZone.java +++ /dev/null @@ -1,515 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.dns.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.dns.DnsZoneManager; -import com.azure.resourcemanager.dns.fluent.models.ZoneInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.GroupableResource; -import com.azure.resourcemanager.resources.fluentcore.arm.models.Resource; -import com.azure.resourcemanager.resources.fluentcore.model.Appliable; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; -import com.azure.resourcemanager.resources.fluentcore.model.Updatable; -import java.util.List; - -/** An immutable client-side representation of an Azure DNS Zone. */ -@Fluent -public interface DnsZone - extends GroupableResource, Refreshable, Updatable { - /** @return the maximum number of record sets that can be created in this zone. */ - long maxNumberOfRecordSets(); - - /** @return the current number of record sets in this zone. */ - long numberOfRecordSets(); - - /** @return the etag associated with this zone. */ - String etag(); - - /** @return the access type of this zone (Private or Public). */ - ZoneType accessType(); - - /** @return the record sets in this zone. */ - PagedIterable listRecordSets(); - - /** - * Lists all the record sets in this zone with the given suffix. - * - * @param recordSetNameSuffix the record set name suffix - * @return the record sets - */ - PagedIterable listRecordSets(String recordSetNameSuffix); - - /** - * Lists all the record sets in this zone with each entries in each page limited to the given size. - * - * @param pageSize the maximum number of record sets in a page - * @return the record sets - */ - PagedIterable listRecordSets(int pageSize); - - /** - * Lists all the record sets in this zone with the given suffix, also limits the number of entries per page to the - * given page size. - * - * @param recordSetNameSuffix the record set name suffix - * @param pageSize the maximum number of record sets in a page - * @return the record sets - */ - PagedIterable listRecordSets(String recordSetNameSuffix, int pageSize); - - /** @return name servers assigned for this zone. */ - List nameServers(); - - /** @return entry point to manage record sets in this zone containing A (IPv4 address) records */ - ARecordSets aRecordSets(); - - /** @return entry point to manage record sets in this zone containing AAAA (IPv6 address) records */ - AaaaRecordSets aaaaRecordSets(); - - /** @return entry point to manage record sets in this zone containing CNAME (canonical name) records */ - CnameRecordSets cNameRecordSets(); - - /** @return entry point to manage record sets in this zone containing MX (mail exchange) records */ - MxRecordSets mxRecordSets(); - - /** @return entry point to manage record sets in this zone containing NS (name server) records */ - NsRecordSets nsRecordSets(); - - /** @return entry point to manage record sets in this zone containing PTR (pointer) records */ - PtrRecordSets ptrRecordSets(); - - /** @return entry point to manage record sets in this zone containing SRV (service) records */ - SrvRecordSets srvRecordSets(); - - /** @return entry point to manage record sets in this zone containing TXT (text) records */ - TxtRecordSets txtRecordSets(); - - /** @return the record set containing SOA (start of authority) record associated with this DNS zone */ - SoaRecordSet getSoaRecordSet(); - - /** The entirety of the DNS zone definition. */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithCreate { - } - - /** Grouping of DNS zone definition stages. */ - interface DefinitionStages { - /** The stage of the DNS zone definition allowing to specify the resource group. */ - interface Blank extends GroupableResource.DefinitionStages.WithGroupAndRegion { - } - - /** The stage of the DNS zone definition allowing to specify record set. */ - interface WithRecordSet { - /** - * Specifies definition of an A record set. - * - * @param name name of the A record set - * @return the stage representing configuration for the A record set - */ - DnsRecordSet.DefinitionStages.ARecordSetBlank defineARecordSet(String name); - - /** - * Specifies definition of an AAAA record set. - * - * @param name name of the AAAA record set - * @return the stage representing configuration for the AAAA record set - */ - DnsRecordSet.DefinitionStages.AaaaRecordSetBlank defineAaaaRecordSet(String name); - - /** - * Specifies definition of a CNAME record set. - * - * @param name name of the CNAME record set - * @param alias the CNAME record alias - * @return the next stage of DNS zone definition - */ - WithCreate withCNameRecordSet(String name, String alias); - - /** - * Specifies definition of a CNAME record set. - * - * @param name name of the CNAME record set - * @return the next stage of DNS zone definition - */ - DnsRecordSet.DefinitionStages.CNameRecordSetBlank defineCNameRecordSet(String name); - - /** - * Specifies definition of a MX record set. - * - * @param name name of the MX record set - * @return the stage representing configuration for the MX record set - */ - DnsRecordSet.DefinitionStages.MXRecordSetBlank defineMXRecordSet(String name); - - /** - * Specifies definition of an NS record set. - * - * @param name name of the NS record set - * @return the stage representing configuration for the NS record set - */ - DnsRecordSet.DefinitionStages.NSRecordSetBlank defineNSRecordSet(String name); - - /** - * Specifies definition of a PTR record set. - * - * @param name name of the PTR record set - * @return the stage representing configuration for the PTR record set - */ - DnsRecordSet.DefinitionStages.PtrRecordSetBlank definePtrRecordSet(String name); - - /** - * Specifies definition of a SRV record set. - * - * @param name the name of the SRV record set - * @return the stage representing configuration for the SRV record set - */ - DnsRecordSet.DefinitionStages.SrvRecordSetBlank defineSrvRecordSet(String name); - - /** - * Specifies definition of a TXT record set. - * - * @param name the name of the TXT record set - * @return the stage representing configuration for the TXT record set - */ - DnsRecordSet.DefinitionStages.TxtRecordSetBlank defineTxtRecordSet(String name); - } - - /** The stage of the DNS zone definition allowing to enable ETag validation. */ - interface WithETagCheck { - /** - * Specifies that If-None-Match header needs to set to * to prevent updating an existing DNS zone. - * - * @return the next stage of the definition - */ - WithCreate withETagCheck(); - } - - /** - * The stage of the definition which contains all the minimum required inputs for the resource to be created - * (via {@link WithCreate#create()}), but also allows for any other optional settings to be specified. - */ - interface WithCreate - extends Creatable, - DefinitionStages.WithRecordSet, - DefinitionStages.WithETagCheck, - Resource.DefinitionWithTags { - } - } - - /** Grouping of DNS zone update stages. */ - interface UpdateStages { - /** The stage of the DNS zone update allowing to specify record set. */ - interface WithRecordSet { - /** - * Specifies definition of an A record set to be attached to the DNS zone. - * - * @param name name of the A record set - * @return the stage representing configuration for the A record set - */ - DnsRecordSet.UpdateDefinitionStages.ARecordSetBlank defineARecordSet(String name); - - /** - * Specifies definition of an AAAA record set to be attached to the DNS zone. - * - * @param name name of the AAAA record set - * @return the stage representing configuration for the AAAA record set - */ - DnsRecordSet.UpdateDefinitionStages.AaaaRecordSetBlank defineAaaaRecordSet(String name); - - /** - * Specifies definition of a CNAME record set to be attached to the DNS zone. - * - * @param name name of the CNAME record set - * @param alias the CNAME record alias - * @return the next stage of DNS zone definition - */ - Update withCNameRecordSet(String name, String alias); - - /** - * Specifies definition of a CNAME record set. - * - * @param name name of the CNAME record set - * @return the next stage of DNS zone definition - */ - DnsRecordSet.UpdateDefinitionStages.CNameRecordSetBlank defineCNameRecordSet(String name); - - /** - * Specifies definition of a MX record set to be attached to the DNS zone. - * - * @param name name of the MX record set - * @return the stage representing configuration for the MX record set - */ - DnsRecordSet.UpdateDefinitionStages.MXRecordSetBlank defineMXRecordSet(String name); - - /** - * Specifies definition of an NS record set to be attached to the DNS zone. - * - * @param name name of the NS record set - * @return the stage representing configuration for the NS record set - */ - DnsRecordSet.UpdateDefinitionStages.NSRecordSetBlank defineNSRecordSet(String name); - - /** - * Specifies definition of a PTR record set to be attached to the DNS zone. - * - * @param name name of the PTR record set - * @return the stage representing configuration for the PTR record set - */ - DnsRecordSet.UpdateDefinitionStages.PtrRecordSetBlank definePtrRecordSet(String name); - - /** - * Specifies definition of a SRV record set to be attached to the DNS zone. - * - * @param name the name of the SRV record set - * @return the stage representing configuration for the SRV record set - */ - DnsRecordSet.UpdateDefinitionStages.SrvRecordSetBlank defineSrvRecordSet(String name); - - /** - * Specifies definition of a TXT record set to be attached to the DNS zone. - * - * @param name the name of the TXT record set - * @return the stage representing configuration for the TXT record set - */ - DnsRecordSet.UpdateDefinitionStages.TxtRecordSetBlank defineTxtRecordSet(String name); - - /** - * Begins the description of an update of an existing A record set in this DNS zone. - * - * @param name name of the A record set - * @return the stage representing configuration for the A record set - */ - DnsRecordSet.UpdateARecordSet updateARecordSet(String name); - - /** - * Begins the description of an update of an existing AAAA record set in this DNS zone. - * - * @param name name of the AAAA record set - * @return the stage representing configuration for the AAAA record set - */ - DnsRecordSet.UpdateAaaaRecordSet updateAaaaRecordSet(String name); - - /** - * Specifies definition of a CNAME record set. - * - * @param name name of the CNAME record set - * @return the stage representing configuration for the CNAME record set - */ - DnsRecordSet.UpdateCNameRecordSet updateCNameRecordSet(String name); - - /** - * Begins the description of an update of an existing MX record set in this DNS zone. - * - * @param name name of the MX record set - * @return the stage representing configuration for the MX record set - */ - DnsRecordSet.UpdateMXRecordSet updateMXRecordSet(String name); - - /** - * Begins the description of an update of an existing NS record set in this DNS zone. - * - * @param name name of the NS record set - * @return the stage representing configuration for the NS record set - */ - DnsRecordSet.UpdateNSRecordSet updateNSRecordSet(String name); - - /** - * Begins the description of an update of an existing PTR record set in this DNS zone. - * - * @param name name of the PTR record set - * @return the stage representing configuration for the PTR record set - */ - DnsRecordSet.UpdatePtrRecordSet updatePtrRecordSet(String name); - - /** - * Begins the description of an update of an existing SRV record set in this DNS zone. - * - * @param name the name of the SRV record set - * @return the stage representing configuration for the SRV record set - */ - DnsRecordSet.UpdateSrvRecordSet updateSrvRecordSet(String name); - - /** - * Begins the description of an update of an existing TXT record set in this DNS zone. - * - * @param name the name of the TXT record set - * @return the stage representing configuration for the TXT record set - */ - DnsRecordSet.UpdateTxtRecordSet updateTxtRecordSet(String name); - - /** - * Begins the description of an update of the SOA record in this DNS zone. - * - * @return the stage representing configuration for the TXT record set - */ - DnsRecordSet.UpdateSoaRecord updateSoaRecord(); - - /** - * Removes a A record set in the DNS zone. - * - * @param name name of the A record set - * @return the next stage of DNS zone update - */ - Update withoutARecordSet(String name); - - /** - * Removes a A record set in the DNS zone. - * - * @param name name of the A record set - * @param etagValue the etag to use for concurrent protection - * @return the next stage of DNS zone update - */ - Update withoutARecordSet(String name, String etagValue); - - /** - * Removes a AAAA record set in the DNS zone. - * - * @param name name of the AAAA record set - * @return the next stage of DNS zone update - */ - Update withoutAaaaRecordSet(String name); - - /** - * Removes a AAAA record set in the DNS zone. - * - * @param name name of the AAAA record set - * @param etagValue the etag to use for concurrent protection - * @return the next stage of DNS zone update - */ - Update withoutAaaaRecordSet(String name, String etagValue); - - /** - * Removes a CNAME record set in the DNS zone. - * - * @param name name of the CNAME record set - * @return the next stage of DNS zone update - */ - Update withoutCNameRecordSet(String name); - - /** - * Removes a CNAME record set in the DNS zone. - * - * @param name name of the CNAME record set - * @param etagValue the etag to use for concurrent protection - * @return the next stage of DNS zone update - */ - Update withoutCNameRecordSet(String name, String etagValue); - - /** - * Removes a MX record set in the DNS zone. - * - * @param name name of the MX record set - * @return the next stage of DNS zone update - */ - Update withoutMXRecordSet(String name); - - /** - * Removes a MX record set in the DNS zone. - * - * @param name name of the MX record set - * @param etagValue the etag to use for concurrent protection - * @return the next stage of DNS zone update - */ - Update withoutMXRecordSet(String name, String etagValue); - - /** - * Removes a NS record set in the DNS zone. - * - * @param name name of the NS record set - * @return the next stage of DNS zone update - */ - Update withoutNSRecordSet(String name); - - /** - * Removes a NS record set in the DNS zone. - * - * @param name name of the NS record set - * @param etagValue the etag to use for concurrent protection - * @return the next stage of DNS zone update - */ - Update withoutNSRecordSet(String name, String etagValue); - - /** - * Removes a PTR record set in the DNS zone. - * - * @param name name of the PTR record set - * @return the next stage of DNS zone update - */ - Update withoutPtrRecordSet(String name); - - /** - * Removes a PTR record set in the DNS zone. - * - * @param name name of the PTR record set - * @param etagValue the etag to use for concurrent protection - * @return the next stage of DNS zone update - */ - Update withoutPtrRecordSet(String name, String etagValue); - - /** - * Removes a SRV record set in the DNS zone. - * - * @param name name of the SRV record set - * @return the next stage of DNS zone update - */ - Update withoutSrvRecordSet(String name); - - /** - * Removes a SRV record set in the DNS zone. - * - * @param name name of the SRV record set - * @param etagValue the etag to use for concurrent protection - * @return the next stage of DNS zone update - */ - Update withoutSrvRecordSet(String name, String etagValue); - - /** - * Removes a TXT record set in the DNS zone. - * - * @param name name of the TXT record set - * @return the next stage of DNS zone update - */ - Update withoutTxtRecordSet(String name); - - /** - * Removes a TXT record set in the DNS zone. - * - * @param name name of the TXT record set - * @param etagValue the etag to use for concurrent protection - * @return the next stage of DNS zone update - */ - Update withoutTxtRecordSet(String name, String etagValue); - } - - /** The stage of the DNS zone update allowing to enable ETag validation. */ - interface WithETagCheck { - /** - * Specifies that If-Match header needs to set to the current etag value associated with the DNS Zone. - * - * @return the next stage of the update - */ - Update withETagCheck(); - - /** - * Specifies that if-Match header needs to set to the given etag value. - * - * @param etagValue the etag value - * @return the next stage of the update - */ - Update withETagCheck(String etagValue); - } - } - - /** - * The template for an update operation, containing all the settings that can be modified. - * - *

    Call {@link Update#apply()} to apply the changes to the resource in Azure. - */ - interface Update - extends Appliable, - UpdateStages.WithRecordSet, - UpdateStages.WithETagCheck, - Resource.UpdateWithTags { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/DnsZones.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/DnsZones.java deleted file mode 100644 index 2b6627278b09..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/DnsZones.java +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.dns.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.dns.DnsZoneManager; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsBatchDeletion; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsDeletingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsListingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsBatchCreation; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsCreating; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingById; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; -import reactor.core.publisher.Mono; - -/** Entry point to DNS zone management API in Azure. */ -@Fluent -public interface DnsZones - extends SupportsCreating, - SupportsListing, - SupportsListingByResourceGroup, - SupportsGettingByResourceGroup, - SupportsGettingById, - SupportsDeletingById, - SupportsDeletingByResourceGroup, - SupportsBatchCreation, - SupportsBatchDeletion, - HasManager { - /** - * Asynchronously deletes the zone from Azure, identifying it by its name and its resource group. - * - * @param resourceGroupName the resource group the resource is part of - * @param zoneName the name of the zone - * @param eTagValue the ETag value to set on IfMatch header for concurrency protection - * @return a representation of the deferred computation this delete call - */ - Mono deleteByResourceGroupNameAsync(String resourceGroupName, String zoneName, String eTagValue); - - /** - * Asynchronously deletes the zone from Azure, identifying it by its name and its resource group. - * - * @param resourceGroupName the resource group the resource is part of - * @param zoneName the name of the zone - * @return a representation of the deferred computation this delete call - */ - Mono deleteByResourceGroupNameAsync(String resourceGroupName, String zoneName); - - /** - * Asynchronously delete the zone from Azure, identifying it by its resource ID. - * - * @param id the resource ID of the resource to delete - * @param eTagValue the ETag value to set on IfMatch header for concurrency protection - * @return a representation of the deferred computation this delete call - */ - Mono deleteByIdAsync(String id, String eTagValue); - - /** - * Asynchronously delete the zone from Azure, identifying it by its resource ID. - * - * @param id the resource ID of the resource to delete - * @return a representation of the deferred computation this delete call - */ - Mono deleteByIdAsync(String id); - - /** - * Deletes the zone from Azure, identifying it by its name and its resource group. - * - * @param resourceGroupName the resource group the resource is part of - * @param zoneName the name of the zone - * @param eTagValue the ETag value to set on IfMatch header for concurrency protection - */ - void deleteByResourceGroupName(String resourceGroupName, String zoneName, String eTagValue); - - /** - * Deletes the zone from Azure, identifying it by its name and its resource group. - * - * @param resourceGroupName the resource group the resource is part of - * @param zoneName the name of the zone - */ - void deleteByResourceGroupName(String resourceGroupName, String zoneName); - - /** - * Deletes a resource from Azure, identifying it by its resource ID. - * - * @param id the resource ID of the resource to delete - * @param eTagValue the ETag value to set on IfMatch header for concurrency protection - */ - void deleteById(String id, String eTagValue); - - /** - * Deletes a resource from Azure, identifying it by its resource ID. - * - * @param id the resource ID of the resource to delete - */ - void deleteById(String id); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/HttpStatusCode.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/HttpStatusCode.java deleted file mode 100644 index 8c27efab520d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/HttpStatusCode.java +++ /dev/null @@ -1,182 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.dns.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for HttpStatusCode. */ -public enum HttpStatusCode { - /** Enum value Continue. */ - CONTINUE("Continue"), - - /** Enum value SwitchingProtocols. */ - SWITCHING_PROTOCOLS("SwitchingProtocols"), - - /** Enum value OK. */ - OK("OK"), - - /** Enum value Created. */ - CREATED("Created"), - - /** Enum value Accepted. */ - ACCEPTED("Accepted"), - - /** Enum value NonAuthoritativeInformation. */ - NON_AUTHORITATIVE_INFORMATION("NonAuthoritativeInformation"), - - /** Enum value NoContent. */ - NO_CONTENT("NoContent"), - - /** Enum value ResetContent. */ - RESET_CONTENT("ResetContent"), - - /** Enum value PartialContent. */ - PARTIAL_CONTENT("PartialContent"), - - /** Enum value MultipleChoices. */ - MULTIPLE_CHOICES("MultipleChoices"), - - /** Enum value Ambiguous. */ - AMBIGUOUS("Ambiguous"), - - /** Enum value MovedPermanently. */ - MOVED_PERMANENTLY("MovedPermanently"), - - /** Enum value Moved. */ - MOVED("Moved"), - - /** Enum value Found. */ - FOUND("Found"), - - /** Enum value Redirect. */ - REDIRECT("Redirect"), - - /** Enum value SeeOther. */ - SEE_OTHER("SeeOther"), - - /** Enum value RedirectMethod. */ - REDIRECT_METHOD("RedirectMethod"), - - /** Enum value NotModified. */ - NOT_MODIFIED("NotModified"), - - /** Enum value UseProxy. */ - USE_PROXY("UseProxy"), - - /** Enum value Unused. */ - UNUSED("Unused"), - - /** Enum value TemporaryRedirect. */ - TEMPORARY_REDIRECT("TemporaryRedirect"), - - /** Enum value RedirectKeepVerb. */ - REDIRECT_KEEP_VERB("RedirectKeepVerb"), - - /** Enum value BadRequest. */ - BAD_REQUEST("BadRequest"), - - /** Enum value Unauthorized. */ - UNAUTHORIZED("Unauthorized"), - - /** Enum value PaymentRequired. */ - PAYMENT_REQUIRED("PaymentRequired"), - - /** Enum value Forbidden. */ - FORBIDDEN("Forbidden"), - - /** Enum value NotFound. */ - NOT_FOUND("NotFound"), - - /** Enum value MethodNotAllowed. */ - METHOD_NOT_ALLOWED("MethodNotAllowed"), - - /** Enum value NotAcceptable. */ - NOT_ACCEPTABLE("NotAcceptable"), - - /** Enum value ProxyAuthenticationRequired. */ - PROXY_AUTHENTICATION_REQUIRED("ProxyAuthenticationRequired"), - - /** Enum value RequestTimeout. */ - REQUEST_TIMEOUT("RequestTimeout"), - - /** Enum value Conflict. */ - CONFLICT("Conflict"), - - /** Enum value Gone. */ - GONE("Gone"), - - /** Enum value LengthRequired. */ - LENGTH_REQUIRED("LengthRequired"), - - /** Enum value PreconditionFailed. */ - PRECONDITION_FAILED("PreconditionFailed"), - - /** Enum value RequestEntityTooLarge. */ - REQUEST_ENTITY_TOO_LARGE("RequestEntityTooLarge"), - - /** Enum value RequestUriTooLong. */ - REQUEST_URI_TOO_LONG("RequestUriTooLong"), - - /** Enum value UnsupportedMediaType. */ - UNSUPPORTED_MEDIA_TYPE("UnsupportedMediaType"), - - /** Enum value RequestedRangeNotSatisfiable. */ - REQUESTED_RANGE_NOT_SATISFIABLE("RequestedRangeNotSatisfiable"), - - /** Enum value ExpectationFailed. */ - EXPECTATION_FAILED("ExpectationFailed"), - - /** Enum value UpgradeRequired. */ - UPGRADE_REQUIRED("UpgradeRequired"), - - /** Enum value InternalServerError. */ - INTERNAL_SERVER_ERROR("InternalServerError"), - - /** Enum value NotImplemented. */ - NOT_IMPLEMENTED("NotImplemented"), - - /** Enum value BadGateway. */ - BAD_GATEWAY("BadGateway"), - - /** Enum value ServiceUnavailable. */ - SERVICE_UNAVAILABLE("ServiceUnavailable"), - - /** Enum value GatewayTimeout. */ - GATEWAY_TIMEOUT("GatewayTimeout"), - - /** Enum value HttpVersionNotSupported. */ - HTTP_VERSION_NOT_SUPPORTED("HttpVersionNotSupported"); - - /** The actual serialized value for a HttpStatusCode instance. */ - private final String value; - - HttpStatusCode(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a HttpStatusCode instance. - * - * @param value the serialized value to parse. - * @return the parsed HttpStatusCode object, or null if unable to parse. - */ - @JsonCreator - public static HttpStatusCode fromString(String value) { - HttpStatusCode[] items = HttpStatusCode.values(); - for (HttpStatusCode item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/MxRecord.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/MxRecord.java deleted file mode 100644 index 9e8518513c42..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/MxRecord.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.dns.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** An MX record. */ -@Fluent -public final class MxRecord { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MxRecord.class); - - /* - * The preference value for this MX record. - */ - @JsonProperty(value = "preference") - private Integer preference; - - /* - * The domain name of the mail host for this MX record. - */ - @JsonProperty(value = "exchange") - private String exchange; - - /** - * Get the preference property: The preference value for this MX record. - * - * @return the preference value. - */ - public Integer preference() { - return this.preference; - } - - /** - * Set the preference property: The preference value for this MX record. - * - * @param preference the preference value to set. - * @return the MxRecord object itself. - */ - public MxRecord withPreference(Integer preference) { - this.preference = preference; - return this; - } - - /** - * Get the exchange property: The domain name of the mail host for this MX record. - * - * @return the exchange value. - */ - public String exchange() { - return this.exchange; - } - - /** - * Set the exchange property: The domain name of the mail host for this MX record. - * - * @param exchange the exchange value to set. - * @return the MxRecord object itself. - */ - public MxRecord withExchange(String exchange) { - this.exchange = exchange; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/MxRecordSet.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/MxRecordSet.java deleted file mode 100644 index 3262d8481ef3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/MxRecordSet.java +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.dns.models; - -import com.azure.core.annotation.Fluent; -import java.util.List; - -/** An immutable client-side representation of an MX (mail exchange) record set in an Azure DNS Zone. */ -@Fluent -public interface MxRecordSet extends DnsRecordSet { - /** @return the MX records in this record set */ - List records(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/MxRecordSets.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/MxRecordSets.java deleted file mode 100644 index f59a2d152545..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/MxRecordSets.java +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.dns.models; - -import com.azure.core.annotation.Fluent; - -/** Entry point to MX record sets in an Azure DNS zone. */ -@Fluent -public interface MxRecordSets extends DnsRecordSets { -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/NsRecord.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/NsRecord.java deleted file mode 100644 index 4cd1ff9532d5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/NsRecord.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.dns.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** An NS record. */ -@Fluent -public final class NsRecord { - @JsonIgnore private final ClientLogger logger = new ClientLogger(NsRecord.class); - - /* - * The name server name for this NS record. - */ - @JsonProperty(value = "nsdname") - private String nsdname; - - /** - * Get the nsdname property: The name server name for this NS record. - * - * @return the nsdname value. - */ - public String nsdname() { - return this.nsdname; - } - - /** - * Set the nsdname property: The name server name for this NS record. - * - * @param nsdname the nsdname value to set. - * @return the NsRecord object itself. - */ - public NsRecord withNsdname(String nsdname) { - this.nsdname = nsdname; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/NsRecordSet.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/NsRecordSet.java deleted file mode 100644 index e49448bfbb74..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/NsRecordSet.java +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.dns.models; - -import com.azure.core.annotation.Fluent; -import java.util.List; - -/** An immutable client-side representation of an NS (name server) record set in Azure DNS Zone. */ -@Fluent -public interface NsRecordSet extends DnsRecordSet { - /** @return the name server names of NS (name server) records in this record set */ - List nameServers(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/NsRecordSets.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/NsRecordSets.java deleted file mode 100644 index 4769f9c6dcbf..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/NsRecordSets.java +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.dns.models; - -import com.azure.core.annotation.Fluent; - -/** Entry point to NS record sets in an Azure DNS zone. */ -@Fluent -public interface NsRecordSets extends DnsRecordSets { -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/OperationStatus.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/OperationStatus.java deleted file mode 100644 index 2f91539965dd..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/OperationStatus.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.dns.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for OperationStatus. */ -public enum OperationStatus { - /** Enum value InProgress. */ - IN_PROGRESS("InProgress"), - - /** Enum value Succeeded. */ - SUCCEEDED("Succeeded"), - - /** Enum value Failed. */ - FAILED("Failed"); - - /** The actual serialized value for a OperationStatus instance. */ - private final String value; - - OperationStatus(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a OperationStatus instance. - * - * @param value the serialized value to parse. - * @return the parsed OperationStatus object, or null if unable to parse. - */ - @JsonCreator - public static OperationStatus fromString(String value) { - OperationStatus[] items = OperationStatus.values(); - for (OperationStatus item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/PtrRecord.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/PtrRecord.java deleted file mode 100644 index f19d73956d04..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/PtrRecord.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.dns.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** A PTR record. */ -@Fluent -public final class PtrRecord { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PtrRecord.class); - - /* - * The PTR target domain name for this PTR record. - */ - @JsonProperty(value = "ptrdname") - private String ptrdname; - - /** - * Get the ptrdname property: The PTR target domain name for this PTR record. - * - * @return the ptrdname value. - */ - public String ptrdname() { - return this.ptrdname; - } - - /** - * Set the ptrdname property: The PTR target domain name for this PTR record. - * - * @param ptrdname the ptrdname value to set. - * @return the PtrRecord object itself. - */ - public PtrRecord withPtrdname(String ptrdname) { - this.ptrdname = ptrdname; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/PtrRecordSet.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/PtrRecordSet.java deleted file mode 100644 index 452229d80c7a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/PtrRecordSet.java +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.dns.models; - -import com.azure.core.annotation.Fluent; -import java.util.List; - -/** An immutable client-side representation of a PTR (pointer) record set in Azure DNS Zone. */ -@Fluent -public interface PtrRecordSet extends DnsRecordSet { - /** @return the target domain names of PTR records in this record set */ - List targetDomainNames(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/PtrRecordSets.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/PtrRecordSets.java deleted file mode 100644 index bd23920ff247..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/PtrRecordSets.java +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.dns.models; - -import com.azure.core.annotation.Fluent; - -/** Entry point to PTR record sets in a DNS zone. */ -@Fluent -public interface PtrRecordSets extends DnsRecordSets { -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/RecordSetListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/RecordSetListResult.java deleted file mode 100644 index 4c04414604b3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/RecordSetListResult.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.dns.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.dns.fluent.models.RecordSetInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The response to a record set List operation. */ -@Fluent -public final class RecordSetListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RecordSetListResult.class); - - /* - * Information about the record sets in the response. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The continuation token for the next page of results. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: Information about the record sets in the response. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Information about the record sets in the response. - * - * @param value the value value to set. - * @return the RecordSetListResult object itself. - */ - public RecordSetListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The continuation token for the next page of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The continuation token for the next page of results. - * - * @param nextLink the nextLink value to set. - * @return the RecordSetListResult object itself. - */ - public RecordSetListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/RecordType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/RecordType.java deleted file mode 100644 index 183a7ddf0887..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/RecordType.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.dns.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for RecordType. */ -public enum RecordType { - /** Enum value A. */ - A("A"), - - /** Enum value AAAA. */ - AAAA("AAAA"), - - /** Enum value CNAME. */ - CNAME("CNAME"), - - /** Enum value MX. */ - MX("MX"), - - /** Enum value NS. */ - NS("NS"), - - /** Enum value PTR. */ - PTR("PTR"), - - /** Enum value SOA. */ - SOA("SOA"), - - /** Enum value SRV. */ - SRV("SRV"), - - /** Enum value TXT. */ - TXT("TXT"); - - /** The actual serialized value for a RecordType instance. */ - private final String value; - - RecordType(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a RecordType instance. - * - * @param value the serialized value to parse. - * @return the parsed RecordType object, or null if unable to parse. - */ - @JsonCreator - public static RecordType fromString(String value) { - RecordType[] items = RecordType.values(); - for (RecordType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/SoaRecord.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/SoaRecord.java deleted file mode 100644 index 8703426d6421..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/SoaRecord.java +++ /dev/null @@ -1,209 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.dns.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** An SOA record. */ -@Fluent -public final class SoaRecord { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SoaRecord.class); - - /* - * The domain name of the authoritative name server for this SOA record. - */ - @JsonProperty(value = "host") - private String host; - - /* - * The email contact for this SOA record. - */ - @JsonProperty(value = "email") - private String email; - - /* - * The serial number for this SOA record. - */ - @JsonProperty(value = "serialNumber") - private Long serialNumber; - - /* - * The refresh value for this SOA record. - */ - @JsonProperty(value = "refreshTime") - private Long refreshTime; - - /* - * The retry time for this SOA record. - */ - @JsonProperty(value = "retryTime") - private Long retryTime; - - /* - * The expire time for this SOA record. - */ - @JsonProperty(value = "expireTime") - private Long expireTime; - - /* - * The minimum value for this SOA record. By convention this is used to - * determine the negative caching duration. - */ - @JsonProperty(value = "minimumTTL") - private Long minimumTtl; - - /** - * Get the host property: The domain name of the authoritative name server for this SOA record. - * - * @return the host value. - */ - public String host() { - return this.host; - } - - /** - * Set the host property: The domain name of the authoritative name server for this SOA record. - * - * @param host the host value to set. - * @return the SoaRecord object itself. - */ - public SoaRecord withHost(String host) { - this.host = host; - return this; - } - - /** - * Get the email property: The email contact for this SOA record. - * - * @return the email value. - */ - public String email() { - return this.email; - } - - /** - * Set the email property: The email contact for this SOA record. - * - * @param email the email value to set. - * @return the SoaRecord object itself. - */ - public SoaRecord withEmail(String email) { - this.email = email; - return this; - } - - /** - * Get the serialNumber property: The serial number for this SOA record. - * - * @return the serialNumber value. - */ - public Long serialNumber() { - return this.serialNumber; - } - - /** - * Set the serialNumber property: The serial number for this SOA record. - * - * @param serialNumber the serialNumber value to set. - * @return the SoaRecord object itself. - */ - public SoaRecord withSerialNumber(Long serialNumber) { - this.serialNumber = serialNumber; - return this; - } - - /** - * Get the refreshTime property: The refresh value for this SOA record. - * - * @return the refreshTime value. - */ - public Long refreshTime() { - return this.refreshTime; - } - - /** - * Set the refreshTime property: The refresh value for this SOA record. - * - * @param refreshTime the refreshTime value to set. - * @return the SoaRecord object itself. - */ - public SoaRecord withRefreshTime(Long refreshTime) { - this.refreshTime = refreshTime; - return this; - } - - /** - * Get the retryTime property: The retry time for this SOA record. - * - * @return the retryTime value. - */ - public Long retryTime() { - return this.retryTime; - } - - /** - * Set the retryTime property: The retry time for this SOA record. - * - * @param retryTime the retryTime value to set. - * @return the SoaRecord object itself. - */ - public SoaRecord withRetryTime(Long retryTime) { - this.retryTime = retryTime; - return this; - } - - /** - * Get the expireTime property: The expire time for this SOA record. - * - * @return the expireTime value. - */ - public Long expireTime() { - return this.expireTime; - } - - /** - * Set the expireTime property: The expire time for this SOA record. - * - * @param expireTime the expireTime value to set. - * @return the SoaRecord object itself. - */ - public SoaRecord withExpireTime(Long expireTime) { - this.expireTime = expireTime; - return this; - } - - /** - * Get the minimumTtl property: The minimum value for this SOA record. By convention this is used to determine the - * negative caching duration. - * - * @return the minimumTtl value. - */ - public Long minimumTtl() { - return this.minimumTtl; - } - - /** - * Set the minimumTtl property: The minimum value for this SOA record. By convention this is used to determine the - * negative caching duration. - * - * @param minimumTtl the minimumTtl value to set. - * @return the SoaRecord object itself. - */ - public SoaRecord withMinimumTtl(Long minimumTtl) { - this.minimumTtl = minimumTtl; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/SoaRecordSet.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/SoaRecordSet.java deleted file mode 100644 index bd5448c9dd1e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/SoaRecordSet.java +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.dns.models; - -import com.azure.core.annotation.Fluent; - -/** An immutable client-side representation of a SOA (start of authority) record set in Azure DNS Zone. */ -@Fluent -public interface SoaRecordSet extends DnsRecordSet { - /** @return the SOA record in this record set */ - SoaRecord record(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/SrvRecord.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/SrvRecord.java deleted file mode 100644 index 9520a2d261f1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/SrvRecord.java +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.dns.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** An SRV record. */ -@Fluent -public final class SrvRecord { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SrvRecord.class); - - /* - * The priority value for this SRV record. - */ - @JsonProperty(value = "priority") - private Integer priority; - - /* - * The weight value for this SRV record. - */ - @JsonProperty(value = "weight") - private Integer weight; - - /* - * The port value for this SRV record. - */ - @JsonProperty(value = "port") - private Integer port; - - /* - * The target domain name for this SRV record. - */ - @JsonProperty(value = "target") - private String target; - - /** - * Get the priority property: The priority value for this SRV record. - * - * @return the priority value. - */ - public Integer priority() { - return this.priority; - } - - /** - * Set the priority property: The priority value for this SRV record. - * - * @param priority the priority value to set. - * @return the SrvRecord object itself. - */ - public SrvRecord withPriority(Integer priority) { - this.priority = priority; - return this; - } - - /** - * Get the weight property: The weight value for this SRV record. - * - * @return the weight value. - */ - public Integer weight() { - return this.weight; - } - - /** - * Set the weight property: The weight value for this SRV record. - * - * @param weight the weight value to set. - * @return the SrvRecord object itself. - */ - public SrvRecord withWeight(Integer weight) { - this.weight = weight; - return this; - } - - /** - * Get the port property: The port value for this SRV record. - * - * @return the port value. - */ - public Integer port() { - return this.port; - } - - /** - * Set the port property: The port value for this SRV record. - * - * @param port the port value to set. - * @return the SrvRecord object itself. - */ - public SrvRecord withPort(Integer port) { - this.port = port; - return this; - } - - /** - * Get the target property: The target domain name for this SRV record. - * - * @return the target value. - */ - public String target() { - return this.target; - } - - /** - * Set the target property: The target domain name for this SRV record. - * - * @param target the target value to set. - * @return the SrvRecord object itself. - */ - public SrvRecord withTarget(String target) { - this.target = target; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/SrvRecordSet.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/SrvRecordSet.java deleted file mode 100644 index 48ecc4be7468..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/SrvRecordSet.java +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.dns.models; - -import com.azure.core.annotation.Fluent; -import java.util.List; - -/** An immutable client-side representation of an SVR (service) record set in Azure DNS Zone. */ -@Fluent -public interface SrvRecordSet extends DnsRecordSet { - /** @return the SRV records in this record set */ - List records(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/SrvRecordSets.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/SrvRecordSets.java deleted file mode 100644 index a77dc682a557..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/SrvRecordSets.java +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.dns.models; - -import com.azure.core.annotation.Fluent; - -/** Entry point to SRV record sets in a DNS zone. */ -@Fluent -public interface SrvRecordSets extends DnsRecordSets { -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/TxtRecord.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/TxtRecord.java deleted file mode 100644 index fe8e7961dd1e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/TxtRecord.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.dns.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** A TXT record. */ -@Fluent -public final class TxtRecord { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TxtRecord.class); - - /* - * The text value of this TXT record. - */ - @JsonProperty(value = "value") - private List value; - - /** - * Get the value property: The text value of this TXT record. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The text value of this TXT record. - * - * @param value the value value to set. - * @return the TxtRecord object itself. - */ - public TxtRecord withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/TxtRecordSet.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/TxtRecordSet.java deleted file mode 100644 index 62f8f314b1fd..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/TxtRecordSet.java +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.dns.models; - -import com.azure.core.annotation.Fluent; -import java.util.List; - -/** An immutable client-side representation of a TXT (text) record set in Azure DNS Zone. */ -@Fluent -public interface TxtRecordSet extends DnsRecordSet { - /** @return the TXT records in this record set */ - List records(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/TxtRecordSets.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/TxtRecordSets.java deleted file mode 100644 index 105a9162e770..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/TxtRecordSets.java +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.dns.models; - -import com.azure.core.annotation.Fluent; - -/** Entry point to TXT record sets in a DNS zone. */ -@Fluent -public interface TxtRecordSets extends DnsRecordSets { -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/ZoneListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/ZoneListResult.java deleted file mode 100644 index 3bcfb38fe376..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/ZoneListResult.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.dns.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.dns.fluent.models.ZoneInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The response to a Zone List or ListAll operation. */ -@Fluent -public final class ZoneListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ZoneListResult.class); - - /* - * Information about the DNS zones. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The continuation token for the next page of results. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: Information about the DNS zones. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Information about the DNS zones. - * - * @param value the value value to set. - * @return the ZoneListResult object itself. - */ - public ZoneListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The continuation token for the next page of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The continuation token for the next page of results. - * - * @param nextLink the nextLink value to set. - * @return the ZoneListResult object itself. - */ - public ZoneListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/ZoneType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/ZoneType.java deleted file mode 100644 index bb953759705e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/ZoneType.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.dns.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for ZoneType. */ -public enum ZoneType { - /** Enum value Public. */ - PUBLIC("Public"), - - /** Enum value Private. */ - PRIVATE("Private"); - - /** The actual serialized value for a ZoneType instance. */ - private final String value; - - ZoneType(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a ZoneType instance. - * - * @param value the serialized value to parse. - * @return the parsed ZoneType object, or null if unable to parse. - */ - @JsonCreator - public static ZoneType fromString(String value) { - ZoneType[] items = ZoneType.values(); - for (ZoneType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/package-info.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/package-info.java deleted file mode 100644 index 68cd8d0385b8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/models/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** Package containing the data models for DnsManagementClient. The DNS Management Client. */ -package com.azure.resourcemanager.dns.models; diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/package-info.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/package-info.java deleted file mode 100644 index 409bc34476a6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/com/azure/resourcemanager/dns/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** Package containing the classes for DnsManagementClient. The DNS Management Client. */ -package com.azure.resourcemanager.dns; diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/module-info.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/module-info.java deleted file mode 100644 index c0bcdbaf8f1a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/main/java/module-info.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -module com.azure.resourcemanager.dns { - requires transitive com.azure.resourcemanager.resources; - - // export public APIs of dns - exports com.azure.resourcemanager.dns; - exports com.azure.resourcemanager.dns.fluent; - exports com.azure.resourcemanager.dns.fluent.models; - exports com.azure.resourcemanager.dns.models; - - // open packages specifically for azure core and jackson - opens com.azure.resourcemanager.dns.fluent.models to - com.azure.core, - com.fasterxml.jackson.databind; - opens com.azure.resourcemanager.dns.models to - com.azure.core, - com.fasterxml.jackson.databind; -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/samples/java/com/azure/resourcemanager/dns/ReadmeSamples.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/samples/java/com/azure/resourcemanager/dns/ReadmeSamples.java deleted file mode 100644 index 79cf3fb373c1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/samples/java/com/azure/resourcemanager/dns/ReadmeSamples.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.dns; - -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpMethod; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.util.serializer.JacksonAdapter; -import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.identity.DefaultAzureCredentialBuilder; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.ArrayNode; - -import java.io.IOException; -import java.util.HashMap; - -public class ReadmeSamples { - - public void authenticate() { - // BEGIN: com.azure.resourcemanager.dns.authenticate - String armEndpoint = "https://management.."; - AzureProfile profile = new AzureProfile(getAzureEnvironmentFromArmEndpoint(armEndpoint)); - TokenCredential credential = new DefaultAzureCredentialBuilder() - .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) - .build(); - DnsZoneManager manager = DnsZoneManager - .authenticate(credential, profile); - // END: com.azure.resourcemanager.dns.authenticate - } - - // BEGIN: com.azure.resourcemanager.dns.getazureenvironment - private static AzureEnvironment getAzureEnvironmentFromArmEndpoint(String armEndpoint) { - // Create HTTP client and request - HttpClient httpClient = HttpClient.createDefault(); - - HttpRequest request = new HttpRequest(HttpMethod.GET, - String.format("%s/metadata/endpoints?api-version=2019-10-01", armEndpoint)) - .setHeader("accept", "application/json"); - - // Execute the request and read the response - HttpResponse response = httpClient.send(request).block(); - if (response.getStatusCode() != 200) { - throw new RuntimeException("Failed : HTTP error code : " + response.getStatusCode()); - } - String body = response.getBodyAsString().block(); - try { - ArrayNode metadataArray = JacksonAdapter.createDefaultSerializerAdapter() - .deserialize(body, ArrayNode.class, SerializerEncoding.JSON); - - if (metadataArray == null || metadataArray.isEmpty()) { - throw new RuntimeException("Failed to find metadata : " + body); - } - - JsonNode metadata = metadataArray.iterator().next(); - AzureEnvironment azureEnvironment = new AzureEnvironment(new HashMap() { - { - put("managementEndpointUrl", metadata.at("/authentication/audiences/0").asText()); - put("resourceManagerEndpointUrl", armEndpoint); - put("galleryEndpointUrl", metadata.at("/gallery").asText()); - put("activeDirectoryEndpointUrl", metadata.at("/authentication/loginEndpoint").asText()); - put("activeDirectoryResourceId", metadata.at("/authentication/audiences/0").asText()); - put("activeDirectoryGraphResourceId", metadata.at("/graph").asText()); - put("storageEndpointSuffix", "." + metadata.at("/suffixes/storage").asText()); - put("keyVaultDnsSuffix", "." + metadata.at("/suffixes/keyVaultDns").asText()); - } - }); - return azureEnvironment; - } catch (IOException ioe) { - ioe.printStackTrace(); - throw new RuntimeException(ioe); - } - } - // END: com.azure.resourcemanager.dns.getazureenvironment -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/test/java/com/azure/resourcemanager/dns/DnsZoneRecordSetETagTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/test/java/com/azure/resourcemanager/dns/DnsZoneRecordSetETagTests.java deleted file mode 100644 index 2bc6287525c6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/test/java/com/azure/resourcemanager/dns/DnsZoneRecordSetETagTests.java +++ /dev/null @@ -1,403 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.dns; - -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.policy.HttpLogOptions; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.exception.ManagementError; -import com.azure.core.management.exception.ManagementException; -import com.azure.resourcemanager.dns.models.ARecordSet; -import com.azure.resourcemanager.dns.models.AaaaRecordSet; -import com.azure.resourcemanager.dns.models.CnameRecordSet; -import com.azure.resourcemanager.dns.models.DnsZone; -import com.azure.resourcemanager.dns.models.ZoneType; -import com.azure.resourcemanager.test.utils.TestUtilities; -import com.azure.core.management.Region; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.resources.ResourceManager; -import com.azure.resourcemanager.resources.fluentcore.utils.HttpPipelineProvider; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import com.azure.resourcemanager.test.ResourceManagerTestBase; -import com.azure.resourcemanager.test.utils.TestDelayProvider; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -import java.time.temporal.ChronoUnit; -import java.util.List; - -public class DnsZoneRecordSetETagTests extends ResourceManagerTestBase { - private String rgName = ""; - - protected ResourceManager resourceManager; - protected DnsZoneManager zoneManager; - - @Override - protected HttpPipeline buildHttpPipeline( - TokenCredential credential, - AzureProfile profile, - HttpLogOptions httpLogOptions, - List policies, - HttpClient httpClient) { - return HttpPipelineProvider.buildHttpPipeline( - credential, - profile, - null, - httpLogOptions, - null, - new RetryPolicy("Retry-After", ChronoUnit.SECONDS), - policies, - httpClient); - } - - @Override - protected void initializeClients(HttpPipeline httpPipeline, AzureProfile profile) { - ResourceManagerUtils.InternalRuntimeContext.setDelayProvider(new TestDelayProvider(!isPlaybackMode())); - zoneManager = buildManager(DnsZoneManager.class, httpPipeline, profile); - resourceManager = zoneManager.resourceManager(); - rgName = generateRandomResourceName("dnsetagtest", 15); - } - - @Override - protected void cleanUpResources() { - resourceManager.resourceGroups().deleteByName(rgName); - } - - @Test - public void canCreateZoneWithDefaultETag() throws Exception { - final Region region = locationOrDefault(Region.US_EAST); - final String topLevelDomain = "www.contoso" + generateRandomResourceName("z", 10) + ".com"; - - DnsZone dnsZone = - zoneManager.zones().define(topLevelDomain).withNewResourceGroup(rgName, region).withETagCheck().create(); - Assertions.assertNotNull(dnsZone.etag()); - - Runnable runnable = - () -> - zoneManager - .zones() - .define(topLevelDomain) - .withNewResourceGroup(rgName, region) - .withETagCheck() - .create(); - ensureETagExceptionIsThrown(runnable); - } - - @Test - public void canUpdateZoneWithExplicitETag() throws Exception { - final Region region = locationOrDefault(Region.US_EAST); - final String topLevelDomain = "www.contoso" + generateRandomResourceName("z", 10) + ".com"; - - final DnsZone dnsZone = - zoneManager.zones().define(topLevelDomain).withNewResourceGroup(rgName, region).withETagCheck().create(); - Assertions.assertNotNull(dnsZone.etag()); - - Runnable runnable = () -> dnsZone.update().withETagCheck(dnsZone.etag() + "-foo").apply(); - ensureETagExceptionIsThrown(runnable); - dnsZone.update().withETagCheck(dnsZone.etag()).apply(); - } - - @Test - public void canDeleteZoneWithExplicitETag() throws Exception { - final Region region = locationOrDefault(Region.US_EAST); - final String topLevelDomain = "www.contoso" + generateRandomResourceName("z", 10) + ".com"; - - final DnsZone dnsZone = - zoneManager.zones().define(topLevelDomain).withNewResourceGroup(rgName, region).withETagCheck().create(); - Assertions.assertNotNull(dnsZone.etag()); - - Runnable runnable = () -> zoneManager.zones().deleteById(dnsZone.id(), dnsZone.etag() + "-foo"); - ensureETagExceptionIsThrown(runnable); - zoneManager.zones().deleteById(dnsZone.id(), dnsZone.etag()); - } - - @Test - public void canCreateRecordSetsWithDefaultETag() throws Exception { - final Region region = locationOrDefault(Region.US_EAST); - final String topLevelDomain = "www.contoso" + generateRandomResourceName("z", 10) + ".com"; - - DnsZone dnsZone = - zoneManager - .zones() - .define(topLevelDomain) - .withNewResourceGroup(rgName, region) - .defineARecordSet("www") - .withIPv4Address("23.96.104.40") - .withIPv4Address("24.97.105.41") - .withTimeToLive(7200) - .withETagCheck() - .attach() - .defineAaaaRecordSet("www") - .withIPv6Address("2001:0db8:85a3:0000:0000:8a2e:0370:7334") - .withIPv6Address("2002:0db9:85a4:0000:0000:8a2e:0371:7335") - .withETagCheck() - .attach() - .defineCNameRecordSet("documents") - .withAlias("doc.contoso.com") - .withETagCheck() - .attach() - .defineCNameRecordSet("userguide") - .withAlias("doc.contoso.com") - .withETagCheck() - .attach() - .create(); - - // Check A records - PagedIterable aRecordSets = dnsZone.aRecordSets().list(); - Assertions.assertTrue(TestUtilities.getSize(aRecordSets) == 1); - ARecordSet aRecordSet1 = aRecordSets.iterator().next(); - Assertions.assertTrue(aRecordSet1.timeToLive() == 7200); - - // Check AAAA records - PagedIterable aaaaRecordSets = dnsZone.aaaaRecordSets().list(); - Assertions.assertTrue(TestUtilities.getSize(aaaaRecordSets) == 1); - AaaaRecordSet aaaaRecordSet1 = aaaaRecordSets.iterator().next(); - Assertions.assertTrue(aaaaRecordSet1.name().startsWith("www")); - Assertions.assertTrue(aaaaRecordSet1.ipv6Addresses().size() == 2); - - // Check CNAME records - PagedIterable cnameRecordSets = dnsZone.cNameRecordSets().list(); - Assertions.assertTrue(TestUtilities.getSize(cnameRecordSets) == 2); - - Assertions.assertEquals(ZoneType.PUBLIC, dnsZone.accessType()); - - Exception compositeException = null; - try { - zoneManager - .zones() - .define(topLevelDomain) - .withNewResourceGroup(rgName, region) - .defineARecordSet("www") - .withIPv4Address("23.96.104.40") - .withIPv4Address("24.97.105.41") - .withTimeToLive(7200) - .withETagCheck() - .attach() - .defineAaaaRecordSet("www") - .withIPv6Address("2001:0db8:85a3:0000:0000:8a2e:0370:7334") - .withIPv6Address("2002:0db9:85a4:0000:0000:8a2e:0371:7335") - .withETagCheck() - .attach() - .defineCNameRecordSet("documents") - .withAlias("doc.contoso.com") - .withETagCheck() - .attach() - .defineCNameRecordSet("userguide") - .withAlias("doc.contoso.com") - .withETagCheck() - .attach() - .create(); - } catch (Exception exception) { - compositeException = exception; - } - Assertions.assertNotNull(compositeException); - - Assertions.assertTrue(compositeException.getSuppressed().length > 0); - for (int i = 0; i < compositeException.getSuppressed().length; ++i) { - Throwable exception = compositeException.getSuppressed()[i]; - if (exception instanceof ManagementException) { - ManagementError cloudError = ((ManagementException) exception).getValue(); - Assertions.assertNotNull(cloudError); - Assertions.assertNotNull(cloudError.getCode()); - Assertions.assertTrue(cloudError.getCode().contains("PreconditionFailed")); - } - } - } - - @Test - public void canUpdateRecordSetWithExplicitETag() throws Exception { - final Region region = locationOrDefault(Region.US_EAST); - final String topLevelDomain = "www.contoso" + generateRandomResourceName("z", 10) + ".com"; - - DnsZone dnsZone = - zoneManager - .zones() - .define(topLevelDomain) - .withNewResourceGroup(rgName, region) - .defineARecordSet("www") - .withIPv4Address("23.96.104.40") - .withIPv4Address("24.97.105.41") - .withTimeToLive(7200) - .withETagCheck() - .attach() - .defineAaaaRecordSet("www") - .withIPv6Address("2001:0db8:85a3:0000:0000:8a2e:0370:7334") - .withIPv6Address("2002:0db9:85a4:0000:0000:8a2e:0371:7335") - .withETagCheck() - .attach() - .create(); - - // Check A records - PagedIterable aRecordSets = dnsZone.aRecordSets().list(); - Assertions.assertTrue(TestUtilities.getSize(aRecordSets) == 1); - ARecordSet aRecordSet = aRecordSets.iterator().next(); - Assertions.assertNotNull(aRecordSet.etag()); - - // Check AAAA records - PagedIterable aaaaRecordSets = dnsZone.aaaaRecordSets().list(); - Assertions.assertTrue(TestUtilities.getSize(aaaaRecordSets) == 1); - AaaaRecordSet aaaaRecordSet = aaaaRecordSets.iterator().next(); - Assertions.assertNotNull(aaaaRecordSet.etag()); - - // by default zone access type should be public - Assertions.assertEquals(ZoneType.PUBLIC, dnsZone.accessType()); - // Try updates with invalid etag - // - Exception compositeException = null; - try { - dnsZone - .update() - .updateARecordSet("www") - .withETagCheck(aRecordSet.etag() + "-foo") - .parent() - .updateAaaaRecordSet("www") - .withETagCheck(aaaaRecordSet.etag() + "-foo") - .parent() - .apply(); - } catch (Exception exception) { - compositeException = exception; - } - Assertions.assertNotNull(compositeException); - Assertions.assertTrue(compositeException.getSuppressed().length > 0); - for (int i = 0; i < compositeException.getSuppressed().length; ++i) { - Throwable exception = compositeException.getSuppressed()[i]; - if (exception instanceof ManagementException) { - ManagementError cloudError = ((ManagementException) exception).getValue(); - Assertions.assertNotNull(cloudError); - Assertions.assertNotNull(cloudError.getCode()); - Assertions.assertTrue(cloudError.getCode().contains("PreconditionFailed")); - } - } - // Try update with correct etags - dnsZone - .update() - .updateARecordSet("www") - .withIPv4Address("24.97.105.45") - .withETagCheck(aRecordSet.etag()) - .parent() - .updateAaaaRecordSet("www") - .withETagCheck(aaaaRecordSet.etag()) - .parent() - .apply(); - - // Check A records - aRecordSets = dnsZone.aRecordSets().list(); - Assertions.assertTrue(TestUtilities.getSize(aRecordSets) == 1); - aRecordSet = aRecordSets.iterator().next(); - Assertions.assertNotNull(aRecordSet.etag()); - Assertions.assertTrue(aRecordSet.ipv4Addresses().size() == 3); - - // Check AAAA records - aaaaRecordSets = dnsZone.aaaaRecordSets().list(); - Assertions.assertTrue(TestUtilities.getSize(aaaaRecordSets) == 1); - aaaaRecordSet = aaaaRecordSets.iterator().next(); - Assertions.assertNotNull(aaaaRecordSet.etag()); - } - - @Test - public void canDeleteRecordSetWithExplicitETag() throws Exception { - final Region region = locationOrDefault(Region.US_EAST); - final String topLevelDomain = "www.contoso" + generateRandomResourceName("z", 10) + ".com"; - - DnsZone dnsZone = - zoneManager - .zones() - .define(topLevelDomain) - .withNewResourceGroup(rgName, region) - .defineARecordSet("www") - .withIPv4Address("23.96.104.40") - .withIPv4Address("24.97.105.41") - .withTimeToLive(7200) - .withETagCheck() - .attach() - .defineAaaaRecordSet("www") - .withIPv6Address("2001:0db8:85a3:0000:0000:8a2e:0370:7334") - .withIPv6Address("2002:0db9:85a4:0000:0000:8a2e:0371:7335") - .withETagCheck() - .attach() - .create(); - - // Check A records - PagedIterable aRecordSets = dnsZone.aRecordSets().list(); - Assertions.assertTrue(TestUtilities.getSize(aRecordSets) == 1); - ARecordSet aRecordSet = aRecordSets.iterator().next(); - Assertions.assertNotNull(aRecordSet.etag()); - - // Check AAAA records - PagedIterable aaaaRecordSets = dnsZone.aaaaRecordSets().list(); - Assertions.assertTrue(TestUtilities.getSize(aaaaRecordSets) == 1); - AaaaRecordSet aaaaRecordSet = aaaaRecordSets.iterator().next(); - Assertions.assertNotNull(aaaaRecordSet.etag()); - - // Try delete with invalid etag - // - Exception compositeException = null; - try { - dnsZone - .update() - .withoutARecordSet("www", aRecordSet.etag() + "-foo") - .withoutAaaaRecordSet("www", aaaaRecordSet.etag() + "-foo") - .apply(); - } catch (Exception exception) { - compositeException = exception; - } - Assertions.assertNotNull(compositeException); - Assertions.assertTrue(compositeException.getSuppressed().length > 0); - for (int i = 0; i < compositeException.getSuppressed().length; ++i) { - Throwable exception = compositeException.getSuppressed()[i]; - if (exception instanceof ManagementException) { - ManagementError cloudError = ((ManagementException) exception).getValue(); - Assertions.assertNotNull(cloudError); - Assertions.assertNotNull(cloudError.getCode()); - Assertions.assertTrue(cloudError.getCode().contains("PreconditionFailed")); - } - } - // Try delete with correct etags - dnsZone - .update() - .withoutARecordSet("www", aRecordSet.etag()) - .withoutAaaaRecordSet("www", aaaaRecordSet.etag()) - .apply(); - - // Check A records - aRecordSets = dnsZone.aRecordSets().list(); - Assertions.assertTrue(TestUtilities.getSize(aRecordSets) == 0); - - // Check AAAA records - aaaaRecordSets = dnsZone.aaaaRecordSets().list(); - Assertions.assertTrue(TestUtilities.getSize(aaaaRecordSets) == 0); - } - - /** - * Runs the action and assert that action throws ManagementException with CloudError.Code property set to - * 'PreconditionFailed'. - * - * @param runnable runnable to run - */ - private void ensureETagExceptionIsThrown(final Runnable runnable) { - boolean isManagementExceptionThrown = false; - boolean isCloudErrorSet = false; - boolean isPreconditionFailedCodeSet = false; - try { - runnable.run(); - } catch (ManagementException exception) { - isManagementExceptionThrown = true; - ManagementError cloudError = exception.getValue(); - if (cloudError != null) { - isCloudErrorSet = true; - isPreconditionFailedCodeSet = cloudError.getCode().contains("PreconditionFailed"); - } - } - Assertions.assertTrue(isManagementExceptionThrown, "Expected ManagementException is not thrown"); - Assertions.assertTrue(isCloudErrorSet, "Expected CloudError property is not set in ManagementException"); - Assertions - .assertTrue( - isPreconditionFailedCodeSet, - "Expected PreconditionFailed code is not set indicating ETag concurrency check failure"); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/test/resources/junit-platform.properties b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/test/resources/junit-platform.properties deleted file mode 100644 index 202d099b3ee8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/src/test/resources/junit-platform.properties +++ /dev/null @@ -1,4 +0,0 @@ -junit.jupiter.execution.parallel.enabled=true -junit.jupiter.execution.parallel.mode.default=concurrent -junit.jupiter.execution.parallel.config.strategy=fixed -junit.jupiter.execution.parallel.config.fixed.parallelism=32 diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/CHANGELOG.md b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/CHANGELOG.md deleted file mode 100644 index 3798e4fa52f2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/CHANGELOG.md +++ /dev/null @@ -1,8 +0,0 @@ -# Release History - -## 1.0.0-hybrid (2022-01-12) - -- Azure Resource Manager EventHubs client library for Java (Hybrid) using API Profiles to allow building hybrid cloud solutions -that target both Azure and Azure Stack Hub. -- Supports api versions in the 2020-09-01-hybrid api profile -- Requires Azure Stack Update 2102+ diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/README.md b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/README.md deleted file mode 100644 index 78dc2de2e9cf..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/README.md +++ /dev/null @@ -1,135 +0,0 @@ -# Azure Resource Manager EventHubs client library for Java (Hybrid) - -Azure Resource Manager EventHubs client library for Java (Hybrid) using [API Profiles][api_profile] to allow building hybrid cloud solutions -that target both Azure and Azure Stack Hub. - -For documentation on how to use this package, please see [Azure Management Libraries for Java (Hybrid)][resourcemanagerhybrid_lib]. - -## Getting started - -### Prerequisites - -- [Java Development Kit (JDK)][jdk] with version 8 or above -- [Azure Subscription][azure_subscription] - -### Adding the package to your product - -```xml - - com.azure.resourcemanager - azure-resourcemanager-eventhubs - 1.0.0-hybrid - -``` - -### Include the recommended packages - -Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. - -[Azure Identity][azure_identity] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation. - -### Authentication - -By default, Azure Active Directory token authentication depends on correct configure of following environment variables. - -- `AZURE_CLIENT_ID` for Azure client ID. -- `AZURE_TENANT_ID` for Azure tenant ID. -- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. - -In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`. - -With above configuration, `azure` client can be authenticated by following code: - -```java com.azure.resourcemanager.eventhubs.authenticate -String armEndpoint = "https://management.."; -AzureProfile profile = new AzureProfile(getAzureEnvironmentFromArmEndpoint(armEndpoint)); -TokenCredential credential = new DefaultAzureCredentialBuilder() - .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) - .build(); -EventHubsManager manager = EventHubsManager - .authenticate(credential, profile); -``` - -Change `armEndpoint` to point to the Azure Resource Manager endpoint of your Azure Stack Hub. The azure environment's -properties above can be populated with the following example: - -```java com.azure.resourcemanager.eventhubs.getazureenvironment -private static AzureEnvironment getAzureEnvironmentFromArmEndpoint(String armEndpoint) { - // Create HTTP client and request - HttpClient httpClient = HttpClient.createDefault(); - - HttpRequest request = new HttpRequest(HttpMethod.GET, - String.format("%s/metadata/endpoints?api-version=2019-10-01", armEndpoint)) - .setHeader("accept", "application/json"); - - // Execute the request and read the response - HttpResponse response = httpClient.send(request).block(); - if (response.getStatusCode() != 200) { - throw new RuntimeException("Failed : HTTP error code : " + response.getStatusCode()); - } - String body = response.getBodyAsString().block(); - try { - ArrayNode metadataArray = JacksonAdapter.createDefaultSerializerAdapter() - .deserialize(body, ArrayNode.class, SerializerEncoding.JSON); - - if (metadataArray == null || metadataArray.isEmpty()) { - throw new RuntimeException("Failed to find metadata : " + body); - } - - JsonNode metadata = metadataArray.iterator().next(); - AzureEnvironment azureEnvironment = new AzureEnvironment(new HashMap() { - { - put("managementEndpointUrl", metadata.at("/authentication/audiences/0").asText()); - put("resourceManagerEndpointUrl", armEndpoint); - put("galleryEndpointUrl", metadata.at("/gallery").asText()); - put("activeDirectoryEndpointUrl", metadata.at("/authentication/loginEndpoint").asText()); - put("activeDirectoryResourceId", metadata.at("/authentication/audiences/0").asText()); - put("activeDirectoryGraphResourceId", metadata.at("/graph").asText()); - put("storageEndpointSuffix", "." + metadata.at("/suffixes/storage").asText()); - put("keyVaultDnsSuffix", "." + metadata.at("/suffixes/keyVaultDns").asText()); - } - }); - return azureEnvironment; - } catch (IOException ioe) { - ioe.printStackTrace(); - throw new RuntimeException(ioe); - } -} -``` - -When targeting a hybrid solution to global Azure instead of your Azure Stack Hub, `AzureEnvironment.AZURE` can be used instead. - -See [Authentication][authenticate] for more options. - -## Key concepts - -See [API design][design] for general introduction on design and key concepts on Azure Management Libraries. - -## Examples - -See [Samples][sample] for code snippets and samples. - -## Troubleshooting - -## Next steps - -## Contributing - -For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). - -1. Fork it -1. Create your feature branch (`git checkout -b my-new-feature`) -1. Commit your changes (`git commit -am 'Add some feature'`) -1. Push to the branch (`git push origin my-new-feature`) -1. Create new Pull Request - - -[jdk]: https://learn.microsoft.com/java/azure/jdk/ -[azure_subscription]: https://azure.microsoft.com/free/ -[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity -[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty -[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md -[sample]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/SAMPLE.md -[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md -[api_profile]: https://learn.microsoft.com/azure-stack/user/azure-stack-version-profiles -[resourcemanagerhybrid_lib]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanagerhybrid diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/pom.xml b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/pom.xml deleted file mode 100644 index 6fef386f4b10..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/pom.xml +++ /dev/null @@ -1,136 +0,0 @@ - - - 4.0.0 - - com.azure - azure-client-sdk-parent - 1.7.0 - ../../parents/azure-client-sdk-parent - - - com.azure.resourcemanager - azure-resourcemanager-eventhubs - 1.0.0-hybrid - jar - - Microsoft Azure SDK for EventHubs Management (Hybrid) - This package contains Microsoft Azure EventHubs Management Hybrid SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt - https://github.com/Azure/azure-sdk-for-java - - - - The MIT License (MIT) - http://opensource.org/licenses/MIT - repo - - - - - https://github.com/Azure/azure-sdk-for-java - scm:git:git@github.com:Azure/azure-sdk-for-java.git - HEAD - - - - - 0.10 - 0.10 - - - --add-opens com.azure.resourcemanager.eventhubs/com.azure.resourcemanager.eventhubs=ALL-UNNAMED - --add-opens com.azure.resourcemanager.storage/com.azure.resourcemanager.storage=ALL-UNNAMED - --add-opens com.azure.core/com.azure.core.implementation.jackson=ALL-UNNAMED - - - - - - microsoft - Microsoft - - - - - - com.azure.resourcemanager - azure-resourcemanager-resources - 1.0.0-hybrid - - - com.azure.resourcemanager - azure-resourcemanager-storage - 1.0.0-hybrid - - - org.junit.jupiter - junit-jupiter-engine - 5.13.4 - test - - - org.junit.jupiter - junit-jupiter-api - 5.13.4 - test - - - com.azure - azure-core-http-netty - 1.16.2 - test - - - - - azure-mgmt-sdk-test-jar - - - !maven.test.skip - - - - - com.azure.resourcemanager - azure-resourcemanager-test - 1.0.0-hybrid - test - - - - - - - - org.apache.maven.plugins - maven-jar-plugin - 3.4.2 - - - - true - true - - - - - - - org.jacoco - jacoco-maven-plugin - 0.8.13 - - - com/azure/resourcemanager/**/fluent/**/* - com/azure/resourcemanager/**/models/**/* - com/azure/resourcemanager/**/implementation/*ClientImpl* - com/azure/resourcemanager/**/implementation/*ClientBuilder* - - - - - - diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/EventHubsManager.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/EventHubsManager.java deleted file mode 100644 index f22a727dcfc5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/EventHubsManager.java +++ /dev/null @@ -1,184 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.eventhubs; - -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpPipeline; -import com.azure.resourcemanager.eventhubs.fluent.EventHubManagementClient; -import com.azure.resourcemanager.eventhubs.implementation.EventHubManagementClientBuilder; -import com.azure.resourcemanager.eventhubs.implementation.DisasterRecoveryPairingAuthorizationRulesImpl; -import com.azure.resourcemanager.eventhubs.implementation.EventHubAuthorizationRulesImpl; -import com.azure.resourcemanager.eventhubs.implementation.EventHubConsumerGroupsImpl; -import com.azure.resourcemanager.eventhubs.implementation.EventHubDisasterRecoveryPairingsImpl; -import com.azure.resourcemanager.eventhubs.implementation.EventHubNamespaceAuthorizationRulesImpl; -import com.azure.resourcemanager.eventhubs.implementation.EventHubNamespacesImpl; -import com.azure.resourcemanager.eventhubs.implementation.EventHubsImpl; -import com.azure.resourcemanager.eventhubs.models.DisasterRecoveryPairingAuthorizationRules; -import com.azure.resourcemanager.eventhubs.models.EventHubAuthorizationRules; -import com.azure.resourcemanager.eventhubs.models.EventHubConsumerGroups; -import com.azure.resourcemanager.eventhubs.models.EventHubDisasterRecoveryPairings; -import com.azure.resourcemanager.eventhubs.models.EventHubNamespaceAuthorizationRules; -import com.azure.resourcemanager.eventhubs.models.EventHubNamespaces; -import com.azure.resourcemanager.eventhubs.models.EventHubs; -import com.azure.resourcemanager.resources.fluentcore.arm.AzureConfigurable; -import com.azure.resourcemanager.resources.fluentcore.arm.implementation.AzureConfigurableImpl; -import com.azure.resourcemanager.resources.fluentcore.arm.Manager; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.resources.fluentcore.utils.HttpPipelineProvider; -import com.azure.resourcemanager.storage.StorageManager; - -import java.util.Objects; - -/** - * Entry point to Azure EventHub resource management. - */ -public final class EventHubsManager extends Manager { - private EventHubNamespaces namespaces; - private EventHubs eventHubs; - private EventHubConsumerGroups consumerGroups; - private EventHubAuthorizationRules eventHubAuthorizationRules; - private EventHubNamespaceAuthorizationRules namespaceAuthorizationRules; - private EventHubDisasterRecoveryPairings eventHubDisasterRecoveryPairings; - private DisasterRecoveryPairingAuthorizationRules disasterRecoveryPairingAuthorizationRules; - - private final StorageManager storageManager; - - /** - * Get a Configurable instance that can be used to create EventHubsManager with optional configuration. - * - * @return the instance allowing configurations - */ - public static Configurable configure() { - return new EventHubsManager.ConfigurableImpl(); - } - - /** - * Creates an instance of EventHubsManager that exposes EventHub resource management API entry points. - * - * @param credential the credential to use - * @param profile the profile to use - * @return the EventHubsManager - */ - public static EventHubsManager authenticate(TokenCredential credential, AzureProfile profile) { - Objects.requireNonNull(credential, "'credential' cannot be null."); - Objects.requireNonNull(profile, "'profile' cannot be null."); - return authenticate(HttpPipelineProvider.buildHttpPipeline(credential, profile), profile); - } - - /** - * Creates an instance of EventHubsManager that exposes EventHub resource management API entry points. - * - * @param httpPipeline the HttpPipeline to be used for API calls. - * @param profile the profile to use - * @return the EventHubsManager - */ - public static EventHubsManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { - Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); - Objects.requireNonNull(profile, "'profile' cannot be null."); - return new EventHubsManager(httpPipeline, profile); - } - - /** - * The interface allowing configurations to be set. - */ - public interface Configurable extends AzureConfigurable { - /** - * Creates an instance of EventHubsManager that exposes EventHub management API entry points. - * - * @param credential the credential to use - * @param profile the profile to use - * @return the interface exposing EventHub management API entry points that work across subscriptions - */ - EventHubsManager authenticate(TokenCredential credential, AzureProfile profile); - } - /** - * The implementation for Configurable interface. - */ - private static final class ConfigurableImpl extends AzureConfigurableImpl implements Configurable { - public EventHubsManager authenticate(TokenCredential credential, AzureProfile profile) { - return EventHubsManager.authenticate(buildHttpPipeline(credential, profile), profile); - } - } - private EventHubsManager(HttpPipeline httpPipeline, AzureProfile profile) { - super( - httpPipeline, - profile, - new EventHubManagementClientBuilder() - .pipeline(httpPipeline) - .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) - .subscriptionId(profile.getSubscriptionId()) - .buildClient()); - storageManager = StorageManager.authenticate(httpPipeline, profile); - } - - /** - * @return entry point to manage EventHub namespaces - */ - public EventHubNamespaces namespaces() { - if (this.namespaces == null) { - this.namespaces = new EventHubNamespacesImpl(this); - } - return this.namespaces; - } - - /** - * @return entry point to manage event hubs - */ - public EventHubs eventHubs() { - if (this.eventHubs == null) { - this.eventHubs = new EventHubsImpl(this, this.storageManager); - } - return this.eventHubs; - } - - /** - * @return entry point to manage event hub consumer groups - */ - public EventHubConsumerGroups consumerGroups() { - if (this.consumerGroups == null) { - this.consumerGroups = new EventHubConsumerGroupsImpl(this); - } - return this.consumerGroups; - } - - /** - * @return entry point to manage disaster recovery pairing of event hub namespaces. - */ - public EventHubDisasterRecoveryPairings eventHubDisasterRecoveryPairings() { - if (this.eventHubDisasterRecoveryPairings == null) { - this.eventHubDisasterRecoveryPairings = new EventHubDisasterRecoveryPairingsImpl(this); - } - return this.eventHubDisasterRecoveryPairings; - } - - /** - * @return entry point to manage event hub authorization rules. - */ - public EventHubAuthorizationRules eventHubAuthorizationRules() { - if (this.eventHubAuthorizationRules == null) { - this.eventHubAuthorizationRules = new EventHubAuthorizationRulesImpl(this); - } - return this.eventHubAuthorizationRules; - } - - /** - * @return entry point to manage event hub namespace authorization rules. - */ - public EventHubNamespaceAuthorizationRules namespaceAuthorizationRules() { - if (this.namespaceAuthorizationRules == null) { - this.namespaceAuthorizationRules = new EventHubNamespaceAuthorizationRulesImpl(this); - } - return this.namespaceAuthorizationRules; - } - - /** - * @return entry point to manage disaster recovery pairing authorization rules. - */ - public DisasterRecoveryPairingAuthorizationRules disasterRecoveryPairingAuthorizationRules() { - if (this.disasterRecoveryPairingAuthorizationRules == null) { - this.disasterRecoveryPairingAuthorizationRules = new DisasterRecoveryPairingAuthorizationRulesImpl(this); - } - return this.disasterRecoveryPairingAuthorizationRules; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/ClustersClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/ClustersClient.java deleted file mode 100644 index c36400ad1582..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/ClustersClient.java +++ /dev/null @@ -1,513 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.eventhubs.fluent.models.AvailableClustersListInner; -import com.azure.resourcemanager.eventhubs.fluent.models.ClusterInner; -import com.azure.resourcemanager.eventhubs.fluent.models.EHNamespaceIdListResultInner; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ClustersClient. */ -public interface ClustersClient extends InnerSupportsGet, InnerSupportsDelete { - /** - * List the quantity of available pre-provisioned Event Hubs Clusters, indexed by Azure region. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of the List Available Clusters operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listAvailableClusterRegionWithResponseAsync(); - - /** - * List the quantity of available pre-provisioned Event Hubs Clusters, indexed by Azure region. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of the List Available Clusters operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listAvailableClusterRegionAsync(); - - /** - * List the quantity of available pre-provisioned Event Hubs Clusters, indexed by Azure region. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of the List Available Clusters operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AvailableClustersListInner listAvailableClusterRegion(); - - /** - * List the quantity of available pre-provisioned Event Hubs Clusters, indexed by Azure region. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of the List Available Clusters operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listAvailableClusterRegionWithResponse(Context context); - - /** - * Lists the available Event Hubs Clusters within an ARM resource group. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of the List Event Hubs Clusters operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName); - - /** - * Lists the available Event Hubs Clusters within an ARM resource group. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of the List Event Hubs Clusters operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Lists the available Event Hubs Clusters within an ARM resource group. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of the List Event Hubs Clusters operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * Gets the resource description of the specified Event Hubs Cluster. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param clusterName The name of the Event Hubs Cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the resource description of the specified Event Hubs Cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String clusterName); - - /** - * Gets the resource description of the specified Event Hubs Cluster. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param clusterName The name of the Event Hubs Cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the resource description of the specified Event Hubs Cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync(String resourceGroupName, String clusterName); - - /** - * Gets the resource description of the specified Event Hubs Cluster. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param clusterName The name of the Event Hubs Cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the resource description of the specified Event Hubs Cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ClusterInner getByResourceGroup(String resourceGroupName, String clusterName); - - /** - * Gets the resource description of the specified Event Hubs Cluster. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param clusterName The name of the Event Hubs Cluster. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the resource description of the specified Event Hubs Cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String clusterName, Context context); - - /** - * Creates or updates an instance of an Event Hubs Cluster. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param clusterName The name of the Event Hubs Cluster. - * @param parameters Parameters for creating a eventhub cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single Event Hubs Cluster resource in List or Get operations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String clusterName, ClusterInner parameters); - - /** - * Creates or updates an instance of an Event Hubs Cluster. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param clusterName The name of the Event Hubs Cluster. - * @param parameters Parameters for creating a eventhub cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single Event Hubs Cluster resource in List or Get operations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, ClusterInner> beginCreateOrUpdateAsync( - String resourceGroupName, String clusterName, ClusterInner parameters); - - /** - * Creates or updates an instance of an Event Hubs Cluster. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param clusterName The name of the Event Hubs Cluster. - * @param parameters Parameters for creating a eventhub cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single Event Hubs Cluster resource in List or Get operations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ClusterInner> beginCreateOrUpdate( - String resourceGroupName, String clusterName, ClusterInner parameters); - - /** - * Creates or updates an instance of an Event Hubs Cluster. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param clusterName The name of the Event Hubs Cluster. - * @param parameters Parameters for creating a eventhub cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single Event Hubs Cluster resource in List or Get operations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ClusterInner> beginCreateOrUpdate( - String resourceGroupName, String clusterName, ClusterInner parameters, Context context); - - /** - * Creates or updates an instance of an Event Hubs Cluster. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param clusterName The name of the Event Hubs Cluster. - * @param parameters Parameters for creating a eventhub cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single Event Hubs Cluster resource in List or Get operations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync(String resourceGroupName, String clusterName, ClusterInner parameters); - - /** - * Creates or updates an instance of an Event Hubs Cluster. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param clusterName The name of the Event Hubs Cluster. - * @param parameters Parameters for creating a eventhub cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single Event Hubs Cluster resource in List or Get operations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ClusterInner createOrUpdate(String resourceGroupName, String clusterName, ClusterInner parameters); - - /** - * Creates or updates an instance of an Event Hubs Cluster. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param clusterName The name of the Event Hubs Cluster. - * @param parameters Parameters for creating a eventhub cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single Event Hubs Cluster resource in List or Get operations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ClusterInner createOrUpdate(String resourceGroupName, String clusterName, ClusterInner parameters, Context context); - - /** - * Modifies mutable properties on the Event Hubs Cluster. This operation is idempotent. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param clusterName The name of the Event Hubs Cluster. - * @param parameters The properties of the Event Hubs Cluster which should be updated. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single Event Hubs Cluster resource in List or Get operations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> updateWithResponseAsync( - String resourceGroupName, String clusterName, ClusterInner parameters); - - /** - * Modifies mutable properties on the Event Hubs Cluster. This operation is idempotent. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param clusterName The name of the Event Hubs Cluster. - * @param parameters The properties of the Event Hubs Cluster which should be updated. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single Event Hubs Cluster resource in List or Get operations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, ClusterInner> beginUpdateAsync( - String resourceGroupName, String clusterName, ClusterInner parameters); - - /** - * Modifies mutable properties on the Event Hubs Cluster. This operation is idempotent. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param clusterName The name of the Event Hubs Cluster. - * @param parameters The properties of the Event Hubs Cluster which should be updated. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single Event Hubs Cluster resource in List or Get operations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ClusterInner> beginUpdate( - String resourceGroupName, String clusterName, ClusterInner parameters); - - /** - * Modifies mutable properties on the Event Hubs Cluster. This operation is idempotent. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param clusterName The name of the Event Hubs Cluster. - * @param parameters The properties of the Event Hubs Cluster which should be updated. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single Event Hubs Cluster resource in List or Get operations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ClusterInner> beginUpdate( - String resourceGroupName, String clusterName, ClusterInner parameters, Context context); - - /** - * Modifies mutable properties on the Event Hubs Cluster. This operation is idempotent. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param clusterName The name of the Event Hubs Cluster. - * @param parameters The properties of the Event Hubs Cluster which should be updated. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single Event Hubs Cluster resource in List or Get operations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAsync(String resourceGroupName, String clusterName, ClusterInner parameters); - - /** - * Modifies mutable properties on the Event Hubs Cluster. This operation is idempotent. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param clusterName The name of the Event Hubs Cluster. - * @param parameters The properties of the Event Hubs Cluster which should be updated. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single Event Hubs Cluster resource in List or Get operations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ClusterInner update(String resourceGroupName, String clusterName, ClusterInner parameters); - - /** - * Modifies mutable properties on the Event Hubs Cluster. This operation is idempotent. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param clusterName The name of the Event Hubs Cluster. - * @param parameters The properties of the Event Hubs Cluster which should be updated. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single Event Hubs Cluster resource in List or Get operations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ClusterInner update(String resourceGroupName, String clusterName, ClusterInner parameters, Context context); - - /** - * Deletes an existing Event Hubs Cluster. This operation is idempotent. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param clusterName The name of the Event Hubs Cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync(String resourceGroupName, String clusterName); - - /** - * Deletes an existing Event Hubs Cluster. This operation is idempotent. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param clusterName The name of the Event Hubs Cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterName); - - /** - * Deletes an existing Event Hubs Cluster. This operation is idempotent. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param clusterName The name of the Event Hubs Cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName); - - /** - * Deletes an existing Event Hubs Cluster. This operation is idempotent. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param clusterName The name of the Event Hubs Cluster. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, Context context); - - /** - * Deletes an existing Event Hubs Cluster. This operation is idempotent. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param clusterName The name of the Event Hubs Cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String clusterName); - - /** - * Deletes an existing Event Hubs Cluster. This operation is idempotent. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param clusterName The name of the Event Hubs Cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String clusterName); - - /** - * Deletes an existing Event Hubs Cluster. This operation is idempotent. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param clusterName The name of the Event Hubs Cluster. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String clusterName, Context context); - - /** - * List all Event Hubs Namespace IDs in an Event Hubs Dedicated Cluster. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param clusterName The name of the Event Hubs Cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of the List Namespace IDs operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listNamespacesWithResponseAsync( - String resourceGroupName, String clusterName); - - /** - * List all Event Hubs Namespace IDs in an Event Hubs Dedicated Cluster. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param clusterName The name of the Event Hubs Cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of the List Namespace IDs operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listNamespacesAsync(String resourceGroupName, String clusterName); - - /** - * List all Event Hubs Namespace IDs in an Event Hubs Dedicated Cluster. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param clusterName The name of the Event Hubs Cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of the List Namespace IDs operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - EHNamespaceIdListResultInner listNamespaces(String resourceGroupName, String clusterName); - - /** - * List all Event Hubs Namespace IDs in an Event Hubs Dedicated Cluster. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param clusterName The name of the Event Hubs Cluster. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of the List Namespace IDs operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listNamespacesWithResponse( - String resourceGroupName, String clusterName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/ConsumerGroupsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/ConsumerGroupsClient.java deleted file mode 100644 index 8a1797d80a55..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/ConsumerGroupsClient.java +++ /dev/null @@ -1,309 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.eventhubs.fluent.models.ConsumerGroupInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ConsumerGroupsClient. */ -public interface ConsumerGroupsClient { - /** - * Creates or updates an Event Hubs consumer group as a nested resource within a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param consumerGroupName The consumer group name. - * @param parameters Parameters supplied to create or update a consumer group resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single item in List or Get Consumer group operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, - String namespaceName, - String eventHubName, - String consumerGroupName, - ConsumerGroupInner parameters); - - /** - * Creates or updates an Event Hubs consumer group as a nested resource within a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param consumerGroupName The consumer group name. - * @param parameters Parameters supplied to create or update a consumer group resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single item in List or Get Consumer group operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, - String namespaceName, - String eventHubName, - String consumerGroupName, - ConsumerGroupInner parameters); - - /** - * Creates or updates an Event Hubs consumer group as a nested resource within a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param consumerGroupName The consumer group name. - * @param parameters Parameters supplied to create or update a consumer group resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single item in List or Get Consumer group operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ConsumerGroupInner createOrUpdate( - String resourceGroupName, - String namespaceName, - String eventHubName, - String consumerGroupName, - ConsumerGroupInner parameters); - - /** - * Creates or updates an Event Hubs consumer group as a nested resource within a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param consumerGroupName The consumer group name. - * @param parameters Parameters supplied to create or update a consumer group resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single item in List or Get Consumer group operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, - String namespaceName, - String eventHubName, - String consumerGroupName, - ConsumerGroupInner parameters, - Context context); - - /** - * Deletes a consumer group from the specified Event Hub and resource group. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param consumerGroupName The consumer group name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteWithResponseAsync( - String resourceGroupName, String namespaceName, String eventHubName, String consumerGroupName); - - /** - * Deletes a consumer group from the specified Event Hub and resource group. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param consumerGroupName The consumer group name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync( - String resourceGroupName, String namespaceName, String eventHubName, String consumerGroupName); - - /** - * Deletes a consumer group from the specified Event Hub and resource group. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param consumerGroupName The consumer group name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String namespaceName, String eventHubName, String consumerGroupName); - - /** - * Deletes a consumer group from the specified Event Hub and resource group. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param consumerGroupName The consumer group name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse( - String resourceGroupName, String namespaceName, String eventHubName, String consumerGroupName, Context context); - - /** - * Gets a description for the specified consumer group. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param consumerGroupName The consumer group name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a description for the specified consumer group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync( - String resourceGroupName, String namespaceName, String eventHubName, String consumerGroupName); - - /** - * Gets a description for the specified consumer group. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param consumerGroupName The consumer group name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a description for the specified consumer group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync( - String resourceGroupName, String namespaceName, String eventHubName, String consumerGroupName); - - /** - * Gets a description for the specified consumer group. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param consumerGroupName The consumer group name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a description for the specified consumer group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ConsumerGroupInner get( - String resourceGroupName, String namespaceName, String eventHubName, String consumerGroupName); - - /** - * Gets a description for the specified consumer group. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param consumerGroupName The consumer group name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a description for the specified consumer group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String namespaceName, String eventHubName, String consumerGroupName, Context context); - - /** - * Gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group exists in the - * Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains - * a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting - * point to use for subsequent calls. - * @param top May be used to limit the number of results to the most recent N usageDetails. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the consumer groups in a Namespace. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByEventHubAsync( - String resourceGroupName, String namespaceName, String eventHubName, Integer skip, Integer top); - - /** - * Gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group exists in the - * Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the consumer groups in a Namespace. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByEventHubAsync( - String resourceGroupName, String namespaceName, String eventHubName); - - /** - * Gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group exists in the - * Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the consumer groups in a Namespace. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByEventHub( - String resourceGroupName, String namespaceName, String eventHubName); - - /** - * Gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group exists in the - * Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains - * a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting - * point to use for subsequent calls. - * @param top May be used to limit the number of results to the most recent N usageDetails. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the consumer groups in a Namespace. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByEventHub( - String resourceGroupName, - String namespaceName, - String eventHubName, - Integer skip, - Integer top, - Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/DisasterRecoveryConfigsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/DisasterRecoveryConfigsClient.java deleted file mode 100644 index ac0419c35346..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/DisasterRecoveryConfigsClient.java +++ /dev/null @@ -1,595 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.eventhubs.fluent.models.AccessKeysInner; -import com.azure.resourcemanager.eventhubs.fluent.models.ArmDisasterRecoveryInner; -import com.azure.resourcemanager.eventhubs.fluent.models.AuthorizationRuleInner; -import com.azure.resourcemanager.eventhubs.fluent.models.CheckNameAvailabilityResultInner; -import com.azure.resourcemanager.eventhubs.models.CheckNameAvailabilityParameter; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in DisasterRecoveryConfigsClient. */ -public interface DisasterRecoveryConfigsClient { - /** - * Gets a list of authorization rules for a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param alias The Disaster Recovery configuration name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of authorization rules for a Namespace. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAuthorizationRulesAsync( - String resourceGroupName, String namespaceName, String alias); - - /** - * Gets a list of authorization rules for a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param alias The Disaster Recovery configuration name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of authorization rules for a Namespace. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listAuthorizationRules( - String resourceGroupName, String namespaceName, String alias); - - /** - * Gets a list of authorization rules for a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param alias The Disaster Recovery configuration name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of authorization rules for a Namespace. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listAuthorizationRules( - String resourceGroupName, String namespaceName, String alias, Context context); - - /** - * Gets an AuthorizationRule for a Namespace by rule name. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param alias The Disaster Recovery configuration name. - * @param authorizationRuleName The authorization rule name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an AuthorizationRule for a Namespace by rule name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getAuthorizationRuleWithResponseAsync( - String resourceGroupName, String namespaceName, String alias, String authorizationRuleName); - - /** - * Gets an AuthorizationRule for a Namespace by rule name. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param alias The Disaster Recovery configuration name. - * @param authorizationRuleName The authorization rule name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an AuthorizationRule for a Namespace by rule name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAuthorizationRuleAsync( - String resourceGroupName, String namespaceName, String alias, String authorizationRuleName); - - /** - * Gets an AuthorizationRule for a Namespace by rule name. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param alias The Disaster Recovery configuration name. - * @param authorizationRuleName The authorization rule name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an AuthorizationRule for a Namespace by rule name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AuthorizationRuleInner getAuthorizationRule( - String resourceGroupName, String namespaceName, String alias, String authorizationRuleName); - - /** - * Gets an AuthorizationRule for a Namespace by rule name. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param alias The Disaster Recovery configuration name. - * @param authorizationRuleName The authorization rule name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an AuthorizationRule for a Namespace by rule name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getAuthorizationRuleWithResponse( - String resourceGroupName, String namespaceName, String alias, String authorizationRuleName, Context context); - - /** - * Gets the primary and secondary connection strings for the Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param alias The Disaster Recovery configuration name. - * @param authorizationRuleName The authorization rule name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the primary and secondary connection strings for the Namespace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listKeysWithResponseAsync( - String resourceGroupName, String namespaceName, String alias, String authorizationRuleName); - - /** - * Gets the primary and secondary connection strings for the Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param alias The Disaster Recovery configuration name. - * @param authorizationRuleName The authorization rule name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the primary and secondary connection strings for the Namespace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listKeysAsync( - String resourceGroupName, String namespaceName, String alias, String authorizationRuleName); - - /** - * Gets the primary and secondary connection strings for the Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param alias The Disaster Recovery configuration name. - * @param authorizationRuleName The authorization rule name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the primary and secondary connection strings for the Namespace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AccessKeysInner listKeys( - String resourceGroupName, String namespaceName, String alias, String authorizationRuleName); - - /** - * Gets the primary and secondary connection strings for the Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param alias The Disaster Recovery configuration name. - * @param authorizationRuleName The authorization rule name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the primary and secondary connection strings for the Namespace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listKeysWithResponse( - String resourceGroupName, String namespaceName, String alias, String authorizationRuleName, Context context); - - /** - * Check the give Namespace name availability. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param parameters Parameters to check availability of the given Alias name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Result of the CheckNameAvailability operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> checkNameAvailabilityWithResponseAsync( - String resourceGroupName, String namespaceName, CheckNameAvailabilityParameter parameters); - - /** - * Check the give Namespace name availability. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param parameters Parameters to check availability of the given Alias name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Result of the CheckNameAvailability operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono checkNameAvailabilityAsync( - String resourceGroupName, String namespaceName, CheckNameAvailabilityParameter parameters); - - /** - * Check the give Namespace name availability. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param parameters Parameters to check availability of the given Alias name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Result of the CheckNameAvailability operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - CheckNameAvailabilityResultInner checkNameAvailability( - String resourceGroupName, String namespaceName, CheckNameAvailabilityParameter parameters); - - /** - * Check the give Namespace name availability. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param parameters Parameters to check availability of the given Alias name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Result of the CheckNameAvailability operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response checkNameAvailabilityWithResponse( - String resourceGroupName, String namespaceName, CheckNameAvailabilityParameter parameters, Context context); - - /** - * Gets all Alias(Disaster Recovery configurations). - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all Alias(Disaster Recovery configurations). - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String resourceGroupName, String namespaceName); - - /** - * Gets all Alias(Disaster Recovery configurations). - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all Alias(Disaster Recovery configurations). - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String namespaceName); - - /** - * Gets all Alias(Disaster Recovery configurations). - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all Alias(Disaster Recovery configurations). - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String namespaceName, Context context); - - /** - * Creates or updates a new Alias(Disaster Recovery configuration). - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param alias The Disaster Recovery configuration name. - * @param parameters Parameters required to create an Alias(Disaster Recovery configuration). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single item in List or Get Alias(Disaster Recovery configuration) operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String namespaceName, String alias, ArmDisasterRecoveryInner parameters); - - /** - * Creates or updates a new Alias(Disaster Recovery configuration). - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param alias The Disaster Recovery configuration name. - * @param parameters Parameters required to create an Alias(Disaster Recovery configuration). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single item in List or Get Alias(Disaster Recovery configuration) operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, String namespaceName, String alias, ArmDisasterRecoveryInner parameters); - - /** - * Creates or updates a new Alias(Disaster Recovery configuration). - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param alias The Disaster Recovery configuration name. - * @param parameters Parameters required to create an Alias(Disaster Recovery configuration). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single item in List or Get Alias(Disaster Recovery configuration) operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ArmDisasterRecoveryInner createOrUpdate( - String resourceGroupName, String namespaceName, String alias, ArmDisasterRecoveryInner parameters); - - /** - * Creates or updates a new Alias(Disaster Recovery configuration). - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param alias The Disaster Recovery configuration name. - * @param parameters Parameters required to create an Alias(Disaster Recovery configuration). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single item in List or Get Alias(Disaster Recovery configuration) operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, - String namespaceName, - String alias, - ArmDisasterRecoveryInner parameters, - Context context); - - /** - * Deletes an Alias(Disaster Recovery configuration). - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param alias The Disaster Recovery configuration name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteWithResponseAsync(String resourceGroupName, String namespaceName, String alias); - - /** - * Deletes an Alias(Disaster Recovery configuration). - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param alias The Disaster Recovery configuration name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String namespaceName, String alias); - - /** - * Deletes an Alias(Disaster Recovery configuration). - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param alias The Disaster Recovery configuration name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String namespaceName, String alias); - - /** - * Deletes an Alias(Disaster Recovery configuration). - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param alias The Disaster Recovery configuration name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String namespaceName, String alias, Context context); - - /** - * Retrieves Alias(Disaster Recovery configuration) for primary or secondary namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param alias The Disaster Recovery configuration name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single item in List or Get Alias(Disaster Recovery configuration) operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync( - String resourceGroupName, String namespaceName, String alias); - - /** - * Retrieves Alias(Disaster Recovery configuration) for primary or secondary namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param alias The Disaster Recovery configuration name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single item in List or Get Alias(Disaster Recovery configuration) operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync(String resourceGroupName, String namespaceName, String alias); - - /** - * Retrieves Alias(Disaster Recovery configuration) for primary or secondary namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param alias The Disaster Recovery configuration name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single item in List or Get Alias(Disaster Recovery configuration) operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ArmDisasterRecoveryInner get(String resourceGroupName, String namespaceName, String alias); - - /** - * Retrieves Alias(Disaster Recovery configuration) for primary or secondary namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param alias The Disaster Recovery configuration name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single item in List or Get Alias(Disaster Recovery configuration) operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String namespaceName, String alias, Context context); - - /** - * This operation disables the Disaster Recovery and stops replicating changes from primary to secondary namespaces. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param alias The Disaster Recovery configuration name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> breakPairingWithResponseAsync(String resourceGroupName, String namespaceName, String alias); - - /** - * This operation disables the Disaster Recovery and stops replicating changes from primary to secondary namespaces. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param alias The Disaster Recovery configuration name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono breakPairingAsync(String resourceGroupName, String namespaceName, String alias); - - /** - * This operation disables the Disaster Recovery and stops replicating changes from primary to secondary namespaces. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param alias The Disaster Recovery configuration name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void breakPairing(String resourceGroupName, String namespaceName, String alias); - - /** - * This operation disables the Disaster Recovery and stops replicating changes from primary to secondary namespaces. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param alias The Disaster Recovery configuration name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response breakPairingWithResponse( - String resourceGroupName, String namespaceName, String alias, Context context); - - /** - * Invokes GEO DR failover and reconfigure the alias to point to the secondary namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param alias The Disaster Recovery configuration name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> failOverWithResponseAsync(String resourceGroupName, String namespaceName, String alias); - - /** - * Invokes GEO DR failover and reconfigure the alias to point to the secondary namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param alias The Disaster Recovery configuration name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono failOverAsync(String resourceGroupName, String namespaceName, String alias); - - /** - * Invokes GEO DR failover and reconfigure the alias to point to the secondary namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param alias The Disaster Recovery configuration name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void failOver(String resourceGroupName, String namespaceName, String alias); - - /** - * Invokes GEO DR failover and reconfigure the alias to point to the secondary namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param alias The Disaster Recovery configuration name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response failOverWithResponse(String resourceGroupName, String namespaceName, String alias, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/EventHubManagementClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/EventHubManagementClient.java deleted file mode 100644 index a502a151cd1f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/EventHubManagementClient.java +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.fluent; - -import com.azure.core.http.HttpPipeline; -import java.time.Duration; - -/** The interface for EventHubManagementClient class. */ -public interface EventHubManagementClient { - /** - * Gets Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms - * part of the URI for every service call. - * - * @return the subscriptionId value. - */ - String getSubscriptionId(); - - /** - * Gets server parameter. - * - * @return the endpoint value. - */ - String getEndpoint(); - - /** - * Gets The HTTP pipeline to send requests through. - * - * @return the httpPipeline value. - */ - HttpPipeline getHttpPipeline(); - - /** - * Gets The default poll interval for long-running operation. - * - * @return the defaultPollInterval value. - */ - Duration getDefaultPollInterval(); - - /** - * Gets the ClustersClient object to access its operations. - * - * @return the ClustersClient object. - */ - ClustersClient getClusters(); - - /** - * Gets the NamespacesClient object to access its operations. - * - * @return the NamespacesClient object. - */ - NamespacesClient getNamespaces(); - - /** - * Gets the PrivateEndpointConnectionsClient object to access its operations. - * - * @return the PrivateEndpointConnectionsClient object. - */ - PrivateEndpointConnectionsClient getPrivateEndpointConnections(); - - /** - * Gets the PrivateLinkResourcesClient object to access its operations. - * - * @return the PrivateLinkResourcesClient object. - */ - PrivateLinkResourcesClient getPrivateLinkResources(); - - /** - * Gets the DisasterRecoveryConfigsClient object to access its operations. - * - * @return the DisasterRecoveryConfigsClient object. - */ - DisasterRecoveryConfigsClient getDisasterRecoveryConfigs(); - - /** - * Gets the EventHubsClient object to access its operations. - * - * @return the EventHubsClient object. - */ - EventHubsClient getEventHubs(); - - /** - * Gets the ConsumerGroupsClient object to access its operations. - * - * @return the ConsumerGroupsClient object. - */ - ConsumerGroupsClient getConsumerGroups(); - - /** - * Gets the OperationsClient object to access its operations. - * - * @return the OperationsClient object. - */ - OperationsClient getOperations(); - - /** - * Gets the RegionsClient object to access its operations. - * - * @return the RegionsClient object. - */ - RegionsClient getRegions(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/EventHubsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/EventHubsClient.java deleted file mode 100644 index 0c48aaef7903..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/EventHubsClient.java +++ /dev/null @@ -1,692 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.eventhubs.fluent.models.AccessKeysInner; -import com.azure.resourcemanager.eventhubs.fluent.models.AuthorizationRuleInner; -import com.azure.resourcemanager.eventhubs.fluent.models.EventhubInner; -import com.azure.resourcemanager.eventhubs.models.RegenerateAccessKeyParameters; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in EventHubsClient. */ -public interface EventHubsClient { - /** - * Gets the authorization rules for an Event Hub. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the authorization rules for an Event Hub. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAuthorizationRulesAsync( - String resourceGroupName, String namespaceName, String eventHubName); - - /** - * Gets the authorization rules for an Event Hub. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the authorization rules for an Event Hub. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listAuthorizationRules( - String resourceGroupName, String namespaceName, String eventHubName); - - /** - * Gets the authorization rules for an Event Hub. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the authorization rules for an Event Hub. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listAuthorizationRules( - String resourceGroupName, String namespaceName, String eventHubName, Context context); - - /** - * Creates or updates an AuthorizationRule for the specified Event Hub. Creation/update of the AuthorizationRule - * will take a few seconds to take effect. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param authorizationRuleName The authorization rule name. - * @param parameters The shared access AuthorizationRule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single item in a List or Get AuthorizationRule operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createOrUpdateAuthorizationRuleWithResponseAsync( - String resourceGroupName, - String namespaceName, - String eventHubName, - String authorizationRuleName, - AuthorizationRuleInner parameters); - - /** - * Creates or updates an AuthorizationRule for the specified Event Hub. Creation/update of the AuthorizationRule - * will take a few seconds to take effect. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param authorizationRuleName The authorization rule name. - * @param parameters The shared access AuthorizationRule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single item in a List or Get AuthorizationRule operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAuthorizationRuleAsync( - String resourceGroupName, - String namespaceName, - String eventHubName, - String authorizationRuleName, - AuthorizationRuleInner parameters); - - /** - * Creates or updates an AuthorizationRule for the specified Event Hub. Creation/update of the AuthorizationRule - * will take a few seconds to take effect. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param authorizationRuleName The authorization rule name. - * @param parameters The shared access AuthorizationRule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single item in a List or Get AuthorizationRule operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AuthorizationRuleInner createOrUpdateAuthorizationRule( - String resourceGroupName, - String namespaceName, - String eventHubName, - String authorizationRuleName, - AuthorizationRuleInner parameters); - - /** - * Creates or updates an AuthorizationRule for the specified Event Hub. Creation/update of the AuthorizationRule - * will take a few seconds to take effect. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param authorizationRuleName The authorization rule name. - * @param parameters The shared access AuthorizationRule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single item in a List or Get AuthorizationRule operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateAuthorizationRuleWithResponse( - String resourceGroupName, - String namespaceName, - String eventHubName, - String authorizationRuleName, - AuthorizationRuleInner parameters, - Context context); - - /** - * Gets an AuthorizationRule for an Event Hub by rule name. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param authorizationRuleName The authorization rule name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an AuthorizationRule for an Event Hub by rule name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getAuthorizationRuleWithResponseAsync( - String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName); - - /** - * Gets an AuthorizationRule for an Event Hub by rule name. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param authorizationRuleName The authorization rule name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an AuthorizationRule for an Event Hub by rule name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAuthorizationRuleAsync( - String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName); - - /** - * Gets an AuthorizationRule for an Event Hub by rule name. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param authorizationRuleName The authorization rule name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an AuthorizationRule for an Event Hub by rule name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AuthorizationRuleInner getAuthorizationRule( - String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName); - - /** - * Gets an AuthorizationRule for an Event Hub by rule name. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param authorizationRuleName The authorization rule name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an AuthorizationRule for an Event Hub by rule name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getAuthorizationRuleWithResponse( - String resourceGroupName, - String namespaceName, - String eventHubName, - String authorizationRuleName, - Context context); - - /** - * Deletes an Event Hub AuthorizationRule. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param authorizationRuleName The authorization rule name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteAuthorizationRuleWithResponseAsync( - String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName); - - /** - * Deletes an Event Hub AuthorizationRule. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param authorizationRuleName The authorization rule name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAuthorizationRuleAsync( - String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName); - - /** - * Deletes an Event Hub AuthorizationRule. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param authorizationRuleName The authorization rule name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deleteAuthorizationRule( - String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName); - - /** - * Deletes an Event Hub AuthorizationRule. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param authorizationRuleName The authorization rule name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteAuthorizationRuleWithResponse( - String resourceGroupName, - String namespaceName, - String eventHubName, - String authorizationRuleName, - Context context); - - /** - * Gets the ACS and SAS connection strings for the Event Hub. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param authorizationRuleName The authorization rule name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ACS and SAS connection strings for the Event Hub. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listKeysWithResponseAsync( - String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName); - - /** - * Gets the ACS and SAS connection strings for the Event Hub. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param authorizationRuleName The authorization rule name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ACS and SAS connection strings for the Event Hub. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listKeysAsync( - String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName); - - /** - * Gets the ACS and SAS connection strings for the Event Hub. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param authorizationRuleName The authorization rule name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ACS and SAS connection strings for the Event Hub. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AccessKeysInner listKeys( - String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName); - - /** - * Gets the ACS and SAS connection strings for the Event Hub. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param authorizationRuleName The authorization rule name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ACS and SAS connection strings for the Event Hub. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listKeysWithResponse( - String resourceGroupName, - String namespaceName, - String eventHubName, - String authorizationRuleName, - Context context); - - /** - * Regenerates the ACS and SAS connection strings for the Event Hub. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param authorizationRuleName The authorization rule name. - * @param parameters Parameters supplied to regenerate the AuthorizationRule Keys (PrimaryKey/SecondaryKey). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return namespace/EventHub Connection String. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> regenerateKeysWithResponseAsync( - String resourceGroupName, - String namespaceName, - String eventHubName, - String authorizationRuleName, - RegenerateAccessKeyParameters parameters); - - /** - * Regenerates the ACS and SAS connection strings for the Event Hub. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param authorizationRuleName The authorization rule name. - * @param parameters Parameters supplied to regenerate the AuthorizationRule Keys (PrimaryKey/SecondaryKey). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return namespace/EventHub Connection String. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono regenerateKeysAsync( - String resourceGroupName, - String namespaceName, - String eventHubName, - String authorizationRuleName, - RegenerateAccessKeyParameters parameters); - - /** - * Regenerates the ACS and SAS connection strings for the Event Hub. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param authorizationRuleName The authorization rule name. - * @param parameters Parameters supplied to regenerate the AuthorizationRule Keys (PrimaryKey/SecondaryKey). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return namespace/EventHub Connection String. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AccessKeysInner regenerateKeys( - String resourceGroupName, - String namespaceName, - String eventHubName, - String authorizationRuleName, - RegenerateAccessKeyParameters parameters); - - /** - * Regenerates the ACS and SAS connection strings for the Event Hub. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param authorizationRuleName The authorization rule name. - * @param parameters Parameters supplied to regenerate the AuthorizationRule Keys (PrimaryKey/SecondaryKey). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return namespace/EventHub Connection String. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response regenerateKeysWithResponse( - String resourceGroupName, - String namespaceName, - String eventHubName, - String authorizationRuleName, - RegenerateAccessKeyParameters parameters, - Context context); - - /** - * Gets all the Event Hubs in a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains - * a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting - * point to use for subsequent calls. - * @param top May be used to limit the number of results to the most recent N usageDetails. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the Event Hubs in a Namespace. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByNamespaceAsync( - String resourceGroupName, String namespaceName, Integer skip, Integer top); - - /** - * Gets all the Event Hubs in a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the Event Hubs in a Namespace. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByNamespaceAsync(String resourceGroupName, String namespaceName); - - /** - * Gets all the Event Hubs in a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the Event Hubs in a Namespace. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByNamespace(String resourceGroupName, String namespaceName); - - /** - * Gets all the Event Hubs in a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains - * a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting - * point to use for subsequent calls. - * @param top May be used to limit the number of results to the most recent N usageDetails. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the Event Hubs in a Namespace. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByNamespace( - String resourceGroupName, String namespaceName, Integer skip, Integer top, Context context); - - /** - * Creates or updates a new Event Hub as a nested resource within a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param parameters Parameters supplied to create an Event Hub resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single item in List or Get Event Hub operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String namespaceName, String eventHubName, EventhubInner parameters); - - /** - * Creates or updates a new Event Hub as a nested resource within a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param parameters Parameters supplied to create an Event Hub resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single item in List or Get Event Hub operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, String namespaceName, String eventHubName, EventhubInner parameters); - - /** - * Creates or updates a new Event Hub as a nested resource within a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param parameters Parameters supplied to create an Event Hub resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single item in List or Get Event Hub operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - EventhubInner createOrUpdate( - String resourceGroupName, String namespaceName, String eventHubName, EventhubInner parameters); - - /** - * Creates or updates a new Event Hub as a nested resource within a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param parameters Parameters supplied to create an Event Hub resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single item in List or Get Event Hub operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, String namespaceName, String eventHubName, EventhubInner parameters, Context context); - - /** - * Deletes an Event Hub from the specified Namespace and resource group. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteWithResponseAsync(String resourceGroupName, String namespaceName, String eventHubName); - - /** - * Deletes an Event Hub from the specified Namespace and resource group. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String namespaceName, String eventHubName); - - /** - * Deletes an Event Hub from the specified Namespace and resource group. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String namespaceName, String eventHubName); - - /** - * Deletes an Event Hub from the specified Namespace and resource group. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse( - String resourceGroupName, String namespaceName, String eventHubName, Context context); - - /** - * Gets an Event Hubs description for the specified Event Hub. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Event Hubs description for the specified Event Hub. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync( - String resourceGroupName, String namespaceName, String eventHubName); - - /** - * Gets an Event Hubs description for the specified Event Hub. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Event Hubs description for the specified Event Hub. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync(String resourceGroupName, String namespaceName, String eventHubName); - - /** - * Gets an Event Hubs description for the specified Event Hub. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Event Hubs description for the specified Event Hub. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - EventhubInner get(String resourceGroupName, String namespaceName, String eventHubName); - - /** - * Gets an Event Hubs description for the specified Event Hub. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Event Hubs description for the specified Event Hub. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String namespaceName, String eventHubName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/NamespacesClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/NamespacesClient.java deleted file mode 100644 index 31ebfe6f8043..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/NamespacesClient.java +++ /dev/null @@ -1,1007 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.eventhubs.fluent.models.AccessKeysInner; -import com.azure.resourcemanager.eventhubs.fluent.models.AuthorizationRuleInner; -import com.azure.resourcemanager.eventhubs.fluent.models.CheckNameAvailabilityResultInner; -import com.azure.resourcemanager.eventhubs.fluent.models.EHNamespaceInner; -import com.azure.resourcemanager.eventhubs.fluent.models.NetworkRuleSetInner; -import com.azure.resourcemanager.eventhubs.models.CheckNameAvailabilityParameter; -import com.azure.resourcemanager.eventhubs.models.RegenerateAccessKeyParameters; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in NamespacesClient. */ -public interface NamespacesClient - extends InnerSupportsGet, InnerSupportsListing, InnerSupportsDelete { - /** - * Lists all the available Namespaces within a subscription, irrespective of the resource groups. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of the List Namespace operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Lists all the available Namespaces within a subscription, irrespective of the resource groups. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of the List Namespace operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Lists all the available Namespaces within a subscription, irrespective of the resource groups. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of the List Namespace operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Lists the available Namespaces within a resource group. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of the List Namespace operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName); - - /** - * Lists the available Namespaces within a resource group. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of the List Namespace operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Lists the available Namespaces within a resource group. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of the List Namespace operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is - * idempotent. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param parameters Parameters for creating a namespace resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single Namespace item in List or Get Operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String namespaceName, EHNamespaceInner parameters); - - /** - * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is - * idempotent. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param parameters Parameters for creating a namespace resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single Namespace item in List or Get Operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, EHNamespaceInner> beginCreateOrUpdateAsync( - String resourceGroupName, String namespaceName, EHNamespaceInner parameters); - - /** - * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is - * idempotent. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param parameters Parameters for creating a namespace resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single Namespace item in List or Get Operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, EHNamespaceInner> beginCreateOrUpdate( - String resourceGroupName, String namespaceName, EHNamespaceInner parameters); - - /** - * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is - * idempotent. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param parameters Parameters for creating a namespace resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single Namespace item in List or Get Operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, EHNamespaceInner> beginCreateOrUpdate( - String resourceGroupName, String namespaceName, EHNamespaceInner parameters, Context context); - - /** - * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is - * idempotent. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param parameters Parameters for creating a namespace resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single Namespace item in List or Get Operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, String namespaceName, EHNamespaceInner parameters); - - /** - * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is - * idempotent. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param parameters Parameters for creating a namespace resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single Namespace item in List or Get Operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - EHNamespaceInner createOrUpdate(String resourceGroupName, String namespaceName, EHNamespaceInner parameters); - - /** - * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is - * idempotent. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param parameters Parameters for creating a namespace resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single Namespace item in List or Get Operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - EHNamespaceInner createOrUpdate( - String resourceGroupName, String namespaceName, EHNamespaceInner parameters, Context context); - - /** - * Deletes an existing namespace. This operation also removes all associated resources under the namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync(String resourceGroupName, String namespaceName); - - /** - * Deletes an existing namespace. This operation also removes all associated resources under the namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String namespaceName); - - /** - * Deletes an existing namespace. This operation also removes all associated resources under the namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String namespaceName); - - /** - * Deletes an existing namespace. This operation also removes all associated resources under the namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String namespaceName, Context context); - - /** - * Deletes an existing namespace. This operation also removes all associated resources under the namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String namespaceName); - - /** - * Deletes an existing namespace. This operation also removes all associated resources under the namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String namespaceName); - - /** - * Deletes an existing namespace. This operation also removes all associated resources under the namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String namespaceName, Context context); - - /** - * Gets the description of the specified namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the description of the specified namespace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String namespaceName); - - /** - * Gets the description of the specified namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the description of the specified namespace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync(String resourceGroupName, String namespaceName); - - /** - * Gets the description of the specified namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the description of the specified namespace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - EHNamespaceInner getByResourceGroup(String resourceGroupName, String namespaceName); - - /** - * Gets the description of the specified namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the description of the specified namespace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String namespaceName, Context context); - - /** - * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is - * idempotent. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param parameters Parameters for updating a namespace resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single Namespace item in List or Get Operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateWithResponseAsync( - String resourceGroupName, String namespaceName, EHNamespaceInner parameters); - - /** - * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is - * idempotent. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param parameters Parameters for updating a namespace resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single Namespace item in List or Get Operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAsync(String resourceGroupName, String namespaceName, EHNamespaceInner parameters); - - /** - * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is - * idempotent. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param parameters Parameters for updating a namespace resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single Namespace item in List or Get Operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - EHNamespaceInner update(String resourceGroupName, String namespaceName, EHNamespaceInner parameters); - - /** - * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is - * idempotent. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param parameters Parameters for updating a namespace resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single Namespace item in List or Get Operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String resourceGroupName, String namespaceName, EHNamespaceInner parameters, Context context); - - /** - * Gets a list of authorization rules for a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of authorization rules for a Namespace. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAuthorizationRulesAsync(String resourceGroupName, String namespaceName); - - /** - * Gets a list of authorization rules for a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of authorization rules for a Namespace. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listAuthorizationRules(String resourceGroupName, String namespaceName); - - /** - * Gets a list of authorization rules for a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of authorization rules for a Namespace. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listAuthorizationRules( - String resourceGroupName, String namespaceName, Context context); - - /** - * Creates or updates an AuthorizationRule for a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param authorizationRuleName The authorization rule name. - * @param parameters The shared access AuthorizationRule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single item in a List or Get AuthorizationRule operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createOrUpdateAuthorizationRuleWithResponseAsync( - String resourceGroupName, - String namespaceName, - String authorizationRuleName, - AuthorizationRuleInner parameters); - - /** - * Creates or updates an AuthorizationRule for a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param authorizationRuleName The authorization rule name. - * @param parameters The shared access AuthorizationRule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single item in a List or Get AuthorizationRule operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAuthorizationRuleAsync( - String resourceGroupName, - String namespaceName, - String authorizationRuleName, - AuthorizationRuleInner parameters); - - /** - * Creates or updates an AuthorizationRule for a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param authorizationRuleName The authorization rule name. - * @param parameters The shared access AuthorizationRule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single item in a List or Get AuthorizationRule operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AuthorizationRuleInner createOrUpdateAuthorizationRule( - String resourceGroupName, - String namespaceName, - String authorizationRuleName, - AuthorizationRuleInner parameters); - - /** - * Creates or updates an AuthorizationRule for a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param authorizationRuleName The authorization rule name. - * @param parameters The shared access AuthorizationRule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single item in a List or Get AuthorizationRule operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateAuthorizationRuleWithResponse( - String resourceGroupName, - String namespaceName, - String authorizationRuleName, - AuthorizationRuleInner parameters, - Context context); - - /** - * Deletes an AuthorizationRule for a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param authorizationRuleName The authorization rule name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteAuthorizationRuleWithResponseAsync( - String resourceGroupName, String namespaceName, String authorizationRuleName); - - /** - * Deletes an AuthorizationRule for a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param authorizationRuleName The authorization rule name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAuthorizationRuleAsync( - String resourceGroupName, String namespaceName, String authorizationRuleName); - - /** - * Deletes an AuthorizationRule for a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param authorizationRuleName The authorization rule name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String authorizationRuleName); - - /** - * Deletes an AuthorizationRule for a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param authorizationRuleName The authorization rule name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteAuthorizationRuleWithResponse( - String resourceGroupName, String namespaceName, String authorizationRuleName, Context context); - - /** - * Gets an AuthorizationRule for a Namespace by rule name. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param authorizationRuleName The authorization rule name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an AuthorizationRule for a Namespace by rule name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getAuthorizationRuleWithResponseAsync( - String resourceGroupName, String namespaceName, String authorizationRuleName); - - /** - * Gets an AuthorizationRule for a Namespace by rule name. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param authorizationRuleName The authorization rule name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an AuthorizationRule for a Namespace by rule name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAuthorizationRuleAsync( - String resourceGroupName, String namespaceName, String authorizationRuleName); - - /** - * Gets an AuthorizationRule for a Namespace by rule name. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param authorizationRuleName The authorization rule name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an AuthorizationRule for a Namespace by rule name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AuthorizationRuleInner getAuthorizationRule( - String resourceGroupName, String namespaceName, String authorizationRuleName); - - /** - * Gets an AuthorizationRule for a Namespace by rule name. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param authorizationRuleName The authorization rule name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an AuthorizationRule for a Namespace by rule name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getAuthorizationRuleWithResponse( - String resourceGroupName, String namespaceName, String authorizationRuleName, Context context); - - /** - * Gets the primary and secondary connection strings for the Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param authorizationRuleName The authorization rule name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the primary and secondary connection strings for the Namespace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listKeysWithResponseAsync( - String resourceGroupName, String namespaceName, String authorizationRuleName); - - /** - * Gets the primary and secondary connection strings for the Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param authorizationRuleName The authorization rule name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the primary and secondary connection strings for the Namespace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName); - - /** - * Gets the primary and secondary connection strings for the Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param authorizationRuleName The authorization rule name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the primary and secondary connection strings for the Namespace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AccessKeysInner listKeys(String resourceGroupName, String namespaceName, String authorizationRuleName); - - /** - * Gets the primary and secondary connection strings for the Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param authorizationRuleName The authorization rule name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the primary and secondary connection strings for the Namespace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listKeysWithResponse( - String resourceGroupName, String namespaceName, String authorizationRuleName, Context context); - - /** - * Regenerates the primary or secondary connection strings for the specified Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param authorizationRuleName The authorization rule name. - * @param parameters Parameters required to regenerate the connection string. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return namespace/EventHub Connection String. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> regenerateKeysWithResponseAsync( - String resourceGroupName, - String namespaceName, - String authorizationRuleName, - RegenerateAccessKeyParameters parameters); - - /** - * Regenerates the primary or secondary connection strings for the specified Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param authorizationRuleName The authorization rule name. - * @param parameters Parameters required to regenerate the connection string. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return namespace/EventHub Connection String. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono regenerateKeysAsync( - String resourceGroupName, - String namespaceName, - String authorizationRuleName, - RegenerateAccessKeyParameters parameters); - - /** - * Regenerates the primary or secondary connection strings for the specified Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param authorizationRuleName The authorization rule name. - * @param parameters Parameters required to regenerate the connection string. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return namespace/EventHub Connection String. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AccessKeysInner regenerateKeys( - String resourceGroupName, - String namespaceName, - String authorizationRuleName, - RegenerateAccessKeyParameters parameters); - - /** - * Regenerates the primary or secondary connection strings for the specified Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param authorizationRuleName The authorization rule name. - * @param parameters Parameters required to regenerate the connection string. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return namespace/EventHub Connection String. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response regenerateKeysWithResponse( - String resourceGroupName, - String namespaceName, - String authorizationRuleName, - RegenerateAccessKeyParameters parameters, - Context context); - - /** - * Check the give Namespace name availability. - * - * @param parameters Parameters to check availability of the given Namespace name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Result of the CheckNameAvailability operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> checkNameAvailabilityWithResponseAsync( - CheckNameAvailabilityParameter parameters); - - /** - * Check the give Namespace name availability. - * - * @param parameters Parameters to check availability of the given Namespace name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Result of the CheckNameAvailability operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono checkNameAvailabilityAsync(CheckNameAvailabilityParameter parameters); - - /** - * Check the give Namespace name availability. - * - * @param parameters Parameters to check availability of the given Namespace name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Result of the CheckNameAvailability operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - CheckNameAvailabilityResultInner checkNameAvailability(CheckNameAvailabilityParameter parameters); - - /** - * Check the give Namespace name availability. - * - * @param parameters Parameters to check availability of the given Namespace name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Result of the CheckNameAvailability operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response checkNameAvailabilityWithResponse( - CheckNameAvailabilityParameter parameters, Context context); - - /** - * Create or update NetworkRuleSet for a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param parameters The Namespace IpFilterRule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of NetworkRuleSet resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createOrUpdateNetworkRuleSetWithResponseAsync( - String resourceGroupName, String namespaceName, NetworkRuleSetInner parameters); - - /** - * Create or update NetworkRuleSet for a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param parameters The Namespace IpFilterRule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of NetworkRuleSet resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateNetworkRuleSetAsync( - String resourceGroupName, String namespaceName, NetworkRuleSetInner parameters); - - /** - * Create or update NetworkRuleSet for a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param parameters The Namespace IpFilterRule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of NetworkRuleSet resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - NetworkRuleSetInner createOrUpdateNetworkRuleSet( - String resourceGroupName, String namespaceName, NetworkRuleSetInner parameters); - - /** - * Create or update NetworkRuleSet for a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param parameters The Namespace IpFilterRule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of NetworkRuleSet resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateNetworkRuleSetWithResponse( - String resourceGroupName, String namespaceName, NetworkRuleSetInner parameters, Context context); - - /** - * Gets NetworkRuleSet for a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return networkRuleSet for a Namespace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getNetworkRuleSetWithResponseAsync( - String resourceGroupName, String namespaceName); - - /** - * Gets NetworkRuleSet for a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return networkRuleSet for a Namespace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getNetworkRuleSetAsync(String resourceGroupName, String namespaceName); - - /** - * Gets NetworkRuleSet for a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return networkRuleSet for a Namespace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - NetworkRuleSetInner getNetworkRuleSet(String resourceGroupName, String namespaceName); - - /** - * Gets NetworkRuleSet for a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return networkRuleSet for a Namespace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getNetworkRuleSetWithResponse( - String resourceGroupName, String namespaceName, Context context); - - /** - * Gets list of NetworkRuleSet for a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of NetworkRuleSet for a Namespace. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listNetworkRuleSetsAsync(String resourceGroupName, String namespaceName); - - /** - * Gets list of NetworkRuleSet for a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of NetworkRuleSet for a Namespace. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listNetworkRuleSets(String resourceGroupName, String namespaceName); - - /** - * Gets list of NetworkRuleSet for a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of NetworkRuleSet for a Namespace. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listNetworkRuleSets( - String resourceGroupName, String namespaceName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/OperationsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/OperationsClient.java deleted file mode 100644 index 7ef09fd03214..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/OperationsClient.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.eventhubs.fluent.models.OperationInner; - -/** An instance of this class provides access to all the operations defined in OperationsClient. */ -public interface OperationsClient { - /** - * Lists all of the available Event Hub REST API operations. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Event Hub operations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Lists all of the available Event Hub REST API operations. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Event Hub operations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Lists all of the available Event Hub REST API operations. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Event Hub operations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/PrivateEndpointConnectionsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/PrivateEndpointConnectionsClient.java deleted file mode 100644 index ef02a4953766..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/PrivateEndpointConnectionsClient.java +++ /dev/null @@ -1,303 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.eventhubs.fluent.models.PrivateEndpointConnectionInner; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. */ -public interface PrivateEndpointConnectionsClient { - /** - * Gets the available PrivateEndpointConnections within a namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the available PrivateEndpointConnections within a namespace. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String resourceGroupName, String namespaceName); - - /** - * Gets the available PrivateEndpointConnections within a namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the available PrivateEndpointConnections within a namespace. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String namespaceName); - - /** - * Gets the available PrivateEndpointConnections within a namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the available PrivateEndpointConnections within a namespace. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String namespaceName, Context context); - - /** - * Creates or updates PrivateEndpointConnections of service namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param privateEndpointConnectionName The PrivateEndpointConnection name. - * @param parameters Parameters supplied to update Status of PrivateEndPoint Connection to namespace resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of the PrivateEndpointConnection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, - String namespaceName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner parameters); - - /** - * Creates or updates PrivateEndpointConnections of service namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param privateEndpointConnectionName The PrivateEndpointConnection name. - * @param parameters Parameters supplied to update Status of PrivateEndPoint Connection to namespace resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of the PrivateEndpointConnection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, - String namespaceName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner parameters); - - /** - * Creates or updates PrivateEndpointConnections of service namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param privateEndpointConnectionName The PrivateEndpointConnection name. - * @param parameters Parameters supplied to update Status of PrivateEndPoint Connection to namespace resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of the PrivateEndpointConnection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PrivateEndpointConnectionInner createOrUpdate( - String resourceGroupName, - String namespaceName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner parameters); - - /** - * Creates or updates PrivateEndpointConnections of service namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param privateEndpointConnectionName The PrivateEndpointConnection name. - * @param parameters Parameters supplied to update Status of PrivateEndPoint Connection to namespace resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of the PrivateEndpointConnection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, - String namespaceName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner parameters, - Context context); - - /** - * Deletes an existing namespace. This operation also removes all associated resources under the namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param privateEndpointConnectionName The PrivateEndpointConnection name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync( - String resourceGroupName, String namespaceName, String privateEndpointConnectionName); - - /** - * Deletes an existing namespace. This operation also removes all associated resources under the namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param privateEndpointConnectionName The PrivateEndpointConnection name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String namespaceName, String privateEndpointConnectionName); - - /** - * Deletes an existing namespace. This operation also removes all associated resources under the namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param privateEndpointConnectionName The PrivateEndpointConnection name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String namespaceName, String privateEndpointConnectionName); - - /** - * Deletes an existing namespace. This operation also removes all associated resources under the namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param privateEndpointConnectionName The PrivateEndpointConnection name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String namespaceName, String privateEndpointConnectionName, Context context); - - /** - * Deletes an existing namespace. This operation also removes all associated resources under the namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param privateEndpointConnectionName The PrivateEndpointConnection name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String namespaceName, String privateEndpointConnectionName); - - /** - * Deletes an existing namespace. This operation also removes all associated resources under the namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param privateEndpointConnectionName The PrivateEndpointConnection name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String namespaceName, String privateEndpointConnectionName); - - /** - * Deletes an existing namespace. This operation also removes all associated resources under the namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param privateEndpointConnectionName The PrivateEndpointConnection name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String namespaceName, String privateEndpointConnectionName, Context context); - - /** - * Gets a description for the specified Private Endpoint Connection name. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param privateEndpointConnectionName The PrivateEndpointConnection name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a description for the specified Private Endpoint Connection name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync( - String resourceGroupName, String namespaceName, String privateEndpointConnectionName); - - /** - * Gets a description for the specified Private Endpoint Connection name. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param privateEndpointConnectionName The PrivateEndpointConnection name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a description for the specified Private Endpoint Connection name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync( - String resourceGroupName, String namespaceName, String privateEndpointConnectionName); - - /** - * Gets a description for the specified Private Endpoint Connection name. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param privateEndpointConnectionName The PrivateEndpointConnection name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a description for the specified Private Endpoint Connection name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PrivateEndpointConnectionInner get( - String resourceGroupName, String namespaceName, String privateEndpointConnectionName); - - /** - * Gets a description for the specified Private Endpoint Connection name. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param privateEndpointConnectionName The PrivateEndpointConnection name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a description for the specified Private Endpoint Connection name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String namespaceName, String privateEndpointConnectionName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/PrivateLinkResourcesClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/PrivateLinkResourcesClient.java deleted file mode 100644 index 3c9b28c3c6c5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/PrivateLinkResourcesClient.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.eventhubs.fluent.models.PrivateLinkResourcesListResultInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. */ -public interface PrivateLinkResourcesClient { - /** - * Gets lists of resources that supports Privatelinks. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lists of resources that supports Privatelinks. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync( - String resourceGroupName, String namespaceName); - - /** - * Gets lists of resources that supports Privatelinks. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lists of resources that supports Privatelinks. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync(String resourceGroupName, String namespaceName); - - /** - * Gets lists of resources that supports Privatelinks. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lists of resources that supports Privatelinks. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PrivateLinkResourcesListResultInner get(String resourceGroupName, String namespaceName); - - /** - * Gets lists of resources that supports Privatelinks. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lists of resources that supports Privatelinks. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String namespaceName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/RegionsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/RegionsClient.java deleted file mode 100644 index a137185013e8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/RegionsClient.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.eventhubs.fluent.models.MessagingRegionsInner; - -/** An instance of this class provides access to all the operations defined in RegionsClient. */ -public interface RegionsClient { - /** - * Gets the available Regions for a given sku. - * - * @param sku The sku type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the available Regions for a given sku. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listBySkuAsync(String sku); - - /** - * Gets the available Regions for a given sku. - * - * @param sku The sku type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the available Regions for a given sku. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listBySku(String sku); - - /** - * Gets the available Regions for a given sku. - * - * @param sku The sku type. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the available Regions for a given sku. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listBySku(String sku, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/models/AccessKeysInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/models/AccessKeysInner.java deleted file mode 100644 index c22d749472a8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/models/AccessKeysInner.java +++ /dev/null @@ -1,132 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Namespace/EventHub Connection String. */ -@Immutable -public final class AccessKeysInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AccessKeysInner.class); - - /* - * Primary connection string of the created namespace AuthorizationRule. - */ - @JsonProperty(value = "primaryConnectionString", access = JsonProperty.Access.WRITE_ONLY) - private String primaryConnectionString; - - /* - * Secondary connection string of the created namespace AuthorizationRule. - */ - @JsonProperty(value = "secondaryConnectionString", access = JsonProperty.Access.WRITE_ONLY) - private String secondaryConnectionString; - - /* - * Primary connection string of the alias if GEO DR is enabled - */ - @JsonProperty(value = "aliasPrimaryConnectionString", access = JsonProperty.Access.WRITE_ONLY) - private String aliasPrimaryConnectionString; - - /* - * Secondary connection string of the alias if GEO DR is enabled - */ - @JsonProperty(value = "aliasSecondaryConnectionString", access = JsonProperty.Access.WRITE_ONLY) - private String aliasSecondaryConnectionString; - - /* - * A base64-encoded 256-bit primary key for signing and validating the SAS - * token. - */ - @JsonProperty(value = "primaryKey", access = JsonProperty.Access.WRITE_ONLY) - private String primaryKey; - - /* - * A base64-encoded 256-bit primary key for signing and validating the SAS - * token. - */ - @JsonProperty(value = "secondaryKey", access = JsonProperty.Access.WRITE_ONLY) - private String secondaryKey; - - /* - * A string that describes the AuthorizationRule. - */ - @JsonProperty(value = "keyName", access = JsonProperty.Access.WRITE_ONLY) - private String keyName; - - /** - * Get the primaryConnectionString property: Primary connection string of the created namespace AuthorizationRule. - * - * @return the primaryConnectionString value. - */ - public String primaryConnectionString() { - return this.primaryConnectionString; - } - - /** - * Get the secondaryConnectionString property: Secondary connection string of the created namespace - * AuthorizationRule. - * - * @return the secondaryConnectionString value. - */ - public String secondaryConnectionString() { - return this.secondaryConnectionString; - } - - /** - * Get the aliasPrimaryConnectionString property: Primary connection string of the alias if GEO DR is enabled. - * - * @return the aliasPrimaryConnectionString value. - */ - public String aliasPrimaryConnectionString() { - return this.aliasPrimaryConnectionString; - } - - /** - * Get the aliasSecondaryConnectionString property: Secondary connection string of the alias if GEO DR is enabled. - * - * @return the aliasSecondaryConnectionString value. - */ - public String aliasSecondaryConnectionString() { - return this.aliasSecondaryConnectionString; - } - - /** - * Get the primaryKey property: A base64-encoded 256-bit primary key for signing and validating the SAS token. - * - * @return the primaryKey value. - */ - public String primaryKey() { - return this.primaryKey; - } - - /** - * Get the secondaryKey property: A base64-encoded 256-bit primary key for signing and validating the SAS token. - * - * @return the secondaryKey value. - */ - public String secondaryKey() { - return this.secondaryKey; - } - - /** - * Get the keyName property: A string that describes the AuthorizationRule. - * - * @return the keyName value. - */ - public String keyName() { - return this.keyName; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/models/ArmDisasterRecoveryInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/models/ArmDisasterRecoveryInner.java deleted file mode 100644 index 5d23abd8a7a9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/models/ArmDisasterRecoveryInner.java +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.eventhubs.models.ProvisioningStateDR; -import com.azure.resourcemanager.eventhubs.models.RoleDisasterRecovery; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Single item in List or Get Alias(Disaster Recovery configuration) operation. */ -@Fluent -public final class ArmDisasterRecoveryInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ArmDisasterRecoveryInner.class); - - /* - * Properties required to the Create Or Update Alias(Disaster Recovery - * configurations) - */ - @JsonProperty(value = "properties") - private ArmDisasterRecoveryProperties innerProperties; - - /** - * Get the innerProperties property: Properties required to the Create Or Update Alias(Disaster Recovery - * configurations). - * - * @return the innerProperties value. - */ - private ArmDisasterRecoveryProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the provisioningState property: Provisioning state of the Alias(Disaster Recovery configuration) - possible - * values 'Accepted' or 'Succeeded' or 'Failed'. - * - * @return the provisioningState value. - */ - public ProvisioningStateDR provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the partnerNamespace property: ARM Id of the Primary/Secondary eventhub namespace name, which is part of GEO - * DR pairing. - * - * @return the partnerNamespace value. - */ - public String partnerNamespace() { - return this.innerProperties() == null ? null : this.innerProperties().partnerNamespace(); - } - - /** - * Set the partnerNamespace property: ARM Id of the Primary/Secondary eventhub namespace name, which is part of GEO - * DR pairing. - * - * @param partnerNamespace the partnerNamespace value to set. - * @return the ArmDisasterRecoveryInner object itself. - */ - public ArmDisasterRecoveryInner withPartnerNamespace(String partnerNamespace) { - if (this.innerProperties() == null) { - this.innerProperties = new ArmDisasterRecoveryProperties(); - } - this.innerProperties().withPartnerNamespace(partnerNamespace); - return this; - } - - /** - * Get the alternateName property: Alternate name specified when alias and namespace names are same. - * - * @return the alternateName value. - */ - public String alternateName() { - return this.innerProperties() == null ? null : this.innerProperties().alternateName(); - } - - /** - * Set the alternateName property: Alternate name specified when alias and namespace names are same. - * - * @param alternateName the alternateName value to set. - * @return the ArmDisasterRecoveryInner object itself. - */ - public ArmDisasterRecoveryInner withAlternateName(String alternateName) { - if (this.innerProperties() == null) { - this.innerProperties = new ArmDisasterRecoveryProperties(); - } - this.innerProperties().withAlternateName(alternateName); - return this; - } - - /** - * Get the role property: role of namespace in GEO DR - possible values 'Primary' or 'PrimaryNotReplicating' or - * 'Secondary'. - * - * @return the role value. - */ - public RoleDisasterRecovery role() { - return this.innerProperties() == null ? null : this.innerProperties().role(); - } - - /** - * Get the pendingReplicationOperationsCount property: Number of entities pending to be replicated. - * - * @return the pendingReplicationOperationsCount value. - */ - public Long pendingReplicationOperationsCount() { - return this.innerProperties() == null ? null : this.innerProperties().pendingReplicationOperationsCount(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/models/ArmDisasterRecoveryProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/models/ArmDisasterRecoveryProperties.java deleted file mode 100644 index 6e4132c61c97..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/models/ArmDisasterRecoveryProperties.java +++ /dev/null @@ -1,130 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.eventhubs.models.ProvisioningStateDR; -import com.azure.resourcemanager.eventhubs.models.RoleDisasterRecovery; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Properties required to the Create Or Update Alias(Disaster Recovery configurations). */ -@Fluent -public final class ArmDisasterRecoveryProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ArmDisasterRecoveryProperties.class); - - /* - * Provisioning state of the Alias(Disaster Recovery configuration) - - * possible values 'Accepted' or 'Succeeded' or 'Failed' - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private ProvisioningStateDR provisioningState; - - /* - * ARM Id of the Primary/Secondary eventhub namespace name, which is part - * of GEO DR pairing - */ - @JsonProperty(value = "partnerNamespace") - private String partnerNamespace; - - /* - * Alternate name specified when alias and namespace names are same. - */ - @JsonProperty(value = "alternateName") - private String alternateName; - - /* - * role of namespace in GEO DR - possible values 'Primary' or - * 'PrimaryNotReplicating' or 'Secondary' - */ - @JsonProperty(value = "role", access = JsonProperty.Access.WRITE_ONLY) - private RoleDisasterRecovery role; - - /* - * Number of entities pending to be replicated. - */ - @JsonProperty(value = "pendingReplicationOperationsCount", access = JsonProperty.Access.WRITE_ONLY) - private Long pendingReplicationOperationsCount; - - /** - * Get the provisioningState property: Provisioning state of the Alias(Disaster Recovery configuration) - possible - * values 'Accepted' or 'Succeeded' or 'Failed'. - * - * @return the provisioningState value. - */ - public ProvisioningStateDR provisioningState() { - return this.provisioningState; - } - - /** - * Get the partnerNamespace property: ARM Id of the Primary/Secondary eventhub namespace name, which is part of GEO - * DR pairing. - * - * @return the partnerNamespace value. - */ - public String partnerNamespace() { - return this.partnerNamespace; - } - - /** - * Set the partnerNamespace property: ARM Id of the Primary/Secondary eventhub namespace name, which is part of GEO - * DR pairing. - * - * @param partnerNamespace the partnerNamespace value to set. - * @return the ArmDisasterRecoveryProperties object itself. - */ - public ArmDisasterRecoveryProperties withPartnerNamespace(String partnerNamespace) { - this.partnerNamespace = partnerNamespace; - return this; - } - - /** - * Get the alternateName property: Alternate name specified when alias and namespace names are same. - * - * @return the alternateName value. - */ - public String alternateName() { - return this.alternateName; - } - - /** - * Set the alternateName property: Alternate name specified when alias and namespace names are same. - * - * @param alternateName the alternateName value to set. - * @return the ArmDisasterRecoveryProperties object itself. - */ - public ArmDisasterRecoveryProperties withAlternateName(String alternateName) { - this.alternateName = alternateName; - return this; - } - - /** - * Get the role property: role of namespace in GEO DR - possible values 'Primary' or 'PrimaryNotReplicating' or - * 'Secondary'. - * - * @return the role value. - */ - public RoleDisasterRecovery role() { - return this.role; - } - - /** - * Get the pendingReplicationOperationsCount property: Number of entities pending to be replicated. - * - * @return the pendingReplicationOperationsCount value. - */ - public Long pendingReplicationOperationsCount() { - return this.pendingReplicationOperationsCount; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/models/AuthorizationRuleInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/models/AuthorizationRuleInner.java deleted file mode 100644 index de3be508582e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/models/AuthorizationRuleInner.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.eventhubs.models.AccessRights; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Single item in a List or Get AuthorizationRule operation. */ -@Fluent -public final class AuthorizationRuleInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AuthorizationRuleInner.class); - - /* - * Properties supplied to create or update AuthorizationRule - */ - @JsonProperty(value = "properties") - private AuthorizationRuleProperties innerProperties; - - /** - * Get the innerProperties property: Properties supplied to create or update AuthorizationRule. - * - * @return the innerProperties value. - */ - private AuthorizationRuleProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the rights property: The rights associated with the rule. - * - * @return the rights value. - */ - public List rights() { - return this.innerProperties() == null ? null : this.innerProperties().rights(); - } - - /** - * Set the rights property: The rights associated with the rule. - * - * @param rights the rights value to set. - * @return the AuthorizationRuleInner object itself. - */ - public AuthorizationRuleInner withRights(List rights) { - if (this.innerProperties() == null) { - this.innerProperties = new AuthorizationRuleProperties(); - } - this.innerProperties().withRights(rights); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/models/AuthorizationRuleProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/models/AuthorizationRuleProperties.java deleted file mode 100644 index e1f92a390356..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/models/AuthorizationRuleProperties.java +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.eventhubs.models.AccessRights; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Properties supplied to create or update AuthorizationRule. */ -@Fluent -public final class AuthorizationRuleProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AuthorizationRuleProperties.class); - - /* - * The rights associated with the rule. - */ - @JsonProperty(value = "rights", required = true) - private List rights; - - /** - * Get the rights property: The rights associated with the rule. - * - * @return the rights value. - */ - public List rights() { - return this.rights; - } - - /** - * Set the rights property: The rights associated with the rule. - * - * @param rights the rights value to set. - * @return the AuthorizationRuleProperties object itself. - */ - public AuthorizationRuleProperties withRights(List rights) { - this.rights = rights; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (rights() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property rights in model AuthorizationRuleProperties")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/models/AvailableClustersListInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/models/AvailableClustersListInner.java deleted file mode 100644 index 752d09018e3a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/models/AvailableClustersListInner.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.eventhubs.models.AvailableCluster; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The response of the List Available Clusters operation. */ -@Fluent -public final class AvailableClustersListInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailableClustersListInner.class); - - /* - * The count of readily available and pre-provisioned Event Hubs Clusters - * per region. - */ - @JsonProperty(value = "value") - private List value; - - /** - * Get the value property: The count of readily available and pre-provisioned Event Hubs Clusters per region. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The count of readily available and pre-provisioned Event Hubs Clusters per region. - * - * @param value the value value to set. - * @return the AvailableClustersListInner object itself. - */ - public AvailableClustersListInner withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/models/CheckNameAvailabilityResultInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/models/CheckNameAvailabilityResultInner.java deleted file mode 100644 index daf7515f5aad..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/models/CheckNameAvailabilityResultInner.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.eventhubs.models.UnavailableReason; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The Result of the CheckNameAvailability operation. */ -@Fluent -public final class CheckNameAvailabilityResultInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CheckNameAvailabilityResultInner.class); - - /* - * The detailed info regarding the reason associated with the Namespace. - */ - @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) - private String message; - - /* - * Value indicating Namespace is availability, true if the Namespace is - * available; otherwise, false. - */ - @JsonProperty(value = "nameAvailable") - private Boolean nameAvailable; - - /* - * The reason for unavailability of a Namespace. - */ - @JsonProperty(value = "reason") - private UnavailableReason reason; - - /** - * Get the message property: The detailed info regarding the reason associated with the Namespace. - * - * @return the message value. - */ - public String message() { - return this.message; - } - - /** - * Get the nameAvailable property: Value indicating Namespace is availability, true if the Namespace is available; - * otherwise, false. - * - * @return the nameAvailable value. - */ - public Boolean nameAvailable() { - return this.nameAvailable; - } - - /** - * Set the nameAvailable property: Value indicating Namespace is availability, true if the Namespace is available; - * otherwise, false. - * - * @param nameAvailable the nameAvailable value to set. - * @return the CheckNameAvailabilityResultInner object itself. - */ - public CheckNameAvailabilityResultInner withNameAvailable(Boolean nameAvailable) { - this.nameAvailable = nameAvailable; - return this; - } - - /** - * Get the reason property: The reason for unavailability of a Namespace. - * - * @return the reason value. - */ - public UnavailableReason reason() { - return this.reason; - } - - /** - * Set the reason property: The reason for unavailability of a Namespace. - * - * @param reason the reason value to set. - * @return the CheckNameAvailabilityResultInner object itself. - */ - public CheckNameAvailabilityResultInner withReason(UnavailableReason reason) { - this.reason = reason; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/models/ClusterInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/models/ClusterInner.java deleted file mode 100644 index 5c5d12710ddc..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/models/ClusterInner.java +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.eventhubs.models.ClusterSku; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** Single Event Hubs Cluster resource in List or Get operations. */ -@Fluent -public final class ClusterInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ClusterInner.class); - - /* - * Properties of the cluster SKU. - */ - @JsonProperty(value = "sku") - private ClusterSku sku; - - /* - * Event Hubs Cluster properties supplied in responses in List or Get - * operations. - */ - @JsonProperty(value = "properties") - private ClusterProperties innerProperties; - - /** - * Get the sku property: Properties of the cluster SKU. - * - * @return the sku value. - */ - public ClusterSku sku() { - return this.sku; - } - - /** - * Set the sku property: Properties of the cluster SKU. - * - * @param sku the sku value to set. - * @return the ClusterInner object itself. - */ - public ClusterInner withSku(ClusterSku sku) { - this.sku = sku; - return this; - } - - /** - * Get the innerProperties property: Event Hubs Cluster properties supplied in responses in List or Get operations. - * - * @return the innerProperties value. - */ - private ClusterProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public ClusterInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public ClusterInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the createdAt property: The UTC time when the Event Hubs Cluster was created. - * - * @return the createdAt value. - */ - public String createdAt() { - return this.innerProperties() == null ? null : this.innerProperties().createdAt(); - } - - /** - * Get the updatedAt property: The UTC time when the Event Hubs Cluster was last updated. - * - * @return the updatedAt value. - */ - public String updatedAt() { - return this.innerProperties() == null ? null : this.innerProperties().updatedAt(); - } - - /** - * Get the metricId property: The metric ID of the cluster resource. Provided by the service and not modifiable by - * the user. - * - * @return the metricId value. - */ - public String metricId() { - return this.innerProperties() == null ? null : this.innerProperties().metricId(); - } - - /** - * Get the status property: Status of the Cluster resource. - * - * @return the status value. - */ - public String status() { - return this.innerProperties() == null ? null : this.innerProperties().status(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (sku() != null) { - sku().validate(); - } - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/models/ClusterProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/models/ClusterProperties.java deleted file mode 100644 index fda98641ef7d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/models/ClusterProperties.java +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Event Hubs Cluster properties supplied in responses in List or Get operations. */ -@Immutable -public final class ClusterProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ClusterProperties.class); - - /* - * The UTC time when the Event Hubs Cluster was created. - */ - @JsonProperty(value = "createdAt", access = JsonProperty.Access.WRITE_ONLY) - private String createdAt; - - /* - * The UTC time when the Event Hubs Cluster was last updated. - */ - @JsonProperty(value = "updatedAt", access = JsonProperty.Access.WRITE_ONLY) - private String updatedAt; - - /* - * The metric ID of the cluster resource. Provided by the service and not - * modifiable by the user. - */ - @JsonProperty(value = "metricId", access = JsonProperty.Access.WRITE_ONLY) - private String metricId; - - /* - * Status of the Cluster resource - */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) - private String status; - - /** - * Get the createdAt property: The UTC time when the Event Hubs Cluster was created. - * - * @return the createdAt value. - */ - public String createdAt() { - return this.createdAt; - } - - /** - * Get the updatedAt property: The UTC time when the Event Hubs Cluster was last updated. - * - * @return the updatedAt value. - */ - public String updatedAt() { - return this.updatedAt; - } - - /** - * Get the metricId property: The metric ID of the cluster resource. Provided by the service and not modifiable by - * the user. - * - * @return the metricId value. - */ - public String metricId() { - return this.metricId; - } - - /** - * Get the status property: Status of the Cluster resource. - * - * @return the status value. - */ - public String status() { - return this.status; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/models/ConsumerGroupInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/models/ConsumerGroupInner.java deleted file mode 100644 index 28e7301b8021..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/models/ConsumerGroupInner.java +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** Single item in List or Get Consumer group operation. */ -@Fluent -public final class ConsumerGroupInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ConsumerGroupInner.class); - - /* - * Single item in List or Get Consumer group operation - */ - @JsonProperty(value = "properties") - private ConsumerGroupProperties innerProperties; - - /** - * Get the innerProperties property: Single item in List or Get Consumer group operation. - * - * @return the innerProperties value. - */ - private ConsumerGroupProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the createdAt property: Exact time the message was created. - * - * @return the createdAt value. - */ - public OffsetDateTime createdAt() { - return this.innerProperties() == null ? null : this.innerProperties().createdAt(); - } - - /** - * Get the updatedAt property: The exact time the message was updated. - * - * @return the updatedAt value. - */ - public OffsetDateTime updatedAt() { - return this.innerProperties() == null ? null : this.innerProperties().updatedAt(); - } - - /** - * Get the userMetadata property: User Metadata is a placeholder to store user-defined string data with maximum - * length 1024. e.g. it can be used to store descriptive data, such as list of teams and their contact information - * also user-defined configuration settings can be stored. - * - * @return the userMetadata value. - */ - public String userMetadata() { - return this.innerProperties() == null ? null : this.innerProperties().userMetadata(); - } - - /** - * Set the userMetadata property: User Metadata is a placeholder to store user-defined string data with maximum - * length 1024. e.g. it can be used to store descriptive data, such as list of teams and their contact information - * also user-defined configuration settings can be stored. - * - * @param userMetadata the userMetadata value to set. - * @return the ConsumerGroupInner object itself. - */ - public ConsumerGroupInner withUserMetadata(String userMetadata) { - if (this.innerProperties() == null) { - this.innerProperties = new ConsumerGroupProperties(); - } - this.innerProperties().withUserMetadata(userMetadata); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/models/ConsumerGroupProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/models/ConsumerGroupProperties.java deleted file mode 100644 index 0beac2977e2d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/models/ConsumerGroupProperties.java +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** Single item in List or Get Consumer group operation. */ -@Fluent -public final class ConsumerGroupProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ConsumerGroupProperties.class); - - /* - * Exact time the message was created. - */ - @JsonProperty(value = "createdAt", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime createdAt; - - /* - * The exact time the message was updated. - */ - @JsonProperty(value = "updatedAt", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime updatedAt; - - /* - * User Metadata is a placeholder to store user-defined string data with - * maximum length 1024. e.g. it can be used to store descriptive data, such - * as list of teams and their contact information also user-defined - * configuration settings can be stored. - */ - @JsonProperty(value = "userMetadata") - private String userMetadata; - - /** - * Get the createdAt property: Exact time the message was created. - * - * @return the createdAt value. - */ - public OffsetDateTime createdAt() { - return this.createdAt; - } - - /** - * Get the updatedAt property: The exact time the message was updated. - * - * @return the updatedAt value. - */ - public OffsetDateTime updatedAt() { - return this.updatedAt; - } - - /** - * Get the userMetadata property: User Metadata is a placeholder to store user-defined string data with maximum - * length 1024. e.g. it can be used to store descriptive data, such as list of teams and their contact information - * also user-defined configuration settings can be stored. - * - * @return the userMetadata value. - */ - public String userMetadata() { - return this.userMetadata; - } - - /** - * Set the userMetadata property: User Metadata is a placeholder to store user-defined string data with maximum - * length 1024. e.g. it can be used to store descriptive data, such as list of teams and their contact information - * also user-defined configuration settings can be stored. - * - * @param userMetadata the userMetadata value to set. - * @return the ConsumerGroupProperties object itself. - */ - public ConsumerGroupProperties withUserMetadata(String userMetadata) { - this.userMetadata = userMetadata; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/models/DestinationProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/models/DestinationProperties.java deleted file mode 100644 index 081dbe44eb70..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/models/DestinationProperties.java +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Properties describing the storage account, blob container and archive name format for capture destination. */ -@Fluent -public final class DestinationProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DestinationProperties.class); - - /* - * Resource id of the storage account to be used to create the blobs - */ - @JsonProperty(value = "storageAccountResourceId") - private String storageAccountResourceId; - - /* - * Blob container Name - */ - @JsonProperty(value = "blobContainer") - private String blobContainer; - - /* - * Blob naming convention for archive, e.g. - * {Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}. - * Here all the parameters (Namespace,EventHub .. etc) are mandatory - * irrespective of order - */ - @JsonProperty(value = "archiveNameFormat") - private String archiveNameFormat; - - /** - * Get the storageAccountResourceId property: Resource id of the storage account to be used to create the blobs. - * - * @return the storageAccountResourceId value. - */ - public String storageAccountResourceId() { - return this.storageAccountResourceId; - } - - /** - * Set the storageAccountResourceId property: Resource id of the storage account to be used to create the blobs. - * - * @param storageAccountResourceId the storageAccountResourceId value to set. - * @return the DestinationProperties object itself. - */ - public DestinationProperties withStorageAccountResourceId(String storageAccountResourceId) { - this.storageAccountResourceId = storageAccountResourceId; - return this; - } - - /** - * Get the blobContainer property: Blob container Name. - * - * @return the blobContainer value. - */ - public String blobContainer() { - return this.blobContainer; - } - - /** - * Set the blobContainer property: Blob container Name. - * - * @param blobContainer the blobContainer value to set. - * @return the DestinationProperties object itself. - */ - public DestinationProperties withBlobContainer(String blobContainer) { - this.blobContainer = blobContainer; - return this; - } - - /** - * Get the archiveNameFormat property: Blob naming convention for archive, e.g. - * {Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}. Here all the parameters - * (Namespace,EventHub .. etc) are mandatory irrespective of order. - * - * @return the archiveNameFormat value. - */ - public String archiveNameFormat() { - return this.archiveNameFormat; - } - - /** - * Set the archiveNameFormat property: Blob naming convention for archive, e.g. - * {Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}. Here all the parameters - * (Namespace,EventHub .. etc) are mandatory irrespective of order. - * - * @param archiveNameFormat the archiveNameFormat value to set. - * @return the DestinationProperties object itself. - */ - public DestinationProperties withArchiveNameFormat(String archiveNameFormat) { - this.archiveNameFormat = archiveNameFormat; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/models/EHNamespaceIdListResultInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/models/EHNamespaceIdListResultInner.java deleted file mode 100644 index 9855113e05eb..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/models/EHNamespaceIdListResultInner.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.eventhubs.models.EHNamespaceIdContainer; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The response of the List Namespace IDs operation. */ -@Fluent -public final class EHNamespaceIdListResultInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(EHNamespaceIdListResultInner.class); - - /* - * Result of the List Namespace IDs operation - */ - @JsonProperty(value = "value") - private List value; - - /** - * Get the value property: Result of the List Namespace IDs operation. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Result of the List Namespace IDs operation. - * - * @param value the value value to set. - * @return the EHNamespaceIdListResultInner object itself. - */ - public EHNamespaceIdListResultInner withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/models/EHNamespaceInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/models/EHNamespaceInner.java deleted file mode 100644 index a2e2b709b085..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/models/EHNamespaceInner.java +++ /dev/null @@ -1,318 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.eventhubs.models.Encryption; -import com.azure.resourcemanager.eventhubs.models.Identity; -import com.azure.resourcemanager.eventhubs.models.Sku; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.Map; - -/** Single Namespace item in List or Get Operation. */ -@Fluent -public final class EHNamespaceInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(EHNamespaceInner.class); - - /* - * Properties of sku resource - */ - @JsonProperty(value = "sku") - private Sku sku; - - /* - * Properties of BYOK Identity description - */ - @JsonProperty(value = "identity") - private Identity identity; - - /* - * Namespace properties supplied for create namespace operation. - */ - @JsonProperty(value = "properties") - private EHNamespaceProperties innerProperties; - - /** - * Get the sku property: Properties of sku resource. - * - * @return the sku value. - */ - public Sku sku() { - return this.sku; - } - - /** - * Set the sku property: Properties of sku resource. - * - * @param sku the sku value to set. - * @return the EHNamespaceInner object itself. - */ - public EHNamespaceInner withSku(Sku sku) { - this.sku = sku; - return this; - } - - /** - * Get the identity property: Properties of BYOK Identity description. - * - * @return the identity value. - */ - public Identity identity() { - return this.identity; - } - - /** - * Set the identity property: Properties of BYOK Identity description. - * - * @param identity the identity value to set. - * @return the EHNamespaceInner object itself. - */ - public EHNamespaceInner withIdentity(Identity identity) { - this.identity = identity; - return this; - } - - /** - * Get the innerProperties property: Namespace properties supplied for create namespace operation. - * - * @return the innerProperties value. - */ - private EHNamespaceProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public EHNamespaceInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public EHNamespaceInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the provisioningState property: Provisioning state of the Namespace. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the status property: Status of the Namespace. - * - * @return the status value. - */ - public String status() { - return this.innerProperties() == null ? null : this.innerProperties().status(); - } - - /** - * Get the createdAt property: The time the Namespace was created. - * - * @return the createdAt value. - */ - public OffsetDateTime createdAt() { - return this.innerProperties() == null ? null : this.innerProperties().createdAt(); - } - - /** - * Get the updatedAt property: The time the Namespace was updated. - * - * @return the updatedAt value. - */ - public OffsetDateTime updatedAt() { - return this.innerProperties() == null ? null : this.innerProperties().updatedAt(); - } - - /** - * Get the serviceBusEndpoint property: Endpoint you can use to perform Service Bus operations. - * - * @return the serviceBusEndpoint value. - */ - public String serviceBusEndpoint() { - return this.innerProperties() == null ? null : this.innerProperties().serviceBusEndpoint(); - } - - /** - * Get the clusterArmId property: Cluster ARM ID of the Namespace. - * - * @return the clusterArmId value. - */ - public String clusterArmId() { - return this.innerProperties() == null ? null : this.innerProperties().clusterArmId(); - } - - /** - * Set the clusterArmId property: Cluster ARM ID of the Namespace. - * - * @param clusterArmId the clusterArmId value to set. - * @return the EHNamespaceInner object itself. - */ - public EHNamespaceInner withClusterArmId(String clusterArmId) { - if (this.innerProperties() == null) { - this.innerProperties = new EHNamespaceProperties(); - } - this.innerProperties().withClusterArmId(clusterArmId); - return this; - } - - /** - * Get the metricId property: Identifier for Azure Insights metrics. - * - * @return the metricId value. - */ - public String metricId() { - return this.innerProperties() == null ? null : this.innerProperties().metricId(); - } - - /** - * Get the isAutoInflateEnabled property: Value that indicates whether AutoInflate is enabled for eventhub - * namespace. - * - * @return the isAutoInflateEnabled value. - */ - public Boolean isAutoInflateEnabled() { - return this.innerProperties() == null ? null : this.innerProperties().isAutoInflateEnabled(); - } - - /** - * Set the isAutoInflateEnabled property: Value that indicates whether AutoInflate is enabled for eventhub - * namespace. - * - * @param isAutoInflateEnabled the isAutoInflateEnabled value to set. - * @return the EHNamespaceInner object itself. - */ - public EHNamespaceInner withIsAutoInflateEnabled(Boolean isAutoInflateEnabled) { - if (this.innerProperties() == null) { - this.innerProperties = new EHNamespaceProperties(); - } - this.innerProperties().withIsAutoInflateEnabled(isAutoInflateEnabled); - return this; - } - - /** - * Get the maximumThroughputUnits property: Upper limit of throughput units when AutoInflate is enabled, value - * should be within 0 to 20 throughput units. ( '0' if AutoInflateEnabled = true). - * - * @return the maximumThroughputUnits value. - */ - public Integer maximumThroughputUnits() { - return this.innerProperties() == null ? null : this.innerProperties().maximumThroughputUnits(); - } - - /** - * Set the maximumThroughputUnits property: Upper limit of throughput units when AutoInflate is enabled, value - * should be within 0 to 20 throughput units. ( '0' if AutoInflateEnabled = true). - * - * @param maximumThroughputUnits the maximumThroughputUnits value to set. - * @return the EHNamespaceInner object itself. - */ - public EHNamespaceInner withMaximumThroughputUnits(Integer maximumThroughputUnits) { - if (this.innerProperties() == null) { - this.innerProperties = new EHNamespaceProperties(); - } - this.innerProperties().withMaximumThroughputUnits(maximumThroughputUnits); - return this; - } - - /** - * Get the kafkaEnabled property: Value that indicates whether Kafka is enabled for eventhub namespace. - * - * @return the kafkaEnabled value. - */ - public Boolean kafkaEnabled() { - return this.innerProperties() == null ? null : this.innerProperties().kafkaEnabled(); - } - - /** - * Set the kafkaEnabled property: Value that indicates whether Kafka is enabled for eventhub namespace. - * - * @param kafkaEnabled the kafkaEnabled value to set. - * @return the EHNamespaceInner object itself. - */ - public EHNamespaceInner withKafkaEnabled(Boolean kafkaEnabled) { - if (this.innerProperties() == null) { - this.innerProperties = new EHNamespaceProperties(); - } - this.innerProperties().withKafkaEnabled(kafkaEnabled); - return this; - } - - /** - * Get the zoneRedundant property: Enabling this property creates a Standard Event Hubs Namespace in regions - * supported availability zones. - * - * @return the zoneRedundant value. - */ - public Boolean zoneRedundant() { - return this.innerProperties() == null ? null : this.innerProperties().zoneRedundant(); - } - - /** - * Set the zoneRedundant property: Enabling this property creates a Standard Event Hubs Namespace in regions - * supported availability zones. - * - * @param zoneRedundant the zoneRedundant value to set. - * @return the EHNamespaceInner object itself. - */ - public EHNamespaceInner withZoneRedundant(Boolean zoneRedundant) { - if (this.innerProperties() == null) { - this.innerProperties = new EHNamespaceProperties(); - } - this.innerProperties().withZoneRedundant(zoneRedundant); - return this; - } - - /** - * Get the encryption property: Properties of BYOK Encryption description. - * - * @return the encryption value. - */ - public Encryption encryption() { - return this.innerProperties() == null ? null : this.innerProperties().encryption(); - } - - /** - * Set the encryption property: Properties of BYOK Encryption description. - * - * @param encryption the encryption value to set. - * @return the EHNamespaceInner object itself. - */ - public EHNamespaceInner withEncryption(Encryption encryption) { - if (this.innerProperties() == null) { - this.innerProperties = new EHNamespaceProperties(); - } - this.innerProperties().withEncryption(encryption); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (sku() != null) { - sku().validate(); - } - if (identity() != null) { - identity().validate(); - } - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/models/EHNamespaceProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/models/EHNamespaceProperties.java deleted file mode 100644 index f9e78718d9ae..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/models/EHNamespaceProperties.java +++ /dev/null @@ -1,285 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.eventhubs.models.Encryption; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** Namespace properties supplied for create namespace operation. */ -@Fluent -public final class EHNamespaceProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(EHNamespaceProperties.class); - - /* - * Provisioning state of the Namespace. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; - - /* - * Status of the Namespace. - */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) - private String status; - - /* - * The time the Namespace was created. - */ - @JsonProperty(value = "createdAt", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime createdAt; - - /* - * The time the Namespace was updated. - */ - @JsonProperty(value = "updatedAt", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime updatedAt; - - /* - * Endpoint you can use to perform Service Bus operations. - */ - @JsonProperty(value = "serviceBusEndpoint", access = JsonProperty.Access.WRITE_ONLY) - private String serviceBusEndpoint; - - /* - * Cluster ARM ID of the Namespace. - */ - @JsonProperty(value = "clusterArmId") - private String clusterArmId; - - /* - * Identifier for Azure Insights metrics. - */ - @JsonProperty(value = "metricId", access = JsonProperty.Access.WRITE_ONLY) - private String metricId; - - /* - * Value that indicates whether AutoInflate is enabled for eventhub - * namespace. - */ - @JsonProperty(value = "isAutoInflateEnabled") - private Boolean isAutoInflateEnabled; - - /* - * Upper limit of throughput units when AutoInflate is enabled, value - * should be within 0 to 20 throughput units. ( '0' if AutoInflateEnabled = - * true) - */ - @JsonProperty(value = "maximumThroughputUnits") - private Integer maximumThroughputUnits; - - /* - * Value that indicates whether Kafka is enabled for eventhub namespace. - */ - @JsonProperty(value = "kafkaEnabled") - private Boolean kafkaEnabled; - - /* - * Enabling this property creates a Standard Event Hubs Namespace in - * regions supported availability zones. - */ - @JsonProperty(value = "zoneRedundant") - private Boolean zoneRedundant; - - /* - * Properties of BYOK Encryption description - */ - @JsonProperty(value = "encryption") - private Encryption encryption; - - /** - * Get the provisioningState property: Provisioning state of the Namespace. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Get the status property: Status of the Namespace. - * - * @return the status value. - */ - public String status() { - return this.status; - } - - /** - * Get the createdAt property: The time the Namespace was created. - * - * @return the createdAt value. - */ - public OffsetDateTime createdAt() { - return this.createdAt; - } - - /** - * Get the updatedAt property: The time the Namespace was updated. - * - * @return the updatedAt value. - */ - public OffsetDateTime updatedAt() { - return this.updatedAt; - } - - /** - * Get the serviceBusEndpoint property: Endpoint you can use to perform Service Bus operations. - * - * @return the serviceBusEndpoint value. - */ - public String serviceBusEndpoint() { - return this.serviceBusEndpoint; - } - - /** - * Get the clusterArmId property: Cluster ARM ID of the Namespace. - * - * @return the clusterArmId value. - */ - public String clusterArmId() { - return this.clusterArmId; - } - - /** - * Set the clusterArmId property: Cluster ARM ID of the Namespace. - * - * @param clusterArmId the clusterArmId value to set. - * @return the EHNamespaceProperties object itself. - */ - public EHNamespaceProperties withClusterArmId(String clusterArmId) { - this.clusterArmId = clusterArmId; - return this; - } - - /** - * Get the metricId property: Identifier for Azure Insights metrics. - * - * @return the metricId value. - */ - public String metricId() { - return this.metricId; - } - - /** - * Get the isAutoInflateEnabled property: Value that indicates whether AutoInflate is enabled for eventhub - * namespace. - * - * @return the isAutoInflateEnabled value. - */ - public Boolean isAutoInflateEnabled() { - return this.isAutoInflateEnabled; - } - - /** - * Set the isAutoInflateEnabled property: Value that indicates whether AutoInflate is enabled for eventhub - * namespace. - * - * @param isAutoInflateEnabled the isAutoInflateEnabled value to set. - * @return the EHNamespaceProperties object itself. - */ - public EHNamespaceProperties withIsAutoInflateEnabled(Boolean isAutoInflateEnabled) { - this.isAutoInflateEnabled = isAutoInflateEnabled; - return this; - } - - /** - * Get the maximumThroughputUnits property: Upper limit of throughput units when AutoInflate is enabled, value - * should be within 0 to 20 throughput units. ( '0' if AutoInflateEnabled = true). - * - * @return the maximumThroughputUnits value. - */ - public Integer maximumThroughputUnits() { - return this.maximumThroughputUnits; - } - - /** - * Set the maximumThroughputUnits property: Upper limit of throughput units when AutoInflate is enabled, value - * should be within 0 to 20 throughput units. ( '0' if AutoInflateEnabled = true). - * - * @param maximumThroughputUnits the maximumThroughputUnits value to set. - * @return the EHNamespaceProperties object itself. - */ - public EHNamespaceProperties withMaximumThroughputUnits(Integer maximumThroughputUnits) { - this.maximumThroughputUnits = maximumThroughputUnits; - return this; - } - - /** - * Get the kafkaEnabled property: Value that indicates whether Kafka is enabled for eventhub namespace. - * - * @return the kafkaEnabled value. - */ - public Boolean kafkaEnabled() { - return this.kafkaEnabled; - } - - /** - * Set the kafkaEnabled property: Value that indicates whether Kafka is enabled for eventhub namespace. - * - * @param kafkaEnabled the kafkaEnabled value to set. - * @return the EHNamespaceProperties object itself. - */ - public EHNamespaceProperties withKafkaEnabled(Boolean kafkaEnabled) { - this.kafkaEnabled = kafkaEnabled; - return this; - } - - /** - * Get the zoneRedundant property: Enabling this property creates a Standard Event Hubs Namespace in regions - * supported availability zones. - * - * @return the zoneRedundant value. - */ - public Boolean zoneRedundant() { - return this.zoneRedundant; - } - - /** - * Set the zoneRedundant property: Enabling this property creates a Standard Event Hubs Namespace in regions - * supported availability zones. - * - * @param zoneRedundant the zoneRedundant value to set. - * @return the EHNamespaceProperties object itself. - */ - public EHNamespaceProperties withZoneRedundant(Boolean zoneRedundant) { - this.zoneRedundant = zoneRedundant; - return this; - } - - /** - * Get the encryption property: Properties of BYOK Encryption description. - * - * @return the encryption value. - */ - public Encryption encryption() { - return this.encryption; - } - - /** - * Set the encryption property: Properties of BYOK Encryption description. - * - * @param encryption the encryption value to set. - * @return the EHNamespaceProperties object itself. - */ - public EHNamespaceProperties withEncryption(Encryption encryption) { - this.encryption = encryption; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (encryption() != null) { - encryption().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/models/EventhubInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/models/EventhubInner.java deleted file mode 100644 index da1f01950d3b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/models/EventhubInner.java +++ /dev/null @@ -1,170 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.eventhubs.models.CaptureDescription; -import com.azure.resourcemanager.eventhubs.models.EntityStatus; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; - -/** Single item in List or Get Event Hub operation. */ -@Fluent -public final class EventhubInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(EventhubInner.class); - - /* - * Properties supplied to the Create Or Update Event Hub operation. - */ - @JsonProperty(value = "properties") - private EventhubProperties innerProperties; - - /** - * Get the innerProperties property: Properties supplied to the Create Or Update Event Hub operation. - * - * @return the innerProperties value. - */ - private EventhubProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the partitionIds property: Current number of shards on the Event Hub. - * - * @return the partitionIds value. - */ - public List partitionIds() { - return this.innerProperties() == null ? null : this.innerProperties().partitionIds(); - } - - /** - * Get the createdAt property: Exact time the Event Hub was created. - * - * @return the createdAt value. - */ - public OffsetDateTime createdAt() { - return this.innerProperties() == null ? null : this.innerProperties().createdAt(); - } - - /** - * Get the updatedAt property: The exact time the message was updated. - * - * @return the updatedAt value. - */ - public OffsetDateTime updatedAt() { - return this.innerProperties() == null ? null : this.innerProperties().updatedAt(); - } - - /** - * Get the messageRetentionInDays property: Number of days to retain the events for this Event Hub, value should be - * 1 to 7 days. - * - * @return the messageRetentionInDays value. - */ - public Long messageRetentionInDays() { - return this.innerProperties() == null ? null : this.innerProperties().messageRetentionInDays(); - } - - /** - * Set the messageRetentionInDays property: Number of days to retain the events for this Event Hub, value should be - * 1 to 7 days. - * - * @param messageRetentionInDays the messageRetentionInDays value to set. - * @return the EventhubInner object itself. - */ - public EventhubInner withMessageRetentionInDays(Long messageRetentionInDays) { - if (this.innerProperties() == null) { - this.innerProperties = new EventhubProperties(); - } - this.innerProperties().withMessageRetentionInDays(messageRetentionInDays); - return this; - } - - /** - * Get the partitionCount property: Number of partitions created for the Event Hub, allowed values are from 1 to 32 - * partitions. - * - * @return the partitionCount value. - */ - public Long partitionCount() { - return this.innerProperties() == null ? null : this.innerProperties().partitionCount(); - } - - /** - * Set the partitionCount property: Number of partitions created for the Event Hub, allowed values are from 1 to 32 - * partitions. - * - * @param partitionCount the partitionCount value to set. - * @return the EventhubInner object itself. - */ - public EventhubInner withPartitionCount(Long partitionCount) { - if (this.innerProperties() == null) { - this.innerProperties = new EventhubProperties(); - } - this.innerProperties().withPartitionCount(partitionCount); - return this; - } - - /** - * Get the status property: Enumerates the possible values for the status of the Event Hub. - * - * @return the status value. - */ - public EntityStatus status() { - return this.innerProperties() == null ? null : this.innerProperties().status(); - } - - /** - * Set the status property: Enumerates the possible values for the status of the Event Hub. - * - * @param status the status value to set. - * @return the EventhubInner object itself. - */ - public EventhubInner withStatus(EntityStatus status) { - if (this.innerProperties() == null) { - this.innerProperties = new EventhubProperties(); - } - this.innerProperties().withStatus(status); - return this; - } - - /** - * Get the captureDescription property: Properties of capture description. - * - * @return the captureDescription value. - */ - public CaptureDescription captureDescription() { - return this.innerProperties() == null ? null : this.innerProperties().captureDescription(); - } - - /** - * Set the captureDescription property: Properties of capture description. - * - * @param captureDescription the captureDescription value to set. - * @return the EventhubInner object itself. - */ - public EventhubInner withCaptureDescription(CaptureDescription captureDescription) { - if (this.innerProperties() == null) { - this.innerProperties = new EventhubProperties(); - } - this.innerProperties().withCaptureDescription(captureDescription); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/models/EventhubProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/models/EventhubProperties.java deleted file mode 100644 index 9c211fff60d7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/models/EventhubProperties.java +++ /dev/null @@ -1,186 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.eventhubs.models.CaptureDescription; -import com.azure.resourcemanager.eventhubs.models.EntityStatus; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; - -/** Properties supplied to the Create Or Update Event Hub operation. */ -@Fluent -public final class EventhubProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(EventhubProperties.class); - - /* - * Current number of shards on the Event Hub. - */ - @JsonProperty(value = "partitionIds", access = JsonProperty.Access.WRITE_ONLY) - private List partitionIds; - - /* - * Exact time the Event Hub was created. - */ - @JsonProperty(value = "createdAt", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime createdAt; - - /* - * The exact time the message was updated. - */ - @JsonProperty(value = "updatedAt", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime updatedAt; - - /* - * Number of days to retain the events for this Event Hub, value should be - * 1 to 7 days - */ - @JsonProperty(value = "messageRetentionInDays") - private Long messageRetentionInDays; - - /* - * Number of partitions created for the Event Hub, allowed values are from - * 1 to 32 partitions. - */ - @JsonProperty(value = "partitionCount") - private Long partitionCount; - - /* - * Enumerates the possible values for the status of the Event Hub. - */ - @JsonProperty(value = "status") - private EntityStatus status; - - /* - * Properties of capture description - */ - @JsonProperty(value = "captureDescription") - private CaptureDescription captureDescription; - - /** - * Get the partitionIds property: Current number of shards on the Event Hub. - * - * @return the partitionIds value. - */ - public List partitionIds() { - return this.partitionIds; - } - - /** - * Get the createdAt property: Exact time the Event Hub was created. - * - * @return the createdAt value. - */ - public OffsetDateTime createdAt() { - return this.createdAt; - } - - /** - * Get the updatedAt property: The exact time the message was updated. - * - * @return the updatedAt value. - */ - public OffsetDateTime updatedAt() { - return this.updatedAt; - } - - /** - * Get the messageRetentionInDays property: Number of days to retain the events for this Event Hub, value should be - * 1 to 7 days. - * - * @return the messageRetentionInDays value. - */ - public Long messageRetentionInDays() { - return this.messageRetentionInDays; - } - - /** - * Set the messageRetentionInDays property: Number of days to retain the events for this Event Hub, value should be - * 1 to 7 days. - * - * @param messageRetentionInDays the messageRetentionInDays value to set. - * @return the EventhubProperties object itself. - */ - public EventhubProperties withMessageRetentionInDays(Long messageRetentionInDays) { - this.messageRetentionInDays = messageRetentionInDays; - return this; - } - - /** - * Get the partitionCount property: Number of partitions created for the Event Hub, allowed values are from 1 to 32 - * partitions. - * - * @return the partitionCount value. - */ - public Long partitionCount() { - return this.partitionCount; - } - - /** - * Set the partitionCount property: Number of partitions created for the Event Hub, allowed values are from 1 to 32 - * partitions. - * - * @param partitionCount the partitionCount value to set. - * @return the EventhubProperties object itself. - */ - public EventhubProperties withPartitionCount(Long partitionCount) { - this.partitionCount = partitionCount; - return this; - } - - /** - * Get the status property: Enumerates the possible values for the status of the Event Hub. - * - * @return the status value. - */ - public EntityStatus status() { - return this.status; - } - - /** - * Set the status property: Enumerates the possible values for the status of the Event Hub. - * - * @param status the status value to set. - * @return the EventhubProperties object itself. - */ - public EventhubProperties withStatus(EntityStatus status) { - this.status = status; - return this; - } - - /** - * Get the captureDescription property: Properties of capture description. - * - * @return the captureDescription value. - */ - public CaptureDescription captureDescription() { - return this.captureDescription; - } - - /** - * Set the captureDescription property: Properties of capture description. - * - * @param captureDescription the captureDescription value to set. - * @return the EventhubProperties object itself. - */ - public EventhubProperties withCaptureDescription(CaptureDescription captureDescription) { - this.captureDescription = captureDescription; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (captureDescription() != null) { - captureDescription().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/models/MessagingRegionsInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/models/MessagingRegionsInner.java deleted file mode 100644 index f0f95b9cbd0f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/models/MessagingRegionsInner.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.eventhubs.models.MessagingRegionsProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** Messaging Region. */ -@Fluent -public final class MessagingRegionsInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MessagingRegionsInner.class); - - /* - * Properties of Messaging Region - */ - @JsonProperty(value = "properties") - private MessagingRegionsProperties properties; - - /** - * Get the properties property: Properties of Messaging Region. - * - * @return the properties value. - */ - public MessagingRegionsProperties properties() { - return this.properties; - } - - /** - * Set the properties property: Properties of Messaging Region. - * - * @param properties the properties value to set. - * @return the MessagingRegionsInner object itself. - */ - public MessagingRegionsInner withProperties(MessagingRegionsProperties properties) { - this.properties = properties; - return this; - } - - /** {@inheritDoc} */ - @Override - public MessagingRegionsInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public MessagingRegionsInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/models/NetworkRuleSetInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/models/NetworkRuleSetInner.java deleted file mode 100644 index de0a690d1b3c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/models/NetworkRuleSetInner.java +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.eventhubs.models.DefaultAction; -import com.azure.resourcemanager.eventhubs.models.NWRuleSetIpRules; -import com.azure.resourcemanager.eventhubs.models.NWRuleSetVirtualNetworkRules; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Description of NetworkRuleSet resource. */ -@Fluent -public final class NetworkRuleSetInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkRuleSetInner.class); - - /* - * NetworkRuleSet properties - */ - @JsonProperty(value = "properties") - private NetworkRuleSetProperties innerProperties; - - /** - * Get the innerProperties property: NetworkRuleSet properties. - * - * @return the innerProperties value. - */ - private NetworkRuleSetProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the defaultAction property: Default Action for Network Rule Set. - * - * @return the defaultAction value. - */ - public DefaultAction defaultAction() { - return this.innerProperties() == null ? null : this.innerProperties().defaultAction(); - } - - /** - * Set the defaultAction property: Default Action for Network Rule Set. - * - * @param defaultAction the defaultAction value to set. - * @return the NetworkRuleSetInner object itself. - */ - public NetworkRuleSetInner withDefaultAction(DefaultAction defaultAction) { - if (this.innerProperties() == null) { - this.innerProperties = new NetworkRuleSetProperties(); - } - this.innerProperties().withDefaultAction(defaultAction); - return this; - } - - /** - * Get the virtualNetworkRules property: List VirtualNetwork Rules. - * - * @return the virtualNetworkRules value. - */ - public List virtualNetworkRules() { - return this.innerProperties() == null ? null : this.innerProperties().virtualNetworkRules(); - } - - /** - * Set the virtualNetworkRules property: List VirtualNetwork Rules. - * - * @param virtualNetworkRules the virtualNetworkRules value to set. - * @return the NetworkRuleSetInner object itself. - */ - public NetworkRuleSetInner withVirtualNetworkRules(List virtualNetworkRules) { - if (this.innerProperties() == null) { - this.innerProperties = new NetworkRuleSetProperties(); - } - this.innerProperties().withVirtualNetworkRules(virtualNetworkRules); - return this; - } - - /** - * Get the ipRules property: List of IpRules. - * - * @return the ipRules value. - */ - public List ipRules() { - return this.innerProperties() == null ? null : this.innerProperties().ipRules(); - } - - /** - * Set the ipRules property: List of IpRules. - * - * @param ipRules the ipRules value to set. - * @return the NetworkRuleSetInner object itself. - */ - public NetworkRuleSetInner withIpRules(List ipRules) { - if (this.innerProperties() == null) { - this.innerProperties = new NetworkRuleSetProperties(); - } - this.innerProperties().withIpRules(ipRules); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/models/NetworkRuleSetProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/models/NetworkRuleSetProperties.java deleted file mode 100644 index 1a6c46e306cb..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/models/NetworkRuleSetProperties.java +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.eventhubs.models.DefaultAction; -import com.azure.resourcemanager.eventhubs.models.NWRuleSetIpRules; -import com.azure.resourcemanager.eventhubs.models.NWRuleSetVirtualNetworkRules; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** NetworkRuleSet properties. */ -@Fluent -public final class NetworkRuleSetProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkRuleSetProperties.class); - - /* - * Default Action for Network Rule Set - */ - @JsonProperty(value = "defaultAction") - private DefaultAction defaultAction; - - /* - * List VirtualNetwork Rules - */ - @JsonProperty(value = "virtualNetworkRules") - private List virtualNetworkRules; - - /* - * List of IpRules - */ - @JsonProperty(value = "ipRules") - private List ipRules; - - /** - * Get the defaultAction property: Default Action for Network Rule Set. - * - * @return the defaultAction value. - */ - public DefaultAction defaultAction() { - return this.defaultAction; - } - - /** - * Set the defaultAction property: Default Action for Network Rule Set. - * - * @param defaultAction the defaultAction value to set. - * @return the NetworkRuleSetProperties object itself. - */ - public NetworkRuleSetProperties withDefaultAction(DefaultAction defaultAction) { - this.defaultAction = defaultAction; - return this; - } - - /** - * Get the virtualNetworkRules property: List VirtualNetwork Rules. - * - * @return the virtualNetworkRules value. - */ - public List virtualNetworkRules() { - return this.virtualNetworkRules; - } - - /** - * Set the virtualNetworkRules property: List VirtualNetwork Rules. - * - * @param virtualNetworkRules the virtualNetworkRules value to set. - * @return the NetworkRuleSetProperties object itself. - */ - public NetworkRuleSetProperties withVirtualNetworkRules(List virtualNetworkRules) { - this.virtualNetworkRules = virtualNetworkRules; - return this; - } - - /** - * Get the ipRules property: List of IpRules. - * - * @return the ipRules value. - */ - public List ipRules() { - return this.ipRules; - } - - /** - * Set the ipRules property: List of IpRules. - * - * @param ipRules the ipRules value to set. - * @return the NetworkRuleSetProperties object itself. - */ - public NetworkRuleSetProperties withIpRules(List ipRules) { - this.ipRules = ipRules; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (virtualNetworkRules() != null) { - virtualNetworkRules().forEach(e -> e.validate()); - } - if (ipRules() != null) { - ipRules().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/models/OperationInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/models/OperationInner.java deleted file mode 100644 index 0707e159d7a2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/models/OperationInner.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.eventhubs.models.OperationDisplay; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** A Event Hub REST API operation. */ -@Fluent -public final class OperationInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationInner.class); - - /* - * Operation name: {provider}/{resource}/{operation} - */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) - private String name; - - /* - * The object that represents the operation. - */ - @JsonProperty(value = "display") - private OperationDisplay display; - - /** - * Get the name property: Operation name: {provider}/{resource}/{operation}. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the display property: The object that represents the operation. - * - * @return the display value. - */ - public OperationDisplay display() { - return this.display; - } - - /** - * Set the display property: The object that represents the operation. - * - * @param display the display value to set. - * @return the OperationInner object itself. - */ - public OperationInner withDisplay(OperationDisplay display) { - this.display = display; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (display() != null) { - display().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/models/PrivateEndpointConnectionInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/models/PrivateEndpointConnectionInner.java deleted file mode 100644 index 29090d43661f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/models/PrivateEndpointConnectionInner.java +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.eventhubs.models.ConnectionState; -import com.azure.resourcemanager.eventhubs.models.EndPointProvisioningState; -import com.azure.resourcemanager.eventhubs.models.PrivateEndpoint; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Properties of the PrivateEndpointConnection. */ -@Fluent -public final class PrivateEndpointConnectionInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionInner.class); - - /* - * Properties of the PrivateEndpointConnection. - */ - @JsonProperty(value = "properties") - private PrivateEndpointConnectionProperties innerProperties; - - /** - * Get the innerProperties property: Properties of the PrivateEndpointConnection. - * - * @return the innerProperties value. - */ - private PrivateEndpointConnectionProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the privateEndpoint property: The Private Endpoint resource for this Connection. - * - * @return the privateEndpoint value. - */ - public PrivateEndpoint privateEndpoint() { - return this.innerProperties() == null ? null : this.innerProperties().privateEndpoint(); - } - - /** - * Set the privateEndpoint property: The Private Endpoint resource for this Connection. - * - * @param privateEndpoint the privateEndpoint value to set. - * @return the PrivateEndpointConnectionInner object itself. - */ - public PrivateEndpointConnectionInner withPrivateEndpoint(PrivateEndpoint privateEndpoint) { - if (this.innerProperties() == null) { - this.innerProperties = new PrivateEndpointConnectionProperties(); - } - this.innerProperties().withPrivateEndpoint(privateEndpoint); - return this; - } - - /** - * Get the privateLinkServiceConnectionState property: Details about the state of the connection. - * - * @return the privateLinkServiceConnectionState value. - */ - public ConnectionState privateLinkServiceConnectionState() { - return this.innerProperties() == null ? null : this.innerProperties().privateLinkServiceConnectionState(); - } - - /** - * Set the privateLinkServiceConnectionState property: Details about the state of the connection. - * - * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. - * @return the PrivateEndpointConnectionInner object itself. - */ - public PrivateEndpointConnectionInner withPrivateLinkServiceConnectionState( - ConnectionState privateLinkServiceConnectionState) { - if (this.innerProperties() == null) { - this.innerProperties = new PrivateEndpointConnectionProperties(); - } - this.innerProperties().withPrivateLinkServiceConnectionState(privateLinkServiceConnectionState); - return this; - } - - /** - * Get the provisioningState property: Provisioning state of the Private Endpoint Connection. - * - * @return the provisioningState value. - */ - public EndPointProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Set the provisioningState property: Provisioning state of the Private Endpoint Connection. - * - * @param provisioningState the provisioningState value to set. - * @return the PrivateEndpointConnectionInner object itself. - */ - public PrivateEndpointConnectionInner withProvisioningState(EndPointProvisioningState provisioningState) { - if (this.innerProperties() == null) { - this.innerProperties = new PrivateEndpointConnectionProperties(); - } - this.innerProperties().withProvisioningState(provisioningState); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/models/PrivateEndpointConnectionProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/models/PrivateEndpointConnectionProperties.java deleted file mode 100644 index 8ff27b225fb3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/models/PrivateEndpointConnectionProperties.java +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.eventhubs.models.ConnectionState; -import com.azure.resourcemanager.eventhubs.models.EndPointProvisioningState; -import com.azure.resourcemanager.eventhubs.models.PrivateEndpoint; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Properties of the private endpoint connection resource. */ -@Fluent -public final class PrivateEndpointConnectionProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionProperties.class); - - /* - * The Private Endpoint resource for this Connection. - */ - @JsonProperty(value = "privateEndpoint") - private PrivateEndpoint privateEndpoint; - - /* - * Details about the state of the connection. - */ - @JsonProperty(value = "privateLinkServiceConnectionState") - private ConnectionState privateLinkServiceConnectionState; - - /* - * Provisioning state of the Private Endpoint Connection. - */ - @JsonProperty(value = "provisioningState") - private EndPointProvisioningState provisioningState; - - /** - * Get the privateEndpoint property: The Private Endpoint resource for this Connection. - * - * @return the privateEndpoint value. - */ - public PrivateEndpoint privateEndpoint() { - return this.privateEndpoint; - } - - /** - * Set the privateEndpoint property: The Private Endpoint resource for this Connection. - * - * @param privateEndpoint the privateEndpoint value to set. - * @return the PrivateEndpointConnectionProperties object itself. - */ - public PrivateEndpointConnectionProperties withPrivateEndpoint(PrivateEndpoint privateEndpoint) { - this.privateEndpoint = privateEndpoint; - return this; - } - - /** - * Get the privateLinkServiceConnectionState property: Details about the state of the connection. - * - * @return the privateLinkServiceConnectionState value. - */ - public ConnectionState privateLinkServiceConnectionState() { - return this.privateLinkServiceConnectionState; - } - - /** - * Set the privateLinkServiceConnectionState property: Details about the state of the connection. - * - * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. - * @return the PrivateEndpointConnectionProperties object itself. - */ - public PrivateEndpointConnectionProperties withPrivateLinkServiceConnectionState( - ConnectionState privateLinkServiceConnectionState) { - this.privateLinkServiceConnectionState = privateLinkServiceConnectionState; - return this; - } - - /** - * Get the provisioningState property: Provisioning state of the Private Endpoint Connection. - * - * @return the provisioningState value. - */ - public EndPointProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Set the provisioningState property: Provisioning state of the Private Endpoint Connection. - * - * @param provisioningState the provisioningState value to set. - * @return the PrivateEndpointConnectionProperties object itself. - */ - public PrivateEndpointConnectionProperties withProvisioningState(EndPointProvisioningState provisioningState) { - this.provisioningState = provisioningState; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (privateEndpoint() != null) { - privateEndpoint().validate(); - } - if (privateLinkServiceConnectionState() != null) { - privateLinkServiceConnectionState().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/models/PrivateLinkResourceProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/models/PrivateLinkResourceProperties.java deleted file mode 100644 index 64cb72b01258..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/models/PrivateLinkResourceProperties.java +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Properties of PrivateLinkResource. */ -@Fluent -public final class PrivateLinkResourceProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkResourceProperties.class); - - /* - * The private link resource group id. - */ - @JsonProperty(value = "groupId") - private String groupId; - - /* - * The private link resource required member names. - */ - @JsonProperty(value = "requiredMembers") - private List requiredMembers; - - /* - * The private link resource Private link DNS zone name. - */ - @JsonProperty(value = "requiredZoneNames") - private List requiredZoneNames; - - /** - * Get the groupId property: The private link resource group id. - * - * @return the groupId value. - */ - public String groupId() { - return this.groupId; - } - - /** - * Set the groupId property: The private link resource group id. - * - * @param groupId the groupId value to set. - * @return the PrivateLinkResourceProperties object itself. - */ - public PrivateLinkResourceProperties withGroupId(String groupId) { - this.groupId = groupId; - return this; - } - - /** - * Get the requiredMembers property: The private link resource required member names. - * - * @return the requiredMembers value. - */ - public List requiredMembers() { - return this.requiredMembers; - } - - /** - * Set the requiredMembers property: The private link resource required member names. - * - * @param requiredMembers the requiredMembers value to set. - * @return the PrivateLinkResourceProperties object itself. - */ - public PrivateLinkResourceProperties withRequiredMembers(List requiredMembers) { - this.requiredMembers = requiredMembers; - return this; - } - - /** - * Get the requiredZoneNames property: The private link resource Private link DNS zone name. - * - * @return the requiredZoneNames value. - */ - public List requiredZoneNames() { - return this.requiredZoneNames; - } - - /** - * Set the requiredZoneNames property: The private link resource Private link DNS zone name. - * - * @param requiredZoneNames the requiredZoneNames value to set. - * @return the PrivateLinkResourceProperties object itself. - */ - public PrivateLinkResourceProperties withRequiredZoneNames(List requiredZoneNames) { - this.requiredZoneNames = requiredZoneNames; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/models/PrivateLinkResourcesListResultInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/models/PrivateLinkResourcesListResultInner.java deleted file mode 100644 index 811d4ac6f6e3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/models/PrivateLinkResourcesListResultInner.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.eventhubs.models.PrivateLinkResource; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Result of the List private link resources operation. */ -@Fluent -public final class PrivateLinkResourcesListResultInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkResourcesListResultInner.class); - - /* - * A collection of private link resources - */ - @JsonProperty(value = "value") - private List value; - - /* - * A link for the next page of private link resources. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: A collection of private link resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: A collection of private link resources. - * - * @param value the value value to set. - * @return the PrivateLinkResourcesListResultInner object itself. - */ - public PrivateLinkResourcesListResultInner withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: A link for the next page of private link resources. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: A link for the next page of private link resources. - * - * @param nextLink the nextLink value to set. - * @return the PrivateLinkResourcesListResultInner object itself. - */ - public PrivateLinkResourcesListResultInner withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/models/package-info.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/models/package-info.java deleted file mode 100644 index 22245ea59b27..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/models/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** - * Package containing the inner data models for EventHubManagementClient. Azure Event Hubs client for managing Event - * Hubs Cluster, IPFilter Rules and VirtualNetworkRules resources. - */ -package com.azure.resourcemanager.eventhubs.fluent.models; diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/package-info.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/package-info.java deleted file mode 100644 index 6aaa66104d3f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** - * Package containing the service clients for EventHubManagementClient. Azure Event Hubs client for managing Event Hubs - * Cluster, IPFilter Rules and VirtualNetworkRules resources. - */ -package com.azure.resourcemanager.eventhubs.fluent; diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/Ancestors.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/Ancestors.java deleted file mode 100644 index 44592e3674d8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/Ancestors.java +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.eventhubs.implementation; - -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceId; - -import java.util.Objects; - -class Ancestors { - - class OneAncestor { - private final String resourceGroupName; - private final String ancestor1Name; - - OneAncestor(String resourceGroupName, String ancestor1Name) { - this.resourceGroupName = Objects.requireNonNull(resourceGroupName); - this.ancestor1Name = Objects.requireNonNull(ancestor1Name); - } - - OneAncestor(ResourceId resourceId) { - Objects.requireNonNull(resourceId); - Objects.requireNonNull(resourceId.parent()); - - this.resourceGroupName = Objects.requireNonNull(resourceId.resourceGroupName()); - this.ancestor1Name = Objects.requireNonNull(resourceId.parent().name()); - } - - OneAncestor(String resourceId) { - this(ResourceId.fromString(Objects.requireNonNull(resourceId))); - } - - public String resourceGroupName() { - return this.resourceGroupName; - } - - public String ancestor1Name() { - return this.ancestor1Name; - } - } - - class TwoAncestor extends OneAncestor { - private final String ancestor2Name; - - TwoAncestor(String resourceGroupName, String ancestor1Name, String ancestor2Name) { - super(resourceGroupName, ancestor1Name); - this.ancestor2Name = Objects.requireNonNull(ancestor2Name); - } - - TwoAncestor(ResourceId resourceId) { - super(resourceId); - Objects.requireNonNull(resourceId.parent().parent()); - - this.ancestor2Name = Objects.requireNonNull(resourceId.parent().parent().name()); - } - - TwoAncestor(String resourceId) { - this(ResourceId.fromString(Objects.requireNonNull(resourceId))); - } - - public String ancestor2Name() { - return this.ancestor2Name; - } - } - - class ThreeAncestor extends TwoAncestor { - private final String ancestor3Name; - - ThreeAncestor(String resourceGroupName, String ancestor1Name, String ancestor2Name, String ancestor3Name) { - super(resourceGroupName, ancestor1Name, ancestor2Name); - - this.ancestor3Name = Objects.requireNonNull(ancestor3Name); - } - - ThreeAncestor(ResourceId resourceId) { - super(resourceId); - Objects.requireNonNull(resourceId.parent().parent().parent()); - - this.ancestor3Name = Objects.requireNonNull(resourceId.parent().parent().parent().name()); - } - - ThreeAncestor(String resourceId) { - this(ResourceId.fromString(Objects.requireNonNull(resourceId))); - } - - public String ancestor3Name() { - return this.ancestor3Name; - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/AuthorizationRuleBaseImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/AuthorizationRuleBaseImpl.java deleted file mode 100644 index 5242aa3ad41e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/AuthorizationRuleBaseImpl.java +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.eventhubs.implementation; - -import com.azure.resourcemanager.eventhubs.EventHubsManager; -import com.azure.resourcemanager.eventhubs.fluent.models.AccessKeysInner; -import com.azure.resourcemanager.eventhubs.fluent.models.AuthorizationRuleInner; -import com.azure.resourcemanager.eventhubs.models.AccessRights; -import com.azure.resourcemanager.eventhubs.models.AuthorizationRule; -import com.azure.resourcemanager.eventhubs.models.EventHubAuthorizationKey; -import com.azure.resourcemanager.eventhubs.models.KeyType; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.IndexableRefreshableWrapperImpl; -import reactor.core.publisher.Mono; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -/** - * Base implementation for authorization rule. - * (Internal use only) - * - * @param rule fluent model - * @param implementation of rule fluent model - */ -abstract class AuthorizationRuleBaseImpl, - RuleImpl extends IndexableRefreshableWrapperImpl> - extends NestedResourceImpl implements AuthorizationRule { - - protected AuthorizationRuleBaseImpl(String name, AuthorizationRuleInner inner, EventHubsManager manager) { - super(name, inner, manager); - } - - @Override - public Mono getKeysAsync() { - return this.getKeysInnerAsync() - .map(EventHubAuthorizationKeyImpl::new); - } - - @Override - public EventHubAuthorizationKey getKeys() { - return getKeysAsync().block(); - } - - @Override - public Mono regenerateKeyAsync(KeyType keyType) { - return this.regenerateKeysInnerAsync(keyType) - .map(EventHubAuthorizationKeyImpl::new); - } - - @Override - public EventHubAuthorizationKey regenerateKey(KeyType keyType) { - return regenerateKeyAsync(keyType).block(); - } - - @Override - public List rights() { - if (this.innerModel().rights() == null) { - return Collections.unmodifiableList(new ArrayList<>()); - } - return Collections.unmodifiableList(this.innerModel().rights()); - } - - - @SuppressWarnings("unchecked") - public RuleImpl withListenAccess() { - if (this.innerModel().rights() == null) { - this.innerModel().withRights(new ArrayList<>()); - } - if (!this.innerModel().rights().contains(AccessRights.LISTEN)) { - this.innerModel().rights().add(AccessRights.LISTEN); - } - return (RuleImpl) this; - } - - @SuppressWarnings("unchecked") - public RuleImpl withSendAccess() { - if (this.innerModel().rights() == null) { - this.innerModel().withRights(new ArrayList<>()); - } - if (!this.innerModel().rights().contains(AccessRights.SEND)) { - this.innerModel().rights().add(AccessRights.SEND); - } - return (RuleImpl) this; - } - - @SuppressWarnings("unchecked") - public RuleImpl withSendAndListenAccess() { - withListenAccess(); - withSendAccess(); - return (RuleImpl) this; - } - - @SuppressWarnings("unchecked") - public RuleImpl withManageAccess() { - withListenAccess(); - withSendAccess(); - if (!this.innerModel().rights().contains(AccessRights.MANAGE)) { - this.innerModel().rights().add(AccessRights.MANAGE); - } - return (RuleImpl) this; - } - - protected abstract Mono getKeysInnerAsync(); - protected abstract Mono regenerateKeysInnerAsync(KeyType keyType); - protected abstract Mono getInnerAsync(); - public abstract Mono createResourceAsync(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/AuthorizationRulesBaseImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/AuthorizationRulesBaseImpl.java deleted file mode 100644 index b1f59436df66..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/AuthorizationRulesBaseImpl.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.eventhubs.implementation; - -import com.azure.resourcemanager.eventhubs.EventHubsManager; -import com.azure.resourcemanager.eventhubs.fluent.models.AuthorizationRuleInner; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingById; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.WrapperImpl; -import reactor.core.publisher.Mono; - -abstract class AuthorizationRulesBaseImpl - extends WrapperImpl - implements HasManager, - SupportsGettingById, - SupportsDeletingById { - - protected final EventHubsManager manager; - - protected AuthorizationRulesBaseImpl(EventHubsManager manager, InnerT inner) { - super(inner); - this.manager = manager; - } - - @Override - public EventHubsManager manager() { - return this.manager; - } - - @Override - public RuleT getById(String id) { - return getByIdAsync(id).block(); - } - - @Override - public void deleteById(String id) { - deleteByIdAsync(id).block(); - } - - protected abstract RuleImpl wrapModel(AuthorizationRuleInner innerModel); - public abstract Mono getByIdAsync(String id); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/ClustersClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/ClustersClientImpl.java deleted file mode 100644 index d30578b1328e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/ClustersClientImpl.java +++ /dev/null @@ -1,1587 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.eventhubs.fluent.ClustersClient; -import com.azure.resourcemanager.eventhubs.fluent.models.AvailableClustersListInner; -import com.azure.resourcemanager.eventhubs.fluent.models.ClusterInner; -import com.azure.resourcemanager.eventhubs.fluent.models.EHNamespaceIdListResultInner; -import com.azure.resourcemanager.eventhubs.models.ClusterListResult; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ClustersClient. */ -public final class ClustersClientImpl - implements InnerSupportsGet, InnerSupportsDelete, ClustersClient { - private final ClientLogger logger = new ClientLogger(ClustersClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final ClustersService service; - - /** The service client containing this operation class. */ - private final EventHubManagementClientImpl client; - - /** - * Initializes an instance of ClustersClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ClustersClientImpl(EventHubManagementClientImpl client) { - this.service = RestProxy.create(ClustersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for EventHubManagementClientClusters to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "EventHubManagementCl") - private interface ClustersService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.EventHub/availableClusterRegions") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAvailableClusterRegion( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/clusters") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/clusters" - + "/{clusterName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("clusterName") String clusterName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/clusters" - + "/{clusterName}") - @ExpectedResponses({200, 201, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("clusterName") String clusterName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ClusterInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/clusters" - + "/{clusterName}") - @ExpectedResponses({200, 201, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("clusterName") String clusterName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ClusterInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/clusters" - + "/{clusterName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("clusterName") String clusterName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/clusters" - + "/{clusterName}/namespaces") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNamespaces( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("clusterName") String clusterName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * List the quantity of available pre-provisioned Event Hubs Clusters, indexed by Azure region. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of the List Available Clusters operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listAvailableClusterRegionWithResponseAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listAvailableClusterRegion( - this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List the quantity of available pre-provisioned Event Hubs Clusters, indexed by Azure region. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of the List Available Clusters operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAvailableClusterRegionWithResponseAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listAvailableClusterRegion( - this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context); - } - - /** - * List the quantity of available pre-provisioned Event Hubs Clusters, indexed by Azure region. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of the List Available Clusters operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listAvailableClusterRegionAsync() { - return listAvailableClusterRegionWithResponseAsync() - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * List the quantity of available pre-provisioned Event Hubs Clusters, indexed by Azure region. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of the List Available Clusters operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AvailableClustersListInner listAvailableClusterRegion() { - return listAvailableClusterRegionAsync().block(); - } - - /** - * List the quantity of available pre-provisioned Event Hubs Clusters, indexed by Azure region. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of the List Available Clusters operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listAvailableClusterRegionWithResponse(Context context) { - return listAvailableClusterRegionWithResponseAsync(context).block(); - } - - /** - * Lists the available Event Hubs Clusters within an ARM resource group. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of the List Event Hubs Clusters operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String apiVersion = "2018-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - apiVersion, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists the available Event Hubs Clusters within an ARM resource group. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of the List Event Hubs Clusters operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String apiVersion = "2018-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - apiVersion, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists the available Event Hubs Clusters within an ARM resource group. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of the List Event Hubs Clusters operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * Lists the available Event Hubs Clusters within an ARM resource group. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of the List Event Hubs Clusters operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists the available Event Hubs Clusters within an ARM resource group. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of the List Event Hubs Clusters operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * Lists the available Event Hubs Clusters within an ARM resource group. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of the List Event Hubs Clusters operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * Gets the resource description of the specified Event Hubs Cluster. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param clusterName The name of the Event Hubs Cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the resource description of the specified Event Hubs Cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String clusterName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - final String apiVersion = "2018-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - clusterName, - apiVersion, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the resource description of the specified Event Hubs Cluster. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param clusterName The name of the Event Hubs Cluster. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the resource description of the specified Event Hubs Cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String clusterName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - final String apiVersion = "2018-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - clusterName, - apiVersion, - accept, - context); - } - - /** - * Gets the resource description of the specified Event Hubs Cluster. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param clusterName The name of the Event Hubs Cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the resource description of the specified Event Hubs Cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync(String resourceGroupName, String clusterName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, clusterName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the resource description of the specified Event Hubs Cluster. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param clusterName The name of the Event Hubs Cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the resource description of the specified Event Hubs Cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ClusterInner getByResourceGroup(String resourceGroupName, String clusterName) { - return getByResourceGroupAsync(resourceGroupName, clusterName).block(); - } - - /** - * Gets the resource description of the specified Event Hubs Cluster. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param clusterName The name of the Event Hubs Cluster. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the resource description of the specified Event Hubs Cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String clusterName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, clusterName, context).block(); - } - - /** - * Creates or updates an instance of an Event Hubs Cluster. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param clusterName The name of the Event Hubs Cluster. - * @param parameters Parameters for creating a eventhub cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single Event Hubs Cluster resource in List or Get operations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String clusterName, ClusterInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - clusterName, - apiVersion, - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates an instance of an Event Hubs Cluster. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param clusterName The name of the Event Hubs Cluster. - * @param parameters Parameters for creating a eventhub cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single Event Hubs Cluster resource in List or Get operations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String clusterName, ClusterInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - clusterName, - apiVersion, - parameters, - accept, - context); - } - - /** - * Creates or updates an instance of an Event Hubs Cluster. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param clusterName The name of the Event Hubs Cluster. - * @param parameters Parameters for creating a eventhub cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single Event Hubs Cluster resource in List or Get operations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, ClusterInner> beginCreateOrUpdateAsync( - String resourceGroupName, String clusterName, ClusterInner parameters) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, clusterName, parameters); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), ClusterInner.class, ClusterInner.class, this.client.getContext()); - } - - /** - * Creates or updates an instance of an Event Hubs Cluster. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param clusterName The name of the Event Hubs Cluster. - * @param parameters Parameters for creating a eventhub cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single Event Hubs Cluster resource in List or Get operations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, ClusterInner> beginCreateOrUpdateAsync( - String resourceGroupName, String clusterName, ClusterInner parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, clusterName, parameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), ClusterInner.class, ClusterInner.class, context); - } - - /** - * Creates or updates an instance of an Event Hubs Cluster. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param clusterName The name of the Event Hubs Cluster. - * @param parameters Parameters for creating a eventhub cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single Event Hubs Cluster resource in List or Get operations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, ClusterInner> beginCreateOrUpdate( - String resourceGroupName, String clusterName, ClusterInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, clusterName, parameters).getSyncPoller(); - } - - /** - * Creates or updates an instance of an Event Hubs Cluster. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param clusterName The name of the Event Hubs Cluster. - * @param parameters Parameters for creating a eventhub cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single Event Hubs Cluster resource in List or Get operations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, ClusterInner> beginCreateOrUpdate( - String resourceGroupName, String clusterName, ClusterInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, clusterName, parameters, context).getSyncPoller(); - } - - /** - * Creates or updates an instance of an Event Hubs Cluster. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param clusterName The name of the Event Hubs Cluster. - * @param parameters Parameters for creating a eventhub cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single Event Hubs Cluster resource in List or Get operations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, String clusterName, ClusterInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, clusterName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates an instance of an Event Hubs Cluster. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param clusterName The name of the Event Hubs Cluster. - * @param parameters Parameters for creating a eventhub cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single Event Hubs Cluster resource in List or Get operations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String clusterName, ClusterInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, clusterName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates an instance of an Event Hubs Cluster. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param clusterName The name of the Event Hubs Cluster. - * @param parameters Parameters for creating a eventhub cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single Event Hubs Cluster resource in List or Get operations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ClusterInner createOrUpdate(String resourceGroupName, String clusterName, ClusterInner parameters) { - return createOrUpdateAsync(resourceGroupName, clusterName, parameters).block(); - } - - /** - * Creates or updates an instance of an Event Hubs Cluster. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param clusterName The name of the Event Hubs Cluster. - * @param parameters Parameters for creating a eventhub cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single Event Hubs Cluster resource in List or Get operations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ClusterInner createOrUpdate( - String resourceGroupName, String clusterName, ClusterInner parameters, Context context) { - return createOrUpdateAsync(resourceGroupName, clusterName, parameters, context).block(); - } - - /** - * Modifies mutable properties on the Event Hubs Cluster. This operation is idempotent. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param clusterName The name of the Event Hubs Cluster. - * @param parameters The properties of the Event Hubs Cluster which should be updated. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single Event Hubs Cluster resource in List or Get operations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateWithResponseAsync( - String resourceGroupName, String clusterName, ClusterInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - clusterName, - apiVersion, - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Modifies mutable properties on the Event Hubs Cluster. This operation is idempotent. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param clusterName The name of the Event Hubs Cluster. - * @param parameters The properties of the Event Hubs Cluster which should be updated. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single Event Hubs Cluster resource in List or Get operations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, String clusterName, ClusterInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - clusterName, - apiVersion, - parameters, - accept, - context); - } - - /** - * Modifies mutable properties on the Event Hubs Cluster. This operation is idempotent. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param clusterName The name of the Event Hubs Cluster. - * @param parameters The properties of the Event Hubs Cluster which should be updated. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single Event Hubs Cluster resource in List or Get operations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, ClusterInner> beginUpdateAsync( - String resourceGroupName, String clusterName, ClusterInner parameters) { - Mono>> mono = updateWithResponseAsync(resourceGroupName, clusterName, parameters); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), ClusterInner.class, ClusterInner.class, this.client.getContext()); - } - - /** - * Modifies mutable properties on the Event Hubs Cluster. This operation is idempotent. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param clusterName The name of the Event Hubs Cluster. - * @param parameters The properties of the Event Hubs Cluster which should be updated. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single Event Hubs Cluster resource in List or Get operations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, ClusterInner> beginUpdateAsync( - String resourceGroupName, String clusterName, ClusterInner parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - updateWithResponseAsync(resourceGroupName, clusterName, parameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), ClusterInner.class, ClusterInner.class, context); - } - - /** - * Modifies mutable properties on the Event Hubs Cluster. This operation is idempotent. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param clusterName The name of the Event Hubs Cluster. - * @param parameters The properties of the Event Hubs Cluster which should be updated. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single Event Hubs Cluster resource in List or Get operations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, ClusterInner> beginUpdate( - String resourceGroupName, String clusterName, ClusterInner parameters) { - return beginUpdateAsync(resourceGroupName, clusterName, parameters).getSyncPoller(); - } - - /** - * Modifies mutable properties on the Event Hubs Cluster. This operation is idempotent. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param clusterName The name of the Event Hubs Cluster. - * @param parameters The properties of the Event Hubs Cluster which should be updated. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single Event Hubs Cluster resource in List or Get operations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, ClusterInner> beginUpdate( - String resourceGroupName, String clusterName, ClusterInner parameters, Context context) { - return beginUpdateAsync(resourceGroupName, clusterName, parameters, context).getSyncPoller(); - } - - /** - * Modifies mutable properties on the Event Hubs Cluster. This operation is idempotent. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param clusterName The name of the Event Hubs Cluster. - * @param parameters The properties of the Event Hubs Cluster which should be updated. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single Event Hubs Cluster resource in List or Get operations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync(String resourceGroupName, String clusterName, ClusterInner parameters) { - return beginUpdateAsync(resourceGroupName, clusterName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Modifies mutable properties on the Event Hubs Cluster. This operation is idempotent. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param clusterName The name of the Event Hubs Cluster. - * @param parameters The properties of the Event Hubs Cluster which should be updated. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single Event Hubs Cluster resource in List or Get operations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, String clusterName, ClusterInner parameters, Context context) { - return beginUpdateAsync(resourceGroupName, clusterName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Modifies mutable properties on the Event Hubs Cluster. This operation is idempotent. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param clusterName The name of the Event Hubs Cluster. - * @param parameters The properties of the Event Hubs Cluster which should be updated. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single Event Hubs Cluster resource in List or Get operations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ClusterInner update(String resourceGroupName, String clusterName, ClusterInner parameters) { - return updateAsync(resourceGroupName, clusterName, parameters).block(); - } - - /** - * Modifies mutable properties on the Event Hubs Cluster. This operation is idempotent. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param clusterName The name of the Event Hubs Cluster. - * @param parameters The properties of the Event Hubs Cluster which should be updated. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single Event Hubs Cluster resource in List or Get operations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ClusterInner update(String resourceGroupName, String clusterName, ClusterInner parameters, Context context) { - return updateAsync(resourceGroupName, clusterName, parameters, context).block(); - } - - /** - * Deletes an existing Event Hubs Cluster. This operation is idempotent. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param clusterName The name of the Event Hubs Cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync(String resourceGroupName, String clusterName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - final String apiVersion = "2018-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - clusterName, - apiVersion, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes an existing Event Hubs Cluster. This operation is idempotent. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param clusterName The name of the Event Hubs Cluster. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String clusterName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - final String apiVersion = "2018-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - clusterName, - apiVersion, - accept, - context); - } - - /** - * Deletes an existing Event Hubs Cluster. This operation is idempotent. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param clusterName The name of the Event Hubs Cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deletes an existing Event Hubs Cluster. This operation is idempotent. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param clusterName The name of the Event Hubs Cluster. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String clusterName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes an existing Event Hubs Cluster. This operation is idempotent. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param clusterName The name of the Event Hubs Cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName) { - return beginDeleteAsync(resourceGroupName, clusterName).getSyncPoller(); - } - - /** - * Deletes an existing Event Hubs Cluster. This operation is idempotent. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param clusterName The name of the Event Hubs Cluster. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String clusterName, Context context) { - return beginDeleteAsync(resourceGroupName, clusterName, context).getSyncPoller(); - } - - /** - * Deletes an existing Event Hubs Cluster. This operation is idempotent. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param clusterName The name of the Event Hubs Cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String clusterName) { - return beginDeleteAsync(resourceGroupName, clusterName).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes an existing Event Hubs Cluster. This operation is idempotent. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param clusterName The name of the Event Hubs Cluster. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String clusterName, Context context) { - return beginDeleteAsync(resourceGroupName, clusterName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes an existing Event Hubs Cluster. This operation is idempotent. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param clusterName The name of the Event Hubs Cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String clusterName) { - deleteAsync(resourceGroupName, clusterName).block(); - } - - /** - * Deletes an existing Event Hubs Cluster. This operation is idempotent. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param clusterName The name of the Event Hubs Cluster. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String clusterName, Context context) { - deleteAsync(resourceGroupName, clusterName, context).block(); - } - - /** - * List all Event Hubs Namespace IDs in an Event Hubs Dedicated Cluster. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param clusterName The name of the Event Hubs Cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of the List Namespace IDs operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listNamespacesWithResponseAsync( - String resourceGroupName, String clusterName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - final String apiVersion = "2018-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listNamespaces( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - clusterName, - apiVersion, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List all Event Hubs Namespace IDs in an Event Hubs Dedicated Cluster. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param clusterName The name of the Event Hubs Cluster. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of the List Namespace IDs operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNamespacesWithResponseAsync( - String resourceGroupName, String clusterName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - final String apiVersion = "2018-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNamespaces( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - clusterName, - apiVersion, - accept, - context); - } - - /** - * List all Event Hubs Namespace IDs in an Event Hubs Dedicated Cluster. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param clusterName The name of the Event Hubs Cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of the List Namespace IDs operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listNamespacesAsync(String resourceGroupName, String clusterName) { - return listNamespacesWithResponseAsync(resourceGroupName, clusterName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * List all Event Hubs Namespace IDs in an Event Hubs Dedicated Cluster. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param clusterName The name of the Event Hubs Cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of the List Namespace IDs operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public EHNamespaceIdListResultInner listNamespaces(String resourceGroupName, String clusterName) { - return listNamespacesAsync(resourceGroupName, clusterName).block(); - } - - /** - * List all Event Hubs Namespace IDs in an Event Hubs Dedicated Cluster. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param clusterName The name of the Event Hubs Cluster. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of the List Namespace IDs operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listNamespacesWithResponse( - String resourceGroupName, String clusterName, Context context) { - return listNamespacesWithResponseAsync(resourceGroupName, clusterName, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of the List Event Hubs Clusters operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of the List Event Hubs Clusters operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/ConsumerGroupsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/ConsumerGroupsClientImpl.java deleted file mode 100644 index 4b48349cae36..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/ConsumerGroupsClientImpl.java +++ /dev/null @@ -1,1079 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.eventhubs.fluent.ConsumerGroupsClient; -import com.azure.resourcemanager.eventhubs.fluent.models.ConsumerGroupInner; -import com.azure.resourcemanager.eventhubs.models.ConsumerGroupListResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ConsumerGroupsClient. */ -public final class ConsumerGroupsClientImpl implements ConsumerGroupsClient { - private final ClientLogger logger = new ClientLogger(ConsumerGroupsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final ConsumerGroupsService service; - - /** The service client containing this operation class. */ - private final EventHubManagementClientImpl client; - - /** - * Initializes an instance of ConsumerGroupsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ConsumerGroupsClientImpl(EventHubManagementClientImpl client) { - this.service = - RestProxy.create(ConsumerGroupsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for EventHubManagementClientConsumerGroups to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "EventHubManagementCl") - private interface ConsumerGroupsService { - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces" - + "/{namespaceName}/eventhubs/{eventHubName}/consumergroups/{consumerGroupName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("namespaceName") String namespaceName, - @PathParam("eventHubName") String eventHubName, - @PathParam("consumerGroupName") String consumerGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") ConsumerGroupInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces" - + "/{namespaceName}/eventhubs/{eventHubName}/consumergroups/{consumerGroupName}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("namespaceName") String namespaceName, - @PathParam("eventHubName") String eventHubName, - @PathParam("consumerGroupName") String consumerGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces" - + "/{namespaceName}/eventhubs/{eventHubName}/consumergroups/{consumerGroupName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("namespaceName") String namespaceName, - @PathParam("eventHubName") String eventHubName, - @PathParam("consumerGroupName") String consumerGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces" - + "/{namespaceName}/eventhubs/{eventHubName}/consumergroups") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByEventHub( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("namespaceName") String namespaceName, - @PathParam("eventHubName") String eventHubName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("$skip") Integer skip, - @QueryParam("$top") Integer top, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByEventHubNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Creates or updates an Event Hubs consumer group as a nested resource within a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param consumerGroupName The consumer group name. - * @param parameters Parameters supplied to create or update a consumer group resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single item in List or Get Consumer group operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, - String namespaceName, - String eventHubName, - String consumerGroupName, - ConsumerGroupInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (eventHubName == null) { - return Mono.error(new IllegalArgumentException("Parameter eventHubName is required and cannot be null.")); - } - if (consumerGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter consumerGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - eventHubName, - consumerGroupName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates an Event Hubs consumer group as a nested resource within a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param consumerGroupName The consumer group name. - * @param parameters Parameters supplied to create or update a consumer group resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single item in List or Get Consumer group operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, - String namespaceName, - String eventHubName, - String consumerGroupName, - ConsumerGroupInner parameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (eventHubName == null) { - return Mono.error(new IllegalArgumentException("Parameter eventHubName is required and cannot be null.")); - } - if (consumerGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter consumerGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - eventHubName, - consumerGroupName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Creates or updates an Event Hubs consumer group as a nested resource within a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param consumerGroupName The consumer group name. - * @param parameters Parameters supplied to create or update a consumer group resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single item in List or Get Consumer group operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, - String namespaceName, - String eventHubName, - String consumerGroupName, - ConsumerGroupInner parameters) { - return createOrUpdateWithResponseAsync( - resourceGroupName, namespaceName, eventHubName, consumerGroupName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates or updates an Event Hubs consumer group as a nested resource within a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param consumerGroupName The consumer group name. - * @param parameters Parameters supplied to create or update a consumer group resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single item in List or Get Consumer group operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ConsumerGroupInner createOrUpdate( - String resourceGroupName, - String namespaceName, - String eventHubName, - String consumerGroupName, - ConsumerGroupInner parameters) { - return createOrUpdateAsync(resourceGroupName, namespaceName, eventHubName, consumerGroupName, parameters) - .block(); - } - - /** - * Creates or updates an Event Hubs consumer group as a nested resource within a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param consumerGroupName The consumer group name. - * @param parameters Parameters supplied to create or update a consumer group resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single item in List or Get Consumer group operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceGroupName, - String namespaceName, - String eventHubName, - String consumerGroupName, - ConsumerGroupInner parameters, - Context context) { - return createOrUpdateWithResponseAsync( - resourceGroupName, namespaceName, eventHubName, consumerGroupName, parameters, context) - .block(); - } - - /** - * Deletes a consumer group from the specified Event Hub and resource group. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param consumerGroupName The consumer group name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync( - String resourceGroupName, String namespaceName, String eventHubName, String consumerGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (eventHubName == null) { - return Mono.error(new IllegalArgumentException("Parameter eventHubName is required and cannot be null.")); - } - if (consumerGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter consumerGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - eventHubName, - consumerGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a consumer group from the specified Event Hub and resource group. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param consumerGroupName The consumer group name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, - String namespaceName, - String eventHubName, - String consumerGroupName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (eventHubName == null) { - return Mono.error(new IllegalArgumentException("Parameter eventHubName is required and cannot be null.")); - } - if (consumerGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter consumerGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - eventHubName, - consumerGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Deletes a consumer group from the specified Event Hub and resource group. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param consumerGroupName The consumer group name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync( - String resourceGroupName, String namespaceName, String eventHubName, String consumerGroupName) { - return deleteWithResponseAsync(resourceGroupName, namespaceName, eventHubName, consumerGroupName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes a consumer group from the specified Event Hub and resource group. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param consumerGroupName The consumer group name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String namespaceName, String eventHubName, String consumerGroupName) { - deleteAsync(resourceGroupName, namespaceName, eventHubName, consumerGroupName).block(); - } - - /** - * Deletes a consumer group from the specified Event Hub and resource group. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param consumerGroupName The consumer group name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse( - String resourceGroupName, - String namespaceName, - String eventHubName, - String consumerGroupName, - Context context) { - return deleteWithResponseAsync(resourceGroupName, namespaceName, eventHubName, consumerGroupName, context) - .block(); - } - - /** - * Gets a description for the specified consumer group. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param consumerGroupName The consumer group name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a description for the specified consumer group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String resourceGroupName, String namespaceName, String eventHubName, String consumerGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (eventHubName == null) { - return Mono.error(new IllegalArgumentException("Parameter eventHubName is required and cannot be null.")); - } - if (consumerGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter consumerGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - eventHubName, - consumerGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a description for the specified consumer group. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param consumerGroupName The consumer group name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a description for the specified consumer group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, - String namespaceName, - String eventHubName, - String consumerGroupName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (eventHubName == null) { - return Mono.error(new IllegalArgumentException("Parameter eventHubName is required and cannot be null.")); - } - if (consumerGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter consumerGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - eventHubName, - consumerGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets a description for the specified consumer group. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param consumerGroupName The consumer group name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a description for the specified consumer group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync( - String resourceGroupName, String namespaceName, String eventHubName, String consumerGroupName) { - return getWithResponseAsync(resourceGroupName, namespaceName, eventHubName, consumerGroupName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a description for the specified consumer group. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param consumerGroupName The consumer group name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a description for the specified consumer group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ConsumerGroupInner get( - String resourceGroupName, String namespaceName, String eventHubName, String consumerGroupName) { - return getAsync(resourceGroupName, namespaceName, eventHubName, consumerGroupName).block(); - } - - /** - * Gets a description for the specified consumer group. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param consumerGroupName The consumer group name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a description for the specified consumer group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, - String namespaceName, - String eventHubName, - String consumerGroupName, - Context context) { - return getWithResponseAsync(resourceGroupName, namespaceName, eventHubName, consumerGroupName, context).block(); - } - - /** - * Gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group exists in the - * Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains - * a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting - * point to use for subsequent calls. - * @param top May be used to limit the number of results to the most recent N usageDetails. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the consumer groups in a Namespace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByEventHubSinglePageAsync( - String resourceGroupName, String namespaceName, String eventHubName, Integer skip, Integer top) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (eventHubName == null) { - return Mono.error(new IllegalArgumentException("Parameter eventHubName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByEventHub( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - eventHubName, - apiVersion, - this.client.getSubscriptionId(), - skip, - top, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group exists in the - * Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains - * a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting - * point to use for subsequent calls. - * @param top May be used to limit the number of results to the most recent N usageDetails. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the consumer groups in a Namespace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByEventHubSinglePageAsync( - String resourceGroupName, - String namespaceName, - String eventHubName, - Integer skip, - Integer top, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (eventHubName == null) { - return Mono.error(new IllegalArgumentException("Parameter eventHubName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByEventHub( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - eventHubName, - apiVersion, - this.client.getSubscriptionId(), - skip, - top, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group exists in the - * Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains - * a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting - * point to use for subsequent calls. - * @param top May be used to limit the number of results to the most recent N usageDetails. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the consumer groups in a Namespace. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByEventHubAsync( - String resourceGroupName, String namespaceName, String eventHubName, Integer skip, Integer top) { - return new PagedFlux<>( - () -> listByEventHubSinglePageAsync(resourceGroupName, namespaceName, eventHubName, skip, top), - nextLink -> listByEventHubNextSinglePageAsync(nextLink)); - } - - /** - * Gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group exists in the - * Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the consumer groups in a Namespace. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByEventHubAsync( - String resourceGroupName, String namespaceName, String eventHubName) { - final Integer skip = null; - final Integer top = null; - return new PagedFlux<>( - () -> listByEventHubSinglePageAsync(resourceGroupName, namespaceName, eventHubName, skip, top), - nextLink -> listByEventHubNextSinglePageAsync(nextLink)); - } - - /** - * Gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group exists in the - * Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains - * a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting - * point to use for subsequent calls. - * @param top May be used to limit the number of results to the most recent N usageDetails. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the consumer groups in a Namespace. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByEventHubAsync( - String resourceGroupName, - String namespaceName, - String eventHubName, - Integer skip, - Integer top, - Context context) { - return new PagedFlux<>( - () -> listByEventHubSinglePageAsync(resourceGroupName, namespaceName, eventHubName, skip, top, context), - nextLink -> listByEventHubNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group exists in the - * Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the consumer groups in a Namespace. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByEventHub( - String resourceGroupName, String namespaceName, String eventHubName) { - final Integer skip = null; - final Integer top = null; - return new PagedIterable<>(listByEventHubAsync(resourceGroupName, namespaceName, eventHubName, skip, top)); - } - - /** - * Gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group exists in the - * Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains - * a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting - * point to use for subsequent calls. - * @param top May be used to limit the number of results to the most recent N usageDetails. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the consumer groups in a Namespace. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByEventHub( - String resourceGroupName, - String namespaceName, - String eventHubName, - Integer skip, - Integer top, - Context context) { - return new PagedIterable<>( - listByEventHubAsync(resourceGroupName, namespaceName, eventHubName, skip, top, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result to the List Consumer Group operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByEventHubNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByEventHubNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result to the List Consumer Group operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByEventHubNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByEventHubNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/DisasterRecoveryConfigsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/DisasterRecoveryConfigsClientImpl.java deleted file mode 100644 index d329c17bd43a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/DisasterRecoveryConfigsClientImpl.java +++ /dev/null @@ -1,2135 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.eventhubs.fluent.DisasterRecoveryConfigsClient; -import com.azure.resourcemanager.eventhubs.fluent.models.AccessKeysInner; -import com.azure.resourcemanager.eventhubs.fluent.models.ArmDisasterRecoveryInner; -import com.azure.resourcemanager.eventhubs.fluent.models.AuthorizationRuleInner; -import com.azure.resourcemanager.eventhubs.fluent.models.CheckNameAvailabilityResultInner; -import com.azure.resourcemanager.eventhubs.models.ArmDisasterRecoveryListResult; -import com.azure.resourcemanager.eventhubs.models.AuthorizationRuleListResult; -import com.azure.resourcemanager.eventhubs.models.CheckNameAvailabilityParameter; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in DisasterRecoveryConfigsClient. */ -public final class DisasterRecoveryConfigsClientImpl implements DisasterRecoveryConfigsClient { - private final ClientLogger logger = new ClientLogger(DisasterRecoveryConfigsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final DisasterRecoveryConfigsService service; - - /** The service client containing this operation class. */ - private final EventHubManagementClientImpl client; - - /** - * Initializes an instance of DisasterRecoveryConfigsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - DisasterRecoveryConfigsClientImpl(EventHubManagementClientImpl client) { - this.service = - RestProxy - .create(DisasterRecoveryConfigsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for EventHubManagementClientDisasterRecoveryConfigs to be used by the - * proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "EventHubManagementCl") - private interface DisasterRecoveryConfigsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces" - + "/{namespaceName}/disasterRecoveryConfigs/{alias}/authorizationRules") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAuthorizationRules( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("namespaceName") String namespaceName, - @PathParam("alias") String alias, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces" - + "/{namespaceName}/disasterRecoveryConfigs/{alias}/authorizationRules/{authorizationRuleName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getAuthorizationRule( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("namespaceName") String namespaceName, - @PathParam("alias") String alias, - @PathParam("authorizationRuleName") String authorizationRuleName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces" - + "/{namespaceName}/disasterRecoveryConfigs/{alias}/authorizationRules/{authorizationRuleName}" - + "/listKeys") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listKeys( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("namespaceName") String namespaceName, - @PathParam("alias") String alias, - @PathParam("authorizationRuleName") String authorizationRuleName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces" - + "/{namespaceName}/disasterRecoveryConfigs/checkNameAvailability") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> checkNameAvailability( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("namespaceName") String namespaceName, - @BodyParam("application/json") CheckNameAvailabilityParameter parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces" - + "/{namespaceName}/disasterRecoveryConfigs") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("namespaceName") String namespaceName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces" - + "/{namespaceName}/disasterRecoveryConfigs/{alias}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("namespaceName") String namespaceName, - @PathParam("alias") String alias, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") ArmDisasterRecoveryInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces" - + "/{namespaceName}/disasterRecoveryConfigs/{alias}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("namespaceName") String namespaceName, - @PathParam("alias") String alias, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces" - + "/{namespaceName}/disasterRecoveryConfigs/{alias}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("namespaceName") String namespaceName, - @PathParam("alias") String alias, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces" - + "/{namespaceName}/disasterRecoveryConfigs/{alias}/breakPairing") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> breakPairing( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("namespaceName") String namespaceName, - @PathParam("alias") String alias, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces" - + "/{namespaceName}/disasterRecoveryConfigs/{alias}/failover") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> failOver( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("namespaceName") String namespaceName, - @PathParam("alias") String alias, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAuthorizationRulesNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets a list of authorization rules for a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param alias The Disaster Recovery configuration name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of authorization rules for a Namespace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAuthorizationRulesSinglePageAsync( - String resourceGroupName, String namespaceName, String alias) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (alias == null) { - return Mono.error(new IllegalArgumentException("Parameter alias is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listAuthorizationRules( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - alias, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a list of authorization rules for a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param alias The Disaster Recovery configuration name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of authorization rules for a Namespace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAuthorizationRulesSinglePageAsync( - String resourceGroupName, String namespaceName, String alias, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (alias == null) { - return Mono.error(new IllegalArgumentException("Parameter alias is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listAuthorizationRules( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - alias, - apiVersion, - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets a list of authorization rules for a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param alias The Disaster Recovery configuration name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of authorization rules for a Namespace. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAuthorizationRulesAsync( - String resourceGroupName, String namespaceName, String alias) { - return new PagedFlux<>( - () -> listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, alias), - nextLink -> listAuthorizationRulesNextSinglePageAsync(nextLink)); - } - - /** - * Gets a list of authorization rules for a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param alias The Disaster Recovery configuration name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of authorization rules for a Namespace. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAuthorizationRulesAsync( - String resourceGroupName, String namespaceName, String alias, Context context) { - return new PagedFlux<>( - () -> listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, alias, context), - nextLink -> listAuthorizationRulesNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets a list of authorization rules for a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param alias The Disaster Recovery configuration name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of authorization rules for a Namespace. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAuthorizationRules( - String resourceGroupName, String namespaceName, String alias) { - return new PagedIterable<>(listAuthorizationRulesAsync(resourceGroupName, namespaceName, alias)); - } - - /** - * Gets a list of authorization rules for a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param alias The Disaster Recovery configuration name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of authorization rules for a Namespace. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAuthorizationRules( - String resourceGroupName, String namespaceName, String alias, Context context) { - return new PagedIterable<>(listAuthorizationRulesAsync(resourceGroupName, namespaceName, alias, context)); - } - - /** - * Gets an AuthorizationRule for a Namespace by rule name. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param alias The Disaster Recovery configuration name. - * @param authorizationRuleName The authorization rule name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an AuthorizationRule for a Namespace by rule name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getAuthorizationRuleWithResponseAsync( - String resourceGroupName, String namespaceName, String alias, String authorizationRuleName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (alias == null) { - return Mono.error(new IllegalArgumentException("Parameter alias is required and cannot be null.")); - } - if (authorizationRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getAuthorizationRule( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - alias, - authorizationRuleName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets an AuthorizationRule for a Namespace by rule name. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param alias The Disaster Recovery configuration name. - * @param authorizationRuleName The authorization rule name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an AuthorizationRule for a Namespace by rule name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getAuthorizationRuleWithResponseAsync( - String resourceGroupName, String namespaceName, String alias, String authorizationRuleName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (alias == null) { - return Mono.error(new IllegalArgumentException("Parameter alias is required and cannot be null.")); - } - if (authorizationRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getAuthorizationRule( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - alias, - authorizationRuleName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets an AuthorizationRule for a Namespace by rule name. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param alias The Disaster Recovery configuration name. - * @param authorizationRuleName The authorization rule name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an AuthorizationRule for a Namespace by rule name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAuthorizationRuleAsync( - String resourceGroupName, String namespaceName, String alias, String authorizationRuleName) { - return getAuthorizationRuleWithResponseAsync(resourceGroupName, namespaceName, alias, authorizationRuleName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets an AuthorizationRule for a Namespace by rule name. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param alias The Disaster Recovery configuration name. - * @param authorizationRuleName The authorization rule name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an AuthorizationRule for a Namespace by rule name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AuthorizationRuleInner getAuthorizationRule( - String resourceGroupName, String namespaceName, String alias, String authorizationRuleName) { - return getAuthorizationRuleAsync(resourceGroupName, namespaceName, alias, authorizationRuleName).block(); - } - - /** - * Gets an AuthorizationRule for a Namespace by rule name. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param alias The Disaster Recovery configuration name. - * @param authorizationRuleName The authorization rule name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an AuthorizationRule for a Namespace by rule name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getAuthorizationRuleWithResponse( - String resourceGroupName, String namespaceName, String alias, String authorizationRuleName, Context context) { - return getAuthorizationRuleWithResponseAsync( - resourceGroupName, namespaceName, alias, authorizationRuleName, context) - .block(); - } - - /** - * Gets the primary and secondary connection strings for the Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param alias The Disaster Recovery configuration name. - * @param authorizationRuleName The authorization rule name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the primary and secondary connection strings for the Namespace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listKeysWithResponseAsync( - String resourceGroupName, String namespaceName, String alias, String authorizationRuleName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (alias == null) { - return Mono.error(new IllegalArgumentException("Parameter alias is required and cannot be null.")); - } - if (authorizationRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listKeys( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - alias, - authorizationRuleName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the primary and secondary connection strings for the Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param alias The Disaster Recovery configuration name. - * @param authorizationRuleName The authorization rule name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the primary and secondary connection strings for the Namespace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listKeysWithResponseAsync( - String resourceGroupName, String namespaceName, String alias, String authorizationRuleName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (alias == null) { - return Mono.error(new IllegalArgumentException("Parameter alias is required and cannot be null.")); - } - if (authorizationRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listKeys( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - alias, - authorizationRuleName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets the primary and secondary connection strings for the Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param alias The Disaster Recovery configuration name. - * @param authorizationRuleName The authorization rule name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the primary and secondary connection strings for the Namespace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listKeysAsync( - String resourceGroupName, String namespaceName, String alias, String authorizationRuleName) { - return listKeysWithResponseAsync(resourceGroupName, namespaceName, alias, authorizationRuleName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the primary and secondary connection strings for the Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param alias The Disaster Recovery configuration name. - * @param authorizationRuleName The authorization rule name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the primary and secondary connection strings for the Namespace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AccessKeysInner listKeys( - String resourceGroupName, String namespaceName, String alias, String authorizationRuleName) { - return listKeysAsync(resourceGroupName, namespaceName, alias, authorizationRuleName).block(); - } - - /** - * Gets the primary and secondary connection strings for the Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param alias The Disaster Recovery configuration name. - * @param authorizationRuleName The authorization rule name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the primary and secondary connection strings for the Namespace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listKeysWithResponse( - String resourceGroupName, String namespaceName, String alias, String authorizationRuleName, Context context) { - return listKeysWithResponseAsync(resourceGroupName, namespaceName, alias, authorizationRuleName, context) - .block(); - } - - /** - * Check the give Namespace name availability. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param parameters Parameters to check availability of the given Alias name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Result of the CheckNameAvailability operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> checkNameAvailabilityWithResponseAsync( - String resourceGroupName, String namespaceName, CheckNameAvailabilityParameter parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .checkNameAvailability( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - namespaceName, - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Check the give Namespace name availability. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param parameters Parameters to check availability of the given Alias name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Result of the CheckNameAvailability operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> checkNameAvailabilityWithResponseAsync( - String resourceGroupName, String namespaceName, CheckNameAvailabilityParameter parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .checkNameAvailability( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - namespaceName, - parameters, - accept, - context); - } - - /** - * Check the give Namespace name availability. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param parameters Parameters to check availability of the given Alias name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Result of the CheckNameAvailability operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono checkNameAvailabilityAsync( - String resourceGroupName, String namespaceName, CheckNameAvailabilityParameter parameters) { - return checkNameAvailabilityWithResponseAsync(resourceGroupName, namespaceName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Check the give Namespace name availability. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param parameters Parameters to check availability of the given Alias name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Result of the CheckNameAvailability operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CheckNameAvailabilityResultInner checkNameAvailability( - String resourceGroupName, String namespaceName, CheckNameAvailabilityParameter parameters) { - return checkNameAvailabilityAsync(resourceGroupName, namespaceName, parameters).block(); - } - - /** - * Check the give Namespace name availability. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param parameters Parameters to check availability of the given Alias name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Result of the CheckNameAvailability operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response checkNameAvailabilityWithResponse( - String resourceGroupName, String namespaceName, CheckNameAvailabilityParameter parameters, Context context) { - return checkNameAvailabilityWithResponseAsync(resourceGroupName, namespaceName, parameters, context).block(); - } - - /** - * Gets all Alias(Disaster Recovery configurations). - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all Alias(Disaster Recovery configurations). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String namespaceName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all Alias(Disaster Recovery configurations). - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all Alias(Disaster Recovery configurations). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String namespaceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all Alias(Disaster Recovery configurations). - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all Alias(Disaster Recovery configurations). - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String resourceGroupName, String namespaceName) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, namespaceName), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets all Alias(Disaster Recovery configurations). - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all Alias(Disaster Recovery configurations). - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String namespaceName, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, namespaceName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all Alias(Disaster Recovery configurations). - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all Alias(Disaster Recovery configurations). - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String namespaceName) { - return new PagedIterable<>(listAsync(resourceGroupName, namespaceName)); - } - - /** - * Gets all Alias(Disaster Recovery configurations). - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all Alias(Disaster Recovery configurations). - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, String namespaceName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, namespaceName, context)); - } - - /** - * Creates or updates a new Alias(Disaster Recovery configuration). - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param alias The Disaster Recovery configuration name. - * @param parameters Parameters required to create an Alias(Disaster Recovery configuration). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single item in List or Get Alias(Disaster Recovery configuration) operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String namespaceName, String alias, ArmDisasterRecoveryInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (alias == null) { - return Mono.error(new IllegalArgumentException("Parameter alias is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - alias, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a new Alias(Disaster Recovery configuration). - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param alias The Disaster Recovery configuration name. - * @param parameters Parameters required to create an Alias(Disaster Recovery configuration). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single item in List or Get Alias(Disaster Recovery configuration) operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, - String namespaceName, - String alias, - ArmDisasterRecoveryInner parameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (alias == null) { - return Mono.error(new IllegalArgumentException("Parameter alias is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - alias, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Creates or updates a new Alias(Disaster Recovery configuration). - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param alias The Disaster Recovery configuration name. - * @param parameters Parameters required to create an Alias(Disaster Recovery configuration). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single item in List or Get Alias(Disaster Recovery configuration) operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, String namespaceName, String alias, ArmDisasterRecoveryInner parameters) { - return createOrUpdateWithResponseAsync(resourceGroupName, namespaceName, alias, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates or updates a new Alias(Disaster Recovery configuration). - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param alias The Disaster Recovery configuration name. - * @param parameters Parameters required to create an Alias(Disaster Recovery configuration). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single item in List or Get Alias(Disaster Recovery configuration) operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ArmDisasterRecoveryInner createOrUpdate( - String resourceGroupName, String namespaceName, String alias, ArmDisasterRecoveryInner parameters) { - return createOrUpdateAsync(resourceGroupName, namespaceName, alias, parameters).block(); - } - - /** - * Creates or updates a new Alias(Disaster Recovery configuration). - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param alias The Disaster Recovery configuration name. - * @param parameters Parameters required to create an Alias(Disaster Recovery configuration). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single item in List or Get Alias(Disaster Recovery configuration) operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceGroupName, - String namespaceName, - String alias, - ArmDisasterRecoveryInner parameters, - Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, namespaceName, alias, parameters, context).block(); - } - - /** - * Deletes an Alias(Disaster Recovery configuration). - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param alias The Disaster Recovery configuration name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String resourceGroupName, String namespaceName, String alias) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (alias == null) { - return Mono.error(new IllegalArgumentException("Parameter alias is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - alias, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes an Alias(Disaster Recovery configuration). - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param alias The Disaster Recovery configuration name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String namespaceName, String alias, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (alias == null) { - return Mono.error(new IllegalArgumentException("Parameter alias is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - alias, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Deletes an Alias(Disaster Recovery configuration). - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param alias The Disaster Recovery configuration name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String namespaceName, String alias) { - return deleteWithResponseAsync(resourceGroupName, namespaceName, alias) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes an Alias(Disaster Recovery configuration). - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param alias The Disaster Recovery configuration name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String namespaceName, String alias) { - deleteAsync(resourceGroupName, namespaceName, alias).block(); - } - - /** - * Deletes an Alias(Disaster Recovery configuration). - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param alias The Disaster Recovery configuration name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse( - String resourceGroupName, String namespaceName, String alias, Context context) { - return deleteWithResponseAsync(resourceGroupName, namespaceName, alias, context).block(); - } - - /** - * Retrieves Alias(Disaster Recovery configuration) for primary or secondary namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param alias The Disaster Recovery configuration name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single item in List or Get Alias(Disaster Recovery configuration) operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String resourceGroupName, String namespaceName, String alias) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (alias == null) { - return Mono.error(new IllegalArgumentException("Parameter alias is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - alias, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Retrieves Alias(Disaster Recovery configuration) for primary or secondary namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param alias The Disaster Recovery configuration name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single item in List or Get Alias(Disaster Recovery configuration) operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String namespaceName, String alias, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (alias == null) { - return Mono.error(new IllegalArgumentException("Parameter alias is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - alias, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Retrieves Alias(Disaster Recovery configuration) for primary or secondary namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param alias The Disaster Recovery configuration name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single item in List or Get Alias(Disaster Recovery configuration) operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync(String resourceGroupName, String namespaceName, String alias) { - return getWithResponseAsync(resourceGroupName, namespaceName, alias) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Retrieves Alias(Disaster Recovery configuration) for primary or secondary namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param alias The Disaster Recovery configuration name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single item in List or Get Alias(Disaster Recovery configuration) operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ArmDisasterRecoveryInner get(String resourceGroupName, String namespaceName, String alias) { - return getAsync(resourceGroupName, namespaceName, alias).block(); - } - - /** - * Retrieves Alias(Disaster Recovery configuration) for primary or secondary namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param alias The Disaster Recovery configuration name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single item in List or Get Alias(Disaster Recovery configuration) operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String namespaceName, String alias, Context context) { - return getWithResponseAsync(resourceGroupName, namespaceName, alias, context).block(); - } - - /** - * This operation disables the Disaster Recovery and stops replicating changes from primary to secondary namespaces. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param alias The Disaster Recovery configuration name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> breakPairingWithResponseAsync( - String resourceGroupName, String namespaceName, String alias) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (alias == null) { - return Mono.error(new IllegalArgumentException("Parameter alias is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .breakPairing( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - alias, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * This operation disables the Disaster Recovery and stops replicating changes from primary to secondary namespaces. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param alias The Disaster Recovery configuration name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> breakPairingWithResponseAsync( - String resourceGroupName, String namespaceName, String alias, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (alias == null) { - return Mono.error(new IllegalArgumentException("Parameter alias is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .breakPairing( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - alias, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * This operation disables the Disaster Recovery and stops replicating changes from primary to secondary namespaces. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param alias The Disaster Recovery configuration name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono breakPairingAsync(String resourceGroupName, String namespaceName, String alias) { - return breakPairingWithResponseAsync(resourceGroupName, namespaceName, alias) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * This operation disables the Disaster Recovery and stops replicating changes from primary to secondary namespaces. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param alias The Disaster Recovery configuration name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void breakPairing(String resourceGroupName, String namespaceName, String alias) { - breakPairingAsync(resourceGroupName, namespaceName, alias).block(); - } - - /** - * This operation disables the Disaster Recovery and stops replicating changes from primary to secondary namespaces. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param alias The Disaster Recovery configuration name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response breakPairingWithResponse( - String resourceGroupName, String namespaceName, String alias, Context context) { - return breakPairingWithResponseAsync(resourceGroupName, namespaceName, alias, context).block(); - } - - /** - * Invokes GEO DR failover and reconfigure the alias to point to the secondary namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param alias The Disaster Recovery configuration name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> failOverWithResponseAsync( - String resourceGroupName, String namespaceName, String alias) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (alias == null) { - return Mono.error(new IllegalArgumentException("Parameter alias is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .failOver( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - alias, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Invokes GEO DR failover and reconfigure the alias to point to the secondary namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param alias The Disaster Recovery configuration name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> failOverWithResponseAsync( - String resourceGroupName, String namespaceName, String alias, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (alias == null) { - return Mono.error(new IllegalArgumentException("Parameter alias is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .failOver( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - alias, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Invokes GEO DR failover and reconfigure the alias to point to the secondary namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param alias The Disaster Recovery configuration name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono failOverAsync(String resourceGroupName, String namespaceName, String alias) { - return failOverWithResponseAsync(resourceGroupName, namespaceName, alias) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Invokes GEO DR failover and reconfigure the alias to point to the secondary namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param alias The Disaster Recovery configuration name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void failOver(String resourceGroupName, String namespaceName, String alias) { - failOverAsync(resourceGroupName, namespaceName, alias).block(); - } - - /** - * Invokes GEO DR failover and reconfigure the alias to point to the secondary namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param alias The Disaster Recovery configuration name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response failOverWithResponse( - String resourceGroupName, String namespaceName, String alias, Context context) { - return failOverWithResponseAsync(resourceGroupName, namespaceName, alias, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the List namespace operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAuthorizationRulesNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listAuthorizationRulesNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the List namespace operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAuthorizationRulesNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listAuthorizationRulesNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of the List Alias(Disaster Recovery configuration) operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of the List Alias(Disaster Recovery configuration) operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/DisasterRecoveryPairingAuthorizationKeyImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/DisasterRecoveryPairingAuthorizationKeyImpl.java deleted file mode 100644 index 1fe0d206e8ba..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/DisasterRecoveryPairingAuthorizationKeyImpl.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.eventhubs.implementation; - -import com.azure.resourcemanager.eventhubs.fluent.models.AccessKeysInner; -import com.azure.resourcemanager.eventhubs.models.DisasterRecoveryPairingAuthorizationKey; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.WrapperImpl; - -/** - * Implementation for {@link DisasterRecoveryPairingAuthorizationKey}. - */ -class DisasterRecoveryPairingAuthorizationKeyImpl - extends WrapperImpl - implements DisasterRecoveryPairingAuthorizationKey { - - DisasterRecoveryPairingAuthorizationKeyImpl(AccessKeysInner inner) { - super(inner); - } - - @Override - public String primaryKey() { - return this.innerModel().primaryKey(); - } - - @Override - public String secondaryKey() { - return this.innerModel().secondaryKey(); - } - - @Override - public String primaryConnectionString() { - return this.innerModel().primaryConnectionString(); - } - - @Override - public String secondaryConnectionString() { - return this.innerModel().secondaryConnectionString(); - } - - @Override - public String aliasPrimaryConnectionString() { - return this.innerModel().aliasPrimaryConnectionString(); - } - - @Override - public String aliasSecondaryConnectionString() { - return this.innerModel().aliasSecondaryConnectionString(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/DisasterRecoveryPairingAuthorizationRuleImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/DisasterRecoveryPairingAuthorizationRuleImpl.java deleted file mode 100644 index 8cf423f75f69..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/DisasterRecoveryPairingAuthorizationRuleImpl.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.eventhubs.implementation; - -import com.azure.resourcemanager.eventhubs.EventHubsManager; -import com.azure.resourcemanager.eventhubs.fluent.models.AuthorizationRuleInner; -import com.azure.resourcemanager.eventhubs.models.AccessRights; -import com.azure.resourcemanager.eventhubs.models.DisasterRecoveryPairingAuthorizationKey; -import com.azure.resourcemanager.eventhubs.models.DisasterRecoveryPairingAuthorizationRule; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.WrapperImpl; -import reactor.core.publisher.Mono; - -import java.util.List; -import java.util.Objects; - -/** - * Implementation for {@link DisasterRecoveryPairingAuthorizationRule}. - */ -class DisasterRecoveryPairingAuthorizationRuleImpl - extends WrapperImpl - implements DisasterRecoveryPairingAuthorizationRule { - - private final EventHubsManager manager; - private final Ancestors.TwoAncestor ancestor; - - protected DisasterRecoveryPairingAuthorizationRuleImpl(AuthorizationRuleInner inner, EventHubsManager manager) { - super(inner); - this.manager = manager; - this.ancestor = new Ancestors().new TwoAncestor(inner.id()); - } - - @Override - public String name() { - return this.innerModel().name(); - } - - @Override - public List rights() { - return this.innerModel().rights(); - } - - @Override - public Mono getKeysAsync() { - return this.manager.serviceClient().getDisasterRecoveryConfigs() - .listKeysAsync(this.ancestor().resourceGroupName(), - this.ancestor.ancestor2Name(), - this.ancestor().ancestor1Name(), - this.name()) - .map(DisasterRecoveryPairingAuthorizationKeyImpl::new); - } - - @Override - public DisasterRecoveryPairingAuthorizationKey getKeys() { - return this.getKeysAsync().block(); - } - - @Override - public EventHubsManager manager() { - return this.manager; - } - - private Ancestors.TwoAncestor ancestor() { - Objects.requireNonNull(this.ancestor); - return this.ancestor; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/DisasterRecoveryPairingAuthorizationRulesImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/DisasterRecoveryPairingAuthorizationRulesImpl.java deleted file mode 100644 index 320032e5a269..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/DisasterRecoveryPairingAuthorizationRulesImpl.java +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.eventhubs.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.eventhubs.EventHubsManager; -import com.azure.resourcemanager.eventhubs.fluent.DisasterRecoveryConfigsClient; -import com.azure.resourcemanager.eventhubs.fluent.models.AuthorizationRuleInner; -import com.azure.resourcemanager.eventhubs.models.DisasterRecoveryPairingAuthorizationRule; -import com.azure.resourcemanager.eventhubs.models.DisasterRecoveryPairingAuthorizationRules; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceId; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.ReadableWrappersImpl; -import reactor.core.publisher.Mono; -import com.azure.resourcemanager.resources.fluentcore.utils.PagedConverter; - -/** - * Implementation for {@link DisasterRecoveryPairingAuthorizationRules}. - */ -public final class DisasterRecoveryPairingAuthorizationRulesImpl - extends ReadableWrappersImpl - implements DisasterRecoveryPairingAuthorizationRules { - - private final EventHubsManager manager; - - public DisasterRecoveryPairingAuthorizationRulesImpl(EventHubsManager manager) { - this.manager = manager; - } - - @Override - public PagedIterable listByDisasterRecoveryPairing( - String resourceGroupName, String namespaceName, String pairingName) { - return PagedConverter.mapPage(inner() - .listAuthorizationRules(resourceGroupName, namespaceName, pairingName), - this::wrapModel); - } - - @Override - public PagedFlux listByDisasterRecoveryPairingAsync( - String resourceGroupName, String namespaceName, String pairingName) { - return PagedConverter.mapPage(inner() - .listAuthorizationRulesAsync(resourceGroupName, namespaceName, pairingName), - this::wrapModel); - } - - @Override - public Mono getByNameAsync( - String resourceGroupName, String namespaceName, String pairingName, String name) { - return this.manager.serviceClient().getDisasterRecoveryConfigs().getAuthorizationRuleAsync(resourceGroupName, - namespaceName, - pairingName, - name) - .map(this::wrapModel); - } - - @Override - public DisasterRecoveryPairingAuthorizationRule getByName( - String resourceGroupName, String namespaceName, String pairingName, String name) { - return getByNameAsync(resourceGroupName, namespaceName, pairingName, name).block(); - } - - @Override - public DisasterRecoveryPairingAuthorizationRule getById(String id) { - return getByIdAsync(id).block(); - } - - @Override - public Mono getByIdAsync(String id) { - ResourceId resourceId = ResourceId.fromString(id); - return this.getByNameAsync(resourceId.resourceGroupName(), - resourceId.parent().name(), - resourceId.parent().parent().name(), - resourceId.name()); - } - - @Override - public EventHubsManager manager() { - return this.manager; - } - - public DisasterRecoveryConfigsClient inner() { - return this.manager.serviceClient().getDisasterRecoveryConfigs(); - } - - @Override - protected DisasterRecoveryPairingAuthorizationRuleImpl wrapModel(AuthorizationRuleInner inner) { - return new DisasterRecoveryPairingAuthorizationRuleImpl(inner, manager); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/EventHubAuthorizationKeyImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/EventHubAuthorizationKeyImpl.java deleted file mode 100644 index 3368f1f6785e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/EventHubAuthorizationKeyImpl.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.eventhubs.implementation; - -import com.azure.resourcemanager.eventhubs.fluent.models.AccessKeysInner; -import com.azure.resourcemanager.eventhubs.models.EventHubAuthorizationKey; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.WrapperImpl; - -/** - * Implementation for AuthorizationKeys. - */ -class EventHubAuthorizationKeyImpl - extends WrapperImpl - implements EventHubAuthorizationKey { - - EventHubAuthorizationKeyImpl(AccessKeysInner inner) { - super(inner); - } - - @Override - public String primaryKey() { - return this.innerModel().primaryKey(); - } - - @Override - public String secondaryKey() { - return this.innerModel().secondaryKey(); - } - - @Override - public String primaryConnectionString() { - return this.innerModel().primaryConnectionString(); - } - - @Override - public String secondaryConnectionString() { - return this.innerModel().secondaryConnectionString(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/EventHubAuthorizationRuleImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/EventHubAuthorizationRuleImpl.java deleted file mode 100644 index 97cd186824e8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/EventHubAuthorizationRuleImpl.java +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.eventhubs.implementation; - -import com.azure.resourcemanager.eventhubs.EventHubsManager; -import com.azure.resourcemanager.eventhubs.fluent.models.AccessKeysInner; -import com.azure.resourcemanager.eventhubs.fluent.models.AuthorizationRuleInner; -import com.azure.resourcemanager.eventhubs.models.EventHub; -import com.azure.resourcemanager.eventhubs.models.EventHubAuthorizationRule; -import com.azure.resourcemanager.eventhubs.models.KeyType; -import com.azure.resourcemanager.eventhubs.models.RegenerateAccessKeyParameters; -import reactor.core.publisher.Mono; - -import java.util.Objects; - -/** - * Implementation for {@link EventHubAuthorizationRule}. - */ -class EventHubAuthorizationRuleImpl extends AuthorizationRuleBaseImpl - implements - EventHubAuthorizationRule, - EventHubAuthorizationRule.Definition, - EventHubAuthorizationRule.Update { - - private Ancestors.TwoAncestor ancestor; - - EventHubAuthorizationRuleImpl(String name, AuthorizationRuleInner inner, EventHubsManager manager) { - super(name, inner, manager); - this.ancestor = new Ancestors().new TwoAncestor(inner.id()); - } - - EventHubAuthorizationRuleImpl(String name, EventHubsManager manager) { - super(name, new AuthorizationRuleInner(), manager); - } - - @Override - public String namespaceResourceGroupName() { - return this.ancestor().resourceGroupName(); - } - - @Override - public String namespaceName() { - return this.ancestor().ancestor2Name(); - } - - @Override - public String eventHubName() { - return this.ancestor().ancestor1Name(); - } - - @Override - public EventHubAuthorizationRuleImpl withExistingEventHubId(String eventHubResourceId) { - this.ancestor = new Ancestors().new TwoAncestor(selfId(eventHubResourceId)); - return this; - } - - @Override - public EventHubAuthorizationRuleImpl withExistingEventHub( - String resourceGroupName, String namespaceName, String eventHubName) { - this.ancestor = new Ancestors().new TwoAncestor(resourceGroupName, eventHubName, namespaceName); - return this; - } - - @Override - public EventHubAuthorizationRuleImpl withExistingEventHub(EventHub eventHub) { - this.ancestor = new Ancestors().new TwoAncestor(selfId(eventHub.id())); - return this; - } - - @Override - protected Mono getInnerAsync() { - return this.manager.serviceClient().getEventHubs() - .getAuthorizationRuleAsync(this.ancestor().resourceGroupName(), - this.ancestor().ancestor2Name(), - this.ancestor().ancestor1Name(), - this.name()); - } - - @Override - public Mono createResourceAsync() { - return this.manager.serviceClient().getEventHubs() - .createOrUpdateAuthorizationRuleAsync(this.ancestor().resourceGroupName(), - this.ancestor().ancestor2Name(), - this.ancestor().ancestor1Name(), - this.name(), - new AuthorizationRuleInner().withRights(this.innerModel().rights())) - .map(innerToFluentMap(this)); - } - - @Override - protected Mono getKeysInnerAsync() { - return this.manager.serviceClient().getEventHubs() - .listKeysAsync(this.ancestor().resourceGroupName(), - this.ancestor().ancestor2Name(), - this.ancestor().ancestor1Name(), - this.name()); - } - - @Override - protected Mono regenerateKeysInnerAsync(KeyType keyType) { - final RegenerateAccessKeyParameters regenKeyInner = new RegenerateAccessKeyParameters() - .withKeyType(keyType); - return this.manager.serviceClient().getEventHubs() - .regenerateKeysAsync(this.ancestor().resourceGroupName(), - this.ancestor().ancestor2Name(), - this.ancestor().ancestor1Name(), - this.name(), - regenKeyInner); - } - - private Ancestors.TwoAncestor ancestor() { - Objects.requireNonNull(this.ancestor); - return this.ancestor; - } - - private String selfId(String parentId) { - return String.format("%s/authorizationRules/%s", parentId, this.name()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/EventHubAuthorizationRulesImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/EventHubAuthorizationRulesImpl.java deleted file mode 100644 index 919cf2de61ae..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/EventHubAuthorizationRulesImpl.java +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.eventhubs.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.eventhubs.EventHubsManager; -import com.azure.resourcemanager.eventhubs.fluent.EventHubsClient; -import com.azure.resourcemanager.eventhubs.fluent.models.AuthorizationRuleInner; -import com.azure.resourcemanager.eventhubs.models.EventHubAuthorizationRule; -import com.azure.resourcemanager.eventhubs.models.EventHubAuthorizationRules; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceId; -import reactor.core.publisher.Mono; - -import java.util.Objects; -import com.azure.resourcemanager.resources.fluentcore.utils.PagedConverter; - -/** - * Implementation for {@link EventHubAuthorizationRules}. - */ -public final class EventHubAuthorizationRulesImpl - extends AuthorizationRulesBaseImpl - implements EventHubAuthorizationRules { - - public EventHubAuthorizationRulesImpl(EventHubsManager manager) { - super(manager, manager.serviceClient().getEventHubs()); - } - - @Override - public EventHubAuthorizationRuleImpl define(String name) { - return new EventHubAuthorizationRuleImpl(name, this.manager); - } - - @Override - public Mono getByIdAsync(String id) { - Objects.requireNonNull(id); - ResourceId resourceId = ResourceId.fromString(id); - - return getByNameAsync(resourceId.resourceGroupName(), - resourceId.parent().parent().name(), - resourceId.parent().name(), - resourceId.name()); - } - - @Override - public EventHubAuthorizationRule getByName( - String resourceGroupName, String namespaceName, String eventHubName, String name) { - return getByNameAsync(resourceGroupName, namespaceName, eventHubName, name).block(); - } - - @Override - public Mono getByNameAsync( - String resourceGroupName, String namespaceName, String eventHubName, String name) { - return this.innerModel().getAuthorizationRuleAsync(resourceGroupName, namespaceName, eventHubName, name) - .map(this::wrapModel); - } - - @Override - public PagedIterable listByEventHub( - final String resourceGroupName, final String namespaceName, final String eventHubName) { - return PagedConverter.mapPage(innerModel() - .listAuthorizationRules(resourceGroupName, namespaceName, eventHubName), - this::wrapModel); - } - - @Override - public PagedFlux listByEventHubAsync( - String resourceGroupName, String namespaceName, final String eventHubName) { - return PagedConverter.mapPage(this.innerModel() - .listAuthorizationRulesAsync(resourceGroupName, namespaceName, eventHubName), - this::wrapModel); - } - - @Override - public Mono deleteByIdAsync(String id) { - Objects.requireNonNull(id); - ResourceId resourceId = ResourceId.fromString(id); - return deleteByNameAsync(resourceId.resourceGroupName(), - resourceId.parent().parent().name(), - resourceId.parent().name(), - resourceId.name()); - } - - @Override - public void deleteByName(String resourceGroupName, String namespaceName, String eventHubName, String name) { - deleteByNameAsync(resourceGroupName, namespaceName, eventHubName, name).block(); - } - - @Override - public Mono deleteByNameAsync( - String resourceGroupName, String namespaceName, String eventHubName, String name) { - return this.innerModel().deleteAuthorizationRuleAsync(resourceGroupName, - namespaceName, - eventHubName, - name); - } - - @Override - protected EventHubAuthorizationRuleImpl wrapModel(AuthorizationRuleInner innerModel) { - return new EventHubAuthorizationRuleImpl(innerModel.name(), innerModel, this.manager); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/EventHubConsumerGroupImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/EventHubConsumerGroupImpl.java deleted file mode 100644 index f00ac04efcfa..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/EventHubConsumerGroupImpl.java +++ /dev/null @@ -1,120 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.eventhubs.implementation; - -import com.azure.resourcemanager.eventhubs.EventHubsManager; -import com.azure.resourcemanager.eventhubs.fluent.models.ConsumerGroupInner; -import com.azure.resourcemanager.eventhubs.models.EventHub; -import com.azure.resourcemanager.eventhubs.models.EventHubConsumerGroup; -import reactor.core.publisher.Mono; - -import java.time.OffsetDateTime; -import java.util.Objects; - -/** - * Implementation for {@link EventHubConsumerGroup}. - */ -class EventHubConsumerGroupImpl - extends NestedResourceImpl - implements EventHubConsumerGroup, - EventHubConsumerGroup.Definition, - EventHubConsumerGroup.Update { - - private Ancestors.TwoAncestor ancestor; - - EventHubConsumerGroupImpl(String name, ConsumerGroupInner inner, EventHubsManager manager) { - super(name, inner, manager); - this.ancestor = new Ancestors().new TwoAncestor(inner.id()); - } - - EventHubConsumerGroupImpl(String name, EventHubsManager manager) { - super(name, new ConsumerGroupInner(), manager); - } - - @Override - public String namespaceResourceGroupName() { - return this.ancestor().resourceGroupName(); - } - - @Override - public String namespaceName() { - return this.ancestor().ancestor2Name(); - } - - @Override - public String eventHubName() { - return this.ancestor().ancestor1Name(); - } - - @Override - public OffsetDateTime createdAt() { - return this.innerModel().createdAt(); - } - - @Override - public OffsetDateTime updatedAt() { - return this.innerModel().updatedAt(); - } - - @Override - public String userMetadata() { - return this.innerModel().userMetadata(); - } - - @Override - public EventHubConsumerGroupImpl withExistingEventHub(EventHub eventHub) { - this.ancestor = new Ancestors().new TwoAncestor(selfId(eventHub.id())); - return this; - } - - @Override - public EventHubConsumerGroupImpl withExistingEventHubId(String eventHubId) { - this.ancestor = new Ancestors().new TwoAncestor(selfId(eventHubId)); - return this; - } - - @Override - public EventHubConsumerGroupImpl withExistingEventHub( - String resourceGroupName, String namespaceName, String eventHubName) { - this.ancestor = new Ancestors().new TwoAncestor(resourceGroupName, eventHubName, namespaceName); - return this; - } - - @Override - public EventHubConsumerGroupImpl withUserMetadata(String metadata) { - this.innerModel().withUserMetadata(metadata); - return this; - } - - @Override - public Mono createResourceAsync() { - return this.manager.serviceClient().getConsumerGroups() - .createOrUpdateAsync(this.ancestor().resourceGroupName(), - this.ancestor().ancestor2Name(), - this.ancestor().ancestor1Name(), - this.name(), - new ConsumerGroupInner().withUserMetadata(this.innerModel().userMetadata())) - .map(innerToFluentMap(this)); - } - - @Override - protected Mono getInnerAsync() { - return this.manager.serviceClient().getConsumerGroups() - .getAsync(this.ancestor().resourceGroupName(), - this.ancestor().ancestor2Name(), - this.ancestor().ancestor1Name(), - this.name()); - } - - private Ancestors.TwoAncestor ancestor() { - Objects.requireNonNull(this.ancestor); - return this.ancestor; - } - - private String selfId(String parentId) { - return String.format("%s/consumerGroups/%s", parentId, this.name()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/EventHubConsumerGroupsImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/EventHubConsumerGroupsImpl.java deleted file mode 100644 index 84cead3b0628..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/EventHubConsumerGroupsImpl.java +++ /dev/null @@ -1,120 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.eventhubs.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.eventhubs.EventHubsManager; -import com.azure.resourcemanager.eventhubs.fluent.ConsumerGroupsClient; -import com.azure.resourcemanager.eventhubs.fluent.models.ConsumerGroupInner; -import com.azure.resourcemanager.eventhubs.models.EventHubConsumerGroup; -import com.azure.resourcemanager.eventhubs.models.EventHubConsumerGroups; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceId; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.WrapperImpl; -import reactor.core.publisher.Mono; - -import java.util.Objects; -import com.azure.resourcemanager.resources.fluentcore.utils.PagedConverter; - -/** - * Implementation for {@link EventHubConsumerGroups}. - */ -public final class EventHubConsumerGroupsImpl - extends WrapperImpl - implements EventHubConsumerGroups { - private final EventHubsManager manager; - - public EventHubConsumerGroupsImpl(EventHubsManager manager) { - super(manager.serviceClient().getConsumerGroups()); - this.manager = manager; - } - - @Override - public EventHubsManager manager() { - return this.manager; - } - - @Override - public EventHubConsumerGroupImpl define(String name) { - return new EventHubConsumerGroupImpl(name, this.manager); - } - - @Override - public EventHubConsumerGroup getById(String id) { - return getByIdAsync(id).block(); - } - - @Override - public Mono getByIdAsync(String id) { - Objects.requireNonNull(id); - ResourceId resourceId = ResourceId.fromString(id); - - return getByNameAsync(resourceId.resourceGroupName(), - resourceId.parent().parent().name(), - resourceId.parent().name(), - resourceId.name()); - } - - @Override - public Mono getByNameAsync( - String resourceGroupName, String namespaceName, String eventHubName, String name) { - return this.innerModel().getAsync(resourceGroupName, namespaceName, eventHubName, name).map(this::wrapModel); - } - - @Override - public EventHubConsumerGroup getByName( - String resourceGroupName, String namespaceName, String eventHubName, String name) { - return getByNameAsync(resourceGroupName, namespaceName, eventHubName, name).block(); - } - - @Override - public PagedIterable listByEventHub( - String resourceGroupName, String namespaceName, String eventHubName) { - return PagedConverter.mapPage(innerModel() - .listByEventHub(resourceGroupName, namespaceName, eventHubName), - this::wrapModel); - } - - @Override - public PagedFlux listByEventHubAsync( - String resourceGroupName, String namespaceName, String eventHubName) { - return PagedConverter.mapPage(innerModel() - .listByEventHubAsync(resourceGroupName, namespaceName, eventHubName), - this::wrapModel); - } - - @Override - public void deleteById(String id) { - deleteByIdAsync(id).block(); - } - - @Override - public Mono deleteByIdAsync(String id) { - Objects.requireNonNull(id); - ResourceId resourceId = ResourceId.fromString(id); - - return deleteByNameAsync(resourceId.resourceGroupName(), - resourceId.parent().parent().name(), - resourceId.parent().name(), - resourceId.name()); - } - - @Override - public Mono deleteByNameAsync( - String resourceGroupName, String namespaceName, String eventHubName, String name) { - return this.innerModel().deleteAsync(resourceGroupName, - namespaceName, - eventHubName, - name); - } - - @Override - public void deleteByName(String resourceGroupName, String namespaceName, String eventHubName, String name) { - deleteByNameAsync(resourceGroupName, namespaceName, eventHubName, name).block(); - } - - private EventHubConsumerGroupImpl wrapModel(ConsumerGroupInner innerModel) { - return new EventHubConsumerGroupImpl(innerModel.name(), innerModel, this.manager); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/EventHubDisasterRecoveryPairingImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/EventHubDisasterRecoveryPairingImpl.java deleted file mode 100644 index 8f3b9e6a1282..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/EventHubDisasterRecoveryPairingImpl.java +++ /dev/null @@ -1,201 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.eventhubs.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.eventhubs.EventHubsManager; -import com.azure.resourcemanager.eventhubs.fluent.models.ArmDisasterRecoveryInner; -import com.azure.resourcemanager.eventhubs.models.DisasterRecoveryPairingAuthorizationRule; -import com.azure.resourcemanager.eventhubs.models.EventHubDisasterRecoveryPairing; -import com.azure.resourcemanager.eventhubs.models.EventHubNamespace; -import com.azure.resourcemanager.eventhubs.models.ProvisioningStateDR; -import com.azure.resourcemanager.eventhubs.models.RoleDisasterRecovery; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceId; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import reactor.core.publisher.Mono; - -import java.util.Objects; - -/** - * Implementation for {@link EventHubDisasterRecoveryPairing}. - */ -class EventHubDisasterRecoveryPairingImpl - extends NestedResourceImpl - implements EventHubDisasterRecoveryPairing, - EventHubDisasterRecoveryPairing.Definition, - EventHubDisasterRecoveryPairing.Update { - - private Ancestors.OneAncestor ancestor; - private final ClientLogger logger = new ClientLogger(EventHubDisasterRecoveryPairingImpl.class); - - EventHubDisasterRecoveryPairingImpl(String name, ArmDisasterRecoveryInner inner, EventHubsManager manager) { - super(name, inner, manager); - this.ancestor = new Ancestors().new OneAncestor(inner.id()); - } - - EventHubDisasterRecoveryPairingImpl(String name, EventHubsManager manager) { - super(name, new ArmDisasterRecoveryInner(), manager); - } - - @Override - public String primaryNamespaceResourceGroupName() { - return this.ancestor().resourceGroupName(); - } - - @Override - public String primaryNamespaceName() { - return this.ancestor().ancestor1Name(); - } - - @Override - public String secondaryNamespaceId() { - return this.innerModel().partnerNamespace(); - } - - @Override - public RoleDisasterRecovery namespaceRole() { - return this.innerModel().role(); - } - - @Override - public ProvisioningStateDR provisioningState() { - return this.innerModel().provisioningState(); - } - - @Override - public EventHubDisasterRecoveryPairingImpl withNewPrimaryNamespace( - Creatable namespaceCreatable) { - this.addDependency(namespaceCreatable); - if (namespaceCreatable instanceof EventHubNamespaceImpl) { - EventHubNamespaceImpl namespace = ((EventHubNamespaceImpl) namespaceCreatable); - this.ancestor = new Ancestors().new OneAncestor(namespace.resourceGroupName(), namespaceCreatable.name()); - } else { - logger.logExceptionAsError(new IllegalArgumentException("The namespaceCreatable is invalid.")); - } - return this; - } - - @Override - public EventHubDisasterRecoveryPairingImpl withExistingPrimaryNamespace(EventHubNamespace namespace) { - this.ancestor = new Ancestors().new OneAncestor(selfId(namespace.id())); - return this; - } - - @Override - public EventHubDisasterRecoveryPairingImpl withExistingPrimaryNamespace( - String resourceGroupName, String primaryNamespaceName) { - this.ancestor = new Ancestors().new OneAncestor(resourceGroupName, primaryNamespaceName); - return this; - } - - @Override - public EventHubDisasterRecoveryPairingImpl withExistingPrimaryNamespaceId(String namespaceId) { - this.ancestor = new Ancestors().new OneAncestor(selfId(namespaceId)); - return this; - } - - @Override - public EventHubDisasterRecoveryPairingImpl withNewSecondaryNamespace( - Creatable namespaceCreatable) { - this.addDependency(namespaceCreatable); - if (namespaceCreatable instanceof EventHubNamespaceImpl) { - EventHubNamespaceImpl namespace = ((EventHubNamespaceImpl) namespaceCreatable); - this.innerModel().withPartnerNamespace(namespace.name()); - } else { - logger.logExceptionAsError(new IllegalArgumentException("The namespaceCreatable is invalid.")); - } - return this; - } - - @Override - public EventHubDisasterRecoveryPairingImpl withExistingSecondaryNamespace(EventHubNamespace namespace) { - Objects.requireNonNull(namespace.id()); - this.innerModel().withPartnerNamespace(namespace.id()); - return this; - } - - @Override - public EventHubDisasterRecoveryPairingImpl withExistingSecondaryNamespaceId(String namespaceId) { - Objects.requireNonNull(namespaceId); - this.innerModel().withPartnerNamespace(namespaceId); - return this; - } - - @Override - public Mono createResourceAsync() { - return this.manager().serviceClient().getDisasterRecoveryConfigs() - .createOrUpdateAsync(this.ancestor().resourceGroupName(), - this.ancestor().ancestor1Name(), - this.name(), - this.innerModel()) - .map(innerToFluentMap(this)); - } - - @Override - public Mono breakPairingAsync() { - return this.manager().serviceClient().getDisasterRecoveryConfigs() - .breakPairingAsync(this.ancestor().resourceGroupName(), - this.ancestor().ancestor1Name(), - this.name()) - .then(refreshAsync()) - .then(); - } - - @Override - public void breakPairing() { - this.breakPairingAsync().block(); - } - - @Override - public Mono failOverAsync() { - // Fail over is run against secondary namespace (because primary might be down at time of failover) - // - ResourceId secondaryNs = ResourceId.fromString(this.innerModel().partnerNamespace()); - return this.manager().serviceClient().getDisasterRecoveryConfigs() - .failOverAsync(secondaryNs.resourceGroupName(), secondaryNs.name(), this.name()) - .then(refreshAsync()) - .then(); - } - - @Override - public void failOver() { - this.failOverAsync().block(); - } - - @Override - public PagedFlux listAuthorizationRulesAsync() { - return this.manager().disasterRecoveryPairingAuthorizationRules() - .listByDisasterRecoveryPairingAsync(this.ancestor().resourceGroupName(), - this.ancestor().ancestor1Name(), - this.name()); - } - - @Override - public PagedIterable listAuthorizationRules() { - return this.manager().disasterRecoveryPairingAuthorizationRules() - .listByDisasterRecoveryPairing(this.ancestor().resourceGroupName(), - this.ancestor().ancestor1Name(), - this.name()); - } - - @Override - protected Mono getInnerAsync() { - return this.manager().serviceClient().getDisasterRecoveryConfigs().getAsync(this.ancestor().resourceGroupName(), - this.ancestor().ancestor1Name(), - this.name()); - } - - private Ancestors.OneAncestor ancestor() { - Objects.requireNonNull(this.ancestor); - return this.ancestor; - } - - private String selfId(String parentId) { - return String.format("%s/disasterRecoveryConfig/%s", parentId, this.name()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/EventHubDisasterRecoveryPairingsImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/EventHubDisasterRecoveryPairingsImpl.java deleted file mode 100644 index 112bda8f129a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/EventHubDisasterRecoveryPairingsImpl.java +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.eventhubs.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.eventhubs.EventHubsManager; -import com.azure.resourcemanager.eventhubs.fluent.DisasterRecoveryConfigsClient; -import com.azure.resourcemanager.eventhubs.fluent.models.ArmDisasterRecoveryInner; -import com.azure.resourcemanager.eventhubs.models.DisasterRecoveryPairingAuthorizationRules; -import com.azure.resourcemanager.eventhubs.models.EventHubDisasterRecoveryPairing; -import com.azure.resourcemanager.eventhubs.models.EventHubDisasterRecoveryPairings; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceId; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.WrapperImpl; -import reactor.core.publisher.Mono; - -import java.util.Objects; -import com.azure.resourcemanager.resources.fluentcore.utils.PagedConverter; - -/** - * Implementation for {@link EventHubDisasterRecoveryPairings}. - */ -public final class EventHubDisasterRecoveryPairingsImpl - extends WrapperImpl - implements EventHubDisasterRecoveryPairings { - private EventHubsManager manager; - - public EventHubDisasterRecoveryPairingsImpl(EventHubsManager manager) { - super(manager.serviceClient().getDisasterRecoveryConfigs()); - this.manager = manager; - } - - @Override - public EventHubsManager manager() { - return this.manager; - } - - @Override - public EventHubDisasterRecoveryPairingImpl define(String name) { - return new EventHubDisasterRecoveryPairingImpl(name, this.manager); - } - - @Override - public DisasterRecoveryPairingAuthorizationRules authorizationRules() { - return null; - } - - @Override - public EventHubDisasterRecoveryPairing getById(String id) { - return getByIdAsync(id).block(); - } - - @Override - public Mono getByIdAsync(String id) { - Objects.requireNonNull(id); - ResourceId resourceId = ResourceId.fromString(id); - return getByNameAsync(resourceId.resourceGroupName(), - resourceId.parent().name(), - resourceId.name()); - } - - @Override - public Mono getByNameAsync( - String resourceGroupName, String namespaceName, String name) { - return this.innerModel().getAsync(resourceGroupName, - namespaceName, - name) - .map(this::wrapModel); - } - - @Override - public EventHubDisasterRecoveryPairing getByName( - String resourceGroupName, String namespaceName, String name) { - return getByNameAsync(resourceGroupName, namespaceName, name).block(); - } - - @Override - public PagedIterable listByNamespace( - String resourceGroupName, String namespaceName) { - return PagedConverter.mapPage(innerModel() - .list(resourceGroupName, namespaceName), - this::wrapModel); - } - - @Override - public PagedFlux listByNamespaceAsync( - String resourceGroupName, String namespaceName) { - return PagedConverter.mapPage(this.innerModel().listAsync(resourceGroupName, namespaceName), - this::wrapModel); - } - - @Override - public void deleteById(String id) { - deleteByIdAsync(id).block(); - } - - @Override - public Mono deleteByIdAsync(String id) { - Objects.requireNonNull(id); - ResourceId resourceId = ResourceId.fromString(id); - return deleteByNameAsync(resourceId.resourceGroupName(), - resourceId.parent().name(), - resourceId.name()); - } - - @Override - public Mono deleteByNameAsync(String resourceGroupName, String namespaceName, String name) { - return this.innerModel().deleteAsync(resourceGroupName, - namespaceName, - name); - } - - @Override - public void deleteByName(String resourceGroupName, String namespaceName, String name) { - deleteByNameAsync(resourceGroupName, namespaceName, name).block(); - } - - private EventHubDisasterRecoveryPairingImpl wrapModel(ArmDisasterRecoveryInner innerModel) { - return new EventHubDisasterRecoveryPairingImpl(innerModel.name(), innerModel, this.manager); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/EventHubImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/EventHubImpl.java deleted file mode 100644 index 2dccf5f77e73..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/EventHubImpl.java +++ /dev/null @@ -1,545 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.eventhubs.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.eventhubs.EventHubsManager; -import com.azure.resourcemanager.eventhubs.fluent.models.EventhubInner; -import com.azure.resourcemanager.eventhubs.models.CaptureDescription; -import com.azure.resourcemanager.eventhubs.models.Destination; -import com.azure.resourcemanager.eventhubs.models.EncodingCaptureDescription; -import com.azure.resourcemanager.eventhubs.models.EventHub; -import com.azure.resourcemanager.eventhubs.models.EventHubAuthorizationRule; -import com.azure.resourcemanager.eventhubs.models.EventHubConsumerGroup; -import com.azure.resourcemanager.eventhubs.models.EventHubNamespace; -import com.azure.resourcemanager.resources.fluentcore.dag.VoidIndexable; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.Indexable; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import com.azure.resourcemanager.storage.StorageManager; -import com.azure.resourcemanager.storage.models.PublicAccess; -import com.azure.resourcemanager.storage.models.StorageAccount; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -import java.util.Collections; -import java.util.HashSet; -import java.util.Objects; -import java.util.Set; -import java.util.UUID; - -/** - * Implementation for {@link EventHub}. - */ -class EventHubImpl - extends NestedResourceImpl - implements EventHub, EventHub.Definition, EventHub.Update { - - private Ancestors.OneAncestor ancestor; - private CaptureSettings captureSettings; - private StorageManager storageManager; - private Flux postRunTasks; - - private final ClientLogger logger = new ClientLogger(EventHubImpl.class); - - EventHubImpl(String name, EventhubInner inner, EventHubsManager manager, StorageManager storageManager) { - super(name, inner, manager); - this.ancestor = new Ancestors().new OneAncestor(inner.id()); - this.captureSettings = new CaptureSettings(this.innerModel()); - this.storageManager = storageManager; - } - - EventHubImpl(String name, EventHubsManager manager, StorageManager storageManager) { - super(name, new EventhubInner(), manager); - this.storageManager = storageManager; - this.captureSettings = new CaptureSettings(this.innerModel()); - } - - @Override - public String namespaceResourceGroupName() { - return this.ancestor().resourceGroupName(); - } - - @Override - public String namespaceName() { - return this.ancestor().ancestor1Name(); - } - - @Override - public boolean isDataCaptureEnabled() { - if (this.innerModel().captureDescription() == null) { - return false; - } - return ResourceManagerUtils.toPrimitiveBoolean(this.innerModel().captureDescription().enabled()); - } - - @Override - public int dataCaptureWindowSizeInSeconds() { - if (this.innerModel().captureDescription() == null) { - return 0; - } - return ResourceManagerUtils.toPrimitiveInt(this.innerModel().captureDescription().intervalInSeconds()); - } - - @Override - public int dataCaptureWindowSizeInMB() { - if (this.innerModel().captureDescription() == null) { - return 0; - } - int inBytes = ResourceManagerUtils.toPrimitiveInt(this.innerModel().captureDescription().sizeLimitInBytes()); - if (inBytes != 0) { - return inBytes / (1024 * 1024); - } else { - return 0; - } - } - - @Override - public boolean dataCaptureSkipEmptyArchives() { - if (this.innerModel().captureDescription() == null) { - return false; - } - return this.innerModel().captureDescription().skipEmptyArchives(); - } - - @Override - public String dataCaptureFileNameFormat() { - if (this.innerModel().captureDescription() == null) { - return null; - } else if (this.innerModel().captureDescription().destination() == null) { - return null; - } else { - return this.innerModel().captureDescription().destination().archiveNameFormat(); - } - } - - @Override - public Destination captureDestination() { - if (this.innerModel().captureDescription() == null) { - return null; - } else { - return this.innerModel().captureDescription().destination(); - } - } - - @Override - public Set partitionIds() { - if (this.innerModel().partitionIds() == null) { - return Collections.unmodifiableSet(new HashSet()); - } else { - return Collections.unmodifiableSet(new HashSet(this.innerModel().partitionIds())); - } - } - - @Override - public int messageRetentionPeriodInDays() { - return ResourceManagerUtils.toPrimitiveInt(this.innerModel().messageRetentionInDays()); - } - - @Override - public EventHubImpl withNewNamespace(Creatable namespaceCreatable) { - this.addDependency(namespaceCreatable); - if (namespaceCreatable instanceof EventHubNamespaceImpl) { - EventHubNamespaceImpl namespace = ((EventHubNamespaceImpl) namespaceCreatable); - this.ancestor = new Ancestors().new OneAncestor(namespace.resourceGroupName(), namespaceCreatable.name()); - } else { - logger.logExceptionAsError(new IllegalArgumentException("The namespaceCreatable is invalid.")); - } - return this; - } - - @Override - public EventHubImpl withExistingNamespace(EventHubNamespace namespace) { - this.ancestor = new Ancestors().new OneAncestor(selfId(namespace.id())); - return this; - } - - @Override - public EventHubImpl withExistingNamespace(String resourceGroupName, String namespaceName) { - this.ancestor = new Ancestors().new OneAncestor(resourceGroupName, namespaceName); - return this; - } - - @Override - public EventHubImpl withExistingNamespaceId(String namespaceId) { - this.ancestor = new Ancestors().new OneAncestor(selfId(namespaceId)); - return this; - } - - @Override - public EventHubImpl withNewStorageAccountForCapturedData( - Creatable storageAccountCreatable, String containerName) { - this.captureSettings.withNewStorageAccountForCapturedData(storageAccountCreatable, containerName); - return this; - } - - @Override - public EventHubImpl withExistingStorageAccountForCapturedData( - StorageAccount storageAccount, String containerName) { - this.captureSettings.withExistingStorageAccountForCapturedData(storageAccount, containerName); - return this; - } - - @Override - public EventHubImpl withExistingStorageAccountForCapturedData( - String storageAccountId, String containerName) { - this.captureSettings.withExistingStorageAccountForCapturedData(storageAccountId, containerName); - return this; - } - - @Override - public EventHubImpl withDataCaptureEnabled() { - this.captureSettings.withDataCaptureEnabled(); - return this; - } - - @Override - public EventHubImpl withDataCaptureDisabled() { - this.captureSettings.withDataCaptureDisabled(); - return this; - } - - @Override - public EventHubImpl withDataCaptureWindowSizeInSeconds(int sizeInSeconds) { - this.captureSettings.withDataCaptureWindowSizeInSeconds(sizeInSeconds); - return this; - } - - @Override - public EventHubImpl withDataCaptureSkipEmptyArchives(Boolean skipEmptyArchives) { - this.captureSettings.withDataCaptureSkipEmptyArchives(skipEmptyArchives); - return this; - } - - @Override - public EventHubImpl withDataCaptureWindowSizeInMB(int sizeInMB) { - this.captureSettings.withDataCaptureWindowSizeInMB(sizeInMB); - return this; - } - - @Override - public EventHubImpl withDataCaptureFileNameFormat(String format) { - this.captureSettings.withDataCaptureFileNameFormat(format); - return this; - } - - @Override - public EventHubImpl withNewSendRule(final String ruleName) { - concatPostRunTask(manager().eventHubAuthorizationRules() - .define(ruleName) - .withExistingEventHub(ancestor().resourceGroupName(), ancestor().ancestor1Name(), name()) - .withSendAccess() - .createAsync() - .cast(Indexable.class)); - return this; - } - - @Override - public EventHubImpl withNewListenRule(final String ruleName) { - concatPostRunTask(manager().eventHubAuthorizationRules() - .define(ruleName) - .withExistingEventHub(ancestor().resourceGroupName(), ancestor().ancestor1Name(), name()) - .withListenAccess() - .createAsync() - .cast(Indexable.class)); - return this; - } - - @Override - public EventHubImpl withNewSendAndListenRule(final String ruleName) { - concatPostRunTask(manager().eventHubAuthorizationRules() - .define(ruleName) - .withExistingEventHub(ancestor().resourceGroupName(), ancestor().ancestor1Name(), name()) - .withSendAndListenAccess() - .createAsync() - .cast(Indexable.class)); - return this; - } - - @Override - public EventHubImpl withNewManageRule(final String ruleName) { - concatPostRunTask(manager().eventHubAuthorizationRules() - .define(ruleName) - .withExistingEventHub(ancestor().resourceGroupName(), ancestor().ancestor1Name(), name()) - .withManageAccess() - .createAsync() - .cast(Indexable.class)); - return this; - } - - @Override - public EventHubImpl withoutAuthorizationRule(final String ruleName) { - concatPostRunTask(manager().eventHubAuthorizationRules() - .deleteByNameAsync(ancestor().resourceGroupName(), ancestor().ancestor1Name(), name(), ruleName) - .map(aVoid -> new VoidIndexable(UUID.randomUUID().toString()))); - return this; - } - - @Override - public EventHubImpl withNewConsumerGroup(final String name) { - concatPostRunTask(manager().consumerGroups() - .define(name) - .withExistingEventHub(ancestor().resourceGroupName(), ancestor().ancestor1Name(), name()) - .createAsync() - .cast(Indexable.class)); - return this; - } - - @Override - public EventHubImpl withNewConsumerGroup(final String name, final String metadata) { - concatPostRunTask(manager().consumerGroups() - .define(name) - .withExistingEventHub(ancestor().resourceGroupName(), ancestor().ancestor1Name(), name()) - .withUserMetadata(metadata) - .createAsync() - .cast(Indexable.class)); - return this; - } - - @Override - public EventHubImpl withoutConsumerGroup(final String name) { - concatPostRunTask(manager().consumerGroups() - .deleteByNameAsync(ancestor().resourceGroupName(), ancestor().ancestor1Name(), name(), name) - .map(aVoid -> new VoidIndexable(UUID.randomUUID().toString()))); - return this; - } - - @Override - public EventHubImpl withPartitionCount(long count) { - this.innerModel().withPartitionCount(count); - return this; - } - - @Override - public EventHubImpl withRetentionPeriodInDays(long period) { - this.innerModel().withMessageRetentionInDays(period); - return this; - } - - @Override - public EventHubImpl update() { - this.captureSettings = new CaptureSettings(this.innerModel()); - return super.update(); - } - - @Override - public void beforeGroupCreateOrUpdate() { - if (postRunTasks != null) { - addPostRunDependent(context -> postRunTasks.last()); - } - this.innerModel().withCaptureDescription(this.captureSettings.validateAndGetSettings()); - } - - @Override - public Mono createResourceAsync() { - return this.manager.serviceClient().getEventHubs() - .createOrUpdateAsync( - ancestor().resourceGroupName(), ancestor().ancestor1Name(), name(), this.innerModel()) - .map(innerToFluentMap(this)); - } - - @Override - public Mono afterPostRunAsync(boolean isGroupFaulted) { - postRunTasks = null; - return Mono.empty(); - } - - @Override - protected Mono getInnerAsync() { - return this.manager.serviceClient().getEventHubs().getAsync(this.ancestor().resourceGroupName(), - this.ancestor().ancestor1Name(), - this.name()); - } - - @Override - public PagedFlux listConsumerGroupsAsync() { - return this.manager.consumerGroups() - .listByEventHubAsync(ancestor().resourceGroupName(), ancestor().ancestor1Name(), name()); - } - - @Override - public PagedFlux listAuthorizationRulesAsync() { - return this.manager.eventHubAuthorizationRules() - .listByEventHubAsync(ancestor().resourceGroupName(), ancestor().ancestor1Name(), name()); - } - - @Override - public PagedIterable listConsumerGroups() { - return this.manager.consumerGroups() - .listByEventHub(ancestor().resourceGroupName(), ancestor().ancestor1Name(), name()); - } - - @Override - public PagedIterable listAuthorizationRules() { - return this.manager.eventHubAuthorizationRules() - .listByEventHub(ancestor().resourceGroupName(), ancestor().ancestor1Name(), name()); - } - - private Ancestors.OneAncestor ancestor() { - Objects.requireNonNull(this.ancestor); - return this.ancestor; - } - - private String selfId(String parentId) { - return String.format("%s/eventhubs/%s", parentId, this.name()); - } - - private void concatPostRunTask(Mono task) { - if (postRunTasks == null) { - postRunTasks = Flux.empty(); - } - postRunTasks = postRunTasks.concatWith(task); - } - - private class CaptureSettings { - private final CaptureDescription currentSettings; - private CaptureDescription newSettings; - - CaptureSettings(final EventhubInner eventhubInner) { - this.currentSettings = eventhubInner.captureDescription(); - } - - public CaptureSettings withNewStorageAccountForCapturedData( - final Creatable creatableStorageAccount, final String containerName) { - this.ensureSettings().destination().withStorageAccountResourceId("temp-id"); - this.ensureSettings().destination().withBlobContainer(containerName); - // - // Schedule task to create storage account and container. - // - addDependency(context -> creatableStorageAccount - .createAsync() - .flatMap(indexable -> { - StorageAccount storageAccount = indexable; - ensureSettings().destination().withStorageAccountResourceId(storageAccount.id()); - return createContainerIfNotExistsAsync(storageAccount, containerName); - })); - return this; - } - - public CaptureSettings withExistingStorageAccountForCapturedData( - final StorageAccount storageAccount, final String containerName) { - this.ensureSettings().destination().withStorageAccountResourceId(storageAccount.id()); - this.ensureSettings().destination().withBlobContainer(containerName); - // - // Schedule task to create container if not exists. - // - addDependency(context -> createContainerIfNotExistsAsync(storageAccount, containerName)); - return this; - } - - public CaptureSettings withExistingStorageAccountForCapturedData( - final String storageAccountId, final String containerName) { - this.ensureSettings().destination().withStorageAccountResourceId(storageAccountId); - this.ensureSettings().destination().withBlobContainer(containerName); - // - // Schedule task to create container if not exists. - // - addDependency(context -> storageManager.storageAccounts() - .getByIdAsync(storageAccountId) - .flatMap(storageAccount -> { - ensureSettings().destination().withStorageAccountResourceId(storageAccount.id()); - return createContainerIfNotExistsAsync(storageAccount, containerName); - })); - return this; - } - - public CaptureSettings withDataCaptureEnabled() { - this.ensureSettings().withEnabled(true); - return this; - } - - public CaptureSettings withDataCaptureDisabled() { - this.ensureSettings().withEnabled(false); - return this; - } - - public CaptureSettings withDataCaptureSkipEmptyArchives(Boolean skipEmptyArchives) { - this.ensureSettings().withSkipEmptyArchives(skipEmptyArchives); - return this; - } - - public CaptureSettings withDataCaptureWindowSizeInSeconds(int sizeInSeconds) { - this.ensureSettings().withIntervalInSeconds(sizeInSeconds); - return this; - } - - public CaptureSettings withDataCaptureWindowSizeInMB(int sizeInMB) { - this.ensureSettings().withSizeLimitInBytes(sizeInMB * 1024 * 1024); - return this; - } - - public CaptureSettings withDataCaptureFileNameFormat(String format) { - this.ensureSettings().destination().withArchiveNameFormat(format); - return this; - } - - public CaptureDescription validateAndGetSettings() { - if (this.newSettings == null) { - return this.currentSettings; - } else if (this.newSettings.destination() == null - || this.newSettings.destination().storageAccountResourceId() == null - || this.newSettings.destination().blobContainer() == null) { - throw logger.logExceptionAsError(new IllegalStateException( - "Setting any of the capture properties requires " - + "capture destination [StorageAccount, DataLake] to be specified")); - } - if (this.newSettings.destination().name() == null) { - this.newSettings.destination().withName("EventHubArchive.AzureBlockBlob"); - } - if (this.newSettings.encoding() == null) { - this.newSettings.withEncoding(EncodingCaptureDescription.AVRO); - } - return this.newSettings; - } - - private CaptureDescription ensureSettings() { - if (this.newSettings != null) { - return this.newSettings; - } else if (this.currentSettings == null) { - this.newSettings = new CaptureDescription().withDestination(new Destination()); - return this.newSettings; - } else { - // Clone the current settings to new settings (one time) - // - this.newSettings = cloneCurrentSettings(); - return this.newSettings; - } - } - - private Mono createContainerIfNotExistsAsync(final StorageAccount storageAccount, - final String containerName) { - return storageManager.blobContainers() - .getAsync(storageAccount.resourceGroupName(), storageAccount.name(), containerName) - .cast(Indexable.class) - .onErrorResume(throwable -> storageManager.blobContainers() - .defineContainer(containerName) - .withExistingStorageAccount(storageAccount.resourceGroupName(), storageAccount.name()) - .withPublicAccess(PublicAccess.NONE) - .createAsync()); - } - - private CaptureDescription cloneCurrentSettings() { - Objects.requireNonNull(this.currentSettings); - CaptureDescription clone = new CaptureDescription(); - clone.withSizeLimitInBytes(this.currentSettings.sizeLimitInBytes()); - clone.withSkipEmptyArchives(this.currentSettings.skipEmptyArchives()); - clone.withIntervalInSeconds(this.currentSettings.intervalInSeconds()); - clone.withEnabled(this.currentSettings.enabled()); - clone.withEncoding(this.currentSettings.encoding()); - if (this.currentSettings.destination() != null) { - clone.withDestination(new Destination()); - clone.destination().withArchiveNameFormat(this.currentSettings.destination().archiveNameFormat()); - clone.destination().withBlobContainer(this.currentSettings.destination().blobContainer()); - clone.destination().withName(this.currentSettings.destination().name()); - clone.destination().withStorageAccountResourceId( - this.currentSettings.destination().storageAccountResourceId()); - } else { - clone.withDestination(new Destination()); - } - return clone; - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/EventHubManagementClientBuilder.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/EventHubManagementClientBuilder.java deleted file mode 100644 index aa657dc2d4b0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/EventHubManagementClientBuilder.java +++ /dev/null @@ -1,149 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.implementation; - -import com.azure.core.annotation.ServiceClientBuilder; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.policy.CookiePolicy; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerAdapter; -import java.time.Duration; - -/** A builder for creating a new instance of the EventHubManagementClientImpl type. */ -@ServiceClientBuilder(serviceClients = {EventHubManagementClientImpl.class}) -public final class EventHubManagementClientBuilder { - /* - * Subscription credentials that uniquely identify a Microsoft Azure - * subscription. The subscription ID forms part of the URI for every - * service call. - */ - private String subscriptionId; - - /** - * Sets Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms - * part of the URI for every service call. - * - * @param subscriptionId the subscriptionId value. - * @return the EventHubManagementClientBuilder. - */ - public EventHubManagementClientBuilder subscriptionId(String subscriptionId) { - this.subscriptionId = subscriptionId; - return this; - } - - /* - * server parameter - */ - private String endpoint; - - /** - * Sets server parameter. - * - * @param endpoint the endpoint value. - * @return the EventHubManagementClientBuilder. - */ - public EventHubManagementClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * The environment to connect to - */ - private AzureEnvironment environment; - - /** - * Sets The environment to connect to. - * - * @param environment the environment value. - * @return the EventHubManagementClientBuilder. - */ - public EventHubManagementClientBuilder environment(AzureEnvironment environment) { - this.environment = environment; - return this; - } - - /* - * The default poll interval for long-running operation - */ - private Duration defaultPollInterval; - - /** - * Sets The default poll interval for long-running operation. - * - * @param defaultPollInterval the defaultPollInterval value. - * @return the EventHubManagementClientBuilder. - */ - public EventHubManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = defaultPollInterval; - return this; - } - - /* - * The HTTP pipeline to send requests through - */ - private HttpPipeline pipeline; - - /** - * Sets The HTTP pipeline to send requests through. - * - * @param pipeline the pipeline value. - * @return the EventHubManagementClientBuilder. - */ - public EventHubManagementClientBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; - return this; - } - - /* - * The serializer to serialize an object into a string - */ - private SerializerAdapter serializerAdapter; - - /** - * Sets The serializer to serialize an object into a string. - * - * @param serializerAdapter the serializerAdapter value. - * @return the EventHubManagementClientBuilder. - */ - public EventHubManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { - this.serializerAdapter = serializerAdapter; - return this; - } - - /** - * Builds an instance of EventHubManagementClientImpl with the provided parameters. - * - * @return an instance of EventHubManagementClientImpl. - */ - public EventHubManagementClientImpl buildClient() { - if (endpoint == null) { - this.endpoint = "https://management.azure.com"; - } - if (environment == null) { - this.environment = AzureEnvironment.AZURE; - } - if (defaultPollInterval == null) { - this.defaultPollInterval = Duration.ofSeconds(30); - } - if (pipeline == null) { - this.pipeline = - new HttpPipelineBuilder() - .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) - .build(); - } - if (serializerAdapter == null) { - this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); - } - EventHubManagementClientImpl client = - new EventHubManagementClientImpl( - pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); - return client; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/EventHubManagementClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/EventHubManagementClientImpl.java deleted file mode 100644 index f01e02427dca..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/EventHubManagementClientImpl.java +++ /dev/null @@ -1,236 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.implementation; - -import com.azure.core.annotation.ServiceClient; -import com.azure.core.http.HttpPipeline; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.serializer.SerializerAdapter; -import com.azure.resourcemanager.eventhubs.fluent.ClustersClient; -import com.azure.resourcemanager.eventhubs.fluent.ConsumerGroupsClient; -import com.azure.resourcemanager.eventhubs.fluent.DisasterRecoveryConfigsClient; -import com.azure.resourcemanager.eventhubs.fluent.EventHubManagementClient; -import com.azure.resourcemanager.eventhubs.fluent.EventHubsClient; -import com.azure.resourcemanager.eventhubs.fluent.NamespacesClient; -import com.azure.resourcemanager.eventhubs.fluent.OperationsClient; -import com.azure.resourcemanager.eventhubs.fluent.PrivateEndpointConnectionsClient; -import com.azure.resourcemanager.eventhubs.fluent.PrivateLinkResourcesClient; -import com.azure.resourcemanager.eventhubs.fluent.RegionsClient; -import com.azure.resourcemanager.resources.fluentcore.AzureServiceClient; -import java.time.Duration; - -/** Initializes a new instance of the EventHubManagementClientImpl type. */ -@ServiceClient(builder = EventHubManagementClientBuilder.class) -public final class EventHubManagementClientImpl extends AzureServiceClient implements EventHubManagementClient { - private final ClientLogger logger = new ClientLogger(EventHubManagementClientImpl.class); - - /** - * Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of - * the URI for every service call. - */ - private final String subscriptionId; - - /** - * Gets Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms - * part of the URI for every service call. - * - * @return the subscriptionId value. - */ - public String getSubscriptionId() { - return this.subscriptionId; - } - - /** server parameter. */ - private final String endpoint; - - /** - * Gets server parameter. - * - * @return the endpoint value. - */ - public String getEndpoint() { - return this.endpoint; - } - - /** The HTTP pipeline to send requests through. */ - private final HttpPipeline httpPipeline; - - /** - * Gets The HTTP pipeline to send requests through. - * - * @return the httpPipeline value. - */ - public HttpPipeline getHttpPipeline() { - return this.httpPipeline; - } - - /** The serializer to serialize an object into a string. */ - private final SerializerAdapter serializerAdapter; - - /** - * Gets The serializer to serialize an object into a string. - * - * @return the serializerAdapter value. - */ - SerializerAdapter getSerializerAdapter() { - return this.serializerAdapter; - } - - /** The default poll interval for long-running operation. */ - private final Duration defaultPollInterval; - - /** - * Gets The default poll interval for long-running operation. - * - * @return the defaultPollInterval value. - */ - public Duration getDefaultPollInterval() { - return this.defaultPollInterval; - } - - /** The ClustersClient object to access its operations. */ - private final ClustersClient clusters; - - /** - * Gets the ClustersClient object to access its operations. - * - * @return the ClustersClient object. - */ - public ClustersClient getClusters() { - return this.clusters; - } - - /** The NamespacesClient object to access its operations. */ - private final NamespacesClient namespaces; - - /** - * Gets the NamespacesClient object to access its operations. - * - * @return the NamespacesClient object. - */ - public NamespacesClient getNamespaces() { - return this.namespaces; - } - - /** The PrivateEndpointConnectionsClient object to access its operations. */ - private final PrivateEndpointConnectionsClient privateEndpointConnections; - - /** - * Gets the PrivateEndpointConnectionsClient object to access its operations. - * - * @return the PrivateEndpointConnectionsClient object. - */ - public PrivateEndpointConnectionsClient getPrivateEndpointConnections() { - return this.privateEndpointConnections; - } - - /** The PrivateLinkResourcesClient object to access its operations. */ - private final PrivateLinkResourcesClient privateLinkResources; - - /** - * Gets the PrivateLinkResourcesClient object to access its operations. - * - * @return the PrivateLinkResourcesClient object. - */ - public PrivateLinkResourcesClient getPrivateLinkResources() { - return this.privateLinkResources; - } - - /** The DisasterRecoveryConfigsClient object to access its operations. */ - private final DisasterRecoveryConfigsClient disasterRecoveryConfigs; - - /** - * Gets the DisasterRecoveryConfigsClient object to access its operations. - * - * @return the DisasterRecoveryConfigsClient object. - */ - public DisasterRecoveryConfigsClient getDisasterRecoveryConfigs() { - return this.disasterRecoveryConfigs; - } - - /** The EventHubsClient object to access its operations. */ - private final EventHubsClient eventHubs; - - /** - * Gets the EventHubsClient object to access its operations. - * - * @return the EventHubsClient object. - */ - public EventHubsClient getEventHubs() { - return this.eventHubs; - } - - /** The ConsumerGroupsClient object to access its operations. */ - private final ConsumerGroupsClient consumerGroups; - - /** - * Gets the ConsumerGroupsClient object to access its operations. - * - * @return the ConsumerGroupsClient object. - */ - public ConsumerGroupsClient getConsumerGroups() { - return this.consumerGroups; - } - - /** The OperationsClient object to access its operations. */ - private final OperationsClient operations; - - /** - * Gets the OperationsClient object to access its operations. - * - * @return the OperationsClient object. - */ - public OperationsClient getOperations() { - return this.operations; - } - - /** The RegionsClient object to access its operations. */ - private final RegionsClient regions; - - /** - * Gets the RegionsClient object to access its operations. - * - * @return the RegionsClient object. - */ - public RegionsClient getRegions() { - return this.regions; - } - - /** - * Initializes an instance of EventHubManagementClient client. - * - * @param httpPipeline The HTTP pipeline to send requests through. - * @param serializerAdapter The serializer to serialize an object into a string. - * @param defaultPollInterval The default poll interval for long-running operation. - * @param environment The Azure environment. - * @param subscriptionId Subscription credentials that uniquely identify a Microsoft Azure subscription. The - * subscription ID forms part of the URI for every service call. - * @param endpoint server parameter. - */ - EventHubManagementClientImpl( - HttpPipeline httpPipeline, - SerializerAdapter serializerAdapter, - Duration defaultPollInterval, - AzureEnvironment environment, - String subscriptionId, - String endpoint) { - super(httpPipeline, serializerAdapter, environment); - this.httpPipeline = httpPipeline; - this.serializerAdapter = serializerAdapter; - this.defaultPollInterval = defaultPollInterval; - this.subscriptionId = subscriptionId; - this.endpoint = endpoint; - this.clusters = new ClustersClientImpl(this); - this.namespaces = new NamespacesClientImpl(this); - this.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(this); - this.privateLinkResources = new PrivateLinkResourcesClientImpl(this); - this.disasterRecoveryConfigs = new DisasterRecoveryConfigsClientImpl(this); - this.eventHubs = new EventHubsClientImpl(this); - this.consumerGroups = new ConsumerGroupsClientImpl(this); - this.operations = new OperationsClientImpl(this); - this.regions = new RegionsClientImpl(this); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/EventHubNamespaceAuthorizationRuleImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/EventHubNamespaceAuthorizationRuleImpl.java deleted file mode 100644 index 584b932b4f3a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/EventHubNamespaceAuthorizationRuleImpl.java +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.eventhubs.implementation; - -import com.azure.resourcemanager.eventhubs.EventHubsManager; -import com.azure.resourcemanager.eventhubs.fluent.models.AccessKeysInner; -import com.azure.resourcemanager.eventhubs.fluent.models.AuthorizationRuleInner; -import com.azure.resourcemanager.eventhubs.models.EventHubNamespace; -import com.azure.resourcemanager.eventhubs.models.EventHubNamespaceAuthorizationRule; -import com.azure.resourcemanager.eventhubs.models.KeyType; -import com.azure.resourcemanager.eventhubs.models.RegenerateAccessKeyParameters; -import reactor.core.publisher.Mono; - -import java.util.Objects; - -/** - * Implementation for {@link EventHubNamespaceAuthorizationRule}. - */ -class EventHubNamespaceAuthorizationRuleImpl extends AuthorizationRuleBaseImpl - implements - EventHubNamespaceAuthorizationRule, - EventHubNamespaceAuthorizationRule.Definition, - EventHubNamespaceAuthorizationRule.Update { - - private Ancestors.OneAncestor ancestor; - - EventHubNamespaceAuthorizationRuleImpl(String name, AuthorizationRuleInner inner, EventHubsManager manager) { - super(name, inner, manager); - this.ancestor = new Ancestors().new OneAncestor(inner.id()); - } - - EventHubNamespaceAuthorizationRuleImpl(String name, EventHubsManager manager) { - super(name, new AuthorizationRuleInner(), manager); - } - - @Override - public String namespaceResourceGroupName() { - return this.ancestor().resourceGroupName(); - } - - @Override - public String namespaceName() { - return this.ancestor().ancestor1Name(); - } - - @Override - public EventHubNamespaceAuthorizationRuleImpl withExistingNamespaceId(String namespaceResourceId) { - this.ancestor = new Ancestors().new OneAncestor(selfId(namespaceResourceId)); - return this; - } - - @Override - public EventHubNamespaceAuthorizationRuleImpl withExistingNamespace( - String resourceGroupName, String namespaceName) { - this.ancestor = new Ancestors().new OneAncestor(resourceGroupName, namespaceName); - return this; - } - - @Override - public EventHubNamespaceAuthorizationRuleImpl withExistingNamespace(EventHubNamespace namespace) { - this.ancestor = new Ancestors().new OneAncestor(selfId(namespace.id())); - return this; - } - - @Override - protected Mono getInnerAsync() { - return this.manager.serviceClient().getNamespaces() - .getAuthorizationRuleAsync(this.ancestor().resourceGroupName(), - this.ancestor().ancestor1Name(), - this.name()); - } - - @Override - public Mono createResourceAsync() { - return this.manager.serviceClient().getNamespaces() - .createOrUpdateAuthorizationRuleAsync(this.ancestor().resourceGroupName(), - this.ancestor().ancestor1Name(), - this.name(), - new AuthorizationRuleInner().withRights(this.innerModel().rights())) - .map(innerToFluentMap(this)); - } - - @Override - protected Mono getKeysInnerAsync() { - return this.manager.serviceClient().getNamespaces() - .listKeysAsync(this.ancestor().resourceGroupName(), - this.ancestor().ancestor1Name(), - this.name()); - } - - @Override - protected Mono regenerateKeysInnerAsync(KeyType keyType) { - final RegenerateAccessKeyParameters regenKeyInner = new RegenerateAccessKeyParameters() - .withKeyType(keyType); - return this.manager.serviceClient().getNamespaces() - .regenerateKeysAsync(this.ancestor().resourceGroupName(), - this.ancestor().ancestor1Name(), - this.name(), - regenKeyInner); - } - - private Ancestors.OneAncestor ancestor() { - Objects.requireNonNull(this.ancestor); - return this.ancestor; - } - - private String selfId(String parentId) { - return String.format("%s/authorizationRules/%s", parentId, this.name()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/EventHubNamespaceAuthorizationRulesImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/EventHubNamespaceAuthorizationRulesImpl.java deleted file mode 100644 index 4eb91ff7ff03..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/EventHubNamespaceAuthorizationRulesImpl.java +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.eventhubs.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.eventhubs.EventHubsManager; -import com.azure.resourcemanager.eventhubs.fluent.NamespacesClient; -import com.azure.resourcemanager.eventhubs.fluent.models.AuthorizationRuleInner; -import com.azure.resourcemanager.eventhubs.models.EventHubNamespaceAuthorizationRule; -import com.azure.resourcemanager.eventhubs.models.EventHubNamespaceAuthorizationRules; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceId; -import reactor.core.publisher.Mono; - -import java.util.Objects; -import com.azure.resourcemanager.resources.fluentcore.utils.PagedConverter; - -/** - * Implementation for {@link EventHubNamespaceAuthorizationRules}. - */ -public final class EventHubNamespaceAuthorizationRulesImpl - extends AuthorizationRulesBaseImpl - implements EventHubNamespaceAuthorizationRules { - - public EventHubNamespaceAuthorizationRulesImpl(EventHubsManager manager) { - super(manager, manager.serviceClient().getNamespaces()); - } - - @Override - public EventHubNamespaceAuthorizationRuleImpl define(String name) { - return new EventHubNamespaceAuthorizationRuleImpl(name, this.manager); - } - - @Override - public Mono getByIdAsync(String id) { - Objects.requireNonNull(id); - ResourceId resourceId = ResourceId.fromString(id); - return getByNameAsync(resourceId.resourceGroupName(), - resourceId.parent().name(), - resourceId.name()); - } - - @Override - public EventHubNamespaceAuthorizationRule getByName(String resourceGroupName, String namespaceName, String name) { - return getByNameAsync(resourceGroupName, namespaceName, name).block(); - } - - @Override - public Mono getByNameAsync( - String resourceGroupName, String namespaceName, String name) { - return this.innerModel().getAuthorizationRuleAsync(resourceGroupName, - namespaceName, - name) - .map(this::wrapModel); - } - - @Override - public PagedIterable listByNamespace( - final String resourceGroupName, final String namespaceName) { - return PagedConverter.mapPage(innerModel() - .listAuthorizationRules(resourceGroupName, namespaceName), - this::wrapModel); - } - - @Override - public PagedFlux listByNamespaceAsync( - String resourceGroupName, String namespaceName) { - return PagedConverter.mapPage(this.innerModel() - .listAuthorizationRulesAsync(resourceGroupName, namespaceName), - this::wrapModel); - } - - @Override - public Mono deleteByIdAsync(String id) { - Objects.requireNonNull(id); - ResourceId resourceId = ResourceId.fromString(id); - - return deleteByNameAsync(resourceId.resourceGroupName(), - resourceId.parent().name(), - resourceId.name()); - } - - @Override - public Mono deleteByNameAsync(String resourceGroupName, String namespaceName, String name) { - return this.innerModel().deleteAuthorizationRuleAsync(resourceGroupName, - namespaceName, - name); - } - - @Override - public void deleteByName(String resourceGroupName, String namespaceName, String name) { - deleteByNameAsync(resourceGroupName, namespaceName, name).block(); - } - - @Override - protected EventHubNamespaceAuthorizationRuleImpl wrapModel(AuthorizationRuleInner innerModel) { - return new EventHubNamespaceAuthorizationRuleImpl(innerModel.name(), innerModel, this.manager); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/EventHubNamespaceImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/EventHubNamespaceImpl.java deleted file mode 100644 index 2c1a38c325f1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/EventHubNamespaceImpl.java +++ /dev/null @@ -1,273 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.eventhubs.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.eventhubs.EventHubsManager; -import com.azure.resourcemanager.eventhubs.fluent.models.EHNamespaceInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.GroupableResourceImpl; -import com.azure.resourcemanager.resources.fluentcore.dag.VoidIndexable; -import com.azure.resourcemanager.resources.fluentcore.model.Indexable; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import com.azure.resourcemanager.eventhubs.models.EventHub; -import com.azure.resourcemanager.eventhubs.models.EventHubNamespace; -import com.azure.resourcemanager.eventhubs.models.EventHubNamespaceAuthorizationRule; -import com.azure.resourcemanager.eventhubs.models.EventHubNamespaceSkuType; -import com.azure.resourcemanager.eventhubs.models.Sku; -import com.azure.resourcemanager.eventhubs.models.SkuName; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -import java.time.OffsetDateTime; -import java.util.UUID; - -/** - * Implementation for {@link EventHubNamespace}. - */ -class EventHubNamespaceImpl - extends GroupableResourceImpl - implements - EventHubNamespace, - EventHubNamespace.Definition, - EventHubNamespace.Update { - - private Flux postRunTasks; - - protected EventHubNamespaceImpl(String name, EHNamespaceInner innerObject, EventHubsManager manager) { - super(name, innerObject, manager); - } - - @Override - public EventHubNamespaceSkuType sku() { - return new EventHubNamespaceSkuType(this.innerModel().sku()); - } - - @Override - public String azureInsightMetricId() { - return this.innerModel().metricId(); - } - - @Override - public String serviceBusEndpoint() { - return this.innerModel().serviceBusEndpoint(); - } - - @Override - public OffsetDateTime createdAt() { - return this.innerModel().createdAt(); - } - - @Override - public OffsetDateTime updatedAt() { - return this.innerModel().updatedAt(); - } - - @Override - public String provisioningState() { - return this.innerModel().provisioningState(); - } - - @Override - public boolean isAutoScaleEnabled() { - return ResourceManagerUtils.toPrimitiveBoolean(this.innerModel().isAutoInflateEnabled()); - } - - @Override - public int currentThroughputUnits() { - return ResourceManagerUtils.toPrimitiveInt(this.innerModel().sku().capacity()); - } - - @Override - public int throughputUnitsUpperLimit() { - return ResourceManagerUtils.toPrimitiveInt(this.innerModel().maximumThroughputUnits()); - } - - @Override - public EventHubNamespaceImpl withNewEventHub(final String eventHubName) { - concatPostRunTask(manager().eventHubs() - .define(eventHubName) - .withExistingNamespace(resourceGroupName(), name()) - .createAsync() - .cast(Indexable.class)); - return this; - } - - @Override - public EventHubNamespaceImpl withNewEventHub(final String eventHubName, final int partitionCount) { - concatPostRunTask(manager().eventHubs() - .define(eventHubName) - .withExistingNamespace(resourceGroupName(), name()) - .withPartitionCount(partitionCount) - .createAsync() - .cast(Indexable.class)); - return this; - } - - @Override - public EventHubNamespaceImpl withNewEventHub( - final String eventHubName, final int partitionCount, final int retentionPeriodInDays) { - concatPostRunTask(manager().eventHubs() - .define(eventHubName) - .withExistingNamespace(resourceGroupName(), name()) - .withPartitionCount(partitionCount) - .withRetentionPeriodInDays(retentionPeriodInDays) - .createAsync() - .cast(Indexable.class)); - return this; - } - - @Override - public Update withoutEventHub(final String eventHubName) { - concatPostRunTask(manager().eventHubs() - .deleteByNameAsync(resourceGroupName(), name(), eventHubName) - .map(aVoid -> new VoidIndexable(UUID.randomUUID().toString()))); - return this; - } - - @Override - public EventHubNamespaceImpl withNewSendRule(final String ruleName) { - concatPostRunTask(manager().namespaceAuthorizationRules() - .define(ruleName) - .withExistingNamespace(resourceGroupName(), name()) - .withSendAccess() - .createAsync() - .cast(Indexable.class)); - return this; - } - - @Override - public EventHubNamespaceImpl withNewListenRule(final String ruleName) { - concatPostRunTask(manager().namespaceAuthorizationRules() - .define(ruleName) - .withExistingNamespace(resourceGroupName(), name()) - .withListenAccess() - .createAsync() - .cast(Indexable.class)); - return this; - } - - @Override - public EventHubNamespaceImpl withNewManageRule(final String ruleName) { - concatPostRunTask(manager().namespaceAuthorizationRules() - .define(ruleName) - .withExistingNamespace(resourceGroupName(), name()) - .withManageAccess() - .createAsync() - .cast(Indexable.class)); - return this; - } - - @Override - public EventHubNamespaceImpl withoutAuthorizationRule(final String ruleName) { - concatPostRunTask(manager().namespaceAuthorizationRules() - .deleteByNameAsync(resourceGroupName(), name(), ruleName) - .map(aVoid -> new VoidIndexable(UUID.randomUUID().toString()))); - return this; - } - - @Override - public EventHubNamespaceImpl withAutoScaling() { - // Auto-inflate requires a Sku > 'Basic' with capacity. - this.setDefaultSkuIfNotSet(); - this.innerModel().withIsAutoInflateEnabled(true); - if (this.innerModel().maximumThroughputUnits() == null) { - // Required when auto-inflate is set & use portal default. - this.withThroughputUnitsUpperLimit(20); - } - return this; - } - - @Override - public EventHubNamespaceImpl withSku(EventHubNamespaceSkuType namespaceSku) { - Sku newSkuInner = new Sku() - .withName(namespaceSku.name()) - .withTier(namespaceSku.tier()) - .withCapacity(null); - Sku currentSkuInner = this.innerModel().sku(); - - boolean isDifferent = currentSkuInner == null || !currentSkuInner.name().equals(newSkuInner.name()); - if (isDifferent) { - this.innerModel().withSku(newSkuInner); - if (newSkuInner.name().equals(SkuName.STANDARD)) { - newSkuInner.withCapacity(1); - } - } - return this; - } - - @Override - public EventHubNamespaceImpl withCurrentThroughputUnits(int units) { - this.setDefaultSkuIfNotSet(); - this.innerModel().sku().withCapacity(units); - return this; - } - - @Override - public EventHubNamespaceImpl withThroughputUnitsUpperLimit(int units) { - this.innerModel().withMaximumThroughputUnits(units); - return this; - } - - @Override - public void beforeGroupCreateOrUpdate() { - if (postRunTasks != null) { - addPostRunDependent(context -> postRunTasks.last()); - } - } - - @Override - public Mono createResourceAsync() { - return this.manager().serviceClient().getNamespaces() - .createOrUpdateAsync(resourceGroupName(), name(), this.innerModel()) - .map(innerToFluentMap(this)); - } - - @Override - public Mono afterPostRunAsync(boolean isGroupFaulted) { - postRunTasks = null; - return Mono.empty(); - } - - @Override - public PagedFlux listEventHubsAsync() { - return this.manager().eventHubs().listByNamespaceAsync(resourceGroupName(), name()); - } - - @Override - public PagedFlux listAuthorizationRulesAsync() { - return this.manager().namespaceAuthorizationRules() - .listByNamespaceAsync(this.resourceGroupName(), this.name()); - } - - @Override - public PagedIterable listEventHubs() { - return this.manager().eventHubs().listByNamespace(resourceGroupName(), name()); - } - - @Override - public PagedIterable listAuthorizationRules() { - return this.manager().namespaceAuthorizationRules() - .listByNamespace(this.resourceGroupName(), this.name()); - } - - @Override - protected Mono getInnerAsync() { - return this.manager().serviceClient().getNamespaces() - .getByResourceGroupAsync(this.resourceGroupName(), this.name()); - } - - private void setDefaultSkuIfNotSet() { - if (this.innerModel().sku() == null) { - this.withSku(EventHubNamespaceSkuType.STANDARD); - } - } - - private void concatPostRunTask(Mono task) { - if (postRunTasks == null) { - postRunTasks = Flux.empty(); - } - postRunTasks = postRunTasks.concatWith(task); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/EventHubNamespacesImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/EventHubNamespacesImpl.java deleted file mode 100644 index 8af7de039802..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/EventHubNamespacesImpl.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.eventhubs.implementation; - -import com.azure.resourcemanager.eventhubs.EventHubsManager; -import com.azure.resourcemanager.eventhubs.fluent.NamespacesClient; -import com.azure.resourcemanager.eventhubs.fluent.models.EHNamespaceInner; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.TopLevelModifiableResourcesImpl; -import com.azure.resourcemanager.eventhubs.models.EventHubNamespace; -import com.azure.resourcemanager.eventhubs.models.EventHubNamespaceAuthorizationRules; -import com.azure.resourcemanager.eventhubs.models.EventHubNamespaces; -import com.azure.resourcemanager.eventhubs.models.EventHubs; - -/** - * Implementation for {@link EventHubNamespaces}. - */ -public final class EventHubNamespacesImpl - extends TopLevelModifiableResourcesImpl< - EventHubNamespace, - EventHubNamespaceImpl, - EHNamespaceInner, - NamespacesClient, - EventHubsManager> - implements EventHubNamespaces { - - public EventHubNamespacesImpl(EventHubsManager manager) { - super(manager.serviceClient().getNamespaces(), manager); - } - - @Override - protected EventHubNamespaceImpl wrapModel(String name) { - return new EventHubNamespaceImpl(name, new EHNamespaceInner(), this.manager()); - } - - @Override - protected EventHubNamespaceImpl wrapModel(EHNamespaceInner inner) { - return new EventHubNamespaceImpl(inner.name(), inner, this.manager()); - } - - @Override - public EventHubNamespaceImpl define(String name) { - return wrapModel(name); - } - - @Override - public EventHubNamespaceAuthorizationRules authorizationRules() { - return this.manager().namespaceAuthorizationRules(); - } - - @Override - public EventHubs eventHubs() { - return this.manager().eventHubs(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/EventHubsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/EventHubsClientImpl.java deleted file mode 100644 index 73a46964aeef..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/EventHubsClientImpl.java +++ /dev/null @@ -1,2362 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.eventhubs.fluent.EventHubsClient; -import com.azure.resourcemanager.eventhubs.fluent.models.AccessKeysInner; -import com.azure.resourcemanager.eventhubs.fluent.models.AuthorizationRuleInner; -import com.azure.resourcemanager.eventhubs.fluent.models.EventhubInner; -import com.azure.resourcemanager.eventhubs.models.AuthorizationRuleListResult; -import com.azure.resourcemanager.eventhubs.models.EventHubListResult; -import com.azure.resourcemanager.eventhubs.models.RegenerateAccessKeyParameters; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in EventHubsClient. */ -public final class EventHubsClientImpl implements EventHubsClient { - private final ClientLogger logger = new ClientLogger(EventHubsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final EventHubsService service; - - /** The service client containing this operation class. */ - private final EventHubManagementClientImpl client; - - /** - * Initializes an instance of EventHubsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - EventHubsClientImpl(EventHubManagementClientImpl client) { - this.service = - RestProxy.create(EventHubsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for EventHubManagementClientEventHubs to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "EventHubManagementCl") - private interface EventHubsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces" - + "/{namespaceName}/eventhubs/{eventHubName}/authorizationRules") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAuthorizationRules( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("namespaceName") String namespaceName, - @PathParam("eventHubName") String eventHubName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces" - + "/{namespaceName}/eventhubs/{eventHubName}/authorizationRules/{authorizationRuleName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdateAuthorizationRule( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("namespaceName") String namespaceName, - @PathParam("eventHubName") String eventHubName, - @PathParam("authorizationRuleName") String authorizationRuleName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") AuthorizationRuleInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces" - + "/{namespaceName}/eventhubs/{eventHubName}/authorizationRules/{authorizationRuleName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getAuthorizationRule( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("namespaceName") String namespaceName, - @PathParam("eventHubName") String eventHubName, - @PathParam("authorizationRuleName") String authorizationRuleName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces" - + "/{namespaceName}/eventhubs/{eventHubName}/authorizationRules/{authorizationRuleName}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteAuthorizationRule( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("namespaceName") String namespaceName, - @PathParam("eventHubName") String eventHubName, - @PathParam("authorizationRuleName") String authorizationRuleName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces" - + "/{namespaceName}/eventhubs/{eventHubName}/authorizationRules/{authorizationRuleName}/listKeys") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listKeys( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("namespaceName") String namespaceName, - @PathParam("eventHubName") String eventHubName, - @PathParam("authorizationRuleName") String authorizationRuleName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces" - + "/{namespaceName}/eventhubs/{eventHubName}/authorizationRules/{authorizationRuleName}/regenerateKeys") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> regenerateKeys( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("namespaceName") String namespaceName, - @PathParam("eventHubName") String eventHubName, - @PathParam("authorizationRuleName") String authorizationRuleName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") RegenerateAccessKeyParameters parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces" - + "/{namespaceName}/eventhubs") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByNamespace( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("namespaceName") String namespaceName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("$skip") Integer skip, - @QueryParam("$top") Integer top, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces" - + "/{namespaceName}/eventhubs/{eventHubName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("namespaceName") String namespaceName, - @PathParam("eventHubName") String eventHubName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") EventhubInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces" - + "/{namespaceName}/eventhubs/{eventHubName}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("namespaceName") String namespaceName, - @PathParam("eventHubName") String eventHubName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces" - + "/{namespaceName}/eventhubs/{eventHubName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("namespaceName") String namespaceName, - @PathParam("eventHubName") String eventHubName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAuthorizationRulesNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByNamespaceNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets the authorization rules for an Event Hub. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the authorization rules for an Event Hub. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAuthorizationRulesSinglePageAsync( - String resourceGroupName, String namespaceName, String eventHubName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (eventHubName == null) { - return Mono.error(new IllegalArgumentException("Parameter eventHubName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listAuthorizationRules( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - eventHubName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the authorization rules for an Event Hub. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the authorization rules for an Event Hub. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAuthorizationRulesSinglePageAsync( - String resourceGroupName, String namespaceName, String eventHubName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (eventHubName == null) { - return Mono.error(new IllegalArgumentException("Parameter eventHubName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listAuthorizationRules( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - eventHubName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets the authorization rules for an Event Hub. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the authorization rules for an Event Hub. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAuthorizationRulesAsync( - String resourceGroupName, String namespaceName, String eventHubName) { - return new PagedFlux<>( - () -> listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, eventHubName), - nextLink -> listAuthorizationRulesNextSinglePageAsync(nextLink)); - } - - /** - * Gets the authorization rules for an Event Hub. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the authorization rules for an Event Hub. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAuthorizationRulesAsync( - String resourceGroupName, String namespaceName, String eventHubName, Context context) { - return new PagedFlux<>( - () -> listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, eventHubName, context), - nextLink -> listAuthorizationRulesNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets the authorization rules for an Event Hub. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the authorization rules for an Event Hub. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAuthorizationRules( - String resourceGroupName, String namespaceName, String eventHubName) { - return new PagedIterable<>(listAuthorizationRulesAsync(resourceGroupName, namespaceName, eventHubName)); - } - - /** - * Gets the authorization rules for an Event Hub. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the authorization rules for an Event Hub. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAuthorizationRules( - String resourceGroupName, String namespaceName, String eventHubName, Context context) { - return new PagedIterable<>( - listAuthorizationRulesAsync(resourceGroupName, namespaceName, eventHubName, context)); - } - - /** - * Creates or updates an AuthorizationRule for the specified Event Hub. Creation/update of the AuthorizationRule - * will take a few seconds to take effect. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param authorizationRuleName The authorization rule name. - * @param parameters The shared access AuthorizationRule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single item in a List or Get AuthorizationRule operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateAuthorizationRuleWithResponseAsync( - String resourceGroupName, - String namespaceName, - String eventHubName, - String authorizationRuleName, - AuthorizationRuleInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (eventHubName == null) { - return Mono.error(new IllegalArgumentException("Parameter eventHubName is required and cannot be null.")); - } - if (authorizationRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdateAuthorizationRule( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - eventHubName, - authorizationRuleName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates an AuthorizationRule for the specified Event Hub. Creation/update of the AuthorizationRule - * will take a few seconds to take effect. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param authorizationRuleName The authorization rule name. - * @param parameters The shared access AuthorizationRule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single item in a List or Get AuthorizationRule operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateAuthorizationRuleWithResponseAsync( - String resourceGroupName, - String namespaceName, - String eventHubName, - String authorizationRuleName, - AuthorizationRuleInner parameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (eventHubName == null) { - return Mono.error(new IllegalArgumentException("Parameter eventHubName is required and cannot be null.")); - } - if (authorizationRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdateAuthorizationRule( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - eventHubName, - authorizationRuleName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Creates or updates an AuthorizationRule for the specified Event Hub. Creation/update of the AuthorizationRule - * will take a few seconds to take effect. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param authorizationRuleName The authorization rule name. - * @param parameters The shared access AuthorizationRule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single item in a List or Get AuthorizationRule operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAuthorizationRuleAsync( - String resourceGroupName, - String namespaceName, - String eventHubName, - String authorizationRuleName, - AuthorizationRuleInner parameters) { - return createOrUpdateAuthorizationRuleWithResponseAsync( - resourceGroupName, namespaceName, eventHubName, authorizationRuleName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates or updates an AuthorizationRule for the specified Event Hub. Creation/update of the AuthorizationRule - * will take a few seconds to take effect. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param authorizationRuleName The authorization rule name. - * @param parameters The shared access AuthorizationRule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single item in a List or Get AuthorizationRule operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AuthorizationRuleInner createOrUpdateAuthorizationRule( - String resourceGroupName, - String namespaceName, - String eventHubName, - String authorizationRuleName, - AuthorizationRuleInner parameters) { - return createOrUpdateAuthorizationRuleAsync( - resourceGroupName, namespaceName, eventHubName, authorizationRuleName, parameters) - .block(); - } - - /** - * Creates or updates an AuthorizationRule for the specified Event Hub. Creation/update of the AuthorizationRule - * will take a few seconds to take effect. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param authorizationRuleName The authorization rule name. - * @param parameters The shared access AuthorizationRule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single item in a List or Get AuthorizationRule operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateAuthorizationRuleWithResponse( - String resourceGroupName, - String namespaceName, - String eventHubName, - String authorizationRuleName, - AuthorizationRuleInner parameters, - Context context) { - return createOrUpdateAuthorizationRuleWithResponseAsync( - resourceGroupName, namespaceName, eventHubName, authorizationRuleName, parameters, context) - .block(); - } - - /** - * Gets an AuthorizationRule for an Event Hub by rule name. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param authorizationRuleName The authorization rule name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an AuthorizationRule for an Event Hub by rule name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getAuthorizationRuleWithResponseAsync( - String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (eventHubName == null) { - return Mono.error(new IllegalArgumentException("Parameter eventHubName is required and cannot be null.")); - } - if (authorizationRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getAuthorizationRule( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - eventHubName, - authorizationRuleName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets an AuthorizationRule for an Event Hub by rule name. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param authorizationRuleName The authorization rule name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an AuthorizationRule for an Event Hub by rule name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getAuthorizationRuleWithResponseAsync( - String resourceGroupName, - String namespaceName, - String eventHubName, - String authorizationRuleName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (eventHubName == null) { - return Mono.error(new IllegalArgumentException("Parameter eventHubName is required and cannot be null.")); - } - if (authorizationRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getAuthorizationRule( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - eventHubName, - authorizationRuleName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets an AuthorizationRule for an Event Hub by rule name. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param authorizationRuleName The authorization rule name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an AuthorizationRule for an Event Hub by rule name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAuthorizationRuleAsync( - String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName) { - return getAuthorizationRuleWithResponseAsync( - resourceGroupName, namespaceName, eventHubName, authorizationRuleName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets an AuthorizationRule for an Event Hub by rule name. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param authorizationRuleName The authorization rule name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an AuthorizationRule for an Event Hub by rule name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AuthorizationRuleInner getAuthorizationRule( - String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName) { - return getAuthorizationRuleAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName).block(); - } - - /** - * Gets an AuthorizationRule for an Event Hub by rule name. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param authorizationRuleName The authorization rule name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an AuthorizationRule for an Event Hub by rule name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getAuthorizationRuleWithResponse( - String resourceGroupName, - String namespaceName, - String eventHubName, - String authorizationRuleName, - Context context) { - return getAuthorizationRuleWithResponseAsync( - resourceGroupName, namespaceName, eventHubName, authorizationRuleName, context) - .block(); - } - - /** - * Deletes an Event Hub AuthorizationRule. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param authorizationRuleName The authorization rule name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteAuthorizationRuleWithResponseAsync( - String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (eventHubName == null) { - return Mono.error(new IllegalArgumentException("Parameter eventHubName is required and cannot be null.")); - } - if (authorizationRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .deleteAuthorizationRule( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - eventHubName, - authorizationRuleName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes an Event Hub AuthorizationRule. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param authorizationRuleName The authorization rule name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteAuthorizationRuleWithResponseAsync( - String resourceGroupName, - String namespaceName, - String eventHubName, - String authorizationRuleName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (eventHubName == null) { - return Mono.error(new IllegalArgumentException("Parameter eventHubName is required and cannot be null.")); - } - if (authorizationRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .deleteAuthorizationRule( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - eventHubName, - authorizationRuleName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Deletes an Event Hub AuthorizationRule. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param authorizationRuleName The authorization rule name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAuthorizationRuleAsync( - String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName) { - return deleteAuthorizationRuleWithResponseAsync( - resourceGroupName, namespaceName, eventHubName, authorizationRuleName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes an Event Hub AuthorizationRule. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param authorizationRuleName The authorization rule name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteAuthorizationRule( - String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName) { - deleteAuthorizationRuleAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName).block(); - } - - /** - * Deletes an Event Hub AuthorizationRule. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param authorizationRuleName The authorization rule name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteAuthorizationRuleWithResponse( - String resourceGroupName, - String namespaceName, - String eventHubName, - String authorizationRuleName, - Context context) { - return deleteAuthorizationRuleWithResponseAsync( - resourceGroupName, namespaceName, eventHubName, authorizationRuleName, context) - .block(); - } - - /** - * Gets the ACS and SAS connection strings for the Event Hub. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param authorizationRuleName The authorization rule name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ACS and SAS connection strings for the Event Hub. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listKeysWithResponseAsync( - String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (eventHubName == null) { - return Mono.error(new IllegalArgumentException("Parameter eventHubName is required and cannot be null.")); - } - if (authorizationRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listKeys( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - eventHubName, - authorizationRuleName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the ACS and SAS connection strings for the Event Hub. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param authorizationRuleName The authorization rule name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ACS and SAS connection strings for the Event Hub. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listKeysWithResponseAsync( - String resourceGroupName, - String namespaceName, - String eventHubName, - String authorizationRuleName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (eventHubName == null) { - return Mono.error(new IllegalArgumentException("Parameter eventHubName is required and cannot be null.")); - } - if (authorizationRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listKeys( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - eventHubName, - authorizationRuleName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets the ACS and SAS connection strings for the Event Hub. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param authorizationRuleName The authorization rule name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ACS and SAS connection strings for the Event Hub. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listKeysAsync( - String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName) { - return listKeysWithResponseAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the ACS and SAS connection strings for the Event Hub. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param authorizationRuleName The authorization rule name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ACS and SAS connection strings for the Event Hub. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AccessKeysInner listKeys( - String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName) { - return listKeysAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName).block(); - } - - /** - * Gets the ACS and SAS connection strings for the Event Hub. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param authorizationRuleName The authorization rule name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ACS and SAS connection strings for the Event Hub. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listKeysWithResponse( - String resourceGroupName, - String namespaceName, - String eventHubName, - String authorizationRuleName, - Context context) { - return listKeysWithResponseAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName, context) - .block(); - } - - /** - * Regenerates the ACS and SAS connection strings for the Event Hub. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param authorizationRuleName The authorization rule name. - * @param parameters Parameters supplied to regenerate the AuthorizationRule Keys (PrimaryKey/SecondaryKey). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return namespace/EventHub Connection String. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> regenerateKeysWithResponseAsync( - String resourceGroupName, - String namespaceName, - String eventHubName, - String authorizationRuleName, - RegenerateAccessKeyParameters parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (eventHubName == null) { - return Mono.error(new IllegalArgumentException("Parameter eventHubName is required and cannot be null.")); - } - if (authorizationRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .regenerateKeys( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - eventHubName, - authorizationRuleName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Regenerates the ACS and SAS connection strings for the Event Hub. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param authorizationRuleName The authorization rule name. - * @param parameters Parameters supplied to regenerate the AuthorizationRule Keys (PrimaryKey/SecondaryKey). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return namespace/EventHub Connection String. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> regenerateKeysWithResponseAsync( - String resourceGroupName, - String namespaceName, - String eventHubName, - String authorizationRuleName, - RegenerateAccessKeyParameters parameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (eventHubName == null) { - return Mono.error(new IllegalArgumentException("Parameter eventHubName is required and cannot be null.")); - } - if (authorizationRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .regenerateKeys( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - eventHubName, - authorizationRuleName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Regenerates the ACS and SAS connection strings for the Event Hub. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param authorizationRuleName The authorization rule name. - * @param parameters Parameters supplied to regenerate the AuthorizationRule Keys (PrimaryKey/SecondaryKey). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return namespace/EventHub Connection String. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono regenerateKeysAsync( - String resourceGroupName, - String namespaceName, - String eventHubName, - String authorizationRuleName, - RegenerateAccessKeyParameters parameters) { - return regenerateKeysWithResponseAsync( - resourceGroupName, namespaceName, eventHubName, authorizationRuleName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Regenerates the ACS and SAS connection strings for the Event Hub. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param authorizationRuleName The authorization rule name. - * @param parameters Parameters supplied to regenerate the AuthorizationRule Keys (PrimaryKey/SecondaryKey). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return namespace/EventHub Connection String. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AccessKeysInner regenerateKeys( - String resourceGroupName, - String namespaceName, - String eventHubName, - String authorizationRuleName, - RegenerateAccessKeyParameters parameters) { - return regenerateKeysAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName, parameters) - .block(); - } - - /** - * Regenerates the ACS and SAS connection strings for the Event Hub. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param authorizationRuleName The authorization rule name. - * @param parameters Parameters supplied to regenerate the AuthorizationRule Keys (PrimaryKey/SecondaryKey). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return namespace/EventHub Connection String. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response regenerateKeysWithResponse( - String resourceGroupName, - String namespaceName, - String eventHubName, - String authorizationRuleName, - RegenerateAccessKeyParameters parameters, - Context context) { - return regenerateKeysWithResponseAsync( - resourceGroupName, namespaceName, eventHubName, authorizationRuleName, parameters, context) - .block(); - } - - /** - * Gets all the Event Hubs in a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains - * a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting - * point to use for subsequent calls. - * @param top May be used to limit the number of results to the most recent N usageDetails. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the Event Hubs in a Namespace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByNamespaceSinglePageAsync( - String resourceGroupName, String namespaceName, Integer skip, Integer top) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByNamespace( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - apiVersion, - this.client.getSubscriptionId(), - skip, - top, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all the Event Hubs in a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains - * a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting - * point to use for subsequent calls. - * @param top May be used to limit the number of results to the most recent N usageDetails. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the Event Hubs in a Namespace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByNamespaceSinglePageAsync( - String resourceGroupName, String namespaceName, Integer skip, Integer top, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByNamespace( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - apiVersion, - this.client.getSubscriptionId(), - skip, - top, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all the Event Hubs in a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains - * a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting - * point to use for subsequent calls. - * @param top May be used to limit the number of results to the most recent N usageDetails. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the Event Hubs in a Namespace. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByNamespaceAsync( - String resourceGroupName, String namespaceName, Integer skip, Integer top) { - return new PagedFlux<>( - () -> listByNamespaceSinglePageAsync(resourceGroupName, namespaceName, skip, top), - nextLink -> listByNamespaceNextSinglePageAsync(nextLink)); - } - - /** - * Gets all the Event Hubs in a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the Event Hubs in a Namespace. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByNamespaceAsync(String resourceGroupName, String namespaceName) { - final Integer skip = null; - final Integer top = null; - return new PagedFlux<>( - () -> listByNamespaceSinglePageAsync(resourceGroupName, namespaceName, skip, top), - nextLink -> listByNamespaceNextSinglePageAsync(nextLink)); - } - - /** - * Gets all the Event Hubs in a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains - * a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting - * point to use for subsequent calls. - * @param top May be used to limit the number of results to the most recent N usageDetails. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the Event Hubs in a Namespace. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByNamespaceAsync( - String resourceGroupName, String namespaceName, Integer skip, Integer top, Context context) { - return new PagedFlux<>( - () -> listByNamespaceSinglePageAsync(resourceGroupName, namespaceName, skip, top, context), - nextLink -> listByNamespaceNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all the Event Hubs in a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the Event Hubs in a Namespace. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByNamespace(String resourceGroupName, String namespaceName) { - final Integer skip = null; - final Integer top = null; - return new PagedIterable<>(listByNamespaceAsync(resourceGroupName, namespaceName, skip, top)); - } - - /** - * Gets all the Event Hubs in a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains - * a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting - * point to use for subsequent calls. - * @param top May be used to limit the number of results to the most recent N usageDetails. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the Event Hubs in a Namespace. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByNamespace( - String resourceGroupName, String namespaceName, Integer skip, Integer top, Context context) { - return new PagedIterable<>(listByNamespaceAsync(resourceGroupName, namespaceName, skip, top, context)); - } - - /** - * Creates or updates a new Event Hub as a nested resource within a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param parameters Parameters supplied to create an Event Hub resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single item in List or Get Event Hub operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String namespaceName, String eventHubName, EventhubInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (eventHubName == null) { - return Mono.error(new IllegalArgumentException("Parameter eventHubName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - eventHubName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a new Event Hub as a nested resource within a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param parameters Parameters supplied to create an Event Hub resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single item in List or Get Event Hub operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, - String namespaceName, - String eventHubName, - EventhubInner parameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (eventHubName == null) { - return Mono.error(new IllegalArgumentException("Parameter eventHubName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - eventHubName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Creates or updates a new Event Hub as a nested resource within a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param parameters Parameters supplied to create an Event Hub resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single item in List or Get Event Hub operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, String namespaceName, String eventHubName, EventhubInner parameters) { - return createOrUpdateWithResponseAsync(resourceGroupName, namespaceName, eventHubName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates or updates a new Event Hub as a nested resource within a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param parameters Parameters supplied to create an Event Hub resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single item in List or Get Event Hub operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public EventhubInner createOrUpdate( - String resourceGroupName, String namespaceName, String eventHubName, EventhubInner parameters) { - return createOrUpdateAsync(resourceGroupName, namespaceName, eventHubName, parameters).block(); - } - - /** - * Creates or updates a new Event Hub as a nested resource within a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param parameters Parameters supplied to create an Event Hub resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single item in List or Get Event Hub operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceGroupName, - String namespaceName, - String eventHubName, - EventhubInner parameters, - Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, namespaceName, eventHubName, parameters, context) - .block(); - } - - /** - * Deletes an Event Hub from the specified Namespace and resource group. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync( - String resourceGroupName, String namespaceName, String eventHubName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (eventHubName == null) { - return Mono.error(new IllegalArgumentException("Parameter eventHubName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - eventHubName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes an Event Hub from the specified Namespace and resource group. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String namespaceName, String eventHubName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (eventHubName == null) { - return Mono.error(new IllegalArgumentException("Parameter eventHubName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - eventHubName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Deletes an Event Hub from the specified Namespace and resource group. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String namespaceName, String eventHubName) { - return deleteWithResponseAsync(resourceGroupName, namespaceName, eventHubName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes an Event Hub from the specified Namespace and resource group. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String namespaceName, String eventHubName) { - deleteAsync(resourceGroupName, namespaceName, eventHubName).block(); - } - - /** - * Deletes an Event Hub from the specified Namespace and resource group. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse( - String resourceGroupName, String namespaceName, String eventHubName, Context context) { - return deleteWithResponseAsync(resourceGroupName, namespaceName, eventHubName, context).block(); - } - - /** - * Gets an Event Hubs description for the specified Event Hub. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Event Hubs description for the specified Event Hub. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String resourceGroupName, String namespaceName, String eventHubName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (eventHubName == null) { - return Mono.error(new IllegalArgumentException("Parameter eventHubName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - eventHubName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets an Event Hubs description for the specified Event Hub. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Event Hubs description for the specified Event Hub. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String namespaceName, String eventHubName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (eventHubName == null) { - return Mono.error(new IllegalArgumentException("Parameter eventHubName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - eventHubName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets an Event Hubs description for the specified Event Hub. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Event Hubs description for the specified Event Hub. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync(String resourceGroupName, String namespaceName, String eventHubName) { - return getWithResponseAsync(resourceGroupName, namespaceName, eventHubName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets an Event Hubs description for the specified Event Hub. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Event Hubs description for the specified Event Hub. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public EventhubInner get(String resourceGroupName, String namespaceName, String eventHubName) { - return getAsync(resourceGroupName, namespaceName, eventHubName).block(); - } - - /** - * Gets an Event Hubs description for the specified Event Hub. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param eventHubName The Event Hub name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Event Hubs description for the specified Event Hub. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String namespaceName, String eventHubName, Context context) { - return getWithResponseAsync(resourceGroupName, namespaceName, eventHubName, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the List namespace operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAuthorizationRulesNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listAuthorizationRulesNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the List namespace operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAuthorizationRulesNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listAuthorizationRulesNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of the List EventHubs operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByNamespaceNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByNamespaceNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of the List EventHubs operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByNamespaceNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByNamespaceNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/EventHubsImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/EventHubsImpl.java deleted file mode 100644 index b2f70d58c932..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/EventHubsImpl.java +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.eventhubs.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.eventhubs.EventHubsManager; -import com.azure.resourcemanager.eventhubs.fluent.EventHubsClient; -import com.azure.resourcemanager.eventhubs.fluent.models.EventhubInner; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceId; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.WrapperImpl; -import com.azure.resourcemanager.storage.StorageManager; -import com.azure.resourcemanager.eventhubs.models.EventHub; -import com.azure.resourcemanager.eventhubs.models.EventHubAuthorizationRules; -import com.azure.resourcemanager.eventhubs.models.EventHubConsumerGroups; -import com.azure.resourcemanager.eventhubs.models.EventHubs; -import reactor.core.publisher.Mono; - -import java.util.Objects; -import com.azure.resourcemanager.resources.fluentcore.utils.PagedConverter; - -/** - * Implementation for {@link EventHubs}. - */ -public final class EventHubsImpl extends WrapperImpl implements EventHubs { - private final EventHubsManager manager; - private final StorageManager storageManager; - - public EventHubsImpl(EventHubsManager manager, StorageManager storageManager) { - super(manager.serviceClient().getEventHubs()); - this.manager = manager; - this.storageManager = storageManager; - } - - @Override - public EventHubsManager manager() { - return this.manager; - } - - @Override - public EventHubImpl define(String name) { - return new EventHubImpl(name, this.manager, this.storageManager); - } - - public EventHubAuthorizationRules authorizationRules() { - return this.manager().eventHubAuthorizationRules(); - } - - public EventHubConsumerGroups consumerGroups() { - return this.manager().consumerGroups(); - } - - @Override - public EventHub getById(String id) { - return getByIdAsync(id).block(); - } - - @Override - public Mono getByIdAsync(String id) { - Objects.requireNonNull(id); - ResourceId resourceId = ResourceId.fromString(id); - return getByNameAsync(resourceId.resourceGroupName(), - resourceId.parent().name(), - resourceId.name()); - } - - @Override - public Mono getByNameAsync(String resourceGroupName, String namespaceName, String name) { - return this.innerModel().getAsync(resourceGroupName, - namespaceName, - name) - .map(this::wrapModel); - } - - @Override - public EventHub getByName(String resourceGroupName, String namespaceName, String name) { - return getByNameAsync(resourceGroupName, namespaceName, name).block(); - } - - @Override - public PagedIterable listByNamespace(String resourceGroupName, String namespaceName) { - return PagedConverter.mapPage(innerModel() - .listByNamespace(resourceGroupName, namespaceName), - this::wrapModel); - } - - @Override - public PagedFlux listByNamespaceAsync(String resourceGroupName, String namespaceName) { - return PagedConverter.mapPage(innerModel() - .listByNamespaceAsync(resourceGroupName, namespaceName), - this::wrapModel); - } - - @Override - public void deleteById(String id) { - deleteByIdAsync(id).block(); - } - - @Override - public Mono deleteByIdAsync(String id) { - Objects.requireNonNull(id); - ResourceId resourceId = ResourceId.fromString(id); - return deleteByNameAsync(resourceId.resourceGroupName(), - resourceId.parent().name(), - resourceId.name()); - } - - @Override - public Mono deleteByNameAsync(String resourceGroupName, String namespaceName, String name) { - return this.innerModel().deleteAsync(resourceGroupName, - namespaceName, - name); - } - - @Override - public void deleteByName(String resourceGroupName, String namespaceName, String name) { - deleteByNameAsync(resourceGroupName, namespaceName, name).block(); - } - - private EventHubImpl wrapModel(EventhubInner innerModel) { - return new EventHubImpl(innerModel.name(), innerModel, this.manager, this.storageManager); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/NamespacesClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/NamespacesClientImpl.java deleted file mode 100644 index a944e6880a56..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/NamespacesClientImpl.java +++ /dev/null @@ -1,3520 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.eventhubs.fluent.NamespacesClient; -import com.azure.resourcemanager.eventhubs.fluent.models.AccessKeysInner; -import com.azure.resourcemanager.eventhubs.fluent.models.AuthorizationRuleInner; -import com.azure.resourcemanager.eventhubs.fluent.models.CheckNameAvailabilityResultInner; -import com.azure.resourcemanager.eventhubs.fluent.models.EHNamespaceInner; -import com.azure.resourcemanager.eventhubs.fluent.models.NetworkRuleSetInner; -import com.azure.resourcemanager.eventhubs.models.AuthorizationRuleListResult; -import com.azure.resourcemanager.eventhubs.models.CheckNameAvailabilityParameter; -import com.azure.resourcemanager.eventhubs.models.EHNamespaceListResult; -import com.azure.resourcemanager.eventhubs.models.NetworkRuleSetListResult; -import com.azure.resourcemanager.eventhubs.models.RegenerateAccessKeyParameters; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in NamespacesClient. */ -public final class NamespacesClientImpl - implements InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete, - NamespacesClient { - private final ClientLogger logger = new ClientLogger(NamespacesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final NamespacesService service; - - /** The service client containing this operation class. */ - private final EventHubManagementClientImpl client; - - /** - * Initializes an instance of NamespacesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - NamespacesClientImpl(EventHubManagementClientImpl client) { - this.service = - RestProxy.create(NamespacesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for EventHubManagementClientNamespaces to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "EventHubManagementCl") - private interface NamespacesService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.EventHub/namespaces") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub" - + "/namespaces") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces" - + "/{namespaceName}") - @ExpectedResponses({200, 201, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("namespaceName") String namespaceName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") EHNamespaceInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces" - + "/{namespaceName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("namespaceName") String namespaceName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces" - + "/{namespaceName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("namespaceName") String namespaceName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces" - + "/{namespaceName}") - @ExpectedResponses({200, 201, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("namespaceName") String namespaceName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") EHNamespaceInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces" - + "/{namespaceName}/authorizationRules") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAuthorizationRules( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("namespaceName") String namespaceName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces" - + "/{namespaceName}/authorizationRules/{authorizationRuleName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdateAuthorizationRule( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("namespaceName") String namespaceName, - @PathParam("authorizationRuleName") String authorizationRuleName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") AuthorizationRuleInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces" - + "/{namespaceName}/authorizationRules/{authorizationRuleName}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteAuthorizationRule( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("namespaceName") String namespaceName, - @PathParam("authorizationRuleName") String authorizationRuleName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces" - + "/{namespaceName}/authorizationRules/{authorizationRuleName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getAuthorizationRule( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("namespaceName") String namespaceName, - @PathParam("authorizationRuleName") String authorizationRuleName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces" - + "/{namespaceName}/authorizationRules/{authorizationRuleName}/listKeys") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listKeys( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("namespaceName") String namespaceName, - @PathParam("authorizationRuleName") String authorizationRuleName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces" - + "/{namespaceName}/authorizationRules/{authorizationRuleName}/regenerateKeys") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> regenerateKeys( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("namespaceName") String namespaceName, - @PathParam("authorizationRuleName") String authorizationRuleName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") RegenerateAccessKeyParameters parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post("/subscriptions/{subscriptionId}/providers/Microsoft.EventHub/checkNameAvailability") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> checkNameAvailability( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") CheckNameAvailabilityParameter parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces" - + "/{namespaceName}/networkRuleSets/default") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdateNetworkRuleSet( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("namespaceName") String namespaceName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") NetworkRuleSetInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces" - + "/{namespaceName}/networkRuleSets/default") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getNetworkRuleSet( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("namespaceName") String namespaceName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces" - + "/{namespaceName}/networkRuleSets") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNetworkRuleSets( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("namespaceName") String namespaceName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAuthorizationRulesNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNetworkRuleSetsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Lists all the available Namespaces within a subscription, irrespective of the resource groups. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of the List Namespace operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all the available Namespaces within a subscription, irrespective of the resource groups. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of the List Namespace operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists all the available Namespaces within a subscription, irrespective of the resource groups. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of the List Namespace operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists all the available Namespaces within a subscription, irrespective of the resource groups. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of the List Namespace operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all the available Namespaces within a subscription, irrespective of the resource groups. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of the List Namespace operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Lists all the available Namespaces within a subscription, irrespective of the resource groups. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of the List Namespace operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Lists the available Namespaces within a resource group. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of the List Namespace operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists the available Namespaces within a resource group. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of the List Namespace operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists the available Namespaces within a resource group. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of the List Namespace operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * Lists the available Namespaces within a resource group. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of the List Namespace operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists the available Namespaces within a resource group. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of the List Namespace operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * Lists the available Namespaces within a resource group. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of the List Namespace operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is - * idempotent. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param parameters Parameters for creating a namespace resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single Namespace item in List or Get Operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String namespaceName, EHNamespaceInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is - * idempotent. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param parameters Parameters for creating a namespace resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single Namespace item in List or Get Operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String namespaceName, EHNamespaceInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is - * idempotent. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param parameters Parameters for creating a namespace resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single Namespace item in List or Get Operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, EHNamespaceInner> beginCreateOrUpdateAsync( - String resourceGroupName, String namespaceName, EHNamespaceInner parameters) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, namespaceName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - EHNamespaceInner.class, - EHNamespaceInner.class, - this.client.getContext()); - } - - /** - * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is - * idempotent. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param parameters Parameters for creating a namespace resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single Namespace item in List or Get Operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, EHNamespaceInner> beginCreateOrUpdateAsync( - String resourceGroupName, String namespaceName, EHNamespaceInner parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, namespaceName, parameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), EHNamespaceInner.class, EHNamespaceInner.class, context); - } - - /** - * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is - * idempotent. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param parameters Parameters for creating a namespace resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single Namespace item in List or Get Operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, EHNamespaceInner> beginCreateOrUpdate( - String resourceGroupName, String namespaceName, EHNamespaceInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, namespaceName, parameters).getSyncPoller(); - } - - /** - * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is - * idempotent. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param parameters Parameters for creating a namespace resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single Namespace item in List or Get Operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, EHNamespaceInner> beginCreateOrUpdate( - String resourceGroupName, String namespaceName, EHNamespaceInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, namespaceName, parameters, context).getSyncPoller(); - } - - /** - * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is - * idempotent. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param parameters Parameters for creating a namespace resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single Namespace item in List or Get Operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, String namespaceName, EHNamespaceInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, namespaceName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is - * idempotent. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param parameters Parameters for creating a namespace resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single Namespace item in List or Get Operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String namespaceName, EHNamespaceInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, namespaceName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is - * idempotent. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param parameters Parameters for creating a namespace resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single Namespace item in List or Get Operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public EHNamespaceInner createOrUpdate( - String resourceGroupName, String namespaceName, EHNamespaceInner parameters) { - return createOrUpdateAsync(resourceGroupName, namespaceName, parameters).block(); - } - - /** - * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is - * idempotent. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param parameters Parameters for creating a namespace resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single Namespace item in List or Get Operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public EHNamespaceInner createOrUpdate( - String resourceGroupName, String namespaceName, EHNamespaceInner parameters, Context context) { - return createOrUpdateAsync(resourceGroupName, namespaceName, parameters, context).block(); - } - - /** - * Deletes an existing namespace. This operation also removes all associated resources under the namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync(String resourceGroupName, String namespaceName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes an existing namespace. This operation also removes all associated resources under the namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String namespaceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Deletes an existing namespace. This operation also removes all associated resources under the namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String namespaceName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, namespaceName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deletes an existing namespace. This operation also removes all associated resources under the namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String namespaceName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(resourceGroupName, namespaceName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes an existing namespace. This operation also removes all associated resources under the namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete(String resourceGroupName, String namespaceName) { - return beginDeleteAsync(resourceGroupName, namespaceName).getSyncPoller(); - } - - /** - * Deletes an existing namespace. This operation also removes all associated resources under the namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String namespaceName, Context context) { - return beginDeleteAsync(resourceGroupName, namespaceName, context).getSyncPoller(); - } - - /** - * Deletes an existing namespace. This operation also removes all associated resources under the namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String namespaceName) { - return beginDeleteAsync(resourceGroupName, namespaceName).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes an existing namespace. This operation also removes all associated resources under the namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String namespaceName, Context context) { - return beginDeleteAsync(resourceGroupName, namespaceName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes an existing namespace. This operation also removes all associated resources under the namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String namespaceName) { - deleteAsync(resourceGroupName, namespaceName).block(); - } - - /** - * Deletes an existing namespace. This operation also removes all associated resources under the namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String namespaceName, Context context) { - deleteAsync(resourceGroupName, namespaceName, context).block(); - } - - /** - * Gets the description of the specified namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the description of the specified namespace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String namespaceName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the description of the specified namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the description of the specified namespace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String namespaceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets the description of the specified namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the description of the specified namespace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync(String resourceGroupName, String namespaceName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, namespaceName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the description of the specified namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the description of the specified namespace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public EHNamespaceInner getByResourceGroup(String resourceGroupName, String namespaceName) { - return getByResourceGroupAsync(resourceGroupName, namespaceName).block(); - } - - /** - * Gets the description of the specified namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the description of the specified namespace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String namespaceName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, namespaceName, context).block(); - } - - /** - * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is - * idempotent. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param parameters Parameters for updating a namespace resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single Namespace item in List or Get Operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateWithResponseAsync( - String resourceGroupName, String namespaceName, EHNamespaceInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is - * idempotent. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param parameters Parameters for updating a namespace resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single Namespace item in List or Get Operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, String namespaceName, EHNamespaceInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is - * idempotent. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param parameters Parameters for updating a namespace resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single Namespace item in List or Get Operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync( - String resourceGroupName, String namespaceName, EHNamespaceInner parameters) { - return updateWithResponseAsync(resourceGroupName, namespaceName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is - * idempotent. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param parameters Parameters for updating a namespace resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single Namespace item in List or Get Operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public EHNamespaceInner update(String resourceGroupName, String namespaceName, EHNamespaceInner parameters) { - return updateAsync(resourceGroupName, namespaceName, parameters).block(); - } - - /** - * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is - * idempotent. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param parameters Parameters for updating a namespace resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single Namespace item in List or Get Operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, String namespaceName, EHNamespaceInner parameters, Context context) { - return updateWithResponseAsync(resourceGroupName, namespaceName, parameters, context).block(); - } - - /** - * Gets a list of authorization rules for a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of authorization rules for a Namespace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAuthorizationRulesSinglePageAsync( - String resourceGroupName, String namespaceName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listAuthorizationRules( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a list of authorization rules for a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of authorization rules for a Namespace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAuthorizationRulesSinglePageAsync( - String resourceGroupName, String namespaceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listAuthorizationRules( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets a list of authorization rules for a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of authorization rules for a Namespace. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAuthorizationRulesAsync( - String resourceGroupName, String namespaceName) { - return new PagedFlux<>( - () -> listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName), - nextLink -> listAuthorizationRulesNextSinglePageAsync(nextLink)); - } - - /** - * Gets a list of authorization rules for a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of authorization rules for a Namespace. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAuthorizationRulesAsync( - String resourceGroupName, String namespaceName, Context context) { - return new PagedFlux<>( - () -> listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, context), - nextLink -> listAuthorizationRulesNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets a list of authorization rules for a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of authorization rules for a Namespace. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAuthorizationRules( - String resourceGroupName, String namespaceName) { - return new PagedIterable<>(listAuthorizationRulesAsync(resourceGroupName, namespaceName)); - } - - /** - * Gets a list of authorization rules for a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of authorization rules for a Namespace. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAuthorizationRules( - String resourceGroupName, String namespaceName, Context context) { - return new PagedIterable<>(listAuthorizationRulesAsync(resourceGroupName, namespaceName, context)); - } - - /** - * Creates or updates an AuthorizationRule for a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param authorizationRuleName The authorization rule name. - * @param parameters The shared access AuthorizationRule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single item in a List or Get AuthorizationRule operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateAuthorizationRuleWithResponseAsync( - String resourceGroupName, - String namespaceName, - String authorizationRuleName, - AuthorizationRuleInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (authorizationRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdateAuthorizationRule( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - authorizationRuleName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates an AuthorizationRule for a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param authorizationRuleName The authorization rule name. - * @param parameters The shared access AuthorizationRule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single item in a List or Get AuthorizationRule operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateAuthorizationRuleWithResponseAsync( - String resourceGroupName, - String namespaceName, - String authorizationRuleName, - AuthorizationRuleInner parameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (authorizationRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdateAuthorizationRule( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - authorizationRuleName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Creates or updates an AuthorizationRule for a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param authorizationRuleName The authorization rule name. - * @param parameters The shared access AuthorizationRule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single item in a List or Get AuthorizationRule operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAuthorizationRuleAsync( - String resourceGroupName, - String namespaceName, - String authorizationRuleName, - AuthorizationRuleInner parameters) { - return createOrUpdateAuthorizationRuleWithResponseAsync( - resourceGroupName, namespaceName, authorizationRuleName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates or updates an AuthorizationRule for a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param authorizationRuleName The authorization rule name. - * @param parameters The shared access AuthorizationRule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single item in a List or Get AuthorizationRule operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AuthorizationRuleInner createOrUpdateAuthorizationRule( - String resourceGroupName, - String namespaceName, - String authorizationRuleName, - AuthorizationRuleInner parameters) { - return createOrUpdateAuthorizationRuleAsync(resourceGroupName, namespaceName, authorizationRuleName, parameters) - .block(); - } - - /** - * Creates or updates an AuthorizationRule for a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param authorizationRuleName The authorization rule name. - * @param parameters The shared access AuthorizationRule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return single item in a List or Get AuthorizationRule operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateAuthorizationRuleWithResponse( - String resourceGroupName, - String namespaceName, - String authorizationRuleName, - AuthorizationRuleInner parameters, - Context context) { - return createOrUpdateAuthorizationRuleWithResponseAsync( - resourceGroupName, namespaceName, authorizationRuleName, parameters, context) - .block(); - } - - /** - * Deletes an AuthorizationRule for a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param authorizationRuleName The authorization rule name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteAuthorizationRuleWithResponseAsync( - String resourceGroupName, String namespaceName, String authorizationRuleName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (authorizationRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .deleteAuthorizationRule( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - authorizationRuleName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes an AuthorizationRule for a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param authorizationRuleName The authorization rule name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteAuthorizationRuleWithResponseAsync( - String resourceGroupName, String namespaceName, String authorizationRuleName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (authorizationRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .deleteAuthorizationRule( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - authorizationRuleName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Deletes an AuthorizationRule for a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param authorizationRuleName The authorization rule name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAuthorizationRuleAsync( - String resourceGroupName, String namespaceName, String authorizationRuleName) { - return deleteAuthorizationRuleWithResponseAsync(resourceGroupName, namespaceName, authorizationRuleName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes an AuthorizationRule for a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param authorizationRuleName The authorization rule name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String authorizationRuleName) { - deleteAuthorizationRuleAsync(resourceGroupName, namespaceName, authorizationRuleName).block(); - } - - /** - * Deletes an AuthorizationRule for a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param authorizationRuleName The authorization rule name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteAuthorizationRuleWithResponse( - String resourceGroupName, String namespaceName, String authorizationRuleName, Context context) { - return deleteAuthorizationRuleWithResponseAsync( - resourceGroupName, namespaceName, authorizationRuleName, context) - .block(); - } - - /** - * Gets an AuthorizationRule for a Namespace by rule name. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param authorizationRuleName The authorization rule name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an AuthorizationRule for a Namespace by rule name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getAuthorizationRuleWithResponseAsync( - String resourceGroupName, String namespaceName, String authorizationRuleName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (authorizationRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getAuthorizationRule( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - authorizationRuleName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets an AuthorizationRule for a Namespace by rule name. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param authorizationRuleName The authorization rule name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an AuthorizationRule for a Namespace by rule name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getAuthorizationRuleWithResponseAsync( - String resourceGroupName, String namespaceName, String authorizationRuleName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (authorizationRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getAuthorizationRule( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - authorizationRuleName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets an AuthorizationRule for a Namespace by rule name. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param authorizationRuleName The authorization rule name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an AuthorizationRule for a Namespace by rule name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAuthorizationRuleAsync( - String resourceGroupName, String namespaceName, String authorizationRuleName) { - return getAuthorizationRuleWithResponseAsync(resourceGroupName, namespaceName, authorizationRuleName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets an AuthorizationRule for a Namespace by rule name. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param authorizationRuleName The authorization rule name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an AuthorizationRule for a Namespace by rule name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AuthorizationRuleInner getAuthorizationRule( - String resourceGroupName, String namespaceName, String authorizationRuleName) { - return getAuthorizationRuleAsync(resourceGroupName, namespaceName, authorizationRuleName).block(); - } - - /** - * Gets an AuthorizationRule for a Namespace by rule name. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param authorizationRuleName The authorization rule name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an AuthorizationRule for a Namespace by rule name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getAuthorizationRuleWithResponse( - String resourceGroupName, String namespaceName, String authorizationRuleName, Context context) { - return getAuthorizationRuleWithResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, context) - .block(); - } - - /** - * Gets the primary and secondary connection strings for the Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param authorizationRuleName The authorization rule name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the primary and secondary connection strings for the Namespace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listKeysWithResponseAsync( - String resourceGroupName, String namespaceName, String authorizationRuleName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (authorizationRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listKeys( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - authorizationRuleName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the primary and secondary connection strings for the Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param authorizationRuleName The authorization rule name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the primary and secondary connection strings for the Namespace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listKeysWithResponseAsync( - String resourceGroupName, String namespaceName, String authorizationRuleName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (authorizationRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listKeys( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - authorizationRuleName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets the primary and secondary connection strings for the Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param authorizationRuleName The authorization rule name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the primary and secondary connection strings for the Namespace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listKeysAsync( - String resourceGroupName, String namespaceName, String authorizationRuleName) { - return listKeysWithResponseAsync(resourceGroupName, namespaceName, authorizationRuleName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the primary and secondary connection strings for the Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param authorizationRuleName The authorization rule name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the primary and secondary connection strings for the Namespace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AccessKeysInner listKeys(String resourceGroupName, String namespaceName, String authorizationRuleName) { - return listKeysAsync(resourceGroupName, namespaceName, authorizationRuleName).block(); - } - - /** - * Gets the primary and secondary connection strings for the Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param authorizationRuleName The authorization rule name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the primary and secondary connection strings for the Namespace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listKeysWithResponse( - String resourceGroupName, String namespaceName, String authorizationRuleName, Context context) { - return listKeysWithResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, context).block(); - } - - /** - * Regenerates the primary or secondary connection strings for the specified Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param authorizationRuleName The authorization rule name. - * @param parameters Parameters required to regenerate the connection string. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return namespace/EventHub Connection String. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> regenerateKeysWithResponseAsync( - String resourceGroupName, - String namespaceName, - String authorizationRuleName, - RegenerateAccessKeyParameters parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (authorizationRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .regenerateKeys( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - authorizationRuleName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Regenerates the primary or secondary connection strings for the specified Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param authorizationRuleName The authorization rule name. - * @param parameters Parameters required to regenerate the connection string. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return namespace/EventHub Connection String. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> regenerateKeysWithResponseAsync( - String resourceGroupName, - String namespaceName, - String authorizationRuleName, - RegenerateAccessKeyParameters parameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (authorizationRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .regenerateKeys( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - authorizationRuleName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Regenerates the primary or secondary connection strings for the specified Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param authorizationRuleName The authorization rule name. - * @param parameters Parameters required to regenerate the connection string. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return namespace/EventHub Connection String. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono regenerateKeysAsync( - String resourceGroupName, - String namespaceName, - String authorizationRuleName, - RegenerateAccessKeyParameters parameters) { - return regenerateKeysWithResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Regenerates the primary or secondary connection strings for the specified Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param authorizationRuleName The authorization rule name. - * @param parameters Parameters required to regenerate the connection string. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return namespace/EventHub Connection String. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AccessKeysInner regenerateKeys( - String resourceGroupName, - String namespaceName, - String authorizationRuleName, - RegenerateAccessKeyParameters parameters) { - return regenerateKeysAsync(resourceGroupName, namespaceName, authorizationRuleName, parameters).block(); - } - - /** - * Regenerates the primary or secondary connection strings for the specified Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param authorizationRuleName The authorization rule name. - * @param parameters Parameters required to regenerate the connection string. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return namespace/EventHub Connection String. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response regenerateKeysWithResponse( - String resourceGroupName, - String namespaceName, - String authorizationRuleName, - RegenerateAccessKeyParameters parameters, - Context context) { - return regenerateKeysWithResponseAsync( - resourceGroupName, namespaceName, authorizationRuleName, parameters, context) - .block(); - } - - /** - * Check the give Namespace name availability. - * - * @param parameters Parameters to check availability of the given Namespace name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Result of the CheckNameAvailability operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> checkNameAvailabilityWithResponseAsync( - CheckNameAvailabilityParameter parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .checkNameAvailability( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Check the give Namespace name availability. - * - * @param parameters Parameters to check availability of the given Namespace name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Result of the CheckNameAvailability operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> checkNameAvailabilityWithResponseAsync( - CheckNameAvailabilityParameter parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .checkNameAvailability( - this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), parameters, accept, context); - } - - /** - * Check the give Namespace name availability. - * - * @param parameters Parameters to check availability of the given Namespace name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Result of the CheckNameAvailability operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono checkNameAvailabilityAsync( - CheckNameAvailabilityParameter parameters) { - return checkNameAvailabilityWithResponseAsync(parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Check the give Namespace name availability. - * - * @param parameters Parameters to check availability of the given Namespace name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Result of the CheckNameAvailability operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CheckNameAvailabilityResultInner checkNameAvailability(CheckNameAvailabilityParameter parameters) { - return checkNameAvailabilityAsync(parameters).block(); - } - - /** - * Check the give Namespace name availability. - * - * @param parameters Parameters to check availability of the given Namespace name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Result of the CheckNameAvailability operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response checkNameAvailabilityWithResponse( - CheckNameAvailabilityParameter parameters, Context context) { - return checkNameAvailabilityWithResponseAsync(parameters, context).block(); - } - - /** - * Create or update NetworkRuleSet for a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param parameters The Namespace IpFilterRule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of NetworkRuleSet resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateNetworkRuleSetWithResponseAsync( - String resourceGroupName, String namespaceName, NetworkRuleSetInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdateNetworkRuleSet( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create or update NetworkRuleSet for a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param parameters The Namespace IpFilterRule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of NetworkRuleSet resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateNetworkRuleSetWithResponseAsync( - String resourceGroupName, String namespaceName, NetworkRuleSetInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdateNetworkRuleSet( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Create or update NetworkRuleSet for a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param parameters The Namespace IpFilterRule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of NetworkRuleSet resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateNetworkRuleSetAsync( - String resourceGroupName, String namespaceName, NetworkRuleSetInner parameters) { - return createOrUpdateNetworkRuleSetWithResponseAsync(resourceGroupName, namespaceName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Create or update NetworkRuleSet for a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param parameters The Namespace IpFilterRule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of NetworkRuleSet resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public NetworkRuleSetInner createOrUpdateNetworkRuleSet( - String resourceGroupName, String namespaceName, NetworkRuleSetInner parameters) { - return createOrUpdateNetworkRuleSetAsync(resourceGroupName, namespaceName, parameters).block(); - } - - /** - * Create or update NetworkRuleSet for a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param parameters The Namespace IpFilterRule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of NetworkRuleSet resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateNetworkRuleSetWithResponse( - String resourceGroupName, String namespaceName, NetworkRuleSetInner parameters, Context context) { - return createOrUpdateNetworkRuleSetWithResponseAsync(resourceGroupName, namespaceName, parameters, context) - .block(); - } - - /** - * Gets NetworkRuleSet for a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return networkRuleSet for a Namespace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getNetworkRuleSetWithResponseAsync( - String resourceGroupName, String namespaceName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getNetworkRuleSet( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets NetworkRuleSet for a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return networkRuleSet for a Namespace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getNetworkRuleSetWithResponseAsync( - String resourceGroupName, String namespaceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getNetworkRuleSet( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets NetworkRuleSet for a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return networkRuleSet for a Namespace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getNetworkRuleSetAsync(String resourceGroupName, String namespaceName) { - return getNetworkRuleSetWithResponseAsync(resourceGroupName, namespaceName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets NetworkRuleSet for a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return networkRuleSet for a Namespace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public NetworkRuleSetInner getNetworkRuleSet(String resourceGroupName, String namespaceName) { - return getNetworkRuleSetAsync(resourceGroupName, namespaceName).block(); - } - - /** - * Gets NetworkRuleSet for a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return networkRuleSet for a Namespace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getNetworkRuleSetWithResponse( - String resourceGroupName, String namespaceName, Context context) { - return getNetworkRuleSetWithResponseAsync(resourceGroupName, namespaceName, context).block(); - } - - /** - * Gets list of NetworkRuleSet for a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of NetworkRuleSet for a Namespace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNetworkRuleSetsSinglePageAsync( - String resourceGroupName, String namespaceName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listNetworkRuleSets( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets list of NetworkRuleSet for a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of NetworkRuleSet for a Namespace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNetworkRuleSetsSinglePageAsync( - String resourceGroupName, String namespaceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNetworkRuleSets( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets list of NetworkRuleSet for a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of NetworkRuleSet for a Namespace. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listNetworkRuleSetsAsync(String resourceGroupName, String namespaceName) { - return new PagedFlux<>( - () -> listNetworkRuleSetsSinglePageAsync(resourceGroupName, namespaceName), - nextLink -> listNetworkRuleSetsNextSinglePageAsync(nextLink)); - } - - /** - * Gets list of NetworkRuleSet for a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of NetworkRuleSet for a Namespace. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listNetworkRuleSetsAsync( - String resourceGroupName, String namespaceName, Context context) { - return new PagedFlux<>( - () -> listNetworkRuleSetsSinglePageAsync(resourceGroupName, namespaceName, context), - nextLink -> listNetworkRuleSetsNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets list of NetworkRuleSet for a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of NetworkRuleSet for a Namespace. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listNetworkRuleSets(String resourceGroupName, String namespaceName) { - return new PagedIterable<>(listNetworkRuleSetsAsync(resourceGroupName, namespaceName)); - } - - /** - * Gets list of NetworkRuleSet for a Namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of NetworkRuleSet for a Namespace. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listNetworkRuleSets( - String resourceGroupName, String namespaceName, Context context) { - return new PagedIterable<>(listNetworkRuleSetsAsync(resourceGroupName, namespaceName, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of the List Namespace operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of the List Namespace operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of the List Namespace operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of the List Namespace operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the List namespace operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAuthorizationRulesNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listAuthorizationRulesNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the List namespace operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAuthorizationRulesNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listAuthorizationRulesNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of the List NetworkRuleSet operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNetworkRuleSetsNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listNetworkRuleSetsNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of the List NetworkRuleSet operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNetworkRuleSetsNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNetworkRuleSetsNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/NestedResourceImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/NestedResourceImpl.java deleted file mode 100644 index e7598c60e6ec..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/NestedResourceImpl.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.eventhubs.implementation; - -import com.azure.core.management.ProxyResource; -import com.azure.resourcemanager.eventhubs.EventHubsManager; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.model.Indexable; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.CreatableUpdatableImpl; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.IndexableRefreshableWrapperImpl; -import com.azure.resourcemanager.eventhubs.models.NestedResource; - -/** - * The implementation for {@link NestedResource}. - * (Internal use only) - * - * @param the fluent model of the nested resource - * @param the inner model of the nested resource - * @param the fluent model implementation of the nested resource - */ -public abstract class NestedResourceImpl< - FluentModelT extends Indexable, - InnerModelT extends ProxyResource, - FluentModelImplT extends IndexableRefreshableWrapperImpl> - extends CreatableUpdatableImpl - implements HasManager, NestedResource { - protected final EventHubsManager manager; - - NestedResourceImpl(final String name, final InnerModelT inner, EventHubsManager manager) { - super(name, inner); - this.manager = manager; - } - - @Override - public String id() { - return this.innerModel().id(); - } - - @Override - public String name() { - if (this.innerModel().name() == null) { - return super.name(); - } else { - return this.innerModel().name(); - } - } - - @Override - public String type() { - return this.innerModel().type(); - } - - @Override - public boolean isInCreateMode() { - return this.innerModel().id() == null; - } - - @Override - public EventHubsManager manager() { - return this.manager; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/OperationsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/OperationsClientImpl.java deleted file mode 100644 index 5f7dc1f07e18..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/OperationsClientImpl.java +++ /dev/null @@ -1,270 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.eventhubs.fluent.OperationsClient; -import com.azure.resourcemanager.eventhubs.fluent.models.OperationInner; -import com.azure.resourcemanager.eventhubs.models.OperationListResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in OperationsClient. */ -public final class OperationsClientImpl implements OperationsClient { - private final ClientLogger logger = new ClientLogger(OperationsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final OperationsService service; - - /** The service client containing this operation class. */ - private final EventHubManagementClientImpl client; - - /** - * Initializes an instance of OperationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - OperationsClientImpl(EventHubManagementClientImpl client) { - this.service = - RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for EventHubManagementClientOperations to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "EventHubManagementCl") - private interface OperationsService { - @Headers({"Content-Type: application/json"}) - @Get("/providers/Microsoft.EventHub/operations") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Lists all of the available Event Hub REST API operations. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Event Hub operations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all of the available Event Hub REST API operations. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Event Hub operations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists all of the available Event Hub REST API operations. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Event Hub operations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists all of the available Event Hub REST API operations. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Event Hub operations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all of the available Event Hub REST API operations. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Event Hub operations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Lists all of the available Event Hub REST API operations. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Event Hub operations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Event Hub operations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Event Hub operations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/PrivateEndpointConnectionsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/PrivateEndpointConnectionsClientImpl.java deleted file mode 100644 index 75d7a17a70a9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/PrivateEndpointConnectionsClientImpl.java +++ /dev/null @@ -1,1044 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.eventhubs.fluent.PrivateEndpointConnectionsClient; -import com.azure.resourcemanager.eventhubs.fluent.models.PrivateEndpointConnectionInner; -import com.azure.resourcemanager.eventhubs.models.PrivateEndpointConnectionListResult; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. */ -public final class PrivateEndpointConnectionsClientImpl implements PrivateEndpointConnectionsClient { - private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final PrivateEndpointConnectionsService service; - - /** The service client containing this operation class. */ - private final EventHubManagementClientImpl client; - - /** - * Initializes an instance of PrivateEndpointConnectionsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - PrivateEndpointConnectionsClientImpl(EventHubManagementClientImpl client) { - this.service = - RestProxy - .create( - PrivateEndpointConnectionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for EventHubManagementClientPrivateEndpointConnections to be used by the - * proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "EventHubManagementCl") - private interface PrivateEndpointConnectionsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces" - + "/{namespaceName}/privateEndpointConnections") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("namespaceName") String namespaceName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces" - + "/{namespaceName}/privateEndpointConnections/{privateEndpointConnectionName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("namespaceName") String namespaceName, - @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, - @BodyParam("application/json") PrivateEndpointConnectionInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces" - + "/{namespaceName}/privateEndpointConnections/{privateEndpointConnectionName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("namespaceName") String namespaceName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces" - + "/{namespaceName}/privateEndpointConnections/{privateEndpointConnectionName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("namespaceName") String namespaceName, - @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets the available PrivateEndpointConnections within a namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the available PrivateEndpointConnections within a namespace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String namespaceName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the available PrivateEndpointConnections within a namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the available PrivateEndpointConnections within a namespace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String namespaceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets the available PrivateEndpointConnections within a namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the available PrivateEndpointConnections within a namespace. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String resourceGroupName, String namespaceName) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, namespaceName), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets the available PrivateEndpointConnections within a namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the available PrivateEndpointConnections within a namespace. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String namespaceName, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, namespaceName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets the available PrivateEndpointConnections within a namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the available PrivateEndpointConnections within a namespace. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String namespaceName) { - return new PagedIterable<>(listAsync(resourceGroupName, namespaceName)); - } - - /** - * Gets the available PrivateEndpointConnections within a namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the available PrivateEndpointConnections within a namespace. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, String namespaceName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, namespaceName, context)); - } - - /** - * Creates or updates PrivateEndpointConnections of service namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param privateEndpointConnectionName The PrivateEndpointConnection name. - * @param parameters Parameters supplied to update Status of PrivateEndPoint Connection to namespace resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of the PrivateEndpointConnection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, - String namespaceName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - namespaceName, - privateEndpointConnectionName, - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates PrivateEndpointConnections of service namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param privateEndpointConnectionName The PrivateEndpointConnection name. - * @param parameters Parameters supplied to update Status of PrivateEndPoint Connection to namespace resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of the PrivateEndpointConnection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, - String namespaceName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner parameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - namespaceName, - privateEndpointConnectionName, - parameters, - accept, - context); - } - - /** - * Creates or updates PrivateEndpointConnections of service namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param privateEndpointConnectionName The PrivateEndpointConnection name. - * @param parameters Parameters supplied to update Status of PrivateEndPoint Connection to namespace resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of the PrivateEndpointConnection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, - String namespaceName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner parameters) { - return createOrUpdateWithResponseAsync( - resourceGroupName, namespaceName, privateEndpointConnectionName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates or updates PrivateEndpointConnections of service namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param privateEndpointConnectionName The PrivateEndpointConnection name. - * @param parameters Parameters supplied to update Status of PrivateEndPoint Connection to namespace resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of the PrivateEndpointConnection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateEndpointConnectionInner createOrUpdate( - String resourceGroupName, - String namespaceName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner parameters) { - return createOrUpdateAsync(resourceGroupName, namespaceName, privateEndpointConnectionName, parameters).block(); - } - - /** - * Creates or updates PrivateEndpointConnections of service namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param privateEndpointConnectionName The PrivateEndpointConnection name. - * @param parameters Parameters supplied to update Status of PrivateEndPoint Connection to namespace resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of the PrivateEndpointConnection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceGroupName, - String namespaceName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner parameters, - Context context) { - return createOrUpdateWithResponseAsync( - resourceGroupName, namespaceName, privateEndpointConnectionName, parameters, context) - .block(); - } - - /** - * Deletes an existing namespace. This operation also removes all associated resources under the namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param privateEndpointConnectionName The PrivateEndpointConnection name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync( - String resourceGroupName, String namespaceName, String privateEndpointConnectionName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); - } - final String apiVersion = "2018-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - apiVersion, - this.client.getSubscriptionId(), - privateEndpointConnectionName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes an existing namespace. This operation also removes all associated resources under the namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param privateEndpointConnectionName The PrivateEndpointConnection name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String namespaceName, String privateEndpointConnectionName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); - } - final String apiVersion = "2018-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - apiVersion, - this.client.getSubscriptionId(), - privateEndpointConnectionName, - accept, - context); - } - - /** - * Deletes an existing namespace. This operation also removes all associated resources under the namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param privateEndpointConnectionName The PrivateEndpointConnection name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String namespaceName, String privateEndpointConnectionName) { - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, namespaceName, privateEndpointConnectionName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deletes an existing namespace. This operation also removes all associated resources under the namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param privateEndpointConnectionName The PrivateEndpointConnection name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String namespaceName, String privateEndpointConnectionName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, namespaceName, privateEndpointConnectionName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes an existing namespace. This operation also removes all associated resources under the namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param privateEndpointConnectionName The PrivateEndpointConnection name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String namespaceName, String privateEndpointConnectionName) { - return beginDeleteAsync(resourceGroupName, namespaceName, privateEndpointConnectionName).getSyncPoller(); - } - - /** - * Deletes an existing namespace. This operation also removes all associated resources under the namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param privateEndpointConnectionName The PrivateEndpointConnection name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String namespaceName, String privateEndpointConnectionName, Context context) { - return beginDeleteAsync(resourceGroupName, namespaceName, privateEndpointConnectionName, context) - .getSyncPoller(); - } - - /** - * Deletes an existing namespace. This operation also removes all associated resources under the namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param privateEndpointConnectionName The PrivateEndpointConnection name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync( - String resourceGroupName, String namespaceName, String privateEndpointConnectionName) { - return beginDeleteAsync(resourceGroupName, namespaceName, privateEndpointConnectionName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes an existing namespace. This operation also removes all associated resources under the namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param privateEndpointConnectionName The PrivateEndpointConnection name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync( - String resourceGroupName, String namespaceName, String privateEndpointConnectionName, Context context) { - return beginDeleteAsync(resourceGroupName, namespaceName, privateEndpointConnectionName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes an existing namespace. This operation also removes all associated resources under the namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param privateEndpointConnectionName The PrivateEndpointConnection name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String namespaceName, String privateEndpointConnectionName) { - deleteAsync(resourceGroupName, namespaceName, privateEndpointConnectionName).block(); - } - - /** - * Deletes an existing namespace. This operation also removes all associated resources under the namespace. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param privateEndpointConnectionName The PrivateEndpointConnection name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete( - String resourceGroupName, String namespaceName, String privateEndpointConnectionName, Context context) { - deleteAsync(resourceGroupName, namespaceName, privateEndpointConnectionName, context).block(); - } - - /** - * Gets a description for the specified Private Endpoint Connection name. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param privateEndpointConnectionName The PrivateEndpointConnection name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a description for the specified Private Endpoint Connection name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String resourceGroupName, String namespaceName, String privateEndpointConnectionName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - privateEndpointConnectionName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a description for the specified Private Endpoint Connection name. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param privateEndpointConnectionName The PrivateEndpointConnection name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a description for the specified Private Endpoint Connection name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String namespaceName, String privateEndpointConnectionName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - privateEndpointConnectionName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets a description for the specified Private Endpoint Connection name. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param privateEndpointConnectionName The PrivateEndpointConnection name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a description for the specified Private Endpoint Connection name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync( - String resourceGroupName, String namespaceName, String privateEndpointConnectionName) { - return getWithResponseAsync(resourceGroupName, namespaceName, privateEndpointConnectionName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a description for the specified Private Endpoint Connection name. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param privateEndpointConnectionName The PrivateEndpointConnection name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a description for the specified Private Endpoint Connection name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateEndpointConnectionInner get( - String resourceGroupName, String namespaceName, String privateEndpointConnectionName) { - return getAsync(resourceGroupName, namespaceName, privateEndpointConnectionName).block(); - } - - /** - * Gets a description for the specified Private Endpoint Connection name. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param privateEndpointConnectionName The PrivateEndpointConnection name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a description for the specified Private Endpoint Connection name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String namespaceName, String privateEndpointConnectionName, Context context) { - return getWithResponseAsync(resourceGroupName, namespaceName, privateEndpointConnectionName, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the list of all private endpoint connections operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the list of all private endpoint connections operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/PrivateLinkResourcesClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/PrivateLinkResourcesClientImpl.java deleted file mode 100644 index 54496c0bfc3a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/PrivateLinkResourcesClientImpl.java +++ /dev/null @@ -1,224 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.eventhubs.fluent.PrivateLinkResourcesClient; -import com.azure.resourcemanager.eventhubs.fluent.models.PrivateLinkResourcesListResultInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. */ -public final class PrivateLinkResourcesClientImpl implements PrivateLinkResourcesClient { - private final ClientLogger logger = new ClientLogger(PrivateLinkResourcesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final PrivateLinkResourcesService service; - - /** The service client containing this operation class. */ - private final EventHubManagementClientImpl client; - - /** - * Initializes an instance of PrivateLinkResourcesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - PrivateLinkResourcesClientImpl(EventHubManagementClientImpl client) { - this.service = - RestProxy - .create(PrivateLinkResourcesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for EventHubManagementClientPrivateLinkResources to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "EventHubManagementCl") - private interface PrivateLinkResourcesService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces" - + "/{namespaceName}/privateLinkResources") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("namespaceName") String namespaceName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets lists of resources that supports Privatelinks. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lists of resources that supports Privatelinks. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String resourceGroupName, String namespaceName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets lists of resources that supports Privatelinks. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lists of resources that supports Privatelinks. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String namespaceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets lists of resources that supports Privatelinks. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lists of resources that supports Privatelinks. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync(String resourceGroupName, String namespaceName) { - return getWithResponseAsync(resourceGroupName, namespaceName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets lists of resources that supports Privatelinks. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lists of resources that supports Privatelinks. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateLinkResourcesListResultInner get(String resourceGroupName, String namespaceName) { - return getAsync(resourceGroupName, namespaceName).block(); - } - - /** - * Gets lists of resources that supports Privatelinks. - * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lists of resources that supports Privatelinks. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String namespaceName, Context context) { - return getWithResponseAsync(resourceGroupName, namespaceName, context).block(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/RegionsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/RegionsClientImpl.java deleted file mode 100644 index 7d477da1f446..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/RegionsClientImpl.java +++ /dev/null @@ -1,307 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.eventhubs.fluent.RegionsClient; -import com.azure.resourcemanager.eventhubs.fluent.models.MessagingRegionsInner; -import com.azure.resourcemanager.eventhubs.models.MessagingRegionsListResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in RegionsClient. */ -public final class RegionsClientImpl implements RegionsClient { - private final ClientLogger logger = new ClientLogger(RegionsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final RegionsService service; - - /** The service client containing this operation class. */ - private final EventHubManagementClientImpl client; - - /** - * Initializes an instance of RegionsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - RegionsClientImpl(EventHubManagementClientImpl client) { - this.service = RestProxy.create(RegionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for EventHubManagementClientRegions to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "EventHubManagementCl") - private interface RegionsService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.EventHub/sku/{sku}/regions") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySku( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("sku") String sku, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySkuNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets the available Regions for a given sku. - * - * @param sku The sku type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the available Regions for a given sku. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySkuSinglePageAsync(String sku) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (sku == null) { - return Mono.error(new IllegalArgumentException("Parameter sku is required and cannot be null.")); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listBySku( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - sku, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the available Regions for a given sku. - * - * @param sku The sku type. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the available Regions for a given sku. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySkuSinglePageAsync(String sku, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (sku == null) { - return Mono.error(new IllegalArgumentException("Parameter sku is required and cannot be null.")); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listBySku(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), sku, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets the available Regions for a given sku. - * - * @param sku The sku type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the available Regions for a given sku. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listBySkuAsync(String sku) { - return new PagedFlux<>(() -> listBySkuSinglePageAsync(sku), nextLink -> listBySkuNextSinglePageAsync(nextLink)); - } - - /** - * Gets the available Regions for a given sku. - * - * @param sku The sku type. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the available Regions for a given sku. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listBySkuAsync(String sku, Context context) { - return new PagedFlux<>( - () -> listBySkuSinglePageAsync(sku, context), nextLink -> listBySkuNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets the available Regions for a given sku. - * - * @param sku The sku type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the available Regions for a given sku. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listBySku(String sku) { - return new PagedIterable<>(listBySkuAsync(sku)); - } - - /** - * Gets the available Regions for a given sku. - * - * @param sku The sku type. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the available Regions for a given sku. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listBySku(String sku, Context context) { - return new PagedIterable<>(listBySkuAsync(sku, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of the List MessagingRegions operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySkuNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listBySkuNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of the List MessagingRegions operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySkuNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listBySkuNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/AccessRights.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/AccessRights.java deleted file mode 100644 index 8559de36833b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/AccessRights.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for AccessRights. */ -public final class AccessRights extends ExpandableStringEnum { - /** Static value Manage for AccessRights. */ - public static final AccessRights MANAGE = fromString("Manage"); - - /** Static value Send for AccessRights. */ - public static final AccessRights SEND = fromString("Send"); - - /** Static value Listen for AccessRights. */ - public static final AccessRights LISTEN = fromString("Listen"); - - /** - * Creates or finds a AccessRights from its string representation. - * - * @param name a name to look for. - * @return the corresponding AccessRights. - */ - @JsonCreator - public static AccessRights fromString(String name) { - return fromString(name, AccessRights.class); - } - - /** @return known AccessRights values. */ - public static Collection values() { - return values(AccessRights.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/ArmDisasterRecoveryListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/ArmDisasterRecoveryListResult.java deleted file mode 100644 index 3b753d3a6ce2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/ArmDisasterRecoveryListResult.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.eventhubs.fluent.models.ArmDisasterRecoveryInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The result of the List Alias(Disaster Recovery configuration) operation. */ -@Fluent -public final class ArmDisasterRecoveryListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ArmDisasterRecoveryListResult.class); - - /* - * List of Alias(Disaster Recovery configurations) - */ - @JsonProperty(value = "value") - private List value; - - /* - * Link to the next set of results. Not empty if Value contains incomplete - * list of Alias(Disaster Recovery configuration) - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: List of Alias(Disaster Recovery configurations). - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: List of Alias(Disaster Recovery configurations). - * - * @param value the value value to set. - * @return the ArmDisasterRecoveryListResult object itself. - */ - public ArmDisasterRecoveryListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to the next set of results. Not empty if Value contains incomplete list of - * Alias(Disaster Recovery configuration). - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/AuthorizationRule.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/AuthorizationRule.java deleted file mode 100644 index a78b77bf05f2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/AuthorizationRule.java +++ /dev/null @@ -1,196 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.eventhubs.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.eventhubs.EventHubsManager; -import com.azure.resourcemanager.eventhubs.fluent.models.AuthorizationRuleInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; -import reactor.core.publisher.Mono; - -import java.util.List; - -/** - * The base type representing authorization rule of event hub namespace and event hub. - * - * @param the specific authorization rule type - */ -@Fluent -public interface AuthorizationRule> extends - NestedResource, HasInnerModel, HasManager, - Refreshable { - /** - * @return rights associated with the authorization rule - */ - List rights(); - /** - * @return a representation of the deferred computation of this call, - * returning access keys (primary, secondary) and the connection strings - */ - Mono getKeysAsync(); - /** - * @return the access keys (primary, secondary) and the connection strings - */ - EventHubAuthorizationKey getKeys(); - /** - * Regenerates primary or secondary access keys. - * - * @param keyType the key to regenerate - * @return a representation of the deferred computation of this call, - * returning access keys (primary, secondary) and the connection strings - */ - Mono regenerateKeyAsync(KeyType keyType); - /** - * Regenerates primary or secondary keys. - * - * @param keyType the key to regenerate - * @return the access keys (primary, secondary) and the connection strings - */ - EventHubAuthorizationKey regenerateKey(KeyType keyType); - - /** - * Grouping of commons authorization rule definition stages shared - * between event hub namespace authorization rule and event hub authorization rule. - */ - interface DefinitionStages { - /** - * The stage of the event hub namespace or event hub authorization rule definition - * allowing to enable listen policy. - * - * @param the next stage of the definition - */ - interface WithListen { - /** - * Specifies that the rule should have listening access enabled. - * - * @return the next stage of the definition - */ - T withListenAccess(); - } - - /** - * The stage of the event hub namespace or event hub authorization rule definition - * allowing to enable send policy. - * - * @param the next stage of the definition - */ - interface WithSend { - /** - * Specifies that the rule should have sending access enabled. - * - * @return the next stage of the definition - */ - T withSendAccess(); - } - - /** - * The stage of the event hub namespace or event hub authorization rule definition - * allowing to enable manage policy. - * - * @param the next stage of the definition - */ - interface WithManage { - /** - * Specifies that the rule should have management access enabled. - * - * @return the next stage of the definition - */ - T withManageAccess(); - } - - /** - * The stage of the event hub namespace or event hub authorization rule definition - * allowing to enable send or manage policy. - * - * @param the next stage of the definition - */ - interface WithSendOrManage extends WithSend, WithManage { - } - - /** - * The stage of the event hub namespace or event hub authorization rule definition - * allowing to enable listen, send or manage policy. - * - * @param the next stage of the definition - */ - interface WithListenOrSendOrManage extends WithListen, WithSendOrManage { - /** - * Specifies that the rule should have sending and listening access enabled. - * - * @return the next stage of the definition - */ - T withSendAndListenAccess(); - } - } - - /** - * Grouping of commons authorization rule update stages shared - * between event hub namespace authorization rule and event hub authorization rule. - */ - interface UpdateStages { - /** - * The stage of the event hub namespace or event hub authorization rule update - * allowing to enable listen policy. - * - * @param the next stage of the update - */ - interface WithListen { - /** - * Specifies that the rule should have listening access enabled. - * - * @return the next stage of the update - */ - T withListenAccess(); - } - - /** - * The stage of the event hub namespace or event hub authorization rule update - * allowing to enable send policy. - * - * @param the next stage of the update - */ - interface WithSend { - /** - * Specifies that the rule should have sending access enabled. - * - * @return the next stage of the update - */ - T withSendAccess(); - } - - /** - * The stage of event hub namespace or event hub authorization rule update - * allowing to enable manage policy. - * - * @param the next stage of the update - */ - interface WithManage { - /** - * Specifies that the rule should have sending access enabled. - * - * @return the next stage of the update - */ - T withManageAccess(); - } - - /** - * The stage of the event hub namespace or event hub authorization rule update - * allowing to enable send or manage policy. - * - * @param the next stage of the update - */ - interface WithSendOrManage extends WithSend, WithManage { - } - - /** - * The stage of the event hub namespace or event hub authorization rule update - * allowing to enable listen, send or manage policy. - * - * @param the next stage of the update - */ - interface WithListenOrSendOrManage extends WithListen, WithSendOrManage { - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/AuthorizationRuleListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/AuthorizationRuleListResult.java deleted file mode 100644 index f2da377cd710..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/AuthorizationRuleListResult.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.eventhubs.fluent.models.AuthorizationRuleInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The response from the List namespace operation. */ -@Fluent -public final class AuthorizationRuleListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AuthorizationRuleListResult.class); - - /* - * Result of the List Authorization Rules operation. - */ - @JsonProperty(value = "value") - private List value; - - /* - * Link to the next set of results. Not empty if Value contains an - * incomplete list of Authorization Rules - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: Result of the List Authorization Rules operation. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Result of the List Authorization Rules operation. - * - * @param value the value value to set. - * @return the AuthorizationRuleListResult object itself. - */ - public AuthorizationRuleListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to the next set of results. Not empty if Value contains an incomplete list of - * Authorization Rules. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: Link to the next set of results. Not empty if Value contains an incomplete list of - * Authorization Rules. - * - * @param nextLink the nextLink value to set. - * @return the AuthorizationRuleListResult object itself. - */ - public AuthorizationRuleListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/AvailableCluster.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/AvailableCluster.java deleted file mode 100644 index 844dfbcd219b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/AvailableCluster.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Pre-provisioned and readily available Event Hubs Cluster count per region. */ -@Fluent -public final class AvailableCluster { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailableCluster.class); - - /* - * Location fo the Available Cluster - */ - @JsonProperty(value = "location") - private String location; - - /** - * Get the location property: Location fo the Available Cluster. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Set the location property: Location fo the Available Cluster. - * - * @param location the location value to set. - * @return the AvailableCluster object itself. - */ - public AvailableCluster withLocation(String location) { - this.location = location; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/CaptureDescription.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/CaptureDescription.java deleted file mode 100644 index 948642031cec..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/CaptureDescription.java +++ /dev/null @@ -1,196 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Properties to configure capture description for eventhub. */ -@Fluent -public final class CaptureDescription { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CaptureDescription.class); - - /* - * A value that indicates whether capture description is enabled. - */ - @JsonProperty(value = "enabled") - private Boolean enabled; - - /* - * Enumerates the possible values for the encoding format of capture - * description. Note: 'AvroDeflate' will be deprecated in New API Version - */ - @JsonProperty(value = "encoding") - private EncodingCaptureDescription encoding; - - /* - * The time window allows you to set the frequency with which the capture - * to Azure Blobs will happen, value should between 60 to 900 seconds - */ - @JsonProperty(value = "intervalInSeconds") - private Integer intervalInSeconds; - - /* - * The size window defines the amount of data built up in your Event Hub - * before an capture operation, value should be between 10485760 to - * 524288000 bytes - */ - @JsonProperty(value = "sizeLimitInBytes") - private Integer sizeLimitInBytes; - - /* - * Properties of Destination where capture will be stored. (Storage - * Account, Blob Names) - */ - @JsonProperty(value = "destination") - private Destination destination; - - /* - * A value that indicates whether to Skip Empty Archives - */ - @JsonProperty(value = "skipEmptyArchives") - private Boolean skipEmptyArchives; - - /** - * Get the enabled property: A value that indicates whether capture description is enabled. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: A value that indicates whether capture description is enabled. - * - * @param enabled the enabled value to set. - * @return the CaptureDescription object itself. - */ - public CaptureDescription withEnabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the encoding property: Enumerates the possible values for the encoding format of capture description. Note: - * 'AvroDeflate' will be deprecated in New API Version. - * - * @return the encoding value. - */ - public EncodingCaptureDescription encoding() { - return this.encoding; - } - - /** - * Set the encoding property: Enumerates the possible values for the encoding format of capture description. Note: - * 'AvroDeflate' will be deprecated in New API Version. - * - * @param encoding the encoding value to set. - * @return the CaptureDescription object itself. - */ - public CaptureDescription withEncoding(EncodingCaptureDescription encoding) { - this.encoding = encoding; - return this; - } - - /** - * Get the intervalInSeconds property: The time window allows you to set the frequency with which the capture to - * Azure Blobs will happen, value should between 60 to 900 seconds. - * - * @return the intervalInSeconds value. - */ - public Integer intervalInSeconds() { - return this.intervalInSeconds; - } - - /** - * Set the intervalInSeconds property: The time window allows you to set the frequency with which the capture to - * Azure Blobs will happen, value should between 60 to 900 seconds. - * - * @param intervalInSeconds the intervalInSeconds value to set. - * @return the CaptureDescription object itself. - */ - public CaptureDescription withIntervalInSeconds(Integer intervalInSeconds) { - this.intervalInSeconds = intervalInSeconds; - return this; - } - - /** - * Get the sizeLimitInBytes property: The size window defines the amount of data built up in your Event Hub before - * an capture operation, value should be between 10485760 to 524288000 bytes. - * - * @return the sizeLimitInBytes value. - */ - public Integer sizeLimitInBytes() { - return this.sizeLimitInBytes; - } - - /** - * Set the sizeLimitInBytes property: The size window defines the amount of data built up in your Event Hub before - * an capture operation, value should be between 10485760 to 524288000 bytes. - * - * @param sizeLimitInBytes the sizeLimitInBytes value to set. - * @return the CaptureDescription object itself. - */ - public CaptureDescription withSizeLimitInBytes(Integer sizeLimitInBytes) { - this.sizeLimitInBytes = sizeLimitInBytes; - return this; - } - - /** - * Get the destination property: Properties of Destination where capture will be stored. (Storage Account, Blob - * Names). - * - * @return the destination value. - */ - public Destination destination() { - return this.destination; - } - - /** - * Set the destination property: Properties of Destination where capture will be stored. (Storage Account, Blob - * Names). - * - * @param destination the destination value to set. - * @return the CaptureDescription object itself. - */ - public CaptureDescription withDestination(Destination destination) { - this.destination = destination; - return this; - } - - /** - * Get the skipEmptyArchives property: A value that indicates whether to Skip Empty Archives. - * - * @return the skipEmptyArchives value. - */ - public Boolean skipEmptyArchives() { - return this.skipEmptyArchives; - } - - /** - * Set the skipEmptyArchives property: A value that indicates whether to Skip Empty Archives. - * - * @param skipEmptyArchives the skipEmptyArchives value to set. - * @return the CaptureDescription object itself. - */ - public CaptureDescription withSkipEmptyArchives(Boolean skipEmptyArchives) { - this.skipEmptyArchives = skipEmptyArchives; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (destination() != null) { - destination().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/CheckNameAvailabilityParameter.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/CheckNameAvailabilityParameter.java deleted file mode 100644 index f498d2dff93d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/CheckNameAvailabilityParameter.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Parameter supplied to check Namespace name availability operation. */ -@Fluent -public final class CheckNameAvailabilityParameter { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CheckNameAvailabilityParameter.class); - - /* - * Name to check the namespace name availability - */ - @JsonProperty(value = "name", required = true) - private String name; - - /** - * Get the name property: Name to check the namespace name availability. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Name to check the namespace name availability. - * - * @param name the name value to set. - * @return the CheckNameAvailabilityParameter object itself. - */ - public CheckNameAvailabilityParameter withName(String name) { - this.name = name; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property name in model CheckNameAvailabilityParameter")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/ClusterListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/ClusterListResult.java deleted file mode 100644 index 49187d1778a3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/ClusterListResult.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.eventhubs.fluent.models.ClusterInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The response of the List Event Hubs Clusters operation. */ -@Fluent -public final class ClusterListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ClusterListResult.class); - - /* - * The Event Hubs Clusters present in the List Event Hubs operation - * results. - */ - @JsonProperty(value = "value") - private List value; - - /* - * Link to the next set of results. Empty unless the value parameter - * contains an incomplete list of Event Hubs Clusters. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: The Event Hubs Clusters present in the List Event Hubs operation results. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The Event Hubs Clusters present in the List Event Hubs operation results. - * - * @param value the value value to set. - * @return the ClusterListResult object itself. - */ - public ClusterListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to the next set of results. Empty unless the value parameter contains an - * incomplete list of Event Hubs Clusters. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: Link to the next set of results. Empty unless the value parameter contains an - * incomplete list of Event Hubs Clusters. - * - * @param nextLink the nextLink value to set. - * @return the ClusterListResult object itself. - */ - public ClusterListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/ClusterSku.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/ClusterSku.java deleted file mode 100644 index e78ff9dfa917..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/ClusterSku.java +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** SKU parameters particular to a cluster instance. */ -@Fluent -public final class ClusterSku { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ClusterSku.class); - - /* - * Name of this SKU. - */ - @JsonProperty(value = "name", required = true) - private ClusterSkuName name; - - /* - * The quantity of Event Hubs Cluster Capacity Units contained in this - * cluster. - */ - @JsonProperty(value = "capacity") - private Integer capacity; - - /** - * Get the name property: Name of this SKU. - * - * @return the name value. - */ - public ClusterSkuName name() { - return this.name; - } - - /** - * Set the name property: Name of this SKU. - * - * @param name the name value to set. - * @return the ClusterSku object itself. - */ - public ClusterSku withName(ClusterSkuName name) { - this.name = name; - return this; - } - - /** - * Get the capacity property: The quantity of Event Hubs Cluster Capacity Units contained in this cluster. - * - * @return the capacity value. - */ - public Integer capacity() { - return this.capacity; - } - - /** - * Set the capacity property: The quantity of Event Hubs Cluster Capacity Units contained in this cluster. - * - * @param capacity the capacity value to set. - * @return the ClusterSku object itself. - */ - public ClusterSku withCapacity(Integer capacity) { - this.capacity = capacity; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property name in model ClusterSku")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/ClusterSkuName.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/ClusterSkuName.java deleted file mode 100644 index 8f151e32174a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/ClusterSkuName.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ClusterSkuName. */ -public final class ClusterSkuName extends ExpandableStringEnum { - /** Static value Dedicated for ClusterSkuName. */ - public static final ClusterSkuName DEDICATED = fromString("Dedicated"); - - /** - * Creates or finds a ClusterSkuName from its string representation. - * - * @param name a name to look for. - * @return the corresponding ClusterSkuName. - */ - @JsonCreator - public static ClusterSkuName fromString(String name) { - return fromString(name, ClusterSkuName.class); - } - - /** @return known ClusterSkuName values. */ - public static Collection values() { - return values(ClusterSkuName.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/ConnectionState.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/ConnectionState.java deleted file mode 100644 index 43d36cd09b57..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/ConnectionState.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** ConnectionState information. */ -@Fluent -public final class ConnectionState { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectionState.class); - - /* - * Status of the connection. - */ - @JsonProperty(value = "status") - private PrivateLinkConnectionStatus status; - - /* - * Description of the connection state. - */ - @JsonProperty(value = "description") - private String description; - - /** - * Get the status property: Status of the connection. - * - * @return the status value. - */ - public PrivateLinkConnectionStatus status() { - return this.status; - } - - /** - * Set the status property: Status of the connection. - * - * @param status the status value to set. - * @return the ConnectionState object itself. - */ - public ConnectionState withStatus(PrivateLinkConnectionStatus status) { - this.status = status; - return this; - } - - /** - * Get the description property: Description of the connection state. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: Description of the connection state. - * - * @param description the description value to set. - * @return the ConnectionState object itself. - */ - public ConnectionState withDescription(String description) { - this.description = description; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/ConsumerGroupListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/ConsumerGroupListResult.java deleted file mode 100644 index adc488cf2947..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/ConsumerGroupListResult.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.eventhubs.fluent.models.ConsumerGroupInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The result to the List Consumer Group operation. */ -@Fluent -public final class ConsumerGroupListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ConsumerGroupListResult.class); - - /* - * Result of the List Consumer Group operation. - */ - @JsonProperty(value = "value") - private List value; - - /* - * Link to the next set of results. Not empty if Value contains incomplete - * list of Consumer Group - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: Result of the List Consumer Group operation. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Result of the List Consumer Group operation. - * - * @param value the value value to set. - * @return the ConsumerGroupListResult object itself. - */ - public ConsumerGroupListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to the next set of results. Not empty if Value contains incomplete list of - * Consumer Group. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: Link to the next set of results. Not empty if Value contains incomplete list of - * Consumer Group. - * - * @param nextLink the nextLink value to set. - * @return the ConsumerGroupListResult object itself. - */ - public ConsumerGroupListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/DefaultAction.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/DefaultAction.java deleted file mode 100644 index 5d962ea58189..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/DefaultAction.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for DefaultAction. */ -public final class DefaultAction extends ExpandableStringEnum { - /** Static value Allow for DefaultAction. */ - public static final DefaultAction ALLOW = fromString("Allow"); - - /** Static value Deny for DefaultAction. */ - public static final DefaultAction DENY = fromString("Deny"); - - /** - * Creates or finds a DefaultAction from its string representation. - * - * @param name a name to look for. - * @return the corresponding DefaultAction. - */ - @JsonCreator - public static DefaultAction fromString(String name) { - return fromString(name, DefaultAction.class); - } - - /** @return known DefaultAction values. */ - public static Collection values() { - return values(DefaultAction.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/Destination.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/Destination.java deleted file mode 100644 index 2164ac3333b7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/Destination.java +++ /dev/null @@ -1,144 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.eventhubs.fluent.models.DestinationProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Capture storage details for capture description. */ -@Fluent -public final class Destination { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Destination.class); - - /* - * Name for capture destination - */ - @JsonProperty(value = "name") - private String name; - - /* - * Properties describing the storage account, blob container and archive - * name format for capture destination - */ - @JsonProperty(value = "properties") - private DestinationProperties innerProperties; - - /** - * Get the name property: Name for capture destination. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Name for capture destination. - * - * @param name the name value to set. - * @return the Destination object itself. - */ - public Destination withName(String name) { - this.name = name; - return this; - } - - /** - * Get the innerProperties property: Properties describing the storage account, blob container and archive name - * format for capture destination. - * - * @return the innerProperties value. - */ - private DestinationProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the storageAccountResourceId property: Resource id of the storage account to be used to create the blobs. - * - * @return the storageAccountResourceId value. - */ - public String storageAccountResourceId() { - return this.innerProperties() == null ? null : this.innerProperties().storageAccountResourceId(); - } - - /** - * Set the storageAccountResourceId property: Resource id of the storage account to be used to create the blobs. - * - * @param storageAccountResourceId the storageAccountResourceId value to set. - * @return the Destination object itself. - */ - public Destination withStorageAccountResourceId(String storageAccountResourceId) { - if (this.innerProperties() == null) { - this.innerProperties = new DestinationProperties(); - } - this.innerProperties().withStorageAccountResourceId(storageAccountResourceId); - return this; - } - - /** - * Get the blobContainer property: Blob container Name. - * - * @return the blobContainer value. - */ - public String blobContainer() { - return this.innerProperties() == null ? null : this.innerProperties().blobContainer(); - } - - /** - * Set the blobContainer property: Blob container Name. - * - * @param blobContainer the blobContainer value to set. - * @return the Destination object itself. - */ - public Destination withBlobContainer(String blobContainer) { - if (this.innerProperties() == null) { - this.innerProperties = new DestinationProperties(); - } - this.innerProperties().withBlobContainer(blobContainer); - return this; - } - - /** - * Get the archiveNameFormat property: Blob naming convention for archive, e.g. - * {Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}. Here all the parameters - * (Namespace,EventHub .. etc) are mandatory irrespective of order. - * - * @return the archiveNameFormat value. - */ - public String archiveNameFormat() { - return this.innerProperties() == null ? null : this.innerProperties().archiveNameFormat(); - } - - /** - * Set the archiveNameFormat property: Blob naming convention for archive, e.g. - * {Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}. Here all the parameters - * (Namespace,EventHub .. etc) are mandatory irrespective of order. - * - * @param archiveNameFormat the archiveNameFormat value to set. - * @return the Destination object itself. - */ - public Destination withArchiveNameFormat(String archiveNameFormat) { - if (this.innerProperties() == null) { - this.innerProperties = new DestinationProperties(); - } - this.innerProperties().withArchiveNameFormat(archiveNameFormat); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/DisasterRecoveryPairingAuthorizationKey.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/DisasterRecoveryPairingAuthorizationKey.java deleted file mode 100644 index 1089cb9301e2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/DisasterRecoveryPairingAuthorizationKey.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.eventhubs.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.eventhubs.fluent.models.AccessKeysInner; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; - -/** - * Type representing access key of {@link DisasterRecoveryPairingAuthorizationRule}. - */ -@Fluent -public interface DisasterRecoveryPairingAuthorizationKey - extends HasInnerModel { - /** - * @return primary access key - */ - String primaryKey(); - - /** - * @return secondary access key - */ - String secondaryKey(); - - /** - * @return primary connection string - */ - String primaryConnectionString(); - - /** - * @return secondary connection string - */ - String secondaryConnectionString(); - - /** - * @return alias primary connection string - */ - String aliasPrimaryConnectionString(); - - /** - * @return alias secondary connection string - */ - String aliasSecondaryConnectionString(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/DisasterRecoveryPairingAuthorizationRule.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/DisasterRecoveryPairingAuthorizationRule.java deleted file mode 100644 index 318565d5beee..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/DisasterRecoveryPairingAuthorizationRule.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.eventhubs.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.eventhubs.EventHubsManager; -import com.azure.resourcemanager.eventhubs.fluent.models.AuthorizationRuleInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasName; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import reactor.core.publisher.Mono; - -import java.util.List; - -/** - * Type representing authorization rule of {@link EventHubDisasterRecoveryPairing}. - */ -@Fluent -public interface DisasterRecoveryPairingAuthorizationRule - extends HasName, HasInnerModel, HasManager { - /** - * @return rights associated with the rule - */ - List rights(); - - /** - * @return an observable that emits a single entity containing access keys (primary and secondary) - */ - Mono getKeysAsync(); - /** - * @return entity containing access keys (primary and secondary) - */ - DisasterRecoveryPairingAuthorizationKey getKeys(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/DisasterRecoveryPairingAuthorizationRules.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/DisasterRecoveryPairingAuthorizationRules.java deleted file mode 100644 index ebfbe5171898..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/DisasterRecoveryPairingAuthorizationRules.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.eventhubs.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.eventhubs.EventHubsManager; -import reactor.core.publisher.Mono; - -/** - * Entry point to manage disaster recovery pairing authorization rules. - */ -@Fluent -public interface DisasterRecoveryPairingAuthorizationRules extends - SupportsGettingById, - HasManager { - /** - * Lists the authorization rules that can be used to access the disaster recovery pairing. - * - * @param resourceGroupName resource group name - * @param namespaceName primary namespace name - * @param pairingName pairing name - * @return list of authorization rules - */ - PagedIterable listByDisasterRecoveryPairing( - String resourceGroupName, String namespaceName, String pairingName); - - /** - * Lists the authorization rules that can be used to access the disaster recovery pairing. - * - * @param resourceGroupName resource group name - * @param namespaceName primary namespace name - * @param pairingName pairing name - * @return observable that emits the authorization rules - */ - PagedFlux listByDisasterRecoveryPairingAsync( - String resourceGroupName, String namespaceName, String pairingName); - - /** - * Gets an authorization rule that can be used to access the disaster recovery pairing. - * - * @param resourceGroupName resource group name - * @param namespaceName primary namespace name - * @param pairingName pairing name - * @param name rule name - * @return observable that emits the authorization rule - */ - Mono getByNameAsync( - String resourceGroupName, String namespaceName, String pairingName, String name); - - /** - * Gets an authorization rule that can be used to access the disaster recovery pairing. - * - * @param resourceGroupName resource group name - * @param namespaceName primary namespace name - * @param pairingName pairing name - * @param name rule name - * @return the authorization rule - */ - DisasterRecoveryPairingAuthorizationRule getByName( - String resourceGroupName, String namespaceName, String pairingName, String name); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/EHNamespaceIdContainer.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/EHNamespaceIdContainer.java deleted file mode 100644 index 8d341ae8980d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/EHNamespaceIdContainer.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The full ARM ID of an Event Hubs Namespace. */ -@Fluent -public final class EHNamespaceIdContainer { - @JsonIgnore private final ClientLogger logger = new ClientLogger(EHNamespaceIdContainer.class); - - /* - * id parameter - */ - @JsonProperty(value = "id") - private String id; - - /** - * Get the id property: id parameter. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: id parameter. - * - * @param id the id value to set. - * @return the EHNamespaceIdContainer object itself. - */ - public EHNamespaceIdContainer withId(String id) { - this.id = id; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/EHNamespaceListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/EHNamespaceListResult.java deleted file mode 100644 index 06a6fac3a3b4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/EHNamespaceListResult.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.eventhubs.fluent.models.EHNamespaceInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The response of the List Namespace operation. */ -@Fluent -public final class EHNamespaceListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(EHNamespaceListResult.class); - - /* - * Result of the List Namespace operation - */ - @JsonProperty(value = "value") - private List value; - - /* - * Link to the next set of results. Not empty if Value contains incomplete - * list of namespaces. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: Result of the List Namespace operation. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Result of the List Namespace operation. - * - * @param value the value value to set. - * @return the EHNamespaceListResult object itself. - */ - public EHNamespaceListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to the next set of results. Not empty if Value contains incomplete list of - * namespaces. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: Link to the next set of results. Not empty if Value contains incomplete list of - * namespaces. - * - * @param nextLink the nextLink value to set. - * @return the EHNamespaceListResult object itself. - */ - public EHNamespaceListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/EncodingCaptureDescription.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/EncodingCaptureDescription.java deleted file mode 100644 index 11764288e760..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/EncodingCaptureDescription.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for EncodingCaptureDescription. */ -public enum EncodingCaptureDescription { - /** Enum value Avro. */ - AVRO("Avro"), - - /** Enum value AvroDeflate. */ - AVRO_DEFLATE("AvroDeflate"); - - /** The actual serialized value for a EncodingCaptureDescription instance. */ - private final String value; - - EncodingCaptureDescription(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a EncodingCaptureDescription instance. - * - * @param value the serialized value to parse. - * @return the parsed EncodingCaptureDescription object, or null if unable to parse. - */ - @JsonCreator - public static EncodingCaptureDescription fromString(String value) { - EncodingCaptureDescription[] items = EncodingCaptureDescription.values(); - for (EncodingCaptureDescription item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/Encryption.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/Encryption.java deleted file mode 100644 index fcce23223593..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/Encryption.java +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Properties to configure Encryption. */ -@Fluent -public final class Encryption { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Encryption.class); - - /* - * Properties of KeyVault - */ - @JsonProperty(value = "keyVaultProperties") - private List keyVaultProperties; - - /* - * Enumerates the possible value of keySource for Encryption - */ - @JsonProperty(value = "keySource") - private KeySource keySource; - - /** - * Get the keyVaultProperties property: Properties of KeyVault. - * - * @return the keyVaultProperties value. - */ - public List keyVaultProperties() { - return this.keyVaultProperties; - } - - /** - * Set the keyVaultProperties property: Properties of KeyVault. - * - * @param keyVaultProperties the keyVaultProperties value to set. - * @return the Encryption object itself. - */ - public Encryption withKeyVaultProperties(List keyVaultProperties) { - this.keyVaultProperties = keyVaultProperties; - return this; - } - - /** - * Get the keySource property: Enumerates the possible value of keySource for Encryption. - * - * @return the keySource value. - */ - public KeySource keySource() { - return this.keySource; - } - - /** - * Set the keySource property: Enumerates the possible value of keySource for Encryption. - * - * @param keySource the keySource value to set. - * @return the Encryption object itself. - */ - public Encryption withKeySource(KeySource keySource) { - this.keySource = keySource; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (keyVaultProperties() != null) { - keyVaultProperties().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/EndPointProvisioningState.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/EndPointProvisioningState.java deleted file mode 100644 index 6f5aaee0415a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/EndPointProvisioningState.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for EndPointProvisioningState. */ -public final class EndPointProvisioningState extends ExpandableStringEnum { - /** Static value Creating for EndPointProvisioningState. */ - public static final EndPointProvisioningState CREATING = fromString("Creating"); - - /** Static value Updating for EndPointProvisioningState. */ - public static final EndPointProvisioningState UPDATING = fromString("Updating"); - - /** Static value Deleting for EndPointProvisioningState. */ - public static final EndPointProvisioningState DELETING = fromString("Deleting"); - - /** Static value Succeeded for EndPointProvisioningState. */ - public static final EndPointProvisioningState SUCCEEDED = fromString("Succeeded"); - - /** Static value Canceled for EndPointProvisioningState. */ - public static final EndPointProvisioningState CANCELED = fromString("Canceled"); - - /** Static value Failed for EndPointProvisioningState. */ - public static final EndPointProvisioningState FAILED = fromString("Failed"); - - /** - * Creates or finds a EndPointProvisioningState from its string representation. - * - * @param name a name to look for. - * @return the corresponding EndPointProvisioningState. - */ - @JsonCreator - public static EndPointProvisioningState fromString(String name) { - return fromString(name, EndPointProvisioningState.class); - } - - /** @return known EndPointProvisioningState values. */ - public static Collection values() { - return values(EndPointProvisioningState.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/EntityStatus.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/EntityStatus.java deleted file mode 100644 index 79dcc844a38e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/EntityStatus.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for EntityStatus. */ -public enum EntityStatus { - /** Enum value Active. */ - ACTIVE("Active"), - - /** Enum value Disabled. */ - DISABLED("Disabled"), - - /** Enum value Restoring. */ - RESTORING("Restoring"), - - /** Enum value SendDisabled. */ - SEND_DISABLED("SendDisabled"), - - /** Enum value ReceiveDisabled. */ - RECEIVE_DISABLED("ReceiveDisabled"), - - /** Enum value Creating. */ - CREATING("Creating"), - - /** Enum value Deleting. */ - DELETING("Deleting"), - - /** Enum value Renaming. */ - RENAMING("Renaming"), - - /** Enum value Unknown. */ - UNKNOWN("Unknown"); - - /** The actual serialized value for a EntityStatus instance. */ - private final String value; - - EntityStatus(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a EntityStatus instance. - * - * @param value the serialized value to parse. - * @return the parsed EntityStatus object, or null if unable to parse. - */ - @JsonCreator - public static EntityStatus fromString(String value) { - EntityStatus[] items = EntityStatus.values(); - for (EntityStatus item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/EventHub.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/EventHub.java deleted file mode 100644 index a3221474fb58..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/EventHub.java +++ /dev/null @@ -1,548 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.eventhubs.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.eventhubs.EventHubsManager; -import com.azure.resourcemanager.eventhubs.fluent.models.EventhubInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.model.Appliable; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; -import com.azure.resourcemanager.resources.fluentcore.model.Updatable; -import com.azure.resourcemanager.storage.models.StorageAccount; - -import java.util.Set; - -/** - * Type representing an Azure EventHub. - */ -@Fluent -public interface EventHub extends - NestedResource, - HasManager, - Refreshable, - Updatable, - HasInnerModel { - /** - * @return the resource group of the parent namespace - */ - String namespaceResourceGroupName(); - - /** - * @return name of the parent namespace - */ - String namespaceName(); - - /** - * @return true if the data capture enabled for the event hub events, false otherwise - */ - boolean isDataCaptureEnabled(); - - /** - * @return configured window in seconds to be used for event capturing when capturing is enabled - */ - int dataCaptureWindowSizeInSeconds(); - - /** - * @return configured window in MB to be used for event capturing when capturing is enabled - */ - int dataCaptureWindowSizeInMB(); - - /** - * @return whether to skip empty archives when capturing is enabled - */ - boolean dataCaptureSkipEmptyArchives(); - - /** - * @return the format file name that stores captured data when capturing is enabled - */ - String dataCaptureFileNameFormat(); - - /** - * @return description of the destination where captured data will be stored - */ - Destination captureDestination(); - - /** - * @return the partition identifiers - */ - Set partitionIds(); - - /** - * @return retention period of events in days - */ - int messageRetentionPeriodInDays(); - - /** - * @return consumer group in the event hub - */ - PagedFlux listConsumerGroupsAsync(); - /** - * @return authorization rules enabled for the event hub - */ - PagedFlux listAuthorizationRulesAsync(); - /** - * @return consumer group in the event hub - */ - PagedIterable listConsumerGroups(); - /** - * @return authorization rules enabled for the event hub - */ - PagedIterable listAuthorizationRules(); - - /** - * The entirety of the event hub definition. - */ - interface Definition extends - DefinitionStages.Blank, - DefinitionStages.WithNamespace, - DefinitionStages.WithCaptureProviderOrCreate, - DefinitionStages.WithCaptureEnabledDisabled, - DefinitionStages.WithCaptureOptionalSettingsOrCreate, - DefinitionStages.WithCreate { - } - - /** - * Grouping of event hub definition stages. - */ - interface DefinitionStages { - /** - * The first stage of a event hub definition. - */ - interface Blank extends WithNamespace { - } - - /** - * The stage of the event hub definition allowing to specify the name space in which - * event hub needs to be created. - */ - interface WithNamespace { - /** - * Specifies the new namespace in which event hub needs to be created. - * - * @param namespaceCreatable namespace creatable definition - * @return next stage of the event hub definition - */ - WithCaptureProviderOrCreate withNewNamespace(Creatable namespaceCreatable); - - /** - * Specifies an existing event hub namespace in which event hub needs to be created. - * - * @param namespace event hub namespace - * @return next stage of the event hub definition - */ - WithCaptureProviderOrCreate withExistingNamespace(EventHubNamespace namespace); - - /** - * Specifies an existing event hub namespace in which event hub needs to be created. - * - * @param resourceGroupName namespace resource group name - * @param namespaceName event hub namespace - * @return next stage of the event hub definition - */ - WithCaptureProviderOrCreate withExistingNamespace(String resourceGroupName, String namespaceName); - - /** - * Specifies id of an existing event hub namespace in which event hub needs to be created. - * - * @param namespaceId event hub namespace resource id - * @return next stage of the event hub definition - */ - WithCaptureProviderOrCreate withExistingNamespaceId(String namespaceId); - } - - /** - * The stage of the event hub definition allowing to specify provider to store captured data - * when data capturing is enabled. - */ - interface WithCaptureProviderOrCreate extends WithCreate { - /** - * Specifies a new storage account to store the captured data when data capturing is enabled. - * - * @param storageAccountCreatable creatable storage account definition - * @param containerName container to store the files containing captured data - * @return next stage of the event hub definition - */ - WithCaptureEnabledDisabled withNewStorageAccountForCapturedData( - Creatable storageAccountCreatable, String containerName); - - /** - * Specifies an existing storage account to store the captured data when data capturing is enabled. - * - * @param storageAccount storage account - * @param containerName an existing or new container to store the files containing captured data - * @return next stage of the event hub definition - */ - WithCaptureEnabledDisabled withExistingStorageAccountForCapturedData( - StorageAccount storageAccount, String containerName); - - /** - * Specifies an existing storage account to store the captured data when data capturing is enabled. - * - * @param storageAccountId storage account arm id - * @param containerName an existing or new container to store the files containing captured data - * @return next stage of the event hub definition - */ - WithCaptureEnabledDisabled withExistingStorageAccountForCapturedData( - String storageAccountId, String containerName); - } - - /** - * The stage of the event hub definition allowing to enable or disable data capturing. - */ - interface WithCaptureEnabledDisabled { - /** - * Specifies that data capture should be enabled for the event hub. - * - * @return next stage of the event hub definition - */ - WithCaptureOptionalSettingsOrCreate withDataCaptureEnabled(); - - /** - * Specifies that data capture should be disabled for the event hub. - * - * @return next stage of the event hub definition - */ - WithCaptureOptionalSettingsOrCreate withDataCaptureDisabled(); - } - - /** - * The stage of the event hub definition allowing to configure data capturing. - */ - interface WithCaptureOptionalSettingsOrCreate extends WithCreate { - /** - * Specifies the capture window size in seconds. - * - * @param sizeInSeconds window size in seconds - * @return next stage of the event hub definition - */ - WithCaptureOptionalSettingsOrCreate withDataCaptureWindowSizeInSeconds(int sizeInSeconds); - - /** - * Set a value that indicates whether to Skip Empty Archives. - * - * @param skipEmptyArchives the skipEmptyArchives value to set - * @return next stage of the event hub definition - */ - WithCaptureOptionalSettingsOrCreate withDataCaptureSkipEmptyArchives(Boolean skipEmptyArchives); - - /** - * Specifies the capture window size in MB. - * - * @param sizeInMB window size in MB - * @return next stage of the event hub definition - */ - WithCaptureOptionalSettingsOrCreate withDataCaptureWindowSizeInMB(int sizeInMB); - - /** - * Specifies file name format containing captured data. - * - * @param format the file name format - * @return next stage of the event hub definition - */ - WithCaptureOptionalSettingsOrCreate withDataCaptureFileNameFormat(String format); - } - - /** - * The stage of the event hub definition allowing to add authorization rule for accessing - * the event hub. - */ - interface WithAuthorizationRule { - /** - * Specifies that a new authorization rule should be created that has send access to the event hub. - * - * @param ruleName rule name - * @return next stage of the event hub definition - */ - WithCreate withNewSendRule(String ruleName); - - /** - * Specifies that a new authorization rule should be created that has listen access to the event hub. - * - * @param ruleName rule name - * @return next stage of the event hub definition - */ - WithCreate withNewListenRule(String ruleName); - - /** - * Specifies that a new authorization rule should be created - * that has send and listen access to the event hub. - * - * @param ruleName rule name - * @return next stage of the event hub definition - */ - WithCreate withNewSendAndListenRule(String ruleName); - - /** - * Specifies that a new authorization rule should be created that has manage access to the event hub. - * - * @param ruleName rule name - * @return next stage of the event hub definition - */ - WithCreate withNewManageRule(String ruleName); - } - - /** - * The stage of the event hub definition allowing to add consumer group for the event hub. - */ - interface WithConsumerGroup { - /** - * Specifies that a new consumer group should be created for the event hub. - * - * @param name consumer group name - * @return next stage of the event hub definition - */ - WithCreate withNewConsumerGroup(String name); - - /** - * Specifies that a new consumer group should be created for the event hub. - * - * @param name consumer group name - * @param metadata consumer group metadata - * @return next stage of the event hub definition - */ - WithCreate withNewConsumerGroup(String name, String metadata); - } - - /** - * The stage of the event hub definition allowing to specify partition count for event hub. - */ - interface WithPartitionCount { - /** - * Specifies the number of partitions in the event hub. - * - * @param count partitions count - * @return next stage of the event hub definition - */ - WithCreate withPartitionCount(long count); - } - - /** - * The stage of the event hub definition allowing to specify retention period for event hub events. - */ - interface WithRetentionPeriod { - /** - * Specifies the retention period for events in days. - * - * @param period retention period - * @return next stage of the event hub definition - */ - WithCreate withRetentionPeriodInDays(long period); - } - - /** - * The stage of the definition which contains all the minimum required inputs for - * the resource to be created (via {@link WithCreate#create()}), but also allows - * for any other optional settings to be specified. - */ - interface WithCreate extends - Creatable, - DefinitionStages.WithAuthorizationRule, - DefinitionStages.WithConsumerGroup, - DefinitionStages.WithPartitionCount, - DefinitionStages.WithRetentionPeriod { - } - } - - /** - * Grouping of event hub update stages. - */ - interface UpdateStages { - /** - * The stage of the event hub definition allowing to add an authorization rule for accessing - * the event hub. - */ - interface WithAuthorizationRule { - /** - * Specifies that a new authorization rule should be created that has send access to the event hub. - * - * @param name rule name - * @return next stage of the event hub update - */ - Update withNewSendRule(String name); - - /** - * Specifies that a new authorization rule should be created that has listen access to the event hub. - * - * @param name rule name - * @return next stage of the event hub update - */ - Update withNewListenRule(String name); - - /** - * Specifies that a new authorization rule should be created - * that has send and listen access to the event hub. - * - * @param name rule name - * @return next stage of the event hub update - */ - Update withNewSendAndListenRule(String name); - - /** - * Specifies that a new authorization rule should be created that has manage access to the event hub. - * - * @param name rule name - * @return next stage of the event hub update - */ - Update withNewManageRule(String name); - - /** - * Specifies that an authorization rule associated with the event hub should be deleted. - * - * @param ruleName rule name - * @return next stage of the event hub update - */ - Update withoutAuthorizationRule(String ruleName); - } - - /** - * The stage of the event hub update allowing to add consumer group for event hub. - */ - interface WithConsumerGroup { - /** - * Specifies that a new consumer group should be created for the event hub. - * - * @param name group name - * @return next stage of the event hub update - */ - Update withNewConsumerGroup(String name); - - /** - * Specifies that a new consumer group should be created for the event hub. - * - * @param name group name - * @param metadata group metadata - * @return next stage of the event hub update - */ - Update withNewConsumerGroup(String name, String metadata); - - /** - * Specifies that a consumer group associated with the event hub should be deleted. - * - * @param name group name - * @return next stage of the event hub update - */ - Update withoutConsumerGroup(String name); - } - - /** - * The stage of the event hub update allowing to configure data capture. - */ - interface WithCapture { - /** - * Specifies a new storage account to store the captured data when data capturing is enabled. - * - * @param storageAccountCreatable creatable storage account definition - * @param containerName container to store the files containing captured data - * @return next stage of the event hub update - */ - Update withNewStorageAccountForCapturedData( - Creatable storageAccountCreatable, String containerName); - - /** - * Specifies an existing storage account to store the captured data when data capturing is enabled. - * - * @param storageAccount storage account - * @param containerName an existing or new container to store the files containing captured data - * @return next stage of the event hub update - */ - Update withExistingStorageAccountForCapturedData(StorageAccount storageAccount, String containerName); - - /** - * Specifies an existing storage account to store the captured data when data capturing is enabled. - * - * @param storageAccountId storage account arm id - * @param containerName an existing or new container to store the files containing captured data - * @return next stage of the event hub update - */ - Update withExistingStorageAccountForCapturedData(String storageAccountId, String containerName); - - /** - * Specifies that data capture should be enabled for the event hub. - * - * @return next stage of the event hub update - */ - Update withDataCaptureEnabled(); - - /** - * Specifies that data capture should be disabled for the event hub. - * - * @return next stage of the event hub update - */ - Update withDataCaptureDisabled(); - - /** - * Specifies the capture window size in seconds. - * - * @param sizeInSeconds window size in seconds - * @return next stage of the event hub update - */ - Update withDataCaptureWindowSizeInSeconds(int sizeInSeconds); - - /** - * Specified the capture whether to Skip Empty Archives. - * - * @param skipEmptyArchives the skipEmptyArchives value to set - * @return next stage of the event hub update - */ - Update withDataCaptureSkipEmptyArchives(Boolean skipEmptyArchives); - - /** - * Specifies the capture window size in MB. - * - * @param sizeInMB window size in MB - * @return next stage of the event hub update - */ - Update withDataCaptureWindowSizeInMB(int sizeInMB); - /** - * Specifies the format of the file containing captured data. - * - * @param format the file name format - * @return next stage of the event hub update - */ - Update withDataCaptureFileNameFormat(String format); - } - - /** - * The stage of the event hub update allowing to specify partition count for event hub. - */ - interface WithPartitionCount { - /** - * Specifies the number of partitions in the event hub. - * - * @param count partitions count - * @return next stage of the event hub update - */ - Update withPartitionCount(long count); - } - - /** - * The stage of the event hub definition allowing to specify retention period for event hub events. - */ - interface WithRetentionPeriod { - /** - * Specifies the retention period for events in days. - * - * @param period retention period - * @return next stage of the event hub update - */ - Update withRetentionPeriodInDays(long period); - } - } - - /** - * The template for a event hub update operation, containing all the settings that can be modified. - */ - interface Update extends - Appliable, - UpdateStages.WithConsumerGroup, - UpdateStages.WithAuthorizationRule, - UpdateStages.WithCapture, - UpdateStages.WithPartitionCount, - UpdateStages.WithRetentionPeriod { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/EventHubAuthorizationKey.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/EventHubAuthorizationKey.java deleted file mode 100644 index 3a9c22b6d482..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/EventHubAuthorizationKey.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.eventhubs.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.eventhubs.fluent.models.AccessKeysInner; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; - -/** - * Type representing access key of {@link EventHubNamespaceAuthorizationRule}. - */ -@Fluent -public interface EventHubAuthorizationKey - extends HasInnerModel { - /** - * @return primary access key - */ - String primaryKey(); - - /** - * @return secondary access key - */ - String secondaryKey(); - - /** - * @return primary connection string - */ - String primaryConnectionString(); - - /** - * @return secondary connection string - */ - String secondaryConnectionString(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/EventHubAuthorizationRule.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/EventHubAuthorizationRule.java deleted file mode 100644 index b53c2c0f6b56..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/EventHubAuthorizationRule.java +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.eventhubs.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.model.Appliable; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; - -/** - * Type representing authorization rule of an event hub. - */ -@Fluent -public interface EventHubAuthorizationRule - extends - AuthorizationRule { - /** - * @return the resource group of the namespace where parent event hub resides - */ - String namespaceResourceGroupName(); - /** - * @return the namespace name of parent event hub - */ - String namespaceName(); - /** - * @return the name of the parent event hub - */ - String eventHubName(); - - /** - * Grouping of event hub authorization rule definition stages. - */ - interface DefinitionStages { - /** - * The first stage of event hub authorization rule definition. - */ - interface Blank extends WithEventHub { - } - - /** - * Stage of the authorization rule definition allowing to specify the event for which rule needs to be created. - */ - interface WithEventHub { - /** - * Specifies that authorization rule needs to be created for the given event hub. - * - * @param eventHubResourceId the resource id of the event Hub - * @return the next stage of the definition - */ - WithAccessPolicy withExistingEventHubId(String eventHubResourceId); - /** - * Specifies that authorization rule needs to be created for the given event hub. - * - * @param resourceGroupName event hub namespace resource group name - * @param namespaceName event hub parent namespace name - * @param eventHubName event hub name - * @return the next stage of the definition - */ - WithAccessPolicy withExistingEventHub(String resourceGroupName, String namespaceName, String eventHubName); - /** - * Specifies that authorization rule needs to be created for the given event hub. - * - * @param eventHub the event hub - * @return the next stage of the definition - */ - WithAccessPolicy withExistingEventHub(EventHub eventHub); - } - - /** - * Stage of the authorization rule definition allowing to specify access policy. - */ - interface WithAccessPolicy extends AuthorizationRule - .DefinitionStages - .WithListenOrSendOrManage { - - } - - /** - * The stage of the definition which contains all the minimum required inputs for - * the resource to be created (via {@link WithCreate#create()}), but also allows - * for any other optional settings to be specified. - */ - interface WithCreate extends Creatable { - } - } - - /** - * The entirety of the event hub namespace authorization rule definition. - */ - interface Definition extends - DefinitionStages.Blank, - DefinitionStages.WithEventHub, - DefinitionStages.WithAccessPolicy, - DefinitionStages.WithCreate { - } - - /** - * The entirety of the event hub authorization rule update. - */ - interface Update extends - Appliable, - UpdateStages.WithListenOrSendOrManage { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/EventHubAuthorizationRules.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/EventHubAuthorizationRules.java deleted file mode 100644 index 77533544563b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/EventHubAuthorizationRules.java +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.eventhubs.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.eventhubs.EventHubsManager; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsCreating; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingById; -import reactor.core.publisher.Mono; - -/** - * Entry point to manage event hub authorization rules. - */ -@Fluent -public interface EventHubAuthorizationRules extends - SupportsCreating, - SupportsDeletingById, - SupportsGettingById, - HasManager { - /** - * Lists the authorization rules of an event hub in a namespace under a resource group. - * - * @param resourceGroupName namespace resource group name - * @param namespaceName event hub parent namespace name - * @param eventHubName event hub name - * @return list of authorization rules - */ - PagedIterable listByEventHub( - String resourceGroupName, String namespaceName, String eventHubName); - /** - * Lists the authorization rules of an event hub in a namespace under a resource group. - * - * @param resourceGroupName namespace resource group name - * @param namespaceName event hub parent namespace name - * @param eventHubName event hub name - * @return observable that emits the authorization rules - */ - PagedFlux listByEventHubAsync( - String resourceGroupName, String namespaceName, String eventHubName); - /** - * Gets an authorization rule of an event hub in a namespace in a resource group. - * - * @param resourceGroupName namespace resource group name - * @param namespaceName event hub parent namespace name - * @param eventHubName event hub name - * @param name authorization rule name - * @return observable that emits the authorization rule - */ - Mono getByNameAsync( - String resourceGroupName, String namespaceName, String eventHubName, String name); - /** - * Gets an authorization rule of an event hub in a namespace under a resource group. - * - * @param resourceGroupName namespace resource group name - * @param namespaceName event hub parent namespace name - * @param eventHubName event hub name - * @param name authorization rule name - * @return the authorization rule - */ - EventHubAuthorizationRule getByName( - String resourceGroupName, String namespaceName, String eventHubName, String name); - - /** - * Deletes an authorization rule of an event hub in a namespace under a resource group. - * - * @param resourceGroupName namespace resource group name - * @param namespaceName event hub parent namespace name - * @param eventHubName event hub name - * @param name authorization rule name - * @return the completable representing the task - */ - Mono deleteByNameAsync( - String resourceGroupName, String namespaceName, String eventHubName, String name); - - /** - * Deletes an authorization rule of an event hub in a namespace under a resource group. - * - * @param resourceGroupName namespace resource group name - * @param namespaceName event hub parent namespace name - * @param eventHubName event hub name - * @param name authorization rule name - */ - void deleteByName(String resourceGroupName, String namespaceName, String eventHubName, String name); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/EventHubConsumerGroup.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/EventHubConsumerGroup.java deleted file mode 100644 index c641dcacc071..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/EventHubConsumerGroup.java +++ /dev/null @@ -1,159 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.eventhubs.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.eventhubs.EventHubsManager; -import com.azure.resourcemanager.eventhubs.fluent.models.ConsumerGroupInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.model.Appliable; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; -import com.azure.resourcemanager.resources.fluentcore.model.Updatable; - -import java.time.OffsetDateTime; - -/** - * Type representing consumer group of an event hub. - */ -@Fluent -public interface EventHubConsumerGroup extends - NestedResource, - HasManager, - Refreshable, - HasInnerModel, - Updatable { - /** - * @return the resource group of the namespace where parent event hub resides - */ - String namespaceResourceGroupName(); - - /** - * @return the namespace name of parent event hub - */ - String namespaceName(); - - /** - * @return the name of the parent event hub - */ - String eventHubName(); - - /** - * @return creation time of the consumer group - */ - OffsetDateTime createdAt(); - - /** - * @return last modified time of the consumer group - */ - OffsetDateTime updatedAt(); - - /** - * @return user metadata associated with the consumer group - */ - String userMetadata(); - - /** - * The entirety of the consumer group definition. - */ - interface Definition extends - DefinitionStages.Blank, - DefinitionStages.WithEventHub, - DefinitionStages.WithUserMetadata, - DefinitionStages.WithCreate { - } - - /** - * Grouping of consumer group definition stages. - */ - interface DefinitionStages { - /** - * The first stage of a event hub definition. - */ - interface Blank extends WithEventHub { - } - - /** - * The stage of the consumer group definition allowing to specify the event - * hub to be associated with it. - */ - interface WithEventHub { - /** - * Specifies the event hub for which consumer group needs to be created. - * - * @param eventHub event hub - * @return next stage of the consumer group definition - */ - WithCreate withExistingEventHub(EventHub eventHub); - - /** - * Specifies the event hub for which consumer group needs to be created. - * - * @param eventHubId ARM resource id of event hub - * @return next stage of the consumer group definition - */ - WithCreate withExistingEventHubId(String eventHubId); - - /** - * Specifies the event hub for which consumer group needs to be created. - * - * @param resourceGroupName event hub namespace resource group name - * @param namespaceName event hub namespace name - * @param eventHubName event hub name - * @return next stage of the consumer group definition - */ - WithCreate withExistingEventHub(String resourceGroupName, String namespaceName, String eventHubName); - } - - /** - * The stage of the consumer group definition allowing to specify user metadata. - */ - interface WithUserMetadata { - /** - * Specifies user metadata. - * - * @param metadata the metadata - * @return next stage of the consumer group definition - */ - WithCreate withUserMetadata(String metadata); - } - - /** - * The stage of the definition which contains all the minimum required inputs for - * the resource to be created (via {@link WithCreate#create()}), but also allows - * for any other optional settings to be specified. - */ - interface WithCreate extends - Creatable, - DefinitionStages.WithUserMetadata { - } - } - - /** - * The template for a consumer group update operation, containing all the settings - * that can be modified. - */ - interface Update extends - Appliable, - UpdateStages.WithUserMetadata { - } - - /** - * Grouping of consumer group update stages. - */ - interface UpdateStages { - /** - * The stage of the consumer group update allowing to specify user metadata. - */ - interface WithUserMetadata { - /** - * Specifies user metadata. - * - * @param metadata the metadata - * @return next stage of the consumer group update - */ - Update withUserMetadata(String metadata); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/EventHubConsumerGroups.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/EventHubConsumerGroups.java deleted file mode 100644 index 8e4372fa9c20..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/EventHubConsumerGroups.java +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.eventhubs.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.eventhubs.EventHubsManager; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsCreating; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingById; -import reactor.core.publisher.Mono; - -/** - * Entry point to manage event hub consumer groups. - */ -@Fluent -public interface EventHubConsumerGroups extends - SupportsCreating, - SupportsDeletingById, - SupportsGettingById, - HasManager { - /** - * Lists the consumer groups of an event hub in a namespace under a resource group. - * - * @param resourceGroupName namespace resource group name - * @param namespaceName event hub parent namespace name - * @param eventHubName event hub name - * @return list of consumer groups - */ - PagedIterable listByEventHub( - String resourceGroupName, String namespaceName, String eventHubName); - - /** - * Lists the consumer groups of an event hub in a namespace under a resource group. - * - * @param resourceGroupName namespace resource group name - * @param namespaceName event hub parent namespace name - * @param eventHubName event hub name - * @return observable that emits the consumer groups - */ - PagedFlux listByEventHubAsync( - String resourceGroupName, String namespaceName, String eventHubName); - - /** - * Gets a consumer group of an event hub in a namespace in a resource group. - * - * @param resourceGroupName namespace resource group name - * @param namespaceName event hub parent namespace name - * @param eventHubName event hub name - * @param name consumer group name - * @return observable that emits the consumer group - */ - Mono getByNameAsync( - String resourceGroupName, String namespaceName, String eventHubName, String name); - - /** - * Gets a consumer group of an event hub in a namespace under a resource group. - * - * @param resourceGroupName namespace resource group name - * @param namespaceName event hub parent namespace name - * @param eventHubName event hub name - * @param name consumer group name - * @return the consumer group - */ - EventHubConsumerGroup getByName( - String resourceGroupName, String namespaceName, String eventHubName, String name); - - /** - * Deletes a consumer group of an event hub in a namespace under a resource group. - * - * @param resourceGroupName namespace resource group name - * @param namespaceName event hub parent namespace name - * @param eventHubName event hub name - * @param name consumer group name - * @return the completable representing the task - */ - Mono deleteByNameAsync( - String resourceGroupName, String namespaceName, String eventHubName, String name); - - /** - * Deletes a consumer group of an event hub in a namespace under a resource group. - * - * @param resourceGroupName namespace resource group name - * @param namespaceName event hub parent namespace name - * @param eventHubName event hub name - * @param name consumer group name - */ - void deleteByName( - String resourceGroupName, String namespaceName, String eventHubName, String name); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/EventHubDisasterRecoveryPairing.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/EventHubDisasterRecoveryPairing.java deleted file mode 100644 index 185d118943eb..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/EventHubDisasterRecoveryPairing.java +++ /dev/null @@ -1,226 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.eventhubs.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.eventhubs.fluent.models.ArmDisasterRecoveryInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.model.Appliable; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; -import com.azure.resourcemanager.resources.fluentcore.model.Updatable; -import com.azure.resourcemanager.eventhubs.EventHubsManager; -import reactor.core.publisher.Mono; - -/** - * Type representing disaster recovery pairing for event hub namespaces. - */ -@Fluent -public interface EventHubDisasterRecoveryPairing extends - NestedResource, - HasManager, - Refreshable, - Updatable, - HasInnerModel { - /** - * @return primary event hub namespace resource group - */ - String primaryNamespaceResourceGroupName(); - - /** - * @return primary event hub namespace in the pairing - */ - String primaryNamespaceName(); - - /** - * @return secondary event hub namespace in the pairing - */ - String secondaryNamespaceId(); - - /** - * @return the namespace role - */ - RoleDisasterRecovery namespaceRole(); - - /** - * @return provisioning state of the pairing - */ - ProvisioningStateDR provisioningState(); - - /** - * Break the pairing between a primary and secondary namespace. - * - * @return completable representing the pairing break action - */ - Mono breakPairingAsync(); - - /** - * Break the pairing between a primary and secondary namespace. - */ - void breakPairing(); - - /** - * Perform fail over so that the secondary namespace becomes the primary. - * - * @return completable representing the fail-over action - */ - Mono failOverAsync(); - - /** - * Perform fail over so that the secondary namespace becomes the primary. - */ - void failOver(); - - /** - * @return the authorization rules for the event hub disaster recovery pairing - */ - PagedFlux listAuthorizationRulesAsync(); - - /** - * @return the authorization rules for the event hub disaster recovery pairing - */ - PagedIterable listAuthorizationRules(); - - /** - * The entirety of the event hub disaster recovery pairing definition. - */ - interface Definition extends - DefinitionStages.Blank, - DefinitionStages.WithPrimaryNamespace, - DefinitionStages.WithSecondaryNamespace, - DefinitionStages.WithCreate { - } - - /** - * Grouping of disaster recovery pairing definition stages. - */ - interface DefinitionStages { - /** - * The first stage of a disaster recovery pairing definition. - */ - interface Blank extends WithPrimaryNamespace { - } - - /** - * The stage of the disaster recovery pairing definition allowing to specify primary event hub namespace. - */ - interface WithPrimaryNamespace { - /** - * Specifies that the given namespace should be used as primary namespace in disaster recovery pairing. - * - * @param namespaceCreatable creatable definition for the primary namespace - * @return next stage of the disaster recovery pairing definition - */ - WithSecondaryNamespace withNewPrimaryNamespace(Creatable namespaceCreatable); - - /** - * Specifies that the given namespace should be used as primary namespace in disaster recovery pairing. - * - * @param namespace the primary event hub namespace - * @return next stage of the disaster recovery pairing definition - */ - WithSecondaryNamespace withExistingPrimaryNamespace(EventHubNamespace namespace); - - /** - * Specifies that the given namespace should be used as primary namespace in disaster recovery pairing. - * - * @param resourceGroupName resource group name of primary namespace - * @param namespaceName the primary namespace - * @return next stage of the disaster recovery pairing definition - */ - WithSecondaryNamespace withExistingPrimaryNamespace(String resourceGroupName, String namespaceName); - - /** - * Specifies that the given namespace should be used as primary namespace in disaster recovery pairing. - * - * @param namespaceId the primary namespace - * @return next stage of the disaster recovery pairing definition - */ - WithSecondaryNamespace withExistingPrimaryNamespaceId(String namespaceId); - } - - /** - * The stage of the disaster recovery pairing definition allowing to specify the secondary event hub namespace. - */ - interface WithSecondaryNamespace { - /** - * Specifies that the given namespace should be used as secondary namespace in disaster recovery pairing. - * - * @param namespaceCreatable creatable definition for the primary namespace - * @return next stage of the event hub definition - */ - WithCreate withNewSecondaryNamespace(Creatable namespaceCreatable); - - /** - * Specifies that the given namespace should be used as secondary namespace in disaster recovery pairing. - * - * @param namespace the secondary namespace - * @return next stage of the disaster recovery pairing definition - */ - WithCreate withExistingSecondaryNamespace(EventHubNamespace namespace); - - /** - * Specifies that the given namespace should be used as secondary namespace in disaster recovery pairing. - * - * @param namespaceId the secondary namespace - * @return next stage of the disaster recovery pairing definition - */ - WithCreate withExistingSecondaryNamespaceId(String namespaceId); - } - - /** - * The stage of the definition which contains all the minimum required inputs for - * the resource to be created (via {@link WithCreate#create()}), but also allows - * for any other optional settings to be specified. - */ - interface WithCreate extends - Creatable { - } - } - - /** - * Grouping of disaster recovery pairing update stages. - */ - interface UpdateStages { - /** - * The stage of the disaster recovery pairing definition allowing to specify primary event hub namespace. - */ - interface WithSecondaryNamespace { - /** - * Specifies that the given namespace should be used as secondary namespace in disaster recovery pairing. - * - * @param namespaceCreatable creatable definition for the secondary namespace - * @return next stage of the disaster recovery pairing update - */ - Update withNewSecondaryNamespace(Creatable namespaceCreatable); - - /** - * Specifies that the given namespace should be used as secondary namespace in disaster recovery pairing. - * - * @param namespace the secondary event hub namespace - * @return next stage of the disaster recovery pairing update - */ - Update withExistingSecondaryNamespace(EventHubNamespace namespace); - - /** - * Specifies that the given namespace should be used as secondary namespace in disaster recovery pairing. - * - * @param namespaceId the secondary namespace - * @return next stage of the disaster recovery pairing update - */ - Update withExistingSecondaryNamespaceId(String namespaceId); - } - } - - /** - * The template for a disaster recovery pairing update operation, containing all the settings - * that can be modified. - */ - interface Update extends - UpdateStages.WithSecondaryNamespace, - Appliable { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/EventHubDisasterRecoveryPairings.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/EventHubDisasterRecoveryPairings.java deleted file mode 100644 index 6180d9f2ea4d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/EventHubDisasterRecoveryPairings.java +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.eventhubs.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsCreating; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingById; -import com.azure.resourcemanager.eventhubs.EventHubsManager; -import reactor.core.publisher.Mono; - -/** - * Entry point to manage disaster recovery pairing of event hub namespaces. - */ -@Fluent -public interface EventHubDisasterRecoveryPairings extends - SupportsCreating, - SupportsDeletingById, - SupportsGettingById, - HasManager { - /** - * @return entry point to manage authorization rules of a disaster recovery pairing. - */ - DisasterRecoveryPairingAuthorizationRules authorizationRules(); - /** - * Lists the disaster recovery pairings of a namespace under a resource group. - * - * @param resourceGroupName resource group name - * @param namespaceName namespace name - * @return list of disaster recovery pairings - */ - PagedIterable listByNamespace(String resourceGroupName, String namespaceName); - /** - * Lists the disaster recovery pairings of a namespace under a resource group. - * - * @param resourceGroupName resource group name - * @param namespaceName namespace name - * @return observable that emits disaster recovery pairings - */ - PagedFlux listByNamespaceAsync(String resourceGroupName, String namespaceName); - /** - * Gets a disaster recovery pairings of a namespace under a resource group. - * - * @param resourceGroupName resource group name - * @param namespaceName namespace name - * @param name disaster recovery pairing name - * @return observable that emits disaster recovery pairings - */ - Mono getByNameAsync(String resourceGroupName, String namespaceName, String name); - - /** - * Gets a disaster recovery pairings of a namespace under a resource group. - * - * @param resourceGroupName resource group name - * @param namespaceName namespace name - * @param name disaster recovery pairing name - * @return the disaster recovery pairing - */ - EventHubDisasterRecoveryPairing getByName(String resourceGroupName, String namespaceName, String name); - - /** - * Deletes a disaster recovery pairings of a namespace under a resource group. - * - * @param resourceGroupName resource group name - * @param namespaceName namespace name - * @param name disaster recovery pairing name - * @return the completable representing the task - */ - Mono deleteByNameAsync(String resourceGroupName, String namespaceName, String name); - - /** - * Deletes a disaster recovery pairings of a namespace under a resource group. - * - * @param resourceGroupName resource group name - * @param namespaceName namespace name - * @param name disaster recovery pairing - */ - void deleteByName(String resourceGroupName, String namespaceName, String name); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/EventHubListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/EventHubListResult.java deleted file mode 100644 index 1fc08d83cb3a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/EventHubListResult.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.eventhubs.fluent.models.EventhubInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The result of the List EventHubs operation. */ -@Fluent -public final class EventHubListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(EventHubListResult.class); - - /* - * Result of the List EventHubs operation. - */ - @JsonProperty(value = "value") - private List value; - - /* - * Link to the next set of results. Not empty if Value contains incomplete - * list of EventHubs. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: Result of the List EventHubs operation. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Result of the List EventHubs operation. - * - * @param value the value value to set. - * @return the EventHubListResult object itself. - */ - public EventHubListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to the next set of results. Not empty if Value contains incomplete list of - * EventHubs. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: Link to the next set of results. Not empty if Value contains incomplete list of - * EventHubs. - * - * @param nextLink the nextLink value to set. - * @return the EventHubListResult object itself. - */ - public EventHubListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/EventHubNamespace.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/EventHubNamespace.java deleted file mode 100644 index 59ca5464c62e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/EventHubNamespace.java +++ /dev/null @@ -1,376 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.eventhubs.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.eventhubs.fluent.models.EHNamespaceInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.GroupableResource; -import com.azure.resourcemanager.resources.fluentcore.arm.models.Resource; -import com.azure.resourcemanager.resources.fluentcore.model.Appliable; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; -import com.azure.resourcemanager.resources.fluentcore.model.Updatable; -import com.azure.resourcemanager.eventhubs.EventHubsManager; - -import java.time.OffsetDateTime; - -/** - * Type representing an Azure EventHub namespace. - */ -@Fluent -public interface EventHubNamespace extends - GroupableResource, - Refreshable, - Updatable { - /** - * @return namespace sku - */ - EventHubNamespaceSkuType sku(); - - /** - * @return resource id of the Azure Insights metrics associated with the namespace - */ - String azureInsightMetricId(); - - /** - * @return the service bus endpoint associated with the namespace - */ - String serviceBusEndpoint(); - - /** - * @return namespace created time - */ - OffsetDateTime createdAt(); - - /** - * @return namespace last modified time - */ - OffsetDateTime updatedAt(); - - /** - * @return provisioning state of the namespace - */ - String provisioningState(); - - /** - * @return true if auto-scale is enabled for the namespace, false otherwise - */ - boolean isAutoScaleEnabled(); - - /** - * @return current throughput units set for the namespace - */ - int currentThroughputUnits(); - - /** - * @return maximum throughput unit that auto-scalar is allowed to set - */ - int throughputUnitsUpperLimit(); - - /** - * @return the event hubs in the namespace - */ - PagedFlux listEventHubsAsync(); - - /** - * @return the authorization rules for the event hub namespace - */ - PagedFlux listAuthorizationRulesAsync(); - - /** - * @return list of event hubs in the namespace - */ - PagedIterable listEventHubs(); - - /** - * @return list of authorization rules for the event hub namespace - */ - PagedIterable listAuthorizationRules(); - - /** - * The entirety of the event hub namespace definition. - */ - interface Definition extends - EventHubNamespace.DefinitionStages.Blank, - EventHubNamespace.DefinitionStages.WithGroup, - EventHubNamespace.DefinitionStages.WithCreate { - } - - /** - * Grouping of event hub namespace definition stages. - */ - interface DefinitionStages { - /** - * The first stage of a event hub namespace definition. - */ - interface Blank extends GroupableResource.DefinitionWithRegion { - } - - /** - * The stage of the event hub namespace definition allowing to specify the resource group. - */ - interface WithGroup extends GroupableResource.DefinitionStages.WithGroup { - } - - /** - * The stage of the event hub namespace definition allowing to specify the sku. - */ - interface WithSku { - /** - * Specifies the namespace sku. - * - * @param namespaceSku the sku - * @return next stage of the event hub namespace definition - */ - WithCreate withSku(EventHubNamespaceSkuType namespaceSku); - } - - /** - * The stage of the event hub namespace definition allowing to add new event hub in the namespace. - */ - interface WithEventHub { - /** - * Specifies that a new event hub should be created in the namespace. - * - * @param eventHubName event hub name - * @return next stage of the event hub namespace definition - */ - WithCreate withNewEventHub(String eventHubName); - - /** - * Specifies that a new event hub should be created in the namespace. - * - * @param eventHubName event hub name - * @param partitionCount the number of partitions in the event hub - * @return next stage of the event hub namespace definition - */ - WithCreate withNewEventHub(String eventHubName, int partitionCount); - - /** - * Specifies that a new event hub should be created in the namespace. - * - * @param eventHubName event hub name - * @param partitionCount the number of partitions in the event hub - * @param retentionPeriodInDays the retention period for events in days - * @return next stage of the event hub namespace definition - */ - WithCreate withNewEventHub(String eventHubName, int partitionCount, int retentionPeriodInDays); - } - - /** - * The stage of the event hub namespace definition allowing to add authorization rule for accessing - * the event hub. - */ - interface WithAuthorizationRule { - /** - * Specifies that a new authorization rule should be created - * that has send access to the event hub namespace. - * - * @param ruleName rule name - * @return next stage of the event hub namespace definition - */ - WithCreate withNewSendRule(String ruleName); - - /** - * Specifies that a new authorization rule should be created - * that has listen access to the event hub namespace. - * - * @param ruleName rule name - * @return next stage of the event hub namespace definition - */ - WithCreate withNewListenRule(String ruleName); - - /** - * Specifies that a new authorization rule should be created - * that has manage access to the event hub namespace. - * - * @param ruleName rule name - * @return next stage of the event hub namespace definition - */ - WithCreate withNewManageRule(String ruleName); - } - - /** - * The stage of the event hub namespace definition - * allowing to specify the throughput unit settings. - */ - interface WithThroughputConfiguration { - /** - * Enables the scaling up the throughput units automatically based on load. - * - * @return next stage of the event hub namespace definition - */ - WithCreate withAutoScaling(); - /** - * Specifies the current throughput units. - * - * @param units throughput units - * @return next stage of the event hub namespace definition - */ - WithCreate withCurrentThroughputUnits(int units); - - /** - * Specifies the maximum throughput units that auto-scalar is allowed to scale-up. - * - * @param units throughput units - * @return next stage of the event hub namespace definition - */ - WithCreate withThroughputUnitsUpperLimit(int units); - } - - /** - * The stage of the definition which contains all the minimum required inputs for - * the resource to be created (via {@link WithCreate#create()}), but also allows - * for any other optional settings to be specified. - */ - interface WithCreate extends - Creatable, - Resource.DefinitionWithTags, - EventHubNamespace.DefinitionStages.WithSku, - EventHubNamespace.DefinitionStages.WithEventHub, - EventHubNamespace.DefinitionStages.WithAuthorizationRule, - EventHubNamespace.DefinitionStages.WithThroughputConfiguration { - } - } - - /** - * The template for a event hub namespace update operation, containing all the settings that can be modified. - */ - interface Update extends - Appliable, - Resource.UpdateWithTags, - EventHubNamespace.UpdateStages.WithSku, - EventHubNamespace.UpdateStages.WithEventHub, - EventHubNamespace.UpdateStages.WithAuthorizationRule, - EventHubNamespace.UpdateStages.WithThroughputConfiguration { - } - - /** - * Grouping of all the event hub namespace update stages. - */ - interface UpdateStages { - /** - * The stage of the event hub namespace update allowing to change the sku. - */ - interface WithSku { - /** - * Specifies the namespace sku. - * - * @param namespaceSku the sku - * @return next stage of the event hub namespace update - */ - Update withSku(EventHubNamespaceSkuType namespaceSku); - } - - /** - * The stage of the event hub namespace update allowing to add new event hub in the namespace. - */ - interface WithEventHub { - /** - * Specifies that a new event hub should be created in the namespace. - * - * @param eventHubName event hub name - * @return next stage of the event hub namespace update - */ - Update withNewEventHub(String eventHubName); - - /** - * Specifies that a new event hub should be created in the namespace. - * - * @param eventHubName event hub name - * @param partitionCount the number of partitions in the event hub - * @return next stage of the event hub namespace update - */ - Update withNewEventHub(String eventHubName, int partitionCount); - - /** - * Specifies that a new event hub should be created in the namespace. - * - * @param eventHubName event hub name - * @param partitionCount the number of partitions in the event hub - * @param retentionPeriodInDays the retention period for events in days - * @return next stage of the event hub namespace update - */ - Update withNewEventHub(String eventHubName, int partitionCount, int retentionPeriodInDays); - - /** - * Deletes an event hub in the event hub namespace. - * - * @param eventHubName event hub name - * @return next stage of the event hub namespace update - */ - Update withoutEventHub(String eventHubName); - } - - /** - * The stage of the event hub namespace update allowing to add authorization rule for accessing - * the event hub. - */ - interface WithAuthorizationRule { - /** - * Specifies that a new authorization rule should be created - * that has send access to the event hub namespace. - * - * @param ruleName rule name - * @return next stage of the event hub namespace update - */ - Update withNewSendRule(String ruleName); - - /** - * Specifies that a new authorization rule should be created - * that has listen access to the event hub namespace. - * - * @param ruleName rule name - * @return next stage of the event hub namespace update - */ - Update withNewListenRule(String ruleName); - - /** - * Specifies that a new authorization rule should be created - * that has manage access to the event hub namespace. - * - * @param ruleName rule name - * @return next stage of the event hub namespace update - */ - Update withNewManageRule(String ruleName); - - /** - * Deletes an authorization rule associated with the event hub namespace. - * - * @param ruleName rule name - * @return next stage of the event hub namespace update - */ - Update withoutAuthorizationRule(String ruleName); - } - - /** - * The stage of the event hub namespace update allowing to specify the throughput unit settings. - */ - interface WithThroughputConfiguration { - /** - * Enables the scaling up the throughput units automatically based on load. - * - * @return next stage of the event hub namespace update - */ - Update withAutoScaling(); - - /** - * Specifies the current throughput units. - * - * @param units throughput units - * @return next stage of the event hub namespace update - */ - Update withCurrentThroughputUnits(int units); - - /** - * Specifies the maximum throughput units that auto-scalar is allowed to scale-up. - * - * @param units throughput units - * @return next stage of the event hub namespace update - */ - Update withThroughputUnitsUpperLimit(int units); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/EventHubNamespaceAuthorizationRule.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/EventHubNamespaceAuthorizationRule.java deleted file mode 100644 index 4f38078cdc5f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/EventHubNamespaceAuthorizationRule.java +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.eventhubs.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.model.Appliable; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; - -/** - * Type representing authorization rule of an event hub namespace. - */ -@Fluent -public interface EventHubNamespaceAuthorizationRule - extends AuthorizationRule { - /** - * @return the resource group of the namespace where parent event hub resides. - */ - String namespaceResourceGroupName(); - - /** - * @return the name of the event hub namespace. - */ - String namespaceName(); - - /** - * Grouping of Event Hub namespace authorization rule definition stages. - */ - interface DefinitionStages { - /** - * The first stage of event hub namespace authorization rule definition. - */ - interface Blank extends WithNamespace { - } - - /** - * Stage of the authorization rule definition allowing to specify - * the event namespace for which rule needs to be created. - */ - interface WithNamespace { - /** - * Specifies that authorization rule needs to be created for the given event hub namespace. - * - * @param namespaceResourceId the resource id of the event Hub namespace - * @return the next stage of the definition - */ - WithAccessPolicy withExistingNamespaceId(String namespaceResourceId); - - /** - * Specifies that authorization rule needs to be created for the given event hub namespace. - * - * @param resourceGroupName namespace resource group name - * @param namespaceName namespace name - * @return the next stage of the definition - */ - WithAccessPolicy withExistingNamespace(String resourceGroupName, String namespaceName); - - /** - * Specifies that authorization rule needs to be created for the given event hub namespace. - * - * @param namespace the namespace - * @return the next stage of the definition - */ - WithAccessPolicy withExistingNamespace(EventHubNamespace namespace); - } - - /** - * Stage of the authorization rule definition allowing to specify access policy. - */ - interface WithAccessPolicy extends AuthorizationRule - .DefinitionStages - .WithListenOrSendOrManage { - - } - - /** - * The stage of the definition which contains all the minimum required inputs for - * the resource to be created (via {@link WithCreate#create()}), but also allows - * for any other optional settings to be specified. - */ - interface WithCreate extends Creatable { - } - } - - /** - * The entirety of the event hub namespace authorization rule definition. - */ - interface Definition extends - DefinitionStages.Blank, - DefinitionStages.WithNamespace, - DefinitionStages.WithAccessPolicy, - DefinitionStages.WithCreate { - } - - /** - * The entirety of the event hub namespace authorization rule update. - */ - interface Update extends - Appliable, - AuthorizationRule.UpdateStages.WithListenOrSendOrManage { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/EventHubNamespaceAuthorizationRules.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/EventHubNamespaceAuthorizationRules.java deleted file mode 100644 index f29f3e5f9821..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/EventHubNamespaceAuthorizationRules.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.eventhubs.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsCreating; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingById; -import com.azure.resourcemanager.eventhubs.EventHubsManager; -import reactor.core.publisher.Mono; - -/** - * Entry point to manage event hub namespace authorization rules. - */ -@Fluent -public interface EventHubNamespaceAuthorizationRules extends - SupportsCreating, - SupportsDeletingById, - SupportsGettingById, - HasManager { - /** - * Lists the authorization rules under a namespace in a resource group. - * - * @param resourceGroupName resource group name - * @param namespaceName namespace name - * @return list of authorization rules - */ - PagedIterable listByNamespace(String resourceGroupName, String namespaceName); - - /** - * Lists the authorization rules under a namespace in a resource group. - * - * @param resourceGroupName resource group name - * @param namespaceName namespace name - * @return observable that emits the authorization rules - */ - PagedFlux listByNamespaceAsync(String resourceGroupName, String namespaceName); - - /** - * Gets an authorization rule under a namespace in a resource group. - * - * @param resourceGroupName resource group name - * @param namespaceName namespace name - * @param name authorization rule name - * @return observable that emits the authorization rule - */ - Mono getByNameAsync( - String resourceGroupName, String namespaceName, String name); - - /** - * Gets an authorization rule under a namespace in a resource group. - * - * @param resourceGroupName resource group name - * @param namespaceName namespace name - * @param name authorization rule name - * @return the authorization rule - */ - EventHubNamespaceAuthorizationRule getByName(String resourceGroupName, String namespaceName, String name); - - /** - * Deletes an authorization rule under a namespace in a resource group. - * - * @param resourceGroupName resource group name - * @param namespaceName namespace name - * @param name authorization rule name - * @return the completable representing the task - */ - Mono deleteByNameAsync(String resourceGroupName, String namespaceName, String name); - - /** - * Deletes an authorization rule under a namespace in a resource group. - * - * @param resourceGroupName resource group name - * @param namespaceName namespace name - * @param name authorization rule name - */ - void deleteByName(String resourceGroupName, String namespaceName, String name); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/EventHubNamespaceSkuType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/EventHubNamespaceSkuType.java deleted file mode 100644 index 9ff15778981f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/EventHubNamespaceSkuType.java +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.eventhubs.models; - -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; - -/** - * Defines values for EventHubNamespaceSkuType. - */ -public class EventHubNamespaceSkuType implements HasInnerModel { - /** Static value NamespaceSku for BASIC. */ - public static final EventHubNamespaceSkuType BASIC = - new EventHubNamespaceSkuType(new Sku().withName(SkuName.BASIC).withTier(SkuTier.BASIC)); - /** Static value NamespaceSku for STANDARD. */ - public static final EventHubNamespaceSkuType STANDARD = - new EventHubNamespaceSkuType(new Sku().withName(SkuName.STANDARD).withTier(SkuTier.STANDARD)); - - private final Sku sku; - - /** - * Creates event hub namespace sku. - * - * @param sku inner sku model instance - */ - public EventHubNamespaceSkuType(Sku sku) { - this.sku = sku; - } - - /** - * Creates event hub namespace sku. - * - * @param name sku name - * @param tier sku tier - */ - public EventHubNamespaceSkuType(SkuName name, SkuTier tier) { - this(new Sku().withName(name).withTier(tier).withCapacity(null)); - } - - @Override - public Sku innerModel() { - return this.sku; - } - - /** - * @return sku tier - */ - public SkuName name() { - return this.sku.name(); - } - - /** - * @return sku tier - */ - public SkuTier tier() { - return this.sku.tier(); - } - - /** - * @return sku capacity - */ - public int capacity() { - return ResourceManagerUtils.toPrimitiveInt(this.sku.capacity()); - } - - @Override - public String toString() { - return String.format("%s_%s", this.sku.name(), this.sku.tier()); - } - - @Override - public int hashCode() { - return this.toString().hashCode(); - } - - @Override - public boolean equals(Object obj) { - if (!(obj instanceof EventHubNamespaceSkuType)) { - return false; - } else if (obj == this) { - return true; - } else { - EventHubNamespaceSkuType rhs = (EventHubNamespaceSkuType) obj; - if (sku == null) { - return rhs.sku == null; - } else { - return this.toString().equalsIgnoreCase(rhs.toString()); - } - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/EventHubNamespaces.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/EventHubNamespaces.java deleted file mode 100644 index fa2ddfac7225..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/EventHubNamespaces.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.eventhubs.models; - - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsBatchDeletion; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsDeletingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsListingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsBatchCreation; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsCreating; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingById; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; -import com.azure.resourcemanager.eventhubs.EventHubsManager; - -/** - * Entry point to manage EventHub namespaces. - */ -@Fluent -public interface EventHubNamespaces extends - SupportsCreating, - SupportsListing, - SupportsListingByResourceGroup, - SupportsGettingByResourceGroup, - SupportsGettingById, - SupportsDeletingById, - SupportsDeletingByResourceGroup, - SupportsBatchCreation, - SupportsBatchDeletion, - HasManager { - /** - * @return entry point to manage authorization rules of event hub namespaces. - */ - EventHubNamespaceAuthorizationRules authorizationRules(); - - /** - * @return entry point to manage event hubs of event hub namespaces. - */ - EventHubs eventHubs(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/EventHubs.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/EventHubs.java deleted file mode 100644 index 636c6a935651..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/EventHubs.java +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.eventhubs.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.eventhubs.EventHubsManager; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsCreating; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingById; -import reactor.core.publisher.Mono; - -/** - * Entry point to manage event hubs. - */ -@Fluent -public interface EventHubs extends - SupportsCreating, - SupportsDeletingById, - SupportsGettingById, - HasManager { - /** - * @return entry point to manage authorization rules of event hubs. - */ - EventHubAuthorizationRules authorizationRules(); - - /** - * @return entry point to manage consumer group of event hubs. - */ - - EventHubConsumerGroups consumerGroups(); - /** - * Lists the event hubs in a namespace under a resource group. - * - * @param resourceGroupName resource group name - * @param namespaceName namespace name - * @return list of event hubs - */ - PagedIterable listByNamespace(String resourceGroupName, String namespaceName); - - /** - * Lists the event hubs in a namespace under a resource group. - * - * @param resourceGroupName resource group name - * @param namespaceName namespace name - * @return observable that emits the event hubs - */ - PagedFlux listByNamespaceAsync(String resourceGroupName, String namespaceName); - - /** - * Gets an event hub in a namespace under a resource group. - * - * @param resourceGroupName resource group name - * @param namespaceName namespace name - * @param name event hub name - * @return observable that emits the event hubs - */ - Mono getByNameAsync(String resourceGroupName, String namespaceName, String name); - - /** - * Gets an event hub in a namespace under a resource group. - * - * @param resourceGroupName resource group name - * @param namespaceName namespace name - * @param name event hub name - * @return the event hubs - */ - EventHub getByName(String resourceGroupName, String namespaceName, String name); - - /** - * Deletes an event hub in a namespace under a resource group. - * - * @param resourceGroupName resource group name - * @param namespaceName namespace name - * @param name event hub name - * @return the completable representing the task - */ - Mono deleteByNameAsync(String resourceGroupName, String namespaceName, String name); - - /** - * Deletes an event hub in a namespace under a resource group. - * - * @param resourceGroupName resource group name - * @param namespaceName namespace name - * @param name event hub name - */ - void deleteByName(String resourceGroupName, String namespaceName, String name); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/Identity.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/Identity.java deleted file mode 100644 index 6c3db3ea0522..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/Identity.java +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Properties to configure Identity for Bring your Own Keys. */ -@Fluent -public class Identity { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Identity.class); - - /* - * ObjectId from the KeyVault - */ - @JsonProperty(value = "principalId") - private String principalId; - - /* - * TenantId from the KeyVault - */ - @JsonProperty(value = "tenantId") - private String tenantId; - - /* - * Enumerates the possible value Identity type, which currently supports - * only 'SystemAssigned' - */ - @JsonProperty(value = "type") - private IdentityType type; - - /** - * Get the principalId property: ObjectId from the KeyVault. - * - * @return the principalId value. - */ - public String principalId() { - return this.principalId; - } - - /** - * Set the principalId property: ObjectId from the KeyVault. - * - * @param principalId the principalId value to set. - * @return the Identity object itself. - */ - public Identity withPrincipalId(String principalId) { - this.principalId = principalId; - return this; - } - - /** - * Get the tenantId property: TenantId from the KeyVault. - * - * @return the tenantId value. - */ - public String tenantId() { - return this.tenantId; - } - - /** - * Set the tenantId property: TenantId from the KeyVault. - * - * @param tenantId the tenantId value to set. - * @return the Identity object itself. - */ - public Identity withTenantId(String tenantId) { - this.tenantId = tenantId; - return this; - } - - /** - * Get the type property: Enumerates the possible value Identity type, which currently supports only - * 'SystemAssigned'. - * - * @return the type value. - */ - public IdentityType type() { - return this.type; - } - - /** - * Set the type property: Enumerates the possible value Identity type, which currently supports only - * 'SystemAssigned'. - * - * @param type the type value to set. - * @return the Identity object itself. - */ - public Identity withType(IdentityType type) { - this.type = type; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/IdentityType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/IdentityType.java deleted file mode 100644 index d7ca820850ee..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/IdentityType.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for IdentityType. */ -public enum IdentityType { - /** Enum value SystemAssigned. */ - SYSTEM_ASSIGNED("SystemAssigned"); - - /** The actual serialized value for a IdentityType instance. */ - private final String value; - - IdentityType(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a IdentityType instance. - * - * @param value the serialized value to parse. - * @return the parsed IdentityType object, or null if unable to parse. - */ - @JsonCreator - public static IdentityType fromString(String value) { - IdentityType[] items = IdentityType.values(); - for (IdentityType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/KeySource.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/KeySource.java deleted file mode 100644 index 35898a466f61..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/KeySource.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for KeySource. */ -public enum KeySource { - /** Enum value Microsoft.KeyVault. */ - MICROSOFT_KEY_VAULT("Microsoft.KeyVault"); - - /** The actual serialized value for a KeySource instance. */ - private final String value; - - KeySource(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a KeySource instance. - * - * @param value the serialized value to parse. - * @return the parsed KeySource object, or null if unable to parse. - */ - @JsonCreator - public static KeySource fromString(String value) { - KeySource[] items = KeySource.values(); - for (KeySource item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/KeyType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/KeyType.java deleted file mode 100644 index 3f9f99308370..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/KeyType.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for KeyType. */ -public enum KeyType { - /** Enum value PrimaryKey. */ - PRIMARY_KEY("PrimaryKey"), - - /** Enum value SecondaryKey. */ - SECONDARY_KEY("SecondaryKey"); - - /** The actual serialized value for a KeyType instance. */ - private final String value; - - KeyType(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a KeyType instance. - * - * @param value the serialized value to parse. - * @return the parsed KeyType object, or null if unable to parse. - */ - @JsonCreator - public static KeyType fromString(String value) { - KeyType[] items = KeyType.values(); - for (KeyType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/KeyVaultProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/KeyVaultProperties.java deleted file mode 100644 index 2ecdb23f8116..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/KeyVaultProperties.java +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Properties to configure keyVault Properties. */ -@Fluent -public final class KeyVaultProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(KeyVaultProperties.class); - - /* - * Name of the Key from KeyVault - */ - @JsonProperty(value = "keyName") - private String keyName; - - /* - * Uri of KeyVault - */ - @JsonProperty(value = "keyVaultUri") - private String keyVaultUri; - - /* - * Key Version - */ - @JsonProperty(value = "keyVersion") - private String keyVersion; - - /** - * Get the keyName property: Name of the Key from KeyVault. - * - * @return the keyName value. - */ - public String keyName() { - return this.keyName; - } - - /** - * Set the keyName property: Name of the Key from KeyVault. - * - * @param keyName the keyName value to set. - * @return the KeyVaultProperties object itself. - */ - public KeyVaultProperties withKeyName(String keyName) { - this.keyName = keyName; - return this; - } - - /** - * Get the keyVaultUri property: Uri of KeyVault. - * - * @return the keyVaultUri value. - */ - public String keyVaultUri() { - return this.keyVaultUri; - } - - /** - * Set the keyVaultUri property: Uri of KeyVault. - * - * @param keyVaultUri the keyVaultUri value to set. - * @return the KeyVaultProperties object itself. - */ - public KeyVaultProperties withKeyVaultUri(String keyVaultUri) { - this.keyVaultUri = keyVaultUri; - return this; - } - - /** - * Get the keyVersion property: Key Version. - * - * @return the keyVersion value. - */ - public String keyVersion() { - return this.keyVersion; - } - - /** - * Set the keyVersion property: Key Version. - * - * @param keyVersion the keyVersion value to set. - * @return the KeyVaultProperties object itself. - */ - public KeyVaultProperties withKeyVersion(String keyVersion) { - this.keyVersion = keyVersion; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/MessagingRegionsListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/MessagingRegionsListResult.java deleted file mode 100644 index accce027cfa3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/MessagingRegionsListResult.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.eventhubs.fluent.models.MessagingRegionsInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The response of the List MessagingRegions operation. */ -@Fluent -public final class MessagingRegionsListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MessagingRegionsListResult.class); - - /* - * Result of the List MessagingRegions type. - */ - @JsonProperty(value = "value") - private List value; - - /* - * Link to the next set of results. Not empty if Value contains incomplete - * list of MessagingRegions. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: Result of the List MessagingRegions type. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Result of the List MessagingRegions type. - * - * @param value the value value to set. - * @return the MessagingRegionsListResult object itself. - */ - public MessagingRegionsListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to the next set of results. Not empty if Value contains incomplete list of - * MessagingRegions. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/MessagingRegionsProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/MessagingRegionsProperties.java deleted file mode 100644 index 2daf383c35f2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/MessagingRegionsProperties.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Properties of Messaging Region. */ -@Immutable -public final class MessagingRegionsProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MessagingRegionsProperties.class); - - /* - * Region code - */ - @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) - private String code; - - /* - * Full name of the region - */ - @JsonProperty(value = "fullName", access = JsonProperty.Access.WRITE_ONLY) - private String fullName; - - /** - * Get the code property: Region code. - * - * @return the code value. - */ - public String code() { - return this.code; - } - - /** - * Get the fullName property: Full name of the region. - * - * @return the fullName value. - */ - public String fullName() { - return this.fullName; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/NWRuleSetIpRules.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/NWRuleSetIpRules.java deleted file mode 100644 index a74202e2b8e8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/NWRuleSetIpRules.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Description of NetWorkRuleSet - IpRules resource. */ -@Fluent -public final class NWRuleSetIpRules { - @JsonIgnore private final ClientLogger logger = new ClientLogger(NWRuleSetIpRules.class); - - /* - * IP Mask - */ - @JsonProperty(value = "ipMask") - private String ipMask; - - /* - * The IP Filter Action - */ - @JsonProperty(value = "action") - private NetworkRuleIpAction action; - - /** - * Get the ipMask property: IP Mask. - * - * @return the ipMask value. - */ - public String ipMask() { - return this.ipMask; - } - - /** - * Set the ipMask property: IP Mask. - * - * @param ipMask the ipMask value to set. - * @return the NWRuleSetIpRules object itself. - */ - public NWRuleSetIpRules withIpMask(String ipMask) { - this.ipMask = ipMask; - return this; - } - - /** - * Get the action property: The IP Filter Action. - * - * @return the action value. - */ - public NetworkRuleIpAction action() { - return this.action; - } - - /** - * Set the action property: The IP Filter Action. - * - * @param action the action value to set. - * @return the NWRuleSetIpRules object itself. - */ - public NWRuleSetIpRules withAction(NetworkRuleIpAction action) { - this.action = action; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/NWRuleSetVirtualNetworkRules.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/NWRuleSetVirtualNetworkRules.java deleted file mode 100644 index 8ffb8a4e30a5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/NWRuleSetVirtualNetworkRules.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Description of VirtualNetworkRules - NetworkRules resource. */ -@Fluent -public final class NWRuleSetVirtualNetworkRules { - @JsonIgnore private final ClientLogger logger = new ClientLogger(NWRuleSetVirtualNetworkRules.class); - - /* - * Subnet properties - */ - @JsonProperty(value = "subnet") - private Subnet subnet; - - /* - * Value that indicates whether to ignore missing VNet Service Endpoint - */ - @JsonProperty(value = "ignoreMissingVnetServiceEndpoint") - private Boolean ignoreMissingVnetServiceEndpoint; - - /** - * Get the subnet property: Subnet properties. - * - * @return the subnet value. - */ - public Subnet subnet() { - return this.subnet; - } - - /** - * Set the subnet property: Subnet properties. - * - * @param subnet the subnet value to set. - * @return the NWRuleSetVirtualNetworkRules object itself. - */ - public NWRuleSetVirtualNetworkRules withSubnet(Subnet subnet) { - this.subnet = subnet; - return this; - } - - /** - * Get the ignoreMissingVnetServiceEndpoint property: Value that indicates whether to ignore missing VNet Service - * Endpoint. - * - * @return the ignoreMissingVnetServiceEndpoint value. - */ - public Boolean ignoreMissingVnetServiceEndpoint() { - return this.ignoreMissingVnetServiceEndpoint; - } - - /** - * Set the ignoreMissingVnetServiceEndpoint property: Value that indicates whether to ignore missing VNet Service - * Endpoint. - * - * @param ignoreMissingVnetServiceEndpoint the ignoreMissingVnetServiceEndpoint value to set. - * @return the NWRuleSetVirtualNetworkRules object itself. - */ - public NWRuleSetVirtualNetworkRules withIgnoreMissingVnetServiceEndpoint(Boolean ignoreMissingVnetServiceEndpoint) { - this.ignoreMissingVnetServiceEndpoint = ignoreMissingVnetServiceEndpoint; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (subnet() != null) { - subnet().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/NestedResource.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/NestedResource.java deleted file mode 100644 index a959199a3c4d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/NestedResource.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.eventhubs.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.model.Indexable; - -/** - * A type contains subset of ARM envelop properties - * in {@link com.azure.core.management.Resource} namely id, name and type. - */ -@Fluent -public interface NestedResource extends Indexable { - /** - * @return resource id. - */ - String id(); - - /** - * @return the resource name. - */ - String name(); - - /** - * - * @return the resource type. - */ - String type(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/NetworkRuleIpAction.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/NetworkRuleIpAction.java deleted file mode 100644 index 954b1692ed2d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/NetworkRuleIpAction.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for NetworkRuleIpAction. */ -public final class NetworkRuleIpAction extends ExpandableStringEnum { - /** Static value Allow for NetworkRuleIpAction. */ - public static final NetworkRuleIpAction ALLOW = fromString("Allow"); - - /** - * Creates or finds a NetworkRuleIpAction from its string representation. - * - * @param name a name to look for. - * @return the corresponding NetworkRuleIpAction. - */ - @JsonCreator - public static NetworkRuleIpAction fromString(String name) { - return fromString(name, NetworkRuleIpAction.class); - } - - /** @return known NetworkRuleIpAction values. */ - public static Collection values() { - return values(NetworkRuleIpAction.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/NetworkRuleSetListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/NetworkRuleSetListResult.java deleted file mode 100644 index c3762821a041..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/NetworkRuleSetListResult.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.eventhubs.fluent.models.NetworkRuleSetInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The response of the List NetworkRuleSet operation. */ -@Fluent -public final class NetworkRuleSetListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkRuleSetListResult.class); - - /* - * Result of the List NetworkRuleSet operation. - */ - @JsonProperty(value = "value") - private List value; - - /* - * Link to the next set of results. Not empty if Value contains incomplete - * list of NetworkRuleSet. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: Result of the List NetworkRuleSet operation. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Result of the List NetworkRuleSet operation. - * - * @param value the value value to set. - * @return the NetworkRuleSetListResult object itself. - */ - public NetworkRuleSetListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to the next set of results. Not empty if Value contains incomplete list of - * NetworkRuleSet. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: Link to the next set of results. Not empty if Value contains incomplete list of - * NetworkRuleSet. - * - * @param nextLink the nextLink value to set. - * @return the NetworkRuleSetListResult object itself. - */ - public NetworkRuleSetListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/OperationDisplay.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/OperationDisplay.java deleted file mode 100644 index 135958ba6406..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/OperationDisplay.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The object that represents the operation. */ -@Immutable -public final class OperationDisplay { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationDisplay.class); - - /* - * Service provider: Microsoft.EventHub - */ - @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) - private String provider; - - /* - * Resource on which the operation is performed: Invoice, etc. - */ - @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) - private String resource; - - /* - * Operation type: Read, write, delete, etc. - */ - @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) - private String operation; - - /** - * Get the provider property: Service provider: Microsoft.EventHub. - * - * @return the provider value. - */ - public String provider() { - return this.provider; - } - - /** - * Get the resource property: Resource on which the operation is performed: Invoice, etc. - * - * @return the resource value. - */ - public String resource() { - return this.resource; - } - - /** - * Get the operation property: Operation type: Read, write, delete, etc. - * - * @return the operation value. - */ - public String operation() { - return this.operation; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/OperationListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/OperationListResult.java deleted file mode 100644 index 46e07ae02d1d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/OperationListResult.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.eventhubs.fluent.models.OperationInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** - * Result of the request to list Event Hub operations. It contains a list of operations and a URL link to get the next - * set of results. - */ -@Immutable -public final class OperationListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationListResult.class); - - /* - * List of Event Hub operations supported by the Microsoft.EventHub - * resource provider. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /* - * URL to get the next set of operation list results if there are any. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: List of Event Hub operations supported by the Microsoft.EventHub resource provider. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: URL to get the next set of operation list results if there are any. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/PrivateEndpoint.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/PrivateEndpoint.java deleted file mode 100644 index b75d87946bda..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/PrivateEndpoint.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** PrivateEndpoint information. */ -@Fluent -public final class PrivateEndpoint { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpoint.class); - - /* - * The ARM identifier for Private Endpoint. - */ - @JsonProperty(value = "id") - private String id; - - /** - * Get the id property: The ARM identifier for Private Endpoint. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: The ARM identifier for Private Endpoint. - * - * @param id the id value to set. - * @return the PrivateEndpoint object itself. - */ - public PrivateEndpoint withId(String id) { - this.id = id; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/PrivateEndpointConnectionListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/PrivateEndpointConnectionListResult.java deleted file mode 100644 index b1faec7042a1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/PrivateEndpointConnectionListResult.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.eventhubs.fluent.models.PrivateEndpointConnectionInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Result of the list of all private endpoint connections operation. */ -@Fluent -public final class PrivateEndpointConnectionListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionListResult.class); - - /* - * A collection of private endpoint connection resources. - */ - @JsonProperty(value = "value") - private List value; - - /* - * A link for the next page of private endpoint connection resources. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: A collection of private endpoint connection resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: A collection of private endpoint connection resources. - * - * @param value the value value to set. - * @return the PrivateEndpointConnectionListResult object itself. - */ - public PrivateEndpointConnectionListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: A link for the next page of private endpoint connection resources. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: A link for the next page of private endpoint connection resources. - * - * @param nextLink the nextLink value to set. - * @return the PrivateEndpointConnectionListResult object itself. - */ - public PrivateEndpointConnectionListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/PrivateLinkConnectionStatus.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/PrivateLinkConnectionStatus.java deleted file mode 100644 index 436cfa00c06b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/PrivateLinkConnectionStatus.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for PrivateLinkConnectionStatus. */ -public final class PrivateLinkConnectionStatus extends ExpandableStringEnum { - /** Static value Pending for PrivateLinkConnectionStatus. */ - public static final PrivateLinkConnectionStatus PENDING = fromString("Pending"); - - /** Static value Approved for PrivateLinkConnectionStatus. */ - public static final PrivateLinkConnectionStatus APPROVED = fromString("Approved"); - - /** Static value Rejected for PrivateLinkConnectionStatus. */ - public static final PrivateLinkConnectionStatus REJECTED = fromString("Rejected"); - - /** Static value Disconnected for PrivateLinkConnectionStatus. */ - public static final PrivateLinkConnectionStatus DISCONNECTED = fromString("Disconnected"); - - /** - * Creates or finds a PrivateLinkConnectionStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding PrivateLinkConnectionStatus. - */ - @JsonCreator - public static PrivateLinkConnectionStatus fromString(String name) { - return fromString(name, PrivateLinkConnectionStatus.class); - } - - /** @return known PrivateLinkConnectionStatus values. */ - public static Collection values() { - return values(PrivateLinkConnectionStatus.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/PrivateLinkResource.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/PrivateLinkResource.java deleted file mode 100644 index f9dc41755205..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/PrivateLinkResource.java +++ /dev/null @@ -1,191 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.eventhubs.fluent.models.PrivateLinkResourceProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Information of the private link resource. */ -@Fluent -public final class PrivateLinkResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkResource.class); - - /* - * Properties of the private link resource. - */ - @JsonProperty(value = "properties") - private PrivateLinkResourceProperties innerProperties; - - /* - * Fully qualified identifier of the resource. - */ - @JsonProperty(value = "id") - private String id; - - /* - * Name of the resource - */ - @JsonProperty(value = "name") - private String name; - - /* - * Type of the resource - */ - @JsonProperty(value = "type") - private String type; - - /** - * Get the innerProperties property: Properties of the private link resource. - * - * @return the innerProperties value. - */ - private PrivateLinkResourceProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the id property: Fully qualified identifier of the resource. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: Fully qualified identifier of the resource. - * - * @param id the id value to set. - * @return the PrivateLinkResource object itself. - */ - public PrivateLinkResource withId(String id) { - this.id = id; - return this; - } - - /** - * Get the name property: Name of the resource. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Name of the resource. - * - * @param name the name value to set. - * @return the PrivateLinkResource object itself. - */ - public PrivateLinkResource withName(String name) { - this.name = name; - return this; - } - - /** - * Get the type property: Type of the resource. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Set the type property: Type of the resource. - * - * @param type the type value to set. - * @return the PrivateLinkResource object itself. - */ - public PrivateLinkResource withType(String type) { - this.type = type; - return this; - } - - /** - * Get the groupId property: The private link resource group id. - * - * @return the groupId value. - */ - public String groupId() { - return this.innerProperties() == null ? null : this.innerProperties().groupId(); - } - - /** - * Set the groupId property: The private link resource group id. - * - * @param groupId the groupId value to set. - * @return the PrivateLinkResource object itself. - */ - public PrivateLinkResource withGroupId(String groupId) { - if (this.innerProperties() == null) { - this.innerProperties = new PrivateLinkResourceProperties(); - } - this.innerProperties().withGroupId(groupId); - return this; - } - - /** - * Get the requiredMembers property: The private link resource required member names. - * - * @return the requiredMembers value. - */ - public List requiredMembers() { - return this.innerProperties() == null ? null : this.innerProperties().requiredMembers(); - } - - /** - * Set the requiredMembers property: The private link resource required member names. - * - * @param requiredMembers the requiredMembers value to set. - * @return the PrivateLinkResource object itself. - */ - public PrivateLinkResource withRequiredMembers(List requiredMembers) { - if (this.innerProperties() == null) { - this.innerProperties = new PrivateLinkResourceProperties(); - } - this.innerProperties().withRequiredMembers(requiredMembers); - return this; - } - - /** - * Get the requiredZoneNames property: The private link resource Private link DNS zone name. - * - * @return the requiredZoneNames value. - */ - public List requiredZoneNames() { - return this.innerProperties() == null ? null : this.innerProperties().requiredZoneNames(); - } - - /** - * Set the requiredZoneNames property: The private link resource Private link DNS zone name. - * - * @param requiredZoneNames the requiredZoneNames value to set. - * @return the PrivateLinkResource object itself. - */ - public PrivateLinkResource withRequiredZoneNames(List requiredZoneNames) { - if (this.innerProperties() == null) { - this.innerProperties = new PrivateLinkResourceProperties(); - } - this.innerProperties().withRequiredZoneNames(requiredZoneNames); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/ProvisioningStateDR.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/ProvisioningStateDR.java deleted file mode 100644 index 33954f68b020..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/ProvisioningStateDR.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for ProvisioningStateDR. */ -public enum ProvisioningStateDR { - /** Enum value Accepted. */ - ACCEPTED("Accepted"), - - /** Enum value Succeeded. */ - SUCCEEDED("Succeeded"), - - /** Enum value Failed. */ - FAILED("Failed"); - - /** The actual serialized value for a ProvisioningStateDR instance. */ - private final String value; - - ProvisioningStateDR(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a ProvisioningStateDR instance. - * - * @param value the serialized value to parse. - * @return the parsed ProvisioningStateDR object, or null if unable to parse. - */ - @JsonCreator - public static ProvisioningStateDR fromString(String value) { - ProvisioningStateDR[] items = ProvisioningStateDR.values(); - for (ProvisioningStateDR item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/RegenerateAccessKeyParameters.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/RegenerateAccessKeyParameters.java deleted file mode 100644 index 2e244ac5c2b7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/RegenerateAccessKeyParameters.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Parameters supplied to the Regenerate Authorization Rule operation, specifies which key needs to be reset. */ -@Fluent -public final class RegenerateAccessKeyParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RegenerateAccessKeyParameters.class); - - /* - * The access key to regenerate. - */ - @JsonProperty(value = "keyType", required = true) - private KeyType keyType; - - /* - * Optional, if the key value provided, is set for KeyType or autogenerated - * Key value set for keyType - */ - @JsonProperty(value = "key") - private String key; - - /** - * Get the keyType property: The access key to regenerate. - * - * @return the keyType value. - */ - public KeyType keyType() { - return this.keyType; - } - - /** - * Set the keyType property: The access key to regenerate. - * - * @param keyType the keyType value to set. - * @return the RegenerateAccessKeyParameters object itself. - */ - public RegenerateAccessKeyParameters withKeyType(KeyType keyType) { - this.keyType = keyType; - return this; - } - - /** - * Get the key property: Optional, if the key value provided, is set for KeyType or autogenerated Key value set for - * keyType. - * - * @return the key value. - */ - public String key() { - return this.key; - } - - /** - * Set the key property: Optional, if the key value provided, is set for KeyType or autogenerated Key value set for - * keyType. - * - * @param key the key value to set. - * @return the RegenerateAccessKeyParameters object itself. - */ - public RegenerateAccessKeyParameters withKey(String key) { - this.key = key; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (keyType() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property keyType in model RegenerateAccessKeyParameters")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/RoleDisasterRecovery.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/RoleDisasterRecovery.java deleted file mode 100644 index a647ac29502b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/RoleDisasterRecovery.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for RoleDisasterRecovery. */ -public enum RoleDisasterRecovery { - /** Enum value Primary. */ - PRIMARY("Primary"), - - /** Enum value PrimaryNotReplicating. */ - PRIMARY_NOT_REPLICATING("PrimaryNotReplicating"), - - /** Enum value Secondary. */ - SECONDARY("Secondary"); - - /** The actual serialized value for a RoleDisasterRecovery instance. */ - private final String value; - - RoleDisasterRecovery(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a RoleDisasterRecovery instance. - * - * @param value the serialized value to parse. - * @return the parsed RoleDisasterRecovery object, or null if unable to parse. - */ - @JsonCreator - public static RoleDisasterRecovery fromString(String value) { - RoleDisasterRecovery[] items = RoleDisasterRecovery.values(); - for (RoleDisasterRecovery item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/Sku.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/Sku.java deleted file mode 100644 index 3ef096f5a985..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/Sku.java +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** SKU parameters supplied to the create namespace operation. */ -@Fluent -public final class Sku { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Sku.class); - - /* - * Name of this SKU. - */ - @JsonProperty(value = "name", required = true) - private SkuName name; - - /* - * The billing tier of this particular SKU. - */ - @JsonProperty(value = "tier") - private SkuTier tier; - - /* - * The Event Hubs throughput units, value should be 0 to 20 throughput - * units. - */ - @JsonProperty(value = "capacity") - private Integer capacity; - - /** - * Get the name property: Name of this SKU. - * - * @return the name value. - */ - public SkuName name() { - return this.name; - } - - /** - * Set the name property: Name of this SKU. - * - * @param name the name value to set. - * @return the Sku object itself. - */ - public Sku withName(SkuName name) { - this.name = name; - return this; - } - - /** - * Get the tier property: The billing tier of this particular SKU. - * - * @return the tier value. - */ - public SkuTier tier() { - return this.tier; - } - - /** - * Set the tier property: The billing tier of this particular SKU. - * - * @param tier the tier value to set. - * @return the Sku object itself. - */ - public Sku withTier(SkuTier tier) { - this.tier = tier; - return this; - } - - /** - * Get the capacity property: The Event Hubs throughput units, value should be 0 to 20 throughput units. - * - * @return the capacity value. - */ - public Integer capacity() { - return this.capacity; - } - - /** - * Set the capacity property: The Event Hubs throughput units, value should be 0 to 20 throughput units. - * - * @param capacity the capacity value to set. - * @return the Sku object itself. - */ - public Sku withCapacity(Integer capacity) { - this.capacity = capacity; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() == null) { - throw logger - .logExceptionAsError(new IllegalArgumentException("Missing required property name in model Sku")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/SkuName.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/SkuName.java deleted file mode 100644 index 9f6fad6a2495..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/SkuName.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for SkuName. */ -public final class SkuName extends ExpandableStringEnum { - /** Static value Basic for SkuName. */ - public static final SkuName BASIC = fromString("Basic"); - - /** Static value Standard for SkuName. */ - public static final SkuName STANDARD = fromString("Standard"); - - /** - * Creates or finds a SkuName from its string representation. - * - * @param name a name to look for. - * @return the corresponding SkuName. - */ - @JsonCreator - public static SkuName fromString(String name) { - return fromString(name, SkuName.class); - } - - /** @return known SkuName values. */ - public static Collection values() { - return values(SkuName.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/SkuTier.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/SkuTier.java deleted file mode 100644 index f522977f21d2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/SkuTier.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for SkuTier. */ -public final class SkuTier extends ExpandableStringEnum { - /** Static value Basic for SkuTier. */ - public static final SkuTier BASIC = fromString("Basic"); - - /** Static value Standard for SkuTier. */ - public static final SkuTier STANDARD = fromString("Standard"); - - /** - * Creates or finds a SkuTier from its string representation. - * - * @param name a name to look for. - * @return the corresponding SkuTier. - */ - @JsonCreator - public static SkuTier fromString(String name) { - return fromString(name, SkuTier.class); - } - - /** @return known SkuTier values. */ - public static Collection values() { - return values(SkuTier.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/Subnet.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/Subnet.java deleted file mode 100644 index 112a41e9bfa1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/Subnet.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Properties supplied for Subnet. */ -@Fluent -public final class Subnet { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Subnet.class); - - /* - * Resource ID of Virtual Network Subnet - */ - @JsonProperty(value = "id", required = true) - private String id; - - /** - * Get the id property: Resource ID of Virtual Network Subnet. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: Resource ID of Virtual Network Subnet. - * - * @param id the id value to set. - * @return the Subnet object itself. - */ - public Subnet withId(String id) { - this.id = id; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (id() == null) { - throw logger - .logExceptionAsError(new IllegalArgumentException("Missing required property id in model Subnet")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/UnavailableReason.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/UnavailableReason.java deleted file mode 100644 index 6310e714e6e4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/UnavailableReason.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventhubs.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for UnavailableReason. */ -public enum UnavailableReason { - /** Enum value None. */ - NONE("None"), - - /** Enum value InvalidName. */ - INVALID_NAME("InvalidName"), - - /** Enum value SubscriptionIsDisabled. */ - SUBSCRIPTION_IS_DISABLED("SubscriptionIsDisabled"), - - /** Enum value NameInUse. */ - NAME_IN_USE("NameInUse"), - - /** Enum value NameInLockdown. */ - NAME_IN_LOCKDOWN("NameInLockdown"), - - /** Enum value TooManyNamespaceInCurrentSubscription. */ - TOO_MANY_NAMESPACE_IN_CURRENT_SUBSCRIPTION("TooManyNamespaceInCurrentSubscription"); - - /** The actual serialized value for a UnavailableReason instance. */ - private final String value; - - UnavailableReason(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a UnavailableReason instance. - * - * @param value the serialized value to parse. - * @return the parsed UnavailableReason object, or null if unable to parse. - */ - @JsonCreator - public static UnavailableReason fromString(String value) { - UnavailableReason[] items = UnavailableReason.values(); - for (UnavailableReason item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/package-info.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/package-info.java deleted file mode 100644 index 9248cfd56afa..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/models/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** - * Package containing the data models for EventHubManagementClient. Azure Event Hubs client for managing Event Hubs - * Cluster, IPFilter Rules and VirtualNetworkRules resources. - */ -package com.azure.resourcemanager.eventhubs.models; diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/package-info.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/package-info.java deleted file mode 100644 index 830875c40fd7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** - * Package containing the classes for EventHubManagementClient. Azure Event Hubs client for managing Event Hubs Cluster, - * IPFilter Rules and VirtualNetworkRules resources. - */ -package com.azure.resourcemanager.eventhubs; diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/module-info.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/module-info.java deleted file mode 100644 index b6474f04767f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/main/java/module-info.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -module com.azure.resourcemanager.eventhubs { - requires transitive com.azure.resourcemanager.resources; - requires com.azure.resourcemanager.storage; - - // export public APIs of eventhubs - exports com.azure.resourcemanager.eventhubs; - exports com.azure.resourcemanager.eventhubs.fluent; - exports com.azure.resourcemanager.eventhubs.fluent.models; - exports com.azure.resourcemanager.eventhubs.models; - - // open packages specifically for azure core and jackson - opens com.azure.resourcemanager.eventhubs.fluent.models to - com.azure.core, - com.fasterxml.jackson.databind; - opens com.azure.resourcemanager.eventhubs.models to - com.azure.core, - com.fasterxml.jackson.databind; -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/samples/java/com/azure/resourcemanager/eventhubs/ReadmeSamples.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/samples/java/com/azure/resourcemanager/eventhubs/ReadmeSamples.java deleted file mode 100644 index 5f291250c4ff..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/samples/java/com/azure/resourcemanager/eventhubs/ReadmeSamples.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.eventhubs; - -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpMethod; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.util.serializer.JacksonAdapter; -import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.identity.DefaultAzureCredentialBuilder; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.ArrayNode; - -import java.io.IOException; -import java.util.HashMap; - -public class ReadmeSamples { - - public void authenticate() { - // BEGIN: com.azure.resourcemanager.eventhubs.authenticate - String armEndpoint = "https://management.."; - AzureProfile profile = new AzureProfile(getAzureEnvironmentFromArmEndpoint(armEndpoint)); - TokenCredential credential = new DefaultAzureCredentialBuilder() - .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) - .build(); - EventHubsManager manager = EventHubsManager - .authenticate(credential, profile); - // END: com.azure.resourcemanager.eventhubs.authenticate - } - - // BEGIN: com.azure.resourcemanager.eventhubs.getazureenvironment - private static AzureEnvironment getAzureEnvironmentFromArmEndpoint(String armEndpoint) { - // Create HTTP client and request - HttpClient httpClient = HttpClient.createDefault(); - - HttpRequest request = new HttpRequest(HttpMethod.GET, - String.format("%s/metadata/endpoints?api-version=2019-10-01", armEndpoint)) - .setHeader("accept", "application/json"); - - // Execute the request and read the response - HttpResponse response = httpClient.send(request).block(); - if (response.getStatusCode() != 200) { - throw new RuntimeException("Failed : HTTP error code : " + response.getStatusCode()); - } - String body = response.getBodyAsString().block(); - try { - ArrayNode metadataArray = JacksonAdapter.createDefaultSerializerAdapter() - .deserialize(body, ArrayNode.class, SerializerEncoding.JSON); - - if (metadataArray == null || metadataArray.isEmpty()) { - throw new RuntimeException("Failed to find metadata : " + body); - } - - JsonNode metadata = metadataArray.iterator().next(); - AzureEnvironment azureEnvironment = new AzureEnvironment(new HashMap() { - { - put("managementEndpointUrl", metadata.at("/authentication/audiences/0").asText()); - put("resourceManagerEndpointUrl", armEndpoint); - put("galleryEndpointUrl", metadata.at("/gallery").asText()); - put("activeDirectoryEndpointUrl", metadata.at("/authentication/loginEndpoint").asText()); - put("activeDirectoryResourceId", metadata.at("/authentication/audiences/0").asText()); - put("activeDirectoryGraphResourceId", metadata.at("/graph").asText()); - put("storageEndpointSuffix", "." + metadata.at("/suffixes/storage").asText()); - put("keyVaultDnsSuffix", "." + metadata.at("/suffixes/keyVaultDns").asText()); - } - }); - return azureEnvironment; - } catch (IOException ioe) { - ioe.printStackTrace(); - throw new RuntimeException(ioe); - } - } - // END: com.azure.resourcemanager.eventhubs.getazureenvironment -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/test/java/com/azure/resourcemanager/eventhubs/EventHubTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/test/java/com/azure/resourcemanager/eventhubs/EventHubTests.java deleted file mode 100644 index d805000ab8e4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/test/java/com/azure/resourcemanager/eventhubs/EventHubTests.java +++ /dev/null @@ -1,604 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.eventhubs; - -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.policy.HttpLogOptions; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.eventhubs.models.AccessRights; -import com.azure.resourcemanager.eventhubs.models.DisasterRecoveryPairingAuthorizationKey; -import com.azure.resourcemanager.eventhubs.models.DisasterRecoveryPairingAuthorizationRule; -import com.azure.resourcemanager.eventhubs.models.EventHub; -import com.azure.resourcemanager.eventhubs.models.EventHubAuthorizationRule; -import com.azure.resourcemanager.eventhubs.models.EventHubConsumerGroup; -import com.azure.resourcemanager.eventhubs.models.EventHubDisasterRecoveryPairing; -import com.azure.resourcemanager.eventhubs.models.EventHubDisasterRecoveryPairings; -import com.azure.resourcemanager.eventhubs.models.EventHubNamespace; -import com.azure.resourcemanager.eventhubs.models.EventHubNamespaceAuthorizationRule; -import com.azure.resourcemanager.eventhubs.models.EventHubNamespaceSkuType; -import com.azure.resourcemanager.eventhubs.models.ProvisioningStateDR; -import com.azure.resourcemanager.resources.ResourceManager; -import com.azure.resourcemanager.test.utils.TestUtilities; -import com.azure.core.management.Region; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.resources.fluentcore.utils.HttpPipelineProvider; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import com.azure.resourcemanager.storage.StorageManager; -import com.azure.resourcemanager.storage.models.StorageAccount; -import com.azure.resourcemanager.storage.models.StorageAccountSkuType; -import com.azure.resourcemanager.test.ResourceManagerTestBase; -import com.azure.resourcemanager.test.utils.TestDelayProvider; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.Exceptions; - -import java.time.Duration; -import java.time.temporal.ChronoUnit; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; - -public class EventHubTests extends ResourceManagerTestBase { - protected EventHubsManager eventHubsManager; - protected StorageManager storageManager; - protected ResourceManager resourceManager; - private String rgName = ""; - private final Region region = locationOrDefault(Region.US_EAST); - - @Override - protected HttpPipeline buildHttpPipeline( - TokenCredential credential, - AzureProfile profile, - HttpLogOptions httpLogOptions, - List policies, - HttpClient httpClient) { - return HttpPipelineProvider.buildHttpPipeline( - credential, - profile, - null, - httpLogOptions, - null, - new RetryPolicy("Retry-After", ChronoUnit.SECONDS), - policies, - httpClient); - } - - @Override - protected void initializeClients(HttpPipeline httpPipeline, AzureProfile profile) { - ResourceManagerUtils.InternalRuntimeContext.setDelayProvider(new TestDelayProvider(!isPlaybackMode())); - eventHubsManager = buildManager(EventHubsManager.class, httpPipeline, profile); - storageManager = buildManager(StorageManager.class, httpPipeline, profile); - resourceManager = eventHubsManager.resourceManager(); - } - - @Override - protected void cleanUpResources() { - if (rgName != null && !rgName.isEmpty()) { - resourceManager.resourceGroups().deleteByName(rgName); - } - } - - @Test - public void canManageEventHubNamespaceBasicSettings() { - rgName = generateRandomResourceName("javacsmrg", 15); - final String namespaceName1 = generateRandomResourceName("ns", 14); - final String namespaceName2 = generateRandomResourceName("ns", 14); - final String namespaceName3 = generateRandomResourceName("ns", 14); - - EventHubNamespace namespace1 = eventHubsManager.namespaces() - .define(namespaceName1) - .withRegion(region) - .withNewResourceGroup(rgName) - // SDK should use Sku as 'Standard' and set capacity.capacity in it as 1 - .withAutoScaling() - .create(); - - Assertions.assertNotNull(namespace1); - Assertions.assertNotNull(namespace1.innerModel()); - Assertions.assertNotNull(namespace1.sku()); - Assertions.assertTrue(namespace1.sku().equals(EventHubNamespaceSkuType.STANDARD)); - Assertions.assertTrue(namespace1.isAutoScaleEnabled()); - Assertions.assertNotNull(namespace1.innerModel().maximumThroughputUnits()); - Assertions.assertNotNull(namespace1.innerModel().sku().capacity()); - - EventHubNamespace namespace2 = eventHubsManager.namespaces() - .define(namespaceName2) - .withRegion(region) - .withExistingResourceGroup(rgName) - // SDK should use Sku as 'Standard' and set capacity.capacity in it as 11 - .withCurrentThroughputUnits(11) - .create(); - - Assertions.assertNotNull(namespace2); - Assertions.assertNotNull(namespace2.innerModel()); - Assertions.assertNotNull(namespace2.sku()); - Assertions.assertTrue(namespace2.sku().equals(EventHubNamespaceSkuType.STANDARD)); - Assertions.assertNotNull(namespace2.innerModel().maximumThroughputUnits()); - Assertions.assertNotNull(namespace2.innerModel().sku().capacity()); - Assertions.assertEquals(11, namespace2.currentThroughputUnits()); - - EventHubNamespace namespace3 = eventHubsManager.namespaces() - .define(namespaceName3) - .withRegion(region) - .withExistingResourceGroup(rgName) - .withSku(EventHubNamespaceSkuType.BASIC) - .create(); - - Assertions.assertNotNull(namespace3); - Assertions.assertNotNull(namespace3.innerModel()); - Assertions.assertNotNull(namespace3.sku()); - Assertions.assertTrue(namespace3.sku().equals(EventHubNamespaceSkuType.BASIC)); - - namespace3.update() - .withSku(EventHubNamespaceSkuType.STANDARD) - .withTag("aa", "bb") - .apply(); - - Assertions.assertNotNull(namespace3.sku()); - Assertions.assertTrue(namespace3.sku().equals(EventHubNamespaceSkuType.STANDARD)); - Assertions.assertNotNull(namespace3.tags()); - Assertions.assertTrue(namespace3.tags().size() > 0); - } - - @Test - public void canManageEventHubNamespaceEventHubs() { - rgName = generateRandomResourceName("javacsmrg", 15); - final String namespaceName = generateRandomResourceName("ns", 14); - final String eventHubName1 = generateRandomResourceName("eh", 14); - final String eventHubName2 = generateRandomResourceName("eh", 14); - final String eventHubName3 = generateRandomResourceName("eh", 14); - - EventHubNamespace namespace = eventHubsManager.namespaces() - .define(namespaceName) - .withRegion(region) - .withNewResourceGroup(rgName) - .withNewEventHub(eventHubName1) - .withNewEventHub(eventHubName2) - .create(); - - Assertions.assertNotNull(namespace); - Assertions.assertNotNull(namespace.innerModel()); - - PagedIterable hubs = namespace.listEventHubs(); - HashSet set = new HashSet<>(); - for (EventHub hub : hubs) { - set.add(hub.name()); - } - Assertions.assertTrue(set.contains(eventHubName1)); - Assertions.assertTrue(set.contains(eventHubName2)); - - hubs = eventHubsManager.namespaces() - .eventHubs() - .listByNamespace(namespace.resourceGroupName(), namespace.name()); - - set.clear(); - for (EventHub hub : hubs) { - set.add(hub.name()); - } - Assertions.assertTrue(set.contains(eventHubName1)); - Assertions.assertTrue(set.contains(eventHubName2)); - - eventHubsManager.namespaces() - .eventHubs() - .define(eventHubName3) - .withExistingNamespaceId(namespace.id()) - .withPartitionCount(5) - .withRetentionPeriodInDays(6) - .create(); - - hubs = namespace.listEventHubs(); - set.clear(); - for (EventHub hub : hubs) { - set.add(hub.name()); - } - Assertions.assertTrue(set.contains(eventHubName1)); - Assertions.assertTrue(set.contains(eventHubName2)); - Assertions.assertTrue(set.contains(eventHubName3)); - } - - @Test - public void canManageEventHubNamespaceAuthorizationRules() { - rgName = generateRandomResourceName("javacsmrg", 15); - final String namespaceName = generateRandomResourceName("ns", 14); - - EventHubNamespace namespace = eventHubsManager.namespaces() - .define(namespaceName) - .withRegion(region) - .withNewResourceGroup(rgName) - .withNewManageRule("mngRule1") - .withNewSendRule("sndRule1") - .create(); - - Assertions.assertNotNull(namespace); - Assertions.assertNotNull(namespace.innerModel()); - - PagedIterable rules = namespace.listAuthorizationRules(); - HashSet set = new HashSet<>(); - for (EventHubNamespaceAuthorizationRule rule : rules) { - set.add(rule.name()); - } - Assertions.assertTrue(set.contains("mngRule1")); - Assertions.assertTrue(set.contains("sndRule1")); - - rules = eventHubsManager.namespaces() - .authorizationRules() - .listByNamespace(namespace.resourceGroupName(), namespace.name()); - - set.clear(); - for (EventHubNamespaceAuthorizationRule rule : rules) { - set.add(rule.name()); - } - Assertions.assertTrue(set.contains("mngRule1")); - Assertions.assertTrue(set.contains("sndRule1")); - - eventHubsManager.namespaces() - .authorizationRules() - .define("sndRule2") - .withExistingNamespaceId(namespace.id()) - .withSendAccess() - .create(); - - rules = namespace.listAuthorizationRules(); - set.clear(); - for (EventHubNamespaceAuthorizationRule rule : rules) { - set.add(rule.name()); - } - Assertions.assertTrue(set.contains("mngRule1")); - Assertions.assertTrue(set.contains("sndRule1")); - Assertions.assertTrue(set.contains("sndRule2")); - - eventHubsManager.namespaces() - .authorizationRules() - .define("sndLsnRule3") - .withExistingNamespaceId(namespace.id()) - .withSendAndListenAccess() - .create(); - - rules = namespace.listAuthorizationRules(); - Map rulesMap = new HashMap<>(); - for (EventHubNamespaceAuthorizationRule rule : rules) { - rulesMap.put(rule.name(), rule); - } - Assertions.assertTrue(rulesMap.containsKey("sndLsnRule3")); - Assertions.assertEquals( - new HashSet<>(Arrays.asList(AccessRights.SEND, AccessRights.LISTEN)), - new HashSet<>(rulesMap.get("sndLsnRule3").rights())); - } - - @Test - public void canManageEventHubConsumerGroups() { - rgName = generateRandomResourceName("javacsmrg", 15); - final String namespaceName = generateRandomResourceName("ns", 14); - final String eventHubName = generateRandomResourceName("eh", 14); - - Creatable namespaceCreatable = eventHubsManager.namespaces() - .define(namespaceName) - .withRegion(region) - .withNewResourceGroup(rgName); - - EventHub eventHub = eventHubsManager.eventHubs() - .define(eventHubName) - .withNewNamespace(namespaceCreatable) - .withNewConsumerGroup("grp1") - .withNewConsumerGroup("grp2", "metadata111") - .create(); - - Assertions.assertNotNull(eventHub); - Assertions.assertNotNull(eventHub.innerModel()); - - PagedIterable cGroups = eventHub.listConsumerGroups(); - HashSet set = new HashSet<>(); - for (EventHubConsumerGroup grp : cGroups) { - set.add(grp.name()); - } - Assertions.assertTrue(set.contains("grp1")); - Assertions.assertTrue(set.contains("grp2")); - - cGroups = eventHubsManager.eventHubs() - .consumerGroups() - .listByEventHub(eventHub.namespaceResourceGroupName(), eventHub.namespaceName(), eventHub.name()); - - set.clear(); - for (EventHubConsumerGroup rule : cGroups) { - set.add(rule.name()); - } - Assertions.assertTrue(set.contains("grp1")); - Assertions.assertTrue(set.contains("grp2")); - - eventHubsManager.eventHubs() - .consumerGroups() - .define("grp3") - .withExistingEventHubId(eventHub.id()) - .withUserMetadata("metadata222") - .create(); - - cGroups = eventHub.listConsumerGroups(); - set.clear(); - for (EventHubConsumerGroup grp : cGroups) { - set.add(grp.name()); - } - Assertions.assertTrue(set.contains("grp1")); - Assertions.assertTrue(set.contains("grp2")); - Assertions.assertTrue(set.contains("grp3")); - } - - @Test - public void canManageEventHubAuthorizationRules() { - rgName = generateRandomResourceName("javacsmrg", 15); - final String namespaceName = generateRandomResourceName("ns", 14); - final String eventHubName = generateRandomResourceName("eh", 14); - - Creatable namespaceCreatable = eventHubsManager.namespaces() - .define(namespaceName) - .withRegion(region) - .withNewResourceGroup(rgName); - - EventHub eventHub = eventHubsManager.eventHubs() - .define(eventHubName) - .withNewNamespace(namespaceCreatable) - .withNewManageRule("mngRule1") - .withNewSendRule("sndRule1") - .create(); - - Assertions.assertNotNull(eventHub); - Assertions.assertNotNull(eventHub.innerModel()); - - PagedIterable rules = eventHub.listAuthorizationRules(); - HashSet set = new HashSet<>(); - for (EventHubAuthorizationRule rule : rules) { - set.add(rule.name()); - } - Assertions.assertTrue(set.contains("mngRule1")); - Assertions.assertTrue(set.contains("sndRule1")); - - rules = eventHubsManager.eventHubs() - .authorizationRules() - .listByEventHub(eventHub.namespaceResourceGroupName(), eventHub.namespaceName(), eventHub.name()); - - set.clear(); - for (EventHubAuthorizationRule rule : rules) { - set.add(rule.name()); - } - Assertions.assertTrue(set.contains("mngRule1")); - Assertions.assertTrue(set.contains("sndRule1")); - - eventHubsManager.eventHubs() - .authorizationRules() - .define("sndRule2") - .withExistingEventHubId(eventHub.id()) - .withSendAccess() - .create(); - - rules = eventHub.listAuthorizationRules(); - set.clear(); - for (EventHubAuthorizationRule rule : rules) { - set.add(rule.name()); - } - Assertions.assertTrue(set.contains("mngRule1")); - Assertions.assertTrue(set.contains("sndRule1")); - Assertions.assertTrue(set.contains("sndRule2")); - } - - @Test - public void canConfigureEventHubDataCapturing() { - rgName = generateRandomResourceName("javacsmrg", 15); - final String stgName = generateRandomResourceName("stg", 14); - final String namespaceName = generateRandomResourceName("ns", 14); - final String eventHubName1 = generateRandomResourceName("eh", 14); - final String eventHubName2 = generateRandomResourceName("eh", 14); - - Creatable storageAccountCreatable = storageManager.storageAccounts() - .define(stgName) - .withRegion(region) - .withNewResourceGroup(rgName) - .withSku(StorageAccountSkuType.STANDARD_LRS); - - Creatable namespaceCreatable = eventHubsManager.namespaces() - .define(namespaceName) - .withRegion(region) - .withNewResourceGroup(rgName); - - final String containerName1 = "eventsctr1"; - - EventHub eventHub1 = eventHubsManager.eventHubs() - .define(eventHubName1) - .withNewNamespace(namespaceCreatable) - .withNewStorageAccountForCapturedData(storageAccountCreatable, containerName1) - .withDataCaptureEnabled() - // Window config is optional if not set service will choose default for it2 - // - .withDataCaptureWindowSizeInSeconds(120) - .withDataCaptureWindowSizeInMB(300) - .withDataCaptureSkipEmptyArchives(true) - .create(); - - Assertions.assertNotNull(eventHub1); - Assertions.assertNotNull(eventHub1.innerModel()); - - Assertions.assertNotNull(eventHub1.name()); - Assertions.assertTrue(eventHub1.name().equalsIgnoreCase(eventHubName1)); - - Assertions.assertNotNull(eventHub1.partitionIds()); - - Assertions.assertTrue(eventHub1.isDataCaptureEnabled()); - Assertions.assertNotNull(eventHub1.captureDestination()); - Assertions.assertTrue(eventHub1.captureDestination().storageAccountResourceId().contains("/storageAccounts/")); - Assertions.assertTrue(eventHub1.captureDestination().storageAccountResourceId().contains(stgName)); - Assertions.assertTrue(eventHub1.captureDestination().blobContainer().equalsIgnoreCase(containerName1)); - Assertions.assertTrue(eventHub1.dataCaptureSkipEmptyArchives()); - - // Create another event Hub in the same namespace with data capture uses the same storage account - // - String stgAccountId = eventHub1.captureDestination().storageAccountResourceId(); - final String containerName2 = "eventsctr2"; - - EventHub eventHub2 = eventHubsManager.eventHubs() - .define(eventHubName2) - .withNewNamespace(namespaceCreatable) - .withExistingStorageAccountForCapturedData(stgAccountId, containerName2) - .withDataCaptureEnabled() - .create(); - - Assertions.assertTrue(eventHub2.isDataCaptureEnabled()); - Assertions.assertNotNull(eventHub2.captureDestination()); - Assertions.assertTrue(eventHub2.captureDestination().storageAccountResourceId().contains("/storageAccounts/")); - Assertions.assertTrue(eventHub2.captureDestination().storageAccountResourceId().contains(stgName)); - Assertions.assertTrue(eventHub2.captureDestination().blobContainer().equalsIgnoreCase(containerName2)); - - eventHub2.update() - .withDataCaptureDisabled() - .apply(); - - Assertions.assertFalse(eventHub2.isDataCaptureEnabled()); - } - - @Test - public void canEnableEventHubDataCaptureOnUpdate() { - rgName = generateRandomResourceName("javacsmrg", 15); - final String stgName = generateRandomResourceName("stg", 14); - final String namespaceName = generateRandomResourceName("ns", 14); - final String eventHubName = generateRandomResourceName("eh", 14); - - Creatable namespaceCreatable = eventHubsManager.namespaces() - .define(namespaceName) - .withRegion(region) - .withNewResourceGroup(rgName); - - EventHub eventHub = eventHubsManager.eventHubs() - .define(eventHubName) - .withNewNamespace(namespaceCreatable) - .create(); - - boolean exceptionThrown = false; - try { - eventHub.update() - .withDataCaptureEnabled() - .apply(); - } catch (IllegalStateException ex) { - exceptionThrown = true; - } - Assertions.assertTrue(exceptionThrown, "Expected IllegalStateException is not thrown"); - - eventHub = eventHub.refresh(); - - Creatable storageAccountCreatable = storageManager.storageAccounts() - .define(stgName) - .withRegion(region) - .withNewResourceGroup(rgName) - .withSku(StorageAccountSkuType.STANDARD_LRS); - - eventHub.update() - .withDataCaptureEnabled() - .withNewStorageAccountForCapturedData(storageAccountCreatable, "eventctr") - .apply(); - - Assertions.assertTrue(eventHub.isDataCaptureEnabled()); - Assertions.assertNotNull(eventHub.captureDestination()); - Assertions.assertTrue(eventHub.captureDestination().storageAccountResourceId().contains("/storageAccounts/")); - Assertions.assertTrue(eventHub.captureDestination().storageAccountResourceId().contains(stgName)); - Assertions.assertTrue(eventHub.captureDestination().blobContainer().equalsIgnoreCase("eventctr")); - } - - @Test - public void canManageGeoDisasterRecoveryPairing() throws Throwable { - rgName = generateRandomResourceName("javacsmrg", 15); - final String geodrName = generateRandomResourceName("geodr", 14); - final String namespaceName1 = generateRandomResourceName("ns", 14); - final String namespaceName2 = generateRandomResourceName("ns", 14); - - EventHubNamespace primaryNamespace = eventHubsManager.namespaces() - .define(namespaceName1) - .withRegion(locationOrDefault(Region.US_SOUTH_CENTRAL)) - .withNewResourceGroup(rgName) - .create(); - - EventHubNamespace secondaryNamespace = eventHubsManager.namespaces() - .define(namespaceName2) - .withRegion(locationOrDefault(Region.US_NORTH_CENTRAL)) - .withExistingResourceGroup(rgName) - .create(); - - Exception exception = null; - Exception breakingFailed = null; - EventHubDisasterRecoveryPairing pairing = null; - try { - pairing = eventHubsManager.eventHubDisasterRecoveryPairings() - .define(geodrName) - .withExistingPrimaryNamespace(primaryNamespace) - .withExistingSecondaryNamespace(secondaryNamespace) - .create(); - - while (pairing.provisioningState() != ProvisioningStateDR.SUCCEEDED) { - pairing = pairing.refresh(); - ResourceManagerUtils.sleep(Duration.ofSeconds(15)); - if (pairing.provisioningState() == ProvisioningStateDR.FAILED) { - Assertions.assertTrue(false, "Provisioning state of the pairing is FAILED"); - } - } - - - Assertions.assertTrue(pairing.name().equalsIgnoreCase(geodrName)); - Assertions.assertTrue(pairing.primaryNamespaceResourceGroupName().equalsIgnoreCase(rgName)); - Assertions.assertTrue(pairing.primaryNamespaceName().equalsIgnoreCase(primaryNamespace.name())); - Assertions.assertTrue(pairing.secondaryNamespaceId().equalsIgnoreCase(secondaryNamespace.id())); - - PagedIterable rules = pairing.listAuthorizationRules(); - Assertions.assertTrue(TestUtilities.getSize(rules) > 0); - for (DisasterRecoveryPairingAuthorizationRule rule : rules) { - DisasterRecoveryPairingAuthorizationKey keys = rule.getKeys(); - Assertions.assertNotNull(keys.aliasPrimaryConnectionString()); - Assertions.assertNotNull(keys.aliasPrimaryConnectionString()); - Assertions.assertNotNull(keys.primaryKey()); - Assertions.assertNotNull(keys.secondaryKey()); - } - - EventHubDisasterRecoveryPairings pairingsCol = eventHubsManager.eventHubDisasterRecoveryPairings(); - PagedIterable pairings = pairingsCol - .listByNamespace(primaryNamespace.resourceGroupName(), primaryNamespace.name()); - - Assertions.assertTrue(TestUtilities.getSize(pairings) > 0); - - boolean found = false; - for (EventHubDisasterRecoveryPairing pairing1 : pairings) { - if (pairing1.name().equalsIgnoreCase(pairing.name())) { - found = true; - Assertions.assertTrue(pairing1.primaryNamespaceResourceGroupName().equalsIgnoreCase(rgName)); - Assertions.assertTrue(pairing1.primaryNamespaceName().equalsIgnoreCase(primaryNamespace.name())); - Assertions.assertTrue(pairing1.secondaryNamespaceId().equalsIgnoreCase(secondaryNamespace.id())); - } - } - Assertions.assertTrue(found); - } catch (Exception ex) { - exception = ex; - } finally { - if (exception != null && pairing != null) { - // Resource group cannot be deleted if the pairing-replication is progress so - // pairing must forcefully break. - try { - pairing.breakPairing(); - } catch (Exception ex) { - breakingFailed = ex; - } - } - } - if (exception != null && breakingFailed != null) { - throw Exceptions.addSuppressed(exception, breakingFailed); - } - if (exception != null) { - throw exception; - } - if (breakingFailed != null) { - throw breakingFailed; - } - pairing.refresh(); - pairing.failOver(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/test/resources/junit-platform.properties b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/test/resources/junit-platform.properties deleted file mode 100644 index 202d099b3ee8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/src/test/resources/junit-platform.properties +++ /dev/null @@ -1,4 +0,0 @@ -junit.jupiter.execution.parallel.enabled=true -junit.jupiter.execution.parallel.mode.default=concurrent -junit.jupiter.execution.parallel.config.strategy=fixed -junit.jupiter.execution.parallel.config.fixed.parallelism=32 diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/CHANGELOG.md b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/CHANGELOG.md deleted file mode 100644 index b2836631240f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/CHANGELOG.md +++ /dev/null @@ -1,8 +0,0 @@ -# Release History - -## 1.0.0-hybrid (2022-01-12) - -- Azure Resource Manager keyvault client library for Java (Hybrid) using API Profiles to allow building hybrid cloud solutions -that target both Azure and Azure Stack Hub. -- Supports api versions in the 2020-09-01-hybrid api profile -- Requires Azure Stack Update 2102+ diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/README.md b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/README.md deleted file mode 100644 index 5f106e866603..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/README.md +++ /dev/null @@ -1,135 +0,0 @@ -# Azure Resource Manager keyvault client library for Java (Hybrid) - -Azure Resource Manager keyvault client library for Java (Hybrid) using [API Profiles][api_profile] to allow building hybrid cloud solutions -that target both Azure and Azure Stack Hub. - -For documentation on how to use this package, please see [Azure Management Libraries for Java (Hybrid)][resourcemanagerhybrid_lib]. - -## Getting started - -### Prerequisites - -- [Java Development Kit (JDK)][jdk] with version 8 or above -- [Azure Subscription][azure_subscription] - -### Adding the package to your product - -```xml - - com.azure.resourcemanager - azure-resourcemanager-keyvault - 1.0.0-hybrid - -``` - -### Include the recommended packages - -Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. - -[Azure Identity][azure_identity] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation. - -### Authentication - -By default, Azure Active Directory token authentication depends on correct configure of following environment variables. - -- `AZURE_CLIENT_ID` for Azure client ID. -- `AZURE_TENANT_ID` for Azure tenant ID. -- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. - -In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`. - -With above configuration, `azure` client can be authenticated by following code: - -```java com.azure.resourcemanager.keyvault.authenticate -String armEndpoint = "https://management.."; -AzureProfile profile = new AzureProfile(getAzureEnvironmentFromArmEndpoint(armEndpoint)); -TokenCredential credential = new DefaultAzureCredentialBuilder() - .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) - .build(); -KeyVaultManager manager = KeyVaultManager - .authenticate(credential, profile); -``` - -Change `armEndpoint` to point to the Azure Resource Manager endpoint of your Azure Stack Hub. The azure environment's -properties above can be populated with the following example: - -```java com.azure.resourcemanager.keyvault.getazureenvironment -private static AzureEnvironment getAzureEnvironmentFromArmEndpoint(String armEndpoint) { - // Create HTTP client and request - HttpClient httpClient = HttpClient.createDefault(); - - HttpRequest request = new HttpRequest(HttpMethod.GET, - String.format("%s/metadata/endpoints?api-version=2019-10-01", armEndpoint)) - .setHeader("accept", "application/json"); - - // Execute the request and read the response - HttpResponse response = httpClient.send(request).block(); - if (response.getStatusCode() != 200) { - throw new RuntimeException("Failed : HTTP error code : " + response.getStatusCode()); - } - String body = response.getBodyAsString().block(); - try { - ArrayNode metadataArray = JacksonAdapter.createDefaultSerializerAdapter() - .deserialize(body, ArrayNode.class, SerializerEncoding.JSON); - - if (metadataArray == null || metadataArray.isEmpty()) { - throw new RuntimeException("Failed to find metadata : " + body); - } - - JsonNode metadata = metadataArray.iterator().next(); - AzureEnvironment azureEnvironment = new AzureEnvironment(new HashMap() { - { - put("managementEndpointUrl", metadata.at("/authentication/audiences/0").asText()); - put("resourceManagerEndpointUrl", armEndpoint); - put("galleryEndpointUrl", metadata.at("/gallery").asText()); - put("activeDirectoryEndpointUrl", metadata.at("/authentication/loginEndpoint").asText()); - put("activeDirectoryResourceId", metadata.at("/authentication/audiences/0").asText()); - put("activeDirectoryGraphResourceId", metadata.at("/graph").asText()); - put("storageEndpointSuffix", "." + metadata.at("/suffixes/storage").asText()); - put("keyVaultDnsSuffix", "." + metadata.at("/suffixes/keyVaultDns").asText()); - } - }); - return azureEnvironment; - } catch (IOException ioe) { - ioe.printStackTrace(); - throw new RuntimeException(ioe); - } -} -``` - -When targeting a hybrid solution to global Azure instead of your Azure Stack Hub, `AzureEnvironment.AZURE` can be used instead. - -See [Authentication][authenticate] for more options. - -## Key concepts - -See [API design][design] for general introduction on design and key concepts on Azure Management Libraries. - -## Examples - -See [Samples][sample] for code snippets and samples. - -## Troubleshooting - -## Next steps - -## Contributing - -For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). - -1. Fork it -1. Create your feature branch (`git checkout -b my-new-feature`) -1. Commit your changes (`git commit -am 'Add some feature'`) -1. Push to the branch (`git push origin my-new-feature`) -1. Create new Pull Request - - -[jdk]: https://learn.microsoft.com/java/azure/jdk/ -[azure_subscription]: https://azure.microsoft.com/free/ -[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity -[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty -[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md -[sample]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/SAMPLE.md -[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md -[api_profile]: https://learn.microsoft.com/azure-stack/user/azure-stack-version-profiles -[resourcemanagerhybrid_lib]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanagerhybrid diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/pom.xml b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/pom.xml deleted file mode 100644 index 40f84083875b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/pom.xml +++ /dev/null @@ -1,164 +0,0 @@ - - - 4.0.0 - - com.azure - azure-client-sdk-parent - 1.7.0 - ../../parents/azure-client-sdk-parent - - - com.azure.resourcemanager - azure-resourcemanager-keyvault - 1.0.0-hybrid - jar - - Microsoft Azure SDK for Key Vault Management (Hybrid) - This package contains Microsoft Azure Key Vault Management Hybrid SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt - https://github.com/Azure/azure-sdk-for-java - - - - The MIT License (MIT) - http://opensource.org/licenses/MIT - repo - - - - - https://github.com/Azure/azure-sdk-for-java - scm:git:git@github.com:Azure/azure-sdk-for-java.git - HEAD - - - - - 0.10 - 0.10 - - - --add-opens com.azure.resourcemanager.authorization/com.azure.resourcemanager.authorization=ALL-UNNAMED - --add-opens com.azure.resourcemanager.keyvault/com.azure.resourcemanager.keyvault=ALL-UNNAMED - --add-opens com.azure.core/com.azure.core.implementation.jackson=ALL-UNNAMED - - - - - - microsoft - Microsoft - - - - - - com.azure.resourcemanager - azure-resourcemanager-resources - 1.0.0-hybrid - - - com.azure.resourcemanager - azure-resourcemanager-authorization - 1.0.0-hybrid - - - com.azure - azure-security-keyvault-keys - 4.10.4 - - - com.azure - azure-core-http-netty - - - - - com.azure - azure-security-keyvault-secrets - 4.10.4 - - - com.azure - azure-core-http-netty - - - - - org.junit.jupiter - junit-jupiter-engine - 5.13.4 - test - - - org.junit.jupiter - junit-jupiter-api - 5.13.4 - test - - - com.azure - azure-core-http-netty - 1.16.2 - test - - - org.slf4j - slf4j-simple - 1.7.36 - test - - - - - azure-mgmt-sdk-test-jar - - - !maven.test.skip - - - - - com.azure.resourcemanager - azure-resourcemanager-test - 1.0.0-hybrid - test - - - - - - - - org.apache.maven.plugins - maven-jar-plugin - 3.4.2 - - - - true - true - - - - - - - org.jacoco - jacoco-maven-plugin - 0.8.13 - - - com/azure/resourcemanager/**/fluent/**/* - com/azure/resourcemanager/**/models/**/* - com/azure/resourcemanager/**/implementation/*ClientImpl* - com/azure/resourcemanager/**/implementation/*ClientBuilder* - - - - - - diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/KeyVaultManager.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/KeyVaultManager.java deleted file mode 100644 index b65d1c294f42..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/KeyVaultManager.java +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.keyvault; - -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpPipeline; -import com.azure.resourcemanager.authorization.AuthorizationManager; -import com.azure.resourcemanager.keyvault.fluent.KeyVaultManagementClient; -import com.azure.resourcemanager.keyvault.implementation.KeyVaultManagementClientBuilder; -import com.azure.resourcemanager.keyvault.implementation.VaultsImpl; -import com.azure.resourcemanager.keyvault.models.Vaults; -import com.azure.resourcemanager.resources.fluentcore.arm.AzureConfigurable; -import com.azure.resourcemanager.resources.fluentcore.arm.implementation.AzureConfigurableImpl; -import com.azure.resourcemanager.resources.fluentcore.arm.Manager; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.resources.fluentcore.utils.HttpPipelineProvider; - -import java.util.Objects; - -/** Entry point to Azure KeyVault resource management. */ -public final class KeyVaultManager extends Manager { - // Service managers - private final AuthorizationManager authorizationManager; - // Collections - private Vaults vaults; - // Variables - private final String tenantId; - - /** - * Get a Configurable instance that can be used to create KeyVaultManager with optional configuration. - * - * @return the instance allowing configurations - */ - public static Configurable configure() { - return new KeyVaultManager.ConfigurableImpl(); - } - - /** - * Creates an instance of KeyVaultManager that exposes KeyVault resource management API entry points. - * - * @param credential the credential to use - * @param profile the profile to use - * @return the KeyVaultManager - */ - public static KeyVaultManager authenticate(TokenCredential credential, AzureProfile profile) { - Objects.requireNonNull(credential, "'credential' cannot be null."); - Objects.requireNonNull(profile, "'profile' cannot be null."); - return authenticate( - HttpPipelineProvider.buildHttpPipeline(credential, profile), profile); - } - - /** - * Creates an instance of KeyVaultManager that exposes KeyVault resource management API entry points. - * - * @param httpPipeline the HttpPipeline to be used for API calls - * @param profile the profile to use - * @return the KeyVaultManager - */ - public static KeyVaultManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { - Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); - Objects.requireNonNull(profile, "'profile' cannot be null."); - return new KeyVaultManager(httpPipeline, profile); - } - - /** The interface allowing configurations to be set. */ - public interface Configurable extends AzureConfigurable { - /** - * Creates an instance of KeyVaultManager that exposes KeyVault management API entry points. - * - * @param credential the credential to use - * @param profile the profile to use - * @return the interface exposing KeyVault management API entry points that work across subscriptions - */ - KeyVaultManager authenticate(TokenCredential credential, AzureProfile profile); - } - - /** The implementation for Configurable interface. */ - private static final class ConfigurableImpl extends AzureConfigurableImpl implements Configurable { - public KeyVaultManager authenticate(TokenCredential credential, AzureProfile profile) { - return KeyVaultManager - .authenticate( - buildHttpPipeline(credential, profile), profile); - } - } - - private KeyVaultManager( - final HttpPipeline httpPipeline, AzureProfile profile) { - super( - httpPipeline, - profile, - new KeyVaultManagementClientBuilder() - .pipeline(httpPipeline) - .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) - .subscriptionId(profile.getSubscriptionId()) - .buildClient()); - authorizationManager = AuthorizationManager.authenticate(httpPipeline, profile); - this.tenantId = profile.getTenantId(); - } - - /** @return the KeyVault account management API entry point */ - public Vaults vaults() { - if (vaults == null) { - vaults = new VaultsImpl(this, authorizationManager, tenantId); - } - return vaults; - } - -// /** -// * Creates a new RestClientBuilder instance from the RestClient used by Manager. -// * -// * @return the new RestClientBuilder instance created from the RestClient used by Manager -// */ -// RestClientBuilder newRestClientBuilder() { -// return restClient.newBuilder(); -// } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/KeyVaultManagementClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/KeyVaultManagementClient.java deleted file mode 100644 index 750dd99fddf1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/KeyVaultManagementClient.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.keyvault.fluent; - -import com.azure.core.http.HttpPipeline; -import java.time.Duration; - -/** The interface for KeyVaultManagementClient class. */ -public interface KeyVaultManagementClient { - /** - * Gets Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms - * part of the URI for every service call. - * - * @return the subscriptionId value. - */ - String getSubscriptionId(); - - /** - * Gets server parameter. - * - * @return the endpoint value. - */ - String getEndpoint(); - - /** - * Gets Api Version. - * - * @return the apiVersion value. - */ - String getApiVersion(); - - /** - * Gets The HTTP pipeline to send requests through. - * - * @return the httpPipeline value. - */ - HttpPipeline getHttpPipeline(); - - /** - * Gets The default poll interval for long-running operation. - * - * @return the defaultPollInterval value. - */ - Duration getDefaultPollInterval(); - - /** - * Gets the VaultsClient object to access its operations. - * - * @return the VaultsClient object. - */ - VaultsClient getVaults(); - - /** - * Gets the PrivateEndpointConnectionsClient object to access its operations. - * - * @return the PrivateEndpointConnectionsClient object. - */ - PrivateEndpointConnectionsClient getPrivateEndpointConnections(); - - /** - * Gets the PrivateLinkResourcesClient object to access its operations. - * - * @return the PrivateLinkResourcesClient object. - */ - PrivateLinkResourcesClient getPrivateLinkResources(); - - /** - * Gets the OperationsClient object to access its operations. - * - * @return the OperationsClient object. - */ - OperationsClient getOperations(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/OperationsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/OperationsClient.java deleted file mode 100644 index 83c460a4abce..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/OperationsClient.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.keyvault.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.keyvault.fluent.models.OperationInner; - -/** An instance of this class provides access to all the operations defined in OperationsClient. */ -public interface OperationsClient { - /** - * Lists all of the available Key Vault Rest API operations. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Storage operations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Lists all of the available Key Vault Rest API operations. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Storage operations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Lists all of the available Key Vault Rest API operations. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Storage operations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/PrivateEndpointConnectionsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/PrivateEndpointConnectionsClient.java deleted file mode 100644 index 0c1310941d0e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/PrivateEndpointConnectionsClient.java +++ /dev/null @@ -1,267 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.keyvault.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.keyvault.fluent.models.PrivateEndpointConnectionInner; -import com.azure.resourcemanager.keyvault.models.PrivateEndpointConnectionsPutResponse; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. */ -public interface PrivateEndpointConnectionsClient { - /** - * Gets the specified private endpoint connection associated with the key vault. - * - * @param resourceGroupName Name of the resource group that contains the key vault. - * @param vaultName The name of the key vault. - * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private endpoint connection associated with the key vault. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync( - String resourceGroupName, String vaultName, String privateEndpointConnectionName); - - /** - * Gets the specified private endpoint connection associated with the key vault. - * - * @param resourceGroupName Name of the resource group that contains the key vault. - * @param vaultName The name of the key vault. - * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private endpoint connection associated with the key vault. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync( - String resourceGroupName, String vaultName, String privateEndpointConnectionName); - - /** - * Gets the specified private endpoint connection associated with the key vault. - * - * @param resourceGroupName Name of the resource group that contains the key vault. - * @param vaultName The name of the key vault. - * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private endpoint connection associated with the key vault. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PrivateEndpointConnectionInner get( - String resourceGroupName, String vaultName, String privateEndpointConnectionName); - - /** - * Gets the specified private endpoint connection associated with the key vault. - * - * @param resourceGroupName Name of the resource group that contains the key vault. - * @param vaultName The name of the key vault. - * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private endpoint connection associated with the key vault. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String vaultName, String privateEndpointConnectionName, Context context); - - /** - * Updates the specified private endpoint connection associated with the key vault. - * - * @param resourceGroupName Name of the resource group that contains the key vault. - * @param vaultName The name of the key vault. - * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. - * @param properties The intended state of private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private endpoint connection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono putWithResponseAsync( - String resourceGroupName, - String vaultName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner properties); - - /** - * Updates the specified private endpoint connection associated with the key vault. - * - * @param resourceGroupName Name of the resource group that contains the key vault. - * @param vaultName The name of the key vault. - * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. - * @param properties The intended state of private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private endpoint connection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono putAsync( - String resourceGroupName, - String vaultName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner properties); - - /** - * Updates the specified private endpoint connection associated with the key vault. - * - * @param resourceGroupName Name of the resource group that contains the key vault. - * @param vaultName The name of the key vault. - * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. - * @param properties The intended state of private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private endpoint connection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PrivateEndpointConnectionInner put( - String resourceGroupName, - String vaultName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner properties); - - /** - * Updates the specified private endpoint connection associated with the key vault. - * - * @param resourceGroupName Name of the resource group that contains the key vault. - * @param vaultName The name of the key vault. - * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. - * @param properties The intended state of private endpoint connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private endpoint connection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PrivateEndpointConnectionsPutResponse putWithResponse( - String resourceGroupName, - String vaultName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner properties, - Context context); - - /** - * Deletes the specified private endpoint connection associated with the key vault. - * - * @param resourceGroupName Name of the resource group that contains the key vault. - * @param vaultName The name of the key vault. - * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private endpoint connection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync( - String resourceGroupName, String vaultName, String privateEndpointConnectionName); - - /** - * Deletes the specified private endpoint connection associated with the key vault. - * - * @param resourceGroupName Name of the resource group that contains the key vault. - * @param vaultName The name of the key vault. - * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private endpoint connection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, PrivateEndpointConnectionInner> beginDeleteAsync( - String resourceGroupName, String vaultName, String privateEndpointConnectionName); - - /** - * Deletes the specified private endpoint connection associated with the key vault. - * - * @param resourceGroupName Name of the resource group that contains the key vault. - * @param vaultName The name of the key vault. - * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private endpoint connection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, PrivateEndpointConnectionInner> beginDelete( - String resourceGroupName, String vaultName, String privateEndpointConnectionName); - - /** - * Deletes the specified private endpoint connection associated with the key vault. - * - * @param resourceGroupName Name of the resource group that contains the key vault. - * @param vaultName The name of the key vault. - * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private endpoint connection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, PrivateEndpointConnectionInner> beginDelete( - String resourceGroupName, String vaultName, String privateEndpointConnectionName, Context context); - - /** - * Deletes the specified private endpoint connection associated with the key vault. - * - * @param resourceGroupName Name of the resource group that contains the key vault. - * @param vaultName The name of the key vault. - * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private endpoint connection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync( - String resourceGroupName, String vaultName, String privateEndpointConnectionName); - - /** - * Deletes the specified private endpoint connection associated with the key vault. - * - * @param resourceGroupName Name of the resource group that contains the key vault. - * @param vaultName The name of the key vault. - * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private endpoint connection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PrivateEndpointConnectionInner delete( - String resourceGroupName, String vaultName, String privateEndpointConnectionName); - - /** - * Deletes the specified private endpoint connection associated with the key vault. - * - * @param resourceGroupName Name of the resource group that contains the key vault. - * @param vaultName The name of the key vault. - * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private endpoint connection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PrivateEndpointConnectionInner delete( - String resourceGroupName, String vaultName, String privateEndpointConnectionName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/PrivateLinkResourcesClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/PrivateLinkResourcesClient.java deleted file mode 100644 index 0dedd4d171d0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/PrivateLinkResourcesClient.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.keyvault.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.keyvault.fluent.models.PrivateLinkResourceListResultInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. */ -public interface PrivateLinkResourcesClient { - /** - * Gets the private link resources supported for the key vault. - * - * @param resourceGroupName Name of the resource group that contains the key vault. - * @param vaultName The name of the key vault. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources supported for the key vault. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listByVaultWithResponseAsync( - String resourceGroupName, String vaultName); - - /** - * Gets the private link resources supported for the key vault. - * - * @param resourceGroupName Name of the resource group that contains the key vault. - * @param vaultName The name of the key vault. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources supported for the key vault. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listByVaultAsync(String resourceGroupName, String vaultName); - - /** - * Gets the private link resources supported for the key vault. - * - * @param resourceGroupName Name of the resource group that contains the key vault. - * @param vaultName The name of the key vault. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources supported for the key vault. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PrivateLinkResourceListResultInner listByVault(String resourceGroupName, String vaultName); - - /** - * Gets the private link resources supported for the key vault. - * - * @param resourceGroupName Name of the resource group that contains the key vault. - * @param vaultName The name of the key vault. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources supported for the key vault. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listByVaultWithResponse( - String resourceGroupName, String vaultName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/VaultsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/VaultsClient.java deleted file mode 100644 index 08da64620fc1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/VaultsClient.java +++ /dev/null @@ -1,750 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.keyvault.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.Resource; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.keyvault.fluent.models.CheckNameAvailabilityResultInner; -import com.azure.resourcemanager.keyvault.fluent.models.DeletedVaultInner; -import com.azure.resourcemanager.keyvault.fluent.models.VaultAccessPolicyParametersInner; -import com.azure.resourcemanager.keyvault.fluent.models.VaultInner; -import com.azure.resourcemanager.keyvault.models.AccessPolicyUpdateKind; -import com.azure.resourcemanager.keyvault.models.VaultAccessPolicyProperties; -import com.azure.resourcemanager.keyvault.models.VaultCreateOrUpdateParameters; -import com.azure.resourcemanager.keyvault.models.VaultPatchParameters; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in VaultsClient. */ -public interface VaultsClient extends InnerSupportsGet, InnerSupportsDelete { - /** - * Create or update a key vault in the specified subscription. - * - * @param resourceGroupName The name of the Resource Group to which the server belongs. - * @param vaultName Name of the vault. - * @param parameters Parameters to create or update the vault. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information with extended details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String vaultName, VaultCreateOrUpdateParameters parameters); - - /** - * Create or update a key vault in the specified subscription. - * - * @param resourceGroupName The name of the Resource Group to which the server belongs. - * @param vaultName Name of the vault. - * @param parameters Parameters to create or update the vault. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information with extended details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, VaultInner> beginCreateOrUpdateAsync( - String resourceGroupName, String vaultName, VaultCreateOrUpdateParameters parameters); - - /** - * Create or update a key vault in the specified subscription. - * - * @param resourceGroupName The name of the Resource Group to which the server belongs. - * @param vaultName Name of the vault. - * @param parameters Parameters to create or update the vault. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information with extended details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VaultInner> beginCreateOrUpdate( - String resourceGroupName, String vaultName, VaultCreateOrUpdateParameters parameters); - - /** - * Create or update a key vault in the specified subscription. - * - * @param resourceGroupName The name of the Resource Group to which the server belongs. - * @param vaultName Name of the vault. - * @param parameters Parameters to create or update the vault. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information with extended details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VaultInner> beginCreateOrUpdate( - String resourceGroupName, String vaultName, VaultCreateOrUpdateParameters parameters, Context context); - - /** - * Create or update a key vault in the specified subscription. - * - * @param resourceGroupName The name of the Resource Group to which the server belongs. - * @param vaultName Name of the vault. - * @param parameters Parameters to create or update the vault. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information with extended details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, String vaultName, VaultCreateOrUpdateParameters parameters); - - /** - * Create or update a key vault in the specified subscription. - * - * @param resourceGroupName The name of the Resource Group to which the server belongs. - * @param vaultName Name of the vault. - * @param parameters Parameters to create or update the vault. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information with extended details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VaultInner createOrUpdate(String resourceGroupName, String vaultName, VaultCreateOrUpdateParameters parameters); - - /** - * Create or update a key vault in the specified subscription. - * - * @param resourceGroupName The name of the Resource Group to which the server belongs. - * @param vaultName Name of the vault. - * @param parameters Parameters to create or update the vault. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information with extended details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VaultInner createOrUpdate( - String resourceGroupName, String vaultName, VaultCreateOrUpdateParameters parameters, Context context); - - /** - * Update a key vault in the specified subscription. - * - * @param resourceGroupName The name of the Resource Group to which the server belongs. - * @param vaultName Name of the vault. - * @param parameters Parameters to patch the vault. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information with extended details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateWithResponseAsync( - String resourceGroupName, String vaultName, VaultPatchParameters parameters); - - /** - * Update a key vault in the specified subscription. - * - * @param resourceGroupName The name of the Resource Group to which the server belongs. - * @param vaultName Name of the vault. - * @param parameters Parameters to patch the vault. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information with extended details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAsync(String resourceGroupName, String vaultName, VaultPatchParameters parameters); - - /** - * Update a key vault in the specified subscription. - * - * @param resourceGroupName The name of the Resource Group to which the server belongs. - * @param vaultName Name of the vault. - * @param parameters Parameters to patch the vault. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information with extended details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VaultInner update(String resourceGroupName, String vaultName, VaultPatchParameters parameters); - - /** - * Update a key vault in the specified subscription. - * - * @param resourceGroupName The name of the Resource Group to which the server belongs. - * @param vaultName Name of the vault. - * @param parameters Parameters to patch the vault. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information with extended details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String resourceGroupName, String vaultName, VaultPatchParameters parameters, Context context); - - /** - * Deletes the specified Azure key vault. - * - * @param resourceGroupName The name of the Resource Group to which the vault belongs. - * @param vaultName The name of the vault to delete. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteWithResponseAsync(String resourceGroupName, String vaultName); - - /** - * Deletes the specified Azure key vault. - * - * @param resourceGroupName The name of the Resource Group to which the vault belongs. - * @param vaultName The name of the vault to delete. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String vaultName); - - /** - * Deletes the specified Azure key vault. - * - * @param resourceGroupName The name of the Resource Group to which the vault belongs. - * @param vaultName The name of the vault to delete. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String vaultName); - - /** - * Deletes the specified Azure key vault. - * - * @param resourceGroupName The name of the Resource Group to which the vault belongs. - * @param vaultName The name of the vault to delete. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String vaultName, Context context); - - /** - * Gets the specified Azure key vault. - * - * @param resourceGroupName The name of the Resource Group to which the vault belongs. - * @param vaultName The name of the vault. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Azure key vault. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String vaultName); - - /** - * Gets the specified Azure key vault. - * - * @param resourceGroupName The name of the Resource Group to which the vault belongs. - * @param vaultName The name of the vault. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Azure key vault. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync(String resourceGroupName, String vaultName); - - /** - * Gets the specified Azure key vault. - * - * @param resourceGroupName The name of the Resource Group to which the vault belongs. - * @param vaultName The name of the vault. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Azure key vault. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VaultInner getByResourceGroup(String resourceGroupName, String vaultName); - - /** - * Gets the specified Azure key vault. - * - * @param resourceGroupName The name of the Resource Group to which the vault belongs. - * @param vaultName The name of the vault. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Azure key vault. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse(String resourceGroupName, String vaultName, Context context); - - /** - * Update access policies in a key vault in the specified subscription. - * - * @param resourceGroupName The name of the Resource Group to which the vault belongs. - * @param vaultName Name of the vault. - * @param operationKind Name of the operation. - * @param properties Properties of the access policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return parameters for updating the access policy in a vault. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateAccessPolicyWithResponseAsync( - String resourceGroupName, - String vaultName, - AccessPolicyUpdateKind operationKind, - VaultAccessPolicyProperties properties); - - /** - * Update access policies in a key vault in the specified subscription. - * - * @param resourceGroupName The name of the Resource Group to which the vault belongs. - * @param vaultName Name of the vault. - * @param operationKind Name of the operation. - * @param properties Properties of the access policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return parameters for updating the access policy in a vault. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAccessPolicyAsync( - String resourceGroupName, - String vaultName, - AccessPolicyUpdateKind operationKind, - VaultAccessPolicyProperties properties); - - /** - * Update access policies in a key vault in the specified subscription. - * - * @param resourceGroupName The name of the Resource Group to which the vault belongs. - * @param vaultName Name of the vault. - * @param operationKind Name of the operation. - * @param properties Properties of the access policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return parameters for updating the access policy in a vault. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VaultAccessPolicyParametersInner updateAccessPolicy( - String resourceGroupName, - String vaultName, - AccessPolicyUpdateKind operationKind, - VaultAccessPolicyProperties properties); - - /** - * Update access policies in a key vault in the specified subscription. - * - * @param resourceGroupName The name of the Resource Group to which the vault belongs. - * @param vaultName Name of the vault. - * @param operationKind Name of the operation. - * @param properties Properties of the access policy. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return parameters for updating the access policy in a vault. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateAccessPolicyWithResponse( - String resourceGroupName, - String vaultName, - AccessPolicyUpdateKind operationKind, - VaultAccessPolicyProperties properties, - Context context); - - /** - * The List operation gets information about the vaults associated with the subscription and within the specified - * resource group. - * - * @param resourceGroupName The name of the Resource Group to which the vault belongs. - * @param top Maximum number of results to return. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of vaults. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName, Integer top); - - /** - * The List operation gets information about the vaults associated with the subscription and within the specified - * resource group. - * - * @param resourceGroupName The name of the Resource Group to which the vault belongs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of vaults. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName); - - /** - * The List operation gets information about the vaults associated with the subscription and within the specified - * resource group. - * - * @param resourceGroupName The name of the Resource Group to which the vault belongs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of vaults. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * The List operation gets information about the vaults associated with the subscription and within the specified - * resource group. - * - * @param resourceGroupName The name of the Resource Group to which the vault belongs. - * @param top Maximum number of results to return. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of vaults. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Integer top, Context context); - - /** - * The List operation gets information about the vaults associated with the subscription. - * - * @param top Maximum number of results to return. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of vaults. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listBySubscriptionAsync(Integer top); - - /** - * The List operation gets information about the vaults associated with the subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of vaults. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listBySubscriptionAsync(); - - /** - * The List operation gets information about the vaults associated with the subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of vaults. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listBySubscription(); - - /** - * The List operation gets information about the vaults associated with the subscription. - * - * @param top Maximum number of results to return. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of vaults. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listBySubscription(Integer top, Context context); - - /** - * Gets information about the deleted vaults in a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the deleted vaults in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listDeletedAsync(); - - /** - * Gets information about the deleted vaults in a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the deleted vaults in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listDeleted(); - - /** - * Gets information about the deleted vaults in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the deleted vaults in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listDeleted(Context context); - - /** - * Gets the deleted Azure key vault. - * - * @param vaultName The name of the vault. - * @param location The location of the deleted vault. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deleted Azure key vault. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getDeletedWithResponseAsync(String vaultName, String location); - - /** - * Gets the deleted Azure key vault. - * - * @param vaultName The name of the vault. - * @param location The location of the deleted vault. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deleted Azure key vault. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getDeletedAsync(String vaultName, String location); - - /** - * Gets the deleted Azure key vault. - * - * @param vaultName The name of the vault. - * @param location The location of the deleted vault. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deleted Azure key vault. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DeletedVaultInner getDeleted(String vaultName, String location); - - /** - * Gets the deleted Azure key vault. - * - * @param vaultName The name of the vault. - * @param location The location of the deleted vault. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deleted Azure key vault. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getDeletedWithResponse(String vaultName, String location, Context context); - - /** - * Permanently deletes the specified vault. aka Purges the deleted Azure key vault. - * - * @param vaultName The name of the soft-deleted vault. - * @param location The location of the soft-deleted vault. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> purgeDeletedWithResponseAsync(String vaultName, String location); - - /** - * Permanently deletes the specified vault. aka Purges the deleted Azure key vault. - * - * @param vaultName The name of the soft-deleted vault. - * @param location The location of the soft-deleted vault. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginPurgeDeletedAsync(String vaultName, String location); - - /** - * Permanently deletes the specified vault. aka Purges the deleted Azure key vault. - * - * @param vaultName The name of the soft-deleted vault. - * @param location The location of the soft-deleted vault. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginPurgeDeleted(String vaultName, String location); - - /** - * Permanently deletes the specified vault. aka Purges the deleted Azure key vault. - * - * @param vaultName The name of the soft-deleted vault. - * @param location The location of the soft-deleted vault. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginPurgeDeleted(String vaultName, String location, Context context); - - /** - * Permanently deletes the specified vault. aka Purges the deleted Azure key vault. - * - * @param vaultName The name of the soft-deleted vault. - * @param location The location of the soft-deleted vault. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono purgeDeletedAsync(String vaultName, String location); - - /** - * Permanently deletes the specified vault. aka Purges the deleted Azure key vault. - * - * @param vaultName The name of the soft-deleted vault. - * @param location The location of the soft-deleted vault. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void purgeDeleted(String vaultName, String location); - - /** - * Permanently deletes the specified vault. aka Purges the deleted Azure key vault. - * - * @param vaultName The name of the soft-deleted vault. - * @param location The location of the soft-deleted vault. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void purgeDeleted(String vaultName, String location, Context context); - - /** - * The List operation gets information about the vaults associated with the subscription. - * - * @param top Maximum number of results to return. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of vault resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(Integer top); - - /** - * The List operation gets information about the vaults associated with the subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of vault resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * The List operation gets information about the vaults associated with the subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of vault resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * The List operation gets information about the vaults associated with the subscription. - * - * @param top Maximum number of results to return. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of vault resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Integer top, Context context); - - /** - * Checks that the vault name is valid and is not already in use. - * - * @param name The vault name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the CheckNameAvailability operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> checkNameAvailabilityWithResponseAsync(String name); - - /** - * Checks that the vault name is valid and is not already in use. - * - * @param name The vault name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the CheckNameAvailability operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono checkNameAvailabilityAsync(String name); - - /** - * Checks that the vault name is valid and is not already in use. - * - * @param name The vault name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the CheckNameAvailability operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - CheckNameAvailabilityResultInner checkNameAvailability(String name); - - /** - * Checks that the vault name is valid and is not already in use. - * - * @param name The vault name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the CheckNameAvailability operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response checkNameAvailabilityWithResponse(String name, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/CheckNameAvailabilityResultInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/CheckNameAvailabilityResultInner.java deleted file mode 100644 index 1d184f17a4ce..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/CheckNameAvailabilityResultInner.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.keyvault.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.keyvault.models.Reason; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The CheckNameAvailability operation response. */ -@Immutable -public final class CheckNameAvailabilityResultInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CheckNameAvailabilityResultInner.class); - - /* - * A boolean value that indicates whether the name is available for you to - * use. If true, the name is available. If false, the name has already been - * taken or is invalid and cannot be used. - */ - @JsonProperty(value = "nameAvailable", access = JsonProperty.Access.WRITE_ONLY) - private Boolean nameAvailable; - - /* - * The reason that a vault name could not be used. The Reason element is - * only returned if NameAvailable is false. - */ - @JsonProperty(value = "reason", access = JsonProperty.Access.WRITE_ONLY) - private Reason reason; - - /* - * An error message explaining the Reason value in more detail. - */ - @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) - private String message; - - /** - * Get the nameAvailable property: A boolean value that indicates whether the name is available for you to use. If - * true, the name is available. If false, the name has already been taken or is invalid and cannot be used. - * - * @return the nameAvailable value. - */ - public Boolean nameAvailable() { - return this.nameAvailable; - } - - /** - * Get the reason property: The reason that a vault name could not be used. The Reason element is only returned if - * NameAvailable is false. - * - * @return the reason value. - */ - public Reason reason() { - return this.reason; - } - - /** - * Get the message property: An error message explaining the Reason value in more detail. - * - * @return the message value. - */ - public String message() { - return this.message; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/DeletedVaultInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/DeletedVaultInner.java deleted file mode 100644 index 167fc580ed31..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/DeletedVaultInner.java +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.keyvault.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.keyvault.models.DeletedVaultProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Deleted vault information with extended details. */ -@Fluent -public final class DeletedVaultInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DeletedVaultInner.class); - - /* - * The resource ID for the deleted key vault. - */ - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) - private String id; - - /* - * The name of the key vault. - */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) - private String name; - - /* - * The resource type of the key vault. - */ - @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) - private String type; - - /* - * Properties of the vault - */ - @JsonProperty(value = "properties") - private DeletedVaultProperties properties; - - /** - * Get the id property: The resource ID for the deleted key vault. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Get the name property: The name of the key vault. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the type property: The resource type of the key vault. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Get the properties property: Properties of the vault. - * - * @return the properties value. - */ - public DeletedVaultProperties properties() { - return this.properties; - } - - /** - * Set the properties property: Properties of the vault. - * - * @param properties the properties value to set. - * @return the DeletedVaultInner object itself. - */ - public DeletedVaultInner withProperties(DeletedVaultProperties properties) { - this.properties = properties; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/OperationInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/OperationInner.java deleted file mode 100644 index 2b0d840a1ac6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/OperationInner.java +++ /dev/null @@ -1,164 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.keyvault.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.keyvault.models.OperationDisplay; -import com.azure.resourcemanager.keyvault.models.ServiceSpecification; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Key Vault REST API operation definition. */ -@JsonFlatten -@Fluent -public class OperationInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationInner.class); - - /* - * Operation name: {provider}/{resource}/{operation} - */ - @JsonProperty(value = "name") - private String name; - - /* - * Display metadata associated with the operation. - */ - @JsonProperty(value = "display") - private OperationDisplay display; - - /* - * The origin of operations. - */ - @JsonProperty(value = "origin") - private String origin; - - /* - * Property to specify whether the action is a data action. - */ - @JsonProperty(value = "isDataAction") - private Boolean isDataAction; - - /* - * One property of operation, include metric specifications. - */ - @JsonProperty(value = "properties.serviceSpecification") - private ServiceSpecification serviceSpecification; - - /** - * Get the name property: Operation name: {provider}/{resource}/{operation}. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Operation name: {provider}/{resource}/{operation}. - * - * @param name the name value to set. - * @return the OperationInner object itself. - */ - public OperationInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the display property: Display metadata associated with the operation. - * - * @return the display value. - */ - public OperationDisplay display() { - return this.display; - } - - /** - * Set the display property: Display metadata associated with the operation. - * - * @param display the display value to set. - * @return the OperationInner object itself. - */ - public OperationInner withDisplay(OperationDisplay display) { - this.display = display; - return this; - } - - /** - * Get the origin property: The origin of operations. - * - * @return the origin value. - */ - public String origin() { - return this.origin; - } - - /** - * Set the origin property: The origin of operations. - * - * @param origin the origin value to set. - * @return the OperationInner object itself. - */ - public OperationInner withOrigin(String origin) { - this.origin = origin; - return this; - } - - /** - * Get the isDataAction property: Property to specify whether the action is a data action. - * - * @return the isDataAction value. - */ - public Boolean isDataAction() { - return this.isDataAction; - } - - /** - * Set the isDataAction property: Property to specify whether the action is a data action. - * - * @param isDataAction the isDataAction value to set. - * @return the OperationInner object itself. - */ - public OperationInner withIsDataAction(Boolean isDataAction) { - this.isDataAction = isDataAction; - return this; - } - - /** - * Get the serviceSpecification property: One property of operation, include metric specifications. - * - * @return the serviceSpecification value. - */ - public ServiceSpecification serviceSpecification() { - return this.serviceSpecification; - } - - /** - * Set the serviceSpecification property: One property of operation, include metric specifications. - * - * @param serviceSpecification the serviceSpecification value to set. - * @return the OperationInner object itself. - */ - public OperationInner withServiceSpecification(ServiceSpecification serviceSpecification) { - this.serviceSpecification = serviceSpecification; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (display() != null) { - display().validate(); - } - if (serviceSpecification() != null) { - serviceSpecification().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/PrivateEndpointConnectionInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/PrivateEndpointConnectionInner.java deleted file mode 100644 index 8c2e7f8cd579..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/PrivateEndpointConnectionInner.java +++ /dev/null @@ -1,146 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.keyvault.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.keyvault.models.PrivateEndpoint; -import com.azure.resourcemanager.keyvault.models.PrivateEndpointConnectionProvisioningState; -import com.azure.resourcemanager.keyvault.models.PrivateLinkServiceConnectionState; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** Private endpoint connection resource. */ -@JsonFlatten -@Fluent -public class PrivateEndpointConnectionInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionInner.class); - - /* - * Modified whenever there is a change in the state of private endpoint - * connection. - */ - @JsonProperty(value = "etag") - private String etag; - - /* - * Properties of the private endpoint object. - */ - @JsonProperty(value = "properties.privateEndpoint") - private PrivateEndpoint privateEndpoint; - - /* - * Approval state of the private link connection. - */ - @JsonProperty(value = "properties.privateLinkServiceConnectionState") - private PrivateLinkServiceConnectionState privateLinkServiceConnectionState; - - /* - * Provisioning state of the private endpoint connection. - */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private PrivateEndpointConnectionProvisioningState provisioningState; - - /** - * Get the etag property: Modified whenever there is a change in the state of private endpoint connection. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: Modified whenever there is a change in the state of private endpoint connection. - * - * @param etag the etag value to set. - * @return the PrivateEndpointConnectionInner object itself. - */ - public PrivateEndpointConnectionInner withEtag(String etag) { - this.etag = etag; - return this; - } - - /** - * Get the privateEndpoint property: Properties of the private endpoint object. - * - * @return the privateEndpoint value. - */ - public PrivateEndpoint privateEndpoint() { - return this.privateEndpoint; - } - - /** - * Set the privateEndpoint property: Properties of the private endpoint object. - * - * @param privateEndpoint the privateEndpoint value to set. - * @return the PrivateEndpointConnectionInner object itself. - */ - public PrivateEndpointConnectionInner withPrivateEndpoint(PrivateEndpoint privateEndpoint) { - this.privateEndpoint = privateEndpoint; - return this; - } - - /** - * Get the privateLinkServiceConnectionState property: Approval state of the private link connection. - * - * @return the privateLinkServiceConnectionState value. - */ - public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { - return this.privateLinkServiceConnectionState; - } - - /** - * Set the privateLinkServiceConnectionState property: Approval state of the private link connection. - * - * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. - * @return the PrivateEndpointConnectionInner object itself. - */ - public PrivateEndpointConnectionInner withPrivateLinkServiceConnectionState( - PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { - this.privateLinkServiceConnectionState = privateLinkServiceConnectionState; - return this; - } - - /** - * Get the provisioningState property: Provisioning state of the private endpoint connection. - * - * @return the provisioningState value. - */ - public PrivateEndpointConnectionProvisioningState provisioningState() { - return this.provisioningState; - } - - /** {@inheritDoc} */ - @Override - public PrivateEndpointConnectionInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public PrivateEndpointConnectionInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (privateEndpoint() != null) { - privateEndpoint().validate(); - } - if (privateLinkServiceConnectionState() != null) { - privateLinkServiceConnectionState().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/PrivateLinkResourceListResultInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/PrivateLinkResourceListResultInner.java deleted file mode 100644 index c79801295959..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/PrivateLinkResourceListResultInner.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.keyvault.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.keyvault.models.PrivateLinkResource; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** A list of private link resources. */ -@Fluent -public final class PrivateLinkResourceListResultInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkResourceListResultInner.class); - - /* - * Array of private link resources - */ - @JsonProperty(value = "value") - private List value; - - /** - * Get the value property: Array of private link resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Array of private link resources. - * - * @param value the value value to set. - * @return the PrivateLinkResourceListResultInner object itself. - */ - public PrivateLinkResourceListResultInner withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/VaultAccessPolicyParametersInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/VaultAccessPolicyParametersInner.java deleted file mode 100644 index f20eccfae528..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/VaultAccessPolicyParametersInner.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.keyvault.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.keyvault.models.VaultAccessPolicyProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Parameters for updating the access policy in a vault. */ -@Fluent -public final class VaultAccessPolicyParametersInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VaultAccessPolicyParametersInner.class); - - /* - * The resource type of the access policy. - */ - @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) - private String location; - - /* - * Properties of the access policy - */ - @JsonProperty(value = "properties", required = true) - private VaultAccessPolicyProperties properties; - - /** - * Get the location property: The resource type of the access policy. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Get the properties property: Properties of the access policy. - * - * @return the properties value. - */ - public VaultAccessPolicyProperties properties() { - return this.properties; - } - - /** - * Set the properties property: Properties of the access policy. - * - * @param properties the properties value to set. - * @return the VaultAccessPolicyParametersInner object itself. - */ - public VaultAccessPolicyParametersInner withProperties(VaultAccessPolicyProperties properties) { - this.properties = properties; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property properties in model VaultAccessPolicyParametersInner")); - } else { - properties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/VaultInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/VaultInner.java deleted file mode 100644 index 9b04e38eb49d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/VaultInner.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.keyvault.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.keyvault.models.VaultProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** Resource information with extended details. */ -@Fluent -public final class VaultInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VaultInner.class); - - /* - * Properties of the vault - */ - @JsonProperty(value = "properties", required = true) - private VaultProperties properties; - - /** - * Get the properties property: Properties of the vault. - * - * @return the properties value. - */ - public VaultProperties properties() { - return this.properties; - } - - /** - * Set the properties property: Properties of the vault. - * - * @param properties the properties value to set. - * @return the VaultInner object itself. - */ - public VaultInner withProperties(VaultProperties properties) { - this.properties = properties; - return this; - } - - /** {@inheritDoc} */ - @Override - public VaultInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public VaultInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property properties in model VaultInner")); - } else { - properties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/package-info.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/package-info.java deleted file mode 100644 index 529590757e99..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** - * Package containing the inner data models for KeyVaultManagementClient. The Azure management API provides a RESTful - * set of web services that interact with Azure Key Vault. - */ -package com.azure.resourcemanager.keyvault.fluent.models; diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/package-info.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/package-info.java deleted file mode 100644 index c43cea214c15..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** - * Package containing the service clients for KeyVaultManagementClient. The Azure management API provides a RESTful set - * of web services that interact with Azure Key Vault. - */ -package com.azure.resourcemanager.keyvault.fluent; diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/AccessPolicyImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/AccessPolicyImpl.java deleted file mode 100644 index 4e1e733e1d7d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/AccessPolicyImpl.java +++ /dev/null @@ -1,372 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.keyvault.implementation; - -import com.azure.resourcemanager.authorization.models.ActiveDirectoryGroup; -import com.azure.resourcemanager.authorization.models.ActiveDirectoryUser; -import com.azure.resourcemanager.authorization.models.ServicePrincipal; -import com.azure.resourcemanager.keyvault.models.AccessPolicy; -import com.azure.resourcemanager.keyvault.models.AccessPolicyEntry; -import com.azure.resourcemanager.keyvault.models.CertificatePermissions; -import com.azure.resourcemanager.keyvault.models.KeyPermissions; -import com.azure.resourcemanager.keyvault.models.Permissions; -import com.azure.resourcemanager.keyvault.models.SecretPermissions; -import com.azure.resourcemanager.keyvault.models.StoragePermissions; -import com.azure.resourcemanager.keyvault.models.Vault; -import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.ChildResourceImpl; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.UUID; - -/** Implementation for AccessPolicy and its parent interfaces. */ -class AccessPolicyImpl extends ChildResourceImpl - implements AccessPolicy, - AccessPolicy.Definition, - AccessPolicy.UpdateDefinition, - AccessPolicy.Update { - private String userPrincipalName; - private String servicePrincipalName; - - AccessPolicyImpl(AccessPolicyEntry innerObject, VaultImpl parent) { - super(innerObject, parent); - innerModel().withTenantId(UUID.fromString(parent.tenantId())); - } - - String userPrincipalName() { - return userPrincipalName; - } - - String servicePrincipalName() { - return servicePrincipalName; - } - - @Override - public String tenantId() { - if (innerModel().tenantId() == null) { - return null; - } - return innerModel().tenantId().toString(); - } - - @Override - public String objectId() { - if (innerModel().objectId() == null) { - return null; - } - return innerModel().objectId(); - } - - @Override - public String applicationId() { - if (innerModel().applicationId() == null) { - return null; - } - return innerModel().applicationId().toString(); - } - - @Override - public Permissions permissions() { - return innerModel().permissions(); - } - - @Override - public String name() { - return innerModel().objectId(); - } - - private void initializeKeyPermissions() { - if (innerModel().permissions() == null) { - innerModel().withPermissions(new Permissions()); - } - if (innerModel().permissions().keys() == null) { - innerModel().permissions().withKeys(new ArrayList()); - } - } - - private void initializeSecretPermissions() { - if (innerModel().permissions() == null) { - innerModel().withPermissions(new Permissions()); - } - if (innerModel().permissions().secrets() == null) { - innerModel().permissions().withSecrets(new ArrayList()); - } - } - - private void initializeCertificatePermissions() { - if (innerModel().permissions() == null) { - innerModel().withPermissions(new Permissions()); - } - if (innerModel().permissions().certificates() == null) { - innerModel().permissions().withCertificates(new ArrayList()); - } - } - - private void initializeStoragePermissions() { - if (innerModel().permissions() == null) { - innerModel().withPermissions(new Permissions()); - } - if (innerModel().permissions().storage() == null) { - innerModel().permissions().withStorage(new ArrayList()); - } - } - - @Override - public AccessPolicyImpl allowKeyPermissions(KeyPermissions... permissions) { - initializeKeyPermissions(); - for (KeyPermissions permission : permissions) { - if (!innerModel().permissions().keys().contains(permission)) { - innerModel().permissions().keys().add(permission); - } - } - return this; - } - - @Override - public AccessPolicyImpl allowKeyPermissions(List permissions) { - initializeKeyPermissions(); - for (KeyPermissions permission : permissions) { - if (!innerModel().permissions().keys().contains(permission)) { - innerModel().permissions().keys().add(permission); - } - } - return this; - } - - @Override - public AccessPolicyImpl allowSecretPermissions(SecretPermissions... permissions) { - initializeSecretPermissions(); - for (SecretPermissions permission : permissions) { - if (!innerModel().permissions().secrets().contains(permission)) { - innerModel().permissions().secrets().add(permission); - } - } - return this; - } - - @Override - public AccessPolicyImpl allowSecretPermissions(List permissions) { - initializeSecretPermissions(); - for (SecretPermissions permission : permissions) { - if (!innerModel().permissions().secrets().contains(permission)) { - innerModel().permissions().secrets().add(permission); - } - } - return this; - } - - @Override - public AccessPolicyImpl allowCertificateAllPermissions() { - for (CertificatePermissions permission : CertificatePermissions.values()) { - allowCertificatePermissions(permission); - } - return this; - } - - @Override - public AccessPolicyImpl allowCertificatePermissions(CertificatePermissions... permissions) { - initializeCertificatePermissions(); - for (CertificatePermissions permission : permissions) { - if (!innerModel().permissions().certificates().contains(permission)) { - innerModel().permissions().certificates().add(permission); - } - } - return this; - } - - @Override - public AccessPolicyImpl allowCertificatePermissions(List permissions) { - initializeCertificatePermissions(); - for (CertificatePermissions permission : permissions) { - if (!innerModel().permissions().certificates().contains(permission)) { - innerModel().permissions().certificates().add(permission); - } - } - return this; - } - - @Override - public AccessPolicyImpl allowStorageAllPermissions() { - for (StoragePermissions permission : StoragePermissions.values()) { - allowStoragePermissions(permission); - } - return this; - } - - @Override - public AccessPolicyImpl allowStoragePermissions(StoragePermissions... permissions) { - initializeStoragePermissions(); - for (StoragePermissions permission : permissions) { - if (!innerModel().permissions().storage().contains(permission)) { - innerModel().permissions().storage().add(permission); - } - } - return this; - } - - @Override - public AccessPolicyImpl allowStoragePermissions(List permissions) { - initializeStoragePermissions(); - for (StoragePermissions permission : permissions) { - if (!innerModel().permissions().storage().contains(permission)) { - innerModel().permissions().storage().add(permission); - } - } - return this; - } - - @Override - public AccessPolicyImpl disallowCertificateAllPermissions() { - initializeCertificatePermissions(); - innerModel().permissions().secrets().clear(); - return this; - } - - @Override - public AccessPolicyImpl disallowCertificatePermissions(CertificatePermissions... permissions) { - initializeCertificatePermissions(); - innerModel().permissions().certificates().removeAll(Arrays.asList(permissions)); - return this; - } - - @Override - public AccessPolicyImpl disallowCertificatePermissions(List permissions) { - initializeCertificatePermissions(); - innerModel().permissions().certificates().removeAll(permissions); - return this; - } - - @Override - public VaultImpl attach() { - parent().withAccessPolicy(this); - return parent(); - } - - @Override - public AccessPolicyImpl forObjectId(String objectId) { - innerModel().withObjectId(objectId); - return this; - } - - @Override - public AccessPolicyImpl forUser(ActiveDirectoryUser user) { - innerModel().withObjectId(user.id()); - return this; - } - - @Override - public AccessPolicyImpl forUser(String userPrincipalName) { - this.userPrincipalName = userPrincipalName; - return this; - } - - @Override - public AccessPolicyImpl forApplicationId(String applicationId) { - innerModel().withApplicationId(UUID.fromString(applicationId)); - return this; - } - - @Override - public AccessPolicyImpl forTenantId(String tenantId) { - innerModel().withTenantId(UUID.fromString(tenantId)); - return this; - } - - @Override - public AccessPolicyImpl forGroup(ActiveDirectoryGroup activeDirectoryGroup) { - innerModel().withObjectId(activeDirectoryGroup.id()); - return this; - } - - @Override - public AccessPolicyImpl forServicePrincipal(ServicePrincipal servicePrincipal) { - innerModel().withObjectId(servicePrincipal.id()); - return this; - } - - @Override - public AccessPolicyImpl forServicePrincipal(String servicePrincipalName) { - this.servicePrincipalName = servicePrincipalName; - return this; - } - - @Override - public AccessPolicyImpl allowKeyAllPermissions() { - for (KeyPermissions permission : KeyPermissions.values()) { - allowKeyPermissions(permission); - } - return this; - } - - @Override - public AccessPolicyImpl disallowKeyAllPermissions() { - initializeKeyPermissions(); - innerModel().permissions().keys().clear(); - return this; - } - - @Override - public AccessPolicyImpl disallowKeyPermissions(KeyPermissions... permissions) { - initializeSecretPermissions(); - innerModel().permissions().keys().removeAll(Arrays.asList(permissions)); - return this; - } - - @Override - public AccessPolicyImpl disallowKeyPermissions(List permissions) { - initializeSecretPermissions(); - innerModel().permissions().keys().removeAll(permissions); - return this; - } - - @Override - public AccessPolicyImpl allowSecretAllPermissions() { - for (SecretPermissions permission : SecretPermissions.values()) { - allowSecretPermissions(permission); - } - return this; - } - - @Override - public AccessPolicyImpl disallowSecretAllPermissions() { - initializeSecretPermissions(); - innerModel().permissions().secrets().clear(); - return this; - } - - @Override - public AccessPolicyImpl disallowSecretPermissions(SecretPermissions... permissions) { - initializeSecretPermissions(); - innerModel().permissions().secrets().removeAll(Arrays.asList(permissions)); - return this; - } - - @Override - public AccessPolicyImpl disallowSecretPermissions(List permissions) { - initializeSecretPermissions(); - innerModel().permissions().secrets().removeAll(permissions); - return this; - } - - @Override - public AccessPolicyImpl disallowStorageAllPermissions() { - initializeStoragePermissions(); - innerModel().permissions().storage().clear(); - return this; - } - - @Override - public AccessPolicyImpl disallowStoragePermissions(StoragePermissions... permissions) { - initializeStoragePermissions(); - innerModel().permissions().storage().removeAll(Arrays.asList(permissions)); - return this; - } - - @Override - public AccessPolicyImpl disallowStoragePermissions(List permissions) { - initializeStoragePermissions(); - innerModel().permissions().storage().removeAll(permissions); - return this; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/CheckNameAvailabilityResultImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/CheckNameAvailabilityResultImpl.java deleted file mode 100644 index 57f3d6201829..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/CheckNameAvailabilityResultImpl.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.keyvault.implementation; - -import com.azure.resourcemanager.keyvault.models.CheckNameAvailabilityResult; -import com.azure.resourcemanager.keyvault.models.Reason; -import com.azure.resourcemanager.keyvault.fluent.models.CheckNameAvailabilityResultInner; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.WrapperImpl; - -/** The CheckNameAvailability operation response. */ -public class CheckNameAvailabilityResultImpl extends WrapperImpl - implements CheckNameAvailabilityResult { - - protected CheckNameAvailabilityResultImpl(CheckNameAvailabilityResultInner innerObject) { - super(innerObject); - } - - @Override - public Boolean nameAvailable() { - return innerModel().nameAvailable(); - } - - @Override - public Reason reason() { - return innerModel().reason(); - } - - @Override - public String message() { - return innerModel().message(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/DeletedVaultImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/DeletedVaultImpl.java deleted file mode 100644 index ae7b4658afb6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/DeletedVaultImpl.java +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.keyvault.implementation; - -import com.azure.resourcemanager.keyvault.models.DeletedVault; -import com.azure.resourcemanager.keyvault.fluent.models.DeletedVaultInner; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.WrapperImpl; -import java.time.OffsetDateTime; -import java.util.Map; - -/** Deleted vault information with extended details. */ -public class DeletedVaultImpl extends WrapperImpl implements DeletedVault { - - DeletedVaultImpl(DeletedVaultInner inner) { - super(inner); - } - - @Override - public String name() { - return innerModel().name(); - } - - @Override - public String id() { - return innerModel().id(); - } - - @Override - public String location() { - return innerModel().properties().location(); - } - - @Override - public OffsetDateTime deletionDate() { - return innerModel().properties().deletionDate(); - } - - @Override - public OffsetDateTime scheduledPurgeDate() { - return innerModel().properties().scheduledPurgeDate(); - } - - @Override - public Map tags() { - return innerModel().properties().tags(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/KeyImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/KeyImpl.java deleted file mode 100644 index 65fa48e891a1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/KeyImpl.java +++ /dev/null @@ -1,396 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.keyvault.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.keyvault.models.Key; -import com.azure.resourcemanager.keyvault.models.Vault; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.CreatableUpdatableImpl; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import com.azure.security.keyvault.keys.cryptography.CryptographyAsyncClient; -import com.azure.security.keyvault.keys.cryptography.CryptographyClientBuilder; -import com.azure.security.keyvault.keys.cryptography.models.DecryptResult; -import com.azure.security.keyvault.keys.cryptography.models.EncryptResult; -import com.azure.security.keyvault.keys.cryptography.models.EncryptionAlgorithm; -import com.azure.security.keyvault.keys.cryptography.models.KeyWrapAlgorithm; -import com.azure.security.keyvault.keys.cryptography.models.SignResult; -import com.azure.security.keyvault.keys.cryptography.models.SignatureAlgorithm; -import com.azure.security.keyvault.keys.cryptography.models.UnwrapResult; -import com.azure.security.keyvault.keys.cryptography.models.VerifyResult; -import com.azure.security.keyvault.keys.cryptography.models.WrapResult; -import com.azure.security.keyvault.keys.models.CreateEcKeyOptions; -import com.azure.security.keyvault.keys.models.CreateKeyOptions; -import com.azure.security.keyvault.keys.models.CreateRsaKeyOptions; -import com.azure.security.keyvault.keys.models.ImportKeyOptions; -import com.azure.security.keyvault.keys.models.JsonWebKey; -import com.azure.security.keyvault.keys.models.KeyCurveName; -import com.azure.security.keyvault.keys.models.KeyOperation; -import com.azure.security.keyvault.keys.models.KeyProperties; -import com.azure.security.keyvault.keys.models.KeyType; -import com.azure.security.keyvault.keys.models.KeyVaultKey; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Map; -import reactor.core.publisher.Mono; -import com.azure.resourcemanager.resources.fluentcore.utils.PagedConverter; - -/** Implementation for Vault and its parent interfaces. */ -class KeyImpl extends CreatableUpdatableImpl - implements Key, Key.Definition, Key.UpdateWithCreate, Key.UpdateWithImport { - - private final ClientLogger logger = new ClientLogger(this.getClass()); - - private final Vault vault; - - private CreateKeyOptions createKeyRequest; - private UpdateKeyOptions updateKeyRequest; - private ImportKeyOptions importKeyRequest = null; - - private CryptographyAsyncClient cryptographyClient; - - private JsonWebKey jsonWebKey; - - private CryptographyAsyncClient cryptographyClient() { - return cryptographyClient; - } - - private static class UpdateKeyOptions { - private KeyProperties keyProperties = new KeyProperties(); - private List keyOperations = new ArrayList<>(); - } - - KeyImpl(String name, KeyProperties innerObject, Vault vault) { - super(name, innerObject); - this.vault = vault; - } - - KeyImpl(String name, KeyVaultKey keyVaultKey, Vault vault) { - super(name, keyVaultKey.getProperties()); - this.jsonWebKey = keyVaultKey.getKey(); - this.vault = vault; - } - - private void init(boolean createNewCryptographyClient) { - this.createKeyRequest = null; - this.updateKeyRequest = new UpdateKeyOptions(); - if (innerModel() != null) { - updateKeyRequest.keyProperties = innerModel(); - if (createNewCryptographyClient) { - cryptographyClient = - new CryptographyClientBuilder() - .keyIdentifier(innerModel().getId()) - .pipeline(vault.vaultHttpPipeline()) - .buildAsyncClient(); - } - } - } - - private KeyImpl wrapModel(KeyProperties keyProperties) { - return new KeyImpl(keyProperties.getName(), keyProperties, vault); - } - - @Override - public String id() { - return this.innerModel().getId(); - } - - @Override - public JsonWebKey getJsonWebKey() { - return this.getJsonWebKeyAsync().block(); - } - - @Override - public Mono getJsonWebKeyAsync() { - if (jsonWebKey != null) { - return Mono.just(jsonWebKey); - } else { - return this.getInnerAsync().map(ignored -> jsonWebKey); - } - } - - @Override - public KeyProperties attributes() { - return innerModel(); - } - - @Override - public Map tags() { - return innerModel().getTags(); - } - - @Override - public boolean managed() { - return ResourceManagerUtils.toPrimitiveBoolean(innerModel().isManaged()); - } - - @Override - public PagedIterable listVersions() { - return new PagedIterable<>(listVersionsAsync()); - } - - @Override - public PagedFlux listVersionsAsync() { - return PagedConverter.mapPage(vault - .keyClient() - .listPropertiesOfKeyVersions(this.name()), - this::wrapModel); - } - - @Override - public byte[] backup() { - return backupAsync().block(); - } - - @Override - public Mono backupAsync() { - return vault.keyClient().backupKey(this.name()); - } - - @Override - public byte[] encrypt(EncryptionAlgorithm algorithm, byte[] content) { - return encryptAsync(algorithm, content).block(); - } - - @Override - public Mono encryptAsync(final EncryptionAlgorithm algorithm, final byte[] content) { - return cryptographyClient().encrypt(algorithm, content).map(EncryptResult::getCipherText); - } - - @Override - public byte[] decrypt(EncryptionAlgorithm algorithm, byte[] content) { - return decryptAsync(algorithm, content).block(); - } - - @Override - public Mono decryptAsync(final EncryptionAlgorithm algorithm, final byte[] content) { - return cryptographyClient().decrypt(algorithm, content).map(DecryptResult::getPlainText); - } - - @Override - public byte[] sign(SignatureAlgorithm algorithm, byte[] digest) { - return signAsync(algorithm, digest).block(); - } - - @Override - public Mono signAsync(final SignatureAlgorithm algorithm, final byte[] digest) { - return cryptographyClient().sign(algorithm, digest).map(SignResult::getSignature); - } - - @Override - public boolean verify(SignatureAlgorithm algorithm, byte[] digest, byte[] signature) { - return ResourceManagerUtils.toPrimitiveBoolean(verifyAsync(algorithm, digest, signature).block()); - } - - @Override - public Mono verifyAsync(final SignatureAlgorithm algorithm, final byte[] digest, final byte[] signature) { - return cryptographyClient().verify(algorithm, digest, signature).map(VerifyResult::isValid); - } - - @Override - public byte[] wrapKey(KeyWrapAlgorithm algorithm, byte[] key) { - return wrapKeyAsync(algorithm, key).block(); - } - - @Override - public Mono wrapKeyAsync(final KeyWrapAlgorithm algorithm, final byte[] key) { - return cryptographyClient().wrapKey(algorithm, key).map(WrapResult::getEncryptedKey); - } - - @Override - public byte[] unwrapKey(KeyWrapAlgorithm algorithm, byte[] key) { - return unwrapKeyAsync(algorithm, key).block(); - } - - @Override - public Mono unwrapKeyAsync(final KeyWrapAlgorithm algorithm, final byte[] key) { - return cryptographyClient().unwrapKey(algorithm, key).map(UnwrapResult::getKey); - } - - @Override - protected Mono getInnerAsync() { - return vault.keyClient().getKey(this.name()).map(keyVaultKey -> { - this.jsonWebKey = keyVaultKey.getKey(); - return keyVaultKey.getProperties(); - }); - } - - @Override - public KeyImpl withTags(Map tags) { - if (isInCreateMode()) { - if (createKeyRequest != null) { - createKeyRequest.setTags(tags); - } else if (importKeyRequest != null) { - importKeyRequest.setTags(tags); - } - } else { - updateKeyRequest.keyProperties.setTags(tags); - } - return this; - } - - @Override - public boolean isInCreateMode() { - return id() == null; - } - - @Override - public Mono createResourceAsync() { - Mono mono; - if (createKeyRequest != null) { - if (createKeyRequest instanceof CreateEcKeyOptions) { - mono = vault.keyClient().createEcKey((CreateEcKeyOptions) createKeyRequest); - } else if (createKeyRequest instanceof CreateRsaKeyOptions) { - mono = vault.keyClient().createRsaKey((CreateRsaKeyOptions) createKeyRequest); - } else { - mono = vault.keyClient().createKey(createKeyRequest); - } - } else { - mono = vault.keyClient().importKey(importKeyRequest); - } - return mono - .map( - keyVaultKey -> { - this.setInner(keyVaultKey.getProperties()); - this.jsonWebKey = keyVaultKey.getKey(); - init(true); - return this; - }); - } - - @Override - public Mono updateResourceAsync() { - UpdateKeyOptions optionsToUpdate = updateKeyRequest; - Mono mono = Mono.just(this); - if (createKeyRequest != null || importKeyRequest != null) { - mono = - createResourceAsync() - .then( - Mono - .fromCallable( - () -> { - // merge optionsToUpdate into refreshed updateKeyRequest - updateKeyRequest - .keyProperties - .setEnabled(optionsToUpdate.keyProperties.isEnabled()); - updateKeyRequest - .keyProperties - .setExpiresOn(optionsToUpdate.keyProperties.getExpiresOn()); - updateKeyRequest - .keyProperties - .setNotBefore(optionsToUpdate.keyProperties.getNotBefore()); - updateKeyRequest.keyProperties.setTags(optionsToUpdate.keyProperties.getTags()); - updateKeyRequest.keyOperations = optionsToUpdate.keyOperations; - return this; - })); - } - return mono - .then( - vault - .keyClient() - .updateKeyProperties( - updateKeyRequest.keyProperties, updateKeyRequest.keyOperations.toArray(new KeyOperation[0])) - .map( - keyVaultKey -> { - this.setInner(keyVaultKey.getProperties()); - this.jsonWebKey = keyVaultKey.getKey(); - init(false); - return this; - })); - } - - @Override - public KeyImpl withAttributes(KeyProperties attributes) { - if (isInCreateMode()) { - if (createKeyRequest != null) { - createKeyRequest.setEnabled(attributes.isEnabled()); - createKeyRequest.setExpiresOn(attributes.getExpiresOn()); - createKeyRequest.setNotBefore(attributes.getNotBefore()); - createKeyRequest.setTags(attributes.getTags()); - } else if (importKeyRequest != null) { - importKeyRequest.setEnabled(attributes.isEnabled()); - importKeyRequest.setExpiresOn(attributes.getExpiresOn()); - importKeyRequest.setNotBefore(attributes.getNotBefore()); - importKeyRequest.setTags(attributes.getTags()); - } - } else { - updateKeyRequest.keyProperties.setEnabled(attributes.isEnabled()); - updateKeyRequest.keyProperties.setExpiresOn(attributes.getExpiresOn()); - updateKeyRequest.keyProperties.setNotBefore(attributes.getNotBefore()); - updateKeyRequest.keyProperties.setTags(attributes.getTags()); - } - return this; - } - - @Override - public KeyImpl withKeyTypeToCreate(KeyType keyType) { - if (keyType == KeyType.EC || keyType == KeyType.EC_HSM) { - CreateEcKeyOptions request = new CreateEcKeyOptions(name()); - request.setHardwareProtected(keyType == KeyType.EC_HSM); - - createKeyRequest = request; - } else if (keyType == KeyType.RSA || keyType == KeyType.RSA_HSM) { - CreateRsaKeyOptions request = new CreateRsaKeyOptions(name()); - request.setHardwareProtected(keyType == KeyType.RSA_HSM); - - createKeyRequest = request; - } else { - createKeyRequest = new CreateKeyOptions(name(), keyType); - } - return this; - } - - @Override - public KeyImpl withLocalKeyToImport(JsonWebKey key) { - if (importKeyRequest == null) { - importKeyRequest = new ImportKeyOptions(name(), key); - } else { - throw logger.logExceptionAsError(new IllegalStateException("Not in import flow")); - } - return this; - } - - @Override - public KeyImpl withKeyOperations(List keyOperations) { - if (isInCreateMode()) { - createKeyRequest.setKeyOperations(keyOperations.toArray(new KeyOperation[0])); - } else { - updateKeyRequest.keyOperations = keyOperations; - } - return this; - } - - @Override - public KeyImpl withKeyOperations(KeyOperation... keyOperations) { - return withKeyOperations(Arrays.asList(keyOperations)); - } - - @Override - public KeyImpl withHsm(boolean isHsm) { - if (importKeyRequest != null) { - importKeyRequest.setHardwareProtected(isHsm); - } else { - throw logger.logExceptionAsError(new IllegalStateException("Not in import flow")); - } - return this; - } - - @Override - public KeyImpl withKeySize(int size) { - if (createKeyRequest instanceof CreateRsaKeyOptions) { - ((CreateRsaKeyOptions) createKeyRequest).setKeySize(size); - } - return this; - } - - @Override - public DefinitionStages.WithCreate withKeyCurveName(KeyCurveName keyCurveName) { - if (createKeyRequest instanceof CreateEcKeyOptions) { - ((CreateEcKeyOptions) createKeyRequest).setCurveName(keyCurveName); - } - return this; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/KeyVaultManagementClientBuilder.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/KeyVaultManagementClientBuilder.java deleted file mode 100644 index 04e1fe50c22d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/KeyVaultManagementClientBuilder.java +++ /dev/null @@ -1,149 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.keyvault.implementation; - -import com.azure.core.annotation.ServiceClientBuilder; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.policy.CookiePolicy; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerAdapter; -import java.time.Duration; - -/** A builder for creating a new instance of the KeyVaultManagementClientImpl type. */ -@ServiceClientBuilder(serviceClients = {KeyVaultManagementClientImpl.class}) -public final class KeyVaultManagementClientBuilder { - /* - * Subscription credentials which uniquely identify Microsoft Azure - * subscription. The subscription ID forms part of the URI for every - * service call. - */ - private String subscriptionId; - - /** - * Sets Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms - * part of the URI for every service call. - * - * @param subscriptionId the subscriptionId value. - * @return the KeyVaultManagementClientBuilder. - */ - public KeyVaultManagementClientBuilder subscriptionId(String subscriptionId) { - this.subscriptionId = subscriptionId; - return this; - } - - /* - * server parameter - */ - private String endpoint; - - /** - * Sets server parameter. - * - * @param endpoint the endpoint value. - * @return the KeyVaultManagementClientBuilder. - */ - public KeyVaultManagementClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * The environment to connect to - */ - private AzureEnvironment environment; - - /** - * Sets The environment to connect to. - * - * @param environment the environment value. - * @return the KeyVaultManagementClientBuilder. - */ - public KeyVaultManagementClientBuilder environment(AzureEnvironment environment) { - this.environment = environment; - return this; - } - - /* - * The default poll interval for long-running operation - */ - private Duration defaultPollInterval; - - /** - * Sets The default poll interval for long-running operation. - * - * @param defaultPollInterval the defaultPollInterval value. - * @return the KeyVaultManagementClientBuilder. - */ - public KeyVaultManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = defaultPollInterval; - return this; - } - - /* - * The HTTP pipeline to send requests through - */ - private HttpPipeline pipeline; - - /** - * Sets The HTTP pipeline to send requests through. - * - * @param pipeline the pipeline value. - * @return the KeyVaultManagementClientBuilder. - */ - public KeyVaultManagementClientBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; - return this; - } - - /* - * The serializer to serialize an object into a string - */ - private SerializerAdapter serializerAdapter; - - /** - * Sets The serializer to serialize an object into a string. - * - * @param serializerAdapter the serializerAdapter value. - * @return the KeyVaultManagementClientBuilder. - */ - public KeyVaultManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { - this.serializerAdapter = serializerAdapter; - return this; - } - - /** - * Builds an instance of KeyVaultManagementClientImpl with the provided parameters. - * - * @return an instance of KeyVaultManagementClientImpl. - */ - public KeyVaultManagementClientImpl buildClient() { - if (endpoint == null) { - this.endpoint = "https://management.azure.com"; - } - if (environment == null) { - this.environment = AzureEnvironment.AZURE; - } - if (defaultPollInterval == null) { - this.defaultPollInterval = Duration.ofSeconds(30); - } - if (pipeline == null) { - this.pipeline = - new HttpPipelineBuilder() - .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) - .build(); - } - if (serializerAdapter == null) { - this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); - } - KeyVaultManagementClientImpl client = - new KeyVaultManagementClientImpl( - pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); - return client; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/KeyVaultManagementClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/KeyVaultManagementClientImpl.java deleted file mode 100644 index 9d4edab71666..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/KeyVaultManagementClientImpl.java +++ /dev/null @@ -1,179 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.keyvault.implementation; - -import com.azure.core.annotation.ServiceClient; -import com.azure.core.http.HttpPipeline; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.serializer.SerializerAdapter; -import com.azure.resourcemanager.keyvault.fluent.KeyVaultManagementClient; -import com.azure.resourcemanager.keyvault.fluent.OperationsClient; -import com.azure.resourcemanager.keyvault.fluent.PrivateEndpointConnectionsClient; -import com.azure.resourcemanager.keyvault.fluent.PrivateLinkResourcesClient; -import com.azure.resourcemanager.keyvault.fluent.VaultsClient; -import com.azure.resourcemanager.resources.fluentcore.AzureServiceClient; -import java.time.Duration; - -/** Initializes a new instance of the KeyVaultManagementClientImpl type. */ -@ServiceClient(builder = KeyVaultManagementClientBuilder.class) -public final class KeyVaultManagementClientImpl extends AzureServiceClient implements KeyVaultManagementClient { - private final ClientLogger logger = new ClientLogger(KeyVaultManagementClientImpl.class); - - /** - * Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of - * the URI for every service call. - */ - private final String subscriptionId; - - /** - * Gets Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms - * part of the URI for every service call. - * - * @return the subscriptionId value. - */ - public String getSubscriptionId() { - return this.subscriptionId; - } - - /** server parameter. */ - private final String endpoint; - - /** - * Gets server parameter. - * - * @return the endpoint value. - */ - public String getEndpoint() { - return this.endpoint; - } - - /** Api Version. */ - private final String apiVersion; - - /** - * Gets Api Version. - * - * @return the apiVersion value. - */ - public String getApiVersion() { - return this.apiVersion; - } - - /** The HTTP pipeline to send requests through. */ - private final HttpPipeline httpPipeline; - - /** - * Gets The HTTP pipeline to send requests through. - * - * @return the httpPipeline value. - */ - public HttpPipeline getHttpPipeline() { - return this.httpPipeline; - } - - /** The serializer to serialize an object into a string. */ - private final SerializerAdapter serializerAdapter; - - /** - * Gets The serializer to serialize an object into a string. - * - * @return the serializerAdapter value. - */ - SerializerAdapter getSerializerAdapter() { - return this.serializerAdapter; - } - - /** The default poll interval for long-running operation. */ - private final Duration defaultPollInterval; - - /** - * Gets The default poll interval for long-running operation. - * - * @return the defaultPollInterval value. - */ - public Duration getDefaultPollInterval() { - return this.defaultPollInterval; - } - - /** The VaultsClient object to access its operations. */ - private final VaultsClient vaults; - - /** - * Gets the VaultsClient object to access its operations. - * - * @return the VaultsClient object. - */ - public VaultsClient getVaults() { - return this.vaults; - } - - /** The PrivateEndpointConnectionsClient object to access its operations. */ - private final PrivateEndpointConnectionsClient privateEndpointConnections; - - /** - * Gets the PrivateEndpointConnectionsClient object to access its operations. - * - * @return the PrivateEndpointConnectionsClient object. - */ - public PrivateEndpointConnectionsClient getPrivateEndpointConnections() { - return this.privateEndpointConnections; - } - - /** The PrivateLinkResourcesClient object to access its operations. */ - private final PrivateLinkResourcesClient privateLinkResources; - - /** - * Gets the PrivateLinkResourcesClient object to access its operations. - * - * @return the PrivateLinkResourcesClient object. - */ - public PrivateLinkResourcesClient getPrivateLinkResources() { - return this.privateLinkResources; - } - - /** The OperationsClient object to access its operations. */ - private final OperationsClient operations; - - /** - * Gets the OperationsClient object to access its operations. - * - * @return the OperationsClient object. - */ - public OperationsClient getOperations() { - return this.operations; - } - - /** - * Initializes an instance of KeyVaultManagementClient client. - * - * @param httpPipeline The HTTP pipeline to send requests through. - * @param serializerAdapter The serializer to serialize an object into a string. - * @param defaultPollInterval The default poll interval for long-running operation. - * @param environment The Azure environment. - * @param subscriptionId Subscription credentials which uniquely identify Microsoft Azure subscription. The - * subscription ID forms part of the URI for every service call. - * @param endpoint server parameter. - */ - KeyVaultManagementClientImpl( - HttpPipeline httpPipeline, - SerializerAdapter serializerAdapter, - Duration defaultPollInterval, - AzureEnvironment environment, - String subscriptionId, - String endpoint) { - super(httpPipeline, serializerAdapter, environment); - this.httpPipeline = httpPipeline; - this.serializerAdapter = serializerAdapter; - this.defaultPollInterval = defaultPollInterval; - this.subscriptionId = subscriptionId; - this.endpoint = endpoint; - this.apiVersion = "2019-09-01"; - this.vaults = new VaultsClientImpl(this); - this.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(this); - this.privateLinkResources = new PrivateLinkResourcesClientImpl(this); - this.operations = new OperationsClientImpl(this); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/KeysImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/KeysImpl.java deleted file mode 100644 index 53242655938e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/KeysImpl.java +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.keyvault.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.polling.LongRunningOperationStatus; -import com.azure.resourcemanager.keyvault.models.Key; -import com.azure.resourcemanager.keyvault.models.Keys; -import com.azure.resourcemanager.keyvault.models.Vault; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.CreatableWrappersImpl; -import com.azure.security.keyvault.keys.KeyAsyncClient; -import com.azure.security.keyvault.keys.models.KeyProperties; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.Objects; - -import com.azure.security.keyvault.keys.models.KeyVaultKey; -import reactor.core.publisher.Mono; -import com.azure.resourcemanager.resources.fluentcore.utils.PagedConverter; - -/** The implementation of Vaults and its parent interfaces. */ -class KeysImpl extends CreatableWrappersImpl implements Keys { - private final KeyAsyncClient inner; - private final Vault vault; - - KeysImpl(KeyAsyncClient client, Vault vault) { - this.inner = client; - this.vault = vault; - } - - @Override - public KeyImpl define(String name) { - return wrapModel(name); - } - - @Override - protected KeyImpl wrapModel(String name) { - return new KeyImpl(name, new KeyProperties(), vault); - } - - @Override - public Key getById(String id) { - return getByIdAsync(id).block(); - } - - @Override - public Mono getByIdAsync(String id) { - String name = nameFromId(id); - String version = versionFromId(id); - return this.getByNameAndVersionAsync(name, version); - } - - @Override - protected KeyImpl wrapModel(KeyProperties keyProperties) { - if (keyProperties == null) { - return null; - } - return new KeyImpl(keyProperties.getName(), keyProperties, vault); - } - - protected KeyImpl wrapModel(KeyVaultKey keyVaultKey) { - if (keyVaultKey == null) { - return null; - } - return new KeyImpl(keyVaultKey.getName(), keyVaultKey, vault); - } - - @Override - public Mono deleteByIdAsync(String id) { - String name = nameFromId(id); - return inner - .beginDeleteKey(name) - .last() - .flatMap( - asyncPollResponse -> { - if (asyncPollResponse.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { - return asyncPollResponse.getFinalResult(); - } else { - return Mono - .error( - new RuntimeException( - "polling completed unsuccessfully with status:" + asyncPollResponse.getStatus())); - } - }); - } - - @Override - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - @Override - public PagedFlux listAsync() { - return PagedConverter.mapPage(inner.listPropertiesOfKeys(), this::wrapModel); - } - - @Override - public Key getByNameAndVersion(String name, String version) { - return getByNameAndVersionAsync(name, version).block(); - } - - @Override - public Mono getByNameAndVersionAsync(final String name, final String version) { - Objects.requireNonNull(name); - return (version == null ? inner.getKey(name) : inner.getKey(name, version)).map(this::wrapModel); - } - - @Override - public Key restore(byte[] backup) { - return restoreAsync(backup).block(); - } - - @Override - public Mono restoreAsync(final byte[] backup) { - return inner.restoreKeyBackup(backup).map(this::wrapModel); - } - - @Override - public Mono getByNameAsync(final String name) { - return inner.getKey(name).map(this::wrapModel); - } - - @Override - public Key getByName(String name) { - return getByNameAsync(name).block(); - } - - private static String nameFromId(String id) { - try { - URL url = new URL(id); - String[] tokens = url.getPath().split("/"); - String name = (tokens.length >= 3 ? tokens[2] : null); - return name; - } catch (MalformedURLException e) { - // Should never come here. - throw new IllegalStateException("Received Malformed Id URL from KV Service"); - } - } - - private static String versionFromId(String id) { - try { - URL url = new URL(id); - String[] tokens = url.getPath().split("/"); - String version = (tokens.length >= 4 ? tokens[3] : null); - return version; - } catch (MalformedURLException e) { - // Should never come here. - throw new IllegalStateException("Received Malformed Id URL from KV Service"); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/OperationsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/OperationsClientImpl.java deleted file mode 100644 index 5ab639126e3e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/OperationsClientImpl.java +++ /dev/null @@ -1,269 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.keyvault.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.keyvault.fluent.OperationsClient; -import com.azure.resourcemanager.keyvault.fluent.models.OperationInner; -import com.azure.resourcemanager.keyvault.models.OperationListResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in OperationsClient. */ -public final class OperationsClientImpl implements OperationsClient { - private final ClientLogger logger = new ClientLogger(OperationsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final OperationsService service; - - /** The service client containing this operation class. */ - private final KeyVaultManagementClientImpl client; - - /** - * Initializes an instance of OperationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - OperationsClientImpl(KeyVaultManagementClientImpl client) { - this.service = - RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for KeyVaultManagementClientOperations to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "KeyVaultManagementCl") - private interface OperationsService { - @Headers({"Content-Type: application/json"}) - @Get("/providers/Microsoft.KeyVault/operations") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Lists all of the available Key Vault Rest API operations. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Storage operations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all of the available Key Vault Rest API operations. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Storage operations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists all of the available Key Vault Rest API operations. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Storage operations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists all of the available Key Vault Rest API operations. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Storage operations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all of the available Key Vault Rest API operations. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Storage operations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Lists all of the available Key Vault Rest API operations. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Storage operations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Storage operations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Storage operations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/PrivateEndpointConnectionsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/PrivateEndpointConnectionsClientImpl.java deleted file mode 100644 index 44b73d3ee54b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/PrivateEndpointConnectionsClientImpl.java +++ /dev/null @@ -1,765 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.keyvault.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.keyvault.fluent.PrivateEndpointConnectionsClient; -import com.azure.resourcemanager.keyvault.fluent.models.PrivateEndpointConnectionInner; -import com.azure.resourcemanager.keyvault.models.PrivateEndpointConnectionsPutResponse; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. */ -public final class PrivateEndpointConnectionsClientImpl implements PrivateEndpointConnectionsClient { - private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final PrivateEndpointConnectionsService service; - - /** The service client containing this operation class. */ - private final KeyVaultManagementClientImpl client; - - /** - * Initializes an instance of PrivateEndpointConnectionsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - PrivateEndpointConnectionsClientImpl(KeyVaultManagementClientImpl client) { - this.service = - RestProxy - .create( - PrivateEndpointConnectionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for KeyVaultManagementClientPrivateEndpointConnections to be used by the - * proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "KeyVaultManagementCl") - private interface PrivateEndpointConnectionsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults" - + "/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vaultName") String vaultName, - @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults" - + "/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono put( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vaultName") String vaultName, - @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") PrivateEndpointConnectionInner properties, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults" - + "/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vaultName") String vaultName, - @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets the specified private endpoint connection associated with the key vault. - * - * @param resourceGroupName Name of the resource group that contains the key vault. - * @param vaultName The name of the key vault. - * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private endpoint connection associated with the key vault. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String resourceGroupName, String vaultName, String privateEndpointConnectionName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vaultName == null) { - return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); - } - if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - vaultName, - privateEndpointConnectionName, - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the specified private endpoint connection associated with the key vault. - * - * @param resourceGroupName Name of the resource group that contains the key vault. - * @param vaultName The name of the key vault. - * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private endpoint connection associated with the key vault. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String vaultName, String privateEndpointConnectionName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vaultName == null) { - return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); - } - if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - vaultName, - privateEndpointConnectionName, - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets the specified private endpoint connection associated with the key vault. - * - * @param resourceGroupName Name of the resource group that contains the key vault. - * @param vaultName The name of the key vault. - * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private endpoint connection associated with the key vault. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync( - String resourceGroupName, String vaultName, String privateEndpointConnectionName) { - return getWithResponseAsync(resourceGroupName, vaultName, privateEndpointConnectionName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the specified private endpoint connection associated with the key vault. - * - * @param resourceGroupName Name of the resource group that contains the key vault. - * @param vaultName The name of the key vault. - * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private endpoint connection associated with the key vault. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateEndpointConnectionInner get( - String resourceGroupName, String vaultName, String privateEndpointConnectionName) { - return getAsync(resourceGroupName, vaultName, privateEndpointConnectionName).block(); - } - - /** - * Gets the specified private endpoint connection associated with the key vault. - * - * @param resourceGroupName Name of the resource group that contains the key vault. - * @param vaultName The name of the key vault. - * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private endpoint connection associated with the key vault. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String vaultName, String privateEndpointConnectionName, Context context) { - return getWithResponseAsync(resourceGroupName, vaultName, privateEndpointConnectionName, context).block(); - } - - /** - * Updates the specified private endpoint connection associated with the key vault. - * - * @param resourceGroupName Name of the resource group that contains the key vault. - * @param vaultName The name of the key vault. - * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. - * @param properties The intended state of private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private endpoint connection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono putWithResponseAsync( - String resourceGroupName, - String vaultName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner properties) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vaultName == null) { - return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); - } - if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); - } - if (properties == null) { - return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); - } else { - properties.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .put( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - vaultName, - privateEndpointConnectionName, - this.client.getApiVersion(), - properties, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates the specified private endpoint connection associated with the key vault. - * - * @param resourceGroupName Name of the resource group that contains the key vault. - * @param vaultName The name of the key vault. - * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. - * @param properties The intended state of private endpoint connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private endpoint connection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono putWithResponseAsync( - String resourceGroupName, - String vaultName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner properties, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vaultName == null) { - return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); - } - if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); - } - if (properties == null) { - return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); - } else { - properties.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .put( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - vaultName, - privateEndpointConnectionName, - this.client.getApiVersion(), - properties, - accept, - context); - } - - /** - * Updates the specified private endpoint connection associated with the key vault. - * - * @param resourceGroupName Name of the resource group that contains the key vault. - * @param vaultName The name of the key vault. - * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. - * @param properties The intended state of private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private endpoint connection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono putAsync( - String resourceGroupName, - String vaultName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner properties) { - return putWithResponseAsync(resourceGroupName, vaultName, privateEndpointConnectionName, properties) - .flatMap( - (PrivateEndpointConnectionsPutResponse res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Updates the specified private endpoint connection associated with the key vault. - * - * @param resourceGroupName Name of the resource group that contains the key vault. - * @param vaultName The name of the key vault. - * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. - * @param properties The intended state of private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private endpoint connection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateEndpointConnectionInner put( - String resourceGroupName, - String vaultName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner properties) { - return putAsync(resourceGroupName, vaultName, privateEndpointConnectionName, properties).block(); - } - - /** - * Updates the specified private endpoint connection associated with the key vault. - * - * @param resourceGroupName Name of the resource group that contains the key vault. - * @param vaultName The name of the key vault. - * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. - * @param properties The intended state of private endpoint connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private endpoint connection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateEndpointConnectionsPutResponse putWithResponse( - String resourceGroupName, - String vaultName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner properties, - Context context) { - return putWithResponseAsync(resourceGroupName, vaultName, privateEndpointConnectionName, properties, context) - .block(); - } - - /** - * Deletes the specified private endpoint connection associated with the key vault. - * - * @param resourceGroupName Name of the resource group that contains the key vault. - * @param vaultName The name of the key vault. - * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private endpoint connection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync( - String resourceGroupName, String vaultName, String privateEndpointConnectionName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vaultName == null) { - return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); - } - if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - vaultName, - privateEndpointConnectionName, - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the specified private endpoint connection associated with the key vault. - * - * @param resourceGroupName Name of the resource group that contains the key vault. - * @param vaultName The name of the key vault. - * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private endpoint connection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String vaultName, String privateEndpointConnectionName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vaultName == null) { - return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); - } - if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - vaultName, - privateEndpointConnectionName, - this.client.getApiVersion(), - accept, - context); - } - - /** - * Deletes the specified private endpoint connection associated with the key vault. - * - * @param resourceGroupName Name of the resource group that contains the key vault. - * @param vaultName The name of the key vault. - * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private endpoint connection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, PrivateEndpointConnectionInner> beginDeleteAsync( - String resourceGroupName, String vaultName, String privateEndpointConnectionName) { - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, vaultName, privateEndpointConnectionName); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - PrivateEndpointConnectionInner.class, - PrivateEndpointConnectionInner.class, - Context.NONE); - } - - /** - * Deletes the specified private endpoint connection associated with the key vault. - * - * @param resourceGroupName Name of the resource group that contains the key vault. - * @param vaultName The name of the key vault. - * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private endpoint connection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, PrivateEndpointConnectionInner> beginDeleteAsync( - String resourceGroupName, String vaultName, String privateEndpointConnectionName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, vaultName, privateEndpointConnectionName, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - PrivateEndpointConnectionInner.class, - PrivateEndpointConnectionInner.class, - context); - } - - /** - * Deletes the specified private endpoint connection associated with the key vault. - * - * @param resourceGroupName Name of the resource group that contains the key vault. - * @param vaultName The name of the key vault. - * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private endpoint connection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, PrivateEndpointConnectionInner> beginDelete( - String resourceGroupName, String vaultName, String privateEndpointConnectionName) { - return beginDeleteAsync(resourceGroupName, vaultName, privateEndpointConnectionName).getSyncPoller(); - } - - /** - * Deletes the specified private endpoint connection associated with the key vault. - * - * @param resourceGroupName Name of the resource group that contains the key vault. - * @param vaultName The name of the key vault. - * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private endpoint connection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, PrivateEndpointConnectionInner> beginDelete( - String resourceGroupName, String vaultName, String privateEndpointConnectionName, Context context) { - return beginDeleteAsync(resourceGroupName, vaultName, privateEndpointConnectionName, context).getSyncPoller(); - } - - /** - * Deletes the specified private endpoint connection associated with the key vault. - * - * @param resourceGroupName Name of the resource group that contains the key vault. - * @param vaultName The name of the key vault. - * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private endpoint connection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync( - String resourceGroupName, String vaultName, String privateEndpointConnectionName) { - return beginDeleteAsync(resourceGroupName, vaultName, privateEndpointConnectionName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified private endpoint connection associated with the key vault. - * - * @param resourceGroupName Name of the resource group that contains the key vault. - * @param vaultName The name of the key vault. - * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private endpoint connection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync( - String resourceGroupName, String vaultName, String privateEndpointConnectionName, Context context) { - return beginDeleteAsync(resourceGroupName, vaultName, privateEndpointConnectionName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified private endpoint connection associated with the key vault. - * - * @param resourceGroupName Name of the resource group that contains the key vault. - * @param vaultName The name of the key vault. - * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private endpoint connection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateEndpointConnectionInner delete( - String resourceGroupName, String vaultName, String privateEndpointConnectionName) { - return deleteAsync(resourceGroupName, vaultName, privateEndpointConnectionName).block(); - } - - /** - * Deletes the specified private endpoint connection associated with the key vault. - * - * @param resourceGroupName Name of the resource group that contains the key vault. - * @param vaultName The name of the key vault. - * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private endpoint connection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateEndpointConnectionInner delete( - String resourceGroupName, String vaultName, String privateEndpointConnectionName, Context context) { - return deleteAsync(resourceGroupName, vaultName, privateEndpointConnectionName, context).block(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/PrivateLinkResourcesClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/PrivateLinkResourcesClientImpl.java deleted file mode 100644 index 0d8b179466c6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/PrivateLinkResourcesClientImpl.java +++ /dev/null @@ -1,222 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.keyvault.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.keyvault.fluent.PrivateLinkResourcesClient; -import com.azure.resourcemanager.keyvault.fluent.models.PrivateLinkResourceListResultInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. */ -public final class PrivateLinkResourcesClientImpl implements PrivateLinkResourcesClient { - private final ClientLogger logger = new ClientLogger(PrivateLinkResourcesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final PrivateLinkResourcesService service; - - /** The service client containing this operation class. */ - private final KeyVaultManagementClientImpl client; - - /** - * Initializes an instance of PrivateLinkResourcesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - PrivateLinkResourcesClientImpl(KeyVaultManagementClientImpl client) { - this.service = - RestProxy - .create(PrivateLinkResourcesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for KeyVaultManagementClientPrivateLinkResources to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "KeyVaultManagementCl") - private interface PrivateLinkResourcesService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults" - + "/{vaultName}/privateLinkResources") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByVault( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vaultName") String vaultName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets the private link resources supported for the key vault. - * - * @param resourceGroupName Name of the resource group that contains the key vault. - * @param vaultName The name of the key vault. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources supported for the key vault. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listByVaultWithResponseAsync( - String resourceGroupName, String vaultName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vaultName == null) { - return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByVault( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - vaultName, - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the private link resources supported for the key vault. - * - * @param resourceGroupName Name of the resource group that contains the key vault. - * @param vaultName The name of the key vault. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources supported for the key vault. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByVaultWithResponseAsync( - String resourceGroupName, String vaultName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vaultName == null) { - return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByVault( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - vaultName, - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets the private link resources supported for the key vault. - * - * @param resourceGroupName Name of the resource group that contains the key vault. - * @param vaultName The name of the key vault. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources supported for the key vault. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listByVaultAsync(String resourceGroupName, String vaultName) { - return listByVaultWithResponseAsync(resourceGroupName, vaultName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the private link resources supported for the key vault. - * - * @param resourceGroupName Name of the resource group that contains the key vault. - * @param vaultName The name of the key vault. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources supported for the key vault. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateLinkResourceListResultInner listByVault(String resourceGroupName, String vaultName) { - return listByVaultAsync(resourceGroupName, vaultName).block(); - } - - /** - * Gets the private link resources supported for the key vault. - * - * @param resourceGroupName Name of the resource group that contains the key vault. - * @param vaultName The name of the key vault. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources supported for the key vault. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listByVaultWithResponse( - String resourceGroupName, String vaultName, Context context) { - return listByVaultWithResponseAsync(resourceGroupName, vaultName, context).block(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/SecretImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/SecretImpl.java deleted file mode 100644 index c82dd6f664b5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/SecretImpl.java +++ /dev/null @@ -1,179 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.keyvault.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.keyvault.models.Secret; -import com.azure.resourcemanager.keyvault.models.Vault; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.CreatableUpdatableImpl; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import com.azure.security.keyvault.secrets.models.KeyVaultSecret; -import com.azure.security.keyvault.secrets.models.SecretProperties; -import java.util.Map; -import java.util.Objects; -import reactor.core.publisher.Mono; -import com.azure.resourcemanager.resources.fluentcore.utils.PagedConverter; - -/** Implementation for Vault and its parent interfaces. */ -class SecretImpl extends CreatableUpdatableImpl - implements Secret, Secret.Definition, Secret.Update { - - private final Vault vault; - - private String secretValueToSet; - - private String secretValue; - - SecretImpl(String name, SecretProperties innerObject, Vault vault) { - super(name, innerObject); - this.vault = vault; - } - - SecretImpl(String name, KeyVaultSecret keyVaultSecret, Vault vault) { - super(name, keyVaultSecret.getProperties()); - this.secretValue = keyVaultSecret.getValue(); - this.vault = vault; - } - - private SecretImpl wrapModel(SecretProperties secret) { - return new SecretImpl(secret.getName(), secret, vault); - } - - @Override - public String id() { - return innerModel().getId(); - } - - @Override - public String getValue() { - return getValueAsync().block(); - } - - @Override - public Mono getValueAsync() { - if (secretValue != null) { - return Mono.just(secretValue); - } else { - return getInnerAsync().map(ignored -> secretValue); - } - } - - @Override - public SecretProperties attributes() { - return innerModel(); - } - - @Override - public Map tags() { - return innerModel().getTags(); - } - - @Override - public String contentType() { - return innerModel().getContentType(); - } - - @Override - public String kid() { - return innerModel().getKeyId(); - } - - @Override - public boolean managed() { - return ResourceManagerUtils.toPrimitiveBoolean(innerModel().isManaged()); - } - - @Override - public boolean enabled() { - return ResourceManagerUtils.toPrimitiveBoolean(innerModel().isEnabled()); - } - - @Override - public PagedIterable listVersions() { - return new PagedIterable<>(this.listVersionsAsync()); - } - - @Override - public PagedFlux listVersionsAsync() { - return PagedConverter.mapPage(vault - .secretClient() - .listPropertiesOfSecretVersions(name()), - this::wrapModel); - } - - @Override - protected Mono getInnerAsync() { - return vault.secretClient().getSecret(name(), innerModel().getVersion()).map(secret -> { - this.secretValue = secret.getValue(); - return secret.getProperties(); - }); - } - - @Override - public SecretImpl withTags(Map tags) { - this.innerModel().setTags(tags); - return this; - } - - @Override - public boolean isInCreateMode() { - return id() == null; - } - - @Override - public Mono createResourceAsync() { - KeyVaultSecret newSecret = new KeyVaultSecret(this.name(), secretValueToSet); - newSecret.setProperties(this.attributes()); - return vault - .secretClient() - .setSecret(newSecret) - .map( - keyVaultSecret -> { - this.setInner(keyVaultSecret.getProperties()); - this.secretValue = keyVaultSecret.getValue(); - secretValueToSet = null; - return this; - }); - } - - @Override - public Mono updateResourceAsync() { - if (secretValueToSet == null) { - // if no update on value, just update properties - return vault - .secretClient() - .updateSecretProperties(this.innerModel()) - .map( - p -> { - this.setInner(p); - if (!p.isEnabled()) { - secretValue = null; - } - return this; - }); - } else { - return this.createResourceAsync(); - } - } - - @Override - public SecretImpl withAttributes(SecretProperties attributes) { - this.setInner(attributes); - return this; - } - - @Override - public SecretImpl withValue(String value) { - Objects.requireNonNull(value); - secretValueToSet = value; - return this; - } - - @Override - public SecretImpl withContentType(String contentType) { - this.innerModel().setContentType(contentType); - return this; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/SecretsImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/SecretsImpl.java deleted file mode 100644 index fef022b714bf..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/SecretsImpl.java +++ /dev/null @@ -1,198 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.keyvault.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.CoreUtils; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.LongRunningOperationStatus; -import com.azure.core.util.serializer.JacksonAdapter; -import com.azure.core.util.serializer.SerializerAdapter; -import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.resourcemanager.keyvault.models.Secret; -import com.azure.resourcemanager.keyvault.models.Secrets; -import com.azure.resourcemanager.keyvault.models.Vault; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.CreatableWrappersImpl; -import com.azure.security.keyvault.secrets.SecretAsyncClient; -import com.azure.security.keyvault.secrets.models.KeyVaultSecret; - -import java.io.IOException; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; - -import com.azure.security.keyvault.secrets.models.SecretProperties; -import reactor.core.publisher.Mono; -import com.azure.resourcemanager.resources.fluentcore.utils.PagedConverter; - -/** The implementation of Secrets and its parent interfaces. */ -class SecretsImpl extends CreatableWrappersImpl implements Secrets { - private final SecretAsyncClient inner; - private final Vault vault; - - private final ClientLogger logger = new ClientLogger(SecretsImpl.class); - - SecretsImpl(SecretAsyncClient client, Vault vault) { - this.inner = client; - this.vault = vault; - } - - @Override - public SecretImpl define(String name) { - return wrapModel(name); - } - - @Override - protected SecretImpl wrapModel(String name) { - return new SecretImpl(name, new SecretProperties(), vault); - } - - @Override - public Secret getById(String id) { - return getByIdAsync(id).block(); - } - - @Override - public Mono getByIdAsync(String id) { - String name = nameFromId(id); - String version = versionFromId(id); - return this.getByNameAndVersionAsync(name, version); - } - - @Override - protected SecretImpl wrapModel(SecretProperties secretProperties) { - if (secretProperties == null) { - return null; - } - return new SecretImpl(secretProperties.getName(), secretProperties, vault); - } - - protected SecretImpl wrapModel(KeyVaultSecret keyVaultSecret) { - if (keyVaultSecret == null) { - return null; - } - return new SecretImpl(keyVaultSecret.getName(), keyVaultSecret, vault); - } - - @Override - public Mono deleteByIdAsync(String id) { - String name = nameFromId(id); - return inner - .beginDeleteSecret(name) - .last() - .flatMap( - asyncPollResponse -> { - if (asyncPollResponse.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { - return asyncPollResponse.getFinalResult(); - } else { - return Mono - .error( - new RuntimeException( - "polling completed unsuccessfully with status:" + asyncPollResponse.getStatus())); - } - }); - } - - @Override - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - @Override - public PagedFlux listAsync() { - return PagedConverter.mapPage(inner.listPropertiesOfSecrets(), this::wrapModel); - } - - @Override - public Mono getByNameAsync(final String name) { - return inner.getSecret(name).map(this::wrapModel); - } - - @Override - public Secret getByName(String name) { - return getByNameAsync(name).block(); - } - - @Override - public Secret getByNameAndVersion(String name, String version) { - return getByNameAndVersionAsync(name, version).block(); - } - - @Override - public Mono getByNameAndVersionAsync(final String name, final String version) { - Objects.requireNonNull(name); - return (version == null ? inner.getSecret(name) : inner.getSecret(name, version)).map(this::wrapModel); - } - - @Override - public Secret enableByNameAndVersion(String name, String version) { - return enableByNameAndVersionAsync(name, version).block(); - } - - @Override - public Mono enableByNameAndVersionAsync(String name, String version) { - Objects.requireNonNull(name); - return updateSecretEnableDisableAsync(name, version, true); - } - - @Override - public void disableByNameAndVersion(String name, String version) { - disableByNameAndVersionAsync(name, version).block(); - } - - @Override - public Mono disableByNameAndVersionAsync(String name, String version) { - Objects.requireNonNull(name); - return updateSecretEnableDisableAsync(name, version, false).then(); - } - - private Mono updateSecretEnableDisableAsync(String name, String version, boolean enabled) { - try { - // create SecretProperties with name and version via JSON serialization. - String mockId = "https://mock.vault.azure.net/secrets/" + name; - if (!CoreUtils.isNullOrEmpty(version)) { - mockId += "/" + version; - } - Map mockSecret = new HashMap<>(); - mockSecret.put("id", mockId); - SerializerAdapter serializerAdapter = JacksonAdapter.createDefaultSerializerAdapter(); - String json = serializerAdapter.serialize(mockSecret, SerializerEncoding.JSON); - SecretProperties secretProperties = serializerAdapter.deserialize(json, SecretProperties.class, - SerializerEncoding.JSON); - - secretProperties.setEnabled(enabled); - - return vault.secretClient().updateSecretProperties(secretProperties).map(this::wrapModel); - } catch (IOException ioe) { - throw logger.logExceptionAsError(new RuntimeException(ioe)); - } - } - - private static String nameFromId(String id) { - try { - URL url = new URL(id); - String[] tokens = url.getPath().split("/"); - String name = (tokens.length >= 3 ? tokens[2] : null); - return name; - } catch (MalformedURLException e) { - // Should never come here. - throw new IllegalStateException("Received Malformed Id URL from KV Service"); - } - } - - private static String versionFromId(String id) { - try { - URL url = new URL(id); - String[] tokens = url.getPath().split("/"); - String version = (tokens.length >= 4 ? tokens[3] : null); - return version; - } catch (MalformedURLException e) { - // Should never come here. - throw new IllegalStateException("Received Malformed Id URL from KV Service"); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/VaultImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/VaultImpl.java deleted file mode 100644 index deade632bafb..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/VaultImpl.java +++ /dev/null @@ -1,572 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.keyvault.implementation; - -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.authorization.AuthorizationManager; -import com.azure.resourcemanager.keyvault.KeyVaultManager; -import com.azure.resourcemanager.keyvault.fluent.VaultsClient; -import com.azure.resourcemanager.keyvault.fluent.models.PrivateEndpointConnectionInner; -import com.azure.resourcemanager.keyvault.fluent.models.VaultInner; -import com.azure.resourcemanager.keyvault.models.AccessPolicy; -import com.azure.resourcemanager.keyvault.models.AccessPolicyEntry; -import com.azure.resourcemanager.keyvault.models.CreateMode; -import com.azure.resourcemanager.keyvault.models.IpRule; -import com.azure.resourcemanager.keyvault.models.Keys; -import com.azure.resourcemanager.keyvault.models.NetworkRuleAction; -import com.azure.resourcemanager.keyvault.models.NetworkRuleBypassOptions; -import com.azure.resourcemanager.keyvault.models.NetworkRuleSet; -import com.azure.resourcemanager.keyvault.models.PrivateEndpointServiceConnectionStatus; -import com.azure.resourcemanager.keyvault.models.PrivateLinkServiceConnectionState; -import com.azure.resourcemanager.keyvault.models.Secrets; -import com.azure.resourcemanager.keyvault.models.Sku; -import com.azure.resourcemanager.keyvault.models.SkuFamily; -import com.azure.resourcemanager.keyvault.models.SkuName; -import com.azure.resourcemanager.keyvault.models.Vault; -import com.azure.resourcemanager.keyvault.models.VaultCreateOrUpdateParameters; -import com.azure.resourcemanager.keyvault.models.VaultProperties; -import com.azure.resourcemanager.keyvault.models.VirtualNetworkRule; -import com.azure.resourcemanager.resources.fluentcore.arm.models.PrivateLinkResource; -import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.GroupableResourceImpl; -import com.azure.resourcemanager.resources.fluentcore.utils.PagedConverter; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import com.azure.security.keyvault.keys.KeyAsyncClient; -import com.azure.security.keyvault.keys.KeyClientBuilder; -import com.azure.security.keyvault.keys.KeyServiceVersion; -import com.azure.security.keyvault.secrets.SecretAsyncClient; -import com.azure.security.keyvault.secrets.SecretClientBuilder; -import com.azure.security.keyvault.secrets.SecretServiceVersion; -import reactor.core.publisher.Mono; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import java.util.NoSuchElementException; -import java.util.stream.Collectors; - -/** Implementation for Vault and its parent interfaces. */ -class VaultImpl extends GroupableResourceImpl - implements Vault, Vault.Definition, Vault.Update { - - private final ClientLogger logger = new ClientLogger(this.getClass()); - - private AuthorizationManager authorizationManager; - private List accessPolicies; - - private SecretAsyncClient secretClient; - private KeyAsyncClient keyClient; - private HttpPipeline vaultHttpPipeline; - - private Keys keys; - private Secrets secrets; - - VaultImpl(String key, VaultInner innerObject, KeyVaultManager manager, AuthorizationManager authorizationManager) { - super(key, innerObject, manager); - this.authorizationManager = authorizationManager; - this.accessPolicies = new ArrayList<>(); - if (innerObject != null - && innerObject.properties() != null - && innerObject.properties().accessPolicies() != null) { - for (AccessPolicyEntry entry : innerObject.properties().accessPolicies()) { - this.accessPolicies.add(new AccessPolicyImpl(entry, this)); - } - } - - vaultHttpPipeline = manager().httpPipeline(); - init(); - } - - private void init() { - if (innerModel().properties().vaultUri() != null) { - final String vaultUrl = vaultUri(); - this.secretClient = - new SecretClientBuilder() - .vaultUrl(vaultUrl) - .serviceVersion(SecretServiceVersion.V7_1) - .pipeline(vaultHttpPipeline) - .buildAsyncClient(); - this.keyClient = - new KeyClientBuilder() - .vaultUrl(vaultUrl) - .serviceVersion(KeyServiceVersion.V7_1) - .pipeline(vaultHttpPipeline) - .buildAsyncClient(); - } - } - - @Override - public HttpPipeline vaultHttpPipeline() { - return vaultHttpPipeline; - } - - public SecretAsyncClient secretClient() { - return secretClient; - } - - @Override - public KeyAsyncClient keyClient() { - return keyClient; - } - - @Override - public Keys keys() { - if (keys == null) { - keys = new KeysImpl(keyClient, this); - } - return keys; - } - - @Override - public Secrets secrets() { - if (secrets == null) { - secrets = new SecretsImpl(secretClient, this); - } - return secrets; - } - - @Override - public String vaultUri() { - if (innerModel().properties() == null) { - return null; - } - return innerModel().properties().vaultUri(); - } - - @Override - public String tenantId() { - if (innerModel().properties() == null) { - return null; - } - if (innerModel().properties().tenantId() == null) { - return null; - } - return innerModel().properties().tenantId().toString(); - } - - @Override - public Sku sku() { - if (innerModel().properties() == null) { - return null; - } - return innerModel().properties().sku(); - } - - @Override - public List accessPolicies() { - AccessPolicy[] array = new AccessPolicy[accessPolicies.size()]; - return Arrays.asList(accessPolicies.toArray(array)); - } - - @Override - public boolean roleBasedAccessControlEnabled() { - if (innerModel().properties() == null) { - return false; - } - return ResourceManagerUtils.toPrimitiveBoolean(innerModel().properties().enableRbacAuthorization()); - } - - @Override - public boolean enabledForDeployment() { - if (innerModel().properties() == null) { - return false; - } - return ResourceManagerUtils.toPrimitiveBoolean(innerModel().properties().enabledForDeployment()); - } - - @Override - public boolean enabledForDiskEncryption() { - if (innerModel().properties() == null) { - return false; - } - return ResourceManagerUtils.toPrimitiveBoolean(innerModel().properties().enabledForDiskEncryption()); - } - - @Override - public boolean enabledForTemplateDeployment() { - if (innerModel().properties() == null) { - return false; - } - return ResourceManagerUtils.toPrimitiveBoolean(innerModel().properties().enabledForTemplateDeployment()); - } - - @Override - public boolean softDeleteEnabled() { - if (innerModel().properties() == null) { - return false; - } - return ResourceManagerUtils.toPrimitiveBoolean(innerModel().properties().enableSoftDelete()); - } - - @Override - public boolean purgeProtectionEnabled() { - if (innerModel().properties() == null) { - return false; - } - return ResourceManagerUtils.toPrimitiveBoolean(innerModel().properties().enablePurgeProtection()); - } - - @Override - public VaultImpl withEmptyAccessPolicy() { - this.accessPolicies = new ArrayList<>(); - return this; - } - - @Override - public VaultImpl withoutAccessPolicy(String objectId) { - for (AccessPolicyImpl entry : this.accessPolicies) { - if (entry.objectId().equals(objectId)) { - accessPolicies.remove(entry); - break; - } - } - return this; - } - - @Override - public VaultImpl withAccessPolicy(AccessPolicy accessPolicy) { - accessPolicies.add((AccessPolicyImpl) accessPolicy); - return this; - } - - @Override - public AccessPolicyImpl defineAccessPolicy() { - return new AccessPolicyImpl(new AccessPolicyEntry(), this); - } - - @Override - public VaultImpl withRoleBasedAccessControl() { - innerModel().properties().withEnableRbacAuthorization(true); - return this; - } - - @Override - public VaultImpl withoutRoleBasedAccessControl() { - innerModel().properties().withEnableRbacAuthorization(false); - return this; - } - - @Override - public AccessPolicyImpl updateAccessPolicy(String objectId) { - for (AccessPolicyImpl entry : this.accessPolicies) { - if (entry.objectId().equals(objectId)) { - return entry; - } - } - throw logger.logExceptionAsError( - new NoSuchElementException(String.format("Identity %s not found in the access policies.", objectId))); - } - - @Override - public VaultImpl withDeploymentEnabled() { - innerModel().properties().withEnabledForDeployment(true); - return this; - } - - @Override - public VaultImpl withDiskEncryptionEnabled() { - innerModel().properties().withEnabledForDiskEncryption(true); - return this; - } - - @Override - public VaultImpl withTemplateDeploymentEnabled() { - innerModel().properties().withEnabledForTemplateDeployment(true); - return this; - } - - @Override - public VaultImpl withSoftDeleteEnabled() { - innerModel().properties().withEnableSoftDelete(true); - return this; - } - - @Override - public VaultImpl withPurgeProtectionEnabled() { - innerModel().properties().withEnablePurgeProtection(true); - return this; - } - - @Override - public VaultImpl withDeploymentDisabled() { - innerModel().properties().withEnabledForDeployment(false); - return this; - } - - @Override - public VaultImpl withDiskEncryptionDisabled() { - innerModel().properties().withEnabledForDiskEncryption(false); - return this; - } - - @Override - public VaultImpl withTemplateDeploymentDisabled() { - innerModel().properties().withEnabledForTemplateDeployment(false); - return this; - } - - @Override - public VaultImpl withSku(SkuName skuName) { - if (innerModel().properties() == null) { - innerModel().withProperties(new VaultProperties()); - } - innerModel().properties().withSku(new Sku().withName(skuName).withFamily(SkuFamily.A)); - return this; - } - - private Mono> populateAccessPolicies() { - List> observables = new ArrayList<>(); - for (final AccessPolicyImpl accessPolicy : accessPolicies) { - if (accessPolicy.objectId() == null) { - if (accessPolicy.userPrincipalName() != null) { - observables - .add( - authorizationManager - .users() - .getByNameAsync(accessPolicy.userPrincipalName()) - .subscribeOn(ResourceManagerUtils.InternalRuntimeContext.getReactorScheduler()) - .doOnNext(user -> accessPolicy.forObjectId(user.id())) - .switchIfEmpty( - Mono - .error( - new ManagementException( - String - .format( - "User principal name %s is not found in tenant %s", - accessPolicy.userPrincipalName(), - authorizationManager.tenantId()), - null)))); - } else if (accessPolicy.servicePrincipalName() != null) { - observables - .add( - authorizationManager - .servicePrincipals() - .getByNameAsync(accessPolicy.servicePrincipalName()) - .subscribeOn(ResourceManagerUtils.InternalRuntimeContext.getReactorScheduler()) - .doOnNext(sp -> accessPolicy.forObjectId(sp.id())) - .switchIfEmpty( - Mono - .error( - new ManagementException( - String - .format( - "Service principal name %s is not found in tenant %s", - accessPolicy.servicePrincipalName(), - authorizationManager.tenantId()), - null)))); - } else { - throw logger.logExceptionAsError( - new IllegalArgumentException("Access policy must specify object ID.")); - } - } - } - if (observables.isEmpty()) { - return Mono.just(accessPolicies()); - } else { - return Mono.zip(observables, args -> accessPolicies()); - } - } - - @Override - public Mono createResourceAsync() { - final VaultsClient client = this.manager().serviceClient().getVaults(); - return populateAccessPolicies() - .then( - Mono - .defer( - () -> { - VaultCreateOrUpdateParameters parameters = new VaultCreateOrUpdateParameters(); - parameters.withLocation(regionName()); - parameters.withProperties(innerModel().properties()); - parameters.withTags(innerModel().tags()); - parameters.properties().withAccessPolicies(new ArrayList<>()); - for (AccessPolicy accessPolicy : accessPolicies) { - parameters.properties().accessPolicies().add(accessPolicy.innerModel()); - } - return client.createOrUpdateAsync(resourceGroupName(), this.name(), parameters); - })) - .map( - inner -> { - this.setInner(inner); - init(); - return this; - }); - } - - @Override - protected Mono getInnerAsync() { - return this.manager().serviceClient().getVaults().getByResourceGroupAsync(resourceGroupName(), this.name()); - } - - @Override - public CreateMode createMode() { - return innerModel().properties().createMode(); - } - - @Override - public NetworkRuleSet networkRuleSet() { - return innerModel().properties().networkAcls(); - } - - @Override - public VaultImpl withAccessFromAllNetworks() { - if (innerModel().properties().networkAcls() == null) { - innerModel().properties().withNetworkAcls(new NetworkRuleSet()); - } - innerModel().properties().networkAcls().withDefaultAction(NetworkRuleAction.ALLOW); - return this; - } - - @Override - public VaultImpl withAccessFromSelectedNetworks() { - if (innerModel().properties().networkAcls() == null) { - innerModel().properties().withNetworkAcls(new NetworkRuleSet()); - } - innerModel().properties().networkAcls().withDefaultAction(NetworkRuleAction.DENY); - return this; - } - - /** - * Specifies that access to the storage account should be allowed from the given ip address or ip address range. - * - * @param ipAddressOrRange the ip address or ip address range in cidr format - * @return VaultImpl - */ - private VaultImpl withAccessAllowedFromIpAddressOrRange(String ipAddressOrRange) { - NetworkRuleSet networkRuleSet = innerModel().properties().networkAcls(); - if (networkRuleSet.ipRules() == null) { - networkRuleSet.withIpRules(new ArrayList<>()); - } - boolean found = false; - for (IpRule rule : networkRuleSet.ipRules()) { - if (rule.value().equalsIgnoreCase(ipAddressOrRange)) { - found = true; - break; - } - } - if (!found) { - networkRuleSet.ipRules().add(new IpRule().withValue(ipAddressOrRange)); - } - return this; - } - - @Override - public VaultImpl withAccessFromIpAddress(String ipAddress) { - return withAccessAllowedFromIpAddressOrRange(ipAddress); - } - - @Override - public VaultImpl withAccessFromIpAddressRange(String ipAddressCidr) { - return withAccessAllowedFromIpAddressOrRange(ipAddressCidr); - } - - @Override - public VaultImpl withAccessFromAzureServices() { - if (innerModel().properties().networkAcls() == null) { - innerModel().properties().withNetworkAcls(new NetworkRuleSet()); - } - innerModel().properties().networkAcls().withBypass(NetworkRuleBypassOptions.AZURE_SERVICES); - return this; - } - - @Override - public VaultImpl withBypass(NetworkRuleBypassOptions bypass) { - if (innerModel().properties().networkAcls() == null) { - innerModel().properties().withNetworkAcls(new NetworkRuleSet()); - } - innerModel().properties().networkAcls().withBypass(bypass); - return this; - } - - @Override - public VaultImpl withDefaultAction(NetworkRuleAction defaultAction) { - if (innerModel().properties().networkAcls() == null) { - innerModel().properties().withNetworkAcls(new NetworkRuleSet()); - } - innerModel().properties().networkAcls().withDefaultAction(defaultAction); - return this; - } - - @Override - public VaultImpl withVirtualNetworkRules(List virtualNetworkRules) { - if (innerModel().properties().networkAcls() == null) { - innerModel().properties().withNetworkAcls(new NetworkRuleSet()); - } - innerModel().properties().networkAcls().withVirtualNetworkRules(virtualNetworkRules); - return this; - } - - @Override - public PagedIterable listPrivateLinkResources() { - return new PagedIterable<>(listPrivateLinkResourcesAsync()); - } - - @Override - public PagedFlux listPrivateLinkResourcesAsync() { - Mono>> retList = this.manager().serviceClient().getPrivateLinkResources() - .listByVaultWithResponseAsync(this.resourceGroupName(), this.name()) - .map(response -> new SimpleResponse<>(response, response.getValue().value().stream() - .map(PrivateLinkResourceImpl::new) - .collect(Collectors.toList()))); - - return PagedConverter.convertListToPagedFlux(retList); - } - - @Override - public void approvePrivateEndpointConnection(String privateEndpointConnectionName) { - approvePrivateEndpointConnectionAsync(privateEndpointConnectionName).block(); - } - - @Override - public Mono approvePrivateEndpointConnectionAsync(String privateEndpointConnectionName) { - return manager().serviceClient().getPrivateEndpointConnections().putAsync( - this.resourceGroupName(), this.name(), privateEndpointConnectionName, - new PrivateEndpointConnectionInner().withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.APPROVED))) - .then(); - } - - @Override - public void rejectPrivateEndpointConnection(String privateEndpointConnectionName) { - rejectPrivateEndpointConnectionAsync(privateEndpointConnectionName).block(); - } - - @Override - public Mono rejectPrivateEndpointConnectionAsync(String privateEndpointConnectionName) { - return manager().serviceClient().getPrivateEndpointConnections().putAsync( - this.resourceGroupName(), this.name(), privateEndpointConnectionName, - new PrivateEndpointConnectionInner().withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.REJECTED))) - .then(); - } - - private static final class PrivateLinkResourceImpl implements PrivateLinkResource { - private final com.azure.resourcemanager.keyvault.models.PrivateLinkResource innerModel; - - private PrivateLinkResourceImpl(com.azure.resourcemanager.keyvault.models.PrivateLinkResource innerModel) { - this.innerModel = innerModel; - } - - @Override - public String groupId() { - return innerModel.groupId(); - } - - @Override - public List requiredMemberNames() { - return Collections.unmodifiableList(innerModel.requiredMembers()); - } - - @Override - public List requiredDnsZoneNames() { - return Collections.unmodifiableList(innerModel.requiredZoneNames()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/VaultsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/VaultsClientImpl.java deleted file mode 100644 index d84d225a8381..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/VaultsClientImpl.java +++ /dev/null @@ -1,2666 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.keyvault.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.Resource; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.keyvault.fluent.VaultsClient; -import com.azure.resourcemanager.keyvault.fluent.models.CheckNameAvailabilityResultInner; -import com.azure.resourcemanager.keyvault.fluent.models.DeletedVaultInner; -import com.azure.resourcemanager.keyvault.fluent.models.VaultAccessPolicyParametersInner; -import com.azure.resourcemanager.keyvault.fluent.models.VaultInner; -import com.azure.resourcemanager.keyvault.models.AccessPolicyUpdateKind; -import com.azure.resourcemanager.keyvault.models.DeletedVaultListResult; -import com.azure.resourcemanager.keyvault.models.ResourceListResult; -import com.azure.resourcemanager.keyvault.models.VaultAccessPolicyProperties; -import com.azure.resourcemanager.keyvault.models.VaultCheckNameAvailabilityParameters; -import com.azure.resourcemanager.keyvault.models.VaultCreateOrUpdateParameters; -import com.azure.resourcemanager.keyvault.models.VaultListResult; -import com.azure.resourcemanager.keyvault.models.VaultPatchParameters; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in VaultsClient. */ -public final class VaultsClientImpl implements InnerSupportsGet, InnerSupportsDelete, VaultsClient { - private final ClientLogger logger = new ClientLogger(VaultsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final VaultsService service; - - /** The service client containing this operation class. */ - private final KeyVaultManagementClientImpl client; - - /** - * Initializes an instance of VaultsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - VaultsClientImpl(KeyVaultManagementClientImpl client) { - this.service = RestProxy.create(VaultsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for KeyVaultManagementClientVaults to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "KeyVaultManagementCl") - private interface VaultsService { - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults" - + "/{vaultName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vaultName") String vaultName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VaultCreateOrUpdateParameters parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults" - + "/{vaultName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vaultName") String vaultName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VaultPatchParameters parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults" - + "/{vaultName}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vaultName") String vaultName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults" - + "/{vaultName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vaultName") String vaultName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults" - + "/{vaultName}/accessPolicies/{operationKind}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> updateAccessPolicy( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vaultName") String vaultName, - @PathParam("operationKind") AccessPolicyUpdateKind operationKind, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VaultAccessPolicyParametersInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("$top") Integer top, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/vaults") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySubscription( - @HostParam("$host") String endpoint, - @QueryParam("$top") Integer top, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/deletedVaults") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listDeleted( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/locations/{location}/deletedVaults" - + "/{vaultName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getDeleted( - @HostParam("$host") String endpoint, - @PathParam("vaultName") String vaultName, - @PathParam("location") String location, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/locations/{location}/deletedVaults" - + "/{vaultName}/purge") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> purgeDeleted( - @HostParam("$host") String endpoint, - @PathParam("vaultName") String vaultName, - @PathParam("location") String location, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/resources") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("$filter") String filter, - @QueryParam("$top") Integer top, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post("/subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/checkNameAvailability") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> checkNameAvailability( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VaultCheckNameAvailabilityParameters vaultName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listDeletedNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Create or update a key vault in the specified subscription. - * - * @param resourceGroupName The name of the Resource Group to which the server belongs. - * @param vaultName Name of the vault. - * @param parameters Parameters to create or update the vault. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information with extended details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String vaultName, VaultCreateOrUpdateParameters parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vaultName == null) { - return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - vaultName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create or update a key vault in the specified subscription. - * - * @param resourceGroupName The name of the Resource Group to which the server belongs. - * @param vaultName Name of the vault. - * @param parameters Parameters to create or update the vault. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information with extended details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String vaultName, VaultCreateOrUpdateParameters parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vaultName == null) { - return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - vaultName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Create or update a key vault in the specified subscription. - * - * @param resourceGroupName The name of the Resource Group to which the server belongs. - * @param vaultName Name of the vault. - * @param parameters Parameters to create or update the vault. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information with extended details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, VaultInner> beginCreateOrUpdateAsync( - String resourceGroupName, String vaultName, VaultCreateOrUpdateParameters parameters) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, vaultName, parameters); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), VaultInner.class, VaultInner.class, this.client.getContext()); - } - - /** - * Create or update a key vault in the specified subscription. - * - * @param resourceGroupName The name of the Resource Group to which the server belongs. - * @param vaultName Name of the vault. - * @param parameters Parameters to create or update the vault. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information with extended details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, VaultInner> beginCreateOrUpdateAsync( - String resourceGroupName, String vaultName, VaultCreateOrUpdateParameters parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, vaultName, parameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), VaultInner.class, VaultInner.class, context); - } - - /** - * Create or update a key vault in the specified subscription. - * - * @param resourceGroupName The name of the Resource Group to which the server belongs. - * @param vaultName Name of the vault. - * @param parameters Parameters to create or update the vault. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information with extended details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VaultInner> beginCreateOrUpdate( - String resourceGroupName, String vaultName, VaultCreateOrUpdateParameters parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, vaultName, parameters).getSyncPoller(); - } - - /** - * Create or update a key vault in the specified subscription. - * - * @param resourceGroupName The name of the Resource Group to which the server belongs. - * @param vaultName Name of the vault. - * @param parameters Parameters to create or update the vault. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information with extended details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VaultInner> beginCreateOrUpdate( - String resourceGroupName, String vaultName, VaultCreateOrUpdateParameters parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, vaultName, parameters, context).getSyncPoller(); - } - - /** - * Create or update a key vault in the specified subscription. - * - * @param resourceGroupName The name of the Resource Group to which the server belongs. - * @param vaultName Name of the vault. - * @param parameters Parameters to create or update the vault. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information with extended details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, String vaultName, VaultCreateOrUpdateParameters parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, vaultName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create or update a key vault in the specified subscription. - * - * @param resourceGroupName The name of the Resource Group to which the server belongs. - * @param vaultName Name of the vault. - * @param parameters Parameters to create or update the vault. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information with extended details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String vaultName, VaultCreateOrUpdateParameters parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, vaultName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create or update a key vault in the specified subscription. - * - * @param resourceGroupName The name of the Resource Group to which the server belongs. - * @param vaultName Name of the vault. - * @param parameters Parameters to create or update the vault. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information with extended details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VaultInner createOrUpdate( - String resourceGroupName, String vaultName, VaultCreateOrUpdateParameters parameters) { - return createOrUpdateAsync(resourceGroupName, vaultName, parameters).block(); - } - - /** - * Create or update a key vault in the specified subscription. - * - * @param resourceGroupName The name of the Resource Group to which the server belongs. - * @param vaultName Name of the vault. - * @param parameters Parameters to create or update the vault. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information with extended details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VaultInner createOrUpdate( - String resourceGroupName, String vaultName, VaultCreateOrUpdateParameters parameters, Context context) { - return createOrUpdateAsync(resourceGroupName, vaultName, parameters, context).block(); - } - - /** - * Update a key vault in the specified subscription. - * - * @param resourceGroupName The name of the Resource Group to which the server belongs. - * @param vaultName Name of the vault. - * @param parameters Parameters to patch the vault. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information with extended details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateWithResponseAsync( - String resourceGroupName, String vaultName, VaultPatchParameters parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vaultName == null) { - return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - resourceGroupName, - vaultName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Update a key vault in the specified subscription. - * - * @param resourceGroupName The name of the Resource Group to which the server belongs. - * @param vaultName Name of the vault. - * @param parameters Parameters to patch the vault. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information with extended details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, String vaultName, VaultPatchParameters parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vaultName == null) { - return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - resourceGroupName, - vaultName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Update a key vault in the specified subscription. - * - * @param resourceGroupName The name of the Resource Group to which the server belongs. - * @param vaultName Name of the vault. - * @param parameters Parameters to patch the vault. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information with extended details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync(String resourceGroupName, String vaultName, VaultPatchParameters parameters) { - return updateWithResponseAsync(resourceGroupName, vaultName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Update a key vault in the specified subscription. - * - * @param resourceGroupName The name of the Resource Group to which the server belongs. - * @param vaultName Name of the vault. - * @param parameters Parameters to patch the vault. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information with extended details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VaultInner update(String resourceGroupName, String vaultName, VaultPatchParameters parameters) { - return updateAsync(resourceGroupName, vaultName, parameters).block(); - } - - /** - * Update a key vault in the specified subscription. - * - * @param resourceGroupName The name of the Resource Group to which the server belongs. - * @param vaultName Name of the vault. - * @param parameters Parameters to patch the vault. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information with extended details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, String vaultName, VaultPatchParameters parameters, Context context) { - return updateWithResponseAsync(resourceGroupName, vaultName, parameters, context).block(); - } - - /** - * Deletes the specified Azure key vault. - * - * @param resourceGroupName The name of the Resource Group to which the vault belongs. - * @param vaultName The name of the vault to delete. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String resourceGroupName, String vaultName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vaultName == null) { - return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - vaultName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the specified Azure key vault. - * - * @param resourceGroupName The name of the Resource Group to which the vault belongs. - * @param vaultName The name of the vault to delete. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String vaultName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vaultName == null) { - return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - vaultName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Deletes the specified Azure key vault. - * - * @param resourceGroupName The name of the Resource Group to which the vault belongs. - * @param vaultName The name of the vault to delete. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String vaultName) { - return deleteWithResponseAsync(resourceGroupName, vaultName).flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes the specified Azure key vault. - * - * @param resourceGroupName The name of the Resource Group to which the vault belongs. - * @param vaultName The name of the vault to delete. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String vaultName) { - deleteAsync(resourceGroupName, vaultName).block(); - } - - /** - * Deletes the specified Azure key vault. - * - * @param resourceGroupName The name of the Resource Group to which the vault belongs. - * @param vaultName The name of the vault to delete. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String vaultName, Context context) { - return deleteWithResponseAsync(resourceGroupName, vaultName, context).block(); - } - - /** - * Gets the specified Azure key vault. - * - * @param resourceGroupName The name of the Resource Group to which the vault belongs. - * @param vaultName The name of the vault. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Azure key vault. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String vaultName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vaultName == null) { - return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - vaultName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the specified Azure key vault. - * - * @param resourceGroupName The name of the Resource Group to which the vault belongs. - * @param vaultName The name of the vault. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Azure key vault. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String vaultName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vaultName == null) { - return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - vaultName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets the specified Azure key vault. - * - * @param resourceGroupName The name of the Resource Group to which the vault belongs. - * @param vaultName The name of the vault. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Azure key vault. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync(String resourceGroupName, String vaultName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, vaultName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the specified Azure key vault. - * - * @param resourceGroupName The name of the Resource Group to which the vault belongs. - * @param vaultName The name of the vault. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Azure key vault. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VaultInner getByResourceGroup(String resourceGroupName, String vaultName) { - return getByResourceGroupAsync(resourceGroupName, vaultName).block(); - } - - /** - * Gets the specified Azure key vault. - * - * @param resourceGroupName The name of the Resource Group to which the vault belongs. - * @param vaultName The name of the vault. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Azure key vault. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String vaultName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, vaultName, context).block(); - } - - /** - * Update access policies in a key vault in the specified subscription. - * - * @param resourceGroupName The name of the Resource Group to which the vault belongs. - * @param vaultName Name of the vault. - * @param operationKind Name of the operation. - * @param properties Properties of the access policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return parameters for updating the access policy in a vault. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateAccessPolicyWithResponseAsync( - String resourceGroupName, - String vaultName, - AccessPolicyUpdateKind operationKind, - VaultAccessPolicyProperties properties) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vaultName == null) { - return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); - } - if (operationKind == null) { - return Mono.error(new IllegalArgumentException("Parameter operationKind is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (properties == null) { - return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); - } else { - properties.validate(); - } - final String accept = "application/json"; - VaultAccessPolicyParametersInner parameters = new VaultAccessPolicyParametersInner(); - parameters.withProperties(properties); - return FluxUtil - .withContext( - context -> - service - .updateAccessPolicy( - this.client.getEndpoint(), - resourceGroupName, - vaultName, - operationKind, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Update access policies in a key vault in the specified subscription. - * - * @param resourceGroupName The name of the Resource Group to which the vault belongs. - * @param vaultName Name of the vault. - * @param operationKind Name of the operation. - * @param properties Properties of the access policy. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return parameters for updating the access policy in a vault. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateAccessPolicyWithResponseAsync( - String resourceGroupName, - String vaultName, - AccessPolicyUpdateKind operationKind, - VaultAccessPolicyProperties properties, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vaultName == null) { - return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); - } - if (operationKind == null) { - return Mono.error(new IllegalArgumentException("Parameter operationKind is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (properties == null) { - return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); - } else { - properties.validate(); - } - final String accept = "application/json"; - VaultAccessPolicyParametersInner parameters = new VaultAccessPolicyParametersInner(); - parameters.withProperties(properties); - context = this.client.mergeContext(context); - return service - .updateAccessPolicy( - this.client.getEndpoint(), - resourceGroupName, - vaultName, - operationKind, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Update access policies in a key vault in the specified subscription. - * - * @param resourceGroupName The name of the Resource Group to which the vault belongs. - * @param vaultName Name of the vault. - * @param operationKind Name of the operation. - * @param properties Properties of the access policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return parameters for updating the access policy in a vault. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAccessPolicyAsync( - String resourceGroupName, - String vaultName, - AccessPolicyUpdateKind operationKind, - VaultAccessPolicyProperties properties) { - return updateAccessPolicyWithResponseAsync(resourceGroupName, vaultName, operationKind, properties) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Update access policies in a key vault in the specified subscription. - * - * @param resourceGroupName The name of the Resource Group to which the vault belongs. - * @param vaultName Name of the vault. - * @param operationKind Name of the operation. - * @param properties Properties of the access policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return parameters for updating the access policy in a vault. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VaultAccessPolicyParametersInner updateAccessPolicy( - String resourceGroupName, - String vaultName, - AccessPolicyUpdateKind operationKind, - VaultAccessPolicyProperties properties) { - return updateAccessPolicyAsync(resourceGroupName, vaultName, operationKind, properties).block(); - } - - /** - * Update access policies in a key vault in the specified subscription. - * - * @param resourceGroupName The name of the Resource Group to which the vault belongs. - * @param vaultName Name of the vault. - * @param operationKind Name of the operation. - * @param properties Properties of the access policy. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return parameters for updating the access policy in a vault. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateAccessPolicyWithResponse( - String resourceGroupName, - String vaultName, - AccessPolicyUpdateKind operationKind, - VaultAccessPolicyProperties properties, - Context context) { - return updateAccessPolicyWithResponseAsync(resourceGroupName, vaultName, operationKind, properties, context) - .block(); - } - - /** - * The List operation gets information about the vaults associated with the subscription and within the specified - * resource group. - * - * @param resourceGroupName The name of the Resource Group to which the vault belongs. - * @param top Maximum number of results to return. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of vaults. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, Integer top) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - top, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * The List operation gets information about the vaults associated with the subscription and within the specified - * resource group. - * - * @param resourceGroupName The name of the Resource Group to which the vault belongs. - * @param top Maximum number of results to return. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of vaults. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Integer top, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - top, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * The List operation gets information about the vaults associated with the subscription and within the specified - * resource group. - * - * @param resourceGroupName The name of the Resource Group to which the vault belongs. - * @param top Maximum number of results to return. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of vaults. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName, Integer top) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, top), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * The List operation gets information about the vaults associated with the subscription and within the specified - * resource group. - * - * @param resourceGroupName The name of the Resource Group to which the vault belongs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of vaults. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - final Integer top = null; - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, top), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * The List operation gets information about the vaults associated with the subscription and within the specified - * resource group. - * - * @param resourceGroupName The name of the Resource Group to which the vault belongs. - * @param top Maximum number of results to return. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of vaults. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Integer top, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, top, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * The List operation gets information about the vaults associated with the subscription and within the specified - * resource group. - * - * @param resourceGroupName The name of the Resource Group to which the vault belongs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of vaults. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - final Integer top = null; - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, top)); - } - - /** - * The List operation gets information about the vaults associated with the subscription and within the specified - * resource group. - * - * @param resourceGroupName The name of the Resource Group to which the vault belongs. - * @param top Maximum number of results to return. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of vaults. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Integer top, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, top, context)); - } - - /** - * The List operation gets information about the vaults associated with the subscription. - * - * @param top Maximum number of results to return. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of vaults. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionSinglePageAsync(Integer top) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listBySubscription( - this.client.getEndpoint(), - top, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * The List operation gets information about the vaults associated with the subscription. - * - * @param top Maximum number of results to return. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of vaults. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionSinglePageAsync(Integer top, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listBySubscription( - this.client.getEndpoint(), - top, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * The List operation gets information about the vaults associated with the subscription. - * - * @param top Maximum number of results to return. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of vaults. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listBySubscriptionAsync(Integer top) { - return new PagedFlux<>( - () -> listBySubscriptionSinglePageAsync(top), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); - } - - /** - * The List operation gets information about the vaults associated with the subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of vaults. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listBySubscriptionAsync() { - final Integer top = null; - return new PagedFlux<>( - () -> listBySubscriptionSinglePageAsync(top), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); - } - - /** - * The List operation gets information about the vaults associated with the subscription. - * - * @param top Maximum number of results to return. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of vaults. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listBySubscriptionAsync(Integer top, Context context) { - return new PagedFlux<>( - () -> listBySubscriptionSinglePageAsync(top, context), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); - } - - /** - * The List operation gets information about the vaults associated with the subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of vaults. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listBySubscription() { - final Integer top = null; - return new PagedIterable<>(listBySubscriptionAsync(top)); - } - - /** - * The List operation gets information about the vaults associated with the subscription. - * - * @param top Maximum number of results to return. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of vaults. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listBySubscription(Integer top, Context context) { - return new PagedIterable<>(listBySubscriptionAsync(top, context)); - } - - /** - * Gets information about the deleted vaults in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the deleted vaults in a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listDeletedSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listDeleted( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets information about the deleted vaults in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the deleted vaults in a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listDeletedSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listDeleted( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets information about the deleted vaults in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the deleted vaults in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listDeletedAsync() { - return new PagedFlux<>( - () -> listDeletedSinglePageAsync(), nextLink -> listDeletedNextSinglePageAsync(nextLink)); - } - - /** - * Gets information about the deleted vaults in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the deleted vaults in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listDeletedAsync(Context context) { - return new PagedFlux<>( - () -> listDeletedSinglePageAsync(context), nextLink -> listDeletedNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets information about the deleted vaults in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the deleted vaults in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listDeleted() { - return new PagedIterable<>(listDeletedAsync()); - } - - /** - * Gets information about the deleted vaults in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the deleted vaults in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listDeleted(Context context) { - return new PagedIterable<>(listDeletedAsync(context)); - } - - /** - * Gets the deleted Azure key vault. - * - * @param vaultName The name of the vault. - * @param location The location of the deleted vault. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deleted Azure key vault. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getDeletedWithResponseAsync(String vaultName, String location) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (vaultName == null) { - return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getDeleted( - this.client.getEndpoint(), - vaultName, - location, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the deleted Azure key vault. - * - * @param vaultName The name of the vault. - * @param location The location of the deleted vault. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deleted Azure key vault. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getDeletedWithResponseAsync( - String vaultName, String location, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (vaultName == null) { - return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getDeleted( - this.client.getEndpoint(), - vaultName, - location, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets the deleted Azure key vault. - * - * @param vaultName The name of the vault. - * @param location The location of the deleted vault. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deleted Azure key vault. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getDeletedAsync(String vaultName, String location) { - return getDeletedWithResponseAsync(vaultName, location) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the deleted Azure key vault. - * - * @param vaultName The name of the vault. - * @param location The location of the deleted vault. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deleted Azure key vault. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DeletedVaultInner getDeleted(String vaultName, String location) { - return getDeletedAsync(vaultName, location).block(); - } - - /** - * Gets the deleted Azure key vault. - * - * @param vaultName The name of the vault. - * @param location The location of the deleted vault. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deleted Azure key vault. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getDeletedWithResponse(String vaultName, String location, Context context) { - return getDeletedWithResponseAsync(vaultName, location, context).block(); - } - - /** - * Permanently deletes the specified vault. aka Purges the deleted Azure key vault. - * - * @param vaultName The name of the soft-deleted vault. - * @param location The location of the soft-deleted vault. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> purgeDeletedWithResponseAsync(String vaultName, String location) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (vaultName == null) { - return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .purgeDeleted( - this.client.getEndpoint(), - vaultName, - location, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Permanently deletes the specified vault. aka Purges the deleted Azure key vault. - * - * @param vaultName The name of the soft-deleted vault. - * @param location The location of the soft-deleted vault. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> purgeDeletedWithResponseAsync( - String vaultName, String location, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (vaultName == null) { - return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .purgeDeleted( - this.client.getEndpoint(), - vaultName, - location, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Permanently deletes the specified vault. aka Purges the deleted Azure key vault. - * - * @param vaultName The name of the soft-deleted vault. - * @param location The location of the soft-deleted vault. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginPurgeDeletedAsync(String vaultName, String location) { - Mono>> mono = purgeDeletedWithResponseAsync(vaultName, location); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Permanently deletes the specified vault. aka Purges the deleted Azure key vault. - * - * @param vaultName The name of the soft-deleted vault. - * @param location The location of the soft-deleted vault. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginPurgeDeletedAsync( - String vaultName, String location, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = purgeDeletedWithResponseAsync(vaultName, location, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Permanently deletes the specified vault. aka Purges the deleted Azure key vault. - * - * @param vaultName The name of the soft-deleted vault. - * @param location The location of the soft-deleted vault. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginPurgeDeleted(String vaultName, String location) { - return beginPurgeDeletedAsync(vaultName, location).getSyncPoller(); - } - - /** - * Permanently deletes the specified vault. aka Purges the deleted Azure key vault. - * - * @param vaultName The name of the soft-deleted vault. - * @param location The location of the soft-deleted vault. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginPurgeDeleted(String vaultName, String location, Context context) { - return beginPurgeDeletedAsync(vaultName, location, context).getSyncPoller(); - } - - /** - * Permanently deletes the specified vault. aka Purges the deleted Azure key vault. - * - * @param vaultName The name of the soft-deleted vault. - * @param location The location of the soft-deleted vault. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono purgeDeletedAsync(String vaultName, String location) { - return beginPurgeDeletedAsync(vaultName, location).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Permanently deletes the specified vault. aka Purges the deleted Azure key vault. - * - * @param vaultName The name of the soft-deleted vault. - * @param location The location of the soft-deleted vault. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono purgeDeletedAsync(String vaultName, String location, Context context) { - return beginPurgeDeletedAsync(vaultName, location, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Permanently deletes the specified vault. aka Purges the deleted Azure key vault. - * - * @param vaultName The name of the soft-deleted vault. - * @param location The location of the soft-deleted vault. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void purgeDeleted(String vaultName, String location) { - purgeDeletedAsync(vaultName, location).block(); - } - - /** - * Permanently deletes the specified vault. aka Purges the deleted Azure key vault. - * - * @param vaultName The name of the soft-deleted vault. - * @param location The location of the soft-deleted vault. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void purgeDeleted(String vaultName, String location, Context context) { - purgeDeletedAsync(vaultName, location, context).block(); - } - - /** - * The List operation gets information about the vaults associated with the subscription. - * - * @param top Maximum number of results to return. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of vault resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Integer top) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String filter = "resourceType eq 'Microsoft.KeyVault/vaults'"; - final String apiVersion = "2015-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - filter, - top, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * The List operation gets information about the vaults associated with the subscription. - * - * @param top Maximum number of results to return. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of vault resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Integer top, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String filter = "resourceType eq 'Microsoft.KeyVault/vaults'"; - final String apiVersion = "2015-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), filter, top, apiVersion, this.client.getSubscriptionId(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * The List operation gets information about the vaults associated with the subscription. - * - * @param top Maximum number of results to return. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of vault resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(Integer top) { - return new PagedFlux<>(() -> listSinglePageAsync(top), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * The List operation gets information about the vaults associated with the subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of vault resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - final Integer top = null; - return new PagedFlux<>(() -> listSinglePageAsync(top), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * The List operation gets information about the vaults associated with the subscription. - * - * @param top Maximum number of results to return. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of vault resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Integer top, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(top, context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * The List operation gets information about the vaults associated with the subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of vault resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - final Integer top = null; - return new PagedIterable<>(listAsync(top)); - } - - /** - * The List operation gets information about the vaults associated with the subscription. - * - * @param top Maximum number of results to return. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of vault resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Integer top, Context context) { - return new PagedIterable<>(listAsync(top, context)); - } - - /** - * Checks that the vault name is valid and is not already in use. - * - * @param name The vault name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the CheckNameAvailability operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> checkNameAvailabilityWithResponseAsync(String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; - VaultCheckNameAvailabilityParameters vaultName = new VaultCheckNameAvailabilityParameters(); - vaultName.withName(name); - return FluxUtil - .withContext( - context -> - service - .checkNameAvailability( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - vaultName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Checks that the vault name is valid and is not already in use. - * - * @param name The vault name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the CheckNameAvailability operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> checkNameAvailabilityWithResponseAsync( - String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; - VaultCheckNameAvailabilityParameters vaultName = new VaultCheckNameAvailabilityParameters(); - vaultName.withName(name); - context = this.client.mergeContext(context); - return service - .checkNameAvailability( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - vaultName, - accept, - context); - } - - /** - * Checks that the vault name is valid and is not already in use. - * - * @param name The vault name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the CheckNameAvailability operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono checkNameAvailabilityAsync(String name) { - return checkNameAvailabilityWithResponseAsync(name) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Checks that the vault name is valid and is not already in use. - * - * @param name The vault name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the CheckNameAvailability operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CheckNameAvailabilityResultInner checkNameAvailability(String name) { - return checkNameAvailabilityAsync(name).block(); - } - - /** - * Checks that the vault name is valid and is not already in use. - * - * @param name The vault name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the CheckNameAvailability operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response checkNameAvailabilityWithResponse(String name, Context context) { - return checkNameAvailabilityWithResponseAsync(name, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of vaults. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of vaults. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of vaults. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of vaults. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of vaults. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listDeletedNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listDeletedNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of vaults. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listDeletedNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listDeletedNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of vault resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of vault resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/VaultsImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/VaultsImpl.java deleted file mode 100644 index 4d6567d1bea8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/VaultsImpl.java +++ /dev/null @@ -1,170 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.keyvault.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.CoreUtils; -import com.azure.resourcemanager.authorization.AuthorizationManager; -import com.azure.resourcemanager.keyvault.KeyVaultManager; -import com.azure.resourcemanager.keyvault.fluent.VaultsClient; -import com.azure.resourcemanager.keyvault.fluent.models.DeletedVaultInner; -import com.azure.resourcemanager.keyvault.fluent.models.VaultInner; -import com.azure.resourcemanager.keyvault.models.CheckNameAvailabilityResult; -import com.azure.resourcemanager.keyvault.models.CreateMode; -import com.azure.resourcemanager.keyvault.models.DeletedVault; -import com.azure.resourcemanager.keyvault.models.Sku; -import com.azure.resourcemanager.keyvault.models.SkuFamily; -import com.azure.resourcemanager.keyvault.models.SkuName; -import com.azure.resourcemanager.keyvault.models.Vault; -import com.azure.resourcemanager.keyvault.models.VaultCreateOrUpdateParameters; -import com.azure.resourcemanager.keyvault.models.VaultProperties; -import com.azure.resourcemanager.keyvault.models.Vaults; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.GroupableResourcesImpl; -import reactor.core.publisher.Mono; - -import java.util.UUID; -import com.azure.resourcemanager.resources.fluentcore.utils.PagedConverter; - -/** The implementation of Vaults and its parent interfaces. */ -public class VaultsImpl extends GroupableResourcesImpl - implements Vaults { - private final AuthorizationManager authorizationManager; - private final String tenantId; - - public VaultsImpl( - final KeyVaultManager keyVaultManager, final AuthorizationManager authorizationManager, final String tenantId) { - super(keyVaultManager.serviceClient().getVaults(), keyVaultManager); - this.authorizationManager = authorizationManager; - this.tenantId = tenantId; - } - - @Override - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - @Override - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - if (CoreUtils.isNullOrEmpty(resourceGroupName)) { - return new PagedFlux<>(() -> Mono.error( - new IllegalArgumentException("Parameter 'resourceGroupName' is required and cannot be null."))); - } - return wrapPageAsync(this.inner().listByResourceGroupAsync(resourceGroupName, null)); - } - - @Override - protected Mono getInnerAsync(String resourceGroupName, String name) { - return this.inner().getByResourceGroupAsync(resourceGroupName, name); - } - - @Override - protected Mono deleteInnerAsync(String resourceGroupName, String name) { - return this.inner().deleteAsync(resourceGroupName, name); - } - - @Override - public Mono deleteByResourceGroupAsync(String resourceGroupName, String name) { - if (CoreUtils.isNullOrEmpty(resourceGroupName)) { - return Mono.error( - new IllegalArgumentException("Parameter 'resourceGroupName' is required and cannot be null.")); - } - if (CoreUtils.isNullOrEmpty(name)) { - return Mono.error( - new IllegalArgumentException("Parameter 'name' is required and cannot be null.")); - } - return this.inner().deleteAsync(resourceGroupName, name); - } - - @Override - public VaultImpl define(String name) { - return wrapModel(name).withSku(SkuName.STANDARD).withEmptyAccessPolicy(); - } - - @Override - protected VaultImpl wrapModel(String name) { - VaultInner inner = new VaultInner().withProperties(new VaultProperties()); - inner.properties().withTenantId(UUID.fromString(tenantId)); - return new VaultImpl(name, inner, this.manager(), authorizationManager); - } - - @Override - protected VaultImpl wrapModel(VaultInner vaultInner) { - if (vaultInner == null) { - return null; - } - return new VaultImpl(vaultInner.name(), vaultInner, this.manager(), authorizationManager); - } - - @Override - public PagedIterable listDeleted() { - return PagedConverter.mapPage(this.inner().listDeleted(), DeletedVaultImpl::new); - } - - @Override - public DeletedVault getDeleted(String vaultName, String location) { - DeletedVaultInner deletedVault = inner().getDeleted(vaultName, location); - if (deletedVault == null) { - return null; - } - return new DeletedVaultImpl(deletedVault); - } - - @Override - public void purgeDeleted(String vaultName, String location) { - inner().purgeDeleted(vaultName, location); - } - - @Override - public Mono getDeletedAsync(String vaultName, String location) { - return this.inner().getDeletedAsync(vaultName, location).map(DeletedVaultImpl::new); - } - - @Override - public Mono purgeDeletedAsync(String vaultName, String location) { - return this.inner().purgeDeletedAsync(vaultName, location); - } - - @Override - public PagedFlux listDeletedAsync() { - return PagedConverter.mapPage(this.inner().listDeletedAsync(), DeletedVaultImpl::new); - } - - @Override - public CheckNameAvailabilityResult checkNameAvailability(String name) { - return new CheckNameAvailabilityResultImpl(inner().checkNameAvailability(name)); - } - - @Override - public Mono checkNameAvailabilityAsync(String name) { - return inner().checkNameAvailabilityAsync(name).map(CheckNameAvailabilityResultImpl::new); - } - - @Override - public Vault recoverSoftDeletedVault(String resourceGroupName, String vaultName, String location) { - return recoverSoftDeletedVaultAsync(resourceGroupName, vaultName, location).block(); - } - - @Override - public Mono recoverSoftDeletedVaultAsync( - final String resourceGroupName, final String vaultName, String location) { - final KeyVaultManager manager = this.manager(); - return getDeletedAsync(vaultName, location) - .flatMap( - deletedVault -> { - VaultCreateOrUpdateParameters parameters = new VaultCreateOrUpdateParameters(); - parameters.withLocation(deletedVault.location()); - parameters.withTags(deletedVault.innerModel().properties().tags()); - parameters - .withProperties( - new VaultProperties() - .withCreateMode(CreateMode.RECOVER) - .withSku(new Sku().withName(SkuName.STANDARD).withFamily(SkuFamily.A)) - .withTenantId(UUID.fromString(tenantId))); - return inner() - .createOrUpdateAsync(resourceGroupName, vaultName, parameters) - .map(inner -> (Vault) new VaultImpl(inner.id(), inner, manager, authorizationManager)); - }); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/AccessPolicy.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/AccessPolicy.java deleted file mode 100644 index cb3606953b28..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/AccessPolicy.java +++ /dev/null @@ -1,633 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.keyvault.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.authorization.models.ActiveDirectoryGroup; -import com.azure.resourcemanager.authorization.models.ActiveDirectoryUser; -import com.azure.resourcemanager.authorization.models.ServicePrincipal; -import com.azure.resourcemanager.resources.fluentcore.arm.models.ChildResource; -import com.azure.resourcemanager.resources.fluentcore.model.Attachable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.model.Settable; -import java.util.List; - -/** An immutable client-side representation of a key vault access policy. */ -@Fluent -public interface AccessPolicy extends ChildResource, HasInnerModel { - /** - * @return The Azure Active Directory tenant ID that should be used for authenticating requests to the key vault. - */ - String tenantId(); - - /** @return The object ID of a user or service principal in the Azure Active Directory tenant for the vault. */ - String objectId(); - - /** @return Application ID of the client making request on behalf of a principal. */ - String applicationId(); - - /** @return Permissions the identity has for keys and secrets. */ - Permissions permissions(); - - /************************************************************** - * Fluent interfaces to attach an access policy - **************************************************************/ - - /** - * The entirety of an access policy definition. - * - * @param the return type of the final {@link Attachable#attach()} - */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithAttach { - } - - /** Grouping of access policy definition stages applicable as part of a key vault creation. */ - interface DefinitionStages { - /** - * The first stage of an access policy definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface Blank extends WithIdentity { - } - - /** - * The access policy definition stage allowing the Active Directory identity to be specified. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithIdentity { - /** - * Specifies the object ID of the Active Directory identity this access policy is for. - * - * @param objectId the object ID of the AD identity - * @return the next stage of access policy definition - */ - WithAttach forObjectId(String objectId); - - /** - * Specifies the Active Directory user this access policy is for. - * - * @param user the AD user object - * @return the next stage of access policy definition - */ - WithAttach forUser(ActiveDirectoryUser user); - - /** - * Specifies the Active Directory user this access policy is for. - * - * @param userPrincipalName the user principal name of the AD user - * @return the next stage of access policy definition - */ - WithAttach forUser(String userPrincipalName); - - /** - * Application ID of the client making request on behalf of a principal. - * - * @param applicationId the application ID - * @return the next stage of access policy definition - */ - WithAttach forApplicationId(String applicationId); - - /** - * Specifies the Azure Active Directory tenant ID that should be used for authenticating requests to the key - * vault. - * - * @param tenantId the tenant ID for the key vault. - * @return the next stage of access policy definition - */ - WithAttach forTenantId(String tenantId); - - /** - * Specifies the Active Directory group this access policy is for. - * - * @param activeDirectoryGroup the AD group object - * @return the next stage of access policy definition - */ - WithAttach forGroup(ActiveDirectoryGroup activeDirectoryGroup); - - /** - * Specifies the Active Directory service principal this access policy is for. - * - * @param servicePrincipal the AD service principal object - * @return the next stage of access policy definition - */ - WithAttach forServicePrincipal(ServicePrincipal servicePrincipal); - - /** - * Specifies the Active Directory service principal this access policy is for. - * - * @param servicePrincipalName the service principal name of the AD user - * @return the next stage of access policy definition - */ - WithAttach forServicePrincipal(String servicePrincipalName); - } - - /** - * The access policy definition stage allowing permissions to be added. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithPermissions { - /** - * Allow all permissions for the AD identity to access keys. - * - * @return the next stage of access policy definition - */ - WithAttach allowKeyAllPermissions(); - - /** - * Allow a list of permissions for the AD identity to access keys. - * - * @param permissions the list of permissions allowed - * @return the next stage of access policy definition - */ - WithAttach allowKeyPermissions(KeyPermissions... permissions); - - /** - * Allow a list of permissions for the AD identity to access keys. - * - * @param permissions the list of permissions allowed - * @return the next stage of access policy definition - */ - WithAttach allowKeyPermissions(List permissions); - - /** - * Allow all permissions for the AD identity to access secrets. - * - * @return the next stage of access policy definition - */ - WithAttach allowSecretAllPermissions(); - - /** - * Allow a list of permissions for the AD identity to access secrets. - * - * @param permissions the list of permissions allowed - * @return the next stage of access policy definition - */ - WithAttach allowSecretPermissions(SecretPermissions... permissions); - - /** - * Allow a list of permissions for the AD identity to access secrets. - * - * @param permissions the list of permissions allowed - * @return the next stage of access policy definition - */ - WithAttach allowSecretPermissions(List permissions); - - /** - * Allow all permissions for the AD identity to access certificates. - * - * @return the next stage of access policy definition - */ - WithAttach allowCertificateAllPermissions(); - - /** - * Allow a list of permissions for the AD identity to access certificates. - * - * @param permissions the list of permissions allowed - * @return the next stage of access policy definition - */ - WithAttach allowCertificatePermissions(CertificatePermissions... permissions); - - /** - * Allow a list of permissions for the AD identity to access certificates. - * - * @param permissions the list of permissions allowed - * @return the next stage of access policy definition - */ - WithAttach allowCertificatePermissions(List permissions); - - /** - * Allow all permissions for the Ad identity to access storage. - * - * @return the next stage of access policy definition - */ - WithAttach allowStorageAllPermissions(); - - /** - * Allow a list of permissions for the AD identity to access storage. - * - * @param permissions the list of permissions allowed - * @return the next stage of access policy definition - */ - WithAttach allowStoragePermissions(StoragePermissions... permissions); - - /** - * Allow a list of permissions for the AD identity to access storage. - * - * @param permissions the list of permissions allowed - * @return the next stage of access policy definition - */ - WithAttach allowStoragePermissions(List permissions); - } - - /** - * The final stage of the access policy definition. - * - *

    At this stage, more permissions can be added or application ID can be specified, or the access policy - * definition can be attached to the parent key vault definition using {@link WithAttach#attach()}. - * - * @param the return type of {@link WithAttach#attach()} - */ - interface WithAttach extends Attachable.InUpdate, WithPermissions { - } - } - - /** - * The entirety of an access policy definition as part of a key vault update. - * - * @param the return type of the final {@link UpdateDefinitionStages.WithAttach#attach()} - */ - interface UpdateDefinition - extends UpdateDefinitionStages.Blank, UpdateDefinitionStages.WithAttach { - } - - /** Grouping of access policy definition stages applicable as part of a key vault update. */ - interface UpdateDefinitionStages { - /** - * The first stage of an access policy definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface Blank extends WithIdentity { - } - - /** - * The access policy definition stage allowing the Active Directory identity to be specified. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithIdentity { - /** - * Specifies the object ID of the Active Directory identity this access policy is for. - * - * @param objectId the object ID of the AD identity - * @return the next stage of access policy definition - */ - WithAttach forObjectId(String objectId); - - /** - * Specifies the Active Directory user this access policy is for. - * - * @param user the AD user object - * @return the next stage of access policy definition - */ - WithAttach forUser(ActiveDirectoryUser user); - - /** - * Specifies the Active Directory user this access policy is for. - * - * @param userPrincipalName the user principal name of the AD user - * @return the next stage of access policy definition - */ - WithAttach forUser(String userPrincipalName); - - /** - * Application ID of the client making request on behalf of a principal. - * - * @param applicationId the application ID - * @return the next stage of access policy definition - */ - WithAttach forApplicationId(String applicationId); - - /** - * Specifies the Azure Active Directory tenant ID that should be used for authenticating requests to the key - * vault. - * - * @param tenantId the tenant ID for the key vault. - * @return the next stage of access policy definition - */ - WithAttach forTenantId(String tenantId); - - /** - * Specifies the Active Directory group this access policy is for. - * - * @param activeDirectoryGroup the AD group object - * @return the next stage of access policy definition - */ - WithAttach forGroup(ActiveDirectoryGroup activeDirectoryGroup); - - /** - * Specifies the Active Directory service principal this access policy is for. - * - * @param servicePrincipal the AD service principal object - * @return the next stage of access policy definition - */ - WithAttach forServicePrincipal(ServicePrincipal servicePrincipal); - - /** - * Specifies the Active Directory service principal this access policy is for. - * - * @param servicePrincipalName the service principal name of the AD user - * @return the next stage of access policy definition - */ - WithAttach forServicePrincipal(String servicePrincipalName); - } - - /** - * The access policy definition stage allowing permissions to be added. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithPermissions { - /** - * Allow all permissions for the AD identity to access keys. - * - * @return the next stage of access policy definition - */ - WithAttach allowKeyAllPermissions(); - - /** - * Allow a list of permissions for the AD identity to access keys. - * - * @param permissions the list of permissions allowed - * @return the next stage of access policy definition - */ - WithAttach allowKeyPermissions(KeyPermissions... permissions); - - /** - * Allow a list of permissions for the AD identity to access keys. - * - * @param permissions the list of permissions allowed - * @return the next stage of access policy definition - */ - WithAttach allowKeyPermissions(List permissions); - - /** - * Allow all permissions for the AD identity to access secrets. - * - * @return the next stage of access policy definition - */ - WithAttach allowSecretAllPermissions(); - - /** - * Allow a list of permissions for the AD identity to access secrets. - * - * @param permissions the list of permissions allowed - * @return the next stage of access policy definition - */ - WithAttach allowSecretPermissions(SecretPermissions... permissions); - - /** - * Allow a list of permissions for the AD identity to access secrets. - * - * @param permissions the list of permissions allowed - * @return the next stage of access policy definition - */ - WithAttach allowSecretPermissions(List permissions); - - /** - * Allow all permissions for the Ad identity to access storage. - * - * @return the next stage of access policy definition - */ - WithAttach allowStorageAllPermissions(); - - /** - * Allow all permissions for the AD identity to access certificates. - * - * @return the next stage of access policy definition - */ - WithAttach allowCertificateAllPermissions(); - - /** - * Allow a list of permissions for the AD identity to access certificates. - * - * @param permissions the list of permissions allowed - * @return the next stage of access policy definition - */ - WithAttach allowCertificatePermissions(CertificatePermissions... permissions); - - /** - * Allow a list of permissions for the AD identity to access certificates. - * - * @param permissions the list of permissions allowed - * @return the next stage of access policy definition - */ - WithAttach allowCertificatePermissions(List permissions); - - /** - * Allow a list of permissions for the AD identity to access storage. - * - * @param permissions the list of permissions allowed - * @return the next stage of access policy definition - */ - WithAttach allowStoragePermissions(StoragePermissions... permissions); - - /** - * Allow a list of permissions for the AD identity to access storage. - * - * @param permissions the list of permissions allowed - * @return the next stage of access policy definition - */ - WithAttach allowStoragePermissions(List permissions); - } - - /** - * The final stage of the access policy definition. - * - *

    At this stage, more permissions can be added or application ID can be specified, or the access policy - * definition can be attached to the parent key vault update using {@link WithAttach#attach()}. - * - * @param the return type of {@link WithAttach#attach()} - */ - interface WithAttach extends Attachable.InDefinition, WithPermissions { - } - } - - /** Grouping of all the key vault update stages. */ - interface UpdateStages { - /** The access policy update stage allowing permissions to be added or removed. */ - interface WithPermissions { - /** - * Allow all permissions for the AD identity to access keys. - * - * @return the next stage of access policy update - */ - Update allowKeyAllPermissions(); - - /** - * Allow a list of permissions for the AD identity to access keys. - * - * @param permissions the list of permissions allowed - * @return the next stage of access policy update - */ - Update allowKeyPermissions(KeyPermissions... permissions); - - /** - * Allow a list of permissions for the AD identity to access keys. - * - * @param permissions the list of permissions allowed - * @return the next stage of access policy update - */ - Update allowKeyPermissions(List permissions); - - /** - * Revoke all permissions for the AD identity to access keys. - * - * @return the next stage of access policy update - */ - Update disallowKeyAllPermissions(); - - /** - * Revoke a list of permissions for the AD identity to access keys. - * - * @param permissions the list of permissions to revoke - * @return the next stage of access policy update - */ - Update disallowKeyPermissions(KeyPermissions... permissions); - - /** - * Revoke a list of permissions for the AD identity to access keys. - * - * @param permissions the list of permissions to revoke - * @return the next stage of access policy update - */ - Update disallowKeyPermissions(List permissions); - - /** - * Allow all permissions for the AD identity to access secrets. - * - * @return the next stage of access policy definition - */ - Update allowSecretAllPermissions(); - - /** - * Allow a list of permissions for the AD identity to access secrets. - * - * @param permissions the list of permissions allowed - * @return the next stage of access policy definition - */ - Update allowSecretPermissions(SecretPermissions... permissions); - - /** - * Allow a list of permissions for the AD identity to access secrets. - * - * @param permissions the list of permissions allowed - * @return the next stage of access policy definition - */ - Update allowSecretPermissions(List permissions); - - /** - * Revoke all permissions for the AD identity to access secrets. - * - * @return the next stage of access policy update - */ - Update disallowSecretAllPermissions(); - - /** - * Revoke a list of permissions for the AD identity to access secrets. - * - * @param permissions the list of permissions to revoke - * @return the next stage of access policy update - */ - Update disallowSecretPermissions(SecretPermissions... permissions); - - /** - * Revoke a list of permissions for the AD identity to access secrets. - * - * @param permissions the list of permissions to revoke - * @return the next stage of access policy update - */ - Update disallowSecretPermissions(List permissions); - - /** - * Allow all permissions for the AD identity to access certificates. - * - * @return the next stage of access policy update - */ - Update allowCertificateAllPermissions(); - - /** - * Allow a list of permissions for the AD identity to access certificates. - * - * @param permissions the list of permissions allowed - * @return the next stage of access policy update - */ - Update allowCertificatePermissions(CertificatePermissions... permissions); - - /** - * Allow a list of permissions for the AD identity to access certificates. - * - * @param permissions the list of permissions allowed - * @return the next stage of access policy update - */ - Update allowCertificatePermissions(List permissions); - - /** - * Revoke all permissions for the AD identity to access certificates. - * - * @return the next stage of access policy update - */ - Update disallowCertificateAllPermissions(); - - /** - * Revoke a list of permissions for the AD identity to access certificates. - * - * @param permissions the list of permissions to revoke - * @return the next stage of access policy update - */ - Update disallowCertificatePermissions(CertificatePermissions... permissions); - - /** - * Revoke a list of permissions for the AD identity to access certificates. - * - * @param permissions the list of permissions to revoke - * @return the next stage of access policy update - */ - Update disallowCertificatePermissions(List permissions); - - /** - * Allow all permissions for the Ad identity to access storage. - * - * @return the next stage of access policy definition - */ - Update allowStorageAllPermissions(); - - /** - * Allow a list of permissions for the AD identity to access storage. - * - * @param permissions the list of permissions allowed - * @return the next stage of access policy definition - */ - Update allowStoragePermissions(StoragePermissions... permissions); - - /** - * Allow a list of permissions for the AD identity to access storage. - * - * @param permissions the list of permissions allowed - * @return the next stage of access policy definition - */ - Update allowStoragePermissions(List permissions); - - /** - * Revoke all permissions for the Ad identity to access storage. - * - * @return the next stage of access policy definition - */ - Update disallowStorageAllPermissions(); - - /** - * Revoke a list of permissions for the AD identity to access storage. - * - * @param permissions the list of permissions allowed - * @return the next stage of access policy definition - */ - Update disallowStoragePermissions(StoragePermissions... permissions); - - /** - * Revoke a list of permissions for the AD identity to access storage. - * - * @param permissions the list of permissions allowed - * @return the next stage of access policy definition - */ - Update disallowStoragePermissions(List permissions); - } - } - - /** The entirety of an access policy update as part of a key vault update. */ - interface Update extends UpdateStages.WithPermissions, Settable { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/AccessPolicyEntry.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/AccessPolicyEntry.java deleted file mode 100644 index ab628e1e7e50..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/AccessPolicyEntry.java +++ /dev/null @@ -1,156 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.keyvault.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.UUID; - -/** - * An identity that have access to the key vault. All identities in the array must use the same tenant ID as the key - * vault's tenant ID. - */ -@Fluent -public final class AccessPolicyEntry { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AccessPolicyEntry.class); - - /* - * The Azure Active Directory tenant ID that should be used for - * authenticating requests to the key vault. - */ - @JsonProperty(value = "tenantId", required = true) - private UUID tenantId; - - /* - * The object ID of a user, service principal or security group in the - * Azure Active Directory tenant for the vault. The object ID must be - * unique for the list of access policies. - */ - @JsonProperty(value = "objectId", required = true) - private String objectId; - - /* - * Application ID of the client making request on behalf of a principal - */ - @JsonProperty(value = "applicationId") - private UUID applicationId; - - /* - * Permissions the identity has for keys, secrets and certificates. - */ - @JsonProperty(value = "permissions", required = true) - private Permissions permissions; - - /** - * Get the tenantId property: The Azure Active Directory tenant ID that should be used for authenticating requests - * to the key vault. - * - * @return the tenantId value. - */ - public UUID tenantId() { - return this.tenantId; - } - - /** - * Set the tenantId property: The Azure Active Directory tenant ID that should be used for authenticating requests - * to the key vault. - * - * @param tenantId the tenantId value to set. - * @return the AccessPolicyEntry object itself. - */ - public AccessPolicyEntry withTenantId(UUID tenantId) { - this.tenantId = tenantId; - return this; - } - - /** - * Get the objectId property: The object ID of a user, service principal or security group in the Azure Active - * Directory tenant for the vault. The object ID must be unique for the list of access policies. - * - * @return the objectId value. - */ - public String objectId() { - return this.objectId; - } - - /** - * Set the objectId property: The object ID of a user, service principal or security group in the Azure Active - * Directory tenant for the vault. The object ID must be unique for the list of access policies. - * - * @param objectId the objectId value to set. - * @return the AccessPolicyEntry object itself. - */ - public AccessPolicyEntry withObjectId(String objectId) { - this.objectId = objectId; - return this; - } - - /** - * Get the applicationId property: Application ID of the client making request on behalf of a principal. - * - * @return the applicationId value. - */ - public UUID applicationId() { - return this.applicationId; - } - - /** - * Set the applicationId property: Application ID of the client making request on behalf of a principal. - * - * @param applicationId the applicationId value to set. - * @return the AccessPolicyEntry object itself. - */ - public AccessPolicyEntry withApplicationId(UUID applicationId) { - this.applicationId = applicationId; - return this; - } - - /** - * Get the permissions property: Permissions the identity has for keys, secrets and certificates. - * - * @return the permissions value. - */ - public Permissions permissions() { - return this.permissions; - } - - /** - * Set the permissions property: Permissions the identity has for keys, secrets and certificates. - * - * @param permissions the permissions value to set. - * @return the AccessPolicyEntry object itself. - */ - public AccessPolicyEntry withPermissions(Permissions permissions) { - this.permissions = permissions; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (tenantId() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property tenantId in model AccessPolicyEntry")); - } - if (objectId() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property objectId in model AccessPolicyEntry")); - } - if (permissions() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property permissions in model AccessPolicyEntry")); - } else { - permissions().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/AccessPolicyUpdateKind.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/AccessPolicyUpdateKind.java deleted file mode 100644 index 522ac1a4c51e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/AccessPolicyUpdateKind.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.keyvault.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for AccessPolicyUpdateKind. */ -public enum AccessPolicyUpdateKind { - /** Enum value add. */ - ADD("add"), - - /** Enum value replace. */ - REPLACE("replace"), - - /** Enum value remove. */ - REMOVE("remove"); - - /** The actual serialized value for a AccessPolicyUpdateKind instance. */ - private final String value; - - AccessPolicyUpdateKind(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a AccessPolicyUpdateKind instance. - * - * @param value the serialized value to parse. - * @return the parsed AccessPolicyUpdateKind object, or null if unable to parse. - */ - @JsonCreator - public static AccessPolicyUpdateKind fromString(String value) { - AccessPolicyUpdateKind[] items = AccessPolicyUpdateKind.values(); - for (AccessPolicyUpdateKind item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/CertificatePermissions.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/CertificatePermissions.java deleted file mode 100644 index c71e49e3831f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/CertificatePermissions.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.keyvault.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for CertificatePermissions. */ -public final class CertificatePermissions extends ExpandableStringEnum { - /** Static value all for CertificatePermissions. */ - public static final CertificatePermissions ALL = fromString("all"); - - /** Static value get for CertificatePermissions. */ - public static final CertificatePermissions GET = fromString("get"); - - /** Static value list for CertificatePermissions. */ - public static final CertificatePermissions LIST = fromString("list"); - - /** Static value delete for CertificatePermissions. */ - public static final CertificatePermissions DELETE = fromString("delete"); - - /** Static value create for CertificatePermissions. */ - public static final CertificatePermissions CREATE = fromString("create"); - - /** Static value import for CertificatePermissions. */ - public static final CertificatePermissions IMPORT = fromString("import"); - - /** Static value update for CertificatePermissions. */ - public static final CertificatePermissions UPDATE = fromString("update"); - - /** Static value managecontacts for CertificatePermissions. */ - public static final CertificatePermissions MANAGECONTACTS = fromString("managecontacts"); - - /** Static value getissuers for CertificatePermissions. */ - public static final CertificatePermissions GETISSUERS = fromString("getissuers"); - - /** Static value listissuers for CertificatePermissions. */ - public static final CertificatePermissions LISTISSUERS = fromString("listissuers"); - - /** Static value setissuers for CertificatePermissions. */ - public static final CertificatePermissions SETISSUERS = fromString("setissuers"); - - /** Static value deleteissuers for CertificatePermissions. */ - public static final CertificatePermissions DELETEISSUERS = fromString("deleteissuers"); - - /** Static value manageissuers for CertificatePermissions. */ - public static final CertificatePermissions MANAGEISSUERS = fromString("manageissuers"); - - /** Static value recover for CertificatePermissions. */ - public static final CertificatePermissions RECOVER = fromString("recover"); - - /** Static value purge for CertificatePermissions. */ - public static final CertificatePermissions PURGE = fromString("purge"); - - /** Static value backup for CertificatePermissions. */ - public static final CertificatePermissions BACKUP = fromString("backup"); - - /** Static value restore for CertificatePermissions. */ - public static final CertificatePermissions RESTORE = fromString("restore"); - - /** - * Creates or finds a CertificatePermissions from its string representation. - * - * @param name a name to look for. - * @return the corresponding CertificatePermissions. - */ - @JsonCreator - public static CertificatePermissions fromString(String name) { - return fromString(name, CertificatePermissions.class); - } - - /** @return known CertificatePermissions values. */ - public static Collection values() { - return values(CertificatePermissions.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/CheckNameAvailabilityResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/CheckNameAvailabilityResult.java deleted file mode 100644 index dfd2c566c4f5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/CheckNameAvailabilityResult.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.keyvault.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.keyvault.fluent.models.CheckNameAvailabilityResultInner; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; - -/** The CheckNameAvailability operation response wrapper. */ -@Fluent -public interface CheckNameAvailabilityResult extends HasInnerModel { - - /** - * Get the nameAvailable value. - * - * @return the nameAvailable value - */ - Boolean nameAvailable(); - - /** - * Get the reason value. - * - * @return the reason value - */ - Reason reason(); - - /** - * Get the message value. - * - * @return the message value - */ - String message(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/CreateMode.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/CreateMode.java deleted file mode 100644 index fefd32d99ecb..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/CreateMode.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.keyvault.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for CreateMode. */ -public enum CreateMode { - /** Enum value recover. */ - RECOVER("recover"), - - /** Enum value default. */ - DEFAULT("default"); - - /** The actual serialized value for a CreateMode instance. */ - private final String value; - - CreateMode(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a CreateMode instance. - * - * @param value the serialized value to parse. - * @return the parsed CreateMode object, or null if unable to parse. - */ - @JsonCreator - public static CreateMode fromString(String value) { - CreateMode[] items = CreateMode.values(); - for (CreateMode item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/DeletedVault.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/DeletedVault.java deleted file mode 100644 index d3a77c13f0ba..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/DeletedVault.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.keyvault.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.keyvault.fluent.models.DeletedVaultInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasId; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasName; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import java.time.OffsetDateTime; -import java.util.Map; - -/** An immutable client-side representation of an Azure Key Vault. */ -@Fluent -public interface DeletedVault extends HasInnerModel, HasName, HasId { - - /** - * Get the location value. - * - * @return the location value - */ - String location(); - - /** - * Get the deletionDate value. - * - * @return the deletionDate value - */ - OffsetDateTime deletionDate(); - - /** - * Get the scheduledPurgeDate value. - * - * @return the scheduledPurgeDate value - */ - OffsetDateTime scheduledPurgeDate(); - - /** - * Get the tags value. - * - * @return the tags value - */ - Map tags(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/DeletedVaultListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/DeletedVaultListResult.java deleted file mode 100644 index 21f8765fa28a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/DeletedVaultListResult.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.keyvault.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.keyvault.fluent.models.DeletedVaultInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** List of vaults. */ -@Fluent -public final class DeletedVaultListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DeletedVaultListResult.class); - - /* - * The list of deleted vaults. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to get the next set of deleted vaults. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: The list of deleted vaults. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The list of deleted vaults. - * - * @param value the value value to set. - * @return the DeletedVaultListResult object itself. - */ - public DeletedVaultListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to get the next set of deleted vaults. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The URL to get the next set of deleted vaults. - * - * @param nextLink the nextLink value to set. - * @return the DeletedVaultListResult object itself. - */ - public DeletedVaultListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/DeletedVaultProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/DeletedVaultProperties.java deleted file mode 100644 index 1f654f18f841..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/DeletedVaultProperties.java +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.keyvault.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.Map; - -/** Properties of the deleted vault. */ -@Immutable -public final class DeletedVaultProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DeletedVaultProperties.class); - - /* - * The resource id of the original vault. - */ - @JsonProperty(value = "vaultId", access = JsonProperty.Access.WRITE_ONLY) - private String vaultId; - - /* - * The location of the original vault. - */ - @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) - private String location; - - /* - * The deleted date. - */ - @JsonProperty(value = "deletionDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime deletionDate; - - /* - * The scheduled purged date. - */ - @JsonProperty(value = "scheduledPurgeDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime scheduledPurgeDate; - - /* - * Tags of the original vault. - */ - @JsonProperty(value = "tags", access = JsonProperty.Access.WRITE_ONLY) - private Map tags; - - /* - * Purge protection status of the original vault. - */ - @JsonProperty(value = "purgeProtectionEnabled", access = JsonProperty.Access.WRITE_ONLY) - private Boolean purgeProtectionEnabled; - - /** - * Get the vaultId property: The resource id of the original vault. - * - * @return the vaultId value. - */ - public String vaultId() { - return this.vaultId; - } - - /** - * Get the location property: The location of the original vault. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Get the deletionDate property: The deleted date. - * - * @return the deletionDate value. - */ - public OffsetDateTime deletionDate() { - return this.deletionDate; - } - - /** - * Get the scheduledPurgeDate property: The scheduled purged date. - * - * @return the scheduledPurgeDate value. - */ - public OffsetDateTime scheduledPurgeDate() { - return this.scheduledPurgeDate; - } - - /** - * Get the tags property: Tags of the original vault. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Get the purgeProtectionEnabled property: Purge protection status of the original vault. - * - * @return the purgeProtectionEnabled value. - */ - public Boolean purgeProtectionEnabled() { - return this.purgeProtectionEnabled; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/DimensionProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/DimensionProperties.java deleted file mode 100644 index a09b3ca552c2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/DimensionProperties.java +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.keyvault.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Type of operation: get, read, delete, etc. */ -@Fluent -public final class DimensionProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DimensionProperties.class); - - /* - * Name of dimension. - */ - @JsonProperty(value = "name") - private String name; - - /* - * Display name of dimension. - */ - @JsonProperty(value = "displayName") - private String displayName; - - /* - * Property to specify whether the dimension should be exported for - * shoebox. - */ - @JsonProperty(value = "toBeExportedForShoebox") - private Boolean toBeExportedForShoebox; - - /** - * Get the name property: Name of dimension. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Name of dimension. - * - * @param name the name value to set. - * @return the DimensionProperties object itself. - */ - public DimensionProperties withName(String name) { - this.name = name; - return this; - } - - /** - * Get the displayName property: Display name of dimension. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Set the displayName property: Display name of dimension. - * - * @param displayName the displayName value to set. - * @return the DimensionProperties object itself. - */ - public DimensionProperties withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - - /** - * Get the toBeExportedForShoebox property: Property to specify whether the dimension should be exported for - * shoebox. - * - * @return the toBeExportedForShoebox value. - */ - public Boolean toBeExportedForShoebox() { - return this.toBeExportedForShoebox; - } - - /** - * Set the toBeExportedForShoebox property: Property to specify whether the dimension should be exported for - * shoebox. - * - * @param toBeExportedForShoebox the toBeExportedForShoebox value to set. - * @return the DimensionProperties object itself. - */ - public DimensionProperties withToBeExportedForShoebox(Boolean toBeExportedForShoebox) { - this.toBeExportedForShoebox = toBeExportedForShoebox; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/IpRule.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/IpRule.java deleted file mode 100644 index 4f6ac4bff1e3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/IpRule.java +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.keyvault.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** A rule governing the accessibility of a vault from a specific ip address or ip range. */ -@Fluent -public final class IpRule { - @JsonIgnore private final ClientLogger logger = new ClientLogger(IpRule.class); - - /* - * An IPv4 address range in CIDR notation, such as '124.56.78.91' (simple - * IP address) or '124.56.78.0/24' (all addresses that start with - * 124.56.78). - */ - @JsonProperty(value = "value", required = true) - private String value; - - /** - * Get the value property: An IPv4 address range in CIDR notation, such as '124.56.78.91' (simple IP address) or - * '124.56.78.0/24' (all addresses that start with 124.56.78). - * - * @return the value value. - */ - public String value() { - return this.value; - } - - /** - * Set the value property: An IPv4 address range in CIDR notation, such as '124.56.78.91' (simple IP address) or - * '124.56.78.0/24' (all addresses that start with 124.56.78). - * - * @param value the value value to set. - * @return the IpRule object itself. - */ - public IpRule withValue(String value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError(new IllegalArgumentException("Missing required property value in model IpRule")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/Key.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/Key.java deleted file mode 100644 index 288d5ea9a909..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/Key.java +++ /dev/null @@ -1,393 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.keyvault.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.keyvault.models.Key.DefinitionStages.WithKey; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasId; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasName; -import com.azure.resourcemanager.resources.fluentcore.model.Appliable; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.model.Indexable; -import com.azure.resourcemanager.resources.fluentcore.model.Updatable; -import com.azure.security.keyvault.keys.cryptography.models.EncryptionAlgorithm; -import com.azure.security.keyvault.keys.cryptography.models.KeyWrapAlgorithm; -import com.azure.security.keyvault.keys.cryptography.models.SignatureAlgorithm; -import com.azure.security.keyvault.keys.models.JsonWebKey; -import com.azure.security.keyvault.keys.models.KeyCurveName; -import com.azure.security.keyvault.keys.models.KeyOperation; -import com.azure.security.keyvault.keys.models.KeyProperties; -import com.azure.security.keyvault.keys.models.KeyType; -import java.util.List; -import java.util.Map; -import reactor.core.publisher.Mono; - -/** An immutable client-side representation of an Azure Key Vault key. */ -@Fluent -public interface Key extends Indexable, HasInnerModel, HasId, HasName, Updatable { - /** @return the Json web key. */ - JsonWebKey getJsonWebKey(); - - /** @return the Json web key. */ - Mono getJsonWebKeyAsync(); - - /** @return the key management attributes. */ - KeyProperties attributes(); - - /** @return application specific metadata in the form of key-value pairs. */ - Map tags(); - - /** - * @return true if the key's lifetime is managed by key vault. If this is a key backing a certificate, then managed - * will be true. - */ - boolean managed(); - - /** @return a list of individual key versions with the same key name */ - PagedIterable listVersions(); - - /** @return a list of individual key versions with the same key name */ - PagedFlux listVersionsAsync(); - - /** @return a backup of the specified key be downloaded to the client */ - byte[] backup(); - - /** @return a backup of the specified key be downloaded to the client */ - Mono backupAsync(); - - /** - * Encrypts an arbitrary sequence of bytes using an encryption key that is stored in a key vault. - * - * @param algorithm the JWK encryption algorithm - * @param content the content to be encrypted - * @return the encrypted value - */ - byte[] encrypt(EncryptionAlgorithm algorithm, byte[] content); - - /** - * Encrypts an arbitrary sequence of bytes using an encryption key that is stored in a key vault. - * - * @param algorithm the JWK encryption algorithm - * @param content the content to be encrypted - * @return the encrypted value - */ - Mono encryptAsync(EncryptionAlgorithm algorithm, byte[] content); - - /** - * Decrypts a single block of encrypted data. - * - * @param algorithm the JWK encryption algorithm - * @param content the content to be decrypted - * @return the decrypted value - */ - byte[] decrypt(EncryptionAlgorithm algorithm, byte[] content); - - /** - * Decrypts a single block of encrypted data. - * - * @param algorithm the JWK encryption algorithm - * @param content the content to be decrypted - * @return the decrypted value - */ - Mono decryptAsync(EncryptionAlgorithm algorithm, byte[] content); - - /** - * Creates a signature from a digest. - * - * @param algorithm the JWK signing algorithm - * @param digest the content to be signed - * @return the signature in a byte array - */ - byte[] sign(SignatureAlgorithm algorithm, byte[] digest); - - /** - * Creates a signature from a digest. - * - * @param algorithm the JWK signing algorithm - * @param digest the content to be signed - * @return the signature in a byte array - */ - Mono signAsync(SignatureAlgorithm algorithm, byte[] digest); - - /** - * Verifies a signature from a digest. - * - * @param algorithm the JWK signing algorithm - * @param digest the content to be signed - * @param signature the signature to verify - * @return true if the signature is valid - */ - boolean verify(SignatureAlgorithm algorithm, byte[] digest, byte[] signature); - - /** - * Verifies a signature from a digest. - * - * @param algorithm the JWK signing algorithm - * @param digest the content to be signed - * @param signature the signature to verify - * @return true if the signature is valid - */ - Mono verifyAsync(SignatureAlgorithm algorithm, byte[] digest, byte[] signature); - - /** - * Wraps a symmetric key using the specified algorithm. - * - * @param algorithm the JWK encryption algorithm - * @param key the symmetric key to wrap - * @return the wrapped key - */ - byte[] wrapKey(KeyWrapAlgorithm algorithm, byte[] key); - - /** - * Wraps a symmetric key using the specified algorithm. - * - * @param algorithm the JWK encryption algorithm - * @param key the symmetric key to wrap - * @return the wrapped key - */ - Mono wrapKeyAsync(KeyWrapAlgorithm algorithm, byte[] key); - - /** - * Unwraps a symmetric key wrapped originally by this Key Vault key. - * - * @param algorithm the JWK encryption algorithm - * @param key the key to unwrap - * @return the unwrapped symmetric key - */ - byte[] unwrapKey(KeyWrapAlgorithm algorithm, byte[] key); - - /** - * Unwraps a symmetric key wrapped originally by this Key Vault key. - * - * @param algorithm the JWK encryption algorithm - * @param key the key to unwrap - * @return the unwrapped symmetric key - */ - Mono unwrapKeyAsync(KeyWrapAlgorithm algorithm, byte[] key); - - /** Container interface for all the definitions. */ - interface Definition - extends DefinitionStages.Blank, WithKey, DefinitionStages.WithImport, DefinitionStages.WithCreate { - } - - /** Grouping of key definition stages. */ - interface DefinitionStages { - /** The first stage of a key definition. */ - interface Blank extends WithKey { - } - - /** The stage of a key definition allowing to specify whether to create a key or to import a key. */ - interface WithKey { - /** - * Specifies a key type to create a new key. - * - * @param keyType the JWK type to create - * @return the next stage of the definition - */ - WithCreate withKeyTypeToCreate(KeyType keyType); - - /** - * Specifies an existing key to import. - * - * @param key the existing JWK to import - * @return the next stage of the definition - */ - WithImport withLocalKeyToImport(JsonWebKey key); - } - - /** The stage of a key definition allowing to specify the key size. */ - interface WithKeySize { - /** - * Specifies the size of the RSA key to create. - * - * @param size the size of the key in integer - * @return the next stage of the definition - */ - WithCreate withKeySize(int size); - - /** - * Specifies the name of the key curve for elliptic-curve key to create. - * - * @param keyCurveName name of the key curve - * @return the next stage of the definition - */ - WithCreate withKeyCurveName(KeyCurveName keyCurveName); - } - - /** The stage of a key definition allowing to specify the allowed operations for the key. */ - interface WithKeyOperations { - /** - * Specifies the list of allowed key operations. By default all operations are allowed. - * - * @param keyOperations the list of JWK operations - * @return the next stage of the definition - */ - WithCreate withKeyOperations(List keyOperations); - - /** - * Specifies the list of allowed key operations. By default all operations are allowed. - * - * @param keyOperations the list of JWK operations - * @return the next stage of the definition - */ - WithCreate withKeyOperations(KeyOperation... keyOperations); - } - - /** The stage of a key definition allowing to specify whether to store the key in hardware security modules. */ - interface WithHsm { - /** - * Specifies whether to store the key in hardware security modules. - * - * @param isHsm store in Hsm if true - * @return the next stage of the definition - */ - WithImport withHsm(boolean isHsm); - } - - /** The stage of a key definition allowing to specify the attributes of the key. */ - interface WithAttributes { - /** - * Specifies the attributes of the key. - * - * @param attributes the object attributes managed by Key Vault service - * @return the next stage of the definition - */ - WithCreate withAttributes(KeyProperties attributes); - } - - /** The stage of a key definition allowing to specify the tags of the key. */ - interface WithTags { - /** - * Specifies the tags on the key. - * - * @param tags the key value pair of the tags - * @return the next stage of the definition - */ - WithCreate withTags(Map tags); - } - - /** The base stage of the key definition allowing for any other optional settings to be specified. */ - interface WithCreateBase extends Creatable, WithAttributes, WithTags { - } - - /** - * The stage of the key definition which contains all the minimum required inputs for the key to be created but - * also allows for any other optional settings to be specified. - */ - interface WithCreate extends WithKeyOperations, WithKeySize, WithCreateBase { - } - - /** - * The stage of the key definition which contains all the minimum required inputs for the key to be imported but - * also allows for any other optional settings to be specified. - */ - interface WithImport extends WithHsm, WithCreateBase { - } - } - - /** Grouping of key update stages. */ - interface UpdateStages { - /** The stage of a key update allowing to create a new version of the key. */ - interface WithKey { - /** - * Specifies a key type to create a new key version. - * - * @param keyType the JWK type to create - * @return the next stage of the update - */ - UpdateWithCreate withKeyTypeToCreate(KeyType keyType); - - /** - * Specifies an existing key to import as a new version. - * - * @param key the existing JWK to import - * @return the next stage of the update - */ - UpdateWithImport withLocalKeyToImport(JsonWebKey key); - } - - /** The stage of a key update allowing to specify the key size. */ - interface WithKeySize { - /** - * Specifies the size of the key to create. - * - * @param size the size of the key in integer - * @return the next stage of the update - */ - UpdateWithCreate withKeySize(int size); - } - - /** The stage of a key update allowing to specify whether to store the key in hardware security modules. */ - interface WithHsm { - /** - * Specifies whether to store the key in hardware security modules. - * - * @param isHsm store in Hsm if true - * @return the next stage of the update - */ - UpdateWithImport withHsm(boolean isHsm); - } - - /** The stage of a key update allowing to specify the allowed operations for the key. */ - interface WithKeyOperations { - /** - * Specifies the list of allowed key operations. By default all operations are allowed. - * - * @param keyOperations the list of JWK operations - * @return the next stage of the update - */ - Update withKeyOperations(List keyOperations); - - /** - * Specifies the list of allowed key operations. By default all operations are allowed. - * - * @param keyOperations the list of JWK operations - * @return the next stage of the update - */ - Update withKeyOperations(KeyOperation... keyOperations); - } - - /** The stage of a key update allowing to specify the attributes of the key. */ - interface WithAttributes { - /** - * Specifies the attributes of the key. - * - * @param attributes the object attributes managed by Key Vault service - * @return the next stage of the update - */ - Update withAttributes(KeyProperties attributes); - } - - /** The stage of a key update allowing to specify the tags of the key. */ - interface WithTags { - /** - * Specifies the tags on the key. - * - * @param tags the key value pair of the tags - * @return the next stage of the update - */ - Update withTags(Map tags); - } - } - - /** The template for a key update operation, containing all the settings that can be modified. */ - interface Update - extends Appliable, - UpdateStages.WithKey, - UpdateStages.WithKeyOperations, - UpdateStages.WithAttributes, - UpdateStages.WithTags { - } - - /** The template for a key vault update operation, with a new key version to be created. */ - interface UpdateWithCreate extends Update, UpdateStages.WithKeySize { - } - - /** The template for a key vault update operation, with a new key version to be imported. */ - interface UpdateWithImport extends Update, UpdateStages.WithHsm { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/KeyPermissions.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/KeyPermissions.java deleted file mode 100644 index 53316289fedf..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/KeyPermissions.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.keyvault.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for KeyPermissions. */ -public final class KeyPermissions extends ExpandableStringEnum { - /** Static value all for KeyPermissions. */ - public static final KeyPermissions ALL = fromString("all"); - - /** Static value encrypt for KeyPermissions. */ - public static final KeyPermissions ENCRYPT = fromString("encrypt"); - - /** Static value decrypt for KeyPermissions. */ - public static final KeyPermissions DECRYPT = fromString("decrypt"); - - /** Static value wrapKey for KeyPermissions. */ - public static final KeyPermissions WRAP_KEY = fromString("wrapKey"); - - /** Static value unwrapKey for KeyPermissions. */ - public static final KeyPermissions UNWRAP_KEY = fromString("unwrapKey"); - - /** Static value sign for KeyPermissions. */ - public static final KeyPermissions SIGN = fromString("sign"); - - /** Static value verify for KeyPermissions. */ - public static final KeyPermissions VERIFY = fromString("verify"); - - /** Static value get for KeyPermissions. */ - public static final KeyPermissions GET = fromString("get"); - - /** Static value list for KeyPermissions. */ - public static final KeyPermissions LIST = fromString("list"); - - /** Static value create for KeyPermissions. */ - public static final KeyPermissions CREATE = fromString("create"); - - /** Static value update for KeyPermissions. */ - public static final KeyPermissions UPDATE = fromString("update"); - - /** Static value import for KeyPermissions. */ - public static final KeyPermissions IMPORT = fromString("import"); - - /** Static value delete for KeyPermissions. */ - public static final KeyPermissions DELETE = fromString("delete"); - - /** Static value backup for KeyPermissions. */ - public static final KeyPermissions BACKUP = fromString("backup"); - - /** Static value restore for KeyPermissions. */ - public static final KeyPermissions RESTORE = fromString("restore"); - - /** Static value recover for KeyPermissions. */ - public static final KeyPermissions RECOVER = fromString("recover"); - - /** Static value purge for KeyPermissions. */ - public static final KeyPermissions PURGE = fromString("purge"); - - /** - * Creates or finds a KeyPermissions from its string representation. - * - * @param name a name to look for. - * @return the corresponding KeyPermissions. - */ - @JsonCreator - public static KeyPermissions fromString(String name) { - return fromString(name, KeyPermissions.class); - } - - /** @return known KeyPermissions values. */ - public static Collection values() { - return values(KeyPermissions.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/Keys.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/Keys.java deleted file mode 100644 index 1d4b76a593b2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/Keys.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.keyvault.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingByName; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsCreating; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingById; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; -import reactor.core.publisher.Mono; - -/** Entry point for Key Vault keys API. */ -@Fluent -public interface Keys - extends SupportsCreating, - SupportsDeletingById, - SupportsGettingById, - SupportsGettingByName, - SupportsListing { - /** - * Gets a Key Vault key. - * - * @param name the name of the key - * @param version the version of the key - * @return the key - */ - Key getByNameAndVersion(String name, String version); - - /** - * Gets a Key Vault key. - * - * @param name the name of the key - * @param version the version of the key - * @return the key - */ - Mono getByNameAndVersionAsync(String name, String version); - - /** - * Restores a backup key into a Key Vault key. - * - * @param backup the backup key - * @return the key restored from the backup - */ - Key restore(byte[] backup); - - /** - * Restores a backup key into a Key Vault key. - * - * @param backup the backup key - * @return the key restored from the backup - */ - Mono restoreAsync(byte[] backup); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/LogSpecification.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/LogSpecification.java deleted file mode 100644 index bff95df70c31..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/LogSpecification.java +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.keyvault.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Log specification of operation. */ -@Fluent -public final class LogSpecification { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LogSpecification.class); - - /* - * Name of log specification. - */ - @JsonProperty(value = "name") - private String name; - - /* - * Display name of log specification. - */ - @JsonProperty(value = "displayName") - private String displayName; - - /* - * Blob duration of specification. - */ - @JsonProperty(value = "blobDuration") - private String blobDuration; - - /** - * Get the name property: Name of log specification. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Name of log specification. - * - * @param name the name value to set. - * @return the LogSpecification object itself. - */ - public LogSpecification withName(String name) { - this.name = name; - return this; - } - - /** - * Get the displayName property: Display name of log specification. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Set the displayName property: Display name of log specification. - * - * @param displayName the displayName value to set. - * @return the LogSpecification object itself. - */ - public LogSpecification withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - - /** - * Get the blobDuration property: Blob duration of specification. - * - * @return the blobDuration value. - */ - public String blobDuration() { - return this.blobDuration; - } - - /** - * Set the blobDuration property: Blob duration of specification. - * - * @param blobDuration the blobDuration value to set. - * @return the LogSpecification object itself. - */ - public LogSpecification withBlobDuration(String blobDuration) { - this.blobDuration = blobDuration; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/MetricSpecification.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/MetricSpecification.java deleted file mode 100644 index 370ea96b61c1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/MetricSpecification.java +++ /dev/null @@ -1,318 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.keyvault.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Metric specification of operation. */ -@Fluent -public final class MetricSpecification { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MetricSpecification.class); - - /* - * Name of metric specification. - */ - @JsonProperty(value = "name") - private String name; - - /* - * Display name of Metric specification. - */ - @JsonProperty(value = "displayName") - private String displayName; - - /* - * Display description of Metric specification. - */ - @JsonProperty(value = "displayDescription") - private String displayDescription; - - /* - * The metric unit. Possible values include: 'Bytes', 'Count', - * 'Milliseconds'. - */ - @JsonProperty(value = "unit") - private String unit; - - /* - * The metric aggregation type. Possible values include: 'Average', - * 'Count', 'Total'. - */ - @JsonProperty(value = "aggregationType") - private String aggregationType; - - /* - * The supported aggregation types for the metrics. - */ - @JsonProperty(value = "supportedAggregationTypes") - private List supportedAggregationTypes; - - /* - * The supported time grain types for the metrics. - */ - @JsonProperty(value = "supportedTimeGrainTypes") - private List supportedTimeGrainTypes; - - /* - * The metric lock aggregation type. - */ - @JsonProperty(value = "lockAggregationType") - private String lockAggregationType; - - /* - * The dimensions of metric - */ - @JsonProperty(value = "dimensions") - private List dimensions; - - /* - * Property to specify whether to fill gap with zero. - */ - @JsonProperty(value = "fillGapWithZero") - private Boolean fillGapWithZero; - - /* - * The internal metric name. - */ - @JsonProperty(value = "internalMetricName") - private String internalMetricName; - - /** - * Get the name property: Name of metric specification. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Name of metric specification. - * - * @param name the name value to set. - * @return the MetricSpecification object itself. - */ - public MetricSpecification withName(String name) { - this.name = name; - return this; - } - - /** - * Get the displayName property: Display name of Metric specification. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Set the displayName property: Display name of Metric specification. - * - * @param displayName the displayName value to set. - * @return the MetricSpecification object itself. - */ - public MetricSpecification withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - - /** - * Get the displayDescription property: Display description of Metric specification. - * - * @return the displayDescription value. - */ - public String displayDescription() { - return this.displayDescription; - } - - /** - * Set the displayDescription property: Display description of Metric specification. - * - * @param displayDescription the displayDescription value to set. - * @return the MetricSpecification object itself. - */ - public MetricSpecification withDisplayDescription(String displayDescription) { - this.displayDescription = displayDescription; - return this; - } - - /** - * Get the unit property: The metric unit. Possible values include: 'Bytes', 'Count', 'Milliseconds'. - * - * @return the unit value. - */ - public String unit() { - return this.unit; - } - - /** - * Set the unit property: The metric unit. Possible values include: 'Bytes', 'Count', 'Milliseconds'. - * - * @param unit the unit value to set. - * @return the MetricSpecification object itself. - */ - public MetricSpecification withUnit(String unit) { - this.unit = unit; - return this; - } - - /** - * Get the aggregationType property: The metric aggregation type. Possible values include: 'Average', 'Count', - * 'Total'. - * - * @return the aggregationType value. - */ - public String aggregationType() { - return this.aggregationType; - } - - /** - * Set the aggregationType property: The metric aggregation type. Possible values include: 'Average', 'Count', - * 'Total'. - * - * @param aggregationType the aggregationType value to set. - * @return the MetricSpecification object itself. - */ - public MetricSpecification withAggregationType(String aggregationType) { - this.aggregationType = aggregationType; - return this; - } - - /** - * Get the supportedAggregationTypes property: The supported aggregation types for the metrics. - * - * @return the supportedAggregationTypes value. - */ - public List supportedAggregationTypes() { - return this.supportedAggregationTypes; - } - - /** - * Set the supportedAggregationTypes property: The supported aggregation types for the metrics. - * - * @param supportedAggregationTypes the supportedAggregationTypes value to set. - * @return the MetricSpecification object itself. - */ - public MetricSpecification withSupportedAggregationTypes(List supportedAggregationTypes) { - this.supportedAggregationTypes = supportedAggregationTypes; - return this; - } - - /** - * Get the supportedTimeGrainTypes property: The supported time grain types for the metrics. - * - * @return the supportedTimeGrainTypes value. - */ - public List supportedTimeGrainTypes() { - return this.supportedTimeGrainTypes; - } - - /** - * Set the supportedTimeGrainTypes property: The supported time grain types for the metrics. - * - * @param supportedTimeGrainTypes the supportedTimeGrainTypes value to set. - * @return the MetricSpecification object itself. - */ - public MetricSpecification withSupportedTimeGrainTypes(List supportedTimeGrainTypes) { - this.supportedTimeGrainTypes = supportedTimeGrainTypes; - return this; - } - - /** - * Get the lockAggregationType property: The metric lock aggregation type. - * - * @return the lockAggregationType value. - */ - public String lockAggregationType() { - return this.lockAggregationType; - } - - /** - * Set the lockAggregationType property: The metric lock aggregation type. - * - * @param lockAggregationType the lockAggregationType value to set. - * @return the MetricSpecification object itself. - */ - public MetricSpecification withLockAggregationType(String lockAggregationType) { - this.lockAggregationType = lockAggregationType; - return this; - } - - /** - * Get the dimensions property: The dimensions of metric. - * - * @return the dimensions value. - */ - public List dimensions() { - return this.dimensions; - } - - /** - * Set the dimensions property: The dimensions of metric. - * - * @param dimensions the dimensions value to set. - * @return the MetricSpecification object itself. - */ - public MetricSpecification withDimensions(List dimensions) { - this.dimensions = dimensions; - return this; - } - - /** - * Get the fillGapWithZero property: Property to specify whether to fill gap with zero. - * - * @return the fillGapWithZero value. - */ - public Boolean fillGapWithZero() { - return this.fillGapWithZero; - } - - /** - * Set the fillGapWithZero property: Property to specify whether to fill gap with zero. - * - * @param fillGapWithZero the fillGapWithZero value to set. - * @return the MetricSpecification object itself. - */ - public MetricSpecification withFillGapWithZero(Boolean fillGapWithZero) { - this.fillGapWithZero = fillGapWithZero; - return this; - } - - /** - * Get the internalMetricName property: The internal metric name. - * - * @return the internalMetricName value. - */ - public String internalMetricName() { - return this.internalMetricName; - } - - /** - * Set the internalMetricName property: The internal metric name. - * - * @param internalMetricName the internalMetricName value to set. - * @return the MetricSpecification object itself. - */ - public MetricSpecification withInternalMetricName(String internalMetricName) { - this.internalMetricName = internalMetricName; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (dimensions() != null) { - dimensions().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/NetworkRuleAction.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/NetworkRuleAction.java deleted file mode 100644 index 2738c4222f0f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/NetworkRuleAction.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.keyvault.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for NetworkRuleAction. */ -public final class NetworkRuleAction extends ExpandableStringEnum { - /** Static value Allow for NetworkRuleAction. */ - public static final NetworkRuleAction ALLOW = fromString("Allow"); - - /** Static value Deny for NetworkRuleAction. */ - public static final NetworkRuleAction DENY = fromString("Deny"); - - /** - * Creates or finds a NetworkRuleAction from its string representation. - * - * @param name a name to look for. - * @return the corresponding NetworkRuleAction. - */ - @JsonCreator - public static NetworkRuleAction fromString(String name) { - return fromString(name, NetworkRuleAction.class); - } - - /** @return known NetworkRuleAction values. */ - public static Collection values() { - return values(NetworkRuleAction.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/NetworkRuleBypassOptions.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/NetworkRuleBypassOptions.java deleted file mode 100644 index e229d5b108cf..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/NetworkRuleBypassOptions.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.keyvault.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for NetworkRuleBypassOptions. */ -public final class NetworkRuleBypassOptions extends ExpandableStringEnum { - /** Static value AzureServices for NetworkRuleBypassOptions. */ - public static final NetworkRuleBypassOptions AZURE_SERVICES = fromString("AzureServices"); - - /** Static value None for NetworkRuleBypassOptions. */ - public static final NetworkRuleBypassOptions NONE = fromString("None"); - - /** - * Creates or finds a NetworkRuleBypassOptions from its string representation. - * - * @param name a name to look for. - * @return the corresponding NetworkRuleBypassOptions. - */ - @JsonCreator - public static NetworkRuleBypassOptions fromString(String name) { - return fromString(name, NetworkRuleBypassOptions.class); - } - - /** @return known NetworkRuleBypassOptions values. */ - public static Collection values() { - return values(NetworkRuleBypassOptions.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/NetworkRuleSet.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/NetworkRuleSet.java deleted file mode 100644 index a8d8e90bc931..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/NetworkRuleSet.java +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.keyvault.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** A set of rules governing the network accessibility of a vault. */ -@Fluent -public final class NetworkRuleSet { - @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkRuleSet.class); - - /* - * Tells what traffic can bypass network rules. This can be 'AzureServices' - * or 'None'. If not specified the default is 'AzureServices'. - */ - @JsonProperty(value = "bypass") - private NetworkRuleBypassOptions bypass; - - /* - * The default action when no rule from ipRules and from - * virtualNetworkRules match. This is only used after the bypass property - * has been evaluated. - */ - @JsonProperty(value = "defaultAction") - private NetworkRuleAction defaultAction; - - /* - * The list of IP address rules. - */ - @JsonProperty(value = "ipRules") - private List ipRules; - - /* - * The list of virtual network rules. - */ - @JsonProperty(value = "virtualNetworkRules") - private List virtualNetworkRules; - - /** - * Get the bypass property: Tells what traffic can bypass network rules. This can be 'AzureServices' or 'None'. If - * not specified the default is 'AzureServices'. - * - * @return the bypass value. - */ - public NetworkRuleBypassOptions bypass() { - return this.bypass; - } - - /** - * Set the bypass property: Tells what traffic can bypass network rules. This can be 'AzureServices' or 'None'. If - * not specified the default is 'AzureServices'. - * - * @param bypass the bypass value to set. - * @return the NetworkRuleSet object itself. - */ - public NetworkRuleSet withBypass(NetworkRuleBypassOptions bypass) { - this.bypass = bypass; - return this; - } - - /** - * Get the defaultAction property: The default action when no rule from ipRules and from virtualNetworkRules match. - * This is only used after the bypass property has been evaluated. - * - * @return the defaultAction value. - */ - public NetworkRuleAction defaultAction() { - return this.defaultAction; - } - - /** - * Set the defaultAction property: The default action when no rule from ipRules and from virtualNetworkRules match. - * This is only used after the bypass property has been evaluated. - * - * @param defaultAction the defaultAction value to set. - * @return the NetworkRuleSet object itself. - */ - public NetworkRuleSet withDefaultAction(NetworkRuleAction defaultAction) { - this.defaultAction = defaultAction; - return this; - } - - /** - * Get the ipRules property: The list of IP address rules. - * - * @return the ipRules value. - */ - public List ipRules() { - return this.ipRules; - } - - /** - * Set the ipRules property: The list of IP address rules. - * - * @param ipRules the ipRules value to set. - * @return the NetworkRuleSet object itself. - */ - public NetworkRuleSet withIpRules(List ipRules) { - this.ipRules = ipRules; - return this; - } - - /** - * Get the virtualNetworkRules property: The list of virtual network rules. - * - * @return the virtualNetworkRules value. - */ - public List virtualNetworkRules() { - return this.virtualNetworkRules; - } - - /** - * Set the virtualNetworkRules property: The list of virtual network rules. - * - * @param virtualNetworkRules the virtualNetworkRules value to set. - * @return the NetworkRuleSet object itself. - */ - public NetworkRuleSet withVirtualNetworkRules(List virtualNetworkRules) { - this.virtualNetworkRules = virtualNetworkRules; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (ipRules() != null) { - ipRules().forEach(e -> e.validate()); - } - if (virtualNetworkRules() != null) { - virtualNetworkRules().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/OperationDisplay.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/OperationDisplay.java deleted file mode 100644 index 4fa8b6979d9e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/OperationDisplay.java +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.keyvault.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Display metadata associated with the operation. */ -@Fluent -public final class OperationDisplay { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationDisplay.class); - - /* - * Service provider: Microsoft Key Vault. - */ - @JsonProperty(value = "provider") - private String provider; - - /* - * Resource on which the operation is performed etc. - */ - @JsonProperty(value = "resource") - private String resource; - - /* - * Type of operation: get, read, delete, etc. - */ - @JsonProperty(value = "operation") - private String operation; - - /* - * Description of operation. - */ - @JsonProperty(value = "description") - private String description; - - /** - * Get the provider property: Service provider: Microsoft Key Vault. - * - * @return the provider value. - */ - public String provider() { - return this.provider; - } - - /** - * Set the provider property: Service provider: Microsoft Key Vault. - * - * @param provider the provider value to set. - * @return the OperationDisplay object itself. - */ - public OperationDisplay withProvider(String provider) { - this.provider = provider; - return this; - } - - /** - * Get the resource property: Resource on which the operation is performed etc. - * - * @return the resource value. - */ - public String resource() { - return this.resource; - } - - /** - * Set the resource property: Resource on which the operation is performed etc. - * - * @param resource the resource value to set. - * @return the OperationDisplay object itself. - */ - public OperationDisplay withResource(String resource) { - this.resource = resource; - return this; - } - - /** - * Get the operation property: Type of operation: get, read, delete, etc. - * - * @return the operation value. - */ - public String operation() { - return this.operation; - } - - /** - * Set the operation property: Type of operation: get, read, delete, etc. - * - * @param operation the operation value to set. - * @return the OperationDisplay object itself. - */ - public OperationDisplay withOperation(String operation) { - this.operation = operation; - return this; - } - - /** - * Get the description property: Description of operation. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: Description of operation. - * - * @param description the description value to set. - * @return the OperationDisplay object itself. - */ - public OperationDisplay withDescription(String description) { - this.description = description; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/OperationListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/OperationListResult.java deleted file mode 100644 index b30dd5102102..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/OperationListResult.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.keyvault.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.keyvault.fluent.models.OperationInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** - * Result of the request to list Storage operations. It contains a list of operations and a URL link to get the next set - * of results. - */ -@Fluent -public final class OperationListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationListResult.class); - - /* - * List of Storage operations supported by the Storage resource provider. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to get the next set of operations. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: List of Storage operations supported by the Storage resource provider. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: List of Storage operations supported by the Storage resource provider. - * - * @param value the value value to set. - * @return the OperationListResult object itself. - */ - public OperationListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to get the next set of operations. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The URL to get the next set of operations. - * - * @param nextLink the nextLink value to set. - * @return the OperationListResult object itself. - */ - public OperationListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/Permissions.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/Permissions.java deleted file mode 100644 index 823a39ba5f66..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/Permissions.java +++ /dev/null @@ -1,129 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.keyvault.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Permissions the identity has for keys, secrets, certificates and storage. */ -@Fluent -public final class Permissions { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Permissions.class); - - /* - * Permissions to keys - */ - @JsonProperty(value = "keys") - private List keys; - - /* - * Permissions to secrets - */ - @JsonProperty(value = "secrets") - private List secrets; - - /* - * Permissions to certificates - */ - @JsonProperty(value = "certificates") - private List certificates; - - /* - * Permissions to storage accounts - */ - @JsonProperty(value = "storage") - private List storage; - - /** - * Get the keys property: Permissions to keys. - * - * @return the keys value. - */ - public List keys() { - return this.keys; - } - - /** - * Set the keys property: Permissions to keys. - * - * @param keys the keys value to set. - * @return the Permissions object itself. - */ - public Permissions withKeys(List keys) { - this.keys = keys; - return this; - } - - /** - * Get the secrets property: Permissions to secrets. - * - * @return the secrets value. - */ - public List secrets() { - return this.secrets; - } - - /** - * Set the secrets property: Permissions to secrets. - * - * @param secrets the secrets value to set. - * @return the Permissions object itself. - */ - public Permissions withSecrets(List secrets) { - this.secrets = secrets; - return this; - } - - /** - * Get the certificates property: Permissions to certificates. - * - * @return the certificates value. - */ - public List certificates() { - return this.certificates; - } - - /** - * Set the certificates property: Permissions to certificates. - * - * @param certificates the certificates value to set. - * @return the Permissions object itself. - */ - public Permissions withCertificates(List certificates) { - this.certificates = certificates; - return this; - } - - /** - * Get the storage property: Permissions to storage accounts. - * - * @return the storage value. - */ - public List storage() { - return this.storage; - } - - /** - * Set the storage property: Permissions to storage accounts. - * - * @param storage the storage value to set. - * @return the Permissions object itself. - */ - public Permissions withStorage(List storage) { - this.storage = storage; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/PrivateEndpoint.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/PrivateEndpoint.java deleted file mode 100644 index 370259fbf145..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/PrivateEndpoint.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.keyvault.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Private endpoint object properties. */ -@Immutable -public final class PrivateEndpoint { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpoint.class); - - /* - * Full identifier of the private endpoint resource. - */ - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) - private String id; - - /** - * Get the id property: Full identifier of the private endpoint resource. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/PrivateEndpointConnectionItem.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/PrivateEndpointConnectionItem.java deleted file mode 100644 index 53dd2d7f3c60..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/PrivateEndpointConnectionItem.java +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.keyvault.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Private endpoint connection item. */ -@JsonFlatten -@Fluent -public class PrivateEndpointConnectionItem { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionItem.class); - - /* - * Id of private endpoint connection. - */ - @JsonProperty(value = "id") - private String id; - - /* - * Modified whenever there is a change in the state of private endpoint - * connection. - */ - @JsonProperty(value = "etag") - private String etag; - - /* - * Properties of the private endpoint object. - */ - @JsonProperty(value = "properties.privateEndpoint") - private PrivateEndpoint privateEndpoint; - - /* - * Approval state of the private link connection. - */ - @JsonProperty(value = "properties.privateLinkServiceConnectionState") - private PrivateLinkServiceConnectionState privateLinkServiceConnectionState; - - /* - * Provisioning state of the private endpoint connection. - */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private PrivateEndpointConnectionProvisioningState provisioningState; - - /** - * Get the id property: Id of private endpoint connection. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: Id of private endpoint connection. - * - * @param id the id value to set. - * @return the PrivateEndpointConnectionItem object itself. - */ - public PrivateEndpointConnectionItem withId(String id) { - this.id = id; - return this; - } - - /** - * Get the etag property: Modified whenever there is a change in the state of private endpoint connection. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: Modified whenever there is a change in the state of private endpoint connection. - * - * @param etag the etag value to set. - * @return the PrivateEndpointConnectionItem object itself. - */ - public PrivateEndpointConnectionItem withEtag(String etag) { - this.etag = etag; - return this; - } - - /** - * Get the privateEndpoint property: Properties of the private endpoint object. - * - * @return the privateEndpoint value. - */ - public PrivateEndpoint privateEndpoint() { - return this.privateEndpoint; - } - - /** - * Set the privateEndpoint property: Properties of the private endpoint object. - * - * @param privateEndpoint the privateEndpoint value to set. - * @return the PrivateEndpointConnectionItem object itself. - */ - public PrivateEndpointConnectionItem withPrivateEndpoint(PrivateEndpoint privateEndpoint) { - this.privateEndpoint = privateEndpoint; - return this; - } - - /** - * Get the privateLinkServiceConnectionState property: Approval state of the private link connection. - * - * @return the privateLinkServiceConnectionState value. - */ - public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { - return this.privateLinkServiceConnectionState; - } - - /** - * Set the privateLinkServiceConnectionState property: Approval state of the private link connection. - * - * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. - * @return the PrivateEndpointConnectionItem object itself. - */ - public PrivateEndpointConnectionItem withPrivateLinkServiceConnectionState( - PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { - this.privateLinkServiceConnectionState = privateLinkServiceConnectionState; - return this; - } - - /** - * Get the provisioningState property: Provisioning state of the private endpoint connection. - * - * @return the provisioningState value. - */ - public PrivateEndpointConnectionProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (privateEndpoint() != null) { - privateEndpoint().validate(); - } - if (privateLinkServiceConnectionState() != null) { - privateLinkServiceConnectionState().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/PrivateEndpointConnectionProvisioningState.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/PrivateEndpointConnectionProvisioningState.java deleted file mode 100644 index 47f1650c4b72..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/PrivateEndpointConnectionProvisioningState.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.keyvault.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for PrivateEndpointConnectionProvisioningState. */ -public final class PrivateEndpointConnectionProvisioningState - extends ExpandableStringEnum { - /** Static value Succeeded for PrivateEndpointConnectionProvisioningState. */ - public static final PrivateEndpointConnectionProvisioningState SUCCEEDED = fromString("Succeeded"); - - /** Static value Creating for PrivateEndpointConnectionProvisioningState. */ - public static final PrivateEndpointConnectionProvisioningState CREATING = fromString("Creating"); - - /** Static value Updating for PrivateEndpointConnectionProvisioningState. */ - public static final PrivateEndpointConnectionProvisioningState UPDATING = fromString("Updating"); - - /** Static value Deleting for PrivateEndpointConnectionProvisioningState. */ - public static final PrivateEndpointConnectionProvisioningState DELETING = fromString("Deleting"); - - /** Static value Failed for PrivateEndpointConnectionProvisioningState. */ - public static final PrivateEndpointConnectionProvisioningState FAILED = fromString("Failed"); - - /** Static value Disconnected for PrivateEndpointConnectionProvisioningState. */ - public static final PrivateEndpointConnectionProvisioningState DISCONNECTED = fromString("Disconnected"); - - /** - * Creates or finds a PrivateEndpointConnectionProvisioningState from its string representation. - * - * @param name a name to look for. - * @return the corresponding PrivateEndpointConnectionProvisioningState. - */ - @JsonCreator - public static PrivateEndpointConnectionProvisioningState fromString(String name) { - return fromString(name, PrivateEndpointConnectionProvisioningState.class); - } - - /** @return known PrivateEndpointConnectionProvisioningState values. */ - public static Collection values() { - return values(PrivateEndpointConnectionProvisioningState.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/PrivateEndpointConnectionsDeleteHeaders.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/PrivateEndpointConnectionsDeleteHeaders.java deleted file mode 100644 index f41a4e2fd6c3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/PrivateEndpointConnectionsDeleteHeaders.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.keyvault.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The PrivateEndpointConnectionsDeleteHeaders model. */ -@Fluent -public final class PrivateEndpointConnectionsDeleteHeaders { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionsDeleteHeaders.class); - - /* - * The Retry-After property. - */ - @JsonProperty(value = "Retry-After") - private Integer retryAfter; - - /* - * The Location property. - */ - @JsonProperty(value = "Location") - private String location; - - /** - * Get the retryAfter property: The Retry-After property. - * - * @return the retryAfter value. - */ - public Integer retryAfter() { - return this.retryAfter; - } - - /** - * Set the retryAfter property: The Retry-After property. - * - * @param retryAfter the retryAfter value to set. - * @return the PrivateEndpointConnectionsDeleteHeaders object itself. - */ - public PrivateEndpointConnectionsDeleteHeaders withRetryAfter(Integer retryAfter) { - this.retryAfter = retryAfter; - return this; - } - - /** - * Get the location property: The Location property. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Set the location property: The Location property. - * - * @param location the location value to set. - * @return the PrivateEndpointConnectionsDeleteHeaders object itself. - */ - public PrivateEndpointConnectionsDeleteHeaders withLocation(String location) { - this.location = location; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/PrivateEndpointConnectionsDeleteResponse.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/PrivateEndpointConnectionsDeleteResponse.java deleted file mode 100644 index 93093534adc6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/PrivateEndpointConnectionsDeleteResponse.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.keyvault.models; - -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.rest.ResponseBase; -import com.azure.resourcemanager.keyvault.fluent.models.PrivateEndpointConnectionInner; - -/** Contains all response data for the delete operation. */ -public final class PrivateEndpointConnectionsDeleteResponse - extends ResponseBase { - /** - * Creates an instance of PrivateEndpointConnectionsDeleteResponse. - * - * @param request the request which resulted in this PrivateEndpointConnectionsDeleteResponse. - * @param statusCode the status code of the HTTP response. - * @param rawHeaders the raw headers of the HTTP response. - * @param value the deserialized value of the HTTP response. - * @param headers the deserialized headers of the HTTP response. - */ - public PrivateEndpointConnectionsDeleteResponse( - HttpRequest request, - int statusCode, - HttpHeaders rawHeaders, - PrivateEndpointConnectionInner value, - PrivateEndpointConnectionsDeleteHeaders headers) { - super(request, statusCode, rawHeaders, value, headers); - } - - /** @return the deserialized response body. */ - @Override - public PrivateEndpointConnectionInner getValue() { - return super.getValue(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/PrivateEndpointConnectionsPutHeaders.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/PrivateEndpointConnectionsPutHeaders.java deleted file mode 100644 index 386d4ff18b00..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/PrivateEndpointConnectionsPutHeaders.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.keyvault.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The PrivateEndpointConnectionsPutHeaders model. */ -@Fluent -public final class PrivateEndpointConnectionsPutHeaders { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionsPutHeaders.class); - - /* - * The Retry-After property. - */ - @JsonProperty(value = "Retry-After") - private Integer retryAfter; - - /* - * The Azure-AsyncOperation property. - */ - @JsonProperty(value = "Azure-AsyncOperation") - private String azureAsyncOperation; - - /** - * Get the retryAfter property: The Retry-After property. - * - * @return the retryAfter value. - */ - public Integer retryAfter() { - return this.retryAfter; - } - - /** - * Set the retryAfter property: The Retry-After property. - * - * @param retryAfter the retryAfter value to set. - * @return the PrivateEndpointConnectionsPutHeaders object itself. - */ - public PrivateEndpointConnectionsPutHeaders withRetryAfter(Integer retryAfter) { - this.retryAfter = retryAfter; - return this; - } - - /** - * Get the azureAsyncOperation property: The Azure-AsyncOperation property. - * - * @return the azureAsyncOperation value. - */ - public String azureAsyncOperation() { - return this.azureAsyncOperation; - } - - /** - * Set the azureAsyncOperation property: The Azure-AsyncOperation property. - * - * @param azureAsyncOperation the azureAsyncOperation value to set. - * @return the PrivateEndpointConnectionsPutHeaders object itself. - */ - public PrivateEndpointConnectionsPutHeaders withAzureAsyncOperation(String azureAsyncOperation) { - this.azureAsyncOperation = azureAsyncOperation; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/PrivateEndpointConnectionsPutResponse.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/PrivateEndpointConnectionsPutResponse.java deleted file mode 100644 index c4764705f4d7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/PrivateEndpointConnectionsPutResponse.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.keyvault.models; - -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.rest.ResponseBase; -import com.azure.resourcemanager.keyvault.fluent.models.PrivateEndpointConnectionInner; - -/** Contains all response data for the put operation. */ -public final class PrivateEndpointConnectionsPutResponse - extends ResponseBase { - /** - * Creates an instance of PrivateEndpointConnectionsPutResponse. - * - * @param request the request which resulted in this PrivateEndpointConnectionsPutResponse. - * @param statusCode the status code of the HTTP response. - * @param rawHeaders the raw headers of the HTTP response. - * @param value the deserialized value of the HTTP response. - * @param headers the deserialized headers of the HTTP response. - */ - public PrivateEndpointConnectionsPutResponse( - HttpRequest request, - int statusCode, - HttpHeaders rawHeaders, - PrivateEndpointConnectionInner value, - PrivateEndpointConnectionsPutHeaders headers) { - super(request, statusCode, rawHeaders, value, headers); - } - - /** @return the deserialized response body. */ - @Override - public PrivateEndpointConnectionInner getValue() { - return super.getValue(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/PrivateEndpointServiceConnectionStatus.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/PrivateEndpointServiceConnectionStatus.java deleted file mode 100644 index 01052d1da865..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/PrivateEndpointServiceConnectionStatus.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.keyvault.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for PrivateEndpointServiceConnectionStatus. */ -public final class PrivateEndpointServiceConnectionStatus - extends ExpandableStringEnum { - /** Static value Pending for PrivateEndpointServiceConnectionStatus. */ - public static final PrivateEndpointServiceConnectionStatus PENDING = fromString("Pending"); - - /** Static value Approved for PrivateEndpointServiceConnectionStatus. */ - public static final PrivateEndpointServiceConnectionStatus APPROVED = fromString("Approved"); - - /** Static value Rejected for PrivateEndpointServiceConnectionStatus. */ - public static final PrivateEndpointServiceConnectionStatus REJECTED = fromString("Rejected"); - - /** Static value Disconnected for PrivateEndpointServiceConnectionStatus. */ - public static final PrivateEndpointServiceConnectionStatus DISCONNECTED = fromString("Disconnected"); - - /** - * Creates or finds a PrivateEndpointServiceConnectionStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding PrivateEndpointServiceConnectionStatus. - */ - @JsonCreator - public static PrivateEndpointServiceConnectionStatus fromString(String name) { - return fromString(name, PrivateEndpointServiceConnectionStatus.class); - } - - /** @return known PrivateEndpointServiceConnectionStatus values. */ - public static Collection values() { - return values(PrivateEndpointServiceConnectionStatus.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/PrivateLinkResource.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/PrivateLinkResource.java deleted file mode 100644 index a387f4105c20..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/PrivateLinkResource.java +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.keyvault.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** A private link resource. */ -@JsonFlatten -@Fluent -public class PrivateLinkResource extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkResource.class); - - /* - * Group identifier of private link resource. - */ - @JsonProperty(value = "properties.groupId", access = JsonProperty.Access.WRITE_ONLY) - private String groupId; - - /* - * Required member names of private link resource. - */ - @JsonProperty(value = "properties.requiredMembers", access = JsonProperty.Access.WRITE_ONLY) - private List requiredMembers; - - /* - * Required DNS zone names of the the private link resource. - */ - @JsonProperty(value = "properties.requiredZoneNames") - private List requiredZoneNames; - - /** - * Get the groupId property: Group identifier of private link resource. - * - * @return the groupId value. - */ - public String groupId() { - return this.groupId; - } - - /** - * Get the requiredMembers property: Required member names of private link resource. - * - * @return the requiredMembers value. - */ - public List requiredMembers() { - return this.requiredMembers; - } - - /** - * Get the requiredZoneNames property: Required DNS zone names of the the private link resource. - * - * @return the requiredZoneNames value. - */ - public List requiredZoneNames() { - return this.requiredZoneNames; - } - - /** - * Set the requiredZoneNames property: Required DNS zone names of the the private link resource. - * - * @param requiredZoneNames the requiredZoneNames value to set. - * @return the PrivateLinkResource object itself. - */ - public PrivateLinkResource withRequiredZoneNames(List requiredZoneNames) { - this.requiredZoneNames = requiredZoneNames; - return this; - } - - /** {@inheritDoc} */ - @Override - public PrivateLinkResource withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public PrivateLinkResource withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/PrivateLinkServiceConnectionState.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/PrivateLinkServiceConnectionState.java deleted file mode 100644 index 6036b8c84575..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/PrivateLinkServiceConnectionState.java +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.keyvault.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** An object that represents the approval state of the private link connection. */ -@Fluent -public final class PrivateLinkServiceConnectionState { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkServiceConnectionState.class); - - /* - * Indicates whether the connection has been approved, rejected or removed - * by the key vault owner. - */ - @JsonProperty(value = "status") - private PrivateEndpointServiceConnectionStatus status; - - /* - * The reason for approval or rejection. - */ - @JsonProperty(value = "description") - private String description; - - /* - * A message indicating if changes on the service provider require any - * updates on the consumer. - */ - @JsonProperty(value = "actionsRequired") - private String actionsRequired; - - /** - * Get the status property: Indicates whether the connection has been approved, rejected or removed by the key vault - * owner. - * - * @return the status value. - */ - public PrivateEndpointServiceConnectionStatus status() { - return this.status; - } - - /** - * Set the status property: Indicates whether the connection has been approved, rejected or removed by the key vault - * owner. - * - * @param status the status value to set. - * @return the PrivateLinkServiceConnectionState object itself. - */ - public PrivateLinkServiceConnectionState withStatus(PrivateEndpointServiceConnectionStatus status) { - this.status = status; - return this; - } - - /** - * Get the description property: The reason for approval or rejection. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: The reason for approval or rejection. - * - * @param description the description value to set. - * @return the PrivateLinkServiceConnectionState object itself. - */ - public PrivateLinkServiceConnectionState withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the actionsRequired property: A message indicating if changes on the service provider require any updates on - * the consumer. - * - * @return the actionsRequired value. - */ - public String actionsRequired() { - return this.actionsRequired; - } - - /** - * Set the actionsRequired property: A message indicating if changes on the service provider require any updates on - * the consumer. - * - * @param actionsRequired the actionsRequired value to set. - * @return the PrivateLinkServiceConnectionState object itself. - */ - public PrivateLinkServiceConnectionState withActionsRequired(String actionsRequired) { - this.actionsRequired = actionsRequired; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/Reason.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/Reason.java deleted file mode 100644 index 782e6db794e9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/Reason.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.keyvault.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for Reason. */ -public enum Reason { - /** Enum value AccountNameInvalid. */ - ACCOUNT_NAME_INVALID("AccountNameInvalid"), - - /** Enum value AlreadyExists. */ - ALREADY_EXISTS("AlreadyExists"); - - /** The actual serialized value for a Reason instance. */ - private final String value; - - Reason(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a Reason instance. - * - * @param value the serialized value to parse. - * @return the parsed Reason object, or null if unable to parse. - */ - @JsonCreator - public static Reason fromString(String value) { - Reason[] items = Reason.values(); - for (Reason item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ResourceListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ResourceListResult.java deleted file mode 100644 index aadf9584e65b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ResourceListResult.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.keyvault.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** List of vault resources. */ -@Fluent -public final class ResourceListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceListResult.class); - - /* - * The list of vault resources. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to get the next set of vault resources. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: The list of vault resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The list of vault resources. - * - * @param value the value value to set. - * @return the ResourceListResult object itself. - */ - public ResourceListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to get the next set of vault resources. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The URL to get the next set of vault resources. - * - * @param nextLink the nextLink value to set. - * @return the ResourceListResult object itself. - */ - public ResourceListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/Secret.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/Secret.java deleted file mode 100644 index dc54e70a7b67..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/Secret.java +++ /dev/null @@ -1,175 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.keyvault.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasId; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasName; -import com.azure.resourcemanager.resources.fluentcore.model.Appliable; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.model.Indexable; -import com.azure.resourcemanager.resources.fluentcore.model.Updatable; -import com.azure.security.keyvault.secrets.models.SecretProperties; -import java.util.Map; -import reactor.core.publisher.Mono; - -/** An immutable client-side representation of an Azure Key Vault secret. */ -@Fluent -public interface Secret extends Indexable, HasInnerModel, HasId, HasName, Updatable { - /** @return the secret value when the secret is enabled */ - String getValue(); - - /** @return the secret value when the secret is enabled */ - Mono getValueAsync(); - - /** @return the secret management attributes */ - SecretProperties attributes(); - - /** @return application specific metadata in the form of key-value pairs */ - Map tags(); - - /** @return type of the secret value such as a password */ - String contentType(); - - /** @return the corresponding key backing the KV certificate if this is a secret backing a KV certificate */ - String kid(); - - /** - * @return true if the secret's lifetime is managed by key vault. If this is a key backing a certificate, then - * managed will be true - */ - boolean managed(); - - /** - * @return whether secret is enabled. - */ - boolean enabled(); - - /** @return a list of individual secret versions with the same secret name */ - PagedIterable listVersions(); - - /** @return a list of individual secret versions with the same secret name */ - PagedFlux listVersionsAsync(); - - /** Container interface for all the definitions. */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithValue, DefinitionStages.WithCreate { - } - - /** Grouping of secret definition stages. */ - interface DefinitionStages { - /** The first stage of a secret definition. */ - interface Blank extends WithValue { - } - - /** The stage of a secret definition allowing to specify the secret value. */ - interface WithValue { - /** - * Specifies the secret value. - * - * @param value the string value of the secret - * @return the next stage of the definition - */ - WithCreate withValue(String value); - } - - /** The stage of a secret definition allowing to specify the secret content type. */ - interface WithContentType { - /** - * Specifies the secret content type. - * - * @param contentType the content type - * @return the next stage of the definition - */ - WithCreate withContentType(String contentType); - } - - /** The stage of a secret definition allowing to specify the secret attributes. */ - interface WithAttributes { - /** - * Specifies the secret attributes. - * - * @param attributes the object attributes managed by Key Vault service - * @return the next stage of the definition - */ - WithCreate withAttributes(SecretProperties attributes); - } - - /** The stage of a secret definition allowing to specify the tags. */ - interface WithTags { - /** - * Specifies the tags on the secret. - * - * @param tags the key value pair of the tags - * @return the next stage of the definition - */ - WithCreate withTags(Map tags); - } - - /** - * The stage of the secret definition which contains all the minimum required inputs for the secret to be - * created but also allows for any optional settings to be specified. - */ - interface WithCreate extends Creatable, WithContentType, WithAttributes, WithTags { - } - } - - /** Grouping of secret update stages. */ - interface UpdateStages { - /** The stage of a secret update allowing to create a new version of the secret value. */ - interface WithValue { - /** - * Specifies the new version of the value to be added. - * - * @param value the value for the new version - * @return the next stage of the secret update - */ - Update withValue(String value); - } - - /** The stage of a secret update allowing to set the content type of the secret. */ - interface WithContentType { - /** - * Specifies the secret content type. - * - * @param contentType the content type - * @return the next stage of the update - */ - Update withContentType(String contentType); - } - - /** The stage of a secret update allowing to specify the secret attributes. */ - interface WithAttributes { - /** - * Specifies the secret attributes. - * - * @param attributes the object attributes managed by Key Vault service - * @return the next stage of the update - */ - Update withAttributes(SecretProperties attributes); - } - - /** The stage of a secret update allowing to specify the tags. */ - interface WithTags { - /** - * Specifies the tags on the secret. - * - * @param tags the key value pair of the tags - * @return the next stage of the update - */ - Update withTags(Map tags); - } - } - - /** The template for a secret update operation, containing all the settings that can be modified. */ - interface Update - extends Appliable, - UpdateStages.WithValue, - UpdateStages.WithAttributes, - UpdateStages.WithContentType, - UpdateStages.WithTags { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/SecretPermissions.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/SecretPermissions.java deleted file mode 100644 index a8652a2b1cad..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/SecretPermissions.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.keyvault.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for SecretPermissions. */ -public final class SecretPermissions extends ExpandableStringEnum { - /** Static value all for SecretPermissions. */ - public static final SecretPermissions ALL = fromString("all"); - - /** Static value get for SecretPermissions. */ - public static final SecretPermissions GET = fromString("get"); - - /** Static value list for SecretPermissions. */ - public static final SecretPermissions LIST = fromString("list"); - - /** Static value set for SecretPermissions. */ - public static final SecretPermissions SET = fromString("set"); - - /** Static value delete for SecretPermissions. */ - public static final SecretPermissions DELETE = fromString("delete"); - - /** Static value backup for SecretPermissions. */ - public static final SecretPermissions BACKUP = fromString("backup"); - - /** Static value restore for SecretPermissions. */ - public static final SecretPermissions RESTORE = fromString("restore"); - - /** Static value recover for SecretPermissions. */ - public static final SecretPermissions RECOVER = fromString("recover"); - - /** Static value purge for SecretPermissions. */ - public static final SecretPermissions PURGE = fromString("purge"); - - /** - * Creates or finds a SecretPermissions from its string representation. - * - * @param name a name to look for. - * @return the corresponding SecretPermissions. - */ - @JsonCreator - public static SecretPermissions fromString(String name) { - return fromString(name, SecretPermissions.class); - } - - /** @return known SecretPermissions values. */ - public static Collection values() { - return values(SecretPermissions.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/Secrets.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/Secrets.java deleted file mode 100644 index 41e18fd83a1d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/Secrets.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.keyvault.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingByName; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsCreating; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingById; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; -import reactor.core.publisher.Mono; - -/** Entry point for Key Vault secrets API. */ -@Fluent -public interface Secrets - extends SupportsCreating, - SupportsDeletingById, - SupportsGettingById, - SupportsGettingByName, - SupportsListing { - /** - * Gets a Key Vault secret when the secret is enabled. - * - * @param name the name of the secret - * @param version the version of the secret - * @return the secret - */ - Secret getByNameAndVersion(String name, String version); - - /** - * Gets a Key Vault secret when the secret is enabled. - * - * @param name the name of the secret - * @param version the version of the secret - * @return the secret - */ - Mono getByNameAndVersionAsync(String name, String version); - - /** - * Enables a secret. - * - * @param name the name of the secret - * @param version the version of the secret - * @return the secret - */ - Secret enableByNameAndVersion(String name, String version); - - /** - * Enables a secret. - * - * @param name the name of the secret - * @param version the version of the secret - * @return the secret - */ - Mono enableByNameAndVersionAsync(String name, String version); - - /** - * Disables a secret. - * - * @param name the name of the secret - * @param version the version of the secret - */ - void disableByNameAndVersion(String name, String version); - - /** - * Disables a secret. - * - * @param name the name of the secret - * @param version the version of the secret - * @return completion - */ - Mono disableByNameAndVersionAsync(String name, String version); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ServiceSpecification.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ServiceSpecification.java deleted file mode 100644 index 39fd4fb2190e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ServiceSpecification.java +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.keyvault.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** One property of operation, include log specifications. */ -@Fluent -public final class ServiceSpecification { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceSpecification.class); - - /* - * Log specifications of operation. - */ - @JsonProperty(value = "logSpecifications") - private List logSpecifications; - - /* - * Metric specifications of operation. - */ - @JsonProperty(value = "metricSpecifications") - private List metricSpecifications; - - /** - * Get the logSpecifications property: Log specifications of operation. - * - * @return the logSpecifications value. - */ - public List logSpecifications() { - return this.logSpecifications; - } - - /** - * Set the logSpecifications property: Log specifications of operation. - * - * @param logSpecifications the logSpecifications value to set. - * @return the ServiceSpecification object itself. - */ - public ServiceSpecification withLogSpecifications(List logSpecifications) { - this.logSpecifications = logSpecifications; - return this; - } - - /** - * Get the metricSpecifications property: Metric specifications of operation. - * - * @return the metricSpecifications value. - */ - public List metricSpecifications() { - return this.metricSpecifications; - } - - /** - * Set the metricSpecifications property: Metric specifications of operation. - * - * @param metricSpecifications the metricSpecifications value to set. - * @return the ServiceSpecification object itself. - */ - public ServiceSpecification withMetricSpecifications(List metricSpecifications) { - this.metricSpecifications = metricSpecifications; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (logSpecifications() != null) { - logSpecifications().forEach(e -> e.validate()); - } - if (metricSpecifications() != null) { - metricSpecifications().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/Sku.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/Sku.java deleted file mode 100644 index 2842a3e9ee8e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/Sku.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.keyvault.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** SKU details. */ -@Fluent -public final class Sku { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Sku.class); - - /* - * SKU family name - */ - @JsonProperty(value = "family", required = true) - private SkuFamily family; - - /* - * SKU name to specify whether the key vault is a standard vault or a - * premium vault. - */ - @JsonProperty(value = "name", required = true) - private SkuName name; - - /** - * Get the family property: SKU family name. - * - * @return the family value. - */ - public SkuFamily family() { - return this.family; - } - - /** - * Set the family property: SKU family name. - * - * @param family the family value to set. - * @return the Sku object itself. - */ - public Sku withFamily(SkuFamily family) { - this.family = family; - return this; - } - - /** - * Get the name property: SKU name to specify whether the key vault is a standard vault or a premium vault. - * - * @return the name value. - */ - public SkuName name() { - return this.name; - } - - /** - * Set the name property: SKU name to specify whether the key vault is a standard vault or a premium vault. - * - * @param name the name value to set. - * @return the Sku object itself. - */ - public Sku withName(SkuName name) { - this.name = name; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (family() == null) { - throw logger - .logExceptionAsError(new IllegalArgumentException("Missing required property family in model Sku")); - } - if (name() == null) { - throw logger - .logExceptionAsError(new IllegalArgumentException("Missing required property name in model Sku")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/SkuFamily.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/SkuFamily.java deleted file mode 100644 index 13a0401af6b3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/SkuFamily.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.keyvault.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for SkuFamily. */ -public final class SkuFamily extends ExpandableStringEnum { - /** Static value A for SkuFamily. */ - public static final SkuFamily A = fromString("A"); - - /** - * Creates or finds a SkuFamily from its string representation. - * - * @param name a name to look for. - * @return the corresponding SkuFamily. - */ - @JsonCreator - public static SkuFamily fromString(String name) { - return fromString(name, SkuFamily.class); - } - - /** @return known SkuFamily values. */ - public static Collection values() { - return values(SkuFamily.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/SkuName.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/SkuName.java deleted file mode 100644 index 514f83812ef0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/SkuName.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.keyvault.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for SkuName. */ -public enum SkuName { - /** Enum value standard. */ - STANDARD("standard"), - - /** Enum value premium. */ - PREMIUM("premium"); - - /** The actual serialized value for a SkuName instance. */ - private final String value; - - SkuName(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a SkuName instance. - * - * @param value the serialized value to parse. - * @return the parsed SkuName object, or null if unable to parse. - */ - @JsonCreator - public static SkuName fromString(String value) { - SkuName[] items = SkuName.values(); - for (SkuName item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/StoragePermissions.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/StoragePermissions.java deleted file mode 100644 index bda910693ad4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/StoragePermissions.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.keyvault.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for StoragePermissions. */ -public final class StoragePermissions extends ExpandableStringEnum { - /** Static value all for StoragePermissions. */ - public static final StoragePermissions ALL = fromString("all"); - - /** Static value get for StoragePermissions. */ - public static final StoragePermissions GET = fromString("get"); - - /** Static value list for StoragePermissions. */ - public static final StoragePermissions LIST = fromString("list"); - - /** Static value delete for StoragePermissions. */ - public static final StoragePermissions DELETE = fromString("delete"); - - /** Static value set for StoragePermissions. */ - public static final StoragePermissions SET = fromString("set"); - - /** Static value update for StoragePermissions. */ - public static final StoragePermissions UPDATE = fromString("update"); - - /** Static value regeneratekey for StoragePermissions. */ - public static final StoragePermissions REGENERATEKEY = fromString("regeneratekey"); - - /** Static value recover for StoragePermissions. */ - public static final StoragePermissions RECOVER = fromString("recover"); - - /** Static value purge for StoragePermissions. */ - public static final StoragePermissions PURGE = fromString("purge"); - - /** Static value backup for StoragePermissions. */ - public static final StoragePermissions BACKUP = fromString("backup"); - - /** Static value restore for StoragePermissions. */ - public static final StoragePermissions RESTORE = fromString("restore"); - - /** Static value setsas for StoragePermissions. */ - public static final StoragePermissions SETSAS = fromString("setsas"); - - /** Static value listsas for StoragePermissions. */ - public static final StoragePermissions LISTSAS = fromString("listsas"); - - /** Static value getsas for StoragePermissions. */ - public static final StoragePermissions GETSAS = fromString("getsas"); - - /** Static value deletesas for StoragePermissions. */ - public static final StoragePermissions DELETESAS = fromString("deletesas"); - - /** - * Creates or finds a StoragePermissions from its string representation. - * - * @param name a name to look for. - * @return the corresponding StoragePermissions. - */ - @JsonCreator - public static StoragePermissions fromString(String name) { - return fromString(name, StoragePermissions.class); - } - - /** @return known StoragePermissions values. */ - public static Collection values() { - return values(StoragePermissions.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/Vault.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/Vault.java deleted file mode 100644 index 3a088900edfc..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/Vault.java +++ /dev/null @@ -1,502 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.keyvault.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.http.HttpPipeline; -import com.azure.resourcemanager.keyvault.KeyVaultManager; -import com.azure.resourcemanager.keyvault.fluent.models.VaultInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.GroupableResource; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListingPrivateLinkResource; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsUpdatingPrivateEndpointConnection; -import com.azure.resourcemanager.resources.fluentcore.model.Appliable; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; -import com.azure.resourcemanager.resources.fluentcore.model.Updatable; -import com.azure.security.keyvault.keys.KeyAsyncClient; -import com.azure.security.keyvault.secrets.SecretAsyncClient; -import java.util.List; - -/** An immutable client-side representation of an Azure Key Vault. */ -@Fluent -public interface Vault - extends GroupableResource, Refreshable, Updatable, - SupportsListingPrivateLinkResource, - SupportsUpdatingPrivateEndpointConnection { - - /** @return an authenticated Key Vault secret client */ - SecretAsyncClient secretClient(); - - /** @return an authenticated Key Vault key client */ - KeyAsyncClient keyClient(); - - /** @return an authenticated Key Vault rest client */ - HttpPipeline vaultHttpPipeline(); - - /** @return the Key Vault key API entry point */ - Keys keys(); - - /** @return the Key Vault secret API entry point */ - Secrets secrets(); - - /** @return the URI of the vault for performing operations on keys and secrets. */ - String vaultUri(); - - /** - * @return the Azure Active Directory tenant ID that should be used for authenticating requests to the key vault. - */ - String tenantId(); - - /** @return SKU details. */ - Sku sku(); - - /** - * @return an array of 0 to 16 identities that have access to the key vault. All identities in the array must use - * the same tenant ID as the key vault's tenant ID. - */ - List accessPolicies(); - - /** - * @return whether role based access control (RBAC) for authorization of data access is enabled. - */ - boolean roleBasedAccessControlEnabled(); - - /** - * @return whether Azure Virtual Machines are permitted to retrieve certificates stored as secrets from the key - * vault. - */ - boolean enabledForDeployment(); - - /** @return whether Azure Disk Encryption is permitted to retrieve secrets from the vault and unwrap keys. */ - boolean enabledForDiskEncryption(); - - /** @return whether Azure Resource Manager is permitted to retrieve secrets from the key vault. */ - boolean enabledForTemplateDeployment(); - - /** @return whether soft delete is enabled for this key vault. */ - boolean softDeleteEnabled(); - - /** - * @return whether purge protection is enabled for this key vault. Purge protection can only be enabled if soft - * delete is enabled. - */ - boolean purgeProtectionEnabled(); - - /** - * Get the createMode value. - * - * @return the createMode value - */ - CreateMode createMode(); - - /** - * Get the networkAcls value. - * - * @return the networkAcls value - */ - NetworkRuleSet networkRuleSet(); - - /************************************************************** - * Fluent interfaces to provision a Vault - **************************************************************/ - - /** Container interface for all the definitions that need to be implemented. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithGroup, - DefinitionStages.WithAccessPolicy, - DefinitionStages.WithCreate { - } - - /** Grouping of all the key vault definition stages. */ - interface DefinitionStages { - /** The first stage of the key vault definition. */ - interface Blank extends DefinitionWithRegion { - } - - /** A key vault definition allowing resource group to be set. */ - interface WithGroup extends GroupableResource.DefinitionStages.WithGroup { - } - - /** A key vault definition allowing the sku to be set. */ - interface WithSku { - /** - * Specifies the sku of the key vault. - * - * @param skuName the sku - * @return the next stage of key vault definition - */ - WithCreate withSku(SkuName skuName); - } - - /** A key vault definition allowing access policies to be attached. */ - interface WithAccessPolicy { - /** - * Attach no access policy. - * - * @return the next stage of key vault definition - */ - WithCreate withEmptyAccessPolicy(); - - /** - * Attach an existing access policy. - * - * @param accessPolicy the existing access policy - * @return the next stage of key vault definition - */ - WithCreate withAccessPolicy(AccessPolicy accessPolicy); - - /** - * Begins the definition of a new access policy to be added to this key vault. - * - * @return the first stage of the access policy definition - */ - AccessPolicy.DefinitionStages.Blank defineAccessPolicy(); - - /** - * Enables role based access control (RBAC) for authorization of data access. - * - * It overrides access policies configure. - * - * @return the next stage of key vault definition - */ - WithCreate withRoleBasedAccessControl(); - } - - /** A key vault definition allowing the networkAcl to be set. */ - interface WithNetworkRuleSet { - - /** - * Specifies that by default access to key vault should be allowed from all networks. - * - * @return the next stage of key vault definition - */ - WithCreate withAccessFromAllNetworks(); - - /** - * Specifies that by default access to key vault should be denied from all networks. except from those - * networks specified via withVirtualNetworkRules, withAccessFromIpAddressRange, withAccessFromIpAddress - * - * @return the next stage of key vault definition - */ - WithCreate withAccessFromSelectedNetworks(); - - /** - * Specifies that access to the key vault from the specific ip address should be allowed. - * - * @param ipAddress the ip address - * @return the next stage of key vault definition - */ - WithCreate withAccessFromIpAddress(String ipAddress); - - /** - * Specifies that access to the key vault from the specific ip range should be allowed. - * - * @param ipAddressCidr the ip address CIDR - * @return the next stage of key vault definition - */ - WithCreate withAccessFromIpAddressRange(String ipAddressCidr); - - /** - * Specifies that access to the key vault should be allowed from applications running on Microsoft azure - * services. - * - * @return the next stage of key vault definition. - */ - WithCreate withAccessFromAzureServices(); - - /** - * Set the bypass value. - * - * @param bypass the bypass value to set - * @return the next stage of key vault definition. - */ - WithCreate withBypass(NetworkRuleBypassOptions bypass); - - /** - * Set the defaultAction value. - * - * @param defaultAction the defaultAction value to set - * @return the next stage of key vault definition. - */ - WithCreate withDefaultAction(NetworkRuleAction defaultAction); - - /** - * Get the virtualNetworkRules value. - * - * @param virtualNetworkRules the virtual network rules - * @return the next stage of key vault definition. - */ - WithCreate withVirtualNetworkRules(List virtualNetworkRules); - } - - /** A key vault definition allowing various configurations to be set. */ - interface WithConfigurations { - /** - * Enable Azure Virtual Machines to retrieve certificates stored as secrets from the key vault. - * - * @return the next stage of key vault definition - */ - WithCreate withDeploymentEnabled(); - - /** - * Enable Azure Disk Encryption to retrieve secrets from the vault and unwrap keys. - * - * @return the next stage of key vault definition - */ - WithCreate withDiskEncryptionEnabled(); - - /** - * Enable Azure Resource Manager to retrieve secrets from the key vault. - * - * @return the next stage of key vault definition - */ - WithCreate withTemplateDeploymentEnabled(); - - /** - * Enable soft delete for the key vault. - * - * @deprecated soft-delete protection is enabled by default. - * Users will no longer be able to opt out of or turn off soft-delete. - * - * @return the next stage of key vault definition - */ - @Deprecated - WithCreate withSoftDeleteEnabled(); - - /** - * Enable purge protection for the key vault; valid only if soft delete is also enabled. - * - * @return the next stage of key vault definition. - */ - WithCreate withPurgeProtectionEnabled(); - - /** - * Disable Azure Virtual Machines to retrieve certificates stored as secrets from the key vault. - * - * @return the next stage of key vault definition - */ - WithCreate withDeploymentDisabled(); - - /** - * Disable Azure Disk Encryption to retrieve secrets from the vault and unwrap keys. - * - * @return the next stage of key vault definition - */ - WithCreate withDiskEncryptionDisabled(); - - /** - * Disable Azure Resource Manager to retrieve secrets from the key vault. - * - * @return the next stage of key vault definition - */ - WithCreate withTemplateDeploymentDisabled(); - } - - /** - * A key vault definition with sufficient inputs to create a new storage account in the cloud, but exposing - * additional optional inputs to specify. - */ - interface WithCreate - extends Creatable, - GroupableResource.DefinitionWithTags, - DefinitionStages.WithSku, - DefinitionStages.WithNetworkRuleSet, - DefinitionStages.WithConfigurations, - DefinitionStages.WithAccessPolicy { - } - } - - /** Grouping of all the key vault update stages. */ - interface UpdateStages { - /** A key vault update allowing access policies to be modified, attached, or removed. */ - interface WithAccessPolicy { - /** - * Remove an access policy from the access policy list. - * - * @param objectId the object ID of the Active Directory identity the access policy is for - * @return the key vault update stage - */ - Update withoutAccessPolicy(String objectId); - - /** - * Attach an existing access policy. - * - * @param accessPolicy the existing access policy - * @return the key vault update stage - */ - Update withAccessPolicy(AccessPolicy accessPolicy); - - /** - * Begins the definition of a new access policy to be added to this key vault. - * - * @return the first stage of the access policy definition - */ - AccessPolicy.UpdateDefinitionStages.Blank defineAccessPolicy(); - - /** - * Begins the update of an existing access policy attached to this key vault. - * - * @param objectId the object ID of the Active Directory identity the access policy is for - * @return the update stage of the access policy definition - */ - AccessPolicy.Update updateAccessPolicy(String objectId); - - /** - * Enables role based access control (RBAC) for authorization of data access. - * - * It overrides access policies configure. - * - * @return the update stage of the access policy definition - */ - Update withRoleBasedAccessControl(); - - /** - * Disables role based access control (RBAC) for authorization of data access. - * - * @return the update stage of the access policy definition - */ - Update withoutRoleBasedAccessControl(); - } - - /** A key vault update allowing the NetworkRuleSet to be set. */ - interface WithNetworkRuleSet { - - /** - * Specifies that by default access to key vault should be allowed from all networks. - * - * @return the next stage of key vault definition - */ - Update withAccessFromAllNetworks(); - - /** - * Specifies that by default access to key vault should be denied from all networks. except from those - * networks specified via withVirtualNetworkRules, withAccessFromIpAddressRange withAccesFromIpAddress - * - * @return the update stage of key vault definition - */ - Update withAccessFromSelectedNetworks(); - - /** - * Specifies that access to the key vault from the specific ip address should be allowed. - * - * @param ipAddress the ip address - * @return the update stage of key vault definition - */ - Update withAccessFromIpAddress(String ipAddress); - - /** - * Specifies that access to the key vault from the specific ip range should be allowed. - * - * @param ipAddressCidr the idAddress range in Cidr format - * @return the update stage of key vault definition - */ - Update withAccessFromIpAddressRange(String ipAddressCidr); - - /** - * Specifies that access to the key vault should be allowed from applications running on Microsoft azure - * services. - * - * @return the update stage of key vault definition. - */ - Update withAccessFromAzureServices(); - - /** - * Set the bypass value. - * - * @param bypass the bypass value to set - * @return the update stage of key vault definition. - */ - Update withBypass(NetworkRuleBypassOptions bypass); - - /** - * Set the defaultAction value. - * - * @param defaultAction the defaultAction value to set - * @return the update stage of key vault definition. - */ - Update withDefaultAction(NetworkRuleAction defaultAction); - - /** - * Get the virtualNetworkRules value. - * - * @param virtualNetworkRules virtual network rules - * @return the update stage of key vault definition. - */ - Update withVirtualNetworkRules(List virtualNetworkRules); - } - - /** A key vault update allowing various configurations to be set. */ - interface WithConfigurations { - /** - * Enable Azure Virtual Machines to retrieve certificates stored as secrets from the key vault. - * - * @return the key vault update stage - */ - Update withDeploymentEnabled(); - - /** - * Enable Azure Disk Encryption to retrieve secrets from the vault and unwrap keys. - * - * @return the key vault update stage - */ - Update withDiskEncryptionEnabled(); - - /** - * Enable Azure Resource Manager to retrieve secrets from the key vault. - * - * @return the key vault update stage - */ - Update withTemplateDeploymentEnabled(); - - /** - * Enable soft delete for the key vault. - * - * @deprecated soft-delete protection is enabled by default. - * Users will no longer be able to opt out of or turn off soft-delete. - * - * @return the next stage of key vault definition - */ - @Deprecated - Update withSoftDeleteEnabled(); - - /** - * Enable purge protection for the key vault; valid only if soft delete is also enabled. - * - * @return the next stage of key vault definition. - */ - Update withPurgeProtectionEnabled(); - - /** - * Disable Azure Virtual Machines to retrieve certificates stored as secrets from the key vault. - * - * @return the key vault update stage - */ - Update withDeploymentDisabled(); - - /** - * Disable Azure Disk Encryption to retrieve secrets from the vault and unwrap keys. - * - * @return the next stage of key vault definition - */ - Update withDiskEncryptionDisabled(); - - /** - * Disable Azure Resource Manager to retrieve secrets from the key vault. - * - * @return the key vault update stage - */ - Update withTemplateDeploymentDisabled(); - } - } - - /** The template for a key vault update operation, containing all the settings that can be modified. */ - interface Update - extends GroupableResource.UpdateWithTags, - Appliable, - UpdateStages.WithAccessPolicy, - UpdateStages.WithNetworkRuleSet, - UpdateStages.WithConfigurations { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/VaultAccessPolicyProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/VaultAccessPolicyProperties.java deleted file mode 100644 index 8c0d049d079e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/VaultAccessPolicyProperties.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.keyvault.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Properties of the vault access policy. */ -@Fluent -public final class VaultAccessPolicyProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VaultAccessPolicyProperties.class); - - /* - * An array of 0 to 16 identities that have access to the key vault. All - * identities in the array must use the same tenant ID as the key vault's - * tenant ID. - */ - @JsonProperty(value = "accessPolicies", required = true) - private List accessPolicies; - - /** - * Get the accessPolicies property: An array of 0 to 16 identities that have access to the key vault. All identities - * in the array must use the same tenant ID as the key vault's tenant ID. - * - * @return the accessPolicies value. - */ - public List accessPolicies() { - return this.accessPolicies; - } - - /** - * Set the accessPolicies property: An array of 0 to 16 identities that have access to the key vault. All identities - * in the array must use the same tenant ID as the key vault's tenant ID. - * - * @param accessPolicies the accessPolicies value to set. - * @return the VaultAccessPolicyProperties object itself. - */ - public VaultAccessPolicyProperties withAccessPolicies(List accessPolicies) { - this.accessPolicies = accessPolicies; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (accessPolicies() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property accessPolicies in model VaultAccessPolicyProperties")); - } else { - accessPolicies().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/VaultCheckNameAvailabilityParameters.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/VaultCheckNameAvailabilityParameters.java deleted file mode 100644 index 9e3ec2bba2eb..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/VaultCheckNameAvailabilityParameters.java +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.keyvault.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The parameters used to check the availability of the vault name. */ -@Fluent -public final class VaultCheckNameAvailabilityParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VaultCheckNameAvailabilityParameters.class); - - /* - * The vault name. - */ - @JsonProperty(value = "name", required = true) - private String name; - - /* - * The type of resource, Microsoft.KeyVault/vaults - */ - @JsonProperty(value = "type", required = true) - private String type; - - /** Creates an instance of VaultCheckNameAvailabilityParameters class. */ - public VaultCheckNameAvailabilityParameters() { - type = "Microsoft.KeyVault/vaults"; - } - - /** - * Get the name property: The vault name. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The vault name. - * - * @param name the name value to set. - * @return the VaultCheckNameAvailabilityParameters object itself. - */ - public VaultCheckNameAvailabilityParameters withName(String name) { - this.name = name; - return this; - } - - /** - * Get the type property: The type of resource, Microsoft.KeyVault/vaults. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Set the type property: The type of resource, Microsoft.KeyVault/vaults. - * - * @param type the type value to set. - * @return the VaultCheckNameAvailabilityParameters object itself. - */ - public VaultCheckNameAvailabilityParameters withType(String type) { - this.type = type; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property name in model VaultCheckNameAvailabilityParameters")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/VaultCreateOrUpdateParameters.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/VaultCreateOrUpdateParameters.java deleted file mode 100644 index 2a0493a76f49..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/VaultCreateOrUpdateParameters.java +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.keyvault.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** Parameters for creating or updating a vault. */ -@Fluent -public final class VaultCreateOrUpdateParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VaultCreateOrUpdateParameters.class); - - /* - * The supported Azure location where the key vault should be created. - */ - @JsonProperty(value = "location", required = true) - private String location; - - /* - * The tags that will be assigned to the key vault. - */ - @JsonProperty(value = "tags") - private Map tags; - - /* - * Properties of the vault - */ - @JsonProperty(value = "properties", required = true) - private VaultProperties properties; - - /** - * Get the location property: The supported Azure location where the key vault should be created. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Set the location property: The supported Azure location where the key vault should be created. - * - * @param location the location value to set. - * @return the VaultCreateOrUpdateParameters object itself. - */ - public VaultCreateOrUpdateParameters withLocation(String location) { - this.location = location; - return this; - } - - /** - * Get the tags property: The tags that will be assigned to the key vault. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: The tags that will be assigned to the key vault. - * - * @param tags the tags value to set. - * @return the VaultCreateOrUpdateParameters object itself. - */ - public VaultCreateOrUpdateParameters withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Get the properties property: Properties of the vault. - * - * @return the properties value. - */ - public VaultProperties properties() { - return this.properties; - } - - /** - * Set the properties property: Properties of the vault. - * - * @param properties the properties value to set. - * @return the VaultCreateOrUpdateParameters object itself. - */ - public VaultCreateOrUpdateParameters withProperties(VaultProperties properties) { - this.properties = properties; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (location() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property location in model VaultCreateOrUpdateParameters")); - } - if (properties() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property properties in model VaultCreateOrUpdateParameters")); - } else { - properties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/VaultListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/VaultListResult.java deleted file mode 100644 index 3daa245a9598..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/VaultListResult.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.keyvault.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.keyvault.fluent.models.VaultInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** List of vaults. */ -@Fluent -public final class VaultListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VaultListResult.class); - - /* - * The list of vaults. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to get the next set of vaults. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: The list of vaults. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The list of vaults. - * - * @param value the value value to set. - * @return the VaultListResult object itself. - */ - public VaultListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to get the next set of vaults. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The URL to get the next set of vaults. - * - * @param nextLink the nextLink value to set. - * @return the VaultListResult object itself. - */ - public VaultListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/VaultPatchParameters.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/VaultPatchParameters.java deleted file mode 100644 index df1475c20869..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/VaultPatchParameters.java +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.keyvault.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** Parameters for creating or updating a vault. */ -@Fluent -public final class VaultPatchParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VaultPatchParameters.class); - - /* - * The tags that will be assigned to the key vault. - */ - @JsonProperty(value = "tags") - private Map tags; - - /* - * Properties of the vault - */ - @JsonProperty(value = "properties") - private VaultPatchProperties properties; - - /** - * Get the tags property: The tags that will be assigned to the key vault. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: The tags that will be assigned to the key vault. - * - * @param tags the tags value to set. - * @return the VaultPatchParameters object itself. - */ - public VaultPatchParameters withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Get the properties property: Properties of the vault. - * - * @return the properties value. - */ - public VaultPatchProperties properties() { - return this.properties; - } - - /** - * Set the properties property: Properties of the vault. - * - * @param properties the properties value to set. - * @return the VaultPatchParameters object itself. - */ - public VaultPatchParameters withProperties(VaultPatchProperties properties) { - this.properties = properties; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/VaultPatchProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/VaultPatchProperties.java deleted file mode 100644 index 941c756f0263..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/VaultPatchProperties.java +++ /dev/null @@ -1,397 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.keyvault.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.UUID; - -/** Properties of the vault. */ -@Fluent -public final class VaultPatchProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VaultPatchProperties.class); - - /* - * The Azure Active Directory tenant ID that should be used for - * authenticating requests to the key vault. - */ - @JsonProperty(value = "tenantId") - private UUID tenantId; - - /* - * SKU details - */ - @JsonProperty(value = "sku") - private Sku sku; - - /* - * An array of 0 to 16 identities that have access to the key vault. All - * identities in the array must use the same tenant ID as the key vault's - * tenant ID. - */ - @JsonProperty(value = "accessPolicies") - private List accessPolicies; - - /* - * Property to specify whether Azure Virtual Machines are permitted to - * retrieve certificates stored as secrets from the key vault. - */ - @JsonProperty(value = "enabledForDeployment") - private Boolean enabledForDeployment; - - /* - * Property to specify whether Azure Disk Encryption is permitted to - * retrieve secrets from the vault and unwrap keys. - */ - @JsonProperty(value = "enabledForDiskEncryption") - private Boolean enabledForDiskEncryption; - - /* - * Property to specify whether Azure Resource Manager is permitted to - * retrieve secrets from the key vault. - */ - @JsonProperty(value = "enabledForTemplateDeployment") - private Boolean enabledForTemplateDeployment; - - /* - * Property to specify whether the 'soft delete' functionality is enabled - * for this key vault. Once set to true, it cannot be reverted to false. - */ - @JsonProperty(value = "enableSoftDelete") - private Boolean enableSoftDelete; - - /* - * Property that controls how data actions are authorized. When true, the - * key vault will use Role Based Access Control (RBAC) for authorization of - * data actions, and the access policies specified in vault properties will - * be ignored (warning: this is a preview feature). When false, the key - * vault will use the access policies specified in vault properties, and - * any policy stored on Azure Resource Manager will be ignored. If null or - * not specified, the value of this property will not change. - */ - @JsonProperty(value = "enableRbacAuthorization") - private Boolean enableRbacAuthorization; - - /* - * softDelete data retention days. It accepts >=7 and <=90. - */ - @JsonProperty(value = "softDeleteRetentionInDays") - private Integer softDeleteRetentionInDays; - - /* - * The vault's create mode to indicate whether the vault need to be - * recovered or not. - */ - @JsonProperty(value = "createMode") - private CreateMode createMode; - - /* - * Property specifying whether protection against purge is enabled for this - * vault. Setting this property to true activates protection against purge - * for this vault and its content - only the Key Vault service may initiate - * a hard, irrecoverable deletion. The setting is effective only if soft - * delete is also enabled. Enabling this functionality is irreversible - - * that is, the property does not accept false as its value. - */ - @JsonProperty(value = "enablePurgeProtection") - private Boolean enablePurgeProtection; - - /* - * A collection of rules governing the accessibility of the vault from - * specific network locations. - */ - @JsonProperty(value = "networkAcls") - private NetworkRuleSet networkAcls; - - /** - * Get the tenantId property: The Azure Active Directory tenant ID that should be used for authenticating requests - * to the key vault. - * - * @return the tenantId value. - */ - public UUID tenantId() { - return this.tenantId; - } - - /** - * Set the tenantId property: The Azure Active Directory tenant ID that should be used for authenticating requests - * to the key vault. - * - * @param tenantId the tenantId value to set. - * @return the VaultPatchProperties object itself. - */ - public VaultPatchProperties withTenantId(UUID tenantId) { - this.tenantId = tenantId; - return this; - } - - /** - * Get the sku property: SKU details. - * - * @return the sku value. - */ - public Sku sku() { - return this.sku; - } - - /** - * Set the sku property: SKU details. - * - * @param sku the sku value to set. - * @return the VaultPatchProperties object itself. - */ - public VaultPatchProperties withSku(Sku sku) { - this.sku = sku; - return this; - } - - /** - * Get the accessPolicies property: An array of 0 to 16 identities that have access to the key vault. All identities - * in the array must use the same tenant ID as the key vault's tenant ID. - * - * @return the accessPolicies value. - */ - public List accessPolicies() { - return this.accessPolicies; - } - - /** - * Set the accessPolicies property: An array of 0 to 16 identities that have access to the key vault. All identities - * in the array must use the same tenant ID as the key vault's tenant ID. - * - * @param accessPolicies the accessPolicies value to set. - * @return the VaultPatchProperties object itself. - */ - public VaultPatchProperties withAccessPolicies(List accessPolicies) { - this.accessPolicies = accessPolicies; - return this; - } - - /** - * Get the enabledForDeployment property: Property to specify whether Azure Virtual Machines are permitted to - * retrieve certificates stored as secrets from the key vault. - * - * @return the enabledForDeployment value. - */ - public Boolean enabledForDeployment() { - return this.enabledForDeployment; - } - - /** - * Set the enabledForDeployment property: Property to specify whether Azure Virtual Machines are permitted to - * retrieve certificates stored as secrets from the key vault. - * - * @param enabledForDeployment the enabledForDeployment value to set. - * @return the VaultPatchProperties object itself. - */ - public VaultPatchProperties withEnabledForDeployment(Boolean enabledForDeployment) { - this.enabledForDeployment = enabledForDeployment; - return this; - } - - /** - * Get the enabledForDiskEncryption property: Property to specify whether Azure Disk Encryption is permitted to - * retrieve secrets from the vault and unwrap keys. - * - * @return the enabledForDiskEncryption value. - */ - public Boolean enabledForDiskEncryption() { - return this.enabledForDiskEncryption; - } - - /** - * Set the enabledForDiskEncryption property: Property to specify whether Azure Disk Encryption is permitted to - * retrieve secrets from the vault and unwrap keys. - * - * @param enabledForDiskEncryption the enabledForDiskEncryption value to set. - * @return the VaultPatchProperties object itself. - */ - public VaultPatchProperties withEnabledForDiskEncryption(Boolean enabledForDiskEncryption) { - this.enabledForDiskEncryption = enabledForDiskEncryption; - return this; - } - - /** - * Get the enabledForTemplateDeployment property: Property to specify whether Azure Resource Manager is permitted to - * retrieve secrets from the key vault. - * - * @return the enabledForTemplateDeployment value. - */ - public Boolean enabledForTemplateDeployment() { - return this.enabledForTemplateDeployment; - } - - /** - * Set the enabledForTemplateDeployment property: Property to specify whether Azure Resource Manager is permitted to - * retrieve secrets from the key vault. - * - * @param enabledForTemplateDeployment the enabledForTemplateDeployment value to set. - * @return the VaultPatchProperties object itself. - */ - public VaultPatchProperties withEnabledForTemplateDeployment(Boolean enabledForTemplateDeployment) { - this.enabledForTemplateDeployment = enabledForTemplateDeployment; - return this; - } - - /** - * Get the enableSoftDelete property: Property to specify whether the 'soft delete' functionality is enabled for - * this key vault. Once set to true, it cannot be reverted to false. - * - * @return the enableSoftDelete value. - */ - public Boolean enableSoftDelete() { - return this.enableSoftDelete; - } - - /** - * Set the enableSoftDelete property: Property to specify whether the 'soft delete' functionality is enabled for - * this key vault. Once set to true, it cannot be reverted to false. - * - * @param enableSoftDelete the enableSoftDelete value to set. - * @return the VaultPatchProperties object itself. - */ - public VaultPatchProperties withEnableSoftDelete(Boolean enableSoftDelete) { - this.enableSoftDelete = enableSoftDelete; - return this; - } - - /** - * Get the enableRbacAuthorization property: Property that controls how data actions are authorized. When true, the - * key vault will use Role Based Access Control (RBAC) for authorization of data actions, and the access policies - * specified in vault properties will be ignored (warning: this is a preview feature). When false, the key vault - * will use the access policies specified in vault properties, and any policy stored on Azure Resource Manager will - * be ignored. If null or not specified, the value of this property will not change. - * - * @return the enableRbacAuthorization value. - */ - public Boolean enableRbacAuthorization() { - return this.enableRbacAuthorization; - } - - /** - * Set the enableRbacAuthorization property: Property that controls how data actions are authorized. When true, the - * key vault will use Role Based Access Control (RBAC) for authorization of data actions, and the access policies - * specified in vault properties will be ignored (warning: this is a preview feature). When false, the key vault - * will use the access policies specified in vault properties, and any policy stored on Azure Resource Manager will - * be ignored. If null or not specified, the value of this property will not change. - * - * @param enableRbacAuthorization the enableRbacAuthorization value to set. - * @return the VaultPatchProperties object itself. - */ - public VaultPatchProperties withEnableRbacAuthorization(Boolean enableRbacAuthorization) { - this.enableRbacAuthorization = enableRbacAuthorization; - return this; - } - - /** - * Get the softDeleteRetentionInDays property: softDelete data retention days. It accepts >=7 and <=90. - * - * @return the softDeleteRetentionInDays value. - */ - public Integer softDeleteRetentionInDays() { - return this.softDeleteRetentionInDays; - } - - /** - * Set the softDeleteRetentionInDays property: softDelete data retention days. It accepts >=7 and <=90. - * - * @param softDeleteRetentionInDays the softDeleteRetentionInDays value to set. - * @return the VaultPatchProperties object itself. - */ - public VaultPatchProperties withSoftDeleteRetentionInDays(Integer softDeleteRetentionInDays) { - this.softDeleteRetentionInDays = softDeleteRetentionInDays; - return this; - } - - /** - * Get the createMode property: The vault's create mode to indicate whether the vault need to be recovered or not. - * - * @return the createMode value. - */ - public CreateMode createMode() { - return this.createMode; - } - - /** - * Set the createMode property: The vault's create mode to indicate whether the vault need to be recovered or not. - * - * @param createMode the createMode value to set. - * @return the VaultPatchProperties object itself. - */ - public VaultPatchProperties withCreateMode(CreateMode createMode) { - this.createMode = createMode; - return this; - } - - /** - * Get the enablePurgeProtection property: Property specifying whether protection against purge is enabled for this - * vault. Setting this property to true activates protection against purge for this vault and its content - only the - * Key Vault service may initiate a hard, irrecoverable deletion. The setting is effective only if soft delete is - * also enabled. Enabling this functionality is irreversible - that is, the property does not accept false as its - * value. - * - * @return the enablePurgeProtection value. - */ - public Boolean enablePurgeProtection() { - return this.enablePurgeProtection; - } - - /** - * Set the enablePurgeProtection property: Property specifying whether protection against purge is enabled for this - * vault. Setting this property to true activates protection against purge for this vault and its content - only the - * Key Vault service may initiate a hard, irrecoverable deletion. The setting is effective only if soft delete is - * also enabled. Enabling this functionality is irreversible - that is, the property does not accept false as its - * value. - * - * @param enablePurgeProtection the enablePurgeProtection value to set. - * @return the VaultPatchProperties object itself. - */ - public VaultPatchProperties withEnablePurgeProtection(Boolean enablePurgeProtection) { - this.enablePurgeProtection = enablePurgeProtection; - return this; - } - - /** - * Get the networkAcls property: A collection of rules governing the accessibility of the vault from specific - * network locations. - * - * @return the networkAcls value. - */ - public NetworkRuleSet networkAcls() { - return this.networkAcls; - } - - /** - * Set the networkAcls property: A collection of rules governing the accessibility of the vault from specific - * network locations. - * - * @param networkAcls the networkAcls value to set. - * @return the VaultPatchProperties object itself. - */ - public VaultPatchProperties withNetworkAcls(NetworkRuleSet networkAcls) { - this.networkAcls = networkAcls; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (sku() != null) { - sku().validate(); - } - if (accessPolicies() != null) { - accessPolicies().forEach(e -> e.validate()); - } - if (networkAcls() != null) { - networkAcls().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/VaultProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/VaultProperties.java deleted file mode 100644 index b86adbda5adc..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/VaultProperties.java +++ /dev/null @@ -1,502 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.keyvault.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.UUID; - -/** Properties of the vault. */ -@Fluent -public final class VaultProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VaultProperties.class); - - /* - * The Azure Active Directory tenant ID that should be used for - * authenticating requests to the key vault. - */ - @JsonProperty(value = "tenantId", required = true) - private UUID tenantId; - - /* - * SKU details - */ - @JsonProperty(value = "sku", required = true) - private Sku sku; - - /* - * An array of 0 to 1024 identities that have access to the key vault. All - * identities in the array must use the same tenant ID as the key vault's - * tenant ID. When `createMode` is set to `recover`, access policies are - * not required. Otherwise, access policies are required. - */ - @JsonProperty(value = "accessPolicies") - private List accessPolicies; - - /* - * The URI of the vault for performing operations on keys and secrets. This - * property is readonly - */ - @JsonProperty(value = "vaultUri") - private String vaultUri; - - /* - * The resource id of HSM Pool. - */ - @JsonProperty(value = "hsmPoolResourceId", access = JsonProperty.Access.WRITE_ONLY) - private String hsmPoolResourceId; - - /* - * Property to specify whether Azure Virtual Machines are permitted to - * retrieve certificates stored as secrets from the key vault. - */ - @JsonProperty(value = "enabledForDeployment") - private Boolean enabledForDeployment; - - /* - * Property to specify whether Azure Disk Encryption is permitted to - * retrieve secrets from the vault and unwrap keys. - */ - @JsonProperty(value = "enabledForDiskEncryption") - private Boolean enabledForDiskEncryption; - - /* - * Property to specify whether Azure Resource Manager is permitted to - * retrieve secrets from the key vault. - */ - @JsonProperty(value = "enabledForTemplateDeployment") - private Boolean enabledForTemplateDeployment; - - /* - * Property to specify whether the 'soft delete' functionality is enabled - * for this key vault. If it's not set to any value(true or false) when - * creating new key vault, it will be set to true by default. Once set to - * true, it cannot be reverted to false. - */ - @JsonProperty(value = "enableSoftDelete") - private Boolean enableSoftDelete; - - /* - * softDelete data retention days. It accepts >=7 and <=90. - */ - @JsonProperty(value = "softDeleteRetentionInDays") - private Integer softDeleteRetentionInDays; - - /* - * Property that controls how data actions are authorized. When true, the - * key vault will use Role Based Access Control (RBAC) for authorization of - * data actions, and the access policies specified in vault properties will - * be ignored (warning: this is a preview feature). When false, the key - * vault will use the access policies specified in vault properties, and - * any policy stored on Azure Resource Manager will be ignored. If null or - * not specified, the vault is created with the default value of false. - * Note that management actions are always authorized with RBAC. - */ - @JsonProperty(value = "enableRbacAuthorization") - private Boolean enableRbacAuthorization; - - /* - * The vault's create mode to indicate whether the vault need to be - * recovered or not. - */ - @JsonProperty(value = "createMode") - private CreateMode createMode; - - /* - * Property specifying whether protection against purge is enabled for this - * vault. Setting this property to true activates protection against purge - * for this vault and its content - only the Key Vault service may initiate - * a hard, irrecoverable deletion. The setting is effective only if soft - * delete is also enabled. Enabling this functionality is irreversible - - * that is, the property does not accept false as its value. - */ - @JsonProperty(value = "enablePurgeProtection") - private Boolean enablePurgeProtection; - - /* - * Rules governing the accessibility of the key vault from specific network - * locations. - */ - @JsonProperty(value = "networkAcls") - private NetworkRuleSet networkAcls; - - /* - * Provisioning state of the vault. - */ - @JsonProperty(value = "provisioningState") - private VaultProvisioningState provisioningState; - - /* - * List of private endpoint connections associated with the key vault. - */ - @JsonProperty(value = "privateEndpointConnections", access = JsonProperty.Access.WRITE_ONLY) - private List privateEndpointConnections; - - /** - * Get the tenantId property: The Azure Active Directory tenant ID that should be used for authenticating requests - * to the key vault. - * - * @return the tenantId value. - */ - public UUID tenantId() { - return this.tenantId; - } - - /** - * Set the tenantId property: The Azure Active Directory tenant ID that should be used for authenticating requests - * to the key vault. - * - * @param tenantId the tenantId value to set. - * @return the VaultProperties object itself. - */ - public VaultProperties withTenantId(UUID tenantId) { - this.tenantId = tenantId; - return this; - } - - /** - * Get the sku property: SKU details. - * - * @return the sku value. - */ - public Sku sku() { - return this.sku; - } - - /** - * Set the sku property: SKU details. - * - * @param sku the sku value to set. - * @return the VaultProperties object itself. - */ - public VaultProperties withSku(Sku sku) { - this.sku = sku; - return this; - } - - /** - * Get the accessPolicies property: An array of 0 to 1024 identities that have access to the key vault. All - * identities in the array must use the same tenant ID as the key vault's tenant ID. When `createMode` is set to - * `recover`, access policies are not required. Otherwise, access policies are required. - * - * @return the accessPolicies value. - */ - public List accessPolicies() { - return this.accessPolicies; - } - - /** - * Set the accessPolicies property: An array of 0 to 1024 identities that have access to the key vault. All - * identities in the array must use the same tenant ID as the key vault's tenant ID. When `createMode` is set to - * `recover`, access policies are not required. Otherwise, access policies are required. - * - * @param accessPolicies the accessPolicies value to set. - * @return the VaultProperties object itself. - */ - public VaultProperties withAccessPolicies(List accessPolicies) { - this.accessPolicies = accessPolicies; - return this; - } - - /** - * Get the vaultUri property: The URI of the vault for performing operations on keys and secrets. This property is - * readonly. - * - * @return the vaultUri value. - */ - public String vaultUri() { - return this.vaultUri; - } - - /** - * Set the vaultUri property: The URI of the vault for performing operations on keys and secrets. This property is - * readonly. - * - * @param vaultUri the vaultUri value to set. - * @return the VaultProperties object itself. - */ - public VaultProperties withVaultUri(String vaultUri) { - this.vaultUri = vaultUri; - return this; - } - - /** - * Get the hsmPoolResourceId property: The resource id of HSM Pool. - * - * @return the hsmPoolResourceId value. - */ - public String hsmPoolResourceId() { - return this.hsmPoolResourceId; - } - - /** - * Get the enabledForDeployment property: Property to specify whether Azure Virtual Machines are permitted to - * retrieve certificates stored as secrets from the key vault. - * - * @return the enabledForDeployment value. - */ - public Boolean enabledForDeployment() { - return this.enabledForDeployment; - } - - /** - * Set the enabledForDeployment property: Property to specify whether Azure Virtual Machines are permitted to - * retrieve certificates stored as secrets from the key vault. - * - * @param enabledForDeployment the enabledForDeployment value to set. - * @return the VaultProperties object itself. - */ - public VaultProperties withEnabledForDeployment(Boolean enabledForDeployment) { - this.enabledForDeployment = enabledForDeployment; - return this; - } - - /** - * Get the enabledForDiskEncryption property: Property to specify whether Azure Disk Encryption is permitted to - * retrieve secrets from the vault and unwrap keys. - * - * @return the enabledForDiskEncryption value. - */ - public Boolean enabledForDiskEncryption() { - return this.enabledForDiskEncryption; - } - - /** - * Set the enabledForDiskEncryption property: Property to specify whether Azure Disk Encryption is permitted to - * retrieve secrets from the vault and unwrap keys. - * - * @param enabledForDiskEncryption the enabledForDiskEncryption value to set. - * @return the VaultProperties object itself. - */ - public VaultProperties withEnabledForDiskEncryption(Boolean enabledForDiskEncryption) { - this.enabledForDiskEncryption = enabledForDiskEncryption; - return this; - } - - /** - * Get the enabledForTemplateDeployment property: Property to specify whether Azure Resource Manager is permitted to - * retrieve secrets from the key vault. - * - * @return the enabledForTemplateDeployment value. - */ - public Boolean enabledForTemplateDeployment() { - return this.enabledForTemplateDeployment; - } - - /** - * Set the enabledForTemplateDeployment property: Property to specify whether Azure Resource Manager is permitted to - * retrieve secrets from the key vault. - * - * @param enabledForTemplateDeployment the enabledForTemplateDeployment value to set. - * @return the VaultProperties object itself. - */ - public VaultProperties withEnabledForTemplateDeployment(Boolean enabledForTemplateDeployment) { - this.enabledForTemplateDeployment = enabledForTemplateDeployment; - return this; - } - - /** - * Get the enableSoftDelete property: Property to specify whether the 'soft delete' functionality is enabled for - * this key vault. If it's not set to any value(true or false) when creating new key vault, it will be set to true - * by default. Once set to true, it cannot be reverted to false. - * - * @return the enableSoftDelete value. - */ - public Boolean enableSoftDelete() { - return this.enableSoftDelete; - } - - /** - * Set the enableSoftDelete property: Property to specify whether the 'soft delete' functionality is enabled for - * this key vault. If it's not set to any value(true or false) when creating new key vault, it will be set to true - * by default. Once set to true, it cannot be reverted to false. - * - * @param enableSoftDelete the enableSoftDelete value to set. - * @return the VaultProperties object itself. - */ - public VaultProperties withEnableSoftDelete(Boolean enableSoftDelete) { - this.enableSoftDelete = enableSoftDelete; - return this; - } - - /** - * Get the softDeleteRetentionInDays property: softDelete data retention days. It accepts >=7 and <=90. - * - * @return the softDeleteRetentionInDays value. - */ - public Integer softDeleteRetentionInDays() { - return this.softDeleteRetentionInDays; - } - - /** - * Set the softDeleteRetentionInDays property: softDelete data retention days. It accepts >=7 and <=90. - * - * @param softDeleteRetentionInDays the softDeleteRetentionInDays value to set. - * @return the VaultProperties object itself. - */ - public VaultProperties withSoftDeleteRetentionInDays(Integer softDeleteRetentionInDays) { - this.softDeleteRetentionInDays = softDeleteRetentionInDays; - return this; - } - - /** - * Get the enableRbacAuthorization property: Property that controls how data actions are authorized. When true, the - * key vault will use Role Based Access Control (RBAC) for authorization of data actions, and the access policies - * specified in vault properties will be ignored (warning: this is a preview feature). When false, the key vault - * will use the access policies specified in vault properties, and any policy stored on Azure Resource Manager will - * be ignored. If null or not specified, the vault is created with the default value of false. Note that management - * actions are always authorized with RBAC. - * - * @return the enableRbacAuthorization value. - */ - public Boolean enableRbacAuthorization() { - return this.enableRbacAuthorization; - } - - /** - * Set the enableRbacAuthorization property: Property that controls how data actions are authorized. When true, the - * key vault will use Role Based Access Control (RBAC) for authorization of data actions, and the access policies - * specified in vault properties will be ignored (warning: this is a preview feature). When false, the key vault - * will use the access policies specified in vault properties, and any policy stored on Azure Resource Manager will - * be ignored. If null or not specified, the vault is created with the default value of false. Note that management - * actions are always authorized with RBAC. - * - * @param enableRbacAuthorization the enableRbacAuthorization value to set. - * @return the VaultProperties object itself. - */ - public VaultProperties withEnableRbacAuthorization(Boolean enableRbacAuthorization) { - this.enableRbacAuthorization = enableRbacAuthorization; - return this; - } - - /** - * Get the createMode property: The vault's create mode to indicate whether the vault need to be recovered or not. - * - * @return the createMode value. - */ - public CreateMode createMode() { - return this.createMode; - } - - /** - * Set the createMode property: The vault's create mode to indicate whether the vault need to be recovered or not. - * - * @param createMode the createMode value to set. - * @return the VaultProperties object itself. - */ - public VaultProperties withCreateMode(CreateMode createMode) { - this.createMode = createMode; - return this; - } - - /** - * Get the enablePurgeProtection property: Property specifying whether protection against purge is enabled for this - * vault. Setting this property to true activates protection against purge for this vault and its content - only the - * Key Vault service may initiate a hard, irrecoverable deletion. The setting is effective only if soft delete is - * also enabled. Enabling this functionality is irreversible - that is, the property does not accept false as its - * value. - * - * @return the enablePurgeProtection value. - */ - public Boolean enablePurgeProtection() { - return this.enablePurgeProtection; - } - - /** - * Set the enablePurgeProtection property: Property specifying whether protection against purge is enabled for this - * vault. Setting this property to true activates protection against purge for this vault and its content - only the - * Key Vault service may initiate a hard, irrecoverable deletion. The setting is effective only if soft delete is - * also enabled. Enabling this functionality is irreversible - that is, the property does not accept false as its - * value. - * - * @param enablePurgeProtection the enablePurgeProtection value to set. - * @return the VaultProperties object itself. - */ - public VaultProperties withEnablePurgeProtection(Boolean enablePurgeProtection) { - this.enablePurgeProtection = enablePurgeProtection; - return this; - } - - /** - * Get the networkAcls property: Rules governing the accessibility of the key vault from specific network locations. - * - * @return the networkAcls value. - */ - public NetworkRuleSet networkAcls() { - return this.networkAcls; - } - - /** - * Set the networkAcls property: Rules governing the accessibility of the key vault from specific network locations. - * - * @param networkAcls the networkAcls value to set. - * @return the VaultProperties object itself. - */ - public VaultProperties withNetworkAcls(NetworkRuleSet networkAcls) { - this.networkAcls = networkAcls; - return this; - } - - /** - * Get the provisioningState property: Provisioning state of the vault. - * - * @return the provisioningState value. - */ - public VaultProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Set the provisioningState property: Provisioning state of the vault. - * - * @param provisioningState the provisioningState value to set. - * @return the VaultProperties object itself. - */ - public VaultProperties withProvisioningState(VaultProvisioningState provisioningState) { - this.provisioningState = provisioningState; - return this; - } - - /** - * Get the privateEndpointConnections property: List of private endpoint connections associated with the key vault. - * - * @return the privateEndpointConnections value. - */ - public List privateEndpointConnections() { - return this.privateEndpointConnections; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (tenantId() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property tenantId in model VaultProperties")); - } - if (sku() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property sku in model VaultProperties")); - } else { - sku().validate(); - } - if (accessPolicies() != null) { - accessPolicies().forEach(e -> e.validate()); - } - if (networkAcls() != null) { - networkAcls().validate(); - } - if (privateEndpointConnections() != null) { - privateEndpointConnections().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/VaultProvisioningState.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/VaultProvisioningState.java deleted file mode 100644 index 3ed730cdafaf..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/VaultProvisioningState.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.keyvault.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for VaultProvisioningState. */ -public final class VaultProvisioningState extends ExpandableStringEnum { - /** Static value Succeeded for VaultProvisioningState. */ - public static final VaultProvisioningState SUCCEEDED = fromString("Succeeded"); - - /** Static value RegisteringDns for VaultProvisioningState. */ - public static final VaultProvisioningState REGISTERING_DNS = fromString("RegisteringDns"); - - /** - * Creates or finds a VaultProvisioningState from its string representation. - * - * @param name a name to look for. - * @return the corresponding VaultProvisioningState. - */ - @JsonCreator - public static VaultProvisioningState fromString(String name) { - return fromString(name, VaultProvisioningState.class); - } - - /** @return known VaultProvisioningState values. */ - public static Collection values() { - return values(VaultProvisioningState.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/Vaults.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/Vaults.java deleted file mode 100644 index 86e710586bf2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/Vaults.java +++ /dev/null @@ -1,131 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.keyvault.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.exception.ManagementException; -import com.azure.resourcemanager.keyvault.KeyVaultManager; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsDeletingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsListingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsCreating; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingById; -import reactor.core.publisher.Mono; - -/** Entry point for key vaults management API. */ -@Fluent -public interface Vaults - extends SupportsCreating, - SupportsDeletingById, - SupportsListingByResourceGroup, - SupportsGettingByResourceGroup, - SupportsGettingById, - SupportsDeletingByResourceGroup, - HasManager { - - /** - * Gets information about the deleted vaults in a subscription. - * - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ManagementException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the PagedList<DeletedVault> object if successful. - */ - PagedIterable listDeleted(); - - /** - * Gets information about the deleted vaults in a subscription. - * - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<DeletedVault> object - */ - PagedFlux listDeletedAsync(); - - /** - * Gets the deleted Azure key vault. - * - * @param vaultName The name of the vault. - * @param location The location of the deleted vault. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ManagementException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the DeletedVault object if successful. - */ - DeletedVault getDeleted(String vaultName, String location); - - /** - * Gets the deleted Azure key vault. - * - * @param vaultName The name of the vault. - * @param location The location of the deleted vault. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link Mono} object - */ - Mono getDeletedAsync(String vaultName, String location); - - /** - * Permanently deletes the specified vault. aka Purges the deleted Azure key vault. - * - * @param vaultName The name of the soft-deleted vault. - * @param location The location of the soft-deleted vault. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ManagementException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - */ - void purgeDeleted(String vaultName, String location); - - /** - * Permanently deletes the specified vault. aka Purges the deleted Azure key vault. - * - * @param vaultName The name of the soft-deleted vault. - * @param location The location of the soft-deleted vault. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - Mono purgeDeletedAsync(String vaultName, String location); - - /** - * Checks that the vault name is valid and is not already in use. - * - * @param name The vault name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ManagementException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the CheckNameAvailabilityResult object if successful. - */ - CheckNameAvailabilityResult checkNameAvailability(String name); - - /** - * Checks that the vault name is valid and is not already in use. - * - * @param name The vault name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the CheckNameAvailabilityResult object - */ - Mono checkNameAvailabilityAsync(String name); - - /** - * Recovers a soft deleted vault. - * - * @param resourceGroupName The name of the Resource Group to which the server belongs. - * @param vaultName Name of the vault - * @param location The location of the deleted vault. - * @return the recovered Vault object if successful - */ - Vault recoverSoftDeletedVault(String resourceGroupName, String vaultName, String location); - - /** - * Recovers a soft deleted vault. - * - * @param resourceGroupName The name of the Resource Group to which the server belongs. - * @param vaultName Name of the vault - * @param location The location of the deleted vault. - * @return the recovered Vault object if successful - */ - Mono recoverSoftDeletedVaultAsync(String resourceGroupName, String vaultName, String location); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/VirtualNetworkRule.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/VirtualNetworkRule.java deleted file mode 100644 index 9183b67c6a61..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/VirtualNetworkRule.java +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.keyvault.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** A rule governing the accessibility of a vault from a specific virtual network. */ -@Fluent -public final class VirtualNetworkRule { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkRule.class); - - /* - * Full resource id of a vnet subnet, such as - * '/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1'. - */ - @JsonProperty(value = "id", required = true) - private String id; - - /* - * Property to specify whether NRP will ignore the check if parent subnet - * has serviceEndpoints configured. - */ - @JsonProperty(value = "ignoreMissingVnetServiceEndpoint") - private Boolean ignoreMissingVnetServiceEndpoint; - - /** - * Get the id property: Full resource id of a vnet subnet, such as - * '/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1'. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: Full resource id of a vnet subnet, such as - * '/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1'. - * - * @param id the id value to set. - * @return the VirtualNetworkRule object itself. - */ - public VirtualNetworkRule withId(String id) { - this.id = id; - return this; - } - - /** - * Get the ignoreMissingVnetServiceEndpoint property: Property to specify whether NRP will ignore the check if - * parent subnet has serviceEndpoints configured. - * - * @return the ignoreMissingVnetServiceEndpoint value. - */ - public Boolean ignoreMissingVnetServiceEndpoint() { - return this.ignoreMissingVnetServiceEndpoint; - } - - /** - * Set the ignoreMissingVnetServiceEndpoint property: Property to specify whether NRP will ignore the check if - * parent subnet has serviceEndpoints configured. - * - * @param ignoreMissingVnetServiceEndpoint the ignoreMissingVnetServiceEndpoint value to set. - * @return the VirtualNetworkRule object itself. - */ - public VirtualNetworkRule withIgnoreMissingVnetServiceEndpoint(Boolean ignoreMissingVnetServiceEndpoint) { - this.ignoreMissingVnetServiceEndpoint = ignoreMissingVnetServiceEndpoint; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (id() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property id in model VirtualNetworkRule")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/package-info.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/package-info.java deleted file mode 100644 index 0358489a1fb8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** - * Package containing the data models for KeyVaultManagementClient. The Azure management API provides a RESTful set of - * web services that interact with Azure Key Vault. - */ -package com.azure.resourcemanager.keyvault.models; diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/package-info.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/package-info.java deleted file mode 100644 index c94865ad6dc8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** - * Package containing the classes for KeyVaultManagementClient. The Azure management API provides a RESTful set of web - * services that interact with Azure Key Vault. - */ -package com.azure.resourcemanager.keyvault; diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/module-info.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/module-info.java deleted file mode 100644 index ce05561e3f89..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/main/java/module-info.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -module com.azure.resourcemanager.keyvault { - requires transitive com.azure.resourcemanager.resources; - requires transitive com.azure.security.keyvault.keys; - requires transitive com.azure.security.keyvault.secrets; - requires transitive com.azure.resourcemanager.authorization; - - // export public APIs of keyvault - exports com.azure.resourcemanager.keyvault; - exports com.azure.resourcemanager.keyvault.fluent; - exports com.azure.resourcemanager.keyvault.fluent.models; - exports com.azure.resourcemanager.keyvault.models; - - // open packages specifically for azure core and jackson - opens com.azure.resourcemanager.keyvault.fluent.models to - com.azure.core, - com.fasterxml.jackson.databind; - opens com.azure.resourcemanager.keyvault.models to - com.azure.core, - com.fasterxml.jackson.databind; -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/samples/java/com/azure/resourcemanager/keyvault/ReadmeSamples.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/samples/java/com/azure/resourcemanager/keyvault/ReadmeSamples.java deleted file mode 100644 index 22200d110681..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/samples/java/com/azure/resourcemanager/keyvault/ReadmeSamples.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.keyvault; - -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpMethod; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.util.serializer.JacksonAdapter; -import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.identity.DefaultAzureCredentialBuilder; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.ArrayNode; - -import java.io.IOException; -import java.util.HashMap; - -public class ReadmeSamples { - - public void authenticate() { - // BEGIN: com.azure.resourcemanager.keyvault.authenticate - String armEndpoint = "https://management.."; - AzureProfile profile = new AzureProfile(getAzureEnvironmentFromArmEndpoint(armEndpoint)); - TokenCredential credential = new DefaultAzureCredentialBuilder() - .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) - .build(); - KeyVaultManager manager = KeyVaultManager - .authenticate(credential, profile); - // END: com.azure.resourcemanager.keyvault.authenticate - } - - // BEGIN: com.azure.resourcemanager.keyvault.getazureenvironment - private static AzureEnvironment getAzureEnvironmentFromArmEndpoint(String armEndpoint) { - // Create HTTP client and request - HttpClient httpClient = HttpClient.createDefault(); - - HttpRequest request = new HttpRequest(HttpMethod.GET, - String.format("%s/metadata/endpoints?api-version=2019-10-01", armEndpoint)) - .setHeader("accept", "application/json"); - - // Execute the request and read the response - HttpResponse response = httpClient.send(request).block(); - if (response.getStatusCode() != 200) { - throw new RuntimeException("Failed : HTTP error code : " + response.getStatusCode()); - } - String body = response.getBodyAsString().block(); - try { - ArrayNode metadataArray = JacksonAdapter.createDefaultSerializerAdapter() - .deserialize(body, ArrayNode.class, SerializerEncoding.JSON); - - if (metadataArray == null || metadataArray.isEmpty()) { - throw new RuntimeException("Failed to find metadata : " + body); - } - - JsonNode metadata = metadataArray.iterator().next(); - AzureEnvironment azureEnvironment = new AzureEnvironment(new HashMap() { - { - put("managementEndpointUrl", metadata.at("/authentication/audiences/0").asText()); - put("resourceManagerEndpointUrl", armEndpoint); - put("galleryEndpointUrl", metadata.at("/gallery").asText()); - put("activeDirectoryEndpointUrl", metadata.at("/authentication/loginEndpoint").asText()); - put("activeDirectoryResourceId", metadata.at("/authentication/audiences/0").asText()); - put("activeDirectoryGraphResourceId", metadata.at("/graph").asText()); - put("storageEndpointSuffix", "." + metadata.at("/suffixes/storage").asText()); - put("keyVaultDnsSuffix", "." + metadata.at("/suffixes/keyVaultDns").asText()); - } - }); - return azureEnvironment; - } catch (IOException ioe) { - ioe.printStackTrace(); - throw new RuntimeException(ioe); - } - } - // END: com.azure.resourcemanager.keyvault.getazureenvironment -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/test/java/com/azure/resourcemanager/keyvault/KeyTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/test/java/com/azure/resourcemanager/keyvault/KeyTests.java deleted file mode 100644 index d5452c27260e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/test/java/com/azure/resourcemanager/keyvault/KeyTests.java +++ /dev/null @@ -1,276 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.keyvault; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.test.annotation.DoNotRecord; -import com.azure.resourcemanager.keyvault.models.Key; -import com.azure.resourcemanager.keyvault.models.Vault; -import com.azure.resourcemanager.test.utils.TestUtilities; -import com.azure.core.management.Region; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import com.azure.security.keyvault.keys.cryptography.models.EncryptionAlgorithm; -import com.azure.security.keyvault.keys.cryptography.models.KeyWrapAlgorithm; -import com.azure.security.keyvault.keys.cryptography.models.SignatureAlgorithm; -import com.azure.security.keyvault.keys.models.JsonWebKey; -import com.azure.security.keyvault.keys.models.KeyCurveName; -import com.azure.security.keyvault.keys.models.KeyOperation; -import com.azure.security.keyvault.keys.models.KeyType; -import java.security.KeyPair; -import java.security.KeyPairGenerator; -import java.security.MessageDigest; -import java.security.Signature; -import java.time.Duration; -import javax.crypto.Cipher; -import javax.crypto.KeyGenerator; -import javax.crypto.SecretKey; -import javax.crypto.spec.SecretKeySpec; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public class KeyTests extends KeyVaultManagementTest { - - @Test - @DoNotRecord - public void canCRUDKey() throws Exception { - if (skipInPlayback()) { - return; - } - - Vault vault = createVault(); - String keyName = generateRandomResourceName("key", 20); - - // Create - Key key = - vault - .keys() - .define(keyName) - .withKeyTypeToCreate(KeyType.RSA) - .withKeyOperations(KeyOperation.SIGN, KeyOperation.VERIFY) - .create(); - - Assertions.assertNotNull(key); - Assertions.assertNotNull(key.id()); - Assertions.assertEquals(2, key.getJsonWebKey().getKeyOps().size()); - - // Get - Key key1 = vault.keys().getById(key.id()); - Assertions.assertNotNull(key1); - Assertions.assertEquals(key.id(), key1.id()); - - // Update - key = key.update().withKeyOperations(KeyOperation.ENCRYPT).apply(); - - Assertions.assertEquals(1, key.getJsonWebKey().getKeyOps().size()); - - // New version - key = - key - .update() - .withKeyTypeToCreate(KeyType.RSA) - .withKeyOperations(KeyOperation.ENCRYPT, KeyOperation.DECRYPT, KeyOperation.SIGN) - .apply(); - - Assertions.assertEquals(3, key.getJsonWebKey().getKeyOps().size()); - - // List versions - Iterable keys = key.listVersions(); - Assertions.assertEquals(2, TestUtilities.getSize(keys)); - - // Create RSA key with size - key = vault - .keys() - .define(keyName) - .withKeyTypeToCreate(KeyType.RSA) - .withKeyOperations(KeyOperation.SIGN, KeyOperation.VERIFY) - .withKeySize(2048) - .create(); - - Assertions.assertNotNull(key); - Assertions.assertNotNull(key.id()); - Assertions.assertEquals(KeyType.RSA, key.getJsonWebKey().getKeyType()); - - // Create EC key with curve - key = vault - .keys() - .define(keyName) - .withKeyTypeToCreate(KeyType.EC) - .withKeyOperations(KeyOperation.SIGN, KeyOperation.VERIFY) - .withKeyCurveName(KeyCurveName.P_521) - .create(); - - Assertions.assertNotNull(key); - Assertions.assertNotNull(key.id()); - Assertions.assertEquals(KeyType.EC, key.getJsonWebKey().getKeyType()); - Assertions.assertEquals(KeyCurveName.P_521, key.getJsonWebKey().getCurveName()); - } - - @Test - @DoNotRecord - public void canImportKey() throws Exception { - if (skipInPlayback()) { - return; - } - - Vault vault = createVault(); - String keyName = generateRandomResourceName("key", 20); - - Key key = - vault - .keys() - .define(keyName) - .withLocalKeyToImport(JsonWebKey.fromRsa(KeyPairGenerator.getInstance("RSA").generateKeyPair())) - .create(); - - Assertions.assertNotNull(key); - Assertions.assertNotNull(key.id()); - } - - @Test - @DoNotRecord - public void canBackupAndRestore() throws Exception { - if (skipInPlayback()) { - return; - } - - Vault vault = createVault(); - String keyName = generateRandomResourceName("key", 20); - - Key key = - vault - .keys() - .define(keyName) - .withLocalKeyToImport(JsonWebKey.fromRsa(KeyPairGenerator.getInstance("RSA").generateKeyPair())) - .create(); - - Assertions.assertNotNull(key); - - byte[] backup = key.backup(); - - vault.keys().deleteById(key.id()); - Assertions.assertEquals(0, TestUtilities.getSize(vault.keys().list())); - - vault.keys().restore(backup); - PagedIterable keys = vault.keys().list(); - Assertions.assertEquals(1, TestUtilities.getSize(keys)); - - Assertions.assertEquals(key.getJsonWebKey(), keys.iterator().next().getJsonWebKey()); - } - - @Test - @DoNotRecord - public void canEncryptAndDecrypt() throws Exception { - if (skipInPlayback()) { - return; - } - - Vault vault = createVault(); - String keyName = generateRandomResourceName("key", 20); - - KeyPair keyPair = KeyPairGenerator.getInstance("RSA").generateKeyPair(); - - Key key = vault.keys().define(keyName).withLocalKeyToImport(JsonWebKey.fromRsa(keyPair)).create(); - - Assertions.assertNotNull(key); - - String s = "the quick brown fox jumps over the lazy dog"; - byte[] data = s.getBytes(); - - // Remote encryption - byte[] encrypted = key.encrypt(EncryptionAlgorithm.RSA1_5, data); - Assertions.assertNotNull(encrypted); - - byte[] decrypted = key.decrypt(EncryptionAlgorithm.RSA1_5, encrypted); - Assertions.assertEquals(s, new String(decrypted)); - - // Local encryption - Cipher cipher = Cipher.getInstance("RSA/ECB/OAEPWithSHA-1AndMGF1Padding"); - cipher.init(Cipher.ENCRYPT_MODE, keyPair.getPublic()); - encrypted = cipher.doFinal(data); - - decrypted = key.decrypt(EncryptionAlgorithm.RSA_OAEP, encrypted); - Assertions.assertEquals(s, new String(decrypted)); - } - - @Test - @DoNotRecord - public void canSignAndVerify() throws Exception { - if (skipInPlayback()) { - return; - } - - Vault vault = createVault(); - String keyName = generateRandomResourceName("key", 20); - - KeyPair keyPair = KeyPairGenerator.getInstance("RSA").generateKeyPair(); - - Key key = vault.keys().define(keyName).withLocalKeyToImport(JsonWebKey.fromRsa(keyPair)).create(); - - Assertions.assertNotNull(key); - - String s = "the quick brown fox jumps over the lazy dog"; - byte[] data = s.getBytes(); - byte[] digest = MessageDigest.getInstance("SHA-256").digest(data); - byte[] signature = key.sign(SignatureAlgorithm.RS256, digest); - Assertions.assertNotNull(signature); - - // Local verification - Signature sign = Signature.getInstance("SHA256withRSA"); - sign.initVerify(keyPair.getPublic()); - sign.update(data); - Assertions.assertTrue(sign.verify(signature)); - - // Remote verification - Assertions.assertTrue(key.verify(SignatureAlgorithm.RS256, digest, signature)); - } - - @Test - @DoNotRecord - public void canWrapAndUnwrap() throws Exception { - if (skipInPlayback()) { - return; - } - - Vault vault = createVault(); - String keyName = generateRandomResourceName("key", 20); - - Key key = - vault - .keys() - .define(keyName) - .withLocalKeyToImport(JsonWebKey.fromRsa(KeyPairGenerator.getInstance("RSA").generateKeyPair())) - .create(); - - SecretKey secretKey = KeyGenerator.getInstance("AES").generateKey(); - - byte[] wrapped = key.wrapKey(KeyWrapAlgorithm.RSA1_5, secretKey.getEncoded()); - Assertions.assertNotNull(wrapped); - - byte[] unwrapped = key.unwrapKey(KeyWrapAlgorithm.RSA1_5, wrapped); - Assertions.assertNotNull(unwrapped); - Assertions.assertEquals(secretKey, new SecretKeySpec(unwrapped, "AES")); - } - - private Vault createVault() throws Exception { - String vaultName = generateRandomResourceName("vault", 20); - - Vault vault = - keyVaultManager - .vaults() - .define(vaultName) - .withRegion(locationOrDefault(Region.US_WEST)) - .withNewResourceGroup(rgName) - .defineAccessPolicy() - .forServicePrincipal(clientIdFromFile()) - .allowKeyAllPermissions() - .attach() - .create(); - - Assertions.assertNotNull(vault); - - ResourceManagerUtils.sleep(Duration.ofSeconds(10)); - - return vault; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/test/java/com/azure/resourcemanager/keyvault/KeyVaultManagementTest.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/test/java/com/azure/resourcemanager/keyvault/KeyVaultManagementTest.java deleted file mode 100644 index 47feedb1acfe..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/test/java/com/azure/resourcemanager/keyvault/KeyVaultManagementTest.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.keyvault; - -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.policy.HttpLogOptions; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.resourcemanager.authorization.AuthorizationManager; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.resources.ResourceManager; -import com.azure.resourcemanager.resources.fluentcore.utils.HttpPipelineProvider; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import com.azure.resourcemanager.test.ResourceManagerTestBase; -import com.azure.resourcemanager.test.utils.TestDelayProvider; - -import java.time.temporal.ChronoUnit; -import java.util.List; - -/** The base for KeyVault manager tests. */ -public class KeyVaultManagementTest extends ResourceManagerTestBase { - protected ResourceManager resourceManager; - protected KeyVaultManager keyVaultManager; - protected AuthorizationManager authorizationManager; - protected String rgName = ""; - protected String vaultName = ""; - - @Override - protected HttpPipeline buildHttpPipeline( - TokenCredential credential, - AzureProfile profile, - HttpLogOptions httpLogOptions, - List policies, - HttpClient httpClient) { - return HttpPipelineProvider.buildHttpPipeline( - credential, - profile, - null, - httpLogOptions, - null, - new RetryPolicy("Retry-After", ChronoUnit.SECONDS), - policies, - httpClient); - } - - @Override - protected void initializeClients(HttpPipeline httpPipeline, AzureProfile profile) { - rgName = generateRandomResourceName("javacsmrg", 15); - vaultName = generateRandomResourceName("java-keyvault-", 20); - - ResourceManagerUtils.InternalRuntimeContext.setDelayProvider(new TestDelayProvider(!isPlaybackMode())); - authorizationManager = buildManager(AuthorizationManager.class, httpPipeline, profile); - keyVaultManager = buildManager(KeyVaultManager.class, httpPipeline, profile); - resourceManager = keyVaultManager.resourceManager(); - } - - @Override - protected void cleanUpResources() { - resourceManager.resourceGroups().beginDeleteByName(rgName); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/test/java/com/azure/resourcemanager/keyvault/SecretTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/test/java/com/azure/resourcemanager/keyvault/SecretTests.java deleted file mode 100644 index c8478b634739..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/test/java/com/azure/resourcemanager/keyvault/SecretTests.java +++ /dev/null @@ -1,151 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.keyvault; - -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.test.annotation.DoNotRecord; -import com.azure.resourcemanager.keyvault.models.Secret; -import com.azure.resourcemanager.keyvault.models.Vault; -import com.azure.core.management.Region; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -import java.time.Duration; -import java.util.List; -import java.util.stream.Collectors; - -public class SecretTests extends KeyVaultManagementTest { - - @Test - @DoNotRecord - public void canCRUDSecret() throws Exception { - if (skipInPlayback()) { - return; - } - - String vaultName = generateRandomResourceName("vault", 20); - String secretName = generateRandomResourceName("secret", 20); - - Vault vault = - keyVaultManager - .vaults() - .define(vaultName) - .withRegion(locationOrDefault(Region.US_WEST)) - .withNewResourceGroup(rgName) - .defineAccessPolicy() - .forServicePrincipal(clientIdFromFile()) - .allowSecretAllPermissions() - .attach() - .create(); - - Assertions.assertNotNull(vault); - - ResourceManagerUtils.sleep(Duration.ofSeconds(10)); - - Secret secret = vault.secrets().define(secretName).withValue("Some secret value").create(); - - Assertions.assertNotNull(secret); - Assertions.assertNotNull(secret.id()); - Assertions.assertEquals("Some secret value", secret.getValue()); - - secret = secret.update().withValue("Some updated value").apply(); - - Assertions.assertEquals("Some updated value", secret.getValue()); - - Iterable versions = secret.listVersions(); - - int count = 2; - for (Secret version : versions) { - if ("Some secret value".equals(version.getValue())) { - count--; - } - if ("Some updated value".equals(version.getValue())) { - count--; - } - } - Assertions.assertEquals(0, count); - } - - @Test - @DoNotRecord - public void canDisableSecret() throws Exception { - if (skipInPlayback()) { - return; - } - - String vaultName = generateRandomResourceName("vault", 20); - String secretName = generateRandomResourceName("secret", 20); - - Vault vault = - keyVaultManager - .vaults() - .define(vaultName) - .withRegion(locationOrDefault(Region.US_WEST)) - .withNewResourceGroup(rgName) - .defineAccessPolicy() - .forServicePrincipal(clientIdFromFile()) - .allowSecretAllPermissions() - .attach() - .create(); - - Assertions.assertNotNull(vault); - - ResourceManagerUtils.sleep(Duration.ofSeconds(10)); - - final String value1 = "Some secret value"; - final String value2 = "Other secret value"; - final String type2 = "Other type"; - - // version - Secret secret = vault.secrets().define(secretName) - .withValue(value1) - .create(); - String version1 = secret.attributes().getVersion(); - - Assertions.assertNotNull(secret); - Assertions.assertNotNull(secret.id()); - - // new version - Secret secret2 = vault.secrets().define(secretName) - .withValue(value2) - .withContentType(type2) - .create(); - String version2 = secret2.attributes().getVersion(); - - // disable secret - vault.secrets().disableByNameAndVersion(secretName, version2); - - List secrets = vault.secrets().list().stream().collect(Collectors.toList()); - Assertions.assertEquals(1, secrets.size()); - - // list by version - secrets = secrets.iterator().next().listVersions().stream().collect(Collectors.toList()); - Assertions.assertEquals(2, secrets.size()); - - // find secrets - secret = secrets.stream().filter(s -> s.attributes().getVersion().equals(version1)).findFirst().get(); - secret2 = secrets.stream().filter(s -> s.attributes().getVersion().equals(version2)).findFirst().get(); - - // verify enabled/disabled - Assertions.assertTrue(secret.enabled()); - Assertions.assertFalse(secret2.enabled()); - - Assertions.assertEquals(value1, secret.getValue()); - - // verify that disable secret does not support GET - Assertions.assertThrows(ResourceModifiedException.class, secret2::getValue); - - // enable secret - secret2 = vault.secrets().enableByNameAndVersion(secretName, version2); - - // can get secret value after enabling - Assertions.assertEquals(value2, secret2.getValue()); - Assertions.assertEquals(type2, secret2.contentType()); - - secret2 = vault.secrets().getById(secret2.id()); - Assertions.assertEquals(value2, secret2.getValue()); - Assertions.assertEquals(type2, secret2.contentType()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/test/java/com/azure/resourcemanager/keyvault/VaultTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/test/java/com/azure/resourcemanager/keyvault/VaultTests.java deleted file mode 100644 index 493bdafb9ec1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/test/java/com/azure/resourcemanager/keyvault/VaultTests.java +++ /dev/null @@ -1,296 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.keyvault; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.exception.ManagementException; -import com.azure.resourcemanager.authorization.models.ActiveDirectoryUser; -import com.azure.resourcemanager.authorization.models.ServicePrincipal; -import com.azure.resourcemanager.keyvault.models.AccessPolicy; -import com.azure.resourcemanager.keyvault.models.CertificatePermissions; -import com.azure.resourcemanager.keyvault.models.KeyPermissions; -import com.azure.resourcemanager.keyvault.models.NetworkRuleBypassOptions; -import com.azure.resourcemanager.keyvault.models.SecretPermissions; -import com.azure.resourcemanager.keyvault.models.Vault; -import com.azure.core.management.Region; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -import java.time.Duration; - -public class VaultTests extends KeyVaultManagementTest { - @Test - public void canCRUDVault() throws Exception { - // Create user service principal - String sp = generateRandomResourceName("sp", 20); - String us = generateRandomResourceName("us", 20); - ServicePrincipal servicePrincipal = - authorizationManager.servicePrincipals().define(sp).withNewApplication("http://" + sp).create(); - - ActiveDirectoryUser user = - authorizationManager.users().define(us).withEmailAlias(us).withPassword(password()).create(); - - try { - // CREATE - Vault vault = - keyVaultManager - .vaults() - .define(vaultName) - .withRegion(locationOrDefault(Region.US_WEST)) - .withNewResourceGroup(rgName) - .defineAccessPolicy() - .forServicePrincipal("http://" + sp) - .allowKeyPermissions(KeyPermissions.LIST) - .allowSecretAllPermissions() - .allowCertificatePermissions(CertificatePermissions.GET) - .attach() - .defineAccessPolicy() - .forUser(us) - .allowKeyAllPermissions() - .allowSecretAllPermissions() - .allowCertificatePermissions( - CertificatePermissions.GET, CertificatePermissions.LIST, CertificatePermissions.CREATE) - .attach() - // .withBypass(NetworkRuleBypassOptions.AZURE_SERVICES) - .withAccessFromAzureServices() - .withAccessFromIpAddress("0.0.0.0/0") - .create(); - Assertions.assertNotNull(vault); - //Assertions.assertFalse(vault.softDeleteEnabled()); - Assertions.assertEquals(vault.networkRuleSet().bypass(), NetworkRuleBypassOptions.AZURE_SERVICES); - - // GET - vault = keyVaultManager.vaults().getByResourceGroup(rgName, vaultName); - Assertions.assertNotNull(vault); - for (AccessPolicy policy : vault.accessPolicies()) { - if (policy.objectId().equals(servicePrincipal.id())) { - Assertions - .assertArrayEquals( - new KeyPermissions[] {KeyPermissions.LIST}, policy.permissions().keys().toArray()); - Assertions.assertEquals(SecretPermissions.values().size(), policy.permissions().secrets().size()); - Assertions - .assertArrayEquals( - new CertificatePermissions[] {CertificatePermissions.GET}, - policy.permissions().certificates().toArray()); - } - if (policy.objectId().equals(user.id())) { - Assertions.assertEquals(KeyPermissions.values().size(), policy.permissions().keys().size()); - Assertions.assertEquals(SecretPermissions.values().size(), policy.permissions().secrets().size()); - Assertions.assertEquals(3, policy.permissions().certificates().size()); - } - } - // LIST - PagedIterable vaults = keyVaultManager.vaults().listByResourceGroup(rgName); - for (Vault v : vaults) { - if (vaultName.equals(v.name())) { - vault = v; - break; - } - } - Assertions.assertNotNull(vault); - // UPDATE - vault - .update() - .updateAccessPolicy(servicePrincipal.id()) - .allowKeyAllPermissions() - .disallowSecretAllPermissions() - .allowCertificateAllPermissions() - .parent() - .withTag("foo", "bar") - .apply(); - for (AccessPolicy policy : vault.accessPolicies()) { - if (policy.objectId().equals(servicePrincipal.id())) { - Assertions.assertEquals(KeyPermissions.values().size(), policy.permissions().keys().size()); - Assertions.assertEquals(0, policy.permissions().secrets().size()); - Assertions - .assertEquals( - CertificatePermissions.values().size(), policy.permissions().certificates().size()); - } - } - - // DELETE - keyVaultManager.vaults().deleteById(vault.id()); - //ResourceManagerUtils.sleep(Duration.ofSeconds(20)); - //assertVaultDeleted(vaultName, locationOrDefault(Region.US_WEST).toString()); - } finally { - authorizationManager.servicePrincipals().deleteById(servicePrincipal.id()); - // graphRbacManager.users().deleteById(user.id()); - } - } - - @Test void canCRUDVaultWithRbac() { - Vault vault = keyVaultManager.vaults().define(vaultName) - .withRegion(locationOrDefault(Region.US_WEST)) - .withNewResourceGroup(rgName) - .withRoleBasedAccessControl() - .create(); - - Assertions.assertTrue(vault.roleBasedAccessControlEnabled()); - - vault.update() - .withoutRoleBasedAccessControl() - .apply(); - - Assertions.assertFalse(vault.roleBasedAccessControlEnabled()); - } - - @Test - public void canCRUDVaultAsync() throws Exception { - // Create user service principal - String sp = generateRandomResourceName("sp", 20); - String us = generateRandomResourceName("us", 20); - ServicePrincipal servicePrincipal = - authorizationManager.servicePrincipals().define(sp).withNewApplication("http://" + sp).create(); - - ActiveDirectoryUser user = - authorizationManager.users().define(us).withEmailAlias(us).withPassword(password()).create(); - - try { - // CREATE - Vault vault = - keyVaultManager - .vaults() - .define(vaultName) - .withRegion(locationOrDefault(Region.US_WEST)) - .withNewResourceGroup(rgName) - .defineAccessPolicy() - .forServicePrincipal("http://" + sp) - .allowKeyPermissions(KeyPermissions.LIST) - .allowSecretAllPermissions() - .allowCertificatePermissions(CertificatePermissions.GET) - .attach() - .defineAccessPolicy() - .forUser(us) - .allowKeyAllPermissions() - .allowSecretAllPermissions() - .allowCertificatePermissions( - CertificatePermissions.GET, CertificatePermissions.LIST, CertificatePermissions.CREATE) - .attach() - .create(); - Assertions.assertNotNull(vault); - //Assertions.assertFalse(vault.softDeleteEnabled()); - // GET - vault = keyVaultManager.vaults().getByResourceGroupAsync(rgName, vaultName).block(); - Assertions.assertNotNull(vault); - for (AccessPolicy policy : vault.accessPolicies()) { - if (policy.objectId().equals(servicePrincipal.id())) { - Assertions - .assertArrayEquals( - new KeyPermissions[] {KeyPermissions.LIST}, policy.permissions().keys().toArray()); - Assertions.assertEquals(SecretPermissions.values().size(), policy.permissions().secrets().size()); - Assertions - .assertArrayEquals( - new CertificatePermissions[] {CertificatePermissions.GET}, - policy.permissions().certificates().toArray()); - } - if (policy.objectId().equals(user.id())) { - Assertions.assertEquals(KeyPermissions.values().size(), policy.permissions().keys().size()); - Assertions.assertEquals(SecretPermissions.values().size(), policy.permissions().secrets().size()); - Assertions.assertEquals(3, policy.permissions().certificates().size()); - } - } - // LIST - PagedIterable vaults = - new PagedIterable<>(keyVaultManager.vaults().listByResourceGroupAsync(rgName)); - for (Vault v : vaults) { - if (vaultName.equals(v.name())) { - vault = v; - break; - } - } - Assertions.assertNotNull(vault); - // UPDATE - vault - .update() - .updateAccessPolicy(servicePrincipal.id()) - .allowKeyAllPermissions() - .disallowSecretAllPermissions() - .allowCertificateAllPermissions() - .parent() - .withTag("foo", "bar") - .apply(); - for (AccessPolicy policy : vault.accessPolicies()) { - if (policy.objectId().equals(servicePrincipal.id())) { - Assertions.assertEquals(KeyPermissions.values().size(), policy.permissions().keys().size()); - Assertions.assertEquals(0, policy.permissions().secrets().size()); - Assertions - .assertEquals( - CertificatePermissions.values().size(), policy.permissions().certificates().size()); - } - } - - // DELETE - keyVaultManager.vaults().deleteByIdAsync(vault.id()).block(); - //ResourceManagerUtils.sleep(Duration.ofSeconds(20)); - //assertVaultDeleted(vaultName, locationOrDefault(Region.US_WEST).toString()); - } finally { - authorizationManager.servicePrincipals().deleteById(servicePrincipal.id()); - // graphRbacManager.users().deleteById(user.id()); - } - } - - @Test - public void canEnableSoftDeleteAndPurge() throws InterruptedException { - String otherVaultName = vaultName + "other"; - String sp = generateRandomResourceName("sp", 20); - String us = generateRandomResourceName("us", 20); - - ServicePrincipal servicePrincipal = - authorizationManager.servicePrincipals().define(sp).withNewApplication("http://" + sp).create(); - - ActiveDirectoryUser user = - authorizationManager.users().define(us).withEmailAlias(us).withPassword(password()).create(); - - try { - Vault vault = - keyVaultManager - .vaults() - .define(otherVaultName) - .withRegion(locationOrDefault(Region.US_WEST)) - .withNewResourceGroup(rgName) - .defineAccessPolicy() - .forServicePrincipal("http://" + sp) - .allowKeyPermissions(KeyPermissions.LIST) - .allowSecretAllPermissions() - .allowCertificatePermissions(CertificatePermissions.GET) - .attach() - .defineAccessPolicy() - .forUser(us) - .allowKeyAllPermissions() - .allowSecretAllPermissions() - .allowCertificatePermissions( - CertificatePermissions.GET, CertificatePermissions.LIST, CertificatePermissions.CREATE) - .attach() - .create(); - Assertions.assertTrue(vault.softDeleteEnabled()); - - keyVaultManager.vaults().deleteByResourceGroup(rgName, otherVaultName); - - ResourceManagerUtils.sleep(Duration.ofSeconds(20)); - // Can still see deleted vault. - Assertions.assertNotNull(keyVaultManager.vaults().getDeleted(otherVaultName, locationOrDefault(Region.US_WEST).toString())); - - keyVaultManager.vaults().purgeDeleted(otherVaultName, locationOrDefault(Region.US_WEST).toString()); - ResourceManagerUtils.sleep(Duration.ofSeconds(20)); - // Vault is purged - assertVaultDeleted(otherVaultName, locationOrDefault(Region.US_WEST).toString()); - } finally { - authorizationManager.servicePrincipals().deleteById(servicePrincipal.id()); - // graphRbacManager.users().deleteById(user.id()); - } - } - - private void assertVaultDeleted(String name, String location) { - boolean deleted = false; - try { - keyVaultManager.vaults().getDeleted(name, location); - } catch (ManagementException exception) { - if (exception.getResponse().getStatusCode() == 404) { - deleted = true; - } - } - Assertions.assertTrue(deleted); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/test/resources/junit-platform.properties b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/test/resources/junit-platform.properties deleted file mode 100644 index 202d099b3ee8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/src/test/resources/junit-platform.properties +++ /dev/null @@ -1,4 +0,0 @@ -junit.jupiter.execution.parallel.enabled=true -junit.jupiter.execution.parallel.mode.default=concurrent -junit.jupiter.execution.parallel.config.strategy=fixed -junit.jupiter.execution.parallel.config.fixed.parallelism=32 diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/CHANGELOG.md b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/CHANGELOG.md deleted file mode 100644 index a41040c850c2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/CHANGELOG.md +++ /dev/null @@ -1,8 +0,0 @@ -# Release History - -## 1.0.0-hybrid (2022-01-12) - -- Azure Resource Manager monitor client library for Java (Hybrid) using API Profiles to allow building hybrid cloud solutions -that target both Azure and Azure Stack Hub. -- Supports api versions in the 2020-09-01-hybrid api profile -- Requires Azure Stack Update 2102+ diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/README.md b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/README.md deleted file mode 100644 index 69a780effe1f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/README.md +++ /dev/null @@ -1,135 +0,0 @@ -# Azure Resource Manager monitor client library for Java (Hybrid) - -Azure Resource Manager monitor client library for Java (Hybrid) using [API Profiles][api_profile] to allow building hybrid cloud solutions -that target both Azure and Azure Stack Hub. - -For documentation on how to use this package, please see [Azure Management Libraries for Java (Hybrid)][resourcemanagerhybrid_lib]. - -## Getting started - -### Prerequisites - -- [Java Development Kit (JDK)][jdk] with version 8 or above -- [Azure Subscription][azure_subscription] - -### Adding the package to your product - -```xml - - com.azure.resourcemanager - azure-resourcemanager-monitor - 1.0.0-hybrid - -``` - -### Include the recommended packages - -Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. - -[Azure Identity][azure_identity] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation. - -### Authentication - -By default, Azure Active Directory token authentication depends on correct configure of following environment variables. - -- `AZURE_CLIENT_ID` for Azure client ID. -- `AZURE_TENANT_ID` for Azure tenant ID. -- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. - -In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`. - -With above configuration, `azure` client can be authenticated by following code: - -```java com.azure.resourcemanager.monitor.authenticate -String armEndpoint = "https://management.."; -AzureProfile profile = new AzureProfile(getAzureEnvironmentFromArmEndpoint(armEndpoint)); -TokenCredential credential = new DefaultAzureCredentialBuilder() - .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) - .build(); -MonitorManager manager = MonitorManager - .authenticate(credential, profile); -``` - -Change `armEndpoint` to point to the Azure Resource Manager endpoint of your Azure Stack Hub. The azure environment's -properties above can be populated with the following example: - -```java com.azure.resourcemanager.monitor.getazureenvironment -private static AzureEnvironment getAzureEnvironmentFromArmEndpoint(String armEndpoint) { - // Create HTTP client and request - HttpClient httpClient = HttpClient.createDefault(); - - HttpRequest request = new HttpRequest(HttpMethod.GET, - String.format("%s/metadata/endpoints?api-version=2019-10-01", armEndpoint)) - .setHeader("accept", "application/json"); - - // Execute the request and read the response - HttpResponse response = httpClient.send(request).block(); - if (response.getStatusCode() != 200) { - throw new RuntimeException("Failed : HTTP error code : " + response.getStatusCode()); - } - String body = response.getBodyAsString().block(); - try { - ArrayNode metadataArray = JacksonAdapter.createDefaultSerializerAdapter() - .deserialize(body, ArrayNode.class, SerializerEncoding.JSON); - - if (metadataArray == null || metadataArray.isEmpty()) { - throw new RuntimeException("Failed to find metadata : " + body); - } - - JsonNode metadata = metadataArray.iterator().next(); - AzureEnvironment azureEnvironment = new AzureEnvironment(new HashMap() { - { - put("managementEndpointUrl", metadata.at("/authentication/audiences/0").asText()); - put("resourceManagerEndpointUrl", armEndpoint); - put("galleryEndpointUrl", metadata.at("/gallery").asText()); - put("activeDirectoryEndpointUrl", metadata.at("/authentication/loginEndpoint").asText()); - put("activeDirectoryResourceId", metadata.at("/authentication/audiences/0").asText()); - put("activeDirectoryGraphResourceId", metadata.at("/graph").asText()); - put("storageEndpointSuffix", "." + metadata.at("/suffixes/storage").asText()); - put("keyVaultDnsSuffix", "." + metadata.at("/suffixes/keyVaultDns").asText()); - } - }); - return azureEnvironment; - } catch (IOException ioe) { - ioe.printStackTrace(); - throw new RuntimeException(ioe); - } -} -``` - -When targeting a hybrid solution to global Azure instead of your Azure Stack Hub, `AzureEnvironment.AZURE` can be used instead. - -See [Authentication][authenticate] for more options. - -## Key concepts - -See [API design][design] for general introduction on design and key concepts on Azure Management Libraries. - -## Examples - -See [Samples][sample] for code snippets and samples. - -## Troubleshooting - -## Next steps - -## Contributing - -For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). - -1. Fork it -1. Create your feature branch (`git checkout -b my-new-feature`) -1. Commit your changes (`git commit -am 'Add some feature'`) -1. Push to the branch (`git push origin my-new-feature`) -1. Create new Pull Request - - -[jdk]: https://learn.microsoft.com/java/azure/jdk/ -[azure_subscription]: https://azure.microsoft.com/free/ -[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity -[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty -[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md -[sample]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/SAMPLE.md -[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md -[api_profile]: https://learn.microsoft.com/azure-stack/user/azure-stack-version-profiles -[resourcemanagerhybrid_lib]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanagerhybrid diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/pom.xml b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/pom.xml deleted file mode 100644 index 2c39b3a2c0fd..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/pom.xml +++ /dev/null @@ -1,169 +0,0 @@ - - - 4.0.0 - - com.azure - azure-client-sdk-parent - 1.7.0 - ../../parents/azure-client-sdk-parent - - - com.azure.resourcemanager - azure-resourcemanager-monitor - 1.0.0-hybrid - jar - - Microsoft Azure SDK for Monitor Management (Hybrid) - This package contains Microsoft Azure Monitor Hybrid SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt - https://github.com/Azure/azure-sdk-for-java - - - - The MIT License (MIT) - http://opensource.org/licenses/MIT - repo - - - - - https://github.com/Azure/azure-sdk-for-java - scm:git:git@github.com:Azure/azure-sdk-for-java.git - HEAD - - - - - 0.10 - 0.10 - - - --add-exports com.azure.resourcemanager.resources/com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation=ALL-UNNAMED - --add-exports com.azure.resourcemanager.resources/com.azure.resourcemanager.resources.fluentcore.arm.implementation=ALL-UNNAMED - --add-exports com.azure.resourcemanager.resources/com.azure.resourcemanager.resources.fluentcore.arm.models.implementation=ALL-UNNAMED - --add-exports com.azure.resourcemanager.resources/com.azure.resourcemanager.resources.fluentcore.model.implementation=ALL-UNNAMED - - --add-opens com.azure.resourcemanager.monitor/com.azure.resourcemanager.monitor=ALL-UNNAMED - --add-opens com.azure.resourcemanager.resources/com.azure.resourcemanager.resources=ALL-UNNAMED - --add-opens com.azure.resourcemanager.resources/com.azure.resourcemanager.resources.fluentcore.arm=ALL-UNNAMED - --add-opens com.azure.core/com.azure.core.implementation.jackson=ALL-UNNAMED - - - - - - microsoft - Microsoft - - - - - - com.azure.resourcemanager - azure-resourcemanager-resources - 1.0.0-hybrid - - - org.junit.jupiter - junit-jupiter-engine - 5.13.4 - test - - - org.junit.jupiter - junit-jupiter-api - 5.13.4 - test - - - com.azure - azure-core-http-netty - 1.16.2 - test - - - com.azure.resourcemanager - azure-resourcemanager-compute - 1.0.0-hybrid - test - - - com.azure.resourcemanager - azure-resourcemanager-appservice - 1.0.0-hybrid - test - - - com.azure.resourcemanager - azure-resourcemanager-storage - 1.0.0-hybrid - test - - - com.azure.resourcemanager - azure-resourcemanager-eventhubs - 1.0.0-hybrid - test - - - commons-io - commons-io - 2.17.0 - test - - - org.slf4j - slf4j-simple - 1.7.36 - test - - - - - azure-mgmt-sdk-test-jar - - - !maven.test.skip - - - - - com.azure.resourcemanager - azure-resourcemanager-test - 1.0.0-hybrid - test - - - - - - - - org.apache.maven.plugins - maven-jar-plugin - 3.4.2 - - - - true - true - - - - - - - org.jacoco - jacoco-maven-plugin - 0.8.13 - - - com/azure/resourcemanager/**/fluent/**/* - com/azure/resourcemanager/**/models/**/* - com/azure/resourcemanager/**/implementation/*ClientImpl* - com/azure/resourcemanager/**/implementation/*ClientBuilder* - - - - - - diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/MonitorManager.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/MonitorManager.java deleted file mode 100644 index a9cabf8fe03f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/MonitorManager.java +++ /dev/null @@ -1,149 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.monitor; - -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpPipeline; -import com.azure.resourcemanager.monitor.fluent.MonitorClient; -import com.azure.resourcemanager.monitor.implementation.MonitorClientBuilder; -import com.azure.resourcemanager.monitor.implementation.ActionGroupsImpl; -import com.azure.resourcemanager.monitor.implementation.ActivityLogsImpl; -import com.azure.resourcemanager.monitor.implementation.AlertRulesImpl; -import com.azure.resourcemanager.monitor.implementation.AutoscaleSettingsImpl; -import com.azure.resourcemanager.monitor.implementation.DiagnosticSettingsImpl; -import com.azure.resourcemanager.monitor.implementation.MetricDefinitionsImpl; -import com.azure.resourcemanager.monitor.models.ActionGroups; -import com.azure.resourcemanager.monitor.models.ActivityLogs; -import com.azure.resourcemanager.monitor.models.AlertRules; -import com.azure.resourcemanager.monitor.models.AutoscaleSettings; -import com.azure.resourcemanager.monitor.models.DiagnosticSettings; -import com.azure.resourcemanager.monitor.models.MetricDefinitions; -import com.azure.resourcemanager.resources.fluentcore.arm.AzureConfigurable; -import com.azure.resourcemanager.resources.fluentcore.arm.implementation.AzureConfigurableImpl; -import com.azure.resourcemanager.resources.fluentcore.arm.Manager; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.resources.fluentcore.utils.HttpPipelineProvider; - -import java.util.Objects; - -/** Entry point to Azure Monitor. */ -public final class MonitorManager extends Manager { - // Collections - private ActivityLogs activityLogs; - private MetricDefinitions metricDefinitions; - private DiagnosticSettings diagnosticSettings; - private ActionGroups actionGroups; - private AlertRules alerts; - private AutoscaleSettings autoscaleSettings; - - /** - * Get a Configurable instance that can be used to create MonitorManager with optional configuration. - * - * @return the instance allowing configurations - */ - public static Configurable configure() { - return new MonitorManager.ConfigurableImpl(); - } - /** - * Creates an instance of MonitorManager that exposes Monitor API entry points. - * - * @param credential the credential to use - * @param profile the profile to use - * @return the MonitorManager - */ - public static MonitorManager authenticate( - TokenCredential credential, AzureProfile profile) { - return authenticate(HttpPipelineProvider.buildHttpPipeline(credential, profile), profile); - } - /** - * Creates an instance of MonitorManager that exposes Monitor API entry points. - * - * @param httpPipeline the HttpPipeline to be used for API calls. - * @param profile the profile to use - * @return the MonitorManager - */ - public static MonitorManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { - Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); - Objects.requireNonNull(profile, "'profile' cannot be null."); - return new MonitorManager(httpPipeline, profile); - } - - /** The interface allowing configurations to be set. */ - public interface Configurable extends AzureConfigurable { - /** - * Creates an instance of MonitorManager that exposes Monitor API entry points. - * - * @param credential the credential to use - * @param profile the profile to use - * @return the interface exposing monitor API entry points that work across subscriptions - */ - MonitorManager authenticate(TokenCredential credential, AzureProfile profile); - } - - /** @return the Azure Activity Logs API entry point */ - public ActivityLogs activityLogs() { - if (this.activityLogs == null) { - this.activityLogs = new ActivityLogsImpl(this); - } - return this.activityLogs; - } - - /** @return the Azure Metric Definitions API entry point */ - public MetricDefinitions metricDefinitions() { - if (this.metricDefinitions == null) { - this.metricDefinitions = new MetricDefinitionsImpl(this); - } - return this.metricDefinitions; - } - - /** @return the Azure Diagnostic Settings API entry point */ - public DiagnosticSettings diagnosticSettings() { - if (this.diagnosticSettings == null) { - this.diagnosticSettings = new DiagnosticSettingsImpl(this); - } - return this.diagnosticSettings; - } - - /** @return the Azure Action Groups API entry point */ - public ActionGroups actionGroups() { - if (this.actionGroups == null) { - this.actionGroups = new ActionGroupsImpl(this); - } - return this.actionGroups; - } - - /** @return the Azure AlertRules API entry point */ - public AlertRules alertRules() { - if (this.alerts == null) { - this.alerts = new AlertRulesImpl(this); - } - return this.alerts; - } - - /** @return the Azure AutoscaleSettings API entry point */ - public AutoscaleSettings autoscaleSettings() { - if (this.autoscaleSettings == null) { - this.autoscaleSettings = new AutoscaleSettingsImpl(this); - } - return this.autoscaleSettings; - } - - /** The implementation for Configurable interface. */ - private static final class ConfigurableImpl extends AzureConfigurableImpl implements Configurable { - public MonitorManager authenticate(TokenCredential credential, AzureProfile profile) { - return MonitorManager.authenticate(buildHttpPipeline(credential, profile), profile); - } - } - - private MonitorManager(HttpPipeline httpPipeline, AzureProfile profile) { - super( - httpPipeline, - profile, - new MonitorClientBuilder() - .pipeline(httpPipeline) - .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) - .subscriptionId(profile.getSubscriptionId()) - .buildClient()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/ActionGroupsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/ActionGroupsClient.java deleted file mode 100644 index d03712cb3838..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/ActionGroupsClient.java +++ /dev/null @@ -1,384 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.monitor.fluent.models.ActionGroupResourceInner; -import com.azure.resourcemanager.monitor.models.ActionGroupPatchBody; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ActionGroupsClient. */ -public interface ActionGroupsClient - extends InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete { - /** - * Create a new action group or update an existing one. - * - * @param resourceGroupName The name of the resource group. - * @param actionGroupName The name of the action group. - * @param actionGroup The action group to create or use for the update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an action group resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String actionGroupName, ActionGroupResourceInner actionGroup); - - /** - * Create a new action group or update an existing one. - * - * @param resourceGroupName The name of the resource group. - * @param actionGroupName The name of the action group. - * @param actionGroup The action group to create or use for the update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an action group resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, String actionGroupName, ActionGroupResourceInner actionGroup); - - /** - * Create a new action group or update an existing one. - * - * @param resourceGroupName The name of the resource group. - * @param actionGroupName The name of the action group. - * @param actionGroup The action group to create or use for the update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an action group resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ActionGroupResourceInner createOrUpdate( - String resourceGroupName, String actionGroupName, ActionGroupResourceInner actionGroup); - - /** - * Create a new action group or update an existing one. - * - * @param resourceGroupName The name of the resource group. - * @param actionGroupName The name of the action group. - * @param actionGroup The action group to create or use for the update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an action group resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, String actionGroupName, ActionGroupResourceInner actionGroup, Context context); - - /** - * Get an action group. - * - * @param resourceGroupName The name of the resource group. - * @param actionGroupName The name of the action group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an action group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String actionGroupName); - - /** - * Get an action group. - * - * @param resourceGroupName The name of the resource group. - * @param actionGroupName The name of the action group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an action group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync(String resourceGroupName, String actionGroupName); - - /** - * Get an action group. - * - * @param resourceGroupName The name of the resource group. - * @param actionGroupName The name of the action group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an action group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ActionGroupResourceInner getByResourceGroup(String resourceGroupName, String actionGroupName); - - /** - * Get an action group. - * - * @param resourceGroupName The name of the resource group. - * @param actionGroupName The name of the action group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an action group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String actionGroupName, Context context); - - /** - * Delete an action group. - * - * @param resourceGroupName The name of the resource group. - * @param actionGroupName The name of the action group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteWithResponseAsync(String resourceGroupName, String actionGroupName); - - /** - * Delete an action group. - * - * @param resourceGroupName The name of the resource group. - * @param actionGroupName The name of the action group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String actionGroupName); - - /** - * Delete an action group. - * - * @param resourceGroupName The name of the resource group. - * @param actionGroupName The name of the action group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String actionGroupName); - - /** - * Delete an action group. - * - * @param resourceGroupName The name of the resource group. - * @param actionGroupName The name of the action group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String actionGroupName, Context context); - - /** - * Updates an existing action group's tags. To update other fields use the CreateOrUpdate method. - * - * @param resourceGroupName The name of the resource group. - * @param actionGroupName The name of the action group. - * @param actionGroupPatch Parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an action group resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateWithResponseAsync( - String resourceGroupName, String actionGroupName, ActionGroupPatchBody actionGroupPatch); - - /** - * Updates an existing action group's tags. To update other fields use the CreateOrUpdate method. - * - * @param resourceGroupName The name of the resource group. - * @param actionGroupName The name of the action group. - * @param actionGroupPatch Parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an action group resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAsync( - String resourceGroupName, String actionGroupName, ActionGroupPatchBody actionGroupPatch); - - /** - * Updates an existing action group's tags. To update other fields use the CreateOrUpdate method. - * - * @param resourceGroupName The name of the resource group. - * @param actionGroupName The name of the action group. - * @param actionGroupPatch Parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an action group resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ActionGroupResourceInner update( - String resourceGroupName, String actionGroupName, ActionGroupPatchBody actionGroupPatch); - - /** - * Updates an existing action group's tags. To update other fields use the CreateOrUpdate method. - * - * @param resourceGroupName The name of the resource group. - * @param actionGroupName The name of the action group. - * @param actionGroupPatch Parameters supplied to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an action group resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String resourceGroupName, String actionGroupName, ActionGroupPatchBody actionGroupPatch, Context context); - - /** - * Get a list of all action groups in a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all action groups in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Get a list of all action groups in a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all action groups in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Get a list of all action groups in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all action groups in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Get a list of all action groups in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all action groups in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName); - - /** - * Get a list of all action groups in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all action groups in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Get a list of all action groups in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all action groups in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * Enable a receiver in an action group. This changes the receiver's status from Disabled to Enabled. This operation - * is only supported for Email or SMS receivers. - * - * @param resourceGroupName The name of the resource group. - * @param actionGroupName The name of the action group. - * @param receiverName The name of the receiver to resubscribe. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> enableReceiverWithResponseAsync( - String resourceGroupName, String actionGroupName, String receiverName); - - /** - * Enable a receiver in an action group. This changes the receiver's status from Disabled to Enabled. This operation - * is only supported for Email or SMS receivers. - * - * @param resourceGroupName The name of the resource group. - * @param actionGroupName The name of the action group. - * @param receiverName The name of the receiver to resubscribe. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono enableReceiverAsync(String resourceGroupName, String actionGroupName, String receiverName); - - /** - * Enable a receiver in an action group. This changes the receiver's status from Disabled to Enabled. This operation - * is only supported for Email or SMS receivers. - * - * @param resourceGroupName The name of the resource group. - * @param actionGroupName The name of the action group. - * @param receiverName The name of the receiver to resubscribe. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void enableReceiver(String resourceGroupName, String actionGroupName, String receiverName); - - /** - * Enable a receiver in an action group. This changes the receiver's status from Disabled to Enabled. This operation - * is only supported for Email or SMS receivers. - * - * @param resourceGroupName The name of the resource group. - * @param actionGroupName The name of the action group. - * @param receiverName The name of the receiver to resubscribe. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response enableReceiverWithResponse( - String resourceGroupName, String actionGroupName, String receiverName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/ActivityLogAlertsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/ActivityLogAlertsClient.java deleted file mode 100644 index 95b791192613..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/ActivityLogAlertsClient.java +++ /dev/null @@ -1,328 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.monitor.fluent.models.ActivityLogAlertResourceInner; -import com.azure.resourcemanager.monitor.models.ActivityLogAlertPatchBody; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ActivityLogAlertsClient. */ -public interface ActivityLogAlertsClient - extends InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete { - /** - * Create a new activity log alert or update an existing one. - * - * @param resourceGroupName The name of the resource group. - * @param activityLogAlertName The name of the activity log alert. - * @param activityLogAlert The activity log alert to create or use for the update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an activity log alert resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String activityLogAlertName, ActivityLogAlertResourceInner activityLogAlert); - - /** - * Create a new activity log alert or update an existing one. - * - * @param resourceGroupName The name of the resource group. - * @param activityLogAlertName The name of the activity log alert. - * @param activityLogAlert The activity log alert to create or use for the update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an activity log alert resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, String activityLogAlertName, ActivityLogAlertResourceInner activityLogAlert); - - /** - * Create a new activity log alert or update an existing one. - * - * @param resourceGroupName The name of the resource group. - * @param activityLogAlertName The name of the activity log alert. - * @param activityLogAlert The activity log alert to create or use for the update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an activity log alert resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ActivityLogAlertResourceInner createOrUpdate( - String resourceGroupName, String activityLogAlertName, ActivityLogAlertResourceInner activityLogAlert); - - /** - * Create a new activity log alert or update an existing one. - * - * @param resourceGroupName The name of the resource group. - * @param activityLogAlertName The name of the activity log alert. - * @param activityLogAlert The activity log alert to create or use for the update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an activity log alert resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, - String activityLogAlertName, - ActivityLogAlertResourceInner activityLogAlert, - Context context); - - /** - * Get an activity log alert. - * - * @param resourceGroupName The name of the resource group. - * @param activityLogAlertName The name of the activity log alert. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an activity log alert. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String activityLogAlertName); - - /** - * Get an activity log alert. - * - * @param resourceGroupName The name of the resource group. - * @param activityLogAlertName The name of the activity log alert. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an activity log alert. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync(String resourceGroupName, String activityLogAlertName); - - /** - * Get an activity log alert. - * - * @param resourceGroupName The name of the resource group. - * @param activityLogAlertName The name of the activity log alert. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an activity log alert. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ActivityLogAlertResourceInner getByResourceGroup(String resourceGroupName, String activityLogAlertName); - - /** - * Get an activity log alert. - * - * @param resourceGroupName The name of the resource group. - * @param activityLogAlertName The name of the activity log alert. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an activity log alert. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String activityLogAlertName, Context context); - - /** - * Delete an activity log alert. - * - * @param resourceGroupName The name of the resource group. - * @param activityLogAlertName The name of the activity log alert. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteWithResponseAsync(String resourceGroupName, String activityLogAlertName); - - /** - * Delete an activity log alert. - * - * @param resourceGroupName The name of the resource group. - * @param activityLogAlertName The name of the activity log alert. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String activityLogAlertName); - - /** - * Delete an activity log alert. - * - * @param resourceGroupName The name of the resource group. - * @param activityLogAlertName The name of the activity log alert. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String activityLogAlertName); - - /** - * Delete an activity log alert. - * - * @param resourceGroupName The name of the resource group. - * @param activityLogAlertName The name of the activity log alert. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String activityLogAlertName, Context context); - - /** - * Updates an existing ActivityLogAlertResource's tags. To update other fields use the CreateOrUpdate method. - * - * @param resourceGroupName The name of the resource group. - * @param activityLogAlertName The name of the activity log alert. - * @param activityLogAlertPatch Parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an activity log alert resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateWithResponseAsync( - String resourceGroupName, String activityLogAlertName, ActivityLogAlertPatchBody activityLogAlertPatch); - - /** - * Updates an existing ActivityLogAlertResource's tags. To update other fields use the CreateOrUpdate method. - * - * @param resourceGroupName The name of the resource group. - * @param activityLogAlertName The name of the activity log alert. - * @param activityLogAlertPatch Parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an activity log alert resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAsync( - String resourceGroupName, String activityLogAlertName, ActivityLogAlertPatchBody activityLogAlertPatch); - - /** - * Updates an existing ActivityLogAlertResource's tags. To update other fields use the CreateOrUpdate method. - * - * @param resourceGroupName The name of the resource group. - * @param activityLogAlertName The name of the activity log alert. - * @param activityLogAlertPatch Parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an activity log alert resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ActivityLogAlertResourceInner update( - String resourceGroupName, String activityLogAlertName, ActivityLogAlertPatchBody activityLogAlertPatch); - - /** - * Updates an existing ActivityLogAlertResource's tags. To update other fields use the CreateOrUpdate method. - * - * @param resourceGroupName The name of the resource group. - * @param activityLogAlertName The name of the activity log alert. - * @param activityLogAlertPatch Parameters supplied to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an activity log alert resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String resourceGroupName, - String activityLogAlertName, - ActivityLogAlertPatchBody activityLogAlertPatch, - Context context); - - /** - * Get a list of all activity log alerts in a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all activity log alerts in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Get a list of all activity log alerts in a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all activity log alerts in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Get a list of all activity log alerts in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all activity log alerts in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Get a list of all activity log alerts in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all activity log alerts in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName); - - /** - * Get a list of all activity log alerts in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all activity log alerts in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Get a list of all activity log alerts in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all activity log alerts in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/ActivityLogsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/ActivityLogsClient.java deleted file mode 100644 index ce9655360166..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/ActivityLogsClient.java +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.monitor.fluent.models.EventDataInner; - -/** An instance of this class provides access to all the operations defined in ActivityLogsClient. */ -public interface ActivityLogsClient { - /** - * Provides the list of records from the activity logs. - * - * @param filter Reduces the set of data collected.<br>This argument is required and it also requires at least - * the start date/time.<br>The **$filter** argument is very restricted and allows only the following - * patterns.<br>- *List events for a resource group*: $filter=eventTimestamp ge - * '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and resourceGroupName eq - * 'resourceGroupName'.<br>- *List events for resource*: $filter=eventTimestamp ge - * '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and resourceUri eq - * 'resourceURI'.<br>- *List events for a subscription in a time range*: $filter=eventTimestamp ge - * '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z'.<br>- *List events - * for a resource provider*: $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le - * '2014-07-20T04:36:37.6407898Z' and resourceProvider eq 'resourceProviderName'.<br>- *List events for a - * correlation Id*: $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le - * '2014-07-20T04:36:37.6407898Z' and correlationId eq 'correlationID'.<br><br>**NOTE**: No other - * syntax is allowed. - * @param select Used to fetch events with only the given properties.<br>The **$select** argument is a comma - * separated list of property names to be returned. Possible values are: *authorization*, *claims*, - * *correlationId*, *description*, *eventDataId*, *eventName*, *eventTimestamp*, *httpRequest*, *level*, - * *operationId*, *operationName*, *properties*, *resourceGroupName*, *resourceProviderName*, *resourceId*, - * *status*, *submissionTimestamp*, *subStatus*, *subscriptionId*. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents collection of events. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String filter, String select); - - /** - * Provides the list of records from the activity logs. - * - * @param filter Reduces the set of data collected.<br>This argument is required and it also requires at least - * the start date/time.<br>The **$filter** argument is very restricted and allows only the following - * patterns.<br>- *List events for a resource group*: $filter=eventTimestamp ge - * '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and resourceGroupName eq - * 'resourceGroupName'.<br>- *List events for resource*: $filter=eventTimestamp ge - * '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and resourceUri eq - * 'resourceURI'.<br>- *List events for a subscription in a time range*: $filter=eventTimestamp ge - * '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z'.<br>- *List events - * for a resource provider*: $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le - * '2014-07-20T04:36:37.6407898Z' and resourceProvider eq 'resourceProviderName'.<br>- *List events for a - * correlation Id*: $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le - * '2014-07-20T04:36:37.6407898Z' and correlationId eq 'correlationID'.<br><br>**NOTE**: No other - * syntax is allowed. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents collection of events. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String filter); - - /** - * Provides the list of records from the activity logs. - * - * @param filter Reduces the set of data collected.<br>This argument is required and it also requires at least - * the start date/time.<br>The **$filter** argument is very restricted and allows only the following - * patterns.<br>- *List events for a resource group*: $filter=eventTimestamp ge - * '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and resourceGroupName eq - * 'resourceGroupName'.<br>- *List events for resource*: $filter=eventTimestamp ge - * '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and resourceUri eq - * 'resourceURI'.<br>- *List events for a subscription in a time range*: $filter=eventTimestamp ge - * '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z'.<br>- *List events - * for a resource provider*: $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le - * '2014-07-20T04:36:37.6407898Z' and resourceProvider eq 'resourceProviderName'.<br>- *List events for a - * correlation Id*: $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le - * '2014-07-20T04:36:37.6407898Z' and correlationId eq 'correlationID'.<br><br>**NOTE**: No other - * syntax is allowed. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents collection of events. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String filter); - - /** - * Provides the list of records from the activity logs. - * - * @param filter Reduces the set of data collected.<br>This argument is required and it also requires at least - * the start date/time.<br>The **$filter** argument is very restricted and allows only the following - * patterns.<br>- *List events for a resource group*: $filter=eventTimestamp ge - * '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and resourceGroupName eq - * 'resourceGroupName'.<br>- *List events for resource*: $filter=eventTimestamp ge - * '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and resourceUri eq - * 'resourceURI'.<br>- *List events for a subscription in a time range*: $filter=eventTimestamp ge - * '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z'.<br>- *List events - * for a resource provider*: $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le - * '2014-07-20T04:36:37.6407898Z' and resourceProvider eq 'resourceProviderName'.<br>- *List events for a - * correlation Id*: $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le - * '2014-07-20T04:36:37.6407898Z' and correlationId eq 'correlationID'.<br><br>**NOTE**: No other - * syntax is allowed. - * @param select Used to fetch events with only the given properties.<br>The **$select** argument is a comma - * separated list of property names to be returned. Possible values are: *authorization*, *claims*, - * *correlationId*, *description*, *eventDataId*, *eventName*, *eventTimestamp*, *httpRequest*, *level*, - * *operationId*, *operationName*, *properties*, *resourceGroupName*, *resourceProviderName*, *resourceId*, - * *status*, *submissionTimestamp*, *subStatus*, *subscriptionId*. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents collection of events. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String filter, String select, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/AlertRuleIncidentsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/AlertRuleIncidentsClient.java deleted file mode 100644 index 65b4f2dad6b5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/AlertRuleIncidentsClient.java +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.monitor.fluent.models.IncidentInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in AlertRuleIncidentsClient. */ -public interface AlertRuleIncidentsClient { - /** - * Gets an incident associated to an alert rule. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param incidentName The name of the incident to retrieve. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an incident associated to an alert rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync(String resourceGroupName, String ruleName, String incidentName); - - /** - * Gets an incident associated to an alert rule. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param incidentName The name of the incident to retrieve. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an incident associated to an alert rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync(String resourceGroupName, String ruleName, String incidentName); - - /** - * Gets an incident associated to an alert rule. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param incidentName The name of the incident to retrieve. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an incident associated to an alert rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - IncidentInner get(String resourceGroupName, String ruleName, String incidentName); - - /** - * Gets an incident associated to an alert rule. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param incidentName The name of the incident to retrieve. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an incident associated to an alert rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String ruleName, String incidentName, Context context); - - /** - * Gets a list of incidents associated to an alert rule. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of incidents associated to an alert rule. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByAlertRuleAsync(String resourceGroupName, String ruleName); - - /** - * Gets a list of incidents associated to an alert rule. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of incidents associated to an alert rule. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByAlertRule(String resourceGroupName, String ruleName); - - /** - * Gets a list of incidents associated to an alert rule. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of incidents associated to an alert rule. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByAlertRule(String resourceGroupName, String ruleName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/AlertRulesClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/AlertRulesClient.java deleted file mode 100644 index fc1bcf282920..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/AlertRulesClient.java +++ /dev/null @@ -1,320 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.monitor.fluent.models.AlertRuleResourceInner; -import com.azure.resourcemanager.monitor.models.AlertRuleResourcePatch; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in AlertRulesClient. */ -public interface AlertRulesClient - extends InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete { - /** - * Creates or updates a classic metric alert rule. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param parameters The parameters of the rule to create or update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the alert rule resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String ruleName, AlertRuleResourceInner parameters); - - /** - * Creates or updates a classic metric alert rule. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param parameters The parameters of the rule to create or update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the alert rule resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, String ruleName, AlertRuleResourceInner parameters); - - /** - * Creates or updates a classic metric alert rule. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param parameters The parameters of the rule to create or update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the alert rule resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AlertRuleResourceInner createOrUpdate(String resourceGroupName, String ruleName, AlertRuleResourceInner parameters); - - /** - * Creates or updates a classic metric alert rule. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param parameters The parameters of the rule to create or update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the alert rule resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, String ruleName, AlertRuleResourceInner parameters, Context context); - - /** - * Deletes a classic metric alert rule. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteWithResponseAsync(String resourceGroupName, String ruleName); - - /** - * Deletes a classic metric alert rule. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String ruleName); - - /** - * Deletes a classic metric alert rule. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String ruleName); - - /** - * Deletes a classic metric alert rule. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String ruleName, Context context); - - /** - * Gets a classic metric alert rule. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a classic metric alert rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String ruleName); - - /** - * Gets a classic metric alert rule. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a classic metric alert rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync(String resourceGroupName, String ruleName); - - /** - * Gets a classic metric alert rule. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a classic metric alert rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AlertRuleResourceInner getByResourceGroup(String resourceGroupName, String ruleName); - - /** - * Gets a classic metric alert rule. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a classic metric alert rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String ruleName, Context context); - - /** - * Updates an existing classic metric AlertRuleResource. To update other fields use the CreateOrUpdate method. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param alertRulesResource Parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the alert rule resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateWithResponseAsync( - String resourceGroupName, String ruleName, AlertRuleResourcePatch alertRulesResource); - - /** - * Updates an existing classic metric AlertRuleResource. To update other fields use the CreateOrUpdate method. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param alertRulesResource Parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the alert rule resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAsync( - String resourceGroupName, String ruleName, AlertRuleResourcePatch alertRulesResource); - - /** - * Updates an existing classic metric AlertRuleResource. To update other fields use the CreateOrUpdate method. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param alertRulesResource Parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the alert rule resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AlertRuleResourceInner update(String resourceGroupName, String ruleName, AlertRuleResourcePatch alertRulesResource); - - /** - * Updates an existing classic metric AlertRuleResource. To update other fields use the CreateOrUpdate method. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param alertRulesResource Parameters supplied to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the alert rule resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String resourceGroupName, String ruleName, AlertRuleResourcePatch alertRulesResource, Context context); - - /** - * List the classic metric alert rules within a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of alert rule resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName); - - /** - * List the classic metric alert rules within a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of alert rule resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * List the classic metric alert rules within a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of alert rule resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * List the classic metric alert rules within a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of alert rule resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * List the classic metric alert rules within a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of alert rule resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * List the classic metric alert rules within a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of alert rule resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/AutoscaleSettingsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/AutoscaleSettingsClient.java deleted file mode 100644 index 5b12805a43ed..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/AutoscaleSettingsClient.java +++ /dev/null @@ -1,328 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.monitor.fluent.models.AutoscaleSettingResourceInner; -import com.azure.resourcemanager.monitor.models.AutoscaleSettingResourcePatch; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in AutoscaleSettingsClient. */ -public interface AutoscaleSettingsClient - extends InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete { - /** - * Lists the autoscale settings for a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of autoscale setting resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName); - - /** - * Lists the autoscale settings for a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of autoscale setting resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Lists the autoscale settings for a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of autoscale setting resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * Creates or updates an autoscale setting. - * - * @param resourceGroupName The name of the resource group. - * @param autoscaleSettingName The autoscale setting name. - * @param parameters Parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the autoscale setting resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String autoscaleSettingName, AutoscaleSettingResourceInner parameters); - - /** - * Creates or updates an autoscale setting. - * - * @param resourceGroupName The name of the resource group. - * @param autoscaleSettingName The autoscale setting name. - * @param parameters Parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the autoscale setting resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, String autoscaleSettingName, AutoscaleSettingResourceInner parameters); - - /** - * Creates or updates an autoscale setting. - * - * @param resourceGroupName The name of the resource group. - * @param autoscaleSettingName The autoscale setting name. - * @param parameters Parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the autoscale setting resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AutoscaleSettingResourceInner createOrUpdate( - String resourceGroupName, String autoscaleSettingName, AutoscaleSettingResourceInner parameters); - - /** - * Creates or updates an autoscale setting. - * - * @param resourceGroupName The name of the resource group. - * @param autoscaleSettingName The autoscale setting name. - * @param parameters Parameters supplied to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the autoscale setting resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, - String autoscaleSettingName, - AutoscaleSettingResourceInner parameters, - Context context); - - /** - * Deletes and autoscale setting. - * - * @param resourceGroupName The name of the resource group. - * @param autoscaleSettingName The autoscale setting name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteWithResponseAsync(String resourceGroupName, String autoscaleSettingName); - - /** - * Deletes and autoscale setting. - * - * @param resourceGroupName The name of the resource group. - * @param autoscaleSettingName The autoscale setting name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String autoscaleSettingName); - - /** - * Deletes and autoscale setting. - * - * @param resourceGroupName The name of the resource group. - * @param autoscaleSettingName The autoscale setting name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String autoscaleSettingName); - - /** - * Deletes and autoscale setting. - * - * @param resourceGroupName The name of the resource group. - * @param autoscaleSettingName The autoscale setting name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String autoscaleSettingName, Context context); - - /** - * Gets an autoscale setting. - * - * @param resourceGroupName The name of the resource group. - * @param autoscaleSettingName The autoscale setting name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an autoscale setting. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String autoscaleSettingName); - - /** - * Gets an autoscale setting. - * - * @param resourceGroupName The name of the resource group. - * @param autoscaleSettingName The autoscale setting name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an autoscale setting. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync(String resourceGroupName, String autoscaleSettingName); - - /** - * Gets an autoscale setting. - * - * @param resourceGroupName The name of the resource group. - * @param autoscaleSettingName The autoscale setting name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an autoscale setting. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AutoscaleSettingResourceInner getByResourceGroup(String resourceGroupName, String autoscaleSettingName); - - /** - * Gets an autoscale setting. - * - * @param resourceGroupName The name of the resource group. - * @param autoscaleSettingName The autoscale setting name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an autoscale setting. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String autoscaleSettingName, Context context); - - /** - * Updates an existing AutoscaleSettingsResource. To update other fields use the CreateOrUpdate method. - * - * @param resourceGroupName The name of the resource group. - * @param autoscaleSettingName The autoscale setting name. - * @param autoscaleSettingResource Parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the autoscale setting resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateWithResponseAsync( - String resourceGroupName, String autoscaleSettingName, AutoscaleSettingResourcePatch autoscaleSettingResource); - - /** - * Updates an existing AutoscaleSettingsResource. To update other fields use the CreateOrUpdate method. - * - * @param resourceGroupName The name of the resource group. - * @param autoscaleSettingName The autoscale setting name. - * @param autoscaleSettingResource Parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the autoscale setting resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAsync( - String resourceGroupName, String autoscaleSettingName, AutoscaleSettingResourcePatch autoscaleSettingResource); - - /** - * Updates an existing AutoscaleSettingsResource. To update other fields use the CreateOrUpdate method. - * - * @param resourceGroupName The name of the resource group. - * @param autoscaleSettingName The autoscale setting name. - * @param autoscaleSettingResource Parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the autoscale setting resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AutoscaleSettingResourceInner update( - String resourceGroupName, String autoscaleSettingName, AutoscaleSettingResourcePatch autoscaleSettingResource); - - /** - * Updates an existing AutoscaleSettingsResource. To update other fields use the CreateOrUpdate method. - * - * @param resourceGroupName The name of the resource group. - * @param autoscaleSettingName The autoscale setting name. - * @param autoscaleSettingResource Parameters supplied to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the autoscale setting resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String resourceGroupName, - String autoscaleSettingName, - AutoscaleSettingResourcePatch autoscaleSettingResource, - Context context); - - /** - * Lists the autoscale settings for a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of autoscale setting resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Lists the autoscale settings for a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of autoscale setting resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Lists the autoscale settings for a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of autoscale setting resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/BaselinesClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/BaselinesClient.java deleted file mode 100644 index 891060656f48..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/BaselinesClient.java +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.monitor.fluent.models.SingleMetricBaselineInner; -import com.azure.resourcemanager.monitor.models.ResultType; -import java.time.Duration; - -/** An instance of this class provides access to all the operations defined in BaselinesClient. */ -public interface BaselinesClient { - /** - * **Lists the metric baseline values for a resource**. - * - * @param resourceUri The identifier of the resource. - * @param metricnames The names of the metrics (comma separated) to retrieve. Special case: If a metricname itself - * has a comma in it then use %2 to indicate it. Eg: 'Metric,Name1' should be **'Metric%2Name1'**. - * @param metricnamespace Metric namespace to query metric definitions for. - * @param timespan The timespan of the query. It is a string with the following format - * 'startDateTime_ISO/endDateTime_ISO'. - * @param interval The interval (i.e. timegrain) of the query. - * @param aggregation The list of aggregation types (comma separated) to retrieve. - * @param sensitivities The list of sensitivities (comma separated) to retrieve. - * @param filter The **$filter** is used to reduce the set of metric data returned. Example: Metric contains - * metadata A, B and C. - Return all time series of C where A = a1 and B = b1 or b2 **$filter=A eq 'a1' and B eq - * 'b1' or B eq 'b2' and C eq '*'** - Invalid variant: **$filter=A eq 'a1' and B eq 'b1' and C eq '*' or B = - * 'b2'** This is invalid because the logical or operator cannot separate two different metadata names. - Return - * all time series where A = a1, B = b1 and C = c1: **$filter=A eq 'a1' and B eq 'b1' and C eq 'c1'** - Return - * all time series where A = a1 **$filter=A eq 'a1' and B eq '*' and C eq '*'**. Special case: When dimension - * name or dimension value uses round brackets. Eg: When dimension name is **dim (test) 1** Instead of using - * $filter= "dim (test) 1 eq '*' " use **$filter= "dim %2528test%2529 1 eq '*' "** When dimension name is **dim - * (test) 3** and dimension value is **dim3 (test) val** Instead of using $filter= "dim (test) 3 eq 'dim3 (test) - * val' " use **$filter= "dim %2528test%2529 3 eq 'dim3 %2528test%2529 val' "**. - * @param resultType Allows retrieving only metadata of the baseline. On data request all information is retrieved. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of metric baselines. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync( - String resourceUri, - String metricnames, - String metricnamespace, - String timespan, - Duration interval, - String aggregation, - String sensitivities, - String filter, - ResultType resultType); - - /** - * **Lists the metric baseline values for a resource**. - * - * @param resourceUri The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of metric baselines. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String resourceUri); - - /** - * **Lists the metric baseline values for a resource**. - * - * @param resourceUri The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of metric baselines. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceUri); - - /** - * **Lists the metric baseline values for a resource**. - * - * @param resourceUri The identifier of the resource. - * @param metricnames The names of the metrics (comma separated) to retrieve. Special case: If a metricname itself - * has a comma in it then use %2 to indicate it. Eg: 'Metric,Name1' should be **'Metric%2Name1'**. - * @param metricnamespace Metric namespace to query metric definitions for. - * @param timespan The timespan of the query. It is a string with the following format - * 'startDateTime_ISO/endDateTime_ISO'. - * @param interval The interval (i.e. timegrain) of the query. - * @param aggregation The list of aggregation types (comma separated) to retrieve. - * @param sensitivities The list of sensitivities (comma separated) to retrieve. - * @param filter The **$filter** is used to reduce the set of metric data returned. Example: Metric contains - * metadata A, B and C. - Return all time series of C where A = a1 and B = b1 or b2 **$filter=A eq 'a1' and B eq - * 'b1' or B eq 'b2' and C eq '*'** - Invalid variant: **$filter=A eq 'a1' and B eq 'b1' and C eq '*' or B = - * 'b2'** This is invalid because the logical or operator cannot separate two different metadata names. - Return - * all time series where A = a1, B = b1 and C = c1: **$filter=A eq 'a1' and B eq 'b1' and C eq 'c1'** - Return - * all time series where A = a1 **$filter=A eq 'a1' and B eq '*' and C eq '*'**. Special case: When dimension - * name or dimension value uses round brackets. Eg: When dimension name is **dim (test) 1** Instead of using - * $filter= "dim (test) 1 eq '*' " use **$filter= "dim %2528test%2529 1 eq '*' "** When dimension name is **dim - * (test) 3** and dimension value is **dim3 (test) val** Instead of using $filter= "dim (test) 3 eq 'dim3 (test) - * val' " use **$filter= "dim %2528test%2529 3 eq 'dim3 %2528test%2529 val' "**. - * @param resultType Allows retrieving only metadata of the baseline. On data request all information is retrieved. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of metric baselines. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String resourceUri, - String metricnames, - String metricnamespace, - String timespan, - Duration interval, - String aggregation, - String sensitivities, - String filter, - ResultType resultType, - Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/DataCollectionEndpointsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/DataCollectionEndpointsClient.java deleted file mode 100644 index 787d0abe1049..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/DataCollectionEndpointsClient.java +++ /dev/null @@ -1,348 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.monitor.fluent.models.DataCollectionEndpointResourceInner; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.util.Map; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in DataCollectionEndpointsClient. */ -public interface DataCollectionEndpointsClient - extends InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete { - /** - * Lists all data collection endpoints in the specified resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a pageable list of resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName); - - /** - * Lists all data collection endpoints in the specified resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a pageable list of resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Lists all data collection endpoints in the specified resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a pageable list of resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * Lists all data collection endpoints in the specified subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a pageable list of resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Lists all data collection endpoints in the specified subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a pageable list of resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Lists all data collection endpoints in the specified subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a pageable list of resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Returns the specified data collection endpoint. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of ARM tracked top level resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String dataCollectionEndpointName); - - /** - * Returns the specified data collection endpoint. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of ARM tracked top level resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync( - String resourceGroupName, String dataCollectionEndpointName); - - /** - * Returns the specified data collection endpoint. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of ARM tracked top level resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DataCollectionEndpointResourceInner getByResourceGroup(String resourceGroupName, String dataCollectionEndpointName); - - /** - * Returns the specified data collection endpoint. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of ARM tracked top level resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String dataCollectionEndpointName, Context context); - - /** - * Creates or updates a data collection endpoint. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case insensitive. - * @param body The payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of ARM tracked top level resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createWithResponseAsync( - String resourceGroupName, String dataCollectionEndpointName, DataCollectionEndpointResourceInner body); - - /** - * Creates or updates a data collection endpoint. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case insensitive. - * @param body The payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of ARM tracked top level resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createAsync( - String resourceGroupName, String dataCollectionEndpointName, DataCollectionEndpointResourceInner body); - - /** - * Creates or updates a data collection endpoint. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of ARM tracked top level resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createAsync(String resourceGroupName, String dataCollectionEndpointName); - - /** - * Creates or updates a data collection endpoint. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of ARM tracked top level resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DataCollectionEndpointResourceInner create(String resourceGroupName, String dataCollectionEndpointName); - - /** - * Creates or updates a data collection endpoint. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case insensitive. - * @param body The payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of ARM tracked top level resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createWithResponse( - String resourceGroupName, - String dataCollectionEndpointName, - DataCollectionEndpointResourceInner body, - Context context); - - /** - * Updates part of a data collection endpoint. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case insensitive. - * @param tags Resource tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of ARM tracked top level resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateWithResponseAsync( - String resourceGroupName, String dataCollectionEndpointName, Map tags); - - /** - * Updates part of a data collection endpoint. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case insensitive. - * @param tags Resource tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of ARM tracked top level resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAsync( - String resourceGroupName, String dataCollectionEndpointName, Map tags); - - /** - * Updates part of a data collection endpoint. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of ARM tracked top level resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAsync(String resourceGroupName, String dataCollectionEndpointName); - - /** - * Updates part of a data collection endpoint. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of ARM tracked top level resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DataCollectionEndpointResourceInner update(String resourceGroupName, String dataCollectionEndpointName); - - /** - * Updates part of a data collection endpoint. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case insensitive. - * @param tags Resource tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of ARM tracked top level resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String resourceGroupName, String dataCollectionEndpointName, Map tags, Context context); - - /** - * Deletes a data collection endpoint. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteWithResponseAsync(String resourceGroupName, String dataCollectionEndpointName); - - /** - * Deletes a data collection endpoint. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String dataCollectionEndpointName); - - /** - * Deletes a data collection endpoint. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String dataCollectionEndpointName); - - /** - * Deletes a data collection endpoint. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String dataCollectionEndpointName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/DataCollectionRuleAssociationsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/DataCollectionRuleAssociationsClient.java deleted file mode 100644 index de8848563c01..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/DataCollectionRuleAssociationsClient.java +++ /dev/null @@ -1,281 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.monitor.fluent.models.DataCollectionRuleAssociationProxyOnlyResourceInner; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in DataCollectionRuleAssociationsClient. */ -public interface DataCollectionRuleAssociationsClient extends InnerSupportsDelete { - /** - * Lists associations for the specified resource. - * - * @param resourceUri The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a pageable list of resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceAsync(String resourceUri); - - /** - * Lists associations for the specified resource. - * - * @param resourceUri The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a pageable list of resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResource(String resourceUri); - - /** - * Lists associations for the specified resource. - * - * @param resourceUri The identifier of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a pageable list of resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResource( - String resourceUri, Context context); - - /** - * Lists associations for the specified data collection rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a pageable list of resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByRuleAsync( - String resourceGroupName, String dataCollectionRuleName); - - /** - * Lists associations for the specified data collection rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a pageable list of resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByRule( - String resourceGroupName, String dataCollectionRuleName); - - /** - * Lists associations for the specified data collection rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a pageable list of resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByRule( - String resourceGroupName, String dataCollectionRuleName, Context context); - - /** - * Returns the specified association. - * - * @param resourceUri The identifier of the resource. - * @param associationName The name of the association. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of generic ARM proxy resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync( - String resourceUri, String associationName); - - /** - * Returns the specified association. - * - * @param resourceUri The identifier of the resource. - * @param associationName The name of the association. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of generic ARM proxy resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync(String resourceUri, String associationName); - - /** - * Returns the specified association. - * - * @param resourceUri The identifier of the resource. - * @param associationName The name of the association. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of generic ARM proxy resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DataCollectionRuleAssociationProxyOnlyResourceInner get(String resourceUri, String associationName); - - /** - * Returns the specified association. - * - * @param resourceUri The identifier of the resource. - * @param associationName The name of the association. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of generic ARM proxy resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceUri, String associationName, Context context); - - /** - * Creates or updates an association. - * - * @param resourceUri The identifier of the resource. - * @param associationName The name of the association. The name is case insensitive. - * @param body The payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of generic ARM proxy resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createWithResponseAsync( - String resourceUri, String associationName, DataCollectionRuleAssociationProxyOnlyResourceInner body); - - /** - * Creates or updates an association. - * - * @param resourceUri The identifier of the resource. - * @param associationName The name of the association. The name is case insensitive. - * @param body The payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of generic ARM proxy resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createAsync( - String resourceUri, String associationName, DataCollectionRuleAssociationProxyOnlyResourceInner body); - - /** - * Creates or updates an association. - * - * @param resourceUri The identifier of the resource. - * @param associationName The name of the association. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of generic ARM proxy resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createAsync(String resourceUri, String associationName); - - /** - * Creates or updates an association. - * - * @param resourceUri The identifier of the resource. - * @param associationName The name of the association. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of generic ARM proxy resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DataCollectionRuleAssociationProxyOnlyResourceInner create(String resourceUri, String associationName); - - /** - * Creates or updates an association. - * - * @param resourceUri The identifier of the resource. - * @param associationName The name of the association. The name is case insensitive. - * @param body The payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of generic ARM proxy resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createWithResponse( - String resourceUri, - String associationName, - DataCollectionRuleAssociationProxyOnlyResourceInner body, - Context context); - - /** - * Deletes an association. - * - * @param resourceUri The identifier of the resource. - * @param associationName The name of the association. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteWithResponseAsync(String resourceUri, String associationName); - - /** - * Deletes an association. - * - * @param resourceUri The identifier of the resource. - * @param associationName The name of the association. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceUri, String associationName); - - /** - * Deletes an association. - * - * @param resourceUri The identifier of the resource. - * @param associationName The name of the association. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceUri, String associationName); - - /** - * Deletes an association. - * - * @param resourceUri The identifier of the resource. - * @param associationName The name of the association. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceUri, String associationName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/DataCollectionRulesClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/DataCollectionRulesClient.java deleted file mode 100644 index 35e7ab09e4bd..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/DataCollectionRulesClient.java +++ /dev/null @@ -1,345 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.monitor.fluent.models.DataCollectionRuleResourceInner; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.util.Map; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in DataCollectionRulesClient. */ -public interface DataCollectionRulesClient - extends InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete { - /** - * Lists all data collection rules in the specified resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a pageable list of resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName); - - /** - * Lists all data collection rules in the specified resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a pageable list of resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Lists all data collection rules in the specified resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a pageable list of resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * Lists all data collection rules in the specified subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a pageable list of resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Lists all data collection rules in the specified subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a pageable list of resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Lists all data collection rules in the specified subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a pageable list of resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Returns the specified data collection rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of ARM tracked top level resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String dataCollectionRuleName); - - /** - * Returns the specified data collection rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of ARM tracked top level resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync( - String resourceGroupName, String dataCollectionRuleName); - - /** - * Returns the specified data collection rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of ARM tracked top level resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DataCollectionRuleResourceInner getByResourceGroup(String resourceGroupName, String dataCollectionRuleName); - - /** - * Returns the specified data collection rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of ARM tracked top level resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String dataCollectionRuleName, Context context); - - /** - * Creates or updates a data collection rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. - * @param body The payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of ARM tracked top level resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createWithResponseAsync( - String resourceGroupName, String dataCollectionRuleName, DataCollectionRuleResourceInner body); - - /** - * Creates or updates a data collection rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. - * @param body The payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of ARM tracked top level resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createAsync( - String resourceGroupName, String dataCollectionRuleName, DataCollectionRuleResourceInner body); - - /** - * Creates or updates a data collection rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of ARM tracked top level resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createAsync(String resourceGroupName, String dataCollectionRuleName); - - /** - * Creates or updates a data collection rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of ARM tracked top level resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DataCollectionRuleResourceInner create(String resourceGroupName, String dataCollectionRuleName); - - /** - * Creates or updates a data collection rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. - * @param body The payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of ARM tracked top level resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createWithResponse( - String resourceGroupName, String dataCollectionRuleName, DataCollectionRuleResourceInner body, Context context); - - /** - * Updates part of a data collection rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. - * @param tags Resource tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of ARM tracked top level resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateWithResponseAsync( - String resourceGroupName, String dataCollectionRuleName, Map tags); - - /** - * Updates part of a data collection rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. - * @param tags Resource tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of ARM tracked top level resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAsync( - String resourceGroupName, String dataCollectionRuleName, Map tags); - - /** - * Updates part of a data collection rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of ARM tracked top level resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAsync(String resourceGroupName, String dataCollectionRuleName); - - /** - * Updates part of a data collection rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of ARM tracked top level resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DataCollectionRuleResourceInner update(String resourceGroupName, String dataCollectionRuleName); - - /** - * Updates part of a data collection rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. - * @param tags Resource tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of ARM tracked top level resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String resourceGroupName, String dataCollectionRuleName, Map tags, Context context); - - /** - * Deletes a data collection rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteWithResponseAsync(String resourceGroupName, String dataCollectionRuleName); - - /** - * Deletes a data collection rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String dataCollectionRuleName); - - /** - * Deletes a data collection rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String dataCollectionRuleName); - - /** - * Deletes a data collection rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String dataCollectionRuleName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/DiagnosticSettingsCategoriesClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/DiagnosticSettingsCategoriesClient.java deleted file mode 100644 index f6b4b6a01baf..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/DiagnosticSettingsCategoriesClient.java +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.monitor.fluent.models.DiagnosticSettingsCategoryResourceCollectionInner; -import com.azure.resourcemanager.monitor.fluent.models.DiagnosticSettingsCategoryResourceInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in DiagnosticSettingsCategoriesClient. */ -public interface DiagnosticSettingsCategoriesClient { - /** - * Gets the diagnostic settings category for the specified resource. - * - * @param resourceUri The identifier of the resource. - * @param name The name of the diagnostic setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the diagnostic settings category for the specified resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync(String resourceUri, String name); - - /** - * Gets the diagnostic settings category for the specified resource. - * - * @param resourceUri The identifier of the resource. - * @param name The name of the diagnostic setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the diagnostic settings category for the specified resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync(String resourceUri, String name); - - /** - * Gets the diagnostic settings category for the specified resource. - * - * @param resourceUri The identifier of the resource. - * @param name The name of the diagnostic setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the diagnostic settings category for the specified resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DiagnosticSettingsCategoryResourceInner get(String resourceUri, String name); - - /** - * Gets the diagnostic settings category for the specified resource. - * - * @param resourceUri The identifier of the resource. - * @param name The name of the diagnostic setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the diagnostic settings category for the specified resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceUri, String name, Context context); - - /** - * Lists the diagnostic settings categories for the specified resource. - * - * @param resourceUri The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of diagnostic setting category resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listWithResponseAsync(String resourceUri); - - /** - * Lists the diagnostic settings categories for the specified resource. - * - * @param resourceUri The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of diagnostic setting category resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listAsync(String resourceUri); - - /** - * Lists the diagnostic settings categories for the specified resource. - * - * @param resourceUri The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of diagnostic setting category resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DiagnosticSettingsCategoryResourceCollectionInner list(String resourceUri); - - /** - * Lists the diagnostic settings categories for the specified resource. - * - * @param resourceUri The identifier of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of diagnostic setting category resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listWithResponse(String resourceUri, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/DiagnosticSettingsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/DiagnosticSettingsClient.java deleted file mode 100644 index be23589c549f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/DiagnosticSettingsClient.java +++ /dev/null @@ -1,232 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.monitor.fluent.models.DiagnosticSettingsResourceCollectionInner; -import com.azure.resourcemanager.monitor.fluent.models.DiagnosticSettingsResourceInner; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in DiagnosticSettingsClient. */ -public interface DiagnosticSettingsClient extends InnerSupportsDelete { - /** - * Gets the active diagnostic settings for the specified resource. - * - * @param resourceUri The identifier of the resource. - * @param name The name of the diagnostic setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the active diagnostic settings for the specified resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync(String resourceUri, String name); - - /** - * Gets the active diagnostic settings for the specified resource. - * - * @param resourceUri The identifier of the resource. - * @param name The name of the diagnostic setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the active diagnostic settings for the specified resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync(String resourceUri, String name); - - /** - * Gets the active diagnostic settings for the specified resource. - * - * @param resourceUri The identifier of the resource. - * @param name The name of the diagnostic setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the active diagnostic settings for the specified resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DiagnosticSettingsResourceInner get(String resourceUri, String name); - - /** - * Gets the active diagnostic settings for the specified resource. - * - * @param resourceUri The identifier of the resource. - * @param name The name of the diagnostic setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the active diagnostic settings for the specified resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceUri, String name, Context context); - - /** - * Creates or updates diagnostic settings for the specified resource. - * - * @param resourceUri The identifier of the resource. - * @param name The name of the diagnostic setting. - * @param parameters Parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the diagnostic setting resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createOrUpdateWithResponseAsync( - String resourceUri, String name, DiagnosticSettingsResourceInner parameters); - - /** - * Creates or updates diagnostic settings for the specified resource. - * - * @param resourceUri The identifier of the resource. - * @param name The name of the diagnostic setting. - * @param parameters Parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the diagnostic setting resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceUri, String name, DiagnosticSettingsResourceInner parameters); - - /** - * Creates or updates diagnostic settings for the specified resource. - * - * @param resourceUri The identifier of the resource. - * @param name The name of the diagnostic setting. - * @param parameters Parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the diagnostic setting resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DiagnosticSettingsResourceInner createOrUpdate( - String resourceUri, String name, DiagnosticSettingsResourceInner parameters); - - /** - * Creates or updates diagnostic settings for the specified resource. - * - * @param resourceUri The identifier of the resource. - * @param name The name of the diagnostic setting. - * @param parameters Parameters supplied to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the diagnostic setting resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceUri, String name, DiagnosticSettingsResourceInner parameters, Context context); - - /** - * Deletes existing diagnostic settings for the specified resource. - * - * @param resourceUri The identifier of the resource. - * @param name The name of the diagnostic setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteWithResponseAsync(String resourceUri, String name); - - /** - * Deletes existing diagnostic settings for the specified resource. - * - * @param resourceUri The identifier of the resource. - * @param name The name of the diagnostic setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceUri, String name); - - /** - * Deletes existing diagnostic settings for the specified resource. - * - * @param resourceUri The identifier of the resource. - * @param name The name of the diagnostic setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceUri, String name); - - /** - * Deletes existing diagnostic settings for the specified resource. - * - * @param resourceUri The identifier of the resource. - * @param name The name of the diagnostic setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceUri, String name, Context context); - - /** - * Gets the active diagnostic settings list for the specified resource. - * - * @param resourceUri The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the active diagnostic settings list for the specified resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listWithResponseAsync(String resourceUri); - - /** - * Gets the active diagnostic settings list for the specified resource. - * - * @param resourceUri The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the active diagnostic settings list for the specified resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listAsync(String resourceUri); - - /** - * Gets the active diagnostic settings list for the specified resource. - * - * @param resourceUri The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the active diagnostic settings list for the specified resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DiagnosticSettingsResourceCollectionInner list(String resourceUri); - - /** - * Gets the active diagnostic settings list for the specified resource. - * - * @param resourceUri The identifier of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the active diagnostic settings list for the specified resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listWithResponse(String resourceUri, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/EventCategoriesClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/EventCategoriesClient.java deleted file mode 100644 index b8b8ca0348e5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/EventCategoriesClient.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.monitor.fluent.models.LocalizableStringInner; - -/** An instance of this class provides access to all the operations defined in EventCategoriesClient. */ -public interface EventCategoriesClient { - /** - * Get the list of available event categories supported in the Activity Logs Service.<br>The current list - * includes the following: Administrative, Security, ServiceHealth, Alert, Recommendation, Policy. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of available event categories supported in the Activity Logs Service. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Get the list of available event categories supported in the Activity Logs Service.<br>The current list - * includes the following: Administrative, Security, ServiceHealth, Alert, Recommendation, Policy. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of available event categories supported in the Activity Logs Service. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Get the list of available event categories supported in the Activity Logs Service.<br>The current list - * includes the following: Administrative, Security, ServiceHealth, Alert, Recommendation, Policy. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of available event categories supported in the Activity Logs Service. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/LogProfilesClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/LogProfilesClient.java deleted file mode 100644 index 7a00312a9ca6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/LogProfilesClient.java +++ /dev/null @@ -1,257 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.monitor.fluent.models.LogProfileResourceInner; -import com.azure.resourcemanager.monitor.models.LogProfileResourcePatch; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in LogProfilesClient. */ -public interface LogProfilesClient { - /** - * Deletes the log profile. - * - * @param logProfileName The name of the log profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteWithResponseAsync(String logProfileName); - - /** - * Deletes the log profile. - * - * @param logProfileName The name of the log profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String logProfileName); - - /** - * Deletes the log profile. - * - * @param logProfileName The name of the log profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String logProfileName); - - /** - * Deletes the log profile. - * - * @param logProfileName The name of the log profile. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String logProfileName, Context context); - - /** - * Gets the log profile. - * - * @param logProfileName The name of the log profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the log profile. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync(String logProfileName); - - /** - * Gets the log profile. - * - * @param logProfileName The name of the log profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the log profile. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync(String logProfileName); - - /** - * Gets the log profile. - * - * @param logProfileName The name of the log profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the log profile. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - LogProfileResourceInner get(String logProfileName); - - /** - * Gets the log profile. - * - * @param logProfileName The name of the log profile. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the log profile. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String logProfileName, Context context); - - /** - * Create or update a log profile in Azure Monitoring REST API. - * - * @param logProfileName The name of the log profile. - * @param parameters Parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the log profile resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createOrUpdateWithResponseAsync( - String logProfileName, LogProfileResourceInner parameters); - - /** - * Create or update a log profile in Azure Monitoring REST API. - * - * @param logProfileName The name of the log profile. - * @param parameters Parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the log profile resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync(String logProfileName, LogProfileResourceInner parameters); - - /** - * Create or update a log profile in Azure Monitoring REST API. - * - * @param logProfileName The name of the log profile. - * @param parameters Parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the log profile resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - LogProfileResourceInner createOrUpdate(String logProfileName, LogProfileResourceInner parameters); - - /** - * Create or update a log profile in Azure Monitoring REST API. - * - * @param logProfileName The name of the log profile. - * @param parameters Parameters supplied to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the log profile resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String logProfileName, LogProfileResourceInner parameters, Context context); - - /** - * Updates an existing LogProfilesResource. To update other fields use the CreateOrUpdate method. - * - * @param logProfileName The name of the log profile. - * @param logProfilesResource Parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the log profile resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateWithResponseAsync( - String logProfileName, LogProfileResourcePatch logProfilesResource); - - /** - * Updates an existing LogProfilesResource. To update other fields use the CreateOrUpdate method. - * - * @param logProfileName The name of the log profile. - * @param logProfilesResource Parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the log profile resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAsync(String logProfileName, LogProfileResourcePatch logProfilesResource); - - /** - * Updates an existing LogProfilesResource. To update other fields use the CreateOrUpdate method. - * - * @param logProfileName The name of the log profile. - * @param logProfilesResource Parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the log profile resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - LogProfileResourceInner update(String logProfileName, LogProfileResourcePatch logProfilesResource); - - /** - * Updates an existing LogProfilesResource. To update other fields use the CreateOrUpdate method. - * - * @param logProfileName The name of the log profile. - * @param logProfilesResource Parameters supplied to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the log profile resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String logProfileName, LogProfileResourcePatch logProfilesResource, Context context); - - /** - * List the log profiles. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of log profiles. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * List the log profiles. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of log profiles. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * List the log profiles. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of log profiles. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/MetricAlertsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/MetricAlertsClient.java deleted file mode 100644 index 97ecddf3030a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/MetricAlertsClient.java +++ /dev/null @@ -1,321 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.monitor.fluent.models.MetricAlertResourceInner; -import com.azure.resourcemanager.monitor.models.MetricAlertResourcePatch; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in MetricAlertsClient. */ -public interface MetricAlertsClient - extends InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete { - /** - * Retrieve alert rule definitions in a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of alert rule resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Retrieve alert rule definitions in a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of alert rule resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Retrieve alert rule definitions in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of alert rule resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Retrieve alert rule definitions in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of alert rule resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName); - - /** - * Retrieve alert rule definitions in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of alert rule resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Retrieve alert rule definitions in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of alert rule resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * Retrieve an alert rule definition. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the metric alert resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String ruleName); - - /** - * Retrieve an alert rule definition. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the metric alert resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync(String resourceGroupName, String ruleName); - - /** - * Retrieve an alert rule definition. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the metric alert resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - MetricAlertResourceInner getByResourceGroup(String resourceGroupName, String ruleName); - - /** - * Retrieve an alert rule definition. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the metric alert resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String ruleName, Context context); - - /** - * Create or update an metric alert definition. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param parameters The parameters of the rule to create or update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the metric alert resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String ruleName, MetricAlertResourceInner parameters); - - /** - * Create or update an metric alert definition. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param parameters The parameters of the rule to create or update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the metric alert resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, String ruleName, MetricAlertResourceInner parameters); - - /** - * Create or update an metric alert definition. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param parameters The parameters of the rule to create or update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the metric alert resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - MetricAlertResourceInner createOrUpdate( - String resourceGroupName, String ruleName, MetricAlertResourceInner parameters); - - /** - * Create or update an metric alert definition. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param parameters The parameters of the rule to create or update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the metric alert resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, String ruleName, MetricAlertResourceInner parameters, Context context); - - /** - * Update an metric alert definition. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param parameters The parameters of the rule to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the metric alert resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateWithResponseAsync( - String resourceGroupName, String ruleName, MetricAlertResourcePatch parameters); - - /** - * Update an metric alert definition. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param parameters The parameters of the rule to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the metric alert resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAsync( - String resourceGroupName, String ruleName, MetricAlertResourcePatch parameters); - - /** - * Update an metric alert definition. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param parameters The parameters of the rule to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the metric alert resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - MetricAlertResourceInner update(String resourceGroupName, String ruleName, MetricAlertResourcePatch parameters); - - /** - * Update an metric alert definition. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param parameters The parameters of the rule to update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the metric alert resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String resourceGroupName, String ruleName, MetricAlertResourcePatch parameters, Context context); - - /** - * Delete an alert rule definition. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteWithResponseAsync(String resourceGroupName, String ruleName); - - /** - * Delete an alert rule definition. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String ruleName); - - /** - * Delete an alert rule definition. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String ruleName); - - /** - * Delete an alert rule definition. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String ruleName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/MetricAlertsStatusClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/MetricAlertsStatusClient.java deleted file mode 100644 index c10d5566e362..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/MetricAlertsStatusClient.java +++ /dev/null @@ -1,129 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.monitor.fluent.models.MetricAlertStatusCollectionInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in MetricAlertsStatusClient. */ -public interface MetricAlertsStatusClient { - /** - * Retrieve an alert rule status. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of alert rule resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listWithResponseAsync(String resourceGroupName, String ruleName); - - /** - * Retrieve an alert rule status. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of alert rule resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listAsync(String resourceGroupName, String ruleName); - - /** - * Retrieve an alert rule status. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of alert rule resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - MetricAlertStatusCollectionInner list(String resourceGroupName, String ruleName); - - /** - * Retrieve an alert rule status. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of alert rule resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listWithResponse( - String resourceGroupName, String ruleName, Context context); - - /** - * Retrieve an alert rule status. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param statusName The name of the status. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of alert rule resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listByNameWithResponseAsync( - String resourceGroupName, String ruleName, String statusName); - - /** - * Retrieve an alert rule status. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param statusName The name of the status. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of alert rule resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listByNameAsync( - String resourceGroupName, String ruleName, String statusName); - - /** - * Retrieve an alert rule status. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param statusName The name of the status. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of alert rule resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - MetricAlertStatusCollectionInner listByName(String resourceGroupName, String ruleName, String statusName); - - /** - * Retrieve an alert rule status. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param statusName The name of the status. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of alert rule resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listByNameWithResponse( - String resourceGroupName, String ruleName, String statusName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/MetricDefinitionsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/MetricDefinitionsClient.java deleted file mode 100644 index 3901d8b31afc..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/MetricDefinitionsClient.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.monitor.fluent.models.MetricDefinitionInner; - -/** An instance of this class provides access to all the operations defined in MetricDefinitionsClient. */ -public interface MetricDefinitionsClient { - /** - * Lists the metric definitions for the resource. - * - * @param resourceUri The identifier of the resource. - * @param metricnamespace Metric namespace to query metric definitions for. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents collection of metric definitions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String resourceUri, String metricnamespace); - - /** - * Lists the metric definitions for the resource. - * - * @param resourceUri The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents collection of metric definitions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String resourceUri); - - /** - * Lists the metric definitions for the resource. - * - * @param resourceUri The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents collection of metric definitions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceUri); - - /** - * Lists the metric definitions for the resource. - * - * @param resourceUri The identifier of the resource. - * @param metricnamespace Metric namespace to query metric definitions for. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents collection of metric definitions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceUri, String metricnamespace, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/MetricNamespacesClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/MetricNamespacesClient.java deleted file mode 100644 index 1759df705267..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/MetricNamespacesClient.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.monitor.fluent.models.MetricNamespaceInner; - -/** An instance of this class provides access to all the operations defined in MetricNamespacesClient. */ -public interface MetricNamespacesClient { - /** - * Lists the metric namespaces for the resource. - * - * @param resourceUri The identifier of the resource. - * @param startTime The ISO 8601 conform Date start time from which to query for metric namespaces. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents collection of metric namespaces. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String resourceUri, String startTime); - - /** - * Lists the metric namespaces for the resource. - * - * @param resourceUri The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents collection of metric namespaces. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String resourceUri); - - /** - * Lists the metric namespaces for the resource. - * - * @param resourceUri The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents collection of metric namespaces. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceUri); - - /** - * Lists the metric namespaces for the resource. - * - * @param resourceUri The identifier of the resource. - * @param startTime The ISO 8601 conform Date start time from which to query for metric namespaces. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents collection of metric namespaces. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceUri, String startTime, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/MetricsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/MetricsClient.java deleted file mode 100644 index 9d02cb5fbe26..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/MetricsClient.java +++ /dev/null @@ -1,175 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.monitor.fluent.models.ResponseInner; -import com.azure.resourcemanager.monitor.models.ResultType; -import java.time.Duration; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in MetricsClient. */ -public interface MetricsClient { - /** - * **Lists the metric values for a resource**. - * - * @param resourceUri The identifier of the resource. - * @param timespan The timespan of the query. It is a string with the following format - * 'startDateTime_ISO/endDateTime_ISO'. - * @param interval The interval (i.e. timegrain) of the query. - * @param metricnames The names of the metrics (comma separated) to retrieve. Special case: If a metricname itself - * has a comma in it then use %2 to indicate it. Eg: 'Metric,Name1' should be **'Metric%2Name1'**. - * @param aggregation The list of aggregation types (comma separated) to retrieve. - * @param top The maximum number of records to retrieve. Valid only if $filter is specified. Defaults to 10. - * @param orderby The aggregation to use for sorting results and the direction of the sort. Only one order can be - * specified. Examples: sum asc. - * @param filter The **$filter** is used to reduce the set of metric data returned. Example: Metric contains - * metadata A, B and C. - Return all time series of C where A = a1 and B = b1 or b2 **$filter=A eq 'a1' and B eq - * 'b1' or B eq 'b2' and C eq '*'** - Invalid variant: **$filter=A eq 'a1' and B eq 'b1' and C eq '*' or B = - * 'b2'** This is invalid because the logical or operator cannot separate two different metadata names. - Return - * all time series where A = a1, B = b1 and C = c1: **$filter=A eq 'a1' and B eq 'b1' and C eq 'c1'** - Return - * all time series where A = a1 **$filter=A eq 'a1' and B eq '*' and C eq '*'**. Special case: When dimension - * name or dimension value uses round brackets. Eg: When dimension name is **dim (test) 1** Instead of using - * $filter= "dim (test) 1 eq '*' " use **$filter= "dim %2528test%2529 1 eq '*' "** When dimension name is **dim - * (test) 3** and dimension value is **dim3 (test) val** Instead of using $filter= "dim (test) 3 eq 'dim3 (test) - * val' " use **$filter= "dim %2528test%2529 3 eq 'dim3 %2528test%2529 val' "**. - * @param resultType Reduces the set of data collected. The syntax allowed depends on the operation. See the - * operation's description for details. - * @param metricnamespace Metric namespace to query metric definitions for. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a metrics query. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listWithResponseAsync( - String resourceUri, - String timespan, - Duration interval, - String metricnames, - String aggregation, - Integer top, - String orderby, - String filter, - ResultType resultType, - String metricnamespace); - - /** - * **Lists the metric values for a resource**. - * - * @param resourceUri The identifier of the resource. - * @param timespan The timespan of the query. It is a string with the following format - * 'startDateTime_ISO/endDateTime_ISO'. - * @param interval The interval (i.e. timegrain) of the query. - * @param metricnames The names of the metrics (comma separated) to retrieve. Special case: If a metricname itself - * has a comma in it then use %2 to indicate it. Eg: 'Metric,Name1' should be **'Metric%2Name1'**. - * @param aggregation The list of aggregation types (comma separated) to retrieve. - * @param top The maximum number of records to retrieve. Valid only if $filter is specified. Defaults to 10. - * @param orderby The aggregation to use for sorting results and the direction of the sort. Only one order can be - * specified. Examples: sum asc. - * @param filter The **$filter** is used to reduce the set of metric data returned. Example: Metric contains - * metadata A, B and C. - Return all time series of C where A = a1 and B = b1 or b2 **$filter=A eq 'a1' and B eq - * 'b1' or B eq 'b2' and C eq '*'** - Invalid variant: **$filter=A eq 'a1' and B eq 'b1' and C eq '*' or B = - * 'b2'** This is invalid because the logical or operator cannot separate two different metadata names. - Return - * all time series where A = a1, B = b1 and C = c1: **$filter=A eq 'a1' and B eq 'b1' and C eq 'c1'** - Return - * all time series where A = a1 **$filter=A eq 'a1' and B eq '*' and C eq '*'**. Special case: When dimension - * name or dimension value uses round brackets. Eg: When dimension name is **dim (test) 1** Instead of using - * $filter= "dim (test) 1 eq '*' " use **$filter= "dim %2528test%2529 1 eq '*' "** When dimension name is **dim - * (test) 3** and dimension value is **dim3 (test) val** Instead of using $filter= "dim (test) 3 eq 'dim3 (test) - * val' " use **$filter= "dim %2528test%2529 3 eq 'dim3 %2528test%2529 val' "**. - * @param resultType Reduces the set of data collected. The syntax allowed depends on the operation. See the - * operation's description for details. - * @param metricnamespace Metric namespace to query metric definitions for. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a metrics query. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listAsync( - String resourceUri, - String timespan, - Duration interval, - String metricnames, - String aggregation, - Integer top, - String orderby, - String filter, - ResultType resultType, - String metricnamespace); - - /** - * **Lists the metric values for a resource**. - * - * @param resourceUri The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a metrics query. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listAsync(String resourceUri); - - /** - * **Lists the metric values for a resource**. - * - * @param resourceUri The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a metrics query. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ResponseInner list(String resourceUri); - - /** - * **Lists the metric values for a resource**. - * - * @param resourceUri The identifier of the resource. - * @param timespan The timespan of the query. It is a string with the following format - * 'startDateTime_ISO/endDateTime_ISO'. - * @param interval The interval (i.e. timegrain) of the query. - * @param metricnames The names of the metrics (comma separated) to retrieve. Special case: If a metricname itself - * has a comma in it then use %2 to indicate it. Eg: 'Metric,Name1' should be **'Metric%2Name1'**. - * @param aggregation The list of aggregation types (comma separated) to retrieve. - * @param top The maximum number of records to retrieve. Valid only if $filter is specified. Defaults to 10. - * @param orderby The aggregation to use for sorting results and the direction of the sort. Only one order can be - * specified. Examples: sum asc. - * @param filter The **$filter** is used to reduce the set of metric data returned. Example: Metric contains - * metadata A, B and C. - Return all time series of C where A = a1 and B = b1 or b2 **$filter=A eq 'a1' and B eq - * 'b1' or B eq 'b2' and C eq '*'** - Invalid variant: **$filter=A eq 'a1' and B eq 'b1' and C eq '*' or B = - * 'b2'** This is invalid because the logical or operator cannot separate two different metadata names. - Return - * all time series where A = a1, B = b1 and C = c1: **$filter=A eq 'a1' and B eq 'b1' and C eq 'c1'** - Return - * all time series where A = a1 **$filter=A eq 'a1' and B eq '*' and C eq '*'**. Special case: When dimension - * name or dimension value uses round brackets. Eg: When dimension name is **dim (test) 1** Instead of using - * $filter= "dim (test) 1 eq '*' " use **$filter= "dim %2528test%2529 1 eq '*' "** When dimension name is **dim - * (test) 3** and dimension value is **dim3 (test) val** Instead of using $filter= "dim (test) 3 eq 'dim3 (test) - * val' " use **$filter= "dim %2528test%2529 3 eq 'dim3 %2528test%2529 val' "**. - * @param resultType Reduces the set of data collected. The syntax allowed depends on the operation. See the - * operation's description for details. - * @param metricnamespace Metric namespace to query metric definitions for. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a metrics query. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listWithResponse( - String resourceUri, - String timespan, - Duration interval, - String metricnames, - String aggregation, - Integer top, - String orderby, - String filter, - ResultType resultType, - String metricnamespace, - Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/MonitorClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/MonitorClient.java deleted file mode 100644 index 1b66bcc3a033..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/MonitorClient.java +++ /dev/null @@ -1,235 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.fluent; - -import com.azure.core.http.HttpPipeline; -import java.time.Duration; - -/** The interface for MonitorClient class. */ -public interface MonitorClient { - /** - * Gets The ID of the target subscription. - * - * @return the subscriptionId value. - */ - String getSubscriptionId(); - - /** - * Gets server parameter. - * - * @return the endpoint value. - */ - String getEndpoint(); - - /** - * Gets The HTTP pipeline to send requests through. - * - * @return the httpPipeline value. - */ - HttpPipeline getHttpPipeline(); - - /** - * Gets The default poll interval for long-running operation. - * - * @return the defaultPollInterval value. - */ - Duration getDefaultPollInterval(); - - /** - * Gets the AutoscaleSettingsClient object to access its operations. - * - * @return the AutoscaleSettingsClient object. - */ - AutoscaleSettingsClient getAutoscaleSettings(); - - /** - * Gets the OperationsClient object to access its operations. - * - * @return the OperationsClient object. - */ - OperationsClient getOperations(); - - /** - * Gets the AlertRuleIncidentsClient object to access its operations. - * - * @return the AlertRuleIncidentsClient object. - */ - AlertRuleIncidentsClient getAlertRuleIncidents(); - - /** - * Gets the AlertRulesClient object to access its operations. - * - * @return the AlertRulesClient object. - */ - AlertRulesClient getAlertRules(); - - /** - * Gets the LogProfilesClient object to access its operations. - * - * @return the LogProfilesClient object. - */ - LogProfilesClient getLogProfiles(); - - /** - * Gets the DiagnosticSettingsClient object to access its operations. - * - * @return the DiagnosticSettingsClient object. - */ - DiagnosticSettingsClient getDiagnosticSettings(); - - /** - * Gets the DiagnosticSettingsCategoriesClient object to access its operations. - * - * @return the DiagnosticSettingsCategoriesClient object. - */ - DiagnosticSettingsCategoriesClient getDiagnosticSettingsCategories(); - - /** - * Gets the ActionGroupsClient object to access its operations. - * - * @return the ActionGroupsClient object. - */ - ActionGroupsClient getActionGroups(); - - /** - * Gets the ActivityLogsClient object to access its operations. - * - * @return the ActivityLogsClient object. - */ - ActivityLogsClient getActivityLogs(); - - /** - * Gets the EventCategoriesClient object to access its operations. - * - * @return the EventCategoriesClient object. - */ - EventCategoriesClient getEventCategories(); - - /** - * Gets the TenantActivityLogsClient object to access its operations. - * - * @return the TenantActivityLogsClient object. - */ - TenantActivityLogsClient getTenantActivityLogs(); - - /** - * Gets the MetricDefinitionsClient object to access its operations. - * - * @return the MetricDefinitionsClient object. - */ - MetricDefinitionsClient getMetricDefinitions(); - - /** - * Gets the MetricsClient object to access its operations. - * - * @return the MetricsClient object. - */ - MetricsClient getMetrics(); - - /** - * Gets the BaselinesClient object to access its operations. - * - * @return the BaselinesClient object. - */ - BaselinesClient getBaselines(); - - /** - * Gets the MetricAlertsClient object to access its operations. - * - * @return the MetricAlertsClient object. - */ - MetricAlertsClient getMetricAlerts(); - - /** - * Gets the MetricAlertsStatusClient object to access its operations. - * - * @return the MetricAlertsStatusClient object. - */ - MetricAlertsStatusClient getMetricAlertsStatus(); - - /** - * Gets the ScheduledQueryRulesClient object to access its operations. - * - * @return the ScheduledQueryRulesClient object. - */ - ScheduledQueryRulesClient getScheduledQueryRules(); - - /** - * Gets the MetricNamespacesClient object to access its operations. - * - * @return the MetricNamespacesClient object. - */ - MetricNamespacesClient getMetricNamespaces(); - - /** - * Gets the VMInsightsClient object to access its operations. - * - * @return the VMInsightsClient object. - */ - VMInsightsClient getVMInsights(); - - /** - * Gets the PrivateLinkScopesClient object to access its operations. - * - * @return the PrivateLinkScopesClient object. - */ - PrivateLinkScopesClient getPrivateLinkScopes(); - - /** - * Gets the PrivateLinkScopeOperationStatusClient object to access its operations. - * - * @return the PrivateLinkScopeOperationStatusClient object. - */ - PrivateLinkScopeOperationStatusClient getPrivateLinkScopeOperationStatus(); - - /** - * Gets the PrivateLinkResourcesClient object to access its operations. - * - * @return the PrivateLinkResourcesClient object. - */ - PrivateLinkResourcesClient getPrivateLinkResources(); - - /** - * Gets the PrivateEndpointConnectionsClient object to access its operations. - * - * @return the PrivateEndpointConnectionsClient object. - */ - PrivateEndpointConnectionsClient getPrivateEndpointConnections(); - - /** - * Gets the PrivateLinkScopedResourcesClient object to access its operations. - * - * @return the PrivateLinkScopedResourcesClient object. - */ - PrivateLinkScopedResourcesClient getPrivateLinkScopedResources(); - - /** - * Gets the ActivityLogAlertsClient object to access its operations. - * - * @return the ActivityLogAlertsClient object. - */ - ActivityLogAlertsClient getActivityLogAlerts(); - - /** - * Gets the DataCollectionEndpointsClient object to access its operations. - * - * @return the DataCollectionEndpointsClient object. - */ - DataCollectionEndpointsClient getDataCollectionEndpoints(); - - /** - * Gets the DataCollectionRuleAssociationsClient object to access its operations. - * - * @return the DataCollectionRuleAssociationsClient object. - */ - DataCollectionRuleAssociationsClient getDataCollectionRuleAssociations(); - - /** - * Gets the DataCollectionRulesClient object to access its operations. - * - * @return the DataCollectionRulesClient object. - */ - DataCollectionRulesClient getDataCollectionRules(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/OperationsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/OperationsClient.java deleted file mode 100644 index 487e05dbba4e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/OperationsClient.java +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.monitor.fluent.models.OperationListResultInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in OperationsClient. */ -public interface OperationsClient { - /** - * Lists all of the available operations from Microsoft.Insights provider. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Microsoft. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listWithResponseAsync(); - - /** - * Lists all of the available operations from Microsoft.Insights provider. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Microsoft. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listAsync(); - - /** - * Lists all of the available operations from Microsoft.Insights provider. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Microsoft. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - OperationListResultInner list(); - - /** - * Lists all of the available operations from Microsoft.Insights provider. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Microsoft. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listWithResponse(Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/PrivateEndpointConnectionsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/PrivateEndpointConnectionsClient.java deleted file mode 100644 index d48aacb703de..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/PrivateEndpointConnectionsClient.java +++ /dev/null @@ -1,363 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.monitor.fluent.models.PrivateEndpointConnectionInner; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. */ -public interface PrivateEndpointConnectionsClient { - /** - * Gets a private endpoint connection. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync( - String resourceGroupName, String scopeName, String privateEndpointConnectionName); - - /** - * Gets a private endpoint connection. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync( - String resourceGroupName, String scopeName, String privateEndpointConnectionName); - - /** - * Gets a private endpoint connection. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PrivateEndpointConnectionInner get( - String resourceGroupName, String scopeName, String privateEndpointConnectionName); - - /** - * Gets a private endpoint connection. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String scopeName, String privateEndpointConnectionName, Context context); - - /** - * Approve or reject a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param parameters A private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String scopeName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner parameters); - - /** - * Approve or reject a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param parameters A private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, PrivateEndpointConnectionInner> beginCreateOrUpdateAsync( - String resourceGroupName, - String scopeName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner parameters); - - /** - * Approve or reject a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param parameters A private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdate( - String resourceGroupName, - String scopeName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner parameters); - - /** - * Approve or reject a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param parameters A private endpoint connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdate( - String resourceGroupName, - String scopeName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner parameters, - Context context); - - /** - * Approve or reject a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param parameters A private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, - String scopeName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner parameters); - - /** - * Approve or reject a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param parameters A private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PrivateEndpointConnectionInner createOrUpdate( - String resourceGroupName, - String scopeName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner parameters); - - /** - * Approve or reject a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param parameters A private endpoint connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PrivateEndpointConnectionInner createOrUpdate( - String resourceGroupName, - String scopeName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner parameters, - Context context); - - /** - * Deletes a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync( - String resourceGroupName, String scopeName, String privateEndpointConnectionName); - - /** - * Deletes a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String scopeName, String privateEndpointConnectionName); - - /** - * Deletes a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String scopeName, String privateEndpointConnectionName); - - /** - * Deletes a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String scopeName, String privateEndpointConnectionName, Context context); - - /** - * Deletes a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String scopeName, String privateEndpointConnectionName); - - /** - * Deletes a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String scopeName, String privateEndpointConnectionName); - - /** - * Deletes a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String scopeName, String privateEndpointConnectionName, Context context); - - /** - * Gets all private endpoint connections on a private link scope. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all private endpoint connections on a private link scope. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByPrivateLinkScopeAsync(String resourceGroupName, String scopeName); - - /** - * Gets all private endpoint connections on a private link scope. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all private endpoint connections on a private link scope. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByPrivateLinkScope(String resourceGroupName, String scopeName); - - /** - * Gets all private endpoint connections on a private link scope. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all private endpoint connections on a private link scope. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByPrivateLinkScope( - String resourceGroupName, String scopeName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/PrivateLinkResourcesClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/PrivateLinkResourcesClient.java deleted file mode 100644 index 9e4743502c5a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/PrivateLinkResourcesClient.java +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.monitor.fluent.models.PrivateLinkResourceInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. */ -public interface PrivateLinkResourcesClient { - /** - * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByPrivateLinkScopeAsync(String resourceGroupName, String scopeName); - - /** - * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByPrivateLinkScope(String resourceGroupName, String scopeName); - - /** - * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByPrivateLinkScope( - String resourceGroupName, String scopeName, Context context); - - /** - * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param groupName The name of the private link resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync( - String resourceGroupName, String scopeName, String groupName); - - /** - * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param groupName The name of the private link resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync(String resourceGroupName, String scopeName, String groupName); - - /** - * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param groupName The name of the private link resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PrivateLinkResourceInner get(String resourceGroupName, String scopeName, String groupName); - - /** - * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param groupName The name of the private link resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String scopeName, String groupName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/PrivateLinkScopeOperationStatusClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/PrivateLinkScopeOperationStatusClient.java deleted file mode 100644 index cc325e423124..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/PrivateLinkScopeOperationStatusClient.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.monitor.fluent.models.OperationStatusInner; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in PrivateLinkScopeOperationStatusClient. */ -public interface PrivateLinkScopeOperationStatusClient extends InnerSupportsGet { - /** - * Get the status of an azure asynchronous operation associated with a private link scope operation. - * - * @param resourceGroupName The name of the resource group. - * @param asyncOperationId The operation Id. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of an azure asynchronous operation associated with a private link scope operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String asyncOperationId); - - /** - * Get the status of an azure asynchronous operation associated with a private link scope operation. - * - * @param resourceGroupName The name of the resource group. - * @param asyncOperationId The operation Id. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of an azure asynchronous operation associated with a private link scope operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync(String resourceGroupName, String asyncOperationId); - - /** - * Get the status of an azure asynchronous operation associated with a private link scope operation. - * - * @param resourceGroupName The name of the resource group. - * @param asyncOperationId The operation Id. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of an azure asynchronous operation associated with a private link scope operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - OperationStatusInner getByResourceGroup(String resourceGroupName, String asyncOperationId); - - /** - * Get the status of an azure asynchronous operation associated with a private link scope operation. - * - * @param resourceGroupName The name of the resource group. - * @param asyncOperationId The operation Id. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of an azure asynchronous operation associated with a private link scope operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String asyncOperationId, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/PrivateLinkScopedResourcesClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/PrivateLinkScopedResourcesClient.java deleted file mode 100644 index 94132afe74f9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/PrivateLinkScopedResourcesClient.java +++ /dev/null @@ -1,362 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.monitor.fluent.models.ScopedResourceInner; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in PrivateLinkScopedResourcesClient. */ -public interface PrivateLinkScopedResourcesClient { - /** - * Gets a scoped resource in a private link scope. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param name The name of the scoped resource object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a scoped resource in a private link scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync(String resourceGroupName, String scopeName, String name); - - /** - * Gets a scoped resource in a private link scope. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param name The name of the scoped resource object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a scoped resource in a private link scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync(String resourceGroupName, String scopeName, String name); - - /** - * Gets a scoped resource in a private link scope. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param name The name of the scoped resource object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a scoped resource in a private link scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ScopedResourceInner get(String resourceGroupName, String scopeName, String name); - - /** - * Gets a scoped resource in a private link scope. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param name The name of the scoped resource object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a scoped resource in a private link scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String scopeName, String name, Context context); - - /** - * Approve or reject a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param name The name of the scoped resource object. - * @param linkedResourceId The resource id of the scoped Azure monitor resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private link scoped resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String scopeName, String name, String linkedResourceId); - - /** - * Approve or reject a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param name The name of the scoped resource object. - * @param linkedResourceId The resource id of the scoped Azure monitor resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private link scoped resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, ScopedResourceInner> beginCreateOrUpdateAsync( - String resourceGroupName, String scopeName, String name, String linkedResourceId); - - /** - * Approve or reject a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param name The name of the scoped resource object. - * @param linkedResourceId The resource id of the scoped Azure monitor resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private link scoped resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ScopedResourceInner> beginCreateOrUpdate( - String resourceGroupName, String scopeName, String name, String linkedResourceId); - - /** - * Approve or reject a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param name The name of the scoped resource object. - * @param linkedResourceId The resource id of the scoped Azure monitor resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private link scoped resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ScopedResourceInner> beginCreateOrUpdate( - String resourceGroupName, String scopeName, String name, String linkedResourceId, Context context); - - /** - * Approve or reject a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param name The name of the scoped resource object. - * @param linkedResourceId The resource id of the scoped Azure monitor resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private link scoped resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, String scopeName, String name, String linkedResourceId); - - /** - * Approve or reject a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param name The name of the scoped resource object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private link scoped resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync(String resourceGroupName, String scopeName, String name); - - /** - * Approve or reject a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param name The name of the scoped resource object. - * @param linkedResourceId The resource id of the scoped Azure monitor resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private link scoped resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ScopedResourceInner createOrUpdate( - String resourceGroupName, String scopeName, String name, String linkedResourceId); - - /** - * Approve or reject a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param name The name of the scoped resource object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private link scoped resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ScopedResourceInner createOrUpdate(String resourceGroupName, String scopeName, String name); - - /** - * Approve or reject a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param name The name of the scoped resource object. - * @param linkedResourceId The resource id of the scoped Azure monitor resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private link scoped resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ScopedResourceInner createOrUpdate( - String resourceGroupName, String scopeName, String name, String linkedResourceId, Context context); - - /** - * Deletes a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param name The name of the scoped resource object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync(String resourceGroupName, String scopeName, String name); - - /** - * Deletes a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param name The name of the scoped resource object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String scopeName, String name); - - /** - * Deletes a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param name The name of the scoped resource object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String scopeName, String name); - - /** - * Deletes a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param name The name of the scoped resource object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String scopeName, String name, Context context); - - /** - * Deletes a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param name The name of the scoped resource object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String scopeName, String name); - - /** - * Deletes a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param name The name of the scoped resource object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String scopeName, String name); - - /** - * Deletes a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param name The name of the scoped resource object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String scopeName, String name, Context context); - - /** - * Gets all private endpoint connections on a private link scope. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all private endpoint connections on a private link scope. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByPrivateLinkScopeAsync(String resourceGroupName, String scopeName); - - /** - * Gets all private endpoint connections on a private link scope. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all private endpoint connections on a private link scope. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByPrivateLinkScope(String resourceGroupName, String scopeName); - - /** - * Gets all private endpoint connections on a private link scope. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all private endpoint connections on a private link scope. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByPrivateLinkScope( - String resourceGroupName, String scopeName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/PrivateLinkScopesClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/PrivateLinkScopesClient.java deleted file mode 100644 index 56c6f528f2c2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/PrivateLinkScopesClient.java +++ /dev/null @@ -1,394 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.monitor.fluent.models.AzureMonitorPrivateLinkScopeInner; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import java.util.Map; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in PrivateLinkScopesClient. */ -public interface PrivateLinkScopesClient - extends InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete { - /** - * Gets a list of all Azure Monitor PrivateLinkScopes within a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all Azure Monitor PrivateLinkScopes within a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Gets a list of all Azure Monitor PrivateLinkScopes within a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all Azure Monitor PrivateLinkScopes within a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Gets a list of all Azure Monitor PrivateLinkScopes within a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all Azure Monitor PrivateLinkScopes within a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Gets a list of Azure Monitor PrivateLinkScopes within a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Azure Monitor PrivateLinkScopes within a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName); - - /** - * Gets a list of Azure Monitor PrivateLinkScopes within a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Azure Monitor PrivateLinkScopes within a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Gets a list of Azure Monitor PrivateLinkScopes within a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Azure Monitor PrivateLinkScopes within a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * Deletes a Azure Monitor PrivateLinkScope. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync(String resourceGroupName, String scopeName); - - /** - * Deletes a Azure Monitor PrivateLinkScope. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String scopeName); - - /** - * Deletes a Azure Monitor PrivateLinkScope. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String scopeName); - - /** - * Deletes a Azure Monitor PrivateLinkScope. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String scopeName, Context context); - - /** - * Deletes a Azure Monitor PrivateLinkScope. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String scopeName); - - /** - * Deletes a Azure Monitor PrivateLinkScope. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String scopeName); - - /** - * Deletes a Azure Monitor PrivateLinkScope. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String scopeName, Context context); - - /** - * Returns a Azure Monitor PrivateLinkScope. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Azure Monitor PrivateLinkScope definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String scopeName); - - /** - * Returns a Azure Monitor PrivateLinkScope. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Azure Monitor PrivateLinkScope definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync(String resourceGroupName, String scopeName); - - /** - * Returns a Azure Monitor PrivateLinkScope. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Azure Monitor PrivateLinkScope definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AzureMonitorPrivateLinkScopeInner getByResourceGroup(String resourceGroupName, String scopeName); - - /** - * Returns a Azure Monitor PrivateLinkScope. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Azure Monitor PrivateLinkScope definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String scopeName, Context context); - - /** - * Creates (or updates) a Azure Monitor PrivateLinkScope. Note: You cannot specify a different value for - * InstrumentationKey nor AppId in the Put operation. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param azureMonitorPrivateLinkScopePayload Properties that need to be specified to create or update a Azure - * Monitor PrivateLinkScope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Azure Monitor PrivateLinkScope definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, - String scopeName, - AzureMonitorPrivateLinkScopeInner azureMonitorPrivateLinkScopePayload); - - /** - * Creates (or updates) a Azure Monitor PrivateLinkScope. Note: You cannot specify a different value for - * InstrumentationKey nor AppId in the Put operation. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param azureMonitorPrivateLinkScopePayload Properties that need to be specified to create or update a Azure - * Monitor PrivateLinkScope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Azure Monitor PrivateLinkScope definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, - String scopeName, - AzureMonitorPrivateLinkScopeInner azureMonitorPrivateLinkScopePayload); - - /** - * Creates (or updates) a Azure Monitor PrivateLinkScope. Note: You cannot specify a different value for - * InstrumentationKey nor AppId in the Put operation. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param azureMonitorPrivateLinkScopePayload Properties that need to be specified to create or update a Azure - * Monitor PrivateLinkScope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Azure Monitor PrivateLinkScope definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AzureMonitorPrivateLinkScopeInner createOrUpdate( - String resourceGroupName, - String scopeName, - AzureMonitorPrivateLinkScopeInner azureMonitorPrivateLinkScopePayload); - - /** - * Creates (or updates) a Azure Monitor PrivateLinkScope. Note: You cannot specify a different value for - * InstrumentationKey nor AppId in the Put operation. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param azureMonitorPrivateLinkScopePayload Properties that need to be specified to create or update a Azure - * Monitor PrivateLinkScope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Azure Monitor PrivateLinkScope definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, - String scopeName, - AzureMonitorPrivateLinkScopeInner azureMonitorPrivateLinkScopePayload, - Context context); - - /** - * Updates an existing PrivateLinkScope's tags. To update other fields use the CreateOrUpdate method. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param tags Resource tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Azure Monitor PrivateLinkScope definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateTagsWithResponseAsync( - String resourceGroupName, String scopeName, Map tags); - - /** - * Updates an existing PrivateLinkScope's tags. To update other fields use the CreateOrUpdate method. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param tags Resource tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Azure Monitor PrivateLinkScope definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateTagsAsync( - String resourceGroupName, String scopeName, Map tags); - - /** - * Updates an existing PrivateLinkScope's tags. To update other fields use the CreateOrUpdate method. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Azure Monitor PrivateLinkScope definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateTagsAsync(String resourceGroupName, String scopeName); - - /** - * Updates an existing PrivateLinkScope's tags. To update other fields use the CreateOrUpdate method. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Azure Monitor PrivateLinkScope definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AzureMonitorPrivateLinkScopeInner updateTags(String resourceGroupName, String scopeName); - - /** - * Updates an existing PrivateLinkScope's tags. To update other fields use the CreateOrUpdate method. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param tags Resource tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Azure Monitor PrivateLinkScope definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateTagsWithResponse( - String resourceGroupName, String scopeName, Map tags, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/ScheduledQueryRulesClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/ScheduledQueryRulesClient.java deleted file mode 100644 index 7e4181fbab15..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/ScheduledQueryRulesClient.java +++ /dev/null @@ -1,353 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.monitor.fluent.models.LogSearchRuleResourceInner; -import com.azure.resourcemanager.monitor.models.LogSearchRuleResourcePatch; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ScheduledQueryRulesClient. */ -public interface ScheduledQueryRulesClient - extends InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete { - /** - * Creates or updates an log search rule. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param parameters The parameters of the rule to create or update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Log Search Rule resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String ruleName, LogSearchRuleResourceInner parameters); - - /** - * Creates or updates an log search rule. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param parameters The parameters of the rule to create or update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Log Search Rule resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, String ruleName, LogSearchRuleResourceInner parameters); - - /** - * Creates or updates an log search rule. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param parameters The parameters of the rule to create or update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Log Search Rule resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - LogSearchRuleResourceInner createOrUpdate( - String resourceGroupName, String ruleName, LogSearchRuleResourceInner parameters); - - /** - * Creates or updates an log search rule. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param parameters The parameters of the rule to create or update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Log Search Rule resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, String ruleName, LogSearchRuleResourceInner parameters, Context context); - - /** - * Gets an Log Search rule. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Log Search rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String ruleName); - - /** - * Gets an Log Search rule. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Log Search rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync(String resourceGroupName, String ruleName); - - /** - * Gets an Log Search rule. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Log Search rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - LogSearchRuleResourceInner getByResourceGroup(String resourceGroupName, String ruleName); - - /** - * Gets an Log Search rule. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Log Search rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String ruleName, Context context); - - /** - * Update log search Rule. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param parameters The parameters of the rule to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Log Search Rule resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateWithResponseAsync( - String resourceGroupName, String ruleName, LogSearchRuleResourcePatch parameters); - - /** - * Update log search Rule. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param parameters The parameters of the rule to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Log Search Rule resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAsync( - String resourceGroupName, String ruleName, LogSearchRuleResourcePatch parameters); - - /** - * Update log search Rule. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param parameters The parameters of the rule to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Log Search Rule resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - LogSearchRuleResourceInner update(String resourceGroupName, String ruleName, LogSearchRuleResourcePatch parameters); - - /** - * Update log search Rule. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param parameters The parameters of the rule to update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Log Search Rule resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String resourceGroupName, String ruleName, LogSearchRuleResourcePatch parameters, Context context); - - /** - * Deletes a Log Search rule. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteWithResponseAsync(String resourceGroupName, String ruleName); - - /** - * Deletes a Log Search rule. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String ruleName); - - /** - * Deletes a Log Search rule. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String ruleName); - - /** - * Deletes a Log Search rule. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String ruleName, Context context); - - /** - * List the Log Search rules within a subscription group. - * - * @param filter The filter to apply on the operation. For more information please see - * https://msdn.microsoft.com/en-us/library/azure/dn931934.aspx. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of Log Search rule resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String filter); - - /** - * List the Log Search rules within a subscription group. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of Log Search rule resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * List the Log Search rules within a subscription group. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of Log Search rule resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * List the Log Search rules within a subscription group. - * - * @param filter The filter to apply on the operation. For more information please see - * https://msdn.microsoft.com/en-us/library/azure/dn931934.aspx. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of Log Search rule resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String filter, Context context); - - /** - * List the Log Search rules within a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param filter The filter to apply on the operation. For more information please see - * https://msdn.microsoft.com/en-us/library/azure/dn931934.aspx. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of Log Search rule resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName, String filter); - - /** - * List the Log Search rules within a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of Log Search rule resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName); - - /** - * List the Log Search rules within a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of Log Search rule resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * List the Log Search rules within a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param filter The filter to apply on the operation. For more information please see - * https://msdn.microsoft.com/en-us/library/azure/dn931934.aspx. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of Log Search rule resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup( - String resourceGroupName, String filter, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/TenantActivityLogsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/TenantActivityLogsClient.java deleted file mode 100644 index 43ee0f5b3315..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/TenantActivityLogsClient.java +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.monitor.fluent.models.EventDataInner; - -/** An instance of this class provides access to all the operations defined in TenantActivityLogsClient. */ -public interface TenantActivityLogsClient { - /** - * Gets the Activity Logs for the Tenant.<br>Everything that is applicable to the API to get the Activity Logs - * for the subscription is applicable to this API (the parameters, $filter, etc.).<br>One thing to point out - * here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces - * the logs that were generated at the tenant level. - * - * @param filter Reduces the set of data collected. <br>The **$filter** is very restricted and allows only the - * following patterns.<br>- List events for a resource group: $filter=eventTimestamp ge '<Start - * Time>' and eventTimestamp le '<End Time>' and eventChannels eq 'Admin, Operation' and - * resourceGroupName eq '<ResourceGroupName>'.<br>- List events for resource: $filter=eventTimestamp - * ge '<Start Time>' and eventTimestamp le '<End Time>' and eventChannels eq 'Admin, Operation' and - * resourceUri eq '<ResourceURI>'.<br>- List events for a subscription: $filter=eventTimestamp ge - * '<Start Time>' and eventTimestamp le '<End Time>' and eventChannels eq 'Admin, - * Operation'.<br>- List events for a resource provider: $filter=eventTimestamp ge '<Start Time>' - * and eventTimestamp le '<End Time>' and eventChannels eq 'Admin, Operation' and resourceProvider eq - * '<ResourceProviderName>'.<br>- List events for a correlation Id: - * api-version=2014-04-01&$filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le - * '2014-07-20T04:36:37.6407898Z' and eventChannels eq 'Admin, Operation' and correlationId eq - * '<CorrelationID>'.<br>**NOTE**: No other syntax is allowed. - * @param select Used to fetch events with only the given properties.<br>The **$select** argument is a comma - * separated list of property names to be returned. Possible values are: *authorization*, *claims*, - * *correlationId*, *description*, *eventDataId*, *eventName*, *eventTimestamp*, *httpRequest*, *level*, - * *operationId*, *operationName*, *properties*, *resourceGroupName*, *resourceProviderName*, *resourceId*, - * *status*, *submissionTimestamp*, *subStatus*, *subscriptionId*. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Activity Logs for the Tenant. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String filter, String select); - - /** - * Gets the Activity Logs for the Tenant.<br>Everything that is applicable to the API to get the Activity Logs - * for the subscription is applicable to this API (the parameters, $filter, etc.).<br>One thing to point out - * here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces - * the logs that were generated at the tenant level. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Activity Logs for the Tenant. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Gets the Activity Logs for the Tenant.<br>Everything that is applicable to the API to get the Activity Logs - * for the subscription is applicable to this API (the parameters, $filter, etc.).<br>One thing to point out - * here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces - * the logs that were generated at the tenant level. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Activity Logs for the Tenant. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Gets the Activity Logs for the Tenant.<br>Everything that is applicable to the API to get the Activity Logs - * for the subscription is applicable to this API (the parameters, $filter, etc.).<br>One thing to point out - * here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces - * the logs that were generated at the tenant level. - * - * @param filter Reduces the set of data collected. <br>The **$filter** is very restricted and allows only the - * following patterns.<br>- List events for a resource group: $filter=eventTimestamp ge '<Start - * Time>' and eventTimestamp le '<End Time>' and eventChannels eq 'Admin, Operation' and - * resourceGroupName eq '<ResourceGroupName>'.<br>- List events for resource: $filter=eventTimestamp - * ge '<Start Time>' and eventTimestamp le '<End Time>' and eventChannels eq 'Admin, Operation' and - * resourceUri eq '<ResourceURI>'.<br>- List events for a subscription: $filter=eventTimestamp ge - * '<Start Time>' and eventTimestamp le '<End Time>' and eventChannels eq 'Admin, - * Operation'.<br>- List events for a resource provider: $filter=eventTimestamp ge '<Start Time>' - * and eventTimestamp le '<End Time>' and eventChannels eq 'Admin, Operation' and resourceProvider eq - * '<ResourceProviderName>'.<br>- List events for a correlation Id: - * api-version=2014-04-01&$filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le - * '2014-07-20T04:36:37.6407898Z' and eventChannels eq 'Admin, Operation' and correlationId eq - * '<CorrelationID>'.<br>**NOTE**: No other syntax is allowed. - * @param select Used to fetch events with only the given properties.<br>The **$select** argument is a comma - * separated list of property names to be returned. Possible values are: *authorization*, *claims*, - * *correlationId*, *description*, *eventDataId*, *eventName*, *eventTimestamp*, *httpRequest*, *level*, - * *operationId*, *operationName*, *properties*, *resourceGroupName*, *resourceProviderName*, *resourceId*, - * *status*, *submissionTimestamp*, *subStatus*, *subscriptionId*. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Activity Logs for the Tenant. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String filter, String select, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/VMInsightsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/VMInsightsClient.java deleted file mode 100644 index 945624b144bf..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/VMInsightsClient.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.monitor.fluent.models.VMInsightsOnboardingStatusInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in VMInsightsClient. */ -public interface VMInsightsClient { - /** - * Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource, or scope, whose status - * to retrieve. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vM Insights onboarding status for a resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getOnboardingStatusWithResponseAsync(String resourceUri); - - /** - * Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource, or scope, whose status - * to retrieve. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vM Insights onboarding status for a resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getOnboardingStatusAsync(String resourceUri); - - /** - * Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource, or scope, whose status - * to retrieve. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vM Insights onboarding status for a resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VMInsightsOnboardingStatusInner getOnboardingStatus(String resourceUri); - - /** - * Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource, or scope, whose status - * to retrieve. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vM Insights onboarding status for a resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getOnboardingStatusWithResponse(String resourceUri, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/ActionGroupResourceInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/ActionGroupResourceInner.java deleted file mode 100644 index 09af08c960e9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/ActionGroupResourceInner.java +++ /dev/null @@ -1,407 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.models.ArmRoleReceiver; -import com.azure.resourcemanager.monitor.models.AutomationRunbookReceiver; -import com.azure.resourcemanager.monitor.models.AzureAppPushReceiver; -import com.azure.resourcemanager.monitor.models.AzureFunctionReceiver; -import com.azure.resourcemanager.monitor.models.AzureResource; -import com.azure.resourcemanager.monitor.models.EmailReceiver; -import com.azure.resourcemanager.monitor.models.ItsmReceiver; -import com.azure.resourcemanager.monitor.models.LogicAppReceiver; -import com.azure.resourcemanager.monitor.models.SmsReceiver; -import com.azure.resourcemanager.monitor.models.VoiceReceiver; -import com.azure.resourcemanager.monitor.models.WebhookReceiver; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** An action group resource. */ -@JsonFlatten -@Fluent -public class ActionGroupResourceInner extends AzureResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ActionGroupResourceInner.class); - - /* - * The short name of the action group. This will be used in SMS messages. - */ - @JsonProperty(value = "properties.groupShortName") - private String groupShortName; - - /* - * Indicates whether this action group is enabled. If an action group is - * not enabled, then none of its receivers will receive communications. - */ - @JsonProperty(value = "properties.enabled") - private Boolean enabled; - - /* - * The list of email receivers that are part of this action group. - */ - @JsonProperty(value = "properties.emailReceivers") - private List emailReceivers; - - /* - * The list of SMS receivers that are part of this action group. - */ - @JsonProperty(value = "properties.smsReceivers") - private List smsReceivers; - - /* - * The list of webhook receivers that are part of this action group. - */ - @JsonProperty(value = "properties.webhookReceivers") - private List webhookReceivers; - - /* - * The list of ITSM receivers that are part of this action group. - */ - @JsonProperty(value = "properties.itsmReceivers") - private List itsmReceivers; - - /* - * The list of AzureAppPush receivers that are part of this action group. - */ - @JsonProperty(value = "properties.azureAppPushReceivers") - private List azureAppPushReceivers; - - /* - * The list of AutomationRunbook receivers that are part of this action - * group. - */ - @JsonProperty(value = "properties.automationRunbookReceivers") - private List automationRunbookReceivers; - - /* - * The list of voice receivers that are part of this action group. - */ - @JsonProperty(value = "properties.voiceReceivers") - private List voiceReceivers; - - /* - * The list of logic app receivers that are part of this action group. - */ - @JsonProperty(value = "properties.logicAppReceivers") - private List logicAppReceivers; - - /* - * The list of azure function receivers that are part of this action group. - */ - @JsonProperty(value = "properties.azureFunctionReceivers") - private List azureFunctionReceivers; - - /* - * The list of ARM role receivers that are part of this action group. Roles - * are Azure RBAC roles and only built-in roles are supported. - */ - @JsonProperty(value = "properties.armRoleReceivers") - private List armRoleReceivers; - - /** - * Get the groupShortName property: The short name of the action group. This will be used in SMS messages. - * - * @return the groupShortName value. - */ - public String groupShortName() { - return this.groupShortName; - } - - /** - * Set the groupShortName property: The short name of the action group. This will be used in SMS messages. - * - * @param groupShortName the groupShortName value to set. - * @return the ActionGroupResourceInner object itself. - */ - public ActionGroupResourceInner withGroupShortName(String groupShortName) { - this.groupShortName = groupShortName; - return this; - } - - /** - * Get the enabled property: Indicates whether this action group is enabled. If an action group is not enabled, then - * none of its receivers will receive communications. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Indicates whether this action group is enabled. If an action group is not enabled, then - * none of its receivers will receive communications. - * - * @param enabled the enabled value to set. - * @return the ActionGroupResourceInner object itself. - */ - public ActionGroupResourceInner withEnabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the emailReceivers property: The list of email receivers that are part of this action group. - * - * @return the emailReceivers value. - */ - public List emailReceivers() { - return this.emailReceivers; - } - - /** - * Set the emailReceivers property: The list of email receivers that are part of this action group. - * - * @param emailReceivers the emailReceivers value to set. - * @return the ActionGroupResourceInner object itself. - */ - public ActionGroupResourceInner withEmailReceivers(List emailReceivers) { - this.emailReceivers = emailReceivers; - return this; - } - - /** - * Get the smsReceivers property: The list of SMS receivers that are part of this action group. - * - * @return the smsReceivers value. - */ - public List smsReceivers() { - return this.smsReceivers; - } - - /** - * Set the smsReceivers property: The list of SMS receivers that are part of this action group. - * - * @param smsReceivers the smsReceivers value to set. - * @return the ActionGroupResourceInner object itself. - */ - public ActionGroupResourceInner withSmsReceivers(List smsReceivers) { - this.smsReceivers = smsReceivers; - return this; - } - - /** - * Get the webhookReceivers property: The list of webhook receivers that are part of this action group. - * - * @return the webhookReceivers value. - */ - public List webhookReceivers() { - return this.webhookReceivers; - } - - /** - * Set the webhookReceivers property: The list of webhook receivers that are part of this action group. - * - * @param webhookReceivers the webhookReceivers value to set. - * @return the ActionGroupResourceInner object itself. - */ - public ActionGroupResourceInner withWebhookReceivers(List webhookReceivers) { - this.webhookReceivers = webhookReceivers; - return this; - } - - /** - * Get the itsmReceivers property: The list of ITSM receivers that are part of this action group. - * - * @return the itsmReceivers value. - */ - public List itsmReceivers() { - return this.itsmReceivers; - } - - /** - * Set the itsmReceivers property: The list of ITSM receivers that are part of this action group. - * - * @param itsmReceivers the itsmReceivers value to set. - * @return the ActionGroupResourceInner object itself. - */ - public ActionGroupResourceInner withItsmReceivers(List itsmReceivers) { - this.itsmReceivers = itsmReceivers; - return this; - } - - /** - * Get the azureAppPushReceivers property: The list of AzureAppPush receivers that are part of this action group. - * - * @return the azureAppPushReceivers value. - */ - public List azureAppPushReceivers() { - return this.azureAppPushReceivers; - } - - /** - * Set the azureAppPushReceivers property: The list of AzureAppPush receivers that are part of this action group. - * - * @param azureAppPushReceivers the azureAppPushReceivers value to set. - * @return the ActionGroupResourceInner object itself. - */ - public ActionGroupResourceInner withAzureAppPushReceivers(List azureAppPushReceivers) { - this.azureAppPushReceivers = azureAppPushReceivers; - return this; - } - - /** - * Get the automationRunbookReceivers property: The list of AutomationRunbook receivers that are part of this action - * group. - * - * @return the automationRunbookReceivers value. - */ - public List automationRunbookReceivers() { - return this.automationRunbookReceivers; - } - - /** - * Set the automationRunbookReceivers property: The list of AutomationRunbook receivers that are part of this action - * group. - * - * @param automationRunbookReceivers the automationRunbookReceivers value to set. - * @return the ActionGroupResourceInner object itself. - */ - public ActionGroupResourceInner withAutomationRunbookReceivers( - List automationRunbookReceivers) { - this.automationRunbookReceivers = automationRunbookReceivers; - return this; - } - - /** - * Get the voiceReceivers property: The list of voice receivers that are part of this action group. - * - * @return the voiceReceivers value. - */ - public List voiceReceivers() { - return this.voiceReceivers; - } - - /** - * Set the voiceReceivers property: The list of voice receivers that are part of this action group. - * - * @param voiceReceivers the voiceReceivers value to set. - * @return the ActionGroupResourceInner object itself. - */ - public ActionGroupResourceInner withVoiceReceivers(List voiceReceivers) { - this.voiceReceivers = voiceReceivers; - return this; - } - - /** - * Get the logicAppReceivers property: The list of logic app receivers that are part of this action group. - * - * @return the logicAppReceivers value. - */ - public List logicAppReceivers() { - return this.logicAppReceivers; - } - - /** - * Set the logicAppReceivers property: The list of logic app receivers that are part of this action group. - * - * @param logicAppReceivers the logicAppReceivers value to set. - * @return the ActionGroupResourceInner object itself. - */ - public ActionGroupResourceInner withLogicAppReceivers(List logicAppReceivers) { - this.logicAppReceivers = logicAppReceivers; - return this; - } - - /** - * Get the azureFunctionReceivers property: The list of azure function receivers that are part of this action group. - * - * @return the azureFunctionReceivers value. - */ - public List azureFunctionReceivers() { - return this.azureFunctionReceivers; - } - - /** - * Set the azureFunctionReceivers property: The list of azure function receivers that are part of this action group. - * - * @param azureFunctionReceivers the azureFunctionReceivers value to set. - * @return the ActionGroupResourceInner object itself. - */ - public ActionGroupResourceInner withAzureFunctionReceivers(List azureFunctionReceivers) { - this.azureFunctionReceivers = azureFunctionReceivers; - return this; - } - - /** - * Get the armRoleReceivers property: The list of ARM role receivers that are part of this action group. Roles are - * Azure RBAC roles and only built-in roles are supported. - * - * @return the armRoleReceivers value. - */ - public List armRoleReceivers() { - return this.armRoleReceivers; - } - - /** - * Set the armRoleReceivers property: The list of ARM role receivers that are part of this action group. Roles are - * Azure RBAC roles and only built-in roles are supported. - * - * @param armRoleReceivers the armRoleReceivers value to set. - * @return the ActionGroupResourceInner object itself. - */ - public ActionGroupResourceInner withArmRoleReceivers(List armRoleReceivers) { - this.armRoleReceivers = armRoleReceivers; - return this; - } - - /** {@inheritDoc} */ - @Override - public ActionGroupResourceInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public ActionGroupResourceInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (emailReceivers() != null) { - emailReceivers().forEach(e -> e.validate()); - } - if (smsReceivers() != null) { - smsReceivers().forEach(e -> e.validate()); - } - if (webhookReceivers() != null) { - webhookReceivers().forEach(e -> e.validate()); - } - if (itsmReceivers() != null) { - itsmReceivers().forEach(e -> e.validate()); - } - if (azureAppPushReceivers() != null) { - azureAppPushReceivers().forEach(e -> e.validate()); - } - if (automationRunbookReceivers() != null) { - automationRunbookReceivers().forEach(e -> e.validate()); - } - if (voiceReceivers() != null) { - voiceReceivers().forEach(e -> e.validate()); - } - if (logicAppReceivers() != null) { - logicAppReceivers().forEach(e -> e.validate()); - } - if (azureFunctionReceivers() != null) { - azureFunctionReceivers().forEach(e -> e.validate()); - } - if (armRoleReceivers() != null) { - armRoleReceivers().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/ActivityLogAlertResourceInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/ActivityLogAlertResourceInner.java deleted file mode 100644 index 43f6049a45a9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/ActivityLogAlertResourceInner.java +++ /dev/null @@ -1,190 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.models.ActivityLogAlertActionList; -import com.azure.resourcemanager.monitor.models.ActivityLogAlertAllOfCondition; -import com.azure.resourcemanager.monitor.models.ResourceAutoGenerated2; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** An activity log alert resource. */ -@JsonFlatten -@Fluent -public class ActivityLogAlertResourceInner extends ResourceAutoGenerated2 { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ActivityLogAlertResourceInner.class); - - /* - * A list of resourceIds that will be used as prefixes. The alert will only - * apply to activityLogs with resourceIds that fall under one of these - * prefixes. This list must include at least one item. - */ - @JsonProperty(value = "properties.scopes") - private List scopes; - - /* - * Indicates whether this activity log alert is enabled. If an activity log - * alert is not enabled, then none of its actions will be activated. - */ - @JsonProperty(value = "properties.enabled") - private Boolean enabled; - - /* - * The condition that will cause this alert to activate. - */ - @JsonProperty(value = "properties.condition") - private ActivityLogAlertAllOfCondition condition; - - /* - * The actions that will activate when the condition is met. - */ - @JsonProperty(value = "properties.actions") - private ActivityLogAlertActionList actions; - - /* - * A description of this activity log alert. - */ - @JsonProperty(value = "properties.description") - private String description; - - /** - * Get the scopes property: A list of resourceIds that will be used as prefixes. The alert will only apply to - * activityLogs with resourceIds that fall under one of these prefixes. This list must include at least one item. - * - * @return the scopes value. - */ - public List scopes() { - return this.scopes; - } - - /** - * Set the scopes property: A list of resourceIds that will be used as prefixes. The alert will only apply to - * activityLogs with resourceIds that fall under one of these prefixes. This list must include at least one item. - * - * @param scopes the scopes value to set. - * @return the ActivityLogAlertResourceInner object itself. - */ - public ActivityLogAlertResourceInner withScopes(List scopes) { - this.scopes = scopes; - return this; - } - - /** - * Get the enabled property: Indicates whether this activity log alert is enabled. If an activity log alert is not - * enabled, then none of its actions will be activated. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Indicates whether this activity log alert is enabled. If an activity log alert is not - * enabled, then none of its actions will be activated. - * - * @param enabled the enabled value to set. - * @return the ActivityLogAlertResourceInner object itself. - */ - public ActivityLogAlertResourceInner withEnabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the condition property: The condition that will cause this alert to activate. - * - * @return the condition value. - */ - public ActivityLogAlertAllOfCondition condition() { - return this.condition; - } - - /** - * Set the condition property: The condition that will cause this alert to activate. - * - * @param condition the condition value to set. - * @return the ActivityLogAlertResourceInner object itself. - */ - public ActivityLogAlertResourceInner withCondition(ActivityLogAlertAllOfCondition condition) { - this.condition = condition; - return this; - } - - /** - * Get the actions property: The actions that will activate when the condition is met. - * - * @return the actions value. - */ - public ActivityLogAlertActionList actions() { - return this.actions; - } - - /** - * Set the actions property: The actions that will activate when the condition is met. - * - * @param actions the actions value to set. - * @return the ActivityLogAlertResourceInner object itself. - */ - public ActivityLogAlertResourceInner withActions(ActivityLogAlertActionList actions) { - this.actions = actions; - return this; - } - - /** - * Get the description property: A description of this activity log alert. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: A description of this activity log alert. - * - * @param description the description value to set. - * @return the ActivityLogAlertResourceInner object itself. - */ - public ActivityLogAlertResourceInner withDescription(String description) { - this.description = description; - return this; - } - - /** {@inheritDoc} */ - @Override - public ActivityLogAlertResourceInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public ActivityLogAlertResourceInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (condition() != null) { - condition().validate(); - } - if (actions() != null) { - actions().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/AlertRuleResourceInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/AlertRuleResourceInner.java deleted file mode 100644 index 88269c36dc39..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/AlertRuleResourceInner.java +++ /dev/null @@ -1,270 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.models.RuleAction; -import com.azure.resourcemanager.monitor.models.RuleCondition; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; -import java.util.Map; - -/** The alert rule resource. */ -@JsonFlatten -@Fluent -public class AlertRuleResourceInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AlertRuleResourceInner.class); - - /* - * the name of the alert rule. - */ - @JsonProperty(value = "properties.name", required = true) - private String namePropertiesName; - - /* - * the description of the alert rule that will be included in the alert - * email. - */ - @JsonProperty(value = "properties.description") - private String description; - - /* - * the provisioning state. - */ - @JsonProperty(value = "properties.provisioningState") - private String provisioningState; - - /* - * the flag that indicates whether the alert rule is enabled. - */ - @JsonProperty(value = "properties.isEnabled", required = true) - private boolean isEnabled; - - /* - * the condition that results in the alert rule being activated. - */ - @JsonProperty(value = "properties.condition", required = true) - private RuleCondition condition; - - /* - * action that is performed when the alert rule becomes active, and when an - * alert condition is resolved. - */ - @JsonProperty(value = "properties.action") - private RuleAction action; - - /* - * the array of actions that are performed when the alert rule becomes - * active, and when an alert condition is resolved. - */ - @JsonProperty(value = "properties.actions") - private List actions; - - /* - * Last time the rule was updated in ISO8601 format. - */ - @JsonProperty(value = "properties.lastUpdatedTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime lastUpdatedTime; - - /** - * Get the namePropertiesName property: the name of the alert rule. - * - * @return the namePropertiesName value. - */ - public String namePropertiesName() { - return this.namePropertiesName; - } - - /** - * Set the namePropertiesName property: the name of the alert rule. - * - * @param namePropertiesName the namePropertiesName value to set. - * @return the AlertRuleResourceInner object itself. - */ - public AlertRuleResourceInner withNamePropertiesName(String namePropertiesName) { - this.namePropertiesName = namePropertiesName; - return this; - } - - /** - * Get the description property: the description of the alert rule that will be included in the alert email. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: the description of the alert rule that will be included in the alert email. - * - * @param description the description value to set. - * @return the AlertRuleResourceInner object itself. - */ - public AlertRuleResourceInner withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the provisioningState property: the provisioning state. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Set the provisioningState property: the provisioning state. - * - * @param provisioningState the provisioningState value to set. - * @return the AlertRuleResourceInner object itself. - */ - public AlertRuleResourceInner withProvisioningState(String provisioningState) { - this.provisioningState = provisioningState; - return this; - } - - /** - * Get the isEnabled property: the flag that indicates whether the alert rule is enabled. - * - * @return the isEnabled value. - */ - public boolean isEnabled() { - return this.isEnabled; - } - - /** - * Set the isEnabled property: the flag that indicates whether the alert rule is enabled. - * - * @param isEnabled the isEnabled value to set. - * @return the AlertRuleResourceInner object itself. - */ - public AlertRuleResourceInner withIsEnabled(boolean isEnabled) { - this.isEnabled = isEnabled; - return this; - } - - /** - * Get the condition property: the condition that results in the alert rule being activated. - * - * @return the condition value. - */ - public RuleCondition condition() { - return this.condition; - } - - /** - * Set the condition property: the condition that results in the alert rule being activated. - * - * @param condition the condition value to set. - * @return the AlertRuleResourceInner object itself. - */ - public AlertRuleResourceInner withCondition(RuleCondition condition) { - this.condition = condition; - return this; - } - - /** - * Get the action property: action that is performed when the alert rule becomes active, and when an alert condition - * is resolved. - * - * @return the action value. - */ - public RuleAction action() { - return this.action; - } - - /** - * Set the action property: action that is performed when the alert rule becomes active, and when an alert condition - * is resolved. - * - * @param action the action value to set. - * @return the AlertRuleResourceInner object itself. - */ - public AlertRuleResourceInner withAction(RuleAction action) { - this.action = action; - return this; - } - - /** - * Get the actions property: the array of actions that are performed when the alert rule becomes active, and when an - * alert condition is resolved. - * - * @return the actions value. - */ - public List actions() { - return this.actions; - } - - /** - * Set the actions property: the array of actions that are performed when the alert rule becomes active, and when an - * alert condition is resolved. - * - * @param actions the actions value to set. - * @return the AlertRuleResourceInner object itself. - */ - public AlertRuleResourceInner withActions(List actions) { - this.actions = actions; - return this; - } - - /** - * Get the lastUpdatedTime property: Last time the rule was updated in ISO8601 format. - * - * @return the lastUpdatedTime value. - */ - public OffsetDateTime lastUpdatedTime() { - return this.lastUpdatedTime; - } - - /** {@inheritDoc} */ - @Override - public AlertRuleResourceInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public AlertRuleResourceInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (namePropertiesName() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property namePropertiesName in model AlertRuleResourceInner")); - } - if (condition() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property condition in model AlertRuleResourceInner")); - } else { - condition().validate(); - } - if (action() != null) { - action().validate(); - } - if (actions() != null) { - actions().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/AutoscaleProfileInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/AutoscaleProfileInner.java deleted file mode 100644 index dc493953621f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/AutoscaleProfileInner.java +++ /dev/null @@ -1,192 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.models.Recurrence; -import com.azure.resourcemanager.monitor.models.ScaleCapacity; -import com.azure.resourcemanager.monitor.models.TimeWindow; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Autoscale profile. */ -@Fluent -public final class AutoscaleProfileInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AutoscaleProfileInner.class); - - /* - * the name of the profile. - */ - @JsonProperty(value = "name", required = true) - private String name; - - /* - * the number of instances that can be used during this profile. - */ - @JsonProperty(value = "capacity", required = true) - private ScaleCapacity capacity; - - /* - * the collection of rules that provide the triggers and parameters for the - * scaling action. A maximum of 10 rules can be specified. - */ - @JsonProperty(value = "rules", required = true) - private List rules; - - /* - * the specific date-time for the profile. This element is not used if the - * Recurrence element is used. - */ - @JsonProperty(value = "fixedDate") - private TimeWindow fixedDate; - - /* - * the repeating times at which this profile begins. This element is not - * used if the FixedDate element is used. - */ - @JsonProperty(value = "recurrence") - private Recurrence recurrence; - - /** - * Get the name property: the name of the profile. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: the name of the profile. - * - * @param name the name value to set. - * @return the AutoscaleProfileInner object itself. - */ - public AutoscaleProfileInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the capacity property: the number of instances that can be used during this profile. - * - * @return the capacity value. - */ - public ScaleCapacity capacity() { - return this.capacity; - } - - /** - * Set the capacity property: the number of instances that can be used during this profile. - * - * @param capacity the capacity value to set. - * @return the AutoscaleProfileInner object itself. - */ - public AutoscaleProfileInner withCapacity(ScaleCapacity capacity) { - this.capacity = capacity; - return this; - } - - /** - * Get the rules property: the collection of rules that provide the triggers and parameters for the scaling action. - * A maximum of 10 rules can be specified. - * - * @return the rules value. - */ - public List rules() { - return this.rules; - } - - /** - * Set the rules property: the collection of rules that provide the triggers and parameters for the scaling action. - * A maximum of 10 rules can be specified. - * - * @param rules the rules value to set. - * @return the AutoscaleProfileInner object itself. - */ - public AutoscaleProfileInner withRules(List rules) { - this.rules = rules; - return this; - } - - /** - * Get the fixedDate property: the specific date-time for the profile. This element is not used if the Recurrence - * element is used. - * - * @return the fixedDate value. - */ - public TimeWindow fixedDate() { - return this.fixedDate; - } - - /** - * Set the fixedDate property: the specific date-time for the profile. This element is not used if the Recurrence - * element is used. - * - * @param fixedDate the fixedDate value to set. - * @return the AutoscaleProfileInner object itself. - */ - public AutoscaleProfileInner withFixedDate(TimeWindow fixedDate) { - this.fixedDate = fixedDate; - return this; - } - - /** - * Get the recurrence property: the repeating times at which this profile begins. This element is not used if the - * FixedDate element is used. - * - * @return the recurrence value. - */ - public Recurrence recurrence() { - return this.recurrence; - } - - /** - * Set the recurrence property: the repeating times at which this profile begins. This element is not used if the - * FixedDate element is used. - * - * @param recurrence the recurrence value to set. - * @return the AutoscaleProfileInner object itself. - */ - public AutoscaleProfileInner withRecurrence(Recurrence recurrence) { - this.recurrence = recurrence; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property name in model AutoscaleProfileInner")); - } - if (capacity() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property capacity in model AutoscaleProfileInner")); - } else { - capacity().validate(); - } - if (rules() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property rules in model AutoscaleProfileInner")); - } else { - rules().forEach(e -> e.validate()); - } - if (fixedDate() != null) { - fixedDate().validate(); - } - if (recurrence() != null) { - recurrence().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/AutoscaleSettingResourceInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/AutoscaleSettingResourceInner.java deleted file mode 100644 index 020cc93666d7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/AutoscaleSettingResourceInner.java +++ /dev/null @@ -1,224 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.models.AutoscaleNotification; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** The autoscale setting resource. */ -@JsonFlatten -@Fluent -public class AutoscaleSettingResourceInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AutoscaleSettingResourceInner.class); - - /* - * the collection of automatic scaling profiles that specify different - * scaling parameters for different time periods. A maximum of 20 profiles - * can be specified. - */ - @JsonProperty(value = "properties.profiles", required = true) - private List profiles; - - /* - * the collection of notifications. - */ - @JsonProperty(value = "properties.notifications") - private List notifications; - - /* - * the enabled flag. Specifies whether automatic scaling is enabled for the - * resource. The default value is 'true'. - */ - @JsonProperty(value = "properties.enabled") - private Boolean enabled; - - /* - * the name of the autoscale setting. - */ - @JsonProperty(value = "properties.name") - private String namePropertiesName; - - /* - * the resource identifier of the resource that the autoscale setting - * should be added to. - */ - @JsonProperty(value = "properties.targetResourceUri") - private String targetResourceUri; - - /* - * the location of the resource that the autoscale setting should be added - * to. - */ - @JsonProperty(value = "properties.targetResourceLocation") - private String targetResourceLocation; - - /** - * Get the profiles property: the collection of automatic scaling profiles that specify different scaling parameters - * for different time periods. A maximum of 20 profiles can be specified. - * - * @return the profiles value. - */ - public List profiles() { - return this.profiles; - } - - /** - * Set the profiles property: the collection of automatic scaling profiles that specify different scaling parameters - * for different time periods. A maximum of 20 profiles can be specified. - * - * @param profiles the profiles value to set. - * @return the AutoscaleSettingResourceInner object itself. - */ - public AutoscaleSettingResourceInner withProfiles(List profiles) { - this.profiles = profiles; - return this; - } - - /** - * Get the notifications property: the collection of notifications. - * - * @return the notifications value. - */ - public List notifications() { - return this.notifications; - } - - /** - * Set the notifications property: the collection of notifications. - * - * @param notifications the notifications value to set. - * @return the AutoscaleSettingResourceInner object itself. - */ - public AutoscaleSettingResourceInner withNotifications(List notifications) { - this.notifications = notifications; - return this; - } - - /** - * Get the enabled property: the enabled flag. Specifies whether automatic scaling is enabled for the resource. The - * default value is 'true'. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: the enabled flag. Specifies whether automatic scaling is enabled for the resource. The - * default value is 'true'. - * - * @param enabled the enabled value to set. - * @return the AutoscaleSettingResourceInner object itself. - */ - public AutoscaleSettingResourceInner withEnabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the namePropertiesName property: the name of the autoscale setting. - * - * @return the namePropertiesName value. - */ - public String namePropertiesName() { - return this.namePropertiesName; - } - - /** - * Set the namePropertiesName property: the name of the autoscale setting. - * - * @param namePropertiesName the namePropertiesName value to set. - * @return the AutoscaleSettingResourceInner object itself. - */ - public AutoscaleSettingResourceInner withNamePropertiesName(String namePropertiesName) { - this.namePropertiesName = namePropertiesName; - return this; - } - - /** - * Get the targetResourceUri property: the resource identifier of the resource that the autoscale setting should be - * added to. - * - * @return the targetResourceUri value. - */ - public String targetResourceUri() { - return this.targetResourceUri; - } - - /** - * Set the targetResourceUri property: the resource identifier of the resource that the autoscale setting should be - * added to. - * - * @param targetResourceUri the targetResourceUri value to set. - * @return the AutoscaleSettingResourceInner object itself. - */ - public AutoscaleSettingResourceInner withTargetResourceUri(String targetResourceUri) { - this.targetResourceUri = targetResourceUri; - return this; - } - - /** - * Get the targetResourceLocation property: the location of the resource that the autoscale setting should be added - * to. - * - * @return the targetResourceLocation value. - */ - public String targetResourceLocation() { - return this.targetResourceLocation; - } - - /** - * Set the targetResourceLocation property: the location of the resource that the autoscale setting should be added - * to. - * - * @param targetResourceLocation the targetResourceLocation value to set. - * @return the AutoscaleSettingResourceInner object itself. - */ - public AutoscaleSettingResourceInner withTargetResourceLocation(String targetResourceLocation) { - this.targetResourceLocation = targetResourceLocation; - return this; - } - - /** {@inheritDoc} */ - @Override - public AutoscaleSettingResourceInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public AutoscaleSettingResourceInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (profiles() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property profiles in model AutoscaleSettingResourceInner")); - } else { - profiles().forEach(e -> e.validate()); - } - if (notifications() != null) { - notifications().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/AzureMonitorPrivateLinkScopeInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/AzureMonitorPrivateLinkScopeInner.java deleted file mode 100644 index ef34d5344520..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/AzureMonitorPrivateLinkScopeInner.java +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.models.PrivateLinkScopesResource; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** An Azure Monitor PrivateLinkScope definition. */ -@JsonFlatten -@Fluent -public class AzureMonitorPrivateLinkScopeInner extends PrivateLinkScopesResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureMonitorPrivateLinkScopeInner.class); - - /* - * Current state of this PrivateLinkScope: whether or not is has been - * provisioned within the resource group it is defined. Users cannot change - * this value but are able to read from it. Values will include - * Provisioning ,Succeeded, Canceled and Failed. - */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; - - /* - * List of private endpoint connections. - */ - @JsonProperty(value = "properties.privateEndpointConnections", access = JsonProperty.Access.WRITE_ONLY) - private List privateEndpointConnections; - - /** - * Get the provisioningState property: Current state of this PrivateLinkScope: whether or not is has been - * provisioned within the resource group it is defined. Users cannot change this value but are able to read from it. - * Values will include Provisioning ,Succeeded, Canceled and Failed. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Get the privateEndpointConnections property: List of private endpoint connections. - * - * @return the privateEndpointConnections value. - */ - public List privateEndpointConnections() { - return this.privateEndpointConnections; - } - - /** {@inheritDoc} */ - @Override - public AzureMonitorPrivateLinkScopeInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public AzureMonitorPrivateLinkScopeInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (privateEndpointConnections() != null) { - privateEndpointConnections().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/DataCollectionEndpointResourceInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/DataCollectionEndpointResourceInner.java deleted file mode 100644 index 620e2a0a126d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/DataCollectionEndpointResourceInner.java +++ /dev/null @@ -1,262 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.management.Resource; -import com.azure.core.management.SystemData; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.models.DataCollectionEndpointConfigurationAccess; -import com.azure.resourcemanager.monitor.models.DataCollectionEndpointLogsIngestion; -import com.azure.resourcemanager.monitor.models.DataCollectionEndpointNetworkAcls; -import com.azure.resourcemanager.monitor.models.KnownDataCollectionEndpointProvisioningState; -import com.azure.resourcemanager.monitor.models.KnownDataCollectionEndpointResourceKind; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** Definition of ARM tracked top level resource. */ -@JsonFlatten -@Fluent -public class DataCollectionEndpointResourceInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DataCollectionEndpointResourceInner.class); - - /* - * The kind of the resource. - */ - @JsonProperty(value = "kind") - private KnownDataCollectionEndpointResourceKind kind; - - /* - * Resource entity tag (ETag). - */ - @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) - private String etag; - - /* - * Metadata pertaining to creation and last modification of the resource. - */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) - private SystemData systemData; - - /* - * Description of the data collection endpoint. - */ - @JsonProperty(value = "properties.description") - private String description; - - /* - * The immutable ID of this data collection endpoint resource. This - * property is READ-ONLY. - */ - @JsonProperty(value = "properties.immutableId") - private String immutableId; - - /* - * The endpoint used by agents to access their configuration. - */ - @JsonProperty(value = "properties.configurationAccess") - private DataCollectionEndpointConfigurationAccess configurationAccess; - - /* - * The endpoint used by clients to ingest logs. - */ - @JsonProperty(value = "properties.logsIngestion") - private DataCollectionEndpointLogsIngestion logsIngestion; - - /* - * Network access control rules for the endpoints. - */ - @JsonProperty(value = "properties.networkAcls") - private DataCollectionEndpointNetworkAcls networkAcls; - - /* - * The resource provisioning state. This property is READ-ONLY. - */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private KnownDataCollectionEndpointProvisioningState provisioningState; - - /** - * Get the kind property: The kind of the resource. - * - * @return the kind value. - */ - public KnownDataCollectionEndpointResourceKind kind() { - return this.kind; - } - - /** - * Set the kind property: The kind of the resource. - * - * @param kind the kind value to set. - * @return the DataCollectionEndpointResourceInner object itself. - */ - public DataCollectionEndpointResourceInner withKind(KnownDataCollectionEndpointResourceKind kind) { - this.kind = kind; - return this; - } - - /** - * Get the etag property: Resource entity tag (ETag). - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Get the systemData property: Metadata pertaining to creation and last modification of the resource. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the description property: Description of the data collection endpoint. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: Description of the data collection endpoint. - * - * @param description the description value to set. - * @return the DataCollectionEndpointResourceInner object itself. - */ - public DataCollectionEndpointResourceInner withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the immutableId property: The immutable ID of this data collection endpoint resource. This property is - * READ-ONLY. - * - * @return the immutableId value. - */ - public String immutableId() { - return this.immutableId; - } - - /** - * Set the immutableId property: The immutable ID of this data collection endpoint resource. This property is - * READ-ONLY. - * - * @param immutableId the immutableId value to set. - * @return the DataCollectionEndpointResourceInner object itself. - */ - public DataCollectionEndpointResourceInner withImmutableId(String immutableId) { - this.immutableId = immutableId; - return this; - } - - /** - * Get the configurationAccess property: The endpoint used by agents to access their configuration. - * - * @return the configurationAccess value. - */ - public DataCollectionEndpointConfigurationAccess configurationAccess() { - return this.configurationAccess; - } - - /** - * Set the configurationAccess property: The endpoint used by agents to access their configuration. - * - * @param configurationAccess the configurationAccess value to set. - * @return the DataCollectionEndpointResourceInner object itself. - */ - public DataCollectionEndpointResourceInner withConfigurationAccess( - DataCollectionEndpointConfigurationAccess configurationAccess) { - this.configurationAccess = configurationAccess; - return this; - } - - /** - * Get the logsIngestion property: The endpoint used by clients to ingest logs. - * - * @return the logsIngestion value. - */ - public DataCollectionEndpointLogsIngestion logsIngestion() { - return this.logsIngestion; - } - - /** - * Set the logsIngestion property: The endpoint used by clients to ingest logs. - * - * @param logsIngestion the logsIngestion value to set. - * @return the DataCollectionEndpointResourceInner object itself. - */ - public DataCollectionEndpointResourceInner withLogsIngestion(DataCollectionEndpointLogsIngestion logsIngestion) { - this.logsIngestion = logsIngestion; - return this; - } - - /** - * Get the networkAcls property: Network access control rules for the endpoints. - * - * @return the networkAcls value. - */ - public DataCollectionEndpointNetworkAcls networkAcls() { - return this.networkAcls; - } - - /** - * Set the networkAcls property: Network access control rules for the endpoints. - * - * @param networkAcls the networkAcls value to set. - * @return the DataCollectionEndpointResourceInner object itself. - */ - public DataCollectionEndpointResourceInner withNetworkAcls(DataCollectionEndpointNetworkAcls networkAcls) { - this.networkAcls = networkAcls; - return this; - } - - /** - * Get the provisioningState property: The resource provisioning state. This property is READ-ONLY. - * - * @return the provisioningState value. - */ - public KnownDataCollectionEndpointProvisioningState provisioningState() { - return this.provisioningState; - } - - /** {@inheritDoc} */ - @Override - public DataCollectionEndpointResourceInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public DataCollectionEndpointResourceInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (configurationAccess() != null) { - configurationAccess().validate(); - } - if (logsIngestion() != null) { - logsIngestion().validate(); - } - if (networkAcls() != null) { - networkAcls().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/DataCollectionRuleAssociationProxyOnlyResourceInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/DataCollectionRuleAssociationProxyOnlyResourceInner.java deleted file mode 100644 index 8f78862e6dd7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/DataCollectionRuleAssociationProxyOnlyResourceInner.java +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.models.KnownDataCollectionRuleAssociationProvisioningState; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Definition of generic ARM proxy resource. */ -@JsonFlatten -@Fluent -public class DataCollectionRuleAssociationProxyOnlyResourceInner extends ProxyResource { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(DataCollectionRuleAssociationProxyOnlyResourceInner.class); - - /* - * Resource entity tag (ETag). - */ - @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) - private String etag; - - /* - * Metadata pertaining to creation and last modification of the resource. - */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) - private SystemData systemData; - - /* - * Description of the association. - */ - @JsonProperty(value = "properties.description") - private String description; - - /* - * The resource ID of the data collection rule that is to be associated. - */ - @JsonProperty(value = "properties.dataCollectionRuleId") - private String dataCollectionRuleId; - - /* - * The resource ID of the data collection endpoint that is to be - * associated. - */ - @JsonProperty(value = "properties.dataCollectionEndpointId") - private String dataCollectionEndpointId; - - /* - * The resource provisioning state. - */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private KnownDataCollectionRuleAssociationProvisioningState provisioningState; - - /** - * Get the etag property: Resource entity tag (ETag). - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Get the systemData property: Metadata pertaining to creation and last modification of the resource. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the description property: Description of the association. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: Description of the association. - * - * @param description the description value to set. - * @return the DataCollectionRuleAssociationProxyOnlyResourceInner object itself. - */ - public DataCollectionRuleAssociationProxyOnlyResourceInner withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the dataCollectionRuleId property: The resource ID of the data collection rule that is to be associated. - * - * @return the dataCollectionRuleId value. - */ - public String dataCollectionRuleId() { - return this.dataCollectionRuleId; - } - - /** - * Set the dataCollectionRuleId property: The resource ID of the data collection rule that is to be associated. - * - * @param dataCollectionRuleId the dataCollectionRuleId value to set. - * @return the DataCollectionRuleAssociationProxyOnlyResourceInner object itself. - */ - public DataCollectionRuleAssociationProxyOnlyResourceInner withDataCollectionRuleId(String dataCollectionRuleId) { - this.dataCollectionRuleId = dataCollectionRuleId; - return this; - } - - /** - * Get the dataCollectionEndpointId property: The resource ID of the data collection endpoint that is to be - * associated. - * - * @return the dataCollectionEndpointId value. - */ - public String dataCollectionEndpointId() { - return this.dataCollectionEndpointId; - } - - /** - * Set the dataCollectionEndpointId property: The resource ID of the data collection endpoint that is to be - * associated. - * - * @param dataCollectionEndpointId the dataCollectionEndpointId value to set. - * @return the DataCollectionRuleAssociationProxyOnlyResourceInner object itself. - */ - public DataCollectionRuleAssociationProxyOnlyResourceInner withDataCollectionEndpointId( - String dataCollectionEndpointId) { - this.dataCollectionEndpointId = dataCollectionEndpointId; - return this; - } - - /** - * Get the provisioningState property: The resource provisioning state. - * - * @return the provisioningState value. - */ - public KnownDataCollectionRuleAssociationProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/DataCollectionRuleResourceInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/DataCollectionRuleResourceInner.java deleted file mode 100644 index 8dc38767cbf8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/DataCollectionRuleResourceInner.java +++ /dev/null @@ -1,253 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.management.Resource; -import com.azure.core.management.SystemData; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.models.DataCollectionRuleDataSources; -import com.azure.resourcemanager.monitor.models.DataCollectionRuleDestinations; -import com.azure.resourcemanager.monitor.models.DataFlow; -import com.azure.resourcemanager.monitor.models.KnownDataCollectionRuleProvisioningState; -import com.azure.resourcemanager.monitor.models.KnownDataCollectionRuleResourceKind; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** Definition of ARM tracked top level resource. */ -@JsonFlatten -@Fluent -public class DataCollectionRuleResourceInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DataCollectionRuleResourceInner.class); - - /* - * The kind of the resource. - */ - @JsonProperty(value = "kind") - private KnownDataCollectionRuleResourceKind kind; - - /* - * Resource entity tag (ETag). - */ - @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) - private String etag; - - /* - * Metadata pertaining to creation and last modification of the resource. - */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) - private SystemData systemData; - - /* - * Description of the data collection rule. - */ - @JsonProperty(value = "properties.description") - private String description; - - /* - * The immutable ID of this data collection rule. This property is - * READ-ONLY. - */ - @JsonProperty(value = "properties.immutableId", access = JsonProperty.Access.WRITE_ONLY) - private String immutableId; - - /* - * The specification of data sources. - * This property is optional and can be omitted if the rule is meant to be - * used via direct calls to the provisioned endpoint. - */ - @JsonProperty(value = "properties.dataSources") - private DataCollectionRuleDataSources dataSources; - - /* - * The specification of destinations. - */ - @JsonProperty(value = "properties.destinations") - private DataCollectionRuleDestinations destinations; - - /* - * The specification of data flows. - */ - @JsonProperty(value = "properties.dataFlows") - private List dataFlows; - - /* - * The resource provisioning state. - */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private KnownDataCollectionRuleProvisioningState provisioningState; - - /** - * Get the kind property: The kind of the resource. - * - * @return the kind value. - */ - public KnownDataCollectionRuleResourceKind kind() { - return this.kind; - } - - /** - * Set the kind property: The kind of the resource. - * - * @param kind the kind value to set. - * @return the DataCollectionRuleResourceInner object itself. - */ - public DataCollectionRuleResourceInner withKind(KnownDataCollectionRuleResourceKind kind) { - this.kind = kind; - return this; - } - - /** - * Get the etag property: Resource entity tag (ETag). - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Get the systemData property: Metadata pertaining to creation and last modification of the resource. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the description property: Description of the data collection rule. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: Description of the data collection rule. - * - * @param description the description value to set. - * @return the DataCollectionRuleResourceInner object itself. - */ - public DataCollectionRuleResourceInner withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the immutableId property: The immutable ID of this data collection rule. This property is READ-ONLY. - * - * @return the immutableId value. - */ - public String immutableId() { - return this.immutableId; - } - - /** - * Get the dataSources property: The specification of data sources. This property is optional and can be omitted if - * the rule is meant to be used via direct calls to the provisioned endpoint. - * - * @return the dataSources value. - */ - public DataCollectionRuleDataSources dataSources() { - return this.dataSources; - } - - /** - * Set the dataSources property: The specification of data sources. This property is optional and can be omitted if - * the rule is meant to be used via direct calls to the provisioned endpoint. - * - * @param dataSources the dataSources value to set. - * @return the DataCollectionRuleResourceInner object itself. - */ - public DataCollectionRuleResourceInner withDataSources(DataCollectionRuleDataSources dataSources) { - this.dataSources = dataSources; - return this; - } - - /** - * Get the destinations property: The specification of destinations. - * - * @return the destinations value. - */ - public DataCollectionRuleDestinations destinations() { - return this.destinations; - } - - /** - * Set the destinations property: The specification of destinations. - * - * @param destinations the destinations value to set. - * @return the DataCollectionRuleResourceInner object itself. - */ - public DataCollectionRuleResourceInner withDestinations(DataCollectionRuleDestinations destinations) { - this.destinations = destinations; - return this; - } - - /** - * Get the dataFlows property: The specification of data flows. - * - * @return the dataFlows value. - */ - public List dataFlows() { - return this.dataFlows; - } - - /** - * Set the dataFlows property: The specification of data flows. - * - * @param dataFlows the dataFlows value to set. - * @return the DataCollectionRuleResourceInner object itself. - */ - public DataCollectionRuleResourceInner withDataFlows(List dataFlows) { - this.dataFlows = dataFlows; - return this; - } - - /** - * Get the provisioningState property: The resource provisioning state. - * - * @return the provisioningState value. - */ - public KnownDataCollectionRuleProvisioningState provisioningState() { - return this.provisioningState; - } - - /** {@inheritDoc} */ - @Override - public DataCollectionRuleResourceInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public DataCollectionRuleResourceInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (dataSources() != null) { - dataSources().validate(); - } - if (destinations() != null) { - destinations().validate(); - } - if (dataFlows() != null) { - dataFlows().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/DiagnosticSettingsCategoryResourceCollectionInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/DiagnosticSettingsCategoryResourceCollectionInner.java deleted file mode 100644 index 16da6fc62d94..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/DiagnosticSettingsCategoryResourceCollectionInner.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Represents a collection of diagnostic setting category resources. */ -@Fluent -public final class DiagnosticSettingsCategoryResourceCollectionInner { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(DiagnosticSettingsCategoryResourceCollectionInner.class); - - /* - * The collection of diagnostic settings category resources. - */ - @JsonProperty(value = "value") - private List value; - - /** - * Get the value property: The collection of diagnostic settings category resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The collection of diagnostic settings category resources. - * - * @param value the value value to set. - * @return the DiagnosticSettingsCategoryResourceCollectionInner object itself. - */ - public DiagnosticSettingsCategoryResourceCollectionInner withValue( - List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/DiagnosticSettingsCategoryResourceInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/DiagnosticSettingsCategoryResourceInner.java deleted file mode 100644 index e22b33f8e0ee..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/DiagnosticSettingsCategoryResourceInner.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.models.CategoryType; -import com.azure.resourcemanager.monitor.models.ProxyOnlyResource; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The diagnostic settings category resource. */ -@JsonFlatten -@Fluent -public class DiagnosticSettingsCategoryResourceInner extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DiagnosticSettingsCategoryResourceInner.class); - - /* - * The type of the diagnostic settings category. - */ - @JsonProperty(value = "properties.categoryType") - private CategoryType categoryType; - - /** - * Get the categoryType property: The type of the diagnostic settings category. - * - * @return the categoryType value. - */ - public CategoryType categoryType() { - return this.categoryType; - } - - /** - * Set the categoryType property: The type of the diagnostic settings category. - * - * @param categoryType the categoryType value to set. - * @return the DiagnosticSettingsCategoryResourceInner object itself. - */ - public DiagnosticSettingsCategoryResourceInner withCategoryType(CategoryType categoryType) { - this.categoryType = categoryType; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/DiagnosticSettingsResourceCollectionInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/DiagnosticSettingsResourceCollectionInner.java deleted file mode 100644 index 8d012850bf03..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/DiagnosticSettingsResourceCollectionInner.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Represents a collection of alert rule resources. */ -@Fluent -public final class DiagnosticSettingsResourceCollectionInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DiagnosticSettingsResourceCollectionInner.class); - - /* - * The collection of diagnostic settings resources;. - */ - @JsonProperty(value = "value") - private List value; - - /** - * Get the value property: The collection of diagnostic settings resources;. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The collection of diagnostic settings resources;. - * - * @param value the value value to set. - * @return the DiagnosticSettingsResourceCollectionInner object itself. - */ - public DiagnosticSettingsResourceCollectionInner withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/DiagnosticSettingsResourceInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/DiagnosticSettingsResourceInner.java deleted file mode 100644 index 02de0a55beee..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/DiagnosticSettingsResourceInner.java +++ /dev/null @@ -1,271 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.models.LogSettings; -import com.azure.resourcemanager.monitor.models.MetricSettings; -import com.azure.resourcemanager.monitor.models.ProxyOnlyResource; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The diagnostic setting resource. */ -@JsonFlatten -@Fluent -public class DiagnosticSettingsResourceInner extends ProxyOnlyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DiagnosticSettingsResourceInner.class); - - /* - * The resource ID of the storage account to which you would like to send - * Diagnostic Logs. - */ - @JsonProperty(value = "properties.storageAccountId") - private String storageAccountId; - - /* - * The service bus rule Id of the diagnostic setting. This is here to - * maintain backwards compatibility. - */ - @JsonProperty(value = "properties.serviceBusRuleId") - private String serviceBusRuleId; - - /* - * The resource Id for the event hub authorization rule. - */ - @JsonProperty(value = "properties.eventHubAuthorizationRuleId") - private String eventHubAuthorizationRuleId; - - /* - * The name of the event hub. If none is specified, the default event hub - * will be selected. - */ - @JsonProperty(value = "properties.eventHubName") - private String eventHubName; - - /* - * The list of metric settings. - */ - @JsonProperty(value = "properties.metrics") - private List metrics; - - /* - * The list of logs settings. - */ - @JsonProperty(value = "properties.logs") - private List logs; - - /* - * The full ARM resource ID of the Log Analytics workspace to which you - * would like to send Diagnostic Logs. Example: - * /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2 - */ - @JsonProperty(value = "properties.workspaceId") - private String workspaceId; - - /* - * A string indicating whether the export to Log Analytics should use the - * default destination type, i.e. AzureDiagnostics, or use a destination - * type constructed as follows: _. Possible values are: Dedicated and null (null is - * default.) - */ - @JsonProperty(value = "properties.logAnalyticsDestinationType") - private String logAnalyticsDestinationType; - - /** - * Get the storageAccountId property: The resource ID of the storage account to which you would like to send - * Diagnostic Logs. - * - * @return the storageAccountId value. - */ - public String storageAccountId() { - return this.storageAccountId; - } - - /** - * Set the storageAccountId property: The resource ID of the storage account to which you would like to send - * Diagnostic Logs. - * - * @param storageAccountId the storageAccountId value to set. - * @return the DiagnosticSettingsResourceInner object itself. - */ - public DiagnosticSettingsResourceInner withStorageAccountId(String storageAccountId) { - this.storageAccountId = storageAccountId; - return this; - } - - /** - * Get the serviceBusRuleId property: The service bus rule Id of the diagnostic setting. This is here to maintain - * backwards compatibility. - * - * @return the serviceBusRuleId value. - */ - public String serviceBusRuleId() { - return this.serviceBusRuleId; - } - - /** - * Set the serviceBusRuleId property: The service bus rule Id of the diagnostic setting. This is here to maintain - * backwards compatibility. - * - * @param serviceBusRuleId the serviceBusRuleId value to set. - * @return the DiagnosticSettingsResourceInner object itself. - */ - public DiagnosticSettingsResourceInner withServiceBusRuleId(String serviceBusRuleId) { - this.serviceBusRuleId = serviceBusRuleId; - return this; - } - - /** - * Get the eventHubAuthorizationRuleId property: The resource Id for the event hub authorization rule. - * - * @return the eventHubAuthorizationRuleId value. - */ - public String eventHubAuthorizationRuleId() { - return this.eventHubAuthorizationRuleId; - } - - /** - * Set the eventHubAuthorizationRuleId property: The resource Id for the event hub authorization rule. - * - * @param eventHubAuthorizationRuleId the eventHubAuthorizationRuleId value to set. - * @return the DiagnosticSettingsResourceInner object itself. - */ - public DiagnosticSettingsResourceInner withEventHubAuthorizationRuleId(String eventHubAuthorizationRuleId) { - this.eventHubAuthorizationRuleId = eventHubAuthorizationRuleId; - return this; - } - - /** - * Get the eventHubName property: The name of the event hub. If none is specified, the default event hub will be - * selected. - * - * @return the eventHubName value. - */ - public String eventHubName() { - return this.eventHubName; - } - - /** - * Set the eventHubName property: The name of the event hub. If none is specified, the default event hub will be - * selected. - * - * @param eventHubName the eventHubName value to set. - * @return the DiagnosticSettingsResourceInner object itself. - */ - public DiagnosticSettingsResourceInner withEventHubName(String eventHubName) { - this.eventHubName = eventHubName; - return this; - } - - /** - * Get the metrics property: The list of metric settings. - * - * @return the metrics value. - */ - public List metrics() { - return this.metrics; - } - - /** - * Set the metrics property: The list of metric settings. - * - * @param metrics the metrics value to set. - * @return the DiagnosticSettingsResourceInner object itself. - */ - public DiagnosticSettingsResourceInner withMetrics(List metrics) { - this.metrics = metrics; - return this; - } - - /** - * Get the logs property: The list of logs settings. - * - * @return the logs value. - */ - public List logs() { - return this.logs; - } - - /** - * Set the logs property: The list of logs settings. - * - * @param logs the logs value to set. - * @return the DiagnosticSettingsResourceInner object itself. - */ - public DiagnosticSettingsResourceInner withLogs(List logs) { - this.logs = logs; - return this; - } - - /** - * Get the workspaceId property: The full ARM resource ID of the Log Analytics workspace to which you would like to - * send Diagnostic Logs. Example: - * /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2. - * - * @return the workspaceId value. - */ - public String workspaceId() { - return this.workspaceId; - } - - /** - * Set the workspaceId property: The full ARM resource ID of the Log Analytics workspace to which you would like to - * send Diagnostic Logs. Example: - * /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2. - * - * @param workspaceId the workspaceId value to set. - * @return the DiagnosticSettingsResourceInner object itself. - */ - public DiagnosticSettingsResourceInner withWorkspaceId(String workspaceId) { - this.workspaceId = workspaceId; - return this; - } - - /** - * Get the logAnalyticsDestinationType property: A string indicating whether the export to Log Analytics should use - * the default destination type, i.e. AzureDiagnostics, or use a destination type constructed as follows: - * <normalized service identity>_<normalized category name>. Possible values are: Dedicated and null - * (null is default.). - * - * @return the logAnalyticsDestinationType value. - */ - public String logAnalyticsDestinationType() { - return this.logAnalyticsDestinationType; - } - - /** - * Set the logAnalyticsDestinationType property: A string indicating whether the export to Log Analytics should use - * the default destination type, i.e. AzureDiagnostics, or use a destination type constructed as follows: - * <normalized service identity>_<normalized category name>. Possible values are: Dedicated and null - * (null is default.). - * - * @param logAnalyticsDestinationType the logAnalyticsDestinationType value to set. - * @return the DiagnosticSettingsResourceInner object itself. - */ - public DiagnosticSettingsResourceInner withLogAnalyticsDestinationType(String logAnalyticsDestinationType) { - this.logAnalyticsDestinationType = logAnalyticsDestinationType; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (metrics() != null) { - metrics().forEach(e -> e.validate()); - } - if (logs() != null) { - logs().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/EventDataInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/EventDataInner.java deleted file mode 100644 index 1b0a9c3a14be..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/EventDataInner.java +++ /dev/null @@ -1,453 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.models.EventLevel; -import com.azure.resourcemanager.monitor.models.HttpRequestInfo; -import com.azure.resourcemanager.monitor.models.SenderAuthorization; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.Map; - -/** The Azure event log entries are of type EventData. */ -@Immutable -public final class EventDataInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(EventDataInner.class); - - /* - * The sender authorization information. - */ - @JsonProperty(value = "authorization", access = JsonProperty.Access.WRITE_ONLY) - private SenderAuthorization authorization; - - /* - * key value pairs to identify ARM permissions. - */ - @JsonProperty(value = "claims", access = JsonProperty.Access.WRITE_ONLY) - private Map claims; - - /* - * the email address of the user who has performed the operation, the UPN - * claim or SPN claim based on availability. - */ - @JsonProperty(value = "caller", access = JsonProperty.Access.WRITE_ONLY) - private String caller; - - /* - * the description of the event. - */ - @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) - private String description; - - /* - * the Id of this event as required by ARM for RBAC. It contains the - * EventDataID and a timestamp information. - */ - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) - private String id; - - /* - * the event data Id. This is a unique identifier for an event. - */ - @JsonProperty(value = "eventDataId", access = JsonProperty.Access.WRITE_ONLY) - private String eventDataId; - - /* - * the correlation Id, usually a GUID in the string format. The correlation - * Id is shared among the events that belong to the same uber operation. - */ - @JsonProperty(value = "correlationId", access = JsonProperty.Access.WRITE_ONLY) - private String correlationId; - - /* - * the event name. This value should not be confused with OperationName. - * For practical purposes, OperationName might be more appealing to end - * users. - */ - @JsonProperty(value = "eventName", access = JsonProperty.Access.WRITE_ONLY) - private LocalizableStringInner eventName; - - /* - * the event category. - */ - @JsonProperty(value = "category", access = JsonProperty.Access.WRITE_ONLY) - private LocalizableStringInner category; - - /* - * the HTTP request info. Usually includes the 'clientRequestId', - * 'clientIpAddress' (IP address of the user who initiated the event) and - * 'method' (HTTP method e.g. PUT). - */ - @JsonProperty(value = "httpRequest", access = JsonProperty.Access.WRITE_ONLY) - private HttpRequestInfo httpRequest; - - /* - * the event level - */ - @JsonProperty(value = "level", access = JsonProperty.Access.WRITE_ONLY) - private EventLevel level; - - /* - * the resource group name of the impacted resource. - */ - @JsonProperty(value = "resourceGroupName", access = JsonProperty.Access.WRITE_ONLY) - private String resourceGroupName; - - /* - * the resource provider name of the impacted resource. - */ - @JsonProperty(value = "resourceProviderName", access = JsonProperty.Access.WRITE_ONLY) - private LocalizableStringInner resourceProviderName; - - /* - * the resource uri that uniquely identifies the resource that caused this - * event. - */ - @JsonProperty(value = "resourceId", access = JsonProperty.Access.WRITE_ONLY) - private String resourceId; - - /* - * the resource type - */ - @JsonProperty(value = "resourceType", access = JsonProperty.Access.WRITE_ONLY) - private LocalizableStringInner resourceType; - - /* - * It is usually a GUID shared among the events corresponding to single - * operation. This value should not be confused with EventName. - */ - @JsonProperty(value = "operationId", access = JsonProperty.Access.WRITE_ONLY) - private String operationId; - - /* - * the operation name. - */ - @JsonProperty(value = "operationName", access = JsonProperty.Access.WRITE_ONLY) - private LocalizableStringInner operationName; - - /* - * the set of pairs (usually a Dictionary) - * that includes details about the event. - */ - @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY) - private Map properties; - - /* - * a string describing the status of the operation. Some typical values - * are: Started, In progress, Succeeded, Failed, Resolved. - */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) - private LocalizableStringInner status; - - /* - * the event sub status. Most of the time, when included, this captures the - * HTTP status code of the REST call. Common values are: OK (HTTP Status - * Code: 200), Created (HTTP Status Code: 201), Accepted (HTTP Status Code: - * 202), No Content (HTTP Status Code: 204), Bad Request(HTTP Status Code: - * 400), Not Found (HTTP Status Code: 404), Conflict (HTTP Status Code: - * 409), Internal Server Error (HTTP Status Code: 500), Service Unavailable - * (HTTP Status Code:503), Gateway Timeout (HTTP Status Code: 504) - */ - @JsonProperty(value = "subStatus", access = JsonProperty.Access.WRITE_ONLY) - private LocalizableStringInner subStatus; - - /* - * the timestamp of when the event was generated by the Azure service - * processing the request corresponding the event. It in ISO 8601 format. - */ - @JsonProperty(value = "eventTimestamp", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime eventTimestamp; - - /* - * the timestamp of when the event became available for querying via this - * API. It is in ISO 8601 format. This value should not be confused - * eventTimestamp. As there might be a delay between the occurrence time of - * the event, and the time that the event is submitted to the Azure logging - * infrastructure. - */ - @JsonProperty(value = "submissionTimestamp", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime submissionTimestamp; - - /* - * the Azure subscription Id usually a GUID. - */ - @JsonProperty(value = "subscriptionId", access = JsonProperty.Access.WRITE_ONLY) - private String subscriptionId; - - /* - * the Azure tenant Id - */ - @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) - private String tenantId; - - /** - * Get the authorization property: The sender authorization information. - * - * @return the authorization value. - */ - public SenderAuthorization authorization() { - return this.authorization; - } - - /** - * Get the claims property: key value pairs to identify ARM permissions. - * - * @return the claims value. - */ - public Map claims() { - return this.claims; - } - - /** - * Get the caller property: the email address of the user who has performed the operation, the UPN claim or SPN - * claim based on availability. - * - * @return the caller value. - */ - public String caller() { - return this.caller; - } - - /** - * Get the description property: the description of the event. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Get the id property: the Id of this event as required by ARM for RBAC. It contains the EventDataID and a - * timestamp information. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Get the eventDataId property: the event data Id. This is a unique identifier for an event. - * - * @return the eventDataId value. - */ - public String eventDataId() { - return this.eventDataId; - } - - /** - * Get the correlationId property: the correlation Id, usually a GUID in the string format. The correlation Id is - * shared among the events that belong to the same uber operation. - * - * @return the correlationId value. - */ - public String correlationId() { - return this.correlationId; - } - - /** - * Get the eventName property: the event name. This value should not be confused with OperationName. For practical - * purposes, OperationName might be more appealing to end users. - * - * @return the eventName value. - */ - public LocalizableStringInner eventName() { - return this.eventName; - } - - /** - * Get the category property: the event category. - * - * @return the category value. - */ - public LocalizableStringInner category() { - return this.category; - } - - /** - * Get the httpRequest property: the HTTP request info. Usually includes the 'clientRequestId', 'clientIpAddress' - * (IP address of the user who initiated the event) and 'method' (HTTP method e.g. PUT). - * - * @return the httpRequest value. - */ - public HttpRequestInfo httpRequest() { - return this.httpRequest; - } - - /** - * Get the level property: the event level. - * - * @return the level value. - */ - public EventLevel level() { - return this.level; - } - - /** - * Get the resourceGroupName property: the resource group name of the impacted resource. - * - * @return the resourceGroupName value. - */ - public String resourceGroupName() { - return this.resourceGroupName; - } - - /** - * Get the resourceProviderName property: the resource provider name of the impacted resource. - * - * @return the resourceProviderName value. - */ - public LocalizableStringInner resourceProviderName() { - return this.resourceProviderName; - } - - /** - * Get the resourceId property: the resource uri that uniquely identifies the resource that caused this event. - * - * @return the resourceId value. - */ - public String resourceId() { - return this.resourceId; - } - - /** - * Get the resourceType property: the resource type. - * - * @return the resourceType value. - */ - public LocalizableStringInner resourceType() { - return this.resourceType; - } - - /** - * Get the operationId property: It is usually a GUID shared among the events corresponding to single operation. - * This value should not be confused with EventName. - * - * @return the operationId value. - */ - public String operationId() { - return this.operationId; - } - - /** - * Get the operationName property: the operation name. - * - * @return the operationName value. - */ - public LocalizableStringInner operationName() { - return this.operationName; - } - - /** - * Get the properties property: the set of <Key, Value> pairs (usually a Dictionary<String, String>) - * that includes details about the event. - * - * @return the properties value. - */ - public Map properties() { - return this.properties; - } - - /** - * Get the status property: a string describing the status of the operation. Some typical values are: Started, In - * progress, Succeeded, Failed, Resolved. - * - * @return the status value. - */ - public LocalizableStringInner status() { - return this.status; - } - - /** - * Get the subStatus property: the event sub status. Most of the time, when included, this captures the HTTP status - * code of the REST call. Common values are: OK (HTTP Status Code: 200), Created (HTTP Status Code: 201), Accepted - * (HTTP Status Code: 202), No Content (HTTP Status Code: 204), Bad Request(HTTP Status Code: 400), Not Found (HTTP - * Status Code: 404), Conflict (HTTP Status Code: 409), Internal Server Error (HTTP Status Code: 500), Service - * Unavailable (HTTP Status Code:503), Gateway Timeout (HTTP Status Code: 504). - * - * @return the subStatus value. - */ - public LocalizableStringInner subStatus() { - return this.subStatus; - } - - /** - * Get the eventTimestamp property: the timestamp of when the event was generated by the Azure service processing - * the request corresponding the event. It in ISO 8601 format. - * - * @return the eventTimestamp value. - */ - public OffsetDateTime eventTimestamp() { - return this.eventTimestamp; - } - - /** - * Get the submissionTimestamp property: the timestamp of when the event became available for querying via this API. - * It is in ISO 8601 format. This value should not be confused eventTimestamp. As there might be a delay between the - * occurrence time of the event, and the time that the event is submitted to the Azure logging infrastructure. - * - * @return the submissionTimestamp value. - */ - public OffsetDateTime submissionTimestamp() { - return this.submissionTimestamp; - } - - /** - * Get the subscriptionId property: the Azure subscription Id usually a GUID. - * - * @return the subscriptionId value. - */ - public String subscriptionId() { - return this.subscriptionId; - } - - /** - * Get the tenantId property: the Azure tenant Id. - * - * @return the tenantId value. - */ - public String tenantId() { - return this.tenantId; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (authorization() != null) { - authorization().validate(); - } - if (eventName() != null) { - eventName().validate(); - } - if (category() != null) { - category().validate(); - } - if (httpRequest() != null) { - httpRequest().validate(); - } - if (resourceProviderName() != null) { - resourceProviderName().validate(); - } - if (resourceType() != null) { - resourceType().validate(); - } - if (operationName() != null) { - operationName().validate(); - } - if (status() != null) { - status().validate(); - } - if (subStatus() != null) { - subStatus().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/IncidentInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/IncidentInner.java deleted file mode 100644 index 01dcc3b3ab9e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/IncidentInner.java +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** An alert incident indicates the activation status of an alert rule. */ -@Immutable -public final class IncidentInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(IncidentInner.class); - - /* - * Incident name. - */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) - private String name; - - /* - * Rule name that is associated with the incident. - */ - @JsonProperty(value = "ruleName", access = JsonProperty.Access.WRITE_ONLY) - private String ruleName; - - /* - * A boolean to indicate whether the incident is active or resolved. - */ - @JsonProperty(value = "isActive", access = JsonProperty.Access.WRITE_ONLY) - private Boolean isActive; - - /* - * The time at which the incident was activated in ISO8601 format. - */ - @JsonProperty(value = "activatedTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime activatedTime; - - /* - * The time at which the incident was resolved in ISO8601 format. If null, - * it means the incident is still active. - */ - @JsonProperty(value = "resolvedTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime resolvedTime; - - /** - * Get the name property: Incident name. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the ruleName property: Rule name that is associated with the incident. - * - * @return the ruleName value. - */ - public String ruleName() { - return this.ruleName; - } - - /** - * Get the isActive property: A boolean to indicate whether the incident is active or resolved. - * - * @return the isActive value. - */ - public Boolean isActive() { - return this.isActive; - } - - /** - * Get the activatedTime property: The time at which the incident was activated in ISO8601 format. - * - * @return the activatedTime value. - */ - public OffsetDateTime activatedTime() { - return this.activatedTime; - } - - /** - * Get the resolvedTime property: The time at which the incident was resolved in ISO8601 format. If null, it means - * the incident is still active. - * - * @return the resolvedTime value. - */ - public OffsetDateTime resolvedTime() { - return this.resolvedTime; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/LocalizableStringInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/LocalizableStringInner.java deleted file mode 100644 index 7725fe73c70d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/LocalizableStringInner.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The localizable string class. */ -@Fluent -public final class LocalizableStringInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LocalizableStringInner.class); - - /* - * the invariant value. - */ - @JsonProperty(value = "value", required = true) - private String value; - - /* - * the locale specific value. - */ - @JsonProperty(value = "localizedValue") - private String localizedValue; - - /** - * Get the value property: the invariant value. - * - * @return the value value. - */ - public String value() { - return this.value; - } - - /** - * Set the value property: the invariant value. - * - * @param value the value value to set. - * @return the LocalizableStringInner object itself. - */ - public LocalizableStringInner withValue(String value) { - this.value = value; - return this; - } - - /** - * Get the localizedValue property: the locale specific value. - * - * @return the localizedValue value. - */ - public String localizedValue() { - return this.localizedValue; - } - - /** - * Set the localizedValue property: the locale specific value. - * - * @param localizedValue the localizedValue value to set. - * @return the LocalizableStringInner object itself. - */ - public LocalizableStringInner withLocalizedValue(String localizedValue) { - this.localizedValue = localizedValue; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model LocalizableStringInner")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/LogProfileResourceInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/LogProfileResourceInner.java deleted file mode 100644 index e7c595733606..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/LogProfileResourceInner.java +++ /dev/null @@ -1,212 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.models.RetentionPolicy; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** The log profile resource. */ -@JsonFlatten -@Fluent -public class LogProfileResourceInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LogProfileResourceInner.class); - - /* - * the resource id of the storage account to which you would like to send - * the Activity Log. - */ - @JsonProperty(value = "properties.storageAccountId") - private String storageAccountId; - - /* - * The service bus rule ID of the service bus namespace in which you would - * like to have Event Hubs created for streaming the Activity Log. The rule - * ID is of the format: '{service bus resource ID}/authorizationrules/{key - * name}'. - */ - @JsonProperty(value = "properties.serviceBusRuleId") - private String serviceBusRuleId; - - /* - * List of regions for which Activity Log events should be stored or - * streamed. It is a comma separated list of valid ARM locations including - * the 'global' location. - */ - @JsonProperty(value = "properties.locations", required = true) - private List locations; - - /* - * the categories of the logs. These categories are created as is - * convenient to the user. Some values are: 'Write', 'Delete', and/or - * 'Action.' - */ - @JsonProperty(value = "properties.categories", required = true) - private List categories; - - /* - * the retention policy for the events in the log. - */ - @JsonProperty(value = "properties.retentionPolicy", required = true) - private RetentionPolicy retentionPolicy; - - /** - * Get the storageAccountId property: the resource id of the storage account to which you would like to send the - * Activity Log. - * - * @return the storageAccountId value. - */ - public String storageAccountId() { - return this.storageAccountId; - } - - /** - * Set the storageAccountId property: the resource id of the storage account to which you would like to send the - * Activity Log. - * - * @param storageAccountId the storageAccountId value to set. - * @return the LogProfileResourceInner object itself. - */ - public LogProfileResourceInner withStorageAccountId(String storageAccountId) { - this.storageAccountId = storageAccountId; - return this; - } - - /** - * Get the serviceBusRuleId property: The service bus rule ID of the service bus namespace in which you would like - * to have Event Hubs created for streaming the Activity Log. The rule ID is of the format: '{service bus resource - * ID}/authorizationrules/{key name}'. - * - * @return the serviceBusRuleId value. - */ - public String serviceBusRuleId() { - return this.serviceBusRuleId; - } - - /** - * Set the serviceBusRuleId property: The service bus rule ID of the service bus namespace in which you would like - * to have Event Hubs created for streaming the Activity Log. The rule ID is of the format: '{service bus resource - * ID}/authorizationrules/{key name}'. - * - * @param serviceBusRuleId the serviceBusRuleId value to set. - * @return the LogProfileResourceInner object itself. - */ - public LogProfileResourceInner withServiceBusRuleId(String serviceBusRuleId) { - this.serviceBusRuleId = serviceBusRuleId; - return this; - } - - /** - * Get the locations property: List of regions for which Activity Log events should be stored or streamed. It is a - * comma separated list of valid ARM locations including the 'global' location. - * - * @return the locations value. - */ - public List locations() { - return this.locations; - } - - /** - * Set the locations property: List of regions for which Activity Log events should be stored or streamed. It is a - * comma separated list of valid ARM locations including the 'global' location. - * - * @param locations the locations value to set. - * @return the LogProfileResourceInner object itself. - */ - public LogProfileResourceInner withLocations(List locations) { - this.locations = locations; - return this; - } - - /** - * Get the categories property: the categories of the logs. These categories are created as is convenient to the - * user. Some values are: 'Write', 'Delete', and/or 'Action.'. - * - * @return the categories value. - */ - public List categories() { - return this.categories; - } - - /** - * Set the categories property: the categories of the logs. These categories are created as is convenient to the - * user. Some values are: 'Write', 'Delete', and/or 'Action.'. - * - * @param categories the categories value to set. - * @return the LogProfileResourceInner object itself. - */ - public LogProfileResourceInner withCategories(List categories) { - this.categories = categories; - return this; - } - - /** - * Get the retentionPolicy property: the retention policy for the events in the log. - * - * @return the retentionPolicy value. - */ - public RetentionPolicy retentionPolicy() { - return this.retentionPolicy; - } - - /** - * Set the retentionPolicy property: the retention policy for the events in the log. - * - * @param retentionPolicy the retentionPolicy value to set. - * @return the LogProfileResourceInner object itself. - */ - public LogProfileResourceInner withRetentionPolicy(RetentionPolicy retentionPolicy) { - this.retentionPolicy = retentionPolicy; - return this; - } - - /** {@inheritDoc} */ - @Override - public LogProfileResourceInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public LogProfileResourceInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (locations() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property locations in model LogProfileResourceInner")); - } - if (categories() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property categories in model LogProfileResourceInner")); - } - if (retentionPolicy() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property retentionPolicy in model LogProfileResourceInner")); - } else { - retentionPolicy().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/LogSearchRuleResourceInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/LogSearchRuleResourceInner.java deleted file mode 100644 index 2c0926ef4a15..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/LogSearchRuleResourceInner.java +++ /dev/null @@ -1,359 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.models.Action; -import com.azure.resourcemanager.monitor.models.Enabled; -import com.azure.resourcemanager.monitor.models.ProvisioningState; -import com.azure.resourcemanager.monitor.models.Schedule; -import com.azure.resourcemanager.monitor.models.Source; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.Map; - -/** The Log Search Rule resource. */ -@JsonFlatten -@Fluent -public class LogSearchRuleResourceInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LogSearchRuleResourceInner.class); - - /* - * The api-version used when creating this alert rule - */ - @JsonProperty(value = "properties.createdWithApiVersion", access = JsonProperty.Access.WRITE_ONLY) - private String createdWithApiVersion; - - /* - * True if alert rule is legacy Log Analytic rule - */ - @JsonProperty(value = "properties.isLegacyLogAnalyticsRule", access = JsonProperty.Access.WRITE_ONLY) - private Boolean isLegacyLogAnalyticsRule; - - /* - * The description of the Log Search rule. - */ - @JsonProperty(value = "properties.description") - private String description; - - /* - * The display name of the alert rule - */ - @JsonProperty(value = "properties.displayName") - private String displayName; - - /* - * The flag that indicates whether the alert should be automatically - * resolved or not. The default is false. - */ - @JsonProperty(value = "properties.autoMitigate") - private Boolean autoMitigate; - - /* - * The flag which indicates whether the Log Search rule is enabled. Value - * should be true or false - */ - @JsonProperty(value = "properties.enabled") - private Enabled enabled; - - /* - * Last time the rule was updated in IS08601 format. - */ - @JsonProperty(value = "properties.lastUpdatedTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime lastUpdatedTime; - - /* - * Provisioning state of the scheduled query rule - */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private ProvisioningState provisioningState; - - /* - * Data Source against which rule will Query Data - */ - @JsonProperty(value = "properties.source", required = true) - private Source source; - - /* - * Schedule (Frequency, Time Window) for rule. Required for action type - - * AlertingAction - */ - @JsonProperty(value = "properties.schedule") - private Schedule schedule; - - /* - * Action needs to be taken on rule execution. - */ - @JsonProperty(value = "properties.action", required = true) - private Action action; - - /* - * 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. - */ - @JsonProperty(value = "kind", access = JsonProperty.Access.WRITE_ONLY) - private String kind; - - /* - * 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. - */ - @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) - private String etag; - - /** - * Get the createdWithApiVersion property: The api-version used when creating this alert rule. - * - * @return the createdWithApiVersion value. - */ - public String createdWithApiVersion() { - return this.createdWithApiVersion; - } - - /** - * Get the isLegacyLogAnalyticsRule property: True if alert rule is legacy Log Analytic rule. - * - * @return the isLegacyLogAnalyticsRule value. - */ - public Boolean isLegacyLogAnalyticsRule() { - return this.isLegacyLogAnalyticsRule; - } - - /** - * Get the description property: The description of the Log Search rule. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: The description of the Log Search rule. - * - * @param description the description value to set. - * @return the LogSearchRuleResourceInner object itself. - */ - public LogSearchRuleResourceInner withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the displayName property: The display name of the alert rule. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Set the displayName property: The display name of the alert rule. - * - * @param displayName the displayName value to set. - * @return the LogSearchRuleResourceInner object itself. - */ - public LogSearchRuleResourceInner withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - - /** - * Get the autoMitigate property: The flag that indicates whether the alert should be automatically resolved or not. - * The default is false. - * - * @return the autoMitigate value. - */ - public Boolean autoMitigate() { - return this.autoMitigate; - } - - /** - * Set the autoMitigate property: The flag that indicates whether the alert should be automatically resolved or not. - * The default is false. - * - * @param autoMitigate the autoMitigate value to set. - * @return the LogSearchRuleResourceInner object itself. - */ - public LogSearchRuleResourceInner withAutoMitigate(Boolean autoMitigate) { - this.autoMitigate = autoMitigate; - return this; - } - - /** - * Get the enabled property: The flag which indicates whether the Log Search rule is enabled. Value should be true - * or false. - * - * @return the enabled value. - */ - public Enabled enabled() { - return this.enabled; - } - - /** - * Set the enabled property: The flag which indicates whether the Log Search rule is enabled. Value should be true - * or false. - * - * @param enabled the enabled value to set. - * @return the LogSearchRuleResourceInner object itself. - */ - public LogSearchRuleResourceInner withEnabled(Enabled enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the lastUpdatedTime property: Last time the rule was updated in IS08601 format. - * - * @return the lastUpdatedTime value. - */ - public OffsetDateTime lastUpdatedTime() { - return this.lastUpdatedTime; - } - - /** - * Get the provisioningState property: Provisioning state of the scheduled query rule. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Get the source property: Data Source against which rule will Query Data. - * - * @return the source value. - */ - public Source source() { - return this.source; - } - - /** - * Set the source property: Data Source against which rule will Query Data. - * - * @param source the source value to set. - * @return the LogSearchRuleResourceInner object itself. - */ - public LogSearchRuleResourceInner withSource(Source source) { - this.source = source; - return this; - } - - /** - * Get the schedule property: Schedule (Frequency, Time Window) for rule. Required for action type - AlertingAction. - * - * @return the schedule value. - */ - public Schedule schedule() { - return this.schedule; - } - - /** - * Set the schedule property: Schedule (Frequency, Time Window) for rule. Required for action type - AlertingAction. - * - * @param schedule the schedule value to set. - * @return the LogSearchRuleResourceInner object itself. - */ - public LogSearchRuleResourceInner withSchedule(Schedule schedule) { - this.schedule = schedule; - return this; - } - - /** - * Get the action property: Action needs to be taken on rule execution. - * - * @return the action value. - */ - public Action action() { - return this.action; - } - - /** - * Set the action property: Action needs to be taken on rule execution. - * - * @param action the action value to set. - * @return the LogSearchRuleResourceInner object itself. - */ - public LogSearchRuleResourceInner withAction(Action action) { - this.action = action; - return this; - } - - /** - * Get the kind property: 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. - * - * @return the kind value. - */ - public String kind() { - return this.kind; - } - - /** - * Get the etag property: 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. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** {@inheritDoc} */ - @Override - public LogSearchRuleResourceInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public LogSearchRuleResourceInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (source() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property source in model LogSearchRuleResourceInner")); - } else { - source().validate(); - } - if (schedule() != null) { - schedule().validate(); - } - if (action() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property action in model LogSearchRuleResourceInner")); - } else { - action().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/MetadataValueInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/MetadataValueInner.java deleted file mode 100644 index c03c8afac480..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/MetadataValueInner.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Represents a metric metadata value. */ -@Fluent -public final class MetadataValueInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MetadataValueInner.class); - - /* - * the name of the metadata. - */ - @JsonProperty(value = "name") - private LocalizableStringInner name; - - /* - * the value of the metadata. - */ - @JsonProperty(value = "value") - private String value; - - /** - * Get the name property: the name of the metadata. - * - * @return the name value. - */ - public LocalizableStringInner name() { - return this.name; - } - - /** - * Set the name property: the name of the metadata. - * - * @param name the name value to set. - * @return the MetadataValueInner object itself. - */ - public MetadataValueInner withName(LocalizableStringInner name) { - this.name = name; - return this; - } - - /** - * Get the value property: the value of the metadata. - * - * @return the value value. - */ - public String value() { - return this.value; - } - - /** - * Set the value property: the value of the metadata. - * - * @param value the value value to set. - * @return the MetadataValueInner object itself. - */ - public MetadataValueInner withValue(String value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() != null) { - name().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/MetricAlertResourceInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/MetricAlertResourceInner.java deleted file mode 100644 index a1a560378756..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/MetricAlertResourceInner.java +++ /dev/null @@ -1,412 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.models.MetricAlertAction; -import com.azure.resourcemanager.monitor.models.MetricAlertCriteria; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.Duration; -import java.time.OffsetDateTime; -import java.util.List; -import java.util.Map; - -/** The metric alert resource. */ -@JsonFlatten -@Fluent -public class MetricAlertResourceInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MetricAlertResourceInner.class); - - /* - * the description of the metric alert that will be included in the alert - * email. - */ - @JsonProperty(value = "properties.description") - private String description; - - /* - * Alert severity {0, 1, 2, 3, 4} - */ - @JsonProperty(value = "properties.severity", required = true) - private int severity; - - /* - * the flag that indicates whether the metric alert is enabled. - */ - @JsonProperty(value = "properties.enabled", required = true) - private boolean enabled; - - /* - * the list of resource id's that this metric alert is scoped to. - */ - @JsonProperty(value = "properties.scopes", required = true) - private List scopes; - - /* - * how often the metric alert is evaluated represented in ISO 8601 duration - * format. - */ - @JsonProperty(value = "properties.evaluationFrequency", required = true) - private Duration evaluationFrequency; - - /* - * the period of time (in ISO 8601 duration format) that is used to monitor - * alert activity based on the threshold. - */ - @JsonProperty(value = "properties.windowSize", required = true) - private Duration windowSize; - - /* - * the resource type of the target resource(s) on which the alert is - * created/updated. Mandatory if the scope contains a subscription, - * resource group, or more than one resource. - */ - @JsonProperty(value = "properties.targetResourceType") - private String targetResourceType; - - /* - * the region of the target resource(s) on which the alert is - * created/updated. Mandatory if the scope contains a subscription, - * resource group, or more than one resource. - */ - @JsonProperty(value = "properties.targetResourceRegion") - private String targetResourceRegion; - - /* - * defines the specific alert criteria information. - */ - @JsonProperty(value = "properties.criteria", required = true) - private MetricAlertCriteria criteria; - - /* - * the flag that indicates whether the alert should be auto resolved or - * not. The default is true. - */ - @JsonProperty(value = "properties.autoMitigate") - private Boolean autoMitigate; - - /* - * the array of actions that are performed when the alert rule becomes - * active, and when an alert condition is resolved. - */ - @JsonProperty(value = "properties.actions") - private List actions; - - /* - * Last time the rule was updated in ISO8601 format. - */ - @JsonProperty(value = "properties.lastUpdatedTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime lastUpdatedTime; - - /* - * the value indicating whether this alert rule is migrated. - */ - @JsonProperty(value = "properties.isMigrated", access = JsonProperty.Access.WRITE_ONLY) - private Boolean isMigrated; - - /** - * Get the description property: the description of the metric alert that will be included in the alert email. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: the description of the metric alert that will be included in the alert email. - * - * @param description the description value to set. - * @return the MetricAlertResourceInner object itself. - */ - public MetricAlertResourceInner withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the severity property: Alert severity {0, 1, 2, 3, 4}. - * - * @return the severity value. - */ - public int severity() { - return this.severity; - } - - /** - * Set the severity property: Alert severity {0, 1, 2, 3, 4}. - * - * @param severity the severity value to set. - * @return the MetricAlertResourceInner object itself. - */ - public MetricAlertResourceInner withSeverity(int severity) { - this.severity = severity; - return this; - } - - /** - * Get the enabled property: the flag that indicates whether the metric alert is enabled. - * - * @return the enabled value. - */ - public boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: the flag that indicates whether the metric alert is enabled. - * - * @param enabled the enabled value to set. - * @return the MetricAlertResourceInner object itself. - */ - public MetricAlertResourceInner withEnabled(boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the scopes property: the list of resource id's that this metric alert is scoped to. - * - * @return the scopes value. - */ - public List scopes() { - return this.scopes; - } - - /** - * Set the scopes property: the list of resource id's that this metric alert is scoped to. - * - * @param scopes the scopes value to set. - * @return the MetricAlertResourceInner object itself. - */ - public MetricAlertResourceInner withScopes(List scopes) { - this.scopes = scopes; - return this; - } - - /** - * Get the evaluationFrequency property: how often the metric alert is evaluated represented in ISO 8601 duration - * format. - * - * @return the evaluationFrequency value. - */ - public Duration evaluationFrequency() { - return this.evaluationFrequency; - } - - /** - * Set the evaluationFrequency property: how often the metric alert is evaluated represented in ISO 8601 duration - * format. - * - * @param evaluationFrequency the evaluationFrequency value to set. - * @return the MetricAlertResourceInner object itself. - */ - public MetricAlertResourceInner withEvaluationFrequency(Duration evaluationFrequency) { - this.evaluationFrequency = evaluationFrequency; - return this; - } - - /** - * Get the windowSize property: the period of time (in ISO 8601 duration format) that is used to monitor alert - * activity based on the threshold. - * - * @return the windowSize value. - */ - public Duration windowSize() { - return this.windowSize; - } - - /** - * Set the windowSize property: the period of time (in ISO 8601 duration format) that is used to monitor alert - * activity based on the threshold. - * - * @param windowSize the windowSize value to set. - * @return the MetricAlertResourceInner object itself. - */ - public MetricAlertResourceInner withWindowSize(Duration windowSize) { - this.windowSize = windowSize; - return this; - } - - /** - * Get the targetResourceType property: the resource type of the target resource(s) on which the alert is - * created/updated. Mandatory if the scope contains a subscription, resource group, or more than one resource. - * - * @return the targetResourceType value. - */ - public String targetResourceType() { - return this.targetResourceType; - } - - /** - * Set the targetResourceType property: the resource type of the target resource(s) on which the alert is - * created/updated. Mandatory if the scope contains a subscription, resource group, or more than one resource. - * - * @param targetResourceType the targetResourceType value to set. - * @return the MetricAlertResourceInner object itself. - */ - public MetricAlertResourceInner withTargetResourceType(String targetResourceType) { - this.targetResourceType = targetResourceType; - return this; - } - - /** - * Get the targetResourceRegion property: the region of the target resource(s) on which the alert is - * created/updated. Mandatory if the scope contains a subscription, resource group, or more than one resource. - * - * @return the targetResourceRegion value. - */ - public String targetResourceRegion() { - return this.targetResourceRegion; - } - - /** - * Set the targetResourceRegion property: the region of the target resource(s) on which the alert is - * created/updated. Mandatory if the scope contains a subscription, resource group, or more than one resource. - * - * @param targetResourceRegion the targetResourceRegion value to set. - * @return the MetricAlertResourceInner object itself. - */ - public MetricAlertResourceInner withTargetResourceRegion(String targetResourceRegion) { - this.targetResourceRegion = targetResourceRegion; - return this; - } - - /** - * Get the criteria property: defines the specific alert criteria information. - * - * @return the criteria value. - */ - public MetricAlertCriteria criteria() { - return this.criteria; - } - - /** - * Set the criteria property: defines the specific alert criteria information. - * - * @param criteria the criteria value to set. - * @return the MetricAlertResourceInner object itself. - */ - public MetricAlertResourceInner withCriteria(MetricAlertCriteria criteria) { - this.criteria = criteria; - return this; - } - - /** - * Get the autoMitigate property: the flag that indicates whether the alert should be auto resolved or not. The - * default is true. - * - * @return the autoMitigate value. - */ - public Boolean autoMitigate() { - return this.autoMitigate; - } - - /** - * Set the autoMitigate property: the flag that indicates whether the alert should be auto resolved or not. The - * default is true. - * - * @param autoMitigate the autoMitigate value to set. - * @return the MetricAlertResourceInner object itself. - */ - public MetricAlertResourceInner withAutoMitigate(Boolean autoMitigate) { - this.autoMitigate = autoMitigate; - return this; - } - - /** - * Get the actions property: the array of actions that are performed when the alert rule becomes active, and when an - * alert condition is resolved. - * - * @return the actions value. - */ - public List actions() { - return this.actions; - } - - /** - * Set the actions property: the array of actions that are performed when the alert rule becomes active, and when an - * alert condition is resolved. - * - * @param actions the actions value to set. - * @return the MetricAlertResourceInner object itself. - */ - public MetricAlertResourceInner withActions(List actions) { - this.actions = actions; - return this; - } - - /** - * Get the lastUpdatedTime property: Last time the rule was updated in ISO8601 format. - * - * @return the lastUpdatedTime value. - */ - public OffsetDateTime lastUpdatedTime() { - return this.lastUpdatedTime; - } - - /** - * Get the isMigrated property: the value indicating whether this alert rule is migrated. - * - * @return the isMigrated value. - */ - public Boolean isMigrated() { - return this.isMigrated; - } - - /** {@inheritDoc} */ - @Override - public MetricAlertResourceInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public MetricAlertResourceInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (scopes() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property scopes in model MetricAlertResourceInner")); - } - if (evaluationFrequency() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property evaluationFrequency in model MetricAlertResourceInner")); - } - if (windowSize() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property windowSize in model MetricAlertResourceInner")); - } - if (criteria() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property criteria in model MetricAlertResourceInner")); - } else { - criteria().validate(); - } - if (actions() != null) { - actions().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/MetricAlertStatusCollectionInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/MetricAlertStatusCollectionInner.java deleted file mode 100644 index 1da62a80569a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/MetricAlertStatusCollectionInner.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.models.MetricAlertStatus; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Represents a collection of alert rule resources. */ -@Fluent -public final class MetricAlertStatusCollectionInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MetricAlertStatusCollectionInner.class); - - /* - * the values for the alert rule resources. - */ - @JsonProperty(value = "value") - private List value; - - /** - * Get the value property: the values for the alert rule resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: the values for the alert rule resources. - * - * @param value the value value to set. - * @return the MetricAlertStatusCollectionInner object itself. - */ - public MetricAlertStatusCollectionInner withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/MetricDefinitionInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/MetricDefinitionInner.java deleted file mode 100644 index 0596eeaf38a0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/MetricDefinitionInner.java +++ /dev/null @@ -1,382 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.models.AggregationType; -import com.azure.resourcemanager.monitor.models.MetricAvailability; -import com.azure.resourcemanager.monitor.models.MetricClass; -import com.azure.resourcemanager.monitor.models.Unit; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Metric definition class specifies the metadata for a metric. */ -@Fluent -public final class MetricDefinitionInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MetricDefinitionInner.class); - - /* - * Flag to indicate whether the dimension is required. - */ - @JsonProperty(value = "isDimensionRequired") - private Boolean isDimensionRequired; - - /* - * the resource identifier of the resource that emitted the metric. - */ - @JsonProperty(value = "resourceId") - private String resourceId; - - /* - * the namespace the metric belongs to. - */ - @JsonProperty(value = "namespace") - private String namespace; - - /* - * the name and the display name of the metric, i.e. it is a localizable - * string. - */ - @JsonProperty(value = "name") - private LocalizableStringInner name; - - /* - * Detailed description of this metric. - */ - @JsonProperty(value = "displayDescription") - private String displayDescription; - - /* - * Custom category name for this metric. - */ - @JsonProperty(value = "category") - private String category; - - /* - * The class of the metric. - */ - @JsonProperty(value = "metricClass") - private MetricClass metricClass; - - /* - * The unit of the metric. - */ - @JsonProperty(value = "unit") - private Unit unit; - - /* - * the primary aggregation type value defining how to use the values for - * display. - */ - @JsonProperty(value = "primaryAggregationType") - private AggregationType primaryAggregationType; - - /* - * the collection of what aggregation types are supported. - */ - @JsonProperty(value = "supportedAggregationTypes") - private List supportedAggregationTypes; - - /* - * the collection of what aggregation intervals are available to be - * queried. - */ - @JsonProperty(value = "metricAvailabilities") - private List metricAvailabilities; - - /* - * the resource identifier of the metric definition. - */ - @JsonProperty(value = "id") - private String id; - - /* - * the name and the display name of the dimension, i.e. it is a localizable - * string. - */ - @JsonProperty(value = "dimensions") - private List dimensions; - - /** - * Get the isDimensionRequired property: Flag to indicate whether the dimension is required. - * - * @return the isDimensionRequired value. - */ - public Boolean isDimensionRequired() { - return this.isDimensionRequired; - } - - /** - * Set the isDimensionRequired property: Flag to indicate whether the dimension is required. - * - * @param isDimensionRequired the isDimensionRequired value to set. - * @return the MetricDefinitionInner object itself. - */ - public MetricDefinitionInner withIsDimensionRequired(Boolean isDimensionRequired) { - this.isDimensionRequired = isDimensionRequired; - return this; - } - - /** - * Get the resourceId property: the resource identifier of the resource that emitted the metric. - * - * @return the resourceId value. - */ - public String resourceId() { - return this.resourceId; - } - - /** - * Set the resourceId property: the resource identifier of the resource that emitted the metric. - * - * @param resourceId the resourceId value to set. - * @return the MetricDefinitionInner object itself. - */ - public MetricDefinitionInner withResourceId(String resourceId) { - this.resourceId = resourceId; - return this; - } - - /** - * Get the namespace property: the namespace the metric belongs to. - * - * @return the namespace value. - */ - public String namespace() { - return this.namespace; - } - - /** - * Set the namespace property: the namespace the metric belongs to. - * - * @param namespace the namespace value to set. - * @return the MetricDefinitionInner object itself. - */ - public MetricDefinitionInner withNamespace(String namespace) { - this.namespace = namespace; - return this; - } - - /** - * Get the name property: the name and the display name of the metric, i.e. it is a localizable string. - * - * @return the name value. - */ - public LocalizableStringInner name() { - return this.name; - } - - /** - * Set the name property: the name and the display name of the metric, i.e. it is a localizable string. - * - * @param name the name value to set. - * @return the MetricDefinitionInner object itself. - */ - public MetricDefinitionInner withName(LocalizableStringInner name) { - this.name = name; - return this; - } - - /** - * Get the displayDescription property: Detailed description of this metric. - * - * @return the displayDescription value. - */ - public String displayDescription() { - return this.displayDescription; - } - - /** - * Set the displayDescription property: Detailed description of this metric. - * - * @param displayDescription the displayDescription value to set. - * @return the MetricDefinitionInner object itself. - */ - public MetricDefinitionInner withDisplayDescription(String displayDescription) { - this.displayDescription = displayDescription; - return this; - } - - /** - * Get the category property: Custom category name for this metric. - * - * @return the category value. - */ - public String category() { - return this.category; - } - - /** - * Set the category property: Custom category name for this metric. - * - * @param category the category value to set. - * @return the MetricDefinitionInner object itself. - */ - public MetricDefinitionInner withCategory(String category) { - this.category = category; - return this; - } - - /** - * Get the metricClass property: The class of the metric. - * - * @return the metricClass value. - */ - public MetricClass metricClass() { - return this.metricClass; - } - - /** - * Set the metricClass property: The class of the metric. - * - * @param metricClass the metricClass value to set. - * @return the MetricDefinitionInner object itself. - */ - public MetricDefinitionInner withMetricClass(MetricClass metricClass) { - this.metricClass = metricClass; - return this; - } - - /** - * Get the unit property: The unit of the metric. - * - * @return the unit value. - */ - public Unit unit() { - return this.unit; - } - - /** - * Set the unit property: The unit of the metric. - * - * @param unit the unit value to set. - * @return the MetricDefinitionInner object itself. - */ - public MetricDefinitionInner withUnit(Unit unit) { - this.unit = unit; - return this; - } - - /** - * Get the primaryAggregationType property: the primary aggregation type value defining how to use the values for - * display. - * - * @return the primaryAggregationType value. - */ - public AggregationType primaryAggregationType() { - return this.primaryAggregationType; - } - - /** - * Set the primaryAggregationType property: the primary aggregation type value defining how to use the values for - * display. - * - * @param primaryAggregationType the primaryAggregationType value to set. - * @return the MetricDefinitionInner object itself. - */ - public MetricDefinitionInner withPrimaryAggregationType(AggregationType primaryAggregationType) { - this.primaryAggregationType = primaryAggregationType; - return this; - } - - /** - * Get the supportedAggregationTypes property: the collection of what aggregation types are supported. - * - * @return the supportedAggregationTypes value. - */ - public List supportedAggregationTypes() { - return this.supportedAggregationTypes; - } - - /** - * Set the supportedAggregationTypes property: the collection of what aggregation types are supported. - * - * @param supportedAggregationTypes the supportedAggregationTypes value to set. - * @return the MetricDefinitionInner object itself. - */ - public MetricDefinitionInner withSupportedAggregationTypes(List supportedAggregationTypes) { - this.supportedAggregationTypes = supportedAggregationTypes; - return this; - } - - /** - * Get the metricAvailabilities property: the collection of what aggregation intervals are available to be queried. - * - * @return the metricAvailabilities value. - */ - public List metricAvailabilities() { - return this.metricAvailabilities; - } - - /** - * Set the metricAvailabilities property: the collection of what aggregation intervals are available to be queried. - * - * @param metricAvailabilities the metricAvailabilities value to set. - * @return the MetricDefinitionInner object itself. - */ - public MetricDefinitionInner withMetricAvailabilities(List metricAvailabilities) { - this.metricAvailabilities = metricAvailabilities; - return this; - } - - /** - * Get the id property: the resource identifier of the metric definition. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: the resource identifier of the metric definition. - * - * @param id the id value to set. - * @return the MetricDefinitionInner object itself. - */ - public MetricDefinitionInner withId(String id) { - this.id = id; - return this; - } - - /** - * Get the dimensions property: the name and the display name of the dimension, i.e. it is a localizable string. - * - * @return the dimensions value. - */ - public List dimensions() { - return this.dimensions; - } - - /** - * Set the dimensions property: the name and the display name of the dimension, i.e. it is a localizable string. - * - * @param dimensions the dimensions value to set. - * @return the MetricDefinitionInner object itself. - */ - public MetricDefinitionInner withDimensions(List dimensions) { - this.dimensions = dimensions; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() != null) { - name().validate(); - } - if (metricAvailabilities() != null) { - metricAvailabilities().forEach(e -> e.validate()); - } - if (dimensions() != null) { - dimensions().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/MetricInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/MetricInner.java deleted file mode 100644 index f8ff04917707..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/MetricInner.java +++ /dev/null @@ -1,264 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.models.TimeSeriesElement; -import com.azure.resourcemanager.monitor.models.Unit; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The result data of a query. */ -@Fluent -public final class MetricInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MetricInner.class); - - /* - * the metric Id. - */ - @JsonProperty(value = "id", required = true) - private String id; - - /* - * the resource type of the metric resource. - */ - @JsonProperty(value = "type", required = true) - private String type; - - /* - * the name and the display name of the metric, i.e. it is localizable - * string. - */ - @JsonProperty(value = "name", required = true) - private LocalizableStringInner name; - - /* - * Detailed description of this metric. - */ - @JsonProperty(value = "displayDescription") - private String displayDescription; - - /* - * 'Success' or the error details on query failures for this metric. - */ - @JsonProperty(value = "errorCode") - private String errorCode; - - /* - * Error message encountered querying this specific metric. - */ - @JsonProperty(value = "errorMessage") - private String errorMessage; - - /* - * The unit of the metric. - */ - @JsonProperty(value = "unit", required = true) - private Unit unit; - - /* - * the time series returned when a data query is performed. - */ - @JsonProperty(value = "timeseries", required = true) - private List timeseries; - - /** - * Get the id property: the metric Id. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: the metric Id. - * - * @param id the id value to set. - * @return the MetricInner object itself. - */ - public MetricInner withId(String id) { - this.id = id; - return this; - } - - /** - * Get the type property: the resource type of the metric resource. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Set the type property: the resource type of the metric resource. - * - * @param type the type value to set. - * @return the MetricInner object itself. - */ - public MetricInner withType(String type) { - this.type = type; - return this; - } - - /** - * Get the name property: the name and the display name of the metric, i.e. it is localizable string. - * - * @return the name value. - */ - public LocalizableStringInner name() { - return this.name; - } - - /** - * Set the name property: the name and the display name of the metric, i.e. it is localizable string. - * - * @param name the name value to set. - * @return the MetricInner object itself. - */ - public MetricInner withName(LocalizableStringInner name) { - this.name = name; - return this; - } - - /** - * Get the displayDescription property: Detailed description of this metric. - * - * @return the displayDescription value. - */ - public String displayDescription() { - return this.displayDescription; - } - - /** - * Set the displayDescription property: Detailed description of this metric. - * - * @param displayDescription the displayDescription value to set. - * @return the MetricInner object itself. - */ - public MetricInner withDisplayDescription(String displayDescription) { - this.displayDescription = displayDescription; - return this; - } - - /** - * Get the errorCode property: 'Success' or the error details on query failures for this metric. - * - * @return the errorCode value. - */ - public String errorCode() { - return this.errorCode; - } - - /** - * Set the errorCode property: 'Success' or the error details on query failures for this metric. - * - * @param errorCode the errorCode value to set. - * @return the MetricInner object itself. - */ - public MetricInner withErrorCode(String errorCode) { - this.errorCode = errorCode; - return this; - } - - /** - * Get the errorMessage property: Error message encountered querying this specific metric. - * - * @return the errorMessage value. - */ - public String errorMessage() { - return this.errorMessage; - } - - /** - * Set the errorMessage property: Error message encountered querying this specific metric. - * - * @param errorMessage the errorMessage value to set. - * @return the MetricInner object itself. - */ - public MetricInner withErrorMessage(String errorMessage) { - this.errorMessage = errorMessage; - return this; - } - - /** - * Get the unit property: The unit of the metric. - * - * @return the unit value. - */ - public Unit unit() { - return this.unit; - } - - /** - * Set the unit property: The unit of the metric. - * - * @param unit the unit value to set. - * @return the MetricInner object itself. - */ - public MetricInner withUnit(Unit unit) { - this.unit = unit; - return this; - } - - /** - * Get the timeseries property: the time series returned when a data query is performed. - * - * @return the timeseries value. - */ - public List timeseries() { - return this.timeseries; - } - - /** - * Set the timeseries property: the time series returned when a data query is performed. - * - * @param timeseries the timeseries value to set. - * @return the MetricInner object itself. - */ - public MetricInner withTimeseries(List timeseries) { - this.timeseries = timeseries; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (id() == null) { - throw logger - .logExceptionAsError(new IllegalArgumentException("Missing required property id in model MetricInner")); - } - if (type() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property type in model MetricInner")); - } - if (name() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property name in model MetricInner")); - } else { - name().validate(); - } - if (unit() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property unit in model MetricInner")); - } - if (timeseries() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property timeseries in model MetricInner")); - } else { - timeseries().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/MetricNamespaceInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/MetricNamespaceInner.java deleted file mode 100644 index 735d834692bc..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/MetricNamespaceInner.java +++ /dev/null @@ -1,159 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.models.MetricNamespaceName; -import com.azure.resourcemanager.monitor.models.NamespaceClassification; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Metric namespace class specifies the metadata for a metric namespace. */ -@Fluent -public final class MetricNamespaceInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MetricNamespaceInner.class); - - /* - * The ID of the metric namespace. - */ - @JsonProperty(value = "id") - private String id; - - /* - * The type of the namespace. - */ - @JsonProperty(value = "type") - private String type; - - /* - * The escaped name of the namespace. - */ - @JsonProperty(value = "name") - private String name; - - /* - * Kind of namespace - */ - @JsonProperty(value = "classification") - private NamespaceClassification classification; - - /* - * Properties which include the fully qualified namespace name. - */ - @JsonProperty(value = "properties") - private MetricNamespaceName properties; - - /** - * Get the id property: The ID of the metric namespace. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: The ID of the metric namespace. - * - * @param id the id value to set. - * @return the MetricNamespaceInner object itself. - */ - public MetricNamespaceInner withId(String id) { - this.id = id; - return this; - } - - /** - * Get the type property: The type of the namespace. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Set the type property: The type of the namespace. - * - * @param type the type value to set. - * @return the MetricNamespaceInner object itself. - */ - public MetricNamespaceInner withType(String type) { - this.type = type; - return this; - } - - /** - * Get the name property: The escaped name of the namespace. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The escaped name of the namespace. - * - * @param name the name value to set. - * @return the MetricNamespaceInner object itself. - */ - public MetricNamespaceInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the classification property: Kind of namespace. - * - * @return the classification value. - */ - public NamespaceClassification classification() { - return this.classification; - } - - /** - * Set the classification property: Kind of namespace. - * - * @param classification the classification value to set. - * @return the MetricNamespaceInner object itself. - */ - public MetricNamespaceInner withClassification(NamespaceClassification classification) { - this.classification = classification; - return this; - } - - /** - * Get the properties property: Properties which include the fully qualified namespace name. - * - * @return the properties value. - */ - public MetricNamespaceName properties() { - return this.properties; - } - - /** - * Set the properties property: Properties which include the fully qualified namespace name. - * - * @param properties the properties value to set. - * @return the MetricNamespaceInner object itself. - */ - public MetricNamespaceInner withProperties(MetricNamespaceName properties) { - this.properties = properties; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/OperationListResultInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/OperationListResultInner.java deleted file mode 100644 index b7049c4027d5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/OperationListResultInner.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.models.Operation; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** - * Result of the request to list Microsoft.Insights operations. It contains a list of operations and a URL link to get - * the next set of results. - */ -@Fluent -public final class OperationListResultInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationListResultInner.class); - - /* - * List of operations supported by the Microsoft.Insights provider. - */ - @JsonProperty(value = "value") - private List value; - - /* - * URL to get the next set of operation list results if there are any. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: List of operations supported by the Microsoft.Insights provider. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: List of operations supported by the Microsoft.Insights provider. - * - * @param value the value value to set. - * @return the OperationListResultInner object itself. - */ - public OperationListResultInner withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: URL to get the next set of operation list results if there are any. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: URL to get the next set of operation list results if there are any. - * - * @param nextLink the nextLink value to set. - * @return the OperationListResultInner object itself. - */ - public OperationListResultInner withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/OperationStatusInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/OperationStatusInner.java deleted file mode 100644 index eac05cd876ad..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/OperationStatusInner.java +++ /dev/null @@ -1,185 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.models.ErrorResponseCommon; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** The status of operation. */ -@Fluent -public final class OperationStatusInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationStatusInner.class); - - /* - * The operation Id. - */ - @JsonProperty(value = "id") - private String id; - - /* - * The operation name. - */ - @JsonProperty(value = "name") - private String name; - - /* - * Start time of the job in standard ISO8601 format. - */ - @JsonProperty(value = "startTime") - private OffsetDateTime startTime; - - /* - * End time of the job in standard ISO8601 format. - */ - @JsonProperty(value = "endTime") - private OffsetDateTime endTime; - - /* - * The status of the operation. - */ - @JsonProperty(value = "status") - private String status; - - /* - * The error detail of the operation if any. - */ - @JsonProperty(value = "error") - private ErrorResponseCommon error; - - /** - * Get the id property: The operation Id. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: The operation Id. - * - * @param id the id value to set. - * @return the OperationStatusInner object itself. - */ - public OperationStatusInner withId(String id) { - this.id = id; - return this; - } - - /** - * Get the name property: The operation name. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The operation name. - * - * @param name the name value to set. - * @return the OperationStatusInner object itself. - */ - public OperationStatusInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the startTime property: Start time of the job in standard ISO8601 format. - * - * @return the startTime value. - */ - public OffsetDateTime startTime() { - return this.startTime; - } - - /** - * Set the startTime property: Start time of the job in standard ISO8601 format. - * - * @param startTime the startTime value to set. - * @return the OperationStatusInner object itself. - */ - public OperationStatusInner withStartTime(OffsetDateTime startTime) { - this.startTime = startTime; - return this; - } - - /** - * Get the endTime property: End time of the job in standard ISO8601 format. - * - * @return the endTime value. - */ - public OffsetDateTime endTime() { - return this.endTime; - } - - /** - * Set the endTime property: End time of the job in standard ISO8601 format. - * - * @param endTime the endTime value to set. - * @return the OperationStatusInner object itself. - */ - public OperationStatusInner withEndTime(OffsetDateTime endTime) { - this.endTime = endTime; - return this; - } - - /** - * Get the status property: The status of the operation. - * - * @return the status value. - */ - public String status() { - return this.status; - } - - /** - * Set the status property: The status of the operation. - * - * @param status the status value to set. - * @return the OperationStatusInner object itself. - */ - public OperationStatusInner withStatus(String status) { - this.status = status; - return this; - } - - /** - * Get the error property: The error detail of the operation if any. - * - * @return the error value. - */ - public ErrorResponseCommon error() { - return this.error; - } - - /** - * Set the error property: The error detail of the operation if any. - * - * @param error the error value to set. - * @return the OperationStatusInner object itself. - */ - public OperationStatusInner withError(ErrorResponseCommon error) { - this.error = error; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (error() != null) { - error().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/PrivateEndpointConnectionInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/PrivateEndpointConnectionInner.java deleted file mode 100644 index 94aafa027f44..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/PrivateEndpointConnectionInner.java +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.models.PrivateEndpointProperty; -import com.azure.resourcemanager.monitor.models.PrivateLinkServiceConnectionStateProperty; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** A private endpoint connection. */ -@JsonFlatten -@Fluent -public class PrivateEndpointConnectionInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionInner.class); - - /* - * Private endpoint which the connection belongs to. - */ - @JsonProperty(value = "properties.privateEndpoint") - private PrivateEndpointProperty privateEndpoint; - - /* - * Connection state of the private endpoint connection. - */ - @JsonProperty(value = "properties.privateLinkServiceConnectionState") - private PrivateLinkServiceConnectionStateProperty privateLinkServiceConnectionState; - - /* - * State of the private endpoint connection. - */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; - - /** - * Get the privateEndpoint property: Private endpoint which the connection belongs to. - * - * @return the privateEndpoint value. - */ - public PrivateEndpointProperty privateEndpoint() { - return this.privateEndpoint; - } - - /** - * Set the privateEndpoint property: Private endpoint which the connection belongs to. - * - * @param privateEndpoint the privateEndpoint value to set. - * @return the PrivateEndpointConnectionInner object itself. - */ - public PrivateEndpointConnectionInner withPrivateEndpoint(PrivateEndpointProperty privateEndpoint) { - this.privateEndpoint = privateEndpoint; - return this; - } - - /** - * Get the privateLinkServiceConnectionState property: Connection state of the private endpoint connection. - * - * @return the privateLinkServiceConnectionState value. - */ - public PrivateLinkServiceConnectionStateProperty privateLinkServiceConnectionState() { - return this.privateLinkServiceConnectionState; - } - - /** - * Set the privateLinkServiceConnectionState property: Connection state of the private endpoint connection. - * - * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. - * @return the PrivateEndpointConnectionInner object itself. - */ - public PrivateEndpointConnectionInner withPrivateLinkServiceConnectionState( - PrivateLinkServiceConnectionStateProperty privateLinkServiceConnectionState) { - this.privateLinkServiceConnectionState = privateLinkServiceConnectionState; - return this; - } - - /** - * Get the provisioningState property: State of the private endpoint connection. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (privateEndpoint() != null) { - privateEndpoint().validate(); - } - if (privateLinkServiceConnectionState() != null) { - privateLinkServiceConnectionState().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/PrivateLinkResourceInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/PrivateLinkResourceInner.java deleted file mode 100644 index 7a03e40e64ed..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/PrivateLinkResourceInner.java +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** A private link resource. */ -@JsonFlatten -@Immutable -public class PrivateLinkResourceInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkResourceInner.class); - - /* - * The private link resource group id. - */ - @JsonProperty(value = "properties.groupId", access = JsonProperty.Access.WRITE_ONLY) - private String groupId; - - /* - * The private link resource required member names. - */ - @JsonProperty(value = "properties.requiredMembers", access = JsonProperty.Access.WRITE_ONLY) - private List requiredMembers; - - /** - * Get the groupId property: The private link resource group id. - * - * @return the groupId value. - */ - public String groupId() { - return this.groupId; - } - - /** - * Get the requiredMembers property: The private link resource required member names. - * - * @return the requiredMembers value. - */ - public List requiredMembers() { - return this.requiredMembers; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/ResponseInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/ResponseInner.java deleted file mode 100644 index 1bc3b7149555..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/ResponseInner.java +++ /dev/null @@ -1,207 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.Duration; -import java.util.List; - -/** The response to a metrics query. */ -@Fluent -public final class ResponseInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResponseInner.class); - - /* - * The integer value representing the relative cost of the query. - */ - @JsonProperty(value = "cost") - private Integer cost; - - /* - * The timespan for which the data was retrieved. Its value consists of two - * datetimes concatenated, separated by '/'. This may be adjusted in the - * future and returned back from what was originally requested. - */ - @JsonProperty(value = "timespan", required = true) - private String timespan; - - /* - * The interval (window size) for which the metric data was returned in. - * This may be adjusted in the future and returned back from what was - * originally requested. This is not present if a metadata request was - * made. - */ - @JsonProperty(value = "interval") - private Duration interval; - - /* - * The namespace of the metrics being queried - */ - @JsonProperty(value = "namespace") - private String namespace; - - /* - * The region of the resource being queried for metrics. - */ - @JsonProperty(value = "resourceregion") - private String resourceRegion; - - /* - * the value of the collection. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /** - * Get the cost property: The integer value representing the relative cost of the query. - * - * @return the cost value. - */ - public Integer cost() { - return this.cost; - } - - /** - * Set the cost property: The integer value representing the relative cost of the query. - * - * @param cost the cost value to set. - * @return the ResponseInner object itself. - */ - public ResponseInner withCost(Integer cost) { - this.cost = cost; - return this; - } - - /** - * Get the timespan property: The timespan for which the data was retrieved. Its value consists of two datetimes - * concatenated, separated by '/'. This may be adjusted in the future and returned back from what was originally - * requested. - * - * @return the timespan value. - */ - public String timespan() { - return this.timespan; - } - - /** - * Set the timespan property: The timespan for which the data was retrieved. Its value consists of two datetimes - * concatenated, separated by '/'. This may be adjusted in the future and returned back from what was originally - * requested. - * - * @param timespan the timespan value to set. - * @return the ResponseInner object itself. - */ - public ResponseInner withTimespan(String timespan) { - this.timespan = timespan; - return this; - } - - /** - * Get the interval property: The interval (window size) for which the metric data was returned in. This may be - * adjusted in the future and returned back from what was originally requested. This is not present if a metadata - * request was made. - * - * @return the interval value. - */ - public Duration interval() { - return this.interval; - } - - /** - * Set the interval property: The interval (window size) for which the metric data was returned in. This may be - * adjusted in the future and returned back from what was originally requested. This is not present if a metadata - * request was made. - * - * @param interval the interval value to set. - * @return the ResponseInner object itself. - */ - public ResponseInner withInterval(Duration interval) { - this.interval = interval; - return this; - } - - /** - * Get the namespace property: The namespace of the metrics being queried. - * - * @return the namespace value. - */ - public String namespace() { - return this.namespace; - } - - /** - * Set the namespace property: The namespace of the metrics being queried. - * - * @param namespace the namespace value to set. - * @return the ResponseInner object itself. - */ - public ResponseInner withNamespace(String namespace) { - this.namespace = namespace; - return this; - } - - /** - * Get the resourceRegion property: The region of the resource being queried for metrics. - * - * @return the resourceRegion value. - */ - public String resourceRegion() { - return this.resourceRegion; - } - - /** - * Set the resourceRegion property: The region of the resource being queried for metrics. - * - * @param resourceRegion the resourceRegion value to set. - * @return the ResponseInner object itself. - */ - public ResponseInner withResourceRegion(String resourceRegion) { - this.resourceRegion = resourceRegion; - return this; - } - - /** - * Get the value property: the value of the collection. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: the value of the collection. - * - * @param value the value value to set. - * @return the ResponseInner object itself. - */ - public ResponseInner withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (timespan() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property timespan in model ResponseInner")); - } - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model ResponseInner")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/ScaleRuleInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/ScaleRuleInner.java deleted file mode 100644 index 986984e76161..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/ScaleRuleInner.java +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.models.MetricTrigger; -import com.azure.resourcemanager.monitor.models.ScaleAction; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** A rule that provide the triggers and parameters for the scaling action. */ -@Fluent -public final class ScaleRuleInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ScaleRuleInner.class); - - /* - * the trigger that results in a scaling action. - */ - @JsonProperty(value = "metricTrigger", required = true) - private MetricTrigger metricTrigger; - - /* - * the parameters for the scaling action. - */ - @JsonProperty(value = "scaleAction", required = true) - private ScaleAction scaleAction; - - /** - * Get the metricTrigger property: the trigger that results in a scaling action. - * - * @return the metricTrigger value. - */ - public MetricTrigger metricTrigger() { - return this.metricTrigger; - } - - /** - * Set the metricTrigger property: the trigger that results in a scaling action. - * - * @param metricTrigger the metricTrigger value to set. - * @return the ScaleRuleInner object itself. - */ - public ScaleRuleInner withMetricTrigger(MetricTrigger metricTrigger) { - this.metricTrigger = metricTrigger; - return this; - } - - /** - * Get the scaleAction property: the parameters for the scaling action. - * - * @return the scaleAction value. - */ - public ScaleAction scaleAction() { - return this.scaleAction; - } - - /** - * Set the scaleAction property: the parameters for the scaling action. - * - * @param scaleAction the scaleAction value to set. - * @return the ScaleRuleInner object itself. - */ - public ScaleRuleInner withScaleAction(ScaleAction scaleAction) { - this.scaleAction = scaleAction; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (metricTrigger() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property metricTrigger in model ScaleRuleInner")); - } else { - metricTrigger().validate(); - } - if (scaleAction() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property scaleAction in model ScaleRuleInner")); - } else { - scaleAction().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/ScopedResourceInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/ScopedResourceInner.java deleted file mode 100644 index f161336eed45..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/ScopedResourceInner.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** A private link scoped resource. */ -@JsonFlatten -@Fluent -public class ScopedResourceInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ScopedResourceInner.class); - - /* - * The resource id of the scoped Azure monitor resource. - */ - @JsonProperty(value = "properties.linkedResourceId") - private String linkedResourceId; - - /* - * State of the private endpoint connection. - */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; - - /** - * Get the linkedResourceId property: The resource id of the scoped Azure monitor resource. - * - * @return the linkedResourceId value. - */ - public String linkedResourceId() { - return this.linkedResourceId; - } - - /** - * Set the linkedResourceId property: The resource id of the scoped Azure monitor resource. - * - * @param linkedResourceId the linkedResourceId value to set. - * @return the ScopedResourceInner object itself. - */ - public ScopedResourceInner withLinkedResourceId(String linkedResourceId) { - this.linkedResourceId = linkedResourceId; - return this; - } - - /** - * Get the provisioningState property: State of the private endpoint connection. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/SingleMetricBaselineInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/SingleMetricBaselineInner.java deleted file mode 100644 index cdcc57cbe84d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/SingleMetricBaselineInner.java +++ /dev/null @@ -1,259 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.models.TimeSeriesBaseline; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.Duration; -import java.util.List; - -/** The baseline results of a single metric. */ -@JsonFlatten -@Fluent -public class SingleMetricBaselineInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SingleMetricBaselineInner.class); - - /* - * The metric baseline Id. - */ - @JsonProperty(value = "id", required = true) - private String id; - - /* - * The resource type of the metric baseline resource. - */ - @JsonProperty(value = "type", required = true) - private String type; - - /* - * The name of the metric for which the baselines were retrieved. - */ - @JsonProperty(value = "name", required = true) - private String name; - - /* - * The timespan for which the data was retrieved. Its value consists of two - * datetimes concatenated, separated by '/'. This may be adjusted in the - * future and returned back from what was originally requested. - */ - @JsonProperty(value = "properties.timespan", required = true) - private String timespan; - - /* - * The interval (window size) for which the metric data was returned in. - * This may be adjusted in the future and returned back from what was - * originally requested. This is not present if a metadata request was - * made. - */ - @JsonProperty(value = "properties.interval", required = true) - private Duration interval; - - /* - * The namespace of the metrics been queried. - */ - @JsonProperty(value = "properties.namespace") - private String namespace; - - /* - * The baseline for each time series that was queried. - */ - @JsonProperty(value = "properties.baselines", required = true) - private List baselines; - - /** - * Get the id property: The metric baseline Id. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: The metric baseline Id. - * - * @param id the id value to set. - * @return the SingleMetricBaselineInner object itself. - */ - public SingleMetricBaselineInner withId(String id) { - this.id = id; - return this; - } - - /** - * Get the type property: The resource type of the metric baseline resource. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Set the type property: The resource type of the metric baseline resource. - * - * @param type the type value to set. - * @return the SingleMetricBaselineInner object itself. - */ - public SingleMetricBaselineInner withType(String type) { - this.type = type; - return this; - } - - /** - * Get the name property: The name of the metric for which the baselines were retrieved. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the metric for which the baselines were retrieved. - * - * @param name the name value to set. - * @return the SingleMetricBaselineInner object itself. - */ - public SingleMetricBaselineInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the timespan property: The timespan for which the data was retrieved. Its value consists of two datetimes - * concatenated, separated by '/'. This may be adjusted in the future and returned back from what was originally - * requested. - * - * @return the timespan value. - */ - public String timespan() { - return this.timespan; - } - - /** - * Set the timespan property: The timespan for which the data was retrieved. Its value consists of two datetimes - * concatenated, separated by '/'. This may be adjusted in the future and returned back from what was originally - * requested. - * - * @param timespan the timespan value to set. - * @return the SingleMetricBaselineInner object itself. - */ - public SingleMetricBaselineInner withTimespan(String timespan) { - this.timespan = timespan; - return this; - } - - /** - * Get the interval property: The interval (window size) for which the metric data was returned in. This may be - * adjusted in the future and returned back from what was originally requested. This is not present if a metadata - * request was made. - * - * @return the interval value. - */ - public Duration interval() { - return this.interval; - } - - /** - * Set the interval property: The interval (window size) for which the metric data was returned in. This may be - * adjusted in the future and returned back from what was originally requested. This is not present if a metadata - * request was made. - * - * @param interval the interval value to set. - * @return the SingleMetricBaselineInner object itself. - */ - public SingleMetricBaselineInner withInterval(Duration interval) { - this.interval = interval; - return this; - } - - /** - * Get the namespace property: The namespace of the metrics been queried. - * - * @return the namespace value. - */ - public String namespace() { - return this.namespace; - } - - /** - * Set the namespace property: The namespace of the metrics been queried. - * - * @param namespace the namespace value to set. - * @return the SingleMetricBaselineInner object itself. - */ - public SingleMetricBaselineInner withNamespace(String namespace) { - this.namespace = namespace; - return this; - } - - /** - * Get the baselines property: The baseline for each time series that was queried. - * - * @return the baselines value. - */ - public List baselines() { - return this.baselines; - } - - /** - * Set the baselines property: The baseline for each time series that was queried. - * - * @param baselines the baselines value to set. - * @return the SingleMetricBaselineInner object itself. - */ - public SingleMetricBaselineInner withBaselines(List baselines) { - this.baselines = baselines; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (id() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property id in model SingleMetricBaselineInner")); - } - if (type() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property type in model SingleMetricBaselineInner")); - } - if (name() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property name in model SingleMetricBaselineInner")); - } - if (timespan() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property timespan in model SingleMetricBaselineInner")); - } - if (interval() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property interval in model SingleMetricBaselineInner")); - } - if (baselines() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property baselines in model SingleMetricBaselineInner")); - } else { - baselines().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/VMInsightsOnboardingStatusInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/VMInsightsOnboardingStatusInner.java deleted file mode 100644 index 740af41b10d9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/VMInsightsOnboardingStatusInner.java +++ /dev/null @@ -1,152 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.models.DataContainer; -import com.azure.resourcemanager.monitor.models.DataStatus; -import com.azure.resourcemanager.monitor.models.OnboardingStatus; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** VM Insights onboarding status for a resource. */ -@JsonFlatten -@Fluent -public class VMInsightsOnboardingStatusInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VMInsightsOnboardingStatusInner.class); - - /* - * Azure Resource Manager identifier of the resource whose onboarding - * status is being represented. - */ - @JsonProperty(value = "properties.resourceId") - private String resourceId; - - /* - * The onboarding status for the resource. Note that, a higher level scope, - * e.g., resource group or subscription, is considered onboarded if at - * least one resource under it is onboarded. - */ - @JsonProperty(value = "properties.onboardingStatus") - private OnboardingStatus onboardingStatus; - - /* - * The status of VM Insights data from the resource. When reported as - * `present` the data array will contain information about the data - * containers to which data for the specified resource is being routed. - */ - @JsonProperty(value = "properties.dataStatus") - private DataStatus dataStatus; - - /* - * Containers that currently store VM Insights data for the specified - * resource. - */ - @JsonProperty(value = "properties.data") - private List data; - - /** - * Get the resourceId property: Azure Resource Manager identifier of the resource whose onboarding status is being - * represented. - * - * @return the resourceId value. - */ - public String resourceId() { - return this.resourceId; - } - - /** - * Set the resourceId property: Azure Resource Manager identifier of the resource whose onboarding status is being - * represented. - * - * @param resourceId the resourceId value to set. - * @return the VMInsightsOnboardingStatusInner object itself. - */ - public VMInsightsOnboardingStatusInner withResourceId(String resourceId) { - this.resourceId = resourceId; - return this; - } - - /** - * Get the onboardingStatus property: The onboarding status for the resource. Note that, a higher level scope, e.g., - * resource group or subscription, is considered onboarded if at least one resource under it is onboarded. - * - * @return the onboardingStatus value. - */ - public OnboardingStatus onboardingStatus() { - return this.onboardingStatus; - } - - /** - * Set the onboardingStatus property: The onboarding status for the resource. Note that, a higher level scope, e.g., - * resource group or subscription, is considered onboarded if at least one resource under it is onboarded. - * - * @param onboardingStatus the onboardingStatus value to set. - * @return the VMInsightsOnboardingStatusInner object itself. - */ - public VMInsightsOnboardingStatusInner withOnboardingStatus(OnboardingStatus onboardingStatus) { - this.onboardingStatus = onboardingStatus; - return this; - } - - /** - * Get the dataStatus property: The status of VM Insights data from the resource. When reported as `present` the - * data array will contain information about the data containers to which data for the specified resource is being - * routed. - * - * @return the dataStatus value. - */ - public DataStatus dataStatus() { - return this.dataStatus; - } - - /** - * Set the dataStatus property: The status of VM Insights data from the resource. When reported as `present` the - * data array will contain information about the data containers to which data for the specified resource is being - * routed. - * - * @param dataStatus the dataStatus value to set. - * @return the VMInsightsOnboardingStatusInner object itself. - */ - public VMInsightsOnboardingStatusInner withDataStatus(DataStatus dataStatus) { - this.dataStatus = dataStatus; - return this; - } - - /** - * Get the data property: Containers that currently store VM Insights data for the specified resource. - * - * @return the data value. - */ - public List data() { - return this.data; - } - - /** - * Set the data property: Containers that currently store VM Insights data for the specified resource. - * - * @param data the data value to set. - * @return the VMInsightsOnboardingStatusInner object itself. - */ - public VMInsightsOnboardingStatusInner withData(List data) { - this.data = data; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (data() != null) { - data().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/package-info.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/package-info.java deleted file mode 100644 index 6734ccece90d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** Package containing the inner data models for MonitorClient. Monitor Management Client. */ -package com.azure.resourcemanager.monitor.fluent.models; diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/package-info.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/package-info.java deleted file mode 100644 index e9222013dee9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** Package containing the service clients for MonitorClient. Monitor Management Client. */ -package com.azure.resourcemanager.monitor.fluent; diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/ActionGroupImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/ActionGroupImpl.java deleted file mode 100644 index 55df278cb2b0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/ActionGroupImpl.java +++ /dev/null @@ -1,599 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.monitor.implementation; - -import com.azure.resourcemanager.monitor.MonitorManager; -import com.azure.resourcemanager.monitor.models.ActionGroup; -import com.azure.resourcemanager.monitor.models.AutomationRunbookReceiver; -import com.azure.resourcemanager.monitor.models.AzureAppPushReceiver; -import com.azure.resourcemanager.monitor.models.AzureFunctionReceiver; -import com.azure.resourcemanager.monitor.models.EmailReceiver; -import com.azure.resourcemanager.monitor.models.ItsmReceiver; -import com.azure.resourcemanager.monitor.models.LogicAppReceiver; -import com.azure.resourcemanager.monitor.models.SmsReceiver; -import com.azure.resourcemanager.monitor.models.VoiceReceiver; -import com.azure.resourcemanager.monitor.models.WebhookReceiver; -import com.azure.resourcemanager.monitor.fluent.models.ActionGroupResourceInner; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils; -import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.GroupableResourceImpl; -import java.util.ArrayList; -import java.util.List; -import java.util.TreeMap; -import reactor.core.publisher.Mono; - -/** Implementation for ActionGroup. */ -class ActionGroupImpl - extends GroupableResourceImpl - implements ActionGroup, - ActionGroup.Definition, - ActionGroup.Update, - ActionGroup.UpdateStages.WithActionUpdateDefinition { - private static final String EMAIL_SUFFIX = "_-EmailAction-"; - private static final String SMS_SUFFIX = "_-SMSAction-"; - private static final String APP_ACTION_SUFFIX = "_-AzureAppAction-"; - private static final String VOICE_SUFFIX = "_-VoiceAction-"; - private static final String RUN_BOOK_SUFFIX = " (RB)"; - private static final String LOGIC_SUFFIX = " (LA)"; - private static final String FUNCTION_SUFFIX = " (F)"; - private static final String WEBHOOK_SUFFIX = " (WH)"; - private static final String ITSM_SUFFIX = " (ITSM)"; - - private String actionReceiverPrefix; - private TreeMap emailReceivers; - private TreeMap smsReceivers; - private TreeMap appActionReceivers; - private TreeMap voiceReceivers; - private TreeMap runBookReceivers; - private TreeMap logicReceivers; - private TreeMap functionReceivers; - private TreeMap webhookReceivers; - private TreeMap itsmReceivers; - - ActionGroupImpl(String name, final ActionGroupResourceInner innerModel, final MonitorManager monitorManager) { - super(name, innerModel, monitorManager); - this.actionReceiverPrefix = ""; - this.emailReceivers = new TreeMap<>(); - this.smsReceivers = new TreeMap<>(); - this.appActionReceivers = new TreeMap<>(); - this.voiceReceivers = new TreeMap<>(); - this.runBookReceivers = new TreeMap<>(); - this.logicReceivers = new TreeMap<>(); - this.functionReceivers = new TreeMap<>(); - this.webhookReceivers = new TreeMap<>(); - this.itsmReceivers = new TreeMap<>(); - if (isInCreateMode()) { - this.innerModel().withEnabled(true); - this - .innerModel() - .withGroupShortName(this.name().substring(0, (this.name().length() > 12) ? 12 : this.name().length())); - } else { - this.withExistingResourceGroup(ResourceUtils.groupFromResourceId(this.id())); - } - } - - @Override - public String shortName() { - return this.innerModel().groupShortName(); - } - - @Override - public List emailReceivers() { - return this.innerModel().emailReceivers(); - } - - @Override - public List smsReceivers() { - return this.innerModel().smsReceivers(); - } - - @Override - public List webhookReceivers() { - return this.innerModel().webhookReceivers(); - } - - @Override - public List itsmReceivers() { - return this.innerModel().itsmReceivers(); - } - - @Override - public List pushNotificationReceivers() { - return this.innerModel().azureAppPushReceivers(); - } - - @Override - public List automationRunbookReceivers() { - return this.innerModel().automationRunbookReceivers(); - } - - @Override - public List voiceReceivers() { - return this.innerModel().voiceReceivers(); - } - - @Override - public List logicAppReceivers() { - return this.innerModel().logicAppReceivers(); - } - - @Override - public List azureFunctionReceivers() { - return this.innerModel().azureFunctionReceivers(); - } - - @Override - public ActionGroupImpl withoutReceiver(String actionNamePrefix) { - this.updateReceiver(actionNamePrefix); - this.withoutEmail(); - this.withoutSms(); - this.withoutPushNotification(); - this.withoutVoice(); - this.withoutAutomationRunbook(); - this.withoutLogicApp(); - this.withoutAzureFunction(); - this.withoutWebhook(); - this.withoutItsm(); - - return this.parent(); - } - - @Override - public ActionGroupImpl defineReceiver(String actionNamePrefix) { - return this.updateReceiver(actionNamePrefix); - } - - @Override - public ActionGroupImpl updateReceiver(String actionNamePrefix) { - this.actionReceiverPrefix = actionNamePrefix; - this.emailReceivers.clear(); - this.smsReceivers.clear(); - this.appActionReceivers.clear(); - this.voiceReceivers.clear(); - this.runBookReceivers.clear(); - this.logicReceivers.clear(); - this.functionReceivers.clear(); - this.webhookReceivers.clear(); - this.itsmReceivers.clear(); - - if (this.innerModel().emailReceivers() != null) { - for (EmailReceiver er : this.innerModel().emailReceivers()) { - this.emailReceivers.put(er.name(), er); - } - } - - if (this.innerModel().smsReceivers() != null) { - for (SmsReceiver sr : this.innerModel().smsReceivers()) { - this.smsReceivers.put(sr.name(), sr); - } - } - - if (this.innerModel().azureAppPushReceivers() != null) { - for (AzureAppPushReceiver ar : this.innerModel().azureAppPushReceivers()) { - this.appActionReceivers.put(ar.name(), ar); - } - } - - if (this.innerModel().voiceReceivers() != null) { - for (VoiceReceiver vr : this.innerModel().voiceReceivers()) { - this.voiceReceivers.put(vr.name(), vr); - } - } - - if (this.innerModel().automationRunbookReceivers() != null) { - for (AutomationRunbookReceiver ar : this.innerModel().automationRunbookReceivers()) { - this.runBookReceivers.put(ar.name(), ar); - } - } - - if (this.innerModel().logicAppReceivers() != null) { - for (LogicAppReceiver lr : this.innerModel().logicAppReceivers()) { - this.logicReceivers.put(lr.name(), lr); - } - } - - if (this.innerModel().azureFunctionReceivers() != null) { - for (AzureFunctionReceiver fr : this.innerModel().azureFunctionReceivers()) { - this.functionReceivers.put(fr.name(), fr); - } - } - - if (this.innerModel().webhookReceivers() != null) { - for (WebhookReceiver wr : this.innerModel().webhookReceivers()) { - this.webhookReceivers.put(wr.name(), wr); - } - } - - if (this.innerModel().itsmReceivers() != null) { - for (ItsmReceiver ir : this.innerModel().itsmReceivers()) { - this.itsmReceivers.put(ir.name(), ir); - } - } - return this; - } - - @Override - public ActionGroupImpl withShortName(String shortName) { - this.innerModel().withGroupShortName(shortName); - return this; - } - - @Override - public Mono createResourceAsync() { - this.innerModel().withLocation("global"); - return this - .manager() - .serviceClient() - .getActionGroups() - .createOrUpdateAsync(this.resourceGroupName(), this.name(), this.innerModel()) - .map(innerToFluentMap(this)); - } - - @Override - protected Mono getInnerAsync() { - return this.manager().serviceClient().getActionGroups() - .getByResourceGroupAsync(this.resourceGroupName(), this.name()); - } - - @Override - public ActionGroupImpl withEmail(String emailAddress) { - this.withoutEmail(); - - String compositeKey = this.actionReceiverPrefix + EMAIL_SUFFIX; - EmailReceiver er = new EmailReceiver(); - er.withName(compositeKey); - er.withEmailAddress(emailAddress); - - this.emailReceivers.put(compositeKey, er); - return this; - } - - @Override - public ActionGroupImpl withSms(String countryCode, String phoneNumber) { - this.withoutSms(); - - String compositeKey = this.actionReceiverPrefix + SMS_SUFFIX; - SmsReceiver sr = new SmsReceiver(); - sr.withName(compositeKey); - sr.withCountryCode(countryCode); - sr.withPhoneNumber(phoneNumber); - - this.smsReceivers.put(compositeKey, sr); - return this; - } - - @Override - public ActionGroupImpl withWebhook(String serviceUri) { - this.withoutWebhook(); - - String compositeKey = this.actionReceiverPrefix + WEBHOOK_SUFFIX; - WebhookReceiver wr = new WebhookReceiver(); - wr.withName(compositeKey); - wr.withServiceUri(serviceUri); - - this.webhookReceivers.put(compositeKey, wr); - return this; - } - - @Override - public ActionGroupImpl withItsm( - String workspaceId, String connectionId, String ticketConfiguration, String region) { - this.withoutItsm(); - - String compositeKey = this.actionReceiverPrefix + ITSM_SUFFIX; - ItsmReceiver ir = new ItsmReceiver(); - ir.withName(compositeKey); - ir.withWorkspaceId(workspaceId); - ir.withConnectionId(connectionId); - ir.withRegion(region); - ir.withTicketConfiguration(ticketConfiguration); - - this.itsmReceivers.put(compositeKey, ir); - return this; - } - - @Override - public ActionGroupImpl withPushNotification(String emailAddress) { - this.withoutPushNotification(); - - String compositeKey = this.actionReceiverPrefix + APP_ACTION_SUFFIX; - AzureAppPushReceiver ar = new AzureAppPushReceiver(); - ar.withName(compositeKey); - ar.withEmailAddress(emailAddress); - - this.appActionReceivers.put(compositeKey, ar); - return this; - } - - @Override - public ActionGroupImpl withAutomationRunbook( - String automationAccountId, String runbookName, String webhookResourceId, boolean isGlobalRunbook) { - this.withoutAutomationRunbook(); - - String compositeKey = this.actionReceiverPrefix + RUN_BOOK_SUFFIX; - AutomationRunbookReceiver arr = new AutomationRunbookReceiver(); - arr.withName(compositeKey); - arr.withAutomationAccountId(automationAccountId); - arr.withRunbookName(runbookName); - arr.withWebhookResourceId(webhookResourceId); - arr.withIsGlobalRunbook(isGlobalRunbook); - - this.runBookReceivers.put(compositeKey, arr); - return this; - } - - @Override - public ActionGroupImpl withVoice(String countryCode, String phoneNumber) { - this.withoutVoice(); - - String compositeKey = this.actionReceiverPrefix + VOICE_SUFFIX; - VoiceReceiver vr = new VoiceReceiver(); - vr.withName(compositeKey); - vr.withCountryCode(countryCode); - vr.withPhoneNumber(phoneNumber); - - this.voiceReceivers.put(compositeKey, vr); - return this; - } - - @Override - public ActionGroupImpl withLogicApp(String logicAppResourceId, String callbackUrl) { - this.withoutLogicApp(); - - String compositeKey = this.actionReceiverPrefix + LOGIC_SUFFIX; - LogicAppReceiver lr = new LogicAppReceiver(); - lr.withName(compositeKey); - lr.withResourceId(logicAppResourceId); - lr.withCallbackUrl(callbackUrl); - - this.logicReceivers.put(compositeKey, lr); - return this; - } - - @Override - public ActionGroupImpl withAzureFunction(String functionAppResourceId, String functionName, String httpTriggerUrl) { - this.withoutAzureFunction(); - String compositeKey = this.actionReceiverPrefix + FUNCTION_SUFFIX; - - AzureFunctionReceiver afr = new AzureFunctionReceiver(); - afr.withName(compositeKey); - afr.withFunctionAppResourceId(functionAppResourceId); - afr.withFunctionName(functionName); - afr.withHttpTriggerUrl(httpTriggerUrl); - - this.functionReceivers.put(compositeKey, afr); - return this; - } - - @Override - public ActionGroupImpl attach() { - this.actionReceiverPrefix = ""; - - populateReceivers(); - - this.emailReceivers.clear(); - this.smsReceivers.clear(); - this.appActionReceivers.clear(); - this.voiceReceivers.clear(); - this.runBookReceivers.clear(); - this.logicReceivers.clear(); - this.functionReceivers.clear(); - this.webhookReceivers.clear(); - this.itsmReceivers.clear(); - return this; - } - - @Override - public ActionGroupImpl withoutEmail() { - String compositeKey = this.actionReceiverPrefix + EMAIL_SUFFIX; - if (this.emailReceivers.containsKey(compositeKey)) { - this.emailReceivers.remove(compositeKey); - } - if (this.emailReceivers.containsKey(this.actionReceiverPrefix)) { - this.emailReceivers.remove(actionReceiverPrefix); - } - return this; - } - - @Override - public ActionGroupImpl withoutSms() { - String compositeKey = this.actionReceiverPrefix + SMS_SUFFIX; - if (this.smsReceivers.containsKey(compositeKey)) { - this.smsReceivers.remove(compositeKey); - } - if (this.smsReceivers.containsKey(this.actionReceiverPrefix)) { - this.smsReceivers.remove(actionReceiverPrefix); - } - return this; - } - - @Override - public ActionGroupImpl withoutWebhook() { - String compositeKey = this.actionReceiverPrefix + WEBHOOK_SUFFIX; - if (this.webhookReceivers.containsKey(compositeKey)) { - this.webhookReceivers.remove(compositeKey); - } - if (this.webhookReceivers.containsKey(this.actionReceiverPrefix)) { - this.webhookReceivers.remove(actionReceiverPrefix); - } - return this; - } - - @Override - public ActionGroupImpl withoutItsm() { - String compositeKey = this.actionReceiverPrefix + ITSM_SUFFIX; - if (this.itsmReceivers.containsKey(compositeKey)) { - this.itsmReceivers.remove(compositeKey); - } - if (this.itsmReceivers.containsKey(this.actionReceiverPrefix)) { - this.itsmReceivers.remove(actionReceiverPrefix); - } - return this; - } - - @Override - public ActionGroupImpl withoutPushNotification() { - String compositeKey = this.actionReceiverPrefix + APP_ACTION_SUFFIX; - if (this.appActionReceivers.containsKey(compositeKey)) { - this.appActionReceivers.remove(compositeKey); - } - if (this.appActionReceivers.containsKey(this.actionReceiverPrefix)) { - this.appActionReceivers.remove(actionReceiverPrefix); - } - return this; - } - - @Override - public ActionGroupImpl withoutAutomationRunbook() { - String compositeKey = this.actionReceiverPrefix + RUN_BOOK_SUFFIX; - if (this.runBookReceivers.containsKey(compositeKey)) { - this.runBookReceivers.remove(compositeKey); - } - if (this.runBookReceivers.containsKey(this.actionReceiverPrefix)) { - this.runBookReceivers.remove(actionReceiverPrefix); - } - return this; - } - - @Override - public ActionGroupImpl withoutVoice() { - String compositeKey = this.actionReceiverPrefix + VOICE_SUFFIX; - if (this.voiceReceivers.containsKey(compositeKey)) { - this.voiceReceivers.remove(compositeKey); - } - if (this.voiceReceivers.containsKey(this.actionReceiverPrefix)) { - this.voiceReceivers.remove(actionReceiverPrefix); - } - return this; - } - - @Override - public ActionGroupImpl withoutLogicApp() { - String compositeKey = this.actionReceiverPrefix + LOGIC_SUFFIX; - if (this.logicReceivers.containsKey(compositeKey)) { - this.logicReceivers.remove(compositeKey); - } - if (this.logicReceivers.containsKey(this.actionReceiverPrefix)) { - this.logicReceivers.remove(actionReceiverPrefix); - } - return this; - } - - @Override - public ActionGroupImpl withoutAzureFunction() { - String compositeKey = this.actionReceiverPrefix + LOGIC_SUFFIX; - if (this.functionReceivers.containsKey(compositeKey)) { - this.functionReceivers.remove(compositeKey); - } - if (this.functionReceivers.containsKey(this.actionReceiverPrefix)) { - this.functionReceivers.remove(actionReceiverPrefix); - } - return this; - } - - @Override - public ActionGroupImpl parent() { - return this.attach(); - } - - private void populateReceivers() { - if (this.emailReceivers.values().size() > 0) { - if (this.innerModel().emailReceivers() == null) { - this.innerModel().withEmailReceivers(new ArrayList()); - } else { - this.innerModel().emailReceivers().clear(); - } - this.innerModel().emailReceivers().addAll(this.emailReceivers.values()); - } else { - this.innerModel().withEmailReceivers(null); - } - - if (this.smsReceivers.values().size() > 0) { - if (this.innerModel().smsReceivers() == null) { - this.innerModel().withSmsReceivers(new ArrayList()); - } else { - this.innerModel().smsReceivers().clear(); - } - this.innerModel().smsReceivers().addAll(this.smsReceivers.values()); - } else { - this.innerModel().withSmsReceivers(null); - } - - if (this.appActionReceivers.values().size() > 0) { - if (this.innerModel().azureAppPushReceivers() == null) { - this.innerModel().withAzureAppPushReceivers(new ArrayList()); - } else { - this.innerModel().azureAppPushReceivers().clear(); - } - this.innerModel().azureAppPushReceivers().addAll(this.appActionReceivers.values()); - } else { - this.innerModel().withAzureAppPushReceivers(null); - } - - if (this.voiceReceivers.values().size() > 0) { - if (this.innerModel().voiceReceivers() == null) { - this.innerModel().withVoiceReceivers(new ArrayList()); - } else { - this.innerModel().voiceReceivers().clear(); - } - this.innerModel().voiceReceivers().addAll(this.voiceReceivers.values()); - } else { - this.innerModel().withVoiceReceivers(null); - } - - if (this.runBookReceivers.values().size() > 0) { - if (this.innerModel().automationRunbookReceivers() == null) { - this.innerModel().withAutomationRunbookReceivers(new ArrayList()); - } else { - this.innerModel().automationRunbookReceivers().clear(); - } - this.innerModel().automationRunbookReceivers().addAll(this.runBookReceivers.values()); - } else { - this.innerModel().withAutomationRunbookReceivers(null); - } - - if (this.logicReceivers.values().size() > 0) { - if (this.innerModel().logicAppReceivers() == null) { - this.innerModel().withLogicAppReceivers(new ArrayList()); - } else { - this.innerModel().logicAppReceivers().clear(); - } - this.innerModel().logicAppReceivers().addAll(this.logicReceivers.values()); - } else { - this.innerModel().withLogicAppReceivers(null); - } - - if (this.functionReceivers.values().size() > 0) { - if (this.innerModel().azureFunctionReceivers() == null) { - this.innerModel().withAzureFunctionReceivers(new ArrayList()); - } else { - this.innerModel().azureFunctionReceivers().clear(); - } - this.innerModel().azureFunctionReceivers().addAll(this.functionReceivers.values()); - } else { - this.innerModel().withAzureFunctionReceivers(null); - } - - if (this.webhookReceivers.values().size() > 0) { - if (this.innerModel().webhookReceivers() == null) { - this.innerModel().withWebhookReceivers(new ArrayList()); - } else { - this.innerModel().webhookReceivers().clear(); - } - this.innerModel().webhookReceivers().addAll(this.webhookReceivers.values()); - } else { - this.innerModel().withWebhookReceivers(null); - } - - if (this.itsmReceivers.values().size() > 0) { - if (this.innerModel().itsmReceivers() == null) { - this.innerModel().withItsmReceivers(new ArrayList()); - } else { - this.innerModel().itsmReceivers().clear(); - } - this.innerModel().itsmReceivers().addAll(this.itsmReceivers.values()); - } else { - this.innerModel().withItsmReceivers(null); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/ActionGroupsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/ActionGroupsClientImpl.java deleted file mode 100644 index 781c7b9bf292..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/ActionGroupsClientImpl.java +++ /dev/null @@ -1,1260 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.fluent.ActionGroupsClient; -import com.azure.resourcemanager.monitor.fluent.models.ActionGroupResourceInner; -import com.azure.resourcemanager.monitor.models.ActionGroupList; -import com.azure.resourcemanager.monitor.models.ActionGroupPatchBody; -import com.azure.resourcemanager.monitor.models.EnableRequest; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ActionGroupsClient. */ -public final class ActionGroupsClientImpl - implements InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete, - ActionGroupsClient { - private final ClientLogger logger = new ClientLogger(ActionGroupsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final ActionGroupsService service; - - /** The service client containing this operation class. */ - private final MonitorClientImpl client; - - /** - * Initializes an instance of ActionGroupsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ActionGroupsClientImpl(MonitorClientImpl client) { - this.service = - RestProxy.create(ActionGroupsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MonitorClientActionGroups to be used by the proxy service to perform - * REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MonitorClientActionG") - private interface ActionGroupsService { - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights" - + "/actionGroups/{actionGroupName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("actionGroupName") String actionGroupName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ActionGroupResourceInner actionGroup, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights" - + "/actionGroups/{actionGroupName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("actionGroupName") String actionGroupName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights" - + "/actionGroups/{actionGroupName}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("actionGroupName") String actionGroupName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights" - + "/actionGroups/{actionGroupName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("actionGroupName") String actionGroupName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ActionGroupPatchBody actionGroupPatch, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/microsoft.insights/actionGroups") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights" - + "/actionGroups") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights" - + "/actionGroups/{actionGroupName}/subscribe") - @ExpectedResponses({200, 409}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> enableReceiver( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("actionGroupName") String actionGroupName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") EnableRequest enableRequest, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Create a new action group or update an existing one. - * - * @param resourceGroupName The name of the resource group. - * @param actionGroupName The name of the action group. - * @param actionGroup The action group to create or use for the update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an action group resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String actionGroupName, ActionGroupResourceInner actionGroup) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (actionGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter actionGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (actionGroup == null) { - return Mono.error(new IllegalArgumentException("Parameter actionGroup is required and cannot be null.")); - } else { - actionGroup.validate(); - } - final String apiVersion = "2019-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - actionGroupName, - this.client.getSubscriptionId(), - apiVersion, - actionGroup, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create a new action group or update an existing one. - * - * @param resourceGroupName The name of the resource group. - * @param actionGroupName The name of the action group. - * @param actionGroup The action group to create or use for the update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an action group resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String actionGroupName, ActionGroupResourceInner actionGroup, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (actionGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter actionGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (actionGroup == null) { - return Mono.error(new IllegalArgumentException("Parameter actionGroup is required and cannot be null.")); - } else { - actionGroup.validate(); - } - final String apiVersion = "2019-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - actionGroupName, - this.client.getSubscriptionId(), - apiVersion, - actionGroup, - accept, - context); - } - - /** - * Create a new action group or update an existing one. - * - * @param resourceGroupName The name of the resource group. - * @param actionGroupName The name of the action group. - * @param actionGroup The action group to create or use for the update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an action group resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, String actionGroupName, ActionGroupResourceInner actionGroup) { - return createOrUpdateWithResponseAsync(resourceGroupName, actionGroupName, actionGroup) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Create a new action group or update an existing one. - * - * @param resourceGroupName The name of the resource group. - * @param actionGroupName The name of the action group. - * @param actionGroup The action group to create or use for the update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an action group resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ActionGroupResourceInner createOrUpdate( - String resourceGroupName, String actionGroupName, ActionGroupResourceInner actionGroup) { - return createOrUpdateAsync(resourceGroupName, actionGroupName, actionGroup).block(); - } - - /** - * Create a new action group or update an existing one. - * - * @param resourceGroupName The name of the resource group. - * @param actionGroupName The name of the action group. - * @param actionGroup The action group to create or use for the update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an action group resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceGroupName, String actionGroupName, ActionGroupResourceInner actionGroup, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, actionGroupName, actionGroup, context).block(); - } - - /** - * Get an action group. - * - * @param resourceGroupName The name of the resource group. - * @param actionGroupName The name of the action group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an action group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String actionGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (actionGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter actionGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - actionGroupName, - this.client.getSubscriptionId(), - apiVersion, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get an action group. - * - * @param resourceGroupName The name of the resource group. - * @param actionGroupName The name of the action group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an action group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String actionGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (actionGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter actionGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - actionGroupName, - this.client.getSubscriptionId(), - apiVersion, - accept, - context); - } - - /** - * Get an action group. - * - * @param resourceGroupName The name of the resource group. - * @param actionGroupName The name of the action group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an action group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync(String resourceGroupName, String actionGroupName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, actionGroupName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get an action group. - * - * @param resourceGroupName The name of the resource group. - * @param actionGroupName The name of the action group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an action group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ActionGroupResourceInner getByResourceGroup(String resourceGroupName, String actionGroupName) { - return getByResourceGroupAsync(resourceGroupName, actionGroupName).block(); - } - - /** - * Get an action group. - * - * @param resourceGroupName The name of the resource group. - * @param actionGroupName The name of the action group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an action group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String actionGroupName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, actionGroupName, context).block(); - } - - /** - * Delete an action group. - * - * @param resourceGroupName The name of the resource group. - * @param actionGroupName The name of the action group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String resourceGroupName, String actionGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (actionGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter actionGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - actionGroupName, - this.client.getSubscriptionId(), - apiVersion, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete an action group. - * - * @param resourceGroupName The name of the resource group. - * @param actionGroupName The name of the action group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String actionGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (actionGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter actionGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - actionGroupName, - this.client.getSubscriptionId(), - apiVersion, - accept, - context); - } - - /** - * Delete an action group. - * - * @param resourceGroupName The name of the resource group. - * @param actionGroupName The name of the action group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String actionGroupName) { - return deleteWithResponseAsync(resourceGroupName, actionGroupName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Delete an action group. - * - * @param resourceGroupName The name of the resource group. - * @param actionGroupName The name of the action group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String actionGroupName) { - deleteAsync(resourceGroupName, actionGroupName).block(); - } - - /** - * Delete an action group. - * - * @param resourceGroupName The name of the resource group. - * @param actionGroupName The name of the action group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String actionGroupName, Context context) { - return deleteWithResponseAsync(resourceGroupName, actionGroupName, context).block(); - } - - /** - * Updates an existing action group's tags. To update other fields use the CreateOrUpdate method. - * - * @param resourceGroupName The name of the resource group. - * @param actionGroupName The name of the action group. - * @param actionGroupPatch Parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an action group resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateWithResponseAsync( - String resourceGroupName, String actionGroupName, ActionGroupPatchBody actionGroupPatch) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (actionGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter actionGroupName is required and cannot be null.")); - } - if (actionGroupPatch == null) { - return Mono - .error(new IllegalArgumentException("Parameter actionGroupPatch is required and cannot be null.")); - } else { - actionGroupPatch.validate(); - } - final String apiVersion = "2019-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - actionGroupName, - apiVersion, - actionGroupPatch, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates an existing action group's tags. To update other fields use the CreateOrUpdate method. - * - * @param resourceGroupName The name of the resource group. - * @param actionGroupName The name of the action group. - * @param actionGroupPatch Parameters supplied to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an action group resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, String actionGroupName, ActionGroupPatchBody actionGroupPatch, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (actionGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter actionGroupName is required and cannot be null.")); - } - if (actionGroupPatch == null) { - return Mono - .error(new IllegalArgumentException("Parameter actionGroupPatch is required and cannot be null.")); - } else { - actionGroupPatch.validate(); - } - final String apiVersion = "2019-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - actionGroupName, - apiVersion, - actionGroupPatch, - accept, - context); - } - - /** - * Updates an existing action group's tags. To update other fields use the CreateOrUpdate method. - * - * @param resourceGroupName The name of the resource group. - * @param actionGroupName The name of the action group. - * @param actionGroupPatch Parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an action group resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync( - String resourceGroupName, String actionGroupName, ActionGroupPatchBody actionGroupPatch) { - return updateWithResponseAsync(resourceGroupName, actionGroupName, actionGroupPatch) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Updates an existing action group's tags. To update other fields use the CreateOrUpdate method. - * - * @param resourceGroupName The name of the resource group. - * @param actionGroupName The name of the action group. - * @param actionGroupPatch Parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an action group resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ActionGroupResourceInner update( - String resourceGroupName, String actionGroupName, ActionGroupPatchBody actionGroupPatch) { - return updateAsync(resourceGroupName, actionGroupName, actionGroupPatch).block(); - } - - /** - * Updates an existing action group's tags. To update other fields use the CreateOrUpdate method. - * - * @param resourceGroupName The name of the resource group. - * @param actionGroupName The name of the action group. - * @param actionGroupPatch Parameters supplied to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an action group resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, String actionGroupName, ActionGroupPatchBody actionGroupPatch, Context context) { - return updateWithResponseAsync(resourceGroupName, actionGroupName, actionGroupPatch, context).block(); - } - - /** - * Get a list of all action groups in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all action groups in a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a list of all action groups in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all action groups in a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); - } - - /** - * Get a list of all action groups in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all action groups in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync()); - } - - /** - * Get a list of all action groups in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all action groups in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context)); - } - - /** - * Get a list of all action groups in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all action groups in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Get a list of all action groups in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all action groups in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Get a list of all action groups in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all action groups in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - this.client.getSubscriptionId(), - apiVersion, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a list of all action groups in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all action groups in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - this.client.getSubscriptionId(), - apiVersion, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); - } - - /** - * Get a list of all action groups in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all action groups in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName)); - } - - /** - * Get a list of all action groups in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all action groups in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context)); - } - - /** - * Get a list of all action groups in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all action groups in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * Get a list of all action groups in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all action groups in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * Enable a receiver in an action group. This changes the receiver's status from Disabled to Enabled. This operation - * is only supported for Email or SMS receivers. - * - * @param resourceGroupName The name of the resource group. - * @param actionGroupName The name of the action group. - * @param receiverName The name of the receiver to resubscribe. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> enableReceiverWithResponseAsync( - String resourceGroupName, String actionGroupName, String receiverName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (actionGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter actionGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (receiverName == null) { - return Mono.error(new IllegalArgumentException("Parameter receiverName is required and cannot be null.")); - } - final String apiVersion = "2019-06-01"; - final String accept = "application/json"; - EnableRequest enableRequest = new EnableRequest(); - enableRequest.withReceiverName(receiverName); - return FluxUtil - .withContext( - context -> - service - .enableReceiver( - this.client.getEndpoint(), - resourceGroupName, - actionGroupName, - this.client.getSubscriptionId(), - apiVersion, - enableRequest, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Enable a receiver in an action group. This changes the receiver's status from Disabled to Enabled. This operation - * is only supported for Email or SMS receivers. - * - * @param resourceGroupName The name of the resource group. - * @param actionGroupName The name of the action group. - * @param receiverName The name of the receiver to resubscribe. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> enableReceiverWithResponseAsync( - String resourceGroupName, String actionGroupName, String receiverName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (actionGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter actionGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (receiverName == null) { - return Mono.error(new IllegalArgumentException("Parameter receiverName is required and cannot be null.")); - } - final String apiVersion = "2019-06-01"; - final String accept = "application/json"; - EnableRequest enableRequest = new EnableRequest(); - enableRequest.withReceiverName(receiverName); - context = this.client.mergeContext(context); - return service - .enableReceiver( - this.client.getEndpoint(), - resourceGroupName, - actionGroupName, - this.client.getSubscriptionId(), - apiVersion, - enableRequest, - accept, - context); - } - - /** - * Enable a receiver in an action group. This changes the receiver's status from Disabled to Enabled. This operation - * is only supported for Email or SMS receivers. - * - * @param resourceGroupName The name of the resource group. - * @param actionGroupName The name of the action group. - * @param receiverName The name of the receiver to resubscribe. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono enableReceiverAsync(String resourceGroupName, String actionGroupName, String receiverName) { - return enableReceiverWithResponseAsync(resourceGroupName, actionGroupName, receiverName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Enable a receiver in an action group. This changes the receiver's status from Disabled to Enabled. This operation - * is only supported for Email or SMS receivers. - * - * @param resourceGroupName The name of the resource group. - * @param actionGroupName The name of the action group. - * @param receiverName The name of the receiver to resubscribe. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void enableReceiver(String resourceGroupName, String actionGroupName, String receiverName) { - enableReceiverAsync(resourceGroupName, actionGroupName, receiverName).block(); - } - - /** - * Enable a receiver in an action group. This changes the receiver's status from Disabled to Enabled. This operation - * is only supported for Email or SMS receivers. - * - * @param resourceGroupName The name of the resource group. - * @param actionGroupName The name of the action group. - * @param receiverName The name of the receiver to resubscribe. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response enableReceiverWithResponse( - String resourceGroupName, String actionGroupName, String receiverName, Context context) { - return enableReceiverWithResponseAsync(resourceGroupName, actionGroupName, receiverName, context).block(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/ActionGroupsImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/ActionGroupsImpl.java deleted file mode 100644 index 7de444783c49..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/ActionGroupsImpl.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.monitor.implementation; - -import com.azure.resourcemanager.monitor.MonitorManager; -import com.azure.resourcemanager.monitor.models.ActionGroup; -import com.azure.resourcemanager.monitor.models.ActionGroups; -import com.azure.resourcemanager.monitor.fluent.models.ActionGroupResourceInner; -import com.azure.resourcemanager.monitor.fluent.ActionGroupsClient; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.TopLevelModifiableResourcesImpl; -import reactor.core.publisher.Mono; - -/** Implementation for {@link ActionGroups}. */ -public class ActionGroupsImpl - extends TopLevelModifiableResourcesImpl< - ActionGroup, ActionGroupImpl, ActionGroupResourceInner, ActionGroupsClient, MonitorManager> - implements ActionGroups { - - public ActionGroupsImpl(final MonitorManager monitorManager) { - super(monitorManager.serviceClient().getActionGroups(), monitorManager); - } - - @Override - protected ActionGroupImpl wrapModel(String name) { - return new ActionGroupImpl(name, new ActionGroupResourceInner(), this.manager()); - } - - @Override - protected ActionGroupImpl wrapModel(ActionGroupResourceInner inner) { - if (inner == null) { - return null; - } - return new ActionGroupImpl(inner.name(), inner, this.manager()); - } - - @Override - public ActionGroupImpl define(String name) { - return wrapModel(name); - } - - @Override - public void enableReceiver(String resourceGroupName, String actionGroupName, String receiverName) { - this.inner().enableReceiver(resourceGroupName, actionGroupName, receiverName); - } - - @Override - public Mono enableReceiverAsync(String resourceGroupName, String actionGroupName, String receiverName) { - return this.inner().enableReceiverAsync(resourceGroupName, actionGroupName, receiverName); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/ActivityLogAlertImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/ActivityLogAlertImpl.java deleted file mode 100644 index 9d57f5759f27..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/ActivityLogAlertImpl.java +++ /dev/null @@ -1,191 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.monitor.implementation; - -import com.azure.resourcemanager.monitor.MonitorManager; -import com.azure.resourcemanager.monitor.models.ActivityLogAlert; -import com.azure.resourcemanager.monitor.models.ActivityLogAlertActionGroup; -import com.azure.resourcemanager.monitor.models.ActivityLogAlertActionList; -import com.azure.resourcemanager.monitor.models.ActivityLogAlertAllOfCondition; -import com.azure.resourcemanager.monitor.models.ActivityLogAlertLeafCondition; -import com.azure.resourcemanager.monitor.fluent.models.ActivityLogAlertResourceInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasId; -import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.GroupableResourceImpl; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.TreeMap; -import reactor.core.publisher.Mono; - -/** Implementation for ActivityLogAlert. */ -class ActivityLogAlertImpl - extends GroupableResourceImpl - implements ActivityLogAlert, - ActivityLogAlert.Definition, - ActivityLogAlert.Update, - ActivityLogAlert.UpdateStages.WithActivityLogUpdate { - - private Map conditions; - - ActivityLogAlertImpl( - String name, final ActivityLogAlertResourceInner innerModel, final MonitorManager monitorManager) { - super(name, innerModel, monitorManager); - this.conditions = new TreeMap<>(); - if (innerModel.condition() != null && innerModel.condition().allOf() != null) { - for (ActivityLogAlertLeafCondition aac : innerModel.condition().allOf()) { - this.conditions.put(aac.field(), aac.equals()); - } - } - } - - @Override - public Collection scopes() { - return Collections.unmodifiableCollection(this.innerModel().scopes()); - } - - @Override - public Boolean enabled() { - return this.innerModel().enabled(); - } - - @Override - public Map equalsConditions() { - return this.conditions; - } - - @Override - public Collection actionGroupIds() { - if (this.innerModel().actions() != null && this.innerModel().actions().actionGroups() != null) { - List ids = new ArrayList<>(); - for (ActivityLogAlertActionGroup alaag : this.innerModel().actions().actionGroups()) { - ids.add(alaag.actionGroupId()); - } - return Collections.unmodifiableCollection(ids); - } - return Collections.emptyList(); - } - - @Override - public String description() { - return this.innerModel().description(); - } - - @Override - public Mono createResourceAsync() { - this.innerModel().withLocation("global"); - ActivityLogAlertAllOfCondition condition = new ActivityLogAlertAllOfCondition(); - condition.withAllOf(new ArrayList()); - for (Map.Entry cds : conditions.entrySet()) { - ActivityLogAlertLeafCondition alalc = new ActivityLogAlertLeafCondition(); - alalc.withField(cds.getKey()); - alalc.withEquals(cds.getValue()); - condition.allOf().add(alalc); - } - this.innerModel().withCondition(condition); - return this - .manager() - .serviceClient() - .getActivityLogAlerts() - .createOrUpdateAsync(this.resourceGroupName(), this.name(), this.innerModel()) - .map(innerToFluentMap(this)); - } - - @Override - protected Mono getInnerAsync() { - return this - .manager() - .serviceClient() - .getActivityLogAlerts() - .getByResourceGroupAsync(this.resourceGroupName(), this.name()); - } - - @Override - public ActivityLogAlert.DefinitionStages.WithDescription withTargetResource(String resourceId) { - this.innerModel().withScopes(new ArrayList()); - this.innerModel().scopes().add(resourceId); - return this; - } - - @Override - public ActivityLogAlert.DefinitionStages.WithDescription withTargetResource(HasId resource) { - return this.withTargetResource(resource.id()); - } - - @Override - public ActivityLogAlert.DefinitionStages.WithDescription withTargetSubscription(String targetSubscriptionId) { - return this.withTargetResource("/subscriptions/" + targetSubscriptionId); - } - - @Override - public ActivityLogAlertImpl withDescription(String description) { - this.innerModel().withDescription(description); - return this; - } - - @Override - public ActivityLogAlertImpl withRuleEnabled() { - this.innerModel().withEnabled(true); - return this; - } - - @Override - public ActivityLogAlertImpl withRuleDisabled() { - this.innerModel().withEnabled(false); - return this; - } - - @Override - public ActivityLogAlertImpl withActionGroups(String... actionGroupId) { - if (this.innerModel().actions() == null) { - this.innerModel().withActions(new ActivityLogAlertActionList()); - this.innerModel().actions().withActionGroups(new ArrayList()); - } - this.innerModel().actions().actionGroups().clear(); - - for (String agid : actionGroupId) { - ActivityLogAlertActionGroup aaa = new ActivityLogAlertActionGroup(); - aaa.withActionGroupId(agid); - this.innerModel().actions().actionGroups().add(aaa); - } - return this; - } - - @Override - public ActivityLogAlertImpl withoutActionGroup(String actionGroupId) { - if (this.innerModel().actions() != null && this.innerModel().actions().actionGroups() != null) { - List toDelete = new ArrayList<>(); - for (ActivityLogAlertActionGroup aaa : this.innerModel().actions().actionGroups()) { - if (aaa.actionGroupId().equalsIgnoreCase(actionGroupId)) { - toDelete.add(aaa); - } - } - this.innerModel().actions().actionGroups().removeAll(toDelete); - } - return this; - } - - @Override - public ActivityLogAlertImpl withEqualsCondition(String field, String equals) { - this.withoutEqualsCondition(field); - this.conditions.put(field, equals); - return this; - } - - @Override - public ActivityLogAlertImpl withEqualsConditions(Map fieldEqualsMap) { - this.conditions.clear(); - this.conditions.putAll(fieldEqualsMap); - return this; - } - - @Override - public ActivityLogAlertImpl withoutEqualsCondition(String field) { - if (this.conditions.containsKey(field)) { - this.conditions.remove(field); - } - return this; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/ActivityLogAlertsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/ActivityLogAlertsClientImpl.java deleted file mode 100644 index 7503c1e42d20..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/ActivityLogAlertsClientImpl.java +++ /dev/null @@ -1,1093 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.fluent.ActivityLogAlertsClient; -import com.azure.resourcemanager.monitor.fluent.models.ActivityLogAlertResourceInner; -import com.azure.resourcemanager.monitor.models.ActivityLogAlertList; -import com.azure.resourcemanager.monitor.models.ActivityLogAlertPatchBody; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ActivityLogAlertsClient. */ -public final class ActivityLogAlertsClientImpl - implements InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete, - ActivityLogAlertsClient { - private final ClientLogger logger = new ClientLogger(ActivityLogAlertsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final ActivityLogAlertsService service; - - /** The service client containing this operation class. */ - private final MonitorClientImpl client; - - /** - * Initializes an instance of ActivityLogAlertsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ActivityLogAlertsClientImpl(MonitorClientImpl client) { - this.service = - RestProxy.create(ActivityLogAlertsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MonitorClientActivityLogAlerts to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MonitorClientActivit") - private interface ActivityLogAlertsService { - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights" - + "/activityLogAlerts/{activityLogAlertName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("activityLogAlertName") String activityLogAlertName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ActivityLogAlertResourceInner activityLogAlert, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights" - + "/activityLogAlerts/{activityLogAlertName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("activityLogAlertName") String activityLogAlertName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights" - + "/activityLogAlerts/{activityLogAlertName}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("activityLogAlertName") String activityLogAlertName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights" - + "/activityLogAlerts/{activityLogAlertName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("activityLogAlertName") String activityLogAlertName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ActivityLogAlertPatchBody activityLogAlertPatch, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/microsoft.insights/activityLogAlerts") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights" - + "/activityLogAlerts") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Create a new activity log alert or update an existing one. - * - * @param resourceGroupName The name of the resource group. - * @param activityLogAlertName The name of the activity log alert. - * @param activityLogAlert The activity log alert to create or use for the update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an activity log alert resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String activityLogAlertName, ActivityLogAlertResourceInner activityLogAlert) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (activityLogAlertName == null) { - return Mono - .error(new IllegalArgumentException("Parameter activityLogAlertName is required and cannot be null.")); - } - if (activityLogAlert == null) { - return Mono - .error(new IllegalArgumentException("Parameter activityLogAlert is required and cannot be null.")); - } else { - activityLogAlert.validate(); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - activityLogAlertName, - apiVersion, - activityLogAlert, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create a new activity log alert or update an existing one. - * - * @param resourceGroupName The name of the resource group. - * @param activityLogAlertName The name of the activity log alert. - * @param activityLogAlert The activity log alert to create or use for the update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an activity log alert resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, - String activityLogAlertName, - ActivityLogAlertResourceInner activityLogAlert, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (activityLogAlertName == null) { - return Mono - .error(new IllegalArgumentException("Parameter activityLogAlertName is required and cannot be null.")); - } - if (activityLogAlert == null) { - return Mono - .error(new IllegalArgumentException("Parameter activityLogAlert is required and cannot be null.")); - } else { - activityLogAlert.validate(); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - activityLogAlertName, - apiVersion, - activityLogAlert, - accept, - context); - } - - /** - * Create a new activity log alert or update an existing one. - * - * @param resourceGroupName The name of the resource group. - * @param activityLogAlertName The name of the activity log alert. - * @param activityLogAlert The activity log alert to create or use for the update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an activity log alert resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, String activityLogAlertName, ActivityLogAlertResourceInner activityLogAlert) { - return createOrUpdateWithResponseAsync(resourceGroupName, activityLogAlertName, activityLogAlert) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Create a new activity log alert or update an existing one. - * - * @param resourceGroupName The name of the resource group. - * @param activityLogAlertName The name of the activity log alert. - * @param activityLogAlert The activity log alert to create or use for the update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an activity log alert resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ActivityLogAlertResourceInner createOrUpdate( - String resourceGroupName, String activityLogAlertName, ActivityLogAlertResourceInner activityLogAlert) { - return createOrUpdateAsync(resourceGroupName, activityLogAlertName, activityLogAlert).block(); - } - - /** - * Create a new activity log alert or update an existing one. - * - * @param resourceGroupName The name of the resource group. - * @param activityLogAlertName The name of the activity log alert. - * @param activityLogAlert The activity log alert to create or use for the update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an activity log alert resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceGroupName, - String activityLogAlertName, - ActivityLogAlertResourceInner activityLogAlert, - Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, activityLogAlertName, activityLogAlert, context) - .block(); - } - - /** - * Get an activity log alert. - * - * @param resourceGroupName The name of the resource group. - * @param activityLogAlertName The name of the activity log alert. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an activity log alert. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String activityLogAlertName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (activityLogAlertName == null) { - return Mono - .error(new IllegalArgumentException("Parameter activityLogAlertName is required and cannot be null.")); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - activityLogAlertName, - apiVersion, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get an activity log alert. - * - * @param resourceGroupName The name of the resource group. - * @param activityLogAlertName The name of the activity log alert. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an activity log alert. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String activityLogAlertName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (activityLogAlertName == null) { - return Mono - .error(new IllegalArgumentException("Parameter activityLogAlertName is required and cannot be null.")); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - activityLogAlertName, - apiVersion, - accept, - context); - } - - /** - * Get an activity log alert. - * - * @param resourceGroupName The name of the resource group. - * @param activityLogAlertName The name of the activity log alert. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an activity log alert. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync( - String resourceGroupName, String activityLogAlertName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, activityLogAlertName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get an activity log alert. - * - * @param resourceGroupName The name of the resource group. - * @param activityLogAlertName The name of the activity log alert. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an activity log alert. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ActivityLogAlertResourceInner getByResourceGroup(String resourceGroupName, String activityLogAlertName) { - return getByResourceGroupAsync(resourceGroupName, activityLogAlertName).block(); - } - - /** - * Get an activity log alert. - * - * @param resourceGroupName The name of the resource group. - * @param activityLogAlertName The name of the activity log alert. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an activity log alert. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String activityLogAlertName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, activityLogAlertName, context).block(); - } - - /** - * Delete an activity log alert. - * - * @param resourceGroupName The name of the resource group. - * @param activityLogAlertName The name of the activity log alert. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String resourceGroupName, String activityLogAlertName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (activityLogAlertName == null) { - return Mono - .error(new IllegalArgumentException("Parameter activityLogAlertName is required and cannot be null.")); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - activityLogAlertName, - apiVersion, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete an activity log alert. - * - * @param resourceGroupName The name of the resource group. - * @param activityLogAlertName The name of the activity log alert. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String activityLogAlertName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (activityLogAlertName == null) { - return Mono - .error(new IllegalArgumentException("Parameter activityLogAlertName is required and cannot be null.")); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - activityLogAlertName, - apiVersion, - accept, - context); - } - - /** - * Delete an activity log alert. - * - * @param resourceGroupName The name of the resource group. - * @param activityLogAlertName The name of the activity log alert. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String activityLogAlertName) { - return deleteWithResponseAsync(resourceGroupName, activityLogAlertName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Delete an activity log alert. - * - * @param resourceGroupName The name of the resource group. - * @param activityLogAlertName The name of the activity log alert. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String activityLogAlertName) { - deleteAsync(resourceGroupName, activityLogAlertName).block(); - } - - /** - * Delete an activity log alert. - * - * @param resourceGroupName The name of the resource group. - * @param activityLogAlertName The name of the activity log alert. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String activityLogAlertName, Context context) { - return deleteWithResponseAsync(resourceGroupName, activityLogAlertName, context).block(); - } - - /** - * Updates an existing ActivityLogAlertResource's tags. To update other fields use the CreateOrUpdate method. - * - * @param resourceGroupName The name of the resource group. - * @param activityLogAlertName The name of the activity log alert. - * @param activityLogAlertPatch Parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an activity log alert resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateWithResponseAsync( - String resourceGroupName, String activityLogAlertName, ActivityLogAlertPatchBody activityLogAlertPatch) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (activityLogAlertName == null) { - return Mono - .error(new IllegalArgumentException("Parameter activityLogAlertName is required and cannot be null.")); - } - if (activityLogAlertPatch == null) { - return Mono - .error(new IllegalArgumentException("Parameter activityLogAlertPatch is required and cannot be null.")); - } else { - activityLogAlertPatch.validate(); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - activityLogAlertName, - apiVersion, - activityLogAlertPatch, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates an existing ActivityLogAlertResource's tags. To update other fields use the CreateOrUpdate method. - * - * @param resourceGroupName The name of the resource group. - * @param activityLogAlertName The name of the activity log alert. - * @param activityLogAlertPatch Parameters supplied to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an activity log alert resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, - String activityLogAlertName, - ActivityLogAlertPatchBody activityLogAlertPatch, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (activityLogAlertName == null) { - return Mono - .error(new IllegalArgumentException("Parameter activityLogAlertName is required and cannot be null.")); - } - if (activityLogAlertPatch == null) { - return Mono - .error(new IllegalArgumentException("Parameter activityLogAlertPatch is required and cannot be null.")); - } else { - activityLogAlertPatch.validate(); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - activityLogAlertName, - apiVersion, - activityLogAlertPatch, - accept, - context); - } - - /** - * Updates an existing ActivityLogAlertResource's tags. To update other fields use the CreateOrUpdate method. - * - * @param resourceGroupName The name of the resource group. - * @param activityLogAlertName The name of the activity log alert. - * @param activityLogAlertPatch Parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an activity log alert resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync( - String resourceGroupName, String activityLogAlertName, ActivityLogAlertPatchBody activityLogAlertPatch) { - return updateWithResponseAsync(resourceGroupName, activityLogAlertName, activityLogAlertPatch) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Updates an existing ActivityLogAlertResource's tags. To update other fields use the CreateOrUpdate method. - * - * @param resourceGroupName The name of the resource group. - * @param activityLogAlertName The name of the activity log alert. - * @param activityLogAlertPatch Parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an activity log alert resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ActivityLogAlertResourceInner update( - String resourceGroupName, String activityLogAlertName, ActivityLogAlertPatchBody activityLogAlertPatch) { - return updateAsync(resourceGroupName, activityLogAlertName, activityLogAlertPatch).block(); - } - - /** - * Updates an existing ActivityLogAlertResource's tags. To update other fields use the CreateOrUpdate method. - * - * @param resourceGroupName The name of the resource group. - * @param activityLogAlertName The name of the activity log alert. - * @param activityLogAlertPatch Parameters supplied to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an activity log alert resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, - String activityLogAlertName, - ActivityLogAlertPatchBody activityLogAlertPatch, - Context context) { - return updateWithResponseAsync(resourceGroupName, activityLogAlertName, activityLogAlertPatch, context).block(); - } - - /** - * Get a list of all activity log alerts in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all activity log alerts in a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a list of all activity log alerts in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all activity log alerts in a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); - } - - /** - * Get a list of all activity log alerts in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all activity log alerts in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync()); - } - - /** - * Get a list of all activity log alerts in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all activity log alerts in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context)); - } - - /** - * Get a list of all activity log alerts in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all activity log alerts in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Get a list of all activity log alerts in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all activity log alerts in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Get a list of all activity log alerts in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all activity log alerts in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - apiVersion, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a list of all activity log alerts in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all activity log alerts in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String apiVersion = "2017-04-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - apiVersion, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); - } - - /** - * Get a list of all activity log alerts in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all activity log alerts in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName)); - } - - /** - * Get a list of all activity log alerts in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all activity log alerts in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync( - String resourceGroupName, Context context) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context)); - } - - /** - * Get a list of all activity log alerts in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all activity log alerts in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * Get a list of all activity log alerts in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all activity log alerts in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/ActivityLogAlertsImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/ActivityLogAlertsImpl.java deleted file mode 100644 index c330e5bae499..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/ActivityLogAlertsImpl.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.monitor.implementation; - -import com.azure.resourcemanager.monitor.MonitorManager; -import com.azure.resourcemanager.monitor.models.ActivityLogAlert; -import com.azure.resourcemanager.monitor.models.ActivityLogAlerts; -import com.azure.resourcemanager.monitor.fluent.models.ActivityLogAlertResourceInner; -import com.azure.resourcemanager.monitor.fluent.ActivityLogAlertsClient; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.TopLevelModifiableResourcesImpl; - -/** Implementation for {@link ActivityLogAlerts}. */ -class ActivityLogAlertsImpl - extends TopLevelModifiableResourcesImpl< - ActivityLogAlert, ActivityLogAlertImpl, ActivityLogAlertResourceInner, ActivityLogAlertsClient, MonitorManager> - implements ActivityLogAlerts { - - ActivityLogAlertsImpl(final MonitorManager monitorManager) { - super(monitorManager.serviceClient().getActivityLogAlerts(), monitorManager); - } - - @Override - protected ActivityLogAlertImpl wrapModel(String name) { - return new ActivityLogAlertImpl(name, new ActivityLogAlertResourceInner(), this.manager()); - } - - @Override - protected ActivityLogAlertImpl wrapModel(ActivityLogAlertResourceInner inner) { - if (inner == null) { - return null; - } - return new ActivityLogAlertImpl(inner.name(), inner, this.manager()); - } - - @Override - public ActivityLogAlertImpl define(String name) { - return wrapModel(name); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/ActivityLogsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/ActivityLogsClientImpl.java deleted file mode 100644 index 03f6c5d49f49..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/ActivityLogsClientImpl.java +++ /dev/null @@ -1,438 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.fluent.ActivityLogsClient; -import com.azure.resourcemanager.monitor.fluent.models.EventDataInner; -import com.azure.resourcemanager.monitor.models.EventDataCollection; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ActivityLogsClient. */ -public final class ActivityLogsClientImpl implements ActivityLogsClient { - private final ClientLogger logger = new ClientLogger(ActivityLogsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final ActivityLogsService service; - - /** The service client containing this operation class. */ - private final MonitorClientImpl client; - - /** - * Initializes an instance of ActivityLogsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ActivityLogsClientImpl(MonitorClientImpl client) { - this.service = - RestProxy.create(ActivityLogsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MonitorClientActivityLogs to be used by the proxy service to perform - * REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MonitorClientActivit") - private interface ActivityLogsService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Insights/eventtypes/management/values") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @QueryParam("$filter") String filter, - @QueryParam("$select") String select, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Provides the list of records from the activity logs. - * - * @param filter Reduces the set of data collected.<br>This argument is required and it also requires at least - * the start date/time.<br>The **$filter** argument is very restricted and allows only the following - * patterns.<br>- *List events for a resource group*: $filter=eventTimestamp ge - * '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and resourceGroupName eq - * 'resourceGroupName'.<br>- *List events for resource*: $filter=eventTimestamp ge - * '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and resourceUri eq - * 'resourceURI'.<br>- *List events for a subscription in a time range*: $filter=eventTimestamp ge - * '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z'.<br>- *List events - * for a resource provider*: $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le - * '2014-07-20T04:36:37.6407898Z' and resourceProvider eq 'resourceProviderName'.<br>- *List events for a - * correlation Id*: $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le - * '2014-07-20T04:36:37.6407898Z' and correlationId eq 'correlationID'.<br><br>**NOTE**: No other - * syntax is allowed. - * @param select Used to fetch events with only the given properties.<br>The **$select** argument is a comma - * separated list of property names to be returned. Possible values are: *authorization*, *claims*, - * *correlationId*, *description*, *eventDataId*, *eventName*, *eventTimestamp*, *httpRequest*, *level*, - * *operationId*, *operationName*, *properties*, *resourceGroupName*, *resourceProviderName*, *resourceId*, - * *status*, *submissionTimestamp*, *subStatus*, *subscriptionId*. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents collection of events. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String filter, String select) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (filter == null) { - return Mono.error(new IllegalArgumentException("Parameter filter is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2015-04-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - apiVersion, - filter, - select, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Provides the list of records from the activity logs. - * - * @param filter Reduces the set of data collected.<br>This argument is required and it also requires at least - * the start date/time.<br>The **$filter** argument is very restricted and allows only the following - * patterns.<br>- *List events for a resource group*: $filter=eventTimestamp ge - * '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and resourceGroupName eq - * 'resourceGroupName'.<br>- *List events for resource*: $filter=eventTimestamp ge - * '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and resourceUri eq - * 'resourceURI'.<br>- *List events for a subscription in a time range*: $filter=eventTimestamp ge - * '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z'.<br>- *List events - * for a resource provider*: $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le - * '2014-07-20T04:36:37.6407898Z' and resourceProvider eq 'resourceProviderName'.<br>- *List events for a - * correlation Id*: $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le - * '2014-07-20T04:36:37.6407898Z' and correlationId eq 'correlationID'.<br><br>**NOTE**: No other - * syntax is allowed. - * @param select Used to fetch events with only the given properties.<br>The **$select** argument is a comma - * separated list of property names to be returned. Possible values are: *authorization*, *claims*, - * *correlationId*, *description*, *eventDataId*, *eventName*, *eventTimestamp*, *httpRequest*, *level*, - * *operationId*, *operationName*, *properties*, *resourceGroupName*, *resourceProviderName*, *resourceId*, - * *status*, *submissionTimestamp*, *subStatus*, *subscriptionId*. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents collection of events. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String filter, String select, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (filter == null) { - return Mono.error(new IllegalArgumentException("Parameter filter is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2015-04-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), apiVersion, filter, select, this.client.getSubscriptionId(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Provides the list of records from the activity logs. - * - * @param filter Reduces the set of data collected.<br>This argument is required and it also requires at least - * the start date/time.<br>The **$filter** argument is very restricted and allows only the following - * patterns.<br>- *List events for a resource group*: $filter=eventTimestamp ge - * '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and resourceGroupName eq - * 'resourceGroupName'.<br>- *List events for resource*: $filter=eventTimestamp ge - * '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and resourceUri eq - * 'resourceURI'.<br>- *List events for a subscription in a time range*: $filter=eventTimestamp ge - * '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z'.<br>- *List events - * for a resource provider*: $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le - * '2014-07-20T04:36:37.6407898Z' and resourceProvider eq 'resourceProviderName'.<br>- *List events for a - * correlation Id*: $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le - * '2014-07-20T04:36:37.6407898Z' and correlationId eq 'correlationID'.<br><br>**NOTE**: No other - * syntax is allowed. - * @param select Used to fetch events with only the given properties.<br>The **$select** argument is a comma - * separated list of property names to be returned. Possible values are: *authorization*, *claims*, - * *correlationId*, *description*, *eventDataId*, *eventName*, *eventTimestamp*, *httpRequest*, *level*, - * *operationId*, *operationName*, *properties*, *resourceGroupName*, *resourceProviderName*, *resourceId*, - * *status*, *submissionTimestamp*, *subStatus*, *subscriptionId*. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents collection of events. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String filter, String select) { - return new PagedFlux<>( - () -> listSinglePageAsync(filter, select), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Provides the list of records from the activity logs. - * - * @param filter Reduces the set of data collected.<br>This argument is required and it also requires at least - * the start date/time.<br>The **$filter** argument is very restricted and allows only the following - * patterns.<br>- *List events for a resource group*: $filter=eventTimestamp ge - * '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and resourceGroupName eq - * 'resourceGroupName'.<br>- *List events for resource*: $filter=eventTimestamp ge - * '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and resourceUri eq - * 'resourceURI'.<br>- *List events for a subscription in a time range*: $filter=eventTimestamp ge - * '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z'.<br>- *List events - * for a resource provider*: $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le - * '2014-07-20T04:36:37.6407898Z' and resourceProvider eq 'resourceProviderName'.<br>- *List events for a - * correlation Id*: $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le - * '2014-07-20T04:36:37.6407898Z' and correlationId eq 'correlationID'.<br><br>**NOTE**: No other - * syntax is allowed. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents collection of events. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String filter) { - final String select = null; - return new PagedFlux<>( - () -> listSinglePageAsync(filter, select), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Provides the list of records from the activity logs. - * - * @param filter Reduces the set of data collected.<br>This argument is required and it also requires at least - * the start date/time.<br>The **$filter** argument is very restricted and allows only the following - * patterns.<br>- *List events for a resource group*: $filter=eventTimestamp ge - * '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and resourceGroupName eq - * 'resourceGroupName'.<br>- *List events for resource*: $filter=eventTimestamp ge - * '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and resourceUri eq - * 'resourceURI'.<br>- *List events for a subscription in a time range*: $filter=eventTimestamp ge - * '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z'.<br>- *List events - * for a resource provider*: $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le - * '2014-07-20T04:36:37.6407898Z' and resourceProvider eq 'resourceProviderName'.<br>- *List events for a - * correlation Id*: $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le - * '2014-07-20T04:36:37.6407898Z' and correlationId eq 'correlationID'.<br><br>**NOTE**: No other - * syntax is allowed. - * @param select Used to fetch events with only the given properties.<br>The **$select** argument is a comma - * separated list of property names to be returned. Possible values are: *authorization*, *claims*, - * *correlationId*, *description*, *eventDataId*, *eventName*, *eventTimestamp*, *httpRequest*, *level*, - * *operationId*, *operationName*, *properties*, *resourceGroupName*, *resourceProviderName*, *resourceId*, - * *status*, *submissionTimestamp*, *subStatus*, *subscriptionId*. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents collection of events. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String filter, String select, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(filter, select, context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Provides the list of records from the activity logs. - * - * @param filter Reduces the set of data collected.<br>This argument is required and it also requires at least - * the start date/time.<br>The **$filter** argument is very restricted and allows only the following - * patterns.<br>- *List events for a resource group*: $filter=eventTimestamp ge - * '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and resourceGroupName eq - * 'resourceGroupName'.<br>- *List events for resource*: $filter=eventTimestamp ge - * '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and resourceUri eq - * 'resourceURI'.<br>- *List events for a subscription in a time range*: $filter=eventTimestamp ge - * '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z'.<br>- *List events - * for a resource provider*: $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le - * '2014-07-20T04:36:37.6407898Z' and resourceProvider eq 'resourceProviderName'.<br>- *List events for a - * correlation Id*: $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le - * '2014-07-20T04:36:37.6407898Z' and correlationId eq 'correlationID'.<br><br>**NOTE**: No other - * syntax is allowed. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents collection of events. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String filter) { - final String select = null; - return new PagedIterable<>(listAsync(filter, select)); - } - - /** - * Provides the list of records from the activity logs. - * - * @param filter Reduces the set of data collected.<br>This argument is required and it also requires at least - * the start date/time.<br>The **$filter** argument is very restricted and allows only the following - * patterns.<br>- *List events for a resource group*: $filter=eventTimestamp ge - * '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and resourceGroupName eq - * 'resourceGroupName'.<br>- *List events for resource*: $filter=eventTimestamp ge - * '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and resourceUri eq - * 'resourceURI'.<br>- *List events for a subscription in a time range*: $filter=eventTimestamp ge - * '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z'.<br>- *List events - * for a resource provider*: $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le - * '2014-07-20T04:36:37.6407898Z' and resourceProvider eq 'resourceProviderName'.<br>- *List events for a - * correlation Id*: $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le - * '2014-07-20T04:36:37.6407898Z' and correlationId eq 'correlationID'.<br><br>**NOTE**: No other - * syntax is allowed. - * @param select Used to fetch events with only the given properties.<br>The **$select** argument is a comma - * separated list of property names to be returned. Possible values are: *authorization*, *claims*, - * *correlationId*, *description*, *eventDataId*, *eventName*, *eventTimestamp*, *httpRequest*, *level*, - * *operationId*, *operationName*, *properties*, *resourceGroupName*, *resourceProviderName*, *resourceId*, - * *status*, *submissionTimestamp*, *subStatus*, *subscriptionId*. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents collection of events. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String filter, String select, Context context) { - return new PagedIterable<>(listAsync(filter, select, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents collection of events. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents collection of events. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/ActivityLogsImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/ActivityLogsImpl.java deleted file mode 100644 index 4aead50dcf08..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/ActivityLogsImpl.java +++ /dev/null @@ -1,186 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.monitor.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.monitor.MonitorManager; -import com.azure.resourcemanager.monitor.models.ActivityLogs; -import com.azure.resourcemanager.monitor.models.EventData; -import com.azure.resourcemanager.monitor.models.EventDataPropertyName; -import com.azure.resourcemanager.monitor.models.LocalizableString; -import com.azure.resourcemanager.monitor.fluent.ActivityLogsClient; -import java.time.OffsetDateTime; -import java.time.ZoneOffset; -import java.time.format.DateTimeFormatter; -import java.util.Arrays; -import java.util.TreeSet; -import java.util.stream.Collectors; -import com.azure.resourcemanager.resources.fluentcore.utils.PagedConverter; - -/** Implementation for {@link ActivityLogs}. */ -public class ActivityLogsImpl implements ActivityLogs, ActivityLogs.ActivityLogsQueryDefinition { - - private final MonitorManager myManager; - private OffsetDateTime queryStartTime = null; - private OffsetDateTime queryEndTime = null; - private final TreeSet responsePropertySelector; - private String filterString; - private boolean filterForTenant; - - public ActivityLogsImpl(final MonitorManager monitorManager) { - this.myManager = monitorManager; - this.responsePropertySelector = new TreeSet<>(); - this.filterString = ""; - this.filterForTenant = false; - } - - @Override - public MonitorManager manager() { - return this.myManager; - } - - public ActivityLogsClient inner() { - return this.myManager.serviceClient().getActivityLogs(); - } - - @Override - public PagedIterable listEventCategories() { - return PagedConverter.mapPage(this.manager().serviceClient().getEventCategories().list(), LocalizableStringImpl::new); - } - - @Override - public PagedFlux listEventCategoriesAsync() { - return PagedConverter.mapPage(this.manager().serviceClient().getEventCategories().listAsync(), LocalizableStringImpl::new); - } - - @Override - public ActivityLogsQueryDefinitionStages.WithEventDataStartTimeFilter defineQuery() { - this.responsePropertySelector.clear(); - this.filterString = ""; - this.filterForTenant = false; - return this; - } - - @Override - public ActivityLogsImpl startingFrom(OffsetDateTime startTime) { - this.queryStartTime = startTime; - return this; - } - - @Override - public ActivityLogsImpl endsBefore(OffsetDateTime endTime) { - this.queryEndTime = endTime; - return this; - } - - @Override - public ActivityLogsImpl withAllPropertiesInResponse() { - this.responsePropertySelector.clear(); - return this; - } - - @Override - public ActivityLogsImpl withResponseProperties(EventDataPropertyName... responseProperties) { - this.responsePropertySelector.clear(); - - this - .responsePropertySelector - .addAll( - Arrays.stream(responseProperties).map(EventDataPropertyName::toString).collect(Collectors.toList())); - return this; - } - - @Override - public ActivityLogsImpl filterByResourceGroup(String resourceGroupName) { - this.filterString = String.format(" and resourceGroupName eq '%s'", resourceGroupName); - return this; - } - - @Override - public ActivityLogsImpl filterByResource(String resourceId) { - this.filterString = String.format(" and resourceUri eq '%s'", resourceId); - return this; - } - - @Override - public ActivityLogsImpl filterByResourceProvider(String resourceProviderName) { - this.filterString = String.format(" and resourceProvider eq '%s'", resourceProviderName); - return this; - } - - @Override - public ActivityLogsImpl filterByCorrelationId(String correlationId) { - this.filterString = String.format(" and correlationId eq '%s'", correlationId); - return this; - } - - @Override - public ActivityLogsImpl filterAtTenantLevel() { - this.filterForTenant = true; - return this; - } - - @Override - public PagedIterable execute() { - if (this.filterForTenant) { - return listEventDataForTenant( - getOdataFilterString() + this.filterString + " eventChannels eq 'Admin, Operation'"); - } - return listEventData(getOdataFilterString() + this.filterString); - } - - @Override - public PagedFlux executeAsync() { - if (this.filterForTenant) { - return listEventDataForTenantAsync( - getOdataFilterString() + this.filterString + " eventChannels eq 'Admin, Operation'"); - } - return listEventDataAsync(getOdataFilterString() + this.filterString); - } - - private String getOdataFilterString() { - return String - .format( - "eventTimestamp ge '%s' and eventTimestamp le '%s'", - DateTimeFormatter.ISO_INSTANT.format(this.queryStartTime.atZoneSameInstant(ZoneOffset.UTC)), - DateTimeFormatter.ISO_INSTANT.format(this.queryEndTime.atZoneSameInstant(ZoneOffset.UTC))); - } - - private PagedIterable listEventData(String filter) { - return PagedConverter.mapPage(this.inner().list(filter, createPropertyFilter(), Context.NONE), EventDataImpl::new); - } - - private PagedIterable listEventDataForTenant(String filter) { - return PagedConverter.mapPage(this - .manager() - .serviceClient() - .getTenantActivityLogs() - .list(filter, createPropertyFilter(), Context.NONE), - EventDataImpl::new); - } - - private PagedFlux listEventDataAsync(String filter) { - return PagedConverter.mapPage(this.inner().listAsync(filter, createPropertyFilter()), EventDataImpl::new); - } - - private PagedFlux listEventDataForTenantAsync(String filter) { - return PagedConverter.mapPage(this - .manager() - .serviceClient() - .getTenantActivityLogs() - .listAsync(filter, createPropertyFilter()), - EventDataImpl::new); - } - - private String createPropertyFilter() { - String propertyFilter = - this.responsePropertySelector == null ? null : String.join(",", this.responsePropertySelector); - if (propertyFilter != null && propertyFilter.trim().isEmpty()) { - propertyFilter = null; - } - return propertyFilter; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/AlertRuleIncidentsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/AlertRuleIncidentsClientImpl.java deleted file mode 100644 index 1389f7a1242a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/AlertRuleIncidentsClientImpl.java +++ /dev/null @@ -1,423 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.fluent.AlertRuleIncidentsClient; -import com.azure.resourcemanager.monitor.fluent.models.IncidentInner; -import com.azure.resourcemanager.monitor.models.IncidentListResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in AlertRuleIncidentsClient. */ -public final class AlertRuleIncidentsClientImpl implements AlertRuleIncidentsClient { - private final ClientLogger logger = new ClientLogger(AlertRuleIncidentsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final AlertRuleIncidentsService service; - - /** The service client containing this operation class. */ - private final MonitorClientImpl client; - - /** - * Initializes an instance of AlertRuleIncidentsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - AlertRuleIncidentsClientImpl(MonitorClientImpl client) { - this.service = - RestProxy.create(AlertRuleIncidentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MonitorClientAlertRuleIncidents to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MonitorClientAlertRu") - private interface AlertRuleIncidentsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/alertrules" - + "/{ruleName}/incidents/{incidentName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("ruleName") String ruleName, - @PathParam("incidentName") String incidentName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/alertrules" - + "/{ruleName}/incidents") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByAlertRule( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("ruleName") String ruleName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets an incident associated to an alert rule. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param incidentName The name of the incident to retrieve. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an incident associated to an alert rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String resourceGroupName, String ruleName, String incidentName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ruleName == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); - } - if (incidentName == null) { - return Mono.error(new IllegalArgumentException("Parameter incidentName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2016-03-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - resourceGroupName, - ruleName, - incidentName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets an incident associated to an alert rule. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param incidentName The name of the incident to retrieve. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an incident associated to an alert rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String ruleName, String incidentName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ruleName == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); - } - if (incidentName == null) { - return Mono.error(new IllegalArgumentException("Parameter incidentName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2016-03-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - resourceGroupName, - ruleName, - incidentName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets an incident associated to an alert rule. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param incidentName The name of the incident to retrieve. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an incident associated to an alert rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync(String resourceGroupName, String ruleName, String incidentName) { - return getWithResponseAsync(resourceGroupName, ruleName, incidentName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets an incident associated to an alert rule. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param incidentName The name of the incident to retrieve. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an incident associated to an alert rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public IncidentInner get(String resourceGroupName, String ruleName, String incidentName) { - return getAsync(resourceGroupName, ruleName, incidentName).block(); - } - - /** - * Gets an incident associated to an alert rule. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param incidentName The name of the incident to retrieve. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an incident associated to an alert rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String ruleName, String incidentName, Context context) { - return getWithResponseAsync(resourceGroupName, ruleName, incidentName, context).block(); - } - - /** - * Gets a list of incidents associated to an alert rule. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of incidents associated to an alert rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByAlertRuleSinglePageAsync( - String resourceGroupName, String ruleName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ruleName == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2016-03-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByAlertRule( - this.client.getEndpoint(), - resourceGroupName, - ruleName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a list of incidents associated to an alert rule. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of incidents associated to an alert rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByAlertRuleSinglePageAsync( - String resourceGroupName, String ruleName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ruleName == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2016-03-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByAlertRule( - this.client.getEndpoint(), - resourceGroupName, - ruleName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); - } - - /** - * Gets a list of incidents associated to an alert rule. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of incidents associated to an alert rule. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByAlertRuleAsync(String resourceGroupName, String ruleName) { - return new PagedFlux<>(() -> listByAlertRuleSinglePageAsync(resourceGroupName, ruleName)); - } - - /** - * Gets a list of incidents associated to an alert rule. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of incidents associated to an alert rule. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByAlertRuleAsync(String resourceGroupName, String ruleName, Context context) { - return new PagedFlux<>(() -> listByAlertRuleSinglePageAsync(resourceGroupName, ruleName, context)); - } - - /** - * Gets a list of incidents associated to an alert rule. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of incidents associated to an alert rule. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByAlertRule(String resourceGroupName, String ruleName) { - return new PagedIterable<>(listByAlertRuleAsync(resourceGroupName, ruleName)); - } - - /** - * Gets a list of incidents associated to an alert rule. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of incidents associated to an alert rule. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByAlertRule(String resourceGroupName, String ruleName, Context context) { - return new PagedIterable<>(listByAlertRuleAsync(resourceGroupName, ruleName, context)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/AlertRulesClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/AlertRulesClientImpl.java deleted file mode 100644 index c2c3c20b9040..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/AlertRulesClientImpl.java +++ /dev/null @@ -1,1065 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.fluent.AlertRulesClient; -import com.azure.resourcemanager.monitor.fluent.models.AlertRuleResourceInner; -import com.azure.resourcemanager.monitor.models.AlertRuleResourceCollection; -import com.azure.resourcemanager.monitor.models.AlertRuleResourcePatch; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in AlertRulesClient. */ -public final class AlertRulesClientImpl - implements InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete, - AlertRulesClient { - private final ClientLogger logger = new ClientLogger(AlertRulesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final AlertRulesService service; - - /** The service client containing this operation class. */ - private final MonitorClientImpl client; - - /** - * Initializes an instance of AlertRulesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - AlertRulesClientImpl(MonitorClientImpl client) { - this.service = - RestProxy.create(AlertRulesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MonitorClientAlertRules to be used by the proxy service to perform - * REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MonitorClientAlertRu") - private interface AlertRulesService { - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/alertrules" - + "/{ruleName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("ruleName") String ruleName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") AlertRuleResourceInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/alertrules" - + "/{ruleName}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("ruleName") String ruleName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/alertrules" - + "/{ruleName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("ruleName") String ruleName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/alertrules" - + "/{ruleName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("ruleName") String ruleName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") AlertRuleResourcePatch alertRulesResource, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights" - + "/alertrules") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Insights/alertrules") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Creates or updates a classic metric alert rule. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param parameters The parameters of the rule to create or update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the alert rule resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String ruleName, AlertRuleResourceInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ruleName == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2016-03-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - ruleName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a classic metric alert rule. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param parameters The parameters of the rule to create or update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the alert rule resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String ruleName, AlertRuleResourceInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ruleName == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2016-03-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - ruleName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Creates or updates a classic metric alert rule. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param parameters The parameters of the rule to create or update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the alert rule resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, String ruleName, AlertRuleResourceInner parameters) { - return createOrUpdateWithResponseAsync(resourceGroupName, ruleName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates or updates a classic metric alert rule. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param parameters The parameters of the rule to create or update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the alert rule resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AlertRuleResourceInner createOrUpdate( - String resourceGroupName, String ruleName, AlertRuleResourceInner parameters) { - return createOrUpdateAsync(resourceGroupName, ruleName, parameters).block(); - } - - /** - * Creates or updates a classic metric alert rule. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param parameters The parameters of the rule to create or update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the alert rule resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceGroupName, String ruleName, AlertRuleResourceInner parameters, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, ruleName, parameters, context).block(); - } - - /** - * Deletes a classic metric alert rule. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String resourceGroupName, String ruleName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ruleName == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2016-03-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - ruleName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a classic metric alert rule. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String ruleName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ruleName == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2016-03-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - ruleName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Deletes a classic metric alert rule. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String ruleName) { - return deleteWithResponseAsync(resourceGroupName, ruleName).flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes a classic metric alert rule. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String ruleName) { - deleteAsync(resourceGroupName, ruleName).block(); - } - - /** - * Deletes a classic metric alert rule. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String ruleName, Context context) { - return deleteWithResponseAsync(resourceGroupName, ruleName, context).block(); - } - - /** - * Gets a classic metric alert rule. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a classic metric alert rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String ruleName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ruleName == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2016-03-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - ruleName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a classic metric alert rule. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a classic metric alert rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String ruleName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ruleName == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2016-03-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - ruleName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets a classic metric alert rule. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a classic metric alert rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync(String resourceGroupName, String ruleName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, ruleName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a classic metric alert rule. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a classic metric alert rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AlertRuleResourceInner getByResourceGroup(String resourceGroupName, String ruleName) { - return getByResourceGroupAsync(resourceGroupName, ruleName).block(); - } - - /** - * Gets a classic metric alert rule. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a classic metric alert rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String ruleName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, ruleName, context).block(); - } - - /** - * Updates an existing classic metric AlertRuleResource. To update other fields use the CreateOrUpdate method. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param alertRulesResource Parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the alert rule resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateWithResponseAsync( - String resourceGroupName, String ruleName, AlertRuleResourcePatch alertRulesResource) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ruleName == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); - } - if (alertRulesResource == null) { - return Mono - .error(new IllegalArgumentException("Parameter alertRulesResource is required and cannot be null.")); - } else { - alertRulesResource.validate(); - } - final String apiVersion = "2016-03-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - ruleName, - apiVersion, - alertRulesResource, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates an existing classic metric AlertRuleResource. To update other fields use the CreateOrUpdate method. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param alertRulesResource Parameters supplied to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the alert rule resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, String ruleName, AlertRuleResourcePatch alertRulesResource, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ruleName == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); - } - if (alertRulesResource == null) { - return Mono - .error(new IllegalArgumentException("Parameter alertRulesResource is required and cannot be null.")); - } else { - alertRulesResource.validate(); - } - final String apiVersion = "2016-03-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - ruleName, - apiVersion, - alertRulesResource, - accept, - context); - } - - /** - * Updates an existing classic metric AlertRuleResource. To update other fields use the CreateOrUpdate method. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param alertRulesResource Parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the alert rule resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync( - String resourceGroupName, String ruleName, AlertRuleResourcePatch alertRulesResource) { - return updateWithResponseAsync(resourceGroupName, ruleName, alertRulesResource) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Updates an existing classic metric AlertRuleResource. To update other fields use the CreateOrUpdate method. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param alertRulesResource Parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the alert rule resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AlertRuleResourceInner update( - String resourceGroupName, String ruleName, AlertRuleResourcePatch alertRulesResource) { - return updateAsync(resourceGroupName, ruleName, alertRulesResource).block(); - } - - /** - * Updates an existing classic metric AlertRuleResource. To update other fields use the CreateOrUpdate method. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param alertRulesResource Parameters supplied to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the alert rule resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, String ruleName, AlertRuleResourcePatch alertRulesResource, Context context) { - return updateWithResponseAsync(resourceGroupName, ruleName, alertRulesResource, context).block(); - } - - /** - * List the classic metric alert rules within a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of alert rule resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2016-03-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List the classic metric alert rules within a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of alert rule resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2016-03-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); - } - - /** - * List the classic metric alert rules within a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of alert rule resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName)); - } - - /** - * List the classic metric alert rules within a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of alert rule resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context)); - } - - /** - * List the classic metric alert rules within a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of alert rule resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * List the classic metric alert rules within a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of alert rule resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * List the classic metric alert rules within a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of alert rule resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2016-03-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List the classic metric alert rules within a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of alert rule resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2016-03-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); - } - - /** - * List the classic metric alert rules within a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of alert rule resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync()); - } - - /** - * List the classic metric alert rules within a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of alert rule resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context)); - } - - /** - * List the classic metric alert rules within a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of alert rule resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * List the classic metric alert rules within a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of alert rule resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/AlertRulesImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/AlertRulesImpl.java deleted file mode 100644 index ffea2f0be42b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/AlertRulesImpl.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.monitor.implementation; - -import com.azure.resourcemanager.monitor.MonitorManager; -import com.azure.resourcemanager.monitor.models.ActivityLogAlerts; -import com.azure.resourcemanager.monitor.models.AlertRules; -import com.azure.resourcemanager.monitor.models.MetricAlerts; - -/** Implementation for {@link MetricAlerts}. */ -public class AlertRulesImpl implements AlertRules { - - private final MetricAlerts metricAlerts; - private final ActivityLogAlerts activityLogAlerts; - - public AlertRulesImpl(final MonitorManager monitorManager) { - metricAlerts = new MetricAlertsImpl(monitorManager); - activityLogAlerts = new ActivityLogAlertsImpl(monitorManager); - } - - @Override - public MetricAlerts metricAlerts() { - return metricAlerts; - } - - @Override - public ActivityLogAlerts activityLogAlerts() { - return activityLogAlerts; - } - - @Override - public MonitorManager manager() { - return this.metricAlerts.manager(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/AutoscaleProfileImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/AutoscaleProfileImpl.java deleted file mode 100644 index a3f2dc2bd676..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/AutoscaleProfileImpl.java +++ /dev/null @@ -1,199 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.monitor.implementation; - -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.models.AutoscaleProfile; -import com.azure.resourcemanager.monitor.models.DayOfWeek; -import com.azure.resourcemanager.monitor.models.Recurrence; -import com.azure.resourcemanager.monitor.models.RecurrenceFrequency; -import com.azure.resourcemanager.monitor.models.RecurrentSchedule; -import com.azure.resourcemanager.monitor.models.ScaleCapacity; -import com.azure.resourcemanager.monitor.models.ScaleRule; -import com.azure.resourcemanager.monitor.models.TimeWindow; -import com.azure.resourcemanager.monitor.fluent.models.AutoscaleProfileInner; -import com.azure.resourcemanager.monitor.fluent.models.ScaleRuleInner; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.WrapperImpl; -import java.time.OffsetDateTime; -import java.util.ArrayList; -import java.util.List; - -/** Implementation for AutoscaleProfile. */ -class AutoscaleProfileImpl extends WrapperImpl - implements AutoscaleProfile, - AutoscaleProfile.Definition, - AutoscaleProfile.UpdateDefinition, - AutoscaleProfile.Update { - - private final ClientLogger logger = new ClientLogger(getClass()); - - private final AutoscaleSettingImpl parent; - - AutoscaleProfileImpl(String name, AutoscaleProfileInner innerObject, AutoscaleSettingImpl parent) { - super(innerObject); - this.innerModel().withName(name); - this.parent = parent; - if (this.innerModel().capacity() == null) { - this.innerModel().withCapacity(new ScaleCapacity()); - } - if (this.innerModel().rules() == null) { - this.innerModel().withRules(new ArrayList<>()); - } - } - - @Override - public String name() { - return this.innerModel().name(); - } - - @Override - public int minInstanceCount() { - if (this.innerModel().capacity() != null) { - return Integer.parseInt(this.innerModel().capacity().minimum()); - } - return 0; - } - - @Override - public int maxInstanceCount() { - if (this.innerModel().capacity() != null) { - return Integer.parseInt(this.innerModel().capacity().maximum()); - } - return 0; - } - - @Override - public int defaultInstanceCount() { - if (this.innerModel().capacity() != null) { - return Integer.parseInt(this.innerModel().capacity().defaultProperty()); - } - return 0; - } - - @Override - public TimeWindow fixedDateSchedule() { - return this.innerModel().fixedDate(); - } - - @Override - public Recurrence recurrentSchedule() { - return this.innerModel().recurrence(); - } - - @Override - public List rules() { - List rules = new ArrayList<>(); - if (this.innerModel().rules() != null) { - for (ScaleRuleInner ruleInner : this.innerModel().rules()) { - rules.add(new ScaleRuleImpl(ruleInner, this)); - } - } - return rules; - } - - @Override - public AutoscaleSettingImpl parent() { - return parent; - } - - @Override - public AutoscaleSettingImpl attach() { - return parent.addNewAutoscaleProfile(this); - } - - @Override - public AutoscaleProfileImpl withMetricBasedScale( - int minimumInstanceCount, int maximumInstanceCount, int defaultInstanceCount) { - this.innerModel().capacity().withMinimum(Integer.toString(minimumInstanceCount)); - this.innerModel().capacity().withMaximum(Integer.toString(maximumInstanceCount)); - this.innerModel().capacity().withDefaultProperty(Integer.toString(defaultInstanceCount)); - return this; - } - - @Override - public AutoscaleProfileImpl withScheduleBasedScale(int instanceCount) { - return this.withMetricBasedScale(instanceCount, instanceCount, instanceCount); - } - - @Override - public AutoscaleProfileImpl withFixedInstanceCount(int instanceCount) { - this.withMetricBasedScale(instanceCount, instanceCount, instanceCount); - this.innerModel().withFixedDate(null); - this.innerModel().withRecurrence(null); - this.innerModel().withRules(new ArrayList()); - return this; - } - - @Override - public AutoscaleProfileImpl withFixedDateSchedule(String timeZone, OffsetDateTime start, OffsetDateTime end) { - this.innerModel().withFixedDate(new TimeWindow().withTimeZone(timeZone).withStart(start).withEnd(end)); - if (this.innerModel().recurrence() != null) { - this.innerModel().withRecurrence(null); - } - return this; - } - - @Override - public AutoscaleProfileImpl withRecurrentSchedule(String scheduleTimeZone, String startTime, DayOfWeek... weekday) { - if (startTime == null - || startTime.isEmpty() - || startTime.length() != 5 - || startTime.charAt(2) != ':' - || !Character.isDigit(startTime.charAt(0)) - || !Character.isDigit(startTime.charAt(1)) - || !Character.isDigit(startTime.charAt(3)) - || !Character.isDigit(startTime.charAt(4))) { - throw logger.logExceptionAsError(new IllegalArgumentException( - "Start time should have format of 'hh:mm' where hh is in 24-hour clock (AM/PM times are not" - + " supported).")); - } - - int hh = Integer.parseInt(startTime.substring(0, 2)); - int mm = Integer.parseInt(startTime.substring(3)); - if (hh > 23 || mm > 60) { - throw logger.logExceptionAsError(new IllegalArgumentException( - "Start time should have format of 'hh:mm' where hh is in 24-hour clock (AM/PM times are not" - + " supported).")); - } - - this.innerModel().withRecurrence(new Recurrence()); - this.innerModel().recurrence().withFrequency(RecurrenceFrequency.WEEK); - this.innerModel().recurrence().withSchedule(new RecurrentSchedule()); - this.innerModel().recurrence().schedule().withTimeZone(scheduleTimeZone); - this.innerModel().recurrence().schedule().withHours(new ArrayList()); - this.innerModel().recurrence().schedule().withMinutes(new ArrayList()); - this.innerModel().recurrence().schedule().hours().add(hh); - this.innerModel().recurrence().schedule().minutes().add(mm); - this.innerModel().recurrence().schedule().withDays(new ArrayList()); - - for (DayOfWeek dof : weekday) { - this.innerModel().recurrence().schedule().days().add(dof.toString()); - } - - this.innerModel().withFixedDate(null); - return this; - } - - @Override - public ScaleRuleImpl defineScaleRule() { - return new ScaleRuleImpl(new ScaleRuleInner(), this); - } - - @Override - public ScaleRuleImpl updateScaleRule(int ruleIndex) { - ScaleRuleImpl srToUpdate = new ScaleRuleImpl(this.innerModel().rules().get(ruleIndex), this); - return srToUpdate; - } - - @Override - public AutoscaleProfileImpl withoutScaleRule(int ruleIndex) { - this.innerModel().rules().remove(ruleIndex); - return this; - } - - AutoscaleProfileImpl addNewScaleRule(ScaleRuleImpl scaleRule) { - this.innerModel().rules().add(scaleRule.innerModel()); - return this; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/AutoscaleSettingImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/AutoscaleSettingImpl.java deleted file mode 100644 index ee241af1140a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/AutoscaleSettingImpl.java +++ /dev/null @@ -1,258 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.monitor.implementation; - -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.MonitorManager; -import com.azure.resourcemanager.monitor.models.AutoscaleNotification; -import com.azure.resourcemanager.monitor.models.AutoscaleProfile; -import com.azure.resourcemanager.monitor.models.AutoscaleSetting; -import com.azure.resourcemanager.monitor.models.EmailNotification; -import com.azure.resourcemanager.monitor.models.WebhookNotification; -import com.azure.resourcemanager.monitor.fluent.models.AutoscaleProfileInner; -import com.azure.resourcemanager.monitor.fluent.models.AutoscaleSettingResourceInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.GroupableResourceImpl; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import reactor.core.publisher.Mono; - -/** Implementation for AutoscaleSetting. */ -class AutoscaleSettingImpl - extends GroupableResourceImpl - implements AutoscaleSetting, AutoscaleSetting.Definition, AutoscaleSetting.Update { - - private final ClientLogger logger = new ClientLogger(getClass()); - - AutoscaleSettingImpl( - String name, final AutoscaleSettingResourceInner innerModel, final MonitorManager monitorManager) { - super(name, innerModel, monitorManager); - if (isInCreateMode()) { - this.innerModel().withEnabled(true); - } - if (this.innerModel().notifications() == null) { - this.innerModel().withNotifications(new ArrayList()); - this.innerModel().notifications().add(new AutoscaleNotification()); - } - if (this.innerModel().profiles() == null) { - this.innerModel().withProfiles(new ArrayList()); - } - } - - @Override - public String targetResourceId() { - return this.innerModel().targetResourceUri(); - } - - @Override - public Map profiles() { - Map result = new HashMap<>(); - for (AutoscaleProfileInner profileInner : this.innerModel().profiles()) { - AutoscaleProfile profileImpl = new AutoscaleProfileImpl(profileInner.name(), profileInner, this); - result.put(profileImpl.name(), profileImpl); - } - return result; - } - - @Override - public boolean autoscaleEnabled() { - return this.innerModel().enabled(); - } - - @Override - public boolean adminEmailNotificationEnabled() { - if (this.innerModel().notifications() != null - && this.innerModel().notifications().get(0) != null - && this.innerModel().notifications().get(0).email() != null) { - return this.innerModel().notifications().get(0).email().sendToSubscriptionAdministrator(); - } - return false; - } - - @Override - public boolean coAdminEmailNotificationEnabled() { - if (this.innerModel().notifications() != null - && this.innerModel().notifications().get(0) != null - && this.innerModel().notifications().get(0).email() != null) { - return this.innerModel().notifications().get(0).email().sendToSubscriptionCoAdministrators(); - } - return false; - } - - @Override - public List customEmailsNotification() { - if (this.innerModel().notifications() != null - && this.innerModel().notifications().get(0) != null - && this.innerModel().notifications().get(0).email() != null - && this.innerModel().notifications().get(0).email().customEmails() != null) { - return this.innerModel().notifications().get(0).email().customEmails(); - } - return new ArrayList<>(); - } - - @Override - public String webhookNotification() { - if (this.innerModel().notifications() != null - && this.innerModel().notifications().get(0) != null - && this.innerModel().notifications().get(0).email() != null - && this.innerModel().notifications().get(0).webhooks() != null - && this.innerModel().notifications().get(0).webhooks().size() > 0) { - return this.innerModel().notifications().get(0).webhooks().get(0).serviceUri(); - } - return null; - } - - @Override - public AutoscaleProfileImpl defineAutoscaleProfile(String name) { - return new AutoscaleProfileImpl(name, new AutoscaleProfileInner(), this); - } - - @Override - public AutoscaleProfileImpl updateAutoscaleProfile(String name) { - int idx = getProfileIndexByName(name); - if (idx == -1) { - throw logger.logExceptionAsError( - new IllegalArgumentException("Cannot find autoscale profile with the name '" + name + "'")); - } - AutoscaleProfileInner innerProfile = this.innerModel().profiles().get(idx); - - return new AutoscaleProfileImpl(innerProfile.name(), innerProfile, this); - } - - @Override - public AutoscaleSettingImpl withoutAutoscaleProfile(String name) { - int idx = getProfileIndexByName(name); - if (idx != -1) { - this.innerModel().profiles().remove(idx); - } - return this; - } - - @Override - public AutoscaleSettingImpl withTargetResource(String targetResourceId) { - this.innerModel().withTargetResourceUri(targetResourceId); - return this; - } - - @Override - public AutoscaleSettingImpl withAdminEmailNotification() { - AutoscaleNotification notificationInner = getNotificationInner(); - notificationInner.email().withSendToSubscriptionAdministrator(true); - return this; - } - - @Override - public AutoscaleSettingImpl withCoAdminEmailNotification() { - AutoscaleNotification notificationInner = getNotificationInner(); - notificationInner.email().withSendToSubscriptionCoAdministrators(true); - return this; - } - - @Override - public AutoscaleSettingImpl withCustomEmailsNotification(String... customEmailAddresses) { - AutoscaleNotification notificationInner = getNotificationInner(); - notificationInner.email().withCustomEmails(new ArrayList()); - for (String strEmail : customEmailAddresses) { - notificationInner.email().customEmails().add(strEmail); - } - return this; - } - - @Override - public AutoscaleSettingImpl withWebhookNotification(String serviceUri) { - AutoscaleNotification notificationInner = getNotificationInner(); - if (notificationInner.webhooks() == null) { - notificationInner.withWebhooks(new ArrayList()); - } - if (notificationInner.webhooks().isEmpty()) { - notificationInner.webhooks().add(new WebhookNotification()); - } - notificationInner.webhooks().get(0).withServiceUri(serviceUri); - return this; - } - - @Override - public AutoscaleSettingImpl withoutAdminEmailNotification() { - AutoscaleNotification notificationInner = getNotificationInner(); - notificationInner.email().withSendToSubscriptionAdministrator(false); - return this; - } - - @Override - public AutoscaleSettingImpl withoutCoAdminEmailNotification() { - AutoscaleNotification notificationInner = getNotificationInner(); - notificationInner.email().withSendToSubscriptionCoAdministrators(false); - return this; - } - - @Override - public AutoscaleSettingImpl withoutCustomEmailsNotification() { - AutoscaleNotification notificationInner = getNotificationInner(); - notificationInner.email().withCustomEmails(null); - return this; - } - - @Override - public AutoscaleSettingImpl withoutWebhookNotification() { - AutoscaleNotification notificationInner = getNotificationInner(); - notificationInner.withWebhooks(null); - return this; - } - - @Override - public AutoscaleSettingImpl withAutoscaleEnabled() { - this.innerModel().withEnabled(true); - return this; - } - - @Override - public AutoscaleSettingImpl withAutoscaleDisabled() { - this.innerModel().withEnabled(false); - return this; - } - - @Override - public Mono createResourceAsync() { - return this - .manager() - .serviceClient() - .getAutoscaleSettings() - .createOrUpdateAsync(this.resourceGroupName(), this.name(), this.innerModel()) - .map(innerToFluentMap(this)); - } - - @Override - protected Mono getInnerAsync() { - return this - .manager() - .serviceClient() - .getAutoscaleSettings() - .getByResourceGroupAsync(this.resourceGroupName(), this.name()); - } - - public AutoscaleSettingImpl addNewAutoscaleProfile(AutoscaleProfileImpl profile) { - this.innerModel().profiles().add(profile.innerModel()); - return this; - } - - private int getProfileIndexByName(String name) { - int idxResult = -1; - for (int idx = 0; idx < this.innerModel().profiles().size(); idx++) { - if (this.innerModel().profiles().get(idx).name().equalsIgnoreCase(name)) { - idxResult = idx; - break; - } - } - return idxResult; - } - - private AutoscaleNotification getNotificationInner() { - AutoscaleNotification notificationInner = this.innerModel().notifications().get(0); - if (notificationInner.email() == null) { - notificationInner.withEmail(new EmailNotification()); - } - return notificationInner; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/AutoscaleSettingsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/AutoscaleSettingsClientImpl.java deleted file mode 100644 index f4ebf1e5f37e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/AutoscaleSettingsClientImpl.java +++ /dev/null @@ -1,1285 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.fluent.AutoscaleSettingsClient; -import com.azure.resourcemanager.monitor.fluent.models.AutoscaleSettingResourceInner; -import com.azure.resourcemanager.monitor.models.AutoscaleSettingResourceCollection; -import com.azure.resourcemanager.monitor.models.AutoscaleSettingResourcePatch; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in AutoscaleSettingsClient. */ -public final class AutoscaleSettingsClientImpl - implements InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete, - AutoscaleSettingsClient { - private final ClientLogger logger = new ClientLogger(AutoscaleSettingsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final AutoscaleSettingsService service; - - /** The service client containing this operation class. */ - private final MonitorClientImpl client; - - /** - * Initializes an instance of AutoscaleSettingsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - AutoscaleSettingsClientImpl(MonitorClientImpl client) { - this.service = - RestProxy.create(AutoscaleSettingsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MonitorClientAutoscaleSettings to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MonitorClientAutosca") - private interface AutoscaleSettingsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights" - + "/autoscalesettings") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights" - + "/autoscalesettings/{autoscaleSettingName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("autoscaleSettingName") String autoscaleSettingName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") AutoscaleSettingResourceInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights" - + "/autoscalesettings/{autoscaleSettingName}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("autoscaleSettingName") String autoscaleSettingName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights" - + "/autoscalesettings/{autoscaleSettingName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("autoscaleSettingName") String autoscaleSettingName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights" - + "/autoscalesettings/{autoscaleSettingName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("autoscaleSettingName") String autoscaleSettingName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") AutoscaleSettingResourcePatch autoscaleSettingResource, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Insights/autoscalesettings") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Lists the autoscale settings for a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of autoscale setting resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2015-04-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists the autoscale settings for a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of autoscale setting resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2015-04-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists the autoscale settings for a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of autoscale setting resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * Lists the autoscale settings for a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of autoscale setting resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync( - String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists the autoscale settings for a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of autoscale setting resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * Lists the autoscale settings for a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of autoscale setting resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * Creates or updates an autoscale setting. - * - * @param resourceGroupName The name of the resource group. - * @param autoscaleSettingName The autoscale setting name. - * @param parameters Parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the autoscale setting resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String autoscaleSettingName, AutoscaleSettingResourceInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (autoscaleSettingName == null) { - return Mono - .error(new IllegalArgumentException("Parameter autoscaleSettingName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2015-04-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - autoscaleSettingName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates an autoscale setting. - * - * @param resourceGroupName The name of the resource group. - * @param autoscaleSettingName The autoscale setting name. - * @param parameters Parameters supplied to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the autoscale setting resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, - String autoscaleSettingName, - AutoscaleSettingResourceInner parameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (autoscaleSettingName == null) { - return Mono - .error(new IllegalArgumentException("Parameter autoscaleSettingName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2015-04-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - autoscaleSettingName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Creates or updates an autoscale setting. - * - * @param resourceGroupName The name of the resource group. - * @param autoscaleSettingName The autoscale setting name. - * @param parameters Parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the autoscale setting resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, String autoscaleSettingName, AutoscaleSettingResourceInner parameters) { - return createOrUpdateWithResponseAsync(resourceGroupName, autoscaleSettingName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates or updates an autoscale setting. - * - * @param resourceGroupName The name of the resource group. - * @param autoscaleSettingName The autoscale setting name. - * @param parameters Parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the autoscale setting resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AutoscaleSettingResourceInner createOrUpdate( - String resourceGroupName, String autoscaleSettingName, AutoscaleSettingResourceInner parameters) { - return createOrUpdateAsync(resourceGroupName, autoscaleSettingName, parameters).block(); - } - - /** - * Creates or updates an autoscale setting. - * - * @param resourceGroupName The name of the resource group. - * @param autoscaleSettingName The autoscale setting name. - * @param parameters Parameters supplied to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the autoscale setting resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceGroupName, - String autoscaleSettingName, - AutoscaleSettingResourceInner parameters, - Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, autoscaleSettingName, parameters, context).block(); - } - - /** - * Deletes and autoscale setting. - * - * @param resourceGroupName The name of the resource group. - * @param autoscaleSettingName The autoscale setting name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String resourceGroupName, String autoscaleSettingName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (autoscaleSettingName == null) { - return Mono - .error(new IllegalArgumentException("Parameter autoscaleSettingName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2015-04-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - autoscaleSettingName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes and autoscale setting. - * - * @param resourceGroupName The name of the resource group. - * @param autoscaleSettingName The autoscale setting name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String autoscaleSettingName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (autoscaleSettingName == null) { - return Mono - .error(new IllegalArgumentException("Parameter autoscaleSettingName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2015-04-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - autoscaleSettingName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Deletes and autoscale setting. - * - * @param resourceGroupName The name of the resource group. - * @param autoscaleSettingName The autoscale setting name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String autoscaleSettingName) { - return deleteWithResponseAsync(resourceGroupName, autoscaleSettingName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes and autoscale setting. - * - * @param resourceGroupName The name of the resource group. - * @param autoscaleSettingName The autoscale setting name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String autoscaleSettingName) { - deleteAsync(resourceGroupName, autoscaleSettingName).block(); - } - - /** - * Deletes and autoscale setting. - * - * @param resourceGroupName The name of the resource group. - * @param autoscaleSettingName The autoscale setting name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String autoscaleSettingName, Context context) { - return deleteWithResponseAsync(resourceGroupName, autoscaleSettingName, context).block(); - } - - /** - * Gets an autoscale setting. - * - * @param resourceGroupName The name of the resource group. - * @param autoscaleSettingName The autoscale setting name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an autoscale setting. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String autoscaleSettingName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (autoscaleSettingName == null) { - return Mono - .error(new IllegalArgumentException("Parameter autoscaleSettingName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2015-04-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - autoscaleSettingName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets an autoscale setting. - * - * @param resourceGroupName The name of the resource group. - * @param autoscaleSettingName The autoscale setting name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an autoscale setting. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String autoscaleSettingName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (autoscaleSettingName == null) { - return Mono - .error(new IllegalArgumentException("Parameter autoscaleSettingName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2015-04-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - autoscaleSettingName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets an autoscale setting. - * - * @param resourceGroupName The name of the resource group. - * @param autoscaleSettingName The autoscale setting name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an autoscale setting. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync( - String resourceGroupName, String autoscaleSettingName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, autoscaleSettingName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets an autoscale setting. - * - * @param resourceGroupName The name of the resource group. - * @param autoscaleSettingName The autoscale setting name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an autoscale setting. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AutoscaleSettingResourceInner getByResourceGroup(String resourceGroupName, String autoscaleSettingName) { - return getByResourceGroupAsync(resourceGroupName, autoscaleSettingName).block(); - } - - /** - * Gets an autoscale setting. - * - * @param resourceGroupName The name of the resource group. - * @param autoscaleSettingName The autoscale setting name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an autoscale setting. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String autoscaleSettingName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, autoscaleSettingName, context).block(); - } - - /** - * Updates an existing AutoscaleSettingsResource. To update other fields use the CreateOrUpdate method. - * - * @param resourceGroupName The name of the resource group. - * @param autoscaleSettingName The autoscale setting name. - * @param autoscaleSettingResource Parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the autoscale setting resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateWithResponseAsync( - String resourceGroupName, String autoscaleSettingName, AutoscaleSettingResourcePatch autoscaleSettingResource) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (autoscaleSettingName == null) { - return Mono - .error(new IllegalArgumentException("Parameter autoscaleSettingName is required and cannot be null.")); - } - if (autoscaleSettingResource == null) { - return Mono - .error( - new IllegalArgumentException("Parameter autoscaleSettingResource is required and cannot be null.")); - } else { - autoscaleSettingResource.validate(); - } - final String apiVersion = "2015-04-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - autoscaleSettingName, - apiVersion, - autoscaleSettingResource, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates an existing AutoscaleSettingsResource. To update other fields use the CreateOrUpdate method. - * - * @param resourceGroupName The name of the resource group. - * @param autoscaleSettingName The autoscale setting name. - * @param autoscaleSettingResource Parameters supplied to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the autoscale setting resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, - String autoscaleSettingName, - AutoscaleSettingResourcePatch autoscaleSettingResource, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (autoscaleSettingName == null) { - return Mono - .error(new IllegalArgumentException("Parameter autoscaleSettingName is required and cannot be null.")); - } - if (autoscaleSettingResource == null) { - return Mono - .error( - new IllegalArgumentException("Parameter autoscaleSettingResource is required and cannot be null.")); - } else { - autoscaleSettingResource.validate(); - } - final String apiVersion = "2015-04-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - autoscaleSettingName, - apiVersion, - autoscaleSettingResource, - accept, - context); - } - - /** - * Updates an existing AutoscaleSettingsResource. To update other fields use the CreateOrUpdate method. - * - * @param resourceGroupName The name of the resource group. - * @param autoscaleSettingName The autoscale setting name. - * @param autoscaleSettingResource Parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the autoscale setting resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync( - String resourceGroupName, String autoscaleSettingName, AutoscaleSettingResourcePatch autoscaleSettingResource) { - return updateWithResponseAsync(resourceGroupName, autoscaleSettingName, autoscaleSettingResource) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Updates an existing AutoscaleSettingsResource. To update other fields use the CreateOrUpdate method. - * - * @param resourceGroupName The name of the resource group. - * @param autoscaleSettingName The autoscale setting name. - * @param autoscaleSettingResource Parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the autoscale setting resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AutoscaleSettingResourceInner update( - String resourceGroupName, String autoscaleSettingName, AutoscaleSettingResourcePatch autoscaleSettingResource) { - return updateAsync(resourceGroupName, autoscaleSettingName, autoscaleSettingResource).block(); - } - - /** - * Updates an existing AutoscaleSettingsResource. To update other fields use the CreateOrUpdate method. - * - * @param resourceGroupName The name of the resource group. - * @param autoscaleSettingName The autoscale setting name. - * @param autoscaleSettingResource Parameters supplied to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the autoscale setting resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, - String autoscaleSettingName, - AutoscaleSettingResourcePatch autoscaleSettingResource, - Context context) { - return updateWithResponseAsync(resourceGroupName, autoscaleSettingName, autoscaleSettingResource, context) - .block(); - } - - /** - * Lists the autoscale settings for a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of autoscale setting resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2015-04-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists the autoscale settings for a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of autoscale setting resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2015-04-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists the autoscale settings for a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of autoscale setting resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>( - () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); - } - - /** - * Lists the autoscale settings for a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of autoscale setting resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists the autoscale settings for a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of autoscale setting resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Lists the autoscale settings for a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of autoscale setting resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of autoscale setting resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of autoscale setting resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of autoscale setting resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of autoscale setting resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/AutoscaleSettingsImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/AutoscaleSettingsImpl.java deleted file mode 100644 index 2bf4f86c4aaf..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/AutoscaleSettingsImpl.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.monitor.implementation; - -import com.azure.resourcemanager.monitor.MonitorManager; -import com.azure.resourcemanager.monitor.models.AutoscaleSetting; -import com.azure.resourcemanager.monitor.models.AutoscaleSettings; -import com.azure.resourcemanager.monitor.fluent.models.AutoscaleSettingResourceInner; -import com.azure.resourcemanager.monitor.fluent.AutoscaleSettingsClient; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.TopLevelModifiableResourcesImpl; - -/** Implementation for {@link AutoscaleSettings}. */ -public class AutoscaleSettingsImpl - extends TopLevelModifiableResourcesImpl< - AutoscaleSetting, AutoscaleSettingImpl, AutoscaleSettingResourceInner, AutoscaleSettingsClient, MonitorManager> - implements AutoscaleSettings { - - public AutoscaleSettingsImpl(final MonitorManager monitorManager) { - super(monitorManager.serviceClient().getAutoscaleSettings(), monitorManager); - } - - @Override - protected AutoscaleSettingImpl wrapModel(String name) { - return new AutoscaleSettingImpl(name, new AutoscaleSettingResourceInner(), this.manager()); - } - - @Override - protected AutoscaleSettingImpl wrapModel(AutoscaleSettingResourceInner inner) { - if (inner == null) { - return null; - } - return new AutoscaleSettingImpl(inner.name(), inner, this.manager()); - } - - @Override - public AutoscaleSettingImpl define(String name) { - return wrapModel(name); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/BaselinesClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/BaselinesClientImpl.java deleted file mode 100644 index 802993dae4ee..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/BaselinesClientImpl.java +++ /dev/null @@ -1,461 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.fluent.BaselinesClient; -import com.azure.resourcemanager.monitor.fluent.models.SingleMetricBaselineInner; -import com.azure.resourcemanager.monitor.models.MetricBaselinesResponse; -import com.azure.resourcemanager.monitor.models.ResultType; -import java.time.Duration; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in BaselinesClient. */ -public final class BaselinesClientImpl implements BaselinesClient { - private final ClientLogger logger = new ClientLogger(BaselinesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final BaselinesService service; - - /** The service client containing this operation class. */ - private final MonitorClientImpl client; - - /** - * Initializes an instance of BaselinesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - BaselinesClientImpl(MonitorClientImpl client) { - this.service = - RestProxy.create(BaselinesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MonitorClientBaselines to be used by the proxy service to perform - * REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MonitorClientBaselin") - private interface BaselinesService { - @Headers({"Content-Type: application/json"}) - @Get("/{resourceUri}/providers/Microsoft.Insights/metricBaselines") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam(value = "resourceUri", encoded = true) String resourceUri, - @QueryParam("metricnames") String metricnames, - @QueryParam("metricnamespace") String metricnamespace, - @QueryParam("timespan") String timespan, - @QueryParam("interval") Duration interval, - @QueryParam("aggregation") String aggregation, - @QueryParam("sensitivities") String sensitivities, - @QueryParam("$filter") String filter, - @QueryParam("resultType") ResultType resultType, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * **Lists the metric baseline values for a resource**. - * - * @param resourceUri The identifier of the resource. - * @param metricnames The names of the metrics (comma separated) to retrieve. Special case: If a metricname itself - * has a comma in it then use %2 to indicate it. Eg: 'Metric,Name1' should be **'Metric%2Name1'**. - * @param metricnamespace Metric namespace to query metric definitions for. - * @param timespan The timespan of the query. It is a string with the following format - * 'startDateTime_ISO/endDateTime_ISO'. - * @param interval The interval (i.e. timegrain) of the query. - * @param aggregation The list of aggregation types (comma separated) to retrieve. - * @param sensitivities The list of sensitivities (comma separated) to retrieve. - * @param filter The **$filter** is used to reduce the set of metric data returned. Example: Metric contains - * metadata A, B and C. - Return all time series of C where A = a1 and B = b1 or b2 **$filter=A eq 'a1' and B eq - * 'b1' or B eq 'b2' and C eq '*'** - Invalid variant: **$filter=A eq 'a1' and B eq 'b1' and C eq '*' or B = - * 'b2'** This is invalid because the logical or operator cannot separate two different metadata names. - Return - * all time series where A = a1, B = b1 and C = c1: **$filter=A eq 'a1' and B eq 'b1' and C eq 'c1'** - Return - * all time series where A = a1 **$filter=A eq 'a1' and B eq '*' and C eq '*'**. Special case: When dimension - * name or dimension value uses round brackets. Eg: When dimension name is **dim (test) 1** Instead of using - * $filter= "dim (test) 1 eq '*' " use **$filter= "dim %2528test%2529 1 eq '*' "** When dimension name is **dim - * (test) 3** and dimension value is **dim3 (test) val** Instead of using $filter= "dim (test) 3 eq 'dim3 (test) - * val' " use **$filter= "dim %2528test%2529 3 eq 'dim3 %2528test%2529 val' "**. - * @param resultType Allows retrieving only metadata of the baseline. On data request all information is retrieved. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of metric baselines. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceUri, - String metricnames, - String metricnamespace, - String timespan, - Duration interval, - String aggregation, - String sensitivities, - String filter, - ResultType resultType) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceUri == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); - } - final String apiVersion = "2019-03-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - resourceUri, - metricnames, - metricnamespace, - timespan, - interval, - aggregation, - sensitivities, - filter, - resultType, - apiVersion, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * **Lists the metric baseline values for a resource**. - * - * @param resourceUri The identifier of the resource. - * @param metricnames The names of the metrics (comma separated) to retrieve. Special case: If a metricname itself - * has a comma in it then use %2 to indicate it. Eg: 'Metric,Name1' should be **'Metric%2Name1'**. - * @param metricnamespace Metric namespace to query metric definitions for. - * @param timespan The timespan of the query. It is a string with the following format - * 'startDateTime_ISO/endDateTime_ISO'. - * @param interval The interval (i.e. timegrain) of the query. - * @param aggregation The list of aggregation types (comma separated) to retrieve. - * @param sensitivities The list of sensitivities (comma separated) to retrieve. - * @param filter The **$filter** is used to reduce the set of metric data returned. Example: Metric contains - * metadata A, B and C. - Return all time series of C where A = a1 and B = b1 or b2 **$filter=A eq 'a1' and B eq - * 'b1' or B eq 'b2' and C eq '*'** - Invalid variant: **$filter=A eq 'a1' and B eq 'b1' and C eq '*' or B = - * 'b2'** This is invalid because the logical or operator cannot separate two different metadata names. - Return - * all time series where A = a1, B = b1 and C = c1: **$filter=A eq 'a1' and B eq 'b1' and C eq 'c1'** - Return - * all time series where A = a1 **$filter=A eq 'a1' and B eq '*' and C eq '*'**. Special case: When dimension - * name or dimension value uses round brackets. Eg: When dimension name is **dim (test) 1** Instead of using - * $filter= "dim (test) 1 eq '*' " use **$filter= "dim %2528test%2529 1 eq '*' "** When dimension name is **dim - * (test) 3** and dimension value is **dim3 (test) val** Instead of using $filter= "dim (test) 3 eq 'dim3 (test) - * val' " use **$filter= "dim %2528test%2529 3 eq 'dim3 %2528test%2529 val' "**. - * @param resultType Allows retrieving only metadata of the baseline. On data request all information is retrieved. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of metric baselines. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceUri, - String metricnames, - String metricnamespace, - String timespan, - Duration interval, - String aggregation, - String sensitivities, - String filter, - ResultType resultType, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceUri == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); - } - final String apiVersion = "2019-03-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - resourceUri, - metricnames, - metricnamespace, - timespan, - interval, - aggregation, - sensitivities, - filter, - resultType, - apiVersion, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); - } - - /** - * **Lists the metric baseline values for a resource**. - * - * @param resourceUri The identifier of the resource. - * @param metricnames The names of the metrics (comma separated) to retrieve. Special case: If a metricname itself - * has a comma in it then use %2 to indicate it. Eg: 'Metric,Name1' should be **'Metric%2Name1'**. - * @param metricnamespace Metric namespace to query metric definitions for. - * @param timespan The timespan of the query. It is a string with the following format - * 'startDateTime_ISO/endDateTime_ISO'. - * @param interval The interval (i.e. timegrain) of the query. - * @param aggregation The list of aggregation types (comma separated) to retrieve. - * @param sensitivities The list of sensitivities (comma separated) to retrieve. - * @param filter The **$filter** is used to reduce the set of metric data returned. Example: Metric contains - * metadata A, B and C. - Return all time series of C where A = a1 and B = b1 or b2 **$filter=A eq 'a1' and B eq - * 'b1' or B eq 'b2' and C eq '*'** - Invalid variant: **$filter=A eq 'a1' and B eq 'b1' and C eq '*' or B = - * 'b2'** This is invalid because the logical or operator cannot separate two different metadata names. - Return - * all time series where A = a1, B = b1 and C = c1: **$filter=A eq 'a1' and B eq 'b1' and C eq 'c1'** - Return - * all time series where A = a1 **$filter=A eq 'a1' and B eq '*' and C eq '*'**. Special case: When dimension - * name or dimension value uses round brackets. Eg: When dimension name is **dim (test) 1** Instead of using - * $filter= "dim (test) 1 eq '*' " use **$filter= "dim %2528test%2529 1 eq '*' "** When dimension name is **dim - * (test) 3** and dimension value is **dim3 (test) val** Instead of using $filter= "dim (test) 3 eq 'dim3 (test) - * val' " use **$filter= "dim %2528test%2529 3 eq 'dim3 %2528test%2529 val' "**. - * @param resultType Allows retrieving only metadata of the baseline. On data request all information is retrieved. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of metric baselines. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync( - String resourceUri, - String metricnames, - String metricnamespace, - String timespan, - Duration interval, - String aggregation, - String sensitivities, - String filter, - ResultType resultType) { - return new PagedFlux<>( - () -> - listSinglePageAsync( - resourceUri, - metricnames, - metricnamespace, - timespan, - interval, - aggregation, - sensitivities, - filter, - resultType)); - } - - /** - * **Lists the metric baseline values for a resource**. - * - * @param resourceUri The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of metric baselines. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String resourceUri) { - final String metricnames = null; - final String metricnamespace = null; - final String timespan = null; - final Duration interval = null; - final String aggregation = null; - final String sensitivities = null; - final String filter = null; - final ResultType resultType = null; - return new PagedFlux<>( - () -> - listSinglePageAsync( - resourceUri, - metricnames, - metricnamespace, - timespan, - interval, - aggregation, - sensitivities, - filter, - resultType)); - } - - /** - * **Lists the metric baseline values for a resource**. - * - * @param resourceUri The identifier of the resource. - * @param metricnames The names of the metrics (comma separated) to retrieve. Special case: If a metricname itself - * has a comma in it then use %2 to indicate it. Eg: 'Metric,Name1' should be **'Metric%2Name1'**. - * @param metricnamespace Metric namespace to query metric definitions for. - * @param timespan The timespan of the query. It is a string with the following format - * 'startDateTime_ISO/endDateTime_ISO'. - * @param interval The interval (i.e. timegrain) of the query. - * @param aggregation The list of aggregation types (comma separated) to retrieve. - * @param sensitivities The list of sensitivities (comma separated) to retrieve. - * @param filter The **$filter** is used to reduce the set of metric data returned. Example: Metric contains - * metadata A, B and C. - Return all time series of C where A = a1 and B = b1 or b2 **$filter=A eq 'a1' and B eq - * 'b1' or B eq 'b2' and C eq '*'** - Invalid variant: **$filter=A eq 'a1' and B eq 'b1' and C eq '*' or B = - * 'b2'** This is invalid because the logical or operator cannot separate two different metadata names. - Return - * all time series where A = a1, B = b1 and C = c1: **$filter=A eq 'a1' and B eq 'b1' and C eq 'c1'** - Return - * all time series where A = a1 **$filter=A eq 'a1' and B eq '*' and C eq '*'**. Special case: When dimension - * name or dimension value uses round brackets. Eg: When dimension name is **dim (test) 1** Instead of using - * $filter= "dim (test) 1 eq '*' " use **$filter= "dim %2528test%2529 1 eq '*' "** When dimension name is **dim - * (test) 3** and dimension value is **dim3 (test) val** Instead of using $filter= "dim (test) 3 eq 'dim3 (test) - * val' " use **$filter= "dim %2528test%2529 3 eq 'dim3 %2528test%2529 val' "**. - * @param resultType Allows retrieving only metadata of the baseline. On data request all information is retrieved. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of metric baselines. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceUri, - String metricnames, - String metricnamespace, - String timespan, - Duration interval, - String aggregation, - String sensitivities, - String filter, - ResultType resultType, - Context context) { - return new PagedFlux<>( - () -> - listSinglePageAsync( - resourceUri, - metricnames, - metricnamespace, - timespan, - interval, - aggregation, - sensitivities, - filter, - resultType, - context)); - } - - /** - * **Lists the metric baseline values for a resource**. - * - * @param resourceUri The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of metric baselines. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceUri) { - final String metricnames = null; - final String metricnamespace = null; - final String timespan = null; - final Duration interval = null; - final String aggregation = null; - final String sensitivities = null; - final String filter = null; - final ResultType resultType = null; - return new PagedIterable<>( - listAsync( - resourceUri, - metricnames, - metricnamespace, - timespan, - interval, - aggregation, - sensitivities, - filter, - resultType)); - } - - /** - * **Lists the metric baseline values for a resource**. - * - * @param resourceUri The identifier of the resource. - * @param metricnames The names of the metrics (comma separated) to retrieve. Special case: If a metricname itself - * has a comma in it then use %2 to indicate it. Eg: 'Metric,Name1' should be **'Metric%2Name1'**. - * @param metricnamespace Metric namespace to query metric definitions for. - * @param timespan The timespan of the query. It is a string with the following format - * 'startDateTime_ISO/endDateTime_ISO'. - * @param interval The interval (i.e. timegrain) of the query. - * @param aggregation The list of aggregation types (comma separated) to retrieve. - * @param sensitivities The list of sensitivities (comma separated) to retrieve. - * @param filter The **$filter** is used to reduce the set of metric data returned. Example: Metric contains - * metadata A, B and C. - Return all time series of C where A = a1 and B = b1 or b2 **$filter=A eq 'a1' and B eq - * 'b1' or B eq 'b2' and C eq '*'** - Invalid variant: **$filter=A eq 'a1' and B eq 'b1' and C eq '*' or B = - * 'b2'** This is invalid because the logical or operator cannot separate two different metadata names. - Return - * all time series where A = a1, B = b1 and C = c1: **$filter=A eq 'a1' and B eq 'b1' and C eq 'c1'** - Return - * all time series where A = a1 **$filter=A eq 'a1' and B eq '*' and C eq '*'**. Special case: When dimension - * name or dimension value uses round brackets. Eg: When dimension name is **dim (test) 1** Instead of using - * $filter= "dim (test) 1 eq '*' " use **$filter= "dim %2528test%2529 1 eq '*' "** When dimension name is **dim - * (test) 3** and dimension value is **dim3 (test) val** Instead of using $filter= "dim (test) 3 eq 'dim3 (test) - * val' " use **$filter= "dim %2528test%2529 3 eq 'dim3 %2528test%2529 val' "**. - * @param resultType Allows retrieving only metadata of the baseline. On data request all information is retrieved. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of metric baselines. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceUri, - String metricnames, - String metricnamespace, - String timespan, - Duration interval, - String aggregation, - String sensitivities, - String filter, - ResultType resultType, - Context context) { - return new PagedIterable<>( - listAsync( - resourceUri, - metricnames, - metricnamespace, - timespan, - interval, - aggregation, - sensitivities, - filter, - resultType, - context)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/DataCollectionEndpointsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/DataCollectionEndpointsClientImpl.java deleted file mode 100644 index daf55bfbea94..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/DataCollectionEndpointsClientImpl.java +++ /dev/null @@ -1,1343 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.fluent.DataCollectionEndpointsClient; -import com.azure.resourcemanager.monitor.fluent.models.DataCollectionEndpointResourceInner; -import com.azure.resourcemanager.monitor.models.DataCollectionEndpointResourceListResult; -import com.azure.resourcemanager.monitor.models.ResourceForUpdate; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.util.Map; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in DataCollectionEndpointsClient. */ -public final class DataCollectionEndpointsClientImpl - implements InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete, - DataCollectionEndpointsClient { - private final ClientLogger logger = new ClientLogger(DataCollectionEndpointsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final DataCollectionEndpointsService service; - - /** The service client containing this operation class. */ - private final MonitorClientImpl client; - - /** - * Initializes an instance of DataCollectionEndpointsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - DataCollectionEndpointsClientImpl(MonitorClientImpl client) { - this.service = - RestProxy - .create(DataCollectionEndpointsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MonitorClientDataCollectionEndpoints to be used by the proxy service - * to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MonitorClientDataCol") - private interface DataCollectionEndpointsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights" - + "/dataCollectionEndpoints") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Insights/dataCollectionEndpoints") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights" - + "/dataCollectionEndpoints/{dataCollectionEndpointName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("dataCollectionEndpointName") String dataCollectionEndpointName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights" - + "/dataCollectionEndpoints/{dataCollectionEndpointName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> create( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("dataCollectionEndpointName") String dataCollectionEndpointName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") DataCollectionEndpointResourceInner body, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights" - + "/dataCollectionEndpoints/{dataCollectionEndpointName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("dataCollectionEndpointName") String dataCollectionEndpointName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ResourceForUpdate body, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights" - + "/dataCollectionEndpoints/{dataCollectionEndpointName}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("dataCollectionEndpointName") String dataCollectionEndpointName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Lists all data collection endpoints in the specified resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a pageable list of resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String apiVersion = "2021-04-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - apiVersion, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all data collection endpoints in the specified resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a pageable list of resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String apiVersion = "2021-04-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - apiVersion, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists all data collection endpoints in the specified resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a pageable list of resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * Lists all data collection endpoints in the specified resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a pageable list of resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync( - String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all data collection endpoints in the specified resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a pageable list of resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * Lists all data collection endpoints in the specified resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a pageable list of resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup( - String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * Lists all data collection endpoints in the specified subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a pageable list of resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2021-04-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all data collection endpoints in the specified subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a pageable list of resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2021-04-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists all data collection endpoints in the specified subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a pageable list of resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>( - () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); - } - - /** - * Lists all data collection endpoints in the specified subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a pageable list of resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all data collection endpoints in the specified subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a pageable list of resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Lists all data collection endpoints in the specified subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a pageable list of resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Returns the specified data collection endpoint. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of ARM tracked top level resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String dataCollectionEndpointName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (dataCollectionEndpointName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter dataCollectionEndpointName is required and cannot be null.")); - } - final String apiVersion = "2021-04-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - dataCollectionEndpointName, - apiVersion, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns the specified data collection endpoint. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of ARM tracked top level resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String dataCollectionEndpointName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (dataCollectionEndpointName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter dataCollectionEndpointName is required and cannot be null.")); - } - final String apiVersion = "2021-04-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - dataCollectionEndpointName, - apiVersion, - accept, - context); - } - - /** - * Returns the specified data collection endpoint. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of ARM tracked top level resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync( - String resourceGroupName, String dataCollectionEndpointName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, dataCollectionEndpointName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Returns the specified data collection endpoint. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of ARM tracked top level resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DataCollectionEndpointResourceInner getByResourceGroup( - String resourceGroupName, String dataCollectionEndpointName) { - return getByResourceGroupAsync(resourceGroupName, dataCollectionEndpointName).block(); - } - - /** - * Returns the specified data collection endpoint. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of ARM tracked top level resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String dataCollectionEndpointName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, dataCollectionEndpointName, context).block(); - } - - /** - * Creates or updates a data collection endpoint. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case insensitive. - * @param body The payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of ARM tracked top level resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createWithResponseAsync( - String resourceGroupName, String dataCollectionEndpointName, DataCollectionEndpointResourceInner body) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (dataCollectionEndpointName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter dataCollectionEndpointName is required and cannot be null.")); - } - if (body != null) { - body.validate(); - } - final String apiVersion = "2021-04-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .create( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - dataCollectionEndpointName, - apiVersion, - body, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a data collection endpoint. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case insensitive. - * @param body The payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of ARM tracked top level resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync( - String resourceGroupName, - String dataCollectionEndpointName, - DataCollectionEndpointResourceInner body, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (dataCollectionEndpointName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter dataCollectionEndpointName is required and cannot be null.")); - } - if (body != null) { - body.validate(); - } - final String apiVersion = "2021-04-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .create( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - dataCollectionEndpointName, - apiVersion, - body, - accept, - context); - } - - /** - * Creates or updates a data collection endpoint. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case insensitive. - * @param body The payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of ARM tracked top level resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createAsync( - String resourceGroupName, String dataCollectionEndpointName, DataCollectionEndpointResourceInner body) { - return createWithResponseAsync(resourceGroupName, dataCollectionEndpointName, body) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates or updates a data collection endpoint. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of ARM tracked top level resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createAsync( - String resourceGroupName, String dataCollectionEndpointName) { - final DataCollectionEndpointResourceInner body = null; - return createWithResponseAsync(resourceGroupName, dataCollectionEndpointName, body) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates or updates a data collection endpoint. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of ARM tracked top level resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DataCollectionEndpointResourceInner create(String resourceGroupName, String dataCollectionEndpointName) { - final DataCollectionEndpointResourceInner body = null; - return createAsync(resourceGroupName, dataCollectionEndpointName, body).block(); - } - - /** - * Creates or updates a data collection endpoint. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case insensitive. - * @param body The payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of ARM tracked top level resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse( - String resourceGroupName, - String dataCollectionEndpointName, - DataCollectionEndpointResourceInner body, - Context context) { - return createWithResponseAsync(resourceGroupName, dataCollectionEndpointName, body, context).block(); - } - - /** - * Updates part of a data collection endpoint. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case insensitive. - * @param tags Resource tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of ARM tracked top level resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateWithResponseAsync( - String resourceGroupName, String dataCollectionEndpointName, Map tags) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (dataCollectionEndpointName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter dataCollectionEndpointName is required and cannot be null.")); - } - final String apiVersion = "2021-04-01"; - final String accept = "application/json"; - ResourceForUpdate bodyInternal = null; - if (tags != null) { - bodyInternal = new ResourceForUpdate(); - bodyInternal.withTags(tags); - } - ResourceForUpdate body = bodyInternal; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - dataCollectionEndpointName, - apiVersion, - body, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates part of a data collection endpoint. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case insensitive. - * @param tags Resource tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of ARM tracked top level resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, String dataCollectionEndpointName, Map tags, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (dataCollectionEndpointName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter dataCollectionEndpointName is required and cannot be null.")); - } - final String apiVersion = "2021-04-01"; - final String accept = "application/json"; - ResourceForUpdate bodyInternal = null; - if (tags != null) { - bodyInternal = new ResourceForUpdate(); - bodyInternal.withTags(tags); - } - ResourceForUpdate body = bodyInternal; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - dataCollectionEndpointName, - apiVersion, - body, - accept, - context); - } - - /** - * Updates part of a data collection endpoint. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case insensitive. - * @param tags Resource tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of ARM tracked top level resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync( - String resourceGroupName, String dataCollectionEndpointName, Map tags) { - return updateWithResponseAsync(resourceGroupName, dataCollectionEndpointName, tags) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Updates part of a data collection endpoint. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of ARM tracked top level resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync( - String resourceGroupName, String dataCollectionEndpointName) { - final Map tags = null; - return updateWithResponseAsync(resourceGroupName, dataCollectionEndpointName, tags) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Updates part of a data collection endpoint. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of ARM tracked top level resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DataCollectionEndpointResourceInner update(String resourceGroupName, String dataCollectionEndpointName) { - final Map tags = null; - return updateAsync(resourceGroupName, dataCollectionEndpointName, tags).block(); - } - - /** - * Updates part of a data collection endpoint. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case insensitive. - * @param tags Resource tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of ARM tracked top level resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, String dataCollectionEndpointName, Map tags, Context context) { - return updateWithResponseAsync(resourceGroupName, dataCollectionEndpointName, tags, context).block(); - } - - /** - * Deletes a data collection endpoint. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String resourceGroupName, String dataCollectionEndpointName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (dataCollectionEndpointName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter dataCollectionEndpointName is required and cannot be null.")); - } - final String apiVersion = "2021-04-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - dataCollectionEndpointName, - apiVersion, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a data collection endpoint. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String dataCollectionEndpointName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (dataCollectionEndpointName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter dataCollectionEndpointName is required and cannot be null.")); - } - final String apiVersion = "2021-04-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - dataCollectionEndpointName, - apiVersion, - accept, - context); - } - - /** - * Deletes a data collection endpoint. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String dataCollectionEndpointName) { - return deleteWithResponseAsync(resourceGroupName, dataCollectionEndpointName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes a data collection endpoint. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String dataCollectionEndpointName) { - deleteAsync(resourceGroupName, dataCollectionEndpointName).block(); - } - - /** - * Deletes a data collection endpoint. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse( - String resourceGroupName, String dataCollectionEndpointName, Context context) { - return deleteWithResponseAsync(resourceGroupName, dataCollectionEndpointName, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a pageable list of resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync( - String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a pageable list of resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a pageable list of resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync( - String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a pageable list of resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/DataCollectionRuleAssociationsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/DataCollectionRuleAssociationsClientImpl.java deleted file mode 100644 index 6da439a95883..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/DataCollectionRuleAssociationsClientImpl.java +++ /dev/null @@ -1,1032 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.fluent.DataCollectionRuleAssociationsClient; -import com.azure.resourcemanager.monitor.fluent.models.DataCollectionRuleAssociationProxyOnlyResourceInner; -import com.azure.resourcemanager.monitor.models.DataCollectionRuleAssociationProxyOnlyResourceListResult; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in DataCollectionRuleAssociationsClient. */ -public final class DataCollectionRuleAssociationsClientImpl - implements InnerSupportsDelete, DataCollectionRuleAssociationsClient { - private final ClientLogger logger = new ClientLogger(DataCollectionRuleAssociationsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final DataCollectionRuleAssociationsService service; - - /** The service client containing this operation class. */ - private final MonitorClientImpl client; - - /** - * Initializes an instance of DataCollectionRuleAssociationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - DataCollectionRuleAssociationsClientImpl(MonitorClientImpl client) { - this.service = - RestProxy - .create( - DataCollectionRuleAssociationsService.class, - client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MonitorClientDataCollectionRuleAssociations to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MonitorClientDataCol") - private interface DataCollectionRuleAssociationsService { - @Headers({"Content-Type: application/json"}) - @Get("/{resourceUri}/providers/Microsoft.Insights/dataCollectionRuleAssociations") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResource( - @HostParam("$host") String endpoint, - @PathParam(value = "resourceUri", encoded = true) String resourceUri, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights" - + "/dataCollectionRules/{dataCollectionRuleName}/associations") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByRule( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("dataCollectionRuleName") String dataCollectionRuleName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/{resourceUri}/providers/Microsoft.Insights/dataCollectionRuleAssociations/{associationName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam(value = "resourceUri", encoded = true) String resourceUri, - @PathParam("associationName") String associationName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put("/{resourceUri}/providers/Microsoft.Insights/dataCollectionRuleAssociations/{associationName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> create( - @HostParam("$host") String endpoint, - @PathParam(value = "resourceUri", encoded = true) String resourceUri, - @PathParam("associationName") String associationName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") DataCollectionRuleAssociationProxyOnlyResourceInner body, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete("/{resourceUri}/providers/Microsoft.Insights/dataCollectionRuleAssociations/{associationName}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @PathParam(value = "resourceUri", encoded = true) String resourceUri, - @PathParam("associationName") String associationName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByRuleNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Lists associations for the specified resource. - * - * @param resourceUri The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a pageable list of resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceSinglePageAsync( - String resourceUri) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceUri == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); - } - final String apiVersion = "2021-04-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByResource(this.client.getEndpoint(), resourceUri, apiVersion, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists associations for the specified resource. - * - * @param resourceUri The identifier of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a pageable list of resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceSinglePageAsync( - String resourceUri, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceUri == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); - } - final String apiVersion = "2021-04-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResource(this.client.getEndpoint(), resourceUri, apiVersion, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists associations for the specified resource. - * - * @param resourceUri The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a pageable list of resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceAsync(String resourceUri) { - return new PagedFlux<>( - () -> listByResourceSinglePageAsync(resourceUri), nextLink -> listByResourceNextSinglePageAsync(nextLink)); - } - - /** - * Lists associations for the specified resource. - * - * @param resourceUri The identifier of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a pageable list of resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceAsync( - String resourceUri, Context context) { - return new PagedFlux<>( - () -> listByResourceSinglePageAsync(resourceUri, context), - nextLink -> listByResourceNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists associations for the specified resource. - * - * @param resourceUri The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a pageable list of resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResource(String resourceUri) { - return new PagedIterable<>(listByResourceAsync(resourceUri)); - } - - /** - * Lists associations for the specified resource. - * - * @param resourceUri The identifier of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a pageable list of resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResource( - String resourceUri, Context context) { - return new PagedIterable<>(listByResourceAsync(resourceUri, context)); - } - - /** - * Lists associations for the specified data collection rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a pageable list of resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByRuleSinglePageAsync( - String resourceGroupName, String dataCollectionRuleName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (dataCollectionRuleName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter dataCollectionRuleName is required and cannot be null.")); - } - final String apiVersion = "2021-04-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByRule( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - dataCollectionRuleName, - apiVersion, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists associations for the specified data collection rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a pageable list of resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByRuleSinglePageAsync( - String resourceGroupName, String dataCollectionRuleName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (dataCollectionRuleName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter dataCollectionRuleName is required and cannot be null.")); - } - final String apiVersion = "2021-04-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByRule( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - dataCollectionRuleName, - apiVersion, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists associations for the specified data collection rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a pageable list of resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByRuleAsync( - String resourceGroupName, String dataCollectionRuleName) { - return new PagedFlux<>( - () -> listByRuleSinglePageAsync(resourceGroupName, dataCollectionRuleName), - nextLink -> listByRuleNextSinglePageAsync(nextLink)); - } - - /** - * Lists associations for the specified data collection rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a pageable list of resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByRuleAsync( - String resourceGroupName, String dataCollectionRuleName, Context context) { - return new PagedFlux<>( - () -> listByRuleSinglePageAsync(resourceGroupName, dataCollectionRuleName, context), - nextLink -> listByRuleNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists associations for the specified data collection rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a pageable list of resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByRule( - String resourceGroupName, String dataCollectionRuleName) { - return new PagedIterable<>(listByRuleAsync(resourceGroupName, dataCollectionRuleName)); - } - - /** - * Lists associations for the specified data collection rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a pageable list of resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByRule( - String resourceGroupName, String dataCollectionRuleName, Context context) { - return new PagedIterable<>(listByRuleAsync(resourceGroupName, dataCollectionRuleName, context)); - } - - /** - * Returns the specified association. - * - * @param resourceUri The identifier of the resource. - * @param associationName The name of the association. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of generic ARM proxy resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String resourceUri, String associationName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceUri == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); - } - if (associationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter associationName is required and cannot be null.")); - } - final String apiVersion = "2021-04-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service.get(this.client.getEndpoint(), resourceUri, associationName, apiVersion, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns the specified association. - * - * @param resourceUri The identifier of the resource. - * @param associationName The name of the association. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of generic ARM proxy resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceUri, String associationName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceUri == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); - } - if (associationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter associationName is required and cannot be null.")); - } - final String apiVersion = "2021-04-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), resourceUri, associationName, apiVersion, accept, context); - } - - /** - * Returns the specified association. - * - * @param resourceUri The identifier of the resource. - * @param associationName The name of the association. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of generic ARM proxy resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync( - String resourceUri, String associationName) { - return getWithResponseAsync(resourceUri, associationName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Returns the specified association. - * - * @param resourceUri The identifier of the resource. - * @param associationName The name of the association. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of generic ARM proxy resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DataCollectionRuleAssociationProxyOnlyResourceInner get(String resourceUri, String associationName) { - return getAsync(resourceUri, associationName).block(); - } - - /** - * Returns the specified association. - * - * @param resourceUri The identifier of the resource. - * @param associationName The name of the association. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of generic ARM proxy resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceUri, String associationName, Context context) { - return getWithResponseAsync(resourceUri, associationName, context).block(); - } - - /** - * Creates or updates an association. - * - * @param resourceUri The identifier of the resource. - * @param associationName The name of the association. The name is case insensitive. - * @param body The payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of generic ARM proxy resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createWithResponseAsync( - String resourceUri, String associationName, DataCollectionRuleAssociationProxyOnlyResourceInner body) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceUri == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); - } - if (associationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter associationName is required and cannot be null.")); - } - if (body != null) { - body.validate(); - } - final String apiVersion = "2021-04-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .create( - this.client.getEndpoint(), resourceUri, associationName, apiVersion, body, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates an association. - * - * @param resourceUri The identifier of the resource. - * @param associationName The name of the association. The name is case insensitive. - * @param body The payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of generic ARM proxy resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync( - String resourceUri, - String associationName, - DataCollectionRuleAssociationProxyOnlyResourceInner body, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceUri == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); - } - if (associationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter associationName is required and cannot be null.")); - } - if (body != null) { - body.validate(); - } - final String apiVersion = "2021-04-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .create(this.client.getEndpoint(), resourceUri, associationName, apiVersion, body, accept, context); - } - - /** - * Creates or updates an association. - * - * @param resourceUri The identifier of the resource. - * @param associationName The name of the association. The name is case insensitive. - * @param body The payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of generic ARM proxy resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createAsync( - String resourceUri, String associationName, DataCollectionRuleAssociationProxyOnlyResourceInner body) { - return createWithResponseAsync(resourceUri, associationName, body) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates or updates an association. - * - * @param resourceUri The identifier of the resource. - * @param associationName The name of the association. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of generic ARM proxy resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createAsync( - String resourceUri, String associationName) { - final DataCollectionRuleAssociationProxyOnlyResourceInner body = null; - return createWithResponseAsync(resourceUri, associationName, body) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates or updates an association. - * - * @param resourceUri The identifier of the resource. - * @param associationName The name of the association. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of generic ARM proxy resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DataCollectionRuleAssociationProxyOnlyResourceInner create(String resourceUri, String associationName) { - final DataCollectionRuleAssociationProxyOnlyResourceInner body = null; - return createAsync(resourceUri, associationName, body).block(); - } - - /** - * Creates or updates an association. - * - * @param resourceUri The identifier of the resource. - * @param associationName The name of the association. The name is case insensitive. - * @param body The payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of generic ARM proxy resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse( - String resourceUri, - String associationName, - DataCollectionRuleAssociationProxyOnlyResourceInner body, - Context context) { - return createWithResponseAsync(resourceUri, associationName, body, context).block(); - } - - /** - * Deletes an association. - * - * @param resourceUri The identifier of the resource. - * @param associationName The name of the association. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String resourceUri, String associationName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceUri == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); - } - if (associationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter associationName is required and cannot be null.")); - } - final String apiVersion = "2021-04-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete(this.client.getEndpoint(), resourceUri, associationName, apiVersion, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes an association. - * - * @param resourceUri The identifier of the resource. - * @param associationName The name of the association. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceUri, String associationName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceUri == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); - } - if (associationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter associationName is required and cannot be null.")); - } - final String apiVersion = "2021-04-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), resourceUri, associationName, apiVersion, accept, context); - } - - /** - * Deletes an association. - * - * @param resourceUri The identifier of the resource. - * @param associationName The name of the association. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceUri, String associationName) { - return deleteWithResponseAsync(resourceUri, associationName).flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes an association. - * - * @param resourceUri The identifier of the resource. - * @param associationName The name of the association. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceUri, String associationName) { - deleteAsync(resourceUri, associationName).block(); - } - - /** - * Deletes an association. - * - * @param resourceUri The identifier of the resource. - * @param associationName The name of the association. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceUri, String associationName, Context context) { - return deleteWithResponseAsync(resourceUri, associationName, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a pageable list of resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceNextSinglePageAsync( - String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByResourceNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a pageable list of resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a pageable list of resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByRuleNextSinglePageAsync( - String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByRuleNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a pageable list of resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByRuleNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByRuleNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/DataCollectionRulesClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/DataCollectionRulesClientImpl.java deleted file mode 100644 index 4f889e7ad803..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/DataCollectionRulesClientImpl.java +++ /dev/null @@ -1,1330 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.fluent.DataCollectionRulesClient; -import com.azure.resourcemanager.monitor.fluent.models.DataCollectionRuleResourceInner; -import com.azure.resourcemanager.monitor.models.DataCollectionRuleResourceListResult; -import com.azure.resourcemanager.monitor.models.ResourceForUpdate; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.util.Map; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in DataCollectionRulesClient. */ -public final class DataCollectionRulesClientImpl - implements InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete, - DataCollectionRulesClient { - private final ClientLogger logger = new ClientLogger(DataCollectionRulesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final DataCollectionRulesService service; - - /** The service client containing this operation class. */ - private final MonitorClientImpl client; - - /** - * Initializes an instance of DataCollectionRulesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - DataCollectionRulesClientImpl(MonitorClientImpl client) { - this.service = - RestProxy.create(DataCollectionRulesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MonitorClientDataCollectionRules to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MonitorClientDataCol") - private interface DataCollectionRulesService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights" - + "/dataCollectionRules") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Insights/dataCollectionRules") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights" - + "/dataCollectionRules/{dataCollectionRuleName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("dataCollectionRuleName") String dataCollectionRuleName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights" - + "/dataCollectionRules/{dataCollectionRuleName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> create( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("dataCollectionRuleName") String dataCollectionRuleName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") DataCollectionRuleResourceInner body, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights" - + "/dataCollectionRules/{dataCollectionRuleName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("dataCollectionRuleName") String dataCollectionRuleName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ResourceForUpdate body, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights" - + "/dataCollectionRules/{dataCollectionRuleName}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("dataCollectionRuleName") String dataCollectionRuleName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Lists all data collection rules in the specified resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a pageable list of resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String apiVersion = "2021-04-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - apiVersion, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all data collection rules in the specified resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a pageable list of resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String apiVersion = "2021-04-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - apiVersion, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists all data collection rules in the specified resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a pageable list of resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * Lists all data collection rules in the specified resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a pageable list of resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync( - String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all data collection rules in the specified resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a pageable list of resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * Lists all data collection rules in the specified resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a pageable list of resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup( - String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * Lists all data collection rules in the specified subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a pageable list of resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2021-04-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all data collection rules in the specified subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a pageable list of resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2021-04-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists all data collection rules in the specified subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a pageable list of resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>( - () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); - } - - /** - * Lists all data collection rules in the specified subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a pageable list of resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all data collection rules in the specified subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a pageable list of resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Lists all data collection rules in the specified subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a pageable list of resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Returns the specified data collection rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of ARM tracked top level resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String dataCollectionRuleName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (dataCollectionRuleName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter dataCollectionRuleName is required and cannot be null.")); - } - final String apiVersion = "2021-04-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - dataCollectionRuleName, - apiVersion, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns the specified data collection rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of ARM tracked top level resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String dataCollectionRuleName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (dataCollectionRuleName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter dataCollectionRuleName is required and cannot be null.")); - } - final String apiVersion = "2021-04-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - dataCollectionRuleName, - apiVersion, - accept, - context); - } - - /** - * Returns the specified data collection rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of ARM tracked top level resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync( - String resourceGroupName, String dataCollectionRuleName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, dataCollectionRuleName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Returns the specified data collection rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of ARM tracked top level resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DataCollectionRuleResourceInner getByResourceGroup(String resourceGroupName, String dataCollectionRuleName) { - return getByResourceGroupAsync(resourceGroupName, dataCollectionRuleName).block(); - } - - /** - * Returns the specified data collection rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of ARM tracked top level resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String dataCollectionRuleName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, dataCollectionRuleName, context).block(); - } - - /** - * Creates or updates a data collection rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. - * @param body The payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of ARM tracked top level resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createWithResponseAsync( - String resourceGroupName, String dataCollectionRuleName, DataCollectionRuleResourceInner body) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (dataCollectionRuleName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter dataCollectionRuleName is required and cannot be null.")); - } - if (body != null) { - body.validate(); - } - final String apiVersion = "2021-04-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .create( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - dataCollectionRuleName, - apiVersion, - body, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a data collection rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. - * @param body The payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of ARM tracked top level resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync( - String resourceGroupName, - String dataCollectionRuleName, - DataCollectionRuleResourceInner body, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (dataCollectionRuleName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter dataCollectionRuleName is required and cannot be null.")); - } - if (body != null) { - body.validate(); - } - final String apiVersion = "2021-04-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .create( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - dataCollectionRuleName, - apiVersion, - body, - accept, - context); - } - - /** - * Creates or updates a data collection rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. - * @param body The payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of ARM tracked top level resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createAsync( - String resourceGroupName, String dataCollectionRuleName, DataCollectionRuleResourceInner body) { - return createWithResponseAsync(resourceGroupName, dataCollectionRuleName, body) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates or updates a data collection rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of ARM tracked top level resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createAsync(String resourceGroupName, String dataCollectionRuleName) { - final DataCollectionRuleResourceInner body = null; - return createWithResponseAsync(resourceGroupName, dataCollectionRuleName, body) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates or updates a data collection rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of ARM tracked top level resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DataCollectionRuleResourceInner create(String resourceGroupName, String dataCollectionRuleName) { - final DataCollectionRuleResourceInner body = null; - return createAsync(resourceGroupName, dataCollectionRuleName, body).block(); - } - - /** - * Creates or updates a data collection rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. - * @param body The payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of ARM tracked top level resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse( - String resourceGroupName, - String dataCollectionRuleName, - DataCollectionRuleResourceInner body, - Context context) { - return createWithResponseAsync(resourceGroupName, dataCollectionRuleName, body, context).block(); - } - - /** - * Updates part of a data collection rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. - * @param tags Resource tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of ARM tracked top level resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateWithResponseAsync( - String resourceGroupName, String dataCollectionRuleName, Map tags) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (dataCollectionRuleName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter dataCollectionRuleName is required and cannot be null.")); - } - final String apiVersion = "2021-04-01"; - final String accept = "application/json"; - ResourceForUpdate bodyInternal = null; - if (tags != null) { - bodyInternal = new ResourceForUpdate(); - bodyInternal.withTags(tags); - } - ResourceForUpdate body = bodyInternal; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - dataCollectionRuleName, - apiVersion, - body, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates part of a data collection rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. - * @param tags Resource tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of ARM tracked top level resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, String dataCollectionRuleName, Map tags, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (dataCollectionRuleName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter dataCollectionRuleName is required and cannot be null.")); - } - final String apiVersion = "2021-04-01"; - final String accept = "application/json"; - ResourceForUpdate bodyInternal = null; - if (tags != null) { - bodyInternal = new ResourceForUpdate(); - bodyInternal.withTags(tags); - } - ResourceForUpdate body = bodyInternal; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - dataCollectionRuleName, - apiVersion, - body, - accept, - context); - } - - /** - * Updates part of a data collection rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. - * @param tags Resource tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of ARM tracked top level resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync( - String resourceGroupName, String dataCollectionRuleName, Map tags) { - return updateWithResponseAsync(resourceGroupName, dataCollectionRuleName, tags) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Updates part of a data collection rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of ARM tracked top level resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync(String resourceGroupName, String dataCollectionRuleName) { - final Map tags = null; - return updateWithResponseAsync(resourceGroupName, dataCollectionRuleName, tags) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Updates part of a data collection rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of ARM tracked top level resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DataCollectionRuleResourceInner update(String resourceGroupName, String dataCollectionRuleName) { - final Map tags = null; - return updateAsync(resourceGroupName, dataCollectionRuleName, tags).block(); - } - - /** - * Updates part of a data collection rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. - * @param tags Resource tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return definition of ARM tracked top level resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, String dataCollectionRuleName, Map tags, Context context) { - return updateWithResponseAsync(resourceGroupName, dataCollectionRuleName, tags, context).block(); - } - - /** - * Deletes a data collection rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String resourceGroupName, String dataCollectionRuleName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (dataCollectionRuleName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter dataCollectionRuleName is required and cannot be null.")); - } - final String apiVersion = "2021-04-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - dataCollectionRuleName, - apiVersion, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a data collection rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String dataCollectionRuleName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (dataCollectionRuleName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter dataCollectionRuleName is required and cannot be null.")); - } - final String apiVersion = "2021-04-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - dataCollectionRuleName, - apiVersion, - accept, - context); - } - - /** - * Deletes a data collection rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String dataCollectionRuleName) { - return deleteWithResponseAsync(resourceGroupName, dataCollectionRuleName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes a data collection rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String dataCollectionRuleName) { - deleteAsync(resourceGroupName, dataCollectionRuleName).block(); - } - - /** - * Deletes a data collection rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String dataCollectionRuleName, Context context) { - return deleteWithResponseAsync(resourceGroupName, dataCollectionRuleName, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a pageable list of resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync( - String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a pageable list of resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a pageable list of resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync( - String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a pageable list of resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/DiagnosticSettingImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/DiagnosticSettingImpl.java deleted file mode 100644 index c5c434975458..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/DiagnosticSettingImpl.java +++ /dev/null @@ -1,267 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.monitor.implementation; - -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.MonitorManager; -import com.azure.resourcemanager.monitor.models.CategoryType; -import com.azure.resourcemanager.monitor.models.DiagnosticSetting; -import com.azure.resourcemanager.monitor.models.DiagnosticSettingsCategory; -import com.azure.resourcemanager.monitor.models.LogSettings; -import com.azure.resourcemanager.monitor.models.MetricSettings; -import com.azure.resourcemanager.monitor.models.RetentionPolicy; -import com.azure.resourcemanager.monitor.fluent.models.DiagnosticSettingsResourceInner; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.CreatableUpdatableImpl; -import java.time.Duration; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.TreeMap; -import reactor.core.publisher.Mono; - -/** The Azure metric definition entries are of type DiagnosticSetting. */ -class DiagnosticSettingImpl - extends CreatableUpdatableImpl - implements DiagnosticSetting, DiagnosticSetting.Definition, DiagnosticSetting.Update { - - private final ClientLogger logger = new ClientLogger(getClass()); - - public static final String DIAGNOSTIC_SETTINGS_URI = "/providers/microsoft.insights/diagnosticSettings/"; - - private String resourceId; - private TreeMap metricSet; - private TreeMap logSet; - private final MonitorManager myManager; - - DiagnosticSettingImpl( - String name, DiagnosticSettingsResourceInner innerModel, final MonitorManager monitorManager) { - super(name, innerModel); - this.myManager = monitorManager; - initializeSets(); - } - - @Override - public DiagnosticSettingImpl withResource(String resourceId) { - this.resourceId = resourceId; - return this; - } - - @Override - public DiagnosticSettingImpl withStorageAccount(String storageAccountId) { - this.innerModel().withStorageAccountId(storageAccountId); - return this; - } - - @Override - public DiagnosticSettingImpl withLogAnalytics(String workspaceId) { - this.innerModel().withWorkspaceId(workspaceId); - return this; - } - - @Override - public DiagnosticSettingImpl withoutLogAnalytics() { - this.innerModel().withWorkspaceId(null); - return this; - } - - @Override - public DiagnosticSettingImpl withoutStorageAccount() { - this.innerModel().withStorageAccountId(null); - return this; - } - - @Override - public DiagnosticSettingImpl withEventHub(String eventHubAuthorizationRuleId) { - this.innerModel().withEventHubAuthorizationRuleId(eventHubAuthorizationRuleId); - return this; - } - - @Override - public DiagnosticSettingImpl withEventHub(String eventHubAuthorizationRuleId, String eventHubName) { - this.withEventHub(eventHubAuthorizationRuleId); - this.innerModel().withEventHubName(eventHubName); - return this; - } - - @Override - public DiagnosticSettingImpl withoutEventHub() { - this.innerModel().withEventHubAuthorizationRuleId(null); - this.innerModel().withEventHubName(null); - return this; - } - - @Override - public DiagnosticSettingImpl withMetric(String category, Duration timeGrain, int retentionDays) { - MetricSettings nm = new MetricSettings(); - nm.withCategory(category); - nm.withEnabled(true); - nm.withRetentionPolicy(new RetentionPolicy()); - nm.retentionPolicy().withDays(retentionDays); - if (retentionDays > 0) { - nm.retentionPolicy().withEnabled(true); - } - nm.withTimeGrain(timeGrain); - this.metricSet.put(category, nm); - return this; - } - - @Override - public DiagnosticSettingImpl withLog(String category, int retentionDays) { - LogSettings nl = new LogSettings(); - nl.withCategory(category); - nl.withEnabled(true); - nl.withRetentionPolicy(new RetentionPolicy()); - nl.retentionPolicy().withDays(retentionDays); - if (retentionDays > 0) { - nl.retentionPolicy().withEnabled(true); - } - this.logSet.put(category, nl); - return this; - } - - @Override - public DiagnosticSettingImpl withLogsAndMetrics( - List categories, Duration timeGrain, int retentionDays) { - for (DiagnosticSettingsCategory dsc : categories) { - if (dsc.type() == CategoryType.METRICS) { - this.withMetric(dsc.name(), timeGrain, retentionDays); - } else if (dsc.type() == CategoryType.LOGS) { - this.withLog(dsc.name(), retentionDays); - } else { - throw logger.logExceptionAsError( - new UnsupportedOperationException(dsc.type().toString() + " is unsupported.")); - } - } - return this; - } - - @Override - public DiagnosticSettingImpl withoutMetric(String category) { - this.metricSet.remove(category); - return this; - } - - @Override - public DiagnosticSettingImpl withoutLog(String category) { - this.logSet.remove(category); - return this; - } - - @Override - public DiagnosticSettingImpl withoutLogs() { - this.logSet.clear(); - return this; - } - - @Override - public DiagnosticSettingImpl withoutMetrics() { - this.metricSet.clear(); - return this; - } - - @Override - public String id() { - return this.innerModel().id(); - } - - @Override - public String resourceId() { - return this.resourceId; - } - - @Override - public String storageAccountId() { - return this.innerModel().storageAccountId(); - } - - @Override - public String eventHubAuthorizationRuleId() { - return this.innerModel().eventHubAuthorizationRuleId(); - } - - @Override - public String eventHubName() { - return this.innerModel().eventHubName(); - } - - @Override - public List metrics() { - if (this.innerModel().metrics() == null) { - return null; - } - return Collections.unmodifiableList(this.innerModel().metrics()); - } - - @Override - public List logs() { - if (this.innerModel().logs() == null) { - return null; - } - return Collections.unmodifiableList(this.innerModel().logs()); - } - - @Override - public String workspaceId() { - return this.innerModel().workspaceId(); - } - - @Override - public MonitorManager manager() { - return this.myManager; - } - - @Override - public boolean isInCreateMode() { - return this.innerModel().id() == null; - } - - @Override - public Mono createResourceAsync() { - this.innerModel().withLogs(new ArrayList<>(logSet.values())); - this.innerModel().withMetrics(new ArrayList<>(metricSet.values())); - return this - .manager() - .serviceClient() - .getDiagnosticSettings() - .createOrUpdateAsync(this.resourceId, this.name(), this.innerModel()) - .map(innerToFluentMap(this)); - } - - @Override - protected Mono getInnerAsync() { - return this.manager().serviceClient().getDiagnosticSettings().getAsync(this.resourceId, this.name()); - } - - @Override - public void setInner(DiagnosticSettingsResourceInner inner) { - super.setInner(inner); - initializeSets(); - this.metricSet.clear(); - this.logSet.clear(); - if (!isInCreateMode()) { - this.resourceId = - inner - .id() - .substring( - 0, - this.innerModel().id().length() - - (DiagnosticSettingImpl.DIAGNOSTIC_SETTINGS_URI + this.innerModel().name()).length()); - for (MetricSettings ms : this.innerModel().metrics()) { - this.metricSet.put(ms.category(), ms); - } - for (LogSettings ls : this.innerModel().logs()) { - this.logSet.put(ls.category(), ls); - } - } - } - - private void initializeSets() { - if (this.metricSet == null) { - this.metricSet = new TreeMap<>(); - } - if (this.logSet == null) { - this.logSet = new TreeMap<>(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/DiagnosticSettingsCategoriesClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/DiagnosticSettingsCategoriesClientImpl.java deleted file mode 100644 index 34afeaba8b3e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/DiagnosticSettingsCategoriesClientImpl.java +++ /dev/null @@ -1,310 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.fluent.DiagnosticSettingsCategoriesClient; -import com.azure.resourcemanager.monitor.fluent.models.DiagnosticSettingsCategoryResourceCollectionInner; -import com.azure.resourcemanager.monitor.fluent.models.DiagnosticSettingsCategoryResourceInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in DiagnosticSettingsCategoriesClient. */ -public final class DiagnosticSettingsCategoriesClientImpl implements DiagnosticSettingsCategoriesClient { - private final ClientLogger logger = new ClientLogger(DiagnosticSettingsCategoriesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final DiagnosticSettingsCategoriesService service; - - /** The service client containing this operation class. */ - private final MonitorClientImpl client; - - /** - * Initializes an instance of DiagnosticSettingsCategoriesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - DiagnosticSettingsCategoriesClientImpl(MonitorClientImpl client) { - this.service = - RestProxy - .create( - DiagnosticSettingsCategoriesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MonitorClientDiagnosticSettingsCategories to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MonitorClientDiagnos") - private interface DiagnosticSettingsCategoriesService { - @Headers({"Content-Type: application/json"}) - @Get("/{resourceUri}/providers/Microsoft.Insights/diagnosticSettingsCategories/{name}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam(value = "resourceUri", encoded = true) String resourceUri, - @QueryParam("api-version") String apiVersion, - @PathParam("name") String name, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/{resourceUri}/providers/Microsoft.Insights/diagnosticSettingsCategories") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam(value = "resourceUri", encoded = true) String resourceUri, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets the diagnostic settings category for the specified resource. - * - * @param resourceUri The identifier of the resource. - * @param name The name of the diagnostic setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the diagnostic settings category for the specified resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String resourceUri, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceUri == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String apiVersion = "2017-05-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.get(this.client.getEndpoint(), resourceUri, apiVersion, name, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the diagnostic settings category for the specified resource. - * - * @param resourceUri The identifier of the resource. - * @param name The name of the diagnostic setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the diagnostic settings category for the specified resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceUri, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceUri == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String apiVersion = "2017-05-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), resourceUri, apiVersion, name, accept, context); - } - - /** - * Gets the diagnostic settings category for the specified resource. - * - * @param resourceUri The identifier of the resource. - * @param name The name of the diagnostic setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the diagnostic settings category for the specified resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync(String resourceUri, String name) { - return getWithResponseAsync(resourceUri, name) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the diagnostic settings category for the specified resource. - * - * @param resourceUri The identifier of the resource. - * @param name The name of the diagnostic setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the diagnostic settings category for the specified resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DiagnosticSettingsCategoryResourceInner get(String resourceUri, String name) { - return getAsync(resourceUri, name).block(); - } - - /** - * Gets the diagnostic settings category for the specified resource. - * - * @param resourceUri The identifier of the resource. - * @param name The name of the diagnostic setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the diagnostic settings category for the specified resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceUri, String name, Context context) { - return getWithResponseAsync(resourceUri, name, context).block(); - } - - /** - * Lists the diagnostic settings categories for the specified resource. - * - * @param resourceUri The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of diagnostic setting category resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listWithResponseAsync(String resourceUri) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceUri == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); - } - final String apiVersion = "2017-05-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), resourceUri, apiVersion, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists the diagnostic settings categories for the specified resource. - * - * @param resourceUri The identifier of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of diagnostic setting category resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync( - String resourceUri, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceUri == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); - } - final String apiVersion = "2017-05-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), resourceUri, apiVersion, accept, context); - } - - /** - * Lists the diagnostic settings categories for the specified resource. - * - * @param resourceUri The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of diagnostic setting category resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listAsync(String resourceUri) { - return listWithResponseAsync(resourceUri) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Lists the diagnostic settings categories for the specified resource. - * - * @param resourceUri The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of diagnostic setting category resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DiagnosticSettingsCategoryResourceCollectionInner list(String resourceUri) { - return listAsync(resourceUri).block(); - } - - /** - * Lists the diagnostic settings categories for the specified resource. - * - * @param resourceUri The identifier of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of diagnostic setting category resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse( - String resourceUri, Context context) { - return listWithResponseAsync(resourceUri, context).block(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/DiagnosticSettingsCategoryImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/DiagnosticSettingsCategoryImpl.java deleted file mode 100644 index d93e6c900fc1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/DiagnosticSettingsCategoryImpl.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.monitor.implementation; - -import com.azure.resourcemanager.monitor.models.CategoryType; -import com.azure.resourcemanager.monitor.models.DiagnosticSettingsCategory; -import com.azure.resourcemanager.monitor.fluent.models.DiagnosticSettingsCategoryResourceInner; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.WrapperImpl; - -/** The Azure {@link DiagnosticSettingsCategory} wrapper class implementation. */ -class DiagnosticSettingsCategoryImpl extends WrapperImpl - implements DiagnosticSettingsCategory { - - DiagnosticSettingsCategoryImpl(DiagnosticSettingsCategoryResourceInner innerObject) { - super(innerObject); - } - - @Override - public String name() { - return this.innerModel().name(); - } - - @Override - public CategoryType type() { - return this.innerModel().categoryType(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/DiagnosticSettingsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/DiagnosticSettingsClientImpl.java deleted file mode 100644 index 922615411f4f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/DiagnosticSettingsClientImpl.java +++ /dev/null @@ -1,583 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.fluent.DiagnosticSettingsClient; -import com.azure.resourcemanager.monitor.fluent.models.DiagnosticSettingsResourceCollectionInner; -import com.azure.resourcemanager.monitor.fluent.models.DiagnosticSettingsResourceInner; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in DiagnosticSettingsClient. */ -public final class DiagnosticSettingsClientImpl implements InnerSupportsDelete, DiagnosticSettingsClient { - private final ClientLogger logger = new ClientLogger(DiagnosticSettingsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final DiagnosticSettingsService service; - - /** The service client containing this operation class. */ - private final MonitorClientImpl client; - - /** - * Initializes an instance of DiagnosticSettingsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - DiagnosticSettingsClientImpl(MonitorClientImpl client) { - this.service = - RestProxy.create(DiagnosticSettingsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MonitorClientDiagnosticSettings to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MonitorClientDiagnos") - private interface DiagnosticSettingsService { - @Headers({"Content-Type: application/json"}) - @Get("/{resourceUri}/providers/Microsoft.Insights/diagnosticSettings/{name}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam(value = "resourceUri", encoded = true) String resourceUri, - @QueryParam("api-version") String apiVersion, - @PathParam("name") String name, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put("/{resourceUri}/providers/Microsoft.Insights/diagnosticSettings/{name}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam(value = "resourceUri", encoded = true) String resourceUri, - @QueryParam("api-version") String apiVersion, - @PathParam("name") String name, - @BodyParam("application/json") DiagnosticSettingsResourceInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete("/{resourceUri}/providers/Microsoft.Insights/diagnosticSettings/{name}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @PathParam(value = "resourceUri", encoded = true) String resourceUri, - @QueryParam("api-version") String apiVersion, - @PathParam("name") String name, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/{resourceUri}/providers/Microsoft.Insights/diagnosticSettings") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam(value = "resourceUri", encoded = true) String resourceUri, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets the active diagnostic settings for the specified resource. - * - * @param resourceUri The identifier of the resource. - * @param name The name of the diagnostic setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the active diagnostic settings for the specified resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync(String resourceUri, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceUri == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String apiVersion = "2017-05-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.get(this.client.getEndpoint(), resourceUri, apiVersion, name, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the active diagnostic settings for the specified resource. - * - * @param resourceUri The identifier of the resource. - * @param name The name of the diagnostic setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the active diagnostic settings for the specified resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceUri, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceUri == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String apiVersion = "2017-05-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), resourceUri, apiVersion, name, accept, context); - } - - /** - * Gets the active diagnostic settings for the specified resource. - * - * @param resourceUri The identifier of the resource. - * @param name The name of the diagnostic setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the active diagnostic settings for the specified resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync(String resourceUri, String name) { - return getWithResponseAsync(resourceUri, name) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the active diagnostic settings for the specified resource. - * - * @param resourceUri The identifier of the resource. - * @param name The name of the diagnostic setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the active diagnostic settings for the specified resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DiagnosticSettingsResourceInner get(String resourceUri, String name) { - return getAsync(resourceUri, name).block(); - } - - /** - * Gets the active diagnostic settings for the specified resource. - * - * @param resourceUri The identifier of the resource. - * @param name The name of the diagnostic setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the active diagnostic settings for the specified resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceUri, String name, Context context) { - return getWithResponseAsync(resourceUri, name, context).block(); - } - - /** - * Creates or updates diagnostic settings for the specified resource. - * - * @param resourceUri The identifier of the resource. - * @param name The name of the diagnostic setting. - * @param parameters Parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the diagnostic setting resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponseAsync( - String resourceUri, String name, DiagnosticSettingsResourceInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceUri == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2017-05-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), resourceUri, apiVersion, name, parameters, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates diagnostic settings for the specified resource. - * - * @param resourceUri The identifier of the resource. - * @param name The name of the diagnostic setting. - * @param parameters Parameters supplied to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the diagnostic setting resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceUri, String name, DiagnosticSettingsResourceInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceUri == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2017-05-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate(this.client.getEndpoint(), resourceUri, apiVersion, name, parameters, accept, context); - } - - /** - * Creates or updates diagnostic settings for the specified resource. - * - * @param resourceUri The identifier of the resource. - * @param name The name of the diagnostic setting. - * @param parameters Parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the diagnostic setting resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceUri, String name, DiagnosticSettingsResourceInner parameters) { - return createOrUpdateWithResponseAsync(resourceUri, name, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates or updates diagnostic settings for the specified resource. - * - * @param resourceUri The identifier of the resource. - * @param name The name of the diagnostic setting. - * @param parameters Parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the diagnostic setting resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DiagnosticSettingsResourceInner createOrUpdate( - String resourceUri, String name, DiagnosticSettingsResourceInner parameters) { - return createOrUpdateAsync(resourceUri, name, parameters).block(); - } - - /** - * Creates or updates diagnostic settings for the specified resource. - * - * @param resourceUri The identifier of the resource. - * @param name The name of the diagnostic setting. - * @param parameters Parameters supplied to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the diagnostic setting resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceUri, String name, DiagnosticSettingsResourceInner parameters, Context context) { - return createOrUpdateWithResponseAsync(resourceUri, name, parameters, context).block(); - } - - /** - * Deletes existing diagnostic settings for the specified resource. - * - * @param resourceUri The identifier of the resource. - * @param name The name of the diagnostic setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String resourceUri, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceUri == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String apiVersion = "2017-05-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.delete(this.client.getEndpoint(), resourceUri, apiVersion, name, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes existing diagnostic settings for the specified resource. - * - * @param resourceUri The identifier of the resource. - * @param name The name of the diagnostic setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceUri, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceUri == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String apiVersion = "2017-05-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), resourceUri, apiVersion, name, accept, context); - } - - /** - * Deletes existing diagnostic settings for the specified resource. - * - * @param resourceUri The identifier of the resource. - * @param name The name of the diagnostic setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceUri, String name) { - return deleteWithResponseAsync(resourceUri, name).flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes existing diagnostic settings for the specified resource. - * - * @param resourceUri The identifier of the resource. - * @param name The name of the diagnostic setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceUri, String name) { - deleteAsync(resourceUri, name).block(); - } - - /** - * Deletes existing diagnostic settings for the specified resource. - * - * @param resourceUri The identifier of the resource. - * @param name The name of the diagnostic setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceUri, String name, Context context) { - return deleteWithResponseAsync(resourceUri, name, context).block(); - } - - /** - * Gets the active diagnostic settings list for the specified resource. - * - * @param resourceUri The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the active diagnostic settings list for the specified resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listWithResponseAsync(String resourceUri) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceUri == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); - } - final String apiVersion = "2017-05-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), resourceUri, apiVersion, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the active diagnostic settings list for the specified resource. - * - * @param resourceUri The identifier of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the active diagnostic settings list for the specified resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync( - String resourceUri, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceUri == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); - } - final String apiVersion = "2017-05-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), resourceUri, apiVersion, accept, context); - } - - /** - * Gets the active diagnostic settings list for the specified resource. - * - * @param resourceUri The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the active diagnostic settings list for the specified resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listAsync(String resourceUri) { - return listWithResponseAsync(resourceUri) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the active diagnostic settings list for the specified resource. - * - * @param resourceUri The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the active diagnostic settings list for the specified resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DiagnosticSettingsResourceCollectionInner list(String resourceUri) { - return listAsync(resourceUri).block(); - } - - /** - * Gets the active diagnostic settings list for the specified resource. - * - * @param resourceUri The identifier of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the active diagnostic settings list for the specified resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse(String resourceUri, Context context) { - return listWithResponseAsync(resourceUri, context).block(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/DiagnosticSettingsImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/DiagnosticSettingsImpl.java deleted file mode 100644 index d3cb6cd1ee2c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/DiagnosticSettingsImpl.java +++ /dev/null @@ -1,216 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.monitor.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.MonitorManager; -import com.azure.resourcemanager.monitor.models.DiagnosticSetting; -import com.azure.resourcemanager.monitor.models.DiagnosticSettings; -import com.azure.resourcemanager.monitor.models.DiagnosticSettingsCategory; -import com.azure.resourcemanager.monitor.fluent.models.DiagnosticSettingsCategoryResourceCollectionInner; -import com.azure.resourcemanager.monitor.fluent.models.DiagnosticSettingsCategoryResourceInner; -import com.azure.resourcemanager.monitor.fluent.DiagnosticSettingsClient; -import com.azure.resourcemanager.monitor.fluent.models.DiagnosticSettingsResourceInner; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.BatchDeletionImpl; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.CreatableResourcesImpl; -import com.azure.resourcemanager.resources.fluentcore.utils.PagedConverter; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.List; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** Implementation for DiagnosticSettings. */ -public class DiagnosticSettingsImpl - extends CreatableResourcesImpl - implements DiagnosticSettings { - - private final ClientLogger logger = new ClientLogger(getClass()); - - private final MonitorManager manager; - - public DiagnosticSettingsImpl(final MonitorManager manager) { - this.manager = manager; - } - - @Override - public DiagnosticSettingImpl define(String name) { - return wrapModel(name); - } - - // Fluent model create helpers - - @Override - protected DiagnosticSettingImpl wrapModel(String name) { - DiagnosticSettingsResourceInner inner = new DiagnosticSettingsResourceInner(); - - return new DiagnosticSettingImpl(name, inner, this.manager()); - } - - @Override - protected DiagnosticSettingImpl wrapModel(DiagnosticSettingsResourceInner inner) { - if (inner == null) { - return null; - } - return new DiagnosticSettingImpl(inner.name(), inner, this.manager()); - } - - @Override - public MonitorManager manager() { - return this.manager; - } - - public DiagnosticSettingsClient inner() { - return this.manager().serviceClient().getDiagnosticSettings(); - } - - @Override - public List listCategoriesByResource(String resourceId) { - List categories = new ArrayList<>(); - DiagnosticSettingsCategoryResourceCollectionInner collection = - this.manager().serviceClient().getDiagnosticSettingsCategories().list(resourceId); - if (collection != null) { - for (DiagnosticSettingsCategoryResourceInner category : collection.value()) { - categories.add(new DiagnosticSettingsCategoryImpl(category)); - } - } - return categories; - } - - @Override - public PagedFlux listCategoriesByResourceAsync(String resourceId) { - return PagedConverter.mapPage(PagedConverter - .convertListToPagedFlux( - this - .manager - .serviceClient() - .getDiagnosticSettingsCategories() - .listWithResponseAsync(resourceId) - .map(r -> new SimpleResponse<>(r.getRequest(), r.getStatusCode(), r.getHeaders(), - r.getValue().value() == null ? Collections.emptyList() : r.getValue().value()))), - DiagnosticSettingsCategoryImpl::new); - } - - @Override - public DiagnosticSettingsCategory getCategory(String resourceId, String name) { - return new DiagnosticSettingsCategoryImpl( - this.manager().serviceClient().getDiagnosticSettingsCategories().get(resourceId, name)); - } - - @Override - public Mono getCategoryAsync(String resourceId, String name) { - return this - .manager() - .serviceClient() - .getDiagnosticSettingsCategories() - .getAsync(resourceId, name) - .map(DiagnosticSettingsCategoryImpl::new); - } - - @Override - public PagedIterable listByResource(String resourceId) { - return new PagedIterable<>(this.listByResourceAsync(resourceId)); - } - - @Override - public PagedFlux listByResourceAsync(String resourceId) { - return PagedConverter.mapPage(PagedConverter - .convertListToPagedFlux( - this - .manager() - .serviceClient() - .getDiagnosticSettings() - .listWithResponseAsync(resourceId) - .map(r -> new SimpleResponse<>(r.getRequest(), r.getStatusCode(), r.getHeaders(), - r.getValue().value() == null ? Collections.emptyList() : r.getValue().value()))), - inner -> new DiagnosticSettingImpl(inner.name(), inner, this.manager())); - } - - @Override - public void delete(String resourceId, String name) { - this.manager().serviceClient().getDiagnosticSettings().delete(resourceId, name); - } - - @Override - public Mono deleteAsync(String resourceId, String name) { - return this.manager().serviceClient().getDiagnosticSettings().deleteAsync(resourceId, name); - } - - @Override - public DiagnosticSetting get(String resourceId, String name) { - return wrapModel(this.manager().serviceClient().getDiagnosticSettings().get(resourceId, name)); - } - - @Override - public Mono getAsync(String resourceId, String name) { - return this.manager().serviceClient().getDiagnosticSettings().getAsync(resourceId, name).map(this::wrapModel); - } - - @Override - public Mono deleteByIdAsync(String id) { - return this - .manager() - .serviceClient() - .getDiagnosticSettings() - .deleteAsync(getResourceIdFromSettingsId(id), getNameFromSettingsId(id)); - } - - @Override - public Flux deleteByIdsAsync(Collection ids) { - return BatchDeletionImpl.deleteByIdsAsync(ids, (rgName, name) -> this.inner().deleteAsync(rgName, name)); - } - - @Override - public Flux deleteByIdsAsync(String... ids) { - return this.deleteByIdsAsync(new ArrayList<>(Arrays.asList(ids))); - } - - @Override - public void deleteByIds(Collection ids) { - if (ids != null && !ids.isEmpty()) { - this.deleteByIdsAsync(ids).blockLast(); - } - } - - @Override - public void deleteByIds(String... ids) { - this.deleteByIds(new ArrayList<>(Arrays.asList(ids))); - } - - @Override - public DiagnosticSetting getById(String id) { - return wrapModel(this.inner().get(getResourceIdFromSettingsId(id), getNameFromSettingsId(id))); - } - - @Override - public Mono getByIdAsync(String id) { - return this.inner().getAsync(getResourceIdFromSettingsId(id), getNameFromSettingsId(id)).map(this::wrapModel); - } - - private String getResourceIdFromSettingsId(String diagnosticSettingId) { - if (diagnosticSettingId == null) { - throw logger.logExceptionAsError( - new IllegalArgumentException("Parameter 'resourceId' is required and cannot be null.")); - } - int dsIdx = diagnosticSettingId.lastIndexOf(DiagnosticSettingImpl.DIAGNOSTIC_SETTINGS_URI); - if (dsIdx == -1) { - throw logger.logExceptionAsError(new IllegalArgumentException( - "Parameter 'resourceId' does not represent a valid Diagnostic Settings resource Id [" - + diagnosticSettingId - + "].")); - } - - return diagnosticSettingId.substring(0, dsIdx); - } - - private String getNameFromSettingsId(String diagnosticSettingId) { - String resourceId = getResourceIdFromSettingsId(diagnosticSettingId); - return diagnosticSettingId - .substring(resourceId.length() + DiagnosticSettingImpl.DIAGNOSTIC_SETTINGS_URI.length()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/EventCategoriesClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/EventCategoriesClientImpl.java deleted file mode 100644 index 16b0d5022696..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/EventCategoriesClientImpl.java +++ /dev/null @@ -1,183 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.fluent.EventCategoriesClient; -import com.azure.resourcemanager.monitor.fluent.models.LocalizableStringInner; -import com.azure.resourcemanager.monitor.models.EventCategoryCollection; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in EventCategoriesClient. */ -public final class EventCategoriesClientImpl implements EventCategoriesClient { - private final ClientLogger logger = new ClientLogger(EventCategoriesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final EventCategoriesService service; - - /** The service client containing this operation class. */ - private final MonitorClientImpl client; - - /** - * Initializes an instance of EventCategoriesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - EventCategoriesClientImpl(MonitorClientImpl client) { - this.service = - RestProxy.create(EventCategoriesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MonitorClientEventCategories to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MonitorClientEventCa") - private interface EventCategoriesService { - @Headers({"Content-Type: application/json"}) - @Get("/providers/Microsoft.Insights/eventcategories") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Get the list of available event categories supported in the Activity Logs Service.<br>The current list - * includes the following: Administrative, Security, ServiceHealth, Alert, Recommendation, Policy. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of available event categories supported in the Activity Logs Service. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String apiVersion = "2015-04-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the list of available event categories supported in the Activity Logs Service.<br>The current list - * includes the following: Administrative, Security, ServiceHealth, Alert, Recommendation, Policy. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of available event categories supported in the Activity Logs Service. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String apiVersion = "2015-04-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); - } - - /** - * Get the list of available event categories supported in the Activity Logs Service.<br>The current list - * includes the following: Administrative, Security, ServiceHealth, Alert, Recommendation, Policy. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of available event categories supported in the Activity Logs Service. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync()); - } - - /** - * Get the list of available event categories supported in the Activity Logs Service.<br>The current list - * includes the following: Administrative, Security, ServiceHealth, Alert, Recommendation, Policy. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of available event categories supported in the Activity Logs Service. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context)); - } - - /** - * Get the list of available event categories supported in the Activity Logs Service.<br>The current list - * includes the following: Administrative, Security, ServiceHealth, Alert, Recommendation, Policy. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of available event categories supported in the Activity Logs Service. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Get the list of available event categories supported in the Activity Logs Service.<br>The current list - * includes the following: Administrative, Security, ServiceHealth, Alert, Recommendation, Policy. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of available event categories supported in the Activity Logs Service. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/EventDataImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/EventDataImpl.java deleted file mode 100644 index 193c6436be27..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/EventDataImpl.java +++ /dev/null @@ -1,161 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.monitor.implementation; - -import com.azure.resourcemanager.monitor.models.EventData; -import com.azure.resourcemanager.monitor.models.EventLevel; -import com.azure.resourcemanager.monitor.models.HttpRequestInfo; -import com.azure.resourcemanager.monitor.models.LocalizableString; -import com.azure.resourcemanager.monitor.models.SenderAuthorization; -import com.azure.resourcemanager.monitor.fluent.models.EventDataInner; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.WrapperImpl; -import java.time.OffsetDateTime; -import java.util.Map; - -/** The Azure {@link EventData} wrapper class implementation. */ -class EventDataImpl extends WrapperImpl implements EventData { - private LocalizableString eventName; - private LocalizableString category; - private LocalizableString resourceProviderName; - private LocalizableString resourceType; - private LocalizableString operationName; - private LocalizableString status; - private LocalizableString subStatus; - - EventDataImpl(EventDataInner innerObject) { - super(innerObject); - this.eventName = - (innerModel().eventName() == null) ? null : new LocalizableStringImpl(innerModel().eventName()); - this.category = (innerModel().category() == null) ? null : new LocalizableStringImpl(innerModel().category()); - this.resourceProviderName = (innerModel().resourceProviderName() == null) - ? null : new LocalizableStringImpl(innerModel().resourceProviderName()); - this.resourceType = - (innerModel().resourceType() == null) ? null : new LocalizableStringImpl(innerModel().resourceType()); - this.operationName = - (innerModel().operationName() == null) ? null : new LocalizableStringImpl(innerModel().operationName()); - this.status = (innerModel().status() == null) ? null : new LocalizableStringImpl(innerModel().status()); - this.subStatus = - (innerModel().subStatus() == null) ? null : new LocalizableStringImpl(innerModel().subStatus()); - } - - @Override - public SenderAuthorization authorization() { - return this.innerModel().authorization(); - } - - @Override - public Map claims() { - return this.innerModel().claims(); - } - - @Override - public String caller() { - return this.innerModel().caller(); - } - - @Override - public String description() { - return this.innerModel().description(); - } - - @Override - public String id() { - return this.innerModel().id(); - } - - @Override - public String eventDataId() { - return this.innerModel().eventDataId(); - } - - @Override - public String correlationId() { - return this.innerModel().correlationId(); - } - - @Override - public LocalizableString eventName() { - return this.eventName; - } - - @Override - public LocalizableString category() { - return this.category; - } - - @Override - public HttpRequestInfo httpRequest() { - return this.innerModel().httpRequest(); - } - - @Override - public EventLevel level() { - return this.innerModel().level(); - } - - @Override - public String resourceGroupName() { - return this.innerModel().resourceGroupName(); - } - - @Override - public LocalizableString resourceProviderName() { - return this.resourceProviderName; - } - - @Override - public String resourceId() { - return this.innerModel().resourceId(); - } - - @Override - public LocalizableString resourceType() { - return this.resourceType; - } - - @Override - public String operationId() { - return this.innerModel().operationId(); - } - - @Override - public LocalizableString operationName() { - return this.operationName; - } - - @Override - public Map properties() { - return this.innerModel().properties(); - } - - @Override - public LocalizableString status() { - return this.status; - } - - @Override - public LocalizableString subStatus() { - return this.subStatus; - } - - @Override - public OffsetDateTime eventTimestamp() { - return this.innerModel().eventTimestamp(); - } - - @Override - public OffsetDateTime submissionTimestamp() { - return this.innerModel().submissionTimestamp(); - } - - @Override - public String subscriptionId() { - return this.innerModel().subscriptionId(); - } - - @Override - public String tenantId() { - return this.innerModel().tenantId(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/LocalizableStringImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/LocalizableStringImpl.java deleted file mode 100644 index 531d616db8cb..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/LocalizableStringImpl.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.monitor.implementation; - -import com.azure.resourcemanager.monitor.models.LocalizableString; -import com.azure.resourcemanager.monitor.fluent.models.LocalizableStringInner; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.WrapperImpl; - -/** The {@link LocalizableString} wrapper class implementation. */ -class LocalizableStringImpl extends WrapperImpl implements LocalizableString { - - LocalizableStringImpl(LocalizableStringInner innerObject) { - super(innerObject); - } - - @Override - public String value() { - return this.innerModel().value(); - } - - @Override - public String localizedValue() { - return this.innerModel().localizedValue(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/LogProfilesClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/LogProfilesClientImpl.java deleted file mode 100644 index c2bd961a69cc..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/LogProfilesClientImpl.java +++ /dev/null @@ -1,806 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.fluent.LogProfilesClient; -import com.azure.resourcemanager.monitor.fluent.models.LogProfileResourceInner; -import com.azure.resourcemanager.monitor.models.LogProfileCollection; -import com.azure.resourcemanager.monitor.models.LogProfileResourcePatch; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in LogProfilesClient. */ -public final class LogProfilesClientImpl implements LogProfilesClient { - private final ClientLogger logger = new ClientLogger(LogProfilesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final LogProfilesService service; - - /** The service client containing this operation class. */ - private final MonitorClientImpl client; - - /** - * Initializes an instance of LogProfilesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - LogProfilesClientImpl(MonitorClientImpl client) { - this.service = - RestProxy.create(LogProfilesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MonitorClientLogProfiles to be used by the proxy service to perform - * REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MonitorClientLogProf") - private interface LogProfilesService { - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete("/subscriptions/{subscriptionId}/providers/Microsoft.Insights/logprofiles/{logProfileName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @PathParam("logProfileName") String logProfileName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Insights/logprofiles/{logProfileName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("logProfileName") String logProfileName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put("/subscriptions/{subscriptionId}/providers/Microsoft.Insights/logprofiles/{logProfileName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("logProfileName") String logProfileName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") LogProfileResourceInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch("/subscriptions/{subscriptionId}/providers/Microsoft.Insights/logprofiles/{logProfileName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("logProfileName") String logProfileName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") LogProfileResourcePatch logProfilesResource, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Insights/logprofiles") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Deletes the log profile. - * - * @param logProfileName The name of the log profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String logProfileName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (logProfileName == null) { - return Mono.error(new IllegalArgumentException("Parameter logProfileName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2016-03-01"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - logProfileName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the log profile. - * - * @param logProfileName The name of the log profile. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String logProfileName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (logProfileName == null) { - return Mono.error(new IllegalArgumentException("Parameter logProfileName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2016-03-01"; - context = this.client.mergeContext(context); - return service - .delete(this.client.getEndpoint(), logProfileName, apiVersion, this.client.getSubscriptionId(), context); - } - - /** - * Deletes the log profile. - * - * @param logProfileName The name of the log profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String logProfileName) { - return deleteWithResponseAsync(logProfileName).flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes the log profile. - * - * @param logProfileName The name of the log profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String logProfileName) { - deleteAsync(logProfileName).block(); - } - - /** - * Deletes the log profile. - * - * @param logProfileName The name of the log profile. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String logProfileName, Context context) { - return deleteWithResponseAsync(logProfileName, context).block(); - } - - /** - * Gets the log profile. - * - * @param logProfileName The name of the log profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the log profile. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync(String logProfileName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (logProfileName == null) { - return Mono.error(new IllegalArgumentException("Parameter logProfileName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2016-03-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - logProfileName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the log profile. - * - * @param logProfileName The name of the log profile. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the log profile. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String logProfileName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (logProfileName == null) { - return Mono.error(new IllegalArgumentException("Parameter logProfileName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2016-03-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - logProfileName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets the log profile. - * - * @param logProfileName The name of the log profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the log profile. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync(String logProfileName) { - return getWithResponseAsync(logProfileName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the log profile. - * - * @param logProfileName The name of the log profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the log profile. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public LogProfileResourceInner get(String logProfileName) { - return getAsync(logProfileName).block(); - } - - /** - * Gets the log profile. - * - * @param logProfileName The name of the log profile. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the log profile. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String logProfileName, Context context) { - return getWithResponseAsync(logProfileName, context).block(); - } - - /** - * Create or update a log profile in Azure Monitoring REST API. - * - * @param logProfileName The name of the log profile. - * @param parameters Parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the log profile resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponseAsync( - String logProfileName, LogProfileResourceInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (logProfileName == null) { - return Mono.error(new IllegalArgumentException("Parameter logProfileName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2016-03-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - logProfileName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create or update a log profile in Azure Monitoring REST API. - * - * @param logProfileName The name of the log profile. - * @param parameters Parameters supplied to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the log profile resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String logProfileName, LogProfileResourceInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (logProfileName == null) { - return Mono.error(new IllegalArgumentException("Parameter logProfileName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2016-03-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - logProfileName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Create or update a log profile in Azure Monitoring REST API. - * - * @param logProfileName The name of the log profile. - * @param parameters Parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the log profile resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String logProfileName, LogProfileResourceInner parameters) { - return createOrUpdateWithResponseAsync(logProfileName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Create or update a log profile in Azure Monitoring REST API. - * - * @param logProfileName The name of the log profile. - * @param parameters Parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the log profile resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public LogProfileResourceInner createOrUpdate(String logProfileName, LogProfileResourceInner parameters) { - return createOrUpdateAsync(logProfileName, parameters).block(); - } - - /** - * Create or update a log profile in Azure Monitoring REST API. - * - * @param logProfileName The name of the log profile. - * @param parameters Parameters supplied to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the log profile resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String logProfileName, LogProfileResourceInner parameters, Context context) { - return createOrUpdateWithResponseAsync(logProfileName, parameters, context).block(); - } - - /** - * Updates an existing LogProfilesResource. To update other fields use the CreateOrUpdate method. - * - * @param logProfileName The name of the log profile. - * @param logProfilesResource Parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the log profile resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateWithResponseAsync( - String logProfileName, LogProfileResourcePatch logProfilesResource) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (logProfileName == null) { - return Mono.error(new IllegalArgumentException("Parameter logProfileName is required and cannot be null.")); - } - if (logProfilesResource == null) { - return Mono - .error(new IllegalArgumentException("Parameter logProfilesResource is required and cannot be null.")); - } else { - logProfilesResource.validate(); - } - final String apiVersion = "2016-03-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - logProfileName, - apiVersion, - logProfilesResource, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates an existing LogProfilesResource. To update other fields use the CreateOrUpdate method. - * - * @param logProfileName The name of the log profile. - * @param logProfilesResource Parameters supplied to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the log profile resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String logProfileName, LogProfileResourcePatch logProfilesResource, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (logProfileName == null) { - return Mono.error(new IllegalArgumentException("Parameter logProfileName is required and cannot be null.")); - } - if (logProfilesResource == null) { - return Mono - .error(new IllegalArgumentException("Parameter logProfilesResource is required and cannot be null.")); - } else { - logProfilesResource.validate(); - } - final String apiVersion = "2016-03-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - logProfileName, - apiVersion, - logProfilesResource, - accept, - context); - } - - /** - * Updates an existing LogProfilesResource. To update other fields use the CreateOrUpdate method. - * - * @param logProfileName The name of the log profile. - * @param logProfilesResource Parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the log profile resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync( - String logProfileName, LogProfileResourcePatch logProfilesResource) { - return updateWithResponseAsync(logProfileName, logProfilesResource) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Updates an existing LogProfilesResource. To update other fields use the CreateOrUpdate method. - * - * @param logProfileName The name of the log profile. - * @param logProfilesResource Parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the log profile resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public LogProfileResourceInner update(String logProfileName, LogProfileResourcePatch logProfilesResource) { - return updateAsync(logProfileName, logProfilesResource).block(); - } - - /** - * Updates an existing LogProfilesResource. To update other fields use the CreateOrUpdate method. - * - * @param logProfileName The name of the log profile. - * @param logProfilesResource Parameters supplied to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the log profile resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String logProfileName, LogProfileResourcePatch logProfilesResource, Context context) { - return updateWithResponseAsync(logProfileName, logProfilesResource, context).block(); - } - - /** - * List the log profiles. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of log profiles. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2016-03-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List the log profiles. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of log profiles. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2016-03-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); - } - - /** - * List the log profiles. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of log profiles. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync()); - } - - /** - * List the log profiles. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of log profiles. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context)); - } - - /** - * List the log profiles. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of log profiles. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * List the log profiles. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of log profiles. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricAlertConditionBaseImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricAlertConditionBaseImpl.java deleted file mode 100644 index 4bed75448544..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricAlertConditionBaseImpl.java +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.monitor.implementation; - -import com.azure.resourcemanager.monitor.models.MetricAlertRuleTimeAggregation; -import com.azure.resourcemanager.monitor.models.MetricDimension; -import com.azure.resourcemanager.monitor.models.MultiMetricCriteria; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.WrapperImpl; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.TreeMap; - -/** - * Base class for MetricAlertConditionImpl and MetricDynamicAlertConditionImpl. - * - * @param inner class, MetricCriteria or DynamicMetricCriteria - * @param subclass, i.e., MetricAlertConditionImpl or MetricDynamicAlertConditionImpl - */ -class MetricAlertConditionBaseImpl< - InnerT extends MultiMetricCriteria, SubclassT extends MetricAlertConditionBaseImpl> - extends WrapperImpl { - - protected final MetricAlertImpl parent; - protected final TreeMap dimensions; - - protected MetricAlertConditionBaseImpl(String name, InnerT innerObject, MetricAlertImpl parent) { - super(innerObject); - this.innerModel().withName(name); - this.parent = parent; - this.dimensions = new TreeMap<>(); - if (this.innerModel().dimensions() != null) { - for (MetricDimension md : this.innerModel().dimensions()) { - dimensions.put(md.name(), md); - } - } - } - - public String name() { - return this.innerModel().name(); - } - - public String metricName() { - return this.innerModel().metricName(); - } - - public String metricNamespace() { - return this.innerModel().metricNamespace(); - } - - public MetricAlertRuleTimeAggregation timeAggregation() { - return MetricAlertRuleTimeAggregation.fromString(this.innerModel().timeAggregation().toString()); - } - - public Collection dimensions() { - return Collections.unmodifiableCollection(this.innerModel().dimensions()); - } - - public MetricAlertImpl parent() { - this.innerModel().withDimensions(new ArrayList<>(this.dimensions.values())); - return this.parent; - } - - @SuppressWarnings("unchecked") - public SubclassT withMetricName(String metricName) { - this.innerModel().withMetricName(metricName); - return (SubclassT) this; - } - - public SubclassT withMetricName(String metricName, String metricNamespace) { - this.innerModel().withMetricNamespace(metricNamespace); - return this.withMetricName(metricName); - } - - @SuppressWarnings("unchecked") - public SubclassT withDimension(String dimensionName, String... values) { - if (this.dimensions.containsKey(dimensionName)) { - dimensions.remove(dimensionName); - } - MetricDimension md = new MetricDimension(); - md.withName(dimensionName); - md.withOperator("Include"); - md.withValues(Arrays.asList(values)); - dimensions.put(dimensionName, md); - return (SubclassT) this; - } - - @SuppressWarnings("unchecked") - public SubclassT withoutDimension(String dimensionName) { - if (this.dimensions.containsKey(dimensionName)) { - dimensions.remove(dimensionName); - } - return (SubclassT) this; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricAlertConditionImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricAlertConditionImpl.java deleted file mode 100644 index 6c5f2552a671..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricAlertConditionImpl.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.monitor.implementation; - -import com.azure.resourcemanager.monitor.models.AggregationTypeEnum; -import com.azure.resourcemanager.monitor.models.MetricAlert; -import com.azure.resourcemanager.monitor.models.MetricAlertCondition; -import com.azure.resourcemanager.monitor.models.MetricAlertRuleCondition; -import com.azure.resourcemanager.monitor.models.MetricAlertRuleTimeAggregation; -import com.azure.resourcemanager.monitor.models.MetricCriteria; -import com.azure.resourcemanager.monitor.models.Operator; -import java.util.ArrayList; - -/** Implementation for MetricAlertCondition. */ -class MetricAlertConditionImpl extends MetricAlertConditionBaseImpl - implements MetricAlertCondition, - MetricAlertCondition.DefinitionStages, - MetricAlertCondition.DefinitionStages.Blank.MetricName, - MetricAlertCondition.DefinitionStages.WithCriteriaOperator, - MetricAlertCondition.DefinitionStages.WithConditionAttach, - MetricAlertCondition.UpdateDefinitionStages, - MetricAlertCondition.UpdateDefinitionStages.Blank.MetricName, - MetricAlertCondition.UpdateDefinitionStages.WithCriteriaOperator, - MetricAlertCondition.UpdateDefinitionStages.WithConditionAttach, - MetricAlertCondition.UpdateStages { - - MetricAlertConditionImpl(String name, MetricCriteria innerObject, MetricAlertImpl parent) { - super(name, innerObject, parent); - } - - @Override - public MetricAlertConditionImpl withCondition( - MetricAlertRuleTimeAggregation timeAggregation, MetricAlertRuleCondition condition, double threshold) { - this.innerModel().withOperator(Operator.fromString(condition.toString())); - this.innerModel().withTimeAggregation(AggregationTypeEnum.fromString(timeAggregation.toString())); - this.innerModel().withThreshold(threshold); - return this; - } - - @Override - public MetricAlertImpl attach() { - this.innerModel().withDimensions(new ArrayList<>(this.dimensions.values())); - return this.parent().withAlertCriteria(this); - } - - @Override - public MetricAlertRuleCondition condition() { - return MetricAlertRuleCondition.fromString(this.innerModel().operator().toString()); - } - - @Override - public double threshold() { - return this.innerModel().threshold(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricAlertImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricAlertImpl.java deleted file mode 100644 index eb831435dfc1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricAlertImpl.java +++ /dev/null @@ -1,385 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.monitor.implementation; - -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.MonitorManager; -import com.azure.resourcemanager.monitor.models.DynamicMetricCriteria; -import com.azure.resourcemanager.monitor.models.MetricAlert; -import com.azure.resourcemanager.monitor.models.MetricAlertAction; -import com.azure.resourcemanager.monitor.models.MetricAlertCondition; -import com.azure.resourcemanager.monitor.models.MetricAlertCriteria; -import com.azure.resourcemanager.monitor.models.MetricAlertMultipleResourceMultipleMetricCriteria; -import com.azure.resourcemanager.monitor.models.MetricAlertSingleResourceMultipleMetricCriteria; -import com.azure.resourcemanager.monitor.models.MetricCriteria; -import com.azure.resourcemanager.monitor.models.MetricDynamicAlertCondition; -import com.azure.resourcemanager.monitor.models.MultiMetricCriteria; -import com.azure.resourcemanager.monitor.fluent.models.MetricAlertResourceInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasId; -import com.azure.resourcemanager.resources.fluentcore.arm.models.Resource; -import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.GroupableResourceImpl; -import java.time.Duration; -import java.time.OffsetDateTime; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.TreeMap; -import reactor.core.publisher.Mono; - -/** Implementation for MetricAlert. */ -class MetricAlertImpl - extends GroupableResourceImpl - implements MetricAlert, - MetricAlert.Definition, - MetricAlert.DefinitionMultipleResource, - MetricAlert.Update, - MetricAlert.UpdateStages.WithMetricUpdate { - - private final ClientLogger logger = new ClientLogger(getClass()); - - // 2019/09 at present service support 2 static criteria, or 1 dynamic criteria - // static criteria - private Map conditions; - // dynamic criteria - private Map dynamicConditions; - - private boolean multipleResource = false; - - MetricAlertImpl(String name, final MetricAlertResourceInner innerModel, final MonitorManager monitorManager) { - super(name, innerModel, monitorManager); - this.conditions = new TreeMap<>(); - this.dynamicConditions = new TreeMap<>(); - if (innerModel.criteria() != null) { - MetricAlertCriteria innerCriteria = innerModel.criteria(); - if (innerCriteria instanceof MetricAlertSingleResourceMultipleMetricCriteria) { - multipleResource = false; - // single resource with multiple static criteria - MetricAlertSingleResourceMultipleMetricCriteria crits = - (MetricAlertSingleResourceMultipleMetricCriteria) innerCriteria; - List criteria = crits.allOf(); - if (criteria != null) { - for (MetricCriteria crit : criteria) { - this.conditions.put(crit.name(), new MetricAlertConditionImpl(crit.name(), crit, this)); - } - } - } else if (innerCriteria instanceof MetricAlertMultipleResourceMultipleMetricCriteria) { - multipleResource = true; - // multiple resource with either multiple static criteria, or (currently single) dynamic criteria - MetricAlertMultipleResourceMultipleMetricCriteria crits = - (MetricAlertMultipleResourceMultipleMetricCriteria) innerCriteria; - List criteria = crits.allOf(); - if (criteria != null) { - for (MultiMetricCriteria crit : criteria) { - if (crit instanceof MetricCriteria) { - this - .conditions - .put( - crit.name(), - new MetricAlertConditionImpl(crit.name(), (MetricCriteria) crit, this)); - } else if (crit instanceof DynamicMetricCriteria) { - this - .dynamicConditions - .put( - crit.name(), - new MetricDynamicAlertConditionImpl( - crit.name(), (DynamicMetricCriteria) crit, this)); - } - } - } - } - } - } - - @Override - public Mono createResourceAsync() { - if (this.conditions.isEmpty() && this.dynamicConditions.isEmpty()) { - throw logger.logExceptionAsError(new IllegalArgumentException("Condition cannot be empty")); - } else if (!this.conditions.isEmpty() && !this.dynamicConditions.isEmpty()) { - throw logger.logExceptionAsError( - new IllegalArgumentException("Static condition and dynamic condition cannot co-exist")); - } - - this.innerModel().withLocation("global"); - if (!this.conditions.isEmpty()) { - if (!multipleResource) { - MetricAlertSingleResourceMultipleMetricCriteria crit = - new MetricAlertSingleResourceMultipleMetricCriteria(); - crit.withAllOf(new ArrayList<>()); - for (MetricAlertCondition mc : conditions.values()) { - crit.allOf().add(mc.innerModel()); - } - this.innerModel().withCriteria(crit); - } else { - MetricAlertMultipleResourceMultipleMetricCriteria crit = - new MetricAlertMultipleResourceMultipleMetricCriteria(); - crit.withAllOf(new ArrayList<>()); - for (MetricAlertCondition mc : conditions.values()) { - crit.allOf().add(mc.innerModel()); - } - this.innerModel().withCriteria(crit); - } - } else if (!this.dynamicConditions.isEmpty()) { - MetricAlertMultipleResourceMultipleMetricCriteria crit = - new MetricAlertMultipleResourceMultipleMetricCriteria(); - crit.withAllOf(new ArrayList<>()); - for (MetricDynamicAlertCondition mc : dynamicConditions.values()) { - crit.allOf().add(mc.innerModel()); - } - this.innerModel().withCriteria(crit); - } - return this - .manager() - .serviceClient() - .getMetricAlerts() - .createOrUpdateAsync(this.resourceGroupName(), this.name(), this.innerModel()) - .map(innerToFluentMap(this)); - } - - @Override - protected Mono getInnerAsync() { - return this.manager().serviceClient().getMetricAlerts() - .getByResourceGroupAsync(this.resourceGroupName(), this.name()); - } - - @Override - public MetricAlertImpl withTargetResource(String resourceId) { - multipleResource = false; - - this.innerModel().withScopes(new ArrayList<>()); - this.innerModel().scopes().add(resourceId); - return this; - } - - @Override - public MetricAlertImpl withTargetResource(HasId resource) { - multipleResource = false; - - return this.withTargetResource(resource.id()); - } - - @Override - public MetricAlertImpl withPeriod(Duration size) { - this.innerModel().withWindowSize(size); - return this; - } - - @Override - public MetricAlertImpl withFrequency(Duration frequency) { - this.innerModel().withEvaluationFrequency(frequency); - return this; - } - - @Override - public MetricAlertImpl withSeverity(int severity) { - this.innerModel().withSeverity(severity); - return this; - } - - @Override - public MetricAlertImpl withAlertDetails(int severity, String description) { - this.withSeverity(severity); - return this.withDescription(description); - } - - @Override - public MetricAlertImpl withDescription(String description) { - this.innerModel().withDescription(description); - return this; - } - - @Override - public MetricAlertImpl withRuleEnabled() { - this.innerModel().withEnabled(true); - return this; - } - - @Override - public MetricAlertImpl withRuleDisabled() { - this.innerModel().withEnabled(false); - return this; - } - - @Override - public MetricAlertImpl withAutoMitigation() { - this.innerModel().withAutoMitigate(true); - return this; - } - - @Override - public MetricAlertImpl withoutAutoMitigation() { - this.innerModel().withAutoMitigate(false); - return this; - } - - @Override - public MetricAlertImpl withActionGroups(String... actionGroupId) { - if (this.innerModel().actions() == null) { - this.innerModel().withActions(new ArrayList()); - } - this.innerModel().actions().clear(); - for (String agid : actionGroupId) { - MetricAlertAction maa = new MetricAlertAction(); - maa.withActionGroupId(agid); - this.innerModel().actions().add(maa); - } - return this; - } - - @Override - public MetricAlertImpl withoutActionGroup(String actionGroupId) { - if (this.innerModel().actions() != null) { - List toDelete = new ArrayList<>(); - for (MetricAlertAction maa : this.innerModel().actions()) { - if (maa.actionGroupId().equalsIgnoreCase(actionGroupId)) { - toDelete.add(maa); - } - } - this.innerModel().actions().removeAll(toDelete); - } - return this; - } - - @Override - public MetricAlertConditionImpl defineAlertCriteria(String name) { - return new MetricAlertConditionImpl(name, new MetricCriteria(), this); - } - - @Override - public MetricDynamicAlertConditionImpl defineDynamicAlertCriteria(String name) { - return new MetricDynamicAlertConditionImpl(name, new DynamicMetricCriteria(), this); - } - - @Override - public MetricAlertConditionImpl updateAlertCriteria(String name) { - return (MetricAlertConditionImpl) this.conditions.get(name); - } - - @Override - public MetricDynamicAlertConditionImpl updateDynamicAlertCriteria(String name) { - return (MetricDynamicAlertConditionImpl) this.dynamicConditions.get(name); - } - - @Override - public MetricAlertImpl withoutAlertCriteria(String name) { - if (this.conditions.containsKey(name)) { - this.conditions.remove(name); - } - if (this.dynamicConditions.containsKey(name)) { - this.dynamicConditions.remove(name); - } - return this; - } - - MetricAlertImpl withAlertCriteria(MetricAlertConditionImpl criteria) { - this.withoutAlertCriteria(criteria.name()); - this.conditions.put(criteria.name(), criteria); - return this; - } - - MetricAlertImpl withDynamicAlertCriteria(MetricDynamicAlertConditionImpl criteria) { - this.withoutAlertCriteria(criteria.name()); - this.dynamicConditions.put(criteria.name(), criteria); - return this; - } - - @Override - public MetricAlertImpl withMultipleTargetResources(Collection resourceIds, String type, String region) { - if (resourceIds == null || resourceIds.isEmpty()) { - throw logger.logExceptionAsError(new IllegalArgumentException("Target resource cannot be empty")); - } - - multipleResource = true; - - this.innerModel().withScopes(new ArrayList<>(resourceIds)); - this.innerModel().withTargetResourceType(type); - this.innerModel().withTargetResourceRegion(region); - return this; - } - - @Override - public MetricAlertImpl withMultipleTargetResources(Collection resources) { - if (resources == null || resources.isEmpty()) { - throw logger.logExceptionAsError(new IllegalArgumentException("Target resource cannot be empty")); - } - - multipleResource = true; - - List resourceIds = new ArrayList<>(); - String type = resources.iterator().next().type(); - String regionName = resources.iterator().next().regionName(); - for (Resource resource : resources) { - if (!type.equalsIgnoreCase(resource.type()) || !regionName.equalsIgnoreCase(resource.regionName())) { - throw logger.logExceptionAsError(new IllegalArgumentException( - "Target resource must be of the same resource type and in the same region")); - } - - resourceIds.add(resource.id()); - } - return this.withMultipleTargetResources(resourceIds, type, regionName); - } - - @Override - public String description() { - return this.innerModel().description(); - } - - @Override - public int severity() { - return this.innerModel().severity(); - } - - @Override - public boolean enabled() { - return this.innerModel().enabled(); - } - - @Override - public Duration evaluationFrequency() { - return this.innerModel().evaluationFrequency(); - } - - @Override - public Duration windowSize() { - return this.innerModel().windowSize(); - } - - @Override - public boolean autoMitigate() { - return this.innerModel().autoMitigate(); - } - - @Override - public OffsetDateTime lastUpdatedTime() { - return this.innerModel().lastUpdatedTime(); - } - - @Override - public Collection scopes() { - return Collections.unmodifiableCollection(this.innerModel().scopes()); - } - - @Override - public Collection actionGroupIds() { - if (this.innerModel().actions() != null && this.innerModel().actions() != null) { - List ids = new ArrayList<>(); - for (MetricAlertAction maag : this.innerModel().actions()) { - ids.add(maag.actionGroupId()); - } - return Collections.unmodifiableCollection(ids); - } - return Collections.emptyList(); - } - - @Override - public Map alertCriterias() { - return Collections.unmodifiableMap(this.conditions); - } - - @Override - public Map dynamicAlertCriterias() { - return Collections.unmodifiableMap(this.dynamicConditions); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricAlertsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricAlertsClientImpl.java deleted file mode 100644 index 3af4a3f89e4b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricAlertsClientImpl.java +++ /dev/null @@ -1,1063 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.fluent.MetricAlertsClient; -import com.azure.resourcemanager.monitor.fluent.models.MetricAlertResourceInner; -import com.azure.resourcemanager.monitor.models.MetricAlertResourceCollection; -import com.azure.resourcemanager.monitor.models.MetricAlertResourcePatch; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in MetricAlertsClient. */ -public final class MetricAlertsClientImpl - implements InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete, - MetricAlertsClient { - private final ClientLogger logger = new ClientLogger(MetricAlertsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final MetricAlertsService service; - - /** The service client containing this operation class. */ - private final MonitorClientImpl client; - - /** - * Initializes an instance of MetricAlertsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - MetricAlertsClientImpl(MonitorClientImpl client) { - this.service = - RestProxy.create(MetricAlertsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MonitorClientMetricAlerts to be used by the proxy service to perform - * REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MonitorClientMetricA") - private interface MetricAlertsService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Insights/metricAlerts") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights" - + "/metricAlerts") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights" - + "/metricAlerts/{ruleName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("ruleName") String ruleName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights" - + "/metricAlerts/{ruleName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("ruleName") String ruleName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") MetricAlertResourceInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights" - + "/metricAlerts/{ruleName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("ruleName") String ruleName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") MetricAlertResourcePatch parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights" - + "/metricAlerts/{ruleName}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("ruleName") String ruleName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Retrieve alert rule definitions in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of alert rule resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-03-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Retrieve alert rule definitions in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of alert rule resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-03-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); - } - - /** - * Retrieve alert rule definitions in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of alert rule resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync()); - } - - /** - * Retrieve alert rule definitions in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of alert rule resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context)); - } - - /** - * Retrieve alert rule definitions in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of alert rule resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Retrieve alert rule definitions in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of alert rule resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Retrieve alert rule definitions in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of alert rule resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String apiVersion = "2018-03-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - apiVersion, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Retrieve alert rule definitions in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of alert rule resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String apiVersion = "2018-03-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - apiVersion, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); - } - - /** - * Retrieve alert rule definitions in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of alert rule resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName)); - } - - /** - * Retrieve alert rule definitions in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of alert rule resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context)); - } - - /** - * Retrieve alert rule definitions in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of alert rule resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * Retrieve alert rule definitions in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of alert rule resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * Retrieve an alert rule definition. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the metric alert resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String ruleName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ruleName == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); - } - final String apiVersion = "2018-03-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - ruleName, - apiVersion, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Retrieve an alert rule definition. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the metric alert resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String ruleName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ruleName == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); - } - final String apiVersion = "2018-03-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - ruleName, - apiVersion, - accept, - context); - } - - /** - * Retrieve an alert rule definition. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the metric alert resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync(String resourceGroupName, String ruleName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, ruleName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Retrieve an alert rule definition. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the metric alert resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public MetricAlertResourceInner getByResourceGroup(String resourceGroupName, String ruleName) { - return getByResourceGroupAsync(resourceGroupName, ruleName).block(); - } - - /** - * Retrieve an alert rule definition. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the metric alert resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String ruleName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, ruleName, context).block(); - } - - /** - * Create or update an metric alert definition. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param parameters The parameters of the rule to create or update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the metric alert resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String ruleName, MetricAlertResourceInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ruleName == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-03-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - ruleName, - apiVersion, - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create or update an metric alert definition. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param parameters The parameters of the rule to create or update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the metric alert resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String ruleName, MetricAlertResourceInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ruleName == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-03-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - ruleName, - apiVersion, - parameters, - accept, - context); - } - - /** - * Create or update an metric alert definition. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param parameters The parameters of the rule to create or update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the metric alert resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, String ruleName, MetricAlertResourceInner parameters) { - return createOrUpdateWithResponseAsync(resourceGroupName, ruleName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Create or update an metric alert definition. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param parameters The parameters of the rule to create or update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the metric alert resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public MetricAlertResourceInner createOrUpdate( - String resourceGroupName, String ruleName, MetricAlertResourceInner parameters) { - return createOrUpdateAsync(resourceGroupName, ruleName, parameters).block(); - } - - /** - * Create or update an metric alert definition. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param parameters The parameters of the rule to create or update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the metric alert resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceGroupName, String ruleName, MetricAlertResourceInner parameters, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, ruleName, parameters, context).block(); - } - - /** - * Update an metric alert definition. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param parameters The parameters of the rule to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the metric alert resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateWithResponseAsync( - String resourceGroupName, String ruleName, MetricAlertResourcePatch parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ruleName == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-03-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - ruleName, - apiVersion, - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Update an metric alert definition. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param parameters The parameters of the rule to update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the metric alert resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, String ruleName, MetricAlertResourcePatch parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ruleName == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-03-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - ruleName, - apiVersion, - parameters, - accept, - context); - } - - /** - * Update an metric alert definition. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param parameters The parameters of the rule to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the metric alert resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync( - String resourceGroupName, String ruleName, MetricAlertResourcePatch parameters) { - return updateWithResponseAsync(resourceGroupName, ruleName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Update an metric alert definition. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param parameters The parameters of the rule to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the metric alert resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public MetricAlertResourceInner update( - String resourceGroupName, String ruleName, MetricAlertResourcePatch parameters) { - return updateAsync(resourceGroupName, ruleName, parameters).block(); - } - - /** - * Update an metric alert definition. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param parameters The parameters of the rule to update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the metric alert resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, String ruleName, MetricAlertResourcePatch parameters, Context context) { - return updateWithResponseAsync(resourceGroupName, ruleName, parameters, context).block(); - } - - /** - * Delete an alert rule definition. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String resourceGroupName, String ruleName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ruleName == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); - } - final String apiVersion = "2018-03-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - ruleName, - apiVersion, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete an alert rule definition. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String ruleName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ruleName == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); - } - final String apiVersion = "2018-03-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - ruleName, - apiVersion, - accept, - context); - } - - /** - * Delete an alert rule definition. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String ruleName) { - return deleteWithResponseAsync(resourceGroupName, ruleName).flatMap((Response res) -> Mono.empty()); - } - - /** - * Delete an alert rule definition. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String ruleName) { - deleteAsync(resourceGroupName, ruleName).block(); - } - - /** - * Delete an alert rule definition. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String ruleName, Context context) { - return deleteWithResponseAsync(resourceGroupName, ruleName, context).block(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricAlertsImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricAlertsImpl.java deleted file mode 100644 index 0c19473e5936..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricAlertsImpl.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.monitor.implementation; - -import com.azure.resourcemanager.monitor.MonitorManager; -import com.azure.resourcemanager.monitor.models.MetricAlert; -import com.azure.resourcemanager.monitor.models.MetricAlerts; -import com.azure.resourcemanager.monitor.fluent.models.MetricAlertResourceInner; -import com.azure.resourcemanager.monitor.fluent.MetricAlertsClient; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.TopLevelModifiableResourcesImpl; - -/** Implementation for {@link MetricAlerts}. */ -class MetricAlertsImpl - extends TopLevelModifiableResourcesImpl< - MetricAlert, MetricAlertImpl, MetricAlertResourceInner, MetricAlertsClient, MonitorManager> - implements MetricAlerts { - - MetricAlertsImpl(final MonitorManager monitorManager) { - super(monitorManager.serviceClient().getMetricAlerts(), monitorManager); - } - - @Override - protected MetricAlertImpl wrapModel(String name) { - MetricAlertResourceInner inner = new MetricAlertResourceInner(); - inner.withEnabled(true); - inner.withAutoMitigate(true); - return new MetricAlertImpl(name, inner, this.manager()); - } - - @Override - protected MetricAlertImpl wrapModel(MetricAlertResourceInner inner) { - if (inner == null) { - return null; - } - return new MetricAlertImpl(inner.name(), inner, this.manager()); - } - - @Override - public MetricAlertImpl define(String name) { - return wrapModel(name); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricAlertsStatusClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricAlertsStatusClientImpl.java deleted file mode 100644 index 2ae5c3a71a4f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricAlertsStatusClientImpl.java +++ /dev/null @@ -1,404 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.fluent.MetricAlertsStatusClient; -import com.azure.resourcemanager.monitor.fluent.models.MetricAlertStatusCollectionInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in MetricAlertsStatusClient. */ -public final class MetricAlertsStatusClientImpl implements MetricAlertsStatusClient { - private final ClientLogger logger = new ClientLogger(MetricAlertsStatusClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final MetricAlertsStatusService service; - - /** The service client containing this operation class. */ - private final MonitorClientImpl client; - - /** - * Initializes an instance of MetricAlertsStatusClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - MetricAlertsStatusClientImpl(MonitorClientImpl client) { - this.service = - RestProxy.create(MetricAlertsStatusService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MonitorClientMetricAlertsStatus to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MonitorClientMetricA") - private interface MetricAlertsStatusService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights" - + "/metricAlerts/{ruleName}/status") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("ruleName") String ruleName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights" - + "/metricAlerts/{ruleName}/status/{statusName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByName( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("ruleName") String ruleName, - @PathParam("statusName") String statusName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Retrieve an alert rule status. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of alert rule resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listWithResponseAsync( - String resourceGroupName, String ruleName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ruleName == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); - } - final String apiVersion = "2018-03-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - ruleName, - apiVersion, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Retrieve an alert rule status. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of alert rule resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync( - String resourceGroupName, String ruleName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ruleName == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); - } - final String apiVersion = "2018-03-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - ruleName, - apiVersion, - accept, - context); - } - - /** - * Retrieve an alert rule status. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of alert rule resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listAsync(String resourceGroupName, String ruleName) { - return listWithResponseAsync(resourceGroupName, ruleName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Retrieve an alert rule status. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of alert rule resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public MetricAlertStatusCollectionInner list(String resourceGroupName, String ruleName) { - return listAsync(resourceGroupName, ruleName).block(); - } - - /** - * Retrieve an alert rule status. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of alert rule resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse( - String resourceGroupName, String ruleName, Context context) { - return listWithResponseAsync(resourceGroupName, ruleName, context).block(); - } - - /** - * Retrieve an alert rule status. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param statusName The name of the status. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of alert rule resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listByNameWithResponseAsync( - String resourceGroupName, String ruleName, String statusName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ruleName == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); - } - if (statusName == null) { - return Mono.error(new IllegalArgumentException("Parameter statusName is required and cannot be null.")); - } - final String apiVersion = "2018-03-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByName( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - ruleName, - statusName, - apiVersion, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Retrieve an alert rule status. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param statusName The name of the status. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of alert rule resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByNameWithResponseAsync( - String resourceGroupName, String ruleName, String statusName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ruleName == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); - } - if (statusName == null) { - return Mono.error(new IllegalArgumentException("Parameter statusName is required and cannot be null.")); - } - final String apiVersion = "2018-03-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByName( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - ruleName, - statusName, - apiVersion, - accept, - context); - } - - /** - * Retrieve an alert rule status. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param statusName The name of the status. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of alert rule resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listByNameAsync( - String resourceGroupName, String ruleName, String statusName) { - return listByNameWithResponseAsync(resourceGroupName, ruleName, statusName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Retrieve an alert rule status. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param statusName The name of the status. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of alert rule resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public MetricAlertStatusCollectionInner listByName(String resourceGroupName, String ruleName, String statusName) { - return listByNameAsync(resourceGroupName, ruleName, statusName).block(); - } - - /** - * Retrieve an alert rule status. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param statusName The name of the status. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of alert rule resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listByNameWithResponse( - String resourceGroupName, String ruleName, String statusName, Context context) { - return listByNameWithResponseAsync(resourceGroupName, ruleName, statusName, context).block(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricCollectionImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricCollectionImpl.java deleted file mode 100644 index 0d6b43ef6ec0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricCollectionImpl.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.monitor.implementation; - -import com.azure.resourcemanager.monitor.models.Metric; -import com.azure.resourcemanager.monitor.models.MetricCollection; -import com.azure.resourcemanager.monitor.fluent.models.ResponseInner; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.WrapperImpl; -import java.time.Duration; -import java.util.List; -import java.util.stream.Collectors; - -/** The Azure {@link MetricCollection} wrapper class implementation. */ -class MetricCollectionImpl extends WrapperImpl implements MetricCollection { - - MetricCollectionImpl(ResponseInner innerObject) { - super(innerObject); - } - - @Override - public String namespace() { - return this.innerModel().namespace(); - } - - @Override - public String resourceRegion() { - return this.innerModel().resourceRegion(); - } - - @Override - public Double cost() { - return this.innerModel().cost().doubleValue(); - } - - @Override - public String timespan() { - return this.innerModel().timespan(); - } - - @Override - public Duration interval() { - return this.innerModel().interval(); - } - - @Override - public List metrics() { - return this.innerModel().value().stream().map(MetricImpl::new).collect(Collectors.toList()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricDefinitionImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricDefinitionImpl.java deleted file mode 100644 index 64b4b6e1575a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricDefinitionImpl.java +++ /dev/null @@ -1,199 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.monitor.implementation; - -import com.azure.resourcemanager.monitor.MonitorManager; -import com.azure.resourcemanager.monitor.models.AggregationType; -import com.azure.resourcemanager.monitor.models.LocalizableString; -import com.azure.resourcemanager.monitor.models.MetricAvailability; -import com.azure.resourcemanager.monitor.models.MetricCollection; -import com.azure.resourcemanager.monitor.models.MetricDefinition; -import com.azure.resourcemanager.monitor.models.ResultType; -import com.azure.resourcemanager.monitor.fluent.models.LocalizableStringInner; -import com.azure.resourcemanager.monitor.fluent.models.MetricDefinitionInner; -import com.azure.resourcemanager.monitor.models.Unit; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.WrapperImpl; -import java.time.Duration; -import java.time.OffsetDateTime; -import java.time.ZoneOffset; -import java.time.format.DateTimeFormatter; -import java.util.ArrayList; -import java.util.List; -import reactor.core.publisher.Mono; - -/** The Azure metric definition entries are of type MetricDefinition. */ -class MetricDefinitionImpl extends WrapperImpl - implements MetricDefinition, MetricDefinition.MetricsQueryDefinition { - - private final MonitorManager myManager; - private final MetricDefinitionInner inner; - private final LocalizableString name; - private List dimensions; - private OffsetDateTime queryStartTime = null; - private OffsetDateTime queryEndTime = null; - private String aggreagation; - private Duration interval; - private String odataFilter; - private ResultType resultType; - private Integer top; - private String orderBy; - private String namespaceFilter; - - MetricDefinitionImpl(final MetricDefinitionInner innerModel, final MonitorManager monitorManager) { - super(innerModel); - this.myManager = monitorManager; - this.inner = innerModel; - this.name = (inner.name() == null) ? null : new LocalizableStringImpl(inner.name()); - this.dimensions = null; - if (this.inner.dimensions() != null && this.inner.dimensions().size() > 0) { - this.dimensions = new ArrayList<>(); - for (LocalizableStringInner lsi : inner.dimensions()) { - this.dimensions.add(new LocalizableStringImpl(lsi)); - } - } - } - - @Override - public MonitorManager manager() { - return this.myManager; - } - - public String resourceId() { - return this.inner.resourceId(); - } - - public LocalizableString name() { - return this.name; - } - - @Override - public String namespace() { - return this.inner.namespace(); - } - - @Override - public boolean isDimensionRequired() { - return this.inner.isDimensionRequired(); - } - - @Override - public List dimensions() { - return this.dimensions; - } - - @Override - public List supportedAggregationTypes() { - return this.inner.supportedAggregationTypes(); - } - - public Unit unit() { - return this.innerModel().unit(); - } - - public AggregationType primaryAggregationType() { - return this.inner.primaryAggregationType(); - } - - public List metricAvailabilities() { - return this.inner.metricAvailabilities(); - } - - public String id() { - return this.inner.id(); - } - - @Override - public MetricDefinitionImpl defineQuery() { - this.aggreagation = null; - this.interval = null; - this.resultType = null; - this.top = null; - this.orderBy = null; - this.namespaceFilter = null; - return this; - } - - @Override - public MetricDefinitionImpl startingFrom(OffsetDateTime startTime) { - this.queryStartTime = startTime; - return this; - } - - @Override - public MetricDefinitionImpl endsBefore(OffsetDateTime endTime) { - this.queryEndTime = endTime; - return this; - } - - @Override - public MetricDefinitionImpl withAggregation(String aggregation) { - this.aggreagation = aggregation; - return this; - } - - @Override - public MetricDefinitionImpl withInterval(Duration interval) { - this.interval = interval; - return this; - } - - @Override - public MetricDefinitionImpl withOdataFilter(String odataFilter) { - this.odataFilter = odataFilter; - return this; - } - - @Override - public MetricDefinitionImpl withResultType(ResultType resultType) { - this.resultType = resultType; - return this; - } - - @Override - public MetricDefinitionImpl selectTop(int top) { - this.top = top; - return this; - } - - @Override - public MetricDefinitionImpl orderBy(String orderBy) { - this.orderBy = orderBy; - return this; - } - - @Override - public MetricsQueryDefinitionStages.WithMetricsQueryExecute filterByNamespace(String namespaceName) { - this.namespaceFilter = namespaceName; - return this; - } - - @Override - public MetricCollection execute() { - return this.executeAsync().block(); - } - - @Override - public Mono executeAsync() { - return this - .manager() - .serviceClient() - .getMetrics() - .listAsync( - this.inner.resourceId(), - String - .format( - "%s/%s", - DateTimeFormatter.ISO_INSTANT.format(this.queryStartTime.atZoneSameInstant(ZoneOffset.UTC)), - DateTimeFormatter.ISO_INSTANT.format(this.queryEndTime.atZoneSameInstant(ZoneOffset.UTC))), - this.interval, - this.inner.name().value(), - this.aggreagation, - this.top, - this.orderBy, - this.odataFilter, - this.resultType, - this.namespaceFilter) - .map(MetricCollectionImpl::new); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricDefinitionsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricDefinitionsClientImpl.java deleted file mode 100644 index 3a8ddd54b405..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricDefinitionsClientImpl.java +++ /dev/null @@ -1,219 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.fluent.MetricDefinitionsClient; -import com.azure.resourcemanager.monitor.fluent.models.MetricDefinitionInner; -import com.azure.resourcemanager.monitor.models.MetricDefinitionCollection; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in MetricDefinitionsClient. */ -public final class MetricDefinitionsClientImpl implements MetricDefinitionsClient { - private final ClientLogger logger = new ClientLogger(MetricDefinitionsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final MetricDefinitionsService service; - - /** The service client containing this operation class. */ - private final MonitorClientImpl client; - - /** - * Initializes an instance of MetricDefinitionsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - MetricDefinitionsClientImpl(MonitorClientImpl client) { - this.service = - RestProxy.create(MetricDefinitionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MonitorClientMetricDefinitions to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MonitorClientMetricD") - private interface MetricDefinitionsService { - @Headers({"Content-Type: application/json"}) - @Get("/{resourceUri}/providers/Microsoft.Insights/metricDefinitions") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam(value = "resourceUri", encoded = true) String resourceUri, - @QueryParam("api-version") String apiVersion, - @QueryParam("metricnamespace") String metricnamespace, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Lists the metric definitions for the resource. - * - * @param resourceUri The identifier of the resource. - * @param metricnamespace Metric namespace to query metric definitions for. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents collection of metric definitions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceUri, String metricnamespace) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceUri == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); - } - final String apiVersion = "2018-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service.list(this.client.getEndpoint(), resourceUri, apiVersion, metricnamespace, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists the metric definitions for the resource. - * - * @param resourceUri The identifier of the resource. - * @param metricnamespace Metric namespace to query metric definitions for. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents collection of metric definitions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceUri, String metricnamespace, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceUri == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); - } - final String apiVersion = "2018-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), resourceUri, apiVersion, metricnamespace, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); - } - - /** - * Lists the metric definitions for the resource. - * - * @param resourceUri The identifier of the resource. - * @param metricnamespace Metric namespace to query metric definitions for. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents collection of metric definitions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String resourceUri, String metricnamespace) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceUri, metricnamespace)); - } - - /** - * Lists the metric definitions for the resource. - * - * @param resourceUri The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents collection of metric definitions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String resourceUri) { - final String metricnamespace = null; - return new PagedFlux<>(() -> listSinglePageAsync(resourceUri, metricnamespace)); - } - - /** - * Lists the metric definitions for the resource. - * - * @param resourceUri The identifier of the resource. - * @param metricnamespace Metric namespace to query metric definitions for. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents collection of metric definitions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceUri, String metricnamespace, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceUri, metricnamespace, context)); - } - - /** - * Lists the metric definitions for the resource. - * - * @param resourceUri The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents collection of metric definitions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceUri) { - final String metricnamespace = null; - return new PagedIterable<>(listAsync(resourceUri, metricnamespace)); - } - - /** - * Lists the metric definitions for the resource. - * - * @param resourceUri The identifier of the resource. - * @param metricnamespace Metric namespace to query metric definitions for. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents collection of metric definitions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceUri, String metricnamespace, Context context) { - return new PagedIterable<>(listAsync(resourceUri, metricnamespace, context)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricDefinitionsImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricDefinitionsImpl.java deleted file mode 100644 index 2b1565942286..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricDefinitionsImpl.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.monitor.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.monitor.MonitorManager; -import com.azure.resourcemanager.monitor.models.MetricDefinition; -import com.azure.resourcemanager.monitor.models.MetricDefinitions; -import com.azure.resourcemanager.monitor.fluent.MetricDefinitionsClient; -import com.azure.resourcemanager.resources.fluentcore.utils.PagedConverter; - -/** Implementation for {@link MetricDefinitions}. */ -public class MetricDefinitionsImpl implements MetricDefinitions { - - private final MonitorManager myManager; - - public MetricDefinitionsImpl(final MonitorManager monitorManager) { - this.myManager = monitorManager; - } - - @Override - public MonitorManager manager() { - return this.myManager; - } - - public MetricDefinitionsClient inner() { - return this.myManager.serviceClient().getMetricDefinitions(); - } - - @Override - public PagedIterable listByResource(String resourceId) { - return PagedConverter.mapPage(this.inner().list(resourceId), inner -> new MetricDefinitionImpl(inner, myManager)); - } - - @Override - public PagedFlux listByResourceAsync(String resourceId) { - return PagedConverter.mapPage(this.inner().listAsync(resourceId), inner -> new MetricDefinitionImpl(inner, myManager)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricDynamicAlertConditionImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricDynamicAlertConditionImpl.java deleted file mode 100644 index 0d2e4c1b0c5e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricDynamicAlertConditionImpl.java +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.monitor.implementation; - -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.models.AggregationTypeEnum; -import com.azure.resourcemanager.monitor.models.DynamicMetricCriteria; -import com.azure.resourcemanager.monitor.models.DynamicThresholdFailingPeriods; -import com.azure.resourcemanager.monitor.models.DynamicThresholdOperator; -import com.azure.resourcemanager.monitor.models.DynamicThresholdSensitivity; -import com.azure.resourcemanager.monitor.models.MetricAlert; -import com.azure.resourcemanager.monitor.models.MetricAlertRuleTimeAggregation; -import com.azure.resourcemanager.monitor.models.MetricDynamicAlertCondition; -import java.time.OffsetDateTime; -import java.util.ArrayList; - -class MetricDynamicAlertConditionImpl - extends MetricAlertConditionBaseImpl - implements MetricDynamicAlertCondition, - MetricDynamicAlertCondition.DefinitionStages, - MetricDynamicAlertCondition.DefinitionStages.Blank.MetricName, - MetricDynamicAlertCondition.DefinitionStages.WithCriteriaOperator, - MetricDynamicAlertCondition.DefinitionStages.WithFailingPeriods, - MetricDynamicAlertCondition.DefinitionStages.WithConditionAttach, - MetricDynamicAlertCondition.UpdateDefinitionStages, - MetricDynamicAlertCondition.UpdateDefinitionStages.Blank.MetricName, - MetricDynamicAlertCondition.UpdateDefinitionStages.WithCriteriaOperator, - MetricDynamicAlertCondition.UpdateDefinitionStages.WithFailingPeriods, - MetricDynamicAlertCondition.UpdateDefinitionStages.WithConditionAttach, - MetricDynamicAlertCondition.UpdateStages { - - private final ClientLogger logger = new ClientLogger(getClass()); - - MetricDynamicAlertConditionImpl(String name, DynamicMetricCriteria innerObject, MetricAlertImpl parent) { - super(name, innerObject, parent); - } - - @Override - public DynamicThresholdOperator condition() { - return DynamicThresholdOperator.fromString(this.innerModel().operator().toString()); - } - - @Override - public DynamicThresholdSensitivity alertSensitivity() { - return DynamicThresholdSensitivity.fromString(this.innerModel().alertSensitivity().toString()); - } - - @Override - public DynamicThresholdFailingPeriods failingPeriods() { - return this.innerModel().failingPeriods(); - } - - @Override - public OffsetDateTime ignoreDataBefore() { - return this.innerModel().ignoreDataBefore(); - } - - @Override - public MetricAlertImpl attach() { - this.innerModel().withDimensions(new ArrayList<>(this.dimensions.values())); - return this.parent().withDynamicAlertCriteria(this); - } - - @Override - public MetricDynamicAlertConditionImpl withCondition( - MetricAlertRuleTimeAggregation timeAggregation, - DynamicThresholdOperator condition, - DynamicThresholdSensitivity alertSensitivity) { - this.innerModel().withOperator(condition); - this.innerModel().withTimeAggregation(AggregationTypeEnum.fromString(timeAggregation.toString())); - this.innerModel().withAlertSensitivity(alertSensitivity); - return this; - } - - @Override - public MetricDynamicAlertConditionImpl withFailingPeriods(DynamicThresholdFailingPeriods failingPeriods) { - if (failingPeriods.minFailingPeriodsToAlert() > failingPeriods.numberOfEvaluationPeriods()) { - throw logger.logExceptionAsError(new IllegalArgumentException( - "The number of evaluation periods should be greater than or equal to the number of failing periods")); - } - - this.innerModel().withFailingPeriods(failingPeriods); - return this; - } - - @Override - public MetricDynamicAlertConditionImpl withIgnoreDataBefore(OffsetDateTime date) { - this.innerModel().withIgnoreDataBefore(date); - return this; - } - - @Override - public MetricDynamicAlertConditionImpl withoutIgnoreDataBefore() { - this.innerModel().withIgnoreDataBefore(null); - return this; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricImpl.java deleted file mode 100644 index c9607ed814c4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.monitor.implementation; - -import com.azure.resourcemanager.monitor.models.LocalizableString; -import com.azure.resourcemanager.monitor.models.Metric; -import com.azure.resourcemanager.monitor.models.Unit; -import com.azure.resourcemanager.monitor.models.TimeSeriesElement; -import com.azure.resourcemanager.monitor.fluent.models.MetricInner; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.WrapperImpl; -import java.util.List; - -/** The Azure {@link Metric} wrapper class implementation. */ -class MetricImpl extends WrapperImpl implements Metric { - private LocalizableString metricName; - - MetricImpl(MetricInner innerObject) { - super(innerObject); - this.metricName = (innerModel().name() == null) ? null : new LocalizableStringImpl(innerModel().name()); - } - - @Override - public String id() { - return this.innerModel().id(); - } - - @Override - public String type() { - return this.innerModel().type(); - } - - @Override - public LocalizableString name() { - return this.metricName; - } - - @Override - public Unit unit() { - return this.innerModel().unit(); - } - - @Override - public List timeseries() { - return this.innerModel().timeseries(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricNamespacesClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricNamespacesClientImpl.java deleted file mode 100644 index b876969fc9d3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricNamespacesClientImpl.java +++ /dev/null @@ -1,218 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.fluent.MetricNamespacesClient; -import com.azure.resourcemanager.monitor.fluent.models.MetricNamespaceInner; -import com.azure.resourcemanager.monitor.models.MetricNamespaceCollection; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in MetricNamespacesClient. */ -public final class MetricNamespacesClientImpl implements MetricNamespacesClient { - private final ClientLogger logger = new ClientLogger(MetricNamespacesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final MetricNamespacesService service; - - /** The service client containing this operation class. */ - private final MonitorClientImpl client; - - /** - * Initializes an instance of MetricNamespacesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - MetricNamespacesClientImpl(MonitorClientImpl client) { - this.service = - RestProxy.create(MetricNamespacesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MonitorClientMetricNamespaces to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MonitorClientMetricN") - private interface MetricNamespacesService { - @Headers({"Content-Type: application/json"}) - @Get("/{resourceUri}/providers/microsoft.insights/metricNamespaces") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam(value = "resourceUri", encoded = true) String resourceUri, - @QueryParam("api-version") String apiVersion, - @QueryParam("startTime") String startTime, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Lists the metric namespaces for the resource. - * - * @param resourceUri The identifier of the resource. - * @param startTime The ISO 8601 conform Date start time from which to query for metric namespaces. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents collection of metric namespaces. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceUri, String startTime) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceUri == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); - } - final String apiVersion = "2017-12-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.list(this.client.getEndpoint(), resourceUri, apiVersion, startTime, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists the metric namespaces for the resource. - * - * @param resourceUri The identifier of the resource. - * @param startTime The ISO 8601 conform Date start time from which to query for metric namespaces. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents collection of metric namespaces. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceUri, String startTime, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceUri == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); - } - final String apiVersion = "2017-12-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), resourceUri, apiVersion, startTime, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); - } - - /** - * Lists the metric namespaces for the resource. - * - * @param resourceUri The identifier of the resource. - * @param startTime The ISO 8601 conform Date start time from which to query for metric namespaces. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents collection of metric namespaces. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String resourceUri, String startTime) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceUri, startTime)); - } - - /** - * Lists the metric namespaces for the resource. - * - * @param resourceUri The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents collection of metric namespaces. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String resourceUri) { - final String startTime = null; - return new PagedFlux<>(() -> listSinglePageAsync(resourceUri, startTime)); - } - - /** - * Lists the metric namespaces for the resource. - * - * @param resourceUri The identifier of the resource. - * @param startTime The ISO 8601 conform Date start time from which to query for metric namespaces. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents collection of metric namespaces. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceUri, String startTime, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceUri, startTime, context)); - } - - /** - * Lists the metric namespaces for the resource. - * - * @param resourceUri The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents collection of metric namespaces. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceUri) { - final String startTime = null; - return new PagedIterable<>(listAsync(resourceUri, startTime)); - } - - /** - * Lists the metric namespaces for the resource. - * - * @param resourceUri The identifier of the resource. - * @param startTime The ISO 8601 conform Date start time from which to query for metric namespaces. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents collection of metric namespaces. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceUri, String startTime, Context context) { - return new PagedIterable<>(listAsync(resourceUri, startTime, context)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricsClientImpl.java deleted file mode 100644 index 2650511fa7b8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricsClientImpl.java +++ /dev/null @@ -1,428 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.fluent.MetricsClient; -import com.azure.resourcemanager.monitor.fluent.models.ResponseInner; -import com.azure.resourcemanager.monitor.models.ResultType; -import java.time.Duration; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in MetricsClient. */ -public final class MetricsClientImpl implements MetricsClient { - private final ClientLogger logger = new ClientLogger(MetricsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final MetricsService service; - - /** The service client containing this operation class. */ - private final MonitorClientImpl client; - - /** - * Initializes an instance of MetricsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - MetricsClientImpl(MonitorClientImpl client) { - this.service = RestProxy.create(MetricsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MonitorClientMetrics to be used by the proxy service to perform REST - * calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MonitorClientMetrics") - private interface MetricsService { - @Headers({"Content-Type: application/json"}) - @Get("/{resourceUri}/providers/Microsoft.Insights/metrics") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam(value = "resourceUri", encoded = true) String resourceUri, - @QueryParam("timespan") String timespan, - @QueryParam("interval") Duration interval, - @QueryParam("metricnames") String metricnames, - @QueryParam("aggregation") String aggregation, - @QueryParam("top") Integer top, - @QueryParam("orderby") String orderby, - @QueryParam("$filter") String filter, - @QueryParam("resultType") ResultType resultType, - @QueryParam("api-version") String apiVersion, - @QueryParam("metricnamespace") String metricnamespace, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * **Lists the metric values for a resource**. - * - * @param resourceUri The identifier of the resource. - * @param timespan The timespan of the query. It is a string with the following format - * 'startDateTime_ISO/endDateTime_ISO'. - * @param interval The interval (i.e. timegrain) of the query. - * @param metricnames The names of the metrics (comma separated) to retrieve. Special case: If a metricname itself - * has a comma in it then use %2 to indicate it. Eg: 'Metric,Name1' should be **'Metric%2Name1'**. - * @param aggregation The list of aggregation types (comma separated) to retrieve. - * @param top The maximum number of records to retrieve. Valid only if $filter is specified. Defaults to 10. - * @param orderby The aggregation to use for sorting results and the direction of the sort. Only one order can be - * specified. Examples: sum asc. - * @param filter The **$filter** is used to reduce the set of metric data returned. Example: Metric contains - * metadata A, B and C. - Return all time series of C where A = a1 and B = b1 or b2 **$filter=A eq 'a1' and B eq - * 'b1' or B eq 'b2' and C eq '*'** - Invalid variant: **$filter=A eq 'a1' and B eq 'b1' and C eq '*' or B = - * 'b2'** This is invalid because the logical or operator cannot separate two different metadata names. - Return - * all time series where A = a1, B = b1 and C = c1: **$filter=A eq 'a1' and B eq 'b1' and C eq 'c1'** - Return - * all time series where A = a1 **$filter=A eq 'a1' and B eq '*' and C eq '*'**. Special case: When dimension - * name or dimension value uses round brackets. Eg: When dimension name is **dim (test) 1** Instead of using - * $filter= "dim (test) 1 eq '*' " use **$filter= "dim %2528test%2529 1 eq '*' "** When dimension name is **dim - * (test) 3** and dimension value is **dim3 (test) val** Instead of using $filter= "dim (test) 3 eq 'dim3 (test) - * val' " use **$filter= "dim %2528test%2529 3 eq 'dim3 %2528test%2529 val' "**. - * @param resultType Reduces the set of data collected. The syntax allowed depends on the operation. See the - * operation's description for details. - * @param metricnamespace Metric namespace to query metric definitions for. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a metrics query. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listWithResponseAsync( - String resourceUri, - String timespan, - Duration interval, - String metricnames, - String aggregation, - Integer top, - String orderby, - String filter, - ResultType resultType, - String metricnamespace) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceUri == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); - } - final String apiVersion = "2018-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - resourceUri, - timespan, - interval, - metricnames, - aggregation, - top, - orderby, - filter, - resultType, - apiVersion, - metricnamespace, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * **Lists the metric values for a resource**. - * - * @param resourceUri The identifier of the resource. - * @param timespan The timespan of the query. It is a string with the following format - * 'startDateTime_ISO/endDateTime_ISO'. - * @param interval The interval (i.e. timegrain) of the query. - * @param metricnames The names of the metrics (comma separated) to retrieve. Special case: If a metricname itself - * has a comma in it then use %2 to indicate it. Eg: 'Metric,Name1' should be **'Metric%2Name1'**. - * @param aggregation The list of aggregation types (comma separated) to retrieve. - * @param top The maximum number of records to retrieve. Valid only if $filter is specified. Defaults to 10. - * @param orderby The aggregation to use for sorting results and the direction of the sort. Only one order can be - * specified. Examples: sum asc. - * @param filter The **$filter** is used to reduce the set of metric data returned. Example: Metric contains - * metadata A, B and C. - Return all time series of C where A = a1 and B = b1 or b2 **$filter=A eq 'a1' and B eq - * 'b1' or B eq 'b2' and C eq '*'** - Invalid variant: **$filter=A eq 'a1' and B eq 'b1' and C eq '*' or B = - * 'b2'** This is invalid because the logical or operator cannot separate two different metadata names. - Return - * all time series where A = a1, B = b1 and C = c1: **$filter=A eq 'a1' and B eq 'b1' and C eq 'c1'** - Return - * all time series where A = a1 **$filter=A eq 'a1' and B eq '*' and C eq '*'**. Special case: When dimension - * name or dimension value uses round brackets. Eg: When dimension name is **dim (test) 1** Instead of using - * $filter= "dim (test) 1 eq '*' " use **$filter= "dim %2528test%2529 1 eq '*' "** When dimension name is **dim - * (test) 3** and dimension value is **dim3 (test) val** Instead of using $filter= "dim (test) 3 eq 'dim3 (test) - * val' " use **$filter= "dim %2528test%2529 3 eq 'dim3 %2528test%2529 val' "**. - * @param resultType Reduces the set of data collected. The syntax allowed depends on the operation. See the - * operation's description for details. - * @param metricnamespace Metric namespace to query metric definitions for. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a metrics query. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync( - String resourceUri, - String timespan, - Duration interval, - String metricnames, - String aggregation, - Integer top, - String orderby, - String filter, - ResultType resultType, - String metricnamespace, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceUri == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); - } - final String apiVersion = "2018-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - resourceUri, - timespan, - interval, - metricnames, - aggregation, - top, - orderby, - filter, - resultType, - apiVersion, - metricnamespace, - accept, - context); - } - - /** - * **Lists the metric values for a resource**. - * - * @param resourceUri The identifier of the resource. - * @param timespan The timespan of the query. It is a string with the following format - * 'startDateTime_ISO/endDateTime_ISO'. - * @param interval The interval (i.e. timegrain) of the query. - * @param metricnames The names of the metrics (comma separated) to retrieve. Special case: If a metricname itself - * has a comma in it then use %2 to indicate it. Eg: 'Metric,Name1' should be **'Metric%2Name1'**. - * @param aggregation The list of aggregation types (comma separated) to retrieve. - * @param top The maximum number of records to retrieve. Valid only if $filter is specified. Defaults to 10. - * @param orderby The aggregation to use for sorting results and the direction of the sort. Only one order can be - * specified. Examples: sum asc. - * @param filter The **$filter** is used to reduce the set of metric data returned. Example: Metric contains - * metadata A, B and C. - Return all time series of C where A = a1 and B = b1 or b2 **$filter=A eq 'a1' and B eq - * 'b1' or B eq 'b2' and C eq '*'** - Invalid variant: **$filter=A eq 'a1' and B eq 'b1' and C eq '*' or B = - * 'b2'** This is invalid because the logical or operator cannot separate two different metadata names. - Return - * all time series where A = a1, B = b1 and C = c1: **$filter=A eq 'a1' and B eq 'b1' and C eq 'c1'** - Return - * all time series where A = a1 **$filter=A eq 'a1' and B eq '*' and C eq '*'**. Special case: When dimension - * name or dimension value uses round brackets. Eg: When dimension name is **dim (test) 1** Instead of using - * $filter= "dim (test) 1 eq '*' " use **$filter= "dim %2528test%2529 1 eq '*' "** When dimension name is **dim - * (test) 3** and dimension value is **dim3 (test) val** Instead of using $filter= "dim (test) 3 eq 'dim3 (test) - * val' " use **$filter= "dim %2528test%2529 3 eq 'dim3 %2528test%2529 val' "**. - * @param resultType Reduces the set of data collected. The syntax allowed depends on the operation. See the - * operation's description for details. - * @param metricnamespace Metric namespace to query metric definitions for. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a metrics query. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listAsync( - String resourceUri, - String timespan, - Duration interval, - String metricnames, - String aggregation, - Integer top, - String orderby, - String filter, - ResultType resultType, - String metricnamespace) { - return listWithResponseAsync( - resourceUri, - timespan, - interval, - metricnames, - aggregation, - top, - orderby, - filter, - resultType, - metricnamespace) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * **Lists the metric values for a resource**. - * - * @param resourceUri The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a metrics query. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listAsync(String resourceUri) { - final String timespan = null; - final Duration interval = null; - final String metricnames = null; - final String aggregation = null; - final Integer top = null; - final String orderby = null; - final String filter = null; - final ResultType resultType = null; - final String metricnamespace = null; - return listWithResponseAsync( - resourceUri, - timespan, - interval, - metricnames, - aggregation, - top, - orderby, - filter, - resultType, - metricnamespace) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * **Lists the metric values for a resource**. - * - * @param resourceUri The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a metrics query. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseInner list(String resourceUri) { - final String timespan = null; - final Duration interval = null; - final String metricnames = null; - final String aggregation = null; - final Integer top = null; - final String orderby = null; - final String filter = null; - final ResultType resultType = null; - final String metricnamespace = null; - return listAsync( - resourceUri, - timespan, - interval, - metricnames, - aggregation, - top, - orderby, - filter, - resultType, - metricnamespace) - .block(); - } - - /** - * **Lists the metric values for a resource**. - * - * @param resourceUri The identifier of the resource. - * @param timespan The timespan of the query. It is a string with the following format - * 'startDateTime_ISO/endDateTime_ISO'. - * @param interval The interval (i.e. timegrain) of the query. - * @param metricnames The names of the metrics (comma separated) to retrieve. Special case: If a metricname itself - * has a comma in it then use %2 to indicate it. Eg: 'Metric,Name1' should be **'Metric%2Name1'**. - * @param aggregation The list of aggregation types (comma separated) to retrieve. - * @param top The maximum number of records to retrieve. Valid only if $filter is specified. Defaults to 10. - * @param orderby The aggregation to use for sorting results and the direction of the sort. Only one order can be - * specified. Examples: sum asc. - * @param filter The **$filter** is used to reduce the set of metric data returned. Example: Metric contains - * metadata A, B and C. - Return all time series of C where A = a1 and B = b1 or b2 **$filter=A eq 'a1' and B eq - * 'b1' or B eq 'b2' and C eq '*'** - Invalid variant: **$filter=A eq 'a1' and B eq 'b1' and C eq '*' or B = - * 'b2'** This is invalid because the logical or operator cannot separate two different metadata names. - Return - * all time series where A = a1, B = b1 and C = c1: **$filter=A eq 'a1' and B eq 'b1' and C eq 'c1'** - Return - * all time series where A = a1 **$filter=A eq 'a1' and B eq '*' and C eq '*'**. Special case: When dimension - * name or dimension value uses round brackets. Eg: When dimension name is **dim (test) 1** Instead of using - * $filter= "dim (test) 1 eq '*' " use **$filter= "dim %2528test%2529 1 eq '*' "** When dimension name is **dim - * (test) 3** and dimension value is **dim3 (test) val** Instead of using $filter= "dim (test) 3 eq 'dim3 (test) - * val' " use **$filter= "dim %2528test%2529 3 eq 'dim3 %2528test%2529 val' "**. - * @param resultType Reduces the set of data collected. The syntax allowed depends on the operation. See the - * operation's description for details. - * @param metricnamespace Metric namespace to query metric definitions for. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a metrics query. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse( - String resourceUri, - String timespan, - Duration interval, - String metricnames, - String aggregation, - Integer top, - String orderby, - String filter, - ResultType resultType, - String metricnamespace, - Context context) { - return listWithResponseAsync( - resourceUri, - timespan, - interval, - metricnames, - aggregation, - top, - orderby, - filter, - resultType, - metricnamespace, - context) - .block(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MonitorClientBuilder.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MonitorClientBuilder.java deleted file mode 100644 index fc95b3561da6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MonitorClientBuilder.java +++ /dev/null @@ -1,146 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.implementation; - -import com.azure.core.annotation.ServiceClientBuilder; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.policy.CookiePolicy; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerAdapter; -import java.time.Duration; - -/** A builder for creating a new instance of the MonitorClientImpl type. */ -@ServiceClientBuilder(serviceClients = {MonitorClientImpl.class}) -public final class MonitorClientBuilder { - /* - * The ID of the target subscription. - */ - private String subscriptionId; - - /** - * Sets The ID of the target subscription. - * - * @param subscriptionId the subscriptionId value. - * @return the MonitorClientBuilder. - */ - public MonitorClientBuilder subscriptionId(String subscriptionId) { - this.subscriptionId = subscriptionId; - return this; - } - - /* - * server parameter - */ - private String endpoint; - - /** - * Sets server parameter. - * - * @param endpoint the endpoint value. - * @return the MonitorClientBuilder. - */ - public MonitorClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * The environment to connect to - */ - private AzureEnvironment environment; - - /** - * Sets The environment to connect to. - * - * @param environment the environment value. - * @return the MonitorClientBuilder. - */ - public MonitorClientBuilder environment(AzureEnvironment environment) { - this.environment = environment; - return this; - } - - /* - * The default poll interval for long-running operation - */ - private Duration defaultPollInterval; - - /** - * Sets The default poll interval for long-running operation. - * - * @param defaultPollInterval the defaultPollInterval value. - * @return the MonitorClientBuilder. - */ - public MonitorClientBuilder defaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = defaultPollInterval; - return this; - } - - /* - * The HTTP pipeline to send requests through - */ - private HttpPipeline pipeline; - - /** - * Sets The HTTP pipeline to send requests through. - * - * @param pipeline the pipeline value. - * @return the MonitorClientBuilder. - */ - public MonitorClientBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; - return this; - } - - /* - * The serializer to serialize an object into a string - */ - private SerializerAdapter serializerAdapter; - - /** - * Sets The serializer to serialize an object into a string. - * - * @param serializerAdapter the serializerAdapter value. - * @return the MonitorClientBuilder. - */ - public MonitorClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { - this.serializerAdapter = serializerAdapter; - return this; - } - - /** - * Builds an instance of MonitorClientImpl with the provided parameters. - * - * @return an instance of MonitorClientImpl. - */ - public MonitorClientImpl buildClient() { - if (endpoint == null) { - this.endpoint = "https://management.azure.com"; - } - if (environment == null) { - this.environment = AzureEnvironment.AZURE; - } - if (defaultPollInterval == null) { - this.defaultPollInterval = Duration.ofSeconds(30); - } - if (pipeline == null) { - this.pipeline = - new HttpPipelineBuilder() - .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) - .build(); - } - if (serializerAdapter == null) { - this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); - } - MonitorClientImpl client = - new MonitorClientImpl( - pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); - return client; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MonitorClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MonitorClientImpl.java deleted file mode 100644 index 77a4bd85c284..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MonitorClientImpl.java +++ /dev/null @@ -1,497 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.implementation; - -import com.azure.core.annotation.ServiceClient; -import com.azure.core.http.HttpPipeline; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.serializer.SerializerAdapter; -import com.azure.resourcemanager.monitor.fluent.ActionGroupsClient; -import com.azure.resourcemanager.monitor.fluent.ActivityLogAlertsClient; -import com.azure.resourcemanager.monitor.fluent.ActivityLogsClient; -import com.azure.resourcemanager.monitor.fluent.AlertRuleIncidentsClient; -import com.azure.resourcemanager.monitor.fluent.AlertRulesClient; -import com.azure.resourcemanager.monitor.fluent.AutoscaleSettingsClient; -import com.azure.resourcemanager.monitor.fluent.BaselinesClient; -import com.azure.resourcemanager.monitor.fluent.DataCollectionEndpointsClient; -import com.azure.resourcemanager.monitor.fluent.DataCollectionRuleAssociationsClient; -import com.azure.resourcemanager.monitor.fluent.DataCollectionRulesClient; -import com.azure.resourcemanager.monitor.fluent.DiagnosticSettingsCategoriesClient; -import com.azure.resourcemanager.monitor.fluent.DiagnosticSettingsClient; -import com.azure.resourcemanager.monitor.fluent.EventCategoriesClient; -import com.azure.resourcemanager.monitor.fluent.LogProfilesClient; -import com.azure.resourcemanager.monitor.fluent.MetricAlertsClient; -import com.azure.resourcemanager.monitor.fluent.MetricAlertsStatusClient; -import com.azure.resourcemanager.monitor.fluent.MetricDefinitionsClient; -import com.azure.resourcemanager.monitor.fluent.MetricNamespacesClient; -import com.azure.resourcemanager.monitor.fluent.MetricsClient; -import com.azure.resourcemanager.monitor.fluent.MonitorClient; -import com.azure.resourcemanager.monitor.fluent.OperationsClient; -import com.azure.resourcemanager.monitor.fluent.PrivateEndpointConnectionsClient; -import com.azure.resourcemanager.monitor.fluent.PrivateLinkResourcesClient; -import com.azure.resourcemanager.monitor.fluent.PrivateLinkScopeOperationStatusClient; -import com.azure.resourcemanager.monitor.fluent.PrivateLinkScopedResourcesClient; -import com.azure.resourcemanager.monitor.fluent.PrivateLinkScopesClient; -import com.azure.resourcemanager.monitor.fluent.ScheduledQueryRulesClient; -import com.azure.resourcemanager.monitor.fluent.TenantActivityLogsClient; -import com.azure.resourcemanager.monitor.fluent.VMInsightsClient; -import com.azure.resourcemanager.resources.fluentcore.AzureServiceClient; -import java.time.Duration; - -/** Initializes a new instance of the MonitorClientImpl type. */ -@ServiceClient(builder = MonitorClientBuilder.class) -public final class MonitorClientImpl extends AzureServiceClient implements MonitorClient { - private final ClientLogger logger = new ClientLogger(MonitorClientImpl.class); - - /** The ID of the target subscription. */ - private final String subscriptionId; - - /** - * Gets The ID of the target subscription. - * - * @return the subscriptionId value. - */ - public String getSubscriptionId() { - return this.subscriptionId; - } - - /** server parameter. */ - private final String endpoint; - - /** - * Gets server parameter. - * - * @return the endpoint value. - */ - public String getEndpoint() { - return this.endpoint; - } - - /** The HTTP pipeline to send requests through. */ - private final HttpPipeline httpPipeline; - - /** - * Gets The HTTP pipeline to send requests through. - * - * @return the httpPipeline value. - */ - public HttpPipeline getHttpPipeline() { - return this.httpPipeline; - } - - /** The serializer to serialize an object into a string. */ - private final SerializerAdapter serializerAdapter; - - /** - * Gets The serializer to serialize an object into a string. - * - * @return the serializerAdapter value. - */ - SerializerAdapter getSerializerAdapter() { - return this.serializerAdapter; - } - - /** The default poll interval for long-running operation. */ - private final Duration defaultPollInterval; - - /** - * Gets The default poll interval for long-running operation. - * - * @return the defaultPollInterval value. - */ - public Duration getDefaultPollInterval() { - return this.defaultPollInterval; - } - - /** The AutoscaleSettingsClient object to access its operations. */ - private final AutoscaleSettingsClient autoscaleSettings; - - /** - * Gets the AutoscaleSettingsClient object to access its operations. - * - * @return the AutoscaleSettingsClient object. - */ - public AutoscaleSettingsClient getAutoscaleSettings() { - return this.autoscaleSettings; - } - - /** The OperationsClient object to access its operations. */ - private final OperationsClient operations; - - /** - * Gets the OperationsClient object to access its operations. - * - * @return the OperationsClient object. - */ - public OperationsClient getOperations() { - return this.operations; - } - - /** The AlertRuleIncidentsClient object to access its operations. */ - private final AlertRuleIncidentsClient alertRuleIncidents; - - /** - * Gets the AlertRuleIncidentsClient object to access its operations. - * - * @return the AlertRuleIncidentsClient object. - */ - public AlertRuleIncidentsClient getAlertRuleIncidents() { - return this.alertRuleIncidents; - } - - /** The AlertRulesClient object to access its operations. */ - private final AlertRulesClient alertRules; - - /** - * Gets the AlertRulesClient object to access its operations. - * - * @return the AlertRulesClient object. - */ - public AlertRulesClient getAlertRules() { - return this.alertRules; - } - - /** The LogProfilesClient object to access its operations. */ - private final LogProfilesClient logProfiles; - - /** - * Gets the LogProfilesClient object to access its operations. - * - * @return the LogProfilesClient object. - */ - public LogProfilesClient getLogProfiles() { - return this.logProfiles; - } - - /** The DiagnosticSettingsClient object to access its operations. */ - private final DiagnosticSettingsClient diagnosticSettings; - - /** - * Gets the DiagnosticSettingsClient object to access its operations. - * - * @return the DiagnosticSettingsClient object. - */ - public DiagnosticSettingsClient getDiagnosticSettings() { - return this.diagnosticSettings; - } - - /** The DiagnosticSettingsCategoriesClient object to access its operations. */ - private final DiagnosticSettingsCategoriesClient diagnosticSettingsCategories; - - /** - * Gets the DiagnosticSettingsCategoriesClient object to access its operations. - * - * @return the DiagnosticSettingsCategoriesClient object. - */ - public DiagnosticSettingsCategoriesClient getDiagnosticSettingsCategories() { - return this.diagnosticSettingsCategories; - } - - /** The ActionGroupsClient object to access its operations. */ - private final ActionGroupsClient actionGroups; - - /** - * Gets the ActionGroupsClient object to access its operations. - * - * @return the ActionGroupsClient object. - */ - public ActionGroupsClient getActionGroups() { - return this.actionGroups; - } - - /** The ActivityLogsClient object to access its operations. */ - private final ActivityLogsClient activityLogs; - - /** - * Gets the ActivityLogsClient object to access its operations. - * - * @return the ActivityLogsClient object. - */ - public ActivityLogsClient getActivityLogs() { - return this.activityLogs; - } - - /** The EventCategoriesClient object to access its operations. */ - private final EventCategoriesClient eventCategories; - - /** - * Gets the EventCategoriesClient object to access its operations. - * - * @return the EventCategoriesClient object. - */ - public EventCategoriesClient getEventCategories() { - return this.eventCategories; - } - - /** The TenantActivityLogsClient object to access its operations. */ - private final TenantActivityLogsClient tenantActivityLogs; - - /** - * Gets the TenantActivityLogsClient object to access its operations. - * - * @return the TenantActivityLogsClient object. - */ - public TenantActivityLogsClient getTenantActivityLogs() { - return this.tenantActivityLogs; - } - - /** The MetricDefinitionsClient object to access its operations. */ - private final MetricDefinitionsClient metricDefinitions; - - /** - * Gets the MetricDefinitionsClient object to access its operations. - * - * @return the MetricDefinitionsClient object. - */ - public MetricDefinitionsClient getMetricDefinitions() { - return this.metricDefinitions; - } - - /** The MetricsClient object to access its operations. */ - private final MetricsClient metrics; - - /** - * Gets the MetricsClient object to access its operations. - * - * @return the MetricsClient object. - */ - public MetricsClient getMetrics() { - return this.metrics; - } - - /** The BaselinesClient object to access its operations. */ - private final BaselinesClient baselines; - - /** - * Gets the BaselinesClient object to access its operations. - * - * @return the BaselinesClient object. - */ - public BaselinesClient getBaselines() { - return this.baselines; - } - - /** The MetricAlertsClient object to access its operations. */ - private final MetricAlertsClient metricAlerts; - - /** - * Gets the MetricAlertsClient object to access its operations. - * - * @return the MetricAlertsClient object. - */ - public MetricAlertsClient getMetricAlerts() { - return this.metricAlerts; - } - - /** The MetricAlertsStatusClient object to access its operations. */ - private final MetricAlertsStatusClient metricAlertsStatus; - - /** - * Gets the MetricAlertsStatusClient object to access its operations. - * - * @return the MetricAlertsStatusClient object. - */ - public MetricAlertsStatusClient getMetricAlertsStatus() { - return this.metricAlertsStatus; - } - - /** The ScheduledQueryRulesClient object to access its operations. */ - private final ScheduledQueryRulesClient scheduledQueryRules; - - /** - * Gets the ScheduledQueryRulesClient object to access its operations. - * - * @return the ScheduledQueryRulesClient object. - */ - public ScheduledQueryRulesClient getScheduledQueryRules() { - return this.scheduledQueryRules; - } - - /** The MetricNamespacesClient object to access its operations. */ - private final MetricNamespacesClient metricNamespaces; - - /** - * Gets the MetricNamespacesClient object to access its operations. - * - * @return the MetricNamespacesClient object. - */ - public MetricNamespacesClient getMetricNamespaces() { - return this.metricNamespaces; - } - - /** The VMInsightsClient object to access its operations. */ - private final VMInsightsClient vMInsights; - - /** - * Gets the VMInsightsClient object to access its operations. - * - * @return the VMInsightsClient object. - */ - public VMInsightsClient getVMInsights() { - return this.vMInsights; - } - - /** The PrivateLinkScopesClient object to access its operations. */ - private final PrivateLinkScopesClient privateLinkScopes; - - /** - * Gets the PrivateLinkScopesClient object to access its operations. - * - * @return the PrivateLinkScopesClient object. - */ - public PrivateLinkScopesClient getPrivateLinkScopes() { - return this.privateLinkScopes; - } - - /** The PrivateLinkScopeOperationStatusClient object to access its operations. */ - private final PrivateLinkScopeOperationStatusClient privateLinkScopeOperationStatus; - - /** - * Gets the PrivateLinkScopeOperationStatusClient object to access its operations. - * - * @return the PrivateLinkScopeOperationStatusClient object. - */ - public PrivateLinkScopeOperationStatusClient getPrivateLinkScopeOperationStatus() { - return this.privateLinkScopeOperationStatus; - } - - /** The PrivateLinkResourcesClient object to access its operations. */ - private final PrivateLinkResourcesClient privateLinkResources; - - /** - * Gets the PrivateLinkResourcesClient object to access its operations. - * - * @return the PrivateLinkResourcesClient object. - */ - public PrivateLinkResourcesClient getPrivateLinkResources() { - return this.privateLinkResources; - } - - /** The PrivateEndpointConnectionsClient object to access its operations. */ - private final PrivateEndpointConnectionsClient privateEndpointConnections; - - /** - * Gets the PrivateEndpointConnectionsClient object to access its operations. - * - * @return the PrivateEndpointConnectionsClient object. - */ - public PrivateEndpointConnectionsClient getPrivateEndpointConnections() { - return this.privateEndpointConnections; - } - - /** The PrivateLinkScopedResourcesClient object to access its operations. */ - private final PrivateLinkScopedResourcesClient privateLinkScopedResources; - - /** - * Gets the PrivateLinkScopedResourcesClient object to access its operations. - * - * @return the PrivateLinkScopedResourcesClient object. - */ - public PrivateLinkScopedResourcesClient getPrivateLinkScopedResources() { - return this.privateLinkScopedResources; - } - - /** The ActivityLogAlertsClient object to access its operations. */ - private final ActivityLogAlertsClient activityLogAlerts; - - /** - * Gets the ActivityLogAlertsClient object to access its operations. - * - * @return the ActivityLogAlertsClient object. - */ - public ActivityLogAlertsClient getActivityLogAlerts() { - return this.activityLogAlerts; - } - - /** The DataCollectionEndpointsClient object to access its operations. */ - private final DataCollectionEndpointsClient dataCollectionEndpoints; - - /** - * Gets the DataCollectionEndpointsClient object to access its operations. - * - * @return the DataCollectionEndpointsClient object. - */ - public DataCollectionEndpointsClient getDataCollectionEndpoints() { - return this.dataCollectionEndpoints; - } - - /** The DataCollectionRuleAssociationsClient object to access its operations. */ - private final DataCollectionRuleAssociationsClient dataCollectionRuleAssociations; - - /** - * Gets the DataCollectionRuleAssociationsClient object to access its operations. - * - * @return the DataCollectionRuleAssociationsClient object. - */ - public DataCollectionRuleAssociationsClient getDataCollectionRuleAssociations() { - return this.dataCollectionRuleAssociations; - } - - /** The DataCollectionRulesClient object to access its operations. */ - private final DataCollectionRulesClient dataCollectionRules; - - /** - * Gets the DataCollectionRulesClient object to access its operations. - * - * @return the DataCollectionRulesClient object. - */ - public DataCollectionRulesClient getDataCollectionRules() { - return this.dataCollectionRules; - } - - /** - * Initializes an instance of MonitorClient client. - * - * @param httpPipeline The HTTP pipeline to send requests through. - * @param serializerAdapter The serializer to serialize an object into a string. - * @param defaultPollInterval The default poll interval for long-running operation. - * @param environment The Azure environment. - * @param subscriptionId The ID of the target subscription. - * @param endpoint server parameter. - */ - MonitorClientImpl( - HttpPipeline httpPipeline, - SerializerAdapter serializerAdapter, - Duration defaultPollInterval, - AzureEnvironment environment, - String subscriptionId, - String endpoint) { - super(httpPipeline, serializerAdapter, environment); - this.httpPipeline = httpPipeline; - this.serializerAdapter = serializerAdapter; - this.defaultPollInterval = defaultPollInterval; - this.subscriptionId = subscriptionId; - this.endpoint = endpoint; - this.autoscaleSettings = new AutoscaleSettingsClientImpl(this); - this.operations = new OperationsClientImpl(this); - this.alertRuleIncidents = new AlertRuleIncidentsClientImpl(this); - this.alertRules = new AlertRulesClientImpl(this); - this.logProfiles = new LogProfilesClientImpl(this); - this.diagnosticSettings = new DiagnosticSettingsClientImpl(this); - this.diagnosticSettingsCategories = new DiagnosticSettingsCategoriesClientImpl(this); - this.actionGroups = new ActionGroupsClientImpl(this); - this.activityLogs = new ActivityLogsClientImpl(this); - this.eventCategories = new EventCategoriesClientImpl(this); - this.tenantActivityLogs = new TenantActivityLogsClientImpl(this); - this.metricDefinitions = new MetricDefinitionsClientImpl(this); - this.metrics = new MetricsClientImpl(this); - this.baselines = new BaselinesClientImpl(this); - this.metricAlerts = new MetricAlertsClientImpl(this); - this.metricAlertsStatus = new MetricAlertsStatusClientImpl(this); - this.scheduledQueryRules = new ScheduledQueryRulesClientImpl(this); - this.metricNamespaces = new MetricNamespacesClientImpl(this); - this.vMInsights = new VMInsightsClientImpl(this); - this.privateLinkScopes = new PrivateLinkScopesClientImpl(this); - this.privateLinkScopeOperationStatus = new PrivateLinkScopeOperationStatusClientImpl(this); - this.privateLinkResources = new PrivateLinkResourcesClientImpl(this); - this.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(this); - this.privateLinkScopedResources = new PrivateLinkScopedResourcesClientImpl(this); - this.activityLogAlerts = new ActivityLogAlertsClientImpl(this); - this.dataCollectionEndpoints = new DataCollectionEndpointsClientImpl(this); - this.dataCollectionRuleAssociations = new DataCollectionRuleAssociationsClientImpl(this); - this.dataCollectionRules = new DataCollectionRulesClientImpl(this); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/OperationsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/OperationsClientImpl.java deleted file mode 100644 index 1935171d38ca..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/OperationsClientImpl.java +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.fluent.OperationsClient; -import com.azure.resourcemanager.monitor.fluent.models.OperationListResultInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in OperationsClient. */ -public final class OperationsClientImpl implements OperationsClient { - private final ClientLogger logger = new ClientLogger(OperationsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final OperationsService service; - - /** The service client containing this operation class. */ - private final MonitorClientImpl client; - - /** - * Initializes an instance of OperationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - OperationsClientImpl(MonitorClientImpl client) { - this.service = - RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MonitorClientOperations to be used by the proxy service to perform - * REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MonitorClientOperati") - private interface OperationsService { - @Headers({"Content-Type: application/json"}) - @Get("/providers/Microsoft.Insights/operations") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Lists all of the available operations from Microsoft.Insights provider. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Microsoft. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listWithResponseAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String apiVersion = "2015-04-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all of the available operations from Microsoft.Insights provider. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Microsoft. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String apiVersion = "2015-04-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), apiVersion, accept, context); - } - - /** - * Lists all of the available operations from Microsoft.Insights provider. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Microsoft. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listAsync() { - return listWithResponseAsync() - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Lists all of the available operations from Microsoft.Insights provider. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Microsoft. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public OperationListResultInner list() { - return listAsync().block(); - } - - /** - * Lists all of the available operations from Microsoft.Insights provider. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Microsoft. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse(Context context) { - return listWithResponseAsync(context).block(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/PrivateEndpointConnectionsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/PrivateEndpointConnectionsClientImpl.java deleted file mode 100644 index 36e46d7f935a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/PrivateEndpointConnectionsClientImpl.java +++ /dev/null @@ -1,1173 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.monitor.fluent.PrivateEndpointConnectionsClient; -import com.azure.resourcemanager.monitor.fluent.models.PrivateEndpointConnectionInner; -import com.azure.resourcemanager.monitor.models.PrivateEndpointConnectionListResult; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. */ -public final class PrivateEndpointConnectionsClientImpl implements PrivateEndpointConnectionsClient { - private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final PrivateEndpointConnectionsService service; - - /** The service client containing this operation class. */ - private final MonitorClientImpl client; - - /** - * Initializes an instance of PrivateEndpointConnectionsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - PrivateEndpointConnectionsClientImpl(MonitorClientImpl client) { - this.service = - RestProxy - .create( - PrivateEndpointConnectionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MonitorClientPrivateEndpointConnections to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MonitorClientPrivate") - private interface PrivateEndpointConnectionsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights" - + "/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("scopeName") String scopeName, - @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights" - + "/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("scopeName") String scopeName, - @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, - @BodyParam("application/json") PrivateEndpointConnectionInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights" - + "/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("scopeName") String scopeName, - @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights" - + "/privateLinkScopes/{scopeName}/privateEndpointConnections") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByPrivateLinkScope( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("scopeName") String scopeName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByPrivateLinkScopeNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets a private endpoint connection. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String resourceGroupName, String scopeName, String privateEndpointConnectionName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (scopeName == null) { - return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); - } - if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); - } - final String apiVersion = "2019-10-17-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - apiVersion, - scopeName, - privateEndpointConnectionName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a private endpoint connection. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String scopeName, String privateEndpointConnectionName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (scopeName == null) { - return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); - } - if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); - } - final String apiVersion = "2019-10-17-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - apiVersion, - scopeName, - privateEndpointConnectionName, - accept, - context); - } - - /** - * Gets a private endpoint connection. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync( - String resourceGroupName, String scopeName, String privateEndpointConnectionName) { - return getWithResponseAsync(resourceGroupName, scopeName, privateEndpointConnectionName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a private endpoint connection. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateEndpointConnectionInner get( - String resourceGroupName, String scopeName, String privateEndpointConnectionName) { - return getAsync(resourceGroupName, scopeName, privateEndpointConnectionName).block(); - } - - /** - * Gets a private endpoint connection. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String scopeName, String privateEndpointConnectionName, Context context) { - return getWithResponseAsync(resourceGroupName, scopeName, privateEndpointConnectionName, context).block(); - } - - /** - * Approve or reject a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param parameters A private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String scopeName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (scopeName == null) { - return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); - } - if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2019-10-17-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - apiVersion, - scopeName, - privateEndpointConnectionName, - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Approve or reject a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param parameters A private endpoint connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String scopeName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner parameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (scopeName == null) { - return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); - } - if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2019-10-17-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - apiVersion, - scopeName, - privateEndpointConnectionName, - parameters, - accept, - context); - } - - /** - * Approve or reject a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param parameters A private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, PrivateEndpointConnectionInner> - beginCreateOrUpdateAsync( - String resourceGroupName, - String scopeName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner parameters) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, scopeName, privateEndpointConnectionName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - PrivateEndpointConnectionInner.class, - PrivateEndpointConnectionInner.class, - Context.NONE); - } - - /** - * Approve or reject a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param parameters A private endpoint connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, PrivateEndpointConnectionInner> - beginCreateOrUpdateAsync( - String resourceGroupName, - String scopeName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner parameters, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync( - resourceGroupName, scopeName, privateEndpointConnectionName, parameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - PrivateEndpointConnectionInner.class, - PrivateEndpointConnectionInner.class, - context); - } - - /** - * Approve or reject a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param parameters A private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdate( - String resourceGroupName, - String scopeName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, scopeName, privateEndpointConnectionName, parameters) - .getSyncPoller(); - } - - /** - * Approve or reject a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param parameters A private endpoint connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdate( - String resourceGroupName, - String scopeName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner parameters, - Context context) { - return beginCreateOrUpdateAsync( - resourceGroupName, scopeName, privateEndpointConnectionName, parameters, context) - .getSyncPoller(); - } - - /** - * Approve or reject a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param parameters A private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, - String scopeName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, scopeName, privateEndpointConnectionName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Approve or reject a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param parameters A private endpoint connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, - String scopeName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner parameters, - Context context) { - return beginCreateOrUpdateAsync( - resourceGroupName, scopeName, privateEndpointConnectionName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Approve or reject a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param parameters A private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateEndpointConnectionInner createOrUpdate( - String resourceGroupName, - String scopeName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner parameters) { - return createOrUpdateAsync(resourceGroupName, scopeName, privateEndpointConnectionName, parameters).block(); - } - - /** - * Approve or reject a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param parameters A private endpoint connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateEndpointConnectionInner createOrUpdate( - String resourceGroupName, - String scopeName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner parameters, - Context context) { - return createOrUpdateAsync(resourceGroupName, scopeName, privateEndpointConnectionName, parameters, context) - .block(); - } - - /** - * Deletes a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync( - String resourceGroupName, String scopeName, String privateEndpointConnectionName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (scopeName == null) { - return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); - } - if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); - } - final String apiVersion = "2019-10-17-preview"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - apiVersion, - scopeName, - privateEndpointConnectionName, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String scopeName, String privateEndpointConnectionName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (scopeName == null) { - return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); - } - if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); - } - final String apiVersion = "2019-10-17-preview"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - apiVersion, - scopeName, - privateEndpointConnectionName, - context); - } - - /** - * Deletes a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String scopeName, String privateEndpointConnectionName) { - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, scopeName, privateEndpointConnectionName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deletes a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String scopeName, String privateEndpointConnectionName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, scopeName, privateEndpointConnectionName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String scopeName, String privateEndpointConnectionName) { - return beginDeleteAsync(resourceGroupName, scopeName, privateEndpointConnectionName).getSyncPoller(); - } - - /** - * Deletes a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String scopeName, String privateEndpointConnectionName, Context context) { - return beginDeleteAsync(resourceGroupName, scopeName, privateEndpointConnectionName, context).getSyncPoller(); - } - - /** - * Deletes a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String scopeName, String privateEndpointConnectionName) { - return beginDeleteAsync(resourceGroupName, scopeName, privateEndpointConnectionName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync( - String resourceGroupName, String scopeName, String privateEndpointConnectionName, Context context) { - return beginDeleteAsync(resourceGroupName, scopeName, privateEndpointConnectionName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String scopeName, String privateEndpointConnectionName) { - deleteAsync(resourceGroupName, scopeName, privateEndpointConnectionName).block(); - } - - /** - * Deletes a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete( - String resourceGroupName, String scopeName, String privateEndpointConnectionName, Context context) { - deleteAsync(resourceGroupName, scopeName, privateEndpointConnectionName, context).block(); - } - - /** - * Gets all private endpoint connections on a private link scope. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all private endpoint connections on a private link scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByPrivateLinkScopeSinglePageAsync( - String resourceGroupName, String scopeName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (scopeName == null) { - return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); - } - final String apiVersion = "2019-10-17-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByPrivateLinkScope( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - apiVersion, - scopeName, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all private endpoint connections on a private link scope. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all private endpoint connections on a private link scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByPrivateLinkScopeSinglePageAsync( - String resourceGroupName, String scopeName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (scopeName == null) { - return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); - } - final String apiVersion = "2019-10-17-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByPrivateLinkScope( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - apiVersion, - scopeName, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all private endpoint connections on a private link scope. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all private endpoint connections on a private link scope. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByPrivateLinkScopeAsync( - String resourceGroupName, String scopeName) { - return new PagedFlux<>( - () -> listByPrivateLinkScopeSinglePageAsync(resourceGroupName, scopeName), - nextLink -> listByPrivateLinkScopeNextSinglePageAsync(nextLink)); - } - - /** - * Gets all private endpoint connections on a private link scope. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all private endpoint connections on a private link scope. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByPrivateLinkScopeAsync( - String resourceGroupName, String scopeName, Context context) { - return new PagedFlux<>( - () -> listByPrivateLinkScopeSinglePageAsync(resourceGroupName, scopeName, context), - nextLink -> listByPrivateLinkScopeNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all private endpoint connections on a private link scope. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all private endpoint connections on a private link scope. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByPrivateLinkScope( - String resourceGroupName, String scopeName) { - return new PagedIterable<>(listByPrivateLinkScopeAsync(resourceGroupName, scopeName)); - } - - /** - * Gets all private endpoint connections on a private link scope. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all private endpoint connections on a private link scope. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByPrivateLinkScope( - String resourceGroupName, String scopeName, Context context) { - return new PagedIterable<>(listByPrivateLinkScopeAsync(resourceGroupName, scopeName, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of private endpoint connections. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByPrivateLinkScopeNextSinglePageAsync( - String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByPrivateLinkScopeNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of private endpoint connections. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByPrivateLinkScopeNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByPrivateLinkScopeNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/PrivateLinkResourcesClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/PrivateLinkResourcesClientImpl.java deleted file mode 100644 index ec2932b0d4ce..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/PrivateLinkResourcesClientImpl.java +++ /dev/null @@ -1,523 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.fluent.PrivateLinkResourcesClient; -import com.azure.resourcemanager.monitor.fluent.models.PrivateLinkResourceInner; -import com.azure.resourcemanager.monitor.models.PrivateLinkResourceListResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. */ -public final class PrivateLinkResourcesClientImpl implements PrivateLinkResourcesClient { - private final ClientLogger logger = new ClientLogger(PrivateLinkResourcesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final PrivateLinkResourcesService service; - - /** The service client containing this operation class. */ - private final MonitorClientImpl client; - - /** - * Initializes an instance of PrivateLinkResourcesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - PrivateLinkResourcesClientImpl(MonitorClientImpl client) { - this.service = - RestProxy - .create(PrivateLinkResourcesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MonitorClientPrivateLinkResources to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MonitorClientPrivate") - private interface PrivateLinkResourcesService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights" - + "/privateLinkScopes/{scopeName}/privateLinkResources") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByPrivateLinkScope( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("scopeName") String scopeName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights" - + "/privateLinkScopes/{scopeName}/privateLinkResources/{groupName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("scopeName") String scopeName, - @PathParam("groupName") String groupName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByPrivateLinkScopeNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByPrivateLinkScopeSinglePageAsync( - String resourceGroupName, String scopeName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (scopeName == null) { - return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); - } - final String apiVersion = "2019-10-17-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByPrivateLinkScope( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - apiVersion, - scopeName, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByPrivateLinkScopeSinglePageAsync( - String resourceGroupName, String scopeName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (scopeName == null) { - return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); - } - final String apiVersion = "2019-10-17-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByPrivateLinkScope( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - apiVersion, - scopeName, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByPrivateLinkScopeAsync(String resourceGroupName, String scopeName) { - return new PagedFlux<>( - () -> listByPrivateLinkScopeSinglePageAsync(resourceGroupName, scopeName), - nextLink -> listByPrivateLinkScopeNextSinglePageAsync(nextLink)); - } - - /** - * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByPrivateLinkScopeAsync( - String resourceGroupName, String scopeName, Context context) { - return new PagedFlux<>( - () -> listByPrivateLinkScopeSinglePageAsync(resourceGroupName, scopeName, context), - nextLink -> listByPrivateLinkScopeNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByPrivateLinkScope(String resourceGroupName, String scopeName) { - return new PagedIterable<>(listByPrivateLinkScopeAsync(resourceGroupName, scopeName)); - } - - /** - * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByPrivateLinkScope( - String resourceGroupName, String scopeName, Context context) { - return new PagedIterable<>(listByPrivateLinkScopeAsync(resourceGroupName, scopeName, context)); - } - - /** - * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param groupName The name of the private link resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String resourceGroupName, String scopeName, String groupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (scopeName == null) { - return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); - } - if (groupName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); - } - final String apiVersion = "2019-10-17-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - apiVersion, - scopeName, - groupName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param groupName The name of the private link resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String scopeName, String groupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (scopeName == null) { - return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); - } - if (groupName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); - } - final String apiVersion = "2019-10-17-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - apiVersion, - scopeName, - groupName, - accept, - context); - } - - /** - * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param groupName The name of the private link resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync(String resourceGroupName, String scopeName, String groupName) { - return getWithResponseAsync(resourceGroupName, scopeName, groupName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param groupName The name of the private link resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateLinkResourceInner get(String resourceGroupName, String scopeName, String groupName) { - return getAsync(resourceGroupName, scopeName, groupName).block(); - } - - /** - * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param groupName The name of the private link resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String scopeName, String groupName, Context context) { - return getWithResponseAsync(resourceGroupName, scopeName, groupName, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of private link resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByPrivateLinkScopeNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByPrivateLinkScopeNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of private link resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByPrivateLinkScopeNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByPrivateLinkScopeNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/PrivateLinkScopeOperationStatusClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/PrivateLinkScopeOperationStatusClientImpl.java deleted file mode 100644 index dff0cabab360..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/PrivateLinkScopeOperationStatusClientImpl.java +++ /dev/null @@ -1,231 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.fluent.PrivateLinkScopeOperationStatusClient; -import com.azure.resourcemanager.monitor.fluent.models.OperationStatusInner; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in PrivateLinkScopeOperationStatusClient. */ -public final class PrivateLinkScopeOperationStatusClientImpl - implements InnerSupportsGet, PrivateLinkScopeOperationStatusClient { - private final ClientLogger logger = new ClientLogger(PrivateLinkScopeOperationStatusClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final PrivateLinkScopeOperationStatusService service; - - /** The service client containing this operation class. */ - private final MonitorClientImpl client; - - /** - * Initializes an instance of PrivateLinkScopeOperationStatusClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - PrivateLinkScopeOperationStatusClientImpl(MonitorClientImpl client) { - this.service = - RestProxy - .create( - PrivateLinkScopeOperationStatusService.class, - client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MonitorClientPrivateLinkScopeOperationStatus to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MonitorClientPrivate") - private interface PrivateLinkScopeOperationStatusService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights" - + "/privateLinkScopeOperationStatuses/{asyncOperationId}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("asyncOperationId") String asyncOperationId, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Get the status of an azure asynchronous operation associated with a private link scope operation. - * - * @param resourceGroupName The name of the resource group. - * @param asyncOperationId The operation Id. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of an azure asynchronous operation associated with a private link scope operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String asyncOperationId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (asyncOperationId == null) { - return Mono - .error(new IllegalArgumentException("Parameter asyncOperationId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-10-17-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - asyncOperationId, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the status of an azure asynchronous operation associated with a private link scope operation. - * - * @param resourceGroupName The name of the resource group. - * @param asyncOperationId The operation Id. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of an azure asynchronous operation associated with a private link scope operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String asyncOperationId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (asyncOperationId == null) { - return Mono - .error(new IllegalArgumentException("Parameter asyncOperationId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-10-17-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - asyncOperationId, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Get the status of an azure asynchronous operation associated with a private link scope operation. - * - * @param resourceGroupName The name of the resource group. - * @param asyncOperationId The operation Id. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of an azure asynchronous operation associated with a private link scope operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync(String resourceGroupName, String asyncOperationId) { - return getByResourceGroupWithResponseAsync(resourceGroupName, asyncOperationId) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get the status of an azure asynchronous operation associated with a private link scope operation. - * - * @param resourceGroupName The name of the resource group. - * @param asyncOperationId The operation Id. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of an azure asynchronous operation associated with a private link scope operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public OperationStatusInner getByResourceGroup(String resourceGroupName, String asyncOperationId) { - return getByResourceGroupAsync(resourceGroupName, asyncOperationId).block(); - } - - /** - * Get the status of an azure asynchronous operation associated with a private link scope operation. - * - * @param resourceGroupName The name of the resource group. - * @param asyncOperationId The operation Id. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of an azure asynchronous operation associated with a private link scope operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String asyncOperationId, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, asyncOperationId, context).block(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/PrivateLinkScopedResourcesClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/PrivateLinkScopedResourcesClientImpl.java deleted file mode 100644 index 0995407c73bb..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/PrivateLinkScopedResourcesClientImpl.java +++ /dev/null @@ -1,1128 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.monitor.fluent.PrivateLinkScopedResourcesClient; -import com.azure.resourcemanager.monitor.fluent.models.ScopedResourceInner; -import com.azure.resourcemanager.monitor.models.ScopedResourceListResult; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in PrivateLinkScopedResourcesClient. */ -public final class PrivateLinkScopedResourcesClientImpl implements PrivateLinkScopedResourcesClient { - private final ClientLogger logger = new ClientLogger(PrivateLinkScopedResourcesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final PrivateLinkScopedResourcesService service; - - /** The service client containing this operation class. */ - private final MonitorClientImpl client; - - /** - * Initializes an instance of PrivateLinkScopedResourcesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - PrivateLinkScopedResourcesClientImpl(MonitorClientImpl client) { - this.service = - RestProxy - .create( - PrivateLinkScopedResourcesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MonitorClientPrivateLinkScopedResources to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MonitorClientPrivate") - private interface PrivateLinkScopedResourcesService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights" - + "/privateLinkScopes/{scopeName}/scopedResources/{name}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("scopeName") String scopeName, - @PathParam("name") String name, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights" - + "/privateLinkScopes/{scopeName}/scopedResources/{name}") - @ExpectedResponses({200, 201, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("scopeName") String scopeName, - @PathParam("name") String name, - @BodyParam("application/json") ScopedResourceInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights" - + "/privateLinkScopes/{scopeName}/scopedResources/{name}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("scopeName") String scopeName, - @PathParam("name") String name, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights" - + "/privateLinkScopes/{scopeName}/scopedResources") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByPrivateLinkScope( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("scopeName") String scopeName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByPrivateLinkScopeNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets a scoped resource in a private link scope. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param name The name of the scoped resource object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a scoped resource in a private link scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String resourceGroupName, String scopeName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (scopeName == null) { - return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String apiVersion = "2019-10-17-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - apiVersion, - scopeName, - name, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a scoped resource in a private link scope. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param name The name of the scoped resource object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a scoped resource in a private link scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String scopeName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (scopeName == null) { - return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String apiVersion = "2019-10-17-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - apiVersion, - scopeName, - name, - accept, - context); - } - - /** - * Gets a scoped resource in a private link scope. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param name The name of the scoped resource object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a scoped resource in a private link scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync(String resourceGroupName, String scopeName, String name) { - return getWithResponseAsync(resourceGroupName, scopeName, name) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a scoped resource in a private link scope. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param name The name of the scoped resource object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a scoped resource in a private link scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ScopedResourceInner get(String resourceGroupName, String scopeName, String name) { - return getAsync(resourceGroupName, scopeName, name).block(); - } - - /** - * Gets a scoped resource in a private link scope. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param name The name of the scoped resource object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a scoped resource in a private link scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String scopeName, String name, Context context) { - return getWithResponseAsync(resourceGroupName, scopeName, name, context).block(); - } - - /** - * Approve or reject a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param name The name of the scoped resource object. - * @param linkedResourceId The resource id of the scoped Azure monitor resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private link scoped resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String scopeName, String name, String linkedResourceId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (scopeName == null) { - return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String apiVersion = "2019-10-17-preview"; - final String accept = "application/json"; - ScopedResourceInner parameters = new ScopedResourceInner(); - parameters.withLinkedResourceId(linkedResourceId); - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - apiVersion, - scopeName, - name, - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Approve or reject a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param name The name of the scoped resource object. - * @param linkedResourceId The resource id of the scoped Azure monitor resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private link scoped resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String scopeName, String name, String linkedResourceId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (scopeName == null) { - return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String apiVersion = "2019-10-17-preview"; - final String accept = "application/json"; - ScopedResourceInner parameters = new ScopedResourceInner(); - parameters.withLinkedResourceId(linkedResourceId); - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - apiVersion, - scopeName, - name, - parameters, - accept, - context); - } - - /** - * Approve or reject a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param name The name of the scoped resource object. - * @param linkedResourceId The resource id of the scoped Azure monitor resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private link scoped resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, ScopedResourceInner> beginCreateOrUpdateAsync( - String resourceGroupName, String scopeName, String name, String linkedResourceId) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, scopeName, name, linkedResourceId); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ScopedResourceInner.class, - ScopedResourceInner.class, - Context.NONE); - } - - /** - * Approve or reject a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param name The name of the scoped resource object. - * @param linkedResourceId The resource id of the scoped Azure monitor resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private link scoped resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, ScopedResourceInner> beginCreateOrUpdateAsync( - String resourceGroupName, String scopeName, String name, String linkedResourceId, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, scopeName, name, linkedResourceId, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), ScopedResourceInner.class, ScopedResourceInner.class, context); - } - - /** - * Approve or reject a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param name The name of the scoped resource object. - * @param linkedResourceId The resource id of the scoped Azure monitor resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private link scoped resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, ScopedResourceInner> beginCreateOrUpdate( - String resourceGroupName, String scopeName, String name, String linkedResourceId) { - return beginCreateOrUpdateAsync(resourceGroupName, scopeName, name, linkedResourceId).getSyncPoller(); - } - - /** - * Approve or reject a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param name The name of the scoped resource object. - * @param linkedResourceId The resource id of the scoped Azure monitor resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private link scoped resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, ScopedResourceInner> beginCreateOrUpdate( - String resourceGroupName, String scopeName, String name, String linkedResourceId, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, scopeName, name, linkedResourceId, context).getSyncPoller(); - } - - /** - * Approve or reject a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param name The name of the scoped resource object. - * @param linkedResourceId The resource id of the scoped Azure monitor resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private link scoped resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, String scopeName, String name, String linkedResourceId) { - return beginCreateOrUpdateAsync(resourceGroupName, scopeName, name, linkedResourceId) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Approve or reject a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param name The name of the scoped resource object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private link scoped resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync(String resourceGroupName, String scopeName, String name) { - final String linkedResourceId = null; - return beginCreateOrUpdateAsync(resourceGroupName, scopeName, name, linkedResourceId) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Approve or reject a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param name The name of the scoped resource object. - * @param linkedResourceId The resource id of the scoped Azure monitor resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private link scoped resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String scopeName, String name, String linkedResourceId, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, scopeName, name, linkedResourceId, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Approve or reject a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param name The name of the scoped resource object. - * @param linkedResourceId The resource id of the scoped Azure monitor resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private link scoped resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ScopedResourceInner createOrUpdate( - String resourceGroupName, String scopeName, String name, String linkedResourceId) { - return createOrUpdateAsync(resourceGroupName, scopeName, name, linkedResourceId).block(); - } - - /** - * Approve or reject a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param name The name of the scoped resource object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private link scoped resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ScopedResourceInner createOrUpdate(String resourceGroupName, String scopeName, String name) { - final String linkedResourceId = null; - return createOrUpdateAsync(resourceGroupName, scopeName, name, linkedResourceId).block(); - } - - /** - * Approve or reject a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param name The name of the scoped resource object. - * @param linkedResourceId The resource id of the scoped Azure monitor resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private link scoped resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ScopedResourceInner createOrUpdate( - String resourceGroupName, String scopeName, String name, String linkedResourceId, Context context) { - return createOrUpdateAsync(resourceGroupName, scopeName, name, linkedResourceId, context).block(); - } - - /** - * Deletes a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param name The name of the scoped resource object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync( - String resourceGroupName, String scopeName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (scopeName == null) { - return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String apiVersion = "2019-10-17-preview"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - apiVersion, - scopeName, - name, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param name The name of the scoped resource object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String scopeName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (scopeName == null) { - return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String apiVersion = "2019-10-17-preview"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - apiVersion, - scopeName, - name, - context); - } - - /** - * Deletes a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param name The name of the scoped resource object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String scopeName, String name) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, scopeName, name); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deletes a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param name The name of the scoped resource object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String scopeName, String name, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(resourceGroupName, scopeName, name, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param name The name of the scoped resource object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete(String resourceGroupName, String scopeName, String name) { - return beginDeleteAsync(resourceGroupName, scopeName, name).getSyncPoller(); - } - - /** - * Deletes a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param name The name of the scoped resource object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String scopeName, String name, Context context) { - return beginDeleteAsync(resourceGroupName, scopeName, name, context).getSyncPoller(); - } - - /** - * Deletes a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param name The name of the scoped resource object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String scopeName, String name) { - return beginDeleteAsync(resourceGroupName, scopeName, name) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param name The name of the scoped resource object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String scopeName, String name, Context context) { - return beginDeleteAsync(resourceGroupName, scopeName, name, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param name The name of the scoped resource object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String scopeName, String name) { - deleteAsync(resourceGroupName, scopeName, name).block(); - } - - /** - * Deletes a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param name The name of the scoped resource object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String scopeName, String name, Context context) { - deleteAsync(resourceGroupName, scopeName, name, context).block(); - } - - /** - * Gets all private endpoint connections on a private link scope. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all private endpoint connections on a private link scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByPrivateLinkScopeSinglePageAsync( - String resourceGroupName, String scopeName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (scopeName == null) { - return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); - } - final String apiVersion = "2019-10-17-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByPrivateLinkScope( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - apiVersion, - scopeName, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all private endpoint connections on a private link scope. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all private endpoint connections on a private link scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByPrivateLinkScopeSinglePageAsync( - String resourceGroupName, String scopeName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (scopeName == null) { - return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); - } - final String apiVersion = "2019-10-17-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByPrivateLinkScope( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - apiVersion, - scopeName, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all private endpoint connections on a private link scope. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all private endpoint connections on a private link scope. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByPrivateLinkScopeAsync(String resourceGroupName, String scopeName) { - return new PagedFlux<>( - () -> listByPrivateLinkScopeSinglePageAsync(resourceGroupName, scopeName), - nextLink -> listByPrivateLinkScopeNextSinglePageAsync(nextLink)); - } - - /** - * Gets all private endpoint connections on a private link scope. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all private endpoint connections on a private link scope. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByPrivateLinkScopeAsync( - String resourceGroupName, String scopeName, Context context) { - return new PagedFlux<>( - () -> listByPrivateLinkScopeSinglePageAsync(resourceGroupName, scopeName, context), - nextLink -> listByPrivateLinkScopeNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all private endpoint connections on a private link scope. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all private endpoint connections on a private link scope. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByPrivateLinkScope(String resourceGroupName, String scopeName) { - return new PagedIterable<>(listByPrivateLinkScopeAsync(resourceGroupName, scopeName)); - } - - /** - * Gets all private endpoint connections on a private link scope. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all private endpoint connections on a private link scope. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByPrivateLinkScope( - String resourceGroupName, String scopeName, Context context) { - return new PagedIterable<>(listByPrivateLinkScopeAsync(resourceGroupName, scopeName, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of scoped resources in a private link scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByPrivateLinkScopeNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByPrivateLinkScopeNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of scoped resources in a private link scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByPrivateLinkScopeNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByPrivateLinkScopeNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/PrivateLinkScopesClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/PrivateLinkScopesClientImpl.java deleted file mode 100644 index a4ae7daadc39..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/PrivateLinkScopesClientImpl.java +++ /dev/null @@ -1,1394 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.monitor.fluent.PrivateLinkScopesClient; -import com.azure.resourcemanager.monitor.fluent.models.AzureMonitorPrivateLinkScopeInner; -import com.azure.resourcemanager.monitor.models.AzureMonitorPrivateLinkScopeListResult; -import com.azure.resourcemanager.monitor.models.TagsResource; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import java.util.Map; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in PrivateLinkScopesClient. */ -public final class PrivateLinkScopesClientImpl - implements InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete, - PrivateLinkScopesClient { - private final ClientLogger logger = new ClientLogger(PrivateLinkScopesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final PrivateLinkScopesService service; - - /** The service client containing this operation class. */ - private final MonitorClientImpl client; - - /** - * Initializes an instance of PrivateLinkScopesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - PrivateLinkScopesClientImpl(MonitorClientImpl client) { - this.service = - RestProxy.create(PrivateLinkScopesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MonitorClientPrivateLinkScopes to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MonitorClientPrivate") - private interface PrivateLinkScopesService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/microsoft.insights/privateLinkScopes") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights" - + "/privateLinkScopes") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights" - + "/privateLinkScopes/{scopeName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("scopeName") String scopeName, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights" - + "/privateLinkScopes/{scopeName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("scopeName") String scopeName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights" - + "/privateLinkScopes/{scopeName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("scopeName") String scopeName, - @BodyParam("application/json") AzureMonitorPrivateLinkScopeInner azureMonitorPrivateLinkScopePayload, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights" - + "/privateLinkScopes/{scopeName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> updateTags( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("scopeName") String scopeName, - @BodyParam("application/json") TagsResource privateLinkScopeTags, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets a list of all Azure Monitor PrivateLinkScopes within a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all Azure Monitor PrivateLinkScopes within a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-10-17-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a list of all Azure Monitor PrivateLinkScopes within a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all Azure Monitor PrivateLinkScopes within a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-10-17-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets a list of all Azure Monitor PrivateLinkScopes within a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all Azure Monitor PrivateLinkScopes within a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets a list of all Azure Monitor PrivateLinkScopes within a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all Azure Monitor PrivateLinkScopes within a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets a list of all Azure Monitor PrivateLinkScopes within a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all Azure Monitor PrivateLinkScopes within a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Gets a list of all Azure Monitor PrivateLinkScopes within a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all Azure Monitor PrivateLinkScopes within a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Gets a list of Azure Monitor PrivateLinkScopes within a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Azure Monitor PrivateLinkScopes within a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-10-17-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a list of Azure Monitor PrivateLinkScopes within a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Azure Monitor PrivateLinkScopes within a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-10-17-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets a list of Azure Monitor PrivateLinkScopes within a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Azure Monitor PrivateLinkScopes within a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * Gets a list of Azure Monitor PrivateLinkScopes within a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Azure Monitor PrivateLinkScopes within a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync( - String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets a list of Azure Monitor PrivateLinkScopes within a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Azure Monitor PrivateLinkScopes within a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * Gets a list of Azure Monitor PrivateLinkScopes within a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Azure Monitor PrivateLinkScopes within a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup( - String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * Deletes a Azure Monitor PrivateLinkScope. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync(String resourceGroupName, String scopeName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (scopeName == null) { - return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); - } - final String apiVersion = "2019-10-17-preview"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - apiVersion, - this.client.getSubscriptionId(), - scopeName, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a Azure Monitor PrivateLinkScope. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String scopeName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (scopeName == null) { - return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); - } - final String apiVersion = "2019-10-17-preview"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - apiVersion, - this.client.getSubscriptionId(), - scopeName, - context); - } - - /** - * Deletes a Azure Monitor PrivateLinkScope. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String scopeName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, scopeName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deletes a Azure Monitor PrivateLinkScope. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String scopeName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(resourceGroupName, scopeName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes a Azure Monitor PrivateLinkScope. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete(String resourceGroupName, String scopeName) { - return beginDeleteAsync(resourceGroupName, scopeName).getSyncPoller(); - } - - /** - * Deletes a Azure Monitor PrivateLinkScope. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete(String resourceGroupName, String scopeName, Context context) { - return beginDeleteAsync(resourceGroupName, scopeName, context).getSyncPoller(); - } - - /** - * Deletes a Azure Monitor PrivateLinkScope. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String scopeName) { - return beginDeleteAsync(resourceGroupName, scopeName).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a Azure Monitor PrivateLinkScope. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String scopeName, Context context) { - return beginDeleteAsync(resourceGroupName, scopeName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a Azure Monitor PrivateLinkScope. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String scopeName) { - deleteAsync(resourceGroupName, scopeName).block(); - } - - /** - * Deletes a Azure Monitor PrivateLinkScope. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String scopeName, Context context) { - deleteAsync(resourceGroupName, scopeName, context).block(); - } - - /** - * Returns a Azure Monitor PrivateLinkScope. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Azure Monitor PrivateLinkScope definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String scopeName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (scopeName == null) { - return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); - } - final String apiVersion = "2019-10-17-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - apiVersion, - this.client.getSubscriptionId(), - scopeName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns a Azure Monitor PrivateLinkScope. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Azure Monitor PrivateLinkScope definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String scopeName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (scopeName == null) { - return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); - } - final String apiVersion = "2019-10-17-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - apiVersion, - this.client.getSubscriptionId(), - scopeName, - accept, - context); - } - - /** - * Returns a Azure Monitor PrivateLinkScope. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Azure Monitor PrivateLinkScope definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync(String resourceGroupName, String scopeName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, scopeName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Returns a Azure Monitor PrivateLinkScope. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Azure Monitor PrivateLinkScope definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AzureMonitorPrivateLinkScopeInner getByResourceGroup(String resourceGroupName, String scopeName) { - return getByResourceGroupAsync(resourceGroupName, scopeName).block(); - } - - /** - * Returns a Azure Monitor PrivateLinkScope. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Azure Monitor PrivateLinkScope definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String scopeName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, scopeName, context).block(); - } - - /** - * Creates (or updates) a Azure Monitor PrivateLinkScope. Note: You cannot specify a different value for - * InstrumentationKey nor AppId in the Put operation. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param azureMonitorPrivateLinkScopePayload Properties that need to be specified to create or update a Azure - * Monitor PrivateLinkScope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Azure Monitor PrivateLinkScope definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, - String scopeName, - AzureMonitorPrivateLinkScopeInner azureMonitorPrivateLinkScopePayload) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (scopeName == null) { - return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); - } - if (azureMonitorPrivateLinkScopePayload == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter azureMonitorPrivateLinkScopePayload is required and cannot be null.")); - } else { - azureMonitorPrivateLinkScopePayload.validate(); - } - final String apiVersion = "2019-10-17-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - apiVersion, - this.client.getSubscriptionId(), - scopeName, - azureMonitorPrivateLinkScopePayload, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates (or updates) a Azure Monitor PrivateLinkScope. Note: You cannot specify a different value for - * InstrumentationKey nor AppId in the Put operation. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param azureMonitorPrivateLinkScopePayload Properties that need to be specified to create or update a Azure - * Monitor PrivateLinkScope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Azure Monitor PrivateLinkScope definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, - String scopeName, - AzureMonitorPrivateLinkScopeInner azureMonitorPrivateLinkScopePayload, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (scopeName == null) { - return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); - } - if (azureMonitorPrivateLinkScopePayload == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter azureMonitorPrivateLinkScopePayload is required and cannot be null.")); - } else { - azureMonitorPrivateLinkScopePayload.validate(); - } - final String apiVersion = "2019-10-17-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - apiVersion, - this.client.getSubscriptionId(), - scopeName, - azureMonitorPrivateLinkScopePayload, - accept, - context); - } - - /** - * Creates (or updates) a Azure Monitor PrivateLinkScope. Note: You cannot specify a different value for - * InstrumentationKey nor AppId in the Put operation. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param azureMonitorPrivateLinkScopePayload Properties that need to be specified to create or update a Azure - * Monitor PrivateLinkScope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Azure Monitor PrivateLinkScope definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, - String scopeName, - AzureMonitorPrivateLinkScopeInner azureMonitorPrivateLinkScopePayload) { - return createOrUpdateWithResponseAsync(resourceGroupName, scopeName, azureMonitorPrivateLinkScopePayload) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates (or updates) a Azure Monitor PrivateLinkScope. Note: You cannot specify a different value for - * InstrumentationKey nor AppId in the Put operation. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param azureMonitorPrivateLinkScopePayload Properties that need to be specified to create or update a Azure - * Monitor PrivateLinkScope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Azure Monitor PrivateLinkScope definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AzureMonitorPrivateLinkScopeInner createOrUpdate( - String resourceGroupName, - String scopeName, - AzureMonitorPrivateLinkScopeInner azureMonitorPrivateLinkScopePayload) { - return createOrUpdateAsync(resourceGroupName, scopeName, azureMonitorPrivateLinkScopePayload).block(); - } - - /** - * Creates (or updates) a Azure Monitor PrivateLinkScope. Note: You cannot specify a different value for - * InstrumentationKey nor AppId in the Put operation. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param azureMonitorPrivateLinkScopePayload Properties that need to be specified to create or update a Azure - * Monitor PrivateLinkScope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Azure Monitor PrivateLinkScope definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceGroupName, - String scopeName, - AzureMonitorPrivateLinkScopeInner azureMonitorPrivateLinkScopePayload, - Context context) { - return createOrUpdateWithResponseAsync( - resourceGroupName, scopeName, azureMonitorPrivateLinkScopePayload, context) - .block(); - } - - /** - * Updates an existing PrivateLinkScope's tags. To update other fields use the CreateOrUpdate method. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param tags Resource tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Azure Monitor PrivateLinkScope definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateTagsWithResponseAsync( - String resourceGroupName, String scopeName, Map tags) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (scopeName == null) { - return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); - } - final String apiVersion = "2019-10-17-preview"; - final String accept = "application/json"; - TagsResource privateLinkScopeTags = new TagsResource(); - privateLinkScopeTags.withTags(tags); - return FluxUtil - .withContext( - context -> - service - .updateTags( - this.client.getEndpoint(), - resourceGroupName, - apiVersion, - this.client.getSubscriptionId(), - scopeName, - privateLinkScopeTags, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates an existing PrivateLinkScope's tags. To update other fields use the CreateOrUpdate method. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param tags Resource tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Azure Monitor PrivateLinkScope definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateTagsWithResponseAsync( - String resourceGroupName, String scopeName, Map tags, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (scopeName == null) { - return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); - } - final String apiVersion = "2019-10-17-preview"; - final String accept = "application/json"; - TagsResource privateLinkScopeTags = new TagsResource(); - privateLinkScopeTags.withTags(tags); - context = this.client.mergeContext(context); - return service - .updateTags( - this.client.getEndpoint(), - resourceGroupName, - apiVersion, - this.client.getSubscriptionId(), - scopeName, - privateLinkScopeTags, - accept, - context); - } - - /** - * Updates an existing PrivateLinkScope's tags. To update other fields use the CreateOrUpdate method. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param tags Resource tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Azure Monitor PrivateLinkScope definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateTagsAsync( - String resourceGroupName, String scopeName, Map tags) { - return updateTagsWithResponseAsync(resourceGroupName, scopeName, tags) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Updates an existing PrivateLinkScope's tags. To update other fields use the CreateOrUpdate method. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Azure Monitor PrivateLinkScope definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateTagsAsync(String resourceGroupName, String scopeName) { - final Map tags = null; - return updateTagsWithResponseAsync(resourceGroupName, scopeName, tags) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Updates an existing PrivateLinkScope's tags. To update other fields use the CreateOrUpdate method. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Azure Monitor PrivateLinkScope definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AzureMonitorPrivateLinkScopeInner updateTags(String resourceGroupName, String scopeName) { - final Map tags = null; - return updateTagsAsync(resourceGroupName, scopeName, tags).block(); - } - - /** - * Updates an existing PrivateLinkScope's tags. To update other fields use the CreateOrUpdate method. - * - * @param resourceGroupName The name of the resource group. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param tags Resource tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Azure Monitor PrivateLinkScope definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateTagsWithResponse( - String resourceGroupName, String scopeName, Map tags, Context context) { - return updateTagsWithResponseAsync(resourceGroupName, scopeName, tags, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the list of Azure Monitor PrivateLinkScope resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the list of Azure Monitor PrivateLinkScope resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the list of Azure Monitor PrivateLinkScope resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync( - String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the list of Azure Monitor PrivateLinkScope resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/ScaleRuleImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/ScaleRuleImpl.java deleted file mode 100644 index 6bcaba20adbb..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/ScaleRuleImpl.java +++ /dev/null @@ -1,199 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.monitor.implementation; - -import com.azure.resourcemanager.monitor.models.ComparisonOperationType; -import com.azure.resourcemanager.monitor.models.MetricStatisticType; -import com.azure.resourcemanager.monitor.models.MetricTrigger; -import com.azure.resourcemanager.monitor.models.ScaleAction; -import com.azure.resourcemanager.monitor.models.ScaleDirection; -import com.azure.resourcemanager.monitor.models.ScaleRule; -import com.azure.resourcemanager.monitor.models.ScaleType; -import com.azure.resourcemanager.monitor.models.TimeAggregationType; -import com.azure.resourcemanager.monitor.fluent.models.ScaleRuleInner; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.WrapperImpl; -import java.time.Duration; - -/** Implementation for ScaleRule. */ -class ScaleRuleImpl extends WrapperImpl - implements ScaleRule, - ScaleRule.Definition, - ScaleRule.ParentUpdateDefinition, - ScaleRule.UpdateDefinition, - ScaleRule.Update { - - private final AutoscaleProfileImpl parent; - - ScaleRuleImpl(ScaleRuleInner innerObject, AutoscaleProfileImpl parent) { - super(innerObject); - this.parent = parent; - if (this.innerModel().metricTrigger() == null) { - this.innerModel().withMetricTrigger(new MetricTrigger()); - } - if (this.innerModel().scaleAction() == null) { - this.innerModel().withScaleAction(new ScaleAction()); - } - } - - @Override - public String metricSource() { - if (this.innerModel().metricTrigger() != null) { - return this.innerModel().metricTrigger().metricResourceUri(); - } - return null; - } - - @Override - public String metricName() { - if (this.innerModel().metricTrigger() != null) { - return this.innerModel().metricTrigger().metricName(); - } - return null; - } - - @Override - public Duration duration() { - if (this.innerModel().metricTrigger() != null) { - return this.innerModel().metricTrigger().timeWindow(); - } - return null; - } - - @Override - public Duration frequency() { - if (this.innerModel().metricTrigger() != null) { - return this.innerModel().metricTrigger().timeGrain(); - } - return null; - } - - @Override - public MetricStatisticType frequencyStatistic() { - if (this.innerModel().metricTrigger() != null) { - return this.innerModel().metricTrigger().statistic(); - } - return null; - } - - @Override - public ComparisonOperationType condition() { - if (this.innerModel().metricTrigger() != null) { - return this.innerModel().metricTrigger().operator(); - } - return null; - } - - @Override - public TimeAggregationType timeAggregation() { - if (this.innerModel().metricTrigger() != null) { - return this.innerModel().metricTrigger().timeAggregation(); - } - return null; - } - - @Override - public double threshold() { - if (this.innerModel().metricTrigger() != null) { - return this.innerModel().metricTrigger().threshold(); - } - return 0; - } - - @Override - public ScaleDirection scaleDirection() { - if (this.innerModel().scaleAction() != null) { - return this.innerModel().scaleAction().direction(); - } - return null; - } - - @Override - public ScaleType scaleType() { - if (this.innerModel().scaleAction() != null) { - return this.innerModel().scaleAction().type(); - } - return null; - } - - @Override - public int scaleInstanceCount() { - if (this.innerModel().scaleAction() != null) { - return Integer.parseInt(this.innerModel().scaleAction().value()); - } - return 0; - } - - @Override - public Duration cooldown() { - if (this.innerModel().scaleAction() != null) { - return this.innerModel().scaleAction().cooldown(); - } - return null; - } - - @Override - public AutoscaleProfileImpl parent() { - // end of update - return this.parent; - } - - @Override - public AutoscaleProfileImpl attach() { - return this.parent.addNewScaleRule(this); - } - - @Override - public ScaleRuleImpl withMetricSource(String metricSourceResourceId) { - this.innerModel().metricTrigger().withMetricResourceUri(metricSourceResourceId); - return this; - } - - @Override - public ScaleRuleImpl withMetricName(String metricName) { - this.innerModel().metricTrigger().withMetricName(metricName); - return this; - } - - @Override - public ScaleRuleImpl withStatistic(Duration duration, Duration frequency, MetricStatisticType statisticType) { - this.innerModel().metricTrigger().withStatistic(statisticType); - this.innerModel().metricTrigger().withTimeWindow(duration); - this.innerModel().metricTrigger().withTimeGrain(frequency); - return this; - } - - @Override - public ScaleRuleImpl withStatistic() { - return withStatistic(Duration.ofMinutes(10), Duration.ofMinutes(1), MetricStatisticType.AVERAGE); - } - - @Override - public ScaleRuleImpl withStatistic(Duration duration) { - return withStatistic(duration, Duration.ofMinutes(1), MetricStatisticType.AVERAGE); - } - - @Override - public ScaleRuleImpl withStatistic(Duration duration, MetricStatisticType statisticType) { - return withStatistic(duration, Duration.ofMinutes(1), statisticType); - } - - @Override - public ScaleRuleImpl withCondition( - TimeAggregationType timeAggregation, ComparisonOperationType condition, double threshold) { - this.innerModel().metricTrigger().withOperator(condition); - this.innerModel().metricTrigger().withTimeAggregation(timeAggregation); - this.innerModel().metricTrigger().withThreshold(threshold); - return this; - } - - @Override - public ScaleRuleImpl withScaleAction( - ScaleDirection direction, ScaleType type, int instanceCountChange, Duration cooldown) { - this.innerModel().scaleAction().withDirection(direction); - this.innerModel().scaleAction().withType(type); - this.innerModel().scaleAction().withValue(Integer.toString(instanceCountChange)); - this.innerModel().scaleAction().withCooldown(cooldown); - return this; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/ScheduledQueryRulesClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/ScheduledQueryRulesClientImpl.java deleted file mode 100644 index c38035d5aff1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/ScheduledQueryRulesClientImpl.java +++ /dev/null @@ -1,1128 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.fluent.ScheduledQueryRulesClient; -import com.azure.resourcemanager.monitor.fluent.models.LogSearchRuleResourceInner; -import com.azure.resourcemanager.monitor.models.LogSearchRuleResourceCollection; -import com.azure.resourcemanager.monitor.models.LogSearchRuleResourcePatch; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ScheduledQueryRulesClient. */ -public final class ScheduledQueryRulesClientImpl - implements InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete, - ScheduledQueryRulesClient { - private final ClientLogger logger = new ClientLogger(ScheduledQueryRulesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final ScheduledQueryRulesService service; - - /** The service client containing this operation class. */ - private final MonitorClientImpl client; - - /** - * Initializes an instance of ScheduledQueryRulesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ScheduledQueryRulesClientImpl(MonitorClientImpl client) { - this.service = - RestProxy.create(ScheduledQueryRulesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MonitorClientScheduledQueryRules to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MonitorClientSchedul") - private interface ScheduledQueryRulesService { - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights" - + "/scheduledQueryRules/{ruleName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("ruleName") String ruleName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") LogSearchRuleResourceInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights" - + "/scheduledQueryRules/{ruleName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("ruleName") String ruleName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights" - + "/scheduledQueryRules/{ruleName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("ruleName") String ruleName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") LogSearchRuleResourcePatch parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights" - + "/scheduledQueryRules/{ruleName}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("ruleName") String ruleName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Insights/scheduledQueryRules") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @QueryParam("$filter") String filter, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights" - + "/scheduledQueryRules") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @QueryParam("$filter") String filter, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Creates or updates an log search rule. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param parameters The parameters of the rule to create or update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Log Search Rule resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String ruleName, LogSearchRuleResourceInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ruleName == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-04-16"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - ruleName, - apiVersion, - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates an log search rule. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param parameters The parameters of the rule to create or update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Log Search Rule resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String ruleName, LogSearchRuleResourceInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ruleName == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-04-16"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - ruleName, - apiVersion, - parameters, - accept, - context); - } - - /** - * Creates or updates an log search rule. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param parameters The parameters of the rule to create or update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Log Search Rule resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, String ruleName, LogSearchRuleResourceInner parameters) { - return createOrUpdateWithResponseAsync(resourceGroupName, ruleName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates or updates an log search rule. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param parameters The parameters of the rule to create or update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Log Search Rule resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public LogSearchRuleResourceInner createOrUpdate( - String resourceGroupName, String ruleName, LogSearchRuleResourceInner parameters) { - return createOrUpdateAsync(resourceGroupName, ruleName, parameters).block(); - } - - /** - * Creates or updates an log search rule. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param parameters The parameters of the rule to create or update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Log Search Rule resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceGroupName, String ruleName, LogSearchRuleResourceInner parameters, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, ruleName, parameters, context).block(); - } - - /** - * Gets an Log Search rule. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Log Search rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String ruleName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ruleName == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-04-16"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - ruleName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets an Log Search rule. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Log Search rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String ruleName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ruleName == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-04-16"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - ruleName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets an Log Search rule. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Log Search rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync(String resourceGroupName, String ruleName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, ruleName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets an Log Search rule. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Log Search rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public LogSearchRuleResourceInner getByResourceGroup(String resourceGroupName, String ruleName) { - return getByResourceGroupAsync(resourceGroupName, ruleName).block(); - } - - /** - * Gets an Log Search rule. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Log Search rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String ruleName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, ruleName, context).block(); - } - - /** - * Update log search Rule. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param parameters The parameters of the rule to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Log Search Rule resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateWithResponseAsync( - String resourceGroupName, String ruleName, LogSearchRuleResourcePatch parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ruleName == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-04-16"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - ruleName, - apiVersion, - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Update log search Rule. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param parameters The parameters of the rule to update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Log Search Rule resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, String ruleName, LogSearchRuleResourcePatch parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ruleName == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-04-16"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - ruleName, - apiVersion, - parameters, - accept, - context); - } - - /** - * Update log search Rule. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param parameters The parameters of the rule to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Log Search Rule resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync( - String resourceGroupName, String ruleName, LogSearchRuleResourcePatch parameters) { - return updateWithResponseAsync(resourceGroupName, ruleName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Update log search Rule. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param parameters The parameters of the rule to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Log Search Rule resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public LogSearchRuleResourceInner update( - String resourceGroupName, String ruleName, LogSearchRuleResourcePatch parameters) { - return updateAsync(resourceGroupName, ruleName, parameters).block(); - } - - /** - * Update log search Rule. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param parameters The parameters of the rule to update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Log Search Rule resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, String ruleName, LogSearchRuleResourcePatch parameters, Context context) { - return updateWithResponseAsync(resourceGroupName, ruleName, parameters, context).block(); - } - - /** - * Deletes a Log Search rule. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String resourceGroupName, String ruleName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ruleName == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-04-16"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - ruleName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a Log Search rule. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String ruleName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ruleName == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-04-16"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - ruleName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Deletes a Log Search rule. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String ruleName) { - return deleteWithResponseAsync(resourceGroupName, ruleName).flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes a Log Search rule. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String ruleName) { - deleteAsync(resourceGroupName, ruleName).block(); - } - - /** - * Deletes a Log Search rule. - * - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String ruleName, Context context) { - return deleteWithResponseAsync(resourceGroupName, ruleName, context).block(); - } - - /** - * List the Log Search rules within a subscription group. - * - * @param filter The filter to apply on the operation. For more information please see - * https://msdn.microsoft.com/en-us/library/azure/dn931934.aspx. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of Log Search rule resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String filter) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-04-16"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - apiVersion, - filter, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List the Log Search rules within a subscription group. - * - * @param filter The filter to apply on the operation. For more information please see - * https://msdn.microsoft.com/en-us/library/azure/dn931934.aspx. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of Log Search rule resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String filter, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-04-16"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, filter, this.client.getSubscriptionId(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); - } - - /** - * List the Log Search rules within a subscription group. - * - * @param filter The filter to apply on the operation. For more information please see - * https://msdn.microsoft.com/en-us/library/azure/dn931934.aspx. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of Log Search rule resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String filter) { - return new PagedFlux<>(() -> listSinglePageAsync(filter)); - } - - /** - * List the Log Search rules within a subscription group. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of Log Search rule resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - final String filter = null; - return new PagedFlux<>(() -> listSinglePageAsync(filter)); - } - - /** - * List the Log Search rules within a subscription group. - * - * @param filter The filter to apply on the operation. For more information please see - * https://msdn.microsoft.com/en-us/library/azure/dn931934.aspx. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of Log Search rule resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String filter, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(filter, context)); - } - - /** - * List the Log Search rules within a subscription group. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of Log Search rule resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - final String filter = null; - return new PagedIterable<>(listAsync(filter)); - } - - /** - * List the Log Search rules within a subscription group. - * - * @param filter The filter to apply on the operation. For more information please see - * https://msdn.microsoft.com/en-us/library/azure/dn931934.aspx. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of Log Search rule resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String filter, Context context) { - return new PagedIterable<>(listAsync(filter, context)); - } - - /** - * List the Log Search rules within a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param filter The filter to apply on the operation. For more information please see - * https://msdn.microsoft.com/en-us/library/azure/dn931934.aspx. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of Log Search rule resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, String filter) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-04-16"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - apiVersion, - filter, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List the Log Search rules within a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param filter The filter to apply on the operation. For more information please see - * https://msdn.microsoft.com/en-us/library/azure/dn931934.aspx. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of Log Search rule resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, String filter, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-04-16"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - apiVersion, - filter, - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); - } - - /** - * List the Log Search rules within a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param filter The filter to apply on the operation. For more information please see - * https://msdn.microsoft.com/en-us/library/azure/dn931934.aspx. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of Log Search rule resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName, String filter) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, filter)); - } - - /** - * List the Log Search rules within a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of Log Search rule resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - final String filter = null; - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, filter)); - } - - /** - * List the Log Search rules within a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param filter The filter to apply on the operation. For more information please see - * https://msdn.microsoft.com/en-us/library/azure/dn931934.aspx. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of Log Search rule resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync( - String resourceGroupName, String filter, Context context) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, context)); - } - - /** - * List the Log Search rules within a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of Log Search rule resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - final String filter = null; - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, filter)); - } - - /** - * List the Log Search rules within a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param filter The filter to apply on the operation. For more information please see - * https://msdn.microsoft.com/en-us/library/azure/dn931934.aspx. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a collection of Log Search rule resources. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup( - String resourceGroupName, String filter, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, filter, context)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/TenantActivityLogsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/TenantActivityLogsClientImpl.java deleted file mode 100644 index df98bc640f91..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/TenantActivityLogsClientImpl.java +++ /dev/null @@ -1,404 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.fluent.TenantActivityLogsClient; -import com.azure.resourcemanager.monitor.fluent.models.EventDataInner; -import com.azure.resourcemanager.monitor.models.EventDataCollection; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in TenantActivityLogsClient. */ -public final class TenantActivityLogsClientImpl implements TenantActivityLogsClient { - private final ClientLogger logger = new ClientLogger(TenantActivityLogsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final TenantActivityLogsService service; - - /** The service client containing this operation class. */ - private final MonitorClientImpl client; - - /** - * Initializes an instance of TenantActivityLogsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - TenantActivityLogsClientImpl(MonitorClientImpl client) { - this.service = - RestProxy.create(TenantActivityLogsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MonitorClientTenantActivityLogs to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MonitorClientTenantA") - private interface TenantActivityLogsService { - @Headers({"Content-Type: application/json"}) - @Get("/providers/Microsoft.Insights/eventtypes/management/values") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @QueryParam("$filter") String filter, - @QueryParam("$select") String select, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets the Activity Logs for the Tenant.<br>Everything that is applicable to the API to get the Activity Logs - * for the subscription is applicable to this API (the parameters, $filter, etc.).<br>One thing to point out - * here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces - * the logs that were generated at the tenant level. - * - * @param filter Reduces the set of data collected. <br>The **$filter** is very restricted and allows only the - * following patterns.<br>- List events for a resource group: $filter=eventTimestamp ge '<Start - * Time>' and eventTimestamp le '<End Time>' and eventChannels eq 'Admin, Operation' and - * resourceGroupName eq '<ResourceGroupName>'.<br>- List events for resource: $filter=eventTimestamp - * ge '<Start Time>' and eventTimestamp le '<End Time>' and eventChannels eq 'Admin, Operation' and - * resourceUri eq '<ResourceURI>'.<br>- List events for a subscription: $filter=eventTimestamp ge - * '<Start Time>' and eventTimestamp le '<End Time>' and eventChannels eq 'Admin, - * Operation'.<br>- List events for a resource provider: $filter=eventTimestamp ge '<Start Time>' - * and eventTimestamp le '<End Time>' and eventChannels eq 'Admin, Operation' and resourceProvider eq - * '<ResourceProviderName>'.<br>- List events for a correlation Id: - * api-version=2014-04-01&$filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le - * '2014-07-20T04:36:37.6407898Z' and eventChannels eq 'Admin, Operation' and correlationId eq - * '<CorrelationID>'.<br>**NOTE**: No other syntax is allowed. - * @param select Used to fetch events with only the given properties.<br>The **$select** argument is a comma - * separated list of property names to be returned. Possible values are: *authorization*, *claims*, - * *correlationId*, *description*, *eventDataId*, *eventName*, *eventTimestamp*, *httpRequest*, *level*, - * *operationId*, *operationName*, *properties*, *resourceGroupName*, *resourceProviderName*, *resourceId*, - * *status*, *submissionTimestamp*, *subStatus*, *subscriptionId*. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Activity Logs for the Tenant. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String filter, String select) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String apiVersion = "2015-04-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.list(this.client.getEndpoint(), apiVersion, filter, select, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the Activity Logs for the Tenant.<br>Everything that is applicable to the API to get the Activity Logs - * for the subscription is applicable to this API (the parameters, $filter, etc.).<br>One thing to point out - * here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces - * the logs that were generated at the tenant level. - * - * @param filter Reduces the set of data collected. <br>The **$filter** is very restricted and allows only the - * following patterns.<br>- List events for a resource group: $filter=eventTimestamp ge '<Start - * Time>' and eventTimestamp le '<End Time>' and eventChannels eq 'Admin, Operation' and - * resourceGroupName eq '<ResourceGroupName>'.<br>- List events for resource: $filter=eventTimestamp - * ge '<Start Time>' and eventTimestamp le '<End Time>' and eventChannels eq 'Admin, Operation' and - * resourceUri eq '<ResourceURI>'.<br>- List events for a subscription: $filter=eventTimestamp ge - * '<Start Time>' and eventTimestamp le '<End Time>' and eventChannels eq 'Admin, - * Operation'.<br>- List events for a resource provider: $filter=eventTimestamp ge '<Start Time>' - * and eventTimestamp le '<End Time>' and eventChannels eq 'Admin, Operation' and resourceProvider eq - * '<ResourceProviderName>'.<br>- List events for a correlation Id: - * api-version=2014-04-01&$filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le - * '2014-07-20T04:36:37.6407898Z' and eventChannels eq 'Admin, Operation' and correlationId eq - * '<CorrelationID>'.<br>**NOTE**: No other syntax is allowed. - * @param select Used to fetch events with only the given properties.<br>The **$select** argument is a comma - * separated list of property names to be returned. Possible values are: *authorization*, *claims*, - * *correlationId*, *description*, *eventDataId*, *eventName*, *eventTimestamp*, *httpRequest*, *level*, - * *operationId*, *operationName*, *properties*, *resourceGroupName*, *resourceProviderName*, *resourceId*, - * *status*, *submissionTimestamp*, *subStatus*, *subscriptionId*. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Activity Logs for the Tenant. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String filter, String select, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String apiVersion = "2015-04-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, filter, select, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets the Activity Logs for the Tenant.<br>Everything that is applicable to the API to get the Activity Logs - * for the subscription is applicable to this API (the parameters, $filter, etc.).<br>One thing to point out - * here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces - * the logs that were generated at the tenant level. - * - * @param filter Reduces the set of data collected. <br>The **$filter** is very restricted and allows only the - * following patterns.<br>- List events for a resource group: $filter=eventTimestamp ge '<Start - * Time>' and eventTimestamp le '<End Time>' and eventChannels eq 'Admin, Operation' and - * resourceGroupName eq '<ResourceGroupName>'.<br>- List events for resource: $filter=eventTimestamp - * ge '<Start Time>' and eventTimestamp le '<End Time>' and eventChannels eq 'Admin, Operation' and - * resourceUri eq '<ResourceURI>'.<br>- List events for a subscription: $filter=eventTimestamp ge - * '<Start Time>' and eventTimestamp le '<End Time>' and eventChannels eq 'Admin, - * Operation'.<br>- List events for a resource provider: $filter=eventTimestamp ge '<Start Time>' - * and eventTimestamp le '<End Time>' and eventChannels eq 'Admin, Operation' and resourceProvider eq - * '<ResourceProviderName>'.<br>- List events for a correlation Id: - * api-version=2014-04-01&$filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le - * '2014-07-20T04:36:37.6407898Z' and eventChannels eq 'Admin, Operation' and correlationId eq - * '<CorrelationID>'.<br>**NOTE**: No other syntax is allowed. - * @param select Used to fetch events with only the given properties.<br>The **$select** argument is a comma - * separated list of property names to be returned. Possible values are: *authorization*, *claims*, - * *correlationId*, *description*, *eventDataId*, *eventName*, *eventTimestamp*, *httpRequest*, *level*, - * *operationId*, *operationName*, *properties*, *resourceGroupName*, *resourceProviderName*, *resourceId*, - * *status*, *submissionTimestamp*, *subStatus*, *subscriptionId*. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Activity Logs for the Tenant. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String filter, String select) { - return new PagedFlux<>( - () -> listSinglePageAsync(filter, select), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets the Activity Logs for the Tenant.<br>Everything that is applicable to the API to get the Activity Logs - * for the subscription is applicable to this API (the parameters, $filter, etc.).<br>One thing to point out - * here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces - * the logs that were generated at the tenant level. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Activity Logs for the Tenant. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - final String filter = null; - final String select = null; - return new PagedFlux<>( - () -> listSinglePageAsync(filter, select), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets the Activity Logs for the Tenant.<br>Everything that is applicable to the API to get the Activity Logs - * for the subscription is applicable to this API (the parameters, $filter, etc.).<br>One thing to point out - * here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces - * the logs that were generated at the tenant level. - * - * @param filter Reduces the set of data collected. <br>The **$filter** is very restricted and allows only the - * following patterns.<br>- List events for a resource group: $filter=eventTimestamp ge '<Start - * Time>' and eventTimestamp le '<End Time>' and eventChannels eq 'Admin, Operation' and - * resourceGroupName eq '<ResourceGroupName>'.<br>- List events for resource: $filter=eventTimestamp - * ge '<Start Time>' and eventTimestamp le '<End Time>' and eventChannels eq 'Admin, Operation' and - * resourceUri eq '<ResourceURI>'.<br>- List events for a subscription: $filter=eventTimestamp ge - * '<Start Time>' and eventTimestamp le '<End Time>' and eventChannels eq 'Admin, - * Operation'.<br>- List events for a resource provider: $filter=eventTimestamp ge '<Start Time>' - * and eventTimestamp le '<End Time>' and eventChannels eq 'Admin, Operation' and resourceProvider eq - * '<ResourceProviderName>'.<br>- List events for a correlation Id: - * api-version=2014-04-01&$filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le - * '2014-07-20T04:36:37.6407898Z' and eventChannels eq 'Admin, Operation' and correlationId eq - * '<CorrelationID>'.<br>**NOTE**: No other syntax is allowed. - * @param select Used to fetch events with only the given properties.<br>The **$select** argument is a comma - * separated list of property names to be returned. Possible values are: *authorization*, *claims*, - * *correlationId*, *description*, *eventDataId*, *eventName*, *eventTimestamp*, *httpRequest*, *level*, - * *operationId*, *operationName*, *properties*, *resourceGroupName*, *resourceProviderName*, *resourceId*, - * *status*, *submissionTimestamp*, *subStatus*, *subscriptionId*. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Activity Logs for the Tenant. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String filter, String select, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(filter, select, context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets the Activity Logs for the Tenant.<br>Everything that is applicable to the API to get the Activity Logs - * for the subscription is applicable to this API (the parameters, $filter, etc.).<br>One thing to point out - * here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces - * the logs that were generated at the tenant level. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Activity Logs for the Tenant. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - final String filter = null; - final String select = null; - return new PagedIterable<>(listAsync(filter, select)); - } - - /** - * Gets the Activity Logs for the Tenant.<br>Everything that is applicable to the API to get the Activity Logs - * for the subscription is applicable to this API (the parameters, $filter, etc.).<br>One thing to point out - * here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces - * the logs that were generated at the tenant level. - * - * @param filter Reduces the set of data collected. <br>The **$filter** is very restricted and allows only the - * following patterns.<br>- List events for a resource group: $filter=eventTimestamp ge '<Start - * Time>' and eventTimestamp le '<End Time>' and eventChannels eq 'Admin, Operation' and - * resourceGroupName eq '<ResourceGroupName>'.<br>- List events for resource: $filter=eventTimestamp - * ge '<Start Time>' and eventTimestamp le '<End Time>' and eventChannels eq 'Admin, Operation' and - * resourceUri eq '<ResourceURI>'.<br>- List events for a subscription: $filter=eventTimestamp ge - * '<Start Time>' and eventTimestamp le '<End Time>' and eventChannels eq 'Admin, - * Operation'.<br>- List events for a resource provider: $filter=eventTimestamp ge '<Start Time>' - * and eventTimestamp le '<End Time>' and eventChannels eq 'Admin, Operation' and resourceProvider eq - * '<ResourceProviderName>'.<br>- List events for a correlation Id: - * api-version=2014-04-01&$filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le - * '2014-07-20T04:36:37.6407898Z' and eventChannels eq 'Admin, Operation' and correlationId eq - * '<CorrelationID>'.<br>**NOTE**: No other syntax is allowed. - * @param select Used to fetch events with only the given properties.<br>The **$select** argument is a comma - * separated list of property names to be returned. Possible values are: *authorization*, *claims*, - * *correlationId*, *description*, *eventDataId*, *eventName*, *eventTimestamp*, *httpRequest*, *level*, - * *operationId*, *operationName*, *properties*, *resourceGroupName*, *resourceProviderName*, *resourceId*, - * *status*, *submissionTimestamp*, *subStatus*, *subscriptionId*. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Activity Logs for the Tenant. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String filter, String select, Context context) { - return new PagedIterable<>(listAsync(filter, select, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents collection of events. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents collection of events. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/VMInsightsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/VMInsightsClientImpl.java deleted file mode 100644 index 4cb9b2fd4a4c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/VMInsightsClientImpl.java +++ /dev/null @@ -1,182 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.fluent.VMInsightsClient; -import com.azure.resourcemanager.monitor.fluent.models.VMInsightsOnboardingStatusInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in VMInsightsClient. */ -public final class VMInsightsClientImpl implements VMInsightsClient { - private final ClientLogger logger = new ClientLogger(VMInsightsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final VMInsightsService service; - - /** The service client containing this operation class. */ - private final MonitorClientImpl client; - - /** - * Initializes an instance of VMInsightsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - VMInsightsClientImpl(MonitorClientImpl client) { - this.service = - RestProxy.create(VMInsightsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MonitorClientVMInsights to be used by the proxy service to perform - * REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MonitorClientVMInsig") - private interface VMInsightsService { - @Headers({"Content-Type: application/json"}) - @Get("/{resourceUri}/providers/Microsoft.Insights/vmInsightsOnboardingStatuses/default") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getOnboardingStatus( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceUri", encoded = true) String resourceUri, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource, or scope, whose status - * to retrieve. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vM Insights onboarding status for a resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getOnboardingStatusWithResponseAsync(String resourceUri) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceUri == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); - } - final String apiVersion = "2018-11-27-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service.getOnboardingStatus(this.client.getEndpoint(), apiVersion, resourceUri, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource, or scope, whose status - * to retrieve. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vM Insights onboarding status for a resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getOnboardingStatusWithResponseAsync( - String resourceUri, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceUri == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); - } - final String apiVersion = "2018-11-27-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getOnboardingStatus(this.client.getEndpoint(), apiVersion, resourceUri, accept, context); - } - - /** - * Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource, or scope, whose status - * to retrieve. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vM Insights onboarding status for a resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getOnboardingStatusAsync(String resourceUri) { - return getOnboardingStatusWithResponseAsync(resourceUri) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource, or scope, whose status - * to retrieve. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vM Insights onboarding status for a resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VMInsightsOnboardingStatusInner getOnboardingStatus(String resourceUri) { - return getOnboardingStatusAsync(resourceUri).block(); - } - - /** - * Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource, or scope, whose status - * to retrieve. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vM Insights onboarding status for a resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getOnboardingStatusWithResponse( - String resourceUri, Context context) { - return getOnboardingStatusWithResponseAsync(resourceUri, context).block(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/Action.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/Action.java deleted file mode 100644 index e416de2176fa..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/Action.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** Action descriptor. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "odata\\.type", - defaultImpl = Action.class) -@JsonTypeName("Action") -@JsonSubTypes({ - @JsonSubTypes.Type( - name = - "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts" - + ".Resources.ScheduledQueryRules.AlertingAction", - value = AlertingAction.class), - @JsonSubTypes.Type( - name = - "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts" - + ".Resources.ScheduledQueryRules.LogToMetricAction", - value = LogToMetricAction.class) -}) -@JsonFlatten -@Immutable -public class Action { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Action.class); - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ActionGroup.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ActionGroup.java deleted file mode 100644 index c06bb3d34a0b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ActionGroup.java +++ /dev/null @@ -1,433 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.monitor.MonitorManager; -import com.azure.resourcemanager.monitor.fluent.models.ActionGroupResourceInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.GroupableResource; -import com.azure.resourcemanager.resources.fluentcore.arm.models.Resource; -import com.azure.resourcemanager.resources.fluentcore.model.Appliable; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; -import com.azure.resourcemanager.resources.fluentcore.model.Updatable; -import java.util.List; - -/** An immutable client-side representation of an Azure Action Group. */ -@Fluent -public interface ActionGroup - extends GroupableResource, - Refreshable, - Updatable { - /** - * Get the groupShortName value. - * - * @return the groupShortName value - */ - String shortName(); - - /** - * Get the emailReceivers value. - * - * @return the emailReceivers value - */ - List emailReceivers(); - - /** - * Get the smsReceivers value. - * - * @return the smsReceivers value - */ - List smsReceivers(); - - /** - * Get the webhookReceivers value. - * - * @return the webhookReceivers value - */ - List webhookReceivers(); - - /** - * Get the itsmReceivers value. - * - * @return the itsmReceivers value - */ - List itsmReceivers(); - - /** - * Get the pushNotificationReceivers value. - * - * @return the pushNotificationReceivers value - */ - List pushNotificationReceivers(); - - /** - * Get the automationRunbookReceivers value. - * - * @return the automationRunbookReceivers value - */ - List automationRunbookReceivers(); - - /** - * Get the voiceReceivers value. - * - * @return the voiceReceivers value - */ - List voiceReceivers(); - - /** - * Get the logicAppReceivers value. - * - * @return the logicAppReceivers value - */ - List logicAppReceivers(); - - /** - * Get the azureFunctionReceivers value. - * - * @return the azureFunctionReceivers value - */ - List azureFunctionReceivers(); - - /** - * Receivers action definition allowing to set each receiver's configuration. - * - * @param the next stage of the definition. - */ - interface ActionDefinition { - /** - * Sets the email receiver. - * - * @param emailAddress the email Address value to set - * @return the next stage of the definition - */ - ActionDefinition withEmail(String emailAddress); - - /** - * Sets the SMS receiver. - * - * @param countryCode the countryCode value to set - * @param phoneNumber the phoneNumber value to set - * @return the next stage of the definition - */ - ActionDefinition withSms(String countryCode, String phoneNumber); - - /** - * Sets the Webhook receiver. - * - * @param serviceUri the serviceUri value to set - * @return the next stage of the definition - */ - ActionDefinition withWebhook(String serviceUri); - - /** - * Sets the ITSM receiver. - * - * @param workspaceId the workspaceId value to set - * @param connectionId the connectionId value to set - * @param ticketConfiguration the ticketConfiguration value to set - * @param region the region value to set - * @return the next stage of the definition - */ - ActionDefinition withItsm( - String workspaceId, String connectionId, String ticketConfiguration, String region); - - /** - * Sets the Azure Mobile App Push Notification receiver. - * - * @param emailAddress the emailAddress value to set - * @return the next stage of the definition - */ - ActionDefinition withPushNotification(String emailAddress); - - /** - * Sets the Azure Automation Runbook notification receiver. - * - * @param automationAccountId the automationAccountId value to set - * @param runbookName the runbookName value to set - * @param webhookResourceId the webhookResourceId value to set - * @param isGlobalRunbook the isGlobalRunbook value to set - * @return the next stage of the definition - */ - ActionDefinition withAutomationRunbook( - String automationAccountId, String runbookName, String webhookResourceId, boolean isGlobalRunbook); - - /** - * Sets the Voice notification receiver. - * - * @param countryCode the countryCode value to set - * @param phoneNumber the phoneNumber value to set - * @return the next stage of the definition - */ - ActionDefinition withVoice(String countryCode, String phoneNumber); - - /** - * Sets the Logic App receiver. - * - * @param logicAppResourceId the logicAppResourceId value to set - * @param callbackUrl the callbackUrl value to set - * @return the next stage of the definition - */ - ActionDefinition withLogicApp(String logicAppResourceId, String callbackUrl); - - /** - * Sets the Azure Functions receiver. - * - * @param functionAppResourceId the functionAppResourceId value to set - * @param functionName the functionName value to set - * @param httpTriggerUrl the httpTriggerUrl value to set - * @return the next stage of the definition - */ - ActionDefinition withAzureFunction( - String functionAppResourceId, String functionName, String httpTriggerUrl); - - /** - * Attaches the defined receivers to the Action Group configuration. - * - * @return the next stage of the definition - */ - ParentT attach(); - } - - /** The entirety of a Action Group definition. */ - interface Definition extends DefinitionStages.Blank, - ActionDefinition, - DefinitionStages.WithCreate { - } - - /** Grouping of Action Group definition stages. */ - interface DefinitionStages { - /** The first stage of a Action Group definition allowing the resource group to be specified. */ - interface Blank extends GroupableResource.DefinitionStages.WithGroupAndRegion { - } - - /** - * The stage of the definition which contains all the minimum required inputs for the resource to be created but - * also allows for any other optional settings to be specified. - */ - interface WithCreate extends Creatable, DefinitionWithTags { - - /** - * Begins the definition of Action Group receivers with the specified name prefix. - * - * @param actionNamePrefix prefix for each receiver name. - * @return the next stage of the definition - */ - ActionDefinition defineReceiver(String actionNamePrefix); - - /** - * Sets the short name of the action group. This will be used in SMS messages. Maximum length cannot exceed - * 12 symbols. - * - * @param shortName short name of the action group. Cannot exceed 12 symbols. - * @return the next stage of the definition - */ - WithCreate withShortName(String shortName); - } - } - - /** Grouping of Action Group update stages. */ - interface UpdateStages { - - /** The stage of update which contains all the top level fields and transition stages to receiver updates. */ - interface WithActionDefinition { - /** - * Removes all the receivers that contain specified actionNamePrefix string in the name. - * - * @param actionNamePrefix the actionNamePrefix value to use during receiver filtering. - * @return the next stage of the update - */ - Update withoutReceiver(String actionNamePrefix); - - /** - * Begins a definition for a new receiver group in the current Action group object. - * - * @param actionNamePrefix the actionNamePrefix value to use during receiver name creation. - * @return the next stage of the update - */ - ActionDefinition defineReceiver(String actionNamePrefix); - - /** - * Begins an update flow for an existing receiver group. - * - * @param actionNamePrefix the actionNamePrefix value to use during receiver filtering. - * @return the next stage of the update - */ - WithActionUpdateDefinition updateReceiver(String actionNamePrefix); - - /** - * Sets the short name of the action group. This will be used in SMS messages. Maximum length cannot exceed - * 12 symbols. - * - * @param shortName short name of the action group. Cannot exceed 12 symbols - * @return the next stage of the update - */ - Update withShortName(String shortName); - } - - /** Receivers action update stage allowing to set each receiver's configuration. */ - interface WithActionUpdateDefinition { - /** - * Removes email receiver from current receiver's group. - * - * @return the next stage of the receiver group update - */ - WithActionUpdateDefinition withoutEmail(); - - /** - * Removes SMS receiver from current receiver's group. - * - * @return the next stage of the receiver group update - */ - WithActionUpdateDefinition withoutSms(); - - /** - * Removes Webhook receiver from current receiver's group. - * - * @return the next stage of the receiver group update - */ - WithActionUpdateDefinition withoutWebhook(); - - /** - * Removes ITSM receiver from current receiver's group. - * - * @return the next stage of the receiver group update - */ - WithActionUpdateDefinition withoutItsm(); - - /** - * Removes Azure mobile App Push notification receiver from current receiver's group. - * - * @return the next stage of the receiver group update - */ - WithActionUpdateDefinition withoutPushNotification(); - - /** - * Removes Azure Automation Runbook receiver from current receiver's group. - * - * @return the next stage of the receiver group update - */ - WithActionUpdateDefinition withoutAutomationRunbook(); - - /** - * Removes Voice receiver from current receiver's group. - * - * @return the next stage of the receiver group update - */ - WithActionUpdateDefinition withoutVoice(); - - /** - * Removes Azure Logic App receiver from current receiver's group. - * - * @return the next stage of the receiver group update - */ - WithActionUpdateDefinition withoutLogicApp(); - - /** - * Removes Azure Function receiver from current receiver's group. - * - * @return the next stage of the receiver group update - */ - WithActionUpdateDefinition withoutAzureFunction(); - - /** - * Sets the email receiver. - * - * @param emailAddress the email Address value to set - * @return the next stage of the update - */ - WithActionUpdateDefinition withEmail(String emailAddress); - - /** - * Sets the SMS receiver. - * - * @param countryCode the countryCode value to set - * @param phoneNumber the phoneNumber value to set - * @return the next stage of the update - */ - WithActionUpdateDefinition withSms(String countryCode, String phoneNumber); - - /** - * Sets the Webhook receiver. - * - * @param serviceUri the serviceUri value to set - * @return the next stage of the update - */ - WithActionUpdateDefinition withWebhook(String serviceUri); - - /** - * Sets the ITSM receiver. - * - * @param workspaceId the workspaceId value to set - * @param connectionId the connectionId value to set - * @param ticketConfiguration the ticketConfiguration value to set - * @param region the region value to set - * @return the next stage of the update - */ - WithActionUpdateDefinition withItsm( - String workspaceId, String connectionId, String ticketConfiguration, String region); - - /** - * Sets the Azure Mobile App Push Notification receiver. - * - * @param emailAddress the emailAddress value to set - * @return the next stage of the update - */ - WithActionUpdateDefinition withPushNotification(String emailAddress); - - /** - * Sets the Azure Automation Runbook notification receiver. - * - * @param automationAccountId the automationAccountId value to set - * @param runbookName the runbookName value to set - * @param webhookResourceId the webhookResourceId value to set - * @param isGlobalRunbook the isGlobalRunbook value to set - * @return the next stage of the update - */ - WithActionUpdateDefinition withAutomationRunbook( - String automationAccountId, String runbookName, String webhookResourceId, boolean isGlobalRunbook); - - /** - * Sets the Voice notification receiver. - * - * @param countryCode the countryCode value to set - * @param phoneNumber the phoneNumber value to set - * @return the next stage of the update - */ - WithActionUpdateDefinition withVoice(String countryCode, String phoneNumber); - - /** - * Sets the Logic App receiver. - * - * @param logicAppResourceId the logicAppResourceId value to set - * @param callbackUrl the callbackUrl value to set - * @return the next stage of the update - */ - WithActionUpdateDefinition withLogicApp(String logicAppResourceId, String callbackUrl); - - /** - * Sets the Azure Functions receiver. - * - * @param functionAppResourceId the functionAppResourceId value to set - * @param functionName the functionName value to set - * @param httpTriggerUrl the httpTriggerUrl value to set - * @return the next stage of the update - */ - WithActionUpdateDefinition withAzureFunction( - String functionAppResourceId, String functionName, String httpTriggerUrl); - - /** - * Returns to the Action Group update flow. - * - * @return the next stage of the update - */ - Update parent(); - } - } - - /** The template for an update operation, containing all the settings that can be modified. */ - interface Update - extends Appliable, UpdateStages.WithActionDefinition, Resource.UpdateWithTags { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ActionGroupList.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ActionGroupList.java deleted file mode 100644 index 8219a909ffce..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ActionGroupList.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.fluent.models.ActionGroupResourceInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** A list of action groups. */ -@Fluent -public final class ActionGroupList { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ActionGroupList.class); - - /* - * The list of action groups. - */ - @JsonProperty(value = "value") - private List value; - - /* - * Provides the link to retrieve the next set of elements. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: The list of action groups. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The list of action groups. - * - * @param value the value value to set. - * @return the ActionGroupList object itself. - */ - public ActionGroupList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Provides the link to retrieve the next set of elements. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: Provides the link to retrieve the next set of elements. - * - * @param nextLink the nextLink value to set. - * @return the ActionGroupList object itself. - */ - public ActionGroupList withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ActionGroupPatchBody.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ActionGroupPatchBody.java deleted file mode 100644 index 565a261adb12..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ActionGroupPatchBody.java +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** An action group object for the body of patch operations. */ -@JsonFlatten -@Fluent -public class ActionGroupPatchBody { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ActionGroupPatchBody.class); - - /* - * Resource tags - */ - @JsonProperty(value = "tags") - private Map tags; - - /* - * Indicates whether this action group is enabled. If an action group is - * not enabled, then none of its actions will be activated. - */ - @JsonProperty(value = "properties.enabled") - private Boolean enabled; - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Resource tags. - * - * @param tags the tags value to set. - * @return the ActionGroupPatchBody object itself. - */ - public ActionGroupPatchBody withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Get the enabled property: Indicates whether this action group is enabled. If an action group is not enabled, then - * none of its actions will be activated. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Indicates whether this action group is enabled. If an action group is not enabled, then - * none of its actions will be activated. - * - * @param enabled the enabled value to set. - * @return the ActionGroupPatchBody object itself. - */ - public ActionGroupPatchBody withEnabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ActionGroups.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ActionGroups.java deleted file mode 100644 index eea4f44e234c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ActionGroups.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.monitor.MonitorManager; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsBatchDeletion; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsDeletingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsListingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsBatchCreation; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsCreating; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingById; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; -import reactor.core.publisher.Mono; - -/** Entry point for Action Group management API. */ -@Fluent -public interface ActionGroups - extends SupportsCreating, - SupportsListing, - SupportsListingByResourceGroup, - SupportsGettingById, - SupportsBatchCreation, - SupportsDeletingById, - SupportsDeletingByResourceGroup, - SupportsBatchDeletion, - HasManager { - - /** - * Enable a receiver in an action group. This changes the receiver's status from Disabled to Enabled. This operation - * is only supported for Email or SMS receivers. - * - * @param resourceGroupName The name of the resource group. - * @param actionGroupName The name of the action group. - * @param receiverName The name of the receiver to resubscribe. - */ - void enableReceiver(String resourceGroupName, String actionGroupName, String receiverName); - - /** - * Enable a receiver in an action group. This changes the receiver's status from Disabled to Enabled. This operation - * is only supported for Email or SMS receivers. - * - * @param resourceGroupName The name of the resource group. - * @param actionGroupName The name of the action group. - * @param receiverName The name of the receiver to resubscribe. - * @return a representation of the deferred computation of this call. - */ - Mono enableReceiverAsync(String resourceGroupName, String actionGroupName, String receiverName); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ActivityLogAlert.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ActivityLogAlert.java deleted file mode 100644 index 724c0e97a074..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ActivityLogAlert.java +++ /dev/null @@ -1,261 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.monitor.MonitorManager; -import com.azure.resourcemanager.monitor.fluent.models.ActivityLogAlertResourceInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.GroupableResource; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasId; -import com.azure.resourcemanager.resources.fluentcore.arm.models.Resource; -import com.azure.resourcemanager.resources.fluentcore.model.Appliable; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; -import com.azure.resourcemanager.resources.fluentcore.model.Updatable; -import java.util.Collection; -import java.util.Map; - -/** An immutable client-side representation of an Azure Activity Log Alert. */ -@Fluent -public interface ActivityLogAlert - extends GroupableResource, - Refreshable, - Updatable { - - /** - * Get a list of resourceIds that will be used as prefixes. The alert will only apply to activityLogs with - * resourceIds that fall under one of these prefixes. This list must include at least one item. - * - * @return the scopes value - */ - Collection scopes(); - - /** - * Get indicates whether this activity log alert is enabled. If an activity log alert is not enabled, then none of - * its actions will be activated. - * - * @return the enabled value - */ - Boolean enabled(); - - /** - * Get the condition that will cause this alert to activate. - * - * @return the condition value - */ - Map equalsConditions(); - - /** - * Get the actions that will activate when the condition is met. - * - * @return the actions value - */ - Collection actionGroupIds(); - - /** - * Get a description of this activity log alert. - * - * @return the description value - */ - String description(); - - /** The entirety of a activity log alerts definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithCreate, - DefinitionStages.WithScopes, - DefinitionStages.WithDescription, - DefinitionStages.WithAlertEnabled, - DefinitionStages.WithActionGroup, - DefinitionStages.WithCriteriaDefinition { - } - - /** Grouping of activity log alerts definition stages. */ - interface DefinitionStages { - /** The first stage of a activity log alert definition. */ - interface Blank extends GroupableResource.DefinitionStages.WithGroupAndRegion { - } - - /** The stage of the definition which specifies target resource or subscription for activity log alert. */ - interface WithScopes { - /** - * Sets specified resource as a target to alert on activity log. - * - * @param resourceId resource Id string. - * @return the next stage of activity log alert definition. - */ - WithDescription withTargetResource(String resourceId); - - /** - * Sets specified resource as a target to alert on activity log. - * - * @param resource resource type that is inherited from {@link HasId} interface - * @return the next stage of activity log alert definition. - */ - WithDescription withTargetResource(HasId resource); - - /** - * Sets specified subscription as a target to alert on activity log. - * - * @param targetSubscriptionId subscription Id. - * @return the next stage of activity log alert definition. - */ - WithDescription withTargetSubscription(String targetSubscriptionId); - } - - /** The stage of the definition which specifies description text for activity log alert. */ - interface WithDescription { - /** - * Sets description for activity log alert. - * - * @param description Human readable text description of the activity log alert. - * @return the next stage of activity log alert definition. - */ - WithAlertEnabled withDescription(String description); - } - - /** The stage of the definition which specifies if the activity log alert should be enabled upon creation. */ - interface WithAlertEnabled { - /** - * Sets activity log alert as enabled during the creation. - * - * @return the next stage of activity log alert definition. - */ - WithActionGroup withRuleEnabled(); - - /** - * Sets activity log alert as disabled during the creation. - * - * @return the next stage of activity log alert definition. - */ - WithActionGroup withRuleDisabled(); - } - - /** - * The stage of the definition which specifies actions that will be activated when the conditions are met in the - * activity log alert rules. - */ - interface WithActionGroup { - /** - * Sets the actions that will activate when the condition is met. - * - * @param actionGroupId resource Ids of the {@link ActionGroup}. - * @return the next stage of activity log alert definition. - */ - WithCriteriaDefinition withActionGroups(String... actionGroupId); - } - - /** The stage of the definition which specifies condition that will cause this alert to activate. */ - interface WithCriteriaDefinition { - /** - * Adds a condition that will cause this alert to activate. - * - * @param field Set the name of the field that this condition will examine. The possible values for this - * field are (case-insensitive): 'resourceId', 'category', 'caller', 'level', 'operationName', - * 'resourceGroup', 'resourceProvider', 'status', 'subStatus', 'resourceType', or anything beginning - * with 'properties.'. - * @param equals Set the field value will be compared to this value (case-insensitive) to determine if the - * condition is met. - * @return the next stage of activity log alert definition. - */ - WithCreate withEqualsCondition(String field, String equals); - - /** - * Sets all the conditions that will cause this alert to activate. - * - * @param fieldEqualsMap Set the names of the field that this condition will examine and their values to be - * compared to. - * @return the next stage of activity log alert definition. - */ - WithCreate withEqualsConditions(Map fieldEqualsMap); - } - - /** - * The stage of the definition which contains all the minimum required inputs for the resource to be created but - * also allows for any other optional settings to be specified. - */ - interface WithCreate - extends Creatable, DefinitionWithTags, WithCriteriaDefinition { - } - } - - /** Grouping of activity log alerts update stages. */ - interface UpdateStages { - /** The stage of a activity log alerts update allowing to modify settings. */ - interface WithActivityLogUpdate { - /** - * Sets description for activity log alert. - * - * @param description Human readable text description of the activity log alert. - * @return the next stage of the activity log alert update. - */ - Update withDescription(String description); - - /** - * Sets activity log alert as enabled. - * - * @return the next stage of the activity log alert update. - */ - Update withRuleEnabled(); - - /** - * Sets activity log alert as disabled. - * - * @return the next stage of the activity log alert update. - */ - Update withRuleDisabled(); - - /** - * Sets the actions that will activate when the condition is met. - * - * @param actionGroupId resource Ids of the {@link ActionGroup}. - * @return the next stage of the activity log alert update. - */ - Update withActionGroups(String... actionGroupId); - - /** - * Removes the specified action group from the actions list. - * - * @param actionGroupId resource Id of the {@link ActionGroup} to remove. - * @return the next stage of the activity log alert update. - */ - Update withoutActionGroup(String actionGroupId); - - /** - * Adds a condition that will cause this alert to activate. - * - * @param field Set the name of the field that this condition will examine. The possible values for this - * field are (case-insensitive): 'resourceId', 'category', 'caller', 'level', 'operationName', - * 'resourceGroup', 'resourceProvider', 'status', 'subStatus', 'resourceType', or anything beginning - * with 'properties.'. - * @param equals Set the field value will be compared to this value (case-insensitive) to determine if the - * condition is met. - * @return the next stage of the activity log alert update. - */ - Update withEqualsCondition(String field, String equals); - - /** - * Sets all the conditions that will cause this alert to activate. - * - * @param fieldEqualsMap Set the names of the field that this condition will examine and their values to be - * compared to. - * @return the next stage of the activity log alert update. - */ - Update withEqualsConditions(Map fieldEqualsMap); - - /** - * Removes a condition from the list of conditions. - * - * @param field the name of the field that was used for condition examination. - * @return the next stage of the activity log alert update. - */ - Update withoutEqualsCondition(String field); - } - } - - /** The template for an update operation, containing all the settings that can be modified. */ - interface Update - extends Appliable, UpdateStages.WithActivityLogUpdate, Resource.UpdateWithTags { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ActivityLogAlertActionGroup.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ActivityLogAlertActionGroup.java deleted file mode 100644 index 6c11b4471668..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ActivityLogAlertActionGroup.java +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** A pointer to an Azure Action Group. */ -@Fluent -public final class ActivityLogAlertActionGroup { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ActivityLogAlertActionGroup.class); - - /* - * The resourceId of the action group. This cannot be null or empty. - */ - @JsonProperty(value = "actionGroupId", required = true) - private String actionGroupId; - - /* - * the dictionary of custom properties to include with the post operation. - * These data are appended to the webhook payload. - */ - @JsonProperty(value = "webhookProperties") - private Map webhookProperties; - - /** - * Get the actionGroupId property: The resourceId of the action group. This cannot be null or empty. - * - * @return the actionGroupId value. - */ - public String actionGroupId() { - return this.actionGroupId; - } - - /** - * Set the actionGroupId property: The resourceId of the action group. This cannot be null or empty. - * - * @param actionGroupId the actionGroupId value to set. - * @return the ActivityLogAlertActionGroup object itself. - */ - public ActivityLogAlertActionGroup withActionGroupId(String actionGroupId) { - this.actionGroupId = actionGroupId; - return this; - } - - /** - * Get the webhookProperties property: the dictionary of custom properties to include with the post operation. These - * data are appended to the webhook payload. - * - * @return the webhookProperties value. - */ - public Map webhookProperties() { - return this.webhookProperties; - } - - /** - * Set the webhookProperties property: the dictionary of custom properties to include with the post operation. These - * data are appended to the webhook payload. - * - * @param webhookProperties the webhookProperties value to set. - * @return the ActivityLogAlertActionGroup object itself. - */ - public ActivityLogAlertActionGroup withWebhookProperties(Map webhookProperties) { - this.webhookProperties = webhookProperties; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (actionGroupId() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property actionGroupId in model ActivityLogAlertActionGroup")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ActivityLogAlertActionList.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ActivityLogAlertActionList.java deleted file mode 100644 index cd18ac205223..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ActivityLogAlertActionList.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** A list of activity log alert actions. */ -@Fluent -public final class ActivityLogAlertActionList { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ActivityLogAlertActionList.class); - - /* - * The list of activity log alerts. - */ - @JsonProperty(value = "actionGroups") - private List actionGroups; - - /** - * Get the actionGroups property: The list of activity log alerts. - * - * @return the actionGroups value. - */ - public List actionGroups() { - return this.actionGroups; - } - - /** - * Set the actionGroups property: The list of activity log alerts. - * - * @param actionGroups the actionGroups value to set. - * @return the ActivityLogAlertActionList object itself. - */ - public ActivityLogAlertActionList withActionGroups(List actionGroups) { - this.actionGroups = actionGroups; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (actionGroups() != null) { - actionGroups().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ActivityLogAlertAllOfCondition.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ActivityLogAlertAllOfCondition.java deleted file mode 100644 index 0d2b58329667..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ActivityLogAlertAllOfCondition.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** An Activity Log alert condition that is met when all its member conditions are met. */ -@Fluent -public final class ActivityLogAlertAllOfCondition { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ActivityLogAlertAllOfCondition.class); - - /* - * The list of activity log alert conditions. - */ - @JsonProperty(value = "allOf", required = true) - private List allOf; - - /** - * Get the allOf property: The list of activity log alert conditions. - * - * @return the allOf value. - */ - public List allOf() { - return this.allOf; - } - - /** - * Set the allOf property: The list of activity log alert conditions. - * - * @param allOf the allOf value to set. - * @return the ActivityLogAlertAllOfCondition object itself. - */ - public ActivityLogAlertAllOfCondition withAllOf(List allOf) { - this.allOf = allOf; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (allOf() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property allOf in model ActivityLogAlertAllOfCondition")); - } else { - allOf().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ActivityLogAlertLeafCondition.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ActivityLogAlertLeafCondition.java deleted file mode 100644 index 445be0f54790..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ActivityLogAlertLeafCondition.java +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** An Activity Log alert condition that is met by comparing an activity log field and value. */ -@Fluent -public final class ActivityLogAlertLeafCondition { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ActivityLogAlertLeafCondition.class); - - /* - * The name of the field that this condition will examine. The possible - * values for this field are (case-insensitive): 'resourceId', 'category', - * 'caller', 'level', 'operationName', 'resourceGroup', 'resourceProvider', - * 'status', 'subStatus', 'resourceType', or anything beginning with - * 'properties.'. - */ - @JsonProperty(value = "field", required = true) - private String field; - - /* - * The field value will be compared to this value (case-insensitive) to - * determine if the condition is met. - */ - @JsonProperty(value = "equals", required = true) - private String equals; - - /** - * Get the field property: The name of the field that this condition will examine. The possible values for this - * field are (case-insensitive): 'resourceId', 'category', 'caller', 'level', 'operationName', 'resourceGroup', - * 'resourceProvider', 'status', 'subStatus', 'resourceType', or anything beginning with 'properties.'. - * - * @return the field value. - */ - public String field() { - return this.field; - } - - /** - * Set the field property: The name of the field that this condition will examine. The possible values for this - * field are (case-insensitive): 'resourceId', 'category', 'caller', 'level', 'operationName', 'resourceGroup', - * 'resourceProvider', 'status', 'subStatus', 'resourceType', or anything beginning with 'properties.'. - * - * @param field the field value to set. - * @return the ActivityLogAlertLeafCondition object itself. - */ - public ActivityLogAlertLeafCondition withField(String field) { - this.field = field; - return this; - } - - /** - * Get the equals property: The field value will be compared to this value (case-insensitive) to determine if the - * condition is met. - * - * @return the equals value. - */ - public String equals() { - return this.equals; - } - - /** - * Set the equals property: The field value will be compared to this value (case-insensitive) to determine if the - * condition is met. - * - * @param equals the equals value to set. - * @return the ActivityLogAlertLeafCondition object itself. - */ - public ActivityLogAlertLeafCondition withEquals(String equals) { - this.equals = equals; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (field() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property field in model ActivityLogAlertLeafCondition")); - } - if (equals() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property equals in model ActivityLogAlertLeafCondition")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ActivityLogAlertList.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ActivityLogAlertList.java deleted file mode 100644 index 44ea1f0c9e53..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ActivityLogAlertList.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.fluent.models.ActivityLogAlertResourceInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** A list of activity log alerts. */ -@Fluent -public final class ActivityLogAlertList { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ActivityLogAlertList.class); - - /* - * The list of activity log alerts. - */ - @JsonProperty(value = "value") - private List value; - - /* - * Provides the link to retrieve the next set of elements. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: The list of activity log alerts. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The list of activity log alerts. - * - * @param value the value value to set. - * @return the ActivityLogAlertList object itself. - */ - public ActivityLogAlertList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Provides the link to retrieve the next set of elements. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: Provides the link to retrieve the next set of elements. - * - * @param nextLink the nextLink value to set. - * @return the ActivityLogAlertList object itself. - */ - public ActivityLogAlertList withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ActivityLogAlertPatchBody.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ActivityLogAlertPatchBody.java deleted file mode 100644 index 8257328a8e12..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ActivityLogAlertPatchBody.java +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** An activity log alert object for the body of patch operations. */ -@JsonFlatten -@Fluent -public class ActivityLogAlertPatchBody { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ActivityLogAlertPatchBody.class); - - /* - * Resource tags - */ - @JsonProperty(value = "tags") - private Map tags; - - /* - * Indicates whether this activity log alert is enabled. If an activity log - * alert is not enabled, then none of its actions will be activated. - */ - @JsonProperty(value = "properties.enabled") - private Boolean enabled; - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Resource tags. - * - * @param tags the tags value to set. - * @return the ActivityLogAlertPatchBody object itself. - */ - public ActivityLogAlertPatchBody withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Get the enabled property: Indicates whether this activity log alert is enabled. If an activity log alert is not - * enabled, then none of its actions will be activated. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Indicates whether this activity log alert is enabled. If an activity log alert is not - * enabled, then none of its actions will be activated. - * - * @param enabled the enabled value to set. - * @return the ActivityLogAlertPatchBody object itself. - */ - public ActivityLogAlertPatchBody withEnabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ActivityLogAlerts.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ActivityLogAlerts.java deleted file mode 100644 index 27a7b5b5bc38..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ActivityLogAlerts.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.monitor.MonitorManager; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsBatchDeletion; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsDeletingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsListingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsBatchCreation; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsCreating; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingById; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; - -/** Entry point for Activity Log Alert management API. */ -@Fluent -public interface ActivityLogAlerts - extends SupportsCreating, - SupportsListing, - SupportsListingByResourceGroup, - SupportsGettingById, - SupportsDeletingById, - SupportsDeletingByResourceGroup, - SupportsBatchCreation, - SupportsBatchDeletion, - HasManager { -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ActivityLogs.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ActivityLogs.java deleted file mode 100644 index 21dd3a318ea7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ActivityLogs.java +++ /dev/null @@ -1,148 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.monitor.MonitorManager; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import java.time.OffsetDateTime; - -/** Entry point for Monitor Activity logs API. */ -public interface ActivityLogs extends HasManager { - - /** - * Lists available event categories supported in the Activity Logs Service. - * - * @return list of available event categories supported in the Activity Logs Service. - */ - PagedIterable listEventCategories(); - - /** - * Lists available event categories supported in the Activity Logs Service. - * - * @return list of available event categories supported in the Activity Logs Service. - */ - PagedFlux listEventCategoriesAsync(); - - /** - * Begins a definition for a new Activity log query. - * - * @return the stage of start time filter definition. - */ - ActivityLogsQueryDefinitionStages.WithEventDataStartTimeFilter defineQuery(); - - /** The entirety of a Activity Logs query definition. */ - interface ActivityLogsQueryDefinition - extends ActivityLogsQueryDefinitionStages.WithEventDataStartTimeFilter, - ActivityLogsQueryDefinitionStages.WithEventDataEndFilter, - ActivityLogsQueryDefinitionStages.WithEventDataFieldFilter, - ActivityLogsQueryDefinitionStages.WithActivityLogsSelectFilter, - ActivityLogsQueryDefinitionStages.WithActivityLogsQueryExecute { - } - - /** Grouping of Activity log query stages. */ - interface ActivityLogsQueryDefinitionStages { - - /** The stage of a Activity Log query allowing to specify start time filter. */ - interface WithEventDataStartTimeFilter { - /** - * Sets the start time for Activity Log query filter. - * - * @param startTime specifies start time of cut off filter. - * @return the stage of end time filter definition. - */ - WithEventDataEndFilter startingFrom(OffsetDateTime startTime); - } - - /** The stage of a Activity Log query allowing to specify end time filter. */ - interface WithEventDataEndFilter { - /** - * Sets the end time for Activity Log query filter. - * - * @param endTime specifies end time of cut off filter. - * @return the stage of optional query parameter definition and query execution. - */ - WithEventDataFieldFilter endsBefore(OffsetDateTime endTime); - } - - /** The stage of a Activity Log query allowing to specify data fields in the server response. */ - interface WithEventDataFieldFilter { - /** - * Selects data fields that will be populated in the server response. - * - * @param responseProperties field names in the server response. - * @return the stage of Activity log filtering by type and query execution. - */ - WithActivityLogsSelectFilter withResponseProperties(EventDataPropertyName... responseProperties); - - /** - * Sets the server response to include all the available properties. - * - * @return the stage of Activity log filtering by type and query execution. - */ - WithActivityLogsSelectFilter withAllPropertiesInResponse(); - } - - /** The stage of the Activity log filtering by type and query execution. */ - interface WithActivityLogsSelectFilter extends WithActivityLogsQueryExecute { - - /** - * Filters events for a given resource group. - * - * @param resourceGroupName Specifies resource group name. - * @return the stage of Activity log filtering by type and query execution. - */ - WithActivityLogsQueryExecute filterByResourceGroup(String resourceGroupName); - - /** - * Filters events for a given resource. - * - * @param resourceId Specifies resource Id. - * @return the stage of Activity log filtering by type and query execution. - */ - WithActivityLogsQueryExecute filterByResource(String resourceId); - - /** - * Filters events for a given resource provider. - * - * @param resourceProviderName Specifies resource provider. - * @return the stage of Activity log filtering by type and query execution. - */ - WithActivityLogsQueryExecute filterByResourceProvider(String resourceProviderName); - - /** - * Filters events for a given correlation id. - * - * @param correlationId Specifies correlation id. - * @return the stage of Activity log filtering by type and query execution. - */ - WithActivityLogsQueryExecute filterByCorrelationId(String correlationId); - } - - /** The stage of the Activity log query execution. */ - interface WithActivityLogsQueryExecute { - /** - * Executes the query. - * - * @return Activity Log events received after query execution. - */ - PagedIterable execute(); - - /** - * Executes the query. - * - * @return a representation of the deferred computation of Activity Log query call. - */ - PagedFlux executeAsync(); - - /** - * Filters events that were generated at the Tenant level. - * - * @return the stage of Activity log filtering by Tenant level and query execution. - */ - WithActivityLogsQueryExecute filterAtTenantLevel(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AggregationType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AggregationType.java deleted file mode 100644 index dfbdda2fbfad..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AggregationType.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for AggregationType. */ -public enum AggregationType { - /** Enum value None. */ - NONE("None"), - - /** Enum value Average. */ - AVERAGE("Average"), - - /** Enum value Count. */ - COUNT("Count"), - - /** Enum value Minimum. */ - MINIMUM("Minimum"), - - /** Enum value Maximum. */ - MAXIMUM("Maximum"), - - /** Enum value Total. */ - TOTAL("Total"); - - /** The actual serialized value for a AggregationType instance. */ - private final String value; - - AggregationType(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a AggregationType instance. - * - * @param value the serialized value to parse. - * @return the parsed AggregationType object, or null if unable to parse. - */ - @JsonCreator - public static AggregationType fromString(String value) { - AggregationType[] items = AggregationType.values(); - for (AggregationType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AggregationTypeEnum.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AggregationTypeEnum.java deleted file mode 100644 index 9979d0ec5d87..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AggregationTypeEnum.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for AggregationTypeEnum. */ -public final class AggregationTypeEnum extends ExpandableStringEnum { - /** Static value Average for AggregationTypeEnum. */ - public static final AggregationTypeEnum AVERAGE = fromString("Average"); - - /** Static value Count for AggregationTypeEnum. */ - public static final AggregationTypeEnum COUNT = fromString("Count"); - - /** Static value Minimum for AggregationTypeEnum. */ - public static final AggregationTypeEnum MINIMUM = fromString("Minimum"); - - /** Static value Maximum for AggregationTypeEnum. */ - public static final AggregationTypeEnum MAXIMUM = fromString("Maximum"); - - /** Static value Total for AggregationTypeEnum. */ - public static final AggregationTypeEnum TOTAL = fromString("Total"); - - /** - * Creates or finds a AggregationTypeEnum from its string representation. - * - * @param name a name to look for. - * @return the corresponding AggregationTypeEnum. - */ - @JsonCreator - public static AggregationTypeEnum fromString(String name) { - return fromString(name, AggregationTypeEnum.class); - } - - /** @return known AggregationTypeEnum values. */ - public static Collection values() { - return values(AggregationTypeEnum.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AlertRuleResourceCollection.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AlertRuleResourceCollection.java deleted file mode 100644 index d4dab85778f7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AlertRuleResourceCollection.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.fluent.models.AlertRuleResourceInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Represents a collection of alert rule resources. */ -@Fluent -public final class AlertRuleResourceCollection { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AlertRuleResourceCollection.class); - - /* - * the values for the alert rule resources. - */ - @JsonProperty(value = "value") - private List value; - - /** - * Get the value property: the values for the alert rule resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: the values for the alert rule resources. - * - * @param value the value value to set. - * @return the AlertRuleResourceCollection object itself. - */ - public AlertRuleResourceCollection withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AlertRuleResourcePatch.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AlertRuleResourcePatch.java deleted file mode 100644 index 25d9d549c8c2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AlertRuleResourcePatch.java +++ /dev/null @@ -1,268 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; -import java.util.Map; - -/** The alert rule object for patch operations. */ -@JsonFlatten -@Fluent -public class AlertRuleResourcePatch { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AlertRuleResourcePatch.class); - - /* - * Resource tags - */ - @JsonProperty(value = "tags") - private Map tags; - - /* - * the name of the alert rule. - */ - @JsonProperty(value = "properties.name") - private String name; - - /* - * the description of the alert rule that will be included in the alert - * email. - */ - @JsonProperty(value = "properties.description") - private String description; - - /* - * the provisioning state. - */ - @JsonProperty(value = "properties.provisioningState") - private String provisioningState; - - /* - * the flag that indicates whether the alert rule is enabled. - */ - @JsonProperty(value = "properties.isEnabled") - private Boolean isEnabled; - - /* - * the condition that results in the alert rule being activated. - */ - @JsonProperty(value = "properties.condition") - private RuleCondition condition; - - /* - * action that is performed when the alert rule becomes active, and when an - * alert condition is resolved. - */ - @JsonProperty(value = "properties.action") - private RuleAction action; - - /* - * the array of actions that are performed when the alert rule becomes - * active, and when an alert condition is resolved. - */ - @JsonProperty(value = "properties.actions") - private List actions; - - /* - * Last time the rule was updated in ISO8601 format. - */ - @JsonProperty(value = "properties.lastUpdatedTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime lastUpdatedTime; - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Resource tags. - * - * @param tags the tags value to set. - * @return the AlertRuleResourcePatch object itself. - */ - public AlertRuleResourcePatch withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Get the name property: the name of the alert rule. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: the name of the alert rule. - * - * @param name the name value to set. - * @return the AlertRuleResourcePatch object itself. - */ - public AlertRuleResourcePatch withName(String name) { - this.name = name; - return this; - } - - /** - * Get the description property: the description of the alert rule that will be included in the alert email. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: the description of the alert rule that will be included in the alert email. - * - * @param description the description value to set. - * @return the AlertRuleResourcePatch object itself. - */ - public AlertRuleResourcePatch withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the provisioningState property: the provisioning state. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Set the provisioningState property: the provisioning state. - * - * @param provisioningState the provisioningState value to set. - * @return the AlertRuleResourcePatch object itself. - */ - public AlertRuleResourcePatch withProvisioningState(String provisioningState) { - this.provisioningState = provisioningState; - return this; - } - - /** - * Get the isEnabled property: the flag that indicates whether the alert rule is enabled. - * - * @return the isEnabled value. - */ - public Boolean isEnabled() { - return this.isEnabled; - } - - /** - * Set the isEnabled property: the flag that indicates whether the alert rule is enabled. - * - * @param isEnabled the isEnabled value to set. - * @return the AlertRuleResourcePatch object itself. - */ - public AlertRuleResourcePatch withIsEnabled(Boolean isEnabled) { - this.isEnabled = isEnabled; - return this; - } - - /** - * Get the condition property: the condition that results in the alert rule being activated. - * - * @return the condition value. - */ - public RuleCondition condition() { - return this.condition; - } - - /** - * Set the condition property: the condition that results in the alert rule being activated. - * - * @param condition the condition value to set. - * @return the AlertRuleResourcePatch object itself. - */ - public AlertRuleResourcePatch withCondition(RuleCondition condition) { - this.condition = condition; - return this; - } - - /** - * Get the action property: action that is performed when the alert rule becomes active, and when an alert condition - * is resolved. - * - * @return the action value. - */ - public RuleAction action() { - return this.action; - } - - /** - * Set the action property: action that is performed when the alert rule becomes active, and when an alert condition - * is resolved. - * - * @param action the action value to set. - * @return the AlertRuleResourcePatch object itself. - */ - public AlertRuleResourcePatch withAction(RuleAction action) { - this.action = action; - return this; - } - - /** - * Get the actions property: the array of actions that are performed when the alert rule becomes active, and when an - * alert condition is resolved. - * - * @return the actions value. - */ - public List actions() { - return this.actions; - } - - /** - * Set the actions property: the array of actions that are performed when the alert rule becomes active, and when an - * alert condition is resolved. - * - * @param actions the actions value to set. - * @return the AlertRuleResourcePatch object itself. - */ - public AlertRuleResourcePatch withActions(List actions) { - this.actions = actions; - return this; - } - - /** - * Get the lastUpdatedTime property: Last time the rule was updated in ISO8601 format. - * - * @return the lastUpdatedTime value. - */ - public OffsetDateTime lastUpdatedTime() { - return this.lastUpdatedTime; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (condition() != null) { - condition().validate(); - } - if (action() != null) { - action().validate(); - } - if (actions() != null) { - actions().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AlertRules.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AlertRules.java deleted file mode 100644 index c874c26a737a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AlertRules.java +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.monitor.MonitorManager; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; - -/** Entry point to Alert Rules management API. */ -@Fluent -public interface AlertRules extends HasManager { - - /** @return the Azure Metric Alerts API entry point */ - MetricAlerts metricAlerts(); - - /** @return the Azure Activity Log Alerts API entry point */ - ActivityLogAlerts activityLogAlerts(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AlertSeverity.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AlertSeverity.java deleted file mode 100644 index 89db007904ac..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AlertSeverity.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for AlertSeverity. */ -public final class AlertSeverity extends ExpandableStringEnum { - /** Static value 0 for AlertSeverity. */ - public static final AlertSeverity ZERO = fromString("0"); - - /** Static value 1 for AlertSeverity. */ - public static final AlertSeverity ONE = fromString("1"); - - /** Static value 2 for AlertSeverity. */ - public static final AlertSeverity TWO = fromString("2"); - - /** Static value 3 for AlertSeverity. */ - public static final AlertSeverity THREE = fromString("3"); - - /** Static value 4 for AlertSeverity. */ - public static final AlertSeverity FOUR = fromString("4"); - - /** - * Creates or finds a AlertSeverity from its string representation. - * - * @param name a name to look for. - * @return the corresponding AlertSeverity. - */ - @JsonCreator - public static AlertSeverity fromString(String name) { - return fromString(name, AlertSeverity.class); - } - - /** @return known AlertSeverity values. */ - public static Collection values() { - return values(AlertSeverity.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AlertingAction.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AlertingAction.java deleted file mode 100644 index 76365ffdae25..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AlertingAction.java +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** Specify action need to be taken when rule type is Alert. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "odata\\.type") -@JsonTypeName( - "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources" - + ".ScheduledQueryRules.AlertingAction") -@JsonFlatten -@Fluent -public class AlertingAction extends Action { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AlertingAction.class); - - /* - * Severity of the alert - */ - @JsonProperty(value = "severity", required = true) - private AlertSeverity severity; - - /* - * Azure action group reference. - */ - @JsonProperty(value = "aznsAction") - private AzNsActionGroup aznsAction; - - /* - * time (in minutes) for which Alerts should be throttled or suppressed. - */ - @JsonProperty(value = "throttlingInMin") - private Integer throttlingInMin; - - /* - * The trigger condition that results in the alert rule being. - */ - @JsonProperty(value = "trigger", required = true) - private TriggerCondition trigger; - - /** - * Get the severity property: Severity of the alert. - * - * @return the severity value. - */ - public AlertSeverity severity() { - return this.severity; - } - - /** - * Set the severity property: Severity of the alert. - * - * @param severity the severity value to set. - * @return the AlertingAction object itself. - */ - public AlertingAction withSeverity(AlertSeverity severity) { - this.severity = severity; - return this; - } - - /** - * Get the aznsAction property: Azure action group reference. - * - * @return the aznsAction value. - */ - public AzNsActionGroup aznsAction() { - return this.aznsAction; - } - - /** - * Set the aznsAction property: Azure action group reference. - * - * @param aznsAction the aznsAction value to set. - * @return the AlertingAction object itself. - */ - public AlertingAction withAznsAction(AzNsActionGroup aznsAction) { - this.aznsAction = aznsAction; - return this; - } - - /** - * Get the throttlingInMin property: time (in minutes) for which Alerts should be throttled or suppressed. - * - * @return the throttlingInMin value. - */ - public Integer throttlingInMin() { - return this.throttlingInMin; - } - - /** - * Set the throttlingInMin property: time (in minutes) for which Alerts should be throttled or suppressed. - * - * @param throttlingInMin the throttlingInMin value to set. - * @return the AlertingAction object itself. - */ - public AlertingAction withThrottlingInMin(Integer throttlingInMin) { - this.throttlingInMin = throttlingInMin; - return this; - } - - /** - * Get the trigger property: The trigger condition that results in the alert rule being. - * - * @return the trigger value. - */ - public TriggerCondition trigger() { - return this.trigger; - } - - /** - * Set the trigger property: The trigger condition that results in the alert rule being. - * - * @param trigger the trigger value to set. - * @return the AlertingAction object itself. - */ - public AlertingAction withTrigger(TriggerCondition trigger) { - this.trigger = trigger; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (severity() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property severity in model AlertingAction")); - } - if (aznsAction() != null) { - aznsAction().validate(); - } - if (trigger() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property trigger in model AlertingAction")); - } else { - trigger().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ArmRoleReceiver.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ArmRoleReceiver.java deleted file mode 100644 index 4f14a010733a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ArmRoleReceiver.java +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** An arm role receiver. */ -@Fluent -public final class ArmRoleReceiver { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ArmRoleReceiver.class); - - /* - * The name of the arm role receiver. Names must be unique across all - * receivers within an action group. - */ - @JsonProperty(value = "name", required = true) - private String name; - - /* - * The arm role id. - */ - @JsonProperty(value = "roleId", required = true) - private String roleId; - - /* - * Indicates whether to use common alert schema. - */ - @JsonProperty(value = "useCommonAlertSchema") - private Boolean useCommonAlertSchema; - - /** - * Get the name property: The name of the arm role receiver. Names must be unique across all receivers within an - * action group. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the arm role receiver. Names must be unique across all receivers within an - * action group. - * - * @param name the name value to set. - * @return the ArmRoleReceiver object itself. - */ - public ArmRoleReceiver withName(String name) { - this.name = name; - return this; - } - - /** - * Get the roleId property: The arm role id. - * - * @return the roleId value. - */ - public String roleId() { - return this.roleId; - } - - /** - * Set the roleId property: The arm role id. - * - * @param roleId the roleId value to set. - * @return the ArmRoleReceiver object itself. - */ - public ArmRoleReceiver withRoleId(String roleId) { - this.roleId = roleId; - return this; - } - - /** - * Get the useCommonAlertSchema property: Indicates whether to use common alert schema. - * - * @return the useCommonAlertSchema value. - */ - public Boolean useCommonAlertSchema() { - return this.useCommonAlertSchema; - } - - /** - * Set the useCommonAlertSchema property: Indicates whether to use common alert schema. - * - * @param useCommonAlertSchema the useCommonAlertSchema value to set. - * @return the ArmRoleReceiver object itself. - */ - public ArmRoleReceiver withUseCommonAlertSchema(Boolean useCommonAlertSchema) { - this.useCommonAlertSchema = useCommonAlertSchema; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property name in model ArmRoleReceiver")); - } - if (roleId() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property roleId in model ArmRoleReceiver")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AutomationRunbookReceiver.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AutomationRunbookReceiver.java deleted file mode 100644 index 03152080c3ee..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AutomationRunbookReceiver.java +++ /dev/null @@ -1,227 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The Azure Automation Runbook notification receiver. */ -@Fluent -public final class AutomationRunbookReceiver { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AutomationRunbookReceiver.class); - - /* - * The Azure automation account Id which holds this runbook and - * authenticate to Azure resource. - */ - @JsonProperty(value = "automationAccountId", required = true) - private String automationAccountId; - - /* - * The name for this runbook. - */ - @JsonProperty(value = "runbookName", required = true) - private String runbookName; - - /* - * The resource id for webhook linked to this runbook. - */ - @JsonProperty(value = "webhookResourceId", required = true) - private String webhookResourceId; - - /* - * Indicates whether this instance is global runbook. - */ - @JsonProperty(value = "isGlobalRunbook", required = true) - private boolean isGlobalRunbook; - - /* - * Indicates name of the webhook. - */ - @JsonProperty(value = "name") - private String name; - - /* - * The URI where webhooks should be sent. - */ - @JsonProperty(value = "serviceUri") - private String serviceUri; - - /* - * Indicates whether to use common alert schema. - */ - @JsonProperty(value = "useCommonAlertSchema") - private Boolean useCommonAlertSchema; - - /** - * Get the automationAccountId property: The Azure automation account Id which holds this runbook and authenticate - * to Azure resource. - * - * @return the automationAccountId value. - */ - public String automationAccountId() { - return this.automationAccountId; - } - - /** - * Set the automationAccountId property: The Azure automation account Id which holds this runbook and authenticate - * to Azure resource. - * - * @param automationAccountId the automationAccountId value to set. - * @return the AutomationRunbookReceiver object itself. - */ - public AutomationRunbookReceiver withAutomationAccountId(String automationAccountId) { - this.automationAccountId = automationAccountId; - return this; - } - - /** - * Get the runbookName property: The name for this runbook. - * - * @return the runbookName value. - */ - public String runbookName() { - return this.runbookName; - } - - /** - * Set the runbookName property: The name for this runbook. - * - * @param runbookName the runbookName value to set. - * @return the AutomationRunbookReceiver object itself. - */ - public AutomationRunbookReceiver withRunbookName(String runbookName) { - this.runbookName = runbookName; - return this; - } - - /** - * Get the webhookResourceId property: The resource id for webhook linked to this runbook. - * - * @return the webhookResourceId value. - */ - public String webhookResourceId() { - return this.webhookResourceId; - } - - /** - * Set the webhookResourceId property: The resource id for webhook linked to this runbook. - * - * @param webhookResourceId the webhookResourceId value to set. - * @return the AutomationRunbookReceiver object itself. - */ - public AutomationRunbookReceiver withWebhookResourceId(String webhookResourceId) { - this.webhookResourceId = webhookResourceId; - return this; - } - - /** - * Get the isGlobalRunbook property: Indicates whether this instance is global runbook. - * - * @return the isGlobalRunbook value. - */ - public boolean isGlobalRunbook() { - return this.isGlobalRunbook; - } - - /** - * Set the isGlobalRunbook property: Indicates whether this instance is global runbook. - * - * @param isGlobalRunbook the isGlobalRunbook value to set. - * @return the AutomationRunbookReceiver object itself. - */ - public AutomationRunbookReceiver withIsGlobalRunbook(boolean isGlobalRunbook) { - this.isGlobalRunbook = isGlobalRunbook; - return this; - } - - /** - * Get the name property: Indicates name of the webhook. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Indicates name of the webhook. - * - * @param name the name value to set. - * @return the AutomationRunbookReceiver object itself. - */ - public AutomationRunbookReceiver withName(String name) { - this.name = name; - return this; - } - - /** - * Get the serviceUri property: The URI where webhooks should be sent. - * - * @return the serviceUri value. - */ - public String serviceUri() { - return this.serviceUri; - } - - /** - * Set the serviceUri property: The URI where webhooks should be sent. - * - * @param serviceUri the serviceUri value to set. - * @return the AutomationRunbookReceiver object itself. - */ - public AutomationRunbookReceiver withServiceUri(String serviceUri) { - this.serviceUri = serviceUri; - return this; - } - - /** - * Get the useCommonAlertSchema property: Indicates whether to use common alert schema. - * - * @return the useCommonAlertSchema value. - */ - public Boolean useCommonAlertSchema() { - return this.useCommonAlertSchema; - } - - /** - * Set the useCommonAlertSchema property: Indicates whether to use common alert schema. - * - * @param useCommonAlertSchema the useCommonAlertSchema value to set. - * @return the AutomationRunbookReceiver object itself. - */ - public AutomationRunbookReceiver withUseCommonAlertSchema(Boolean useCommonAlertSchema) { - this.useCommonAlertSchema = useCommonAlertSchema; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (automationAccountId() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property automationAccountId in model AutomationRunbookReceiver")); - } - if (runbookName() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property runbookName in model AutomationRunbookReceiver")); - } - if (webhookResourceId() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property webhookResourceId in model AutomationRunbookReceiver")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AutoscaleNotification.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AutoscaleNotification.java deleted file mode 100644 index de80e6d9f3db..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AutoscaleNotification.java +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Autoscale notification. */ -@Fluent -public final class AutoscaleNotification { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AutoscaleNotification.class); - - /* - * the operation associated with the notification and its value must be - * "scale" - */ - @JsonProperty(value = "operation", required = true) - private String operation; - - /* - * the email notification. - */ - @JsonProperty(value = "email") - private EmailNotification email; - - /* - * the collection of webhook notifications. - */ - @JsonProperty(value = "webhooks") - private List webhooks; - - /** Creates an instance of AutoscaleNotification class. */ - public AutoscaleNotification() { - operation = "Scale"; - } - - /** - * Get the operation property: the operation associated with the notification and its value must be "scale". - * - * @return the operation value. - */ - public String operation() { - return this.operation; - } - - /** - * Set the operation property: the operation associated with the notification and its value must be "scale". - * - * @param operation the operation value to set. - * @return the AutoscaleNotification object itself. - */ - public AutoscaleNotification withOperation(String operation) { - this.operation = operation; - return this; - } - - /** - * Get the email property: the email notification. - * - * @return the email value. - */ - public EmailNotification email() { - return this.email; - } - - /** - * Set the email property: the email notification. - * - * @param email the email value to set. - * @return the AutoscaleNotification object itself. - */ - public AutoscaleNotification withEmail(EmailNotification email) { - this.email = email; - return this; - } - - /** - * Get the webhooks property: the collection of webhook notifications. - * - * @return the webhooks value. - */ - public List webhooks() { - return this.webhooks; - } - - /** - * Set the webhooks property: the collection of webhook notifications. - * - * @param webhooks the webhooks value to set. - * @return the AutoscaleNotification object itself. - */ - public AutoscaleNotification withWebhooks(List webhooks) { - this.webhooks = webhooks; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (email() != null) { - email().validate(); - } - if (webhooks() != null) { - webhooks().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AutoscaleProfile.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AutoscaleProfile.java deleted file mode 100644 index 07f0195338a3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AutoscaleProfile.java +++ /dev/null @@ -1,484 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.monitor.fluent.models.AutoscaleProfileInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasName; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasParent; -import com.azure.resourcemanager.resources.fluentcore.model.Attachable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.model.Settable; -import java.time.OffsetDateTime; -import java.util.List; - -/** An immutable client-side representation of an Azure autoscale profile. */ -@Fluent -public interface AutoscaleProfile extends HasInnerModel, HasParent, HasName { - /** - * Get the minimum number of instances for the resource. - * - * @return the minimum value. - */ - int minInstanceCount(); - - /** - * Get the maximum number of instances for the resource. The actual maximum number of instances is limited by the - * cores that are available in the subscription. - * - * @return the maximum value. - */ - int maxInstanceCount(); - - /** - * Get the number of instances that will be set if metrics are not available for evaluation. The default is only - * used if the current instance count is lower than the default. - * - * @return the defaultProperty value. - */ - int defaultInstanceCount(); - - /** - * Get the specific date-time for the profile. This element is not used if the Recurrence element is used. - * - * @return the fixedDate value. - */ - TimeWindow fixedDateSchedule(); - - /** - * Get the repeating times at which this profile begins. This element is not used if the FixedDate element is used. - * - * @return the recurrence value. - */ - Recurrence recurrentSchedule(); - - /** - * Get the collection of rules that provide the triggers and parameters for the scaling action. A maximum of 10 - * rules can be specified. - * - * @return the rules value. - */ - List rules(); - - /** The entirety of an autoscale profile definition. */ - interface Definition - extends DefinitionStages.WithAttach, - DefinitionStages.Blank, - DefinitionStages.WithScaleRule, - DefinitionStages.WithScaleRuleOptional, - DefinitionStages.WithScaleSchedule { - } - - /** Grouping of autoscale profile definition stages. */ - interface DefinitionStages { - /** The final stage of the definition which attaches defined profile to the current Autoscale settings. */ - interface WithAttach extends Attachable.InDefinition { - } - - /** The first stage of autoscale profile definition. */ - interface Blank { - /** - * Selects metric based autoscale profile. - * - * @param minimumInstanceCount the minimum number of instances for the resource. - * @param maximumInstanceCount the maximum number of instances for the resource. The actual maximum number - * of instances is limited by the cores that are available in the subscription. - * @param defaultInstanceCount the number of instances that will be set if metrics are not available for - * evaluation. The default is only used if the current instance count is lower than the default. - * @return the next stage of the definition. - */ - WithScaleRule withMetricBasedScale( - int minimumInstanceCount, int maximumInstanceCount, int defaultInstanceCount); - - /** - * Selects schedule based autoscale profile. - * - * @param instanceCount the number of instances that will be set during specified schedule. The actual - * number of instances is limited by the cores that are available in the subscription. - * @return the next stage of the definition. - */ - WithScaleSchedule withScheduleBasedScale(int instanceCount); - - /** - * Selects a specific instance count for the current Default profile. - * - * @param instanceCount the number of instances that will be set during specified schedule. The actual - * number of instances is limited by the cores that are available in the subscription. - * @return the next stage of the definition. - */ - WithAttach withFixedInstanceCount(int instanceCount); - } - - /** The stage of the definition which adds scale rules. */ - interface WithScaleRule { - /** - * Starts the definition of scale rule for the current autoscale profile. - * - * @return the next stage of the definition. - */ - ScaleRule.DefinitionStages.Blank defineScaleRule(); - } - - /** The stage of the definition which adds optional scale rules and schedules. */ - interface WithScaleRuleOptional extends WithAttach { - /** - * Starts the definition of scale rule for the current autoscale profile. - * - * @return the next stage of the definition. - */ - ScaleRule.DefinitionStages.Blank defineScaleRule(); - - /** - * Specifies fixed date schedule for autoscale profile. - * - * @param timeZone time zone for the schedule. - * @param start start time. - * @param end end time. - * @return the next stage of the definition. - */ - WithScaleRuleOptional withFixedDateSchedule(String timeZone, OffsetDateTime start, OffsetDateTime end); - - /** - * Specifies recurrent schedule for autoscale profile. - * - * @param scheduleTimeZone time zone for the schedule. Some examples of valid timezones are: Dateline - * Standard Time, UTC-11, Hawaiian Standard Time, Alaskan Standard Time, Pacific Standard Time (Mexico), - * Pacific Standard Time, US Mountain Standard Time, Mountain Standard Time (Mexico), Mountain Standard - * Time, Central America Standard Time, Central Standard Time, Central Standard Time (Mexico), Canada - * Central Standard Time, SA Pacific Standard Time, Eastern Standard Time, US Eastern Standard Time, - * Venezuela Standard Time, Paraguay Standard Time, Atlantic Standard Time, Central Brazilian Standard - * Time, SA Western Standard Time, Pacific SA Standard Time, Newfoundland Standard Time, E. South - * America Standard Time, Argentina Standard Time, SA Eastern Standard Time, Greenland Standard Time, - * Montevideo Standard Time, Bahia Standard Time, UTC-02, Mid-Atlantic Standard Time, Azores Standard - * Time, Cape Verde Standard Time, Morocco Standard Time, UTC, GMT Standard Time, Greenwich Standard - * Time, W. Europe Standard Time, Central Europe Standard Time, Romance Standard Time, Central European - * Standard Time, W. Central Africa Standard Time, Namibia Standard Time, Jordan Standard Time, GTB - * Standard Time, Middle East Standard Time, Egypt Standard Time, Syria Standard Time, E. Europe - * Standard Time, South Africa Standard Time, FLE Standard Time, Turkey Standard Time, Israel Standard - * Time, Kaliningrad Standard Time, Libya Standard Time, Arabic Standard Time, Arab Standard Time, - * Belarus Standard Time, Russian Standard Time, E. Africa Standard Time, Iran Standard Time, Arabian - * Standard Time, Azerbaijan Standard Time, Russia Time Zone 3, Mauritius Standard Time, Georgian - * Standard Time, Caucasus Standard Time, Afghanistan Standard Time, West Asia Standard Time, - * Ekaterinburg Standard Time, Pakistan Standard Time, India Standard Time, Sri Lanka Standard Time, - * Nepal Standard Time, Central Asia Standard Time, Bangladesh Standard Time, N. Central Asia Standard - * Time, Myanmar Standard Time, SE Asia Standard Time, North Asia Standard Time, China Standard Time, - * North Asia East Standard Time, Singapore Standard Time, W. Australia Standard Time, Taipei Standard - * Time, Ulaanbaatar Standard Time, Tokyo Standard Time, Korea Standard Time, Yakutsk Standard Time, - * Cen. Australia Standard Time, AUS Central Standard Time, E. Australia Standard Time, AUS Eastern - * Standard Time, West Pacific Standard Time, Tasmania Standard Time, Magadan Standard Time, Vladivostok - * Standard Time, Russia Time Zone 10, Central Pacific Standard Time, Russia Time Zone 11, New Zealand - * Standard Time, UTC+12, Fiji Standard Time, Kamchatka Standard Time, Tonga Standard Time, Samoa - * Standard Time, Line Islands Standard Time. - * @param startTime start time in hh:mm format. - * @param weekday list of week days when the schedule should be active. - * @return the next stage of the definition. - */ - WithScaleRuleOptional withRecurrentSchedule( - String scheduleTimeZone, String startTime, DayOfWeek... weekday); - } - - /** The stage of the definition which specifies autoscale profile schedule. */ - interface WithScaleSchedule { - /** - * Specifies fixed date schedule for autoscale profile. - * - * @param timeZone time zone for the schedule. - * @param start start time. - * @param end end time. - * @return the next stage of the definition. - */ - WithAttach withFixedDateSchedule(String timeZone, OffsetDateTime start, OffsetDateTime end); - - /** - * Specifies recurrent schedule for autoscale profile. - * - * @param scheduleTimeZone time zone for the schedule. Some examples of valid timezones are: Dateline - * Standard Time, UTC-11, Hawaiian Standard Time, Alaskan Standard Time, Pacific Standard Time (Mexico), - * Pacific Standard Time, US Mountain Standard Time, Mountain Standard Time (Mexico), Mountain Standard - * Time, Central America Standard Time, Central Standard Time, Central Standard Time (Mexico), Canada - * Central Standard Time, SA Pacific Standard Time, Eastern Standard Time, US Eastern Standard Time, - * Venezuela Standard Time, Paraguay Standard Time, Atlantic Standard Time, Central Brazilian Standard - * Time, SA Western Standard Time, Pacific SA Standard Time, Newfoundland Standard Time, E. South - * America Standard Time, Argentina Standard Time, SA Eastern Standard Time, Greenland Standard Time, - * Montevideo Standard Time, Bahia Standard Time, UTC-02, Mid-Atlantic Standard Time, Azores Standard - * Time, Cape Verde Standard Time, Morocco Standard Time, UTC, GMT Standard Time, Greenwich Standard - * Time, W. Europe Standard Time, Central Europe Standard Time, Romance Standard Time, Central European - * Standard Time, W. Central Africa Standard Time, Namibia Standard Time, Jordan Standard Time, GTB - * Standard Time, Middle East Standard Time, Egypt Standard Time, Syria Standard Time, E. Europe - * Standard Time, South Africa Standard Time, FLE Standard Time, Turkey Standard Time, Israel Standard - * Time, Kaliningrad Standard Time, Libya Standard Time, Arabic Standard Time, Arab Standard Time, - * Belarus Standard Time, Russian Standard Time, E. Africa Standard Time, Iran Standard Time, Arabian - * Standard Time, Azerbaijan Standard Time, Russia Time Zone 3, Mauritius Standard Time, Georgian - * Standard Time, Caucasus Standard Time, Afghanistan Standard Time, West Asia Standard Time, - * Ekaterinburg Standard Time, Pakistan Standard Time, India Standard Time, Sri Lanka Standard Time, - * Nepal Standard Time, Central Asia Standard Time, Bangladesh Standard Time, N. Central Asia Standard - * Time, Myanmar Standard Time, SE Asia Standard Time, North Asia Standard Time, China Standard Time, - * North Asia East Standard Time, Singapore Standard Time, W. Australia Standard Time, Taipei Standard - * Time, Ulaanbaatar Standard Time, Tokyo Standard Time, Korea Standard Time, Yakutsk Standard Time, - * Cen. Australia Standard Time, AUS Central Standard Time, E. Australia Standard Time, AUS Eastern - * Standard Time, West Pacific Standard Time, Tasmania Standard Time, Magadan Standard Time, Vladivostok - * Standard Time, Russia Time Zone 10, Central Pacific Standard Time, Russia Time Zone 11, New Zealand - * Standard Time, UTC+12, Fiji Standard Time, Kamchatka Standard Time, Tonga Standard Time, Samoa - * Standard Time, Line Islands Standard Time. - * @param startTime start time in hh:mm format. - * @param weekday list of week days when the schedule should be active. - * @return the next stage of the definition. - */ - WithAttach withRecurrentSchedule(String scheduleTimeZone, String startTime, DayOfWeek... weekday); - } - } - - /** The entirety of an autoscale profile definition during current autoscale settings update. */ - interface UpdateDefinition - extends UpdateDefinitionStages.WithAttach, - UpdateDefinitionStages.Blank, - UpdateDefinitionStages.WithScaleRule, - UpdateDefinitionStages.WithScaleRuleOptional, - UpdateDefinitionStages.WithScaleSchedule { - } - - /** Grouping of autoscale profile definition stages during current autoscale settings update stage. */ - interface UpdateDefinitionStages { - /** The final stage of the definition which attaches defined profile to the current Autoscale settings. */ - interface WithAttach extends Attachable.InUpdate { - } - - /** The first stage of autoscale profile definition. */ - interface Blank { - /** - * Selects metric based autoscale profile. - * - * @param minimumInstanceCount the minimum number of instances for the resource. - * @param maximumInstanceCount the maximum number of instances for the resource. The actual maximum number - * of instances is limited by the cores that are available in the subscription. - * @param defaultInstanceCount the number of instances that will be set if metrics are not available for - * evaluation. The default is only used if the current instance count is lower than the default. - * @return the next stage of the definition. - */ - WithScaleRule withMetricBasedScale( - int minimumInstanceCount, int maximumInstanceCount, int defaultInstanceCount); - - /** - * Selects schedule based autoscale profile. - * - * @param instanceCount the number of instances that will be set during specified schedule. The actual - * number of instances is limited by the cores that are available in the subscription. - * @return the next stage of the definition. - */ - WithScaleSchedule withScheduleBasedScale(int instanceCount); - } - - /** The stage of the definition which adds scale rules. */ - interface WithScaleRule { - /** - * Starts the definition of scale rule for the current autoscale profile. - * - * @return the next stage of the definition. - */ - ScaleRule.ParentUpdateDefinitionStages.Blank defineScaleRule(); - } - - /** The stage of the definition which adds optional scale rules and schedules. */ - interface WithScaleRuleOptional extends WithAttach { - /** - * Starts the definition of scale rule for the current autoscale profile. - * - * @return the next stage of the definition. - */ - ScaleRule.ParentUpdateDefinitionStages.Blank defineScaleRule(); - - /** - * Specifies fixed date schedule for autoscale profile. - * - * @param timeZone time zone for the schedule. - * @param start start time. - * @param end end time. - * @return the next stage of the definition. - */ - WithScaleRuleOptional withFixedDateSchedule(String timeZone, OffsetDateTime start, OffsetDateTime end); - - /** - * Specifies recurrent schedule for autoscale profile. - * - * @param scheduleTimeZone time zone for the schedule. Some examples of valid timezones are: Dateline - * Standard Time, UTC-11, Hawaiian Standard Time, Alaskan Standard Time, Pacific Standard Time (Mexico), - * Pacific Standard Time, US Mountain Standard Time, Mountain Standard Time (Mexico), Mountain Standard - * Time, Central America Standard Time, Central Standard Time, Central Standard Time (Mexico), Canada - * Central Standard Time, SA Pacific Standard Time, Eastern Standard Time, US Eastern Standard Time, - * Venezuela Standard Time, Paraguay Standard Time, Atlantic Standard Time, Central Brazilian Standard - * Time, SA Western Standard Time, Pacific SA Standard Time, Newfoundland Standard Time, E. South - * America Standard Time, Argentina Standard Time, SA Eastern Standard Time, Greenland Standard Time, - * Montevideo Standard Time, Bahia Standard Time, UTC-02, Mid-Atlantic Standard Time, Azores Standard - * Time, Cape Verde Standard Time, Morocco Standard Time, UTC, GMT Standard Time, Greenwich Standard - * Time, W. Europe Standard Time, Central Europe Standard Time, Romance Standard Time, Central European - * Standard Time, W. Central Africa Standard Time, Namibia Standard Time, Jordan Standard Time, GTB - * Standard Time, Middle East Standard Time, Egypt Standard Time, Syria Standard Time, E. Europe - * Standard Time, South Africa Standard Time, FLE Standard Time, Turkey Standard Time, Israel Standard - * Time, Kaliningrad Standard Time, Libya Standard Time, Arabic Standard Time, Arab Standard Time, - * Belarus Standard Time, Russian Standard Time, E. Africa Standard Time, Iran Standard Time, Arabian - * Standard Time, Azerbaijan Standard Time, Russia Time Zone 3, Mauritius Standard Time, Georgian - * Standard Time, Caucasus Standard Time, Afghanistan Standard Time, West Asia Standard Time, - * Ekaterinburg Standard Time, Pakistan Standard Time, India Standard Time, Sri Lanka Standard Time, - * Nepal Standard Time, Central Asia Standard Time, Bangladesh Standard Time, N. Central Asia Standard - * Time, Myanmar Standard Time, SE Asia Standard Time, North Asia Standard Time, China Standard Time, - * North Asia East Standard Time, Singapore Standard Time, W. Australia Standard Time, Taipei Standard - * Time, Ulaanbaatar Standard Time, Tokyo Standard Time, Korea Standard Time, Yakutsk Standard Time, - * Cen. Australia Standard Time, AUS Central Standard Time, E. Australia Standard Time, AUS Eastern - * Standard Time, West Pacific Standard Time, Tasmania Standard Time, Magadan Standard Time, Vladivostok - * Standard Time, Russia Time Zone 10, Central Pacific Standard Time, Russia Time Zone 11, New Zealand - * Standard Time, UTC+12, Fiji Standard Time, Kamchatka Standard Time, Tonga Standard Time, Samoa - * Standard Time, Line Islands Standard Time. - * @param startTime start time in hh:mm format. - * @param weekday list of week days when the schedule should be active. - * @return the next stage of the definition. - */ - WithScaleRuleOptional withRecurrentSchedule( - String scheduleTimeZone, String startTime, DayOfWeek... weekday); - } - - /** The stage of the definition which specifies autoscale profile schedule. */ - interface WithScaleSchedule { - /** - * Specifies fixed date schedule for autoscale profile. - * - * @param timeZone time zone for the schedule. - * @param start start time. - * @param end end time. - * @return the next stage of the definition. - */ - WithAttach withFixedDateSchedule(String timeZone, OffsetDateTime start, OffsetDateTime end); - - /** - * Specifies recurrent schedule for autoscale profile. - * - * @param scheduleTimeZone time zone for the schedule. Some examples of valid timezones are: Dateline - * Standard Time, UTC-11, Hawaiian Standard Time, Alaskan Standard Time, Pacific Standard Time (Mexico), - * Pacific Standard Time, US Mountain Standard Time, Mountain Standard Time (Mexico), Mountain Standard - * Time, Central America Standard Time, Central Standard Time, Central Standard Time (Mexico), Canada - * Central Standard Time, SA Pacific Standard Time, Eastern Standard Time, US Eastern Standard Time, - * Venezuela Standard Time, Paraguay Standard Time, Atlantic Standard Time, Central Brazilian Standard - * Time, SA Western Standard Time, Pacific SA Standard Time, Newfoundland Standard Time, E. South - * America Standard Time, Argentina Standard Time, SA Eastern Standard Time, Greenland Standard Time, - * Montevideo Standard Time, Bahia Standard Time, UTC-02, Mid-Atlantic Standard Time, Azores Standard - * Time, Cape Verde Standard Time, Morocco Standard Time, UTC, GMT Standard Time, Greenwich Standard - * Time, W. Europe Standard Time, Central Europe Standard Time, Romance Standard Time, Central European - * Standard Time, W. Central Africa Standard Time, Namibia Standard Time, Jordan Standard Time, GTB - * Standard Time, Middle East Standard Time, Egypt Standard Time, Syria Standard Time, E. Europe - * Standard Time, South Africa Standard Time, FLE Standard Time, Turkey Standard Time, Israel Standard - * Time, Kaliningrad Standard Time, Libya Standard Time, Arabic Standard Time, Arab Standard Time, - * Belarus Standard Time, Russian Standard Time, E. Africa Standard Time, Iran Standard Time, Arabian - * Standard Time, Azerbaijan Standard Time, Russia Time Zone 3, Mauritius Standard Time, Georgian - * Standard Time, Caucasus Standard Time, Afghanistan Standard Time, West Asia Standard Time, - * Ekaterinburg Standard Time, Pakistan Standard Time, India Standard Time, Sri Lanka Standard Time, - * Nepal Standard Time, Central Asia Standard Time, Bangladesh Standard Time, N. Central Asia Standard - * Time, Myanmar Standard Time, SE Asia Standard Time, North Asia Standard Time, China Standard Time, - * North Asia East Standard Time, Singapore Standard Time, W. Australia Standard Time, Taipei Standard - * Time, Ulaanbaatar Standard Time, Tokyo Standard Time, Korea Standard Time, Yakutsk Standard Time, - * Cen. Australia Standard Time, AUS Central Standard Time, E. Australia Standard Time, AUS Eastern - * Standard Time, West Pacific Standard Time, Tasmania Standard Time, Magadan Standard Time, Vladivostok - * Standard Time, Russia Time Zone 10, Central Pacific Standard Time, Russia Time Zone 11, New Zealand - * Standard Time, UTC+12, Fiji Standard Time, Kamchatka Standard Time, Tonga Standard Time, Samoa - * Standard Time, Line Islands Standard Time. - * @param startTime start time in hh:mm format. - * @param weekday list of week days when the schedule should be active. - * @return the next stage of the definition. - */ - WithAttach withRecurrentSchedule(String scheduleTimeZone, String startTime, DayOfWeek... weekday); - } - } - - /** Grouping of autoscale profile update stages. */ - interface Update extends Settable { - /** - * Updates metric based autoscale profile. - * - * @param minimumInstanceCount the minimum number of instances for the resource. - * @param maximumInstanceCount the maximum number of instances for the resource. The actual maximum number of - * instances is limited by the cores that are available in the subscription. - * @param defaultInstanceCount the number of instances that will be set if metrics are not available for - * evaluation. The default is only used if the current instance count is lower than the default. - * @return the next stage of the autoscale profile update. - */ - Update withMetricBasedScale(int minimumInstanceCount, int maximumInstanceCount, int defaultInstanceCount); - - /** - * Updates schedule based autoscale profile. - * - * @param instanceCount instanceCount the number of instances that will be set during specified schedule. The - * actual number of instances is limited by the cores that are available in the subscription. - * @return the next stage of the autoscale profile update. - */ - Update withScheduleBasedScale(int instanceCount); - - /** - * Updates fixed date schedule for autoscale profile. - * - * @param timeZone time zone for the schedule. - * @param start start time. - * @param end end time. - * @return the next stage of the autoscale profile update. - */ - Update withFixedDateSchedule(String timeZone, OffsetDateTime start, OffsetDateTime end); - - /** - * Updates recurrent schedule for autoscale profile. - * - * @param scheduleTimeZone time zone for the schedule. Some examples of valid timezones are: Dateline Standard - * Time, UTC-11, Hawaiian Standard Time, Alaskan Standard Time, Pacific Standard Time (Mexico), Pacific - * Standard Time, US Mountain Standard Time, Mountain Standard Time (Mexico), Mountain Standard Time, - * Central America Standard Time, Central Standard Time, Central Standard Time (Mexico), Canada Central - * Standard Time, SA Pacific Standard Time, Eastern Standard Time, US Eastern Standard Time, Venezuela - * Standard Time, Paraguay Standard Time, Atlantic Standard Time, Central Brazilian Standard Time, SA - * Western Standard Time, Pacific SA Standard Time, Newfoundland Standard Time, E. South America Standard - * Time, Argentina Standard Time, SA Eastern Standard Time, Greenland Standard Time, Montevideo Standard - * Time, Bahia Standard Time, UTC-02, Mid-Atlantic Standard Time, Azores Standard Time, Cape Verde Standard - * Time, Morocco Standard Time, UTC, GMT Standard Time, Greenwich Standard Time, W. Europe Standard Time, - * Central Europe Standard Time, Romance Standard Time, Central European Standard Time, W. Central Africa - * Standard Time, Namibia Standard Time, Jordan Standard Time, GTB Standard Time, Middle East Standard Time, - * Egypt Standard Time, Syria Standard Time, E. Europe Standard Time, South Africa Standard Time, FLE - * Standard Time, Turkey Standard Time, Israel Standard Time, Kaliningrad Standard Time, Libya Standard - * Time, Arabic Standard Time, Arab Standard Time, Belarus Standard Time, Russian Standard Time, E. Africa - * Standard Time, Iran Standard Time, Arabian Standard Time, Azerbaijan Standard Time, Russia Time Zone 3, - * Mauritius Standard Time, Georgian Standard Time, Caucasus Standard Time, Afghanistan Standard Time, West - * Asia Standard Time, Ekaterinburg Standard Time, Pakistan Standard Time, India Standard Time, Sri Lanka - * Standard Time, Nepal Standard Time, Central Asia Standard Time, Bangladesh Standard Time, N. Central Asia - * Standard Time, Myanmar Standard Time, SE Asia Standard Time, North Asia Standard Time, China Standard - * Time, North Asia East Standard Time, Singapore Standard Time, W. Australia Standard Time, Taipei Standard - * Time, Ulaanbaatar Standard Time, Tokyo Standard Time, Korea Standard Time, Yakutsk Standard Time, Cen. - * Australia Standard Time, AUS Central Standard Time, E. Australia Standard Time, AUS Eastern Standard - * Time, West Pacific Standard Time, Tasmania Standard Time, Magadan Standard Time, Vladivostok Standard - * Time, Russia Time Zone 10, Central Pacific Standard Time, Russia Time Zone 11, New Zealand Standard Time, - * UTC+12, Fiji Standard Time, Kamchatka Standard Time, Tonga Standard Time, Samoa Standard Time, Line - * Islands Standard Time. - * @param startTime start time in hh:mm format. - * @param weekday list of week days when the schedule should be active. - * @return the next stage of the autoscale profile update. - */ - Update withRecurrentSchedule(String scheduleTimeZone, String startTime, DayOfWeek... weekday); - - /** - * Starts the definition of scale rule for the current autoscale profile. - * - * @return the next stage of the autoscale profile update. - */ - ScaleRule.UpdateDefinitionStages.Blank defineScaleRule(); - - /** - * Starts the update of the scale rule for the current autoscale profile. - * - * @param ruleIndex the index of the scale rule in the current autoscale profile. The index represents the order - * at which rules were added to the current profile. - * @return the next stage of the autoscale profile update. - */ - ScaleRule.Update updateScaleRule(int ruleIndex); - - /** - * Removes scale rule from the current autoscale profile. - * - * @param ruleIndex the index of the scale rule in the current autoscale profile. - * @return the next stage of the autoscale profile update. - */ - Update withoutScaleRule(int ruleIndex); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AutoscaleSetting.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AutoscaleSetting.java deleted file mode 100644 index c19b01126ba6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AutoscaleSetting.java +++ /dev/null @@ -1,288 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.monitor.MonitorManager; -import com.azure.resourcemanager.monitor.fluent.models.AutoscaleSettingResourceInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.GroupableResource; -import com.azure.resourcemanager.resources.fluentcore.arm.models.Resource; -import com.azure.resourcemanager.resources.fluentcore.model.Appliable; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; -import com.azure.resourcemanager.resources.fluentcore.model.Updatable; -import java.util.List; -import java.util.Map; - -/** An immutable client-side representation of an Azure autoscale setting. */ -@Fluent -public interface AutoscaleSetting - extends GroupableResource, - Refreshable, - Updatable { - - /** - * Get the resource identifier of the resource that the autoscale setting should be added to. - * - * @return the targetResourceUri value. - */ - String targetResourceId(); - - /** - * Gets the autoscale profiles in the current autoscale setting. - * - * @return autoscale profiles in the current autoscale setting, indexed by name - */ - Map profiles(); - - /** - * Get the enabled flag. Specifies whether automatic scaling is enabled for the resource. The default value is - * 'true'. - * - * @return the enabled value. - */ - boolean autoscaleEnabled(); - - /** - * Get a value indicating whether to send email to subscription administrator. - * - * @return the sendToSubscriptionAdministrator value. - */ - boolean adminEmailNotificationEnabled(); - - /** - * Get a value indicating whether to send email to subscription co-administrators. - * - * @return the sendToSubscriptionCoAdministrators value - */ - boolean coAdminEmailNotificationEnabled(); - - /** - * Get the custom e-mails list. This value can be null or empty, in which case this attribute will be ignored. - * - * @return the customEmails value. - */ - List customEmailsNotification(); - - /** - * Get the service address to receive the notification. - * - * @return the serviceUri value. - */ - String webhookNotification(); - - /** The entirety of an autoscale setting definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithGroup, - DefinitionStages.WithCreate, - DefinitionStages.DefineAutoscaleSettingResourceProfiles, - DefinitionStages.WithAutoscaleSettingResourceTargetResourceUri, - DefinitionStages.WithAutoscaleSettingResourceEnabled { - } - - /** Grouping of autoscale setting definition stages. */ - interface DefinitionStages { - - /** The first stage of autoscale setting definition. */ - interface Blank extends DefinitionWithRegion { - } - - /** The stage of the definition which selects resource group. */ - interface WithGroup - extends GroupableResource.DefinitionStages.WithGroup { - } - - /** The stage of the definition which selects target resource. */ - interface WithAutoscaleSettingResourceTargetResourceUri { - /** - * Set the resource identifier of the resource that the autoscale setting should be added to. - * - * @param targetResourceId the targetResourceUri value to set - * @return the next stage of the definition. - */ - DefineAutoscaleSettingResourceProfiles withTargetResource(String targetResourceId); - } - - /** The stage of the definition which specifies autoscale profile. */ - interface DefineAutoscaleSettingResourceProfiles { - /** - * Starts the definition of automatic scaling profiles that specify different scaling parameters for - * different time periods. A maximum of 20 profiles can be specified. - * - * @param name name of the autoscale profile. - * @return the next stage of the definition. - */ - AutoscaleProfile.DefinitionStages.Blank defineAutoscaleProfile(String name); - } - - /** The stage of the definition which specifies autoscale notifications. */ - interface DefineAutoscaleSettingResourceNotifications { - /** - * Specifies that an email should be send to subscription administrator. - * - * @return the next stage of the definition. - */ - WithCreate withAdminEmailNotification(); - - /** - * Specifies that an email should be send to subscription co-administrator. - * - * @return the next stage of the definition. - */ - WithCreate withCoAdminEmailNotification(); - - /** - * Specifies that an email should be send to custom email addresses. - * - * @param customEmailAddresses list of the emails that should receive the notification. - * @return the next stage of the definition. - */ - WithCreate withCustomEmailsNotification(String... customEmailAddresses); - - /** - * Set the service address to receive the notification. - * - * @param serviceUri the serviceUri value to set. - * @return the next stage of the definition. - */ - WithCreate withWebhookNotification(String serviceUri); - } - - /** - * The stage of the definition which specifies if the current autoscale setting should be disabled upon - * creation. - */ - interface WithAutoscaleSettingResourceEnabled { - /** - * Set the current autoscale in the disabled state. - * - * @return the next stage of the definition. - */ - WithCreate withAutoscaleDisabled(); - } - - /** The stage of the definition which allows autoscale setting creation. */ - interface WithCreate - extends Creatable, - DefineAutoscaleSettingResourceProfiles, - DefineAutoscaleSettingResourceNotifications, - WithAutoscaleSettingResourceEnabled { - } - } - - /** Grouping of autoscale setting update stages. */ - interface UpdateStages { - /** The stage of the update which adds or updates autoscale profiles in the current setting. */ - interface DefineAutoscaleSettingProfiles { - /** - * Starts definition of automatic scaling profiles that specify different scaling parameters for different - * time periods. A maximum of 20 profiles can be specified. - * - * @param name name of the profile. - * @return the next stage of autoscale setting update. - */ - AutoscaleProfile.UpdateDefinitionStages.Blank defineAutoscaleProfile(String name); - - /** - * Starts the update of automatic scaling profiles. - * - * @param name name of the profile. - * @return the next stage of autoscale setting update. - */ - AutoscaleProfile.Update updateAutoscaleProfile(String name); - - /** - * Removes the specified profile from the current setting. - * - * @param name name of the profile. - * @return the next stage of autoscale setting update. - */ - Update withoutAutoscaleProfile(String name); - } - - /** The stage of the update which updates current autoscale setting. */ - interface UpdateAutoscaleSettings { - /** - * Sets current autoscale setting to the enabled state. - * - * @return the next stage of autoscale setting update. - */ - Update withAutoscaleEnabled(); - - /** - * Sets current autoscale setting to the disabled state. - * - * @return the next stage of autoscale setting update. - */ - Update withAutoscaleDisabled(); - - /** - * Specifies that an email should be send to subscription administrator. - * - * @return the next stage of autoscale setting update. - */ - Update withAdminEmailNotification(); - - /** - * Specifies that an email should be send to subscription co-administrator. - * - * @return the next stage of autoscale setting update. - */ - Update withCoAdminEmailNotification(); - - /** - * Specifies that an email should be send to custom email addresses. - * - * @param customEmailAddresses list of the emails that should receive the notification. - * @return the next stage of autoscale setting update. - */ - Update withCustomEmailsNotification(String... customEmailAddresses); - - /** - * Set the service address to receive the notification. - * - * @param serviceUri the serviceUri value to set. - * @return the next stage of autoscale setting update. - */ - Update withWebhookNotification(String serviceUri); - - /** - * Removes email notification to subscription administrator. - * - * @return the next stage of autoscale setting update. - */ - Update withoutAdminEmailNotification(); - - /** - * Removes email notification to subscription co-administrator. - * - * @return the next stage of autoscale setting update. - */ - Update withoutCoAdminEmailNotification(); - - /** - * Removes email notification to custom email addresses. - * - * @return the next stage of autoscale setting update. - */ - Update withoutCustomEmailsNotification(); - - /** - * Removes service from autoscale notification. - * - * @return the next stage of autoscale setting update. - */ - Update withoutWebhookNotification(); - } - } - - /** Grouping of autoscale setting update stages. */ - interface Update - extends Appliable, - Resource.UpdateWithTags, - UpdateStages.DefineAutoscaleSettingProfiles, - UpdateStages.UpdateAutoscaleSettings { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AutoscaleSettingResourceCollection.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AutoscaleSettingResourceCollection.java deleted file mode 100644 index cbe260940c6e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AutoscaleSettingResourceCollection.java +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.fluent.models.AutoscaleSettingResourceInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Represents a collection of autoscale setting resources. */ -@Fluent -public final class AutoscaleSettingResourceCollection { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AutoscaleSettingResourceCollection.class); - - /* - * the values for the autoscale setting resources. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * URL to get the next set of results. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: the values for the autoscale setting resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: the values for the autoscale setting resources. - * - * @param value the value value to set. - * @return the AutoscaleSettingResourceCollection object itself. - */ - public AutoscaleSettingResourceCollection withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: URL to get the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: URL to get the next set of results. - * - * @param nextLink the nextLink value to set. - * @return the AutoscaleSettingResourceCollection object itself. - */ - public AutoscaleSettingResourceCollection withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property value in model AutoscaleSettingResourceCollection")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AutoscaleSettingResourcePatch.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AutoscaleSettingResourcePatch.java deleted file mode 100644 index 9a154b433d77..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AutoscaleSettingResourcePatch.java +++ /dev/null @@ -1,230 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.fluent.models.AutoscaleProfileInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** The autoscale setting object for patch operations. */ -@JsonFlatten -@Fluent -public class AutoscaleSettingResourcePatch { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AutoscaleSettingResourcePatch.class); - - /* - * Resource tags - */ - @JsonProperty(value = "tags") - private Map tags; - - /* - * the collection of automatic scaling profiles that specify different - * scaling parameters for different time periods. A maximum of 20 profiles - * can be specified. - */ - @JsonProperty(value = "properties.profiles") - private List profiles; - - /* - * the collection of notifications. - */ - @JsonProperty(value = "properties.notifications") - private List notifications; - - /* - * the enabled flag. Specifies whether automatic scaling is enabled for the - * resource. The default value is 'true'. - */ - @JsonProperty(value = "properties.enabled") - private Boolean enabled; - - /* - * the name of the autoscale setting. - */ - @JsonProperty(value = "properties.name") - private String name; - - /* - * the resource identifier of the resource that the autoscale setting - * should be added to. - */ - @JsonProperty(value = "properties.targetResourceUri") - private String targetResourceUri; - - /* - * the location of the resource that the autoscale setting should be added - * to. - */ - @JsonProperty(value = "properties.targetResourceLocation") - private String targetResourceLocation; - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Resource tags. - * - * @param tags the tags value to set. - * @return the AutoscaleSettingResourcePatch object itself. - */ - public AutoscaleSettingResourcePatch withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Get the profiles property: the collection of automatic scaling profiles that specify different scaling parameters - * for different time periods. A maximum of 20 profiles can be specified. - * - * @return the profiles value. - */ - public List profiles() { - return this.profiles; - } - - /** - * Set the profiles property: the collection of automatic scaling profiles that specify different scaling parameters - * for different time periods. A maximum of 20 profiles can be specified. - * - * @param profiles the profiles value to set. - * @return the AutoscaleSettingResourcePatch object itself. - */ - public AutoscaleSettingResourcePatch withProfiles(List profiles) { - this.profiles = profiles; - return this; - } - - /** - * Get the notifications property: the collection of notifications. - * - * @return the notifications value. - */ - public List notifications() { - return this.notifications; - } - - /** - * Set the notifications property: the collection of notifications. - * - * @param notifications the notifications value to set. - * @return the AutoscaleSettingResourcePatch object itself. - */ - public AutoscaleSettingResourcePatch withNotifications(List notifications) { - this.notifications = notifications; - return this; - } - - /** - * Get the enabled property: the enabled flag. Specifies whether automatic scaling is enabled for the resource. The - * default value is 'true'. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: the enabled flag. Specifies whether automatic scaling is enabled for the resource. The - * default value is 'true'. - * - * @param enabled the enabled value to set. - * @return the AutoscaleSettingResourcePatch object itself. - */ - public AutoscaleSettingResourcePatch withEnabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the name property: the name of the autoscale setting. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: the name of the autoscale setting. - * - * @param name the name value to set. - * @return the AutoscaleSettingResourcePatch object itself. - */ - public AutoscaleSettingResourcePatch withName(String name) { - this.name = name; - return this; - } - - /** - * Get the targetResourceUri property: the resource identifier of the resource that the autoscale setting should be - * added to. - * - * @return the targetResourceUri value. - */ - public String targetResourceUri() { - return this.targetResourceUri; - } - - /** - * Set the targetResourceUri property: the resource identifier of the resource that the autoscale setting should be - * added to. - * - * @param targetResourceUri the targetResourceUri value to set. - * @return the AutoscaleSettingResourcePatch object itself. - */ - public AutoscaleSettingResourcePatch withTargetResourceUri(String targetResourceUri) { - this.targetResourceUri = targetResourceUri; - return this; - } - - /** - * Get the targetResourceLocation property: the location of the resource that the autoscale setting should be added - * to. - * - * @return the targetResourceLocation value. - */ - public String targetResourceLocation() { - return this.targetResourceLocation; - } - - /** - * Set the targetResourceLocation property: the location of the resource that the autoscale setting should be added - * to. - * - * @param targetResourceLocation the targetResourceLocation value to set. - * @return the AutoscaleSettingResourcePatch object itself. - */ - public AutoscaleSettingResourcePatch withTargetResourceLocation(String targetResourceLocation) { - this.targetResourceLocation = targetResourceLocation; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (profiles() != null) { - profiles().forEach(e -> e.validate()); - } - if (notifications() != null) { - notifications().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AutoscaleSettings.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AutoscaleSettings.java deleted file mode 100644 index 68482c0028da..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AutoscaleSettings.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.monitor.MonitorManager; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsBatchDeletion; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsDeletingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsListingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsBatchCreation; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsCreating; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingById; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; - -/** Entry point to autoscale management API in Azure. */ -@Fluent -public interface AutoscaleSettings - extends SupportsCreating, - SupportsListing, - SupportsListingByResourceGroup, - SupportsGettingById, - SupportsBatchCreation, - SupportsDeletingById, - SupportsDeletingByResourceGroup, - SupportsBatchDeletion, - HasManager { -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AzNsActionGroup.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AzNsActionGroup.java deleted file mode 100644 index 5d277b5f6435..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AzNsActionGroup.java +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Azure action group. */ -@Fluent -public final class AzNsActionGroup { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AzNsActionGroup.class); - - /* - * Azure Action Group reference. - */ - @JsonProperty(value = "actionGroup") - private List actionGroup; - - /* - * Custom subject override for all email ids in Azure action group - */ - @JsonProperty(value = "emailSubject") - private String emailSubject; - - /* - * Custom payload to be sent for all webhook URI in Azure action group - */ - @JsonProperty(value = "customWebhookPayload") - private String customWebhookPayload; - - /** - * Get the actionGroup property: Azure Action Group reference. - * - * @return the actionGroup value. - */ - public List actionGroup() { - return this.actionGroup; - } - - /** - * Set the actionGroup property: Azure Action Group reference. - * - * @param actionGroup the actionGroup value to set. - * @return the AzNsActionGroup object itself. - */ - public AzNsActionGroup withActionGroup(List actionGroup) { - this.actionGroup = actionGroup; - return this; - } - - /** - * Get the emailSubject property: Custom subject override for all email ids in Azure action group. - * - * @return the emailSubject value. - */ - public String emailSubject() { - return this.emailSubject; - } - - /** - * Set the emailSubject property: Custom subject override for all email ids in Azure action group. - * - * @param emailSubject the emailSubject value to set. - * @return the AzNsActionGroup object itself. - */ - public AzNsActionGroup withEmailSubject(String emailSubject) { - this.emailSubject = emailSubject; - return this; - } - - /** - * Get the customWebhookPayload property: Custom payload to be sent for all webhook URI in Azure action group. - * - * @return the customWebhookPayload value. - */ - public String customWebhookPayload() { - return this.customWebhookPayload; - } - - /** - * Set the customWebhookPayload property: Custom payload to be sent for all webhook URI in Azure action group. - * - * @param customWebhookPayload the customWebhookPayload value to set. - * @return the AzNsActionGroup object itself. - */ - public AzNsActionGroup withCustomWebhookPayload(String customWebhookPayload) { - this.customWebhookPayload = customWebhookPayload; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AzureAppPushReceiver.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AzureAppPushReceiver.java deleted file mode 100644 index 9a87df0a4796..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AzureAppPushReceiver.java +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The Azure mobile App push notification receiver. */ -@Fluent -public final class AzureAppPushReceiver { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureAppPushReceiver.class); - - /* - * The name of the Azure mobile app push receiver. Names must be unique - * across all receivers within an action group. - */ - @JsonProperty(value = "name", required = true) - private String name; - - /* - * The email address registered for the Azure mobile app. - */ - @JsonProperty(value = "emailAddress", required = true) - private String emailAddress; - - /** - * Get the name property: The name of the Azure mobile app push receiver. Names must be unique across all receivers - * within an action group. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the Azure mobile app push receiver. Names must be unique across all receivers - * within an action group. - * - * @param name the name value to set. - * @return the AzureAppPushReceiver object itself. - */ - public AzureAppPushReceiver withName(String name) { - this.name = name; - return this; - } - - /** - * Get the emailAddress property: The email address registered for the Azure mobile app. - * - * @return the emailAddress value. - */ - public String emailAddress() { - return this.emailAddress; - } - - /** - * Set the emailAddress property: The email address registered for the Azure mobile app. - * - * @param emailAddress the emailAddress value to set. - * @return the AzureAppPushReceiver object itself. - */ - public AzureAppPushReceiver withEmailAddress(String emailAddress) { - this.emailAddress = emailAddress; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property name in model AzureAppPushReceiver")); - } - if (emailAddress() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property emailAddress in model AzureAppPushReceiver")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AzureFunctionReceiver.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AzureFunctionReceiver.java deleted file mode 100644 index eb0bbf8fc04b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AzureFunctionReceiver.java +++ /dev/null @@ -1,180 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** An azure function receiver. */ -@Fluent -public final class AzureFunctionReceiver { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureFunctionReceiver.class); - - /* - * The name of the azure function receiver. Names must be unique across all - * receivers within an action group. - */ - @JsonProperty(value = "name", required = true) - private String name; - - /* - * The azure resource id of the function app. - */ - @JsonProperty(value = "functionAppResourceId", required = true) - private String functionAppResourceId; - - /* - * The function name in the function app. - */ - @JsonProperty(value = "functionName", required = true) - private String functionName; - - /* - * The http trigger url where http request sent to. - */ - @JsonProperty(value = "httpTriggerUrl", required = true) - private String httpTriggerUrl; - - /* - * Indicates whether to use common alert schema. - */ - @JsonProperty(value = "useCommonAlertSchema") - private Boolean useCommonAlertSchema; - - /** - * Get the name property: The name of the azure function receiver. Names must be unique across all receivers within - * an action group. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the azure function receiver. Names must be unique across all receivers within - * an action group. - * - * @param name the name value to set. - * @return the AzureFunctionReceiver object itself. - */ - public AzureFunctionReceiver withName(String name) { - this.name = name; - return this; - } - - /** - * Get the functionAppResourceId property: The azure resource id of the function app. - * - * @return the functionAppResourceId value. - */ - public String functionAppResourceId() { - return this.functionAppResourceId; - } - - /** - * Set the functionAppResourceId property: The azure resource id of the function app. - * - * @param functionAppResourceId the functionAppResourceId value to set. - * @return the AzureFunctionReceiver object itself. - */ - public AzureFunctionReceiver withFunctionAppResourceId(String functionAppResourceId) { - this.functionAppResourceId = functionAppResourceId; - return this; - } - - /** - * Get the functionName property: The function name in the function app. - * - * @return the functionName value. - */ - public String functionName() { - return this.functionName; - } - - /** - * Set the functionName property: The function name in the function app. - * - * @param functionName the functionName value to set. - * @return the AzureFunctionReceiver object itself. - */ - public AzureFunctionReceiver withFunctionName(String functionName) { - this.functionName = functionName; - return this; - } - - /** - * Get the httpTriggerUrl property: The http trigger url where http request sent to. - * - * @return the httpTriggerUrl value. - */ - public String httpTriggerUrl() { - return this.httpTriggerUrl; - } - - /** - * Set the httpTriggerUrl property: The http trigger url where http request sent to. - * - * @param httpTriggerUrl the httpTriggerUrl value to set. - * @return the AzureFunctionReceiver object itself. - */ - public AzureFunctionReceiver withHttpTriggerUrl(String httpTriggerUrl) { - this.httpTriggerUrl = httpTriggerUrl; - return this; - } - - /** - * Get the useCommonAlertSchema property: Indicates whether to use common alert schema. - * - * @return the useCommonAlertSchema value. - */ - public Boolean useCommonAlertSchema() { - return this.useCommonAlertSchema; - } - - /** - * Set the useCommonAlertSchema property: Indicates whether to use common alert schema. - * - * @param useCommonAlertSchema the useCommonAlertSchema value to set. - * @return the AzureFunctionReceiver object itself. - */ - public AzureFunctionReceiver withUseCommonAlertSchema(Boolean useCommonAlertSchema) { - this.useCommonAlertSchema = useCommonAlertSchema; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property name in model AzureFunctionReceiver")); - } - if (functionAppResourceId() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property functionAppResourceId in model AzureFunctionReceiver")); - } - if (functionName() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property functionName in model AzureFunctionReceiver")); - } - if (httpTriggerUrl() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property httpTriggerUrl in model AzureFunctionReceiver")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AzureMonitorMetricsDestination.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AzureMonitorMetricsDestination.java deleted file mode 100644 index 20bc11cfe9b3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AzureMonitorMetricsDestination.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Azure Monitor Metrics destination. */ -@Fluent -public class AzureMonitorMetricsDestination { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureMonitorMetricsDestination.class); - - /* - * A friendly name for the destination. - * This name should be unique across all destinations (regardless of type) - * within the data collection rule. - */ - @JsonProperty(value = "name") - private String name; - - /** - * Get the name property: A friendly name for the destination. This name should be unique across all destinations - * (regardless of type) within the data collection rule. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: A friendly name for the destination. This name should be unique across all destinations - * (regardless of type) within the data collection rule. - * - * @param name the name value to set. - * @return the AzureMonitorMetricsDestination object itself. - */ - public AzureMonitorMetricsDestination withName(String name) { - this.name = name; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AzureMonitorPrivateLinkScopeListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AzureMonitorPrivateLinkScopeListResult.java deleted file mode 100644 index 59b75f5fbf98..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AzureMonitorPrivateLinkScopeListResult.java +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.fluent.models.AzureMonitorPrivateLinkScopeInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Describes the list of Azure Monitor PrivateLinkScope resources. */ -@Fluent -public final class AzureMonitorPrivateLinkScopeListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureMonitorPrivateLinkScopeListResult.class); - - /* - * List of Azure Monitor PrivateLinkScope definitions. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * The URI to get the next set of Azure Monitor PrivateLinkScope - * definitions if too many PrivateLinkScopes where returned in the result - * set. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: List of Azure Monitor PrivateLinkScope definitions. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: List of Azure Monitor PrivateLinkScope definitions. - * - * @param value the value value to set. - * @return the AzureMonitorPrivateLinkScopeListResult object itself. - */ - public AzureMonitorPrivateLinkScopeListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URI to get the next set of Azure Monitor PrivateLinkScope definitions if too many - * PrivateLinkScopes where returned in the result set. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The URI to get the next set of Azure Monitor PrivateLinkScope definitions if too many - * PrivateLinkScopes where returned in the result set. - * - * @param nextLink the nextLink value to set. - * @return the AzureMonitorPrivateLinkScopeListResult object itself. - */ - public AzureMonitorPrivateLinkScopeListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property value in model AzureMonitorPrivateLinkScopeListResult")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AzureResource.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AzureResource.java deleted file mode 100644 index de780c13f1f2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AzureResource.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** An azure resource object. */ -@Fluent -public class AzureResource extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureResource.class); - - /* - * Azure resource kind - */ - @JsonProperty(value = "kind", access = JsonProperty.Access.WRITE_ONLY) - private String kind; - - /* - * Azure resource identity - */ - @JsonProperty(value = "identity", access = JsonProperty.Access.WRITE_ONLY) - private String identity; - - /** - * Get the kind property: Azure resource kind. - * - * @return the kind value. - */ - public String kind() { - return this.kind; - } - - /** - * Get the identity property: Azure resource identity. - * - * @return the identity value. - */ - public String identity() { - return this.identity; - } - - /** {@inheritDoc} */ - @Override - public AzureResource withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public AzureResource withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/BaselineMetadata.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/BaselineMetadata.java deleted file mode 100644 index 0830d80275eb..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/BaselineMetadata.java +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Represents a baseline metadata value. */ -@Fluent -public final class BaselineMetadata { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BaselineMetadata.class); - - /* - * Name of the baseline metadata. - */ - @JsonProperty(value = "name", required = true) - private String name; - - /* - * Value of the baseline metadata. - */ - @JsonProperty(value = "value", required = true) - private String value; - - /** - * Get the name property: Name of the baseline metadata. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Name of the baseline metadata. - * - * @param name the name value to set. - * @return the BaselineMetadata object itself. - */ - public BaselineMetadata withName(String name) { - this.name = name; - return this; - } - - /** - * Get the value property: Value of the baseline metadata. - * - * @return the value value. - */ - public String value() { - return this.value; - } - - /** - * Set the value property: Value of the baseline metadata. - * - * @param value the value value to set. - * @return the BaselineMetadata object itself. - */ - public BaselineMetadata withValue(String value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property name in model BaselineMetadata")); - } - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model BaselineMetadata")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/BaselineSensitivity.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/BaselineSensitivity.java deleted file mode 100644 index af4f0fca24a0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/BaselineSensitivity.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for BaselineSensitivity. */ -public final class BaselineSensitivity extends ExpandableStringEnum { - /** Static value Low for BaselineSensitivity. */ - public static final BaselineSensitivity LOW = fromString("Low"); - - /** Static value Medium for BaselineSensitivity. */ - public static final BaselineSensitivity MEDIUM = fromString("Medium"); - - /** Static value High for BaselineSensitivity. */ - public static final BaselineSensitivity HIGH = fromString("High"); - - /** - * Creates or finds a BaselineSensitivity from its string representation. - * - * @param name a name to look for. - * @return the corresponding BaselineSensitivity. - */ - @JsonCreator - public static BaselineSensitivity fromString(String name) { - return fromString(name, BaselineSensitivity.class); - } - - /** @return known BaselineSensitivity values. */ - public static Collection values() { - return values(BaselineSensitivity.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/CategoryType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/CategoryType.java deleted file mode 100644 index 4dad31216849..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/CategoryType.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for CategoryType. */ -public enum CategoryType { - /** Enum value Metrics. */ - METRICS("Metrics"), - - /** Enum value Logs. */ - LOGS("Logs"); - - /** The actual serialized value for a CategoryType instance. */ - private final String value; - - CategoryType(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a CategoryType instance. - * - * @param value the serialized value to parse. - * @return the parsed CategoryType object, or null if unable to parse. - */ - @JsonCreator - public static CategoryType fromString(String value) { - CategoryType[] items = CategoryType.values(); - for (CategoryType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ComparisonOperationType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ComparisonOperationType.java deleted file mode 100644 index c0d1e2d7f0a0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ComparisonOperationType.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for ComparisonOperationType. */ -public enum ComparisonOperationType { - /** Enum value Equals. */ - EQUALS("Equals"), - - /** Enum value NotEquals. */ - NOT_EQUALS("NotEquals"), - - /** Enum value GreaterThan. */ - GREATER_THAN("GreaterThan"), - - /** Enum value GreaterThanOrEqual. */ - GREATER_THAN_OR_EQUAL("GreaterThanOrEqual"), - - /** Enum value LessThan. */ - LESS_THAN("LessThan"), - - /** Enum value LessThanOrEqual. */ - LESS_THAN_OR_EQUAL("LessThanOrEqual"); - - /** The actual serialized value for a ComparisonOperationType instance. */ - private final String value; - - ComparisonOperationType(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a ComparisonOperationType instance. - * - * @param value the serialized value to parse. - * @return the parsed ComparisonOperationType object, or null if unable to parse. - */ - @JsonCreator - public static ComparisonOperationType fromString(String value) { - ComparisonOperationType[] items = ComparisonOperationType.values(); - for (ComparisonOperationType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ConditionOperator.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ConditionOperator.java deleted file mode 100644 index 1cd58a201762..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ConditionOperator.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for ConditionOperator. */ -public enum ConditionOperator { - /** Enum value GreaterThan. */ - GREATER_THAN("GreaterThan"), - - /** Enum value GreaterThanOrEqual. */ - GREATER_THAN_OR_EQUAL("GreaterThanOrEqual"), - - /** Enum value LessThan. */ - LESS_THAN("LessThan"), - - /** Enum value LessThanOrEqual. */ - LESS_THAN_OR_EQUAL("LessThanOrEqual"); - - /** The actual serialized value for a ConditionOperator instance. */ - private final String value; - - ConditionOperator(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a ConditionOperator instance. - * - * @param value the serialized value to parse. - * @return the parsed ConditionOperator object, or null if unable to parse. - */ - @JsonCreator - public static ConditionOperator fromString(String value) { - ConditionOperator[] items = ConditionOperator.values(); - for (ConditionOperator item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ConditionalOperator.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ConditionalOperator.java deleted file mode 100644 index 5b034708fabb..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ConditionalOperator.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ConditionalOperator. */ -public final class ConditionalOperator extends ExpandableStringEnum { - /** Static value GreaterThanOrEqual for ConditionalOperator. */ - public static final ConditionalOperator GREATER_THAN_OR_EQUAL = fromString("GreaterThanOrEqual"); - - /** Static value LessThanOrEqual for ConditionalOperator. */ - public static final ConditionalOperator LESS_THAN_OR_EQUAL = fromString("LessThanOrEqual"); - - /** Static value GreaterThan for ConditionalOperator. */ - public static final ConditionalOperator GREATER_THAN = fromString("GreaterThan"); - - /** Static value LessThan for ConditionalOperator. */ - public static final ConditionalOperator LESS_THAN = fromString("LessThan"); - - /** Static value Equal for ConditionalOperator. */ - public static final ConditionalOperator EQUAL = fromString("Equal"); - - /** - * Creates or finds a ConditionalOperator from its string representation. - * - * @param name a name to look for. - * @return the corresponding ConditionalOperator. - */ - @JsonCreator - public static ConditionalOperator fromString(String name) { - return fromString(name, ConditionalOperator.class); - } - - /** @return known ConditionalOperator values. */ - public static Collection values() { - return values(ConditionalOperator.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ConfigurationAccessEndpointSpec.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ConfigurationAccessEndpointSpec.java deleted file mode 100644 index 5b1d3b77bbaf..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ConfigurationAccessEndpointSpec.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Definition of the endpoint used for accessing configuration. */ -@Immutable -public class ConfigurationAccessEndpointSpec { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ConfigurationAccessEndpointSpec.class); - - /* - * The endpoint. This property is READ-ONLY. - */ - @JsonProperty(value = "endpoint", access = JsonProperty.Access.WRITE_ONLY) - private String endpoint; - - /** - * Get the endpoint property: The endpoint. This property is READ-ONLY. - * - * @return the endpoint value. - */ - public String endpoint() { - return this.endpoint; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/Criteria.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/Criteria.java deleted file mode 100644 index 8c20f7de3b4d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/Criteria.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Specifies the criteria for converting log to metric. */ -@Fluent -public final class Criteria { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Criteria.class); - - /* - * Name of the metric - */ - @JsonProperty(value = "metricName", required = true) - private String metricName; - - /* - * List of Dimensions for creating metric - */ - @JsonProperty(value = "dimensions") - private List dimensions; - - /** - * Get the metricName property: Name of the metric. - * - * @return the metricName value. - */ - public String metricName() { - return this.metricName; - } - - /** - * Set the metricName property: Name of the metric. - * - * @param metricName the metricName value to set. - * @return the Criteria object itself. - */ - public Criteria withMetricName(String metricName) { - this.metricName = metricName; - return this; - } - - /** - * Get the dimensions property: List of Dimensions for creating metric. - * - * @return the dimensions value. - */ - public List dimensions() { - return this.dimensions; - } - - /** - * Set the dimensions property: List of Dimensions for creating metric. - * - * @param dimensions the dimensions value to set. - * @return the Criteria object itself. - */ - public Criteria withDimensions(List dimensions) { - this.dimensions = dimensions; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (metricName() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property metricName in model Criteria")); - } - if (dimensions() != null) { - dimensions().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/CriterionType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/CriterionType.java deleted file mode 100644 index 10a45cb7a6c2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/CriterionType.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for CriterionType. */ -public final class CriterionType extends ExpandableStringEnum { - /** Static value StaticThresholdCriterion for CriterionType. */ - public static final CriterionType STATIC_THRESHOLD_CRITERION = fromString("StaticThresholdCriterion"); - - /** Static value DynamicThresholdCriterion for CriterionType. */ - public static final CriterionType DYNAMIC_THRESHOLD_CRITERION = fromString("DynamicThresholdCriterion"); - - /** - * Creates or finds a CriterionType from its string representation. - * - * @param name a name to look for. - * @return the corresponding CriterionType. - */ - @JsonCreator - public static CriterionType fromString(String name) { - return fromString(name, CriterionType.class); - } - - /** @return known CriterionType values. */ - public static Collection values() { - return values(CriterionType.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionEndpoint.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionEndpoint.java deleted file mode 100644 index db44f6fc9ed4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionEndpoint.java +++ /dev/null @@ -1,182 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Definition of data collection endpoint. */ -@Fluent -public class DataCollectionEndpoint { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DataCollectionEndpoint.class); - - /* - * Description of the data collection endpoint. - */ - @JsonProperty(value = "description") - private String description; - - /* - * The immutable ID of this data collection endpoint resource. This - * property is READ-ONLY. - */ - @JsonProperty(value = "immutableId") - private String immutableId; - - /* - * The endpoint used by agents to access their configuration. - */ - @JsonProperty(value = "configurationAccess") - private DataCollectionEndpointConfigurationAccess configurationAccess; - - /* - * The endpoint used by clients to ingest logs. - */ - @JsonProperty(value = "logsIngestion") - private DataCollectionEndpointLogsIngestion logsIngestion; - - /* - * Network access control rules for the endpoints. - */ - @JsonProperty(value = "networkAcls") - private DataCollectionEndpointNetworkAcls networkAcls; - - /* - * The resource provisioning state. This property is READ-ONLY. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private KnownDataCollectionEndpointProvisioningState provisioningState; - - /** - * Get the description property: Description of the data collection endpoint. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: Description of the data collection endpoint. - * - * @param description the description value to set. - * @return the DataCollectionEndpoint object itself. - */ - public DataCollectionEndpoint withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the immutableId property: The immutable ID of this data collection endpoint resource. This property is - * READ-ONLY. - * - * @return the immutableId value. - */ - public String immutableId() { - return this.immutableId; - } - - /** - * Set the immutableId property: The immutable ID of this data collection endpoint resource. This property is - * READ-ONLY. - * - * @param immutableId the immutableId value to set. - * @return the DataCollectionEndpoint object itself. - */ - public DataCollectionEndpoint withImmutableId(String immutableId) { - this.immutableId = immutableId; - return this; - } - - /** - * Get the configurationAccess property: The endpoint used by agents to access their configuration. - * - * @return the configurationAccess value. - */ - public DataCollectionEndpointConfigurationAccess configurationAccess() { - return this.configurationAccess; - } - - /** - * Set the configurationAccess property: The endpoint used by agents to access their configuration. - * - * @param configurationAccess the configurationAccess value to set. - * @return the DataCollectionEndpoint object itself. - */ - public DataCollectionEndpoint withConfigurationAccess( - DataCollectionEndpointConfigurationAccess configurationAccess) { - this.configurationAccess = configurationAccess; - return this; - } - - /** - * Get the logsIngestion property: The endpoint used by clients to ingest logs. - * - * @return the logsIngestion value. - */ - public DataCollectionEndpointLogsIngestion logsIngestion() { - return this.logsIngestion; - } - - /** - * Set the logsIngestion property: The endpoint used by clients to ingest logs. - * - * @param logsIngestion the logsIngestion value to set. - * @return the DataCollectionEndpoint object itself. - */ - public DataCollectionEndpoint withLogsIngestion(DataCollectionEndpointLogsIngestion logsIngestion) { - this.logsIngestion = logsIngestion; - return this; - } - - /** - * Get the networkAcls property: Network access control rules for the endpoints. - * - * @return the networkAcls value. - */ - public DataCollectionEndpointNetworkAcls networkAcls() { - return this.networkAcls; - } - - /** - * Set the networkAcls property: Network access control rules for the endpoints. - * - * @param networkAcls the networkAcls value to set. - * @return the DataCollectionEndpoint object itself. - */ - public DataCollectionEndpoint withNetworkAcls(DataCollectionEndpointNetworkAcls networkAcls) { - this.networkAcls = networkAcls; - return this; - } - - /** - * Get the provisioningState property: The resource provisioning state. This property is READ-ONLY. - * - * @return the provisioningState value. - */ - public KnownDataCollectionEndpointProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (configurationAccess() != null) { - configurationAccess().validate(); - } - if (logsIngestion() != null) { - logsIngestion().validate(); - } - if (networkAcls() != null) { - networkAcls().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionEndpointConfigurationAccess.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionEndpointConfigurationAccess.java deleted file mode 100644 index b0d52a912b1d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionEndpointConfigurationAccess.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; - -/** The endpoint used by agents to access their configuration. */ -@Immutable -public final class DataCollectionEndpointConfigurationAccess extends ConfigurationAccessEndpointSpec { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DataCollectionEndpointConfigurationAccess.class); - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionEndpointLogsIngestion.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionEndpointLogsIngestion.java deleted file mode 100644 index bdd6e2ebc8f7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionEndpointLogsIngestion.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; - -/** The endpoint used by clients to ingest logs. */ -@Immutable -public final class DataCollectionEndpointLogsIngestion extends LogsIngestionEndpointSpec { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DataCollectionEndpointLogsIngestion.class); - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionEndpointNetworkAcls.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionEndpointNetworkAcls.java deleted file mode 100644 index f21821ab1ff3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionEndpointNetworkAcls.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; - -/** Network access control rules for the endpoints. */ -@Fluent -public final class DataCollectionEndpointNetworkAcls extends NetworkRuleSet { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DataCollectionEndpointNetworkAcls.class); - - /** {@inheritDoc} */ - @Override - public DataCollectionEndpointNetworkAcls withPublicNetworkAccess( - KnownPublicNetworkAccessOptions publicNetworkAccess) { - super.withPublicNetworkAccess(publicNetworkAccess); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionEndpointResourceListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionEndpointResourceListResult.java deleted file mode 100644 index 4ca831d79c43..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionEndpointResourceListResult.java +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.fluent.models.DataCollectionEndpointResourceInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** A pageable list of resources. */ -@Fluent -public final class DataCollectionEndpointResourceListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DataCollectionEndpointResourceListResult.class); - - /* - * A list of resources. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * The URL to use for getting the next set of results. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: A list of resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: A list of resources. - * - * @param value the value value to set. - * @return the DataCollectionEndpointResourceListResult object itself. - */ - public DataCollectionEndpointResourceListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to use for getting the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The URL to use for getting the next set of results. - * - * @param nextLink the nextLink value to set. - * @return the DataCollectionEndpointResourceListResult object itself. - */ - public DataCollectionEndpointResourceListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property value in model DataCollectionEndpointResourceListResult")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionEndpointResourceProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionEndpointResourceProperties.java deleted file mode 100644 index 55973242b1ab..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionEndpointResourceProperties.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; - -/** Resource properties. */ -@Fluent -public final class DataCollectionEndpointResourceProperties extends DataCollectionEndpoint { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DataCollectionEndpointResourceProperties.class); - - /** {@inheritDoc} */ - @Override - public DataCollectionEndpointResourceProperties withDescription(String description) { - super.withDescription(description); - return this; - } - - /** {@inheritDoc} */ - @Override - public DataCollectionEndpointResourceProperties withImmutableId(String immutableId) { - super.withImmutableId(immutableId); - return this; - } - - /** {@inheritDoc} */ - @Override - public DataCollectionEndpointResourceProperties withConfigurationAccess( - DataCollectionEndpointConfigurationAccess configurationAccess) { - super.withConfigurationAccess(configurationAccess); - return this; - } - - /** {@inheritDoc} */ - @Override - public DataCollectionEndpointResourceProperties withLogsIngestion( - DataCollectionEndpointLogsIngestion logsIngestion) { - super.withLogsIngestion(logsIngestion); - return this; - } - - /** {@inheritDoc} */ - @Override - public DataCollectionEndpointResourceProperties withNetworkAcls(DataCollectionEndpointNetworkAcls networkAcls) { - super.withNetworkAcls(networkAcls); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRule.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRule.java deleted file mode 100644 index 24275d0ec743..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRule.java +++ /dev/null @@ -1,173 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Definition of what monitoring data to collect and where that data should be sent. */ -@Fluent -public class DataCollectionRule { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DataCollectionRule.class); - - /* - * Description of the data collection rule. - */ - @JsonProperty(value = "description") - private String description; - - /* - * The immutable ID of this data collection rule. This property is - * READ-ONLY. - */ - @JsonProperty(value = "immutableId", access = JsonProperty.Access.WRITE_ONLY) - private String immutableId; - - /* - * The specification of data sources. - * This property is optional and can be omitted if the rule is meant to be - * used via direct calls to the provisioned endpoint. - */ - @JsonProperty(value = "dataSources") - private DataCollectionRuleDataSources dataSources; - - /* - * The specification of destinations. - */ - @JsonProperty(value = "destinations") - private DataCollectionRuleDestinations destinations; - - /* - * The specification of data flows. - */ - @JsonProperty(value = "dataFlows") - private List dataFlows; - - /* - * The resource provisioning state. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private KnownDataCollectionRuleProvisioningState provisioningState; - - /** - * Get the description property: Description of the data collection rule. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: Description of the data collection rule. - * - * @param description the description value to set. - * @return the DataCollectionRule object itself. - */ - public DataCollectionRule withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the immutableId property: The immutable ID of this data collection rule. This property is READ-ONLY. - * - * @return the immutableId value. - */ - public String immutableId() { - return this.immutableId; - } - - /** - * Get the dataSources property: The specification of data sources. This property is optional and can be omitted if - * the rule is meant to be used via direct calls to the provisioned endpoint. - * - * @return the dataSources value. - */ - public DataCollectionRuleDataSources dataSources() { - return this.dataSources; - } - - /** - * Set the dataSources property: The specification of data sources. This property is optional and can be omitted if - * the rule is meant to be used via direct calls to the provisioned endpoint. - * - * @param dataSources the dataSources value to set. - * @return the DataCollectionRule object itself. - */ - public DataCollectionRule withDataSources(DataCollectionRuleDataSources dataSources) { - this.dataSources = dataSources; - return this; - } - - /** - * Get the destinations property: The specification of destinations. - * - * @return the destinations value. - */ - public DataCollectionRuleDestinations destinations() { - return this.destinations; - } - - /** - * Set the destinations property: The specification of destinations. - * - * @param destinations the destinations value to set. - * @return the DataCollectionRule object itself. - */ - public DataCollectionRule withDestinations(DataCollectionRuleDestinations destinations) { - this.destinations = destinations; - return this; - } - - /** - * Get the dataFlows property: The specification of data flows. - * - * @return the dataFlows value. - */ - public List dataFlows() { - return this.dataFlows; - } - - /** - * Set the dataFlows property: The specification of data flows. - * - * @param dataFlows the dataFlows value to set. - * @return the DataCollectionRule object itself. - */ - public DataCollectionRule withDataFlows(List dataFlows) { - this.dataFlows = dataFlows; - return this; - } - - /** - * Get the provisioningState property: The resource provisioning state. - * - * @return the provisioningState value. - */ - public KnownDataCollectionRuleProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (dataSources() != null) { - dataSources().validate(); - } - if (destinations() != null) { - destinations().validate(); - } - if (dataFlows() != null) { - dataFlows().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRuleAssociation.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRuleAssociation.java deleted file mode 100644 index 1de7c91d0f4c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRuleAssociation.java +++ /dev/null @@ -1,120 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Definition of association of a data collection rule with a monitored Azure resource. */ -@Fluent -public class DataCollectionRuleAssociation { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DataCollectionRuleAssociation.class); - - /* - * Description of the association. - */ - @JsonProperty(value = "description") - private String description; - - /* - * The resource ID of the data collection rule that is to be associated. - */ - @JsonProperty(value = "dataCollectionRuleId") - private String dataCollectionRuleId; - - /* - * The resource ID of the data collection endpoint that is to be - * associated. - */ - @JsonProperty(value = "dataCollectionEndpointId") - private String dataCollectionEndpointId; - - /* - * The resource provisioning state. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private KnownDataCollectionRuleAssociationProvisioningState provisioningState; - - /** - * Get the description property: Description of the association. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: Description of the association. - * - * @param description the description value to set. - * @return the DataCollectionRuleAssociation object itself. - */ - public DataCollectionRuleAssociation withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the dataCollectionRuleId property: The resource ID of the data collection rule that is to be associated. - * - * @return the dataCollectionRuleId value. - */ - public String dataCollectionRuleId() { - return this.dataCollectionRuleId; - } - - /** - * Set the dataCollectionRuleId property: The resource ID of the data collection rule that is to be associated. - * - * @param dataCollectionRuleId the dataCollectionRuleId value to set. - * @return the DataCollectionRuleAssociation object itself. - */ - public DataCollectionRuleAssociation withDataCollectionRuleId(String dataCollectionRuleId) { - this.dataCollectionRuleId = dataCollectionRuleId; - return this; - } - - /** - * Get the dataCollectionEndpointId property: The resource ID of the data collection endpoint that is to be - * associated. - * - * @return the dataCollectionEndpointId value. - */ - public String dataCollectionEndpointId() { - return this.dataCollectionEndpointId; - } - - /** - * Set the dataCollectionEndpointId property: The resource ID of the data collection endpoint that is to be - * associated. - * - * @param dataCollectionEndpointId the dataCollectionEndpointId value to set. - * @return the DataCollectionRuleAssociation object itself. - */ - public DataCollectionRuleAssociation withDataCollectionEndpointId(String dataCollectionEndpointId) { - this.dataCollectionEndpointId = dataCollectionEndpointId; - return this; - } - - /** - * Get the provisioningState property: The resource provisioning state. - * - * @return the provisioningState value. - */ - public KnownDataCollectionRuleAssociationProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRuleAssociationProxyOnlyResourceListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRuleAssociationProxyOnlyResourceListResult.java deleted file mode 100644 index 4938510fa311..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRuleAssociationProxyOnlyResourceListResult.java +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.fluent.models.DataCollectionRuleAssociationProxyOnlyResourceInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** A pageable list of resources. */ -@Fluent -public final class DataCollectionRuleAssociationProxyOnlyResourceListResult { - @JsonIgnore - private final ClientLogger logger = - new ClientLogger(DataCollectionRuleAssociationProxyOnlyResourceListResult.class); - - /* - * A list of resources. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * The URL to use for getting the next set of results. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: A list of resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: A list of resources. - * - * @param value the value value to set. - * @return the DataCollectionRuleAssociationProxyOnlyResourceListResult object itself. - */ - public DataCollectionRuleAssociationProxyOnlyResourceListResult withValue( - List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to use for getting the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The URL to use for getting the next set of results. - * - * @param nextLink the nextLink value to set. - * @return the DataCollectionRuleAssociationProxyOnlyResourceListResult object itself. - */ - public DataCollectionRuleAssociationProxyOnlyResourceListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property value in model" - + " DataCollectionRuleAssociationProxyOnlyResourceListResult")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRuleAssociationProxyOnlyResourceProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRuleAssociationProxyOnlyResourceProperties.java deleted file mode 100644 index d7d9f58c9548..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRuleAssociationProxyOnlyResourceProperties.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; - -/** Resource properties. */ -@Fluent -public final class DataCollectionRuleAssociationProxyOnlyResourceProperties extends DataCollectionRuleAssociation { - @JsonIgnore - private final ClientLogger logger = - new ClientLogger(DataCollectionRuleAssociationProxyOnlyResourceProperties.class); - - /** {@inheritDoc} */ - @Override - public DataCollectionRuleAssociationProxyOnlyResourceProperties withDescription(String description) { - super.withDescription(description); - return this; - } - - /** {@inheritDoc} */ - @Override - public DataCollectionRuleAssociationProxyOnlyResourceProperties withDataCollectionRuleId( - String dataCollectionRuleId) { - super.withDataCollectionRuleId(dataCollectionRuleId); - return this; - } - - /** {@inheritDoc} */ - @Override - public DataCollectionRuleAssociationProxyOnlyResourceProperties withDataCollectionEndpointId( - String dataCollectionEndpointId) { - super.withDataCollectionEndpointId(dataCollectionEndpointId); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRuleDataSources.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRuleDataSources.java deleted file mode 100644 index ee0a612e4139..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRuleDataSources.java +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import java.util.List; - -/** - * The specification of data sources. This property is optional and can be omitted if the rule is meant to be used via - * direct calls to the provisioned endpoint. - */ -@Fluent -public final class DataCollectionRuleDataSources extends DataSourcesSpec { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DataCollectionRuleDataSources.class); - - /** {@inheritDoc} */ - @Override - public DataCollectionRuleDataSources withPerformanceCounters(List performanceCounters) { - super.withPerformanceCounters(performanceCounters); - return this; - } - - /** {@inheritDoc} */ - @Override - public DataCollectionRuleDataSources withWindowsEventLogs(List windowsEventLogs) { - super.withWindowsEventLogs(windowsEventLogs); - return this; - } - - /** {@inheritDoc} */ - @Override - public DataCollectionRuleDataSources withSyslog(List syslog) { - super.withSyslog(syslog); - return this; - } - - /** {@inheritDoc} */ - @Override - public DataCollectionRuleDataSources withExtensions(List extensions) { - super.withExtensions(extensions); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRuleDestinations.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRuleDestinations.java deleted file mode 100644 index 1fd2830c7bf7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRuleDestinations.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import java.util.List; - -/** The specification of destinations. */ -@Fluent -public final class DataCollectionRuleDestinations extends DestinationsSpec { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DataCollectionRuleDestinations.class); - - /** {@inheritDoc} */ - @Override - public DataCollectionRuleDestinations withLogAnalytics(List logAnalytics) { - super.withLogAnalytics(logAnalytics); - return this; - } - - /** {@inheritDoc} */ - @Override - public DataCollectionRuleDestinations withAzureMonitorMetrics( - DestinationsSpecAzureMonitorMetrics azureMonitorMetrics) { - super.withAzureMonitorMetrics(azureMonitorMetrics); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRuleResourceListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRuleResourceListResult.java deleted file mode 100644 index 9bf874261f75..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRuleResourceListResult.java +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.fluent.models.DataCollectionRuleResourceInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** A pageable list of resources. */ -@Fluent -public final class DataCollectionRuleResourceListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DataCollectionRuleResourceListResult.class); - - /* - * A list of resources. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * The URL to use for getting the next set of results. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: A list of resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: A list of resources. - * - * @param value the value value to set. - * @return the DataCollectionRuleResourceListResult object itself. - */ - public DataCollectionRuleResourceListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to use for getting the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The URL to use for getting the next set of results. - * - * @param nextLink the nextLink value to set. - * @return the DataCollectionRuleResourceListResult object itself. - */ - public DataCollectionRuleResourceListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property value in model DataCollectionRuleResourceListResult")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRuleResourceProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRuleResourceProperties.java deleted file mode 100644 index 7666fda3b6a7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRuleResourceProperties.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import java.util.List; - -/** Resource properties. */ -@Fluent -public final class DataCollectionRuleResourceProperties extends DataCollectionRule { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DataCollectionRuleResourceProperties.class); - - /** {@inheritDoc} */ - @Override - public DataCollectionRuleResourceProperties withDescription(String description) { - super.withDescription(description); - return this; - } - - /** {@inheritDoc} */ - @Override - public DataCollectionRuleResourceProperties withDataSources(DataCollectionRuleDataSources dataSources) { - super.withDataSources(dataSources); - return this; - } - - /** {@inheritDoc} */ - @Override - public DataCollectionRuleResourceProperties withDestinations(DataCollectionRuleDestinations destinations) { - super.withDestinations(destinations); - return this; - } - - /** {@inheritDoc} */ - @Override - public DataCollectionRuleResourceProperties withDataFlows(List dataFlows) { - super.withDataFlows(dataFlows); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataContainer.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataContainer.java deleted file mode 100644 index 9009c829bff8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataContainer.java +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Information about a container with data for a given resource. */ -@Fluent -public final class DataContainer { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DataContainer.class); - - /* - * Log Analytics workspace information. - */ - @JsonProperty(value = "workspace", required = true) - private WorkspaceInfo workspace; - - /** - * Get the workspace property: Log Analytics workspace information. - * - * @return the workspace value. - */ - public WorkspaceInfo workspace() { - return this.workspace; - } - - /** - * Set the workspace property: Log Analytics workspace information. - * - * @param workspace the workspace value to set. - * @return the DataContainer object itself. - */ - public DataContainer withWorkspace(WorkspaceInfo workspace) { - this.workspace = workspace; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (workspace() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property workspace in model DataContainer")); - } else { - workspace().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataFlow.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataFlow.java deleted file mode 100644 index 050d18e7205a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataFlow.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Definition of which streams are sent to which destinations. */ -@Fluent -public final class DataFlow { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DataFlow.class); - - /* - * List of streams for this data flow. - */ - @JsonProperty(value = "streams") - private List streams; - - /* - * List of destinations for this data flow. - */ - @JsonProperty(value = "destinations") - private List destinations; - - /** - * Get the streams property: List of streams for this data flow. - * - * @return the streams value. - */ - public List streams() { - return this.streams; - } - - /** - * Set the streams property: List of streams for this data flow. - * - * @param streams the streams value to set. - * @return the DataFlow object itself. - */ - public DataFlow withStreams(List streams) { - this.streams = streams; - return this; - } - - /** - * Get the destinations property: List of destinations for this data flow. - * - * @return the destinations value. - */ - public List destinations() { - return this.destinations; - } - - /** - * Set the destinations property: List of destinations for this data flow. - * - * @param destinations the destinations value to set. - * @return the DataFlow object itself. - */ - public DataFlow withDestinations(List destinations) { - this.destinations = destinations; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataSourcesSpec.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataSourcesSpec.java deleted file mode 100644 index 154632db5551..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataSourcesSpec.java +++ /dev/null @@ -1,141 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Specification of data sources that will be collected. */ -@Fluent -public class DataSourcesSpec { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DataSourcesSpec.class); - - /* - * The list of performance counter data source configurations. - */ - @JsonProperty(value = "performanceCounters") - private List performanceCounters; - - /* - * The list of Windows Event Log data source configurations. - */ - @JsonProperty(value = "windowsEventLogs") - private List windowsEventLogs; - - /* - * The list of Syslog data source configurations. - */ - @JsonProperty(value = "syslog") - private List syslog; - - /* - * The list of Azure VM extension data source configurations. - */ - @JsonProperty(value = "extensions") - private List extensions; - - /** - * Get the performanceCounters property: The list of performance counter data source configurations. - * - * @return the performanceCounters value. - */ - public List performanceCounters() { - return this.performanceCounters; - } - - /** - * Set the performanceCounters property: The list of performance counter data source configurations. - * - * @param performanceCounters the performanceCounters value to set. - * @return the DataSourcesSpec object itself. - */ - public DataSourcesSpec withPerformanceCounters(List performanceCounters) { - this.performanceCounters = performanceCounters; - return this; - } - - /** - * Get the windowsEventLogs property: The list of Windows Event Log data source configurations. - * - * @return the windowsEventLogs value. - */ - public List windowsEventLogs() { - return this.windowsEventLogs; - } - - /** - * Set the windowsEventLogs property: The list of Windows Event Log data source configurations. - * - * @param windowsEventLogs the windowsEventLogs value to set. - * @return the DataSourcesSpec object itself. - */ - public DataSourcesSpec withWindowsEventLogs(List windowsEventLogs) { - this.windowsEventLogs = windowsEventLogs; - return this; - } - - /** - * Get the syslog property: The list of Syslog data source configurations. - * - * @return the syslog value. - */ - public List syslog() { - return this.syslog; - } - - /** - * Set the syslog property: The list of Syslog data source configurations. - * - * @param syslog the syslog value to set. - * @return the DataSourcesSpec object itself. - */ - public DataSourcesSpec withSyslog(List syslog) { - this.syslog = syslog; - return this; - } - - /** - * Get the extensions property: The list of Azure VM extension data source configurations. - * - * @return the extensions value. - */ - public List extensions() { - return this.extensions; - } - - /** - * Set the extensions property: The list of Azure VM extension data source configurations. - * - * @param extensions the extensions value to set. - * @return the DataSourcesSpec object itself. - */ - public DataSourcesSpec withExtensions(List extensions) { - this.extensions = extensions; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (performanceCounters() != null) { - performanceCounters().forEach(e -> e.validate()); - } - if (windowsEventLogs() != null) { - windowsEventLogs().forEach(e -> e.validate()); - } - if (syslog() != null) { - syslog().forEach(e -> e.validate()); - } - if (extensions() != null) { - extensions().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataStatus.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataStatus.java deleted file mode 100644 index 01385836c6df..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataStatus.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for DataStatus. */ -public final class DataStatus extends ExpandableStringEnum { - /** Static value present for DataStatus. */ - public static final DataStatus PRESENT = fromString("present"); - - /** Static value notPresent for DataStatus. */ - public static final DataStatus NOT_PRESENT = fromString("notPresent"); - - /** - * Creates or finds a DataStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding DataStatus. - */ - @JsonCreator - public static DataStatus fromString(String name) { - return fromString(name, DataStatus.class); - } - - /** @return known DataStatus values. */ - public static Collection values() { - return values(DataStatus.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DayOfWeek.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DayOfWeek.java deleted file mode 100644 index 8d5848eabe68..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DayOfWeek.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.monitor.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for DayOfWeek. */ -public enum DayOfWeek { - /** Enum value Monday. */ - MONDAY("Monday"), - - /** Enum value Tuesday. */ - TUESDAY("Tuesday"), - - /** Enum value Wednesday. */ - WEDNESDAY("Wednesday"), - - /** Enum value Thursday. */ - THURSDAY("Thursday"), - - /** Enum value Friday. */ - FRIDAY("Friday"), - - /** Enum value Saturday. */ - SATURDAY("Saturday"), - - /** Enum value Sunday. */ - SUNDAY("Sunday"); - - /** The actual serialized value for a DayOfWeek instance. */ - private String value; - - DayOfWeek(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a DayOfWeek instance. - * - * @param value the serialized value to parse. - * @return the parsed DayOfWeek object, or null if unable to parse. - */ - @JsonCreator - public static DayOfWeek fromString(String value) { - DayOfWeek[] items = DayOfWeek.values(); - for (DayOfWeek item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DestinationsSpec.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DestinationsSpec.java deleted file mode 100644 index 19eed45684f3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DestinationsSpec.java +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Specification of destinations that can be used in data flows. */ -@Fluent -public class DestinationsSpec { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DestinationsSpec.class); - - /* - * List of Log Analytics destinations. - */ - @JsonProperty(value = "logAnalytics") - private List logAnalytics; - - /* - * Azure Monitor Metrics destination. - */ - @JsonProperty(value = "azureMonitorMetrics") - private DestinationsSpecAzureMonitorMetrics azureMonitorMetrics; - - /** - * Get the logAnalytics property: List of Log Analytics destinations. - * - * @return the logAnalytics value. - */ - public List logAnalytics() { - return this.logAnalytics; - } - - /** - * Set the logAnalytics property: List of Log Analytics destinations. - * - * @param logAnalytics the logAnalytics value to set. - * @return the DestinationsSpec object itself. - */ - public DestinationsSpec withLogAnalytics(List logAnalytics) { - this.logAnalytics = logAnalytics; - return this; - } - - /** - * Get the azureMonitorMetrics property: Azure Monitor Metrics destination. - * - * @return the azureMonitorMetrics value. - */ - public DestinationsSpecAzureMonitorMetrics azureMonitorMetrics() { - return this.azureMonitorMetrics; - } - - /** - * Set the azureMonitorMetrics property: Azure Monitor Metrics destination. - * - * @param azureMonitorMetrics the azureMonitorMetrics value to set. - * @return the DestinationsSpec object itself. - */ - public DestinationsSpec withAzureMonitorMetrics(DestinationsSpecAzureMonitorMetrics azureMonitorMetrics) { - this.azureMonitorMetrics = azureMonitorMetrics; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (logAnalytics() != null) { - logAnalytics().forEach(e -> e.validate()); - } - if (azureMonitorMetrics() != null) { - azureMonitorMetrics().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DestinationsSpecAzureMonitorMetrics.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DestinationsSpecAzureMonitorMetrics.java deleted file mode 100644 index bb7aac403baf..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DestinationsSpecAzureMonitorMetrics.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; - -/** Azure Monitor Metrics destination. */ -@Fluent -public final class DestinationsSpecAzureMonitorMetrics extends AzureMonitorMetricsDestination { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DestinationsSpecAzureMonitorMetrics.class); - - /** {@inheritDoc} */ - @Override - public DestinationsSpecAzureMonitorMetrics withName(String name) { - super.withName(name); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DiagnosticSetting.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DiagnosticSetting.java deleted file mode 100644 index f125641066e6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DiagnosticSetting.java +++ /dev/null @@ -1,325 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.monitor.MonitorManager; -import com.azure.resourcemanager.monitor.fluent.models.DiagnosticSettingsResourceInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasId; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasName; -import com.azure.resourcemanager.resources.fluentcore.model.Appliable; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.model.Indexable; -import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; -import com.azure.resourcemanager.resources.fluentcore.model.Updatable; -import java.time.Duration; -import java.util.List; - -/** An immutable client-side representation of an Azure diagnostic settings. */ -@Fluent -public interface DiagnosticSetting - extends Indexable, - HasId, - HasName, - HasManager, - HasInnerModel, - Refreshable, - Updatable { - /** - * Get the associated resource Id value. - * - * @return the associated resource Id value - */ - String resourceId(); - - /** - * Get the storageAccountId value. - * - * @return the storageAccountId value - */ - String storageAccountId(); - - /** - * Get the eventHubAuthorizationRuleId value. - * - * @return the eventHubAuthorizationRuleId value - */ - String eventHubAuthorizationRuleId(); - - /** - * Get the eventHubName value. - * - * @return the eventHubName value - */ - String eventHubName(); - - /** - * Get the metrics value. - * - * @return the metrics value - */ - List metrics(); - - /** - * Get the logs value. - * - * @return the logs value - */ - List logs(); - - /** - * Get the workspaceId value. - * - * @return the workspaceId value - */ - String workspaceId(); - - /** The entirety of a diagnostic settings definition. */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithDiagnosticLogRecipient, DefinitionStages.WithCreate { - } - - /** Grouping of diagnostic settings definition stages. */ - interface DefinitionStages { - /** The first stage of a diagnostic setting definition. */ - interface Blank { - /** - * Sets the resource for which Diagnostic Settings will be created. - * - * @param resourceId of the resource. - * @return the stage of selecting data recipient. - */ - WithDiagnosticLogRecipient withResource(String resourceId); - } - - /** - * The stage of the definition which contains minimum required properties to be specified for Diagnostic - * Settings creation. - */ - interface WithDiagnosticLogRecipient { - /** - * Sets Log Analytics workspace for data transfer. - * - * @param workspaceId of Log Analytics that should exist in the same region as resource. - * @return the stage of creating Diagnostic Settings. - */ - WithCreate withLogAnalytics(String workspaceId); - - /** - * Sets Storage Account for data transfer. - * - * @param storageAccountId of storage account that should exist in the same region as resource. - * @return the stage of creating Diagnostic Settings. - */ - WithCreate withStorageAccount(String storageAccountId); - - /** - * Sets EventHub Namespace Authorization Rule for data transfer. - * - * @param eventHubAuthorizationRuleId of EventHub namespace authorization rule that should exist in the same - * region as resource. - * @return the stage of creating Diagnostic Settings. - */ - WithCreate withEventHub(String eventHubAuthorizationRuleId); - - /** - * Sets EventHub Namespace Authorization Rule for data transfer. - * - * @param eventHubAuthorizationRuleId of EventHub namespace authorization rule that should exist in the same - * region as resource. - * @param eventHubName name of the EventHub. If none is specified, the default EventHub will be selected. - * @return the stage of creating Diagnostic Settings. - */ - WithCreate withEventHub(String eventHubAuthorizationRuleId, String eventHubName); - } - - /** - * The stage of the definition which contains all the minimum required inputs for the resource to be created but - * also allows for any other optional settings to be specified. - */ - interface WithCreate extends WithDiagnosticLogRecipient, Creatable { - /** - * Adds a Metric Setting to the list of Metric Settings for the current Diagnostic Settings. - * - * @param category name of a Metric category for a resource type this setting is applied to. - * @param timeGrain the timegrain of the metric in ISO8601 format. - * @param retentionDays the number of days for the retention in days. A value of 0 will retain the events - * indefinitely. - * @return the stage of creating Diagnostic Settings. - */ - WithCreate withMetric(String category, Duration timeGrain, int retentionDays); - - /** - * Adds a Log Setting to the list of Log Settings for the current Diagnostic Settings. - * - * @param category name of a Log category for a resource type this setting is applied to. - * @param retentionDays the number of days for the retention in days. A value of 0 will retain the events - * indefinitely. - * @return the stage of creating Diagnostic Settings. - */ - WithCreate withLog(String category, int retentionDays); - - /** - * Adds a Log and Metric Settings to the list Log and Metric Settings for the current Diagnostic Settings. - * - * @param categories a list of diagnostic settings category. - * @param timeGrain the timegrain of the metric in ISO8601 format for all Metrics in the {@code categories} - * list. - * @param retentionDays the number of days for the retention in days. A value of 0 will retain the events - * indefinitely. - * @return the stage of creating Diagnostic Settings. - */ - WithCreate withLogsAndMetrics( - List categories, Duration timeGrain, int retentionDays); - } - } - - /** Grouping of diagnostic setting update stages. */ - interface UpdateStages { - /** The stage of a Diagnostic Settings update allowing to modify Storage Account settings. */ - interface WithStorageAccount { - /** - * Sets Storage Account for data transfer. - * - * @param storageAccountId of storage account that should exist in the same region as resource. - * @return the next stage of the Diagnostic Settings update. - */ - Update withStorageAccount(String storageAccountId); - - /** - * Removes the Storage Account from the Diagnostic Settings. - * - * @return the next stage of the Diagnostic Settings update. - */ - Update withoutStorageAccount(); - } - - /** The stage of a Diagnostic Settings update allowing to modify EventHub settings. */ - interface WithEventHub { - /** - * Sets EventHub Namespace Authorization Rule for data transfer. - * - * @param eventHubAuthorizationRuleId of EventHub namespace authorization rule that should exist in the same - * region as resource. - * @return the next stage of the Diagnostic Settings update. - */ - Update withEventHub(String eventHubAuthorizationRuleId); - - /** - * Sets EventHub Namespace Authorization Rule for data transfer. - * - * @param eventHubAuthorizationRuleId of EventHub namespace authorization rule that should exist in the same - * region as resource. - * @param eventHubName name of the EventHub. If none is specified, the default EventHub will be selected. - * @return the next stage of the Diagnostic Settings update. - */ - Update withEventHub(String eventHubAuthorizationRuleId, String eventHubName); - - /** - * Removes the EventHub from the Diagnostic Settings. - * - * @return the next stage of the Diagnostic Settings update. - */ - Update withoutEventHub(); - } - - /** The stage of a Diagnostic Settings update allowing to modify Log Analytics settings. */ - interface WithLogAnalytics { - /** - * Sets Log Analytics workspace for data transfer. - * - * @param workspaceId of Log Analytics that should exist in the same region as resource. - * @return the next stage of the Diagnostic Settings update. - */ - Update withLogAnalytics(String workspaceId); - - /** - * Removes the Log Analytics from the Diagnostic Settings. - * - * @return the next stage of the Diagnostic Settings update. - */ - Update withoutLogAnalytics(); - } - - /** - * The stage of a Diagnostic Settings update allowing to modify metric and logs. - */ - interface WithMetricAndLogs { - /** - * Adds a Metric Setting to the list of Metric Settings for the current Diagnostic Settings. - * - * @param category name of a Metric category for a resource type this setting is applied to. - * @param timeGrain the timegrain of the metric in ISO8601 format. - * @param retentionDays the number of days for the retention in days. A value of 0 will retain the events - * indefinitely. - * @return the next stage of the Diagnostic Settings update. - */ - Update withMetric(String category, Duration timeGrain, int retentionDays); - - /** - * Adds a Log Setting to the list of Log Settings for the current Diagnostic Settings. - * - * @param category name of a Log category for a resource type this setting is applied to. - * @param retentionDays the number of days for the retention in days. A value of 0 will retain the events - * indefinitely. - * @return the next stage of the Diagnostic Settings update. - */ - Update withLog(String category, int retentionDays); - - /** - * Adds a Log and Metric Settings to the list Log and Metric Settings for the current Diagnostic Settings. - * - * @param categories a list of diagnostic settings category. - * @param timeGrain the timegrain of the metric in ISO8601 format for all Metrics in the {@code categories} - * list. - * @param retentionDays the number of days for the retention in days. A value of 0 will retain the events - * indefinitely. - * @return the next stage of the Diagnostic Settings update. - */ - Update withLogsAndMetrics( - List categories, Duration timeGrain, int retentionDays); - - /** - * Removes the Metric Setting from the Diagnostic Setting. - * - * @param category name of a Metric category to remove. - * @return the next stage of the Diagnostic Settings update. - */ - Update withoutMetric(String category); - - /** - * Removes the Log Setting from the Diagnostic Setting. - * - * @param category name of a Log category to remove. - * @return the next stage of the Diagnostic Settings update. - */ - Update withoutLog(String category); - - /** - * Removes all the Log Settings from the Diagnostic Setting. - * - * @return the next stage of the Diagnostic Settings update. - */ - Update withoutLogs(); - - /** - * Removes all the Metric Settings from the Diagnostic Setting. - * - * @return the next stage of the Diagnostic Settings update. - */ - Update withoutMetrics(); - } - } - - /** The template for an update operation, containing all the settings that can be modified. */ - interface Update - extends Appliable, - UpdateStages.WithStorageAccount, - UpdateStages.WithEventHub, - UpdateStages.WithLogAnalytics, - UpdateStages.WithMetricAndLogs { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DiagnosticSettings.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DiagnosticSettings.java deleted file mode 100644 index 0d4b0922a842..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DiagnosticSettings.java +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.monitor.MonitorManager; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsBatchDeletion; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsBatchCreation; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsCreating; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingById; -import java.util.List; -import reactor.core.publisher.Mono; - -/** Entry point for diagnostic settings management API. */ -@Fluent -public interface DiagnosticSettings - extends SupportsCreating, - SupportsBatchCreation, - SupportsGettingById, - SupportsDeletingById, - SupportsBatchDeletion, - HasManager { - - /** - * Lists all the Diagnostic Settings categories for Log and Metric Settings for a specific resource. - * - * @param resourceId of the requested resource. - * @return list of Diagnostic Settings category available for the resource. - */ - List listCategoriesByResource(String resourceId); - - /** - * Lists all the Diagnostic Settings categories for Log and Metric Settings for a specific resource. - * - * @param resourceId of the requested resource. - * @return list of Diagnostic Settings category available for the resource. - */ - PagedFlux listCategoriesByResourceAsync(String resourceId); - - /** - * Gets the information about Diagnostic Setting category for Log or Metric Setting for a specific resource. - * - * @param resourceId of the requested resource. - * @param name of the Log or Metric category. - * @return Diagnostic Setting category available for the resource. - */ - DiagnosticSettingsCategory getCategory(String resourceId, String name); - - /** - * Gets the information about Diagnostic Setting category for Log or Metric Setting for a specific resource. - * - * @param resourceId of the requested resource. - * @param name of the Log or Metric category. - * @return Diagnostic Setting category available for the resource. - */ - Mono getCategoryAsync(String resourceId, String name); - - /** - * Lists all the diagnostic settings in the currently selected subscription for a specific resource. - * - * @param resourceId that Diagnostic Setting is associated with. - * @return list of resources - */ - PagedIterable listByResource(String resourceId); - - /** - * Lists all the diagnostic settings in the currently selected subscription for a specific resource. - * - * @param resourceId that Diagnostic Setting is associated with. - * @return list of resources - */ - PagedFlux listByResourceAsync(String resourceId); - - /** - * Deletes a Diagnostic Setting from Azure, identifying it by its resourceId and name. - * - * @param resourceId that Diagnostic Setting is associated with. - * @param name the name of Diagnostic Setting. - */ - void delete(String resourceId, String name); - - /** - * Asynchronously delete a Diagnostic Setting from Azure, identifying it by its resourceId and name. - * - * @param resourceId that Diagnostic Setting is associated with. - * @param name the name of Diagnostic Setting. - * @return a representation of the deferred computation of this call - */ - Mono deleteAsync(String resourceId, String name); - - /** - * Gets the information about Diagnostic Setting from Azure based on the resource id and setting name. - * - * @param resourceId that Diagnostic Setting is associated with. - * @param name the name of Diagnostic Setting. - * @return an immutable representation of the resource - */ - DiagnosticSetting get(String resourceId, String name); - - /** - * Gets the information about Diagnostic Setting from Azure based on the resource id and setting name. - * - * @param resourceId that Diagnostic Setting is associated with. - * @param name the name of Diagnostic Setting. - * @return an immutable representation of the resource - */ - Mono getAsync(String resourceId, String name); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DiagnosticSettingsCategory.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DiagnosticSettingsCategory.java deleted file mode 100644 index 09cee712411c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DiagnosticSettingsCategory.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.resourcemanager.monitor.fluent.models.DiagnosticSettingsCategoryResourceInner; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; - -/** The Azure event log entries are of type DiagnosticSettingsCategory. */ -public interface DiagnosticSettingsCategory extends HasInnerModel { - /** - * Get the diagnostic settings category name value. - * - * @return the diagnostic settings category name - */ - String name(); - - /** - * Get the categoryType value. - * - * @return the categoryType value - */ - CategoryType type(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/Dimension.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/Dimension.java deleted file mode 100644 index 89c0d38300a9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/Dimension.java +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Specifies the criteria for converting log to metric. */ -@Fluent -public final class Dimension { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Dimension.class); - - /* - * Name of the dimension - */ - @JsonProperty(value = "name", required = true) - private String name; - - /* - * Operator for dimension values - */ - @JsonProperty(value = "operator", required = true) - private Operator operator; - - /* - * List of dimension values - */ - @JsonProperty(value = "values", required = true) - private List values; - - /** - * Get the name property: Name of the dimension. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Name of the dimension. - * - * @param name the name value to set. - * @return the Dimension object itself. - */ - public Dimension withName(String name) { - this.name = name; - return this; - } - - /** - * Get the operator property: Operator for dimension values. - * - * @return the operator value. - */ - public Operator operator() { - return this.operator; - } - - /** - * Set the operator property: Operator for dimension values. - * - * @param operator the operator value to set. - * @return the Dimension object itself. - */ - public Dimension withOperator(Operator operator) { - this.operator = operator; - return this; - } - - /** - * Get the values property: List of dimension values. - * - * @return the values value. - */ - public List values() { - return this.values; - } - - /** - * Set the values property: List of dimension values. - * - * @param values the values value to set. - * @return the Dimension object itself. - */ - public Dimension withValues(List values) { - this.values = values; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() == null) { - throw logger - .logExceptionAsError(new IllegalArgumentException("Missing required property name in model Dimension")); - } - if (operator() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property operator in model Dimension")); - } - if (values() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property values in model Dimension")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DynamicMetricCriteria.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DynamicMetricCriteria.java deleted file mode 100644 index db3a6646113a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DynamicMetricCriteria.java +++ /dev/null @@ -1,206 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.time.OffsetDateTime; -import java.util.List; - -/** Criterion for dynamic threshold. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "criterionType") -@JsonTypeName("DynamicThresholdCriterion") -@Fluent -public final class DynamicMetricCriteria extends MultiMetricCriteria { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DynamicMetricCriteria.class); - - /* - * The operator used to compare the metric value against the threshold. - */ - @JsonProperty(value = "operator", required = true) - private DynamicThresholdOperator operator; - - /* - * The extent of deviation required to trigger an alert. This will affect - * how tight the threshold is to the metric series pattern. - */ - @JsonProperty(value = "alertSensitivity", required = true) - private DynamicThresholdSensitivity alertSensitivity; - - /* - * The minimum number of violations required within the selected lookback - * time window required to raise an alert. - */ - @JsonProperty(value = "failingPeriods", required = true) - private DynamicThresholdFailingPeriods failingPeriods; - - /* - * Use this option to set the date from which to start learning the metric - * historical data and calculate the dynamic thresholds (in ISO8601 format) - */ - @JsonProperty(value = "ignoreDataBefore") - private OffsetDateTime ignoreDataBefore; - - /** - * Get the operator property: The operator used to compare the metric value against the threshold. - * - * @return the operator value. - */ - public DynamicThresholdOperator operator() { - return this.operator; - } - - /** - * Set the operator property: The operator used to compare the metric value against the threshold. - * - * @param operator the operator value to set. - * @return the DynamicMetricCriteria object itself. - */ - public DynamicMetricCriteria withOperator(DynamicThresholdOperator operator) { - this.operator = operator; - return this; - } - - /** - * Get the alertSensitivity property: The extent of deviation required to trigger an alert. This will affect how - * tight the threshold is to the metric series pattern. - * - * @return the alertSensitivity value. - */ - public DynamicThresholdSensitivity alertSensitivity() { - return this.alertSensitivity; - } - - /** - * Set the alertSensitivity property: The extent of deviation required to trigger an alert. This will affect how - * tight the threshold is to the metric series pattern. - * - * @param alertSensitivity the alertSensitivity value to set. - * @return the DynamicMetricCriteria object itself. - */ - public DynamicMetricCriteria withAlertSensitivity(DynamicThresholdSensitivity alertSensitivity) { - this.alertSensitivity = alertSensitivity; - return this; - } - - /** - * Get the failingPeriods property: The minimum number of violations required within the selected lookback time - * window required to raise an alert. - * - * @return the failingPeriods value. - */ - public DynamicThresholdFailingPeriods failingPeriods() { - return this.failingPeriods; - } - - /** - * Set the failingPeriods property: The minimum number of violations required within the selected lookback time - * window required to raise an alert. - * - * @param failingPeriods the failingPeriods value to set. - * @return the DynamicMetricCriteria object itself. - */ - public DynamicMetricCriteria withFailingPeriods(DynamicThresholdFailingPeriods failingPeriods) { - this.failingPeriods = failingPeriods; - return this; - } - - /** - * Get the ignoreDataBefore property: Use this option to set the date from which to start learning the metric - * historical data and calculate the dynamic thresholds (in ISO8601 format). - * - * @return the ignoreDataBefore value. - */ - public OffsetDateTime ignoreDataBefore() { - return this.ignoreDataBefore; - } - - /** - * Set the ignoreDataBefore property: Use this option to set the date from which to start learning the metric - * historical data and calculate the dynamic thresholds (in ISO8601 format). - * - * @param ignoreDataBefore the ignoreDataBefore value to set. - * @return the DynamicMetricCriteria object itself. - */ - public DynamicMetricCriteria withIgnoreDataBefore(OffsetDateTime ignoreDataBefore) { - this.ignoreDataBefore = ignoreDataBefore; - return this; - } - - /** {@inheritDoc} */ - @Override - public DynamicMetricCriteria withName(String name) { - super.withName(name); - return this; - } - - /** {@inheritDoc} */ - @Override - public DynamicMetricCriteria withMetricName(String metricName) { - super.withMetricName(metricName); - return this; - } - - /** {@inheritDoc} */ - @Override - public DynamicMetricCriteria withMetricNamespace(String metricNamespace) { - super.withMetricNamespace(metricNamespace); - return this; - } - - /** {@inheritDoc} */ - @Override - public DynamicMetricCriteria withTimeAggregation(AggregationTypeEnum timeAggregation) { - super.withTimeAggregation(timeAggregation); - return this; - } - - /** {@inheritDoc} */ - @Override - public DynamicMetricCriteria withDimensions(List dimensions) { - super.withDimensions(dimensions); - return this; - } - - /** {@inheritDoc} */ - @Override - public DynamicMetricCriteria withSkipMetricValidation(Boolean skipMetricValidation) { - super.withSkipMetricValidation(skipMetricValidation); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (operator() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property operator in model DynamicMetricCriteria")); - } - if (alertSensitivity() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property alertSensitivity in model DynamicMetricCriteria")); - } - if (failingPeriods() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property failingPeriods in model DynamicMetricCriteria")); - } else { - failingPeriods().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DynamicThresholdFailingPeriods.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DynamicThresholdFailingPeriods.java deleted file mode 100644 index 77f064359e6c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DynamicThresholdFailingPeriods.java +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The minimum number of violations required within the selected lookback time window required to raise an alert. */ -@Fluent -public final class DynamicThresholdFailingPeriods { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DynamicThresholdFailingPeriods.class); - - /* - * The number of aggregated lookback points. The lookback time window is - * calculated based on the aggregation granularity (windowSize) and the - * selected number of aggregated points. - */ - @JsonProperty(value = "numberOfEvaluationPeriods", required = true) - private float numberOfEvaluationPeriods; - - /* - * The number of violations to trigger an alert. Should be smaller or equal - * to numberOfEvaluationPeriods. - */ - @JsonProperty(value = "minFailingPeriodsToAlert", required = true) - private float minFailingPeriodsToAlert; - - /** - * Get the numberOfEvaluationPeriods property: The number of aggregated lookback points. The lookback time window is - * calculated based on the aggregation granularity (windowSize) and the selected number of aggregated points. - * - * @return the numberOfEvaluationPeriods value. - */ - public float numberOfEvaluationPeriods() { - return this.numberOfEvaluationPeriods; - } - - /** - * Set the numberOfEvaluationPeriods property: The number of aggregated lookback points. The lookback time window is - * calculated based on the aggregation granularity (windowSize) and the selected number of aggregated points. - * - * @param numberOfEvaluationPeriods the numberOfEvaluationPeriods value to set. - * @return the DynamicThresholdFailingPeriods object itself. - */ - public DynamicThresholdFailingPeriods withNumberOfEvaluationPeriods(float numberOfEvaluationPeriods) { - this.numberOfEvaluationPeriods = numberOfEvaluationPeriods; - return this; - } - - /** - * Get the minFailingPeriodsToAlert property: The number of violations to trigger an alert. Should be smaller or - * equal to numberOfEvaluationPeriods. - * - * @return the minFailingPeriodsToAlert value. - */ - public float minFailingPeriodsToAlert() { - return this.minFailingPeriodsToAlert; - } - - /** - * Set the minFailingPeriodsToAlert property: The number of violations to trigger an alert. Should be smaller or - * equal to numberOfEvaluationPeriods. - * - * @param minFailingPeriodsToAlert the minFailingPeriodsToAlert value to set. - * @return the DynamicThresholdFailingPeriods object itself. - */ - public DynamicThresholdFailingPeriods withMinFailingPeriodsToAlert(float minFailingPeriodsToAlert) { - this.minFailingPeriodsToAlert = minFailingPeriodsToAlert; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DynamicThresholdOperator.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DynamicThresholdOperator.java deleted file mode 100644 index e25e28a1b025..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DynamicThresholdOperator.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for DynamicThresholdOperator. */ -public final class DynamicThresholdOperator extends ExpandableStringEnum { - /** Static value GreaterThan for DynamicThresholdOperator. */ - public static final DynamicThresholdOperator GREATER_THAN = fromString("GreaterThan"); - - /** Static value LessThan for DynamicThresholdOperator. */ - public static final DynamicThresholdOperator LESS_THAN = fromString("LessThan"); - - /** Static value GreaterOrLessThan for DynamicThresholdOperator. */ - public static final DynamicThresholdOperator GREATER_OR_LESS_THAN = fromString("GreaterOrLessThan"); - - /** - * Creates or finds a DynamicThresholdOperator from its string representation. - * - * @param name a name to look for. - * @return the corresponding DynamicThresholdOperator. - */ - @JsonCreator - public static DynamicThresholdOperator fromString(String name) { - return fromString(name, DynamicThresholdOperator.class); - } - - /** @return known DynamicThresholdOperator values. */ - public static Collection values() { - return values(DynamicThresholdOperator.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DynamicThresholdSensitivity.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DynamicThresholdSensitivity.java deleted file mode 100644 index 5d428bb37153..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DynamicThresholdSensitivity.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for DynamicThresholdSensitivity. */ -public final class DynamicThresholdSensitivity extends ExpandableStringEnum { - /** Static value Low for DynamicThresholdSensitivity. */ - public static final DynamicThresholdSensitivity LOW = fromString("Low"); - - /** Static value Medium for DynamicThresholdSensitivity. */ - public static final DynamicThresholdSensitivity MEDIUM = fromString("Medium"); - - /** Static value High for DynamicThresholdSensitivity. */ - public static final DynamicThresholdSensitivity HIGH = fromString("High"); - - /** - * Creates or finds a DynamicThresholdSensitivity from its string representation. - * - * @param name a name to look for. - * @return the corresponding DynamicThresholdSensitivity. - */ - @JsonCreator - public static DynamicThresholdSensitivity fromString(String name) { - return fromString(name, DynamicThresholdSensitivity.class); - } - - /** @return known DynamicThresholdSensitivity values. */ - public static Collection values() { - return values(DynamicThresholdSensitivity.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/EmailNotification.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/EmailNotification.java deleted file mode 100644 index 13961448ee5c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/EmailNotification.java +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Email notification of an autoscale event. */ -@Fluent -public final class EmailNotification { - @JsonIgnore private final ClientLogger logger = new ClientLogger(EmailNotification.class); - - /* - * a value indicating whether to send email to subscription administrator. - */ - @JsonProperty(value = "sendToSubscriptionAdministrator") - private Boolean sendToSubscriptionAdministrator; - - /* - * a value indicating whether to send email to subscription - * co-administrators. - */ - @JsonProperty(value = "sendToSubscriptionCoAdministrators") - private Boolean sendToSubscriptionCoAdministrators; - - /* - * the custom e-mails list. This value can be null or empty, in which case - * this attribute will be ignored. - */ - @JsonProperty(value = "customEmails") - private List customEmails; - - /** - * Get the sendToSubscriptionAdministrator property: a value indicating whether to send email to subscription - * administrator. - * - * @return the sendToSubscriptionAdministrator value. - */ - public Boolean sendToSubscriptionAdministrator() { - return this.sendToSubscriptionAdministrator; - } - - /** - * Set the sendToSubscriptionAdministrator property: a value indicating whether to send email to subscription - * administrator. - * - * @param sendToSubscriptionAdministrator the sendToSubscriptionAdministrator value to set. - * @return the EmailNotification object itself. - */ - public EmailNotification withSendToSubscriptionAdministrator(Boolean sendToSubscriptionAdministrator) { - this.sendToSubscriptionAdministrator = sendToSubscriptionAdministrator; - return this; - } - - /** - * Get the sendToSubscriptionCoAdministrators property: a value indicating whether to send email to subscription - * co-administrators. - * - * @return the sendToSubscriptionCoAdministrators value. - */ - public Boolean sendToSubscriptionCoAdministrators() { - return this.sendToSubscriptionCoAdministrators; - } - - /** - * Set the sendToSubscriptionCoAdministrators property: a value indicating whether to send email to subscription - * co-administrators. - * - * @param sendToSubscriptionCoAdministrators the sendToSubscriptionCoAdministrators value to set. - * @return the EmailNotification object itself. - */ - public EmailNotification withSendToSubscriptionCoAdministrators(Boolean sendToSubscriptionCoAdministrators) { - this.sendToSubscriptionCoAdministrators = sendToSubscriptionCoAdministrators; - return this; - } - - /** - * Get the customEmails property: the custom e-mails list. This value can be null or empty, in which case this - * attribute will be ignored. - * - * @return the customEmails value. - */ - public List customEmails() { - return this.customEmails; - } - - /** - * Set the customEmails property: the custom e-mails list. This value can be null or empty, in which case this - * attribute will be ignored. - * - * @param customEmails the customEmails value to set. - * @return the EmailNotification object itself. - */ - public EmailNotification withCustomEmails(List customEmails) { - this.customEmails = customEmails; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/EmailReceiver.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/EmailReceiver.java deleted file mode 100644 index c691b77fdaf0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/EmailReceiver.java +++ /dev/null @@ -1,130 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** An email receiver. */ -@Fluent -public final class EmailReceiver { - @JsonIgnore private final ClientLogger logger = new ClientLogger(EmailReceiver.class); - - /* - * The name of the email receiver. Names must be unique across all - * receivers within an action group. - */ - @JsonProperty(value = "name", required = true) - private String name; - - /* - * The email address of this receiver. - */ - @JsonProperty(value = "emailAddress", required = true) - private String emailAddress; - - /* - * Indicates whether to use common alert schema. - */ - @JsonProperty(value = "useCommonAlertSchema") - private Boolean useCommonAlertSchema; - - /* - * The receiver status of the e-mail. - */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) - private ReceiverStatus status; - - /** - * Get the name property: The name of the email receiver. Names must be unique across all receivers within an action - * group. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the email receiver. Names must be unique across all receivers within an action - * group. - * - * @param name the name value to set. - * @return the EmailReceiver object itself. - */ - public EmailReceiver withName(String name) { - this.name = name; - return this; - } - - /** - * Get the emailAddress property: The email address of this receiver. - * - * @return the emailAddress value. - */ - public String emailAddress() { - return this.emailAddress; - } - - /** - * Set the emailAddress property: The email address of this receiver. - * - * @param emailAddress the emailAddress value to set. - * @return the EmailReceiver object itself. - */ - public EmailReceiver withEmailAddress(String emailAddress) { - this.emailAddress = emailAddress; - return this; - } - - /** - * Get the useCommonAlertSchema property: Indicates whether to use common alert schema. - * - * @return the useCommonAlertSchema value. - */ - public Boolean useCommonAlertSchema() { - return this.useCommonAlertSchema; - } - - /** - * Set the useCommonAlertSchema property: Indicates whether to use common alert schema. - * - * @param useCommonAlertSchema the useCommonAlertSchema value to set. - * @return the EmailReceiver object itself. - */ - public EmailReceiver withUseCommonAlertSchema(Boolean useCommonAlertSchema) { - this.useCommonAlertSchema = useCommonAlertSchema; - return this; - } - - /** - * Get the status property: The receiver status of the e-mail. - * - * @return the status value. - */ - public ReceiverStatus status() { - return this.status; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property name in model EmailReceiver")); - } - if (emailAddress() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property emailAddress in model EmailReceiver")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/EnableRequest.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/EnableRequest.java deleted file mode 100644 index 2d74448eb896..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/EnableRequest.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describes a receiver that should be resubscribed. */ -@Fluent -public final class EnableRequest { - @JsonIgnore private final ClientLogger logger = new ClientLogger(EnableRequest.class); - - /* - * The name of the receiver to resubscribe. - */ - @JsonProperty(value = "receiverName", required = true) - private String receiverName; - - /** - * Get the receiverName property: The name of the receiver to resubscribe. - * - * @return the receiverName value. - */ - public String receiverName() { - return this.receiverName; - } - - /** - * Set the receiverName property: The name of the receiver to resubscribe. - * - * @param receiverName the receiverName value to set. - * @return the EnableRequest object itself. - */ - public EnableRequest withReceiverName(String receiverName) { - this.receiverName = receiverName; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (receiverName() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property receiverName in model EnableRequest")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/Enabled.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/Enabled.java deleted file mode 100644 index 9e0713606b5e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/Enabled.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for Enabled. */ -public final class Enabled extends ExpandableStringEnum { - /** Static value true for Enabled. */ - public static final Enabled TRUE = fromString("true"); - - /** Static value false for Enabled. */ - public static final Enabled FALSE = fromString("false"); - - /** - * Creates or finds a Enabled from its string representation. - * - * @param name a name to look for. - * @return the corresponding Enabled. - */ - @JsonCreator - public static Enabled fromString(String name) { - return fromString(name, Enabled.class); - } - - /** @return known Enabled values. */ - public static Collection values() { - return values(Enabled.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ErrorResponseCommon.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ErrorResponseCommon.java deleted file mode 100644 index e75ad7b28924..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ErrorResponseCommon.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.exception.ManagementError; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The resource management error response. */ -@Immutable -public final class ErrorResponseCommon extends ManagementError { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ErrorResponseCommon.class); - - /* - * The error details. - */ - @JsonProperty(value = "details", access = JsonProperty.Access.WRITE_ONLY) - private List details; - - /** - * Get the details property: The error details. - * - * @return the details value. - */ - public List getDetails() { - return this.details; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (getDetails() != null) { - getDetails().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/EventCategoryCollection.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/EventCategoryCollection.java deleted file mode 100644 index f68838901afc..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/EventCategoryCollection.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.fluent.models.LocalizableStringInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** - * A collection of event categories. Currently possible values are: Administrative, Security, ServiceHealth, Alert, - * Recommendation, Policy. - */ -@Fluent -public final class EventCategoryCollection { - @JsonIgnore private final ClientLogger logger = new ClientLogger(EventCategoryCollection.class); - - /* - * the list that includes the Azure event categories. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /** - * Get the value property: the list that includes the Azure event categories. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: the list that includes the Azure event categories. - * - * @param value the value value to set. - * @return the EventCategoryCollection object itself. - */ - public EventCategoryCollection withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model EventCategoryCollection")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/EventData.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/EventData.java deleted file mode 100644 index 32be6d498c7f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/EventData.java +++ /dev/null @@ -1,181 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.resourcemanager.monitor.fluent.models.EventDataInner; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import java.time.OffsetDateTime; -import java.util.Map; - -/** The Azure event log entries are of type EventData. */ -public interface EventData extends HasInnerModel { - - /** - * Get the authorization value. - * - * @return the authorization value - */ - SenderAuthorization authorization(); - - /** - * Get the claims value. - * - * @return the claims value - */ - Map claims(); - - /** - * Get the caller value. - * - * @return the caller value - */ - String caller(); - - /** - * Get the description value. - * - * @return the description value - */ - String description(); - - /** - * Get the id value. - * - * @return the id value - */ - String id(); - - /** - * Get the eventDataId value. - * - * @return the eventDataId value - */ - String eventDataId(); - - /** - * Get the correlationId value. - * - * @return the correlationId value - */ - String correlationId(); - - /** - * Get the eventName value. - * - * @return the eventName value - */ - LocalizableString eventName(); - - /** - * Get the category value. - * - * @return the category value - */ - LocalizableString category(); - - /** - * Get the httpRequest value. - * - * @return the httpRequest value - */ - HttpRequestInfo httpRequest(); - - /** - * Get the level value. - * - * @return the level value - */ - EventLevel level(); - - /** - * Get the resourceGroupName value. - * - * @return the resourceGroupName value - */ - String resourceGroupName(); - - /** - * Get the resourceProviderName value. - * - * @return the resourceProviderName value - */ - LocalizableString resourceProviderName(); - - /** - * Get the resourceId value. - * - * @return the resourceId value - */ - String resourceId(); - - /** - * Get the resourceType value. - * - * @return the resourceType value - */ - LocalizableString resourceType(); - - /** - * Get the operationId value. - * - * @return the operationId value - */ - String operationId(); - - /** - * Get the operationName value. - * - * @return the operationName value - */ - LocalizableString operationName(); - - /** - * Get the properties value. - * - * @return the properties value - */ - Map properties(); - - /** - * Get the status value. - * - * @return the status value - */ - LocalizableString status(); - - /** - * Get the subStatus value. - * - * @return the subStatus value - */ - LocalizableString subStatus(); - - /** - * Get the eventTimestamp value. - * - * @return the eventTimestamp value - */ - OffsetDateTime eventTimestamp(); - - /** - * Get the submissionTimestamp value. - * - * @return the submissionTimestamp value - */ - OffsetDateTime submissionTimestamp(); - - /** - * Get the subscriptionId value. - * - * @return the subscriptionId value - */ - String subscriptionId(); - - /** - * Get the tenantId value. - * - * @return the tenantId value - */ - String tenantId(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/EventDataCollection.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/EventDataCollection.java deleted file mode 100644 index 0e26d24c83cf..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/EventDataCollection.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.fluent.models.EventDataInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Represents collection of events. */ -@Fluent -public final class EventDataCollection { - @JsonIgnore private final ClientLogger logger = new ClientLogger(EventDataCollection.class); - - /* - * this list that includes the Azure audit logs. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * Provides the link to retrieve the next set of events. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: this list that includes the Azure audit logs. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: this list that includes the Azure audit logs. - * - * @param value the value value to set. - * @return the EventDataCollection object itself. - */ - public EventDataCollection withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Provides the link to retrieve the next set of events. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: Provides the link to retrieve the next set of events. - * - * @param nextLink the nextLink value to set. - * @return the EventDataCollection object itself. - */ - public EventDataCollection withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model EventDataCollection")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/EventDataPropertyName.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/EventDataPropertyName.java deleted file mode 100644 index 3e0f33a90d0b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/EventDataPropertyName.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for EventDataPropertyName. */ -public final class EventDataPropertyName extends ExpandableStringEnum { - /** Static value "authorization" for EventDataPropertyName. */ - public static final EventDataPropertyName AUTHORIZATION = fromString("authorization"); - - /** Static value "claims" for EventDataPropertyName. */ - public static final EventDataPropertyName CLAIMS = fromString("claims"); - - /** Static value "correlationId" for EventDataPropertyName. */ - public static final EventDataPropertyName CORRELATIONID = fromString("correlationId"); - - /** Static value "description" for EventDataPropertyName. */ - public static final EventDataPropertyName DESCRIPTION = fromString("description"); - - /** Static value "eventDataId" for EventDataPropertyName. */ - public static final EventDataPropertyName EVENTDATAID = fromString("eventDataId"); - - /** Static value "eventName" for EventDataPropertyName. */ - public static final EventDataPropertyName EVENTNAME = fromString("eventName"); - - /** Static value "eventTimestamp" for EventDataPropertyName. */ - public static final EventDataPropertyName EVENTTIMESTAMP = fromString("eventTimestamp"); - - /** Static value "httpRequest" for EventDataPropertyName. */ - public static final EventDataPropertyName HTTPREQUEST = fromString("httpRequest"); - - /** Static value "level" for EventDataPropertyName. */ - public static final EventDataPropertyName LEVEL = fromString("level"); - - /** Static value "operationId" for EventDataPropertyName. */ - public static final EventDataPropertyName OPERATIONID = fromString("operationId"); - - /** Static value "operationName" for EventDataPropertyName. */ - public static final EventDataPropertyName OPERATIONNAME = fromString("operationName"); - - /** Static value "properties" for EventDataPropertyName. */ - public static final EventDataPropertyName PROPERTIES = fromString("properties"); - - /** Static value "resourceGroupName" for EventDataPropertyName. */ - public static final EventDataPropertyName RESOURCEGROUPNAME = fromString("resourceGroupName"); - - /** Static value "resourceProviderName" for EventDataPropertyName. */ - public static final EventDataPropertyName RESOURCEPROVIDERNAME = fromString("resourceProviderName"); - - /** Static value "resourceId" for EventDataPropertyName. */ - public static final EventDataPropertyName RESOURCEID = fromString("resourceId"); - - /** Static value "status" for EventDataPropertyName. */ - public static final EventDataPropertyName STATUS = fromString("status"); - - /** Static value "submissionTimestamp" for EventDataPropertyName. */ - public static final EventDataPropertyName SUBMISSIONTIMESTAMP = fromString("submissionTimestamp"); - - /** Static value "subStatus" for EventDataPropertyName. */ - public static final EventDataPropertyName SUBSTATUS = fromString("subStatus"); - - /** Static value "subscriptionId" for EventDataPropertyName. */ - public static final EventDataPropertyName SUBSCRIPTIONID = fromString("subscriptionId"); - - /** - * Creates or finds a EventDataPropertyName from its string representation. - * - * @param name a name to look for - * @return the corresponding WebhookAction - */ - @JsonCreator - public static EventDataPropertyName fromString(String name) { - return fromString(name, EventDataPropertyName.class); - } - - /** @return known WebhookAction values */ - public static Collection values() { - return values(EventDataPropertyName.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/EventLevel.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/EventLevel.java deleted file mode 100644 index 600a4515b24b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/EventLevel.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for EventLevel. */ -public enum EventLevel { - /** Enum value Critical. */ - CRITICAL("Critical"), - - /** Enum value Error. */ - ERROR("Error"), - - /** Enum value Warning. */ - WARNING("Warning"), - - /** Enum value Informational. */ - INFORMATIONAL("Informational"), - - /** Enum value Verbose. */ - VERBOSE("Verbose"); - - /** The actual serialized value for a EventLevel instance. */ - private final String value; - - EventLevel(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a EventLevel instance. - * - * @param value the serialized value to parse. - * @return the parsed EventLevel object, or null if unable to parse. - */ - @JsonCreator - public static EventLevel fromString(String value) { - EventLevel[] items = EventLevel.values(); - for (EventLevel item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ExtensionDataSource.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ExtensionDataSource.java deleted file mode 100644 index caee0d87cc40..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ExtensionDataSource.java +++ /dev/null @@ -1,172 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** - * Definition of which data will be collected from a separate VM extension that integrates with the Azure Monitor Agent. - * Collected from either Windows and Linux machines, depending on which extension is defined. - */ -@Fluent -public final class ExtensionDataSource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ExtensionDataSource.class); - - /* - * List of streams that this data source will be sent to. - * A stream indicates what schema will be used for this data and usually - * what table in Log Analytics the data will be sent to. - */ - @JsonProperty(value = "streams") - private List streams; - - /* - * The name of the VM extension. - */ - @JsonProperty(value = "extensionName", required = true) - private String extensionName; - - /* - * The extension settings. The format is specific for particular extension. - */ - @JsonProperty(value = "extensionSettings") - private Object extensionSettings; - - /* - * The list of data sources this extension needs data from. - */ - @JsonProperty(value = "inputDataSources") - private List inputDataSources; - - /* - * A friendly name for the data source. - * This name should be unique across all data sources (regardless of type) - * within the data collection rule. - */ - @JsonProperty(value = "name") - private String name; - - /** - * Get the streams property: List of streams that this data source will be sent to. A stream indicates what schema - * will be used for this data and usually what table in Log Analytics the data will be sent to. - * - * @return the streams value. - */ - public List streams() { - return this.streams; - } - - /** - * Set the streams property: List of streams that this data source will be sent to. A stream indicates what schema - * will be used for this data and usually what table in Log Analytics the data will be sent to. - * - * @param streams the streams value to set. - * @return the ExtensionDataSource object itself. - */ - public ExtensionDataSource withStreams(List streams) { - this.streams = streams; - return this; - } - - /** - * Get the extensionName property: The name of the VM extension. - * - * @return the extensionName value. - */ - public String extensionName() { - return this.extensionName; - } - - /** - * Set the extensionName property: The name of the VM extension. - * - * @param extensionName the extensionName value to set. - * @return the ExtensionDataSource object itself. - */ - public ExtensionDataSource withExtensionName(String extensionName) { - this.extensionName = extensionName; - return this; - } - - /** - * Get the extensionSettings property: The extension settings. The format is specific for particular extension. - * - * @return the extensionSettings value. - */ - public Object extensionSettings() { - return this.extensionSettings; - } - - /** - * Set the extensionSettings property: The extension settings. The format is specific for particular extension. - * - * @param extensionSettings the extensionSettings value to set. - * @return the ExtensionDataSource object itself. - */ - public ExtensionDataSource withExtensionSettings(Object extensionSettings) { - this.extensionSettings = extensionSettings; - return this; - } - - /** - * Get the inputDataSources property: The list of data sources this extension needs data from. - * - * @return the inputDataSources value. - */ - public List inputDataSources() { - return this.inputDataSources; - } - - /** - * Set the inputDataSources property: The list of data sources this extension needs data from. - * - * @param inputDataSources the inputDataSources value to set. - * @return the ExtensionDataSource object itself. - */ - public ExtensionDataSource withInputDataSources(List inputDataSources) { - this.inputDataSources = inputDataSources; - return this; - } - - /** - * Get the name property: A friendly name for the data source. This name should be unique across all data sources - * (regardless of type) within the data collection rule. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: A friendly name for the data source. This name should be unique across all data sources - * (regardless of type) within the data collection rule. - * - * @param name the name value to set. - * @return the ExtensionDataSource object itself. - */ - public ExtensionDataSource withName(String name) { - this.name = name; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (extensionName() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property extensionName in model ExtensionDataSource")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/HttpRequestInfo.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/HttpRequestInfo.java deleted file mode 100644 index c812675033c3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/HttpRequestInfo.java +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The Http request info. */ -@Fluent -public final class HttpRequestInfo { - @JsonIgnore private final ClientLogger logger = new ClientLogger(HttpRequestInfo.class); - - /* - * the client request id. - */ - @JsonProperty(value = "clientRequestId") - private String clientRequestId; - - /* - * the client Ip Address - */ - @JsonProperty(value = "clientIpAddress") - private String clientIpAddress; - - /* - * the Http request method. - */ - @JsonProperty(value = "method") - private String method; - - /* - * the Uri. - */ - @JsonProperty(value = "uri") - private String uri; - - /** - * Get the clientRequestId property: the client request id. - * - * @return the clientRequestId value. - */ - public String clientRequestId() { - return this.clientRequestId; - } - - /** - * Set the clientRequestId property: the client request id. - * - * @param clientRequestId the clientRequestId value to set. - * @return the HttpRequestInfo object itself. - */ - public HttpRequestInfo withClientRequestId(String clientRequestId) { - this.clientRequestId = clientRequestId; - return this; - } - - /** - * Get the clientIpAddress property: the client Ip Address. - * - * @return the clientIpAddress value. - */ - public String clientIpAddress() { - return this.clientIpAddress; - } - - /** - * Set the clientIpAddress property: the client Ip Address. - * - * @param clientIpAddress the clientIpAddress value to set. - * @return the HttpRequestInfo object itself. - */ - public HttpRequestInfo withClientIpAddress(String clientIpAddress) { - this.clientIpAddress = clientIpAddress; - return this; - } - - /** - * Get the method property: the Http request method. - * - * @return the method value. - */ - public String method() { - return this.method; - } - - /** - * Set the method property: the Http request method. - * - * @param method the method value to set. - * @return the HttpRequestInfo object itself. - */ - public HttpRequestInfo withMethod(String method) { - this.method = method; - return this; - } - - /** - * Get the uri property: the Uri. - * - * @return the uri value. - */ - public String uri() { - return this.uri; - } - - /** - * Set the uri property: the Uri. - * - * @param uri the uri value to set. - * @return the HttpRequestInfo object itself. - */ - public HttpRequestInfo withUri(String uri) { - this.uri = uri; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/IncidentListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/IncidentListResult.java deleted file mode 100644 index 83a59130c7d3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/IncidentListResult.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.fluent.models.IncidentInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The List incidents operation response. */ -@Fluent -public final class IncidentListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(IncidentListResult.class); - - /* - * the incident collection. - */ - @JsonProperty(value = "value") - private List value; - - /** - * Get the value property: the incident collection. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: the incident collection. - * - * @param value the value value to set. - * @return the IncidentListResult object itself. - */ - public IncidentListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ItsmReceiver.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ItsmReceiver.java deleted file mode 100644 index d9e12d6964fe..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ItsmReceiver.java +++ /dev/null @@ -1,192 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** An Itsm receiver. */ -@Fluent -public final class ItsmReceiver { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ItsmReceiver.class); - - /* - * The name of the Itsm receiver. Names must be unique across all receivers - * within an action group. - */ - @JsonProperty(value = "name", required = true) - private String name; - - /* - * OMS LA instance identifier. - */ - @JsonProperty(value = "workspaceId", required = true) - private String workspaceId; - - /* - * Unique identification of ITSM connection among multiple defined in above - * workspace. - */ - @JsonProperty(value = "connectionId", required = true) - private String connectionId; - - /* - * JSON blob for the configurations of the ITSM action. - * CreateMultipleWorkItems option will be part of this blob as well. - */ - @JsonProperty(value = "ticketConfiguration", required = true) - private String ticketConfiguration; - - /* - * Region in which workspace resides. Supported - * values:'centralindia','japaneast','southeastasia','australiasoutheast','uksouth','westcentralus','canadacentral','eastus','westeurope' - */ - @JsonProperty(value = "region", required = true) - private String region; - - /** - * Get the name property: The name of the Itsm receiver. Names must be unique across all receivers within an action - * group. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the Itsm receiver. Names must be unique across all receivers within an action - * group. - * - * @param name the name value to set. - * @return the ItsmReceiver object itself. - */ - public ItsmReceiver withName(String name) { - this.name = name; - return this; - } - - /** - * Get the workspaceId property: OMS LA instance identifier. - * - * @return the workspaceId value. - */ - public String workspaceId() { - return this.workspaceId; - } - - /** - * Set the workspaceId property: OMS LA instance identifier. - * - * @param workspaceId the workspaceId value to set. - * @return the ItsmReceiver object itself. - */ - public ItsmReceiver withWorkspaceId(String workspaceId) { - this.workspaceId = workspaceId; - return this; - } - - /** - * Get the connectionId property: Unique identification of ITSM connection among multiple defined in above - * workspace. - * - * @return the connectionId value. - */ - public String connectionId() { - return this.connectionId; - } - - /** - * Set the connectionId property: Unique identification of ITSM connection among multiple defined in above - * workspace. - * - * @param connectionId the connectionId value to set. - * @return the ItsmReceiver object itself. - */ - public ItsmReceiver withConnectionId(String connectionId) { - this.connectionId = connectionId; - return this; - } - - /** - * Get the ticketConfiguration property: JSON blob for the configurations of the ITSM action. - * CreateMultipleWorkItems option will be part of this blob as well. - * - * @return the ticketConfiguration value. - */ - public String ticketConfiguration() { - return this.ticketConfiguration; - } - - /** - * Set the ticketConfiguration property: JSON blob for the configurations of the ITSM action. - * CreateMultipleWorkItems option will be part of this blob as well. - * - * @param ticketConfiguration the ticketConfiguration value to set. - * @return the ItsmReceiver object itself. - */ - public ItsmReceiver withTicketConfiguration(String ticketConfiguration) { - this.ticketConfiguration = ticketConfiguration; - return this; - } - - /** - * Get the region property: Region in which workspace resides. Supported - * values:'centralindia','japaneast','southeastasia','australiasoutheast','uksouth','westcentralus','canadacentral','eastus','westeurope'. - * - * @return the region value. - */ - public String region() { - return this.region; - } - - /** - * Set the region property: Region in which workspace resides. Supported - * values:'centralindia','japaneast','southeastasia','australiasoutheast','uksouth','westcentralus','canadacentral','eastus','westeurope'. - * - * @param region the region value to set. - * @return the ItsmReceiver object itself. - */ - public ItsmReceiver withRegion(String region) { - this.region = region; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property name in model ItsmReceiver")); - } - if (workspaceId() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property workspaceId in model ItsmReceiver")); - } - if (connectionId() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property connectionId in model ItsmReceiver")); - } - if (ticketConfiguration() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property ticketConfiguration in model ItsmReceiver")); - } - if (region() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property region in model ItsmReceiver")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownDataCollectionEndpointProvisioningState.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownDataCollectionEndpointProvisioningState.java deleted file mode 100644 index 0e11d941b265..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownDataCollectionEndpointProvisioningState.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for KnownDataCollectionEndpointProvisioningState. */ -public final class KnownDataCollectionEndpointProvisioningState - extends ExpandableStringEnum { - /** Static value Creating for KnownDataCollectionEndpointProvisioningState. */ - public static final KnownDataCollectionEndpointProvisioningState CREATING = fromString("Creating"); - - /** Static value Updating for KnownDataCollectionEndpointProvisioningState. */ - public static final KnownDataCollectionEndpointProvisioningState UPDATING = fromString("Updating"); - - /** Static value Deleting for KnownDataCollectionEndpointProvisioningState. */ - public static final KnownDataCollectionEndpointProvisioningState DELETING = fromString("Deleting"); - - /** Static value Succeeded for KnownDataCollectionEndpointProvisioningState. */ - public static final KnownDataCollectionEndpointProvisioningState SUCCEEDED = fromString("Succeeded"); - - /** Static value Failed for KnownDataCollectionEndpointProvisioningState. */ - public static final KnownDataCollectionEndpointProvisioningState FAILED = fromString("Failed"); - - /** - * Creates or finds a KnownDataCollectionEndpointProvisioningState from its string representation. - * - * @param name a name to look for. - * @return the corresponding KnownDataCollectionEndpointProvisioningState. - */ - @JsonCreator - public static KnownDataCollectionEndpointProvisioningState fromString(String name) { - return fromString(name, KnownDataCollectionEndpointProvisioningState.class); - } - - /** @return known KnownDataCollectionEndpointProvisioningState values. */ - public static Collection values() { - return values(KnownDataCollectionEndpointProvisioningState.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownDataCollectionEndpointResourceKind.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownDataCollectionEndpointResourceKind.java deleted file mode 100644 index ed7fc419c182..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownDataCollectionEndpointResourceKind.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for KnownDataCollectionEndpointResourceKind. */ -public final class KnownDataCollectionEndpointResourceKind - extends ExpandableStringEnum { - /** Static value Linux for KnownDataCollectionEndpointResourceKind. */ - public static final KnownDataCollectionEndpointResourceKind LINUX = fromString("Linux"); - - /** Static value Windows for KnownDataCollectionEndpointResourceKind. */ - public static final KnownDataCollectionEndpointResourceKind WINDOWS = fromString("Windows"); - - /** - * Creates or finds a KnownDataCollectionEndpointResourceKind from its string representation. - * - * @param name a name to look for. - * @return the corresponding KnownDataCollectionEndpointResourceKind. - */ - @JsonCreator - public static KnownDataCollectionEndpointResourceKind fromString(String name) { - return fromString(name, KnownDataCollectionEndpointResourceKind.class); - } - - /** @return known KnownDataCollectionEndpointResourceKind values. */ - public static Collection values() { - return values(KnownDataCollectionEndpointResourceKind.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownDataCollectionRuleAssociationProvisioningState.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownDataCollectionRuleAssociationProvisioningState.java deleted file mode 100644 index d1469e7f611a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownDataCollectionRuleAssociationProvisioningState.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for KnownDataCollectionRuleAssociationProvisioningState. */ -public final class KnownDataCollectionRuleAssociationProvisioningState - extends ExpandableStringEnum { - /** Static value Creating for KnownDataCollectionRuleAssociationProvisioningState. */ - public static final KnownDataCollectionRuleAssociationProvisioningState CREATING = fromString("Creating"); - - /** Static value Updating for KnownDataCollectionRuleAssociationProvisioningState. */ - public static final KnownDataCollectionRuleAssociationProvisioningState UPDATING = fromString("Updating"); - - /** Static value Deleting for KnownDataCollectionRuleAssociationProvisioningState. */ - public static final KnownDataCollectionRuleAssociationProvisioningState DELETING = fromString("Deleting"); - - /** Static value Succeeded for KnownDataCollectionRuleAssociationProvisioningState. */ - public static final KnownDataCollectionRuleAssociationProvisioningState SUCCEEDED = fromString("Succeeded"); - - /** Static value Failed for KnownDataCollectionRuleAssociationProvisioningState. */ - public static final KnownDataCollectionRuleAssociationProvisioningState FAILED = fromString("Failed"); - - /** - * Creates or finds a KnownDataCollectionRuleAssociationProvisioningState from its string representation. - * - * @param name a name to look for. - * @return the corresponding KnownDataCollectionRuleAssociationProvisioningState. - */ - @JsonCreator - public static KnownDataCollectionRuleAssociationProvisioningState fromString(String name) { - return fromString(name, KnownDataCollectionRuleAssociationProvisioningState.class); - } - - /** @return known KnownDataCollectionRuleAssociationProvisioningState values. */ - public static Collection values() { - return values(KnownDataCollectionRuleAssociationProvisioningState.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownDataCollectionRuleProvisioningState.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownDataCollectionRuleProvisioningState.java deleted file mode 100644 index 21be2d6ee3d6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownDataCollectionRuleProvisioningState.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for KnownDataCollectionRuleProvisioningState. */ -public final class KnownDataCollectionRuleProvisioningState - extends ExpandableStringEnum { - /** Static value Creating for KnownDataCollectionRuleProvisioningState. */ - public static final KnownDataCollectionRuleProvisioningState CREATING = fromString("Creating"); - - /** Static value Updating for KnownDataCollectionRuleProvisioningState. */ - public static final KnownDataCollectionRuleProvisioningState UPDATING = fromString("Updating"); - - /** Static value Deleting for KnownDataCollectionRuleProvisioningState. */ - public static final KnownDataCollectionRuleProvisioningState DELETING = fromString("Deleting"); - - /** Static value Succeeded for KnownDataCollectionRuleProvisioningState. */ - public static final KnownDataCollectionRuleProvisioningState SUCCEEDED = fromString("Succeeded"); - - /** Static value Failed for KnownDataCollectionRuleProvisioningState. */ - public static final KnownDataCollectionRuleProvisioningState FAILED = fromString("Failed"); - - /** - * Creates or finds a KnownDataCollectionRuleProvisioningState from its string representation. - * - * @param name a name to look for. - * @return the corresponding KnownDataCollectionRuleProvisioningState. - */ - @JsonCreator - public static KnownDataCollectionRuleProvisioningState fromString(String name) { - return fromString(name, KnownDataCollectionRuleProvisioningState.class); - } - - /** @return known KnownDataCollectionRuleProvisioningState values. */ - public static Collection values() { - return values(KnownDataCollectionRuleProvisioningState.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownDataCollectionRuleResourceKind.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownDataCollectionRuleResourceKind.java deleted file mode 100644 index 6705536553d7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownDataCollectionRuleResourceKind.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for KnownDataCollectionRuleResourceKind. */ -public final class KnownDataCollectionRuleResourceKind - extends ExpandableStringEnum { - /** Static value Linux for KnownDataCollectionRuleResourceKind. */ - public static final KnownDataCollectionRuleResourceKind LINUX = fromString("Linux"); - - /** Static value Windows for KnownDataCollectionRuleResourceKind. */ - public static final KnownDataCollectionRuleResourceKind WINDOWS = fromString("Windows"); - - /** - * Creates or finds a KnownDataCollectionRuleResourceKind from its string representation. - * - * @param name a name to look for. - * @return the corresponding KnownDataCollectionRuleResourceKind. - */ - @JsonCreator - public static KnownDataCollectionRuleResourceKind fromString(String name) { - return fromString(name, KnownDataCollectionRuleResourceKind.class); - } - - /** @return known KnownDataCollectionRuleResourceKind values. */ - public static Collection values() { - return values(KnownDataCollectionRuleResourceKind.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownDataFlowStreams.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownDataFlowStreams.java deleted file mode 100644 index 7fa554d102b0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownDataFlowStreams.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for KnownDataFlowStreams. */ -public final class KnownDataFlowStreams extends ExpandableStringEnum { - /** Static value Microsoft-Event for KnownDataFlowStreams. */ - public static final KnownDataFlowStreams MICROSOFT_EVENT = fromString("Microsoft-Event"); - - /** Static value Microsoft-InsightsMetrics for KnownDataFlowStreams. */ - public static final KnownDataFlowStreams MICROSOFT_INSIGHTS_METRICS = fromString("Microsoft-InsightsMetrics"); - - /** Static value Microsoft-Perf for KnownDataFlowStreams. */ - public static final KnownDataFlowStreams MICROSOFT_PERF = fromString("Microsoft-Perf"); - - /** Static value Microsoft-Syslog for KnownDataFlowStreams. */ - public static final KnownDataFlowStreams MICROSOFT_SYSLOG = fromString("Microsoft-Syslog"); - - /** Static value Microsoft-WindowsEvent for KnownDataFlowStreams. */ - public static final KnownDataFlowStreams MICROSOFT_WINDOWS_EVENT = fromString("Microsoft-WindowsEvent"); - - /** - * Creates or finds a KnownDataFlowStreams from its string representation. - * - * @param name a name to look for. - * @return the corresponding KnownDataFlowStreams. - */ - @JsonCreator - public static KnownDataFlowStreams fromString(String name) { - return fromString(name, KnownDataFlowStreams.class); - } - - /** @return known KnownDataFlowStreams values. */ - public static Collection values() { - return values(KnownDataFlowStreams.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownExtensionDataSourceStreams.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownExtensionDataSourceStreams.java deleted file mode 100644 index e87b1058021c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownExtensionDataSourceStreams.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for KnownExtensionDataSourceStreams. */ -public final class KnownExtensionDataSourceStreams extends ExpandableStringEnum { - /** Static value Microsoft-Event for KnownExtensionDataSourceStreams. */ - public static final KnownExtensionDataSourceStreams MICROSOFT_EVENT = fromString("Microsoft-Event"); - - /** Static value Microsoft-InsightsMetrics for KnownExtensionDataSourceStreams. */ - public static final KnownExtensionDataSourceStreams MICROSOFT_INSIGHTS_METRICS = - fromString("Microsoft-InsightsMetrics"); - - /** Static value Microsoft-Perf for KnownExtensionDataSourceStreams. */ - public static final KnownExtensionDataSourceStreams MICROSOFT_PERF = fromString("Microsoft-Perf"); - - /** Static value Microsoft-Syslog for KnownExtensionDataSourceStreams. */ - public static final KnownExtensionDataSourceStreams MICROSOFT_SYSLOG = fromString("Microsoft-Syslog"); - - /** Static value Microsoft-WindowsEvent for KnownExtensionDataSourceStreams. */ - public static final KnownExtensionDataSourceStreams MICROSOFT_WINDOWS_EVENT = fromString("Microsoft-WindowsEvent"); - - /** - * Creates or finds a KnownExtensionDataSourceStreams from its string representation. - * - * @param name a name to look for. - * @return the corresponding KnownExtensionDataSourceStreams. - */ - @JsonCreator - public static KnownExtensionDataSourceStreams fromString(String name) { - return fromString(name, KnownExtensionDataSourceStreams.class); - } - - /** @return known KnownExtensionDataSourceStreams values. */ - public static Collection values() { - return values(KnownExtensionDataSourceStreams.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownPerfCounterDataSourceStreams.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownPerfCounterDataSourceStreams.java deleted file mode 100644 index 4b6037156d63..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownPerfCounterDataSourceStreams.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for KnownPerfCounterDataSourceStreams. */ -public final class KnownPerfCounterDataSourceStreams extends ExpandableStringEnum { - /** Static value Microsoft-Perf for KnownPerfCounterDataSourceStreams. */ - public static final KnownPerfCounterDataSourceStreams MICROSOFT_PERF = fromString("Microsoft-Perf"); - - /** Static value Microsoft-InsightsMetrics for KnownPerfCounterDataSourceStreams. */ - public static final KnownPerfCounterDataSourceStreams MICROSOFT_INSIGHTS_METRICS = - fromString("Microsoft-InsightsMetrics"); - - /** - * Creates or finds a KnownPerfCounterDataSourceStreams from its string representation. - * - * @param name a name to look for. - * @return the corresponding KnownPerfCounterDataSourceStreams. - */ - @JsonCreator - public static KnownPerfCounterDataSourceStreams fromString(String name) { - return fromString(name, KnownPerfCounterDataSourceStreams.class); - } - - /** @return known KnownPerfCounterDataSourceStreams values. */ - public static Collection values() { - return values(KnownPerfCounterDataSourceStreams.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownPublicNetworkAccessOptions.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownPublicNetworkAccessOptions.java deleted file mode 100644 index 40f19718e471..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownPublicNetworkAccessOptions.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for KnownPublicNetworkAccessOptions. */ -public final class KnownPublicNetworkAccessOptions extends ExpandableStringEnum { - /** Static value Enabled for KnownPublicNetworkAccessOptions. */ - public static final KnownPublicNetworkAccessOptions ENABLED = fromString("Enabled"); - - /** Static value Disabled for KnownPublicNetworkAccessOptions. */ - public static final KnownPublicNetworkAccessOptions DISABLED = fromString("Disabled"); - - /** - * Creates or finds a KnownPublicNetworkAccessOptions from its string representation. - * - * @param name a name to look for. - * @return the corresponding KnownPublicNetworkAccessOptions. - */ - @JsonCreator - public static KnownPublicNetworkAccessOptions fromString(String name) { - return fromString(name, KnownPublicNetworkAccessOptions.class); - } - - /** @return known KnownPublicNetworkAccessOptions values. */ - public static Collection values() { - return values(KnownPublicNetworkAccessOptions.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownSyslogDataSourceFacilityNames.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownSyslogDataSourceFacilityNames.java deleted file mode 100644 index a5dbb3617a1f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownSyslogDataSourceFacilityNames.java +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for KnownSyslogDataSourceFacilityNames. */ -public final class KnownSyslogDataSourceFacilityNames extends ExpandableStringEnum { - /** Static value auth for KnownSyslogDataSourceFacilityNames. */ - public static final KnownSyslogDataSourceFacilityNames AUTH = fromString("auth"); - - /** Static value authpriv for KnownSyslogDataSourceFacilityNames. */ - public static final KnownSyslogDataSourceFacilityNames AUTHPRIV = fromString("authpriv"); - - /** Static value cron for KnownSyslogDataSourceFacilityNames. */ - public static final KnownSyslogDataSourceFacilityNames CRON = fromString("cron"); - - /** Static value daemon for KnownSyslogDataSourceFacilityNames. */ - public static final KnownSyslogDataSourceFacilityNames DAEMON = fromString("daemon"); - - /** Static value kern for KnownSyslogDataSourceFacilityNames. */ - public static final KnownSyslogDataSourceFacilityNames KERN = fromString("kern"); - - /** Static value lpr for KnownSyslogDataSourceFacilityNames. */ - public static final KnownSyslogDataSourceFacilityNames LPR = fromString("lpr"); - - /** Static value mail for KnownSyslogDataSourceFacilityNames. */ - public static final KnownSyslogDataSourceFacilityNames MAIL = fromString("mail"); - - /** Static value mark for KnownSyslogDataSourceFacilityNames. */ - public static final KnownSyslogDataSourceFacilityNames MARK = fromString("mark"); - - /** Static value news for KnownSyslogDataSourceFacilityNames. */ - public static final KnownSyslogDataSourceFacilityNames NEWS = fromString("news"); - - /** Static value syslog for KnownSyslogDataSourceFacilityNames. */ - public static final KnownSyslogDataSourceFacilityNames SYSLOG = fromString("syslog"); - - /** Static value user for KnownSyslogDataSourceFacilityNames. */ - public static final KnownSyslogDataSourceFacilityNames USER = fromString("user"); - - /** Static value uucp for KnownSyslogDataSourceFacilityNames. */ - public static final KnownSyslogDataSourceFacilityNames UUCP = fromString("uucp"); - - /** Static value local0 for KnownSyslogDataSourceFacilityNames. */ - public static final KnownSyslogDataSourceFacilityNames LOCAL0 = fromString("local0"); - - /** Static value local1 for KnownSyslogDataSourceFacilityNames. */ - public static final KnownSyslogDataSourceFacilityNames LOCAL1 = fromString("local1"); - - /** Static value local2 for KnownSyslogDataSourceFacilityNames. */ - public static final KnownSyslogDataSourceFacilityNames LOCAL2 = fromString("local2"); - - /** Static value local3 for KnownSyslogDataSourceFacilityNames. */ - public static final KnownSyslogDataSourceFacilityNames LOCAL3 = fromString("local3"); - - /** Static value local4 for KnownSyslogDataSourceFacilityNames. */ - public static final KnownSyslogDataSourceFacilityNames LOCAL4 = fromString("local4"); - - /** Static value local5 for KnownSyslogDataSourceFacilityNames. */ - public static final KnownSyslogDataSourceFacilityNames LOCAL5 = fromString("local5"); - - /** Static value local6 for KnownSyslogDataSourceFacilityNames. */ - public static final KnownSyslogDataSourceFacilityNames LOCAL6 = fromString("local6"); - - /** Static value local7 for KnownSyslogDataSourceFacilityNames. */ - public static final KnownSyslogDataSourceFacilityNames LOCAL7 = fromString("local7"); - - /** Static value * for KnownSyslogDataSourceFacilityNames. */ - public static final KnownSyslogDataSourceFacilityNames ASTERISK = fromString("*"); - - /** - * Creates or finds a KnownSyslogDataSourceFacilityNames from its string representation. - * - * @param name a name to look for. - * @return the corresponding KnownSyslogDataSourceFacilityNames. - */ - @JsonCreator - public static KnownSyslogDataSourceFacilityNames fromString(String name) { - return fromString(name, KnownSyslogDataSourceFacilityNames.class); - } - - /** @return known KnownSyslogDataSourceFacilityNames values. */ - public static Collection values() { - return values(KnownSyslogDataSourceFacilityNames.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownSyslogDataSourceLogLevels.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownSyslogDataSourceLogLevels.java deleted file mode 100644 index 3bd3950850fa..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownSyslogDataSourceLogLevels.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for KnownSyslogDataSourceLogLevels. */ -public final class KnownSyslogDataSourceLogLevels extends ExpandableStringEnum { - /** Static value Debug for KnownSyslogDataSourceLogLevels. */ - public static final KnownSyslogDataSourceLogLevels DEBUG = fromString("Debug"); - - /** Static value Info for KnownSyslogDataSourceLogLevels. */ - public static final KnownSyslogDataSourceLogLevels INFO = fromString("Info"); - - /** Static value Notice for KnownSyslogDataSourceLogLevels. */ - public static final KnownSyslogDataSourceLogLevels NOTICE = fromString("Notice"); - - /** Static value Warning for KnownSyslogDataSourceLogLevels. */ - public static final KnownSyslogDataSourceLogLevels WARNING = fromString("Warning"); - - /** Static value Error for KnownSyslogDataSourceLogLevels. */ - public static final KnownSyslogDataSourceLogLevels ERROR = fromString("Error"); - - /** Static value Critical for KnownSyslogDataSourceLogLevels. */ - public static final KnownSyslogDataSourceLogLevels CRITICAL = fromString("Critical"); - - /** Static value Alert for KnownSyslogDataSourceLogLevels. */ - public static final KnownSyslogDataSourceLogLevels ALERT = fromString("Alert"); - - /** Static value Emergency for KnownSyslogDataSourceLogLevels. */ - public static final KnownSyslogDataSourceLogLevels EMERGENCY = fromString("Emergency"); - - /** Static value * for KnownSyslogDataSourceLogLevels. */ - public static final KnownSyslogDataSourceLogLevels ASTERISK = fromString("*"); - - /** - * Creates or finds a KnownSyslogDataSourceLogLevels from its string representation. - * - * @param name a name to look for. - * @return the corresponding KnownSyslogDataSourceLogLevels. - */ - @JsonCreator - public static KnownSyslogDataSourceLogLevels fromString(String name) { - return fromString(name, KnownSyslogDataSourceLogLevels.class); - } - - /** @return known KnownSyslogDataSourceLogLevels values. */ - public static Collection values() { - return values(KnownSyslogDataSourceLogLevels.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownSyslogDataSourceStreams.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownSyslogDataSourceStreams.java deleted file mode 100644 index 8b71ec284aaa..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownSyslogDataSourceStreams.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for KnownSyslogDataSourceStreams. */ -public final class KnownSyslogDataSourceStreams extends ExpandableStringEnum { - /** Static value Microsoft-Syslog for KnownSyslogDataSourceStreams. */ - public static final KnownSyslogDataSourceStreams MICROSOFT_SYSLOG = fromString("Microsoft-Syslog"); - - /** - * Creates or finds a KnownSyslogDataSourceStreams from its string representation. - * - * @param name a name to look for. - * @return the corresponding KnownSyslogDataSourceStreams. - */ - @JsonCreator - public static KnownSyslogDataSourceStreams fromString(String name) { - return fromString(name, KnownSyslogDataSourceStreams.class); - } - - /** @return known KnownSyslogDataSourceStreams values. */ - public static Collection values() { - return values(KnownSyslogDataSourceStreams.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownWindowsEventLogDataSourceStreams.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownWindowsEventLogDataSourceStreams.java deleted file mode 100644 index 6b6bd146a411..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownWindowsEventLogDataSourceStreams.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for KnownWindowsEventLogDataSourceStreams. */ -public final class KnownWindowsEventLogDataSourceStreams - extends ExpandableStringEnum { - /** Static value Microsoft-WindowsEvent for KnownWindowsEventLogDataSourceStreams. */ - public static final KnownWindowsEventLogDataSourceStreams MICROSOFT_WINDOWS_EVENT = - fromString("Microsoft-WindowsEvent"); - - /** Static value Microsoft-Event for KnownWindowsEventLogDataSourceStreams. */ - public static final KnownWindowsEventLogDataSourceStreams MICROSOFT_EVENT = fromString("Microsoft-Event"); - - /** - * Creates or finds a KnownWindowsEventLogDataSourceStreams from its string representation. - * - * @param name a name to look for. - * @return the corresponding KnownWindowsEventLogDataSourceStreams. - */ - @JsonCreator - public static KnownWindowsEventLogDataSourceStreams fromString(String name) { - return fromString(name, KnownWindowsEventLogDataSourceStreams.class); - } - - /** @return known KnownWindowsEventLogDataSourceStreams values. */ - public static Collection values() { - return values(KnownWindowsEventLogDataSourceStreams.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/LocalizableString.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/LocalizableString.java deleted file mode 100644 index 7e07bb00505f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/LocalizableString.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.resourcemanager.monitor.fluent.models.LocalizableStringInner; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; - -/** The localizable string class. */ -public interface LocalizableString extends HasInnerModel { - /** - * Get the value value. - * - * @return the value value - */ - String value(); - - /** - * Get the localizedValue value. - * - * @return the localizedValue value - */ - String localizedValue(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/LocationThresholdRuleCondition.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/LocationThresholdRuleCondition.java deleted file mode 100644 index e25a8b84457e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/LocationThresholdRuleCondition.java +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.time.Duration; - -/** A rule condition based on a certain number of locations failing. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "odata\\.type") -@JsonTypeName("Microsoft.Azure.Management.Insights.Models.LocationThresholdRuleCondition") -@JsonFlatten -@Fluent -public class LocationThresholdRuleCondition extends RuleCondition { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LocationThresholdRuleCondition.class); - - /* - * the period of time (in ISO 8601 duration format) that is used to monitor - * alert activity based on the threshold. If specified then it must be - * between 5 minutes and 1 day. - */ - @JsonProperty(value = "windowSize") - private Duration windowSize; - - /* - * the number of locations that must fail to activate the alert. - */ - @JsonProperty(value = "failedLocationCount", required = true) - private int failedLocationCount; - - /** - * Get the windowSize property: the period of time (in ISO 8601 duration format) that is used to monitor alert - * activity based on the threshold. If specified then it must be between 5 minutes and 1 day. - * - * @return the windowSize value. - */ - public Duration windowSize() { - return this.windowSize; - } - - /** - * Set the windowSize property: the period of time (in ISO 8601 duration format) that is used to monitor alert - * activity based on the threshold. If specified then it must be between 5 minutes and 1 day. - * - * @param windowSize the windowSize value to set. - * @return the LocationThresholdRuleCondition object itself. - */ - public LocationThresholdRuleCondition withWindowSize(Duration windowSize) { - this.windowSize = windowSize; - return this; - } - - /** - * Get the failedLocationCount property: the number of locations that must fail to activate the alert. - * - * @return the failedLocationCount value. - */ - public int failedLocationCount() { - return this.failedLocationCount; - } - - /** - * Set the failedLocationCount property: the number of locations that must fail to activate the alert. - * - * @param failedLocationCount the failedLocationCount value to set. - * @return the LocationThresholdRuleCondition object itself. - */ - public LocationThresholdRuleCondition withFailedLocationCount(int failedLocationCount) { - this.failedLocationCount = failedLocationCount; - return this; - } - - /** {@inheritDoc} */ - @Override - public LocationThresholdRuleCondition withDataSource(RuleDataSource dataSource) { - super.withDataSource(dataSource); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/LogAnalyticsDestination.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/LogAnalyticsDestination.java deleted file mode 100644 index 39efe95bb74a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/LogAnalyticsDestination.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Log Analytics destination. */ -@Fluent -public final class LogAnalyticsDestination { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LogAnalyticsDestination.class); - - /* - * The resource ID of the Log Analytics workspace. - */ - @JsonProperty(value = "workspaceResourceId") - private String workspaceResourceId; - - /* - * The Customer ID of the Log Analytics workspace. - */ - @JsonProperty(value = "workspaceId", access = JsonProperty.Access.WRITE_ONLY) - private String workspaceId; - - /* - * A friendly name for the destination. - * This name should be unique across all destinations (regardless of type) - * within the data collection rule. - */ - @JsonProperty(value = "name") - private String name; - - /** - * Get the workspaceResourceId property: The resource ID of the Log Analytics workspace. - * - * @return the workspaceResourceId value. - */ - public String workspaceResourceId() { - return this.workspaceResourceId; - } - - /** - * Set the workspaceResourceId property: The resource ID of the Log Analytics workspace. - * - * @param workspaceResourceId the workspaceResourceId value to set. - * @return the LogAnalyticsDestination object itself. - */ - public LogAnalyticsDestination withWorkspaceResourceId(String workspaceResourceId) { - this.workspaceResourceId = workspaceResourceId; - return this; - } - - /** - * Get the workspaceId property: The Customer ID of the Log Analytics workspace. - * - * @return the workspaceId value. - */ - public String workspaceId() { - return this.workspaceId; - } - - /** - * Get the name property: A friendly name for the destination. This name should be unique across all destinations - * (regardless of type) within the data collection rule. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: A friendly name for the destination. This name should be unique across all destinations - * (regardless of type) within the data collection rule. - * - * @param name the name value to set. - * @return the LogAnalyticsDestination object itself. - */ - public LogAnalyticsDestination withName(String name) { - this.name = name; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/LogMetricTrigger.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/LogMetricTrigger.java deleted file mode 100644 index e0231b53c50c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/LogMetricTrigger.java +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** A log metrics trigger descriptor. */ -@Fluent -public final class LogMetricTrigger { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LogMetricTrigger.class); - - /* - * Evaluation operation for Metric -'GreaterThan' or 'LessThan' or 'Equal'. - */ - @JsonProperty(value = "thresholdOperator") - private ConditionalOperator thresholdOperator; - - /* - * The threshold of the metric trigger. - */ - @JsonProperty(value = "threshold") - private Double threshold; - - /* - * Metric Trigger Type - 'Consecutive' or 'Total' - */ - @JsonProperty(value = "metricTriggerType") - private MetricTriggerType metricTriggerType; - - /* - * Evaluation of metric on a particular column - */ - @JsonProperty(value = "metricColumn") - private String metricColumn; - - /** - * Get the thresholdOperator property: Evaluation operation for Metric -'GreaterThan' or 'LessThan' or 'Equal'. - * - * @return the thresholdOperator value. - */ - public ConditionalOperator thresholdOperator() { - return this.thresholdOperator; - } - - /** - * Set the thresholdOperator property: Evaluation operation for Metric -'GreaterThan' or 'LessThan' or 'Equal'. - * - * @param thresholdOperator the thresholdOperator value to set. - * @return the LogMetricTrigger object itself. - */ - public LogMetricTrigger withThresholdOperator(ConditionalOperator thresholdOperator) { - this.thresholdOperator = thresholdOperator; - return this; - } - - /** - * Get the threshold property: The threshold of the metric trigger. - * - * @return the threshold value. - */ - public Double threshold() { - return this.threshold; - } - - /** - * Set the threshold property: The threshold of the metric trigger. - * - * @param threshold the threshold value to set. - * @return the LogMetricTrigger object itself. - */ - public LogMetricTrigger withThreshold(Double threshold) { - this.threshold = threshold; - return this; - } - - /** - * Get the metricTriggerType property: Metric Trigger Type - 'Consecutive' or 'Total'. - * - * @return the metricTriggerType value. - */ - public MetricTriggerType metricTriggerType() { - return this.metricTriggerType; - } - - /** - * Set the metricTriggerType property: Metric Trigger Type - 'Consecutive' or 'Total'. - * - * @param metricTriggerType the metricTriggerType value to set. - * @return the LogMetricTrigger object itself. - */ - public LogMetricTrigger withMetricTriggerType(MetricTriggerType metricTriggerType) { - this.metricTriggerType = metricTriggerType; - return this; - } - - /** - * Get the metricColumn property: Evaluation of metric on a particular column. - * - * @return the metricColumn value. - */ - public String metricColumn() { - return this.metricColumn; - } - - /** - * Set the metricColumn property: Evaluation of metric on a particular column. - * - * @param metricColumn the metricColumn value to set. - * @return the LogMetricTrigger object itself. - */ - public LogMetricTrigger withMetricColumn(String metricColumn) { - this.metricColumn = metricColumn; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/LogProfileCollection.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/LogProfileCollection.java deleted file mode 100644 index 4a08f74b2c0b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/LogProfileCollection.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.fluent.models.LogProfileResourceInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Represents a collection of log profiles. */ -@Fluent -public final class LogProfileCollection { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LogProfileCollection.class); - - /* - * the values of the log profiles. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /** - * Get the value property: the values of the log profiles. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: the values of the log profiles. - * - * @param value the value value to set. - * @return the LogProfileCollection object itself. - */ - public LogProfileCollection withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model LogProfileCollection")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/LogProfileResourcePatch.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/LogProfileResourcePatch.java deleted file mode 100644 index 80eb6159da46..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/LogProfileResourcePatch.java +++ /dev/null @@ -1,205 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** The log profile resource for patch operations. */ -@JsonFlatten -@Fluent -public class LogProfileResourcePatch { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LogProfileResourcePatch.class); - - /* - * Resource tags - */ - @JsonProperty(value = "tags") - private Map tags; - - /* - * the resource id of the storage account to which you would like to send - * the Activity Log. - */ - @JsonProperty(value = "properties.storageAccountId") - private String storageAccountId; - - /* - * The service bus rule ID of the service bus namespace in which you would - * like to have Event Hubs created for streaming the Activity Log. The rule - * ID is of the format: '{service bus resource ID}/authorizationrules/{key - * name}'. - */ - @JsonProperty(value = "properties.serviceBusRuleId") - private String serviceBusRuleId; - - /* - * List of regions for which Activity Log events should be stored or - * streamed. It is a comma separated list of valid ARM locations including - * the 'global' location. - */ - @JsonProperty(value = "properties.locations") - private List locations; - - /* - * the categories of the logs. These categories are created as is - * convenient to the user. Some values are: 'Write', 'Delete', and/or - * 'Action.' - */ - @JsonProperty(value = "properties.categories") - private List categories; - - /* - * the retention policy for the events in the log. - */ - @JsonProperty(value = "properties.retentionPolicy") - private RetentionPolicy retentionPolicy; - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Resource tags. - * - * @param tags the tags value to set. - * @return the LogProfileResourcePatch object itself. - */ - public LogProfileResourcePatch withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Get the storageAccountId property: the resource id of the storage account to which you would like to send the - * Activity Log. - * - * @return the storageAccountId value. - */ - public String storageAccountId() { - return this.storageAccountId; - } - - /** - * Set the storageAccountId property: the resource id of the storage account to which you would like to send the - * Activity Log. - * - * @param storageAccountId the storageAccountId value to set. - * @return the LogProfileResourcePatch object itself. - */ - public LogProfileResourcePatch withStorageAccountId(String storageAccountId) { - this.storageAccountId = storageAccountId; - return this; - } - - /** - * Get the serviceBusRuleId property: The service bus rule ID of the service bus namespace in which you would like - * to have Event Hubs created for streaming the Activity Log. The rule ID is of the format: '{service bus resource - * ID}/authorizationrules/{key name}'. - * - * @return the serviceBusRuleId value. - */ - public String serviceBusRuleId() { - return this.serviceBusRuleId; - } - - /** - * Set the serviceBusRuleId property: The service bus rule ID of the service bus namespace in which you would like - * to have Event Hubs created for streaming the Activity Log. The rule ID is of the format: '{service bus resource - * ID}/authorizationrules/{key name}'. - * - * @param serviceBusRuleId the serviceBusRuleId value to set. - * @return the LogProfileResourcePatch object itself. - */ - public LogProfileResourcePatch withServiceBusRuleId(String serviceBusRuleId) { - this.serviceBusRuleId = serviceBusRuleId; - return this; - } - - /** - * Get the locations property: List of regions for which Activity Log events should be stored or streamed. It is a - * comma separated list of valid ARM locations including the 'global' location. - * - * @return the locations value. - */ - public List locations() { - return this.locations; - } - - /** - * Set the locations property: List of regions for which Activity Log events should be stored or streamed. It is a - * comma separated list of valid ARM locations including the 'global' location. - * - * @param locations the locations value to set. - * @return the LogProfileResourcePatch object itself. - */ - public LogProfileResourcePatch withLocations(List locations) { - this.locations = locations; - return this; - } - - /** - * Get the categories property: the categories of the logs. These categories are created as is convenient to the - * user. Some values are: 'Write', 'Delete', and/or 'Action.'. - * - * @return the categories value. - */ - public List categories() { - return this.categories; - } - - /** - * Set the categories property: the categories of the logs. These categories are created as is convenient to the - * user. Some values are: 'Write', 'Delete', and/or 'Action.'. - * - * @param categories the categories value to set. - * @return the LogProfileResourcePatch object itself. - */ - public LogProfileResourcePatch withCategories(List categories) { - this.categories = categories; - return this; - } - - /** - * Get the retentionPolicy property: the retention policy for the events in the log. - * - * @return the retentionPolicy value. - */ - public RetentionPolicy retentionPolicy() { - return this.retentionPolicy; - } - - /** - * Set the retentionPolicy property: the retention policy for the events in the log. - * - * @param retentionPolicy the retentionPolicy value to set. - * @return the LogProfileResourcePatch object itself. - */ - public LogProfileResourcePatch withRetentionPolicy(RetentionPolicy retentionPolicy) { - this.retentionPolicy = retentionPolicy; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (retentionPolicy() != null) { - retentionPolicy().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/LogSearchRuleResourceCollection.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/LogSearchRuleResourceCollection.java deleted file mode 100644 index dbdfa28a4083..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/LogSearchRuleResourceCollection.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.fluent.models.LogSearchRuleResourceInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Represents a collection of Log Search rule resources. */ -@Fluent -public final class LogSearchRuleResourceCollection { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LogSearchRuleResourceCollection.class); - - /* - * The values for the Log Search Rule resources. - */ - @JsonProperty(value = "value") - private List value; - - /** - * Get the value property: The values for the Log Search Rule resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The values for the Log Search Rule resources. - * - * @param value the value value to set. - * @return the LogSearchRuleResourceCollection object itself. - */ - public LogSearchRuleResourceCollection withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/LogSearchRuleResourcePatch.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/LogSearchRuleResourcePatch.java deleted file mode 100644 index b66c8c2023eb..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/LogSearchRuleResourcePatch.java +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** The log search rule resource for patch operations. */ -@JsonFlatten -@Fluent -public class LogSearchRuleResourcePatch { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LogSearchRuleResourcePatch.class); - - /* - * Resource tags - */ - @JsonProperty(value = "tags") - private Map tags; - - /* - * The flag which indicates whether the Log Search rule is enabled. Value - * should be true or false - */ - @JsonProperty(value = "properties.enabled") - private Enabled enabled; - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Resource tags. - * - * @param tags the tags value to set. - * @return the LogSearchRuleResourcePatch object itself. - */ - public LogSearchRuleResourcePatch withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Get the enabled property: The flag which indicates whether the Log Search rule is enabled. Value should be true - * or false. - * - * @return the enabled value. - */ - public Enabled enabled() { - return this.enabled; - } - - /** - * Set the enabled property: The flag which indicates whether the Log Search rule is enabled. Value should be true - * or false. - * - * @param enabled the enabled value to set. - * @return the LogSearchRuleResourcePatch object itself. - */ - public LogSearchRuleResourcePatch withEnabled(Enabled enabled) { - this.enabled = enabled; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/LogSettings.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/LogSettings.java deleted file mode 100644 index b5db3ff81565..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/LogSettings.java +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Part of MultiTenantDiagnosticSettings. Specifies the settings for a particular log. */ -@Fluent -public final class LogSettings { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LogSettings.class); - - /* - * Name of a Diagnostic Log category for a resource type this setting is - * applied to. To obtain the list of Diagnostic Log categories for a - * resource, first perform a GET diagnostic settings operation. - */ - @JsonProperty(value = "category") - private String category; - - /* - * a value indicating whether this log is enabled. - */ - @JsonProperty(value = "enabled", required = true) - private boolean enabled; - - /* - * the retention policy for this log. - */ - @JsonProperty(value = "retentionPolicy") - private RetentionPolicy retentionPolicy; - - /** - * Get the category property: Name of a Diagnostic Log category for a resource type this setting is applied to. To - * obtain the list of Diagnostic Log categories for a resource, first perform a GET diagnostic settings operation. - * - * @return the category value. - */ - public String category() { - return this.category; - } - - /** - * Set the category property: Name of a Diagnostic Log category for a resource type this setting is applied to. To - * obtain the list of Diagnostic Log categories for a resource, first perform a GET diagnostic settings operation. - * - * @param category the category value to set. - * @return the LogSettings object itself. - */ - public LogSettings withCategory(String category) { - this.category = category; - return this; - } - - /** - * Get the enabled property: a value indicating whether this log is enabled. - * - * @return the enabled value. - */ - public boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: a value indicating whether this log is enabled. - * - * @param enabled the enabled value to set. - * @return the LogSettings object itself. - */ - public LogSettings withEnabled(boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the retentionPolicy property: the retention policy for this log. - * - * @return the retentionPolicy value. - */ - public RetentionPolicy retentionPolicy() { - return this.retentionPolicy; - } - - /** - * Set the retentionPolicy property: the retention policy for this log. - * - * @param retentionPolicy the retentionPolicy value to set. - * @return the LogSettings object itself. - */ - public LogSettings withRetentionPolicy(RetentionPolicy retentionPolicy) { - this.retentionPolicy = retentionPolicy; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (retentionPolicy() != null) { - retentionPolicy().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/LogToMetricAction.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/LogToMetricAction.java deleted file mode 100644 index 7410f3b13c6a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/LogToMetricAction.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.util.List; - -/** Specify action need to be taken when rule type is converting log to metric. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "odata\\.type") -@JsonTypeName( - "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources" - + ".ScheduledQueryRules.LogToMetricAction") -@JsonFlatten -@Fluent -public class LogToMetricAction extends Action { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LogToMetricAction.class); - - /* - * Criteria of Metric - */ - @JsonProperty(value = "criteria", required = true) - private List criteria; - - /** - * Get the criteria property: Criteria of Metric. - * - * @return the criteria value. - */ - public List criteria() { - return this.criteria; - } - - /** - * Set the criteria property: Criteria of Metric. - * - * @param criteria the criteria value to set. - * @return the LogToMetricAction object itself. - */ - public LogToMetricAction withCriteria(List criteria) { - this.criteria = criteria; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (criteria() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property criteria in model LogToMetricAction")); - } else { - criteria().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/LogicAppReceiver.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/LogicAppReceiver.java deleted file mode 100644 index 1734e6c40f91..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/LogicAppReceiver.java +++ /dev/null @@ -1,146 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** A logic app receiver. */ -@Fluent -public final class LogicAppReceiver { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LogicAppReceiver.class); - - /* - * The name of the logic app receiver. Names must be unique across all - * receivers within an action group. - */ - @JsonProperty(value = "name", required = true) - private String name; - - /* - * The azure resource id of the logic app receiver. - */ - @JsonProperty(value = "resourceId", required = true) - private String resourceId; - - /* - * The callback url where http request sent to. - */ - @JsonProperty(value = "callbackUrl", required = true) - private String callbackUrl; - - /* - * Indicates whether to use common alert schema. - */ - @JsonProperty(value = "useCommonAlertSchema") - private Boolean useCommonAlertSchema; - - /** - * Get the name property: The name of the logic app receiver. Names must be unique across all receivers within an - * action group. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the logic app receiver. Names must be unique across all receivers within an - * action group. - * - * @param name the name value to set. - * @return the LogicAppReceiver object itself. - */ - public LogicAppReceiver withName(String name) { - this.name = name; - return this; - } - - /** - * Get the resourceId property: The azure resource id of the logic app receiver. - * - * @return the resourceId value. - */ - public String resourceId() { - return this.resourceId; - } - - /** - * Set the resourceId property: The azure resource id of the logic app receiver. - * - * @param resourceId the resourceId value to set. - * @return the LogicAppReceiver object itself. - */ - public LogicAppReceiver withResourceId(String resourceId) { - this.resourceId = resourceId; - return this; - } - - /** - * Get the callbackUrl property: The callback url where http request sent to. - * - * @return the callbackUrl value. - */ - public String callbackUrl() { - return this.callbackUrl; - } - - /** - * Set the callbackUrl property: The callback url where http request sent to. - * - * @param callbackUrl the callbackUrl value to set. - * @return the LogicAppReceiver object itself. - */ - public LogicAppReceiver withCallbackUrl(String callbackUrl) { - this.callbackUrl = callbackUrl; - return this; - } - - /** - * Get the useCommonAlertSchema property: Indicates whether to use common alert schema. - * - * @return the useCommonAlertSchema value. - */ - public Boolean useCommonAlertSchema() { - return this.useCommonAlertSchema; - } - - /** - * Set the useCommonAlertSchema property: Indicates whether to use common alert schema. - * - * @param useCommonAlertSchema the useCommonAlertSchema value to set. - * @return the LogicAppReceiver object itself. - */ - public LogicAppReceiver withUseCommonAlertSchema(Boolean useCommonAlertSchema) { - this.useCommonAlertSchema = useCommonAlertSchema; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property name in model LogicAppReceiver")); - } - if (resourceId() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property resourceId in model LogicAppReceiver")); - } - if (callbackUrl() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property callbackUrl in model LogicAppReceiver")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/LogsIngestionEndpointSpec.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/LogsIngestionEndpointSpec.java deleted file mode 100644 index d074164aa259..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/LogsIngestionEndpointSpec.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Definition of the endpoint used for ingesting logs. */ -@Immutable -public class LogsIngestionEndpointSpec { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LogsIngestionEndpointSpec.class); - - /* - * The endpoint. This property is READ-ONLY. - */ - @JsonProperty(value = "endpoint", access = JsonProperty.Access.WRITE_ONLY) - private String endpoint; - - /** - * Get the endpoint property: The endpoint. This property is READ-ONLY. - * - * @return the endpoint value. - */ - public String endpoint() { - return this.endpoint; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ManagementEventAggregationCondition.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ManagementEventAggregationCondition.java deleted file mode 100644 index f85e494982c1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ManagementEventAggregationCondition.java +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.Duration; - -/** How the data that is collected should be combined over time. */ -@Fluent -public final class ManagementEventAggregationCondition { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagementEventAggregationCondition.class); - - /* - * the condition operator. - */ - @JsonProperty(value = "operator") - private ConditionOperator operator; - - /* - * The threshold value that activates the alert. - */ - @JsonProperty(value = "threshold") - private Double threshold; - - /* - * the period of time (in ISO 8601 duration format) that is used to monitor - * alert activity based on the threshold. If specified then it must be - * between 5 minutes and 1 day. - */ - @JsonProperty(value = "windowSize") - private Duration windowSize; - - /** - * Get the operator property: the condition operator. - * - * @return the operator value. - */ - public ConditionOperator operator() { - return this.operator; - } - - /** - * Set the operator property: the condition operator. - * - * @param operator the operator value to set. - * @return the ManagementEventAggregationCondition object itself. - */ - public ManagementEventAggregationCondition withOperator(ConditionOperator operator) { - this.operator = operator; - return this; - } - - /** - * Get the threshold property: The threshold value that activates the alert. - * - * @return the threshold value. - */ - public Double threshold() { - return this.threshold; - } - - /** - * Set the threshold property: The threshold value that activates the alert. - * - * @param threshold the threshold value to set. - * @return the ManagementEventAggregationCondition object itself. - */ - public ManagementEventAggregationCondition withThreshold(Double threshold) { - this.threshold = threshold; - return this; - } - - /** - * Get the windowSize property: the period of time (in ISO 8601 duration format) that is used to monitor alert - * activity based on the threshold. If specified then it must be between 5 minutes and 1 day. - * - * @return the windowSize value. - */ - public Duration windowSize() { - return this.windowSize; - } - - /** - * Set the windowSize property: the period of time (in ISO 8601 duration format) that is used to monitor alert - * activity based on the threshold. If specified then it must be between 5 minutes and 1 day. - * - * @param windowSize the windowSize value to set. - * @return the ManagementEventAggregationCondition object itself. - */ - public ManagementEventAggregationCondition withWindowSize(Duration windowSize) { - this.windowSize = windowSize; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ManagementEventRuleCondition.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ManagementEventRuleCondition.java deleted file mode 100644 index 959f0cd00336..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ManagementEventRuleCondition.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** A management event rule condition. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "odata\\.type") -@JsonTypeName("Microsoft.Azure.Management.Insights.Models.ManagementEventRuleCondition") -@JsonFlatten -@Fluent -public class ManagementEventRuleCondition extends RuleCondition { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagementEventRuleCondition.class); - - /* - * How the data that is collected should be combined over time and when the - * alert is activated. Note that for management event alerts aggregation is - * optional – if it is not provided then any event will cause the alert to - * activate. - */ - @JsonProperty(value = "aggregation") - private ManagementEventAggregationCondition aggregation; - - /** - * Get the aggregation property: How the data that is collected should be combined over time and when the alert is - * activated. Note that for management event alerts aggregation is optional – if it is not provided then any event - * will cause the alert to activate. - * - * @return the aggregation value. - */ - public ManagementEventAggregationCondition aggregation() { - return this.aggregation; - } - - /** - * Set the aggregation property: How the data that is collected should be combined over time and when the alert is - * activated. Note that for management event alerts aggregation is optional – if it is not provided then any event - * will cause the alert to activate. - * - * @param aggregation the aggregation value to set. - * @return the ManagementEventRuleCondition object itself. - */ - public ManagementEventRuleCondition withAggregation(ManagementEventAggregationCondition aggregation) { - this.aggregation = aggregation; - return this; - } - - /** {@inheritDoc} */ - @Override - public ManagementEventRuleCondition withDataSource(RuleDataSource dataSource) { - super.withDataSource(dataSource); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (aggregation() != null) { - aggregation().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/Metric.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/Metric.java deleted file mode 100644 index 5a20a03aefd2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/Metric.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.resourcemanager.monitor.fluent.models.MetricInner; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import java.util.List; - -/** The Azure metric entries are of type Metric. */ -public interface Metric extends HasInnerModel { - /** - * Get the metric Id. - * - * @return the id value - */ - String id(); - - /** - * Get the resource type of the metric resource. - * - * @return the type value - */ - String type(); - - /** - * Get the name and the display name of the metric, i.e. it is localizable string. - * - * @return the name value - */ - LocalizableString name(); - - /** - * Get the unit of the metric. - * - * @return the unit value - */ - Unit unit(); - - /** - * Get the time series returned when a data query is performed. - * - * @return the timeseries value - */ - List timeseries(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricAlert.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricAlert.java deleted file mode 100644 index 5c83148274ab..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricAlert.java +++ /dev/null @@ -1,467 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.monitor.MonitorManager; -import com.azure.resourcemanager.monitor.fluent.models.MetricAlertResourceInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.GroupableResource; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasId; -import com.azure.resourcemanager.resources.fluentcore.arm.models.Resource; -import com.azure.resourcemanager.resources.fluentcore.model.Appliable; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; -import com.azure.resourcemanager.resources.fluentcore.model.Updatable; -import java.time.Duration; -import java.time.OffsetDateTime; -import java.util.Collection; -import java.util.Map; - -/** An immutable client-side representation of a Metric Alert. */ -@Fluent -public interface MetricAlert - extends GroupableResource, - Refreshable, - Updatable { - - /** - * Get the description of the metric alert that will be included in the alert email. - * - * @return the description value - */ - String description(); - - /** - * Get alert severity {0, 1, 2, 3, 4}. - * - * @return the severity value - */ - int severity(); - - /** - * Get the flag that indicates whether the metric alert is enabled. - * - * @return the enabled value - */ - boolean enabled(); - - /** - * Get the list of resource id's that this metric alert is scoped to. - * - * @return the scopes value - */ - Collection scopes(); - - /** - * Get how often the metric alert is evaluated represented in ISO 8601 duration format. - * - * @return the evaluationFrequency value - */ - Duration evaluationFrequency(); - - /** - * Get the Duration of time (in ISO 8601 duration format) that is used to monitor alert activity based on the - * threshold. - * - * @return the windowSize value - */ - Duration windowSize(); - - /** @return metric alert criterias, indexed by name */ - Map alertCriterias(); - - /** @return metric dynamic alert criterias, indexed by name */ - Map dynamicAlertCriterias(); - - /** - * Get the flag that indicates whether the alert should be auto resolved or not. - * - * @return the autoMitigate value - */ - boolean autoMitigate(); - - /** - * Get the array of actions that are performed when the alert rule becomes active, and when an alert condition is - * resolved. - * - * @return the actions value - */ - Collection actionGroupIds(); - - /** - * Get last time the rule was updated in ISO8601 format. - * - * @return the lastUpdatedTime value - */ - OffsetDateTime lastUpdatedTime(); - - /** The entirety of a Metric Alert definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithCreate, - DefinitionStages.WithScopes, - DefinitionStages.WithWindowSize, - DefinitionStages.WithEvaluationFrequency, - DefinitionStages.WithSeverity, - DefinitionStages.WithActionGroup, - DefinitionStages.WithCriteriaDefinition { - } - - /** Metric Alert definition for multiple resource. */ - interface DefinitionMultipleResource - extends DefinitionStages.Blank, - DefinitionStages.WithCreateDynamicCondition, - DefinitionStages.WithScopes, - DefinitionStages.WithWindowSizeMultipleResource, - DefinitionStages.WithEvaluationFrequencyMultipleResource, - DefinitionStages.WithSeverityMultipleResource, - DefinitionStages.WithActionGroupMultipleResource, - DefinitionStages.WithCriteriaDefinitionMultipleResource { - } - - /** Grouping of metric alerts definition stages. */ - interface DefinitionStages { - /** The first stage of a Metric Alert definition. */ - interface Blank extends GroupableResource.DefinitionStages.WithGroupAndRegion { - } - - /** The stage of the definition which specifies target resource for metric alert. */ - interface WithScopes { - /** - * Sets specified resource as a target to alert on metric. - * - * @param resourceId resource Id string. - * @return the next stage of metric alert definition. - */ - WithWindowSize withTargetResource(String resourceId); - - /** - * Sets specified resource as a target to alert on metric. - * - * @param resource resource type that is inherited from {@link HasId} interface - * @return the next stage of metric alert definition. - */ - WithWindowSize withTargetResource(HasId resource); - - /** - * Sets specified resources as target to alert on metric. All resources must be of the same type and in the - * same region. - * - * @param resourceIds collection of resource id to alert on metric. - * @param type resource type. - * @param regionName resource region. - * @return the next stage of metric alert definition. - */ - WithWindowSizeMultipleResource withMultipleTargetResources( - Collection resourceIds, String type, String regionName); - - /** - * Sets specified resources as target to alert on metric. All resources must be of the same type and in the - * same region. - * - * @param resources collection of resources to alert on metric, which must be of the same type and in the - * same region. - * @return the next stage of metric alert definition. - */ - WithWindowSizeMultipleResource withMultipleTargetResources(Collection resources); - } - - /** The stage of the definition which specifies monitoring window for metric alert. */ - interface WithWindowSize { - /** - * Sets the period of time (in ISO 8601 duration format) that is used to monitor alert activity based on the - * threshold. - * - * @param size the windowSize value to set - * @return the next stage of metric alert definition. - */ - WithEvaluationFrequency withPeriod(Duration size); - } - - /** The stage of the definition which specifies evaluation frequency for metric alert. */ - interface WithEvaluationFrequency { - /** - * Sets how often the metric alert is evaluated represented in ISO 8601 duration format. - * - * @param frequency the evaluationFrequency value to set. - * @return the next stage of metric alert definition. - */ - WithSeverity withFrequency(Duration frequency); - } - - /** The stage of the definition which specifies severity for metric alert. */ - interface WithSeverity { - /** - * Sets alert severity {0, 1, 2, 3, 4} and description. - * - * @param severity the severity value to set - * @param description Human readable text description of the metric alert. - * @return the next stage of metric alert definition. - */ - WithActionGroup withAlertDetails(int severity, String description); - } - - /** - * The stage of the definition which specifies actions that will be activated when the conditions are met in the - * metric alert rules. - */ - interface WithActionGroup { - /** - * Sets the actions that will activate when the condition is met. - * - * @param actionGroupId resource Ids of the {@link ActionGroup}. - * @return the next stage of metric alert definition. - */ - WithCriteriaDefinition withActionGroups(String... actionGroupId); - } - - /** The stage of the definition which specifies condition that will cause this alert to activate. */ - interface WithCriteriaDefinition { - /** - * Starts definition of the metric alert condition. - * - * @param name sets the name of the condition. - * @return the next stage of metric alert condition definition. - */ - MetricAlertCondition.DefinitionStages.Blank.MetricName defineAlertCriteria(String name); - } - - /** The stage of the definition which specifies monitoring window for metric alert. */ - interface WithWindowSizeMultipleResource { - /** - * Sets the period of time (in ISO 8601 duration format) that is used to monitor alert activity based on the - * threshold. - * - * @param size the windowSize value to set - * @return the next stage of metric alert definition. - */ - WithEvaluationFrequencyMultipleResource withPeriod(Duration size); - } - - /** The stage of the definition which specifies evaluation frequency for metric alert. */ - interface WithEvaluationFrequencyMultipleResource { - /** - * Sets how often the metric alert is evaluated represented in ISO 8601 duration format. - * - * @param frequency the evaluationFrequency value to set. - * @return the next stage of metric alert definition. - */ - WithSeverityMultipleResource withFrequency(Duration frequency); - } - - /** The stage of the definition which specifies severity for metric alert. */ - interface WithSeverityMultipleResource { - /** - * Sets alert severity {0, 1, 2, 3, 4} and description. - * - * @param severity the severity value to set - * @param description Human readable text description of the metric alert. - * @return the next stage of metric alert definition. - */ - WithActionGroupMultipleResource withAlertDetails(int severity, String description); - } - - /** - * The stage of the definition which specifies actions that will be activated when the conditions are met in the - * metric alert rules. - */ - interface WithActionGroupMultipleResource { - /** - * Sets the actions that will activate when the condition is met. - * - * @param actionGroupId resource Ids of the {@link ActionGroup}. - * @return the next stage of metric alert definition. - */ - WithCriteriaDefinitionMultipleResource withActionGroups(String... actionGroupId); - } - - /** The stage of the definition which specifies condition that will cause this alert to activate. */ - interface WithCriteriaDefinitionMultipleResource { - /** - * Starts definition of the metric alert condition. - * - * @param name sets the name of the condition. - * @return the next stage of metric alert condition definition. - */ - MetricAlertCondition.DefinitionStages.Blank.MetricName defineAlertCriteria(String name); - - /** - * Starts definition of the metric dynamic alert condition. - * - * @param name sets the name of the dynamic condition. - * @return the next stage of metric alert condition definition. - */ - MetricDynamicAlertCondition.DefinitionStages.Blank.MetricName defineDynamicAlertCriteria( - String name); - } - - /** - * The stage of the definition which contains all the minimum required inputs for the resource to be created but - * also allows for any other optional settings to be specified. - */ - interface WithCreate extends Creatable, DefinitionWithTags, WithCriteriaDefinition { - /** - * Sets the flag that indicates the alert should not be auto resolved. - * - * @return the next stage of metric alert condition definition. - */ - WithCreate withoutAutoMitigation(); - - /** - * Sets metric alert as disabled during the creation. - * - * @return the next stage of metric alert definition. - */ - WithActionGroup withRuleDisabled(); - } - - /** - * The stage of the definition which contains all the minimum required inputs for the resource to be created but - * also allows for any other optional settings to be specified. - */ - interface WithCreateDynamicCondition extends Creatable, DefinitionWithTags { - /** - * Sets the flag that indicates the alert should not be auto resolved. - * - * @return the next stage of metric alert condition definition. - */ - WithCreate withoutAutoMitigation(); - - /** - * Sets metric alert as disabled during the creation. - * - * @return the next stage of metric alert definition. - */ - WithActionGroup withRuleDisabled(); - } - } - - /** Grouping of metric alerts update stages. */ - interface UpdateStages { - /** The stage of a metric alerts update allowing to modify settings. */ - interface WithMetricUpdate { - /** - * Sets the period of time (in ISO 8601 duration format) that is used to monitor alert activity based on the - * threshold. - * - * @param size the windowSize value to set - * @return the next stage of the metric alert update. - */ - Update withPeriod(Duration size); - - /** - * Sets how often the metric alert is evaluated represented in ISO 8601 duration format. - * - * @param frequency the evaluationFrequency value to set. - * @return the next stage of the metric alert update. - */ - Update withFrequency(Duration frequency); - - /** - * Sets alert severity {0, 1, 2, 3, 4}. - * - * @param severity the severity value to set - * @return the next stage of the metric alert update. - */ - Update withSeverity(int severity); - - /** - * Sets description for metric alert. - * - * @param description Human readable text description of the metric alert. - * @return the next stage of the metric alert update. - */ - Update withDescription(String description); - - /** - * Sets metric alert as enabled. - * - * @return the next stage of the metric alert update. - */ - Update withRuleEnabled(); - - /** - * Sets metric alert as disabled. - * - * @return the next stage of the metric alert update. - */ - Update withRuleDisabled(); - - /** - * Sets the actions that will activate when the condition is met. - * - * @param actionGroupId resource Ids of the {@link ActionGroup}. - * @return the next stage of the metric alert update. - */ - Update withActionGroups(String... actionGroupId); - - /** - * Removes the specified action group from the actions list. - * - * @param actionGroupId resource Id of the {@link ActionGroup} to remove. - * @return the next stage of the metric alert update. - */ - Update withoutActionGroup(String actionGroupId); - - /** - * Starts definition of the metric alert condition. - * - * @param name sets the name of the condition. - * @return the next stage of the metric alert update. - */ - MetricAlertCondition.UpdateDefinitionStages.Blank.MetricName defineAlertCriteria(String name); - - /** - * Starts definition of the metric dynamic alert condition. - * - * @param name sets the name of the condition. - * @return the next stage of the metric alert update. - */ - MetricDynamicAlertCondition.UpdateDefinitionStages.Blank.MetricName defineDynamicAlertCriteria( - String name); - - /** - * Starts update of the previously defined metric alert condition. - * - * @param name name of the condition that should be updated. - * @return the next stage of the metric alert update. - */ - MetricAlertCondition.UpdateStages updateAlertCriteria(String name); - - /** - * Starts update of the previously defined metric dynamic alert condition. - * - * @param name name of the condition that should be updated. - * @return the next stage of the metric alert update. - */ - MetricDynamicAlertCondition.UpdateStages updateDynamicAlertCriteria(String name); - - /** - * Removes a condition from the previously defined metric alert conditions. - * - * @param name name of the condition that should be removed. - * @return the next stage of the metric alert update. - */ - Update withoutAlertCriteria(String name); - - /** - * Sets the flag that indicates the alert should be auto resolved. - * - * @return the next stage of the metric alert update. - */ - Update withAutoMitigation(); - - /** - * Sets the flag that indicates the alert should not be auto resolved. - * - * @return the next stage of the metric alert update. - */ - Update withoutAutoMitigation(); - } - } - - /** The template for an update operation, containing all the settings that can be modified. */ - interface Update extends Appliable, UpdateStages.WithMetricUpdate, Resource.UpdateWithTags { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricAlertAction.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricAlertAction.java deleted file mode 100644 index 14e5d3d03ba8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricAlertAction.java +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** An alert action. */ -@Fluent -public final class MetricAlertAction { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MetricAlertAction.class); - - /* - * the id of the action group to use. - */ - @JsonProperty(value = "actionGroupId") - private String actionGroupId; - - /* - * This field allows specifying custom properties, which would be appended - * to the alert payload sent as input to the webhook. - */ - @JsonProperty(value = "webHookProperties") - private Map webhookProperties; - - /** - * Get the actionGroupId property: the id of the action group to use. - * - * @return the actionGroupId value. - */ - public String actionGroupId() { - return this.actionGroupId; - } - - /** - * Set the actionGroupId property: the id of the action group to use. - * - * @param actionGroupId the actionGroupId value to set. - * @return the MetricAlertAction object itself. - */ - public MetricAlertAction withActionGroupId(String actionGroupId) { - this.actionGroupId = actionGroupId; - return this; - } - - /** - * Get the webhookProperties property: This field allows specifying custom properties, which would be appended to - * the alert payload sent as input to the webhook. - * - * @return the webhookProperties value. - */ - public Map webhookProperties() { - return this.webhookProperties; - } - - /** - * Set the webhookProperties property: This field allows specifying custom properties, which would be appended to - * the alert payload sent as input to the webhook. - * - * @param webhookProperties the webhookProperties value to set. - * @return the MetricAlertAction object itself. - */ - public MetricAlertAction withWebhookProperties(Map webhookProperties) { - this.webhookProperties = webhookProperties; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricAlertCondition.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricAlertCondition.java deleted file mode 100644 index 4dc6fea9da66..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricAlertCondition.java +++ /dev/null @@ -1,251 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasParent; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import java.util.Collection; - -/** An immutable client-side representation of an Azure metric dynamic alert criteria. */ -@Fluent -public interface MetricAlertCondition extends HasInnerModel, HasParent { - /** - * Get name of the criteria. - * - * @return the name value - */ - String name(); - - /** - * Get name of the metric signal. - * - * @return the metricName value - */ - String metricName(); - - /** - * Get namespace of the metric. - * - * @return the metricNamespace value - */ - String metricNamespace(); - - /** - * Get the criteria operator. Possible values include: 'Equals', 'NotEquals', 'GreaterThan', 'GreaterThanOrEqual', - * 'LessThan', 'LessThanOrEqual'. - * - * @return the operator value - */ - MetricAlertRuleCondition condition(); - - /** - * Get the criteria time aggregation types. Possible values include: 'Average', 'Minimum', 'Maximum', 'Total'. - * - * @return the timeAggregation value - */ - MetricAlertRuleTimeAggregation timeAggregation(); - - /** - * Get the criteria threshold value that activates the alert. - * - * @return the threshold value - */ - double threshold(); - - /** - * Get list of dimension conditions. - * - * @return the dimensions value - */ - Collection dimensions(); - - /** Grouping of metric alerts condition definition stages. */ - interface DefinitionStages { - /** The first stage of a Metric Alert condition definition. */ - interface Blank { - /** - * The stage of the definition which specifies metric signal name. * - * - * @param the stage of the parent Metric Alert definition to return to after attaching this - * definition - */ - interface MetricName { - /** - * Sets the name of the signal name to monitor. - * - * @param metricName metric name of the signal. - * @return the next stage of metric alert condition definition. - */ - WithCriteriaOperator withMetricName(String metricName); - - /** - * Sets the name of the signal name to monitor. - * - * @param metricName metric name of the signal. - * @param metricNamespace the Namespace of the metric. - * @return the next stage of metric alert condition definition. - */ - WithCriteriaOperator withMetricName(String metricName, String metricNamespace); - } - } - - /** - * The stage of the definition which specifies metric alert condition. - * - * @param the stage of the parent Metric Alert definition to return to after attaching this definition - */ - interface WithCriteriaOperator { - /** - * Sets the condition to monitor for the current metric alert. - * - * @param timeAggregation the criteria time aggregation types. Possible values include: 'Average', - * 'Minimum', 'Maximum', 'Total'. - * @param condition the criteria operator. Possible values include: 'Equals', 'NotEquals', 'GreaterThan', - * 'GreaterThanOrEqual', 'LessThan', 'LessThanOrEqual'. - * @param threshold the criteria threshold value that activates the alert. - * @return the next stage of metric alert condition definition. - */ - WithConditionAttach withCondition( - MetricAlertRuleTimeAggregation timeAggregation, MetricAlertRuleCondition condition, double threshold); - } - - /** - * The stage of the definition which specifies metric alert additional filtering options. - * - * @param the stage of the parent Metric Alert definition to return to after attaching this definition - */ - interface WithConditionAttach { - /** - * Adds a metric dimension filter. - * - * @param dimensionName the name of the dimension. - * @param values list of dimension values to alert on. - * @return the next stage of metric alert condition definition. - */ - WithConditionAttach withDimension(String dimensionName, String... values); - - /** - * Attaches the defined condition to the parent metric alert. - * - * @return the next stage of metric alert definition. - */ - ParentT attach(); - } - } - - /** The entirety of a metric alert condition definition as a part of a parent metric alert update. */ - interface UpdateDefinitionStages { - /** The first stage of a Metric Alert condition definition. */ - interface Blank { - /** - * The stage of the definition which specifies metric signal name. * - * - * @param the stage of the parent Metric Alert definition to return to after attaching this - * definition - */ - interface MetricName { - /** - * Sets the name of the signal name to monitor. - * - * @param metricName metric name of the signal. - * @return the next stage of metric alert condition definition. - */ - WithCriteriaOperator withMetricName(String metricName); - - /** - * Sets the name of the signal name to monitor. - * - * @param metricName metric name of the signal. - * @param metricNamespace the Namespace of the metric. - * @return the next stage of metric alert condition definition. - */ - WithCriteriaOperator withMetricName(String metricName, String metricNamespace); - } - } - - /** - * The stage of the definition which specifies metric alert condition. - * - * @param the stage of the parent Metric Alert definition to return to after attaching this definition - */ - interface WithCriteriaOperator { - /** - * Sets the condition to monitor for the current metric alert. - * - * @param condition the criteria operator. Possible values include: 'Equals', 'NotEquals', 'GreaterThan', - * 'GreaterThanOrEqual', 'LessThan', 'LessThanOrEqual'. - * @param timeAggregation the criteria time aggregation types. Possible values include: 'Average', - * 'Minimum', 'Maximum', 'Total'. - * @param threshold the criteria threshold value that activates the alert. - * @return the next stage of metric alert condition definition. - */ - WithConditionAttach withCondition( - MetricAlertRuleTimeAggregation timeAggregation, MetricAlertRuleCondition condition, double threshold); - } - - /** - * The stage of the definition which specifies metric alert additional filtering options. - * - * @param the stage of the parent Metric Alert definition to return to after attaching this definition - */ - interface WithConditionAttach { - /** - * Adds a metric dimension filter. - * - * @param dimensionName the name of the dimension. - * @param values list of dimension values to alert on. - * @return the next stage of metric alert condition definition. - */ - WithConditionAttach withDimension(String dimensionName, String... values); - - /** - * Attaches the defined condition to the parent metric alert. - * - * @return the next stage of metric alert definition. - */ - ParentT attach(); - } - } - - /** Grouping of metric alert condition update stages. */ - interface UpdateStages { - /** - * Sets the condition to monitor for the current metric alert. - * - * @param condition the criteria operator. Possible values include: 'Equals', 'NotEquals', 'GreaterThan', - * 'GreaterThanOrEqual', 'LessThan', 'LessThanOrEqual'. - * @param timeAggregation the criteria time aggregation types. Possible values include: 'Average', 'Minimum', - * 'Maximum', 'Total'. - * @param threshold the criteria threshold value that activates the alert. - * @return the next stage of the metric alert condition update. - */ - UpdateStages withCondition( - MetricAlertRuleTimeAggregation timeAggregation, MetricAlertRuleCondition condition, double threshold); - - /** - * Adds a metric dimension filter. - * - * @param dimensionName the name of the dimension. - * @param values list of dimension values to alert on. - * @return the next stage of the metric alert condition update. - */ - UpdateStages withDimension(String dimensionName, String... values); - - /** - * Removes the specified dimension filter. - * - * @param dimensionName dimensionName the name of the dimension. - * @return the next stage of the metric alert condition update. - */ - UpdateStages withoutDimension(String dimensionName); - - /** - * Returns back to the metric alert update flow. - * - * @return the next stage of the metric alert update. - */ - MetricAlert.Update parent(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricAlertCriteria.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricAlertCriteria.java deleted file mode 100644 index cc1bd643d5f6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricAlertCriteria.java +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.util.HashMap; -import java.util.Map; - -/** The rule criteria that defines the conditions of the alert rule. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "odata\\.type", - defaultImpl = MetricAlertCriteria.class) -@JsonTypeName("MetricAlertCriteria") -@JsonSubTypes({ - @JsonSubTypes.Type( - name = "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria", - value = MetricAlertSingleResourceMultipleMetricCriteria.class), - @JsonSubTypes.Type( - name = "Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria", - value = WebtestLocationAvailabilityCriteria.class), - @JsonSubTypes.Type( - name = "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria", - value = MetricAlertMultipleResourceMultipleMetricCriteria.class) -}) -@JsonFlatten -@Fluent -public class MetricAlertCriteria { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MetricAlertCriteria.class); - - /* - * The rule criteria that defines the conditions of the alert rule. - */ - @JsonIgnore private Map additionalProperties; - - /** - * Get the additionalProperties property: The rule criteria that defines the conditions of the alert rule. - * - * @return the additionalProperties value. - */ - @JsonAnyGetter - public Map additionalProperties() { - return this.additionalProperties; - } - - /** - * Set the additionalProperties property: The rule criteria that defines the conditions of the alert rule. - * - * @param additionalProperties the additionalProperties value to set. - * @return the MetricAlertCriteria object itself. - */ - public MetricAlertCriteria withAdditionalProperties(Map additionalProperties) { - this.additionalProperties = additionalProperties; - return this; - } - - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key.replace("\\.", "."), value); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricAlertMultipleResourceMultipleMetricCriteria.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricAlertMultipleResourceMultipleMetricCriteria.java deleted file mode 100644 index f11e25c45451..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricAlertMultipleResourceMultipleMetricCriteria.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.util.List; - -/** Specifies the metric alert criteria for multiple resource that has multiple metric criteria. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "odata\\.type") -@JsonTypeName("Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria") -@JsonFlatten -@Fluent -public class MetricAlertMultipleResourceMultipleMetricCriteria extends MetricAlertCriteria { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(MetricAlertMultipleResourceMultipleMetricCriteria.class); - - /* - * the list of multiple metric criteria for this 'all of' operation. - */ - @JsonProperty(value = "allOf") - private List allOf; - - /** - * Get the allOf property: the list of multiple metric criteria for this 'all of' operation. - * - * @return the allOf value. - */ - public List allOf() { - return this.allOf; - } - - /** - * Set the allOf property: the list of multiple metric criteria for this 'all of' operation. - * - * @param allOf the allOf value to set. - * @return the MetricAlertMultipleResourceMultipleMetricCriteria object itself. - */ - public MetricAlertMultipleResourceMultipleMetricCriteria withAllOf(List allOf) { - this.allOf = allOf; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (allOf() != null) { - allOf().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricAlertResourceCollection.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricAlertResourceCollection.java deleted file mode 100644 index 70fd17b826b9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricAlertResourceCollection.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.fluent.models.MetricAlertResourceInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Represents a collection of alert rule resources. */ -@Fluent -public final class MetricAlertResourceCollection { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MetricAlertResourceCollection.class); - - /* - * the values for the alert rule resources. - */ - @JsonProperty(value = "value") - private List value; - - /** - * Get the value property: the values for the alert rule resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: the values for the alert rule resources. - * - * @param value the value value to set. - * @return the MetricAlertResourceCollection object itself. - */ - public MetricAlertResourceCollection withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricAlertResourcePatch.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricAlertResourcePatch.java deleted file mode 100644 index 59f2e0b192ea..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricAlertResourcePatch.java +++ /dev/null @@ -1,397 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.Duration; -import java.time.OffsetDateTime; -import java.util.List; -import java.util.Map; - -/** The metric alert resource for patch operations. */ -@JsonFlatten -@Fluent -public class MetricAlertResourcePatch { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MetricAlertResourcePatch.class); - - /* - * Resource tags - */ - @JsonProperty(value = "tags") - private Map tags; - - /* - * the description of the metric alert that will be included in the alert - * email. - */ - @JsonProperty(value = "properties.description") - private String description; - - /* - * Alert severity {0, 1, 2, 3, 4} - */ - @JsonProperty(value = "properties.severity") - private Integer severity; - - /* - * the flag that indicates whether the metric alert is enabled. - */ - @JsonProperty(value = "properties.enabled") - private Boolean enabled; - - /* - * the list of resource id's that this metric alert is scoped to. - */ - @JsonProperty(value = "properties.scopes") - private List scopes; - - /* - * how often the metric alert is evaluated represented in ISO 8601 duration - * format. - */ - @JsonProperty(value = "properties.evaluationFrequency") - private Duration evaluationFrequency; - - /* - * the period of time (in ISO 8601 duration format) that is used to monitor - * alert activity based on the threshold. - */ - @JsonProperty(value = "properties.windowSize") - private Duration windowSize; - - /* - * the resource type of the target resource(s) on which the alert is - * created/updated. Mandatory for MultipleResourceMultipleMetricCriteria. - */ - @JsonProperty(value = "properties.targetResourceType") - private String targetResourceType; - - /* - * the region of the target resource(s) on which the alert is - * created/updated. Mandatory for MultipleResourceMultipleMetricCriteria. - */ - @JsonProperty(value = "properties.targetResourceRegion") - private String targetResourceRegion; - - /* - * defines the specific alert criteria information. - */ - @JsonProperty(value = "properties.criteria") - private MetricAlertCriteria criteria; - - /* - * the flag that indicates whether the alert should be auto resolved or - * not. The default is true. - */ - @JsonProperty(value = "properties.autoMitigate") - private Boolean autoMitigate; - - /* - * the array of actions that are performed when the alert rule becomes - * active, and when an alert condition is resolved. - */ - @JsonProperty(value = "properties.actions") - private List actions; - - /* - * Last time the rule was updated in ISO8601 format. - */ - @JsonProperty(value = "properties.lastUpdatedTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime lastUpdatedTime; - - /* - * the value indicating whether this alert rule is migrated. - */ - @JsonProperty(value = "properties.isMigrated", access = JsonProperty.Access.WRITE_ONLY) - private Boolean isMigrated; - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Resource tags. - * - * @param tags the tags value to set. - * @return the MetricAlertResourcePatch object itself. - */ - public MetricAlertResourcePatch withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Get the description property: the description of the metric alert that will be included in the alert email. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: the description of the metric alert that will be included in the alert email. - * - * @param description the description value to set. - * @return the MetricAlertResourcePatch object itself. - */ - public MetricAlertResourcePatch withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the severity property: Alert severity {0, 1, 2, 3, 4}. - * - * @return the severity value. - */ - public Integer severity() { - return this.severity; - } - - /** - * Set the severity property: Alert severity {0, 1, 2, 3, 4}. - * - * @param severity the severity value to set. - * @return the MetricAlertResourcePatch object itself. - */ - public MetricAlertResourcePatch withSeverity(Integer severity) { - this.severity = severity; - return this; - } - - /** - * Get the enabled property: the flag that indicates whether the metric alert is enabled. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: the flag that indicates whether the metric alert is enabled. - * - * @param enabled the enabled value to set. - * @return the MetricAlertResourcePatch object itself. - */ - public MetricAlertResourcePatch withEnabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the scopes property: the list of resource id's that this metric alert is scoped to. - * - * @return the scopes value. - */ - public List scopes() { - return this.scopes; - } - - /** - * Set the scopes property: the list of resource id's that this metric alert is scoped to. - * - * @param scopes the scopes value to set. - * @return the MetricAlertResourcePatch object itself. - */ - public MetricAlertResourcePatch withScopes(List scopes) { - this.scopes = scopes; - return this; - } - - /** - * Get the evaluationFrequency property: how often the metric alert is evaluated represented in ISO 8601 duration - * format. - * - * @return the evaluationFrequency value. - */ - public Duration evaluationFrequency() { - return this.evaluationFrequency; - } - - /** - * Set the evaluationFrequency property: how often the metric alert is evaluated represented in ISO 8601 duration - * format. - * - * @param evaluationFrequency the evaluationFrequency value to set. - * @return the MetricAlertResourcePatch object itself. - */ - public MetricAlertResourcePatch withEvaluationFrequency(Duration evaluationFrequency) { - this.evaluationFrequency = evaluationFrequency; - return this; - } - - /** - * Get the windowSize property: the period of time (in ISO 8601 duration format) that is used to monitor alert - * activity based on the threshold. - * - * @return the windowSize value. - */ - public Duration windowSize() { - return this.windowSize; - } - - /** - * Set the windowSize property: the period of time (in ISO 8601 duration format) that is used to monitor alert - * activity based on the threshold. - * - * @param windowSize the windowSize value to set. - * @return the MetricAlertResourcePatch object itself. - */ - public MetricAlertResourcePatch withWindowSize(Duration windowSize) { - this.windowSize = windowSize; - return this; - } - - /** - * Get the targetResourceType property: the resource type of the target resource(s) on which the alert is - * created/updated. Mandatory for MultipleResourceMultipleMetricCriteria. - * - * @return the targetResourceType value. - */ - public String targetResourceType() { - return this.targetResourceType; - } - - /** - * Set the targetResourceType property: the resource type of the target resource(s) on which the alert is - * created/updated. Mandatory for MultipleResourceMultipleMetricCriteria. - * - * @param targetResourceType the targetResourceType value to set. - * @return the MetricAlertResourcePatch object itself. - */ - public MetricAlertResourcePatch withTargetResourceType(String targetResourceType) { - this.targetResourceType = targetResourceType; - return this; - } - - /** - * Get the targetResourceRegion property: the region of the target resource(s) on which the alert is - * created/updated. Mandatory for MultipleResourceMultipleMetricCriteria. - * - * @return the targetResourceRegion value. - */ - public String targetResourceRegion() { - return this.targetResourceRegion; - } - - /** - * Set the targetResourceRegion property: the region of the target resource(s) on which the alert is - * created/updated. Mandatory for MultipleResourceMultipleMetricCriteria. - * - * @param targetResourceRegion the targetResourceRegion value to set. - * @return the MetricAlertResourcePatch object itself. - */ - public MetricAlertResourcePatch withTargetResourceRegion(String targetResourceRegion) { - this.targetResourceRegion = targetResourceRegion; - return this; - } - - /** - * Get the criteria property: defines the specific alert criteria information. - * - * @return the criteria value. - */ - public MetricAlertCriteria criteria() { - return this.criteria; - } - - /** - * Set the criteria property: defines the specific alert criteria information. - * - * @param criteria the criteria value to set. - * @return the MetricAlertResourcePatch object itself. - */ - public MetricAlertResourcePatch withCriteria(MetricAlertCriteria criteria) { - this.criteria = criteria; - return this; - } - - /** - * Get the autoMitigate property: the flag that indicates whether the alert should be auto resolved or not. The - * default is true. - * - * @return the autoMitigate value. - */ - public Boolean autoMitigate() { - return this.autoMitigate; - } - - /** - * Set the autoMitigate property: the flag that indicates whether the alert should be auto resolved or not. The - * default is true. - * - * @param autoMitigate the autoMitigate value to set. - * @return the MetricAlertResourcePatch object itself. - */ - public MetricAlertResourcePatch withAutoMitigate(Boolean autoMitigate) { - this.autoMitigate = autoMitigate; - return this; - } - - /** - * Get the actions property: the array of actions that are performed when the alert rule becomes active, and when an - * alert condition is resolved. - * - * @return the actions value. - */ - public List actions() { - return this.actions; - } - - /** - * Set the actions property: the array of actions that are performed when the alert rule becomes active, and when an - * alert condition is resolved. - * - * @param actions the actions value to set. - * @return the MetricAlertResourcePatch object itself. - */ - public MetricAlertResourcePatch withActions(List actions) { - this.actions = actions; - return this; - } - - /** - * Get the lastUpdatedTime property: Last time the rule was updated in ISO8601 format. - * - * @return the lastUpdatedTime value. - */ - public OffsetDateTime lastUpdatedTime() { - return this.lastUpdatedTime; - } - - /** - * Get the isMigrated property: the value indicating whether this alert rule is migrated. - * - * @return the isMigrated value. - */ - public Boolean isMigrated() { - return this.isMigrated; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (criteria() != null) { - criteria().validate(); - } - if (actions() != null) { - actions().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricAlertRuleCondition.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricAlertRuleCondition.java deleted file mode 100644 index 915257bb021b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricAlertRuleCondition.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for MetricAlertRuleCondition. */ -public final class MetricAlertRuleCondition extends ExpandableStringEnum { - /** Static value Equals for MetricAlertRuleCondition. */ - public static final MetricAlertRuleCondition EQUALS = fromString("Equals"); - - /** Static value NotEquals for MetricAlertRuleCondition. */ - public static final MetricAlertRuleCondition NOT_EQUALS = fromString("NotEquals"); - - /** Static value GreaterThan for MetricAlertRuleCondition. */ - public static final MetricAlertRuleCondition GREATER_THAN = fromString("GreaterThan"); - - /** Static value GreaterThanOrEqual for MetricAlertRuleCondition. */ - public static final MetricAlertRuleCondition GREATER_THAN_OR_EQUAL = fromString("GreaterThanOrEqual"); - - /** Static value LessThan for MetricAlertRuleCondition. */ - public static final MetricAlertRuleCondition LESS_THAN = fromString("LessThan"); - - /** Static value LessThanOrEqual for MetricAlertRuleCondition. */ - public static final MetricAlertRuleCondition LESS_THAN_OR_EQUAL = fromString("LessThanOrEqual"); - - /** - * Creates or finds a MetricAlertRuleCondition from its string representation. - * - * @param name a name to look for - * @return the corresponding MetricAlertRuleCondition - */ - @JsonCreator - public static MetricAlertRuleCondition fromString(String name) { - return fromString(name, MetricAlertRuleCondition.class); - } - - /** @return known MetricAlertRuleCondition values */ - public static Collection values() { - return values(MetricAlertRuleCondition.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricAlertRuleTimeAggregation.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricAlertRuleTimeAggregation.java deleted file mode 100644 index e04409ace13f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricAlertRuleTimeAggregation.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for MetricAlertRuleTimeAggregation. */ -public final class MetricAlertRuleTimeAggregation extends ExpandableStringEnum { - /** Static value Count for MetricAlertRuleTimeAggregation. */ - public static final MetricAlertRuleTimeAggregation COUNT = fromString("Count"); - - /** Static value Average for MetricAlertRuleTimeAggregation. */ - public static final MetricAlertRuleTimeAggregation AVERAGE = fromString("Average"); - - /** Static value Minimum for MetricAlertRuleTimeAggregation. */ - public static final MetricAlertRuleTimeAggregation MINIMUM = fromString("Minimum"); - - /** Static value Maximum for MetricAlertRuleTimeAggregation. */ - public static final MetricAlertRuleTimeAggregation MAXIMUM = fromString("Maximum"); - - /** Static value Total for MetricAlertRuleTimeAggregation. */ - public static final MetricAlertRuleTimeAggregation TOTAL = fromString("Total"); - - /** - * Creates or finds a MetricAlertRuleTimeAggregation from its string representation. - * - * @param name a name to look for - * @return the corresponding MetricAlertRuleTimeAggregation - */ - @JsonCreator - public static MetricAlertRuleTimeAggregation fromString(String name) { - return fromString(name, MetricAlertRuleTimeAggregation.class); - } - - /** @return known MetricAlertRuleTimeAggregation values */ - public static Collection values() { - return values(MetricAlertRuleTimeAggregation.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricAlertSingleResourceMultipleMetricCriteria.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricAlertSingleResourceMultipleMetricCriteria.java deleted file mode 100644 index ba4496039d28..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricAlertSingleResourceMultipleMetricCriteria.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.util.List; - -/** Specifies the metric alert criteria for a single resource that has multiple metric criteria. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "odata\\.type") -@JsonTypeName("Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria") -@JsonFlatten -@Fluent -public class MetricAlertSingleResourceMultipleMetricCriteria extends MetricAlertCriteria { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(MetricAlertSingleResourceMultipleMetricCriteria.class); - - /* - * The list of metric criteria for this 'all of' operation. - */ - @JsonProperty(value = "allOf") - private List allOf; - - /** - * Get the allOf property: The list of metric criteria for this 'all of' operation. - * - * @return the allOf value. - */ - public List allOf() { - return this.allOf; - } - - /** - * Set the allOf property: The list of metric criteria for this 'all of' operation. - * - * @param allOf the allOf value to set. - * @return the MetricAlertSingleResourceMultipleMetricCriteria object itself. - */ - public MetricAlertSingleResourceMultipleMetricCriteria withAllOf(List allOf) { - this.allOf = allOf; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (allOf() != null) { - allOf().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricAlertStatus.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricAlertStatus.java deleted file mode 100644 index cf2fd03db018..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricAlertStatus.java +++ /dev/null @@ -1,131 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** An alert status. */ -@Fluent -public final class MetricAlertStatus { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MetricAlertStatus.class); - - /* - * The status name. - */ - @JsonProperty(value = "name") - private String name; - - /* - * The alert rule arm id. - */ - @JsonProperty(value = "id") - private String id; - - /* - * The extended resource type name. - */ - @JsonProperty(value = "type") - private String type; - - /* - * The alert status properties of the metric alert status. - */ - @JsonProperty(value = "properties") - private MetricAlertStatusProperties properties; - - /** - * Get the name property: The status name. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The status name. - * - * @param name the name value to set. - * @return the MetricAlertStatus object itself. - */ - public MetricAlertStatus withName(String name) { - this.name = name; - return this; - } - - /** - * Get the id property: The alert rule arm id. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: The alert rule arm id. - * - * @param id the id value to set. - * @return the MetricAlertStatus object itself. - */ - public MetricAlertStatus withId(String id) { - this.id = id; - return this; - } - - /** - * Get the type property: The extended resource type name. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Set the type property: The extended resource type name. - * - * @param type the type value to set. - * @return the MetricAlertStatus object itself. - */ - public MetricAlertStatus withType(String type) { - this.type = type; - return this; - } - - /** - * Get the properties property: The alert status properties of the metric alert status. - * - * @return the properties value. - */ - public MetricAlertStatusProperties properties() { - return this.properties; - } - - /** - * Set the properties property: The alert status properties of the metric alert status. - * - * @param properties the properties value to set. - * @return the MetricAlertStatus object itself. - */ - public MetricAlertStatus withProperties(MetricAlertStatusProperties properties) { - this.properties = properties; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricAlertStatusProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricAlertStatusProperties.java deleted file mode 100644 index 4cb25de8b251..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricAlertStatusProperties.java +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.Map; - -/** An alert status properties. */ -@Fluent -public final class MetricAlertStatusProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MetricAlertStatusProperties.class); - - /* - * An object describing the type of the dimensions. - */ - @JsonProperty(value = "dimensions") - private Map dimensions; - - /* - * status value - */ - @JsonProperty(value = "status") - private String status; - - /* - * UTC time when the status was checked. - */ - @JsonProperty(value = "timestamp") - private OffsetDateTime timestamp; - - /** - * Get the dimensions property: An object describing the type of the dimensions. - * - * @return the dimensions value. - */ - public Map dimensions() { - return this.dimensions; - } - - /** - * Set the dimensions property: An object describing the type of the dimensions. - * - * @param dimensions the dimensions value to set. - * @return the MetricAlertStatusProperties object itself. - */ - public MetricAlertStatusProperties withDimensions(Map dimensions) { - this.dimensions = dimensions; - return this; - } - - /** - * Get the status property: status value. - * - * @return the status value. - */ - public String status() { - return this.status; - } - - /** - * Set the status property: status value. - * - * @param status the status value to set. - * @return the MetricAlertStatusProperties object itself. - */ - public MetricAlertStatusProperties withStatus(String status) { - this.status = status; - return this; - } - - /** - * Get the timestamp property: UTC time when the status was checked. - * - * @return the timestamp value. - */ - public OffsetDateTime timestamp() { - return this.timestamp; - } - - /** - * Set the timestamp property: UTC time when the status was checked. - * - * @param timestamp the timestamp value to set. - * @return the MetricAlertStatusProperties object itself. - */ - public MetricAlertStatusProperties withTimestamp(OffsetDateTime timestamp) { - this.timestamp = timestamp; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricAlerts.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricAlerts.java deleted file mode 100644 index 1a3ac4a54d54..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricAlerts.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.monitor.MonitorManager; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsBatchDeletion; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsDeletingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsListingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsBatchCreation; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsCreating; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingById; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; - -/** Entry point for Metric Alert management API. */ -@Fluent -public interface MetricAlerts - extends SupportsCreating, - SupportsListing, - SupportsListingByResourceGroup, - SupportsGettingById, - SupportsDeletingById, - SupportsDeletingByResourceGroup, - SupportsBatchCreation, - SupportsBatchDeletion, - HasManager { -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricAvailability.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricAvailability.java deleted file mode 100644 index 5d80cefc33fc..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricAvailability.java +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.Duration; - -/** - * Metric availability specifies the time grain (aggregation interval or frequency) and the retention period for that - * time grain. - */ -@Fluent -public final class MetricAvailability { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MetricAvailability.class); - - /* - * the time grain specifies the aggregation interval for the metric. - * Expressed as a duration 'PT1M', 'P1D', etc. - */ - @JsonProperty(value = "timeGrain") - private Duration timeGrain; - - /* - * the retention period for the metric at the specified timegrain. - * Expressed as a duration 'PT1M', 'P1D', etc. - */ - @JsonProperty(value = "retention") - private Duration retention; - - /** - * Get the timeGrain property: the time grain specifies the aggregation interval for the metric. Expressed as a - * duration 'PT1M', 'P1D', etc. - * - * @return the timeGrain value. - */ - public Duration timeGrain() { - return this.timeGrain; - } - - /** - * Set the timeGrain property: the time grain specifies the aggregation interval for the metric. Expressed as a - * duration 'PT1M', 'P1D', etc. - * - * @param timeGrain the timeGrain value to set. - * @return the MetricAvailability object itself. - */ - public MetricAvailability withTimeGrain(Duration timeGrain) { - this.timeGrain = timeGrain; - return this; - } - - /** - * Get the retention property: the retention period for the metric at the specified timegrain. Expressed as a - * duration 'PT1M', 'P1D', etc. - * - * @return the retention value. - */ - public Duration retention() { - return this.retention; - } - - /** - * Set the retention property: the retention period for the metric at the specified timegrain. Expressed as a - * duration 'PT1M', 'P1D', etc. - * - * @param retention the retention value to set. - * @return the MetricAvailability object itself. - */ - public MetricAvailability withRetention(Duration retention) { - this.retention = retention; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricBaselinesResponse.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricBaselinesResponse.java deleted file mode 100644 index f278e64ba838..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricBaselinesResponse.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.fluent.models.SingleMetricBaselineInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** A list of metric baselines. */ -@Fluent -public final class MetricBaselinesResponse { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MetricBaselinesResponse.class); - - /* - * The list of metric baselines. - */ - @JsonProperty(value = "value") - private List value; - - /** - * Get the value property: The list of metric baselines. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The list of metric baselines. - * - * @param value the value value to set. - * @return the MetricBaselinesResponse object itself. - */ - public MetricBaselinesResponse withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricClass.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricClass.java deleted file mode 100644 index 4a8cf45ca345..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricClass.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for MetricClass. */ -public final class MetricClass extends ExpandableStringEnum { - /** Static value Availability for MetricClass. */ - public static final MetricClass AVAILABILITY = fromString("Availability"); - - /** Static value Transactions for MetricClass. */ - public static final MetricClass TRANSACTIONS = fromString("Transactions"); - - /** Static value Errors for MetricClass. */ - public static final MetricClass ERRORS = fromString("Errors"); - - /** Static value Latency for MetricClass. */ - public static final MetricClass LATENCY = fromString("Latency"); - - /** Static value Saturation for MetricClass. */ - public static final MetricClass SATURATION = fromString("Saturation"); - - /** - * Creates or finds a MetricClass from its string representation. - * - * @param name a name to look for. - * @return the corresponding MetricClass. - */ - @JsonCreator - public static MetricClass fromString(String name) { - return fromString(name, MetricClass.class); - } - - /** @return known MetricClass values. */ - public static Collection values() { - return values(MetricClass.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricCollection.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricCollection.java deleted file mode 100644 index 54b400892868..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricCollection.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.resourcemanager.monitor.fluent.models.ResponseInner; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import java.time.Duration; -import java.util.List; - -/** The MetricCollection representing wrapper over ResponseInner type. */ -public interface MetricCollection extends HasInnerModel { - /** - * Get the namespace value. - * - * @return the namespace value - */ - String namespace(); - - /** - * Get the resource region value. - * - * @return the resource region value - */ - String resourceRegion(); - - /** - * Get the cost value. - * - * @return the cost value - */ - Double cost(); - - /** - * Get the timespan value. - * - * @return the timespan value - */ - String timespan(); - - /** - * Get the interval value. - * - * @return the interval value - */ - Duration interval(); - - /** - * Get the metric collection value. - * - * @return the metric collection value - */ - List metrics(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricCriteria.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricCriteria.java deleted file mode 100644 index d6f30f2d66dc..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricCriteria.java +++ /dev/null @@ -1,130 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.util.List; - -/** Criterion to filter metrics. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "criterionType") -@JsonTypeName("StaticThresholdCriterion") -@Fluent -public final class MetricCriteria extends MultiMetricCriteria { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MetricCriteria.class); - - /* - * the criteria operator. - */ - @JsonProperty(value = "operator", required = true) - private Operator operator; - - /* - * the criteria threshold value that activates the alert. - */ - @JsonProperty(value = "threshold", required = true) - private double threshold; - - /** - * Get the operator property: the criteria operator. - * - * @return the operator value. - */ - public Operator operator() { - return this.operator; - } - - /** - * Set the operator property: the criteria operator. - * - * @param operator the operator value to set. - * @return the MetricCriteria object itself. - */ - public MetricCriteria withOperator(Operator operator) { - this.operator = operator; - return this; - } - - /** - * Get the threshold property: the criteria threshold value that activates the alert. - * - * @return the threshold value. - */ - public double threshold() { - return this.threshold; - } - - /** - * Set the threshold property: the criteria threshold value that activates the alert. - * - * @param threshold the threshold value to set. - * @return the MetricCriteria object itself. - */ - public MetricCriteria withThreshold(double threshold) { - this.threshold = threshold; - return this; - } - - /** {@inheritDoc} */ - @Override - public MetricCriteria withName(String name) { - super.withName(name); - return this; - } - - /** {@inheritDoc} */ - @Override - public MetricCriteria withMetricName(String metricName) { - super.withMetricName(metricName); - return this; - } - - /** {@inheritDoc} */ - @Override - public MetricCriteria withMetricNamespace(String metricNamespace) { - super.withMetricNamespace(metricNamespace); - return this; - } - - /** {@inheritDoc} */ - @Override - public MetricCriteria withTimeAggregation(AggregationTypeEnum timeAggregation) { - super.withTimeAggregation(timeAggregation); - return this; - } - - /** {@inheritDoc} */ - @Override - public MetricCriteria withDimensions(List dimensions) { - super.withDimensions(dimensions); - return this; - } - - /** {@inheritDoc} */ - @Override - public MetricCriteria withSkipMetricValidation(Boolean skipMetricValidation) { - super.withSkipMetricValidation(skipMetricValidation); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (operator() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property operator in model MetricCriteria")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricDefinition.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricDefinition.java deleted file mode 100644 index 8aa0dc7a5c59..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricDefinition.java +++ /dev/null @@ -1,214 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.resourcemanager.monitor.MonitorManager; -import com.azure.resourcemanager.monitor.fluent.models.MetricDefinitionInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import java.time.Duration; -import java.time.OffsetDateTime; -import java.util.List; -import reactor.core.publisher.Mono; - -/** The Azure metric definition entries are of type MetricDefinition. */ -public interface MetricDefinition extends HasManager, HasInnerModel { - - /** - * Get the resourceId value. - * - * @return the resourceId value - */ - String resourceId(); - - /** - * Get the name value. - * - * @return the name value - */ - LocalizableString name(); - - /** - * Get the namespace value. - * - * @return the namespace value - */ - String namespace(); - - /** - * Get the isDimensionRequired value. - * - * @return the isDimensionRequired value - */ - boolean isDimensionRequired(); - - /** - * the name and the display name of the dimension, i.e. it is a localizable string. - * - * @return the list of dimension values. - */ - List dimensions(); - - /** - * the collection of what aggregation types are supported. - * - * @return the list of supported aggregation type values. - */ - List supportedAggregationTypes(); - - /** - * Get the unit value. - * - * @return the unit value - */ - Unit unit(); - - /** - * Get the primaryAggregationType value. - * - * @return the primaryAggregationType value - */ - AggregationType primaryAggregationType(); - - /** - * Get the metricAvailabilities value. - * - * @return the metricAvailabilities value - */ - List metricAvailabilities(); - - /** - * Get the id value. - * - * @return the id value - */ - String id(); - - /** - * Begins a definition for a new resource Metric query. - * - * @return the stage of start time filter definition. - */ - MetricsQueryDefinitionStages.WithMetricStartTimeFilter defineQuery(); - - /** The entirety of a Metrics query definition. */ - interface MetricsQueryDefinition - extends MetricsQueryDefinitionStages.WithMetricStartTimeFilter, - MetricsQueryDefinitionStages.WithMetricEndFilter, - MetricsQueryDefinitionStages.WithMetricsQueryExecute { - } - - /** Grouping of Metric query stages. */ - interface MetricsQueryDefinitionStages { - - /** The stage of a Metric query allowing to specify start time filter. */ - interface WithMetricStartTimeFilter { - /** - * Sets the start time for Metric query filter. - * - * @param startTime specifies start time of cut off filter. - * @return the stage of end time filter definition. - */ - WithMetricEndFilter startingFrom(OffsetDateTime startTime); - } - - /** The stage of a Metric query allowing to specify end time filter. */ - interface WithMetricEndFilter { - /** - * Sets the end time for Metric query filter. - * - * @param endTime specifies end time of cut off filter. - * @return the stage of optional query parameter definition and query execution. - */ - WithMetricsQueryExecute endsBefore(OffsetDateTime endTime); - } - - /** The stage of a Metric query allowing to specify optional filters and execute the query. */ - interface WithMetricsQueryExecute { - /** - * Sets the list of aggregation types to retrieve. - * - * @param aggregation The list of aggregation types (comma separated) to retrieve. - * @return the stage of optional query parameter definition and query execution. - */ - WithMetricsQueryExecute withAggregation(String aggregation); - - /** - * Sets the interval of the query. - * - * @param interval The interval of the query. - * @return the stage of optional query parameter definition and query execution. - */ - WithMetricsQueryExecute withInterval(Duration interval); - - /** - * Sets the **$filter** that is used to reduce the set of metric data returned. <br>Example:<br> - * Metric contains metadata A, B and C.<br> - * - *

    - Return all time series of C where A = a1 and B = b1 or b2<br> **$filter=A eq ‘a1’ and B eq - * ‘b1’ or B eq ‘b2’ and C eq ‘*’**<br> - * - *

    - Invalid variant:<br> **$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’**<br> - * This is invalid because the logical or operator cannot separate two different metadata names.<br> - * - *

    - Return all time series where A = a1, B = b1 and C = c1:<br> **$filter=A eq ‘a1’ and B eq ‘b1’ - * and C eq ‘c1’**<br> - * - *

    - Return all time series where A = a1<br> **$filter=A eq ‘a1’ and B eq ‘*’ and C eq ‘*’**. - * - * @param odataFilter the **$filter** to reduce the set of the returned metric data. - * @return the stage of optional query parameter definition and query execution. - */ - WithMetricsQueryExecute withOdataFilter(String odataFilter); - - /** - * Reduces the set of data collected. The syntax allowed depends on the operation. See the operation's - * description for details. Possible values include: 'Data', 'Metadata' - * - * @param resultType the type of metric to retrieve. - * @return the stage of optional query parameter definition and query execution. - */ - WithMetricsQueryExecute withResultType(ResultType resultType); - - /** - * Sets the maximum number of records to retrieve. Valid only if $filter is specified. Defaults to 10. - * - * @param top the maximum number of records to retrieve. - * @return the stage of optional query parameter definition and query execution. - */ - WithMetricsQueryExecute selectTop(int top); - - /** - * Sets the aggregation to use for sorting results and the direction of the sort. Only one order can be - * specified. Examples: sum asc. - * - * @param orderBy the aggregation to use for sorting results and the direction of the sort. - * @return the stage of optional query parameter definition and query execution. - */ - WithMetricsQueryExecute orderBy(String orderBy); - - /** - * Filters Metrics for a given namespace. - * - * @param namespaceName Metric namespace to query metric definitions for. - * @return the stage of optional query parameter definition and query execution. - */ - WithMetricsQueryExecute filterByNamespace(String namespaceName); - - /** - * Executes the query. - * - * @return Metric collection received after query execution. - */ - MetricCollection execute(); - - /** - * Executes the query. - * - * @return a representation of the deferred computation of Metric collection query call - */ - Mono executeAsync(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricDefinitionCollection.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricDefinitionCollection.java deleted file mode 100644 index fafcfad3d2c6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricDefinitionCollection.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.fluent.models.MetricDefinitionInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Represents collection of metric definitions. */ -@Fluent -public final class MetricDefinitionCollection { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MetricDefinitionCollection.class); - - /* - * the values for the metric definitions. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /** - * Get the value property: the values for the metric definitions. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: the values for the metric definitions. - * - * @param value the value value to set. - * @return the MetricDefinitionCollection object itself. - */ - public MetricDefinitionCollection withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property value in model MetricDefinitionCollection")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricDefinitions.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricDefinitions.java deleted file mode 100644 index 0d01df921e3f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricDefinitions.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.monitor.MonitorManager; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; - -/** Entry point for Monitor Metric Definitions API. */ -public interface MetricDefinitions extends HasManager { - - /** - * Lists Metric Definitions for a given resource. - * - * @param resourceId The resource Id. - * @return list of metric definitions. - */ - PagedIterable listByResource(String resourceId); - - /** - * Lists Metric Definitions for a given resource. - * - * @param resourceId The resource Id. - * @return a representation of the deferred computation of Metric Definitions list call. - */ - PagedFlux listByResourceAsync(String resourceId); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricDimension.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricDimension.java deleted file mode 100644 index 9d1248a14ceb..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricDimension.java +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Specifies a metric dimension. */ -@Fluent -public final class MetricDimension { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MetricDimension.class); - - /* - * Name of the dimension. - */ - @JsonProperty(value = "name", required = true) - private String name; - - /* - * the dimension operator. Only 'Include' and 'Exclude' are supported - */ - @JsonProperty(value = "operator", required = true) - private String operator; - - /* - * list of dimension values. - */ - @JsonProperty(value = "values", required = true) - private List values; - - /** - * Get the name property: Name of the dimension. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Name of the dimension. - * - * @param name the name value to set. - * @return the MetricDimension object itself. - */ - public MetricDimension withName(String name) { - this.name = name; - return this; - } - - /** - * Get the operator property: the dimension operator. Only 'Include' and 'Exclude' are supported. - * - * @return the operator value. - */ - public String operator() { - return this.operator; - } - - /** - * Set the operator property: the dimension operator. Only 'Include' and 'Exclude' are supported. - * - * @param operator the operator value to set. - * @return the MetricDimension object itself. - */ - public MetricDimension withOperator(String operator) { - this.operator = operator; - return this; - } - - /** - * Get the values property: list of dimension values. - * - * @return the values value. - */ - public List values() { - return this.values; - } - - /** - * Set the values property: list of dimension values. - * - * @param values the values value to set. - * @return the MetricDimension object itself. - */ - public MetricDimension withValues(List values) { - this.values = values; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property name in model MetricDimension")); - } - if (operator() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property operator in model MetricDimension")); - } - if (values() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property values in model MetricDimension")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricDynamicAlertCondition.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricDynamicAlertCondition.java deleted file mode 100644 index d7679846e2f4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricDynamicAlertCondition.java +++ /dev/null @@ -1,344 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasParent; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import java.time.OffsetDateTime; -import java.util.Collection; - -/** An immutable client-side representation of an Azure metric alert criteria. */ -@Fluent -public interface MetricDynamicAlertCondition extends HasInnerModel, HasParent { - - /** - * Get name of the criteria. - * - * @return the name value - */ - String name(); - - /** - * Get name of the metric signal. - * - * @return the metricName value - */ - String metricName(); - - /** - * Get namespace of the metric. - * - * @return the metricNamespace value - */ - String metricNamespace(); - - /** - * Get the operator used to compare the metric value against the threshold. - * - * @return the operator value - */ - DynamicThresholdOperator condition(); - - /** - * Get the criteria time aggregation types. Possible values include: 'Average', 'Minimum', 'Maximum', 'Total'. - * - * @return the timeAggregation value - */ - MetricAlertRuleTimeAggregation timeAggregation(); - - /** - * Get the extent of deviation required to trigger an alert. This will affect how tight the threshold is to the - * metric series pattern. - * - * @return the threshold value - */ - DynamicThresholdSensitivity alertSensitivity(); - - /** - * Get list of dimension conditions. - * - * @return the dimensions value - */ - Collection dimensions(); - - /** - * Get the minimum number of violations required within the selected lookback time window required to raise an - * alert. - * - * @return the failingPeriods value - */ - DynamicThresholdFailingPeriods failingPeriods(); - - /** - * Get the date from which to start learning the metric historical data and calculate the dynamic thresholds (in - * ISO8601 format). - * - * @return the ignoreDataBefore value - */ - OffsetDateTime ignoreDataBefore(); - - /** Grouping of metric alerts condition definition stages. */ - interface DefinitionStages { - /** The first stage of a Metric Alert condition definition. */ - interface Blank { - /** - * The stage of the definition which specifies metric signal name. - * - * @param the stage of the parent Metric Alert definition to return to after attaching this - * definition - */ - interface MetricName { - /** - * Sets the name of the signal name to monitor. - * - * @param metricName metric name of the signal. - * @return the next stage of metric alert condition definition. - */ - WithCriteriaOperator withMetricName(String metricName); - - /** - * Sets the name of the signal name to monitor. - * - * @param metricName metric name of the signal. - * @param metricNamespace the Namespace of the metric. - * @return the next stage of metric alert condition definition. - */ - WithCriteriaOperator withMetricName(String metricName, String metricNamespace); - } - } - - /** - * The stage of the definition which specifies metric alert condition. - * - * @param the stage of the parent Metric Alert definition to return to after attaching this definition - */ - interface WithCriteriaOperator { - /** - * Sets the condition to monitor for the current metric alert. - * - * @param timeAggregation the criteria time aggregation types. - * @param condition the criteria operator used to compare the metric value against the threshold. - * @param alertSensitivity the extent of deviation required to trigger an alert. - * @return the next stage of metric alert condition definition. - */ - WithFailingPeriods withCondition( - MetricAlertRuleTimeAggregation timeAggregation, - DynamicThresholdOperator condition, - DynamicThresholdSensitivity alertSensitivity); - } - - /** - * The stage of the definition which specifies metric alert condition. - * - * @param the stage of the parent Metric Alert definition to return to after attaching this definition - */ - interface WithFailingPeriods { - /** - * Sets the failing periods for triggering the alert. - * - * @param failingPeriods the failing periods for triggering the alert. - * @return the next stage of metric alert condition definition. - */ - WithConditionAttach withFailingPeriods(DynamicThresholdFailingPeriods failingPeriods); - } - - /** - * The stage of the definition which specifies metric alert additional filtering options. - * - * @param the stage of the parent Metric Alert definition to return to after attaching this definition - */ - interface WithConditionAttach { - /** - * Sets the date from which to start learning the metric historical data and calculate the dynamic - * thresholds. - * - * @param dateTime the date from which to start learning the metric historical data and calculate the - * dynamic thresholds. - * @return the next stage of metric alert condition definition. - */ - WithConditionAttach withIgnoreDataBefore(OffsetDateTime dateTime); - - /** - * Adds a metric dimension filter. - * - * @param dimensionName the name of the dimension. - * @param values list of dimension values to alert on. - * @return the next stage of metric alert condition definition. - */ - WithConditionAttach withDimension(String dimensionName, String... values); - - /** - * Attaches the defined condition to the parent metric alert. - * - * @return the next stage of metric alert definition. - */ - ParentT attach(); - } - } - - /** The entirety of a metric alert condition definition as a part of a parent metric alert update. */ - interface UpdateDefinitionStages { - /** The first stage of a Metric Alert condition definition. */ - interface Blank { - /** - * The stage of the definition which specifies metric signal name. * - * - * @param the stage of the parent Metric Alert definition to return to after attaching this - * definition - */ - interface MetricName { - /** - * Sets the name of the signal name to monitor. - * - * @param metricName metric name of the signal. - * @return the next stage of metric alert condition definition. - */ - WithCriteriaOperator withMetricName(String metricName); - - /** - * Sets the name of the signal name to monitor. - * - * @param metricName metric name of the signal. - * @param metricNamespace the Namespace of the metric. - * @return the next stage of metric alert condition definition. - */ - WithCriteriaOperator withMetricName(String metricName, String metricNamespace); - } - } - - /** - * The stage of the definition which specifies metric alert condition. - * - * @param the stage of the parent Metric Alert definition to return to after attaching this definition - */ - interface WithCriteriaOperator { - /** - * Sets the condition to monitor for the current metric alert. - * - * @param timeAggregation the criteria time aggregation types. - * @param condition the criteria operator used to compare the metric value against the threshold. - * @param alertSensitivity the extent of deviation required to trigger an alert. - * @return the next stage of metric alert condition definition. - */ - WithFailingPeriods withCondition( - MetricAlertRuleTimeAggregation timeAggregation, - DynamicThresholdOperator condition, - DynamicThresholdSensitivity alertSensitivity); - } - - /** - * The stage of the definition which specifies metric alert condition. - * - * @param the stage of the parent Metric Alert definition to return to after attaching this definition - */ - interface WithFailingPeriods { - /** - * Sets the failing periods for triggering the alert. - * - * @param failingPeriods the failing periods for triggering the alert. - * @return the next stage of metric alert condition definition. - */ - WithConditionAttach withFailingPeriods(DynamicThresholdFailingPeriods failingPeriods); - } - - /** - * The stage of the definition which specifies metric alert additional filtering options. - * - * @param the stage of the parent Metric Alert definition to return to after attaching this definition - */ - interface WithConditionAttach { - /** - * Sets the date from which to start learning the metric historical data and calculate the dynamic - * thresholds. - * - * @param date the date from which to start learning the metric historical data and calculate the dynamic - * thresholds. - * @return the next stage of metric alert condition definition. - */ - WithConditionAttach withIgnoreDataBefore(OffsetDateTime date); - - /** - * Adds a metric dimension filter. - * - * @param dimensionName the name of the dimension. - * @param values list of dimension values to alert on. - * @return the next stage of metric alert condition definition. - */ - WithConditionAttach withDimension(String dimensionName, String... values); - - /** - * Attaches the defined condition to the parent metric alert. - * - * @return the next stage of metric alert definition. - */ - ParentT attach(); - } - } - - /** Grouping of metric alert condition update stages. */ - interface UpdateStages { - /** - * Sets the condition to monitor for the current metric alert. - * - * @param condition the criteria operator. - * @param timeAggregation the criteria time aggregation types. - * @param sensitivity the threshold sensitivity that activates the alert. - * @return the next stage of metric alert condition definition. - */ - UpdateStages withCondition( - MetricAlertRuleTimeAggregation timeAggregation, - DynamicThresholdOperator condition, - DynamicThresholdSensitivity sensitivity); - - /** - * Adds a metric dimension filter. - * - * @param dimensionName the name of the dimension. - * @param values list of dimension values to alert on. - * @return the next stage of the metric alert condition update. - */ - UpdateStages withDimension(String dimensionName, String... values); - - /** - * Removes the specified dimension filter. - * - * @param dimensionName dimensionName the name of the dimension. - * @return the next stage of the metric alert condition update. - */ - UpdateStages withoutDimension(String dimensionName); - - /** - * Sets the failing periods for triggering the alert. - * - * @param failingPeriods the failing periods for triggering the alert. - * @return the next stage of metric alert condition definition. - */ - UpdateStages withFailingPeriods(DynamicThresholdFailingPeriods failingPeriods); - - /** - * Sets the date from which to start learning the metric historical data and calculate the dynamic thresholds. - * - * @param date the date from which to start learning the metric historical data and calculate the dynamic - * thresholds. - * @return the next stage of metric alert condition definition. - */ - UpdateStages withIgnoreDataBefore(OffsetDateTime date); - - /** - * Removes the date from which to start learning the metric historical data and calculate the dynamic - * thresholds. - * - * @return the next stage of the metric alert condition update. - */ - UpdateStages withoutIgnoreDataBefore(); - - /** - * Returns back to the metric alert update flow. - * - * @return the next stage of the metric alert update. - */ - MetricAlert.Update parent(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricNamespaceCollection.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricNamespaceCollection.java deleted file mode 100644 index 87fe237ea51a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricNamespaceCollection.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.fluent.models.MetricNamespaceInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Represents collection of metric namespaces. */ -@Fluent -public final class MetricNamespaceCollection { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MetricNamespaceCollection.class); - - /* - * The values for the metric namespaces. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /** - * Get the value property: The values for the metric namespaces. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The values for the metric namespaces. - * - * @param value the value value to set. - * @return the MetricNamespaceCollection object itself. - */ - public MetricNamespaceCollection withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model MetricNamespaceCollection")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricNamespaceName.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricNamespaceName.java deleted file mode 100644 index 9121ebff68e7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricNamespaceName.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The fully qualified metric namespace name. */ -@Fluent -public final class MetricNamespaceName { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MetricNamespaceName.class); - - /* - * The metric namespace name. - */ - @JsonProperty(value = "metricNamespaceName") - private String metricNamespaceName; - - /** - * Get the metricNamespaceName property: The metric namespace name. - * - * @return the metricNamespaceName value. - */ - public String metricNamespaceName() { - return this.metricNamespaceName; - } - - /** - * Set the metricNamespaceName property: The metric namespace name. - * - * @param metricNamespaceName the metricNamespaceName value to set. - * @return the MetricNamespaceName object itself. - */ - public MetricNamespaceName withMetricNamespaceName(String metricNamespaceName) { - this.metricNamespaceName = metricNamespaceName; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricSettings.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricSettings.java deleted file mode 100644 index 2980416d438b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricSettings.java +++ /dev/null @@ -1,138 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.Duration; - -/** Part of MultiTenantDiagnosticSettings. Specifies the settings for a particular metric. */ -@Fluent -public final class MetricSettings { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MetricSettings.class); - - /* - * the timegrain of the metric in ISO8601 format. - */ - @JsonProperty(value = "timeGrain") - private Duration timeGrain; - - /* - * Name of a Diagnostic Metric category for a resource type this setting is - * applied to. To obtain the list of Diagnostic metric categories for a - * resource, first perform a GET diagnostic settings operation. - */ - @JsonProperty(value = "category") - private String category; - - /* - * a value indicating whether this category is enabled. - */ - @JsonProperty(value = "enabled", required = true) - private boolean enabled; - - /* - * the retention policy for this category. - */ - @JsonProperty(value = "retentionPolicy") - private RetentionPolicy retentionPolicy; - - /** - * Get the timeGrain property: the timegrain of the metric in ISO8601 format. - * - * @return the timeGrain value. - */ - public Duration timeGrain() { - return this.timeGrain; - } - - /** - * Set the timeGrain property: the timegrain of the metric in ISO8601 format. - * - * @param timeGrain the timeGrain value to set. - * @return the MetricSettings object itself. - */ - public MetricSettings withTimeGrain(Duration timeGrain) { - this.timeGrain = timeGrain; - return this; - } - - /** - * Get the category property: Name of a Diagnostic Metric category for a resource type this setting is applied to. - * To obtain the list of Diagnostic metric categories for a resource, first perform a GET diagnostic settings - * operation. - * - * @return the category value. - */ - public String category() { - return this.category; - } - - /** - * Set the category property: Name of a Diagnostic Metric category for a resource type this setting is applied to. - * To obtain the list of Diagnostic metric categories for a resource, first perform a GET diagnostic settings - * operation. - * - * @param category the category value to set. - * @return the MetricSettings object itself. - */ - public MetricSettings withCategory(String category) { - this.category = category; - return this; - } - - /** - * Get the enabled property: a value indicating whether this category is enabled. - * - * @return the enabled value. - */ - public boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: a value indicating whether this category is enabled. - * - * @param enabled the enabled value to set. - * @return the MetricSettings object itself. - */ - public MetricSettings withEnabled(boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the retentionPolicy property: the retention policy for this category. - * - * @return the retentionPolicy value. - */ - public RetentionPolicy retentionPolicy() { - return this.retentionPolicy; - } - - /** - * Set the retentionPolicy property: the retention policy for this category. - * - * @param retentionPolicy the retentionPolicy value to set. - * @return the MetricSettings object itself. - */ - public MetricSettings withRetentionPolicy(RetentionPolicy retentionPolicy) { - this.retentionPolicy = retentionPolicy; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (retentionPolicy() != null) { - retentionPolicy().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricSingleDimension.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricSingleDimension.java deleted file mode 100644 index 483f07acbaab..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricSingleDimension.java +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The metric dimension name and value. */ -@Fluent -public final class MetricSingleDimension { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MetricSingleDimension.class); - - /* - * Name of the dimension. - */ - @JsonProperty(value = "name", required = true) - private String name; - - /* - * Value of the dimension. - */ - @JsonProperty(value = "value", required = true) - private String value; - - /** - * Get the name property: Name of the dimension. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Name of the dimension. - * - * @param name the name value to set. - * @return the MetricSingleDimension object itself. - */ - public MetricSingleDimension withName(String name) { - this.name = name; - return this; - } - - /** - * Get the value property: Value of the dimension. - * - * @return the value value. - */ - public String value() { - return this.value; - } - - /** - * Set the value property: Value of the dimension. - * - * @param value the value value to set. - * @return the MetricSingleDimension object itself. - */ - public MetricSingleDimension withValue(String value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property name in model MetricSingleDimension")); - } - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model MetricSingleDimension")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricStatisticType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricStatisticType.java deleted file mode 100644 index 44142a2cfc1c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricStatisticType.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for MetricStatisticType. */ -public enum MetricStatisticType { - /** Enum value Average. */ - AVERAGE("Average"), - - /** Enum value Min. */ - MIN("Min"), - - /** Enum value Max. */ - MAX("Max"), - - /** Enum value Sum. */ - SUM("Sum"), - - /** Enum value Count. */ - COUNT("Count"); - - /** The actual serialized value for a MetricStatisticType instance. */ - private final String value; - - MetricStatisticType(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a MetricStatisticType instance. - * - * @param value the serialized value to parse. - * @return the parsed MetricStatisticType object, or null if unable to parse. - */ - @JsonCreator - public static MetricStatisticType fromString(String value) { - MetricStatisticType[] items = MetricStatisticType.values(); - for (MetricStatisticType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricTrigger.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricTrigger.java deleted file mode 100644 index 2e82c2fc7952..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricTrigger.java +++ /dev/null @@ -1,396 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.Duration; -import java.util.List; - -/** The trigger that results in a scaling action. */ -@Fluent -public final class MetricTrigger { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MetricTrigger.class); - - /* - * the name of the metric that defines what the rule monitors. - */ - @JsonProperty(value = "metricName", required = true) - private String metricName; - - /* - * the namespace of the metric that defines what the rule monitors. - */ - @JsonProperty(value = "metricNamespace") - private String metricNamespace; - - /* - * the resource identifier of the resource the rule monitors. - */ - @JsonProperty(value = "metricResourceUri", required = true) - private String metricResourceUri; - - /* - * the location of the resource the rule monitors. - */ - @JsonProperty(value = "metricResourceLocation") - private String metricResourceLocation; - - /* - * the granularity of metrics the rule monitors. Must be one of the - * predefined values returned from metric definitions for the metric. Must - * be between 12 hours and 1 minute. - */ - @JsonProperty(value = "timeGrain", required = true) - private Duration timeGrain; - - /* - * the metric statistic type. How the metrics from multiple instances are - * combined. - */ - @JsonProperty(value = "statistic", required = true) - private MetricStatisticType statistic; - - /* - * the range of time in which instance data is collected. This value must - * be greater than the delay in metric collection, which can vary from - * resource-to-resource. Must be between 12 hours and 5 minutes. - */ - @JsonProperty(value = "timeWindow", required = true) - private Duration timeWindow; - - /* - * time aggregation type. How the data that is collected should be combined - * over time. The default value is Average. - */ - @JsonProperty(value = "timeAggregation", required = true) - private TimeAggregationType timeAggregation; - - /* - * the operator that is used to compare the metric data and the threshold. - */ - @JsonProperty(value = "operator", required = true) - private ComparisonOperationType operator; - - /* - * the threshold of the metric that triggers the scale action. - */ - @JsonProperty(value = "threshold", required = true) - private double threshold; - - /* - * List of dimension conditions. For example: - * [{"DimensionName":"AppName","Operator":"Equals","Values":["App1"]},{"DimensionName":"Deployment"" - + ","Operator":"Equals","Values":["default"]}]. - */ - @JsonProperty(value = "dimensions") - private List dimensions; - - /* - * a value indicating whether metric should divide per instance. - */ - @JsonProperty(value = "dividePerInstance") - private Boolean dividePerInstance; - - /** - * Get the metricName property: the name of the metric that defines what the rule monitors. - * - * @return the metricName value. - */ - public String metricName() { - return this.metricName; - } - - /** - * Set the metricName property: the name of the metric that defines what the rule monitors. - * - * @param metricName the metricName value to set. - * @return the MetricTrigger object itself. - */ - public MetricTrigger withMetricName(String metricName) { - this.metricName = metricName; - return this; - } - - /** - * Get the metricNamespace property: the namespace of the metric that defines what the rule monitors. - * - * @return the metricNamespace value. - */ - public String metricNamespace() { - return this.metricNamespace; - } - - /** - * Set the metricNamespace property: the namespace of the metric that defines what the rule monitors. - * - * @param metricNamespace the metricNamespace value to set. - * @return the MetricTrigger object itself. - */ - public MetricTrigger withMetricNamespace(String metricNamespace) { - this.metricNamespace = metricNamespace; - return this; - } - - /** - * Get the metricResourceUri property: the resource identifier of the resource the rule monitors. - * - * @return the metricResourceUri value. - */ - public String metricResourceUri() { - return this.metricResourceUri; - } - - /** - * Set the metricResourceUri property: the resource identifier of the resource the rule monitors. - * - * @param metricResourceUri the metricResourceUri value to set. - * @return the MetricTrigger object itself. - */ - public MetricTrigger withMetricResourceUri(String metricResourceUri) { - this.metricResourceUri = metricResourceUri; - return this; - } - - /** - * Get the metricResourceLocation property: the location of the resource the rule monitors. - * - * @return the metricResourceLocation value. - */ - public String metricResourceLocation() { - return this.metricResourceLocation; - } - - /** - * Set the metricResourceLocation property: the location of the resource the rule monitors. - * - * @param metricResourceLocation the metricResourceLocation value to set. - * @return the MetricTrigger object itself. - */ - public MetricTrigger withMetricResourceLocation(String metricResourceLocation) { - this.metricResourceLocation = metricResourceLocation; - return this; - } - - /** - * Get the timeGrain property: the granularity of metrics the rule monitors. Must be one of the predefined values - * returned from metric definitions for the metric. Must be between 12 hours and 1 minute. - * - * @return the timeGrain value. - */ - public Duration timeGrain() { - return this.timeGrain; - } - - /** - * Set the timeGrain property: the granularity of metrics the rule monitors. Must be one of the predefined values - * returned from metric definitions for the metric. Must be between 12 hours and 1 minute. - * - * @param timeGrain the timeGrain value to set. - * @return the MetricTrigger object itself. - */ - public MetricTrigger withTimeGrain(Duration timeGrain) { - this.timeGrain = timeGrain; - return this; - } - - /** - * Get the statistic property: the metric statistic type. How the metrics from multiple instances are combined. - * - * @return the statistic value. - */ - public MetricStatisticType statistic() { - return this.statistic; - } - - /** - * Set the statistic property: the metric statistic type. How the metrics from multiple instances are combined. - * - * @param statistic the statistic value to set. - * @return the MetricTrigger object itself. - */ - public MetricTrigger withStatistic(MetricStatisticType statistic) { - this.statistic = statistic; - return this; - } - - /** - * Get the timeWindow property: the range of time in which instance data is collected. This value must be greater - * than the delay in metric collection, which can vary from resource-to-resource. Must be between 12 hours and 5 - * minutes. - * - * @return the timeWindow value. - */ - public Duration timeWindow() { - return this.timeWindow; - } - - /** - * Set the timeWindow property: the range of time in which instance data is collected. This value must be greater - * than the delay in metric collection, which can vary from resource-to-resource. Must be between 12 hours and 5 - * minutes. - * - * @param timeWindow the timeWindow value to set. - * @return the MetricTrigger object itself. - */ - public MetricTrigger withTimeWindow(Duration timeWindow) { - this.timeWindow = timeWindow; - return this; - } - - /** - * Get the timeAggregation property: time aggregation type. How the data that is collected should be combined over - * time. The default value is Average. - * - * @return the timeAggregation value. - */ - public TimeAggregationType timeAggregation() { - return this.timeAggregation; - } - - /** - * Set the timeAggregation property: time aggregation type. How the data that is collected should be combined over - * time. The default value is Average. - * - * @param timeAggregation the timeAggregation value to set. - * @return the MetricTrigger object itself. - */ - public MetricTrigger withTimeAggregation(TimeAggregationType timeAggregation) { - this.timeAggregation = timeAggregation; - return this; - } - - /** - * Get the operator property: the operator that is used to compare the metric data and the threshold. - * - * @return the operator value. - */ - public ComparisonOperationType operator() { - return this.operator; - } - - /** - * Set the operator property: the operator that is used to compare the metric data and the threshold. - * - * @param operator the operator value to set. - * @return the MetricTrigger object itself. - */ - public MetricTrigger withOperator(ComparisonOperationType operator) { - this.operator = operator; - return this; - } - - /** - * Get the threshold property: the threshold of the metric that triggers the scale action. - * - * @return the threshold value. - */ - public double threshold() { - return this.threshold; - } - - /** - * Set the threshold property: the threshold of the metric that triggers the scale action. - * - * @param threshold the threshold value to set. - * @return the MetricTrigger object itself. - */ - public MetricTrigger withThreshold(double threshold) { - this.threshold = threshold; - return this; - } - - /** - * Get the dimensions property: List of dimension conditions. For example: - * [{"DimensionName":"AppName","Operator":"Equals","Values":["App1"]},{"DimensionName":"Deployment"" - + ","Operator":"Equals","Values":["default"]}]. - * - * @return the dimensions value. - */ - public List dimensions() { - return this.dimensions; - } - - /** - * Set the dimensions property: List of dimension conditions. For example: - * [{"DimensionName":"AppName","Operator":"Equals","Values":["App1"]},{"DimensionName":"Deployment"" - + ","Operator":"Equals","Values":["default"]}]. - * - * @param dimensions the dimensions value to set. - * @return the MetricTrigger object itself. - */ - public MetricTrigger withDimensions(List dimensions) { - this.dimensions = dimensions; - return this; - } - - /** - * Get the dividePerInstance property: a value indicating whether metric should divide per instance. - * - * @return the dividePerInstance value. - */ - public Boolean dividePerInstance() { - return this.dividePerInstance; - } - - /** - * Set the dividePerInstance property: a value indicating whether metric should divide per instance. - * - * @param dividePerInstance the dividePerInstance value to set. - * @return the MetricTrigger object itself. - */ - public MetricTrigger withDividePerInstance(Boolean dividePerInstance) { - this.dividePerInstance = dividePerInstance; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (metricName() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property metricName in model MetricTrigger")); - } - if (metricResourceUri() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property metricResourceUri in model MetricTrigger")); - } - if (timeGrain() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property timeGrain in model MetricTrigger")); - } - if (statistic() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property statistic in model MetricTrigger")); - } - if (timeWindow() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property timeWindow in model MetricTrigger")); - } - if (timeAggregation() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property timeAggregation in model MetricTrigger")); - } - if (operator() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property operator in model MetricTrigger")); - } - if (dimensions() != null) { - dimensions().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricTriggerType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricTriggerType.java deleted file mode 100644 index 834740faf05d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricTriggerType.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for MetricTriggerType. */ -public final class MetricTriggerType extends ExpandableStringEnum { - /** Static value Consecutive for MetricTriggerType. */ - public static final MetricTriggerType CONSECUTIVE = fromString("Consecutive"); - - /** Static value Total for MetricTriggerType. */ - public static final MetricTriggerType TOTAL = fromString("Total"); - - /** - * Creates or finds a MetricTriggerType from its string representation. - * - * @param name a name to look for. - * @return the corresponding MetricTriggerType. - */ - @JsonCreator - public static MetricTriggerType fromString(String name) { - return fromString(name, MetricTriggerType.class); - } - - /** @return known MetricTriggerType values. */ - public static Collection values() { - return values(MetricTriggerType.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricValue.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricValue.java deleted file mode 100644 index 24fe6468e9e4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricValue.java +++ /dev/null @@ -1,189 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** Represents a metric value. */ -@Fluent -public final class MetricValue { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MetricValue.class); - - /* - * the timestamp for the metric value in ISO 8601 format. - */ - @JsonProperty(value = "timeStamp", required = true) - private OffsetDateTime timestamp; - - /* - * the average value in the time range. - */ - @JsonProperty(value = "average") - private Double average; - - /* - * the least value in the time range. - */ - @JsonProperty(value = "minimum") - private Double minimum; - - /* - * the greatest value in the time range. - */ - @JsonProperty(value = "maximum") - private Double maximum; - - /* - * the sum of all of the values in the time range. - */ - @JsonProperty(value = "total") - private Double total; - - /* - * the number of samples in the time range. Can be used to determine the - * number of values that contributed to the average value. - */ - @JsonProperty(value = "count") - private Double count; - - /** - * Get the timestamp property: the timestamp for the metric value in ISO 8601 format. - * - * @return the timestamp value. - */ - public OffsetDateTime timestamp() { - return this.timestamp; - } - - /** - * Set the timestamp property: the timestamp for the metric value in ISO 8601 format. - * - * @param timestamp the timestamp value to set. - * @return the MetricValue object itself. - */ - public MetricValue withTimestamp(OffsetDateTime timestamp) { - this.timestamp = timestamp; - return this; - } - - /** - * Get the average property: the average value in the time range. - * - * @return the average value. - */ - public Double average() { - return this.average; - } - - /** - * Set the average property: the average value in the time range. - * - * @param average the average value to set. - * @return the MetricValue object itself. - */ - public MetricValue withAverage(Double average) { - this.average = average; - return this; - } - - /** - * Get the minimum property: the least value in the time range. - * - * @return the minimum value. - */ - public Double minimum() { - return this.minimum; - } - - /** - * Set the minimum property: the least value in the time range. - * - * @param minimum the minimum value to set. - * @return the MetricValue object itself. - */ - public MetricValue withMinimum(Double minimum) { - this.minimum = minimum; - return this; - } - - /** - * Get the maximum property: the greatest value in the time range. - * - * @return the maximum value. - */ - public Double maximum() { - return this.maximum; - } - - /** - * Set the maximum property: the greatest value in the time range. - * - * @param maximum the maximum value to set. - * @return the MetricValue object itself. - */ - public MetricValue withMaximum(Double maximum) { - this.maximum = maximum; - return this; - } - - /** - * Get the total property: the sum of all of the values in the time range. - * - * @return the total value. - */ - public Double total() { - return this.total; - } - - /** - * Set the total property: the sum of all of the values in the time range. - * - * @param total the total value to set. - * @return the MetricValue object itself. - */ - public MetricValue withTotal(Double total) { - this.total = total; - return this; - } - - /** - * Get the count property: the number of samples in the time range. Can be used to determine the number of values - * that contributed to the average value. - * - * @return the count value. - */ - public Double count() { - return this.count; - } - - /** - * Set the count property: the number of samples in the time range. Can be used to determine the number of values - * that contributed to the average value. - * - * @param count the count value to set. - * @return the MetricValue object itself. - */ - public MetricValue withCount(Double count) { - this.count = count; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (timestamp() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property timestamp in model MetricValue")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MultiMetricCriteria.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MultiMetricCriteria.java deleted file mode 100644 index c9e25d006a59..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MultiMetricCriteria.java +++ /dev/null @@ -1,254 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** The types of conditions for a multi resource alert. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "criterionType", - defaultImpl = MultiMetricCriteria.class) -@JsonTypeName("MultiMetricCriteria") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "StaticThresholdCriterion", value = MetricCriteria.class), - @JsonSubTypes.Type(name = "DynamicThresholdCriterion", value = DynamicMetricCriteria.class) -}) -@Fluent -public class MultiMetricCriteria { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MultiMetricCriteria.class); - - /* - * Name of the criteria. - */ - @JsonProperty(value = "name", required = true) - private String name; - - /* - * Name of the metric. - */ - @JsonProperty(value = "metricName", required = true) - private String metricName; - - /* - * Namespace of the metric. - */ - @JsonProperty(value = "metricNamespace") - private String metricNamespace; - - /* - * the criteria time aggregation types. - */ - @JsonProperty(value = "timeAggregation", required = true) - private AggregationTypeEnum timeAggregation; - - /* - * List of dimension conditions. - */ - @JsonProperty(value = "dimensions") - private List dimensions; - - /* - * Allows creating an alert rule on a custom metric that isn't yet emitted, - * by causing the metric validation to be skipped. - */ - @JsonProperty(value = "skipMetricValidation") - private Boolean skipMetricValidation; - - /* - * The types of conditions for a multi resource alert. - */ - @JsonIgnore private Map additionalProperties; - - /** - * Get the name property: Name of the criteria. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Name of the criteria. - * - * @param name the name value to set. - * @return the MultiMetricCriteria object itself. - */ - public MultiMetricCriteria withName(String name) { - this.name = name; - return this; - } - - /** - * Get the metricName property: Name of the metric. - * - * @return the metricName value. - */ - public String metricName() { - return this.metricName; - } - - /** - * Set the metricName property: Name of the metric. - * - * @param metricName the metricName value to set. - * @return the MultiMetricCriteria object itself. - */ - public MultiMetricCriteria withMetricName(String metricName) { - this.metricName = metricName; - return this; - } - - /** - * Get the metricNamespace property: Namespace of the metric. - * - * @return the metricNamespace value. - */ - public String metricNamespace() { - return this.metricNamespace; - } - - /** - * Set the metricNamespace property: Namespace of the metric. - * - * @param metricNamespace the metricNamespace value to set. - * @return the MultiMetricCriteria object itself. - */ - public MultiMetricCriteria withMetricNamespace(String metricNamespace) { - this.metricNamespace = metricNamespace; - return this; - } - - /** - * Get the timeAggregation property: the criteria time aggregation types. - * - * @return the timeAggregation value. - */ - public AggregationTypeEnum timeAggregation() { - return this.timeAggregation; - } - - /** - * Set the timeAggregation property: the criteria time aggregation types. - * - * @param timeAggregation the timeAggregation value to set. - * @return the MultiMetricCriteria object itself. - */ - public MultiMetricCriteria withTimeAggregation(AggregationTypeEnum timeAggregation) { - this.timeAggregation = timeAggregation; - return this; - } - - /** - * Get the dimensions property: List of dimension conditions. - * - * @return the dimensions value. - */ - public List dimensions() { - return this.dimensions; - } - - /** - * Set the dimensions property: List of dimension conditions. - * - * @param dimensions the dimensions value to set. - * @return the MultiMetricCriteria object itself. - */ - public MultiMetricCriteria withDimensions(List dimensions) { - this.dimensions = dimensions; - return this; - } - - /** - * Get the skipMetricValidation property: Allows creating an alert rule on a custom metric that isn't yet emitted, - * by causing the metric validation to be skipped. - * - * @return the skipMetricValidation value. - */ - public Boolean skipMetricValidation() { - return this.skipMetricValidation; - } - - /** - * Set the skipMetricValidation property: Allows creating an alert rule on a custom metric that isn't yet emitted, - * by causing the metric validation to be skipped. - * - * @param skipMetricValidation the skipMetricValidation value to set. - * @return the MultiMetricCriteria object itself. - */ - public MultiMetricCriteria withSkipMetricValidation(Boolean skipMetricValidation) { - this.skipMetricValidation = skipMetricValidation; - return this; - } - - /** - * Get the additionalProperties property: The types of conditions for a multi resource alert. - * - * @return the additionalProperties value. - */ - @JsonAnyGetter - public Map additionalProperties() { - return this.additionalProperties; - } - - /** - * Set the additionalProperties property: The types of conditions for a multi resource alert. - * - * @param additionalProperties the additionalProperties value to set. - * @return the MultiMetricCriteria object itself. - */ - public MultiMetricCriteria withAdditionalProperties(Map additionalProperties) { - this.additionalProperties = additionalProperties; - return this; - } - - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property name in model MultiMetricCriteria")); - } - if (metricName() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property metricName in model MultiMetricCriteria")); - } - if (timeAggregation() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property timeAggregation in model MultiMetricCriteria")); - } - if (dimensions() != null) { - dimensions().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/NamespaceClassification.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/NamespaceClassification.java deleted file mode 100644 index 565aa30271ed..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/NamespaceClassification.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for NamespaceClassification. */ -public final class NamespaceClassification extends ExpandableStringEnum { - /** Static value Platform for NamespaceClassification. */ - public static final NamespaceClassification PLATFORM = fromString("Platform"); - - /** Static value Custom for NamespaceClassification. */ - public static final NamespaceClassification CUSTOM = fromString("Custom"); - - /** Static value Qos for NamespaceClassification. */ - public static final NamespaceClassification QOS = fromString("Qos"); - - /** - * Creates or finds a NamespaceClassification from its string representation. - * - * @param name a name to look for. - * @return the corresponding NamespaceClassification. - */ - @JsonCreator - public static NamespaceClassification fromString(String name) { - return fromString(name, NamespaceClassification.class); - } - - /** @return known NamespaceClassification values. */ - public static Collection values() { - return values(NamespaceClassification.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/NetworkRuleSet.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/NetworkRuleSet.java deleted file mode 100644 index 6f153af85005..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/NetworkRuleSet.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Definition of the network rules. */ -@Fluent -public class NetworkRuleSet { - @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkRuleSet.class); - - /* - * The configuration to set whether network access from public internet to - * the endpoints are allowed. - */ - @JsonProperty(value = "publicNetworkAccess") - private KnownPublicNetworkAccessOptions publicNetworkAccess; - - /** - * Get the publicNetworkAccess property: The configuration to set whether network access from public internet to the - * endpoints are allowed. - * - * @return the publicNetworkAccess value. - */ - public KnownPublicNetworkAccessOptions publicNetworkAccess() { - return this.publicNetworkAccess; - } - - /** - * Set the publicNetworkAccess property: The configuration to set whether network access from public internet to the - * endpoints are allowed. - * - * @param publicNetworkAccess the publicNetworkAccess value to set. - * @return the NetworkRuleSet object itself. - */ - public NetworkRuleSet withPublicNetworkAccess(KnownPublicNetworkAccessOptions publicNetworkAccess) { - this.publicNetworkAccess = publicNetworkAccess; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/Odatatype.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/Odatatype.java deleted file mode 100644 index ca9d4203bb7f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/Odatatype.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for Odatatype. */ -public final class Odatatype extends ExpandableStringEnum { - /** Static value Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria for Odatatype. */ - public static final Odatatype MICROSOFT_AZURE_MONITOR_SINGLE_RESOURCE_MULTIPLE_METRIC_CRITERIA = - fromString("Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria"); - - /** Static value Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria for Odatatype. */ - public static final Odatatype MICROSOFT_AZURE_MONITOR_MULTIPLE_RESOURCE_MULTIPLE_METRIC_CRITERIA = - fromString("Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria"); - - /** Static value Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria for Odatatype. */ - public static final Odatatype MICROSOFT_AZURE_MONITOR_WEBTEST_LOCATION_AVAILABILITY_CRITERIA = - fromString("Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria"); - - /** - * Creates or finds a Odatatype from its string representation. - * - * @param name a name to look for. - * @return the corresponding Odatatype. - */ - @JsonCreator - public static Odatatype fromString(String name) { - return fromString(name, Odatatype.class); - } - - /** @return known Odatatype values. */ - public static Collection values() { - return values(Odatatype.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/OnboardingStatus.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/OnboardingStatus.java deleted file mode 100644 index 5231663f369c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/OnboardingStatus.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for OnboardingStatus. */ -public final class OnboardingStatus extends ExpandableStringEnum { - /** Static value onboarded for OnboardingStatus. */ - public static final OnboardingStatus ONBOARDED = fromString("onboarded"); - - /** Static value notOnboarded for OnboardingStatus. */ - public static final OnboardingStatus NOT_ONBOARDED = fromString("notOnboarded"); - - /** Static value unknown for OnboardingStatus. */ - public static final OnboardingStatus UNKNOWN = fromString("unknown"); - - /** - * Creates or finds a OnboardingStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding OnboardingStatus. - */ - @JsonCreator - public static OnboardingStatus fromString(String name) { - return fromString(name, OnboardingStatus.class); - } - - /** @return known OnboardingStatus values. */ - public static Collection values() { - return values(OnboardingStatus.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/Operation.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/Operation.java deleted file mode 100644 index 76788741b8af..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/Operation.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Microsoft Insights API operation definition. */ -@Fluent -public final class Operation { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Operation.class); - - /* - * Operation name: {provider}/{resource}/{operation} - */ - @JsonProperty(value = "name") - private String name; - - /* - * Display metadata associated with the operation. - */ - @JsonProperty(value = "display") - private OperationDisplay display; - - /** - * Get the name property: Operation name: {provider}/{resource}/{operation}. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Operation name: {provider}/{resource}/{operation}. - * - * @param name the name value to set. - * @return the Operation object itself. - */ - public Operation withName(String name) { - this.name = name; - return this; - } - - /** - * Get the display property: Display metadata associated with the operation. - * - * @return the display value. - */ - public OperationDisplay display() { - return this.display; - } - - /** - * Set the display property: Display metadata associated with the operation. - * - * @param display the display value to set. - * @return the Operation object itself. - */ - public Operation withDisplay(OperationDisplay display) { - this.display = display; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (display() != null) { - display().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/OperationDisplay.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/OperationDisplay.java deleted file mode 100644 index 8328c93e9d2c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/OperationDisplay.java +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Display metadata associated with the operation. */ -@Fluent -public final class OperationDisplay { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationDisplay.class); - - /* - * Service provider: Microsoft.Insights - */ - @JsonProperty(value = "provider") - private String provider; - - /* - * Resource on which the operation is performed: AlertRules, Autoscale, - * etc. - */ - @JsonProperty(value = "resource") - private String resource; - - /* - * Operation type: Read, write, delete, etc. - */ - @JsonProperty(value = "operation") - private String operation; - - /** - * Get the provider property: Service provider: Microsoft.Insights. - * - * @return the provider value. - */ - public String provider() { - return this.provider; - } - - /** - * Set the provider property: Service provider: Microsoft.Insights. - * - * @param provider the provider value to set. - * @return the OperationDisplay object itself. - */ - public OperationDisplay withProvider(String provider) { - this.provider = provider; - return this; - } - - /** - * Get the resource property: Resource on which the operation is performed: AlertRules, Autoscale, etc. - * - * @return the resource value. - */ - public String resource() { - return this.resource; - } - - /** - * Set the resource property: Resource on which the operation is performed: AlertRules, Autoscale, etc. - * - * @param resource the resource value to set. - * @return the OperationDisplay object itself. - */ - public OperationDisplay withResource(String resource) { - this.resource = resource; - return this; - } - - /** - * Get the operation property: Operation type: Read, write, delete, etc. - * - * @return the operation value. - */ - public String operation() { - return this.operation; - } - - /** - * Set the operation property: Operation type: Read, write, delete, etc. - * - * @param operation the operation value to set. - * @return the OperationDisplay object itself. - */ - public OperationDisplay withOperation(String operation) { - this.operation = operation; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/Operator.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/Operator.java deleted file mode 100644 index 7fa4b7a9f139..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/Operator.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for Operator. */ -public final class Operator extends ExpandableStringEnum { - /** Static value Equals for Operator. */ - public static final Operator EQUALS = fromString("Equals"); - - /** Static value NotEquals for Operator. */ - public static final Operator NOT_EQUALS = fromString("NotEquals"); - - /** Static value GreaterThan for Operator. */ - public static final Operator GREATER_THAN = fromString("GreaterThan"); - - /** Static value GreaterThanOrEqual for Operator. */ - public static final Operator GREATER_THAN_OR_EQUAL = fromString("GreaterThanOrEqual"); - - /** Static value LessThan for Operator. */ - public static final Operator LESS_THAN = fromString("LessThan"); - - /** Static value LessThanOrEqual for Operator. */ - public static final Operator LESS_THAN_OR_EQUAL = fromString("LessThanOrEqual"); - - /** Static value Include for Operator. */ - public static final Operator INCLUDE = fromString("Include"); - - /** - * Creates or finds a Operator from its string representation. - * - * @param name a name to look for. - * @return the corresponding Operator. - */ - @JsonCreator - public static Operator fromString(String name) { - return fromString(name, Operator.class); - } - - /** @return known Operator values. */ - public static Collection values() { - return values(Operator.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/PerfCounterDataSource.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/PerfCounterDataSource.java deleted file mode 100644 index 1d8e43aa7a7b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/PerfCounterDataSource.java +++ /dev/null @@ -1,151 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** - * Definition of which performance counters will be collected and how they will be collected by this data collection - * rule. Collected from both Windows and Linux machines where the counter is present. - */ -@Fluent -public final class PerfCounterDataSource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PerfCounterDataSource.class); - - /* - * List of streams that this data source will be sent to. - * A stream indicates what schema will be used for this data and usually - * what table in Log Analytics the data will be sent to. - */ - @JsonProperty(value = "streams") - private List streams; - - /* - * The number of seconds between consecutive counter measurements - * (samples). - */ - @JsonProperty(value = "samplingFrequencyInSeconds") - private Integer samplingFrequencyInSeconds; - - /* - * A list of specifier names of the performance counters you want to - * collect. - * Use a wildcard (*) to collect a counter for all instances. - * To get a list of performance counters on Windows, run the command - * 'typeperf'. - */ - @JsonProperty(value = "counterSpecifiers") - private List counterSpecifiers; - - /* - * A friendly name for the data source. - * This name should be unique across all data sources (regardless of type) - * within the data collection rule. - */ - @JsonProperty(value = "name") - private String name; - - /** - * Get the streams property: List of streams that this data source will be sent to. A stream indicates what schema - * will be used for this data and usually what table in Log Analytics the data will be sent to. - * - * @return the streams value. - */ - public List streams() { - return this.streams; - } - - /** - * Set the streams property: List of streams that this data source will be sent to. A stream indicates what schema - * will be used for this data and usually what table in Log Analytics the data will be sent to. - * - * @param streams the streams value to set. - * @return the PerfCounterDataSource object itself. - */ - public PerfCounterDataSource withStreams(List streams) { - this.streams = streams; - return this; - } - - /** - * Get the samplingFrequencyInSeconds property: The number of seconds between consecutive counter measurements - * (samples). - * - * @return the samplingFrequencyInSeconds value. - */ - public Integer samplingFrequencyInSeconds() { - return this.samplingFrequencyInSeconds; - } - - /** - * Set the samplingFrequencyInSeconds property: The number of seconds between consecutive counter measurements - * (samples). - * - * @param samplingFrequencyInSeconds the samplingFrequencyInSeconds value to set. - * @return the PerfCounterDataSource object itself. - */ - public PerfCounterDataSource withSamplingFrequencyInSeconds(Integer samplingFrequencyInSeconds) { - this.samplingFrequencyInSeconds = samplingFrequencyInSeconds; - return this; - } - - /** - * Get the counterSpecifiers property: A list of specifier names of the performance counters you want to collect. - * Use a wildcard (*) to collect a counter for all instances. To get a list of performance counters on Windows, run - * the command 'typeperf'. - * - * @return the counterSpecifiers value. - */ - public List counterSpecifiers() { - return this.counterSpecifiers; - } - - /** - * Set the counterSpecifiers property: A list of specifier names of the performance counters you want to collect. - * Use a wildcard (*) to collect a counter for all instances. To get a list of performance counters on Windows, run - * the command 'typeperf'. - * - * @param counterSpecifiers the counterSpecifiers value to set. - * @return the PerfCounterDataSource object itself. - */ - public PerfCounterDataSource withCounterSpecifiers(List counterSpecifiers) { - this.counterSpecifiers = counterSpecifiers; - return this; - } - - /** - * Get the name property: A friendly name for the data source. This name should be unique across all data sources - * (regardless of type) within the data collection rule. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: A friendly name for the data source. This name should be unique across all data sources - * (regardless of type) within the data collection rule. - * - * @param name the name value to set. - * @return the PerfCounterDataSource object itself. - */ - public PerfCounterDataSource withName(String name) { - this.name = name; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/PrivateEndpointConnectionListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/PrivateEndpointConnectionListResult.java deleted file mode 100644 index 93c6c1f210b4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/PrivateEndpointConnectionListResult.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.fluent.models.PrivateEndpointConnectionInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** A list of private endpoint connections. */ -@Immutable -public final class PrivateEndpointConnectionListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionListResult.class); - - /* - * Array of results. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /* - * Link to retrieve next page of results. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: Array of results. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: Link to retrieve next page of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/PrivateEndpointProperty.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/PrivateEndpointProperty.java deleted file mode 100644 index c455648b2357..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/PrivateEndpointProperty.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Private endpoint which the connection belongs to. */ -@Fluent -public final class PrivateEndpointProperty { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointProperty.class); - - /* - * Resource id of the private endpoint. - */ - @JsonProperty(value = "id") - private String id; - - /** - * Get the id property: Resource id of the private endpoint. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: Resource id of the private endpoint. - * - * @param id the id value to set. - * @return the PrivateEndpointProperty object itself. - */ - public PrivateEndpointProperty withId(String id) { - this.id = id; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/PrivateLinkResourceListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/PrivateLinkResourceListResult.java deleted file mode 100644 index efefcac98563..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/PrivateLinkResourceListResult.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.fluent.models.PrivateLinkResourceInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** A list of private link resources. */ -@Immutable -public final class PrivateLinkResourceListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkResourceListResult.class); - - /* - * Array of results. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /* - * Link to retrieve next page of results. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: Array of results. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: Link to retrieve next page of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/PrivateLinkScopesResource.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/PrivateLinkScopesResource.java deleted file mode 100644 index 7cbd03dc6ad1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/PrivateLinkScopesResource.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import java.util.Map; - -/** An azure resource object. */ -@Fluent -public class PrivateLinkScopesResource extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkScopesResource.class); - - /** {@inheritDoc} */ - @Override - public PrivateLinkScopesResource withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public PrivateLinkScopesResource withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/PrivateLinkServiceConnectionStateProperty.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/PrivateLinkServiceConnectionStateProperty.java deleted file mode 100644 index 93467c78a2d4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/PrivateLinkServiceConnectionStateProperty.java +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** State of the private endpoint connection. */ -@Fluent -public final class PrivateLinkServiceConnectionStateProperty { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkServiceConnectionStateProperty.class); - - /* - * The private link service connection status. - */ - @JsonProperty(value = "status", required = true) - private String status; - - /* - * The private link service connection description. - */ - @JsonProperty(value = "description", required = true) - private String description; - - /* - * The actions required for private link service connection. - */ - @JsonProperty(value = "actionsRequired", access = JsonProperty.Access.WRITE_ONLY) - private String actionsRequired; - - /** - * Get the status property: The private link service connection status. - * - * @return the status value. - */ - public String status() { - return this.status; - } - - /** - * Set the status property: The private link service connection status. - * - * @param status the status value to set. - * @return the PrivateLinkServiceConnectionStateProperty object itself. - */ - public PrivateLinkServiceConnectionStateProperty withStatus(String status) { - this.status = status; - return this; - } - - /** - * Get the description property: The private link service connection description. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: The private link service connection description. - * - * @param description the description value to set. - * @return the PrivateLinkServiceConnectionStateProperty object itself. - */ - public PrivateLinkServiceConnectionStateProperty withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the actionsRequired property: The actions required for private link service connection. - * - * @return the actionsRequired value. - */ - public String actionsRequired() { - return this.actionsRequired; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (status() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property status in model PrivateLinkServiceConnectionStateProperty")); - } - if (description() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property description in model PrivateLinkServiceConnectionStateProperty")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ProvisioningState.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ProvisioningState.java deleted file mode 100644 index c52d0066aeb1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ProvisioningState.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ProvisioningState. */ -public final class ProvisioningState extends ExpandableStringEnum { - /** Static value Succeeded for ProvisioningState. */ - public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); - - /** Static value Deploying for ProvisioningState. */ - public static final ProvisioningState DEPLOYING = fromString("Deploying"); - - /** Static value Canceled for ProvisioningState. */ - public static final ProvisioningState CANCELED = fromString("Canceled"); - - /** Static value Failed for ProvisioningState. */ - public static final ProvisioningState FAILED = fromString("Failed"); - - /** - * Creates or finds a ProvisioningState from its string representation. - * - * @param name a name to look for. - * @return the corresponding ProvisioningState. - */ - @JsonCreator - public static ProvisioningState fromString(String name) { - return fromString(name, ProvisioningState.class); - } - - /** @return known ProvisioningState values. */ - public static Collection values() { - return values(ProvisioningState.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ProxyOnlyResource.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ProxyOnlyResource.java deleted file mode 100644 index c7550411dba0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ProxyOnlyResource.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; - -/** A proxy only azure resource object. */ -@Immutable -public class ProxyOnlyResource extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ProxyOnlyResource.class); - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/QueryType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/QueryType.java deleted file mode 100644 index 89a4c5b395b2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/QueryType.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for QueryType. */ -public final class QueryType extends ExpandableStringEnum { - /** Static value ResultCount for QueryType. */ - public static final QueryType RESULT_COUNT = fromString("ResultCount"); - - /** - * Creates or finds a QueryType from its string representation. - * - * @param name a name to look for. - * @return the corresponding QueryType. - */ - @JsonCreator - public static QueryType fromString(String name) { - return fromString(name, QueryType.class); - } - - /** @return known QueryType values. */ - public static Collection values() { - return values(QueryType.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ReceiverStatus.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ReceiverStatus.java deleted file mode 100644 index 5aca225a7ab6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ReceiverStatus.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for ReceiverStatus. */ -public enum ReceiverStatus { - /** Enum value NotSpecified. */ - NOT_SPECIFIED("NotSpecified"), - - /** Enum value Enabled. */ - ENABLED("Enabled"), - - /** Enum value Disabled. */ - DISABLED("Disabled"); - - /** The actual serialized value for a ReceiverStatus instance. */ - private final String value; - - ReceiverStatus(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a ReceiverStatus instance. - * - * @param value the serialized value to parse. - * @return the parsed ReceiverStatus object, or null if unable to parse. - */ - @JsonCreator - public static ReceiverStatus fromString(String value) { - ReceiverStatus[] items = ReceiverStatus.values(); - for (ReceiverStatus item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/Recurrence.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/Recurrence.java deleted file mode 100644 index 8d4a684dbcba..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/Recurrence.java +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The repeating times at which this profile begins. This element is not used if the FixedDate element is used. */ -@Fluent -public final class Recurrence { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Recurrence.class); - - /* - * the recurrence frequency. How often the schedule profile should take - * effect. This value must be Week, meaning each week will have the same - * set of profiles. For example, to set a daily schedule, set **schedule** - * to every day of the week. The frequency property specifies that the - * schedule is repeated weekly. - */ - @JsonProperty(value = "frequency", required = true) - private RecurrenceFrequency frequency; - - /* - * the scheduling constraints for when the profile begins. - */ - @JsonProperty(value = "schedule", required = true) - private RecurrentSchedule schedule; - - /** - * Get the frequency property: the recurrence frequency. How often the schedule profile should take effect. This - * value must be Week, meaning each week will have the same set of profiles. For example, to set a daily schedule, - * set **schedule** to every day of the week. The frequency property specifies that the schedule is repeated weekly. - * - * @return the frequency value. - */ - public RecurrenceFrequency frequency() { - return this.frequency; - } - - /** - * Set the frequency property: the recurrence frequency. How often the schedule profile should take effect. This - * value must be Week, meaning each week will have the same set of profiles. For example, to set a daily schedule, - * set **schedule** to every day of the week. The frequency property specifies that the schedule is repeated weekly. - * - * @param frequency the frequency value to set. - * @return the Recurrence object itself. - */ - public Recurrence withFrequency(RecurrenceFrequency frequency) { - this.frequency = frequency; - return this; - } - - /** - * Get the schedule property: the scheduling constraints for when the profile begins. - * - * @return the schedule value. - */ - public RecurrentSchedule schedule() { - return this.schedule; - } - - /** - * Set the schedule property: the scheduling constraints for when the profile begins. - * - * @param schedule the schedule value to set. - * @return the Recurrence object itself. - */ - public Recurrence withSchedule(RecurrentSchedule schedule) { - this.schedule = schedule; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (frequency() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property frequency in model Recurrence")); - } - if (schedule() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property schedule in model Recurrence")); - } else { - schedule().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/RecurrenceFrequency.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/RecurrenceFrequency.java deleted file mode 100644 index edaa655fe89a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/RecurrenceFrequency.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for RecurrenceFrequency. */ -public enum RecurrenceFrequency { - /** Enum value None. */ - NONE("None"), - - /** Enum value Second. */ - SECOND("Second"), - - /** Enum value Minute. */ - MINUTE("Minute"), - - /** Enum value Hour. */ - HOUR("Hour"), - - /** Enum value Day. */ - DAY("Day"), - - /** Enum value Week. */ - WEEK("Week"), - - /** Enum value Month. */ - MONTH("Month"), - - /** Enum value Year. */ - YEAR("Year"); - - /** The actual serialized value for a RecurrenceFrequency instance. */ - private final String value; - - RecurrenceFrequency(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a RecurrenceFrequency instance. - * - * @param value the serialized value to parse. - * @return the parsed RecurrenceFrequency object, or null if unable to parse. - */ - @JsonCreator - public static RecurrenceFrequency fromString(String value) { - RecurrenceFrequency[] items = RecurrenceFrequency.values(); - for (RecurrenceFrequency item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/RecurrentSchedule.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/RecurrentSchedule.java deleted file mode 100644 index 7b917e04d963..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/RecurrentSchedule.java +++ /dev/null @@ -1,241 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The scheduling constraints for when the profile begins. */ -@Fluent -public final class RecurrentSchedule { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RecurrentSchedule.class); - - /* - * the timezone for the hours of the profile. Some examples of valid time - * zones are: Dateline Standard Time, UTC-11, Hawaiian Standard Time, - * Alaskan Standard Time, Pacific Standard Time (Mexico), Pacific Standard - * Time, US Mountain Standard Time, Mountain Standard Time (Mexico), - * Mountain Standard Time, Central America Standard Time, Central Standard - * Time, Central Standard Time (Mexico), Canada Central Standard Time, SA - * Pacific Standard Time, Eastern Standard Time, US Eastern Standard Time, - * Venezuela Standard Time, Paraguay Standard Time, Atlantic Standard Time, - * Central Brazilian Standard Time, SA Western Standard Time, Pacific SA - * Standard Time, Newfoundland Standard Time, E. South America Standard - * Time, Argentina Standard Time, SA Eastern Standard Time, Greenland - * Standard Time, Montevideo Standard Time, Bahia Standard Time, UTC-02, - * Mid-Atlantic Standard Time, Azores Standard Time, Cape Verde Standard - * Time, Morocco Standard Time, UTC, GMT Standard Time, Greenwich Standard - * Time, W. Europe Standard Time, Central Europe Standard Time, Romance - * Standard Time, Central European Standard Time, W. Central Africa - * Standard Time, Namibia Standard Time, Jordan Standard Time, GTB Standard - * Time, Middle East Standard Time, Egypt Standard Time, Syria Standard - * Time, E. Europe Standard Time, South Africa Standard Time, FLE Standard - * Time, Turkey Standard Time, Israel Standard Time, Kaliningrad Standard - * Time, Libya Standard Time, Arabic Standard Time, Arab Standard Time, - * Belarus Standard Time, Russian Standard Time, E. Africa Standard Time, - * Iran Standard Time, Arabian Standard Time, Azerbaijan Standard Time, - * Russia Time Zone 3, Mauritius Standard Time, Georgian Standard Time, - * Caucasus Standard Time, Afghanistan Standard Time, West Asia Standard - * Time, Ekaterinburg Standard Time, Pakistan Standard Time, India Standard - * Time, Sri Lanka Standard Time, Nepal Standard Time, Central Asia - * Standard Time, Bangladesh Standard Time, N. Central Asia Standard Time, - * Myanmar Standard Time, SE Asia Standard Time, North Asia Standard Time, - * China Standard Time, North Asia East Standard Time, Singapore Standard - * Time, W. Australia Standard Time, Taipei Standard Time, Ulaanbaatar - * Standard Time, Tokyo Standard Time, Korea Standard Time, Yakutsk - * Standard Time, Cen. Australia Standard Time, AUS Central Standard Time, - * E. Australia Standard Time, AUS Eastern Standard Time, West Pacific - * Standard Time, Tasmania Standard Time, Magadan Standard Time, - * Vladivostok Standard Time, Russia Time Zone 10, Central Pacific Standard - * Time, Russia Time Zone 11, New Zealand Standard Time, UTC+12, Fiji - * Standard Time, Kamchatka Standard Time, Tonga Standard Time, Samoa - * Standard Time, Line Islands Standard Time - */ - @JsonProperty(value = "timeZone", required = true) - private String timeZone; - - /* - * the collection of days that the profile takes effect on. Possible values - * are Sunday through Saturday. - */ - @JsonProperty(value = "days", required = true) - private List days; - - /* - * A collection of hours that the profile takes effect on. Values supported - * are 0 to 23 on the 24-hour clock (AM/PM times are not supported). - */ - @JsonProperty(value = "hours", required = true) - private List hours; - - /* - * A collection of minutes at which the profile takes effect at. - */ - @JsonProperty(value = "minutes", required = true) - private List minutes; - - /** - * Get the timeZone property: the timezone for the hours of the profile. Some examples of valid time zones are: - * Dateline Standard Time, UTC-11, Hawaiian Standard Time, Alaskan Standard Time, Pacific Standard Time (Mexico), - * Pacific Standard Time, US Mountain Standard Time, Mountain Standard Time (Mexico), Mountain Standard Time, - * Central America Standard Time, Central Standard Time, Central Standard Time (Mexico), Canada Central Standard - * Time, SA Pacific Standard Time, Eastern Standard Time, US Eastern Standard Time, Venezuela Standard Time, - * Paraguay Standard Time, Atlantic Standard Time, Central Brazilian Standard Time, SA Western Standard Time, - * Pacific SA Standard Time, Newfoundland Standard Time, E. South America Standard Time, Argentina Standard Time, SA - * Eastern Standard Time, Greenland Standard Time, Montevideo Standard Time, Bahia Standard Time, UTC-02, - * Mid-Atlantic Standard Time, Azores Standard Time, Cape Verde Standard Time, Morocco Standard Time, UTC, GMT - * Standard Time, Greenwich Standard Time, W. Europe Standard Time, Central Europe Standard Time, Romance Standard - * Time, Central European Standard Time, W. Central Africa Standard Time, Namibia Standard Time, Jordan Standard - * Time, GTB Standard Time, Middle East Standard Time, Egypt Standard Time, Syria Standard Time, E. Europe Standard - * Time, South Africa Standard Time, FLE Standard Time, Turkey Standard Time, Israel Standard Time, Kaliningrad - * Standard Time, Libya Standard Time, Arabic Standard Time, Arab Standard Time, Belarus Standard Time, Russian - * Standard Time, E. Africa Standard Time, Iran Standard Time, Arabian Standard Time, Azerbaijan Standard Time, - * Russia Time Zone 3, Mauritius Standard Time, Georgian Standard Time, Caucasus Standard Time, Afghanistan Standard - * Time, West Asia Standard Time, Ekaterinburg Standard Time, Pakistan Standard Time, India Standard Time, Sri Lanka - * Standard Time, Nepal Standard Time, Central Asia Standard Time, Bangladesh Standard Time, N. Central Asia - * Standard Time, Myanmar Standard Time, SE Asia Standard Time, North Asia Standard Time, China Standard Time, North - * Asia East Standard Time, Singapore Standard Time, W. Australia Standard Time, Taipei Standard Time, Ulaanbaatar - * Standard Time, Tokyo Standard Time, Korea Standard Time, Yakutsk Standard Time, Cen. Australia Standard Time, AUS - * Central Standard Time, E. Australia Standard Time, AUS Eastern Standard Time, West Pacific Standard Time, - * Tasmania Standard Time, Magadan Standard Time, Vladivostok Standard Time, Russia Time Zone 10, Central Pacific - * Standard Time, Russia Time Zone 11, New Zealand Standard Time, UTC+12, Fiji Standard Time, Kamchatka Standard - * Time, Tonga Standard Time, Samoa Standard Time, Line Islands Standard Time. - * - * @return the timeZone value. - */ - public String timeZone() { - return this.timeZone; - } - - /** - * Set the timeZone property: the timezone for the hours of the profile. Some examples of valid time zones are: - * Dateline Standard Time, UTC-11, Hawaiian Standard Time, Alaskan Standard Time, Pacific Standard Time (Mexico), - * Pacific Standard Time, US Mountain Standard Time, Mountain Standard Time (Mexico), Mountain Standard Time, - * Central America Standard Time, Central Standard Time, Central Standard Time (Mexico), Canada Central Standard - * Time, SA Pacific Standard Time, Eastern Standard Time, US Eastern Standard Time, Venezuela Standard Time, - * Paraguay Standard Time, Atlantic Standard Time, Central Brazilian Standard Time, SA Western Standard Time, - * Pacific SA Standard Time, Newfoundland Standard Time, E. South America Standard Time, Argentina Standard Time, SA - * Eastern Standard Time, Greenland Standard Time, Montevideo Standard Time, Bahia Standard Time, UTC-02, - * Mid-Atlantic Standard Time, Azores Standard Time, Cape Verde Standard Time, Morocco Standard Time, UTC, GMT - * Standard Time, Greenwich Standard Time, W. Europe Standard Time, Central Europe Standard Time, Romance Standard - * Time, Central European Standard Time, W. Central Africa Standard Time, Namibia Standard Time, Jordan Standard - * Time, GTB Standard Time, Middle East Standard Time, Egypt Standard Time, Syria Standard Time, E. Europe Standard - * Time, South Africa Standard Time, FLE Standard Time, Turkey Standard Time, Israel Standard Time, Kaliningrad - * Standard Time, Libya Standard Time, Arabic Standard Time, Arab Standard Time, Belarus Standard Time, Russian - * Standard Time, E. Africa Standard Time, Iran Standard Time, Arabian Standard Time, Azerbaijan Standard Time, - * Russia Time Zone 3, Mauritius Standard Time, Georgian Standard Time, Caucasus Standard Time, Afghanistan Standard - * Time, West Asia Standard Time, Ekaterinburg Standard Time, Pakistan Standard Time, India Standard Time, Sri Lanka - * Standard Time, Nepal Standard Time, Central Asia Standard Time, Bangladesh Standard Time, N. Central Asia - * Standard Time, Myanmar Standard Time, SE Asia Standard Time, North Asia Standard Time, China Standard Time, North - * Asia East Standard Time, Singapore Standard Time, W. Australia Standard Time, Taipei Standard Time, Ulaanbaatar - * Standard Time, Tokyo Standard Time, Korea Standard Time, Yakutsk Standard Time, Cen. Australia Standard Time, AUS - * Central Standard Time, E. Australia Standard Time, AUS Eastern Standard Time, West Pacific Standard Time, - * Tasmania Standard Time, Magadan Standard Time, Vladivostok Standard Time, Russia Time Zone 10, Central Pacific - * Standard Time, Russia Time Zone 11, New Zealand Standard Time, UTC+12, Fiji Standard Time, Kamchatka Standard - * Time, Tonga Standard Time, Samoa Standard Time, Line Islands Standard Time. - * - * @param timeZone the timeZone value to set. - * @return the RecurrentSchedule object itself. - */ - public RecurrentSchedule withTimeZone(String timeZone) { - this.timeZone = timeZone; - return this; - } - - /** - * Get the days property: the collection of days that the profile takes effect on. Possible values are Sunday - * through Saturday. - * - * @return the days value. - */ - public List days() { - return this.days; - } - - /** - * Set the days property: the collection of days that the profile takes effect on. Possible values are Sunday - * through Saturday. - * - * @param days the days value to set. - * @return the RecurrentSchedule object itself. - */ - public RecurrentSchedule withDays(List days) { - this.days = days; - return this; - } - - /** - * Get the hours property: A collection of hours that the profile takes effect on. Values supported are 0 to 23 on - * the 24-hour clock (AM/PM times are not supported). - * - * @return the hours value. - */ - public List hours() { - return this.hours; - } - - /** - * Set the hours property: A collection of hours that the profile takes effect on. Values supported are 0 to 23 on - * the 24-hour clock (AM/PM times are not supported). - * - * @param hours the hours value to set. - * @return the RecurrentSchedule object itself. - */ - public RecurrentSchedule withHours(List hours) { - this.hours = hours; - return this; - } - - /** - * Get the minutes property: A collection of minutes at which the profile takes effect at. - * - * @return the minutes value. - */ - public List minutes() { - return this.minutes; - } - - /** - * Set the minutes property: A collection of minutes at which the profile takes effect at. - * - * @param minutes the minutes value to set. - * @return the RecurrentSchedule object itself. - */ - public RecurrentSchedule withMinutes(List minutes) { - this.minutes = minutes; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (timeZone() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property timeZone in model RecurrentSchedule")); - } - if (days() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property days in model RecurrentSchedule")); - } - if (hours() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property hours in model RecurrentSchedule")); - } - if (minutes() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property minutes in model RecurrentSchedule")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ResourceAutoGenerated2.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ResourceAutoGenerated2.java deleted file mode 100644 index 3a6b96b02481..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ResourceAutoGenerated2.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import java.util.Map; - -/** An azure resource object. */ -@Fluent -public class ResourceAutoGenerated2 extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceAutoGenerated2.class); - - /** {@inheritDoc} */ - @Override - public ResourceAutoGenerated2 withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public ResourceAutoGenerated2 withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ResourceForUpdate.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ResourceForUpdate.java deleted file mode 100644 index 755b4791c8c5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ResourceForUpdate.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** Definition of ARM tracked top level resource properties for update operation. */ -@Fluent -public final class ResourceForUpdate { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceForUpdate.class); - - /* - * Resource tags. - */ - @JsonProperty(value = "tags") - private Map tags; - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Resource tags. - * - * @param tags the tags value to set. - * @return the ResourceForUpdate object itself. - */ - public ResourceForUpdate withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ResultType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ResultType.java deleted file mode 100644 index f5a55100336a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ResultType.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for ResultType. */ -public enum ResultType { - /** Enum value Data. */ - DATA("Data"), - - /** Enum value Metadata. */ - METADATA("Metadata"); - - /** The actual serialized value for a ResultType instance. */ - private final String value; - - ResultType(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a ResultType instance. - * - * @param value the serialized value to parse. - * @return the parsed ResultType object, or null if unable to parse. - */ - @JsonCreator - public static ResultType fromString(String value) { - ResultType[] items = ResultType.values(); - for (ResultType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/RetentionPolicy.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/RetentionPolicy.java deleted file mode 100644 index 10559c727382..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/RetentionPolicy.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Specifies the retention policy for the log. */ -@Fluent -public final class RetentionPolicy { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RetentionPolicy.class); - - /* - * a value indicating whether the retention policy is enabled. - */ - @JsonProperty(value = "enabled", required = true) - private boolean enabled; - - /* - * the number of days for the retention in days. A value of 0 will retain - * the events indefinitely. - */ - @JsonProperty(value = "days", required = true) - private int days; - - /** - * Get the enabled property: a value indicating whether the retention policy is enabled. - * - * @return the enabled value. - */ - public boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: a value indicating whether the retention policy is enabled. - * - * @param enabled the enabled value to set. - * @return the RetentionPolicy object itself. - */ - public RetentionPolicy withEnabled(boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the days property: the number of days for the retention in days. A value of 0 will retain the events - * indefinitely. - * - * @return the days value. - */ - public int days() { - return this.days; - } - - /** - * Set the days property: the number of days for the retention in days. A value of 0 will retain the events - * indefinitely. - * - * @param days the days value to set. - * @return the RetentionPolicy object itself. - */ - public RetentionPolicy withDays(int days) { - this.days = days; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/RuleAction.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/RuleAction.java deleted file mode 100644 index 2d11333d3e84..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/RuleAction.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** The action that is performed when the alert rule becomes active, and when an alert condition is resolved. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "odata\\.type", - defaultImpl = RuleAction.class) -@JsonTypeName("RuleAction") -@JsonSubTypes({ - @JsonSubTypes.Type( - name = "Microsoft.Azure.Management.Insights.Models.RuleEmailAction", - value = RuleEmailAction.class), - @JsonSubTypes.Type( - name = "Microsoft.Azure.Management.Insights.Models.RuleWebhookAction", - value = RuleWebhookAction.class) -}) -@JsonFlatten -@Immutable -public class RuleAction { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RuleAction.class); - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/RuleCondition.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/RuleCondition.java deleted file mode 100644 index c92f3dc3066e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/RuleCondition.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** The condition that results in the alert rule being activated. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "odata\\.type", - defaultImpl = RuleCondition.class) -@JsonTypeName("RuleCondition") -@JsonSubTypes({ - @JsonSubTypes.Type( - name = "Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition", - value = ThresholdRuleCondition.class), - @JsonSubTypes.Type( - name = "Microsoft.Azure.Management.Insights.Models.LocationThresholdRuleCondition", - value = LocationThresholdRuleCondition.class), - @JsonSubTypes.Type( - name = "Microsoft.Azure.Management.Insights.Models.ManagementEventRuleCondition", - value = ManagementEventRuleCondition.class) -}) -@JsonFlatten -@Fluent -public class RuleCondition { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RuleCondition.class); - - /* - * the resource from which the rule collects its data. For this type - * dataSource will always be of type RuleMetricDataSource. - */ - @JsonProperty(value = "dataSource") - private RuleDataSource dataSource; - - /** - * Get the dataSource property: the resource from which the rule collects its data. For this type dataSource will - * always be of type RuleMetricDataSource. - * - * @return the dataSource value. - */ - public RuleDataSource dataSource() { - return this.dataSource; - } - - /** - * Set the dataSource property: the resource from which the rule collects its data. For this type dataSource will - * always be of type RuleMetricDataSource. - * - * @param dataSource the dataSource value to set. - * @return the RuleCondition object itself. - */ - public RuleCondition withDataSource(RuleDataSource dataSource) { - this.dataSource = dataSource; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (dataSource() != null) { - dataSource().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/RuleDataSource.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/RuleDataSource.java deleted file mode 100644 index 88a0dce3b65a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/RuleDataSource.java +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** The resource from which the rule collects its data. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "odata\\.type", - defaultImpl = RuleDataSource.class) -@JsonTypeName("RuleDataSource") -@JsonSubTypes({ - @JsonSubTypes.Type( - name = "Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource", - value = RuleMetricDataSource.class), - @JsonSubTypes.Type( - name = "Microsoft.Azure.Management.Insights.Models.RuleManagementEventDataSource", - value = RuleManagementEventDataSource.class) -}) -@JsonFlatten -@Fluent -public class RuleDataSource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RuleDataSource.class); - - /* - * the resource identifier of the resource the rule monitors. **NOTE**: - * this property cannot be updated for an existing rule. - */ - @JsonProperty(value = "resourceUri") - private String resourceUri; - - /* - * the legacy resource identifier of the resource the rule monitors. - * **NOTE**: this property cannot be updated for an existing rule. - */ - @JsonProperty(value = "legacyResourceId") - private String legacyResourceId; - - /* - * the location of the resource. - */ - @JsonProperty(value = "resourceLocation") - private String resourceLocation; - - /* - * the namespace of the metric. - */ - @JsonProperty(value = "metricNamespace") - private String metricNamespace; - - /** - * Get the resourceUri property: the resource identifier of the resource the rule monitors. **NOTE**: this property - * cannot be updated for an existing rule. - * - * @return the resourceUri value. - */ - public String resourceUri() { - return this.resourceUri; - } - - /** - * Set the resourceUri property: the resource identifier of the resource the rule monitors. **NOTE**: this property - * cannot be updated for an existing rule. - * - * @param resourceUri the resourceUri value to set. - * @return the RuleDataSource object itself. - */ - public RuleDataSource withResourceUri(String resourceUri) { - this.resourceUri = resourceUri; - return this; - } - - /** - * Get the legacyResourceId property: the legacy resource identifier of the resource the rule monitors. **NOTE**: - * this property cannot be updated for an existing rule. - * - * @return the legacyResourceId value. - */ - public String legacyResourceId() { - return this.legacyResourceId; - } - - /** - * Set the legacyResourceId property: the legacy resource identifier of the resource the rule monitors. **NOTE**: - * this property cannot be updated for an existing rule. - * - * @param legacyResourceId the legacyResourceId value to set. - * @return the RuleDataSource object itself. - */ - public RuleDataSource withLegacyResourceId(String legacyResourceId) { - this.legacyResourceId = legacyResourceId; - return this; - } - - /** - * Get the resourceLocation property: the location of the resource. - * - * @return the resourceLocation value. - */ - public String resourceLocation() { - return this.resourceLocation; - } - - /** - * Set the resourceLocation property: the location of the resource. - * - * @param resourceLocation the resourceLocation value to set. - * @return the RuleDataSource object itself. - */ - public RuleDataSource withResourceLocation(String resourceLocation) { - this.resourceLocation = resourceLocation; - return this; - } - - /** - * Get the metricNamespace property: the namespace of the metric. - * - * @return the metricNamespace value. - */ - public String metricNamespace() { - return this.metricNamespace; - } - - /** - * Set the metricNamespace property: the namespace of the metric. - * - * @param metricNamespace the metricNamespace value to set. - * @return the RuleDataSource object itself. - */ - public RuleDataSource withMetricNamespace(String metricNamespace) { - this.metricNamespace = metricNamespace; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/RuleEmailAction.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/RuleEmailAction.java deleted file mode 100644 index 58c545859f4e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/RuleEmailAction.java +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.util.List; - -/** - * Specifies the action to send email when the rule condition is evaluated. The discriminator is always RuleEmailAction - * in this case. - */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "odata\\.type") -@JsonTypeName("Microsoft.Azure.Management.Insights.Models.RuleEmailAction") -@JsonFlatten -@Fluent -public class RuleEmailAction extends RuleAction { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RuleEmailAction.class); - - /* - * Whether the administrators (service and co-administrators) of the - * service should be notified when the alert is activated. - */ - @JsonProperty(value = "sendToServiceOwners") - private Boolean sendToServiceOwners; - - /* - * the list of administrator's custom email addresses to notify of the - * activation of the alert. - */ - @JsonProperty(value = "customEmails") - private List customEmails; - - /** - * Get the sendToServiceOwners property: Whether the administrators (service and co-administrators) of the service - * should be notified when the alert is activated. - * - * @return the sendToServiceOwners value. - */ - public Boolean sendToServiceOwners() { - return this.sendToServiceOwners; - } - - /** - * Set the sendToServiceOwners property: Whether the administrators (service and co-administrators) of the service - * should be notified when the alert is activated. - * - * @param sendToServiceOwners the sendToServiceOwners value to set. - * @return the RuleEmailAction object itself. - */ - public RuleEmailAction withSendToServiceOwners(Boolean sendToServiceOwners) { - this.sendToServiceOwners = sendToServiceOwners; - return this; - } - - /** - * Get the customEmails property: the list of administrator's custom email addresses to notify of the activation of - * the alert. - * - * @return the customEmails value. - */ - public List customEmails() { - return this.customEmails; - } - - /** - * Set the customEmails property: the list of administrator's custom email addresses to notify of the activation of - * the alert. - * - * @param customEmails the customEmails value to set. - * @return the RuleEmailAction object itself. - */ - public RuleEmailAction withCustomEmails(List customEmails) { - this.customEmails = customEmails; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/RuleManagementEventClaimsDataSource.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/RuleManagementEventClaimsDataSource.java deleted file mode 100644 index ade8ca780270..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/RuleManagementEventClaimsDataSource.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The claims for a rule management event data source. */ -@Fluent -public final class RuleManagementEventClaimsDataSource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RuleManagementEventClaimsDataSource.class); - - /* - * the email address. - */ - @JsonProperty(value = "emailAddress") - private String emailAddress; - - /** - * Get the emailAddress property: the email address. - * - * @return the emailAddress value. - */ - public String emailAddress() { - return this.emailAddress; - } - - /** - * Set the emailAddress property: the email address. - * - * @param emailAddress the emailAddress value to set. - * @return the RuleManagementEventClaimsDataSource object itself. - */ - public RuleManagementEventClaimsDataSource withEmailAddress(String emailAddress) { - this.emailAddress = emailAddress; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/RuleManagementEventDataSource.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/RuleManagementEventDataSource.java deleted file mode 100644 index 85c2c6bbeeb0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/RuleManagementEventDataSource.java +++ /dev/null @@ -1,305 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** - * A rule management event data source. The discriminator fields is always RuleManagementEventDataSource in this case. - */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "odata\\.type") -@JsonTypeName("Microsoft.Azure.Management.Insights.Models.RuleManagementEventDataSource") -@JsonFlatten -@Fluent -public class RuleManagementEventDataSource extends RuleDataSource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RuleManagementEventDataSource.class); - - /* - * the event name. - */ - @JsonProperty(value = "eventName") - private String eventName; - - /* - * the event source. - */ - @JsonProperty(value = "eventSource") - private String eventSource; - - /* - * the level. - */ - @JsonProperty(value = "level") - private String level; - - /* - * The name of the operation that should be checked for. If no name is - * provided, any operation will match. - */ - @JsonProperty(value = "operationName") - private String operationName; - - /* - * the resource group name. - */ - @JsonProperty(value = "resourceGroupName") - private String resourceGroupName; - - /* - * the resource provider name. - */ - @JsonProperty(value = "resourceProviderName") - private String resourceProviderName; - - /* - * The status of the operation that should be checked for. If no status is - * provided, any status will match. - */ - @JsonProperty(value = "status") - private String status; - - /* - * the substatus. - */ - @JsonProperty(value = "subStatus") - private String subStatus; - - /* - * the claims. - */ - @JsonProperty(value = "claims") - private RuleManagementEventClaimsDataSource claims; - - /** - * Get the eventName property: the event name. - * - * @return the eventName value. - */ - public String eventName() { - return this.eventName; - } - - /** - * Set the eventName property: the event name. - * - * @param eventName the eventName value to set. - * @return the RuleManagementEventDataSource object itself. - */ - public RuleManagementEventDataSource withEventName(String eventName) { - this.eventName = eventName; - return this; - } - - /** - * Get the eventSource property: the event source. - * - * @return the eventSource value. - */ - public String eventSource() { - return this.eventSource; - } - - /** - * Set the eventSource property: the event source. - * - * @param eventSource the eventSource value to set. - * @return the RuleManagementEventDataSource object itself. - */ - public RuleManagementEventDataSource withEventSource(String eventSource) { - this.eventSource = eventSource; - return this; - } - - /** - * Get the level property: the level. - * - * @return the level value. - */ - public String level() { - return this.level; - } - - /** - * Set the level property: the level. - * - * @param level the level value to set. - * @return the RuleManagementEventDataSource object itself. - */ - public RuleManagementEventDataSource withLevel(String level) { - this.level = level; - return this; - } - - /** - * Get the operationName property: The name of the operation that should be checked for. If no name is provided, any - * operation will match. - * - * @return the operationName value. - */ - public String operationName() { - return this.operationName; - } - - /** - * Set the operationName property: The name of the operation that should be checked for. If no name is provided, any - * operation will match. - * - * @param operationName the operationName value to set. - * @return the RuleManagementEventDataSource object itself. - */ - public RuleManagementEventDataSource withOperationName(String operationName) { - this.operationName = operationName; - return this; - } - - /** - * Get the resourceGroupName property: the resource group name. - * - * @return the resourceGroupName value. - */ - public String resourceGroupName() { - return this.resourceGroupName; - } - - /** - * Set the resourceGroupName property: the resource group name. - * - * @param resourceGroupName the resourceGroupName value to set. - * @return the RuleManagementEventDataSource object itself. - */ - public RuleManagementEventDataSource withResourceGroupName(String resourceGroupName) { - this.resourceGroupName = resourceGroupName; - return this; - } - - /** - * Get the resourceProviderName property: the resource provider name. - * - * @return the resourceProviderName value. - */ - public String resourceProviderName() { - return this.resourceProviderName; - } - - /** - * Set the resourceProviderName property: the resource provider name. - * - * @param resourceProviderName the resourceProviderName value to set. - * @return the RuleManagementEventDataSource object itself. - */ - public RuleManagementEventDataSource withResourceProviderName(String resourceProviderName) { - this.resourceProviderName = resourceProviderName; - return this; - } - - /** - * Get the status property: The status of the operation that should be checked for. If no status is provided, any - * status will match. - * - * @return the status value. - */ - public String status() { - return this.status; - } - - /** - * Set the status property: The status of the operation that should be checked for. If no status is provided, any - * status will match. - * - * @param status the status value to set. - * @return the RuleManagementEventDataSource object itself. - */ - public RuleManagementEventDataSource withStatus(String status) { - this.status = status; - return this; - } - - /** - * Get the subStatus property: the substatus. - * - * @return the subStatus value. - */ - public String subStatus() { - return this.subStatus; - } - - /** - * Set the subStatus property: the substatus. - * - * @param subStatus the subStatus value to set. - * @return the RuleManagementEventDataSource object itself. - */ - public RuleManagementEventDataSource withSubStatus(String subStatus) { - this.subStatus = subStatus; - return this; - } - - /** - * Get the claims property: the claims. - * - * @return the claims value. - */ - public RuleManagementEventClaimsDataSource claims() { - return this.claims; - } - - /** - * Set the claims property: the claims. - * - * @param claims the claims value to set. - * @return the RuleManagementEventDataSource object itself. - */ - public RuleManagementEventDataSource withClaims(RuleManagementEventClaimsDataSource claims) { - this.claims = claims; - return this; - } - - /** {@inheritDoc} */ - @Override - public RuleManagementEventDataSource withResourceUri(String resourceUri) { - super.withResourceUri(resourceUri); - return this; - } - - /** {@inheritDoc} */ - @Override - public RuleManagementEventDataSource withLegacyResourceId(String legacyResourceId) { - super.withLegacyResourceId(legacyResourceId); - return this; - } - - /** {@inheritDoc} */ - @Override - public RuleManagementEventDataSource withResourceLocation(String resourceLocation) { - super.withResourceLocation(resourceLocation); - return this; - } - - /** {@inheritDoc} */ - @Override - public RuleManagementEventDataSource withMetricNamespace(String metricNamespace) { - super.withMetricNamespace(metricNamespace); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (claims() != null) { - claims().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/RuleMetricDataSource.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/RuleMetricDataSource.java deleted file mode 100644 index cc0d63994692..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/RuleMetricDataSource.java +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** A rule metric data source. The discriminator value is always RuleMetricDataSource in this case. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "odata\\.type") -@JsonTypeName("Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource") -@JsonFlatten -@Fluent -public class RuleMetricDataSource extends RuleDataSource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RuleMetricDataSource.class); - - /* - * the name of the metric that defines what the rule monitors. - */ - @JsonProperty(value = "metricName") - private String metricName; - - /** - * Get the metricName property: the name of the metric that defines what the rule monitors. - * - * @return the metricName value. - */ - public String metricName() { - return this.metricName; - } - - /** - * Set the metricName property: the name of the metric that defines what the rule monitors. - * - * @param metricName the metricName value to set. - * @return the RuleMetricDataSource object itself. - */ - public RuleMetricDataSource withMetricName(String metricName) { - this.metricName = metricName; - return this; - } - - /** {@inheritDoc} */ - @Override - public RuleMetricDataSource withResourceUri(String resourceUri) { - super.withResourceUri(resourceUri); - return this; - } - - /** {@inheritDoc} */ - @Override - public RuleMetricDataSource withLegacyResourceId(String legacyResourceId) { - super.withLegacyResourceId(legacyResourceId); - return this; - } - - /** {@inheritDoc} */ - @Override - public RuleMetricDataSource withResourceLocation(String resourceLocation) { - super.withResourceLocation(resourceLocation); - return this; - } - - /** {@inheritDoc} */ - @Override - public RuleMetricDataSource withMetricNamespace(String metricNamespace) { - super.withMetricNamespace(metricNamespace); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/RuleWebhookAction.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/RuleWebhookAction.java deleted file mode 100644 index 53f6c744aa4a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/RuleWebhookAction.java +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.util.Map; - -/** - * Specifies the action to post to service when the rule condition is evaluated. The discriminator is always - * RuleWebhookAction in this case. - */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "odata\\.type") -@JsonTypeName("Microsoft.Azure.Management.Insights.Models.RuleWebhookAction") -@JsonFlatten -@Fluent -public class RuleWebhookAction extends RuleAction { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RuleWebhookAction.class); - - /* - * the service uri to Post the notification when the alert activates or - * resolves. - */ - @JsonProperty(value = "serviceUri") - private String serviceUri; - - /* - * the dictionary of custom properties to include with the post operation. - * These data are appended to the webhook payload. - */ - @JsonProperty(value = "properties") - private Map properties; - - /** - * Get the serviceUri property: the service uri to Post the notification when the alert activates or resolves. - * - * @return the serviceUri value. - */ - public String serviceUri() { - return this.serviceUri; - } - - /** - * Set the serviceUri property: the service uri to Post the notification when the alert activates or resolves. - * - * @param serviceUri the serviceUri value to set. - * @return the RuleWebhookAction object itself. - */ - public RuleWebhookAction withServiceUri(String serviceUri) { - this.serviceUri = serviceUri; - return this; - } - - /** - * Get the properties property: the dictionary of custom properties to include with the post operation. These data - * are appended to the webhook payload. - * - * @return the properties value. - */ - public Map properties() { - return this.properties; - } - - /** - * Set the properties property: the dictionary of custom properties to include with the post operation. These data - * are appended to the webhook payload. - * - * @param properties the properties value to set. - * @return the RuleWebhookAction object itself. - */ - public RuleWebhookAction withProperties(Map properties) { - this.properties = properties; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ScaleAction.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ScaleAction.java deleted file mode 100644 index d6db1d784ac8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ScaleAction.java +++ /dev/null @@ -1,154 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.Duration; - -/** The parameters for the scaling action. */ -@Fluent -public final class ScaleAction { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ScaleAction.class); - - /* - * the scale direction. Whether the scaling action increases or decreases - * the number of instances. - */ - @JsonProperty(value = "direction", required = true) - private ScaleDirection direction; - - /* - * the type of action that should occur when the scale rule fires. - */ - @JsonProperty(value = "type", required = true) - private ScaleType type; - - /* - * the number of instances that are involved in the scaling action. This - * value must be 1 or greater. The default value is 1. - */ - @JsonProperty(value = "value") - private String value; - - /* - * the amount of time to wait since the last scaling action before this - * action occurs. It must be between 1 week and 1 minute in ISO 8601 - * format. - */ - @JsonProperty(value = "cooldown", required = true) - private Duration cooldown; - - /** - * Get the direction property: the scale direction. Whether the scaling action increases or decreases the number of - * instances. - * - * @return the direction value. - */ - public ScaleDirection direction() { - return this.direction; - } - - /** - * Set the direction property: the scale direction. Whether the scaling action increases or decreases the number of - * instances. - * - * @param direction the direction value to set. - * @return the ScaleAction object itself. - */ - public ScaleAction withDirection(ScaleDirection direction) { - this.direction = direction; - return this; - } - - /** - * Get the type property: the type of action that should occur when the scale rule fires. - * - * @return the type value. - */ - public ScaleType type() { - return this.type; - } - - /** - * Set the type property: the type of action that should occur when the scale rule fires. - * - * @param type the type value to set. - * @return the ScaleAction object itself. - */ - public ScaleAction withType(ScaleType type) { - this.type = type; - return this; - } - - /** - * Get the value property: the number of instances that are involved in the scaling action. This value must be 1 or - * greater. The default value is 1. - * - * @return the value value. - */ - public String value() { - return this.value; - } - - /** - * Set the value property: the number of instances that are involved in the scaling action. This value must be 1 or - * greater. The default value is 1. - * - * @param value the value value to set. - * @return the ScaleAction object itself. - */ - public ScaleAction withValue(String value) { - this.value = value; - return this; - } - - /** - * Get the cooldown property: the amount of time to wait since the last scaling action before this action occurs. It - * must be between 1 week and 1 minute in ISO 8601 format. - * - * @return the cooldown value. - */ - public Duration cooldown() { - return this.cooldown; - } - - /** - * Set the cooldown property: the amount of time to wait since the last scaling action before this action occurs. It - * must be between 1 week and 1 minute in ISO 8601 format. - * - * @param cooldown the cooldown value to set. - * @return the ScaleAction object itself. - */ - public ScaleAction withCooldown(Duration cooldown) { - this.cooldown = cooldown; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (direction() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property direction in model ScaleAction")); - } - if (type() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property type in model ScaleAction")); - } - if (cooldown() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property cooldown in model ScaleAction")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ScaleCapacity.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ScaleCapacity.java deleted file mode 100644 index 1e90da69d35f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ScaleCapacity.java +++ /dev/null @@ -1,125 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The number of instances that can be used during this profile. */ -@Fluent -public final class ScaleCapacity { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ScaleCapacity.class); - - /* - * the minimum number of instances for the resource. - */ - @JsonProperty(value = "minimum", required = true) - private String minimum; - - /* - * the maximum number of instances for the resource. The actual maximum - * number of instances is limited by the cores that are available in the - * subscription. - */ - @JsonProperty(value = "maximum", required = true) - private String maximum; - - /* - * the number of instances that will be set if metrics are not available - * for evaluation. The default is only used if the current instance count - * is lower than the default. - */ - @JsonProperty(value = "default", required = true) - private String defaultProperty; - - /** - * Get the minimum property: the minimum number of instances for the resource. - * - * @return the minimum value. - */ - public String minimum() { - return this.minimum; - } - - /** - * Set the minimum property: the minimum number of instances for the resource. - * - * @param minimum the minimum value to set. - * @return the ScaleCapacity object itself. - */ - public ScaleCapacity withMinimum(String minimum) { - this.minimum = minimum; - return this; - } - - /** - * Get the maximum property: the maximum number of instances for the resource. The actual maximum number of - * instances is limited by the cores that are available in the subscription. - * - * @return the maximum value. - */ - public String maximum() { - return this.maximum; - } - - /** - * Set the maximum property: the maximum number of instances for the resource. The actual maximum number of - * instances is limited by the cores that are available in the subscription. - * - * @param maximum the maximum value to set. - * @return the ScaleCapacity object itself. - */ - public ScaleCapacity withMaximum(String maximum) { - this.maximum = maximum; - return this; - } - - /** - * Get the defaultProperty property: the number of instances that will be set if metrics are not available for - * evaluation. The default is only used if the current instance count is lower than the default. - * - * @return the defaultProperty value. - */ - public String defaultProperty() { - return this.defaultProperty; - } - - /** - * Set the defaultProperty property: the number of instances that will be set if metrics are not available for - * evaluation. The default is only used if the current instance count is lower than the default. - * - * @param defaultProperty the defaultProperty value to set. - * @return the ScaleCapacity object itself. - */ - public ScaleCapacity withDefaultProperty(String defaultProperty) { - this.defaultProperty = defaultProperty; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (minimum() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property minimum in model ScaleCapacity")); - } - if (maximum() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property maximum in model ScaleCapacity")); - } - if (defaultProperty() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property defaultProperty in model ScaleCapacity")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ScaleDirection.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ScaleDirection.java deleted file mode 100644 index ef885b3f22ee..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ScaleDirection.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for ScaleDirection. */ -public enum ScaleDirection { - /** Enum value None. */ - NONE("None"), - - /** Enum value Increase. */ - INCREASE("Increase"), - - /** Enum value Decrease. */ - DECREASE("Decrease"); - - /** The actual serialized value for a ScaleDirection instance. */ - private final String value; - - ScaleDirection(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a ScaleDirection instance. - * - * @param value the serialized value to parse. - * @return the parsed ScaleDirection object, or null if unable to parse. - */ - @JsonCreator - public static ScaleDirection fromString(String value) { - ScaleDirection[] items = ScaleDirection.values(); - for (ScaleDirection item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ScaleRule.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ScaleRule.java deleted file mode 100644 index 3f22be232412..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ScaleRule.java +++ /dev/null @@ -1,598 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.monitor.fluent.models.ScaleRuleInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasParent; -import com.azure.resourcemanager.resources.fluentcore.model.Attachable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.model.Settable; -import java.time.Duration; - -/** An immutable client-side representation of an Azure autoscale profile scale rule. */ -@Fluent -public interface ScaleRule extends HasInnerModel, HasParent { - /** - * Get the resource identifier of the resource the rule monitors. - * - * @return the metricResourceUri value - */ - String metricSource(); - - /** - * Get the name of the metric that defines what the rule monitors. - * - * @return the metricName value - */ - String metricName(); - - /** - * Get the range of time in which instance data is collected. This value must be greater than the delay in metric - * collection, which can vary from resource-to-resource. Must be between 12 hours and 5 minutes. - * - * @return the timeWindow value - */ - Duration duration(); - - /** - * Get the granularity of metrics the rule monitors. Must be one of the predefined values returned from metric - * definitions for the metric. Must be between 12 hours and 1 minute. - * - * @return the timeGrain value - */ - Duration frequency(); - - /** - * Get the metric statistic type. How the metrics from multiple instances are combined. Possible values include: - * 'Average', 'Min', 'Max', 'Sum'. - * - * @return the statistic value - */ - MetricStatisticType frequencyStatistic(); - - /** - * Get the operator that is used to compare the metric data and the threshold. Possible values include: 'Equals', - * 'NotEquals', 'GreaterThan', 'GreaterThanOrEqual', 'LessThan', 'LessThanOrEqual'. - * - * @return the operator value - */ - ComparisonOperationType condition(); - - /** - * Get the time aggregation type. How the data that is collected should be combined over time. The default value is - * Average. Possible values include: 'Average', 'Minimum', 'Maximum', 'Total', 'Count'. - * - * @return the timeAggregation value - */ - TimeAggregationType timeAggregation(); - - /** - * Get the threshold of the metric that triggers the scale action. - * - * @return the threshold value - */ - double threshold(); - - /** - * Get the scale direction. Whether the scaling action increases or decreases the number of instances. Possible - * values include: 'None', 'Increase', 'Decrease'. - * - * @return the direction value - */ - ScaleDirection scaleDirection(); - - /** - * Get the type of action that should occur when the scale rule fires. Possible values include: 'ChangeCount', - * 'PercentChangeCount', 'ExactCount'. - * - * @return the type value - */ - ScaleType scaleType(); - - /** - * Get the number of instances that are involved in the scaling action. - * - * @return the value value - */ - int scaleInstanceCount(); - - /** - * Get the amount of time to wait since the last scaling action before this action occurs. It must be between 1 week - * and 1 minute in ISO 8601 format. - * - * @return the cooldown value - */ - Duration cooldown(); - - /** The entirety of an autoscale profile scale rule definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithMetricName, - DefinitionStages.WithStatistic, - DefinitionStages.WithCondition, - DefinitionStages.WithScaleAction, - DefinitionStages.WithAttach { - } - - /** Grouping of autoscale profile scale rule definition stages. */ - interface DefinitionStages { - /** The first stage of autoscale profile scale rule definition. */ - interface Blank { - /** - * Sets the resource identifier of the resource the rule monitors. - * - * @param metricSourceResourceId resourceId of the resource. - * @return the next stage of the definition. - */ - WithMetricName withMetricSource(String metricSourceResourceId); - } - - /** The stage of the definition which specifies metric name. */ - interface WithMetricName { - /** - * Sets the name of the metric that defines what the rule monitors. - * - * @param metricName name of the metric. - * @return the next stage of the definition. - */ - WithStatistic withMetricName(String metricName); - } - - /** - * The stage of the definition which specifies what kind of statistics should be used to calculate autoscale - * trigger action. - */ - interface WithStatistic { - /** - * Sets statistics for autoscale trigger action. - * - * @param duration the range of time in which instance data is collected. This value must be greater than - * the delay in metric collection, which can vary from resource-to-resource. Must be between 12 hours - * and 5 minutes. - * @param frequency the granularity of metrics the rule monitors. Must be one of the predefined values - * returned from metric definitions for the metric. Must be between 12 hours and 1 minute. - * @param statisticType the metric statistic type. How the metrics from multiple instances are combined. - * Possible values include: 'Average', 'Min', 'Max', 'Sum'. - * @return the next stage of the definition. - */ - WithCondition withStatistic(Duration duration, Duration frequency, MetricStatisticType statisticType); - - /** - * Sets statistics for autoscale trigger action with default values of 10 minutes for duration, 1 minute for - * frequency(time grain) and 'Average' for statistic type. - * - * @return the next stage of the definition. - */ - WithCondition withStatistic(); - - /** - * Sets statistics for autoscale trigger action with default values of 1 minute for frequency(time grain) - * and 'Average' for statistic type. - * - * @param duration the range of time in which instance data is collected. This value must be greater than - * the delay in metric collection, which can vary from resource-to-resource. Must be between 12 hours - * and 5 minutes. - * @return the next stage of the definition. - */ - WithCondition withStatistic(Duration duration); - - /** - * Sets statistics for autoscale trigger action with default values of 1 minute for frequency(time grain). - * - * @param duration the range of time in which instance data is collected. This value must be greater than - * the delay in metric collection, which can vary from resource-to-resource. Must be between 12 hours - * and 5 minutes. - * @param statisticType the metric statistic type. How the metrics from multiple instances are combined. - * Possible values include: 'Average', 'Min', 'Max', 'Sum'. - * @return the next stage of the definition. - */ - WithCondition withStatistic(Duration duration, MetricStatisticType statisticType); - } - - /** The stage of the definition which specifies metric alert condition. */ - interface WithCondition { - /** - * Sets the condition to monitor for the current metric alert. - * - * @param condition the operator that is used to compare the metric data and the threshold. Possible values - * include: 'Equals', 'NotEquals', 'GreaterThan', 'GreaterThanOrEqual', 'LessThan', 'LessThanOrEqual'. - * @param timeAggregation the time aggregation type. How the data that is collected should be combined over - * time. The default value is Average. Possible values include: 'Average', 'Minimum', 'Maximum', - * 'Total', 'Count'. - * @param threshold the threshold of the metric that triggers the scale action. - * @return the next stage of the definition. - */ - WithScaleAction withCondition( - TimeAggregationType timeAggregation, ComparisonOperationType condition, double threshold); - } - - /** The stage of the definition which specifies action to take when the metric alert will be triggered. */ - interface WithScaleAction { - /** - * Sets the action to be performed when the scale rule will be active. - * - * @param direction the scale direction. Whether the scaling action increases or decreases the number of - * instances. Possible values include: 'None', 'Increase', 'Decrease'. - * @param type the type of action that should occur when the scale rule fires. Possible values include: - * 'ChangeCount', 'PercentChangeCount', 'ExactCount'. - * @param instanceCountChange the number of instances that are involved in the scaling action. - * @param cooldown the amount of time to wait since the last scaling action before this action occurs. It - * must be between 1 week and 1 minute in ISO 8601 format. - * @return the next stage of the definition. - */ - WithAttach withScaleAction( - ScaleDirection direction, ScaleType type, int instanceCountChange, Duration cooldown); - } - - /** The final stage of the definition which attaches defined scale rule to the current Autoscale profile. */ - interface WithAttach extends Attachable.InDefinition { - } - } - - /** - * The entirety of an autoscale profile scale rule definition during parent Autoscale Profile definition in - * Autoscale Settings update stage. - */ - interface ParentUpdateDefinition - extends ParentUpdateDefinitionStages.Blank, - ParentUpdateDefinitionStages.WithMetricName, - ParentUpdateDefinitionStages.WithStatistic, - ParentUpdateDefinitionStages.WithCondition, - ParentUpdateDefinitionStages.WithScaleAction, - ParentUpdateDefinitionStages.WithAttach { - } - - /** - * Grouping of autoscale profile scale rule definition stages during definition of Autoscale Profile in the - * Autoscale update stage. - */ - interface ParentUpdateDefinitionStages { - /** The first stage of autoscale profile scale rule definition. */ - interface Blank { - /** - * Sets the resource identifier of the resource the rule monitors. - * - * @param metricSourceResourceId resourceId of the resource. - * @return the next stage of the definition. - */ - WithMetricName withMetricSource(String metricSourceResourceId); - } - - /** The stage of the definition which specifies metric name. */ - interface WithMetricName { - /** - * Sets the name of the metric that defines what the rule monitors. - * - * @param metricName name of the metric. - * @return the next stage of the definition. - */ - WithStatistic withMetricName(String metricName); - } - - /** - * The stage of the definition which specifies what kind of statistics should be used to calculate autoscale - * trigger action. - */ - interface WithStatistic { - /** - * Sets statistics for autoscale trigger action. - * - * @param duration the range of time in which instance data is collected. This value must be greater than - * the delay in metric collection, which can vary from resource-to-resource. Must be between 12 hours - * and 5 minutes. - * @param frequency the granularity of metrics the rule monitors. Must be one of the predefined values - * returned from metric definitions for the metric. Must be between 12 hours and 1 minute. - * @param statisticType the metric statistic type. How the metrics from multiple instances are combined. - * Possible values include: 'Average', 'Min', 'Max', 'Sum'. - * @return the next stage of the definition. - */ - WithCondition withStatistic(Duration duration, Duration frequency, MetricStatisticType statisticType); - - /** - * Sets statistics for autoscale trigger action with default values of 10 minutes for duration, 1 minute for - * frequency(time grain) and 'Average' for statistic type. - * - * @return the next stage of the definition. - */ - WithCondition withStatistic(); - - /** - * Sets statistics for autoscale trigger action with default values of 1 minute for frequency(time grain) - * and 'Average' for statistic type. - * - * @param duration the range of time in which instance data is collected. This value must be greater than - * the delay in metric collection, which can vary from resource-to-resource. Must be between 12 hours - * and 5 minutes. - * @return the next stage of the definition. - */ - WithCondition withStatistic(Duration duration); - - /** - * Sets statistics for autoscale trigger action with default values of 1 minute for frequency(time grain). - * - * @param duration the range of time in which instance data is collected. This value must be greater than - * the delay in metric collection, which can vary from resource-to-resource. Must be between 12 hours - * and 5 minutes. - * @param statisticType the metric statistic type. How the metrics from multiple instances are combined. - * Possible values include: 'Average', 'Min', 'Max', 'Sum'. - * @return the next stage of the definition. - */ - WithCondition withStatistic(Duration duration, MetricStatisticType statisticType); - } - - /** The stage of the definition which specifies metric alert condition. */ - interface WithCondition { - /** - * Sets the condition to monitor for the current metric alert. - * - * @param condition the operator that is used to compare the metric data and the threshold. Possible values - * include: 'Equals', 'NotEquals', 'GreaterThan', 'GreaterThanOrEqual', 'LessThan', 'LessThanOrEqual'. - * @param timeAggregation the time aggregation type. How the data that is collected should be combined over - * time. The default value is Average. Possible values include: 'Average', 'Minimum', 'Maximum', - * 'Total', 'Count'. - * @param threshold the threshold of the metric that triggers the scale action. - * @return the next stage of the definition. - */ - WithScaleAction withCondition( - TimeAggregationType timeAggregation, ComparisonOperationType condition, double threshold); - } - - /** The stage of the definition which specifies action to take when the metric alert will be triggered. */ - interface WithScaleAction { - /** - * Sets the action to be performed when the scale rule will be active. - * - * @param direction the scale direction. Whether the scaling action increases or decreases the number of - * instances. Possible values include: 'None', 'Increase', 'Decrease'. - * @param type the type of action that should occur when the scale rule fires. Possible values include: - * 'ChangeCount', 'PercentChangeCount', 'ExactCount'. - * @param instanceCountChange the number of instances that are involved in the scaling action. - * @param cooldown the amount of time to wait since the last scaling action before this action occurs. It - * must be between 1 week and 1 minute in ISO 8601 format. - * @return the next stage of the definition. - */ - WithAttach withScaleAction( - ScaleDirection direction, ScaleType type, int instanceCountChange, Duration cooldown); - } - - /** The final stage of the definition which attaches defined scale rule to the current Autoscale profile. */ - interface WithAttach { - /** - * Attaches sclae rule to the new autoscale profile in the autoscale update definition stage. - * - * @return the next stage of the parent definition - */ - AutoscaleProfile.UpdateDefinitionStages.WithScaleRuleOptional attach(); - } - } - - /** - * The entirety of an autoscale profile scale rule definition during parent Autoscale Profile update in Autoscale - * Settings update stage. - */ - interface UpdateDefinition - extends UpdateDefinitionStages.Blank, - UpdateDefinitionStages.WithMetricName, - UpdateDefinitionStages.WithStatistic, - UpdateDefinitionStages.WithCondition, - UpdateDefinitionStages.WithScaleAction, - UpdateDefinitionStages.WithAttach { - } - - /** - * Grouping of autoscale profile scale rule definition stages during update of Autoscale Profile in the Autoscale - * update stage. - */ - interface UpdateDefinitionStages { - /** The first stage of autoscale profile scale rule definition. */ - interface Blank { - /** - * Sets the resource identifier of the resource the rule monitors. - * - * @param metricSourceResourceId resourceId of the resource. - * @return the next stage of the definition. - */ - WithMetricName withMetricSource(String metricSourceResourceId); - } - - /** The stage of the definition which specifies metric name. */ - interface WithMetricName { - /** - * Sets the name of the metric that defines what the rule monitors. - * - * @param metricName name of the metric. - * @return the next stage of the definition. - */ - WithStatistic withMetricName(String metricName); - } - - /** - * The stage of the definition which specifies what kind of statistics should be used to calculate autoscale - * trigger action. - */ - interface WithStatistic { - /** - * Sets statistics for autoscale trigger action. - * - * @param duration the range of time in which instance data is collected. This value must be greater than - * the delay in metric collection, which can vary from resource-to-resource. Must be between 12 hours - * and 5 minutes. - * @param frequency the granularity of metrics the rule monitors. Must be one of the predefined values - * returned from metric definitions for the metric. Must be between 12 hours and 1 minute. - * @param statisticType the metric statistic type. How the metrics from multiple instances are combined. - * Possible values include: 'Average', 'Min', 'Max', 'Sum'. - * @return the next stage of the definition. - */ - WithCondition withStatistic(Duration duration, Duration frequency, MetricStatisticType statisticType); - - /** - * Sets statistics for autoscale trigger action with default values of 10 minutes for duration, 1 minute for - * frequency(time grain) and 'Average' for statistic type. - * - * @return the next stage of the definition. - */ - WithCondition withStatistic(); - - /** - * Sets statistics for autoscale trigger action with default values of 1 minute for frequency(time grain) - * and 'Average' for statistic type. - * - * @param duration the range of time in which instance data is collected. This value must be greater than - * the delay in metric collection, which can vary from resource-to-resource. Must be between 12 hours - * and 5 minutes. - * @return the next stage of the definition. - */ - WithCondition withStatistic(Duration duration); - - /** - * Sets statistics for autoscale trigger action with default values of 1 minute for frequency(time grain). - * - * @param duration the range of time in which instance data is collected. This value must be greater than - * the delay in metric collection, which can vary from resource-to-resource. Must be between 12 hours - * and 5 minutes. - * @param statisticType the metric statistic type. How the metrics from multiple instances are combined. - * Possible values include: 'Average', 'Min', 'Max', 'Sum'. - * @return the next stage of the definition. - */ - WithCondition withStatistic(Duration duration, MetricStatisticType statisticType); - } - - /** The stage of the definition which specifies metric alert condition. */ - interface WithCondition { - /** - * Sets the condition to monitor for the current metric alert. - * - * @param condition the operator that is used to compare the metric data and the threshold. Possible values - * include: 'Equals', 'NotEquals', 'GreaterThan', 'GreaterThanOrEqual', 'LessThan', 'LessThanOrEqual'. - * @param timeAggregation the time aggregation type. How the data that is collected should be combined over - * time. The default value is Average. Possible values include: 'Average', 'Minimum', 'Maximum', - * 'Total', 'Count'. - * @param threshold the threshold of the metric that triggers the scale action. - * @return the next stage of the definition. - */ - WithScaleAction withCondition( - TimeAggregationType timeAggregation, ComparisonOperationType condition, double threshold); - } - /** The stage of the definition which specifies action to take when the metric alert will be triggered. */ - interface WithScaleAction { - /** - * Sets the action to be performed when the scale rule will be active. - * - * @param direction the scale direction. Whether the scaling action increases or decreases the number of - * instances. Possible values include: 'None', 'Increase', 'Decrease'. - * @param type the type of action that should occur when the scale rule fires. Possible values include: - * 'ChangeCount', 'PercentChangeCount', 'ExactCount'. - * @param instanceCountChange the number of instances that are involved in the scaling action. - * @param cooldown the amount of time to wait since the last scaling action before this action occurs. It - * must be between 1 week and 1 minute in ISO 8601 format. - * @return the next stage of the definition. - */ - WithAttach withScaleAction( - ScaleDirection direction, ScaleType type, int instanceCountChange, Duration cooldown); - } - - /** The final stage of the definition which attaches defined scale rule to the current Autoscale profile. */ - interface WithAttach - extends - /** - * Attaches sclae rule to the new autoscale profile in the autoscale update definition stage. - * - * @return the next stage of the parent definition - */ - Attachable.InUpdate { - } - } - - /** Grouping of scale rule update stages. */ - interface Update extends Settable { - /** - * Updates the resource identifier of the resource the rule monitors. - * - * @param metricSourceResourceId resourceId of the resource. - * @return the next stage of the scale rule update. - */ - Update withMetricSource(String metricSourceResourceId); - - /** - * the name of the metric that defines what the rule monitors. - * - * @param metricName metricName name of the metric. - * @return the next stage of the scale rule update. - */ - Update withMetricName(String metricName); - - /** - * Updates the statistics for autoscale trigger action. - * - * @param duration the range of time in which instance data is collected. This value must be greater than the - * delay in metric collection, which can vary from resource-to-resource. Must be between 12 hours and 5 - * minutes. - * @param frequency the granularity of metrics the rule monitors. Must be one of the predefined values returned - * from metric definitions for the metric. Must be between 12 hours and 1 minute. - * @param statisticType the metric statistic type. How the metrics from multiple instances are combined. - * Possible values include: 'Average', 'Min', 'Max', 'Sum'. - * @return the next stage of the scale rule update. - */ - Update withStatistic(Duration duration, Duration frequency, MetricStatisticType statisticType); - - /** - * Sets statistics for autoscale trigger action with default values of 10 minutes for duration, 1 minute for - * frequency(time grain) and 'Average' for statistic type. - * - * @return the next stage of the definition. - */ - Update withStatistic(); - - /** - * Sets statistics for autoscale trigger action with default values of 1 minute for frequency(time grain) and - * 'Average' for statistic type. - * - * @param duration the range of time in which instance data is collected. This value must be greater than the - * delay in metric collection, which can vary from resource-to-resource. Must be between 12 hours and 5 - * minutes. - * @return the next stage of the definition. - */ - Update withStatistic(Duration duration); - - /** - * Sets statistics for autoscale trigger action with default values of 1 minute for frequency(time grain). - * - * @param duration the range of time in which instance data is collected. This value must be greater than the - * delay in metric collection, which can vary from resource-to-resource. Must be between 12 hours and 5 - * minutes. - * @param statisticType the metric statistic type. How the metrics from multiple instances are combined. - * Possible values include: 'Average', 'Min', 'Max', 'Sum'. - * @return the next stage of the definition. - */ - Update withStatistic(Duration duration, MetricStatisticType statisticType); - - /** - * Updates the condition to monitor for the current metric alert. - * - * @param condition the operator that is used to compare the metric data and the threshold. Possible values - * include: 'Equals', 'NotEquals', 'GreaterThan', 'GreaterThanOrEqual', 'LessThan', 'LessThanOrEqual'. - * @param timeAggregation the time aggregation type. How the data that is collected should be combined over - * time. The default value is Average. Possible values include: 'Average', 'Minimum', 'Maximum', 'Total', - * 'Count'. - * @param threshold the threshold of the metric that triggers the scale action. - * @return the next stage of the scale rule update. - */ - Update withCondition(TimeAggregationType timeAggregation, ComparisonOperationType condition, double threshold); - - /** - * Updates the action to be performed when the scale rule will be active. - * - * @param direction the scale direction. Whether the scaling action increases or decreases the number of - * instances. Possible values include: 'None', 'Increase', 'Decrease'. - * @param type the type of action that should occur when the scale rule fires. Possible values include: - * 'ChangeCount', 'PercentChangeCount', 'ExactCount'. - * @param instanceCountChange the number of instances that are involved in the scaling action. - * @param cooldown the amount of time to wait since the last scaling action before this action occurs. It must - * be between 1 week and 1 minute in ISO 8601 format. - * @return the next stage of the scale rule update. - */ - Update withScaleAction(ScaleDirection direction, ScaleType type, int instanceCountChange, Duration cooldown); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ScaleRuleMetricDimension.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ScaleRuleMetricDimension.java deleted file mode 100644 index cba4c7cf8058..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ScaleRuleMetricDimension.java +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Specifies an auto scale rule metric dimension. */ -@Fluent -public final class ScaleRuleMetricDimension { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ScaleRuleMetricDimension.class); - - /* - * Name of the dimension. - */ - @JsonProperty(value = "DimensionName", required = true) - private String dimensionName; - - /* - * the dimension operator. Only 'Equals' and 'NotEquals' are supported. - * 'Equals' being equal to any of the values. 'NotEquals' being not equal - * to all of the values - */ - @JsonProperty(value = "Operator", required = true) - private ScaleRuleMetricDimensionOperationType operator; - - /* - * list of dimension values. For example: ["App1","App2"]. - */ - @JsonProperty(value = "Values", required = true) - private List values; - - /** - * Get the dimensionName property: Name of the dimension. - * - * @return the dimensionName value. - */ - public String dimensionName() { - return this.dimensionName; - } - - /** - * Set the dimensionName property: Name of the dimension. - * - * @param dimensionName the dimensionName value to set. - * @return the ScaleRuleMetricDimension object itself. - */ - public ScaleRuleMetricDimension withDimensionName(String dimensionName) { - this.dimensionName = dimensionName; - return this; - } - - /** - * Get the operator property: the dimension operator. Only 'Equals' and 'NotEquals' are supported. 'Equals' being - * equal to any of the values. 'NotEquals' being not equal to all of the values. - * - * @return the operator value. - */ - public ScaleRuleMetricDimensionOperationType operator() { - return this.operator; - } - - /** - * Set the operator property: the dimension operator. Only 'Equals' and 'NotEquals' are supported. 'Equals' being - * equal to any of the values. 'NotEquals' being not equal to all of the values. - * - * @param operator the operator value to set. - * @return the ScaleRuleMetricDimension object itself. - */ - public ScaleRuleMetricDimension withOperator(ScaleRuleMetricDimensionOperationType operator) { - this.operator = operator; - return this; - } - - /** - * Get the values property: list of dimension values. For example: ["App1","App2"]. - * - * @return the values value. - */ - public List values() { - return this.values; - } - - /** - * Set the values property: list of dimension values. For example: ["App1","App2"]. - * - * @param values the values value to set. - * @return the ScaleRuleMetricDimension object itself. - */ - public ScaleRuleMetricDimension withValues(List values) { - this.values = values; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (dimensionName() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property dimensionName in model ScaleRuleMetricDimension")); - } - if (operator() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property operator in model ScaleRuleMetricDimension")); - } - if (values() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property values in model ScaleRuleMetricDimension")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ScaleRuleMetricDimensionOperationType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ScaleRuleMetricDimensionOperationType.java deleted file mode 100644 index da5407cda5d1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ScaleRuleMetricDimensionOperationType.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ScaleRuleMetricDimensionOperationType. */ -public final class ScaleRuleMetricDimensionOperationType - extends ExpandableStringEnum { - /** Static value Equals for ScaleRuleMetricDimensionOperationType. */ - public static final ScaleRuleMetricDimensionOperationType EQUALS = fromString("Equals"); - - /** Static value NotEquals for ScaleRuleMetricDimensionOperationType. */ - public static final ScaleRuleMetricDimensionOperationType NOT_EQUALS = fromString("NotEquals"); - - /** - * Creates or finds a ScaleRuleMetricDimensionOperationType from its string representation. - * - * @param name a name to look for. - * @return the corresponding ScaleRuleMetricDimensionOperationType. - */ - @JsonCreator - public static ScaleRuleMetricDimensionOperationType fromString(String name) { - return fromString(name, ScaleRuleMetricDimensionOperationType.class); - } - - /** @return known ScaleRuleMetricDimensionOperationType values. */ - public static Collection values() { - return values(ScaleRuleMetricDimensionOperationType.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ScaleType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ScaleType.java deleted file mode 100644 index a311dc688912..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ScaleType.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for ScaleType. */ -public enum ScaleType { - /** Enum value ChangeCount. */ - CHANGE_COUNT("ChangeCount"), - - /** Enum value PercentChangeCount. */ - PERCENT_CHANGE_COUNT("PercentChangeCount"), - - /** Enum value ExactCount. */ - EXACT_COUNT("ExactCount"), - - /** Enum value ServiceAllowedNextValue. */ - SERVICE_ALLOWED_NEXT_VALUE("ServiceAllowedNextValue"); - - /** The actual serialized value for a ScaleType instance. */ - private final String value; - - ScaleType(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a ScaleType instance. - * - * @param value the serialized value to parse. - * @return the parsed ScaleType object, or null if unable to parse. - */ - @JsonCreator - public static ScaleType fromString(String value) { - ScaleType[] items = ScaleType.values(); - for (ScaleType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/Schedule.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/Schedule.java deleted file mode 100644 index 9c59bcb26a3e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/Schedule.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Defines how often to run the search and the time interval. */ -@Fluent -public final class Schedule { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Schedule.class); - - /* - * frequency (in minutes) at which rule condition should be evaluated. - */ - @JsonProperty(value = "frequencyInMinutes", required = true) - private int frequencyInMinutes; - - /* - * Time window for which data needs to be fetched for query (should be - * greater than or equal to frequencyInMinutes). - */ - @JsonProperty(value = "timeWindowInMinutes", required = true) - private int timeWindowInMinutes; - - /** - * Get the frequencyInMinutes property: frequency (in minutes) at which rule condition should be evaluated. - * - * @return the frequencyInMinutes value. - */ - public int frequencyInMinutes() { - return this.frequencyInMinutes; - } - - /** - * Set the frequencyInMinutes property: frequency (in minutes) at which rule condition should be evaluated. - * - * @param frequencyInMinutes the frequencyInMinutes value to set. - * @return the Schedule object itself. - */ - public Schedule withFrequencyInMinutes(int frequencyInMinutes) { - this.frequencyInMinutes = frequencyInMinutes; - return this; - } - - /** - * Get the timeWindowInMinutes property: Time window for which data needs to be fetched for query (should be greater - * than or equal to frequencyInMinutes). - * - * @return the timeWindowInMinutes value. - */ - public int timeWindowInMinutes() { - return this.timeWindowInMinutes; - } - - /** - * Set the timeWindowInMinutes property: Time window for which data needs to be fetched for query (should be greater - * than or equal to frequencyInMinutes). - * - * @param timeWindowInMinutes the timeWindowInMinutes value to set. - * @return the Schedule object itself. - */ - public Schedule withTimeWindowInMinutes(int timeWindowInMinutes) { - this.timeWindowInMinutes = timeWindowInMinutes; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ScopedResourceListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ScopedResourceListResult.java deleted file mode 100644 index aff95a2a90d5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ScopedResourceListResult.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.fluent.models.ScopedResourceInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** A list of scoped resources in a private link scope. */ -@Immutable -public final class ScopedResourceListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ScopedResourceListResult.class); - - /* - * Array of results. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /* - * Link to retrieve next page of results. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: Array of results. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: Link to retrieve next page of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/SenderAuthorization.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/SenderAuthorization.java deleted file mode 100644 index 70dd0f6052be..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/SenderAuthorization.java +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * the authorization used by the user who has performed the operation that led to this event. This captures the RBAC - * properties of the event. These usually include the 'action', 'role' and the 'scope'. - */ -@Fluent -public final class SenderAuthorization { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SenderAuthorization.class); - - /* - * the permissible actions. For instance: - * microsoft.support/supporttickets/write - */ - @JsonProperty(value = "action") - private String action; - - /* - * the role of the user. For instance: Subscription Admin - */ - @JsonProperty(value = "role") - private String role; - - /* - * the scope. - */ - @JsonProperty(value = "scope") - private String scope; - - /** - * Get the action property: the permissible actions. For instance: microsoft.support/supporttickets/write. - * - * @return the action value. - */ - public String action() { - return this.action; - } - - /** - * Set the action property: the permissible actions. For instance: microsoft.support/supporttickets/write. - * - * @param action the action value to set. - * @return the SenderAuthorization object itself. - */ - public SenderAuthorization withAction(String action) { - this.action = action; - return this; - } - - /** - * Get the role property: the role of the user. For instance: Subscription Admin. - * - * @return the role value. - */ - public String role() { - return this.role; - } - - /** - * Set the role property: the role of the user. For instance: Subscription Admin. - * - * @param role the role value to set. - * @return the SenderAuthorization object itself. - */ - public SenderAuthorization withRole(String role) { - this.role = role; - return this; - } - - /** - * Get the scope property: the scope. - * - * @return the scope value. - */ - public String scope() { - return this.scope; - } - - /** - * Set the scope property: the scope. - * - * @param scope the scope value to set. - * @return the SenderAuthorization object itself. - */ - public SenderAuthorization withScope(String scope) { - this.scope = scope; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/SingleBaseline.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/SingleBaseline.java deleted file mode 100644 index 382b36506233..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/SingleBaseline.java +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The baseline values for a single sensitivity value. */ -@Fluent -public final class SingleBaseline { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SingleBaseline.class); - - /* - * the sensitivity of the baseline. - */ - @JsonProperty(value = "sensitivity", required = true) - private BaselineSensitivity sensitivity; - - /* - * The low thresholds of the baseline. - */ - @JsonProperty(value = "lowThresholds", required = true) - private List lowThresholds; - - /* - * The high thresholds of the baseline. - */ - @JsonProperty(value = "highThresholds", required = true) - private List highThresholds; - - /** - * Get the sensitivity property: the sensitivity of the baseline. - * - * @return the sensitivity value. - */ - public BaselineSensitivity sensitivity() { - return this.sensitivity; - } - - /** - * Set the sensitivity property: the sensitivity of the baseline. - * - * @param sensitivity the sensitivity value to set. - * @return the SingleBaseline object itself. - */ - public SingleBaseline withSensitivity(BaselineSensitivity sensitivity) { - this.sensitivity = sensitivity; - return this; - } - - /** - * Get the lowThresholds property: The low thresholds of the baseline. - * - * @return the lowThresholds value. - */ - public List lowThresholds() { - return this.lowThresholds; - } - - /** - * Set the lowThresholds property: The low thresholds of the baseline. - * - * @param lowThresholds the lowThresholds value to set. - * @return the SingleBaseline object itself. - */ - public SingleBaseline withLowThresholds(List lowThresholds) { - this.lowThresholds = lowThresholds; - return this; - } - - /** - * Get the highThresholds property: The high thresholds of the baseline. - * - * @return the highThresholds value. - */ - public List highThresholds() { - return this.highThresholds; - } - - /** - * Set the highThresholds property: The high thresholds of the baseline. - * - * @param highThresholds the highThresholds value to set. - * @return the SingleBaseline object itself. - */ - public SingleBaseline withHighThresholds(List highThresholds) { - this.highThresholds = highThresholds; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (sensitivity() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property sensitivity in model SingleBaseline")); - } - if (lowThresholds() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property lowThresholds in model SingleBaseline")); - } - if (highThresholds() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property highThresholds in model SingleBaseline")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/SmsReceiver.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/SmsReceiver.java deleted file mode 100644 index 94dedc7c196b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/SmsReceiver.java +++ /dev/null @@ -1,135 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** An SMS receiver. */ -@Fluent -public final class SmsReceiver { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SmsReceiver.class); - - /* - * The name of the SMS receiver. Names must be unique across all receivers - * within an action group. - */ - @JsonProperty(value = "name", required = true) - private String name; - - /* - * The country code of the SMS receiver. - */ - @JsonProperty(value = "countryCode", required = true) - private String countryCode; - - /* - * The phone number of the SMS receiver. - */ - @JsonProperty(value = "phoneNumber", required = true) - private String phoneNumber; - - /* - * The status of the receiver. - */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) - private ReceiverStatus status; - - /** - * Get the name property: The name of the SMS receiver. Names must be unique across all receivers within an action - * group. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the SMS receiver. Names must be unique across all receivers within an action - * group. - * - * @param name the name value to set. - * @return the SmsReceiver object itself. - */ - public SmsReceiver withName(String name) { - this.name = name; - return this; - } - - /** - * Get the countryCode property: The country code of the SMS receiver. - * - * @return the countryCode value. - */ - public String countryCode() { - return this.countryCode; - } - - /** - * Set the countryCode property: The country code of the SMS receiver. - * - * @param countryCode the countryCode value to set. - * @return the SmsReceiver object itself. - */ - public SmsReceiver withCountryCode(String countryCode) { - this.countryCode = countryCode; - return this; - } - - /** - * Get the phoneNumber property: The phone number of the SMS receiver. - * - * @return the phoneNumber value. - */ - public String phoneNumber() { - return this.phoneNumber; - } - - /** - * Set the phoneNumber property: The phone number of the SMS receiver. - * - * @param phoneNumber the phoneNumber value to set. - * @return the SmsReceiver object itself. - */ - public SmsReceiver withPhoneNumber(String phoneNumber) { - this.phoneNumber = phoneNumber; - return this; - } - - /** - * Get the status property: The status of the receiver. - * - * @return the status value. - */ - public ReceiverStatus status() { - return this.status; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property name in model SmsReceiver")); - } - if (countryCode() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property countryCode in model SmsReceiver")); - } - if (phoneNumber() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property phoneNumber in model SmsReceiver")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/Source.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/Source.java deleted file mode 100644 index 0de2c36c433c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/Source.java +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Specifies the log search query. */ -@Fluent -public final class Source { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Source.class); - - /* - * Log search query. Required for action type - AlertingAction - */ - @JsonProperty(value = "query") - private String query; - - /* - * List of Resource referred into query - */ - @JsonProperty(value = "authorizedResources") - private List authorizedResources; - - /* - * The resource uri over which log search query is to be run. - */ - @JsonProperty(value = "dataSourceId", required = true) - private String dataSourceId; - - /* - * Set value to 'ResultCount' . - */ - @JsonProperty(value = "queryType") - private QueryType queryType; - - /** - * Get the query property: Log search query. Required for action type - AlertingAction. - * - * @return the query value. - */ - public String query() { - return this.query; - } - - /** - * Set the query property: Log search query. Required for action type - AlertingAction. - * - * @param query the query value to set. - * @return the Source object itself. - */ - public Source withQuery(String query) { - this.query = query; - return this; - } - - /** - * Get the authorizedResources property: List of Resource referred into query. - * - * @return the authorizedResources value. - */ - public List authorizedResources() { - return this.authorizedResources; - } - - /** - * Set the authorizedResources property: List of Resource referred into query. - * - * @param authorizedResources the authorizedResources value to set. - * @return the Source object itself. - */ - public Source withAuthorizedResources(List authorizedResources) { - this.authorizedResources = authorizedResources; - return this; - } - - /** - * Get the dataSourceId property: The resource uri over which log search query is to be run. - * - * @return the dataSourceId value. - */ - public String dataSourceId() { - return this.dataSourceId; - } - - /** - * Set the dataSourceId property: The resource uri over which log search query is to be run. - * - * @param dataSourceId the dataSourceId value to set. - * @return the Source object itself. - */ - public Source withDataSourceId(String dataSourceId) { - this.dataSourceId = dataSourceId; - return this; - } - - /** - * Get the queryType property: Set value to 'ResultCount' . - * - * @return the queryType value. - */ - public QueryType queryType() { - return this.queryType; - } - - /** - * Set the queryType property: Set value to 'ResultCount' . - * - * @param queryType the queryType value to set. - * @return the Source object itself. - */ - public Source withQueryType(QueryType queryType) { - this.queryType = queryType; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (dataSourceId() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property dataSourceId in model Source")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/SyslogDataSource.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/SyslogDataSource.java deleted file mode 100644 index 5d32e10a4769..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/SyslogDataSource.java +++ /dev/null @@ -1,139 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** - * Definition of which syslog data will be collected and how it will be collected. Only collected from Linux machines. - */ -@Fluent -public final class SyslogDataSource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SyslogDataSource.class); - - /* - * List of streams that this data source will be sent to. - * A stream indicates what schema will be used for this data and usually - * what table in Log Analytics the data will be sent to. - */ - @JsonProperty(value = "streams") - private List streams; - - /* - * The list of facility names. - */ - @JsonProperty(value = "facilityNames") - private List facilityNames; - - /* - * The log levels to collect. - */ - @JsonProperty(value = "logLevels") - private List logLevels; - - /* - * A friendly name for the data source. - * This name should be unique across all data sources (regardless of type) - * within the data collection rule. - */ - @JsonProperty(value = "name") - private String name; - - /** - * Get the streams property: List of streams that this data source will be sent to. A stream indicates what schema - * will be used for this data and usually what table in Log Analytics the data will be sent to. - * - * @return the streams value. - */ - public List streams() { - return this.streams; - } - - /** - * Set the streams property: List of streams that this data source will be sent to. A stream indicates what schema - * will be used for this data and usually what table in Log Analytics the data will be sent to. - * - * @param streams the streams value to set. - * @return the SyslogDataSource object itself. - */ - public SyslogDataSource withStreams(List streams) { - this.streams = streams; - return this; - } - - /** - * Get the facilityNames property: The list of facility names. - * - * @return the facilityNames value. - */ - public List facilityNames() { - return this.facilityNames; - } - - /** - * Set the facilityNames property: The list of facility names. - * - * @param facilityNames the facilityNames value to set. - * @return the SyslogDataSource object itself. - */ - public SyslogDataSource withFacilityNames(List facilityNames) { - this.facilityNames = facilityNames; - return this; - } - - /** - * Get the logLevels property: The log levels to collect. - * - * @return the logLevels value. - */ - public List logLevels() { - return this.logLevels; - } - - /** - * Set the logLevels property: The log levels to collect. - * - * @param logLevels the logLevels value to set. - * @return the SyslogDataSource object itself. - */ - public SyslogDataSource withLogLevels(List logLevels) { - this.logLevels = logLevels; - return this; - } - - /** - * Get the name property: A friendly name for the data source. This name should be unique across all data sources - * (regardless of type) within the data collection rule. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: A friendly name for the data source. This name should be unique across all data sources - * (regardless of type) within the data collection rule. - * - * @param name the name value to set. - * @return the SyslogDataSource object itself. - */ - public SyslogDataSource withName(String name) { - this.name = name; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/TagsResource.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/TagsResource.java deleted file mode 100644 index e2566e24e7c6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/TagsResource.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** - * A container holding only the Tags for a resource, allowing the user to update the tags on a PrivateLinkScope - * instance. - */ -@Fluent -public final class TagsResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TagsResource.class); - - /* - * Resource tags - */ - @JsonProperty(value = "tags") - private Map tags; - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Resource tags. - * - * @param tags the tags value to set. - * @return the TagsResource object itself. - */ - public TagsResource withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ThresholdRuleCondition.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ThresholdRuleCondition.java deleted file mode 100644 index 2da784a06200..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ThresholdRuleCondition.java +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.time.Duration; - -/** A rule condition based on a metric crossing a threshold. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "odata\\.type") -@JsonTypeName("Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition") -@JsonFlatten -@Fluent -public class ThresholdRuleCondition extends RuleCondition { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ThresholdRuleCondition.class); - - /* - * the operator used to compare the data and the threshold. - */ - @JsonProperty(value = "operator", required = true) - private ConditionOperator operator; - - /* - * the threshold value that activates the alert. - */ - @JsonProperty(value = "threshold", required = true) - private double threshold; - - /* - * the period of time (in ISO 8601 duration format) that is used to monitor - * alert activity based on the threshold. If specified then it must be - * between 5 minutes and 1 day. - */ - @JsonProperty(value = "windowSize") - private Duration windowSize; - - /* - * the time aggregation operator. How the data that are collected should be - * combined over time. The default value is the PrimaryAggregationType of - * the Metric. - */ - @JsonProperty(value = "timeAggregation") - private TimeAggregationOperator timeAggregation; - - /** - * Get the operator property: the operator used to compare the data and the threshold. - * - * @return the operator value. - */ - public ConditionOperator operator() { - return this.operator; - } - - /** - * Set the operator property: the operator used to compare the data and the threshold. - * - * @param operator the operator value to set. - * @return the ThresholdRuleCondition object itself. - */ - public ThresholdRuleCondition withOperator(ConditionOperator operator) { - this.operator = operator; - return this; - } - - /** - * Get the threshold property: the threshold value that activates the alert. - * - * @return the threshold value. - */ - public double threshold() { - return this.threshold; - } - - /** - * Set the threshold property: the threshold value that activates the alert. - * - * @param threshold the threshold value to set. - * @return the ThresholdRuleCondition object itself. - */ - public ThresholdRuleCondition withThreshold(double threshold) { - this.threshold = threshold; - return this; - } - - /** - * Get the windowSize property: the period of time (in ISO 8601 duration format) that is used to monitor alert - * activity based on the threshold. If specified then it must be between 5 minutes and 1 day. - * - * @return the windowSize value. - */ - public Duration windowSize() { - return this.windowSize; - } - - /** - * Set the windowSize property: the period of time (in ISO 8601 duration format) that is used to monitor alert - * activity based on the threshold. If specified then it must be between 5 minutes and 1 day. - * - * @param windowSize the windowSize value to set. - * @return the ThresholdRuleCondition object itself. - */ - public ThresholdRuleCondition withWindowSize(Duration windowSize) { - this.windowSize = windowSize; - return this; - } - - /** - * Get the timeAggregation property: the time aggregation operator. How the data that are collected should be - * combined over time. The default value is the PrimaryAggregationType of the Metric. - * - * @return the timeAggregation value. - */ - public TimeAggregationOperator timeAggregation() { - return this.timeAggregation; - } - - /** - * Set the timeAggregation property: the time aggregation operator. How the data that are collected should be - * combined over time. The default value is the PrimaryAggregationType of the Metric. - * - * @param timeAggregation the timeAggregation value to set. - * @return the ThresholdRuleCondition object itself. - */ - public ThresholdRuleCondition withTimeAggregation(TimeAggregationOperator timeAggregation) { - this.timeAggregation = timeAggregation; - return this; - } - - /** {@inheritDoc} */ - @Override - public ThresholdRuleCondition withDataSource(RuleDataSource dataSource) { - super.withDataSource(dataSource); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (operator() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property operator in model ThresholdRuleCondition")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/TimeAggregationOperator.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/TimeAggregationOperator.java deleted file mode 100644 index 20bc79941cc7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/TimeAggregationOperator.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for TimeAggregationOperator. */ -public enum TimeAggregationOperator { - /** Enum value Average. */ - AVERAGE("Average"), - - /** Enum value Minimum. */ - MINIMUM("Minimum"), - - /** Enum value Maximum. */ - MAXIMUM("Maximum"), - - /** Enum value Total. */ - TOTAL("Total"), - - /** Enum value Last. */ - LAST("Last"); - - /** The actual serialized value for a TimeAggregationOperator instance. */ - private final String value; - - TimeAggregationOperator(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a TimeAggregationOperator instance. - * - * @param value the serialized value to parse. - * @return the parsed TimeAggregationOperator object, or null if unable to parse. - */ - @JsonCreator - public static TimeAggregationOperator fromString(String value) { - TimeAggregationOperator[] items = TimeAggregationOperator.values(); - for (TimeAggregationOperator item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/TimeAggregationType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/TimeAggregationType.java deleted file mode 100644 index 20abcee3908e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/TimeAggregationType.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for TimeAggregationType. */ -public enum TimeAggregationType { - /** Enum value Average. */ - AVERAGE("Average"), - - /** Enum value Minimum. */ - MINIMUM("Minimum"), - - /** Enum value Maximum. */ - MAXIMUM("Maximum"), - - /** Enum value Total. */ - TOTAL("Total"), - - /** Enum value Count. */ - COUNT("Count"), - - /** Enum value Last. */ - LAST("Last"); - - /** The actual serialized value for a TimeAggregationType instance. */ - private final String value; - - TimeAggregationType(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a TimeAggregationType instance. - * - * @param value the serialized value to parse. - * @return the parsed TimeAggregationType object, or null if unable to parse. - */ - @JsonCreator - public static TimeAggregationType fromString(String value) { - TimeAggregationType[] items = TimeAggregationType.values(); - for (TimeAggregationType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/TimeSeriesBaseline.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/TimeSeriesBaseline.java deleted file mode 100644 index 27295753c6fc..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/TimeSeriesBaseline.java +++ /dev/null @@ -1,179 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; - -/** The baseline values for a single time series. */ -@Fluent -public final class TimeSeriesBaseline { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TimeSeriesBaseline.class); - - /* - * The aggregation type of the metric. - */ - @JsonProperty(value = "aggregation", required = true) - private String aggregation; - - /* - * The dimensions of this time series. - */ - @JsonProperty(value = "dimensions") - private List dimensions; - - /* - * The list of timestamps of the baselines. - */ - @JsonProperty(value = "timestamps", required = true) - private List timestamps; - - /* - * The baseline values for each sensitivity. - */ - @JsonProperty(value = "data", required = true) - private List data; - - /* - * The baseline metadata values. - */ - @JsonProperty(value = "metadataValues") - private List metadataValues; - - /** - * Get the aggregation property: The aggregation type of the metric. - * - * @return the aggregation value. - */ - public String aggregation() { - return this.aggregation; - } - - /** - * Set the aggregation property: The aggregation type of the metric. - * - * @param aggregation the aggregation value to set. - * @return the TimeSeriesBaseline object itself. - */ - public TimeSeriesBaseline withAggregation(String aggregation) { - this.aggregation = aggregation; - return this; - } - - /** - * Get the dimensions property: The dimensions of this time series. - * - * @return the dimensions value. - */ - public List dimensions() { - return this.dimensions; - } - - /** - * Set the dimensions property: The dimensions of this time series. - * - * @param dimensions the dimensions value to set. - * @return the TimeSeriesBaseline object itself. - */ - public TimeSeriesBaseline withDimensions(List dimensions) { - this.dimensions = dimensions; - return this; - } - - /** - * Get the timestamps property: The list of timestamps of the baselines. - * - * @return the timestamps value. - */ - public List timestamps() { - return this.timestamps; - } - - /** - * Set the timestamps property: The list of timestamps of the baselines. - * - * @param timestamps the timestamps value to set. - * @return the TimeSeriesBaseline object itself. - */ - public TimeSeriesBaseline withTimestamps(List timestamps) { - this.timestamps = timestamps; - return this; - } - - /** - * Get the data property: The baseline values for each sensitivity. - * - * @return the data value. - */ - public List data() { - return this.data; - } - - /** - * Set the data property: The baseline values for each sensitivity. - * - * @param data the data value to set. - * @return the TimeSeriesBaseline object itself. - */ - public TimeSeriesBaseline withData(List data) { - this.data = data; - return this; - } - - /** - * Get the metadataValues property: The baseline metadata values. - * - * @return the metadataValues value. - */ - public List metadataValues() { - return this.metadataValues; - } - - /** - * Set the metadataValues property: The baseline metadata values. - * - * @param metadataValues the metadataValues value to set. - * @return the TimeSeriesBaseline object itself. - */ - public TimeSeriesBaseline withMetadataValues(List metadataValues) { - this.metadataValues = metadataValues; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (aggregation() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property aggregation in model TimeSeriesBaseline")); - } - if (dimensions() != null) { - dimensions().forEach(e -> e.validate()); - } - if (timestamps() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property timestamps in model TimeSeriesBaseline")); - } - if (data() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property data in model TimeSeriesBaseline")); - } else { - data().forEach(e -> e.validate()); - } - if (metadataValues() != null) { - metadataValues().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/TimeSeriesElement.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/TimeSeriesElement.java deleted file mode 100644 index 252ace3ef0f2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/TimeSeriesElement.java +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.fluent.models.MetadataValueInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** A time series result type. The discriminator value is always TimeSeries in this case. */ -@Fluent -public final class TimeSeriesElement { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TimeSeriesElement.class); - - /* - * the metadata values returned if $filter was specified in the call. - */ - @JsonProperty(value = "metadatavalues") - private List metadatavalues; - - /* - * An array of data points representing the metric values. This is only - * returned if a result type of data is specified. - */ - @JsonProperty(value = "data") - private List data; - - /** - * Get the metadatavalues property: the metadata values returned if $filter was specified in the call. - * - * @return the metadatavalues value. - */ - public List metadatavalues() { - return this.metadatavalues; - } - - /** - * Set the metadatavalues property: the metadata values returned if $filter was specified in the call. - * - * @param metadatavalues the metadatavalues value to set. - * @return the TimeSeriesElement object itself. - */ - public TimeSeriesElement withMetadatavalues(List metadatavalues) { - this.metadatavalues = metadatavalues; - return this; - } - - /** - * Get the data property: An array of data points representing the metric values. This is only returned if a result - * type of data is specified. - * - * @return the data value. - */ - public List data() { - return this.data; - } - - /** - * Set the data property: An array of data points representing the metric values. This is only returned if a result - * type of data is specified. - * - * @param data the data value to set. - * @return the TimeSeriesElement object itself. - */ - public TimeSeriesElement withData(List data) { - this.data = data; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (metadatavalues() != null) { - metadatavalues().forEach(e -> e.validate()); - } - if (data() != null) { - data().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/TimeWindow.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/TimeWindow.java deleted file mode 100644 index 231e26d7fc44..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/TimeWindow.java +++ /dev/null @@ -1,198 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** A specific date-time for the profile. */ -@Fluent -public final class TimeWindow { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TimeWindow.class); - - /* - * the timezone of the start and end times for the profile. Some examples - * of valid time zones are: Dateline Standard Time, UTC-11, Hawaiian - * Standard Time, Alaskan Standard Time, Pacific Standard Time (Mexico), - * Pacific Standard Time, US Mountain Standard Time, Mountain Standard Time - * (Mexico), Mountain Standard Time, Central America Standard Time, Central - * Standard Time, Central Standard Time (Mexico), Canada Central Standard - * Time, SA Pacific Standard Time, Eastern Standard Time, US Eastern - * Standard Time, Venezuela Standard Time, Paraguay Standard Time, Atlantic - * Standard Time, Central Brazilian Standard Time, SA Western Standard - * Time, Pacific SA Standard Time, Newfoundland Standard Time, E. South - * America Standard Time, Argentina Standard Time, SA Eastern Standard - * Time, Greenland Standard Time, Montevideo Standard Time, Bahia Standard - * Time, UTC-02, Mid-Atlantic Standard Time, Azores Standard Time, Cape - * Verde Standard Time, Morocco Standard Time, UTC, GMT Standard Time, - * Greenwich Standard Time, W. Europe Standard Time, Central Europe - * Standard Time, Romance Standard Time, Central European Standard Time, W. - * Central Africa Standard Time, Namibia Standard Time, Jordan Standard - * Time, GTB Standard Time, Middle East Standard Time, Egypt Standard Time, - * Syria Standard Time, E. Europe Standard Time, South Africa Standard - * Time, FLE Standard Time, Turkey Standard Time, Israel Standard Time, - * Kaliningrad Standard Time, Libya Standard Time, Arabic Standard Time, - * Arab Standard Time, Belarus Standard Time, Russian Standard Time, E. - * Africa Standard Time, Iran Standard Time, Arabian Standard Time, - * Azerbaijan Standard Time, Russia Time Zone 3, Mauritius Standard Time, - * Georgian Standard Time, Caucasus Standard Time, Afghanistan Standard - * Time, West Asia Standard Time, Ekaterinburg Standard Time, Pakistan - * Standard Time, India Standard Time, Sri Lanka Standard Time, Nepal - * Standard Time, Central Asia Standard Time, Bangladesh Standard Time, N. - * Central Asia Standard Time, Myanmar Standard Time, SE Asia Standard - * Time, North Asia Standard Time, China Standard Time, North Asia East - * Standard Time, Singapore Standard Time, W. Australia Standard Time, - * Taipei Standard Time, Ulaanbaatar Standard Time, Tokyo Standard Time, - * Korea Standard Time, Yakutsk Standard Time, Cen. Australia Standard - * Time, AUS Central Standard Time, E. Australia Standard Time, AUS Eastern - * Standard Time, West Pacific Standard Time, Tasmania Standard Time, - * Magadan Standard Time, Vladivostok Standard Time, Russia Time Zone 10, - * Central Pacific Standard Time, Russia Time Zone 11, New Zealand Standard - * Time, UTC+12, Fiji Standard Time, Kamchatka Standard Time, Tonga - * Standard Time, Samoa Standard Time, Line Islands Standard Time - */ - @JsonProperty(value = "timeZone") - private String timeZone; - - /* - * the start time for the profile in ISO 8601 format. - */ - @JsonProperty(value = "start", required = true) - private OffsetDateTime start; - - /* - * the end time for the profile in ISO 8601 format. - */ - @JsonProperty(value = "end", required = true) - private OffsetDateTime end; - - /** - * Get the timeZone property: the timezone of the start and end times for the profile. Some examples of valid time - * zones are: Dateline Standard Time, UTC-11, Hawaiian Standard Time, Alaskan Standard Time, Pacific Standard Time - * (Mexico), Pacific Standard Time, US Mountain Standard Time, Mountain Standard Time (Mexico), Mountain Standard - * Time, Central America Standard Time, Central Standard Time, Central Standard Time (Mexico), Canada Central - * Standard Time, SA Pacific Standard Time, Eastern Standard Time, US Eastern Standard Time, Venezuela Standard - * Time, Paraguay Standard Time, Atlantic Standard Time, Central Brazilian Standard Time, SA Western Standard Time, - * Pacific SA Standard Time, Newfoundland Standard Time, E. South America Standard Time, Argentina Standard Time, SA - * Eastern Standard Time, Greenland Standard Time, Montevideo Standard Time, Bahia Standard Time, UTC-02, - * Mid-Atlantic Standard Time, Azores Standard Time, Cape Verde Standard Time, Morocco Standard Time, UTC, GMT - * Standard Time, Greenwich Standard Time, W. Europe Standard Time, Central Europe Standard Time, Romance Standard - * Time, Central European Standard Time, W. Central Africa Standard Time, Namibia Standard Time, Jordan Standard - * Time, GTB Standard Time, Middle East Standard Time, Egypt Standard Time, Syria Standard Time, E. Europe Standard - * Time, South Africa Standard Time, FLE Standard Time, Turkey Standard Time, Israel Standard Time, Kaliningrad - * Standard Time, Libya Standard Time, Arabic Standard Time, Arab Standard Time, Belarus Standard Time, Russian - * Standard Time, E. Africa Standard Time, Iran Standard Time, Arabian Standard Time, Azerbaijan Standard Time, - * Russia Time Zone 3, Mauritius Standard Time, Georgian Standard Time, Caucasus Standard Time, Afghanistan Standard - * Time, West Asia Standard Time, Ekaterinburg Standard Time, Pakistan Standard Time, India Standard Time, Sri Lanka - * Standard Time, Nepal Standard Time, Central Asia Standard Time, Bangladesh Standard Time, N. Central Asia - * Standard Time, Myanmar Standard Time, SE Asia Standard Time, North Asia Standard Time, China Standard Time, North - * Asia East Standard Time, Singapore Standard Time, W. Australia Standard Time, Taipei Standard Time, Ulaanbaatar - * Standard Time, Tokyo Standard Time, Korea Standard Time, Yakutsk Standard Time, Cen. Australia Standard Time, AUS - * Central Standard Time, E. Australia Standard Time, AUS Eastern Standard Time, West Pacific Standard Time, - * Tasmania Standard Time, Magadan Standard Time, Vladivostok Standard Time, Russia Time Zone 10, Central Pacific - * Standard Time, Russia Time Zone 11, New Zealand Standard Time, UTC+12, Fiji Standard Time, Kamchatka Standard - * Time, Tonga Standard Time, Samoa Standard Time, Line Islands Standard Time. - * - * @return the timeZone value. - */ - public String timeZone() { - return this.timeZone; - } - - /** - * Set the timeZone property: the timezone of the start and end times for the profile. Some examples of valid time - * zones are: Dateline Standard Time, UTC-11, Hawaiian Standard Time, Alaskan Standard Time, Pacific Standard Time - * (Mexico), Pacific Standard Time, US Mountain Standard Time, Mountain Standard Time (Mexico), Mountain Standard - * Time, Central America Standard Time, Central Standard Time, Central Standard Time (Mexico), Canada Central - * Standard Time, SA Pacific Standard Time, Eastern Standard Time, US Eastern Standard Time, Venezuela Standard - * Time, Paraguay Standard Time, Atlantic Standard Time, Central Brazilian Standard Time, SA Western Standard Time, - * Pacific SA Standard Time, Newfoundland Standard Time, E. South America Standard Time, Argentina Standard Time, SA - * Eastern Standard Time, Greenland Standard Time, Montevideo Standard Time, Bahia Standard Time, UTC-02, - * Mid-Atlantic Standard Time, Azores Standard Time, Cape Verde Standard Time, Morocco Standard Time, UTC, GMT - * Standard Time, Greenwich Standard Time, W. Europe Standard Time, Central Europe Standard Time, Romance Standard - * Time, Central European Standard Time, W. Central Africa Standard Time, Namibia Standard Time, Jordan Standard - * Time, GTB Standard Time, Middle East Standard Time, Egypt Standard Time, Syria Standard Time, E. Europe Standard - * Time, South Africa Standard Time, FLE Standard Time, Turkey Standard Time, Israel Standard Time, Kaliningrad - * Standard Time, Libya Standard Time, Arabic Standard Time, Arab Standard Time, Belarus Standard Time, Russian - * Standard Time, E. Africa Standard Time, Iran Standard Time, Arabian Standard Time, Azerbaijan Standard Time, - * Russia Time Zone 3, Mauritius Standard Time, Georgian Standard Time, Caucasus Standard Time, Afghanistan Standard - * Time, West Asia Standard Time, Ekaterinburg Standard Time, Pakistan Standard Time, India Standard Time, Sri Lanka - * Standard Time, Nepal Standard Time, Central Asia Standard Time, Bangladesh Standard Time, N. Central Asia - * Standard Time, Myanmar Standard Time, SE Asia Standard Time, North Asia Standard Time, China Standard Time, North - * Asia East Standard Time, Singapore Standard Time, W. Australia Standard Time, Taipei Standard Time, Ulaanbaatar - * Standard Time, Tokyo Standard Time, Korea Standard Time, Yakutsk Standard Time, Cen. Australia Standard Time, AUS - * Central Standard Time, E. Australia Standard Time, AUS Eastern Standard Time, West Pacific Standard Time, - * Tasmania Standard Time, Magadan Standard Time, Vladivostok Standard Time, Russia Time Zone 10, Central Pacific - * Standard Time, Russia Time Zone 11, New Zealand Standard Time, UTC+12, Fiji Standard Time, Kamchatka Standard - * Time, Tonga Standard Time, Samoa Standard Time, Line Islands Standard Time. - * - * @param timeZone the timeZone value to set. - * @return the TimeWindow object itself. - */ - public TimeWindow withTimeZone(String timeZone) { - this.timeZone = timeZone; - return this; - } - - /** - * Get the start property: the start time for the profile in ISO 8601 format. - * - * @return the start value. - */ - public OffsetDateTime start() { - return this.start; - } - - /** - * Set the start property: the start time for the profile in ISO 8601 format. - * - * @param start the start value to set. - * @return the TimeWindow object itself. - */ - public TimeWindow withStart(OffsetDateTime start) { - this.start = start; - return this; - } - - /** - * Get the end property: the end time for the profile in ISO 8601 format. - * - * @return the end value. - */ - public OffsetDateTime end() { - return this.end; - } - - /** - * Set the end property: the end time for the profile in ISO 8601 format. - * - * @param end the end value to set. - * @return the TimeWindow object itself. - */ - public TimeWindow withEnd(OffsetDateTime end) { - this.end = end; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (start() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property start in model TimeWindow")); - } - if (end() == null) { - throw logger - .logExceptionAsError(new IllegalArgumentException("Missing required property end in model TimeWindow")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/TriggerCondition.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/TriggerCondition.java deleted file mode 100644 index abc9e84a1e2f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/TriggerCondition.java +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The condition that results in the Log Search rule. */ -@Fluent -public final class TriggerCondition { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TriggerCondition.class); - - /* - * Evaluation operation for rule - 'GreaterThan' or 'LessThan. - */ - @JsonProperty(value = "thresholdOperator", required = true) - private ConditionalOperator thresholdOperator; - - /* - * Result or count threshold based on which rule should be triggered. - */ - @JsonProperty(value = "threshold", required = true) - private double threshold; - - /* - * Trigger condition for metric query rule - */ - @JsonProperty(value = "metricTrigger") - private LogMetricTrigger metricTrigger; - - /** - * Get the thresholdOperator property: Evaluation operation for rule - 'GreaterThan' or 'LessThan. - * - * @return the thresholdOperator value. - */ - public ConditionalOperator thresholdOperator() { - return this.thresholdOperator; - } - - /** - * Set the thresholdOperator property: Evaluation operation for rule - 'GreaterThan' or 'LessThan. - * - * @param thresholdOperator the thresholdOperator value to set. - * @return the TriggerCondition object itself. - */ - public TriggerCondition withThresholdOperator(ConditionalOperator thresholdOperator) { - this.thresholdOperator = thresholdOperator; - return this; - } - - /** - * Get the threshold property: Result or count threshold based on which rule should be triggered. - * - * @return the threshold value. - */ - public double threshold() { - return this.threshold; - } - - /** - * Set the threshold property: Result or count threshold based on which rule should be triggered. - * - * @param threshold the threshold value to set. - * @return the TriggerCondition object itself. - */ - public TriggerCondition withThreshold(double threshold) { - this.threshold = threshold; - return this; - } - - /** - * Get the metricTrigger property: Trigger condition for metric query rule. - * - * @return the metricTrigger value. - */ - public LogMetricTrigger metricTrigger() { - return this.metricTrigger; - } - - /** - * Set the metricTrigger property: Trigger condition for metric query rule. - * - * @param metricTrigger the metricTrigger value to set. - * @return the TriggerCondition object itself. - */ - public TriggerCondition withMetricTrigger(LogMetricTrigger metricTrigger) { - this.metricTrigger = metricTrigger; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (thresholdOperator() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property thresholdOperator in model TriggerCondition")); - } - if (metricTrigger() != null) { - metricTrigger().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/Unit.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/Unit.java deleted file mode 100644 index 2ee3697c0029..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/Unit.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for Unit. */ -public final class Unit extends ExpandableStringEnum { - /** Static value Count for Unit. */ - public static final Unit COUNT = fromString("Count"); - - /** Static value Bytes for Unit. */ - public static final Unit BYTES = fromString("Bytes"); - - /** Static value Seconds for Unit. */ - public static final Unit SECONDS = fromString("Seconds"); - - /** Static value CountPerSecond for Unit. */ - public static final Unit COUNT_PER_SECOND = fromString("CountPerSecond"); - - /** Static value BytesPerSecond for Unit. */ - public static final Unit BYTES_PER_SECOND = fromString("BytesPerSecond"); - - /** Static value Percent for Unit. */ - public static final Unit PERCENT = fromString("Percent"); - - /** Static value MilliSeconds for Unit. */ - public static final Unit MILLI_SECONDS = fromString("MilliSeconds"); - - /** Static value ByteSeconds for Unit. */ - public static final Unit BYTE_SECONDS = fromString("ByteSeconds"); - - /** Static value Unspecified for Unit. */ - public static final Unit UNSPECIFIED = fromString("Unspecified"); - - /** Static value Cores for Unit. */ - public static final Unit CORES = fromString("Cores"); - - /** Static value MilliCores for Unit. */ - public static final Unit MILLI_CORES = fromString("MilliCores"); - - /** Static value NanoCores for Unit. */ - public static final Unit NANO_CORES = fromString("NanoCores"); - - /** Static value BitsPerSecond for Unit. */ - public static final Unit BITS_PER_SECOND = fromString("BitsPerSecond"); - - /** - * Creates or finds a Unit from its string representation. - * - * @param name a name to look for. - * @return the corresponding Unit. - */ - @JsonCreator - public static Unit fromString(String name) { - return fromString(name, Unit.class); - } - - /** @return known Unit values. */ - public static Collection values() { - return values(Unit.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/VoiceReceiver.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/VoiceReceiver.java deleted file mode 100644 index be02d0c3bb40..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/VoiceReceiver.java +++ /dev/null @@ -1,120 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** A voice receiver. */ -@Fluent -public final class VoiceReceiver { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VoiceReceiver.class); - - /* - * The name of the voice receiver. Names must be unique across all - * receivers within an action group. - */ - @JsonProperty(value = "name", required = true) - private String name; - - /* - * The country code of the voice receiver. - */ - @JsonProperty(value = "countryCode", required = true) - private String countryCode; - - /* - * The phone number of the voice receiver. - */ - @JsonProperty(value = "phoneNumber", required = true) - private String phoneNumber; - - /** - * Get the name property: The name of the voice receiver. Names must be unique across all receivers within an action - * group. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the voice receiver. Names must be unique across all receivers within an action - * group. - * - * @param name the name value to set. - * @return the VoiceReceiver object itself. - */ - public VoiceReceiver withName(String name) { - this.name = name; - return this; - } - - /** - * Get the countryCode property: The country code of the voice receiver. - * - * @return the countryCode value. - */ - public String countryCode() { - return this.countryCode; - } - - /** - * Set the countryCode property: The country code of the voice receiver. - * - * @param countryCode the countryCode value to set. - * @return the VoiceReceiver object itself. - */ - public VoiceReceiver withCountryCode(String countryCode) { - this.countryCode = countryCode; - return this; - } - - /** - * Get the phoneNumber property: The phone number of the voice receiver. - * - * @return the phoneNumber value. - */ - public String phoneNumber() { - return this.phoneNumber; - } - - /** - * Set the phoneNumber property: The phone number of the voice receiver. - * - * @param phoneNumber the phoneNumber value to set. - * @return the VoiceReceiver object itself. - */ - public VoiceReceiver withPhoneNumber(String phoneNumber) { - this.phoneNumber = phoneNumber; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property name in model VoiceReceiver")); - } - if (countryCode() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property countryCode in model VoiceReceiver")); - } - if (phoneNumber() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property phoneNumber in model VoiceReceiver")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/WebhookNotification.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/WebhookNotification.java deleted file mode 100644 index 65da3148dc12..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/WebhookNotification.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** Webhook notification of an autoscale event. */ -@Fluent -public final class WebhookNotification { - @JsonIgnore private final ClientLogger logger = new ClientLogger(WebhookNotification.class); - - /* - * the service address to receive the notification. - */ - @JsonProperty(value = "serviceUri") - private String serviceUri; - - /* - * a property bag of settings. This value can be empty. - */ - @JsonProperty(value = "properties") - private Map properties; - - /** - * Get the serviceUri property: the service address to receive the notification. - * - * @return the serviceUri value. - */ - public String serviceUri() { - return this.serviceUri; - } - - /** - * Set the serviceUri property: the service address to receive the notification. - * - * @param serviceUri the serviceUri value to set. - * @return the WebhookNotification object itself. - */ - public WebhookNotification withServiceUri(String serviceUri) { - this.serviceUri = serviceUri; - return this; - } - - /** - * Get the properties property: a property bag of settings. This value can be empty. - * - * @return the properties value. - */ - public Map properties() { - return this.properties; - } - - /** - * Set the properties property: a property bag of settings. This value can be empty. - * - * @param properties the properties value to set. - * @return the WebhookNotification object itself. - */ - public WebhookNotification withProperties(Map properties) { - this.properties = properties; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/WebhookReceiver.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/WebhookReceiver.java deleted file mode 100644 index ee204cbe14dc..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/WebhookReceiver.java +++ /dev/null @@ -1,219 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** A webhook receiver. */ -@Fluent -public final class WebhookReceiver { - @JsonIgnore private final ClientLogger logger = new ClientLogger(WebhookReceiver.class); - - /* - * The name of the webhook receiver. Names must be unique across all - * receivers within an action group. - */ - @JsonProperty(value = "name", required = true) - private String name; - - /* - * The URI where webhooks should be sent. - */ - @JsonProperty(value = "serviceUri", required = true) - private String serviceUri; - - /* - * Indicates whether to use common alert schema. - */ - @JsonProperty(value = "useCommonAlertSchema") - private Boolean useCommonAlertSchema; - - /* - * Indicates whether or not use AAD authentication. - */ - @JsonProperty(value = "useAadAuth") - private Boolean useAadAuth; - - /* - * Indicates the webhook app object Id for aad auth. - */ - @JsonProperty(value = "objectId") - private String objectId; - - /* - * Indicates the identifier uri for aad auth. - */ - @JsonProperty(value = "identifierUri") - private String identifierUri; - - /* - * Indicates the tenant id for aad auth. - */ - @JsonProperty(value = "tenantId") - private String tenantId; - - /** - * Get the name property: The name of the webhook receiver. Names must be unique across all receivers within an - * action group. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the webhook receiver. Names must be unique across all receivers within an - * action group. - * - * @param name the name value to set. - * @return the WebhookReceiver object itself. - */ - public WebhookReceiver withName(String name) { - this.name = name; - return this; - } - - /** - * Get the serviceUri property: The URI where webhooks should be sent. - * - * @return the serviceUri value. - */ - public String serviceUri() { - return this.serviceUri; - } - - /** - * Set the serviceUri property: The URI where webhooks should be sent. - * - * @param serviceUri the serviceUri value to set. - * @return the WebhookReceiver object itself. - */ - public WebhookReceiver withServiceUri(String serviceUri) { - this.serviceUri = serviceUri; - return this; - } - - /** - * Get the useCommonAlertSchema property: Indicates whether to use common alert schema. - * - * @return the useCommonAlertSchema value. - */ - public Boolean useCommonAlertSchema() { - return this.useCommonAlertSchema; - } - - /** - * Set the useCommonAlertSchema property: Indicates whether to use common alert schema. - * - * @param useCommonAlertSchema the useCommonAlertSchema value to set. - * @return the WebhookReceiver object itself. - */ - public WebhookReceiver withUseCommonAlertSchema(Boolean useCommonAlertSchema) { - this.useCommonAlertSchema = useCommonAlertSchema; - return this; - } - - /** - * Get the useAadAuth property: Indicates whether or not use AAD authentication. - * - * @return the useAadAuth value. - */ - public Boolean useAadAuth() { - return this.useAadAuth; - } - - /** - * Set the useAadAuth property: Indicates whether or not use AAD authentication. - * - * @param useAadAuth the useAadAuth value to set. - * @return the WebhookReceiver object itself. - */ - public WebhookReceiver withUseAadAuth(Boolean useAadAuth) { - this.useAadAuth = useAadAuth; - return this; - } - - /** - * Get the objectId property: Indicates the webhook app object Id for aad auth. - * - * @return the objectId value. - */ - public String objectId() { - return this.objectId; - } - - /** - * Set the objectId property: Indicates the webhook app object Id for aad auth. - * - * @param objectId the objectId value to set. - * @return the WebhookReceiver object itself. - */ - public WebhookReceiver withObjectId(String objectId) { - this.objectId = objectId; - return this; - } - - /** - * Get the identifierUri property: Indicates the identifier uri for aad auth. - * - * @return the identifierUri value. - */ - public String identifierUri() { - return this.identifierUri; - } - - /** - * Set the identifierUri property: Indicates the identifier uri for aad auth. - * - * @param identifierUri the identifierUri value to set. - * @return the WebhookReceiver object itself. - */ - public WebhookReceiver withIdentifierUri(String identifierUri) { - this.identifierUri = identifierUri; - return this; - } - - /** - * Get the tenantId property: Indicates the tenant id for aad auth. - * - * @return the tenantId value. - */ - public String tenantId() { - return this.tenantId; - } - - /** - * Set the tenantId property: Indicates the tenant id for aad auth. - * - * @param tenantId the tenantId value to set. - * @return the WebhookReceiver object itself. - */ - public WebhookReceiver withTenantId(String tenantId) { - this.tenantId = tenantId; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property name in model WebhookReceiver")); - } - if (serviceUri() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property serviceUri in model WebhookReceiver")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/WebtestLocationAvailabilityCriteria.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/WebtestLocationAvailabilityCriteria.java deleted file mode 100644 index 607e5063f8f3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/WebtestLocationAvailabilityCriteria.java +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** Specifies the metric alert rule criteria for a web test resource. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "odata\\.type") -@JsonTypeName("Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria") -@JsonFlatten -@Fluent -public class WebtestLocationAvailabilityCriteria extends MetricAlertCriteria { - @JsonIgnore private final ClientLogger logger = new ClientLogger(WebtestLocationAvailabilityCriteria.class); - - /* - * The Application Insights web test Id. - */ - @JsonProperty(value = "webTestId", required = true) - private String webTestId; - - /* - * The Application Insights resource Id. - */ - @JsonProperty(value = "componentId", required = true) - private String componentId; - - /* - * The number of failed locations. - */ - @JsonProperty(value = "failedLocationCount", required = true) - private float failedLocationCount; - - /** - * Get the webTestId property: The Application Insights web test Id. - * - * @return the webTestId value. - */ - public String webTestId() { - return this.webTestId; - } - - /** - * Set the webTestId property: The Application Insights web test Id. - * - * @param webTestId the webTestId value to set. - * @return the WebtestLocationAvailabilityCriteria object itself. - */ - public WebtestLocationAvailabilityCriteria withWebTestId(String webTestId) { - this.webTestId = webTestId; - return this; - } - - /** - * Get the componentId property: The Application Insights resource Id. - * - * @return the componentId value. - */ - public String componentId() { - return this.componentId; - } - - /** - * Set the componentId property: The Application Insights resource Id. - * - * @param componentId the componentId value to set. - * @return the WebtestLocationAvailabilityCriteria object itself. - */ - public WebtestLocationAvailabilityCriteria withComponentId(String componentId) { - this.componentId = componentId; - return this; - } - - /** - * Get the failedLocationCount property: The number of failed locations. - * - * @return the failedLocationCount value. - */ - public float failedLocationCount() { - return this.failedLocationCount; - } - - /** - * Set the failedLocationCount property: The number of failed locations. - * - * @param failedLocationCount the failedLocationCount value to set. - * @return the WebtestLocationAvailabilityCriteria object itself. - */ - public WebtestLocationAvailabilityCriteria withFailedLocationCount(float failedLocationCount) { - this.failedLocationCount = failedLocationCount; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (webTestId() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property webTestId in model WebtestLocationAvailabilityCriteria")); - } - if (componentId() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property componentId in model WebtestLocationAvailabilityCriteria")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/WindowsEventLogDataSource.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/WindowsEventLogDataSource.java deleted file mode 100644 index 6e0aa7a225d0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/WindowsEventLogDataSource.java +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** - * Definition of which Windows Event Log events will be collected and how they will be collected. Only collected from - * Windows machines. - */ -@Fluent -public final class WindowsEventLogDataSource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(WindowsEventLogDataSource.class); - - /* - * List of streams that this data source will be sent to. - * A stream indicates what schema will be used for this data and usually - * what table in Log Analytics the data will be sent to. - */ - @JsonProperty(value = "streams") - private List streams; - - /* - * A list of Windows Event Log queries in XPATH format. - */ - @JsonProperty(value = "xPathQueries") - private List xPathQueries; - - /* - * A friendly name for the data source. - * This name should be unique across all data sources (regardless of type) - * within the data collection rule. - */ - @JsonProperty(value = "name") - private String name; - - /** - * Get the streams property: List of streams that this data source will be sent to. A stream indicates what schema - * will be used for this data and usually what table in Log Analytics the data will be sent to. - * - * @return the streams value. - */ - public List streams() { - return this.streams; - } - - /** - * Set the streams property: List of streams that this data source will be sent to. A stream indicates what schema - * will be used for this data and usually what table in Log Analytics the data will be sent to. - * - * @param streams the streams value to set. - * @return the WindowsEventLogDataSource object itself. - */ - public WindowsEventLogDataSource withStreams(List streams) { - this.streams = streams; - return this; - } - - /** - * Get the xPathQueries property: A list of Windows Event Log queries in XPATH format. - * - * @return the xPathQueries value. - */ - public List xPathQueries() { - return this.xPathQueries; - } - - /** - * Set the xPathQueries property: A list of Windows Event Log queries in XPATH format. - * - * @param xPathQueries the xPathQueries value to set. - * @return the WindowsEventLogDataSource object itself. - */ - public WindowsEventLogDataSource withXPathQueries(List xPathQueries) { - this.xPathQueries = xPathQueries; - return this; - } - - /** - * Get the name property: A friendly name for the data source. This name should be unique across all data sources - * (regardless of type) within the data collection rule. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: A friendly name for the data source. This name should be unique across all data sources - * (regardless of type) within the data collection rule. - * - * @param name the name value to set. - * @return the WindowsEventLogDataSource object itself. - */ - public WindowsEventLogDataSource withName(String name) { - this.name = name; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/WorkspaceInfo.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/WorkspaceInfo.java deleted file mode 100644 index 8411f5e11ff0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/WorkspaceInfo.java +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Information about a Log Analytics Workspace. */ -@JsonFlatten -@Fluent -public class WorkspaceInfo { - @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkspaceInfo.class); - - /* - * Azure Resource Manager identifier of the Log Analytics Workspace. - */ - @JsonProperty(value = "id", required = true) - private String id; - - /* - * Location of the Log Analytics workspace. - */ - @JsonProperty(value = "location", required = true) - private String location; - - /* - * Log Analytics workspace identifier. - */ - @JsonProperty(value = "properties.customerId", required = true) - private String customerId; - - /** - * Get the id property: Azure Resource Manager identifier of the Log Analytics Workspace. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: Azure Resource Manager identifier of the Log Analytics Workspace. - * - * @param id the id value to set. - * @return the WorkspaceInfo object itself. - */ - public WorkspaceInfo withId(String id) { - this.id = id; - return this; - } - - /** - * Get the location property: Location of the Log Analytics workspace. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Set the location property: Location of the Log Analytics workspace. - * - * @param location the location value to set. - * @return the WorkspaceInfo object itself. - */ - public WorkspaceInfo withLocation(String location) { - this.location = location; - return this; - } - - /** - * Get the customerId property: Log Analytics workspace identifier. - * - * @return the customerId value. - */ - public String customerId() { - return this.customerId; - } - - /** - * Set the customerId property: Log Analytics workspace identifier. - * - * @param customerId the customerId value to set. - * @return the WorkspaceInfo object itself. - */ - public WorkspaceInfo withCustomerId(String customerId) { - this.customerId = customerId; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (id() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property id in model WorkspaceInfo")); - } - if (location() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property location in model WorkspaceInfo")); - } - if (customerId() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property customerId in model WorkspaceInfo")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/package-info.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/package-info.java deleted file mode 100644 index d36729466a88..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** Package containing the data models for MonitorClient. Monitor Management Client. */ -package com.azure.resourcemanager.monitor.models; diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/package-info.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/package-info.java deleted file mode 100644 index c1cfbed1f432..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** Package containing the classes for MonitorClient. Monitor Management Client. */ -package com.azure.resourcemanager.monitor; diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/module-info.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/module-info.java deleted file mode 100644 index 0c03c6869716..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/module-info.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -module com.azure.resourcemanager.monitor { - requires transitive com.azure.resourcemanager.resources; - - // export public APIs of monitor - exports com.azure.resourcemanager.monitor; - exports com.azure.resourcemanager.monitor.fluent; - exports com.azure.resourcemanager.monitor.fluent.models; - exports com.azure.resourcemanager.monitor.models; - - // open packages specifically for azure core and jackson - opens com.azure.resourcemanager.monitor.fluent.models to - com.azure.core, - com.fasterxml.jackson.databind; - opens com.azure.resourcemanager.monitor.models to - com.azure.core, - com.fasterxml.jackson.databind; -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/samples/java/com/azure/resourcemanager/monitor/ReadmeSamples.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/samples/java/com/azure/resourcemanager/monitor/ReadmeSamples.java deleted file mode 100644 index fd5c06cc5706..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/samples/java/com/azure/resourcemanager/monitor/ReadmeSamples.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.monitor; - -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpMethod; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.util.serializer.JacksonAdapter; -import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.identity.DefaultAzureCredentialBuilder; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.ArrayNode; - -import java.io.IOException; -import java.util.HashMap; - -public class ReadmeSamples { - - public void authenticate() { - // BEGIN: com.azure.resourcemanager.monitor.authenticate - String armEndpoint = "https://management.."; - AzureProfile profile = new AzureProfile(getAzureEnvironmentFromArmEndpoint(armEndpoint)); - TokenCredential credential = new DefaultAzureCredentialBuilder() - .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) - .build(); - MonitorManager manager = MonitorManager - .authenticate(credential, profile); - // END: com.azure.resourcemanager.monitor.authenticate - } - - // BEGIN: com.azure.resourcemanager.monitor.getazureenvironment - private static AzureEnvironment getAzureEnvironmentFromArmEndpoint(String armEndpoint) { - // Create HTTP client and request - HttpClient httpClient = HttpClient.createDefault(); - - HttpRequest request = new HttpRequest(HttpMethod.GET, - String.format("%s/metadata/endpoints?api-version=2019-10-01", armEndpoint)) - .setHeader("accept", "application/json"); - - // Execute the request and read the response - HttpResponse response = httpClient.send(request).block(); - if (response.getStatusCode() != 200) { - throw new RuntimeException("Failed : HTTP error code : " + response.getStatusCode()); - } - String body = response.getBodyAsString().block(); - try { - ArrayNode metadataArray = JacksonAdapter.createDefaultSerializerAdapter() - .deserialize(body, ArrayNode.class, SerializerEncoding.JSON); - - if (metadataArray == null || metadataArray.isEmpty()) { - throw new RuntimeException("Failed to find metadata : " + body); - } - - JsonNode metadata = metadataArray.iterator().next(); - AzureEnvironment azureEnvironment = new AzureEnvironment(new HashMap() { - { - put("managementEndpointUrl", metadata.at("/authentication/audiences/0").asText()); - put("resourceManagerEndpointUrl", armEndpoint); - put("galleryEndpointUrl", metadata.at("/gallery").asText()); - put("activeDirectoryEndpointUrl", metadata.at("/authentication/loginEndpoint").asText()); - put("activeDirectoryResourceId", metadata.at("/authentication/audiences/0").asText()); - put("activeDirectoryGraphResourceId", metadata.at("/graph").asText()); - put("storageEndpointSuffix", "." + metadata.at("/suffixes/storage").asText()); - put("keyVaultDnsSuffix", "." + metadata.at("/suffixes/keyVaultDns").asText()); - } - }); - return azureEnvironment; - } catch (IOException ioe) { - ioe.printStackTrace(); - throw new RuntimeException(ioe); - } - } - // END: com.azure.resourcemanager.monitor.getazureenvironment -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/test/java/com/azure/resourcemanager/monitor/ActionGroupsTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/test/java/com/azure/resourcemanager/monitor/ActionGroupsTests.java deleted file mode 100644 index 2060164b6a71..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/test/java/com/azure/resourcemanager/monitor/ActionGroupsTests.java +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.monitor; - -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.monitor.models.ActionGroup; -import com.azure.resourcemanager.test.utils.TestUtilities; -import com.azure.core.management.Region; -import com.azure.core.management.profile.AzureProfile; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public class ActionGroupsTests extends MonitorManagementTest { - private String rgName = ""; - - @Override - protected void initializeClients(HttpPipeline httpPipeline, AzureProfile profile) { - rgName = generateRandomResourceName("jMonitor_", 18); - - super.initializeClients(httpPipeline, profile); - } - - @Override - protected void cleanUpResources() { - resourceManager.resourceGroups().beginDeleteByName(rgName); - } - - @Test - public void canCRUDActionGroups() throws Exception { - - ActionGroup ag = - monitorManager - .actionGroups() - .define("simpleActionGroup") - .withNewResourceGroup(rgName, locationOrDefault(Region.AUSTRALIA_SOUTHEAST)) - .defineReceiver("first") - .withPushNotification("azurepush@outlook.com") - .withEmail("justemail@outlook.com") - .withSms("1", "4255655665") - .withVoice("1", "2062066050") - .withWebhook("https://www.rate.am") - .attach() - .defineReceiver("second") - .withEmail("secondemail@outlook.com") - .withWebhook("https://www.spyur.am") - .attach() - .create(); - Assertions.assertNotNull(ag); - Assertions.assertEquals("simpleAction", ag.shortName()); - Assertions.assertNotNull(ag.pushNotificationReceivers()); - Assertions.assertEquals(1, ag.pushNotificationReceivers().size()); - Assertions.assertNotNull(ag.smsReceivers()); - Assertions.assertEquals(1, ag.smsReceivers().size()); - Assertions.assertNotNull(ag.voiceReceivers()); - Assertions.assertEquals(1, ag.voiceReceivers().size()); - Assertions.assertNotNull(ag.emailReceivers()); - Assertions.assertEquals(2, ag.emailReceivers().size()); - Assertions.assertNotNull(ag.webhookReceivers()); - Assertions.assertEquals(2, ag.webhookReceivers().size()); - Assertions.assertTrue(ag.emailReceivers().get(0).name().startsWith("first")); - Assertions.assertTrue(ag.emailReceivers().get(1).name().startsWith("second")); - - ag - .update() - .defineReceiver("third") - .withWebhook("https://www.news.am") - .attach() - .updateReceiver("first") - .withoutSms() - .parent() - .withoutReceiver("second") - .apply(); - - Assertions.assertEquals(2, ag.webhookReceivers().size()); - Assertions.assertEquals(1, ag.emailReceivers().size()); - Assertions.assertEquals(0, ag.smsReceivers().size()); - - ActionGroup agGet = monitorManager.actionGroups().getById(ag.id()); - Assertions.assertEquals("simpleAction", agGet.shortName()); - Assertions.assertEquals(2, agGet.webhookReceivers().size()); - Assertions.assertEquals(1, agGet.emailReceivers().size()); - Assertions.assertEquals(0, agGet.smsReceivers().size()); - - monitorManager - .actionGroups() - .enableReceiver(agGet.resourceGroupName(), agGet.name(), agGet.emailReceivers().get(0).name()); - - PagedIterable agListByRg = monitorManager.actionGroups().listByResourceGroup(rgName); - Assertions.assertNotNull(agListByRg); - Assertions.assertEquals(1, TestUtilities.getSize(agListByRg)); - - PagedIterable agList = monitorManager.actionGroups().list(); - Assertions.assertNotNull(agListByRg); - Assertions.assertTrue(TestUtilities.getSize(agListByRg) > 0); - - monitorManager.actionGroups().deleteById(ag.id()); - agListByRg = monitorManager.actionGroups().listByResourceGroup(rgName); - Assertions.assertEquals(0, TestUtilities.getSize(agListByRg)); - - resourceManager.resourceGroups().beginDeleteByName(rgName); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/test/java/com/azure/resourcemanager/monitor/AlertsTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/test/java/com/azure/resourcemanager/monitor/AlertsTests.java deleted file mode 100644 index 9004c9cff8cb..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/test/java/com/azure/resourcemanager/monitor/AlertsTests.java +++ /dev/null @@ -1,559 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.monitor; - -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.compute.models.KnownLinuxVirtualMachineImage; -import com.azure.resourcemanager.compute.models.VirtualMachine; -import com.azure.resourcemanager.monitor.models.ActionGroup; -import com.azure.resourcemanager.monitor.models.ActivityLogAlert; -import com.azure.resourcemanager.monitor.models.DynamicThresholdFailingPeriods; -import com.azure.resourcemanager.monitor.models.DynamicThresholdOperator; -import com.azure.resourcemanager.monitor.models.DynamicThresholdSensitivity; -import com.azure.resourcemanager.monitor.models.MetricAlert; -import com.azure.resourcemanager.monitor.models.MetricAlertCondition; -import com.azure.resourcemanager.monitor.models.MetricAlertRuleCondition; -import com.azure.resourcemanager.monitor.models.MetricAlertRuleTimeAggregation; -import com.azure.resourcemanager.monitor.models.MetricDimension; -import com.azure.resourcemanager.monitor.models.MetricDynamicAlertCondition; -import com.azure.resourcemanager.test.utils.TestUtilities; -import com.azure.core.management.Region; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.storage.models.StorageAccount; -import java.time.Duration; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.Iterator; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public class AlertsTests extends MonitorManagementTest { - private String rgName = ""; - private String saName = ""; - - @Override - protected void initializeClients(HttpPipeline httpPipeline, AzureProfile profile) { - rgName = generateRandomResourceName("jMonitor_", 18); - saName = generateRandomResourceName("jMonitorSA", 18); - - super.initializeClients(httpPipeline, profile); - } - - @Override - protected void cleanUpResources() { - resourceManager.resourceGroups().beginDeleteByName(rgName); - } - - @Test - public void canCRUDMetricAlerts() throws Exception { - - try { - StorageAccount sa = - storageManager - .storageAccounts() - .define(saName) - .withRegion(locationOrDefault(Region.US_EAST2)) - .withNewResourceGroup(rgName) - .withOnlyHttpsTraffic() - .create(); - - ActionGroup ag = - monitorManager - .actionGroups() - .define("simpleActionGroup") - .withExistingResourceGroup(rgName) - .defineReceiver("first") - .withPushNotification("azurepush@outlook.com") - .withEmail("justemail@outlook.com") - .withSms("1", "4255655665") - .withVoice("1", "2062066050") - .withWebhook("https://www.rate.am") - .attach() - .defineReceiver("second") - .withEmail("secondemail@outlook.com") - .withWebhook("https://www.spyur.am") - .attach() - .create(); - - MetricAlert ma = - monitorManager - .alertRules() - .metricAlerts() - .define("somename") - .withExistingResourceGroup(rgName) - .withTargetResource(sa.id()) - .withPeriod(Duration.ofMinutes(15)) - .withFrequency(Duration.ofMinutes(1)) - .withAlertDetails( - 3, - "This alert rule is for U3 - Single resource multiple-criteria with dimensions-single" - + " timeseries") - .withActionGroups(ag.id()) - .defineAlertCriteria("Metric1") - .withMetricName("Transactions", "Microsoft.Storage/storageAccounts") - .withCondition(MetricAlertRuleTimeAggregation.TOTAL, MetricAlertRuleCondition.GREATER_THAN, 100) - .withDimension("ResponseType", "Success") - .withDimension("ApiName", "GetBlob") - .attach() - .create(); - - Assertions.assertNotNull(ma); - Assertions.assertEquals(1, ma.scopes().size()); - Assertions.assertEquals(sa.id(), ma.scopes().iterator().next()); - Assertions - .assertEquals( - "This alert rule is for U3 - Single resource multiple-criteria with dimensions-single timeseries", - ma.description()); - Assertions.assertEquals(Duration.ofMinutes(15), ma.windowSize()); - Assertions.assertEquals(Duration.ofMinutes(1), ma.evaluationFrequency()); - Assertions.assertEquals(3, ma.severity()); - Assertions.assertEquals(true, ma.enabled()); - Assertions.assertEquals(true, ma.autoMitigate()); - Assertions.assertEquals(1, ma.actionGroupIds().size()); - Assertions.assertEquals(ag.id(), ma.actionGroupIds().iterator().next()); - Assertions.assertEquals(1, ma.alertCriterias().size()); - MetricAlertCondition ac1 = ma.alertCriterias().values().iterator().next(); - Assertions.assertEquals("Metric1", ac1.name()); - Assertions.assertEquals("Transactions", ac1.metricName()); - Assertions.assertEquals("Microsoft.Storage/storageAccounts", ac1.metricNamespace()); - Assertions.assertEquals(MetricAlertRuleCondition.GREATER_THAN, ac1.condition()); - Assertions.assertEquals(MetricAlertRuleTimeAggregation.TOTAL, ac1.timeAggregation()); - Assertions.assertEquals(100, ac1.threshold(), 0.001); - Assertions.assertEquals(2, ac1.dimensions().size()); - Iterator iterator = ac1.dimensions().iterator(); - MetricDimension d2 = iterator.next(); - MetricDimension d1 = iterator.next(); - Assertions.assertEquals("ResponseType", d1.name()); - Assertions.assertEquals(1, d1.values().size()); - Assertions.assertEquals("Success", d1.values().get(0)); - Assertions.assertEquals("ApiName", d2.name()); - Assertions.assertEquals(1, d2.values().size()); - Assertions.assertEquals("GetBlob", d2.values().get(0)); - - MetricAlert maFromGet = monitorManager.alertRules().metricAlerts().getById(ma.id()); - Assertions.assertNotNull(maFromGet); - Assertions.assertEquals(ma.scopes().size(), maFromGet.scopes().size()); - Assertions.assertEquals(ma.scopes().iterator().next(), maFromGet.scopes().iterator().next()); - Assertions.assertEquals(ma.description(), maFromGet.description()); - Assertions.assertEquals(ma.windowSize(), maFromGet.windowSize()); - Assertions.assertEquals(ma.evaluationFrequency(), maFromGet.evaluationFrequency()); - Assertions.assertEquals(ma.severity(), maFromGet.severity()); - Assertions.assertEquals(ma.enabled(), maFromGet.enabled()); - Assertions.assertEquals(ma.autoMitigate(), maFromGet.autoMitigate()); - Assertions.assertEquals(ma.actionGroupIds().size(), maFromGet.actionGroupIds().size()); - Assertions - .assertEquals(ma.actionGroupIds().iterator().next(), maFromGet.actionGroupIds().iterator().next()); - Assertions.assertEquals(ma.alertCriterias().size(), maFromGet.alertCriterias().size()); - ac1 = maFromGet.alertCriterias().values().iterator().next(); - Assertions.assertEquals("Metric1", ac1.name()); - Assertions.assertEquals("Transactions", ac1.metricName()); - Assertions.assertEquals("Microsoft.Storage/storageAccounts", ac1.metricNamespace()); - Assertions.assertEquals(MetricAlertRuleCondition.GREATER_THAN, ac1.condition()); - Assertions.assertEquals(MetricAlertRuleTimeAggregation.TOTAL, ac1.timeAggregation()); - Assertions.assertEquals(100, ac1.threshold(), 0.001); - Assertions.assertEquals(2, ac1.dimensions().size()); - iterator = ac1.dimensions().iterator(); - d2 = iterator.next(); - d1 = iterator.next(); - Assertions.assertEquals("ResponseType", d1.name()); - Assertions.assertEquals(1, d1.values().size()); - Assertions.assertEquals("Success", d1.values().get(0)); - Assertions.assertEquals("ApiName", d2.name()); - Assertions.assertEquals(1, d2.values().size()); - Assertions.assertEquals("GetBlob", d2.values().get(0)); - - ma - .update() - .withRuleDisabled() - .updateAlertCriteria("Metric1") - .withCondition(MetricAlertRuleTimeAggregation.TOTAL, MetricAlertRuleCondition.GREATER_THAN, 99) - .parent() - .defineAlertCriteria("Metric2") - .withMetricName("SuccessE2ELatency", "Microsoft.Storage/storageAccounts") - .withCondition(MetricAlertRuleTimeAggregation.AVERAGE, MetricAlertRuleCondition.GREATER_THAN, 200) - .withDimension("ApiName", "GetBlob") - .attach() - .apply(); - - Assertions.assertNotNull(ma); - Assertions.assertEquals(1, ma.scopes().size()); - Assertions.assertEquals(sa.id(), ma.scopes().iterator().next()); - Assertions - .assertEquals( - "This alert rule is for U3 - Single resource multiple-criteria with dimensions-single timeseries", - ma.description()); - Assertions.assertEquals(Duration.ofMinutes(15), ma.windowSize()); - Assertions.assertEquals(Duration.ofMinutes(1), ma.evaluationFrequency()); - Assertions.assertEquals(3, ma.severity()); - Assertions.assertEquals(false, ma.enabled()); - Assertions.assertEquals(true, ma.autoMitigate()); - Assertions.assertEquals(1, ma.actionGroupIds().size()); - Assertions.assertEquals(ag.id(), ma.actionGroupIds().iterator().next()); - Assertions.assertEquals(2, ma.alertCriterias().size()); - Iterator maCriteriaIterator = ma.alertCriterias().values().iterator(); - ac1 = maCriteriaIterator.next(); - MetricAlertCondition ac2 = maCriteriaIterator.next(); - Assertions.assertEquals("Metric1", ac1.name()); - Assertions.assertEquals("Transactions", ac1.metricName()); - Assertions.assertEquals(MetricAlertRuleCondition.GREATER_THAN, ac1.condition()); - Assertions.assertEquals(MetricAlertRuleTimeAggregation.TOTAL, ac1.timeAggregation()); - Assertions.assertEquals(99, ac1.threshold(), 0.001); - Assertions.assertEquals(2, ac1.dimensions().size()); - iterator = ac1.dimensions().iterator(); - d2 = iterator.next(); - d1 = iterator.next(); - Assertions.assertEquals("ResponseType", d1.name()); - Assertions.assertEquals(1, d1.values().size()); - Assertions.assertEquals("Success", d1.values().get(0)); - Assertions.assertEquals("ApiName", d2.name()); - Assertions.assertEquals(1, d2.values().size()); - Assertions.assertEquals("GetBlob", d2.values().get(0)); - - Assertions.assertEquals("Metric2", ac2.name()); - Assertions.assertEquals("SuccessE2ELatency", ac2.metricName()); - Assertions.assertEquals("Microsoft.Storage/storageAccounts", ac2.metricNamespace()); - Assertions.assertEquals(MetricAlertRuleCondition.GREATER_THAN, ac2.condition()); - Assertions.assertEquals(MetricAlertRuleTimeAggregation.AVERAGE, ac2.timeAggregation()); - Assertions.assertEquals(200, ac2.threshold(), 0.001); - Assertions.assertEquals(1, ac2.dimensions().size()); - d1 = ac2.dimensions().iterator().next(); - Assertions.assertEquals("ApiName", d1.name()); - Assertions.assertEquals(1, d1.values().size()); - Assertions.assertEquals("GetBlob", d1.values().get(0)); - - maFromGet = monitorManager.alertRules().metricAlerts().getById(ma.id()); - - Assertions.assertNotNull(maFromGet); - Assertions.assertEquals(1, maFromGet.scopes().size()); - Assertions.assertEquals(sa.id(), maFromGet.scopes().iterator().next()); - Assertions - .assertEquals( - "This alert rule is for U3 - Single resource multiple-criteria with dimensions-single timeseries", - ma.description()); - Assertions.assertEquals(Duration.ofMinutes(15), maFromGet.windowSize()); - Assertions.assertEquals(Duration.ofMinutes(1), maFromGet.evaluationFrequency()); - Assertions.assertEquals(3, maFromGet.severity()); - Assertions.assertEquals(false, maFromGet.enabled()); - Assertions.assertEquals(true, maFromGet.autoMitigate()); - Assertions.assertEquals(1, maFromGet.actionGroupIds().size()); - Assertions.assertEquals(ag.id(), maFromGet.actionGroupIds().iterator().next()); - Assertions.assertEquals(2, maFromGet.alertCriterias().size()); - maCriteriaIterator = maFromGet.alertCriterias().values().iterator(); - ac1 = maCriteriaIterator.next(); - ac2 = maCriteriaIterator.next(); - Assertions.assertEquals("Metric1", ac1.name()); - Assertions.assertEquals("Transactions", ac1.metricName()); - Assertions.assertEquals(MetricAlertRuleCondition.GREATER_THAN, ac1.condition()); - Assertions.assertEquals(MetricAlertRuleTimeAggregation.TOTAL, ac1.timeAggregation()); - Assertions.assertEquals(99, ac1.threshold(), 0.001); - Assertions.assertEquals(2, ac1.dimensions().size()); - iterator = ac1.dimensions().iterator(); - d2 = iterator.next(); - d1 = iterator.next(); - Assertions.assertEquals("ResponseType", d1.name()); - Assertions.assertEquals(1, d1.values().size()); - Assertions.assertEquals("Success", d1.values().get(0)); - Assertions.assertEquals("ApiName", d2.name()); - Assertions.assertEquals(1, d2.values().size()); - Assertions.assertEquals("GetBlob", d2.values().get(0)); - - Assertions.assertEquals("Metric2", ac2.name()); - Assertions.assertEquals("SuccessE2ELatency", ac2.metricName()); - Assertions.assertEquals("Microsoft.Storage/storageAccounts", ac2.metricNamespace()); - Assertions.assertEquals(MetricAlertRuleCondition.GREATER_THAN, ac2.condition()); - Assertions.assertEquals(MetricAlertRuleTimeAggregation.AVERAGE, ac2.timeAggregation()); - Assertions.assertEquals(200, ac2.threshold(), 0.001); - Assertions.assertEquals(1, ac2.dimensions().size()); - d1 = ac2.dimensions().iterator().next(); - Assertions.assertEquals("ApiName", d1.name()); - Assertions.assertEquals(1, d1.values().size()); - Assertions.assertEquals("GetBlob", d1.values().get(0)); - - PagedIterable alertsInRg = - monitorManager.alertRules().metricAlerts().listByResourceGroup(rgName); - - Assertions.assertEquals(1, TestUtilities.getSize(alertsInRg)); - maFromGet = alertsInRg.iterator().next(); - - Assertions.assertNotNull(maFromGet); - Assertions.assertEquals(1, maFromGet.scopes().size()); - Assertions.assertEquals(sa.id(), maFromGet.scopes().iterator().next()); - Assertions - .assertEquals( - "This alert rule is for U3 - Single resource multiple-criteria with dimensions-single timeseries", - ma.description()); - Assertions.assertEquals(Duration.ofMinutes(15), maFromGet.windowSize()); - Assertions.assertEquals(Duration.ofMinutes(1), maFromGet.evaluationFrequency()); - Assertions.assertEquals(3, maFromGet.severity()); - Assertions.assertEquals(false, maFromGet.enabled()); - Assertions.assertEquals(true, maFromGet.autoMitigate()); - Assertions.assertEquals(1, maFromGet.actionGroupIds().size()); - Assertions.assertEquals(ag.id(), maFromGet.actionGroupIds().iterator().next()); - Assertions.assertEquals(2, maFromGet.alertCriterias().size()); - maCriteriaIterator = maFromGet.alertCriterias().values().iterator(); - ac1 = maCriteriaIterator.next(); - ac2 = maCriteriaIterator.next(); - Assertions.assertEquals("Metric1", ac1.name()); - Assertions.assertEquals("Transactions", ac1.metricName()); - Assertions.assertEquals(MetricAlertRuleCondition.GREATER_THAN, ac1.condition()); - Assertions.assertEquals(MetricAlertRuleTimeAggregation.TOTAL, ac1.timeAggregation()); - Assertions.assertEquals(99, ac1.threshold(), 0.001); - Assertions.assertEquals(2, ac1.dimensions().size()); - iterator = ac1.dimensions().iterator(); - d2 = iterator.next(); - d1 = iterator.next(); - Assertions.assertEquals("ResponseType", d1.name()); - Assertions.assertEquals(1, d1.values().size()); - Assertions.assertEquals("Success", d1.values().get(0)); - Assertions.assertEquals("ApiName", d2.name()); - Assertions.assertEquals(1, d2.values().size()); - Assertions.assertEquals("GetBlob", d2.values().get(0)); - - Assertions.assertEquals("Metric2", ac2.name()); - Assertions.assertEquals("SuccessE2ELatency", ac2.metricName()); - Assertions.assertEquals("Microsoft.Storage/storageAccounts", ac2.metricNamespace()); - Assertions.assertEquals(MetricAlertRuleCondition.GREATER_THAN, ac2.condition()); - Assertions.assertEquals(MetricAlertRuleTimeAggregation.AVERAGE, ac2.timeAggregation()); - Assertions.assertEquals(200, ac2.threshold(), 0.001); - Assertions.assertEquals(1, ac2.dimensions().size()); - d1 = ac2.dimensions().iterator().next(); - Assertions.assertEquals("ApiName", d1.name()); - Assertions.assertEquals(1, d1.values().size()); - Assertions.assertEquals("GetBlob", d1.values().get(0)); - - monitorManager.alertRules().metricAlerts().deleteById(ma.id()); - } finally { - resourceManager.resourceGroups().beginDeleteByName(rgName); - } - } - - @Test - public void canCRUDMultipleResourceMetricAlerts() throws Exception { - try { - final String userName = "tirekicker"; - final String password = password(); - - String alertName = generateRandomResourceName("jMonitorMA", 18); - String vmName1 = generateRandomResourceName("jMonitorVM1", 18); - String vmName2 = generateRandomResourceName("jMonitorVM2", 18); - - VirtualMachine vm1 = - computeManager - .virtualMachines() - .define(vmName1) - .withRegion(locationOrDefault(Region.US_EAST2)) - .withNewResourceGroup(rgName) - .withNewPrimaryNetwork("10.0.0.0/28") - .withPrimaryPrivateIPAddressDynamic() - .withoutPrimaryPublicIPAddress() - .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) - .withRootUsername(userName) - .withSsh(sshPublicKey()) - .create(); - - VirtualMachine vm2 = - computeManager - .virtualMachines() - .define(vmName2) - .withRegion(locationOrDefault(Region.US_EAST2)) - .withExistingResourceGroup(rgName) - .withNewPrimaryNetwork("10.0.0.0/28") - .withPrimaryPrivateIPAddressDynamic() - .withoutPrimaryPublicIPAddress() - .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) - .withRootUsername(userName) - .withSsh(sshPublicKey()) - .create(); - - MetricAlert ma = - monitorManager - .alertRules() - .metricAlerts() - .define(alertName) - .withExistingResourceGroup(rgName) - .withMultipleTargetResources(Arrays.asList(vm1, vm2)) - .withPeriod(Duration.ofMinutes(15)) - .withFrequency(Duration.ofMinutes(5)) - .withAlertDetails(3, "This alert rule is for U3 - Multiple resource, static criteria") - .withActionGroups() - .defineAlertCriteria("Metric1") - .withMetricName("Percentage CPU", vm1.type()) - .withCondition(MetricAlertRuleTimeAggregation.AVERAGE, MetricAlertRuleCondition.GREATER_THAN, 80) - .attach() - .create(); - - ma.refresh(); - Assertions.assertEquals(2, ma.scopes().size()); - Assertions.assertEquals(vm1.type(), ma.innerModel().targetResourceType()); - Assertions.assertEquals(vm1.regionName(), ma.innerModel().targetResourceRegion()); - Assertions.assertEquals(1, ma.alertCriterias().size()); - Assertions.assertEquals(0, ma.dynamicAlertCriterias().size()); - Assertions.assertEquals("Percentage CPU", ma.alertCriterias().get("Metric1").metricName()); - - OffsetDateTime time30MinBefore = OffsetDateTime.now().minusMinutes(30); - ma - .update() - .withDescription("This alert rule is for U3 - Multiple resource, dynamic criteria") - .withoutAlertCriteria("Metric1") - .defineDynamicAlertCriteria("Metric2") - .withMetricName("Percentage CPU", vm1.type()) - .withCondition( - MetricAlertRuleTimeAggregation.AVERAGE, - DynamicThresholdOperator.GREATER_THAN, - DynamicThresholdSensitivity.HIGH) - .withFailingPeriods( - new DynamicThresholdFailingPeriods() - .withNumberOfEvaluationPeriods(4) - .withMinFailingPeriodsToAlert(2)) - .withIgnoreDataBefore(time30MinBefore) - .attach() - .apply(); - - ma.refresh(); - Assertions.assertEquals(2, ma.scopes().size()); - Assertions.assertEquals(vm1.type(), ma.innerModel().targetResourceType()); - Assertions.assertEquals(vm1.regionName(), ma.innerModel().targetResourceRegion()); - Assertions.assertEquals(0, ma.alertCriterias().size()); - Assertions.assertEquals(1, ma.dynamicAlertCriterias().size()); - MetricDynamicAlertCondition condition = ma.dynamicAlertCriterias().get("Metric2"); - Assertions.assertEquals("Percentage CPU", condition.metricName()); - Assertions.assertEquals(MetricAlertRuleTimeAggregation.AVERAGE, condition.timeAggregation()); - Assertions.assertEquals(DynamicThresholdOperator.GREATER_THAN, condition.condition()); - Assertions.assertEquals(DynamicThresholdSensitivity.HIGH, condition.alertSensitivity()); - Assertions.assertEquals(4, (int) condition.failingPeriods().numberOfEvaluationPeriods()); - Assertions.assertEquals(2, (int) condition.failingPeriods().minFailingPeriodsToAlert()); - Assertions.assertEquals(time30MinBefore, condition.ignoreDataBefore()); - - monitorManager.alertRules().metricAlerts().deleteById(ma.id()); - } finally { - resourceManager.resourceGroups().beginDeleteByName(rgName); - } - } - - @Test - public void canCRUDActivityLogAlerts() throws Exception { - - // make sure there exists a VM - - try { - ActionGroup ag = - monitorManager - .actionGroups() - .define("simpleActionGroup") - .withNewResourceGroup(rgName, locationOrDefault(Region.US_EAST2)) - .defineReceiver("first") - .withPushNotification("azurepush@outlook.com") - .withEmail("justemail@outlook.com") - .withSms("1", "4255655665") - .withVoice("1", "2062066050") - .withWebhook("https://www.rate.am") - .attach() - .defineReceiver("second") - .withEmail("secondemail@outlook.com") - .withWebhook("https://www.spyur.am") - .attach() - .create(); - - VirtualMachine justAvm = computeManager.virtualMachines().list().iterator().next(); - - ActivityLogAlert ala = - monitorManager - .alertRules() - .activityLogAlerts() - .define("somename") - .withExistingResourceGroup(rgName) - .withTargetSubscription(monitorManager.subscriptionId()) - .withDescription("AutoScale-VM-Creation-Failed") - .withRuleEnabled() - .withActionGroups(ag.id()) - .withEqualsCondition("category", "Administrative") - .withEqualsCondition("resourceId", justAvm.id()) - .withEqualsCondition("operationName", "Microsoft.Compute/virtualMachines/delete") - .create(); - - Assertions.assertNotNull(ala); - Assertions.assertEquals(1, ala.scopes().size()); - Assertions - .assertEquals("/subscriptions/" + monitorManager.subscriptionId(), ala.scopes().iterator().next()); - Assertions.assertEquals("AutoScale-VM-Creation-Failed", ala.description()); - Assertions.assertEquals(true, ala.enabled()); - Assertions.assertEquals(1, ala.actionGroupIds().size()); - Assertions.assertEquals(ag.id(), ala.actionGroupIds().iterator().next()); - Assertions.assertEquals(3, ala.equalsConditions().size()); - Assertions.assertEquals("Administrative", ala.equalsConditions().get("category")); - Assertions.assertEquals(justAvm.id(), ala.equalsConditions().get("resourceId")); - Assertions - .assertEquals("Microsoft.Compute/virtualMachines/delete", ala.equalsConditions().get("operationName")); - - ActivityLogAlert alaFromGet = monitorManager.alertRules().activityLogAlerts().getById(ala.id()); - - Assertions.assertEquals(ala.scopes().size(), alaFromGet.scopes().size()); - Assertions.assertEquals(ala.scopes().iterator().next(), alaFromGet.scopes().iterator().next()); - Assertions.assertEquals(ala.description(), alaFromGet.description()); - Assertions.assertEquals(ala.enabled(), alaFromGet.enabled()); - Assertions.assertEquals(ala.actionGroupIds().size(), alaFromGet.actionGroupIds().size()); - Assertions - .assertEquals(ala.actionGroupIds().iterator().next(), alaFromGet.actionGroupIds().iterator().next()); - Assertions.assertEquals(ala.equalsConditions().size(), alaFromGet.equalsConditions().size()); - Assertions - .assertEquals(ala.equalsConditions().get("category"), alaFromGet.equalsConditions().get("category")); - Assertions - .assertEquals( - ala.equalsConditions().get("resourceId"), alaFromGet.equalsConditions().get("resourceId")); - Assertions - .assertEquals( - ala.equalsConditions().get("operationName"), alaFromGet.equalsConditions().get("operationName")); - - ala - .update() - .withRuleDisabled() - .withoutEqualsCondition("operationName") - .withEqualsCondition("status", "Failed") - .apply(); - - Assertions.assertEquals(1, ala.scopes().size()); - Assertions - .assertEquals("/subscriptions/" + monitorManager.subscriptionId(), ala.scopes().iterator().next()); - Assertions.assertEquals("AutoScale-VM-Creation-Failed", ala.description()); - Assertions.assertEquals(false, ala.enabled()); - Assertions.assertEquals(1, ala.actionGroupIds().size()); - Assertions.assertEquals(ag.id(), ala.actionGroupIds().iterator().next()); - Assertions.assertEquals(3, ala.equalsConditions().size()); - Assertions.assertEquals("Administrative", ala.equalsConditions().get("category")); - Assertions.assertEquals(justAvm.id(), ala.equalsConditions().get("resourceId")); - Assertions.assertEquals("Failed", ala.equalsConditions().get("status")); - Assertions.assertEquals(false, ala.equalsConditions().containsKey("operationName")); - - PagedIterable alertsInRg = - monitorManager.alertRules().activityLogAlerts().listByResourceGroup(rgName); - - Assertions.assertEquals(1, TestUtilities.getSize(alertsInRg)); - alaFromGet = alertsInRg.iterator().next(); - - Assertions.assertEquals(ala.scopes().size(), alaFromGet.scopes().size()); - Assertions.assertEquals(ala.scopes().iterator().next(), alaFromGet.scopes().iterator().next()); - Assertions.assertEquals(ala.description(), alaFromGet.description()); - Assertions.assertEquals(ala.enabled(), alaFromGet.enabled()); - Assertions.assertEquals(ala.actionGroupIds().size(), alaFromGet.actionGroupIds().size()); - Assertions - .assertEquals(ala.actionGroupIds().iterator().next(), alaFromGet.actionGroupIds().iterator().next()); - Assertions.assertEquals(ala.equalsConditions().size(), alaFromGet.equalsConditions().size()); - Assertions - .assertEquals(ala.equalsConditions().get("category"), alaFromGet.equalsConditions().get("category")); - Assertions - .assertEquals( - ala.equalsConditions().get("resourceId"), alaFromGet.equalsConditions().get("resourceId")); - Assertions.assertEquals(ala.equalsConditions().get("status"), alaFromGet.equalsConditions().get("status")); - Assertions - .assertEquals( - ala.equalsConditions().containsKey("operationName"), - alaFromGet.equalsConditions().containsKey("operationName")); - - monitorManager.alertRules().activityLogAlerts().deleteById(ala.id()); - } finally { - resourceManager.resourceGroups().beginDeleteByName(rgName); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/test/java/com/azure/resourcemanager/monitor/AutoscaleTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/test/java/com/azure/resourcemanager/monitor/AutoscaleTests.java deleted file mode 100644 index 70e7cfb955ea..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/test/java/com/azure/resourcemanager/monitor/AutoscaleTests.java +++ /dev/null @@ -1,579 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.monitor; - -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.appservice.models.AppServicePlan; -import com.azure.resourcemanager.appservice.models.OperatingSystem; -import com.azure.resourcemanager.appservice.models.PricingTier; -import com.azure.resourcemanager.monitor.models.AutoscaleProfile; -import com.azure.resourcemanager.monitor.models.AutoscaleSetting; -import com.azure.resourcemanager.monitor.models.ComparisonOperationType; -import com.azure.resourcemanager.monitor.models.DayOfWeek; -import com.azure.resourcemanager.monitor.models.MetricStatisticType; -import com.azure.resourcemanager.monitor.models.RecurrenceFrequency; -import com.azure.resourcemanager.monitor.models.ScaleDirection; -import com.azure.resourcemanager.monitor.models.ScaleRule; -import com.azure.resourcemanager.monitor.models.ScaleType; -import com.azure.resourcemanager.monitor.models.TimeAggregationType; -import com.azure.resourcemanager.test.utils.TestUtilities; -import com.azure.core.management.Region; -import com.azure.core.management.profile.AzureProfile; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -import java.time.Duration; -import java.time.OffsetDateTime; - -public class AutoscaleTests extends MonitorManagementTest { - private static String rgName = ""; - - @Override - protected void initializeClients(HttpPipeline httpPipeline, AzureProfile profile) { - rgName = generateRandomResourceName("jMonitor_", 18); - - super.initializeClients(httpPipeline, profile); - } - - @Override - protected void cleanUpResources() { - resourceManager.resourceGroups().beginDeleteByName(rgName); - } - - @Test - public void canCRUDAutoscale() throws Exception { - - try { - resourceManager - .resourceGroups() - .define(rgName) - .withRegion(locationOrDefault(Region.US_EAST2)) - .withTag("type", "autoscale") - .withTag("tagname", "tagvalue") - .create(); - - AppServicePlan servicePlan = - appServiceManager - .appServicePlans() - .define("HighlyAvailableWebApps") - .withRegion(locationOrDefault(Region.US_EAST2)) - .withExistingResourceGroup(rgName) - .withPricingTier(PricingTier.PREMIUM_P1) - .withOperatingSystem(OperatingSystem.WINDOWS) - .create(); - - AutoscaleSetting setting = - monitorManager - .autoscaleSettings() - .define("somesettingZ") - .withRegion(locationOrDefault(Region.US_EAST2)) - .withExistingResourceGroup(rgName) - .withTargetResource(servicePlan.id()) - .defineAutoscaleProfile("Default") - .withScheduleBasedScale(3) - .withRecurrentSchedule("UTC", "18:00", DayOfWeek.MONDAY, DayOfWeek.TUESDAY, DayOfWeek.SATURDAY) - .attach() - .defineAutoscaleProfile("AutoScaleProfile1") - .withMetricBasedScale(1, 10, 1) - .defineScaleRule() - .withMetricSource(servicePlan.id()) - // current swagger does not support namespace selection - // .withMetricName("CPUPercentage", "Microsoft.Web/serverfarms") - .withMetricName("CPUPercentage") - .withStatistic(Duration.ofMinutes(10), Duration.ofMinutes(1), MetricStatisticType.AVERAGE) - .withCondition(TimeAggregationType.AVERAGE, ComparisonOperationType.GREATER_THAN, 70) - .withScaleAction(ScaleDirection.INCREASE, ScaleType.EXACT_COUNT, 10, Duration.ofHours(12)) - .attach() - .withFixedDateSchedule( - "UTC", - OffsetDateTime.parse("2050-10-12T20:15:10Z"), - OffsetDateTime.parse("2051-09-11T16:08:04Z")) - .attach() - .defineAutoscaleProfile("AutoScaleProfile2") - .withMetricBasedScale(1, 5, 3) - .defineScaleRule() - .withMetricSource(servicePlan.id()) - .withMetricName("CPUPercentage") - .withStatistic(Duration.ofMinutes(10), Duration.ofMinutes(1), MetricStatisticType.AVERAGE) - .withCondition(TimeAggregationType.AVERAGE, ComparisonOperationType.LESS_THAN, 20) - .withScaleAction(ScaleDirection.DECREASE, ScaleType.EXACT_COUNT, 1, Duration.ofHours(3)) - .attach() - .withRecurrentSchedule("UTC", "12:13", DayOfWeek.FRIDAY) - .attach() - .withAdminEmailNotification() - .withCoAdminEmailNotification() - .withCustomEmailsNotification("me@mycorp.com", "you@mycorp.com", "him@mycorp.com") - .withAutoscaleDisabled() - .create(); - - Assertions.assertNotNull(setting); - Assertions.assertEquals("somesettingZ", setting.name()); - Assertions.assertEquals(servicePlan.id(), setting.targetResourceId()); - Assertions.assertTrue(setting.adminEmailNotificationEnabled()); - Assertions.assertTrue(setting.coAdminEmailNotificationEnabled()); - Assertions.assertFalse(setting.autoscaleEnabled()); - Assertions.assertEquals(3, setting.customEmailsNotification().size()); - Assertions.assertEquals("me@mycorp.com", setting.customEmailsNotification().get(0)); - Assertions.assertEquals("you@mycorp.com", setting.customEmailsNotification().get(1)); - Assertions.assertEquals("him@mycorp.com", setting.customEmailsNotification().get(2)); - - Assertions.assertEquals(3, setting.profiles().size()); - - AutoscaleProfile tempProfile = setting.profiles().get("Default"); - Assertions.assertNotNull(tempProfile); - Assertions.assertEquals("Default", tempProfile.name()); - Assertions.assertEquals(3, tempProfile.defaultInstanceCount()); - Assertions.assertEquals(3, tempProfile.maxInstanceCount()); - Assertions.assertEquals(3, tempProfile.minInstanceCount()); - Assertions.assertNull(tempProfile.fixedDateSchedule()); - Assertions.assertNotNull(tempProfile.rules()); - Assertions.assertEquals(0, tempProfile.rules().size()); - Assertions.assertNotNull(tempProfile.recurrentSchedule()); - Assertions.assertEquals(RecurrenceFrequency.WEEK, tempProfile.recurrentSchedule().frequency()); - Assertions.assertNotNull(tempProfile.recurrentSchedule().schedule()); - Assertions.assertEquals(3, tempProfile.recurrentSchedule().schedule().days().size()); - Assertions - .assertTrue(tempProfile.recurrentSchedule().schedule().days().contains(DayOfWeek.MONDAY.toString())); - Assertions - .assertTrue(tempProfile.recurrentSchedule().schedule().days().contains(DayOfWeek.TUESDAY.toString())); - Assertions - .assertTrue(tempProfile.recurrentSchedule().schedule().days().contains(DayOfWeek.SATURDAY.toString())); - Assertions.assertEquals(1, tempProfile.recurrentSchedule().schedule().hours().size()); - Assertions.assertEquals(1, tempProfile.recurrentSchedule().schedule().minutes().size()); - Assertions.assertTrue(tempProfile.recurrentSchedule().schedule().hours().contains(18)); - Assertions.assertTrue(tempProfile.recurrentSchedule().schedule().minutes().contains(0)); - Assertions.assertTrue(tempProfile.recurrentSchedule().schedule().timeZone().equalsIgnoreCase("UTC")); - - tempProfile = setting.profiles().get("AutoScaleProfile1"); - Assertions.assertNotNull(tempProfile); - Assertions.assertEquals("AutoScaleProfile1", tempProfile.name()); - Assertions.assertEquals(1, tempProfile.defaultInstanceCount()); - Assertions.assertEquals(10, tempProfile.maxInstanceCount()); - Assertions.assertEquals(1, tempProfile.minInstanceCount()); - Assertions.assertNotNull(tempProfile.fixedDateSchedule()); - Assertions.assertTrue(tempProfile.fixedDateSchedule().timeZone().equalsIgnoreCase("UTC")); - Assertions - .assertEquals(OffsetDateTime.parse("2050-10-12T20:15:10Z"), tempProfile.fixedDateSchedule().start()); - Assertions - .assertEquals(OffsetDateTime.parse("2051-09-11T16:08:04Z"), tempProfile.fixedDateSchedule().end()); - Assertions.assertNull(tempProfile.recurrentSchedule()); - Assertions.assertNotNull(tempProfile.rules()); - Assertions.assertEquals(1, tempProfile.rules().size()); - ScaleRule rule = tempProfile.rules().get(0); - Assertions.assertEquals(servicePlan.id(), rule.metricSource()); - Assertions.assertEquals("CPUPercentage", rule.metricName()); - Assertions.assertEquals(Duration.ofMinutes(10), rule.duration()); - Assertions.assertEquals(Duration.ofMinutes(1), rule.frequency()); - Assertions.assertEquals(MetricStatisticType.AVERAGE, rule.frequencyStatistic()); - Assertions.assertEquals(ComparisonOperationType.GREATER_THAN, rule.condition()); - Assertions.assertEquals(TimeAggregationType.AVERAGE, rule.timeAggregation()); - Assertions.assertEquals(70, rule.threshold(), 0.001); - Assertions.assertEquals(ScaleDirection.INCREASE, rule.scaleDirection()); - Assertions.assertEquals(ScaleType.EXACT_COUNT, rule.scaleType()); - Assertions.assertEquals(10, rule.scaleInstanceCount()); - Assertions.assertEquals(Duration.ofHours(12), rule.cooldown()); - - tempProfile = setting.profiles().get("AutoScaleProfile2"); - Assertions.assertNotNull(tempProfile); - Assertions.assertEquals("AutoScaleProfile2", tempProfile.name()); - Assertions.assertEquals(3, tempProfile.defaultInstanceCount()); - Assertions.assertEquals(5, tempProfile.maxInstanceCount()); - Assertions.assertEquals(1, tempProfile.minInstanceCount()); - Assertions.assertNull(tempProfile.fixedDateSchedule()); - Assertions.assertNotNull(tempProfile.recurrentSchedule().schedule()); - Assertions.assertEquals(1, tempProfile.recurrentSchedule().schedule().days().size()); - Assertions - .assertTrue(tempProfile.recurrentSchedule().schedule().days().contains(DayOfWeek.FRIDAY.toString())); - Assertions.assertEquals(1, tempProfile.recurrentSchedule().schedule().hours().size()); - Assertions.assertEquals(1, tempProfile.recurrentSchedule().schedule().minutes().size()); - Assertions.assertTrue(tempProfile.recurrentSchedule().schedule().hours().contains(12)); - Assertions.assertTrue(tempProfile.recurrentSchedule().schedule().minutes().contains(13)); - Assertions.assertTrue(tempProfile.recurrentSchedule().schedule().timeZone().equalsIgnoreCase("UTC")); - - Assertions.assertNotNull(tempProfile.rules()); - Assertions.assertEquals(1, tempProfile.rules().size()); - rule = tempProfile.rules().get(0); - Assertions.assertEquals(servicePlan.id(), rule.metricSource()); - Assertions.assertEquals("CPUPercentage", rule.metricName()); - Assertions.assertEquals(Duration.ofMinutes(10), rule.duration()); - Assertions.assertEquals(Duration.ofMinutes(1), rule.frequency()); - Assertions.assertEquals(MetricStatisticType.AVERAGE, rule.frequencyStatistic()); - Assertions.assertEquals(ComparisonOperationType.LESS_THAN, rule.condition()); - Assertions.assertEquals(TimeAggregationType.AVERAGE, rule.timeAggregation()); - Assertions.assertEquals(20, rule.threshold(), 0.001); - Assertions.assertEquals(ScaleDirection.DECREASE, rule.scaleDirection()); - Assertions.assertEquals(ScaleType.EXACT_COUNT, rule.scaleType()); - Assertions.assertEquals(1, rule.scaleInstanceCount()); - Assertions.assertEquals(Duration.ofHours(3), rule.cooldown()); - - // GET Autoscale settings and compare - AutoscaleSetting settingFromGet = monitorManager.autoscaleSettings().getById(setting.id()); - Assertions.assertNotNull(settingFromGet); - Assertions.assertEquals("somesettingZ", settingFromGet.name()); - Assertions.assertEquals(servicePlan.id(), settingFromGet.targetResourceId()); - Assertions.assertTrue(settingFromGet.adminEmailNotificationEnabled()); - Assertions.assertTrue(settingFromGet.coAdminEmailNotificationEnabled()); - Assertions.assertFalse(settingFromGet.autoscaleEnabled()); - Assertions.assertEquals(3, settingFromGet.customEmailsNotification().size()); - Assertions.assertEquals("me@mycorp.com", settingFromGet.customEmailsNotification().get(0)); - Assertions.assertEquals("you@mycorp.com", settingFromGet.customEmailsNotification().get(1)); - Assertions.assertEquals("him@mycorp.com", settingFromGet.customEmailsNotification().get(2)); - - Assertions.assertEquals(3, settingFromGet.profiles().size()); - - tempProfile = settingFromGet.profiles().get("Default"); - Assertions.assertNotNull(tempProfile); - Assertions.assertEquals("Default", tempProfile.name()); - Assertions.assertEquals(3, tempProfile.defaultInstanceCount()); - Assertions.assertEquals(3, tempProfile.maxInstanceCount()); - Assertions.assertEquals(3, tempProfile.minInstanceCount()); - Assertions.assertNull(tempProfile.fixedDateSchedule()); - Assertions.assertNotNull(tempProfile.rules()); - Assertions.assertEquals(0, tempProfile.rules().size()); - Assertions.assertNotNull(tempProfile.recurrentSchedule()); - Assertions.assertEquals(RecurrenceFrequency.WEEK, tempProfile.recurrentSchedule().frequency()); - Assertions.assertNotNull(tempProfile.recurrentSchedule().schedule()); - Assertions.assertEquals(3, tempProfile.recurrentSchedule().schedule().days().size()); - Assertions - .assertTrue(tempProfile.recurrentSchedule().schedule().days().contains(DayOfWeek.MONDAY.toString())); - Assertions - .assertTrue(tempProfile.recurrentSchedule().schedule().days().contains(DayOfWeek.TUESDAY.toString())); - Assertions - .assertTrue(tempProfile.recurrentSchedule().schedule().days().contains(DayOfWeek.SATURDAY.toString())); - Assertions.assertEquals(1, tempProfile.recurrentSchedule().schedule().hours().size()); - Assertions.assertEquals(1, tempProfile.recurrentSchedule().schedule().minutes().size()); - Assertions.assertTrue(tempProfile.recurrentSchedule().schedule().hours().contains(18)); - Assertions.assertTrue(tempProfile.recurrentSchedule().schedule().minutes().contains(0)); - Assertions.assertTrue(tempProfile.recurrentSchedule().schedule().timeZone().equalsIgnoreCase("UTC")); - - tempProfile = settingFromGet.profiles().get("AutoScaleProfile1"); - Assertions.assertNotNull(tempProfile); - Assertions.assertEquals("AutoScaleProfile1", tempProfile.name()); - Assertions.assertEquals(1, tempProfile.defaultInstanceCount()); - Assertions.assertEquals(10, tempProfile.maxInstanceCount()); - Assertions.assertEquals(1, tempProfile.minInstanceCount()); - Assertions.assertNotNull(tempProfile.fixedDateSchedule()); - Assertions.assertTrue(tempProfile.fixedDateSchedule().timeZone().equalsIgnoreCase("UTC")); - Assertions - .assertEquals(OffsetDateTime.parse("2050-10-12T20:15:10Z"), tempProfile.fixedDateSchedule().start()); - Assertions - .assertEquals(OffsetDateTime.parse("2051-09-11T16:08:04Z"), tempProfile.fixedDateSchedule().end()); - Assertions.assertNull(tempProfile.recurrentSchedule()); - Assertions.assertNotNull(tempProfile.rules()); - Assertions.assertEquals(1, tempProfile.rules().size()); - rule = tempProfile.rules().get(0); - Assertions.assertEquals(servicePlan.id(), rule.metricSource()); - Assertions.assertEquals("CPUPercentage", rule.metricName()); - Assertions.assertEquals(Duration.ofMinutes(10), rule.duration()); - Assertions.assertEquals(Duration.ofMinutes(1), rule.frequency()); - Assertions.assertEquals(MetricStatisticType.AVERAGE, rule.frequencyStatistic()); - Assertions.assertEquals(ComparisonOperationType.GREATER_THAN, rule.condition()); - Assertions.assertEquals(TimeAggregationType.AVERAGE, rule.timeAggregation()); - Assertions.assertEquals(70, rule.threshold(), 0.001); - Assertions.assertEquals(ScaleDirection.INCREASE, rule.scaleDirection()); - Assertions.assertEquals(ScaleType.EXACT_COUNT, rule.scaleType()); - Assertions.assertEquals(10, rule.scaleInstanceCount()); - Assertions.assertEquals(Duration.ofHours(12), rule.cooldown()); - - tempProfile = settingFromGet.profiles().get("AutoScaleProfile2"); - Assertions.assertNotNull(tempProfile); - Assertions.assertEquals("AutoScaleProfile2", tempProfile.name()); - Assertions.assertEquals(3, tempProfile.defaultInstanceCount()); - Assertions.assertEquals(5, tempProfile.maxInstanceCount()); - Assertions.assertEquals(1, tempProfile.minInstanceCount()); - Assertions.assertNull(tempProfile.fixedDateSchedule()); - Assertions.assertNotNull(tempProfile.recurrentSchedule().schedule()); - Assertions.assertEquals(1, tempProfile.recurrentSchedule().schedule().days().size()); - Assertions - .assertTrue(tempProfile.recurrentSchedule().schedule().days().contains(DayOfWeek.FRIDAY.toString())); - Assertions.assertEquals(1, tempProfile.recurrentSchedule().schedule().hours().size()); - Assertions.assertEquals(1, tempProfile.recurrentSchedule().schedule().minutes().size()); - Assertions.assertTrue(tempProfile.recurrentSchedule().schedule().hours().contains(12)); - Assertions.assertTrue(tempProfile.recurrentSchedule().schedule().minutes().contains(13)); - Assertions.assertTrue(tempProfile.recurrentSchedule().schedule().timeZone().equalsIgnoreCase("UTC")); - - Assertions.assertNotNull(tempProfile.rules()); - Assertions.assertEquals(1, tempProfile.rules().size()); - rule = tempProfile.rules().get(0); - Assertions.assertEquals(servicePlan.id(), rule.metricSource()); - Assertions.assertEquals("CPUPercentage", rule.metricName()); - Assertions.assertEquals(Duration.ofMinutes(10), rule.duration()); - Assertions.assertEquals(Duration.ofMinutes(1), rule.frequency()); - Assertions.assertEquals(MetricStatisticType.AVERAGE, rule.frequencyStatistic()); - Assertions.assertEquals(ComparisonOperationType.LESS_THAN, rule.condition()); - Assertions.assertEquals(TimeAggregationType.AVERAGE, rule.timeAggregation()); - Assertions.assertEquals(20, rule.threshold(), 0.001); - Assertions.assertEquals(ScaleDirection.DECREASE, rule.scaleDirection()); - Assertions.assertEquals(ScaleType.EXACT_COUNT, rule.scaleType()); - Assertions.assertEquals(1, rule.scaleInstanceCount()); - Assertions.assertEquals(Duration.ofHours(3), rule.cooldown()); - - // Update - setting - .update() - .defineAutoscaleProfile("very new profile") - .withScheduleBasedScale(10) - .withFixedDateSchedule( - "UTC", OffsetDateTime.parse("2030-02-12T20:15:10Z"), OffsetDateTime.parse("2030-02-12T20:45:10Z")) - .attach() - .defineAutoscaleProfile("a new profile") - .withMetricBasedScale(5, 7, 6) - .defineScaleRule() - .withMetricSource(servicePlan.id()) - .withMetricName("CPUPercentage") - .withStatistic(Duration.ofHours(10), Duration.ofHours(1), MetricStatisticType.AVERAGE) - .withCondition(TimeAggregationType.TOTAL, ComparisonOperationType.LESS_THAN, 6) - .withScaleAction(ScaleDirection.DECREASE, ScaleType.PERCENT_CHANGE_COUNT, 10, Duration.ofHours(10)) - .attach() - .attach() - .updateAutoscaleProfile("AutoScaleProfile2") - .updateScaleRule(0) - .withStatistic(Duration.ofMinutes(15), Duration.ofMinutes(1), MetricStatisticType.AVERAGE) - .parent() - .withFixedDateSchedule( - "UTC", OffsetDateTime.parse("2025-02-02T02:02:02Z"), OffsetDateTime.parse("2025-02-02T03:03:03Z")) - .defineScaleRule() - .withMetricSource(servicePlan.id()) - .withMetricName("CPUPercentage") - .withStatistic(Duration.ofHours(5), Duration.ofHours(3), MetricStatisticType.AVERAGE) - .withCondition(TimeAggregationType.TOTAL, ComparisonOperationType.LESS_THAN, 50) - .withScaleAction(ScaleDirection.DECREASE, ScaleType.PERCENT_CHANGE_COUNT, 25, Duration.ofHours(2)) - .attach() - .withoutScaleRule(1) - .parent() - .withoutAutoscaleProfile("AutoScaleProfile1") - .withAutoscaleEnabled() - .withoutCoAdminEmailNotification() - .apply(); - - Assertions.assertNotNull(setting); - Assertions.assertEquals("somesettingZ", setting.name()); - Assertions.assertEquals(servicePlan.id(), setting.targetResourceId()); - Assertions.assertTrue(setting.adminEmailNotificationEnabled()); - Assertions.assertFalse(setting.coAdminEmailNotificationEnabled()); - Assertions.assertTrue(setting.autoscaleEnabled()); - Assertions.assertEquals(3, setting.customEmailsNotification().size()); - Assertions.assertEquals("me@mycorp.com", setting.customEmailsNotification().get(0)); - Assertions.assertEquals("you@mycorp.com", setting.customEmailsNotification().get(1)); - Assertions.assertEquals("him@mycorp.com", setting.customEmailsNotification().get(2)); - - Assertions.assertEquals(4, setting.profiles().size()); - - Assertions.assertFalse(setting.profiles().containsKey("AutoScaleProfile1")); - - tempProfile = setting.profiles().get("Default"); - Assertions.assertNotNull(tempProfile); - Assertions.assertEquals("Default", tempProfile.name()); - Assertions.assertEquals(3, tempProfile.defaultInstanceCount()); - Assertions.assertEquals(3, tempProfile.maxInstanceCount()); - Assertions.assertEquals(3, tempProfile.minInstanceCount()); - Assertions.assertNull(tempProfile.fixedDateSchedule()); - Assertions.assertNotNull(tempProfile.rules()); - Assertions.assertEquals(0, tempProfile.rules().size()); - Assertions.assertNotNull(tempProfile.recurrentSchedule()); - Assertions.assertEquals(RecurrenceFrequency.WEEK, tempProfile.recurrentSchedule().frequency()); - Assertions.assertNotNull(tempProfile.recurrentSchedule().schedule()); - Assertions.assertEquals(3, tempProfile.recurrentSchedule().schedule().days().size()); - Assertions - .assertTrue(tempProfile.recurrentSchedule().schedule().days().contains(DayOfWeek.MONDAY.toString())); - Assertions - .assertTrue(tempProfile.recurrentSchedule().schedule().days().contains(DayOfWeek.TUESDAY.toString())); - Assertions - .assertTrue(tempProfile.recurrentSchedule().schedule().days().contains(DayOfWeek.SATURDAY.toString())); - Assertions.assertEquals(1, tempProfile.recurrentSchedule().schedule().hours().size()); - Assertions.assertEquals(1, tempProfile.recurrentSchedule().schedule().minutes().size()); - Assertions.assertTrue(tempProfile.recurrentSchedule().schedule().hours().contains(18)); - Assertions.assertTrue(tempProfile.recurrentSchedule().schedule().minutes().contains(0)); - Assertions.assertTrue(tempProfile.recurrentSchedule().schedule().timeZone().equalsIgnoreCase("UTC")); - - tempProfile = setting.profiles().get("very new profile"); - Assertions.assertNotNull(tempProfile); - Assertions.assertEquals("very new profile", tempProfile.name()); - Assertions.assertEquals(10, tempProfile.defaultInstanceCount()); - Assertions.assertEquals(10, tempProfile.maxInstanceCount()); - Assertions.assertEquals(10, tempProfile.minInstanceCount()); - Assertions.assertNull(tempProfile.recurrentSchedule()); - Assertions.assertNotNull(tempProfile.fixedDateSchedule()); - Assertions.assertTrue(tempProfile.fixedDateSchedule().timeZone().equalsIgnoreCase("UTC")); - Assertions - .assertEquals(OffsetDateTime.parse("2030-02-12T20:15:10Z"), tempProfile.fixedDateSchedule().start()); - Assertions - .assertEquals(OffsetDateTime.parse("2030-02-12T20:45:10Z"), tempProfile.fixedDateSchedule().end()); - - tempProfile = setting.profiles().get("a new profile"); - Assertions.assertNotNull(tempProfile); - Assertions.assertEquals("a new profile", tempProfile.name()); - Assertions.assertEquals(6, tempProfile.defaultInstanceCount()); - Assertions.assertEquals(7, tempProfile.maxInstanceCount()); - Assertions.assertEquals(5, tempProfile.minInstanceCount()); - Assertions.assertNull(tempProfile.fixedDateSchedule()); - Assertions.assertNull(tempProfile.recurrentSchedule()); - Assertions.assertNotNull(tempProfile.rules()); - Assertions.assertEquals(1, tempProfile.rules().size()); - rule = tempProfile.rules().get(0); - Assertions.assertEquals(servicePlan.id(), rule.metricSource()); - Assertions.assertEquals("CPUPercentage", rule.metricName()); - Assertions.assertEquals(Duration.ofHours(10), rule.duration()); - Assertions.assertEquals(Duration.ofHours(1), rule.frequency()); - Assertions.assertEquals(MetricStatisticType.AVERAGE, rule.frequencyStatistic()); - Assertions.assertEquals(ComparisonOperationType.LESS_THAN, rule.condition()); - Assertions.assertEquals(TimeAggregationType.TOTAL, rule.timeAggregation()); - Assertions.assertEquals(6, rule.threshold(), 0.001); - Assertions.assertEquals(ScaleDirection.DECREASE, rule.scaleDirection()); - Assertions.assertEquals(ScaleType.PERCENT_CHANGE_COUNT, rule.scaleType()); - Assertions.assertEquals(10, rule.scaleInstanceCount()); - Assertions.assertEquals(Duration.ofHours(10), rule.cooldown()); - - tempProfile = setting.profiles().get("AutoScaleProfile2"); - Assertions.assertNotNull(tempProfile); - Assertions.assertEquals("AutoScaleProfile2", tempProfile.name()); - Assertions.assertEquals(3, tempProfile.defaultInstanceCount()); - Assertions.assertEquals(5, tempProfile.maxInstanceCount()); - Assertions.assertEquals(1, tempProfile.minInstanceCount()); - Assertions.assertNull(tempProfile.recurrentSchedule()); - Assertions.assertNotNull(tempProfile.fixedDateSchedule()); - Assertions.assertTrue(tempProfile.fixedDateSchedule().timeZone().equalsIgnoreCase("UTC")); - Assertions - .assertEquals(OffsetDateTime.parse("2025-02-02T02:02:02Z"), tempProfile.fixedDateSchedule().start()); - Assertions - .assertEquals(OffsetDateTime.parse("2025-02-02T03:03:03Z"), tempProfile.fixedDateSchedule().end()); - - Assertions.assertNotNull(tempProfile.rules()); - Assertions.assertEquals(1, tempProfile.rules().size()); - rule = tempProfile.rules().get(0); - Assertions.assertEquals(servicePlan.id(), rule.metricSource()); - Assertions.assertEquals("CPUPercentage", rule.metricName()); - Assertions.assertEquals(Duration.ofMinutes(15), rule.duration()); - Assertions.assertEquals(Duration.ofMinutes(1), rule.frequency()); - Assertions.assertEquals(MetricStatisticType.AVERAGE, rule.frequencyStatistic()); - Assertions.assertEquals(ComparisonOperationType.LESS_THAN, rule.condition()); - Assertions.assertEquals(TimeAggregationType.AVERAGE, rule.timeAggregation()); - Assertions.assertEquals(20, rule.threshold(), 0.001); - Assertions.assertEquals(ScaleDirection.DECREASE, rule.scaleDirection()); - Assertions.assertEquals(ScaleType.EXACT_COUNT, rule.scaleType()); - Assertions.assertEquals(1, rule.scaleInstanceCount()); - Assertions.assertEquals(Duration.ofHours(3), rule.cooldown()); - - // List - settingFromGet = monitorManager.autoscaleSettings().listByResourceGroup(rgName).iterator().next(); - - Assertions.assertNotNull(settingFromGet); - Assertions.assertEquals("somesettingZ", settingFromGet.name()); - Assertions.assertEquals(servicePlan.id(), settingFromGet.targetResourceId()); - Assertions.assertTrue(settingFromGet.adminEmailNotificationEnabled()); - Assertions.assertFalse(settingFromGet.coAdminEmailNotificationEnabled()); - Assertions.assertTrue(settingFromGet.autoscaleEnabled()); - Assertions.assertEquals(3, settingFromGet.customEmailsNotification().size()); - Assertions.assertEquals("me@mycorp.com", settingFromGet.customEmailsNotification().get(0)); - Assertions.assertEquals("you@mycorp.com", settingFromGet.customEmailsNotification().get(1)); - Assertions.assertEquals("him@mycorp.com", settingFromGet.customEmailsNotification().get(2)); - - Assertions.assertEquals(4, settingFromGet.profiles().size()); - - Assertions.assertFalse(settingFromGet.profiles().containsKey("AutoScaleProfile1")); - - tempProfile = settingFromGet.profiles().get("Default"); - Assertions.assertNotNull(tempProfile); - Assertions.assertEquals("Default", tempProfile.name()); - Assertions.assertEquals(3, tempProfile.defaultInstanceCount()); - Assertions.assertEquals(3, tempProfile.maxInstanceCount()); - Assertions.assertEquals(3, tempProfile.minInstanceCount()); - Assertions.assertNull(tempProfile.fixedDateSchedule()); - Assertions.assertNotNull(tempProfile.rules()); - Assertions.assertEquals(0, tempProfile.rules().size()); - Assertions.assertNotNull(tempProfile.recurrentSchedule()); - Assertions.assertEquals(RecurrenceFrequency.WEEK, tempProfile.recurrentSchedule().frequency()); - Assertions.assertNotNull(tempProfile.recurrentSchedule().schedule()); - Assertions.assertEquals(3, tempProfile.recurrentSchedule().schedule().days().size()); - Assertions - .assertTrue(tempProfile.recurrentSchedule().schedule().days().contains(DayOfWeek.MONDAY.toString())); - Assertions - .assertTrue(tempProfile.recurrentSchedule().schedule().days().contains(DayOfWeek.TUESDAY.toString())); - Assertions - .assertTrue(tempProfile.recurrentSchedule().schedule().days().contains(DayOfWeek.SATURDAY.toString())); - Assertions.assertEquals(1, tempProfile.recurrentSchedule().schedule().hours().size()); - Assertions.assertEquals(1, tempProfile.recurrentSchedule().schedule().minutes().size()); - Assertions.assertTrue(tempProfile.recurrentSchedule().schedule().hours().contains(18)); - Assertions.assertTrue(tempProfile.recurrentSchedule().schedule().minutes().contains(0)); - Assertions.assertTrue(tempProfile.recurrentSchedule().schedule().timeZone().equalsIgnoreCase("UTC")); - - tempProfile = settingFromGet.profiles().get("very new profile"); - Assertions.assertNotNull(tempProfile); - Assertions.assertEquals("very new profile", tempProfile.name()); - Assertions.assertEquals(10, tempProfile.defaultInstanceCount()); - Assertions.assertEquals(10, tempProfile.maxInstanceCount()); - Assertions.assertEquals(10, tempProfile.minInstanceCount()); - Assertions.assertNull(tempProfile.recurrentSchedule()); - Assertions.assertNotNull(tempProfile.fixedDateSchedule()); - Assertions.assertTrue(tempProfile.fixedDateSchedule().timeZone().equalsIgnoreCase("UTC")); - Assertions - .assertEquals(OffsetDateTime.parse("2030-02-12T20:15:10Z"), tempProfile.fixedDateSchedule().start()); - Assertions - .assertEquals(OffsetDateTime.parse("2030-02-12T20:45:10Z"), tempProfile.fixedDateSchedule().end()); - - tempProfile = settingFromGet.profiles().get("a new profile"); - Assertions.assertNotNull(tempProfile); - Assertions.assertEquals("a new profile", tempProfile.name()); - Assertions.assertEquals(6, tempProfile.defaultInstanceCount()); - Assertions.assertEquals(7, tempProfile.maxInstanceCount()); - Assertions.assertEquals(5, tempProfile.minInstanceCount()); - Assertions.assertNull(tempProfile.fixedDateSchedule()); - Assertions.assertNull(tempProfile.recurrentSchedule()); - Assertions.assertNotNull(tempProfile.rules()); - Assertions.assertEquals(1, tempProfile.rules().size()); - rule = tempProfile.rules().get(0); - Assertions.assertEquals(servicePlan.id(), rule.metricSource()); - Assertions.assertEquals("CPUPercentage", rule.metricName()); - Assertions.assertEquals(Duration.ofHours(10), rule.duration()); - Assertions.assertEquals(Duration.ofHours(1), rule.frequency()); - Assertions.assertEquals(MetricStatisticType.AVERAGE, rule.frequencyStatistic()); - Assertions.assertEquals(ComparisonOperationType.LESS_THAN, rule.condition()); - Assertions.assertEquals(TimeAggregationType.TOTAL, rule.timeAggregation()); - Assertions.assertEquals(6, rule.threshold(), 0.001); - Assertions.assertEquals(ScaleDirection.DECREASE, rule.scaleDirection()); - Assertions.assertEquals(ScaleType.PERCENT_CHANGE_COUNT, rule.scaleType()); - Assertions.assertEquals(10, rule.scaleInstanceCount()); - Assertions.assertEquals(Duration.ofHours(10), rule.cooldown()); - - tempProfile = settingFromGet.profiles().get("AutoScaleProfile2"); - Assertions.assertNotNull(tempProfile); - Assertions.assertEquals("AutoScaleProfile2", tempProfile.name()); - Assertions.assertEquals(3, tempProfile.defaultInstanceCount()); - Assertions.assertEquals(5, tempProfile.maxInstanceCount()); - Assertions.assertEquals(1, tempProfile.minInstanceCount()); - Assertions.assertNull(tempProfile.recurrentSchedule()); - Assertions.assertNotNull(tempProfile.fixedDateSchedule()); - Assertions.assertTrue(tempProfile.fixedDateSchedule().timeZone().equalsIgnoreCase("UTC")); - Assertions - .assertEquals(OffsetDateTime.parse("2025-02-02T02:02:02Z"), tempProfile.fixedDateSchedule().start()); - Assertions - .assertEquals(OffsetDateTime.parse("2025-02-02T03:03:03Z"), tempProfile.fixedDateSchedule().end()); - - Assertions.assertNotNull(tempProfile.rules()); - Assertions.assertEquals(1, tempProfile.rules().size()); - rule = tempProfile.rules().get(0); - Assertions.assertEquals(servicePlan.id(), rule.metricSource()); - Assertions.assertEquals("CPUPercentage", rule.metricName()); - Assertions.assertEquals(Duration.ofMinutes(15), rule.duration()); - Assertions.assertEquals(Duration.ofMinutes(1), rule.frequency()); - Assertions.assertEquals(MetricStatisticType.AVERAGE, rule.frequencyStatistic()); - Assertions.assertEquals(ComparisonOperationType.LESS_THAN, rule.condition()); - Assertions.assertEquals(TimeAggregationType.AVERAGE, rule.timeAggregation()); - Assertions.assertEquals(20, rule.threshold(), 0.001); - Assertions.assertEquals(ScaleDirection.DECREASE, rule.scaleDirection()); - Assertions.assertEquals(ScaleType.EXACT_COUNT, rule.scaleType()); - Assertions.assertEquals(1, rule.scaleInstanceCount()); - Assertions.assertEquals(Duration.ofHours(3), rule.cooldown()); - - // Delete - monitorManager.autoscaleSettings().deleteById(settingFromGet.id()); - - PagedIterable emptyList = monitorManager.autoscaleSettings().listByResourceGroup(rgName); - Assertions.assertEquals(0, TestUtilities.getSize(emptyList)); - } finally { - resourceManager.resourceGroups().beginDeleteByName(rgName); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/test/java/com/azure/resourcemanager/monitor/DiagnosticSettingsTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/test/java/com/azure/resourcemanager/monitor/DiagnosticSettingsTests.java deleted file mode 100644 index ea2b5474c6ed..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/test/java/com/azure/resourcemanager/monitor/DiagnosticSettingsTests.java +++ /dev/null @@ -1,166 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.monitor; - -import com.azure.core.http.HttpPipeline; -import com.azure.resourcemanager.compute.models.VirtualMachine; -import com.azure.resourcemanager.eventhubs.models.EventHubNamespace; -import com.azure.resourcemanager.eventhubs.models.EventHubNamespaceAuthorizationRule; -import com.azure.resourcemanager.monitor.models.DiagnosticSetting; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.monitor.models.DiagnosticSettingsCategory; -import com.azure.resourcemanager.storage.models.StorageAccount; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -import java.time.Duration; -import java.util.List; -import java.util.stream.Collectors; - -public class DiagnosticSettingsTests extends MonitorManagementTest { - private String rgName = ""; - private String saName = ""; - private String dsName = ""; - private String ehName = ""; - - @Override - protected void initializeClients(HttpPipeline httpPipeline, AzureProfile profile) { - rgName = generateRandomResourceName("jMonitor_", 18); - saName = generateRandomResourceName("jMonitorSa", 18); - dsName = generateRandomResourceName("jMonitorDs_", 18); - ehName = generateRandomResourceName("jMonitorEH", 18); - - super.initializeClients(httpPipeline, profile); - } - - @Override - protected void cleanUpResources() { - resourceManager.resourceGroups().beginDeleteByName(rgName); - } - - @Test - public void canCRUDDiagnosticSettings() throws Exception { - - // make sure there exists a VM - - VirtualMachine vm = computeManager.virtualMachines().list().iterator().next(); - - // clean all diagnostic settings. - List dsList = monitorManager.diagnosticSettings().listByResource(vm.id()).stream().collect(Collectors.toList()); - for (DiagnosticSetting dsd : dsList) { - monitorManager.diagnosticSettings().deleteById(dsd.id()); - } - - StorageAccount sa = storageManager.storageAccounts() - .define(saName) - // Storage Account should be in the same region as resource - .withRegion(vm.region()) - .withNewResourceGroup(rgName) - .withTag("tag1", "value1") - .create(); - - EventHubNamespace namespace = eventHubManager.namespaces() - .define(ehName) - // EventHub should be in the same region as resource - .withRegion(vm.region()) - .withNewResourceGroup(rgName) - .withNewManageRule("mngRule1") - .withNewSendRule("sndRule1") - .create(); - - EventHubNamespaceAuthorizationRule evenHubNsRule = namespace.listAuthorizationRules().iterator().next(); - - List categories = monitorManager.diagnosticSettings() - .listCategoriesByResource(vm.id()); - - Assertions.assertNotNull(categories); - Assertions.assertFalse(categories.isEmpty()); - - DiagnosticSetting setting = monitorManager.diagnosticSettings() - .define(dsName) - .withResource(vm.id()) - .withStorageAccount(sa.id()) - .withEventHub(evenHubNsRule.id()) - .withLogsAndMetrics(categories, Duration.ofMinutes(5), 7) - .create(); - - Assertions.assertTrue(vm.id().equalsIgnoreCase(setting.resourceId())); - Assertions.assertTrue(sa.id().equalsIgnoreCase(setting.storageAccountId())); - Assertions.assertTrue(evenHubNsRule.id().equalsIgnoreCase(setting.eventHubAuthorizationRuleId())); - Assertions.assertNull(setting.eventHubName()); - Assertions.assertNull(setting.workspaceId()); - Assertions.assertTrue(setting.logs().isEmpty()); - Assertions.assertFalse(setting.metrics().isEmpty()); - - setting.update() - .withoutStorageAccount() - .withoutLogs() - .apply(); - - Assertions.assertTrue(vm.id().equalsIgnoreCase(setting.resourceId())); - Assertions.assertTrue(evenHubNsRule.id().equalsIgnoreCase(setting.eventHubAuthorizationRuleId())); - Assertions.assertNull(setting.storageAccountId()); - Assertions.assertNull(setting.eventHubName()); - Assertions.assertNull(setting.workspaceId()); - Assertions.assertTrue(setting.logs().isEmpty()); - Assertions.assertFalse(setting.metrics().isEmpty()); - - DiagnosticSetting ds1 = monitorManager.diagnosticSettings().get(setting.resourceId(), setting.name()); - checkDiagnosticSettingValues(setting, ds1); - - DiagnosticSetting ds2 = monitorManager.diagnosticSettings().getById(setting.id()); - checkDiagnosticSettingValues(setting, ds2); - - dsList = monitorManager.diagnosticSettings().listByResource(vm.id()).stream().collect(Collectors.toList()); - Assertions.assertNotNull(dsList); - Assertions.assertEquals(1, dsList.size()); - DiagnosticSetting ds3 = dsList.get(0); - checkDiagnosticSettingValues(setting, ds3); - - monitorManager.diagnosticSettings().deleteById(setting.id()); - - dsList = monitorManager.diagnosticSettings().listByResource(vm.id()).stream().collect(Collectors.toList()); - Assertions.assertNotNull(dsList); - Assertions.assertTrue(dsList.isEmpty()); - } - - private void checkDiagnosticSettingValues(DiagnosticSetting expected, DiagnosticSetting actual) { - Assertions.assertTrue(expected.resourceId().equalsIgnoreCase(actual.resourceId())); - Assertions.assertTrue(expected.name().equalsIgnoreCase(actual.name())); - - if (expected.workspaceId() == null) { - Assertions.assertNull(actual.workspaceId()); - } else { - Assertions.assertTrue(expected.workspaceId().equalsIgnoreCase(actual.workspaceId())); - } - if (expected.storageAccountId() == null) { - Assertions.assertNull(actual.storageAccountId()); - } else { - Assertions.assertTrue(expected.storageAccountId().equalsIgnoreCase(actual.storageAccountId())); - } - if (expected.eventHubAuthorizationRuleId() == null) { - Assertions.assertNull(actual.eventHubAuthorizationRuleId()); - } else { - Assertions - .assertTrue( - expected.eventHubAuthorizationRuleId().equalsIgnoreCase(actual.eventHubAuthorizationRuleId())); - } - if (expected.eventHubName() == null) { - Assertions.assertNull(actual.eventHubName()); - } else { - Assertions.assertTrue(expected.eventHubName().equalsIgnoreCase(actual.eventHubName())); - } - // arrays - if (expected.logs() == null) { - Assertions.assertNull(actual.logs()); - } else { - Assertions.assertEquals(expected.logs().size(), actual.logs().size()); - } - if (expected.metrics() == null) { - Assertions.assertNull(actual.metrics()); - } else { - Assertions.assertEquals(expected.metrics().size(), actual.metrics().size()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/test/java/com/azure/resourcemanager/monitor/MonitorActivityAndMetricsTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/test/java/com/azure/resourcemanager/monitor/MonitorActivityAndMetricsTests.java deleted file mode 100644 index 7a854992c1ec..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/test/java/com/azure/resourcemanager/monitor/MonitorActivityAndMetricsTests.java +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.monitor; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.exception.ManagementException; -import com.azure.resourcemanager.compute.models.VirtualMachine; -import com.azure.resourcemanager.monitor.models.EventData; -import com.azure.resourcemanager.monitor.models.EventDataPropertyName; -import com.azure.resourcemanager.monitor.models.LocalizableString; -import com.azure.resourcemanager.monitor.models.MetricCollection; -import com.azure.resourcemanager.monitor.models.MetricDefinition; -import com.azure.resourcemanager.monitor.models.ResultType; -import com.azure.resourcemanager.test.utils.TestUtilities; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public class MonitorActivityAndMetricsTests extends MonitorManagementTest { - @Test - public void canListEventsAndMetrics() throws Exception { - // make sure there exists a VM - - OffsetDateTime now = OffsetDateTime.parse("2021-10-28T15:19:33.617526800-07:00"); - if (!this.isPlaybackMode()) { - now = OffsetDateTime.now(); - System.out.println("record timestamp: " + now); - } - - OffsetDateTime recordDateTime = now.minusDays(40); - VirtualMachine vm = computeManager.virtualMachines().list().iterator().next(); - - // Metric Definition - PagedIterable mt = monitorManager.metricDefinitions().listByResource(vm.id()); - - Assertions.assertNotNull(mt); - MetricDefinition mDef = mt.iterator().next(); - Assertions.assertNotNull(mDef.metricAvailabilities()); - Assertions.assertNotNull(mDef.namespace()); - Assertions.assertNotNull(mDef.supportedAggregationTypes()); - - // Metric - MetricCollection metrics = - mDef - .defineQuery() - .startingFrom(recordDateTime.minusDays(30)) - .endsBefore(recordDateTime) - .withResultType(ResultType.DATA) - .execute(); - - Assertions.assertNotNull(metrics); - Assertions.assertNotNull(metrics.namespace()); - Assertions.assertNotNull(metrics.resourceRegion()); - Assertions.assertEquals("Microsoft.Compute/virtualMachines", metrics.namespace()); - - // Activity Logs - PagedIterable retVal = - monitorManager - .activityLogs() - .defineQuery() - .startingFrom(recordDateTime.minusDays(30)) - .endsBefore(recordDateTime) - .withResponseProperties( - EventDataPropertyName.RESOURCEID, - EventDataPropertyName.EVENTTIMESTAMP, - EventDataPropertyName.OPERATIONNAME, - EventDataPropertyName.EVENTNAME) - .filterByResource(vm.id()) - .execute(); - - Assertions.assertNotNull(retVal); - for (EventData event : retVal) { - Assertions.assertTrue(event.resourceId().toLowerCase().startsWith(vm.id().toLowerCase())); - Assertions.assertNotNull(event.eventName().localizedValue()); - Assertions.assertNotNull(event.operationName().localizedValue()); - Assertions.assertNotNull(event.eventTimestamp()); - - Assertions.assertNull(event.category()); - Assertions.assertNull(event.authorization()); - Assertions.assertNull(event.caller()); - Assertions.assertNull(event.correlationId()); - Assertions.assertNull(event.description()); - Assertions.assertNull(event.eventDataId()); - Assertions.assertNull(event.httpRequest()); - Assertions.assertNull(event.level()); - } - - // List Event Categories - PagedIterable eventCategories = monitorManager.activityLogs().listEventCategories(); - Assertions.assertNotNull(eventCategories); - Assertions.assertTrue(TestUtilities.getSize(eventCategories) > 0); - - // List Activity logs at tenant level is not allowed for the current tenant - try { - monitorManager - .activityLogs() - .defineQuery() - .startingFrom(recordDateTime.minusDays(30)) - .endsBefore(recordDateTime) - .withResponseProperties( - EventDataPropertyName.RESOURCEID, - EventDataPropertyName.EVENTTIMESTAMP, - EventDataPropertyName.OPERATIONNAME, - EventDataPropertyName.EVENTNAME) - .filterByResource(vm.id()) - .filterAtTenantLevel() - .execute(); - } catch (ManagementException er) { - // should throw "The client '...' with object id '...' does not have authorization to perform action - // 'microsoft.insights/eventtypes/values/read' over scope - // '/providers/microsoft.insights/eventtypes/management'. - Assertions.assertEquals(403, er.getResponse().getStatusCode()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/test/java/com/azure/resourcemanager/monitor/MonitorManagementTest.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/test/java/com/azure/resourcemanager/monitor/MonitorManagementTest.java deleted file mode 100644 index 6b189a85f319..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/test/java/com/azure/resourcemanager/monitor/MonitorManagementTest.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.monitor; - -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.policy.HttpLogOptions; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.resourcemanager.appservice.AppServiceManager; -import com.azure.resourcemanager.compute.ComputeManager; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.eventhubs.EventHubsManager; -import com.azure.resourcemanager.resources.ResourceManager; -import com.azure.resourcemanager.resources.fluentcore.utils.HttpPipelineProvider; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import com.azure.resourcemanager.storage.StorageManager; -import com.azure.resourcemanager.test.ResourceManagerTestBase; -import com.azure.resourcemanager.test.utils.TestDelayProvider; -import com.azure.resourcemanager.test.utils.TestIdentifierProvider; - -import java.time.temporal.ChronoUnit; -import java.util.List; - -/** The base for Monitor manager tests. */ -public class MonitorManagementTest extends ResourceManagerTestBase { - protected ResourceManager resourceManager; - protected MonitorManager monitorManager; - protected ComputeManager computeManager; - protected StorageManager storageManager; - protected EventHubsManager eventHubManager; - protected AppServiceManager appServiceManager; - - @Override - protected HttpPipeline buildHttpPipeline( - TokenCredential credential, - AzureProfile profile, - HttpLogOptions httpLogOptions, - List policies, - HttpClient httpClient) { - return HttpPipelineProvider.buildHttpPipeline( - credential, - profile, - null, - httpLogOptions, - null, - new RetryPolicy("Retry-After", ChronoUnit.SECONDS), - policies, - httpClient); - } - - @Override - protected void initializeClients(HttpPipeline httpPipeline, AzureProfile profile) { - ResourceManagerUtils.InternalRuntimeContext.setDelayProvider(new TestDelayProvider(!isPlaybackMode())); - ResourceManagerUtils.InternalRuntimeContext internalContext = new ResourceManagerUtils.InternalRuntimeContext(); - internalContext.setIdentifierFunction(name -> new TestIdentifierProvider(testResourceNamer)); - appServiceManager = buildManager(AppServiceManager.class, httpPipeline, profile); - monitorManager = buildManager(MonitorManager.class, httpPipeline, profile); - computeManager = buildManager(ComputeManager.class, httpPipeline, profile); - storageManager = buildManager(StorageManager.class, httpPipeline, profile); - eventHubManager = buildManager(EventHubsManager.class, httpPipeline, profile); - resourceManager = monitorManager.resourceManager(); - setInternalContext(internalContext, computeManager); - } - - @Override - protected void cleanUpResources() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/test/java/com/azure/resourcemanager/monitor/TypeSerializationTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/test/java/com/azure/resourcemanager/monitor/TypeSerializationTests.java deleted file mode 100644 index 09debdf0d240..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/test/java/com/azure/resourcemanager/monitor/TypeSerializationTests.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.monitor; - -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerAdapter; -import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.resourcemanager.monitor.fluent.models.AlertRuleResourceInner; -import com.azure.resourcemanager.monitor.fluent.models.LogSearchRuleResourceInner; -import com.azure.resourcemanager.monitor.fluent.models.MetricAlertResourceInner; -import java.util.Arrays; - -import com.azure.resourcemanager.monitor.models.AlertingAction; -import com.azure.resourcemanager.monitor.models.MetricAlertMultipleResourceMultipleMetricCriteria; -import com.azure.resourcemanager.monitor.models.RuleEmailAction; -import com.azure.resourcemanager.monitor.models.RuleMetricDataSource; -import com.azure.resourcemanager.monitor.models.ThresholdRuleCondition; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public class TypeSerializationTests { - - @Test - public void testDiscriminatorSerialization() throws Exception { - // Currently solved by @JsonFlatten annotation and escape on "odata.type" (as "odata\\.type") - - SerializerAdapter adapter = SerializerFactory.createDefaultManagementSerializerAdapter(); - - MetricAlertResourceInner metricAlertInner = new MetricAlertResourceInner(); - metricAlertInner.withCriteria(new MetricAlertMultipleResourceMultipleMetricCriteria()); - String metricAlertInnerJson = adapter.serialize(metricAlertInner, SerializerEncoding.JSON); - checkOdatatypeJson(metricAlertInnerJson); - - MetricAlertResourceInner metricAlertInner2 = adapter.deserialize(metricAlertInnerJson, MetricAlertResourceInner.class, SerializerEncoding.JSON); - Assertions.assertTrue(metricAlertInner2.criteria() instanceof MetricAlertMultipleResourceMultipleMetricCriteria); - - AlertRuleResourceInner alertRuleInner = new AlertRuleResourceInner(); - alertRuleInner.withActions(Arrays.asList(new RuleEmailAction())); - alertRuleInner.withCondition(new ThresholdRuleCondition().withDataSource(new RuleMetricDataSource())); - String alertRuleInnerJson = adapter.serialize(alertRuleInner, SerializerEncoding.JSON); - checkOdatatypeJson(alertRuleInnerJson); - - LogSearchRuleResourceInner logSearchRuleInner = new LogSearchRuleResourceInner(); - logSearchRuleInner.withAction(new AlertingAction()); - String logSearchRuleInnerJson = adapter.serialize(logSearchRuleInner, SerializerEncoding.JSON); - checkOdatatypeJson(logSearchRuleInnerJson); - } - - private void checkOdatatypeJson(String json) { - final String odataTypeDiscriminatorSignature = "\"odata.type\":"; - final String incorrectOdataTypeDiscriminatorSignature = "\"odata\":"; - Assertions.assertTrue(json.contains(odataTypeDiscriminatorSignature)); - Assertions.assertFalse(json.contains(incorrectOdataTypeDiscriminatorSignature)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/test/resources/junit-platform.properties b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/test/resources/junit-platform.properties deleted file mode 100644 index 202d099b3ee8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/test/resources/junit-platform.properties +++ /dev/null @@ -1,4 +0,0 @@ -junit.jupiter.execution.parallel.enabled=true -junit.jupiter.execution.parallel.mode.default=concurrent -junit.jupiter.execution.parallel.config.strategy=fixed -junit.jupiter.execution.parallel.config.fixed.parallelism=32 diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/.gitignore b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/.gitignore deleted file mode 100644 index c71ea97aba95..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/.apt_generated/ diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/CHANGELOG.md b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/CHANGELOG.md deleted file mode 100644 index 8e8c2b1f857d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/CHANGELOG.md +++ /dev/null @@ -1,8 +0,0 @@ -# Release History - -## 1.0.0-hybrid (2022-01-12) - -- Azure Resource Manager network client library for Java (Hybrid) using API Profiles to allow building hybrid cloud solutions -that target both Azure and Azure Stack Hub. -- Supports api versions in the 2020-09-01-hybrid api profile -- Requires Azure Stack Update 2102+ diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/README.md b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/README.md deleted file mode 100644 index 67b309cf8d46..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/README.md +++ /dev/null @@ -1,135 +0,0 @@ -# Azure Resource Manager network client library for Java (Hybrid) - -Azure Resource Manager network client library for Java (Hybrid) using [API Profiles][api_profile] to allow building hybrid cloud solutions -that target both Azure and Azure Stack Hub. - -For documentation on how to use this package, please see [Azure Management Libraries for Java (Hybrid)][resourcemanagerhybrid_lib]. - -## Getting started - -### Prerequisites - -- [Java Development Kit (JDK)][jdk] with version 8 or above -- [Azure Subscription][azure_subscription] - -### Adding the package to your product - -```xml - - com.azure.resourcemanager - azure-resourcemanager-network - 1.0.0-hybrid - -``` - -### Include the recommended packages - -Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. - -[Azure Identity][azure_identity] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation. - -### Authentication - -By default, Azure Active Directory token authentication depends on correct configure of following environment variables. - -- `AZURE_CLIENT_ID` for Azure client ID. -- `AZURE_TENANT_ID` for Azure tenant ID. -- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. - -In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`. - -With above configuration, `azure` client can be authenticated by following code: - -```java com.azure.resourcemanager.network.authenticate -String armEndpoint = "https://management.."; -AzureProfile profile = new AzureProfile(getAzureEnvironmentFromArmEndpoint(armEndpoint)); -TokenCredential credential = new DefaultAzureCredentialBuilder() - .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) - .build(); -NetworkManager manager = NetworkManager - .authenticate(credential, profile); -``` - -Change `armEndpoint` to point to the Azure Resource Manager endpoint of your Azure Stack Hub. The azure environment's -properties above can be populated with the following example: - -```java com.azure.resourcemanager.network.getazureenvironment -private static AzureEnvironment getAzureEnvironmentFromArmEndpoint(String armEndpoint) { - // Create HTTP client and request - HttpClient httpClient = HttpClient.createDefault(); - - HttpRequest request = new HttpRequest(HttpMethod.GET, - String.format("%s/metadata/endpoints?api-version=2019-10-01", armEndpoint)) - .setHeader("accept", "application/json"); - - // Execute the request and read the response - HttpResponse response = httpClient.send(request).block(); - if (response.getStatusCode() != 200) { - throw new RuntimeException("Failed : HTTP error code : " + response.getStatusCode()); - } - String body = response.getBodyAsString().block(); - try { - ArrayNode metadataArray = JacksonAdapter.createDefaultSerializerAdapter() - .deserialize(body, ArrayNode.class, SerializerEncoding.JSON); - - if (metadataArray == null || metadataArray.isEmpty()) { - throw new RuntimeException("Failed to find metadata : " + body); - } - - JsonNode metadata = metadataArray.iterator().next(); - AzureEnvironment azureEnvironment = new AzureEnvironment(new HashMap() { - { - put("managementEndpointUrl", metadata.at("/authentication/audiences/0").asText()); - put("resourceManagerEndpointUrl", armEndpoint); - put("galleryEndpointUrl", metadata.at("/gallery").asText()); - put("activeDirectoryEndpointUrl", metadata.at("/authentication/loginEndpoint").asText()); - put("activeDirectoryResourceId", metadata.at("/authentication/audiences/0").asText()); - put("activeDirectoryGraphResourceId", metadata.at("/graph").asText()); - put("storageEndpointSuffix", "." + metadata.at("/suffixes/storage").asText()); - put("keyVaultDnsSuffix", "." + metadata.at("/suffixes/keyVaultDns").asText()); - } - }); - return azureEnvironment; - } catch (IOException ioe) { - ioe.printStackTrace(); - throw new RuntimeException(ioe); - } -} -``` - -When targeting a hybrid solution to global Azure instead of your Azure Stack Hub, `AzureEnvironment.AZURE` can be used instead. - -See [Authentication][authenticate] for more options. - -## Key concepts - -See [API design][design] for general introduction on design and key concepts on Azure Management Libraries. - -## Examples - -See [Samples][sample] for code snippets and samples. - -## Troubleshooting - -## Next steps - -## Contributing - -For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). - -1. Fork it -1. Create your feature branch (`git checkout -b my-new-feature`) -1. Commit your changes (`git commit -am 'Add some feature'`) -1. Push to the branch (`git push origin my-new-feature`) -1. Create new Pull Request - - -[jdk]: https://learn.microsoft.com/java/azure/jdk/ -[azure_subscription]: https://azure.microsoft.com/free/ -[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity -[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty -[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md -[sample]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/SAMPLE.md -[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md -[api_profile]: https://learn.microsoft.com/azure-stack/user/azure-stack-version-profiles -[resourcemanagerhybrid_lib]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanagerhybrid diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/pom.xml b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/pom.xml deleted file mode 100644 index 4d3347a3d01c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/pom.xml +++ /dev/null @@ -1,161 +0,0 @@ - - - 4.0.0 - - com.azure - azure-client-sdk-parent - 1.7.0 - ../../parents/azure-client-sdk-parent - - - com.azure.resourcemanager - azure-resourcemanager-network - 1.0.0-hybrid - jar - - Microsoft Azure SDK for Network Management (Hybrid) - This package contains Microsoft Azure Network Management Hybrid SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt - https://github.com/Azure/azure-sdk-for-java - - - - The MIT License (MIT) - http://opensource.org/licenses/MIT - repo - - - - - https://github.com/Azure/azure-sdk-for-java - scm:git:git@github.com:Azure/azure-sdk-for-java.git - HEAD - - - - - 0.10 - 0.10 - - - --add-exports com.azure.resourcemanager.resources/com.azure.resourcemanager.resources.fluentcore.arm.implementation=ALL-UNNAMED - --add-exports com.azure.resourcemanager.resources/com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation=ALL-UNNAMED - --add-exports com.azure.resourcemanager.resources/com.azure.resourcemanager.resources.fluentcore.arm.models.implementation=ALL-UNNAMED - --add-exports com.azure.resourcemanager.resources/com.azure.resourcemanager.resources.fluentcore.model.implementation=ALL-UNNAMED - - --add-opens com.azure.resourcemanager.network/com.azure.resourcemanager.network=ALL-UNNAMED - --add-opens com.azure.resourcemanager.resources/com.azure.resourcemanager.resources=ALL-UNNAMED - --add-opens com.azure.resourcemanager.resources/com.azure.resourcemanager.resources.fluentcore.arm=ALL-UNNAMED - --add-opens com.azure.core/com.azure.core.implementation.jackson=ALL-UNNAMED - - - - - - microsoft - Microsoft - - - - - - com.azure.resourcemanager - azure-resourcemanager-resources - 1.0.0-hybrid - - - org.junit.jupiter - junit-jupiter-engine - 5.13.4 - test - - - org.slf4j - slf4j-simple - 1.7.36 - test - - - com.azure - azure-core-http-netty - 1.16.2 - test - - - com.azure - azure-security-keyvault-certificates - 4.8.4 - test - - - com.azure.resourcemanager - azure-resourcemanager-keyvault - 1.0.0-hybrid - test - - - com.azure.resourcemanager - azure-resourcemanager-msi - 2.53.5 - test - - - org.junit.jupiter - junit-jupiter-api - 5.13.4 - test - - - - - azure-mgmt-sdk-test-jar - - - !maven.test.skip - - - - - com.azure.resourcemanager - azure-resourcemanager-test - 1.0.0-hybrid - test - - - - - - - - org.apache.maven.plugins - maven-jar-plugin - 3.4.2 - - - - true - true - - - - - - - org.jacoco - jacoco-maven-plugin - 0.8.13 - - - com/azure/resourcemanager/**/fluent/**/* - com/azure/resourcemanager/**/models/**/* - com/azure/resourcemanager/**/implementation/*ClientImpl* - com/azure/resourcemanager/**/implementation/*ClientBuilder* - - - - - - diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/NetworkManager.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/NetworkManager.java deleted file mode 100644 index d01d0f61bab0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/NetworkManager.java +++ /dev/null @@ -1,285 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network; - -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpPipeline; -import com.azure.resourcemanager.network.fluent.NetworkManagementClient; -import com.azure.resourcemanager.network.implementation.NetworkManagementClientBuilder; -import com.azure.resourcemanager.network.implementation.ApplicationGatewaysImpl; -import com.azure.resourcemanager.network.implementation.ApplicationSecurityGroupsImpl; -import com.azure.resourcemanager.network.implementation.DdosProtectionPlansImpl; -import com.azure.resourcemanager.network.implementation.ExpressRouteCircuitsImpl; -import com.azure.resourcemanager.network.implementation.ExpressRouteCrossConnectionsImpl; -import com.azure.resourcemanager.network.implementation.LoadBalancersImpl; -import com.azure.resourcemanager.network.implementation.LocalNetworkGatewaysImpl; -import com.azure.resourcemanager.network.implementation.NetworkInterfacesImpl; -import com.azure.resourcemanager.network.implementation.NetworkProfilesImpl; -import com.azure.resourcemanager.network.implementation.NetworkSecurityGroupsImpl; -import com.azure.resourcemanager.network.implementation.NetworkUsagesImpl; -import com.azure.resourcemanager.network.implementation.NetworkWatchersImpl; -import com.azure.resourcemanager.network.implementation.NetworksImpl; -import com.azure.resourcemanager.network.implementation.PublicIpAddressesImpl; -import com.azure.resourcemanager.network.implementation.PublicIpPrefixesImpl; -import com.azure.resourcemanager.network.implementation.RouteFiltersImpl; -import com.azure.resourcemanager.network.implementation.RouteTablesImpl; -import com.azure.resourcemanager.network.implementation.VirtualNetworkGatewaysImpl; -import com.azure.resourcemanager.network.models.ApplicationGateways; -import com.azure.resourcemanager.network.models.ApplicationSecurityGroups; -import com.azure.resourcemanager.network.models.DdosProtectionPlans; -import com.azure.resourcemanager.network.models.ExpressRouteCircuits; -import com.azure.resourcemanager.network.models.ExpressRouteCrossConnections; -import com.azure.resourcemanager.network.models.LoadBalancers; -import com.azure.resourcemanager.network.models.LocalNetworkGateways; -import com.azure.resourcemanager.network.models.NetworkInterfaces; -import com.azure.resourcemanager.network.models.NetworkProfiles; -import com.azure.resourcemanager.network.models.NetworkSecurityGroups; -import com.azure.resourcemanager.network.models.NetworkUsages; -import com.azure.resourcemanager.network.models.NetworkWatchers; -import com.azure.resourcemanager.network.models.Networks; -import com.azure.resourcemanager.network.models.PublicIpAddresses; -import com.azure.resourcemanager.network.models.PublicIpPrefixes; -import com.azure.resourcemanager.network.models.RouteFilters; -import com.azure.resourcemanager.network.models.RouteTables; -import com.azure.resourcemanager.network.models.VirtualNetworkGateways; -import com.azure.resourcemanager.resources.fluentcore.arm.AzureConfigurable; -import com.azure.resourcemanager.resources.fluentcore.arm.implementation.AzureConfigurableImpl; -import com.azure.resourcemanager.resources.fluentcore.arm.Manager; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.resources.fluentcore.utils.HttpPipelineProvider; - -import java.util.Objects; - -/** Entry point to Azure network management. */ -public final class NetworkManager extends Manager { - - // Collections - private PublicIpAddresses publicIPAddresses; - private PublicIpPrefixes publicIpPrefixes; - private Networks networks; - private NetworkSecurityGroups networkSecurityGroups; - private NetworkInterfaces networkInterfaces; - private LoadBalancers loadBalancers; - private RouteTables routeTables; - private ApplicationGateways applicationGateways; - private NetworkUsages networkUsages; - private NetworkWatchers networkWatchers; - private VirtualNetworkGateways virtualNetworkGateways; - private LocalNetworkGateways localNetworkGateways; - private ExpressRouteCircuits expressRouteCircuits; - private ApplicationSecurityGroups applicationSecurityGroups; - private RouteFilters routeFilters; - private DdosProtectionPlans ddosProtectionPlans; - private ExpressRouteCrossConnections expressRouteCrossConnections; - private NetworkProfiles networkProfiles; - - /** - * Get a Configurable instance that can be used to create {@link NetworkManager} with optional configuration. - * - * @return the instance allowing configurations - */ - public static Configurable configure() { - return new NetworkManager.ConfigurableImpl(); - } - - /** - * Creates an instance of NetworkManager that exposes network resource management API entry points. - * - * @param credential the credential to use - * @param profile the profile to use - * @return the NetworkManager - */ - public static NetworkManager authenticate(TokenCredential credential, AzureProfile profile) { - Objects.requireNonNull(credential, "'credential' cannot be null."); - Objects.requireNonNull(profile, "'profile' cannot be null."); - return authenticate(HttpPipelineProvider.buildHttpPipeline(credential, profile), profile); - } - - /** - * Creates an instance of NetworkManager that exposes network resource management API entry points. - * - * @param httpPipeline the HttpPipeline to be used for API calls. - * @param profile the profile to use - * @return the NetworkManager - */ - public static NetworkManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { - Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); - Objects.requireNonNull(profile, "'profile' cannot be null."); - return new NetworkManager(httpPipeline, profile); - } - - /** The interface allowing configurations to be set. */ - public interface Configurable extends AzureConfigurable { - /** - * Creates an instance of NetworkManager that exposes network management API entry points. - * - * @param credential the credential to use - * @param profile the profile to use - * @return the interface exposing network management API entry points that work across subscriptions - */ - NetworkManager authenticate(TokenCredential credential, AzureProfile profile); - } - - /** The implementation for Configurable interface. */ - private static class ConfigurableImpl extends AzureConfigurableImpl implements Configurable { - - public NetworkManager authenticate(TokenCredential credential, AzureProfile profile) { - return NetworkManager.authenticate(buildHttpPipeline(credential, profile), profile); - } - } - - private NetworkManager(HttpPipeline httpPipeline, AzureProfile profile) { - super( - httpPipeline, - profile, - new NetworkManagementClientBuilder() - .pipeline(httpPipeline) - .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) - .subscriptionId(profile.getSubscriptionId()) - .buildClient()); - } - - /** @return entry point to route table management */ - public RouteTables routeTables() { - if (this.routeTables == null) { - this.routeTables = new RouteTablesImpl(this); - } - return this.routeTables; - } - - /** @return entry point to virtual network management */ - public Networks networks() { - if (this.networks == null) { - this.networks = new NetworksImpl(this); - } - return this.networks; - } - - /** @return entry point to network security group management */ - public NetworkSecurityGroups networkSecurityGroups() { - if (this.networkSecurityGroups == null) { - this.networkSecurityGroups = new NetworkSecurityGroupsImpl(this); - } - return this.networkSecurityGroups; - } - - /** @return entry point to public IP address management */ - public PublicIpAddresses publicIpAddresses() { - if (this.publicIPAddresses == null) { - this.publicIPAddresses = new PublicIpAddressesImpl(this); - } - return this.publicIPAddresses; - } - - /** @return entry point to public IP prefix management */ - public PublicIpPrefixes publicIpPrefixes() { - if (this.publicIpPrefixes == null) { - this.publicIpPrefixes = new PublicIpPrefixesImpl(this); - } - return this.publicIpPrefixes; - } - - /** @return entry point to network interface management */ - public NetworkInterfaces networkInterfaces() { - if (networkInterfaces == null) { - this.networkInterfaces = new NetworkInterfacesImpl(this); - } - return this.networkInterfaces; - } - - /** @return entry point to application gateway management */ - public ApplicationGateways applicationGateways() { - if (this.applicationGateways == null) { - this.applicationGateways = new ApplicationGatewaysImpl(this); - } - return this.applicationGateways; - } - - /** @return entry point to load balancer management */ - public LoadBalancers loadBalancers() { - if (this.loadBalancers == null) { - this.loadBalancers = new LoadBalancersImpl(this); - } - return this.loadBalancers; - } - - /** @return entry point to network resource usage management API entry point */ - public NetworkUsages usages() { - if (this.networkUsages == null) { - this.networkUsages = new NetworkUsagesImpl(this.serviceClient()); - } - return this.networkUsages; - } - - /** @return entry point to network watchers management API entry point */ - public NetworkWatchers networkWatchers() { - if (this.networkWatchers == null) { - this.networkWatchers = new NetworkWatchersImpl(this); - } - return this.networkWatchers; - } - - /** @return entry point to virtual network gateways management */ - public VirtualNetworkGateways virtualNetworkGateways() { - if (this.virtualNetworkGateways == null) { - this.virtualNetworkGateways = new VirtualNetworkGatewaysImpl(this); - } - return this.virtualNetworkGateways; - } - - /** @return entry point to local network gateway management */ - public LocalNetworkGateways localNetworkGateways() { - if (this.localNetworkGateways == null) { - this.localNetworkGateways = new LocalNetworkGatewaysImpl(this); - } - return this.localNetworkGateways; - } - - /** @return entry point to express route circuit management */ - public ExpressRouteCircuits expressRouteCircuits() { - if (this.expressRouteCircuits == null) { - this.expressRouteCircuits = new ExpressRouteCircuitsImpl(this); - } - return this.expressRouteCircuits; - } - - /** @return entry point to application security groups management */ - public ApplicationSecurityGroups applicationSecurityGroups() { - if (this.applicationSecurityGroups == null) { - this.applicationSecurityGroups = new ApplicationSecurityGroupsImpl(this); - } - return this.applicationSecurityGroups; - } - - /** @return entry point to application security groups management */ - public RouteFilters routeFilters() { - if (this.routeFilters == null) { - this.routeFilters = new RouteFiltersImpl(this); - } - return this.routeFilters; - } - - /** @return entry point to DDoS protection plans management */ - public DdosProtectionPlans ddosProtectionPlans() { - if (this.ddosProtectionPlans == null) { - this.ddosProtectionPlans = new DdosProtectionPlansImpl(this); - } - return this.ddosProtectionPlans; - } - - /** @return entry point to express route cross connections management */ - public ExpressRouteCrossConnections expressRouteCrossConnections() { - if (this.expressRouteCrossConnections == null) { - this.expressRouteCrossConnections = new ExpressRouteCrossConnectionsImpl(this); - } - return this.expressRouteCrossConnections; - } - - /** @return entry point to network profiles management */ - public NetworkProfiles networkProfiles() { - if (this.networkProfiles == null) { - this.networkProfiles = new NetworkProfilesImpl(this); - } - return this.networkProfiles; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/ApplicationGatewaysClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/ApplicationGatewaysClient.java deleted file mode 100644 index 25172a64103a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/ApplicationGatewaysClient.java +++ /dev/null @@ -1,1074 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.models.ApplicationGatewayAvailableSslOptionsInner; -import com.azure.resourcemanager.network.fluent.models.ApplicationGatewayAvailableWafRuleSetsResultInner; -import com.azure.resourcemanager.network.fluent.models.ApplicationGatewayBackendHealthInner; -import com.azure.resourcemanager.network.fluent.models.ApplicationGatewayInner; -import com.azure.resourcemanager.network.fluent.models.ApplicationGatewaySslPredefinedPolicyInner; -import com.azure.resourcemanager.network.models.TagsObject; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import java.util.List; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ApplicationGatewaysClient. */ -public interface ApplicationGatewaysClient - extends InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete { - /** - * Deletes the specified application gateway. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync(String resourceGroupName, String applicationGatewayName); - - /** - * Deletes the specified application gateway. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String applicationGatewayName); - - /** - * Deletes the specified application gateway. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String applicationGatewayName); - - /** - * Deletes the specified application gateway. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String applicationGatewayName, Context context); - - /** - * Deletes the specified application gateway. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String applicationGatewayName); - - /** - * Deletes the specified application gateway. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String applicationGatewayName); - - /** - * Deletes the specified application gateway. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String applicationGatewayName, Context context); - - /** - * Gets the specified application gateway. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified application gateway. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String applicationGatewayName); - - /** - * Gets the specified application gateway. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified application gateway. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync(String resourceGroupName, String applicationGatewayName); - - /** - * Gets the specified application gateway. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified application gateway. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ApplicationGatewayInner getByResourceGroup(String resourceGroupName, String applicationGatewayName); - - /** - * Gets the specified application gateway. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified application gateway. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String applicationGatewayName, Context context); - - /** - * Creates or updates the specified application gateway. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @param parameters Parameters supplied to the create or update application gateway operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return application gateway resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters); - - /** - * Creates or updates the specified application gateway. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @param parameters Parameters supplied to the create or update application gateway operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return application gateway resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, ApplicationGatewayInner> beginCreateOrUpdateAsync( - String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters); - - /** - * Creates or updates the specified application gateway. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @param parameters Parameters supplied to the create or update application gateway operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return application gateway resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ApplicationGatewayInner> beginCreateOrUpdate( - String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters); - - /** - * Creates or updates the specified application gateway. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @param parameters Parameters supplied to the create or update application gateway operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return application gateway resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ApplicationGatewayInner> beginCreateOrUpdate( - String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters, Context context); - - /** - * Creates or updates the specified application gateway. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @param parameters Parameters supplied to the create or update application gateway operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return application gateway resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters); - - /** - * Creates or updates the specified application gateway. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @param parameters Parameters supplied to the create or update application gateway operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return application gateway resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ApplicationGatewayInner createOrUpdate( - String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters); - - /** - * Creates or updates the specified application gateway. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @param parameters Parameters supplied to the create or update application gateway operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return application gateway resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ApplicationGatewayInner createOrUpdate( - String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters, Context context); - - /** - * Updates the specified application gateway tags. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @param parameters Parameters supplied to update application gateway tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return application gateway resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> updateTagsWithResponseAsync( - String resourceGroupName, String applicationGatewayName, TagsObject parameters); - - /** - * Updates the specified application gateway tags. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @param parameters Parameters supplied to update application gateway tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return application gateway resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, ApplicationGatewayInner> beginUpdateTagsAsync( - String resourceGroupName, String applicationGatewayName, TagsObject parameters); - - /** - * Updates the specified application gateway tags. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @param parameters Parameters supplied to update application gateway tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return application gateway resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ApplicationGatewayInner> beginUpdateTags( - String resourceGroupName, String applicationGatewayName, TagsObject parameters); - - /** - * Updates the specified application gateway tags. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @param parameters Parameters supplied to update application gateway tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return application gateway resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ApplicationGatewayInner> beginUpdateTags( - String resourceGroupName, String applicationGatewayName, TagsObject parameters, Context context); - - /** - * Updates the specified application gateway tags. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @param parameters Parameters supplied to update application gateway tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return application gateway resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateTagsAsync( - String resourceGroupName, String applicationGatewayName, TagsObject parameters); - - /** - * Updates the specified application gateway tags. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @param parameters Parameters supplied to update application gateway tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return application gateway resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ApplicationGatewayInner updateTags(String resourceGroupName, String applicationGatewayName, TagsObject parameters); - - /** - * Updates the specified application gateway tags. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @param parameters Parameters supplied to update application gateway tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return application gateway resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ApplicationGatewayInner updateTags( - String resourceGroupName, String applicationGatewayName, TagsObject parameters, Context context); - - /** - * Lists all application gateways in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListApplicationGateways API service call. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName); - - /** - * Lists all application gateways in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListApplicationGateways API service call. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Lists all application gateways in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListApplicationGateways API service call. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * Gets all the application gateways in a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the application gateways in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Gets all the application gateways in a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the application gateways in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Gets all the application gateways in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the application gateways in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Starts the specified application gateway. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> startWithResponseAsync(String resourceGroupName, String applicationGatewayName); - - /** - * Starts the specified application gateway. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginStartAsync(String resourceGroupName, String applicationGatewayName); - - /** - * Starts the specified application gateway. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginStart(String resourceGroupName, String applicationGatewayName); - - /** - * Starts the specified application gateway. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginStart( - String resourceGroupName, String applicationGatewayName, Context context); - - /** - * Starts the specified application gateway. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono startAsync(String resourceGroupName, String applicationGatewayName); - - /** - * Starts the specified application gateway. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void start(String resourceGroupName, String applicationGatewayName); - - /** - * Starts the specified application gateway. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void start(String resourceGroupName, String applicationGatewayName, Context context); - - /** - * Stops the specified application gateway in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> stopWithResponseAsync(String resourceGroupName, String applicationGatewayName); - - /** - * Stops the specified application gateway in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginStopAsync(String resourceGroupName, String applicationGatewayName); - - /** - * Stops the specified application gateway in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginStop(String resourceGroupName, String applicationGatewayName); - - /** - * Stops the specified application gateway in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginStop( - String resourceGroupName, String applicationGatewayName, Context context); - - /** - * Stops the specified application gateway in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono stopAsync(String resourceGroupName, String applicationGatewayName); - - /** - * Stops the specified application gateway in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void stop(String resourceGroupName, String applicationGatewayName); - - /** - * Stops the specified application gateway in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void stop(String resourceGroupName, String applicationGatewayName, Context context); - - /** - * Gets the backend health of the specified application gateway in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the backend health of the specified application gateway in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> backendHealthWithResponseAsync( - String resourceGroupName, String applicationGatewayName, String expand); - - /** - * Gets the backend health of the specified application gateway in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the backend health of the specified application gateway in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, ApplicationGatewayBackendHealthInner> - beginBackendHealthAsync(String resourceGroupName, String applicationGatewayName, String expand); - - /** - * Gets the backend health of the specified application gateway in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the backend health of the specified application gateway in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ApplicationGatewayBackendHealthInner> - beginBackendHealth(String resourceGroupName, String applicationGatewayName, String expand); - - /** - * Gets the backend health of the specified application gateway in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the backend health of the specified application gateway in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ApplicationGatewayBackendHealthInner> - beginBackendHealth(String resourceGroupName, String applicationGatewayName, String expand, Context context); - - /** - * Gets the backend health of the specified application gateway in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the backend health of the specified application gateway in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono backendHealthAsync( - String resourceGroupName, String applicationGatewayName, String expand); - - /** - * Gets the backend health of the specified application gateway in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the backend health of the specified application gateway in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono backendHealthAsync( - String resourceGroupName, String applicationGatewayName); - - /** - * Gets the backend health of the specified application gateway in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the backend health of the specified application gateway in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ApplicationGatewayBackendHealthInner backendHealth( - String resourceGroupName, String applicationGatewayName, String expand); - - /** - * Gets the backend health of the specified application gateway in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the backend health of the specified application gateway in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ApplicationGatewayBackendHealthInner backendHealth(String resourceGroupName, String applicationGatewayName); - - /** - * Gets the backend health of the specified application gateway in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the backend health of the specified application gateway in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ApplicationGatewayBackendHealthInner backendHealth( - String resourceGroupName, String applicationGatewayName, String expand, Context context); - - /** - * Lists all available server variables. - * - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ApplicationGatewayAvailableServerVariables API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> listAvailableServerVariablesWithResponseAsync(); - - /** - * Lists all available server variables. - * - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ApplicationGatewayAvailableServerVariables API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listAvailableServerVariablesAsync(); - - /** - * Lists all available server variables. - * - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ApplicationGatewayAvailableServerVariables API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - List listAvailableServerVariables(); - - /** - * Lists all available server variables. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ApplicationGatewayAvailableServerVariables API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response> listAvailableServerVariablesWithResponse(Context context); - - /** - * Lists all available request headers. - * - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ApplicationGatewayAvailableRequestHeaders API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> listAvailableRequestHeadersWithResponseAsync(); - - /** - * Lists all available request headers. - * - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ApplicationGatewayAvailableRequestHeaders API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listAvailableRequestHeadersAsync(); - - /** - * Lists all available request headers. - * - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ApplicationGatewayAvailableRequestHeaders API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - List listAvailableRequestHeaders(); - - /** - * Lists all available request headers. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ApplicationGatewayAvailableRequestHeaders API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response> listAvailableRequestHeadersWithResponse(Context context); - - /** - * Lists all available response headers. - * - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ApplicationGatewayAvailableResponseHeaders API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> listAvailableResponseHeadersWithResponseAsync(); - - /** - * Lists all available response headers. - * - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ApplicationGatewayAvailableResponseHeaders API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listAvailableResponseHeadersAsync(); - - /** - * Lists all available response headers. - * - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ApplicationGatewayAvailableResponseHeaders API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - List listAvailableResponseHeaders(); - - /** - * Lists all available response headers. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ApplicationGatewayAvailableResponseHeaders API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response> listAvailableResponseHeadersWithResponse(Context context); - - /** - * Lists all available web application firewall rule sets. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ApplicationGatewayAvailableWafRuleSets API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listAvailableWafRuleSetsWithResponseAsync(); - - /** - * Lists all available web application firewall rule sets. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ApplicationGatewayAvailableWafRuleSets API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listAvailableWafRuleSetsAsync(); - - /** - * Lists all available web application firewall rule sets. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ApplicationGatewayAvailableWafRuleSets API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ApplicationGatewayAvailableWafRuleSetsResultInner listAvailableWafRuleSets(); - - /** - * Lists all available web application firewall rule sets. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ApplicationGatewayAvailableWafRuleSets API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listAvailableWafRuleSetsWithResponse(Context context); - - /** - * Lists available Ssl options for configuring Ssl policy. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ApplicationGatewayAvailableSslOptions API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listAvailableSslOptionsWithResponseAsync(); - - /** - * Lists available Ssl options for configuring Ssl policy. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ApplicationGatewayAvailableSslOptions API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listAvailableSslOptionsAsync(); - - /** - * Lists available Ssl options for configuring Ssl policy. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ApplicationGatewayAvailableSslOptions API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ApplicationGatewayAvailableSslOptionsInner listAvailableSslOptions(); - - /** - * Lists available Ssl options for configuring Ssl policy. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ApplicationGatewayAvailableSslOptions API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listAvailableSslOptionsWithResponse(Context context); - - /** - * Lists all SSL predefined policies for configuring Ssl policy. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ApplicationGatewayAvailableSslOptions API service call. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAvailableSslPredefinedPoliciesAsync(); - - /** - * Lists all SSL predefined policies for configuring Ssl policy. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ApplicationGatewayAvailableSslOptions API service call. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listAvailableSslPredefinedPolicies(); - - /** - * Lists all SSL predefined policies for configuring Ssl policy. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ApplicationGatewayAvailableSslOptions API service call. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listAvailableSslPredefinedPolicies(Context context); - - /** - * Gets Ssl predefined policy with the specified policy name. - * - * @param predefinedPolicyName Name of Ssl predefined policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ssl predefined policy with the specified policy name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getSslPredefinedPolicyWithResponseAsync( - String predefinedPolicyName); - - /** - * Gets Ssl predefined policy with the specified policy name. - * - * @param predefinedPolicyName Name of Ssl predefined policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ssl predefined policy with the specified policy name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getSslPredefinedPolicyAsync(String predefinedPolicyName); - - /** - * Gets Ssl predefined policy with the specified policy name. - * - * @param predefinedPolicyName Name of Ssl predefined policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ssl predefined policy with the specified policy name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ApplicationGatewaySslPredefinedPolicyInner getSslPredefinedPolicy(String predefinedPolicyName); - - /** - * Gets Ssl predefined policy with the specified policy name. - * - * @param predefinedPolicyName Name of Ssl predefined policy. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ssl predefined policy with the specified policy name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getSslPredefinedPolicyWithResponse( - String predefinedPolicyName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/ApplicationSecurityGroupsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/ApplicationSecurityGroupsClient.java deleted file mode 100644 index 7e2d13710ad5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/ApplicationSecurityGroupsClient.java +++ /dev/null @@ -1,467 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.models.ApplicationSecurityGroupInner; -import com.azure.resourcemanager.network.models.TagsObject; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ApplicationSecurityGroupsClient. */ -public interface ApplicationSecurityGroupsClient - extends InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete { - /** - * Deletes the specified application security group. - * - * @param resourceGroupName The name of the resource group. - * @param applicationSecurityGroupName The name of the application security group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync( - String resourceGroupName, String applicationSecurityGroupName); - - /** - * Deletes the specified application security group. - * - * @param resourceGroupName The name of the resource group. - * @param applicationSecurityGroupName The name of the application security group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String applicationSecurityGroupName); - - /** - * Deletes the specified application security group. - * - * @param resourceGroupName The name of the resource group. - * @param applicationSecurityGroupName The name of the application security group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String applicationSecurityGroupName); - - /** - * Deletes the specified application security group. - * - * @param resourceGroupName The name of the resource group. - * @param applicationSecurityGroupName The name of the application security group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String applicationSecurityGroupName, Context context); - - /** - * Deletes the specified application security group. - * - * @param resourceGroupName The name of the resource group. - * @param applicationSecurityGroupName The name of the application security group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String applicationSecurityGroupName); - - /** - * Deletes the specified application security group. - * - * @param resourceGroupName The name of the resource group. - * @param applicationSecurityGroupName The name of the application security group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String applicationSecurityGroupName); - - /** - * Deletes the specified application security group. - * - * @param resourceGroupName The name of the resource group. - * @param applicationSecurityGroupName The name of the application security group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String applicationSecurityGroupName, Context context); - - /** - * Gets information about the specified application security group. - * - * @param resourceGroupName The name of the resource group. - * @param applicationSecurityGroupName The name of the application security group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified application security group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String applicationSecurityGroupName); - - /** - * Gets information about the specified application security group. - * - * @param resourceGroupName The name of the resource group. - * @param applicationSecurityGroupName The name of the application security group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified application security group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync( - String resourceGroupName, String applicationSecurityGroupName); - - /** - * Gets information about the specified application security group. - * - * @param resourceGroupName The name of the resource group. - * @param applicationSecurityGroupName The name of the application security group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified application security group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ApplicationSecurityGroupInner getByResourceGroup(String resourceGroupName, String applicationSecurityGroupName); - - /** - * Gets information about the specified application security group. - * - * @param resourceGroupName The name of the resource group. - * @param applicationSecurityGroupName The name of the application security group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified application security group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String applicationSecurityGroupName, Context context); - - /** - * Creates or updates an application security group. - * - * @param resourceGroupName The name of the resource group. - * @param applicationSecurityGroupName The name of the application security group. - * @param parameters Parameters supplied to the create or update ApplicationSecurityGroup operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an application security group in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String applicationSecurityGroupName, ApplicationSecurityGroupInner parameters); - - /** - * Creates or updates an application security group. - * - * @param resourceGroupName The name of the resource group. - * @param applicationSecurityGroupName The name of the application security group. - * @param parameters Parameters supplied to the create or update ApplicationSecurityGroup operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an application security group in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, ApplicationSecurityGroupInner> beginCreateOrUpdateAsync( - String resourceGroupName, String applicationSecurityGroupName, ApplicationSecurityGroupInner parameters); - - /** - * Creates or updates an application security group. - * - * @param resourceGroupName The name of the resource group. - * @param applicationSecurityGroupName The name of the application security group. - * @param parameters Parameters supplied to the create or update ApplicationSecurityGroup operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an application security group in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ApplicationSecurityGroupInner> beginCreateOrUpdate( - String resourceGroupName, String applicationSecurityGroupName, ApplicationSecurityGroupInner parameters); - - /** - * Creates or updates an application security group. - * - * @param resourceGroupName The name of the resource group. - * @param applicationSecurityGroupName The name of the application security group. - * @param parameters Parameters supplied to the create or update ApplicationSecurityGroup operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an application security group in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ApplicationSecurityGroupInner> beginCreateOrUpdate( - String resourceGroupName, - String applicationSecurityGroupName, - ApplicationSecurityGroupInner parameters, - Context context); - - /** - * Creates or updates an application security group. - * - * @param resourceGroupName The name of the resource group. - * @param applicationSecurityGroupName The name of the application security group. - * @param parameters Parameters supplied to the create or update ApplicationSecurityGroup operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an application security group in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, String applicationSecurityGroupName, ApplicationSecurityGroupInner parameters); - - /** - * Creates or updates an application security group. - * - * @param resourceGroupName The name of the resource group. - * @param applicationSecurityGroupName The name of the application security group. - * @param parameters Parameters supplied to the create or update ApplicationSecurityGroup operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an application security group in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ApplicationSecurityGroupInner createOrUpdate( - String resourceGroupName, String applicationSecurityGroupName, ApplicationSecurityGroupInner parameters); - - /** - * Creates or updates an application security group. - * - * @param resourceGroupName The name of the resource group. - * @param applicationSecurityGroupName The name of the application security group. - * @param parameters Parameters supplied to the create or update ApplicationSecurityGroup operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an application security group in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ApplicationSecurityGroupInner createOrUpdate( - String resourceGroupName, - String applicationSecurityGroupName, - ApplicationSecurityGroupInner parameters, - Context context); - - /** - * Updates an application security group's tags. - * - * @param resourceGroupName The name of the resource group. - * @param applicationSecurityGroupName The name of the application security group. - * @param parameters Parameters supplied to update application security group tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an application security group in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> updateTagsWithResponseAsync( - String resourceGroupName, String applicationSecurityGroupName, TagsObject parameters); - - /** - * Updates an application security group's tags. - * - * @param resourceGroupName The name of the resource group. - * @param applicationSecurityGroupName The name of the application security group. - * @param parameters Parameters supplied to update application security group tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an application security group in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, ApplicationSecurityGroupInner> beginUpdateTagsAsync( - String resourceGroupName, String applicationSecurityGroupName, TagsObject parameters); - - /** - * Updates an application security group's tags. - * - * @param resourceGroupName The name of the resource group. - * @param applicationSecurityGroupName The name of the application security group. - * @param parameters Parameters supplied to update application security group tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an application security group in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ApplicationSecurityGroupInner> beginUpdateTags( - String resourceGroupName, String applicationSecurityGroupName, TagsObject parameters); - - /** - * Updates an application security group's tags. - * - * @param resourceGroupName The name of the resource group. - * @param applicationSecurityGroupName The name of the application security group. - * @param parameters Parameters supplied to update application security group tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an application security group in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ApplicationSecurityGroupInner> beginUpdateTags( - String resourceGroupName, String applicationSecurityGroupName, TagsObject parameters, Context context); - - /** - * Updates an application security group's tags. - * - * @param resourceGroupName The name of the resource group. - * @param applicationSecurityGroupName The name of the application security group. - * @param parameters Parameters supplied to update application security group tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an application security group in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateTagsAsync( - String resourceGroupName, String applicationSecurityGroupName, TagsObject parameters); - - /** - * Updates an application security group's tags. - * - * @param resourceGroupName The name of the resource group. - * @param applicationSecurityGroupName The name of the application security group. - * @param parameters Parameters supplied to update application security group tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an application security group in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ApplicationSecurityGroupInner updateTags( - String resourceGroupName, String applicationSecurityGroupName, TagsObject parameters); - - /** - * Updates an application security group's tags. - * - * @param resourceGroupName The name of the resource group. - * @param applicationSecurityGroupName The name of the application security group. - * @param parameters Parameters supplied to update application security group tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an application security group in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ApplicationSecurityGroupInner updateTags( - String resourceGroupName, String applicationSecurityGroupName, TagsObject parameters, Context context); - - /** - * Gets all application security groups in a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all application security groups in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Gets all application security groups in a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all application security groups in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Gets all application security groups in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all application security groups in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Gets all the application security groups in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the application security groups in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName); - - /** - * Gets all the application security groups in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the application security groups in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Gets all the application security groups in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the application security groups in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/AvailableDelegationsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/AvailableDelegationsClient.java deleted file mode 100644 index edba92ccfa48..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/AvailableDelegationsClient.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.network.fluent.models.AvailableDelegationInner; - -/** An instance of this class provides access to all the operations defined in AvailableDelegationsClient. */ -public interface AvailableDelegationsClient { - /** - * Gets all of the available subnet delegations for this subscription in this region. - * - * @param location The location of the subnet. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all of the available subnet delegations for this subscription in this region. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String location); - - /** - * Gets all of the available subnet delegations for this subscription in this region. - * - * @param location The location of the subnet. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all of the available subnet delegations for this subscription in this region. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String location); - - /** - * Gets all of the available subnet delegations for this subscription in this region. - * - * @param location The location of the subnet. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all of the available subnet delegations for this subscription in this region. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String location, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/AvailableEndpointServicesClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/AvailableEndpointServicesClient.java deleted file mode 100644 index bb2075fe3d7c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/AvailableEndpointServicesClient.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.network.fluent.models.EndpointServiceResultInner; - -/** An instance of this class provides access to all the operations defined in AvailableEndpointServicesClient. */ -public interface AvailableEndpointServicesClient { - /** - * List what values of endpoint services are available for use. - * - * @param location The location to check available endpoint services. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the ListAvailableEndpointServices API service call. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String location); - - /** - * List what values of endpoint services are available for use. - * - * @param location The location to check available endpoint services. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the ListAvailableEndpointServices API service call. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String location); - - /** - * List what values of endpoint services are available for use. - * - * @param location The location to check available endpoint services. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the ListAvailableEndpointServices API service call. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String location, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/AvailableResourceGroupDelegationsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/AvailableResourceGroupDelegationsClient.java deleted file mode 100644 index a287d47e6996..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/AvailableResourceGroupDelegationsClient.java +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.network.fluent.models.AvailableDelegationInner; - -/** - * An instance of this class provides access to all the operations defined in AvailableResourceGroupDelegationsClient. - */ -public interface AvailableResourceGroupDelegationsClient { - /** - * Gets all of the available subnet delegations for this resource group in this region. - * - * @param location The location of the domain name. - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all of the available subnet delegations for this resource group in this region. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String location, String resourceGroupName); - - /** - * Gets all of the available subnet delegations for this resource group in this region. - * - * @param location The location of the domain name. - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all of the available subnet delegations for this resource group in this region. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String location, String resourceGroupName); - - /** - * Gets all of the available subnet delegations for this resource group in this region. - * - * @param location The location of the domain name. - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all of the available subnet delegations for this resource group in this region. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String location, String resourceGroupName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/AzureFirewallFqdnTagsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/AzureFirewallFqdnTagsClient.java deleted file mode 100644 index f6f1ea295a24..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/AzureFirewallFqdnTagsClient.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.network.fluent.models.AzureFirewallFqdnTagInner; - -/** An instance of this class provides access to all the operations defined in AzureFirewallFqdnTagsClient. */ -public interface AzureFirewallFqdnTagsClient { - /** - * Gets all the Azure Firewall FQDN Tags in a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the Azure Firewall FQDN Tags in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Gets all the Azure Firewall FQDN Tags in a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the Azure Firewall FQDN Tags in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Gets all the Azure Firewall FQDN Tags in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the Azure Firewall FQDN Tags in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/AzureFirewallsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/AzureFirewallsClient.java deleted file mode 100644 index 0cf1f8240577..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/AzureFirewallsClient.java +++ /dev/null @@ -1,348 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.models.AzureFirewallInner; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in AzureFirewallsClient. */ -public interface AzureFirewallsClient - extends InnerSupportsGet, InnerSupportsListing, InnerSupportsDelete { - /** - * Deletes the specified Azure Firewall. - * - * @param resourceGroupName The name of the resource group. - * @param azureFirewallName The name of the Azure Firewall. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync(String resourceGroupName, String azureFirewallName); - - /** - * Deletes the specified Azure Firewall. - * - * @param resourceGroupName The name of the resource group. - * @param azureFirewallName The name of the Azure Firewall. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String azureFirewallName); - - /** - * Deletes the specified Azure Firewall. - * - * @param resourceGroupName The name of the resource group. - * @param azureFirewallName The name of the Azure Firewall. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String azureFirewallName); - - /** - * Deletes the specified Azure Firewall. - * - * @param resourceGroupName The name of the resource group. - * @param azureFirewallName The name of the Azure Firewall. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String azureFirewallName, Context context); - - /** - * Deletes the specified Azure Firewall. - * - * @param resourceGroupName The name of the resource group. - * @param azureFirewallName The name of the Azure Firewall. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String azureFirewallName); - - /** - * Deletes the specified Azure Firewall. - * - * @param resourceGroupName The name of the resource group. - * @param azureFirewallName The name of the Azure Firewall. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String azureFirewallName); - - /** - * Deletes the specified Azure Firewall. - * - * @param resourceGroupName The name of the resource group. - * @param azureFirewallName The name of the Azure Firewall. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String azureFirewallName, Context context); - - /** - * Gets the specified Azure Firewall. - * - * @param resourceGroupName The name of the resource group. - * @param azureFirewallName The name of the Azure Firewall. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Azure Firewall. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String azureFirewallName); - - /** - * Gets the specified Azure Firewall. - * - * @param resourceGroupName The name of the resource group. - * @param azureFirewallName The name of the Azure Firewall. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Azure Firewall. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync(String resourceGroupName, String azureFirewallName); - - /** - * Gets the specified Azure Firewall. - * - * @param resourceGroupName The name of the resource group. - * @param azureFirewallName The name of the Azure Firewall. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Azure Firewall. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AzureFirewallInner getByResourceGroup(String resourceGroupName, String azureFirewallName); - - /** - * Gets the specified Azure Firewall. - * - * @param resourceGroupName The name of the resource group. - * @param azureFirewallName The name of the Azure Firewall. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Azure Firewall. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String azureFirewallName, Context context); - - /** - * Creates or updates the specified Azure Firewall. - * - * @param resourceGroupName The name of the resource group. - * @param azureFirewallName The name of the Azure Firewall. - * @param parameters Parameters supplied to the create or update Azure Firewall operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure Firewall resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String azureFirewallName, AzureFirewallInner parameters); - - /** - * Creates or updates the specified Azure Firewall. - * - * @param resourceGroupName The name of the resource group. - * @param azureFirewallName The name of the Azure Firewall. - * @param parameters Parameters supplied to the create or update Azure Firewall operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure Firewall resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, AzureFirewallInner> beginCreateOrUpdateAsync( - String resourceGroupName, String azureFirewallName, AzureFirewallInner parameters); - - /** - * Creates or updates the specified Azure Firewall. - * - * @param resourceGroupName The name of the resource group. - * @param azureFirewallName The name of the Azure Firewall. - * @param parameters Parameters supplied to the create or update Azure Firewall operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure Firewall resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, AzureFirewallInner> beginCreateOrUpdate( - String resourceGroupName, String azureFirewallName, AzureFirewallInner parameters); - - /** - * Creates or updates the specified Azure Firewall. - * - * @param resourceGroupName The name of the resource group. - * @param azureFirewallName The name of the Azure Firewall. - * @param parameters Parameters supplied to the create or update Azure Firewall operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure Firewall resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, AzureFirewallInner> beginCreateOrUpdate( - String resourceGroupName, String azureFirewallName, AzureFirewallInner parameters, Context context); - - /** - * Creates or updates the specified Azure Firewall. - * - * @param resourceGroupName The name of the resource group. - * @param azureFirewallName The name of the Azure Firewall. - * @param parameters Parameters supplied to the create or update Azure Firewall operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure Firewall resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, String azureFirewallName, AzureFirewallInner parameters); - - /** - * Creates or updates the specified Azure Firewall. - * - * @param resourceGroupName The name of the resource group. - * @param azureFirewallName The name of the Azure Firewall. - * @param parameters Parameters supplied to the create or update Azure Firewall operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure Firewall resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AzureFirewallInner createOrUpdate( - String resourceGroupName, String azureFirewallName, AzureFirewallInner parameters); - - /** - * Creates or updates the specified Azure Firewall. - * - * @param resourceGroupName The name of the resource group. - * @param azureFirewallName The name of the Azure Firewall. - * @param parameters Parameters supplied to the create or update Azure Firewall operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure Firewall resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AzureFirewallInner createOrUpdate( - String resourceGroupName, String azureFirewallName, AzureFirewallInner parameters, Context context); - - /** - * Lists all Azure Firewalls in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListAzureFirewalls API service call. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName); - - /** - * Lists all Azure Firewalls in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListAzureFirewalls API service call. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Lists all Azure Firewalls in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListAzureFirewalls API service call. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * Gets all the Azure Firewalls in a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the Azure Firewalls in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Gets all the Azure Firewalls in a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the Azure Firewalls in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Gets all the Azure Firewalls in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the Azure Firewalls in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/BgpServiceCommunitiesClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/BgpServiceCommunitiesClient.java deleted file mode 100644 index 6763face20a6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/BgpServiceCommunitiesClient.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.network.fluent.models.BgpServiceCommunityInner; - -/** An instance of this class provides access to all the operations defined in BgpServiceCommunitiesClient. */ -public interface BgpServiceCommunitiesClient { - /** - * Gets all the available bgp service communities. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the available bgp service communities. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Gets all the available bgp service communities. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the available bgp service communities. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Gets all the available bgp service communities. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the available bgp service communities. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/ConnectionMonitorsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/ConnectionMonitorsClient.java deleted file mode 100644 index ab4d719e0260..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/ConnectionMonitorsClient.java +++ /dev/null @@ -1,675 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.models.ConnectionMonitorInner; -import com.azure.resourcemanager.network.fluent.models.ConnectionMonitorQueryResultInner; -import com.azure.resourcemanager.network.fluent.models.ConnectionMonitorResultInner; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ConnectionMonitorsClient. */ -public interface ConnectionMonitorsClient { - /** - * Create or update a connection monitor. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name of the connection monitor. - * @param parameters Parameters that define the operation to create a connection monitor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the connection monitor. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String networkWatcherName, - String connectionMonitorName, - ConnectionMonitorInner parameters); - - /** - * Create or update a connection monitor. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name of the connection monitor. - * @param parameters Parameters that define the operation to create a connection monitor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the connection monitor. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, ConnectionMonitorResultInner> beginCreateOrUpdateAsync( - String resourceGroupName, - String networkWatcherName, - String connectionMonitorName, - ConnectionMonitorInner parameters); - - /** - * Create or update a connection monitor. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name of the connection monitor. - * @param parameters Parameters that define the operation to create a connection monitor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the connection monitor. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ConnectionMonitorResultInner> beginCreateOrUpdate( - String resourceGroupName, - String networkWatcherName, - String connectionMonitorName, - ConnectionMonitorInner parameters); - - /** - * Create or update a connection monitor. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name of the connection monitor. - * @param parameters Parameters that define the operation to create a connection monitor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the connection monitor. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ConnectionMonitorResultInner> beginCreateOrUpdate( - String resourceGroupName, - String networkWatcherName, - String connectionMonitorName, - ConnectionMonitorInner parameters, - Context context); - - /** - * Create or update a connection monitor. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name of the connection monitor. - * @param parameters Parameters that define the operation to create a connection monitor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the connection monitor. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, - String networkWatcherName, - String connectionMonitorName, - ConnectionMonitorInner parameters); - - /** - * Create or update a connection monitor. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name of the connection monitor. - * @param parameters Parameters that define the operation to create a connection monitor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the connection monitor. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ConnectionMonitorResultInner createOrUpdate( - String resourceGroupName, - String networkWatcherName, - String connectionMonitorName, - ConnectionMonitorInner parameters); - - /** - * Create or update a connection monitor. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name of the connection monitor. - * @param parameters Parameters that define the operation to create a connection monitor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the connection monitor. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ConnectionMonitorResultInner createOrUpdate( - String resourceGroupName, - String networkWatcherName, - String connectionMonitorName, - ConnectionMonitorInner parameters, - Context context); - - /** - * Gets a connection monitor by name. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name of the connection monitor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a connection monitor by name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync( - String resourceGroupName, String networkWatcherName, String connectionMonitorName); - - /** - * Gets a connection monitor by name. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name of the connection monitor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a connection monitor by name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync( - String resourceGroupName, String networkWatcherName, String connectionMonitorName); - - /** - * Gets a connection monitor by name. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name of the connection monitor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a connection monitor by name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ConnectionMonitorResultInner get(String resourceGroupName, String networkWatcherName, String connectionMonitorName); - - /** - * Gets a connection monitor by name. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name of the connection monitor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a connection monitor by name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context); - - /** - * Deletes the specified connection monitor. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name of the connection monitor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync( - String resourceGroupName, String networkWatcherName, String connectionMonitorName); - - /** - * Deletes the specified connection monitor. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name of the connection monitor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String networkWatcherName, String connectionMonitorName); - - /** - * Deletes the specified connection monitor. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name of the connection monitor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String networkWatcherName, String connectionMonitorName); - - /** - * Deletes the specified connection monitor. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name of the connection monitor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context); - - /** - * Deletes the specified connection monitor. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name of the connection monitor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName); - - /** - * Deletes the specified connection monitor. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name of the connection monitor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String networkWatcherName, String connectionMonitorName); - - /** - * Deletes the specified connection monitor. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name of the connection monitor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context); - - /** - * Stops the specified connection monitor. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name of the connection monitor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> stopWithResponseAsync( - String resourceGroupName, String networkWatcherName, String connectionMonitorName); - - /** - * Stops the specified connection monitor. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name of the connection monitor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginStopAsync( - String resourceGroupName, String networkWatcherName, String connectionMonitorName); - - /** - * Stops the specified connection monitor. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name of the connection monitor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginStop( - String resourceGroupName, String networkWatcherName, String connectionMonitorName); - - /** - * Stops the specified connection monitor. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name of the connection monitor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginStop( - String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context); - - /** - * Stops the specified connection monitor. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name of the connection monitor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono stopAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName); - - /** - * Stops the specified connection monitor. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name of the connection monitor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void stop(String resourceGroupName, String networkWatcherName, String connectionMonitorName); - - /** - * Stops the specified connection monitor. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name of the connection monitor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void stop(String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context); - - /** - * Starts the specified connection monitor. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name of the connection monitor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> startWithResponseAsync( - String resourceGroupName, String networkWatcherName, String connectionMonitorName); - - /** - * Starts the specified connection monitor. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name of the connection monitor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginStartAsync( - String resourceGroupName, String networkWatcherName, String connectionMonitorName); - - /** - * Starts the specified connection monitor. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name of the connection monitor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginStart( - String resourceGroupName, String networkWatcherName, String connectionMonitorName); - - /** - * Starts the specified connection monitor. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name of the connection monitor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginStart( - String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context); - - /** - * Starts the specified connection monitor. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name of the connection monitor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono startAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName); - - /** - * Starts the specified connection monitor. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name of the connection monitor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void start(String resourceGroupName, String networkWatcherName, String connectionMonitorName); - - /** - * Starts the specified connection monitor. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name of the connection monitor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void start(String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context); - - /** - * Query a snapshot of the most recent connection states. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name given to the connection monitor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of connection states snapshots. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> queryWithResponseAsync( - String resourceGroupName, String networkWatcherName, String connectionMonitorName); - - /** - * Query a snapshot of the most recent connection states. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name given to the connection monitor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of connection states snapshots. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, ConnectionMonitorQueryResultInner> beginQueryAsync( - String resourceGroupName, String networkWatcherName, String connectionMonitorName); - - /** - * Query a snapshot of the most recent connection states. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name given to the connection monitor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of connection states snapshots. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ConnectionMonitorQueryResultInner> beginQuery( - String resourceGroupName, String networkWatcherName, String connectionMonitorName); - - /** - * Query a snapshot of the most recent connection states. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name given to the connection monitor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of connection states snapshots. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ConnectionMonitorQueryResultInner> beginQuery( - String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context); - - /** - * Query a snapshot of the most recent connection states. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name given to the connection monitor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of connection states snapshots. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono queryAsync( - String resourceGroupName, String networkWatcherName, String connectionMonitorName); - - /** - * Query a snapshot of the most recent connection states. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name given to the connection monitor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of connection states snapshots. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ConnectionMonitorQueryResultInner query( - String resourceGroupName, String networkWatcherName, String connectionMonitorName); - - /** - * Query a snapshot of the most recent connection states. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name given to the connection monitor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of connection states snapshots. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ConnectionMonitorQueryResultInner query( - String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context); - - /** - * Lists all connection monitors for the specified Network Watcher. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of connection monitors. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String resourceGroupName, String networkWatcherName); - - /** - * Lists all connection monitors for the specified Network Watcher. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of connection monitors. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String networkWatcherName); - - /** - * Lists all connection monitors for the specified Network Watcher. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of connection monitors. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String resourceGroupName, String networkWatcherName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/DdosCustomPoliciesClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/DdosCustomPoliciesClient.java deleted file mode 100644 index 964ddada2a20..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/DdosCustomPoliciesClient.java +++ /dev/null @@ -1,383 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.models.DdosCustomPolicyInner; -import com.azure.resourcemanager.network.models.TagsObject; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in DdosCustomPoliciesClient. */ -public interface DdosCustomPoliciesClient extends InnerSupportsGet, InnerSupportsDelete { - /** - * Deletes the specified DDoS custom policy. - * - * @param resourceGroupName The name of the resource group. - * @param ddosCustomPolicyName The name of the DDoS custom policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync(String resourceGroupName, String ddosCustomPolicyName); - - /** - * Deletes the specified DDoS custom policy. - * - * @param resourceGroupName The name of the resource group. - * @param ddosCustomPolicyName The name of the DDoS custom policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String ddosCustomPolicyName); - - /** - * Deletes the specified DDoS custom policy. - * - * @param resourceGroupName The name of the resource group. - * @param ddosCustomPolicyName The name of the DDoS custom policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String ddosCustomPolicyName); - - /** - * Deletes the specified DDoS custom policy. - * - * @param resourceGroupName The name of the resource group. - * @param ddosCustomPolicyName The name of the DDoS custom policy. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String ddosCustomPolicyName, Context context); - - /** - * Deletes the specified DDoS custom policy. - * - * @param resourceGroupName The name of the resource group. - * @param ddosCustomPolicyName The name of the DDoS custom policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String ddosCustomPolicyName); - - /** - * Deletes the specified DDoS custom policy. - * - * @param resourceGroupName The name of the resource group. - * @param ddosCustomPolicyName The name of the DDoS custom policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String ddosCustomPolicyName); - - /** - * Deletes the specified DDoS custom policy. - * - * @param resourceGroupName The name of the resource group. - * @param ddosCustomPolicyName The name of the DDoS custom policy. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String ddosCustomPolicyName, Context context); - - /** - * Gets information about the specified DDoS custom policy. - * - * @param resourceGroupName The name of the resource group. - * @param ddosCustomPolicyName The name of the DDoS custom policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified DDoS custom policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String ddosCustomPolicyName); - - /** - * Gets information about the specified DDoS custom policy. - * - * @param resourceGroupName The name of the resource group. - * @param ddosCustomPolicyName The name of the DDoS custom policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified DDoS custom policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync(String resourceGroupName, String ddosCustomPolicyName); - - /** - * Gets information about the specified DDoS custom policy. - * - * @param resourceGroupName The name of the resource group. - * @param ddosCustomPolicyName The name of the DDoS custom policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified DDoS custom policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DdosCustomPolicyInner getByResourceGroup(String resourceGroupName, String ddosCustomPolicyName); - - /** - * Gets information about the specified DDoS custom policy. - * - * @param resourceGroupName The name of the resource group. - * @param ddosCustomPolicyName The name of the DDoS custom policy. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified DDoS custom policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String ddosCustomPolicyName, Context context); - - /** - * Creates or updates a DDoS custom policy. - * - * @param resourceGroupName The name of the resource group. - * @param ddosCustomPolicyName The name of the DDoS custom policy. - * @param parameters Parameters supplied to the create or update operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DDoS custom policy in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String ddosCustomPolicyName, DdosCustomPolicyInner parameters); - - /** - * Creates or updates a DDoS custom policy. - * - * @param resourceGroupName The name of the resource group. - * @param ddosCustomPolicyName The name of the DDoS custom policy. - * @param parameters Parameters supplied to the create or update operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DDoS custom policy in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, DdosCustomPolicyInner> beginCreateOrUpdateAsync( - String resourceGroupName, String ddosCustomPolicyName, DdosCustomPolicyInner parameters); - - /** - * Creates or updates a DDoS custom policy. - * - * @param resourceGroupName The name of the resource group. - * @param ddosCustomPolicyName The name of the DDoS custom policy. - * @param parameters Parameters supplied to the create or update operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DDoS custom policy in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, DdosCustomPolicyInner> beginCreateOrUpdate( - String resourceGroupName, String ddosCustomPolicyName, DdosCustomPolicyInner parameters); - - /** - * Creates or updates a DDoS custom policy. - * - * @param resourceGroupName The name of the resource group. - * @param ddosCustomPolicyName The name of the DDoS custom policy. - * @param parameters Parameters supplied to the create or update operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DDoS custom policy in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, DdosCustomPolicyInner> beginCreateOrUpdate( - String resourceGroupName, String ddosCustomPolicyName, DdosCustomPolicyInner parameters, Context context); - - /** - * Creates or updates a DDoS custom policy. - * - * @param resourceGroupName The name of the resource group. - * @param ddosCustomPolicyName The name of the DDoS custom policy. - * @param parameters Parameters supplied to the create or update operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DDoS custom policy in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, String ddosCustomPolicyName, DdosCustomPolicyInner parameters); - - /** - * Creates or updates a DDoS custom policy. - * - * @param resourceGroupName The name of the resource group. - * @param ddosCustomPolicyName The name of the DDoS custom policy. - * @param parameters Parameters supplied to the create or update operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DDoS custom policy in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DdosCustomPolicyInner createOrUpdate( - String resourceGroupName, String ddosCustomPolicyName, DdosCustomPolicyInner parameters); - - /** - * Creates or updates a DDoS custom policy. - * - * @param resourceGroupName The name of the resource group. - * @param ddosCustomPolicyName The name of the DDoS custom policy. - * @param parameters Parameters supplied to the create or update operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DDoS custom policy in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DdosCustomPolicyInner createOrUpdate( - String resourceGroupName, String ddosCustomPolicyName, DdosCustomPolicyInner parameters, Context context); - - /** - * Update a DDoS custom policy tags. - * - * @param resourceGroupName The name of the resource group. - * @param ddosCustomPolicyName The name of the DDoS custom policy. - * @param parameters Parameters supplied to the update DDoS custom policy resource tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DDoS custom policy in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> updateTagsWithResponseAsync( - String resourceGroupName, String ddosCustomPolicyName, TagsObject parameters); - - /** - * Update a DDoS custom policy tags. - * - * @param resourceGroupName The name of the resource group. - * @param ddosCustomPolicyName The name of the DDoS custom policy. - * @param parameters Parameters supplied to the update DDoS custom policy resource tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DDoS custom policy in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, DdosCustomPolicyInner> beginUpdateTagsAsync( - String resourceGroupName, String ddosCustomPolicyName, TagsObject parameters); - - /** - * Update a DDoS custom policy tags. - * - * @param resourceGroupName The name of the resource group. - * @param ddosCustomPolicyName The name of the DDoS custom policy. - * @param parameters Parameters supplied to the update DDoS custom policy resource tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DDoS custom policy in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, DdosCustomPolicyInner> beginUpdateTags( - String resourceGroupName, String ddosCustomPolicyName, TagsObject parameters); - - /** - * Update a DDoS custom policy tags. - * - * @param resourceGroupName The name of the resource group. - * @param ddosCustomPolicyName The name of the DDoS custom policy. - * @param parameters Parameters supplied to the update DDoS custom policy resource tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DDoS custom policy in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, DdosCustomPolicyInner> beginUpdateTags( - String resourceGroupName, String ddosCustomPolicyName, TagsObject parameters, Context context); - - /** - * Update a DDoS custom policy tags. - * - * @param resourceGroupName The name of the resource group. - * @param ddosCustomPolicyName The name of the DDoS custom policy. - * @param parameters Parameters supplied to the update DDoS custom policy resource tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DDoS custom policy in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateTagsAsync( - String resourceGroupName, String ddosCustomPolicyName, TagsObject parameters); - - /** - * Update a DDoS custom policy tags. - * - * @param resourceGroupName The name of the resource group. - * @param ddosCustomPolicyName The name of the DDoS custom policy. - * @param parameters Parameters supplied to the update DDoS custom policy resource tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DDoS custom policy in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DdosCustomPolicyInner updateTags(String resourceGroupName, String ddosCustomPolicyName, TagsObject parameters); - - /** - * Update a DDoS custom policy tags. - * - * @param resourceGroupName The name of the resource group. - * @param ddosCustomPolicyName The name of the DDoS custom policy. - * @param parameters Parameters supplied to the update DDoS custom policy resource tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DDoS custom policy in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DdosCustomPolicyInner updateTags( - String resourceGroupName, String ddosCustomPolicyName, TagsObject parameters, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/DdosProtectionPlansClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/DdosProtectionPlansClient.java deleted file mode 100644 index 8662e6f8499b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/DdosProtectionPlansClient.java +++ /dev/null @@ -1,458 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.models.DdosProtectionPlanInner; -import com.azure.resourcemanager.network.models.TagsObject; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in DdosProtectionPlansClient. */ -public interface DdosProtectionPlansClient - extends InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete { - /** - * Deletes the specified DDoS protection plan. - * - * @param resourceGroupName The name of the resource group. - * @param ddosProtectionPlanName The name of the DDoS protection plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync(String resourceGroupName, String ddosProtectionPlanName); - - /** - * Deletes the specified DDoS protection plan. - * - * @param resourceGroupName The name of the resource group. - * @param ddosProtectionPlanName The name of the DDoS protection plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String ddosProtectionPlanName); - - /** - * Deletes the specified DDoS protection plan. - * - * @param resourceGroupName The name of the resource group. - * @param ddosProtectionPlanName The name of the DDoS protection plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String ddosProtectionPlanName); - - /** - * Deletes the specified DDoS protection plan. - * - * @param resourceGroupName The name of the resource group. - * @param ddosProtectionPlanName The name of the DDoS protection plan. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String ddosProtectionPlanName, Context context); - - /** - * Deletes the specified DDoS protection plan. - * - * @param resourceGroupName The name of the resource group. - * @param ddosProtectionPlanName The name of the DDoS protection plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String ddosProtectionPlanName); - - /** - * Deletes the specified DDoS protection plan. - * - * @param resourceGroupName The name of the resource group. - * @param ddosProtectionPlanName The name of the DDoS protection plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String ddosProtectionPlanName); - - /** - * Deletes the specified DDoS protection plan. - * - * @param resourceGroupName The name of the resource group. - * @param ddosProtectionPlanName The name of the DDoS protection plan. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String ddosProtectionPlanName, Context context); - - /** - * Gets information about the specified DDoS protection plan. - * - * @param resourceGroupName The name of the resource group. - * @param ddosProtectionPlanName The name of the DDoS protection plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified DDoS protection plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String ddosProtectionPlanName); - - /** - * Gets information about the specified DDoS protection plan. - * - * @param resourceGroupName The name of the resource group. - * @param ddosProtectionPlanName The name of the DDoS protection plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified DDoS protection plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync(String resourceGroupName, String ddosProtectionPlanName); - - /** - * Gets information about the specified DDoS protection plan. - * - * @param resourceGroupName The name of the resource group. - * @param ddosProtectionPlanName The name of the DDoS protection plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified DDoS protection plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DdosProtectionPlanInner getByResourceGroup(String resourceGroupName, String ddosProtectionPlanName); - - /** - * Gets information about the specified DDoS protection plan. - * - * @param resourceGroupName The name of the resource group. - * @param ddosProtectionPlanName The name of the DDoS protection plan. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified DDoS protection plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String ddosProtectionPlanName, Context context); - - /** - * Creates or updates a DDoS protection plan. - * - * @param resourceGroupName The name of the resource group. - * @param ddosProtectionPlanName The name of the DDoS protection plan. - * @param parameters Parameters supplied to the create or update operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DDoS protection plan in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String ddosProtectionPlanName, DdosProtectionPlanInner parameters); - - /** - * Creates or updates a DDoS protection plan. - * - * @param resourceGroupName The name of the resource group. - * @param ddosProtectionPlanName The name of the DDoS protection plan. - * @param parameters Parameters supplied to the create or update operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DDoS protection plan in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, DdosProtectionPlanInner> beginCreateOrUpdateAsync( - String resourceGroupName, String ddosProtectionPlanName, DdosProtectionPlanInner parameters); - - /** - * Creates or updates a DDoS protection plan. - * - * @param resourceGroupName The name of the resource group. - * @param ddosProtectionPlanName The name of the DDoS protection plan. - * @param parameters Parameters supplied to the create or update operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DDoS protection plan in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, DdosProtectionPlanInner> beginCreateOrUpdate( - String resourceGroupName, String ddosProtectionPlanName, DdosProtectionPlanInner parameters); - - /** - * Creates or updates a DDoS protection plan. - * - * @param resourceGroupName The name of the resource group. - * @param ddosProtectionPlanName The name of the DDoS protection plan. - * @param parameters Parameters supplied to the create or update operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DDoS protection plan in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, DdosProtectionPlanInner> beginCreateOrUpdate( - String resourceGroupName, String ddosProtectionPlanName, DdosProtectionPlanInner parameters, Context context); - - /** - * Creates or updates a DDoS protection plan. - * - * @param resourceGroupName The name of the resource group. - * @param ddosProtectionPlanName The name of the DDoS protection plan. - * @param parameters Parameters supplied to the create or update operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DDoS protection plan in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, String ddosProtectionPlanName, DdosProtectionPlanInner parameters); - - /** - * Creates or updates a DDoS protection plan. - * - * @param resourceGroupName The name of the resource group. - * @param ddosProtectionPlanName The name of the DDoS protection plan. - * @param parameters Parameters supplied to the create or update operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DDoS protection plan in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DdosProtectionPlanInner createOrUpdate( - String resourceGroupName, String ddosProtectionPlanName, DdosProtectionPlanInner parameters); - - /** - * Creates or updates a DDoS protection plan. - * - * @param resourceGroupName The name of the resource group. - * @param ddosProtectionPlanName The name of the DDoS protection plan. - * @param parameters Parameters supplied to the create or update operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DDoS protection plan in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DdosProtectionPlanInner createOrUpdate( - String resourceGroupName, String ddosProtectionPlanName, DdosProtectionPlanInner parameters, Context context); - - /** - * Update a DDoS protection plan tags. - * - * @param resourceGroupName The name of the resource group. - * @param ddosProtectionPlanName The name of the DDoS protection plan. - * @param parameters Parameters supplied to the update DDoS protection plan resource tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DDoS protection plan in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> updateTagsWithResponseAsync( - String resourceGroupName, String ddosProtectionPlanName, TagsObject parameters); - - /** - * Update a DDoS protection plan tags. - * - * @param resourceGroupName The name of the resource group. - * @param ddosProtectionPlanName The name of the DDoS protection plan. - * @param parameters Parameters supplied to the update DDoS protection plan resource tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DDoS protection plan in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, DdosProtectionPlanInner> beginUpdateTagsAsync( - String resourceGroupName, String ddosProtectionPlanName, TagsObject parameters); - - /** - * Update a DDoS protection plan tags. - * - * @param resourceGroupName The name of the resource group. - * @param ddosProtectionPlanName The name of the DDoS protection plan. - * @param parameters Parameters supplied to the update DDoS protection plan resource tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DDoS protection plan in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, DdosProtectionPlanInner> beginUpdateTags( - String resourceGroupName, String ddosProtectionPlanName, TagsObject parameters); - - /** - * Update a DDoS protection plan tags. - * - * @param resourceGroupName The name of the resource group. - * @param ddosProtectionPlanName The name of the DDoS protection plan. - * @param parameters Parameters supplied to the update DDoS protection plan resource tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DDoS protection plan in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, DdosProtectionPlanInner> beginUpdateTags( - String resourceGroupName, String ddosProtectionPlanName, TagsObject parameters, Context context); - - /** - * Update a DDoS protection plan tags. - * - * @param resourceGroupName The name of the resource group. - * @param ddosProtectionPlanName The name of the DDoS protection plan. - * @param parameters Parameters supplied to the update DDoS protection plan resource tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DDoS protection plan in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateTagsAsync( - String resourceGroupName, String ddosProtectionPlanName, TagsObject parameters); - - /** - * Update a DDoS protection plan tags. - * - * @param resourceGroupName The name of the resource group. - * @param ddosProtectionPlanName The name of the DDoS protection plan. - * @param parameters Parameters supplied to the update DDoS protection plan resource tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DDoS protection plan in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DdosProtectionPlanInner updateTags(String resourceGroupName, String ddosProtectionPlanName, TagsObject parameters); - - /** - * Update a DDoS protection plan tags. - * - * @param resourceGroupName The name of the resource group. - * @param ddosProtectionPlanName The name of the DDoS protection plan. - * @param parameters Parameters supplied to the update DDoS protection plan resource tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DDoS protection plan in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DdosProtectionPlanInner updateTags( - String resourceGroupName, String ddosProtectionPlanName, TagsObject parameters, Context context); - - /** - * Gets all DDoS protection plans in a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all DDoS protection plans in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Gets all DDoS protection plans in a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all DDoS protection plans in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Gets all DDoS protection plans in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all DDoS protection plans in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Gets all the DDoS protection plans in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the DDoS protection plans in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName); - - /** - * Gets all the DDoS protection plans in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the DDoS protection plans in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Gets all the DDoS protection plans in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the DDoS protection plans in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/DefaultSecurityRulesClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/DefaultSecurityRulesClient.java deleted file mode 100644 index 8d83da5d0d9a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/DefaultSecurityRulesClient.java +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.network.fluent.models.SecurityRuleInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in DefaultSecurityRulesClient. */ -public interface DefaultSecurityRulesClient { - /** - * Gets all default security rules in a network security group. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all default security rules in a network security group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String resourceGroupName, String networkSecurityGroupName); - - /** - * Gets all default security rules in a network security group. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all default security rules in a network security group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String networkSecurityGroupName); - - /** - * Gets all default security rules in a network security group. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all default security rules in a network security group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String networkSecurityGroupName, Context context); - - /** - * Get the specified default network security rule. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param defaultSecurityRuleName The name of the default security rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified default network security rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync( - String resourceGroupName, String networkSecurityGroupName, String defaultSecurityRuleName); - - /** - * Get the specified default network security rule. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param defaultSecurityRuleName The name of the default security rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified default network security rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync( - String resourceGroupName, String networkSecurityGroupName, String defaultSecurityRuleName); - - /** - * Get the specified default network security rule. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param defaultSecurityRuleName The name of the default security rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified default network security rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SecurityRuleInner get(String resourceGroupName, String networkSecurityGroupName, String defaultSecurityRuleName); - - /** - * Get the specified default network security rule. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param defaultSecurityRuleName The name of the default security rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified default network security rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String networkSecurityGroupName, String defaultSecurityRuleName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/ExpressRouteCircuitAuthorizationsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/ExpressRouteCircuitAuthorizationsClient.java deleted file mode 100644 index 238722c4dd93..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/ExpressRouteCircuitAuthorizationsClient.java +++ /dev/null @@ -1,374 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.models.ExpressRouteCircuitAuthorizationInner; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in ExpressRouteCircuitAuthorizationsClient. - */ -public interface ExpressRouteCircuitAuthorizationsClient { - /** - * Deletes the specified authorization from the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param authorizationName The name of the authorization. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync( - String resourceGroupName, String circuitName, String authorizationName); - - /** - * Deletes the specified authorization from the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param authorizationName The name of the authorization. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String circuitName, String authorizationName); - - /** - * Deletes the specified authorization from the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param authorizationName The name of the authorization. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String circuitName, String authorizationName); - - /** - * Deletes the specified authorization from the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param authorizationName The name of the authorization. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String circuitName, String authorizationName, Context context); - - /** - * Deletes the specified authorization from the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param authorizationName The name of the authorization. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String circuitName, String authorizationName); - - /** - * Deletes the specified authorization from the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param authorizationName The name of the authorization. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String circuitName, String authorizationName); - - /** - * Deletes the specified authorization from the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param authorizationName The name of the authorization. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String circuitName, String authorizationName, Context context); - - /** - * Gets the specified authorization from the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param authorizationName The name of the authorization. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified authorization from the specified express route circuit. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync( - String resourceGroupName, String circuitName, String authorizationName); - - /** - * Gets the specified authorization from the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param authorizationName The name of the authorization. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified authorization from the specified express route circuit. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync( - String resourceGroupName, String circuitName, String authorizationName); - - /** - * Gets the specified authorization from the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param authorizationName The name of the authorization. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified authorization from the specified express route circuit. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ExpressRouteCircuitAuthorizationInner get(String resourceGroupName, String circuitName, String authorizationName); - - /** - * Gets the specified authorization from the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param authorizationName The name of the authorization. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified authorization from the specified express route circuit. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String circuitName, String authorizationName, Context context); - - /** - * Creates or updates an authorization in the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param authorizationName The name of the authorization. - * @param authorizationParameters Parameters supplied to the create or update express route circuit authorization - * operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return authorization in an ExpressRouteCircuit resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String circuitName, - String authorizationName, - ExpressRouteCircuitAuthorizationInner authorizationParameters); - - /** - * Creates or updates an authorization in the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param authorizationName The name of the authorization. - * @param authorizationParameters Parameters supplied to the create or update express route circuit authorization - * operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return authorization in an ExpressRouteCircuit resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, ExpressRouteCircuitAuthorizationInner> - beginCreateOrUpdateAsync( - String resourceGroupName, - String circuitName, - String authorizationName, - ExpressRouteCircuitAuthorizationInner authorizationParameters); - - /** - * Creates or updates an authorization in the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param authorizationName The name of the authorization. - * @param authorizationParameters Parameters supplied to the create or update express route circuit authorization - * operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return authorization in an ExpressRouteCircuit resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ExpressRouteCircuitAuthorizationInner> - beginCreateOrUpdate( - String resourceGroupName, - String circuitName, - String authorizationName, - ExpressRouteCircuitAuthorizationInner authorizationParameters); - - /** - * Creates or updates an authorization in the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param authorizationName The name of the authorization. - * @param authorizationParameters Parameters supplied to the create or update express route circuit authorization - * operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return authorization in an ExpressRouteCircuit resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ExpressRouteCircuitAuthorizationInner> - beginCreateOrUpdate( - String resourceGroupName, - String circuitName, - String authorizationName, - ExpressRouteCircuitAuthorizationInner authorizationParameters, - Context context); - - /** - * Creates or updates an authorization in the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param authorizationName The name of the authorization. - * @param authorizationParameters Parameters supplied to the create or update express route circuit authorization - * operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return authorization in an ExpressRouteCircuit resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, - String circuitName, - String authorizationName, - ExpressRouteCircuitAuthorizationInner authorizationParameters); - - /** - * Creates or updates an authorization in the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param authorizationName The name of the authorization. - * @param authorizationParameters Parameters supplied to the create or update express route circuit authorization - * operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return authorization in an ExpressRouteCircuit resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ExpressRouteCircuitAuthorizationInner createOrUpdate( - String resourceGroupName, - String circuitName, - String authorizationName, - ExpressRouteCircuitAuthorizationInner authorizationParameters); - - /** - * Creates or updates an authorization in the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param authorizationName The name of the authorization. - * @param authorizationParameters Parameters supplied to the create or update express route circuit authorization - * operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return authorization in an ExpressRouteCircuit resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ExpressRouteCircuitAuthorizationInner createOrUpdate( - String resourceGroupName, - String circuitName, - String authorizationName, - ExpressRouteCircuitAuthorizationInner authorizationParameters, - Context context); - - /** - * Gets all authorizations in an express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the circuit. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all authorizations in an express route circuit. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String resourceGroupName, String circuitName); - - /** - * Gets all authorizations in an express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the circuit. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all authorizations in an express route circuit. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String circuitName); - - /** - * Gets all authorizations in an express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the circuit. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all authorizations in an express route circuit. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String resourceGroupName, String circuitName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/ExpressRouteCircuitConnectionsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/ExpressRouteCircuitConnectionsClient.java deleted file mode 100644 index 487eb698ed0d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/ExpressRouteCircuitConnectionsClient.java +++ /dev/null @@ -1,402 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.models.ExpressRouteCircuitConnectionInner; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ExpressRouteCircuitConnectionsClient. */ -public interface ExpressRouteCircuitConnectionsClient { - /** - * Deletes the specified Express Route Circuit Connection from the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param connectionName The name of the express route circuit connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync( - String resourceGroupName, String circuitName, String peeringName, String connectionName); - - /** - * Deletes the specified Express Route Circuit Connection from the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param connectionName The name of the express route circuit connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String circuitName, String peeringName, String connectionName); - - /** - * Deletes the specified Express Route Circuit Connection from the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param connectionName The name of the express route circuit connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String circuitName, String peeringName, String connectionName); - - /** - * Deletes the specified Express Route Circuit Connection from the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param connectionName The name of the express route circuit connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String circuitName, String peeringName, String connectionName, Context context); - - /** - * Deletes the specified Express Route Circuit Connection from the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param connectionName The name of the express route circuit connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName); - - /** - * Deletes the specified Express Route Circuit Connection from the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param connectionName The name of the express route circuit connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String circuitName, String peeringName, String connectionName); - - /** - * Deletes the specified Express Route Circuit Connection from the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param connectionName The name of the express route circuit connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete( - String resourceGroupName, String circuitName, String peeringName, String connectionName, Context context); - - /** - * Gets the specified Express Route Circuit Connection from the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param connectionName The name of the express route circuit connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Express Route Circuit Connection from the specified express route circuit. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync( - String resourceGroupName, String circuitName, String peeringName, String connectionName); - - /** - * Gets the specified Express Route Circuit Connection from the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param connectionName The name of the express route circuit connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Express Route Circuit Connection from the specified express route circuit. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync( - String resourceGroupName, String circuitName, String peeringName, String connectionName); - - /** - * Gets the specified Express Route Circuit Connection from the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param connectionName The name of the express route circuit connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Express Route Circuit Connection from the specified express route circuit. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ExpressRouteCircuitConnectionInner get( - String resourceGroupName, String circuitName, String peeringName, String connectionName); - - /** - * Gets the specified Express Route Circuit Connection from the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param connectionName The name of the express route circuit connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Express Route Circuit Connection from the specified express route circuit. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String circuitName, String peeringName, String connectionName, Context context); - - /** - * Creates or updates a Express Route Circuit Connection in the specified express route circuits. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param connectionName The name of the express route circuit connection. - * @param expressRouteCircuitConnectionParameters Parameters supplied to the create or update express route circuit - * connection operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return express Route Circuit Connection in an ExpressRouteCircuitPeering resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String circuitName, - String peeringName, - String connectionName, - ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters); - - /** - * Creates or updates a Express Route Circuit Connection in the specified express route circuits. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param connectionName The name of the express route circuit connection. - * @param expressRouteCircuitConnectionParameters Parameters supplied to the create or update express route circuit - * connection operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return express Route Circuit Connection in an ExpressRouteCircuitPeering resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, ExpressRouteCircuitConnectionInner> - beginCreateOrUpdateAsync( - String resourceGroupName, - String circuitName, - String peeringName, - String connectionName, - ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters); - - /** - * Creates or updates a Express Route Circuit Connection in the specified express route circuits. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param connectionName The name of the express route circuit connection. - * @param expressRouteCircuitConnectionParameters Parameters supplied to the create or update express route circuit - * connection operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return express Route Circuit Connection in an ExpressRouteCircuitPeering resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ExpressRouteCircuitConnectionInner> beginCreateOrUpdate( - String resourceGroupName, - String circuitName, - String peeringName, - String connectionName, - ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters); - - /** - * Creates or updates a Express Route Circuit Connection in the specified express route circuits. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param connectionName The name of the express route circuit connection. - * @param expressRouteCircuitConnectionParameters Parameters supplied to the create or update express route circuit - * connection operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return express Route Circuit Connection in an ExpressRouteCircuitPeering resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ExpressRouteCircuitConnectionInner> beginCreateOrUpdate( - String resourceGroupName, - String circuitName, - String peeringName, - String connectionName, - ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters, - Context context); - - /** - * Creates or updates a Express Route Circuit Connection in the specified express route circuits. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param connectionName The name of the express route circuit connection. - * @param expressRouteCircuitConnectionParameters Parameters supplied to the create or update express route circuit - * connection operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return express Route Circuit Connection in an ExpressRouteCircuitPeering resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, - String circuitName, - String peeringName, - String connectionName, - ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters); - - /** - * Creates or updates a Express Route Circuit Connection in the specified express route circuits. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param connectionName The name of the express route circuit connection. - * @param expressRouteCircuitConnectionParameters Parameters supplied to the create or update express route circuit - * connection operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return express Route Circuit Connection in an ExpressRouteCircuitPeering resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ExpressRouteCircuitConnectionInner createOrUpdate( - String resourceGroupName, - String circuitName, - String peeringName, - String connectionName, - ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters); - - /** - * Creates or updates a Express Route Circuit Connection in the specified express route circuits. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param connectionName The name of the express route circuit connection. - * @param expressRouteCircuitConnectionParameters Parameters supplied to the create or update express route circuit - * connection operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return express Route Circuit Connection in an ExpressRouteCircuitPeering resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ExpressRouteCircuitConnectionInner createOrUpdate( - String resourceGroupName, - String circuitName, - String peeringName, - String connectionName, - ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters, - Context context); - - /** - * Gets all global reach connections associated with a private peering in an express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the circuit. - * @param peeringName The name of the peering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all global reach connections associated with a private peering in an express route circuit. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync( - String resourceGroupName, String circuitName, String peeringName); - - /** - * Gets all global reach connections associated with a private peering in an express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the circuit. - * @param peeringName The name of the peering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all global reach connections associated with a private peering in an express route circuit. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String resourceGroupName, String circuitName, String peeringName); - - /** - * Gets all global reach connections associated with a private peering in an express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the circuit. - * @param peeringName The name of the peering. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all global reach connections associated with a private peering in an express route circuit. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String resourceGroupName, String circuitName, String peeringName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/ExpressRouteCircuitPeeringsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/ExpressRouteCircuitPeeringsClient.java deleted file mode 100644 index c3181b77de6c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/ExpressRouteCircuitPeeringsClient.java +++ /dev/null @@ -1,359 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.models.ExpressRouteCircuitPeeringInner; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ExpressRouteCircuitPeeringsClient. */ -public interface ExpressRouteCircuitPeeringsClient { - /** - * Deletes the specified peering from the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync( - String resourceGroupName, String circuitName, String peeringName); - - /** - * Deletes the specified peering from the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String circuitName, String peeringName); - - /** - * Deletes the specified peering from the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String circuitName, String peeringName); - - /** - * Deletes the specified peering from the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String circuitName, String peeringName, Context context); - - /** - * Deletes the specified peering from the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String circuitName, String peeringName); - - /** - * Deletes the specified peering from the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String circuitName, String peeringName); - - /** - * Deletes the specified peering from the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String circuitName, String peeringName, Context context); - - /** - * Gets the specified peering for the express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified peering for the express route circuit. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync( - String resourceGroupName, String circuitName, String peeringName); - - /** - * Gets the specified peering for the express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified peering for the express route circuit. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync(String resourceGroupName, String circuitName, String peeringName); - - /** - * Gets the specified peering for the express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified peering for the express route circuit. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ExpressRouteCircuitPeeringInner get(String resourceGroupName, String circuitName, String peeringName); - - /** - * Gets the specified peering for the express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified peering for the express route circuit. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String circuitName, String peeringName, Context context); - - /** - * Creates or updates a peering in the specified express route circuits. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param peeringParameters Parameters supplied to the create or update express route circuit peering operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return peering in an ExpressRouteCircuit resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String circuitName, - String peeringName, - ExpressRouteCircuitPeeringInner peeringParameters); - - /** - * Creates or updates a peering in the specified express route circuits. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param peeringParameters Parameters supplied to the create or update express route circuit peering operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return peering in an ExpressRouteCircuit resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, ExpressRouteCircuitPeeringInner> beginCreateOrUpdateAsync( - String resourceGroupName, - String circuitName, - String peeringName, - ExpressRouteCircuitPeeringInner peeringParameters); - - /** - * Creates or updates a peering in the specified express route circuits. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param peeringParameters Parameters supplied to the create or update express route circuit peering operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return peering in an ExpressRouteCircuit resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ExpressRouteCircuitPeeringInner> beginCreateOrUpdate( - String resourceGroupName, - String circuitName, - String peeringName, - ExpressRouteCircuitPeeringInner peeringParameters); - - /** - * Creates or updates a peering in the specified express route circuits. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param peeringParameters Parameters supplied to the create or update express route circuit peering operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return peering in an ExpressRouteCircuit resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ExpressRouteCircuitPeeringInner> beginCreateOrUpdate( - String resourceGroupName, - String circuitName, - String peeringName, - ExpressRouteCircuitPeeringInner peeringParameters, - Context context); - - /** - * Creates or updates a peering in the specified express route circuits. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param peeringParameters Parameters supplied to the create or update express route circuit peering operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return peering in an ExpressRouteCircuit resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, - String circuitName, - String peeringName, - ExpressRouteCircuitPeeringInner peeringParameters); - - /** - * Creates or updates a peering in the specified express route circuits. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param peeringParameters Parameters supplied to the create or update express route circuit peering operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return peering in an ExpressRouteCircuit resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ExpressRouteCircuitPeeringInner createOrUpdate( - String resourceGroupName, - String circuitName, - String peeringName, - ExpressRouteCircuitPeeringInner peeringParameters); - - /** - * Creates or updates a peering in the specified express route circuits. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param peeringParameters Parameters supplied to the create or update express route circuit peering operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return peering in an ExpressRouteCircuit resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ExpressRouteCircuitPeeringInner createOrUpdate( - String resourceGroupName, - String circuitName, - String peeringName, - ExpressRouteCircuitPeeringInner peeringParameters, - Context context); - - /** - * Gets all peerings in a specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all peerings in a specified express route circuit. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String resourceGroupName, String circuitName); - - /** - * Gets all peerings in a specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all peerings in a specified express route circuit. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String circuitName); - - /** - * Gets all peerings in a specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all peerings in a specified express route circuit. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String circuitName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/ExpressRouteCircuitsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/ExpressRouteCircuitsClient.java deleted file mode 100644 index 538ca1e14c1d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/ExpressRouteCircuitsClient.java +++ /dev/null @@ -1,938 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.models.ExpressRouteCircuitInner; -import com.azure.resourcemanager.network.fluent.models.ExpressRouteCircuitStatsInner; -import com.azure.resourcemanager.network.fluent.models.ExpressRouteCircuitsArpTableListResultInner; -import com.azure.resourcemanager.network.fluent.models.ExpressRouteCircuitsRoutesTableListResultInner; -import com.azure.resourcemanager.network.fluent.models.ExpressRouteCircuitsRoutesTableSummaryListResultInner; -import com.azure.resourcemanager.network.models.TagsObject; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ExpressRouteCircuitsClient. */ -public interface ExpressRouteCircuitsClient - extends InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete { - /** - * Deletes the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync(String resourceGroupName, String circuitName); - - /** - * Deletes the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String circuitName); - - /** - * Deletes the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String circuitName); - - /** - * Deletes the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String circuitName, Context context); - - /** - * Deletes the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String circuitName); - - /** - * Deletes the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String circuitName); - - /** - * Deletes the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String circuitName, Context context); - - /** - * Gets information about the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of express route circuit. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified express route circuit. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String circuitName); - - /** - * Gets information about the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of express route circuit. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified express route circuit. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync(String resourceGroupName, String circuitName); - - /** - * Gets information about the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of express route circuit. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified express route circuit. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ExpressRouteCircuitInner getByResourceGroup(String resourceGroupName, String circuitName); - - /** - * Gets information about the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of express route circuit. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified express route circuit. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String circuitName, Context context); - - /** - * Creates or updates an express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the circuit. - * @param parameters Parameters supplied to the create or update express route circuit operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteCircuit resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters); - - /** - * Creates or updates an express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the circuit. - * @param parameters Parameters supplied to the create or update express route circuit operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteCircuit resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, ExpressRouteCircuitInner> beginCreateOrUpdateAsync( - String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters); - - /** - * Creates or updates an express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the circuit. - * @param parameters Parameters supplied to the create or update express route circuit operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteCircuit resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ExpressRouteCircuitInner> beginCreateOrUpdate( - String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters); - - /** - * Creates or updates an express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the circuit. - * @param parameters Parameters supplied to the create or update express route circuit operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteCircuit resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ExpressRouteCircuitInner> beginCreateOrUpdate( - String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters, Context context); - - /** - * Creates or updates an express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the circuit. - * @param parameters Parameters supplied to the create or update express route circuit operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteCircuit resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters); - - /** - * Creates or updates an express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the circuit. - * @param parameters Parameters supplied to the create or update express route circuit operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteCircuit resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ExpressRouteCircuitInner createOrUpdate( - String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters); - - /** - * Creates or updates an express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the circuit. - * @param parameters Parameters supplied to the create or update express route circuit operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteCircuit resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ExpressRouteCircuitInner createOrUpdate( - String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters, Context context); - - /** - * Updates an express route circuit tags. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the circuit. - * @param parameters Parameters supplied to update express route circuit tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteCircuit resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> updateTagsWithResponseAsync( - String resourceGroupName, String circuitName, TagsObject parameters); - - /** - * Updates an express route circuit tags. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the circuit. - * @param parameters Parameters supplied to update express route circuit tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteCircuit resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, ExpressRouteCircuitInner> beginUpdateTagsAsync( - String resourceGroupName, String circuitName, TagsObject parameters); - - /** - * Updates an express route circuit tags. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the circuit. - * @param parameters Parameters supplied to update express route circuit tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteCircuit resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ExpressRouteCircuitInner> beginUpdateTags( - String resourceGroupName, String circuitName, TagsObject parameters); - - /** - * Updates an express route circuit tags. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the circuit. - * @param parameters Parameters supplied to update express route circuit tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteCircuit resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ExpressRouteCircuitInner> beginUpdateTags( - String resourceGroupName, String circuitName, TagsObject parameters, Context context); - - /** - * Updates an express route circuit tags. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the circuit. - * @param parameters Parameters supplied to update express route circuit tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteCircuit resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateTagsAsync(String resourceGroupName, String circuitName, TagsObject parameters); - - /** - * Updates an express route circuit tags. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the circuit. - * @param parameters Parameters supplied to update express route circuit tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteCircuit resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ExpressRouteCircuitInner updateTags(String resourceGroupName, String circuitName, TagsObject parameters); - - /** - * Updates an express route circuit tags. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the circuit. - * @param parameters Parameters supplied to update express route circuit tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteCircuit resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ExpressRouteCircuitInner updateTags( - String resourceGroupName, String circuitName, TagsObject parameters, Context context); - - /** - * Gets the currently advertised ARP table associated with the express route circuit in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised ARP table associated with the express route circuit in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> listArpTableWithResponseAsync( - String resourceGroupName, String circuitName, String peeringName, String devicePath); - - /** - * Gets the currently advertised ARP table associated with the express route circuit in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised ARP table associated with the express route circuit in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, ExpressRouteCircuitsArpTableListResultInner> - beginListArpTableAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath); - - /** - * Gets the currently advertised ARP table associated with the express route circuit in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised ARP table associated with the express route circuit in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ExpressRouteCircuitsArpTableListResultInner> - beginListArpTable(String resourceGroupName, String circuitName, String peeringName, String devicePath); - - /** - * Gets the currently advertised ARP table associated with the express route circuit in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised ARP table associated with the express route circuit in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ExpressRouteCircuitsArpTableListResultInner> - beginListArpTable( - String resourceGroupName, String circuitName, String peeringName, String devicePath, Context context); - - /** - * Gets the currently advertised ARP table associated with the express route circuit in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised ARP table associated with the express route circuit in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listArpTableAsync( - String resourceGroupName, String circuitName, String peeringName, String devicePath); - - /** - * Gets the currently advertised ARP table associated with the express route circuit in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised ARP table associated with the express route circuit in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ExpressRouteCircuitsArpTableListResultInner listArpTable( - String resourceGroupName, String circuitName, String peeringName, String devicePath); - - /** - * Gets the currently advertised ARP table associated with the express route circuit in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised ARP table associated with the express route circuit in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ExpressRouteCircuitsArpTableListResultInner listArpTable( - String resourceGroupName, String circuitName, String peeringName, String devicePath, Context context); - - /** - * Gets the currently advertised routes table associated with the express route circuit in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised routes table associated with the express route circuit in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> listRoutesTableWithResponseAsync( - String resourceGroupName, String circuitName, String peeringName, String devicePath); - - /** - * Gets the currently advertised routes table associated with the express route circuit in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised routes table associated with the express route circuit in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux< - PollResult, ExpressRouteCircuitsRoutesTableListResultInner> - beginListRoutesTableAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath); - - /** - * Gets the currently advertised routes table associated with the express route circuit in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised routes table associated with the express route circuit in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller< - PollResult, ExpressRouteCircuitsRoutesTableListResultInner> - beginListRoutesTable(String resourceGroupName, String circuitName, String peeringName, String devicePath); - - /** - * Gets the currently advertised routes table associated with the express route circuit in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised routes table associated with the express route circuit in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller< - PollResult, ExpressRouteCircuitsRoutesTableListResultInner> - beginListRoutesTable( - String resourceGroupName, String circuitName, String peeringName, String devicePath, Context context); - - /** - * Gets the currently advertised routes table associated with the express route circuit in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised routes table associated with the express route circuit in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listRoutesTableAsync( - String resourceGroupName, String circuitName, String peeringName, String devicePath); - - /** - * Gets the currently advertised routes table associated with the express route circuit in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised routes table associated with the express route circuit in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ExpressRouteCircuitsRoutesTableListResultInner listRoutesTable( - String resourceGroupName, String circuitName, String peeringName, String devicePath); - - /** - * Gets the currently advertised routes table associated with the express route circuit in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised routes table associated with the express route circuit in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ExpressRouteCircuitsRoutesTableListResultInner listRoutesTable( - String resourceGroupName, String circuitName, String peeringName, String devicePath, Context context); - - /** - * Gets the currently advertised routes table summary associated with the express route circuit in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised routes table summary associated with the express route circuit in a resource - * group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> listRoutesTableSummaryWithResponseAsync( - String resourceGroupName, String circuitName, String peeringName, String devicePath); - - /** - * Gets the currently advertised routes table summary associated with the express route circuit in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised routes table summary associated with the express route circuit in a resource - * group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux< - PollResult, - ExpressRouteCircuitsRoutesTableSummaryListResultInner> - beginListRoutesTableSummaryAsync( - String resourceGroupName, String circuitName, String peeringName, String devicePath); - - /** - * Gets the currently advertised routes table summary associated with the express route circuit in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised routes table summary associated with the express route circuit in a resource - * group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller< - PollResult, - ExpressRouteCircuitsRoutesTableSummaryListResultInner> - beginListRoutesTableSummary( - String resourceGroupName, String circuitName, String peeringName, String devicePath); - - /** - * Gets the currently advertised routes table summary associated with the express route circuit in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised routes table summary associated with the express route circuit in a resource - * group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller< - PollResult, - ExpressRouteCircuitsRoutesTableSummaryListResultInner> - beginListRoutesTableSummary( - String resourceGroupName, String circuitName, String peeringName, String devicePath, Context context); - - /** - * Gets the currently advertised routes table summary associated with the express route circuit in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised routes table summary associated with the express route circuit in a resource - * group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listRoutesTableSummaryAsync( - String resourceGroupName, String circuitName, String peeringName, String devicePath); - - /** - * Gets the currently advertised routes table summary associated with the express route circuit in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised routes table summary associated with the express route circuit in a resource - * group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ExpressRouteCircuitsRoutesTableSummaryListResultInner listRoutesTableSummary( - String resourceGroupName, String circuitName, String peeringName, String devicePath); - - /** - * Gets the currently advertised routes table summary associated with the express route circuit in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised routes table summary associated with the express route circuit in a resource - * group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ExpressRouteCircuitsRoutesTableSummaryListResultInner listRoutesTableSummary( - String resourceGroupName, String circuitName, String peeringName, String devicePath, Context context); - - /** - * Gets all the stats from an express route circuit in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the stats from an express route circuit in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getStatsWithResponseAsync( - String resourceGroupName, String circuitName); - - /** - * Gets all the stats from an express route circuit in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the stats from an express route circuit in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getStatsAsync(String resourceGroupName, String circuitName); - - /** - * Gets all the stats from an express route circuit in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the stats from an express route circuit in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ExpressRouteCircuitStatsInner getStats(String resourceGroupName, String circuitName); - - /** - * Gets all the stats from an express route circuit in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the stats from an express route circuit in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getStatsWithResponse( - String resourceGroupName, String circuitName, Context context); - - /** - * Gets all stats from an express route circuit in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all stats from an express route circuit in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getPeeringStatsWithResponseAsync( - String resourceGroupName, String circuitName, String peeringName); - - /** - * Gets all stats from an express route circuit in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all stats from an express route circuit in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getPeeringStatsAsync( - String resourceGroupName, String circuitName, String peeringName); - - /** - * Gets all stats from an express route circuit in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all stats from an express route circuit in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ExpressRouteCircuitStatsInner getPeeringStats(String resourceGroupName, String circuitName, String peeringName); - - /** - * Gets all stats from an express route circuit in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all stats from an express route circuit in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getPeeringStatsWithResponse( - String resourceGroupName, String circuitName, String peeringName, Context context); - - /** - * Gets all the express route circuits in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the express route circuits in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName); - - /** - * Gets all the express route circuits in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the express route circuits in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Gets all the express route circuits in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the express route circuits in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * Gets all the express route circuits in a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the express route circuits in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Gets all the express route circuits in a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the express route circuits in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Gets all the express route circuits in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the express route circuits in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/ExpressRouteConnectionsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/ExpressRouteConnectionsClient.java deleted file mode 100644 index 5ddd87884069..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/ExpressRouteConnectionsClient.java +++ /dev/null @@ -1,375 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.models.ExpressRouteConnectionInner; -import com.azure.resourcemanager.network.fluent.models.ExpressRouteConnectionListInner; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ExpressRouteConnectionsClient. */ -public interface ExpressRouteConnectionsClient { - /** - * Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @param connectionName The name of the connection subresource. - * @param putExpressRouteConnectionParameters Parameters required in an ExpressRouteConnection PUT operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteConnection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String expressRouteGatewayName, - String connectionName, - ExpressRouteConnectionInner putExpressRouteConnectionParameters); - - /** - * Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @param connectionName The name of the connection subresource. - * @param putExpressRouteConnectionParameters Parameters required in an ExpressRouteConnection PUT operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteConnection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, ExpressRouteConnectionInner> beginCreateOrUpdateAsync( - String resourceGroupName, - String expressRouteGatewayName, - String connectionName, - ExpressRouteConnectionInner putExpressRouteConnectionParameters); - - /** - * Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @param connectionName The name of the connection subresource. - * @param putExpressRouteConnectionParameters Parameters required in an ExpressRouteConnection PUT operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteConnection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ExpressRouteConnectionInner> beginCreateOrUpdate( - String resourceGroupName, - String expressRouteGatewayName, - String connectionName, - ExpressRouteConnectionInner putExpressRouteConnectionParameters); - - /** - * Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @param connectionName The name of the connection subresource. - * @param putExpressRouteConnectionParameters Parameters required in an ExpressRouteConnection PUT operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteConnection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ExpressRouteConnectionInner> beginCreateOrUpdate( - String resourceGroupName, - String expressRouteGatewayName, - String connectionName, - ExpressRouteConnectionInner putExpressRouteConnectionParameters, - Context context); - - /** - * Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @param connectionName The name of the connection subresource. - * @param putExpressRouteConnectionParameters Parameters required in an ExpressRouteConnection PUT operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteConnection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, - String expressRouteGatewayName, - String connectionName, - ExpressRouteConnectionInner putExpressRouteConnectionParameters); - - /** - * Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @param connectionName The name of the connection subresource. - * @param putExpressRouteConnectionParameters Parameters required in an ExpressRouteConnection PUT operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteConnection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ExpressRouteConnectionInner createOrUpdate( - String resourceGroupName, - String expressRouteGatewayName, - String connectionName, - ExpressRouteConnectionInner putExpressRouteConnectionParameters); - - /** - * Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @param connectionName The name of the connection subresource. - * @param putExpressRouteConnectionParameters Parameters required in an ExpressRouteConnection PUT operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteConnection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ExpressRouteConnectionInner createOrUpdate( - String resourceGroupName, - String expressRouteGatewayName, - String connectionName, - ExpressRouteConnectionInner putExpressRouteConnectionParameters, - Context context); - - /** - * Gets the specified ExpressRouteConnection. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @param connectionName The name of the ExpressRoute connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified ExpressRouteConnection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync( - String resourceGroupName, String expressRouteGatewayName, String connectionName); - - /** - * Gets the specified ExpressRouteConnection. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @param connectionName The name of the ExpressRoute connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified ExpressRouteConnection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync( - String resourceGroupName, String expressRouteGatewayName, String connectionName); - - /** - * Gets the specified ExpressRouteConnection. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @param connectionName The name of the ExpressRoute connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified ExpressRouteConnection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ExpressRouteConnectionInner get(String resourceGroupName, String expressRouteGatewayName, String connectionName); - - /** - * Gets the specified ExpressRouteConnection. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @param connectionName The name of the ExpressRoute connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified ExpressRouteConnection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String expressRouteGatewayName, String connectionName, Context context); - - /** - * Deletes a connection to a ExpressRoute circuit. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @param connectionName The name of the connection subresource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync( - String resourceGroupName, String expressRouteGatewayName, String connectionName); - - /** - * Deletes a connection to a ExpressRoute circuit. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @param connectionName The name of the connection subresource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String expressRouteGatewayName, String connectionName); - - /** - * Deletes a connection to a ExpressRoute circuit. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @param connectionName The name of the connection subresource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String expressRouteGatewayName, String connectionName); - - /** - * Deletes a connection to a ExpressRoute circuit. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @param connectionName The name of the connection subresource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String expressRouteGatewayName, String connectionName, Context context); - - /** - * Deletes a connection to a ExpressRoute circuit. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @param connectionName The name of the connection subresource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String expressRouteGatewayName, String connectionName); - - /** - * Deletes a connection to a ExpressRoute circuit. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @param connectionName The name of the connection subresource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String expressRouteGatewayName, String connectionName); - - /** - * Deletes a connection to a ExpressRoute circuit. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @param connectionName The name of the connection subresource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String expressRouteGatewayName, String connectionName, Context context); - - /** - * Lists ExpressRouteConnections. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteConnection list. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listWithResponseAsync( - String resourceGroupName, String expressRouteGatewayName); - - /** - * Lists ExpressRouteConnections. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteConnection list. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listAsync(String resourceGroupName, String expressRouteGatewayName); - - /** - * Lists ExpressRouteConnections. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteConnection list. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ExpressRouteConnectionListInner list(String resourceGroupName, String expressRouteGatewayName); - - /** - * Lists ExpressRouteConnections. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteConnection list. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listWithResponse( - String resourceGroupName, String expressRouteGatewayName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/ExpressRouteCrossConnectionPeeringsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/ExpressRouteCrossConnectionPeeringsClient.java deleted file mode 100644 index d46402bc4bbf..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/ExpressRouteCrossConnectionPeeringsClient.java +++ /dev/null @@ -1,375 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.models.ExpressRouteCrossConnectionPeeringInner; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in ExpressRouteCrossConnectionPeeringsClient. - */ -public interface ExpressRouteCrossConnectionPeeringsClient { - /** - * Gets all peerings in a specified ExpressRouteCrossConnection. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all peerings in a specified ExpressRouteCrossConnection. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String resourceGroupName, String crossConnectionName); - - /** - * Gets all peerings in a specified ExpressRouteCrossConnection. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all peerings in a specified ExpressRouteCrossConnection. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String crossConnectionName); - - /** - * Gets all peerings in a specified ExpressRouteCrossConnection. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all peerings in a specified ExpressRouteCrossConnection. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String resourceGroupName, String crossConnectionName, Context context); - - /** - * Deletes the specified peering from the ExpressRouteCrossConnection. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync( - String resourceGroupName, String crossConnectionName, String peeringName); - - /** - * Deletes the specified peering from the ExpressRouteCrossConnection. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String crossConnectionName, String peeringName); - - /** - * Deletes the specified peering from the ExpressRouteCrossConnection. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String crossConnectionName, String peeringName); - - /** - * Deletes the specified peering from the ExpressRouteCrossConnection. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String crossConnectionName, String peeringName, Context context); - - /** - * Deletes the specified peering from the ExpressRouteCrossConnection. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String crossConnectionName, String peeringName); - - /** - * Deletes the specified peering from the ExpressRouteCrossConnection. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String crossConnectionName, String peeringName); - - /** - * Deletes the specified peering from the ExpressRouteCrossConnection. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String crossConnectionName, String peeringName, Context context); - - /** - * Gets the specified peering for the ExpressRouteCrossConnection. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified peering for the ExpressRouteCrossConnection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync( - String resourceGroupName, String crossConnectionName, String peeringName); - - /** - * Gets the specified peering for the ExpressRouteCrossConnection. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified peering for the ExpressRouteCrossConnection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync( - String resourceGroupName, String crossConnectionName, String peeringName); - - /** - * Gets the specified peering for the ExpressRouteCrossConnection. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified peering for the ExpressRouteCrossConnection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ExpressRouteCrossConnectionPeeringInner get( - String resourceGroupName, String crossConnectionName, String peeringName); - - /** - * Gets the specified peering for the ExpressRouteCrossConnection. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified peering for the ExpressRouteCrossConnection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String crossConnectionName, String peeringName, Context context); - - /** - * Creates or updates a peering in the specified ExpressRouteCrossConnection. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @param peeringParameters Parameters supplied to the create or update ExpressRouteCrossConnection peering - * operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return peering in an ExpressRoute Cross Connection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String crossConnectionName, - String peeringName, - ExpressRouteCrossConnectionPeeringInner peeringParameters); - - /** - * Creates or updates a peering in the specified ExpressRouteCrossConnection. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @param peeringParameters Parameters supplied to the create or update ExpressRouteCrossConnection peering - * operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return peering in an ExpressRoute Cross Connection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, ExpressRouteCrossConnectionPeeringInner> - beginCreateOrUpdateAsync( - String resourceGroupName, - String crossConnectionName, - String peeringName, - ExpressRouteCrossConnectionPeeringInner peeringParameters); - - /** - * Creates or updates a peering in the specified ExpressRouteCrossConnection. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @param peeringParameters Parameters supplied to the create or update ExpressRouteCrossConnection peering - * operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return peering in an ExpressRoute Cross Connection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ExpressRouteCrossConnectionPeeringInner> - beginCreateOrUpdate( - String resourceGroupName, - String crossConnectionName, - String peeringName, - ExpressRouteCrossConnectionPeeringInner peeringParameters); - - /** - * Creates or updates a peering in the specified ExpressRouteCrossConnection. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @param peeringParameters Parameters supplied to the create or update ExpressRouteCrossConnection peering - * operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return peering in an ExpressRoute Cross Connection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ExpressRouteCrossConnectionPeeringInner> - beginCreateOrUpdate( - String resourceGroupName, - String crossConnectionName, - String peeringName, - ExpressRouteCrossConnectionPeeringInner peeringParameters, - Context context); - - /** - * Creates or updates a peering in the specified ExpressRouteCrossConnection. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @param peeringParameters Parameters supplied to the create or update ExpressRouteCrossConnection peering - * operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return peering in an ExpressRoute Cross Connection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, - String crossConnectionName, - String peeringName, - ExpressRouteCrossConnectionPeeringInner peeringParameters); - - /** - * Creates or updates a peering in the specified ExpressRouteCrossConnection. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @param peeringParameters Parameters supplied to the create or update ExpressRouteCrossConnection peering - * operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return peering in an ExpressRoute Cross Connection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ExpressRouteCrossConnectionPeeringInner createOrUpdate( - String resourceGroupName, - String crossConnectionName, - String peeringName, - ExpressRouteCrossConnectionPeeringInner peeringParameters); - - /** - * Creates or updates a peering in the specified ExpressRouteCrossConnection. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @param peeringParameters Parameters supplied to the create or update ExpressRouteCrossConnection peering - * operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return peering in an ExpressRoute Cross Connection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ExpressRouteCrossConnectionPeeringInner createOrUpdate( - String resourceGroupName, - String crossConnectionName, - String peeringName, - ExpressRouteCrossConnectionPeeringInner peeringParameters, - Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/ExpressRouteCrossConnectionsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/ExpressRouteCrossConnectionsClient.java deleted file mode 100644 index b1e05ca41c28..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/ExpressRouteCrossConnectionsClient.java +++ /dev/null @@ -1,766 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.models.ExpressRouteCircuitsArpTableListResultInner; -import com.azure.resourcemanager.network.fluent.models.ExpressRouteCircuitsRoutesTableListResultInner; -import com.azure.resourcemanager.network.fluent.models.ExpressRouteCrossConnectionInner; -import com.azure.resourcemanager.network.fluent.models.ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner; -import com.azure.resourcemanager.network.models.TagsObject; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ExpressRouteCrossConnectionsClient. */ -public interface ExpressRouteCrossConnectionsClient - extends InnerSupportsGet, InnerSupportsListing { - /** - * Retrieves all the ExpressRouteCrossConnections in a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListExpressRouteCrossConnection API service call. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Retrieves all the ExpressRouteCrossConnections in a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListExpressRouteCrossConnection API service call. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Retrieves all the ExpressRouteCrossConnections in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListExpressRouteCrossConnection API service call. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Retrieves all the ExpressRouteCrossConnections in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListExpressRouteCrossConnection API service call. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName); - - /** - * Retrieves all the ExpressRouteCrossConnections in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListExpressRouteCrossConnection API service call. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Retrieves all the ExpressRouteCrossConnections in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListExpressRouteCrossConnection API service call. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * Gets details about the specified ExpressRouteCrossConnection. - * - * @param resourceGroupName The name of the resource group (peering location of the circuit). - * @param crossConnectionName The name of the ExpressRouteCrossConnection (service key of the circuit). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return details about the specified ExpressRouteCrossConnection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String crossConnectionName); - - /** - * Gets details about the specified ExpressRouteCrossConnection. - * - * @param resourceGroupName The name of the resource group (peering location of the circuit). - * @param crossConnectionName The name of the ExpressRouteCrossConnection (service key of the circuit). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return details about the specified ExpressRouteCrossConnection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync( - String resourceGroupName, String crossConnectionName); - - /** - * Gets details about the specified ExpressRouteCrossConnection. - * - * @param resourceGroupName The name of the resource group (peering location of the circuit). - * @param crossConnectionName The name of the ExpressRouteCrossConnection (service key of the circuit). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return details about the specified ExpressRouteCrossConnection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ExpressRouteCrossConnectionInner getByResourceGroup(String resourceGroupName, String crossConnectionName); - - /** - * Gets details about the specified ExpressRouteCrossConnection. - * - * @param resourceGroupName The name of the resource group (peering location of the circuit). - * @param crossConnectionName The name of the ExpressRouteCrossConnection (service key of the circuit). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return details about the specified ExpressRouteCrossConnection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String crossConnectionName, Context context); - - /** - * Update the specified ExpressRouteCrossConnection. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param parameters Parameters supplied to the update express route crossConnection operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteCrossConnection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String crossConnectionName, ExpressRouteCrossConnectionInner parameters); - - /** - * Update the specified ExpressRouteCrossConnection. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param parameters Parameters supplied to the update express route crossConnection operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteCrossConnection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, ExpressRouteCrossConnectionInner> beginCreateOrUpdateAsync( - String resourceGroupName, String crossConnectionName, ExpressRouteCrossConnectionInner parameters); - - /** - * Update the specified ExpressRouteCrossConnection. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param parameters Parameters supplied to the update express route crossConnection operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteCrossConnection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ExpressRouteCrossConnectionInner> beginCreateOrUpdate( - String resourceGroupName, String crossConnectionName, ExpressRouteCrossConnectionInner parameters); - - /** - * Update the specified ExpressRouteCrossConnection. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param parameters Parameters supplied to the update express route crossConnection operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteCrossConnection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ExpressRouteCrossConnectionInner> beginCreateOrUpdate( - String resourceGroupName, - String crossConnectionName, - ExpressRouteCrossConnectionInner parameters, - Context context); - - /** - * Update the specified ExpressRouteCrossConnection. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param parameters Parameters supplied to the update express route crossConnection operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteCrossConnection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, String crossConnectionName, ExpressRouteCrossConnectionInner parameters); - - /** - * Update the specified ExpressRouteCrossConnection. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param parameters Parameters supplied to the update express route crossConnection operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteCrossConnection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ExpressRouteCrossConnectionInner createOrUpdate( - String resourceGroupName, String crossConnectionName, ExpressRouteCrossConnectionInner parameters); - - /** - * Update the specified ExpressRouteCrossConnection. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param parameters Parameters supplied to the update express route crossConnection operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteCrossConnection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ExpressRouteCrossConnectionInner createOrUpdate( - String resourceGroupName, - String crossConnectionName, - ExpressRouteCrossConnectionInner parameters, - Context context); - - /** - * Updates an express route cross connection tags. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the cross connection. - * @param crossConnectionParameters Parameters supplied to update express route cross connection tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteCrossConnection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> updateTagsWithResponseAsync( - String resourceGroupName, String crossConnectionName, TagsObject crossConnectionParameters); - - /** - * Updates an express route cross connection tags. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the cross connection. - * @param crossConnectionParameters Parameters supplied to update express route cross connection tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteCrossConnection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, ExpressRouteCrossConnectionInner> beginUpdateTagsAsync( - String resourceGroupName, String crossConnectionName, TagsObject crossConnectionParameters); - - /** - * Updates an express route cross connection tags. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the cross connection. - * @param crossConnectionParameters Parameters supplied to update express route cross connection tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteCrossConnection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ExpressRouteCrossConnectionInner> beginUpdateTags( - String resourceGroupName, String crossConnectionName, TagsObject crossConnectionParameters); - - /** - * Updates an express route cross connection tags. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the cross connection. - * @param crossConnectionParameters Parameters supplied to update express route cross connection tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteCrossConnection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ExpressRouteCrossConnectionInner> beginUpdateTags( - String resourceGroupName, String crossConnectionName, TagsObject crossConnectionParameters, Context context); - - /** - * Updates an express route cross connection tags. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the cross connection. - * @param crossConnectionParameters Parameters supplied to update express route cross connection tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteCrossConnection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateTagsAsync( - String resourceGroupName, String crossConnectionName, TagsObject crossConnectionParameters); - - /** - * Updates an express route cross connection tags. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the cross connection. - * @param crossConnectionParameters Parameters supplied to update express route cross connection tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteCrossConnection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ExpressRouteCrossConnectionInner updateTags( - String resourceGroupName, String crossConnectionName, TagsObject crossConnectionParameters); - - /** - * Updates an express route cross connection tags. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the cross connection. - * @param crossConnectionParameters Parameters supplied to update express route cross connection tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteCrossConnection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ExpressRouteCrossConnectionInner updateTags( - String resourceGroupName, String crossConnectionName, TagsObject crossConnectionParameters, Context context); - - /** - * Gets the currently advertised ARP table associated with the express route cross connection in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised ARP table associated with the express route cross connection in a resource - * group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> listArpTableWithResponseAsync( - String resourceGroupName, String crossConnectionName, String peeringName, String devicePath); - - /** - * Gets the currently advertised ARP table associated with the express route cross connection in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised ARP table associated with the express route cross connection in a resource - * group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, ExpressRouteCircuitsArpTableListResultInner> - beginListArpTableAsync( - String resourceGroupName, String crossConnectionName, String peeringName, String devicePath); - - /** - * Gets the currently advertised ARP table associated with the express route cross connection in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised ARP table associated with the express route cross connection in a resource - * group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ExpressRouteCircuitsArpTableListResultInner> - beginListArpTable(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath); - - /** - * Gets the currently advertised ARP table associated with the express route cross connection in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised ARP table associated with the express route cross connection in a resource - * group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ExpressRouteCircuitsArpTableListResultInner> - beginListArpTable( - String resourceGroupName, - String crossConnectionName, - String peeringName, - String devicePath, - Context context); - - /** - * Gets the currently advertised ARP table associated with the express route cross connection in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised ARP table associated with the express route cross connection in a resource - * group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listArpTableAsync( - String resourceGroupName, String crossConnectionName, String peeringName, String devicePath); - - /** - * Gets the currently advertised ARP table associated with the express route cross connection in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised ARP table associated with the express route cross connection in a resource - * group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ExpressRouteCircuitsArpTableListResultInner listArpTable( - String resourceGroupName, String crossConnectionName, String peeringName, String devicePath); - - /** - * Gets the currently advertised ARP table associated with the express route cross connection in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised ARP table associated with the express route cross connection in a resource - * group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ExpressRouteCircuitsArpTableListResultInner listArpTable( - String resourceGroupName, String crossConnectionName, String peeringName, String devicePath, Context context); - - /** - * Gets the route table summary associated with the express route cross connection in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the route table summary associated with the express route cross connection in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> listRoutesTableSummaryWithResponseAsync( - String resourceGroupName, String crossConnectionName, String peeringName, String devicePath); - - /** - * Gets the route table summary associated with the express route cross connection in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the route table summary associated with the express route cross connection in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux< - PollResult, - ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner> - beginListRoutesTableSummaryAsync( - String resourceGroupName, String crossConnectionName, String peeringName, String devicePath); - - /** - * Gets the route table summary associated with the express route cross connection in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the route table summary associated with the express route cross connection in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller< - PollResult, - ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner> - beginListRoutesTableSummary( - String resourceGroupName, String crossConnectionName, String peeringName, String devicePath); - - /** - * Gets the route table summary associated with the express route cross connection in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the route table summary associated with the express route cross connection in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller< - PollResult, - ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner> - beginListRoutesTableSummary( - String resourceGroupName, - String crossConnectionName, - String peeringName, - String devicePath, - Context context); - - /** - * Gets the route table summary associated with the express route cross connection in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the route table summary associated with the express route cross connection in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listRoutesTableSummaryAsync( - String resourceGroupName, String crossConnectionName, String peeringName, String devicePath); - - /** - * Gets the route table summary associated with the express route cross connection in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the route table summary associated with the express route cross connection in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner listRoutesTableSummary( - String resourceGroupName, String crossConnectionName, String peeringName, String devicePath); - - /** - * Gets the route table summary associated with the express route cross connection in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the route table summary associated with the express route cross connection in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner listRoutesTableSummary( - String resourceGroupName, String crossConnectionName, String peeringName, String devicePath, Context context); - - /** - * Gets the currently advertised routes table associated with the express route cross connection in a resource - * group. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised routes table associated with the express route cross connection in a resource - * group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> listRoutesTableWithResponseAsync( - String resourceGroupName, String crossConnectionName, String peeringName, String devicePath); - - /** - * Gets the currently advertised routes table associated with the express route cross connection in a resource - * group. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised routes table associated with the express route cross connection in a resource - * group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux< - PollResult, ExpressRouteCircuitsRoutesTableListResultInner> - beginListRoutesTableAsync( - String resourceGroupName, String crossConnectionName, String peeringName, String devicePath); - - /** - * Gets the currently advertised routes table associated with the express route cross connection in a resource - * group. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised routes table associated with the express route cross connection in a resource - * group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller< - PollResult, ExpressRouteCircuitsRoutesTableListResultInner> - beginListRoutesTable( - String resourceGroupName, String crossConnectionName, String peeringName, String devicePath); - - /** - * Gets the currently advertised routes table associated with the express route cross connection in a resource - * group. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised routes table associated with the express route cross connection in a resource - * group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller< - PollResult, ExpressRouteCircuitsRoutesTableListResultInner> - beginListRoutesTable( - String resourceGroupName, - String crossConnectionName, - String peeringName, - String devicePath, - Context context); - - /** - * Gets the currently advertised routes table associated with the express route cross connection in a resource - * group. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised routes table associated with the express route cross connection in a resource - * group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listRoutesTableAsync( - String resourceGroupName, String crossConnectionName, String peeringName, String devicePath); - - /** - * Gets the currently advertised routes table associated with the express route cross connection in a resource - * group. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised routes table associated with the express route cross connection in a resource - * group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ExpressRouteCircuitsRoutesTableListResultInner listRoutesTable( - String resourceGroupName, String crossConnectionName, String peeringName, String devicePath); - - /** - * Gets the currently advertised routes table associated with the express route cross connection in a resource - * group. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised routes table associated with the express route cross connection in a resource - * group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ExpressRouteCircuitsRoutesTableListResultInner listRoutesTable( - String resourceGroupName, String crossConnectionName, String peeringName, String devicePath, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/ExpressRouteGatewaysClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/ExpressRouteGatewaysClient.java deleted file mode 100644 index adf2ca8bf5bc..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/ExpressRouteGatewaysClient.java +++ /dev/null @@ -1,392 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.models.ExpressRouteGatewayInner; -import com.azure.resourcemanager.network.fluent.models.ExpressRouteGatewayListInner; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ExpressRouteGatewaysClient. */ -public interface ExpressRouteGatewaysClient - extends InnerSupportsGet, InnerSupportsDelete { - /** - * Lists ExpressRoute gateways under a given subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ExpressRoute gateways. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listBySubscriptionWithResponseAsync(); - - /** - * Lists ExpressRoute gateways under a given subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ExpressRoute gateways. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listBySubscriptionAsync(); - - /** - * Lists ExpressRoute gateways under a given subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ExpressRoute gateways. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ExpressRouteGatewayListInner listBySubscription(); - - /** - * Lists ExpressRoute gateways under a given subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ExpressRoute gateways. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listBySubscriptionWithResponse(Context context); - - /** - * Lists ExpressRoute gateways in a given resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ExpressRoute gateways. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listByResourceGroupWithResponseAsync(String resourceGroupName); - - /** - * Lists ExpressRoute gateways in a given resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ExpressRoute gateways. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listByResourceGroupAsync(String resourceGroupName); - - /** - * Lists ExpressRoute gateways in a given resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ExpressRoute gateways. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ExpressRouteGatewayListInner listByResourceGroup(String resourceGroupName); - - /** - * Lists ExpressRoute gateways in a given resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ExpressRoute gateways. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listByResourceGroupWithResponse(String resourceGroupName, Context context); - - /** - * Creates or updates a ExpressRoute gateway in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @param putExpressRouteGatewayParameters Parameters required in an ExpressRoute gateway PUT operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute gateway resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String expressRouteGatewayName, - ExpressRouteGatewayInner putExpressRouteGatewayParameters); - - /** - * Creates or updates a ExpressRoute gateway in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @param putExpressRouteGatewayParameters Parameters required in an ExpressRoute gateway PUT operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute gateway resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, ExpressRouteGatewayInner> beginCreateOrUpdateAsync( - String resourceGroupName, - String expressRouteGatewayName, - ExpressRouteGatewayInner putExpressRouteGatewayParameters); - - /** - * Creates or updates a ExpressRoute gateway in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @param putExpressRouteGatewayParameters Parameters required in an ExpressRoute gateway PUT operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute gateway resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ExpressRouteGatewayInner> beginCreateOrUpdate( - String resourceGroupName, - String expressRouteGatewayName, - ExpressRouteGatewayInner putExpressRouteGatewayParameters); - - /** - * Creates or updates a ExpressRoute gateway in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @param putExpressRouteGatewayParameters Parameters required in an ExpressRoute gateway PUT operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute gateway resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ExpressRouteGatewayInner> beginCreateOrUpdate( - String resourceGroupName, - String expressRouteGatewayName, - ExpressRouteGatewayInner putExpressRouteGatewayParameters, - Context context); - - /** - * Creates or updates a ExpressRoute gateway in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @param putExpressRouteGatewayParameters Parameters required in an ExpressRoute gateway PUT operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute gateway resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, - String expressRouteGatewayName, - ExpressRouteGatewayInner putExpressRouteGatewayParameters); - - /** - * Creates or updates a ExpressRoute gateway in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @param putExpressRouteGatewayParameters Parameters required in an ExpressRoute gateway PUT operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute gateway resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ExpressRouteGatewayInner createOrUpdate( - String resourceGroupName, - String expressRouteGatewayName, - ExpressRouteGatewayInner putExpressRouteGatewayParameters); - - /** - * Creates or updates a ExpressRoute gateway in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @param putExpressRouteGatewayParameters Parameters required in an ExpressRoute gateway PUT operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute gateway resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ExpressRouteGatewayInner createOrUpdate( - String resourceGroupName, - String expressRouteGatewayName, - ExpressRouteGatewayInner putExpressRouteGatewayParameters, - Context context); - - /** - * Fetches the details of a ExpressRoute gateway in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute gateway resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String expressRouteGatewayName); - - /** - * Fetches the details of a ExpressRoute gateway in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute gateway resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync(String resourceGroupName, String expressRouteGatewayName); - - /** - * Fetches the details of a ExpressRoute gateway in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute gateway resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ExpressRouteGatewayInner getByResourceGroup(String resourceGroupName, String expressRouteGatewayName); - - /** - * Fetches the details of a ExpressRoute gateway in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute gateway resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String expressRouteGatewayName, Context context); - - /** - * Deletes the specified ExpressRoute gateway in a resource group. An ExpressRoute gateway resource can only be - * deleted when there are no connection subresources. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync(String resourceGroupName, String expressRouteGatewayName); - - /** - * Deletes the specified ExpressRoute gateway in a resource group. An ExpressRoute gateway resource can only be - * deleted when there are no connection subresources. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String expressRouteGatewayName); - - /** - * Deletes the specified ExpressRoute gateway in a resource group. An ExpressRoute gateway resource can only be - * deleted when there are no connection subresources. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String expressRouteGatewayName); - - /** - * Deletes the specified ExpressRoute gateway in a resource group. An ExpressRoute gateway resource can only be - * deleted when there are no connection subresources. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String expressRouteGatewayName, Context context); - - /** - * Deletes the specified ExpressRoute gateway in a resource group. An ExpressRoute gateway resource can only be - * deleted when there are no connection subresources. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String expressRouteGatewayName); - - /** - * Deletes the specified ExpressRoute gateway in a resource group. An ExpressRoute gateway resource can only be - * deleted when there are no connection subresources. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String expressRouteGatewayName); - - /** - * Deletes the specified ExpressRoute gateway in a resource group. An ExpressRoute gateway resource can only be - * deleted when there are no connection subresources. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String expressRouteGatewayName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/ExpressRouteLinksClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/ExpressRouteLinksClient.java deleted file mode 100644 index 9546787e19c9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/ExpressRouteLinksClient.java +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.network.fluent.models.ExpressRouteLinkInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ExpressRouteLinksClient. */ -public interface ExpressRouteLinksClient { - /** - * Retrieves the specified ExpressRouteLink resource. - * - * @param resourceGroupName The name of the resource group. - * @param expressRoutePortName The name of the ExpressRoutePort resource. - * @param linkName The name of the ExpressRouteLink resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteLink. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync( - String resourceGroupName, String expressRoutePortName, String linkName); - - /** - * Retrieves the specified ExpressRouteLink resource. - * - * @param resourceGroupName The name of the resource group. - * @param expressRoutePortName The name of the ExpressRoutePort resource. - * @param linkName The name of the ExpressRouteLink resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteLink. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync(String resourceGroupName, String expressRoutePortName, String linkName); - - /** - * Retrieves the specified ExpressRouteLink resource. - * - * @param resourceGroupName The name of the resource group. - * @param expressRoutePortName The name of the ExpressRoutePort resource. - * @param linkName The name of the ExpressRouteLink resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteLink. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ExpressRouteLinkInner get(String resourceGroupName, String expressRoutePortName, String linkName); - - /** - * Retrieves the specified ExpressRouteLink resource. - * - * @param resourceGroupName The name of the resource group. - * @param expressRoutePortName The name of the ExpressRoutePort resource. - * @param linkName The name of the ExpressRouteLink resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteLink. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String expressRoutePortName, String linkName, Context context); - - /** - * Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. - * - * @param resourceGroupName The name of the resource group. - * @param expressRoutePortName The name of the ExpressRoutePort resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteLink List Result. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String resourceGroupName, String expressRoutePortName); - - /** - * Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. - * - * @param resourceGroupName The name of the resource group. - * @param expressRoutePortName The name of the ExpressRoutePort resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteLink List Result. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String expressRoutePortName); - - /** - * Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. - * - * @param resourceGroupName The name of the resource group. - * @param expressRoutePortName The name of the ExpressRoutePort resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteLink List Result. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String expressRoutePortName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/ExpressRoutePortsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/ExpressRoutePortsClient.java deleted file mode 100644 index 61323a4f91a0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/ExpressRoutePortsClient.java +++ /dev/null @@ -1,458 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.models.ExpressRoutePortInner; -import com.azure.resourcemanager.network.models.TagsObject; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ExpressRoutePortsClient. */ -public interface ExpressRoutePortsClient - extends InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete { - /** - * Deletes the specified ExpressRoutePort resource. - * - * @param resourceGroupName The name of the resource group. - * @param expressRoutePortName The name of the ExpressRoutePort resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync(String resourceGroupName, String expressRoutePortName); - - /** - * Deletes the specified ExpressRoutePort resource. - * - * @param resourceGroupName The name of the resource group. - * @param expressRoutePortName The name of the ExpressRoutePort resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String expressRoutePortName); - - /** - * Deletes the specified ExpressRoutePort resource. - * - * @param resourceGroupName The name of the resource group. - * @param expressRoutePortName The name of the ExpressRoutePort resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String expressRoutePortName); - - /** - * Deletes the specified ExpressRoutePort resource. - * - * @param resourceGroupName The name of the resource group. - * @param expressRoutePortName The name of the ExpressRoutePort resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String expressRoutePortName, Context context); - - /** - * Deletes the specified ExpressRoutePort resource. - * - * @param resourceGroupName The name of the resource group. - * @param expressRoutePortName The name of the ExpressRoutePort resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String expressRoutePortName); - - /** - * Deletes the specified ExpressRoutePort resource. - * - * @param resourceGroupName The name of the resource group. - * @param expressRoutePortName The name of the ExpressRoutePort resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String expressRoutePortName); - - /** - * Deletes the specified ExpressRoutePort resource. - * - * @param resourceGroupName The name of the resource group. - * @param expressRoutePortName The name of the ExpressRoutePort resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String expressRoutePortName, Context context); - - /** - * Retrieves the requested ExpressRoutePort resource. - * - * @param resourceGroupName The name of the resource group. - * @param expressRoutePortName The name of ExpressRoutePort. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute Port. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String expressRoutePortName); - - /** - * Retrieves the requested ExpressRoutePort resource. - * - * @param resourceGroupName The name of the resource group. - * @param expressRoutePortName The name of ExpressRoutePort. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute Port. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync(String resourceGroupName, String expressRoutePortName); - - /** - * Retrieves the requested ExpressRoutePort resource. - * - * @param resourceGroupName The name of the resource group. - * @param expressRoutePortName The name of ExpressRoutePort. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute Port. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ExpressRoutePortInner getByResourceGroup(String resourceGroupName, String expressRoutePortName); - - /** - * Retrieves the requested ExpressRoutePort resource. - * - * @param resourceGroupName The name of the resource group. - * @param expressRoutePortName The name of ExpressRoutePort. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute Port. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String expressRoutePortName, Context context); - - /** - * Creates or updates the specified ExpressRoutePort resource. - * - * @param resourceGroupName The name of the resource group. - * @param expressRoutePortName The name of the ExpressRoutePort resource. - * @param parameters Parameters supplied to the create ExpressRoutePort operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute Port. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String expressRoutePortName, ExpressRoutePortInner parameters); - - /** - * Creates or updates the specified ExpressRoutePort resource. - * - * @param resourceGroupName The name of the resource group. - * @param expressRoutePortName The name of the ExpressRoutePort resource. - * @param parameters Parameters supplied to the create ExpressRoutePort operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute Port. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, ExpressRoutePortInner> beginCreateOrUpdateAsync( - String resourceGroupName, String expressRoutePortName, ExpressRoutePortInner parameters); - - /** - * Creates or updates the specified ExpressRoutePort resource. - * - * @param resourceGroupName The name of the resource group. - * @param expressRoutePortName The name of the ExpressRoutePort resource. - * @param parameters Parameters supplied to the create ExpressRoutePort operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute Port. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ExpressRoutePortInner> beginCreateOrUpdate( - String resourceGroupName, String expressRoutePortName, ExpressRoutePortInner parameters); - - /** - * Creates or updates the specified ExpressRoutePort resource. - * - * @param resourceGroupName The name of the resource group. - * @param expressRoutePortName The name of the ExpressRoutePort resource. - * @param parameters Parameters supplied to the create ExpressRoutePort operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute Port. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ExpressRoutePortInner> beginCreateOrUpdate( - String resourceGroupName, String expressRoutePortName, ExpressRoutePortInner parameters, Context context); - - /** - * Creates or updates the specified ExpressRoutePort resource. - * - * @param resourceGroupName The name of the resource group. - * @param expressRoutePortName The name of the ExpressRoutePort resource. - * @param parameters Parameters supplied to the create ExpressRoutePort operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute Port. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, String expressRoutePortName, ExpressRoutePortInner parameters); - - /** - * Creates or updates the specified ExpressRoutePort resource. - * - * @param resourceGroupName The name of the resource group. - * @param expressRoutePortName The name of the ExpressRoutePort resource. - * @param parameters Parameters supplied to the create ExpressRoutePort operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute Port. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ExpressRoutePortInner createOrUpdate( - String resourceGroupName, String expressRoutePortName, ExpressRoutePortInner parameters); - - /** - * Creates or updates the specified ExpressRoutePort resource. - * - * @param resourceGroupName The name of the resource group. - * @param expressRoutePortName The name of the ExpressRoutePort resource. - * @param parameters Parameters supplied to the create ExpressRoutePort operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute Port. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ExpressRoutePortInner createOrUpdate( - String resourceGroupName, String expressRoutePortName, ExpressRoutePortInner parameters, Context context); - - /** - * Update ExpressRoutePort tags. - * - * @param resourceGroupName The name of the resource group. - * @param expressRoutePortName The name of the ExpressRoutePort resource. - * @param parameters Parameters supplied to update ExpressRoutePort resource tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute Port. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> updateTagsWithResponseAsync( - String resourceGroupName, String expressRoutePortName, TagsObject parameters); - - /** - * Update ExpressRoutePort tags. - * - * @param resourceGroupName The name of the resource group. - * @param expressRoutePortName The name of the ExpressRoutePort resource. - * @param parameters Parameters supplied to update ExpressRoutePort resource tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute Port. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, ExpressRoutePortInner> beginUpdateTagsAsync( - String resourceGroupName, String expressRoutePortName, TagsObject parameters); - - /** - * Update ExpressRoutePort tags. - * - * @param resourceGroupName The name of the resource group. - * @param expressRoutePortName The name of the ExpressRoutePort resource. - * @param parameters Parameters supplied to update ExpressRoutePort resource tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute Port. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ExpressRoutePortInner> beginUpdateTags( - String resourceGroupName, String expressRoutePortName, TagsObject parameters); - - /** - * Update ExpressRoutePort tags. - * - * @param resourceGroupName The name of the resource group. - * @param expressRoutePortName The name of the ExpressRoutePort resource. - * @param parameters Parameters supplied to update ExpressRoutePort resource tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute Port. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ExpressRoutePortInner> beginUpdateTags( - String resourceGroupName, String expressRoutePortName, TagsObject parameters, Context context); - - /** - * Update ExpressRoutePort tags. - * - * @param resourceGroupName The name of the resource group. - * @param expressRoutePortName The name of the ExpressRoutePort resource. - * @param parameters Parameters supplied to update ExpressRoutePort resource tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute Port. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateTagsAsync( - String resourceGroupName, String expressRoutePortName, TagsObject parameters); - - /** - * Update ExpressRoutePort tags. - * - * @param resourceGroupName The name of the resource group. - * @param expressRoutePortName The name of the ExpressRoutePort resource. - * @param parameters Parameters supplied to update ExpressRoutePort resource tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute Port. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ExpressRoutePortInner updateTags(String resourceGroupName, String expressRoutePortName, TagsObject parameters); - - /** - * Update ExpressRoutePort tags. - * - * @param resourceGroupName The name of the resource group. - * @param expressRoutePortName The name of the ExpressRoutePort resource. - * @param parameters Parameters supplied to update ExpressRoutePort resource tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute Port. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ExpressRoutePortInner updateTags( - String resourceGroupName, String expressRoutePortName, TagsObject parameters, Context context); - - /** - * List all the ExpressRoutePort resources in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute Port List Result. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName); - - /** - * List all the ExpressRoutePort resources in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute Port List Result. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * List all the ExpressRoutePort resources in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute Port List Result. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * List all the ExpressRoutePort resources in the specified subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute Port List Result. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * List all the ExpressRoutePort resources in the specified subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute Port List Result. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * List all the ExpressRoutePort resources in the specified subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute Port List Result. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/ExpressRoutePortsLocationsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/ExpressRoutePortsLocationsClient.java deleted file mode 100644 index 3f6ead083220..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/ExpressRoutePortsLocationsClient.java +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.network.fluent.models.ExpressRoutePortsLocationInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ExpressRoutePortsLocationsClient. */ -public interface ExpressRoutePortsLocationsClient { - /** - * Retrieves all ExpressRoutePort peering locations. Does not return available bandwidths for each location. - * Available bandwidths can only be obtained when retrieving a specific peering location. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoutePorts Location List Result. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Retrieves all ExpressRoutePort peering locations. Does not return available bandwidths for each location. - * Available bandwidths can only be obtained when retrieving a specific peering location. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoutePorts Location List Result. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Retrieves all ExpressRoutePort peering locations. Does not return available bandwidths for each location. - * Available bandwidths can only be obtained when retrieving a specific peering location. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoutePorts Location List Result. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Retrieves a single ExpressRoutePort peering location, including the list of available bandwidths available at - * said peering location. - * - * @param locationName Name of the requested ExpressRoutePort peering location. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoutePorts Peering Location. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync(String locationName); - - /** - * Retrieves a single ExpressRoutePort peering location, including the list of available bandwidths available at - * said peering location. - * - * @param locationName Name of the requested ExpressRoutePort peering location. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoutePorts Peering Location. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync(String locationName); - - /** - * Retrieves a single ExpressRoutePort peering location, including the list of available bandwidths available at - * said peering location. - * - * @param locationName Name of the requested ExpressRoutePort peering location. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoutePorts Peering Location. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ExpressRoutePortsLocationInner get(String locationName); - - /** - * Retrieves a single ExpressRoutePort peering location, including the list of available bandwidths available at - * said peering location. - * - * @param locationName Name of the requested ExpressRoutePort peering location. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoutePorts Peering Location. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String locationName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/ExpressRouteServiceProvidersClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/ExpressRouteServiceProvidersClient.java deleted file mode 100644 index c08451411e42..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/ExpressRouteServiceProvidersClient.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.network.fluent.models.ExpressRouteServiceProviderInner; - -/** An instance of this class provides access to all the operations defined in ExpressRouteServiceProvidersClient. */ -public interface ExpressRouteServiceProvidersClient { - /** - * Gets all the available express route service providers. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the available express route service providers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Gets all the available express route service providers. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the available express route service providers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Gets all the available express route service providers. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the available express route service providers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/HubVirtualNetworkConnectionsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/HubVirtualNetworkConnectionsClient.java deleted file mode 100644 index 8efc0a04117c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/HubVirtualNetworkConnectionsClient.java +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.network.fluent.models.HubVirtualNetworkConnectionInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in HubVirtualNetworkConnectionsClient. */ -public interface HubVirtualNetworkConnectionsClient { - /** - * Retrieves the details of a HubVirtualNetworkConnection. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param virtualHubName The name of the VirtualHub. - * @param connectionName The name of the vpn connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hubVirtualNetworkConnection Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync( - String resourceGroupName, String virtualHubName, String connectionName); - - /** - * Retrieves the details of a HubVirtualNetworkConnection. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param virtualHubName The name of the VirtualHub. - * @param connectionName The name of the vpn connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hubVirtualNetworkConnection Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync( - String resourceGroupName, String virtualHubName, String connectionName); - - /** - * Retrieves the details of a HubVirtualNetworkConnection. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param virtualHubName The name of the VirtualHub. - * @param connectionName The name of the vpn connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hubVirtualNetworkConnection Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - HubVirtualNetworkConnectionInner get(String resourceGroupName, String virtualHubName, String connectionName); - - /** - * Retrieves the details of a HubVirtualNetworkConnection. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param virtualHubName The name of the VirtualHub. - * @param connectionName The name of the vpn connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hubVirtualNetworkConnection Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String virtualHubName, String connectionName, Context context); - - /** - * Retrieves the details of all HubVirtualNetworkConnections. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param virtualHubName The name of the VirtualHub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of HubVirtualNetworkConnections and a URL nextLink to get the next set of results. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String resourceGroupName, String virtualHubName); - - /** - * Retrieves the details of all HubVirtualNetworkConnections. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param virtualHubName The name of the VirtualHub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of HubVirtualNetworkConnections and a URL nextLink to get the next set of results. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String virtualHubName); - - /** - * Retrieves the details of all HubVirtualNetworkConnections. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param virtualHubName The name of the VirtualHub. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of HubVirtualNetworkConnections and a URL nextLink to get the next set of results. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String resourceGroupName, String virtualHubName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/InboundNatRulesClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/InboundNatRulesClient.java deleted file mode 100644 index 1a856d16714c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/InboundNatRulesClient.java +++ /dev/null @@ -1,378 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.models.InboundNatRuleInner; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in InboundNatRulesClient. */ -public interface InboundNatRulesClient { - /** - * Gets all the inbound nat rules in a load balancer. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the inbound nat rules in a load balancer. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String resourceGroupName, String loadBalancerName); - - /** - * Gets all the inbound nat rules in a load balancer. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the inbound nat rules in a load balancer. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String loadBalancerName); - - /** - * Gets all the inbound nat rules in a load balancer. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the inbound nat rules in a load balancer. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String loadBalancerName, Context context); - - /** - * Deletes the specified load balancer inbound nat rule. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param inboundNatRuleName The name of the inbound nat rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync( - String resourceGroupName, String loadBalancerName, String inboundNatRuleName); - - /** - * Deletes the specified load balancer inbound nat rule. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param inboundNatRuleName The name of the inbound nat rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String loadBalancerName, String inboundNatRuleName); - - /** - * Deletes the specified load balancer inbound nat rule. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param inboundNatRuleName The name of the inbound nat rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String loadBalancerName, String inboundNatRuleName); - - /** - * Deletes the specified load balancer inbound nat rule. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param inboundNatRuleName The name of the inbound nat rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String loadBalancerName, String inboundNatRuleName, Context context); - - /** - * Deletes the specified load balancer inbound nat rule. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param inboundNatRuleName The name of the inbound nat rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName); - - /** - * Deletes the specified load balancer inbound nat rule. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param inboundNatRuleName The name of the inbound nat rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String loadBalancerName, String inboundNatRuleName); - - /** - * Deletes the specified load balancer inbound nat rule. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param inboundNatRuleName The name of the inbound nat rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String loadBalancerName, String inboundNatRuleName, Context context); - - /** - * Gets the specified load balancer inbound nat rule. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param inboundNatRuleName The name of the inbound nat rule. - * @param expand Expands referenced resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified load balancer inbound nat rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync( - String resourceGroupName, String loadBalancerName, String inboundNatRuleName, String expand); - - /** - * Gets the specified load balancer inbound nat rule. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param inboundNatRuleName The name of the inbound nat rule. - * @param expand Expands referenced resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified load balancer inbound nat rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync( - String resourceGroupName, String loadBalancerName, String inboundNatRuleName, String expand); - - /** - * Gets the specified load balancer inbound nat rule. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param inboundNatRuleName The name of the inbound nat rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified load balancer inbound nat rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName); - - /** - * Gets the specified load balancer inbound nat rule. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param inboundNatRuleName The name of the inbound nat rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified load balancer inbound nat rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - InboundNatRuleInner get(String resourceGroupName, String loadBalancerName, String inboundNatRuleName); - - /** - * Gets the specified load balancer inbound nat rule. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param inboundNatRuleName The name of the inbound nat rule. - * @param expand Expands referenced resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified load balancer inbound nat rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String loadBalancerName, String inboundNatRuleName, String expand, Context context); - - /** - * Creates or updates a load balancer inbound nat rule. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param inboundNatRuleName The name of the inbound nat rule. - * @param inboundNatRuleParameters Parameters supplied to the create or update inbound nat rule operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return inbound NAT rule of the load balancer. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String loadBalancerName, - String inboundNatRuleName, - InboundNatRuleInner inboundNatRuleParameters); - - /** - * Creates or updates a load balancer inbound nat rule. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param inboundNatRuleName The name of the inbound nat rule. - * @param inboundNatRuleParameters Parameters supplied to the create or update inbound nat rule operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return inbound NAT rule of the load balancer. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, InboundNatRuleInner> beginCreateOrUpdateAsync( - String resourceGroupName, - String loadBalancerName, - String inboundNatRuleName, - InboundNatRuleInner inboundNatRuleParameters); - - /** - * Creates or updates a load balancer inbound nat rule. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param inboundNatRuleName The name of the inbound nat rule. - * @param inboundNatRuleParameters Parameters supplied to the create or update inbound nat rule operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return inbound NAT rule of the load balancer. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, InboundNatRuleInner> beginCreateOrUpdate( - String resourceGroupName, - String loadBalancerName, - String inboundNatRuleName, - InboundNatRuleInner inboundNatRuleParameters); - - /** - * Creates or updates a load balancer inbound nat rule. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param inboundNatRuleName The name of the inbound nat rule. - * @param inboundNatRuleParameters Parameters supplied to the create or update inbound nat rule operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return inbound NAT rule of the load balancer. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, InboundNatRuleInner> beginCreateOrUpdate( - String resourceGroupName, - String loadBalancerName, - String inboundNatRuleName, - InboundNatRuleInner inboundNatRuleParameters, - Context context); - - /** - * Creates or updates a load balancer inbound nat rule. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param inboundNatRuleName The name of the inbound nat rule. - * @param inboundNatRuleParameters Parameters supplied to the create or update inbound nat rule operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return inbound NAT rule of the load balancer. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, - String loadBalancerName, - String inboundNatRuleName, - InboundNatRuleInner inboundNatRuleParameters); - - /** - * Creates or updates a load balancer inbound nat rule. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param inboundNatRuleName The name of the inbound nat rule. - * @param inboundNatRuleParameters Parameters supplied to the create or update inbound nat rule operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return inbound NAT rule of the load balancer. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - InboundNatRuleInner createOrUpdate( - String resourceGroupName, - String loadBalancerName, - String inboundNatRuleName, - InboundNatRuleInner inboundNatRuleParameters); - - /** - * Creates or updates a load balancer inbound nat rule. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param inboundNatRuleName The name of the inbound nat rule. - * @param inboundNatRuleParameters Parameters supplied to the create or update inbound nat rule operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return inbound NAT rule of the load balancer. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - InboundNatRuleInner createOrUpdate( - String resourceGroupName, - String loadBalancerName, - String inboundNatRuleName, - InboundNatRuleInner inboundNatRuleParameters, - Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/InterfaceEndpointsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/InterfaceEndpointsClient.java deleted file mode 100644 index ddc2634a5785..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/InterfaceEndpointsClient.java +++ /dev/null @@ -1,368 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.models.InterfaceEndpointInner; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in InterfaceEndpointsClient. */ -public interface InterfaceEndpointsClient - extends InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete { - /** - * Deletes the specified interface endpoint. - * - * @param resourceGroupName The name of the resource group. - * @param interfaceEndpointName The name of the interface endpoint. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync(String resourceGroupName, String interfaceEndpointName); - - /** - * Deletes the specified interface endpoint. - * - * @param resourceGroupName The name of the resource group. - * @param interfaceEndpointName The name of the interface endpoint. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String interfaceEndpointName); - - /** - * Deletes the specified interface endpoint. - * - * @param resourceGroupName The name of the resource group. - * @param interfaceEndpointName The name of the interface endpoint. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String interfaceEndpointName); - - /** - * Deletes the specified interface endpoint. - * - * @param resourceGroupName The name of the resource group. - * @param interfaceEndpointName The name of the interface endpoint. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String interfaceEndpointName, Context context); - - /** - * Deletes the specified interface endpoint. - * - * @param resourceGroupName The name of the resource group. - * @param interfaceEndpointName The name of the interface endpoint. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String interfaceEndpointName); - - /** - * Deletes the specified interface endpoint. - * - * @param resourceGroupName The name of the resource group. - * @param interfaceEndpointName The name of the interface endpoint. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String interfaceEndpointName); - - /** - * Deletes the specified interface endpoint. - * - * @param resourceGroupName The name of the resource group. - * @param interfaceEndpointName The name of the interface endpoint. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String interfaceEndpointName, Context context); - - /** - * Gets the specified interface endpoint by resource group. - * - * @param resourceGroupName The name of the resource group. - * @param interfaceEndpointName The name of the interface endpoint. - * @param expand Expands referenced resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified interface endpoint by resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String interfaceEndpointName, String expand); - - /** - * Gets the specified interface endpoint by resource group. - * - * @param resourceGroupName The name of the resource group. - * @param interfaceEndpointName The name of the interface endpoint. - * @param expand Expands referenced resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified interface endpoint by resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync( - String resourceGroupName, String interfaceEndpointName, String expand); - - /** - * Gets the specified interface endpoint by resource group. - * - * @param resourceGroupName The name of the resource group. - * @param interfaceEndpointName The name of the interface endpoint. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified interface endpoint by resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync(String resourceGroupName, String interfaceEndpointName); - - /** - * Gets the specified interface endpoint by resource group. - * - * @param resourceGroupName The name of the resource group. - * @param interfaceEndpointName The name of the interface endpoint. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified interface endpoint by resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - InterfaceEndpointInner getByResourceGroup(String resourceGroupName, String interfaceEndpointName); - - /** - * Gets the specified interface endpoint by resource group. - * - * @param resourceGroupName The name of the resource group. - * @param interfaceEndpointName The name of the interface endpoint. - * @param expand Expands referenced resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified interface endpoint by resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String interfaceEndpointName, String expand, Context context); - - /** - * Creates or updates an interface endpoint in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param interfaceEndpointName The name of the interface endpoint. - * @param parameters Parameters supplied to the create or update interface endpoint operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return interface endpoint resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String interfaceEndpointName, InterfaceEndpointInner parameters); - - /** - * Creates or updates an interface endpoint in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param interfaceEndpointName The name of the interface endpoint. - * @param parameters Parameters supplied to the create or update interface endpoint operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return interface endpoint resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, InterfaceEndpointInner> beginCreateOrUpdateAsync( - String resourceGroupName, String interfaceEndpointName, InterfaceEndpointInner parameters); - - /** - * Creates or updates an interface endpoint in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param interfaceEndpointName The name of the interface endpoint. - * @param parameters Parameters supplied to the create or update interface endpoint operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return interface endpoint resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, InterfaceEndpointInner> beginCreateOrUpdate( - String resourceGroupName, String interfaceEndpointName, InterfaceEndpointInner parameters); - - /** - * Creates or updates an interface endpoint in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param interfaceEndpointName The name of the interface endpoint. - * @param parameters Parameters supplied to the create or update interface endpoint operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return interface endpoint resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, InterfaceEndpointInner> beginCreateOrUpdate( - String resourceGroupName, String interfaceEndpointName, InterfaceEndpointInner parameters, Context context); - - /** - * Creates or updates an interface endpoint in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param interfaceEndpointName The name of the interface endpoint. - * @param parameters Parameters supplied to the create or update interface endpoint operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return interface endpoint resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, String interfaceEndpointName, InterfaceEndpointInner parameters); - - /** - * Creates or updates an interface endpoint in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param interfaceEndpointName The name of the interface endpoint. - * @param parameters Parameters supplied to the create or update interface endpoint operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return interface endpoint resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - InterfaceEndpointInner createOrUpdate( - String resourceGroupName, String interfaceEndpointName, InterfaceEndpointInner parameters); - - /** - * Creates or updates an interface endpoint in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param interfaceEndpointName The name of the interface endpoint. - * @param parameters Parameters supplied to the create or update interface endpoint operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return interface endpoint resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - InterfaceEndpointInner createOrUpdate( - String resourceGroupName, String interfaceEndpointName, InterfaceEndpointInner parameters, Context context); - - /** - * Gets all interface endpoints in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all interface endpoints in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName); - - /** - * Gets all interface endpoints in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all interface endpoints in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Gets all interface endpoints in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all interface endpoints in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * Gets all interface endpoints in a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all interface endpoints in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Gets all interface endpoints in a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all interface endpoints in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Gets all interface endpoints in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all interface endpoints in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/LoadBalancerBackendAddressPoolsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/LoadBalancerBackendAddressPoolsClient.java deleted file mode 100644 index e869a6685a22..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/LoadBalancerBackendAddressPoolsClient.java +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.network.fluent.models.BackendAddressPoolInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in LoadBalancerBackendAddressPoolsClient. */ -public interface LoadBalancerBackendAddressPoolsClient { - /** - * Gets all the load balancer backed address pools. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the load balancer backed address pools. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String resourceGroupName, String loadBalancerName); - - /** - * Gets all the load balancer backed address pools. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the load balancer backed address pools. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String loadBalancerName); - - /** - * Gets all the load balancer backed address pools. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the load balancer backed address pools. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String loadBalancerName, Context context); - - /** - * Gets load balancer backend address pool. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param backendAddressPoolName The name of the backend address pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return load balancer backend address pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync( - String resourceGroupName, String loadBalancerName, String backendAddressPoolName); - - /** - * Gets load balancer backend address pool. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param backendAddressPoolName The name of the backend address pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return load balancer backend address pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync( - String resourceGroupName, String loadBalancerName, String backendAddressPoolName); - - /** - * Gets load balancer backend address pool. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param backendAddressPoolName The name of the backend address pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return load balancer backend address pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - BackendAddressPoolInner get(String resourceGroupName, String loadBalancerName, String backendAddressPoolName); - - /** - * Gets load balancer backend address pool. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param backendAddressPoolName The name of the backend address pool. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return load balancer backend address pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String loadBalancerName, String backendAddressPoolName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/LoadBalancerFrontendIpConfigurationsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/LoadBalancerFrontendIpConfigurationsClient.java deleted file mode 100644 index e5591e09f819..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/LoadBalancerFrontendIpConfigurationsClient.java +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.network.fluent.models.FrontendIpConfigurationInner; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in - * LoadBalancerFrontendIpConfigurationsClient. - */ -public interface LoadBalancerFrontendIpConfigurationsClient { - /** - * Gets all the load balancer frontend IP configurations. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the load balancer frontend IP configurations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String resourceGroupName, String loadBalancerName); - - /** - * Gets all the load balancer frontend IP configurations. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the load balancer frontend IP configurations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String loadBalancerName); - - /** - * Gets all the load balancer frontend IP configurations. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the load balancer frontend IP configurations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String resourceGroupName, String loadBalancerName, Context context); - - /** - * Gets load balancer frontend IP configuration. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param frontendIpConfigurationName The name of the frontend IP configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return load balancer frontend IP configuration. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync( - String resourceGroupName, String loadBalancerName, String frontendIpConfigurationName); - - /** - * Gets load balancer frontend IP configuration. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param frontendIpConfigurationName The name of the frontend IP configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return load balancer frontend IP configuration. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync( - String resourceGroupName, String loadBalancerName, String frontendIpConfigurationName); - - /** - * Gets load balancer frontend IP configuration. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param frontendIpConfigurationName The name of the frontend IP configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return load balancer frontend IP configuration. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - FrontendIpConfigurationInner get( - String resourceGroupName, String loadBalancerName, String frontendIpConfigurationName); - - /** - * Gets load balancer frontend IP configuration. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param frontendIpConfigurationName The name of the frontend IP configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return load balancer frontend IP configuration. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String loadBalancerName, String frontendIpConfigurationName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/LoadBalancerLoadBalancingRulesClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/LoadBalancerLoadBalancingRulesClient.java deleted file mode 100644 index d72c407a438e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/LoadBalancerLoadBalancingRulesClient.java +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.network.fluent.models.LoadBalancingRuleInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in LoadBalancerLoadBalancingRulesClient. */ -public interface LoadBalancerLoadBalancingRulesClient { - /** - * Gets all the load balancing rules in a load balancer. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the load balancing rules in a load balancer. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String resourceGroupName, String loadBalancerName); - - /** - * Gets all the load balancing rules in a load balancer. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the load balancing rules in a load balancer. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String loadBalancerName); - - /** - * Gets all the load balancing rules in a load balancer. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the load balancing rules in a load balancer. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String loadBalancerName, Context context); - - /** - * Gets the specified load balancer load balancing rule. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param loadBalancingRuleName The name of the load balancing rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified load balancer load balancing rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync( - String resourceGroupName, String loadBalancerName, String loadBalancingRuleName); - - /** - * Gets the specified load balancer load balancing rule. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param loadBalancingRuleName The name of the load balancing rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified load balancer load balancing rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync( - String resourceGroupName, String loadBalancerName, String loadBalancingRuleName); - - /** - * Gets the specified load balancer load balancing rule. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param loadBalancingRuleName The name of the load balancing rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified load balancer load balancing rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - LoadBalancingRuleInner get(String resourceGroupName, String loadBalancerName, String loadBalancingRuleName); - - /** - * Gets the specified load balancer load balancing rule. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param loadBalancingRuleName The name of the load balancing rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified load balancer load balancing rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String loadBalancerName, String loadBalancingRuleName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/LoadBalancerNetworkInterfacesClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/LoadBalancerNetworkInterfacesClient.java deleted file mode 100644 index d1fc215deace..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/LoadBalancerNetworkInterfacesClient.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.network.fluent.models.NetworkInterfaceInner; - -/** An instance of this class provides access to all the operations defined in LoadBalancerNetworkInterfacesClient. */ -public interface LoadBalancerNetworkInterfacesClient { - /** - * Gets associated load balancer network interfaces. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return associated load balancer network interfaces. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String resourceGroupName, String loadBalancerName); - - /** - * Gets associated load balancer network interfaces. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return associated load balancer network interfaces. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String loadBalancerName); - - /** - * Gets associated load balancer network interfaces. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return associated load balancer network interfaces. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String loadBalancerName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/LoadBalancerOutboundRulesClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/LoadBalancerOutboundRulesClient.java deleted file mode 100644 index f734d5b56c17..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/LoadBalancerOutboundRulesClient.java +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.network.fluent.models.OutboundRuleInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in LoadBalancerOutboundRulesClient. */ -public interface LoadBalancerOutboundRulesClient { - /** - * Gets all the outbound rules in a load balancer. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the outbound rules in a load balancer. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String resourceGroupName, String loadBalancerName); - - /** - * Gets all the outbound rules in a load balancer. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the outbound rules in a load balancer. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String loadBalancerName); - - /** - * Gets all the outbound rules in a load balancer. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the outbound rules in a load balancer. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String loadBalancerName, Context context); - - /** - * Gets the specified load balancer outbound rule. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param outboundRuleName The name of the outbound rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified load balancer outbound rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync( - String resourceGroupName, String loadBalancerName, String outboundRuleName); - - /** - * Gets the specified load balancer outbound rule. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param outboundRuleName The name of the outbound rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified load balancer outbound rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync(String resourceGroupName, String loadBalancerName, String outboundRuleName); - - /** - * Gets the specified load balancer outbound rule. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param outboundRuleName The name of the outbound rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified load balancer outbound rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - OutboundRuleInner get(String resourceGroupName, String loadBalancerName, String outboundRuleName); - - /** - * Gets the specified load balancer outbound rule. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param outboundRuleName The name of the outbound rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified load balancer outbound rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String loadBalancerName, String outboundRuleName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/LoadBalancerProbesClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/LoadBalancerProbesClient.java deleted file mode 100644 index 62bbc43a3eb2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/LoadBalancerProbesClient.java +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.network.fluent.models.ProbeInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in LoadBalancerProbesClient. */ -public interface LoadBalancerProbesClient { - /** - * Gets all the load balancer probes. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the load balancer probes. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String resourceGroupName, String loadBalancerName); - - /** - * Gets all the load balancer probes. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the load balancer probes. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String loadBalancerName); - - /** - * Gets all the load balancer probes. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the load balancer probes. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String loadBalancerName, Context context); - - /** - * Gets load balancer probe. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param probeName The name of the probe. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return load balancer probe. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync( - String resourceGroupName, String loadBalancerName, String probeName); - - /** - * Gets load balancer probe. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param probeName The name of the probe. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return load balancer probe. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync(String resourceGroupName, String loadBalancerName, String probeName); - - /** - * Gets load balancer probe. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param probeName The name of the probe. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return load balancer probe. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ProbeInner get(String resourceGroupName, String loadBalancerName, String probeName); - - /** - * Gets load balancer probe. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param probeName The name of the probe. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return load balancer probe. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String loadBalancerName, String probeName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/LoadBalancersClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/LoadBalancersClient.java deleted file mode 100644 index a0258c41943b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/LoadBalancersClient.java +++ /dev/null @@ -1,469 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.models.LoadBalancerInner; -import com.azure.resourcemanager.network.models.TagsObject; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in LoadBalancersClient. */ -public interface LoadBalancersClient - extends InnerSupportsGet, InnerSupportsListing, InnerSupportsDelete { - /** - * Deletes the specified load balancer. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync(String resourceGroupName, String loadBalancerName); - - /** - * Deletes the specified load balancer. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String loadBalancerName); - - /** - * Deletes the specified load balancer. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String loadBalancerName); - - /** - * Deletes the specified load balancer. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String loadBalancerName, Context context); - - /** - * Deletes the specified load balancer. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String loadBalancerName); - - /** - * Deletes the specified load balancer. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String loadBalancerName); - - /** - * Deletes the specified load balancer. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String loadBalancerName, Context context); - - /** - * Gets the specified load balancer. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param expand Expands referenced resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified load balancer. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String loadBalancerName, String expand); - - /** - * Gets the specified load balancer. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param expand Expands referenced resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified load balancer. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync(String resourceGroupName, String loadBalancerName, String expand); - - /** - * Gets the specified load balancer. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified load balancer. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync(String resourceGroupName, String loadBalancerName); - - /** - * Gets the specified load balancer. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified load balancer. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - LoadBalancerInner getByResourceGroup(String resourceGroupName, String loadBalancerName); - - /** - * Gets the specified load balancer. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param expand Expands referenced resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified load balancer. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String loadBalancerName, String expand, Context context); - - /** - * Creates or updates a load balancer. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param parameters Parameters supplied to the create or update load balancer operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return loadBalancer resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters); - - /** - * Creates or updates a load balancer. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param parameters Parameters supplied to the create or update load balancer operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return loadBalancer resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, LoadBalancerInner> beginCreateOrUpdateAsync( - String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters); - - /** - * Creates or updates a load balancer. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param parameters Parameters supplied to the create or update load balancer operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return loadBalancer resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, LoadBalancerInner> beginCreateOrUpdate( - String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters); - - /** - * Creates or updates a load balancer. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param parameters Parameters supplied to the create or update load balancer operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return loadBalancer resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, LoadBalancerInner> beginCreateOrUpdate( - String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters, Context context); - - /** - * Creates or updates a load balancer. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param parameters Parameters supplied to the create or update load balancer operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return loadBalancer resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters); - - /** - * Creates or updates a load balancer. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param parameters Parameters supplied to the create or update load balancer operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return loadBalancer resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - LoadBalancerInner createOrUpdate(String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters); - - /** - * Creates or updates a load balancer. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param parameters Parameters supplied to the create or update load balancer operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return loadBalancer resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - LoadBalancerInner createOrUpdate( - String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters, Context context); - - /** - * Updates a load balancer tags. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param parameters Parameters supplied to update load balancer tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return loadBalancer resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> updateTagsWithResponseAsync( - String resourceGroupName, String loadBalancerName, TagsObject parameters); - - /** - * Updates a load balancer tags. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param parameters Parameters supplied to update load balancer tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return loadBalancer resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, LoadBalancerInner> beginUpdateTagsAsync( - String resourceGroupName, String loadBalancerName, TagsObject parameters); - - /** - * Updates a load balancer tags. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param parameters Parameters supplied to update load balancer tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return loadBalancer resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, LoadBalancerInner> beginUpdateTags( - String resourceGroupName, String loadBalancerName, TagsObject parameters); - - /** - * Updates a load balancer tags. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param parameters Parameters supplied to update load balancer tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return loadBalancer resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, LoadBalancerInner> beginUpdateTags( - String resourceGroupName, String loadBalancerName, TagsObject parameters, Context context); - - /** - * Updates a load balancer tags. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param parameters Parameters supplied to update load balancer tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return loadBalancer resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateTagsAsync(String resourceGroupName, String loadBalancerName, TagsObject parameters); - - /** - * Updates a load balancer tags. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param parameters Parameters supplied to update load balancer tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return loadBalancer resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - LoadBalancerInner updateTags(String resourceGroupName, String loadBalancerName, TagsObject parameters); - - /** - * Updates a load balancer tags. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param parameters Parameters supplied to update load balancer tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return loadBalancer resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - LoadBalancerInner updateTags( - String resourceGroupName, String loadBalancerName, TagsObject parameters, Context context); - - /** - * Gets all the load balancers in a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the load balancers in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Gets all the load balancers in a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the load balancers in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Gets all the load balancers in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the load balancers in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Gets all the load balancers in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the load balancers in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName); - - /** - * Gets all the load balancers in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the load balancers in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Gets all the load balancers in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the load balancers in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/LocalNetworkGatewaysClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/LocalNetworkGatewaysClient.java deleted file mode 100644 index 5f3393c37ed0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/LocalNetworkGatewaysClient.java +++ /dev/null @@ -1,424 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.models.LocalNetworkGatewayInner; -import com.azure.resourcemanager.network.models.TagsObject; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in LocalNetworkGatewaysClient. */ -public interface LocalNetworkGatewaysClient - extends InnerSupportsGet, InnerSupportsDelete { - /** - * Creates or updates a local network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param localNetworkGatewayName The name of the local network gateway. - * @param parameters Parameters supplied to the create or update local network gateway operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String localNetworkGatewayName, LocalNetworkGatewayInner parameters); - - /** - * Creates or updates a local network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param localNetworkGatewayName The name of the local network gateway. - * @param parameters Parameters supplied to the create or update local network gateway operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, LocalNetworkGatewayInner> beginCreateOrUpdateAsync( - String resourceGroupName, String localNetworkGatewayName, LocalNetworkGatewayInner parameters); - - /** - * Creates or updates a local network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param localNetworkGatewayName The name of the local network gateway. - * @param parameters Parameters supplied to the create or update local network gateway operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, LocalNetworkGatewayInner> beginCreateOrUpdate( - String resourceGroupName, String localNetworkGatewayName, LocalNetworkGatewayInner parameters); - - /** - * Creates or updates a local network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param localNetworkGatewayName The name of the local network gateway. - * @param parameters Parameters supplied to the create or update local network gateway operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, LocalNetworkGatewayInner> beginCreateOrUpdate( - String resourceGroupName, String localNetworkGatewayName, LocalNetworkGatewayInner parameters, Context context); - - /** - * Creates or updates a local network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param localNetworkGatewayName The name of the local network gateway. - * @param parameters Parameters supplied to the create or update local network gateway operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, String localNetworkGatewayName, LocalNetworkGatewayInner parameters); - - /** - * Creates or updates a local network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param localNetworkGatewayName The name of the local network gateway. - * @param parameters Parameters supplied to the create or update local network gateway operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - LocalNetworkGatewayInner createOrUpdate( - String resourceGroupName, String localNetworkGatewayName, LocalNetworkGatewayInner parameters); - - /** - * Creates or updates a local network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param localNetworkGatewayName The name of the local network gateway. - * @param parameters Parameters supplied to the create or update local network gateway operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - LocalNetworkGatewayInner createOrUpdate( - String resourceGroupName, String localNetworkGatewayName, LocalNetworkGatewayInner parameters, Context context); - - /** - * Gets the specified local network gateway in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param localNetworkGatewayName The name of the local network gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified local network gateway in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String localNetworkGatewayName); - - /** - * Gets the specified local network gateway in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param localNetworkGatewayName The name of the local network gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified local network gateway in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync(String resourceGroupName, String localNetworkGatewayName); - - /** - * Gets the specified local network gateway in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param localNetworkGatewayName The name of the local network gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified local network gateway in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - LocalNetworkGatewayInner getByResourceGroup(String resourceGroupName, String localNetworkGatewayName); - - /** - * Gets the specified local network gateway in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param localNetworkGatewayName The name of the local network gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified local network gateway in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String localNetworkGatewayName, Context context); - - /** - * Deletes the specified local network gateway. - * - * @param resourceGroupName The name of the resource group. - * @param localNetworkGatewayName The name of the local network gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync(String resourceGroupName, String localNetworkGatewayName); - - /** - * Deletes the specified local network gateway. - * - * @param resourceGroupName The name of the resource group. - * @param localNetworkGatewayName The name of the local network gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String localNetworkGatewayName); - - /** - * Deletes the specified local network gateway. - * - * @param resourceGroupName The name of the resource group. - * @param localNetworkGatewayName The name of the local network gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String localNetworkGatewayName); - - /** - * Deletes the specified local network gateway. - * - * @param resourceGroupName The name of the resource group. - * @param localNetworkGatewayName The name of the local network gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String localNetworkGatewayName, Context context); - - /** - * Deletes the specified local network gateway. - * - * @param resourceGroupName The name of the resource group. - * @param localNetworkGatewayName The name of the local network gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String localNetworkGatewayName); - - /** - * Deletes the specified local network gateway. - * - * @param resourceGroupName The name of the resource group. - * @param localNetworkGatewayName The name of the local network gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String localNetworkGatewayName); - - /** - * Deletes the specified local network gateway. - * - * @param resourceGroupName The name of the resource group. - * @param localNetworkGatewayName The name of the local network gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String localNetworkGatewayName, Context context); - - /** - * Updates a local network gateway tags. - * - * @param resourceGroupName The name of the resource group. - * @param localNetworkGatewayName The name of the local network gateway. - * @param parameters Parameters supplied to update local network gateway tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> updateTagsWithResponseAsync( - String resourceGroupName, String localNetworkGatewayName, TagsObject parameters); - - /** - * Updates a local network gateway tags. - * - * @param resourceGroupName The name of the resource group. - * @param localNetworkGatewayName The name of the local network gateway. - * @param parameters Parameters supplied to update local network gateway tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, LocalNetworkGatewayInner> beginUpdateTagsAsync( - String resourceGroupName, String localNetworkGatewayName, TagsObject parameters); - - /** - * Updates a local network gateway tags. - * - * @param resourceGroupName The name of the resource group. - * @param localNetworkGatewayName The name of the local network gateway. - * @param parameters Parameters supplied to update local network gateway tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, LocalNetworkGatewayInner> beginUpdateTags( - String resourceGroupName, String localNetworkGatewayName, TagsObject parameters); - - /** - * Updates a local network gateway tags. - * - * @param resourceGroupName The name of the resource group. - * @param localNetworkGatewayName The name of the local network gateway. - * @param parameters Parameters supplied to update local network gateway tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, LocalNetworkGatewayInner> beginUpdateTags( - String resourceGroupName, String localNetworkGatewayName, TagsObject parameters, Context context); - - /** - * Updates a local network gateway tags. - * - * @param resourceGroupName The name of the resource group. - * @param localNetworkGatewayName The name of the local network gateway. - * @param parameters Parameters supplied to update local network gateway tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateTagsAsync( - String resourceGroupName, String localNetworkGatewayName, TagsObject parameters); - - /** - * Updates a local network gateway tags. - * - * @param resourceGroupName The name of the resource group. - * @param localNetworkGatewayName The name of the local network gateway. - * @param parameters Parameters supplied to update local network gateway tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - LocalNetworkGatewayInner updateTags( - String resourceGroupName, String localNetworkGatewayName, TagsObject parameters); - - /** - * Updates a local network gateway tags. - * - * @param resourceGroupName The name of the resource group. - * @param localNetworkGatewayName The name of the local network gateway. - * @param parameters Parameters supplied to update local network gateway tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - LocalNetworkGatewayInner updateTags( - String resourceGroupName, String localNetworkGatewayName, TagsObject parameters, Context context); - - /** - * Gets all the local network gateways in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the local network gateways in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName); - - /** - * Gets all the local network gateways in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the local network gateways in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Gets all the local network gateways in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the local network gateways in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/NetworkInterfaceIpConfigurationsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/NetworkInterfaceIpConfigurationsClient.java deleted file mode 100644 index 40f6962c019c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/NetworkInterfaceIpConfigurationsClient.java +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.network.fluent.models.NetworkInterfaceIpConfigurationInner; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in NetworkInterfaceIpConfigurationsClient. - */ -public interface NetworkInterfaceIpConfigurationsClient { - /** - * Get all ip configurations in a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all ip configurations in a network interface. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String resourceGroupName, String networkInterfaceName); - - /** - * Get all ip configurations in a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all ip configurations in a network interface. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String networkInterfaceName); - - /** - * Get all ip configurations in a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all ip configurations in a network interface. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String resourceGroupName, String networkInterfaceName, Context context); - - /** - * Gets the specified network interface ip configuration. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param ipConfigurationName The name of the ip configuration name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network interface ip configuration. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync( - String resourceGroupName, String networkInterfaceName, String ipConfigurationName); - - /** - * Gets the specified network interface ip configuration. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param ipConfigurationName The name of the ip configuration name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network interface ip configuration. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync( - String resourceGroupName, String networkInterfaceName, String ipConfigurationName); - - /** - * Gets the specified network interface ip configuration. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param ipConfigurationName The name of the ip configuration name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network interface ip configuration. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - NetworkInterfaceIpConfigurationInner get( - String resourceGroupName, String networkInterfaceName, String ipConfigurationName); - - /** - * Gets the specified network interface ip configuration. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param ipConfigurationName The name of the ip configuration name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network interface ip configuration. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String networkInterfaceName, String ipConfigurationName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/NetworkInterfaceLoadBalancersClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/NetworkInterfaceLoadBalancersClient.java deleted file mode 100644 index 215f5401857d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/NetworkInterfaceLoadBalancersClient.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.network.fluent.models.LoadBalancerInner; - -/** An instance of this class provides access to all the operations defined in NetworkInterfaceLoadBalancersClient. */ -public interface NetworkInterfaceLoadBalancersClient { - /** - * List all load balancers in a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for list ip configurations API service call. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String resourceGroupName, String networkInterfaceName); - - /** - * List all load balancers in a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for list ip configurations API service call. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String networkInterfaceName); - - /** - * List all load balancers in a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for list ip configurations API service call. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String networkInterfaceName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/NetworkInterfaceTapConfigurationsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/NetworkInterfaceTapConfigurationsClient.java deleted file mode 100644 index cbc10db4536d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/NetworkInterfaceTapConfigurationsClient.java +++ /dev/null @@ -1,368 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.models.NetworkInterfaceTapConfigurationInner; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in NetworkInterfaceTapConfigurationsClient. - */ -public interface NetworkInterfaceTapConfigurationsClient { - /** - * Deletes the specified tap configuration from the NetworkInterface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param tapConfigurationName The name of the tap configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync( - String resourceGroupName, String networkInterfaceName, String tapConfigurationName); - - /** - * Deletes the specified tap configuration from the NetworkInterface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param tapConfigurationName The name of the tap configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String networkInterfaceName, String tapConfigurationName); - - /** - * Deletes the specified tap configuration from the NetworkInterface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param tapConfigurationName The name of the tap configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String networkInterfaceName, String tapConfigurationName); - - /** - * Deletes the specified tap configuration from the NetworkInterface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param tapConfigurationName The name of the tap configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String networkInterfaceName, String tapConfigurationName, Context context); - - /** - * Deletes the specified tap configuration from the NetworkInterface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param tapConfigurationName The name of the tap configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String networkInterfaceName, String tapConfigurationName); - - /** - * Deletes the specified tap configuration from the NetworkInterface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param tapConfigurationName The name of the tap configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String networkInterfaceName, String tapConfigurationName); - - /** - * Deletes the specified tap configuration from the NetworkInterface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param tapConfigurationName The name of the tap configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String networkInterfaceName, String tapConfigurationName, Context context); - - /** - * Get the specified tap configuration on a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param tapConfigurationName The name of the tap configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified tap configuration on a network interface. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync( - String resourceGroupName, String networkInterfaceName, String tapConfigurationName); - - /** - * Get the specified tap configuration on a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param tapConfigurationName The name of the tap configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified tap configuration on a network interface. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync( - String resourceGroupName, String networkInterfaceName, String tapConfigurationName); - - /** - * Get the specified tap configuration on a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param tapConfigurationName The name of the tap configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified tap configuration on a network interface. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - NetworkInterfaceTapConfigurationInner get( - String resourceGroupName, String networkInterfaceName, String tapConfigurationName); - - /** - * Get the specified tap configuration on a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param tapConfigurationName The name of the tap configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified tap configuration on a network interface. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String networkInterfaceName, String tapConfigurationName, Context context); - - /** - * Creates or updates a Tap configuration in the specified NetworkInterface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param tapConfigurationName The name of the tap configuration. - * @param tapConfigurationParameters Parameters supplied to the create or update tap configuration operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return tap configuration in a Network Interface. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String networkInterfaceName, - String tapConfigurationName, - NetworkInterfaceTapConfigurationInner tapConfigurationParameters); - - /** - * Creates or updates a Tap configuration in the specified NetworkInterface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param tapConfigurationName The name of the tap configuration. - * @param tapConfigurationParameters Parameters supplied to the create or update tap configuration operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return tap configuration in a Network Interface. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, NetworkInterfaceTapConfigurationInner> - beginCreateOrUpdateAsync( - String resourceGroupName, - String networkInterfaceName, - String tapConfigurationName, - NetworkInterfaceTapConfigurationInner tapConfigurationParameters); - - /** - * Creates or updates a Tap configuration in the specified NetworkInterface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param tapConfigurationName The name of the tap configuration. - * @param tapConfigurationParameters Parameters supplied to the create or update tap configuration operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return tap configuration in a Network Interface. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, NetworkInterfaceTapConfigurationInner> - beginCreateOrUpdate( - String resourceGroupName, - String networkInterfaceName, - String tapConfigurationName, - NetworkInterfaceTapConfigurationInner tapConfigurationParameters); - - /** - * Creates or updates a Tap configuration in the specified NetworkInterface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param tapConfigurationName The name of the tap configuration. - * @param tapConfigurationParameters Parameters supplied to the create or update tap configuration operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return tap configuration in a Network Interface. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, NetworkInterfaceTapConfigurationInner> - beginCreateOrUpdate( - String resourceGroupName, - String networkInterfaceName, - String tapConfigurationName, - NetworkInterfaceTapConfigurationInner tapConfigurationParameters, - Context context); - - /** - * Creates or updates a Tap configuration in the specified NetworkInterface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param tapConfigurationName The name of the tap configuration. - * @param tapConfigurationParameters Parameters supplied to the create or update tap configuration operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return tap configuration in a Network Interface. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, - String networkInterfaceName, - String tapConfigurationName, - NetworkInterfaceTapConfigurationInner tapConfigurationParameters); - - /** - * Creates or updates a Tap configuration in the specified NetworkInterface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param tapConfigurationName The name of the tap configuration. - * @param tapConfigurationParameters Parameters supplied to the create or update tap configuration operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return tap configuration in a Network Interface. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - NetworkInterfaceTapConfigurationInner createOrUpdate( - String resourceGroupName, - String networkInterfaceName, - String tapConfigurationName, - NetworkInterfaceTapConfigurationInner tapConfigurationParameters); - - /** - * Creates or updates a Tap configuration in the specified NetworkInterface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param tapConfigurationName The name of the tap configuration. - * @param tapConfigurationParameters Parameters supplied to the create or update tap configuration operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return tap configuration in a Network Interface. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - NetworkInterfaceTapConfigurationInner createOrUpdate( - String resourceGroupName, - String networkInterfaceName, - String tapConfigurationName, - NetworkInterfaceTapConfigurationInner tapConfigurationParameters, - Context context); - - /** - * Get all Tap configurations in a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all Tap configurations in a network interface. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String resourceGroupName, String networkInterfaceName); - - /** - * Get all Tap configurations in a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all Tap configurations in a network interface. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String networkInterfaceName); - - /** - * Get all Tap configurations in a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all Tap configurations in a network interface. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String resourceGroupName, String networkInterfaceName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/NetworkInterfacesClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/NetworkInterfacesClient.java deleted file mode 100644 index ed6445172049..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/NetworkInterfacesClient.java +++ /dev/null @@ -1,1064 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.models.EffectiveNetworkSecurityGroupListResultInner; -import com.azure.resourcemanager.network.fluent.models.EffectiveRouteListResultInner; -import com.azure.resourcemanager.network.fluent.models.NetworkInterfaceInner; -import com.azure.resourcemanager.network.fluent.models.NetworkInterfaceIpConfigurationInner; -import com.azure.resourcemanager.network.models.TagsObject; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in NetworkInterfacesClient. */ -public interface NetworkInterfacesClient - extends InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete { - /** - * Deletes the specified network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync(String resourceGroupName, String networkInterfaceName); - - /** - * Deletes the specified network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String networkInterfaceName); - - /** - * Deletes the specified network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String networkInterfaceName); - - /** - * Deletes the specified network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String networkInterfaceName, Context context); - - /** - * Deletes the specified network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String networkInterfaceName); - - /** - * Deletes the specified network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String networkInterfaceName); - - /** - * Deletes the specified network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String networkInterfaceName, Context context); - - /** - * Gets information about the specified network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param expand Expands referenced resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified network interface. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String networkInterfaceName, String expand); - - /** - * Gets information about the specified network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param expand Expands referenced resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified network interface. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync( - String resourceGroupName, String networkInterfaceName, String expand); - - /** - * Gets information about the specified network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified network interface. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync(String resourceGroupName, String networkInterfaceName); - - /** - * Gets information about the specified network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified network interface. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - NetworkInterfaceInner getByResourceGroup(String resourceGroupName, String networkInterfaceName); - - /** - * Gets information about the specified network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param expand Expands referenced resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified network interface. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String networkInterfaceName, String expand, Context context); - - /** - * Creates or updates a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param parameters Parameters supplied to the create or update network interface operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a network interface in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters); - - /** - * Creates or updates a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param parameters Parameters supplied to the create or update network interface operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a network interface in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, NetworkInterfaceInner> beginCreateOrUpdateAsync( - String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters); - - /** - * Creates or updates a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param parameters Parameters supplied to the create or update network interface operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a network interface in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, NetworkInterfaceInner> beginCreateOrUpdate( - String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters); - - /** - * Creates or updates a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param parameters Parameters supplied to the create or update network interface operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a network interface in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, NetworkInterfaceInner> beginCreateOrUpdate( - String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters, Context context); - - /** - * Creates or updates a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param parameters Parameters supplied to the create or update network interface operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a network interface in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters); - - /** - * Creates or updates a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param parameters Parameters supplied to the create or update network interface operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a network interface in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - NetworkInterfaceInner createOrUpdate( - String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters); - - /** - * Creates or updates a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param parameters Parameters supplied to the create or update network interface operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a network interface in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - NetworkInterfaceInner createOrUpdate( - String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters, Context context); - - /** - * Updates a network interface tags. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param parameters Parameters supplied to update network interface tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a network interface in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> updateTagsWithResponseAsync( - String resourceGroupName, String networkInterfaceName, TagsObject parameters); - - /** - * Updates a network interface tags. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param parameters Parameters supplied to update network interface tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a network interface in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, NetworkInterfaceInner> beginUpdateTagsAsync( - String resourceGroupName, String networkInterfaceName, TagsObject parameters); - - /** - * Updates a network interface tags. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param parameters Parameters supplied to update network interface tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a network interface in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, NetworkInterfaceInner> beginUpdateTags( - String resourceGroupName, String networkInterfaceName, TagsObject parameters); - - /** - * Updates a network interface tags. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param parameters Parameters supplied to update network interface tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a network interface in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, NetworkInterfaceInner> beginUpdateTags( - String resourceGroupName, String networkInterfaceName, TagsObject parameters, Context context); - - /** - * Updates a network interface tags. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param parameters Parameters supplied to update network interface tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a network interface in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateTagsAsync( - String resourceGroupName, String networkInterfaceName, TagsObject parameters); - - /** - * Updates a network interface tags. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param parameters Parameters supplied to update network interface tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a network interface in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - NetworkInterfaceInner updateTags(String resourceGroupName, String networkInterfaceName, TagsObject parameters); - - /** - * Updates a network interface tags. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param parameters Parameters supplied to update network interface tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a network interface in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - NetworkInterfaceInner updateTags( - String resourceGroupName, String networkInterfaceName, TagsObject parameters, Context context); - - /** - * Gets all network interfaces in a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network interfaces in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Gets all network interfaces in a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network interfaces in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Gets all network interfaces in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network interfaces in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Gets all network interfaces in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network interfaces in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName); - - /** - * Gets all network interfaces in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network interfaces in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Gets all network interfaces in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network interfaces in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * Gets all route tables applied to a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all route tables applied to a network interface. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> getEffectiveRouteTableWithResponseAsync( - String resourceGroupName, String networkInterfaceName); - - /** - * Gets all route tables applied to a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all route tables applied to a network interface. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, EffectiveRouteListResultInner> - beginGetEffectiveRouteTableAsync(String resourceGroupName, String networkInterfaceName); - - /** - * Gets all route tables applied to a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all route tables applied to a network interface. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, EffectiveRouteListResultInner> beginGetEffectiveRouteTable( - String resourceGroupName, String networkInterfaceName); - - /** - * Gets all route tables applied to a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all route tables applied to a network interface. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, EffectiveRouteListResultInner> beginGetEffectiveRouteTable( - String resourceGroupName, String networkInterfaceName, Context context); - - /** - * Gets all route tables applied to a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all route tables applied to a network interface. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getEffectiveRouteTableAsync( - String resourceGroupName, String networkInterfaceName); - - /** - * Gets all route tables applied to a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all route tables applied to a network interface. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - EffectiveRouteListResultInner getEffectiveRouteTable(String resourceGroupName, String networkInterfaceName); - - /** - * Gets all route tables applied to a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all route tables applied to a network interface. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - EffectiveRouteListResultInner getEffectiveRouteTable( - String resourceGroupName, String networkInterfaceName, Context context); - - /** - * Gets all network security groups applied to a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network security groups applied to a network interface. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> listEffectiveNetworkSecurityGroupsWithResponseAsync( - String resourceGroupName, String networkInterfaceName); - - /** - * Gets all network security groups applied to a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network security groups applied to a network interface. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, EffectiveNetworkSecurityGroupListResultInner> - beginListEffectiveNetworkSecurityGroupsAsync(String resourceGroupName, String networkInterfaceName); - - /** - * Gets all network security groups applied to a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network security groups applied to a network interface. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, EffectiveNetworkSecurityGroupListResultInner> - beginListEffectiveNetworkSecurityGroups(String resourceGroupName, String networkInterfaceName); - - /** - * Gets all network security groups applied to a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network security groups applied to a network interface. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, EffectiveNetworkSecurityGroupListResultInner> - beginListEffectiveNetworkSecurityGroups(String resourceGroupName, String networkInterfaceName, Context context); - - /** - * Gets all network security groups applied to a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network security groups applied to a network interface. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listEffectiveNetworkSecurityGroupsAsync( - String resourceGroupName, String networkInterfaceName); - - /** - * Gets all network security groups applied to a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network security groups applied to a network interface. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - EffectiveNetworkSecurityGroupListResultInner listEffectiveNetworkSecurityGroups( - String resourceGroupName, String networkInterfaceName); - - /** - * Gets all network security groups applied to a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network security groups applied to a network interface. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - EffectiveNetworkSecurityGroupListResultInner listEffectiveNetworkSecurityGroups( - String resourceGroupName, String networkInterfaceName, Context context); - - /** - * Gets information about all network interfaces in a virtual machine in a virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @param virtualmachineIndex The virtual machine index. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about all network interfaces in a virtual machine in a virtual machine scale set. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listVirtualMachineScaleSetVMNetworkInterfacesAsync( - String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex); - - /** - * Gets information about all network interfaces in a virtual machine in a virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @param virtualmachineIndex The virtual machine index. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about all network interfaces in a virtual machine in a virtual machine scale set. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listVirtualMachineScaleSetVMNetworkInterfaces( - String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex); - - /** - * Gets information about all network interfaces in a virtual machine in a virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @param virtualmachineIndex The virtual machine index. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about all network interfaces in a virtual machine in a virtual machine scale set. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listVirtualMachineScaleSetVMNetworkInterfaces( - String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, Context context); - - /** - * Gets all network interfaces in a virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network interfaces in a virtual machine scale set. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listVirtualMachineScaleSetNetworkInterfacesAsync( - String resourceGroupName, String virtualMachineScaleSetName); - - /** - * Gets all network interfaces in a virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network interfaces in a virtual machine scale set. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listVirtualMachineScaleSetNetworkInterfaces( - String resourceGroupName, String virtualMachineScaleSetName); - - /** - * Gets all network interfaces in a virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network interfaces in a virtual machine scale set. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listVirtualMachineScaleSetNetworkInterfaces( - String resourceGroupName, String virtualMachineScaleSetName, Context context); - - /** - * Get the specified network interface in a virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @param virtualmachineIndex The virtual machine index. - * @param networkInterfaceName The name of the network interface. - * @param expand Expands referenced resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network interface in a virtual machine scale set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getVirtualMachineScaleSetNetworkInterfaceWithResponseAsync( - String resourceGroupName, - String virtualMachineScaleSetName, - String virtualmachineIndex, - String networkInterfaceName, - String expand); - - /** - * Get the specified network interface in a virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @param virtualmachineIndex The virtual machine index. - * @param networkInterfaceName The name of the network interface. - * @param expand Expands referenced resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network interface in a virtual machine scale set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getVirtualMachineScaleSetNetworkInterfaceAsync( - String resourceGroupName, - String virtualMachineScaleSetName, - String virtualmachineIndex, - String networkInterfaceName, - String expand); - - /** - * Get the specified network interface in a virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @param virtualmachineIndex The virtual machine index. - * @param networkInterfaceName The name of the network interface. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network interface in a virtual machine scale set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getVirtualMachineScaleSetNetworkInterfaceAsync( - String resourceGroupName, - String virtualMachineScaleSetName, - String virtualmachineIndex, - String networkInterfaceName); - - /** - * Get the specified network interface in a virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @param virtualmachineIndex The virtual machine index. - * @param networkInterfaceName The name of the network interface. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network interface in a virtual machine scale set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - NetworkInterfaceInner getVirtualMachineScaleSetNetworkInterface( - String resourceGroupName, - String virtualMachineScaleSetName, - String virtualmachineIndex, - String networkInterfaceName); - - /** - * Get the specified network interface in a virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @param virtualmachineIndex The virtual machine index. - * @param networkInterfaceName The name of the network interface. - * @param expand Expands referenced resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network interface in a virtual machine scale set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getVirtualMachineScaleSetNetworkInterfaceWithResponse( - String resourceGroupName, - String virtualMachineScaleSetName, - String virtualmachineIndex, - String networkInterfaceName, - String expand, - Context context); - - /** - * Get the specified network interface ip configuration in a virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @param virtualmachineIndex The virtual machine index. - * @param networkInterfaceName The name of the network interface. - * @param expand Expands referenced resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network interface ip configuration in a virtual machine scale set. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listVirtualMachineScaleSetIpConfigurationsAsync( - String resourceGroupName, - String virtualMachineScaleSetName, - String virtualmachineIndex, - String networkInterfaceName, - String expand); - - /** - * Get the specified network interface ip configuration in a virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @param virtualmachineIndex The virtual machine index. - * @param networkInterfaceName The name of the network interface. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network interface ip configuration in a virtual machine scale set. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listVirtualMachineScaleSetIpConfigurationsAsync( - String resourceGroupName, - String virtualMachineScaleSetName, - String virtualmachineIndex, - String networkInterfaceName); - - /** - * Get the specified network interface ip configuration in a virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @param virtualmachineIndex The virtual machine index. - * @param networkInterfaceName The name of the network interface. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network interface ip configuration in a virtual machine scale set. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listVirtualMachineScaleSetIpConfigurations( - String resourceGroupName, - String virtualMachineScaleSetName, - String virtualmachineIndex, - String networkInterfaceName); - - /** - * Get the specified network interface ip configuration in a virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @param virtualmachineIndex The virtual machine index. - * @param networkInterfaceName The name of the network interface. - * @param expand Expands referenced resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network interface ip configuration in a virtual machine scale set. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listVirtualMachineScaleSetIpConfigurations( - String resourceGroupName, - String virtualMachineScaleSetName, - String virtualmachineIndex, - String networkInterfaceName, - String expand, - Context context); - - /** - * Get the specified network interface ip configuration in a virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @param virtualmachineIndex The virtual machine index. - * @param networkInterfaceName The name of the network interface. - * @param ipConfigurationName The name of the ip configuration. - * @param expand Expands referenced resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network interface ip configuration in a virtual machine scale set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getVirtualMachineScaleSetIpConfigurationWithResponseAsync( - String resourceGroupName, - String virtualMachineScaleSetName, - String virtualmachineIndex, - String networkInterfaceName, - String ipConfigurationName, - String expand); - - /** - * Get the specified network interface ip configuration in a virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @param virtualmachineIndex The virtual machine index. - * @param networkInterfaceName The name of the network interface. - * @param ipConfigurationName The name of the ip configuration. - * @param expand Expands referenced resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network interface ip configuration in a virtual machine scale set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getVirtualMachineScaleSetIpConfigurationAsync( - String resourceGroupName, - String virtualMachineScaleSetName, - String virtualmachineIndex, - String networkInterfaceName, - String ipConfigurationName, - String expand); - - /** - * Get the specified network interface ip configuration in a virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @param virtualmachineIndex The virtual machine index. - * @param networkInterfaceName The name of the network interface. - * @param ipConfigurationName The name of the ip configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network interface ip configuration in a virtual machine scale set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getVirtualMachineScaleSetIpConfigurationAsync( - String resourceGroupName, - String virtualMachineScaleSetName, - String virtualmachineIndex, - String networkInterfaceName, - String ipConfigurationName); - - /** - * Get the specified network interface ip configuration in a virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @param virtualmachineIndex The virtual machine index. - * @param networkInterfaceName The name of the network interface. - * @param ipConfigurationName The name of the ip configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network interface ip configuration in a virtual machine scale set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - NetworkInterfaceIpConfigurationInner getVirtualMachineScaleSetIpConfiguration( - String resourceGroupName, - String virtualMachineScaleSetName, - String virtualmachineIndex, - String networkInterfaceName, - String ipConfigurationName); - - /** - * Get the specified network interface ip configuration in a virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @param virtualmachineIndex The virtual machine index. - * @param networkInterfaceName The name of the network interface. - * @param ipConfigurationName The name of the ip configuration. - * @param expand Expands referenced resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network interface ip configuration in a virtual machine scale set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getVirtualMachineScaleSetIpConfigurationWithResponse( - String resourceGroupName, - String virtualMachineScaleSetName, - String virtualmachineIndex, - String networkInterfaceName, - String ipConfigurationName, - String expand, - Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/NetworkManagementClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/NetworkManagementClient.java deleted file mode 100644 index 0ba19ed30cd7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/NetworkManagementClient.java +++ /dev/null @@ -1,638 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.network.fluent.models.DnsNameAvailabilityResultInner; -import com.azure.resourcemanager.network.fluent.models.VirtualWanSecurityProvidersInner; -import java.time.Duration; -import reactor.core.publisher.Mono; - -/** The interface for NetworkManagementClient class. */ -public interface NetworkManagementClient { - /** - * Gets The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID - * forms part of the URI for every service call. - * - * @return the subscriptionId value. - */ - String getSubscriptionId(); - - /** - * Gets server parameter. - * - * @return the endpoint value. - */ - String getEndpoint(); - - /** - * Gets The HTTP pipeline to send requests through. - * - * @return the httpPipeline value. - */ - HttpPipeline getHttpPipeline(); - - /** - * Gets The default poll interval for long-running operation. - * - * @return the defaultPollInterval value. - */ - Duration getDefaultPollInterval(); - - /** - * Gets the ApplicationGatewaysClient object to access its operations. - * - * @return the ApplicationGatewaysClient object. - */ - ApplicationGatewaysClient getApplicationGateways(); - - /** - * Gets the ApplicationSecurityGroupsClient object to access its operations. - * - * @return the ApplicationSecurityGroupsClient object. - */ - ApplicationSecurityGroupsClient getApplicationSecurityGroups(); - - /** - * Gets the AvailableDelegationsClient object to access its operations. - * - * @return the AvailableDelegationsClient object. - */ - AvailableDelegationsClient getAvailableDelegations(); - - /** - * Gets the AvailableResourceGroupDelegationsClient object to access its operations. - * - * @return the AvailableResourceGroupDelegationsClient object. - */ - AvailableResourceGroupDelegationsClient getAvailableResourceGroupDelegations(); - - /** - * Gets the AzureFirewallsClient object to access its operations. - * - * @return the AzureFirewallsClient object. - */ - AzureFirewallsClient getAzureFirewalls(); - - /** - * Gets the AzureFirewallFqdnTagsClient object to access its operations. - * - * @return the AzureFirewallFqdnTagsClient object. - */ - AzureFirewallFqdnTagsClient getAzureFirewallFqdnTags(); - - /** - * Gets the DdosCustomPoliciesClient object to access its operations. - * - * @return the DdosCustomPoliciesClient object. - */ - DdosCustomPoliciesClient getDdosCustomPolicies(); - - /** - * Gets the DdosProtectionPlansClient object to access its operations. - * - * @return the DdosProtectionPlansClient object. - */ - DdosProtectionPlansClient getDdosProtectionPlans(); - - /** - * Gets the AvailableEndpointServicesClient object to access its operations. - * - * @return the AvailableEndpointServicesClient object. - */ - AvailableEndpointServicesClient getAvailableEndpointServices(); - - /** - * Gets the ExpressRouteCircuitAuthorizationsClient object to access its operations. - * - * @return the ExpressRouteCircuitAuthorizationsClient object. - */ - ExpressRouteCircuitAuthorizationsClient getExpressRouteCircuitAuthorizations(); - - /** - * Gets the ExpressRouteCircuitPeeringsClient object to access its operations. - * - * @return the ExpressRouteCircuitPeeringsClient object. - */ - ExpressRouteCircuitPeeringsClient getExpressRouteCircuitPeerings(); - - /** - * Gets the ExpressRouteCircuitConnectionsClient object to access its operations. - * - * @return the ExpressRouteCircuitConnectionsClient object. - */ - ExpressRouteCircuitConnectionsClient getExpressRouteCircuitConnections(); - - /** - * Gets the ExpressRouteCircuitsClient object to access its operations. - * - * @return the ExpressRouteCircuitsClient object. - */ - ExpressRouteCircuitsClient getExpressRouteCircuits(); - - /** - * Gets the ExpressRouteServiceProvidersClient object to access its operations. - * - * @return the ExpressRouteServiceProvidersClient object. - */ - ExpressRouteServiceProvidersClient getExpressRouteServiceProviders(); - - /** - * Gets the ExpressRouteCrossConnectionsClient object to access its operations. - * - * @return the ExpressRouteCrossConnectionsClient object. - */ - ExpressRouteCrossConnectionsClient getExpressRouteCrossConnections(); - - /** - * Gets the ExpressRouteCrossConnectionPeeringsClient object to access its operations. - * - * @return the ExpressRouteCrossConnectionPeeringsClient object. - */ - ExpressRouteCrossConnectionPeeringsClient getExpressRouteCrossConnectionPeerings(); - - /** - * Gets the ExpressRouteGatewaysClient object to access its operations. - * - * @return the ExpressRouteGatewaysClient object. - */ - ExpressRouteGatewaysClient getExpressRouteGateways(); - - /** - * Gets the ExpressRouteConnectionsClient object to access its operations. - * - * @return the ExpressRouteConnectionsClient object. - */ - ExpressRouteConnectionsClient getExpressRouteConnections(); - - /** - * Gets the ExpressRoutePortsLocationsClient object to access its operations. - * - * @return the ExpressRoutePortsLocationsClient object. - */ - ExpressRoutePortsLocationsClient getExpressRoutePortsLocations(); - - /** - * Gets the ExpressRoutePortsClient object to access its operations. - * - * @return the ExpressRoutePortsClient object. - */ - ExpressRoutePortsClient getExpressRoutePorts(); - - /** - * Gets the ExpressRouteLinksClient object to access its operations. - * - * @return the ExpressRouteLinksClient object. - */ - ExpressRouteLinksClient getExpressRouteLinks(); - - /** - * Gets the InterfaceEndpointsClient object to access its operations. - * - * @return the InterfaceEndpointsClient object. - */ - InterfaceEndpointsClient getInterfaceEndpoints(); - - /** - * Gets the LoadBalancersClient object to access its operations. - * - * @return the LoadBalancersClient object. - */ - LoadBalancersClient getLoadBalancers(); - - /** - * Gets the LoadBalancerBackendAddressPoolsClient object to access its operations. - * - * @return the LoadBalancerBackendAddressPoolsClient object. - */ - LoadBalancerBackendAddressPoolsClient getLoadBalancerBackendAddressPools(); - - /** - * Gets the LoadBalancerFrontendIpConfigurationsClient object to access its operations. - * - * @return the LoadBalancerFrontendIpConfigurationsClient object. - */ - LoadBalancerFrontendIpConfigurationsClient getLoadBalancerFrontendIpConfigurations(); - - /** - * Gets the InboundNatRulesClient object to access its operations. - * - * @return the InboundNatRulesClient object. - */ - InboundNatRulesClient getInboundNatRules(); - - /** - * Gets the LoadBalancerLoadBalancingRulesClient object to access its operations. - * - * @return the LoadBalancerLoadBalancingRulesClient object. - */ - LoadBalancerLoadBalancingRulesClient getLoadBalancerLoadBalancingRules(); - - /** - * Gets the LoadBalancerOutboundRulesClient object to access its operations. - * - * @return the LoadBalancerOutboundRulesClient object. - */ - LoadBalancerOutboundRulesClient getLoadBalancerOutboundRules(); - - /** - * Gets the LoadBalancerNetworkInterfacesClient object to access its operations. - * - * @return the LoadBalancerNetworkInterfacesClient object. - */ - LoadBalancerNetworkInterfacesClient getLoadBalancerNetworkInterfaces(); - - /** - * Gets the LoadBalancerProbesClient object to access its operations. - * - * @return the LoadBalancerProbesClient object. - */ - LoadBalancerProbesClient getLoadBalancerProbes(); - - /** - * Gets the NetworkInterfacesClient object to access its operations. - * - * @return the NetworkInterfacesClient object. - */ - NetworkInterfacesClient getNetworkInterfaces(); - - /** - * Gets the NetworkInterfaceIpConfigurationsClient object to access its operations. - * - * @return the NetworkInterfaceIpConfigurationsClient object. - */ - NetworkInterfaceIpConfigurationsClient getNetworkInterfaceIpConfigurations(); - - /** - * Gets the NetworkInterfaceLoadBalancersClient object to access its operations. - * - * @return the NetworkInterfaceLoadBalancersClient object. - */ - NetworkInterfaceLoadBalancersClient getNetworkInterfaceLoadBalancers(); - - /** - * Gets the NetworkInterfaceTapConfigurationsClient object to access its operations. - * - * @return the NetworkInterfaceTapConfigurationsClient object. - */ - NetworkInterfaceTapConfigurationsClient getNetworkInterfaceTapConfigurations(); - - /** - * Gets the NetworkProfilesClient object to access its operations. - * - * @return the NetworkProfilesClient object. - */ - NetworkProfilesClient getNetworkProfiles(); - - /** - * Gets the NetworkSecurityGroupsClient object to access its operations. - * - * @return the NetworkSecurityGroupsClient object. - */ - NetworkSecurityGroupsClient getNetworkSecurityGroups(); - - /** - * Gets the SecurityRulesClient object to access its operations. - * - * @return the SecurityRulesClient object. - */ - SecurityRulesClient getSecurityRules(); - - /** - * Gets the DefaultSecurityRulesClient object to access its operations. - * - * @return the DefaultSecurityRulesClient object. - */ - DefaultSecurityRulesClient getDefaultSecurityRules(); - - /** - * Gets the NetworkWatchersClient object to access its operations. - * - * @return the NetworkWatchersClient object. - */ - NetworkWatchersClient getNetworkWatchers(); - - /** - * Gets the PacketCapturesClient object to access its operations. - * - * @return the PacketCapturesClient object. - */ - PacketCapturesClient getPacketCaptures(); - - /** - * Gets the ConnectionMonitorsClient object to access its operations. - * - * @return the ConnectionMonitorsClient object. - */ - ConnectionMonitorsClient getConnectionMonitors(); - - /** - * Gets the OperationsClient object to access its operations. - * - * @return the OperationsClient object. - */ - OperationsClient getOperations(); - - /** - * Gets the PublicIpAddressesClient object to access its operations. - * - * @return the PublicIpAddressesClient object. - */ - PublicIpAddressesClient getPublicIpAddresses(); - - /** - * Gets the PublicIpPrefixesClient object to access its operations. - * - * @return the PublicIpPrefixesClient object. - */ - PublicIpPrefixesClient getPublicIpPrefixes(); - - /** - * Gets the RouteFiltersClient object to access its operations. - * - * @return the RouteFiltersClient object. - */ - RouteFiltersClient getRouteFilters(); - - /** - * Gets the RouteFilterRulesClient object to access its operations. - * - * @return the RouteFilterRulesClient object. - */ - RouteFilterRulesClient getRouteFilterRules(); - - /** - * Gets the RouteTablesClient object to access its operations. - * - * @return the RouteTablesClient object. - */ - RouteTablesClient getRouteTables(); - - /** - * Gets the RoutesClient object to access its operations. - * - * @return the RoutesClient object. - */ - RoutesClient getRoutes(); - - /** - * Gets the BgpServiceCommunitiesClient object to access its operations. - * - * @return the BgpServiceCommunitiesClient object. - */ - BgpServiceCommunitiesClient getBgpServiceCommunities(); - - /** - * Gets the ServiceEndpointPoliciesClient object to access its operations. - * - * @return the ServiceEndpointPoliciesClient object. - */ - ServiceEndpointPoliciesClient getServiceEndpointPolicies(); - - /** - * Gets the ServiceEndpointPolicyDefinitionsClient object to access its operations. - * - * @return the ServiceEndpointPolicyDefinitionsClient object. - */ - ServiceEndpointPolicyDefinitionsClient getServiceEndpointPolicyDefinitions(); - - /** - * Gets the UsagesClient object to access its operations. - * - * @return the UsagesClient object. - */ - UsagesClient getUsages(); - - /** - * Gets the VirtualNetworksClient object to access its operations. - * - * @return the VirtualNetworksClient object. - */ - VirtualNetworksClient getVirtualNetworks(); - - /** - * Gets the SubnetsClient object to access its operations. - * - * @return the SubnetsClient object. - */ - SubnetsClient getSubnets(); - - /** - * Gets the VirtualNetworkPeeringsClient object to access its operations. - * - * @return the VirtualNetworkPeeringsClient object. - */ - VirtualNetworkPeeringsClient getVirtualNetworkPeerings(); - - /** - * Gets the VirtualNetworkGatewaysClient object to access its operations. - * - * @return the VirtualNetworkGatewaysClient object. - */ - VirtualNetworkGatewaysClient getVirtualNetworkGateways(); - - /** - * Gets the VirtualNetworkGatewayConnectionsClient object to access its operations. - * - * @return the VirtualNetworkGatewayConnectionsClient object. - */ - VirtualNetworkGatewayConnectionsClient getVirtualNetworkGatewayConnections(); - - /** - * Gets the LocalNetworkGatewaysClient object to access its operations. - * - * @return the LocalNetworkGatewaysClient object. - */ - LocalNetworkGatewaysClient getLocalNetworkGateways(); - - /** - * Gets the VirtualNetworkTapsClient object to access its operations. - * - * @return the VirtualNetworkTapsClient object. - */ - VirtualNetworkTapsClient getVirtualNetworkTaps(); - - /** - * Gets the VirtualWansClient object to access its operations. - * - * @return the VirtualWansClient object. - */ - VirtualWansClient getVirtualWans(); - - /** - * Gets the VpnSitesClient object to access its operations. - * - * @return the VpnSitesClient object. - */ - VpnSitesClient getVpnSites(); - - /** - * Gets the VpnSitesConfigurationsClient object to access its operations. - * - * @return the VpnSitesConfigurationsClient object. - */ - VpnSitesConfigurationsClient getVpnSitesConfigurations(); - - /** - * Gets the VirtualHubsClient object to access its operations. - * - * @return the VirtualHubsClient object. - */ - VirtualHubsClient getVirtualHubs(); - - /** - * Gets the HubVirtualNetworkConnectionsClient object to access its operations. - * - * @return the HubVirtualNetworkConnectionsClient object. - */ - HubVirtualNetworkConnectionsClient getHubVirtualNetworkConnections(); - - /** - * Gets the VpnGatewaysClient object to access its operations. - * - * @return the VpnGatewaysClient object. - */ - VpnGatewaysClient getVpnGateways(); - - /** - * Gets the VpnConnectionsClient object to access its operations. - * - * @return the VpnConnectionsClient object. - */ - VpnConnectionsClient getVpnConnections(); - - /** - * Gets the P2SVpnServerConfigurationsClient object to access its operations. - * - * @return the P2SVpnServerConfigurationsClient object. - */ - P2SVpnServerConfigurationsClient getP2SVpnServerConfigurations(); - - /** - * Gets the P2SVpnGatewaysClient object to access its operations. - * - * @return the P2SVpnGatewaysClient object. - */ - P2SVpnGatewaysClient getP2SVpnGateways(); - - /** - * Checks whether a domain name in the cloudapp.azure.com zone is available for use. - * - * @param location The location of the domain name. - * @param domainNameLabel The domain name to be verified. It must conform to the following regular expression: - * ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the CheckDnsNameAvailability API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> checkDnsNameAvailabilityWithResponseAsync( - String location, String domainNameLabel); - - /** - * Checks whether a domain name in the cloudapp.azure.com zone is available for use. - * - * @param location The location of the domain name. - * @param domainNameLabel The domain name to be verified. It must conform to the following regular expression: - * ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the CheckDnsNameAvailability API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono checkDnsNameAvailabilityAsync(String location, String domainNameLabel); - - /** - * Checks whether a domain name in the cloudapp.azure.com zone is available for use. - * - * @param location The location of the domain name. - * @param domainNameLabel The domain name to be verified. It must conform to the following regular expression: - * ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the CheckDnsNameAvailability API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DnsNameAvailabilityResultInner checkDnsNameAvailability(String location, String domainNameLabel); - - /** - * Checks whether a domain name in the cloudapp.azure.com zone is available for use. - * - * @param location The location of the domain name. - * @param domainNameLabel The domain name to be verified. It must conform to the following regular expression: - * ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the CheckDnsNameAvailability API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response checkDnsNameAvailabilityWithResponse( - String location, String domainNameLabel, Context context); - - /** - * Gives the supported security providers for the virtual wan. - * - * @param resourceGroupName The resource group name. - * @param virtualWanName The name of the VirtualWAN for which supported security providers are needed. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of SecurityProviders. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> supportedSecurityProvidersWithResponseAsync( - String resourceGroupName, String virtualWanName); - - /** - * Gives the supported security providers for the virtual wan. - * - * @param resourceGroupName The resource group name. - * @param virtualWanName The name of the VirtualWAN for which supported security providers are needed. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of SecurityProviders. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono supportedSecurityProvidersAsync( - String resourceGroupName, String virtualWanName); - - /** - * Gives the supported security providers for the virtual wan. - * - * @param resourceGroupName The resource group name. - * @param virtualWanName The name of the VirtualWAN for which supported security providers are needed. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of SecurityProviders. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualWanSecurityProvidersInner supportedSecurityProviders(String resourceGroupName, String virtualWanName); - - /** - * Gives the supported security providers for the virtual wan. - * - * @param resourceGroupName The resource group name. - * @param virtualWanName The name of the VirtualWAN for which supported security providers are needed. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of SecurityProviders. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response supportedSecurityProvidersWithResponse( - String resourceGroupName, String virtualWanName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/NetworkProfilesClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/NetworkProfilesClient.java deleted file mode 100644 index 75f699063842..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/NetworkProfilesClient.java +++ /dev/null @@ -1,383 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.models.NetworkProfileInner; -import com.azure.resourcemanager.network.models.TagsObject; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in NetworkProfilesClient. */ -public interface NetworkProfilesClient - extends InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete { - /** - * Deletes the specified network profile. - * - * @param resourceGroupName The name of the resource group. - * @param networkProfileName The name of the NetworkProfile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync(String resourceGroupName, String networkProfileName); - - /** - * Deletes the specified network profile. - * - * @param resourceGroupName The name of the resource group. - * @param networkProfileName The name of the NetworkProfile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String networkProfileName); - - /** - * Deletes the specified network profile. - * - * @param resourceGroupName The name of the resource group. - * @param networkProfileName The name of the NetworkProfile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String networkProfileName); - - /** - * Deletes the specified network profile. - * - * @param resourceGroupName The name of the resource group. - * @param networkProfileName The name of the NetworkProfile. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String networkProfileName, Context context); - - /** - * Deletes the specified network profile. - * - * @param resourceGroupName The name of the resource group. - * @param networkProfileName The name of the NetworkProfile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String networkProfileName); - - /** - * Deletes the specified network profile. - * - * @param resourceGroupName The name of the resource group. - * @param networkProfileName The name of the NetworkProfile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String networkProfileName); - - /** - * Deletes the specified network profile. - * - * @param resourceGroupName The name of the resource group. - * @param networkProfileName The name of the NetworkProfile. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String networkProfileName, Context context); - - /** - * Gets the specified network profile in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param networkProfileName The name of the PublicIPPrefix. - * @param expand Expands referenced resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network profile in a specified resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String networkProfileName, String expand); - - /** - * Gets the specified network profile in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param networkProfileName The name of the PublicIPPrefix. - * @param expand Expands referenced resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network profile in a specified resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync( - String resourceGroupName, String networkProfileName, String expand); - - /** - * Gets the specified network profile in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param networkProfileName The name of the PublicIPPrefix. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network profile in a specified resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync(String resourceGroupName, String networkProfileName); - - /** - * Gets the specified network profile in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param networkProfileName The name of the PublicIPPrefix. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network profile in a specified resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - NetworkProfileInner getByResourceGroup(String resourceGroupName, String networkProfileName); - - /** - * Gets the specified network profile in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param networkProfileName The name of the PublicIPPrefix. - * @param expand Expands referenced resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network profile in a specified resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String networkProfileName, String expand, Context context); - - /** - * Creates or updates a network profile. - * - * @param resourceGroupName The name of the resource group. - * @param networkProfileName The name of the network profile. - * @param parameters Parameters supplied to the create or update network profile operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return network profile resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String networkProfileName, NetworkProfileInner parameters); - - /** - * Creates or updates a network profile. - * - * @param resourceGroupName The name of the resource group. - * @param networkProfileName The name of the network profile. - * @param parameters Parameters supplied to the create or update network profile operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return network profile resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, String networkProfileName, NetworkProfileInner parameters); - - /** - * Creates or updates a network profile. - * - * @param resourceGroupName The name of the resource group. - * @param networkProfileName The name of the network profile. - * @param parameters Parameters supplied to the create or update network profile operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return network profile resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - NetworkProfileInner createOrUpdate( - String resourceGroupName, String networkProfileName, NetworkProfileInner parameters); - - /** - * Creates or updates a network profile. - * - * @param resourceGroupName The name of the resource group. - * @param networkProfileName The name of the network profile. - * @param parameters Parameters supplied to the create or update network profile operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return network profile resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, String networkProfileName, NetworkProfileInner parameters, Context context); - - /** - * Updates network profile tags. - * - * @param resourceGroupName The name of the resource group. - * @param networkProfileName The name of the network profile. - * @param parameters Parameters supplied to update network profile tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return network profile resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateTagsWithResponseAsync( - String resourceGroupName, String networkProfileName, TagsObject parameters); - - /** - * Updates network profile tags. - * - * @param resourceGroupName The name of the resource group. - * @param networkProfileName The name of the network profile. - * @param parameters Parameters supplied to update network profile tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return network profile resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateTagsAsync( - String resourceGroupName, String networkProfileName, TagsObject parameters); - - /** - * Updates network profile tags. - * - * @param resourceGroupName The name of the resource group. - * @param networkProfileName The name of the network profile. - * @param parameters Parameters supplied to update network profile tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return network profile resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - NetworkProfileInner updateTags(String resourceGroupName, String networkProfileName, TagsObject parameters); - - /** - * Updates network profile tags. - * - * @param resourceGroupName The name of the resource group. - * @param networkProfileName The name of the network profile. - * @param parameters Parameters supplied to update network profile tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return network profile resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateTagsWithResponse( - String resourceGroupName, String networkProfileName, TagsObject parameters, Context context); - - /** - * Gets all the network profiles in a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the network profiles in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Gets all the network profiles in a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the network profiles in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Gets all the network profiles in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the network profiles in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Gets all network profiles in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network profiles in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName); - - /** - * Gets all network profiles in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network profiles in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Gets all network profiles in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network profiles in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/NetworkSecurityGroupsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/NetworkSecurityGroupsClient.java deleted file mode 100644 index 5a8cf1243546..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/NetworkSecurityGroupsClient.java +++ /dev/null @@ -1,482 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.models.NetworkSecurityGroupInner; -import com.azure.resourcemanager.network.models.TagsObject; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in NetworkSecurityGroupsClient. */ -public interface NetworkSecurityGroupsClient - extends InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete { - /** - * Deletes the specified network security group. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync(String resourceGroupName, String networkSecurityGroupName); - - /** - * Deletes the specified network security group. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String networkSecurityGroupName); - - /** - * Deletes the specified network security group. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String networkSecurityGroupName); - - /** - * Deletes the specified network security group. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String networkSecurityGroupName, Context context); - - /** - * Deletes the specified network security group. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String networkSecurityGroupName); - - /** - * Deletes the specified network security group. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String networkSecurityGroupName); - - /** - * Deletes the specified network security group. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String networkSecurityGroupName, Context context); - - /** - * Gets the specified network security group. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param expand Expands referenced resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network security group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String networkSecurityGroupName, String expand); - - /** - * Gets the specified network security group. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param expand Expands referenced resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network security group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync( - String resourceGroupName, String networkSecurityGroupName, String expand); - - /** - * Gets the specified network security group. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network security group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync(String resourceGroupName, String networkSecurityGroupName); - - /** - * Gets the specified network security group. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network security group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - NetworkSecurityGroupInner getByResourceGroup(String resourceGroupName, String networkSecurityGroupName); - - /** - * Gets the specified network security group. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param expand Expands referenced resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network security group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String networkSecurityGroupName, String expand, Context context); - - /** - * Creates or updates a network security group in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param parameters Parameters supplied to the create or update network security group operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return networkSecurityGroup resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String networkSecurityGroupName, NetworkSecurityGroupInner parameters); - - /** - * Creates or updates a network security group in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param parameters Parameters supplied to the create or update network security group operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return networkSecurityGroup resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, NetworkSecurityGroupInner> beginCreateOrUpdateAsync( - String resourceGroupName, String networkSecurityGroupName, NetworkSecurityGroupInner parameters); - - /** - * Creates or updates a network security group in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param parameters Parameters supplied to the create or update network security group operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return networkSecurityGroup resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, NetworkSecurityGroupInner> beginCreateOrUpdate( - String resourceGroupName, String networkSecurityGroupName, NetworkSecurityGroupInner parameters); - - /** - * Creates or updates a network security group in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param parameters Parameters supplied to the create or update network security group operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return networkSecurityGroup resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, NetworkSecurityGroupInner> beginCreateOrUpdate( - String resourceGroupName, - String networkSecurityGroupName, - NetworkSecurityGroupInner parameters, - Context context); - - /** - * Creates or updates a network security group in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param parameters Parameters supplied to the create or update network security group operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return networkSecurityGroup resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, String networkSecurityGroupName, NetworkSecurityGroupInner parameters); - - /** - * Creates or updates a network security group in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param parameters Parameters supplied to the create or update network security group operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return networkSecurityGroup resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - NetworkSecurityGroupInner createOrUpdate( - String resourceGroupName, String networkSecurityGroupName, NetworkSecurityGroupInner parameters); - - /** - * Creates or updates a network security group in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param parameters Parameters supplied to the create or update network security group operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return networkSecurityGroup resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - NetworkSecurityGroupInner createOrUpdate( - String resourceGroupName, - String networkSecurityGroupName, - NetworkSecurityGroupInner parameters, - Context context); - - /** - * Updates a network security group tags. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param parameters Parameters supplied to update network security group tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return networkSecurityGroup resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> updateTagsWithResponseAsync( - String resourceGroupName, String networkSecurityGroupName, TagsObject parameters); - - /** - * Updates a network security group tags. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param parameters Parameters supplied to update network security group tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return networkSecurityGroup resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, NetworkSecurityGroupInner> beginUpdateTagsAsync( - String resourceGroupName, String networkSecurityGroupName, TagsObject parameters); - - /** - * Updates a network security group tags. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param parameters Parameters supplied to update network security group tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return networkSecurityGroup resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, NetworkSecurityGroupInner> beginUpdateTags( - String resourceGroupName, String networkSecurityGroupName, TagsObject parameters); - - /** - * Updates a network security group tags. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param parameters Parameters supplied to update network security group tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return networkSecurityGroup resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, NetworkSecurityGroupInner> beginUpdateTags( - String resourceGroupName, String networkSecurityGroupName, TagsObject parameters, Context context); - - /** - * Updates a network security group tags. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param parameters Parameters supplied to update network security group tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return networkSecurityGroup resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateTagsAsync( - String resourceGroupName, String networkSecurityGroupName, TagsObject parameters); - - /** - * Updates a network security group tags. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param parameters Parameters supplied to update network security group tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return networkSecurityGroup resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - NetworkSecurityGroupInner updateTags( - String resourceGroupName, String networkSecurityGroupName, TagsObject parameters); - - /** - * Updates a network security group tags. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param parameters Parameters supplied to update network security group tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return networkSecurityGroup resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - NetworkSecurityGroupInner updateTags( - String resourceGroupName, String networkSecurityGroupName, TagsObject parameters, Context context); - - /** - * Gets all network security groups in a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network security groups in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Gets all network security groups in a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network security groups in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Gets all network security groups in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network security groups in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Gets all network security groups in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network security groups in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName); - - /** - * Gets all network security groups in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network security groups in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Gets all network security groups in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network security groups in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/NetworkWatchersClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/NetworkWatchersClient.java deleted file mode 100644 index 49116b071ec1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/NetworkWatchersClient.java +++ /dev/null @@ -1,1658 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.models.AvailableProvidersListInner; -import com.azure.resourcemanager.network.fluent.models.AzureReachabilityReportInner; -import com.azure.resourcemanager.network.fluent.models.ConnectivityInformationInner; -import com.azure.resourcemanager.network.fluent.models.FlowLogInformationInner; -import com.azure.resourcemanager.network.fluent.models.NetworkConfigurationDiagnosticResponseInner; -import com.azure.resourcemanager.network.fluent.models.NetworkWatcherInner; -import com.azure.resourcemanager.network.fluent.models.NextHopResultInner; -import com.azure.resourcemanager.network.fluent.models.SecurityGroupViewResultInner; -import com.azure.resourcemanager.network.fluent.models.TopologyInner; -import com.azure.resourcemanager.network.fluent.models.TroubleshootingResultInner; -import com.azure.resourcemanager.network.fluent.models.VerificationIpFlowResultInner; -import com.azure.resourcemanager.network.models.AvailableProvidersListParameters; -import com.azure.resourcemanager.network.models.AzureReachabilityReportParameters; -import com.azure.resourcemanager.network.models.ConnectivityParameters; -import com.azure.resourcemanager.network.models.FlowLogStatusParameters; -import com.azure.resourcemanager.network.models.NetworkConfigurationDiagnosticParameters; -import com.azure.resourcemanager.network.models.NextHopParameters; -import com.azure.resourcemanager.network.models.QueryTroubleshootingParameters; -import com.azure.resourcemanager.network.models.SecurityGroupViewParameters; -import com.azure.resourcemanager.network.models.TagsObject; -import com.azure.resourcemanager.network.models.TopologyParameters; -import com.azure.resourcemanager.network.models.TroubleshootingParameters; -import com.azure.resourcemanager.network.models.VerificationIpFlowParameters; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in NetworkWatchersClient. */ -public interface NetworkWatchersClient - extends InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete { - /** - * Creates or updates a network watcher in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters that define the network watcher resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return network watcher in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String networkWatcherName, NetworkWatcherInner parameters); - - /** - * Creates or updates a network watcher in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters that define the network watcher resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return network watcher in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, String networkWatcherName, NetworkWatcherInner parameters); - - /** - * Creates or updates a network watcher in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters that define the network watcher resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return network watcher in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - NetworkWatcherInner createOrUpdate( - String resourceGroupName, String networkWatcherName, NetworkWatcherInner parameters); - - /** - * Creates or updates a network watcher in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters that define the network watcher resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return network watcher in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, String networkWatcherName, NetworkWatcherInner parameters, Context context); - - /** - * Gets the specified network watcher by resource group. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network watcher by resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String networkWatcherName); - - /** - * Gets the specified network watcher by resource group. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network watcher by resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync(String resourceGroupName, String networkWatcherName); - - /** - * Gets the specified network watcher by resource group. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network watcher by resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - NetworkWatcherInner getByResourceGroup(String resourceGroupName, String networkWatcherName); - - /** - * Gets the specified network watcher by resource group. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network watcher by resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String networkWatcherName, Context context); - - /** - * Deletes the specified network watcher resource. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync(String resourceGroupName, String networkWatcherName); - - /** - * Deletes the specified network watcher resource. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String networkWatcherName); - - /** - * Deletes the specified network watcher resource. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String networkWatcherName); - - /** - * Deletes the specified network watcher resource. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String networkWatcherName, Context context); - - /** - * Deletes the specified network watcher resource. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String networkWatcherName); - - /** - * Deletes the specified network watcher resource. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String networkWatcherName); - - /** - * Deletes the specified network watcher resource. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String networkWatcherName, Context context); - - /** - * Updates a network watcher tags. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters supplied to update network watcher tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return network watcher in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateTagsWithResponseAsync( - String resourceGroupName, String networkWatcherName, TagsObject parameters); - - /** - * Updates a network watcher tags. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters supplied to update network watcher tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return network watcher in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateTagsAsync( - String resourceGroupName, String networkWatcherName, TagsObject parameters); - - /** - * Updates a network watcher tags. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters supplied to update network watcher tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return network watcher in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - NetworkWatcherInner updateTags(String resourceGroupName, String networkWatcherName, TagsObject parameters); - - /** - * Updates a network watcher tags. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters supplied to update network watcher tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return network watcher in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateTagsWithResponse( - String resourceGroupName, String networkWatcherName, TagsObject parameters, Context context); - - /** - * Gets all network watchers by resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network watchers by resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName); - - /** - * Gets all network watchers by resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network watchers by resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Gets all network watchers by resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network watchers by resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * Gets all network watchers by subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network watchers by subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Gets all network watchers by subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network watchers by subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Gets all network watchers by subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network watchers by subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Gets the current network topology by resource group. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters that define the representation of topology. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the current network topology by resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getTopologyWithResponseAsync( - String resourceGroupName, String networkWatcherName, TopologyParameters parameters); - - /** - * Gets the current network topology by resource group. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters that define the representation of topology. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the current network topology by resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getTopologyAsync( - String resourceGroupName, String networkWatcherName, TopologyParameters parameters); - - /** - * Gets the current network topology by resource group. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters that define the representation of topology. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the current network topology by resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - TopologyInner getTopology(String resourceGroupName, String networkWatcherName, TopologyParameters parameters); - - /** - * Gets the current network topology by resource group. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters that define the representation of topology. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the current network topology by resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getTopologyWithResponse( - String resourceGroupName, String networkWatcherName, TopologyParameters parameters, Context context); - - /** - * Verify IP flow from the specified VM to a location given the currently configured NSG rules. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters that define the IP flow to be verified. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return results of IP flow verification on the target resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> verifyIpFlowWithResponseAsync( - String resourceGroupName, String networkWatcherName, VerificationIpFlowParameters parameters); - - /** - * Verify IP flow from the specified VM to a location given the currently configured NSG rules. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters that define the IP flow to be verified. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return results of IP flow verification on the target resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, VerificationIpFlowResultInner> beginVerifyIpFlowAsync( - String resourceGroupName, String networkWatcherName, VerificationIpFlowParameters parameters); - - /** - * Verify IP flow from the specified VM to a location given the currently configured NSG rules. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters that define the IP flow to be verified. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return results of IP flow verification on the target resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VerificationIpFlowResultInner> beginVerifyIpFlow( - String resourceGroupName, String networkWatcherName, VerificationIpFlowParameters parameters); - - /** - * Verify IP flow from the specified VM to a location given the currently configured NSG rules. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters that define the IP flow to be verified. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return results of IP flow verification on the target resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VerificationIpFlowResultInner> beginVerifyIpFlow( - String resourceGroupName, String networkWatcherName, VerificationIpFlowParameters parameters, Context context); - - /** - * Verify IP flow from the specified VM to a location given the currently configured NSG rules. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters that define the IP flow to be verified. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return results of IP flow verification on the target resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono verifyIpFlowAsync( - String resourceGroupName, String networkWatcherName, VerificationIpFlowParameters parameters); - - /** - * Verify IP flow from the specified VM to a location given the currently configured NSG rules. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters that define the IP flow to be verified. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return results of IP flow verification on the target resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VerificationIpFlowResultInner verifyIpFlow( - String resourceGroupName, String networkWatcherName, VerificationIpFlowParameters parameters); - - /** - * Verify IP flow from the specified VM to a location given the currently configured NSG rules. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters that define the IP flow to be verified. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return results of IP flow verification on the target resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VerificationIpFlowResultInner verifyIpFlow( - String resourceGroupName, String networkWatcherName, VerificationIpFlowParameters parameters, Context context); - - /** - * Gets the next hop from the specified VM. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters that define the source and destination endpoint. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the next hop from the specified VM. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> getNextHopWithResponseAsync( - String resourceGroupName, String networkWatcherName, NextHopParameters parameters); - - /** - * Gets the next hop from the specified VM. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters that define the source and destination endpoint. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the next hop from the specified VM. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, NextHopResultInner> beginGetNextHopAsync( - String resourceGroupName, String networkWatcherName, NextHopParameters parameters); - - /** - * Gets the next hop from the specified VM. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters that define the source and destination endpoint. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the next hop from the specified VM. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, NextHopResultInner> beginGetNextHop( - String resourceGroupName, String networkWatcherName, NextHopParameters parameters); - - /** - * Gets the next hop from the specified VM. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters that define the source and destination endpoint. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the next hop from the specified VM. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, NextHopResultInner> beginGetNextHop( - String resourceGroupName, String networkWatcherName, NextHopParameters parameters, Context context); - - /** - * Gets the next hop from the specified VM. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters that define the source and destination endpoint. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the next hop from the specified VM. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getNextHopAsync( - String resourceGroupName, String networkWatcherName, NextHopParameters parameters); - - /** - * Gets the next hop from the specified VM. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters that define the source and destination endpoint. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the next hop from the specified VM. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - NextHopResultInner getNextHop(String resourceGroupName, String networkWatcherName, NextHopParameters parameters); - - /** - * Gets the next hop from the specified VM. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters that define the source and destination endpoint. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the next hop from the specified VM. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - NextHopResultInner getNextHop( - String resourceGroupName, String networkWatcherName, NextHopParameters parameters, Context context); - - /** - * Gets the configured and effective security group rules on the specified VM. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters that define the VM to check security groups for. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the configured and effective security group rules on the specified VM. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> getVMSecurityRulesWithResponseAsync( - String resourceGroupName, String networkWatcherName, SecurityGroupViewParameters parameters); - - /** - * Gets the configured and effective security group rules on the specified VM. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters that define the VM to check security groups for. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the configured and effective security group rules on the specified VM. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, SecurityGroupViewResultInner> beginGetVMSecurityRulesAsync( - String resourceGroupName, String networkWatcherName, SecurityGroupViewParameters parameters); - - /** - * Gets the configured and effective security group rules on the specified VM. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters that define the VM to check security groups for. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the configured and effective security group rules on the specified VM. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, SecurityGroupViewResultInner> beginGetVMSecurityRules( - String resourceGroupName, String networkWatcherName, SecurityGroupViewParameters parameters); - - /** - * Gets the configured and effective security group rules on the specified VM. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters that define the VM to check security groups for. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the configured and effective security group rules on the specified VM. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, SecurityGroupViewResultInner> beginGetVMSecurityRules( - String resourceGroupName, String networkWatcherName, SecurityGroupViewParameters parameters, Context context); - - /** - * Gets the configured and effective security group rules on the specified VM. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters that define the VM to check security groups for. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the configured and effective security group rules on the specified VM. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getVMSecurityRulesAsync( - String resourceGroupName, String networkWatcherName, SecurityGroupViewParameters parameters); - - /** - * Gets the configured and effective security group rules on the specified VM. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters that define the VM to check security groups for. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the configured and effective security group rules on the specified VM. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SecurityGroupViewResultInner getVMSecurityRules( - String resourceGroupName, String networkWatcherName, SecurityGroupViewParameters parameters); - - /** - * Gets the configured and effective security group rules on the specified VM. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters that define the VM to check security groups for. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the configured and effective security group rules on the specified VM. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SecurityGroupViewResultInner getVMSecurityRules( - String resourceGroupName, String networkWatcherName, SecurityGroupViewParameters parameters, Context context); - - /** - * Initiate troubleshooting on a specified resource. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that define the resource to troubleshoot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return troubleshooting information gained from specified resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> getTroubleshootingWithResponseAsync( - String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters); - - /** - * Initiate troubleshooting on a specified resource. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that define the resource to troubleshoot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return troubleshooting information gained from specified resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, TroubleshootingResultInner> beginGetTroubleshootingAsync( - String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters); - - /** - * Initiate troubleshooting on a specified resource. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that define the resource to troubleshoot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return troubleshooting information gained from specified resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, TroubleshootingResultInner> beginGetTroubleshooting( - String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters); - - /** - * Initiate troubleshooting on a specified resource. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that define the resource to troubleshoot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return troubleshooting information gained from specified resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, TroubleshootingResultInner> beginGetTroubleshooting( - String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters, Context context); - - /** - * Initiate troubleshooting on a specified resource. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that define the resource to troubleshoot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return troubleshooting information gained from specified resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getTroubleshootingAsync( - String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters); - - /** - * Initiate troubleshooting on a specified resource. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that define the resource to troubleshoot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return troubleshooting information gained from specified resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - TroubleshootingResultInner getTroubleshooting( - String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters); - - /** - * Initiate troubleshooting on a specified resource. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that define the resource to troubleshoot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return troubleshooting information gained from specified resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - TroubleshootingResultInner getTroubleshooting( - String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters, Context context); - - /** - * Get the last completed troubleshooting result on a specified resource. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that define the resource to query the troubleshooting result. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the last completed troubleshooting result on a specified resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> getTroubleshootingResultWithResponseAsync( - String resourceGroupName, String networkWatcherName, QueryTroubleshootingParameters parameters); - - /** - * Get the last completed troubleshooting result on a specified resource. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that define the resource to query the troubleshooting result. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the last completed troubleshooting result on a specified resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, TroubleshootingResultInner> beginGetTroubleshootingResultAsync( - String resourceGroupName, String networkWatcherName, QueryTroubleshootingParameters parameters); - - /** - * Get the last completed troubleshooting result on a specified resource. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that define the resource to query the troubleshooting result. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the last completed troubleshooting result on a specified resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, TroubleshootingResultInner> beginGetTroubleshootingResult( - String resourceGroupName, String networkWatcherName, QueryTroubleshootingParameters parameters); - - /** - * Get the last completed troubleshooting result on a specified resource. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that define the resource to query the troubleshooting result. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the last completed troubleshooting result on a specified resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, TroubleshootingResultInner> beginGetTroubleshootingResult( - String resourceGroupName, - String networkWatcherName, - QueryTroubleshootingParameters parameters, - Context context); - - /** - * Get the last completed troubleshooting result on a specified resource. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that define the resource to query the troubleshooting result. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the last completed troubleshooting result on a specified resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getTroubleshootingResultAsync( - String resourceGroupName, String networkWatcherName, QueryTroubleshootingParameters parameters); - - /** - * Get the last completed troubleshooting result on a specified resource. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that define the resource to query the troubleshooting result. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the last completed troubleshooting result on a specified resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - TroubleshootingResultInner getTroubleshootingResult( - String resourceGroupName, String networkWatcherName, QueryTroubleshootingParameters parameters); - - /** - * Get the last completed troubleshooting result on a specified resource. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that define the resource to query the troubleshooting result. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the last completed troubleshooting result on a specified resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - TroubleshootingResultInner getTroubleshootingResult( - String resourceGroupName, - String networkWatcherName, - QueryTroubleshootingParameters parameters, - Context context); - - /** - * Configures flow log and traffic analytics (optional) on a specified resource. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that define the configuration of flow log. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information on the configuration of flow log and traffic analytics (optional). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> setFlowLogConfigurationWithResponseAsync( - String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters); - - /** - * Configures flow log and traffic analytics (optional) on a specified resource. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that define the configuration of flow log. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information on the configuration of flow log and traffic analytics (optional). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, FlowLogInformationInner> beginSetFlowLogConfigurationAsync( - String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters); - - /** - * Configures flow log and traffic analytics (optional) on a specified resource. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that define the configuration of flow log. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information on the configuration of flow log and traffic analytics (optional). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, FlowLogInformationInner> beginSetFlowLogConfiguration( - String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters); - - /** - * Configures flow log and traffic analytics (optional) on a specified resource. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that define the configuration of flow log. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information on the configuration of flow log and traffic analytics (optional). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, FlowLogInformationInner> beginSetFlowLogConfiguration( - String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters, Context context); - - /** - * Configures flow log and traffic analytics (optional) on a specified resource. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that define the configuration of flow log. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information on the configuration of flow log and traffic analytics (optional). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono setFlowLogConfigurationAsync( - String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters); - - /** - * Configures flow log and traffic analytics (optional) on a specified resource. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that define the configuration of flow log. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information on the configuration of flow log and traffic analytics (optional). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - FlowLogInformationInner setFlowLogConfiguration( - String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters); - - /** - * Configures flow log and traffic analytics (optional) on a specified resource. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that define the configuration of flow log. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information on the configuration of flow log and traffic analytics (optional). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - FlowLogInformationInner setFlowLogConfiguration( - String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters, Context context); - - /** - * Queries status of flow log and traffic analytics (optional) on a specified resource. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that define a resource to query flow log and traffic analytics (optional) status. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information on the configuration of flow log and traffic analytics (optional). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> getFlowLogStatusWithResponseAsync( - String resourceGroupName, String networkWatcherName, FlowLogStatusParameters parameters); - - /** - * Queries status of flow log and traffic analytics (optional) on a specified resource. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that define a resource to query flow log and traffic analytics (optional) status. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information on the configuration of flow log and traffic analytics (optional). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, FlowLogInformationInner> beginGetFlowLogStatusAsync( - String resourceGroupName, String networkWatcherName, FlowLogStatusParameters parameters); - - /** - * Queries status of flow log and traffic analytics (optional) on a specified resource. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that define a resource to query flow log and traffic analytics (optional) status. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information on the configuration of flow log and traffic analytics (optional). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, FlowLogInformationInner> beginGetFlowLogStatus( - String resourceGroupName, String networkWatcherName, FlowLogStatusParameters parameters); - - /** - * Queries status of flow log and traffic analytics (optional) on a specified resource. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that define a resource to query flow log and traffic analytics (optional) status. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information on the configuration of flow log and traffic analytics (optional). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, FlowLogInformationInner> beginGetFlowLogStatus( - String resourceGroupName, String networkWatcherName, FlowLogStatusParameters parameters, Context context); - - /** - * Queries status of flow log and traffic analytics (optional) on a specified resource. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that define a resource to query flow log and traffic analytics (optional) status. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information on the configuration of flow log and traffic analytics (optional). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getFlowLogStatusAsync( - String resourceGroupName, String networkWatcherName, FlowLogStatusParameters parameters); - - /** - * Queries status of flow log and traffic analytics (optional) on a specified resource. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that define a resource to query flow log and traffic analytics (optional) status. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information on the configuration of flow log and traffic analytics (optional). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - FlowLogInformationInner getFlowLogStatus( - String resourceGroupName, String networkWatcherName, FlowLogStatusParameters parameters); - - /** - * Queries status of flow log and traffic analytics (optional) on a specified resource. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that define a resource to query flow log and traffic analytics (optional) status. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information on the configuration of flow log and traffic analytics (optional). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - FlowLogInformationInner getFlowLogStatus( - String resourceGroupName, String networkWatcherName, FlowLogStatusParameters parameters, Context context); - - /** - * Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint - * including another VM or an arbitrary remote server. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that determine how the connectivity check will be performed. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information on the connectivity status. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> checkConnectivityWithResponseAsync( - String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters); - - /** - * Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint - * including another VM or an arbitrary remote server. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that determine how the connectivity check will be performed. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information on the connectivity status. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, ConnectivityInformationInner> beginCheckConnectivityAsync( - String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters); - - /** - * Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint - * including another VM or an arbitrary remote server. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that determine how the connectivity check will be performed. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information on the connectivity status. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ConnectivityInformationInner> beginCheckConnectivity( - String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters); - - /** - * Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint - * including another VM or an arbitrary remote server. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that determine how the connectivity check will be performed. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information on the connectivity status. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ConnectivityInformationInner> beginCheckConnectivity( - String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters, Context context); - - /** - * Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint - * including another VM or an arbitrary remote server. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that determine how the connectivity check will be performed. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information on the connectivity status. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono checkConnectivityAsync( - String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters); - - /** - * Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint - * including another VM or an arbitrary remote server. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that determine how the connectivity check will be performed. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information on the connectivity status. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ConnectivityInformationInner checkConnectivity( - String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters); - - /** - * Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint - * including another VM or an arbitrary remote server. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that determine how the connectivity check will be performed. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information on the connectivity status. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ConnectivityInformationInner checkConnectivity( - String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters, Context context); - - /** - * Gets the relative latency score for internet service providers from a specified location to Azure regions. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that determine Azure reachability report configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the relative latency score for internet service providers from a specified location to Azure regions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> getAzureReachabilityReportWithResponseAsync( - String resourceGroupName, String networkWatcherName, AzureReachabilityReportParameters parameters); - - /** - * Gets the relative latency score for internet service providers from a specified location to Azure regions. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that determine Azure reachability report configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the relative latency score for internet service providers from a specified location to Azure regions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, AzureReachabilityReportInner> - beginGetAzureReachabilityReportAsync( - String resourceGroupName, String networkWatcherName, AzureReachabilityReportParameters parameters); - - /** - * Gets the relative latency score for internet service providers from a specified location to Azure regions. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that determine Azure reachability report configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the relative latency score for internet service providers from a specified location to Azure regions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, AzureReachabilityReportInner> beginGetAzureReachabilityReport( - String resourceGroupName, String networkWatcherName, AzureReachabilityReportParameters parameters); - - /** - * Gets the relative latency score for internet service providers from a specified location to Azure regions. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that determine Azure reachability report configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the relative latency score for internet service providers from a specified location to Azure regions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, AzureReachabilityReportInner> beginGetAzureReachabilityReport( - String resourceGroupName, - String networkWatcherName, - AzureReachabilityReportParameters parameters, - Context context); - - /** - * Gets the relative latency score for internet service providers from a specified location to Azure regions. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that determine Azure reachability report configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the relative latency score for internet service providers from a specified location to Azure regions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAzureReachabilityReportAsync( - String resourceGroupName, String networkWatcherName, AzureReachabilityReportParameters parameters); - - /** - * Gets the relative latency score for internet service providers from a specified location to Azure regions. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that determine Azure reachability report configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the relative latency score for internet service providers from a specified location to Azure regions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AzureReachabilityReportInner getAzureReachabilityReport( - String resourceGroupName, String networkWatcherName, AzureReachabilityReportParameters parameters); - - /** - * Gets the relative latency score for internet service providers from a specified location to Azure regions. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that determine Azure reachability report configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the relative latency score for internet service providers from a specified location to Azure regions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AzureReachabilityReportInner getAzureReachabilityReport( - String resourceGroupName, - String networkWatcherName, - AzureReachabilityReportParameters parameters, - Context context); - - /** - * Lists all available internet service providers for a specified Azure region. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that scope the list of available providers. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of available countries with details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> listAvailableProvidersWithResponseAsync( - String resourceGroupName, String networkWatcherName, AvailableProvidersListParameters parameters); - - /** - * Lists all available internet service providers for a specified Azure region. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that scope the list of available providers. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of available countries with details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, AvailableProvidersListInner> beginListAvailableProvidersAsync( - String resourceGroupName, String networkWatcherName, AvailableProvidersListParameters parameters); - - /** - * Lists all available internet service providers for a specified Azure region. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that scope the list of available providers. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of available countries with details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, AvailableProvidersListInner> beginListAvailableProviders( - String resourceGroupName, String networkWatcherName, AvailableProvidersListParameters parameters); - - /** - * Lists all available internet service providers for a specified Azure region. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that scope the list of available providers. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of available countries with details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, AvailableProvidersListInner> beginListAvailableProviders( - String resourceGroupName, - String networkWatcherName, - AvailableProvidersListParameters parameters, - Context context); - - /** - * Lists all available internet service providers for a specified Azure region. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that scope the list of available providers. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of available countries with details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listAvailableProvidersAsync( - String resourceGroupName, String networkWatcherName, AvailableProvidersListParameters parameters); - - /** - * Lists all available internet service providers for a specified Azure region. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that scope the list of available providers. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of available countries with details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AvailableProvidersListInner listAvailableProviders( - String resourceGroupName, String networkWatcherName, AvailableProvidersListParameters parameters); - - /** - * Lists all available internet service providers for a specified Azure region. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that scope the list of available providers. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of available countries with details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AvailableProvidersListInner listAvailableProviders( - String resourceGroupName, - String networkWatcherName, - AvailableProvidersListParameters parameters, - Context context); - - /** - * Get network configuration diagnostic. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters to get network configuration diagnostic. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return network configuration diagnostic. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> getNetworkConfigurationDiagnosticWithResponseAsync( - String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters); - - /** - * Get network configuration diagnostic. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters to get network configuration diagnostic. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return network configuration diagnostic. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, NetworkConfigurationDiagnosticResponseInner> - beginGetNetworkConfigurationDiagnosticAsync( - String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters); - - /** - * Get network configuration diagnostic. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters to get network configuration diagnostic. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return network configuration diagnostic. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, NetworkConfigurationDiagnosticResponseInner> - beginGetNetworkConfigurationDiagnostic( - String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters); - - /** - * Get network configuration diagnostic. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters to get network configuration diagnostic. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return network configuration diagnostic. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, NetworkConfigurationDiagnosticResponseInner> - beginGetNetworkConfigurationDiagnostic( - String resourceGroupName, - String networkWatcherName, - NetworkConfigurationDiagnosticParameters parameters, - Context context); - - /** - * Get network configuration diagnostic. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters to get network configuration diagnostic. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return network configuration diagnostic. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getNetworkConfigurationDiagnosticAsync( - String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters); - - /** - * Get network configuration diagnostic. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters to get network configuration diagnostic. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return network configuration diagnostic. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - NetworkConfigurationDiagnosticResponseInner getNetworkConfigurationDiagnostic( - String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters); - - /** - * Get network configuration diagnostic. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters to get network configuration diagnostic. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return network configuration diagnostic. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - NetworkConfigurationDiagnosticResponseInner getNetworkConfigurationDiagnostic( - String resourceGroupName, - String networkWatcherName, - NetworkConfigurationDiagnosticParameters parameters, - Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/OperationsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/OperationsClient.java deleted file mode 100644 index 66a8ab430ce1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/OperationsClient.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.network.fluent.models.OperationInner; - -/** An instance of this class provides access to all the operations defined in OperationsClient. */ -public interface OperationsClient { - /** - * Lists all of the available Network Rest API operations. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Network operations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Lists all of the available Network Rest API operations. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Network operations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Lists all of the available Network Rest API operations. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Network operations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/P2SVpnGatewaysClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/P2SVpnGatewaysClient.java deleted file mode 100644 index d3f3521b0590..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/P2SVpnGatewaysClient.java +++ /dev/null @@ -1,564 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.models.P2SVpnGatewayInner; -import com.azure.resourcemanager.network.fluent.models.VpnProfileResponseInner; -import com.azure.resourcemanager.network.models.P2SVpnProfileParameters; -import com.azure.resourcemanager.network.models.TagsObject; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in P2SVpnGatewaysClient. */ -public interface P2SVpnGatewaysClient - extends InnerSupportsGet, InnerSupportsListing, InnerSupportsDelete { - /** - * Retrieves the details of a virtual wan p2s vpn gateway. - * - * @param resourceGroupName The resource group name of the P2SVpnGateway. - * @param gatewayName The name of the gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return p2SVpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String gatewayName); - - /** - * Retrieves the details of a virtual wan p2s vpn gateway. - * - * @param resourceGroupName The resource group name of the P2SVpnGateway. - * @param gatewayName The name of the gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return p2SVpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync(String resourceGroupName, String gatewayName); - - /** - * Retrieves the details of a virtual wan p2s vpn gateway. - * - * @param resourceGroupName The resource group name of the P2SVpnGateway. - * @param gatewayName The name of the gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return p2SVpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - P2SVpnGatewayInner getByResourceGroup(String resourceGroupName, String gatewayName); - - /** - * Retrieves the details of a virtual wan p2s vpn gateway. - * - * @param resourceGroupName The resource group name of the P2SVpnGateway. - * @param gatewayName The name of the gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return p2SVpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String gatewayName, Context context); - - /** - * Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. - * - * @param resourceGroupName The resource group name of the P2SVpnGateway. - * @param gatewayName The name of the gateway. - * @param p2SVpnGatewayParameters Parameters supplied to create or Update a virtual wan p2s vpn gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return p2SVpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String gatewayName, P2SVpnGatewayInner p2SVpnGatewayParameters); - - /** - * Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. - * - * @param resourceGroupName The resource group name of the P2SVpnGateway. - * @param gatewayName The name of the gateway. - * @param p2SVpnGatewayParameters Parameters supplied to create or Update a virtual wan p2s vpn gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return p2SVpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, P2SVpnGatewayInner> beginCreateOrUpdateAsync( - String resourceGroupName, String gatewayName, P2SVpnGatewayInner p2SVpnGatewayParameters); - - /** - * Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. - * - * @param resourceGroupName The resource group name of the P2SVpnGateway. - * @param gatewayName The name of the gateway. - * @param p2SVpnGatewayParameters Parameters supplied to create or Update a virtual wan p2s vpn gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return p2SVpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, P2SVpnGatewayInner> beginCreateOrUpdate( - String resourceGroupName, String gatewayName, P2SVpnGatewayInner p2SVpnGatewayParameters); - - /** - * Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. - * - * @param resourceGroupName The resource group name of the P2SVpnGateway. - * @param gatewayName The name of the gateway. - * @param p2SVpnGatewayParameters Parameters supplied to create or Update a virtual wan p2s vpn gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return p2SVpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, P2SVpnGatewayInner> beginCreateOrUpdate( - String resourceGroupName, String gatewayName, P2SVpnGatewayInner p2SVpnGatewayParameters, Context context); - - /** - * Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. - * - * @param resourceGroupName The resource group name of the P2SVpnGateway. - * @param gatewayName The name of the gateway. - * @param p2SVpnGatewayParameters Parameters supplied to create or Update a virtual wan p2s vpn gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return p2SVpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, String gatewayName, P2SVpnGatewayInner p2SVpnGatewayParameters); - - /** - * Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. - * - * @param resourceGroupName The resource group name of the P2SVpnGateway. - * @param gatewayName The name of the gateway. - * @param p2SVpnGatewayParameters Parameters supplied to create or Update a virtual wan p2s vpn gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return p2SVpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - P2SVpnGatewayInner createOrUpdate( - String resourceGroupName, String gatewayName, P2SVpnGatewayInner p2SVpnGatewayParameters); - - /** - * Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. - * - * @param resourceGroupName The resource group name of the P2SVpnGateway. - * @param gatewayName The name of the gateway. - * @param p2SVpnGatewayParameters Parameters supplied to create or Update a virtual wan p2s vpn gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return p2SVpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - P2SVpnGatewayInner createOrUpdate( - String resourceGroupName, String gatewayName, P2SVpnGatewayInner p2SVpnGatewayParameters, Context context); - - /** - * Updates virtual wan p2s vpn gateway tags. - * - * @param resourceGroupName The resource group name of the P2SVpnGateway. - * @param gatewayName The name of the gateway. - * @param p2SVpnGatewayParameters Parameters supplied to update a virtual wan p2s vpn gateway tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return p2SVpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> updateTagsWithResponseAsync( - String resourceGroupName, String gatewayName, TagsObject p2SVpnGatewayParameters); - - /** - * Updates virtual wan p2s vpn gateway tags. - * - * @param resourceGroupName The resource group name of the P2SVpnGateway. - * @param gatewayName The name of the gateway. - * @param p2SVpnGatewayParameters Parameters supplied to update a virtual wan p2s vpn gateway tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return p2SVpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, P2SVpnGatewayInner> beginUpdateTagsAsync( - String resourceGroupName, String gatewayName, TagsObject p2SVpnGatewayParameters); - - /** - * Updates virtual wan p2s vpn gateway tags. - * - * @param resourceGroupName The resource group name of the P2SVpnGateway. - * @param gatewayName The name of the gateway. - * @param p2SVpnGatewayParameters Parameters supplied to update a virtual wan p2s vpn gateway tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return p2SVpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, P2SVpnGatewayInner> beginUpdateTags( - String resourceGroupName, String gatewayName, TagsObject p2SVpnGatewayParameters); - - /** - * Updates virtual wan p2s vpn gateway tags. - * - * @param resourceGroupName The resource group name of the P2SVpnGateway. - * @param gatewayName The name of the gateway. - * @param p2SVpnGatewayParameters Parameters supplied to update a virtual wan p2s vpn gateway tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return p2SVpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, P2SVpnGatewayInner> beginUpdateTags( - String resourceGroupName, String gatewayName, TagsObject p2SVpnGatewayParameters, Context context); - - /** - * Updates virtual wan p2s vpn gateway tags. - * - * @param resourceGroupName The resource group name of the P2SVpnGateway. - * @param gatewayName The name of the gateway. - * @param p2SVpnGatewayParameters Parameters supplied to update a virtual wan p2s vpn gateway tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return p2SVpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateTagsAsync( - String resourceGroupName, String gatewayName, TagsObject p2SVpnGatewayParameters); - - /** - * Updates virtual wan p2s vpn gateway tags. - * - * @param resourceGroupName The resource group name of the P2SVpnGateway. - * @param gatewayName The name of the gateway. - * @param p2SVpnGatewayParameters Parameters supplied to update a virtual wan p2s vpn gateway tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return p2SVpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - P2SVpnGatewayInner updateTags(String resourceGroupName, String gatewayName, TagsObject p2SVpnGatewayParameters); - - /** - * Updates virtual wan p2s vpn gateway tags. - * - * @param resourceGroupName The resource group name of the P2SVpnGateway. - * @param gatewayName The name of the gateway. - * @param p2SVpnGatewayParameters Parameters supplied to update a virtual wan p2s vpn gateway tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return p2SVpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - P2SVpnGatewayInner updateTags( - String resourceGroupName, String gatewayName, TagsObject p2SVpnGatewayParameters, Context context); - - /** - * Deletes a virtual wan p2s vpn gateway. - * - * @param resourceGroupName The resource group name of the P2SVpnGateway. - * @param gatewayName The name of the gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync(String resourceGroupName, String gatewayName); - - /** - * Deletes a virtual wan p2s vpn gateway. - * - * @param resourceGroupName The resource group name of the P2SVpnGateway. - * @param gatewayName The name of the gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String gatewayName); - - /** - * Deletes a virtual wan p2s vpn gateway. - * - * @param resourceGroupName The resource group name of the P2SVpnGateway. - * @param gatewayName The name of the gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String gatewayName); - - /** - * Deletes a virtual wan p2s vpn gateway. - * - * @param resourceGroupName The resource group name of the P2SVpnGateway. - * @param gatewayName The name of the gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String gatewayName, Context context); - - /** - * Deletes a virtual wan p2s vpn gateway. - * - * @param resourceGroupName The resource group name of the P2SVpnGateway. - * @param gatewayName The name of the gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String gatewayName); - - /** - * Deletes a virtual wan p2s vpn gateway. - * - * @param resourceGroupName The resource group name of the P2SVpnGateway. - * @param gatewayName The name of the gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String gatewayName); - - /** - * Deletes a virtual wan p2s vpn gateway. - * - * @param resourceGroupName The resource group name of the P2SVpnGateway. - * @param gatewayName The name of the gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String gatewayName, Context context); - - /** - * Lists all the P2SVpnGateways in a resource group. - * - * @param resourceGroupName The resource group name of the P2SVpnGateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list P2SVpnGateways. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName); - - /** - * Lists all the P2SVpnGateways in a resource group. - * - * @param resourceGroupName The resource group name of the P2SVpnGateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list P2SVpnGateways. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Lists all the P2SVpnGateways in a resource group. - * - * @param resourceGroupName The resource group name of the P2SVpnGateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list P2SVpnGateways. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * Lists all the P2SVpnGateways in a subscription. - * - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list P2SVpnGateways. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Lists all the P2SVpnGateways in a subscription. - * - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list P2SVpnGateways. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Lists all the P2SVpnGateways in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list P2SVpnGateways. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param gatewayName The name of the P2SVpnGateway. - * @param parameters Parameters supplied to the generate P2SVpnGateway VPN client package operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpn Profile Response for package generation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> generateVpnProfileWithResponseAsync( - String resourceGroupName, String gatewayName, P2SVpnProfileParameters parameters); - - /** - * Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param gatewayName The name of the P2SVpnGateway. - * @param parameters Parameters supplied to the generate P2SVpnGateway VPN client package operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpn Profile Response for package generation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, VpnProfileResponseInner> beginGenerateVpnProfileAsync( - String resourceGroupName, String gatewayName, P2SVpnProfileParameters parameters); - - /** - * Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param gatewayName The name of the P2SVpnGateway. - * @param parameters Parameters supplied to the generate P2SVpnGateway VPN client package operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpn Profile Response for package generation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VpnProfileResponseInner> beginGenerateVpnProfile( - String resourceGroupName, String gatewayName, P2SVpnProfileParameters parameters); - - /** - * Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param gatewayName The name of the P2SVpnGateway. - * @param parameters Parameters supplied to the generate P2SVpnGateway VPN client package operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpn Profile Response for package generation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VpnProfileResponseInner> beginGenerateVpnProfile( - String resourceGroupName, String gatewayName, P2SVpnProfileParameters parameters, Context context); - - /** - * Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param gatewayName The name of the P2SVpnGateway. - * @param parameters Parameters supplied to the generate P2SVpnGateway VPN client package operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpn Profile Response for package generation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono generateVpnProfileAsync( - String resourceGroupName, String gatewayName, P2SVpnProfileParameters parameters); - - /** - * Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param gatewayName The name of the P2SVpnGateway. - * @param parameters Parameters supplied to the generate P2SVpnGateway VPN client package operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpn Profile Response for package generation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VpnProfileResponseInner generateVpnProfile( - String resourceGroupName, String gatewayName, P2SVpnProfileParameters parameters); - - /** - * Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param gatewayName The name of the P2SVpnGateway. - * @param parameters Parameters supplied to the generate P2SVpnGateway VPN client package operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpn Profile Response for package generation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VpnProfileResponseInner generateVpnProfile( - String resourceGroupName, String gatewayName, P2SVpnProfileParameters parameters, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/P2SVpnServerConfigurationsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/P2SVpnServerConfigurationsClient.java deleted file mode 100644 index 1b3eadcbd6b7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/P2SVpnServerConfigurationsClient.java +++ /dev/null @@ -1,370 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.models.P2SVpnServerConfigurationInner; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in P2SVpnServerConfigurationsClient. */ -public interface P2SVpnServerConfigurationsClient { - /** - * Retrieves the details of a P2SVpnServerConfiguration. - * - * @param resourceGroupName The resource group name of the P2SVpnServerConfiguration. - * @param virtualWanName The name of the VirtualWan. - * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return p2SVpnServerConfiguration Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync( - String resourceGroupName, String virtualWanName, String p2SVpnServerConfigurationName); - - /** - * Retrieves the details of a P2SVpnServerConfiguration. - * - * @param resourceGroupName The resource group name of the P2SVpnServerConfiguration. - * @param virtualWanName The name of the VirtualWan. - * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return p2SVpnServerConfiguration Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync( - String resourceGroupName, String virtualWanName, String p2SVpnServerConfigurationName); - - /** - * Retrieves the details of a P2SVpnServerConfiguration. - * - * @param resourceGroupName The resource group name of the P2SVpnServerConfiguration. - * @param virtualWanName The name of the VirtualWan. - * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return p2SVpnServerConfiguration Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - P2SVpnServerConfigurationInner get( - String resourceGroupName, String virtualWanName, String p2SVpnServerConfigurationName); - - /** - * Retrieves the details of a P2SVpnServerConfiguration. - * - * @param resourceGroupName The resource group name of the P2SVpnServerConfiguration. - * @param virtualWanName The name of the VirtualWan. - * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return p2SVpnServerConfiguration Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String virtualWanName, String p2SVpnServerConfigurationName, Context context); - - /** - * Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it doesn't exist else updates the existing - * P2SVpnServerConfiguration. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWan. - * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. - * @param p2SVpnServerConfigurationParameters Parameters supplied to create or Update a P2SVpnServerConfiguration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return p2SVpnServerConfiguration Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String virtualWanName, - String p2SVpnServerConfigurationName, - P2SVpnServerConfigurationInner p2SVpnServerConfigurationParameters); - - /** - * Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it doesn't exist else updates the existing - * P2SVpnServerConfiguration. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWan. - * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. - * @param p2SVpnServerConfigurationParameters Parameters supplied to create or Update a P2SVpnServerConfiguration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return p2SVpnServerConfiguration Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, P2SVpnServerConfigurationInner> beginCreateOrUpdateAsync( - String resourceGroupName, - String virtualWanName, - String p2SVpnServerConfigurationName, - P2SVpnServerConfigurationInner p2SVpnServerConfigurationParameters); - - /** - * Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it doesn't exist else updates the existing - * P2SVpnServerConfiguration. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWan. - * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. - * @param p2SVpnServerConfigurationParameters Parameters supplied to create or Update a P2SVpnServerConfiguration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return p2SVpnServerConfiguration Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, P2SVpnServerConfigurationInner> beginCreateOrUpdate( - String resourceGroupName, - String virtualWanName, - String p2SVpnServerConfigurationName, - P2SVpnServerConfigurationInner p2SVpnServerConfigurationParameters); - - /** - * Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it doesn't exist else updates the existing - * P2SVpnServerConfiguration. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWan. - * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. - * @param p2SVpnServerConfigurationParameters Parameters supplied to create or Update a P2SVpnServerConfiguration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return p2SVpnServerConfiguration Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, P2SVpnServerConfigurationInner> beginCreateOrUpdate( - String resourceGroupName, - String virtualWanName, - String p2SVpnServerConfigurationName, - P2SVpnServerConfigurationInner p2SVpnServerConfigurationParameters, - Context context); - - /** - * Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it doesn't exist else updates the existing - * P2SVpnServerConfiguration. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWan. - * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. - * @param p2SVpnServerConfigurationParameters Parameters supplied to create or Update a P2SVpnServerConfiguration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return p2SVpnServerConfiguration Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, - String virtualWanName, - String p2SVpnServerConfigurationName, - P2SVpnServerConfigurationInner p2SVpnServerConfigurationParameters); - - /** - * Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it doesn't exist else updates the existing - * P2SVpnServerConfiguration. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWan. - * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. - * @param p2SVpnServerConfigurationParameters Parameters supplied to create or Update a P2SVpnServerConfiguration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return p2SVpnServerConfiguration Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - P2SVpnServerConfigurationInner createOrUpdate( - String resourceGroupName, - String virtualWanName, - String p2SVpnServerConfigurationName, - P2SVpnServerConfigurationInner p2SVpnServerConfigurationParameters); - - /** - * Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it doesn't exist else updates the existing - * P2SVpnServerConfiguration. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWan. - * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. - * @param p2SVpnServerConfigurationParameters Parameters supplied to create or Update a P2SVpnServerConfiguration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return p2SVpnServerConfiguration Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - P2SVpnServerConfigurationInner createOrUpdate( - String resourceGroupName, - String virtualWanName, - String p2SVpnServerConfigurationName, - P2SVpnServerConfigurationInner p2SVpnServerConfigurationParameters, - Context context); - - /** - * Deletes a P2SVpnServerConfiguration. - * - * @param resourceGroupName The resource group name of the P2SVpnServerConfiguration. - * @param virtualWanName The name of the VirtualWan. - * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync( - String resourceGroupName, String virtualWanName, String p2SVpnServerConfigurationName); - - /** - * Deletes a P2SVpnServerConfiguration. - * - * @param resourceGroupName The resource group name of the P2SVpnServerConfiguration. - * @param virtualWanName The name of the VirtualWan. - * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String virtualWanName, String p2SVpnServerConfigurationName); - - /** - * Deletes a P2SVpnServerConfiguration. - * - * @param resourceGroupName The resource group name of the P2SVpnServerConfiguration. - * @param virtualWanName The name of the VirtualWan. - * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String virtualWanName, String p2SVpnServerConfigurationName); - - /** - * Deletes a P2SVpnServerConfiguration. - * - * @param resourceGroupName The resource group name of the P2SVpnServerConfiguration. - * @param virtualWanName The name of the VirtualWan. - * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String virtualWanName, String p2SVpnServerConfigurationName, Context context); - - /** - * Deletes a P2SVpnServerConfiguration. - * - * @param resourceGroupName The resource group name of the P2SVpnServerConfiguration. - * @param virtualWanName The name of the VirtualWan. - * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String virtualWanName, String p2SVpnServerConfigurationName); - - /** - * Deletes a P2SVpnServerConfiguration. - * - * @param resourceGroupName The resource group name of the P2SVpnServerConfiguration. - * @param virtualWanName The name of the VirtualWan. - * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String virtualWanName, String p2SVpnServerConfigurationName); - - /** - * Deletes a P2SVpnServerConfiguration. - * - * @param resourceGroupName The resource group name of the P2SVpnServerConfiguration. - * @param virtualWanName The name of the VirtualWan. - * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String virtualWanName, String p2SVpnServerConfigurationName, Context context); - - /** - * Retrieves all P2SVpnServerConfigurations for a particular VirtualWan. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list all P2SVpnServerConfigurations associated to a VirtualWan. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByVirtualWanAsync(String resourceGroupName, String virtualWanName); - - /** - * Retrieves all P2SVpnServerConfigurations for a particular VirtualWan. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list all P2SVpnServerConfigurations associated to a VirtualWan. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByVirtualWan(String resourceGroupName, String virtualWanName); - - /** - * Retrieves all P2SVpnServerConfigurations for a particular VirtualWan. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWan. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list all P2SVpnServerConfigurations associated to a VirtualWan. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByVirtualWan( - String resourceGroupName, String virtualWanName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/PacketCapturesClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/PacketCapturesClient.java deleted file mode 100644 index aaec95f0e42c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/PacketCapturesClient.java +++ /dev/null @@ -1,557 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.models.PacketCaptureInner; -import com.azure.resourcemanager.network.fluent.models.PacketCaptureQueryStatusResultInner; -import com.azure.resourcemanager.network.fluent.models.PacketCaptureResultInner; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in PacketCapturesClient. */ -public interface PacketCapturesClient { - /** - * Create and start a packet capture on the specified VM. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param packetCaptureName The name of the packet capture session. - * @param parameters Parameters that define the create packet capture operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about packet capture session. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createWithResponseAsync( - String resourceGroupName, String networkWatcherName, String packetCaptureName, PacketCaptureInner parameters); - - /** - * Create and start a packet capture on the specified VM. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param packetCaptureName The name of the packet capture session. - * @param parameters Parameters that define the create packet capture operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about packet capture session. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, PacketCaptureResultInner> beginCreateAsync( - String resourceGroupName, String networkWatcherName, String packetCaptureName, PacketCaptureInner parameters); - - /** - * Create and start a packet capture on the specified VM. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param packetCaptureName The name of the packet capture session. - * @param parameters Parameters that define the create packet capture operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about packet capture session. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, PacketCaptureResultInner> beginCreate( - String resourceGroupName, String networkWatcherName, String packetCaptureName, PacketCaptureInner parameters); - - /** - * Create and start a packet capture on the specified VM. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param packetCaptureName The name of the packet capture session. - * @param parameters Parameters that define the create packet capture operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about packet capture session. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, PacketCaptureResultInner> beginCreate( - String resourceGroupName, - String networkWatcherName, - String packetCaptureName, - PacketCaptureInner parameters, - Context context); - - /** - * Create and start a packet capture on the specified VM. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param packetCaptureName The name of the packet capture session. - * @param parameters Parameters that define the create packet capture operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about packet capture session. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createAsync( - String resourceGroupName, String networkWatcherName, String packetCaptureName, PacketCaptureInner parameters); - - /** - * Create and start a packet capture on the specified VM. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param packetCaptureName The name of the packet capture session. - * @param parameters Parameters that define the create packet capture operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about packet capture session. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PacketCaptureResultInner create( - String resourceGroupName, String networkWatcherName, String packetCaptureName, PacketCaptureInner parameters); - - /** - * Create and start a packet capture on the specified VM. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param packetCaptureName The name of the packet capture session. - * @param parameters Parameters that define the create packet capture operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about packet capture session. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PacketCaptureResultInner create( - String resourceGroupName, - String networkWatcherName, - String packetCaptureName, - PacketCaptureInner parameters, - Context context); - - /** - * Gets a packet capture session by name. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param packetCaptureName The name of the packet capture session. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a packet capture session by name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync( - String resourceGroupName, String networkWatcherName, String packetCaptureName); - - /** - * Gets a packet capture session by name. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param packetCaptureName The name of the packet capture session. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a packet capture session by name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync( - String resourceGroupName, String networkWatcherName, String packetCaptureName); - - /** - * Gets a packet capture session by name. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param packetCaptureName The name of the packet capture session. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a packet capture session by name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PacketCaptureResultInner get(String resourceGroupName, String networkWatcherName, String packetCaptureName); - - /** - * Gets a packet capture session by name. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param packetCaptureName The name of the packet capture session. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a packet capture session by name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String networkWatcherName, String packetCaptureName, Context context); - - /** - * Deletes the specified packet capture session. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param packetCaptureName The name of the packet capture session. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync( - String resourceGroupName, String networkWatcherName, String packetCaptureName); - - /** - * Deletes the specified packet capture session. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param packetCaptureName The name of the packet capture session. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String networkWatcherName, String packetCaptureName); - - /** - * Deletes the specified packet capture session. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param packetCaptureName The name of the packet capture session. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String networkWatcherName, String packetCaptureName); - - /** - * Deletes the specified packet capture session. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param packetCaptureName The name of the packet capture session. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String networkWatcherName, String packetCaptureName, Context context); - - /** - * Deletes the specified packet capture session. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param packetCaptureName The name of the packet capture session. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName); - - /** - * Deletes the specified packet capture session. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param packetCaptureName The name of the packet capture session. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String networkWatcherName, String packetCaptureName); - - /** - * Deletes the specified packet capture session. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param packetCaptureName The name of the packet capture session. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String networkWatcherName, String packetCaptureName, Context context); - - /** - * Stops a specified packet capture session. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param packetCaptureName The name of the packet capture session. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> stopWithResponseAsync( - String resourceGroupName, String networkWatcherName, String packetCaptureName); - - /** - * Stops a specified packet capture session. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param packetCaptureName The name of the packet capture session. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginStopAsync( - String resourceGroupName, String networkWatcherName, String packetCaptureName); - - /** - * Stops a specified packet capture session. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param packetCaptureName The name of the packet capture session. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginStop( - String resourceGroupName, String networkWatcherName, String packetCaptureName); - - /** - * Stops a specified packet capture session. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param packetCaptureName The name of the packet capture session. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginStop( - String resourceGroupName, String networkWatcherName, String packetCaptureName, Context context); - - /** - * Stops a specified packet capture session. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param packetCaptureName The name of the packet capture session. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono stopAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName); - - /** - * Stops a specified packet capture session. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param packetCaptureName The name of the packet capture session. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void stop(String resourceGroupName, String networkWatcherName, String packetCaptureName); - - /** - * Stops a specified packet capture session. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param packetCaptureName The name of the packet capture session. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void stop(String resourceGroupName, String networkWatcherName, String packetCaptureName, Context context); - - /** - * Query the status of a running packet capture session. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the Network Watcher resource. - * @param packetCaptureName The name given to the packet capture session. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return status of packet capture session. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> getStatusWithResponseAsync( - String resourceGroupName, String networkWatcherName, String packetCaptureName); - - /** - * Query the status of a running packet capture session. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the Network Watcher resource. - * @param packetCaptureName The name given to the packet capture session. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return status of packet capture session. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, PacketCaptureQueryStatusResultInner> - beginGetStatusAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName); - - /** - * Query the status of a running packet capture session. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the Network Watcher resource. - * @param packetCaptureName The name given to the packet capture session. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return status of packet capture session. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, PacketCaptureQueryStatusResultInner> beginGetStatus( - String resourceGroupName, String networkWatcherName, String packetCaptureName); - - /** - * Query the status of a running packet capture session. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the Network Watcher resource. - * @param packetCaptureName The name given to the packet capture session. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return status of packet capture session. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, PacketCaptureQueryStatusResultInner> beginGetStatus( - String resourceGroupName, String networkWatcherName, String packetCaptureName, Context context); - - /** - * Query the status of a running packet capture session. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the Network Watcher resource. - * @param packetCaptureName The name given to the packet capture session. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return status of packet capture session. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getStatusAsync( - String resourceGroupName, String networkWatcherName, String packetCaptureName); - - /** - * Query the status of a running packet capture session. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the Network Watcher resource. - * @param packetCaptureName The name given to the packet capture session. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return status of packet capture session. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PacketCaptureQueryStatusResultInner getStatus( - String resourceGroupName, String networkWatcherName, String packetCaptureName); - - /** - * Query the status of a running packet capture session. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the Network Watcher resource. - * @param packetCaptureName The name given to the packet capture session. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return status of packet capture session. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PacketCaptureQueryStatusResultInner getStatus( - String resourceGroupName, String networkWatcherName, String packetCaptureName, Context context); - - /** - * Lists all packet capture sessions within the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the Network Watcher resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of packet capture sessions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String resourceGroupName, String networkWatcherName); - - /** - * Lists all packet capture sessions within the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the Network Watcher resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of packet capture sessions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String networkWatcherName); - - /** - * Lists all packet capture sessions within the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the Network Watcher resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of packet capture sessions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String networkWatcherName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/PublicIpAddressesClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/PublicIpAddressesClient.java deleted file mode 100644 index b614e70f37d9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/PublicIpAddressesClient.java +++ /dev/null @@ -1,712 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.models.PublicIpAddressInner; -import com.azure.resourcemanager.network.models.TagsObject; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in PublicIpAddressesClient. */ -public interface PublicIpAddressesClient - extends InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete { - /** - * Deletes the specified public IP address. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpAddressName The name of the subnet. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync(String resourceGroupName, String publicIpAddressName); - - /** - * Deletes the specified public IP address. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpAddressName The name of the subnet. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String publicIpAddressName); - - /** - * Deletes the specified public IP address. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpAddressName The name of the subnet. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String publicIpAddressName); - - /** - * Deletes the specified public IP address. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpAddressName The name of the subnet. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String publicIpAddressName, Context context); - - /** - * Deletes the specified public IP address. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpAddressName The name of the subnet. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String publicIpAddressName); - - /** - * Deletes the specified public IP address. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpAddressName The name of the subnet. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String publicIpAddressName); - - /** - * Deletes the specified public IP address. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpAddressName The name of the subnet. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String publicIpAddressName, Context context); - - /** - * Gets the specified public IP address in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpAddressName The name of the subnet. - * @param expand Expands referenced resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified public IP address in a specified resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String publicIpAddressName, String expand); - - /** - * Gets the specified public IP address in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpAddressName The name of the subnet. - * @param expand Expands referenced resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified public IP address in a specified resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync( - String resourceGroupName, String publicIpAddressName, String expand); - - /** - * Gets the specified public IP address in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpAddressName The name of the subnet. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified public IP address in a specified resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync(String resourceGroupName, String publicIpAddressName); - - /** - * Gets the specified public IP address in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpAddressName The name of the subnet. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified public IP address in a specified resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PublicIpAddressInner getByResourceGroup(String resourceGroupName, String publicIpAddressName); - - /** - * Gets the specified public IP address in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpAddressName The name of the subnet. - * @param expand Expands referenced resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified public IP address in a specified resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String publicIpAddressName, String expand, Context context); - - /** - * Creates or updates a static or dynamic public IP address. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpAddressName The name of the public IP address. - * @param parameters Parameters supplied to the create or update public IP address operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public IP address resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String publicIpAddressName, PublicIpAddressInner parameters); - - /** - * Creates or updates a static or dynamic public IP address. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpAddressName The name of the public IP address. - * @param parameters Parameters supplied to the create or update public IP address operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public IP address resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, PublicIpAddressInner> beginCreateOrUpdateAsync( - String resourceGroupName, String publicIpAddressName, PublicIpAddressInner parameters); - - /** - * Creates or updates a static or dynamic public IP address. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpAddressName The name of the public IP address. - * @param parameters Parameters supplied to the create or update public IP address operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public IP address resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, PublicIpAddressInner> beginCreateOrUpdate( - String resourceGroupName, String publicIpAddressName, PublicIpAddressInner parameters); - - /** - * Creates or updates a static or dynamic public IP address. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpAddressName The name of the public IP address. - * @param parameters Parameters supplied to the create or update public IP address operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public IP address resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, PublicIpAddressInner> beginCreateOrUpdate( - String resourceGroupName, String publicIpAddressName, PublicIpAddressInner parameters, Context context); - - /** - * Creates or updates a static or dynamic public IP address. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpAddressName The name of the public IP address. - * @param parameters Parameters supplied to the create or update public IP address operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public IP address resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, String publicIpAddressName, PublicIpAddressInner parameters); - - /** - * Creates or updates a static or dynamic public IP address. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpAddressName The name of the public IP address. - * @param parameters Parameters supplied to the create or update public IP address operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public IP address resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PublicIpAddressInner createOrUpdate( - String resourceGroupName, String publicIpAddressName, PublicIpAddressInner parameters); - - /** - * Creates or updates a static or dynamic public IP address. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpAddressName The name of the public IP address. - * @param parameters Parameters supplied to the create or update public IP address operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public IP address resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PublicIpAddressInner createOrUpdate( - String resourceGroupName, String publicIpAddressName, PublicIpAddressInner parameters, Context context); - - /** - * Updates public IP address tags. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpAddressName The name of the public IP address. - * @param parameters Parameters supplied to update public IP address tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public IP address resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> updateTagsWithResponseAsync( - String resourceGroupName, String publicIpAddressName, TagsObject parameters); - - /** - * Updates public IP address tags. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpAddressName The name of the public IP address. - * @param parameters Parameters supplied to update public IP address tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public IP address resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, PublicIpAddressInner> beginUpdateTagsAsync( - String resourceGroupName, String publicIpAddressName, TagsObject parameters); - - /** - * Updates public IP address tags. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpAddressName The name of the public IP address. - * @param parameters Parameters supplied to update public IP address tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public IP address resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, PublicIpAddressInner> beginUpdateTags( - String resourceGroupName, String publicIpAddressName, TagsObject parameters); - - /** - * Updates public IP address tags. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpAddressName The name of the public IP address. - * @param parameters Parameters supplied to update public IP address tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public IP address resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, PublicIpAddressInner> beginUpdateTags( - String resourceGroupName, String publicIpAddressName, TagsObject parameters, Context context); - - /** - * Updates public IP address tags. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpAddressName The name of the public IP address. - * @param parameters Parameters supplied to update public IP address tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public IP address resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateTagsAsync( - String resourceGroupName, String publicIpAddressName, TagsObject parameters); - - /** - * Updates public IP address tags. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpAddressName The name of the public IP address. - * @param parameters Parameters supplied to update public IP address tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public IP address resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PublicIpAddressInner updateTags(String resourceGroupName, String publicIpAddressName, TagsObject parameters); - - /** - * Updates public IP address tags. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpAddressName The name of the public IP address. - * @param parameters Parameters supplied to update public IP address tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public IP address resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PublicIpAddressInner updateTags( - String resourceGroupName, String publicIpAddressName, TagsObject parameters, Context context); - - /** - * Gets all the public IP addresses in a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the public IP addresses in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Gets all the public IP addresses in a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the public IP addresses in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Gets all the public IP addresses in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the public IP addresses in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Gets all public IP addresses in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all public IP addresses in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName); - - /** - * Gets all public IP addresses in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all public IP addresses in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Gets all public IP addresses in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all public IP addresses in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * Gets information about all public IP addresses on a virtual machine scale set level. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about all public IP addresses on a virtual machine scale set level. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listVirtualMachineScaleSetPublicIpAddressesAsync( - String resourceGroupName, String virtualMachineScaleSetName); - - /** - * Gets information about all public IP addresses on a virtual machine scale set level. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about all public IP addresses on a virtual machine scale set level. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listVirtualMachineScaleSetPublicIpAddresses( - String resourceGroupName, String virtualMachineScaleSetName); - - /** - * Gets information about all public IP addresses on a virtual machine scale set level. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about all public IP addresses on a virtual machine scale set level. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listVirtualMachineScaleSetPublicIpAddresses( - String resourceGroupName, String virtualMachineScaleSetName, Context context); - - /** - * Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale - * set. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @param virtualmachineIndex The virtual machine index. - * @param networkInterfaceName The network interface name. - * @param ipConfigurationName The IP configuration name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about all public IP addresses in a virtual machine IP configuration in a virtual machine - * scale set. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listVirtualMachineScaleSetVMPublicIpAddressesAsync( - String resourceGroupName, - String virtualMachineScaleSetName, - String virtualmachineIndex, - String networkInterfaceName, - String ipConfigurationName); - - /** - * Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale - * set. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @param virtualmachineIndex The virtual machine index. - * @param networkInterfaceName The network interface name. - * @param ipConfigurationName The IP configuration name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about all public IP addresses in a virtual machine IP configuration in a virtual machine - * scale set. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listVirtualMachineScaleSetVMPublicIpAddresses( - String resourceGroupName, - String virtualMachineScaleSetName, - String virtualmachineIndex, - String networkInterfaceName, - String ipConfigurationName); - - /** - * Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale - * set. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @param virtualmachineIndex The virtual machine index. - * @param networkInterfaceName The network interface name. - * @param ipConfigurationName The IP configuration name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about all public IP addresses in a virtual machine IP configuration in a virtual machine - * scale set. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listVirtualMachineScaleSetVMPublicIpAddresses( - String resourceGroupName, - String virtualMachineScaleSetName, - String virtualmachineIndex, - String networkInterfaceName, - String ipConfigurationName, - Context context); - - /** - * Get the specified public IP address in a virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @param virtualmachineIndex The virtual machine index. - * @param networkInterfaceName The name of the network interface. - * @param ipConfigurationName The name of the IP configuration. - * @param publicIpAddressName The name of the public IP Address. - * @param expand Expands referenced resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified public IP address in a virtual machine scale set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getVirtualMachineScaleSetPublicIpAddressWithResponseAsync( - String resourceGroupName, - String virtualMachineScaleSetName, - String virtualmachineIndex, - String networkInterfaceName, - String ipConfigurationName, - String publicIpAddressName, - String expand); - - /** - * Get the specified public IP address in a virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @param virtualmachineIndex The virtual machine index. - * @param networkInterfaceName The name of the network interface. - * @param ipConfigurationName The name of the IP configuration. - * @param publicIpAddressName The name of the public IP Address. - * @param expand Expands referenced resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified public IP address in a virtual machine scale set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getVirtualMachineScaleSetPublicIpAddressAsync( - String resourceGroupName, - String virtualMachineScaleSetName, - String virtualmachineIndex, - String networkInterfaceName, - String ipConfigurationName, - String publicIpAddressName, - String expand); - - /** - * Get the specified public IP address in a virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @param virtualmachineIndex The virtual machine index. - * @param networkInterfaceName The name of the network interface. - * @param ipConfigurationName The name of the IP configuration. - * @param publicIpAddressName The name of the public IP Address. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified public IP address in a virtual machine scale set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getVirtualMachineScaleSetPublicIpAddressAsync( - String resourceGroupName, - String virtualMachineScaleSetName, - String virtualmachineIndex, - String networkInterfaceName, - String ipConfigurationName, - String publicIpAddressName); - - /** - * Get the specified public IP address in a virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @param virtualmachineIndex The virtual machine index. - * @param networkInterfaceName The name of the network interface. - * @param ipConfigurationName The name of the IP configuration. - * @param publicIpAddressName The name of the public IP Address. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified public IP address in a virtual machine scale set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PublicIpAddressInner getVirtualMachineScaleSetPublicIpAddress( - String resourceGroupName, - String virtualMachineScaleSetName, - String virtualmachineIndex, - String networkInterfaceName, - String ipConfigurationName, - String publicIpAddressName); - - /** - * Get the specified public IP address in a virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @param virtualmachineIndex The virtual machine index. - * @param networkInterfaceName The name of the network interface. - * @param ipConfigurationName The name of the IP configuration. - * @param publicIpAddressName The name of the public IP Address. - * @param expand Expands referenced resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified public IP address in a virtual machine scale set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getVirtualMachineScaleSetPublicIpAddressWithResponse( - String resourceGroupName, - String virtualMachineScaleSetName, - String virtualmachineIndex, - String networkInterfaceName, - String ipConfigurationName, - String publicIpAddressName, - String expand, - Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/PublicIpPrefixesClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/PublicIpPrefixesClient.java deleted file mode 100644 index ed6d03ed3bb0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/PublicIpPrefixesClient.java +++ /dev/null @@ -1,475 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.models.PublicIpPrefixInner; -import com.azure.resourcemanager.network.models.TagsObject; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in PublicIpPrefixesClient. */ -public interface PublicIpPrefixesClient - extends InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete { - /** - * Deletes the specified public IP prefix. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpPrefixName The name of the PublicIpPrefix. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync(String resourceGroupName, String publicIpPrefixName); - - /** - * Deletes the specified public IP prefix. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpPrefixName The name of the PublicIpPrefix. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String publicIpPrefixName); - - /** - * Deletes the specified public IP prefix. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpPrefixName The name of the PublicIpPrefix. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String publicIpPrefixName); - - /** - * Deletes the specified public IP prefix. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpPrefixName The name of the PublicIpPrefix. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String publicIpPrefixName, Context context); - - /** - * Deletes the specified public IP prefix. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpPrefixName The name of the PublicIpPrefix. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String publicIpPrefixName); - - /** - * Deletes the specified public IP prefix. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpPrefixName The name of the PublicIpPrefix. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String publicIpPrefixName); - - /** - * Deletes the specified public IP prefix. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpPrefixName The name of the PublicIpPrefix. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String publicIpPrefixName, Context context); - - /** - * Gets the specified public IP prefix in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpPrefixName The name of the PublicIPPrefix. - * @param expand Expands referenced resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified public IP prefix in a specified resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String publicIpPrefixName, String expand); - - /** - * Gets the specified public IP prefix in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpPrefixName The name of the PublicIPPrefix. - * @param expand Expands referenced resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified public IP prefix in a specified resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync( - String resourceGroupName, String publicIpPrefixName, String expand); - - /** - * Gets the specified public IP prefix in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpPrefixName The name of the PublicIPPrefix. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified public IP prefix in a specified resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync(String resourceGroupName, String publicIpPrefixName); - - /** - * Gets the specified public IP prefix in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpPrefixName The name of the PublicIPPrefix. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified public IP prefix in a specified resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PublicIpPrefixInner getByResourceGroup(String resourceGroupName, String publicIpPrefixName); - - /** - * Gets the specified public IP prefix in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpPrefixName The name of the PublicIPPrefix. - * @param expand Expands referenced resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified public IP prefix in a specified resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String publicIpPrefixName, String expand, Context context); - - /** - * Creates or updates a static or dynamic public IP prefix. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpPrefixName The name of the public IP prefix. - * @param parameters Parameters supplied to the create or update public IP prefix operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public IP prefix resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String publicIpPrefixName, PublicIpPrefixInner parameters); - - /** - * Creates or updates a static or dynamic public IP prefix. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpPrefixName The name of the public IP prefix. - * @param parameters Parameters supplied to the create or update public IP prefix operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public IP prefix resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, PublicIpPrefixInner> beginCreateOrUpdateAsync( - String resourceGroupName, String publicIpPrefixName, PublicIpPrefixInner parameters); - - /** - * Creates or updates a static or dynamic public IP prefix. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpPrefixName The name of the public IP prefix. - * @param parameters Parameters supplied to the create or update public IP prefix operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public IP prefix resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, PublicIpPrefixInner> beginCreateOrUpdate( - String resourceGroupName, String publicIpPrefixName, PublicIpPrefixInner parameters); - - /** - * Creates or updates a static or dynamic public IP prefix. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpPrefixName The name of the public IP prefix. - * @param parameters Parameters supplied to the create or update public IP prefix operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public IP prefix resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, PublicIpPrefixInner> beginCreateOrUpdate( - String resourceGroupName, String publicIpPrefixName, PublicIpPrefixInner parameters, Context context); - - /** - * Creates or updates a static or dynamic public IP prefix. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpPrefixName The name of the public IP prefix. - * @param parameters Parameters supplied to the create or update public IP prefix operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public IP prefix resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, String publicIpPrefixName, PublicIpPrefixInner parameters); - - /** - * Creates or updates a static or dynamic public IP prefix. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpPrefixName The name of the public IP prefix. - * @param parameters Parameters supplied to the create or update public IP prefix operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public IP prefix resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PublicIpPrefixInner createOrUpdate( - String resourceGroupName, String publicIpPrefixName, PublicIpPrefixInner parameters); - - /** - * Creates or updates a static or dynamic public IP prefix. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpPrefixName The name of the public IP prefix. - * @param parameters Parameters supplied to the create or update public IP prefix operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public IP prefix resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PublicIpPrefixInner createOrUpdate( - String resourceGroupName, String publicIpPrefixName, PublicIpPrefixInner parameters, Context context); - - /** - * Updates public IP prefix tags. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpPrefixName The name of the public IP prefix. - * @param parameters Parameters supplied to update public IP prefix tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public IP prefix resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> updateTagsWithResponseAsync( - String resourceGroupName, String publicIpPrefixName, TagsObject parameters); - - /** - * Updates public IP prefix tags. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpPrefixName The name of the public IP prefix. - * @param parameters Parameters supplied to update public IP prefix tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public IP prefix resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, PublicIpPrefixInner> beginUpdateTagsAsync( - String resourceGroupName, String publicIpPrefixName, TagsObject parameters); - - /** - * Updates public IP prefix tags. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpPrefixName The name of the public IP prefix. - * @param parameters Parameters supplied to update public IP prefix tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public IP prefix resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, PublicIpPrefixInner> beginUpdateTags( - String resourceGroupName, String publicIpPrefixName, TagsObject parameters); - - /** - * Updates public IP prefix tags. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpPrefixName The name of the public IP prefix. - * @param parameters Parameters supplied to update public IP prefix tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public IP prefix resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, PublicIpPrefixInner> beginUpdateTags( - String resourceGroupName, String publicIpPrefixName, TagsObject parameters, Context context); - - /** - * Updates public IP prefix tags. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpPrefixName The name of the public IP prefix. - * @param parameters Parameters supplied to update public IP prefix tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public IP prefix resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateTagsAsync( - String resourceGroupName, String publicIpPrefixName, TagsObject parameters); - - /** - * Updates public IP prefix tags. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpPrefixName The name of the public IP prefix. - * @param parameters Parameters supplied to update public IP prefix tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public IP prefix resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PublicIpPrefixInner updateTags(String resourceGroupName, String publicIpPrefixName, TagsObject parameters); - - /** - * Updates public IP prefix tags. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpPrefixName The name of the public IP prefix. - * @param parameters Parameters supplied to update public IP prefix tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public IP prefix resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PublicIpPrefixInner updateTags( - String resourceGroupName, String publicIpPrefixName, TagsObject parameters, Context context); - - /** - * Gets all the public IP prefixes in a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the public IP prefixes in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Gets all the public IP prefixes in a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the public IP prefixes in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Gets all the public IP prefixes in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the public IP prefixes in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Gets all public IP prefixes in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all public IP prefixes in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName); - - /** - * Gets all public IP prefixes in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all public IP prefixes in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Gets all public IP prefixes in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all public IP prefixes in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/RouteFilterRulesClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/RouteFilterRulesClient.java deleted file mode 100644 index 6c1fe05eba96..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/RouteFilterRulesClient.java +++ /dev/null @@ -1,498 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.models.RouteFilterRuleInner; -import com.azure.resourcemanager.network.models.PatchRouteFilterRule; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in RouteFilterRulesClient. */ -public interface RouteFilterRulesClient { - /** - * Deletes the specified rule from a route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param ruleName The name of the rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync( - String resourceGroupName, String routeFilterName, String ruleName); - - /** - * Deletes the specified rule from a route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param ruleName The name of the rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String routeFilterName, String ruleName); - - /** - * Deletes the specified rule from a route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param ruleName The name of the rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String routeFilterName, String ruleName); - - /** - * Deletes the specified rule from a route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param ruleName The name of the rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String routeFilterName, String ruleName, Context context); - - /** - * Deletes the specified rule from a route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param ruleName The name of the rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String routeFilterName, String ruleName); - - /** - * Deletes the specified rule from a route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param ruleName The name of the rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String routeFilterName, String ruleName); - - /** - * Deletes the specified rule from a route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param ruleName The name of the rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String routeFilterName, String ruleName, Context context); - - /** - * Gets the specified rule from a route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param ruleName The name of the rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified rule from a route filter. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync( - String resourceGroupName, String routeFilterName, String ruleName); - - /** - * Gets the specified rule from a route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param ruleName The name of the rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified rule from a route filter. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync(String resourceGroupName, String routeFilterName, String ruleName); - - /** - * Gets the specified rule from a route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param ruleName The name of the rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified rule from a route filter. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RouteFilterRuleInner get(String resourceGroupName, String routeFilterName, String ruleName); - - /** - * Gets the specified rule from a route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param ruleName The name of the rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified rule from a route filter. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String routeFilterName, String ruleName, Context context); - - /** - * Creates or updates a route in the specified route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param ruleName The name of the route filter rule. - * @param routeFilterRuleParameters Parameters supplied to the create or update route filter rule operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route Filter Rule Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String routeFilterName, - String ruleName, - RouteFilterRuleInner routeFilterRuleParameters); - - /** - * Creates or updates a route in the specified route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param ruleName The name of the route filter rule. - * @param routeFilterRuleParameters Parameters supplied to the create or update route filter rule operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route Filter Rule Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, RouteFilterRuleInner> beginCreateOrUpdateAsync( - String resourceGroupName, - String routeFilterName, - String ruleName, - RouteFilterRuleInner routeFilterRuleParameters); - - /** - * Creates or updates a route in the specified route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param ruleName The name of the route filter rule. - * @param routeFilterRuleParameters Parameters supplied to the create or update route filter rule operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route Filter Rule Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, RouteFilterRuleInner> beginCreateOrUpdate( - String resourceGroupName, - String routeFilterName, - String ruleName, - RouteFilterRuleInner routeFilterRuleParameters); - - /** - * Creates or updates a route in the specified route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param ruleName The name of the route filter rule. - * @param routeFilterRuleParameters Parameters supplied to the create or update route filter rule operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route Filter Rule Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, RouteFilterRuleInner> beginCreateOrUpdate( - String resourceGroupName, - String routeFilterName, - String ruleName, - RouteFilterRuleInner routeFilterRuleParameters, - Context context); - - /** - * Creates or updates a route in the specified route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param ruleName The name of the route filter rule. - * @param routeFilterRuleParameters Parameters supplied to the create or update route filter rule operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route Filter Rule Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, - String routeFilterName, - String ruleName, - RouteFilterRuleInner routeFilterRuleParameters); - - /** - * Creates or updates a route in the specified route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param ruleName The name of the route filter rule. - * @param routeFilterRuleParameters Parameters supplied to the create or update route filter rule operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route Filter Rule Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RouteFilterRuleInner createOrUpdate( - String resourceGroupName, - String routeFilterName, - String ruleName, - RouteFilterRuleInner routeFilterRuleParameters); - - /** - * Creates or updates a route in the specified route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param ruleName The name of the route filter rule. - * @param routeFilterRuleParameters Parameters supplied to the create or update route filter rule operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route Filter Rule Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RouteFilterRuleInner createOrUpdate( - String resourceGroupName, - String routeFilterName, - String ruleName, - RouteFilterRuleInner routeFilterRuleParameters, - Context context); - - /** - * Updates a route in the specified route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param ruleName The name of the route filter rule. - * @param routeFilterRuleParameters Parameters supplied to the update route filter rule operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route Filter Rule Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> updateWithResponseAsync( - String resourceGroupName, - String routeFilterName, - String ruleName, - PatchRouteFilterRule routeFilterRuleParameters); - - /** - * Updates a route in the specified route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param ruleName The name of the route filter rule. - * @param routeFilterRuleParameters Parameters supplied to the update route filter rule operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route Filter Rule Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, RouteFilterRuleInner> beginUpdateAsync( - String resourceGroupName, - String routeFilterName, - String ruleName, - PatchRouteFilterRule routeFilterRuleParameters); - - /** - * Updates a route in the specified route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param ruleName The name of the route filter rule. - * @param routeFilterRuleParameters Parameters supplied to the update route filter rule operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route Filter Rule Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, RouteFilterRuleInner> beginUpdate( - String resourceGroupName, - String routeFilterName, - String ruleName, - PatchRouteFilterRule routeFilterRuleParameters); - - /** - * Updates a route in the specified route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param ruleName The name of the route filter rule. - * @param routeFilterRuleParameters Parameters supplied to the update route filter rule operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route Filter Rule Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, RouteFilterRuleInner> beginUpdate( - String resourceGroupName, - String routeFilterName, - String ruleName, - PatchRouteFilterRule routeFilterRuleParameters, - Context context); - - /** - * Updates a route in the specified route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param ruleName The name of the route filter rule. - * @param routeFilterRuleParameters Parameters supplied to the update route filter rule operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route Filter Rule Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAsync( - String resourceGroupName, - String routeFilterName, - String ruleName, - PatchRouteFilterRule routeFilterRuleParameters); - - /** - * Updates a route in the specified route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param ruleName The name of the route filter rule. - * @param routeFilterRuleParameters Parameters supplied to the update route filter rule operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route Filter Rule Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RouteFilterRuleInner update( - String resourceGroupName, - String routeFilterName, - String ruleName, - PatchRouteFilterRule routeFilterRuleParameters); - - /** - * Updates a route in the specified route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param ruleName The name of the route filter rule. - * @param routeFilterRuleParameters Parameters supplied to the update route filter rule operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route Filter Rule Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RouteFilterRuleInner update( - String resourceGroupName, - String routeFilterName, - String ruleName, - PatchRouteFilterRule routeFilterRuleParameters, - Context context); - - /** - * Gets all RouteFilterRules in a route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all RouteFilterRules in a route filter. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByRouteFilterAsync(String resourceGroupName, String routeFilterName); - - /** - * Gets all RouteFilterRules in a route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all RouteFilterRules in a route filter. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByRouteFilter(String resourceGroupName, String routeFilterName); - - /** - * Gets all RouteFilterRules in a route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all RouteFilterRules in a route filter. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByRouteFilter( - String resourceGroupName, String routeFilterName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/RouteFiltersClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/RouteFiltersClient.java deleted file mode 100644 index e1c50db54af0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/RouteFiltersClient.java +++ /dev/null @@ -1,471 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.models.RouteFilterInner; -import com.azure.resourcemanager.network.models.PatchRouteFilter; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in RouteFiltersClient. */ -public interface RouteFiltersClient - extends InnerSupportsGet, InnerSupportsListing, InnerSupportsDelete { - /** - * Deletes the specified route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync(String resourceGroupName, String routeFilterName); - - /** - * Deletes the specified route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String routeFilterName); - - /** - * Deletes the specified route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String routeFilterName); - - /** - * Deletes the specified route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String routeFilterName, Context context); - - /** - * Deletes the specified route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String routeFilterName); - - /** - * Deletes the specified route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String routeFilterName); - - /** - * Deletes the specified route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String routeFilterName, Context context); - - /** - * Gets the specified route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param expand Expands referenced express route bgp peering resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified route filter. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String routeFilterName, String expand); - - /** - * Gets the specified route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param expand Expands referenced express route bgp peering resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified route filter. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync(String resourceGroupName, String routeFilterName, String expand); - - /** - * Gets the specified route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified route filter. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync(String resourceGroupName, String routeFilterName); - - /** - * Gets the specified route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified route filter. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RouteFilterInner getByResourceGroup(String resourceGroupName, String routeFilterName); - - /** - * Gets the specified route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param expand Expands referenced express route bgp peering resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified route filter. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String routeFilterName, String expand, Context context); - - /** - * Creates or updates a route filter in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param routeFilterParameters Parameters supplied to the create or update route filter operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route Filter Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String routeFilterName, RouteFilterInner routeFilterParameters); - - /** - * Creates or updates a route filter in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param routeFilterParameters Parameters supplied to the create or update route filter operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route Filter Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, RouteFilterInner> beginCreateOrUpdateAsync( - String resourceGroupName, String routeFilterName, RouteFilterInner routeFilterParameters); - - /** - * Creates or updates a route filter in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param routeFilterParameters Parameters supplied to the create or update route filter operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route Filter Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, RouteFilterInner> beginCreateOrUpdate( - String resourceGroupName, String routeFilterName, RouteFilterInner routeFilterParameters); - - /** - * Creates or updates a route filter in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param routeFilterParameters Parameters supplied to the create or update route filter operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route Filter Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, RouteFilterInner> beginCreateOrUpdate( - String resourceGroupName, String routeFilterName, RouteFilterInner routeFilterParameters, Context context); - - /** - * Creates or updates a route filter in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param routeFilterParameters Parameters supplied to the create or update route filter operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route Filter Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, String routeFilterName, RouteFilterInner routeFilterParameters); - - /** - * Creates or updates a route filter in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param routeFilterParameters Parameters supplied to the create or update route filter operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route Filter Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RouteFilterInner createOrUpdate( - String resourceGroupName, String routeFilterName, RouteFilterInner routeFilterParameters); - - /** - * Creates or updates a route filter in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param routeFilterParameters Parameters supplied to the create or update route filter operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route Filter Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RouteFilterInner createOrUpdate( - String resourceGroupName, String routeFilterName, RouteFilterInner routeFilterParameters, Context context); - - /** - * Updates a route filter in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param routeFilterParameters Parameters supplied to the update route filter operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route Filter Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> updateWithResponseAsync( - String resourceGroupName, String routeFilterName, PatchRouteFilter routeFilterParameters); - - /** - * Updates a route filter in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param routeFilterParameters Parameters supplied to the update route filter operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route Filter Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, RouteFilterInner> beginUpdateAsync( - String resourceGroupName, String routeFilterName, PatchRouteFilter routeFilterParameters); - - /** - * Updates a route filter in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param routeFilterParameters Parameters supplied to the update route filter operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route Filter Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, RouteFilterInner> beginUpdate( - String resourceGroupName, String routeFilterName, PatchRouteFilter routeFilterParameters); - - /** - * Updates a route filter in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param routeFilterParameters Parameters supplied to the update route filter operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route Filter Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, RouteFilterInner> beginUpdate( - String resourceGroupName, String routeFilterName, PatchRouteFilter routeFilterParameters, Context context); - - /** - * Updates a route filter in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param routeFilterParameters Parameters supplied to the update route filter operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route Filter Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAsync( - String resourceGroupName, String routeFilterName, PatchRouteFilter routeFilterParameters); - - /** - * Updates a route filter in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param routeFilterParameters Parameters supplied to the update route filter operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route Filter Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RouteFilterInner update(String resourceGroupName, String routeFilterName, PatchRouteFilter routeFilterParameters); - - /** - * Updates a route filter in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param routeFilterParameters Parameters supplied to the update route filter operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route Filter Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RouteFilterInner update( - String resourceGroupName, String routeFilterName, PatchRouteFilter routeFilterParameters, Context context); - - /** - * Gets all route filters in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all route filters in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName); - - /** - * Gets all route filters in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all route filters in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Gets all route filters in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all route filters in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * Gets all route filters in a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all route filters in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Gets all route filters in a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all route filters in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Gets all route filters in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all route filters in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/RouteTablesClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/RouteTablesClient.java deleted file mode 100644 index 39194defbb37..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/RouteTablesClient.java +++ /dev/null @@ -1,468 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.models.RouteTableInner; -import com.azure.resourcemanager.network.models.TagsObject; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in RouteTablesClient. */ -public interface RouteTablesClient - extends InnerSupportsGet, InnerSupportsListing, InnerSupportsDelete { - /** - * Deletes the specified route table. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync(String resourceGroupName, String routeTableName); - - /** - * Deletes the specified route table. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String routeTableName); - - /** - * Deletes the specified route table. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String routeTableName); - - /** - * Deletes the specified route table. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String routeTableName, Context context); - - /** - * Deletes the specified route table. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String routeTableName); - - /** - * Deletes the specified route table. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String routeTableName); - - /** - * Deletes the specified route table. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String routeTableName, Context context); - - /** - * Gets the specified route table. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param expand Expands referenced resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified route table. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String routeTableName, String expand); - - /** - * Gets the specified route table. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param expand Expands referenced resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified route table. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync(String resourceGroupName, String routeTableName, String expand); - - /** - * Gets the specified route table. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified route table. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync(String resourceGroupName, String routeTableName); - - /** - * Gets the specified route table. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified route table. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RouteTableInner getByResourceGroup(String resourceGroupName, String routeTableName); - - /** - * Gets the specified route table. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param expand Expands referenced resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified route table. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String routeTableName, String expand, Context context); - - /** - * Create or updates a route table in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param parameters Parameters supplied to the create or update route table operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route table resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String routeTableName, RouteTableInner parameters); - - /** - * Create or updates a route table in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param parameters Parameters supplied to the create or update route table operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route table resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, RouteTableInner> beginCreateOrUpdateAsync( - String resourceGroupName, String routeTableName, RouteTableInner parameters); - - /** - * Create or updates a route table in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param parameters Parameters supplied to the create or update route table operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route table resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, RouteTableInner> beginCreateOrUpdate( - String resourceGroupName, String routeTableName, RouteTableInner parameters); - - /** - * Create or updates a route table in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param parameters Parameters supplied to the create or update route table operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route table resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, RouteTableInner> beginCreateOrUpdate( - String resourceGroupName, String routeTableName, RouteTableInner parameters, Context context); - - /** - * Create or updates a route table in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param parameters Parameters supplied to the create or update route table operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route table resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, String routeTableName, RouteTableInner parameters); - - /** - * Create or updates a route table in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param parameters Parameters supplied to the create or update route table operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route table resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RouteTableInner createOrUpdate(String resourceGroupName, String routeTableName, RouteTableInner parameters); - - /** - * Create or updates a route table in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param parameters Parameters supplied to the create or update route table operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route table resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RouteTableInner createOrUpdate( - String resourceGroupName, String routeTableName, RouteTableInner parameters, Context context); - - /** - * Updates a route table tags. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param parameters Parameters supplied to update route table tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route table resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> updateTagsWithResponseAsync( - String resourceGroupName, String routeTableName, TagsObject parameters); - - /** - * Updates a route table tags. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param parameters Parameters supplied to update route table tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route table resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, RouteTableInner> beginUpdateTagsAsync( - String resourceGroupName, String routeTableName, TagsObject parameters); - - /** - * Updates a route table tags. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param parameters Parameters supplied to update route table tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route table resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, RouteTableInner> beginUpdateTags( - String resourceGroupName, String routeTableName, TagsObject parameters); - - /** - * Updates a route table tags. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param parameters Parameters supplied to update route table tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route table resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, RouteTableInner> beginUpdateTags( - String resourceGroupName, String routeTableName, TagsObject parameters, Context context); - - /** - * Updates a route table tags. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param parameters Parameters supplied to update route table tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route table resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateTagsAsync(String resourceGroupName, String routeTableName, TagsObject parameters); - - /** - * Updates a route table tags. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param parameters Parameters supplied to update route table tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route table resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RouteTableInner updateTags(String resourceGroupName, String routeTableName, TagsObject parameters); - - /** - * Updates a route table tags. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param parameters Parameters supplied to update route table tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route table resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RouteTableInner updateTags(String resourceGroupName, String routeTableName, TagsObject parameters, Context context); - - /** - * Gets all route tables in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all route tables in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName); - - /** - * Gets all route tables in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all route tables in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Gets all route tables in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all route tables in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * Gets all route tables in a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all route tables in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Gets all route tables in a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all route tables in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Gets all route tables in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all route tables in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/RoutesClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/RoutesClient.java deleted file mode 100644 index 3cb9703ec9d9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/RoutesClient.java +++ /dev/null @@ -1,335 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.models.RouteInner; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in RoutesClient. */ -public interface RoutesClient { - /** - * Deletes the specified route from a route table. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param routeName The name of the route. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync( - String resourceGroupName, String routeTableName, String routeName); - - /** - * Deletes the specified route from a route table. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param routeName The name of the route. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String routeTableName, String routeName); - - /** - * Deletes the specified route from a route table. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param routeName The name of the route. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String routeTableName, String routeName); - - /** - * Deletes the specified route from a route table. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param routeName The name of the route. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String routeTableName, String routeName, Context context); - - /** - * Deletes the specified route from a route table. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param routeName The name of the route. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String routeTableName, String routeName); - - /** - * Deletes the specified route from a route table. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param routeName The name of the route. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String routeTableName, String routeName); - - /** - * Deletes the specified route from a route table. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param routeName The name of the route. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String routeTableName, String routeName, Context context); - - /** - * Gets the specified route from a route table. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param routeName The name of the route. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified route from a route table. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync(String resourceGroupName, String routeTableName, String routeName); - - /** - * Gets the specified route from a route table. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param routeName The name of the route. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified route from a route table. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync(String resourceGroupName, String routeTableName, String routeName); - - /** - * Gets the specified route from a route table. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param routeName The name of the route. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified route from a route table. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RouteInner get(String resourceGroupName, String routeTableName, String routeName); - - /** - * Gets the specified route from a route table. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param routeName The name of the route. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified route from a route table. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String routeTableName, String routeName, Context context); - - /** - * Creates or updates a route in the specified route table. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param routeName The name of the route. - * @param routeParameters Parameters supplied to the create or update route operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String routeTableName, String routeName, RouteInner routeParameters); - - /** - * Creates or updates a route in the specified route table. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param routeName The name of the route. - * @param routeParameters Parameters supplied to the create or update route operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, RouteInner> beginCreateOrUpdateAsync( - String resourceGroupName, String routeTableName, String routeName, RouteInner routeParameters); - - /** - * Creates or updates a route in the specified route table. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param routeName The name of the route. - * @param routeParameters Parameters supplied to the create or update route operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, RouteInner> beginCreateOrUpdate( - String resourceGroupName, String routeTableName, String routeName, RouteInner routeParameters); - - /** - * Creates or updates a route in the specified route table. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param routeName The name of the route. - * @param routeParameters Parameters supplied to the create or update route operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, RouteInner> beginCreateOrUpdate( - String resourceGroupName, String routeTableName, String routeName, RouteInner routeParameters, Context context); - - /** - * Creates or updates a route in the specified route table. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param routeName The name of the route. - * @param routeParameters Parameters supplied to the create or update route operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, String routeTableName, String routeName, RouteInner routeParameters); - - /** - * Creates or updates a route in the specified route table. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param routeName The name of the route. - * @param routeParameters Parameters supplied to the create or update route operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RouteInner createOrUpdate( - String resourceGroupName, String routeTableName, String routeName, RouteInner routeParameters); - - /** - * Creates or updates a route in the specified route table. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param routeName The name of the route. - * @param routeParameters Parameters supplied to the create or update route operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RouteInner createOrUpdate( - String resourceGroupName, String routeTableName, String routeName, RouteInner routeParameters, Context context); - - /** - * Gets all routes in a route table. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all routes in a route table. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String resourceGroupName, String routeTableName); - - /** - * Gets all routes in a route table. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all routes in a route table. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String routeTableName); - - /** - * Gets all routes in a route table. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all routes in a route table. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String routeTableName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/SecurityRulesClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/SecurityRulesClient.java deleted file mode 100644 index db5c03d7bff1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/SecurityRulesClient.java +++ /dev/null @@ -1,361 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.models.SecurityRuleInner; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in SecurityRulesClient. */ -public interface SecurityRulesClient { - /** - * Deletes the specified network security rule. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param securityRuleName The name of the security rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync( - String resourceGroupName, String networkSecurityGroupName, String securityRuleName); - - /** - * Deletes the specified network security rule. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param securityRuleName The name of the security rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String networkSecurityGroupName, String securityRuleName); - - /** - * Deletes the specified network security rule. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param securityRuleName The name of the security rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String networkSecurityGroupName, String securityRuleName); - - /** - * Deletes the specified network security rule. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param securityRuleName The name of the security rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String networkSecurityGroupName, String securityRuleName, Context context); - - /** - * Deletes the specified network security rule. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param securityRuleName The name of the security rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName); - - /** - * Deletes the specified network security rule. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param securityRuleName The name of the security rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String networkSecurityGroupName, String securityRuleName); - - /** - * Deletes the specified network security rule. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param securityRuleName The name of the security rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String networkSecurityGroupName, String securityRuleName, Context context); - - /** - * Get the specified network security rule. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param securityRuleName The name of the security rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network security rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync( - String resourceGroupName, String networkSecurityGroupName, String securityRuleName); - - /** - * Get the specified network security rule. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param securityRuleName The name of the security rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network security rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync( - String resourceGroupName, String networkSecurityGroupName, String securityRuleName); - - /** - * Get the specified network security rule. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param securityRuleName The name of the security rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network security rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SecurityRuleInner get(String resourceGroupName, String networkSecurityGroupName, String securityRuleName); - - /** - * Get the specified network security rule. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param securityRuleName The name of the security rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network security rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String networkSecurityGroupName, String securityRuleName, Context context); - - /** - * Creates or updates a security rule in the specified network security group. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param securityRuleName The name of the security rule. - * @param securityRuleParameters Parameters supplied to the create or update network security rule operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return network security rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String networkSecurityGroupName, - String securityRuleName, - SecurityRuleInner securityRuleParameters); - - /** - * Creates or updates a security rule in the specified network security group. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param securityRuleName The name of the security rule. - * @param securityRuleParameters Parameters supplied to the create or update network security rule operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return network security rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, SecurityRuleInner> beginCreateOrUpdateAsync( - String resourceGroupName, - String networkSecurityGroupName, - String securityRuleName, - SecurityRuleInner securityRuleParameters); - - /** - * Creates or updates a security rule in the specified network security group. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param securityRuleName The name of the security rule. - * @param securityRuleParameters Parameters supplied to the create or update network security rule operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return network security rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, SecurityRuleInner> beginCreateOrUpdate( - String resourceGroupName, - String networkSecurityGroupName, - String securityRuleName, - SecurityRuleInner securityRuleParameters); - - /** - * Creates or updates a security rule in the specified network security group. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param securityRuleName The name of the security rule. - * @param securityRuleParameters Parameters supplied to the create or update network security rule operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return network security rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, SecurityRuleInner> beginCreateOrUpdate( - String resourceGroupName, - String networkSecurityGroupName, - String securityRuleName, - SecurityRuleInner securityRuleParameters, - Context context); - - /** - * Creates or updates a security rule in the specified network security group. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param securityRuleName The name of the security rule. - * @param securityRuleParameters Parameters supplied to the create or update network security rule operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return network security rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, - String networkSecurityGroupName, - String securityRuleName, - SecurityRuleInner securityRuleParameters); - - /** - * Creates or updates a security rule in the specified network security group. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param securityRuleName The name of the security rule. - * @param securityRuleParameters Parameters supplied to the create or update network security rule operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return network security rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SecurityRuleInner createOrUpdate( - String resourceGroupName, - String networkSecurityGroupName, - String securityRuleName, - SecurityRuleInner securityRuleParameters); - - /** - * Creates or updates a security rule in the specified network security group. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param securityRuleName The name of the security rule. - * @param securityRuleParameters Parameters supplied to the create or update network security rule operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return network security rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SecurityRuleInner createOrUpdate( - String resourceGroupName, - String networkSecurityGroupName, - String securityRuleName, - SecurityRuleInner securityRuleParameters, - Context context); - - /** - * Gets all security rules in a network security group. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all security rules in a network security group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String resourceGroupName, String networkSecurityGroupName); - - /** - * Gets all security rules in a network security group. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all security rules in a network security group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String networkSecurityGroupName); - - /** - * Gets all security rules in a network security group. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all security rules in a network security group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String networkSecurityGroupName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/ServiceEndpointPoliciesClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/ServiceEndpointPoliciesClient.java deleted file mode 100644 index dd4c5a8a6c50..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/ServiceEndpointPoliciesClient.java +++ /dev/null @@ -1,484 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.models.ServiceEndpointPolicyInner; -import com.azure.resourcemanager.network.models.TagsObject; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ServiceEndpointPoliciesClient. */ -public interface ServiceEndpointPoliciesClient - extends InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete { - /** - * Deletes the specified service endpoint policy. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync( - String resourceGroupName, String serviceEndpointPolicyName); - - /** - * Deletes the specified service endpoint policy. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String serviceEndpointPolicyName); - - /** - * Deletes the specified service endpoint policy. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String serviceEndpointPolicyName); - - /** - * Deletes the specified service endpoint policy. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String serviceEndpointPolicyName, Context context); - - /** - * Deletes the specified service endpoint policy. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String serviceEndpointPolicyName); - - /** - * Deletes the specified service endpoint policy. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String serviceEndpointPolicyName); - - /** - * Deletes the specified service endpoint policy. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String serviceEndpointPolicyName, Context context); - - /** - * Gets the specified service Endpoint Policies in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy. - * @param expand Expands referenced resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified service Endpoint Policies in a specified resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String serviceEndpointPolicyName, String expand); - - /** - * Gets the specified service Endpoint Policies in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy. - * @param expand Expands referenced resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified service Endpoint Policies in a specified resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync( - String resourceGroupName, String serviceEndpointPolicyName, String expand); - - /** - * Gets the specified service Endpoint Policies in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified service Endpoint Policies in a specified resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync( - String resourceGroupName, String serviceEndpointPolicyName); - - /** - * Gets the specified service Endpoint Policies in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified service Endpoint Policies in a specified resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ServiceEndpointPolicyInner getByResourceGroup(String resourceGroupName, String serviceEndpointPolicyName); - - /** - * Gets the specified service Endpoint Policies in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy. - * @param expand Expands referenced resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified service Endpoint Policies in a specified resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String serviceEndpointPolicyName, String expand, Context context); - - /** - * Creates or updates a service Endpoint Policies. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy. - * @param parameters Parameters supplied to the create or update service endpoint policy operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service End point policy resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String serviceEndpointPolicyName, ServiceEndpointPolicyInner parameters); - - /** - * Creates or updates a service Endpoint Policies. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy. - * @param parameters Parameters supplied to the create or update service endpoint policy operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service End point policy resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, ServiceEndpointPolicyInner> beginCreateOrUpdateAsync( - String resourceGroupName, String serviceEndpointPolicyName, ServiceEndpointPolicyInner parameters); - - /** - * Creates or updates a service Endpoint Policies. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy. - * @param parameters Parameters supplied to the create or update service endpoint policy operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service End point policy resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ServiceEndpointPolicyInner> beginCreateOrUpdate( - String resourceGroupName, String serviceEndpointPolicyName, ServiceEndpointPolicyInner parameters); - - /** - * Creates or updates a service Endpoint Policies. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy. - * @param parameters Parameters supplied to the create or update service endpoint policy operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service End point policy resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ServiceEndpointPolicyInner> beginCreateOrUpdate( - String resourceGroupName, - String serviceEndpointPolicyName, - ServiceEndpointPolicyInner parameters, - Context context); - - /** - * Creates or updates a service Endpoint Policies. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy. - * @param parameters Parameters supplied to the create or update service endpoint policy operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service End point policy resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, String serviceEndpointPolicyName, ServiceEndpointPolicyInner parameters); - - /** - * Creates or updates a service Endpoint Policies. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy. - * @param parameters Parameters supplied to the create or update service endpoint policy operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service End point policy resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ServiceEndpointPolicyInner createOrUpdate( - String resourceGroupName, String serviceEndpointPolicyName, ServiceEndpointPolicyInner parameters); - - /** - * Creates or updates a service Endpoint Policies. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy. - * @param parameters Parameters supplied to the create or update service endpoint policy operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service End point policy resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ServiceEndpointPolicyInner createOrUpdate( - String resourceGroupName, - String serviceEndpointPolicyName, - ServiceEndpointPolicyInner parameters, - Context context); - - /** - * Updates service Endpoint Policies. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy. - * @param parameters Parameters supplied to update service endpoint policy tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service End point policy resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> updateWithResponseAsync( - String resourceGroupName, String serviceEndpointPolicyName, TagsObject parameters); - - /** - * Updates service Endpoint Policies. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy. - * @param parameters Parameters supplied to update service endpoint policy tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service End point policy resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, ServiceEndpointPolicyInner> beginUpdateAsync( - String resourceGroupName, String serviceEndpointPolicyName, TagsObject parameters); - - /** - * Updates service Endpoint Policies. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy. - * @param parameters Parameters supplied to update service endpoint policy tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service End point policy resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ServiceEndpointPolicyInner> beginUpdate( - String resourceGroupName, String serviceEndpointPolicyName, TagsObject parameters); - - /** - * Updates service Endpoint Policies. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy. - * @param parameters Parameters supplied to update service endpoint policy tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service End point policy resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ServiceEndpointPolicyInner> beginUpdate( - String resourceGroupName, String serviceEndpointPolicyName, TagsObject parameters, Context context); - - /** - * Updates service Endpoint Policies. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy. - * @param parameters Parameters supplied to update service endpoint policy tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service End point policy resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAsync( - String resourceGroupName, String serviceEndpointPolicyName, TagsObject parameters); - - /** - * Updates service Endpoint Policies. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy. - * @param parameters Parameters supplied to update service endpoint policy tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service End point policy resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ServiceEndpointPolicyInner update( - String resourceGroupName, String serviceEndpointPolicyName, TagsObject parameters); - - /** - * Updates service Endpoint Policies. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy. - * @param parameters Parameters supplied to update service endpoint policy tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service End point policy resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ServiceEndpointPolicyInner update( - String resourceGroupName, String serviceEndpointPolicyName, TagsObject parameters, Context context); - - /** - * Gets all the service endpoint policies in a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the service endpoint policies in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Gets all the service endpoint policies in a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the service endpoint policies in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Gets all the service endpoint policies in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the service endpoint policies in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Gets all service endpoint Policies in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all service endpoint Policies in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName); - - /** - * Gets all service endpoint Policies in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all service endpoint Policies in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Gets all service endpoint Policies in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all service endpoint Policies in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/ServiceEndpointPolicyDefinitionsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/ServiceEndpointPolicyDefinitionsClient.java deleted file mode 100644 index 3d31e09bfa28..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/ServiceEndpointPolicyDefinitionsClient.java +++ /dev/null @@ -1,388 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.models.ServiceEndpointPolicyDefinitionInner; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in ServiceEndpointPolicyDefinitionsClient. - */ -public interface ServiceEndpointPolicyDefinitionsClient { - /** - * Deletes the specified ServiceEndpoint policy definitions. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the Service Endpoint Policy. - * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync( - String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName); - - /** - * Deletes the specified ServiceEndpoint policy definitions. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the Service Endpoint Policy. - * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName); - - /** - * Deletes the specified ServiceEndpoint policy definitions. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the Service Endpoint Policy. - * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName); - - /** - * Deletes the specified ServiceEndpoint policy definitions. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the Service Endpoint Policy. - * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, - String serviceEndpointPolicyName, - String serviceEndpointPolicyDefinitionName, - Context context); - - /** - * Deletes the specified ServiceEndpoint policy definitions. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the Service Endpoint Policy. - * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync( - String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName); - - /** - * Deletes the specified ServiceEndpoint policy definitions. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the Service Endpoint Policy. - * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName); - - /** - * Deletes the specified ServiceEndpoint policy definitions. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the Service Endpoint Policy. - * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete( - String resourceGroupName, - String serviceEndpointPolicyName, - String serviceEndpointPolicyDefinitionName, - Context context); - - /** - * Get the specified service endpoint policy definitions from service endpoint policy. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy name. - * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified service endpoint policy definitions from service endpoint policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync( - String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName); - - /** - * Get the specified service endpoint policy definitions from service endpoint policy. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy name. - * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified service endpoint policy definitions from service endpoint policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync( - String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName); - - /** - * Get the specified service endpoint policy definitions from service endpoint policy. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy name. - * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified service endpoint policy definitions from service endpoint policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ServiceEndpointPolicyDefinitionInner get( - String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName); - - /** - * Get the specified service endpoint policy definitions from service endpoint policy. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy name. - * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified service endpoint policy definitions from service endpoint policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, - String serviceEndpointPolicyName, - String serviceEndpointPolicyDefinitionName, - Context context); - - /** - * Creates or updates a service endpoint policy definition in the specified service endpoint policy. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy. - * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition name. - * @param serviceEndpointPolicyDefinitions Parameters supplied to the create or update service endpoint policy - * operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service Endpoint policy definitions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String serviceEndpointPolicyName, - String serviceEndpointPolicyDefinitionName, - ServiceEndpointPolicyDefinitionInner serviceEndpointPolicyDefinitions); - - /** - * Creates or updates a service endpoint policy definition in the specified service endpoint policy. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy. - * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition name. - * @param serviceEndpointPolicyDefinitions Parameters supplied to the create or update service endpoint policy - * operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service Endpoint policy definitions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, ServiceEndpointPolicyDefinitionInner> - beginCreateOrUpdateAsync( - String resourceGroupName, - String serviceEndpointPolicyName, - String serviceEndpointPolicyDefinitionName, - ServiceEndpointPolicyDefinitionInner serviceEndpointPolicyDefinitions); - - /** - * Creates or updates a service endpoint policy definition in the specified service endpoint policy. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy. - * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition name. - * @param serviceEndpointPolicyDefinitions Parameters supplied to the create or update service endpoint policy - * operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service Endpoint policy definitions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ServiceEndpointPolicyDefinitionInner> - beginCreateOrUpdate( - String resourceGroupName, - String serviceEndpointPolicyName, - String serviceEndpointPolicyDefinitionName, - ServiceEndpointPolicyDefinitionInner serviceEndpointPolicyDefinitions); - - /** - * Creates or updates a service endpoint policy definition in the specified service endpoint policy. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy. - * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition name. - * @param serviceEndpointPolicyDefinitions Parameters supplied to the create or update service endpoint policy - * operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service Endpoint policy definitions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ServiceEndpointPolicyDefinitionInner> - beginCreateOrUpdate( - String resourceGroupName, - String serviceEndpointPolicyName, - String serviceEndpointPolicyDefinitionName, - ServiceEndpointPolicyDefinitionInner serviceEndpointPolicyDefinitions, - Context context); - - /** - * Creates or updates a service endpoint policy definition in the specified service endpoint policy. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy. - * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition name. - * @param serviceEndpointPolicyDefinitions Parameters supplied to the create or update service endpoint policy - * operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service Endpoint policy definitions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, - String serviceEndpointPolicyName, - String serviceEndpointPolicyDefinitionName, - ServiceEndpointPolicyDefinitionInner serviceEndpointPolicyDefinitions); - - /** - * Creates or updates a service endpoint policy definition in the specified service endpoint policy. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy. - * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition name. - * @param serviceEndpointPolicyDefinitions Parameters supplied to the create or update service endpoint policy - * operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service Endpoint policy definitions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ServiceEndpointPolicyDefinitionInner createOrUpdate( - String resourceGroupName, - String serviceEndpointPolicyName, - String serviceEndpointPolicyDefinitionName, - ServiceEndpointPolicyDefinitionInner serviceEndpointPolicyDefinitions); - - /** - * Creates or updates a service endpoint policy definition in the specified service endpoint policy. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy. - * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition name. - * @param serviceEndpointPolicyDefinitions Parameters supplied to the create or update service endpoint policy - * operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service Endpoint policy definitions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ServiceEndpointPolicyDefinitionInner createOrUpdate( - String resourceGroupName, - String serviceEndpointPolicyName, - String serviceEndpointPolicyDefinitionName, - ServiceEndpointPolicyDefinitionInner serviceEndpointPolicyDefinitions, - Context context); - - /** - * Gets all service endpoint policy definitions in a service end point policy. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all service endpoint policy definitions in a service end point policy. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync( - String resourceGroupName, String serviceEndpointPolicyName); - - /** - * Gets all service endpoint policy definitions in a service end point policy. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all service endpoint policy definitions in a service end point policy. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup( - String resourceGroupName, String serviceEndpointPolicyName); - - /** - * Gets all service endpoint policy definitions in a service end point policy. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all service endpoint policy definitions in a service end point policy. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup( - String resourceGroupName, String serviceEndpointPolicyName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/SubnetsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/SubnetsClient.java deleted file mode 100644 index bb8855c8be30..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/SubnetsClient.java +++ /dev/null @@ -1,362 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.models.SubnetInner; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in SubnetsClient. */ -public interface SubnetsClient { - /** - * Deletes the specified subnet. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param subnetName The name of the subnet. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync( - String resourceGroupName, String virtualNetworkName, String subnetName); - - /** - * Deletes the specified subnet. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param subnetName The name of the subnet. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String virtualNetworkName, String subnetName); - - /** - * Deletes the specified subnet. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param subnetName The name of the subnet. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String virtualNetworkName, String subnetName); - - /** - * Deletes the specified subnet. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param subnetName The name of the subnet. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String virtualNetworkName, String subnetName, Context context); - - /** - * Deletes the specified subnet. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param subnetName The name of the subnet. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String virtualNetworkName, String subnetName); - - /** - * Deletes the specified subnet. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param subnetName The name of the subnet. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String virtualNetworkName, String subnetName); - - /** - * Deletes the specified subnet. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param subnetName The name of the subnet. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String virtualNetworkName, String subnetName, Context context); - - /** - * Gets the specified subnet by virtual network and resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param subnetName The name of the subnet. - * @param expand Expands referenced resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified subnet by virtual network and resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync( - String resourceGroupName, String virtualNetworkName, String subnetName, String expand); - - /** - * Gets the specified subnet by virtual network and resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param subnetName The name of the subnet. - * @param expand Expands referenced resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified subnet by virtual network and resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync(String resourceGroupName, String virtualNetworkName, String subnetName, String expand); - - /** - * Gets the specified subnet by virtual network and resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param subnetName The name of the subnet. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified subnet by virtual network and resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync(String resourceGroupName, String virtualNetworkName, String subnetName); - - /** - * Gets the specified subnet by virtual network and resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param subnetName The name of the subnet. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified subnet by virtual network and resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SubnetInner get(String resourceGroupName, String virtualNetworkName, String subnetName); - - /** - * Gets the specified subnet by virtual network and resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param subnetName The name of the subnet. - * @param expand Expands referenced resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified subnet by virtual network and resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String virtualNetworkName, String subnetName, String expand, Context context); - - /** - * Creates or updates a subnet in the specified virtual network. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param subnetName The name of the subnet. - * @param subnetParameters Parameters supplied to the create or update subnet operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return subnet in a virtual network resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String virtualNetworkName, String subnetName, SubnetInner subnetParameters); - - /** - * Creates or updates a subnet in the specified virtual network. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param subnetName The name of the subnet. - * @param subnetParameters Parameters supplied to the create or update subnet operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return subnet in a virtual network resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, SubnetInner> beginCreateOrUpdateAsync( - String resourceGroupName, String virtualNetworkName, String subnetName, SubnetInner subnetParameters); - - /** - * Creates or updates a subnet in the specified virtual network. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param subnetName The name of the subnet. - * @param subnetParameters Parameters supplied to the create or update subnet operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return subnet in a virtual network resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, SubnetInner> beginCreateOrUpdate( - String resourceGroupName, String virtualNetworkName, String subnetName, SubnetInner subnetParameters); - - /** - * Creates or updates a subnet in the specified virtual network. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param subnetName The name of the subnet. - * @param subnetParameters Parameters supplied to the create or update subnet operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return subnet in a virtual network resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, SubnetInner> beginCreateOrUpdate( - String resourceGroupName, - String virtualNetworkName, - String subnetName, - SubnetInner subnetParameters, - Context context); - - /** - * Creates or updates a subnet in the specified virtual network. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param subnetName The name of the subnet. - * @param subnetParameters Parameters supplied to the create or update subnet operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return subnet in a virtual network resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, String virtualNetworkName, String subnetName, SubnetInner subnetParameters); - - /** - * Creates or updates a subnet in the specified virtual network. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param subnetName The name of the subnet. - * @param subnetParameters Parameters supplied to the create or update subnet operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return subnet in a virtual network resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SubnetInner createOrUpdate( - String resourceGroupName, String virtualNetworkName, String subnetName, SubnetInner subnetParameters); - - /** - * Creates or updates a subnet in the specified virtual network. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param subnetName The name of the subnet. - * @param subnetParameters Parameters supplied to the create or update subnet operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return subnet in a virtual network resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SubnetInner createOrUpdate( - String resourceGroupName, - String virtualNetworkName, - String subnetName, - SubnetInner subnetParameters, - Context context); - - /** - * Gets all subnets in a virtual network. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all subnets in a virtual network. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String resourceGroupName, String virtualNetworkName); - - /** - * Gets all subnets in a virtual network. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all subnets in a virtual network. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String virtualNetworkName); - - /** - * Gets all subnets in a virtual network. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all subnets in a virtual network. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String virtualNetworkName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/UsagesClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/UsagesClient.java deleted file mode 100644 index ca7f678a0403..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/UsagesClient.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.network.fluent.models.UsageInner; - -/** An instance of this class provides access to all the operations defined in UsagesClient. */ -public interface UsagesClient { - /** - * List network usages for a subscription. - * - * @param location The location where resource usage is queried. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list usages operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String location); - - /** - * List network usages for a subscription. - * - * @param location The location where resource usage is queried. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list usages operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String location); - - /** - * List network usages for a subscription. - * - * @param location The location where resource usage is queried. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list usages operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String location, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/VirtualHubsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/VirtualHubsClient.java deleted file mode 100644 index bedf638de70e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/VirtualHubsClient.java +++ /dev/null @@ -1,455 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.models.VirtualHubInner; -import com.azure.resourcemanager.network.models.TagsObject; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in VirtualHubsClient. */ -public interface VirtualHubsClient - extends InnerSupportsGet, InnerSupportsListing, InnerSupportsDelete { - /** - * Retrieves the details of a VirtualHub. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param virtualHubName The name of the VirtualHub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualHub Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String virtualHubName); - - /** - * Retrieves the details of a VirtualHub. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param virtualHubName The name of the VirtualHub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualHub Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync(String resourceGroupName, String virtualHubName); - - /** - * Retrieves the details of a VirtualHub. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param virtualHubName The name of the VirtualHub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualHub Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualHubInner getByResourceGroup(String resourceGroupName, String virtualHubName); - - /** - * Retrieves the details of a VirtualHub. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param virtualHubName The name of the VirtualHub. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualHub Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String virtualHubName, Context context); - - /** - * Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param virtualHubName The name of the VirtualHub. - * @param virtualHubParameters Parameters supplied to create or update VirtualHub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualHub Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String virtualHubName, VirtualHubInner virtualHubParameters); - - /** - * Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param virtualHubName The name of the VirtualHub. - * @param virtualHubParameters Parameters supplied to create or update VirtualHub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualHub Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, VirtualHubInner> beginCreateOrUpdateAsync( - String resourceGroupName, String virtualHubName, VirtualHubInner virtualHubParameters); - - /** - * Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param virtualHubName The name of the VirtualHub. - * @param virtualHubParameters Parameters supplied to create or update VirtualHub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualHub Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VirtualHubInner> beginCreateOrUpdate( - String resourceGroupName, String virtualHubName, VirtualHubInner virtualHubParameters); - - /** - * Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param virtualHubName The name of the VirtualHub. - * @param virtualHubParameters Parameters supplied to create or update VirtualHub. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualHub Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VirtualHubInner> beginCreateOrUpdate( - String resourceGroupName, String virtualHubName, VirtualHubInner virtualHubParameters, Context context); - - /** - * Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param virtualHubName The name of the VirtualHub. - * @param virtualHubParameters Parameters supplied to create or update VirtualHub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualHub Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, String virtualHubName, VirtualHubInner virtualHubParameters); - - /** - * Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param virtualHubName The name of the VirtualHub. - * @param virtualHubParameters Parameters supplied to create or update VirtualHub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualHub Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualHubInner createOrUpdate( - String resourceGroupName, String virtualHubName, VirtualHubInner virtualHubParameters); - - /** - * Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param virtualHubName The name of the VirtualHub. - * @param virtualHubParameters Parameters supplied to create or update VirtualHub. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualHub Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualHubInner createOrUpdate( - String resourceGroupName, String virtualHubName, VirtualHubInner virtualHubParameters, Context context); - - /** - * Updates VirtualHub tags. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param virtualHubName The name of the VirtualHub. - * @param virtualHubParameters Parameters supplied to update VirtualHub tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualHub Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> updateTagsWithResponseAsync( - String resourceGroupName, String virtualHubName, TagsObject virtualHubParameters); - - /** - * Updates VirtualHub tags. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param virtualHubName The name of the VirtualHub. - * @param virtualHubParameters Parameters supplied to update VirtualHub tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualHub Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, VirtualHubInner> beginUpdateTagsAsync( - String resourceGroupName, String virtualHubName, TagsObject virtualHubParameters); - - /** - * Updates VirtualHub tags. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param virtualHubName The name of the VirtualHub. - * @param virtualHubParameters Parameters supplied to update VirtualHub tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualHub Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VirtualHubInner> beginUpdateTags( - String resourceGroupName, String virtualHubName, TagsObject virtualHubParameters); - - /** - * Updates VirtualHub tags. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param virtualHubName The name of the VirtualHub. - * @param virtualHubParameters Parameters supplied to update VirtualHub tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualHub Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VirtualHubInner> beginUpdateTags( - String resourceGroupName, String virtualHubName, TagsObject virtualHubParameters, Context context); - - /** - * Updates VirtualHub tags. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param virtualHubName The name of the VirtualHub. - * @param virtualHubParameters Parameters supplied to update VirtualHub tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualHub Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateTagsAsync( - String resourceGroupName, String virtualHubName, TagsObject virtualHubParameters); - - /** - * Updates VirtualHub tags. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param virtualHubName The name of the VirtualHub. - * @param virtualHubParameters Parameters supplied to update VirtualHub tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualHub Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualHubInner updateTags(String resourceGroupName, String virtualHubName, TagsObject virtualHubParameters); - - /** - * Updates VirtualHub tags. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param virtualHubName The name of the VirtualHub. - * @param virtualHubParameters Parameters supplied to update VirtualHub tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualHub Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualHubInner updateTags( - String resourceGroupName, String virtualHubName, TagsObject virtualHubParameters, Context context); - - /** - * Deletes a VirtualHub. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param virtualHubName The name of the VirtualHub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync(String resourceGroupName, String virtualHubName); - - /** - * Deletes a VirtualHub. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param virtualHubName The name of the VirtualHub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String virtualHubName); - - /** - * Deletes a VirtualHub. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param virtualHubName The name of the VirtualHub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String virtualHubName); - - /** - * Deletes a VirtualHub. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param virtualHubName The name of the VirtualHub. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String virtualHubName, Context context); - - /** - * Deletes a VirtualHub. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param virtualHubName The name of the VirtualHub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String virtualHubName); - - /** - * Deletes a VirtualHub. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param virtualHubName The name of the VirtualHub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String virtualHubName); - - /** - * Deletes a VirtualHub. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param virtualHubName The name of the VirtualHub. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String virtualHubName, Context context); - - /** - * Lists all the VirtualHubs in a resource group. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VirtualHubs. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName); - - /** - * Lists all the VirtualHubs in a resource group. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VirtualHubs. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Lists all the VirtualHubs in a resource group. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VirtualHubs. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * Lists all the VirtualHubs in a subscription. - * - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VirtualHubs. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Lists all the VirtualHubs in a subscription. - * - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VirtualHubs. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Lists all the VirtualHubs in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VirtualHubs. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/VirtualNetworkGatewayConnectionsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/VirtualNetworkGatewayConnectionsClient.java deleted file mode 100644 index 5d714add278b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/VirtualNetworkGatewayConnectionsClient.java +++ /dev/null @@ -1,777 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.models.ConnectionResetSharedKeyInner; -import com.azure.resourcemanager.network.fluent.models.ConnectionSharedKeyInner; -import com.azure.resourcemanager.network.fluent.models.VirtualNetworkGatewayConnectionInner; -import com.azure.resourcemanager.network.models.TagsObject; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in VirtualNetworkGatewayConnectionsClient. - */ -public interface VirtualNetworkGatewayConnectionsClient - extends InnerSupportsGet, InnerSupportsDelete { - /** - * Creates or updates a virtual network gateway connection in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. - * @param parameters Parameters supplied to the create or update virtual network gateway connection operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String virtualNetworkGatewayConnectionName, - VirtualNetworkGatewayConnectionInner parameters); - - /** - * Creates or updates a virtual network gateway connection in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. - * @param parameters Parameters supplied to the create or update virtual network gateway connection operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, VirtualNetworkGatewayConnectionInner> - beginCreateOrUpdateAsync( - String resourceGroupName, - String virtualNetworkGatewayConnectionName, - VirtualNetworkGatewayConnectionInner parameters); - - /** - * Creates or updates a virtual network gateway connection in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. - * @param parameters Parameters supplied to the create or update virtual network gateway connection operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VirtualNetworkGatewayConnectionInner> - beginCreateOrUpdate( - String resourceGroupName, - String virtualNetworkGatewayConnectionName, - VirtualNetworkGatewayConnectionInner parameters); - - /** - * Creates or updates a virtual network gateway connection in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. - * @param parameters Parameters supplied to the create or update virtual network gateway connection operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VirtualNetworkGatewayConnectionInner> - beginCreateOrUpdate( - String resourceGroupName, - String virtualNetworkGatewayConnectionName, - VirtualNetworkGatewayConnectionInner parameters, - Context context); - - /** - * Creates or updates a virtual network gateway connection in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. - * @param parameters Parameters supplied to the create or update virtual network gateway connection operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, - String virtualNetworkGatewayConnectionName, - VirtualNetworkGatewayConnectionInner parameters); - - /** - * Creates or updates a virtual network gateway connection in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. - * @param parameters Parameters supplied to the create or update virtual network gateway connection operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualNetworkGatewayConnectionInner createOrUpdate( - String resourceGroupName, - String virtualNetworkGatewayConnectionName, - VirtualNetworkGatewayConnectionInner parameters); - - /** - * Creates or updates a virtual network gateway connection in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. - * @param parameters Parameters supplied to the create or update virtual network gateway connection operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualNetworkGatewayConnectionInner createOrUpdate( - String resourceGroupName, - String virtualNetworkGatewayConnectionName, - VirtualNetworkGatewayConnectionInner parameters, - Context context); - - /** - * Gets the specified virtual network gateway connection by resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified virtual network gateway connection by resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String virtualNetworkGatewayConnectionName); - - /** - * Gets the specified virtual network gateway connection by resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified virtual network gateway connection by resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync( - String resourceGroupName, String virtualNetworkGatewayConnectionName); - - /** - * Gets the specified virtual network gateway connection by resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified virtual network gateway connection by resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualNetworkGatewayConnectionInner getByResourceGroup( - String resourceGroupName, String virtualNetworkGatewayConnectionName); - - /** - * Gets the specified virtual network gateway connection by resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified virtual network gateway connection by resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String virtualNetworkGatewayConnectionName, Context context); - - /** - * Deletes the specified virtual network Gateway connection. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync( - String resourceGroupName, String virtualNetworkGatewayConnectionName); - - /** - * Deletes the specified virtual network Gateway connection. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String virtualNetworkGatewayConnectionName); - - /** - * Deletes the specified virtual network Gateway connection. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String virtualNetworkGatewayConnectionName); - - /** - * Deletes the specified virtual network Gateway connection. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String virtualNetworkGatewayConnectionName, Context context); - - /** - * Deletes the specified virtual network Gateway connection. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName); - - /** - * Deletes the specified virtual network Gateway connection. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String virtualNetworkGatewayConnectionName); - - /** - * Deletes the specified virtual network Gateway connection. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String virtualNetworkGatewayConnectionName, Context context); - - /** - * Updates a virtual network gateway connection tags. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. - * @param parameters Parameters supplied to update virtual network gateway connection tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> updateTagsWithResponseAsync( - String resourceGroupName, String virtualNetworkGatewayConnectionName, TagsObject parameters); - - /** - * Updates a virtual network gateway connection tags. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. - * @param parameters Parameters supplied to update virtual network gateway connection tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, VirtualNetworkGatewayConnectionInner> - beginUpdateTagsAsync( - String resourceGroupName, String virtualNetworkGatewayConnectionName, TagsObject parameters); - - /** - * Updates a virtual network gateway connection tags. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. - * @param parameters Parameters supplied to update virtual network gateway connection tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VirtualNetworkGatewayConnectionInner> beginUpdateTags( - String resourceGroupName, String virtualNetworkGatewayConnectionName, TagsObject parameters); - - /** - * Updates a virtual network gateway connection tags. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. - * @param parameters Parameters supplied to update virtual network gateway connection tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VirtualNetworkGatewayConnectionInner> beginUpdateTags( - String resourceGroupName, String virtualNetworkGatewayConnectionName, TagsObject parameters, Context context); - - /** - * Updates a virtual network gateway connection tags. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. - * @param parameters Parameters supplied to update virtual network gateway connection tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateTagsAsync( - String resourceGroupName, String virtualNetworkGatewayConnectionName, TagsObject parameters); - - /** - * Updates a virtual network gateway connection tags. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. - * @param parameters Parameters supplied to update virtual network gateway connection tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualNetworkGatewayConnectionInner updateTags( - String resourceGroupName, String virtualNetworkGatewayConnectionName, TagsObject parameters); - - /** - * Updates a virtual network gateway connection tags. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. - * @param parameters Parameters supplied to update virtual network gateway connection tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualNetworkGatewayConnectionInner updateTags( - String resourceGroupName, String virtualNetworkGatewayConnectionName, TagsObject parameters, Context context); - - /** - * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key - * for passed virtual network gateway connection in the specified resource group through Network resource provider. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name. - * @param parameters Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation - * throughNetwork resource provider. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for GetConnectionSharedKey API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> setSharedKeyWithResponseAsync( - String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionSharedKeyInner parameters); - - /** - * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key - * for passed virtual network gateway connection in the specified resource group through Network resource provider. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name. - * @param parameters Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation - * throughNetwork resource provider. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for GetConnectionSharedKey API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, ConnectionSharedKeyInner> beginSetSharedKeyAsync( - String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionSharedKeyInner parameters); - - /** - * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key - * for passed virtual network gateway connection in the specified resource group through Network resource provider. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name. - * @param parameters Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation - * throughNetwork resource provider. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for GetConnectionSharedKey API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ConnectionSharedKeyInner> beginSetSharedKey( - String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionSharedKeyInner parameters); - - /** - * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key - * for passed virtual network gateway connection in the specified resource group through Network resource provider. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name. - * @param parameters Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation - * throughNetwork resource provider. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for GetConnectionSharedKey API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ConnectionSharedKeyInner> beginSetSharedKey( - String resourceGroupName, - String virtualNetworkGatewayConnectionName, - ConnectionSharedKeyInner parameters, - Context context); - - /** - * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key - * for passed virtual network gateway connection in the specified resource group through Network resource provider. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name. - * @param parameters Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation - * throughNetwork resource provider. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for GetConnectionSharedKey API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono setSharedKeyAsync( - String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionSharedKeyInner parameters); - - /** - * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key - * for passed virtual network gateway connection in the specified resource group through Network resource provider. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name. - * @param parameters Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation - * throughNetwork resource provider. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for GetConnectionSharedKey API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ConnectionSharedKeyInner setSharedKey( - String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionSharedKeyInner parameters); - - /** - * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key - * for passed virtual network gateway connection in the specified resource group through Network resource provider. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name. - * @param parameters Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation - * throughNetwork resource provider. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for GetConnectionSharedKey API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ConnectionSharedKeyInner setSharedKey( - String resourceGroupName, - String virtualNetworkGatewayConnectionName, - ConnectionSharedKeyInner parameters, - Context context); - - /** - * The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual - * network gateway connection shared key through Network resource provider. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The virtual network gateway connection shared key name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for GetConnectionSharedKey API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getSharedKeyWithResponseAsync( - String resourceGroupName, String virtualNetworkGatewayConnectionName); - - /** - * The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual - * network gateway connection shared key through Network resource provider. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The virtual network gateway connection shared key name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for GetConnectionSharedKey API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getSharedKeyAsync( - String resourceGroupName, String virtualNetworkGatewayConnectionName); - - /** - * The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual - * network gateway connection shared key through Network resource provider. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The virtual network gateway connection shared key name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for GetConnectionSharedKey API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ConnectionSharedKeyInner getSharedKey(String resourceGroupName, String virtualNetworkGatewayConnectionName); - - /** - * The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual - * network gateway connection shared key through Network resource provider. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The virtual network gateway connection shared key name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for GetConnectionSharedKey API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getSharedKeyWithResponse( - String resourceGroupName, String virtualNetworkGatewayConnectionName, Context context); - - /** - * The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections - * created. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the ListVirtualNetworkGatewayConnections API service call. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName); - - /** - * The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections - * created. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the ListVirtualNetworkGatewayConnections API service call. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections - * created. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the ListVirtualNetworkGatewayConnections API service call. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared - * key for passed virtual network gateway connection in the specified resource group through Network resource - * provider. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. - * @param parameters Parameters supplied to the begin reset virtual network gateway connection shared key operation - * through network resource provider. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the virtual network connection reset shared key. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> resetSharedKeyWithResponseAsync( - String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionResetSharedKeyInner parameters); - - /** - * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared - * key for passed virtual network gateway connection in the specified resource group through Network resource - * provider. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. - * @param parameters Parameters supplied to the begin reset virtual network gateway connection shared key operation - * through network resource provider. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the virtual network connection reset shared key. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, ConnectionResetSharedKeyInner> beginResetSharedKeyAsync( - String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionResetSharedKeyInner parameters); - - /** - * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared - * key for passed virtual network gateway connection in the specified resource group through Network resource - * provider. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. - * @param parameters Parameters supplied to the begin reset virtual network gateway connection shared key operation - * through network resource provider. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the virtual network connection reset shared key. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ConnectionResetSharedKeyInner> beginResetSharedKey( - String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionResetSharedKeyInner parameters); - - /** - * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared - * key for passed virtual network gateway connection in the specified resource group through Network resource - * provider. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. - * @param parameters Parameters supplied to the begin reset virtual network gateway connection shared key operation - * through network resource provider. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the virtual network connection reset shared key. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ConnectionResetSharedKeyInner> beginResetSharedKey( - String resourceGroupName, - String virtualNetworkGatewayConnectionName, - ConnectionResetSharedKeyInner parameters, - Context context); - - /** - * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared - * key for passed virtual network gateway connection in the specified resource group through Network resource - * provider. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. - * @param parameters Parameters supplied to the begin reset virtual network gateway connection shared key operation - * through network resource provider. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the virtual network connection reset shared key. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono resetSharedKeyAsync( - String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionResetSharedKeyInner parameters); - - /** - * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared - * key for passed virtual network gateway connection in the specified resource group through Network resource - * provider. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. - * @param parameters Parameters supplied to the begin reset virtual network gateway connection shared key operation - * through network resource provider. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the virtual network connection reset shared key. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ConnectionResetSharedKeyInner resetSharedKey( - String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionResetSharedKeyInner parameters); - - /** - * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared - * key for passed virtual network gateway connection in the specified resource group through Network resource - * provider. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. - * @param parameters Parameters supplied to the begin reset virtual network gateway connection shared key operation - * through network resource provider. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the virtual network connection reset shared key. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ConnectionResetSharedKeyInner resetSharedKey( - String resourceGroupName, - String virtualNetworkGatewayConnectionName, - ConnectionResetSharedKeyInner parameters, - Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/VirtualNetworkGatewaysClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/VirtualNetworkGatewaysClient.java deleted file mode 100644 index 77eef09345c1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/VirtualNetworkGatewaysClient.java +++ /dev/null @@ -1,1750 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.models.BgpPeerStatusListResultInner; -import com.azure.resourcemanager.network.fluent.models.GatewayRouteListResultInner; -import com.azure.resourcemanager.network.fluent.models.VirtualNetworkGatewayConnectionListEntityInner; -import com.azure.resourcemanager.network.fluent.models.VirtualNetworkGatewayInner; -import com.azure.resourcemanager.network.fluent.models.VpnClientIPsecParametersInner; -import com.azure.resourcemanager.network.models.TagsObject; -import com.azure.resourcemanager.network.models.VpnClientParameters; -import com.azure.resourcemanager.network.models.VpnDeviceScriptParameters; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in VirtualNetworkGatewaysClient. */ -public interface VirtualNetworkGatewaysClient - extends InnerSupportsGet, InnerSupportsDelete { - /** - * Creates or updates a virtual network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to create or update virtual network gateway operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters); - - /** - * Creates or updates a virtual network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to create or update virtual network gateway operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, VirtualNetworkGatewayInner> beginCreateOrUpdateAsync( - String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters); - - /** - * Creates or updates a virtual network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to create or update virtual network gateway operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VirtualNetworkGatewayInner> beginCreateOrUpdate( - String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters); - - /** - * Creates or updates a virtual network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to create or update virtual network gateway operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VirtualNetworkGatewayInner> beginCreateOrUpdate( - String resourceGroupName, - String virtualNetworkGatewayName, - VirtualNetworkGatewayInner parameters, - Context context); - - /** - * Creates or updates a virtual network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to create or update virtual network gateway operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters); - - /** - * Creates or updates a virtual network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to create or update virtual network gateway operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualNetworkGatewayInner createOrUpdate( - String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters); - - /** - * Creates or updates a virtual network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to create or update virtual network gateway operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualNetworkGatewayInner createOrUpdate( - String resourceGroupName, - String virtualNetworkGatewayName, - VirtualNetworkGatewayInner parameters, - Context context); - - /** - * Gets the specified virtual network gateway by resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified virtual network gateway by resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String virtualNetworkGatewayName); - - /** - * Gets the specified virtual network gateway by resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified virtual network gateway by resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync( - String resourceGroupName, String virtualNetworkGatewayName); - - /** - * Gets the specified virtual network gateway by resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified virtual network gateway by resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualNetworkGatewayInner getByResourceGroup(String resourceGroupName, String virtualNetworkGatewayName); - - /** - * Gets the specified virtual network gateway by resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified virtual network gateway by resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String virtualNetworkGatewayName, Context context); - - /** - * Deletes the specified virtual network gateway. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync( - String resourceGroupName, String virtualNetworkGatewayName); - - /** - * Deletes the specified virtual network gateway. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String virtualNetworkGatewayName); - - /** - * Deletes the specified virtual network gateway. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String virtualNetworkGatewayName); - - /** - * Deletes the specified virtual network gateway. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String virtualNetworkGatewayName, Context context); - - /** - * Deletes the specified virtual network gateway. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String virtualNetworkGatewayName); - - /** - * Deletes the specified virtual network gateway. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String virtualNetworkGatewayName); - - /** - * Deletes the specified virtual network gateway. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String virtualNetworkGatewayName, Context context); - - /** - * Updates a virtual network gateway tags. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to update virtual network gateway tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> updateTagsWithResponseAsync( - String resourceGroupName, String virtualNetworkGatewayName, TagsObject parameters); - - /** - * Updates a virtual network gateway tags. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to update virtual network gateway tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, VirtualNetworkGatewayInner> beginUpdateTagsAsync( - String resourceGroupName, String virtualNetworkGatewayName, TagsObject parameters); - - /** - * Updates a virtual network gateway tags. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to update virtual network gateway tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VirtualNetworkGatewayInner> beginUpdateTags( - String resourceGroupName, String virtualNetworkGatewayName, TagsObject parameters); - - /** - * Updates a virtual network gateway tags. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to update virtual network gateway tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VirtualNetworkGatewayInner> beginUpdateTags( - String resourceGroupName, String virtualNetworkGatewayName, TagsObject parameters, Context context); - - /** - * Updates a virtual network gateway tags. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to update virtual network gateway tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateTagsAsync( - String resourceGroupName, String virtualNetworkGatewayName, TagsObject parameters); - - /** - * Updates a virtual network gateway tags. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to update virtual network gateway tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualNetworkGatewayInner updateTags( - String resourceGroupName, String virtualNetworkGatewayName, TagsObject parameters); - - /** - * Updates a virtual network gateway tags. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to update virtual network gateway tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualNetworkGatewayInner updateTags( - String resourceGroupName, String virtualNetworkGatewayName, TagsObject parameters, Context context); - - /** - * Gets all virtual network gateways by resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all virtual network gateways by resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName); - - /** - * Gets all virtual network gateways by resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all virtual network gateways by resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Gets all virtual network gateways by resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all virtual network gateways by resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * Gets all the connections in a virtual network gateway. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the connections in a virtual network gateway. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listConnectionsAsync( - String resourceGroupName, String virtualNetworkGatewayName); - - /** - * Gets all the connections in a virtual network gateway. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the connections in a virtual network gateway. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listConnections( - String resourceGroupName, String virtualNetworkGatewayName); - - /** - * Gets all the connections in a virtual network gateway. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the connections in a virtual network gateway. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listConnections( - String resourceGroupName, String virtualNetworkGatewayName, Context context); - - /** - * Resets the primary of the virtual network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param gatewayVip Virtual network gateway vip address supplied to the begin reset of the active-active feature - * enabled gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> resetWithResponseAsync( - String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip); - - /** - * Resets the primary of the virtual network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param gatewayVip Virtual network gateway vip address supplied to the begin reset of the active-active feature - * enabled gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, VirtualNetworkGatewayInner> beginResetAsync( - String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip); - - /** - * Resets the primary of the virtual network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param gatewayVip Virtual network gateway vip address supplied to the begin reset of the active-active feature - * enabled gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VirtualNetworkGatewayInner> beginReset( - String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip); - - /** - * Resets the primary of the virtual network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param gatewayVip Virtual network gateway vip address supplied to the begin reset of the active-active feature - * enabled gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VirtualNetworkGatewayInner> beginReset( - String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip, Context context); - - /** - * Resets the primary of the virtual network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param gatewayVip Virtual network gateway vip address supplied to the begin reset of the active-active feature - * enabled gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono resetAsync( - String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip); - - /** - * Resets the primary of the virtual network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono resetAsync(String resourceGroupName, String virtualNetworkGatewayName); - - /** - * Resets the primary of the virtual network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param gatewayVip Virtual network gateway vip address supplied to the begin reset of the active-active feature - * enabled gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualNetworkGatewayInner reset(String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip); - - /** - * Resets the primary of the virtual network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualNetworkGatewayInner reset(String resourceGroupName, String virtualNetworkGatewayName); - - /** - * Resets the primary of the virtual network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param gatewayVip Virtual network gateway vip address supplied to the begin reset of the active-active feature - * enabled gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualNetworkGatewayInner reset( - String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip, Context context); - - /** - * Resets the VPN client shared key of the virtual network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> resetVpnClientSharedKeyWithResponseAsync( - String resourceGroupName, String virtualNetworkGatewayName); - - /** - * Resets the VPN client shared key of the virtual network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginResetVpnClientSharedKeyAsync( - String resourceGroupName, String virtualNetworkGatewayName); - - /** - * Resets the VPN client shared key of the virtual network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginResetVpnClientSharedKey( - String resourceGroupName, String virtualNetworkGatewayName); - - /** - * Resets the VPN client shared key of the virtual network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginResetVpnClientSharedKey( - String resourceGroupName, String virtualNetworkGatewayName, Context context); - - /** - * Resets the VPN client shared key of the virtual network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono resetVpnClientSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayName); - - /** - * Resets the VPN client shared key of the virtual network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void resetVpnClientSharedKey(String resourceGroupName, String virtualNetworkGatewayName); - - /** - * Resets the VPN client shared key of the virtual network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void resetVpnClientSharedKey(String resourceGroupName, String virtualNetworkGatewayName, Context context); - - /** - * Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> generatevpnclientpackageWithResponseAsync( - String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters); - - /** - * Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, String> beginGeneratevpnclientpackageAsync( - String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters); - - /** - * Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, String> beginGeneratevpnclientpackage( - String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters); - - /** - * Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, String> beginGeneratevpnclientpackage( - String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters, Context context); - - /** - * Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono generatevpnclientpackageAsync( - String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters); - - /** - * Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - String generatevpnclientpackage( - String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters); - - /** - * Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - String generatevpnclientpackage( - String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters, Context context); - - /** - * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for - * IKEV2 and radius based authentication. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> generateVpnProfileWithResponseAsync( - String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters); - - /** - * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for - * IKEV2 and radius based authentication. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, String> beginGenerateVpnProfileAsync( - String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters); - - /** - * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for - * IKEV2 and radius based authentication. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, String> beginGenerateVpnProfile( - String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters); - - /** - * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for - * IKEV2 and radius based authentication. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, String> beginGenerateVpnProfile( - String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters, Context context); - - /** - * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for - * IKEV2 and radius based authentication. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono generateVpnProfileAsync( - String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters); - - /** - * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for - * IKEV2 and radius based authentication. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - String generateVpnProfile( - String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters); - - /** - * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for - * IKEV2 and radius based authentication. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - String generateVpnProfile( - String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters, Context context); - - /** - * Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The - * profile needs to be generated first using generateVpnProfile. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> getVpnProfilePackageUrlWithResponseAsync( - String resourceGroupName, String virtualNetworkGatewayName); - - /** - * Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The - * profile needs to be generated first using generateVpnProfile. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, String> beginGetVpnProfilePackageUrlAsync( - String resourceGroupName, String virtualNetworkGatewayName); - - /** - * Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The - * profile needs to be generated first using generateVpnProfile. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, String> beginGetVpnProfilePackageUrl( - String resourceGroupName, String virtualNetworkGatewayName); - - /** - * Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The - * profile needs to be generated first using generateVpnProfile. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, String> beginGetVpnProfilePackageUrl( - String resourceGroupName, String virtualNetworkGatewayName, Context context); - - /** - * Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The - * profile needs to be generated first using generateVpnProfile. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getVpnProfilePackageUrlAsync(String resourceGroupName, String virtualNetworkGatewayName); - - /** - * Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The - * profile needs to be generated first using generateVpnProfile. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - String getVpnProfilePackageUrl(String resourceGroupName, String virtualNetworkGatewayName); - - /** - * Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The - * profile needs to be generated first using generateVpnProfile. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - String getVpnProfilePackageUrl(String resourceGroupName, String virtualNetworkGatewayName, Context context); - - /** - * The GetBgpPeerStatus operation retrieves the status of all BGP peers. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param peer The IP address of the peer to retrieve the status of. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for list BGP peer status API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> getBgpPeerStatusWithResponseAsync( - String resourceGroupName, String virtualNetworkGatewayName, String peer); - - /** - * The GetBgpPeerStatus operation retrieves the status of all BGP peers. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param peer The IP address of the peer to retrieve the status of. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for list BGP peer status API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, BgpPeerStatusListResultInner> beginGetBgpPeerStatusAsync( - String resourceGroupName, String virtualNetworkGatewayName, String peer); - - /** - * The GetBgpPeerStatus operation retrieves the status of all BGP peers. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param peer The IP address of the peer to retrieve the status of. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for list BGP peer status API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, BgpPeerStatusListResultInner> beginGetBgpPeerStatus( - String resourceGroupName, String virtualNetworkGatewayName, String peer); - - /** - * The GetBgpPeerStatus operation retrieves the status of all BGP peers. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param peer The IP address of the peer to retrieve the status of. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for list BGP peer status API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, BgpPeerStatusListResultInner> beginGetBgpPeerStatus( - String resourceGroupName, String virtualNetworkGatewayName, String peer, Context context); - - /** - * The GetBgpPeerStatus operation retrieves the status of all BGP peers. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param peer The IP address of the peer to retrieve the status of. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for list BGP peer status API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getBgpPeerStatusAsync( - String resourceGroupName, String virtualNetworkGatewayName, String peer); - - /** - * The GetBgpPeerStatus operation retrieves the status of all BGP peers. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for list BGP peer status API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getBgpPeerStatusAsync( - String resourceGroupName, String virtualNetworkGatewayName); - - /** - * The GetBgpPeerStatus operation retrieves the status of all BGP peers. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param peer The IP address of the peer to retrieve the status of. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for list BGP peer status API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - BgpPeerStatusListResultInner getBgpPeerStatus( - String resourceGroupName, String virtualNetworkGatewayName, String peer); - - /** - * The GetBgpPeerStatus operation retrieves the status of all BGP peers. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for list BGP peer status API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - BgpPeerStatusListResultInner getBgpPeerStatus(String resourceGroupName, String virtualNetworkGatewayName); - - /** - * The GetBgpPeerStatus operation retrieves the status of all BGP peers. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param peer The IP address of the peer to retrieve the status of. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for list BGP peer status API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - BgpPeerStatusListResultInner getBgpPeerStatus( - String resourceGroupName, String virtualNetworkGatewayName, String peer, Context context); - - /** - * Gets a xml format representation for supported vpn devices. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a xml format representation for supported vpn devices. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> supportedVpnDevicesWithResponseAsync( - String resourceGroupName, String virtualNetworkGatewayName); - - /** - * Gets a xml format representation for supported vpn devices. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a xml format representation for supported vpn devices. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono supportedVpnDevicesAsync(String resourceGroupName, String virtualNetworkGatewayName); - - /** - * Gets a xml format representation for supported vpn devices. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a xml format representation for supported vpn devices. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - String supportedVpnDevices(String resourceGroupName, String virtualNetworkGatewayName); - - /** - * Gets a xml format representation for supported vpn devices. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a xml format representation for supported vpn devices. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response supportedVpnDevicesWithResponse( - String resourceGroupName, String virtualNetworkGatewayName, Context context); - - /** - * This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from - * BGP peers. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of virtual network gateway routes. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> getLearnedRoutesWithResponseAsync( - String resourceGroupName, String virtualNetworkGatewayName); - - /** - * This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from - * BGP peers. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of virtual network gateway routes. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, GatewayRouteListResultInner> beginGetLearnedRoutesAsync( - String resourceGroupName, String virtualNetworkGatewayName); - - /** - * This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from - * BGP peers. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of virtual network gateway routes. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, GatewayRouteListResultInner> beginGetLearnedRoutes( - String resourceGroupName, String virtualNetworkGatewayName); - - /** - * This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from - * BGP peers. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of virtual network gateway routes. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, GatewayRouteListResultInner> beginGetLearnedRoutes( - String resourceGroupName, String virtualNetworkGatewayName, Context context); - - /** - * This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from - * BGP peers. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of virtual network gateway routes. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getLearnedRoutesAsync(String resourceGroupName, String virtualNetworkGatewayName); - - /** - * This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from - * BGP peers. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of virtual network gateway routes. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GatewayRouteListResultInner getLearnedRoutes(String resourceGroupName, String virtualNetworkGatewayName); - - /** - * This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from - * BGP peers. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of virtual network gateway routes. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GatewayRouteListResultInner getLearnedRoutes( - String resourceGroupName, String virtualNetworkGatewayName, Context context); - - /** - * This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param peer The IP address of the peer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of virtual network gateway routes. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> getAdvertisedRoutesWithResponseAsync( - String resourceGroupName, String virtualNetworkGatewayName, String peer); - - /** - * This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param peer The IP address of the peer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of virtual network gateway routes. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, GatewayRouteListResultInner> beginGetAdvertisedRoutesAsync( - String resourceGroupName, String virtualNetworkGatewayName, String peer); - - /** - * This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param peer The IP address of the peer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of virtual network gateway routes. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, GatewayRouteListResultInner> beginGetAdvertisedRoutes( - String resourceGroupName, String virtualNetworkGatewayName, String peer); - - /** - * This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param peer The IP address of the peer. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of virtual network gateway routes. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, GatewayRouteListResultInner> beginGetAdvertisedRoutes( - String resourceGroupName, String virtualNetworkGatewayName, String peer, Context context); - - /** - * This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param peer The IP address of the peer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of virtual network gateway routes. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAdvertisedRoutesAsync( - String resourceGroupName, String virtualNetworkGatewayName, String peer); - - /** - * This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param peer The IP address of the peer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of virtual network gateway routes. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GatewayRouteListResultInner getAdvertisedRoutes( - String resourceGroupName, String virtualNetworkGatewayName, String peer); - - /** - * This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param peer The IP address of the peer. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of virtual network gateway routes. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GatewayRouteListResultInner getAdvertisedRoutes( - String resourceGroupName, String virtualNetworkGatewayName, String peer, Context context); - - /** - * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network - * gateway in the specified resource group through Network resource provider. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param vpnclientIpsecParams Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual Network - * Gateway P2S client operation through Network resource provider. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an IPSec parameters for a virtual network gateway P2S connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> setVpnclientIpsecParametersWithResponseAsync( - String resourceGroupName, String virtualNetworkGatewayName, VpnClientIPsecParametersInner vpnclientIpsecParams); - - /** - * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network - * gateway in the specified resource group through Network resource provider. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param vpnclientIpsecParams Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual Network - * Gateway P2S client operation through Network resource provider. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an IPSec parameters for a virtual network gateway P2S connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, VpnClientIPsecParametersInner> - beginSetVpnclientIpsecParametersAsync( - String resourceGroupName, - String virtualNetworkGatewayName, - VpnClientIPsecParametersInner vpnclientIpsecParams); - - /** - * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network - * gateway in the specified resource group through Network resource provider. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param vpnclientIpsecParams Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual Network - * Gateway P2S client operation through Network resource provider. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an IPSec parameters for a virtual network gateway P2S connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VpnClientIPsecParametersInner> - beginSetVpnclientIpsecParameters( - String resourceGroupName, - String virtualNetworkGatewayName, - VpnClientIPsecParametersInner vpnclientIpsecParams); - - /** - * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network - * gateway in the specified resource group through Network resource provider. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param vpnclientIpsecParams Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual Network - * Gateway P2S client operation through Network resource provider. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an IPSec parameters for a virtual network gateway P2S connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VpnClientIPsecParametersInner> - beginSetVpnclientIpsecParameters( - String resourceGroupName, - String virtualNetworkGatewayName, - VpnClientIPsecParametersInner vpnclientIpsecParams, - Context context); - - /** - * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network - * gateway in the specified resource group through Network resource provider. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param vpnclientIpsecParams Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual Network - * Gateway P2S client operation through Network resource provider. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an IPSec parameters for a virtual network gateway P2S connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono setVpnclientIpsecParametersAsync( - String resourceGroupName, String virtualNetworkGatewayName, VpnClientIPsecParametersInner vpnclientIpsecParams); - - /** - * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network - * gateway in the specified resource group through Network resource provider. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param vpnclientIpsecParams Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual Network - * Gateway P2S client operation through Network resource provider. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an IPSec parameters for a virtual network gateway P2S connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VpnClientIPsecParametersInner setVpnclientIpsecParameters( - String resourceGroupName, String virtualNetworkGatewayName, VpnClientIPsecParametersInner vpnclientIpsecParams); - - /** - * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network - * gateway in the specified resource group through Network resource provider. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param vpnclientIpsecParams Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual Network - * Gateway P2S client operation through Network resource provider. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an IPSec parameters for a virtual network gateway P2S connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VpnClientIPsecParametersInner setVpnclientIpsecParameters( - String resourceGroupName, - String virtualNetworkGatewayName, - VpnClientIPsecParametersInner vpnclientIpsecParams, - Context context); - - /** - * The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client - * of virtual network gateway in the specified resource group through Network resource provider. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The virtual network gateway name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an IPSec parameters for a virtual network gateway P2S connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> getVpnclientIpsecParametersWithResponseAsync( - String resourceGroupName, String virtualNetworkGatewayName); - - /** - * The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client - * of virtual network gateway in the specified resource group through Network resource provider. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The virtual network gateway name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an IPSec parameters for a virtual network gateway P2S connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, VpnClientIPsecParametersInner> - beginGetVpnclientIpsecParametersAsync(String resourceGroupName, String virtualNetworkGatewayName); - - /** - * The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client - * of virtual network gateway in the specified resource group through Network resource provider. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The virtual network gateway name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an IPSec parameters for a virtual network gateway P2S connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VpnClientIPsecParametersInner> - beginGetVpnclientIpsecParameters(String resourceGroupName, String virtualNetworkGatewayName); - - /** - * The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client - * of virtual network gateway in the specified resource group through Network resource provider. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The virtual network gateway name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an IPSec parameters for a virtual network gateway P2S connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VpnClientIPsecParametersInner> - beginGetVpnclientIpsecParameters(String resourceGroupName, String virtualNetworkGatewayName, Context context); - - /** - * The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client - * of virtual network gateway in the specified resource group through Network resource provider. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The virtual network gateway name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an IPSec parameters for a virtual network gateway P2S connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getVpnclientIpsecParametersAsync( - String resourceGroupName, String virtualNetworkGatewayName); - - /** - * The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client - * of virtual network gateway in the specified resource group through Network resource provider. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The virtual network gateway name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an IPSec parameters for a virtual network gateway P2S connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VpnClientIPsecParametersInner getVpnclientIpsecParameters( - String resourceGroupName, String virtualNetworkGatewayName); - - /** - * The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client - * of virtual network gateway in the specified resource group through Network resource provider. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The virtual network gateway name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an IPSec parameters for a virtual network gateway P2S connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VpnClientIPsecParametersInner getVpnclientIpsecParameters( - String resourceGroupName, String virtualNetworkGatewayName, Context context); - - /** - * Gets a xml format representation for vpn device configuration script. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection for which the - * configuration script is generated. - * @param parameters Parameters supplied to the generate vpn device script operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a xml format representation for vpn device configuration script. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> vpnDeviceConfigurationScriptWithResponseAsync( - String resourceGroupName, String virtualNetworkGatewayConnectionName, VpnDeviceScriptParameters parameters); - - /** - * Gets a xml format representation for vpn device configuration script. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection for which the - * configuration script is generated. - * @param parameters Parameters supplied to the generate vpn device script operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a xml format representation for vpn device configuration script. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono vpnDeviceConfigurationScriptAsync( - String resourceGroupName, String virtualNetworkGatewayConnectionName, VpnDeviceScriptParameters parameters); - - /** - * Gets a xml format representation for vpn device configuration script. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection for which the - * configuration script is generated. - * @param parameters Parameters supplied to the generate vpn device script operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a xml format representation for vpn device configuration script. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - String vpnDeviceConfigurationScript( - String resourceGroupName, String virtualNetworkGatewayConnectionName, VpnDeviceScriptParameters parameters); - - /** - * Gets a xml format representation for vpn device configuration script. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection for which the - * configuration script is generated. - * @param parameters Parameters supplied to the generate vpn device script operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a xml format representation for vpn device configuration script. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response vpnDeviceConfigurationScriptWithResponse( - String resourceGroupName, - String virtualNetworkGatewayConnectionName, - VpnDeviceScriptParameters parameters, - Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/VirtualNetworkPeeringsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/VirtualNetworkPeeringsClient.java deleted file mode 100644 index ee7aee5a44fb..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/VirtualNetworkPeeringsClient.java +++ /dev/null @@ -1,370 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.models.VirtualNetworkPeeringInner; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in VirtualNetworkPeeringsClient. */ -public interface VirtualNetworkPeeringsClient { - /** - * Deletes the specified virtual network peering. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param virtualNetworkPeeringName The name of the virtual network peering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync( - String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName); - - /** - * Deletes the specified virtual network peering. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param virtualNetworkPeeringName The name of the virtual network peering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName); - - /** - * Deletes the specified virtual network peering. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param virtualNetworkPeeringName The name of the virtual network peering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName); - - /** - * Deletes the specified virtual network peering. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param virtualNetworkPeeringName The name of the virtual network peering. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, Context context); - - /** - * Deletes the specified virtual network peering. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param virtualNetworkPeeringName The name of the virtual network peering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName); - - /** - * Deletes the specified virtual network peering. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param virtualNetworkPeeringName The name of the virtual network peering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName); - - /** - * Deletes the specified virtual network peering. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param virtualNetworkPeeringName The name of the virtual network peering. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, Context context); - - /** - * Gets the specified virtual network peering. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param virtualNetworkPeeringName The name of the virtual network peering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified virtual network peering. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync( - String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName); - - /** - * Gets the specified virtual network peering. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param virtualNetworkPeeringName The name of the virtual network peering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified virtual network peering. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync( - String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName); - - /** - * Gets the specified virtual network peering. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param virtualNetworkPeeringName The name of the virtual network peering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified virtual network peering. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualNetworkPeeringInner get( - String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName); - - /** - * Gets the specified virtual network peering. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param virtualNetworkPeeringName The name of the virtual network peering. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified virtual network peering. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, Context context); - - /** - * Creates or updates a peering in the specified virtual network. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param virtualNetworkPeeringName The name of the peering. - * @param virtualNetworkPeeringParameters Parameters supplied to the create or update virtual network peering - * operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return peerings in a virtual network resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String virtualNetworkName, - String virtualNetworkPeeringName, - VirtualNetworkPeeringInner virtualNetworkPeeringParameters); - - /** - * Creates or updates a peering in the specified virtual network. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param virtualNetworkPeeringName The name of the peering. - * @param virtualNetworkPeeringParameters Parameters supplied to the create or update virtual network peering - * operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return peerings in a virtual network resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, VirtualNetworkPeeringInner> beginCreateOrUpdateAsync( - String resourceGroupName, - String virtualNetworkName, - String virtualNetworkPeeringName, - VirtualNetworkPeeringInner virtualNetworkPeeringParameters); - - /** - * Creates or updates a peering in the specified virtual network. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param virtualNetworkPeeringName The name of the peering. - * @param virtualNetworkPeeringParameters Parameters supplied to the create or update virtual network peering - * operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return peerings in a virtual network resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VirtualNetworkPeeringInner> beginCreateOrUpdate( - String resourceGroupName, - String virtualNetworkName, - String virtualNetworkPeeringName, - VirtualNetworkPeeringInner virtualNetworkPeeringParameters); - - /** - * Creates or updates a peering in the specified virtual network. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param virtualNetworkPeeringName The name of the peering. - * @param virtualNetworkPeeringParameters Parameters supplied to the create or update virtual network peering - * operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return peerings in a virtual network resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VirtualNetworkPeeringInner> beginCreateOrUpdate( - String resourceGroupName, - String virtualNetworkName, - String virtualNetworkPeeringName, - VirtualNetworkPeeringInner virtualNetworkPeeringParameters, - Context context); - - /** - * Creates or updates a peering in the specified virtual network. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param virtualNetworkPeeringName The name of the peering. - * @param virtualNetworkPeeringParameters Parameters supplied to the create or update virtual network peering - * operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return peerings in a virtual network resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, - String virtualNetworkName, - String virtualNetworkPeeringName, - VirtualNetworkPeeringInner virtualNetworkPeeringParameters); - - /** - * Creates or updates a peering in the specified virtual network. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param virtualNetworkPeeringName The name of the peering. - * @param virtualNetworkPeeringParameters Parameters supplied to the create or update virtual network peering - * operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return peerings in a virtual network resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualNetworkPeeringInner createOrUpdate( - String resourceGroupName, - String virtualNetworkName, - String virtualNetworkPeeringName, - VirtualNetworkPeeringInner virtualNetworkPeeringParameters); - - /** - * Creates or updates a peering in the specified virtual network. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param virtualNetworkPeeringName The name of the peering. - * @param virtualNetworkPeeringParameters Parameters supplied to the create or update virtual network peering - * operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return peerings in a virtual network resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualNetworkPeeringInner createOrUpdate( - String resourceGroupName, - String virtualNetworkName, - String virtualNetworkPeeringName, - VirtualNetworkPeeringInner virtualNetworkPeeringParameters, - Context context); - - /** - * Gets all virtual network peerings in a virtual network. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all virtual network peerings in a virtual network. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String resourceGroupName, String virtualNetworkName); - - /** - * Gets all virtual network peerings in a virtual network. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all virtual network peerings in a virtual network. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String virtualNetworkName); - - /** - * Gets all virtual network peerings in a virtual network. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all virtual network peerings in a virtual network. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String resourceGroupName, String virtualNetworkName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/VirtualNetworkTapsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/VirtualNetworkTapsClient.java deleted file mode 100644 index 241dd1df137f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/VirtualNetworkTapsClient.java +++ /dev/null @@ -1,455 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.models.VirtualNetworkTapInner; -import com.azure.resourcemanager.network.models.TagsObject; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in VirtualNetworkTapsClient. */ -public interface VirtualNetworkTapsClient - extends InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete { - /** - * Deletes the specified virtual network tap. - * - * @param resourceGroupName The name of the resource group. - * @param tapName The name of the virtual network tap. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync(String resourceGroupName, String tapName); - - /** - * Deletes the specified virtual network tap. - * - * @param resourceGroupName The name of the resource group. - * @param tapName The name of the virtual network tap. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String tapName); - - /** - * Deletes the specified virtual network tap. - * - * @param resourceGroupName The name of the resource group. - * @param tapName The name of the virtual network tap. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String tapName); - - /** - * Deletes the specified virtual network tap. - * - * @param resourceGroupName The name of the resource group. - * @param tapName The name of the virtual network tap. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String tapName, Context context); - - /** - * Deletes the specified virtual network tap. - * - * @param resourceGroupName The name of the resource group. - * @param tapName The name of the virtual network tap. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String tapName); - - /** - * Deletes the specified virtual network tap. - * - * @param resourceGroupName The name of the resource group. - * @param tapName The name of the virtual network tap. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String tapName); - - /** - * Deletes the specified virtual network tap. - * - * @param resourceGroupName The name of the resource group. - * @param tapName The name of the virtual network tap. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String tapName, Context context); - - /** - * Gets information about the specified virtual network tap. - * - * @param resourceGroupName The name of the resource group. - * @param tapName The name of virtual network tap. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified virtual network tap. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String tapName); - - /** - * Gets information about the specified virtual network tap. - * - * @param resourceGroupName The name of the resource group. - * @param tapName The name of virtual network tap. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified virtual network tap. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync(String resourceGroupName, String tapName); - - /** - * Gets information about the specified virtual network tap. - * - * @param resourceGroupName The name of the resource group. - * @param tapName The name of virtual network tap. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified virtual network tap. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualNetworkTapInner getByResourceGroup(String resourceGroupName, String tapName); - - /** - * Gets information about the specified virtual network tap. - * - * @param resourceGroupName The name of the resource group. - * @param tapName The name of virtual network tap. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified virtual network tap. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String tapName, Context context); - - /** - * Creates or updates a Virtual Network Tap. - * - * @param resourceGroupName The name of the resource group. - * @param tapName The name of the virtual network tap. - * @param parameters Parameters supplied to the create or update virtual network tap operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network Tap resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String tapName, VirtualNetworkTapInner parameters); - - /** - * Creates or updates a Virtual Network Tap. - * - * @param resourceGroupName The name of the resource group. - * @param tapName The name of the virtual network tap. - * @param parameters Parameters supplied to the create or update virtual network tap operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network Tap resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, VirtualNetworkTapInner> beginCreateOrUpdateAsync( - String resourceGroupName, String tapName, VirtualNetworkTapInner parameters); - - /** - * Creates or updates a Virtual Network Tap. - * - * @param resourceGroupName The name of the resource group. - * @param tapName The name of the virtual network tap. - * @param parameters Parameters supplied to the create or update virtual network tap operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network Tap resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VirtualNetworkTapInner> beginCreateOrUpdate( - String resourceGroupName, String tapName, VirtualNetworkTapInner parameters); - - /** - * Creates or updates a Virtual Network Tap. - * - * @param resourceGroupName The name of the resource group. - * @param tapName The name of the virtual network tap. - * @param parameters Parameters supplied to the create or update virtual network tap operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network Tap resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VirtualNetworkTapInner> beginCreateOrUpdate( - String resourceGroupName, String tapName, VirtualNetworkTapInner parameters, Context context); - - /** - * Creates or updates a Virtual Network Tap. - * - * @param resourceGroupName The name of the resource group. - * @param tapName The name of the virtual network tap. - * @param parameters Parameters supplied to the create or update virtual network tap operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network Tap resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, String tapName, VirtualNetworkTapInner parameters); - - /** - * Creates or updates a Virtual Network Tap. - * - * @param resourceGroupName The name of the resource group. - * @param tapName The name of the virtual network tap. - * @param parameters Parameters supplied to the create or update virtual network tap operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network Tap resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualNetworkTapInner createOrUpdate(String resourceGroupName, String tapName, VirtualNetworkTapInner parameters); - - /** - * Creates or updates a Virtual Network Tap. - * - * @param resourceGroupName The name of the resource group. - * @param tapName The name of the virtual network tap. - * @param parameters Parameters supplied to the create or update virtual network tap operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network Tap resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualNetworkTapInner createOrUpdate( - String resourceGroupName, String tapName, VirtualNetworkTapInner parameters, Context context); - - /** - * Updates an VirtualNetworkTap tags. - * - * @param resourceGroupName The name of the resource group. - * @param tapName The name of the tap. - * @param tapParameters Parameters supplied to update VirtualNetworkTap tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network Tap resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> updateTagsWithResponseAsync( - String resourceGroupName, String tapName, TagsObject tapParameters); - - /** - * Updates an VirtualNetworkTap tags. - * - * @param resourceGroupName The name of the resource group. - * @param tapName The name of the tap. - * @param tapParameters Parameters supplied to update VirtualNetworkTap tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network Tap resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, VirtualNetworkTapInner> beginUpdateTagsAsync( - String resourceGroupName, String tapName, TagsObject tapParameters); - - /** - * Updates an VirtualNetworkTap tags. - * - * @param resourceGroupName The name of the resource group. - * @param tapName The name of the tap. - * @param tapParameters Parameters supplied to update VirtualNetworkTap tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network Tap resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VirtualNetworkTapInner> beginUpdateTags( - String resourceGroupName, String tapName, TagsObject tapParameters); - - /** - * Updates an VirtualNetworkTap tags. - * - * @param resourceGroupName The name of the resource group. - * @param tapName The name of the tap. - * @param tapParameters Parameters supplied to update VirtualNetworkTap tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network Tap resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VirtualNetworkTapInner> beginUpdateTags( - String resourceGroupName, String tapName, TagsObject tapParameters, Context context); - - /** - * Updates an VirtualNetworkTap tags. - * - * @param resourceGroupName The name of the resource group. - * @param tapName The name of the tap. - * @param tapParameters Parameters supplied to update VirtualNetworkTap tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network Tap resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateTagsAsync(String resourceGroupName, String tapName, TagsObject tapParameters); - - /** - * Updates an VirtualNetworkTap tags. - * - * @param resourceGroupName The name of the resource group. - * @param tapName The name of the tap. - * @param tapParameters Parameters supplied to update VirtualNetworkTap tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network Tap resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualNetworkTapInner updateTags(String resourceGroupName, String tapName, TagsObject tapParameters); - - /** - * Updates an VirtualNetworkTap tags. - * - * @param resourceGroupName The name of the resource group. - * @param tapName The name of the tap. - * @param tapParameters Parameters supplied to update VirtualNetworkTap tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network Tap resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualNetworkTapInner updateTags( - String resourceGroupName, String tapName, TagsObject tapParameters, Context context); - - /** - * Gets all the VirtualNetworkTaps in a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the VirtualNetworkTaps in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Gets all the VirtualNetworkTaps in a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the VirtualNetworkTaps in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Gets all the VirtualNetworkTaps in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the VirtualNetworkTaps in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Gets all the VirtualNetworkTaps in a subscription. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the VirtualNetworkTaps in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName); - - /** - * Gets all the VirtualNetworkTaps in a subscription. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the VirtualNetworkTaps in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Gets all the VirtualNetworkTaps in a subscription. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the VirtualNetworkTaps in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/VirtualNetworksClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/VirtualNetworksClient.java deleted file mode 100644 index 5962c75cd35f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/VirtualNetworksClient.java +++ /dev/null @@ -1,579 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.models.IpAddressAvailabilityResultInner; -import com.azure.resourcemanager.network.fluent.models.VirtualNetworkInner; -import com.azure.resourcemanager.network.fluent.models.VirtualNetworkUsageInner; -import com.azure.resourcemanager.network.models.TagsObject; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in VirtualNetworksClient. */ -public interface VirtualNetworksClient - extends InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete { - /** - * Deletes the specified virtual network. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync(String resourceGroupName, String virtualNetworkName); - - /** - * Deletes the specified virtual network. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String virtualNetworkName); - - /** - * Deletes the specified virtual network. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String virtualNetworkName); - - /** - * Deletes the specified virtual network. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String virtualNetworkName, Context context); - - /** - * Deletes the specified virtual network. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String virtualNetworkName); - - /** - * Deletes the specified virtual network. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String virtualNetworkName); - - /** - * Deletes the specified virtual network. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String virtualNetworkName, Context context); - - /** - * Gets the specified virtual network by resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param expand Expands referenced resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified virtual network by resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String virtualNetworkName, String expand); - - /** - * Gets the specified virtual network by resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param expand Expands referenced resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified virtual network by resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync( - String resourceGroupName, String virtualNetworkName, String expand); - - /** - * Gets the specified virtual network by resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified virtual network by resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync(String resourceGroupName, String virtualNetworkName); - - /** - * Gets the specified virtual network by resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified virtual network by resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualNetworkInner getByResourceGroup(String resourceGroupName, String virtualNetworkName); - - /** - * Gets the specified virtual network by resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param expand Expands referenced resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified virtual network by resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String virtualNetworkName, String expand, Context context); - - /** - * Creates or updates a virtual network in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param parameters Parameters supplied to the create or update virtual network operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String virtualNetworkName, VirtualNetworkInner parameters); - - /** - * Creates or updates a virtual network in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param parameters Parameters supplied to the create or update virtual network operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, VirtualNetworkInner> beginCreateOrUpdateAsync( - String resourceGroupName, String virtualNetworkName, VirtualNetworkInner parameters); - - /** - * Creates or updates a virtual network in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param parameters Parameters supplied to the create or update virtual network operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VirtualNetworkInner> beginCreateOrUpdate( - String resourceGroupName, String virtualNetworkName, VirtualNetworkInner parameters); - - /** - * Creates or updates a virtual network in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param parameters Parameters supplied to the create or update virtual network operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VirtualNetworkInner> beginCreateOrUpdate( - String resourceGroupName, String virtualNetworkName, VirtualNetworkInner parameters, Context context); - - /** - * Creates or updates a virtual network in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param parameters Parameters supplied to the create or update virtual network operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, String virtualNetworkName, VirtualNetworkInner parameters); - - /** - * Creates or updates a virtual network in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param parameters Parameters supplied to the create or update virtual network operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualNetworkInner createOrUpdate( - String resourceGroupName, String virtualNetworkName, VirtualNetworkInner parameters); - - /** - * Creates or updates a virtual network in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param parameters Parameters supplied to the create or update virtual network operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualNetworkInner createOrUpdate( - String resourceGroupName, String virtualNetworkName, VirtualNetworkInner parameters, Context context); - - /** - * Updates a virtual network tags. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param parameters Parameters supplied to update virtual network tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> updateTagsWithResponseAsync( - String resourceGroupName, String virtualNetworkName, TagsObject parameters); - - /** - * Updates a virtual network tags. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param parameters Parameters supplied to update virtual network tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, VirtualNetworkInner> beginUpdateTagsAsync( - String resourceGroupName, String virtualNetworkName, TagsObject parameters); - - /** - * Updates a virtual network tags. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param parameters Parameters supplied to update virtual network tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VirtualNetworkInner> beginUpdateTags( - String resourceGroupName, String virtualNetworkName, TagsObject parameters); - - /** - * Updates a virtual network tags. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param parameters Parameters supplied to update virtual network tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VirtualNetworkInner> beginUpdateTags( - String resourceGroupName, String virtualNetworkName, TagsObject parameters, Context context); - - /** - * Updates a virtual network tags. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param parameters Parameters supplied to update virtual network tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateTagsAsync( - String resourceGroupName, String virtualNetworkName, TagsObject parameters); - - /** - * Updates a virtual network tags. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param parameters Parameters supplied to update virtual network tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualNetworkInner updateTags(String resourceGroupName, String virtualNetworkName, TagsObject parameters); - - /** - * Updates a virtual network tags. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param parameters Parameters supplied to update virtual network tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualNetworkInner updateTags( - String resourceGroupName, String virtualNetworkName, TagsObject parameters, Context context); - - /** - * Gets all virtual networks in a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all virtual networks in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Gets all virtual networks in a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all virtual networks in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Gets all virtual networks in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all virtual networks in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Gets all virtual networks in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all virtual networks in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName); - - /** - * Gets all virtual networks in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all virtual networks in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Gets all virtual networks in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all virtual networks in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * Checks whether a private IP address is available for use. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param ipAddress The private IP address to be verified. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for CheckIPAddressAvailability API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> checkIpAddressAvailabilityWithResponseAsync( - String resourceGroupName, String virtualNetworkName, String ipAddress); - - /** - * Checks whether a private IP address is available for use. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param ipAddress The private IP address to be verified. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for CheckIPAddressAvailability API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono checkIpAddressAvailabilityAsync( - String resourceGroupName, String virtualNetworkName, String ipAddress); - - /** - * Checks whether a private IP address is available for use. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param ipAddress The private IP address to be verified. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for CheckIPAddressAvailability API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - IpAddressAvailabilityResultInner checkIpAddressAvailability( - String resourceGroupName, String virtualNetworkName, String ipAddress); - - /** - * Checks whether a private IP address is available for use. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param ipAddress The private IP address to be verified. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for CheckIPAddressAvailability API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response checkIpAddressAvailabilityWithResponse( - String resourceGroupName, String virtualNetworkName, String ipAddress, Context context); - - /** - * Lists usage stats. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the virtual networks GetUsage API service call. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listUsageAsync(String resourceGroupName, String virtualNetworkName); - - /** - * Lists usage stats. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the virtual networks GetUsage API service call. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listUsage(String resourceGroupName, String virtualNetworkName); - - /** - * Lists usage stats. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the virtual networks GetUsage API service call. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listUsage( - String resourceGroupName, String virtualNetworkName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/VirtualWansClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/VirtualWansClient.java deleted file mode 100644 index 461fe755249a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/VirtualWansClient.java +++ /dev/null @@ -1,453 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.models.VirtualWanInner; -import com.azure.resourcemanager.network.models.TagsObject; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in VirtualWansClient. */ -public interface VirtualWansClient - extends InnerSupportsGet, InnerSupportsListing, InnerSupportsDelete { - /** - * Retrieves the details of a VirtualWAN. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWAN being retrieved. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualWAN Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String virtualWanName); - - /** - * Retrieves the details of a VirtualWAN. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWAN being retrieved. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualWAN Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync(String resourceGroupName, String virtualWanName); - - /** - * Retrieves the details of a VirtualWAN. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWAN being retrieved. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualWAN Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualWanInner getByResourceGroup(String resourceGroupName, String virtualWanName); - - /** - * Retrieves the details of a VirtualWAN. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWAN being retrieved. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualWAN Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String virtualWanName, Context context); - - /** - * Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWAN being created or updated. - * @param wanParameters Parameters supplied to create or update VirtualWAN. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualWAN Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String virtualWanName, VirtualWanInner wanParameters); - - /** - * Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWAN being created or updated. - * @param wanParameters Parameters supplied to create or update VirtualWAN. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualWAN Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, VirtualWanInner> beginCreateOrUpdateAsync( - String resourceGroupName, String virtualWanName, VirtualWanInner wanParameters); - - /** - * Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWAN being created or updated. - * @param wanParameters Parameters supplied to create or update VirtualWAN. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualWAN Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VirtualWanInner> beginCreateOrUpdate( - String resourceGroupName, String virtualWanName, VirtualWanInner wanParameters); - - /** - * Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWAN being created or updated. - * @param wanParameters Parameters supplied to create or update VirtualWAN. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualWAN Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VirtualWanInner> beginCreateOrUpdate( - String resourceGroupName, String virtualWanName, VirtualWanInner wanParameters, Context context); - - /** - * Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWAN being created or updated. - * @param wanParameters Parameters supplied to create or update VirtualWAN. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualWAN Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, String virtualWanName, VirtualWanInner wanParameters); - - /** - * Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWAN being created or updated. - * @param wanParameters Parameters supplied to create or update VirtualWAN. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualWAN Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualWanInner createOrUpdate(String resourceGroupName, String virtualWanName, VirtualWanInner wanParameters); - - /** - * Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWAN being created or updated. - * @param wanParameters Parameters supplied to create or update VirtualWAN. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualWAN Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualWanInner createOrUpdate( - String resourceGroupName, String virtualWanName, VirtualWanInner wanParameters, Context context); - - /** - * Updates a VirtualWAN tags. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWAN being updated. - * @param wanParameters Parameters supplied to Update VirtualWAN tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualWAN Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> updateTagsWithResponseAsync( - String resourceGroupName, String virtualWanName, TagsObject wanParameters); - - /** - * Updates a VirtualWAN tags. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWAN being updated. - * @param wanParameters Parameters supplied to Update VirtualWAN tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualWAN Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, VirtualWanInner> beginUpdateTagsAsync( - String resourceGroupName, String virtualWanName, TagsObject wanParameters); - - /** - * Updates a VirtualWAN tags. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWAN being updated. - * @param wanParameters Parameters supplied to Update VirtualWAN tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualWAN Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VirtualWanInner> beginUpdateTags( - String resourceGroupName, String virtualWanName, TagsObject wanParameters); - - /** - * Updates a VirtualWAN tags. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWAN being updated. - * @param wanParameters Parameters supplied to Update VirtualWAN tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualWAN Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VirtualWanInner> beginUpdateTags( - String resourceGroupName, String virtualWanName, TagsObject wanParameters, Context context); - - /** - * Updates a VirtualWAN tags. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWAN being updated. - * @param wanParameters Parameters supplied to Update VirtualWAN tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualWAN Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateTagsAsync(String resourceGroupName, String virtualWanName, TagsObject wanParameters); - - /** - * Updates a VirtualWAN tags. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWAN being updated. - * @param wanParameters Parameters supplied to Update VirtualWAN tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualWAN Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualWanInner updateTags(String resourceGroupName, String virtualWanName, TagsObject wanParameters); - - /** - * Updates a VirtualWAN tags. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWAN being updated. - * @param wanParameters Parameters supplied to Update VirtualWAN tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualWAN Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualWanInner updateTags( - String resourceGroupName, String virtualWanName, TagsObject wanParameters, Context context); - - /** - * Deletes a VirtualWAN. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWAN being deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync(String resourceGroupName, String virtualWanName); - - /** - * Deletes a VirtualWAN. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWAN being deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String virtualWanName); - - /** - * Deletes a VirtualWAN. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWAN being deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String virtualWanName); - - /** - * Deletes a VirtualWAN. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWAN being deleted. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String virtualWanName, Context context); - - /** - * Deletes a VirtualWAN. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWAN being deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String virtualWanName); - - /** - * Deletes a VirtualWAN. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWAN being deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String virtualWanName); - - /** - * Deletes a VirtualWAN. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWAN being deleted. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String virtualWanName, Context context); - - /** - * Lists all the VirtualWANs in a resource group. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VirtualWANs. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName); - - /** - * Lists all the VirtualWANs in a resource group. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VirtualWANs. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Lists all the VirtualWANs in a resource group. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VirtualWANs. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * Lists all the VirtualWANs in a subscription. - * - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VirtualWANs. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Lists all the VirtualWANs in a subscription. - * - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VirtualWANs. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Lists all the VirtualWANs in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VirtualWANs. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/VpnConnectionsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/VpnConnectionsClient.java deleted file mode 100644 index b2958ebd4078..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/VpnConnectionsClient.java +++ /dev/null @@ -1,359 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.models.VpnConnectionInner; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in VpnConnectionsClient. */ -public interface VpnConnectionsClient { - /** - * Retrieves the details of a vpn connection. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param connectionName The name of the vpn connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnConnection Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync( - String resourceGroupName, String gatewayName, String connectionName); - - /** - * Retrieves the details of a vpn connection. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param connectionName The name of the vpn connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnConnection Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync(String resourceGroupName, String gatewayName, String connectionName); - - /** - * Retrieves the details of a vpn connection. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param connectionName The name of the vpn connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnConnection Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VpnConnectionInner get(String resourceGroupName, String gatewayName, String connectionName); - - /** - * Retrieves the details of a vpn connection. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param connectionName The name of the vpn connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnConnection Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String gatewayName, String connectionName, Context context); - - /** - * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param connectionName The name of the connection. - * @param vpnConnectionParameters Parameters supplied to create or Update a VPN Connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnConnection Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String gatewayName, - String connectionName, - VpnConnectionInner vpnConnectionParameters); - - /** - * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param connectionName The name of the connection. - * @param vpnConnectionParameters Parameters supplied to create or Update a VPN Connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnConnection Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, VpnConnectionInner> beginCreateOrUpdateAsync( - String resourceGroupName, - String gatewayName, - String connectionName, - VpnConnectionInner vpnConnectionParameters); - - /** - * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param connectionName The name of the connection. - * @param vpnConnectionParameters Parameters supplied to create or Update a VPN Connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnConnection Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VpnConnectionInner> beginCreateOrUpdate( - String resourceGroupName, - String gatewayName, - String connectionName, - VpnConnectionInner vpnConnectionParameters); - - /** - * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param connectionName The name of the connection. - * @param vpnConnectionParameters Parameters supplied to create or Update a VPN Connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnConnection Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VpnConnectionInner> beginCreateOrUpdate( - String resourceGroupName, - String gatewayName, - String connectionName, - VpnConnectionInner vpnConnectionParameters, - Context context); - - /** - * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param connectionName The name of the connection. - * @param vpnConnectionParameters Parameters supplied to create or Update a VPN Connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnConnection Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, - String gatewayName, - String connectionName, - VpnConnectionInner vpnConnectionParameters); - - /** - * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param connectionName The name of the connection. - * @param vpnConnectionParameters Parameters supplied to create or Update a VPN Connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnConnection Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VpnConnectionInner createOrUpdate( - String resourceGroupName, - String gatewayName, - String connectionName, - VpnConnectionInner vpnConnectionParameters); - - /** - * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param connectionName The name of the connection. - * @param vpnConnectionParameters Parameters supplied to create or Update a VPN Connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnConnection Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VpnConnectionInner createOrUpdate( - String resourceGroupName, - String gatewayName, - String connectionName, - VpnConnectionInner vpnConnectionParameters, - Context context); - - /** - * Deletes a vpn connection. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param connectionName The name of the connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync( - String resourceGroupName, String gatewayName, String connectionName); - - /** - * Deletes a vpn connection. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param connectionName The name of the connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String gatewayName, String connectionName); - - /** - * Deletes a vpn connection. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param connectionName The name of the connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String gatewayName, String connectionName); - - /** - * Deletes a vpn connection. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param connectionName The name of the connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String gatewayName, String connectionName, Context context); - - /** - * Deletes a vpn connection. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param connectionName The name of the connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String gatewayName, String connectionName); - - /** - * Deletes a vpn connection. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param connectionName The name of the connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String gatewayName, String connectionName); - - /** - * Deletes a vpn connection. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param connectionName The name of the connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String gatewayName, String connectionName, Context context); - - /** - * Retrieves all vpn connections for a particular virtual wan vpn gateway. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list all vpn connections to a virtual wan vpn gateway. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByVpnGatewayAsync(String resourceGroupName, String gatewayName); - - /** - * Retrieves all vpn connections for a particular virtual wan vpn gateway. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list all vpn connections to a virtual wan vpn gateway. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByVpnGateway(String resourceGroupName, String gatewayName); - - /** - * Retrieves all vpn connections for a particular virtual wan vpn gateway. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list all vpn connections to a virtual wan vpn gateway. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByVpnGateway(String resourceGroupName, String gatewayName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/VpnGatewaysClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/VpnGatewaysClient.java deleted file mode 100644 index 558747db54fb..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/VpnGatewaysClient.java +++ /dev/null @@ -1,453 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.models.VpnGatewayInner; -import com.azure.resourcemanager.network.models.TagsObject; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in VpnGatewaysClient. */ -public interface VpnGatewaysClient - extends InnerSupportsGet, InnerSupportsListing, InnerSupportsDelete { - /** - * Retrieves the details of a virtual wan vpn gateway. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String gatewayName); - - /** - * Retrieves the details of a virtual wan vpn gateway. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync(String resourceGroupName, String gatewayName); - - /** - * Retrieves the details of a virtual wan vpn gateway. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VpnGatewayInner getByResourceGroup(String resourceGroupName, String gatewayName); - - /** - * Retrieves the details of a virtual wan vpn gateway. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String gatewayName, Context context); - - /** - * Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param vpnGatewayParameters Parameters supplied to create or Update a virtual wan vpn gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String gatewayName, VpnGatewayInner vpnGatewayParameters); - - /** - * Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param vpnGatewayParameters Parameters supplied to create or Update a virtual wan vpn gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, VpnGatewayInner> beginCreateOrUpdateAsync( - String resourceGroupName, String gatewayName, VpnGatewayInner vpnGatewayParameters); - - /** - * Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param vpnGatewayParameters Parameters supplied to create or Update a virtual wan vpn gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VpnGatewayInner> beginCreateOrUpdate( - String resourceGroupName, String gatewayName, VpnGatewayInner vpnGatewayParameters); - - /** - * Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param vpnGatewayParameters Parameters supplied to create or Update a virtual wan vpn gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VpnGatewayInner> beginCreateOrUpdate( - String resourceGroupName, String gatewayName, VpnGatewayInner vpnGatewayParameters, Context context); - - /** - * Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param vpnGatewayParameters Parameters supplied to create or Update a virtual wan vpn gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, String gatewayName, VpnGatewayInner vpnGatewayParameters); - - /** - * Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param vpnGatewayParameters Parameters supplied to create or Update a virtual wan vpn gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VpnGatewayInner createOrUpdate(String resourceGroupName, String gatewayName, VpnGatewayInner vpnGatewayParameters); - - /** - * Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param vpnGatewayParameters Parameters supplied to create or Update a virtual wan vpn gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VpnGatewayInner createOrUpdate( - String resourceGroupName, String gatewayName, VpnGatewayInner vpnGatewayParameters, Context context); - - /** - * Updates virtual wan vpn gateway tags. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param vpnGatewayParameters Parameters supplied to update a virtual wan vpn gateway tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> updateTagsWithResponseAsync( - String resourceGroupName, String gatewayName, TagsObject vpnGatewayParameters); - - /** - * Updates virtual wan vpn gateway tags. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param vpnGatewayParameters Parameters supplied to update a virtual wan vpn gateway tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, VpnGatewayInner> beginUpdateTagsAsync( - String resourceGroupName, String gatewayName, TagsObject vpnGatewayParameters); - - /** - * Updates virtual wan vpn gateway tags. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param vpnGatewayParameters Parameters supplied to update a virtual wan vpn gateway tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VpnGatewayInner> beginUpdateTags( - String resourceGroupName, String gatewayName, TagsObject vpnGatewayParameters); - - /** - * Updates virtual wan vpn gateway tags. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param vpnGatewayParameters Parameters supplied to update a virtual wan vpn gateway tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VpnGatewayInner> beginUpdateTags( - String resourceGroupName, String gatewayName, TagsObject vpnGatewayParameters, Context context); - - /** - * Updates virtual wan vpn gateway tags. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param vpnGatewayParameters Parameters supplied to update a virtual wan vpn gateway tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateTagsAsync( - String resourceGroupName, String gatewayName, TagsObject vpnGatewayParameters); - - /** - * Updates virtual wan vpn gateway tags. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param vpnGatewayParameters Parameters supplied to update a virtual wan vpn gateway tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VpnGatewayInner updateTags(String resourceGroupName, String gatewayName, TagsObject vpnGatewayParameters); - - /** - * Updates virtual wan vpn gateway tags. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param vpnGatewayParameters Parameters supplied to update a virtual wan vpn gateway tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VpnGatewayInner updateTags( - String resourceGroupName, String gatewayName, TagsObject vpnGatewayParameters, Context context); - - /** - * Deletes a virtual wan vpn gateway. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync(String resourceGroupName, String gatewayName); - - /** - * Deletes a virtual wan vpn gateway. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String gatewayName); - - /** - * Deletes a virtual wan vpn gateway. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String gatewayName); - - /** - * Deletes a virtual wan vpn gateway. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String gatewayName, Context context); - - /** - * Deletes a virtual wan vpn gateway. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String gatewayName); - - /** - * Deletes a virtual wan vpn gateway. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String gatewayName); - - /** - * Deletes a virtual wan vpn gateway. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String gatewayName, Context context); - - /** - * Lists all the VpnGateways in a resource group. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VpnGateways. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName); - - /** - * Lists all the VpnGateways in a resource group. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VpnGateways. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Lists all the VpnGateways in a resource group. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VpnGateways. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * Lists all the VpnGateways in a subscription. - * - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VpnGateways. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Lists all the VpnGateways in a subscription. - * - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VpnGateways. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Lists all the VpnGateways in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VpnGateways. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/VpnSitesClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/VpnSitesClient.java deleted file mode 100644 index 1714990c7587..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/VpnSitesClient.java +++ /dev/null @@ -1,452 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.models.VpnSiteInner; -import com.azure.resourcemanager.network.models.TagsObject; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in VpnSitesClient. */ -public interface VpnSitesClient - extends InnerSupportsGet, InnerSupportsListing, InnerSupportsDelete { - /** - * Retrieves the details of a VPN site. - * - * @param resourceGroupName The resource group name of the VpnSite. - * @param vpnSiteName The name of the VpnSite being retrieved. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnSite Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String vpnSiteName); - - /** - * Retrieves the details of a VPN site. - * - * @param resourceGroupName The resource group name of the VpnSite. - * @param vpnSiteName The name of the VpnSite being retrieved. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnSite Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync(String resourceGroupName, String vpnSiteName); - - /** - * Retrieves the details of a VPN site. - * - * @param resourceGroupName The resource group name of the VpnSite. - * @param vpnSiteName The name of the VpnSite being retrieved. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnSite Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VpnSiteInner getByResourceGroup(String resourceGroupName, String vpnSiteName); - - /** - * Retrieves the details of a VPN site. - * - * @param resourceGroupName The resource group name of the VpnSite. - * @param vpnSiteName The name of the VpnSite being retrieved. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnSite Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String vpnSiteName, Context context); - - /** - * Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. - * - * @param resourceGroupName The resource group name of the VpnSite. - * @param vpnSiteName The name of the VpnSite being created or updated. - * @param vpnSiteParameters Parameters supplied to create or update VpnSite. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnSite Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String vpnSiteName, VpnSiteInner vpnSiteParameters); - - /** - * Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. - * - * @param resourceGroupName The resource group name of the VpnSite. - * @param vpnSiteName The name of the VpnSite being created or updated. - * @param vpnSiteParameters Parameters supplied to create or update VpnSite. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnSite Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, VpnSiteInner> beginCreateOrUpdateAsync( - String resourceGroupName, String vpnSiteName, VpnSiteInner vpnSiteParameters); - - /** - * Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. - * - * @param resourceGroupName The resource group name of the VpnSite. - * @param vpnSiteName The name of the VpnSite being created or updated. - * @param vpnSiteParameters Parameters supplied to create or update VpnSite. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnSite Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VpnSiteInner> beginCreateOrUpdate( - String resourceGroupName, String vpnSiteName, VpnSiteInner vpnSiteParameters); - - /** - * Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. - * - * @param resourceGroupName The resource group name of the VpnSite. - * @param vpnSiteName The name of the VpnSite being created or updated. - * @param vpnSiteParameters Parameters supplied to create or update VpnSite. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnSite Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VpnSiteInner> beginCreateOrUpdate( - String resourceGroupName, String vpnSiteName, VpnSiteInner vpnSiteParameters, Context context); - - /** - * Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. - * - * @param resourceGroupName The resource group name of the VpnSite. - * @param vpnSiteName The name of the VpnSite being created or updated. - * @param vpnSiteParameters Parameters supplied to create or update VpnSite. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnSite Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, String vpnSiteName, VpnSiteInner vpnSiteParameters); - - /** - * Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. - * - * @param resourceGroupName The resource group name of the VpnSite. - * @param vpnSiteName The name of the VpnSite being created or updated. - * @param vpnSiteParameters Parameters supplied to create or update VpnSite. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnSite Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VpnSiteInner createOrUpdate(String resourceGroupName, String vpnSiteName, VpnSiteInner vpnSiteParameters); - - /** - * Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. - * - * @param resourceGroupName The resource group name of the VpnSite. - * @param vpnSiteName The name of the VpnSite being created or updated. - * @param vpnSiteParameters Parameters supplied to create or update VpnSite. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnSite Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VpnSiteInner createOrUpdate( - String resourceGroupName, String vpnSiteName, VpnSiteInner vpnSiteParameters, Context context); - - /** - * Updates VpnSite tags. - * - * @param resourceGroupName The resource group name of the VpnSite. - * @param vpnSiteName The name of the VpnSite being updated. - * @param vpnSiteParameters Parameters supplied to update VpnSite tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnSite Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> updateTagsWithResponseAsync( - String resourceGroupName, String vpnSiteName, TagsObject vpnSiteParameters); - - /** - * Updates VpnSite tags. - * - * @param resourceGroupName The resource group name of the VpnSite. - * @param vpnSiteName The name of the VpnSite being updated. - * @param vpnSiteParameters Parameters supplied to update VpnSite tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnSite Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, VpnSiteInner> beginUpdateTagsAsync( - String resourceGroupName, String vpnSiteName, TagsObject vpnSiteParameters); - - /** - * Updates VpnSite tags. - * - * @param resourceGroupName The resource group name of the VpnSite. - * @param vpnSiteName The name of the VpnSite being updated. - * @param vpnSiteParameters Parameters supplied to update VpnSite tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnSite Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VpnSiteInner> beginUpdateTags( - String resourceGroupName, String vpnSiteName, TagsObject vpnSiteParameters); - - /** - * Updates VpnSite tags. - * - * @param resourceGroupName The resource group name of the VpnSite. - * @param vpnSiteName The name of the VpnSite being updated. - * @param vpnSiteParameters Parameters supplied to update VpnSite tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnSite Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VpnSiteInner> beginUpdateTags( - String resourceGroupName, String vpnSiteName, TagsObject vpnSiteParameters, Context context); - - /** - * Updates VpnSite tags. - * - * @param resourceGroupName The resource group name of the VpnSite. - * @param vpnSiteName The name of the VpnSite being updated. - * @param vpnSiteParameters Parameters supplied to update VpnSite tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnSite Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateTagsAsync(String resourceGroupName, String vpnSiteName, TagsObject vpnSiteParameters); - - /** - * Updates VpnSite tags. - * - * @param resourceGroupName The resource group name of the VpnSite. - * @param vpnSiteName The name of the VpnSite being updated. - * @param vpnSiteParameters Parameters supplied to update VpnSite tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnSite Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VpnSiteInner updateTags(String resourceGroupName, String vpnSiteName, TagsObject vpnSiteParameters); - - /** - * Updates VpnSite tags. - * - * @param resourceGroupName The resource group name of the VpnSite. - * @param vpnSiteName The name of the VpnSite being updated. - * @param vpnSiteParameters Parameters supplied to update VpnSite tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnSite Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VpnSiteInner updateTags( - String resourceGroupName, String vpnSiteName, TagsObject vpnSiteParameters, Context context); - - /** - * Deletes a VpnSite. - * - * @param resourceGroupName The resource group name of the VpnSite. - * @param vpnSiteName The name of the VpnSite being deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync(String resourceGroupName, String vpnSiteName); - - /** - * Deletes a VpnSite. - * - * @param resourceGroupName The resource group name of the VpnSite. - * @param vpnSiteName The name of the VpnSite being deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String vpnSiteName); - - /** - * Deletes a VpnSite. - * - * @param resourceGroupName The resource group name of the VpnSite. - * @param vpnSiteName The name of the VpnSite being deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String vpnSiteName); - - /** - * Deletes a VpnSite. - * - * @param resourceGroupName The resource group name of the VpnSite. - * @param vpnSiteName The name of the VpnSite being deleted. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String vpnSiteName, Context context); - - /** - * Deletes a VpnSite. - * - * @param resourceGroupName The resource group name of the VpnSite. - * @param vpnSiteName The name of the VpnSite being deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String vpnSiteName); - - /** - * Deletes a VpnSite. - * - * @param resourceGroupName The resource group name of the VpnSite. - * @param vpnSiteName The name of the VpnSite being deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String vpnSiteName); - - /** - * Deletes a VpnSite. - * - * @param resourceGroupName The resource group name of the VpnSite. - * @param vpnSiteName The name of the VpnSite being deleted. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String vpnSiteName, Context context); - - /** - * Lists all the vpnSites in a resource group. - * - * @param resourceGroupName The resource group name of the VpnSite. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VpnSites. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName); - - /** - * Lists all the vpnSites in a resource group. - * - * @param resourceGroupName The resource group name of the VpnSite. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VpnSites. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Lists all the vpnSites in a resource group. - * - * @param resourceGroupName The resource group name of the VpnSite. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VpnSites. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * Lists all the VpnSites in a subscription. - * - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VpnSites. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Lists all the VpnSites in a subscription. - * - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VpnSites. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Lists all the VpnSites in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VpnSites. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/VpnSitesConfigurationsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/VpnSitesConfigurationsClient.java deleted file mode 100644 index 4af0a4d1085d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/VpnSitesConfigurationsClient.java +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.models.GetVpnSitesConfigurationRequest; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in VpnSitesConfigurationsClient. */ -public interface VpnSitesConfigurationsClient { - /** - * Gives the sas-url to download the configurations for vpn-sites in a resource group. - * - * @param resourceGroupName The resource group name. - * @param virtualWanName The name of the VirtualWAN for which configuration of all vpn-sites is needed. - * @param request Parameters supplied to download vpn-sites configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> downloadWithResponseAsync( - String resourceGroupName, String virtualWanName, GetVpnSitesConfigurationRequest request); - - /** - * Gives the sas-url to download the configurations for vpn-sites in a resource group. - * - * @param resourceGroupName The resource group name. - * @param virtualWanName The name of the VirtualWAN for which configuration of all vpn-sites is needed. - * @param request Parameters supplied to download vpn-sites configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDownloadAsync( - String resourceGroupName, String virtualWanName, GetVpnSitesConfigurationRequest request); - - /** - * Gives the sas-url to download the configurations for vpn-sites in a resource group. - * - * @param resourceGroupName The resource group name. - * @param virtualWanName The name of the VirtualWAN for which configuration of all vpn-sites is needed. - * @param request Parameters supplied to download vpn-sites configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDownload( - String resourceGroupName, String virtualWanName, GetVpnSitesConfigurationRequest request); - - /** - * Gives the sas-url to download the configurations for vpn-sites in a resource group. - * - * @param resourceGroupName The resource group name. - * @param virtualWanName The name of the VirtualWAN for which configuration of all vpn-sites is needed. - * @param request Parameters supplied to download vpn-sites configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDownload( - String resourceGroupName, String virtualWanName, GetVpnSitesConfigurationRequest request, Context context); - - /** - * Gives the sas-url to download the configurations for vpn-sites in a resource group. - * - * @param resourceGroupName The resource group name. - * @param virtualWanName The name of the VirtualWAN for which configuration of all vpn-sites is needed. - * @param request Parameters supplied to download vpn-sites configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono downloadAsync(String resourceGroupName, String virtualWanName, GetVpnSitesConfigurationRequest request); - - /** - * Gives the sas-url to download the configurations for vpn-sites in a resource group. - * - * @param resourceGroupName The resource group name. - * @param virtualWanName The name of the VirtualWAN for which configuration of all vpn-sites is needed. - * @param request Parameters supplied to download vpn-sites configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void download(String resourceGroupName, String virtualWanName, GetVpnSitesConfigurationRequest request); - - /** - * Gives the sas-url to download the configurations for vpn-sites in a resource group. - * - * @param resourceGroupName The resource group name. - * @param virtualWanName The name of the VirtualWAN for which configuration of all vpn-sites is needed. - * @param request Parameters supplied to download vpn-sites configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void download( - String resourceGroupName, String virtualWanName, GetVpnSitesConfigurationRequest request, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayAuthenticationCertificateInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayAuthenticationCertificateInner.java deleted file mode 100644 index 16664022c8cd..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayAuthenticationCertificateInner.java +++ /dev/null @@ -1,178 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Authentication certificates of an application gateway. */ -@Fluent -public final class ApplicationGatewayAuthenticationCertificateInner extends SubResource { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(ApplicationGatewayAuthenticationCertificateInner.class); - - /* - * Authentication certificates properties of an application gateway. - */ - @JsonProperty(value = "properties") - private ApplicationGatewayAuthenticationCertificatePropertiesFormat innerProperties; - - /* - * Name of the authentication certificate that is unique within an - * Application Gateway. - */ - @JsonProperty(value = "name") - private String name; - - /* - * A unique read-only string that changes whenever the resource is updated. - */ - @JsonProperty(value = "etag") - private String etag; - - /* - * Type of the resource. - */ - @JsonProperty(value = "type") - private String type; - - /** - * Get the innerProperties property: Authentication certificates properties of an application gateway. - * - * @return the innerProperties value. - */ - private ApplicationGatewayAuthenticationCertificatePropertiesFormat innerProperties() { - return this.innerProperties; - } - - /** - * Get the name property: Name of the authentication certificate that is unique within an Application Gateway. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Name of the authentication certificate that is unique within an Application Gateway. - * - * @param name the name value to set. - * @return the ApplicationGatewayAuthenticationCertificateInner object itself. - */ - public ApplicationGatewayAuthenticationCertificateInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @param etag the etag value to set. - * @return the ApplicationGatewayAuthenticationCertificateInner object itself. - */ - public ApplicationGatewayAuthenticationCertificateInner withEtag(String etag) { - this.etag = etag; - return this; - } - - /** - * Get the type property: Type of the resource. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Set the type property: Type of the resource. - * - * @param type the type value to set. - * @return the ApplicationGatewayAuthenticationCertificateInner object itself. - */ - public ApplicationGatewayAuthenticationCertificateInner withType(String type) { - this.type = type; - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicationGatewayAuthenticationCertificateInner withId(String id) { - super.withId(id); - return this; - } - - /** - * Get the data property: Certificate public data. - * - * @return the data value. - */ - public String data() { - return this.innerProperties() == null ? null : this.innerProperties().data(); - } - - /** - * Set the data property: Certificate public data. - * - * @param data the data value to set. - * @return the ApplicationGatewayAuthenticationCertificateInner object itself. - */ - public ApplicationGatewayAuthenticationCertificateInner withData(String data) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayAuthenticationCertificatePropertiesFormat(); - } - this.innerProperties().withData(data); - return this; - } - - /** - * Get the provisioningState property: Provisioning state of the authentication certificate resource. Possible - * values are: 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Set the provisioningState property: Provisioning state of the authentication certificate resource. Possible - * values are: 'Updating', 'Deleting', and 'Failed'. - * - * @param provisioningState the provisioningState value to set. - * @return the ApplicationGatewayAuthenticationCertificateInner object itself. - */ - public ApplicationGatewayAuthenticationCertificateInner withProvisioningState(String provisioningState) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayAuthenticationCertificatePropertiesFormat(); - } - this.innerProperties().withProvisioningState(provisioningState); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayAuthenticationCertificatePropertiesFormat.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayAuthenticationCertificatePropertiesFormat.java deleted file mode 100644 index 99c1e968acea..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayAuthenticationCertificatePropertiesFormat.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Authentication certificates properties of an application gateway. */ -@Fluent -public final class ApplicationGatewayAuthenticationCertificatePropertiesFormat { - @JsonIgnore - private final ClientLogger logger = - new ClientLogger(ApplicationGatewayAuthenticationCertificatePropertiesFormat.class); - - /* - * Certificate public data. - */ - @JsonProperty(value = "data") - private String data; - - /* - * Provisioning state of the authentication certificate resource. Possible - * values are: 'Updating', 'Deleting', and 'Failed'. - */ - @JsonProperty(value = "provisioningState") - private String provisioningState; - - /** - * Get the data property: Certificate public data. - * - * @return the data value. - */ - public String data() { - return this.data; - } - - /** - * Set the data property: Certificate public data. - * - * @param data the data value to set. - * @return the ApplicationGatewayAuthenticationCertificatePropertiesFormat object itself. - */ - public ApplicationGatewayAuthenticationCertificatePropertiesFormat withData(String data) { - this.data = data; - return this; - } - - /** - * Get the provisioningState property: Provisioning state of the authentication certificate resource. Possible - * values are: 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Set the provisioningState property: Provisioning state of the authentication certificate resource. Possible - * values are: 'Updating', 'Deleting', and 'Failed'. - * - * @param provisioningState the provisioningState value to set. - * @return the ApplicationGatewayAuthenticationCertificatePropertiesFormat object itself. - */ - public ApplicationGatewayAuthenticationCertificatePropertiesFormat withProvisioningState(String provisioningState) { - this.provisioningState = provisioningState; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayAvailableSslOptionsInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayAvailableSslOptionsInner.java deleted file mode 100644 index 23fc3b236145..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayAvailableSslOptionsInner.java +++ /dev/null @@ -1,183 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.ApplicationGatewaySslCipherSuite; -import com.azure.resourcemanager.network.models.ApplicationGatewaySslPolicyName; -import com.azure.resourcemanager.network.models.ApplicationGatewaySslProtocol; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** Response for ApplicationGatewayAvailableSslOptions API service call. */ -@Fluent -public final class ApplicationGatewayAvailableSslOptionsInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayAvailableSslOptionsInner.class); - - /* - * Properties of ApplicationGatewayAvailableSslOptions - */ - @JsonProperty(value = "properties") - private ApplicationGatewayAvailableSslOptionsPropertiesFormat innerProperties; - - /* - * Resource ID. - */ - @JsonProperty(value = "id") - private String id; - - /** - * Get the innerProperties property: Properties of ApplicationGatewayAvailableSslOptions. - * - * @return the innerProperties value. - */ - private ApplicationGatewayAvailableSslOptionsPropertiesFormat innerProperties() { - return this.innerProperties; - } - - /** - * Get the id property: Resource ID. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: Resource ID. - * - * @param id the id value to set. - * @return the ApplicationGatewayAvailableSslOptionsInner object itself. - */ - public ApplicationGatewayAvailableSslOptionsInner withId(String id) { - this.id = id; - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicationGatewayAvailableSslOptionsInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicationGatewayAvailableSslOptionsInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the predefinedPolicies property: List of available Ssl predefined policy. - * - * @return the predefinedPolicies value. - */ - public List predefinedPolicies() { - return this.innerProperties() == null ? null : this.innerProperties().predefinedPolicies(); - } - - /** - * Set the predefinedPolicies property: List of available Ssl predefined policy. - * - * @param predefinedPolicies the predefinedPolicies value to set. - * @return the ApplicationGatewayAvailableSslOptionsInner object itself. - */ - public ApplicationGatewayAvailableSslOptionsInner withPredefinedPolicies(List predefinedPolicies) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayAvailableSslOptionsPropertiesFormat(); - } - this.innerProperties().withPredefinedPolicies(predefinedPolicies); - return this; - } - - /** - * Get the defaultPolicy property: Name of the Ssl predefined policy applied by default to application gateway. - * - * @return the defaultPolicy value. - */ - public ApplicationGatewaySslPolicyName defaultPolicy() { - return this.innerProperties() == null ? null : this.innerProperties().defaultPolicy(); - } - - /** - * Set the defaultPolicy property: Name of the Ssl predefined policy applied by default to application gateway. - * - * @param defaultPolicy the defaultPolicy value to set. - * @return the ApplicationGatewayAvailableSslOptionsInner object itself. - */ - public ApplicationGatewayAvailableSslOptionsInner withDefaultPolicy(ApplicationGatewaySslPolicyName defaultPolicy) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayAvailableSslOptionsPropertiesFormat(); - } - this.innerProperties().withDefaultPolicy(defaultPolicy); - return this; - } - - /** - * Get the availableCipherSuites property: List of available Ssl cipher suites. - * - * @return the availableCipherSuites value. - */ - public List availableCipherSuites() { - return this.innerProperties() == null ? null : this.innerProperties().availableCipherSuites(); - } - - /** - * Set the availableCipherSuites property: List of available Ssl cipher suites. - * - * @param availableCipherSuites the availableCipherSuites value to set. - * @return the ApplicationGatewayAvailableSslOptionsInner object itself. - */ - public ApplicationGatewayAvailableSslOptionsInner withAvailableCipherSuites( - List availableCipherSuites) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayAvailableSslOptionsPropertiesFormat(); - } - this.innerProperties().withAvailableCipherSuites(availableCipherSuites); - return this; - } - - /** - * Get the availableProtocols property: List of available Ssl protocols. - * - * @return the availableProtocols value. - */ - public List availableProtocols() { - return this.innerProperties() == null ? null : this.innerProperties().availableProtocols(); - } - - /** - * Set the availableProtocols property: List of available Ssl protocols. - * - * @param availableProtocols the availableProtocols value to set. - * @return the ApplicationGatewayAvailableSslOptionsInner object itself. - */ - public ApplicationGatewayAvailableSslOptionsInner withAvailableProtocols( - List availableProtocols) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayAvailableSslOptionsPropertiesFormat(); - } - this.innerProperties().withAvailableProtocols(availableProtocols); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayAvailableSslOptionsPropertiesFormat.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayAvailableSslOptionsPropertiesFormat.java deleted file mode 100644 index ef48c5a53d6c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayAvailableSslOptionsPropertiesFormat.java +++ /dev/null @@ -1,139 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.ApplicationGatewaySslCipherSuite; -import com.azure.resourcemanager.network.models.ApplicationGatewaySslPolicyName; -import com.azure.resourcemanager.network.models.ApplicationGatewaySslProtocol; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Properties of ApplicationGatewayAvailableSslOptions. */ -@Fluent -public final class ApplicationGatewayAvailableSslOptionsPropertiesFormat { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(ApplicationGatewayAvailableSslOptionsPropertiesFormat.class); - - /* - * List of available Ssl predefined policy. - */ - @JsonProperty(value = "predefinedPolicies") - private List predefinedPolicies; - - /* - * Name of the Ssl predefined policy applied by default to application - * gateway - */ - @JsonProperty(value = "defaultPolicy") - private ApplicationGatewaySslPolicyName defaultPolicy; - - /* - * List of available Ssl cipher suites. - */ - @JsonProperty(value = "availableCipherSuites") - private List availableCipherSuites; - - /* - * List of available Ssl protocols. - */ - @JsonProperty(value = "availableProtocols") - private List availableProtocols; - - /** - * Get the predefinedPolicies property: List of available Ssl predefined policy. - * - * @return the predefinedPolicies value. - */ - public List predefinedPolicies() { - return this.predefinedPolicies; - } - - /** - * Set the predefinedPolicies property: List of available Ssl predefined policy. - * - * @param predefinedPolicies the predefinedPolicies value to set. - * @return the ApplicationGatewayAvailableSslOptionsPropertiesFormat object itself. - */ - public ApplicationGatewayAvailableSslOptionsPropertiesFormat withPredefinedPolicies( - List predefinedPolicies) { - this.predefinedPolicies = predefinedPolicies; - return this; - } - - /** - * Get the defaultPolicy property: Name of the Ssl predefined policy applied by default to application gateway. - * - * @return the defaultPolicy value. - */ - public ApplicationGatewaySslPolicyName defaultPolicy() { - return this.defaultPolicy; - } - - /** - * Set the defaultPolicy property: Name of the Ssl predefined policy applied by default to application gateway. - * - * @param defaultPolicy the defaultPolicy value to set. - * @return the ApplicationGatewayAvailableSslOptionsPropertiesFormat object itself. - */ - public ApplicationGatewayAvailableSslOptionsPropertiesFormat withDefaultPolicy( - ApplicationGatewaySslPolicyName defaultPolicy) { - this.defaultPolicy = defaultPolicy; - return this; - } - - /** - * Get the availableCipherSuites property: List of available Ssl cipher suites. - * - * @return the availableCipherSuites value. - */ - public List availableCipherSuites() { - return this.availableCipherSuites; - } - - /** - * Set the availableCipherSuites property: List of available Ssl cipher suites. - * - * @param availableCipherSuites the availableCipherSuites value to set. - * @return the ApplicationGatewayAvailableSslOptionsPropertiesFormat object itself. - */ - public ApplicationGatewayAvailableSslOptionsPropertiesFormat withAvailableCipherSuites( - List availableCipherSuites) { - this.availableCipherSuites = availableCipherSuites; - return this; - } - - /** - * Get the availableProtocols property: List of available Ssl protocols. - * - * @return the availableProtocols value. - */ - public List availableProtocols() { - return this.availableProtocols; - } - - /** - * Set the availableProtocols property: List of available Ssl protocols. - * - * @param availableProtocols the availableProtocols value to set. - * @return the ApplicationGatewayAvailableSslOptionsPropertiesFormat object itself. - */ - public ApplicationGatewayAvailableSslOptionsPropertiesFormat withAvailableProtocols( - List availableProtocols) { - this.availableProtocols = availableProtocols; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayAvailableWafRuleSetsResultInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayAvailableWafRuleSetsResultInner.java deleted file mode 100644 index d66191f01bc2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayAvailableWafRuleSetsResultInner.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.ApplicationGatewayFirewallRuleSet; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Response for ApplicationGatewayAvailableWafRuleSets API service call. */ -@Fluent -public final class ApplicationGatewayAvailableWafRuleSetsResultInner { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(ApplicationGatewayAvailableWafRuleSetsResultInner.class); - - /* - * The list of application gateway rule sets. - */ - @JsonProperty(value = "value") - private List value; - - /** - * Get the value property: The list of application gateway rule sets. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The list of application gateway rule sets. - * - * @param value the value value to set. - * @return the ApplicationGatewayAvailableWafRuleSetsResultInner object itself. - */ - public ApplicationGatewayAvailableWafRuleSetsResultInner withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayBackendAddressPoolPropertiesFormat.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayBackendAddressPoolPropertiesFormat.java deleted file mode 100644 index 6396959d4d0d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayBackendAddressPoolPropertiesFormat.java +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.ApplicationGatewayBackendAddress; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Properties of Backend Address Pool of an application gateway. */ -@Fluent -public final class ApplicationGatewayBackendAddressPoolPropertiesFormat { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(ApplicationGatewayBackendAddressPoolPropertiesFormat.class); - - /* - * Collection of references to IPs defined in network interfaces. - */ - @JsonProperty(value = "backendIPConfigurations") - private List backendIpConfigurations; - - /* - * Backend addresses - */ - @JsonProperty(value = "backendAddresses") - private List backendAddresses; - - /* - * Provisioning state of the backend address pool resource. Possible values - * are: 'Updating', 'Deleting', and 'Failed'. - */ - @JsonProperty(value = "provisioningState") - private String provisioningState; - - /** - * Get the backendIpConfigurations property: Collection of references to IPs defined in network interfaces. - * - * @return the backendIpConfigurations value. - */ - public List backendIpConfigurations() { - return this.backendIpConfigurations; - } - - /** - * Set the backendIpConfigurations property: Collection of references to IPs defined in network interfaces. - * - * @param backendIpConfigurations the backendIpConfigurations value to set. - * @return the ApplicationGatewayBackendAddressPoolPropertiesFormat object itself. - */ - public ApplicationGatewayBackendAddressPoolPropertiesFormat withBackendIpConfigurations( - List backendIpConfigurations) { - this.backendIpConfigurations = backendIpConfigurations; - return this; - } - - /** - * Get the backendAddresses property: Backend addresses. - * - * @return the backendAddresses value. - */ - public List backendAddresses() { - return this.backendAddresses; - } - - /** - * Set the backendAddresses property: Backend addresses. - * - * @param backendAddresses the backendAddresses value to set. - * @return the ApplicationGatewayBackendAddressPoolPropertiesFormat object itself. - */ - public ApplicationGatewayBackendAddressPoolPropertiesFormat withBackendAddresses( - List backendAddresses) { - this.backendAddresses = backendAddresses; - return this; - } - - /** - * Get the provisioningState property: Provisioning state of the backend address pool resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Set the provisioningState property: Provisioning state of the backend address pool resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param provisioningState the provisioningState value to set. - * @return the ApplicationGatewayBackendAddressPoolPropertiesFormat object itself. - */ - public ApplicationGatewayBackendAddressPoolPropertiesFormat withProvisioningState(String provisioningState) { - this.provisioningState = provisioningState; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (backendIpConfigurations() != null) { - backendIpConfigurations().forEach(e -> e.validate()); - } - if (backendAddresses() != null) { - backendAddresses().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayBackendHealthInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayBackendHealthInner.java deleted file mode 100644 index 4d2c3a8b7f81..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayBackendHealthInner.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.ApplicationGatewayBackendHealthPool; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** List of ApplicationGatewayBackendHealthPool resources. */ -@Fluent -public final class ApplicationGatewayBackendHealthInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayBackendHealthInner.class); - - /* - * The backendAddressPools property. - */ - @JsonProperty(value = "backendAddressPools") - private List backendAddressPools; - - /** - * Get the backendAddressPools property: The backendAddressPools property. - * - * @return the backendAddressPools value. - */ - public List backendAddressPools() { - return this.backendAddressPools; - } - - /** - * Set the backendAddressPools property: The backendAddressPools property. - * - * @param backendAddressPools the backendAddressPools value to set. - * @return the ApplicationGatewayBackendHealthInner object itself. - */ - public ApplicationGatewayBackendHealthInner withBackendAddressPools( - List backendAddressPools) { - this.backendAddressPools = backendAddressPools; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (backendAddressPools() != null) { - backendAddressPools().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayBackendHealthServerInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayBackendHealthServerInner.java deleted file mode 100644 index 1eda7615e9d6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayBackendHealthServerInner.java +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.ApplicationGatewayBackendHealthServerHealth; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Application gateway backendhealth http settings. */ -@Fluent -public final class ApplicationGatewayBackendHealthServerInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayBackendHealthServerInner.class); - - /* - * IP address or FQDN of backend server. - */ - @JsonProperty(value = "address") - private String address; - - /* - * Reference of IP configuration of backend server. - */ - @JsonProperty(value = "ipConfiguration") - private NetworkInterfaceIpConfigurationInner ipConfiguration; - - /* - * Health of backend server. - */ - @JsonProperty(value = "health") - private ApplicationGatewayBackendHealthServerHealth health; - - /** - * Get the address property: IP address or FQDN of backend server. - * - * @return the address value. - */ - public String address() { - return this.address; - } - - /** - * Set the address property: IP address or FQDN of backend server. - * - * @param address the address value to set. - * @return the ApplicationGatewayBackendHealthServerInner object itself. - */ - public ApplicationGatewayBackendHealthServerInner withAddress(String address) { - this.address = address; - return this; - } - - /** - * Get the ipConfiguration property: Reference of IP configuration of backend server. - * - * @return the ipConfiguration value. - */ - public NetworkInterfaceIpConfigurationInner ipConfiguration() { - return this.ipConfiguration; - } - - /** - * Set the ipConfiguration property: Reference of IP configuration of backend server. - * - * @param ipConfiguration the ipConfiguration value to set. - * @return the ApplicationGatewayBackendHealthServerInner object itself. - */ - public ApplicationGatewayBackendHealthServerInner withIpConfiguration( - NetworkInterfaceIpConfigurationInner ipConfiguration) { - this.ipConfiguration = ipConfiguration; - return this; - } - - /** - * Get the health property: Health of backend server. - * - * @return the health value. - */ - public ApplicationGatewayBackendHealthServerHealth health() { - return this.health; - } - - /** - * Set the health property: Health of backend server. - * - * @param health the health value to set. - * @return the ApplicationGatewayBackendHealthServerInner object itself. - */ - public ApplicationGatewayBackendHealthServerInner withHealth(ApplicationGatewayBackendHealthServerHealth health) { - this.health = health; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (ipConfiguration() != null) { - ipConfiguration().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayBackendHttpSettingsPropertiesFormat.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayBackendHttpSettingsPropertiesFormat.java deleted file mode 100644 index 20dd4a5ea541..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayBackendHttpSettingsPropertiesFormat.java +++ /dev/null @@ -1,420 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.ApplicationGatewayConnectionDraining; -import com.azure.resourcemanager.network.models.ApplicationGatewayCookieBasedAffinity; -import com.azure.resourcemanager.network.models.ApplicationGatewayProtocol; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Properties of Backend address pool settings of an application gateway. */ -@Fluent -public final class ApplicationGatewayBackendHttpSettingsPropertiesFormat { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(ApplicationGatewayBackendHttpSettingsPropertiesFormat.class); - - /* - * The destination port on the backend. - */ - @JsonProperty(value = "port") - private Integer port; - - /* - * The protocol used to communicate with the backend. Possible values are - * 'Http' and 'Https'. - */ - @JsonProperty(value = "protocol") - private ApplicationGatewayProtocol protocol; - - /* - * Cookie based affinity. - */ - @JsonProperty(value = "cookieBasedAffinity") - private ApplicationGatewayCookieBasedAffinity cookieBasedAffinity; - - /* - * Request timeout in seconds. Application Gateway will fail the request if - * response is not received within RequestTimeout. Acceptable values are - * from 1 second to 86400 seconds. - */ - @JsonProperty(value = "requestTimeout") - private Integer requestTimeout; - - /* - * Probe resource of an application gateway. - */ - @JsonProperty(value = "probe") - private SubResource probe; - - /* - * Array of references to application gateway authentication certificates. - */ - @JsonProperty(value = "authenticationCertificates") - private List authenticationCertificates; - - /* - * Array of references to application gateway trusted root certificates. - */ - @JsonProperty(value = "trustedRootCertificates") - private List trustedRootCertificates; - - /* - * Connection draining of the backend http settings resource. - */ - @JsonProperty(value = "connectionDraining") - private ApplicationGatewayConnectionDraining connectionDraining; - - /* - * Host header to be sent to the backend servers. - */ - @JsonProperty(value = "hostName") - private String hostname; - - /* - * Whether to pick host header should be picked from the host name of the - * backend server. Default value is false. - */ - @JsonProperty(value = "pickHostNameFromBackendAddress") - private Boolean pickHostnameFromBackendAddress; - - /* - * Cookie name to use for the affinity cookie. - */ - @JsonProperty(value = "affinityCookieName") - private String affinityCookieName; - - /* - * Whether the probe is enabled. Default value is false. - */ - @JsonProperty(value = "probeEnabled") - private Boolean probeEnabled; - - /* - * Path which should be used as a prefix for all HTTP requests. Null means - * no path will be prefixed. Default value is null. - */ - @JsonProperty(value = "path") - private String path; - - /* - * Provisioning state of the backend http settings resource. Possible - * values are: 'Updating', 'Deleting', and 'Failed'. - */ - @JsonProperty(value = "provisioningState") - private String provisioningState; - - /** - * Get the port property: The destination port on the backend. - * - * @return the port value. - */ - public Integer port() { - return this.port; - } - - /** - * Set the port property: The destination port on the backend. - * - * @param port the port value to set. - * @return the ApplicationGatewayBackendHttpSettingsPropertiesFormat object itself. - */ - public ApplicationGatewayBackendHttpSettingsPropertiesFormat withPort(Integer port) { - this.port = port; - return this; - } - - /** - * Get the protocol property: The protocol used to communicate with the backend. Possible values are 'Http' and - * 'Https'. - * - * @return the protocol value. - */ - public ApplicationGatewayProtocol protocol() { - return this.protocol; - } - - /** - * Set the protocol property: The protocol used to communicate with the backend. Possible values are 'Http' and - * 'Https'. - * - * @param protocol the protocol value to set. - * @return the ApplicationGatewayBackendHttpSettingsPropertiesFormat object itself. - */ - public ApplicationGatewayBackendHttpSettingsPropertiesFormat withProtocol(ApplicationGatewayProtocol protocol) { - this.protocol = protocol; - return this; - } - - /** - * Get the cookieBasedAffinity property: Cookie based affinity. - * - * @return the cookieBasedAffinity value. - */ - public ApplicationGatewayCookieBasedAffinity cookieBasedAffinity() { - return this.cookieBasedAffinity; - } - - /** - * Set the cookieBasedAffinity property: Cookie based affinity. - * - * @param cookieBasedAffinity the cookieBasedAffinity value to set. - * @return the ApplicationGatewayBackendHttpSettingsPropertiesFormat object itself. - */ - public ApplicationGatewayBackendHttpSettingsPropertiesFormat withCookieBasedAffinity( - ApplicationGatewayCookieBasedAffinity cookieBasedAffinity) { - this.cookieBasedAffinity = cookieBasedAffinity; - return this; - } - - /** - * Get the requestTimeout property: Request timeout in seconds. Application Gateway will fail the request if - * response is not received within RequestTimeout. Acceptable values are from 1 second to 86400 seconds. - * - * @return the requestTimeout value. - */ - public Integer requestTimeout() { - return this.requestTimeout; - } - - /** - * Set the requestTimeout property: Request timeout in seconds. Application Gateway will fail the request if - * response is not received within RequestTimeout. Acceptable values are from 1 second to 86400 seconds. - * - * @param requestTimeout the requestTimeout value to set. - * @return the ApplicationGatewayBackendHttpSettingsPropertiesFormat object itself. - */ - public ApplicationGatewayBackendHttpSettingsPropertiesFormat withRequestTimeout(Integer requestTimeout) { - this.requestTimeout = requestTimeout; - return this; - } - - /** - * Get the probe property: Probe resource of an application gateway. - * - * @return the probe value. - */ - public SubResource probe() { - return this.probe; - } - - /** - * Set the probe property: Probe resource of an application gateway. - * - * @param probe the probe value to set. - * @return the ApplicationGatewayBackendHttpSettingsPropertiesFormat object itself. - */ - public ApplicationGatewayBackendHttpSettingsPropertiesFormat withProbe(SubResource probe) { - this.probe = probe; - return this; - } - - /** - * Get the authenticationCertificates property: Array of references to application gateway authentication - * certificates. - * - * @return the authenticationCertificates value. - */ - public List authenticationCertificates() { - return this.authenticationCertificates; - } - - /** - * Set the authenticationCertificates property: Array of references to application gateway authentication - * certificates. - * - * @param authenticationCertificates the authenticationCertificates value to set. - * @return the ApplicationGatewayBackendHttpSettingsPropertiesFormat object itself. - */ - public ApplicationGatewayBackendHttpSettingsPropertiesFormat withAuthenticationCertificates( - List authenticationCertificates) { - this.authenticationCertificates = authenticationCertificates; - return this; - } - - /** - * Get the trustedRootCertificates property: Array of references to application gateway trusted root certificates. - * - * @return the trustedRootCertificates value. - */ - public List trustedRootCertificates() { - return this.trustedRootCertificates; - } - - /** - * Set the trustedRootCertificates property: Array of references to application gateway trusted root certificates. - * - * @param trustedRootCertificates the trustedRootCertificates value to set. - * @return the ApplicationGatewayBackendHttpSettingsPropertiesFormat object itself. - */ - public ApplicationGatewayBackendHttpSettingsPropertiesFormat withTrustedRootCertificates( - List trustedRootCertificates) { - this.trustedRootCertificates = trustedRootCertificates; - return this; - } - - /** - * Get the connectionDraining property: Connection draining of the backend http settings resource. - * - * @return the connectionDraining value. - */ - public ApplicationGatewayConnectionDraining connectionDraining() { - return this.connectionDraining; - } - - /** - * Set the connectionDraining property: Connection draining of the backend http settings resource. - * - * @param connectionDraining the connectionDraining value to set. - * @return the ApplicationGatewayBackendHttpSettingsPropertiesFormat object itself. - */ - public ApplicationGatewayBackendHttpSettingsPropertiesFormat withConnectionDraining( - ApplicationGatewayConnectionDraining connectionDraining) { - this.connectionDraining = connectionDraining; - return this; - } - - /** - * Get the hostname property: Host header to be sent to the backend servers. - * - * @return the hostname value. - */ - public String hostname() { - return this.hostname; - } - - /** - * Set the hostname property: Host header to be sent to the backend servers. - * - * @param hostname the hostname value to set. - * @return the ApplicationGatewayBackendHttpSettingsPropertiesFormat object itself. - */ - public ApplicationGatewayBackendHttpSettingsPropertiesFormat withHostname(String hostname) { - this.hostname = hostname; - return this; - } - - /** - * Get the pickHostnameFromBackendAddress property: Whether to pick host header should be picked from the host name - * of the backend server. Default value is false. - * - * @return the pickHostnameFromBackendAddress value. - */ - public Boolean pickHostnameFromBackendAddress() { - return this.pickHostnameFromBackendAddress; - } - - /** - * Set the pickHostnameFromBackendAddress property: Whether to pick host header should be picked from the host name - * of the backend server. Default value is false. - * - * @param pickHostnameFromBackendAddress the pickHostnameFromBackendAddress value to set. - * @return the ApplicationGatewayBackendHttpSettingsPropertiesFormat object itself. - */ - public ApplicationGatewayBackendHttpSettingsPropertiesFormat withPickHostnameFromBackendAddress( - Boolean pickHostnameFromBackendAddress) { - this.pickHostnameFromBackendAddress = pickHostnameFromBackendAddress; - return this; - } - - /** - * Get the affinityCookieName property: Cookie name to use for the affinity cookie. - * - * @return the affinityCookieName value. - */ - public String affinityCookieName() { - return this.affinityCookieName; - } - - /** - * Set the affinityCookieName property: Cookie name to use for the affinity cookie. - * - * @param affinityCookieName the affinityCookieName value to set. - * @return the ApplicationGatewayBackendHttpSettingsPropertiesFormat object itself. - */ - public ApplicationGatewayBackendHttpSettingsPropertiesFormat withAffinityCookieName(String affinityCookieName) { - this.affinityCookieName = affinityCookieName; - return this; - } - - /** - * Get the probeEnabled property: Whether the probe is enabled. Default value is false. - * - * @return the probeEnabled value. - */ - public Boolean probeEnabled() { - return this.probeEnabled; - } - - /** - * Set the probeEnabled property: Whether the probe is enabled. Default value is false. - * - * @param probeEnabled the probeEnabled value to set. - * @return the ApplicationGatewayBackendHttpSettingsPropertiesFormat object itself. - */ - public ApplicationGatewayBackendHttpSettingsPropertiesFormat withProbeEnabled(Boolean probeEnabled) { - this.probeEnabled = probeEnabled; - return this; - } - - /** - * Get the path property: Path which should be used as a prefix for all HTTP requests. Null means no path will be - * prefixed. Default value is null. - * - * @return the path value. - */ - public String path() { - return this.path; - } - - /** - * Set the path property: Path which should be used as a prefix for all HTTP requests. Null means no path will be - * prefixed. Default value is null. - * - * @param path the path value to set. - * @return the ApplicationGatewayBackendHttpSettingsPropertiesFormat object itself. - */ - public ApplicationGatewayBackendHttpSettingsPropertiesFormat withPath(String path) { - this.path = path; - return this; - } - - /** - * Get the provisioningState property: Provisioning state of the backend http settings resource. Possible values - * are: 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Set the provisioningState property: Provisioning state of the backend http settings resource. Possible values - * are: 'Updating', 'Deleting', and 'Failed'. - * - * @param provisioningState the provisioningState value to set. - * @return the ApplicationGatewayBackendHttpSettingsPropertiesFormat object itself. - */ - public ApplicationGatewayBackendHttpSettingsPropertiesFormat withProvisioningState(String provisioningState) { - this.provisioningState = provisioningState; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (connectionDraining() != null) { - connectionDraining().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayFirewallRuleSetPropertiesFormat.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayFirewallRuleSetPropertiesFormat.java deleted file mode 100644 index f35b9506c5af..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayFirewallRuleSetPropertiesFormat.java +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.ApplicationGatewayFirewallRuleGroup; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Properties of the web application firewall rule set. */ -@Fluent -public final class ApplicationGatewayFirewallRuleSetPropertiesFormat { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(ApplicationGatewayFirewallRuleSetPropertiesFormat.class); - - /* - * The provisioning state of the web application firewall rule set. - */ - @JsonProperty(value = "provisioningState") - private String provisioningState; - - /* - * The type of the web application firewall rule set. - */ - @JsonProperty(value = "ruleSetType", required = true) - private String ruleSetType; - - /* - * The version of the web application firewall rule set type. - */ - @JsonProperty(value = "ruleSetVersion", required = true) - private String ruleSetVersion; - - /* - * The rule groups of the web application firewall rule set. - */ - @JsonProperty(value = "ruleGroups", required = true) - private List ruleGroups; - - /** - * Get the provisioningState property: The provisioning state of the web application firewall rule set. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Set the provisioningState property: The provisioning state of the web application firewall rule set. - * - * @param provisioningState the provisioningState value to set. - * @return the ApplicationGatewayFirewallRuleSetPropertiesFormat object itself. - */ - public ApplicationGatewayFirewallRuleSetPropertiesFormat withProvisioningState(String provisioningState) { - this.provisioningState = provisioningState; - return this; - } - - /** - * Get the ruleSetType property: The type of the web application firewall rule set. - * - * @return the ruleSetType value. - */ - public String ruleSetType() { - return this.ruleSetType; - } - - /** - * Set the ruleSetType property: The type of the web application firewall rule set. - * - * @param ruleSetType the ruleSetType value to set. - * @return the ApplicationGatewayFirewallRuleSetPropertiesFormat object itself. - */ - public ApplicationGatewayFirewallRuleSetPropertiesFormat withRuleSetType(String ruleSetType) { - this.ruleSetType = ruleSetType; - return this; - } - - /** - * Get the ruleSetVersion property: The version of the web application firewall rule set type. - * - * @return the ruleSetVersion value. - */ - public String ruleSetVersion() { - return this.ruleSetVersion; - } - - /** - * Set the ruleSetVersion property: The version of the web application firewall rule set type. - * - * @param ruleSetVersion the ruleSetVersion value to set. - * @return the ApplicationGatewayFirewallRuleSetPropertiesFormat object itself. - */ - public ApplicationGatewayFirewallRuleSetPropertiesFormat withRuleSetVersion(String ruleSetVersion) { - this.ruleSetVersion = ruleSetVersion; - return this; - } - - /** - * Get the ruleGroups property: The rule groups of the web application firewall rule set. - * - * @return the ruleGroups value. - */ - public List ruleGroups() { - return this.ruleGroups; - } - - /** - * Set the ruleGroups property: The rule groups of the web application firewall rule set. - * - * @param ruleGroups the ruleGroups value to set. - * @return the ApplicationGatewayFirewallRuleSetPropertiesFormat object itself. - */ - public ApplicationGatewayFirewallRuleSetPropertiesFormat withRuleGroups( - List ruleGroups) { - this.ruleGroups = ruleGroups; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (ruleSetType() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property ruleSetType in model" - + " ApplicationGatewayFirewallRuleSetPropertiesFormat")); - } - if (ruleSetVersion() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property ruleSetVersion in model" - + " ApplicationGatewayFirewallRuleSetPropertiesFormat")); - } - if (ruleGroups() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property ruleGroups in model" - + " ApplicationGatewayFirewallRuleSetPropertiesFormat")); - } else { - ruleGroups().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayFrontendIpConfigurationPropertiesFormat.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayFrontendIpConfigurationPropertiesFormat.java deleted file mode 100644 index 3742146f5de9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayFrontendIpConfigurationPropertiesFormat.java +++ /dev/null @@ -1,162 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.IpAllocationMethod; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Properties of Frontend IP configuration of an application gateway. */ -@Fluent -public final class ApplicationGatewayFrontendIpConfigurationPropertiesFormat { - @JsonIgnore - private final ClientLogger logger = - new ClientLogger(ApplicationGatewayFrontendIpConfigurationPropertiesFormat.class); - - /* - * PrivateIPAddress of the network interface IP Configuration. - */ - @JsonProperty(value = "privateIPAddress") - private String privateIpAddress; - - /* - * PrivateIP allocation method. - */ - @JsonProperty(value = "privateIPAllocationMethod") - private IpAllocationMethod privateIpAllocationMethod; - - /* - * Reference of the subnet resource. - */ - @JsonProperty(value = "subnet") - private SubResource subnet; - - /* - * Reference of the PublicIP resource. - */ - @JsonProperty(value = "publicIPAddress") - private SubResource publicIpAddress; - - /* - * Provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - */ - @JsonProperty(value = "provisioningState") - private String provisioningState; - - /** - * Get the privateIpAddress property: PrivateIPAddress of the network interface IP Configuration. - * - * @return the privateIpAddress value. - */ - public String privateIpAddress() { - return this.privateIpAddress; - } - - /** - * Set the privateIpAddress property: PrivateIPAddress of the network interface IP Configuration. - * - * @param privateIpAddress the privateIpAddress value to set. - * @return the ApplicationGatewayFrontendIpConfigurationPropertiesFormat object itself. - */ - public ApplicationGatewayFrontendIpConfigurationPropertiesFormat withPrivateIpAddress(String privateIpAddress) { - this.privateIpAddress = privateIpAddress; - return this; - } - - /** - * Get the privateIpAllocationMethod property: PrivateIP allocation method. - * - * @return the privateIpAllocationMethod value. - */ - public IpAllocationMethod privateIpAllocationMethod() { - return this.privateIpAllocationMethod; - } - - /** - * Set the privateIpAllocationMethod property: PrivateIP allocation method. - * - * @param privateIpAllocationMethod the privateIpAllocationMethod value to set. - * @return the ApplicationGatewayFrontendIpConfigurationPropertiesFormat object itself. - */ - public ApplicationGatewayFrontendIpConfigurationPropertiesFormat withPrivateIpAllocationMethod( - IpAllocationMethod privateIpAllocationMethod) { - this.privateIpAllocationMethod = privateIpAllocationMethod; - return this; - } - - /** - * Get the subnet property: Reference of the subnet resource. - * - * @return the subnet value. - */ - public SubResource subnet() { - return this.subnet; - } - - /** - * Set the subnet property: Reference of the subnet resource. - * - * @param subnet the subnet value to set. - * @return the ApplicationGatewayFrontendIpConfigurationPropertiesFormat object itself. - */ - public ApplicationGatewayFrontendIpConfigurationPropertiesFormat withSubnet(SubResource subnet) { - this.subnet = subnet; - return this; - } - - /** - * Get the publicIpAddress property: Reference of the PublicIP resource. - * - * @return the publicIpAddress value. - */ - public SubResource publicIpAddress() { - return this.publicIpAddress; - } - - /** - * Set the publicIpAddress property: Reference of the PublicIP resource. - * - * @param publicIpAddress the publicIpAddress value to set. - * @return the ApplicationGatewayFrontendIpConfigurationPropertiesFormat object itself. - */ - public ApplicationGatewayFrontendIpConfigurationPropertiesFormat withPublicIpAddress(SubResource publicIpAddress) { - this.publicIpAddress = publicIpAddress; - return this; - } - - /** - * Get the provisioningState property: Provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Set the provisioningState property: Provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param provisioningState the provisioningState value to set. - * @return the ApplicationGatewayFrontendIpConfigurationPropertiesFormat object itself. - */ - public ApplicationGatewayFrontendIpConfigurationPropertiesFormat withProvisioningState(String provisioningState) { - this.provisioningState = provisioningState; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayFrontendPortPropertiesFormat.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayFrontendPortPropertiesFormat.java deleted file mode 100644 index c26f0790a632..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayFrontendPortPropertiesFormat.java +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Properties of Frontend port of an application gateway. */ -@Fluent -public final class ApplicationGatewayFrontendPortPropertiesFormat { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(ApplicationGatewayFrontendPortPropertiesFormat.class); - - /* - * Frontend port - */ - @JsonProperty(value = "port") - private Integer port; - - /* - * Provisioning state of the frontend port resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - */ - @JsonProperty(value = "provisioningState") - private String provisioningState; - - /** - * Get the port property: Frontend port. - * - * @return the port value. - */ - public Integer port() { - return this.port; - } - - /** - * Set the port property: Frontend port. - * - * @param port the port value to set. - * @return the ApplicationGatewayFrontendPortPropertiesFormat object itself. - */ - public ApplicationGatewayFrontendPortPropertiesFormat withPort(Integer port) { - this.port = port; - return this; - } - - /** - * Get the provisioningState property: Provisioning state of the frontend port resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Set the provisioningState property: Provisioning state of the frontend port resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param provisioningState the provisioningState value to set. - * @return the ApplicationGatewayFrontendPortPropertiesFormat object itself. - */ - public ApplicationGatewayFrontendPortPropertiesFormat withProvisioningState(String provisioningState) { - this.provisioningState = provisioningState; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayHttpListenerPropertiesFormat.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayHttpListenerPropertiesFormat.java deleted file mode 100644 index 21c85952f48c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayHttpListenerPropertiesFormat.java +++ /dev/null @@ -1,248 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.ApplicationGatewayCustomError; -import com.azure.resourcemanager.network.models.ApplicationGatewayProtocol; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Properties of HTTP listener of an application gateway. */ -@Fluent -public final class ApplicationGatewayHttpListenerPropertiesFormat { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(ApplicationGatewayHttpListenerPropertiesFormat.class); - - /* - * Frontend IP configuration resource of an application gateway. - */ - @JsonProperty(value = "frontendIPConfiguration") - private SubResource frontendIpConfiguration; - - /* - * Frontend port resource of an application gateway. - */ - @JsonProperty(value = "frontendPort") - private SubResource frontendPort; - - /* - * Protocol of the HTTP listener. Possible values are 'Http' and 'Https'. - */ - @JsonProperty(value = "protocol") - private ApplicationGatewayProtocol protocol; - - /* - * Host name of HTTP listener. - */ - @JsonProperty(value = "hostName") - private String hostname; - - /* - * SSL certificate resource of an application gateway. - */ - @JsonProperty(value = "sslCertificate") - private SubResource sslCertificate; - - /* - * Applicable only if protocol is https. Enables SNI for multi-hosting. - */ - @JsonProperty(value = "requireServerNameIndication") - private Boolean requireServerNameIndication; - - /* - * Provisioning state of the HTTP listener resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - */ - @JsonProperty(value = "provisioningState") - private String provisioningState; - - /* - * Custom error configurations of the HTTP listener. - */ - @JsonProperty(value = "customErrorConfigurations") - private List customErrorConfigurations; - - /** - * Get the frontendIpConfiguration property: Frontend IP configuration resource of an application gateway. - * - * @return the frontendIpConfiguration value. - */ - public SubResource frontendIpConfiguration() { - return this.frontendIpConfiguration; - } - - /** - * Set the frontendIpConfiguration property: Frontend IP configuration resource of an application gateway. - * - * @param frontendIpConfiguration the frontendIpConfiguration value to set. - * @return the ApplicationGatewayHttpListenerPropertiesFormat object itself. - */ - public ApplicationGatewayHttpListenerPropertiesFormat withFrontendIpConfiguration( - SubResource frontendIpConfiguration) { - this.frontendIpConfiguration = frontendIpConfiguration; - return this; - } - - /** - * Get the frontendPort property: Frontend port resource of an application gateway. - * - * @return the frontendPort value. - */ - public SubResource frontendPort() { - return this.frontendPort; - } - - /** - * Set the frontendPort property: Frontend port resource of an application gateway. - * - * @param frontendPort the frontendPort value to set. - * @return the ApplicationGatewayHttpListenerPropertiesFormat object itself. - */ - public ApplicationGatewayHttpListenerPropertiesFormat withFrontendPort(SubResource frontendPort) { - this.frontendPort = frontendPort; - return this; - } - - /** - * Get the protocol property: Protocol of the HTTP listener. Possible values are 'Http' and 'Https'. - * - * @return the protocol value. - */ - public ApplicationGatewayProtocol protocol() { - return this.protocol; - } - - /** - * Set the protocol property: Protocol of the HTTP listener. Possible values are 'Http' and 'Https'. - * - * @param protocol the protocol value to set. - * @return the ApplicationGatewayHttpListenerPropertiesFormat object itself. - */ - public ApplicationGatewayHttpListenerPropertiesFormat withProtocol(ApplicationGatewayProtocol protocol) { - this.protocol = protocol; - return this; - } - - /** - * Get the hostname property: Host name of HTTP listener. - * - * @return the hostname value. - */ - public String hostname() { - return this.hostname; - } - - /** - * Set the hostname property: Host name of HTTP listener. - * - * @param hostname the hostname value to set. - * @return the ApplicationGatewayHttpListenerPropertiesFormat object itself. - */ - public ApplicationGatewayHttpListenerPropertiesFormat withHostname(String hostname) { - this.hostname = hostname; - return this; - } - - /** - * Get the sslCertificate property: SSL certificate resource of an application gateway. - * - * @return the sslCertificate value. - */ - public SubResource sslCertificate() { - return this.sslCertificate; - } - - /** - * Set the sslCertificate property: SSL certificate resource of an application gateway. - * - * @param sslCertificate the sslCertificate value to set. - * @return the ApplicationGatewayHttpListenerPropertiesFormat object itself. - */ - public ApplicationGatewayHttpListenerPropertiesFormat withSslCertificate(SubResource sslCertificate) { - this.sslCertificate = sslCertificate; - return this; - } - - /** - * Get the requireServerNameIndication property: Applicable only if protocol is https. Enables SNI for - * multi-hosting. - * - * @return the requireServerNameIndication value. - */ - public Boolean requireServerNameIndication() { - return this.requireServerNameIndication; - } - - /** - * Set the requireServerNameIndication property: Applicable only if protocol is https. Enables SNI for - * multi-hosting. - * - * @param requireServerNameIndication the requireServerNameIndication value to set. - * @return the ApplicationGatewayHttpListenerPropertiesFormat object itself. - */ - public ApplicationGatewayHttpListenerPropertiesFormat withRequireServerNameIndication( - Boolean requireServerNameIndication) { - this.requireServerNameIndication = requireServerNameIndication; - return this; - } - - /** - * Get the provisioningState property: Provisioning state of the HTTP listener resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Set the provisioningState property: Provisioning state of the HTTP listener resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param provisioningState the provisioningState value to set. - * @return the ApplicationGatewayHttpListenerPropertiesFormat object itself. - */ - public ApplicationGatewayHttpListenerPropertiesFormat withProvisioningState(String provisioningState) { - this.provisioningState = provisioningState; - return this; - } - - /** - * Get the customErrorConfigurations property: Custom error configurations of the HTTP listener. - * - * @return the customErrorConfigurations value. - */ - public List customErrorConfigurations() { - return this.customErrorConfigurations; - } - - /** - * Set the customErrorConfigurations property: Custom error configurations of the HTTP listener. - * - * @param customErrorConfigurations the customErrorConfigurations value to set. - * @return the ApplicationGatewayHttpListenerPropertiesFormat object itself. - */ - public ApplicationGatewayHttpListenerPropertiesFormat withCustomErrorConfigurations( - List customErrorConfigurations) { - this.customErrorConfigurations = customErrorConfigurations; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (customErrorConfigurations() != null) { - customErrorConfigurations().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayInner.java deleted file mode 100644 index 6e0cec04800b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayInner.java +++ /dev/null @@ -1,732 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.ApplicationGatewayAutoscaleConfiguration; -import com.azure.resourcemanager.network.models.ApplicationGatewayBackendAddressPool; -import com.azure.resourcemanager.network.models.ApplicationGatewayBackendHttpSettings; -import com.azure.resourcemanager.network.models.ApplicationGatewayCustomError; -import com.azure.resourcemanager.network.models.ApplicationGatewayFrontendIpConfiguration; -import com.azure.resourcemanager.network.models.ApplicationGatewayFrontendPort; -import com.azure.resourcemanager.network.models.ApplicationGatewayHttpListener; -import com.azure.resourcemanager.network.models.ApplicationGatewayOperationalState; -import com.azure.resourcemanager.network.models.ApplicationGatewayRewriteRuleSet; -import com.azure.resourcemanager.network.models.ApplicationGatewaySku; -import com.azure.resourcemanager.network.models.ApplicationGatewaySslPolicy; -import com.azure.resourcemanager.network.models.ApplicationGatewayTrustedRootCertificate; -import com.azure.resourcemanager.network.models.ApplicationGatewayWebApplicationFirewallConfiguration; -import com.azure.resourcemanager.network.models.ManagedServiceIdentity; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** Application gateway resource. */ -@Fluent -public final class ApplicationGatewayInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayInner.class); - - /* - * Properties of the application gateway. - */ - @JsonProperty(value = "properties") - private ApplicationGatewayPropertiesFormat innerProperties; - - /* - * A unique read-only string that changes whenever the resource is updated. - */ - @JsonProperty(value = "etag") - private String etag; - - /* - * A list of availability zones denoting where the resource needs to come - * from. - */ - @JsonProperty(value = "zones") - private List zones; - - /* - * The identity of the application gateway, if configured. - */ - @JsonProperty(value = "identity") - private ManagedServiceIdentity identity; - - /* - * Resource ID. - */ - @JsonProperty(value = "id") - private String id; - - /** - * Get the innerProperties property: Properties of the application gateway. - * - * @return the innerProperties value. - */ - private ApplicationGatewayPropertiesFormat innerProperties() { - return this.innerProperties; - } - - /** - * Get the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @param etag the etag value to set. - * @return the ApplicationGatewayInner object itself. - */ - public ApplicationGatewayInner withEtag(String etag) { - this.etag = etag; - return this; - } - - /** - * Get the zones property: A list of availability zones denoting where the resource needs to come from. - * - * @return the zones value. - */ - public List zones() { - return this.zones; - } - - /** - * Set the zones property: A list of availability zones denoting where the resource needs to come from. - * - * @param zones the zones value to set. - * @return the ApplicationGatewayInner object itself. - */ - public ApplicationGatewayInner withZones(List zones) { - this.zones = zones; - return this; - } - - /** - * Get the identity property: The identity of the application gateway, if configured. - * - * @return the identity value. - */ - public ManagedServiceIdentity identity() { - return this.identity; - } - - /** - * Set the identity property: The identity of the application gateway, if configured. - * - * @param identity the identity value to set. - * @return the ApplicationGatewayInner object itself. - */ - public ApplicationGatewayInner withIdentity(ManagedServiceIdentity identity) { - this.identity = identity; - return this; - } - - /** - * Get the id property: Resource ID. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: Resource ID. - * - * @param id the id value to set. - * @return the ApplicationGatewayInner object itself. - */ - public ApplicationGatewayInner withId(String id) { - this.id = id; - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicationGatewayInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicationGatewayInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the sku property: SKU of the application gateway resource. - * - * @return the sku value. - */ - public ApplicationGatewaySku sku() { - return this.innerProperties() == null ? null : this.innerProperties().sku(); - } - - /** - * Set the sku property: SKU of the application gateway resource. - * - * @param sku the sku value to set. - * @return the ApplicationGatewayInner object itself. - */ - public ApplicationGatewayInner withSku(ApplicationGatewaySku sku) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayPropertiesFormat(); - } - this.innerProperties().withSku(sku); - return this; - } - - /** - * Get the sslPolicy property: SSL policy of the application gateway resource. - * - * @return the sslPolicy value. - */ - public ApplicationGatewaySslPolicy sslPolicy() { - return this.innerProperties() == null ? null : this.innerProperties().sslPolicy(); - } - - /** - * Set the sslPolicy property: SSL policy of the application gateway resource. - * - * @param sslPolicy the sslPolicy value to set. - * @return the ApplicationGatewayInner object itself. - */ - public ApplicationGatewayInner withSslPolicy(ApplicationGatewaySslPolicy sslPolicy) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayPropertiesFormat(); - } - this.innerProperties().withSslPolicy(sslPolicy); - return this; - } - - /** - * Get the operationalState property: Operational state of the application gateway resource. - * - * @return the operationalState value. - */ - public ApplicationGatewayOperationalState operationalState() { - return this.innerProperties() == null ? null : this.innerProperties().operationalState(); - } - - /** - * Get the gatewayIpConfigurations property: Subnets of application the gateway resource. - * - * @return the gatewayIpConfigurations value. - */ - public List gatewayIpConfigurations() { - return this.innerProperties() == null ? null : this.innerProperties().gatewayIpConfigurations(); - } - - /** - * Set the gatewayIpConfigurations property: Subnets of application the gateway resource. - * - * @param gatewayIpConfigurations the gatewayIpConfigurations value to set. - * @return the ApplicationGatewayInner object itself. - */ - public ApplicationGatewayInner withGatewayIpConfigurations( - List gatewayIpConfigurations) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayPropertiesFormat(); - } - this.innerProperties().withGatewayIpConfigurations(gatewayIpConfigurations); - return this; - } - - /** - * Get the authenticationCertificates property: Authentication certificates of the application gateway resource. - * - * @return the authenticationCertificates value. - */ - public List authenticationCertificates() { - return this.innerProperties() == null ? null : this.innerProperties().authenticationCertificates(); - } - - /** - * Set the authenticationCertificates property: Authentication certificates of the application gateway resource. - * - * @param authenticationCertificates the authenticationCertificates value to set. - * @return the ApplicationGatewayInner object itself. - */ - public ApplicationGatewayInner withAuthenticationCertificates( - List authenticationCertificates) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayPropertiesFormat(); - } - this.innerProperties().withAuthenticationCertificates(authenticationCertificates); - return this; - } - - /** - * Get the trustedRootCertificates property: Trusted Root certificates of the application gateway resource. - * - * @return the trustedRootCertificates value. - */ - public List trustedRootCertificates() { - return this.innerProperties() == null ? null : this.innerProperties().trustedRootCertificates(); - } - - /** - * Set the trustedRootCertificates property: Trusted Root certificates of the application gateway resource. - * - * @param trustedRootCertificates the trustedRootCertificates value to set. - * @return the ApplicationGatewayInner object itself. - */ - public ApplicationGatewayInner withTrustedRootCertificates( - List trustedRootCertificates) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayPropertiesFormat(); - } - this.innerProperties().withTrustedRootCertificates(trustedRootCertificates); - return this; - } - - /** - * Get the sslCertificates property: SSL certificates of the application gateway resource. - * - * @return the sslCertificates value. - */ - public List sslCertificates() { - return this.innerProperties() == null ? null : this.innerProperties().sslCertificates(); - } - - /** - * Set the sslCertificates property: SSL certificates of the application gateway resource. - * - * @param sslCertificates the sslCertificates value to set. - * @return the ApplicationGatewayInner object itself. - */ - public ApplicationGatewayInner withSslCertificates(List sslCertificates) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayPropertiesFormat(); - } - this.innerProperties().withSslCertificates(sslCertificates); - return this; - } - - /** - * Get the frontendIpConfigurations property: Frontend IP addresses of the application gateway resource. - * - * @return the frontendIpConfigurations value. - */ - public List frontendIpConfigurations() { - return this.innerProperties() == null ? null : this.innerProperties().frontendIpConfigurations(); - } - - /** - * Set the frontendIpConfigurations property: Frontend IP addresses of the application gateway resource. - * - * @param frontendIpConfigurations the frontendIpConfigurations value to set. - * @return the ApplicationGatewayInner object itself. - */ - public ApplicationGatewayInner withFrontendIpConfigurations( - List frontendIpConfigurations) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayPropertiesFormat(); - } - this.innerProperties().withFrontendIpConfigurations(frontendIpConfigurations); - return this; - } - - /** - * Get the frontendPorts property: Frontend ports of the application gateway resource. - * - * @return the frontendPorts value. - */ - public List frontendPorts() { - return this.innerProperties() == null ? null : this.innerProperties().frontendPorts(); - } - - /** - * Set the frontendPorts property: Frontend ports of the application gateway resource. - * - * @param frontendPorts the frontendPorts value to set. - * @return the ApplicationGatewayInner object itself. - */ - public ApplicationGatewayInner withFrontendPorts(List frontendPorts) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayPropertiesFormat(); - } - this.innerProperties().withFrontendPorts(frontendPorts); - return this; - } - - /** - * Get the probes property: Probes of the application gateway resource. - * - * @return the probes value. - */ - public List probes() { - return this.innerProperties() == null ? null : this.innerProperties().probes(); - } - - /** - * Set the probes property: Probes of the application gateway resource. - * - * @param probes the probes value to set. - * @return the ApplicationGatewayInner object itself. - */ - public ApplicationGatewayInner withProbes(List probes) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayPropertiesFormat(); - } - this.innerProperties().withProbes(probes); - return this; - } - - /** - * Get the backendAddressPools property: Backend address pool of the application gateway resource. - * - * @return the backendAddressPools value. - */ - public List backendAddressPools() { - return this.innerProperties() == null ? null : this.innerProperties().backendAddressPools(); - } - - /** - * Set the backendAddressPools property: Backend address pool of the application gateway resource. - * - * @param backendAddressPools the backendAddressPools value to set. - * @return the ApplicationGatewayInner object itself. - */ - public ApplicationGatewayInner withBackendAddressPools( - List backendAddressPools) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayPropertiesFormat(); - } - this.innerProperties().withBackendAddressPools(backendAddressPools); - return this; - } - - /** - * Get the backendHttpSettingsCollection property: Backend http settings of the application gateway resource. - * - * @return the backendHttpSettingsCollection value. - */ - public List backendHttpSettingsCollection() { - return this.innerProperties() == null ? null : this.innerProperties().backendHttpSettingsCollection(); - } - - /** - * Set the backendHttpSettingsCollection property: Backend http settings of the application gateway resource. - * - * @param backendHttpSettingsCollection the backendHttpSettingsCollection value to set. - * @return the ApplicationGatewayInner object itself. - */ - public ApplicationGatewayInner withBackendHttpSettingsCollection( - List backendHttpSettingsCollection) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayPropertiesFormat(); - } - this.innerProperties().withBackendHttpSettingsCollection(backendHttpSettingsCollection); - return this; - } - - /** - * Get the httpListeners property: Http listeners of the application gateway resource. - * - * @return the httpListeners value. - */ - public List httpListeners() { - return this.innerProperties() == null ? null : this.innerProperties().httpListeners(); - } - - /** - * Set the httpListeners property: Http listeners of the application gateway resource. - * - * @param httpListeners the httpListeners value to set. - * @return the ApplicationGatewayInner object itself. - */ - public ApplicationGatewayInner withHttpListeners(List httpListeners) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayPropertiesFormat(); - } - this.innerProperties().withHttpListeners(httpListeners); - return this; - } - - /** - * Get the urlPathMaps property: URL path map of the application gateway resource. - * - * @return the urlPathMaps value. - */ - public List urlPathMaps() { - return this.innerProperties() == null ? null : this.innerProperties().urlPathMaps(); - } - - /** - * Set the urlPathMaps property: URL path map of the application gateway resource. - * - * @param urlPathMaps the urlPathMaps value to set. - * @return the ApplicationGatewayInner object itself. - */ - public ApplicationGatewayInner withUrlPathMaps(List urlPathMaps) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayPropertiesFormat(); - } - this.innerProperties().withUrlPathMaps(urlPathMaps); - return this; - } - - /** - * Get the requestRoutingRules property: Request routing rules of the application gateway resource. - * - * @return the requestRoutingRules value. - */ - public List requestRoutingRules() { - return this.innerProperties() == null ? null : this.innerProperties().requestRoutingRules(); - } - - /** - * Set the requestRoutingRules property: Request routing rules of the application gateway resource. - * - * @param requestRoutingRules the requestRoutingRules value to set. - * @return the ApplicationGatewayInner object itself. - */ - public ApplicationGatewayInner withRequestRoutingRules( - List requestRoutingRules) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayPropertiesFormat(); - } - this.innerProperties().withRequestRoutingRules(requestRoutingRules); - return this; - } - - /** - * Get the rewriteRuleSets property: Rewrite rules for the application gateway resource. - * - * @return the rewriteRuleSets value. - */ - public List rewriteRuleSets() { - return this.innerProperties() == null ? null : this.innerProperties().rewriteRuleSets(); - } - - /** - * Set the rewriteRuleSets property: Rewrite rules for the application gateway resource. - * - * @param rewriteRuleSets the rewriteRuleSets value to set. - * @return the ApplicationGatewayInner object itself. - */ - public ApplicationGatewayInner withRewriteRuleSets(List rewriteRuleSets) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayPropertiesFormat(); - } - this.innerProperties().withRewriteRuleSets(rewriteRuleSets); - return this; - } - - /** - * Get the redirectConfigurations property: Redirect configurations of the application gateway resource. - * - * @return the redirectConfigurations value. - */ - public List redirectConfigurations() { - return this.innerProperties() == null ? null : this.innerProperties().redirectConfigurations(); - } - - /** - * Set the redirectConfigurations property: Redirect configurations of the application gateway resource. - * - * @param redirectConfigurations the redirectConfigurations value to set. - * @return the ApplicationGatewayInner object itself. - */ - public ApplicationGatewayInner withRedirectConfigurations( - List redirectConfigurations) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayPropertiesFormat(); - } - this.innerProperties().withRedirectConfigurations(redirectConfigurations); - return this; - } - - /** - * Get the webApplicationFirewallConfiguration property: Web application firewall configuration. - * - * @return the webApplicationFirewallConfiguration value. - */ - public ApplicationGatewayWebApplicationFirewallConfiguration webApplicationFirewallConfiguration() { - return this.innerProperties() == null ? null : this.innerProperties().webApplicationFirewallConfiguration(); - } - - /** - * Set the webApplicationFirewallConfiguration property: Web application firewall configuration. - * - * @param webApplicationFirewallConfiguration the webApplicationFirewallConfiguration value to set. - * @return the ApplicationGatewayInner object itself. - */ - public ApplicationGatewayInner withWebApplicationFirewallConfiguration( - ApplicationGatewayWebApplicationFirewallConfiguration webApplicationFirewallConfiguration) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayPropertiesFormat(); - } - this.innerProperties().withWebApplicationFirewallConfiguration(webApplicationFirewallConfiguration); - return this; - } - - /** - * Get the enableHttp2 property: Whether HTTP2 is enabled on the application gateway resource. - * - * @return the enableHttp2 value. - */ - public Boolean enableHttp2() { - return this.innerProperties() == null ? null : this.innerProperties().enableHttp2(); - } - - /** - * Set the enableHttp2 property: Whether HTTP2 is enabled on the application gateway resource. - * - * @param enableHttp2 the enableHttp2 value to set. - * @return the ApplicationGatewayInner object itself. - */ - public ApplicationGatewayInner withEnableHttp2(Boolean enableHttp2) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayPropertiesFormat(); - } - this.innerProperties().withEnableHttp2(enableHttp2); - return this; - } - - /** - * Get the enableFips property: Whether FIPS is enabled on the application gateway resource. - * - * @return the enableFips value. - */ - public Boolean enableFips() { - return this.innerProperties() == null ? null : this.innerProperties().enableFips(); - } - - /** - * Set the enableFips property: Whether FIPS is enabled on the application gateway resource. - * - * @param enableFips the enableFips value to set. - * @return the ApplicationGatewayInner object itself. - */ - public ApplicationGatewayInner withEnableFips(Boolean enableFips) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayPropertiesFormat(); - } - this.innerProperties().withEnableFips(enableFips); - return this; - } - - /** - * Get the autoscaleConfiguration property: Autoscale Configuration. - * - * @return the autoscaleConfiguration value. - */ - public ApplicationGatewayAutoscaleConfiguration autoscaleConfiguration() { - return this.innerProperties() == null ? null : this.innerProperties().autoscaleConfiguration(); - } - - /** - * Set the autoscaleConfiguration property: Autoscale Configuration. - * - * @param autoscaleConfiguration the autoscaleConfiguration value to set. - * @return the ApplicationGatewayInner object itself. - */ - public ApplicationGatewayInner withAutoscaleConfiguration( - ApplicationGatewayAutoscaleConfiguration autoscaleConfiguration) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayPropertiesFormat(); - } - this.innerProperties().withAutoscaleConfiguration(autoscaleConfiguration); - return this; - } - - /** - * Get the resourceGuid property: Resource GUID property of the application gateway resource. - * - * @return the resourceGuid value. - */ - public String resourceGuid() { - return this.innerProperties() == null ? null : this.innerProperties().resourceGuid(); - } - - /** - * Set the resourceGuid property: Resource GUID property of the application gateway resource. - * - * @param resourceGuid the resourceGuid value to set. - * @return the ApplicationGatewayInner object itself. - */ - public ApplicationGatewayInner withResourceGuid(String resourceGuid) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayPropertiesFormat(); - } - this.innerProperties().withResourceGuid(resourceGuid); - return this; - } - - /** - * Get the provisioningState property: Provisioning state of the application gateway resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Set the provisioningState property: Provisioning state of the application gateway resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param provisioningState the provisioningState value to set. - * @return the ApplicationGatewayInner object itself. - */ - public ApplicationGatewayInner withProvisioningState(String provisioningState) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayPropertiesFormat(); - } - this.innerProperties().withProvisioningState(provisioningState); - return this; - } - - /** - * Get the customErrorConfigurations property: Custom error configurations of the application gateway resource. - * - * @return the customErrorConfigurations value. - */ - public List customErrorConfigurations() { - return this.innerProperties() == null ? null : this.innerProperties().customErrorConfigurations(); - } - - /** - * Set the customErrorConfigurations property: Custom error configurations of the application gateway resource. - * - * @param customErrorConfigurations the customErrorConfigurations value to set. - * @return the ApplicationGatewayInner object itself. - */ - public ApplicationGatewayInner withCustomErrorConfigurations( - List customErrorConfigurations) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayPropertiesFormat(); - } - this.innerProperties().withCustomErrorConfigurations(customErrorConfigurations); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - if (identity() != null) { - identity().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayIpConfigurationInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayIpConfigurationInner.java deleted file mode 100644 index ee7f588c1b4c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayIpConfigurationInner.java +++ /dev/null @@ -1,179 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** IP configuration of an application gateway. Currently 1 public and 1 private IP configuration is allowed. */ -@Fluent -public final class ApplicationGatewayIpConfigurationInner extends SubResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayIpConfigurationInner.class); - - /* - * Properties of IP configuration of an application gateway. - */ - @JsonProperty(value = "properties") - private ApplicationGatewayIpConfigurationPropertiesFormat innerProperties; - - /* - * Name of the IP configuration that is unique within an Application - * Gateway. - */ - @JsonProperty(value = "name") - private String name; - - /* - * A unique read-only string that changes whenever the resource is updated. - */ - @JsonProperty(value = "etag") - private String etag; - - /* - * Type of the resource. - */ - @JsonProperty(value = "type") - private String type; - - /** - * Get the innerProperties property: Properties of IP configuration of an application gateway. - * - * @return the innerProperties value. - */ - private ApplicationGatewayIpConfigurationPropertiesFormat innerProperties() { - return this.innerProperties; - } - - /** - * Get the name property: Name of the IP configuration that is unique within an Application Gateway. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Name of the IP configuration that is unique within an Application Gateway. - * - * @param name the name value to set. - * @return the ApplicationGatewayIpConfigurationInner object itself. - */ - public ApplicationGatewayIpConfigurationInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @param etag the etag value to set. - * @return the ApplicationGatewayIpConfigurationInner object itself. - */ - public ApplicationGatewayIpConfigurationInner withEtag(String etag) { - this.etag = etag; - return this; - } - - /** - * Get the type property: Type of the resource. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Set the type property: Type of the resource. - * - * @param type the type value to set. - * @return the ApplicationGatewayIpConfigurationInner object itself. - */ - public ApplicationGatewayIpConfigurationInner withType(String type) { - this.type = type; - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicationGatewayIpConfigurationInner withId(String id) { - super.withId(id); - return this; - } - - /** - * Get the subnet property: Reference of the subnet resource. A subnet from where application gateway gets its - * private address. - * - * @return the subnet value. - */ - public SubResource subnet() { - return this.innerProperties() == null ? null : this.innerProperties().subnet(); - } - - /** - * Set the subnet property: Reference of the subnet resource. A subnet from where application gateway gets its - * private address. - * - * @param subnet the subnet value to set. - * @return the ApplicationGatewayIpConfigurationInner object itself. - */ - public ApplicationGatewayIpConfigurationInner withSubnet(SubResource subnet) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayIpConfigurationPropertiesFormat(); - } - this.innerProperties().withSubnet(subnet); - return this; - } - - /** - * Get the provisioningState property: Provisioning state of the application gateway subnet resource. Possible - * values are: 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Set the provisioningState property: Provisioning state of the application gateway subnet resource. Possible - * values are: 'Updating', 'Deleting', and 'Failed'. - * - * @param provisioningState the provisioningState value to set. - * @return the ApplicationGatewayIpConfigurationInner object itself. - */ - public ApplicationGatewayIpConfigurationInner withProvisioningState(String provisioningState) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayIpConfigurationPropertiesFormat(); - } - this.innerProperties().withProvisioningState(provisioningState); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayIpConfigurationPropertiesFormat.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayIpConfigurationPropertiesFormat.java deleted file mode 100644 index 9093d5c84cd9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayIpConfigurationPropertiesFormat.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Properties of IP configuration of an application gateway. */ -@Fluent -public final class ApplicationGatewayIpConfigurationPropertiesFormat { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(ApplicationGatewayIpConfigurationPropertiesFormat.class); - - /* - * Reference of the subnet resource. A subnet from where application - * gateway gets its private address. - */ - @JsonProperty(value = "subnet") - private SubResource subnet; - - /* - * Provisioning state of the application gateway subnet resource. Possible - * values are: 'Updating', 'Deleting', and 'Failed'. - */ - @JsonProperty(value = "provisioningState") - private String provisioningState; - - /** - * Get the subnet property: Reference of the subnet resource. A subnet from where application gateway gets its - * private address. - * - * @return the subnet value. - */ - public SubResource subnet() { - return this.subnet; - } - - /** - * Set the subnet property: Reference of the subnet resource. A subnet from where application gateway gets its - * private address. - * - * @param subnet the subnet value to set. - * @return the ApplicationGatewayIpConfigurationPropertiesFormat object itself. - */ - public ApplicationGatewayIpConfigurationPropertiesFormat withSubnet(SubResource subnet) { - this.subnet = subnet; - return this; - } - - /** - * Get the provisioningState property: Provisioning state of the application gateway subnet resource. Possible - * values are: 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Set the provisioningState property: Provisioning state of the application gateway subnet resource. Possible - * values are: 'Updating', 'Deleting', and 'Failed'. - * - * @param provisioningState the provisioningState value to set. - * @return the ApplicationGatewayIpConfigurationPropertiesFormat object itself. - */ - public ApplicationGatewayIpConfigurationPropertiesFormat withProvisioningState(String provisioningState) { - this.provisioningState = provisioningState; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayPathRuleInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayPathRuleInner.java deleted file mode 100644 index 1e150f9b9983..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayPathRuleInner.java +++ /dev/null @@ -1,269 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Path rule of URL path map of an application gateway. */ -@Fluent -public final class ApplicationGatewayPathRuleInner extends SubResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayPathRuleInner.class); - - /* - * Properties of path rule of an application gateway. - */ - @JsonProperty(value = "properties") - private ApplicationGatewayPathRulePropertiesFormat innerProperties; - - /* - * Name of the path rule that is unique within an Application Gateway. - */ - @JsonProperty(value = "name") - private String name; - - /* - * A unique read-only string that changes whenever the resource is updated. - */ - @JsonProperty(value = "etag") - private String etag; - - /* - * Type of the resource. - */ - @JsonProperty(value = "type") - private String type; - - /** - * Get the innerProperties property: Properties of path rule of an application gateway. - * - * @return the innerProperties value. - */ - private ApplicationGatewayPathRulePropertiesFormat innerProperties() { - return this.innerProperties; - } - - /** - * Get the name property: Name of the path rule that is unique within an Application Gateway. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Name of the path rule that is unique within an Application Gateway. - * - * @param name the name value to set. - * @return the ApplicationGatewayPathRuleInner object itself. - */ - public ApplicationGatewayPathRuleInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @param etag the etag value to set. - * @return the ApplicationGatewayPathRuleInner object itself. - */ - public ApplicationGatewayPathRuleInner withEtag(String etag) { - this.etag = etag; - return this; - } - - /** - * Get the type property: Type of the resource. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Set the type property: Type of the resource. - * - * @param type the type value to set. - * @return the ApplicationGatewayPathRuleInner object itself. - */ - public ApplicationGatewayPathRuleInner withType(String type) { - this.type = type; - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicationGatewayPathRuleInner withId(String id) { - super.withId(id); - return this; - } - - /** - * Get the paths property: Path rules of URL path map. - * - * @return the paths value. - */ - public List paths() { - return this.innerProperties() == null ? null : this.innerProperties().paths(); - } - - /** - * Set the paths property: Path rules of URL path map. - * - * @param paths the paths value to set. - * @return the ApplicationGatewayPathRuleInner object itself. - */ - public ApplicationGatewayPathRuleInner withPaths(List paths) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayPathRulePropertiesFormat(); - } - this.innerProperties().withPaths(paths); - return this; - } - - /** - * Get the backendAddressPool property: Backend address pool resource of URL path map path rule. - * - * @return the backendAddressPool value. - */ - public SubResource backendAddressPool() { - return this.innerProperties() == null ? null : this.innerProperties().backendAddressPool(); - } - - /** - * Set the backendAddressPool property: Backend address pool resource of URL path map path rule. - * - * @param backendAddressPool the backendAddressPool value to set. - * @return the ApplicationGatewayPathRuleInner object itself. - */ - public ApplicationGatewayPathRuleInner withBackendAddressPool(SubResource backendAddressPool) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayPathRulePropertiesFormat(); - } - this.innerProperties().withBackendAddressPool(backendAddressPool); - return this; - } - - /** - * Get the backendHttpSettings property: Backend http settings resource of URL path map path rule. - * - * @return the backendHttpSettings value. - */ - public SubResource backendHttpSettings() { - return this.innerProperties() == null ? null : this.innerProperties().backendHttpSettings(); - } - - /** - * Set the backendHttpSettings property: Backend http settings resource of URL path map path rule. - * - * @param backendHttpSettings the backendHttpSettings value to set. - * @return the ApplicationGatewayPathRuleInner object itself. - */ - public ApplicationGatewayPathRuleInner withBackendHttpSettings(SubResource backendHttpSettings) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayPathRulePropertiesFormat(); - } - this.innerProperties().withBackendHttpSettings(backendHttpSettings); - return this; - } - - /** - * Get the redirectConfiguration property: Redirect configuration resource of URL path map path rule. - * - * @return the redirectConfiguration value. - */ - public SubResource redirectConfiguration() { - return this.innerProperties() == null ? null : this.innerProperties().redirectConfiguration(); - } - - /** - * Set the redirectConfiguration property: Redirect configuration resource of URL path map path rule. - * - * @param redirectConfiguration the redirectConfiguration value to set. - * @return the ApplicationGatewayPathRuleInner object itself. - */ - public ApplicationGatewayPathRuleInner withRedirectConfiguration(SubResource redirectConfiguration) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayPathRulePropertiesFormat(); - } - this.innerProperties().withRedirectConfiguration(redirectConfiguration); - return this; - } - - /** - * Get the rewriteRuleSet property: Rewrite rule set resource of URL path map path rule. - * - * @return the rewriteRuleSet value. - */ - public SubResource rewriteRuleSet() { - return this.innerProperties() == null ? null : this.innerProperties().rewriteRuleSet(); - } - - /** - * Set the rewriteRuleSet property: Rewrite rule set resource of URL path map path rule. - * - * @param rewriteRuleSet the rewriteRuleSet value to set. - * @return the ApplicationGatewayPathRuleInner object itself. - */ - public ApplicationGatewayPathRuleInner withRewriteRuleSet(SubResource rewriteRuleSet) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayPathRulePropertiesFormat(); - } - this.innerProperties().withRewriteRuleSet(rewriteRuleSet); - return this; - } - - /** - * Get the provisioningState property: Path rule of URL path map resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Set the provisioningState property: Path rule of URL path map resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * - * @param provisioningState the provisioningState value to set. - * @return the ApplicationGatewayPathRuleInner object itself. - */ - public ApplicationGatewayPathRuleInner withProvisioningState(String provisioningState) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayPathRulePropertiesFormat(); - } - this.innerProperties().withProvisioningState(provisioningState); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayPathRulePropertiesFormat.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayPathRulePropertiesFormat.java deleted file mode 100644 index c15c86ac7396..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayPathRulePropertiesFormat.java +++ /dev/null @@ -1,185 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Properties of path rule of an application gateway. */ -@Fluent -public final class ApplicationGatewayPathRulePropertiesFormat { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayPathRulePropertiesFormat.class); - - /* - * Path rules of URL path map. - */ - @JsonProperty(value = "paths") - private List paths; - - /* - * Backend address pool resource of URL path map path rule. - */ - @JsonProperty(value = "backendAddressPool") - private SubResource backendAddressPool; - - /* - * Backend http settings resource of URL path map path rule. - */ - @JsonProperty(value = "backendHttpSettings") - private SubResource backendHttpSettings; - - /* - * Redirect configuration resource of URL path map path rule. - */ - @JsonProperty(value = "redirectConfiguration") - private SubResource redirectConfiguration; - - /* - * Rewrite rule set resource of URL path map path rule. - */ - @JsonProperty(value = "rewriteRuleSet") - private SubResource rewriteRuleSet; - - /* - * Path rule of URL path map resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - */ - @JsonProperty(value = "provisioningState") - private String provisioningState; - - /** - * Get the paths property: Path rules of URL path map. - * - * @return the paths value. - */ - public List paths() { - return this.paths; - } - - /** - * Set the paths property: Path rules of URL path map. - * - * @param paths the paths value to set. - * @return the ApplicationGatewayPathRulePropertiesFormat object itself. - */ - public ApplicationGatewayPathRulePropertiesFormat withPaths(List paths) { - this.paths = paths; - return this; - } - - /** - * Get the backendAddressPool property: Backend address pool resource of URL path map path rule. - * - * @return the backendAddressPool value. - */ - public SubResource backendAddressPool() { - return this.backendAddressPool; - } - - /** - * Set the backendAddressPool property: Backend address pool resource of URL path map path rule. - * - * @param backendAddressPool the backendAddressPool value to set. - * @return the ApplicationGatewayPathRulePropertiesFormat object itself. - */ - public ApplicationGatewayPathRulePropertiesFormat withBackendAddressPool(SubResource backendAddressPool) { - this.backendAddressPool = backendAddressPool; - return this; - } - - /** - * Get the backendHttpSettings property: Backend http settings resource of URL path map path rule. - * - * @return the backendHttpSettings value. - */ - public SubResource backendHttpSettings() { - return this.backendHttpSettings; - } - - /** - * Set the backendHttpSettings property: Backend http settings resource of URL path map path rule. - * - * @param backendHttpSettings the backendHttpSettings value to set. - * @return the ApplicationGatewayPathRulePropertiesFormat object itself. - */ - public ApplicationGatewayPathRulePropertiesFormat withBackendHttpSettings(SubResource backendHttpSettings) { - this.backendHttpSettings = backendHttpSettings; - return this; - } - - /** - * Get the redirectConfiguration property: Redirect configuration resource of URL path map path rule. - * - * @return the redirectConfiguration value. - */ - public SubResource redirectConfiguration() { - return this.redirectConfiguration; - } - - /** - * Set the redirectConfiguration property: Redirect configuration resource of URL path map path rule. - * - * @param redirectConfiguration the redirectConfiguration value to set. - * @return the ApplicationGatewayPathRulePropertiesFormat object itself. - */ - public ApplicationGatewayPathRulePropertiesFormat withRedirectConfiguration(SubResource redirectConfiguration) { - this.redirectConfiguration = redirectConfiguration; - return this; - } - - /** - * Get the rewriteRuleSet property: Rewrite rule set resource of URL path map path rule. - * - * @return the rewriteRuleSet value. - */ - public SubResource rewriteRuleSet() { - return this.rewriteRuleSet; - } - - /** - * Set the rewriteRuleSet property: Rewrite rule set resource of URL path map path rule. - * - * @param rewriteRuleSet the rewriteRuleSet value to set. - * @return the ApplicationGatewayPathRulePropertiesFormat object itself. - */ - public ApplicationGatewayPathRulePropertiesFormat withRewriteRuleSet(SubResource rewriteRuleSet) { - this.rewriteRuleSet = rewriteRuleSet; - return this; - } - - /** - * Get the provisioningState property: Path rule of URL path map resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Set the provisioningState property: Path rule of URL path map resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * - * @param provisioningState the provisioningState value to set. - * @return the ApplicationGatewayPathRulePropertiesFormat object itself. - */ - public ApplicationGatewayPathRulePropertiesFormat withProvisioningState(String provisioningState) { - this.provisioningState = provisioningState; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayProbeInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayProbeInner.java deleted file mode 100644 index 70d71e566174..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayProbeInner.java +++ /dev/null @@ -1,373 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.ApplicationGatewayProbeHealthResponseMatch; -import com.azure.resourcemanager.network.models.ApplicationGatewayProtocol; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Probe of the application gateway. */ -@Fluent -public final class ApplicationGatewayProbeInner extends SubResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayProbeInner.class); - - /* - * Properties of probe of an application gateway. - */ - @JsonProperty(value = "properties") - private ApplicationGatewayProbePropertiesFormat innerProperties; - - /* - * Name of the probe that is unique within an Application Gateway. - */ - @JsonProperty(value = "name") - private String name; - - /* - * A unique read-only string that changes whenever the resource is updated. - */ - @JsonProperty(value = "etag") - private String etag; - - /* - * Type of the resource. - */ - @JsonProperty(value = "type") - private String type; - - /** - * Get the innerProperties property: Properties of probe of an application gateway. - * - * @return the innerProperties value. - */ - private ApplicationGatewayProbePropertiesFormat innerProperties() { - return this.innerProperties; - } - - /** - * Get the name property: Name of the probe that is unique within an Application Gateway. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Name of the probe that is unique within an Application Gateway. - * - * @param name the name value to set. - * @return the ApplicationGatewayProbeInner object itself. - */ - public ApplicationGatewayProbeInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @param etag the etag value to set. - * @return the ApplicationGatewayProbeInner object itself. - */ - public ApplicationGatewayProbeInner withEtag(String etag) { - this.etag = etag; - return this; - } - - /** - * Get the type property: Type of the resource. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Set the type property: Type of the resource. - * - * @param type the type value to set. - * @return the ApplicationGatewayProbeInner object itself. - */ - public ApplicationGatewayProbeInner withType(String type) { - this.type = type; - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicationGatewayProbeInner withId(String id) { - super.withId(id); - return this; - } - - /** - * Get the protocol property: The protocol used for the probe. Possible values are 'Http' and 'Https'. - * - * @return the protocol value. - */ - public ApplicationGatewayProtocol protocol() { - return this.innerProperties() == null ? null : this.innerProperties().protocol(); - } - - /** - * Set the protocol property: The protocol used for the probe. Possible values are 'Http' and 'Https'. - * - * @param protocol the protocol value to set. - * @return the ApplicationGatewayProbeInner object itself. - */ - public ApplicationGatewayProbeInner withProtocol(ApplicationGatewayProtocol protocol) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayProbePropertiesFormat(); - } - this.innerProperties().withProtocol(protocol); - return this; - } - - /** - * Get the host property: Host name to send the probe to. - * - * @return the host value. - */ - public String host() { - return this.innerProperties() == null ? null : this.innerProperties().host(); - } - - /** - * Set the host property: Host name to send the probe to. - * - * @param host the host value to set. - * @return the ApplicationGatewayProbeInner object itself. - */ - public ApplicationGatewayProbeInner withHost(String host) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayProbePropertiesFormat(); - } - this.innerProperties().withHost(host); - return this; - } - - /** - * Get the path property: Relative path of probe. Valid path starts from '/'. Probe is sent to - * <Protocol>://<host>:<port><path>. - * - * @return the path value. - */ - public String path() { - return this.innerProperties() == null ? null : this.innerProperties().path(); - } - - /** - * Set the path property: Relative path of probe. Valid path starts from '/'. Probe is sent to - * <Protocol>://<host>:<port><path>. - * - * @param path the path value to set. - * @return the ApplicationGatewayProbeInner object itself. - */ - public ApplicationGatewayProbeInner withPath(String path) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayProbePropertiesFormat(); - } - this.innerProperties().withPath(path); - return this; - } - - /** - * Get the interval property: The probing interval in seconds. This is the time interval between two consecutive - * probes. Acceptable values are from 1 second to 86400 seconds. - * - * @return the interval value. - */ - public Integer interval() { - return this.innerProperties() == null ? null : this.innerProperties().interval(); - } - - /** - * Set the interval property: The probing interval in seconds. This is the time interval between two consecutive - * probes. Acceptable values are from 1 second to 86400 seconds. - * - * @param interval the interval value to set. - * @return the ApplicationGatewayProbeInner object itself. - */ - public ApplicationGatewayProbeInner withInterval(Integer interval) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayProbePropertiesFormat(); - } - this.innerProperties().withInterval(interval); - return this; - } - - /** - * Get the timeout property: the probe timeout in seconds. Probe marked as failed if valid response is not received - * with this timeout period. Acceptable values are from 1 second to 86400 seconds. - * - * @return the timeout value. - */ - public Integer timeout() { - return this.innerProperties() == null ? null : this.innerProperties().timeout(); - } - - /** - * Set the timeout property: the probe timeout in seconds. Probe marked as failed if valid response is not received - * with this timeout period. Acceptable values are from 1 second to 86400 seconds. - * - * @param timeout the timeout value to set. - * @return the ApplicationGatewayProbeInner object itself. - */ - public ApplicationGatewayProbeInner withTimeout(Integer timeout) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayProbePropertiesFormat(); - } - this.innerProperties().withTimeout(timeout); - return this; - } - - /** - * Get the unhealthyThreshold property: The probe retry count. Backend server is marked down after consecutive probe - * failure count reaches UnhealthyThreshold. Acceptable values are from 1 second to 20. - * - * @return the unhealthyThreshold value. - */ - public Integer unhealthyThreshold() { - return this.innerProperties() == null ? null : this.innerProperties().unhealthyThreshold(); - } - - /** - * Set the unhealthyThreshold property: The probe retry count. Backend server is marked down after consecutive probe - * failure count reaches UnhealthyThreshold. Acceptable values are from 1 second to 20. - * - * @param unhealthyThreshold the unhealthyThreshold value to set. - * @return the ApplicationGatewayProbeInner object itself. - */ - public ApplicationGatewayProbeInner withUnhealthyThreshold(Integer unhealthyThreshold) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayProbePropertiesFormat(); - } - this.innerProperties().withUnhealthyThreshold(unhealthyThreshold); - return this; - } - - /** - * Get the pickHostnameFromBackendHttpSettings property: Whether the host header should be picked from the backend - * http settings. Default value is false. - * - * @return the pickHostnameFromBackendHttpSettings value. - */ - public Boolean pickHostnameFromBackendHttpSettings() { - return this.innerProperties() == null ? null : this.innerProperties().pickHostnameFromBackendHttpSettings(); - } - - /** - * Set the pickHostnameFromBackendHttpSettings property: Whether the host header should be picked from the backend - * http settings. Default value is false. - * - * @param pickHostnameFromBackendHttpSettings the pickHostnameFromBackendHttpSettings value to set. - * @return the ApplicationGatewayProbeInner object itself. - */ - public ApplicationGatewayProbeInner withPickHostnameFromBackendHttpSettings( - Boolean pickHostnameFromBackendHttpSettings) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayProbePropertiesFormat(); - } - this.innerProperties().withPickHostnameFromBackendHttpSettings(pickHostnameFromBackendHttpSettings); - return this; - } - - /** - * Get the minServers property: Minimum number of servers that are always marked healthy. Default value is 0. - * - * @return the minServers value. - */ - public Integer minServers() { - return this.innerProperties() == null ? null : this.innerProperties().minServers(); - } - - /** - * Set the minServers property: Minimum number of servers that are always marked healthy. Default value is 0. - * - * @param minServers the minServers value to set. - * @return the ApplicationGatewayProbeInner object itself. - */ - public ApplicationGatewayProbeInner withMinServers(Integer minServers) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayProbePropertiesFormat(); - } - this.innerProperties().withMinServers(minServers); - return this; - } - - /** - * Get the match property: Criterion for classifying a healthy probe response. - * - * @return the match value. - */ - public ApplicationGatewayProbeHealthResponseMatch match() { - return this.innerProperties() == null ? null : this.innerProperties().match(); - } - - /** - * Set the match property: Criterion for classifying a healthy probe response. - * - * @param match the match value to set. - * @return the ApplicationGatewayProbeInner object itself. - */ - public ApplicationGatewayProbeInner withMatch(ApplicationGatewayProbeHealthResponseMatch match) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayProbePropertiesFormat(); - } - this.innerProperties().withMatch(match); - return this; - } - - /** - * Get the provisioningState property: Provisioning state of the backend http settings resource. Possible values - * are: 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Set the provisioningState property: Provisioning state of the backend http settings resource. Possible values - * are: 'Updating', 'Deleting', and 'Failed'. - * - * @param provisioningState the provisioningState value to set. - * @return the ApplicationGatewayProbeInner object itself. - */ - public ApplicationGatewayProbeInner withProvisioningState(String provisioningState) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayProbePropertiesFormat(); - } - this.innerProperties().withProvisioningState(provisioningState); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayProbePropertiesFormat.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayProbePropertiesFormat.java deleted file mode 100644 index e8684a6856a1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayProbePropertiesFormat.java +++ /dev/null @@ -1,312 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.ApplicationGatewayProbeHealthResponseMatch; -import com.azure.resourcemanager.network.models.ApplicationGatewayProtocol; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Properties of probe of an application gateway. */ -@Fluent -public final class ApplicationGatewayProbePropertiesFormat { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayProbePropertiesFormat.class); - - /* - * The protocol used for the probe. Possible values are 'Http' and 'Https'. - */ - @JsonProperty(value = "protocol") - private ApplicationGatewayProtocol protocol; - - /* - * Host name to send the probe to. - */ - @JsonProperty(value = "host") - private String host; - - /* - * Relative path of probe. Valid path starts from '/'. Probe is sent to - * ://: - */ - @JsonProperty(value = "path") - private String path; - - /* - * The probing interval in seconds. This is the time interval between two - * consecutive probes. Acceptable values are from 1 second to 86400 - * seconds. - */ - @JsonProperty(value = "interval") - private Integer interval; - - /* - * the probe timeout in seconds. Probe marked as failed if valid response - * is not received with this timeout period. Acceptable values are from 1 - * second to 86400 seconds. - */ - @JsonProperty(value = "timeout") - private Integer timeout; - - /* - * The probe retry count. Backend server is marked down after consecutive - * probe failure count reaches UnhealthyThreshold. Acceptable values are - * from 1 second to 20. - */ - @JsonProperty(value = "unhealthyThreshold") - private Integer unhealthyThreshold; - - /* - * Whether the host header should be picked from the backend http settings. - * Default value is false. - */ - @JsonProperty(value = "pickHostNameFromBackendHttpSettings") - private Boolean pickHostnameFromBackendHttpSettings; - - /* - * Minimum number of servers that are always marked healthy. Default value - * is 0. - */ - @JsonProperty(value = "minServers") - private Integer minServers; - - /* - * Criterion for classifying a healthy probe response. - */ - @JsonProperty(value = "match") - private ApplicationGatewayProbeHealthResponseMatch match; - - /* - * Provisioning state of the backend http settings resource. Possible - * values are: 'Updating', 'Deleting', and 'Failed'. - */ - @JsonProperty(value = "provisioningState") - private String provisioningState; - - /** - * Get the protocol property: The protocol used for the probe. Possible values are 'Http' and 'Https'. - * - * @return the protocol value. - */ - public ApplicationGatewayProtocol protocol() { - return this.protocol; - } - - /** - * Set the protocol property: The protocol used for the probe. Possible values are 'Http' and 'Https'. - * - * @param protocol the protocol value to set. - * @return the ApplicationGatewayProbePropertiesFormat object itself. - */ - public ApplicationGatewayProbePropertiesFormat withProtocol(ApplicationGatewayProtocol protocol) { - this.protocol = protocol; - return this; - } - - /** - * Get the host property: Host name to send the probe to. - * - * @return the host value. - */ - public String host() { - return this.host; - } - - /** - * Set the host property: Host name to send the probe to. - * - * @param host the host value to set. - * @return the ApplicationGatewayProbePropertiesFormat object itself. - */ - public ApplicationGatewayProbePropertiesFormat withHost(String host) { - this.host = host; - return this; - } - - /** - * Get the path property: Relative path of probe. Valid path starts from '/'. Probe is sent to - * <Protocol>://<host>:<port><path>. - * - * @return the path value. - */ - public String path() { - return this.path; - } - - /** - * Set the path property: Relative path of probe. Valid path starts from '/'. Probe is sent to - * <Protocol>://<host>:<port><path>. - * - * @param path the path value to set. - * @return the ApplicationGatewayProbePropertiesFormat object itself. - */ - public ApplicationGatewayProbePropertiesFormat withPath(String path) { - this.path = path; - return this; - } - - /** - * Get the interval property: The probing interval in seconds. This is the time interval between two consecutive - * probes. Acceptable values are from 1 second to 86400 seconds. - * - * @return the interval value. - */ - public Integer interval() { - return this.interval; - } - - /** - * Set the interval property: The probing interval in seconds. This is the time interval between two consecutive - * probes. Acceptable values are from 1 second to 86400 seconds. - * - * @param interval the interval value to set. - * @return the ApplicationGatewayProbePropertiesFormat object itself. - */ - public ApplicationGatewayProbePropertiesFormat withInterval(Integer interval) { - this.interval = interval; - return this; - } - - /** - * Get the timeout property: the probe timeout in seconds. Probe marked as failed if valid response is not received - * with this timeout period. Acceptable values are from 1 second to 86400 seconds. - * - * @return the timeout value. - */ - public Integer timeout() { - return this.timeout; - } - - /** - * Set the timeout property: the probe timeout in seconds. Probe marked as failed if valid response is not received - * with this timeout period. Acceptable values are from 1 second to 86400 seconds. - * - * @param timeout the timeout value to set. - * @return the ApplicationGatewayProbePropertiesFormat object itself. - */ - public ApplicationGatewayProbePropertiesFormat withTimeout(Integer timeout) { - this.timeout = timeout; - return this; - } - - /** - * Get the unhealthyThreshold property: The probe retry count. Backend server is marked down after consecutive probe - * failure count reaches UnhealthyThreshold. Acceptable values are from 1 second to 20. - * - * @return the unhealthyThreshold value. - */ - public Integer unhealthyThreshold() { - return this.unhealthyThreshold; - } - - /** - * Set the unhealthyThreshold property: The probe retry count. Backend server is marked down after consecutive probe - * failure count reaches UnhealthyThreshold. Acceptable values are from 1 second to 20. - * - * @param unhealthyThreshold the unhealthyThreshold value to set. - * @return the ApplicationGatewayProbePropertiesFormat object itself. - */ - public ApplicationGatewayProbePropertiesFormat withUnhealthyThreshold(Integer unhealthyThreshold) { - this.unhealthyThreshold = unhealthyThreshold; - return this; - } - - /** - * Get the pickHostnameFromBackendHttpSettings property: Whether the host header should be picked from the backend - * http settings. Default value is false. - * - * @return the pickHostnameFromBackendHttpSettings value. - */ - public Boolean pickHostnameFromBackendHttpSettings() { - return this.pickHostnameFromBackendHttpSettings; - } - - /** - * Set the pickHostnameFromBackendHttpSettings property: Whether the host header should be picked from the backend - * http settings. Default value is false. - * - * @param pickHostnameFromBackendHttpSettings the pickHostnameFromBackendHttpSettings value to set. - * @return the ApplicationGatewayProbePropertiesFormat object itself. - */ - public ApplicationGatewayProbePropertiesFormat withPickHostnameFromBackendHttpSettings( - Boolean pickHostnameFromBackendHttpSettings) { - this.pickHostnameFromBackendHttpSettings = pickHostnameFromBackendHttpSettings; - return this; - } - - /** - * Get the minServers property: Minimum number of servers that are always marked healthy. Default value is 0. - * - * @return the minServers value. - */ - public Integer minServers() { - return this.minServers; - } - - /** - * Set the minServers property: Minimum number of servers that are always marked healthy. Default value is 0. - * - * @param minServers the minServers value to set. - * @return the ApplicationGatewayProbePropertiesFormat object itself. - */ - public ApplicationGatewayProbePropertiesFormat withMinServers(Integer minServers) { - this.minServers = minServers; - return this; - } - - /** - * Get the match property: Criterion for classifying a healthy probe response. - * - * @return the match value. - */ - public ApplicationGatewayProbeHealthResponseMatch match() { - return this.match; - } - - /** - * Set the match property: Criterion for classifying a healthy probe response. - * - * @param match the match value to set. - * @return the ApplicationGatewayProbePropertiesFormat object itself. - */ - public ApplicationGatewayProbePropertiesFormat withMatch(ApplicationGatewayProbeHealthResponseMatch match) { - this.match = match; - return this; - } - - /** - * Get the provisioningState property: Provisioning state of the backend http settings resource. Possible values - * are: 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Set the provisioningState property: Provisioning state of the backend http settings resource. Possible values - * are: 'Updating', 'Deleting', and 'Failed'. - * - * @param provisioningState the provisioningState value to set. - * @return the ApplicationGatewayProbePropertiesFormat object itself. - */ - public ApplicationGatewayProbePropertiesFormat withProvisioningState(String provisioningState) { - this.provisioningState = provisioningState; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (match() != null) { - match().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayPropertiesFormat.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayPropertiesFormat.java deleted file mode 100644 index ad441868de42..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayPropertiesFormat.java +++ /dev/null @@ -1,724 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.ApplicationGatewayAutoscaleConfiguration; -import com.azure.resourcemanager.network.models.ApplicationGatewayBackendAddressPool; -import com.azure.resourcemanager.network.models.ApplicationGatewayBackendHttpSettings; -import com.azure.resourcemanager.network.models.ApplicationGatewayCustomError; -import com.azure.resourcemanager.network.models.ApplicationGatewayFrontendIpConfiguration; -import com.azure.resourcemanager.network.models.ApplicationGatewayFrontendPort; -import com.azure.resourcemanager.network.models.ApplicationGatewayHttpListener; -import com.azure.resourcemanager.network.models.ApplicationGatewayOperationalState; -import com.azure.resourcemanager.network.models.ApplicationGatewayRewriteRuleSet; -import com.azure.resourcemanager.network.models.ApplicationGatewaySku; -import com.azure.resourcemanager.network.models.ApplicationGatewaySslPolicy; -import com.azure.resourcemanager.network.models.ApplicationGatewayTrustedRootCertificate; -import com.azure.resourcemanager.network.models.ApplicationGatewayWebApplicationFirewallConfiguration; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Properties of the application gateway. */ -@Fluent -public final class ApplicationGatewayPropertiesFormat { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayPropertiesFormat.class); - - /* - * SKU of the application gateway resource. - */ - @JsonProperty(value = "sku") - private ApplicationGatewaySku sku; - - /* - * SSL policy of the application gateway resource. - */ - @JsonProperty(value = "sslPolicy") - private ApplicationGatewaySslPolicy sslPolicy; - - /* - * Operational state of the application gateway resource. - */ - @JsonProperty(value = "operationalState", access = JsonProperty.Access.WRITE_ONLY) - private ApplicationGatewayOperationalState operationalState; - - /* - * Subnets of application the gateway resource. - */ - @JsonProperty(value = "gatewayIPConfigurations") - private List gatewayIpConfigurations; - - /* - * Authentication certificates of the application gateway resource. - */ - @JsonProperty(value = "authenticationCertificates") - private List authenticationCertificates; - - /* - * Trusted Root certificates of the application gateway resource. - */ - @JsonProperty(value = "trustedRootCertificates") - private List trustedRootCertificates; - - /* - * SSL certificates of the application gateway resource. - */ - @JsonProperty(value = "sslCertificates") - private List sslCertificates; - - /* - * Frontend IP addresses of the application gateway resource. - */ - @JsonProperty(value = "frontendIPConfigurations") - private List frontendIpConfigurations; - - /* - * Frontend ports of the application gateway resource. - */ - @JsonProperty(value = "frontendPorts") - private List frontendPorts; - - /* - * Probes of the application gateway resource. - */ - @JsonProperty(value = "probes") - private List probes; - - /* - * Backend address pool of the application gateway resource. - */ - @JsonProperty(value = "backendAddressPools") - private List backendAddressPools; - - /* - * Backend http settings of the application gateway resource. - */ - @JsonProperty(value = "backendHttpSettingsCollection") - private List backendHttpSettingsCollection; - - /* - * Http listeners of the application gateway resource. - */ - @JsonProperty(value = "httpListeners") - private List httpListeners; - - /* - * URL path map of the application gateway resource. - */ - @JsonProperty(value = "urlPathMaps") - private List urlPathMaps; - - /* - * Request routing rules of the application gateway resource. - */ - @JsonProperty(value = "requestRoutingRules") - private List requestRoutingRules; - - /* - * Rewrite rules for the application gateway resource. - */ - @JsonProperty(value = "rewriteRuleSets") - private List rewriteRuleSets; - - /* - * Redirect configurations of the application gateway resource. - */ - @JsonProperty(value = "redirectConfigurations") - private List redirectConfigurations; - - /* - * Web application firewall configuration. - */ - @JsonProperty(value = "webApplicationFirewallConfiguration") - private ApplicationGatewayWebApplicationFirewallConfiguration webApplicationFirewallConfiguration; - - /* - * Whether HTTP2 is enabled on the application gateway resource. - */ - @JsonProperty(value = "enableHttp2") - private Boolean enableHttp2; - - /* - * Whether FIPS is enabled on the application gateway resource. - */ - @JsonProperty(value = "enableFips") - private Boolean enableFips; - - /* - * Autoscale Configuration. - */ - @JsonProperty(value = "autoscaleConfiguration") - private ApplicationGatewayAutoscaleConfiguration autoscaleConfiguration; - - /* - * Resource GUID property of the application gateway resource. - */ - @JsonProperty(value = "resourceGuid") - private String resourceGuid; - - /* - * Provisioning state of the application gateway resource. Possible values - * are: 'Updating', 'Deleting', and 'Failed'. - */ - @JsonProperty(value = "provisioningState") - private String provisioningState; - - /* - * Custom error configurations of the application gateway resource. - */ - @JsonProperty(value = "customErrorConfigurations") - private List customErrorConfigurations; - - /** - * Get the sku property: SKU of the application gateway resource. - * - * @return the sku value. - */ - public ApplicationGatewaySku sku() { - return this.sku; - } - - /** - * Set the sku property: SKU of the application gateway resource. - * - * @param sku the sku value to set. - * @return the ApplicationGatewayPropertiesFormat object itself. - */ - public ApplicationGatewayPropertiesFormat withSku(ApplicationGatewaySku sku) { - this.sku = sku; - return this; - } - - /** - * Get the sslPolicy property: SSL policy of the application gateway resource. - * - * @return the sslPolicy value. - */ - public ApplicationGatewaySslPolicy sslPolicy() { - return this.sslPolicy; - } - - /** - * Set the sslPolicy property: SSL policy of the application gateway resource. - * - * @param sslPolicy the sslPolicy value to set. - * @return the ApplicationGatewayPropertiesFormat object itself. - */ - public ApplicationGatewayPropertiesFormat withSslPolicy(ApplicationGatewaySslPolicy sslPolicy) { - this.sslPolicy = sslPolicy; - return this; - } - - /** - * Get the operationalState property: Operational state of the application gateway resource. - * - * @return the operationalState value. - */ - public ApplicationGatewayOperationalState operationalState() { - return this.operationalState; - } - - /** - * Get the gatewayIpConfigurations property: Subnets of application the gateway resource. - * - * @return the gatewayIpConfigurations value. - */ - public List gatewayIpConfigurations() { - return this.gatewayIpConfigurations; - } - - /** - * Set the gatewayIpConfigurations property: Subnets of application the gateway resource. - * - * @param gatewayIpConfigurations the gatewayIpConfigurations value to set. - * @return the ApplicationGatewayPropertiesFormat object itself. - */ - public ApplicationGatewayPropertiesFormat withGatewayIpConfigurations( - List gatewayIpConfigurations) { - this.gatewayIpConfigurations = gatewayIpConfigurations; - return this; - } - - /** - * Get the authenticationCertificates property: Authentication certificates of the application gateway resource. - * - * @return the authenticationCertificates value. - */ - public List authenticationCertificates() { - return this.authenticationCertificates; - } - - /** - * Set the authenticationCertificates property: Authentication certificates of the application gateway resource. - * - * @param authenticationCertificates the authenticationCertificates value to set. - * @return the ApplicationGatewayPropertiesFormat object itself. - */ - public ApplicationGatewayPropertiesFormat withAuthenticationCertificates( - List authenticationCertificates) { - this.authenticationCertificates = authenticationCertificates; - return this; - } - - /** - * Get the trustedRootCertificates property: Trusted Root certificates of the application gateway resource. - * - * @return the trustedRootCertificates value. - */ - public List trustedRootCertificates() { - return this.trustedRootCertificates; - } - - /** - * Set the trustedRootCertificates property: Trusted Root certificates of the application gateway resource. - * - * @param trustedRootCertificates the trustedRootCertificates value to set. - * @return the ApplicationGatewayPropertiesFormat object itself. - */ - public ApplicationGatewayPropertiesFormat withTrustedRootCertificates( - List trustedRootCertificates) { - this.trustedRootCertificates = trustedRootCertificates; - return this; - } - - /** - * Get the sslCertificates property: SSL certificates of the application gateway resource. - * - * @return the sslCertificates value. - */ - public List sslCertificates() { - return this.sslCertificates; - } - - /** - * Set the sslCertificates property: SSL certificates of the application gateway resource. - * - * @param sslCertificates the sslCertificates value to set. - * @return the ApplicationGatewayPropertiesFormat object itself. - */ - public ApplicationGatewayPropertiesFormat withSslCertificates( - List sslCertificates) { - this.sslCertificates = sslCertificates; - return this; - } - - /** - * Get the frontendIpConfigurations property: Frontend IP addresses of the application gateway resource. - * - * @return the frontendIpConfigurations value. - */ - public List frontendIpConfigurations() { - return this.frontendIpConfigurations; - } - - /** - * Set the frontendIpConfigurations property: Frontend IP addresses of the application gateway resource. - * - * @param frontendIpConfigurations the frontendIpConfigurations value to set. - * @return the ApplicationGatewayPropertiesFormat object itself. - */ - public ApplicationGatewayPropertiesFormat withFrontendIpConfigurations( - List frontendIpConfigurations) { - this.frontendIpConfigurations = frontendIpConfigurations; - return this; - } - - /** - * Get the frontendPorts property: Frontend ports of the application gateway resource. - * - * @return the frontendPorts value. - */ - public List frontendPorts() { - return this.frontendPorts; - } - - /** - * Set the frontendPorts property: Frontend ports of the application gateway resource. - * - * @param frontendPorts the frontendPorts value to set. - * @return the ApplicationGatewayPropertiesFormat object itself. - */ - public ApplicationGatewayPropertiesFormat withFrontendPorts(List frontendPorts) { - this.frontendPorts = frontendPorts; - return this; - } - - /** - * Get the probes property: Probes of the application gateway resource. - * - * @return the probes value. - */ - public List probes() { - return this.probes; - } - - /** - * Set the probes property: Probes of the application gateway resource. - * - * @param probes the probes value to set. - * @return the ApplicationGatewayPropertiesFormat object itself. - */ - public ApplicationGatewayPropertiesFormat withProbes(List probes) { - this.probes = probes; - return this; - } - - /** - * Get the backendAddressPools property: Backend address pool of the application gateway resource. - * - * @return the backendAddressPools value. - */ - public List backendAddressPools() { - return this.backendAddressPools; - } - - /** - * Set the backendAddressPools property: Backend address pool of the application gateway resource. - * - * @param backendAddressPools the backendAddressPools value to set. - * @return the ApplicationGatewayPropertiesFormat object itself. - */ - public ApplicationGatewayPropertiesFormat withBackendAddressPools( - List backendAddressPools) { - this.backendAddressPools = backendAddressPools; - return this; - } - - /** - * Get the backendHttpSettingsCollection property: Backend http settings of the application gateway resource. - * - * @return the backendHttpSettingsCollection value. - */ - public List backendHttpSettingsCollection() { - return this.backendHttpSettingsCollection; - } - - /** - * Set the backendHttpSettingsCollection property: Backend http settings of the application gateway resource. - * - * @param backendHttpSettingsCollection the backendHttpSettingsCollection value to set. - * @return the ApplicationGatewayPropertiesFormat object itself. - */ - public ApplicationGatewayPropertiesFormat withBackendHttpSettingsCollection( - List backendHttpSettingsCollection) { - this.backendHttpSettingsCollection = backendHttpSettingsCollection; - return this; - } - - /** - * Get the httpListeners property: Http listeners of the application gateway resource. - * - * @return the httpListeners value. - */ - public List httpListeners() { - return this.httpListeners; - } - - /** - * Set the httpListeners property: Http listeners of the application gateway resource. - * - * @param httpListeners the httpListeners value to set. - * @return the ApplicationGatewayPropertiesFormat object itself. - */ - public ApplicationGatewayPropertiesFormat withHttpListeners(List httpListeners) { - this.httpListeners = httpListeners; - return this; - } - - /** - * Get the urlPathMaps property: URL path map of the application gateway resource. - * - * @return the urlPathMaps value. - */ - public List urlPathMaps() { - return this.urlPathMaps; - } - - /** - * Set the urlPathMaps property: URL path map of the application gateway resource. - * - * @param urlPathMaps the urlPathMaps value to set. - * @return the ApplicationGatewayPropertiesFormat object itself. - */ - public ApplicationGatewayPropertiesFormat withUrlPathMaps(List urlPathMaps) { - this.urlPathMaps = urlPathMaps; - return this; - } - - /** - * Get the requestRoutingRules property: Request routing rules of the application gateway resource. - * - * @return the requestRoutingRules value. - */ - public List requestRoutingRules() { - return this.requestRoutingRules; - } - - /** - * Set the requestRoutingRules property: Request routing rules of the application gateway resource. - * - * @param requestRoutingRules the requestRoutingRules value to set. - * @return the ApplicationGatewayPropertiesFormat object itself. - */ - public ApplicationGatewayPropertiesFormat withRequestRoutingRules( - List requestRoutingRules) { - this.requestRoutingRules = requestRoutingRules; - return this; - } - - /** - * Get the rewriteRuleSets property: Rewrite rules for the application gateway resource. - * - * @return the rewriteRuleSets value. - */ - public List rewriteRuleSets() { - return this.rewriteRuleSets; - } - - /** - * Set the rewriteRuleSets property: Rewrite rules for the application gateway resource. - * - * @param rewriteRuleSets the rewriteRuleSets value to set. - * @return the ApplicationGatewayPropertiesFormat object itself. - */ - public ApplicationGatewayPropertiesFormat withRewriteRuleSets( - List rewriteRuleSets) { - this.rewriteRuleSets = rewriteRuleSets; - return this; - } - - /** - * Get the redirectConfigurations property: Redirect configurations of the application gateway resource. - * - * @return the redirectConfigurations value. - */ - public List redirectConfigurations() { - return this.redirectConfigurations; - } - - /** - * Set the redirectConfigurations property: Redirect configurations of the application gateway resource. - * - * @param redirectConfigurations the redirectConfigurations value to set. - * @return the ApplicationGatewayPropertiesFormat object itself. - */ - public ApplicationGatewayPropertiesFormat withRedirectConfigurations( - List redirectConfigurations) { - this.redirectConfigurations = redirectConfigurations; - return this; - } - - /** - * Get the webApplicationFirewallConfiguration property: Web application firewall configuration. - * - * @return the webApplicationFirewallConfiguration value. - */ - public ApplicationGatewayWebApplicationFirewallConfiguration webApplicationFirewallConfiguration() { - return this.webApplicationFirewallConfiguration; - } - - /** - * Set the webApplicationFirewallConfiguration property: Web application firewall configuration. - * - * @param webApplicationFirewallConfiguration the webApplicationFirewallConfiguration value to set. - * @return the ApplicationGatewayPropertiesFormat object itself. - */ - public ApplicationGatewayPropertiesFormat withWebApplicationFirewallConfiguration( - ApplicationGatewayWebApplicationFirewallConfiguration webApplicationFirewallConfiguration) { - this.webApplicationFirewallConfiguration = webApplicationFirewallConfiguration; - return this; - } - - /** - * Get the enableHttp2 property: Whether HTTP2 is enabled on the application gateway resource. - * - * @return the enableHttp2 value. - */ - public Boolean enableHttp2() { - return this.enableHttp2; - } - - /** - * Set the enableHttp2 property: Whether HTTP2 is enabled on the application gateway resource. - * - * @param enableHttp2 the enableHttp2 value to set. - * @return the ApplicationGatewayPropertiesFormat object itself. - */ - public ApplicationGatewayPropertiesFormat withEnableHttp2(Boolean enableHttp2) { - this.enableHttp2 = enableHttp2; - return this; - } - - /** - * Get the enableFips property: Whether FIPS is enabled on the application gateway resource. - * - * @return the enableFips value. - */ - public Boolean enableFips() { - return this.enableFips; - } - - /** - * Set the enableFips property: Whether FIPS is enabled on the application gateway resource. - * - * @param enableFips the enableFips value to set. - * @return the ApplicationGatewayPropertiesFormat object itself. - */ - public ApplicationGatewayPropertiesFormat withEnableFips(Boolean enableFips) { - this.enableFips = enableFips; - return this; - } - - /** - * Get the autoscaleConfiguration property: Autoscale Configuration. - * - * @return the autoscaleConfiguration value. - */ - public ApplicationGatewayAutoscaleConfiguration autoscaleConfiguration() { - return this.autoscaleConfiguration; - } - - /** - * Set the autoscaleConfiguration property: Autoscale Configuration. - * - * @param autoscaleConfiguration the autoscaleConfiguration value to set. - * @return the ApplicationGatewayPropertiesFormat object itself. - */ - public ApplicationGatewayPropertiesFormat withAutoscaleConfiguration( - ApplicationGatewayAutoscaleConfiguration autoscaleConfiguration) { - this.autoscaleConfiguration = autoscaleConfiguration; - return this; - } - - /** - * Get the resourceGuid property: Resource GUID property of the application gateway resource. - * - * @return the resourceGuid value. - */ - public String resourceGuid() { - return this.resourceGuid; - } - - /** - * Set the resourceGuid property: Resource GUID property of the application gateway resource. - * - * @param resourceGuid the resourceGuid value to set. - * @return the ApplicationGatewayPropertiesFormat object itself. - */ - public ApplicationGatewayPropertiesFormat withResourceGuid(String resourceGuid) { - this.resourceGuid = resourceGuid; - return this; - } - - /** - * Get the provisioningState property: Provisioning state of the application gateway resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Set the provisioningState property: Provisioning state of the application gateway resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param provisioningState the provisioningState value to set. - * @return the ApplicationGatewayPropertiesFormat object itself. - */ - public ApplicationGatewayPropertiesFormat withProvisioningState(String provisioningState) { - this.provisioningState = provisioningState; - return this; - } - - /** - * Get the customErrorConfigurations property: Custom error configurations of the application gateway resource. - * - * @return the customErrorConfigurations value. - */ - public List customErrorConfigurations() { - return this.customErrorConfigurations; - } - - /** - * Set the customErrorConfigurations property: Custom error configurations of the application gateway resource. - * - * @param customErrorConfigurations the customErrorConfigurations value to set. - * @return the ApplicationGatewayPropertiesFormat object itself. - */ - public ApplicationGatewayPropertiesFormat withCustomErrorConfigurations( - List customErrorConfigurations) { - this.customErrorConfigurations = customErrorConfigurations; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (sku() != null) { - sku().validate(); - } - if (sslPolicy() != null) { - sslPolicy().validate(); - } - if (gatewayIpConfigurations() != null) { - gatewayIpConfigurations().forEach(e -> e.validate()); - } - if (authenticationCertificates() != null) { - authenticationCertificates().forEach(e -> e.validate()); - } - if (trustedRootCertificates() != null) { - trustedRootCertificates().forEach(e -> e.validate()); - } - if (sslCertificates() != null) { - sslCertificates().forEach(e -> e.validate()); - } - if (frontendIpConfigurations() != null) { - frontendIpConfigurations().forEach(e -> e.validate()); - } - if (frontendPorts() != null) { - frontendPorts().forEach(e -> e.validate()); - } - if (probes() != null) { - probes().forEach(e -> e.validate()); - } - if (backendAddressPools() != null) { - backendAddressPools().forEach(e -> e.validate()); - } - if (backendHttpSettingsCollection() != null) { - backendHttpSettingsCollection().forEach(e -> e.validate()); - } - if (httpListeners() != null) { - httpListeners().forEach(e -> e.validate()); - } - if (urlPathMaps() != null) { - urlPathMaps().forEach(e -> e.validate()); - } - if (requestRoutingRules() != null) { - requestRoutingRules().forEach(e -> e.validate()); - } - if (rewriteRuleSets() != null) { - rewriteRuleSets().forEach(e -> e.validate()); - } - if (redirectConfigurations() != null) { - redirectConfigurations().forEach(e -> e.validate()); - } - if (webApplicationFirewallConfiguration() != null) { - webApplicationFirewallConfiguration().validate(); - } - if (autoscaleConfiguration() != null) { - autoscaleConfiguration().validate(); - } - if (customErrorConfigurations() != null) { - customErrorConfigurations().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayRedirectConfigurationInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayRedirectConfigurationInner.java deleted file mode 100644 index db5c2a709880..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayRedirectConfigurationInner.java +++ /dev/null @@ -1,316 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.ApplicationGatewayRedirectType; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Redirect configuration of an application gateway. */ -@Fluent -public final class ApplicationGatewayRedirectConfigurationInner extends SubResource { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(ApplicationGatewayRedirectConfigurationInner.class); - - /* - * Properties of redirect configuration of the application gateway. - */ - @JsonProperty(value = "properties") - private ApplicationGatewayRedirectConfigurationPropertiesFormat innerProperties; - - /* - * Name of the redirect configuration that is unique within an Application - * Gateway. - */ - @JsonProperty(value = "name") - private String name; - - /* - * A unique read-only string that changes whenever the resource is updated. - */ - @JsonProperty(value = "etag") - private String etag; - - /* - * Type of the resource. - */ - @JsonProperty(value = "type") - private String type; - - /** - * Get the innerProperties property: Properties of redirect configuration of the application gateway. - * - * @return the innerProperties value. - */ - private ApplicationGatewayRedirectConfigurationPropertiesFormat innerProperties() { - return this.innerProperties; - } - - /** - * Get the name property: Name of the redirect configuration that is unique within an Application Gateway. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Name of the redirect configuration that is unique within an Application Gateway. - * - * @param name the name value to set. - * @return the ApplicationGatewayRedirectConfigurationInner object itself. - */ - public ApplicationGatewayRedirectConfigurationInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @param etag the etag value to set. - * @return the ApplicationGatewayRedirectConfigurationInner object itself. - */ - public ApplicationGatewayRedirectConfigurationInner withEtag(String etag) { - this.etag = etag; - return this; - } - - /** - * Get the type property: Type of the resource. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Set the type property: Type of the resource. - * - * @param type the type value to set. - * @return the ApplicationGatewayRedirectConfigurationInner object itself. - */ - public ApplicationGatewayRedirectConfigurationInner withType(String type) { - this.type = type; - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicationGatewayRedirectConfigurationInner withId(String id) { - super.withId(id); - return this; - } - - /** - * Get the redirectType property: Supported http redirection types - Permanent, Temporary, Found, SeeOther. - * - * @return the redirectType value. - */ - public ApplicationGatewayRedirectType redirectType() { - return this.innerProperties() == null ? null : this.innerProperties().redirectType(); - } - - /** - * Set the redirectType property: Supported http redirection types - Permanent, Temporary, Found, SeeOther. - * - * @param redirectType the redirectType value to set. - * @return the ApplicationGatewayRedirectConfigurationInner object itself. - */ - public ApplicationGatewayRedirectConfigurationInner withRedirectType(ApplicationGatewayRedirectType redirectType) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayRedirectConfigurationPropertiesFormat(); - } - this.innerProperties().withRedirectType(redirectType); - return this; - } - - /** - * Get the targetListener property: Reference to a listener to redirect the request to. - * - * @return the targetListener value. - */ - public SubResource targetListener() { - return this.innerProperties() == null ? null : this.innerProperties().targetListener(); - } - - /** - * Set the targetListener property: Reference to a listener to redirect the request to. - * - * @param targetListener the targetListener value to set. - * @return the ApplicationGatewayRedirectConfigurationInner object itself. - */ - public ApplicationGatewayRedirectConfigurationInner withTargetListener(SubResource targetListener) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayRedirectConfigurationPropertiesFormat(); - } - this.innerProperties().withTargetListener(targetListener); - return this; - } - - /** - * Get the targetUrl property: Url to redirect the request to. - * - * @return the targetUrl value. - */ - public String targetUrl() { - return this.innerProperties() == null ? null : this.innerProperties().targetUrl(); - } - - /** - * Set the targetUrl property: Url to redirect the request to. - * - * @param targetUrl the targetUrl value to set. - * @return the ApplicationGatewayRedirectConfigurationInner object itself. - */ - public ApplicationGatewayRedirectConfigurationInner withTargetUrl(String targetUrl) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayRedirectConfigurationPropertiesFormat(); - } - this.innerProperties().withTargetUrl(targetUrl); - return this; - } - - /** - * Get the includePath property: Include path in the redirected url. - * - * @return the includePath value. - */ - public Boolean includePath() { - return this.innerProperties() == null ? null : this.innerProperties().includePath(); - } - - /** - * Set the includePath property: Include path in the redirected url. - * - * @param includePath the includePath value to set. - * @return the ApplicationGatewayRedirectConfigurationInner object itself. - */ - public ApplicationGatewayRedirectConfigurationInner withIncludePath(Boolean includePath) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayRedirectConfigurationPropertiesFormat(); - } - this.innerProperties().withIncludePath(includePath); - return this; - } - - /** - * Get the includeQueryString property: Include query string in the redirected url. - * - * @return the includeQueryString value. - */ - public Boolean includeQueryString() { - return this.innerProperties() == null ? null : this.innerProperties().includeQueryString(); - } - - /** - * Set the includeQueryString property: Include query string in the redirected url. - * - * @param includeQueryString the includeQueryString value to set. - * @return the ApplicationGatewayRedirectConfigurationInner object itself. - */ - public ApplicationGatewayRedirectConfigurationInner withIncludeQueryString(Boolean includeQueryString) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayRedirectConfigurationPropertiesFormat(); - } - this.innerProperties().withIncludeQueryString(includeQueryString); - return this; - } - - /** - * Get the requestRoutingRules property: Request routing specifying redirect configuration. - * - * @return the requestRoutingRules value. - */ - public List requestRoutingRules() { - return this.innerProperties() == null ? null : this.innerProperties().requestRoutingRules(); - } - - /** - * Set the requestRoutingRules property: Request routing specifying redirect configuration. - * - * @param requestRoutingRules the requestRoutingRules value to set. - * @return the ApplicationGatewayRedirectConfigurationInner object itself. - */ - public ApplicationGatewayRedirectConfigurationInner withRequestRoutingRules(List requestRoutingRules) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayRedirectConfigurationPropertiesFormat(); - } - this.innerProperties().withRequestRoutingRules(requestRoutingRules); - return this; - } - - /** - * Get the urlPathMaps property: Url path maps specifying default redirect configuration. - * - * @return the urlPathMaps value. - */ - public List urlPathMaps() { - return this.innerProperties() == null ? null : this.innerProperties().urlPathMaps(); - } - - /** - * Set the urlPathMaps property: Url path maps specifying default redirect configuration. - * - * @param urlPathMaps the urlPathMaps value to set. - * @return the ApplicationGatewayRedirectConfigurationInner object itself. - */ - public ApplicationGatewayRedirectConfigurationInner withUrlPathMaps(List urlPathMaps) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayRedirectConfigurationPropertiesFormat(); - } - this.innerProperties().withUrlPathMaps(urlPathMaps); - return this; - } - - /** - * Get the pathRules property: Path rules specifying redirect configuration. - * - * @return the pathRules value. - */ - public List pathRules() { - return this.innerProperties() == null ? null : this.innerProperties().pathRules(); - } - - /** - * Set the pathRules property: Path rules specifying redirect configuration. - * - * @param pathRules the pathRules value to set. - * @return the ApplicationGatewayRedirectConfigurationInner object itself. - */ - public ApplicationGatewayRedirectConfigurationInner withPathRules(List pathRules) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayRedirectConfigurationPropertiesFormat(); - } - this.innerProperties().withPathRules(pathRules); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayRedirectConfigurationPropertiesFormat.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayRedirectConfigurationPropertiesFormat.java deleted file mode 100644 index f0b2bd40f8a3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayRedirectConfigurationPropertiesFormat.java +++ /dev/null @@ -1,239 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.ApplicationGatewayRedirectType; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Properties of redirect configuration of the application gateway. */ -@Fluent -public final class ApplicationGatewayRedirectConfigurationPropertiesFormat { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(ApplicationGatewayRedirectConfigurationPropertiesFormat.class); - - /* - * Supported http redirection types - Permanent, Temporary, Found, - * SeeOther. - */ - @JsonProperty(value = "redirectType") - private ApplicationGatewayRedirectType redirectType; - - /* - * Reference to a listener to redirect the request to. - */ - @JsonProperty(value = "targetListener") - private SubResource targetListener; - - /* - * Url to redirect the request to. - */ - @JsonProperty(value = "targetUrl") - private String targetUrl; - - /* - * Include path in the redirected url. - */ - @JsonProperty(value = "includePath") - private Boolean includePath; - - /* - * Include query string in the redirected url. - */ - @JsonProperty(value = "includeQueryString") - private Boolean includeQueryString; - - /* - * Request routing specifying redirect configuration. - */ - @JsonProperty(value = "requestRoutingRules") - private List requestRoutingRules; - - /* - * Url path maps specifying default redirect configuration. - */ - @JsonProperty(value = "urlPathMaps") - private List urlPathMaps; - - /* - * Path rules specifying redirect configuration. - */ - @JsonProperty(value = "pathRules") - private List pathRules; - - /** - * Get the redirectType property: Supported http redirection types - Permanent, Temporary, Found, SeeOther. - * - * @return the redirectType value. - */ - public ApplicationGatewayRedirectType redirectType() { - return this.redirectType; - } - - /** - * Set the redirectType property: Supported http redirection types - Permanent, Temporary, Found, SeeOther. - * - * @param redirectType the redirectType value to set. - * @return the ApplicationGatewayRedirectConfigurationPropertiesFormat object itself. - */ - public ApplicationGatewayRedirectConfigurationPropertiesFormat withRedirectType( - ApplicationGatewayRedirectType redirectType) { - this.redirectType = redirectType; - return this; - } - - /** - * Get the targetListener property: Reference to a listener to redirect the request to. - * - * @return the targetListener value. - */ - public SubResource targetListener() { - return this.targetListener; - } - - /** - * Set the targetListener property: Reference to a listener to redirect the request to. - * - * @param targetListener the targetListener value to set. - * @return the ApplicationGatewayRedirectConfigurationPropertiesFormat object itself. - */ - public ApplicationGatewayRedirectConfigurationPropertiesFormat withTargetListener(SubResource targetListener) { - this.targetListener = targetListener; - return this; - } - - /** - * Get the targetUrl property: Url to redirect the request to. - * - * @return the targetUrl value. - */ - public String targetUrl() { - return this.targetUrl; - } - - /** - * Set the targetUrl property: Url to redirect the request to. - * - * @param targetUrl the targetUrl value to set. - * @return the ApplicationGatewayRedirectConfigurationPropertiesFormat object itself. - */ - public ApplicationGatewayRedirectConfigurationPropertiesFormat withTargetUrl(String targetUrl) { - this.targetUrl = targetUrl; - return this; - } - - /** - * Get the includePath property: Include path in the redirected url. - * - * @return the includePath value. - */ - public Boolean includePath() { - return this.includePath; - } - - /** - * Set the includePath property: Include path in the redirected url. - * - * @param includePath the includePath value to set. - * @return the ApplicationGatewayRedirectConfigurationPropertiesFormat object itself. - */ - public ApplicationGatewayRedirectConfigurationPropertiesFormat withIncludePath(Boolean includePath) { - this.includePath = includePath; - return this; - } - - /** - * Get the includeQueryString property: Include query string in the redirected url. - * - * @return the includeQueryString value. - */ - public Boolean includeQueryString() { - return this.includeQueryString; - } - - /** - * Set the includeQueryString property: Include query string in the redirected url. - * - * @param includeQueryString the includeQueryString value to set. - * @return the ApplicationGatewayRedirectConfigurationPropertiesFormat object itself. - */ - public ApplicationGatewayRedirectConfigurationPropertiesFormat withIncludeQueryString(Boolean includeQueryString) { - this.includeQueryString = includeQueryString; - return this; - } - - /** - * Get the requestRoutingRules property: Request routing specifying redirect configuration. - * - * @return the requestRoutingRules value. - */ - public List requestRoutingRules() { - return this.requestRoutingRules; - } - - /** - * Set the requestRoutingRules property: Request routing specifying redirect configuration. - * - * @param requestRoutingRules the requestRoutingRules value to set. - * @return the ApplicationGatewayRedirectConfigurationPropertiesFormat object itself. - */ - public ApplicationGatewayRedirectConfigurationPropertiesFormat withRequestRoutingRules( - List requestRoutingRules) { - this.requestRoutingRules = requestRoutingRules; - return this; - } - - /** - * Get the urlPathMaps property: Url path maps specifying default redirect configuration. - * - * @return the urlPathMaps value. - */ - public List urlPathMaps() { - return this.urlPathMaps; - } - - /** - * Set the urlPathMaps property: Url path maps specifying default redirect configuration. - * - * @param urlPathMaps the urlPathMaps value to set. - * @return the ApplicationGatewayRedirectConfigurationPropertiesFormat object itself. - */ - public ApplicationGatewayRedirectConfigurationPropertiesFormat withUrlPathMaps(List urlPathMaps) { - this.urlPathMaps = urlPathMaps; - return this; - } - - /** - * Get the pathRules property: Path rules specifying redirect configuration. - * - * @return the pathRules value. - */ - public List pathRules() { - return this.pathRules; - } - - /** - * Set the pathRules property: Path rules specifying redirect configuration. - * - * @param pathRules the pathRules value to set. - * @return the ApplicationGatewayRedirectConfigurationPropertiesFormat object itself. - */ - public ApplicationGatewayRedirectConfigurationPropertiesFormat withPathRules(List pathRules) { - this.pathRules = pathRules; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayRequestRoutingRuleInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayRequestRoutingRuleInner.java deleted file mode 100644 index a45ea82dfe45..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayRequestRoutingRuleInner.java +++ /dev/null @@ -1,316 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.ApplicationGatewayRequestRoutingRuleType; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Request routing rule of an application gateway. */ -@Fluent -public final class ApplicationGatewayRequestRoutingRuleInner extends SubResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayRequestRoutingRuleInner.class); - - /* - * Properties of request routing rule of the application gateway. - */ - @JsonProperty(value = "properties") - private ApplicationGatewayRequestRoutingRulePropertiesFormat innerProperties; - - /* - * Name of the request routing rule that is unique within an Application - * Gateway. - */ - @JsonProperty(value = "name") - private String name; - - /* - * A unique read-only string that changes whenever the resource is updated. - */ - @JsonProperty(value = "etag") - private String etag; - - /* - * Type of the resource. - */ - @JsonProperty(value = "type") - private String type; - - /** - * Get the innerProperties property: Properties of request routing rule of the application gateway. - * - * @return the innerProperties value. - */ - private ApplicationGatewayRequestRoutingRulePropertiesFormat innerProperties() { - return this.innerProperties; - } - - /** - * Get the name property: Name of the request routing rule that is unique within an Application Gateway. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Name of the request routing rule that is unique within an Application Gateway. - * - * @param name the name value to set. - * @return the ApplicationGatewayRequestRoutingRuleInner object itself. - */ - public ApplicationGatewayRequestRoutingRuleInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @param etag the etag value to set. - * @return the ApplicationGatewayRequestRoutingRuleInner object itself. - */ - public ApplicationGatewayRequestRoutingRuleInner withEtag(String etag) { - this.etag = etag; - return this; - } - - /** - * Get the type property: Type of the resource. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Set the type property: Type of the resource. - * - * @param type the type value to set. - * @return the ApplicationGatewayRequestRoutingRuleInner object itself. - */ - public ApplicationGatewayRequestRoutingRuleInner withType(String type) { - this.type = type; - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicationGatewayRequestRoutingRuleInner withId(String id) { - super.withId(id); - return this; - } - - /** - * Get the ruleType property: Rule type. - * - * @return the ruleType value. - */ - public ApplicationGatewayRequestRoutingRuleType ruleType() { - return this.innerProperties() == null ? null : this.innerProperties().ruleType(); - } - - /** - * Set the ruleType property: Rule type. - * - * @param ruleType the ruleType value to set. - * @return the ApplicationGatewayRequestRoutingRuleInner object itself. - */ - public ApplicationGatewayRequestRoutingRuleInner withRuleType(ApplicationGatewayRequestRoutingRuleType ruleType) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayRequestRoutingRulePropertiesFormat(); - } - this.innerProperties().withRuleType(ruleType); - return this; - } - - /** - * Get the backendAddressPool property: Backend address pool resource of the application gateway. - * - * @return the backendAddressPool value. - */ - public SubResource backendAddressPool() { - return this.innerProperties() == null ? null : this.innerProperties().backendAddressPool(); - } - - /** - * Set the backendAddressPool property: Backend address pool resource of the application gateway. - * - * @param backendAddressPool the backendAddressPool value to set. - * @return the ApplicationGatewayRequestRoutingRuleInner object itself. - */ - public ApplicationGatewayRequestRoutingRuleInner withBackendAddressPool(SubResource backendAddressPool) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayRequestRoutingRulePropertiesFormat(); - } - this.innerProperties().withBackendAddressPool(backendAddressPool); - return this; - } - - /** - * Get the backendHttpSettings property: Backend http settings resource of the application gateway. - * - * @return the backendHttpSettings value. - */ - public SubResource backendHttpSettings() { - return this.innerProperties() == null ? null : this.innerProperties().backendHttpSettings(); - } - - /** - * Set the backendHttpSettings property: Backend http settings resource of the application gateway. - * - * @param backendHttpSettings the backendHttpSettings value to set. - * @return the ApplicationGatewayRequestRoutingRuleInner object itself. - */ - public ApplicationGatewayRequestRoutingRuleInner withBackendHttpSettings(SubResource backendHttpSettings) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayRequestRoutingRulePropertiesFormat(); - } - this.innerProperties().withBackendHttpSettings(backendHttpSettings); - return this; - } - - /** - * Get the httpListener property: Http listener resource of the application gateway. - * - * @return the httpListener value. - */ - public SubResource httpListener() { - return this.innerProperties() == null ? null : this.innerProperties().httpListener(); - } - - /** - * Set the httpListener property: Http listener resource of the application gateway. - * - * @param httpListener the httpListener value to set. - * @return the ApplicationGatewayRequestRoutingRuleInner object itself. - */ - public ApplicationGatewayRequestRoutingRuleInner withHttpListener(SubResource httpListener) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayRequestRoutingRulePropertiesFormat(); - } - this.innerProperties().withHttpListener(httpListener); - return this; - } - - /** - * Get the urlPathMap property: URL path map resource of the application gateway. - * - * @return the urlPathMap value. - */ - public SubResource urlPathMap() { - return this.innerProperties() == null ? null : this.innerProperties().urlPathMap(); - } - - /** - * Set the urlPathMap property: URL path map resource of the application gateway. - * - * @param urlPathMap the urlPathMap value to set. - * @return the ApplicationGatewayRequestRoutingRuleInner object itself. - */ - public ApplicationGatewayRequestRoutingRuleInner withUrlPathMap(SubResource urlPathMap) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayRequestRoutingRulePropertiesFormat(); - } - this.innerProperties().withUrlPathMap(urlPathMap); - return this; - } - - /** - * Get the rewriteRuleSet property: Rewrite Rule Set resource in Basic rule of the application gateway. - * - * @return the rewriteRuleSet value. - */ - public SubResource rewriteRuleSet() { - return this.innerProperties() == null ? null : this.innerProperties().rewriteRuleSet(); - } - - /** - * Set the rewriteRuleSet property: Rewrite Rule Set resource in Basic rule of the application gateway. - * - * @param rewriteRuleSet the rewriteRuleSet value to set. - * @return the ApplicationGatewayRequestRoutingRuleInner object itself. - */ - public ApplicationGatewayRequestRoutingRuleInner withRewriteRuleSet(SubResource rewriteRuleSet) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayRequestRoutingRulePropertiesFormat(); - } - this.innerProperties().withRewriteRuleSet(rewriteRuleSet); - return this; - } - - /** - * Get the redirectConfiguration property: Redirect configuration resource of the application gateway. - * - * @return the redirectConfiguration value. - */ - public SubResource redirectConfiguration() { - return this.innerProperties() == null ? null : this.innerProperties().redirectConfiguration(); - } - - /** - * Set the redirectConfiguration property: Redirect configuration resource of the application gateway. - * - * @param redirectConfiguration the redirectConfiguration value to set. - * @return the ApplicationGatewayRequestRoutingRuleInner object itself. - */ - public ApplicationGatewayRequestRoutingRuleInner withRedirectConfiguration(SubResource redirectConfiguration) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayRequestRoutingRulePropertiesFormat(); - } - this.innerProperties().withRedirectConfiguration(redirectConfiguration); - return this; - } - - /** - * Get the provisioningState property: Provisioning state of the request routing rule resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Set the provisioningState property: Provisioning state of the request routing rule resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param provisioningState the provisioningState value to set. - * @return the ApplicationGatewayRequestRoutingRuleInner object itself. - */ - public ApplicationGatewayRequestRoutingRuleInner withProvisioningState(String provisioningState) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayRequestRoutingRulePropertiesFormat(); - } - this.innerProperties().withProvisioningState(provisioningState); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayRequestRoutingRulePropertiesFormat.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayRequestRoutingRulePropertiesFormat.java deleted file mode 100644 index e14f96902f84..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayRequestRoutingRulePropertiesFormat.java +++ /dev/null @@ -1,241 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.ApplicationGatewayRequestRoutingRuleType; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Properties of request routing rule of the application gateway. */ -@Fluent -public final class ApplicationGatewayRequestRoutingRulePropertiesFormat { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(ApplicationGatewayRequestRoutingRulePropertiesFormat.class); - - /* - * Rule type. - */ - @JsonProperty(value = "ruleType") - private ApplicationGatewayRequestRoutingRuleType ruleType; - - /* - * Backend address pool resource of the application gateway. - */ - @JsonProperty(value = "backendAddressPool") - private SubResource backendAddressPool; - - /* - * Backend http settings resource of the application gateway. - */ - @JsonProperty(value = "backendHttpSettings") - private SubResource backendHttpSettings; - - /* - * Http listener resource of the application gateway. - */ - @JsonProperty(value = "httpListener") - private SubResource httpListener; - - /* - * URL path map resource of the application gateway. - */ - @JsonProperty(value = "urlPathMap") - private SubResource urlPathMap; - - /* - * Rewrite Rule Set resource in Basic rule of the application gateway. - */ - @JsonProperty(value = "rewriteRuleSet") - private SubResource rewriteRuleSet; - - /* - * Redirect configuration resource of the application gateway. - */ - @JsonProperty(value = "redirectConfiguration") - private SubResource redirectConfiguration; - - /* - * Provisioning state of the request routing rule resource. Possible values - * are: 'Updating', 'Deleting', and 'Failed'. - */ - @JsonProperty(value = "provisioningState") - private String provisioningState; - - /** - * Get the ruleType property: Rule type. - * - * @return the ruleType value. - */ - public ApplicationGatewayRequestRoutingRuleType ruleType() { - return this.ruleType; - } - - /** - * Set the ruleType property: Rule type. - * - * @param ruleType the ruleType value to set. - * @return the ApplicationGatewayRequestRoutingRulePropertiesFormat object itself. - */ - public ApplicationGatewayRequestRoutingRulePropertiesFormat withRuleType( - ApplicationGatewayRequestRoutingRuleType ruleType) { - this.ruleType = ruleType; - return this; - } - - /** - * Get the backendAddressPool property: Backend address pool resource of the application gateway. - * - * @return the backendAddressPool value. - */ - public SubResource backendAddressPool() { - return this.backendAddressPool; - } - - /** - * Set the backendAddressPool property: Backend address pool resource of the application gateway. - * - * @param backendAddressPool the backendAddressPool value to set. - * @return the ApplicationGatewayRequestRoutingRulePropertiesFormat object itself. - */ - public ApplicationGatewayRequestRoutingRulePropertiesFormat withBackendAddressPool(SubResource backendAddressPool) { - this.backendAddressPool = backendAddressPool; - return this; - } - - /** - * Get the backendHttpSettings property: Backend http settings resource of the application gateway. - * - * @return the backendHttpSettings value. - */ - public SubResource backendHttpSettings() { - return this.backendHttpSettings; - } - - /** - * Set the backendHttpSettings property: Backend http settings resource of the application gateway. - * - * @param backendHttpSettings the backendHttpSettings value to set. - * @return the ApplicationGatewayRequestRoutingRulePropertiesFormat object itself. - */ - public ApplicationGatewayRequestRoutingRulePropertiesFormat withBackendHttpSettings( - SubResource backendHttpSettings) { - this.backendHttpSettings = backendHttpSettings; - return this; - } - - /** - * Get the httpListener property: Http listener resource of the application gateway. - * - * @return the httpListener value. - */ - public SubResource httpListener() { - return this.httpListener; - } - - /** - * Set the httpListener property: Http listener resource of the application gateway. - * - * @param httpListener the httpListener value to set. - * @return the ApplicationGatewayRequestRoutingRulePropertiesFormat object itself. - */ - public ApplicationGatewayRequestRoutingRulePropertiesFormat withHttpListener(SubResource httpListener) { - this.httpListener = httpListener; - return this; - } - - /** - * Get the urlPathMap property: URL path map resource of the application gateway. - * - * @return the urlPathMap value. - */ - public SubResource urlPathMap() { - return this.urlPathMap; - } - - /** - * Set the urlPathMap property: URL path map resource of the application gateway. - * - * @param urlPathMap the urlPathMap value to set. - * @return the ApplicationGatewayRequestRoutingRulePropertiesFormat object itself. - */ - public ApplicationGatewayRequestRoutingRulePropertiesFormat withUrlPathMap(SubResource urlPathMap) { - this.urlPathMap = urlPathMap; - return this; - } - - /** - * Get the rewriteRuleSet property: Rewrite Rule Set resource in Basic rule of the application gateway. - * - * @return the rewriteRuleSet value. - */ - public SubResource rewriteRuleSet() { - return this.rewriteRuleSet; - } - - /** - * Set the rewriteRuleSet property: Rewrite Rule Set resource in Basic rule of the application gateway. - * - * @param rewriteRuleSet the rewriteRuleSet value to set. - * @return the ApplicationGatewayRequestRoutingRulePropertiesFormat object itself. - */ - public ApplicationGatewayRequestRoutingRulePropertiesFormat withRewriteRuleSet(SubResource rewriteRuleSet) { - this.rewriteRuleSet = rewriteRuleSet; - return this; - } - - /** - * Get the redirectConfiguration property: Redirect configuration resource of the application gateway. - * - * @return the redirectConfiguration value. - */ - public SubResource redirectConfiguration() { - return this.redirectConfiguration; - } - - /** - * Set the redirectConfiguration property: Redirect configuration resource of the application gateway. - * - * @param redirectConfiguration the redirectConfiguration value to set. - * @return the ApplicationGatewayRequestRoutingRulePropertiesFormat object itself. - */ - public ApplicationGatewayRequestRoutingRulePropertiesFormat withRedirectConfiguration( - SubResource redirectConfiguration) { - this.redirectConfiguration = redirectConfiguration; - return this; - } - - /** - * Get the provisioningState property: Provisioning state of the request routing rule resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Set the provisioningState property: Provisioning state of the request routing rule resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param provisioningState the provisioningState value to set. - * @return the ApplicationGatewayRequestRoutingRulePropertiesFormat object itself. - */ - public ApplicationGatewayRequestRoutingRulePropertiesFormat withProvisioningState(String provisioningState) { - this.provisioningState = provisioningState; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayRewriteRuleSetPropertiesFormat.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayRewriteRuleSetPropertiesFormat.java deleted file mode 100644 index 2c90df418a50..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayRewriteRuleSetPropertiesFormat.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.ApplicationGatewayRewriteRule; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Properties of rewrite rule set of the application gateway. */ -@Fluent -public final class ApplicationGatewayRewriteRuleSetPropertiesFormat { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(ApplicationGatewayRewriteRuleSetPropertiesFormat.class); - - /* - * Rewrite rules in the rewrite rule set. - */ - @JsonProperty(value = "rewriteRules") - private List rewriteRules; - - /* - * Provisioning state of the rewrite rule set resource. Possible values - * are: 'Updating', 'Deleting', and 'Failed'. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; - - /** - * Get the rewriteRules property: Rewrite rules in the rewrite rule set. - * - * @return the rewriteRules value. - */ - public List rewriteRules() { - return this.rewriteRules; - } - - /** - * Set the rewriteRules property: Rewrite rules in the rewrite rule set. - * - * @param rewriteRules the rewriteRules value to set. - * @return the ApplicationGatewayRewriteRuleSetPropertiesFormat object itself. - */ - public ApplicationGatewayRewriteRuleSetPropertiesFormat withRewriteRules( - List rewriteRules) { - this.rewriteRules = rewriteRules; - return this; - } - - /** - * Get the provisioningState property: Provisioning state of the rewrite rule set resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (rewriteRules() != null) { - rewriteRules().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewaySslCertificateInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewaySslCertificateInner.java deleted file mode 100644 index 1f8bae98959a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewaySslCertificateInner.java +++ /dev/null @@ -1,250 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** SSL certificates of an application gateway. */ -@Fluent -public final class ApplicationGatewaySslCertificateInner extends SubResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewaySslCertificateInner.class); - - /* - * Properties of SSL certificates of an application gateway. - */ - @JsonProperty(value = "properties") - private ApplicationGatewaySslCertificatePropertiesFormat innerProperties; - - /* - * Name of the SSL certificate that is unique within an Application - * Gateway. - */ - @JsonProperty(value = "name") - private String name; - - /* - * A unique read-only string that changes whenever the resource is updated. - */ - @JsonProperty(value = "etag") - private String etag; - - /* - * Type of the resource. - */ - @JsonProperty(value = "type") - private String type; - - /** - * Get the innerProperties property: Properties of SSL certificates of an application gateway. - * - * @return the innerProperties value. - */ - private ApplicationGatewaySslCertificatePropertiesFormat innerProperties() { - return this.innerProperties; - } - - /** - * Get the name property: Name of the SSL certificate that is unique within an Application Gateway. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Name of the SSL certificate that is unique within an Application Gateway. - * - * @param name the name value to set. - * @return the ApplicationGatewaySslCertificateInner object itself. - */ - public ApplicationGatewaySslCertificateInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @param etag the etag value to set. - * @return the ApplicationGatewaySslCertificateInner object itself. - */ - public ApplicationGatewaySslCertificateInner withEtag(String etag) { - this.etag = etag; - return this; - } - - /** - * Get the type property: Type of the resource. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Set the type property: Type of the resource. - * - * @param type the type value to set. - * @return the ApplicationGatewaySslCertificateInner object itself. - */ - public ApplicationGatewaySslCertificateInner withType(String type) { - this.type = type; - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicationGatewaySslCertificateInner withId(String id) { - super.withId(id); - return this; - } - - /** - * Get the data property: Base-64 encoded pfx certificate. Only applicable in PUT Request. - * - * @return the data value. - */ - public String data() { - return this.innerProperties() == null ? null : this.innerProperties().data(); - } - - /** - * Set the data property: Base-64 encoded pfx certificate. Only applicable in PUT Request. - * - * @param data the data value to set. - * @return the ApplicationGatewaySslCertificateInner object itself. - */ - public ApplicationGatewaySslCertificateInner withData(String data) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewaySslCertificatePropertiesFormat(); - } - this.innerProperties().withData(data); - return this; - } - - /** - * Get the password property: Password for the pfx file specified in data. Only applicable in PUT request. - * - * @return the password value. - */ - public String password() { - return this.innerProperties() == null ? null : this.innerProperties().password(); - } - - /** - * Set the password property: Password for the pfx file specified in data. Only applicable in PUT request. - * - * @param password the password value to set. - * @return the ApplicationGatewaySslCertificateInner object itself. - */ - public ApplicationGatewaySslCertificateInner withPassword(String password) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewaySslCertificatePropertiesFormat(); - } - this.innerProperties().withPassword(password); - return this; - } - - /** - * Get the publicCertData property: Base-64 encoded Public cert data corresponding to pfx specified in data. Only - * applicable in GET request. - * - * @return the publicCertData value. - */ - public String publicCertData() { - return this.innerProperties() == null ? null : this.innerProperties().publicCertData(); - } - - /** - * Set the publicCertData property: Base-64 encoded Public cert data corresponding to pfx specified in data. Only - * applicable in GET request. - * - * @param publicCertData the publicCertData value to set. - * @return the ApplicationGatewaySslCertificateInner object itself. - */ - public ApplicationGatewaySslCertificateInner withPublicCertData(String publicCertData) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewaySslCertificatePropertiesFormat(); - } - this.innerProperties().withPublicCertData(publicCertData); - return this; - } - - /** - * Get the keyVaultSecretId property: Secret Id of (base-64 encoded unencrypted pfx) 'Secret' or 'Certificate' - * object stored in KeyVault. - * - * @return the keyVaultSecretId value. - */ - public String keyVaultSecretId() { - return this.innerProperties() == null ? null : this.innerProperties().keyVaultSecretId(); - } - - /** - * Set the keyVaultSecretId property: Secret Id of (base-64 encoded unencrypted pfx) 'Secret' or 'Certificate' - * object stored in KeyVault. - * - * @param keyVaultSecretId the keyVaultSecretId value to set. - * @return the ApplicationGatewaySslCertificateInner object itself. - */ - public ApplicationGatewaySslCertificateInner withKeyVaultSecretId(String keyVaultSecretId) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewaySslCertificatePropertiesFormat(); - } - this.innerProperties().withKeyVaultSecretId(keyVaultSecretId); - return this; - } - - /** - * Get the provisioningState property: Provisioning state of the SSL certificate resource Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Set the provisioningState property: Provisioning state of the SSL certificate resource Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param provisioningState the provisioningState value to set. - * @return the ApplicationGatewaySslCertificateInner object itself. - */ - public ApplicationGatewaySslCertificateInner withProvisioningState(String provisioningState) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewaySslCertificatePropertiesFormat(); - } - this.innerProperties().withProvisioningState(provisioningState); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewaySslCertificatePropertiesFormat.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewaySslCertificatePropertiesFormat.java deleted file mode 100644 index e46976565790..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewaySslCertificatePropertiesFormat.java +++ /dev/null @@ -1,165 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Properties of SSL certificates of an application gateway. */ -@Fluent -public final class ApplicationGatewaySslCertificatePropertiesFormat { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(ApplicationGatewaySslCertificatePropertiesFormat.class); - - /* - * Base-64 encoded pfx certificate. Only applicable in PUT Request. - */ - @JsonProperty(value = "data") - private String data; - - /* - * Password for the pfx file specified in data. Only applicable in PUT - * request. - */ - @JsonProperty(value = "password") - private String password; - - /* - * Base-64 encoded Public cert data corresponding to pfx specified in data. - * Only applicable in GET request. - */ - @JsonProperty(value = "publicCertData") - private String publicCertData; - - /* - * Secret Id of (base-64 encoded unencrypted pfx) 'Secret' or 'Certificate' - * object stored in KeyVault. - */ - @JsonProperty(value = "keyVaultSecretId") - private String keyVaultSecretId; - - /* - * Provisioning state of the SSL certificate resource Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - */ - @JsonProperty(value = "provisioningState") - private String provisioningState; - - /** - * Get the data property: Base-64 encoded pfx certificate. Only applicable in PUT Request. - * - * @return the data value. - */ - public String data() { - return this.data; - } - - /** - * Set the data property: Base-64 encoded pfx certificate. Only applicable in PUT Request. - * - * @param data the data value to set. - * @return the ApplicationGatewaySslCertificatePropertiesFormat object itself. - */ - public ApplicationGatewaySslCertificatePropertiesFormat withData(String data) { - this.data = data; - return this; - } - - /** - * Get the password property: Password for the pfx file specified in data. Only applicable in PUT request. - * - * @return the password value. - */ - public String password() { - return this.password; - } - - /** - * Set the password property: Password for the pfx file specified in data. Only applicable in PUT request. - * - * @param password the password value to set. - * @return the ApplicationGatewaySslCertificatePropertiesFormat object itself. - */ - public ApplicationGatewaySslCertificatePropertiesFormat withPassword(String password) { - this.password = password; - return this; - } - - /** - * Get the publicCertData property: Base-64 encoded Public cert data corresponding to pfx specified in data. Only - * applicable in GET request. - * - * @return the publicCertData value. - */ - public String publicCertData() { - return this.publicCertData; - } - - /** - * Set the publicCertData property: Base-64 encoded Public cert data corresponding to pfx specified in data. Only - * applicable in GET request. - * - * @param publicCertData the publicCertData value to set. - * @return the ApplicationGatewaySslCertificatePropertiesFormat object itself. - */ - public ApplicationGatewaySslCertificatePropertiesFormat withPublicCertData(String publicCertData) { - this.publicCertData = publicCertData; - return this; - } - - /** - * Get the keyVaultSecretId property: Secret Id of (base-64 encoded unencrypted pfx) 'Secret' or 'Certificate' - * object stored in KeyVault. - * - * @return the keyVaultSecretId value. - */ - public String keyVaultSecretId() { - return this.keyVaultSecretId; - } - - /** - * Set the keyVaultSecretId property: Secret Id of (base-64 encoded unencrypted pfx) 'Secret' or 'Certificate' - * object stored in KeyVault. - * - * @param keyVaultSecretId the keyVaultSecretId value to set. - * @return the ApplicationGatewaySslCertificatePropertiesFormat object itself. - */ - public ApplicationGatewaySslCertificatePropertiesFormat withKeyVaultSecretId(String keyVaultSecretId) { - this.keyVaultSecretId = keyVaultSecretId; - return this; - } - - /** - * Get the provisioningState property: Provisioning state of the SSL certificate resource Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Set the provisioningState property: Provisioning state of the SSL certificate resource Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param provisioningState the provisioningState value to set. - * @return the ApplicationGatewaySslCertificatePropertiesFormat object itself. - */ - public ApplicationGatewaySslCertificatePropertiesFormat withProvisioningState(String provisioningState) { - this.provisioningState = provisioningState; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewaySslPredefinedPolicyInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewaySslPredefinedPolicyInner.java deleted file mode 100644 index 01aa0af10f01..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewaySslPredefinedPolicyInner.java +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.ApplicationGatewaySslCipherSuite; -import com.azure.resourcemanager.network.models.ApplicationGatewaySslProtocol; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** An Ssl predefined policy. */ -@Fluent -public final class ApplicationGatewaySslPredefinedPolicyInner extends SubResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewaySslPredefinedPolicyInner.class); - - /* - * Name of the Ssl predefined policy. - */ - @JsonProperty(value = "name") - private String name; - - /* - * Properties of ApplicationGatewaySslPredefinedPolicy - */ - @JsonProperty(value = "properties") - private ApplicationGatewaySslPredefinedPolicyPropertiesFormat innerProperties; - - /** - * Get the name property: Name of the Ssl predefined policy. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Name of the Ssl predefined policy. - * - * @param name the name value to set. - * @return the ApplicationGatewaySslPredefinedPolicyInner object itself. - */ - public ApplicationGatewaySslPredefinedPolicyInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the innerProperties property: Properties of ApplicationGatewaySslPredefinedPolicy. - * - * @return the innerProperties value. - */ - private ApplicationGatewaySslPredefinedPolicyPropertiesFormat innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public ApplicationGatewaySslPredefinedPolicyInner withId(String id) { - super.withId(id); - return this; - } - - /** - * Get the cipherSuites property: Ssl cipher suites to be enabled in the specified order for application gateway. - * - * @return the cipherSuites value. - */ - public List cipherSuites() { - return this.innerProperties() == null ? null : this.innerProperties().cipherSuites(); - } - - /** - * Set the cipherSuites property: Ssl cipher suites to be enabled in the specified order for application gateway. - * - * @param cipherSuites the cipherSuites value to set. - * @return the ApplicationGatewaySslPredefinedPolicyInner object itself. - */ - public ApplicationGatewaySslPredefinedPolicyInner withCipherSuites( - List cipherSuites) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewaySslPredefinedPolicyPropertiesFormat(); - } - this.innerProperties().withCipherSuites(cipherSuites); - return this; - } - - /** - * Get the minProtocolVersion property: Minimum version of Ssl protocol to be supported on application gateway. - * - * @return the minProtocolVersion value. - */ - public ApplicationGatewaySslProtocol minProtocolVersion() { - return this.innerProperties() == null ? null : this.innerProperties().minProtocolVersion(); - } - - /** - * Set the minProtocolVersion property: Minimum version of Ssl protocol to be supported on application gateway. - * - * @param minProtocolVersion the minProtocolVersion value to set. - * @return the ApplicationGatewaySslPredefinedPolicyInner object itself. - */ - public ApplicationGatewaySslPredefinedPolicyInner withMinProtocolVersion( - ApplicationGatewaySslProtocol minProtocolVersion) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewaySslPredefinedPolicyPropertiesFormat(); - } - this.innerProperties().withMinProtocolVersion(minProtocolVersion); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewaySslPredefinedPolicyPropertiesFormat.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewaySslPredefinedPolicyPropertiesFormat.java deleted file mode 100644 index 3fd06e2b0d75..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewaySslPredefinedPolicyPropertiesFormat.java +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.ApplicationGatewaySslCipherSuite; -import com.azure.resourcemanager.network.models.ApplicationGatewaySslProtocol; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Properties of ApplicationGatewaySslPredefinedPolicy. */ -@Fluent -public final class ApplicationGatewaySslPredefinedPolicyPropertiesFormat { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(ApplicationGatewaySslPredefinedPolicyPropertiesFormat.class); - - /* - * Ssl cipher suites to be enabled in the specified order for application - * gateway. - */ - @JsonProperty(value = "cipherSuites") - private List cipherSuites; - - /* - * Minimum version of Ssl protocol to be supported on application gateway. - */ - @JsonProperty(value = "minProtocolVersion") - private ApplicationGatewaySslProtocol minProtocolVersion; - - /** - * Get the cipherSuites property: Ssl cipher suites to be enabled in the specified order for application gateway. - * - * @return the cipherSuites value. - */ - public List cipherSuites() { - return this.cipherSuites; - } - - /** - * Set the cipherSuites property: Ssl cipher suites to be enabled in the specified order for application gateway. - * - * @param cipherSuites the cipherSuites value to set. - * @return the ApplicationGatewaySslPredefinedPolicyPropertiesFormat object itself. - */ - public ApplicationGatewaySslPredefinedPolicyPropertiesFormat withCipherSuites( - List cipherSuites) { - this.cipherSuites = cipherSuites; - return this; - } - - /** - * Get the minProtocolVersion property: Minimum version of Ssl protocol to be supported on application gateway. - * - * @return the minProtocolVersion value. - */ - public ApplicationGatewaySslProtocol minProtocolVersion() { - return this.minProtocolVersion; - } - - /** - * Set the minProtocolVersion property: Minimum version of Ssl protocol to be supported on application gateway. - * - * @param minProtocolVersion the minProtocolVersion value to set. - * @return the ApplicationGatewaySslPredefinedPolicyPropertiesFormat object itself. - */ - public ApplicationGatewaySslPredefinedPolicyPropertiesFormat withMinProtocolVersion( - ApplicationGatewaySslProtocol minProtocolVersion) { - this.minProtocolVersion = minProtocolVersion; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayTrustedRootCertificatePropertiesFormat.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayTrustedRootCertificatePropertiesFormat.java deleted file mode 100644 index 6c8f3adab0d5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayTrustedRootCertificatePropertiesFormat.java +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Trusted Root certificates properties of an application gateway. */ -@Fluent -public final class ApplicationGatewayTrustedRootCertificatePropertiesFormat { - @JsonIgnore - private final ClientLogger logger = - new ClientLogger(ApplicationGatewayTrustedRootCertificatePropertiesFormat.class); - - /* - * Certificate public data. - */ - @JsonProperty(value = "data") - private String data; - - /* - * Secret Id of (base-64 encoded unencrypted pfx) 'Secret' or 'Certificate' - * object stored in KeyVault. - */ - @JsonProperty(value = "keyVaultSecretId") - private String keyVaultSecretId; - - /* - * Provisioning state of the trusted root certificate resource. Possible - * values are: 'Updating', 'Deleting', and 'Failed'. - */ - @JsonProperty(value = "provisioningState") - private String provisioningState; - - /** - * Get the data property: Certificate public data. - * - * @return the data value. - */ - public String data() { - return this.data; - } - - /** - * Set the data property: Certificate public data. - * - * @param data the data value to set. - * @return the ApplicationGatewayTrustedRootCertificatePropertiesFormat object itself. - */ - public ApplicationGatewayTrustedRootCertificatePropertiesFormat withData(String data) { - this.data = data; - return this; - } - - /** - * Get the keyVaultSecretId property: Secret Id of (base-64 encoded unencrypted pfx) 'Secret' or 'Certificate' - * object stored in KeyVault. - * - * @return the keyVaultSecretId value. - */ - public String keyVaultSecretId() { - return this.keyVaultSecretId; - } - - /** - * Set the keyVaultSecretId property: Secret Id of (base-64 encoded unencrypted pfx) 'Secret' or 'Certificate' - * object stored in KeyVault. - * - * @param keyVaultSecretId the keyVaultSecretId value to set. - * @return the ApplicationGatewayTrustedRootCertificatePropertiesFormat object itself. - */ - public ApplicationGatewayTrustedRootCertificatePropertiesFormat withKeyVaultSecretId(String keyVaultSecretId) { - this.keyVaultSecretId = keyVaultSecretId; - return this; - } - - /** - * Get the provisioningState property: Provisioning state of the trusted root certificate resource. Possible values - * are: 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Set the provisioningState property: Provisioning state of the trusted root certificate resource. Possible values - * are: 'Updating', 'Deleting', and 'Failed'. - * - * @param provisioningState the provisioningState value to set. - * @return the ApplicationGatewayTrustedRootCertificatePropertiesFormat object itself. - */ - public ApplicationGatewayTrustedRootCertificatePropertiesFormat withProvisioningState(String provisioningState) { - this.provisioningState = provisioningState; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayUrlPathMapInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayUrlPathMapInner.java deleted file mode 100644 index d9a78244ec45..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayUrlPathMapInner.java +++ /dev/null @@ -1,270 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** UrlPathMaps give a url path to the backend mapping information for PathBasedRouting. */ -@Fluent -public final class ApplicationGatewayUrlPathMapInner extends SubResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayUrlPathMapInner.class); - - /* - * Properties of UrlPathMap of the application gateway. - */ - @JsonProperty(value = "properties") - private ApplicationGatewayUrlPathMapPropertiesFormat innerProperties; - - /* - * Name of the URL path map that is unique within an Application Gateway. - */ - @JsonProperty(value = "name") - private String name; - - /* - * A unique read-only string that changes whenever the resource is updated. - */ - @JsonProperty(value = "etag") - private String etag; - - /* - * Type of the resource. - */ - @JsonProperty(value = "type") - private String type; - - /** - * Get the innerProperties property: Properties of UrlPathMap of the application gateway. - * - * @return the innerProperties value. - */ - private ApplicationGatewayUrlPathMapPropertiesFormat innerProperties() { - return this.innerProperties; - } - - /** - * Get the name property: Name of the URL path map that is unique within an Application Gateway. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Name of the URL path map that is unique within an Application Gateway. - * - * @param name the name value to set. - * @return the ApplicationGatewayUrlPathMapInner object itself. - */ - public ApplicationGatewayUrlPathMapInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @param etag the etag value to set. - * @return the ApplicationGatewayUrlPathMapInner object itself. - */ - public ApplicationGatewayUrlPathMapInner withEtag(String etag) { - this.etag = etag; - return this; - } - - /** - * Get the type property: Type of the resource. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Set the type property: Type of the resource. - * - * @param type the type value to set. - * @return the ApplicationGatewayUrlPathMapInner object itself. - */ - public ApplicationGatewayUrlPathMapInner withType(String type) { - this.type = type; - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicationGatewayUrlPathMapInner withId(String id) { - super.withId(id); - return this; - } - - /** - * Get the defaultBackendAddressPool property: Default backend address pool resource of URL path map. - * - * @return the defaultBackendAddressPool value. - */ - public SubResource defaultBackendAddressPool() { - return this.innerProperties() == null ? null : this.innerProperties().defaultBackendAddressPool(); - } - - /** - * Set the defaultBackendAddressPool property: Default backend address pool resource of URL path map. - * - * @param defaultBackendAddressPool the defaultBackendAddressPool value to set. - * @return the ApplicationGatewayUrlPathMapInner object itself. - */ - public ApplicationGatewayUrlPathMapInner withDefaultBackendAddressPool(SubResource defaultBackendAddressPool) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayUrlPathMapPropertiesFormat(); - } - this.innerProperties().withDefaultBackendAddressPool(defaultBackendAddressPool); - return this; - } - - /** - * Get the defaultBackendHttpSettings property: Default backend http settings resource of URL path map. - * - * @return the defaultBackendHttpSettings value. - */ - public SubResource defaultBackendHttpSettings() { - return this.innerProperties() == null ? null : this.innerProperties().defaultBackendHttpSettings(); - } - - /** - * Set the defaultBackendHttpSettings property: Default backend http settings resource of URL path map. - * - * @param defaultBackendHttpSettings the defaultBackendHttpSettings value to set. - * @return the ApplicationGatewayUrlPathMapInner object itself. - */ - public ApplicationGatewayUrlPathMapInner withDefaultBackendHttpSettings(SubResource defaultBackendHttpSettings) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayUrlPathMapPropertiesFormat(); - } - this.innerProperties().withDefaultBackendHttpSettings(defaultBackendHttpSettings); - return this; - } - - /** - * Get the defaultRewriteRuleSet property: Default Rewrite rule set resource of URL path map. - * - * @return the defaultRewriteRuleSet value. - */ - public SubResource defaultRewriteRuleSet() { - return this.innerProperties() == null ? null : this.innerProperties().defaultRewriteRuleSet(); - } - - /** - * Set the defaultRewriteRuleSet property: Default Rewrite rule set resource of URL path map. - * - * @param defaultRewriteRuleSet the defaultRewriteRuleSet value to set. - * @return the ApplicationGatewayUrlPathMapInner object itself. - */ - public ApplicationGatewayUrlPathMapInner withDefaultRewriteRuleSet(SubResource defaultRewriteRuleSet) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayUrlPathMapPropertiesFormat(); - } - this.innerProperties().withDefaultRewriteRuleSet(defaultRewriteRuleSet); - return this; - } - - /** - * Get the defaultRedirectConfiguration property: Default redirect configuration resource of URL path map. - * - * @return the defaultRedirectConfiguration value. - */ - public SubResource defaultRedirectConfiguration() { - return this.innerProperties() == null ? null : this.innerProperties().defaultRedirectConfiguration(); - } - - /** - * Set the defaultRedirectConfiguration property: Default redirect configuration resource of URL path map. - * - * @param defaultRedirectConfiguration the defaultRedirectConfiguration value to set. - * @return the ApplicationGatewayUrlPathMapInner object itself. - */ - public ApplicationGatewayUrlPathMapInner withDefaultRedirectConfiguration( - SubResource defaultRedirectConfiguration) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayUrlPathMapPropertiesFormat(); - } - this.innerProperties().withDefaultRedirectConfiguration(defaultRedirectConfiguration); - return this; - } - - /** - * Get the pathRules property: Path rule of URL path map resource. - * - * @return the pathRules value. - */ - public List pathRules() { - return this.innerProperties() == null ? null : this.innerProperties().pathRules(); - } - - /** - * Set the pathRules property: Path rule of URL path map resource. - * - * @param pathRules the pathRules value to set. - * @return the ApplicationGatewayUrlPathMapInner object itself. - */ - public ApplicationGatewayUrlPathMapInner withPathRules(List pathRules) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayUrlPathMapPropertiesFormat(); - } - this.innerProperties().withPathRules(pathRules); - return this; - } - - /** - * Get the provisioningState property: Provisioning state of the backend http settings resource. Possible values - * are: 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Set the provisioningState property: Provisioning state of the backend http settings resource. Possible values - * are: 'Updating', 'Deleting', and 'Failed'. - * - * @param provisioningState the provisioningState value to set. - * @return the ApplicationGatewayUrlPathMapInner object itself. - */ - public ApplicationGatewayUrlPathMapInner withProvisioningState(String provisioningState) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayUrlPathMapPropertiesFormat(); - } - this.innerProperties().withProvisioningState(provisioningState); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayUrlPathMapPropertiesFormat.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayUrlPathMapPropertiesFormat.java deleted file mode 100644 index 5b59184461c5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayUrlPathMapPropertiesFormat.java +++ /dev/null @@ -1,192 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Properties of UrlPathMap of the application gateway. */ -@Fluent -public final class ApplicationGatewayUrlPathMapPropertiesFormat { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(ApplicationGatewayUrlPathMapPropertiesFormat.class); - - /* - * Default backend address pool resource of URL path map. - */ - @JsonProperty(value = "defaultBackendAddressPool") - private SubResource defaultBackendAddressPool; - - /* - * Default backend http settings resource of URL path map. - */ - @JsonProperty(value = "defaultBackendHttpSettings") - private SubResource defaultBackendHttpSettings; - - /* - * Default Rewrite rule set resource of URL path map. - */ - @JsonProperty(value = "defaultRewriteRuleSet") - private SubResource defaultRewriteRuleSet; - - /* - * Default redirect configuration resource of URL path map. - */ - @JsonProperty(value = "defaultRedirectConfiguration") - private SubResource defaultRedirectConfiguration; - - /* - * Path rule of URL path map resource. - */ - @JsonProperty(value = "pathRules") - private List pathRules; - - /* - * Provisioning state of the backend http settings resource. Possible - * values are: 'Updating', 'Deleting', and 'Failed'. - */ - @JsonProperty(value = "provisioningState") - private String provisioningState; - - /** - * Get the defaultBackendAddressPool property: Default backend address pool resource of URL path map. - * - * @return the defaultBackendAddressPool value. - */ - public SubResource defaultBackendAddressPool() { - return this.defaultBackendAddressPool; - } - - /** - * Set the defaultBackendAddressPool property: Default backend address pool resource of URL path map. - * - * @param defaultBackendAddressPool the defaultBackendAddressPool value to set. - * @return the ApplicationGatewayUrlPathMapPropertiesFormat object itself. - */ - public ApplicationGatewayUrlPathMapPropertiesFormat withDefaultBackendAddressPool( - SubResource defaultBackendAddressPool) { - this.defaultBackendAddressPool = defaultBackendAddressPool; - return this; - } - - /** - * Get the defaultBackendHttpSettings property: Default backend http settings resource of URL path map. - * - * @return the defaultBackendHttpSettings value. - */ - public SubResource defaultBackendHttpSettings() { - return this.defaultBackendHttpSettings; - } - - /** - * Set the defaultBackendHttpSettings property: Default backend http settings resource of URL path map. - * - * @param defaultBackendHttpSettings the defaultBackendHttpSettings value to set. - * @return the ApplicationGatewayUrlPathMapPropertiesFormat object itself. - */ - public ApplicationGatewayUrlPathMapPropertiesFormat withDefaultBackendHttpSettings( - SubResource defaultBackendHttpSettings) { - this.defaultBackendHttpSettings = defaultBackendHttpSettings; - return this; - } - - /** - * Get the defaultRewriteRuleSet property: Default Rewrite rule set resource of URL path map. - * - * @return the defaultRewriteRuleSet value. - */ - public SubResource defaultRewriteRuleSet() { - return this.defaultRewriteRuleSet; - } - - /** - * Set the defaultRewriteRuleSet property: Default Rewrite rule set resource of URL path map. - * - * @param defaultRewriteRuleSet the defaultRewriteRuleSet value to set. - * @return the ApplicationGatewayUrlPathMapPropertiesFormat object itself. - */ - public ApplicationGatewayUrlPathMapPropertiesFormat withDefaultRewriteRuleSet(SubResource defaultRewriteRuleSet) { - this.defaultRewriteRuleSet = defaultRewriteRuleSet; - return this; - } - - /** - * Get the defaultRedirectConfiguration property: Default redirect configuration resource of URL path map. - * - * @return the defaultRedirectConfiguration value. - */ - public SubResource defaultRedirectConfiguration() { - return this.defaultRedirectConfiguration; - } - - /** - * Set the defaultRedirectConfiguration property: Default redirect configuration resource of URL path map. - * - * @param defaultRedirectConfiguration the defaultRedirectConfiguration value to set. - * @return the ApplicationGatewayUrlPathMapPropertiesFormat object itself. - */ - public ApplicationGatewayUrlPathMapPropertiesFormat withDefaultRedirectConfiguration( - SubResource defaultRedirectConfiguration) { - this.defaultRedirectConfiguration = defaultRedirectConfiguration; - return this; - } - - /** - * Get the pathRules property: Path rule of URL path map resource. - * - * @return the pathRules value. - */ - public List pathRules() { - return this.pathRules; - } - - /** - * Set the pathRules property: Path rule of URL path map resource. - * - * @param pathRules the pathRules value to set. - * @return the ApplicationGatewayUrlPathMapPropertiesFormat object itself. - */ - public ApplicationGatewayUrlPathMapPropertiesFormat withPathRules(List pathRules) { - this.pathRules = pathRules; - return this; - } - - /** - * Get the provisioningState property: Provisioning state of the backend http settings resource. Possible values - * are: 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Set the provisioningState property: Provisioning state of the backend http settings resource. Possible values - * are: 'Updating', 'Deleting', and 'Failed'. - * - * @param provisioningState the provisioningState value to set. - * @return the ApplicationGatewayUrlPathMapPropertiesFormat object itself. - */ - public ApplicationGatewayUrlPathMapPropertiesFormat withProvisioningState(String provisioningState) { - this.provisioningState = provisioningState; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (pathRules() != null) { - pathRules().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationSecurityGroupInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationSecurityGroupInner.java deleted file mode 100644 index 02fb13a4aeed..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationSecurityGroupInner.java +++ /dev/null @@ -1,120 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** An application security group in a resource group. */ -@Fluent -public final class ApplicationSecurityGroupInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationSecurityGroupInner.class); - - /* - * Properties of the application security group. - */ - @JsonProperty(value = "properties") - private ApplicationSecurityGroupPropertiesFormat innerProperties; - - /* - * A unique read-only string that changes whenever the resource is updated. - */ - @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) - private String etag; - - /* - * Resource ID. - */ - @JsonProperty(value = "id") - private String id; - - /** - * Get the innerProperties property: Properties of the application security group. - * - * @return the innerProperties value. - */ - private ApplicationSecurityGroupPropertiesFormat innerProperties() { - return this.innerProperties; - } - - /** - * Get the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Get the id property: Resource ID. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: Resource ID. - * - * @param id the id value to set. - * @return the ApplicationSecurityGroupInner object itself. - */ - public ApplicationSecurityGroupInner withId(String id) { - this.id = id; - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicationSecurityGroupInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicationSecurityGroupInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the resourceGuid property: The resource GUID property of the application security group resource. It uniquely - * identifies a resource, even if the user changes its name or migrate the resource across subscriptions or resource - * groups. - * - * @return the resourceGuid value. - */ - public String resourceGuid() { - return this.innerProperties() == null ? null : this.innerProperties().resourceGuid(); - } - - /** - * Get the provisioningState property: The provisioning state of the application security group resource. Possible - * values are: 'Succeeded', 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationSecurityGroupPropertiesFormat.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationSecurityGroupPropertiesFormat.java deleted file mode 100644 index de12eefefa1b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationSecurityGroupPropertiesFormat.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Application security group properties. */ -@Immutable -public final class ApplicationSecurityGroupPropertiesFormat { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationSecurityGroupPropertiesFormat.class); - - /* - * The resource GUID property of the application security group resource. - * It uniquely identifies a resource, even if the user changes its name or - * migrate the resource across subscriptions or resource groups. - */ - @JsonProperty(value = "resourceGuid", access = JsonProperty.Access.WRITE_ONLY) - private String resourceGuid; - - /* - * The provisioning state of the application security group resource. - * Possible values are: 'Succeeded', 'Updating', 'Deleting', and 'Failed'. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; - - /** - * Get the resourceGuid property: The resource GUID property of the application security group resource. It uniquely - * identifies a resource, even if the user changes its name or migrate the resource across subscriptions or resource - * groups. - * - * @return the resourceGuid value. - */ - public String resourceGuid() { - return this.resourceGuid; - } - - /** - * Get the provisioningState property: The provisioning state of the application security group resource. Possible - * values are: 'Succeeded', 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/AuthorizationPropertiesFormat.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/AuthorizationPropertiesFormat.java deleted file mode 100644 index e62259ab3d38..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/AuthorizationPropertiesFormat.java +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.AuthorizationUseStatus; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The AuthorizationPropertiesFormat model. */ -@Fluent -public final class AuthorizationPropertiesFormat { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AuthorizationPropertiesFormat.class); - - /* - * The authorization key. - */ - @JsonProperty(value = "authorizationKey") - private String authorizationKey; - - /* - * AuthorizationUseStatus. Possible values are: 'Available' and 'InUse'. - */ - @JsonProperty(value = "authorizationUseStatus") - private AuthorizationUseStatus authorizationUseStatus; - - /* - * Gets the provisioning state of the public IP resource. Possible values - * are: 'Updating', 'Deleting', and 'Failed'. - */ - @JsonProperty(value = "provisioningState") - private String provisioningState; - - /** - * Get the authorizationKey property: The authorization key. - * - * @return the authorizationKey value. - */ - public String authorizationKey() { - return this.authorizationKey; - } - - /** - * Set the authorizationKey property: The authorization key. - * - * @param authorizationKey the authorizationKey value to set. - * @return the AuthorizationPropertiesFormat object itself. - */ - public AuthorizationPropertiesFormat withAuthorizationKey(String authorizationKey) { - this.authorizationKey = authorizationKey; - return this; - } - - /** - * Get the authorizationUseStatus property: AuthorizationUseStatus. Possible values are: 'Available' and 'InUse'. - * - * @return the authorizationUseStatus value. - */ - public AuthorizationUseStatus authorizationUseStatus() { - return this.authorizationUseStatus; - } - - /** - * Set the authorizationUseStatus property: AuthorizationUseStatus. Possible values are: 'Available' and 'InUse'. - * - * @param authorizationUseStatus the authorizationUseStatus value to set. - * @return the AuthorizationPropertiesFormat object itself. - */ - public AuthorizationPropertiesFormat withAuthorizationUseStatus(AuthorizationUseStatus authorizationUseStatus) { - this.authorizationUseStatus = authorizationUseStatus; - return this; - } - - /** - * Get the provisioningState property: Gets the provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Set the provisioningState property: Gets the provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param provisioningState the provisioningState value to set. - * @return the AuthorizationPropertiesFormat object itself. - */ - public AuthorizationPropertiesFormat withProvisioningState(String provisioningState) { - this.provisioningState = provisioningState; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/AvailableDelegationInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/AvailableDelegationInner.java deleted file mode 100644 index 8878bab1c1b2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/AvailableDelegationInner.java +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The serviceName of an AvailableDelegation indicates a possible delegation for a subnet. */ -@Fluent -public final class AvailableDelegationInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailableDelegationInner.class); - - /* - * The name of the AvailableDelegation resource. - */ - @JsonProperty(value = "name") - private String name; - - /* - * A unique identifier of the AvailableDelegation resource. - */ - @JsonProperty(value = "id") - private String id; - - /* - * Resource type. - */ - @JsonProperty(value = "type") - private String type; - - /* - * The name of the service and resource - */ - @JsonProperty(value = "serviceName") - private String serviceName; - - /* - * Describes the actions permitted to the service upon delegation - */ - @JsonProperty(value = "actions") - private List actions; - - /** - * Get the name property: The name of the AvailableDelegation resource. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the AvailableDelegation resource. - * - * @param name the name value to set. - * @return the AvailableDelegationInner object itself. - */ - public AvailableDelegationInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the id property: A unique identifier of the AvailableDelegation resource. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: A unique identifier of the AvailableDelegation resource. - * - * @param id the id value to set. - * @return the AvailableDelegationInner object itself. - */ - public AvailableDelegationInner withId(String id) { - this.id = id; - return this; - } - - /** - * Get the type property: Resource type. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Set the type property: Resource type. - * - * @param type the type value to set. - * @return the AvailableDelegationInner object itself. - */ - public AvailableDelegationInner withType(String type) { - this.type = type; - return this; - } - - /** - * Get the serviceName property: The name of the service and resource. - * - * @return the serviceName value. - */ - public String serviceName() { - return this.serviceName; - } - - /** - * Set the serviceName property: The name of the service and resource. - * - * @param serviceName the serviceName value to set. - * @return the AvailableDelegationInner object itself. - */ - public AvailableDelegationInner withServiceName(String serviceName) { - this.serviceName = serviceName; - return this; - } - - /** - * Get the actions property: Describes the actions permitted to the service upon delegation. - * - * @return the actions value. - */ - public List actions() { - return this.actions; - } - - /** - * Set the actions property: Describes the actions permitted to the service upon delegation. - * - * @param actions the actions value to set. - * @return the AvailableDelegationInner object itself. - */ - public AvailableDelegationInner withActions(List actions) { - this.actions = actions; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/AvailableProvidersListInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/AvailableProvidersListInner.java deleted file mode 100644 index 50dcd1305d44..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/AvailableProvidersListInner.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.AvailableProvidersListCountry; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** List of available countries with details. */ -@Fluent -public final class AvailableProvidersListInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailableProvidersListInner.class); - - /* - * List of available countries. - */ - @JsonProperty(value = "countries", required = true) - private List countries; - - /** - * Get the countries property: List of available countries. - * - * @return the countries value. - */ - public List countries() { - return this.countries; - } - - /** - * Set the countries property: List of available countries. - * - * @param countries the countries value to set. - * @return the AvailableProvidersListInner object itself. - */ - public AvailableProvidersListInner withCountries(List countries) { - this.countries = countries; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (countries() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property countries in model AvailableProvidersListInner")); - } else { - countries().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/AzureFirewallApplicationRuleCollectionPropertiesFormat.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/AzureFirewallApplicationRuleCollectionPropertiesFormat.java deleted file mode 100644 index 9a8f933c444b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/AzureFirewallApplicationRuleCollectionPropertiesFormat.java +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.AzureFirewallApplicationRule; -import com.azure.resourcemanager.network.models.AzureFirewallRCAction; -import com.azure.resourcemanager.network.models.ProvisioningState; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Properties of the application rule collection. */ -@Fluent -public final class AzureFirewallApplicationRuleCollectionPropertiesFormat { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(AzureFirewallApplicationRuleCollectionPropertiesFormat.class); - - /* - * Priority of the application rule collection resource. - */ - @JsonProperty(value = "priority") - private Integer priority; - - /* - * The action type of a rule collection - */ - @JsonProperty(value = "action") - private AzureFirewallRCAction action; - - /* - * Collection of rules used by a application rule collection. - */ - @JsonProperty(value = "rules") - private List rules; - - /* - * The provisioning state of the resource. - */ - @JsonProperty(value = "provisioningState") - private ProvisioningState provisioningState; - - /** - * Get the priority property: Priority of the application rule collection resource. - * - * @return the priority value. - */ - public Integer priority() { - return this.priority; - } - - /** - * Set the priority property: Priority of the application rule collection resource. - * - * @param priority the priority value to set. - * @return the AzureFirewallApplicationRuleCollectionPropertiesFormat object itself. - */ - public AzureFirewallApplicationRuleCollectionPropertiesFormat withPriority(Integer priority) { - this.priority = priority; - return this; - } - - /** - * Get the action property: The action type of a rule collection. - * - * @return the action value. - */ - public AzureFirewallRCAction action() { - return this.action; - } - - /** - * Set the action property: The action type of a rule collection. - * - * @param action the action value to set. - * @return the AzureFirewallApplicationRuleCollectionPropertiesFormat object itself. - */ - public AzureFirewallApplicationRuleCollectionPropertiesFormat withAction(AzureFirewallRCAction action) { - this.action = action; - return this; - } - - /** - * Get the rules property: Collection of rules used by a application rule collection. - * - * @return the rules value. - */ - public List rules() { - return this.rules; - } - - /** - * Set the rules property: Collection of rules used by a application rule collection. - * - * @param rules the rules value to set. - * @return the AzureFirewallApplicationRuleCollectionPropertiesFormat object itself. - */ - public AzureFirewallApplicationRuleCollectionPropertiesFormat withRules(List rules) { - this.rules = rules; - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the resource. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Set the provisioningState property: The provisioning state of the resource. - * - * @param provisioningState the provisioningState value to set. - * @return the AzureFirewallApplicationRuleCollectionPropertiesFormat object itself. - */ - public AzureFirewallApplicationRuleCollectionPropertiesFormat withProvisioningState( - ProvisioningState provisioningState) { - this.provisioningState = provisioningState; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (action() != null) { - action().validate(); - } - if (rules() != null) { - rules().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/AzureFirewallFqdnTagInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/AzureFirewallFqdnTagInner.java deleted file mode 100644 index 3a347143af44..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/AzureFirewallFqdnTagInner.java +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** Azure Firewall FQDN Tag Resource. */ -@Fluent -public final class AzureFirewallFqdnTagInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureFirewallFqdnTagInner.class); - - /* - * Azure Firewall FQDN Tag Properties - */ - @JsonProperty(value = "properties") - private AzureFirewallFqdnTagPropertiesFormat innerProperties; - - /* - * Gets a unique read-only string that changes whenever the resource is - * updated. - */ - @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) - private String etag; - - /* - * Resource ID. - */ - @JsonProperty(value = "id") - private String id; - - /** - * Get the innerProperties property: Azure Firewall FQDN Tag Properties. - * - * @return the innerProperties value. - */ - private AzureFirewallFqdnTagPropertiesFormat innerProperties() { - return this.innerProperties; - } - - /** - * Get the etag property: Gets a unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Get the id property: Resource ID. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: Resource ID. - * - * @param id the id value to set. - * @return the AzureFirewallFqdnTagInner object itself. - */ - public AzureFirewallFqdnTagInner withId(String id) { - this.id = id; - return this; - } - - /** {@inheritDoc} */ - @Override - public AzureFirewallFqdnTagInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public AzureFirewallFqdnTagInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the resource. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the fqdnTagName property: The name of this FQDN Tag. - * - * @return the fqdnTagName value. - */ - public String fqdnTagName() { - return this.innerProperties() == null ? null : this.innerProperties().fqdnTagName(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/AzureFirewallFqdnTagPropertiesFormat.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/AzureFirewallFqdnTagPropertiesFormat.java deleted file mode 100644 index 5bf3488056f2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/AzureFirewallFqdnTagPropertiesFormat.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Azure Firewall FQDN Tag Properties. */ -@Immutable -public final class AzureFirewallFqdnTagPropertiesFormat { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureFirewallFqdnTagPropertiesFormat.class); - - /* - * The provisioning state of the resource. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; - - /* - * The name of this FQDN Tag. - */ - @JsonProperty(value = "fqdnTagName", access = JsonProperty.Access.WRITE_ONLY) - private String fqdnTagName; - - /** - * Get the provisioningState property: The provisioning state of the resource. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Get the fqdnTagName property: The name of this FQDN Tag. - * - * @return the fqdnTagName value. - */ - public String fqdnTagName() { - return this.fqdnTagName; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/AzureFirewallInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/AzureFirewallInner.java deleted file mode 100644 index fc7429b336fc..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/AzureFirewallInner.java +++ /dev/null @@ -1,223 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.AzureFirewallApplicationRuleCollection; -import com.azure.resourcemanager.network.models.AzureFirewallIpConfiguration; -import com.azure.resourcemanager.network.models.AzureFirewallNatRuleCollection; -import com.azure.resourcemanager.network.models.AzureFirewallNetworkRuleCollection; -import com.azure.resourcemanager.network.models.ProvisioningState; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** Azure Firewall resource. */ -@Fluent -public final class AzureFirewallInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureFirewallInner.class); - - /* - * Properties of the Azure Firewall. - */ - @JsonProperty(value = "properties") - private AzureFirewallPropertiesFormat innerProperties; - - /* - * Gets a unique read-only string that changes whenever the resource is - * updated. - */ - @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) - private String etag; - - /* - * Resource ID. - */ - @JsonProperty(value = "id") - private String id; - - /** - * Get the innerProperties property: Properties of the Azure Firewall. - * - * @return the innerProperties value. - */ - private AzureFirewallPropertiesFormat innerProperties() { - return this.innerProperties; - } - - /** - * Get the etag property: Gets a unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Get the id property: Resource ID. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: Resource ID. - * - * @param id the id value to set. - * @return the AzureFirewallInner object itself. - */ - public AzureFirewallInner withId(String id) { - this.id = id; - return this; - } - - /** {@inheritDoc} */ - @Override - public AzureFirewallInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public AzureFirewallInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the applicationRuleCollections property: Collection of application rule collections used by Azure Firewall. - * - * @return the applicationRuleCollections value. - */ - public List applicationRuleCollections() { - return this.innerProperties() == null ? null : this.innerProperties().applicationRuleCollections(); - } - - /** - * Set the applicationRuleCollections property: Collection of application rule collections used by Azure Firewall. - * - * @param applicationRuleCollections the applicationRuleCollections value to set. - * @return the AzureFirewallInner object itself. - */ - public AzureFirewallInner withApplicationRuleCollections( - List applicationRuleCollections) { - if (this.innerProperties() == null) { - this.innerProperties = new AzureFirewallPropertiesFormat(); - } - this.innerProperties().withApplicationRuleCollections(applicationRuleCollections); - return this; - } - - /** - * Get the natRuleCollections property: Collection of NAT rule collections used by Azure Firewall. - * - * @return the natRuleCollections value. - */ - public List natRuleCollections() { - return this.innerProperties() == null ? null : this.innerProperties().natRuleCollections(); - } - - /** - * Set the natRuleCollections property: Collection of NAT rule collections used by Azure Firewall. - * - * @param natRuleCollections the natRuleCollections value to set. - * @return the AzureFirewallInner object itself. - */ - public AzureFirewallInner withNatRuleCollections(List natRuleCollections) { - if (this.innerProperties() == null) { - this.innerProperties = new AzureFirewallPropertiesFormat(); - } - this.innerProperties().withNatRuleCollections(natRuleCollections); - return this; - } - - /** - * Get the networkRuleCollections property: Collection of network rule collections used by Azure Firewall. - * - * @return the networkRuleCollections value. - */ - public List networkRuleCollections() { - return this.innerProperties() == null ? null : this.innerProperties().networkRuleCollections(); - } - - /** - * Set the networkRuleCollections property: Collection of network rule collections used by Azure Firewall. - * - * @param networkRuleCollections the networkRuleCollections value to set. - * @return the AzureFirewallInner object itself. - */ - public AzureFirewallInner withNetworkRuleCollections( - List networkRuleCollections) { - if (this.innerProperties() == null) { - this.innerProperties = new AzureFirewallPropertiesFormat(); - } - this.innerProperties().withNetworkRuleCollections(networkRuleCollections); - return this; - } - - /** - * Get the ipConfigurations property: IP configuration of the Azure Firewall resource. - * - * @return the ipConfigurations value. - */ - public List ipConfigurations() { - return this.innerProperties() == null ? null : this.innerProperties().ipConfigurations(); - } - - /** - * Set the ipConfigurations property: IP configuration of the Azure Firewall resource. - * - * @param ipConfigurations the ipConfigurations value to set. - * @return the AzureFirewallInner object itself. - */ - public AzureFirewallInner withIpConfigurations(List ipConfigurations) { - if (this.innerProperties() == null) { - this.innerProperties = new AzureFirewallPropertiesFormat(); - } - this.innerProperties().withIpConfigurations(ipConfigurations); - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the resource. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Set the provisioningState property: The provisioning state of the resource. - * - * @param provisioningState the provisioningState value to set. - * @return the AzureFirewallInner object itself. - */ - public AzureFirewallInner withProvisioningState(ProvisioningState provisioningState) { - if (this.innerProperties() == null) { - this.innerProperties = new AzureFirewallPropertiesFormat(); - } - this.innerProperties().withProvisioningState(provisioningState); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/AzureFirewallIpConfigurationPropertiesFormat.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/AzureFirewallIpConfigurationPropertiesFormat.java deleted file mode 100644 index 470d0e8b17fa..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/AzureFirewallIpConfigurationPropertiesFormat.java +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.ProvisioningState; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Properties of IP configuration of an Azure Firewall. */ -@Fluent -public final class AzureFirewallIpConfigurationPropertiesFormat { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(AzureFirewallIpConfigurationPropertiesFormat.class); - - /* - * The Firewall Internal Load Balancer IP to be used as the next hop in - * User Defined Routes. - */ - @JsonProperty(value = "privateIPAddress", access = JsonProperty.Access.WRITE_ONLY) - private String privateIpAddress; - - /* - * Reference of the subnet resource. This resource must be named - * 'AzureFirewallSubnet'. - */ - @JsonProperty(value = "subnet") - private SubResource subnet; - - /* - * Reference of the PublicIP resource. This field is a mandatory input if - * subnet is not null. - */ - @JsonProperty(value = "publicIPAddress") - private SubResource publicIpAddress; - - /* - * The provisioning state of the resource. - */ - @JsonProperty(value = "provisioningState") - private ProvisioningState provisioningState; - - /** - * Get the privateIpAddress property: The Firewall Internal Load Balancer IP to be used as the next hop in User - * Defined Routes. - * - * @return the privateIpAddress value. - */ - public String privateIpAddress() { - return this.privateIpAddress; - } - - /** - * Get the subnet property: Reference of the subnet resource. This resource must be named 'AzureFirewallSubnet'. - * - * @return the subnet value. - */ - public SubResource subnet() { - return this.subnet; - } - - /** - * Set the subnet property: Reference of the subnet resource. This resource must be named 'AzureFirewallSubnet'. - * - * @param subnet the subnet value to set. - * @return the AzureFirewallIpConfigurationPropertiesFormat object itself. - */ - public AzureFirewallIpConfigurationPropertiesFormat withSubnet(SubResource subnet) { - this.subnet = subnet; - return this; - } - - /** - * Get the publicIpAddress property: Reference of the PublicIP resource. This field is a mandatory input if subnet - * is not null. - * - * @return the publicIpAddress value. - */ - public SubResource publicIpAddress() { - return this.publicIpAddress; - } - - /** - * Set the publicIpAddress property: Reference of the PublicIP resource. This field is a mandatory input if subnet - * is not null. - * - * @param publicIpAddress the publicIpAddress value to set. - * @return the AzureFirewallIpConfigurationPropertiesFormat object itself. - */ - public AzureFirewallIpConfigurationPropertiesFormat withPublicIpAddress(SubResource publicIpAddress) { - this.publicIpAddress = publicIpAddress; - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the resource. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Set the provisioningState property: The provisioning state of the resource. - * - * @param provisioningState the provisioningState value to set. - * @return the AzureFirewallIpConfigurationPropertiesFormat object itself. - */ - public AzureFirewallIpConfigurationPropertiesFormat withProvisioningState(ProvisioningState provisioningState) { - this.provisioningState = provisioningState; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/AzureFirewallNatRuleCollectionProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/AzureFirewallNatRuleCollectionProperties.java deleted file mode 100644 index 9758f4b272e7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/AzureFirewallNatRuleCollectionProperties.java +++ /dev/null @@ -1,138 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.AzureFirewallNatRCAction; -import com.azure.resourcemanager.network.models.AzureFirewallNatRule; -import com.azure.resourcemanager.network.models.ProvisioningState; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Properties of the NAT rule collection. */ -@Fluent -public final class AzureFirewallNatRuleCollectionProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureFirewallNatRuleCollectionProperties.class); - - /* - * Priority of the NAT rule collection resource. - */ - @JsonProperty(value = "priority") - private Integer priority; - - /* - * The action type of a NAT rule collection - */ - @JsonProperty(value = "action") - private AzureFirewallNatRCAction action; - - /* - * Collection of rules used by a NAT rule collection. - */ - @JsonProperty(value = "rules") - private List rules; - - /* - * The provisioning state of the resource. - */ - @JsonProperty(value = "provisioningState") - private ProvisioningState provisioningState; - - /** - * Get the priority property: Priority of the NAT rule collection resource. - * - * @return the priority value. - */ - public Integer priority() { - return this.priority; - } - - /** - * Set the priority property: Priority of the NAT rule collection resource. - * - * @param priority the priority value to set. - * @return the AzureFirewallNatRuleCollectionProperties object itself. - */ - public AzureFirewallNatRuleCollectionProperties withPriority(Integer priority) { - this.priority = priority; - return this; - } - - /** - * Get the action property: The action type of a NAT rule collection. - * - * @return the action value. - */ - public AzureFirewallNatRCAction action() { - return this.action; - } - - /** - * Set the action property: The action type of a NAT rule collection. - * - * @param action the action value to set. - * @return the AzureFirewallNatRuleCollectionProperties object itself. - */ - public AzureFirewallNatRuleCollectionProperties withAction(AzureFirewallNatRCAction action) { - this.action = action; - return this; - } - - /** - * Get the rules property: Collection of rules used by a NAT rule collection. - * - * @return the rules value. - */ - public List rules() { - return this.rules; - } - - /** - * Set the rules property: Collection of rules used by a NAT rule collection. - * - * @param rules the rules value to set. - * @return the AzureFirewallNatRuleCollectionProperties object itself. - */ - public AzureFirewallNatRuleCollectionProperties withRules(List rules) { - this.rules = rules; - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the resource. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Set the provisioningState property: The provisioning state of the resource. - * - * @param provisioningState the provisioningState value to set. - * @return the AzureFirewallNatRuleCollectionProperties object itself. - */ - public AzureFirewallNatRuleCollectionProperties withProvisioningState(ProvisioningState provisioningState) { - this.provisioningState = provisioningState; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (action() != null) { - action().validate(); - } - if (rules() != null) { - rules().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/AzureFirewallNetworkRuleCollectionPropertiesFormat.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/AzureFirewallNetworkRuleCollectionPropertiesFormat.java deleted file mode 100644 index 0787a41d8ee5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/AzureFirewallNetworkRuleCollectionPropertiesFormat.java +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.AzureFirewallNetworkRule; -import com.azure.resourcemanager.network.models.AzureFirewallRCAction; -import com.azure.resourcemanager.network.models.ProvisioningState; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Properties of the network rule collection. */ -@Fluent -public final class AzureFirewallNetworkRuleCollectionPropertiesFormat { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(AzureFirewallNetworkRuleCollectionPropertiesFormat.class); - - /* - * Priority of the network rule collection resource. - */ - @JsonProperty(value = "priority") - private Integer priority; - - /* - * The action type of a rule collection - */ - @JsonProperty(value = "action") - private AzureFirewallRCAction action; - - /* - * Collection of rules used by a network rule collection. - */ - @JsonProperty(value = "rules") - private List rules; - - /* - * The provisioning state of the resource. - */ - @JsonProperty(value = "provisioningState") - private ProvisioningState provisioningState; - - /** - * Get the priority property: Priority of the network rule collection resource. - * - * @return the priority value. - */ - public Integer priority() { - return this.priority; - } - - /** - * Set the priority property: Priority of the network rule collection resource. - * - * @param priority the priority value to set. - * @return the AzureFirewallNetworkRuleCollectionPropertiesFormat object itself. - */ - public AzureFirewallNetworkRuleCollectionPropertiesFormat withPriority(Integer priority) { - this.priority = priority; - return this; - } - - /** - * Get the action property: The action type of a rule collection. - * - * @return the action value. - */ - public AzureFirewallRCAction action() { - return this.action; - } - - /** - * Set the action property: The action type of a rule collection. - * - * @param action the action value to set. - * @return the AzureFirewallNetworkRuleCollectionPropertiesFormat object itself. - */ - public AzureFirewallNetworkRuleCollectionPropertiesFormat withAction(AzureFirewallRCAction action) { - this.action = action; - return this; - } - - /** - * Get the rules property: Collection of rules used by a network rule collection. - * - * @return the rules value. - */ - public List rules() { - return this.rules; - } - - /** - * Set the rules property: Collection of rules used by a network rule collection. - * - * @param rules the rules value to set. - * @return the AzureFirewallNetworkRuleCollectionPropertiesFormat object itself. - */ - public AzureFirewallNetworkRuleCollectionPropertiesFormat withRules(List rules) { - this.rules = rules; - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the resource. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Set the provisioningState property: The provisioning state of the resource. - * - * @param provisioningState the provisioningState value to set. - * @return the AzureFirewallNetworkRuleCollectionPropertiesFormat object itself. - */ - public AzureFirewallNetworkRuleCollectionPropertiesFormat withProvisioningState( - ProvisioningState provisioningState) { - this.provisioningState = provisioningState; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (action() != null) { - action().validate(); - } - if (rules() != null) { - rules().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/AzureFirewallPropertiesFormat.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/AzureFirewallPropertiesFormat.java deleted file mode 100644 index da26eaa47e0a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/AzureFirewallPropertiesFormat.java +++ /dev/null @@ -1,175 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.AzureFirewallApplicationRuleCollection; -import com.azure.resourcemanager.network.models.AzureFirewallIpConfiguration; -import com.azure.resourcemanager.network.models.AzureFirewallNatRuleCollection; -import com.azure.resourcemanager.network.models.AzureFirewallNetworkRuleCollection; -import com.azure.resourcemanager.network.models.ProvisioningState; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Properties of the Azure Firewall. */ -@Fluent -public final class AzureFirewallPropertiesFormat { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureFirewallPropertiesFormat.class); - - /* - * Collection of application rule collections used by Azure Firewall. - */ - @JsonProperty(value = "applicationRuleCollections") - private List applicationRuleCollections; - - /* - * Collection of NAT rule collections used by Azure Firewall. - */ - @JsonProperty(value = "natRuleCollections") - private List natRuleCollections; - - /* - * Collection of network rule collections used by Azure Firewall. - */ - @JsonProperty(value = "networkRuleCollections") - private List networkRuleCollections; - - /* - * IP configuration of the Azure Firewall resource. - */ - @JsonProperty(value = "ipConfigurations") - private List ipConfigurations; - - /* - * The provisioning state of the resource. - */ - @JsonProperty(value = "provisioningState") - private ProvisioningState provisioningState; - - /** - * Get the applicationRuleCollections property: Collection of application rule collections used by Azure Firewall. - * - * @return the applicationRuleCollections value. - */ - public List applicationRuleCollections() { - return this.applicationRuleCollections; - } - - /** - * Set the applicationRuleCollections property: Collection of application rule collections used by Azure Firewall. - * - * @param applicationRuleCollections the applicationRuleCollections value to set. - * @return the AzureFirewallPropertiesFormat object itself. - */ - public AzureFirewallPropertiesFormat withApplicationRuleCollections( - List applicationRuleCollections) { - this.applicationRuleCollections = applicationRuleCollections; - return this; - } - - /** - * Get the natRuleCollections property: Collection of NAT rule collections used by Azure Firewall. - * - * @return the natRuleCollections value. - */ - public List natRuleCollections() { - return this.natRuleCollections; - } - - /** - * Set the natRuleCollections property: Collection of NAT rule collections used by Azure Firewall. - * - * @param natRuleCollections the natRuleCollections value to set. - * @return the AzureFirewallPropertiesFormat object itself. - */ - public AzureFirewallPropertiesFormat withNatRuleCollections( - List natRuleCollections) { - this.natRuleCollections = natRuleCollections; - return this; - } - - /** - * Get the networkRuleCollections property: Collection of network rule collections used by Azure Firewall. - * - * @return the networkRuleCollections value. - */ - public List networkRuleCollections() { - return this.networkRuleCollections; - } - - /** - * Set the networkRuleCollections property: Collection of network rule collections used by Azure Firewall. - * - * @param networkRuleCollections the networkRuleCollections value to set. - * @return the AzureFirewallPropertiesFormat object itself. - */ - public AzureFirewallPropertiesFormat withNetworkRuleCollections( - List networkRuleCollections) { - this.networkRuleCollections = networkRuleCollections; - return this; - } - - /** - * Get the ipConfigurations property: IP configuration of the Azure Firewall resource. - * - * @return the ipConfigurations value. - */ - public List ipConfigurations() { - return this.ipConfigurations; - } - - /** - * Set the ipConfigurations property: IP configuration of the Azure Firewall resource. - * - * @param ipConfigurations the ipConfigurations value to set. - * @return the AzureFirewallPropertiesFormat object itself. - */ - public AzureFirewallPropertiesFormat withIpConfigurations(List ipConfigurations) { - this.ipConfigurations = ipConfigurations; - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the resource. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Set the provisioningState property: The provisioning state of the resource. - * - * @param provisioningState the provisioningState value to set. - * @return the AzureFirewallPropertiesFormat object itself. - */ - public AzureFirewallPropertiesFormat withProvisioningState(ProvisioningState provisioningState) { - this.provisioningState = provisioningState; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (applicationRuleCollections() != null) { - applicationRuleCollections().forEach(e -> e.validate()); - } - if (natRuleCollections() != null) { - natRuleCollections().forEach(e -> e.validate()); - } - if (networkRuleCollections() != null) { - networkRuleCollections().forEach(e -> e.validate()); - } - if (ipConfigurations() != null) { - ipConfigurations().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/AzureReachabilityReportInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/AzureReachabilityReportInner.java deleted file mode 100644 index 2aa812faf21f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/AzureReachabilityReportInner.java +++ /dev/null @@ -1,130 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.AzureReachabilityReportItem; -import com.azure.resourcemanager.network.models.AzureReachabilityReportLocation; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Azure reachability report details. */ -@Fluent -public final class AzureReachabilityReportInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureReachabilityReportInner.class); - - /* - * The aggregation level of Azure reachability report. Can be Country, - * State or City. - */ - @JsonProperty(value = "aggregationLevel", required = true) - private String aggregationLevel; - - /* - * Parameters that define a geographic location. - */ - @JsonProperty(value = "providerLocation", required = true) - private AzureReachabilityReportLocation providerLocation; - - /* - * List of Azure reachability report items. - */ - @JsonProperty(value = "reachabilityReport", required = true) - private List reachabilityReport; - - /** - * Get the aggregationLevel property: The aggregation level of Azure reachability report. Can be Country, State or - * City. - * - * @return the aggregationLevel value. - */ - public String aggregationLevel() { - return this.aggregationLevel; - } - - /** - * Set the aggregationLevel property: The aggregation level of Azure reachability report. Can be Country, State or - * City. - * - * @param aggregationLevel the aggregationLevel value to set. - * @return the AzureReachabilityReportInner object itself. - */ - public AzureReachabilityReportInner withAggregationLevel(String aggregationLevel) { - this.aggregationLevel = aggregationLevel; - return this; - } - - /** - * Get the providerLocation property: Parameters that define a geographic location. - * - * @return the providerLocation value. - */ - public AzureReachabilityReportLocation providerLocation() { - return this.providerLocation; - } - - /** - * Set the providerLocation property: Parameters that define a geographic location. - * - * @param providerLocation the providerLocation value to set. - * @return the AzureReachabilityReportInner object itself. - */ - public AzureReachabilityReportInner withProviderLocation(AzureReachabilityReportLocation providerLocation) { - this.providerLocation = providerLocation; - return this; - } - - /** - * Get the reachabilityReport property: List of Azure reachability report items. - * - * @return the reachabilityReport value. - */ - public List reachabilityReport() { - return this.reachabilityReport; - } - - /** - * Set the reachabilityReport property: List of Azure reachability report items. - * - * @param reachabilityReport the reachabilityReport value to set. - * @return the AzureReachabilityReportInner object itself. - */ - public AzureReachabilityReportInner withReachabilityReport(List reachabilityReport) { - this.reachabilityReport = reachabilityReport; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (aggregationLevel() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property aggregationLevel in model AzureReachabilityReportInner")); - } - if (providerLocation() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property providerLocation in model AzureReachabilityReportInner")); - } else { - providerLocation().validate(); - } - if (reachabilityReport() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property reachabilityReport in model AzureReachabilityReportInner")); - } else { - reachabilityReport().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/BackendAddressPoolInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/BackendAddressPoolInner.java deleted file mode 100644 index 348e6b838c0a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/BackendAddressPoolInner.java +++ /dev/null @@ -1,168 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Pool of backend IP addresses. */ -@Fluent -public final class BackendAddressPoolInner extends SubResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BackendAddressPoolInner.class); - - /* - * Properties of load balancer backend address pool. - */ - @JsonProperty(value = "properties") - private BackendAddressPoolPropertiesFormat innerProperties; - - /* - * Gets name of the resource that is unique within a resource group. This - * name can be used to access the resource. - */ - @JsonProperty(value = "name") - private String name; - - /* - * A unique read-only string that changes whenever the resource is updated. - */ - @JsonProperty(value = "etag") - private String etag; - - /** - * Get the innerProperties property: Properties of load balancer backend address pool. - * - * @return the innerProperties value. - */ - private BackendAddressPoolPropertiesFormat innerProperties() { - return this.innerProperties; - } - - /** - * Get the name property: Gets name of the resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Gets name of the resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @param name the name value to set. - * @return the BackendAddressPoolInner object itself. - */ - public BackendAddressPoolInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @param etag the etag value to set. - * @return the BackendAddressPoolInner object itself. - */ - public BackendAddressPoolInner withEtag(String etag) { - this.etag = etag; - return this; - } - - /** {@inheritDoc} */ - @Override - public BackendAddressPoolInner withId(String id) { - super.withId(id); - return this; - } - - /** - * Get the backendIpConfigurations property: Gets collection of references to IP addresses defined in network - * interfaces. - * - * @return the backendIpConfigurations value. - */ - public List backendIpConfigurations() { - return this.innerProperties() == null ? null : this.innerProperties().backendIpConfigurations(); - } - - /** - * Get the loadBalancingRules property: Gets load balancing rules that use this backend address pool. - * - * @return the loadBalancingRules value. - */ - public List loadBalancingRules() { - return this.innerProperties() == null ? null : this.innerProperties().loadBalancingRules(); - } - - /** - * Get the outboundRule property: Gets outbound rules that use this backend address pool. - * - * @return the outboundRule value. - */ - public SubResource outboundRule() { - return this.innerProperties() == null ? null : this.innerProperties().outboundRule(); - } - - /** - * Get the outboundRules property: Gets outbound rules that use this backend address pool. - * - * @return the outboundRules value. - */ - public List outboundRules() { - return this.innerProperties() == null ? null : this.innerProperties().outboundRules(); - } - - /** - * Get the provisioningState property: Get provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Set the provisioningState property: Get provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param provisioningState the provisioningState value to set. - * @return the BackendAddressPoolInner object itself. - */ - public BackendAddressPoolInner withProvisioningState(String provisioningState) { - if (this.innerProperties() == null) { - this.innerProperties = new BackendAddressPoolPropertiesFormat(); - } - this.innerProperties().withProvisioningState(provisioningState); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/BackendAddressPoolPropertiesFormat.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/BackendAddressPoolPropertiesFormat.java deleted file mode 100644 index 6b3f22502cfe..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/BackendAddressPoolPropertiesFormat.java +++ /dev/null @@ -1,120 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Properties of the backend address pool. */ -@Fluent -public final class BackendAddressPoolPropertiesFormat { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BackendAddressPoolPropertiesFormat.class); - - /* - * Gets collection of references to IP addresses defined in network - * interfaces. - */ - @JsonProperty(value = "backendIPConfigurations", access = JsonProperty.Access.WRITE_ONLY) - private List backendIpConfigurations; - - /* - * Gets load balancing rules that use this backend address pool. - */ - @JsonProperty(value = "loadBalancingRules", access = JsonProperty.Access.WRITE_ONLY) - private List loadBalancingRules; - - /* - * Gets outbound rules that use this backend address pool. - */ - @JsonProperty(value = "outboundRule", access = JsonProperty.Access.WRITE_ONLY) - private SubResource outboundRule; - - /* - * Gets outbound rules that use this backend address pool. - */ - @JsonProperty(value = "outboundRules", access = JsonProperty.Access.WRITE_ONLY) - private List outboundRules; - - /* - * Get provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - */ - @JsonProperty(value = "provisioningState") - private String provisioningState; - - /** - * Get the backendIpConfigurations property: Gets collection of references to IP addresses defined in network - * interfaces. - * - * @return the backendIpConfigurations value. - */ - public List backendIpConfigurations() { - return this.backendIpConfigurations; - } - - /** - * Get the loadBalancingRules property: Gets load balancing rules that use this backend address pool. - * - * @return the loadBalancingRules value. - */ - public List loadBalancingRules() { - return this.loadBalancingRules; - } - - /** - * Get the outboundRule property: Gets outbound rules that use this backend address pool. - * - * @return the outboundRule value. - */ - public SubResource outboundRule() { - return this.outboundRule; - } - - /** - * Get the outboundRules property: Gets outbound rules that use this backend address pool. - * - * @return the outboundRules value. - */ - public List outboundRules() { - return this.outboundRules; - } - - /** - * Get the provisioningState property: Get provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Set the provisioningState property: Get provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param provisioningState the provisioningState value to set. - * @return the BackendAddressPoolPropertiesFormat object itself. - */ - public BackendAddressPoolPropertiesFormat withProvisioningState(String provisioningState) { - this.provisioningState = provisioningState; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (backendIpConfigurations() != null) { - backendIpConfigurations().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/BgpPeerStatusListResultInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/BgpPeerStatusListResultInner.java deleted file mode 100644 index 23082b23dbca..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/BgpPeerStatusListResultInner.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.BgpPeerStatus; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Response for list BGP peer status API service call. */ -@Fluent -public final class BgpPeerStatusListResultInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BgpPeerStatusListResultInner.class); - - /* - * List of BGP peers - */ - @JsonProperty(value = "value") - private List value; - - /** - * Get the value property: List of BGP peers. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: List of BGP peers. - * - * @param value the value value to set. - * @return the BgpPeerStatusListResultInner object itself. - */ - public BgpPeerStatusListResultInner withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/BgpServiceCommunityInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/BgpServiceCommunityInner.java deleted file mode 100644 index a55e2f8d3c70..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/BgpServiceCommunityInner.java +++ /dev/null @@ -1,132 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.BgpCommunity; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** Service Community Properties. */ -@Fluent -public final class BgpServiceCommunityInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BgpServiceCommunityInner.class); - - /* - * Properties of Service Community. - */ - @JsonProperty(value = "properties") - private BgpServiceCommunityPropertiesFormat innerProperties; - - /* - * Resource ID. - */ - @JsonProperty(value = "id") - private String id; - - /** - * Get the innerProperties property: Properties of Service Community. - * - * @return the innerProperties value. - */ - private BgpServiceCommunityPropertiesFormat innerProperties() { - return this.innerProperties; - } - - /** - * Get the id property: Resource ID. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: Resource ID. - * - * @param id the id value to set. - * @return the BgpServiceCommunityInner object itself. - */ - public BgpServiceCommunityInner withId(String id) { - this.id = id; - return this; - } - - /** {@inheritDoc} */ - @Override - public BgpServiceCommunityInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public BgpServiceCommunityInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the serviceName property: The name of the bgp community. e.g. Skype. - * - * @return the serviceName value. - */ - public String serviceName() { - return this.innerProperties() == null ? null : this.innerProperties().serviceName(); - } - - /** - * Set the serviceName property: The name of the bgp community. e.g. Skype. - * - * @param serviceName the serviceName value to set. - * @return the BgpServiceCommunityInner object itself. - */ - public BgpServiceCommunityInner withServiceName(String serviceName) { - if (this.innerProperties() == null) { - this.innerProperties = new BgpServiceCommunityPropertiesFormat(); - } - this.innerProperties().withServiceName(serviceName); - return this; - } - - /** - * Get the bgpCommunities property: Get a list of bgp communities. - * - * @return the bgpCommunities value. - */ - public List bgpCommunities() { - return this.innerProperties() == null ? null : this.innerProperties().bgpCommunities(); - } - - /** - * Set the bgpCommunities property: Get a list of bgp communities. - * - * @param bgpCommunities the bgpCommunities value to set. - * @return the BgpServiceCommunityInner object itself. - */ - public BgpServiceCommunityInner withBgpCommunities(List bgpCommunities) { - if (this.innerProperties() == null) { - this.innerProperties = new BgpServiceCommunityPropertiesFormat(); - } - this.innerProperties().withBgpCommunities(bgpCommunities); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/BgpServiceCommunityPropertiesFormat.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/BgpServiceCommunityPropertiesFormat.java deleted file mode 100644 index c1f1ec923fac..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/BgpServiceCommunityPropertiesFormat.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.BgpCommunity; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Properties of Service Community. */ -@Fluent -public final class BgpServiceCommunityPropertiesFormat { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BgpServiceCommunityPropertiesFormat.class); - - /* - * The name of the bgp community. e.g. Skype. - */ - @JsonProperty(value = "serviceName") - private String serviceName; - - /* - * Get a list of bgp communities. - */ - @JsonProperty(value = "bgpCommunities") - private List bgpCommunities; - - /** - * Get the serviceName property: The name of the bgp community. e.g. Skype. - * - * @return the serviceName value. - */ - public String serviceName() { - return this.serviceName; - } - - /** - * Set the serviceName property: The name of the bgp community. e.g. Skype. - * - * @param serviceName the serviceName value to set. - * @return the BgpServiceCommunityPropertiesFormat object itself. - */ - public BgpServiceCommunityPropertiesFormat withServiceName(String serviceName) { - this.serviceName = serviceName; - return this; - } - - /** - * Get the bgpCommunities property: Get a list of bgp communities. - * - * @return the bgpCommunities value. - */ - public List bgpCommunities() { - return this.bgpCommunities; - } - - /** - * Set the bgpCommunities property: Get a list of bgp communities. - * - * @param bgpCommunities the bgpCommunities value to set. - * @return the BgpServiceCommunityPropertiesFormat object itself. - */ - public BgpServiceCommunityPropertiesFormat withBgpCommunities(List bgpCommunities) { - this.bgpCommunities = bgpCommunities; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (bgpCommunities() != null) { - bgpCommunities().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ConnectionMonitorInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ConnectionMonitorInner.java deleted file mode 100644 index 0b131ed065ed..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ConnectionMonitorInner.java +++ /dev/null @@ -1,196 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.ConnectionMonitorDestination; -import com.azure.resourcemanager.network.models.ConnectionMonitorSource; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** Parameters that define the operation to create a connection monitor. */ -@Fluent -public final class ConnectionMonitorInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectionMonitorInner.class); - - /* - * Connection monitor location. - */ - @JsonProperty(value = "location") - private String location; - - /* - * Connection monitor tags. - */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map tags; - - /* - * Parameters that define the operation to create a connection monitor. - */ - @JsonProperty(value = "properties", required = true) - private ConnectionMonitorParameters innerProperties = new ConnectionMonitorParameters(); - - /** - * Get the location property: Connection monitor location. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Set the location property: Connection monitor location. - * - * @param location the location value to set. - * @return the ConnectionMonitorInner object itself. - */ - public ConnectionMonitorInner withLocation(String location) { - this.location = location; - return this; - } - - /** - * Get the tags property: Connection monitor tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Connection monitor tags. - * - * @param tags the tags value to set. - * @return the ConnectionMonitorInner object itself. - */ - public ConnectionMonitorInner withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Get the innerProperties property: Parameters that define the operation to create a connection monitor. - * - * @return the innerProperties value. - */ - private ConnectionMonitorParameters innerProperties() { - return this.innerProperties; - } - - /** - * Get the source property: Describes the source of connection monitor. - * - * @return the source value. - */ - public ConnectionMonitorSource source() { - return this.innerProperties() == null ? null : this.innerProperties().source(); - } - - /** - * Set the source property: Describes the source of connection monitor. - * - * @param source the source value to set. - * @return the ConnectionMonitorInner object itself. - */ - public ConnectionMonitorInner withSource(ConnectionMonitorSource source) { - if (this.innerProperties() == null) { - this.innerProperties = new ConnectionMonitorParameters(); - } - this.innerProperties().withSource(source); - return this; - } - - /** - * Get the destination property: Describes the destination of connection monitor. - * - * @return the destination value. - */ - public ConnectionMonitorDestination destination() { - return this.innerProperties() == null ? null : this.innerProperties().destination(); - } - - /** - * Set the destination property: Describes the destination of connection monitor. - * - * @param destination the destination value to set. - * @return the ConnectionMonitorInner object itself. - */ - public ConnectionMonitorInner withDestination(ConnectionMonitorDestination destination) { - if (this.innerProperties() == null) { - this.innerProperties = new ConnectionMonitorParameters(); - } - this.innerProperties().withDestination(destination); - return this; - } - - /** - * Get the autoStart property: Determines if the connection monitor will start automatically once created. - * - * @return the autoStart value. - */ - public Boolean autoStart() { - return this.innerProperties() == null ? null : this.innerProperties().autoStart(); - } - - /** - * Set the autoStart property: Determines if the connection monitor will start automatically once created. - * - * @param autoStart the autoStart value to set. - * @return the ConnectionMonitorInner object itself. - */ - public ConnectionMonitorInner withAutoStart(Boolean autoStart) { - if (this.innerProperties() == null) { - this.innerProperties = new ConnectionMonitorParameters(); - } - this.innerProperties().withAutoStart(autoStart); - return this; - } - - /** - * Get the monitoringIntervalInSeconds property: Monitoring interval in seconds. - * - * @return the monitoringIntervalInSeconds value. - */ - public Integer monitoringIntervalInSeconds() { - return this.innerProperties() == null ? null : this.innerProperties().monitoringIntervalInSeconds(); - } - - /** - * Set the monitoringIntervalInSeconds property: Monitoring interval in seconds. - * - * @param monitoringIntervalInSeconds the monitoringIntervalInSeconds value to set. - * @return the ConnectionMonitorInner object itself. - */ - public ConnectionMonitorInner withMonitoringIntervalInSeconds(Integer monitoringIntervalInSeconds) { - if (this.innerProperties() == null) { - this.innerProperties = new ConnectionMonitorParameters(); - } - this.innerProperties().withMonitoringIntervalInSeconds(monitoringIntervalInSeconds); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property innerProperties in model ConnectionMonitorInner")); - } else { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ConnectionMonitorParameters.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ConnectionMonitorParameters.java deleted file mode 100644 index 7b9a2fc4f4b3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ConnectionMonitorParameters.java +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.ConnectionMonitorDestination; -import com.azure.resourcemanager.network.models.ConnectionMonitorSource; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Parameters that define the operation to create a connection monitor. */ -@Fluent -public class ConnectionMonitorParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectionMonitorParameters.class); - - /* - * Describes the source of connection monitor. - */ - @JsonProperty(value = "source", required = true) - private ConnectionMonitorSource source; - - /* - * Describes the destination of connection monitor. - */ - @JsonProperty(value = "destination", required = true) - private ConnectionMonitorDestination destination; - - /* - * Determines if the connection monitor will start automatically once - * created. - */ - @JsonProperty(value = "autoStart") - private Boolean autoStart; - - /* - * Monitoring interval in seconds. - */ - @JsonProperty(value = "monitoringIntervalInSeconds") - private Integer monitoringIntervalInSeconds; - - /** - * Get the source property: Describes the source of connection monitor. - * - * @return the source value. - */ - public ConnectionMonitorSource source() { - return this.source; - } - - /** - * Set the source property: Describes the source of connection monitor. - * - * @param source the source value to set. - * @return the ConnectionMonitorParameters object itself. - */ - public ConnectionMonitorParameters withSource(ConnectionMonitorSource source) { - this.source = source; - return this; - } - - /** - * Get the destination property: Describes the destination of connection monitor. - * - * @return the destination value. - */ - public ConnectionMonitorDestination destination() { - return this.destination; - } - - /** - * Set the destination property: Describes the destination of connection monitor. - * - * @param destination the destination value to set. - * @return the ConnectionMonitorParameters object itself. - */ - public ConnectionMonitorParameters withDestination(ConnectionMonitorDestination destination) { - this.destination = destination; - return this; - } - - /** - * Get the autoStart property: Determines if the connection monitor will start automatically once created. - * - * @return the autoStart value. - */ - public Boolean autoStart() { - return this.autoStart; - } - - /** - * Set the autoStart property: Determines if the connection monitor will start automatically once created. - * - * @param autoStart the autoStart value to set. - * @return the ConnectionMonitorParameters object itself. - */ - public ConnectionMonitorParameters withAutoStart(Boolean autoStart) { - this.autoStart = autoStart; - return this; - } - - /** - * Get the monitoringIntervalInSeconds property: Monitoring interval in seconds. - * - * @return the monitoringIntervalInSeconds value. - */ - public Integer monitoringIntervalInSeconds() { - return this.monitoringIntervalInSeconds; - } - - /** - * Set the monitoringIntervalInSeconds property: Monitoring interval in seconds. - * - * @param monitoringIntervalInSeconds the monitoringIntervalInSeconds value to set. - * @return the ConnectionMonitorParameters object itself. - */ - public ConnectionMonitorParameters withMonitoringIntervalInSeconds(Integer monitoringIntervalInSeconds) { - this.monitoringIntervalInSeconds = monitoringIntervalInSeconds; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (source() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property source in model ConnectionMonitorParameters")); - } else { - source().validate(); - } - if (destination() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property destination in model ConnectionMonitorParameters")); - } else { - destination().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ConnectionMonitorQueryResultInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ConnectionMonitorQueryResultInner.java deleted file mode 100644 index 44ff5fbb0d95..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ConnectionMonitorQueryResultInner.java +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.ConnectionMonitorSourceStatus; -import com.azure.resourcemanager.network.models.ConnectionStateSnapshot; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** List of connection states snapshots. */ -@Fluent -public final class ConnectionMonitorQueryResultInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectionMonitorQueryResultInner.class); - - /* - * Status of connection monitor source. - */ - @JsonProperty(value = "sourceStatus") - private ConnectionMonitorSourceStatus sourceStatus; - - /* - * Information about connection states. - */ - @JsonProperty(value = "states") - private List states; - - /** - * Get the sourceStatus property: Status of connection monitor source. - * - * @return the sourceStatus value. - */ - public ConnectionMonitorSourceStatus sourceStatus() { - return this.sourceStatus; - } - - /** - * Set the sourceStatus property: Status of connection monitor source. - * - * @param sourceStatus the sourceStatus value to set. - * @return the ConnectionMonitorQueryResultInner object itself. - */ - public ConnectionMonitorQueryResultInner withSourceStatus(ConnectionMonitorSourceStatus sourceStatus) { - this.sourceStatus = sourceStatus; - return this; - } - - /** - * Get the states property: Information about connection states. - * - * @return the states value. - */ - public List states() { - return this.states; - } - - /** - * Set the states property: Information about connection states. - * - * @param states the states value to set. - * @return the ConnectionMonitorQueryResultInner object itself. - */ - public ConnectionMonitorQueryResultInner withStates(List states) { - this.states = states; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (states() != null) { - states().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ConnectionMonitorResultInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ConnectionMonitorResultInner.java deleted file mode 100644 index 54cfe0efc88c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ConnectionMonitorResultInner.java +++ /dev/null @@ -1,249 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.ConnectionMonitorDestination; -import com.azure.resourcemanager.network.models.ConnectionMonitorSource; -import com.azure.resourcemanager.network.models.ProvisioningState; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.Map; - -/** Information about the connection monitor. */ -@Fluent -public final class ConnectionMonitorResultInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectionMonitorResultInner.class); - - /* - * The etag property. - */ - @JsonProperty(value = "etag") - private String etag; - - /* - * Describes the properties of a connection monitor. - */ - @JsonProperty(value = "properties") - private ConnectionMonitorResultProperties innerProperties; - - /** - * Get the etag property: The etag property. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: The etag property. - * - * @param etag the etag value to set. - * @return the ConnectionMonitorResultInner object itself. - */ - public ConnectionMonitorResultInner withEtag(String etag) { - this.etag = etag; - return this; - } - - /** - * Get the innerProperties property: Describes the properties of a connection monitor. - * - * @return the innerProperties value. - */ - private ConnectionMonitorResultProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public ConnectionMonitorResultInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public ConnectionMonitorResultInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the connection monitor. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Set the provisioningState property: The provisioning state of the connection monitor. - * - * @param provisioningState the provisioningState value to set. - * @return the ConnectionMonitorResultInner object itself. - */ - public ConnectionMonitorResultInner withProvisioningState(ProvisioningState provisioningState) { - if (this.innerProperties() == null) { - this.innerProperties = new ConnectionMonitorResultProperties(); - } - this.innerProperties().withProvisioningState(provisioningState); - return this; - } - - /** - * Get the startTime property: The date and time when the connection monitor was started. - * - * @return the startTime value. - */ - public OffsetDateTime startTime() { - return this.innerProperties() == null ? null : this.innerProperties().startTime(); - } - - /** - * Set the startTime property: The date and time when the connection monitor was started. - * - * @param startTime the startTime value to set. - * @return the ConnectionMonitorResultInner object itself. - */ - public ConnectionMonitorResultInner withStartTime(OffsetDateTime startTime) { - if (this.innerProperties() == null) { - this.innerProperties = new ConnectionMonitorResultProperties(); - } - this.innerProperties().withStartTime(startTime); - return this; - } - - /** - * Get the monitoringStatus property: The monitoring status of the connection monitor. - * - * @return the monitoringStatus value. - */ - public String monitoringStatus() { - return this.innerProperties() == null ? null : this.innerProperties().monitoringStatus(); - } - - /** - * Set the monitoringStatus property: The monitoring status of the connection monitor. - * - * @param monitoringStatus the monitoringStatus value to set. - * @return the ConnectionMonitorResultInner object itself. - */ - public ConnectionMonitorResultInner withMonitoringStatus(String monitoringStatus) { - if (this.innerProperties() == null) { - this.innerProperties = new ConnectionMonitorResultProperties(); - } - this.innerProperties().withMonitoringStatus(monitoringStatus); - return this; - } - - /** - * Get the source property: Describes the source of connection monitor. - * - * @return the source value. - */ - public ConnectionMonitorSource source() { - return this.innerProperties() == null ? null : this.innerProperties().source(); - } - - /** - * Set the source property: Describes the source of connection monitor. - * - * @param source the source value to set. - * @return the ConnectionMonitorResultInner object itself. - */ - public ConnectionMonitorResultInner withSource(ConnectionMonitorSource source) { - if (this.innerProperties() == null) { - this.innerProperties = new ConnectionMonitorResultProperties(); - } - this.innerProperties().withSource(source); - return this; - } - - /** - * Get the destination property: Describes the destination of connection monitor. - * - * @return the destination value. - */ - public ConnectionMonitorDestination destination() { - return this.innerProperties() == null ? null : this.innerProperties().destination(); - } - - /** - * Set the destination property: Describes the destination of connection monitor. - * - * @param destination the destination value to set. - * @return the ConnectionMonitorResultInner object itself. - */ - public ConnectionMonitorResultInner withDestination(ConnectionMonitorDestination destination) { - if (this.innerProperties() == null) { - this.innerProperties = new ConnectionMonitorResultProperties(); - } - this.innerProperties().withDestination(destination); - return this; - } - - /** - * Get the autoStart property: Determines if the connection monitor will start automatically once created. - * - * @return the autoStart value. - */ - public Boolean autoStart() { - return this.innerProperties() == null ? null : this.innerProperties().autoStart(); - } - - /** - * Set the autoStart property: Determines if the connection monitor will start automatically once created. - * - * @param autoStart the autoStart value to set. - * @return the ConnectionMonitorResultInner object itself. - */ - public ConnectionMonitorResultInner withAutoStart(Boolean autoStart) { - if (this.innerProperties() == null) { - this.innerProperties = new ConnectionMonitorResultProperties(); - } - this.innerProperties().withAutoStart(autoStart); - return this; - } - - /** - * Get the monitoringIntervalInSeconds property: Monitoring interval in seconds. - * - * @return the monitoringIntervalInSeconds value. - */ - public Integer monitoringIntervalInSeconds() { - return this.innerProperties() == null ? null : this.innerProperties().monitoringIntervalInSeconds(); - } - - /** - * Set the monitoringIntervalInSeconds property: Monitoring interval in seconds. - * - * @param monitoringIntervalInSeconds the monitoringIntervalInSeconds value to set. - * @return the ConnectionMonitorResultInner object itself. - */ - public ConnectionMonitorResultInner withMonitoringIntervalInSeconds(Integer monitoringIntervalInSeconds) { - if (this.innerProperties() == null) { - this.innerProperties = new ConnectionMonitorResultProperties(); - } - this.innerProperties().withMonitoringIntervalInSeconds(monitoringIntervalInSeconds); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ConnectionMonitorResultProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ConnectionMonitorResultProperties.java deleted file mode 100644 index 86a8b230f53e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ConnectionMonitorResultProperties.java +++ /dev/null @@ -1,136 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.ConnectionMonitorDestination; -import com.azure.resourcemanager.network.models.ConnectionMonitorSource; -import com.azure.resourcemanager.network.models.ProvisioningState; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** Describes the properties of a connection monitor. */ -@Fluent -public final class ConnectionMonitorResultProperties extends ConnectionMonitorParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectionMonitorResultProperties.class); - - /* - * The provisioning state of the connection monitor. - */ - @JsonProperty(value = "provisioningState") - private ProvisioningState provisioningState; - - /* - * The date and time when the connection monitor was started. - */ - @JsonProperty(value = "startTime") - private OffsetDateTime startTime; - - /* - * The monitoring status of the connection monitor. - */ - @JsonProperty(value = "monitoringStatus") - private String monitoringStatus; - - /** - * Get the provisioningState property: The provisioning state of the connection monitor. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Set the provisioningState property: The provisioning state of the connection monitor. - * - * @param provisioningState the provisioningState value to set. - * @return the ConnectionMonitorResultProperties object itself. - */ - public ConnectionMonitorResultProperties withProvisioningState(ProvisioningState provisioningState) { - this.provisioningState = provisioningState; - return this; - } - - /** - * Get the startTime property: The date and time when the connection monitor was started. - * - * @return the startTime value. - */ - public OffsetDateTime startTime() { - return this.startTime; - } - - /** - * Set the startTime property: The date and time when the connection monitor was started. - * - * @param startTime the startTime value to set. - * @return the ConnectionMonitorResultProperties object itself. - */ - public ConnectionMonitorResultProperties withStartTime(OffsetDateTime startTime) { - this.startTime = startTime; - return this; - } - - /** - * Get the monitoringStatus property: The monitoring status of the connection monitor. - * - * @return the monitoringStatus value. - */ - public String monitoringStatus() { - return this.monitoringStatus; - } - - /** - * Set the monitoringStatus property: The monitoring status of the connection monitor. - * - * @param monitoringStatus the monitoringStatus value to set. - * @return the ConnectionMonitorResultProperties object itself. - */ - public ConnectionMonitorResultProperties withMonitoringStatus(String monitoringStatus) { - this.monitoringStatus = monitoringStatus; - return this; - } - - /** {@inheritDoc} */ - @Override - public ConnectionMonitorResultProperties withSource(ConnectionMonitorSource source) { - super.withSource(source); - return this; - } - - /** {@inheritDoc} */ - @Override - public ConnectionMonitorResultProperties withDestination(ConnectionMonitorDestination destination) { - super.withDestination(destination); - return this; - } - - /** {@inheritDoc} */ - @Override - public ConnectionMonitorResultProperties withAutoStart(Boolean autoStart) { - super.withAutoStart(autoStart); - return this; - } - - /** {@inheritDoc} */ - @Override - public ConnectionMonitorResultProperties withMonitoringIntervalInSeconds(Integer monitoringIntervalInSeconds) { - super.withMonitoringIntervalInSeconds(monitoringIntervalInSeconds); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ConnectionResetSharedKeyInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ConnectionResetSharedKeyInner.java deleted file mode 100644 index 2bc254c37c96..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ConnectionResetSharedKeyInner.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The virtual network connection reset shared key. */ -@Fluent -public final class ConnectionResetSharedKeyInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectionResetSharedKeyInner.class); - - /* - * The virtual network connection reset shared key length, should between 1 - * and 128. - */ - @JsonProperty(value = "keyLength", required = true) - private int keyLength; - - /** - * Get the keyLength property: The virtual network connection reset shared key length, should between 1 and 128. - * - * @return the keyLength value. - */ - public int keyLength() { - return this.keyLength; - } - - /** - * Set the keyLength property: The virtual network connection reset shared key length, should between 1 and 128. - * - * @param keyLength the keyLength value to set. - * @return the ConnectionResetSharedKeyInner object itself. - */ - public ConnectionResetSharedKeyInner withKeyLength(int keyLength) { - this.keyLength = keyLength; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ConnectionSharedKeyInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ConnectionSharedKeyInner.java deleted file mode 100644 index d7b463d7293a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ConnectionSharedKeyInner.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Response for GetConnectionSharedKey API service call. */ -@Fluent -public final class ConnectionSharedKeyInner extends SubResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectionSharedKeyInner.class); - - /* - * The virtual network connection shared key value. - */ - @JsonProperty(value = "value", required = true) - private String value; - - /** - * Get the value property: The virtual network connection shared key value. - * - * @return the value value. - */ - public String value() { - return this.value; - } - - /** - * Set the value property: The virtual network connection shared key value. - * - * @param value the value value to set. - * @return the ConnectionSharedKeyInner object itself. - */ - public ConnectionSharedKeyInner withValue(String value) { - this.value = value; - return this; - } - - /** {@inheritDoc} */ - @Override - public ConnectionSharedKeyInner withId(String id) { - super.withId(id); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model ConnectionSharedKeyInner")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ConnectivityInformationInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ConnectivityInformationInner.java deleted file mode 100644 index 7d231e2608d0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ConnectivityInformationInner.java +++ /dev/null @@ -1,135 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.ConnectionStatus; -import com.azure.resourcemanager.network.models.ConnectivityHop; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Information on the connectivity status. */ -@Immutable -public final class ConnectivityInformationInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectivityInformationInner.class); - - /* - * List of hops between the source and the destination. - */ - @JsonProperty(value = "hops", access = JsonProperty.Access.WRITE_ONLY) - private List hops; - - /* - * The connection status. - */ - @JsonProperty(value = "connectionStatus", access = JsonProperty.Access.WRITE_ONLY) - private ConnectionStatus connectionStatus; - - /* - * Average latency in milliseconds. - */ - @JsonProperty(value = "avgLatencyInMs", access = JsonProperty.Access.WRITE_ONLY) - private Integer avgLatencyInMs; - - /* - * Minimum latency in milliseconds. - */ - @JsonProperty(value = "minLatencyInMs", access = JsonProperty.Access.WRITE_ONLY) - private Integer minLatencyInMs; - - /* - * Maximum latency in milliseconds. - */ - @JsonProperty(value = "maxLatencyInMs", access = JsonProperty.Access.WRITE_ONLY) - private Integer maxLatencyInMs; - - /* - * Total number of probes sent. - */ - @JsonProperty(value = "probesSent", access = JsonProperty.Access.WRITE_ONLY) - private Integer probesSent; - - /* - * Number of failed probes. - */ - @JsonProperty(value = "probesFailed", access = JsonProperty.Access.WRITE_ONLY) - private Integer probesFailed; - - /** - * Get the hops property: List of hops between the source and the destination. - * - * @return the hops value. - */ - public List hops() { - return this.hops; - } - - /** - * Get the connectionStatus property: The connection status. - * - * @return the connectionStatus value. - */ - public ConnectionStatus connectionStatus() { - return this.connectionStatus; - } - - /** - * Get the avgLatencyInMs property: Average latency in milliseconds. - * - * @return the avgLatencyInMs value. - */ - public Integer avgLatencyInMs() { - return this.avgLatencyInMs; - } - - /** - * Get the minLatencyInMs property: Minimum latency in milliseconds. - * - * @return the minLatencyInMs value. - */ - public Integer minLatencyInMs() { - return this.minLatencyInMs; - } - - /** - * Get the maxLatencyInMs property: Maximum latency in milliseconds. - * - * @return the maxLatencyInMs value. - */ - public Integer maxLatencyInMs() { - return this.maxLatencyInMs; - } - - /** - * Get the probesSent property: Total number of probes sent. - * - * @return the probesSent value. - */ - public Integer probesSent() { - return this.probesSent; - } - - /** - * Get the probesFailed property: Number of failed probes. - * - * @return the probesFailed value. - */ - public Integer probesFailed() { - return this.probesFailed; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (hops() != null) { - hops().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ContainerNetworkInterfaceConfigurationPropertiesFormat.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ContainerNetworkInterfaceConfigurationPropertiesFormat.java deleted file mode 100644 index 5699e86a483a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ContainerNetworkInterfaceConfigurationPropertiesFormat.java +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Container network interface configuration properties. */ -@Fluent -public final class ContainerNetworkInterfaceConfigurationPropertiesFormat { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(ContainerNetworkInterfaceConfigurationPropertiesFormat.class); - - /* - * A list of ip configurations of the container network interface - * configuration. - */ - @JsonProperty(value = "ipConfigurations") - private List ipConfigurations; - - /* - * A list of container network interfaces created from this container - * network interface configuration. - */ - @JsonProperty(value = "containerNetworkInterfaces") - private List containerNetworkInterfaces; - - /* - * The provisioning state of the resource. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; - - /** - * Get the ipConfigurations property: A list of ip configurations of the container network interface configuration. - * - * @return the ipConfigurations value. - */ - public List ipConfigurations() { - return this.ipConfigurations; - } - - /** - * Set the ipConfigurations property: A list of ip configurations of the container network interface configuration. - * - * @param ipConfigurations the ipConfigurations value to set. - * @return the ContainerNetworkInterfaceConfigurationPropertiesFormat object itself. - */ - public ContainerNetworkInterfaceConfigurationPropertiesFormat withIpConfigurations( - List ipConfigurations) { - this.ipConfigurations = ipConfigurations; - return this; - } - - /** - * Get the containerNetworkInterfaces property: A list of container network interfaces created from this container - * network interface configuration. - * - * @return the containerNetworkInterfaces value. - */ - public List containerNetworkInterfaces() { - return this.containerNetworkInterfaces; - } - - /** - * Set the containerNetworkInterfaces property: A list of container network interfaces created from this container - * network interface configuration. - * - * @param containerNetworkInterfaces the containerNetworkInterfaces value to set. - * @return the ContainerNetworkInterfaceConfigurationPropertiesFormat object itself. - */ - public ContainerNetworkInterfaceConfigurationPropertiesFormat withContainerNetworkInterfaces( - List containerNetworkInterfaces) { - this.containerNetworkInterfaces = containerNetworkInterfaces; - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the resource. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (ipConfigurations() != null) { - ipConfigurations().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ContainerNetworkInterfaceIpConfigurationPropertiesFormat.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ContainerNetworkInterfaceIpConfigurationPropertiesFormat.java deleted file mode 100644 index aa295fa126d7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ContainerNetworkInterfaceIpConfigurationPropertiesFormat.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Properties of the container network interface IP configuration. */ -@Immutable -public final class ContainerNetworkInterfaceIpConfigurationPropertiesFormat { - @JsonIgnore - private final ClientLogger logger = - new ClientLogger(ContainerNetworkInterfaceIpConfigurationPropertiesFormat.class); - - /* - * The provisioning state of the resource. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; - - /** - * Get the provisioningState property: The provisioning state of the resource. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ContainerNetworkInterfacePropertiesFormat.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ContainerNetworkInterfacePropertiesFormat.java deleted file mode 100644 index 3efa0d6f866c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ContainerNetworkInterfacePropertiesFormat.java +++ /dev/null @@ -1,136 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.Container; -import com.azure.resourcemanager.network.models.ContainerNetworkInterfaceConfiguration; -import com.azure.resourcemanager.network.models.ContainerNetworkInterfaceIpConfiguration; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The ContainerNetworkInterfacePropertiesFormat model. */ -@Fluent -public final class ContainerNetworkInterfacePropertiesFormat { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ContainerNetworkInterfacePropertiesFormat.class); - - /* - * Container network interface configuration from which this container - * network interface is created. - */ - @JsonProperty(value = "containerNetworkInterfaceConfiguration") - private ContainerNetworkInterfaceConfiguration containerNetworkInterfaceConfiguration; - - /* - * Reference to the container to which this container network interface is - * attached. - */ - @JsonProperty(value = "container") - private Container container; - - /* - * Reference to the ip configuration on this container nic. - */ - @JsonProperty(value = "ipConfigurations") - private List ipConfigurations; - - /* - * The provisioning state of the resource. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; - - /** - * Get the containerNetworkInterfaceConfiguration property: Container network interface configuration from which - * this container network interface is created. - * - * @return the containerNetworkInterfaceConfiguration value. - */ - public ContainerNetworkInterfaceConfiguration containerNetworkInterfaceConfiguration() { - return this.containerNetworkInterfaceConfiguration; - } - - /** - * Set the containerNetworkInterfaceConfiguration property: Container network interface configuration from which - * this container network interface is created. - * - * @param containerNetworkInterfaceConfiguration the containerNetworkInterfaceConfiguration value to set. - * @return the ContainerNetworkInterfacePropertiesFormat object itself. - */ - public ContainerNetworkInterfacePropertiesFormat withContainerNetworkInterfaceConfiguration( - ContainerNetworkInterfaceConfiguration containerNetworkInterfaceConfiguration) { - this.containerNetworkInterfaceConfiguration = containerNetworkInterfaceConfiguration; - return this; - } - - /** - * Get the container property: Reference to the container to which this container network interface is attached. - * - * @return the container value. - */ - public Container container() { - return this.container; - } - - /** - * Set the container property: Reference to the container to which this container network interface is attached. - * - * @param container the container value to set. - * @return the ContainerNetworkInterfacePropertiesFormat object itself. - */ - public ContainerNetworkInterfacePropertiesFormat withContainer(Container container) { - this.container = container; - return this; - } - - /** - * Get the ipConfigurations property: Reference to the ip configuration on this container nic. - * - * @return the ipConfigurations value. - */ - public List ipConfigurations() { - return this.ipConfigurations; - } - - /** - * Set the ipConfigurations property: Reference to the ip configuration on this container nic. - * - * @param ipConfigurations the ipConfigurations value to set. - * @return the ContainerNetworkInterfacePropertiesFormat object itself. - */ - public ContainerNetworkInterfacePropertiesFormat withIpConfigurations( - List ipConfigurations) { - this.ipConfigurations = ipConfigurations; - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the resource. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (containerNetworkInterfaceConfiguration() != null) { - containerNetworkInterfaceConfiguration().validate(); - } - if (container() != null) { - container().validate(); - } - if (ipConfigurations() != null) { - ipConfigurations().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/DdosCustomPolicyInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/DdosCustomPolicyInner.java deleted file mode 100644 index 1c6ad9fa2496..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/DdosCustomPolicyInner.java +++ /dev/null @@ -1,156 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.ProtocolCustomSettingsFormat; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** A DDoS custom policy in a resource group. */ -@Fluent -public final class DdosCustomPolicyInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DdosCustomPolicyInner.class); - - /* - * Properties of the DDoS custom policy. - */ - @JsonProperty(value = "properties") - private DdosCustomPolicyPropertiesFormat innerProperties; - - /* - * A unique read-only string that changes whenever the resource is updated. - */ - @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) - private String etag; - - /* - * Resource ID. - */ - @JsonProperty(value = "id") - private String id; - - /** - * Get the innerProperties property: Properties of the DDoS custom policy. - * - * @return the innerProperties value. - */ - private DdosCustomPolicyPropertiesFormat innerProperties() { - return this.innerProperties; - } - - /** - * Get the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Get the id property: Resource ID. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: Resource ID. - * - * @param id the id value to set. - * @return the DdosCustomPolicyInner object itself. - */ - public DdosCustomPolicyInner withId(String id) { - this.id = id; - return this; - } - - /** {@inheritDoc} */ - @Override - public DdosCustomPolicyInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public DdosCustomPolicyInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the resourceGuid property: The resource GUID property of the DDoS custom policy resource. It uniquely - * identifies the resource, even if the user changes its name or migrate the resource across subscriptions or - * resource groups. - * - * @return the resourceGuid value. - */ - public String resourceGuid() { - return this.innerProperties() == null ? null : this.innerProperties().resourceGuid(); - } - - /** - * Get the provisioningState property: The provisioning state of the DDoS custom policy resource. Possible values - * are: 'Succeeded', 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the publicIpAddresses property: The list of public IPs associated with the DDoS custom policy resource. This - * list is read-only. - * - * @return the publicIpAddresses value. - */ - public List publicIpAddresses() { - return this.innerProperties() == null ? null : this.innerProperties().publicIpAddresses(); - } - - /** - * Get the protocolCustomSettings property: The protocol-specific DDoS policy customization parameters. - * - * @return the protocolCustomSettings value. - */ - public List protocolCustomSettings() { - return this.innerProperties() == null ? null : this.innerProperties().protocolCustomSettings(); - } - - /** - * Set the protocolCustomSettings property: The protocol-specific DDoS policy customization parameters. - * - * @param protocolCustomSettings the protocolCustomSettings value to set. - * @return the DdosCustomPolicyInner object itself. - */ - public DdosCustomPolicyInner withProtocolCustomSettings(List protocolCustomSettings) { - if (this.innerProperties() == null) { - this.innerProperties = new DdosCustomPolicyPropertiesFormat(); - } - this.innerProperties().withProtocolCustomSettings(protocolCustomSettings); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/DdosCustomPolicyPropertiesFormat.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/DdosCustomPolicyPropertiesFormat.java deleted file mode 100644 index 6d98a5f9756e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/DdosCustomPolicyPropertiesFormat.java +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.ProtocolCustomSettingsFormat; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** DDoS custom policy properties. */ -@Fluent -public final class DdosCustomPolicyPropertiesFormat { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DdosCustomPolicyPropertiesFormat.class); - - /* - * The resource GUID property of the DDoS custom policy resource. It - * uniquely identifies the resource, even if the user changes its name or - * migrate the resource across subscriptions or resource groups. - */ - @JsonProperty(value = "resourceGuid", access = JsonProperty.Access.WRITE_ONLY) - private String resourceGuid; - - /* - * The provisioning state of the DDoS custom policy resource. Possible - * values are: 'Succeeded', 'Updating', 'Deleting', and 'Failed'. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; - - /* - * The list of public IPs associated with the DDoS custom policy resource. - * This list is read-only. - */ - @JsonProperty(value = "publicIPAddresses", access = JsonProperty.Access.WRITE_ONLY) - private List publicIpAddresses; - - /* - * The protocol-specific DDoS policy customization parameters. - */ - @JsonProperty(value = "protocolCustomSettings") - private List protocolCustomSettings; - - /** - * Get the resourceGuid property: The resource GUID property of the DDoS custom policy resource. It uniquely - * identifies the resource, even if the user changes its name or migrate the resource across subscriptions or - * resource groups. - * - * @return the resourceGuid value. - */ - public String resourceGuid() { - return this.resourceGuid; - } - - /** - * Get the provisioningState property: The provisioning state of the DDoS custom policy resource. Possible values - * are: 'Succeeded', 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Get the publicIpAddresses property: The list of public IPs associated with the DDoS custom policy resource. This - * list is read-only. - * - * @return the publicIpAddresses value. - */ - public List publicIpAddresses() { - return this.publicIpAddresses; - } - - /** - * Get the protocolCustomSettings property: The protocol-specific DDoS policy customization parameters. - * - * @return the protocolCustomSettings value. - */ - public List protocolCustomSettings() { - return this.protocolCustomSettings; - } - - /** - * Set the protocolCustomSettings property: The protocol-specific DDoS policy customization parameters. - * - * @param protocolCustomSettings the protocolCustomSettings value to set. - * @return the DdosCustomPolicyPropertiesFormat object itself. - */ - public DdosCustomPolicyPropertiesFormat withProtocolCustomSettings( - List protocolCustomSettings) { - this.protocolCustomSettings = protocolCustomSettings; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (protocolCustomSettings() != null) { - protocolCustomSettings().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/DdosProtectionPlanInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/DdosProtectionPlanInner.java deleted file mode 100644 index 43c987294c4a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/DdosProtectionPlanInner.java +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** A DDoS protection plan in a resource group. */ -@Fluent -public final class DdosProtectionPlanInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DdosProtectionPlanInner.class); - - /* - * Properties of the DDoS protection plan. - */ - @JsonProperty(value = "properties") - private DdosProtectionPlanPropertiesFormat innerProperties; - - /* - * A unique read-only string that changes whenever the resource is updated. - */ - @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) - private String etag; - - /** - * Get the innerProperties property: Properties of the DDoS protection plan. - * - * @return the innerProperties value. - */ - private DdosProtectionPlanPropertiesFormat innerProperties() { - return this.innerProperties; - } - - /** - * Get the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** {@inheritDoc} */ - @Override - public DdosProtectionPlanInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public DdosProtectionPlanInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the resourceGuid property: The resource GUID property of the DDoS protection plan resource. It uniquely - * identifies the resource, even if the user changes its name or migrate the resource across subscriptions or - * resource groups. - * - * @return the resourceGuid value. - */ - public String resourceGuid() { - return this.innerProperties() == null ? null : this.innerProperties().resourceGuid(); - } - - /** - * Get the provisioningState property: The provisioning state of the DDoS protection plan resource. Possible values - * are: 'Succeeded', 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the virtualNetworks property: The list of virtual networks associated with the DDoS protection plan resource. - * This list is read-only. - * - * @return the virtualNetworks value. - */ - public List virtualNetworks() { - return this.innerProperties() == null ? null : this.innerProperties().virtualNetworks(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/DdosProtectionPlanPropertiesFormat.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/DdosProtectionPlanPropertiesFormat.java deleted file mode 100644 index 0ffa865b2c0c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/DdosProtectionPlanPropertiesFormat.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** DDoS protection plan properties. */ -@Immutable -public final class DdosProtectionPlanPropertiesFormat { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DdosProtectionPlanPropertiesFormat.class); - - /* - * The resource GUID property of the DDoS protection plan resource. It - * uniquely identifies the resource, even if the user changes its name or - * migrate the resource across subscriptions or resource groups. - */ - @JsonProperty(value = "resourceGuid", access = JsonProperty.Access.WRITE_ONLY) - private String resourceGuid; - - /* - * The provisioning state of the DDoS protection plan resource. Possible - * values are: 'Succeeded', 'Updating', 'Deleting', and 'Failed'. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; - - /* - * The list of virtual networks associated with the DDoS protection plan - * resource. This list is read-only. - */ - @JsonProperty(value = "virtualNetworks", access = JsonProperty.Access.WRITE_ONLY) - private List virtualNetworks; - - /** - * Get the resourceGuid property: The resource GUID property of the DDoS protection plan resource. It uniquely - * identifies the resource, even if the user changes its name or migrate the resource across subscriptions or - * resource groups. - * - * @return the resourceGuid value. - */ - public String resourceGuid() { - return this.resourceGuid; - } - - /** - * Get the provisioningState property: The provisioning state of the DDoS protection plan resource. Possible values - * are: 'Succeeded', 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Get the virtualNetworks property: The list of virtual networks associated with the DDoS protection plan resource. - * This list is read-only. - * - * @return the virtualNetworks value. - */ - public List virtualNetworks() { - return this.virtualNetworks; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/DnsNameAvailabilityResultInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/DnsNameAvailabilityResultInner.java deleted file mode 100644 index ba5427300f4b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/DnsNameAvailabilityResultInner.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Response for the CheckDnsNameAvailability API service call. */ -@Fluent -public final class DnsNameAvailabilityResultInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DnsNameAvailabilityResultInner.class); - - /* - * Domain availability (True/False). - */ - @JsonProperty(value = "available") - private Boolean available; - - /** - * Get the available property: Domain availability (True/False). - * - * @return the available value. - */ - public Boolean available() { - return this.available; - } - - /** - * Set the available property: Domain availability (True/False). - * - * @param available the available value to set. - * @return the DnsNameAvailabilityResultInner object itself. - */ - public DnsNameAvailabilityResultInner withAvailable(Boolean available) { - this.available = available; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/EffectiveNetworkSecurityGroupListResultInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/EffectiveNetworkSecurityGroupListResultInner.java deleted file mode 100644 index 311111d29247..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/EffectiveNetworkSecurityGroupListResultInner.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.EffectiveNetworkSecurityGroup; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Response for list effective network security groups API service call. */ -@Fluent -public final class EffectiveNetworkSecurityGroupListResultInner { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(EffectiveNetworkSecurityGroupListResultInner.class); - - /* - * A list of effective network security groups. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to get the next set of results. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: A list of effective network security groups. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: A list of effective network security groups. - * - * @param value the value value to set. - * @return the EffectiveNetworkSecurityGroupListResultInner object itself. - */ - public EffectiveNetworkSecurityGroupListResultInner withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to get the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/EffectiveRouteListResultInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/EffectiveRouteListResultInner.java deleted file mode 100644 index 3385c0925963..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/EffectiveRouteListResultInner.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.EffectiveRoute; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Response for list effective route API service call. */ -@Fluent -public final class EffectiveRouteListResultInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(EffectiveRouteListResultInner.class); - - /* - * A list of effective routes. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to get the next set of results. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: A list of effective routes. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: A list of effective routes. - * - * @param value the value value to set. - * @return the EffectiveRouteListResultInner object itself. - */ - public EffectiveRouteListResultInner withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to get the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/EndpointServiceResultInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/EndpointServiceResultInner.java deleted file mode 100644 index 25fbc794314b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/EndpointServiceResultInner.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Endpoint service. */ -@Fluent -public final class EndpointServiceResultInner extends SubResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(EndpointServiceResultInner.class); - - /* - * Name of the endpoint service. - */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) - private String name; - - /* - * Type of the endpoint service. - */ - @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) - private String type; - - /** - * Get the name property: Name of the endpoint service. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the type property: Type of the endpoint service. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** {@inheritDoc} */ - @Override - public EndpointServiceResultInner withId(String id) { - super.withId(id); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRouteCircuitAuthorizationInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRouteCircuitAuthorizationInner.java deleted file mode 100644 index a0b5e582a9cf..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRouteCircuitAuthorizationInner.java +++ /dev/null @@ -1,167 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.AuthorizationUseStatus; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Authorization in an ExpressRouteCircuit resource. */ -@Fluent -public final class ExpressRouteCircuitAuthorizationInner extends SubResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitAuthorizationInner.class); - - /* - * The properties property. - */ - @JsonProperty(value = "properties") - private AuthorizationPropertiesFormat innerProperties; - - /* - * Gets name of the resource that is unique within a resource group. This - * name can be used to access the resource. - */ - @JsonProperty(value = "name") - private String name; - - /* - * A unique read-only string that changes whenever the resource is updated. - */ - @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) - private String etag; - - /** - * Get the innerProperties property: The properties property. - * - * @return the innerProperties value. - */ - private AuthorizationPropertiesFormat innerProperties() { - return this.innerProperties; - } - - /** - * Get the name property: Gets name of the resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Gets name of the resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @param name the name value to set. - * @return the ExpressRouteCircuitAuthorizationInner object itself. - */ - public ExpressRouteCircuitAuthorizationInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** {@inheritDoc} */ - @Override - public ExpressRouteCircuitAuthorizationInner withId(String id) { - super.withId(id); - return this; - } - - /** - * Get the authorizationKey property: The authorization key. - * - * @return the authorizationKey value. - */ - public String authorizationKey() { - return this.innerProperties() == null ? null : this.innerProperties().authorizationKey(); - } - - /** - * Set the authorizationKey property: The authorization key. - * - * @param authorizationKey the authorizationKey value to set. - * @return the ExpressRouteCircuitAuthorizationInner object itself. - */ - public ExpressRouteCircuitAuthorizationInner withAuthorizationKey(String authorizationKey) { - if (this.innerProperties() == null) { - this.innerProperties = new AuthorizationPropertiesFormat(); - } - this.innerProperties().withAuthorizationKey(authorizationKey); - return this; - } - - /** - * Get the authorizationUseStatus property: AuthorizationUseStatus. Possible values are: 'Available' and 'InUse'. - * - * @return the authorizationUseStatus value. - */ - public AuthorizationUseStatus authorizationUseStatus() { - return this.innerProperties() == null ? null : this.innerProperties().authorizationUseStatus(); - } - - /** - * Set the authorizationUseStatus property: AuthorizationUseStatus. Possible values are: 'Available' and 'InUse'. - * - * @param authorizationUseStatus the authorizationUseStatus value to set. - * @return the ExpressRouteCircuitAuthorizationInner object itself. - */ - public ExpressRouteCircuitAuthorizationInner withAuthorizationUseStatus( - AuthorizationUseStatus authorizationUseStatus) { - if (this.innerProperties() == null) { - this.innerProperties = new AuthorizationPropertiesFormat(); - } - this.innerProperties().withAuthorizationUseStatus(authorizationUseStatus); - return this; - } - - /** - * Get the provisioningState property: Gets the provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Set the provisioningState property: Gets the provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param provisioningState the provisioningState value to set. - * @return the ExpressRouteCircuitAuthorizationInner object itself. - */ - public ExpressRouteCircuitAuthorizationInner withProvisioningState(String provisioningState) { - if (this.innerProperties() == null) { - this.innerProperties = new AuthorizationPropertiesFormat(); - } - this.innerProperties().withProvisioningState(provisioningState); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRouteCircuitConnectionInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRouteCircuitConnectionInner.java deleted file mode 100644 index a0c3e9273cc2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRouteCircuitConnectionInner.java +++ /dev/null @@ -1,212 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.CircuitConnectionStatus; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Express Route Circuit Connection in an ExpressRouteCircuitPeering resource. */ -@Fluent -public final class ExpressRouteCircuitConnectionInner extends SubResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitConnectionInner.class); - - /* - * The properties property. - */ - @JsonProperty(value = "properties") - private ExpressRouteCircuitConnectionPropertiesFormat innerProperties; - - /* - * Gets name of the resource that is unique within a resource group. This - * name can be used to access the resource. - */ - @JsonProperty(value = "name") - private String name; - - /* - * A unique read-only string that changes whenever the resource is updated. - */ - @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) - private String etag; - - /** - * Get the innerProperties property: The properties property. - * - * @return the innerProperties value. - */ - private ExpressRouteCircuitConnectionPropertiesFormat innerProperties() { - return this.innerProperties; - } - - /** - * Get the name property: Gets name of the resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Gets name of the resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @param name the name value to set. - * @return the ExpressRouteCircuitConnectionInner object itself. - */ - public ExpressRouteCircuitConnectionInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** {@inheritDoc} */ - @Override - public ExpressRouteCircuitConnectionInner withId(String id) { - super.withId(id); - return this; - } - - /** - * Get the expressRouteCircuitPeering property: Reference to Express Route Circuit Private Peering Resource of the - * circuit initiating connection. - * - * @return the expressRouteCircuitPeering value. - */ - public SubResource expressRouteCircuitPeering() { - return this.innerProperties() == null ? null : this.innerProperties().expressRouteCircuitPeering(); - } - - /** - * Set the expressRouteCircuitPeering property: Reference to Express Route Circuit Private Peering Resource of the - * circuit initiating connection. - * - * @param expressRouteCircuitPeering the expressRouteCircuitPeering value to set. - * @return the ExpressRouteCircuitConnectionInner object itself. - */ - public ExpressRouteCircuitConnectionInner withExpressRouteCircuitPeering(SubResource expressRouteCircuitPeering) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpressRouteCircuitConnectionPropertiesFormat(); - } - this.innerProperties().withExpressRouteCircuitPeering(expressRouteCircuitPeering); - return this; - } - - /** - * Get the peerExpressRouteCircuitPeering property: Reference to Express Route Circuit Private Peering Resource of - * the peered circuit. - * - * @return the peerExpressRouteCircuitPeering value. - */ - public SubResource peerExpressRouteCircuitPeering() { - return this.innerProperties() == null ? null : this.innerProperties().peerExpressRouteCircuitPeering(); - } - - /** - * Set the peerExpressRouteCircuitPeering property: Reference to Express Route Circuit Private Peering Resource of - * the peered circuit. - * - * @param peerExpressRouteCircuitPeering the peerExpressRouteCircuitPeering value to set. - * @return the ExpressRouteCircuitConnectionInner object itself. - */ - public ExpressRouteCircuitConnectionInner withPeerExpressRouteCircuitPeering( - SubResource peerExpressRouteCircuitPeering) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpressRouteCircuitConnectionPropertiesFormat(); - } - this.innerProperties().withPeerExpressRouteCircuitPeering(peerExpressRouteCircuitPeering); - return this; - } - - /** - * Get the addressPrefix property: /29 IP address space to carve out Customer addresses for tunnels. - * - * @return the addressPrefix value. - */ - public String addressPrefix() { - return this.innerProperties() == null ? null : this.innerProperties().addressPrefix(); - } - - /** - * Set the addressPrefix property: /29 IP address space to carve out Customer addresses for tunnels. - * - * @param addressPrefix the addressPrefix value to set. - * @return the ExpressRouteCircuitConnectionInner object itself. - */ - public ExpressRouteCircuitConnectionInner withAddressPrefix(String addressPrefix) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpressRouteCircuitConnectionPropertiesFormat(); - } - this.innerProperties().withAddressPrefix(addressPrefix); - return this; - } - - /** - * Get the authorizationKey property: The authorization key. - * - * @return the authorizationKey value. - */ - public String authorizationKey() { - return this.innerProperties() == null ? null : this.innerProperties().authorizationKey(); - } - - /** - * Set the authorizationKey property: The authorization key. - * - * @param authorizationKey the authorizationKey value to set. - * @return the ExpressRouteCircuitConnectionInner object itself. - */ - public ExpressRouteCircuitConnectionInner withAuthorizationKey(String authorizationKey) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpressRouteCircuitConnectionPropertiesFormat(); - } - this.innerProperties().withAuthorizationKey(authorizationKey); - return this; - } - - /** - * Get the circuitConnectionStatus property: Express Route Circuit Connection State. Possible values are: - * 'Connected' and 'Disconnected'. - * - * @return the circuitConnectionStatus value. - */ - public CircuitConnectionStatus circuitConnectionStatus() { - return this.innerProperties() == null ? null : this.innerProperties().circuitConnectionStatus(); - } - - /** - * Get the provisioningState property: Provisioning state of the circuit connection resource. Possible values are: - * 'Succeeded', 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRouteCircuitConnectionPropertiesFormat.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRouteCircuitConnectionPropertiesFormat.java deleted file mode 100644 index 2359f797e39e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRouteCircuitConnectionPropertiesFormat.java +++ /dev/null @@ -1,173 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.CircuitConnectionStatus; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The ExpressRouteCircuitConnectionPropertiesFormat model. */ -@Fluent -public final class ExpressRouteCircuitConnectionPropertiesFormat { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitConnectionPropertiesFormat.class); - - /* - * Reference to Express Route Circuit Private Peering Resource of the - * circuit initiating connection. - */ - @JsonProperty(value = "expressRouteCircuitPeering") - private SubResource expressRouteCircuitPeering; - - /* - * Reference to Express Route Circuit Private Peering Resource of the - * peered circuit. - */ - @JsonProperty(value = "peerExpressRouteCircuitPeering") - private SubResource peerExpressRouteCircuitPeering; - - /* - * /29 IP address space to carve out Customer addresses for tunnels. - */ - @JsonProperty(value = "addressPrefix") - private String addressPrefix; - - /* - * The authorization key. - */ - @JsonProperty(value = "authorizationKey") - private String authorizationKey; - - /* - * Express Route Circuit Connection State. Possible values are: 'Connected' - * and 'Disconnected'. - */ - @JsonProperty(value = "circuitConnectionStatus", access = JsonProperty.Access.WRITE_ONLY) - private CircuitConnectionStatus circuitConnectionStatus; - - /* - * Provisioning state of the circuit connection resource. Possible values - * are: 'Succeeded', 'Updating', 'Deleting', and 'Failed'. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; - - /** - * Get the expressRouteCircuitPeering property: Reference to Express Route Circuit Private Peering Resource of the - * circuit initiating connection. - * - * @return the expressRouteCircuitPeering value. - */ - public SubResource expressRouteCircuitPeering() { - return this.expressRouteCircuitPeering; - } - - /** - * Set the expressRouteCircuitPeering property: Reference to Express Route Circuit Private Peering Resource of the - * circuit initiating connection. - * - * @param expressRouteCircuitPeering the expressRouteCircuitPeering value to set. - * @return the ExpressRouteCircuitConnectionPropertiesFormat object itself. - */ - public ExpressRouteCircuitConnectionPropertiesFormat withExpressRouteCircuitPeering( - SubResource expressRouteCircuitPeering) { - this.expressRouteCircuitPeering = expressRouteCircuitPeering; - return this; - } - - /** - * Get the peerExpressRouteCircuitPeering property: Reference to Express Route Circuit Private Peering Resource of - * the peered circuit. - * - * @return the peerExpressRouteCircuitPeering value. - */ - public SubResource peerExpressRouteCircuitPeering() { - return this.peerExpressRouteCircuitPeering; - } - - /** - * Set the peerExpressRouteCircuitPeering property: Reference to Express Route Circuit Private Peering Resource of - * the peered circuit. - * - * @param peerExpressRouteCircuitPeering the peerExpressRouteCircuitPeering value to set. - * @return the ExpressRouteCircuitConnectionPropertiesFormat object itself. - */ - public ExpressRouteCircuitConnectionPropertiesFormat withPeerExpressRouteCircuitPeering( - SubResource peerExpressRouteCircuitPeering) { - this.peerExpressRouteCircuitPeering = peerExpressRouteCircuitPeering; - return this; - } - - /** - * Get the addressPrefix property: /29 IP address space to carve out Customer addresses for tunnels. - * - * @return the addressPrefix value. - */ - public String addressPrefix() { - return this.addressPrefix; - } - - /** - * Set the addressPrefix property: /29 IP address space to carve out Customer addresses for tunnels. - * - * @param addressPrefix the addressPrefix value to set. - * @return the ExpressRouteCircuitConnectionPropertiesFormat object itself. - */ - public ExpressRouteCircuitConnectionPropertiesFormat withAddressPrefix(String addressPrefix) { - this.addressPrefix = addressPrefix; - return this; - } - - /** - * Get the authorizationKey property: The authorization key. - * - * @return the authorizationKey value. - */ - public String authorizationKey() { - return this.authorizationKey; - } - - /** - * Set the authorizationKey property: The authorization key. - * - * @param authorizationKey the authorizationKey value to set. - * @return the ExpressRouteCircuitConnectionPropertiesFormat object itself. - */ - public ExpressRouteCircuitConnectionPropertiesFormat withAuthorizationKey(String authorizationKey) { - this.authorizationKey = authorizationKey; - return this; - } - - /** - * Get the circuitConnectionStatus property: Express Route Circuit Connection State. Possible values are: - * 'Connected' and 'Disconnected'. - * - * @return the circuitConnectionStatus value. - */ - public CircuitConnectionStatus circuitConnectionStatus() { - return this.circuitConnectionStatus; - } - - /** - * Get the provisioningState property: Provisioning state of the circuit connection resource. Possible values are: - * 'Succeeded', 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRouteCircuitInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRouteCircuitInner.java deleted file mode 100644 index f4fdba9575ec..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRouteCircuitInner.java +++ /dev/null @@ -1,452 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.ExpressRouteCircuitServiceProviderProperties; -import com.azure.resourcemanager.network.models.ExpressRouteCircuitSku; -import com.azure.resourcemanager.network.models.ServiceProviderProvisioningState; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** ExpressRouteCircuit resource. */ -@Fluent -public final class ExpressRouteCircuitInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitInner.class); - - /* - * The SKU. - */ - @JsonProperty(value = "sku") - private ExpressRouteCircuitSku sku; - - /* - * Properties of ExpressRouteCircuit. - */ - @JsonProperty(value = "properties") - private ExpressRouteCircuitPropertiesFormat innerProperties; - - /* - * Gets a unique read-only string that changes whenever the resource is - * updated. - */ - @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) - private String etag; - - /* - * Resource ID. - */ - @JsonProperty(value = "id") - private String id; - - /** - * Get the sku property: The SKU. - * - * @return the sku value. - */ - public ExpressRouteCircuitSku sku() { - return this.sku; - } - - /** - * Set the sku property: The SKU. - * - * @param sku the sku value to set. - * @return the ExpressRouteCircuitInner object itself. - */ - public ExpressRouteCircuitInner withSku(ExpressRouteCircuitSku sku) { - this.sku = sku; - return this; - } - - /** - * Get the innerProperties property: Properties of ExpressRouteCircuit. - * - * @return the innerProperties value. - */ - private ExpressRouteCircuitPropertiesFormat innerProperties() { - return this.innerProperties; - } - - /** - * Get the etag property: Gets a unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Get the id property: Resource ID. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: Resource ID. - * - * @param id the id value to set. - * @return the ExpressRouteCircuitInner object itself. - */ - public ExpressRouteCircuitInner withId(String id) { - this.id = id; - return this; - } - - /** {@inheritDoc} */ - @Override - public ExpressRouteCircuitInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public ExpressRouteCircuitInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the allowClassicOperations property: Allow classic operations. - * - * @return the allowClassicOperations value. - */ - public Boolean allowClassicOperations() { - return this.innerProperties() == null ? null : this.innerProperties().allowClassicOperations(); - } - - /** - * Set the allowClassicOperations property: Allow classic operations. - * - * @param allowClassicOperations the allowClassicOperations value to set. - * @return the ExpressRouteCircuitInner object itself. - */ - public ExpressRouteCircuitInner withAllowClassicOperations(Boolean allowClassicOperations) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpressRouteCircuitPropertiesFormat(); - } - this.innerProperties().withAllowClassicOperations(allowClassicOperations); - return this; - } - - /** - * Get the circuitProvisioningState property: The CircuitProvisioningState state of the resource. - * - * @return the circuitProvisioningState value. - */ - public String circuitProvisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().circuitProvisioningState(); - } - - /** - * Set the circuitProvisioningState property: The CircuitProvisioningState state of the resource. - * - * @param circuitProvisioningState the circuitProvisioningState value to set. - * @return the ExpressRouteCircuitInner object itself. - */ - public ExpressRouteCircuitInner withCircuitProvisioningState(String circuitProvisioningState) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpressRouteCircuitPropertiesFormat(); - } - this.innerProperties().withCircuitProvisioningState(circuitProvisioningState); - return this; - } - - /** - * Get the serviceProviderProvisioningState property: The ServiceProviderProvisioningState state of the resource. - * Possible values are 'NotProvisioned', 'Provisioning', 'Provisioned', and 'Deprovisioning'. - * - * @return the serviceProviderProvisioningState value. - */ - public ServiceProviderProvisioningState serviceProviderProvisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().serviceProviderProvisioningState(); - } - - /** - * Set the serviceProviderProvisioningState property: The ServiceProviderProvisioningState state of the resource. - * Possible values are 'NotProvisioned', 'Provisioning', 'Provisioned', and 'Deprovisioning'. - * - * @param serviceProviderProvisioningState the serviceProviderProvisioningState value to set. - * @return the ExpressRouteCircuitInner object itself. - */ - public ExpressRouteCircuitInner withServiceProviderProvisioningState( - ServiceProviderProvisioningState serviceProviderProvisioningState) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpressRouteCircuitPropertiesFormat(); - } - this.innerProperties().withServiceProviderProvisioningState(serviceProviderProvisioningState); - return this; - } - - /** - * Get the authorizations property: The list of authorizations. - * - * @return the authorizations value. - */ - public List authorizations() { - return this.innerProperties() == null ? null : this.innerProperties().authorizations(); - } - - /** - * Set the authorizations property: The list of authorizations. - * - * @param authorizations the authorizations value to set. - * @return the ExpressRouteCircuitInner object itself. - */ - public ExpressRouteCircuitInner withAuthorizations(List authorizations) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpressRouteCircuitPropertiesFormat(); - } - this.innerProperties().withAuthorizations(authorizations); - return this; - } - - /** - * Get the peerings property: The list of peerings. - * - * @return the peerings value. - */ - public List peerings() { - return this.innerProperties() == null ? null : this.innerProperties().peerings(); - } - - /** - * Set the peerings property: The list of peerings. - * - * @param peerings the peerings value to set. - * @return the ExpressRouteCircuitInner object itself. - */ - public ExpressRouteCircuitInner withPeerings(List peerings) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpressRouteCircuitPropertiesFormat(); - } - this.innerProperties().withPeerings(peerings); - return this; - } - - /** - * Get the serviceKey property: The ServiceKey. - * - * @return the serviceKey value. - */ - public String serviceKey() { - return this.innerProperties() == null ? null : this.innerProperties().serviceKey(); - } - - /** - * Set the serviceKey property: The ServiceKey. - * - * @param serviceKey the serviceKey value to set. - * @return the ExpressRouteCircuitInner object itself. - */ - public ExpressRouteCircuitInner withServiceKey(String serviceKey) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpressRouteCircuitPropertiesFormat(); - } - this.innerProperties().withServiceKey(serviceKey); - return this; - } - - /** - * Get the serviceProviderNotes property: The ServiceProviderNotes. - * - * @return the serviceProviderNotes value. - */ - public String serviceProviderNotes() { - return this.innerProperties() == null ? null : this.innerProperties().serviceProviderNotes(); - } - - /** - * Set the serviceProviderNotes property: The ServiceProviderNotes. - * - * @param serviceProviderNotes the serviceProviderNotes value to set. - * @return the ExpressRouteCircuitInner object itself. - */ - public ExpressRouteCircuitInner withServiceProviderNotes(String serviceProviderNotes) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpressRouteCircuitPropertiesFormat(); - } - this.innerProperties().withServiceProviderNotes(serviceProviderNotes); - return this; - } - - /** - * Get the serviceProviderProperties property: The ServiceProviderProperties. - * - * @return the serviceProviderProperties value. - */ - public ExpressRouteCircuitServiceProviderProperties serviceProviderProperties() { - return this.innerProperties() == null ? null : this.innerProperties().serviceProviderProperties(); - } - - /** - * Set the serviceProviderProperties property: The ServiceProviderProperties. - * - * @param serviceProviderProperties the serviceProviderProperties value to set. - * @return the ExpressRouteCircuitInner object itself. - */ - public ExpressRouteCircuitInner withServiceProviderProperties( - ExpressRouteCircuitServiceProviderProperties serviceProviderProperties) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpressRouteCircuitPropertiesFormat(); - } - this.innerProperties().withServiceProviderProperties(serviceProviderProperties); - return this; - } - - /** - * Get the expressRoutePort property: The reference to the ExpressRoutePort resource when the circuit is provisioned - * on an ExpressRoutePort resource. - * - * @return the expressRoutePort value. - */ - public SubResource expressRoutePort() { - return this.innerProperties() == null ? null : this.innerProperties().expressRoutePort(); - } - - /** - * Set the expressRoutePort property: The reference to the ExpressRoutePort resource when the circuit is provisioned - * on an ExpressRoutePort resource. - * - * @param expressRoutePort the expressRoutePort value to set. - * @return the ExpressRouteCircuitInner object itself. - */ - public ExpressRouteCircuitInner withExpressRoutePort(SubResource expressRoutePort) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpressRouteCircuitPropertiesFormat(); - } - this.innerProperties().withExpressRoutePort(expressRoutePort); - return this; - } - - /** - * Get the bandwidthInGbps property: The bandwidth of the circuit when the circuit is provisioned on an - * ExpressRoutePort resource. - * - * @return the bandwidthInGbps value. - */ - public Float bandwidthInGbps() { - return this.innerProperties() == null ? null : this.innerProperties().bandwidthInGbps(); - } - - /** - * Set the bandwidthInGbps property: The bandwidth of the circuit when the circuit is provisioned on an - * ExpressRoutePort resource. - * - * @param bandwidthInGbps the bandwidthInGbps value to set. - * @return the ExpressRouteCircuitInner object itself. - */ - public ExpressRouteCircuitInner withBandwidthInGbps(Float bandwidthInGbps) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpressRouteCircuitPropertiesFormat(); - } - this.innerProperties().withBandwidthInGbps(bandwidthInGbps); - return this; - } - - /** - * Get the stag property: The identifier of the circuit traffic. Outer tag for QinQ encapsulation. - * - * @return the stag value. - */ - public Integer stag() { - return this.innerProperties() == null ? null : this.innerProperties().stag(); - } - - /** - * Get the provisioningState property: Gets the provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Set the provisioningState property: Gets the provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param provisioningState the provisioningState value to set. - * @return the ExpressRouteCircuitInner object itself. - */ - public ExpressRouteCircuitInner withProvisioningState(String provisioningState) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpressRouteCircuitPropertiesFormat(); - } - this.innerProperties().withProvisioningState(provisioningState); - return this; - } - - /** - * Get the gatewayManagerEtag property: The GatewayManager Etag. - * - * @return the gatewayManagerEtag value. - */ - public String gatewayManagerEtag() { - return this.innerProperties() == null ? null : this.innerProperties().gatewayManagerEtag(); - } - - /** - * Set the gatewayManagerEtag property: The GatewayManager Etag. - * - * @param gatewayManagerEtag the gatewayManagerEtag value to set. - * @return the ExpressRouteCircuitInner object itself. - */ - public ExpressRouteCircuitInner withGatewayManagerEtag(String gatewayManagerEtag) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpressRouteCircuitPropertiesFormat(); - } - this.innerProperties().withGatewayManagerEtag(gatewayManagerEtag); - return this; - } - - /** - * Get the allowGlobalReach property: Flag to enable Global Reach on the circuit. - * - * @return the allowGlobalReach value. - */ - public Boolean allowGlobalReach() { - return this.innerProperties() == null ? null : this.innerProperties().allowGlobalReach(); - } - - /** - * Set the allowGlobalReach property: Flag to enable Global Reach on the circuit. - * - * @param allowGlobalReach the allowGlobalReach value to set. - * @return the ExpressRouteCircuitInner object itself. - */ - public ExpressRouteCircuitInner withAllowGlobalReach(Boolean allowGlobalReach) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpressRouteCircuitPropertiesFormat(); - } - this.innerProperties().withAllowGlobalReach(allowGlobalReach); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (sku() != null) { - sku().validate(); - } - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRouteCircuitPeeringInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRouteCircuitPeeringInner.java deleted file mode 100644 index 1be37b3eb5f0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRouteCircuitPeeringInner.java +++ /dev/null @@ -1,543 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.ExpressRouteCircuitPeeringConfig; -import com.azure.resourcemanager.network.models.ExpressRouteConnectionId; -import com.azure.resourcemanager.network.models.ExpressRoutePeeringState; -import com.azure.resourcemanager.network.models.ExpressRoutePeeringType; -import com.azure.resourcemanager.network.models.Ipv6ExpressRouteCircuitPeeringConfig; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Peering in an ExpressRouteCircuit resource. */ -@Fluent -public final class ExpressRouteCircuitPeeringInner extends SubResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitPeeringInner.class); - - /* - * The properties property. - */ - @JsonProperty(value = "properties") - private ExpressRouteCircuitPeeringPropertiesFormatInner innerProperties; - - /* - * Gets name of the resource that is unique within a resource group. This - * name can be used to access the resource. - */ - @JsonProperty(value = "name") - private String name; - - /* - * A unique read-only string that changes whenever the resource is updated. - */ - @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) - private String etag; - - /** - * Get the innerProperties property: The properties property. - * - * @return the innerProperties value. - */ - private ExpressRouteCircuitPeeringPropertiesFormatInner innerProperties() { - return this.innerProperties; - } - - /** - * Get the name property: Gets name of the resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Gets name of the resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @param name the name value to set. - * @return the ExpressRouteCircuitPeeringInner object itself. - */ - public ExpressRouteCircuitPeeringInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** {@inheritDoc} */ - @Override - public ExpressRouteCircuitPeeringInner withId(String id) { - super.withId(id); - return this; - } - - /** - * Get the peeringType property: The peering type. - * - * @return the peeringType value. - */ - public ExpressRoutePeeringType peeringType() { - return this.innerProperties() == null ? null : this.innerProperties().peeringType(); - } - - /** - * Set the peeringType property: The peering type. - * - * @param peeringType the peeringType value to set. - * @return the ExpressRouteCircuitPeeringInner object itself. - */ - public ExpressRouteCircuitPeeringInner withPeeringType(ExpressRoutePeeringType peeringType) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpressRouteCircuitPeeringPropertiesFormatInner(); - } - this.innerProperties().withPeeringType(peeringType); - return this; - } - - /** - * Get the state property: The peering state. - * - * @return the state value. - */ - public ExpressRoutePeeringState state() { - return this.innerProperties() == null ? null : this.innerProperties().state(); - } - - /** - * Set the state property: The peering state. - * - * @param state the state value to set. - * @return the ExpressRouteCircuitPeeringInner object itself. - */ - public ExpressRouteCircuitPeeringInner withState(ExpressRoutePeeringState state) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpressRouteCircuitPeeringPropertiesFormatInner(); - } - this.innerProperties().withState(state); - return this; - } - - /** - * Get the azureAsn property: The Azure ASN. - * - * @return the azureAsn value. - */ - public Integer azureAsn() { - return this.innerProperties() == null ? null : this.innerProperties().azureAsn(); - } - - /** - * Set the azureAsn property: The Azure ASN. - * - * @param azureAsn the azureAsn value to set. - * @return the ExpressRouteCircuitPeeringInner object itself. - */ - public ExpressRouteCircuitPeeringInner withAzureAsn(Integer azureAsn) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpressRouteCircuitPeeringPropertiesFormatInner(); - } - this.innerProperties().withAzureAsn(azureAsn); - return this; - } - - /** - * Get the peerAsn property: The peer ASN. - * - * @return the peerAsn value. - */ - public Long peerAsn() { - return this.innerProperties() == null ? null : this.innerProperties().peerAsn(); - } - - /** - * Set the peerAsn property: The peer ASN. - * - * @param peerAsn the peerAsn value to set. - * @return the ExpressRouteCircuitPeeringInner object itself. - */ - public ExpressRouteCircuitPeeringInner withPeerAsn(Long peerAsn) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpressRouteCircuitPeeringPropertiesFormatInner(); - } - this.innerProperties().withPeerAsn(peerAsn); - return this; - } - - /** - * Get the primaryPeerAddressPrefix property: The primary address prefix. - * - * @return the primaryPeerAddressPrefix value. - */ - public String primaryPeerAddressPrefix() { - return this.innerProperties() == null ? null : this.innerProperties().primaryPeerAddressPrefix(); - } - - /** - * Set the primaryPeerAddressPrefix property: The primary address prefix. - * - * @param primaryPeerAddressPrefix the primaryPeerAddressPrefix value to set. - * @return the ExpressRouteCircuitPeeringInner object itself. - */ - public ExpressRouteCircuitPeeringInner withPrimaryPeerAddressPrefix(String primaryPeerAddressPrefix) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpressRouteCircuitPeeringPropertiesFormatInner(); - } - this.innerProperties().withPrimaryPeerAddressPrefix(primaryPeerAddressPrefix); - return this; - } - - /** - * Get the secondaryPeerAddressPrefix property: The secondary address prefix. - * - * @return the secondaryPeerAddressPrefix value. - */ - public String secondaryPeerAddressPrefix() { - return this.innerProperties() == null ? null : this.innerProperties().secondaryPeerAddressPrefix(); - } - - /** - * Set the secondaryPeerAddressPrefix property: The secondary address prefix. - * - * @param secondaryPeerAddressPrefix the secondaryPeerAddressPrefix value to set. - * @return the ExpressRouteCircuitPeeringInner object itself. - */ - public ExpressRouteCircuitPeeringInner withSecondaryPeerAddressPrefix(String secondaryPeerAddressPrefix) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpressRouteCircuitPeeringPropertiesFormatInner(); - } - this.innerProperties().withSecondaryPeerAddressPrefix(secondaryPeerAddressPrefix); - return this; - } - - /** - * Get the primaryAzurePort property: The primary port. - * - * @return the primaryAzurePort value. - */ - public String primaryAzurePort() { - return this.innerProperties() == null ? null : this.innerProperties().primaryAzurePort(); - } - - /** - * Set the primaryAzurePort property: The primary port. - * - * @param primaryAzurePort the primaryAzurePort value to set. - * @return the ExpressRouteCircuitPeeringInner object itself. - */ - public ExpressRouteCircuitPeeringInner withPrimaryAzurePort(String primaryAzurePort) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpressRouteCircuitPeeringPropertiesFormatInner(); - } - this.innerProperties().withPrimaryAzurePort(primaryAzurePort); - return this; - } - - /** - * Get the secondaryAzurePort property: The secondary port. - * - * @return the secondaryAzurePort value. - */ - public String secondaryAzurePort() { - return this.innerProperties() == null ? null : this.innerProperties().secondaryAzurePort(); - } - - /** - * Set the secondaryAzurePort property: The secondary port. - * - * @param secondaryAzurePort the secondaryAzurePort value to set. - * @return the ExpressRouteCircuitPeeringInner object itself. - */ - public ExpressRouteCircuitPeeringInner withSecondaryAzurePort(String secondaryAzurePort) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpressRouteCircuitPeeringPropertiesFormatInner(); - } - this.innerProperties().withSecondaryAzurePort(secondaryAzurePort); - return this; - } - - /** - * Get the sharedKey property: The shared key. - * - * @return the sharedKey value. - */ - public String sharedKey() { - return this.innerProperties() == null ? null : this.innerProperties().sharedKey(); - } - - /** - * Set the sharedKey property: The shared key. - * - * @param sharedKey the sharedKey value to set. - * @return the ExpressRouteCircuitPeeringInner object itself. - */ - public ExpressRouteCircuitPeeringInner withSharedKey(String sharedKey) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpressRouteCircuitPeeringPropertiesFormatInner(); - } - this.innerProperties().withSharedKey(sharedKey); - return this; - } - - /** - * Get the vlanId property: The VLAN ID. - * - * @return the vlanId value. - */ - public Integer vlanId() { - return this.innerProperties() == null ? null : this.innerProperties().vlanId(); - } - - /** - * Set the vlanId property: The VLAN ID. - * - * @param vlanId the vlanId value to set. - * @return the ExpressRouteCircuitPeeringInner object itself. - */ - public ExpressRouteCircuitPeeringInner withVlanId(Integer vlanId) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpressRouteCircuitPeeringPropertiesFormatInner(); - } - this.innerProperties().withVlanId(vlanId); - return this; - } - - /** - * Get the microsoftPeeringConfig property: The Microsoft peering configuration. - * - * @return the microsoftPeeringConfig value. - */ - public ExpressRouteCircuitPeeringConfig microsoftPeeringConfig() { - return this.innerProperties() == null ? null : this.innerProperties().microsoftPeeringConfig(); - } - - /** - * Set the microsoftPeeringConfig property: The Microsoft peering configuration. - * - * @param microsoftPeeringConfig the microsoftPeeringConfig value to set. - * @return the ExpressRouteCircuitPeeringInner object itself. - */ - public ExpressRouteCircuitPeeringInner withMicrosoftPeeringConfig( - ExpressRouteCircuitPeeringConfig microsoftPeeringConfig) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpressRouteCircuitPeeringPropertiesFormatInner(); - } - this.innerProperties().withMicrosoftPeeringConfig(microsoftPeeringConfig); - return this; - } - - /** - * Get the stats property: Gets peering stats. - * - * @return the stats value. - */ - public ExpressRouteCircuitStatsInner stats() { - return this.innerProperties() == null ? null : this.innerProperties().stats(); - } - - /** - * Set the stats property: Gets peering stats. - * - * @param stats the stats value to set. - * @return the ExpressRouteCircuitPeeringInner object itself. - */ - public ExpressRouteCircuitPeeringInner withStats(ExpressRouteCircuitStatsInner stats) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpressRouteCircuitPeeringPropertiesFormatInner(); - } - this.innerProperties().withStats(stats); - return this; - } - - /** - * Get the provisioningState property: Gets the provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Set the provisioningState property: Gets the provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param provisioningState the provisioningState value to set. - * @return the ExpressRouteCircuitPeeringInner object itself. - */ - public ExpressRouteCircuitPeeringInner withProvisioningState(String provisioningState) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpressRouteCircuitPeeringPropertiesFormatInner(); - } - this.innerProperties().withProvisioningState(provisioningState); - return this; - } - - /** - * Get the gatewayManagerEtag property: The GatewayManager Etag. - * - * @return the gatewayManagerEtag value. - */ - public String gatewayManagerEtag() { - return this.innerProperties() == null ? null : this.innerProperties().gatewayManagerEtag(); - } - - /** - * Set the gatewayManagerEtag property: The GatewayManager Etag. - * - * @param gatewayManagerEtag the gatewayManagerEtag value to set. - * @return the ExpressRouteCircuitPeeringInner object itself. - */ - public ExpressRouteCircuitPeeringInner withGatewayManagerEtag(String gatewayManagerEtag) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpressRouteCircuitPeeringPropertiesFormatInner(); - } - this.innerProperties().withGatewayManagerEtag(gatewayManagerEtag); - return this; - } - - /** - * Get the lastModifiedBy property: Gets whether the provider or the customer last modified the peering. - * - * @return the lastModifiedBy value. - */ - public String lastModifiedBy() { - return this.innerProperties() == null ? null : this.innerProperties().lastModifiedBy(); - } - - /** - * Set the lastModifiedBy property: Gets whether the provider or the customer last modified the peering. - * - * @param lastModifiedBy the lastModifiedBy value to set. - * @return the ExpressRouteCircuitPeeringInner object itself. - */ - public ExpressRouteCircuitPeeringInner withLastModifiedBy(String lastModifiedBy) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpressRouteCircuitPeeringPropertiesFormatInner(); - } - this.innerProperties().withLastModifiedBy(lastModifiedBy); - return this; - } - - /** - * Get the routeFilter property: The reference of the RouteFilter resource. - * - * @return the routeFilter value. - */ - public RouteFilterInner routeFilter() { - return this.innerProperties() == null ? null : this.innerProperties().routeFilter(); - } - - /** - * Set the routeFilter property: The reference of the RouteFilter resource. - * - * @param routeFilter the routeFilter value to set. - * @return the ExpressRouteCircuitPeeringInner object itself. - */ - public ExpressRouteCircuitPeeringInner withRouteFilter(RouteFilterInner routeFilter) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpressRouteCircuitPeeringPropertiesFormatInner(); - } - this.innerProperties().withRouteFilter(routeFilter); - return this; - } - - /** - * Get the ipv6PeeringConfig property: The IPv6 peering configuration. - * - * @return the ipv6PeeringConfig value. - */ - public Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig() { - return this.innerProperties() == null ? null : this.innerProperties().ipv6PeeringConfig(); - } - - /** - * Set the ipv6PeeringConfig property: The IPv6 peering configuration. - * - * @param ipv6PeeringConfig the ipv6PeeringConfig value to set. - * @return the ExpressRouteCircuitPeeringInner object itself. - */ - public ExpressRouteCircuitPeeringInner withIpv6PeeringConfig( - Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpressRouteCircuitPeeringPropertiesFormatInner(); - } - this.innerProperties().withIpv6PeeringConfig(ipv6PeeringConfig); - return this; - } - - /** - * Get the expressRouteConnection property: The ExpressRoute connection. - * - * @return the expressRouteConnection value. - */ - public ExpressRouteConnectionId expressRouteConnection() { - return this.innerProperties() == null ? null : this.innerProperties().expressRouteConnection(); - } - - /** - * Set the expressRouteConnection property: The ExpressRoute connection. - * - * @param expressRouteConnection the expressRouteConnection value to set. - * @return the ExpressRouteCircuitPeeringInner object itself. - */ - public ExpressRouteCircuitPeeringInner withExpressRouteConnection(ExpressRouteConnectionId expressRouteConnection) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpressRouteCircuitPeeringPropertiesFormatInner(); - } - this.innerProperties().withExpressRouteConnection(expressRouteConnection); - return this; - } - - /** - * Get the connections property: The list of circuit connections associated with Azure Private Peering for this - * circuit. - * - * @return the connections value. - */ - public List connections() { - return this.innerProperties() == null ? null : this.innerProperties().connections(); - } - - /** - * Set the connections property: The list of circuit connections associated with Azure Private Peering for this - * circuit. - * - * @param connections the connections value to set. - * @return the ExpressRouteCircuitPeeringInner object itself. - */ - public ExpressRouteCircuitPeeringInner withConnections(List connections) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpressRouteCircuitPeeringPropertiesFormatInner(); - } - this.innerProperties().withConnections(connections); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRouteCircuitPeeringPropertiesFormatInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRouteCircuitPeeringPropertiesFormatInner.java deleted file mode 100644 index e7325906b085..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRouteCircuitPeeringPropertiesFormatInner.java +++ /dev/null @@ -1,555 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.ExpressRouteCircuitPeeringConfig; -import com.azure.resourcemanager.network.models.ExpressRouteConnectionId; -import com.azure.resourcemanager.network.models.ExpressRoutePeeringState; -import com.azure.resourcemanager.network.models.ExpressRoutePeeringType; -import com.azure.resourcemanager.network.models.Ipv6ExpressRouteCircuitPeeringConfig; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The ExpressRouteCircuitPeeringPropertiesFormat model. */ -@Fluent -public final class ExpressRouteCircuitPeeringPropertiesFormatInner { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitPeeringPropertiesFormatInner.class); - - /* - * The peering type. - */ - @JsonProperty(value = "peeringType") - private ExpressRoutePeeringType peeringType; - - /* - * The peering state. - */ - @JsonProperty(value = "state") - private ExpressRoutePeeringState state; - - /* - * The Azure ASN. - */ - @JsonProperty(value = "azureASN") - private Integer azureAsn; - - /* - * The peer ASN. - */ - @JsonProperty(value = "peerASN") - private Long peerAsn; - - /* - * The primary address prefix. - */ - @JsonProperty(value = "primaryPeerAddressPrefix") - private String primaryPeerAddressPrefix; - - /* - * The secondary address prefix. - */ - @JsonProperty(value = "secondaryPeerAddressPrefix") - private String secondaryPeerAddressPrefix; - - /* - * The primary port. - */ - @JsonProperty(value = "primaryAzurePort") - private String primaryAzurePort; - - /* - * The secondary port. - */ - @JsonProperty(value = "secondaryAzurePort") - private String secondaryAzurePort; - - /* - * The shared key. - */ - @JsonProperty(value = "sharedKey") - private String sharedKey; - - /* - * The VLAN ID. - */ - @JsonProperty(value = "vlanId") - private Integer vlanId; - - /* - * The Microsoft peering configuration. - */ - @JsonProperty(value = "microsoftPeeringConfig") - private ExpressRouteCircuitPeeringConfig microsoftPeeringConfig; - - /* - * Gets peering stats. - */ - @JsonProperty(value = "stats") - private ExpressRouteCircuitStatsInner stats; - - /* - * Gets the provisioning state of the public IP resource. Possible values - * are: 'Updating', 'Deleting', and 'Failed'. - */ - @JsonProperty(value = "provisioningState") - private String provisioningState; - - /* - * The GatewayManager Etag. - */ - @JsonProperty(value = "gatewayManagerEtag") - private String gatewayManagerEtag; - - /* - * Gets whether the provider or the customer last modified the peering. - */ - @JsonProperty(value = "lastModifiedBy") - private String lastModifiedBy; - - /* - * The reference of the RouteFilter resource. - */ - @JsonProperty(value = "routeFilter") - private RouteFilterInner routeFilter; - - /* - * The IPv6 peering configuration. - */ - @JsonProperty(value = "ipv6PeeringConfig") - private Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig; - - /* - * The ExpressRoute connection. - */ - @JsonProperty(value = "expressRouteConnection") - private ExpressRouteConnectionId expressRouteConnection; - - /* - * The list of circuit connections associated with Azure Private Peering - * for this circuit. - */ - @JsonProperty(value = "connections") - private List connections; - - /** - * Get the peeringType property: The peering type. - * - * @return the peeringType value. - */ - public ExpressRoutePeeringType peeringType() { - return this.peeringType; - } - - /** - * Set the peeringType property: The peering type. - * - * @param peeringType the peeringType value to set. - * @return the ExpressRouteCircuitPeeringPropertiesFormatInner object itself. - */ - public ExpressRouteCircuitPeeringPropertiesFormatInner withPeeringType(ExpressRoutePeeringType peeringType) { - this.peeringType = peeringType; - return this; - } - - /** - * Get the state property: The peering state. - * - * @return the state value. - */ - public ExpressRoutePeeringState state() { - return this.state; - } - - /** - * Set the state property: The peering state. - * - * @param state the state value to set. - * @return the ExpressRouteCircuitPeeringPropertiesFormatInner object itself. - */ - public ExpressRouteCircuitPeeringPropertiesFormatInner withState(ExpressRoutePeeringState state) { - this.state = state; - return this; - } - - /** - * Get the azureAsn property: The Azure ASN. - * - * @return the azureAsn value. - */ - public Integer azureAsn() { - return this.azureAsn; - } - - /** - * Set the azureAsn property: The Azure ASN. - * - * @param azureAsn the azureAsn value to set. - * @return the ExpressRouteCircuitPeeringPropertiesFormatInner object itself. - */ - public ExpressRouteCircuitPeeringPropertiesFormatInner withAzureAsn(Integer azureAsn) { - this.azureAsn = azureAsn; - return this; - } - - /** - * Get the peerAsn property: The peer ASN. - * - * @return the peerAsn value. - */ - public Long peerAsn() { - return this.peerAsn; - } - - /** - * Set the peerAsn property: The peer ASN. - * - * @param peerAsn the peerAsn value to set. - * @return the ExpressRouteCircuitPeeringPropertiesFormatInner object itself. - */ - public ExpressRouteCircuitPeeringPropertiesFormatInner withPeerAsn(Long peerAsn) { - this.peerAsn = peerAsn; - return this; - } - - /** - * Get the primaryPeerAddressPrefix property: The primary address prefix. - * - * @return the primaryPeerAddressPrefix value. - */ - public String primaryPeerAddressPrefix() { - return this.primaryPeerAddressPrefix; - } - - /** - * Set the primaryPeerAddressPrefix property: The primary address prefix. - * - * @param primaryPeerAddressPrefix the primaryPeerAddressPrefix value to set. - * @return the ExpressRouteCircuitPeeringPropertiesFormatInner object itself. - */ - public ExpressRouteCircuitPeeringPropertiesFormatInner withPrimaryPeerAddressPrefix( - String primaryPeerAddressPrefix) { - this.primaryPeerAddressPrefix = primaryPeerAddressPrefix; - return this; - } - - /** - * Get the secondaryPeerAddressPrefix property: The secondary address prefix. - * - * @return the secondaryPeerAddressPrefix value. - */ - public String secondaryPeerAddressPrefix() { - return this.secondaryPeerAddressPrefix; - } - - /** - * Set the secondaryPeerAddressPrefix property: The secondary address prefix. - * - * @param secondaryPeerAddressPrefix the secondaryPeerAddressPrefix value to set. - * @return the ExpressRouteCircuitPeeringPropertiesFormatInner object itself. - */ - public ExpressRouteCircuitPeeringPropertiesFormatInner withSecondaryPeerAddressPrefix( - String secondaryPeerAddressPrefix) { - this.secondaryPeerAddressPrefix = secondaryPeerAddressPrefix; - return this; - } - - /** - * Get the primaryAzurePort property: The primary port. - * - * @return the primaryAzurePort value. - */ - public String primaryAzurePort() { - return this.primaryAzurePort; - } - - /** - * Set the primaryAzurePort property: The primary port. - * - * @param primaryAzurePort the primaryAzurePort value to set. - * @return the ExpressRouteCircuitPeeringPropertiesFormatInner object itself. - */ - public ExpressRouteCircuitPeeringPropertiesFormatInner withPrimaryAzurePort(String primaryAzurePort) { - this.primaryAzurePort = primaryAzurePort; - return this; - } - - /** - * Get the secondaryAzurePort property: The secondary port. - * - * @return the secondaryAzurePort value. - */ - public String secondaryAzurePort() { - return this.secondaryAzurePort; - } - - /** - * Set the secondaryAzurePort property: The secondary port. - * - * @param secondaryAzurePort the secondaryAzurePort value to set. - * @return the ExpressRouteCircuitPeeringPropertiesFormatInner object itself. - */ - public ExpressRouteCircuitPeeringPropertiesFormatInner withSecondaryAzurePort(String secondaryAzurePort) { - this.secondaryAzurePort = secondaryAzurePort; - return this; - } - - /** - * Get the sharedKey property: The shared key. - * - * @return the sharedKey value. - */ - public String sharedKey() { - return this.sharedKey; - } - - /** - * Set the sharedKey property: The shared key. - * - * @param sharedKey the sharedKey value to set. - * @return the ExpressRouteCircuitPeeringPropertiesFormatInner object itself. - */ - public ExpressRouteCircuitPeeringPropertiesFormatInner withSharedKey(String sharedKey) { - this.sharedKey = sharedKey; - return this; - } - - /** - * Get the vlanId property: The VLAN ID. - * - * @return the vlanId value. - */ - public Integer vlanId() { - return this.vlanId; - } - - /** - * Set the vlanId property: The VLAN ID. - * - * @param vlanId the vlanId value to set. - * @return the ExpressRouteCircuitPeeringPropertiesFormatInner object itself. - */ - public ExpressRouteCircuitPeeringPropertiesFormatInner withVlanId(Integer vlanId) { - this.vlanId = vlanId; - return this; - } - - /** - * Get the microsoftPeeringConfig property: The Microsoft peering configuration. - * - * @return the microsoftPeeringConfig value. - */ - public ExpressRouteCircuitPeeringConfig microsoftPeeringConfig() { - return this.microsoftPeeringConfig; - } - - /** - * Set the microsoftPeeringConfig property: The Microsoft peering configuration. - * - * @param microsoftPeeringConfig the microsoftPeeringConfig value to set. - * @return the ExpressRouteCircuitPeeringPropertiesFormatInner object itself. - */ - public ExpressRouteCircuitPeeringPropertiesFormatInner withMicrosoftPeeringConfig( - ExpressRouteCircuitPeeringConfig microsoftPeeringConfig) { - this.microsoftPeeringConfig = microsoftPeeringConfig; - return this; - } - - /** - * Get the stats property: Gets peering stats. - * - * @return the stats value. - */ - public ExpressRouteCircuitStatsInner stats() { - return this.stats; - } - - /** - * Set the stats property: Gets peering stats. - * - * @param stats the stats value to set. - * @return the ExpressRouteCircuitPeeringPropertiesFormatInner object itself. - */ - public ExpressRouteCircuitPeeringPropertiesFormatInner withStats(ExpressRouteCircuitStatsInner stats) { - this.stats = stats; - return this; - } - - /** - * Get the provisioningState property: Gets the provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Set the provisioningState property: Gets the provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param provisioningState the provisioningState value to set. - * @return the ExpressRouteCircuitPeeringPropertiesFormatInner object itself. - */ - public ExpressRouteCircuitPeeringPropertiesFormatInner withProvisioningState(String provisioningState) { - this.provisioningState = provisioningState; - return this; - } - - /** - * Get the gatewayManagerEtag property: The GatewayManager Etag. - * - * @return the gatewayManagerEtag value. - */ - public String gatewayManagerEtag() { - return this.gatewayManagerEtag; - } - - /** - * Set the gatewayManagerEtag property: The GatewayManager Etag. - * - * @param gatewayManagerEtag the gatewayManagerEtag value to set. - * @return the ExpressRouteCircuitPeeringPropertiesFormatInner object itself. - */ - public ExpressRouteCircuitPeeringPropertiesFormatInner withGatewayManagerEtag(String gatewayManagerEtag) { - this.gatewayManagerEtag = gatewayManagerEtag; - return this; - } - - /** - * Get the lastModifiedBy property: Gets whether the provider or the customer last modified the peering. - * - * @return the lastModifiedBy value. - */ - public String lastModifiedBy() { - return this.lastModifiedBy; - } - - /** - * Set the lastModifiedBy property: Gets whether the provider or the customer last modified the peering. - * - * @param lastModifiedBy the lastModifiedBy value to set. - * @return the ExpressRouteCircuitPeeringPropertiesFormatInner object itself. - */ - public ExpressRouteCircuitPeeringPropertiesFormatInner withLastModifiedBy(String lastModifiedBy) { - this.lastModifiedBy = lastModifiedBy; - return this; - } - - /** - * Get the routeFilter property: The reference of the RouteFilter resource. - * - * @return the routeFilter value. - */ - public RouteFilterInner routeFilter() { - return this.routeFilter; - } - - /** - * Set the routeFilter property: The reference of the RouteFilter resource. - * - * @param routeFilter the routeFilter value to set. - * @return the ExpressRouteCircuitPeeringPropertiesFormatInner object itself. - */ - public ExpressRouteCircuitPeeringPropertiesFormatInner withRouteFilter(RouteFilterInner routeFilter) { - this.routeFilter = routeFilter; - return this; - } - - /** - * Get the ipv6PeeringConfig property: The IPv6 peering configuration. - * - * @return the ipv6PeeringConfig value. - */ - public Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig() { - return this.ipv6PeeringConfig; - } - - /** - * Set the ipv6PeeringConfig property: The IPv6 peering configuration. - * - * @param ipv6PeeringConfig the ipv6PeeringConfig value to set. - * @return the ExpressRouteCircuitPeeringPropertiesFormatInner object itself. - */ - public ExpressRouteCircuitPeeringPropertiesFormatInner withIpv6PeeringConfig( - Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig) { - this.ipv6PeeringConfig = ipv6PeeringConfig; - return this; - } - - /** - * Get the expressRouteConnection property: The ExpressRoute connection. - * - * @return the expressRouteConnection value. - */ - public ExpressRouteConnectionId expressRouteConnection() { - return this.expressRouteConnection; - } - - /** - * Set the expressRouteConnection property: The ExpressRoute connection. - * - * @param expressRouteConnection the expressRouteConnection value to set. - * @return the ExpressRouteCircuitPeeringPropertiesFormatInner object itself. - */ - public ExpressRouteCircuitPeeringPropertiesFormatInner withExpressRouteConnection( - ExpressRouteConnectionId expressRouteConnection) { - this.expressRouteConnection = expressRouteConnection; - return this; - } - - /** - * Get the connections property: The list of circuit connections associated with Azure Private Peering for this - * circuit. - * - * @return the connections value. - */ - public List connections() { - return this.connections; - } - - /** - * Set the connections property: The list of circuit connections associated with Azure Private Peering for this - * circuit. - * - * @param connections the connections value to set. - * @return the ExpressRouteCircuitPeeringPropertiesFormatInner object itself. - */ - public ExpressRouteCircuitPeeringPropertiesFormatInner withConnections( - List connections) { - this.connections = connections; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (microsoftPeeringConfig() != null) { - microsoftPeeringConfig().validate(); - } - if (stats() != null) { - stats().validate(); - } - if (routeFilter() != null) { - routeFilter().validate(); - } - if (ipv6PeeringConfig() != null) { - ipv6PeeringConfig().validate(); - } - if (expressRouteConnection() != null) { - expressRouteConnection().validate(); - } - if (connections() != null) { - connections().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRouteCircuitPropertiesFormat.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRouteCircuitPropertiesFormat.java deleted file mode 100644 index 894b3507e535..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRouteCircuitPropertiesFormat.java +++ /dev/null @@ -1,406 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.ExpressRouteCircuitServiceProviderProperties; -import com.azure.resourcemanager.network.models.ServiceProviderProvisioningState; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Properties of ExpressRouteCircuit. */ -@Fluent -public final class ExpressRouteCircuitPropertiesFormat { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitPropertiesFormat.class); - - /* - * Allow classic operations - */ - @JsonProperty(value = "allowClassicOperations") - private Boolean allowClassicOperations; - - /* - * The CircuitProvisioningState state of the resource. - */ - @JsonProperty(value = "circuitProvisioningState") - private String circuitProvisioningState; - - /* - * The ServiceProviderProvisioningState state of the resource. Possible - * values are 'NotProvisioned', 'Provisioning', 'Provisioned', and - * 'Deprovisioning'. - */ - @JsonProperty(value = "serviceProviderProvisioningState") - private ServiceProviderProvisioningState serviceProviderProvisioningState; - - /* - * The list of authorizations. - */ - @JsonProperty(value = "authorizations") - private List authorizations; - - /* - * The list of peerings. - */ - @JsonProperty(value = "peerings") - private List peerings; - - /* - * The ServiceKey. - */ - @JsonProperty(value = "serviceKey") - private String serviceKey; - - /* - * The ServiceProviderNotes. - */ - @JsonProperty(value = "serviceProviderNotes") - private String serviceProviderNotes; - - /* - * The ServiceProviderProperties. - */ - @JsonProperty(value = "serviceProviderProperties") - private ExpressRouteCircuitServiceProviderProperties serviceProviderProperties; - - /* - * The reference to the ExpressRoutePort resource when the circuit is - * provisioned on an ExpressRoutePort resource. - */ - @JsonProperty(value = "expressRoutePort") - private SubResource expressRoutePort; - - /* - * The bandwidth of the circuit when the circuit is provisioned on an - * ExpressRoutePort resource. - */ - @JsonProperty(value = "bandwidthInGbps") - private Float bandwidthInGbps; - - /* - * The identifier of the circuit traffic. Outer tag for QinQ encapsulation. - */ - @JsonProperty(value = "stag", access = JsonProperty.Access.WRITE_ONLY) - private Integer stag; - - /* - * Gets the provisioning state of the public IP resource. Possible values - * are: 'Updating', 'Deleting', and 'Failed'. - */ - @JsonProperty(value = "provisioningState") - private String provisioningState; - - /* - * The GatewayManager Etag. - */ - @JsonProperty(value = "gatewayManagerEtag") - private String gatewayManagerEtag; - - /* - * Flag to enable Global Reach on the circuit. - */ - @JsonProperty(value = "allowGlobalReach") - private Boolean allowGlobalReach; - - /** - * Get the allowClassicOperations property: Allow classic operations. - * - * @return the allowClassicOperations value. - */ - public Boolean allowClassicOperations() { - return this.allowClassicOperations; - } - - /** - * Set the allowClassicOperations property: Allow classic operations. - * - * @param allowClassicOperations the allowClassicOperations value to set. - * @return the ExpressRouteCircuitPropertiesFormat object itself. - */ - public ExpressRouteCircuitPropertiesFormat withAllowClassicOperations(Boolean allowClassicOperations) { - this.allowClassicOperations = allowClassicOperations; - return this; - } - - /** - * Get the circuitProvisioningState property: The CircuitProvisioningState state of the resource. - * - * @return the circuitProvisioningState value. - */ - public String circuitProvisioningState() { - return this.circuitProvisioningState; - } - - /** - * Set the circuitProvisioningState property: The CircuitProvisioningState state of the resource. - * - * @param circuitProvisioningState the circuitProvisioningState value to set. - * @return the ExpressRouteCircuitPropertiesFormat object itself. - */ - public ExpressRouteCircuitPropertiesFormat withCircuitProvisioningState(String circuitProvisioningState) { - this.circuitProvisioningState = circuitProvisioningState; - return this; - } - - /** - * Get the serviceProviderProvisioningState property: The ServiceProviderProvisioningState state of the resource. - * Possible values are 'NotProvisioned', 'Provisioning', 'Provisioned', and 'Deprovisioning'. - * - * @return the serviceProviderProvisioningState value. - */ - public ServiceProviderProvisioningState serviceProviderProvisioningState() { - return this.serviceProviderProvisioningState; - } - - /** - * Set the serviceProviderProvisioningState property: The ServiceProviderProvisioningState state of the resource. - * Possible values are 'NotProvisioned', 'Provisioning', 'Provisioned', and 'Deprovisioning'. - * - * @param serviceProviderProvisioningState the serviceProviderProvisioningState value to set. - * @return the ExpressRouteCircuitPropertiesFormat object itself. - */ - public ExpressRouteCircuitPropertiesFormat withServiceProviderProvisioningState( - ServiceProviderProvisioningState serviceProviderProvisioningState) { - this.serviceProviderProvisioningState = serviceProviderProvisioningState; - return this; - } - - /** - * Get the authorizations property: The list of authorizations. - * - * @return the authorizations value. - */ - public List authorizations() { - return this.authorizations; - } - - /** - * Set the authorizations property: The list of authorizations. - * - * @param authorizations the authorizations value to set. - * @return the ExpressRouteCircuitPropertiesFormat object itself. - */ - public ExpressRouteCircuitPropertiesFormat withAuthorizations( - List authorizations) { - this.authorizations = authorizations; - return this; - } - - /** - * Get the peerings property: The list of peerings. - * - * @return the peerings value. - */ - public List peerings() { - return this.peerings; - } - - /** - * Set the peerings property: The list of peerings. - * - * @param peerings the peerings value to set. - * @return the ExpressRouteCircuitPropertiesFormat object itself. - */ - public ExpressRouteCircuitPropertiesFormat withPeerings(List peerings) { - this.peerings = peerings; - return this; - } - - /** - * Get the serviceKey property: The ServiceKey. - * - * @return the serviceKey value. - */ - public String serviceKey() { - return this.serviceKey; - } - - /** - * Set the serviceKey property: The ServiceKey. - * - * @param serviceKey the serviceKey value to set. - * @return the ExpressRouteCircuitPropertiesFormat object itself. - */ - public ExpressRouteCircuitPropertiesFormat withServiceKey(String serviceKey) { - this.serviceKey = serviceKey; - return this; - } - - /** - * Get the serviceProviderNotes property: The ServiceProviderNotes. - * - * @return the serviceProviderNotes value. - */ - public String serviceProviderNotes() { - return this.serviceProviderNotes; - } - - /** - * Set the serviceProviderNotes property: The ServiceProviderNotes. - * - * @param serviceProviderNotes the serviceProviderNotes value to set. - * @return the ExpressRouteCircuitPropertiesFormat object itself. - */ - public ExpressRouteCircuitPropertiesFormat withServiceProviderNotes(String serviceProviderNotes) { - this.serviceProviderNotes = serviceProviderNotes; - return this; - } - - /** - * Get the serviceProviderProperties property: The ServiceProviderProperties. - * - * @return the serviceProviderProperties value. - */ - public ExpressRouteCircuitServiceProviderProperties serviceProviderProperties() { - return this.serviceProviderProperties; - } - - /** - * Set the serviceProviderProperties property: The ServiceProviderProperties. - * - * @param serviceProviderProperties the serviceProviderProperties value to set. - * @return the ExpressRouteCircuitPropertiesFormat object itself. - */ - public ExpressRouteCircuitPropertiesFormat withServiceProviderProperties( - ExpressRouteCircuitServiceProviderProperties serviceProviderProperties) { - this.serviceProviderProperties = serviceProviderProperties; - return this; - } - - /** - * Get the expressRoutePort property: The reference to the ExpressRoutePort resource when the circuit is provisioned - * on an ExpressRoutePort resource. - * - * @return the expressRoutePort value. - */ - public SubResource expressRoutePort() { - return this.expressRoutePort; - } - - /** - * Set the expressRoutePort property: The reference to the ExpressRoutePort resource when the circuit is provisioned - * on an ExpressRoutePort resource. - * - * @param expressRoutePort the expressRoutePort value to set. - * @return the ExpressRouteCircuitPropertiesFormat object itself. - */ - public ExpressRouteCircuitPropertiesFormat withExpressRoutePort(SubResource expressRoutePort) { - this.expressRoutePort = expressRoutePort; - return this; - } - - /** - * Get the bandwidthInGbps property: The bandwidth of the circuit when the circuit is provisioned on an - * ExpressRoutePort resource. - * - * @return the bandwidthInGbps value. - */ - public Float bandwidthInGbps() { - return this.bandwidthInGbps; - } - - /** - * Set the bandwidthInGbps property: The bandwidth of the circuit when the circuit is provisioned on an - * ExpressRoutePort resource. - * - * @param bandwidthInGbps the bandwidthInGbps value to set. - * @return the ExpressRouteCircuitPropertiesFormat object itself. - */ - public ExpressRouteCircuitPropertiesFormat withBandwidthInGbps(Float bandwidthInGbps) { - this.bandwidthInGbps = bandwidthInGbps; - return this; - } - - /** - * Get the stag property: The identifier of the circuit traffic. Outer tag for QinQ encapsulation. - * - * @return the stag value. - */ - public Integer stag() { - return this.stag; - } - - /** - * Get the provisioningState property: Gets the provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Set the provisioningState property: Gets the provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param provisioningState the provisioningState value to set. - * @return the ExpressRouteCircuitPropertiesFormat object itself. - */ - public ExpressRouteCircuitPropertiesFormat withProvisioningState(String provisioningState) { - this.provisioningState = provisioningState; - return this; - } - - /** - * Get the gatewayManagerEtag property: The GatewayManager Etag. - * - * @return the gatewayManagerEtag value. - */ - public String gatewayManagerEtag() { - return this.gatewayManagerEtag; - } - - /** - * Set the gatewayManagerEtag property: The GatewayManager Etag. - * - * @param gatewayManagerEtag the gatewayManagerEtag value to set. - * @return the ExpressRouteCircuitPropertiesFormat object itself. - */ - public ExpressRouteCircuitPropertiesFormat withGatewayManagerEtag(String gatewayManagerEtag) { - this.gatewayManagerEtag = gatewayManagerEtag; - return this; - } - - /** - * Get the allowGlobalReach property: Flag to enable Global Reach on the circuit. - * - * @return the allowGlobalReach value. - */ - public Boolean allowGlobalReach() { - return this.allowGlobalReach; - } - - /** - * Set the allowGlobalReach property: Flag to enable Global Reach on the circuit. - * - * @param allowGlobalReach the allowGlobalReach value to set. - * @return the ExpressRouteCircuitPropertiesFormat object itself. - */ - public ExpressRouteCircuitPropertiesFormat withAllowGlobalReach(Boolean allowGlobalReach) { - this.allowGlobalReach = allowGlobalReach; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (authorizations() != null) { - authorizations().forEach(e -> e.validate()); - } - if (peerings() != null) { - peerings().forEach(e -> e.validate()); - } - if (serviceProviderProperties() != null) { - serviceProviderProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRouteCircuitStatsInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRouteCircuitStatsInner.java deleted file mode 100644 index 98eef7c2022e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRouteCircuitStatsInner.java +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Contains stats associated with the peering. */ -@Fluent -public final class ExpressRouteCircuitStatsInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitStatsInner.class); - - /* - * Gets BytesIn of the peering. - */ - @JsonProperty(value = "primarybytesIn") - private Long primarybytesIn; - - /* - * Gets BytesOut of the peering. - */ - @JsonProperty(value = "primarybytesOut") - private Long primarybytesOut; - - /* - * Gets BytesIn of the peering. - */ - @JsonProperty(value = "secondarybytesIn") - private Long secondarybytesIn; - - /* - * Gets BytesOut of the peering. - */ - @JsonProperty(value = "secondarybytesOut") - private Long secondarybytesOut; - - /** - * Get the primarybytesIn property: Gets BytesIn of the peering. - * - * @return the primarybytesIn value. - */ - public Long primarybytesIn() { - return this.primarybytesIn; - } - - /** - * Set the primarybytesIn property: Gets BytesIn of the peering. - * - * @param primarybytesIn the primarybytesIn value to set. - * @return the ExpressRouteCircuitStatsInner object itself. - */ - public ExpressRouteCircuitStatsInner withPrimarybytesIn(Long primarybytesIn) { - this.primarybytesIn = primarybytesIn; - return this; - } - - /** - * Get the primarybytesOut property: Gets BytesOut of the peering. - * - * @return the primarybytesOut value. - */ - public Long primarybytesOut() { - return this.primarybytesOut; - } - - /** - * Set the primarybytesOut property: Gets BytesOut of the peering. - * - * @param primarybytesOut the primarybytesOut value to set. - * @return the ExpressRouteCircuitStatsInner object itself. - */ - public ExpressRouteCircuitStatsInner withPrimarybytesOut(Long primarybytesOut) { - this.primarybytesOut = primarybytesOut; - return this; - } - - /** - * Get the secondarybytesIn property: Gets BytesIn of the peering. - * - * @return the secondarybytesIn value. - */ - public Long secondarybytesIn() { - return this.secondarybytesIn; - } - - /** - * Set the secondarybytesIn property: Gets BytesIn of the peering. - * - * @param secondarybytesIn the secondarybytesIn value to set. - * @return the ExpressRouteCircuitStatsInner object itself. - */ - public ExpressRouteCircuitStatsInner withSecondarybytesIn(Long secondarybytesIn) { - this.secondarybytesIn = secondarybytesIn; - return this; - } - - /** - * Get the secondarybytesOut property: Gets BytesOut of the peering. - * - * @return the secondarybytesOut value. - */ - public Long secondarybytesOut() { - return this.secondarybytesOut; - } - - /** - * Set the secondarybytesOut property: Gets BytesOut of the peering. - * - * @param secondarybytesOut the secondarybytesOut value to set. - * @return the ExpressRouteCircuitStatsInner object itself. - */ - public ExpressRouteCircuitStatsInner withSecondarybytesOut(Long secondarybytesOut) { - this.secondarybytesOut = secondarybytesOut; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRouteCircuitsArpTableListResultInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRouteCircuitsArpTableListResultInner.java deleted file mode 100644 index 1fdda7b0663d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRouteCircuitsArpTableListResultInner.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.ExpressRouteCircuitArpTable; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Response for ListArpTable associated with the Express Route Circuits API. */ -@Fluent -public final class ExpressRouteCircuitsArpTableListResultInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitsArpTableListResultInner.class); - - /* - * Gets list of the ARP table. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to get the next set of results. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: Gets list of the ARP table. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Gets list of the ARP table. - * - * @param value the value value to set. - * @return the ExpressRouteCircuitsArpTableListResultInner object itself. - */ - public ExpressRouteCircuitsArpTableListResultInner withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to get the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The URL to get the next set of results. - * - * @param nextLink the nextLink value to set. - * @return the ExpressRouteCircuitsArpTableListResultInner object itself. - */ - public ExpressRouteCircuitsArpTableListResultInner withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRouteCircuitsRoutesTableListResultInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRouteCircuitsRoutesTableListResultInner.java deleted file mode 100644 index de55a1ee7753..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRouteCircuitsRoutesTableListResultInner.java +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.ExpressRouteCircuitRoutesTable; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Response for ListRoutesTable associated with the Express Route Circuits API. */ -@Fluent -public final class ExpressRouteCircuitsRoutesTableListResultInner { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitsRoutesTableListResultInner.class); - - /* - * The list of routes table. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to get the next set of results. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: The list of routes table. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The list of routes table. - * - * @param value the value value to set. - * @return the ExpressRouteCircuitsRoutesTableListResultInner object itself. - */ - public ExpressRouteCircuitsRoutesTableListResultInner withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to get the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The URL to get the next set of results. - * - * @param nextLink the nextLink value to set. - * @return the ExpressRouteCircuitsRoutesTableListResultInner object itself. - */ - public ExpressRouteCircuitsRoutesTableListResultInner withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRouteCircuitsRoutesTableSummaryListResultInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRouteCircuitsRoutesTableSummaryListResultInner.java deleted file mode 100644 index b74bf2189634..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRouteCircuitsRoutesTableSummaryListResultInner.java +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.ExpressRouteCircuitRoutesTableSummary; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Response for ListRoutesTable associated with the Express Route Circuits API. */ -@Fluent -public final class ExpressRouteCircuitsRoutesTableSummaryListResultInner { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitsRoutesTableSummaryListResultInner.class); - - /* - * A list of the routes table. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to get the next set of results. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: A list of the routes table. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: A list of the routes table. - * - * @param value the value value to set. - * @return the ExpressRouteCircuitsRoutesTableSummaryListResultInner object itself. - */ - public ExpressRouteCircuitsRoutesTableSummaryListResultInner withValue( - List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to get the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The URL to get the next set of results. - * - * @param nextLink the nextLink value to set. - * @return the ExpressRouteCircuitsRoutesTableSummaryListResultInner object itself. - */ - public ExpressRouteCircuitsRoutesTableSummaryListResultInner withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRouteConnectionInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRouteConnectionInner.java deleted file mode 100644 index 53a83c842d8b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRouteConnectionInner.java +++ /dev/null @@ -1,163 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.ExpressRouteCircuitPeeringId; -import com.azure.resourcemanager.network.models.ProvisioningState; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** ExpressRouteConnection resource. */ -@Fluent -public final class ExpressRouteConnectionInner extends SubResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteConnectionInner.class); - - /* - * Properties of the ExpressRouteConnection subresource. - */ - @JsonProperty(value = "properties") - private ExpressRouteConnectionProperties innerProperties; - - /* - * The name of the resource. - */ - @JsonProperty(value = "name", required = true) - private String name; - - /** - * Get the innerProperties property: Properties of the ExpressRouteConnection subresource. - * - * @return the innerProperties value. - */ - private ExpressRouteConnectionProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the resource. - * - * @param name the name value to set. - * @return the ExpressRouteConnectionInner object itself. - */ - public ExpressRouteConnectionInner withName(String name) { - this.name = name; - return this; - } - - /** {@inheritDoc} */ - @Override - public ExpressRouteConnectionInner withId(String id) { - super.withId(id); - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the resource. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the expressRouteCircuitPeering property: The ExpressRoute circuit peering. - * - * @return the expressRouteCircuitPeering value. - */ - public ExpressRouteCircuitPeeringId expressRouteCircuitPeering() { - return this.innerProperties() == null ? null : this.innerProperties().expressRouteCircuitPeering(); - } - - /** - * Set the expressRouteCircuitPeering property: The ExpressRoute circuit peering. - * - * @param expressRouteCircuitPeering the expressRouteCircuitPeering value to set. - * @return the ExpressRouteConnectionInner object itself. - */ - public ExpressRouteConnectionInner withExpressRouteCircuitPeering( - ExpressRouteCircuitPeeringId expressRouteCircuitPeering) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpressRouteConnectionProperties(); - } - this.innerProperties().withExpressRouteCircuitPeering(expressRouteCircuitPeering); - return this; - } - - /** - * Get the authorizationKey property: Authorization key to establish the connection. - * - * @return the authorizationKey value. - */ - public String authorizationKey() { - return this.innerProperties() == null ? null : this.innerProperties().authorizationKey(); - } - - /** - * Set the authorizationKey property: Authorization key to establish the connection. - * - * @param authorizationKey the authorizationKey value to set. - * @return the ExpressRouteConnectionInner object itself. - */ - public ExpressRouteConnectionInner withAuthorizationKey(String authorizationKey) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpressRouteConnectionProperties(); - } - this.innerProperties().withAuthorizationKey(authorizationKey); - return this; - } - - /** - * Get the routingWeight property: The routing weight associated to the connection. - * - * @return the routingWeight value. - */ - public Integer routingWeight() { - return this.innerProperties() == null ? null : this.innerProperties().routingWeight(); - } - - /** - * Set the routingWeight property: The routing weight associated to the connection. - * - * @param routingWeight the routingWeight value to set. - * @return the ExpressRouteConnectionInner object itself. - */ - public ExpressRouteConnectionInner withRoutingWeight(Integer routingWeight) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpressRouteConnectionProperties(); - } - this.innerProperties().withRoutingWeight(routingWeight); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - if (name() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property name in model ExpressRouteConnectionInner")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRouteConnectionListInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRouteConnectionListInner.java deleted file mode 100644 index 1db69d768fa3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRouteConnectionListInner.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** ExpressRouteConnection list. */ -@Fluent -public final class ExpressRouteConnectionListInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteConnectionListInner.class); - - /* - * The list of ExpressRoute connections - */ - @JsonProperty(value = "value") - private List value; - - /** - * Get the value property: The list of ExpressRoute connections. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The list of ExpressRoute connections. - * - * @param value the value value to set. - * @return the ExpressRouteConnectionListInner object itself. - */ - public ExpressRouteConnectionListInner withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRouteConnectionProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRouteConnectionProperties.java deleted file mode 100644 index a21f2d6fc622..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRouteConnectionProperties.java +++ /dev/null @@ -1,129 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.ExpressRouteCircuitPeeringId; -import com.azure.resourcemanager.network.models.ProvisioningState; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Properties of the ExpressRouteConnection subresource. */ -@Fluent -public final class ExpressRouteConnectionProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteConnectionProperties.class); - - /* - * The provisioning state of the resource. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private ProvisioningState provisioningState; - - /* - * The ExpressRoute circuit peering. - */ - @JsonProperty(value = "expressRouteCircuitPeering", required = true) - private ExpressRouteCircuitPeeringId expressRouteCircuitPeering; - - /* - * Authorization key to establish the connection. - */ - @JsonProperty(value = "authorizationKey") - private String authorizationKey; - - /* - * The routing weight associated to the connection. - */ - @JsonProperty(value = "routingWeight") - private Integer routingWeight; - - /** - * Get the provisioningState property: The provisioning state of the resource. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Get the expressRouteCircuitPeering property: The ExpressRoute circuit peering. - * - * @return the expressRouteCircuitPeering value. - */ - public ExpressRouteCircuitPeeringId expressRouteCircuitPeering() { - return this.expressRouteCircuitPeering; - } - - /** - * Set the expressRouteCircuitPeering property: The ExpressRoute circuit peering. - * - * @param expressRouteCircuitPeering the expressRouteCircuitPeering value to set. - * @return the ExpressRouteConnectionProperties object itself. - */ - public ExpressRouteConnectionProperties withExpressRouteCircuitPeering( - ExpressRouteCircuitPeeringId expressRouteCircuitPeering) { - this.expressRouteCircuitPeering = expressRouteCircuitPeering; - return this; - } - - /** - * Get the authorizationKey property: Authorization key to establish the connection. - * - * @return the authorizationKey value. - */ - public String authorizationKey() { - return this.authorizationKey; - } - - /** - * Set the authorizationKey property: Authorization key to establish the connection. - * - * @param authorizationKey the authorizationKey value to set. - * @return the ExpressRouteConnectionProperties object itself. - */ - public ExpressRouteConnectionProperties withAuthorizationKey(String authorizationKey) { - this.authorizationKey = authorizationKey; - return this; - } - - /** - * Get the routingWeight property: The routing weight associated to the connection. - * - * @return the routingWeight value. - */ - public Integer routingWeight() { - return this.routingWeight; - } - - /** - * Set the routingWeight property: The routing weight associated to the connection. - * - * @param routingWeight the routingWeight value to set. - * @return the ExpressRouteConnectionProperties object itself. - */ - public ExpressRouteConnectionProperties withRoutingWeight(Integer routingWeight) { - this.routingWeight = routingWeight; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (expressRouteCircuitPeering() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property expressRouteCircuitPeering in model" - + " ExpressRouteConnectionProperties")); - } else { - expressRouteCircuitPeering().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRouteCrossConnectionInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRouteCrossConnectionInner.java deleted file mode 100644 index f69d1b095b6b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRouteCrossConnectionInner.java +++ /dev/null @@ -1,281 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.ExpressRouteCircuitReference; -import com.azure.resourcemanager.network.models.ServiceProviderProvisioningState; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** ExpressRouteCrossConnection resource. */ -@Fluent -public final class ExpressRouteCrossConnectionInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteCrossConnectionInner.class); - - /* - * Properties of ExpressRouteCrossConnection. - */ - @JsonProperty(value = "properties") - private ExpressRouteCrossConnectionProperties innerProperties; - - /* - * Gets a unique read-only string that changes whenever the resource is - * updated. - */ - @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) - private String etag; - - /* - * Resource ID. - */ - @JsonProperty(value = "id") - private String id; - - /** - * Get the innerProperties property: Properties of ExpressRouteCrossConnection. - * - * @return the innerProperties value. - */ - private ExpressRouteCrossConnectionProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the etag property: Gets a unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Get the id property: Resource ID. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: Resource ID. - * - * @param id the id value to set. - * @return the ExpressRouteCrossConnectionInner object itself. - */ - public ExpressRouteCrossConnectionInner withId(String id) { - this.id = id; - return this; - } - - /** {@inheritDoc} */ - @Override - public ExpressRouteCrossConnectionInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public ExpressRouteCrossConnectionInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the primaryAzurePort property: The name of the primary port. - * - * @return the primaryAzurePort value. - */ - public String primaryAzurePort() { - return this.innerProperties() == null ? null : this.innerProperties().primaryAzurePort(); - } - - /** - * Get the secondaryAzurePort property: The name of the secondary port. - * - * @return the secondaryAzurePort value. - */ - public String secondaryAzurePort() { - return this.innerProperties() == null ? null : this.innerProperties().secondaryAzurePort(); - } - - /** - * Get the stag property: The identifier of the circuit traffic. - * - * @return the stag value. - */ - public Integer stag() { - return this.innerProperties() == null ? null : this.innerProperties().stag(); - } - - /** - * Get the peeringLocation property: The peering location of the ExpressRoute circuit. - * - * @return the peeringLocation value. - */ - public String peeringLocation() { - return this.innerProperties() == null ? null : this.innerProperties().peeringLocation(); - } - - /** - * Set the peeringLocation property: The peering location of the ExpressRoute circuit. - * - * @param peeringLocation the peeringLocation value to set. - * @return the ExpressRouteCrossConnectionInner object itself. - */ - public ExpressRouteCrossConnectionInner withPeeringLocation(String peeringLocation) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpressRouteCrossConnectionProperties(); - } - this.innerProperties().withPeeringLocation(peeringLocation); - return this; - } - - /** - * Get the bandwidthInMbps property: The circuit bandwidth In Mbps. - * - * @return the bandwidthInMbps value. - */ - public Integer bandwidthInMbps() { - return this.innerProperties() == null ? null : this.innerProperties().bandwidthInMbps(); - } - - /** - * Set the bandwidthInMbps property: The circuit bandwidth In Mbps. - * - * @param bandwidthInMbps the bandwidthInMbps value to set. - * @return the ExpressRouteCrossConnectionInner object itself. - */ - public ExpressRouteCrossConnectionInner withBandwidthInMbps(Integer bandwidthInMbps) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpressRouteCrossConnectionProperties(); - } - this.innerProperties().withBandwidthInMbps(bandwidthInMbps); - return this; - } - - /** - * Get the expressRouteCircuit property: The ExpressRouteCircuit. - * - * @return the expressRouteCircuit value. - */ - public ExpressRouteCircuitReference expressRouteCircuit() { - return this.innerProperties() == null ? null : this.innerProperties().expressRouteCircuit(); - } - - /** - * Set the expressRouteCircuit property: The ExpressRouteCircuit. - * - * @param expressRouteCircuit the expressRouteCircuit value to set. - * @return the ExpressRouteCrossConnectionInner object itself. - */ - public ExpressRouteCrossConnectionInner withExpressRouteCircuit(ExpressRouteCircuitReference expressRouteCircuit) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpressRouteCrossConnectionProperties(); - } - this.innerProperties().withExpressRouteCircuit(expressRouteCircuit); - return this; - } - - /** - * Get the serviceProviderProvisioningState property: The provisioning state of the circuit in the connectivity - * provider system. Possible values are 'NotProvisioned', 'Provisioning', 'Provisioned'. - * - * @return the serviceProviderProvisioningState value. - */ - public ServiceProviderProvisioningState serviceProviderProvisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().serviceProviderProvisioningState(); - } - - /** - * Set the serviceProviderProvisioningState property: The provisioning state of the circuit in the connectivity - * provider system. Possible values are 'NotProvisioned', 'Provisioning', 'Provisioned'. - * - * @param serviceProviderProvisioningState the serviceProviderProvisioningState value to set. - * @return the ExpressRouteCrossConnectionInner object itself. - */ - public ExpressRouteCrossConnectionInner withServiceProviderProvisioningState( - ServiceProviderProvisioningState serviceProviderProvisioningState) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpressRouteCrossConnectionProperties(); - } - this.innerProperties().withServiceProviderProvisioningState(serviceProviderProvisioningState); - return this; - } - - /** - * Get the serviceProviderNotes property: Additional read only notes set by the connectivity provider. - * - * @return the serviceProviderNotes value. - */ - public String serviceProviderNotes() { - return this.innerProperties() == null ? null : this.innerProperties().serviceProviderNotes(); - } - - /** - * Set the serviceProviderNotes property: Additional read only notes set by the connectivity provider. - * - * @param serviceProviderNotes the serviceProviderNotes value to set. - * @return the ExpressRouteCrossConnectionInner object itself. - */ - public ExpressRouteCrossConnectionInner withServiceProviderNotes(String serviceProviderNotes) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpressRouteCrossConnectionProperties(); - } - this.innerProperties().withServiceProviderNotes(serviceProviderNotes); - return this; - } - - /** - * Get the provisioningState property: Gets the provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the peerings property: The list of peerings. - * - * @return the peerings value. - */ - public List peerings() { - return this.innerProperties() == null ? null : this.innerProperties().peerings(); - } - - /** - * Set the peerings property: The list of peerings. - * - * @param peerings the peerings value to set. - * @return the ExpressRouteCrossConnectionInner object itself. - */ - public ExpressRouteCrossConnectionInner withPeerings(List peerings) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpressRouteCrossConnectionProperties(); - } - this.innerProperties().withPeerings(peerings); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRouteCrossConnectionPeeringInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRouteCrossConnectionPeeringInner.java deleted file mode 100644 index 684218967d65..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRouteCrossConnectionPeeringInner.java +++ /dev/null @@ -1,390 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.ExpressRouteCircuitPeeringConfig; -import com.azure.resourcemanager.network.models.ExpressRoutePeeringState; -import com.azure.resourcemanager.network.models.ExpressRoutePeeringType; -import com.azure.resourcemanager.network.models.Ipv6ExpressRouteCircuitPeeringConfig; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Peering in an ExpressRoute Cross Connection resource. */ -@Fluent -public final class ExpressRouteCrossConnectionPeeringInner extends SubResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteCrossConnectionPeeringInner.class); - - /* - * The properties property. - */ - @JsonProperty(value = "properties") - private ExpressRouteCrossConnectionPeeringPropertiesInner innerProperties; - - /* - * Gets name of the resource that is unique within a resource group. This - * name can be used to access the resource. - */ - @JsonProperty(value = "name") - private String name; - - /* - * A unique read-only string that changes whenever the resource is updated. - */ - @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) - private String etag; - - /** - * Get the innerProperties property: The properties property. - * - * @return the innerProperties value. - */ - private ExpressRouteCrossConnectionPeeringPropertiesInner innerProperties() { - return this.innerProperties; - } - - /** - * Get the name property: Gets name of the resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Gets name of the resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @param name the name value to set. - * @return the ExpressRouteCrossConnectionPeeringInner object itself. - */ - public ExpressRouteCrossConnectionPeeringInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** {@inheritDoc} */ - @Override - public ExpressRouteCrossConnectionPeeringInner withId(String id) { - super.withId(id); - return this; - } - - /** - * Get the peeringType property: The peering type. - * - * @return the peeringType value. - */ - public ExpressRoutePeeringType peeringType() { - return this.innerProperties() == null ? null : this.innerProperties().peeringType(); - } - - /** - * Set the peeringType property: The peering type. - * - * @param peeringType the peeringType value to set. - * @return the ExpressRouteCrossConnectionPeeringInner object itself. - */ - public ExpressRouteCrossConnectionPeeringInner withPeeringType(ExpressRoutePeeringType peeringType) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpressRouteCrossConnectionPeeringPropertiesInner(); - } - this.innerProperties().withPeeringType(peeringType); - return this; - } - - /** - * Get the state property: The peering state. - * - * @return the state value. - */ - public ExpressRoutePeeringState state() { - return this.innerProperties() == null ? null : this.innerProperties().state(); - } - - /** - * Set the state property: The peering state. - * - * @param state the state value to set. - * @return the ExpressRouteCrossConnectionPeeringInner object itself. - */ - public ExpressRouteCrossConnectionPeeringInner withState(ExpressRoutePeeringState state) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpressRouteCrossConnectionPeeringPropertiesInner(); - } - this.innerProperties().withState(state); - return this; - } - - /** - * Get the azureAsn property: The Azure ASN. - * - * @return the azureAsn value. - */ - public Integer azureAsn() { - return this.innerProperties() == null ? null : this.innerProperties().azureAsn(); - } - - /** - * Get the peerAsn property: The peer ASN. - * - * @return the peerAsn value. - */ - public Long peerAsn() { - return this.innerProperties() == null ? null : this.innerProperties().peerAsn(); - } - - /** - * Set the peerAsn property: The peer ASN. - * - * @param peerAsn the peerAsn value to set. - * @return the ExpressRouteCrossConnectionPeeringInner object itself. - */ - public ExpressRouteCrossConnectionPeeringInner withPeerAsn(Long peerAsn) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpressRouteCrossConnectionPeeringPropertiesInner(); - } - this.innerProperties().withPeerAsn(peerAsn); - return this; - } - - /** - * Get the primaryPeerAddressPrefix property: The primary address prefix. - * - * @return the primaryPeerAddressPrefix value. - */ - public String primaryPeerAddressPrefix() { - return this.innerProperties() == null ? null : this.innerProperties().primaryPeerAddressPrefix(); - } - - /** - * Set the primaryPeerAddressPrefix property: The primary address prefix. - * - * @param primaryPeerAddressPrefix the primaryPeerAddressPrefix value to set. - * @return the ExpressRouteCrossConnectionPeeringInner object itself. - */ - public ExpressRouteCrossConnectionPeeringInner withPrimaryPeerAddressPrefix(String primaryPeerAddressPrefix) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpressRouteCrossConnectionPeeringPropertiesInner(); - } - this.innerProperties().withPrimaryPeerAddressPrefix(primaryPeerAddressPrefix); - return this; - } - - /** - * Get the secondaryPeerAddressPrefix property: The secondary address prefix. - * - * @return the secondaryPeerAddressPrefix value. - */ - public String secondaryPeerAddressPrefix() { - return this.innerProperties() == null ? null : this.innerProperties().secondaryPeerAddressPrefix(); - } - - /** - * Set the secondaryPeerAddressPrefix property: The secondary address prefix. - * - * @param secondaryPeerAddressPrefix the secondaryPeerAddressPrefix value to set. - * @return the ExpressRouteCrossConnectionPeeringInner object itself. - */ - public ExpressRouteCrossConnectionPeeringInner withSecondaryPeerAddressPrefix(String secondaryPeerAddressPrefix) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpressRouteCrossConnectionPeeringPropertiesInner(); - } - this.innerProperties().withSecondaryPeerAddressPrefix(secondaryPeerAddressPrefix); - return this; - } - - /** - * Get the primaryAzurePort property: The primary port. - * - * @return the primaryAzurePort value. - */ - public String primaryAzurePort() { - return this.innerProperties() == null ? null : this.innerProperties().primaryAzurePort(); - } - - /** - * Get the secondaryAzurePort property: The secondary port. - * - * @return the secondaryAzurePort value. - */ - public String secondaryAzurePort() { - return this.innerProperties() == null ? null : this.innerProperties().secondaryAzurePort(); - } - - /** - * Get the sharedKey property: The shared key. - * - * @return the sharedKey value. - */ - public String sharedKey() { - return this.innerProperties() == null ? null : this.innerProperties().sharedKey(); - } - - /** - * Set the sharedKey property: The shared key. - * - * @param sharedKey the sharedKey value to set. - * @return the ExpressRouteCrossConnectionPeeringInner object itself. - */ - public ExpressRouteCrossConnectionPeeringInner withSharedKey(String sharedKey) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpressRouteCrossConnectionPeeringPropertiesInner(); - } - this.innerProperties().withSharedKey(sharedKey); - return this; - } - - /** - * Get the vlanId property: The VLAN ID. - * - * @return the vlanId value. - */ - public Integer vlanId() { - return this.innerProperties() == null ? null : this.innerProperties().vlanId(); - } - - /** - * Set the vlanId property: The VLAN ID. - * - * @param vlanId the vlanId value to set. - * @return the ExpressRouteCrossConnectionPeeringInner object itself. - */ - public ExpressRouteCrossConnectionPeeringInner withVlanId(Integer vlanId) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpressRouteCrossConnectionPeeringPropertiesInner(); - } - this.innerProperties().withVlanId(vlanId); - return this; - } - - /** - * Get the microsoftPeeringConfig property: The Microsoft peering configuration. - * - * @return the microsoftPeeringConfig value. - */ - public ExpressRouteCircuitPeeringConfig microsoftPeeringConfig() { - return this.innerProperties() == null ? null : this.innerProperties().microsoftPeeringConfig(); - } - - /** - * Set the microsoftPeeringConfig property: The Microsoft peering configuration. - * - * @param microsoftPeeringConfig the microsoftPeeringConfig value to set. - * @return the ExpressRouteCrossConnectionPeeringInner object itself. - */ - public ExpressRouteCrossConnectionPeeringInner withMicrosoftPeeringConfig( - ExpressRouteCircuitPeeringConfig microsoftPeeringConfig) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpressRouteCrossConnectionPeeringPropertiesInner(); - } - this.innerProperties().withMicrosoftPeeringConfig(microsoftPeeringConfig); - return this; - } - - /** - * Get the provisioningState property: Gets the provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the gatewayManagerEtag property: The GatewayManager Etag. - * - * @return the gatewayManagerEtag value. - */ - public String gatewayManagerEtag() { - return this.innerProperties() == null ? null : this.innerProperties().gatewayManagerEtag(); - } - - /** - * Set the gatewayManagerEtag property: The GatewayManager Etag. - * - * @param gatewayManagerEtag the gatewayManagerEtag value to set. - * @return the ExpressRouteCrossConnectionPeeringInner object itself. - */ - public ExpressRouteCrossConnectionPeeringInner withGatewayManagerEtag(String gatewayManagerEtag) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpressRouteCrossConnectionPeeringPropertiesInner(); - } - this.innerProperties().withGatewayManagerEtag(gatewayManagerEtag); - return this; - } - - /** - * Get the lastModifiedBy property: Gets whether the provider or the customer last modified the peering. - * - * @return the lastModifiedBy value. - */ - public String lastModifiedBy() { - return this.innerProperties() == null ? null : this.innerProperties().lastModifiedBy(); - } - - /** - * Set the lastModifiedBy property: Gets whether the provider or the customer last modified the peering. - * - * @param lastModifiedBy the lastModifiedBy value to set. - * @return the ExpressRouteCrossConnectionPeeringInner object itself. - */ - public ExpressRouteCrossConnectionPeeringInner withLastModifiedBy(String lastModifiedBy) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpressRouteCrossConnectionPeeringPropertiesInner(); - } - this.innerProperties().withLastModifiedBy(lastModifiedBy); - return this; - } - - /** - * Get the ipv6PeeringConfig property: The IPv6 peering configuration. - * - * @return the ipv6PeeringConfig value. - */ - public Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig() { - return this.innerProperties() == null ? null : this.innerProperties().ipv6PeeringConfig(); - } - - /** - * Set the ipv6PeeringConfig property: The IPv6 peering configuration. - * - * @param ipv6PeeringConfig the ipv6PeeringConfig value to set. - * @return the ExpressRouteCrossConnectionPeeringInner object itself. - */ - public ExpressRouteCrossConnectionPeeringInner withIpv6PeeringConfig( - Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpressRouteCrossConnectionPeeringPropertiesInner(); - } - this.innerProperties().withIpv6PeeringConfig(ipv6PeeringConfig); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRouteCrossConnectionPeeringPropertiesInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRouteCrossConnectionPeeringPropertiesInner.java deleted file mode 100644 index 2b2223809660..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRouteCrossConnectionPeeringPropertiesInner.java +++ /dev/null @@ -1,387 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.ExpressRouteCircuitPeeringConfig; -import com.azure.resourcemanager.network.models.ExpressRoutePeeringState; -import com.azure.resourcemanager.network.models.ExpressRoutePeeringType; -import com.azure.resourcemanager.network.models.Ipv6ExpressRouteCircuitPeeringConfig; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The ExpressRouteCrossConnectionPeeringProperties model. */ -@Fluent -public final class ExpressRouteCrossConnectionPeeringPropertiesInner { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(ExpressRouteCrossConnectionPeeringPropertiesInner.class); - - /* - * The peering type. - */ - @JsonProperty(value = "peeringType") - private ExpressRoutePeeringType peeringType; - - /* - * The peering state. - */ - @JsonProperty(value = "state") - private ExpressRoutePeeringState state; - - /* - * The Azure ASN. - */ - @JsonProperty(value = "azureASN", access = JsonProperty.Access.WRITE_ONLY) - private Integer azureAsn; - - /* - * The peer ASN. - */ - @JsonProperty(value = "peerASN") - private Long peerAsn; - - /* - * The primary address prefix. - */ - @JsonProperty(value = "primaryPeerAddressPrefix") - private String primaryPeerAddressPrefix; - - /* - * The secondary address prefix. - */ - @JsonProperty(value = "secondaryPeerAddressPrefix") - private String secondaryPeerAddressPrefix; - - /* - * The primary port. - */ - @JsonProperty(value = "primaryAzurePort", access = JsonProperty.Access.WRITE_ONLY) - private String primaryAzurePort; - - /* - * The secondary port. - */ - @JsonProperty(value = "secondaryAzurePort", access = JsonProperty.Access.WRITE_ONLY) - private String secondaryAzurePort; - - /* - * The shared key. - */ - @JsonProperty(value = "sharedKey") - private String sharedKey; - - /* - * The VLAN ID. - */ - @JsonProperty(value = "vlanId") - private Integer vlanId; - - /* - * The Microsoft peering configuration. - */ - @JsonProperty(value = "microsoftPeeringConfig") - private ExpressRouteCircuitPeeringConfig microsoftPeeringConfig; - - /* - * Gets the provisioning state of the public IP resource. Possible values - * are: 'Updating', 'Deleting', and 'Failed'. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; - - /* - * The GatewayManager Etag. - */ - @JsonProperty(value = "gatewayManagerEtag") - private String gatewayManagerEtag; - - /* - * Gets whether the provider or the customer last modified the peering. - */ - @JsonProperty(value = "lastModifiedBy") - private String lastModifiedBy; - - /* - * The IPv6 peering configuration. - */ - @JsonProperty(value = "ipv6PeeringConfig") - private Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig; - - /** - * Get the peeringType property: The peering type. - * - * @return the peeringType value. - */ - public ExpressRoutePeeringType peeringType() { - return this.peeringType; - } - - /** - * Set the peeringType property: The peering type. - * - * @param peeringType the peeringType value to set. - * @return the ExpressRouteCrossConnectionPeeringPropertiesInner object itself. - */ - public ExpressRouteCrossConnectionPeeringPropertiesInner withPeeringType(ExpressRoutePeeringType peeringType) { - this.peeringType = peeringType; - return this; - } - - /** - * Get the state property: The peering state. - * - * @return the state value. - */ - public ExpressRoutePeeringState state() { - return this.state; - } - - /** - * Set the state property: The peering state. - * - * @param state the state value to set. - * @return the ExpressRouteCrossConnectionPeeringPropertiesInner object itself. - */ - public ExpressRouteCrossConnectionPeeringPropertiesInner withState(ExpressRoutePeeringState state) { - this.state = state; - return this; - } - - /** - * Get the azureAsn property: The Azure ASN. - * - * @return the azureAsn value. - */ - public Integer azureAsn() { - return this.azureAsn; - } - - /** - * Get the peerAsn property: The peer ASN. - * - * @return the peerAsn value. - */ - public Long peerAsn() { - return this.peerAsn; - } - - /** - * Set the peerAsn property: The peer ASN. - * - * @param peerAsn the peerAsn value to set. - * @return the ExpressRouteCrossConnectionPeeringPropertiesInner object itself. - */ - public ExpressRouteCrossConnectionPeeringPropertiesInner withPeerAsn(Long peerAsn) { - this.peerAsn = peerAsn; - return this; - } - - /** - * Get the primaryPeerAddressPrefix property: The primary address prefix. - * - * @return the primaryPeerAddressPrefix value. - */ - public String primaryPeerAddressPrefix() { - return this.primaryPeerAddressPrefix; - } - - /** - * Set the primaryPeerAddressPrefix property: The primary address prefix. - * - * @param primaryPeerAddressPrefix the primaryPeerAddressPrefix value to set. - * @return the ExpressRouteCrossConnectionPeeringPropertiesInner object itself. - */ - public ExpressRouteCrossConnectionPeeringPropertiesInner withPrimaryPeerAddressPrefix( - String primaryPeerAddressPrefix) { - this.primaryPeerAddressPrefix = primaryPeerAddressPrefix; - return this; - } - - /** - * Get the secondaryPeerAddressPrefix property: The secondary address prefix. - * - * @return the secondaryPeerAddressPrefix value. - */ - public String secondaryPeerAddressPrefix() { - return this.secondaryPeerAddressPrefix; - } - - /** - * Set the secondaryPeerAddressPrefix property: The secondary address prefix. - * - * @param secondaryPeerAddressPrefix the secondaryPeerAddressPrefix value to set. - * @return the ExpressRouteCrossConnectionPeeringPropertiesInner object itself. - */ - public ExpressRouteCrossConnectionPeeringPropertiesInner withSecondaryPeerAddressPrefix( - String secondaryPeerAddressPrefix) { - this.secondaryPeerAddressPrefix = secondaryPeerAddressPrefix; - return this; - } - - /** - * Get the primaryAzurePort property: The primary port. - * - * @return the primaryAzurePort value. - */ - public String primaryAzurePort() { - return this.primaryAzurePort; - } - - /** - * Get the secondaryAzurePort property: The secondary port. - * - * @return the secondaryAzurePort value. - */ - public String secondaryAzurePort() { - return this.secondaryAzurePort; - } - - /** - * Get the sharedKey property: The shared key. - * - * @return the sharedKey value. - */ - public String sharedKey() { - return this.sharedKey; - } - - /** - * Set the sharedKey property: The shared key. - * - * @param sharedKey the sharedKey value to set. - * @return the ExpressRouteCrossConnectionPeeringPropertiesInner object itself. - */ - public ExpressRouteCrossConnectionPeeringPropertiesInner withSharedKey(String sharedKey) { - this.sharedKey = sharedKey; - return this; - } - - /** - * Get the vlanId property: The VLAN ID. - * - * @return the vlanId value. - */ - public Integer vlanId() { - return this.vlanId; - } - - /** - * Set the vlanId property: The VLAN ID. - * - * @param vlanId the vlanId value to set. - * @return the ExpressRouteCrossConnectionPeeringPropertiesInner object itself. - */ - public ExpressRouteCrossConnectionPeeringPropertiesInner withVlanId(Integer vlanId) { - this.vlanId = vlanId; - return this; - } - - /** - * Get the microsoftPeeringConfig property: The Microsoft peering configuration. - * - * @return the microsoftPeeringConfig value. - */ - public ExpressRouteCircuitPeeringConfig microsoftPeeringConfig() { - return this.microsoftPeeringConfig; - } - - /** - * Set the microsoftPeeringConfig property: The Microsoft peering configuration. - * - * @param microsoftPeeringConfig the microsoftPeeringConfig value to set. - * @return the ExpressRouteCrossConnectionPeeringPropertiesInner object itself. - */ - public ExpressRouteCrossConnectionPeeringPropertiesInner withMicrosoftPeeringConfig( - ExpressRouteCircuitPeeringConfig microsoftPeeringConfig) { - this.microsoftPeeringConfig = microsoftPeeringConfig; - return this; - } - - /** - * Get the provisioningState property: Gets the provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Get the gatewayManagerEtag property: The GatewayManager Etag. - * - * @return the gatewayManagerEtag value. - */ - public String gatewayManagerEtag() { - return this.gatewayManagerEtag; - } - - /** - * Set the gatewayManagerEtag property: The GatewayManager Etag. - * - * @param gatewayManagerEtag the gatewayManagerEtag value to set. - * @return the ExpressRouteCrossConnectionPeeringPropertiesInner object itself. - */ - public ExpressRouteCrossConnectionPeeringPropertiesInner withGatewayManagerEtag(String gatewayManagerEtag) { - this.gatewayManagerEtag = gatewayManagerEtag; - return this; - } - - /** - * Get the lastModifiedBy property: Gets whether the provider or the customer last modified the peering. - * - * @return the lastModifiedBy value. - */ - public String lastModifiedBy() { - return this.lastModifiedBy; - } - - /** - * Set the lastModifiedBy property: Gets whether the provider or the customer last modified the peering. - * - * @param lastModifiedBy the lastModifiedBy value to set. - * @return the ExpressRouteCrossConnectionPeeringPropertiesInner object itself. - */ - public ExpressRouteCrossConnectionPeeringPropertiesInner withLastModifiedBy(String lastModifiedBy) { - this.lastModifiedBy = lastModifiedBy; - return this; - } - - /** - * Get the ipv6PeeringConfig property: The IPv6 peering configuration. - * - * @return the ipv6PeeringConfig value. - */ - public Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig() { - return this.ipv6PeeringConfig; - } - - /** - * Set the ipv6PeeringConfig property: The IPv6 peering configuration. - * - * @param ipv6PeeringConfig the ipv6PeeringConfig value to set. - * @return the ExpressRouteCrossConnectionPeeringPropertiesInner object itself. - */ - public ExpressRouteCrossConnectionPeeringPropertiesInner withIpv6PeeringConfig( - Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig) { - this.ipv6PeeringConfig = ipv6PeeringConfig; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (microsoftPeeringConfig() != null) { - microsoftPeeringConfig().validate(); - } - if (ipv6PeeringConfig() != null) { - ipv6PeeringConfig().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRouteCrossConnectionProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRouteCrossConnectionProperties.java deleted file mode 100644 index b2b6bd9ffe4a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRouteCrossConnectionProperties.java +++ /dev/null @@ -1,257 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.ExpressRouteCircuitReference; -import com.azure.resourcemanager.network.models.ServiceProviderProvisioningState; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Properties of ExpressRouteCrossConnection. */ -@Fluent -public final class ExpressRouteCrossConnectionProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteCrossConnectionProperties.class); - - /* - * The name of the primary port. - */ - @JsonProperty(value = "primaryAzurePort", access = JsonProperty.Access.WRITE_ONLY) - private String primaryAzurePort; - - /* - * The name of the secondary port. - */ - @JsonProperty(value = "secondaryAzurePort", access = JsonProperty.Access.WRITE_ONLY) - private String secondaryAzurePort; - - /* - * The identifier of the circuit traffic. - */ - @JsonProperty(value = "sTag", access = JsonProperty.Access.WRITE_ONLY) - private Integer stag; - - /* - * The peering location of the ExpressRoute circuit. - */ - @JsonProperty(value = "peeringLocation") - private String peeringLocation; - - /* - * The circuit bandwidth In Mbps. - */ - @JsonProperty(value = "bandwidthInMbps") - private Integer bandwidthInMbps; - - /* - * The ExpressRouteCircuit - */ - @JsonProperty(value = "expressRouteCircuit") - private ExpressRouteCircuitReference expressRouteCircuit; - - /* - * The provisioning state of the circuit in the connectivity provider - * system. Possible values are 'NotProvisioned', 'Provisioning', - * 'Provisioned'. - */ - @JsonProperty(value = "serviceProviderProvisioningState") - private ServiceProviderProvisioningState serviceProviderProvisioningState; - - /* - * Additional read only notes set by the connectivity provider. - */ - @JsonProperty(value = "serviceProviderNotes") - private String serviceProviderNotes; - - /* - * Gets the provisioning state of the public IP resource. Possible values - * are: 'Updating', 'Deleting', and 'Failed'. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; - - /* - * The list of peerings. - */ - @JsonProperty(value = "peerings") - private List peerings; - - /** - * Get the primaryAzurePort property: The name of the primary port. - * - * @return the primaryAzurePort value. - */ - public String primaryAzurePort() { - return this.primaryAzurePort; - } - - /** - * Get the secondaryAzurePort property: The name of the secondary port. - * - * @return the secondaryAzurePort value. - */ - public String secondaryAzurePort() { - return this.secondaryAzurePort; - } - - /** - * Get the stag property: The identifier of the circuit traffic. - * - * @return the stag value. - */ - public Integer stag() { - return this.stag; - } - - /** - * Get the peeringLocation property: The peering location of the ExpressRoute circuit. - * - * @return the peeringLocation value. - */ - public String peeringLocation() { - return this.peeringLocation; - } - - /** - * Set the peeringLocation property: The peering location of the ExpressRoute circuit. - * - * @param peeringLocation the peeringLocation value to set. - * @return the ExpressRouteCrossConnectionProperties object itself. - */ - public ExpressRouteCrossConnectionProperties withPeeringLocation(String peeringLocation) { - this.peeringLocation = peeringLocation; - return this; - } - - /** - * Get the bandwidthInMbps property: The circuit bandwidth In Mbps. - * - * @return the bandwidthInMbps value. - */ - public Integer bandwidthInMbps() { - return this.bandwidthInMbps; - } - - /** - * Set the bandwidthInMbps property: The circuit bandwidth In Mbps. - * - * @param bandwidthInMbps the bandwidthInMbps value to set. - * @return the ExpressRouteCrossConnectionProperties object itself. - */ - public ExpressRouteCrossConnectionProperties withBandwidthInMbps(Integer bandwidthInMbps) { - this.bandwidthInMbps = bandwidthInMbps; - return this; - } - - /** - * Get the expressRouteCircuit property: The ExpressRouteCircuit. - * - * @return the expressRouteCircuit value. - */ - public ExpressRouteCircuitReference expressRouteCircuit() { - return this.expressRouteCircuit; - } - - /** - * Set the expressRouteCircuit property: The ExpressRouteCircuit. - * - * @param expressRouteCircuit the expressRouteCircuit value to set. - * @return the ExpressRouteCrossConnectionProperties object itself. - */ - public ExpressRouteCrossConnectionProperties withExpressRouteCircuit( - ExpressRouteCircuitReference expressRouteCircuit) { - this.expressRouteCircuit = expressRouteCircuit; - return this; - } - - /** - * Get the serviceProviderProvisioningState property: The provisioning state of the circuit in the connectivity - * provider system. Possible values are 'NotProvisioned', 'Provisioning', 'Provisioned'. - * - * @return the serviceProviderProvisioningState value. - */ - public ServiceProviderProvisioningState serviceProviderProvisioningState() { - return this.serviceProviderProvisioningState; - } - - /** - * Set the serviceProviderProvisioningState property: The provisioning state of the circuit in the connectivity - * provider system. Possible values are 'NotProvisioned', 'Provisioning', 'Provisioned'. - * - * @param serviceProviderProvisioningState the serviceProviderProvisioningState value to set. - * @return the ExpressRouteCrossConnectionProperties object itself. - */ - public ExpressRouteCrossConnectionProperties withServiceProviderProvisioningState( - ServiceProviderProvisioningState serviceProviderProvisioningState) { - this.serviceProviderProvisioningState = serviceProviderProvisioningState; - return this; - } - - /** - * Get the serviceProviderNotes property: Additional read only notes set by the connectivity provider. - * - * @return the serviceProviderNotes value. - */ - public String serviceProviderNotes() { - return this.serviceProviderNotes; - } - - /** - * Set the serviceProviderNotes property: Additional read only notes set by the connectivity provider. - * - * @param serviceProviderNotes the serviceProviderNotes value to set. - * @return the ExpressRouteCrossConnectionProperties object itself. - */ - public ExpressRouteCrossConnectionProperties withServiceProviderNotes(String serviceProviderNotes) { - this.serviceProviderNotes = serviceProviderNotes; - return this; - } - - /** - * Get the provisioningState property: Gets the provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Get the peerings property: The list of peerings. - * - * @return the peerings value. - */ - public List peerings() { - return this.peerings; - } - - /** - * Set the peerings property: The list of peerings. - * - * @param peerings the peerings value to set. - * @return the ExpressRouteCrossConnectionProperties object itself. - */ - public ExpressRouteCrossConnectionProperties withPeerings(List peerings) { - this.peerings = peerings; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (expressRouteCircuit() != null) { - expressRouteCircuit().validate(); - } - if (peerings() != null) { - peerings().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner.java deleted file mode 100644 index 57f38f29d3a1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.ExpressRouteCrossConnectionRoutesTableSummary; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Response for ListRoutesTable associated with the Express Route Cross Connections. */ -@Fluent -public final class ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner { - @JsonIgnore - private final ClientLogger logger = - new ClientLogger(ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner.class); - - /* - * A list of the routes table. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to get the next set of results. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: A list of the routes table. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: A list of the routes table. - * - * @param value the value value to set. - * @return the ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner object itself. - */ - public ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner withValue( - List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to get the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRouteGatewayInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRouteGatewayInner.java deleted file mode 100644 index 19c61d93739d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRouteGatewayInner.java +++ /dev/null @@ -1,168 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.ExpressRouteGatewayPropertiesAutoScaleConfiguration; -import com.azure.resourcemanager.network.models.ProvisioningState; -import com.azure.resourcemanager.network.models.VirtualHubId; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** ExpressRoute gateway resource. */ -@Fluent -public final class ExpressRouteGatewayInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteGatewayInner.class); - - /* - * ExpressRoute gateway resource properties. - */ - @JsonProperty(value = "properties") - private ExpressRouteGatewayProperties innerProperties; - - /* - * A unique read-only string that changes whenever the resource is updated. - */ - @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) - private String etag; - - /* - * Resource ID. - */ - @JsonProperty(value = "id") - private String id; - - /** - * Get the innerProperties property: ExpressRoute gateway resource properties. - * - * @return the innerProperties value. - */ - private ExpressRouteGatewayProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Get the id property: Resource ID. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: Resource ID. - * - * @param id the id value to set. - * @return the ExpressRouteGatewayInner object itself. - */ - public ExpressRouteGatewayInner withId(String id) { - this.id = id; - return this; - } - - /** {@inheritDoc} */ - @Override - public ExpressRouteGatewayInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public ExpressRouteGatewayInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the autoScaleConfiguration property: Configuration for auto scaling. - * - * @return the autoScaleConfiguration value. - */ - public ExpressRouteGatewayPropertiesAutoScaleConfiguration autoScaleConfiguration() { - return this.innerProperties() == null ? null : this.innerProperties().autoScaleConfiguration(); - } - - /** - * Set the autoScaleConfiguration property: Configuration for auto scaling. - * - * @param autoScaleConfiguration the autoScaleConfiguration value to set. - * @return the ExpressRouteGatewayInner object itself. - */ - public ExpressRouteGatewayInner withAutoScaleConfiguration( - ExpressRouteGatewayPropertiesAutoScaleConfiguration autoScaleConfiguration) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpressRouteGatewayProperties(); - } - this.innerProperties().withAutoScaleConfiguration(autoScaleConfiguration); - return this; - } - - /** - * Get the expressRouteConnections property: List of ExpressRoute connections to the ExpressRoute gateway. - * - * @return the expressRouteConnections value. - */ - public List expressRouteConnections() { - return this.innerProperties() == null ? null : this.innerProperties().expressRouteConnections(); - } - - /** - * Get the provisioningState property: The provisioning state of the resource. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the virtualHub property: The Virtual Hub where the ExpressRoute gateway is or will be deployed. - * - * @return the virtualHub value. - */ - public VirtualHubId virtualHub() { - return this.innerProperties() == null ? null : this.innerProperties().virtualHub(); - } - - /** - * Set the virtualHub property: The Virtual Hub where the ExpressRoute gateway is or will be deployed. - * - * @param virtualHub the virtualHub value to set. - * @return the ExpressRouteGatewayInner object itself. - */ - public ExpressRouteGatewayInner withVirtualHub(VirtualHubId virtualHub) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpressRouteGatewayProperties(); - } - this.innerProperties().withVirtualHub(virtualHub); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRouteGatewayListInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRouteGatewayListInner.java deleted file mode 100644 index 69106f5b9753..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRouteGatewayListInner.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** List of ExpressRoute gateways. */ -@Fluent -public final class ExpressRouteGatewayListInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteGatewayListInner.class); - - /* - * List of ExpressRoute gateways. - */ - @JsonProperty(value = "value") - private List value; - - /** - * Get the value property: List of ExpressRoute gateways. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: List of ExpressRoute gateways. - * - * @param value the value value to set. - * @return the ExpressRouteGatewayListInner object itself. - */ - public ExpressRouteGatewayListInner withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRouteGatewayProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRouteGatewayProperties.java deleted file mode 100644 index b0f0bb5b35f9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRouteGatewayProperties.java +++ /dev/null @@ -1,125 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.ExpressRouteGatewayPropertiesAutoScaleConfiguration; -import com.azure.resourcemanager.network.models.ProvisioningState; -import com.azure.resourcemanager.network.models.VirtualHubId; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** ExpressRoute gateway resource properties. */ -@Fluent -public final class ExpressRouteGatewayProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteGatewayProperties.class); - - /* - * Configuration for auto scaling. - */ - @JsonProperty(value = "autoScaleConfiguration") - private ExpressRouteGatewayPropertiesAutoScaleConfiguration autoScaleConfiguration; - - /* - * List of ExpressRoute connections to the ExpressRoute gateway. - */ - @JsonProperty(value = "expressRouteConnections", access = JsonProperty.Access.WRITE_ONLY) - private List expressRouteConnections; - - /* - * The provisioning state of the resource. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private ProvisioningState provisioningState; - - /* - * The Virtual Hub where the ExpressRoute gateway is or will be deployed. - */ - @JsonProperty(value = "virtualHub", required = true) - private VirtualHubId virtualHub; - - /** - * Get the autoScaleConfiguration property: Configuration for auto scaling. - * - * @return the autoScaleConfiguration value. - */ - public ExpressRouteGatewayPropertiesAutoScaleConfiguration autoScaleConfiguration() { - return this.autoScaleConfiguration; - } - - /** - * Set the autoScaleConfiguration property: Configuration for auto scaling. - * - * @param autoScaleConfiguration the autoScaleConfiguration value to set. - * @return the ExpressRouteGatewayProperties object itself. - */ - public ExpressRouteGatewayProperties withAutoScaleConfiguration( - ExpressRouteGatewayPropertiesAutoScaleConfiguration autoScaleConfiguration) { - this.autoScaleConfiguration = autoScaleConfiguration; - return this; - } - - /** - * Get the expressRouteConnections property: List of ExpressRoute connections to the ExpressRoute gateway. - * - * @return the expressRouteConnections value. - */ - public List expressRouteConnections() { - return this.expressRouteConnections; - } - - /** - * Get the provisioningState property: The provisioning state of the resource. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Get the virtualHub property: The Virtual Hub where the ExpressRoute gateway is or will be deployed. - * - * @return the virtualHub value. - */ - public VirtualHubId virtualHub() { - return this.virtualHub; - } - - /** - * Set the virtualHub property: The Virtual Hub where the ExpressRoute gateway is or will be deployed. - * - * @param virtualHub the virtualHub value to set. - * @return the ExpressRouteGatewayProperties object itself. - */ - public ExpressRouteGatewayProperties withVirtualHub(VirtualHubId virtualHub) { - this.virtualHub = virtualHub; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (autoScaleConfiguration() != null) { - autoScaleConfiguration().validate(); - } - if (expressRouteConnections() != null) { - expressRouteConnections().forEach(e -> e.validate()); - } - if (virtualHub() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property virtualHub in model ExpressRouteGatewayProperties")); - } else { - virtualHub().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRouteLinkInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRouteLinkInner.java deleted file mode 100644 index 1184b0ec26cd..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRouteLinkInner.java +++ /dev/null @@ -1,172 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.ExpressRouteLinkAdminState; -import com.azure.resourcemanager.network.models.ExpressRouteLinkConnectorType; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** ExpressRouteLink ExpressRouteLink child resource definition. */ -@Fluent -public final class ExpressRouteLinkInner extends SubResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteLinkInner.class); - - /* - * ExpressRouteLink Resource Properties ExpressRouteLink properties - */ - @JsonProperty(value = "properties") - private ExpressRouteLinkPropertiesFormat innerProperties; - - /* - * Name of child port resource that is unique among child port resources of - * the parent. - */ - @JsonProperty(value = "name") - private String name; - - /* - * A unique read-only string that changes whenever the resource is updated. - */ - @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) - private String etag; - - /** - * Get the innerProperties property: ExpressRouteLink Resource Properties ExpressRouteLink properties. - * - * @return the innerProperties value. - */ - private ExpressRouteLinkPropertiesFormat innerProperties() { - return this.innerProperties; - } - - /** - * Get the name property: Name of child port resource that is unique among child port resources of the parent. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Name of child port resource that is unique among child port resources of the parent. - * - * @param name the name value to set. - * @return the ExpressRouteLinkInner object itself. - */ - public ExpressRouteLinkInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** {@inheritDoc} */ - @Override - public ExpressRouteLinkInner withId(String id) { - super.withId(id); - return this; - } - - /** - * Get the routerName property: Name of Azure router associated with physical port. - * - * @return the routerName value. - */ - public String routerName() { - return this.innerProperties() == null ? null : this.innerProperties().routerName(); - } - - /** - * Get the interfaceName property: Name of Azure router interface. - * - * @return the interfaceName value. - */ - public String interfaceName() { - return this.innerProperties() == null ? null : this.innerProperties().interfaceName(); - } - - /** - * Get the patchPanelId property: Mapping between physical port to patch panel port. - * - * @return the patchPanelId value. - */ - public String patchPanelId() { - return this.innerProperties() == null ? null : this.innerProperties().patchPanelId(); - } - - /** - * Get the rackId property: Mapping of physical patch panel to rack. - * - * @return the rackId value. - */ - public String rackId() { - return this.innerProperties() == null ? null : this.innerProperties().rackId(); - } - - /** - * Get the connectorType property: Physical fiber port type. - * - * @return the connectorType value. - */ - public ExpressRouteLinkConnectorType connectorType() { - return this.innerProperties() == null ? null : this.innerProperties().connectorType(); - } - - /** - * Get the adminState property: Administrative state of the physical port. - * - * @return the adminState value. - */ - public ExpressRouteLinkAdminState adminState() { - return this.innerProperties() == null ? null : this.innerProperties().adminState(); - } - - /** - * Set the adminState property: Administrative state of the physical port. - * - * @param adminState the adminState value to set. - * @return the ExpressRouteLinkInner object itself. - */ - public ExpressRouteLinkInner withAdminState(ExpressRouteLinkAdminState adminState) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpressRouteLinkPropertiesFormat(); - } - this.innerProperties().withAdminState(adminState); - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the ExpressRouteLink resource. Possible values are: - * 'Succeeded', 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRouteLinkPropertiesFormat.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRouteLinkPropertiesFormat.java deleted file mode 100644 index 8cc533ac60ee..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRouteLinkPropertiesFormat.java +++ /dev/null @@ -1,144 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.ExpressRouteLinkAdminState; -import com.azure.resourcemanager.network.models.ExpressRouteLinkConnectorType; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** ExpressRouteLink Resource Properties Properties specific to ExpressRouteLink resources. */ -@Fluent -public final class ExpressRouteLinkPropertiesFormat { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteLinkPropertiesFormat.class); - - /* - * Name of Azure router associated with physical port. - */ - @JsonProperty(value = "routerName", access = JsonProperty.Access.WRITE_ONLY) - private String routerName; - - /* - * Name of Azure router interface. - */ - @JsonProperty(value = "interfaceName", access = JsonProperty.Access.WRITE_ONLY) - private String interfaceName; - - /* - * Mapping between physical port to patch panel port. - */ - @JsonProperty(value = "patchPanelId", access = JsonProperty.Access.WRITE_ONLY) - private String patchPanelId; - - /* - * Mapping of physical patch panel to rack. - */ - @JsonProperty(value = "rackId", access = JsonProperty.Access.WRITE_ONLY) - private String rackId; - - /* - * Physical fiber port type. - */ - @JsonProperty(value = "connectorType", access = JsonProperty.Access.WRITE_ONLY) - private ExpressRouteLinkConnectorType connectorType; - - /* - * Administrative state of the physical port - */ - @JsonProperty(value = "adminState") - private ExpressRouteLinkAdminState adminState; - - /* - * The provisioning state of the ExpressRouteLink resource. Possible values - * are: 'Succeeded', 'Updating', 'Deleting', and 'Failed'. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; - - /** - * Get the routerName property: Name of Azure router associated with physical port. - * - * @return the routerName value. - */ - public String routerName() { - return this.routerName; - } - - /** - * Get the interfaceName property: Name of Azure router interface. - * - * @return the interfaceName value. - */ - public String interfaceName() { - return this.interfaceName; - } - - /** - * Get the patchPanelId property: Mapping between physical port to patch panel port. - * - * @return the patchPanelId value. - */ - public String patchPanelId() { - return this.patchPanelId; - } - - /** - * Get the rackId property: Mapping of physical patch panel to rack. - * - * @return the rackId value. - */ - public String rackId() { - return this.rackId; - } - - /** - * Get the connectorType property: Physical fiber port type. - * - * @return the connectorType value. - */ - public ExpressRouteLinkConnectorType connectorType() { - return this.connectorType; - } - - /** - * Get the adminState property: Administrative state of the physical port. - * - * @return the adminState value. - */ - public ExpressRouteLinkAdminState adminState() { - return this.adminState; - } - - /** - * Set the adminState property: Administrative state of the physical port. - * - * @param adminState the adminState value to set. - * @return the ExpressRouteLinkPropertiesFormat object itself. - */ - public ExpressRouteLinkPropertiesFormat withAdminState(ExpressRouteLinkAdminState adminState) { - this.adminState = adminState; - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the ExpressRouteLink resource. Possible values are: - * 'Succeeded', 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRoutePortInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRoutePortInner.java deleted file mode 100644 index 51682ceb029a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRoutePortInner.java +++ /dev/null @@ -1,277 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.ExpressRoutePortsEncapsulation; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** ExpressRoute Port ExpressRoutePort resource definition. */ -@Fluent -public final class ExpressRoutePortInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRoutePortInner.class); - - /* - * ExpressRoutePort Properties ExpressRoutePort properties - */ - @JsonProperty(value = "properties") - private ExpressRoutePortPropertiesFormat innerProperties; - - /* - * A unique read-only string that changes whenever the resource is updated. - */ - @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) - private String etag; - - /* - * Resource ID. - */ - @JsonProperty(value = "id") - private String id; - - /** - * Get the innerProperties property: ExpressRoutePort Properties ExpressRoutePort properties. - * - * @return the innerProperties value. - */ - private ExpressRoutePortPropertiesFormat innerProperties() { - return this.innerProperties; - } - - /** - * Get the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Get the id property: Resource ID. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: Resource ID. - * - * @param id the id value to set. - * @return the ExpressRoutePortInner object itself. - */ - public ExpressRoutePortInner withId(String id) { - this.id = id; - return this; - } - - /** {@inheritDoc} */ - @Override - public ExpressRoutePortInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public ExpressRoutePortInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the peeringLocation property: The name of the peering location that the ExpressRoutePort is mapped to - * physically. - * - * @return the peeringLocation value. - */ - public String peeringLocation() { - return this.innerProperties() == null ? null : this.innerProperties().peeringLocation(); - } - - /** - * Set the peeringLocation property: The name of the peering location that the ExpressRoutePort is mapped to - * physically. - * - * @param peeringLocation the peeringLocation value to set. - * @return the ExpressRoutePortInner object itself. - */ - public ExpressRoutePortInner withPeeringLocation(String peeringLocation) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpressRoutePortPropertiesFormat(); - } - this.innerProperties().withPeeringLocation(peeringLocation); - return this; - } - - /** - * Get the bandwidthInGbps property: Bandwidth of procured ports in Gbps. - * - * @return the bandwidthInGbps value. - */ - public Integer bandwidthInGbps() { - return this.innerProperties() == null ? null : this.innerProperties().bandwidthInGbps(); - } - - /** - * Set the bandwidthInGbps property: Bandwidth of procured ports in Gbps. - * - * @param bandwidthInGbps the bandwidthInGbps value to set. - * @return the ExpressRoutePortInner object itself. - */ - public ExpressRoutePortInner withBandwidthInGbps(Integer bandwidthInGbps) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpressRoutePortPropertiesFormat(); - } - this.innerProperties().withBandwidthInGbps(bandwidthInGbps); - return this; - } - - /** - * Get the provisionedBandwidthInGbps property: Aggregate Gbps of associated circuit bandwidths. - * - * @return the provisionedBandwidthInGbps value. - */ - public Float provisionedBandwidthInGbps() { - return this.innerProperties() == null ? null : this.innerProperties().provisionedBandwidthInGbps(); - } - - /** - * Get the mtu property: Maximum transmission unit of the physical port pair(s). - * - * @return the mtu value. - */ - public String mtu() { - return this.innerProperties() == null ? null : this.innerProperties().mtu(); - } - - /** - * Get the encapsulation property: Encapsulation method on physical ports. - * - * @return the encapsulation value. - */ - public ExpressRoutePortsEncapsulation encapsulation() { - return this.innerProperties() == null ? null : this.innerProperties().encapsulation(); - } - - /** - * Set the encapsulation property: Encapsulation method on physical ports. - * - * @param encapsulation the encapsulation value to set. - * @return the ExpressRoutePortInner object itself. - */ - public ExpressRoutePortInner withEncapsulation(ExpressRoutePortsEncapsulation encapsulation) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpressRoutePortPropertiesFormat(); - } - this.innerProperties().withEncapsulation(encapsulation); - return this; - } - - /** - * Get the etherType property: Ether type of the physical port. - * - * @return the etherType value. - */ - public String etherType() { - return this.innerProperties() == null ? null : this.innerProperties().etherType(); - } - - /** - * Get the allocationDate property: Date of the physical port allocation to be used in Letter of Authorization. - * - * @return the allocationDate value. - */ - public String allocationDate() { - return this.innerProperties() == null ? null : this.innerProperties().allocationDate(); - } - - /** - * Get the links property: ExpressRouteLink Sub-Resources The set of physical links of the ExpressRoutePort - * resource. - * - * @return the links value. - */ - public List links() { - return this.innerProperties() == null ? null : this.innerProperties().links(); - } - - /** - * Set the links property: ExpressRouteLink Sub-Resources The set of physical links of the ExpressRoutePort - * resource. - * - * @param links the links value to set. - * @return the ExpressRoutePortInner object itself. - */ - public ExpressRoutePortInner withLinks(List links) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpressRoutePortPropertiesFormat(); - } - this.innerProperties().withLinks(links); - return this; - } - - /** - * Get the circuits property: Reference the ExpressRoute circuit(s) that are provisioned on this ExpressRoutePort - * resource. - * - * @return the circuits value. - */ - public List circuits() { - return this.innerProperties() == null ? null : this.innerProperties().circuits(); - } - - /** - * Get the provisioningState property: The provisioning state of the ExpressRoutePort resource. Possible values are: - * 'Succeeded', 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the resourceGuid property: The resource GUID property of the ExpressRoutePort resource. - * - * @return the resourceGuid value. - */ - public String resourceGuid() { - return this.innerProperties() == null ? null : this.innerProperties().resourceGuid(); - } - - /** - * Set the resourceGuid property: The resource GUID property of the ExpressRoutePort resource. - * - * @param resourceGuid the resourceGuid value to set. - * @return the ExpressRoutePortInner object itself. - */ - public ExpressRoutePortInner withResourceGuid(String resourceGuid) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpressRoutePortPropertiesFormat(); - } - this.innerProperties().withResourceGuid(resourceGuid); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRoutePortPropertiesFormat.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRoutePortPropertiesFormat.java deleted file mode 100644 index 714fb88dfee9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRoutePortPropertiesFormat.java +++ /dev/null @@ -1,261 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.ExpressRoutePortsEncapsulation; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** ExpressRoutePort Properties Properties specific to ExpressRoutePort resources. */ -@Fluent -public final class ExpressRoutePortPropertiesFormat { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRoutePortPropertiesFormat.class); - - /* - * The name of the peering location that the ExpressRoutePort is mapped to - * physically. - */ - @JsonProperty(value = "peeringLocation") - private String peeringLocation; - - /* - * Bandwidth of procured ports in Gbps - */ - @JsonProperty(value = "bandwidthInGbps") - private Integer bandwidthInGbps; - - /* - * Aggregate Gbps of associated circuit bandwidths. - */ - @JsonProperty(value = "provisionedBandwidthInGbps", access = JsonProperty.Access.WRITE_ONLY) - private Float provisionedBandwidthInGbps; - - /* - * Maximum transmission unit of the physical port pair(s) - */ - @JsonProperty(value = "mtu", access = JsonProperty.Access.WRITE_ONLY) - private String mtu; - - /* - * Encapsulation method on physical ports. - */ - @JsonProperty(value = "encapsulation") - private ExpressRoutePortsEncapsulation encapsulation; - - /* - * Ether type of the physical port. - */ - @JsonProperty(value = "etherType", access = JsonProperty.Access.WRITE_ONLY) - private String etherType; - - /* - * Date of the physical port allocation to be used in Letter of - * Authorization. - */ - @JsonProperty(value = "allocationDate", access = JsonProperty.Access.WRITE_ONLY) - private String allocationDate; - - /* - * ExpressRouteLink Sub-Resources The set of physical links of the - * ExpressRoutePort resource - */ - @JsonProperty(value = "links") - private List links; - - /* - * Reference the ExpressRoute circuit(s) that are provisioned on this - * ExpressRoutePort resource. - */ - @JsonProperty(value = "circuits", access = JsonProperty.Access.WRITE_ONLY) - private List circuits; - - /* - * The provisioning state of the ExpressRoutePort resource. Possible values - * are: 'Succeeded', 'Updating', 'Deleting', and 'Failed'. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; - - /* - * The resource GUID property of the ExpressRoutePort resource. - */ - @JsonProperty(value = "resourceGuid") - private String resourceGuid; - - /** - * Get the peeringLocation property: The name of the peering location that the ExpressRoutePort is mapped to - * physically. - * - * @return the peeringLocation value. - */ - public String peeringLocation() { - return this.peeringLocation; - } - - /** - * Set the peeringLocation property: The name of the peering location that the ExpressRoutePort is mapped to - * physically. - * - * @param peeringLocation the peeringLocation value to set. - * @return the ExpressRoutePortPropertiesFormat object itself. - */ - public ExpressRoutePortPropertiesFormat withPeeringLocation(String peeringLocation) { - this.peeringLocation = peeringLocation; - return this; - } - - /** - * Get the bandwidthInGbps property: Bandwidth of procured ports in Gbps. - * - * @return the bandwidthInGbps value. - */ - public Integer bandwidthInGbps() { - return this.bandwidthInGbps; - } - - /** - * Set the bandwidthInGbps property: Bandwidth of procured ports in Gbps. - * - * @param bandwidthInGbps the bandwidthInGbps value to set. - * @return the ExpressRoutePortPropertiesFormat object itself. - */ - public ExpressRoutePortPropertiesFormat withBandwidthInGbps(Integer bandwidthInGbps) { - this.bandwidthInGbps = bandwidthInGbps; - return this; - } - - /** - * Get the provisionedBandwidthInGbps property: Aggregate Gbps of associated circuit bandwidths. - * - * @return the provisionedBandwidthInGbps value. - */ - public Float provisionedBandwidthInGbps() { - return this.provisionedBandwidthInGbps; - } - - /** - * Get the mtu property: Maximum transmission unit of the physical port pair(s). - * - * @return the mtu value. - */ - public String mtu() { - return this.mtu; - } - - /** - * Get the encapsulation property: Encapsulation method on physical ports. - * - * @return the encapsulation value. - */ - public ExpressRoutePortsEncapsulation encapsulation() { - return this.encapsulation; - } - - /** - * Set the encapsulation property: Encapsulation method on physical ports. - * - * @param encapsulation the encapsulation value to set. - * @return the ExpressRoutePortPropertiesFormat object itself. - */ - public ExpressRoutePortPropertiesFormat withEncapsulation(ExpressRoutePortsEncapsulation encapsulation) { - this.encapsulation = encapsulation; - return this; - } - - /** - * Get the etherType property: Ether type of the physical port. - * - * @return the etherType value. - */ - public String etherType() { - return this.etherType; - } - - /** - * Get the allocationDate property: Date of the physical port allocation to be used in Letter of Authorization. - * - * @return the allocationDate value. - */ - public String allocationDate() { - return this.allocationDate; - } - - /** - * Get the links property: ExpressRouteLink Sub-Resources The set of physical links of the ExpressRoutePort - * resource. - * - * @return the links value. - */ - public List links() { - return this.links; - } - - /** - * Set the links property: ExpressRouteLink Sub-Resources The set of physical links of the ExpressRoutePort - * resource. - * - * @param links the links value to set. - * @return the ExpressRoutePortPropertiesFormat object itself. - */ - public ExpressRoutePortPropertiesFormat withLinks(List links) { - this.links = links; - return this; - } - - /** - * Get the circuits property: Reference the ExpressRoute circuit(s) that are provisioned on this ExpressRoutePort - * resource. - * - * @return the circuits value. - */ - public List circuits() { - return this.circuits; - } - - /** - * Get the provisioningState property: The provisioning state of the ExpressRoutePort resource. Possible values are: - * 'Succeeded', 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Get the resourceGuid property: The resource GUID property of the ExpressRoutePort resource. - * - * @return the resourceGuid value. - */ - public String resourceGuid() { - return this.resourceGuid; - } - - /** - * Set the resourceGuid property: The resource GUID property of the ExpressRoutePort resource. - * - * @param resourceGuid the resourceGuid value to set. - * @return the ExpressRoutePortPropertiesFormat object itself. - */ - public ExpressRoutePortPropertiesFormat withResourceGuid(String resourceGuid) { - this.resourceGuid = resourceGuid; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (links() != null) { - links().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRoutePortsLocationInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRoutePortsLocationInner.java deleted file mode 100644 index 7b54c4c9603d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRoutePortsLocationInner.java +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.ExpressRoutePortsLocationBandwidths; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** ExpressRoutePorts Peering Location Definition of the ExpressRoutePorts peering location resource. */ -@Fluent -public final class ExpressRoutePortsLocationInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRoutePortsLocationInner.class); - - /* - * ExpressRoutePorts Location Properties ExpressRoutePort peering location - * properties - */ - @JsonProperty(value = "properties") - private ExpressRoutePortsLocationPropertiesFormat innerProperties; - - /* - * Resource ID. - */ - @JsonProperty(value = "id") - private String id; - - /** - * Get the innerProperties property: ExpressRoutePorts Location Properties ExpressRoutePort peering location - * properties. - * - * @return the innerProperties value. - */ - private ExpressRoutePortsLocationPropertiesFormat innerProperties() { - return this.innerProperties; - } - - /** - * Get the id property: Resource ID. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: Resource ID. - * - * @param id the id value to set. - * @return the ExpressRoutePortsLocationInner object itself. - */ - public ExpressRoutePortsLocationInner withId(String id) { - this.id = id; - return this; - } - - /** {@inheritDoc} */ - @Override - public ExpressRoutePortsLocationInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public ExpressRoutePortsLocationInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the address property: Address of peering location. - * - * @return the address value. - */ - public String address() { - return this.innerProperties() == null ? null : this.innerProperties().address(); - } - - /** - * Get the contact property: Contact details of peering locations. - * - * @return the contact value. - */ - public String contact() { - return this.innerProperties() == null ? null : this.innerProperties().contact(); - } - - /** - * Get the availableBandwidths property: The inventory of available ExpressRoutePort bandwidths. - * - * @return the availableBandwidths value. - */ - public List availableBandwidths() { - return this.innerProperties() == null ? null : this.innerProperties().availableBandwidths(); - } - - /** - * Set the availableBandwidths property: The inventory of available ExpressRoutePort bandwidths. - * - * @param availableBandwidths the availableBandwidths value to set. - * @return the ExpressRoutePortsLocationInner object itself. - */ - public ExpressRoutePortsLocationInner withAvailableBandwidths( - List availableBandwidths) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpressRoutePortsLocationPropertiesFormat(); - } - this.innerProperties().withAvailableBandwidths(availableBandwidths); - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the ExpressRoutePortLocation resource. Possible - * values are: 'Succeeded', 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRoutePortsLocationPropertiesFormat.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRoutePortsLocationPropertiesFormat.java deleted file mode 100644 index 19c3fec88574..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRoutePortsLocationPropertiesFormat.java +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.ExpressRoutePortsLocationBandwidths; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** ExpressRoutePorts Location Properties Properties specific to ExpressRoutePorts peering location resources. */ -@Fluent -public final class ExpressRoutePortsLocationPropertiesFormat { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRoutePortsLocationPropertiesFormat.class); - - /* - * Address of peering location. - */ - @JsonProperty(value = "address", access = JsonProperty.Access.WRITE_ONLY) - private String address; - - /* - * Contact details of peering locations. - */ - @JsonProperty(value = "contact", access = JsonProperty.Access.WRITE_ONLY) - private String contact; - - /* - * The inventory of available ExpressRoutePort bandwidths. - */ - @JsonProperty(value = "availableBandwidths") - private List availableBandwidths; - - /* - * The provisioning state of the ExpressRoutePortLocation resource. - * Possible values are: 'Succeeded', 'Updating', 'Deleting', and 'Failed'. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; - - /** - * Get the address property: Address of peering location. - * - * @return the address value. - */ - public String address() { - return this.address; - } - - /** - * Get the contact property: Contact details of peering locations. - * - * @return the contact value. - */ - public String contact() { - return this.contact; - } - - /** - * Get the availableBandwidths property: The inventory of available ExpressRoutePort bandwidths. - * - * @return the availableBandwidths value. - */ - public List availableBandwidths() { - return this.availableBandwidths; - } - - /** - * Set the availableBandwidths property: The inventory of available ExpressRoutePort bandwidths. - * - * @param availableBandwidths the availableBandwidths value to set. - * @return the ExpressRoutePortsLocationPropertiesFormat object itself. - */ - public ExpressRoutePortsLocationPropertiesFormat withAvailableBandwidths( - List availableBandwidths) { - this.availableBandwidths = availableBandwidths; - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the ExpressRoutePortLocation resource. Possible - * values are: 'Succeeded', 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (availableBandwidths() != null) { - availableBandwidths().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRouteServiceProviderInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRouteServiceProviderInner.java deleted file mode 100644 index 1c4a5fc19723..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRouteServiceProviderInner.java +++ /dev/null @@ -1,156 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.ExpressRouteServiceProviderBandwidthsOffered; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** A ExpressRouteResourceProvider object. */ -@Fluent -public final class ExpressRouteServiceProviderInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteServiceProviderInner.class); - - /* - * Properties of ExpressRouteServiceProvider. - */ - @JsonProperty(value = "properties") - private ExpressRouteServiceProviderPropertiesFormat innerProperties; - - /* - * Resource ID. - */ - @JsonProperty(value = "id") - private String id; - - /** - * Get the innerProperties property: Properties of ExpressRouteServiceProvider. - * - * @return the innerProperties value. - */ - private ExpressRouteServiceProviderPropertiesFormat innerProperties() { - return this.innerProperties; - } - - /** - * Get the id property: Resource ID. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: Resource ID. - * - * @param id the id value to set. - * @return the ExpressRouteServiceProviderInner object itself. - */ - public ExpressRouteServiceProviderInner withId(String id) { - this.id = id; - return this; - } - - /** {@inheritDoc} */ - @Override - public ExpressRouteServiceProviderInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public ExpressRouteServiceProviderInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the peeringLocations property: Get a list of peering locations. - * - * @return the peeringLocations value. - */ - public List peeringLocations() { - return this.innerProperties() == null ? null : this.innerProperties().peeringLocations(); - } - - /** - * Set the peeringLocations property: Get a list of peering locations. - * - * @param peeringLocations the peeringLocations value to set. - * @return the ExpressRouteServiceProviderInner object itself. - */ - public ExpressRouteServiceProviderInner withPeeringLocations(List peeringLocations) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpressRouteServiceProviderPropertiesFormat(); - } - this.innerProperties().withPeeringLocations(peeringLocations); - return this; - } - - /** - * Get the bandwidthsOffered property: Gets bandwidths offered. - * - * @return the bandwidthsOffered value. - */ - public List bandwidthsOffered() { - return this.innerProperties() == null ? null : this.innerProperties().bandwidthsOffered(); - } - - /** - * Set the bandwidthsOffered property: Gets bandwidths offered. - * - * @param bandwidthsOffered the bandwidthsOffered value to set. - * @return the ExpressRouteServiceProviderInner object itself. - */ - public ExpressRouteServiceProviderInner withBandwidthsOffered( - List bandwidthsOffered) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpressRouteServiceProviderPropertiesFormat(); - } - this.innerProperties().withBandwidthsOffered(bandwidthsOffered); - return this; - } - - /** - * Get the provisioningState property: Gets the provisioning state of the resource. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Set the provisioningState property: Gets the provisioning state of the resource. - * - * @param provisioningState the provisioningState value to set. - * @return the ExpressRouteServiceProviderInner object itself. - */ - public ExpressRouteServiceProviderInner withProvisioningState(String provisioningState) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpressRouteServiceProviderPropertiesFormat(); - } - this.innerProperties().withProvisioningState(provisioningState); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRouteServiceProviderPropertiesFormat.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRouteServiceProviderPropertiesFormat.java deleted file mode 100644 index 2e65a7991a4a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ExpressRouteServiceProviderPropertiesFormat.java +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.ExpressRouteServiceProviderBandwidthsOffered; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Properties of ExpressRouteServiceProvider. */ -@Fluent -public final class ExpressRouteServiceProviderPropertiesFormat { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteServiceProviderPropertiesFormat.class); - - /* - * Get a list of peering locations. - */ - @JsonProperty(value = "peeringLocations") - private List peeringLocations; - - /* - * Gets bandwidths offered. - */ - @JsonProperty(value = "bandwidthsOffered") - private List bandwidthsOffered; - - /* - * Gets the provisioning state of the resource. - */ - @JsonProperty(value = "provisioningState") - private String provisioningState; - - /** - * Get the peeringLocations property: Get a list of peering locations. - * - * @return the peeringLocations value. - */ - public List peeringLocations() { - return this.peeringLocations; - } - - /** - * Set the peeringLocations property: Get a list of peering locations. - * - * @param peeringLocations the peeringLocations value to set. - * @return the ExpressRouteServiceProviderPropertiesFormat object itself. - */ - public ExpressRouteServiceProviderPropertiesFormat withPeeringLocations(List peeringLocations) { - this.peeringLocations = peeringLocations; - return this; - } - - /** - * Get the bandwidthsOffered property: Gets bandwidths offered. - * - * @return the bandwidthsOffered value. - */ - public List bandwidthsOffered() { - return this.bandwidthsOffered; - } - - /** - * Set the bandwidthsOffered property: Gets bandwidths offered. - * - * @param bandwidthsOffered the bandwidthsOffered value to set. - * @return the ExpressRouteServiceProviderPropertiesFormat object itself. - */ - public ExpressRouteServiceProviderPropertiesFormat withBandwidthsOffered( - List bandwidthsOffered) { - this.bandwidthsOffered = bandwidthsOffered; - return this; - } - - /** - * Get the provisioningState property: Gets the provisioning state of the resource. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Set the provisioningState property: Gets the provisioning state of the resource. - * - * @param provisioningState the provisioningState value to set. - * @return the ExpressRouteServiceProviderPropertiesFormat object itself. - */ - public ExpressRouteServiceProviderPropertiesFormat withProvisioningState(String provisioningState) { - this.provisioningState = provisioningState; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (bandwidthsOffered() != null) { - bandwidthsOffered().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/FlowLogInformationInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/FlowLogInformationInner.java deleted file mode 100644 index 72772f557b45..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/FlowLogInformationInner.java +++ /dev/null @@ -1,207 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.FlowLogFormatParameters; -import com.azure.resourcemanager.network.models.RetentionPolicyParameters; -import com.azure.resourcemanager.network.models.TrafficAnalyticsProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Information on the configuration of flow log and traffic analytics (optional) . */ -@Fluent -public final class FlowLogInformationInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(FlowLogInformationInner.class); - - /* - * The ID of the resource to configure for flow log and traffic analytics - * (optional) . - */ - @JsonProperty(value = "targetResourceId", required = true) - private String targetResourceId; - - /* - * Parameters that define the configuration of flow log. - */ - @JsonProperty(value = "properties", required = true) - private FlowLogProperties innerProperties = new FlowLogProperties(); - - /* - * Parameters that define the configuration of traffic analytics. - */ - @JsonProperty(value = "flowAnalyticsConfiguration") - private TrafficAnalyticsProperties flowAnalyticsConfiguration; - - /** - * Get the targetResourceId property: The ID of the resource to configure for flow log and traffic analytics - * (optional) . - * - * @return the targetResourceId value. - */ - public String targetResourceId() { - return this.targetResourceId; - } - - /** - * Set the targetResourceId property: The ID of the resource to configure for flow log and traffic analytics - * (optional) . - * - * @param targetResourceId the targetResourceId value to set. - * @return the FlowLogInformationInner object itself. - */ - public FlowLogInformationInner withTargetResourceId(String targetResourceId) { - this.targetResourceId = targetResourceId; - return this; - } - - /** - * Get the innerProperties property: Parameters that define the configuration of flow log. - * - * @return the innerProperties value. - */ - private FlowLogProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the flowAnalyticsConfiguration property: Parameters that define the configuration of traffic analytics. - * - * @return the flowAnalyticsConfiguration value. - */ - public TrafficAnalyticsProperties flowAnalyticsConfiguration() { - return this.flowAnalyticsConfiguration; - } - - /** - * Set the flowAnalyticsConfiguration property: Parameters that define the configuration of traffic analytics. - * - * @param flowAnalyticsConfiguration the flowAnalyticsConfiguration value to set. - * @return the FlowLogInformationInner object itself. - */ - public FlowLogInformationInner withFlowAnalyticsConfiguration( - TrafficAnalyticsProperties flowAnalyticsConfiguration) { - this.flowAnalyticsConfiguration = flowAnalyticsConfiguration; - return this; - } - - /** - * Get the storageId property: ID of the storage account which is used to store the flow log. - * - * @return the storageId value. - */ - public String storageId() { - return this.innerProperties() == null ? null : this.innerProperties().storageId(); - } - - /** - * Set the storageId property: ID of the storage account which is used to store the flow log. - * - * @param storageId the storageId value to set. - * @return the FlowLogInformationInner object itself. - */ - public FlowLogInformationInner withStorageId(String storageId) { - if (this.innerProperties() == null) { - this.innerProperties = new FlowLogProperties(); - } - this.innerProperties().withStorageId(storageId); - return this; - } - - /** - * Get the enabled property: Flag to enable/disable flow logging. - * - * @return the enabled value. - */ - public boolean enabled() { - return this.innerProperties() == null ? false : this.innerProperties().enabled(); - } - - /** - * Set the enabled property: Flag to enable/disable flow logging. - * - * @param enabled the enabled value to set. - * @return the FlowLogInformationInner object itself. - */ - public FlowLogInformationInner withEnabled(boolean enabled) { - if (this.innerProperties() == null) { - this.innerProperties = new FlowLogProperties(); - } - this.innerProperties().withEnabled(enabled); - return this; - } - - /** - * Get the retentionPolicy property: Parameters that define the retention policy for flow log. - * - * @return the retentionPolicy value. - */ - public RetentionPolicyParameters retentionPolicy() { - return this.innerProperties() == null ? null : this.innerProperties().retentionPolicy(); - } - - /** - * Set the retentionPolicy property: Parameters that define the retention policy for flow log. - * - * @param retentionPolicy the retentionPolicy value to set. - * @return the FlowLogInformationInner object itself. - */ - public FlowLogInformationInner withRetentionPolicy(RetentionPolicyParameters retentionPolicy) { - if (this.innerProperties() == null) { - this.innerProperties = new FlowLogProperties(); - } - this.innerProperties().withRetentionPolicy(retentionPolicy); - return this; - } - - /** - * Get the format property: Parameters that define the flow log format. - * - * @return the format value. - */ - public FlowLogFormatParameters format() { - return this.innerProperties() == null ? null : this.innerProperties().format(); - } - - /** - * Set the format property: Parameters that define the flow log format. - * - * @param format the format value to set. - * @return the FlowLogInformationInner object itself. - */ - public FlowLogInformationInner withFormat(FlowLogFormatParameters format) { - if (this.innerProperties() == null) { - this.innerProperties = new FlowLogProperties(); - } - this.innerProperties().withFormat(format); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (targetResourceId() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property targetResourceId in model FlowLogInformationInner")); - } - if (innerProperties() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property innerProperties in model FlowLogInformationInner")); - } else { - innerProperties().validate(); - } - if (flowAnalyticsConfiguration() != null) { - flowAnalyticsConfiguration().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/FlowLogProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/FlowLogProperties.java deleted file mode 100644 index 20a233f0aa2a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/FlowLogProperties.java +++ /dev/null @@ -1,141 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.FlowLogFormatParameters; -import com.azure.resourcemanager.network.models.RetentionPolicyParameters; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Parameters that define the configuration of flow log. */ -@Fluent -public final class FlowLogProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(FlowLogProperties.class); - - /* - * ID of the storage account which is used to store the flow log. - */ - @JsonProperty(value = "storageId", required = true) - private String storageId; - - /* - * Flag to enable/disable flow logging. - */ - @JsonProperty(value = "enabled", required = true) - private boolean enabled; - - /* - * Parameters that define the retention policy for flow log. - */ - @JsonProperty(value = "retentionPolicy") - private RetentionPolicyParameters retentionPolicy; - - /* - * Parameters that define the flow log format. - */ - @JsonProperty(value = "format") - private FlowLogFormatParameters format; - - /** - * Get the storageId property: ID of the storage account which is used to store the flow log. - * - * @return the storageId value. - */ - public String storageId() { - return this.storageId; - } - - /** - * Set the storageId property: ID of the storage account which is used to store the flow log. - * - * @param storageId the storageId value to set. - * @return the FlowLogProperties object itself. - */ - public FlowLogProperties withStorageId(String storageId) { - this.storageId = storageId; - return this; - } - - /** - * Get the enabled property: Flag to enable/disable flow logging. - * - * @return the enabled value. - */ - public boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Flag to enable/disable flow logging. - * - * @param enabled the enabled value to set. - * @return the FlowLogProperties object itself. - */ - public FlowLogProperties withEnabled(boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the retentionPolicy property: Parameters that define the retention policy for flow log. - * - * @return the retentionPolicy value. - */ - public RetentionPolicyParameters retentionPolicy() { - return this.retentionPolicy; - } - - /** - * Set the retentionPolicy property: Parameters that define the retention policy for flow log. - * - * @param retentionPolicy the retentionPolicy value to set. - * @return the FlowLogProperties object itself. - */ - public FlowLogProperties withRetentionPolicy(RetentionPolicyParameters retentionPolicy) { - this.retentionPolicy = retentionPolicy; - return this; - } - - /** - * Get the format property: Parameters that define the flow log format. - * - * @return the format value. - */ - public FlowLogFormatParameters format() { - return this.format; - } - - /** - * Set the format property: Parameters that define the flow log format. - * - * @param format the format value to set. - * @return the FlowLogProperties object itself. - */ - public FlowLogProperties withFormat(FlowLogFormatParameters format) { - this.format = format; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (storageId() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property storageId in model FlowLogProperties")); - } - if (retentionPolicy() != null) { - retentionPolicy().validate(); - } - if (format() != null) { - format().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/FrontendIpConfigurationInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/FrontendIpConfigurationInner.java deleted file mode 100644 index e602cdbd3937..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/FrontendIpConfigurationInner.java +++ /dev/null @@ -1,314 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.IpAllocationMethod; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Frontend IP address of the load balancer. */ -@Fluent -public final class FrontendIpConfigurationInner extends SubResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(FrontendIpConfigurationInner.class); - - /* - * Properties of the load balancer probe. - */ - @JsonProperty(value = "properties") - private FrontendIpConfigurationPropertiesFormatInner innerProperties; - - /* - * The name of the resource that is unique within a resource group. This - * name can be used to access the resource. - */ - @JsonProperty(value = "name") - private String name; - - /* - * A unique read-only string that changes whenever the resource is updated. - */ - @JsonProperty(value = "etag") - private String etag; - - /* - * A list of availability zones denoting the IP allocated for the resource - * needs to come from. - */ - @JsonProperty(value = "zones") - private List zones; - - /** - * Get the innerProperties property: Properties of the load balancer probe. - * - * @return the innerProperties value. - */ - private FrontendIpConfigurationPropertiesFormatInner innerProperties() { - return this.innerProperties; - } - - /** - * Get the name property: The name of the resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @param name the name value to set. - * @return the FrontendIpConfigurationInner object itself. - */ - public FrontendIpConfigurationInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @param etag the etag value to set. - * @return the FrontendIpConfigurationInner object itself. - */ - public FrontendIpConfigurationInner withEtag(String etag) { - this.etag = etag; - return this; - } - - /** - * Get the zones property: A list of availability zones denoting the IP allocated for the resource needs to come - * from. - * - * @return the zones value. - */ - public List zones() { - return this.zones; - } - - /** - * Set the zones property: A list of availability zones denoting the IP allocated for the resource needs to come - * from. - * - * @param zones the zones value to set. - * @return the FrontendIpConfigurationInner object itself. - */ - public FrontendIpConfigurationInner withZones(List zones) { - this.zones = zones; - return this; - } - - /** {@inheritDoc} */ - @Override - public FrontendIpConfigurationInner withId(String id) { - super.withId(id); - return this; - } - - /** - * Get the inboundNatRules property: Read only. Inbound rules URIs that use this frontend IP. - * - * @return the inboundNatRules value. - */ - public List inboundNatRules() { - return this.innerProperties() == null ? null : this.innerProperties().inboundNatRules(); - } - - /** - * Get the inboundNatPools property: Read only. Inbound pools URIs that use this frontend IP. - * - * @return the inboundNatPools value. - */ - public List inboundNatPools() { - return this.innerProperties() == null ? null : this.innerProperties().inboundNatPools(); - } - - /** - * Get the outboundRules property: Read only. Outbound rules URIs that use this frontend IP. - * - * @return the outboundRules value. - */ - public List outboundRules() { - return this.innerProperties() == null ? null : this.innerProperties().outboundRules(); - } - - /** - * Get the loadBalancingRules property: Gets load balancing rules URIs that use this frontend IP. - * - * @return the loadBalancingRules value. - */ - public List loadBalancingRules() { - return this.innerProperties() == null ? null : this.innerProperties().loadBalancingRules(); - } - - /** - * Get the privateIpAddress property: The private IP address of the IP configuration. - * - * @return the privateIpAddress value. - */ - public String privateIpAddress() { - return this.innerProperties() == null ? null : this.innerProperties().privateIpAddress(); - } - - /** - * Set the privateIpAddress property: The private IP address of the IP configuration. - * - * @param privateIpAddress the privateIpAddress value to set. - * @return the FrontendIpConfigurationInner object itself. - */ - public FrontendIpConfigurationInner withPrivateIpAddress(String privateIpAddress) { - if (this.innerProperties() == null) { - this.innerProperties = new FrontendIpConfigurationPropertiesFormatInner(); - } - this.innerProperties().withPrivateIpAddress(privateIpAddress); - return this; - } - - /** - * Get the privateIpAllocationMethod property: The Private IP allocation method. Possible values are: 'Static' and - * 'Dynamic'. - * - * @return the privateIpAllocationMethod value. - */ - public IpAllocationMethod privateIpAllocationMethod() { - return this.innerProperties() == null ? null : this.innerProperties().privateIpAllocationMethod(); - } - - /** - * Set the privateIpAllocationMethod property: The Private IP allocation method. Possible values are: 'Static' and - * 'Dynamic'. - * - * @param privateIpAllocationMethod the privateIpAllocationMethod value to set. - * @return the FrontendIpConfigurationInner object itself. - */ - public FrontendIpConfigurationInner withPrivateIpAllocationMethod(IpAllocationMethod privateIpAllocationMethod) { - if (this.innerProperties() == null) { - this.innerProperties = new FrontendIpConfigurationPropertiesFormatInner(); - } - this.innerProperties().withPrivateIpAllocationMethod(privateIpAllocationMethod); - return this; - } - - /** - * Get the subnet property: The reference of the subnet resource. - * - * @return the subnet value. - */ - public SubnetInner subnet() { - return this.innerProperties() == null ? null : this.innerProperties().subnet(); - } - - /** - * Set the subnet property: The reference of the subnet resource. - * - * @param subnet the subnet value to set. - * @return the FrontendIpConfigurationInner object itself. - */ - public FrontendIpConfigurationInner withSubnet(SubnetInner subnet) { - if (this.innerProperties() == null) { - this.innerProperties = new FrontendIpConfigurationPropertiesFormatInner(); - } - this.innerProperties().withSubnet(subnet); - return this; - } - - /** - * Get the publicIpAddress property: The reference of the Public IP resource. - * - * @return the publicIpAddress value. - */ - public PublicIpAddressInner publicIpAddress() { - return this.innerProperties() == null ? null : this.innerProperties().publicIpAddress(); - } - - /** - * Set the publicIpAddress property: The reference of the Public IP resource. - * - * @param publicIpAddress the publicIpAddress value to set. - * @return the FrontendIpConfigurationInner object itself. - */ - public FrontendIpConfigurationInner withPublicIpAddress(PublicIpAddressInner publicIpAddress) { - if (this.innerProperties() == null) { - this.innerProperties = new FrontendIpConfigurationPropertiesFormatInner(); - } - this.innerProperties().withPublicIpAddress(publicIpAddress); - return this; - } - - /** - * Get the publicIpPrefix property: The reference of the Public IP Prefix resource. - * - * @return the publicIpPrefix value. - */ - public SubResource publicIpPrefix() { - return this.innerProperties() == null ? null : this.innerProperties().publicIpPrefix(); - } - - /** - * Set the publicIpPrefix property: The reference of the Public IP Prefix resource. - * - * @param publicIpPrefix the publicIpPrefix value to set. - * @return the FrontendIpConfigurationInner object itself. - */ - public FrontendIpConfigurationInner withPublicIpPrefix(SubResource publicIpPrefix) { - if (this.innerProperties() == null) { - this.innerProperties = new FrontendIpConfigurationPropertiesFormatInner(); - } - this.innerProperties().withPublicIpPrefix(publicIpPrefix); - return this; - } - - /** - * Get the provisioningState property: Gets the provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Set the provisioningState property: Gets the provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param provisioningState the provisioningState value to set. - * @return the FrontendIpConfigurationInner object itself. - */ - public FrontendIpConfigurationInner withProvisioningState(String provisioningState) { - if (this.innerProperties() == null) { - this.innerProperties = new FrontendIpConfigurationPropertiesFormatInner(); - } - this.innerProperties().withProvisioningState(provisioningState); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/FrontendIpConfigurationPropertiesFormatInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/FrontendIpConfigurationPropertiesFormatInner.java deleted file mode 100644 index 8ca4a5b3ce41..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/FrontendIpConfigurationPropertiesFormatInner.java +++ /dev/null @@ -1,257 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.IpAllocationMethod; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Properties of Frontend IP Configuration of the load balancer. */ -@Fluent -public final class FrontendIpConfigurationPropertiesFormatInner { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(FrontendIpConfigurationPropertiesFormatInner.class); - - /* - * Read only. Inbound rules URIs that use this frontend IP. - */ - @JsonProperty(value = "inboundNatRules", access = JsonProperty.Access.WRITE_ONLY) - private List inboundNatRules; - - /* - * Read only. Inbound pools URIs that use this frontend IP. - */ - @JsonProperty(value = "inboundNatPools", access = JsonProperty.Access.WRITE_ONLY) - private List inboundNatPools; - - /* - * Read only. Outbound rules URIs that use this frontend IP. - */ - @JsonProperty(value = "outboundRules", access = JsonProperty.Access.WRITE_ONLY) - private List outboundRules; - - /* - * Gets load balancing rules URIs that use this frontend IP. - */ - @JsonProperty(value = "loadBalancingRules", access = JsonProperty.Access.WRITE_ONLY) - private List loadBalancingRules; - - /* - * The private IP address of the IP configuration. - */ - @JsonProperty(value = "privateIPAddress") - private String privateIpAddress; - - /* - * The Private IP allocation method. Possible values are: 'Static' and - * 'Dynamic'. - */ - @JsonProperty(value = "privateIPAllocationMethod") - private IpAllocationMethod privateIpAllocationMethod; - - /* - * The reference of the subnet resource. - */ - @JsonProperty(value = "subnet") - private SubnetInner subnet; - - /* - * The reference of the Public IP resource. - */ - @JsonProperty(value = "publicIPAddress") - private PublicIpAddressInner publicIpAddress; - - /* - * The reference of the Public IP Prefix resource. - */ - @JsonProperty(value = "publicIPPrefix") - private SubResource publicIpPrefix; - - /* - * Gets the provisioning state of the public IP resource. Possible values - * are: 'Updating', 'Deleting', and 'Failed'. - */ - @JsonProperty(value = "provisioningState") - private String provisioningState; - - /** - * Get the inboundNatRules property: Read only. Inbound rules URIs that use this frontend IP. - * - * @return the inboundNatRules value. - */ - public List inboundNatRules() { - return this.inboundNatRules; - } - - /** - * Get the inboundNatPools property: Read only. Inbound pools URIs that use this frontend IP. - * - * @return the inboundNatPools value. - */ - public List inboundNatPools() { - return this.inboundNatPools; - } - - /** - * Get the outboundRules property: Read only. Outbound rules URIs that use this frontend IP. - * - * @return the outboundRules value. - */ - public List outboundRules() { - return this.outboundRules; - } - - /** - * Get the loadBalancingRules property: Gets load balancing rules URIs that use this frontend IP. - * - * @return the loadBalancingRules value. - */ - public List loadBalancingRules() { - return this.loadBalancingRules; - } - - /** - * Get the privateIpAddress property: The private IP address of the IP configuration. - * - * @return the privateIpAddress value. - */ - public String privateIpAddress() { - return this.privateIpAddress; - } - - /** - * Set the privateIpAddress property: The private IP address of the IP configuration. - * - * @param privateIpAddress the privateIpAddress value to set. - * @return the FrontendIpConfigurationPropertiesFormatInner object itself. - */ - public FrontendIpConfigurationPropertiesFormatInner withPrivateIpAddress(String privateIpAddress) { - this.privateIpAddress = privateIpAddress; - return this; - } - - /** - * Get the privateIpAllocationMethod property: The Private IP allocation method. Possible values are: 'Static' and - * 'Dynamic'. - * - * @return the privateIpAllocationMethod value. - */ - public IpAllocationMethod privateIpAllocationMethod() { - return this.privateIpAllocationMethod; - } - - /** - * Set the privateIpAllocationMethod property: The Private IP allocation method. Possible values are: 'Static' and - * 'Dynamic'. - * - * @param privateIpAllocationMethod the privateIpAllocationMethod value to set. - * @return the FrontendIpConfigurationPropertiesFormatInner object itself. - */ - public FrontendIpConfigurationPropertiesFormatInner withPrivateIpAllocationMethod( - IpAllocationMethod privateIpAllocationMethod) { - this.privateIpAllocationMethod = privateIpAllocationMethod; - return this; - } - - /** - * Get the subnet property: The reference of the subnet resource. - * - * @return the subnet value. - */ - public SubnetInner subnet() { - return this.subnet; - } - - /** - * Set the subnet property: The reference of the subnet resource. - * - * @param subnet the subnet value to set. - * @return the FrontendIpConfigurationPropertiesFormatInner object itself. - */ - public FrontendIpConfigurationPropertiesFormatInner withSubnet(SubnetInner subnet) { - this.subnet = subnet; - return this; - } - - /** - * Get the publicIpAddress property: The reference of the Public IP resource. - * - * @return the publicIpAddress value. - */ - public PublicIpAddressInner publicIpAddress() { - return this.publicIpAddress; - } - - /** - * Set the publicIpAddress property: The reference of the Public IP resource. - * - * @param publicIpAddress the publicIpAddress value to set. - * @return the FrontendIpConfigurationPropertiesFormatInner object itself. - */ - public FrontendIpConfigurationPropertiesFormatInner withPublicIpAddress(PublicIpAddressInner publicIpAddress) { - this.publicIpAddress = publicIpAddress; - return this; - } - - /** - * Get the publicIpPrefix property: The reference of the Public IP Prefix resource. - * - * @return the publicIpPrefix value. - */ - public SubResource publicIpPrefix() { - return this.publicIpPrefix; - } - - /** - * Set the publicIpPrefix property: The reference of the Public IP Prefix resource. - * - * @param publicIpPrefix the publicIpPrefix value to set. - * @return the FrontendIpConfigurationPropertiesFormatInner object itself. - */ - public FrontendIpConfigurationPropertiesFormatInner withPublicIpPrefix(SubResource publicIpPrefix) { - this.publicIpPrefix = publicIpPrefix; - return this; - } - - /** - * Get the provisioningState property: Gets the provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Set the provisioningState property: Gets the provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param provisioningState the provisioningState value to set. - * @return the FrontendIpConfigurationPropertiesFormatInner object itself. - */ - public FrontendIpConfigurationPropertiesFormatInner withProvisioningState(String provisioningState) { - this.provisioningState = provisioningState; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (subnet() != null) { - subnet().validate(); - } - if (publicIpAddress() != null) { - publicIpAddress().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/GatewayRouteListResultInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/GatewayRouteListResultInner.java deleted file mode 100644 index 679bad23c1c5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/GatewayRouteListResultInner.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.GatewayRoute; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** List of virtual network gateway routes. */ -@Fluent -public final class GatewayRouteListResultInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(GatewayRouteListResultInner.class); - - /* - * List of gateway routes - */ - @JsonProperty(value = "value") - private List value; - - /** - * Get the value property: List of gateway routes. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: List of gateway routes. - * - * @param value the value value to set. - * @return the GatewayRouteListResultInner object itself. - */ - public GatewayRouteListResultInner withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/HubVirtualNetworkConnectionInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/HubVirtualNetworkConnectionInner.java deleted file mode 100644 index 8f6a0a8c955e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/HubVirtualNetworkConnectionInner.java +++ /dev/null @@ -1,212 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.ProvisioningState; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** HubVirtualNetworkConnection Resource. */ -@Fluent -public final class HubVirtualNetworkConnectionInner extends SubResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(HubVirtualNetworkConnectionInner.class); - - /* - * Parameters for HubVirtualNetworkConnection - */ - @JsonProperty(value = "properties") - private HubVirtualNetworkConnectionProperties innerProperties; - - /* - * The name of the resource that is unique within a resource group. This - * name can be used to access the resource. - */ - @JsonProperty(value = "name") - private String name; - - /* - * Gets a unique read-only string that changes whenever the resource is - * updated. - */ - @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) - private String etag; - - /** - * Get the innerProperties property: Parameters for HubVirtualNetworkConnection. - * - * @return the innerProperties value. - */ - private HubVirtualNetworkConnectionProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the name property: The name of the resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @param name the name value to set. - * @return the HubVirtualNetworkConnectionInner object itself. - */ - public HubVirtualNetworkConnectionInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the etag property: Gets a unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** {@inheritDoc} */ - @Override - public HubVirtualNetworkConnectionInner withId(String id) { - super.withId(id); - return this; - } - - /** - * Get the remoteVirtualNetwork property: Reference to the remote virtual network. - * - * @return the remoteVirtualNetwork value. - */ - public SubResource remoteVirtualNetwork() { - return this.innerProperties() == null ? null : this.innerProperties().remoteVirtualNetwork(); - } - - /** - * Set the remoteVirtualNetwork property: Reference to the remote virtual network. - * - * @param remoteVirtualNetwork the remoteVirtualNetwork value to set. - * @return the HubVirtualNetworkConnectionInner object itself. - */ - public HubVirtualNetworkConnectionInner withRemoteVirtualNetwork(SubResource remoteVirtualNetwork) { - if (this.innerProperties() == null) { - this.innerProperties = new HubVirtualNetworkConnectionProperties(); - } - this.innerProperties().withRemoteVirtualNetwork(remoteVirtualNetwork); - return this; - } - - /** - * Get the allowHubToRemoteVnetTransit property: VirtualHub to RemoteVnet transit to enabled or not. - * - * @return the allowHubToRemoteVnetTransit value. - */ - public Boolean allowHubToRemoteVnetTransit() { - return this.innerProperties() == null ? null : this.innerProperties().allowHubToRemoteVnetTransit(); - } - - /** - * Set the allowHubToRemoteVnetTransit property: VirtualHub to RemoteVnet transit to enabled or not. - * - * @param allowHubToRemoteVnetTransit the allowHubToRemoteVnetTransit value to set. - * @return the HubVirtualNetworkConnectionInner object itself. - */ - public HubVirtualNetworkConnectionInner withAllowHubToRemoteVnetTransit(Boolean allowHubToRemoteVnetTransit) { - if (this.innerProperties() == null) { - this.innerProperties = new HubVirtualNetworkConnectionProperties(); - } - this.innerProperties().withAllowHubToRemoteVnetTransit(allowHubToRemoteVnetTransit); - return this; - } - - /** - * Get the allowRemoteVnetToUseHubVnetGateways property: Allow RemoteVnet to use Virtual Hub's gateways. - * - * @return the allowRemoteVnetToUseHubVnetGateways value. - */ - public Boolean allowRemoteVnetToUseHubVnetGateways() { - return this.innerProperties() == null ? null : this.innerProperties().allowRemoteVnetToUseHubVnetGateways(); - } - - /** - * Set the allowRemoteVnetToUseHubVnetGateways property: Allow RemoteVnet to use Virtual Hub's gateways. - * - * @param allowRemoteVnetToUseHubVnetGateways the allowRemoteVnetToUseHubVnetGateways value to set. - * @return the HubVirtualNetworkConnectionInner object itself. - */ - public HubVirtualNetworkConnectionInner withAllowRemoteVnetToUseHubVnetGateways( - Boolean allowRemoteVnetToUseHubVnetGateways) { - if (this.innerProperties() == null) { - this.innerProperties = new HubVirtualNetworkConnectionProperties(); - } - this.innerProperties().withAllowRemoteVnetToUseHubVnetGateways(allowRemoteVnetToUseHubVnetGateways); - return this; - } - - /** - * Get the enableInternetSecurity property: Enable internet security. - * - * @return the enableInternetSecurity value. - */ - public Boolean enableInternetSecurity() { - return this.innerProperties() == null ? null : this.innerProperties().enableInternetSecurity(); - } - - /** - * Set the enableInternetSecurity property: Enable internet security. - * - * @param enableInternetSecurity the enableInternetSecurity value to set. - * @return the HubVirtualNetworkConnectionInner object itself. - */ - public HubVirtualNetworkConnectionInner withEnableInternetSecurity(Boolean enableInternetSecurity) { - if (this.innerProperties() == null) { - this.innerProperties = new HubVirtualNetworkConnectionProperties(); - } - this.innerProperties().withEnableInternetSecurity(enableInternetSecurity); - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the resource. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Set the provisioningState property: The provisioning state of the resource. - * - * @param provisioningState the provisioningState value to set. - * @return the HubVirtualNetworkConnectionInner object itself. - */ - public HubVirtualNetworkConnectionInner withProvisioningState(ProvisioningState provisioningState) { - if (this.innerProperties() == null) { - this.innerProperties = new HubVirtualNetworkConnectionProperties(); - } - this.innerProperties().withProvisioningState(provisioningState); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/HubVirtualNetworkConnectionProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/HubVirtualNetworkConnectionProperties.java deleted file mode 100644 index e0904e7b4367..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/HubVirtualNetworkConnectionProperties.java +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.ProvisioningState; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Parameters for HubVirtualNetworkConnection. */ -@Fluent -public final class HubVirtualNetworkConnectionProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(HubVirtualNetworkConnectionProperties.class); - - /* - * Reference to the remote virtual network. - */ - @JsonProperty(value = "remoteVirtualNetwork") - private SubResource remoteVirtualNetwork; - - /* - * VirtualHub to RemoteVnet transit to enabled or not. - */ - @JsonProperty(value = "allowHubToRemoteVnetTransit") - private Boolean allowHubToRemoteVnetTransit; - - /* - * Allow RemoteVnet to use Virtual Hub's gateways. - */ - @JsonProperty(value = "allowRemoteVnetToUseHubVnetGateways") - private Boolean allowRemoteVnetToUseHubVnetGateways; - - /* - * Enable internet security - */ - @JsonProperty(value = "enableInternetSecurity") - private Boolean enableInternetSecurity; - - /* - * The provisioning state of the resource. - */ - @JsonProperty(value = "provisioningState") - private ProvisioningState provisioningState; - - /** - * Get the remoteVirtualNetwork property: Reference to the remote virtual network. - * - * @return the remoteVirtualNetwork value. - */ - public SubResource remoteVirtualNetwork() { - return this.remoteVirtualNetwork; - } - - /** - * Set the remoteVirtualNetwork property: Reference to the remote virtual network. - * - * @param remoteVirtualNetwork the remoteVirtualNetwork value to set. - * @return the HubVirtualNetworkConnectionProperties object itself. - */ - public HubVirtualNetworkConnectionProperties withRemoteVirtualNetwork(SubResource remoteVirtualNetwork) { - this.remoteVirtualNetwork = remoteVirtualNetwork; - return this; - } - - /** - * Get the allowHubToRemoteVnetTransit property: VirtualHub to RemoteVnet transit to enabled or not. - * - * @return the allowHubToRemoteVnetTransit value. - */ - public Boolean allowHubToRemoteVnetTransit() { - return this.allowHubToRemoteVnetTransit; - } - - /** - * Set the allowHubToRemoteVnetTransit property: VirtualHub to RemoteVnet transit to enabled or not. - * - * @param allowHubToRemoteVnetTransit the allowHubToRemoteVnetTransit value to set. - * @return the HubVirtualNetworkConnectionProperties object itself. - */ - public HubVirtualNetworkConnectionProperties withAllowHubToRemoteVnetTransit(Boolean allowHubToRemoteVnetTransit) { - this.allowHubToRemoteVnetTransit = allowHubToRemoteVnetTransit; - return this; - } - - /** - * Get the allowRemoteVnetToUseHubVnetGateways property: Allow RemoteVnet to use Virtual Hub's gateways. - * - * @return the allowRemoteVnetToUseHubVnetGateways value. - */ - public Boolean allowRemoteVnetToUseHubVnetGateways() { - return this.allowRemoteVnetToUseHubVnetGateways; - } - - /** - * Set the allowRemoteVnetToUseHubVnetGateways property: Allow RemoteVnet to use Virtual Hub's gateways. - * - * @param allowRemoteVnetToUseHubVnetGateways the allowRemoteVnetToUseHubVnetGateways value to set. - * @return the HubVirtualNetworkConnectionProperties object itself. - */ - public HubVirtualNetworkConnectionProperties withAllowRemoteVnetToUseHubVnetGateways( - Boolean allowRemoteVnetToUseHubVnetGateways) { - this.allowRemoteVnetToUseHubVnetGateways = allowRemoteVnetToUseHubVnetGateways; - return this; - } - - /** - * Get the enableInternetSecurity property: Enable internet security. - * - * @return the enableInternetSecurity value. - */ - public Boolean enableInternetSecurity() { - return this.enableInternetSecurity; - } - - /** - * Set the enableInternetSecurity property: Enable internet security. - * - * @param enableInternetSecurity the enableInternetSecurity value to set. - * @return the HubVirtualNetworkConnectionProperties object itself. - */ - public HubVirtualNetworkConnectionProperties withEnableInternetSecurity(Boolean enableInternetSecurity) { - this.enableInternetSecurity = enableInternetSecurity; - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the resource. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Set the provisioningState property: The provisioning state of the resource. - * - * @param provisioningState the provisioningState value to set. - * @return the HubVirtualNetworkConnectionProperties object itself. - */ - public HubVirtualNetworkConnectionProperties withProvisioningState(ProvisioningState provisioningState) { - this.provisioningState = provisioningState; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/InboundNatPoolPropertiesFormat.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/InboundNatPoolPropertiesFormat.java deleted file mode 100644 index 5876d5c34ead..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/InboundNatPoolPropertiesFormat.java +++ /dev/null @@ -1,296 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.TransportProtocol; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Properties of Inbound NAT pool. */ -@Fluent -public final class InboundNatPoolPropertiesFormat { - @JsonIgnore private final ClientLogger logger = new ClientLogger(InboundNatPoolPropertiesFormat.class); - - /* - * A reference to frontend IP addresses. - */ - @JsonProperty(value = "frontendIPConfiguration") - private SubResource frontendIpConfiguration; - - /* - * The transport protocol for the endpoint. Possible values are 'Udp' or - * 'Tcp' or 'All'. - */ - @JsonProperty(value = "protocol", required = true) - private TransportProtocol protocol; - - /* - * The first port number in the range of external ports that will be used - * to provide Inbound Nat to NICs associated with a load balancer. - * Acceptable values range between 1 and 65534. - */ - @JsonProperty(value = "frontendPortRangeStart", required = true) - private int frontendPortRangeStart; - - /* - * The last port number in the range of external ports that will be used to - * provide Inbound Nat to NICs associated with a load balancer. Acceptable - * values range between 1 and 65535. - */ - @JsonProperty(value = "frontendPortRangeEnd", required = true) - private int frontendPortRangeEnd; - - /* - * The port used for internal connections on the endpoint. Acceptable - * values are between 1 and 65535. - */ - @JsonProperty(value = "backendPort", required = true) - private int backendPort; - - /* - * The timeout for the TCP idle connection. The value can be set between 4 - * and 30 minutes. The default value is 4 minutes. This element is only - * used when the protocol is set to TCP. - */ - @JsonProperty(value = "idleTimeoutInMinutes") - private Integer idleTimeoutInMinutes; - - /* - * Configures a virtual machine's endpoint for the floating IP capability - * required to configure a SQL AlwaysOn Availability Group. This setting is - * required when using the SQL AlwaysOn Availability Groups in SQL server. - * This setting can't be changed after you create the endpoint. - */ - @JsonProperty(value = "enableFloatingIP") - private Boolean enableFloatingIp; - - /* - * Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected - * connection termination. This element is only used when the protocol is - * set to TCP. - */ - @JsonProperty(value = "enableTcpReset") - private Boolean enableTcpReset; - - /* - * Gets the provisioning state of the PublicIP resource. Possible values - * are: 'Updating', 'Deleting', and 'Failed'. - */ - @JsonProperty(value = "provisioningState") - private String provisioningState; - - /** - * Get the frontendIpConfiguration property: A reference to frontend IP addresses. - * - * @return the frontendIpConfiguration value. - */ - public SubResource frontendIpConfiguration() { - return this.frontendIpConfiguration; - } - - /** - * Set the frontendIpConfiguration property: A reference to frontend IP addresses. - * - * @param frontendIpConfiguration the frontendIpConfiguration value to set. - * @return the InboundNatPoolPropertiesFormat object itself. - */ - public InboundNatPoolPropertiesFormat withFrontendIpConfiguration(SubResource frontendIpConfiguration) { - this.frontendIpConfiguration = frontendIpConfiguration; - return this; - } - - /** - * Get the protocol property: The transport protocol for the endpoint. Possible values are 'Udp' or 'Tcp' or 'All'. - * - * @return the protocol value. - */ - public TransportProtocol protocol() { - return this.protocol; - } - - /** - * Set the protocol property: The transport protocol for the endpoint. Possible values are 'Udp' or 'Tcp' or 'All'. - * - * @param protocol the protocol value to set. - * @return the InboundNatPoolPropertiesFormat object itself. - */ - public InboundNatPoolPropertiesFormat withProtocol(TransportProtocol protocol) { - this.protocol = protocol; - return this; - } - - /** - * Get the frontendPortRangeStart property: The first port number in the range of external ports that will be used - * to provide Inbound Nat to NICs associated with a load balancer. Acceptable values range between 1 and 65534. - * - * @return the frontendPortRangeStart value. - */ - public int frontendPortRangeStart() { - return this.frontendPortRangeStart; - } - - /** - * Set the frontendPortRangeStart property: The first port number in the range of external ports that will be used - * to provide Inbound Nat to NICs associated with a load balancer. Acceptable values range between 1 and 65534. - * - * @param frontendPortRangeStart the frontendPortRangeStart value to set. - * @return the InboundNatPoolPropertiesFormat object itself. - */ - public InboundNatPoolPropertiesFormat withFrontendPortRangeStart(int frontendPortRangeStart) { - this.frontendPortRangeStart = frontendPortRangeStart; - return this; - } - - /** - * Get the frontendPortRangeEnd property: The last port number in the range of external ports that will be used to - * provide Inbound Nat to NICs associated with a load balancer. Acceptable values range between 1 and 65535. - * - * @return the frontendPortRangeEnd value. - */ - public int frontendPortRangeEnd() { - return this.frontendPortRangeEnd; - } - - /** - * Set the frontendPortRangeEnd property: The last port number in the range of external ports that will be used to - * provide Inbound Nat to NICs associated with a load balancer. Acceptable values range between 1 and 65535. - * - * @param frontendPortRangeEnd the frontendPortRangeEnd value to set. - * @return the InboundNatPoolPropertiesFormat object itself. - */ - public InboundNatPoolPropertiesFormat withFrontendPortRangeEnd(int frontendPortRangeEnd) { - this.frontendPortRangeEnd = frontendPortRangeEnd; - return this; - } - - /** - * Get the backendPort property: The port used for internal connections on the endpoint. Acceptable values are - * between 1 and 65535. - * - * @return the backendPort value. - */ - public int backendPort() { - return this.backendPort; - } - - /** - * Set the backendPort property: The port used for internal connections on the endpoint. Acceptable values are - * between 1 and 65535. - * - * @param backendPort the backendPort value to set. - * @return the InboundNatPoolPropertiesFormat object itself. - */ - public InboundNatPoolPropertiesFormat withBackendPort(int backendPort) { - this.backendPort = backendPort; - return this; - } - - /** - * Get the idleTimeoutInMinutes property: The timeout for the TCP idle connection. The value can be set between 4 - * and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP. - * - * @return the idleTimeoutInMinutes value. - */ - public Integer idleTimeoutInMinutes() { - return this.idleTimeoutInMinutes; - } - - /** - * Set the idleTimeoutInMinutes property: The timeout for the TCP idle connection. The value can be set between 4 - * and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP. - * - * @param idleTimeoutInMinutes the idleTimeoutInMinutes value to set. - * @return the InboundNatPoolPropertiesFormat object itself. - */ - public InboundNatPoolPropertiesFormat withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes) { - this.idleTimeoutInMinutes = idleTimeoutInMinutes; - return this; - } - - /** - * Get the enableFloatingIp property: Configures a virtual machine's endpoint for the floating IP capability - * required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn - * Availability Groups in SQL server. This setting can't be changed after you create the endpoint. - * - * @return the enableFloatingIp value. - */ - public Boolean enableFloatingIp() { - return this.enableFloatingIp; - } - - /** - * Set the enableFloatingIp property: Configures a virtual machine's endpoint for the floating IP capability - * required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn - * Availability Groups in SQL server. This setting can't be changed after you create the endpoint. - * - * @param enableFloatingIp the enableFloatingIp value to set. - * @return the InboundNatPoolPropertiesFormat object itself. - */ - public InboundNatPoolPropertiesFormat withEnableFloatingIp(Boolean enableFloatingIp) { - this.enableFloatingIp = enableFloatingIp; - return this; - } - - /** - * Get the enableTcpReset property: Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected - * connection termination. This element is only used when the protocol is set to TCP. - * - * @return the enableTcpReset value. - */ - public Boolean enableTcpReset() { - return this.enableTcpReset; - } - - /** - * Set the enableTcpReset property: Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected - * connection termination. This element is only used when the protocol is set to TCP. - * - * @param enableTcpReset the enableTcpReset value to set. - * @return the InboundNatPoolPropertiesFormat object itself. - */ - public InboundNatPoolPropertiesFormat withEnableTcpReset(Boolean enableTcpReset) { - this.enableTcpReset = enableTcpReset; - return this; - } - - /** - * Get the provisioningState property: Gets the provisioning state of the PublicIP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Set the provisioningState property: Gets the provisioning state of the PublicIP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param provisioningState the provisioningState value to set. - * @return the InboundNatPoolPropertiesFormat object itself. - */ - public InboundNatPoolPropertiesFormat withProvisioningState(String provisioningState) { - this.provisioningState = provisioningState; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (protocol() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property protocol in model InboundNatPoolPropertiesFormat")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/InboundNatRuleInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/InboundNatRuleInner.java deleted file mode 100644 index 98761743ab90..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/InboundNatRuleInner.java +++ /dev/null @@ -1,312 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.TransportProtocol; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Inbound NAT rule of the load balancer. */ -@Fluent -public final class InboundNatRuleInner extends SubResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(InboundNatRuleInner.class); - - /* - * Properties of load balancer inbound nat rule. - */ - @JsonProperty(value = "properties") - private InboundNatRulePropertiesFormatInner innerProperties; - - /* - * Gets name of the resource that is unique within a resource group. This - * name can be used to access the resource. - */ - @JsonProperty(value = "name") - private String name; - - /* - * A unique read-only string that changes whenever the resource is updated. - */ - @JsonProperty(value = "etag") - private String etag; - - /** - * Get the innerProperties property: Properties of load balancer inbound nat rule. - * - * @return the innerProperties value. - */ - private InboundNatRulePropertiesFormatInner innerProperties() { - return this.innerProperties; - } - - /** - * Get the name property: Gets name of the resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Gets name of the resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @param name the name value to set. - * @return the InboundNatRuleInner object itself. - */ - public InboundNatRuleInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @param etag the etag value to set. - * @return the InboundNatRuleInner object itself. - */ - public InboundNatRuleInner withEtag(String etag) { - this.etag = etag; - return this; - } - - /** {@inheritDoc} */ - @Override - public InboundNatRuleInner withId(String id) { - super.withId(id); - return this; - } - - /** - * Get the frontendIpConfiguration property: A reference to frontend IP addresses. - * - * @return the frontendIpConfiguration value. - */ - public SubResource frontendIpConfiguration() { - return this.innerProperties() == null ? null : this.innerProperties().frontendIpConfiguration(); - } - - /** - * Set the frontendIpConfiguration property: A reference to frontend IP addresses. - * - * @param frontendIpConfiguration the frontendIpConfiguration value to set. - * @return the InboundNatRuleInner object itself. - */ - public InboundNatRuleInner withFrontendIpConfiguration(SubResource frontendIpConfiguration) { - if (this.innerProperties() == null) { - this.innerProperties = new InboundNatRulePropertiesFormatInner(); - } - this.innerProperties().withFrontendIpConfiguration(frontendIpConfiguration); - return this; - } - - /** - * Get the backendIpConfiguration property: A reference to a private IP address defined on a network interface of a - * VM. Traffic sent to the frontend port of each of the frontend IP configurations is forwarded to the backend IP. - * - * @return the backendIpConfiguration value. - */ - public NetworkInterfaceIpConfigurationInner backendIpConfiguration() { - return this.innerProperties() == null ? null : this.innerProperties().backendIpConfiguration(); - } - - /** - * Get the protocol property: The transport protocol for the endpoint. Possible values are 'Udp' or 'Tcp' or 'All'. - * - * @return the protocol value. - */ - public TransportProtocol protocol() { - return this.innerProperties() == null ? null : this.innerProperties().protocol(); - } - - /** - * Set the protocol property: The transport protocol for the endpoint. Possible values are 'Udp' or 'Tcp' or 'All'. - * - * @param protocol the protocol value to set. - * @return the InboundNatRuleInner object itself. - */ - public InboundNatRuleInner withProtocol(TransportProtocol protocol) { - if (this.innerProperties() == null) { - this.innerProperties = new InboundNatRulePropertiesFormatInner(); - } - this.innerProperties().withProtocol(protocol); - return this; - } - - /** - * Get the frontendPort property: The port for the external endpoint. Port numbers for each rule must be unique - * within the Load Balancer. Acceptable values range from 1 to 65534. - * - * @return the frontendPort value. - */ - public Integer frontendPort() { - return this.innerProperties() == null ? null : this.innerProperties().frontendPort(); - } - - /** - * Set the frontendPort property: The port for the external endpoint. Port numbers for each rule must be unique - * within the Load Balancer. Acceptable values range from 1 to 65534. - * - * @param frontendPort the frontendPort value to set. - * @return the InboundNatRuleInner object itself. - */ - public InboundNatRuleInner withFrontendPort(Integer frontendPort) { - if (this.innerProperties() == null) { - this.innerProperties = new InboundNatRulePropertiesFormatInner(); - } - this.innerProperties().withFrontendPort(frontendPort); - return this; - } - - /** - * Get the backendPort property: The port used for the internal endpoint. Acceptable values range from 1 to 65535. - * - * @return the backendPort value. - */ - public Integer backendPort() { - return this.innerProperties() == null ? null : this.innerProperties().backendPort(); - } - - /** - * Set the backendPort property: The port used for the internal endpoint. Acceptable values range from 1 to 65535. - * - * @param backendPort the backendPort value to set. - * @return the InboundNatRuleInner object itself. - */ - public InboundNatRuleInner withBackendPort(Integer backendPort) { - if (this.innerProperties() == null) { - this.innerProperties = new InboundNatRulePropertiesFormatInner(); - } - this.innerProperties().withBackendPort(backendPort); - return this; - } - - /** - * Get the idleTimeoutInMinutes property: The timeout for the TCP idle connection. The value can be set between 4 - * and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP. - * - * @return the idleTimeoutInMinutes value. - */ - public Integer idleTimeoutInMinutes() { - return this.innerProperties() == null ? null : this.innerProperties().idleTimeoutInMinutes(); - } - - /** - * Set the idleTimeoutInMinutes property: The timeout for the TCP idle connection. The value can be set between 4 - * and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP. - * - * @param idleTimeoutInMinutes the idleTimeoutInMinutes value to set. - * @return the InboundNatRuleInner object itself. - */ - public InboundNatRuleInner withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes) { - if (this.innerProperties() == null) { - this.innerProperties = new InboundNatRulePropertiesFormatInner(); - } - this.innerProperties().withIdleTimeoutInMinutes(idleTimeoutInMinutes); - return this; - } - - /** - * Get the enableFloatingIp property: Configures a virtual machine's endpoint for the floating IP capability - * required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn - * Availability Groups in SQL server. This setting can't be changed after you create the endpoint. - * - * @return the enableFloatingIp value. - */ - public Boolean enableFloatingIp() { - return this.innerProperties() == null ? null : this.innerProperties().enableFloatingIp(); - } - - /** - * Set the enableFloatingIp property: Configures a virtual machine's endpoint for the floating IP capability - * required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn - * Availability Groups in SQL server. This setting can't be changed after you create the endpoint. - * - * @param enableFloatingIp the enableFloatingIp value to set. - * @return the InboundNatRuleInner object itself. - */ - public InboundNatRuleInner withEnableFloatingIp(Boolean enableFloatingIp) { - if (this.innerProperties() == null) { - this.innerProperties = new InboundNatRulePropertiesFormatInner(); - } - this.innerProperties().withEnableFloatingIp(enableFloatingIp); - return this; - } - - /** - * Get the enableTcpReset property: Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected - * connection termination. This element is only used when the protocol is set to TCP. - * - * @return the enableTcpReset value. - */ - public Boolean enableTcpReset() { - return this.innerProperties() == null ? null : this.innerProperties().enableTcpReset(); - } - - /** - * Set the enableTcpReset property: Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected - * connection termination. This element is only used when the protocol is set to TCP. - * - * @param enableTcpReset the enableTcpReset value to set. - * @return the InboundNatRuleInner object itself. - */ - public InboundNatRuleInner withEnableTcpReset(Boolean enableTcpReset) { - if (this.innerProperties() == null) { - this.innerProperties = new InboundNatRulePropertiesFormatInner(); - } - this.innerProperties().withEnableTcpReset(enableTcpReset); - return this; - } - - /** - * Get the provisioningState property: Gets the provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Set the provisioningState property: Gets the provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param provisioningState the provisioningState value to set. - * @return the InboundNatRuleInner object itself. - */ - public InboundNatRuleInner withProvisioningState(String provisioningState) { - if (this.innerProperties() == null) { - this.innerProperties = new InboundNatRulePropertiesFormatInner(); - } - this.innerProperties().withProvisioningState(provisioningState); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/InboundNatRulePropertiesFormatInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/InboundNatRulePropertiesFormatInner.java deleted file mode 100644 index 349f2db5283f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/InboundNatRulePropertiesFormatInner.java +++ /dev/null @@ -1,279 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.TransportProtocol; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Properties of the inbound NAT rule. */ -@Fluent -public final class InboundNatRulePropertiesFormatInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(InboundNatRulePropertiesFormatInner.class); - - /* - * A reference to frontend IP addresses. - */ - @JsonProperty(value = "frontendIPConfiguration") - private SubResource frontendIpConfiguration; - - /* - * A reference to a private IP address defined on a network interface of a - * VM. Traffic sent to the frontend port of each of the frontend IP - * configurations is forwarded to the backend IP. - */ - @JsonProperty(value = "backendIPConfiguration", access = JsonProperty.Access.WRITE_ONLY) - private NetworkInterfaceIpConfigurationInner backendIpConfiguration; - - /* - * The transport protocol for the endpoint. Possible values are 'Udp' or - * 'Tcp' or 'All'. - */ - @JsonProperty(value = "protocol") - private TransportProtocol protocol; - - /* - * The port for the external endpoint. Port numbers for each rule must be - * unique within the Load Balancer. Acceptable values range from 1 to - * 65534. - */ - @JsonProperty(value = "frontendPort") - private Integer frontendPort; - - /* - * The port used for the internal endpoint. Acceptable values range from 1 - * to 65535. - */ - @JsonProperty(value = "backendPort") - private Integer backendPort; - - /* - * The timeout for the TCP idle connection. The value can be set between 4 - * and 30 minutes. The default value is 4 minutes. This element is only - * used when the protocol is set to TCP. - */ - @JsonProperty(value = "idleTimeoutInMinutes") - private Integer idleTimeoutInMinutes; - - /* - * Configures a virtual machine's endpoint for the floating IP capability - * required to configure a SQL AlwaysOn Availability Group. This setting is - * required when using the SQL AlwaysOn Availability Groups in SQL server. - * This setting can't be changed after you create the endpoint. - */ - @JsonProperty(value = "enableFloatingIP") - private Boolean enableFloatingIp; - - /* - * Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected - * connection termination. This element is only used when the protocol is - * set to TCP. - */ - @JsonProperty(value = "enableTcpReset") - private Boolean enableTcpReset; - - /* - * Gets the provisioning state of the public IP resource. Possible values - * are: 'Updating', 'Deleting', and 'Failed'. - */ - @JsonProperty(value = "provisioningState") - private String provisioningState; - - /** - * Get the frontendIpConfiguration property: A reference to frontend IP addresses. - * - * @return the frontendIpConfiguration value. - */ - public SubResource frontendIpConfiguration() { - return this.frontendIpConfiguration; - } - - /** - * Set the frontendIpConfiguration property: A reference to frontend IP addresses. - * - * @param frontendIpConfiguration the frontendIpConfiguration value to set. - * @return the InboundNatRulePropertiesFormatInner object itself. - */ - public InboundNatRulePropertiesFormatInner withFrontendIpConfiguration(SubResource frontendIpConfiguration) { - this.frontendIpConfiguration = frontendIpConfiguration; - return this; - } - - /** - * Get the backendIpConfiguration property: A reference to a private IP address defined on a network interface of a - * VM. Traffic sent to the frontend port of each of the frontend IP configurations is forwarded to the backend IP. - * - * @return the backendIpConfiguration value. - */ - public NetworkInterfaceIpConfigurationInner backendIpConfiguration() { - return this.backendIpConfiguration; - } - - /** - * Get the protocol property: The transport protocol for the endpoint. Possible values are 'Udp' or 'Tcp' or 'All'. - * - * @return the protocol value. - */ - public TransportProtocol protocol() { - return this.protocol; - } - - /** - * Set the protocol property: The transport protocol for the endpoint. Possible values are 'Udp' or 'Tcp' or 'All'. - * - * @param protocol the protocol value to set. - * @return the InboundNatRulePropertiesFormatInner object itself. - */ - public InboundNatRulePropertiesFormatInner withProtocol(TransportProtocol protocol) { - this.protocol = protocol; - return this; - } - - /** - * Get the frontendPort property: The port for the external endpoint. Port numbers for each rule must be unique - * within the Load Balancer. Acceptable values range from 1 to 65534. - * - * @return the frontendPort value. - */ - public Integer frontendPort() { - return this.frontendPort; - } - - /** - * Set the frontendPort property: The port for the external endpoint. Port numbers for each rule must be unique - * within the Load Balancer. Acceptable values range from 1 to 65534. - * - * @param frontendPort the frontendPort value to set. - * @return the InboundNatRulePropertiesFormatInner object itself. - */ - public InboundNatRulePropertiesFormatInner withFrontendPort(Integer frontendPort) { - this.frontendPort = frontendPort; - return this; - } - - /** - * Get the backendPort property: The port used for the internal endpoint. Acceptable values range from 1 to 65535. - * - * @return the backendPort value. - */ - public Integer backendPort() { - return this.backendPort; - } - - /** - * Set the backendPort property: The port used for the internal endpoint. Acceptable values range from 1 to 65535. - * - * @param backendPort the backendPort value to set. - * @return the InboundNatRulePropertiesFormatInner object itself. - */ - public InboundNatRulePropertiesFormatInner withBackendPort(Integer backendPort) { - this.backendPort = backendPort; - return this; - } - - /** - * Get the idleTimeoutInMinutes property: The timeout for the TCP idle connection. The value can be set between 4 - * and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP. - * - * @return the idleTimeoutInMinutes value. - */ - public Integer idleTimeoutInMinutes() { - return this.idleTimeoutInMinutes; - } - - /** - * Set the idleTimeoutInMinutes property: The timeout for the TCP idle connection. The value can be set between 4 - * and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP. - * - * @param idleTimeoutInMinutes the idleTimeoutInMinutes value to set. - * @return the InboundNatRulePropertiesFormatInner object itself. - */ - public InboundNatRulePropertiesFormatInner withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes) { - this.idleTimeoutInMinutes = idleTimeoutInMinutes; - return this; - } - - /** - * Get the enableFloatingIp property: Configures a virtual machine's endpoint for the floating IP capability - * required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn - * Availability Groups in SQL server. This setting can't be changed after you create the endpoint. - * - * @return the enableFloatingIp value. - */ - public Boolean enableFloatingIp() { - return this.enableFloatingIp; - } - - /** - * Set the enableFloatingIp property: Configures a virtual machine's endpoint for the floating IP capability - * required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn - * Availability Groups in SQL server. This setting can't be changed after you create the endpoint. - * - * @param enableFloatingIp the enableFloatingIp value to set. - * @return the InboundNatRulePropertiesFormatInner object itself. - */ - public InboundNatRulePropertiesFormatInner withEnableFloatingIp(Boolean enableFloatingIp) { - this.enableFloatingIp = enableFloatingIp; - return this; - } - - /** - * Get the enableTcpReset property: Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected - * connection termination. This element is only used when the protocol is set to TCP. - * - * @return the enableTcpReset value. - */ - public Boolean enableTcpReset() { - return this.enableTcpReset; - } - - /** - * Set the enableTcpReset property: Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected - * connection termination. This element is only used when the protocol is set to TCP. - * - * @param enableTcpReset the enableTcpReset value to set. - * @return the InboundNatRulePropertiesFormatInner object itself. - */ - public InboundNatRulePropertiesFormatInner withEnableTcpReset(Boolean enableTcpReset) { - this.enableTcpReset = enableTcpReset; - return this; - } - - /** - * Get the provisioningState property: Gets the provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Set the provisioningState property: Gets the provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param provisioningState the provisioningState value to set. - * @return the InboundNatRulePropertiesFormatInner object itself. - */ - public InboundNatRulePropertiesFormatInner withProvisioningState(String provisioningState) { - this.provisioningState = provisioningState; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (backendIpConfiguration() != null) { - backendIpConfiguration().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/InterfaceEndpointInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/InterfaceEndpointInner.java deleted file mode 100644 index 89d04c5353c7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/InterfaceEndpointInner.java +++ /dev/null @@ -1,213 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.EndpointService; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** Interface endpoint resource. */ -@Fluent -public final class InterfaceEndpointInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(InterfaceEndpointInner.class); - - /* - * Properties of the interface endpoint. - */ - @JsonProperty(value = "properties") - private InterfaceEndpointPropertiesInner innerProperties; - - /* - * Gets a unique read-only string that changes whenever the resource is - * updated. - */ - @JsonProperty(value = "etag") - private String etag; - - /* - * Resource ID. - */ - @JsonProperty(value = "id") - private String id; - - /** - * Get the innerProperties property: Properties of the interface endpoint. - * - * @return the innerProperties value. - */ - private InterfaceEndpointPropertiesInner innerProperties() { - return this.innerProperties; - } - - /** - * Get the etag property: Gets a unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: Gets a unique read-only string that changes whenever the resource is updated. - * - * @param etag the etag value to set. - * @return the InterfaceEndpointInner object itself. - */ - public InterfaceEndpointInner withEtag(String etag) { - this.etag = etag; - return this; - } - - /** - * Get the id property: Resource ID. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: Resource ID. - * - * @param id the id value to set. - * @return the InterfaceEndpointInner object itself. - */ - public InterfaceEndpointInner withId(String id) { - this.id = id; - return this; - } - - /** {@inheritDoc} */ - @Override - public InterfaceEndpointInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public InterfaceEndpointInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the fqdn property: A first-party service's FQDN that is mapped to the private IP allocated via this interface - * endpoint. - * - * @return the fqdn value. - */ - public String fqdn() { - return this.innerProperties() == null ? null : this.innerProperties().fqdn(); - } - - /** - * Set the fqdn property: A first-party service's FQDN that is mapped to the private IP allocated via this interface - * endpoint. - * - * @param fqdn the fqdn value to set. - * @return the InterfaceEndpointInner object itself. - */ - public InterfaceEndpointInner withFqdn(String fqdn) { - if (this.innerProperties() == null) { - this.innerProperties = new InterfaceEndpointPropertiesInner(); - } - this.innerProperties().withFqdn(fqdn); - return this; - } - - /** - * Get the endpointService property: A reference to the service being brought into the virtual network. - * - * @return the endpointService value. - */ - public EndpointService endpointService() { - return this.innerProperties() == null ? null : this.innerProperties().endpointService(); - } - - /** - * Set the endpointService property: A reference to the service being brought into the virtual network. - * - * @param endpointService the endpointService value to set. - * @return the InterfaceEndpointInner object itself. - */ - public InterfaceEndpointInner withEndpointService(EndpointService endpointService) { - if (this.innerProperties() == null) { - this.innerProperties = new InterfaceEndpointPropertiesInner(); - } - this.innerProperties().withEndpointService(endpointService); - return this; - } - - /** - * Get the subnet property: The ID of the subnet from which the private IP will be allocated. - * - * @return the subnet value. - */ - public SubnetInner subnet() { - return this.innerProperties() == null ? null : this.innerProperties().subnet(); - } - - /** - * Set the subnet property: The ID of the subnet from which the private IP will be allocated. - * - * @param subnet the subnet value to set. - * @return the InterfaceEndpointInner object itself. - */ - public InterfaceEndpointInner withSubnet(SubnetInner subnet) { - if (this.innerProperties() == null) { - this.innerProperties = new InterfaceEndpointPropertiesInner(); - } - this.innerProperties().withSubnet(subnet); - return this; - } - - /** - * Get the networkInterfaces property: Gets an array of references to the network interfaces created for this - * interface endpoint. - * - * @return the networkInterfaces value. - */ - public List networkInterfaces() { - return this.innerProperties() == null ? null : this.innerProperties().networkInterfaces(); - } - - /** - * Get the owner property: A read-only property that identifies who created this interface endpoint. - * - * @return the owner value. - */ - public String owner() { - return this.innerProperties() == null ? null : this.innerProperties().owner(); - } - - /** - * Get the provisioningState property: The provisioning state of the interface endpoint. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/InterfaceEndpointPropertiesInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/InterfaceEndpointPropertiesInner.java deleted file mode 100644 index 537adbaec88e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/InterfaceEndpointPropertiesInner.java +++ /dev/null @@ -1,166 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.EndpointService; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Properties of the interface endpoint. */ -@Fluent -public final class InterfaceEndpointPropertiesInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(InterfaceEndpointPropertiesInner.class); - - /* - * A first-party service's FQDN that is mapped to the private IP allocated - * via this interface endpoint. - */ - @JsonProperty(value = "fqdn") - private String fqdn; - - /* - * A reference to the service being brought into the virtual network. - */ - @JsonProperty(value = "endpointService") - private EndpointService endpointService; - - /* - * The ID of the subnet from which the private IP will be allocated. - */ - @JsonProperty(value = "subnet") - private SubnetInner subnet; - - /* - * Gets an array of references to the network interfaces created for this - * interface endpoint. - */ - @JsonProperty(value = "networkInterfaces", access = JsonProperty.Access.WRITE_ONLY) - private List networkInterfaces; - - /* - * A read-only property that identifies who created this interface - * endpoint. - */ - @JsonProperty(value = "owner", access = JsonProperty.Access.WRITE_ONLY) - private String owner; - - /* - * The provisioning state of the interface endpoint. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; - - /** - * Get the fqdn property: A first-party service's FQDN that is mapped to the private IP allocated via this interface - * endpoint. - * - * @return the fqdn value. - */ - public String fqdn() { - return this.fqdn; - } - - /** - * Set the fqdn property: A first-party service's FQDN that is mapped to the private IP allocated via this interface - * endpoint. - * - * @param fqdn the fqdn value to set. - * @return the InterfaceEndpointPropertiesInner object itself. - */ - public InterfaceEndpointPropertiesInner withFqdn(String fqdn) { - this.fqdn = fqdn; - return this; - } - - /** - * Get the endpointService property: A reference to the service being brought into the virtual network. - * - * @return the endpointService value. - */ - public EndpointService endpointService() { - return this.endpointService; - } - - /** - * Set the endpointService property: A reference to the service being brought into the virtual network. - * - * @param endpointService the endpointService value to set. - * @return the InterfaceEndpointPropertiesInner object itself. - */ - public InterfaceEndpointPropertiesInner withEndpointService(EndpointService endpointService) { - this.endpointService = endpointService; - return this; - } - - /** - * Get the subnet property: The ID of the subnet from which the private IP will be allocated. - * - * @return the subnet value. - */ - public SubnetInner subnet() { - return this.subnet; - } - - /** - * Set the subnet property: The ID of the subnet from which the private IP will be allocated. - * - * @param subnet the subnet value to set. - * @return the InterfaceEndpointPropertiesInner object itself. - */ - public InterfaceEndpointPropertiesInner withSubnet(SubnetInner subnet) { - this.subnet = subnet; - return this; - } - - /** - * Get the networkInterfaces property: Gets an array of references to the network interfaces created for this - * interface endpoint. - * - * @return the networkInterfaces value. - */ - public List networkInterfaces() { - return this.networkInterfaces; - } - - /** - * Get the owner property: A read-only property that identifies who created this interface endpoint. - * - * @return the owner value. - */ - public String owner() { - return this.owner; - } - - /** - * Get the provisioningState property: The provisioning state of the interface endpoint. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (endpointService() != null) { - endpointService().validate(); - } - if (subnet() != null) { - subnet().validate(); - } - if (networkInterfaces() != null) { - networkInterfaces().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/IpAddressAvailabilityResultInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/IpAddressAvailabilityResultInner.java deleted file mode 100644 index 7c3063b6c5ae..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/IpAddressAvailabilityResultInner.java +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Response for CheckIPAddressAvailability API service call. */ -@Fluent -public final class IpAddressAvailabilityResultInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(IpAddressAvailabilityResultInner.class); - - /* - * Private IP address availability. - */ - @JsonProperty(value = "available") - private Boolean available; - - /* - * Contains other available private IP addresses if the asked for address - * is taken. - */ - @JsonProperty(value = "availableIPAddresses") - private List availableIpAddresses; - - /** - * Get the available property: Private IP address availability. - * - * @return the available value. - */ - public Boolean available() { - return this.available; - } - - /** - * Set the available property: Private IP address availability. - * - * @param available the available value to set. - * @return the IpAddressAvailabilityResultInner object itself. - */ - public IpAddressAvailabilityResultInner withAvailable(Boolean available) { - this.available = available; - return this; - } - - /** - * Get the availableIpAddresses property: Contains other available private IP addresses if the asked for address is - * taken. - * - * @return the availableIpAddresses value. - */ - public List availableIpAddresses() { - return this.availableIpAddresses; - } - - /** - * Set the availableIpAddresses property: Contains other available private IP addresses if the asked for address is - * taken. - * - * @param availableIpAddresses the availableIpAddresses value to set. - * @return the IpAddressAvailabilityResultInner object itself. - */ - public IpAddressAvailabilityResultInner withAvailableIpAddresses(List availableIpAddresses) { - this.availableIpAddresses = availableIpAddresses; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/IpConfigurationInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/IpConfigurationInner.java deleted file mode 100644 index 65c22d837b1f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/IpConfigurationInner.java +++ /dev/null @@ -1,225 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.IpAllocationMethod; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** IP configuration. */ -@Fluent -public final class IpConfigurationInner extends SubResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(IpConfigurationInner.class); - - /* - * Properties of the IP configuration - */ - @JsonProperty(value = "properties") - private IpConfigurationPropertiesFormatInner innerProperties; - - /* - * The name of the resource that is unique within a resource group. This - * name can be used to access the resource. - */ - @JsonProperty(value = "name") - private String name; - - /* - * A unique read-only string that changes whenever the resource is updated. - */ - @JsonProperty(value = "etag") - private String etag; - - /** - * Get the innerProperties property: Properties of the IP configuration. - * - * @return the innerProperties value. - */ - private IpConfigurationPropertiesFormatInner innerProperties() { - return this.innerProperties; - } - - /** - * Get the name property: The name of the resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @param name the name value to set. - * @return the IpConfigurationInner object itself. - */ - public IpConfigurationInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @param etag the etag value to set. - * @return the IpConfigurationInner object itself. - */ - public IpConfigurationInner withEtag(String etag) { - this.etag = etag; - return this; - } - - /** {@inheritDoc} */ - @Override - public IpConfigurationInner withId(String id) { - super.withId(id); - return this; - } - - /** - * Get the privateIpAddress property: The private IP address of the IP configuration. - * - * @return the privateIpAddress value. - */ - public String privateIpAddress() { - return this.innerProperties() == null ? null : this.innerProperties().privateIpAddress(); - } - - /** - * Set the privateIpAddress property: The private IP address of the IP configuration. - * - * @param privateIpAddress the privateIpAddress value to set. - * @return the IpConfigurationInner object itself. - */ - public IpConfigurationInner withPrivateIpAddress(String privateIpAddress) { - if (this.innerProperties() == null) { - this.innerProperties = new IpConfigurationPropertiesFormatInner(); - } - this.innerProperties().withPrivateIpAddress(privateIpAddress); - return this; - } - - /** - * Get the privateIpAllocationMethod property: The private IP allocation method. Possible values are 'Static' and - * 'Dynamic'. - * - * @return the privateIpAllocationMethod value. - */ - public IpAllocationMethod privateIpAllocationMethod() { - return this.innerProperties() == null ? null : this.innerProperties().privateIpAllocationMethod(); - } - - /** - * Set the privateIpAllocationMethod property: The private IP allocation method. Possible values are 'Static' and - * 'Dynamic'. - * - * @param privateIpAllocationMethod the privateIpAllocationMethod value to set. - * @return the IpConfigurationInner object itself. - */ - public IpConfigurationInner withPrivateIpAllocationMethod(IpAllocationMethod privateIpAllocationMethod) { - if (this.innerProperties() == null) { - this.innerProperties = new IpConfigurationPropertiesFormatInner(); - } - this.innerProperties().withPrivateIpAllocationMethod(privateIpAllocationMethod); - return this; - } - - /** - * Get the subnet property: The reference of the subnet resource. - * - * @return the subnet value. - */ - public SubnetInner subnet() { - return this.innerProperties() == null ? null : this.innerProperties().subnet(); - } - - /** - * Set the subnet property: The reference of the subnet resource. - * - * @param subnet the subnet value to set. - * @return the IpConfigurationInner object itself. - */ - public IpConfigurationInner withSubnet(SubnetInner subnet) { - if (this.innerProperties() == null) { - this.innerProperties = new IpConfigurationPropertiesFormatInner(); - } - this.innerProperties().withSubnet(subnet); - return this; - } - - /** - * Get the publicIpAddress property: The reference of the public IP resource. - * - * @return the publicIpAddress value. - */ - public PublicIpAddressInner publicIpAddress() { - return this.innerProperties() == null ? null : this.innerProperties().publicIpAddress(); - } - - /** - * Set the publicIpAddress property: The reference of the public IP resource. - * - * @param publicIpAddress the publicIpAddress value to set. - * @return the IpConfigurationInner object itself. - */ - public IpConfigurationInner withPublicIpAddress(PublicIpAddressInner publicIpAddress) { - if (this.innerProperties() == null) { - this.innerProperties = new IpConfigurationPropertiesFormatInner(); - } - this.innerProperties().withPublicIpAddress(publicIpAddress); - return this; - } - - /** - * Get the provisioningState property: Gets the provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Set the provisioningState property: Gets the provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param provisioningState the provisioningState value to set. - * @return the IpConfigurationInner object itself. - */ - public IpConfigurationInner withProvisioningState(String provisioningState) { - if (this.innerProperties() == null) { - this.innerProperties = new IpConfigurationPropertiesFormatInner(); - } - this.innerProperties().withProvisioningState(provisioningState); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/IpConfigurationProfileInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/IpConfigurationProfileInner.java deleted file mode 100644 index c581c4523df0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/IpConfigurationProfileInner.java +++ /dev/null @@ -1,151 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** IP configuration profile child resource. */ -@Fluent -public final class IpConfigurationProfileInner extends SubResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(IpConfigurationProfileInner.class); - - /* - * Properties of the IP configuration profile. - */ - @JsonProperty(value = "properties") - private IpConfigurationProfilePropertiesFormatInner innerProperties; - - /* - * The name of the resource. This name can be used to access the resource. - */ - @JsonProperty(value = "name") - private String name; - - /* - * Sub Resource type. - */ - @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) - private String type; - - /* - * A unique read-only string that changes whenever the resource is updated. - */ - @JsonProperty(value = "etag") - private String etag; - - /** - * Get the innerProperties property: Properties of the IP configuration profile. - * - * @return the innerProperties value. - */ - private IpConfigurationProfilePropertiesFormatInner innerProperties() { - return this.innerProperties; - } - - /** - * Get the name property: The name of the resource. This name can be used to access the resource. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the resource. This name can be used to access the resource. - * - * @param name the name value to set. - * @return the IpConfigurationProfileInner object itself. - */ - public IpConfigurationProfileInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the type property: Sub Resource type. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Get the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @param etag the etag value to set. - * @return the IpConfigurationProfileInner object itself. - */ - public IpConfigurationProfileInner withEtag(String etag) { - this.etag = etag; - return this; - } - - /** {@inheritDoc} */ - @Override - public IpConfigurationProfileInner withId(String id) { - super.withId(id); - return this; - } - - /** - * Get the subnet property: The reference of the subnet resource to create a container network interface ip - * configuration. - * - * @return the subnet value. - */ - public SubnetInner subnet() { - return this.innerProperties() == null ? null : this.innerProperties().subnet(); - } - - /** - * Set the subnet property: The reference of the subnet resource to create a container network interface ip - * configuration. - * - * @param subnet the subnet value to set. - * @return the IpConfigurationProfileInner object itself. - */ - public IpConfigurationProfileInner withSubnet(SubnetInner subnet) { - if (this.innerProperties() == null) { - this.innerProperties = new IpConfigurationProfilePropertiesFormatInner(); - } - this.innerProperties().withSubnet(subnet); - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the resource. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/IpConfigurationProfilePropertiesFormatInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/IpConfigurationProfilePropertiesFormatInner.java deleted file mode 100644 index d7cdae30c4bf..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/IpConfigurationProfilePropertiesFormatInner.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** IP configuration profile properties. */ -@Fluent -public final class IpConfigurationProfilePropertiesFormatInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(IpConfigurationProfilePropertiesFormatInner.class); - - /* - * The reference of the subnet resource to create a container network - * interface ip configuration. - */ - @JsonProperty(value = "subnet") - private SubnetInner subnet; - - /* - * The provisioning state of the resource. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; - - /** - * Get the subnet property: The reference of the subnet resource to create a container network interface ip - * configuration. - * - * @return the subnet value. - */ - public SubnetInner subnet() { - return this.subnet; - } - - /** - * Set the subnet property: The reference of the subnet resource to create a container network interface ip - * configuration. - * - * @param subnet the subnet value to set. - * @return the IpConfigurationProfilePropertiesFormatInner object itself. - */ - public IpConfigurationProfilePropertiesFormatInner withSubnet(SubnetInner subnet) { - this.subnet = subnet; - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the resource. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (subnet() != null) { - subnet().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/IpConfigurationPropertiesFormatInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/IpConfigurationPropertiesFormatInner.java deleted file mode 100644 index 964bff0fb61a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/IpConfigurationPropertiesFormatInner.java +++ /dev/null @@ -1,168 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.IpAllocationMethod; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Properties of IP configuration. */ -@Fluent -public final class IpConfigurationPropertiesFormatInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(IpConfigurationPropertiesFormatInner.class); - - /* - * The private IP address of the IP configuration. - */ - @JsonProperty(value = "privateIPAddress") - private String privateIpAddress; - - /* - * The private IP allocation method. Possible values are 'Static' and - * 'Dynamic'. - */ - @JsonProperty(value = "privateIPAllocationMethod") - private IpAllocationMethod privateIpAllocationMethod; - - /* - * The reference of the subnet resource. - */ - @JsonProperty(value = "subnet") - private SubnetInner subnet; - - /* - * The reference of the public IP resource. - */ - @JsonProperty(value = "publicIPAddress") - private PublicIpAddressInner publicIpAddress; - - /* - * Gets the provisioning state of the public IP resource. Possible values - * are: 'Updating', 'Deleting', and 'Failed'. - */ - @JsonProperty(value = "provisioningState") - private String provisioningState; - - /** - * Get the privateIpAddress property: The private IP address of the IP configuration. - * - * @return the privateIpAddress value. - */ - public String privateIpAddress() { - return this.privateIpAddress; - } - - /** - * Set the privateIpAddress property: The private IP address of the IP configuration. - * - * @param privateIpAddress the privateIpAddress value to set. - * @return the IpConfigurationPropertiesFormatInner object itself. - */ - public IpConfigurationPropertiesFormatInner withPrivateIpAddress(String privateIpAddress) { - this.privateIpAddress = privateIpAddress; - return this; - } - - /** - * Get the privateIpAllocationMethod property: The private IP allocation method. Possible values are 'Static' and - * 'Dynamic'. - * - * @return the privateIpAllocationMethod value. - */ - public IpAllocationMethod privateIpAllocationMethod() { - return this.privateIpAllocationMethod; - } - - /** - * Set the privateIpAllocationMethod property: The private IP allocation method. Possible values are 'Static' and - * 'Dynamic'. - * - * @param privateIpAllocationMethod the privateIpAllocationMethod value to set. - * @return the IpConfigurationPropertiesFormatInner object itself. - */ - public IpConfigurationPropertiesFormatInner withPrivateIpAllocationMethod( - IpAllocationMethod privateIpAllocationMethod) { - this.privateIpAllocationMethod = privateIpAllocationMethod; - return this; - } - - /** - * Get the subnet property: The reference of the subnet resource. - * - * @return the subnet value. - */ - public SubnetInner subnet() { - return this.subnet; - } - - /** - * Set the subnet property: The reference of the subnet resource. - * - * @param subnet the subnet value to set. - * @return the IpConfigurationPropertiesFormatInner object itself. - */ - public IpConfigurationPropertiesFormatInner withSubnet(SubnetInner subnet) { - this.subnet = subnet; - return this; - } - - /** - * Get the publicIpAddress property: The reference of the public IP resource. - * - * @return the publicIpAddress value. - */ - public PublicIpAddressInner publicIpAddress() { - return this.publicIpAddress; - } - - /** - * Set the publicIpAddress property: The reference of the public IP resource. - * - * @param publicIpAddress the publicIpAddress value to set. - * @return the IpConfigurationPropertiesFormatInner object itself. - */ - public IpConfigurationPropertiesFormatInner withPublicIpAddress(PublicIpAddressInner publicIpAddress) { - this.publicIpAddress = publicIpAddress; - return this; - } - - /** - * Get the provisioningState property: Gets the provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Set the provisioningState property: Gets the provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param provisioningState the provisioningState value to set. - * @return the IpConfigurationPropertiesFormatInner object itself. - */ - public IpConfigurationPropertiesFormatInner withProvisioningState(String provisioningState) { - this.provisioningState = provisioningState; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (subnet() != null) { - subnet().validate(); - } - if (publicIpAddress() != null) { - publicIpAddress().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/LoadBalancerInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/LoadBalancerInner.java deleted file mode 100644 index e063fa389765..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/LoadBalancerInner.java +++ /dev/null @@ -1,369 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.InboundNatPool; -import com.azure.resourcemanager.network.models.LoadBalancerSku; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** LoadBalancer resource. */ -@Fluent -public final class LoadBalancerInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LoadBalancerInner.class); - - /* - * The load balancer SKU. - */ - @JsonProperty(value = "sku") - private LoadBalancerSku sku; - - /* - * Properties of load balancer. - */ - @JsonProperty(value = "properties") - private LoadBalancerPropertiesFormat innerProperties; - - /* - * A unique read-only string that changes whenever the resource is updated. - */ - @JsonProperty(value = "etag") - private String etag; - - /* - * Resource ID. - */ - @JsonProperty(value = "id") - private String id; - - /** - * Get the sku property: The load balancer SKU. - * - * @return the sku value. - */ - public LoadBalancerSku sku() { - return this.sku; - } - - /** - * Set the sku property: The load balancer SKU. - * - * @param sku the sku value to set. - * @return the LoadBalancerInner object itself. - */ - public LoadBalancerInner withSku(LoadBalancerSku sku) { - this.sku = sku; - return this; - } - - /** - * Get the innerProperties property: Properties of load balancer. - * - * @return the innerProperties value. - */ - private LoadBalancerPropertiesFormat innerProperties() { - return this.innerProperties; - } - - /** - * Get the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @param etag the etag value to set. - * @return the LoadBalancerInner object itself. - */ - public LoadBalancerInner withEtag(String etag) { - this.etag = etag; - return this; - } - - /** - * Get the id property: Resource ID. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: Resource ID. - * - * @param id the id value to set. - * @return the LoadBalancerInner object itself. - */ - public LoadBalancerInner withId(String id) { - this.id = id; - return this; - } - - /** {@inheritDoc} */ - @Override - public LoadBalancerInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public LoadBalancerInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the frontendIpConfigurations property: Object representing the frontend IPs to be used for the load balancer. - * - * @return the frontendIpConfigurations value. - */ - public List frontendIpConfigurations() { - return this.innerProperties() == null ? null : this.innerProperties().frontendIpConfigurations(); - } - - /** - * Set the frontendIpConfigurations property: Object representing the frontend IPs to be used for the load balancer. - * - * @param frontendIpConfigurations the frontendIpConfigurations value to set. - * @return the LoadBalancerInner object itself. - */ - public LoadBalancerInner withFrontendIpConfigurations(List frontendIpConfigurations) { - if (this.innerProperties() == null) { - this.innerProperties = new LoadBalancerPropertiesFormat(); - } - this.innerProperties().withFrontendIpConfigurations(frontendIpConfigurations); - return this; - } - - /** - * Get the backendAddressPools property: Collection of backend address pools used by a load balancer. - * - * @return the backendAddressPools value. - */ - public List backendAddressPools() { - return this.innerProperties() == null ? null : this.innerProperties().backendAddressPools(); - } - - /** - * Set the backendAddressPools property: Collection of backend address pools used by a load balancer. - * - * @param backendAddressPools the backendAddressPools value to set. - * @return the LoadBalancerInner object itself. - */ - public LoadBalancerInner withBackendAddressPools(List backendAddressPools) { - if (this.innerProperties() == null) { - this.innerProperties = new LoadBalancerPropertiesFormat(); - } - this.innerProperties().withBackendAddressPools(backendAddressPools); - return this; - } - - /** - * Get the loadBalancingRules property: Object collection representing the load balancing rules Gets the - * provisioning. - * - * @return the loadBalancingRules value. - */ - public List loadBalancingRules() { - return this.innerProperties() == null ? null : this.innerProperties().loadBalancingRules(); - } - - /** - * Set the loadBalancingRules property: Object collection representing the load balancing rules Gets the - * provisioning. - * - * @param loadBalancingRules the loadBalancingRules value to set. - * @return the LoadBalancerInner object itself. - */ - public LoadBalancerInner withLoadBalancingRules(List loadBalancingRules) { - if (this.innerProperties() == null) { - this.innerProperties = new LoadBalancerPropertiesFormat(); - } - this.innerProperties().withLoadBalancingRules(loadBalancingRules); - return this; - } - - /** - * Get the probes property: Collection of probe objects used in the load balancer. - * - * @return the probes value. - */ - public List probes() { - return this.innerProperties() == null ? null : this.innerProperties().probes(); - } - - /** - * Set the probes property: Collection of probe objects used in the load balancer. - * - * @param probes the probes value to set. - * @return the LoadBalancerInner object itself. - */ - public LoadBalancerInner withProbes(List probes) { - if (this.innerProperties() == null) { - this.innerProperties = new LoadBalancerPropertiesFormat(); - } - this.innerProperties().withProbes(probes); - return this; - } - - /** - * Get the inboundNatRules property: Collection of inbound NAT Rules used by a load balancer. Defining inbound NAT - * rules on your load balancer is mutually exclusive with defining an inbound NAT pool. Inbound NAT pools are - * referenced from virtual machine scale sets. NICs that are associated with individual virtual machines cannot - * reference an Inbound NAT pool. They have to reference individual inbound NAT rules. - * - * @return the inboundNatRules value. - */ - public List inboundNatRules() { - return this.innerProperties() == null ? null : this.innerProperties().inboundNatRules(); - } - - /** - * Set the inboundNatRules property: Collection of inbound NAT Rules used by a load balancer. Defining inbound NAT - * rules on your load balancer is mutually exclusive with defining an inbound NAT pool. Inbound NAT pools are - * referenced from virtual machine scale sets. NICs that are associated with individual virtual machines cannot - * reference an Inbound NAT pool. They have to reference individual inbound NAT rules. - * - * @param inboundNatRules the inboundNatRules value to set. - * @return the LoadBalancerInner object itself. - */ - public LoadBalancerInner withInboundNatRules(List inboundNatRules) { - if (this.innerProperties() == null) { - this.innerProperties = new LoadBalancerPropertiesFormat(); - } - this.innerProperties().withInboundNatRules(inboundNatRules); - return this; - } - - /** - * Get the inboundNatPools property: Defines an external port range for inbound NAT to a single backend port on NICs - * associated with a load balancer. Inbound NAT rules are created automatically for each NIC associated with the - * Load Balancer using an external port from this range. Defining an Inbound NAT pool on your Load Balancer is - * mutually exclusive with defining inbound Nat rules. Inbound NAT pools are referenced from virtual machine scale - * sets. NICs that are associated with individual virtual machines cannot reference an inbound NAT pool. They have - * to reference individual inbound NAT rules. - * - * @return the inboundNatPools value. - */ - public List inboundNatPools() { - return this.innerProperties() == null ? null : this.innerProperties().inboundNatPools(); - } - - /** - * Set the inboundNatPools property: Defines an external port range for inbound NAT to a single backend port on NICs - * associated with a load balancer. Inbound NAT rules are created automatically for each NIC associated with the - * Load Balancer using an external port from this range. Defining an Inbound NAT pool on your Load Balancer is - * mutually exclusive with defining inbound Nat rules. Inbound NAT pools are referenced from virtual machine scale - * sets. NICs that are associated with individual virtual machines cannot reference an inbound NAT pool. They have - * to reference individual inbound NAT rules. - * - * @param inboundNatPools the inboundNatPools value to set. - * @return the LoadBalancerInner object itself. - */ - public LoadBalancerInner withInboundNatPools(List inboundNatPools) { - if (this.innerProperties() == null) { - this.innerProperties = new LoadBalancerPropertiesFormat(); - } - this.innerProperties().withInboundNatPools(inboundNatPools); - return this; - } - - /** - * Get the outboundRules property: The outbound rules. - * - * @return the outboundRules value. - */ - public List outboundRules() { - return this.innerProperties() == null ? null : this.innerProperties().outboundRules(); - } - - /** - * Set the outboundRules property: The outbound rules. - * - * @param outboundRules the outboundRules value to set. - * @return the LoadBalancerInner object itself. - */ - public LoadBalancerInner withOutboundRules(List outboundRules) { - if (this.innerProperties() == null) { - this.innerProperties = new LoadBalancerPropertiesFormat(); - } - this.innerProperties().withOutboundRules(outboundRules); - return this; - } - - /** - * Get the resourceGuid property: The resource GUID property of the load balancer resource. - * - * @return the resourceGuid value. - */ - public String resourceGuid() { - return this.innerProperties() == null ? null : this.innerProperties().resourceGuid(); - } - - /** - * Set the resourceGuid property: The resource GUID property of the load balancer resource. - * - * @param resourceGuid the resourceGuid value to set. - * @return the LoadBalancerInner object itself. - */ - public LoadBalancerInner withResourceGuid(String resourceGuid) { - if (this.innerProperties() == null) { - this.innerProperties = new LoadBalancerPropertiesFormat(); - } - this.innerProperties().withResourceGuid(resourceGuid); - return this; - } - - /** - * Get the provisioningState property: Gets the provisioning state of the PublicIP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Set the provisioningState property: Gets the provisioning state of the PublicIP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param provisioningState the provisioningState value to set. - * @return the LoadBalancerInner object itself. - */ - public LoadBalancerInner withProvisioningState(String provisioningState) { - if (this.innerProperties() == null) { - this.innerProperties = new LoadBalancerPropertiesFormat(); - } - this.innerProperties().withProvisioningState(provisioningState); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (sku() != null) { - sku().validate(); - } - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/LoadBalancerPropertiesFormat.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/LoadBalancerPropertiesFormat.java deleted file mode 100644 index 23d4fd7046a9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/LoadBalancerPropertiesFormat.java +++ /dev/null @@ -1,316 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.InboundNatPool; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Properties of the load balancer. */ -@Fluent -public final class LoadBalancerPropertiesFormat { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LoadBalancerPropertiesFormat.class); - - /* - * Object representing the frontend IPs to be used for the load balancer - */ - @JsonProperty(value = "frontendIPConfigurations") - private List frontendIpConfigurations; - - /* - * Collection of backend address pools used by a load balancer - */ - @JsonProperty(value = "backendAddressPools") - private List backendAddressPools; - - /* - * Object collection representing the load balancing rules Gets the - * provisioning - */ - @JsonProperty(value = "loadBalancingRules") - private List loadBalancingRules; - - /* - * Collection of probe objects used in the load balancer - */ - @JsonProperty(value = "probes") - private List probes; - - /* - * Collection of inbound NAT Rules used by a load balancer. Defining - * inbound NAT rules on your load balancer is mutually exclusive with - * defining an inbound NAT pool. Inbound NAT pools are referenced from - * virtual machine scale sets. NICs that are associated with individual - * virtual machines cannot reference an Inbound NAT pool. They have to - * reference individual inbound NAT rules. - */ - @JsonProperty(value = "inboundNatRules") - private List inboundNatRules; - - /* - * Defines an external port range for inbound NAT to a single backend port - * on NICs associated with a load balancer. Inbound NAT rules are created - * automatically for each NIC associated with the Load Balancer using an - * external port from this range. Defining an Inbound NAT pool on your Load - * Balancer is mutually exclusive with defining inbound Nat rules. Inbound - * NAT pools are referenced from virtual machine scale sets. NICs that are - * associated with individual virtual machines cannot reference an inbound - * NAT pool. They have to reference individual inbound NAT rules. - */ - @JsonProperty(value = "inboundNatPools") - private List inboundNatPools; - - /* - * The outbound rules. - */ - @JsonProperty(value = "outboundRules") - private List outboundRules; - - /* - * The resource GUID property of the load balancer resource. - */ - @JsonProperty(value = "resourceGuid") - private String resourceGuid; - - /* - * Gets the provisioning state of the PublicIP resource. Possible values - * are: 'Updating', 'Deleting', and 'Failed'. - */ - @JsonProperty(value = "provisioningState") - private String provisioningState; - - /** - * Get the frontendIpConfigurations property: Object representing the frontend IPs to be used for the load balancer. - * - * @return the frontendIpConfigurations value. - */ - public List frontendIpConfigurations() { - return this.frontendIpConfigurations; - } - - /** - * Set the frontendIpConfigurations property: Object representing the frontend IPs to be used for the load balancer. - * - * @param frontendIpConfigurations the frontendIpConfigurations value to set. - * @return the LoadBalancerPropertiesFormat object itself. - */ - public LoadBalancerPropertiesFormat withFrontendIpConfigurations( - List frontendIpConfigurations) { - this.frontendIpConfigurations = frontendIpConfigurations; - return this; - } - - /** - * Get the backendAddressPools property: Collection of backend address pools used by a load balancer. - * - * @return the backendAddressPools value. - */ - public List backendAddressPools() { - return this.backendAddressPools; - } - - /** - * Set the backendAddressPools property: Collection of backend address pools used by a load balancer. - * - * @param backendAddressPools the backendAddressPools value to set. - * @return the LoadBalancerPropertiesFormat object itself. - */ - public LoadBalancerPropertiesFormat withBackendAddressPools(List backendAddressPools) { - this.backendAddressPools = backendAddressPools; - return this; - } - - /** - * Get the loadBalancingRules property: Object collection representing the load balancing rules Gets the - * provisioning. - * - * @return the loadBalancingRules value. - */ - public List loadBalancingRules() { - return this.loadBalancingRules; - } - - /** - * Set the loadBalancingRules property: Object collection representing the load balancing rules Gets the - * provisioning. - * - * @param loadBalancingRules the loadBalancingRules value to set. - * @return the LoadBalancerPropertiesFormat object itself. - */ - public LoadBalancerPropertiesFormat withLoadBalancingRules(List loadBalancingRules) { - this.loadBalancingRules = loadBalancingRules; - return this; - } - - /** - * Get the probes property: Collection of probe objects used in the load balancer. - * - * @return the probes value. - */ - public List probes() { - return this.probes; - } - - /** - * Set the probes property: Collection of probe objects used in the load balancer. - * - * @param probes the probes value to set. - * @return the LoadBalancerPropertiesFormat object itself. - */ - public LoadBalancerPropertiesFormat withProbes(List probes) { - this.probes = probes; - return this; - } - - /** - * Get the inboundNatRules property: Collection of inbound NAT Rules used by a load balancer. Defining inbound NAT - * rules on your load balancer is mutually exclusive with defining an inbound NAT pool. Inbound NAT pools are - * referenced from virtual machine scale sets. NICs that are associated with individual virtual machines cannot - * reference an Inbound NAT pool. They have to reference individual inbound NAT rules. - * - * @return the inboundNatRules value. - */ - public List inboundNatRules() { - return this.inboundNatRules; - } - - /** - * Set the inboundNatRules property: Collection of inbound NAT Rules used by a load balancer. Defining inbound NAT - * rules on your load balancer is mutually exclusive with defining an inbound NAT pool. Inbound NAT pools are - * referenced from virtual machine scale sets. NICs that are associated with individual virtual machines cannot - * reference an Inbound NAT pool. They have to reference individual inbound NAT rules. - * - * @param inboundNatRules the inboundNatRules value to set. - * @return the LoadBalancerPropertiesFormat object itself. - */ - public LoadBalancerPropertiesFormat withInboundNatRules(List inboundNatRules) { - this.inboundNatRules = inboundNatRules; - return this; - } - - /** - * Get the inboundNatPools property: Defines an external port range for inbound NAT to a single backend port on NICs - * associated with a load balancer. Inbound NAT rules are created automatically for each NIC associated with the - * Load Balancer using an external port from this range. Defining an Inbound NAT pool on your Load Balancer is - * mutually exclusive with defining inbound Nat rules. Inbound NAT pools are referenced from virtual machine scale - * sets. NICs that are associated with individual virtual machines cannot reference an inbound NAT pool. They have - * to reference individual inbound NAT rules. - * - * @return the inboundNatPools value. - */ - public List inboundNatPools() { - return this.inboundNatPools; - } - - /** - * Set the inboundNatPools property: Defines an external port range for inbound NAT to a single backend port on NICs - * associated with a load balancer. Inbound NAT rules are created automatically for each NIC associated with the - * Load Balancer using an external port from this range. Defining an Inbound NAT pool on your Load Balancer is - * mutually exclusive with defining inbound Nat rules. Inbound NAT pools are referenced from virtual machine scale - * sets. NICs that are associated with individual virtual machines cannot reference an inbound NAT pool. They have - * to reference individual inbound NAT rules. - * - * @param inboundNatPools the inboundNatPools value to set. - * @return the LoadBalancerPropertiesFormat object itself. - */ - public LoadBalancerPropertiesFormat withInboundNatPools(List inboundNatPools) { - this.inboundNatPools = inboundNatPools; - return this; - } - - /** - * Get the outboundRules property: The outbound rules. - * - * @return the outboundRules value. - */ - public List outboundRules() { - return this.outboundRules; - } - - /** - * Set the outboundRules property: The outbound rules. - * - * @param outboundRules the outboundRules value to set. - * @return the LoadBalancerPropertiesFormat object itself. - */ - public LoadBalancerPropertiesFormat withOutboundRules(List outboundRules) { - this.outboundRules = outboundRules; - return this; - } - - /** - * Get the resourceGuid property: The resource GUID property of the load balancer resource. - * - * @return the resourceGuid value. - */ - public String resourceGuid() { - return this.resourceGuid; - } - - /** - * Set the resourceGuid property: The resource GUID property of the load balancer resource. - * - * @param resourceGuid the resourceGuid value to set. - * @return the LoadBalancerPropertiesFormat object itself. - */ - public LoadBalancerPropertiesFormat withResourceGuid(String resourceGuid) { - this.resourceGuid = resourceGuid; - return this; - } - - /** - * Get the provisioningState property: Gets the provisioning state of the PublicIP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Set the provisioningState property: Gets the provisioning state of the PublicIP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param provisioningState the provisioningState value to set. - * @return the LoadBalancerPropertiesFormat object itself. - */ - public LoadBalancerPropertiesFormat withProvisioningState(String provisioningState) { - this.provisioningState = provisioningState; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (frontendIpConfigurations() != null) { - frontendIpConfigurations().forEach(e -> e.validate()); - } - if (backendAddressPools() != null) { - backendAddressPools().forEach(e -> e.validate()); - } - if (loadBalancingRules() != null) { - loadBalancingRules().forEach(e -> e.validate()); - } - if (probes() != null) { - probes().forEach(e -> e.validate()); - } - if (inboundNatRules() != null) { - inboundNatRules().forEach(e -> e.validate()); - } - if (inboundNatPools() != null) { - inboundNatPools().forEach(e -> e.validate()); - } - if (outboundRules() != null) { - outboundRules().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/LoadBalancingRuleInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/LoadBalancingRuleInner.java deleted file mode 100644 index e0a3c43e31d7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/LoadBalancingRuleInner.java +++ /dev/null @@ -1,403 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.LoadDistribution; -import com.azure.resourcemanager.network.models.TransportProtocol; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** A load balancing rule for a load balancer. */ -@Fluent -public final class LoadBalancingRuleInner extends SubResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LoadBalancingRuleInner.class); - - /* - * Properties of load balancer load balancing rule. - */ - @JsonProperty(value = "properties") - private LoadBalancingRulePropertiesFormat innerProperties; - - /* - * The name of the resource that is unique within a resource group. This - * name can be used to access the resource. - */ - @JsonProperty(value = "name") - private String name; - - /* - * A unique read-only string that changes whenever the resource is updated. - */ - @JsonProperty(value = "etag") - private String etag; - - /** - * Get the innerProperties property: Properties of load balancer load balancing rule. - * - * @return the innerProperties value. - */ - private LoadBalancingRulePropertiesFormat innerProperties() { - return this.innerProperties; - } - - /** - * Get the name property: The name of the resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @param name the name value to set. - * @return the LoadBalancingRuleInner object itself. - */ - public LoadBalancingRuleInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @param etag the etag value to set. - * @return the LoadBalancingRuleInner object itself. - */ - public LoadBalancingRuleInner withEtag(String etag) { - this.etag = etag; - return this; - } - - /** {@inheritDoc} */ - @Override - public LoadBalancingRuleInner withId(String id) { - super.withId(id); - return this; - } - - /** - * Get the frontendIpConfiguration property: A reference to frontend IP addresses. - * - * @return the frontendIpConfiguration value. - */ - public SubResource frontendIpConfiguration() { - return this.innerProperties() == null ? null : this.innerProperties().frontendIpConfiguration(); - } - - /** - * Set the frontendIpConfiguration property: A reference to frontend IP addresses. - * - * @param frontendIpConfiguration the frontendIpConfiguration value to set. - * @return the LoadBalancingRuleInner object itself. - */ - public LoadBalancingRuleInner withFrontendIpConfiguration(SubResource frontendIpConfiguration) { - if (this.innerProperties() == null) { - this.innerProperties = new LoadBalancingRulePropertiesFormat(); - } - this.innerProperties().withFrontendIpConfiguration(frontendIpConfiguration); - return this; - } - - /** - * Get the backendAddressPool property: A reference to a pool of DIPs. Inbound traffic is randomly load balanced - * across IPs in the backend IPs. - * - * @return the backendAddressPool value. - */ - public SubResource backendAddressPool() { - return this.innerProperties() == null ? null : this.innerProperties().backendAddressPool(); - } - - /** - * Set the backendAddressPool property: A reference to a pool of DIPs. Inbound traffic is randomly load balanced - * across IPs in the backend IPs. - * - * @param backendAddressPool the backendAddressPool value to set. - * @return the LoadBalancingRuleInner object itself. - */ - public LoadBalancingRuleInner withBackendAddressPool(SubResource backendAddressPool) { - if (this.innerProperties() == null) { - this.innerProperties = new LoadBalancingRulePropertiesFormat(); - } - this.innerProperties().withBackendAddressPool(backendAddressPool); - return this; - } - - /** - * Get the probe property: The reference of the load balancer probe used by the load balancing rule. - * - * @return the probe value. - */ - public SubResource probe() { - return this.innerProperties() == null ? null : this.innerProperties().probe(); - } - - /** - * Set the probe property: The reference of the load balancer probe used by the load balancing rule. - * - * @param probe the probe value to set. - * @return the LoadBalancingRuleInner object itself. - */ - public LoadBalancingRuleInner withProbe(SubResource probe) { - if (this.innerProperties() == null) { - this.innerProperties = new LoadBalancingRulePropertiesFormat(); - } - this.innerProperties().withProbe(probe); - return this; - } - - /** - * Get the protocol property: The transport protocol for the endpoint. Possible values are 'Udp' or 'Tcp' or 'All'. - * - * @return the protocol value. - */ - public TransportProtocol protocol() { - return this.innerProperties() == null ? null : this.innerProperties().protocol(); - } - - /** - * Set the protocol property: The transport protocol for the endpoint. Possible values are 'Udp' or 'Tcp' or 'All'. - * - * @param protocol the protocol value to set. - * @return the LoadBalancingRuleInner object itself. - */ - public LoadBalancingRuleInner withProtocol(TransportProtocol protocol) { - if (this.innerProperties() == null) { - this.innerProperties = new LoadBalancingRulePropertiesFormat(); - } - this.innerProperties().withProtocol(protocol); - return this; - } - - /** - * Get the loadDistribution property: The load distribution policy for this rule. Possible values are 'Default', - * 'SourceIP', and 'SourceIPProtocol'. - * - * @return the loadDistribution value. - */ - public LoadDistribution loadDistribution() { - return this.innerProperties() == null ? null : this.innerProperties().loadDistribution(); - } - - /** - * Set the loadDistribution property: The load distribution policy for this rule. Possible values are 'Default', - * 'SourceIP', and 'SourceIPProtocol'. - * - * @param loadDistribution the loadDistribution value to set. - * @return the LoadBalancingRuleInner object itself. - */ - public LoadBalancingRuleInner withLoadDistribution(LoadDistribution loadDistribution) { - if (this.innerProperties() == null) { - this.innerProperties = new LoadBalancingRulePropertiesFormat(); - } - this.innerProperties().withLoadDistribution(loadDistribution); - return this; - } - - /** - * Get the frontendPort property: The port for the external endpoint. Port numbers for each rule must be unique - * within the Load Balancer. Acceptable values are between 0 and 65534. Note that value 0 enables "Any Port". - * - * @return the frontendPort value. - */ - public Integer frontendPort() { - return this.innerProperties() == null ? null : this.innerProperties().frontendPort(); - } - - /** - * Set the frontendPort property: The port for the external endpoint. Port numbers for each rule must be unique - * within the Load Balancer. Acceptable values are between 0 and 65534. Note that value 0 enables "Any Port". - * - * @param frontendPort the frontendPort value to set. - * @return the LoadBalancingRuleInner object itself. - */ - public LoadBalancingRuleInner withFrontendPort(Integer frontendPort) { - if (this.innerProperties() == null) { - this.innerProperties = new LoadBalancingRulePropertiesFormat(); - } - this.innerProperties().withFrontendPort(frontendPort); - return this; - } - - /** - * Get the backendPort property: The port used for internal connections on the endpoint. Acceptable values are - * between 0 and 65535. Note that value 0 enables "Any Port". - * - * @return the backendPort value. - */ - public Integer backendPort() { - return this.innerProperties() == null ? null : this.innerProperties().backendPort(); - } - - /** - * Set the backendPort property: The port used for internal connections on the endpoint. Acceptable values are - * between 0 and 65535. Note that value 0 enables "Any Port". - * - * @param backendPort the backendPort value to set. - * @return the LoadBalancingRuleInner object itself. - */ - public LoadBalancingRuleInner withBackendPort(Integer backendPort) { - if (this.innerProperties() == null) { - this.innerProperties = new LoadBalancingRulePropertiesFormat(); - } - this.innerProperties().withBackendPort(backendPort); - return this; - } - - /** - * Get the idleTimeoutInMinutes property: The timeout for the TCP idle connection. The value can be set between 4 - * and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP. - * - * @return the idleTimeoutInMinutes value. - */ - public Integer idleTimeoutInMinutes() { - return this.innerProperties() == null ? null : this.innerProperties().idleTimeoutInMinutes(); - } - - /** - * Set the idleTimeoutInMinutes property: The timeout for the TCP idle connection. The value can be set between 4 - * and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP. - * - * @param idleTimeoutInMinutes the idleTimeoutInMinutes value to set. - * @return the LoadBalancingRuleInner object itself. - */ - public LoadBalancingRuleInner withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes) { - if (this.innerProperties() == null) { - this.innerProperties = new LoadBalancingRulePropertiesFormat(); - } - this.innerProperties().withIdleTimeoutInMinutes(idleTimeoutInMinutes); - return this; - } - - /** - * Get the enableFloatingIp property: Configures a virtual machine's endpoint for the floating IP capability - * required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn - * Availability Groups in SQL server. This setting can't be changed after you create the endpoint. - * - * @return the enableFloatingIp value. - */ - public Boolean enableFloatingIp() { - return this.innerProperties() == null ? null : this.innerProperties().enableFloatingIp(); - } - - /** - * Set the enableFloatingIp property: Configures a virtual machine's endpoint for the floating IP capability - * required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn - * Availability Groups in SQL server. This setting can't be changed after you create the endpoint. - * - * @param enableFloatingIp the enableFloatingIp value to set. - * @return the LoadBalancingRuleInner object itself. - */ - public LoadBalancingRuleInner withEnableFloatingIp(Boolean enableFloatingIp) { - if (this.innerProperties() == null) { - this.innerProperties = new LoadBalancingRulePropertiesFormat(); - } - this.innerProperties().withEnableFloatingIp(enableFloatingIp); - return this; - } - - /** - * Get the enableTcpReset property: Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected - * connection termination. This element is only used when the protocol is set to TCP. - * - * @return the enableTcpReset value. - */ - public Boolean enableTcpReset() { - return this.innerProperties() == null ? null : this.innerProperties().enableTcpReset(); - } - - /** - * Set the enableTcpReset property: Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected - * connection termination. This element is only used when the protocol is set to TCP. - * - * @param enableTcpReset the enableTcpReset value to set. - * @return the LoadBalancingRuleInner object itself. - */ - public LoadBalancingRuleInner withEnableTcpReset(Boolean enableTcpReset) { - if (this.innerProperties() == null) { - this.innerProperties = new LoadBalancingRulePropertiesFormat(); - } - this.innerProperties().withEnableTcpReset(enableTcpReset); - return this; - } - - /** - * Get the disableOutboundSnat property: Configures SNAT for the VMs in the backend pool to use the publicIP address - * specified in the frontend of the load balancing rule. - * - * @return the disableOutboundSnat value. - */ - public Boolean disableOutboundSnat() { - return this.innerProperties() == null ? null : this.innerProperties().disableOutboundSnat(); - } - - /** - * Set the disableOutboundSnat property: Configures SNAT for the VMs in the backend pool to use the publicIP address - * specified in the frontend of the load balancing rule. - * - * @param disableOutboundSnat the disableOutboundSnat value to set. - * @return the LoadBalancingRuleInner object itself. - */ - public LoadBalancingRuleInner withDisableOutboundSnat(Boolean disableOutboundSnat) { - if (this.innerProperties() == null) { - this.innerProperties = new LoadBalancingRulePropertiesFormat(); - } - this.innerProperties().withDisableOutboundSnat(disableOutboundSnat); - return this; - } - - /** - * Get the provisioningState property: Gets the provisioning state of the PublicIP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Set the provisioningState property: Gets the provisioning state of the PublicIP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param provisioningState the provisioningState value to set. - * @return the LoadBalancingRuleInner object itself. - */ - public LoadBalancingRuleInner withProvisioningState(String provisioningState) { - if (this.innerProperties() == null) { - this.innerProperties = new LoadBalancingRulePropertiesFormat(); - } - this.innerProperties().withProvisioningState(provisioningState); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/LoadBalancingRulePropertiesFormat.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/LoadBalancingRulePropertiesFormat.java deleted file mode 100644 index 076e0275716b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/LoadBalancingRulePropertiesFormat.java +++ /dev/null @@ -1,381 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.LoadDistribution; -import com.azure.resourcemanager.network.models.TransportProtocol; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Properties of the load balancer. */ -@Fluent -public final class LoadBalancingRulePropertiesFormat { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LoadBalancingRulePropertiesFormat.class); - - /* - * A reference to frontend IP addresses. - */ - @JsonProperty(value = "frontendIPConfiguration") - private SubResource frontendIpConfiguration; - - /* - * A reference to a pool of DIPs. Inbound traffic is randomly load balanced - * across IPs in the backend IPs. - */ - @JsonProperty(value = "backendAddressPool") - private SubResource backendAddressPool; - - /* - * The reference of the load balancer probe used by the load balancing - * rule. - */ - @JsonProperty(value = "probe") - private SubResource probe; - - /* - * The transport protocol for the endpoint. Possible values are 'Udp' or - * 'Tcp' or 'All'. - */ - @JsonProperty(value = "protocol", required = true) - private TransportProtocol protocol; - - /* - * The load distribution policy for this rule. Possible values are - * 'Default', 'SourceIP', and 'SourceIPProtocol'. - */ - @JsonProperty(value = "loadDistribution") - private LoadDistribution loadDistribution; - - /* - * The port for the external endpoint. Port numbers for each rule must be - * unique within the Load Balancer. Acceptable values are between 0 and - * 65534. Note that value 0 enables "Any Port" - */ - @JsonProperty(value = "frontendPort", required = true) - private int frontendPort; - - /* - * The port used for internal connections on the endpoint. Acceptable - * values are between 0 and 65535. Note that value 0 enables "Any Port" - */ - @JsonProperty(value = "backendPort") - private Integer backendPort; - - /* - * The timeout for the TCP idle connection. The value can be set between 4 - * and 30 minutes. The default value is 4 minutes. This element is only - * used when the protocol is set to TCP. - */ - @JsonProperty(value = "idleTimeoutInMinutes") - private Integer idleTimeoutInMinutes; - - /* - * Configures a virtual machine's endpoint for the floating IP capability - * required to configure a SQL AlwaysOn Availability Group. This setting is - * required when using the SQL AlwaysOn Availability Groups in SQL server. - * This setting can't be changed after you create the endpoint. - */ - @JsonProperty(value = "enableFloatingIP") - private Boolean enableFloatingIp; - - /* - * Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected - * connection termination. This element is only used when the protocol is - * set to TCP. - */ - @JsonProperty(value = "enableTcpReset") - private Boolean enableTcpReset; - - /* - * Configures SNAT for the VMs in the backend pool to use the publicIP - * address specified in the frontend of the load balancing rule. - */ - @JsonProperty(value = "disableOutboundSnat") - private Boolean disableOutboundSnat; - - /* - * Gets the provisioning state of the PublicIP resource. Possible values - * are: 'Updating', 'Deleting', and 'Failed'. - */ - @JsonProperty(value = "provisioningState") - private String provisioningState; - - /** - * Get the frontendIpConfiguration property: A reference to frontend IP addresses. - * - * @return the frontendIpConfiguration value. - */ - public SubResource frontendIpConfiguration() { - return this.frontendIpConfiguration; - } - - /** - * Set the frontendIpConfiguration property: A reference to frontend IP addresses. - * - * @param frontendIpConfiguration the frontendIpConfiguration value to set. - * @return the LoadBalancingRulePropertiesFormat object itself. - */ - public LoadBalancingRulePropertiesFormat withFrontendIpConfiguration(SubResource frontendIpConfiguration) { - this.frontendIpConfiguration = frontendIpConfiguration; - return this; - } - - /** - * Get the backendAddressPool property: A reference to a pool of DIPs. Inbound traffic is randomly load balanced - * across IPs in the backend IPs. - * - * @return the backendAddressPool value. - */ - public SubResource backendAddressPool() { - return this.backendAddressPool; - } - - /** - * Set the backendAddressPool property: A reference to a pool of DIPs. Inbound traffic is randomly load balanced - * across IPs in the backend IPs. - * - * @param backendAddressPool the backendAddressPool value to set. - * @return the LoadBalancingRulePropertiesFormat object itself. - */ - public LoadBalancingRulePropertiesFormat withBackendAddressPool(SubResource backendAddressPool) { - this.backendAddressPool = backendAddressPool; - return this; - } - - /** - * Get the probe property: The reference of the load balancer probe used by the load balancing rule. - * - * @return the probe value. - */ - public SubResource probe() { - return this.probe; - } - - /** - * Set the probe property: The reference of the load balancer probe used by the load balancing rule. - * - * @param probe the probe value to set. - * @return the LoadBalancingRulePropertiesFormat object itself. - */ - public LoadBalancingRulePropertiesFormat withProbe(SubResource probe) { - this.probe = probe; - return this; - } - - /** - * Get the protocol property: The transport protocol for the endpoint. Possible values are 'Udp' or 'Tcp' or 'All'. - * - * @return the protocol value. - */ - public TransportProtocol protocol() { - return this.protocol; - } - - /** - * Set the protocol property: The transport protocol for the endpoint. Possible values are 'Udp' or 'Tcp' or 'All'. - * - * @param protocol the protocol value to set. - * @return the LoadBalancingRulePropertiesFormat object itself. - */ - public LoadBalancingRulePropertiesFormat withProtocol(TransportProtocol protocol) { - this.protocol = protocol; - return this; - } - - /** - * Get the loadDistribution property: The load distribution policy for this rule. Possible values are 'Default', - * 'SourceIP', and 'SourceIPProtocol'. - * - * @return the loadDistribution value. - */ - public LoadDistribution loadDistribution() { - return this.loadDistribution; - } - - /** - * Set the loadDistribution property: The load distribution policy for this rule. Possible values are 'Default', - * 'SourceIP', and 'SourceIPProtocol'. - * - * @param loadDistribution the loadDistribution value to set. - * @return the LoadBalancingRulePropertiesFormat object itself. - */ - public LoadBalancingRulePropertiesFormat withLoadDistribution(LoadDistribution loadDistribution) { - this.loadDistribution = loadDistribution; - return this; - } - - /** - * Get the frontendPort property: The port for the external endpoint. Port numbers for each rule must be unique - * within the Load Balancer. Acceptable values are between 0 and 65534. Note that value 0 enables "Any Port". - * - * @return the frontendPort value. - */ - public int frontendPort() { - return this.frontendPort; - } - - /** - * Set the frontendPort property: The port for the external endpoint. Port numbers for each rule must be unique - * within the Load Balancer. Acceptable values are between 0 and 65534. Note that value 0 enables "Any Port". - * - * @param frontendPort the frontendPort value to set. - * @return the LoadBalancingRulePropertiesFormat object itself. - */ - public LoadBalancingRulePropertiesFormat withFrontendPort(int frontendPort) { - this.frontendPort = frontendPort; - return this; - } - - /** - * Get the backendPort property: The port used for internal connections on the endpoint. Acceptable values are - * between 0 and 65535. Note that value 0 enables "Any Port". - * - * @return the backendPort value. - */ - public Integer backendPort() { - return this.backendPort; - } - - /** - * Set the backendPort property: The port used for internal connections on the endpoint. Acceptable values are - * between 0 and 65535. Note that value 0 enables "Any Port". - * - * @param backendPort the backendPort value to set. - * @return the LoadBalancingRulePropertiesFormat object itself. - */ - public LoadBalancingRulePropertiesFormat withBackendPort(Integer backendPort) { - this.backendPort = backendPort; - return this; - } - - /** - * Get the idleTimeoutInMinutes property: The timeout for the TCP idle connection. The value can be set between 4 - * and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP. - * - * @return the idleTimeoutInMinutes value. - */ - public Integer idleTimeoutInMinutes() { - return this.idleTimeoutInMinutes; - } - - /** - * Set the idleTimeoutInMinutes property: The timeout for the TCP idle connection. The value can be set between 4 - * and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP. - * - * @param idleTimeoutInMinutes the idleTimeoutInMinutes value to set. - * @return the LoadBalancingRulePropertiesFormat object itself. - */ - public LoadBalancingRulePropertiesFormat withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes) { - this.idleTimeoutInMinutes = idleTimeoutInMinutes; - return this; - } - - /** - * Get the enableFloatingIp property: Configures a virtual machine's endpoint for the floating IP capability - * required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn - * Availability Groups in SQL server. This setting can't be changed after you create the endpoint. - * - * @return the enableFloatingIp value. - */ - public Boolean enableFloatingIp() { - return this.enableFloatingIp; - } - - /** - * Set the enableFloatingIp property: Configures a virtual machine's endpoint for the floating IP capability - * required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn - * Availability Groups in SQL server. This setting can't be changed after you create the endpoint. - * - * @param enableFloatingIp the enableFloatingIp value to set. - * @return the LoadBalancingRulePropertiesFormat object itself. - */ - public LoadBalancingRulePropertiesFormat withEnableFloatingIp(Boolean enableFloatingIp) { - this.enableFloatingIp = enableFloatingIp; - return this; - } - - /** - * Get the enableTcpReset property: Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected - * connection termination. This element is only used when the protocol is set to TCP. - * - * @return the enableTcpReset value. - */ - public Boolean enableTcpReset() { - return this.enableTcpReset; - } - - /** - * Set the enableTcpReset property: Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected - * connection termination. This element is only used when the protocol is set to TCP. - * - * @param enableTcpReset the enableTcpReset value to set. - * @return the LoadBalancingRulePropertiesFormat object itself. - */ - public LoadBalancingRulePropertiesFormat withEnableTcpReset(Boolean enableTcpReset) { - this.enableTcpReset = enableTcpReset; - return this; - } - - /** - * Get the disableOutboundSnat property: Configures SNAT for the VMs in the backend pool to use the publicIP address - * specified in the frontend of the load balancing rule. - * - * @return the disableOutboundSnat value. - */ - public Boolean disableOutboundSnat() { - return this.disableOutboundSnat; - } - - /** - * Set the disableOutboundSnat property: Configures SNAT for the VMs in the backend pool to use the publicIP address - * specified in the frontend of the load balancing rule. - * - * @param disableOutboundSnat the disableOutboundSnat value to set. - * @return the LoadBalancingRulePropertiesFormat object itself. - */ - public LoadBalancingRulePropertiesFormat withDisableOutboundSnat(Boolean disableOutboundSnat) { - this.disableOutboundSnat = disableOutboundSnat; - return this; - } - - /** - * Get the provisioningState property: Gets the provisioning state of the PublicIP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Set the provisioningState property: Gets the provisioning state of the PublicIP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param provisioningState the provisioningState value to set. - * @return the LoadBalancingRulePropertiesFormat object itself. - */ - public LoadBalancingRulePropertiesFormat withProvisioningState(String provisioningState) { - this.provisioningState = provisioningState; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (protocol() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property protocol in model LoadBalancingRulePropertiesFormat")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/LocalNetworkGatewayInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/LocalNetworkGatewayInner.java deleted file mode 100644 index 7a9c81e383dd..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/LocalNetworkGatewayInner.java +++ /dev/null @@ -1,219 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.AddressSpace; -import com.azure.resourcemanager.network.models.BgpSettings; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** A common class for general resource information. */ -@Fluent -public final class LocalNetworkGatewayInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LocalNetworkGatewayInner.class); - - /* - * Properties of the local network gateway. - */ - @JsonProperty(value = "properties", required = true) - private LocalNetworkGatewayPropertiesFormat innerProperties = new LocalNetworkGatewayPropertiesFormat(); - - /* - * A unique read-only string that changes whenever the resource is updated. - */ - @JsonProperty(value = "etag") - private String etag; - - /* - * Resource ID. - */ - @JsonProperty(value = "id") - private String id; - - /** - * Get the innerProperties property: Properties of the local network gateway. - * - * @return the innerProperties value. - */ - private LocalNetworkGatewayPropertiesFormat innerProperties() { - return this.innerProperties; - } - - /** - * Get the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @param etag the etag value to set. - * @return the LocalNetworkGatewayInner object itself. - */ - public LocalNetworkGatewayInner withEtag(String etag) { - this.etag = etag; - return this; - } - - /** - * Get the id property: Resource ID. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: Resource ID. - * - * @param id the id value to set. - * @return the LocalNetworkGatewayInner object itself. - */ - public LocalNetworkGatewayInner withId(String id) { - this.id = id; - return this; - } - - /** {@inheritDoc} */ - @Override - public LocalNetworkGatewayInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public LocalNetworkGatewayInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the localNetworkAddressSpace property: Local network site address space. - * - * @return the localNetworkAddressSpace value. - */ - public AddressSpace localNetworkAddressSpace() { - return this.innerProperties() == null ? null : this.innerProperties().localNetworkAddressSpace(); - } - - /** - * Set the localNetworkAddressSpace property: Local network site address space. - * - * @param localNetworkAddressSpace the localNetworkAddressSpace value to set. - * @return the LocalNetworkGatewayInner object itself. - */ - public LocalNetworkGatewayInner withLocalNetworkAddressSpace(AddressSpace localNetworkAddressSpace) { - if (this.innerProperties() == null) { - this.innerProperties = new LocalNetworkGatewayPropertiesFormat(); - } - this.innerProperties().withLocalNetworkAddressSpace(localNetworkAddressSpace); - return this; - } - - /** - * Get the gatewayIpAddress property: IP address of local network gateway. - * - * @return the gatewayIpAddress value. - */ - public String gatewayIpAddress() { - return this.innerProperties() == null ? null : this.innerProperties().gatewayIpAddress(); - } - - /** - * Set the gatewayIpAddress property: IP address of local network gateway. - * - * @param gatewayIpAddress the gatewayIpAddress value to set. - * @return the LocalNetworkGatewayInner object itself. - */ - public LocalNetworkGatewayInner withGatewayIpAddress(String gatewayIpAddress) { - if (this.innerProperties() == null) { - this.innerProperties = new LocalNetworkGatewayPropertiesFormat(); - } - this.innerProperties().withGatewayIpAddress(gatewayIpAddress); - return this; - } - - /** - * Get the bgpSettings property: Local network gateway's BGP speaker settings. - * - * @return the bgpSettings value. - */ - public BgpSettings bgpSettings() { - return this.innerProperties() == null ? null : this.innerProperties().bgpSettings(); - } - - /** - * Set the bgpSettings property: Local network gateway's BGP speaker settings. - * - * @param bgpSettings the bgpSettings value to set. - * @return the LocalNetworkGatewayInner object itself. - */ - public LocalNetworkGatewayInner withBgpSettings(BgpSettings bgpSettings) { - if (this.innerProperties() == null) { - this.innerProperties = new LocalNetworkGatewayPropertiesFormat(); - } - this.innerProperties().withBgpSettings(bgpSettings); - return this; - } - - /** - * Get the resourceGuid property: The resource GUID property of the LocalNetworkGateway resource. - * - * @return the resourceGuid value. - */ - public String resourceGuid() { - return this.innerProperties() == null ? null : this.innerProperties().resourceGuid(); - } - - /** - * Set the resourceGuid property: The resource GUID property of the LocalNetworkGateway resource. - * - * @param resourceGuid the resourceGuid value to set. - * @return the LocalNetworkGatewayInner object itself. - */ - public LocalNetworkGatewayInner withResourceGuid(String resourceGuid) { - if (this.innerProperties() == null) { - this.innerProperties = new LocalNetworkGatewayPropertiesFormat(); - } - this.innerProperties().withResourceGuid(resourceGuid); - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the LocalNetworkGateway resource. Possible values - * are: 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property innerProperties in model LocalNetworkGatewayInner")); - } else { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/LocalNetworkGatewayPropertiesFormat.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/LocalNetworkGatewayPropertiesFormat.java deleted file mode 100644 index 8741536352ef..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/LocalNetworkGatewayPropertiesFormat.java +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.AddressSpace; -import com.azure.resourcemanager.network.models.BgpSettings; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** LocalNetworkGateway properties. */ -@Fluent -public final class LocalNetworkGatewayPropertiesFormat { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LocalNetworkGatewayPropertiesFormat.class); - - /* - * Local network site address space. - */ - @JsonProperty(value = "localNetworkAddressSpace") - private AddressSpace localNetworkAddressSpace; - - /* - * IP address of local network gateway. - */ - @JsonProperty(value = "gatewayIpAddress") - private String gatewayIpAddress; - - /* - * Local network gateway's BGP speaker settings. - */ - @JsonProperty(value = "bgpSettings") - private BgpSettings bgpSettings; - - /* - * The resource GUID property of the LocalNetworkGateway resource. - */ - @JsonProperty(value = "resourceGuid") - private String resourceGuid; - - /* - * The provisioning state of the LocalNetworkGateway resource. Possible - * values are: 'Updating', 'Deleting', and 'Failed'. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; - - /** - * Get the localNetworkAddressSpace property: Local network site address space. - * - * @return the localNetworkAddressSpace value. - */ - public AddressSpace localNetworkAddressSpace() { - return this.localNetworkAddressSpace; - } - - /** - * Set the localNetworkAddressSpace property: Local network site address space. - * - * @param localNetworkAddressSpace the localNetworkAddressSpace value to set. - * @return the LocalNetworkGatewayPropertiesFormat object itself. - */ - public LocalNetworkGatewayPropertiesFormat withLocalNetworkAddressSpace(AddressSpace localNetworkAddressSpace) { - this.localNetworkAddressSpace = localNetworkAddressSpace; - return this; - } - - /** - * Get the gatewayIpAddress property: IP address of local network gateway. - * - * @return the gatewayIpAddress value. - */ - public String gatewayIpAddress() { - return this.gatewayIpAddress; - } - - /** - * Set the gatewayIpAddress property: IP address of local network gateway. - * - * @param gatewayIpAddress the gatewayIpAddress value to set. - * @return the LocalNetworkGatewayPropertiesFormat object itself. - */ - public LocalNetworkGatewayPropertiesFormat withGatewayIpAddress(String gatewayIpAddress) { - this.gatewayIpAddress = gatewayIpAddress; - return this; - } - - /** - * Get the bgpSettings property: Local network gateway's BGP speaker settings. - * - * @return the bgpSettings value. - */ - public BgpSettings bgpSettings() { - return this.bgpSettings; - } - - /** - * Set the bgpSettings property: Local network gateway's BGP speaker settings. - * - * @param bgpSettings the bgpSettings value to set. - * @return the LocalNetworkGatewayPropertiesFormat object itself. - */ - public LocalNetworkGatewayPropertiesFormat withBgpSettings(BgpSettings bgpSettings) { - this.bgpSettings = bgpSettings; - return this; - } - - /** - * Get the resourceGuid property: The resource GUID property of the LocalNetworkGateway resource. - * - * @return the resourceGuid value. - */ - public String resourceGuid() { - return this.resourceGuid; - } - - /** - * Set the resourceGuid property: The resource GUID property of the LocalNetworkGateway resource. - * - * @param resourceGuid the resourceGuid value to set. - * @return the LocalNetworkGatewayPropertiesFormat object itself. - */ - public LocalNetworkGatewayPropertiesFormat withResourceGuid(String resourceGuid) { - this.resourceGuid = resourceGuid; - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the LocalNetworkGateway resource. Possible values - * are: 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (localNetworkAddressSpace() != null) { - localNetworkAddressSpace().validate(); - } - if (bgpSettings() != null) { - bgpSettings().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/NetworkConfigurationDiagnosticResponseInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/NetworkConfigurationDiagnosticResponseInner.java deleted file mode 100644 index 4260357be3b0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/NetworkConfigurationDiagnosticResponseInner.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.NetworkConfigurationDiagnosticResult; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Results of network configuration diagnostic on the target resource. */ -@Immutable -public final class NetworkConfigurationDiagnosticResponseInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkConfigurationDiagnosticResponseInner.class); - - /* - * List of network configuration diagnostic results. - */ - @JsonProperty(value = "results", access = JsonProperty.Access.WRITE_ONLY) - private List results; - - /** - * Get the results property: List of network configuration diagnostic results. - * - * @return the results value. - */ - public List results() { - return this.results; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (results() != null) { - results().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/NetworkInterfaceInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/NetworkInterfaceInner.java deleted file mode 100644 index 3e23a1e22ddf..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/NetworkInterfaceInner.java +++ /dev/null @@ -1,373 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.NetworkInterfaceDnsSettings; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** A network interface in a resource group. */ -@Fluent -public final class NetworkInterfaceInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkInterfaceInner.class); - - /* - * Properties of the network interface. - */ - @JsonProperty(value = "properties") - private NetworkInterfacePropertiesFormatInner innerProperties; - - /* - * A unique read-only string that changes whenever the resource is updated. - */ - @JsonProperty(value = "etag") - private String etag; - - /* - * Resource ID. - */ - @JsonProperty(value = "id") - private String id; - - /** - * Get the innerProperties property: Properties of the network interface. - * - * @return the innerProperties value. - */ - private NetworkInterfacePropertiesFormatInner innerProperties() { - return this.innerProperties; - } - - /** - * Get the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @param etag the etag value to set. - * @return the NetworkInterfaceInner object itself. - */ - public NetworkInterfaceInner withEtag(String etag) { - this.etag = etag; - return this; - } - - /** - * Get the id property: Resource ID. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: Resource ID. - * - * @param id the id value to set. - * @return the NetworkInterfaceInner object itself. - */ - public NetworkInterfaceInner withId(String id) { - this.id = id; - return this; - } - - /** {@inheritDoc} */ - @Override - public NetworkInterfaceInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public NetworkInterfaceInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the virtualMachine property: The reference of a virtual machine. - * - * @return the virtualMachine value. - */ - public SubResource virtualMachine() { - return this.innerProperties() == null ? null : this.innerProperties().virtualMachine(); - } - - /** - * Get the networkSecurityGroup property: The reference of the NetworkSecurityGroup resource. - * - * @return the networkSecurityGroup value. - */ - public NetworkSecurityGroupInner networkSecurityGroup() { - return this.innerProperties() == null ? null : this.innerProperties().networkSecurityGroup(); - } - - /** - * Set the networkSecurityGroup property: The reference of the NetworkSecurityGroup resource. - * - * @param networkSecurityGroup the networkSecurityGroup value to set. - * @return the NetworkInterfaceInner object itself. - */ - public NetworkInterfaceInner withNetworkSecurityGroup(NetworkSecurityGroupInner networkSecurityGroup) { - if (this.innerProperties() == null) { - this.innerProperties = new NetworkInterfacePropertiesFormatInner(); - } - this.innerProperties().withNetworkSecurityGroup(networkSecurityGroup); - return this; - } - - /** - * Get the interfaceEndpoint property: A reference to the interface endpoint to which the network interface is - * linked. - * - * @return the interfaceEndpoint value. - */ - public InterfaceEndpointInner interfaceEndpoint() { - return this.innerProperties() == null ? null : this.innerProperties().interfaceEndpoint(); - } - - /** - * Get the ipConfigurations property: A list of IPConfigurations of the network interface. - * - * @return the ipConfigurations value. - */ - public List ipConfigurations() { - return this.innerProperties() == null ? null : this.innerProperties().ipConfigurations(); - } - - /** - * Set the ipConfigurations property: A list of IPConfigurations of the network interface. - * - * @param ipConfigurations the ipConfigurations value to set. - * @return the NetworkInterfaceInner object itself. - */ - public NetworkInterfaceInner withIpConfigurations(List ipConfigurations) { - if (this.innerProperties() == null) { - this.innerProperties = new NetworkInterfacePropertiesFormatInner(); - } - this.innerProperties().withIpConfigurations(ipConfigurations); - return this; - } - - /** - * Get the tapConfigurations property: A list of TapConfigurations of the network interface. - * - * @return the tapConfigurations value. - */ - public List tapConfigurations() { - return this.innerProperties() == null ? null : this.innerProperties().tapConfigurations(); - } - - /** - * Set the tapConfigurations property: A list of TapConfigurations of the network interface. - * - * @param tapConfigurations the tapConfigurations value to set. - * @return the NetworkInterfaceInner object itself. - */ - public NetworkInterfaceInner withTapConfigurations(List tapConfigurations) { - if (this.innerProperties() == null) { - this.innerProperties = new NetworkInterfacePropertiesFormatInner(); - } - this.innerProperties().withTapConfigurations(tapConfigurations); - return this; - } - - /** - * Get the dnsSettings property: The DNS settings in network interface. - * - * @return the dnsSettings value. - */ - public NetworkInterfaceDnsSettings dnsSettings() { - return this.innerProperties() == null ? null : this.innerProperties().dnsSettings(); - } - - /** - * Set the dnsSettings property: The DNS settings in network interface. - * - * @param dnsSettings the dnsSettings value to set. - * @return the NetworkInterfaceInner object itself. - */ - public NetworkInterfaceInner withDnsSettings(NetworkInterfaceDnsSettings dnsSettings) { - if (this.innerProperties() == null) { - this.innerProperties = new NetworkInterfacePropertiesFormatInner(); - } - this.innerProperties().withDnsSettings(dnsSettings); - return this; - } - - /** - * Get the macAddress property: The MAC address of the network interface. - * - * @return the macAddress value. - */ - public String macAddress() { - return this.innerProperties() == null ? null : this.innerProperties().macAddress(); - } - - /** - * Set the macAddress property: The MAC address of the network interface. - * - * @param macAddress the macAddress value to set. - * @return the NetworkInterfaceInner object itself. - */ - public NetworkInterfaceInner withMacAddress(String macAddress) { - if (this.innerProperties() == null) { - this.innerProperties = new NetworkInterfacePropertiesFormatInner(); - } - this.innerProperties().withMacAddress(macAddress); - return this; - } - - /** - * Get the primary property: Gets whether this is a primary network interface on a virtual machine. - * - * @return the primary value. - */ - public Boolean primary() { - return this.innerProperties() == null ? null : this.innerProperties().primary(); - } - - /** - * Set the primary property: Gets whether this is a primary network interface on a virtual machine. - * - * @param primary the primary value to set. - * @return the NetworkInterfaceInner object itself. - */ - public NetworkInterfaceInner withPrimary(Boolean primary) { - if (this.innerProperties() == null) { - this.innerProperties = new NetworkInterfacePropertiesFormatInner(); - } - this.innerProperties().withPrimary(primary); - return this; - } - - /** - * Get the enableAcceleratedNetworking property: If the network interface is accelerated networking enabled. - * - * @return the enableAcceleratedNetworking value. - */ - public Boolean enableAcceleratedNetworking() { - return this.innerProperties() == null ? null : this.innerProperties().enableAcceleratedNetworking(); - } - - /** - * Set the enableAcceleratedNetworking property: If the network interface is accelerated networking enabled. - * - * @param enableAcceleratedNetworking the enableAcceleratedNetworking value to set. - * @return the NetworkInterfaceInner object itself. - */ - public NetworkInterfaceInner withEnableAcceleratedNetworking(Boolean enableAcceleratedNetworking) { - if (this.innerProperties() == null) { - this.innerProperties = new NetworkInterfacePropertiesFormatInner(); - } - this.innerProperties().withEnableAcceleratedNetworking(enableAcceleratedNetworking); - return this; - } - - /** - * Get the enableIpForwarding property: Indicates whether IP forwarding is enabled on this network interface. - * - * @return the enableIpForwarding value. - */ - public Boolean enableIpForwarding() { - return this.innerProperties() == null ? null : this.innerProperties().enableIpForwarding(); - } - - /** - * Set the enableIpForwarding property: Indicates whether IP forwarding is enabled on this network interface. - * - * @param enableIpForwarding the enableIpForwarding value to set. - * @return the NetworkInterfaceInner object itself. - */ - public NetworkInterfaceInner withEnableIpForwarding(Boolean enableIpForwarding) { - if (this.innerProperties() == null) { - this.innerProperties = new NetworkInterfacePropertiesFormatInner(); - } - this.innerProperties().withEnableIpForwarding(enableIpForwarding); - return this; - } - - /** - * Get the hostedWorkloads property: A list of references to linked BareMetal resources. - * - * @return the hostedWorkloads value. - */ - public List hostedWorkloads() { - return this.innerProperties() == null ? null : this.innerProperties().hostedWorkloads(); - } - - /** - * Get the resourceGuid property: The resource GUID property of the network interface resource. - * - * @return the resourceGuid value. - */ - public String resourceGuid() { - return this.innerProperties() == null ? null : this.innerProperties().resourceGuid(); - } - - /** - * Set the resourceGuid property: The resource GUID property of the network interface resource. - * - * @param resourceGuid the resourceGuid value to set. - * @return the NetworkInterfaceInner object itself. - */ - public NetworkInterfaceInner withResourceGuid(String resourceGuid) { - if (this.innerProperties() == null) { - this.innerProperties = new NetworkInterfacePropertiesFormatInner(); - } - this.innerProperties().withResourceGuid(resourceGuid); - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Set the provisioningState property: The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param provisioningState the provisioningState value to set. - * @return the NetworkInterfaceInner object itself. - */ - public NetworkInterfaceInner withProvisioningState(String provisioningState) { - if (this.innerProperties() == null) { - this.innerProperties = new NetworkInterfacePropertiesFormatInner(); - } - this.innerProperties().withProvisioningState(provisioningState); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/NetworkInterfaceIpConfigurationInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/NetworkInterfaceIpConfigurationInner.java deleted file mode 100644 index 6af3a7b47fcd..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/NetworkInterfaceIpConfigurationInner.java +++ /dev/null @@ -1,401 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.ApplicationGatewayBackendAddressPool; -import com.azure.resourcemanager.network.models.IpAllocationMethod; -import com.azure.resourcemanager.network.models.IpVersion; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** IPConfiguration in a network interface. */ -@Fluent -public final class NetworkInterfaceIpConfigurationInner extends SubResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkInterfaceIpConfigurationInner.class); - - /* - * Network interface IP configuration properties. - */ - @JsonProperty(value = "properties") - private NetworkInterfaceIpConfigurationPropertiesFormatInner innerProperties; - - /* - * The name of the resource that is unique within a resource group. This - * name can be used to access the resource. - */ - @JsonProperty(value = "name") - private String name; - - /* - * A unique read-only string that changes whenever the resource is updated. - */ - @JsonProperty(value = "etag") - private String etag; - - /** - * Get the innerProperties property: Network interface IP configuration properties. - * - * @return the innerProperties value. - */ - private NetworkInterfaceIpConfigurationPropertiesFormatInner innerProperties() { - return this.innerProperties; - } - - /** - * Get the name property: The name of the resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @param name the name value to set. - * @return the NetworkInterfaceIpConfigurationInner object itself. - */ - public NetworkInterfaceIpConfigurationInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @param etag the etag value to set. - * @return the NetworkInterfaceIpConfigurationInner object itself. - */ - public NetworkInterfaceIpConfigurationInner withEtag(String etag) { - this.etag = etag; - return this; - } - - /** {@inheritDoc} */ - @Override - public NetworkInterfaceIpConfigurationInner withId(String id) { - super.withId(id); - return this; - } - - /** - * Get the virtualNetworkTaps property: The reference to Virtual Network Taps. - * - * @return the virtualNetworkTaps value. - */ - public List virtualNetworkTaps() { - return this.innerProperties() == null ? null : this.innerProperties().virtualNetworkTaps(); - } - - /** - * Set the virtualNetworkTaps property: The reference to Virtual Network Taps. - * - * @param virtualNetworkTaps the virtualNetworkTaps value to set. - * @return the NetworkInterfaceIpConfigurationInner object itself. - */ - public NetworkInterfaceIpConfigurationInner withVirtualNetworkTaps( - List virtualNetworkTaps) { - if (this.innerProperties() == null) { - this.innerProperties = new NetworkInterfaceIpConfigurationPropertiesFormatInner(); - } - this.innerProperties().withVirtualNetworkTaps(virtualNetworkTaps); - return this; - } - - /** - * Get the applicationGatewayBackendAddressPools property: The reference of ApplicationGatewayBackendAddressPool - * resource. - * - * @return the applicationGatewayBackendAddressPools value. - */ - public List applicationGatewayBackendAddressPools() { - return this.innerProperties() == null ? null : this.innerProperties().applicationGatewayBackendAddressPools(); - } - - /** - * Set the applicationGatewayBackendAddressPools property: The reference of ApplicationGatewayBackendAddressPool - * resource. - * - * @param applicationGatewayBackendAddressPools the applicationGatewayBackendAddressPools value to set. - * @return the NetworkInterfaceIpConfigurationInner object itself. - */ - public NetworkInterfaceIpConfigurationInner withApplicationGatewayBackendAddressPools( - List applicationGatewayBackendAddressPools) { - if (this.innerProperties() == null) { - this.innerProperties = new NetworkInterfaceIpConfigurationPropertiesFormatInner(); - } - this.innerProperties().withApplicationGatewayBackendAddressPools(applicationGatewayBackendAddressPools); - return this; - } - - /** - * Get the loadBalancerBackendAddressPools property: The reference of LoadBalancerBackendAddressPool resource. - * - * @return the loadBalancerBackendAddressPools value. - */ - public List loadBalancerBackendAddressPools() { - return this.innerProperties() == null ? null : this.innerProperties().loadBalancerBackendAddressPools(); - } - - /** - * Set the loadBalancerBackendAddressPools property: The reference of LoadBalancerBackendAddressPool resource. - * - * @param loadBalancerBackendAddressPools the loadBalancerBackendAddressPools value to set. - * @return the NetworkInterfaceIpConfigurationInner object itself. - */ - public NetworkInterfaceIpConfigurationInner withLoadBalancerBackendAddressPools( - List loadBalancerBackendAddressPools) { - if (this.innerProperties() == null) { - this.innerProperties = new NetworkInterfaceIpConfigurationPropertiesFormatInner(); - } - this.innerProperties().withLoadBalancerBackendAddressPools(loadBalancerBackendAddressPools); - return this; - } - - /** - * Get the loadBalancerInboundNatRules property: A list of references of LoadBalancerInboundNatRules. - * - * @return the loadBalancerInboundNatRules value. - */ - public List loadBalancerInboundNatRules() { - return this.innerProperties() == null ? null : this.innerProperties().loadBalancerInboundNatRules(); - } - - /** - * Set the loadBalancerInboundNatRules property: A list of references of LoadBalancerInboundNatRules. - * - * @param loadBalancerInboundNatRules the loadBalancerInboundNatRules value to set. - * @return the NetworkInterfaceIpConfigurationInner object itself. - */ - public NetworkInterfaceIpConfigurationInner withLoadBalancerInboundNatRules( - List loadBalancerInboundNatRules) { - if (this.innerProperties() == null) { - this.innerProperties = new NetworkInterfaceIpConfigurationPropertiesFormatInner(); - } - this.innerProperties().withLoadBalancerInboundNatRules(loadBalancerInboundNatRules); - return this; - } - - /** - * Get the privateIpAddress property: Private IP address of the IP configuration. - * - * @return the privateIpAddress value. - */ - public String privateIpAddress() { - return this.innerProperties() == null ? null : this.innerProperties().privateIpAddress(); - } - - /** - * Set the privateIpAddress property: Private IP address of the IP configuration. - * - * @param privateIpAddress the privateIpAddress value to set. - * @return the NetworkInterfaceIpConfigurationInner object itself. - */ - public NetworkInterfaceIpConfigurationInner withPrivateIpAddress(String privateIpAddress) { - if (this.innerProperties() == null) { - this.innerProperties = new NetworkInterfaceIpConfigurationPropertiesFormatInner(); - } - this.innerProperties().withPrivateIpAddress(privateIpAddress); - return this; - } - - /** - * Get the privateIpAllocationMethod property: Defines how a private IP address is assigned. Possible values are: - * 'Static' and 'Dynamic'. - * - * @return the privateIpAllocationMethod value. - */ - public IpAllocationMethod privateIpAllocationMethod() { - return this.innerProperties() == null ? null : this.innerProperties().privateIpAllocationMethod(); - } - - /** - * Set the privateIpAllocationMethod property: Defines how a private IP address is assigned. Possible values are: - * 'Static' and 'Dynamic'. - * - * @param privateIpAllocationMethod the privateIpAllocationMethod value to set. - * @return the NetworkInterfaceIpConfigurationInner object itself. - */ - public NetworkInterfaceIpConfigurationInner withPrivateIpAllocationMethod( - IpAllocationMethod privateIpAllocationMethod) { - if (this.innerProperties() == null) { - this.innerProperties = new NetworkInterfaceIpConfigurationPropertiesFormatInner(); - } - this.innerProperties().withPrivateIpAllocationMethod(privateIpAllocationMethod); - return this; - } - - /** - * Get the privateIpAddressVersion property: Available from Api-Version 2016-03-30 onwards, it represents whether - * the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. - * - * @return the privateIpAddressVersion value. - */ - public IpVersion privateIpAddressVersion() { - return this.innerProperties() == null ? null : this.innerProperties().privateIpAddressVersion(); - } - - /** - * Set the privateIpAddressVersion property: Available from Api-Version 2016-03-30 onwards, it represents whether - * the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. - * - * @param privateIpAddressVersion the privateIpAddressVersion value to set. - * @return the NetworkInterfaceIpConfigurationInner object itself. - */ - public NetworkInterfaceIpConfigurationInner withPrivateIpAddressVersion(IpVersion privateIpAddressVersion) { - if (this.innerProperties() == null) { - this.innerProperties = new NetworkInterfaceIpConfigurationPropertiesFormatInner(); - } - this.innerProperties().withPrivateIpAddressVersion(privateIpAddressVersion); - return this; - } - - /** - * Get the subnet property: Subnet bound to the IP configuration. - * - * @return the subnet value. - */ - public SubnetInner subnet() { - return this.innerProperties() == null ? null : this.innerProperties().subnet(); - } - - /** - * Set the subnet property: Subnet bound to the IP configuration. - * - * @param subnet the subnet value to set. - * @return the NetworkInterfaceIpConfigurationInner object itself. - */ - public NetworkInterfaceIpConfigurationInner withSubnet(SubnetInner subnet) { - if (this.innerProperties() == null) { - this.innerProperties = new NetworkInterfaceIpConfigurationPropertiesFormatInner(); - } - this.innerProperties().withSubnet(subnet); - return this; - } - - /** - * Get the primary property: Gets whether this is a primary customer address on the network interface. - * - * @return the primary value. - */ - public Boolean primary() { - return this.innerProperties() == null ? null : this.innerProperties().primary(); - } - - /** - * Set the primary property: Gets whether this is a primary customer address on the network interface. - * - * @param primary the primary value to set. - * @return the NetworkInterfaceIpConfigurationInner object itself. - */ - public NetworkInterfaceIpConfigurationInner withPrimary(Boolean primary) { - if (this.innerProperties() == null) { - this.innerProperties = new NetworkInterfaceIpConfigurationPropertiesFormatInner(); - } - this.innerProperties().withPrimary(primary); - return this; - } - - /** - * Get the publicIpAddress property: Public IP address bound to the IP configuration. - * - * @return the publicIpAddress value. - */ - public PublicIpAddressInner publicIpAddress() { - return this.innerProperties() == null ? null : this.innerProperties().publicIpAddress(); - } - - /** - * Set the publicIpAddress property: Public IP address bound to the IP configuration. - * - * @param publicIpAddress the publicIpAddress value to set. - * @return the NetworkInterfaceIpConfigurationInner object itself. - */ - public NetworkInterfaceIpConfigurationInner withPublicIpAddress(PublicIpAddressInner publicIpAddress) { - if (this.innerProperties() == null) { - this.innerProperties = new NetworkInterfaceIpConfigurationPropertiesFormatInner(); - } - this.innerProperties().withPublicIpAddress(publicIpAddress); - return this; - } - - /** - * Get the applicationSecurityGroups property: Application security groups in which the IP configuration is - * included. - * - * @return the applicationSecurityGroups value. - */ - public List applicationSecurityGroups() { - return this.innerProperties() == null ? null : this.innerProperties().applicationSecurityGroups(); - } - - /** - * Set the applicationSecurityGroups property: Application security groups in which the IP configuration is - * included. - * - * @param applicationSecurityGroups the applicationSecurityGroups value to set. - * @return the NetworkInterfaceIpConfigurationInner object itself. - */ - public NetworkInterfaceIpConfigurationInner withApplicationSecurityGroups( - List applicationSecurityGroups) { - if (this.innerProperties() == null) { - this.innerProperties = new NetworkInterfaceIpConfigurationPropertiesFormatInner(); - } - this.innerProperties().withApplicationSecurityGroups(applicationSecurityGroups); - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the network interface IP configuration. Possible - * values are: 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Set the provisioningState property: The provisioning state of the network interface IP configuration. Possible - * values are: 'Updating', 'Deleting', and 'Failed'. - * - * @param provisioningState the provisioningState value to set. - * @return the NetworkInterfaceIpConfigurationInner object itself. - */ - public NetworkInterfaceIpConfigurationInner withProvisioningState(String provisioningState) { - if (this.innerProperties() == null) { - this.innerProperties = new NetworkInterfaceIpConfigurationPropertiesFormatInner(); - } - this.innerProperties().withProvisioningState(provisioningState); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/NetworkInterfaceIpConfigurationPropertiesFormatInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/NetworkInterfaceIpConfigurationPropertiesFormatInner.java deleted file mode 100644 index e189757c002d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/NetworkInterfaceIpConfigurationPropertiesFormatInner.java +++ /dev/null @@ -1,385 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.ApplicationGatewayBackendAddressPool; -import com.azure.resourcemanager.network.models.IpAllocationMethod; -import com.azure.resourcemanager.network.models.IpVersion; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Properties of IP configuration. */ -@Fluent -public final class NetworkInterfaceIpConfigurationPropertiesFormatInner { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(NetworkInterfaceIpConfigurationPropertiesFormatInner.class); - - /* - * The reference to Virtual Network Taps. - */ - @JsonProperty(value = "virtualNetworkTaps") - private List virtualNetworkTaps; - - /* - * The reference of ApplicationGatewayBackendAddressPool resource. - */ - @JsonProperty(value = "applicationGatewayBackendAddressPools") - private List applicationGatewayBackendAddressPools; - - /* - * The reference of LoadBalancerBackendAddressPool resource. - */ - @JsonProperty(value = "loadBalancerBackendAddressPools") - private List loadBalancerBackendAddressPools; - - /* - * A list of references of LoadBalancerInboundNatRules. - */ - @JsonProperty(value = "loadBalancerInboundNatRules") - private List loadBalancerInboundNatRules; - - /* - * Private IP address of the IP configuration. - */ - @JsonProperty(value = "privateIPAddress") - private String privateIpAddress; - - /* - * Defines how a private IP address is assigned. Possible values are: - * 'Static' and 'Dynamic'. - */ - @JsonProperty(value = "privateIPAllocationMethod") - private IpAllocationMethod privateIpAllocationMethod; - - /* - * Available from Api-Version 2016-03-30 onwards, it represents whether the - * specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. - * Possible values are: 'IPv4' and 'IPv6'. - */ - @JsonProperty(value = "privateIPAddressVersion") - private IpVersion privateIpAddressVersion; - - /* - * Subnet bound to the IP configuration. - */ - @JsonProperty(value = "subnet") - private SubnetInner subnet; - - /* - * Gets whether this is a primary customer address on the network - * interface. - */ - @JsonProperty(value = "primary") - private Boolean primary; - - /* - * Public IP address bound to the IP configuration. - */ - @JsonProperty(value = "publicIPAddress") - private PublicIpAddressInner publicIpAddress; - - /* - * Application security groups in which the IP configuration is included. - */ - @JsonProperty(value = "applicationSecurityGroups") - private List applicationSecurityGroups; - - /* - * The provisioning state of the network interface IP configuration. - * Possible values are: 'Updating', 'Deleting', and 'Failed'. - */ - @JsonProperty(value = "provisioningState") - private String provisioningState; - - /** - * Get the virtualNetworkTaps property: The reference to Virtual Network Taps. - * - * @return the virtualNetworkTaps value. - */ - public List virtualNetworkTaps() { - return this.virtualNetworkTaps; - } - - /** - * Set the virtualNetworkTaps property: The reference to Virtual Network Taps. - * - * @param virtualNetworkTaps the virtualNetworkTaps value to set. - * @return the NetworkInterfaceIpConfigurationPropertiesFormatInner object itself. - */ - public NetworkInterfaceIpConfigurationPropertiesFormatInner withVirtualNetworkTaps( - List virtualNetworkTaps) { - this.virtualNetworkTaps = virtualNetworkTaps; - return this; - } - - /** - * Get the applicationGatewayBackendAddressPools property: The reference of ApplicationGatewayBackendAddressPool - * resource. - * - * @return the applicationGatewayBackendAddressPools value. - */ - public List applicationGatewayBackendAddressPools() { - return this.applicationGatewayBackendAddressPools; - } - - /** - * Set the applicationGatewayBackendAddressPools property: The reference of ApplicationGatewayBackendAddressPool - * resource. - * - * @param applicationGatewayBackendAddressPools the applicationGatewayBackendAddressPools value to set. - * @return the NetworkInterfaceIpConfigurationPropertiesFormatInner object itself. - */ - public NetworkInterfaceIpConfigurationPropertiesFormatInner withApplicationGatewayBackendAddressPools( - List applicationGatewayBackendAddressPools) { - this.applicationGatewayBackendAddressPools = applicationGatewayBackendAddressPools; - return this; - } - - /** - * Get the loadBalancerBackendAddressPools property: The reference of LoadBalancerBackendAddressPool resource. - * - * @return the loadBalancerBackendAddressPools value. - */ - public List loadBalancerBackendAddressPools() { - return this.loadBalancerBackendAddressPools; - } - - /** - * Set the loadBalancerBackendAddressPools property: The reference of LoadBalancerBackendAddressPool resource. - * - * @param loadBalancerBackendAddressPools the loadBalancerBackendAddressPools value to set. - * @return the NetworkInterfaceIpConfigurationPropertiesFormatInner object itself. - */ - public NetworkInterfaceIpConfigurationPropertiesFormatInner withLoadBalancerBackendAddressPools( - List loadBalancerBackendAddressPools) { - this.loadBalancerBackendAddressPools = loadBalancerBackendAddressPools; - return this; - } - - /** - * Get the loadBalancerInboundNatRules property: A list of references of LoadBalancerInboundNatRules. - * - * @return the loadBalancerInboundNatRules value. - */ - public List loadBalancerInboundNatRules() { - return this.loadBalancerInboundNatRules; - } - - /** - * Set the loadBalancerInboundNatRules property: A list of references of LoadBalancerInboundNatRules. - * - * @param loadBalancerInboundNatRules the loadBalancerInboundNatRules value to set. - * @return the NetworkInterfaceIpConfigurationPropertiesFormatInner object itself. - */ - public NetworkInterfaceIpConfigurationPropertiesFormatInner withLoadBalancerInboundNatRules( - List loadBalancerInboundNatRules) { - this.loadBalancerInboundNatRules = loadBalancerInboundNatRules; - return this; - } - - /** - * Get the privateIpAddress property: Private IP address of the IP configuration. - * - * @return the privateIpAddress value. - */ - public String privateIpAddress() { - return this.privateIpAddress; - } - - /** - * Set the privateIpAddress property: Private IP address of the IP configuration. - * - * @param privateIpAddress the privateIpAddress value to set. - * @return the NetworkInterfaceIpConfigurationPropertiesFormatInner object itself. - */ - public NetworkInterfaceIpConfigurationPropertiesFormatInner withPrivateIpAddress(String privateIpAddress) { - this.privateIpAddress = privateIpAddress; - return this; - } - - /** - * Get the privateIpAllocationMethod property: Defines how a private IP address is assigned. Possible values are: - * 'Static' and 'Dynamic'. - * - * @return the privateIpAllocationMethod value. - */ - public IpAllocationMethod privateIpAllocationMethod() { - return this.privateIpAllocationMethod; - } - - /** - * Set the privateIpAllocationMethod property: Defines how a private IP address is assigned. Possible values are: - * 'Static' and 'Dynamic'. - * - * @param privateIpAllocationMethod the privateIpAllocationMethod value to set. - * @return the NetworkInterfaceIpConfigurationPropertiesFormatInner object itself. - */ - public NetworkInterfaceIpConfigurationPropertiesFormatInner withPrivateIpAllocationMethod( - IpAllocationMethod privateIpAllocationMethod) { - this.privateIpAllocationMethod = privateIpAllocationMethod; - return this; - } - - /** - * Get the privateIpAddressVersion property: Available from Api-Version 2016-03-30 onwards, it represents whether - * the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. - * - * @return the privateIpAddressVersion value. - */ - public IpVersion privateIpAddressVersion() { - return this.privateIpAddressVersion; - } - - /** - * Set the privateIpAddressVersion property: Available from Api-Version 2016-03-30 onwards, it represents whether - * the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. - * - * @param privateIpAddressVersion the privateIpAddressVersion value to set. - * @return the NetworkInterfaceIpConfigurationPropertiesFormatInner object itself. - */ - public NetworkInterfaceIpConfigurationPropertiesFormatInner withPrivateIpAddressVersion( - IpVersion privateIpAddressVersion) { - this.privateIpAddressVersion = privateIpAddressVersion; - return this; - } - - /** - * Get the subnet property: Subnet bound to the IP configuration. - * - * @return the subnet value. - */ - public SubnetInner subnet() { - return this.subnet; - } - - /** - * Set the subnet property: Subnet bound to the IP configuration. - * - * @param subnet the subnet value to set. - * @return the NetworkInterfaceIpConfigurationPropertiesFormatInner object itself. - */ - public NetworkInterfaceIpConfigurationPropertiesFormatInner withSubnet(SubnetInner subnet) { - this.subnet = subnet; - return this; - } - - /** - * Get the primary property: Gets whether this is a primary customer address on the network interface. - * - * @return the primary value. - */ - public Boolean primary() { - return this.primary; - } - - /** - * Set the primary property: Gets whether this is a primary customer address on the network interface. - * - * @param primary the primary value to set. - * @return the NetworkInterfaceIpConfigurationPropertiesFormatInner object itself. - */ - public NetworkInterfaceIpConfigurationPropertiesFormatInner withPrimary(Boolean primary) { - this.primary = primary; - return this; - } - - /** - * Get the publicIpAddress property: Public IP address bound to the IP configuration. - * - * @return the publicIpAddress value. - */ - public PublicIpAddressInner publicIpAddress() { - return this.publicIpAddress; - } - - /** - * Set the publicIpAddress property: Public IP address bound to the IP configuration. - * - * @param publicIpAddress the publicIpAddress value to set. - * @return the NetworkInterfaceIpConfigurationPropertiesFormatInner object itself. - */ - public NetworkInterfaceIpConfigurationPropertiesFormatInner withPublicIpAddress( - PublicIpAddressInner publicIpAddress) { - this.publicIpAddress = publicIpAddress; - return this; - } - - /** - * Get the applicationSecurityGroups property: Application security groups in which the IP configuration is - * included. - * - * @return the applicationSecurityGroups value. - */ - public List applicationSecurityGroups() { - return this.applicationSecurityGroups; - } - - /** - * Set the applicationSecurityGroups property: Application security groups in which the IP configuration is - * included. - * - * @param applicationSecurityGroups the applicationSecurityGroups value to set. - * @return the NetworkInterfaceIpConfigurationPropertiesFormatInner object itself. - */ - public NetworkInterfaceIpConfigurationPropertiesFormatInner withApplicationSecurityGroups( - List applicationSecurityGroups) { - this.applicationSecurityGroups = applicationSecurityGroups; - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the network interface IP configuration. Possible - * values are: 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Set the provisioningState property: The provisioning state of the network interface IP configuration. Possible - * values are: 'Updating', 'Deleting', and 'Failed'. - * - * @param provisioningState the provisioningState value to set. - * @return the NetworkInterfaceIpConfigurationPropertiesFormatInner object itself. - */ - public NetworkInterfaceIpConfigurationPropertiesFormatInner withProvisioningState(String provisioningState) { - this.provisioningState = provisioningState; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (virtualNetworkTaps() != null) { - virtualNetworkTaps().forEach(e -> e.validate()); - } - if (applicationGatewayBackendAddressPools() != null) { - applicationGatewayBackendAddressPools().forEach(e -> e.validate()); - } - if (loadBalancerBackendAddressPools() != null) { - loadBalancerBackendAddressPools().forEach(e -> e.validate()); - } - if (loadBalancerInboundNatRules() != null) { - loadBalancerInboundNatRules().forEach(e -> e.validate()); - } - if (subnet() != null) { - subnet().validate(); - } - if (publicIpAddress() != null) { - publicIpAddress().validate(); - } - if (applicationSecurityGroups() != null) { - applicationSecurityGroups().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/NetworkInterfacePropertiesFormatInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/NetworkInterfacePropertiesFormatInner.java deleted file mode 100644 index 22425cddfeea..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/NetworkInterfacePropertiesFormatInner.java +++ /dev/null @@ -1,355 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.NetworkInterfaceDnsSettings; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** NetworkInterface properties. */ -@Fluent -public final class NetworkInterfacePropertiesFormatInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkInterfacePropertiesFormatInner.class); - - /* - * The reference of a virtual machine. - */ - @JsonProperty(value = "virtualMachine", access = JsonProperty.Access.WRITE_ONLY) - private SubResource virtualMachine; - - /* - * The reference of the NetworkSecurityGroup resource. - */ - @JsonProperty(value = "networkSecurityGroup") - private NetworkSecurityGroupInner networkSecurityGroup; - - /* - * A reference to the interface endpoint to which the network interface is - * linked. - */ - @JsonProperty(value = "interfaceEndpoint", access = JsonProperty.Access.WRITE_ONLY) - private InterfaceEndpointInner interfaceEndpoint; - - /* - * A list of IPConfigurations of the network interface. - */ - @JsonProperty(value = "ipConfigurations") - private List ipConfigurations; - - /* - * A list of TapConfigurations of the network interface. - */ - @JsonProperty(value = "tapConfigurations") - private List tapConfigurations; - - /* - * The DNS settings in network interface. - */ - @JsonProperty(value = "dnsSettings") - private NetworkInterfaceDnsSettings dnsSettings; - - /* - * The MAC address of the network interface. - */ - @JsonProperty(value = "macAddress") - private String macAddress; - - /* - * Gets whether this is a primary network interface on a virtual machine. - */ - @JsonProperty(value = "primary") - private Boolean primary; - - /* - * If the network interface is accelerated networking enabled. - */ - @JsonProperty(value = "enableAcceleratedNetworking") - private Boolean enableAcceleratedNetworking; - - /* - * Indicates whether IP forwarding is enabled on this network interface. - */ - @JsonProperty(value = "enableIPForwarding") - private Boolean enableIpForwarding; - - /* - * A list of references to linked BareMetal resources - */ - @JsonProperty(value = "hostedWorkloads", access = JsonProperty.Access.WRITE_ONLY) - private List hostedWorkloads; - - /* - * The resource GUID property of the network interface resource. - */ - @JsonProperty(value = "resourceGuid") - private String resourceGuid; - - /* - * The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - */ - @JsonProperty(value = "provisioningState") - private String provisioningState; - - /** - * Get the virtualMachine property: The reference of a virtual machine. - * - * @return the virtualMachine value. - */ - public SubResource virtualMachine() { - return this.virtualMachine; - } - - /** - * Get the networkSecurityGroup property: The reference of the NetworkSecurityGroup resource. - * - * @return the networkSecurityGroup value. - */ - public NetworkSecurityGroupInner networkSecurityGroup() { - return this.networkSecurityGroup; - } - - /** - * Set the networkSecurityGroup property: The reference of the NetworkSecurityGroup resource. - * - * @param networkSecurityGroup the networkSecurityGroup value to set. - * @return the NetworkInterfacePropertiesFormatInner object itself. - */ - public NetworkInterfacePropertiesFormatInner withNetworkSecurityGroup( - NetworkSecurityGroupInner networkSecurityGroup) { - this.networkSecurityGroup = networkSecurityGroup; - return this; - } - - /** - * Get the interfaceEndpoint property: A reference to the interface endpoint to which the network interface is - * linked. - * - * @return the interfaceEndpoint value. - */ - public InterfaceEndpointInner interfaceEndpoint() { - return this.interfaceEndpoint; - } - - /** - * Get the ipConfigurations property: A list of IPConfigurations of the network interface. - * - * @return the ipConfigurations value. - */ - public List ipConfigurations() { - return this.ipConfigurations; - } - - /** - * Set the ipConfigurations property: A list of IPConfigurations of the network interface. - * - * @param ipConfigurations the ipConfigurations value to set. - * @return the NetworkInterfacePropertiesFormatInner object itself. - */ - public NetworkInterfacePropertiesFormatInner withIpConfigurations( - List ipConfigurations) { - this.ipConfigurations = ipConfigurations; - return this; - } - - /** - * Get the tapConfigurations property: A list of TapConfigurations of the network interface. - * - * @return the tapConfigurations value. - */ - public List tapConfigurations() { - return this.tapConfigurations; - } - - /** - * Set the tapConfigurations property: A list of TapConfigurations of the network interface. - * - * @param tapConfigurations the tapConfigurations value to set. - * @return the NetworkInterfacePropertiesFormatInner object itself. - */ - public NetworkInterfacePropertiesFormatInner withTapConfigurations( - List tapConfigurations) { - this.tapConfigurations = tapConfigurations; - return this; - } - - /** - * Get the dnsSettings property: The DNS settings in network interface. - * - * @return the dnsSettings value. - */ - public NetworkInterfaceDnsSettings dnsSettings() { - return this.dnsSettings; - } - - /** - * Set the dnsSettings property: The DNS settings in network interface. - * - * @param dnsSettings the dnsSettings value to set. - * @return the NetworkInterfacePropertiesFormatInner object itself. - */ - public NetworkInterfacePropertiesFormatInner withDnsSettings(NetworkInterfaceDnsSettings dnsSettings) { - this.dnsSettings = dnsSettings; - return this; - } - - /** - * Get the macAddress property: The MAC address of the network interface. - * - * @return the macAddress value. - */ - public String macAddress() { - return this.macAddress; - } - - /** - * Set the macAddress property: The MAC address of the network interface. - * - * @param macAddress the macAddress value to set. - * @return the NetworkInterfacePropertiesFormatInner object itself. - */ - public NetworkInterfacePropertiesFormatInner withMacAddress(String macAddress) { - this.macAddress = macAddress; - return this; - } - - /** - * Get the primary property: Gets whether this is a primary network interface on a virtual machine. - * - * @return the primary value. - */ - public Boolean primary() { - return this.primary; - } - - /** - * Set the primary property: Gets whether this is a primary network interface on a virtual machine. - * - * @param primary the primary value to set. - * @return the NetworkInterfacePropertiesFormatInner object itself. - */ - public NetworkInterfacePropertiesFormatInner withPrimary(Boolean primary) { - this.primary = primary; - return this; - } - - /** - * Get the enableAcceleratedNetworking property: If the network interface is accelerated networking enabled. - * - * @return the enableAcceleratedNetworking value. - */ - public Boolean enableAcceleratedNetworking() { - return this.enableAcceleratedNetworking; - } - - /** - * Set the enableAcceleratedNetworking property: If the network interface is accelerated networking enabled. - * - * @param enableAcceleratedNetworking the enableAcceleratedNetworking value to set. - * @return the NetworkInterfacePropertiesFormatInner object itself. - */ - public NetworkInterfacePropertiesFormatInner withEnableAcceleratedNetworking(Boolean enableAcceleratedNetworking) { - this.enableAcceleratedNetworking = enableAcceleratedNetworking; - return this; - } - - /** - * Get the enableIpForwarding property: Indicates whether IP forwarding is enabled on this network interface. - * - * @return the enableIpForwarding value. - */ - public Boolean enableIpForwarding() { - return this.enableIpForwarding; - } - - /** - * Set the enableIpForwarding property: Indicates whether IP forwarding is enabled on this network interface. - * - * @param enableIpForwarding the enableIpForwarding value to set. - * @return the NetworkInterfacePropertiesFormatInner object itself. - */ - public NetworkInterfacePropertiesFormatInner withEnableIpForwarding(Boolean enableIpForwarding) { - this.enableIpForwarding = enableIpForwarding; - return this; - } - - /** - * Get the hostedWorkloads property: A list of references to linked BareMetal resources. - * - * @return the hostedWorkloads value. - */ - public List hostedWorkloads() { - return this.hostedWorkloads; - } - - /** - * Get the resourceGuid property: The resource GUID property of the network interface resource. - * - * @return the resourceGuid value. - */ - public String resourceGuid() { - return this.resourceGuid; - } - - /** - * Set the resourceGuid property: The resource GUID property of the network interface resource. - * - * @param resourceGuid the resourceGuid value to set. - * @return the NetworkInterfacePropertiesFormatInner object itself. - */ - public NetworkInterfacePropertiesFormatInner withResourceGuid(String resourceGuid) { - this.resourceGuid = resourceGuid; - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Set the provisioningState property: The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param provisioningState the provisioningState value to set. - * @return the NetworkInterfacePropertiesFormatInner object itself. - */ - public NetworkInterfacePropertiesFormatInner withProvisioningState(String provisioningState) { - this.provisioningState = provisioningState; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (networkSecurityGroup() != null) { - networkSecurityGroup().validate(); - } - if (interfaceEndpoint() != null) { - interfaceEndpoint().validate(); - } - if (ipConfigurations() != null) { - ipConfigurations().forEach(e -> e.validate()); - } - if (tapConfigurations() != null) { - tapConfigurations().forEach(e -> e.validate()); - } - if (dnsSettings() != null) { - dnsSettings().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/NetworkInterfaceTapConfigurationInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/NetworkInterfaceTapConfigurationInner.java deleted file mode 100644 index a19f01fff791..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/NetworkInterfaceTapConfigurationInner.java +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Tap configuration in a Network Interface. */ -@Fluent -public final class NetworkInterfaceTapConfigurationInner extends SubResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkInterfaceTapConfigurationInner.class); - - /* - * Properties of the Virtual Network Tap configuration - */ - @JsonProperty(value = "properties") - private NetworkInterfaceTapConfigurationPropertiesFormatInner innerProperties; - - /* - * The name of the resource that is unique within a resource group. This - * name can be used to access the resource. - */ - @JsonProperty(value = "name") - private String name; - - /* - * A unique read-only string that changes whenever the resource is updated. - */ - @JsonProperty(value = "etag") - private String etag; - - /* - * Sub Resource type. - */ - @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) - private String type; - - /** - * Get the innerProperties property: Properties of the Virtual Network Tap configuration. - * - * @return the innerProperties value. - */ - private NetworkInterfaceTapConfigurationPropertiesFormatInner innerProperties() { - return this.innerProperties; - } - - /** - * Get the name property: The name of the resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @param name the name value to set. - * @return the NetworkInterfaceTapConfigurationInner object itself. - */ - public NetworkInterfaceTapConfigurationInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @param etag the etag value to set. - * @return the NetworkInterfaceTapConfigurationInner object itself. - */ - public NetworkInterfaceTapConfigurationInner withEtag(String etag) { - this.etag = etag; - return this; - } - - /** - * Get the type property: Sub Resource type. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** {@inheritDoc} */ - @Override - public NetworkInterfaceTapConfigurationInner withId(String id) { - super.withId(id); - return this; - } - - /** - * Get the virtualNetworkTap property: The reference of the Virtual Network Tap resource. - * - * @return the virtualNetworkTap value. - */ - public VirtualNetworkTapInner virtualNetworkTap() { - return this.innerProperties() == null ? null : this.innerProperties().virtualNetworkTap(); - } - - /** - * Set the virtualNetworkTap property: The reference of the Virtual Network Tap resource. - * - * @param virtualNetworkTap the virtualNetworkTap value to set. - * @return the NetworkInterfaceTapConfigurationInner object itself. - */ - public NetworkInterfaceTapConfigurationInner withVirtualNetworkTap(VirtualNetworkTapInner virtualNetworkTap) { - if (this.innerProperties() == null) { - this.innerProperties = new NetworkInterfaceTapConfigurationPropertiesFormatInner(); - } - this.innerProperties().withVirtualNetworkTap(virtualNetworkTap); - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the network interface tap configuration. Possible - * values are: 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/NetworkInterfaceTapConfigurationPropertiesFormatInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/NetworkInterfaceTapConfigurationPropertiesFormatInner.java deleted file mode 100644 index 16d737bd2873..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/NetworkInterfaceTapConfigurationPropertiesFormatInner.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Properties of Virtual Network Tap configuration. */ -@Fluent -public final class NetworkInterfaceTapConfigurationPropertiesFormatInner { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(NetworkInterfaceTapConfigurationPropertiesFormatInner.class); - - /* - * The reference of the Virtual Network Tap resource. - */ - @JsonProperty(value = "virtualNetworkTap") - private VirtualNetworkTapInner virtualNetworkTap; - - /* - * The provisioning state of the network interface tap configuration. - * Possible values are: 'Updating', 'Deleting', and 'Failed'. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; - - /** - * Get the virtualNetworkTap property: The reference of the Virtual Network Tap resource. - * - * @return the virtualNetworkTap value. - */ - public VirtualNetworkTapInner virtualNetworkTap() { - return this.virtualNetworkTap; - } - - /** - * Set the virtualNetworkTap property: The reference of the Virtual Network Tap resource. - * - * @param virtualNetworkTap the virtualNetworkTap value to set. - * @return the NetworkInterfaceTapConfigurationPropertiesFormatInner object itself. - */ - public NetworkInterfaceTapConfigurationPropertiesFormatInner withVirtualNetworkTap( - VirtualNetworkTapInner virtualNetworkTap) { - this.virtualNetworkTap = virtualNetworkTap; - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the network interface tap configuration. Possible - * values are: 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (virtualNetworkTap() != null) { - virtualNetworkTap().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/NetworkProfileInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/NetworkProfileInner.java deleted file mode 100644 index 35b87db79b20..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/NetworkProfileInner.java +++ /dev/null @@ -1,181 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.ContainerNetworkInterface; -import com.azure.resourcemanager.network.models.ContainerNetworkInterfaceConfiguration; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** Network profile resource. */ -@Fluent -public final class NetworkProfileInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkProfileInner.class); - - /* - * Network profile properties. - */ - @JsonProperty(value = "properties") - private NetworkProfilePropertiesFormat innerProperties; - - /* - * A unique read-only string that changes whenever the resource is updated. - */ - @JsonProperty(value = "etag") - private String etag; - - /* - * Resource ID. - */ - @JsonProperty(value = "id") - private String id; - - /** - * Get the innerProperties property: Network profile properties. - * - * @return the innerProperties value. - */ - private NetworkProfilePropertiesFormat innerProperties() { - return this.innerProperties; - } - - /** - * Get the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @param etag the etag value to set. - * @return the NetworkProfileInner object itself. - */ - public NetworkProfileInner withEtag(String etag) { - this.etag = etag; - return this; - } - - /** - * Get the id property: Resource ID. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: Resource ID. - * - * @param id the id value to set. - * @return the NetworkProfileInner object itself. - */ - public NetworkProfileInner withId(String id) { - this.id = id; - return this; - } - - /** {@inheritDoc} */ - @Override - public NetworkProfileInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public NetworkProfileInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the containerNetworkInterfaces property: List of child container network interfaces. - * - * @return the containerNetworkInterfaces value. - */ - public List containerNetworkInterfaces() { - return this.innerProperties() == null ? null : this.innerProperties().containerNetworkInterfaces(); - } - - /** - * Set the containerNetworkInterfaces property: List of child container network interfaces. - * - * @param containerNetworkInterfaces the containerNetworkInterfaces value to set. - * @return the NetworkProfileInner object itself. - */ - public NetworkProfileInner withContainerNetworkInterfaces( - List containerNetworkInterfaces) { - if (this.innerProperties() == null) { - this.innerProperties = new NetworkProfilePropertiesFormat(); - } - this.innerProperties().withContainerNetworkInterfaces(containerNetworkInterfaces); - return this; - } - - /** - * Get the containerNetworkInterfaceConfigurations property: List of chid container network interface - * configurations. - * - * @return the containerNetworkInterfaceConfigurations value. - */ - public List containerNetworkInterfaceConfigurations() { - return this.innerProperties() == null ? null : this.innerProperties().containerNetworkInterfaceConfigurations(); - } - - /** - * Set the containerNetworkInterfaceConfigurations property: List of chid container network interface - * configurations. - * - * @param containerNetworkInterfaceConfigurations the containerNetworkInterfaceConfigurations value to set. - * @return the NetworkProfileInner object itself. - */ - public NetworkProfileInner withContainerNetworkInterfaceConfigurations( - List containerNetworkInterfaceConfigurations) { - if (this.innerProperties() == null) { - this.innerProperties = new NetworkProfilePropertiesFormat(); - } - this.innerProperties().withContainerNetworkInterfaceConfigurations(containerNetworkInterfaceConfigurations); - return this; - } - - /** - * Get the resourceGuid property: The resource GUID property of the network interface resource. - * - * @return the resourceGuid value. - */ - public String resourceGuid() { - return this.innerProperties() == null ? null : this.innerProperties().resourceGuid(); - } - - /** - * Get the provisioningState property: The provisioning state of the resource. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/NetworkProfilePropertiesFormat.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/NetworkProfilePropertiesFormat.java deleted file mode 100644 index b49f7269470f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/NetworkProfilePropertiesFormat.java +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.ContainerNetworkInterface; -import com.azure.resourcemanager.network.models.ContainerNetworkInterfaceConfiguration; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Network profile properties. */ -@Fluent -public final class NetworkProfilePropertiesFormat { - @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkProfilePropertiesFormat.class); - - /* - * List of child container network interfaces. - */ - @JsonProperty(value = "containerNetworkInterfaces") - private List containerNetworkInterfaces; - - /* - * List of chid container network interface configurations. - */ - @JsonProperty(value = "containerNetworkInterfaceConfigurations") - private List containerNetworkInterfaceConfigurations; - - /* - * The resource GUID property of the network interface resource. - */ - @JsonProperty(value = "resourceGuid", access = JsonProperty.Access.WRITE_ONLY) - private String resourceGuid; - - /* - * The provisioning state of the resource. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; - - /** - * Get the containerNetworkInterfaces property: List of child container network interfaces. - * - * @return the containerNetworkInterfaces value. - */ - public List containerNetworkInterfaces() { - return this.containerNetworkInterfaces; - } - - /** - * Set the containerNetworkInterfaces property: List of child container network interfaces. - * - * @param containerNetworkInterfaces the containerNetworkInterfaces value to set. - * @return the NetworkProfilePropertiesFormat object itself. - */ - public NetworkProfilePropertiesFormat withContainerNetworkInterfaces( - List containerNetworkInterfaces) { - this.containerNetworkInterfaces = containerNetworkInterfaces; - return this; - } - - /** - * Get the containerNetworkInterfaceConfigurations property: List of chid container network interface - * configurations. - * - * @return the containerNetworkInterfaceConfigurations value. - */ - public List containerNetworkInterfaceConfigurations() { - return this.containerNetworkInterfaceConfigurations; - } - - /** - * Set the containerNetworkInterfaceConfigurations property: List of chid container network interface - * configurations. - * - * @param containerNetworkInterfaceConfigurations the containerNetworkInterfaceConfigurations value to set. - * @return the NetworkProfilePropertiesFormat object itself. - */ - public NetworkProfilePropertiesFormat withContainerNetworkInterfaceConfigurations( - List containerNetworkInterfaceConfigurations) { - this.containerNetworkInterfaceConfigurations = containerNetworkInterfaceConfigurations; - return this; - } - - /** - * Get the resourceGuid property: The resource GUID property of the network interface resource. - * - * @return the resourceGuid value. - */ - public String resourceGuid() { - return this.resourceGuid; - } - - /** - * Get the provisioningState property: The provisioning state of the resource. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (containerNetworkInterfaces() != null) { - containerNetworkInterfaces().forEach(e -> e.validate()); - } - if (containerNetworkInterfaceConfigurations() != null) { - containerNetworkInterfaceConfigurations().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/NetworkSecurityGroupInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/NetworkSecurityGroupInner.java deleted file mode 100644 index cf9aaf1b6811..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/NetworkSecurityGroupInner.java +++ /dev/null @@ -1,223 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** NetworkSecurityGroup resource. */ -@Fluent -public final class NetworkSecurityGroupInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkSecurityGroupInner.class); - - /* - * Properties of the network security group - */ - @JsonProperty(value = "properties") - private NetworkSecurityGroupPropertiesFormat innerProperties; - - /* - * A unique read-only string that changes whenever the resource is updated. - */ - @JsonProperty(value = "etag") - private String etag; - - /* - * Resource ID. - */ - @JsonProperty(value = "id") - private String id; - - /** - * Get the innerProperties property: Properties of the network security group. - * - * @return the innerProperties value. - */ - private NetworkSecurityGroupPropertiesFormat innerProperties() { - return this.innerProperties; - } - - /** - * Get the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @param etag the etag value to set. - * @return the NetworkSecurityGroupInner object itself. - */ - public NetworkSecurityGroupInner withEtag(String etag) { - this.etag = etag; - return this; - } - - /** - * Get the id property: Resource ID. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: Resource ID. - * - * @param id the id value to set. - * @return the NetworkSecurityGroupInner object itself. - */ - public NetworkSecurityGroupInner withId(String id) { - this.id = id; - return this; - } - - /** {@inheritDoc} */ - @Override - public NetworkSecurityGroupInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public NetworkSecurityGroupInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the securityRules property: A collection of security rules of the network security group. - * - * @return the securityRules value. - */ - public List securityRules() { - return this.innerProperties() == null ? null : this.innerProperties().securityRules(); - } - - /** - * Set the securityRules property: A collection of security rules of the network security group. - * - * @param securityRules the securityRules value to set. - * @return the NetworkSecurityGroupInner object itself. - */ - public NetworkSecurityGroupInner withSecurityRules(List securityRules) { - if (this.innerProperties() == null) { - this.innerProperties = new NetworkSecurityGroupPropertiesFormat(); - } - this.innerProperties().withSecurityRules(securityRules); - return this; - } - - /** - * Get the defaultSecurityRules property: The default security rules of network security group. - * - * @return the defaultSecurityRules value. - */ - public List defaultSecurityRules() { - return this.innerProperties() == null ? null : this.innerProperties().defaultSecurityRules(); - } - - /** - * Set the defaultSecurityRules property: The default security rules of network security group. - * - * @param defaultSecurityRules the defaultSecurityRules value to set. - * @return the NetworkSecurityGroupInner object itself. - */ - public NetworkSecurityGroupInner withDefaultSecurityRules(List defaultSecurityRules) { - if (this.innerProperties() == null) { - this.innerProperties = new NetworkSecurityGroupPropertiesFormat(); - } - this.innerProperties().withDefaultSecurityRules(defaultSecurityRules); - return this; - } - - /** - * Get the networkInterfaces property: A collection of references to network interfaces. - * - * @return the networkInterfaces value. - */ - public List networkInterfaces() { - return this.innerProperties() == null ? null : this.innerProperties().networkInterfaces(); - } - - /** - * Get the subnets property: A collection of references to subnets. - * - * @return the subnets value. - */ - public List subnets() { - return this.innerProperties() == null ? null : this.innerProperties().subnets(); - } - - /** - * Get the resourceGuid property: The resource GUID property of the network security group resource. - * - * @return the resourceGuid value. - */ - public String resourceGuid() { - return this.innerProperties() == null ? null : this.innerProperties().resourceGuid(); - } - - /** - * Set the resourceGuid property: The resource GUID property of the network security group resource. - * - * @param resourceGuid the resourceGuid value to set. - * @return the NetworkSecurityGroupInner object itself. - */ - public NetworkSecurityGroupInner withResourceGuid(String resourceGuid) { - if (this.innerProperties() == null) { - this.innerProperties = new NetworkSecurityGroupPropertiesFormat(); - } - this.innerProperties().withResourceGuid(resourceGuid); - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Set the provisioningState property: The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param provisioningState the provisioningState value to set. - * @return the NetworkSecurityGroupInner object itself. - */ - public NetworkSecurityGroupInner withProvisioningState(String provisioningState) { - if (this.innerProperties() == null) { - this.innerProperties = new NetworkSecurityGroupPropertiesFormat(); - } - this.innerProperties().withProvisioningState(provisioningState); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/NetworkSecurityGroupPropertiesFormat.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/NetworkSecurityGroupPropertiesFormat.java deleted file mode 100644 index 9f95fc37cee0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/NetworkSecurityGroupPropertiesFormat.java +++ /dev/null @@ -1,174 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Network Security Group resource. */ -@Fluent -public final class NetworkSecurityGroupPropertiesFormat { - @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkSecurityGroupPropertiesFormat.class); - - /* - * A collection of security rules of the network security group. - */ - @JsonProperty(value = "securityRules") - private List securityRules; - - /* - * The default security rules of network security group. - */ - @JsonProperty(value = "defaultSecurityRules") - private List defaultSecurityRules; - - /* - * A collection of references to network interfaces. - */ - @JsonProperty(value = "networkInterfaces", access = JsonProperty.Access.WRITE_ONLY) - private List networkInterfaces; - - /* - * A collection of references to subnets. - */ - @JsonProperty(value = "subnets", access = JsonProperty.Access.WRITE_ONLY) - private List subnets; - - /* - * The resource GUID property of the network security group resource. - */ - @JsonProperty(value = "resourceGuid") - private String resourceGuid; - - /* - * The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - */ - @JsonProperty(value = "provisioningState") - private String provisioningState; - - /** - * Get the securityRules property: A collection of security rules of the network security group. - * - * @return the securityRules value. - */ - public List securityRules() { - return this.securityRules; - } - - /** - * Set the securityRules property: A collection of security rules of the network security group. - * - * @param securityRules the securityRules value to set. - * @return the NetworkSecurityGroupPropertiesFormat object itself. - */ - public NetworkSecurityGroupPropertiesFormat withSecurityRules(List securityRules) { - this.securityRules = securityRules; - return this; - } - - /** - * Get the defaultSecurityRules property: The default security rules of network security group. - * - * @return the defaultSecurityRules value. - */ - public List defaultSecurityRules() { - return this.defaultSecurityRules; - } - - /** - * Set the defaultSecurityRules property: The default security rules of network security group. - * - * @param defaultSecurityRules the defaultSecurityRules value to set. - * @return the NetworkSecurityGroupPropertiesFormat object itself. - */ - public NetworkSecurityGroupPropertiesFormat withDefaultSecurityRules(List defaultSecurityRules) { - this.defaultSecurityRules = defaultSecurityRules; - return this; - } - - /** - * Get the networkInterfaces property: A collection of references to network interfaces. - * - * @return the networkInterfaces value. - */ - public List networkInterfaces() { - return this.networkInterfaces; - } - - /** - * Get the subnets property: A collection of references to subnets. - * - * @return the subnets value. - */ - public List subnets() { - return this.subnets; - } - - /** - * Get the resourceGuid property: The resource GUID property of the network security group resource. - * - * @return the resourceGuid value. - */ - public String resourceGuid() { - return this.resourceGuid; - } - - /** - * Set the resourceGuid property: The resource GUID property of the network security group resource. - * - * @param resourceGuid the resourceGuid value to set. - * @return the NetworkSecurityGroupPropertiesFormat object itself. - */ - public NetworkSecurityGroupPropertiesFormat withResourceGuid(String resourceGuid) { - this.resourceGuid = resourceGuid; - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Set the provisioningState property: The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param provisioningState the provisioningState value to set. - * @return the NetworkSecurityGroupPropertiesFormat object itself. - */ - public NetworkSecurityGroupPropertiesFormat withProvisioningState(String provisioningState) { - this.provisioningState = provisioningState; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (securityRules() != null) { - securityRules().forEach(e -> e.validate()); - } - if (defaultSecurityRules() != null) { - defaultSecurityRules().forEach(e -> e.validate()); - } - if (networkInterfaces() != null) { - networkInterfaces().forEach(e -> e.validate()); - } - if (subnets() != null) { - subnets().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/NetworkWatcherInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/NetworkWatcherInner.java deleted file mode 100644 index 237198c72a3a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/NetworkWatcherInner.java +++ /dev/null @@ -1,120 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.ProvisioningState; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** Network watcher in a resource group. */ -@Fluent -public final class NetworkWatcherInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkWatcherInner.class); - - /* - * A unique read-only string that changes whenever the resource is updated. - */ - @JsonProperty(value = "etag") - private String etag; - - /* - * The network watcher properties. - */ - @JsonProperty(value = "properties") - private NetworkWatcherPropertiesFormat innerProperties; - - /* - * Resource ID. - */ - @JsonProperty(value = "id") - private String id; - - /** - * Get the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @param etag the etag value to set. - * @return the NetworkWatcherInner object itself. - */ - public NetworkWatcherInner withEtag(String etag) { - this.etag = etag; - return this; - } - - /** - * Get the innerProperties property: The network watcher properties. - * - * @return the innerProperties value. - */ - private NetworkWatcherPropertiesFormat innerProperties() { - return this.innerProperties; - } - - /** - * Get the id property: Resource ID. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: Resource ID. - * - * @param id the id value to set. - * @return the NetworkWatcherInner object itself. - */ - public NetworkWatcherInner withId(String id) { - this.id = id; - return this; - } - - /** {@inheritDoc} */ - @Override - public NetworkWatcherInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public NetworkWatcherInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the resource. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/NetworkWatcherPropertiesFormat.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/NetworkWatcherPropertiesFormat.java deleted file mode 100644 index 27756f7dc6b0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/NetworkWatcherPropertiesFormat.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.ProvisioningState; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The network watcher properties. */ -@Immutable -public final class NetworkWatcherPropertiesFormat { - @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkWatcherPropertiesFormat.class); - - /* - * The provisioning state of the resource. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private ProvisioningState provisioningState; - - /** - * Get the provisioningState property: The provisioning state of the resource. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/NextHopResultInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/NextHopResultInner.java deleted file mode 100644 index 76070d6c3ea7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/NextHopResultInner.java +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.NextHopType; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The information about next hop from the specified VM. */ -@Fluent -public final class NextHopResultInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(NextHopResultInner.class); - - /* - * Next hop type. - */ - @JsonProperty(value = "nextHopType") - private NextHopType nextHopType; - - /* - * Next hop IP Address - */ - @JsonProperty(value = "nextHopIpAddress") - private String nextHopIpAddress; - - /* - * The resource identifier for the route table associated with the route - * being returned. If the route being returned does not correspond to any - * user created routes then this field will be the string 'System Route'. - */ - @JsonProperty(value = "routeTableId") - private String routeTableId; - - /** - * Get the nextHopType property: Next hop type. - * - * @return the nextHopType value. - */ - public NextHopType nextHopType() { - return this.nextHopType; - } - - /** - * Set the nextHopType property: Next hop type. - * - * @param nextHopType the nextHopType value to set. - * @return the NextHopResultInner object itself. - */ - public NextHopResultInner withNextHopType(NextHopType nextHopType) { - this.nextHopType = nextHopType; - return this; - } - - /** - * Get the nextHopIpAddress property: Next hop IP Address. - * - * @return the nextHopIpAddress value. - */ - public String nextHopIpAddress() { - return this.nextHopIpAddress; - } - - /** - * Set the nextHopIpAddress property: Next hop IP Address. - * - * @param nextHopIpAddress the nextHopIpAddress value to set. - * @return the NextHopResultInner object itself. - */ - public NextHopResultInner withNextHopIpAddress(String nextHopIpAddress) { - this.nextHopIpAddress = nextHopIpAddress; - return this; - } - - /** - * Get the routeTableId property: The resource identifier for the route table associated with the route being - * returned. If the route being returned does not correspond to any user created routes then this field will be the - * string 'System Route'. - * - * @return the routeTableId value. - */ - public String routeTableId() { - return this.routeTableId; - } - - /** - * Set the routeTableId property: The resource identifier for the route table associated with the route being - * returned. If the route being returned does not correspond to any user created routes then this field will be the - * string 'System Route'. - * - * @param routeTableId the routeTableId value to set. - * @return the NextHopResultInner object itself. - */ - public NextHopResultInner withRouteTableId(String routeTableId) { - this.routeTableId = routeTableId; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/OperationInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/OperationInner.java deleted file mode 100644 index 9105cb1e074e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/OperationInner.java +++ /dev/null @@ -1,148 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.OperationDisplay; -import com.azure.resourcemanager.network.models.OperationPropertiesFormatServiceSpecification; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Network REST API operation definition. */ -@Fluent -public final class OperationInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationInner.class); - - /* - * Operation name: {provider}/{resource}/{operation} - */ - @JsonProperty(value = "name") - private String name; - - /* - * Display metadata associated with the operation. - */ - @JsonProperty(value = "display") - private OperationDisplay display; - - /* - * Origin of the operation. - */ - @JsonProperty(value = "origin") - private String origin; - - /* - * Operation properties format. - */ - @JsonProperty(value = "properties") - private OperationPropertiesFormat innerProperties; - - /** - * Get the name property: Operation name: {provider}/{resource}/{operation}. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Operation name: {provider}/{resource}/{operation}. - * - * @param name the name value to set. - * @return the OperationInner object itself. - */ - public OperationInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the display property: Display metadata associated with the operation. - * - * @return the display value. - */ - public OperationDisplay display() { - return this.display; - } - - /** - * Set the display property: Display metadata associated with the operation. - * - * @param display the display value to set. - * @return the OperationInner object itself. - */ - public OperationInner withDisplay(OperationDisplay display) { - this.display = display; - return this; - } - - /** - * Get the origin property: Origin of the operation. - * - * @return the origin value. - */ - public String origin() { - return this.origin; - } - - /** - * Set the origin property: Origin of the operation. - * - * @param origin the origin value to set. - * @return the OperationInner object itself. - */ - public OperationInner withOrigin(String origin) { - this.origin = origin; - return this; - } - - /** - * Get the innerProperties property: Operation properties format. - * - * @return the innerProperties value. - */ - private OperationPropertiesFormat innerProperties() { - return this.innerProperties; - } - - /** - * Get the serviceSpecification property: Specification of the service. - * - * @return the serviceSpecification value. - */ - public OperationPropertiesFormatServiceSpecification serviceSpecification() { - return this.innerProperties() == null ? null : this.innerProperties().serviceSpecification(); - } - - /** - * Set the serviceSpecification property: Specification of the service. - * - * @param serviceSpecification the serviceSpecification value to set. - * @return the OperationInner object itself. - */ - public OperationInner withServiceSpecification(OperationPropertiesFormatServiceSpecification serviceSpecification) { - if (this.innerProperties() == null) { - this.innerProperties = new OperationPropertiesFormat(); - } - this.innerProperties().withServiceSpecification(serviceSpecification); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (display() != null) { - display().validate(); - } - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/OperationPropertiesFormat.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/OperationPropertiesFormat.java deleted file mode 100644 index f23f30315153..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/OperationPropertiesFormat.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.OperationPropertiesFormatServiceSpecification; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Description of operation properties format. */ -@Fluent -public final class OperationPropertiesFormat { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationPropertiesFormat.class); - - /* - * Specification of the service. - */ - @JsonProperty(value = "serviceSpecification") - private OperationPropertiesFormatServiceSpecification serviceSpecification; - - /** - * Get the serviceSpecification property: Specification of the service. - * - * @return the serviceSpecification value. - */ - public OperationPropertiesFormatServiceSpecification serviceSpecification() { - return this.serviceSpecification; - } - - /** - * Set the serviceSpecification property: Specification of the service. - * - * @param serviceSpecification the serviceSpecification value to set. - * @return the OperationPropertiesFormat object itself. - */ - public OperationPropertiesFormat withServiceSpecification( - OperationPropertiesFormatServiceSpecification serviceSpecification) { - this.serviceSpecification = serviceSpecification; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (serviceSpecification() != null) { - serviceSpecification().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/OutboundRuleInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/OutboundRuleInner.java deleted file mode 100644 index 461771a66ea6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/OutboundRuleInner.java +++ /dev/null @@ -1,274 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.LoadBalancerOutboundRuleProtocol; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Outbound rule of the load balancer. */ -@Fluent -public final class OutboundRuleInner extends SubResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OutboundRuleInner.class); - - /* - * Properties of load balancer outbound rule. - */ - @JsonProperty(value = "properties") - private OutboundRulePropertiesFormat innerProperties; - - /* - * The name of the resource that is unique within a resource group. This - * name can be used to access the resource. - */ - @JsonProperty(value = "name") - private String name; - - /* - * A unique read-only string that changes whenever the resource is updated. - */ - @JsonProperty(value = "etag") - private String etag; - - /** - * Get the innerProperties property: Properties of load balancer outbound rule. - * - * @return the innerProperties value. - */ - private OutboundRulePropertiesFormat innerProperties() { - return this.innerProperties; - } - - /** - * Get the name property: The name of the resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @param name the name value to set. - * @return the OutboundRuleInner object itself. - */ - public OutboundRuleInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @param etag the etag value to set. - * @return the OutboundRuleInner object itself. - */ - public OutboundRuleInner withEtag(String etag) { - this.etag = etag; - return this; - } - - /** {@inheritDoc} */ - @Override - public OutboundRuleInner withId(String id) { - super.withId(id); - return this; - } - - /** - * Get the allocatedOutboundPorts property: The number of outbound ports to be used for NAT. - * - * @return the allocatedOutboundPorts value. - */ - public Integer allocatedOutboundPorts() { - return this.innerProperties() == null ? null : this.innerProperties().allocatedOutboundPorts(); - } - - /** - * Set the allocatedOutboundPorts property: The number of outbound ports to be used for NAT. - * - * @param allocatedOutboundPorts the allocatedOutboundPorts value to set. - * @return the OutboundRuleInner object itself. - */ - public OutboundRuleInner withAllocatedOutboundPorts(Integer allocatedOutboundPorts) { - if (this.innerProperties() == null) { - this.innerProperties = new OutboundRulePropertiesFormat(); - } - this.innerProperties().withAllocatedOutboundPorts(allocatedOutboundPorts); - return this; - } - - /** - * Get the frontendIpConfigurations property: The Frontend IP addresses of the load balancer. - * - * @return the frontendIpConfigurations value. - */ - public List frontendIpConfigurations() { - return this.innerProperties() == null ? null : this.innerProperties().frontendIpConfigurations(); - } - - /** - * Set the frontendIpConfigurations property: The Frontend IP addresses of the load balancer. - * - * @param frontendIpConfigurations the frontendIpConfigurations value to set. - * @return the OutboundRuleInner object itself. - */ - public OutboundRuleInner withFrontendIpConfigurations(List frontendIpConfigurations) { - if (this.innerProperties() == null) { - this.innerProperties = new OutboundRulePropertiesFormat(); - } - this.innerProperties().withFrontendIpConfigurations(frontendIpConfigurations); - return this; - } - - /** - * Get the backendAddressPool property: A reference to a pool of DIPs. Outbound traffic is randomly load balanced - * across IPs in the backend IPs. - * - * @return the backendAddressPool value. - */ - public SubResource backendAddressPool() { - return this.innerProperties() == null ? null : this.innerProperties().backendAddressPool(); - } - - /** - * Set the backendAddressPool property: A reference to a pool of DIPs. Outbound traffic is randomly load balanced - * across IPs in the backend IPs. - * - * @param backendAddressPool the backendAddressPool value to set. - * @return the OutboundRuleInner object itself. - */ - public OutboundRuleInner withBackendAddressPool(SubResource backendAddressPool) { - if (this.innerProperties() == null) { - this.innerProperties = new OutboundRulePropertiesFormat(); - } - this.innerProperties().withBackendAddressPool(backendAddressPool); - return this; - } - - /** - * Get the provisioningState property: Gets the provisioning state of the PublicIP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Set the provisioningState property: Gets the provisioning state of the PublicIP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param provisioningState the provisioningState value to set. - * @return the OutboundRuleInner object itself. - */ - public OutboundRuleInner withProvisioningState(String provisioningState) { - if (this.innerProperties() == null) { - this.innerProperties = new OutboundRulePropertiesFormat(); - } - this.innerProperties().withProvisioningState(provisioningState); - return this; - } - - /** - * Get the protocol property: Protocol - TCP, UDP or All. - * - * @return the protocol value. - */ - public LoadBalancerOutboundRuleProtocol protocol() { - return this.innerProperties() == null ? null : this.innerProperties().protocol(); - } - - /** - * Set the protocol property: Protocol - TCP, UDP or All. - * - * @param protocol the protocol value to set. - * @return the OutboundRuleInner object itself. - */ - public OutboundRuleInner withProtocol(LoadBalancerOutboundRuleProtocol protocol) { - if (this.innerProperties() == null) { - this.innerProperties = new OutboundRulePropertiesFormat(); - } - this.innerProperties().withProtocol(protocol); - return this; - } - - /** - * Get the enableTcpReset property: Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected - * connection termination. This element is only used when the protocol is set to TCP. - * - * @return the enableTcpReset value. - */ - public Boolean enableTcpReset() { - return this.innerProperties() == null ? null : this.innerProperties().enableTcpReset(); - } - - /** - * Set the enableTcpReset property: Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected - * connection termination. This element is only used when the protocol is set to TCP. - * - * @param enableTcpReset the enableTcpReset value to set. - * @return the OutboundRuleInner object itself. - */ - public OutboundRuleInner withEnableTcpReset(Boolean enableTcpReset) { - if (this.innerProperties() == null) { - this.innerProperties = new OutboundRulePropertiesFormat(); - } - this.innerProperties().withEnableTcpReset(enableTcpReset); - return this; - } - - /** - * Get the idleTimeoutInMinutes property: The timeout for the TCP idle connection. - * - * @return the idleTimeoutInMinutes value. - */ - public Integer idleTimeoutInMinutes() { - return this.innerProperties() == null ? null : this.innerProperties().idleTimeoutInMinutes(); - } - - /** - * Set the idleTimeoutInMinutes property: The timeout for the TCP idle connection. - * - * @param idleTimeoutInMinutes the idleTimeoutInMinutes value to set. - * @return the OutboundRuleInner object itself. - */ - public OutboundRuleInner withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes) { - if (this.innerProperties() == null) { - this.innerProperties = new OutboundRulePropertiesFormat(); - } - this.innerProperties().withIdleTimeoutInMinutes(idleTimeoutInMinutes); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/OutboundRulePropertiesFormat.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/OutboundRulePropertiesFormat.java deleted file mode 100644 index 023468212cf5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/OutboundRulePropertiesFormat.java +++ /dev/null @@ -1,237 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.LoadBalancerOutboundRuleProtocol; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Outbound rule of the load balancer. */ -@Fluent -public final class OutboundRulePropertiesFormat { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OutboundRulePropertiesFormat.class); - - /* - * The number of outbound ports to be used for NAT. - */ - @JsonProperty(value = "allocatedOutboundPorts") - private Integer allocatedOutboundPorts; - - /* - * The Frontend IP addresses of the load balancer. - */ - @JsonProperty(value = "frontendIPConfigurations", required = true) - private List frontendIpConfigurations; - - /* - * A reference to a pool of DIPs. Outbound traffic is randomly load - * balanced across IPs in the backend IPs. - */ - @JsonProperty(value = "backendAddressPool", required = true) - private SubResource backendAddressPool; - - /* - * Gets the provisioning state of the PublicIP resource. Possible values - * are: 'Updating', 'Deleting', and 'Failed'. - */ - @JsonProperty(value = "provisioningState") - private String provisioningState; - - /* - * Protocol - TCP, UDP or All - */ - @JsonProperty(value = "protocol", required = true) - private LoadBalancerOutboundRuleProtocol protocol; - - /* - * Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected - * connection termination. This element is only used when the protocol is - * set to TCP. - */ - @JsonProperty(value = "enableTcpReset") - private Boolean enableTcpReset; - - /* - * The timeout for the TCP idle connection - */ - @JsonProperty(value = "idleTimeoutInMinutes") - private Integer idleTimeoutInMinutes; - - /** - * Get the allocatedOutboundPorts property: The number of outbound ports to be used for NAT. - * - * @return the allocatedOutboundPorts value. - */ - public Integer allocatedOutboundPorts() { - return this.allocatedOutboundPorts; - } - - /** - * Set the allocatedOutboundPorts property: The number of outbound ports to be used for NAT. - * - * @param allocatedOutboundPorts the allocatedOutboundPorts value to set. - * @return the OutboundRulePropertiesFormat object itself. - */ - public OutboundRulePropertiesFormat withAllocatedOutboundPorts(Integer allocatedOutboundPorts) { - this.allocatedOutboundPorts = allocatedOutboundPorts; - return this; - } - - /** - * Get the frontendIpConfigurations property: The Frontend IP addresses of the load balancer. - * - * @return the frontendIpConfigurations value. - */ - public List frontendIpConfigurations() { - return this.frontendIpConfigurations; - } - - /** - * Set the frontendIpConfigurations property: The Frontend IP addresses of the load balancer. - * - * @param frontendIpConfigurations the frontendIpConfigurations value to set. - * @return the OutboundRulePropertiesFormat object itself. - */ - public OutboundRulePropertiesFormat withFrontendIpConfigurations(List frontendIpConfigurations) { - this.frontendIpConfigurations = frontendIpConfigurations; - return this; - } - - /** - * Get the backendAddressPool property: A reference to a pool of DIPs. Outbound traffic is randomly load balanced - * across IPs in the backend IPs. - * - * @return the backendAddressPool value. - */ - public SubResource backendAddressPool() { - return this.backendAddressPool; - } - - /** - * Set the backendAddressPool property: A reference to a pool of DIPs. Outbound traffic is randomly load balanced - * across IPs in the backend IPs. - * - * @param backendAddressPool the backendAddressPool value to set. - * @return the OutboundRulePropertiesFormat object itself. - */ - public OutboundRulePropertiesFormat withBackendAddressPool(SubResource backendAddressPool) { - this.backendAddressPool = backendAddressPool; - return this; - } - - /** - * Get the provisioningState property: Gets the provisioning state of the PublicIP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Set the provisioningState property: Gets the provisioning state of the PublicIP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param provisioningState the provisioningState value to set. - * @return the OutboundRulePropertiesFormat object itself. - */ - public OutboundRulePropertiesFormat withProvisioningState(String provisioningState) { - this.provisioningState = provisioningState; - return this; - } - - /** - * Get the protocol property: Protocol - TCP, UDP or All. - * - * @return the protocol value. - */ - public LoadBalancerOutboundRuleProtocol protocol() { - return this.protocol; - } - - /** - * Set the protocol property: Protocol - TCP, UDP or All. - * - * @param protocol the protocol value to set. - * @return the OutboundRulePropertiesFormat object itself. - */ - public OutboundRulePropertiesFormat withProtocol(LoadBalancerOutboundRuleProtocol protocol) { - this.protocol = protocol; - return this; - } - - /** - * Get the enableTcpReset property: Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected - * connection termination. This element is only used when the protocol is set to TCP. - * - * @return the enableTcpReset value. - */ - public Boolean enableTcpReset() { - return this.enableTcpReset; - } - - /** - * Set the enableTcpReset property: Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected - * connection termination. This element is only used when the protocol is set to TCP. - * - * @param enableTcpReset the enableTcpReset value to set. - * @return the OutboundRulePropertiesFormat object itself. - */ - public OutboundRulePropertiesFormat withEnableTcpReset(Boolean enableTcpReset) { - this.enableTcpReset = enableTcpReset; - return this; - } - - /** - * Get the idleTimeoutInMinutes property: The timeout for the TCP idle connection. - * - * @return the idleTimeoutInMinutes value. - */ - public Integer idleTimeoutInMinutes() { - return this.idleTimeoutInMinutes; - } - - /** - * Set the idleTimeoutInMinutes property: The timeout for the TCP idle connection. - * - * @param idleTimeoutInMinutes the idleTimeoutInMinutes value to set. - * @return the OutboundRulePropertiesFormat object itself. - */ - public OutboundRulePropertiesFormat withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes) { - this.idleTimeoutInMinutes = idleTimeoutInMinutes; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (frontendIpConfigurations() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property frontendIpConfigurations in model OutboundRulePropertiesFormat")); - } - if (backendAddressPool() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property backendAddressPool in model OutboundRulePropertiesFormat")); - } - if (protocol() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property protocol in model OutboundRulePropertiesFormat")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/P2SVpnGatewayInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/P2SVpnGatewayInner.java deleted file mode 100644 index 5ac67f5dabd6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/P2SVpnGatewayInner.java +++ /dev/null @@ -1,232 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.AddressSpace; -import com.azure.resourcemanager.network.models.ProvisioningState; -import com.azure.resourcemanager.network.models.VpnClientConnectionHealth; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** P2SVpnGateway Resource. */ -@Fluent -public final class P2SVpnGatewayInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(P2SVpnGatewayInner.class); - - /* - * Parameters for P2SVpnGateway - */ - @JsonProperty(value = "properties") - private P2SVpnGatewayProperties innerProperties; - - /* - * Gets a unique read-only string that changes whenever the resource is - * updated. - */ - @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) - private String etag; - - /* - * Resource ID. - */ - @JsonProperty(value = "id") - private String id; - - /** - * Get the innerProperties property: Parameters for P2SVpnGateway. - * - * @return the innerProperties value. - */ - private P2SVpnGatewayProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the etag property: Gets a unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Get the id property: Resource ID. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: Resource ID. - * - * @param id the id value to set. - * @return the P2SVpnGatewayInner object itself. - */ - public P2SVpnGatewayInner withId(String id) { - this.id = id; - return this; - } - - /** {@inheritDoc} */ - @Override - public P2SVpnGatewayInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public P2SVpnGatewayInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the virtualHub property: The VirtualHub to which the gateway belongs. - * - * @return the virtualHub value. - */ - public SubResource virtualHub() { - return this.innerProperties() == null ? null : this.innerProperties().virtualHub(); - } - - /** - * Set the virtualHub property: The VirtualHub to which the gateway belongs. - * - * @param virtualHub the virtualHub value to set. - * @return the P2SVpnGatewayInner object itself. - */ - public P2SVpnGatewayInner withVirtualHub(SubResource virtualHub) { - if (this.innerProperties() == null) { - this.innerProperties = new P2SVpnGatewayProperties(); - } - this.innerProperties().withVirtualHub(virtualHub); - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the resource. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Set the provisioningState property: The provisioning state of the resource. - * - * @param provisioningState the provisioningState value to set. - * @return the P2SVpnGatewayInner object itself. - */ - public P2SVpnGatewayInner withProvisioningState(ProvisioningState provisioningState) { - if (this.innerProperties() == null) { - this.innerProperties = new P2SVpnGatewayProperties(); - } - this.innerProperties().withProvisioningState(provisioningState); - return this; - } - - /** - * Get the vpnGatewayScaleUnit property: The scale unit for this p2s vpn gateway. - * - * @return the vpnGatewayScaleUnit value. - */ - public Integer vpnGatewayScaleUnit() { - return this.innerProperties() == null ? null : this.innerProperties().vpnGatewayScaleUnit(); - } - - /** - * Set the vpnGatewayScaleUnit property: The scale unit for this p2s vpn gateway. - * - * @param vpnGatewayScaleUnit the vpnGatewayScaleUnit value to set. - * @return the P2SVpnGatewayInner object itself. - */ - public P2SVpnGatewayInner withVpnGatewayScaleUnit(Integer vpnGatewayScaleUnit) { - if (this.innerProperties() == null) { - this.innerProperties = new P2SVpnGatewayProperties(); - } - this.innerProperties().withVpnGatewayScaleUnit(vpnGatewayScaleUnit); - return this; - } - - /** - * Get the p2SVpnServerConfiguration property: The P2SVpnServerConfiguration to which the p2sVpnGateway is attached - * to. - * - * @return the p2SVpnServerConfiguration value. - */ - public SubResource p2SVpnServerConfiguration() { - return this.innerProperties() == null ? null : this.innerProperties().p2SVpnServerConfiguration(); - } - - /** - * Set the p2SVpnServerConfiguration property: The P2SVpnServerConfiguration to which the p2sVpnGateway is attached - * to. - * - * @param p2SVpnServerConfiguration the p2SVpnServerConfiguration value to set. - * @return the P2SVpnGatewayInner object itself. - */ - public P2SVpnGatewayInner withP2SVpnServerConfiguration(SubResource p2SVpnServerConfiguration) { - if (this.innerProperties() == null) { - this.innerProperties = new P2SVpnGatewayProperties(); - } - this.innerProperties().withP2SVpnServerConfiguration(p2SVpnServerConfiguration); - return this; - } - - /** - * Get the vpnClientAddressPool property: The reference of the address space resource which represents Address space - * for P2S VpnClient. - * - * @return the vpnClientAddressPool value. - */ - public AddressSpace vpnClientAddressPool() { - return this.innerProperties() == null ? null : this.innerProperties().vpnClientAddressPool(); - } - - /** - * Set the vpnClientAddressPool property: The reference of the address space resource which represents Address space - * for P2S VpnClient. - * - * @param vpnClientAddressPool the vpnClientAddressPool value to set. - * @return the P2SVpnGatewayInner object itself. - */ - public P2SVpnGatewayInner withVpnClientAddressPool(AddressSpace vpnClientAddressPool) { - if (this.innerProperties() == null) { - this.innerProperties = new P2SVpnGatewayProperties(); - } - this.innerProperties().withVpnClientAddressPool(vpnClientAddressPool); - return this; - } - - /** - * Get the vpnClientConnectionHealth property: All P2S VPN clients' connection health status. - * - * @return the vpnClientConnectionHealth value. - */ - public VpnClientConnectionHealth vpnClientConnectionHealth() { - return this.innerProperties() == null ? null : this.innerProperties().vpnClientConnectionHealth(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/P2SVpnGatewayProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/P2SVpnGatewayProperties.java deleted file mode 100644 index a0eafb8cbc92..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/P2SVpnGatewayProperties.java +++ /dev/null @@ -1,184 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.AddressSpace; -import com.azure.resourcemanager.network.models.ProvisioningState; -import com.azure.resourcemanager.network.models.VpnClientConnectionHealth; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Parameters for P2SVpnGateway. */ -@Fluent -public final class P2SVpnGatewayProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(P2SVpnGatewayProperties.class); - - /* - * The VirtualHub to which the gateway belongs - */ - @JsonProperty(value = "virtualHub") - private SubResource virtualHub; - - /* - * The provisioning state of the resource. - */ - @JsonProperty(value = "provisioningState") - private ProvisioningState provisioningState; - - /* - * The scale unit for this p2s vpn gateway. - */ - @JsonProperty(value = "vpnGatewayScaleUnit") - private Integer vpnGatewayScaleUnit; - - /* - * The P2SVpnServerConfiguration to which the p2sVpnGateway is attached to. - */ - @JsonProperty(value = "p2SVpnServerConfiguration") - private SubResource p2SVpnServerConfiguration; - - /* - * The reference of the address space resource which represents Address - * space for P2S VpnClient. - */ - @JsonProperty(value = "vpnClientAddressPool") - private AddressSpace vpnClientAddressPool; - - /* - * All P2S VPN clients' connection health status. - */ - @JsonProperty(value = "vpnClientConnectionHealth", access = JsonProperty.Access.WRITE_ONLY) - private VpnClientConnectionHealth vpnClientConnectionHealth; - - /** - * Get the virtualHub property: The VirtualHub to which the gateway belongs. - * - * @return the virtualHub value. - */ - public SubResource virtualHub() { - return this.virtualHub; - } - - /** - * Set the virtualHub property: The VirtualHub to which the gateway belongs. - * - * @param virtualHub the virtualHub value to set. - * @return the P2SVpnGatewayProperties object itself. - */ - public P2SVpnGatewayProperties withVirtualHub(SubResource virtualHub) { - this.virtualHub = virtualHub; - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the resource. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Set the provisioningState property: The provisioning state of the resource. - * - * @param provisioningState the provisioningState value to set. - * @return the P2SVpnGatewayProperties object itself. - */ - public P2SVpnGatewayProperties withProvisioningState(ProvisioningState provisioningState) { - this.provisioningState = provisioningState; - return this; - } - - /** - * Get the vpnGatewayScaleUnit property: The scale unit for this p2s vpn gateway. - * - * @return the vpnGatewayScaleUnit value. - */ - public Integer vpnGatewayScaleUnit() { - return this.vpnGatewayScaleUnit; - } - - /** - * Set the vpnGatewayScaleUnit property: The scale unit for this p2s vpn gateway. - * - * @param vpnGatewayScaleUnit the vpnGatewayScaleUnit value to set. - * @return the P2SVpnGatewayProperties object itself. - */ - public P2SVpnGatewayProperties withVpnGatewayScaleUnit(Integer vpnGatewayScaleUnit) { - this.vpnGatewayScaleUnit = vpnGatewayScaleUnit; - return this; - } - - /** - * Get the p2SVpnServerConfiguration property: The P2SVpnServerConfiguration to which the p2sVpnGateway is attached - * to. - * - * @return the p2SVpnServerConfiguration value. - */ - public SubResource p2SVpnServerConfiguration() { - return this.p2SVpnServerConfiguration; - } - - /** - * Set the p2SVpnServerConfiguration property: The P2SVpnServerConfiguration to which the p2sVpnGateway is attached - * to. - * - * @param p2SVpnServerConfiguration the p2SVpnServerConfiguration value to set. - * @return the P2SVpnGatewayProperties object itself. - */ - public P2SVpnGatewayProperties withP2SVpnServerConfiguration(SubResource p2SVpnServerConfiguration) { - this.p2SVpnServerConfiguration = p2SVpnServerConfiguration; - return this; - } - - /** - * Get the vpnClientAddressPool property: The reference of the address space resource which represents Address space - * for P2S VpnClient. - * - * @return the vpnClientAddressPool value. - */ - public AddressSpace vpnClientAddressPool() { - return this.vpnClientAddressPool; - } - - /** - * Set the vpnClientAddressPool property: The reference of the address space resource which represents Address space - * for P2S VpnClient. - * - * @param vpnClientAddressPool the vpnClientAddressPool value to set. - * @return the P2SVpnGatewayProperties object itself. - */ - public P2SVpnGatewayProperties withVpnClientAddressPool(AddressSpace vpnClientAddressPool) { - this.vpnClientAddressPool = vpnClientAddressPool; - return this; - } - - /** - * Get the vpnClientConnectionHealth property: All P2S VPN clients' connection health status. - * - * @return the vpnClientConnectionHealth value. - */ - public VpnClientConnectionHealth vpnClientConnectionHealth() { - return this.vpnClientConnectionHealth; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (vpnClientAddressPool() != null) { - vpnClientAddressPool().validate(); - } - if (vpnClientConnectionHealth() != null) { - vpnClientConnectionHealth().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/P2SVpnServerConfigRadiusClientRootCertificatePropertiesFormat.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/P2SVpnServerConfigRadiusClientRootCertificatePropertiesFormat.java deleted file mode 100644 index 620109642ba3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/P2SVpnServerConfigRadiusClientRootCertificatePropertiesFormat.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Properties of the Radius client root certificate of P2SVpnServerConfiguration. */ -@Fluent -public final class P2SVpnServerConfigRadiusClientRootCertificatePropertiesFormat { - @JsonIgnore - private final ClientLogger logger = - new ClientLogger(P2SVpnServerConfigRadiusClientRootCertificatePropertiesFormat.class); - - /* - * The Radius client root certificate thumbprint. - */ - @JsonProperty(value = "thumbprint") - private String thumbprint; - - /* - * The provisioning state of the Radius client root certificate resource. - * Possible values are: 'Updating', 'Deleting', and 'Failed'. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; - - /** - * Get the thumbprint property: The Radius client root certificate thumbprint. - * - * @return the thumbprint value. - */ - public String thumbprint() { - return this.thumbprint; - } - - /** - * Set the thumbprint property: The Radius client root certificate thumbprint. - * - * @param thumbprint the thumbprint value to set. - * @return the P2SVpnServerConfigRadiusClientRootCertificatePropertiesFormat object itself. - */ - public P2SVpnServerConfigRadiusClientRootCertificatePropertiesFormat withThumbprint(String thumbprint) { - this.thumbprint = thumbprint; - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the Radius client root certificate resource. - * Possible values are: 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/P2SVpnServerConfigRadiusServerRootCertificatePropertiesFormat.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/P2SVpnServerConfigRadiusServerRootCertificatePropertiesFormat.java deleted file mode 100644 index d27876a56b3b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/P2SVpnServerConfigRadiusServerRootCertificatePropertiesFormat.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Properties of Radius Server root certificate of P2SVpnServerConfiguration. */ -@Fluent -public final class P2SVpnServerConfigRadiusServerRootCertificatePropertiesFormat { - @JsonIgnore - private final ClientLogger logger = - new ClientLogger(P2SVpnServerConfigRadiusServerRootCertificatePropertiesFormat.class); - - /* - * The certificate public data. - */ - @JsonProperty(value = "publicCertData", required = true) - private String publicCertData; - - /* - * The provisioning state of the P2SVpnServerConfiguration Radius Server - * root certificate resource. Possible values are: 'Updating', 'Deleting', - * and 'Failed'. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; - - /** - * Get the publicCertData property: The certificate public data. - * - * @return the publicCertData value. - */ - public String publicCertData() { - return this.publicCertData; - } - - /** - * Set the publicCertData property: The certificate public data. - * - * @param publicCertData the publicCertData value to set. - * @return the P2SVpnServerConfigRadiusServerRootCertificatePropertiesFormat object itself. - */ - public P2SVpnServerConfigRadiusServerRootCertificatePropertiesFormat withPublicCertData(String publicCertData) { - this.publicCertData = publicCertData; - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the P2SVpnServerConfiguration Radius Server root - * certificate resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (publicCertData() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property publicCertData in model" - + " P2SVpnServerConfigRadiusServerRootCertificatePropertiesFormat")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/P2SVpnServerConfigVpnClientRevokedCertificatePropertiesFormat.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/P2SVpnServerConfigVpnClientRevokedCertificatePropertiesFormat.java deleted file mode 100644 index 6d74fd8fb36b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/P2SVpnServerConfigVpnClientRevokedCertificatePropertiesFormat.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Properties of the revoked VPN client certificate of P2SVpnServerConfiguration. */ -@Fluent -public final class P2SVpnServerConfigVpnClientRevokedCertificatePropertiesFormat { - @JsonIgnore - private final ClientLogger logger = - new ClientLogger(P2SVpnServerConfigVpnClientRevokedCertificatePropertiesFormat.class); - - /* - * The revoked VPN client certificate thumbprint. - */ - @JsonProperty(value = "thumbprint") - private String thumbprint; - - /* - * The provisioning state of the VPN client revoked certificate resource. - * Possible values are: 'Updating', 'Deleting', and 'Failed'. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; - - /** - * Get the thumbprint property: The revoked VPN client certificate thumbprint. - * - * @return the thumbprint value. - */ - public String thumbprint() { - return this.thumbprint; - } - - /** - * Set the thumbprint property: The revoked VPN client certificate thumbprint. - * - * @param thumbprint the thumbprint value to set. - * @return the P2SVpnServerConfigVpnClientRevokedCertificatePropertiesFormat object itself. - */ - public P2SVpnServerConfigVpnClientRevokedCertificatePropertiesFormat withThumbprint(String thumbprint) { - this.thumbprint = thumbprint; - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the VPN client revoked certificate resource. - * Possible values are: 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/P2SVpnServerConfigVpnClientRootCertificatePropertiesFormat.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/P2SVpnServerConfigVpnClientRootCertificatePropertiesFormat.java deleted file mode 100644 index 2548b48b1666..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/P2SVpnServerConfigVpnClientRootCertificatePropertiesFormat.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Properties of VPN client root certificate of P2SVpnServerConfiguration. */ -@Fluent -public final class P2SVpnServerConfigVpnClientRootCertificatePropertiesFormat { - @JsonIgnore - private final ClientLogger logger = - new ClientLogger(P2SVpnServerConfigVpnClientRootCertificatePropertiesFormat.class); - - /* - * The certificate public data. - */ - @JsonProperty(value = "publicCertData", required = true) - private String publicCertData; - - /* - * The provisioning state of the P2SVpnServerConfiguration VPN client root - * certificate resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; - - /** - * Get the publicCertData property: The certificate public data. - * - * @return the publicCertData value. - */ - public String publicCertData() { - return this.publicCertData; - } - - /** - * Set the publicCertData property: The certificate public data. - * - * @param publicCertData the publicCertData value to set. - * @return the P2SVpnServerConfigVpnClientRootCertificatePropertiesFormat object itself. - */ - public P2SVpnServerConfigVpnClientRootCertificatePropertiesFormat withPublicCertData(String publicCertData) { - this.publicCertData = publicCertData; - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the P2SVpnServerConfiguration VPN client root - * certificate resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (publicCertData() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property publicCertData in model" - + " P2SVpnServerConfigVpnClientRootCertificatePropertiesFormat")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/P2SVpnServerConfigurationInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/P2SVpnServerConfigurationInner.java deleted file mode 100644 index ee90cae6ceca..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/P2SVpnServerConfigurationInner.java +++ /dev/null @@ -1,388 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.IpsecPolicy; -import com.azure.resourcemanager.network.models.P2SVpnServerConfigRadiusClientRootCertificate; -import com.azure.resourcemanager.network.models.P2SVpnServerConfigRadiusServerRootCertificate; -import com.azure.resourcemanager.network.models.P2SVpnServerConfigVpnClientRevokedCertificate; -import com.azure.resourcemanager.network.models.P2SVpnServerConfigVpnClientRootCertificate; -import com.azure.resourcemanager.network.models.VpnGatewayTunnelingProtocol; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** P2SVpnServerConfiguration Resource. */ -@Fluent -public final class P2SVpnServerConfigurationInner extends SubResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(P2SVpnServerConfigurationInner.class); - - /* - * Parameters for P2SVpnServerConfiguration - */ - @JsonProperty(value = "properties") - private P2SVpnServerConfigurationProperties innerProperties; - - /* - * The name of the resource that is unique within a resource group. This - * name can be used to access the resource. - */ - @JsonProperty(value = "name") - private String name; - - /* - * Gets a unique read-only string that changes whenever the resource is - * updated. - */ - @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) - private String etag; - - /** - * Get the innerProperties property: Parameters for P2SVpnServerConfiguration. - * - * @return the innerProperties value. - */ - private P2SVpnServerConfigurationProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the name property: The name of the resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @param name the name value to set. - * @return the P2SVpnServerConfigurationInner object itself. - */ - public P2SVpnServerConfigurationInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the etag property: Gets a unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** {@inheritDoc} */ - @Override - public P2SVpnServerConfigurationInner withId(String id) { - super.withId(id); - return this; - } - - /** - * Get the name property: The name of the P2SVpnServerConfiguration that is unique within a VirtualWan in a resource - * group. This name can be used to access the resource along with Paren VirtualWan resource name. - * - * @return the name value. - */ - public String namePropertiesName() { - return this.innerProperties() == null ? null : this.innerProperties().name(); - } - - /** - * Set the name property: The name of the P2SVpnServerConfiguration that is unique within a VirtualWan in a resource - * group. This name can be used to access the resource along with Paren VirtualWan resource name. - * - * @param name the name value to set. - * @return the P2SVpnServerConfigurationInner object itself. - */ - public P2SVpnServerConfigurationInner withNamePropertiesName(String name) { - if (this.innerProperties() == null) { - this.innerProperties = new P2SVpnServerConfigurationProperties(); - } - this.innerProperties().withName(name); - return this; - } - - /** - * Get the vpnProtocols property: vpnProtocols for the P2SVpnServerConfiguration. - * - * @return the vpnProtocols value. - */ - public List vpnProtocols() { - return this.innerProperties() == null ? null : this.innerProperties().vpnProtocols(); - } - - /** - * Set the vpnProtocols property: vpnProtocols for the P2SVpnServerConfiguration. - * - * @param vpnProtocols the vpnProtocols value to set. - * @return the P2SVpnServerConfigurationInner object itself. - */ - public P2SVpnServerConfigurationInner withVpnProtocols(List vpnProtocols) { - if (this.innerProperties() == null) { - this.innerProperties = new P2SVpnServerConfigurationProperties(); - } - this.innerProperties().withVpnProtocols(vpnProtocols); - return this; - } - - /** - * Get the p2SVpnServerConfigVpnClientRootCertificates property: VPN client root certificate of - * P2SVpnServerConfiguration. - * - * @return the p2SVpnServerConfigVpnClientRootCertificates value. - */ - public List p2SVpnServerConfigVpnClientRootCertificates() { - return this.innerProperties() == null - ? null - : this.innerProperties().p2SVpnServerConfigVpnClientRootCertificates(); - } - - /** - * Set the p2SVpnServerConfigVpnClientRootCertificates property: VPN client root certificate of - * P2SVpnServerConfiguration. - * - * @param p2SVpnServerConfigVpnClientRootCertificates the p2SVpnServerConfigVpnClientRootCertificates value to set. - * @return the P2SVpnServerConfigurationInner object itself. - */ - public P2SVpnServerConfigurationInner withP2SVpnServerConfigVpnClientRootCertificates( - List p2SVpnServerConfigVpnClientRootCertificates) { - if (this.innerProperties() == null) { - this.innerProperties = new P2SVpnServerConfigurationProperties(); - } - this - .innerProperties() - .withP2SVpnServerConfigVpnClientRootCertificates(p2SVpnServerConfigVpnClientRootCertificates); - return this; - } - - /** - * Get the p2SVpnServerConfigVpnClientRevokedCertificates property: VPN client revoked certificate of - * P2SVpnServerConfiguration. - * - * @return the p2SVpnServerConfigVpnClientRevokedCertificates value. - */ - public List p2SVpnServerConfigVpnClientRevokedCertificates() { - return this.innerProperties() == null - ? null - : this.innerProperties().p2SVpnServerConfigVpnClientRevokedCertificates(); - } - - /** - * Set the p2SVpnServerConfigVpnClientRevokedCertificates property: VPN client revoked certificate of - * P2SVpnServerConfiguration. - * - * @param p2SVpnServerConfigVpnClientRevokedCertificates the p2SVpnServerConfigVpnClientRevokedCertificates value to - * set. - * @return the P2SVpnServerConfigurationInner object itself. - */ - public P2SVpnServerConfigurationInner withP2SVpnServerConfigVpnClientRevokedCertificates( - List p2SVpnServerConfigVpnClientRevokedCertificates) { - if (this.innerProperties() == null) { - this.innerProperties = new P2SVpnServerConfigurationProperties(); - } - this - .innerProperties() - .withP2SVpnServerConfigVpnClientRevokedCertificates(p2SVpnServerConfigVpnClientRevokedCertificates); - return this; - } - - /** - * Get the p2SVpnServerConfigRadiusServerRootCertificates property: Radius Server root certificate of - * P2SVpnServerConfiguration. - * - * @return the p2SVpnServerConfigRadiusServerRootCertificates value. - */ - public List p2SVpnServerConfigRadiusServerRootCertificates() { - return this.innerProperties() == null - ? null - : this.innerProperties().p2SVpnServerConfigRadiusServerRootCertificates(); - } - - /** - * Set the p2SVpnServerConfigRadiusServerRootCertificates property: Radius Server root certificate of - * P2SVpnServerConfiguration. - * - * @param p2SVpnServerConfigRadiusServerRootCertificates the p2SVpnServerConfigRadiusServerRootCertificates value to - * set. - * @return the P2SVpnServerConfigurationInner object itself. - */ - public P2SVpnServerConfigurationInner withP2SVpnServerConfigRadiusServerRootCertificates( - List p2SVpnServerConfigRadiusServerRootCertificates) { - if (this.innerProperties() == null) { - this.innerProperties = new P2SVpnServerConfigurationProperties(); - } - this - .innerProperties() - .withP2SVpnServerConfigRadiusServerRootCertificates(p2SVpnServerConfigRadiusServerRootCertificates); - return this; - } - - /** - * Get the p2SVpnServerConfigRadiusClientRootCertificates property: Radius client root certificate of - * P2SVpnServerConfiguration. - * - * @return the p2SVpnServerConfigRadiusClientRootCertificates value. - */ - public List p2SVpnServerConfigRadiusClientRootCertificates() { - return this.innerProperties() == null - ? null - : this.innerProperties().p2SVpnServerConfigRadiusClientRootCertificates(); - } - - /** - * Set the p2SVpnServerConfigRadiusClientRootCertificates property: Radius client root certificate of - * P2SVpnServerConfiguration. - * - * @param p2SVpnServerConfigRadiusClientRootCertificates the p2SVpnServerConfigRadiusClientRootCertificates value to - * set. - * @return the P2SVpnServerConfigurationInner object itself. - */ - public P2SVpnServerConfigurationInner withP2SVpnServerConfigRadiusClientRootCertificates( - List p2SVpnServerConfigRadiusClientRootCertificates) { - if (this.innerProperties() == null) { - this.innerProperties = new P2SVpnServerConfigurationProperties(); - } - this - .innerProperties() - .withP2SVpnServerConfigRadiusClientRootCertificates(p2SVpnServerConfigRadiusClientRootCertificates); - return this; - } - - /** - * Get the vpnClientIpsecPolicies property: VpnClientIpsecPolicies for P2SVpnServerConfiguration. - * - * @return the vpnClientIpsecPolicies value. - */ - public List vpnClientIpsecPolicies() { - return this.innerProperties() == null ? null : this.innerProperties().vpnClientIpsecPolicies(); - } - - /** - * Set the vpnClientIpsecPolicies property: VpnClientIpsecPolicies for P2SVpnServerConfiguration. - * - * @param vpnClientIpsecPolicies the vpnClientIpsecPolicies value to set. - * @return the P2SVpnServerConfigurationInner object itself. - */ - public P2SVpnServerConfigurationInner withVpnClientIpsecPolicies(List vpnClientIpsecPolicies) { - if (this.innerProperties() == null) { - this.innerProperties = new P2SVpnServerConfigurationProperties(); - } - this.innerProperties().withVpnClientIpsecPolicies(vpnClientIpsecPolicies); - return this; - } - - /** - * Get the radiusServerAddress property: The radius server address property of the P2SVpnServerConfiguration - * resource for point to site client connection. - * - * @return the radiusServerAddress value. - */ - public String radiusServerAddress() { - return this.innerProperties() == null ? null : this.innerProperties().radiusServerAddress(); - } - - /** - * Set the radiusServerAddress property: The radius server address property of the P2SVpnServerConfiguration - * resource for point to site client connection. - * - * @param radiusServerAddress the radiusServerAddress value to set. - * @return the P2SVpnServerConfigurationInner object itself. - */ - public P2SVpnServerConfigurationInner withRadiusServerAddress(String radiusServerAddress) { - if (this.innerProperties() == null) { - this.innerProperties = new P2SVpnServerConfigurationProperties(); - } - this.innerProperties().withRadiusServerAddress(radiusServerAddress); - return this; - } - - /** - * Get the radiusServerSecret property: The radius secret property of the P2SVpnServerConfiguration resource for - * point to site client connection. - * - * @return the radiusServerSecret value. - */ - public String radiusServerSecret() { - return this.innerProperties() == null ? null : this.innerProperties().radiusServerSecret(); - } - - /** - * Set the radiusServerSecret property: The radius secret property of the P2SVpnServerConfiguration resource for - * point to site client connection. - * - * @param radiusServerSecret the radiusServerSecret value to set. - * @return the P2SVpnServerConfigurationInner object itself. - */ - public P2SVpnServerConfigurationInner withRadiusServerSecret(String radiusServerSecret) { - if (this.innerProperties() == null) { - this.innerProperties = new P2SVpnServerConfigurationProperties(); - } - this.innerProperties().withRadiusServerSecret(radiusServerSecret); - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the P2SVpnServerConfiguration resource. Possible - * values are: 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the p2SVpnGateways property: The p2SVpnGateways property. - * - * @return the p2SVpnGateways value. - */ - public List p2SVpnGateways() { - return this.innerProperties() == null ? null : this.innerProperties().p2SVpnGateways(); - } - - /** - * Get the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etagPropertiesEtag() { - return this.innerProperties() == null ? null : this.innerProperties().etag(); - } - - /** - * Set the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @param etag the etag value to set. - * @return the P2SVpnServerConfigurationInner object itself. - */ - public P2SVpnServerConfigurationInner withEtagPropertiesEtag(String etag) { - if (this.innerProperties() == null) { - this.innerProperties = new P2SVpnServerConfigurationProperties(); - } - this.innerProperties().withEtag(etag); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/P2SVpnServerConfigurationProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/P2SVpnServerConfigurationProperties.java deleted file mode 100644 index 6f780fcd8c7f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/P2SVpnServerConfigurationProperties.java +++ /dev/null @@ -1,364 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.IpsecPolicy; -import com.azure.resourcemanager.network.models.P2SVpnServerConfigRadiusClientRootCertificate; -import com.azure.resourcemanager.network.models.P2SVpnServerConfigRadiusServerRootCertificate; -import com.azure.resourcemanager.network.models.P2SVpnServerConfigVpnClientRevokedCertificate; -import com.azure.resourcemanager.network.models.P2SVpnServerConfigVpnClientRootCertificate; -import com.azure.resourcemanager.network.models.VpnGatewayTunnelingProtocol; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Parameters for P2SVpnServerConfiguration. */ -@Fluent -public final class P2SVpnServerConfigurationProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(P2SVpnServerConfigurationProperties.class); - - /* - * The name of the P2SVpnServerConfiguration that is unique within a - * VirtualWan in a resource group. This name can be used to access the - * resource along with Paren VirtualWan resource name. - */ - @JsonProperty(value = "name") - private String name; - - /* - * vpnProtocols for the P2SVpnServerConfiguration. - */ - @JsonProperty(value = "vpnProtocols") - private List vpnProtocols; - - /* - * VPN client root certificate of P2SVpnServerConfiguration. - */ - @JsonProperty(value = "p2SVpnServerConfigVpnClientRootCertificates") - private List p2SVpnServerConfigVpnClientRootCertificates; - - /* - * VPN client revoked certificate of P2SVpnServerConfiguration. - */ - @JsonProperty(value = "p2SVpnServerConfigVpnClientRevokedCertificates") - private List p2SVpnServerConfigVpnClientRevokedCertificates; - - /* - * Radius Server root certificate of P2SVpnServerConfiguration. - */ - @JsonProperty(value = "p2SVpnServerConfigRadiusServerRootCertificates") - private List p2SVpnServerConfigRadiusServerRootCertificates; - - /* - * Radius client root certificate of P2SVpnServerConfiguration. - */ - @JsonProperty(value = "p2SVpnServerConfigRadiusClientRootCertificates") - private List p2SVpnServerConfigRadiusClientRootCertificates; - - /* - * VpnClientIpsecPolicies for P2SVpnServerConfiguration. - */ - @JsonProperty(value = "vpnClientIpsecPolicies") - private List vpnClientIpsecPolicies; - - /* - * The radius server address property of the P2SVpnServerConfiguration - * resource for point to site client connection. - */ - @JsonProperty(value = "radiusServerAddress") - private String radiusServerAddress; - - /* - * The radius secret property of the P2SVpnServerConfiguration resource for - * point to site client connection. - */ - @JsonProperty(value = "radiusServerSecret") - private String radiusServerSecret; - - /* - * The provisioning state of the P2SVpnServerConfiguration resource. - * Possible values are: 'Updating', 'Deleting', and 'Failed'. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; - - /* - * The p2SVpnGateways property. - */ - @JsonProperty(value = "p2SVpnGateways", access = JsonProperty.Access.WRITE_ONLY) - private List p2SVpnGateways; - - /* - * A unique read-only string that changes whenever the resource is updated. - */ - @JsonProperty(value = "etag") - private String etag; - - /** - * Get the name property: The name of the P2SVpnServerConfiguration that is unique within a VirtualWan in a resource - * group. This name can be used to access the resource along with Paren VirtualWan resource name. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the P2SVpnServerConfiguration that is unique within a VirtualWan in a resource - * group. This name can be used to access the resource along with Paren VirtualWan resource name. - * - * @param name the name value to set. - * @return the P2SVpnServerConfigurationProperties object itself. - */ - public P2SVpnServerConfigurationProperties withName(String name) { - this.name = name; - return this; - } - - /** - * Get the vpnProtocols property: vpnProtocols for the P2SVpnServerConfiguration. - * - * @return the vpnProtocols value. - */ - public List vpnProtocols() { - return this.vpnProtocols; - } - - /** - * Set the vpnProtocols property: vpnProtocols for the P2SVpnServerConfiguration. - * - * @param vpnProtocols the vpnProtocols value to set. - * @return the P2SVpnServerConfigurationProperties object itself. - */ - public P2SVpnServerConfigurationProperties withVpnProtocols(List vpnProtocols) { - this.vpnProtocols = vpnProtocols; - return this; - } - - /** - * Get the p2SVpnServerConfigVpnClientRootCertificates property: VPN client root certificate of - * P2SVpnServerConfiguration. - * - * @return the p2SVpnServerConfigVpnClientRootCertificates value. - */ - public List p2SVpnServerConfigVpnClientRootCertificates() { - return this.p2SVpnServerConfigVpnClientRootCertificates; - } - - /** - * Set the p2SVpnServerConfigVpnClientRootCertificates property: VPN client root certificate of - * P2SVpnServerConfiguration. - * - * @param p2SVpnServerConfigVpnClientRootCertificates the p2SVpnServerConfigVpnClientRootCertificates value to set. - * @return the P2SVpnServerConfigurationProperties object itself. - */ - public P2SVpnServerConfigurationProperties withP2SVpnServerConfigVpnClientRootCertificates( - List p2SVpnServerConfigVpnClientRootCertificates) { - this.p2SVpnServerConfigVpnClientRootCertificates = p2SVpnServerConfigVpnClientRootCertificates; - return this; - } - - /** - * Get the p2SVpnServerConfigVpnClientRevokedCertificates property: VPN client revoked certificate of - * P2SVpnServerConfiguration. - * - * @return the p2SVpnServerConfigVpnClientRevokedCertificates value. - */ - public List p2SVpnServerConfigVpnClientRevokedCertificates() { - return this.p2SVpnServerConfigVpnClientRevokedCertificates; - } - - /** - * Set the p2SVpnServerConfigVpnClientRevokedCertificates property: VPN client revoked certificate of - * P2SVpnServerConfiguration. - * - * @param p2SVpnServerConfigVpnClientRevokedCertificates the p2SVpnServerConfigVpnClientRevokedCertificates value to - * set. - * @return the P2SVpnServerConfigurationProperties object itself. - */ - public P2SVpnServerConfigurationProperties withP2SVpnServerConfigVpnClientRevokedCertificates( - List p2SVpnServerConfigVpnClientRevokedCertificates) { - this.p2SVpnServerConfigVpnClientRevokedCertificates = p2SVpnServerConfigVpnClientRevokedCertificates; - return this; - } - - /** - * Get the p2SVpnServerConfigRadiusServerRootCertificates property: Radius Server root certificate of - * P2SVpnServerConfiguration. - * - * @return the p2SVpnServerConfigRadiusServerRootCertificates value. - */ - public List p2SVpnServerConfigRadiusServerRootCertificates() { - return this.p2SVpnServerConfigRadiusServerRootCertificates; - } - - /** - * Set the p2SVpnServerConfigRadiusServerRootCertificates property: Radius Server root certificate of - * P2SVpnServerConfiguration. - * - * @param p2SVpnServerConfigRadiusServerRootCertificates the p2SVpnServerConfigRadiusServerRootCertificates value to - * set. - * @return the P2SVpnServerConfigurationProperties object itself. - */ - public P2SVpnServerConfigurationProperties withP2SVpnServerConfigRadiusServerRootCertificates( - List p2SVpnServerConfigRadiusServerRootCertificates) { - this.p2SVpnServerConfigRadiusServerRootCertificates = p2SVpnServerConfigRadiusServerRootCertificates; - return this; - } - - /** - * Get the p2SVpnServerConfigRadiusClientRootCertificates property: Radius client root certificate of - * P2SVpnServerConfiguration. - * - * @return the p2SVpnServerConfigRadiusClientRootCertificates value. - */ - public List p2SVpnServerConfigRadiusClientRootCertificates() { - return this.p2SVpnServerConfigRadiusClientRootCertificates; - } - - /** - * Set the p2SVpnServerConfigRadiusClientRootCertificates property: Radius client root certificate of - * P2SVpnServerConfiguration. - * - * @param p2SVpnServerConfigRadiusClientRootCertificates the p2SVpnServerConfigRadiusClientRootCertificates value to - * set. - * @return the P2SVpnServerConfigurationProperties object itself. - */ - public P2SVpnServerConfigurationProperties withP2SVpnServerConfigRadiusClientRootCertificates( - List p2SVpnServerConfigRadiusClientRootCertificates) { - this.p2SVpnServerConfigRadiusClientRootCertificates = p2SVpnServerConfigRadiusClientRootCertificates; - return this; - } - - /** - * Get the vpnClientIpsecPolicies property: VpnClientIpsecPolicies for P2SVpnServerConfiguration. - * - * @return the vpnClientIpsecPolicies value. - */ - public List vpnClientIpsecPolicies() { - return this.vpnClientIpsecPolicies; - } - - /** - * Set the vpnClientIpsecPolicies property: VpnClientIpsecPolicies for P2SVpnServerConfiguration. - * - * @param vpnClientIpsecPolicies the vpnClientIpsecPolicies value to set. - * @return the P2SVpnServerConfigurationProperties object itself. - */ - public P2SVpnServerConfigurationProperties withVpnClientIpsecPolicies(List vpnClientIpsecPolicies) { - this.vpnClientIpsecPolicies = vpnClientIpsecPolicies; - return this; - } - - /** - * Get the radiusServerAddress property: The radius server address property of the P2SVpnServerConfiguration - * resource for point to site client connection. - * - * @return the radiusServerAddress value. - */ - public String radiusServerAddress() { - return this.radiusServerAddress; - } - - /** - * Set the radiusServerAddress property: The radius server address property of the P2SVpnServerConfiguration - * resource for point to site client connection. - * - * @param radiusServerAddress the radiusServerAddress value to set. - * @return the P2SVpnServerConfigurationProperties object itself. - */ - public P2SVpnServerConfigurationProperties withRadiusServerAddress(String radiusServerAddress) { - this.radiusServerAddress = radiusServerAddress; - return this; - } - - /** - * Get the radiusServerSecret property: The radius secret property of the P2SVpnServerConfiguration resource for - * point to site client connection. - * - * @return the radiusServerSecret value. - */ - public String radiusServerSecret() { - return this.radiusServerSecret; - } - - /** - * Set the radiusServerSecret property: The radius secret property of the P2SVpnServerConfiguration resource for - * point to site client connection. - * - * @param radiusServerSecret the radiusServerSecret value to set. - * @return the P2SVpnServerConfigurationProperties object itself. - */ - public P2SVpnServerConfigurationProperties withRadiusServerSecret(String radiusServerSecret) { - this.radiusServerSecret = radiusServerSecret; - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the P2SVpnServerConfiguration resource. Possible - * values are: 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Get the p2SVpnGateways property: The p2SVpnGateways property. - * - * @return the p2SVpnGateways value. - */ - public List p2SVpnGateways() { - return this.p2SVpnGateways; - } - - /** - * Get the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @param etag the etag value to set. - * @return the P2SVpnServerConfigurationProperties object itself. - */ - public P2SVpnServerConfigurationProperties withEtag(String etag) { - this.etag = etag; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (p2SVpnServerConfigVpnClientRootCertificates() != null) { - p2SVpnServerConfigVpnClientRootCertificates().forEach(e -> e.validate()); - } - if (p2SVpnServerConfigVpnClientRevokedCertificates() != null) { - p2SVpnServerConfigVpnClientRevokedCertificates().forEach(e -> e.validate()); - } - if (p2SVpnServerConfigRadiusServerRootCertificates() != null) { - p2SVpnServerConfigRadiusServerRootCertificates().forEach(e -> e.validate()); - } - if (p2SVpnServerConfigRadiusClientRootCertificates() != null) { - p2SVpnServerConfigRadiusClientRootCertificates().forEach(e -> e.validate()); - } - if (vpnClientIpsecPolicies() != null) { - vpnClientIpsecPolicies().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/PacketCaptureInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/PacketCaptureInner.java deleted file mode 100644 index 733db01d05c7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/PacketCaptureInner.java +++ /dev/null @@ -1,188 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.PacketCaptureFilter; -import com.azure.resourcemanager.network.models.PacketCaptureStorageLocation; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Parameters that define the create packet capture operation. */ -@Fluent -public final class PacketCaptureInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PacketCaptureInner.class); - - /* - * Parameters that define the create packet capture operation. - */ - @JsonProperty(value = "properties", required = true) - private PacketCaptureParameters innerProperties = new PacketCaptureParameters(); - - /** - * Get the innerProperties property: Parameters that define the create packet capture operation. - * - * @return the innerProperties value. - */ - private PacketCaptureParameters innerProperties() { - return this.innerProperties; - } - - /** - * Get the target property: The ID of the targeted resource, only VM is currently supported. - * - * @return the target value. - */ - public String target() { - return this.innerProperties() == null ? null : this.innerProperties().target(); - } - - /** - * Set the target property: The ID of the targeted resource, only VM is currently supported. - * - * @param target the target value to set. - * @return the PacketCaptureInner object itself. - */ - public PacketCaptureInner withTarget(String target) { - if (this.innerProperties() == null) { - this.innerProperties = new PacketCaptureParameters(); - } - this.innerProperties().withTarget(target); - return this; - } - - /** - * Get the bytesToCapturePerPacket property: Number of bytes captured per packet, the remaining bytes are truncated. - * - * @return the bytesToCapturePerPacket value. - */ - public Integer bytesToCapturePerPacket() { - return this.innerProperties() == null ? null : this.innerProperties().bytesToCapturePerPacket(); - } - - /** - * Set the bytesToCapturePerPacket property: Number of bytes captured per packet, the remaining bytes are truncated. - * - * @param bytesToCapturePerPacket the bytesToCapturePerPacket value to set. - * @return the PacketCaptureInner object itself. - */ - public PacketCaptureInner withBytesToCapturePerPacket(Integer bytesToCapturePerPacket) { - if (this.innerProperties() == null) { - this.innerProperties = new PacketCaptureParameters(); - } - this.innerProperties().withBytesToCapturePerPacket(bytesToCapturePerPacket); - return this; - } - - /** - * Get the totalBytesPerSession property: Maximum size of the capture output. - * - * @return the totalBytesPerSession value. - */ - public Integer totalBytesPerSession() { - return this.innerProperties() == null ? null : this.innerProperties().totalBytesPerSession(); - } - - /** - * Set the totalBytesPerSession property: Maximum size of the capture output. - * - * @param totalBytesPerSession the totalBytesPerSession value to set. - * @return the PacketCaptureInner object itself. - */ - public PacketCaptureInner withTotalBytesPerSession(Integer totalBytesPerSession) { - if (this.innerProperties() == null) { - this.innerProperties = new PacketCaptureParameters(); - } - this.innerProperties().withTotalBytesPerSession(totalBytesPerSession); - return this; - } - - /** - * Get the timeLimitInSeconds property: Maximum duration of the capture session in seconds. - * - * @return the timeLimitInSeconds value. - */ - public Integer timeLimitInSeconds() { - return this.innerProperties() == null ? null : this.innerProperties().timeLimitInSeconds(); - } - - /** - * Set the timeLimitInSeconds property: Maximum duration of the capture session in seconds. - * - * @param timeLimitInSeconds the timeLimitInSeconds value to set. - * @return the PacketCaptureInner object itself. - */ - public PacketCaptureInner withTimeLimitInSeconds(Integer timeLimitInSeconds) { - if (this.innerProperties() == null) { - this.innerProperties = new PacketCaptureParameters(); - } - this.innerProperties().withTimeLimitInSeconds(timeLimitInSeconds); - return this; - } - - /** - * Get the storageLocation property: Describes the storage location for a packet capture session. - * - * @return the storageLocation value. - */ - public PacketCaptureStorageLocation storageLocation() { - return this.innerProperties() == null ? null : this.innerProperties().storageLocation(); - } - - /** - * Set the storageLocation property: Describes the storage location for a packet capture session. - * - * @param storageLocation the storageLocation value to set. - * @return the PacketCaptureInner object itself. - */ - public PacketCaptureInner withStorageLocation(PacketCaptureStorageLocation storageLocation) { - if (this.innerProperties() == null) { - this.innerProperties = new PacketCaptureParameters(); - } - this.innerProperties().withStorageLocation(storageLocation); - return this; - } - - /** - * Get the filters property: The filters property. - * - * @return the filters value. - */ - public List filters() { - return this.innerProperties() == null ? null : this.innerProperties().filters(); - } - - /** - * Set the filters property: The filters property. - * - * @param filters the filters value to set. - * @return the PacketCaptureInner object itself. - */ - public PacketCaptureInner withFilters(List filters) { - if (this.innerProperties() == null) { - this.innerProperties = new PacketCaptureParameters(); - } - this.innerProperties().withFilters(filters); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property innerProperties in model PacketCaptureInner")); - } else { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/PacketCaptureParameters.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/PacketCaptureParameters.java deleted file mode 100644 index 3c6c518d94f0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/PacketCaptureParameters.java +++ /dev/null @@ -1,199 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.PacketCaptureFilter; -import com.azure.resourcemanager.network.models.PacketCaptureStorageLocation; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Parameters that define the create packet capture operation. */ -@Fluent -public class PacketCaptureParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PacketCaptureParameters.class); - - /* - * The ID of the targeted resource, only VM is currently supported. - */ - @JsonProperty(value = "target", required = true) - private String target; - - /* - * Number of bytes captured per packet, the remaining bytes are truncated. - */ - @JsonProperty(value = "bytesToCapturePerPacket") - private Integer bytesToCapturePerPacket; - - /* - * Maximum size of the capture output. - */ - @JsonProperty(value = "totalBytesPerSession") - private Integer totalBytesPerSession; - - /* - * Maximum duration of the capture session in seconds. - */ - @JsonProperty(value = "timeLimitInSeconds") - private Integer timeLimitInSeconds; - - /* - * Describes the storage location for a packet capture session. - */ - @JsonProperty(value = "storageLocation", required = true) - private PacketCaptureStorageLocation storageLocation; - - /* - * The filters property. - */ - @JsonProperty(value = "filters") - private List filters; - - /** - * Get the target property: The ID of the targeted resource, only VM is currently supported. - * - * @return the target value. - */ - public String target() { - return this.target; - } - - /** - * Set the target property: The ID of the targeted resource, only VM is currently supported. - * - * @param target the target value to set. - * @return the PacketCaptureParameters object itself. - */ - public PacketCaptureParameters withTarget(String target) { - this.target = target; - return this; - } - - /** - * Get the bytesToCapturePerPacket property: Number of bytes captured per packet, the remaining bytes are truncated. - * - * @return the bytesToCapturePerPacket value. - */ - public Integer bytesToCapturePerPacket() { - return this.bytesToCapturePerPacket; - } - - /** - * Set the bytesToCapturePerPacket property: Number of bytes captured per packet, the remaining bytes are truncated. - * - * @param bytesToCapturePerPacket the bytesToCapturePerPacket value to set. - * @return the PacketCaptureParameters object itself. - */ - public PacketCaptureParameters withBytesToCapturePerPacket(Integer bytesToCapturePerPacket) { - this.bytesToCapturePerPacket = bytesToCapturePerPacket; - return this; - } - - /** - * Get the totalBytesPerSession property: Maximum size of the capture output. - * - * @return the totalBytesPerSession value. - */ - public Integer totalBytesPerSession() { - return this.totalBytesPerSession; - } - - /** - * Set the totalBytesPerSession property: Maximum size of the capture output. - * - * @param totalBytesPerSession the totalBytesPerSession value to set. - * @return the PacketCaptureParameters object itself. - */ - public PacketCaptureParameters withTotalBytesPerSession(Integer totalBytesPerSession) { - this.totalBytesPerSession = totalBytesPerSession; - return this; - } - - /** - * Get the timeLimitInSeconds property: Maximum duration of the capture session in seconds. - * - * @return the timeLimitInSeconds value. - */ - public Integer timeLimitInSeconds() { - return this.timeLimitInSeconds; - } - - /** - * Set the timeLimitInSeconds property: Maximum duration of the capture session in seconds. - * - * @param timeLimitInSeconds the timeLimitInSeconds value to set. - * @return the PacketCaptureParameters object itself. - */ - public PacketCaptureParameters withTimeLimitInSeconds(Integer timeLimitInSeconds) { - this.timeLimitInSeconds = timeLimitInSeconds; - return this; - } - - /** - * Get the storageLocation property: Describes the storage location for a packet capture session. - * - * @return the storageLocation value. - */ - public PacketCaptureStorageLocation storageLocation() { - return this.storageLocation; - } - - /** - * Set the storageLocation property: Describes the storage location for a packet capture session. - * - * @param storageLocation the storageLocation value to set. - * @return the PacketCaptureParameters object itself. - */ - public PacketCaptureParameters withStorageLocation(PacketCaptureStorageLocation storageLocation) { - this.storageLocation = storageLocation; - return this; - } - - /** - * Get the filters property: The filters property. - * - * @return the filters value. - */ - public List filters() { - return this.filters; - } - - /** - * Set the filters property: The filters property. - * - * @param filters the filters value to set. - * @return the PacketCaptureParameters object itself. - */ - public PacketCaptureParameters withFilters(List filters) { - this.filters = filters; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (target() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property target in model PacketCaptureParameters")); - } - if (storageLocation() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property storageLocation in model PacketCaptureParameters")); - } else { - storageLocation().validate(); - } - if (filters() != null) { - filters().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/PacketCaptureQueryStatusResultInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/PacketCaptureQueryStatusResultInner.java deleted file mode 100644 index d3c069cb9a50..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/PacketCaptureQueryStatusResultInner.java +++ /dev/null @@ -1,184 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.PcError; -import com.azure.resourcemanager.network.models.PcStatus; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; - -/** Status of packet capture session. */ -@Fluent -public final class PacketCaptureQueryStatusResultInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PacketCaptureQueryStatusResultInner.class); - - /* - * The name of the packet capture resource. - */ - @JsonProperty(value = "name") - private String name; - - /* - * The ID of the packet capture resource. - */ - @JsonProperty(value = "id") - private String id; - - /* - * The start time of the packet capture session. - */ - @JsonProperty(value = "captureStartTime") - private OffsetDateTime captureStartTime; - - /* - * The status of the packet capture session. - */ - @JsonProperty(value = "packetCaptureStatus") - private PcStatus packetCaptureStatus; - - /* - * The reason the current packet capture session was stopped. - */ - @JsonProperty(value = "stopReason") - private String stopReason; - - /* - * List of errors of packet capture session. - */ - @JsonProperty(value = "packetCaptureError") - private List packetCaptureError; - - /** - * Get the name property: The name of the packet capture resource. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the packet capture resource. - * - * @param name the name value to set. - * @return the PacketCaptureQueryStatusResultInner object itself. - */ - public PacketCaptureQueryStatusResultInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the id property: The ID of the packet capture resource. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: The ID of the packet capture resource. - * - * @param id the id value to set. - * @return the PacketCaptureQueryStatusResultInner object itself. - */ - public PacketCaptureQueryStatusResultInner withId(String id) { - this.id = id; - return this; - } - - /** - * Get the captureStartTime property: The start time of the packet capture session. - * - * @return the captureStartTime value. - */ - public OffsetDateTime captureStartTime() { - return this.captureStartTime; - } - - /** - * Set the captureStartTime property: The start time of the packet capture session. - * - * @param captureStartTime the captureStartTime value to set. - * @return the PacketCaptureQueryStatusResultInner object itself. - */ - public PacketCaptureQueryStatusResultInner withCaptureStartTime(OffsetDateTime captureStartTime) { - this.captureStartTime = captureStartTime; - return this; - } - - /** - * Get the packetCaptureStatus property: The status of the packet capture session. - * - * @return the packetCaptureStatus value. - */ - public PcStatus packetCaptureStatus() { - return this.packetCaptureStatus; - } - - /** - * Set the packetCaptureStatus property: The status of the packet capture session. - * - * @param packetCaptureStatus the packetCaptureStatus value to set. - * @return the PacketCaptureQueryStatusResultInner object itself. - */ - public PacketCaptureQueryStatusResultInner withPacketCaptureStatus(PcStatus packetCaptureStatus) { - this.packetCaptureStatus = packetCaptureStatus; - return this; - } - - /** - * Get the stopReason property: The reason the current packet capture session was stopped. - * - * @return the stopReason value. - */ - public String stopReason() { - return this.stopReason; - } - - /** - * Set the stopReason property: The reason the current packet capture session was stopped. - * - * @param stopReason the stopReason value to set. - * @return the PacketCaptureQueryStatusResultInner object itself. - */ - public PacketCaptureQueryStatusResultInner withStopReason(String stopReason) { - this.stopReason = stopReason; - return this; - } - - /** - * Get the packetCaptureError property: List of errors of packet capture session. - * - * @return the packetCaptureError value. - */ - public List packetCaptureError() { - return this.packetCaptureError; - } - - /** - * Set the packetCaptureError property: List of errors of packet capture session. - * - * @param packetCaptureError the packetCaptureError value to set. - * @return the PacketCaptureQueryStatusResultInner object itself. - */ - public PacketCaptureQueryStatusResultInner withPacketCaptureError(List packetCaptureError) { - this.packetCaptureError = packetCaptureError; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/PacketCaptureResultInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/PacketCaptureResultInner.java deleted file mode 100644 index a2379d991c0b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/PacketCaptureResultInner.java +++ /dev/null @@ -1,263 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.PacketCaptureFilter; -import com.azure.resourcemanager.network.models.PacketCaptureStorageLocation; -import com.azure.resourcemanager.network.models.ProvisioningState; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Information about packet capture session. */ -@Fluent -public final class PacketCaptureResultInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PacketCaptureResultInner.class); - - /* - * Name of the packet capture session. - */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) - private String name; - - /* - * ID of the packet capture operation. - */ - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) - private String id; - - /* - * The etag property. - */ - @JsonProperty(value = "etag") - private String etag; - - /* - * Describes the properties of a packet capture session. - */ - @JsonProperty(value = "properties") - private PacketCaptureResultProperties innerProperties; - - /** - * Get the name property: Name of the packet capture session. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the id property: ID of the packet capture operation. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Get the etag property: The etag property. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: The etag property. - * - * @param etag the etag value to set. - * @return the PacketCaptureResultInner object itself. - */ - public PacketCaptureResultInner withEtag(String etag) { - this.etag = etag; - return this; - } - - /** - * Get the innerProperties property: Describes the properties of a packet capture session. - * - * @return the innerProperties value. - */ - private PacketCaptureResultProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the provisioningState property: The provisioning state of the packet capture session. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Set the provisioningState property: The provisioning state of the packet capture session. - * - * @param provisioningState the provisioningState value to set. - * @return the PacketCaptureResultInner object itself. - */ - public PacketCaptureResultInner withProvisioningState(ProvisioningState provisioningState) { - if (this.innerProperties() == null) { - this.innerProperties = new PacketCaptureResultProperties(); - } - this.innerProperties().withProvisioningState(provisioningState); - return this; - } - - /** - * Get the target property: The ID of the targeted resource, only VM is currently supported. - * - * @return the target value. - */ - public String target() { - return this.innerProperties() == null ? null : this.innerProperties().target(); - } - - /** - * Set the target property: The ID of the targeted resource, only VM is currently supported. - * - * @param target the target value to set. - * @return the PacketCaptureResultInner object itself. - */ - public PacketCaptureResultInner withTarget(String target) { - if (this.innerProperties() == null) { - this.innerProperties = new PacketCaptureResultProperties(); - } - this.innerProperties().withTarget(target); - return this; - } - - /** - * Get the bytesToCapturePerPacket property: Number of bytes captured per packet, the remaining bytes are truncated. - * - * @return the bytesToCapturePerPacket value. - */ - public Integer bytesToCapturePerPacket() { - return this.innerProperties() == null ? null : this.innerProperties().bytesToCapturePerPacket(); - } - - /** - * Set the bytesToCapturePerPacket property: Number of bytes captured per packet, the remaining bytes are truncated. - * - * @param bytesToCapturePerPacket the bytesToCapturePerPacket value to set. - * @return the PacketCaptureResultInner object itself. - */ - public PacketCaptureResultInner withBytesToCapturePerPacket(Integer bytesToCapturePerPacket) { - if (this.innerProperties() == null) { - this.innerProperties = new PacketCaptureResultProperties(); - } - this.innerProperties().withBytesToCapturePerPacket(bytesToCapturePerPacket); - return this; - } - - /** - * Get the totalBytesPerSession property: Maximum size of the capture output. - * - * @return the totalBytesPerSession value. - */ - public Integer totalBytesPerSession() { - return this.innerProperties() == null ? null : this.innerProperties().totalBytesPerSession(); - } - - /** - * Set the totalBytesPerSession property: Maximum size of the capture output. - * - * @param totalBytesPerSession the totalBytesPerSession value to set. - * @return the PacketCaptureResultInner object itself. - */ - public PacketCaptureResultInner withTotalBytesPerSession(Integer totalBytesPerSession) { - if (this.innerProperties() == null) { - this.innerProperties = new PacketCaptureResultProperties(); - } - this.innerProperties().withTotalBytesPerSession(totalBytesPerSession); - return this; - } - - /** - * Get the timeLimitInSeconds property: Maximum duration of the capture session in seconds. - * - * @return the timeLimitInSeconds value. - */ - public Integer timeLimitInSeconds() { - return this.innerProperties() == null ? null : this.innerProperties().timeLimitInSeconds(); - } - - /** - * Set the timeLimitInSeconds property: Maximum duration of the capture session in seconds. - * - * @param timeLimitInSeconds the timeLimitInSeconds value to set. - * @return the PacketCaptureResultInner object itself. - */ - public PacketCaptureResultInner withTimeLimitInSeconds(Integer timeLimitInSeconds) { - if (this.innerProperties() == null) { - this.innerProperties = new PacketCaptureResultProperties(); - } - this.innerProperties().withTimeLimitInSeconds(timeLimitInSeconds); - return this; - } - - /** - * Get the storageLocation property: Describes the storage location for a packet capture session. - * - * @return the storageLocation value. - */ - public PacketCaptureStorageLocation storageLocation() { - return this.innerProperties() == null ? null : this.innerProperties().storageLocation(); - } - - /** - * Set the storageLocation property: Describes the storage location for a packet capture session. - * - * @param storageLocation the storageLocation value to set. - * @return the PacketCaptureResultInner object itself. - */ - public PacketCaptureResultInner withStorageLocation(PacketCaptureStorageLocation storageLocation) { - if (this.innerProperties() == null) { - this.innerProperties = new PacketCaptureResultProperties(); - } - this.innerProperties().withStorageLocation(storageLocation); - return this; - } - - /** - * Get the filters property: The filters property. - * - * @return the filters value. - */ - public List filters() { - return this.innerProperties() == null ? null : this.innerProperties().filters(); - } - - /** - * Set the filters property: The filters property. - * - * @param filters the filters value to set. - * @return the PacketCaptureResultInner object itself. - */ - public PacketCaptureResultInner withFilters(List filters) { - if (this.innerProperties() == null) { - this.innerProperties = new PacketCaptureResultProperties(); - } - this.innerProperties().withFilters(filters); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/PacketCaptureResultProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/PacketCaptureResultProperties.java deleted file mode 100644 index e926dc069f7e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/PacketCaptureResultProperties.java +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.PacketCaptureFilter; -import com.azure.resourcemanager.network.models.PacketCaptureStorageLocation; -import com.azure.resourcemanager.network.models.ProvisioningState; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Describes the properties of a packet capture session. */ -@Fluent -public final class PacketCaptureResultProperties extends PacketCaptureParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PacketCaptureResultProperties.class); - - /* - * The provisioning state of the packet capture session. - */ - @JsonProperty(value = "provisioningState") - private ProvisioningState provisioningState; - - /** - * Get the provisioningState property: The provisioning state of the packet capture session. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Set the provisioningState property: The provisioning state of the packet capture session. - * - * @param provisioningState the provisioningState value to set. - * @return the PacketCaptureResultProperties object itself. - */ - public PacketCaptureResultProperties withProvisioningState(ProvisioningState provisioningState) { - this.provisioningState = provisioningState; - return this; - } - - /** {@inheritDoc} */ - @Override - public PacketCaptureResultProperties withTarget(String target) { - super.withTarget(target); - return this; - } - - /** {@inheritDoc} */ - @Override - public PacketCaptureResultProperties withBytesToCapturePerPacket(Integer bytesToCapturePerPacket) { - super.withBytesToCapturePerPacket(bytesToCapturePerPacket); - return this; - } - - /** {@inheritDoc} */ - @Override - public PacketCaptureResultProperties withTotalBytesPerSession(Integer totalBytesPerSession) { - super.withTotalBytesPerSession(totalBytesPerSession); - return this; - } - - /** {@inheritDoc} */ - @Override - public PacketCaptureResultProperties withTimeLimitInSeconds(Integer timeLimitInSeconds) { - super.withTimeLimitInSeconds(timeLimitInSeconds); - return this; - } - - /** {@inheritDoc} */ - @Override - public PacketCaptureResultProperties withStorageLocation(PacketCaptureStorageLocation storageLocation) { - super.withStorageLocation(storageLocation); - return this; - } - - /** {@inheritDoc} */ - @Override - public PacketCaptureResultProperties withFilters(List filters) { - super.withFilters(filters); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ProbeInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ProbeInner.java deleted file mode 100644 index 286bf5d7efb0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ProbeInner.java +++ /dev/null @@ -1,270 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.ProbeProtocol; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** A load balancer probe. */ -@Fluent -public final class ProbeInner extends SubResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ProbeInner.class); - - /* - * Properties of load balancer probe. - */ - @JsonProperty(value = "properties") - private ProbePropertiesFormat innerProperties; - - /* - * Gets name of the resource that is unique within a resource group. This - * name can be used to access the resource. - */ - @JsonProperty(value = "name") - private String name; - - /* - * A unique read-only string that changes whenever the resource is updated. - */ - @JsonProperty(value = "etag") - private String etag; - - /** - * Get the innerProperties property: Properties of load balancer probe. - * - * @return the innerProperties value. - */ - private ProbePropertiesFormat innerProperties() { - return this.innerProperties; - } - - /** - * Get the name property: Gets name of the resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Gets name of the resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @param name the name value to set. - * @return the ProbeInner object itself. - */ - public ProbeInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @param etag the etag value to set. - * @return the ProbeInner object itself. - */ - public ProbeInner withEtag(String etag) { - this.etag = etag; - return this; - } - - /** {@inheritDoc} */ - @Override - public ProbeInner withId(String id) { - super.withId(id); - return this; - } - - /** - * Get the loadBalancingRules property: The load balancer rules that use this probe. - * - * @return the loadBalancingRules value. - */ - public List loadBalancingRules() { - return this.innerProperties() == null ? null : this.innerProperties().loadBalancingRules(); - } - - /** - * Get the protocol property: The protocol of the end point. Possible values are: 'Http', 'Tcp', or 'Https'. If - * 'Tcp' is specified, a received ACK is required for the probe to be successful. If 'Http' or 'Https' is specified, - * a 200 OK response from the specifies URI is required for the probe to be successful. - * - * @return the protocol value. - */ - public ProbeProtocol protocol() { - return this.innerProperties() == null ? null : this.innerProperties().protocol(); - } - - /** - * Set the protocol property: The protocol of the end point. Possible values are: 'Http', 'Tcp', or 'Https'. If - * 'Tcp' is specified, a received ACK is required for the probe to be successful. If 'Http' or 'Https' is specified, - * a 200 OK response from the specifies URI is required for the probe to be successful. - * - * @param protocol the protocol value to set. - * @return the ProbeInner object itself. - */ - public ProbeInner withProtocol(ProbeProtocol protocol) { - if (this.innerProperties() == null) { - this.innerProperties = new ProbePropertiesFormat(); - } - this.innerProperties().withProtocol(protocol); - return this; - } - - /** - * Get the port property: The port for communicating the probe. Possible values range from 1 to 65535, inclusive. - * - * @return the port value. - */ - public Integer port() { - return this.innerProperties() == null ? null : this.innerProperties().port(); - } - - /** - * Set the port property: The port for communicating the probe. Possible values range from 1 to 65535, inclusive. - * - * @param port the port value to set. - * @return the ProbeInner object itself. - */ - public ProbeInner withPort(Integer port) { - if (this.innerProperties() == null) { - this.innerProperties = new ProbePropertiesFormat(); - } - this.innerProperties().withPort(port); - return this; - } - - /** - * Get the intervalInSeconds property: The interval, in seconds, for how frequently to probe the endpoint for health - * status. Typically, the interval is slightly less than half the allocated timeout period (in seconds) which allows - * two full probes before taking the instance out of rotation. The default value is 15, the minimum value is 5. - * - * @return the intervalInSeconds value. - */ - public Integer intervalInSeconds() { - return this.innerProperties() == null ? null : this.innerProperties().intervalInSeconds(); - } - - /** - * Set the intervalInSeconds property: The interval, in seconds, for how frequently to probe the endpoint for health - * status. Typically, the interval is slightly less than half the allocated timeout period (in seconds) which allows - * two full probes before taking the instance out of rotation. The default value is 15, the minimum value is 5. - * - * @param intervalInSeconds the intervalInSeconds value to set. - * @return the ProbeInner object itself. - */ - public ProbeInner withIntervalInSeconds(Integer intervalInSeconds) { - if (this.innerProperties() == null) { - this.innerProperties = new ProbePropertiesFormat(); - } - this.innerProperties().withIntervalInSeconds(intervalInSeconds); - return this; - } - - /** - * Get the numberOfProbes property: The number of probes where if no response, will result in stopping further - * traffic from being delivered to the endpoint. This values allows endpoints to be taken out of rotation faster or - * slower than the typical times used in Azure. - * - * @return the numberOfProbes value. - */ - public Integer numberOfProbes() { - return this.innerProperties() == null ? null : this.innerProperties().numberOfProbes(); - } - - /** - * Set the numberOfProbes property: The number of probes where if no response, will result in stopping further - * traffic from being delivered to the endpoint. This values allows endpoints to be taken out of rotation faster or - * slower than the typical times used in Azure. - * - * @param numberOfProbes the numberOfProbes value to set. - * @return the ProbeInner object itself. - */ - public ProbeInner withNumberOfProbes(Integer numberOfProbes) { - if (this.innerProperties() == null) { - this.innerProperties = new ProbePropertiesFormat(); - } - this.innerProperties().withNumberOfProbes(numberOfProbes); - return this; - } - - /** - * Get the requestPath property: The URI used for requesting health status from the VM. Path is required if a - * protocol is set to http. Otherwise, it is not allowed. There is no default value. - * - * @return the requestPath value. - */ - public String requestPath() { - return this.innerProperties() == null ? null : this.innerProperties().requestPath(); - } - - /** - * Set the requestPath property: The URI used for requesting health status from the VM. Path is required if a - * protocol is set to http. Otherwise, it is not allowed. There is no default value. - * - * @param requestPath the requestPath value to set. - * @return the ProbeInner object itself. - */ - public ProbeInner withRequestPath(String requestPath) { - if (this.innerProperties() == null) { - this.innerProperties = new ProbePropertiesFormat(); - } - this.innerProperties().withRequestPath(requestPath); - return this; - } - - /** - * Get the provisioningState property: Gets the provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Set the provisioningState property: Gets the provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param provisioningState the provisioningState value to set. - * @return the ProbeInner object itself. - */ - public ProbeInner withProvisioningState(String provisioningState) { - if (this.innerProperties() == null) { - this.innerProperties = new ProbePropertiesFormat(); - } - this.innerProperties().withProvisioningState(provisioningState); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ProbePropertiesFormat.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ProbePropertiesFormat.java deleted file mode 100644 index 5f1e2273c7c6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ProbePropertiesFormat.java +++ /dev/null @@ -1,233 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.ProbeProtocol; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Load balancer probe resource. */ -@Fluent -public final class ProbePropertiesFormat { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ProbePropertiesFormat.class); - - /* - * The load balancer rules that use this probe. - */ - @JsonProperty(value = "loadBalancingRules", access = JsonProperty.Access.WRITE_ONLY) - private List loadBalancingRules; - - /* - * The protocol of the end point. Possible values are: 'Http', 'Tcp', or - * 'Https'. If 'Tcp' is specified, a received ACK is required for the probe - * to be successful. If 'Http' or 'Https' is specified, a 200 OK response - * from the specifies URI is required for the probe to be successful. - */ - @JsonProperty(value = "protocol", required = true) - private ProbeProtocol protocol; - - /* - * The port for communicating the probe. Possible values range from 1 to - * 65535, inclusive. - */ - @JsonProperty(value = "port", required = true) - private int port; - - /* - * The interval, in seconds, for how frequently to probe the endpoint for - * health status. Typically, the interval is slightly less than half the - * allocated timeout period (in seconds) which allows two full probes - * before taking the instance out of rotation. The default value is 15, the - * minimum value is 5. - */ - @JsonProperty(value = "intervalInSeconds") - private Integer intervalInSeconds; - - /* - * The number of probes where if no response, will result in stopping - * further traffic from being delivered to the endpoint. This values allows - * endpoints to be taken out of rotation faster or slower than the typical - * times used in Azure. - */ - @JsonProperty(value = "numberOfProbes") - private Integer numberOfProbes; - - /* - * The URI used for requesting health status from the VM. Path is required - * if a protocol is set to http. Otherwise, it is not allowed. There is no - * default value. - */ - @JsonProperty(value = "requestPath") - private String requestPath; - - /* - * Gets the provisioning state of the public IP resource. Possible values - * are: 'Updating', 'Deleting', and 'Failed'. - */ - @JsonProperty(value = "provisioningState") - private String provisioningState; - - /** - * Get the loadBalancingRules property: The load balancer rules that use this probe. - * - * @return the loadBalancingRules value. - */ - public List loadBalancingRules() { - return this.loadBalancingRules; - } - - /** - * Get the protocol property: The protocol of the end point. Possible values are: 'Http', 'Tcp', or 'Https'. If - * 'Tcp' is specified, a received ACK is required for the probe to be successful. If 'Http' or 'Https' is specified, - * a 200 OK response from the specifies URI is required for the probe to be successful. - * - * @return the protocol value. - */ - public ProbeProtocol protocol() { - return this.protocol; - } - - /** - * Set the protocol property: The protocol of the end point. Possible values are: 'Http', 'Tcp', or 'Https'. If - * 'Tcp' is specified, a received ACK is required for the probe to be successful. If 'Http' or 'Https' is specified, - * a 200 OK response from the specifies URI is required for the probe to be successful. - * - * @param protocol the protocol value to set. - * @return the ProbePropertiesFormat object itself. - */ - public ProbePropertiesFormat withProtocol(ProbeProtocol protocol) { - this.protocol = protocol; - return this; - } - - /** - * Get the port property: The port for communicating the probe. Possible values range from 1 to 65535, inclusive. - * - * @return the port value. - */ - public int port() { - return this.port; - } - - /** - * Set the port property: The port for communicating the probe. Possible values range from 1 to 65535, inclusive. - * - * @param port the port value to set. - * @return the ProbePropertiesFormat object itself. - */ - public ProbePropertiesFormat withPort(int port) { - this.port = port; - return this; - } - - /** - * Get the intervalInSeconds property: The interval, in seconds, for how frequently to probe the endpoint for health - * status. Typically, the interval is slightly less than half the allocated timeout period (in seconds) which allows - * two full probes before taking the instance out of rotation. The default value is 15, the minimum value is 5. - * - * @return the intervalInSeconds value. - */ - public Integer intervalInSeconds() { - return this.intervalInSeconds; - } - - /** - * Set the intervalInSeconds property: The interval, in seconds, for how frequently to probe the endpoint for health - * status. Typically, the interval is slightly less than half the allocated timeout period (in seconds) which allows - * two full probes before taking the instance out of rotation. The default value is 15, the minimum value is 5. - * - * @param intervalInSeconds the intervalInSeconds value to set. - * @return the ProbePropertiesFormat object itself. - */ - public ProbePropertiesFormat withIntervalInSeconds(Integer intervalInSeconds) { - this.intervalInSeconds = intervalInSeconds; - return this; - } - - /** - * Get the numberOfProbes property: The number of probes where if no response, will result in stopping further - * traffic from being delivered to the endpoint. This values allows endpoints to be taken out of rotation faster or - * slower than the typical times used in Azure. - * - * @return the numberOfProbes value. - */ - public Integer numberOfProbes() { - return this.numberOfProbes; - } - - /** - * Set the numberOfProbes property: The number of probes where if no response, will result in stopping further - * traffic from being delivered to the endpoint. This values allows endpoints to be taken out of rotation faster or - * slower than the typical times used in Azure. - * - * @param numberOfProbes the numberOfProbes value to set. - * @return the ProbePropertiesFormat object itself. - */ - public ProbePropertiesFormat withNumberOfProbes(Integer numberOfProbes) { - this.numberOfProbes = numberOfProbes; - return this; - } - - /** - * Get the requestPath property: The URI used for requesting health status from the VM. Path is required if a - * protocol is set to http. Otherwise, it is not allowed. There is no default value. - * - * @return the requestPath value. - */ - public String requestPath() { - return this.requestPath; - } - - /** - * Set the requestPath property: The URI used for requesting health status from the VM. Path is required if a - * protocol is set to http. Otherwise, it is not allowed. There is no default value. - * - * @param requestPath the requestPath value to set. - * @return the ProbePropertiesFormat object itself. - */ - public ProbePropertiesFormat withRequestPath(String requestPath) { - this.requestPath = requestPath; - return this; - } - - /** - * Get the provisioningState property: Gets the provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Set the provisioningState property: Gets the provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param provisioningState the provisioningState value to set. - * @return the ProbePropertiesFormat object itself. - */ - public ProbePropertiesFormat withProvisioningState(String provisioningState) { - this.provisioningState = provisioningState; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (protocol() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property protocol in model ProbePropertiesFormat")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/PublicIpAddressInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/PublicIpAddressInner.java deleted file mode 100644 index 80ae2fdd682c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/PublicIpAddressInner.java +++ /dev/null @@ -1,419 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.DdosSettings; -import com.azure.resourcemanager.network.models.IpAllocationMethod; -import com.azure.resourcemanager.network.models.IpTag; -import com.azure.resourcemanager.network.models.IpVersion; -import com.azure.resourcemanager.network.models.PublicIpAddressDnsSettings; -import com.azure.resourcemanager.network.models.PublicIpAddressSku; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** Public IP address resource. */ -@Fluent -public final class PublicIpAddressInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PublicIpAddressInner.class); - - /* - * The public IP address SKU. - */ - @JsonProperty(value = "sku") - private PublicIpAddressSku sku; - - /* - * Public IP address properties. - */ - @JsonProperty(value = "properties") - private PublicIpAddressPropertiesFormatInner innerProperties; - - /* - * A unique read-only string that changes whenever the resource is updated. - */ - @JsonProperty(value = "etag") - private String etag; - - /* - * A list of availability zones denoting the IP allocated for the resource - * needs to come from. - */ - @JsonProperty(value = "zones") - private List zones; - - /* - * Resource ID. - */ - @JsonProperty(value = "id") - private String id; - - /** - * Get the sku property: The public IP address SKU. - * - * @return the sku value. - */ - public PublicIpAddressSku sku() { - return this.sku; - } - - /** - * Set the sku property: The public IP address SKU. - * - * @param sku the sku value to set. - * @return the PublicIpAddressInner object itself. - */ - public PublicIpAddressInner withSku(PublicIpAddressSku sku) { - this.sku = sku; - return this; - } - - /** - * Get the innerProperties property: Public IP address properties. - * - * @return the innerProperties value. - */ - private PublicIpAddressPropertiesFormatInner innerProperties() { - return this.innerProperties; - } - - /** - * Get the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @param etag the etag value to set. - * @return the PublicIpAddressInner object itself. - */ - public PublicIpAddressInner withEtag(String etag) { - this.etag = etag; - return this; - } - - /** - * Get the zones property: A list of availability zones denoting the IP allocated for the resource needs to come - * from. - * - * @return the zones value. - */ - public List zones() { - return this.zones; - } - - /** - * Set the zones property: A list of availability zones denoting the IP allocated for the resource needs to come - * from. - * - * @param zones the zones value to set. - * @return the PublicIpAddressInner object itself. - */ - public PublicIpAddressInner withZones(List zones) { - this.zones = zones; - return this; - } - - /** - * Get the id property: Resource ID. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: Resource ID. - * - * @param id the id value to set. - * @return the PublicIpAddressInner object itself. - */ - public PublicIpAddressInner withId(String id) { - this.id = id; - return this; - } - - /** {@inheritDoc} */ - @Override - public PublicIpAddressInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public PublicIpAddressInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the publicIpAllocationMethod property: The public IP allocation method. Possible values are: 'Static' and - * 'Dynamic'. - * - * @return the publicIpAllocationMethod value. - */ - public IpAllocationMethod publicIpAllocationMethod() { - return this.innerProperties() == null ? null : this.innerProperties().publicIpAllocationMethod(); - } - - /** - * Set the publicIpAllocationMethod property: The public IP allocation method. Possible values are: 'Static' and - * 'Dynamic'. - * - * @param publicIpAllocationMethod the publicIpAllocationMethod value to set. - * @return the PublicIpAddressInner object itself. - */ - public PublicIpAddressInner withPublicIpAllocationMethod(IpAllocationMethod publicIpAllocationMethod) { - if (this.innerProperties() == null) { - this.innerProperties = new PublicIpAddressPropertiesFormatInner(); - } - this.innerProperties().withPublicIpAllocationMethod(publicIpAllocationMethod); - return this; - } - - /** - * Get the publicIpAddressVersion property: The public IP address version. Possible values are: 'IPv4' and 'IPv6'. - * - * @return the publicIpAddressVersion value. - */ - public IpVersion publicIpAddressVersion() { - return this.innerProperties() == null ? null : this.innerProperties().publicIpAddressVersion(); - } - - /** - * Set the publicIpAddressVersion property: The public IP address version. Possible values are: 'IPv4' and 'IPv6'. - * - * @param publicIpAddressVersion the publicIpAddressVersion value to set. - * @return the PublicIpAddressInner object itself. - */ - public PublicIpAddressInner withPublicIpAddressVersion(IpVersion publicIpAddressVersion) { - if (this.innerProperties() == null) { - this.innerProperties = new PublicIpAddressPropertiesFormatInner(); - } - this.innerProperties().withPublicIpAddressVersion(publicIpAddressVersion); - return this; - } - - /** - * Get the ipConfiguration property: The IP configuration associated with the public IP address. - * - * @return the ipConfiguration value. - */ - public IpConfigurationInner ipConfiguration() { - return this.innerProperties() == null ? null : this.innerProperties().ipConfiguration(); - } - - /** - * Get the dnsSettings property: The FQDN of the DNS record associated with the public IP address. - * - * @return the dnsSettings value. - */ - public PublicIpAddressDnsSettings dnsSettings() { - return this.innerProperties() == null ? null : this.innerProperties().dnsSettings(); - } - - /** - * Set the dnsSettings property: The FQDN of the DNS record associated with the public IP address. - * - * @param dnsSettings the dnsSettings value to set. - * @return the PublicIpAddressInner object itself. - */ - public PublicIpAddressInner withDnsSettings(PublicIpAddressDnsSettings dnsSettings) { - if (this.innerProperties() == null) { - this.innerProperties = new PublicIpAddressPropertiesFormatInner(); - } - this.innerProperties().withDnsSettings(dnsSettings); - return this; - } - - /** - * Get the ddosSettings property: The DDoS protection custom policy associated with the public IP address. - * - * @return the ddosSettings value. - */ - public DdosSettings ddosSettings() { - return this.innerProperties() == null ? null : this.innerProperties().ddosSettings(); - } - - /** - * Set the ddosSettings property: The DDoS protection custom policy associated with the public IP address. - * - * @param ddosSettings the ddosSettings value to set. - * @return the PublicIpAddressInner object itself. - */ - public PublicIpAddressInner withDdosSettings(DdosSettings ddosSettings) { - if (this.innerProperties() == null) { - this.innerProperties = new PublicIpAddressPropertiesFormatInner(); - } - this.innerProperties().withDdosSettings(ddosSettings); - return this; - } - - /** - * Get the ipTags property: The list of tags associated with the public IP address. - * - * @return the ipTags value. - */ - public List ipTags() { - return this.innerProperties() == null ? null : this.innerProperties().ipTags(); - } - - /** - * Set the ipTags property: The list of tags associated with the public IP address. - * - * @param ipTags the ipTags value to set. - * @return the PublicIpAddressInner object itself. - */ - public PublicIpAddressInner withIpTags(List ipTags) { - if (this.innerProperties() == null) { - this.innerProperties = new PublicIpAddressPropertiesFormatInner(); - } - this.innerProperties().withIpTags(ipTags); - return this; - } - - /** - * Get the ipAddress property: The IP address associated with the public IP address resource. - * - * @return the ipAddress value. - */ - public String ipAddress() { - return this.innerProperties() == null ? null : this.innerProperties().ipAddress(); - } - - /** - * Set the ipAddress property: The IP address associated with the public IP address resource. - * - * @param ipAddress the ipAddress value to set. - * @return the PublicIpAddressInner object itself. - */ - public PublicIpAddressInner withIpAddress(String ipAddress) { - if (this.innerProperties() == null) { - this.innerProperties = new PublicIpAddressPropertiesFormatInner(); - } - this.innerProperties().withIpAddress(ipAddress); - return this; - } - - /** - * Get the publicIpPrefix property: The Public IP Prefix this Public IP Address should be allocated from. - * - * @return the publicIpPrefix value. - */ - public SubResource publicIpPrefix() { - return this.innerProperties() == null ? null : this.innerProperties().publicIpPrefix(); - } - - /** - * Set the publicIpPrefix property: The Public IP Prefix this Public IP Address should be allocated from. - * - * @param publicIpPrefix the publicIpPrefix value to set. - * @return the PublicIpAddressInner object itself. - */ - public PublicIpAddressInner withPublicIpPrefix(SubResource publicIpPrefix) { - if (this.innerProperties() == null) { - this.innerProperties = new PublicIpAddressPropertiesFormatInner(); - } - this.innerProperties().withPublicIpPrefix(publicIpPrefix); - return this; - } - - /** - * Get the idleTimeoutInMinutes property: The idle timeout of the public IP address. - * - * @return the idleTimeoutInMinutes value. - */ - public Integer idleTimeoutInMinutes() { - return this.innerProperties() == null ? null : this.innerProperties().idleTimeoutInMinutes(); - } - - /** - * Set the idleTimeoutInMinutes property: The idle timeout of the public IP address. - * - * @param idleTimeoutInMinutes the idleTimeoutInMinutes value to set. - * @return the PublicIpAddressInner object itself. - */ - public PublicIpAddressInner withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes) { - if (this.innerProperties() == null) { - this.innerProperties = new PublicIpAddressPropertiesFormatInner(); - } - this.innerProperties().withIdleTimeoutInMinutes(idleTimeoutInMinutes); - return this; - } - - /** - * Get the resourceGuid property: The resource GUID property of the public IP resource. - * - * @return the resourceGuid value. - */ - public String resourceGuid() { - return this.innerProperties() == null ? null : this.innerProperties().resourceGuid(); - } - - /** - * Set the resourceGuid property: The resource GUID property of the public IP resource. - * - * @param resourceGuid the resourceGuid value to set. - * @return the PublicIpAddressInner object itself. - */ - public PublicIpAddressInner withResourceGuid(String resourceGuid) { - if (this.innerProperties() == null) { - this.innerProperties = new PublicIpAddressPropertiesFormatInner(); - } - this.innerProperties().withResourceGuid(resourceGuid); - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the PublicIP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Set the provisioningState property: The provisioning state of the PublicIP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param provisioningState the provisioningState value to set. - * @return the PublicIpAddressInner object itself. - */ - public PublicIpAddressInner withProvisioningState(String provisioningState) { - if (this.innerProperties() == null) { - this.innerProperties = new PublicIpAddressPropertiesFormatInner(); - } - this.innerProperties().withProvisioningState(provisioningState); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (sku() != null) { - sku().validate(); - } - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/PublicIpAddressPropertiesFormatInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/PublicIpAddressPropertiesFormatInner.java deleted file mode 100644 index ed652bfc6c1c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/PublicIpAddressPropertiesFormatInner.java +++ /dev/null @@ -1,325 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.DdosSettings; -import com.azure.resourcemanager.network.models.IpAllocationMethod; -import com.azure.resourcemanager.network.models.IpTag; -import com.azure.resourcemanager.network.models.IpVersion; -import com.azure.resourcemanager.network.models.PublicIpAddressDnsSettings; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Public IP address properties. */ -@Fluent -public final class PublicIpAddressPropertiesFormatInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PublicIpAddressPropertiesFormatInner.class); - - /* - * The public IP allocation method. Possible values are: 'Static' and - * 'Dynamic'. - */ - @JsonProperty(value = "publicIPAllocationMethod") - private IpAllocationMethod publicIpAllocationMethod; - - /* - * The public IP address version. Possible values are: 'IPv4' and 'IPv6'. - */ - @JsonProperty(value = "publicIPAddressVersion") - private IpVersion publicIpAddressVersion; - - /* - * The IP configuration associated with the public IP address. - */ - @JsonProperty(value = "ipConfiguration", access = JsonProperty.Access.WRITE_ONLY) - private IpConfigurationInner ipConfiguration; - - /* - * The FQDN of the DNS record associated with the public IP address. - */ - @JsonProperty(value = "dnsSettings") - private PublicIpAddressDnsSettings dnsSettings; - - /* - * The DDoS protection custom policy associated with the public IP address. - */ - @JsonProperty(value = "ddosSettings") - private DdosSettings ddosSettings; - - /* - * The list of tags associated with the public IP address. - */ - @JsonProperty(value = "ipTags") - private List ipTags; - - /* - * The IP address associated with the public IP address resource. - */ - @JsonProperty(value = "ipAddress") - private String ipAddress; - - /* - * The Public IP Prefix this Public IP Address should be allocated from. - */ - @JsonProperty(value = "publicIPPrefix") - private SubResource publicIpPrefix; - - /* - * The idle timeout of the public IP address. - */ - @JsonProperty(value = "idleTimeoutInMinutes") - private Integer idleTimeoutInMinutes; - - /* - * The resource GUID property of the public IP resource. - */ - @JsonProperty(value = "resourceGuid") - private String resourceGuid; - - /* - * The provisioning state of the PublicIP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - */ - @JsonProperty(value = "provisioningState") - private String provisioningState; - - /** - * Get the publicIpAllocationMethod property: The public IP allocation method. Possible values are: 'Static' and - * 'Dynamic'. - * - * @return the publicIpAllocationMethod value. - */ - public IpAllocationMethod publicIpAllocationMethod() { - return this.publicIpAllocationMethod; - } - - /** - * Set the publicIpAllocationMethod property: The public IP allocation method. Possible values are: 'Static' and - * 'Dynamic'. - * - * @param publicIpAllocationMethod the publicIpAllocationMethod value to set. - * @return the PublicIpAddressPropertiesFormatInner object itself. - */ - public PublicIpAddressPropertiesFormatInner withPublicIpAllocationMethod( - IpAllocationMethod publicIpAllocationMethod) { - this.publicIpAllocationMethod = publicIpAllocationMethod; - return this; - } - - /** - * Get the publicIpAddressVersion property: The public IP address version. Possible values are: 'IPv4' and 'IPv6'. - * - * @return the publicIpAddressVersion value. - */ - public IpVersion publicIpAddressVersion() { - return this.publicIpAddressVersion; - } - - /** - * Set the publicIpAddressVersion property: The public IP address version. Possible values are: 'IPv4' and 'IPv6'. - * - * @param publicIpAddressVersion the publicIpAddressVersion value to set. - * @return the PublicIpAddressPropertiesFormatInner object itself. - */ - public PublicIpAddressPropertiesFormatInner withPublicIpAddressVersion(IpVersion publicIpAddressVersion) { - this.publicIpAddressVersion = publicIpAddressVersion; - return this; - } - - /** - * Get the ipConfiguration property: The IP configuration associated with the public IP address. - * - * @return the ipConfiguration value. - */ - public IpConfigurationInner ipConfiguration() { - return this.ipConfiguration; - } - - /** - * Get the dnsSettings property: The FQDN of the DNS record associated with the public IP address. - * - * @return the dnsSettings value. - */ - public PublicIpAddressDnsSettings dnsSettings() { - return this.dnsSettings; - } - - /** - * Set the dnsSettings property: The FQDN of the DNS record associated with the public IP address. - * - * @param dnsSettings the dnsSettings value to set. - * @return the PublicIpAddressPropertiesFormatInner object itself. - */ - public PublicIpAddressPropertiesFormatInner withDnsSettings(PublicIpAddressDnsSettings dnsSettings) { - this.dnsSettings = dnsSettings; - return this; - } - - /** - * Get the ddosSettings property: The DDoS protection custom policy associated with the public IP address. - * - * @return the ddosSettings value. - */ - public DdosSettings ddosSettings() { - return this.ddosSettings; - } - - /** - * Set the ddosSettings property: The DDoS protection custom policy associated with the public IP address. - * - * @param ddosSettings the ddosSettings value to set. - * @return the PublicIpAddressPropertiesFormatInner object itself. - */ - public PublicIpAddressPropertiesFormatInner withDdosSettings(DdosSettings ddosSettings) { - this.ddosSettings = ddosSettings; - return this; - } - - /** - * Get the ipTags property: The list of tags associated with the public IP address. - * - * @return the ipTags value. - */ - public List ipTags() { - return this.ipTags; - } - - /** - * Set the ipTags property: The list of tags associated with the public IP address. - * - * @param ipTags the ipTags value to set. - * @return the PublicIpAddressPropertiesFormatInner object itself. - */ - public PublicIpAddressPropertiesFormatInner withIpTags(List ipTags) { - this.ipTags = ipTags; - return this; - } - - /** - * Get the ipAddress property: The IP address associated with the public IP address resource. - * - * @return the ipAddress value. - */ - public String ipAddress() { - return this.ipAddress; - } - - /** - * Set the ipAddress property: The IP address associated with the public IP address resource. - * - * @param ipAddress the ipAddress value to set. - * @return the PublicIpAddressPropertiesFormatInner object itself. - */ - public PublicIpAddressPropertiesFormatInner withIpAddress(String ipAddress) { - this.ipAddress = ipAddress; - return this; - } - - /** - * Get the publicIpPrefix property: The Public IP Prefix this Public IP Address should be allocated from. - * - * @return the publicIpPrefix value. - */ - public SubResource publicIpPrefix() { - return this.publicIpPrefix; - } - - /** - * Set the publicIpPrefix property: The Public IP Prefix this Public IP Address should be allocated from. - * - * @param publicIpPrefix the publicIpPrefix value to set. - * @return the PublicIpAddressPropertiesFormatInner object itself. - */ - public PublicIpAddressPropertiesFormatInner withPublicIpPrefix(SubResource publicIpPrefix) { - this.publicIpPrefix = publicIpPrefix; - return this; - } - - /** - * Get the idleTimeoutInMinutes property: The idle timeout of the public IP address. - * - * @return the idleTimeoutInMinutes value. - */ - public Integer idleTimeoutInMinutes() { - return this.idleTimeoutInMinutes; - } - - /** - * Set the idleTimeoutInMinutes property: The idle timeout of the public IP address. - * - * @param idleTimeoutInMinutes the idleTimeoutInMinutes value to set. - * @return the PublicIpAddressPropertiesFormatInner object itself. - */ - public PublicIpAddressPropertiesFormatInner withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes) { - this.idleTimeoutInMinutes = idleTimeoutInMinutes; - return this; - } - - /** - * Get the resourceGuid property: The resource GUID property of the public IP resource. - * - * @return the resourceGuid value. - */ - public String resourceGuid() { - return this.resourceGuid; - } - - /** - * Set the resourceGuid property: The resource GUID property of the public IP resource. - * - * @param resourceGuid the resourceGuid value to set. - * @return the PublicIpAddressPropertiesFormatInner object itself. - */ - public PublicIpAddressPropertiesFormatInner withResourceGuid(String resourceGuid) { - this.resourceGuid = resourceGuid; - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the PublicIP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Set the provisioningState property: The provisioning state of the PublicIP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param provisioningState the provisioningState value to set. - * @return the PublicIpAddressPropertiesFormatInner object itself. - */ - public PublicIpAddressPropertiesFormatInner withProvisioningState(String provisioningState) { - this.provisioningState = provisioningState; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (ipConfiguration() != null) { - ipConfiguration().validate(); - } - if (dnsSettings() != null) { - dnsSettings().validate(); - } - if (ddosSettings() != null) { - ddosSettings().validate(); - } - if (ipTags() != null) { - ipTags().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/PublicIpPrefixInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/PublicIpPrefixInner.java deleted file mode 100644 index 8e0948d1d793..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/PublicIpPrefixInner.java +++ /dev/null @@ -1,347 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.IpTag; -import com.azure.resourcemanager.network.models.IpVersion; -import com.azure.resourcemanager.network.models.PublicIpPrefixSku; -import com.azure.resourcemanager.network.models.ReferencedPublicIpAddress; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** Public IP prefix resource. */ -@Fluent -public final class PublicIpPrefixInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PublicIpPrefixInner.class); - - /* - * The public IP prefix SKU. - */ - @JsonProperty(value = "sku") - private PublicIpPrefixSku sku; - - /* - * Public IP prefix properties. - */ - @JsonProperty(value = "properties") - private PublicIpPrefixPropertiesFormat innerProperties; - - /* - * A unique read-only string that changes whenever the resource is updated. - */ - @JsonProperty(value = "etag") - private String etag; - - /* - * A list of availability zones denoting the IP allocated for the resource - * needs to come from. - */ - @JsonProperty(value = "zones") - private List zones; - - /* - * Resource ID. - */ - @JsonProperty(value = "id") - private String id; - - /** - * Get the sku property: The public IP prefix SKU. - * - * @return the sku value. - */ - public PublicIpPrefixSku sku() { - return this.sku; - } - - /** - * Set the sku property: The public IP prefix SKU. - * - * @param sku the sku value to set. - * @return the PublicIpPrefixInner object itself. - */ - public PublicIpPrefixInner withSku(PublicIpPrefixSku sku) { - this.sku = sku; - return this; - } - - /** - * Get the innerProperties property: Public IP prefix properties. - * - * @return the innerProperties value. - */ - private PublicIpPrefixPropertiesFormat innerProperties() { - return this.innerProperties; - } - - /** - * Get the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @param etag the etag value to set. - * @return the PublicIpPrefixInner object itself. - */ - public PublicIpPrefixInner withEtag(String etag) { - this.etag = etag; - return this; - } - - /** - * Get the zones property: A list of availability zones denoting the IP allocated for the resource needs to come - * from. - * - * @return the zones value. - */ - public List zones() { - return this.zones; - } - - /** - * Set the zones property: A list of availability zones denoting the IP allocated for the resource needs to come - * from. - * - * @param zones the zones value to set. - * @return the PublicIpPrefixInner object itself. - */ - public PublicIpPrefixInner withZones(List zones) { - this.zones = zones; - return this; - } - - /** - * Get the id property: Resource ID. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: Resource ID. - * - * @param id the id value to set. - * @return the PublicIpPrefixInner object itself. - */ - public PublicIpPrefixInner withId(String id) { - this.id = id; - return this; - } - - /** {@inheritDoc} */ - @Override - public PublicIpPrefixInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public PublicIpPrefixInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the publicIpAddressVersion property: The public IP address version. Possible values are: 'IPv4' and 'IPv6'. - * - * @return the publicIpAddressVersion value. - */ - public IpVersion publicIpAddressVersion() { - return this.innerProperties() == null ? null : this.innerProperties().publicIpAddressVersion(); - } - - /** - * Set the publicIpAddressVersion property: The public IP address version. Possible values are: 'IPv4' and 'IPv6'. - * - * @param publicIpAddressVersion the publicIpAddressVersion value to set. - * @return the PublicIpPrefixInner object itself. - */ - public PublicIpPrefixInner withPublicIpAddressVersion(IpVersion publicIpAddressVersion) { - if (this.innerProperties() == null) { - this.innerProperties = new PublicIpPrefixPropertiesFormat(); - } - this.innerProperties().withPublicIpAddressVersion(publicIpAddressVersion); - return this; - } - - /** - * Get the ipTags property: The list of tags associated with the public IP prefix. - * - * @return the ipTags value. - */ - public List ipTags() { - return this.innerProperties() == null ? null : this.innerProperties().ipTags(); - } - - /** - * Set the ipTags property: The list of tags associated with the public IP prefix. - * - * @param ipTags the ipTags value to set. - * @return the PublicIpPrefixInner object itself. - */ - public PublicIpPrefixInner withIpTags(List ipTags) { - if (this.innerProperties() == null) { - this.innerProperties = new PublicIpPrefixPropertiesFormat(); - } - this.innerProperties().withIpTags(ipTags); - return this; - } - - /** - * Get the prefixLength property: The Length of the Public IP Prefix. - * - * @return the prefixLength value. - */ - public Integer prefixLength() { - return this.innerProperties() == null ? null : this.innerProperties().prefixLength(); - } - - /** - * Set the prefixLength property: The Length of the Public IP Prefix. - * - * @param prefixLength the prefixLength value to set. - * @return the PublicIpPrefixInner object itself. - */ - public PublicIpPrefixInner withPrefixLength(Integer prefixLength) { - if (this.innerProperties() == null) { - this.innerProperties = new PublicIpPrefixPropertiesFormat(); - } - this.innerProperties().withPrefixLength(prefixLength); - return this; - } - - /** - * Get the ipPrefix property: The allocated Prefix. - * - * @return the ipPrefix value. - */ - public String ipPrefix() { - return this.innerProperties() == null ? null : this.innerProperties().ipPrefix(); - } - - /** - * Set the ipPrefix property: The allocated Prefix. - * - * @param ipPrefix the ipPrefix value to set. - * @return the PublicIpPrefixInner object itself. - */ - public PublicIpPrefixInner withIpPrefix(String ipPrefix) { - if (this.innerProperties() == null) { - this.innerProperties = new PublicIpPrefixPropertiesFormat(); - } - this.innerProperties().withIpPrefix(ipPrefix); - return this; - } - - /** - * Get the publicIpAddresses property: The list of all referenced PublicIPAddresses. - * - * @return the publicIpAddresses value. - */ - public List publicIpAddresses() { - return this.innerProperties() == null ? null : this.innerProperties().publicIpAddresses(); - } - - /** - * Set the publicIpAddresses property: The list of all referenced PublicIPAddresses. - * - * @param publicIpAddresses the publicIpAddresses value to set. - * @return the PublicIpPrefixInner object itself. - */ - public PublicIpPrefixInner withPublicIpAddresses(List publicIpAddresses) { - if (this.innerProperties() == null) { - this.innerProperties = new PublicIpPrefixPropertiesFormat(); - } - this.innerProperties().withPublicIpAddresses(publicIpAddresses); - return this; - } - - /** - * Get the loadBalancerFrontendIpConfiguration property: The reference to load balancer frontend IP configuration - * associated with the public IP prefix. - * - * @return the loadBalancerFrontendIpConfiguration value. - */ - public SubResource loadBalancerFrontendIpConfiguration() { - return this.innerProperties() == null ? null : this.innerProperties().loadBalancerFrontendIpConfiguration(); - } - - /** - * Get the resourceGuid property: The resource GUID property of the public IP prefix resource. - * - * @return the resourceGuid value. - */ - public String resourceGuid() { - return this.innerProperties() == null ? null : this.innerProperties().resourceGuid(); - } - - /** - * Set the resourceGuid property: The resource GUID property of the public IP prefix resource. - * - * @param resourceGuid the resourceGuid value to set. - * @return the PublicIpPrefixInner object itself. - */ - public PublicIpPrefixInner withResourceGuid(String resourceGuid) { - if (this.innerProperties() == null) { - this.innerProperties = new PublicIpPrefixPropertiesFormat(); - } - this.innerProperties().withResourceGuid(resourceGuid); - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the Public IP prefix resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Set the provisioningState property: The provisioning state of the Public IP prefix resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param provisioningState the provisioningState value to set. - * @return the PublicIpPrefixInner object itself. - */ - public PublicIpPrefixInner withProvisioningState(String provisioningState) { - if (this.innerProperties() == null) { - this.innerProperties = new PublicIpPrefixPropertiesFormat(); - } - this.innerProperties().withProvisioningState(provisioningState); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (sku() != null) { - sku().validate(); - } - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/PublicIpPrefixPropertiesFormat.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/PublicIpPrefixPropertiesFormat.java deleted file mode 100644 index 305353e2a831..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/PublicIpPrefixPropertiesFormat.java +++ /dev/null @@ -1,237 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.IpTag; -import com.azure.resourcemanager.network.models.IpVersion; -import com.azure.resourcemanager.network.models.ReferencedPublicIpAddress; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Public IP prefix properties. */ -@Fluent -public final class PublicIpPrefixPropertiesFormat { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PublicIpPrefixPropertiesFormat.class); - - /* - * The public IP address version. Possible values are: 'IPv4' and 'IPv6'. - */ - @JsonProperty(value = "publicIPAddressVersion") - private IpVersion publicIpAddressVersion; - - /* - * The list of tags associated with the public IP prefix. - */ - @JsonProperty(value = "ipTags") - private List ipTags; - - /* - * The Length of the Public IP Prefix. - */ - @JsonProperty(value = "prefixLength") - private Integer prefixLength; - - /* - * The allocated Prefix - */ - @JsonProperty(value = "ipPrefix") - private String ipPrefix; - - /* - * The list of all referenced PublicIPAddresses - */ - @JsonProperty(value = "publicIPAddresses") - private List publicIpAddresses; - - /* - * The reference to load balancer frontend IP configuration associated with - * the public IP prefix. - */ - @JsonProperty(value = "loadBalancerFrontendIpConfiguration", access = JsonProperty.Access.WRITE_ONLY) - private SubResource loadBalancerFrontendIpConfiguration; - - /* - * The resource GUID property of the public IP prefix resource. - */ - @JsonProperty(value = "resourceGuid") - private String resourceGuid; - - /* - * The provisioning state of the Public IP prefix resource. Possible values - * are: 'Updating', 'Deleting', and 'Failed'. - */ - @JsonProperty(value = "provisioningState") - private String provisioningState; - - /** - * Get the publicIpAddressVersion property: The public IP address version. Possible values are: 'IPv4' and 'IPv6'. - * - * @return the publicIpAddressVersion value. - */ - public IpVersion publicIpAddressVersion() { - return this.publicIpAddressVersion; - } - - /** - * Set the publicIpAddressVersion property: The public IP address version. Possible values are: 'IPv4' and 'IPv6'. - * - * @param publicIpAddressVersion the publicIpAddressVersion value to set. - * @return the PublicIpPrefixPropertiesFormat object itself. - */ - public PublicIpPrefixPropertiesFormat withPublicIpAddressVersion(IpVersion publicIpAddressVersion) { - this.publicIpAddressVersion = publicIpAddressVersion; - return this; - } - - /** - * Get the ipTags property: The list of tags associated with the public IP prefix. - * - * @return the ipTags value. - */ - public List ipTags() { - return this.ipTags; - } - - /** - * Set the ipTags property: The list of tags associated with the public IP prefix. - * - * @param ipTags the ipTags value to set. - * @return the PublicIpPrefixPropertiesFormat object itself. - */ - public PublicIpPrefixPropertiesFormat withIpTags(List ipTags) { - this.ipTags = ipTags; - return this; - } - - /** - * Get the prefixLength property: The Length of the Public IP Prefix. - * - * @return the prefixLength value. - */ - public Integer prefixLength() { - return this.prefixLength; - } - - /** - * Set the prefixLength property: The Length of the Public IP Prefix. - * - * @param prefixLength the prefixLength value to set. - * @return the PublicIpPrefixPropertiesFormat object itself. - */ - public PublicIpPrefixPropertiesFormat withPrefixLength(Integer prefixLength) { - this.prefixLength = prefixLength; - return this; - } - - /** - * Get the ipPrefix property: The allocated Prefix. - * - * @return the ipPrefix value. - */ - public String ipPrefix() { - return this.ipPrefix; - } - - /** - * Set the ipPrefix property: The allocated Prefix. - * - * @param ipPrefix the ipPrefix value to set. - * @return the PublicIpPrefixPropertiesFormat object itself. - */ - public PublicIpPrefixPropertiesFormat withIpPrefix(String ipPrefix) { - this.ipPrefix = ipPrefix; - return this; - } - - /** - * Get the publicIpAddresses property: The list of all referenced PublicIPAddresses. - * - * @return the publicIpAddresses value. - */ - public List publicIpAddresses() { - return this.publicIpAddresses; - } - - /** - * Set the publicIpAddresses property: The list of all referenced PublicIPAddresses. - * - * @param publicIpAddresses the publicIpAddresses value to set. - * @return the PublicIpPrefixPropertiesFormat object itself. - */ - public PublicIpPrefixPropertiesFormat withPublicIpAddresses(List publicIpAddresses) { - this.publicIpAddresses = publicIpAddresses; - return this; - } - - /** - * Get the loadBalancerFrontendIpConfiguration property: The reference to load balancer frontend IP configuration - * associated with the public IP prefix. - * - * @return the loadBalancerFrontendIpConfiguration value. - */ - public SubResource loadBalancerFrontendIpConfiguration() { - return this.loadBalancerFrontendIpConfiguration; - } - - /** - * Get the resourceGuid property: The resource GUID property of the public IP prefix resource. - * - * @return the resourceGuid value. - */ - public String resourceGuid() { - return this.resourceGuid; - } - - /** - * Set the resourceGuid property: The resource GUID property of the public IP prefix resource. - * - * @param resourceGuid the resourceGuid value to set. - * @return the PublicIpPrefixPropertiesFormat object itself. - */ - public PublicIpPrefixPropertiesFormat withResourceGuid(String resourceGuid) { - this.resourceGuid = resourceGuid; - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the Public IP prefix resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Set the provisioningState property: The provisioning state of the Public IP prefix resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param provisioningState the provisioningState value to set. - * @return the PublicIpPrefixPropertiesFormat object itself. - */ - public PublicIpPrefixPropertiesFormat withProvisioningState(String provisioningState) { - this.provisioningState = provisioningState; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (ipTags() != null) { - ipTags().forEach(e -> e.validate()); - } - if (publicIpAddresses() != null) { - publicIpAddresses().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ResourceNavigationLinkFormat.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ResourceNavigationLinkFormat.java deleted file mode 100644 index 0fdaf84edefb..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ResourceNavigationLinkFormat.java +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Properties of ResourceNavigationLink. */ -@Fluent -public final class ResourceNavigationLinkFormat { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceNavigationLinkFormat.class); - - /* - * Resource type of the linked resource. - */ - @JsonProperty(value = "linkedResourceType") - private String linkedResourceType; - - /* - * Link to the external resource - */ - @JsonProperty(value = "link") - private String link; - - /* - * Provisioning state of the ResourceNavigationLink resource. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; - - /** - * Get the linkedResourceType property: Resource type of the linked resource. - * - * @return the linkedResourceType value. - */ - public String linkedResourceType() { - return this.linkedResourceType; - } - - /** - * Set the linkedResourceType property: Resource type of the linked resource. - * - * @param linkedResourceType the linkedResourceType value to set. - * @return the ResourceNavigationLinkFormat object itself. - */ - public ResourceNavigationLinkFormat withLinkedResourceType(String linkedResourceType) { - this.linkedResourceType = linkedResourceType; - return this; - } - - /** - * Get the link property: Link to the external resource. - * - * @return the link value. - */ - public String link() { - return this.link; - } - - /** - * Set the link property: Link to the external resource. - * - * @param link the link value to set. - * @return the ResourceNavigationLinkFormat object itself. - */ - public ResourceNavigationLinkFormat withLink(String link) { - this.link = link; - return this; - } - - /** - * Get the provisioningState property: Provisioning state of the ResourceNavigationLink resource. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/RouteFilterInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/RouteFilterInner.java deleted file mode 100644 index 7ed0b7004736..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/RouteFilterInner.java +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** Route Filter Resource. */ -@Fluent -public final class RouteFilterInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RouteFilterInner.class); - - /* - * Route Filter Resource - */ - @JsonProperty(value = "properties") - private RouteFilterPropertiesFormat innerProperties; - - /* - * Gets a unique read-only string that changes whenever the resource is - * updated. - */ - @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) - private String etag; - - /* - * Resource ID. - */ - @JsonProperty(value = "id") - private String id; - - /** - * Get the innerProperties property: Route Filter Resource. - * - * @return the innerProperties value. - */ - private RouteFilterPropertiesFormat innerProperties() { - return this.innerProperties; - } - - /** - * Get the etag property: Gets a unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Get the id property: Resource ID. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: Resource ID. - * - * @param id the id value to set. - * @return the RouteFilterInner object itself. - */ - public RouteFilterInner withId(String id) { - this.id = id; - return this; - } - - /** {@inheritDoc} */ - @Override - public RouteFilterInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public RouteFilterInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the rules property: Collection of RouteFilterRules contained within a route filter. - * - * @return the rules value. - */ - public List rules() { - return this.innerProperties() == null ? null : this.innerProperties().rules(); - } - - /** - * Set the rules property: Collection of RouteFilterRules contained within a route filter. - * - * @param rules the rules value to set. - * @return the RouteFilterInner object itself. - */ - public RouteFilterInner withRules(List rules) { - if (this.innerProperties() == null) { - this.innerProperties = new RouteFilterPropertiesFormat(); - } - this.innerProperties().withRules(rules); - return this; - } - - /** - * Get the peerings property: A collection of references to express route circuit peerings. - * - * @return the peerings value. - */ - public List peerings() { - return this.innerProperties() == null ? null : this.innerProperties().peerings(); - } - - /** - * Set the peerings property: A collection of references to express route circuit peerings. - * - * @param peerings the peerings value to set. - * @return the RouteFilterInner object itself. - */ - public RouteFilterInner withPeerings(List peerings) { - if (this.innerProperties() == null) { - this.innerProperties = new RouteFilterPropertiesFormat(); - } - this.innerProperties().withPeerings(peerings); - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', 'Succeeded' and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/RouteFilterPropertiesFormat.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/RouteFilterPropertiesFormat.java deleted file mode 100644 index d6ebbb98d31a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/RouteFilterPropertiesFormat.java +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Route Filter Resource. */ -@Fluent -public final class RouteFilterPropertiesFormat { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RouteFilterPropertiesFormat.class); - - /* - * Collection of RouteFilterRules contained within a route filter. - */ - @JsonProperty(value = "rules") - private List rules; - - /* - * A collection of references to express route circuit peerings. - */ - @JsonProperty(value = "peerings") - private List peerings; - - /* - * The provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', 'Succeeded' and 'Failed'. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; - - /** - * Get the rules property: Collection of RouteFilterRules contained within a route filter. - * - * @return the rules value. - */ - public List rules() { - return this.rules; - } - - /** - * Set the rules property: Collection of RouteFilterRules contained within a route filter. - * - * @param rules the rules value to set. - * @return the RouteFilterPropertiesFormat object itself. - */ - public RouteFilterPropertiesFormat withRules(List rules) { - this.rules = rules; - return this; - } - - /** - * Get the peerings property: A collection of references to express route circuit peerings. - * - * @return the peerings value. - */ - public List peerings() { - return this.peerings; - } - - /** - * Set the peerings property: A collection of references to express route circuit peerings. - * - * @param peerings the peerings value to set. - * @return the RouteFilterPropertiesFormat object itself. - */ - public RouteFilterPropertiesFormat withPeerings(List peerings) { - this.peerings = peerings; - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', 'Succeeded' and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (rules() != null) { - rules().forEach(e -> e.validate()); - } - if (peerings() != null) { - peerings().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/RouteFilterRuleInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/RouteFilterRuleInner.java deleted file mode 100644 index 3b6c1735c704..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/RouteFilterRuleInner.java +++ /dev/null @@ -1,204 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.Access; -import com.azure.resourcemanager.network.models.RouteFilterRuleType; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Route Filter Rule Resource. */ -@Fluent -public final class RouteFilterRuleInner extends SubResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RouteFilterRuleInner.class); - - /* - * Route Filter Rule Resource - */ - @JsonProperty(value = "properties") - private RouteFilterRulePropertiesFormat innerProperties; - - /* - * The name of the resource that is unique within a resource group. This - * name can be used to access the resource. - */ - @JsonProperty(value = "name") - private String name; - - /* - * Resource location. - */ - @JsonProperty(value = "location") - private String location; - - /* - * A unique read-only string that changes whenever the resource is updated. - */ - @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) - private String etag; - - /** - * Get the innerProperties property: Route Filter Rule Resource. - * - * @return the innerProperties value. - */ - private RouteFilterRulePropertiesFormat innerProperties() { - return this.innerProperties; - } - - /** - * Get the name property: The name of the resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @param name the name value to set. - * @return the RouteFilterRuleInner object itself. - */ - public RouteFilterRuleInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the location property: Resource location. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Set the location property: Resource location. - * - * @param location the location value to set. - * @return the RouteFilterRuleInner object itself. - */ - public RouteFilterRuleInner withLocation(String location) { - this.location = location; - return this; - } - - /** - * Get the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** {@inheritDoc} */ - @Override - public RouteFilterRuleInner withId(String id) { - super.withId(id); - return this; - } - - /** - * Get the access property: The access type of the rule. Valid values are: 'Allow', 'Deny'. - * - * @return the access value. - */ - public Access access() { - return this.innerProperties() == null ? null : this.innerProperties().access(); - } - - /** - * Set the access property: The access type of the rule. Valid values are: 'Allow', 'Deny'. - * - * @param access the access value to set. - * @return the RouteFilterRuleInner object itself. - */ - public RouteFilterRuleInner withAccess(Access access) { - if (this.innerProperties() == null) { - this.innerProperties = new RouteFilterRulePropertiesFormat(); - } - this.innerProperties().withAccess(access); - return this; - } - - /** - * Get the routeFilterRuleType property: The rule type of the rule. Valid value is: 'Community'. - * - * @return the routeFilterRuleType value. - */ - public RouteFilterRuleType routeFilterRuleType() { - return this.innerProperties() == null ? null : this.innerProperties().routeFilterRuleType(); - } - - /** - * Set the routeFilterRuleType property: The rule type of the rule. Valid value is: 'Community'. - * - * @param routeFilterRuleType the routeFilterRuleType value to set. - * @return the RouteFilterRuleInner object itself. - */ - public RouteFilterRuleInner withRouteFilterRuleType(RouteFilterRuleType routeFilterRuleType) { - if (this.innerProperties() == null) { - this.innerProperties = new RouteFilterRulePropertiesFormat(); - } - this.innerProperties().withRouteFilterRuleType(routeFilterRuleType); - return this; - } - - /** - * Get the communities property: The collection for bgp community values to filter on. e.g. - * ['12076:5010','12076:5020']. - * - * @return the communities value. - */ - public List communities() { - return this.innerProperties() == null ? null : this.innerProperties().communities(); - } - - /** - * Set the communities property: The collection for bgp community values to filter on. e.g. - * ['12076:5010','12076:5020']. - * - * @param communities the communities value to set. - * @return the RouteFilterRuleInner object itself. - */ - public RouteFilterRuleInner withCommunities(List communities) { - if (this.innerProperties() == null) { - this.innerProperties = new RouteFilterRulePropertiesFormat(); - } - this.innerProperties().withCommunities(communities); - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', 'Succeeded' and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/RouteFilterRulePropertiesFormat.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/RouteFilterRulePropertiesFormat.java deleted file mode 100644 index 1abcf12553e2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/RouteFilterRulePropertiesFormat.java +++ /dev/null @@ -1,143 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.Access; -import com.azure.resourcemanager.network.models.RouteFilterRuleType; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Route Filter Rule Resource. */ -@Fluent -public final class RouteFilterRulePropertiesFormat { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RouteFilterRulePropertiesFormat.class); - - /* - * The access type of the rule. Valid values are: 'Allow', 'Deny' - */ - @JsonProperty(value = "access", required = true) - private Access access; - - /* - * The rule type of the rule. Valid value is: 'Community' - */ - @JsonProperty(value = "routeFilterRuleType", required = true) - private RouteFilterRuleType routeFilterRuleType; - - /* - * The collection for bgp community values to filter on. e.g. - * ['12076:5010','12076:5020'] - */ - @JsonProperty(value = "communities", required = true) - private List communities; - - /* - * The provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', 'Succeeded' and 'Failed'. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; - - /** - * Get the access property: The access type of the rule. Valid values are: 'Allow', 'Deny'. - * - * @return the access value. - */ - public Access access() { - return this.access; - } - - /** - * Set the access property: The access type of the rule. Valid values are: 'Allow', 'Deny'. - * - * @param access the access value to set. - * @return the RouteFilterRulePropertiesFormat object itself. - */ - public RouteFilterRulePropertiesFormat withAccess(Access access) { - this.access = access; - return this; - } - - /** - * Get the routeFilterRuleType property: The rule type of the rule. Valid value is: 'Community'. - * - * @return the routeFilterRuleType value. - */ - public RouteFilterRuleType routeFilterRuleType() { - return this.routeFilterRuleType; - } - - /** - * Set the routeFilterRuleType property: The rule type of the rule. Valid value is: 'Community'. - * - * @param routeFilterRuleType the routeFilterRuleType value to set. - * @return the RouteFilterRulePropertiesFormat object itself. - */ - public RouteFilterRulePropertiesFormat withRouteFilterRuleType(RouteFilterRuleType routeFilterRuleType) { - this.routeFilterRuleType = routeFilterRuleType; - return this; - } - - /** - * Get the communities property: The collection for bgp community values to filter on. e.g. - * ['12076:5010','12076:5020']. - * - * @return the communities value. - */ - public List communities() { - return this.communities; - } - - /** - * Set the communities property: The collection for bgp community values to filter on. e.g. - * ['12076:5010','12076:5020']. - * - * @param communities the communities value to set. - * @return the RouteFilterRulePropertiesFormat object itself. - */ - public RouteFilterRulePropertiesFormat withCommunities(List communities) { - this.communities = communities; - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', 'Succeeded' and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (access() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property access in model RouteFilterRulePropertiesFormat")); - } - if (routeFilterRuleType() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property routeFilterRuleType in model RouteFilterRulePropertiesFormat")); - } - if (communities() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property communities in model RouteFilterRulePropertiesFormat")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/RouteInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/RouteInner.java deleted file mode 100644 index b6034bb594d7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/RouteInner.java +++ /dev/null @@ -1,204 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.RouteNextHopType; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Route resource. */ -@Fluent -public final class RouteInner extends SubResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RouteInner.class); - - /* - * Properties of the route. - */ - @JsonProperty(value = "properties") - private RoutePropertiesFormat innerProperties; - - /* - * The name of the resource that is unique within a resource group. This - * name can be used to access the resource. - */ - @JsonProperty(value = "name") - private String name; - - /* - * A unique read-only string that changes whenever the resource is updated. - */ - @JsonProperty(value = "etag") - private String etag; - - /** - * Get the innerProperties property: Properties of the route. - * - * @return the innerProperties value. - */ - private RoutePropertiesFormat innerProperties() { - return this.innerProperties; - } - - /** - * Get the name property: The name of the resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @param name the name value to set. - * @return the RouteInner object itself. - */ - public RouteInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @param etag the etag value to set. - * @return the RouteInner object itself. - */ - public RouteInner withEtag(String etag) { - this.etag = etag; - return this; - } - - /** {@inheritDoc} */ - @Override - public RouteInner withId(String id) { - super.withId(id); - return this; - } - - /** - * Get the addressPrefix property: The destination CIDR to which the route applies. - * - * @return the addressPrefix value. - */ - public String addressPrefix() { - return this.innerProperties() == null ? null : this.innerProperties().addressPrefix(); - } - - /** - * Set the addressPrefix property: The destination CIDR to which the route applies. - * - * @param addressPrefix the addressPrefix value to set. - * @return the RouteInner object itself. - */ - public RouteInner withAddressPrefix(String addressPrefix) { - if (this.innerProperties() == null) { - this.innerProperties = new RoutePropertiesFormat(); - } - this.innerProperties().withAddressPrefix(addressPrefix); - return this; - } - - /** - * Get the nextHopType property: The type of Azure hop the packet should be sent to. Possible values are: - * 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'. - * - * @return the nextHopType value. - */ - public RouteNextHopType nextHopType() { - return this.innerProperties() == null ? null : this.innerProperties().nextHopType(); - } - - /** - * Set the nextHopType property: The type of Azure hop the packet should be sent to. Possible values are: - * 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'. - * - * @param nextHopType the nextHopType value to set. - * @return the RouteInner object itself. - */ - public RouteInner withNextHopType(RouteNextHopType nextHopType) { - if (this.innerProperties() == null) { - this.innerProperties = new RoutePropertiesFormat(); - } - this.innerProperties().withNextHopType(nextHopType); - return this; - } - - /** - * Get the nextHopIpAddress property: The IP address packets should be forwarded to. Next hop values are only - * allowed in routes where the next hop type is VirtualAppliance. - * - * @return the nextHopIpAddress value. - */ - public String nextHopIpAddress() { - return this.innerProperties() == null ? null : this.innerProperties().nextHopIpAddress(); - } - - /** - * Set the nextHopIpAddress property: The IP address packets should be forwarded to. Next hop values are only - * allowed in routes where the next hop type is VirtualAppliance. - * - * @param nextHopIpAddress the nextHopIpAddress value to set. - * @return the RouteInner object itself. - */ - public RouteInner withNextHopIpAddress(String nextHopIpAddress) { - if (this.innerProperties() == null) { - this.innerProperties = new RoutePropertiesFormat(); - } - this.innerProperties().withNextHopIpAddress(nextHopIpAddress); - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Set the provisioningState property: The provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * - * @param provisioningState the provisioningState value to set. - * @return the RouteInner object itself. - */ - public RouteInner withProvisioningState(String provisioningState) { - if (this.innerProperties() == null) { - this.innerProperties = new RoutePropertiesFormat(); - } - this.innerProperties().withProvisioningState(provisioningState); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/RoutePropertiesFormat.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/RoutePropertiesFormat.java deleted file mode 100644 index 13a74b432169..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/RoutePropertiesFormat.java +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.RouteNextHopType; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Route resource. */ -@Fluent -public final class RoutePropertiesFormat { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RoutePropertiesFormat.class); - - /* - * The destination CIDR to which the route applies. - */ - @JsonProperty(value = "addressPrefix") - private String addressPrefix; - - /* - * The type of Azure hop the packet should be sent to. Possible values are: - * 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', - * and 'None' - */ - @JsonProperty(value = "nextHopType", required = true) - private RouteNextHopType nextHopType; - - /* - * The IP address packets should be forwarded to. Next hop values are only - * allowed in routes where the next hop type is VirtualAppliance. - */ - @JsonProperty(value = "nextHopIpAddress") - private String nextHopIpAddress; - - /* - * The provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - */ - @JsonProperty(value = "provisioningState") - private String provisioningState; - - /** - * Get the addressPrefix property: The destination CIDR to which the route applies. - * - * @return the addressPrefix value. - */ - public String addressPrefix() { - return this.addressPrefix; - } - - /** - * Set the addressPrefix property: The destination CIDR to which the route applies. - * - * @param addressPrefix the addressPrefix value to set. - * @return the RoutePropertiesFormat object itself. - */ - public RoutePropertiesFormat withAddressPrefix(String addressPrefix) { - this.addressPrefix = addressPrefix; - return this; - } - - /** - * Get the nextHopType property: The type of Azure hop the packet should be sent to. Possible values are: - * 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'. - * - * @return the nextHopType value. - */ - public RouteNextHopType nextHopType() { - return this.nextHopType; - } - - /** - * Set the nextHopType property: The type of Azure hop the packet should be sent to. Possible values are: - * 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'. - * - * @param nextHopType the nextHopType value to set. - * @return the RoutePropertiesFormat object itself. - */ - public RoutePropertiesFormat withNextHopType(RouteNextHopType nextHopType) { - this.nextHopType = nextHopType; - return this; - } - - /** - * Get the nextHopIpAddress property: The IP address packets should be forwarded to. Next hop values are only - * allowed in routes where the next hop type is VirtualAppliance. - * - * @return the nextHopIpAddress value. - */ - public String nextHopIpAddress() { - return this.nextHopIpAddress; - } - - /** - * Set the nextHopIpAddress property: The IP address packets should be forwarded to. Next hop values are only - * allowed in routes where the next hop type is VirtualAppliance. - * - * @param nextHopIpAddress the nextHopIpAddress value to set. - * @return the RoutePropertiesFormat object itself. - */ - public RoutePropertiesFormat withNextHopIpAddress(String nextHopIpAddress) { - this.nextHopIpAddress = nextHopIpAddress; - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Set the provisioningState property: The provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * - * @param provisioningState the provisioningState value to set. - * @return the RoutePropertiesFormat object itself. - */ - public RoutePropertiesFormat withProvisioningState(String provisioningState) { - this.provisioningState = provisioningState; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (nextHopType() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property nextHopType in model RoutePropertiesFormat")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/RouteTableInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/RouteTableInner.java deleted file mode 100644 index 35ec542135a1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/RouteTableInner.java +++ /dev/null @@ -1,194 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** Route table resource. */ -@Fluent -public final class RouteTableInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RouteTableInner.class); - - /* - * Properties of the route table. - */ - @JsonProperty(value = "properties") - private RouteTablePropertiesFormat innerProperties; - - /* - * Gets a unique read-only string that changes whenever the resource is - * updated. - */ - @JsonProperty(value = "etag") - private String etag; - - /* - * Resource ID. - */ - @JsonProperty(value = "id") - private String id; - - /** - * Get the innerProperties property: Properties of the route table. - * - * @return the innerProperties value. - */ - private RouteTablePropertiesFormat innerProperties() { - return this.innerProperties; - } - - /** - * Get the etag property: Gets a unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: Gets a unique read-only string that changes whenever the resource is updated. - * - * @param etag the etag value to set. - * @return the RouteTableInner object itself. - */ - public RouteTableInner withEtag(String etag) { - this.etag = etag; - return this; - } - - /** - * Get the id property: Resource ID. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: Resource ID. - * - * @param id the id value to set. - * @return the RouteTableInner object itself. - */ - public RouteTableInner withId(String id) { - this.id = id; - return this; - } - - /** {@inheritDoc} */ - @Override - public RouteTableInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public RouteTableInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the routes property: Collection of routes contained within a route table. - * - * @return the routes value. - */ - public List routes() { - return this.innerProperties() == null ? null : this.innerProperties().routes(); - } - - /** - * Set the routes property: Collection of routes contained within a route table. - * - * @param routes the routes value to set. - * @return the RouteTableInner object itself. - */ - public RouteTableInner withRoutes(List routes) { - if (this.innerProperties() == null) { - this.innerProperties = new RouteTablePropertiesFormat(); - } - this.innerProperties().withRoutes(routes); - return this; - } - - /** - * Get the subnets property: A collection of references to subnets. - * - * @return the subnets value. - */ - public List subnets() { - return this.innerProperties() == null ? null : this.innerProperties().subnets(); - } - - /** - * Get the disableBgpRoutePropagation property: Gets or sets whether to disable the routes learned by BGP on that - * route table. True means disable. - * - * @return the disableBgpRoutePropagation value. - */ - public Boolean disableBgpRoutePropagation() { - return this.innerProperties() == null ? null : this.innerProperties().disableBgpRoutePropagation(); - } - - /** - * Set the disableBgpRoutePropagation property: Gets or sets whether to disable the routes learned by BGP on that - * route table. True means disable. - * - * @param disableBgpRoutePropagation the disableBgpRoutePropagation value to set. - * @return the RouteTableInner object itself. - */ - public RouteTableInner withDisableBgpRoutePropagation(Boolean disableBgpRoutePropagation) { - if (this.innerProperties() == null) { - this.innerProperties = new RouteTablePropertiesFormat(); - } - this.innerProperties().withDisableBgpRoutePropagation(disableBgpRoutePropagation); - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Set the provisioningState property: The provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * - * @param provisioningState the provisioningState value to set. - * @return the RouteTableInner object itself. - */ - public RouteTableInner withProvisioningState(String provisioningState) { - if (this.innerProperties() == null) { - this.innerProperties = new RouteTablePropertiesFormat(); - } - this.innerProperties().withProvisioningState(provisioningState); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/RouteTablePropertiesFormat.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/RouteTablePropertiesFormat.java deleted file mode 100644 index 40ddc3b87569..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/RouteTablePropertiesFormat.java +++ /dev/null @@ -1,130 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Route Table resource. */ -@Fluent -public final class RouteTablePropertiesFormat { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RouteTablePropertiesFormat.class); - - /* - * Collection of routes contained within a route table. - */ - @JsonProperty(value = "routes") - private List routes; - - /* - * A collection of references to subnets. - */ - @JsonProperty(value = "subnets", access = JsonProperty.Access.WRITE_ONLY) - private List subnets; - - /* - * Gets or sets whether to disable the routes learned by BGP on that route - * table. True means disable. - */ - @JsonProperty(value = "disableBgpRoutePropagation") - private Boolean disableBgpRoutePropagation; - - /* - * The provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - */ - @JsonProperty(value = "provisioningState") - private String provisioningState; - - /** - * Get the routes property: Collection of routes contained within a route table. - * - * @return the routes value. - */ - public List routes() { - return this.routes; - } - - /** - * Set the routes property: Collection of routes contained within a route table. - * - * @param routes the routes value to set. - * @return the RouteTablePropertiesFormat object itself. - */ - public RouteTablePropertiesFormat withRoutes(List routes) { - this.routes = routes; - return this; - } - - /** - * Get the subnets property: A collection of references to subnets. - * - * @return the subnets value. - */ - public List subnets() { - return this.subnets; - } - - /** - * Get the disableBgpRoutePropagation property: Gets or sets whether to disable the routes learned by BGP on that - * route table. True means disable. - * - * @return the disableBgpRoutePropagation value. - */ - public Boolean disableBgpRoutePropagation() { - return this.disableBgpRoutePropagation; - } - - /** - * Set the disableBgpRoutePropagation property: Gets or sets whether to disable the routes learned by BGP on that - * route table. True means disable. - * - * @param disableBgpRoutePropagation the disableBgpRoutePropagation value to set. - * @return the RouteTablePropertiesFormat object itself. - */ - public RouteTablePropertiesFormat withDisableBgpRoutePropagation(Boolean disableBgpRoutePropagation) { - this.disableBgpRoutePropagation = disableBgpRoutePropagation; - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Set the provisioningState property: The provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * - * @param provisioningState the provisioningState value to set. - * @return the RouteTablePropertiesFormat object itself. - */ - public RouteTablePropertiesFormat withProvisioningState(String provisioningState) { - this.provisioningState = provisioningState; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (routes() != null) { - routes().forEach(e -> e.validate()); - } - if (subnets() != null) { - subnets().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/SecurityGroupViewResultInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/SecurityGroupViewResultInner.java deleted file mode 100644 index 3761bad6ed36..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/SecurityGroupViewResultInner.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.SecurityGroupNetworkInterface; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The information about security rules applied to the specified VM. */ -@Fluent -public final class SecurityGroupViewResultInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SecurityGroupViewResultInner.class); - - /* - * List of network interfaces on the specified VM. - */ - @JsonProperty(value = "networkInterfaces") - private List networkInterfaces; - - /** - * Get the networkInterfaces property: List of network interfaces on the specified VM. - * - * @return the networkInterfaces value. - */ - public List networkInterfaces() { - return this.networkInterfaces; - } - - /** - * Set the networkInterfaces property: List of network interfaces on the specified VM. - * - * @param networkInterfaces the networkInterfaces value to set. - * @return the SecurityGroupViewResultInner object itself. - */ - public SecurityGroupViewResultInner withNetworkInterfaces(List networkInterfaces) { - this.networkInterfaces = networkInterfaces; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (networkInterfaces() != null) { - networkInterfaces().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/SecurityRuleInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/SecurityRuleInner.java deleted file mode 100644 index 07b8a613cb0e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/SecurityRuleInner.java +++ /dev/null @@ -1,499 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.SecurityRuleAccess; -import com.azure.resourcemanager.network.models.SecurityRuleDirection; -import com.azure.resourcemanager.network.models.SecurityRuleProtocol; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Network security rule. */ -@Fluent -public final class SecurityRuleInner extends SubResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SecurityRuleInner.class); - - /* - * Properties of the security rule - */ - @JsonProperty(value = "properties") - private SecurityRulePropertiesFormat innerProperties; - - /* - * The name of the resource that is unique within a resource group. This - * name can be used to access the resource. - */ - @JsonProperty(value = "name") - private String name; - - /* - * A unique read-only string that changes whenever the resource is updated. - */ - @JsonProperty(value = "etag") - private String etag; - - /** - * Get the innerProperties property: Properties of the security rule. - * - * @return the innerProperties value. - */ - private SecurityRulePropertiesFormat innerProperties() { - return this.innerProperties; - } - - /** - * Get the name property: The name of the resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @param name the name value to set. - * @return the SecurityRuleInner object itself. - */ - public SecurityRuleInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @param etag the etag value to set. - * @return the SecurityRuleInner object itself. - */ - public SecurityRuleInner withEtag(String etag) { - this.etag = etag; - return this; - } - - /** {@inheritDoc} */ - @Override - public SecurityRuleInner withId(String id) { - super.withId(id); - return this; - } - - /** - * Get the description property: A description for this rule. Restricted to 140 chars. - * - * @return the description value. - */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); - } - - /** - * Set the description property: A description for this rule. Restricted to 140 chars. - * - * @param description the description value to set. - * @return the SecurityRuleInner object itself. - */ - public SecurityRuleInner withDescription(String description) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityRulePropertiesFormat(); - } - this.innerProperties().withDescription(description); - return this; - } - - /** - * Get the protocol property: Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'. - * - * @return the protocol value. - */ - public SecurityRuleProtocol protocol() { - return this.innerProperties() == null ? null : this.innerProperties().protocol(); - } - - /** - * Set the protocol property: Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'. - * - * @param protocol the protocol value to set. - * @return the SecurityRuleInner object itself. - */ - public SecurityRuleInner withProtocol(SecurityRuleProtocol protocol) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityRulePropertiesFormat(); - } - this.innerProperties().withProtocol(protocol); - return this; - } - - /** - * Get the sourcePortRange property: The source port or range. Integer or range between 0 and 65535. Asterisks '*' - * can also be used to match all ports. - * - * @return the sourcePortRange value. - */ - public String sourcePortRange() { - return this.innerProperties() == null ? null : this.innerProperties().sourcePortRange(); - } - - /** - * Set the sourcePortRange property: The source port or range. Integer or range between 0 and 65535. Asterisks '*' - * can also be used to match all ports. - * - * @param sourcePortRange the sourcePortRange value to set. - * @return the SecurityRuleInner object itself. - */ - public SecurityRuleInner withSourcePortRange(String sourcePortRange) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityRulePropertiesFormat(); - } - this.innerProperties().withSourcePortRange(sourcePortRange); - return this; - } - - /** - * Get the destinationPortRange property: The destination port or range. Integer or range between 0 and 65535. - * Asterisks '*' can also be used to match all ports. - * - * @return the destinationPortRange value. - */ - public String destinationPortRange() { - return this.innerProperties() == null ? null : this.innerProperties().destinationPortRange(); - } - - /** - * Set the destinationPortRange property: The destination port or range. Integer or range between 0 and 65535. - * Asterisks '*' can also be used to match all ports. - * - * @param destinationPortRange the destinationPortRange value to set. - * @return the SecurityRuleInner object itself. - */ - public SecurityRuleInner withDestinationPortRange(String destinationPortRange) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityRulePropertiesFormat(); - } - this.innerProperties().withDestinationPortRange(destinationPortRange); - return this; - } - - /** - * Get the sourceAddressPrefix property: The CIDR or source IP range. Asterisks '*' can also be used to match all - * source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this - * is an ingress rule, specifies where network traffic originates from. - * - * @return the sourceAddressPrefix value. - */ - public String sourceAddressPrefix() { - return this.innerProperties() == null ? null : this.innerProperties().sourceAddressPrefix(); - } - - /** - * Set the sourceAddressPrefix property: The CIDR or source IP range. Asterisks '*' can also be used to match all - * source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this - * is an ingress rule, specifies where network traffic originates from. - * - * @param sourceAddressPrefix the sourceAddressPrefix value to set. - * @return the SecurityRuleInner object itself. - */ - public SecurityRuleInner withSourceAddressPrefix(String sourceAddressPrefix) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityRulePropertiesFormat(); - } - this.innerProperties().withSourceAddressPrefix(sourceAddressPrefix); - return this; - } - - /** - * Get the sourceAddressPrefixes property: The CIDR or source IP ranges. - * - * @return the sourceAddressPrefixes value. - */ - public List sourceAddressPrefixes() { - return this.innerProperties() == null ? null : this.innerProperties().sourceAddressPrefixes(); - } - - /** - * Set the sourceAddressPrefixes property: The CIDR or source IP ranges. - * - * @param sourceAddressPrefixes the sourceAddressPrefixes value to set. - * @return the SecurityRuleInner object itself. - */ - public SecurityRuleInner withSourceAddressPrefixes(List sourceAddressPrefixes) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityRulePropertiesFormat(); - } - this.innerProperties().withSourceAddressPrefixes(sourceAddressPrefixes); - return this; - } - - /** - * Get the sourceApplicationSecurityGroups property: The application security group specified as source. - * - * @return the sourceApplicationSecurityGroups value. - */ - public List sourceApplicationSecurityGroups() { - return this.innerProperties() == null ? null : this.innerProperties().sourceApplicationSecurityGroups(); - } - - /** - * Set the sourceApplicationSecurityGroups property: The application security group specified as source. - * - * @param sourceApplicationSecurityGroups the sourceApplicationSecurityGroups value to set. - * @return the SecurityRuleInner object itself. - */ - public SecurityRuleInner withSourceApplicationSecurityGroups( - List sourceApplicationSecurityGroups) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityRulePropertiesFormat(); - } - this.innerProperties().withSourceApplicationSecurityGroups(sourceApplicationSecurityGroups); - return this; - } - - /** - * Get the destinationAddressPrefix property: The destination address prefix. CIDR or destination IP range. - * Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', - * 'AzureLoadBalancer' and 'Internet' can also be used. - * - * @return the destinationAddressPrefix value. - */ - public String destinationAddressPrefix() { - return this.innerProperties() == null ? null : this.innerProperties().destinationAddressPrefix(); - } - - /** - * Set the destinationAddressPrefix property: The destination address prefix. CIDR or destination IP range. - * Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', - * 'AzureLoadBalancer' and 'Internet' can also be used. - * - * @param destinationAddressPrefix the destinationAddressPrefix value to set. - * @return the SecurityRuleInner object itself. - */ - public SecurityRuleInner withDestinationAddressPrefix(String destinationAddressPrefix) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityRulePropertiesFormat(); - } - this.innerProperties().withDestinationAddressPrefix(destinationAddressPrefix); - return this; - } - - /** - * Get the destinationAddressPrefixes property: The destination address prefixes. CIDR or destination IP ranges. - * - * @return the destinationAddressPrefixes value. - */ - public List destinationAddressPrefixes() { - return this.innerProperties() == null ? null : this.innerProperties().destinationAddressPrefixes(); - } - - /** - * Set the destinationAddressPrefixes property: The destination address prefixes. CIDR or destination IP ranges. - * - * @param destinationAddressPrefixes the destinationAddressPrefixes value to set. - * @return the SecurityRuleInner object itself. - */ - public SecurityRuleInner withDestinationAddressPrefixes(List destinationAddressPrefixes) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityRulePropertiesFormat(); - } - this.innerProperties().withDestinationAddressPrefixes(destinationAddressPrefixes); - return this; - } - - /** - * Get the destinationApplicationSecurityGroups property: The application security group specified as destination. - * - * @return the destinationApplicationSecurityGroups value. - */ - public List destinationApplicationSecurityGroups() { - return this.innerProperties() == null ? null : this.innerProperties().destinationApplicationSecurityGroups(); - } - - /** - * Set the destinationApplicationSecurityGroups property: The application security group specified as destination. - * - * @param destinationApplicationSecurityGroups the destinationApplicationSecurityGroups value to set. - * @return the SecurityRuleInner object itself. - */ - public SecurityRuleInner withDestinationApplicationSecurityGroups( - List destinationApplicationSecurityGroups) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityRulePropertiesFormat(); - } - this.innerProperties().withDestinationApplicationSecurityGroups(destinationApplicationSecurityGroups); - return this; - } - - /** - * Get the sourcePortRanges property: The source port ranges. - * - * @return the sourcePortRanges value. - */ - public List sourcePortRanges() { - return this.innerProperties() == null ? null : this.innerProperties().sourcePortRanges(); - } - - /** - * Set the sourcePortRanges property: The source port ranges. - * - * @param sourcePortRanges the sourcePortRanges value to set. - * @return the SecurityRuleInner object itself. - */ - public SecurityRuleInner withSourcePortRanges(List sourcePortRanges) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityRulePropertiesFormat(); - } - this.innerProperties().withSourcePortRanges(sourcePortRanges); - return this; - } - - /** - * Get the destinationPortRanges property: The destination port ranges. - * - * @return the destinationPortRanges value. - */ - public List destinationPortRanges() { - return this.innerProperties() == null ? null : this.innerProperties().destinationPortRanges(); - } - - /** - * Set the destinationPortRanges property: The destination port ranges. - * - * @param destinationPortRanges the destinationPortRanges value to set. - * @return the SecurityRuleInner object itself. - */ - public SecurityRuleInner withDestinationPortRanges(List destinationPortRanges) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityRulePropertiesFormat(); - } - this.innerProperties().withDestinationPortRanges(destinationPortRanges); - return this; - } - - /** - * Get the access property: The network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'. - * - * @return the access value. - */ - public SecurityRuleAccess access() { - return this.innerProperties() == null ? null : this.innerProperties().access(); - } - - /** - * Set the access property: The network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'. - * - * @param access the access value to set. - * @return the SecurityRuleInner object itself. - */ - public SecurityRuleInner withAccess(SecurityRuleAccess access) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityRulePropertiesFormat(); - } - this.innerProperties().withAccess(access); - return this; - } - - /** - * Get the priority property: The priority of the rule. The value can be between 100 and 4096. The priority number - * must be unique for each rule in the collection. The lower the priority number, the higher the priority of the - * rule. - * - * @return the priority value. - */ - public Integer priority() { - return this.innerProperties() == null ? null : this.innerProperties().priority(); - } - - /** - * Set the priority property: The priority of the rule. The value can be between 100 and 4096. The priority number - * must be unique for each rule in the collection. The lower the priority number, the higher the priority of the - * rule. - * - * @param priority the priority value to set. - * @return the SecurityRuleInner object itself. - */ - public SecurityRuleInner withPriority(Integer priority) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityRulePropertiesFormat(); - } - this.innerProperties().withPriority(priority); - return this; - } - - /** - * Get the direction property: The direction of the rule. The direction specifies if rule will be evaluated on - * incoming or outgoing traffic. Possible values are: 'Inbound' and 'Outbound'. - * - * @return the direction value. - */ - public SecurityRuleDirection direction() { - return this.innerProperties() == null ? null : this.innerProperties().direction(); - } - - /** - * Set the direction property: The direction of the rule. The direction specifies if rule will be evaluated on - * incoming or outgoing traffic. Possible values are: 'Inbound' and 'Outbound'. - * - * @param direction the direction value to set. - * @return the SecurityRuleInner object itself. - */ - public SecurityRuleInner withDirection(SecurityRuleDirection direction) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityRulePropertiesFormat(); - } - this.innerProperties().withDirection(direction); - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Set the provisioningState property: The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param provisioningState the provisioningState value to set. - * @return the SecurityRuleInner object itself. - */ - public SecurityRuleInner withProvisioningState(String provisioningState) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityRulePropertiesFormat(); - } - this.innerProperties().withProvisioningState(provisioningState); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/SecurityRulePropertiesFormat.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/SecurityRulePropertiesFormat.java deleted file mode 100644 index b57d7a441770..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/SecurityRulePropertiesFormat.java +++ /dev/null @@ -1,504 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.SecurityRuleAccess; -import com.azure.resourcemanager.network.models.SecurityRuleDirection; -import com.azure.resourcemanager.network.models.SecurityRuleProtocol; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Security rule resource. */ -@Fluent -public final class SecurityRulePropertiesFormat { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SecurityRulePropertiesFormat.class); - - /* - * A description for this rule. Restricted to 140 chars. - */ - @JsonProperty(value = "description") - private String description; - - /* - * Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', - * and '*'. - */ - @JsonProperty(value = "protocol", required = true) - private SecurityRuleProtocol protocol; - - /* - * The source port or range. Integer or range between 0 and 65535. - * Asterisks '*' can also be used to match all ports. - */ - @JsonProperty(value = "sourcePortRange") - private String sourcePortRange; - - /* - * The destination port or range. Integer or range between 0 and 65535. - * Asterisks '*' can also be used to match all ports. - */ - @JsonProperty(value = "destinationPortRange") - private String destinationPortRange; - - /* - * The CIDR or source IP range. Asterisks '*' can also be used to match all - * source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' - * and 'Internet' can also be used. If this is an ingress rule, specifies - * where network traffic originates from. - */ - @JsonProperty(value = "sourceAddressPrefix") - private String sourceAddressPrefix; - - /* - * The CIDR or source IP ranges. - */ - @JsonProperty(value = "sourceAddressPrefixes") - private List sourceAddressPrefixes; - - /* - * The application security group specified as source. - */ - @JsonProperty(value = "sourceApplicationSecurityGroups") - private List sourceApplicationSecurityGroups; - - /* - * The destination address prefix. CIDR or destination IP range. Asterisks - * '*' can also be used to match all source IPs. Default tags such as - * 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. - */ - @JsonProperty(value = "destinationAddressPrefix") - private String destinationAddressPrefix; - - /* - * The destination address prefixes. CIDR or destination IP ranges. - */ - @JsonProperty(value = "destinationAddressPrefixes") - private List destinationAddressPrefixes; - - /* - * The application security group specified as destination. - */ - @JsonProperty(value = "destinationApplicationSecurityGroups") - private List destinationApplicationSecurityGroups; - - /* - * The source port ranges. - */ - @JsonProperty(value = "sourcePortRanges") - private List sourcePortRanges; - - /* - * The destination port ranges. - */ - @JsonProperty(value = "destinationPortRanges") - private List destinationPortRanges; - - /* - * The network traffic is allowed or denied. Possible values are: 'Allow' - * and 'Deny'. - */ - @JsonProperty(value = "access", required = true) - private SecurityRuleAccess access; - - /* - * The priority of the rule. The value can be between 100 and 4096. The - * priority number must be unique for each rule in the collection. The - * lower the priority number, the higher the priority of the rule. - */ - @JsonProperty(value = "priority") - private Integer priority; - - /* - * The direction of the rule. The direction specifies if rule will be - * evaluated on incoming or outgoing traffic. Possible values are: - * 'Inbound' and 'Outbound'. - */ - @JsonProperty(value = "direction", required = true) - private SecurityRuleDirection direction; - - /* - * The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - */ - @JsonProperty(value = "provisioningState") - private String provisioningState; - - /** - * Get the description property: A description for this rule. Restricted to 140 chars. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: A description for this rule. Restricted to 140 chars. - * - * @param description the description value to set. - * @return the SecurityRulePropertiesFormat object itself. - */ - public SecurityRulePropertiesFormat withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the protocol property: Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'. - * - * @return the protocol value. - */ - public SecurityRuleProtocol protocol() { - return this.protocol; - } - - /** - * Set the protocol property: Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'. - * - * @param protocol the protocol value to set. - * @return the SecurityRulePropertiesFormat object itself. - */ - public SecurityRulePropertiesFormat withProtocol(SecurityRuleProtocol protocol) { - this.protocol = protocol; - return this; - } - - /** - * Get the sourcePortRange property: The source port or range. Integer or range between 0 and 65535. Asterisks '*' - * can also be used to match all ports. - * - * @return the sourcePortRange value. - */ - public String sourcePortRange() { - return this.sourcePortRange; - } - - /** - * Set the sourcePortRange property: The source port or range. Integer or range between 0 and 65535. Asterisks '*' - * can also be used to match all ports. - * - * @param sourcePortRange the sourcePortRange value to set. - * @return the SecurityRulePropertiesFormat object itself. - */ - public SecurityRulePropertiesFormat withSourcePortRange(String sourcePortRange) { - this.sourcePortRange = sourcePortRange; - return this; - } - - /** - * Get the destinationPortRange property: The destination port or range. Integer or range between 0 and 65535. - * Asterisks '*' can also be used to match all ports. - * - * @return the destinationPortRange value. - */ - public String destinationPortRange() { - return this.destinationPortRange; - } - - /** - * Set the destinationPortRange property: The destination port or range. Integer or range between 0 and 65535. - * Asterisks '*' can also be used to match all ports. - * - * @param destinationPortRange the destinationPortRange value to set. - * @return the SecurityRulePropertiesFormat object itself. - */ - public SecurityRulePropertiesFormat withDestinationPortRange(String destinationPortRange) { - this.destinationPortRange = destinationPortRange; - return this; - } - - /** - * Get the sourceAddressPrefix property: The CIDR or source IP range. Asterisks '*' can also be used to match all - * source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this - * is an ingress rule, specifies where network traffic originates from. - * - * @return the sourceAddressPrefix value. - */ - public String sourceAddressPrefix() { - return this.sourceAddressPrefix; - } - - /** - * Set the sourceAddressPrefix property: The CIDR or source IP range. Asterisks '*' can also be used to match all - * source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this - * is an ingress rule, specifies where network traffic originates from. - * - * @param sourceAddressPrefix the sourceAddressPrefix value to set. - * @return the SecurityRulePropertiesFormat object itself. - */ - public SecurityRulePropertiesFormat withSourceAddressPrefix(String sourceAddressPrefix) { - this.sourceAddressPrefix = sourceAddressPrefix; - return this; - } - - /** - * Get the sourceAddressPrefixes property: The CIDR or source IP ranges. - * - * @return the sourceAddressPrefixes value. - */ - public List sourceAddressPrefixes() { - return this.sourceAddressPrefixes; - } - - /** - * Set the sourceAddressPrefixes property: The CIDR or source IP ranges. - * - * @param sourceAddressPrefixes the sourceAddressPrefixes value to set. - * @return the SecurityRulePropertiesFormat object itself. - */ - public SecurityRulePropertiesFormat withSourceAddressPrefixes(List sourceAddressPrefixes) { - this.sourceAddressPrefixes = sourceAddressPrefixes; - return this; - } - - /** - * Get the sourceApplicationSecurityGroups property: The application security group specified as source. - * - * @return the sourceApplicationSecurityGroups value. - */ - public List sourceApplicationSecurityGroups() { - return this.sourceApplicationSecurityGroups; - } - - /** - * Set the sourceApplicationSecurityGroups property: The application security group specified as source. - * - * @param sourceApplicationSecurityGroups the sourceApplicationSecurityGroups value to set. - * @return the SecurityRulePropertiesFormat object itself. - */ - public SecurityRulePropertiesFormat withSourceApplicationSecurityGroups( - List sourceApplicationSecurityGroups) { - this.sourceApplicationSecurityGroups = sourceApplicationSecurityGroups; - return this; - } - - /** - * Get the destinationAddressPrefix property: The destination address prefix. CIDR or destination IP range. - * Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', - * 'AzureLoadBalancer' and 'Internet' can also be used. - * - * @return the destinationAddressPrefix value. - */ - public String destinationAddressPrefix() { - return this.destinationAddressPrefix; - } - - /** - * Set the destinationAddressPrefix property: The destination address prefix. CIDR or destination IP range. - * Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', - * 'AzureLoadBalancer' and 'Internet' can also be used. - * - * @param destinationAddressPrefix the destinationAddressPrefix value to set. - * @return the SecurityRulePropertiesFormat object itself. - */ - public SecurityRulePropertiesFormat withDestinationAddressPrefix(String destinationAddressPrefix) { - this.destinationAddressPrefix = destinationAddressPrefix; - return this; - } - - /** - * Get the destinationAddressPrefixes property: The destination address prefixes. CIDR or destination IP ranges. - * - * @return the destinationAddressPrefixes value. - */ - public List destinationAddressPrefixes() { - return this.destinationAddressPrefixes; - } - - /** - * Set the destinationAddressPrefixes property: The destination address prefixes. CIDR or destination IP ranges. - * - * @param destinationAddressPrefixes the destinationAddressPrefixes value to set. - * @return the SecurityRulePropertiesFormat object itself. - */ - public SecurityRulePropertiesFormat withDestinationAddressPrefixes(List destinationAddressPrefixes) { - this.destinationAddressPrefixes = destinationAddressPrefixes; - return this; - } - - /** - * Get the destinationApplicationSecurityGroups property: The application security group specified as destination. - * - * @return the destinationApplicationSecurityGroups value. - */ - public List destinationApplicationSecurityGroups() { - return this.destinationApplicationSecurityGroups; - } - - /** - * Set the destinationApplicationSecurityGroups property: The application security group specified as destination. - * - * @param destinationApplicationSecurityGroups the destinationApplicationSecurityGroups value to set. - * @return the SecurityRulePropertiesFormat object itself. - */ - public SecurityRulePropertiesFormat withDestinationApplicationSecurityGroups( - List destinationApplicationSecurityGroups) { - this.destinationApplicationSecurityGroups = destinationApplicationSecurityGroups; - return this; - } - - /** - * Get the sourcePortRanges property: The source port ranges. - * - * @return the sourcePortRanges value. - */ - public List sourcePortRanges() { - return this.sourcePortRanges; - } - - /** - * Set the sourcePortRanges property: The source port ranges. - * - * @param sourcePortRanges the sourcePortRanges value to set. - * @return the SecurityRulePropertiesFormat object itself. - */ - public SecurityRulePropertiesFormat withSourcePortRanges(List sourcePortRanges) { - this.sourcePortRanges = sourcePortRanges; - return this; - } - - /** - * Get the destinationPortRanges property: The destination port ranges. - * - * @return the destinationPortRanges value. - */ - public List destinationPortRanges() { - return this.destinationPortRanges; - } - - /** - * Set the destinationPortRanges property: The destination port ranges. - * - * @param destinationPortRanges the destinationPortRanges value to set. - * @return the SecurityRulePropertiesFormat object itself. - */ - public SecurityRulePropertiesFormat withDestinationPortRanges(List destinationPortRanges) { - this.destinationPortRanges = destinationPortRanges; - return this; - } - - /** - * Get the access property: The network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'. - * - * @return the access value. - */ - public SecurityRuleAccess access() { - return this.access; - } - - /** - * Set the access property: The network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'. - * - * @param access the access value to set. - * @return the SecurityRulePropertiesFormat object itself. - */ - public SecurityRulePropertiesFormat withAccess(SecurityRuleAccess access) { - this.access = access; - return this; - } - - /** - * Get the priority property: The priority of the rule. The value can be between 100 and 4096. The priority number - * must be unique for each rule in the collection. The lower the priority number, the higher the priority of the - * rule. - * - * @return the priority value. - */ - public Integer priority() { - return this.priority; - } - - /** - * Set the priority property: The priority of the rule. The value can be between 100 and 4096. The priority number - * must be unique for each rule in the collection. The lower the priority number, the higher the priority of the - * rule. - * - * @param priority the priority value to set. - * @return the SecurityRulePropertiesFormat object itself. - */ - public SecurityRulePropertiesFormat withPriority(Integer priority) { - this.priority = priority; - return this; - } - - /** - * Get the direction property: The direction of the rule. The direction specifies if rule will be evaluated on - * incoming or outgoing traffic. Possible values are: 'Inbound' and 'Outbound'. - * - * @return the direction value. - */ - public SecurityRuleDirection direction() { - return this.direction; - } - - /** - * Set the direction property: The direction of the rule. The direction specifies if rule will be evaluated on - * incoming or outgoing traffic. Possible values are: 'Inbound' and 'Outbound'. - * - * @param direction the direction value to set. - * @return the SecurityRulePropertiesFormat object itself. - */ - public SecurityRulePropertiesFormat withDirection(SecurityRuleDirection direction) { - this.direction = direction; - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Set the provisioningState property: The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param provisioningState the provisioningState value to set. - * @return the SecurityRulePropertiesFormat object itself. - */ - public SecurityRulePropertiesFormat withProvisioningState(String provisioningState) { - this.provisioningState = provisioningState; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (protocol() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property protocol in model SecurityRulePropertiesFormat")); - } - if (sourceApplicationSecurityGroups() != null) { - sourceApplicationSecurityGroups().forEach(e -> e.validate()); - } - if (destinationApplicationSecurityGroups() != null) { - destinationApplicationSecurityGroups().forEach(e -> e.validate()); - } - if (access() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property access in model SecurityRulePropertiesFormat")); - } - if (direction() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property direction in model SecurityRulePropertiesFormat")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ServiceAssociationLinkPropertiesFormat.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ServiceAssociationLinkPropertiesFormat.java deleted file mode 100644 index c5e23781eb12..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ServiceAssociationLinkPropertiesFormat.java +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Properties of ServiceAssociationLink. */ -@Fluent -public final class ServiceAssociationLinkPropertiesFormat { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceAssociationLinkPropertiesFormat.class); - - /* - * Resource type of the linked resource. - */ - @JsonProperty(value = "linkedResourceType") - private String linkedResourceType; - - /* - * Link to the external resource. - */ - @JsonProperty(value = "link") - private String link; - - /* - * Provisioning state of the ServiceAssociationLink resource. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; - - /** - * Get the linkedResourceType property: Resource type of the linked resource. - * - * @return the linkedResourceType value. - */ - public String linkedResourceType() { - return this.linkedResourceType; - } - - /** - * Set the linkedResourceType property: Resource type of the linked resource. - * - * @param linkedResourceType the linkedResourceType value to set. - * @return the ServiceAssociationLinkPropertiesFormat object itself. - */ - public ServiceAssociationLinkPropertiesFormat withLinkedResourceType(String linkedResourceType) { - this.linkedResourceType = linkedResourceType; - return this; - } - - /** - * Get the link property: Link to the external resource. - * - * @return the link value. - */ - public String link() { - return this.link; - } - - /** - * Set the link property: Link to the external resource. - * - * @param link the link value to set. - * @return the ServiceAssociationLinkPropertiesFormat object itself. - */ - public ServiceAssociationLinkPropertiesFormat withLink(String link) { - this.link = link; - return this; - } - - /** - * Get the provisioningState property: Provisioning state of the ServiceAssociationLink resource. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ServiceDelegationPropertiesFormat.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ServiceDelegationPropertiesFormat.java deleted file mode 100644 index 5119453de315..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ServiceDelegationPropertiesFormat.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Properties of a service delegation. */ -@Fluent -public final class ServiceDelegationPropertiesFormat { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceDelegationPropertiesFormat.class); - - /* - * The name of the service to whom the subnet should be delegated (e.g. - * Microsoft.Sql/servers) - */ - @JsonProperty(value = "serviceName") - private String serviceName; - - /* - * Describes the actions permitted to the service upon delegation - */ - @JsonProperty(value = "actions") - private List actions; - - /* - * The provisioning state of the resource. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; - - /** - * Get the serviceName property: The name of the service to whom the subnet should be delegated (e.g. - * Microsoft.Sql/servers). - * - * @return the serviceName value. - */ - public String serviceName() { - return this.serviceName; - } - - /** - * Set the serviceName property: The name of the service to whom the subnet should be delegated (e.g. - * Microsoft.Sql/servers). - * - * @param serviceName the serviceName value to set. - * @return the ServiceDelegationPropertiesFormat object itself. - */ - public ServiceDelegationPropertiesFormat withServiceName(String serviceName) { - this.serviceName = serviceName; - return this; - } - - /** - * Get the actions property: Describes the actions permitted to the service upon delegation. - * - * @return the actions value. - */ - public List actions() { - return this.actions; - } - - /** - * Set the actions property: Describes the actions permitted to the service upon delegation. - * - * @param actions the actions value to set. - * @return the ServiceDelegationPropertiesFormat object itself. - */ - public ServiceDelegationPropertiesFormat withActions(List actions) { - this.actions = actions; - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the resource. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ServiceEndpointPolicyDefinitionInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ServiceEndpointPolicyDefinitionInner.java deleted file mode 100644 index 0b95d6b26154..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ServiceEndpointPolicyDefinitionInner.java +++ /dev/null @@ -1,185 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Service Endpoint policy definitions. */ -@Fluent -public final class ServiceEndpointPolicyDefinitionInner extends SubResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceEndpointPolicyDefinitionInner.class); - - /* - * Properties of the service endpoint policy definition - */ - @JsonProperty(value = "properties") - private ServiceEndpointPolicyDefinitionPropertiesFormat innerProperties; - - /* - * The name of the resource that is unique within a resource group. This - * name can be used to access the resource. - */ - @JsonProperty(value = "name") - private String name; - - /* - * A unique read-only string that changes whenever the resource is updated. - */ - @JsonProperty(value = "etag") - private String etag; - - /** - * Get the innerProperties property: Properties of the service endpoint policy definition. - * - * @return the innerProperties value. - */ - private ServiceEndpointPolicyDefinitionPropertiesFormat innerProperties() { - return this.innerProperties; - } - - /** - * Get the name property: The name of the resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @param name the name value to set. - * @return the ServiceEndpointPolicyDefinitionInner object itself. - */ - public ServiceEndpointPolicyDefinitionInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @param etag the etag value to set. - * @return the ServiceEndpointPolicyDefinitionInner object itself. - */ - public ServiceEndpointPolicyDefinitionInner withEtag(String etag) { - this.etag = etag; - return this; - } - - /** {@inheritDoc} */ - @Override - public ServiceEndpointPolicyDefinitionInner withId(String id) { - super.withId(id); - return this; - } - - /** - * Get the description property: A description for this rule. Restricted to 140 chars. - * - * @return the description value. - */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); - } - - /** - * Set the description property: A description for this rule. Restricted to 140 chars. - * - * @param description the description value to set. - * @return the ServiceEndpointPolicyDefinitionInner object itself. - */ - public ServiceEndpointPolicyDefinitionInner withDescription(String description) { - if (this.innerProperties() == null) { - this.innerProperties = new ServiceEndpointPolicyDefinitionPropertiesFormat(); - } - this.innerProperties().withDescription(description); - return this; - } - - /** - * Get the service property: service endpoint name. - * - * @return the service value. - */ - public String service() { - return this.innerProperties() == null ? null : this.innerProperties().service(); - } - - /** - * Set the service property: service endpoint name. - * - * @param service the service value to set. - * @return the ServiceEndpointPolicyDefinitionInner object itself. - */ - public ServiceEndpointPolicyDefinitionInner withService(String service) { - if (this.innerProperties() == null) { - this.innerProperties = new ServiceEndpointPolicyDefinitionPropertiesFormat(); - } - this.innerProperties().withService(service); - return this; - } - - /** - * Get the serviceResources property: A list of service resources. - * - * @return the serviceResources value. - */ - public List serviceResources() { - return this.innerProperties() == null ? null : this.innerProperties().serviceResources(); - } - - /** - * Set the serviceResources property: A list of service resources. - * - * @param serviceResources the serviceResources value to set. - * @return the ServiceEndpointPolicyDefinitionInner object itself. - */ - public ServiceEndpointPolicyDefinitionInner withServiceResources(List serviceResources) { - if (this.innerProperties() == null) { - this.innerProperties = new ServiceEndpointPolicyDefinitionPropertiesFormat(); - } - this.innerProperties().withServiceResources(serviceResources); - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the service end point policy definition. Possible - * values are: 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ServiceEndpointPolicyDefinitionPropertiesFormat.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ServiceEndpointPolicyDefinitionPropertiesFormat.java deleted file mode 100644 index 1b96c8fc4856..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ServiceEndpointPolicyDefinitionPropertiesFormat.java +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Service Endpoint policy definition resource. */ -@Fluent -public final class ServiceEndpointPolicyDefinitionPropertiesFormat { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(ServiceEndpointPolicyDefinitionPropertiesFormat.class); - - /* - * A description for this rule. Restricted to 140 chars. - */ - @JsonProperty(value = "description") - private String description; - - /* - * service endpoint name. - */ - @JsonProperty(value = "service") - private String service; - - /* - * A list of service resources. - */ - @JsonProperty(value = "serviceResources") - private List serviceResources; - - /* - * The provisioning state of the service end point policy definition. - * Possible values are: 'Updating', 'Deleting', and 'Failed'. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; - - /** - * Get the description property: A description for this rule. Restricted to 140 chars. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: A description for this rule. Restricted to 140 chars. - * - * @param description the description value to set. - * @return the ServiceEndpointPolicyDefinitionPropertiesFormat object itself. - */ - public ServiceEndpointPolicyDefinitionPropertiesFormat withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the service property: service endpoint name. - * - * @return the service value. - */ - public String service() { - return this.service; - } - - /** - * Set the service property: service endpoint name. - * - * @param service the service value to set. - * @return the ServiceEndpointPolicyDefinitionPropertiesFormat object itself. - */ - public ServiceEndpointPolicyDefinitionPropertiesFormat withService(String service) { - this.service = service; - return this; - } - - /** - * Get the serviceResources property: A list of service resources. - * - * @return the serviceResources value. - */ - public List serviceResources() { - return this.serviceResources; - } - - /** - * Set the serviceResources property: A list of service resources. - * - * @param serviceResources the serviceResources value to set. - * @return the ServiceEndpointPolicyDefinitionPropertiesFormat object itself. - */ - public ServiceEndpointPolicyDefinitionPropertiesFormat withServiceResources(List serviceResources) { - this.serviceResources = serviceResources; - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the service end point policy definition. Possible - * values are: 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ServiceEndpointPolicyInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ServiceEndpointPolicyInner.java deleted file mode 100644 index 83e213268789..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ServiceEndpointPolicyInner.java +++ /dev/null @@ -1,165 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** Service End point policy resource. */ -@Fluent -public final class ServiceEndpointPolicyInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceEndpointPolicyInner.class); - - /* - * Properties of the service end point policy - */ - @JsonProperty(value = "properties") - private ServiceEndpointPolicyPropertiesFormat innerProperties; - - /* - * A unique read-only string that changes whenever the resource is updated. - */ - @JsonProperty(value = "etag") - private String etag; - - /* - * Resource ID. - */ - @JsonProperty(value = "id") - private String id; - - /** - * Get the innerProperties property: Properties of the service end point policy. - * - * @return the innerProperties value. - */ - private ServiceEndpointPolicyPropertiesFormat innerProperties() { - return this.innerProperties; - } - - /** - * Get the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @param etag the etag value to set. - * @return the ServiceEndpointPolicyInner object itself. - */ - public ServiceEndpointPolicyInner withEtag(String etag) { - this.etag = etag; - return this; - } - - /** - * Get the id property: Resource ID. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: Resource ID. - * - * @param id the id value to set. - * @return the ServiceEndpointPolicyInner object itself. - */ - public ServiceEndpointPolicyInner withId(String id) { - this.id = id; - return this; - } - - /** {@inheritDoc} */ - @Override - public ServiceEndpointPolicyInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public ServiceEndpointPolicyInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the serviceEndpointPolicyDefinitions property: A collection of service endpoint policy definitions of the - * service endpoint policy. - * - * @return the serviceEndpointPolicyDefinitions value. - */ - public List serviceEndpointPolicyDefinitions() { - return this.innerProperties() == null ? null : this.innerProperties().serviceEndpointPolicyDefinitions(); - } - - /** - * Set the serviceEndpointPolicyDefinitions property: A collection of service endpoint policy definitions of the - * service endpoint policy. - * - * @param serviceEndpointPolicyDefinitions the serviceEndpointPolicyDefinitions value to set. - * @return the ServiceEndpointPolicyInner object itself. - */ - public ServiceEndpointPolicyInner withServiceEndpointPolicyDefinitions( - List serviceEndpointPolicyDefinitions) { - if (this.innerProperties() == null) { - this.innerProperties = new ServiceEndpointPolicyPropertiesFormat(); - } - this.innerProperties().withServiceEndpointPolicyDefinitions(serviceEndpointPolicyDefinitions); - return this; - } - - /** - * Get the subnets property: A collection of references to subnets. - * - * @return the subnets value. - */ - public List subnets() { - return this.innerProperties() == null ? null : this.innerProperties().subnets(); - } - - /** - * Get the resourceGuid property: The resource GUID property of the service endpoint policy resource. - * - * @return the resourceGuid value. - */ - public String resourceGuid() { - return this.innerProperties() == null ? null : this.innerProperties().resourceGuid(); - } - - /** - * Get the provisioningState property: The provisioning state of the service endpoint policy. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ServiceEndpointPolicyPropertiesFormat.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ServiceEndpointPolicyPropertiesFormat.java deleted file mode 100644 index 493f28afa72f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ServiceEndpointPolicyPropertiesFormat.java +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Service Endpoint Policy resource. */ -@Fluent -public final class ServiceEndpointPolicyPropertiesFormat { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceEndpointPolicyPropertiesFormat.class); - - /* - * A collection of service endpoint policy definitions of the service - * endpoint policy. - */ - @JsonProperty(value = "serviceEndpointPolicyDefinitions") - private List serviceEndpointPolicyDefinitions; - - /* - * A collection of references to subnets. - */ - @JsonProperty(value = "subnets", access = JsonProperty.Access.WRITE_ONLY) - private List subnets; - - /* - * The resource GUID property of the service endpoint policy resource. - */ - @JsonProperty(value = "resourceGuid", access = JsonProperty.Access.WRITE_ONLY) - private String resourceGuid; - - /* - * The provisioning state of the service endpoint policy. Possible values - * are: 'Updating', 'Deleting', and 'Failed'. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; - - /** - * Get the serviceEndpointPolicyDefinitions property: A collection of service endpoint policy definitions of the - * service endpoint policy. - * - * @return the serviceEndpointPolicyDefinitions value. - */ - public List serviceEndpointPolicyDefinitions() { - return this.serviceEndpointPolicyDefinitions; - } - - /** - * Set the serviceEndpointPolicyDefinitions property: A collection of service endpoint policy definitions of the - * service endpoint policy. - * - * @param serviceEndpointPolicyDefinitions the serviceEndpointPolicyDefinitions value to set. - * @return the ServiceEndpointPolicyPropertiesFormat object itself. - */ - public ServiceEndpointPolicyPropertiesFormat withServiceEndpointPolicyDefinitions( - List serviceEndpointPolicyDefinitions) { - this.serviceEndpointPolicyDefinitions = serviceEndpointPolicyDefinitions; - return this; - } - - /** - * Get the subnets property: A collection of references to subnets. - * - * @return the subnets value. - */ - public List subnets() { - return this.subnets; - } - - /** - * Get the resourceGuid property: The resource GUID property of the service endpoint policy resource. - * - * @return the resourceGuid value. - */ - public String resourceGuid() { - return this.resourceGuid; - } - - /** - * Get the provisioningState property: The provisioning state of the service endpoint policy. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (serviceEndpointPolicyDefinitions() != null) { - serviceEndpointPolicyDefinitions().forEach(e -> e.validate()); - } - if (subnets() != null) { - subnets().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/SubnetInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/SubnetInner.java deleted file mode 100644 index f00f585768e1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/SubnetInner.java +++ /dev/null @@ -1,378 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.Delegation; -import com.azure.resourcemanager.network.models.ResourceNavigationLink; -import com.azure.resourcemanager.network.models.ServiceAssociationLink; -import com.azure.resourcemanager.network.models.ServiceEndpointPropertiesFormat; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Subnet in a virtual network resource. */ -@Fluent -public final class SubnetInner extends SubResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SubnetInner.class); - - /* - * Properties of the subnet. - */ - @JsonProperty(value = "properties") - private SubnetPropertiesFormatInner innerProperties; - - /* - * The name of the resource that is unique within a resource group. This - * name can be used to access the resource. - */ - @JsonProperty(value = "name") - private String name; - - /* - * A unique read-only string that changes whenever the resource is updated. - */ - @JsonProperty(value = "etag") - private String etag; - - /** - * Get the innerProperties property: Properties of the subnet. - * - * @return the innerProperties value. - */ - private SubnetPropertiesFormatInner innerProperties() { - return this.innerProperties; - } - - /** - * Get the name property: The name of the resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @param name the name value to set. - * @return the SubnetInner object itself. - */ - public SubnetInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @param etag the etag value to set. - * @return the SubnetInner object itself. - */ - public SubnetInner withEtag(String etag) { - this.etag = etag; - return this; - } - - /** {@inheritDoc} */ - @Override - public SubnetInner withId(String id) { - super.withId(id); - return this; - } - - /** - * Get the addressPrefix property: The address prefix for the subnet. - * - * @return the addressPrefix value. - */ - public String addressPrefix() { - return this.innerProperties() == null ? null : this.innerProperties().addressPrefix(); - } - - /** - * Set the addressPrefix property: The address prefix for the subnet. - * - * @param addressPrefix the addressPrefix value to set. - * @return the SubnetInner object itself. - */ - public SubnetInner withAddressPrefix(String addressPrefix) { - if (this.innerProperties() == null) { - this.innerProperties = new SubnetPropertiesFormatInner(); - } - this.innerProperties().withAddressPrefix(addressPrefix); - return this; - } - - /** - * Get the addressPrefixes property: List of address prefixes for the subnet. - * - * @return the addressPrefixes value. - */ - public List addressPrefixes() { - return this.innerProperties() == null ? null : this.innerProperties().addressPrefixes(); - } - - /** - * Set the addressPrefixes property: List of address prefixes for the subnet. - * - * @param addressPrefixes the addressPrefixes value to set. - * @return the SubnetInner object itself. - */ - public SubnetInner withAddressPrefixes(List addressPrefixes) { - if (this.innerProperties() == null) { - this.innerProperties = new SubnetPropertiesFormatInner(); - } - this.innerProperties().withAddressPrefixes(addressPrefixes); - return this; - } - - /** - * Get the networkSecurityGroup property: The reference of the NetworkSecurityGroup resource. - * - * @return the networkSecurityGroup value. - */ - public NetworkSecurityGroupInner networkSecurityGroup() { - return this.innerProperties() == null ? null : this.innerProperties().networkSecurityGroup(); - } - - /** - * Set the networkSecurityGroup property: The reference of the NetworkSecurityGroup resource. - * - * @param networkSecurityGroup the networkSecurityGroup value to set. - * @return the SubnetInner object itself. - */ - public SubnetInner withNetworkSecurityGroup(NetworkSecurityGroupInner networkSecurityGroup) { - if (this.innerProperties() == null) { - this.innerProperties = new SubnetPropertiesFormatInner(); - } - this.innerProperties().withNetworkSecurityGroup(networkSecurityGroup); - return this; - } - - /** - * Get the routeTable property: The reference of the RouteTable resource. - * - * @return the routeTable value. - */ - public RouteTableInner routeTable() { - return this.innerProperties() == null ? null : this.innerProperties().routeTable(); - } - - /** - * Set the routeTable property: The reference of the RouteTable resource. - * - * @param routeTable the routeTable value to set. - * @return the SubnetInner object itself. - */ - public SubnetInner withRouteTable(RouteTableInner routeTable) { - if (this.innerProperties() == null) { - this.innerProperties = new SubnetPropertiesFormatInner(); - } - this.innerProperties().withRouteTable(routeTable); - return this; - } - - /** - * Get the serviceEndpoints property: An array of service endpoints. - * - * @return the serviceEndpoints value. - */ - public List serviceEndpoints() { - return this.innerProperties() == null ? null : this.innerProperties().serviceEndpoints(); - } - - /** - * Set the serviceEndpoints property: An array of service endpoints. - * - * @param serviceEndpoints the serviceEndpoints value to set. - * @return the SubnetInner object itself. - */ - public SubnetInner withServiceEndpoints(List serviceEndpoints) { - if (this.innerProperties() == null) { - this.innerProperties = new SubnetPropertiesFormatInner(); - } - this.innerProperties().withServiceEndpoints(serviceEndpoints); - return this; - } - - /** - * Get the serviceEndpointPolicies property: An array of service endpoint policies. - * - * @return the serviceEndpointPolicies value. - */ - public List serviceEndpointPolicies() { - return this.innerProperties() == null ? null : this.innerProperties().serviceEndpointPolicies(); - } - - /** - * Set the serviceEndpointPolicies property: An array of service endpoint policies. - * - * @param serviceEndpointPolicies the serviceEndpointPolicies value to set. - * @return the SubnetInner object itself. - */ - public SubnetInner withServiceEndpointPolicies(List serviceEndpointPolicies) { - if (this.innerProperties() == null) { - this.innerProperties = new SubnetPropertiesFormatInner(); - } - this.innerProperties().withServiceEndpointPolicies(serviceEndpointPolicies); - return this; - } - - /** - * Get the interfaceEndpoints property: An array of references to interface endpoints. - * - * @return the interfaceEndpoints value. - */ - public List interfaceEndpoints() { - return this.innerProperties() == null ? null : this.innerProperties().interfaceEndpoints(); - } - - /** - * Get the ipConfigurations property: Gets an array of references to the network interface IP configurations using - * subnet. - * - * @return the ipConfigurations value. - */ - public List ipConfigurations() { - return this.innerProperties() == null ? null : this.innerProperties().ipConfigurations(); - } - - /** - * Get the ipConfigurationProfiles property: Array of IP configuration profiles which reference this subnet. - * - * @return the ipConfigurationProfiles value. - */ - public List ipConfigurationProfiles() { - return this.innerProperties() == null ? null : this.innerProperties().ipConfigurationProfiles(); - } - - /** - * Get the resourceNavigationLinks property: Gets an array of references to the external resources using subnet. - * - * @return the resourceNavigationLinks value. - */ - public List resourceNavigationLinks() { - return this.innerProperties() == null ? null : this.innerProperties().resourceNavigationLinks(); - } - - /** - * Set the resourceNavigationLinks property: Gets an array of references to the external resources using subnet. - * - * @param resourceNavigationLinks the resourceNavigationLinks value to set. - * @return the SubnetInner object itself. - */ - public SubnetInner withResourceNavigationLinks(List resourceNavigationLinks) { - if (this.innerProperties() == null) { - this.innerProperties = new SubnetPropertiesFormatInner(); - } - this.innerProperties().withResourceNavigationLinks(resourceNavigationLinks); - return this; - } - - /** - * Get the serviceAssociationLinks property: Gets an array of references to services injecting into this subnet. - * - * @return the serviceAssociationLinks value. - */ - public List serviceAssociationLinks() { - return this.innerProperties() == null ? null : this.innerProperties().serviceAssociationLinks(); - } - - /** - * Set the serviceAssociationLinks property: Gets an array of references to services injecting into this subnet. - * - * @param serviceAssociationLinks the serviceAssociationLinks value to set. - * @return the SubnetInner object itself. - */ - public SubnetInner withServiceAssociationLinks(List serviceAssociationLinks) { - if (this.innerProperties() == null) { - this.innerProperties = new SubnetPropertiesFormatInner(); - } - this.innerProperties().withServiceAssociationLinks(serviceAssociationLinks); - return this; - } - - /** - * Get the delegations property: Gets an array of references to the delegations on the subnet. - * - * @return the delegations value. - */ - public List delegations() { - return this.innerProperties() == null ? null : this.innerProperties().delegations(); - } - - /** - * Set the delegations property: Gets an array of references to the delegations on the subnet. - * - * @param delegations the delegations value to set. - * @return the SubnetInner object itself. - */ - public SubnetInner withDelegations(List delegations) { - if (this.innerProperties() == null) { - this.innerProperties = new SubnetPropertiesFormatInner(); - } - this.innerProperties().withDelegations(delegations); - return this; - } - - /** - * Get the purpose property: A read-only string identifying the intention of use for this subnet based on - * delegations and other user-defined properties. - * - * @return the purpose value. - */ - public String purpose() { - return this.innerProperties() == null ? null : this.innerProperties().purpose(); - } - - /** - * Get the provisioningState property: The provisioning state of the resource. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Set the provisioningState property: The provisioning state of the resource. - * - * @param provisioningState the provisioningState value to set. - * @return the SubnetInner object itself. - */ - public SubnetInner withProvisioningState(String provisioningState) { - if (this.innerProperties() == null) { - this.innerProperties = new SubnetPropertiesFormatInner(); - } - this.innerProperties().withProvisioningState(provisioningState); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/SubnetPropertiesFormatInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/SubnetPropertiesFormatInner.java deleted file mode 100644 index 4be8e48afff6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/SubnetPropertiesFormatInner.java +++ /dev/null @@ -1,386 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.Delegation; -import com.azure.resourcemanager.network.models.ResourceNavigationLink; -import com.azure.resourcemanager.network.models.ServiceAssociationLink; -import com.azure.resourcemanager.network.models.ServiceEndpointPropertiesFormat; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Properties of the subnet. */ -@Fluent -public final class SubnetPropertiesFormatInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SubnetPropertiesFormatInner.class); - - /* - * The address prefix for the subnet. - */ - @JsonProperty(value = "addressPrefix") - private String addressPrefix; - - /* - * List of address prefixes for the subnet. - */ - @JsonProperty(value = "addressPrefixes") - private List addressPrefixes; - - /* - * The reference of the NetworkSecurityGroup resource. - */ - @JsonProperty(value = "networkSecurityGroup") - private NetworkSecurityGroupInner networkSecurityGroup; - - /* - * The reference of the RouteTable resource. - */ - @JsonProperty(value = "routeTable") - private RouteTableInner routeTable; - - /* - * An array of service endpoints. - */ - @JsonProperty(value = "serviceEndpoints") - private List serviceEndpoints; - - /* - * An array of service endpoint policies. - */ - @JsonProperty(value = "serviceEndpointPolicies") - private List serviceEndpointPolicies; - - /* - * An array of references to interface endpoints - */ - @JsonProperty(value = "interfaceEndpoints", access = JsonProperty.Access.WRITE_ONLY) - private List interfaceEndpoints; - - /* - * Gets an array of references to the network interface IP configurations - * using subnet. - */ - @JsonProperty(value = "ipConfigurations", access = JsonProperty.Access.WRITE_ONLY) - private List ipConfigurations; - - /* - * Array of IP configuration profiles which reference this subnet. - */ - @JsonProperty(value = "ipConfigurationProfiles", access = JsonProperty.Access.WRITE_ONLY) - private List ipConfigurationProfiles; - - /* - * Gets an array of references to the external resources using subnet. - */ - @JsonProperty(value = "resourceNavigationLinks") - private List resourceNavigationLinks; - - /* - * Gets an array of references to services injecting into this subnet. - */ - @JsonProperty(value = "serviceAssociationLinks") - private List serviceAssociationLinks; - - /* - * Gets an array of references to the delegations on the subnet. - */ - @JsonProperty(value = "delegations") - private List delegations; - - /* - * A read-only string identifying the intention of use for this subnet - * based on delegations and other user-defined properties. - */ - @JsonProperty(value = "purpose", access = JsonProperty.Access.WRITE_ONLY) - private String purpose; - - /* - * The provisioning state of the resource. - */ - @JsonProperty(value = "provisioningState") - private String provisioningState; - - /** - * Get the addressPrefix property: The address prefix for the subnet. - * - * @return the addressPrefix value. - */ - public String addressPrefix() { - return this.addressPrefix; - } - - /** - * Set the addressPrefix property: The address prefix for the subnet. - * - * @param addressPrefix the addressPrefix value to set. - * @return the SubnetPropertiesFormatInner object itself. - */ - public SubnetPropertiesFormatInner withAddressPrefix(String addressPrefix) { - this.addressPrefix = addressPrefix; - return this; - } - - /** - * Get the addressPrefixes property: List of address prefixes for the subnet. - * - * @return the addressPrefixes value. - */ - public List addressPrefixes() { - return this.addressPrefixes; - } - - /** - * Set the addressPrefixes property: List of address prefixes for the subnet. - * - * @param addressPrefixes the addressPrefixes value to set. - * @return the SubnetPropertiesFormatInner object itself. - */ - public SubnetPropertiesFormatInner withAddressPrefixes(List addressPrefixes) { - this.addressPrefixes = addressPrefixes; - return this; - } - - /** - * Get the networkSecurityGroup property: The reference of the NetworkSecurityGroup resource. - * - * @return the networkSecurityGroup value. - */ - public NetworkSecurityGroupInner networkSecurityGroup() { - return this.networkSecurityGroup; - } - - /** - * Set the networkSecurityGroup property: The reference of the NetworkSecurityGroup resource. - * - * @param networkSecurityGroup the networkSecurityGroup value to set. - * @return the SubnetPropertiesFormatInner object itself. - */ - public SubnetPropertiesFormatInner withNetworkSecurityGroup(NetworkSecurityGroupInner networkSecurityGroup) { - this.networkSecurityGroup = networkSecurityGroup; - return this; - } - - /** - * Get the routeTable property: The reference of the RouteTable resource. - * - * @return the routeTable value. - */ - public RouteTableInner routeTable() { - return this.routeTable; - } - - /** - * Set the routeTable property: The reference of the RouteTable resource. - * - * @param routeTable the routeTable value to set. - * @return the SubnetPropertiesFormatInner object itself. - */ - public SubnetPropertiesFormatInner withRouteTable(RouteTableInner routeTable) { - this.routeTable = routeTable; - return this; - } - - /** - * Get the serviceEndpoints property: An array of service endpoints. - * - * @return the serviceEndpoints value. - */ - public List serviceEndpoints() { - return this.serviceEndpoints; - } - - /** - * Set the serviceEndpoints property: An array of service endpoints. - * - * @param serviceEndpoints the serviceEndpoints value to set. - * @return the SubnetPropertiesFormatInner object itself. - */ - public SubnetPropertiesFormatInner withServiceEndpoints(List serviceEndpoints) { - this.serviceEndpoints = serviceEndpoints; - return this; - } - - /** - * Get the serviceEndpointPolicies property: An array of service endpoint policies. - * - * @return the serviceEndpointPolicies value. - */ - public List serviceEndpointPolicies() { - return this.serviceEndpointPolicies; - } - - /** - * Set the serviceEndpointPolicies property: An array of service endpoint policies. - * - * @param serviceEndpointPolicies the serviceEndpointPolicies value to set. - * @return the SubnetPropertiesFormatInner object itself. - */ - public SubnetPropertiesFormatInner withServiceEndpointPolicies( - List serviceEndpointPolicies) { - this.serviceEndpointPolicies = serviceEndpointPolicies; - return this; - } - - /** - * Get the interfaceEndpoints property: An array of references to interface endpoints. - * - * @return the interfaceEndpoints value. - */ - public List interfaceEndpoints() { - return this.interfaceEndpoints; - } - - /** - * Get the ipConfigurations property: Gets an array of references to the network interface IP configurations using - * subnet. - * - * @return the ipConfigurations value. - */ - public List ipConfigurations() { - return this.ipConfigurations; - } - - /** - * Get the ipConfigurationProfiles property: Array of IP configuration profiles which reference this subnet. - * - * @return the ipConfigurationProfiles value. - */ - public List ipConfigurationProfiles() { - return this.ipConfigurationProfiles; - } - - /** - * Get the resourceNavigationLinks property: Gets an array of references to the external resources using subnet. - * - * @return the resourceNavigationLinks value. - */ - public List resourceNavigationLinks() { - return this.resourceNavigationLinks; - } - - /** - * Set the resourceNavigationLinks property: Gets an array of references to the external resources using subnet. - * - * @param resourceNavigationLinks the resourceNavigationLinks value to set. - * @return the SubnetPropertiesFormatInner object itself. - */ - public SubnetPropertiesFormatInner withResourceNavigationLinks( - List resourceNavigationLinks) { - this.resourceNavigationLinks = resourceNavigationLinks; - return this; - } - - /** - * Get the serviceAssociationLinks property: Gets an array of references to services injecting into this subnet. - * - * @return the serviceAssociationLinks value. - */ - public List serviceAssociationLinks() { - return this.serviceAssociationLinks; - } - - /** - * Set the serviceAssociationLinks property: Gets an array of references to services injecting into this subnet. - * - * @param serviceAssociationLinks the serviceAssociationLinks value to set. - * @return the SubnetPropertiesFormatInner object itself. - */ - public SubnetPropertiesFormatInner withServiceAssociationLinks( - List serviceAssociationLinks) { - this.serviceAssociationLinks = serviceAssociationLinks; - return this; - } - - /** - * Get the delegations property: Gets an array of references to the delegations on the subnet. - * - * @return the delegations value. - */ - public List delegations() { - return this.delegations; - } - - /** - * Set the delegations property: Gets an array of references to the delegations on the subnet. - * - * @param delegations the delegations value to set. - * @return the SubnetPropertiesFormatInner object itself. - */ - public SubnetPropertiesFormatInner withDelegations(List delegations) { - this.delegations = delegations; - return this; - } - - /** - * Get the purpose property: A read-only string identifying the intention of use for this subnet based on - * delegations and other user-defined properties. - * - * @return the purpose value. - */ - public String purpose() { - return this.purpose; - } - - /** - * Get the provisioningState property: The provisioning state of the resource. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Set the provisioningState property: The provisioning state of the resource. - * - * @param provisioningState the provisioningState value to set. - * @return the SubnetPropertiesFormatInner object itself. - */ - public SubnetPropertiesFormatInner withProvisioningState(String provisioningState) { - this.provisioningState = provisioningState; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (networkSecurityGroup() != null) { - networkSecurityGroup().validate(); - } - if (routeTable() != null) { - routeTable().validate(); - } - if (serviceEndpoints() != null) { - serviceEndpoints().forEach(e -> e.validate()); - } - if (serviceEndpointPolicies() != null) { - serviceEndpointPolicies().forEach(e -> e.validate()); - } - if (interfaceEndpoints() != null) { - interfaceEndpoints().forEach(e -> e.validate()); - } - if (ipConfigurations() != null) { - ipConfigurations().forEach(e -> e.validate()); - } - if (ipConfigurationProfiles() != null) { - ipConfigurationProfiles().forEach(e -> e.validate()); - } - if (resourceNavigationLinks() != null) { - resourceNavigationLinks().forEach(e -> e.validate()); - } - if (serviceAssociationLinks() != null) { - serviceAssociationLinks().forEach(e -> e.validate()); - } - if (delegations() != null) { - delegations().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/TopologyInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/TopologyInner.java deleted file mode 100644 index e1785e80eb14..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/TopologyInner.java +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.TopologyResource; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; - -/** Topology of the specified resource group. */ -@Fluent -public final class TopologyInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TopologyInner.class); - - /* - * GUID representing the operation id. - */ - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) - private String id; - - /* - * The datetime when the topology was initially created for the resource - * group. - */ - @JsonProperty(value = "createdDateTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime createdDateTime; - - /* - * The datetime when the topology was last modified. - */ - @JsonProperty(value = "lastModified", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime lastModified; - - /* - * The resources property. - */ - @JsonProperty(value = "resources") - private List resources; - - /** - * Get the id property: GUID representing the operation id. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Get the createdDateTime property: The datetime when the topology was initially created for the resource group. - * - * @return the createdDateTime value. - */ - public OffsetDateTime createdDateTime() { - return this.createdDateTime; - } - - /** - * Get the lastModified property: The datetime when the topology was last modified. - * - * @return the lastModified value. - */ - public OffsetDateTime lastModified() { - return this.lastModified; - } - - /** - * Get the resources property: The resources property. - * - * @return the resources value. - */ - public List resources() { - return this.resources; - } - - /** - * Set the resources property: The resources property. - * - * @param resources the resources value to set. - * @return the TopologyInner object itself. - */ - public TopologyInner withResources(List resources) { - this.resources = resources; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (resources() != null) { - resources().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/TroubleshootingProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/TroubleshootingProperties.java deleted file mode 100644 index e468edb8acd7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/TroubleshootingProperties.java +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Storage location provided for troubleshoot. */ -@Fluent -public final class TroubleshootingProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TroubleshootingProperties.class); - - /* - * The ID for the storage account to save the troubleshoot result. - */ - @JsonProperty(value = "storageId", required = true) - private String storageId; - - /* - * The path to the blob to save the troubleshoot result in. - */ - @JsonProperty(value = "storagePath", required = true) - private String storagePath; - - /** - * Get the storageId property: The ID for the storage account to save the troubleshoot result. - * - * @return the storageId value. - */ - public String storageId() { - return this.storageId; - } - - /** - * Set the storageId property: The ID for the storage account to save the troubleshoot result. - * - * @param storageId the storageId value to set. - * @return the TroubleshootingProperties object itself. - */ - public TroubleshootingProperties withStorageId(String storageId) { - this.storageId = storageId; - return this; - } - - /** - * Get the storagePath property: The path to the blob to save the troubleshoot result in. - * - * @return the storagePath value. - */ - public String storagePath() { - return this.storagePath; - } - - /** - * Set the storagePath property: The path to the blob to save the troubleshoot result in. - * - * @param storagePath the storagePath value to set. - * @return the TroubleshootingProperties object itself. - */ - public TroubleshootingProperties withStoragePath(String storagePath) { - this.storagePath = storagePath; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (storageId() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property storageId in model TroubleshootingProperties")); - } - if (storagePath() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property storagePath in model TroubleshootingProperties")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/TroubleshootingResultInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/TroubleshootingResultInner.java deleted file mode 100644 index 8ac008d37134..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/TroubleshootingResultInner.java +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.TroubleshootingDetails; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; - -/** Troubleshooting information gained from specified resource. */ -@Fluent -public final class TroubleshootingResultInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TroubleshootingResultInner.class); - - /* - * The start time of the troubleshooting. - */ - @JsonProperty(value = "startTime") - private OffsetDateTime startTime; - - /* - * The end time of the troubleshooting. - */ - @JsonProperty(value = "endTime") - private OffsetDateTime endTime; - - /* - * The result code of the troubleshooting. - */ - @JsonProperty(value = "code") - private String code; - - /* - * Information from troubleshooting. - */ - @JsonProperty(value = "results") - private List results; - - /** - * Get the startTime property: The start time of the troubleshooting. - * - * @return the startTime value. - */ - public OffsetDateTime startTime() { - return this.startTime; - } - - /** - * Set the startTime property: The start time of the troubleshooting. - * - * @param startTime the startTime value to set. - * @return the TroubleshootingResultInner object itself. - */ - public TroubleshootingResultInner withStartTime(OffsetDateTime startTime) { - this.startTime = startTime; - return this; - } - - /** - * Get the endTime property: The end time of the troubleshooting. - * - * @return the endTime value. - */ - public OffsetDateTime endTime() { - return this.endTime; - } - - /** - * Set the endTime property: The end time of the troubleshooting. - * - * @param endTime the endTime value to set. - * @return the TroubleshootingResultInner object itself. - */ - public TroubleshootingResultInner withEndTime(OffsetDateTime endTime) { - this.endTime = endTime; - return this; - } - - /** - * Get the code property: The result code of the troubleshooting. - * - * @return the code value. - */ - public String code() { - return this.code; - } - - /** - * Set the code property: The result code of the troubleshooting. - * - * @param code the code value to set. - * @return the TroubleshootingResultInner object itself. - */ - public TroubleshootingResultInner withCode(String code) { - this.code = code; - return this; - } - - /** - * Get the results property: Information from troubleshooting. - * - * @return the results value. - */ - public List results() { - return this.results; - } - - /** - * Set the results property: Information from troubleshooting. - * - * @param results the results value to set. - * @return the TroubleshootingResultInner object itself. - */ - public TroubleshootingResultInner withResults(List results) { - this.results = results; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (results() != null) { - results().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/UsageInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/UsageInner.java deleted file mode 100644 index 237b4dcecdc0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/UsageInner.java +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.UsageName; -import com.azure.resourcemanager.network.models.UsageUnit; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describes network resource usage. */ -@Fluent -public final class UsageInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(UsageInner.class); - - /* - * Resource identifier. - */ - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) - private String id; - - /* - * An enum describing the unit of measurement. - */ - @JsonProperty(value = "unit", required = true) - private UsageUnit unit; - - /* - * The current value of the usage. - */ - @JsonProperty(value = "currentValue", required = true) - private long currentValue; - - /* - * The limit of usage. - */ - @JsonProperty(value = "limit", required = true) - private long limit; - - /* - * The name of the type of usage. - */ - @JsonProperty(value = "name", required = true) - private UsageName name; - - /** - * Get the id property: Resource identifier. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Get the unit property: An enum describing the unit of measurement. - * - * @return the unit value. - */ - public UsageUnit unit() { - return this.unit; - } - - /** - * Set the unit property: An enum describing the unit of measurement. - * - * @param unit the unit value to set. - * @return the UsageInner object itself. - */ - public UsageInner withUnit(UsageUnit unit) { - this.unit = unit; - return this; - } - - /** - * Get the currentValue property: The current value of the usage. - * - * @return the currentValue value. - */ - public long currentValue() { - return this.currentValue; - } - - /** - * Set the currentValue property: The current value of the usage. - * - * @param currentValue the currentValue value to set. - * @return the UsageInner object itself. - */ - public UsageInner withCurrentValue(long currentValue) { - this.currentValue = currentValue; - return this; - } - - /** - * Get the limit property: The limit of usage. - * - * @return the limit value. - */ - public long limit() { - return this.limit; - } - - /** - * Set the limit property: The limit of usage. - * - * @param limit the limit value to set. - * @return the UsageInner object itself. - */ - public UsageInner withLimit(long limit) { - this.limit = limit; - return this; - } - - /** - * Get the name property: The name of the type of usage. - * - * @return the name value. - */ - public UsageName name() { - return this.name; - } - - /** - * Set the name property: The name of the type of usage. - * - * @param name the name value to set. - * @return the UsageInner object itself. - */ - public UsageInner withName(UsageName name) { - this.name = name; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (unit() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property unit in model UsageInner")); - } - if (name() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property name in model UsageInner")); - } else { - name().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VerificationIpFlowResultInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VerificationIpFlowResultInner.java deleted file mode 100644 index 87b270c16e4c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VerificationIpFlowResultInner.java +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.Access; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Results of IP flow verification on the target resource. */ -@Fluent -public final class VerificationIpFlowResultInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VerificationIpFlowResultInner.class); - - /* - * Indicates whether the traffic is allowed or denied. - */ - @JsonProperty(value = "access") - private Access access; - - /* - * Name of the rule. If input is not matched against any security rule, it - * is not displayed. - */ - @JsonProperty(value = "ruleName") - private String ruleName; - - /** - * Get the access property: Indicates whether the traffic is allowed or denied. - * - * @return the access value. - */ - public Access access() { - return this.access; - } - - /** - * Set the access property: Indicates whether the traffic is allowed or denied. - * - * @param access the access value to set. - * @return the VerificationIpFlowResultInner object itself. - */ - public VerificationIpFlowResultInner withAccess(Access access) { - this.access = access; - return this; - } - - /** - * Get the ruleName property: Name of the rule. If input is not matched against any security rule, it is not - * displayed. - * - * @return the ruleName value. - */ - public String ruleName() { - return this.ruleName; - } - - /** - * Set the ruleName property: Name of the rule. If input is not matched against any security rule, it is not - * displayed. - * - * @param ruleName the ruleName value to set. - * @return the VerificationIpFlowResultInner object itself. - */ - public VerificationIpFlowResultInner withRuleName(String ruleName) { - this.ruleName = ruleName; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VirtualHubInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VirtualHubInner.java deleted file mode 100644 index 074497c1c834..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VirtualHubInner.java +++ /dev/null @@ -1,289 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.ProvisioningState; -import com.azure.resourcemanager.network.models.VirtualHubRouteTable; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** VirtualHub Resource. */ -@Fluent -public final class VirtualHubInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualHubInner.class); - - /* - * Parameters for VirtualHub - */ - @JsonProperty(value = "properties") - private VirtualHubProperties innerProperties; - - /* - * Gets a unique read-only string that changes whenever the resource is - * updated. - */ - @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) - private String etag; - - /* - * Resource ID. - */ - @JsonProperty(value = "id") - private String id; - - /** - * Get the innerProperties property: Parameters for VirtualHub. - * - * @return the innerProperties value. - */ - private VirtualHubProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the etag property: Gets a unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Get the id property: Resource ID. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: Resource ID. - * - * @param id the id value to set. - * @return the VirtualHubInner object itself. - */ - public VirtualHubInner withId(String id) { - this.id = id; - return this; - } - - /** {@inheritDoc} */ - @Override - public VirtualHubInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public VirtualHubInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the virtualWan property: The VirtualWAN to which the VirtualHub belongs. - * - * @return the virtualWan value. - */ - public SubResource virtualWan() { - return this.innerProperties() == null ? null : this.innerProperties().virtualWan(); - } - - /** - * Set the virtualWan property: The VirtualWAN to which the VirtualHub belongs. - * - * @param virtualWan the virtualWan value to set. - * @return the VirtualHubInner object itself. - */ - public VirtualHubInner withVirtualWan(SubResource virtualWan) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualHubProperties(); - } - this.innerProperties().withVirtualWan(virtualWan); - return this; - } - - /** - * Get the vpnGateway property: The VpnGateway associated with this VirtualHub. - * - * @return the vpnGateway value. - */ - public SubResource vpnGateway() { - return this.innerProperties() == null ? null : this.innerProperties().vpnGateway(); - } - - /** - * Set the vpnGateway property: The VpnGateway associated with this VirtualHub. - * - * @param vpnGateway the vpnGateway value to set. - * @return the VirtualHubInner object itself. - */ - public VirtualHubInner withVpnGateway(SubResource vpnGateway) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualHubProperties(); - } - this.innerProperties().withVpnGateway(vpnGateway); - return this; - } - - /** - * Get the p2SVpnGateway property: The P2SVpnGateway associated with this VirtualHub. - * - * @return the p2SVpnGateway value. - */ - public SubResource p2SVpnGateway() { - return this.innerProperties() == null ? null : this.innerProperties().p2SVpnGateway(); - } - - /** - * Set the p2SVpnGateway property: The P2SVpnGateway associated with this VirtualHub. - * - * @param p2SVpnGateway the p2SVpnGateway value to set. - * @return the VirtualHubInner object itself. - */ - public VirtualHubInner withP2SVpnGateway(SubResource p2SVpnGateway) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualHubProperties(); - } - this.innerProperties().withP2SVpnGateway(p2SVpnGateway); - return this; - } - - /** - * Get the expressRouteGateway property: The expressRouteGateway associated with this VirtualHub. - * - * @return the expressRouteGateway value. - */ - public SubResource expressRouteGateway() { - return this.innerProperties() == null ? null : this.innerProperties().expressRouteGateway(); - } - - /** - * Set the expressRouteGateway property: The expressRouteGateway associated with this VirtualHub. - * - * @param expressRouteGateway the expressRouteGateway value to set. - * @return the VirtualHubInner object itself. - */ - public VirtualHubInner withExpressRouteGateway(SubResource expressRouteGateway) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualHubProperties(); - } - this.innerProperties().withExpressRouteGateway(expressRouteGateway); - return this; - } - - /** - * Get the virtualNetworkConnections property: list of all vnet connections with this VirtualHub. - * - * @return the virtualNetworkConnections value. - */ - public List virtualNetworkConnections() { - return this.innerProperties() == null ? null : this.innerProperties().virtualNetworkConnections(); - } - - /** - * Set the virtualNetworkConnections property: list of all vnet connections with this VirtualHub. - * - * @param virtualNetworkConnections the virtualNetworkConnections value to set. - * @return the VirtualHubInner object itself. - */ - public VirtualHubInner withVirtualNetworkConnections( - List virtualNetworkConnections) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualHubProperties(); - } - this.innerProperties().withVirtualNetworkConnections(virtualNetworkConnections); - return this; - } - - /** - * Get the addressPrefix property: Address-prefix for this VirtualHub. - * - * @return the addressPrefix value. - */ - public String addressPrefix() { - return this.innerProperties() == null ? null : this.innerProperties().addressPrefix(); - } - - /** - * Set the addressPrefix property: Address-prefix for this VirtualHub. - * - * @param addressPrefix the addressPrefix value to set. - * @return the VirtualHubInner object itself. - */ - public VirtualHubInner withAddressPrefix(String addressPrefix) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualHubProperties(); - } - this.innerProperties().withAddressPrefix(addressPrefix); - return this; - } - - /** - * Get the routeTable property: The routeTable associated with this virtual hub. - * - * @return the routeTable value. - */ - public VirtualHubRouteTable routeTable() { - return this.innerProperties() == null ? null : this.innerProperties().routeTable(); - } - - /** - * Set the routeTable property: The routeTable associated with this virtual hub. - * - * @param routeTable the routeTable value to set. - * @return the VirtualHubInner object itself. - */ - public VirtualHubInner withRouteTable(VirtualHubRouteTable routeTable) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualHubProperties(); - } - this.innerProperties().withRouteTable(routeTable); - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the resource. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Set the provisioningState property: The provisioning state of the resource. - * - * @param provisioningState the provisioningState value to set. - * @return the VirtualHubInner object itself. - */ - public VirtualHubInner withProvisioningState(ProvisioningState provisioningState) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualHubProperties(); - } - this.innerProperties().withProvisioningState(provisioningState); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VirtualHubProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VirtualHubProperties.java deleted file mode 100644 index a848b099ffe1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VirtualHubProperties.java +++ /dev/null @@ -1,243 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.ProvisioningState; -import com.azure.resourcemanager.network.models.VirtualHubRouteTable; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Parameters for VirtualHub. */ -@Fluent -public final class VirtualHubProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualHubProperties.class); - - /* - * The VirtualWAN to which the VirtualHub belongs - */ - @JsonProperty(value = "virtualWan") - private SubResource virtualWan; - - /* - * The VpnGateway associated with this VirtualHub - */ - @JsonProperty(value = "vpnGateway") - private SubResource vpnGateway; - - /* - * The P2SVpnGateway associated with this VirtualHub - */ - @JsonProperty(value = "p2SVpnGateway") - private SubResource p2SVpnGateway; - - /* - * The expressRouteGateway associated with this VirtualHub - */ - @JsonProperty(value = "expressRouteGateway") - private SubResource expressRouteGateway; - - /* - * list of all vnet connections with this VirtualHub. - */ - @JsonProperty(value = "virtualNetworkConnections") - private List virtualNetworkConnections; - - /* - * Address-prefix for this VirtualHub. - */ - @JsonProperty(value = "addressPrefix") - private String addressPrefix; - - /* - * The routeTable associated with this virtual hub. - */ - @JsonProperty(value = "routeTable") - private VirtualHubRouteTable routeTable; - - /* - * The provisioning state of the resource. - */ - @JsonProperty(value = "provisioningState") - private ProvisioningState provisioningState; - - /** - * Get the virtualWan property: The VirtualWAN to which the VirtualHub belongs. - * - * @return the virtualWan value. - */ - public SubResource virtualWan() { - return this.virtualWan; - } - - /** - * Set the virtualWan property: The VirtualWAN to which the VirtualHub belongs. - * - * @param virtualWan the virtualWan value to set. - * @return the VirtualHubProperties object itself. - */ - public VirtualHubProperties withVirtualWan(SubResource virtualWan) { - this.virtualWan = virtualWan; - return this; - } - - /** - * Get the vpnGateway property: The VpnGateway associated with this VirtualHub. - * - * @return the vpnGateway value. - */ - public SubResource vpnGateway() { - return this.vpnGateway; - } - - /** - * Set the vpnGateway property: The VpnGateway associated with this VirtualHub. - * - * @param vpnGateway the vpnGateway value to set. - * @return the VirtualHubProperties object itself. - */ - public VirtualHubProperties withVpnGateway(SubResource vpnGateway) { - this.vpnGateway = vpnGateway; - return this; - } - - /** - * Get the p2SVpnGateway property: The P2SVpnGateway associated with this VirtualHub. - * - * @return the p2SVpnGateway value. - */ - public SubResource p2SVpnGateway() { - return this.p2SVpnGateway; - } - - /** - * Set the p2SVpnGateway property: The P2SVpnGateway associated with this VirtualHub. - * - * @param p2SVpnGateway the p2SVpnGateway value to set. - * @return the VirtualHubProperties object itself. - */ - public VirtualHubProperties withP2SVpnGateway(SubResource p2SVpnGateway) { - this.p2SVpnGateway = p2SVpnGateway; - return this; - } - - /** - * Get the expressRouteGateway property: The expressRouteGateway associated with this VirtualHub. - * - * @return the expressRouteGateway value. - */ - public SubResource expressRouteGateway() { - return this.expressRouteGateway; - } - - /** - * Set the expressRouteGateway property: The expressRouteGateway associated with this VirtualHub. - * - * @param expressRouteGateway the expressRouteGateway value to set. - * @return the VirtualHubProperties object itself. - */ - public VirtualHubProperties withExpressRouteGateway(SubResource expressRouteGateway) { - this.expressRouteGateway = expressRouteGateway; - return this; - } - - /** - * Get the virtualNetworkConnections property: list of all vnet connections with this VirtualHub. - * - * @return the virtualNetworkConnections value. - */ - public List virtualNetworkConnections() { - return this.virtualNetworkConnections; - } - - /** - * Set the virtualNetworkConnections property: list of all vnet connections with this VirtualHub. - * - * @param virtualNetworkConnections the virtualNetworkConnections value to set. - * @return the VirtualHubProperties object itself. - */ - public VirtualHubProperties withVirtualNetworkConnections( - List virtualNetworkConnections) { - this.virtualNetworkConnections = virtualNetworkConnections; - return this; - } - - /** - * Get the addressPrefix property: Address-prefix for this VirtualHub. - * - * @return the addressPrefix value. - */ - public String addressPrefix() { - return this.addressPrefix; - } - - /** - * Set the addressPrefix property: Address-prefix for this VirtualHub. - * - * @param addressPrefix the addressPrefix value to set. - * @return the VirtualHubProperties object itself. - */ - public VirtualHubProperties withAddressPrefix(String addressPrefix) { - this.addressPrefix = addressPrefix; - return this; - } - - /** - * Get the routeTable property: The routeTable associated with this virtual hub. - * - * @return the routeTable value. - */ - public VirtualHubRouteTable routeTable() { - return this.routeTable; - } - - /** - * Set the routeTable property: The routeTable associated with this virtual hub. - * - * @param routeTable the routeTable value to set. - * @return the VirtualHubProperties object itself. - */ - public VirtualHubProperties withRouteTable(VirtualHubRouteTable routeTable) { - this.routeTable = routeTable; - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the resource. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Set the provisioningState property: The provisioning state of the resource. - * - * @param provisioningState the provisioningState value to set. - * @return the VirtualHubProperties object itself. - */ - public VirtualHubProperties withProvisioningState(ProvisioningState provisioningState) { - this.provisioningState = provisioningState; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (virtualNetworkConnections() != null) { - virtualNetworkConnections().forEach(e -> e.validate()); - } - if (routeTable() != null) { - routeTable().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VirtualNetworkGatewayConnectionInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VirtualNetworkGatewayConnectionInner.java deleted file mode 100644 index c228ca826181..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VirtualNetworkGatewayConnectionInner.java +++ /dev/null @@ -1,500 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.IpsecPolicy; -import com.azure.resourcemanager.network.models.TunnelConnectionHealth; -import com.azure.resourcemanager.network.models.VirtualNetworkGatewayConnectionProtocol; -import com.azure.resourcemanager.network.models.VirtualNetworkGatewayConnectionStatus; -import com.azure.resourcemanager.network.models.VirtualNetworkGatewayConnectionType; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** A common class for general resource information. */ -@Fluent -public final class VirtualNetworkGatewayConnectionInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkGatewayConnectionInner.class); - - /* - * Properties of the virtual network gateway connection. - */ - @JsonProperty(value = "properties", required = true) - private VirtualNetworkGatewayConnectionPropertiesFormatInner innerProperties = - new VirtualNetworkGatewayConnectionPropertiesFormatInner(); - - /* - * Gets a unique read-only string that changes whenever the resource is - * updated. - */ - @JsonProperty(value = "etag") - private String etag; - - /* - * Resource ID. - */ - @JsonProperty(value = "id") - private String id; - - /** - * Get the innerProperties property: Properties of the virtual network gateway connection. - * - * @return the innerProperties value. - */ - private VirtualNetworkGatewayConnectionPropertiesFormatInner innerProperties() { - return this.innerProperties; - } - - /** - * Get the etag property: Gets a unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: Gets a unique read-only string that changes whenever the resource is updated. - * - * @param etag the etag value to set. - * @return the VirtualNetworkGatewayConnectionInner object itself. - */ - public VirtualNetworkGatewayConnectionInner withEtag(String etag) { - this.etag = etag; - return this; - } - - /** - * Get the id property: Resource ID. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: Resource ID. - * - * @param id the id value to set. - * @return the VirtualNetworkGatewayConnectionInner object itself. - */ - public VirtualNetworkGatewayConnectionInner withId(String id) { - this.id = id; - return this; - } - - /** {@inheritDoc} */ - @Override - public VirtualNetworkGatewayConnectionInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public VirtualNetworkGatewayConnectionInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the authorizationKey property: The authorizationKey. - * - * @return the authorizationKey value. - */ - public String authorizationKey() { - return this.innerProperties() == null ? null : this.innerProperties().authorizationKey(); - } - - /** - * Set the authorizationKey property: The authorizationKey. - * - * @param authorizationKey the authorizationKey value to set. - * @return the VirtualNetworkGatewayConnectionInner object itself. - */ - public VirtualNetworkGatewayConnectionInner withAuthorizationKey(String authorizationKey) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualNetworkGatewayConnectionPropertiesFormatInner(); - } - this.innerProperties().withAuthorizationKey(authorizationKey); - return this; - } - - /** - * Get the virtualNetworkGateway1 property: The reference to virtual network gateway resource. - * - * @return the virtualNetworkGateway1 value. - */ - public VirtualNetworkGatewayInner virtualNetworkGateway1() { - return this.innerProperties() == null ? null : this.innerProperties().virtualNetworkGateway1(); - } - - /** - * Set the virtualNetworkGateway1 property: The reference to virtual network gateway resource. - * - * @param virtualNetworkGateway1 the virtualNetworkGateway1 value to set. - * @return the VirtualNetworkGatewayConnectionInner object itself. - */ - public VirtualNetworkGatewayConnectionInner withVirtualNetworkGateway1( - VirtualNetworkGatewayInner virtualNetworkGateway1) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualNetworkGatewayConnectionPropertiesFormatInner(); - } - this.innerProperties().withVirtualNetworkGateway1(virtualNetworkGateway1); - return this; - } - - /** - * Get the virtualNetworkGateway2 property: The reference to virtual network gateway resource. - * - * @return the virtualNetworkGateway2 value. - */ - public VirtualNetworkGatewayInner virtualNetworkGateway2() { - return this.innerProperties() == null ? null : this.innerProperties().virtualNetworkGateway2(); - } - - /** - * Set the virtualNetworkGateway2 property: The reference to virtual network gateway resource. - * - * @param virtualNetworkGateway2 the virtualNetworkGateway2 value to set. - * @return the VirtualNetworkGatewayConnectionInner object itself. - */ - public VirtualNetworkGatewayConnectionInner withVirtualNetworkGateway2( - VirtualNetworkGatewayInner virtualNetworkGateway2) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualNetworkGatewayConnectionPropertiesFormatInner(); - } - this.innerProperties().withVirtualNetworkGateway2(virtualNetworkGateway2); - return this; - } - - /** - * Get the localNetworkGateway2 property: The reference to local network gateway resource. - * - * @return the localNetworkGateway2 value. - */ - public LocalNetworkGatewayInner localNetworkGateway2() { - return this.innerProperties() == null ? null : this.innerProperties().localNetworkGateway2(); - } - - /** - * Set the localNetworkGateway2 property: The reference to local network gateway resource. - * - * @param localNetworkGateway2 the localNetworkGateway2 value to set. - * @return the VirtualNetworkGatewayConnectionInner object itself. - */ - public VirtualNetworkGatewayConnectionInner withLocalNetworkGateway2( - LocalNetworkGatewayInner localNetworkGateway2) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualNetworkGatewayConnectionPropertiesFormatInner(); - } - this.innerProperties().withLocalNetworkGateway2(localNetworkGateway2); - return this; - } - - /** - * Get the connectionType property: Gateway connection type. Possible values are: - * 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. - * - * @return the connectionType value. - */ - public VirtualNetworkGatewayConnectionType connectionType() { - return this.innerProperties() == null ? null : this.innerProperties().connectionType(); - } - - /** - * Set the connectionType property: Gateway connection type. Possible values are: - * 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. - * - * @param connectionType the connectionType value to set. - * @return the VirtualNetworkGatewayConnectionInner object itself. - */ - public VirtualNetworkGatewayConnectionInner withConnectionType(VirtualNetworkGatewayConnectionType connectionType) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualNetworkGatewayConnectionPropertiesFormatInner(); - } - this.innerProperties().withConnectionType(connectionType); - return this; - } - - /** - * Get the connectionProtocol property: Connection protocol used for this connection. - * - * @return the connectionProtocol value. - */ - public VirtualNetworkGatewayConnectionProtocol connectionProtocol() { - return this.innerProperties() == null ? null : this.innerProperties().connectionProtocol(); - } - - /** - * Set the connectionProtocol property: Connection protocol used for this connection. - * - * @param connectionProtocol the connectionProtocol value to set. - * @return the VirtualNetworkGatewayConnectionInner object itself. - */ - public VirtualNetworkGatewayConnectionInner withConnectionProtocol( - VirtualNetworkGatewayConnectionProtocol connectionProtocol) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualNetworkGatewayConnectionPropertiesFormatInner(); - } - this.innerProperties().withConnectionProtocol(connectionProtocol); - return this; - } - - /** - * Get the routingWeight property: The routing weight. - * - * @return the routingWeight value. - */ - public Integer routingWeight() { - return this.innerProperties() == null ? null : this.innerProperties().routingWeight(); - } - - /** - * Set the routingWeight property: The routing weight. - * - * @param routingWeight the routingWeight value to set. - * @return the VirtualNetworkGatewayConnectionInner object itself. - */ - public VirtualNetworkGatewayConnectionInner withRoutingWeight(Integer routingWeight) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualNetworkGatewayConnectionPropertiesFormatInner(); - } - this.innerProperties().withRoutingWeight(routingWeight); - return this; - } - - /** - * Get the sharedKey property: The IPSec shared key. - * - * @return the sharedKey value. - */ - public String sharedKey() { - return this.innerProperties() == null ? null : this.innerProperties().sharedKey(); - } - - /** - * Set the sharedKey property: The IPSec shared key. - * - * @param sharedKey the sharedKey value to set. - * @return the VirtualNetworkGatewayConnectionInner object itself. - */ - public VirtualNetworkGatewayConnectionInner withSharedKey(String sharedKey) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualNetworkGatewayConnectionPropertiesFormatInner(); - } - this.innerProperties().withSharedKey(sharedKey); - return this; - } - - /** - * Get the connectionStatus property: Virtual network Gateway connection status. Possible values are 'Unknown', - * 'Connecting', 'Connected' and 'NotConnected'. - * - * @return the connectionStatus value. - */ - public VirtualNetworkGatewayConnectionStatus connectionStatus() { - return this.innerProperties() == null ? null : this.innerProperties().connectionStatus(); - } - - /** - * Get the tunnelConnectionStatus property: Collection of all tunnels' connection health status. - * - * @return the tunnelConnectionStatus value. - */ - public List tunnelConnectionStatus() { - return this.innerProperties() == null ? null : this.innerProperties().tunnelConnectionStatus(); - } - - /** - * Get the egressBytesTransferred property: The egress bytes transferred in this connection. - * - * @return the egressBytesTransferred value. - */ - public Long egressBytesTransferred() { - return this.innerProperties() == null ? null : this.innerProperties().egressBytesTransferred(); - } - - /** - * Get the ingressBytesTransferred property: The ingress bytes transferred in this connection. - * - * @return the ingressBytesTransferred value. - */ - public Long ingressBytesTransferred() { - return this.innerProperties() == null ? null : this.innerProperties().ingressBytesTransferred(); - } - - /** - * Get the peer property: The reference to peerings resource. - * - * @return the peer value. - */ - public SubResource peer() { - return this.innerProperties() == null ? null : this.innerProperties().peer(); - } - - /** - * Set the peer property: The reference to peerings resource. - * - * @param peer the peer value to set. - * @return the VirtualNetworkGatewayConnectionInner object itself. - */ - public VirtualNetworkGatewayConnectionInner withPeer(SubResource peer) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualNetworkGatewayConnectionPropertiesFormatInner(); - } - this.innerProperties().withPeer(peer); - return this; - } - - /** - * Get the enableBgp property: EnableBgp flag. - * - * @return the enableBgp value. - */ - public Boolean enableBgp() { - return this.innerProperties() == null ? null : this.innerProperties().enableBgp(); - } - - /** - * Set the enableBgp property: EnableBgp flag. - * - * @param enableBgp the enableBgp value to set. - * @return the VirtualNetworkGatewayConnectionInner object itself. - */ - public VirtualNetworkGatewayConnectionInner withEnableBgp(Boolean enableBgp) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualNetworkGatewayConnectionPropertiesFormatInner(); - } - this.innerProperties().withEnableBgp(enableBgp); - return this; - } - - /** - * Get the usePolicyBasedTrafficSelectors property: Enable policy-based traffic selectors. - * - * @return the usePolicyBasedTrafficSelectors value. - */ - public Boolean usePolicyBasedTrafficSelectors() { - return this.innerProperties() == null ? null : this.innerProperties().usePolicyBasedTrafficSelectors(); - } - - /** - * Set the usePolicyBasedTrafficSelectors property: Enable policy-based traffic selectors. - * - * @param usePolicyBasedTrafficSelectors the usePolicyBasedTrafficSelectors value to set. - * @return the VirtualNetworkGatewayConnectionInner object itself. - */ - public VirtualNetworkGatewayConnectionInner withUsePolicyBasedTrafficSelectors( - Boolean usePolicyBasedTrafficSelectors) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualNetworkGatewayConnectionPropertiesFormatInner(); - } - this.innerProperties().withUsePolicyBasedTrafficSelectors(usePolicyBasedTrafficSelectors); - return this; - } - - /** - * Get the ipsecPolicies property: The IPSec Policies to be considered by this connection. - * - * @return the ipsecPolicies value. - */ - public List ipsecPolicies() { - return this.innerProperties() == null ? null : this.innerProperties().ipsecPolicies(); - } - - /** - * Set the ipsecPolicies property: The IPSec Policies to be considered by this connection. - * - * @param ipsecPolicies the ipsecPolicies value to set. - * @return the VirtualNetworkGatewayConnectionInner object itself. - */ - public VirtualNetworkGatewayConnectionInner withIpsecPolicies(List ipsecPolicies) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualNetworkGatewayConnectionPropertiesFormatInner(); - } - this.innerProperties().withIpsecPolicies(ipsecPolicies); - return this; - } - - /** - * Get the resourceGuid property: The resource GUID property of the VirtualNetworkGatewayConnection resource. - * - * @return the resourceGuid value. - */ - public String resourceGuid() { - return this.innerProperties() == null ? null : this.innerProperties().resourceGuid(); - } - - /** - * Set the resourceGuid property: The resource GUID property of the VirtualNetworkGatewayConnection resource. - * - * @param resourceGuid the resourceGuid value to set. - * @return the VirtualNetworkGatewayConnectionInner object itself. - */ - public VirtualNetworkGatewayConnectionInner withResourceGuid(String resourceGuid) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualNetworkGatewayConnectionPropertiesFormatInner(); - } - this.innerProperties().withResourceGuid(resourceGuid); - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the VirtualNetworkGatewayConnection resource. - * Possible values are: 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the expressRouteGatewayBypass property: Bypass ExpressRoute Gateway for data forwarding. - * - * @return the expressRouteGatewayBypass value. - */ - public Boolean expressRouteGatewayBypass() { - return this.innerProperties() == null ? null : this.innerProperties().expressRouteGatewayBypass(); - } - - /** - * Set the expressRouteGatewayBypass property: Bypass ExpressRoute Gateway for data forwarding. - * - * @param expressRouteGatewayBypass the expressRouteGatewayBypass value to set. - * @return the VirtualNetworkGatewayConnectionInner object itself. - */ - public VirtualNetworkGatewayConnectionInner withExpressRouteGatewayBypass(Boolean expressRouteGatewayBypass) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualNetworkGatewayConnectionPropertiesFormatInner(); - } - this.innerProperties().withExpressRouteGatewayBypass(expressRouteGatewayBypass); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property innerProperties in model VirtualNetworkGatewayConnectionInner")); - } else { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VirtualNetworkGatewayConnectionListEntityInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VirtualNetworkGatewayConnectionListEntityInner.java deleted file mode 100644 index 8c8cb75abb89..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VirtualNetworkGatewayConnectionListEntityInner.java +++ /dev/null @@ -1,505 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.IpsecPolicy; -import com.azure.resourcemanager.network.models.TunnelConnectionHealth; -import com.azure.resourcemanager.network.models.VirtualNetworkConnectionGatewayReference; -import com.azure.resourcemanager.network.models.VirtualNetworkGatewayConnectionProtocol; -import com.azure.resourcemanager.network.models.VirtualNetworkGatewayConnectionStatus; -import com.azure.resourcemanager.network.models.VirtualNetworkGatewayConnectionType; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** A common class for general resource information. */ -@Fluent -public final class VirtualNetworkGatewayConnectionListEntityInner extends Resource { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(VirtualNetworkGatewayConnectionListEntityInner.class); - - /* - * Properties of the virtual network gateway connection. - */ - @JsonProperty(value = "properties", required = true) - private VirtualNetworkGatewayConnectionListEntityPropertiesFormat innerProperties = - new VirtualNetworkGatewayConnectionListEntityPropertiesFormat(); - - /* - * Gets a unique read-only string that changes whenever the resource is - * updated. - */ - @JsonProperty(value = "etag") - private String etag; - - /* - * Resource ID. - */ - @JsonProperty(value = "id") - private String id; - - /** - * Get the innerProperties property: Properties of the virtual network gateway connection. - * - * @return the innerProperties value. - */ - private VirtualNetworkGatewayConnectionListEntityPropertiesFormat innerProperties() { - return this.innerProperties; - } - - /** - * Get the etag property: Gets a unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: Gets a unique read-only string that changes whenever the resource is updated. - * - * @param etag the etag value to set. - * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. - */ - public VirtualNetworkGatewayConnectionListEntityInner withEtag(String etag) { - this.etag = etag; - return this; - } - - /** - * Get the id property: Resource ID. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: Resource ID. - * - * @param id the id value to set. - * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. - */ - public VirtualNetworkGatewayConnectionListEntityInner withId(String id) { - this.id = id; - return this; - } - - /** {@inheritDoc} */ - @Override - public VirtualNetworkGatewayConnectionListEntityInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public VirtualNetworkGatewayConnectionListEntityInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the authorizationKey property: The authorizationKey. - * - * @return the authorizationKey value. - */ - public String authorizationKey() { - return this.innerProperties() == null ? null : this.innerProperties().authorizationKey(); - } - - /** - * Set the authorizationKey property: The authorizationKey. - * - * @param authorizationKey the authorizationKey value to set. - * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. - */ - public VirtualNetworkGatewayConnectionListEntityInner withAuthorizationKey(String authorizationKey) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualNetworkGatewayConnectionListEntityPropertiesFormat(); - } - this.innerProperties().withAuthorizationKey(authorizationKey); - return this; - } - - /** - * Get the virtualNetworkGateway1 property: The reference to virtual network gateway resource. - * - * @return the virtualNetworkGateway1 value. - */ - public VirtualNetworkConnectionGatewayReference virtualNetworkGateway1() { - return this.innerProperties() == null ? null : this.innerProperties().virtualNetworkGateway1(); - } - - /** - * Set the virtualNetworkGateway1 property: The reference to virtual network gateway resource. - * - * @param virtualNetworkGateway1 the virtualNetworkGateway1 value to set. - * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. - */ - public VirtualNetworkGatewayConnectionListEntityInner withVirtualNetworkGateway1( - VirtualNetworkConnectionGatewayReference virtualNetworkGateway1) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualNetworkGatewayConnectionListEntityPropertiesFormat(); - } - this.innerProperties().withVirtualNetworkGateway1(virtualNetworkGateway1); - return this; - } - - /** - * Get the virtualNetworkGateway2 property: The reference to virtual network gateway resource. - * - * @return the virtualNetworkGateway2 value. - */ - public VirtualNetworkConnectionGatewayReference virtualNetworkGateway2() { - return this.innerProperties() == null ? null : this.innerProperties().virtualNetworkGateway2(); - } - - /** - * Set the virtualNetworkGateway2 property: The reference to virtual network gateway resource. - * - * @param virtualNetworkGateway2 the virtualNetworkGateway2 value to set. - * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. - */ - public VirtualNetworkGatewayConnectionListEntityInner withVirtualNetworkGateway2( - VirtualNetworkConnectionGatewayReference virtualNetworkGateway2) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualNetworkGatewayConnectionListEntityPropertiesFormat(); - } - this.innerProperties().withVirtualNetworkGateway2(virtualNetworkGateway2); - return this; - } - - /** - * Get the localNetworkGateway2 property: The reference to local network gateway resource. - * - * @return the localNetworkGateway2 value. - */ - public VirtualNetworkConnectionGatewayReference localNetworkGateway2() { - return this.innerProperties() == null ? null : this.innerProperties().localNetworkGateway2(); - } - - /** - * Set the localNetworkGateway2 property: The reference to local network gateway resource. - * - * @param localNetworkGateway2 the localNetworkGateway2 value to set. - * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. - */ - public VirtualNetworkGatewayConnectionListEntityInner withLocalNetworkGateway2( - VirtualNetworkConnectionGatewayReference localNetworkGateway2) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualNetworkGatewayConnectionListEntityPropertiesFormat(); - } - this.innerProperties().withLocalNetworkGateway2(localNetworkGateway2); - return this; - } - - /** - * Get the connectionType property: Gateway connection type. Possible values are: - * 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. - * - * @return the connectionType value. - */ - public VirtualNetworkGatewayConnectionType connectionType() { - return this.innerProperties() == null ? null : this.innerProperties().connectionType(); - } - - /** - * Set the connectionType property: Gateway connection type. Possible values are: - * 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. - * - * @param connectionType the connectionType value to set. - * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. - */ - public VirtualNetworkGatewayConnectionListEntityInner withConnectionType( - VirtualNetworkGatewayConnectionType connectionType) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualNetworkGatewayConnectionListEntityPropertiesFormat(); - } - this.innerProperties().withConnectionType(connectionType); - return this; - } - - /** - * Get the connectionProtocol property: Connection protocol used for this connection. - * - * @return the connectionProtocol value. - */ - public VirtualNetworkGatewayConnectionProtocol connectionProtocol() { - return this.innerProperties() == null ? null : this.innerProperties().connectionProtocol(); - } - - /** - * Set the connectionProtocol property: Connection protocol used for this connection. - * - * @param connectionProtocol the connectionProtocol value to set. - * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. - */ - public VirtualNetworkGatewayConnectionListEntityInner withConnectionProtocol( - VirtualNetworkGatewayConnectionProtocol connectionProtocol) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualNetworkGatewayConnectionListEntityPropertiesFormat(); - } - this.innerProperties().withConnectionProtocol(connectionProtocol); - return this; - } - - /** - * Get the routingWeight property: The routing weight. - * - * @return the routingWeight value. - */ - public Integer routingWeight() { - return this.innerProperties() == null ? null : this.innerProperties().routingWeight(); - } - - /** - * Set the routingWeight property: The routing weight. - * - * @param routingWeight the routingWeight value to set. - * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. - */ - public VirtualNetworkGatewayConnectionListEntityInner withRoutingWeight(Integer routingWeight) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualNetworkGatewayConnectionListEntityPropertiesFormat(); - } - this.innerProperties().withRoutingWeight(routingWeight); - return this; - } - - /** - * Get the sharedKey property: The IPSec shared key. - * - * @return the sharedKey value. - */ - public String sharedKey() { - return this.innerProperties() == null ? null : this.innerProperties().sharedKey(); - } - - /** - * Set the sharedKey property: The IPSec shared key. - * - * @param sharedKey the sharedKey value to set. - * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. - */ - public VirtualNetworkGatewayConnectionListEntityInner withSharedKey(String sharedKey) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualNetworkGatewayConnectionListEntityPropertiesFormat(); - } - this.innerProperties().withSharedKey(sharedKey); - return this; - } - - /** - * Get the connectionStatus property: Virtual network Gateway connection status. Possible values are 'Unknown', - * 'Connecting', 'Connected' and 'NotConnected'. - * - * @return the connectionStatus value. - */ - public VirtualNetworkGatewayConnectionStatus connectionStatus() { - return this.innerProperties() == null ? null : this.innerProperties().connectionStatus(); - } - - /** - * Get the tunnelConnectionStatus property: Collection of all tunnels' connection health status. - * - * @return the tunnelConnectionStatus value. - */ - public List tunnelConnectionStatus() { - return this.innerProperties() == null ? null : this.innerProperties().tunnelConnectionStatus(); - } - - /** - * Get the egressBytesTransferred property: The egress bytes transferred in this connection. - * - * @return the egressBytesTransferred value. - */ - public Long egressBytesTransferred() { - return this.innerProperties() == null ? null : this.innerProperties().egressBytesTransferred(); - } - - /** - * Get the ingressBytesTransferred property: The ingress bytes transferred in this connection. - * - * @return the ingressBytesTransferred value. - */ - public Long ingressBytesTransferred() { - return this.innerProperties() == null ? null : this.innerProperties().ingressBytesTransferred(); - } - - /** - * Get the peer property: The reference to peerings resource. - * - * @return the peer value. - */ - public SubResource peer() { - return this.innerProperties() == null ? null : this.innerProperties().peer(); - } - - /** - * Set the peer property: The reference to peerings resource. - * - * @param peer the peer value to set. - * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. - */ - public VirtualNetworkGatewayConnectionListEntityInner withPeer(SubResource peer) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualNetworkGatewayConnectionListEntityPropertiesFormat(); - } - this.innerProperties().withPeer(peer); - return this; - } - - /** - * Get the enableBgp property: EnableBgp flag. - * - * @return the enableBgp value. - */ - public Boolean enableBgp() { - return this.innerProperties() == null ? null : this.innerProperties().enableBgp(); - } - - /** - * Set the enableBgp property: EnableBgp flag. - * - * @param enableBgp the enableBgp value to set. - * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. - */ - public VirtualNetworkGatewayConnectionListEntityInner withEnableBgp(Boolean enableBgp) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualNetworkGatewayConnectionListEntityPropertiesFormat(); - } - this.innerProperties().withEnableBgp(enableBgp); - return this; - } - - /** - * Get the usePolicyBasedTrafficSelectors property: Enable policy-based traffic selectors. - * - * @return the usePolicyBasedTrafficSelectors value. - */ - public Boolean usePolicyBasedTrafficSelectors() { - return this.innerProperties() == null ? null : this.innerProperties().usePolicyBasedTrafficSelectors(); - } - - /** - * Set the usePolicyBasedTrafficSelectors property: Enable policy-based traffic selectors. - * - * @param usePolicyBasedTrafficSelectors the usePolicyBasedTrafficSelectors value to set. - * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. - */ - public VirtualNetworkGatewayConnectionListEntityInner withUsePolicyBasedTrafficSelectors( - Boolean usePolicyBasedTrafficSelectors) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualNetworkGatewayConnectionListEntityPropertiesFormat(); - } - this.innerProperties().withUsePolicyBasedTrafficSelectors(usePolicyBasedTrafficSelectors); - return this; - } - - /** - * Get the ipsecPolicies property: The IPSec Policies to be considered by this connection. - * - * @return the ipsecPolicies value. - */ - public List ipsecPolicies() { - return this.innerProperties() == null ? null : this.innerProperties().ipsecPolicies(); - } - - /** - * Set the ipsecPolicies property: The IPSec Policies to be considered by this connection. - * - * @param ipsecPolicies the ipsecPolicies value to set. - * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. - */ - public VirtualNetworkGatewayConnectionListEntityInner withIpsecPolicies(List ipsecPolicies) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualNetworkGatewayConnectionListEntityPropertiesFormat(); - } - this.innerProperties().withIpsecPolicies(ipsecPolicies); - return this; - } - - /** - * Get the resourceGuid property: The resource GUID property of the VirtualNetworkGatewayConnection resource. - * - * @return the resourceGuid value. - */ - public String resourceGuid() { - return this.innerProperties() == null ? null : this.innerProperties().resourceGuid(); - } - - /** - * Set the resourceGuid property: The resource GUID property of the VirtualNetworkGatewayConnection resource. - * - * @param resourceGuid the resourceGuid value to set. - * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. - */ - public VirtualNetworkGatewayConnectionListEntityInner withResourceGuid(String resourceGuid) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualNetworkGatewayConnectionListEntityPropertiesFormat(); - } - this.innerProperties().withResourceGuid(resourceGuid); - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the VirtualNetworkGatewayConnection resource. - * Possible values are: 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the expressRouteGatewayBypass property: Bypass ExpressRoute Gateway for data forwarding. - * - * @return the expressRouteGatewayBypass value. - */ - public Boolean expressRouteGatewayBypass() { - return this.innerProperties() == null ? null : this.innerProperties().expressRouteGatewayBypass(); - } - - /** - * Set the expressRouteGatewayBypass property: Bypass ExpressRoute Gateway for data forwarding. - * - * @param expressRouteGatewayBypass the expressRouteGatewayBypass value to set. - * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. - */ - public VirtualNetworkGatewayConnectionListEntityInner withExpressRouteGatewayBypass( - Boolean expressRouteGatewayBypass) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualNetworkGatewayConnectionListEntityPropertiesFormat(); - } - this.innerProperties().withExpressRouteGatewayBypass(expressRouteGatewayBypass); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property innerProperties in model" - + " VirtualNetworkGatewayConnectionListEntityInner")); - } else { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VirtualNetworkGatewayConnectionListEntityPropertiesFormat.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VirtualNetworkGatewayConnectionListEntityPropertiesFormat.java deleted file mode 100644 index 5f7c90a08e06..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VirtualNetworkGatewayConnectionListEntityPropertiesFormat.java +++ /dev/null @@ -1,517 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.IpsecPolicy; -import com.azure.resourcemanager.network.models.TunnelConnectionHealth; -import com.azure.resourcemanager.network.models.VirtualNetworkConnectionGatewayReference; -import com.azure.resourcemanager.network.models.VirtualNetworkGatewayConnectionProtocol; -import com.azure.resourcemanager.network.models.VirtualNetworkGatewayConnectionStatus; -import com.azure.resourcemanager.network.models.VirtualNetworkGatewayConnectionType; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** VirtualNetworkGatewayConnection properties. */ -@Fluent -public final class VirtualNetworkGatewayConnectionListEntityPropertiesFormat { - @JsonIgnore - private final ClientLogger logger = - new ClientLogger(VirtualNetworkGatewayConnectionListEntityPropertiesFormat.class); - - /* - * The authorizationKey. - */ - @JsonProperty(value = "authorizationKey") - private String authorizationKey; - - /* - * The reference to virtual network gateway resource. - */ - @JsonProperty(value = "virtualNetworkGateway1", required = true) - private VirtualNetworkConnectionGatewayReference virtualNetworkGateway1; - - /* - * The reference to virtual network gateway resource. - */ - @JsonProperty(value = "virtualNetworkGateway2") - private VirtualNetworkConnectionGatewayReference virtualNetworkGateway2; - - /* - * The reference to local network gateway resource. - */ - @JsonProperty(value = "localNetworkGateway2") - private VirtualNetworkConnectionGatewayReference localNetworkGateway2; - - /* - * Gateway connection type. Possible values are: - * 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. - */ - @JsonProperty(value = "connectionType", required = true) - private VirtualNetworkGatewayConnectionType connectionType; - - /* - * Connection protocol used for this connection - */ - @JsonProperty(value = "connectionProtocol") - private VirtualNetworkGatewayConnectionProtocol connectionProtocol; - - /* - * The routing weight. - */ - @JsonProperty(value = "routingWeight") - private Integer routingWeight; - - /* - * The IPSec shared key. - */ - @JsonProperty(value = "sharedKey") - private String sharedKey; - - /* - * Virtual network Gateway connection status. Possible values are - * 'Unknown', 'Connecting', 'Connected' and 'NotConnected'. - */ - @JsonProperty(value = "connectionStatus", access = JsonProperty.Access.WRITE_ONLY) - private VirtualNetworkGatewayConnectionStatus connectionStatus; - - /* - * Collection of all tunnels' connection health status. - */ - @JsonProperty(value = "tunnelConnectionStatus", access = JsonProperty.Access.WRITE_ONLY) - private List tunnelConnectionStatus; - - /* - * The egress bytes transferred in this connection. - */ - @JsonProperty(value = "egressBytesTransferred", access = JsonProperty.Access.WRITE_ONLY) - private Long egressBytesTransferred; - - /* - * The ingress bytes transferred in this connection. - */ - @JsonProperty(value = "ingressBytesTransferred", access = JsonProperty.Access.WRITE_ONLY) - private Long ingressBytesTransferred; - - /* - * The reference to peerings resource. - */ - @JsonProperty(value = "peer") - private SubResource peer; - - /* - * EnableBgp flag - */ - @JsonProperty(value = "enableBgp") - private Boolean enableBgp; - - /* - * Enable policy-based traffic selectors. - */ - @JsonProperty(value = "usePolicyBasedTrafficSelectors") - private Boolean usePolicyBasedTrafficSelectors; - - /* - * The IPSec Policies to be considered by this connection. - */ - @JsonProperty(value = "ipsecPolicies") - private List ipsecPolicies; - - /* - * The resource GUID property of the VirtualNetworkGatewayConnection - * resource. - */ - @JsonProperty(value = "resourceGuid") - private String resourceGuid; - - /* - * The provisioning state of the VirtualNetworkGatewayConnection resource. - * Possible values are: 'Updating', 'Deleting', and 'Failed'. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; - - /* - * Bypass ExpressRoute Gateway for data forwarding - */ - @JsonProperty(value = "expressRouteGatewayBypass") - private Boolean expressRouteGatewayBypass; - - /** - * Get the authorizationKey property: The authorizationKey. - * - * @return the authorizationKey value. - */ - public String authorizationKey() { - return this.authorizationKey; - } - - /** - * Set the authorizationKey property: The authorizationKey. - * - * @param authorizationKey the authorizationKey value to set. - * @return the VirtualNetworkGatewayConnectionListEntityPropertiesFormat object itself. - */ - public VirtualNetworkGatewayConnectionListEntityPropertiesFormat withAuthorizationKey(String authorizationKey) { - this.authorizationKey = authorizationKey; - return this; - } - - /** - * Get the virtualNetworkGateway1 property: The reference to virtual network gateway resource. - * - * @return the virtualNetworkGateway1 value. - */ - public VirtualNetworkConnectionGatewayReference virtualNetworkGateway1() { - return this.virtualNetworkGateway1; - } - - /** - * Set the virtualNetworkGateway1 property: The reference to virtual network gateway resource. - * - * @param virtualNetworkGateway1 the virtualNetworkGateway1 value to set. - * @return the VirtualNetworkGatewayConnectionListEntityPropertiesFormat object itself. - */ - public VirtualNetworkGatewayConnectionListEntityPropertiesFormat withVirtualNetworkGateway1( - VirtualNetworkConnectionGatewayReference virtualNetworkGateway1) { - this.virtualNetworkGateway1 = virtualNetworkGateway1; - return this; - } - - /** - * Get the virtualNetworkGateway2 property: The reference to virtual network gateway resource. - * - * @return the virtualNetworkGateway2 value. - */ - public VirtualNetworkConnectionGatewayReference virtualNetworkGateway2() { - return this.virtualNetworkGateway2; - } - - /** - * Set the virtualNetworkGateway2 property: The reference to virtual network gateway resource. - * - * @param virtualNetworkGateway2 the virtualNetworkGateway2 value to set. - * @return the VirtualNetworkGatewayConnectionListEntityPropertiesFormat object itself. - */ - public VirtualNetworkGatewayConnectionListEntityPropertiesFormat withVirtualNetworkGateway2( - VirtualNetworkConnectionGatewayReference virtualNetworkGateway2) { - this.virtualNetworkGateway2 = virtualNetworkGateway2; - return this; - } - - /** - * Get the localNetworkGateway2 property: The reference to local network gateway resource. - * - * @return the localNetworkGateway2 value. - */ - public VirtualNetworkConnectionGatewayReference localNetworkGateway2() { - return this.localNetworkGateway2; - } - - /** - * Set the localNetworkGateway2 property: The reference to local network gateway resource. - * - * @param localNetworkGateway2 the localNetworkGateway2 value to set. - * @return the VirtualNetworkGatewayConnectionListEntityPropertiesFormat object itself. - */ - public VirtualNetworkGatewayConnectionListEntityPropertiesFormat withLocalNetworkGateway2( - VirtualNetworkConnectionGatewayReference localNetworkGateway2) { - this.localNetworkGateway2 = localNetworkGateway2; - return this; - } - - /** - * Get the connectionType property: Gateway connection type. Possible values are: - * 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. - * - * @return the connectionType value. - */ - public VirtualNetworkGatewayConnectionType connectionType() { - return this.connectionType; - } - - /** - * Set the connectionType property: Gateway connection type. Possible values are: - * 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. - * - * @param connectionType the connectionType value to set. - * @return the VirtualNetworkGatewayConnectionListEntityPropertiesFormat object itself. - */ - public VirtualNetworkGatewayConnectionListEntityPropertiesFormat withConnectionType( - VirtualNetworkGatewayConnectionType connectionType) { - this.connectionType = connectionType; - return this; - } - - /** - * Get the connectionProtocol property: Connection protocol used for this connection. - * - * @return the connectionProtocol value. - */ - public VirtualNetworkGatewayConnectionProtocol connectionProtocol() { - return this.connectionProtocol; - } - - /** - * Set the connectionProtocol property: Connection protocol used for this connection. - * - * @param connectionProtocol the connectionProtocol value to set. - * @return the VirtualNetworkGatewayConnectionListEntityPropertiesFormat object itself. - */ - public VirtualNetworkGatewayConnectionListEntityPropertiesFormat withConnectionProtocol( - VirtualNetworkGatewayConnectionProtocol connectionProtocol) { - this.connectionProtocol = connectionProtocol; - return this; - } - - /** - * Get the routingWeight property: The routing weight. - * - * @return the routingWeight value. - */ - public Integer routingWeight() { - return this.routingWeight; - } - - /** - * Set the routingWeight property: The routing weight. - * - * @param routingWeight the routingWeight value to set. - * @return the VirtualNetworkGatewayConnectionListEntityPropertiesFormat object itself. - */ - public VirtualNetworkGatewayConnectionListEntityPropertiesFormat withRoutingWeight(Integer routingWeight) { - this.routingWeight = routingWeight; - return this; - } - - /** - * Get the sharedKey property: The IPSec shared key. - * - * @return the sharedKey value. - */ - public String sharedKey() { - return this.sharedKey; - } - - /** - * Set the sharedKey property: The IPSec shared key. - * - * @param sharedKey the sharedKey value to set. - * @return the VirtualNetworkGatewayConnectionListEntityPropertiesFormat object itself. - */ - public VirtualNetworkGatewayConnectionListEntityPropertiesFormat withSharedKey(String sharedKey) { - this.sharedKey = sharedKey; - return this; - } - - /** - * Get the connectionStatus property: Virtual network Gateway connection status. Possible values are 'Unknown', - * 'Connecting', 'Connected' and 'NotConnected'. - * - * @return the connectionStatus value. - */ - public VirtualNetworkGatewayConnectionStatus connectionStatus() { - return this.connectionStatus; - } - - /** - * Get the tunnelConnectionStatus property: Collection of all tunnels' connection health status. - * - * @return the tunnelConnectionStatus value. - */ - public List tunnelConnectionStatus() { - return this.tunnelConnectionStatus; - } - - /** - * Get the egressBytesTransferred property: The egress bytes transferred in this connection. - * - * @return the egressBytesTransferred value. - */ - public Long egressBytesTransferred() { - return this.egressBytesTransferred; - } - - /** - * Get the ingressBytesTransferred property: The ingress bytes transferred in this connection. - * - * @return the ingressBytesTransferred value. - */ - public Long ingressBytesTransferred() { - return this.ingressBytesTransferred; - } - - /** - * Get the peer property: The reference to peerings resource. - * - * @return the peer value. - */ - public SubResource peer() { - return this.peer; - } - - /** - * Set the peer property: The reference to peerings resource. - * - * @param peer the peer value to set. - * @return the VirtualNetworkGatewayConnectionListEntityPropertiesFormat object itself. - */ - public VirtualNetworkGatewayConnectionListEntityPropertiesFormat withPeer(SubResource peer) { - this.peer = peer; - return this; - } - - /** - * Get the enableBgp property: EnableBgp flag. - * - * @return the enableBgp value. - */ - public Boolean enableBgp() { - return this.enableBgp; - } - - /** - * Set the enableBgp property: EnableBgp flag. - * - * @param enableBgp the enableBgp value to set. - * @return the VirtualNetworkGatewayConnectionListEntityPropertiesFormat object itself. - */ - public VirtualNetworkGatewayConnectionListEntityPropertiesFormat withEnableBgp(Boolean enableBgp) { - this.enableBgp = enableBgp; - return this; - } - - /** - * Get the usePolicyBasedTrafficSelectors property: Enable policy-based traffic selectors. - * - * @return the usePolicyBasedTrafficSelectors value. - */ - public Boolean usePolicyBasedTrafficSelectors() { - return this.usePolicyBasedTrafficSelectors; - } - - /** - * Set the usePolicyBasedTrafficSelectors property: Enable policy-based traffic selectors. - * - * @param usePolicyBasedTrafficSelectors the usePolicyBasedTrafficSelectors value to set. - * @return the VirtualNetworkGatewayConnectionListEntityPropertiesFormat object itself. - */ - public VirtualNetworkGatewayConnectionListEntityPropertiesFormat withUsePolicyBasedTrafficSelectors( - Boolean usePolicyBasedTrafficSelectors) { - this.usePolicyBasedTrafficSelectors = usePolicyBasedTrafficSelectors; - return this; - } - - /** - * Get the ipsecPolicies property: The IPSec Policies to be considered by this connection. - * - * @return the ipsecPolicies value. - */ - public List ipsecPolicies() { - return this.ipsecPolicies; - } - - /** - * Set the ipsecPolicies property: The IPSec Policies to be considered by this connection. - * - * @param ipsecPolicies the ipsecPolicies value to set. - * @return the VirtualNetworkGatewayConnectionListEntityPropertiesFormat object itself. - */ - public VirtualNetworkGatewayConnectionListEntityPropertiesFormat withIpsecPolicies( - List ipsecPolicies) { - this.ipsecPolicies = ipsecPolicies; - return this; - } - - /** - * Get the resourceGuid property: The resource GUID property of the VirtualNetworkGatewayConnection resource. - * - * @return the resourceGuid value. - */ - public String resourceGuid() { - return this.resourceGuid; - } - - /** - * Set the resourceGuid property: The resource GUID property of the VirtualNetworkGatewayConnection resource. - * - * @param resourceGuid the resourceGuid value to set. - * @return the VirtualNetworkGatewayConnectionListEntityPropertiesFormat object itself. - */ - public VirtualNetworkGatewayConnectionListEntityPropertiesFormat withResourceGuid(String resourceGuid) { - this.resourceGuid = resourceGuid; - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the VirtualNetworkGatewayConnection resource. - * Possible values are: 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Get the expressRouteGatewayBypass property: Bypass ExpressRoute Gateway for data forwarding. - * - * @return the expressRouteGatewayBypass value. - */ - public Boolean expressRouteGatewayBypass() { - return this.expressRouteGatewayBypass; - } - - /** - * Set the expressRouteGatewayBypass property: Bypass ExpressRoute Gateway for data forwarding. - * - * @param expressRouteGatewayBypass the expressRouteGatewayBypass value to set. - * @return the VirtualNetworkGatewayConnectionListEntityPropertiesFormat object itself. - */ - public VirtualNetworkGatewayConnectionListEntityPropertiesFormat withExpressRouteGatewayBypass( - Boolean expressRouteGatewayBypass) { - this.expressRouteGatewayBypass = expressRouteGatewayBypass; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (virtualNetworkGateway1() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property virtualNetworkGateway1 in model" - + " VirtualNetworkGatewayConnectionListEntityPropertiesFormat")); - } else { - virtualNetworkGateway1().validate(); - } - if (virtualNetworkGateway2() != null) { - virtualNetworkGateway2().validate(); - } - if (localNetworkGateway2() != null) { - localNetworkGateway2().validate(); - } - if (connectionType() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property connectionType in model" - + " VirtualNetworkGatewayConnectionListEntityPropertiesFormat")); - } - if (tunnelConnectionStatus() != null) { - tunnelConnectionStatus().forEach(e -> e.validate()); - } - if (ipsecPolicies() != null) { - ipsecPolicies().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VirtualNetworkGatewayConnectionPropertiesFormatInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VirtualNetworkGatewayConnectionPropertiesFormatInner.java deleted file mode 100644 index f623b1e3b41e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VirtualNetworkGatewayConnectionPropertiesFormatInner.java +++ /dev/null @@ -1,514 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.IpsecPolicy; -import com.azure.resourcemanager.network.models.TunnelConnectionHealth; -import com.azure.resourcemanager.network.models.VirtualNetworkGatewayConnectionProtocol; -import com.azure.resourcemanager.network.models.VirtualNetworkGatewayConnectionStatus; -import com.azure.resourcemanager.network.models.VirtualNetworkGatewayConnectionType; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** VirtualNetworkGatewayConnection properties. */ -@Fluent -public final class VirtualNetworkGatewayConnectionPropertiesFormatInner { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(VirtualNetworkGatewayConnectionPropertiesFormatInner.class); - - /* - * The authorizationKey. - */ - @JsonProperty(value = "authorizationKey") - private String authorizationKey; - - /* - * The reference to virtual network gateway resource. - */ - @JsonProperty(value = "virtualNetworkGateway1", required = true) - private VirtualNetworkGatewayInner virtualNetworkGateway1; - - /* - * The reference to virtual network gateway resource. - */ - @JsonProperty(value = "virtualNetworkGateway2") - private VirtualNetworkGatewayInner virtualNetworkGateway2; - - /* - * The reference to local network gateway resource. - */ - @JsonProperty(value = "localNetworkGateway2") - private LocalNetworkGatewayInner localNetworkGateway2; - - /* - * Gateway connection type. Possible values are: - * 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. - */ - @JsonProperty(value = "connectionType", required = true) - private VirtualNetworkGatewayConnectionType connectionType; - - /* - * Connection protocol used for this connection - */ - @JsonProperty(value = "connectionProtocol") - private VirtualNetworkGatewayConnectionProtocol connectionProtocol; - - /* - * The routing weight. - */ - @JsonProperty(value = "routingWeight") - private Integer routingWeight; - - /* - * The IPSec shared key. - */ - @JsonProperty(value = "sharedKey") - private String sharedKey; - - /* - * Virtual network Gateway connection status. Possible values are - * 'Unknown', 'Connecting', 'Connected' and 'NotConnected'. - */ - @JsonProperty(value = "connectionStatus", access = JsonProperty.Access.WRITE_ONLY) - private VirtualNetworkGatewayConnectionStatus connectionStatus; - - /* - * Collection of all tunnels' connection health status. - */ - @JsonProperty(value = "tunnelConnectionStatus", access = JsonProperty.Access.WRITE_ONLY) - private List tunnelConnectionStatus; - - /* - * The egress bytes transferred in this connection. - */ - @JsonProperty(value = "egressBytesTransferred", access = JsonProperty.Access.WRITE_ONLY) - private Long egressBytesTransferred; - - /* - * The ingress bytes transferred in this connection. - */ - @JsonProperty(value = "ingressBytesTransferred", access = JsonProperty.Access.WRITE_ONLY) - private Long ingressBytesTransferred; - - /* - * The reference to peerings resource. - */ - @JsonProperty(value = "peer") - private SubResource peer; - - /* - * EnableBgp flag - */ - @JsonProperty(value = "enableBgp") - private Boolean enableBgp; - - /* - * Enable policy-based traffic selectors. - */ - @JsonProperty(value = "usePolicyBasedTrafficSelectors") - private Boolean usePolicyBasedTrafficSelectors; - - /* - * The IPSec Policies to be considered by this connection. - */ - @JsonProperty(value = "ipsecPolicies") - private List ipsecPolicies; - - /* - * The resource GUID property of the VirtualNetworkGatewayConnection - * resource. - */ - @JsonProperty(value = "resourceGuid") - private String resourceGuid; - - /* - * The provisioning state of the VirtualNetworkGatewayConnection resource. - * Possible values are: 'Updating', 'Deleting', and 'Failed'. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; - - /* - * Bypass ExpressRoute Gateway for data forwarding - */ - @JsonProperty(value = "expressRouteGatewayBypass") - private Boolean expressRouteGatewayBypass; - - /** - * Get the authorizationKey property: The authorizationKey. - * - * @return the authorizationKey value. - */ - public String authorizationKey() { - return this.authorizationKey; - } - - /** - * Set the authorizationKey property: The authorizationKey. - * - * @param authorizationKey the authorizationKey value to set. - * @return the VirtualNetworkGatewayConnectionPropertiesFormatInner object itself. - */ - public VirtualNetworkGatewayConnectionPropertiesFormatInner withAuthorizationKey(String authorizationKey) { - this.authorizationKey = authorizationKey; - return this; - } - - /** - * Get the virtualNetworkGateway1 property: The reference to virtual network gateway resource. - * - * @return the virtualNetworkGateway1 value. - */ - public VirtualNetworkGatewayInner virtualNetworkGateway1() { - return this.virtualNetworkGateway1; - } - - /** - * Set the virtualNetworkGateway1 property: The reference to virtual network gateway resource. - * - * @param virtualNetworkGateway1 the virtualNetworkGateway1 value to set. - * @return the VirtualNetworkGatewayConnectionPropertiesFormatInner object itself. - */ - public VirtualNetworkGatewayConnectionPropertiesFormatInner withVirtualNetworkGateway1( - VirtualNetworkGatewayInner virtualNetworkGateway1) { - this.virtualNetworkGateway1 = virtualNetworkGateway1; - return this; - } - - /** - * Get the virtualNetworkGateway2 property: The reference to virtual network gateway resource. - * - * @return the virtualNetworkGateway2 value. - */ - public VirtualNetworkGatewayInner virtualNetworkGateway2() { - return this.virtualNetworkGateway2; - } - - /** - * Set the virtualNetworkGateway2 property: The reference to virtual network gateway resource. - * - * @param virtualNetworkGateway2 the virtualNetworkGateway2 value to set. - * @return the VirtualNetworkGatewayConnectionPropertiesFormatInner object itself. - */ - public VirtualNetworkGatewayConnectionPropertiesFormatInner withVirtualNetworkGateway2( - VirtualNetworkGatewayInner virtualNetworkGateway2) { - this.virtualNetworkGateway2 = virtualNetworkGateway2; - return this; - } - - /** - * Get the localNetworkGateway2 property: The reference to local network gateway resource. - * - * @return the localNetworkGateway2 value. - */ - public LocalNetworkGatewayInner localNetworkGateway2() { - return this.localNetworkGateway2; - } - - /** - * Set the localNetworkGateway2 property: The reference to local network gateway resource. - * - * @param localNetworkGateway2 the localNetworkGateway2 value to set. - * @return the VirtualNetworkGatewayConnectionPropertiesFormatInner object itself. - */ - public VirtualNetworkGatewayConnectionPropertiesFormatInner withLocalNetworkGateway2( - LocalNetworkGatewayInner localNetworkGateway2) { - this.localNetworkGateway2 = localNetworkGateway2; - return this; - } - - /** - * Get the connectionType property: Gateway connection type. Possible values are: - * 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. - * - * @return the connectionType value. - */ - public VirtualNetworkGatewayConnectionType connectionType() { - return this.connectionType; - } - - /** - * Set the connectionType property: Gateway connection type. Possible values are: - * 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. - * - * @param connectionType the connectionType value to set. - * @return the VirtualNetworkGatewayConnectionPropertiesFormatInner object itself. - */ - public VirtualNetworkGatewayConnectionPropertiesFormatInner withConnectionType( - VirtualNetworkGatewayConnectionType connectionType) { - this.connectionType = connectionType; - return this; - } - - /** - * Get the connectionProtocol property: Connection protocol used for this connection. - * - * @return the connectionProtocol value. - */ - public VirtualNetworkGatewayConnectionProtocol connectionProtocol() { - return this.connectionProtocol; - } - - /** - * Set the connectionProtocol property: Connection protocol used for this connection. - * - * @param connectionProtocol the connectionProtocol value to set. - * @return the VirtualNetworkGatewayConnectionPropertiesFormatInner object itself. - */ - public VirtualNetworkGatewayConnectionPropertiesFormatInner withConnectionProtocol( - VirtualNetworkGatewayConnectionProtocol connectionProtocol) { - this.connectionProtocol = connectionProtocol; - return this; - } - - /** - * Get the routingWeight property: The routing weight. - * - * @return the routingWeight value. - */ - public Integer routingWeight() { - return this.routingWeight; - } - - /** - * Set the routingWeight property: The routing weight. - * - * @param routingWeight the routingWeight value to set. - * @return the VirtualNetworkGatewayConnectionPropertiesFormatInner object itself. - */ - public VirtualNetworkGatewayConnectionPropertiesFormatInner withRoutingWeight(Integer routingWeight) { - this.routingWeight = routingWeight; - return this; - } - - /** - * Get the sharedKey property: The IPSec shared key. - * - * @return the sharedKey value. - */ - public String sharedKey() { - return this.sharedKey; - } - - /** - * Set the sharedKey property: The IPSec shared key. - * - * @param sharedKey the sharedKey value to set. - * @return the VirtualNetworkGatewayConnectionPropertiesFormatInner object itself. - */ - public VirtualNetworkGatewayConnectionPropertiesFormatInner withSharedKey(String sharedKey) { - this.sharedKey = sharedKey; - return this; - } - - /** - * Get the connectionStatus property: Virtual network Gateway connection status. Possible values are 'Unknown', - * 'Connecting', 'Connected' and 'NotConnected'. - * - * @return the connectionStatus value. - */ - public VirtualNetworkGatewayConnectionStatus connectionStatus() { - return this.connectionStatus; - } - - /** - * Get the tunnelConnectionStatus property: Collection of all tunnels' connection health status. - * - * @return the tunnelConnectionStatus value. - */ - public List tunnelConnectionStatus() { - return this.tunnelConnectionStatus; - } - - /** - * Get the egressBytesTransferred property: The egress bytes transferred in this connection. - * - * @return the egressBytesTransferred value. - */ - public Long egressBytesTransferred() { - return this.egressBytesTransferred; - } - - /** - * Get the ingressBytesTransferred property: The ingress bytes transferred in this connection. - * - * @return the ingressBytesTransferred value. - */ - public Long ingressBytesTransferred() { - return this.ingressBytesTransferred; - } - - /** - * Get the peer property: The reference to peerings resource. - * - * @return the peer value. - */ - public SubResource peer() { - return this.peer; - } - - /** - * Set the peer property: The reference to peerings resource. - * - * @param peer the peer value to set. - * @return the VirtualNetworkGatewayConnectionPropertiesFormatInner object itself. - */ - public VirtualNetworkGatewayConnectionPropertiesFormatInner withPeer(SubResource peer) { - this.peer = peer; - return this; - } - - /** - * Get the enableBgp property: EnableBgp flag. - * - * @return the enableBgp value. - */ - public Boolean enableBgp() { - return this.enableBgp; - } - - /** - * Set the enableBgp property: EnableBgp flag. - * - * @param enableBgp the enableBgp value to set. - * @return the VirtualNetworkGatewayConnectionPropertiesFormatInner object itself. - */ - public VirtualNetworkGatewayConnectionPropertiesFormatInner withEnableBgp(Boolean enableBgp) { - this.enableBgp = enableBgp; - return this; - } - - /** - * Get the usePolicyBasedTrafficSelectors property: Enable policy-based traffic selectors. - * - * @return the usePolicyBasedTrafficSelectors value. - */ - public Boolean usePolicyBasedTrafficSelectors() { - return this.usePolicyBasedTrafficSelectors; - } - - /** - * Set the usePolicyBasedTrafficSelectors property: Enable policy-based traffic selectors. - * - * @param usePolicyBasedTrafficSelectors the usePolicyBasedTrafficSelectors value to set. - * @return the VirtualNetworkGatewayConnectionPropertiesFormatInner object itself. - */ - public VirtualNetworkGatewayConnectionPropertiesFormatInner withUsePolicyBasedTrafficSelectors( - Boolean usePolicyBasedTrafficSelectors) { - this.usePolicyBasedTrafficSelectors = usePolicyBasedTrafficSelectors; - return this; - } - - /** - * Get the ipsecPolicies property: The IPSec Policies to be considered by this connection. - * - * @return the ipsecPolicies value. - */ - public List ipsecPolicies() { - return this.ipsecPolicies; - } - - /** - * Set the ipsecPolicies property: The IPSec Policies to be considered by this connection. - * - * @param ipsecPolicies the ipsecPolicies value to set. - * @return the VirtualNetworkGatewayConnectionPropertiesFormatInner object itself. - */ - public VirtualNetworkGatewayConnectionPropertiesFormatInner withIpsecPolicies(List ipsecPolicies) { - this.ipsecPolicies = ipsecPolicies; - return this; - } - - /** - * Get the resourceGuid property: The resource GUID property of the VirtualNetworkGatewayConnection resource. - * - * @return the resourceGuid value. - */ - public String resourceGuid() { - return this.resourceGuid; - } - - /** - * Set the resourceGuid property: The resource GUID property of the VirtualNetworkGatewayConnection resource. - * - * @param resourceGuid the resourceGuid value to set. - * @return the VirtualNetworkGatewayConnectionPropertiesFormatInner object itself. - */ - public VirtualNetworkGatewayConnectionPropertiesFormatInner withResourceGuid(String resourceGuid) { - this.resourceGuid = resourceGuid; - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the VirtualNetworkGatewayConnection resource. - * Possible values are: 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Get the expressRouteGatewayBypass property: Bypass ExpressRoute Gateway for data forwarding. - * - * @return the expressRouteGatewayBypass value. - */ - public Boolean expressRouteGatewayBypass() { - return this.expressRouteGatewayBypass; - } - - /** - * Set the expressRouteGatewayBypass property: Bypass ExpressRoute Gateway for data forwarding. - * - * @param expressRouteGatewayBypass the expressRouteGatewayBypass value to set. - * @return the VirtualNetworkGatewayConnectionPropertiesFormatInner object itself. - */ - public VirtualNetworkGatewayConnectionPropertiesFormatInner withExpressRouteGatewayBypass( - Boolean expressRouteGatewayBypass) { - this.expressRouteGatewayBypass = expressRouteGatewayBypass; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (virtualNetworkGateway1() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property virtualNetworkGateway1 in model" - + " VirtualNetworkGatewayConnectionPropertiesFormatInner")); - } else { - virtualNetworkGateway1().validate(); - } - if (virtualNetworkGateway2() != null) { - virtualNetworkGateway2().validate(); - } - if (localNetworkGateway2() != null) { - localNetworkGateway2().validate(); - } - if (connectionType() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property connectionType in model" - + " VirtualNetworkGatewayConnectionPropertiesFormatInner")); - } - if (tunnelConnectionStatus() != null) { - tunnelConnectionStatus().forEach(e -> e.validate()); - } - if (ipsecPolicies() != null) { - ipsecPolicies().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VirtualNetworkGatewayInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VirtualNetworkGatewayInner.java deleted file mode 100644 index dadd039c8095..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VirtualNetworkGatewayInner.java +++ /dev/null @@ -1,374 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.BgpSettings; -import com.azure.resourcemanager.network.models.VirtualNetworkGatewaySku; -import com.azure.resourcemanager.network.models.VirtualNetworkGatewayType; -import com.azure.resourcemanager.network.models.VpnClientConfiguration; -import com.azure.resourcemanager.network.models.VpnType; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** A common class for general resource information. */ -@Fluent -public final class VirtualNetworkGatewayInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkGatewayInner.class); - - /* - * Properties of the virtual network gateway. - */ - @JsonProperty(value = "properties", required = true) - private VirtualNetworkGatewayPropertiesFormat innerProperties = new VirtualNetworkGatewayPropertiesFormat(); - - /* - * Gets a unique read-only string that changes whenever the resource is - * updated. - */ - @JsonProperty(value = "etag") - private String etag; - - /* - * Resource ID. - */ - @JsonProperty(value = "id") - private String id; - - /** - * Get the innerProperties property: Properties of the virtual network gateway. - * - * @return the innerProperties value. - */ - private VirtualNetworkGatewayPropertiesFormat innerProperties() { - return this.innerProperties; - } - - /** - * Get the etag property: Gets a unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: Gets a unique read-only string that changes whenever the resource is updated. - * - * @param etag the etag value to set. - * @return the VirtualNetworkGatewayInner object itself. - */ - public VirtualNetworkGatewayInner withEtag(String etag) { - this.etag = etag; - return this; - } - - /** - * Get the id property: Resource ID. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: Resource ID. - * - * @param id the id value to set. - * @return the VirtualNetworkGatewayInner object itself. - */ - public VirtualNetworkGatewayInner withId(String id) { - this.id = id; - return this; - } - - /** {@inheritDoc} */ - @Override - public VirtualNetworkGatewayInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public VirtualNetworkGatewayInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the ipConfigurations property: IP configurations for virtual network gateway. - * - * @return the ipConfigurations value. - */ - public List ipConfigurations() { - return this.innerProperties() == null ? null : this.innerProperties().ipConfigurations(); - } - - /** - * Set the ipConfigurations property: IP configurations for virtual network gateway. - * - * @param ipConfigurations the ipConfigurations value to set. - * @return the VirtualNetworkGatewayInner object itself. - */ - public VirtualNetworkGatewayInner withIpConfigurations( - List ipConfigurations) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualNetworkGatewayPropertiesFormat(); - } - this.innerProperties().withIpConfigurations(ipConfigurations); - return this; - } - - /** - * Get the gatewayType property: The type of this virtual network gateway. Possible values are: 'Vpn' and - * 'ExpressRoute'. - * - * @return the gatewayType value. - */ - public VirtualNetworkGatewayType gatewayType() { - return this.innerProperties() == null ? null : this.innerProperties().gatewayType(); - } - - /** - * Set the gatewayType property: The type of this virtual network gateway. Possible values are: 'Vpn' and - * 'ExpressRoute'. - * - * @param gatewayType the gatewayType value to set. - * @return the VirtualNetworkGatewayInner object itself. - */ - public VirtualNetworkGatewayInner withGatewayType(VirtualNetworkGatewayType gatewayType) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualNetworkGatewayPropertiesFormat(); - } - this.innerProperties().withGatewayType(gatewayType); - return this; - } - - /** - * Get the vpnType property: The type of this virtual network gateway. Possible values are: 'PolicyBased' and - * 'RouteBased'. - * - * @return the vpnType value. - */ - public VpnType vpnType() { - return this.innerProperties() == null ? null : this.innerProperties().vpnType(); - } - - /** - * Set the vpnType property: The type of this virtual network gateway. Possible values are: 'PolicyBased' and - * 'RouteBased'. - * - * @param vpnType the vpnType value to set. - * @return the VirtualNetworkGatewayInner object itself. - */ - public VirtualNetworkGatewayInner withVpnType(VpnType vpnType) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualNetworkGatewayPropertiesFormat(); - } - this.innerProperties().withVpnType(vpnType); - return this; - } - - /** - * Get the enableBgp property: Whether BGP is enabled for this virtual network gateway or not. - * - * @return the enableBgp value. - */ - public Boolean enableBgp() { - return this.innerProperties() == null ? null : this.innerProperties().enableBgp(); - } - - /** - * Set the enableBgp property: Whether BGP is enabled for this virtual network gateway or not. - * - * @param enableBgp the enableBgp value to set. - * @return the VirtualNetworkGatewayInner object itself. - */ - public VirtualNetworkGatewayInner withEnableBgp(Boolean enableBgp) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualNetworkGatewayPropertiesFormat(); - } - this.innerProperties().withEnableBgp(enableBgp); - return this; - } - - /** - * Get the active property: ActiveActive flag. - * - * @return the active value. - */ - public Boolean active() { - return this.innerProperties() == null ? null : this.innerProperties().active(); - } - - /** - * Set the active property: ActiveActive flag. - * - * @param active the active value to set. - * @return the VirtualNetworkGatewayInner object itself. - */ - public VirtualNetworkGatewayInner withActive(Boolean active) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualNetworkGatewayPropertiesFormat(); - } - this.innerProperties().withActive(active); - return this; - } - - /** - * Get the gatewayDefaultSite property: The reference of the LocalNetworkGateway resource which represents local - * network site having default routes. Assign Null value in case of removing existing default site setting. - * - * @return the gatewayDefaultSite value. - */ - public SubResource gatewayDefaultSite() { - return this.innerProperties() == null ? null : this.innerProperties().gatewayDefaultSite(); - } - - /** - * Set the gatewayDefaultSite property: The reference of the LocalNetworkGateway resource which represents local - * network site having default routes. Assign Null value in case of removing existing default site setting. - * - * @param gatewayDefaultSite the gatewayDefaultSite value to set. - * @return the VirtualNetworkGatewayInner object itself. - */ - public VirtualNetworkGatewayInner withGatewayDefaultSite(SubResource gatewayDefaultSite) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualNetworkGatewayPropertiesFormat(); - } - this.innerProperties().withGatewayDefaultSite(gatewayDefaultSite); - return this; - } - - /** - * Get the sku property: The reference of the VirtualNetworkGatewaySku resource which represents the SKU selected - * for Virtual network gateway. - * - * @return the sku value. - */ - public VirtualNetworkGatewaySku sku() { - return this.innerProperties() == null ? null : this.innerProperties().sku(); - } - - /** - * Set the sku property: The reference of the VirtualNetworkGatewaySku resource which represents the SKU selected - * for Virtual network gateway. - * - * @param sku the sku value to set. - * @return the VirtualNetworkGatewayInner object itself. - */ - public VirtualNetworkGatewayInner withSku(VirtualNetworkGatewaySku sku) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualNetworkGatewayPropertiesFormat(); - } - this.innerProperties().withSku(sku); - return this; - } - - /** - * Get the vpnClientConfiguration property: The reference of the VpnClientConfiguration resource which represents - * the P2S VpnClient configurations. - * - * @return the vpnClientConfiguration value. - */ - public VpnClientConfiguration vpnClientConfiguration() { - return this.innerProperties() == null ? null : this.innerProperties().vpnClientConfiguration(); - } - - /** - * Set the vpnClientConfiguration property: The reference of the VpnClientConfiguration resource which represents - * the P2S VpnClient configurations. - * - * @param vpnClientConfiguration the vpnClientConfiguration value to set. - * @return the VirtualNetworkGatewayInner object itself. - */ - public VirtualNetworkGatewayInner withVpnClientConfiguration(VpnClientConfiguration vpnClientConfiguration) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualNetworkGatewayPropertiesFormat(); - } - this.innerProperties().withVpnClientConfiguration(vpnClientConfiguration); - return this; - } - - /** - * Get the bgpSettings property: Virtual network gateway's BGP speaker settings. - * - * @return the bgpSettings value. - */ - public BgpSettings bgpSettings() { - return this.innerProperties() == null ? null : this.innerProperties().bgpSettings(); - } - - /** - * Set the bgpSettings property: Virtual network gateway's BGP speaker settings. - * - * @param bgpSettings the bgpSettings value to set. - * @return the VirtualNetworkGatewayInner object itself. - */ - public VirtualNetworkGatewayInner withBgpSettings(BgpSettings bgpSettings) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualNetworkGatewayPropertiesFormat(); - } - this.innerProperties().withBgpSettings(bgpSettings); - return this; - } - - /** - * Get the resourceGuid property: The resource GUID property of the VirtualNetworkGateway resource. - * - * @return the resourceGuid value. - */ - public String resourceGuid() { - return this.innerProperties() == null ? null : this.innerProperties().resourceGuid(); - } - - /** - * Set the resourceGuid property: The resource GUID property of the VirtualNetworkGateway resource. - * - * @param resourceGuid the resourceGuid value to set. - * @return the VirtualNetworkGatewayInner object itself. - */ - public VirtualNetworkGatewayInner withResourceGuid(String resourceGuid) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualNetworkGatewayPropertiesFormat(); - } - this.innerProperties().withResourceGuid(resourceGuid); - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the VirtualNetworkGateway resource. Possible values - * are: 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property innerProperties in model VirtualNetworkGatewayInner")); - } else { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VirtualNetworkGatewayIpConfigurationInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VirtualNetworkGatewayIpConfigurationInner.java deleted file mode 100644 index c15dea710510..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VirtualNetworkGatewayIpConfigurationInner.java +++ /dev/null @@ -1,188 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.IpAllocationMethod; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** IP configuration for virtual network gateway. */ -@Fluent -public final class VirtualNetworkGatewayIpConfigurationInner extends SubResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkGatewayIpConfigurationInner.class); - - /* - * Properties of the virtual network gateway ip configuration. - */ - @JsonProperty(value = "properties") - private VirtualNetworkGatewayIpConfigurationPropertiesFormat innerProperties; - - /* - * The name of the resource that is unique within a resource group. This - * name can be used to access the resource. - */ - @JsonProperty(value = "name") - private String name; - - /* - * A unique read-only string that changes whenever the resource is updated. - */ - @JsonProperty(value = "etag") - private String etag; - - /** - * Get the innerProperties property: Properties of the virtual network gateway ip configuration. - * - * @return the innerProperties value. - */ - private VirtualNetworkGatewayIpConfigurationPropertiesFormat innerProperties() { - return this.innerProperties; - } - - /** - * Get the name property: The name of the resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @param name the name value to set. - * @return the VirtualNetworkGatewayIpConfigurationInner object itself. - */ - public VirtualNetworkGatewayIpConfigurationInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @param etag the etag value to set. - * @return the VirtualNetworkGatewayIpConfigurationInner object itself. - */ - public VirtualNetworkGatewayIpConfigurationInner withEtag(String etag) { - this.etag = etag; - return this; - } - - /** {@inheritDoc} */ - @Override - public VirtualNetworkGatewayIpConfigurationInner withId(String id) { - super.withId(id); - return this; - } - - /** - * Get the privateIpAllocationMethod property: The private IP allocation method. Possible values are: 'Static' and - * 'Dynamic'. - * - * @return the privateIpAllocationMethod value. - */ - public IpAllocationMethod privateIpAllocationMethod() { - return this.innerProperties() == null ? null : this.innerProperties().privateIpAllocationMethod(); - } - - /** - * Set the privateIpAllocationMethod property: The private IP allocation method. Possible values are: 'Static' and - * 'Dynamic'. - * - * @param privateIpAllocationMethod the privateIpAllocationMethod value to set. - * @return the VirtualNetworkGatewayIpConfigurationInner object itself. - */ - public VirtualNetworkGatewayIpConfigurationInner withPrivateIpAllocationMethod( - IpAllocationMethod privateIpAllocationMethod) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualNetworkGatewayIpConfigurationPropertiesFormat(); - } - this.innerProperties().withPrivateIpAllocationMethod(privateIpAllocationMethod); - return this; - } - - /** - * Get the subnet property: The reference of the subnet resource. - * - * @return the subnet value. - */ - public SubResource subnet() { - return this.innerProperties() == null ? null : this.innerProperties().subnet(); - } - - /** - * Set the subnet property: The reference of the subnet resource. - * - * @param subnet the subnet value to set. - * @return the VirtualNetworkGatewayIpConfigurationInner object itself. - */ - public VirtualNetworkGatewayIpConfigurationInner withSubnet(SubResource subnet) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualNetworkGatewayIpConfigurationPropertiesFormat(); - } - this.innerProperties().withSubnet(subnet); - return this; - } - - /** - * Get the publicIpAddress property: The reference of the public IP resource. - * - * @return the publicIpAddress value. - */ - public SubResource publicIpAddress() { - return this.innerProperties() == null ? null : this.innerProperties().publicIpAddress(); - } - - /** - * Set the publicIpAddress property: The reference of the public IP resource. - * - * @param publicIpAddress the publicIpAddress value to set. - * @return the VirtualNetworkGatewayIpConfigurationInner object itself. - */ - public VirtualNetworkGatewayIpConfigurationInner withPublicIpAddress(SubResource publicIpAddress) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualNetworkGatewayIpConfigurationPropertiesFormat(); - } - this.innerProperties().withPublicIpAddress(publicIpAddress); - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VirtualNetworkGatewayIpConfigurationPropertiesFormat.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VirtualNetworkGatewayIpConfigurationPropertiesFormat.java deleted file mode 100644 index 8094eb573659..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VirtualNetworkGatewayIpConfigurationPropertiesFormat.java +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.IpAllocationMethod; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Properties of VirtualNetworkGatewayIPConfiguration. */ -@Fluent -public final class VirtualNetworkGatewayIpConfigurationPropertiesFormat { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(VirtualNetworkGatewayIpConfigurationPropertiesFormat.class); - - /* - * The private IP allocation method. Possible values are: 'Static' and - * 'Dynamic'. - */ - @JsonProperty(value = "privateIPAllocationMethod") - private IpAllocationMethod privateIpAllocationMethod; - - /* - * The reference of the subnet resource. - */ - @JsonProperty(value = "subnet") - private SubResource subnet; - - /* - * The reference of the public IP resource. - */ - @JsonProperty(value = "publicIPAddress") - private SubResource publicIpAddress; - - /* - * The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; - - /** - * Get the privateIpAllocationMethod property: The private IP allocation method. Possible values are: 'Static' and - * 'Dynamic'. - * - * @return the privateIpAllocationMethod value. - */ - public IpAllocationMethod privateIpAllocationMethod() { - return this.privateIpAllocationMethod; - } - - /** - * Set the privateIpAllocationMethod property: The private IP allocation method. Possible values are: 'Static' and - * 'Dynamic'. - * - * @param privateIpAllocationMethod the privateIpAllocationMethod value to set. - * @return the VirtualNetworkGatewayIpConfigurationPropertiesFormat object itself. - */ - public VirtualNetworkGatewayIpConfigurationPropertiesFormat withPrivateIpAllocationMethod( - IpAllocationMethod privateIpAllocationMethod) { - this.privateIpAllocationMethod = privateIpAllocationMethod; - return this; - } - - /** - * Get the subnet property: The reference of the subnet resource. - * - * @return the subnet value. - */ - public SubResource subnet() { - return this.subnet; - } - - /** - * Set the subnet property: The reference of the subnet resource. - * - * @param subnet the subnet value to set. - * @return the VirtualNetworkGatewayIpConfigurationPropertiesFormat object itself. - */ - public VirtualNetworkGatewayIpConfigurationPropertiesFormat withSubnet(SubResource subnet) { - this.subnet = subnet; - return this; - } - - /** - * Get the publicIpAddress property: The reference of the public IP resource. - * - * @return the publicIpAddress value. - */ - public SubResource publicIpAddress() { - return this.publicIpAddress; - } - - /** - * Set the publicIpAddress property: The reference of the public IP resource. - * - * @param publicIpAddress the publicIpAddress value to set. - * @return the VirtualNetworkGatewayIpConfigurationPropertiesFormat object itself. - */ - public VirtualNetworkGatewayIpConfigurationPropertiesFormat withPublicIpAddress(SubResource publicIpAddress) { - this.publicIpAddress = publicIpAddress; - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VirtualNetworkGatewayPropertiesFormat.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VirtualNetworkGatewayPropertiesFormat.java deleted file mode 100644 index 23c523f9dd1a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VirtualNetworkGatewayPropertiesFormat.java +++ /dev/null @@ -1,338 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.BgpSettings; -import com.azure.resourcemanager.network.models.VirtualNetworkGatewaySku; -import com.azure.resourcemanager.network.models.VirtualNetworkGatewayType; -import com.azure.resourcemanager.network.models.VpnClientConfiguration; -import com.azure.resourcemanager.network.models.VpnType; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** VirtualNetworkGateway properties. */ -@Fluent -public final class VirtualNetworkGatewayPropertiesFormat { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkGatewayPropertiesFormat.class); - - /* - * IP configurations for virtual network gateway. - */ - @JsonProperty(value = "ipConfigurations") - private List ipConfigurations; - - /* - * The type of this virtual network gateway. Possible values are: 'Vpn' and - * 'ExpressRoute'. - */ - @JsonProperty(value = "gatewayType") - private VirtualNetworkGatewayType gatewayType; - - /* - * The type of this virtual network gateway. Possible values are: - * 'PolicyBased' and 'RouteBased'. - */ - @JsonProperty(value = "vpnType") - private VpnType vpnType; - - /* - * Whether BGP is enabled for this virtual network gateway or not. - */ - @JsonProperty(value = "enableBgp") - private Boolean enableBgp; - - /* - * ActiveActive flag - */ - @JsonProperty(value = "activeActive") - private Boolean active; - - /* - * The reference of the LocalNetworkGateway resource which represents local - * network site having default routes. Assign Null value in case of - * removing existing default site setting. - */ - @JsonProperty(value = "gatewayDefaultSite") - private SubResource gatewayDefaultSite; - - /* - * The reference of the VirtualNetworkGatewaySku resource which represents - * the SKU selected for Virtual network gateway. - */ - @JsonProperty(value = "sku") - private VirtualNetworkGatewaySku sku; - - /* - * The reference of the VpnClientConfiguration resource which represents - * the P2S VpnClient configurations. - */ - @JsonProperty(value = "vpnClientConfiguration") - private VpnClientConfiguration vpnClientConfiguration; - - /* - * Virtual network gateway's BGP speaker settings. - */ - @JsonProperty(value = "bgpSettings") - private BgpSettings bgpSettings; - - /* - * The resource GUID property of the VirtualNetworkGateway resource. - */ - @JsonProperty(value = "resourceGuid") - private String resourceGuid; - - /* - * The provisioning state of the VirtualNetworkGateway resource. Possible - * values are: 'Updating', 'Deleting', and 'Failed'. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; - - /** - * Get the ipConfigurations property: IP configurations for virtual network gateway. - * - * @return the ipConfigurations value. - */ - public List ipConfigurations() { - return this.ipConfigurations; - } - - /** - * Set the ipConfigurations property: IP configurations for virtual network gateway. - * - * @param ipConfigurations the ipConfigurations value to set. - * @return the VirtualNetworkGatewayPropertiesFormat object itself. - */ - public VirtualNetworkGatewayPropertiesFormat withIpConfigurations( - List ipConfigurations) { - this.ipConfigurations = ipConfigurations; - return this; - } - - /** - * Get the gatewayType property: The type of this virtual network gateway. Possible values are: 'Vpn' and - * 'ExpressRoute'. - * - * @return the gatewayType value. - */ - public VirtualNetworkGatewayType gatewayType() { - return this.gatewayType; - } - - /** - * Set the gatewayType property: The type of this virtual network gateway. Possible values are: 'Vpn' and - * 'ExpressRoute'. - * - * @param gatewayType the gatewayType value to set. - * @return the VirtualNetworkGatewayPropertiesFormat object itself. - */ - public VirtualNetworkGatewayPropertiesFormat withGatewayType(VirtualNetworkGatewayType gatewayType) { - this.gatewayType = gatewayType; - return this; - } - - /** - * Get the vpnType property: The type of this virtual network gateway. Possible values are: 'PolicyBased' and - * 'RouteBased'. - * - * @return the vpnType value. - */ - public VpnType vpnType() { - return this.vpnType; - } - - /** - * Set the vpnType property: The type of this virtual network gateway. Possible values are: 'PolicyBased' and - * 'RouteBased'. - * - * @param vpnType the vpnType value to set. - * @return the VirtualNetworkGatewayPropertiesFormat object itself. - */ - public VirtualNetworkGatewayPropertiesFormat withVpnType(VpnType vpnType) { - this.vpnType = vpnType; - return this; - } - - /** - * Get the enableBgp property: Whether BGP is enabled for this virtual network gateway or not. - * - * @return the enableBgp value. - */ - public Boolean enableBgp() { - return this.enableBgp; - } - - /** - * Set the enableBgp property: Whether BGP is enabled for this virtual network gateway or not. - * - * @param enableBgp the enableBgp value to set. - * @return the VirtualNetworkGatewayPropertiesFormat object itself. - */ - public VirtualNetworkGatewayPropertiesFormat withEnableBgp(Boolean enableBgp) { - this.enableBgp = enableBgp; - return this; - } - - /** - * Get the active property: ActiveActive flag. - * - * @return the active value. - */ - public Boolean active() { - return this.active; - } - - /** - * Set the active property: ActiveActive flag. - * - * @param active the active value to set. - * @return the VirtualNetworkGatewayPropertiesFormat object itself. - */ - public VirtualNetworkGatewayPropertiesFormat withActive(Boolean active) { - this.active = active; - return this; - } - - /** - * Get the gatewayDefaultSite property: The reference of the LocalNetworkGateway resource which represents local - * network site having default routes. Assign Null value in case of removing existing default site setting. - * - * @return the gatewayDefaultSite value. - */ - public SubResource gatewayDefaultSite() { - return this.gatewayDefaultSite; - } - - /** - * Set the gatewayDefaultSite property: The reference of the LocalNetworkGateway resource which represents local - * network site having default routes. Assign Null value in case of removing existing default site setting. - * - * @param gatewayDefaultSite the gatewayDefaultSite value to set. - * @return the VirtualNetworkGatewayPropertiesFormat object itself. - */ - public VirtualNetworkGatewayPropertiesFormat withGatewayDefaultSite(SubResource gatewayDefaultSite) { - this.gatewayDefaultSite = gatewayDefaultSite; - return this; - } - - /** - * Get the sku property: The reference of the VirtualNetworkGatewaySku resource which represents the SKU selected - * for Virtual network gateway. - * - * @return the sku value. - */ - public VirtualNetworkGatewaySku sku() { - return this.sku; - } - - /** - * Set the sku property: The reference of the VirtualNetworkGatewaySku resource which represents the SKU selected - * for Virtual network gateway. - * - * @param sku the sku value to set. - * @return the VirtualNetworkGatewayPropertiesFormat object itself. - */ - public VirtualNetworkGatewayPropertiesFormat withSku(VirtualNetworkGatewaySku sku) { - this.sku = sku; - return this; - } - - /** - * Get the vpnClientConfiguration property: The reference of the VpnClientConfiguration resource which represents - * the P2S VpnClient configurations. - * - * @return the vpnClientConfiguration value. - */ - public VpnClientConfiguration vpnClientConfiguration() { - return this.vpnClientConfiguration; - } - - /** - * Set the vpnClientConfiguration property: The reference of the VpnClientConfiguration resource which represents - * the P2S VpnClient configurations. - * - * @param vpnClientConfiguration the vpnClientConfiguration value to set. - * @return the VirtualNetworkGatewayPropertiesFormat object itself. - */ - public VirtualNetworkGatewayPropertiesFormat withVpnClientConfiguration( - VpnClientConfiguration vpnClientConfiguration) { - this.vpnClientConfiguration = vpnClientConfiguration; - return this; - } - - /** - * Get the bgpSettings property: Virtual network gateway's BGP speaker settings. - * - * @return the bgpSettings value. - */ - public BgpSettings bgpSettings() { - return this.bgpSettings; - } - - /** - * Set the bgpSettings property: Virtual network gateway's BGP speaker settings. - * - * @param bgpSettings the bgpSettings value to set. - * @return the VirtualNetworkGatewayPropertiesFormat object itself. - */ - public VirtualNetworkGatewayPropertiesFormat withBgpSettings(BgpSettings bgpSettings) { - this.bgpSettings = bgpSettings; - return this; - } - - /** - * Get the resourceGuid property: The resource GUID property of the VirtualNetworkGateway resource. - * - * @return the resourceGuid value. - */ - public String resourceGuid() { - return this.resourceGuid; - } - - /** - * Set the resourceGuid property: The resource GUID property of the VirtualNetworkGateway resource. - * - * @param resourceGuid the resourceGuid value to set. - * @return the VirtualNetworkGatewayPropertiesFormat object itself. - */ - public VirtualNetworkGatewayPropertiesFormat withResourceGuid(String resourceGuid) { - this.resourceGuid = resourceGuid; - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the VirtualNetworkGateway resource. Possible values - * are: 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (ipConfigurations() != null) { - ipConfigurations().forEach(e -> e.validate()); - } - if (sku() != null) { - sku().validate(); - } - if (vpnClientConfiguration() != null) { - vpnClientConfiguration().validate(); - } - if (bgpSettings() != null) { - bgpSettings().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VirtualNetworkInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VirtualNetworkInner.java deleted file mode 100644 index ad4e1fe914a4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VirtualNetworkInner.java +++ /dev/null @@ -1,332 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.AddressSpace; -import com.azure.resourcemanager.network.models.DhcpOptions; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** Virtual Network resource. */ -@Fluent -public final class VirtualNetworkInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkInner.class); - - /* - * Properties of the virtual network. - */ - @JsonProperty(value = "properties") - private VirtualNetworkPropertiesFormat innerProperties; - - /* - * Gets a unique read-only string that changes whenever the resource is - * updated. - */ - @JsonProperty(value = "etag") - private String etag; - - /* - * Resource ID. - */ - @JsonProperty(value = "id") - private String id; - - /** - * Get the innerProperties property: Properties of the virtual network. - * - * @return the innerProperties value. - */ - private VirtualNetworkPropertiesFormat innerProperties() { - return this.innerProperties; - } - - /** - * Get the etag property: Gets a unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: Gets a unique read-only string that changes whenever the resource is updated. - * - * @param etag the etag value to set. - * @return the VirtualNetworkInner object itself. - */ - public VirtualNetworkInner withEtag(String etag) { - this.etag = etag; - return this; - } - - /** - * Get the id property: Resource ID. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: Resource ID. - * - * @param id the id value to set. - * @return the VirtualNetworkInner object itself. - */ - public VirtualNetworkInner withId(String id) { - this.id = id; - return this; - } - - /** {@inheritDoc} */ - @Override - public VirtualNetworkInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public VirtualNetworkInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the addressSpace property: The AddressSpace that contains an array of IP address ranges that can be used by - * subnets. - * - * @return the addressSpace value. - */ - public AddressSpace addressSpace() { - return this.innerProperties() == null ? null : this.innerProperties().addressSpace(); - } - - /** - * Set the addressSpace property: The AddressSpace that contains an array of IP address ranges that can be used by - * subnets. - * - * @param addressSpace the addressSpace value to set. - * @return the VirtualNetworkInner object itself. - */ - public VirtualNetworkInner withAddressSpace(AddressSpace addressSpace) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualNetworkPropertiesFormat(); - } - this.innerProperties().withAddressSpace(addressSpace); - return this; - } - - /** - * Get the dhcpOptions property: The dhcpOptions that contains an array of DNS servers available to VMs deployed in - * the virtual network. - * - * @return the dhcpOptions value. - */ - public DhcpOptions dhcpOptions() { - return this.innerProperties() == null ? null : this.innerProperties().dhcpOptions(); - } - - /** - * Set the dhcpOptions property: The dhcpOptions that contains an array of DNS servers available to VMs deployed in - * the virtual network. - * - * @param dhcpOptions the dhcpOptions value to set. - * @return the VirtualNetworkInner object itself. - */ - public VirtualNetworkInner withDhcpOptions(DhcpOptions dhcpOptions) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualNetworkPropertiesFormat(); - } - this.innerProperties().withDhcpOptions(dhcpOptions); - return this; - } - - /** - * Get the subnets property: A list of subnets in a Virtual Network. - * - * @return the subnets value. - */ - public List subnets() { - return this.innerProperties() == null ? null : this.innerProperties().subnets(); - } - - /** - * Set the subnets property: A list of subnets in a Virtual Network. - * - * @param subnets the subnets value to set. - * @return the VirtualNetworkInner object itself. - */ - public VirtualNetworkInner withSubnets(List subnets) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualNetworkPropertiesFormat(); - } - this.innerProperties().withSubnets(subnets); - return this; - } - - /** - * Get the virtualNetworkPeerings property: A list of peerings in a Virtual Network. - * - * @return the virtualNetworkPeerings value. - */ - public List virtualNetworkPeerings() { - return this.innerProperties() == null ? null : this.innerProperties().virtualNetworkPeerings(); - } - - /** - * Set the virtualNetworkPeerings property: A list of peerings in a Virtual Network. - * - * @param virtualNetworkPeerings the virtualNetworkPeerings value to set. - * @return the VirtualNetworkInner object itself. - */ - public VirtualNetworkInner withVirtualNetworkPeerings(List virtualNetworkPeerings) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualNetworkPropertiesFormat(); - } - this.innerProperties().withVirtualNetworkPeerings(virtualNetworkPeerings); - return this; - } - - /** - * Get the resourceGuid property: The resourceGuid property of the Virtual Network resource. - * - * @return the resourceGuid value. - */ - public String resourceGuid() { - return this.innerProperties() == null ? null : this.innerProperties().resourceGuid(); - } - - /** - * Set the resourceGuid property: The resourceGuid property of the Virtual Network resource. - * - * @param resourceGuid the resourceGuid value to set. - * @return the VirtualNetworkInner object itself. - */ - public VirtualNetworkInner withResourceGuid(String resourceGuid) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualNetworkPropertiesFormat(); - } - this.innerProperties().withResourceGuid(resourceGuid); - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the PublicIP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Set the provisioningState property: The provisioning state of the PublicIP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param provisioningState the provisioningState value to set. - * @return the VirtualNetworkInner object itself. - */ - public VirtualNetworkInner withProvisioningState(String provisioningState) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualNetworkPropertiesFormat(); - } - this.innerProperties().withProvisioningState(provisioningState); - return this; - } - - /** - * Get the enableDdosProtection property: Indicates if DDoS protection is enabled for all the protected resources in - * the virtual network. It requires a DDoS protection plan associated with the resource. - * - * @return the enableDdosProtection value. - */ - public Boolean enableDdosProtection() { - return this.innerProperties() == null ? null : this.innerProperties().enableDdosProtection(); - } - - /** - * Set the enableDdosProtection property: Indicates if DDoS protection is enabled for all the protected resources in - * the virtual network. It requires a DDoS protection plan associated with the resource. - * - * @param enableDdosProtection the enableDdosProtection value to set. - * @return the VirtualNetworkInner object itself. - */ - public VirtualNetworkInner withEnableDdosProtection(Boolean enableDdosProtection) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualNetworkPropertiesFormat(); - } - this.innerProperties().withEnableDdosProtection(enableDdosProtection); - return this; - } - - /** - * Get the enableVmProtection property: Indicates if VM protection is enabled for all the subnets in the virtual - * network. - * - * @return the enableVmProtection value. - */ - public Boolean enableVmProtection() { - return this.innerProperties() == null ? null : this.innerProperties().enableVmProtection(); - } - - /** - * Set the enableVmProtection property: Indicates if VM protection is enabled for all the subnets in the virtual - * network. - * - * @param enableVmProtection the enableVmProtection value to set. - * @return the VirtualNetworkInner object itself. - */ - public VirtualNetworkInner withEnableVmProtection(Boolean enableVmProtection) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualNetworkPropertiesFormat(); - } - this.innerProperties().withEnableVmProtection(enableVmProtection); - return this; - } - - /** - * Get the ddosProtectionPlan property: The DDoS protection plan associated with the virtual network. - * - * @return the ddosProtectionPlan value. - */ - public SubResource ddosProtectionPlan() { - return this.innerProperties() == null ? null : this.innerProperties().ddosProtectionPlan(); - } - - /** - * Set the ddosProtectionPlan property: The DDoS protection plan associated with the virtual network. - * - * @param ddosProtectionPlan the ddosProtectionPlan value to set. - * @return the VirtualNetworkInner object itself. - */ - public VirtualNetworkInner withDdosProtectionPlan(SubResource ddosProtectionPlan) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualNetworkPropertiesFormat(); - } - this.innerProperties().withDdosProtectionPlan(ddosProtectionPlan); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VirtualNetworkPeeringInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VirtualNetworkPeeringInner.java deleted file mode 100644 index 4224e3205918..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VirtualNetworkPeeringInner.java +++ /dev/null @@ -1,309 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.AddressSpace; -import com.azure.resourcemanager.network.models.VirtualNetworkPeeringState; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Peerings in a virtual network resource. */ -@Fluent -public final class VirtualNetworkPeeringInner extends SubResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkPeeringInner.class); - - /* - * Properties of the virtual network peering. - */ - @JsonProperty(value = "properties") - private VirtualNetworkPeeringPropertiesFormat innerProperties; - - /* - * The name of the resource that is unique within a resource group. This - * name can be used to access the resource. - */ - @JsonProperty(value = "name") - private String name; - - /* - * A unique read-only string that changes whenever the resource is updated. - */ - @JsonProperty(value = "etag") - private String etag; - - /** - * Get the innerProperties property: Properties of the virtual network peering. - * - * @return the innerProperties value. - */ - private VirtualNetworkPeeringPropertiesFormat innerProperties() { - return this.innerProperties; - } - - /** - * Get the name property: The name of the resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @param name the name value to set. - * @return the VirtualNetworkPeeringInner object itself. - */ - public VirtualNetworkPeeringInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @param etag the etag value to set. - * @return the VirtualNetworkPeeringInner object itself. - */ - public VirtualNetworkPeeringInner withEtag(String etag) { - this.etag = etag; - return this; - } - - /** {@inheritDoc} */ - @Override - public VirtualNetworkPeeringInner withId(String id) { - super.withId(id); - return this; - } - - /** - * Get the allowVirtualNetworkAccess property: Whether the VMs in the linked virtual network space would be able to - * access all the VMs in local Virtual network space. - * - * @return the allowVirtualNetworkAccess value. - */ - public Boolean allowVirtualNetworkAccess() { - return this.innerProperties() == null ? null : this.innerProperties().allowVirtualNetworkAccess(); - } - - /** - * Set the allowVirtualNetworkAccess property: Whether the VMs in the linked virtual network space would be able to - * access all the VMs in local Virtual network space. - * - * @param allowVirtualNetworkAccess the allowVirtualNetworkAccess value to set. - * @return the VirtualNetworkPeeringInner object itself. - */ - public VirtualNetworkPeeringInner withAllowVirtualNetworkAccess(Boolean allowVirtualNetworkAccess) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualNetworkPeeringPropertiesFormat(); - } - this.innerProperties().withAllowVirtualNetworkAccess(allowVirtualNetworkAccess); - return this; - } - - /** - * Get the allowForwardedTraffic property: Whether the forwarded traffic from the VMs in the remote virtual network - * will be allowed/disallowed. - * - * @return the allowForwardedTraffic value. - */ - public Boolean allowForwardedTraffic() { - return this.innerProperties() == null ? null : this.innerProperties().allowForwardedTraffic(); - } - - /** - * Set the allowForwardedTraffic property: Whether the forwarded traffic from the VMs in the remote virtual network - * will be allowed/disallowed. - * - * @param allowForwardedTraffic the allowForwardedTraffic value to set. - * @return the VirtualNetworkPeeringInner object itself. - */ - public VirtualNetworkPeeringInner withAllowForwardedTraffic(Boolean allowForwardedTraffic) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualNetworkPeeringPropertiesFormat(); - } - this.innerProperties().withAllowForwardedTraffic(allowForwardedTraffic); - return this; - } - - /** - * Get the allowGatewayTransit property: If gateway links can be used in remote virtual networking to link to this - * virtual network. - * - * @return the allowGatewayTransit value. - */ - public Boolean allowGatewayTransit() { - return this.innerProperties() == null ? null : this.innerProperties().allowGatewayTransit(); - } - - /** - * Set the allowGatewayTransit property: If gateway links can be used in remote virtual networking to link to this - * virtual network. - * - * @param allowGatewayTransit the allowGatewayTransit value to set. - * @return the VirtualNetworkPeeringInner object itself. - */ - public VirtualNetworkPeeringInner withAllowGatewayTransit(Boolean allowGatewayTransit) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualNetworkPeeringPropertiesFormat(); - } - this.innerProperties().withAllowGatewayTransit(allowGatewayTransit); - return this; - } - - /** - * Get the useRemoteGateways property: If remote gateways can be used on this virtual network. If the flag is set to - * true, and allowGatewayTransit on remote peering is also true, virtual network will use gateways of remote virtual - * network for transit. Only one peering can have this flag set to true. This flag cannot be set if virtual network - * already has a gateway. - * - * @return the useRemoteGateways value. - */ - public Boolean useRemoteGateways() { - return this.innerProperties() == null ? null : this.innerProperties().useRemoteGateways(); - } - - /** - * Set the useRemoteGateways property: If remote gateways can be used on this virtual network. If the flag is set to - * true, and allowGatewayTransit on remote peering is also true, virtual network will use gateways of remote virtual - * network for transit. Only one peering can have this flag set to true. This flag cannot be set if virtual network - * already has a gateway. - * - * @param useRemoteGateways the useRemoteGateways value to set. - * @return the VirtualNetworkPeeringInner object itself. - */ - public VirtualNetworkPeeringInner withUseRemoteGateways(Boolean useRemoteGateways) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualNetworkPeeringPropertiesFormat(); - } - this.innerProperties().withUseRemoteGateways(useRemoteGateways); - return this; - } - - /** - * Get the remoteVirtualNetwork property: The reference of the remote virtual network. The remote virtual network - * can be in the same or different region (preview). See here to register for the preview and learn more - * (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering). - * - * @return the remoteVirtualNetwork value. - */ - public SubResource remoteVirtualNetwork() { - return this.innerProperties() == null ? null : this.innerProperties().remoteVirtualNetwork(); - } - - /** - * Set the remoteVirtualNetwork property: The reference of the remote virtual network. The remote virtual network - * can be in the same or different region (preview). See here to register for the preview and learn more - * (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering). - * - * @param remoteVirtualNetwork the remoteVirtualNetwork value to set. - * @return the VirtualNetworkPeeringInner object itself. - */ - public VirtualNetworkPeeringInner withRemoteVirtualNetwork(SubResource remoteVirtualNetwork) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualNetworkPeeringPropertiesFormat(); - } - this.innerProperties().withRemoteVirtualNetwork(remoteVirtualNetwork); - return this; - } - - /** - * Get the remoteAddressSpace property: The reference of the remote virtual network address space. - * - * @return the remoteAddressSpace value. - */ - public AddressSpace remoteAddressSpace() { - return this.innerProperties() == null ? null : this.innerProperties().remoteAddressSpace(); - } - - /** - * Set the remoteAddressSpace property: The reference of the remote virtual network address space. - * - * @param remoteAddressSpace the remoteAddressSpace value to set. - * @return the VirtualNetworkPeeringInner object itself. - */ - public VirtualNetworkPeeringInner withRemoteAddressSpace(AddressSpace remoteAddressSpace) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualNetworkPeeringPropertiesFormat(); - } - this.innerProperties().withRemoteAddressSpace(remoteAddressSpace); - return this; - } - - /** - * Get the peeringState property: The status of the virtual network peering. Possible values are 'Initiated', - * 'Connected', and 'Disconnected'. - * - * @return the peeringState value. - */ - public VirtualNetworkPeeringState peeringState() { - return this.innerProperties() == null ? null : this.innerProperties().peeringState(); - } - - /** - * Set the peeringState property: The status of the virtual network peering. Possible values are 'Initiated', - * 'Connected', and 'Disconnected'. - * - * @param peeringState the peeringState value to set. - * @return the VirtualNetworkPeeringInner object itself. - */ - public VirtualNetworkPeeringInner withPeeringState(VirtualNetworkPeeringState peeringState) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualNetworkPeeringPropertiesFormat(); - } - this.innerProperties().withPeeringState(peeringState); - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the resource. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Set the provisioningState property: The provisioning state of the resource. - * - * @param provisioningState the provisioningState value to set. - * @return the VirtualNetworkPeeringInner object itself. - */ - public VirtualNetworkPeeringInner withProvisioningState(String provisioningState) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualNetworkPeeringPropertiesFormat(); - } - this.innerProperties().withProvisioningState(provisioningState); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VirtualNetworkPeeringPropertiesFormat.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VirtualNetworkPeeringPropertiesFormat.java deleted file mode 100644 index 17db5a9a75e7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VirtualNetworkPeeringPropertiesFormat.java +++ /dev/null @@ -1,267 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.AddressSpace; -import com.azure.resourcemanager.network.models.VirtualNetworkPeeringState; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Properties of the virtual network peering. */ -@Fluent -public final class VirtualNetworkPeeringPropertiesFormat { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkPeeringPropertiesFormat.class); - - /* - * Whether the VMs in the linked virtual network space would be able to - * access all the VMs in local Virtual network space. - */ - @JsonProperty(value = "allowVirtualNetworkAccess") - private Boolean allowVirtualNetworkAccess; - - /* - * Whether the forwarded traffic from the VMs in the remote virtual network - * will be allowed/disallowed. - */ - @JsonProperty(value = "allowForwardedTraffic") - private Boolean allowForwardedTraffic; - - /* - * If gateway links can be used in remote virtual networking to link to - * this virtual network. - */ - @JsonProperty(value = "allowGatewayTransit") - private Boolean allowGatewayTransit; - - /* - * If remote gateways can be used on this virtual network. If the flag is - * set to true, and allowGatewayTransit on remote peering is also true, - * virtual network will use gateways of remote virtual network for transit. - * Only one peering can have this flag set to true. This flag cannot be set - * if virtual network already has a gateway. - */ - @JsonProperty(value = "useRemoteGateways") - private Boolean useRemoteGateways; - - /* - * The reference of the remote virtual network. The remote virtual network - * can be in the same or different region (preview). See here to register - * for the preview and learn more - * (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering). - */ - @JsonProperty(value = "remoteVirtualNetwork") - private SubResource remoteVirtualNetwork; - - /* - * The reference of the remote virtual network address space. - */ - @JsonProperty(value = "remoteAddressSpace") - private AddressSpace remoteAddressSpace; - - /* - * The status of the virtual network peering. Possible values are - * 'Initiated', 'Connected', and 'Disconnected'. - */ - @JsonProperty(value = "peeringState") - private VirtualNetworkPeeringState peeringState; - - /* - * The provisioning state of the resource. - */ - @JsonProperty(value = "provisioningState") - private String provisioningState; - - /** - * Get the allowVirtualNetworkAccess property: Whether the VMs in the linked virtual network space would be able to - * access all the VMs in local Virtual network space. - * - * @return the allowVirtualNetworkAccess value. - */ - public Boolean allowVirtualNetworkAccess() { - return this.allowVirtualNetworkAccess; - } - - /** - * Set the allowVirtualNetworkAccess property: Whether the VMs in the linked virtual network space would be able to - * access all the VMs in local Virtual network space. - * - * @param allowVirtualNetworkAccess the allowVirtualNetworkAccess value to set. - * @return the VirtualNetworkPeeringPropertiesFormat object itself. - */ - public VirtualNetworkPeeringPropertiesFormat withAllowVirtualNetworkAccess(Boolean allowVirtualNetworkAccess) { - this.allowVirtualNetworkAccess = allowVirtualNetworkAccess; - return this; - } - - /** - * Get the allowForwardedTraffic property: Whether the forwarded traffic from the VMs in the remote virtual network - * will be allowed/disallowed. - * - * @return the allowForwardedTraffic value. - */ - public Boolean allowForwardedTraffic() { - return this.allowForwardedTraffic; - } - - /** - * Set the allowForwardedTraffic property: Whether the forwarded traffic from the VMs in the remote virtual network - * will be allowed/disallowed. - * - * @param allowForwardedTraffic the allowForwardedTraffic value to set. - * @return the VirtualNetworkPeeringPropertiesFormat object itself. - */ - public VirtualNetworkPeeringPropertiesFormat withAllowForwardedTraffic(Boolean allowForwardedTraffic) { - this.allowForwardedTraffic = allowForwardedTraffic; - return this; - } - - /** - * Get the allowGatewayTransit property: If gateway links can be used in remote virtual networking to link to this - * virtual network. - * - * @return the allowGatewayTransit value. - */ - public Boolean allowGatewayTransit() { - return this.allowGatewayTransit; - } - - /** - * Set the allowGatewayTransit property: If gateway links can be used in remote virtual networking to link to this - * virtual network. - * - * @param allowGatewayTransit the allowGatewayTransit value to set. - * @return the VirtualNetworkPeeringPropertiesFormat object itself. - */ - public VirtualNetworkPeeringPropertiesFormat withAllowGatewayTransit(Boolean allowGatewayTransit) { - this.allowGatewayTransit = allowGatewayTransit; - return this; - } - - /** - * Get the useRemoteGateways property: If remote gateways can be used on this virtual network. If the flag is set to - * true, and allowGatewayTransit on remote peering is also true, virtual network will use gateways of remote virtual - * network for transit. Only one peering can have this flag set to true. This flag cannot be set if virtual network - * already has a gateway. - * - * @return the useRemoteGateways value. - */ - public Boolean useRemoteGateways() { - return this.useRemoteGateways; - } - - /** - * Set the useRemoteGateways property: If remote gateways can be used on this virtual network. If the flag is set to - * true, and allowGatewayTransit on remote peering is also true, virtual network will use gateways of remote virtual - * network for transit. Only one peering can have this flag set to true. This flag cannot be set if virtual network - * already has a gateway. - * - * @param useRemoteGateways the useRemoteGateways value to set. - * @return the VirtualNetworkPeeringPropertiesFormat object itself. - */ - public VirtualNetworkPeeringPropertiesFormat withUseRemoteGateways(Boolean useRemoteGateways) { - this.useRemoteGateways = useRemoteGateways; - return this; - } - - /** - * Get the remoteVirtualNetwork property: The reference of the remote virtual network. The remote virtual network - * can be in the same or different region (preview). See here to register for the preview and learn more - * (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering). - * - * @return the remoteVirtualNetwork value. - */ - public SubResource remoteVirtualNetwork() { - return this.remoteVirtualNetwork; - } - - /** - * Set the remoteVirtualNetwork property: The reference of the remote virtual network. The remote virtual network - * can be in the same or different region (preview). See here to register for the preview and learn more - * (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering). - * - * @param remoteVirtualNetwork the remoteVirtualNetwork value to set. - * @return the VirtualNetworkPeeringPropertiesFormat object itself. - */ - public VirtualNetworkPeeringPropertiesFormat withRemoteVirtualNetwork(SubResource remoteVirtualNetwork) { - this.remoteVirtualNetwork = remoteVirtualNetwork; - return this; - } - - /** - * Get the remoteAddressSpace property: The reference of the remote virtual network address space. - * - * @return the remoteAddressSpace value. - */ - public AddressSpace remoteAddressSpace() { - return this.remoteAddressSpace; - } - - /** - * Set the remoteAddressSpace property: The reference of the remote virtual network address space. - * - * @param remoteAddressSpace the remoteAddressSpace value to set. - * @return the VirtualNetworkPeeringPropertiesFormat object itself. - */ - public VirtualNetworkPeeringPropertiesFormat withRemoteAddressSpace(AddressSpace remoteAddressSpace) { - this.remoteAddressSpace = remoteAddressSpace; - return this; - } - - /** - * Get the peeringState property: The status of the virtual network peering. Possible values are 'Initiated', - * 'Connected', and 'Disconnected'. - * - * @return the peeringState value. - */ - public VirtualNetworkPeeringState peeringState() { - return this.peeringState; - } - - /** - * Set the peeringState property: The status of the virtual network peering. Possible values are 'Initiated', - * 'Connected', and 'Disconnected'. - * - * @param peeringState the peeringState value to set. - * @return the VirtualNetworkPeeringPropertiesFormat object itself. - */ - public VirtualNetworkPeeringPropertiesFormat withPeeringState(VirtualNetworkPeeringState peeringState) { - this.peeringState = peeringState; - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the resource. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Set the provisioningState property: The provisioning state of the resource. - * - * @param provisioningState the provisioningState value to set. - * @return the VirtualNetworkPeeringPropertiesFormat object itself. - */ - public VirtualNetworkPeeringPropertiesFormat withProvisioningState(String provisioningState) { - this.provisioningState = provisioningState; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (remoteAddressSpace() != null) { - remoteAddressSpace().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VirtualNetworkPropertiesFormat.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VirtualNetworkPropertiesFormat.java deleted file mode 100644 index 536283d50f16..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VirtualNetworkPropertiesFormat.java +++ /dev/null @@ -1,291 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.AddressSpace; -import com.azure.resourcemanager.network.models.DhcpOptions; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Properties of the virtual network. */ -@Fluent -public final class VirtualNetworkPropertiesFormat { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkPropertiesFormat.class); - - /* - * The AddressSpace that contains an array of IP address ranges that can be - * used by subnets. - */ - @JsonProperty(value = "addressSpace") - private AddressSpace addressSpace; - - /* - * The dhcpOptions that contains an array of DNS servers available to VMs - * deployed in the virtual network. - */ - @JsonProperty(value = "dhcpOptions") - private DhcpOptions dhcpOptions; - - /* - * A list of subnets in a Virtual Network. - */ - @JsonProperty(value = "subnets") - private List subnets; - - /* - * A list of peerings in a Virtual Network. - */ - @JsonProperty(value = "virtualNetworkPeerings") - private List virtualNetworkPeerings; - - /* - * The resourceGuid property of the Virtual Network resource. - */ - @JsonProperty(value = "resourceGuid") - private String resourceGuid; - - /* - * The provisioning state of the PublicIP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - */ - @JsonProperty(value = "provisioningState") - private String provisioningState; - - /* - * Indicates if DDoS protection is enabled for all the protected resources - * in the virtual network. It requires a DDoS protection plan associated - * with the resource. - */ - @JsonProperty(value = "enableDdosProtection") - private Boolean enableDdosProtection; - - /* - * Indicates if VM protection is enabled for all the subnets in the virtual - * network. - */ - @JsonProperty(value = "enableVmProtection") - private Boolean enableVmProtection; - - /* - * The DDoS protection plan associated with the virtual network. - */ - @JsonProperty(value = "ddosProtectionPlan") - private SubResource ddosProtectionPlan; - - /** - * Get the addressSpace property: The AddressSpace that contains an array of IP address ranges that can be used by - * subnets. - * - * @return the addressSpace value. - */ - public AddressSpace addressSpace() { - return this.addressSpace; - } - - /** - * Set the addressSpace property: The AddressSpace that contains an array of IP address ranges that can be used by - * subnets. - * - * @param addressSpace the addressSpace value to set. - * @return the VirtualNetworkPropertiesFormat object itself. - */ - public VirtualNetworkPropertiesFormat withAddressSpace(AddressSpace addressSpace) { - this.addressSpace = addressSpace; - return this; - } - - /** - * Get the dhcpOptions property: The dhcpOptions that contains an array of DNS servers available to VMs deployed in - * the virtual network. - * - * @return the dhcpOptions value. - */ - public DhcpOptions dhcpOptions() { - return this.dhcpOptions; - } - - /** - * Set the dhcpOptions property: The dhcpOptions that contains an array of DNS servers available to VMs deployed in - * the virtual network. - * - * @param dhcpOptions the dhcpOptions value to set. - * @return the VirtualNetworkPropertiesFormat object itself. - */ - public VirtualNetworkPropertiesFormat withDhcpOptions(DhcpOptions dhcpOptions) { - this.dhcpOptions = dhcpOptions; - return this; - } - - /** - * Get the subnets property: A list of subnets in a Virtual Network. - * - * @return the subnets value. - */ - public List subnets() { - return this.subnets; - } - - /** - * Set the subnets property: A list of subnets in a Virtual Network. - * - * @param subnets the subnets value to set. - * @return the VirtualNetworkPropertiesFormat object itself. - */ - public VirtualNetworkPropertiesFormat withSubnets(List subnets) { - this.subnets = subnets; - return this; - } - - /** - * Get the virtualNetworkPeerings property: A list of peerings in a Virtual Network. - * - * @return the virtualNetworkPeerings value. - */ - public List virtualNetworkPeerings() { - return this.virtualNetworkPeerings; - } - - /** - * Set the virtualNetworkPeerings property: A list of peerings in a Virtual Network. - * - * @param virtualNetworkPeerings the virtualNetworkPeerings value to set. - * @return the VirtualNetworkPropertiesFormat object itself. - */ - public VirtualNetworkPropertiesFormat withVirtualNetworkPeerings( - List virtualNetworkPeerings) { - this.virtualNetworkPeerings = virtualNetworkPeerings; - return this; - } - - /** - * Get the resourceGuid property: The resourceGuid property of the Virtual Network resource. - * - * @return the resourceGuid value. - */ - public String resourceGuid() { - return this.resourceGuid; - } - - /** - * Set the resourceGuid property: The resourceGuid property of the Virtual Network resource. - * - * @param resourceGuid the resourceGuid value to set. - * @return the VirtualNetworkPropertiesFormat object itself. - */ - public VirtualNetworkPropertiesFormat withResourceGuid(String resourceGuid) { - this.resourceGuid = resourceGuid; - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the PublicIP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Set the provisioningState property: The provisioning state of the PublicIP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param provisioningState the provisioningState value to set. - * @return the VirtualNetworkPropertiesFormat object itself. - */ - public VirtualNetworkPropertiesFormat withProvisioningState(String provisioningState) { - this.provisioningState = provisioningState; - return this; - } - - /** - * Get the enableDdosProtection property: Indicates if DDoS protection is enabled for all the protected resources in - * the virtual network. It requires a DDoS protection plan associated with the resource. - * - * @return the enableDdosProtection value. - */ - public Boolean enableDdosProtection() { - return this.enableDdosProtection; - } - - /** - * Set the enableDdosProtection property: Indicates if DDoS protection is enabled for all the protected resources in - * the virtual network. It requires a DDoS protection plan associated with the resource. - * - * @param enableDdosProtection the enableDdosProtection value to set. - * @return the VirtualNetworkPropertiesFormat object itself. - */ - public VirtualNetworkPropertiesFormat withEnableDdosProtection(Boolean enableDdosProtection) { - this.enableDdosProtection = enableDdosProtection; - return this; - } - - /** - * Get the enableVmProtection property: Indicates if VM protection is enabled for all the subnets in the virtual - * network. - * - * @return the enableVmProtection value. - */ - public Boolean enableVmProtection() { - return this.enableVmProtection; - } - - /** - * Set the enableVmProtection property: Indicates if VM protection is enabled for all the subnets in the virtual - * network. - * - * @param enableVmProtection the enableVmProtection value to set. - * @return the VirtualNetworkPropertiesFormat object itself. - */ - public VirtualNetworkPropertiesFormat withEnableVmProtection(Boolean enableVmProtection) { - this.enableVmProtection = enableVmProtection; - return this; - } - - /** - * Get the ddosProtectionPlan property: The DDoS protection plan associated with the virtual network. - * - * @return the ddosProtectionPlan value. - */ - public SubResource ddosProtectionPlan() { - return this.ddosProtectionPlan; - } - - /** - * Set the ddosProtectionPlan property: The DDoS protection plan associated with the virtual network. - * - * @param ddosProtectionPlan the ddosProtectionPlan value to set. - * @return the VirtualNetworkPropertiesFormat object itself. - */ - public VirtualNetworkPropertiesFormat withDdosProtectionPlan(SubResource ddosProtectionPlan) { - this.ddosProtectionPlan = ddosProtectionPlan; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (addressSpace() != null) { - addressSpace().validate(); - } - if (dhcpOptions() != null) { - dhcpOptions().validate(); - } - if (subnets() != null) { - subnets().forEach(e -> e.validate()); - } - if (virtualNetworkPeerings() != null) { - virtualNetworkPeerings().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VirtualNetworkTapInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VirtualNetworkTapInner.java deleted file mode 100644 index 2db3c0466061..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VirtualNetworkTapInner.java +++ /dev/null @@ -1,225 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** Virtual Network Tap resource. */ -@Fluent -public final class VirtualNetworkTapInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkTapInner.class); - - /* - * Virtual Network Tap Properties. - */ - @JsonProperty(value = "properties") - private VirtualNetworkTapPropertiesFormatInner innerProperties; - - /* - * Gets a unique read-only string that changes whenever the resource is - * updated. - */ - @JsonProperty(value = "etag") - private String etag; - - /* - * Resource ID. - */ - @JsonProperty(value = "id") - private String id; - - /** - * Get the innerProperties property: Virtual Network Tap Properties. - * - * @return the innerProperties value. - */ - private VirtualNetworkTapPropertiesFormatInner innerProperties() { - return this.innerProperties; - } - - /** - * Get the etag property: Gets a unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: Gets a unique read-only string that changes whenever the resource is updated. - * - * @param etag the etag value to set. - * @return the VirtualNetworkTapInner object itself. - */ - public VirtualNetworkTapInner withEtag(String etag) { - this.etag = etag; - return this; - } - - /** - * Get the id property: Resource ID. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: Resource ID. - * - * @param id the id value to set. - * @return the VirtualNetworkTapInner object itself. - */ - public VirtualNetworkTapInner withId(String id) { - this.id = id; - return this; - } - - /** {@inheritDoc} */ - @Override - public VirtualNetworkTapInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public VirtualNetworkTapInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the networkInterfaceTapConfigurations property: Specifies the list of resource IDs for the network interface - * IP configuration that needs to be tapped. - * - * @return the networkInterfaceTapConfigurations value. - */ - public List networkInterfaceTapConfigurations() { - return this.innerProperties() == null ? null : this.innerProperties().networkInterfaceTapConfigurations(); - } - - /** - * Get the resourceGuid property: The resourceGuid property of the virtual network tap. - * - * @return the resourceGuid value. - */ - public String resourceGuid() { - return this.innerProperties() == null ? null : this.innerProperties().resourceGuid(); - } - - /** - * Get the provisioningState property: The provisioning state of the virtual network tap. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the destinationNetworkInterfaceIpConfiguration property: The reference to the private IP Address of the - * collector nic that will receive the tap. - * - * @return the destinationNetworkInterfaceIpConfiguration value. - */ - public NetworkInterfaceIpConfigurationInner destinationNetworkInterfaceIpConfiguration() { - return this.innerProperties() == null - ? null - : this.innerProperties().destinationNetworkInterfaceIpConfiguration(); - } - - /** - * Set the destinationNetworkInterfaceIpConfiguration property: The reference to the private IP Address of the - * collector nic that will receive the tap. - * - * @param destinationNetworkInterfaceIpConfiguration the destinationNetworkInterfaceIpConfiguration value to set. - * @return the VirtualNetworkTapInner object itself. - */ - public VirtualNetworkTapInner withDestinationNetworkInterfaceIpConfiguration( - NetworkInterfaceIpConfigurationInner destinationNetworkInterfaceIpConfiguration) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualNetworkTapPropertiesFormatInner(); - } - this - .innerProperties() - .withDestinationNetworkInterfaceIpConfiguration(destinationNetworkInterfaceIpConfiguration); - return this; - } - - /** - * Get the destinationLoadBalancerFrontEndIpConfiguration property: The reference to the private IP address on the - * internal Load Balancer that will receive the tap. - * - * @return the destinationLoadBalancerFrontEndIpConfiguration value. - */ - public FrontendIpConfigurationInner destinationLoadBalancerFrontEndIpConfiguration() { - return this.innerProperties() == null - ? null - : this.innerProperties().destinationLoadBalancerFrontEndIpConfiguration(); - } - - /** - * Set the destinationLoadBalancerFrontEndIpConfiguration property: The reference to the private IP address on the - * internal Load Balancer that will receive the tap. - * - * @param destinationLoadBalancerFrontEndIpConfiguration the destinationLoadBalancerFrontEndIpConfiguration value to - * set. - * @return the VirtualNetworkTapInner object itself. - */ - public VirtualNetworkTapInner withDestinationLoadBalancerFrontEndIpConfiguration( - FrontendIpConfigurationInner destinationLoadBalancerFrontEndIpConfiguration) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualNetworkTapPropertiesFormatInner(); - } - this - .innerProperties() - .withDestinationLoadBalancerFrontEndIpConfiguration(destinationLoadBalancerFrontEndIpConfiguration); - return this; - } - - /** - * Get the destinationPort property: The VXLAN destination port that will receive the tapped traffic. - * - * @return the destinationPort value. - */ - public Integer destinationPort() { - return this.innerProperties() == null ? null : this.innerProperties().destinationPort(); - } - - /** - * Set the destinationPort property: The VXLAN destination port that will receive the tapped traffic. - * - * @param destinationPort the destinationPort value to set. - * @return the VirtualNetworkTapInner object itself. - */ - public VirtualNetworkTapInner withDestinationPort(Integer destinationPort) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualNetworkTapPropertiesFormatInner(); - } - this.innerProperties().withDestinationPort(destinationPort); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VirtualNetworkTapPropertiesFormatInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VirtualNetworkTapPropertiesFormatInner.java deleted file mode 100644 index 9c63e3c43eb0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VirtualNetworkTapPropertiesFormatInner.java +++ /dev/null @@ -1,170 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Virtual Network Tap properties. */ -@Fluent -public final class VirtualNetworkTapPropertiesFormatInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkTapPropertiesFormatInner.class); - - /* - * Specifies the list of resource IDs for the network interface IP - * configuration that needs to be tapped. - */ - @JsonProperty(value = "networkInterfaceTapConfigurations", access = JsonProperty.Access.WRITE_ONLY) - private List networkInterfaceTapConfigurations; - - /* - * The resourceGuid property of the virtual network tap. - */ - @JsonProperty(value = "resourceGuid", access = JsonProperty.Access.WRITE_ONLY) - private String resourceGuid; - - /* - * The provisioning state of the virtual network tap. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; - - /* - * The reference to the private IP Address of the collector nic that will - * receive the tap - */ - @JsonProperty(value = "destinationNetworkInterfaceIPConfiguration") - private NetworkInterfaceIpConfigurationInner destinationNetworkInterfaceIpConfiguration; - - /* - * The reference to the private IP address on the internal Load Balancer - * that will receive the tap - */ - @JsonProperty(value = "destinationLoadBalancerFrontEndIPConfiguration") - private FrontendIpConfigurationInner destinationLoadBalancerFrontEndIpConfiguration; - - /* - * The VXLAN destination port that will receive the tapped traffic. - */ - @JsonProperty(value = "destinationPort") - private Integer destinationPort; - - /** - * Get the networkInterfaceTapConfigurations property: Specifies the list of resource IDs for the network interface - * IP configuration that needs to be tapped. - * - * @return the networkInterfaceTapConfigurations value. - */ - public List networkInterfaceTapConfigurations() { - return this.networkInterfaceTapConfigurations; - } - - /** - * Get the resourceGuid property: The resourceGuid property of the virtual network tap. - * - * @return the resourceGuid value. - */ - public String resourceGuid() { - return this.resourceGuid; - } - - /** - * Get the provisioningState property: The provisioning state of the virtual network tap. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Get the destinationNetworkInterfaceIpConfiguration property: The reference to the private IP Address of the - * collector nic that will receive the tap. - * - * @return the destinationNetworkInterfaceIpConfiguration value. - */ - public NetworkInterfaceIpConfigurationInner destinationNetworkInterfaceIpConfiguration() { - return this.destinationNetworkInterfaceIpConfiguration; - } - - /** - * Set the destinationNetworkInterfaceIpConfiguration property: The reference to the private IP Address of the - * collector nic that will receive the tap. - * - * @param destinationNetworkInterfaceIpConfiguration the destinationNetworkInterfaceIpConfiguration value to set. - * @return the VirtualNetworkTapPropertiesFormatInner object itself. - */ - public VirtualNetworkTapPropertiesFormatInner withDestinationNetworkInterfaceIpConfiguration( - NetworkInterfaceIpConfigurationInner destinationNetworkInterfaceIpConfiguration) { - this.destinationNetworkInterfaceIpConfiguration = destinationNetworkInterfaceIpConfiguration; - return this; - } - - /** - * Get the destinationLoadBalancerFrontEndIpConfiguration property: The reference to the private IP address on the - * internal Load Balancer that will receive the tap. - * - * @return the destinationLoadBalancerFrontEndIpConfiguration value. - */ - public FrontendIpConfigurationInner destinationLoadBalancerFrontEndIpConfiguration() { - return this.destinationLoadBalancerFrontEndIpConfiguration; - } - - /** - * Set the destinationLoadBalancerFrontEndIpConfiguration property: The reference to the private IP address on the - * internal Load Balancer that will receive the tap. - * - * @param destinationLoadBalancerFrontEndIpConfiguration the destinationLoadBalancerFrontEndIpConfiguration value to - * set. - * @return the VirtualNetworkTapPropertiesFormatInner object itself. - */ - public VirtualNetworkTapPropertiesFormatInner withDestinationLoadBalancerFrontEndIpConfiguration( - FrontendIpConfigurationInner destinationLoadBalancerFrontEndIpConfiguration) { - this.destinationLoadBalancerFrontEndIpConfiguration = destinationLoadBalancerFrontEndIpConfiguration; - return this; - } - - /** - * Get the destinationPort property: The VXLAN destination port that will receive the tapped traffic. - * - * @return the destinationPort value. - */ - public Integer destinationPort() { - return this.destinationPort; - } - - /** - * Set the destinationPort property: The VXLAN destination port that will receive the tapped traffic. - * - * @param destinationPort the destinationPort value to set. - * @return the VirtualNetworkTapPropertiesFormatInner object itself. - */ - public VirtualNetworkTapPropertiesFormatInner withDestinationPort(Integer destinationPort) { - this.destinationPort = destinationPort; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (networkInterfaceTapConfigurations() != null) { - networkInterfaceTapConfigurations().forEach(e -> e.validate()); - } - if (destinationNetworkInterfaceIpConfiguration() != null) { - destinationNetworkInterfaceIpConfiguration().validate(); - } - if (destinationLoadBalancerFrontEndIpConfiguration() != null) { - destinationLoadBalancerFrontEndIpConfiguration().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VirtualNetworkUsageInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VirtualNetworkUsageInner.java deleted file mode 100644 index d545dda36583..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VirtualNetworkUsageInner.java +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.VirtualNetworkUsageName; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Usage details for subnet. */ -@Immutable -public final class VirtualNetworkUsageInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkUsageInner.class); - - /* - * Indicates number of IPs used from the Subnet. - */ - @JsonProperty(value = "currentValue", access = JsonProperty.Access.WRITE_ONLY) - private Double currentValue; - - /* - * Subnet identifier. - */ - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) - private String id; - - /* - * Indicates the size of the subnet. - */ - @JsonProperty(value = "limit", access = JsonProperty.Access.WRITE_ONLY) - private Double limit; - - /* - * The name containing common and localized value for usage. - */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) - private VirtualNetworkUsageName name; - - /* - * Usage units. Returns 'Count' - */ - @JsonProperty(value = "unit", access = JsonProperty.Access.WRITE_ONLY) - private String unit; - - /** - * Get the currentValue property: Indicates number of IPs used from the Subnet. - * - * @return the currentValue value. - */ - public Double currentValue() { - return this.currentValue; - } - - /** - * Get the id property: Subnet identifier. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Get the limit property: Indicates the size of the subnet. - * - * @return the limit value. - */ - public Double limit() { - return this.limit; - } - - /** - * Get the name property: The name containing common and localized value for usage. - * - * @return the name value. - */ - public VirtualNetworkUsageName name() { - return this.name; - } - - /** - * Get the unit property: Usage units. Returns 'Count'. - * - * @return the unit value. - */ - public String unit() { - return this.unit; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() != null) { - name().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VirtualWanInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VirtualWanInner.java deleted file mode 100644 index 0594b84ff772..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VirtualWanInner.java +++ /dev/null @@ -1,272 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.OfficeTrafficCategory; -import com.azure.resourcemanager.network.models.ProvisioningState; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** VirtualWAN Resource. */ -@Fluent -public final class VirtualWanInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualWanInner.class); - - /* - * Parameters for VirtualWAN - */ - @JsonProperty(value = "properties") - private VirtualWanProperties innerProperties; - - /* - * Gets a unique read-only string that changes whenever the resource is - * updated. - */ - @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) - private String etag; - - /* - * Resource ID. - */ - @JsonProperty(value = "id") - private String id; - - /** - * Get the innerProperties property: Parameters for VirtualWAN. - * - * @return the innerProperties value. - */ - private VirtualWanProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the etag property: Gets a unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Get the id property: Resource ID. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: Resource ID. - * - * @param id the id value to set. - * @return the VirtualWanInner object itself. - */ - public VirtualWanInner withId(String id) { - this.id = id; - return this; - } - - /** {@inheritDoc} */ - @Override - public VirtualWanInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public VirtualWanInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the disableVpnEncryption property: Vpn encryption to be disabled or not. - * - * @return the disableVpnEncryption value. - */ - public Boolean disableVpnEncryption() { - return this.innerProperties() == null ? null : this.innerProperties().disableVpnEncryption(); - } - - /** - * Set the disableVpnEncryption property: Vpn encryption to be disabled or not. - * - * @param disableVpnEncryption the disableVpnEncryption value to set. - * @return the VirtualWanInner object itself. - */ - public VirtualWanInner withDisableVpnEncryption(Boolean disableVpnEncryption) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualWanProperties(); - } - this.innerProperties().withDisableVpnEncryption(disableVpnEncryption); - return this; - } - - /** - * Get the virtualHubs property: List of VirtualHubs in the VirtualWAN. - * - * @return the virtualHubs value. - */ - public List virtualHubs() { - return this.innerProperties() == null ? null : this.innerProperties().virtualHubs(); - } - - /** - * Get the vpnSites property: The vpnSites property. - * - * @return the vpnSites value. - */ - public List vpnSites() { - return this.innerProperties() == null ? null : this.innerProperties().vpnSites(); - } - - /** - * Get the securityProviderName property: The Security Provider name. - * - * @return the securityProviderName value. - */ - public String securityProviderName() { - return this.innerProperties() == null ? null : this.innerProperties().securityProviderName(); - } - - /** - * Set the securityProviderName property: The Security Provider name. - * - * @param securityProviderName the securityProviderName value to set. - * @return the VirtualWanInner object itself. - */ - public VirtualWanInner withSecurityProviderName(String securityProviderName) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualWanProperties(); - } - this.innerProperties().withSecurityProviderName(securityProviderName); - return this; - } - - /** - * Get the allowBranchToBranchTraffic property: True if branch to branch traffic is allowed. - * - * @return the allowBranchToBranchTraffic value. - */ - public Boolean allowBranchToBranchTraffic() { - return this.innerProperties() == null ? null : this.innerProperties().allowBranchToBranchTraffic(); - } - - /** - * Set the allowBranchToBranchTraffic property: True if branch to branch traffic is allowed. - * - * @param allowBranchToBranchTraffic the allowBranchToBranchTraffic value to set. - * @return the VirtualWanInner object itself. - */ - public VirtualWanInner withAllowBranchToBranchTraffic(Boolean allowBranchToBranchTraffic) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualWanProperties(); - } - this.innerProperties().withAllowBranchToBranchTraffic(allowBranchToBranchTraffic); - return this; - } - - /** - * Get the allowVnetToVnetTraffic property: True if Vnet to Vnet traffic is allowed. - * - * @return the allowVnetToVnetTraffic value. - */ - public Boolean allowVnetToVnetTraffic() { - return this.innerProperties() == null ? null : this.innerProperties().allowVnetToVnetTraffic(); - } - - /** - * Set the allowVnetToVnetTraffic property: True if Vnet to Vnet traffic is allowed. - * - * @param allowVnetToVnetTraffic the allowVnetToVnetTraffic value to set. - * @return the VirtualWanInner object itself. - */ - public VirtualWanInner withAllowVnetToVnetTraffic(Boolean allowVnetToVnetTraffic) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualWanProperties(); - } - this.innerProperties().withAllowVnetToVnetTraffic(allowVnetToVnetTraffic); - return this; - } - - /** - * Get the office365LocalBreakoutCategory property: The office local breakout category. - * - * @return the office365LocalBreakoutCategory value. - */ - public OfficeTrafficCategory office365LocalBreakoutCategory() { - return this.innerProperties() == null ? null : this.innerProperties().office365LocalBreakoutCategory(); - } - - /** - * Get the p2SVpnServerConfigurations property: list of all P2SVpnServerConfigurations associated with the virtual - * wan. - * - * @return the p2SVpnServerConfigurations value. - */ - public List p2SVpnServerConfigurations() { - return this.innerProperties() == null ? null : this.innerProperties().p2SVpnServerConfigurations(); - } - - /** - * Set the p2SVpnServerConfigurations property: list of all P2SVpnServerConfigurations associated with the virtual - * wan. - * - * @param p2SVpnServerConfigurations the p2SVpnServerConfigurations value to set. - * @return the VirtualWanInner object itself. - */ - public VirtualWanInner withP2SVpnServerConfigurations( - List p2SVpnServerConfigurations) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualWanProperties(); - } - this.innerProperties().withP2SVpnServerConfigurations(p2SVpnServerConfigurations); - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the resource. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Set the provisioningState property: The provisioning state of the resource. - * - * @param provisioningState the provisioningState value to set. - * @return the VirtualWanInner object itself. - */ - public VirtualWanInner withProvisioningState(ProvisioningState provisioningState) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualWanProperties(); - } - this.innerProperties().withProvisioningState(provisioningState); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VirtualWanProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VirtualWanProperties.java deleted file mode 100644 index 81ba38a69b14..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VirtualWanProperties.java +++ /dev/null @@ -1,235 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.OfficeTrafficCategory; -import com.azure.resourcemanager.network.models.ProvisioningState; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Parameters for VirtualWAN. */ -@Fluent -public final class VirtualWanProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualWanProperties.class); - - /* - * Vpn encryption to be disabled or not. - */ - @JsonProperty(value = "disableVpnEncryption") - private Boolean disableVpnEncryption; - - /* - * List of VirtualHubs in the VirtualWAN. - */ - @JsonProperty(value = "virtualHubs", access = JsonProperty.Access.WRITE_ONLY) - private List virtualHubs; - - /* - * The vpnSites property. - */ - @JsonProperty(value = "vpnSites", access = JsonProperty.Access.WRITE_ONLY) - private List vpnSites; - - /* - * The Security Provider name. - */ - @JsonProperty(value = "securityProviderName") - private String securityProviderName; - - /* - * True if branch to branch traffic is allowed. - */ - @JsonProperty(value = "allowBranchToBranchTraffic") - private Boolean allowBranchToBranchTraffic; - - /* - * True if Vnet to Vnet traffic is allowed. - */ - @JsonProperty(value = "allowVnetToVnetTraffic") - private Boolean allowVnetToVnetTraffic; - - /* - * The office local breakout category. - */ - @JsonProperty(value = "office365LocalBreakoutCategory", access = JsonProperty.Access.WRITE_ONLY) - private OfficeTrafficCategory office365LocalBreakoutCategory; - - /* - * list of all P2SVpnServerConfigurations associated with the virtual wan. - */ - @JsonProperty(value = "p2SVpnServerConfigurations") - private List p2SVpnServerConfigurations; - - /* - * The provisioning state of the resource. - */ - @JsonProperty(value = "provisioningState") - private ProvisioningState provisioningState; - - /** - * Get the disableVpnEncryption property: Vpn encryption to be disabled or not. - * - * @return the disableVpnEncryption value. - */ - public Boolean disableVpnEncryption() { - return this.disableVpnEncryption; - } - - /** - * Set the disableVpnEncryption property: Vpn encryption to be disabled or not. - * - * @param disableVpnEncryption the disableVpnEncryption value to set. - * @return the VirtualWanProperties object itself. - */ - public VirtualWanProperties withDisableVpnEncryption(Boolean disableVpnEncryption) { - this.disableVpnEncryption = disableVpnEncryption; - return this; - } - - /** - * Get the virtualHubs property: List of VirtualHubs in the VirtualWAN. - * - * @return the virtualHubs value. - */ - public List virtualHubs() { - return this.virtualHubs; - } - - /** - * Get the vpnSites property: The vpnSites property. - * - * @return the vpnSites value. - */ - public List vpnSites() { - return this.vpnSites; - } - - /** - * Get the securityProviderName property: The Security Provider name. - * - * @return the securityProviderName value. - */ - public String securityProviderName() { - return this.securityProviderName; - } - - /** - * Set the securityProviderName property: The Security Provider name. - * - * @param securityProviderName the securityProviderName value to set. - * @return the VirtualWanProperties object itself. - */ - public VirtualWanProperties withSecurityProviderName(String securityProviderName) { - this.securityProviderName = securityProviderName; - return this; - } - - /** - * Get the allowBranchToBranchTraffic property: True if branch to branch traffic is allowed. - * - * @return the allowBranchToBranchTraffic value. - */ - public Boolean allowBranchToBranchTraffic() { - return this.allowBranchToBranchTraffic; - } - - /** - * Set the allowBranchToBranchTraffic property: True if branch to branch traffic is allowed. - * - * @param allowBranchToBranchTraffic the allowBranchToBranchTraffic value to set. - * @return the VirtualWanProperties object itself. - */ - public VirtualWanProperties withAllowBranchToBranchTraffic(Boolean allowBranchToBranchTraffic) { - this.allowBranchToBranchTraffic = allowBranchToBranchTraffic; - return this; - } - - /** - * Get the allowVnetToVnetTraffic property: True if Vnet to Vnet traffic is allowed. - * - * @return the allowVnetToVnetTraffic value. - */ - public Boolean allowVnetToVnetTraffic() { - return this.allowVnetToVnetTraffic; - } - - /** - * Set the allowVnetToVnetTraffic property: True if Vnet to Vnet traffic is allowed. - * - * @param allowVnetToVnetTraffic the allowVnetToVnetTraffic value to set. - * @return the VirtualWanProperties object itself. - */ - public VirtualWanProperties withAllowVnetToVnetTraffic(Boolean allowVnetToVnetTraffic) { - this.allowVnetToVnetTraffic = allowVnetToVnetTraffic; - return this; - } - - /** - * Get the office365LocalBreakoutCategory property: The office local breakout category. - * - * @return the office365LocalBreakoutCategory value. - */ - public OfficeTrafficCategory office365LocalBreakoutCategory() { - return this.office365LocalBreakoutCategory; - } - - /** - * Get the p2SVpnServerConfigurations property: list of all P2SVpnServerConfigurations associated with the virtual - * wan. - * - * @return the p2SVpnServerConfigurations value. - */ - public List p2SVpnServerConfigurations() { - return this.p2SVpnServerConfigurations; - } - - /** - * Set the p2SVpnServerConfigurations property: list of all P2SVpnServerConfigurations associated with the virtual - * wan. - * - * @param p2SVpnServerConfigurations the p2SVpnServerConfigurations value to set. - * @return the VirtualWanProperties object itself. - */ - public VirtualWanProperties withP2SVpnServerConfigurations( - List p2SVpnServerConfigurations) { - this.p2SVpnServerConfigurations = p2SVpnServerConfigurations; - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the resource. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Set the provisioningState property: The provisioning state of the resource. - * - * @param provisioningState the provisioningState value to set. - * @return the VirtualWanProperties object itself. - */ - public VirtualWanProperties withProvisioningState(ProvisioningState provisioningState) { - this.provisioningState = provisioningState; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (p2SVpnServerConfigurations() != null) { - p2SVpnServerConfigurations().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VirtualWanSecurityProvidersInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VirtualWanSecurityProvidersInner.java deleted file mode 100644 index b58046feae18..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VirtualWanSecurityProvidersInner.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.VirtualWanSecurityProvider; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Collection of SecurityProviders. */ -@Fluent -public final class VirtualWanSecurityProvidersInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualWanSecurityProvidersInner.class); - - /* - * The supportedProviders property. - */ - @JsonProperty(value = "supportedProviders") - private List supportedProviders; - - /** - * Get the supportedProviders property: The supportedProviders property. - * - * @return the supportedProviders value. - */ - public List supportedProviders() { - return this.supportedProviders; - } - - /** - * Set the supportedProviders property: The supportedProviders property. - * - * @param supportedProviders the supportedProviders value to set. - * @return the VirtualWanSecurityProvidersInner object itself. - */ - public VirtualWanSecurityProvidersInner withSupportedProviders( - List supportedProviders) { - this.supportedProviders = supportedProviders; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (supportedProviders() != null) { - supportedProviders().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VpnClientIPsecParametersInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VpnClientIPsecParametersInner.java deleted file mode 100644 index d9cc8f616cb5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VpnClientIPsecParametersInner.java +++ /dev/null @@ -1,280 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.DhGroup; -import com.azure.resourcemanager.network.models.IkeEncryption; -import com.azure.resourcemanager.network.models.IkeIntegrity; -import com.azure.resourcemanager.network.models.IpsecEncryption; -import com.azure.resourcemanager.network.models.IpsecIntegrity; -import com.azure.resourcemanager.network.models.PfsGroup; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** An IPSec parameters for a virtual network gateway P2S connection. */ -@Fluent -public final class VpnClientIPsecParametersInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnClientIPsecParametersInner.class); - - /* - * The IPSec Security Association (also called Quick Mode or Phase 2 SA) - * lifetime in seconds for P2S client. - */ - @JsonProperty(value = "saLifeTimeSeconds", required = true) - private int saLifeTimeSeconds; - - /* - * The IPSec Security Association (also called Quick Mode or Phase 2 SA) - * payload size in KB for P2S client.. - */ - @JsonProperty(value = "saDataSizeKilobytes", required = true) - private int saDataSizeKilobytes; - - /* - * The IPSec encryption algorithm (IKE phase 1). - */ - @JsonProperty(value = "ipsecEncryption", required = true) - private IpsecEncryption ipsecEncryption; - - /* - * The IPSec integrity algorithm (IKE phase 1). - */ - @JsonProperty(value = "ipsecIntegrity", required = true) - private IpsecIntegrity ipsecIntegrity; - - /* - * The IKE encryption algorithm (IKE phase 2). - */ - @JsonProperty(value = "ikeEncryption", required = true) - private IkeEncryption ikeEncryption; - - /* - * The IKE integrity algorithm (IKE phase 2). - */ - @JsonProperty(value = "ikeIntegrity", required = true) - private IkeIntegrity ikeIntegrity; - - /* - * The DH Groups used in IKE Phase 1 for initial SA. - */ - @JsonProperty(value = "dhGroup", required = true) - private DhGroup dhGroup; - - /* - * The Pfs Groups used in IKE Phase 2 for new child SA. - */ - @JsonProperty(value = "pfsGroup", required = true) - private PfsGroup pfsGroup; - - /** - * Get the saLifeTimeSeconds property: The IPSec Security Association (also called Quick Mode or Phase 2 SA) - * lifetime in seconds for P2S client. - * - * @return the saLifeTimeSeconds value. - */ - public int saLifeTimeSeconds() { - return this.saLifeTimeSeconds; - } - - /** - * Set the saLifeTimeSeconds property: The IPSec Security Association (also called Quick Mode or Phase 2 SA) - * lifetime in seconds for P2S client. - * - * @param saLifeTimeSeconds the saLifeTimeSeconds value to set. - * @return the VpnClientIPsecParametersInner object itself. - */ - public VpnClientIPsecParametersInner withSaLifeTimeSeconds(int saLifeTimeSeconds) { - this.saLifeTimeSeconds = saLifeTimeSeconds; - return this; - } - - /** - * Get the saDataSizeKilobytes property: The IPSec Security Association (also called Quick Mode or Phase 2 SA) - * payload size in KB for P2S client.. - * - * @return the saDataSizeKilobytes value. - */ - public int saDataSizeKilobytes() { - return this.saDataSizeKilobytes; - } - - /** - * Set the saDataSizeKilobytes property: The IPSec Security Association (also called Quick Mode or Phase 2 SA) - * payload size in KB for P2S client.. - * - * @param saDataSizeKilobytes the saDataSizeKilobytes value to set. - * @return the VpnClientIPsecParametersInner object itself. - */ - public VpnClientIPsecParametersInner withSaDataSizeKilobytes(int saDataSizeKilobytes) { - this.saDataSizeKilobytes = saDataSizeKilobytes; - return this; - } - - /** - * Get the ipsecEncryption property: The IPSec encryption algorithm (IKE phase 1). - * - * @return the ipsecEncryption value. - */ - public IpsecEncryption ipsecEncryption() { - return this.ipsecEncryption; - } - - /** - * Set the ipsecEncryption property: The IPSec encryption algorithm (IKE phase 1). - * - * @param ipsecEncryption the ipsecEncryption value to set. - * @return the VpnClientIPsecParametersInner object itself. - */ - public VpnClientIPsecParametersInner withIpsecEncryption(IpsecEncryption ipsecEncryption) { - this.ipsecEncryption = ipsecEncryption; - return this; - } - - /** - * Get the ipsecIntegrity property: The IPSec integrity algorithm (IKE phase 1). - * - * @return the ipsecIntegrity value. - */ - public IpsecIntegrity ipsecIntegrity() { - return this.ipsecIntegrity; - } - - /** - * Set the ipsecIntegrity property: The IPSec integrity algorithm (IKE phase 1). - * - * @param ipsecIntegrity the ipsecIntegrity value to set. - * @return the VpnClientIPsecParametersInner object itself. - */ - public VpnClientIPsecParametersInner withIpsecIntegrity(IpsecIntegrity ipsecIntegrity) { - this.ipsecIntegrity = ipsecIntegrity; - return this; - } - - /** - * Get the ikeEncryption property: The IKE encryption algorithm (IKE phase 2). - * - * @return the ikeEncryption value. - */ - public IkeEncryption ikeEncryption() { - return this.ikeEncryption; - } - - /** - * Set the ikeEncryption property: The IKE encryption algorithm (IKE phase 2). - * - * @param ikeEncryption the ikeEncryption value to set. - * @return the VpnClientIPsecParametersInner object itself. - */ - public VpnClientIPsecParametersInner withIkeEncryption(IkeEncryption ikeEncryption) { - this.ikeEncryption = ikeEncryption; - return this; - } - - /** - * Get the ikeIntegrity property: The IKE integrity algorithm (IKE phase 2). - * - * @return the ikeIntegrity value. - */ - public IkeIntegrity ikeIntegrity() { - return this.ikeIntegrity; - } - - /** - * Set the ikeIntegrity property: The IKE integrity algorithm (IKE phase 2). - * - * @param ikeIntegrity the ikeIntegrity value to set. - * @return the VpnClientIPsecParametersInner object itself. - */ - public VpnClientIPsecParametersInner withIkeIntegrity(IkeIntegrity ikeIntegrity) { - this.ikeIntegrity = ikeIntegrity; - return this; - } - - /** - * Get the dhGroup property: The DH Groups used in IKE Phase 1 for initial SA. - * - * @return the dhGroup value. - */ - public DhGroup dhGroup() { - return this.dhGroup; - } - - /** - * Set the dhGroup property: The DH Groups used in IKE Phase 1 for initial SA. - * - * @param dhGroup the dhGroup value to set. - * @return the VpnClientIPsecParametersInner object itself. - */ - public VpnClientIPsecParametersInner withDhGroup(DhGroup dhGroup) { - this.dhGroup = dhGroup; - return this; - } - - /** - * Get the pfsGroup property: The Pfs Groups used in IKE Phase 2 for new child SA. - * - * @return the pfsGroup value. - */ - public PfsGroup pfsGroup() { - return this.pfsGroup; - } - - /** - * Set the pfsGroup property: The Pfs Groups used in IKE Phase 2 for new child SA. - * - * @param pfsGroup the pfsGroup value to set. - * @return the VpnClientIPsecParametersInner object itself. - */ - public VpnClientIPsecParametersInner withPfsGroup(PfsGroup pfsGroup) { - this.pfsGroup = pfsGroup; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (ipsecEncryption() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property ipsecEncryption in model VpnClientIPsecParametersInner")); - } - if (ipsecIntegrity() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property ipsecIntegrity in model VpnClientIPsecParametersInner")); - } - if (ikeEncryption() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property ikeEncryption in model VpnClientIPsecParametersInner")); - } - if (ikeIntegrity() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property ikeIntegrity in model VpnClientIPsecParametersInner")); - } - if (dhGroup() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property dhGroup in model VpnClientIPsecParametersInner")); - } - if (pfsGroup() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property pfsGroup in model VpnClientIPsecParametersInner")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VpnClientRevokedCertificatePropertiesFormat.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VpnClientRevokedCertificatePropertiesFormat.java deleted file mode 100644 index 75c9a0545a84..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VpnClientRevokedCertificatePropertiesFormat.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Properties of the revoked VPN client certificate of virtual network gateway. */ -@Fluent -public final class VpnClientRevokedCertificatePropertiesFormat { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnClientRevokedCertificatePropertiesFormat.class); - - /* - * The revoked VPN client certificate thumbprint. - */ - @JsonProperty(value = "thumbprint") - private String thumbprint; - - /* - * The provisioning state of the VPN client revoked certificate resource. - * Possible values are: 'Updating', 'Deleting', and 'Failed'. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; - - /** - * Get the thumbprint property: The revoked VPN client certificate thumbprint. - * - * @return the thumbprint value. - */ - public String thumbprint() { - return this.thumbprint; - } - - /** - * Set the thumbprint property: The revoked VPN client certificate thumbprint. - * - * @param thumbprint the thumbprint value to set. - * @return the VpnClientRevokedCertificatePropertiesFormat object itself. - */ - public VpnClientRevokedCertificatePropertiesFormat withThumbprint(String thumbprint) { - this.thumbprint = thumbprint; - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the VPN client revoked certificate resource. - * Possible values are: 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VpnClientRootCertificatePropertiesFormat.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VpnClientRootCertificatePropertiesFormat.java deleted file mode 100644 index 717d3b621330..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VpnClientRootCertificatePropertiesFormat.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Properties of SSL certificates of application gateway. */ -@Fluent -public final class VpnClientRootCertificatePropertiesFormat { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnClientRootCertificatePropertiesFormat.class); - - /* - * The certificate public data. - */ - @JsonProperty(value = "publicCertData", required = true) - private String publicCertData; - - /* - * The provisioning state of the VPN client root certificate resource. - * Possible values are: 'Updating', 'Deleting', and 'Failed'. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; - - /** - * Get the publicCertData property: The certificate public data. - * - * @return the publicCertData value. - */ - public String publicCertData() { - return this.publicCertData; - } - - /** - * Set the publicCertData property: The certificate public data. - * - * @param publicCertData the publicCertData value to set. - * @return the VpnClientRootCertificatePropertiesFormat object itself. - */ - public VpnClientRootCertificatePropertiesFormat withPublicCertData(String publicCertData) { - this.publicCertData = publicCertData; - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the VPN client root certificate resource. Possible - * values are: 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (publicCertData() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property publicCertData in model VpnClientRootCertificatePropertiesFormat")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VpnConnectionInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VpnConnectionInner.java deleted file mode 100644 index 2ff21348e7ae..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VpnConnectionInner.java +++ /dev/null @@ -1,358 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.IpsecPolicy; -import com.azure.resourcemanager.network.models.ProvisioningState; -import com.azure.resourcemanager.network.models.VirtualNetworkGatewayConnectionProtocol; -import com.azure.resourcemanager.network.models.VpnConnectionStatus; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** VpnConnection Resource. */ -@Fluent -public final class VpnConnectionInner extends SubResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnConnectionInner.class); - - /* - * Parameters for VpnConnection - */ - @JsonProperty(value = "properties") - private VpnConnectionProperties innerProperties; - - /* - * The name of the resource that is unique within a resource group. This - * name can be used to access the resource. - */ - @JsonProperty(value = "name") - private String name; - - /* - * Gets a unique read-only string that changes whenever the resource is - * updated. - */ - @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) - private String etag; - - /** - * Get the innerProperties property: Parameters for VpnConnection. - * - * @return the innerProperties value. - */ - private VpnConnectionProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the name property: The name of the resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @param name the name value to set. - * @return the VpnConnectionInner object itself. - */ - public VpnConnectionInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the etag property: Gets a unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** {@inheritDoc} */ - @Override - public VpnConnectionInner withId(String id) { - super.withId(id); - return this; - } - - /** - * Get the remoteVpnSite property: Id of the connected vpn site. - * - * @return the remoteVpnSite value. - */ - public SubResource remoteVpnSite() { - return this.innerProperties() == null ? null : this.innerProperties().remoteVpnSite(); - } - - /** - * Set the remoteVpnSite property: Id of the connected vpn site. - * - * @param remoteVpnSite the remoteVpnSite value to set. - * @return the VpnConnectionInner object itself. - */ - public VpnConnectionInner withRemoteVpnSite(SubResource remoteVpnSite) { - if (this.innerProperties() == null) { - this.innerProperties = new VpnConnectionProperties(); - } - this.innerProperties().withRemoteVpnSite(remoteVpnSite); - return this; - } - - /** - * Get the routingWeight property: routing weight for vpn connection. - * - * @return the routingWeight value. - */ - public Integer routingWeight() { - return this.innerProperties() == null ? null : this.innerProperties().routingWeight(); - } - - /** - * Set the routingWeight property: routing weight for vpn connection. - * - * @param routingWeight the routingWeight value to set. - * @return the VpnConnectionInner object itself. - */ - public VpnConnectionInner withRoutingWeight(Integer routingWeight) { - if (this.innerProperties() == null) { - this.innerProperties = new VpnConnectionProperties(); - } - this.innerProperties().withRoutingWeight(routingWeight); - return this; - } - - /** - * Get the connectionStatus property: The connection status. - * - * @return the connectionStatus value. - */ - public VpnConnectionStatus connectionStatus() { - return this.innerProperties() == null ? null : this.innerProperties().connectionStatus(); - } - - /** - * Get the vpnConnectionProtocolType property: Connection protocol used for this connection. - * - * @return the vpnConnectionProtocolType value. - */ - public VirtualNetworkGatewayConnectionProtocol vpnConnectionProtocolType() { - return this.innerProperties() == null ? null : this.innerProperties().vpnConnectionProtocolType(); - } - - /** - * Set the vpnConnectionProtocolType property: Connection protocol used for this connection. - * - * @param vpnConnectionProtocolType the vpnConnectionProtocolType value to set. - * @return the VpnConnectionInner object itself. - */ - public VpnConnectionInner withVpnConnectionProtocolType( - VirtualNetworkGatewayConnectionProtocol vpnConnectionProtocolType) { - if (this.innerProperties() == null) { - this.innerProperties = new VpnConnectionProperties(); - } - this.innerProperties().withVpnConnectionProtocolType(vpnConnectionProtocolType); - return this; - } - - /** - * Get the ingressBytesTransferred property: Ingress bytes transferred. - * - * @return the ingressBytesTransferred value. - */ - public Long ingressBytesTransferred() { - return this.innerProperties() == null ? null : this.innerProperties().ingressBytesTransferred(); - } - - /** - * Get the egressBytesTransferred property: Egress bytes transferred. - * - * @return the egressBytesTransferred value. - */ - public Long egressBytesTransferred() { - return this.innerProperties() == null ? null : this.innerProperties().egressBytesTransferred(); - } - - /** - * Get the connectionBandwidth property: Expected bandwidth in MBPS. - * - * @return the connectionBandwidth value. - */ - public Integer connectionBandwidth() { - return this.innerProperties() == null ? null : this.innerProperties().connectionBandwidth(); - } - - /** - * Set the connectionBandwidth property: Expected bandwidth in MBPS. - * - * @param connectionBandwidth the connectionBandwidth value to set. - * @return the VpnConnectionInner object itself. - */ - public VpnConnectionInner withConnectionBandwidth(Integer connectionBandwidth) { - if (this.innerProperties() == null) { - this.innerProperties = new VpnConnectionProperties(); - } - this.innerProperties().withConnectionBandwidth(connectionBandwidth); - return this; - } - - /** - * Get the sharedKey property: SharedKey for the vpn connection. - * - * @return the sharedKey value. - */ - public String sharedKey() { - return this.innerProperties() == null ? null : this.innerProperties().sharedKey(); - } - - /** - * Set the sharedKey property: SharedKey for the vpn connection. - * - * @param sharedKey the sharedKey value to set. - * @return the VpnConnectionInner object itself. - */ - public VpnConnectionInner withSharedKey(String sharedKey) { - if (this.innerProperties() == null) { - this.innerProperties = new VpnConnectionProperties(); - } - this.innerProperties().withSharedKey(sharedKey); - return this; - } - - /** - * Get the enableBgp property: EnableBgp flag. - * - * @return the enableBgp value. - */ - public Boolean enableBgp() { - return this.innerProperties() == null ? null : this.innerProperties().enableBgp(); - } - - /** - * Set the enableBgp property: EnableBgp flag. - * - * @param enableBgp the enableBgp value to set. - * @return the VpnConnectionInner object itself. - */ - public VpnConnectionInner withEnableBgp(Boolean enableBgp) { - if (this.innerProperties() == null) { - this.innerProperties = new VpnConnectionProperties(); - } - this.innerProperties().withEnableBgp(enableBgp); - return this; - } - - /** - * Get the ipsecPolicies property: The IPSec Policies to be considered by this connection. - * - * @return the ipsecPolicies value. - */ - public List ipsecPolicies() { - return this.innerProperties() == null ? null : this.innerProperties().ipsecPolicies(); - } - - /** - * Set the ipsecPolicies property: The IPSec Policies to be considered by this connection. - * - * @param ipsecPolicies the ipsecPolicies value to set. - * @return the VpnConnectionInner object itself. - */ - public VpnConnectionInner withIpsecPolicies(List ipsecPolicies) { - if (this.innerProperties() == null) { - this.innerProperties = new VpnConnectionProperties(); - } - this.innerProperties().withIpsecPolicies(ipsecPolicies); - return this; - } - - /** - * Get the enableRateLimiting property: EnableBgp flag. - * - * @return the enableRateLimiting value. - */ - public Boolean enableRateLimiting() { - return this.innerProperties() == null ? null : this.innerProperties().enableRateLimiting(); - } - - /** - * Set the enableRateLimiting property: EnableBgp flag. - * - * @param enableRateLimiting the enableRateLimiting value to set. - * @return the VpnConnectionInner object itself. - */ - public VpnConnectionInner withEnableRateLimiting(Boolean enableRateLimiting) { - if (this.innerProperties() == null) { - this.innerProperties = new VpnConnectionProperties(); - } - this.innerProperties().withEnableRateLimiting(enableRateLimiting); - return this; - } - - /** - * Get the enableInternetSecurity property: Enable internet security. - * - * @return the enableInternetSecurity value. - */ - public Boolean enableInternetSecurity() { - return this.innerProperties() == null ? null : this.innerProperties().enableInternetSecurity(); - } - - /** - * Set the enableInternetSecurity property: Enable internet security. - * - * @param enableInternetSecurity the enableInternetSecurity value to set. - * @return the VpnConnectionInner object itself. - */ - public VpnConnectionInner withEnableInternetSecurity(Boolean enableInternetSecurity) { - if (this.innerProperties() == null) { - this.innerProperties = new VpnConnectionProperties(); - } - this.innerProperties().withEnableInternetSecurity(enableInternetSecurity); - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the resource. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Set the provisioningState property: The provisioning state of the resource. - * - * @param provisioningState the provisioningState value to set. - * @return the VpnConnectionInner object itself. - */ - public VpnConnectionInner withProvisioningState(ProvisioningState provisioningState) { - if (this.innerProperties() == null) { - this.innerProperties = new VpnConnectionProperties(); - } - this.innerProperties().withProvisioningState(provisioningState); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VpnConnectionProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VpnConnectionProperties.java deleted file mode 100644 index 3fc5b372bb4c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VpnConnectionProperties.java +++ /dev/null @@ -1,339 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.IpsecPolicy; -import com.azure.resourcemanager.network.models.ProvisioningState; -import com.azure.resourcemanager.network.models.VirtualNetworkGatewayConnectionProtocol; -import com.azure.resourcemanager.network.models.VpnConnectionStatus; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Parameters for VpnConnection. */ -@Fluent -public final class VpnConnectionProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnConnectionProperties.class); - - /* - * Id of the connected vpn site. - */ - @JsonProperty(value = "remoteVpnSite") - private SubResource remoteVpnSite; - - /* - * routing weight for vpn connection. - */ - @JsonProperty(value = "routingWeight") - private Integer routingWeight; - - /* - * The connection status. - */ - @JsonProperty(value = "connectionStatus", access = JsonProperty.Access.WRITE_ONLY) - private VpnConnectionStatus connectionStatus; - - /* - * Connection protocol used for this connection - */ - @JsonProperty(value = "vpnConnectionProtocolType") - private VirtualNetworkGatewayConnectionProtocol vpnConnectionProtocolType; - - /* - * Ingress bytes transferred. - */ - @JsonProperty(value = "ingressBytesTransferred", access = JsonProperty.Access.WRITE_ONLY) - private Long ingressBytesTransferred; - - /* - * Egress bytes transferred. - */ - @JsonProperty(value = "egressBytesTransferred", access = JsonProperty.Access.WRITE_ONLY) - private Long egressBytesTransferred; - - /* - * Expected bandwidth in MBPS. - */ - @JsonProperty(value = "connectionBandwidth") - private Integer connectionBandwidth; - - /* - * SharedKey for the vpn connection. - */ - @JsonProperty(value = "sharedKey") - private String sharedKey; - - /* - * EnableBgp flag - */ - @JsonProperty(value = "enableBgp") - private Boolean enableBgp; - - /* - * The IPSec Policies to be considered by this connection. - */ - @JsonProperty(value = "ipsecPolicies") - private List ipsecPolicies; - - /* - * EnableBgp flag - */ - @JsonProperty(value = "enableRateLimiting") - private Boolean enableRateLimiting; - - /* - * Enable internet security - */ - @JsonProperty(value = "enableInternetSecurity") - private Boolean enableInternetSecurity; - - /* - * The provisioning state of the resource. - */ - @JsonProperty(value = "provisioningState") - private ProvisioningState provisioningState; - - /** - * Get the remoteVpnSite property: Id of the connected vpn site. - * - * @return the remoteVpnSite value. - */ - public SubResource remoteVpnSite() { - return this.remoteVpnSite; - } - - /** - * Set the remoteVpnSite property: Id of the connected vpn site. - * - * @param remoteVpnSite the remoteVpnSite value to set. - * @return the VpnConnectionProperties object itself. - */ - public VpnConnectionProperties withRemoteVpnSite(SubResource remoteVpnSite) { - this.remoteVpnSite = remoteVpnSite; - return this; - } - - /** - * Get the routingWeight property: routing weight for vpn connection. - * - * @return the routingWeight value. - */ - public Integer routingWeight() { - return this.routingWeight; - } - - /** - * Set the routingWeight property: routing weight for vpn connection. - * - * @param routingWeight the routingWeight value to set. - * @return the VpnConnectionProperties object itself. - */ - public VpnConnectionProperties withRoutingWeight(Integer routingWeight) { - this.routingWeight = routingWeight; - return this; - } - - /** - * Get the connectionStatus property: The connection status. - * - * @return the connectionStatus value. - */ - public VpnConnectionStatus connectionStatus() { - return this.connectionStatus; - } - - /** - * Get the vpnConnectionProtocolType property: Connection protocol used for this connection. - * - * @return the vpnConnectionProtocolType value. - */ - public VirtualNetworkGatewayConnectionProtocol vpnConnectionProtocolType() { - return this.vpnConnectionProtocolType; - } - - /** - * Set the vpnConnectionProtocolType property: Connection protocol used for this connection. - * - * @param vpnConnectionProtocolType the vpnConnectionProtocolType value to set. - * @return the VpnConnectionProperties object itself. - */ - public VpnConnectionProperties withVpnConnectionProtocolType( - VirtualNetworkGatewayConnectionProtocol vpnConnectionProtocolType) { - this.vpnConnectionProtocolType = vpnConnectionProtocolType; - return this; - } - - /** - * Get the ingressBytesTransferred property: Ingress bytes transferred. - * - * @return the ingressBytesTransferred value. - */ - public Long ingressBytesTransferred() { - return this.ingressBytesTransferred; - } - - /** - * Get the egressBytesTransferred property: Egress bytes transferred. - * - * @return the egressBytesTransferred value. - */ - public Long egressBytesTransferred() { - return this.egressBytesTransferred; - } - - /** - * Get the connectionBandwidth property: Expected bandwidth in MBPS. - * - * @return the connectionBandwidth value. - */ - public Integer connectionBandwidth() { - return this.connectionBandwidth; - } - - /** - * Set the connectionBandwidth property: Expected bandwidth in MBPS. - * - * @param connectionBandwidth the connectionBandwidth value to set. - * @return the VpnConnectionProperties object itself. - */ - public VpnConnectionProperties withConnectionBandwidth(Integer connectionBandwidth) { - this.connectionBandwidth = connectionBandwidth; - return this; - } - - /** - * Get the sharedKey property: SharedKey for the vpn connection. - * - * @return the sharedKey value. - */ - public String sharedKey() { - return this.sharedKey; - } - - /** - * Set the sharedKey property: SharedKey for the vpn connection. - * - * @param sharedKey the sharedKey value to set. - * @return the VpnConnectionProperties object itself. - */ - public VpnConnectionProperties withSharedKey(String sharedKey) { - this.sharedKey = sharedKey; - return this; - } - - /** - * Get the enableBgp property: EnableBgp flag. - * - * @return the enableBgp value. - */ - public Boolean enableBgp() { - return this.enableBgp; - } - - /** - * Set the enableBgp property: EnableBgp flag. - * - * @param enableBgp the enableBgp value to set. - * @return the VpnConnectionProperties object itself. - */ - public VpnConnectionProperties withEnableBgp(Boolean enableBgp) { - this.enableBgp = enableBgp; - return this; - } - - /** - * Get the ipsecPolicies property: The IPSec Policies to be considered by this connection. - * - * @return the ipsecPolicies value. - */ - public List ipsecPolicies() { - return this.ipsecPolicies; - } - - /** - * Set the ipsecPolicies property: The IPSec Policies to be considered by this connection. - * - * @param ipsecPolicies the ipsecPolicies value to set. - * @return the VpnConnectionProperties object itself. - */ - public VpnConnectionProperties withIpsecPolicies(List ipsecPolicies) { - this.ipsecPolicies = ipsecPolicies; - return this; - } - - /** - * Get the enableRateLimiting property: EnableBgp flag. - * - * @return the enableRateLimiting value. - */ - public Boolean enableRateLimiting() { - return this.enableRateLimiting; - } - - /** - * Set the enableRateLimiting property: EnableBgp flag. - * - * @param enableRateLimiting the enableRateLimiting value to set. - * @return the VpnConnectionProperties object itself. - */ - public VpnConnectionProperties withEnableRateLimiting(Boolean enableRateLimiting) { - this.enableRateLimiting = enableRateLimiting; - return this; - } - - /** - * Get the enableInternetSecurity property: Enable internet security. - * - * @return the enableInternetSecurity value. - */ - public Boolean enableInternetSecurity() { - return this.enableInternetSecurity; - } - - /** - * Set the enableInternetSecurity property: Enable internet security. - * - * @param enableInternetSecurity the enableInternetSecurity value to set. - * @return the VpnConnectionProperties object itself. - */ - public VpnConnectionProperties withEnableInternetSecurity(Boolean enableInternetSecurity) { - this.enableInternetSecurity = enableInternetSecurity; - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the resource. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Set the provisioningState property: The provisioning state of the resource. - * - * @param provisioningState the provisioningState value to set. - * @return the VpnConnectionProperties object itself. - */ - public VpnConnectionProperties withProvisioningState(ProvisioningState provisioningState) { - this.provisioningState = provisioningState; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (ipsecPolicies() != null) { - ipsecPolicies().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VpnGatewayInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VpnGatewayInner.java deleted file mode 100644 index c61c623ccf29..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VpnGatewayInner.java +++ /dev/null @@ -1,219 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.BgpSettings; -import com.azure.resourcemanager.network.models.ProvisioningState; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** VpnGateway Resource. */ -@Fluent -public final class VpnGatewayInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnGatewayInner.class); - - /* - * Parameters for VpnGateway - */ - @JsonProperty(value = "properties") - private VpnGatewayProperties innerProperties; - - /* - * Gets a unique read-only string that changes whenever the resource is - * updated. - */ - @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) - private String etag; - - /* - * Resource ID. - */ - @JsonProperty(value = "id") - private String id; - - /** - * Get the innerProperties property: Parameters for VpnGateway. - * - * @return the innerProperties value. - */ - private VpnGatewayProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the etag property: Gets a unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Get the id property: Resource ID. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: Resource ID. - * - * @param id the id value to set. - * @return the VpnGatewayInner object itself. - */ - public VpnGatewayInner withId(String id) { - this.id = id; - return this; - } - - /** {@inheritDoc} */ - @Override - public VpnGatewayInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public VpnGatewayInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the virtualHub property: The VirtualHub to which the gateway belongs. - * - * @return the virtualHub value. - */ - public SubResource virtualHub() { - return this.innerProperties() == null ? null : this.innerProperties().virtualHub(); - } - - /** - * Set the virtualHub property: The VirtualHub to which the gateway belongs. - * - * @param virtualHub the virtualHub value to set. - * @return the VpnGatewayInner object itself. - */ - public VpnGatewayInner withVirtualHub(SubResource virtualHub) { - if (this.innerProperties() == null) { - this.innerProperties = new VpnGatewayProperties(); - } - this.innerProperties().withVirtualHub(virtualHub); - return this; - } - - /** - * Get the connections property: list of all vpn connections to the gateway. - * - * @return the connections value. - */ - public List connections() { - return this.innerProperties() == null ? null : this.innerProperties().connections(); - } - - /** - * Set the connections property: list of all vpn connections to the gateway. - * - * @param connections the connections value to set. - * @return the VpnGatewayInner object itself. - */ - public VpnGatewayInner withConnections(List connections) { - if (this.innerProperties() == null) { - this.innerProperties = new VpnGatewayProperties(); - } - this.innerProperties().withConnections(connections); - return this; - } - - /** - * Get the bgpSettings property: Local network gateway's BGP speaker settings. - * - * @return the bgpSettings value. - */ - public BgpSettings bgpSettings() { - return this.innerProperties() == null ? null : this.innerProperties().bgpSettings(); - } - - /** - * Set the bgpSettings property: Local network gateway's BGP speaker settings. - * - * @param bgpSettings the bgpSettings value to set. - * @return the VpnGatewayInner object itself. - */ - public VpnGatewayInner withBgpSettings(BgpSettings bgpSettings) { - if (this.innerProperties() == null) { - this.innerProperties = new VpnGatewayProperties(); - } - this.innerProperties().withBgpSettings(bgpSettings); - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the resource. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Set the provisioningState property: The provisioning state of the resource. - * - * @param provisioningState the provisioningState value to set. - * @return the VpnGatewayInner object itself. - */ - public VpnGatewayInner withProvisioningState(ProvisioningState provisioningState) { - if (this.innerProperties() == null) { - this.innerProperties = new VpnGatewayProperties(); - } - this.innerProperties().withProvisioningState(provisioningState); - return this; - } - - /** - * Get the vpnGatewayScaleUnit property: The scale unit for this vpn gateway. - * - * @return the vpnGatewayScaleUnit value. - */ - public Integer vpnGatewayScaleUnit() { - return this.innerProperties() == null ? null : this.innerProperties().vpnGatewayScaleUnit(); - } - - /** - * Set the vpnGatewayScaleUnit property: The scale unit for this vpn gateway. - * - * @param vpnGatewayScaleUnit the vpnGatewayScaleUnit value to set. - * @return the VpnGatewayInner object itself. - */ - public VpnGatewayInner withVpnGatewayScaleUnit(Integer vpnGatewayScaleUnit) { - if (this.innerProperties() == null) { - this.innerProperties = new VpnGatewayProperties(); - } - this.innerProperties().withVpnGatewayScaleUnit(vpnGatewayScaleUnit); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VpnGatewayProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VpnGatewayProperties.java deleted file mode 100644 index dae9d4cb3573..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VpnGatewayProperties.java +++ /dev/null @@ -1,164 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.BgpSettings; -import com.azure.resourcemanager.network.models.ProvisioningState; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Parameters for VpnGateway. */ -@Fluent -public final class VpnGatewayProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnGatewayProperties.class); - - /* - * The VirtualHub to which the gateway belongs - */ - @JsonProperty(value = "virtualHub") - private SubResource virtualHub; - - /* - * list of all vpn connections to the gateway. - */ - @JsonProperty(value = "connections") - private List connections; - - /* - * Local network gateway's BGP speaker settings. - */ - @JsonProperty(value = "bgpSettings") - private BgpSettings bgpSettings; - - /* - * The provisioning state of the resource. - */ - @JsonProperty(value = "provisioningState") - private ProvisioningState provisioningState; - - /* - * The scale unit for this vpn gateway. - */ - @JsonProperty(value = "vpnGatewayScaleUnit") - private Integer vpnGatewayScaleUnit; - - /** - * Get the virtualHub property: The VirtualHub to which the gateway belongs. - * - * @return the virtualHub value. - */ - public SubResource virtualHub() { - return this.virtualHub; - } - - /** - * Set the virtualHub property: The VirtualHub to which the gateway belongs. - * - * @param virtualHub the virtualHub value to set. - * @return the VpnGatewayProperties object itself. - */ - public VpnGatewayProperties withVirtualHub(SubResource virtualHub) { - this.virtualHub = virtualHub; - return this; - } - - /** - * Get the connections property: list of all vpn connections to the gateway. - * - * @return the connections value. - */ - public List connections() { - return this.connections; - } - - /** - * Set the connections property: list of all vpn connections to the gateway. - * - * @param connections the connections value to set. - * @return the VpnGatewayProperties object itself. - */ - public VpnGatewayProperties withConnections(List connections) { - this.connections = connections; - return this; - } - - /** - * Get the bgpSettings property: Local network gateway's BGP speaker settings. - * - * @return the bgpSettings value. - */ - public BgpSettings bgpSettings() { - return this.bgpSettings; - } - - /** - * Set the bgpSettings property: Local network gateway's BGP speaker settings. - * - * @param bgpSettings the bgpSettings value to set. - * @return the VpnGatewayProperties object itself. - */ - public VpnGatewayProperties withBgpSettings(BgpSettings bgpSettings) { - this.bgpSettings = bgpSettings; - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the resource. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Set the provisioningState property: The provisioning state of the resource. - * - * @param provisioningState the provisioningState value to set. - * @return the VpnGatewayProperties object itself. - */ - public VpnGatewayProperties withProvisioningState(ProvisioningState provisioningState) { - this.provisioningState = provisioningState; - return this; - } - - /** - * Get the vpnGatewayScaleUnit property: The scale unit for this vpn gateway. - * - * @return the vpnGatewayScaleUnit value. - */ - public Integer vpnGatewayScaleUnit() { - return this.vpnGatewayScaleUnit; - } - - /** - * Set the vpnGatewayScaleUnit property: The scale unit for this vpn gateway. - * - * @param vpnGatewayScaleUnit the vpnGatewayScaleUnit value to set. - * @return the VpnGatewayProperties object itself. - */ - public VpnGatewayProperties withVpnGatewayScaleUnit(Integer vpnGatewayScaleUnit) { - this.vpnGatewayScaleUnit = vpnGatewayScaleUnit; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (connections() != null) { - connections().forEach(e -> e.validate()); - } - if (bgpSettings() != null) { - bgpSettings().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VpnProfileResponseInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VpnProfileResponseInner.java deleted file mode 100644 index 5c5f87a08bca..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VpnProfileResponseInner.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Vpn Profile Response for package generation. */ -@Fluent -public final class VpnProfileResponseInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnProfileResponseInner.class); - - /* - * URL to the VPN profile - */ - @JsonProperty(value = "profileUrl") - private String profileUrl; - - /** - * Get the profileUrl property: URL to the VPN profile. - * - * @return the profileUrl value. - */ - public String profileUrl() { - return this.profileUrl; - } - - /** - * Set the profileUrl property: URL to the VPN profile. - * - * @param profileUrl the profileUrl value to set. - * @return the VpnProfileResponseInner object itself. - */ - public VpnProfileResponseInner withProfileUrl(String profileUrl) { - this.profileUrl = profileUrl; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VpnSiteInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VpnSiteInner.java deleted file mode 100644 index 1042c50aa84f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VpnSiteInner.java +++ /dev/null @@ -1,289 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.AddressSpace; -import com.azure.resourcemanager.network.models.BgpSettings; -import com.azure.resourcemanager.network.models.DeviceProperties; -import com.azure.resourcemanager.network.models.ProvisioningState; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** VpnSite Resource. */ -@Fluent -public final class VpnSiteInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnSiteInner.class); - - /* - * Parameters for VpnSite - */ - @JsonProperty(value = "properties") - private VpnSiteProperties innerProperties; - - /* - * Gets a unique read-only string that changes whenever the resource is - * updated. - */ - @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) - private String etag; - - /* - * Resource ID. - */ - @JsonProperty(value = "id") - private String id; - - /** - * Get the innerProperties property: Parameters for VpnSite. - * - * @return the innerProperties value. - */ - private VpnSiteProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the etag property: Gets a unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Get the id property: Resource ID. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: Resource ID. - * - * @param id the id value to set. - * @return the VpnSiteInner object itself. - */ - public VpnSiteInner withId(String id) { - this.id = id; - return this; - } - - /** {@inheritDoc} */ - @Override - public VpnSiteInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public VpnSiteInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the virtualWan property: The VirtualWAN to which the vpnSite belongs. - * - * @return the virtualWan value. - */ - public SubResource virtualWan() { - return this.innerProperties() == null ? null : this.innerProperties().virtualWan(); - } - - /** - * Set the virtualWan property: The VirtualWAN to which the vpnSite belongs. - * - * @param virtualWan the virtualWan value to set. - * @return the VpnSiteInner object itself. - */ - public VpnSiteInner withVirtualWan(SubResource virtualWan) { - if (this.innerProperties() == null) { - this.innerProperties = new VpnSiteProperties(); - } - this.innerProperties().withVirtualWan(virtualWan); - return this; - } - - /** - * Get the deviceProperties property: The device properties. - * - * @return the deviceProperties value. - */ - public DeviceProperties deviceProperties() { - return this.innerProperties() == null ? null : this.innerProperties().deviceProperties(); - } - - /** - * Set the deviceProperties property: The device properties. - * - * @param deviceProperties the deviceProperties value to set. - * @return the VpnSiteInner object itself. - */ - public VpnSiteInner withDeviceProperties(DeviceProperties deviceProperties) { - if (this.innerProperties() == null) { - this.innerProperties = new VpnSiteProperties(); - } - this.innerProperties().withDeviceProperties(deviceProperties); - return this; - } - - /** - * Get the ipAddress property: The ip-address for the vpn-site. - * - * @return the ipAddress value. - */ - public String ipAddress() { - return this.innerProperties() == null ? null : this.innerProperties().ipAddress(); - } - - /** - * Set the ipAddress property: The ip-address for the vpn-site. - * - * @param ipAddress the ipAddress value to set. - * @return the VpnSiteInner object itself. - */ - public VpnSiteInner withIpAddress(String ipAddress) { - if (this.innerProperties() == null) { - this.innerProperties = new VpnSiteProperties(); - } - this.innerProperties().withIpAddress(ipAddress); - return this; - } - - /** - * Get the siteKey property: The key for vpn-site that can be used for connections. - * - * @return the siteKey value. - */ - public String siteKey() { - return this.innerProperties() == null ? null : this.innerProperties().siteKey(); - } - - /** - * Set the siteKey property: The key for vpn-site that can be used for connections. - * - * @param siteKey the siteKey value to set. - * @return the VpnSiteInner object itself. - */ - public VpnSiteInner withSiteKey(String siteKey) { - if (this.innerProperties() == null) { - this.innerProperties = new VpnSiteProperties(); - } - this.innerProperties().withSiteKey(siteKey); - return this; - } - - /** - * Get the addressSpace property: The AddressSpace that contains an array of IP address ranges. - * - * @return the addressSpace value. - */ - public AddressSpace addressSpace() { - return this.innerProperties() == null ? null : this.innerProperties().addressSpace(); - } - - /** - * Set the addressSpace property: The AddressSpace that contains an array of IP address ranges. - * - * @param addressSpace the addressSpace value to set. - * @return the VpnSiteInner object itself. - */ - public VpnSiteInner withAddressSpace(AddressSpace addressSpace) { - if (this.innerProperties() == null) { - this.innerProperties = new VpnSiteProperties(); - } - this.innerProperties().withAddressSpace(addressSpace); - return this; - } - - /** - * Get the bgpProperties property: The set of bgp properties. - * - * @return the bgpProperties value. - */ - public BgpSettings bgpProperties() { - return this.innerProperties() == null ? null : this.innerProperties().bgpProperties(); - } - - /** - * Set the bgpProperties property: The set of bgp properties. - * - * @param bgpProperties the bgpProperties value to set. - * @return the VpnSiteInner object itself. - */ - public VpnSiteInner withBgpProperties(BgpSettings bgpProperties) { - if (this.innerProperties() == null) { - this.innerProperties = new VpnSiteProperties(); - } - this.innerProperties().withBgpProperties(bgpProperties); - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the resource. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Set the provisioningState property: The provisioning state of the resource. - * - * @param provisioningState the provisioningState value to set. - * @return the VpnSiteInner object itself. - */ - public VpnSiteInner withProvisioningState(ProvisioningState provisioningState) { - if (this.innerProperties() == null) { - this.innerProperties = new VpnSiteProperties(); - } - this.innerProperties().withProvisioningState(provisioningState); - return this; - } - - /** - * Get the isSecuritySite property: IsSecuritySite flag. - * - * @return the isSecuritySite value. - */ - public Boolean isSecuritySite() { - return this.innerProperties() == null ? null : this.innerProperties().isSecuritySite(); - } - - /** - * Set the isSecuritySite property: IsSecuritySite flag. - * - * @param isSecuritySite the isSecuritySite value to set. - * @return the VpnSiteInner object itself. - */ - public VpnSiteInner withIsSecuritySite(Boolean isSecuritySite) { - if (this.innerProperties() == null) { - this.innerProperties = new VpnSiteProperties(); - } - this.innerProperties().withIsSecuritySite(isSecuritySite); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VpnSiteProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VpnSiteProperties.java deleted file mode 100644 index 37cca5710fe5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VpnSiteProperties.java +++ /dev/null @@ -1,246 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.AddressSpace; -import com.azure.resourcemanager.network.models.BgpSettings; -import com.azure.resourcemanager.network.models.DeviceProperties; -import com.azure.resourcemanager.network.models.ProvisioningState; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Parameters for VpnSite. */ -@Fluent -public final class VpnSiteProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnSiteProperties.class); - - /* - * The VirtualWAN to which the vpnSite belongs - */ - @JsonProperty(value = "virtualWan") - private SubResource virtualWan; - - /* - * The device properties - */ - @JsonProperty(value = "deviceProperties") - private DeviceProperties deviceProperties; - - /* - * The ip-address for the vpn-site. - */ - @JsonProperty(value = "ipAddress") - private String ipAddress; - - /* - * The key for vpn-site that can be used for connections. - */ - @JsonProperty(value = "siteKey") - private String siteKey; - - /* - * The AddressSpace that contains an array of IP address ranges. - */ - @JsonProperty(value = "addressSpace") - private AddressSpace addressSpace; - - /* - * The set of bgp properties. - */ - @JsonProperty(value = "bgpProperties") - private BgpSettings bgpProperties; - - /* - * The provisioning state of the resource. - */ - @JsonProperty(value = "provisioningState") - private ProvisioningState provisioningState; - - /* - * IsSecuritySite flag - */ - @JsonProperty(value = "isSecuritySite") - private Boolean isSecuritySite; - - /** - * Get the virtualWan property: The VirtualWAN to which the vpnSite belongs. - * - * @return the virtualWan value. - */ - public SubResource virtualWan() { - return this.virtualWan; - } - - /** - * Set the virtualWan property: The VirtualWAN to which the vpnSite belongs. - * - * @param virtualWan the virtualWan value to set. - * @return the VpnSiteProperties object itself. - */ - public VpnSiteProperties withVirtualWan(SubResource virtualWan) { - this.virtualWan = virtualWan; - return this; - } - - /** - * Get the deviceProperties property: The device properties. - * - * @return the deviceProperties value. - */ - public DeviceProperties deviceProperties() { - return this.deviceProperties; - } - - /** - * Set the deviceProperties property: The device properties. - * - * @param deviceProperties the deviceProperties value to set. - * @return the VpnSiteProperties object itself. - */ - public VpnSiteProperties withDeviceProperties(DeviceProperties deviceProperties) { - this.deviceProperties = deviceProperties; - return this; - } - - /** - * Get the ipAddress property: The ip-address for the vpn-site. - * - * @return the ipAddress value. - */ - public String ipAddress() { - return this.ipAddress; - } - - /** - * Set the ipAddress property: The ip-address for the vpn-site. - * - * @param ipAddress the ipAddress value to set. - * @return the VpnSiteProperties object itself. - */ - public VpnSiteProperties withIpAddress(String ipAddress) { - this.ipAddress = ipAddress; - return this; - } - - /** - * Get the siteKey property: The key for vpn-site that can be used for connections. - * - * @return the siteKey value. - */ - public String siteKey() { - return this.siteKey; - } - - /** - * Set the siteKey property: The key for vpn-site that can be used for connections. - * - * @param siteKey the siteKey value to set. - * @return the VpnSiteProperties object itself. - */ - public VpnSiteProperties withSiteKey(String siteKey) { - this.siteKey = siteKey; - return this; - } - - /** - * Get the addressSpace property: The AddressSpace that contains an array of IP address ranges. - * - * @return the addressSpace value. - */ - public AddressSpace addressSpace() { - return this.addressSpace; - } - - /** - * Set the addressSpace property: The AddressSpace that contains an array of IP address ranges. - * - * @param addressSpace the addressSpace value to set. - * @return the VpnSiteProperties object itself. - */ - public VpnSiteProperties withAddressSpace(AddressSpace addressSpace) { - this.addressSpace = addressSpace; - return this; - } - - /** - * Get the bgpProperties property: The set of bgp properties. - * - * @return the bgpProperties value. - */ - public BgpSettings bgpProperties() { - return this.bgpProperties; - } - - /** - * Set the bgpProperties property: The set of bgp properties. - * - * @param bgpProperties the bgpProperties value to set. - * @return the VpnSiteProperties object itself. - */ - public VpnSiteProperties withBgpProperties(BgpSettings bgpProperties) { - this.bgpProperties = bgpProperties; - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the resource. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Set the provisioningState property: The provisioning state of the resource. - * - * @param provisioningState the provisioningState value to set. - * @return the VpnSiteProperties object itself. - */ - public VpnSiteProperties withProvisioningState(ProvisioningState provisioningState) { - this.provisioningState = provisioningState; - return this; - } - - /** - * Get the isSecuritySite property: IsSecuritySite flag. - * - * @return the isSecuritySite value. - */ - public Boolean isSecuritySite() { - return this.isSecuritySite; - } - - /** - * Set the isSecuritySite property: IsSecuritySite flag. - * - * @param isSecuritySite the isSecuritySite value to set. - * @return the VpnSiteProperties object itself. - */ - public VpnSiteProperties withIsSecuritySite(Boolean isSecuritySite) { - this.isSecuritySite = isSecuritySite; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (deviceProperties() != null) { - deviceProperties().validate(); - } - if (addressSpace() != null) { - addressSpace().validate(); - } - if (bgpProperties() != null) { - bgpProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/package-info.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/package-info.java deleted file mode 100644 index 40b03e98c92c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** Package containing the inner data models for NetworkManagementClient. Network Client. */ -package com.azure.resourcemanager.network.fluent.models; diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/package-info.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/package-info.java deleted file mode 100644 index 8461ef5d9dab..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** Package containing the service clients for NetworkManagementClient. Network Client. */ -package com.azure.resourcemanager.network.fluent; diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ApplicationGatewayAuthenticationCertificateImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ApplicationGatewayAuthenticationCertificateImpl.java deleted file mode 100644 index 22157b23069e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ApplicationGatewayAuthenticationCertificateImpl.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.resourcemanager.network.models.ApplicationGateway; -import com.azure.resourcemanager.network.models.ApplicationGatewayAuthenticationCertificate; -import com.azure.resourcemanager.network.fluent.models.ApplicationGatewayAuthenticationCertificateInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.ChildResourceImpl; -import java.io.File; -import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.util.Base64; - -/** Implementation for ApplicationGatewayAuthenticationCertificate. */ -class ApplicationGatewayAuthenticationCertificateImpl - extends ChildResourceImpl< - ApplicationGatewayAuthenticationCertificateInner, ApplicationGatewayImpl, ApplicationGateway> - implements ApplicationGatewayAuthenticationCertificate, - ApplicationGatewayAuthenticationCertificate.Definition, - ApplicationGatewayAuthenticationCertificate.UpdateDefinition, - ApplicationGatewayAuthenticationCertificate.Update { - - ApplicationGatewayAuthenticationCertificateImpl( - ApplicationGatewayAuthenticationCertificateInner inner, ApplicationGatewayImpl parent) { - super(inner, parent); - } - - // Helpers - - // Getters - - @Override - public String name() { - return this.innerModel().name(); - } - - @Override - public String data() { - return this.innerModel().data(); - } - - // Verbs - - @Override - public ApplicationGatewayImpl attach() { - return this.parent().withAuthenticationCertificate(this); - } - - // Withers - - @Override - public ApplicationGatewayAuthenticationCertificateImpl fromBytes(byte[] data) { - String encoded = new String(Base64.getEncoder().encode(data), StandardCharsets.UTF_8); - return this.fromBase64(encoded); - } - - @Override - public ApplicationGatewayAuthenticationCertificateImpl fromFile(File certificateFile) throws IOException { - if (certificateFile == null) { - return null; - } - - byte[] content = Files.readAllBytes(certificateFile.toPath()); - return this.fromBytes(content); - } - - @Override - public ApplicationGatewayAuthenticationCertificateImpl fromBase64(String base64data) { - if (base64data == null) { - return this; - } - - this.innerModel().withData(base64data); - return this; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ApplicationGatewayBackendHealthImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ApplicationGatewayBackendHealthImpl.java deleted file mode 100644 index b073a10ad488..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ApplicationGatewayBackendHealthImpl.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.resourcemanager.network.models.ApplicationGateway; -import com.azure.resourcemanager.network.models.ApplicationGatewayBackend; -import com.azure.resourcemanager.network.models.ApplicationGatewayBackendHealth; -import com.azure.resourcemanager.network.models.ApplicationGatewayBackendHealthHttpSettings; -import com.azure.resourcemanager.network.models.ApplicationGatewayBackendHealthPool; -import com.azure.resourcemanager.network.models.ApplicationGatewayBackendHttpConfigurationHealth; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils; -import java.util.Collections; -import java.util.Map; -import java.util.TreeMap; - -/** Implementation of application gateway backend health information. */ -public class ApplicationGatewayBackendHealthImpl implements ApplicationGatewayBackendHealth { - - private final ApplicationGatewayBackendHealthPool inner; - private final ApplicationGatewayImpl appGateway; - private final Map httpConfigHealths = new TreeMap<>(); - - ApplicationGatewayBackendHealthImpl(ApplicationGatewayBackendHealthPool inner, ApplicationGatewayImpl appGateway) { - this.inner = inner; - this.appGateway = appGateway; - if (inner != null) { - for (ApplicationGatewayBackendHealthHttpSettings httpConfigInner : inner.backendHttpSettingsCollection()) { - ApplicationGatewayBackendHttpConfigurationHealthImpl httpConfigHealth = - new ApplicationGatewayBackendHttpConfigurationHealthImpl(httpConfigInner, this); - this.httpConfigHealths.put(httpConfigHealth.name(), httpConfigHealth); - } - } - } - - @Override - public ApplicationGatewayBackendHealthPool innerModel() { - return this.inner; - } - - @Override - public String name() { - if (this.inner.backendAddressPool() != null) { - return ResourceUtils.nameFromResourceId(this.inner.backendAddressPool().id()); - } else { - return null; - } - } - - @Override - public ApplicationGatewayBackend backend() { - if (this.inner.backendAddressPool() == null) { - return null; - } - - String backendName = ResourceUtils.nameFromResourceId(this.inner.backendAddressPool().id()); - return this.appGateway.backends().get(backendName); - } - - @Override - public Map httpConfigurationHealths() { - return Collections.unmodifiableMap(this.httpConfigHealths); - } - - @Override - public ApplicationGateway parent() { - return this.appGateway; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ApplicationGatewayBackendHttpConfigurationHealthImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ApplicationGatewayBackendHttpConfigurationHealthImpl.java deleted file mode 100644 index 86c9a38d2cef..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ApplicationGatewayBackendHttpConfigurationHealthImpl.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.resourcemanager.network.models.ApplicationGatewayBackendHealth; -import com.azure.resourcemanager.network.models.ApplicationGatewayBackendHealthHttpSettings; -import com.azure.resourcemanager.network.models.ApplicationGatewayBackendHttpConfiguration; -import com.azure.resourcemanager.network.models.ApplicationGatewayBackendHttpConfigurationHealth; -import com.azure.resourcemanager.network.models.ApplicationGatewayBackendServerHealth; -import com.azure.resourcemanager.network.fluent.models.ApplicationGatewayBackendHealthServerInner; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils; -import java.util.Collections; -import java.util.Map; -import java.util.TreeMap; - -/** Implementation of application gateway backend HTTP configuration health information. */ -public class ApplicationGatewayBackendHttpConfigurationHealthImpl - implements ApplicationGatewayBackendHttpConfigurationHealth { - - private final ApplicationGatewayBackendHealthHttpSettings inner; - private final ApplicationGatewayBackendHealthImpl backendHealth; - private final Map serverHealths = new TreeMap<>(); - - ApplicationGatewayBackendHttpConfigurationHealthImpl( - ApplicationGatewayBackendHealthHttpSettings inner, ApplicationGatewayBackendHealthImpl backendHealth) { - this.inner = inner; - this.backendHealth = backendHealth; - - if (inner.servers() != null) { - for (ApplicationGatewayBackendHealthServerInner serverHealthInner : this.innerModel().servers()) { - ApplicationGatewayBackendServerHealth serverHealth = - new ApplicationGatewayBackendServerHealthImpl(serverHealthInner, this); - this.serverHealths.put(serverHealth.ipAddress(), serverHealth); - } - } - } - - @Override - public ApplicationGatewayBackendHealthHttpSettings innerModel() { - return this.inner; - } - - @Override - public String name() { - if (this.inner.backendHttpSettings() != null) { - return ResourceUtils.nameFromResourceId(this.inner.backendHttpSettings().id()); - } else { - return null; - } - } - - @Override - public ApplicationGatewayBackendHttpConfiguration backendHttpConfiguration() { - if (this.inner.backendHttpSettings() == null) { - return null; - } - - String name = ResourceUtils.nameFromResourceId(this.inner.backendHttpSettings().id()); - return this.parent().parent().backendHttpConfigurations().get(name); - } - - @Override - public ApplicationGatewayBackendHealth parent() { - return this.backendHealth; - } - - @Override - public Map serverHealths() { - return Collections.unmodifiableMap(this.serverHealths); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ApplicationGatewayBackendHttpConfigurationImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ApplicationGatewayBackendHttpConfigurationImpl.java deleted file mode 100644 index 4007b73cc265..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ApplicationGatewayBackendHttpConfigurationImpl.java +++ /dev/null @@ -1,322 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.management.SubResource; -import com.azure.resourcemanager.network.models.ApplicationGateway; -import com.azure.resourcemanager.network.models.ApplicationGatewayAuthenticationCertificate; -import com.azure.resourcemanager.network.models.ApplicationGatewayBackendHttpConfiguration; -import com.azure.resourcemanager.network.models.ApplicationGatewayBackendHttpSettings; -import com.azure.resourcemanager.network.models.ApplicationGatewayConnectionDraining; -import com.azure.resourcemanager.network.models.ApplicationGatewayCookieBasedAffinity; -import com.azure.resourcemanager.network.models.ApplicationGatewayProbe; -import com.azure.resourcemanager.network.models.ApplicationGatewayProtocol; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils; -import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.ChildResourceImpl; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; - -import java.io.File; -import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.util.ArrayList; -import java.util.Base64; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.TreeMap; - -/** Base implementation for ApplicationGatewayBackendConfiguration. */ -class ApplicationGatewayBackendHttpConfigurationImpl - extends ChildResourceImpl - implements ApplicationGatewayBackendHttpConfiguration, - ApplicationGatewayBackendHttpConfiguration.Definition, - ApplicationGatewayBackendHttpConfiguration.UpdateDefinition, - ApplicationGatewayBackendHttpConfiguration.Update { - - ApplicationGatewayBackendHttpConfigurationImpl( - ApplicationGatewayBackendHttpSettings inner, ApplicationGatewayImpl parent) { - super(inner, parent); - } - - // Getters - - @Override - public Map authenticationCertificates() { - Map certs = new TreeMap<>(); - if (this.innerModel().authenticationCertificates() == null) { - return Collections.unmodifiableMap(certs); - } else { - for (SubResource ref : this.innerModel().authenticationCertificates()) { - ApplicationGatewayAuthenticationCertificate cert = - this.parent().authenticationCertificates().get(ResourceUtils.nameFromResourceId(ref.id())); - if (cert != null) { - certs.put(cert.name(), cert); - } - } - } - return Collections.unmodifiableMap(certs); - } - - @Override - public String name() { - return this.innerModel().name(); - } - - @Override - public ApplicationGatewayProbe probe() { - if (this.parent().probes() != null && this.innerModel().probe() != null) { - return this.parent().probes().get(ResourceUtils.nameFromResourceId(this.innerModel().probe().id())); - } else { - return null; - } - } - - @Override - public String hostHeader() { - return this.innerModel().hostname(); - } - - @Override - public boolean isHostHeaderFromBackend() { - return ResourceManagerUtils.toPrimitiveBoolean(this.innerModel().pickHostnameFromBackendAddress()); - } - - @Override - public boolean isProbeEnabled() { - return ResourceManagerUtils.toPrimitiveBoolean(this.innerModel().probeEnabled()); - } - - @Override - public int connectionDrainingTimeoutInSeconds() { - if (this.innerModel().connectionDraining() == null) { - return 0; - } else if (!this.innerModel().connectionDraining().enabled()) { - return 0; - } else { - return this.innerModel().connectionDraining().drainTimeoutInSec(); - } - } - - @Override - public String affinityCookieName() { - return this.innerModel().affinityCookieName(); - } - - @Override - public String path() { - return this.innerModel().path(); - } - - @Override - public int port() { - return ResourceManagerUtils.toPrimitiveInt(this.innerModel().port()); - } - - @Override - public ApplicationGatewayProtocol protocol() { - return this.innerModel().protocol(); - } - - @Override - public boolean cookieBasedAffinity() { - return this.innerModel().cookieBasedAffinity().equals(ApplicationGatewayCookieBasedAffinity.ENABLED); - } - - @Override - public int requestTimeout() { - return ResourceManagerUtils.toPrimitiveInt(this.innerModel().requestTimeout()); - } - - // Verbs - - public ApplicationGatewayImpl attach() { - this.parent().withBackendHttpConfiguration(this); - return this.parent(); - } - - // Withers - - public ApplicationGatewayBackendHttpConfigurationImpl withPort(int port) { - this.innerModel().withPort(port); - return this; - } - - public ApplicationGatewayBackendHttpConfigurationImpl withCookieBasedAffinity() { - this.innerModel().withCookieBasedAffinity(ApplicationGatewayCookieBasedAffinity.ENABLED); - return this; - } - - public ApplicationGatewayBackendHttpConfigurationImpl withoutCookieBasedAffinity() { - this.innerModel().withCookieBasedAffinity(ApplicationGatewayCookieBasedAffinity.DISABLED); - return this; - } - - private ApplicationGatewayBackendHttpConfigurationImpl withProtocol(ApplicationGatewayProtocol protocol) { - this.innerModel().withProtocol(protocol); - return this; - } - - public ApplicationGatewayBackendHttpConfigurationImpl withRequestTimeout(int seconds) { - this.innerModel().withRequestTimeout(seconds); - return this; - } - - public ApplicationGatewayBackendHttpConfigurationImpl withProbe(String name) { - if (name == null) { - return this.withoutProbe(); - } else { - SubResource probeRef = new SubResource().withId(this.parent().futureResourceId() + "/probes/" + name); - this.innerModel().withProbe(probeRef); - return this; - } - } - - public ApplicationGatewayBackendHttpConfigurationImpl withoutProbe() { - this.innerModel().withProbe(null); - return this; - } - - public ApplicationGatewayBackendHttpConfigurationImpl withHostHeaderFromBackend() { - this.innerModel().withPickHostnameFromBackendAddress(true).withHostname(null); - return this; - } - - public ApplicationGatewayBackendHttpConfigurationImpl withHostHeader(String hostHeader) { - this.innerModel().withHostname(hostHeader).withPickHostnameFromBackendAddress(false); - return this; - } - - public ApplicationGatewayBackendHttpConfigurationImpl withoutHostHeader() { - this.innerModel().withHostname(null).withPickHostnameFromBackendAddress(false); - return this; - } - - public ApplicationGatewayBackendHttpConfigurationImpl withConnectionDrainingTimeoutInSeconds(int seconds) { - if (this.innerModel().connectionDraining() == null) { - this.innerModel().withConnectionDraining(new ApplicationGatewayConnectionDraining()); - } - if (seconds > 0) { - this.innerModel().connectionDraining().withDrainTimeoutInSec(seconds).withEnabled(true); - } - return this; - } - - public ApplicationGatewayBackendHttpConfigurationImpl withoutConnectionDraining() { - this.innerModel().withConnectionDraining(null); - return this; - } - - public ApplicationGatewayBackendHttpConfigurationImpl withAffinityCookieName(String name) { - this.innerModel().withAffinityCookieName(name); - return this; - } - - public ApplicationGatewayBackendHttpConfigurationImpl withPath(String path) { - if (path != null) { - if (!path.startsWith("/")) { - path = "/" + path; - } - if (!path.endsWith("/")) { - path += "/"; - } - } - this.innerModel().withPath(path); - return this; - } - - @Override - public ApplicationGatewayBackendHttpConfigurationImpl withAuthenticationCertificate(String name) { - if (name == null) { - return this; - } - SubResource certRef = - new SubResource().withId(this.parent().futureResourceId() + "/authenticationCertificates/" + name); - List refs = this.innerModel().authenticationCertificates(); - if (refs == null) { - refs = new ArrayList<>(); - this.innerModel().withAuthenticationCertificates(refs); - } - for (SubResource ref : refs) { - if (ref.id().equalsIgnoreCase(certRef.id())) { - return this; - } - } - refs.add(certRef); - return this.withHttps(); - } - - @Override - public ApplicationGatewayBackendHttpConfigurationImpl withAuthenticationCertificateFromBytes(byte[] derData) { - if (derData == null) { - return this; - } - - String encoded = new String(Base64.getEncoder().encode(derData), StandardCharsets.UTF_8); - return this.withAuthenticationCertificateFromBase64(encoded); - } - - @Override - public ApplicationGatewayBackendHttpConfigurationImpl withAuthenticationCertificateFromBase64(String base64Data) { - if (base64Data == null) { - return this; - } - - String certName = null; - for (ApplicationGatewayAuthenticationCertificate cert : this.parent().authenticationCertificates().values()) { - if (cert.data().contentEquals(base64Data)) { - certName = cert.name(); - break; - } - } - - // If matching cert reference not found, create a new one - if (certName == null) { - certName = this.parent().manager().resourceManager().internalContext().randomResourceName("cert", 20); - this.parent().defineAuthenticationCertificate(certName).fromBase64(base64Data).attach(); - } - - return this.withAuthenticationCertificate(certName).withHttps(); - } - - @Override - public ApplicationGatewayBackendHttpConfigurationImpl withAuthenticationCertificateFromFile(File certificateFile) - throws IOException { - if (certificateFile == null) { - return this; - } else { - byte[] content = Files.readAllBytes(certificateFile.toPath()); - return this.withAuthenticationCertificateFromBytes(content); - } - } - - @Override - public ApplicationGatewayBackendHttpConfigurationImpl withoutAuthenticationCertificate(String name) { - if (name == null) { - return this; - } - for (SubResource ref : this.innerModel().authenticationCertificates()) { - if (ResourceUtils.nameFromResourceId(ref.id()).equalsIgnoreCase(name)) { - this.innerModel().authenticationCertificates().remove(ref); - break; - } - } - return this; - } - - @Override - public ApplicationGatewayBackendHttpConfigurationImpl withHttps() { - return this.withProtocol(ApplicationGatewayProtocol.HTTPS); - } - - @Override - public ApplicationGatewayBackendHttpConfigurationImpl withHttp() { - return this.withoutAuthenticationCertificates().withProtocol(ApplicationGatewayProtocol.HTTP); - } - - @Override - public ApplicationGatewayBackendHttpConfigurationImpl withoutAuthenticationCertificates() { - this.innerModel().withAuthenticationCertificates(null); - return this; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ApplicationGatewayBackendImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ApplicationGatewayBackendImpl.java deleted file mode 100644 index cf95812d4844..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ApplicationGatewayBackendImpl.java +++ /dev/null @@ -1,178 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.resourcemanager.network.models.ApplicationGateway; -import com.azure.resourcemanager.network.models.ApplicationGatewayBackend; -import com.azure.resourcemanager.network.models.ApplicationGatewayBackendAddress; -import com.azure.resourcemanager.network.models.ApplicationGatewayBackendAddressPool; -import com.azure.resourcemanager.network.fluent.models.NetworkInterfaceIpConfigurationInner; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils; -import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.ChildResourceImpl; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.TreeMap; - -/** Implementation for ApplicationGatewayBackend. */ -class ApplicationGatewayBackendImpl - extends ChildResourceImpl - implements ApplicationGatewayBackend, - ApplicationGatewayBackend.Definition, - ApplicationGatewayBackend.UpdateDefinition, - ApplicationGatewayBackend.Update { - - ApplicationGatewayBackendImpl(ApplicationGatewayBackendAddressPool inner, ApplicationGatewayImpl parent) { - super(inner, parent); - } - - // Helpers - - private List ensureAddresses() { - List addresses = this.innerModel().backendAddresses(); - if (addresses == null) { - addresses = new ArrayList(); - this.innerModel().withBackendAddresses(addresses); - } - return addresses; - } - - // Getters - - @Override - public String name() { - return this.innerModel().name(); - } - - @Override - public Map backendNicIPConfigurationNames() { - // This assumes a NIC can only have one IP config associated with the backend of an app gateway, - // which is correct at the time of this implementation and seems unlikely to ever change - final Map ipConfigNames = new TreeMap<>(); - if (this.innerModel().backendIpConfigurations() != null) { - for (NetworkInterfaceIpConfigurationInner inner : this.innerModel().backendIpConfigurations()) { - String nicId = ResourceUtils.parentResourceIdFromResourceId(inner.id()); - String ipConfigName = ResourceUtils.nameFromResourceId(inner.id()); - ipConfigNames.put(nicId, ipConfigName); - } - } - - return Collections.unmodifiableMap(ipConfigNames); - } - - @Override - public Collection addresses() { - Collection addresses = new ArrayList<>(); - if (this.innerModel().backendAddresses() != null) { - for (ApplicationGatewayBackendAddress address : this.innerModel().backendAddresses()) { - addresses.add(address); - } - } - return Collections.unmodifiableCollection(addresses); - } - - // Verbs - - @Override - public ApplicationGatewayImpl attach() { - this.parent().withBackend(this); - return this.parent(); - } - - // Withers - - @Override - public ApplicationGatewayBackendImpl withIPAddress(String ipAddress) { - if (ipAddress == null) { - return this; - } - - ApplicationGatewayBackendAddress address = new ApplicationGatewayBackendAddress().withIpAddress(ipAddress); - List addresses = ensureAddresses(); - for (ApplicationGatewayBackendAddress a : addresses) { - if (ipAddress.equalsIgnoreCase(a.ipAddress())) { - return this; // Address already included, so skip - } - } - addresses.add(address); - return this; - } - - @Override - public ApplicationGatewayBackendImpl withFqdn(String fqdn) { - if (fqdn == null) { - return this; - } - ApplicationGatewayBackendAddress address = new ApplicationGatewayBackendAddress().withFqdn(fqdn); - ensureAddresses().add(address); - return this; - } - - @Override - public ApplicationGatewayBackendImpl withoutIPAddress(String ipAddress) { - if (ipAddress == null) { - return this; - } - if (this.innerModel().backendAddresses() == null) { - return this; - } - - final List addresses = ensureAddresses(); - for (int i = 0; i < addresses.size(); i++) { - String curIPAddress = addresses.get(i).ipAddress(); - if (curIPAddress != null && curIPAddress.equalsIgnoreCase(ipAddress)) { - addresses.remove(i); - break; - } - } - return this; - } - - @Override - public ApplicationGatewayBackendImpl withoutAddress(ApplicationGatewayBackendAddress address) { - ensureAddresses().remove(address); - return this; - } - - @Override - public ApplicationGatewayBackendImpl withoutFqdn(String fqdn) { - if (fqdn == null) { - return this; - } - final List addresses = ensureAddresses(); - for (int i = 0; i < addresses.size(); i++) { - String curFqdn = addresses.get(i).fqdn(); - if (curFqdn != null && curFqdn.equalsIgnoreCase(fqdn)) { - addresses.remove(i); - break; - } - } - return this; - } - - @Override - public boolean containsIPAddress(String ipAddress) { - if (ipAddress != null) { - for (ApplicationGatewayBackendAddress address : this.innerModel().backendAddresses()) { - if (ipAddress.equalsIgnoreCase(address.ipAddress())) { - return true; - } - } - } - return false; - } - - @Override - public boolean containsFqdn(String fqdn) { - if (fqdn != null) { - for (ApplicationGatewayBackendAddress address : this.innerModel().backendAddresses()) { - if (fqdn.equalsIgnoreCase(address.fqdn())) { - return true; - } - } - } - return false; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ApplicationGatewayBackendServerHealthImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ApplicationGatewayBackendServerHealthImpl.java deleted file mode 100644 index 5f95f05fa70a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ApplicationGatewayBackendServerHealthImpl.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.resourcemanager.network.models.ApplicationGatewayBackendHealthStatus; -import com.azure.resourcemanager.network.models.ApplicationGatewayBackendHttpConfigurationHealth; -import com.azure.resourcemanager.network.models.ApplicationGatewayBackendServerHealth; -import com.azure.resourcemanager.network.models.NetworkInterface; -import com.azure.resourcemanager.network.models.NicIpConfiguration; -import com.azure.resourcemanager.network.fluent.models.ApplicationGatewayBackendHealthServerInner; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils; - -/** Implementation of application gateway backend server health information. */ -public class ApplicationGatewayBackendServerHealthImpl implements ApplicationGatewayBackendServerHealth { - - private final ApplicationGatewayBackendHealthServerInner inner; - private final ApplicationGatewayBackendHttpConfigurationHealthImpl httpConfigHealth; - - ApplicationGatewayBackendServerHealthImpl( - ApplicationGatewayBackendHealthServerInner inner, - ApplicationGatewayBackendHttpConfigurationHealthImpl httpConfigHealth) { - this.inner = inner; - this.httpConfigHealth = httpConfigHealth; - } - - @Override - public ApplicationGatewayBackendHealthServerInner innerModel() { - return this.inner; - } - - @Override - public ApplicationGatewayBackendHttpConfigurationHealth parent() { - return this.httpConfigHealth; - } - - @Override - public String ipAddress() { - return this.innerModel().address(); - } - - @Override - public NicIpConfiguration getNetworkInterfaceIPConfiguration() { - if (this.innerModel().ipConfiguration() == null) { - return null; - } - String nicIPConfigId = this.innerModel().ipConfiguration().id(); - if (nicIPConfigId == null) { - return null; - } - - String nicIPConfigName = ResourceUtils.nameFromResourceId(nicIPConfigId); - String nicId = ResourceUtils.parentResourceIdFromResourceId(nicIPConfigId); - NetworkInterface nic = this.parent().parent().parent().manager().networkInterfaces().getById(nicId); - if (nic == null) { - return null; - } else { - return nic.ipConfigurations().get(nicIPConfigName); - } - } - - @Override - public ApplicationGatewayBackendHealthStatus status() { - return ApplicationGatewayBackendHealthStatus.fromString(this.inner.health().toString()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ApplicationGatewayFrontendImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ApplicationGatewayFrontendImpl.java deleted file mode 100644 index 84050801eb4d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ApplicationGatewayFrontendImpl.java +++ /dev/null @@ -1,160 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.management.SubResource; -import com.azure.resourcemanager.network.models.ApplicationGateway; -import com.azure.resourcemanager.network.models.ApplicationGatewayFrontend; -import com.azure.resourcemanager.network.models.ApplicationGatewayFrontendIpConfiguration; -import com.azure.resourcemanager.network.models.IpAllocationMethod; -import com.azure.resourcemanager.network.models.Network; -import com.azure.resourcemanager.network.models.PublicIpAddress; -import com.azure.resourcemanager.network.models.Subnet; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils; -import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.ChildResourceImpl; -import reactor.core.publisher.Mono; - -/** Implementation for ApplicationGatewayFrontend. */ -class ApplicationGatewayFrontendImpl - extends ChildResourceImpl - implements ApplicationGatewayFrontend, - ApplicationGatewayFrontend.Definition, - ApplicationGatewayFrontend.UpdateDefinition, - ApplicationGatewayFrontend.Update { - - ApplicationGatewayFrontendImpl(ApplicationGatewayFrontendIpConfiguration inner, ApplicationGatewayImpl parent) { - super(inner, parent); - } - - // Getters - - @Override - public String networkId() { - SubResource subnetRef = this.innerModel().subnet(); - if (subnetRef != null) { - return ResourceUtils.parentResourceIdFromResourceId(subnetRef.id()); - } else { - return null; - } - } - - @Override - public String subnetName() { - SubResource subnetRef = this.innerModel().subnet(); - if (subnetRef != null) { - return ResourceUtils.nameFromResourceId(subnetRef.id()); - } else { - return null; - } - } - - @Override - public String privateIpAddress() { - return this.innerModel().privateIpAddress(); - } - - @Override - public IpAllocationMethod privateIpAllocationMethod() { - return this.innerModel().privateIpAllocationMethod(); - } - - @Override - public String name() { - return this.innerModel().name(); - } - - @Override - public String publicIpAddressId() { - if (this.innerModel().publicIpAddress() != null) { - return this.innerModel().publicIpAddress().id(); - } else { - return null; - } - } - - @Override - public boolean isPublic() { - return (this.innerModel().publicIpAddress() != null); - } - - @Override - public boolean isPrivate() { - return (this.innerModel().subnet() != null); - } - - // Fluent setters - - @Override - public ApplicationGatewayFrontendImpl withExistingSubnet(Network network, String subnetName) { - return this.withExistingSubnet(network.id(), subnetName); - } - - @Override - public ApplicationGatewayFrontendImpl withExistingSubnet(String parentNetworkResourceId, String subnetName) { - SubResource subnetRef = new SubResource().withId(parentNetworkResourceId + "/subnets/" + subnetName); - this.innerModel().withSubnet(subnetRef); - - // Ensure this frontend is not public - this.withoutPublicIpAddress(); - return this; - } - - @Override - public ApplicationGatewayFrontendImpl withExistingPublicIpAddress(PublicIpAddress pip) { - return this.withExistingPublicIpAddress(pip.id()); - } - - @Override - public ApplicationGatewayFrontendImpl withExistingPublicIpAddress(String resourceId) { - SubResource pipRef = new SubResource().withId(resourceId); - this.innerModel().withPublicIpAddress(pipRef); - this.withoutSubnet(); // Ensure no conflicting public and private settings - return this; - } - - @Override - public ApplicationGatewayFrontendImpl withoutPublicIpAddress() { - this.innerModel().withPublicIpAddress(null); - return this; - } - - public ApplicationGatewayFrontendImpl withoutSubnet() { - this.innerModel().withSubnet(null).withPrivateIpAddress(null).withPrivateIpAllocationMethod(null); - return this; - } - - @Override - public ApplicationGatewayFrontendImpl withPrivateIpAddressDynamic() { - this.innerModel().withPrivateIpAddress(null).withPrivateIpAllocationMethod(IpAllocationMethod.DYNAMIC); - return this; - } - - @Override - public ApplicationGatewayFrontendImpl withPrivateIpAddressStatic(String ipAddress) { - this.innerModel().withPrivateIpAddress(ipAddress).withPrivateIpAllocationMethod(IpAllocationMethod.STATIC); - return this; - } - - // Verbs - - @Override - public Subnet getSubnet() { - return Utils.getAssociatedSubnet(this.parent().manager(), this.innerModel().subnet()); - } - - @Override - public ApplicationGatewayImpl attach() { - return this.parent().withFrontend(this); - } - - @Override - public PublicIpAddress getPublicIpAddress() { - return this.getPublicIpAddressAsync().block(); - } - - @Override - public Mono getPublicIpAddressAsync() { - String pipId = this.publicIpAddressId(); - return pipId == null ? Mono.empty() : this.parent().manager().publicIpAddresses().getByIdAsync(pipId); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ApplicationGatewayImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ApplicationGatewayImpl.java deleted file mode 100644 index 390a66ac3b4f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ApplicationGatewayImpl.java +++ /dev/null @@ -1,1698 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.management.SubResource; -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.network.fluent.ApplicationGatewaysClient; -import com.azure.resourcemanager.network.fluent.models.ApplicationGatewayAuthenticationCertificateInner; -import com.azure.resourcemanager.network.fluent.models.ApplicationGatewayInner; -import com.azure.resourcemanager.network.fluent.models.ApplicationGatewayIpConfigurationInner; -import com.azure.resourcemanager.network.fluent.models.ApplicationGatewayProbeInner; -import com.azure.resourcemanager.network.fluent.models.ApplicationGatewayRedirectConfigurationInner; -import com.azure.resourcemanager.network.fluent.models.ApplicationGatewayRequestRoutingRuleInner; -import com.azure.resourcemanager.network.fluent.models.ApplicationGatewaySslCertificateInner; -import com.azure.resourcemanager.network.fluent.models.ApplicationGatewayUrlPathMapInner; -import com.azure.resourcemanager.network.models.ApplicationGateway; -import com.azure.resourcemanager.network.models.ApplicationGatewayAuthenticationCertificate; -import com.azure.resourcemanager.network.models.ApplicationGatewayAutoscaleConfiguration; -import com.azure.resourcemanager.network.models.ApplicationGatewayBackend; -import com.azure.resourcemanager.network.models.ApplicationGatewayBackendAddressPool; -import com.azure.resourcemanager.network.models.ApplicationGatewayBackendHealth; -import com.azure.resourcemanager.network.models.ApplicationGatewayBackendHealthPool; -import com.azure.resourcemanager.network.models.ApplicationGatewayBackendHttpConfiguration; -import com.azure.resourcemanager.network.models.ApplicationGatewayBackendHttpSettings; -import com.azure.resourcemanager.network.models.ApplicationGatewayFirewallMode; -import com.azure.resourcemanager.network.models.ApplicationGatewayFrontend; -import com.azure.resourcemanager.network.models.ApplicationGatewayFrontendIpConfiguration; -import com.azure.resourcemanager.network.models.ApplicationGatewayFrontendPort; -import com.azure.resourcemanager.network.models.ApplicationGatewayHttpListener; -import com.azure.resourcemanager.network.models.ApplicationGatewayIpConfiguration; -import com.azure.resourcemanager.network.models.ApplicationGatewayListener; -import com.azure.resourcemanager.network.models.ApplicationGatewayOperationalState; -import com.azure.resourcemanager.network.models.ApplicationGatewayProbe; -import com.azure.resourcemanager.network.models.ApplicationGatewayRedirectConfiguration; -import com.azure.resourcemanager.network.models.ApplicationGatewayRequestRoutingRule; -import com.azure.resourcemanager.network.models.ApplicationGatewayRequestRoutingRuleType; -import com.azure.resourcemanager.network.models.ApplicationGatewaySku; -import com.azure.resourcemanager.network.models.ApplicationGatewaySkuName; -import com.azure.resourcemanager.network.models.ApplicationGatewaySslCertificate; -import com.azure.resourcemanager.network.models.ApplicationGatewaySslPolicy; -import com.azure.resourcemanager.network.models.ApplicationGatewaySslProtocol; -import com.azure.resourcemanager.network.models.ApplicationGatewayTier; -import com.azure.resourcemanager.network.models.ApplicationGatewayUrlPathMap; -import com.azure.resourcemanager.network.models.ApplicationGatewayWebApplicationFirewallConfiguration; -import com.azure.resourcemanager.network.models.IpAllocationMethod; -import com.azure.resourcemanager.network.models.ManagedServiceIdentity; -import com.azure.resourcemanager.network.models.Network; -import com.azure.resourcemanager.network.models.PublicIpAddress; -import com.azure.resourcemanager.network.models.Subnet; -import com.azure.resourcemanager.network.models.TagsObject; -import com.azure.resourcemanager.resources.fluentcore.arm.AvailabilityZoneId; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils; -import com.azure.resourcemanager.resources.fluentcore.arm.models.Resource; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -import java.lang.reflect.InvocationTargetException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; -import java.util.TreeMap; -import java.util.TreeSet; - -/** Implementation of the ApplicationGateway interface. */ -class ApplicationGatewayImpl - extends GroupableParentResourceWithTagsImpl< - ApplicationGateway, ApplicationGatewayInner, ApplicationGatewayImpl, NetworkManager> - implements ApplicationGateway, ApplicationGateway.Definition, ApplicationGateway.Update { - - private Map ipConfigs; - private Map frontends; - private Map probes; - private Map backends; - private Map backendConfigs; - private Map listeners; - private Map rules; - private Map sslCerts; - private Map authCertificates; - private Map redirectConfigs; - private Map urlPathMaps; - - private static final String DEFAULT = "default"; - private ApplicationGatewayFrontendImpl defaultPrivateFrontend; - private ApplicationGatewayFrontendImpl defaultPublicFrontend; - - private Map creatablePipsByFrontend; - - ApplicationGatewayImpl(String name, final ApplicationGatewayInner innerModel, final NetworkManager networkManager) { - super(name, innerModel, networkManager); - } - - // Verbs - - @Override - public Mono refreshAsync() { - return super - .refreshAsync() - .map( - applicationGateway -> { - ApplicationGatewayImpl impl = (ApplicationGatewayImpl) applicationGateway; - impl.initializeChildrenFromInner(); - return impl; - }); - } - - @Override - protected Mono getInnerAsync() { - return this - .manager() - .serviceClient() - .getApplicationGateways() - .getByResourceGroupAsync(this.resourceGroupName(), this.name()); - } - - @Override - protected Mono applyTagsToInnerAsync() { - return this - .manager() - .serviceClient() - .getApplicationGateways() - .updateTagsAsync(resourceGroupName(), name(), new TagsObject().withTags(innerModel().tags())); - } - - // Helpers - - @Override - protected void initializeChildrenFromInner() { - initializeConfigsFromInner(); - initializeFrontendsFromInner(); - initializeProbesFromInner(); - initializeBackendsFromInner(); - initializeBackendHttpConfigsFromInner(); - initializeHttpListenersFromInner(); - initializeRedirectConfigurationsFromInner(); - initializeRequestRoutingRulesFromInner(); - initializeSslCertificatesFromInner(); - initializeAuthCertificatesFromInner(); - initializeUrlPathMapsFromInner(); - this.defaultPrivateFrontend = null; - this.defaultPublicFrontend = null; - this.creatablePipsByFrontend = new HashMap<>(); - } - - private void initializeAuthCertificatesFromInner() { - this.authCertificates = new TreeMap<>(); - List inners = this.innerModel().authenticationCertificates(); - if (inners != null) { - for (ApplicationGatewayAuthenticationCertificateInner inner : inners) { - ApplicationGatewayAuthenticationCertificateImpl cert = - new ApplicationGatewayAuthenticationCertificateImpl(inner, this); - this.authCertificates.put(inner.name(), cert); - } - } - } - - private void initializeSslCertificatesFromInner() { - this.sslCerts = new TreeMap<>(); - List inners = this.innerModel().sslCertificates(); - if (inners != null) { - for (ApplicationGatewaySslCertificateInner inner : inners) { - ApplicationGatewaySslCertificateImpl cert = new ApplicationGatewaySslCertificateImpl(inner, this); - this.sslCerts.put(inner.name(), cert); - } - } - } - - private void initializeFrontendsFromInner() { - this.frontends = new TreeMap<>(); - List inners = this.innerModel().frontendIpConfigurations(); - if (inners != null) { - for (ApplicationGatewayFrontendIpConfiguration inner : inners) { - ApplicationGatewayFrontendImpl frontend = new ApplicationGatewayFrontendImpl(inner, this); - this.frontends.put(inner.name(), frontend); - } - } - } - - private void initializeProbesFromInner() { - this.probes = new TreeMap<>(); - List inners = this.innerModel().probes(); - if (inners != null) { - for (ApplicationGatewayProbeInner inner : inners) { - ApplicationGatewayProbeImpl probe = new ApplicationGatewayProbeImpl(inner, this); - this.probes.put(inner.name(), probe); - } - } - } - - private void initializeBackendsFromInner() { - this.backends = new TreeMap<>(); - List inners = this.innerModel().backendAddressPools(); - if (inners != null) { - for (ApplicationGatewayBackendAddressPool inner : inners) { - ApplicationGatewayBackendImpl backend = new ApplicationGatewayBackendImpl(inner, this); - this.backends.put(inner.name(), backend); - } - } - } - - private void initializeBackendHttpConfigsFromInner() { - this.backendConfigs = new TreeMap<>(); - List inners = this.innerModel().backendHttpSettingsCollection(); - if (inners != null) { - for (ApplicationGatewayBackendHttpSettings inner : inners) { - ApplicationGatewayBackendHttpConfigurationImpl httpConfig = - new ApplicationGatewayBackendHttpConfigurationImpl(inner, this); - this.backendConfigs.put(inner.name(), httpConfig); - } - } - } - - private void initializeHttpListenersFromInner() { - this.listeners = new TreeMap<>(); - List inners = this.innerModel().httpListeners(); - if (inners != null) { - for (ApplicationGatewayHttpListener inner : inners) { - ApplicationGatewayListenerImpl httpListener = new ApplicationGatewayListenerImpl(inner, this); - this.listeners.put(inner.name(), httpListener); - } - } - } - - private void initializeRedirectConfigurationsFromInner() { - this.redirectConfigs = new TreeMap<>(); - List inners = this.innerModel().redirectConfigurations(); - if (inners != null) { - for (ApplicationGatewayRedirectConfigurationInner inner : inners) { - ApplicationGatewayRedirectConfigurationImpl redirectConfig = - new ApplicationGatewayRedirectConfigurationImpl(inner, this); - this.redirectConfigs.put(inner.name(), redirectConfig); - } - } - } - - private void initializeUrlPathMapsFromInner() { - this.urlPathMaps = new TreeMap<>(); - List inners = this.innerModel().urlPathMaps(); - if (inners != null) { - for (ApplicationGatewayUrlPathMapInner inner : inners) { - ApplicationGatewayUrlPathMapImpl wrapper = new ApplicationGatewayUrlPathMapImpl(inner, this); - this.urlPathMaps.put(inner.name(), wrapper); - } - } - } - - private void initializeRequestRoutingRulesFromInner() { - this.rules = new TreeMap<>(); - List inners = this.innerModel().requestRoutingRules(); - if (inners != null) { - for (ApplicationGatewayRequestRoutingRuleInner inner : inners) { - ApplicationGatewayRequestRoutingRuleImpl rule = - new ApplicationGatewayRequestRoutingRuleImpl(inner, this); - this.rules.put(inner.name(), rule); - } - } - } - - private void initializeConfigsFromInner() { - this.ipConfigs = new TreeMap<>(); - List inners = this.innerModel().gatewayIpConfigurations(); - if (inners != null) { - for (ApplicationGatewayIpConfigurationInner inner : inners) { - ApplicationGatewayIpConfigurationImpl config = new ApplicationGatewayIpConfigurationImpl(inner, this); - this.ipConfigs.put(inner.name(), config); - } - } - } - - @Override - protected void beforeCreating() { - // Process created PIPs - for (Entry frontendPipPair : this.creatablePipsByFrontend.entrySet()) { - Resource createdPip = this.taskResult(frontendPipPair.getValue()); - this.updateFrontend(frontendPipPair.getKey()).withExistingPublicIpAddress(createdPip.id()); - } - this.creatablePipsByFrontend.clear(); - - // Reset and update IP configs - ensureDefaultIPConfig(); - this.innerModel().withGatewayIpConfigurations(innersFromWrappers(this.ipConfigs.values())); - - // Reset and update frontends - this.innerModel().withFrontendIpConfigurations(innersFromWrappers(this.frontends.values())); - - // Reset and update probes - this.innerModel().withProbes(innersFromWrappers(this.probes.values())); - - // Reset and update auth certs - this.innerModel().withAuthenticationCertificates(innersFromWrappers(this.authCertificates.values())); - - // Reset and update backends - this.innerModel().withBackendAddressPools(innersFromWrappers(this.backends.values())); - - // Reset and update SSL certs - this.innerModel().withSslCertificates(innersFromWrappers(this.sslCerts.values())); - - // Reset and update URL path maps - this.innerModel().withUrlPathMaps(innersFromWrappers(this.urlPathMaps.values())); - - // Reset and update backend HTTP settings configs - this.innerModel().withBackendHttpSettingsCollection(innersFromWrappers(this.backendConfigs.values())); - for (ApplicationGatewayBackendHttpConfiguration config : this.backendConfigs.values()) { - SubResource ref; - - // Clear deleted probe references - ref = config.innerModel().probe(); - if (ref != null && !this.probes().containsKey(ResourceUtils.nameFromResourceId(ref.id()))) { - config.innerModel().withProbe(null); - } - - // Clear deleted auth cert references - List certRefs = config.innerModel().authenticationCertificates(); - if (certRefs != null) { - // Make a copy of the cert refs, because we will be deleting in place - certRefs = new ArrayList<>(certRefs); - for (SubResource certRef : certRefs) { - if (certRef != null - && !this.authCertificates.containsKey(ResourceUtils.nameFromResourceId(certRef.id()))) { - config.innerModel().authenticationCertificates().remove(certRef); - } - } - } - } - - // Reset and update redirect configurations - this.innerModel().withRedirectConfigurations(innersFromWrappers(this.redirectConfigs.values())); - for (ApplicationGatewayRedirectConfiguration redirect : this.redirectConfigs.values()) { - SubResource ref; - - // Clear deleted listener references - ref = redirect.innerModel().targetListener(); - if (ref != null && !this.listeners.containsKey(ResourceUtils.nameFromResourceId(ref.id()))) { - redirect.innerModel().withTargetListener(null); - } - } - - // Reset and update HTTP listeners - this.innerModel().withHttpListeners(innersFromWrappers(this.listeners.values())); - for (ApplicationGatewayListener listener : this.listeners.values()) { - SubResource ref; - - // Clear deleted frontend references - ref = listener.innerModel().frontendIpConfiguration(); - if (ref != null && !this.frontends().containsKey(ResourceUtils.nameFromResourceId(ref.id()))) { - listener.innerModel().withFrontendIpConfiguration(null); - } - - // Clear deleted frontend port references - ref = listener.innerModel().frontendPort(); - if (ref != null && !this.frontendPorts().containsKey(ResourceUtils.nameFromResourceId(ref.id()))) { - listener.innerModel().withFrontendPort(null); - } - - // Clear deleted SSL certificate references - ref = listener.innerModel().sslCertificate(); - if (ref != null && !this.sslCertificates().containsKey(ResourceUtils.nameFromResourceId(ref.id()))) { - listener.innerModel().withSslCertificate(null); - } - } - - // Reset and update request routing rules - this.innerModel().withRequestRoutingRules(innersFromWrappers(this.rules.values())); - for (ApplicationGatewayRequestRoutingRule rule : this.rules.values()) { - SubResource ref; - - // Clear deleted redirect configs - ref = rule.innerModel().redirectConfiguration(); - if (ref != null && !this.redirectConfigs.containsKey(ResourceUtils.nameFromResourceId(ref.id()))) { - rule.innerModel().withRedirectConfiguration(null); - } - - // Clear deleted backends - ref = rule.innerModel().backendAddressPool(); - if (ref != null && !this.backends().containsKey(ResourceUtils.nameFromResourceId(ref.id()))) { - rule.innerModel().withBackendAddressPool(null); - } - - // Clear deleted backend HTTP configs - ref = rule.innerModel().backendHttpSettings(); - if (ref != null && !this.backendConfigs.containsKey(ResourceUtils.nameFromResourceId(ref.id()))) { - rule.innerModel().withBackendHttpSettings(null); - } - - // Clear deleted frontend HTTP listeners - ref = rule.innerModel().httpListener(); - if (ref != null && !this.listeners().containsKey(ResourceUtils.nameFromResourceId(ref.id()))) { - rule.innerModel().withHttpListener(null); - } - } - } - - protected SubResource ensureBackendRef(String name) { - // Ensure existence of backend, creating one if needed - ApplicationGatewayBackendImpl backend; - if (name == null) { - backend = this.ensureUniqueBackend(); - } else { - backend = this.defineBackend(name); - backend.attach(); - } - - // Return backend reference - return new SubResource().withId(this.futureResourceId() + "/backendAddressPools/" + backend.name()); - } - - protected ApplicationGatewayBackendImpl ensureUniqueBackend() { - String name = this.manager().resourceManager().internalContext() - .randomResourceName("backend", 20); - ApplicationGatewayBackendImpl backend = this.defineBackend(name); - backend.attach(); - return backend; - } - - private ApplicationGatewayIpConfigurationImpl ensureDefaultIPConfig() { - ApplicationGatewayIpConfigurationImpl ipConfig = - (ApplicationGatewayIpConfigurationImpl) defaultIPConfiguration(); - if (ipConfig == null) { - String name = this.manager().resourceManager().internalContext().randomResourceName("ipcfg", 11); - ipConfig = this.defineIPConfiguration(name); - ipConfig.attach(); - } - return ipConfig; - } - - protected ApplicationGatewayFrontendImpl ensureDefaultPrivateFrontend() { - ApplicationGatewayFrontendImpl frontend = (ApplicationGatewayFrontendImpl) defaultPrivateFrontend(); - if (frontend != null) { - return frontend; - } else { - String name = this.manager().resourceManager().internalContext().randomResourceName("frontend", 14); - frontend = this.defineFrontend(name); - frontend.attach(); - this.defaultPrivateFrontend = frontend; - return frontend; - } - } - - protected ApplicationGatewayFrontendImpl ensureDefaultPublicFrontend() { - ApplicationGatewayFrontendImpl frontend = (ApplicationGatewayFrontendImpl) defaultPublicFrontend(); - if (frontend != null) { - return frontend; - } else { - String name = this.manager().resourceManager().internalContext().randomResourceName("frontend", 14); - frontend = this.defineFrontend(name); - frontend.attach(); - this.defaultPublicFrontend = frontend; - return frontend; - } - } - - private Creatable creatableNetwork = null; - - private Creatable ensureDefaultNetworkDefinition() { - if (this.creatableNetwork == null) { - final String vnetName = this.manager().resourceManager().internalContext().randomResourceName("vnet", 10); - this.creatableNetwork = - this - .manager() - .networks() - .define(vnetName) - .withRegion(this.region()) - .withExistingResourceGroup(this.resourceGroupName()) - .withAddressSpace("10.0.0.0/24") - .withSubnet(DEFAULT, "10.0.0.0/25") - .withSubnet("apps", "10.0.0.128/25"); - } - - return this.creatableNetwork; - } - - private Creatable creatablePip = null; - - private Creatable ensureDefaultPipDefinition() { - if (this.creatablePip == null) { - final String pipName = this.manager().resourceManager().internalContext().randomResourceName("pip", 9); - this.creatablePip = - this - .manager() - .publicIpAddresses() - .define(pipName) - .withRegion(this.regionName()) - .withExistingResourceGroup(this.resourceGroupName()); - } - - return this.creatablePip; - } - - private static ApplicationGatewayFrontendImpl useSubnetFromIPConfigForFrontend( - ApplicationGatewayIpConfigurationImpl ipConfig, ApplicationGatewayFrontendImpl frontend) { - if (frontend != null) { - frontend.withExistingSubnet(ipConfig.networkId(), ipConfig.subnetName()); - if (frontend.privateIpAddress() == null) { - frontend.withPrivateIpAddressDynamic(); - } else if (frontend.privateIpAllocationMethod() == null) { - frontend.withPrivateIpAddressDynamic(); - } - } - return frontend; - } - - @Override - protected Mono createInner() { - // Determine if a default public frontend PIP should be created - final ApplicationGatewayFrontendImpl defaultPublicFrontend = - (ApplicationGatewayFrontendImpl) defaultPublicFrontend(); - final Mono pipObservable; - if (defaultPublicFrontend != null && defaultPublicFrontend.publicIpAddressId() == null) { - // If public frontend requested but no PIP specified, then create a default PIP - pipObservable = - ensureDefaultPipDefinition() - .createAsync() - .map( - publicIPAddress -> { - defaultPublicFrontend.withExistingPublicIpAddress(publicIPAddress); - return publicIPAddress; - }); - } else { - // If no public frontend requested, skip creating the PIP - pipObservable = Mono.empty(); - } - - // Determine if default VNet should be created - final ApplicationGatewayIpConfigurationImpl defaultIPConfig = ensureDefaultIPConfig(); - final ApplicationGatewayFrontendImpl defaultPrivateFrontend = - (ApplicationGatewayFrontendImpl) defaultPrivateFrontend(); - final Mono networkObservable; - if (defaultIPConfig.subnetName() != null) { - // If default IP config already has a subnet assigned to it... - if (defaultPrivateFrontend != null) { - // ...and a private frontend is requested, then use the same vnet for the private frontend - useSubnetFromIPConfigForFrontend(defaultIPConfig, defaultPrivateFrontend); - } - // ...and no need to create a default VNet - networkObservable = Mono.empty(); // ...and don't create another VNet - } else { - // But if default IP config does not have a subnet specified, then create a default VNet - networkObservable = - ensureDefaultNetworkDefinition() - .createAsync() - .map( - network -> { - // ... and assign the created VNet to the default IP config - defaultIPConfig.withExistingSubnet(network, DEFAULT); - if (defaultPrivateFrontend != null) { - // If a private frontend is also requested, then use the same VNet for the private - // frontend as for the IP config - /* TODO: Not sure if the assumption of the same subnet for the frontend and - * the IP config will hold in - * the future, but the existing ARM template for App Gateway for some reason uses - * the same subnet for the - * IP config and the private frontend. Also, trying to use different subnets results - * in server error today saying they - * have to be the same. This may need to be revisited in the future however, - * as this is somewhat inconsistent - * with what the documentation says. - */ - useSubnetFromIPConfigForFrontend(defaultIPConfig, defaultPrivateFrontend); - } - return network; - }); - } - - final ApplicationGatewaysClient innerCollection = this.manager().serviceClient().getApplicationGateways(); - return Flux - .merge(networkObservable, pipObservable) - .last(Resource.DUMMY) - .flatMap(resource -> innerCollection.createOrUpdateAsync(resourceGroupName(), name(), innerModel())); - } - - /** - * Determines whether the app gateway child that can be found using a name or a port number can be created, or it - * already exists, or there is a clash. - * - * @param byName object found by name - * @param byPort object found by port - * @param name the desired name of the object - * @return CreationState - */ - CreationState needToCreate(T byName, T byPort, String name) { - if (byName != null && byPort != null) { - // If objects with this name and/or port already exist... - if (byName == byPort) { - // ...and it is the same object, then do nothing - return CreationState.Found; - } else { - // ...but if they are inconsistent, then fail fast - return CreationState.InvalidState; - } - } else if (byPort != null) { - // If no object with the requested name, but the port number is found... - if (name == null) { - // ...and no name is requested, then do nothing, because the object already exists - return CreationState.Found; - } else { - // ...but if a clashing name is requested, then fail fast - return CreationState.InvalidState; - } - } else { - // Ok to create the object - return CreationState.NeedToCreate; - } - } - - enum CreationState { - Found, - NeedToCreate, - InvalidState, - } - - String futureResourceId() { - return new StringBuilder() - .append(super.resourceIdBase()) - .append("/providers/Microsoft.Network/applicationGateways/") - .append(this.name()) - .toString(); - } - - // Withers (fluent) - - @Override - public ApplicationGatewayImpl withDisabledSslProtocol(ApplicationGatewaySslProtocol protocol) { - if (protocol != null) { - ApplicationGatewaySslPolicy policy = ensureSslPolicy(); - if (!policy.disabledSslProtocols().contains(protocol)) { - policy.disabledSslProtocols().add(protocol); - } - } - return this; - } - - @Override - public ApplicationGatewayImpl withDisabledSslProtocols(ApplicationGatewaySslProtocol... protocols) { - if (protocols != null) { - for (ApplicationGatewaySslProtocol protocol : protocols) { - withDisabledSslProtocol(protocol); - } - } - - return this; - } - - @Override - public ApplicationGatewayImpl withoutDisabledSslProtocol(ApplicationGatewaySslProtocol protocol) { - if (this.innerModel().sslPolicy() != null && this.innerModel().sslPolicy().disabledSslProtocols() != null) { - this.innerModel().sslPolicy().disabledSslProtocols().remove(protocol); - if (this.innerModel().sslPolicy().disabledSslProtocols().isEmpty()) { - this.withoutAnyDisabledSslProtocols(); - } - } - return this; - } - - @Override - public ApplicationGatewayImpl withoutDisabledSslProtocols(ApplicationGatewaySslProtocol... protocols) { - if (protocols != null) { - for (ApplicationGatewaySslProtocol protocol : protocols) { - this.withoutDisabledSslProtocol(protocol); - } - } - return this; - } - - @Override - public ApplicationGatewayImpl withoutAnyDisabledSslProtocols() { - this.innerModel().withSslPolicy(null); - return this; - } - - @Override - public ApplicationGatewayImpl withInstanceCount(int capacity) { - if (this.innerModel().sku() == null) { - this.withSize(ApplicationGatewaySkuName.STANDARD_SMALL); - } - - this.innerModel().sku().withCapacity(capacity); - this.innerModel().withAutoscaleConfiguration(null); - return this; - } - - @Override - public ApplicationGatewayImpl withWebApplicationFirewall(boolean enabled, ApplicationGatewayFirewallMode mode) { - this - .innerModel() - .withWebApplicationFirewallConfiguration( - new ApplicationGatewayWebApplicationFirewallConfiguration() - .withEnabled(enabled) - .withFirewallMode(mode) - .withRuleSetType("OWASP") - .withRuleSetVersion("3.0")); - return this; - } - - @Override - public ApplicationGatewayImpl withWebApplicationFirewall( - ApplicationGatewayWebApplicationFirewallConfiguration config) { - this.innerModel().withWebApplicationFirewallConfiguration(config); - return this; - } - - @Override - public ApplicationGatewayImpl withAutoScale(int minCapacity, int maxCapacity) { - this.innerModel().sku().withCapacity(null); - this - .innerModel() - .withAutoscaleConfiguration( - new ApplicationGatewayAutoscaleConfiguration() - .withMinCapacity(minCapacity) - .withMaxCapacity(maxCapacity)); - return this; - } - - @Override - public ApplicationGatewayImpl withPrivateIpAddressDynamic() { - ensureDefaultPrivateFrontend().withPrivateIpAddressDynamic(); - return this; - } - - @Override - public ApplicationGatewayImpl withPrivateIpAddressStatic(String ipAddress) { - ensureDefaultPrivateFrontend().withPrivateIpAddressStatic(ipAddress); - return this; - } - - ApplicationGatewayImpl withFrontend(ApplicationGatewayFrontendImpl frontend) { - if (frontend != null) { - this.frontends.put(frontend.name(), frontend); - } - return this; - } - - ApplicationGatewayImpl withProbe(ApplicationGatewayProbeImpl probe) { - if (probe != null) { - this.probes.put(probe.name(), probe); - } - return this; - } - - ApplicationGatewayImpl withBackend(ApplicationGatewayBackendImpl backend) { - if (backend != null) { - this.backends.put(backend.name(), backend); - } - return this; - } - - ApplicationGatewayImpl withAuthenticationCertificate(ApplicationGatewayAuthenticationCertificateImpl authCert) { - if (authCert != null) { - this.authCertificates.put(authCert.name(), authCert); - } - return this; - } - - ApplicationGatewayImpl withSslCertificate(ApplicationGatewaySslCertificateImpl cert) { - if (cert != null) { - this.sslCerts.put(cert.name(), cert); - } - return this; - } - - ApplicationGatewayImpl withHttpListener(ApplicationGatewayListenerImpl httpListener) { - if (httpListener != null) { - this.listeners.put(httpListener.name(), httpListener); - } - return this; - } - - ApplicationGatewayImpl withRedirectConfiguration(ApplicationGatewayRedirectConfigurationImpl redirectConfig) { - if (redirectConfig != null) { - this.redirectConfigs.put(redirectConfig.name(), redirectConfig); - } - return this; - } - - ApplicationGatewayImpl withUrlPathMap(ApplicationGatewayUrlPathMapImpl urlPathMap) { - if (urlPathMap != null) { - this.urlPathMaps.put(urlPathMap.name(), urlPathMap); - } - return this; - } - - ApplicationGatewayImpl withRequestRoutingRule(ApplicationGatewayRequestRoutingRuleImpl rule) { - if (rule != null) { - this.rules.put(rule.name(), rule); - } - return this; - } - - ApplicationGatewayImpl withBackendHttpConfiguration(ApplicationGatewayBackendHttpConfigurationImpl httpConfig) { - if (httpConfig != null) { - this.backendConfigs.put(httpConfig.name(), httpConfig); - } - return this; - } - - @Override - public ApplicationGatewayImpl withTier(ApplicationGatewayTier skuTier) { - if (this.innerModel().sku() == null) { - this.innerModel().withSku(new ApplicationGatewaySku().withCapacity(1)); - } - this.innerModel().sku().withTier(skuTier); - return this; - } - - @Override - public ApplicationGatewayImpl withSize(ApplicationGatewaySkuName skuName) { - if (this.innerModel().sku() == null) { - // Create with default instance count - this.innerModel().withSku(new ApplicationGatewaySku().withCapacity(1)); - } - this.innerModel().sku().withName(skuName); - return this; - } - - @Override - public ApplicationGatewayImpl withExistingSubnet(Subnet subnet) { - ensureDefaultIPConfig().withExistingSubnet(subnet); - return this; - } - - @Override - public ApplicationGatewayImpl withExistingSubnet(Network network, String subnetName) { - ensureDefaultIPConfig().withExistingSubnet(network, subnetName); - return this; - } - - @Override - public ApplicationGatewayImpl withExistingSubnet(String networkResourceId, String subnetName) { - ensureDefaultIPConfig().withExistingSubnet(networkResourceId, subnetName); - return this; - } - - @Override - public ApplicationGatewayImpl withIdentity(ManagedServiceIdentity identity) { - this.innerModel().withIdentity(identity); - return this; - } - - ApplicationGatewayImpl withConfig(ApplicationGatewayIpConfigurationImpl config) { - if (config != null) { - this.ipConfigs.put(config.name(), config); - } - return this; - } - - @Override - public ApplicationGatewaySslCertificateImpl defineSslCertificate(String name) { - return defineChild( - name, - this.sslCerts, - ApplicationGatewaySslCertificateInner.class, - ApplicationGatewaySslCertificateImpl.class); - } - - // TODO(future) @Override - since app gateways don't support more than one today, no need to expose this - private ApplicationGatewayIpConfigurationImpl defineIPConfiguration(String name) { - return defineChild( - name, - this.ipConfigs, - ApplicationGatewayIpConfigurationInner.class, - ApplicationGatewayIpConfigurationImpl.class); - } - - // TODO(future) @Override - since app gateways don't support more than one today, no need to expose this - private ApplicationGatewayFrontendImpl defineFrontend(String name) { - return defineChild( - name, - this.frontends, - ApplicationGatewayFrontendIpConfiguration.class, - ApplicationGatewayFrontendImpl.class); - } - - @Override - public ApplicationGatewayRedirectConfigurationImpl defineRedirectConfiguration(String name) { - return defineChild( - name, - this.redirectConfigs, - ApplicationGatewayRedirectConfigurationInner.class, - ApplicationGatewayRedirectConfigurationImpl.class); - } - - @Override - public ApplicationGatewayRequestRoutingRuleImpl defineRequestRoutingRule(String name) { - return defineChild( - name, - this.rules, - ApplicationGatewayRequestRoutingRuleInner.class, - ApplicationGatewayRequestRoutingRuleImpl.class); - } - - @Override - public ApplicationGatewayBackendImpl defineBackend(String name) { - return defineChild( - name, this.backends, ApplicationGatewayBackendAddressPool.class, ApplicationGatewayBackendImpl.class); - } - - @Override - public ApplicationGatewayAuthenticationCertificateImpl defineAuthenticationCertificate(String name) { - return defineChild( - name, - this.authCertificates, - ApplicationGatewayAuthenticationCertificateInner.class, - ApplicationGatewayAuthenticationCertificateImpl.class); - } - - @Override - public ApplicationGatewayProbeImpl defineProbe(String name) { - return defineChild(name, this.probes, ApplicationGatewayProbeInner.class, ApplicationGatewayProbeImpl.class); - } - - @Override - public ApplicationGatewayUrlPathMapImpl definePathBasedRoutingRule(String name) { - ApplicationGatewayUrlPathMapImpl urlPathMap = - defineChild( - name, - this.urlPathMaps, - ApplicationGatewayUrlPathMapInner.class, - ApplicationGatewayUrlPathMapImpl.class); - SubResource ref = new SubResource().withId(futureResourceId() + "/urlPathMaps/" + name); - // create corresponding request routing rule - ApplicationGatewayRequestRoutingRuleInner inner = - new ApplicationGatewayRequestRoutingRuleInner() - .withName(name) - .withRuleType(ApplicationGatewayRequestRoutingRuleType.PATH_BASED_ROUTING) - .withUrlPathMap(ref); - rules.put(name, new ApplicationGatewayRequestRoutingRuleImpl(inner, this)); - return urlPathMap; - } - - @Override - public ApplicationGatewayListenerImpl defineListener(String name) { - return defineChild( - name, this.listeners, ApplicationGatewayHttpListener.class, ApplicationGatewayListenerImpl.class); - } - - @Override - public ApplicationGatewayBackendHttpConfigurationImpl defineBackendHttpConfiguration(String name) { - ApplicationGatewayBackendHttpConfigurationImpl config = - defineChild( - name, - this.backendConfigs, - ApplicationGatewayBackendHttpSettings.class, - ApplicationGatewayBackendHttpConfigurationImpl.class); - if (config.innerModel().id() == null) { - return config.withPort(80); // Default port - } else { - return config; - } - } - - @SuppressWarnings("unchecked") - private ChildImplT defineChild( - String name, Map children, Class innerClass, Class implClass) { - ChildT child = children.get(name); - if (child == null) { - ChildInnerT inner; - try { - inner = innerClass.getDeclaredConstructor().newInstance(); - innerClass.getDeclaredMethod("withName", String.class).invoke(inner, name); - return implClass - .getDeclaredConstructor(innerClass, ApplicationGatewayImpl.class) - .newInstance(inner, this); - } catch (InstantiationException - | IllegalAccessException - | IllegalArgumentException - | InvocationTargetException - | NoSuchMethodException - | SecurityException e1) { - return null; - } - } else { - return (ChildImplT) child; - } - } - - @Override - public ApplicationGatewayImpl withoutPrivateFrontend() { - // Delete all private frontends - List toDelete = new ArrayList<>(); - for (ApplicationGatewayFrontend frontend : this.frontends.values()) { - if (frontend.isPrivate()) { - toDelete.add(frontend.name()); - } - } - - for (String frontendName : toDelete) { - this.frontends.remove(frontendName); - } - - this.defaultPrivateFrontend = null; - return this; - } - - @Override - public ApplicationGatewayImpl withoutPublicFrontend() { - // Delete all public frontends - List toDelete = new ArrayList<>(); - for (ApplicationGatewayFrontend frontend : this.frontends.values()) { - if (frontend.isPublic()) { - toDelete.add(frontend.name()); - } - } - - for (String frontendName : toDelete) { - this.frontends.remove(frontendName); - } - - this.defaultPublicFrontend = null; - return this; - } - - @Override - public ApplicationGatewayImpl withFrontendPort(int portNumber) { - return withFrontendPort(portNumber, null); - } - - @Override - public ApplicationGatewayImpl withFrontendPort(int portNumber, String name) { - // Ensure inner ports list initialized - List frontendPorts = this.innerModel().frontendPorts(); - if (frontendPorts == null) { - frontendPorts = new ArrayList(); - this.innerModel().withFrontendPorts(frontendPorts); - } - - // Attempt to find inner port by name if provided, or port number otherwise - ApplicationGatewayFrontendPort frontendPortByName = null; - ApplicationGatewayFrontendPort frontendPortByNumber = null; - for (ApplicationGatewayFrontendPort inner : this.innerModel().frontendPorts()) { - if (name != null && name.equalsIgnoreCase(inner.name())) { - frontendPortByName = inner; - } - if (inner.port() == portNumber) { - frontendPortByNumber = inner; - } - } - - CreationState needToCreate = this.needToCreate(frontendPortByName, frontendPortByNumber, name); - if (needToCreate == CreationState.NeedToCreate) { - // If no conflict, create a new port - if (name == null) { - // No name specified, so auto-name it - name = this.manager().resourceManager().internalContext().randomResourceName("port", 9); - } - - frontendPortByName = new ApplicationGatewayFrontendPort().withName(name).withPort(portNumber); - frontendPorts.add(frontendPortByName); - return this; - } else if (needToCreate == CreationState.Found) { - // If found matching port, then nothing needs to happen - return this; - } else { - // If name conflict for the same port number, then fail - return null; - } - } - - @Override - public ApplicationGatewayImpl withPrivateFrontend() { - /* NOTE: This logic is a workaround for the unusual Azure API logic: - * - although app gateway API definition allows multiple IP configs, - * only one is allowed by the service currently; - * - although app gateway frontend API definition allows for multiple frontends, - * only one is allowed by the service today; - * - and although app gateway API definition allows different subnets to be specified - * between the IP configs and frontends, the service - * requires the frontend and the containing subnet to be one and the same currently. - * - * So the logic here attempts to figure out from the API what that containing subnet - * for the app gateway is so that the user wouldn't have to re-enter it redundantly - * when enabling a private frontend, since only that one subnet is supported anyway. - * - * TODO: When the underlying Azure API is reworked to make more sense, - * or the app gateway service starts supporting the functionality - * that the underlying API implies is supported, this model and implementation should be revisited. - */ - ensureDefaultPrivateFrontend(); - return this; - } - - // Withers - - @Override - public ApplicationGatewayImpl withExistingPublicIpAddress(PublicIpAddress publicIPAddress) { - ensureDefaultPublicFrontend().withExistingPublicIpAddress(publicIPAddress); - return this; - } - - @Override - public ApplicationGatewayImpl withExistingPublicIpAddress(String resourceId) { - ensureDefaultPublicFrontend().withExistingPublicIpAddress(resourceId); - return this; - } - - @Override - public ApplicationGatewayImpl withNewPublicIpAddress(Creatable creatable) { - final String name = ensureDefaultPublicFrontend().name(); - this.creatablePipsByFrontend.put(name, this.addDependency(creatable)); - return this; - } - - @Override - public ApplicationGatewayImpl withNewPublicIpAddress() { - ensureDefaultPublicFrontend(); - return this; - } - - @Override - public ApplicationGatewayImpl withoutBackendFqdn(String fqdn) { - for (ApplicationGatewayBackend backend : this.backends.values()) { - ((ApplicationGatewayBackendImpl) backend).withoutFqdn(fqdn); - } - return this; - } - - @Override - public ApplicationGatewayImpl withoutBackendIPAddress(String ipAddress) { - for (ApplicationGatewayBackend backend : this.backends.values()) { - ApplicationGatewayBackendImpl backendImpl = (ApplicationGatewayBackendImpl) backend; - backendImpl.withoutIPAddress(ipAddress); - } - return this; - } - - @Override - public ApplicationGatewayImpl withoutIPConfiguration(String ipConfigurationName) { - this.ipConfigs.remove(ipConfigurationName); - return this; - } - - @Override - public ApplicationGatewayImpl withoutFrontend(String frontendName) { - this.frontends.remove(frontendName); - return this; - } - - @Override - public ApplicationGatewayImpl withoutFrontendPort(String name) { - if (this.innerModel().frontendPorts() == null) { - return this; - } - - for (int i = 0; i < this.innerModel().frontendPorts().size(); i++) { - ApplicationGatewayFrontendPort inner = this.innerModel().frontendPorts().get(i); - if (inner.name().equalsIgnoreCase(name)) { - this.innerModel().frontendPorts().remove(i); - break; - } - } - - return this; - } - - @Override - public ApplicationGatewayImpl withoutFrontendPort(int portNumber) { - for (int i = 0; i < this.innerModel().frontendPorts().size(); i++) { - ApplicationGatewayFrontendPort inner = this.innerModel().frontendPorts().get(i); - if (inner.port().equals(portNumber)) { - this.innerModel().frontendPorts().remove(i); - break; - } - } - - return this; - } - - @Override - public ApplicationGatewayImpl withoutSslCertificate(String name) { - this.sslCerts.remove(name); - return this; - } - - @Override - public ApplicationGatewayImpl withoutAuthenticationCertificate(String name) { - this.authCertificates.remove(name); - return this; - } - - @Override - public ApplicationGatewayImpl withoutProbe(String name) { - this.probes.remove(name); - return this; - } - - @Override - public ApplicationGatewayImpl withoutListener(String name) { - this.listeners.remove(name); - return this; - } - - @Override - public ApplicationGatewayImpl withoutRedirectConfiguration(String name) { - this.redirectConfigs.remove(name); - return this; - } - - @Override - public ApplicationGatewayImpl withoutUrlPathMap(String name) { - // Remove associated request routing rule - for (ApplicationGatewayRequestRoutingRule rule : rules.values()) { - if (rule.urlPathMap() != null && name.equals(rule.urlPathMap().name())) { - rules.remove(rule.name()); - break; - } - } - this.urlPathMaps.remove(name); - return this; - } - - @Override - public ApplicationGatewayImpl withoutRequestRoutingRule(String name) { - this.rules.remove(name); - return this; - } - - @Override - public ApplicationGatewayImpl withoutBackend(String backendName) { - this.backends.remove(backendName); - return this; - } - - @Override - public ApplicationGatewayImpl withHttp2() { - innerModel().withEnableHttp2(true); - return this; - } - - @Override - public ApplicationGatewayImpl withoutHttp2() { - innerModel().withEnableHttp2(false); - return this; - } - - @Override - public ApplicationGatewayImpl withAvailabilityZone(AvailabilityZoneId zoneId) { - if (this.innerModel().zones() == null) { - this.innerModel().withZones(new ArrayList()); - } - if (!this.innerModel().zones().contains(zoneId.toString())) { - this.innerModel().zones().add(zoneId.toString()); - } - return this; - } - - @Override - public ApplicationGatewayBackendImpl updateBackend(String name) { - return (ApplicationGatewayBackendImpl) this.backends.get(name); - } - - @Override - public ApplicationGatewayFrontendImpl updatePublicFrontend() { - return (ApplicationGatewayFrontendImpl) defaultPublicFrontend(); - } - - @Override - public ApplicationGatewayListenerImpl updateListener(String name) { - return (ApplicationGatewayListenerImpl) this.listeners.get(name); - } - - @Override - public ApplicationGatewayRedirectConfigurationImpl updateRedirectConfiguration(String name) { - return (ApplicationGatewayRedirectConfigurationImpl) this.redirectConfigs.get(name); - } - - @Override - public ApplicationGatewayRequestRoutingRuleImpl updateRequestRoutingRule(String name) { - return (ApplicationGatewayRequestRoutingRuleImpl) this.rules.get(name); - } - - @Override - public ApplicationGatewayImpl withoutBackendHttpConfiguration(String name) { - this.backendConfigs.remove(name); - return this; - } - - @Override - public ApplicationGatewayBackendHttpConfigurationImpl updateBackendHttpConfiguration(String name) { - return (ApplicationGatewayBackendHttpConfigurationImpl) this.backendConfigs.get(name); - } - - @Override - public ApplicationGatewayIpConfigurationImpl updateIPConfiguration(String ipConfigurationName) { - return (ApplicationGatewayIpConfigurationImpl) this.ipConfigs.get(ipConfigurationName); - } - - @Override - public ApplicationGatewayProbeImpl updateProbe(String name) { - return (ApplicationGatewayProbeImpl) this.probes.get(name); - } - - @Override - public ApplicationGatewayIpConfigurationImpl updateDefaultIPConfiguration() { - return (ApplicationGatewayIpConfigurationImpl) this.defaultIPConfiguration(); - } - - @Override - public ApplicationGatewayIpConfigurationImpl defineDefaultIPConfiguration() { - return ensureDefaultIPConfig(); - } - - @Override - public ApplicationGatewayFrontendImpl definePublicFrontend() { - return ensureDefaultPublicFrontend(); - } - - @Override - public ApplicationGatewayFrontendImpl definePrivateFrontend() { - return ensureDefaultPrivateFrontend(); - } - - @Override - public ApplicationGatewayFrontendImpl updateFrontend(String frontendName) { - return (ApplicationGatewayFrontendImpl) this.frontends.get(frontendName); - } - - @Override - public ApplicationGatewayUrlPathMapImpl updateUrlPathMap(String name) { - return (ApplicationGatewayUrlPathMapImpl) this.urlPathMaps.get(name); - } - - // Getters - - @Override - public Collection disabledSslProtocols() { - if (this.innerModel().sslPolicy() == null || this.innerModel().sslPolicy().disabledSslProtocols() == null) { - return new ArrayList<>(); - } else { - return Collections.unmodifiableCollection(this.innerModel().sslPolicy().disabledSslProtocols()); - } - } - - @Override - public ApplicationGatewayFrontend defaultPrivateFrontend() { - // Default means the only private one or the one tracked as default, if more than one private present - Map privateFrontends = this.privateFrontends(); - if (privateFrontends.size() == 1) { - this.defaultPrivateFrontend = (ApplicationGatewayFrontendImpl) privateFrontends.values().iterator().next(); - } else if (this.frontends().size() == 0) { - this.defaultPrivateFrontend = null; - } - - return this.defaultPrivateFrontend; - } - - @Override - public ApplicationGatewayFrontend defaultPublicFrontend() { - // Default means the only public one or the one tracked as default, if more than one public present - Map publicFrontends = this.publicFrontends(); - if (publicFrontends.size() == 1) { - this.defaultPublicFrontend = (ApplicationGatewayFrontendImpl) publicFrontends.values().iterator().next(); - } else if (this.frontends().size() == 0) { - this.defaultPublicFrontend = null; - } - - return this.defaultPublicFrontend; - } - - @Override - public ApplicationGatewayIpConfiguration defaultIPConfiguration() { - // Default means the only one - if (this.ipConfigs.size() == 1) { - return this.ipConfigs.values().iterator().next(); - } else { - return null; - } - } - - @Override - public ApplicationGatewayListener listenerByPortNumber(int portNumber) { - ApplicationGatewayListener listener = null; - for (ApplicationGatewayListener l : this.listeners.values()) { - if (l.frontendPortNumber() == portNumber) { - listener = l; - break; - } - } - return listener; - } - - @Override - public Map authenticationCertificates() { - return Collections.unmodifiableMap(this.authCertificates); - } - - @Override - public boolean isHttp2Enabled() { - return ResourceManagerUtils.toPrimitiveBoolean(innerModel().enableHttp2()); - } - - @Override - public Map urlPathMaps() { - return Collections.unmodifiableMap(this.urlPathMaps); - } - - @Override - public Set availabilityZones() { - Set zones = new TreeSet<>(); - if (this.innerModel().zones() != null) { - for (String zone : this.innerModel().zones()) { - zones.add(AvailabilityZoneId.fromString(zone)); - } - } - return Collections.unmodifiableSet(zones); - } - - @Override - public Map backendHttpConfigurations() { - return Collections.unmodifiableMap(this.backendConfigs); - } - - @Override - public Map backends() { - return Collections.unmodifiableMap(this.backends); - } - - @Override - public Map requestRoutingRules() { - return Collections.unmodifiableMap(this.rules); - } - - @Override - public Map frontends() { - return Collections.unmodifiableMap(this.frontends); - } - - @Override - public Map probes() { - return Collections.unmodifiableMap(this.probes); - } - - @Override - public Map sslCertificates() { - return Collections.unmodifiableMap(this.sslCerts); - } - - @Override - public Map listeners() { - return Collections.unmodifiableMap(this.listeners); - } - - @Override - public Map redirectConfigurations() { - return Collections.unmodifiableMap(this.redirectConfigs); - } - - @Override - public Map ipConfigurations() { - return Collections.unmodifiableMap(this.ipConfigs); - } - - @Override - public ApplicationGatewaySku sku() { - return this.innerModel().sku(); - } - - @Override - public ApplicationGatewayOperationalState operationalState() { - return this.innerModel().operationalState(); - } - - @Override - public Map frontendPorts() { - Map ports = new TreeMap<>(); - if (this.innerModel().frontendPorts() != null) { - for (ApplicationGatewayFrontendPort portInner : this.innerModel().frontendPorts()) { - ports.put(portInner.name(), portInner.port()); - } - } - return Collections.unmodifiableMap(ports); - } - - @Override - public String frontendPortNameFromNumber(int portNumber) { - String portName = null; - for (Entry portEntry : this.frontendPorts().entrySet()) { - if (portNumber == portEntry.getValue()) { - portName = portEntry.getKey(); - break; - } - } - return portName; - } - - private SubResource defaultSubnetRef() { - ApplicationGatewayIpConfiguration ipConfig = defaultIPConfiguration(); - if (ipConfig == null) { - return null; - } else { - return ipConfig.innerModel().subnet(); - } - } - - @Override - public String networkId() { - SubResource subnetRef = defaultSubnetRef(); - if (subnetRef == null) { - return null; - } else { - return ResourceUtils.parentResourceIdFromResourceId(subnetRef.id()); - } - } - - @Override - public String subnetName() { - SubResource subnetRef = defaultSubnetRef(); - if (subnetRef == null) { - return null; - } else { - return ResourceUtils.nameFromResourceId(subnetRef.id()); - } - } - - @Override - public String privateIpAddress() { - ApplicationGatewayFrontend frontend = defaultPrivateFrontend(); - if (frontend == null) { - return null; - } else { - return frontend.privateIpAddress(); - } - } - - @Override - public IpAllocationMethod privateIpAllocationMethod() { - ApplicationGatewayFrontend frontend = defaultPrivateFrontend(); - if (frontend == null) { - return null; - } else { - return frontend.privateIpAllocationMethod(); - } - } - - @Override - public boolean isPrivate() { - for (ApplicationGatewayFrontend frontend : this.frontends.values()) { - if (frontend.isPrivate()) { - return true; - } - } - return false; - } - - @Override - public boolean isPublic() { - for (ApplicationGatewayFrontend frontend : this.frontends.values()) { - if (frontend.isPublic()) { - return true; - } - } - return false; - } - - @Override - public Map publicFrontends() { - Map publicFrontends = new TreeMap<>(); - for (ApplicationGatewayFrontend frontend : this.frontends().values()) { - if (frontend.isPublic()) { - publicFrontends.put(frontend.name(), frontend); - } - } - - return Collections.unmodifiableMap(publicFrontends); - } - - @Override - public Map privateFrontends() { - Map privateFrontends = new TreeMap<>(); - for (ApplicationGatewayFrontend frontend : this.frontends.values()) { - if (frontend.isPrivate()) { - privateFrontends.put(frontend.name(), frontend); - } - } - - return Collections.unmodifiableMap(privateFrontends); - } - - @Override - public int instanceCount() { - if (this.sku() != null && this.sku().capacity() != null) { - return this.sku().capacity(); - } else { - return 1; - } - } - - @Override - public ApplicationGatewaySkuName size() { - if (this.sku() != null && this.sku().name() != null) { - return this.sku().name(); - } else { - return ApplicationGatewaySkuName.STANDARD_SMALL; - } - } - - @Override - public ApplicationGatewayTier tier() { - if (this.sku() != null && this.sku().tier() != null) { - return this.sku().tier(); - } else { - return ApplicationGatewayTier.STANDARD; - } - } - - @Override - public ApplicationGatewayAutoscaleConfiguration autoscaleConfiguration() { - return this.innerModel().autoscaleConfiguration(); - } - - @Override - public ApplicationGatewayWebApplicationFirewallConfiguration webApplicationFirewallConfiguration() { - return this.innerModel().webApplicationFirewallConfiguration(); - } - - @Override - public Update withoutPublicIpAddress() { - return this.withoutPublicFrontend(); - } - - // Actions - - @Override - public void start() { - this.startAsync().block(); - } - - @Override - public void stop() { - this.stopAsync().block(); - } - - @Override - public Mono startAsync() { - Mono startObservable = - this.manager().serviceClient().getApplicationGateways().startAsync(this.resourceGroupName(), this.name()); - Mono refreshObservable = refreshAsync(); - - // Refresh after start to ensure the app gateway operational state is updated - return Flux.concat(startObservable, refreshObservable).then(); - } - - @Override - public Mono stopAsync() { - Mono stopObservable = - this.manager().serviceClient().getApplicationGateways().stopAsync(this.resourceGroupName(), this.name()); - Mono refreshObservable = refreshAsync(); - - // Refresh after stop to ensure the app gateway operational state is updated - return Flux.concat(stopObservable, refreshObservable).then(); - } - - private ApplicationGatewaySslPolicy ensureSslPolicy() { - ApplicationGatewaySslPolicy policy = this.innerModel().sslPolicy(); - if (policy == null) { - policy = new ApplicationGatewaySslPolicy(); - this.innerModel().withSslPolicy(policy); - } - - List protocols = policy.disabledSslProtocols(); - if (protocols == null) { - protocols = new ArrayList<>(); - policy.withDisabledSslProtocols(protocols); - } - - return policy; - } - - @Override - public Map checkBackendHealth() { - return this.checkBackendHealthAsync().block(); - } - - @Override - public Mono> checkBackendHealthAsync() { - return this - .manager() - .serviceClient() - .getApplicationGateways() - // TODO(not known): Last minutes - .backendHealthAsync(this.resourceGroupName(), this.name(), null) - .map( - inner -> { - Map backendHealths = new TreeMap<>(); - if (inner != null) { - for (ApplicationGatewayBackendHealthPool healthInner : inner.backendAddressPools()) { - ApplicationGatewayBackendHealth backendHealth = - new ApplicationGatewayBackendHealthImpl(healthInner, ApplicationGatewayImpl.this); - backendHealths.put(backendHealth.name(), backendHealth); - } - } - return Collections.unmodifiableMap(backendHealths); - }); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ApplicationGatewayIpConfigurationImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ApplicationGatewayIpConfigurationImpl.java deleted file mode 100644 index 030500235a79..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ApplicationGatewayIpConfigurationImpl.java +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.management.SubResource; -import com.azure.resourcemanager.network.models.ApplicationGateway; -import com.azure.resourcemanager.network.models.ApplicationGatewayIpConfiguration; -import com.azure.resourcemanager.network.models.Network; -import com.azure.resourcemanager.network.models.Subnet; -import com.azure.resourcemanager.network.fluent.models.ApplicationGatewayIpConfigurationInner; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils; -import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.ChildResourceImpl; - -/** Implementation for ApplicationGatewayIpConfiguration. */ -class ApplicationGatewayIpConfigurationImpl - extends ChildResourceImpl - implements ApplicationGatewayIpConfiguration, - ApplicationGatewayIpConfiguration.Definition, - ApplicationGatewayIpConfiguration.UpdateDefinition, - ApplicationGatewayIpConfiguration.Update { - - ApplicationGatewayIpConfigurationImpl(ApplicationGatewayIpConfigurationInner inner, ApplicationGatewayImpl parent) { - super(inner, parent); - } - - // Getters - @Override - public String name() { - return this.innerModel().name(); - } - - // Fluent setters - - @Override - public ApplicationGatewayIpConfigurationImpl withExistingSubnet(Subnet subnet) { - return this.withExistingSubnet(subnet.parent().id(), subnet.name()); - } - - @Override - public ApplicationGatewayIpConfigurationImpl withExistingSubnet(Network network, String subnetName) { - return this.withExistingSubnet(network.id(), subnetName); - } - - @Override - public ApplicationGatewayIpConfigurationImpl withExistingSubnet(String networkId, String subnetName) { - SubResource subnetRef = new SubResource().withId(networkId + "/subnets/" + subnetName); - this.innerModel().withSubnet(subnetRef); - return this; - } - - // Verbs - - @Override - public ApplicationGatewayImpl attach() { - return this.parent().withConfig(this); - } - - @Override - public String networkId() { - SubResource subnetRef = this.innerModel().subnet(); - if (subnetRef != null) { - return ResourceUtils.parentResourceIdFromResourceId(subnetRef.id()); - } else { - return null; - } - } - - @Override - public String subnetName() { - SubResource subnetRef = this.innerModel().subnet(); - if (subnetRef != null) { - return ResourceUtils.nameFromResourceId(subnetRef.id()); - } else { - return null; - } - } - - @Override - public Subnet getSubnet() { - return Utils.getAssociatedSubnet(this.parent().manager(), this.innerModel().subnet()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ApplicationGatewayListenerImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ApplicationGatewayListenerImpl.java deleted file mode 100644 index 751590896d14..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ApplicationGatewayListenerImpl.java +++ /dev/null @@ -1,267 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.management.SubResource; -import com.azure.resourcemanager.network.models.ApplicationGateway; -import com.azure.resourcemanager.network.models.ApplicationGatewayFrontend; -import com.azure.resourcemanager.network.models.ApplicationGatewayHttpListener; -import com.azure.resourcemanager.network.models.ApplicationGatewayListener; -import com.azure.resourcemanager.network.models.ApplicationGatewayProtocol; -import com.azure.resourcemanager.network.models.ApplicationGatewaySslCertificate; -import com.azure.resourcemanager.network.models.PublicIpAddress; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils; -import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.ChildResourceImpl; -import reactor.core.publisher.Mono; - -import java.io.File; -import java.io.IOException; - -/** Implementation for ApplicationGatewayListener. */ -class ApplicationGatewayListenerImpl - extends ChildResourceImpl - implements ApplicationGatewayListener, - ApplicationGatewayListener.Definition, - ApplicationGatewayListener.UpdateDefinition, - ApplicationGatewayListener.Update { - - ApplicationGatewayListenerImpl(ApplicationGatewayHttpListener inner, ApplicationGatewayImpl parent) { - super(inner, parent); - } - - // Getters - @Override - public String networkId() { - ApplicationGatewayFrontend frontend = this.frontend(); - if (frontend != null) { - return frontend.networkId(); - } else { - return null; - } - } - - @Override - public String subnetName() { - ApplicationGatewayFrontend frontend = this.frontend(); - if (frontend != null) { - return frontend.subnetName(); - } else { - return null; - } - } - - @Override - public boolean requiresServerNameIndication() { - if (this.innerModel().requireServerNameIndication() != null) { - return this.innerModel().requireServerNameIndication(); - } else { - return false; - } - } - - @Override - public String hostname() { - return this.innerModel().hostname(); - } - - @Override - public String publicIpAddressId() { - final ApplicationGatewayFrontend frontend = this.frontend(); - if (frontend == null) { - return null; - } else { - return frontend.publicIpAddressId(); - } - } - - @Override - public PublicIpAddress getPublicIpAddress() { - return this.getPublicIpAddressAsync().block(); - } - - @Override - public Mono getPublicIpAddressAsync() { - String pipId = this.publicIpAddressId(); - return pipId == null ? Mono.empty() : this.parent().manager().publicIpAddresses().getByIdAsync(pipId); - } - - @Override - public String name() { - return this.innerModel().name(); - } - - @Override - public ApplicationGatewaySslCertificate sslCertificate() { - SubResource certRef = this.innerModel().sslCertificate(); - if (certRef == null) { - return null; - } - - String name = ResourceUtils.nameFromResourceId(certRef.id()); - return this.parent().sslCertificates().get(name); - } - - @Override - public ApplicationGatewayProtocol protocol() { - return this.innerModel().protocol(); - } - - @Override - public int frontendPortNumber() { - String name = this.frontendPortName(); - if (name == null) { - return 0; - } else if (!this.parent().frontendPorts().containsKey(name)) { - return 0; - } else { - return this.parent().frontendPorts().get(name); - } - } - - @Override - public String frontendPortName() { - if (this.innerModel().frontendPort() != null) { - return ResourceUtils.nameFromResourceId(this.innerModel().frontendPort().id()); - } else { - return null; - } - } - - @Override - public ApplicationGatewayFrontend frontend() { - final SubResource frontendInner = this.innerModel().frontendIpConfiguration(); - if (frontendInner == null) { - return null; - } else { - final String frontendName = ResourceUtils.nameFromResourceId(frontendInner.id()); - return this.parent().frontends().get(frontendName); - } - } - - // Verbs - - @Override - public ApplicationGatewayImpl attach() { - this.parent().withHttpListener(this); - return this.parent(); - } - - // Helpers - - private ApplicationGatewayListenerImpl withFrontend(String name) { - SubResource frontendRef = - new SubResource().withId(this.parent().futureResourceId() + "/frontendIPConfigurations/" + name); - this.innerModel().withFrontendIpConfiguration(frontendRef); - return this; - } - - // Withers - - @Override - public ApplicationGatewayListenerImpl withFrontendPort(String name) { - SubResource portRef = new SubResource().withId(this.parent().futureResourceId() + "/frontendPorts/" + name); - this.innerModel().withFrontendPort(portRef); - return this; - } - - @Override - public ApplicationGatewayListenerImpl withFrontendPort(int portNumber) { - // Attempt to find an existing port referencing this port number - String portName = this.parent().frontendPortNameFromNumber(portNumber); - if (portName == null) { - // Existing frontend port with this number not found so create one - portName = this.parent().manager().resourceManager().internalContext() - .randomResourceName("port", 9); - this.parent().withFrontendPort(portNumber, portName); - } - - return this.withFrontendPort(portName); - } - - @Override - public ApplicationGatewayListenerImpl withSslCertificate(String name) { - SubResource certRef = new SubResource().withId(this.parent().futureResourceId() + "/sslCertificates/" + name); - this.innerModel().withSslCertificate(certRef); - return this; - } - - @Override - public ApplicationGatewayListenerImpl withSslCertificateFromKeyVaultSecretId(String keyVaultSecretId) { - return withSslCertificateFromKeyVaultSecretId(keyVaultSecretId, null); - } - - private ApplicationGatewayListenerImpl withSslCertificateFromKeyVaultSecretId( - String keyVaultSecretId, String name) { - if (name == null) { - name = this.parent().manager().resourceManager().internalContext() - .randomResourceName("cert", 10); - } - this.parent().defineSslCertificate(name).withKeyVaultSecretId(keyVaultSecretId).attach(); - return this; - } - - @Override - public ApplicationGatewayListenerImpl withSslCertificateFromPfxFile(File pfxFile) throws IOException { - return withSslCertificateFromPfxFile(pfxFile, null); - } - - private ApplicationGatewayListenerImpl withSslCertificateFromPfxFile(File pfxFile, String name) throws IOException { - if (name == null) { - name = this.parent().manager().resourceManager().internalContext() - .randomResourceName("cert", 10); - } - this.parent().defineSslCertificate(name).withPfxFromFile(pfxFile).attach(); - return this.withSslCertificate(name); - } - - @Override - public ApplicationGatewayListenerImpl withSslCertificatePassword(String password) { - ApplicationGatewaySslCertificateImpl sslCert = (ApplicationGatewaySslCertificateImpl) this.sslCertificate(); - if (sslCert != null) { - sslCert.withPfxPassword(password); - } - return this; - } - - @Override - public ApplicationGatewayListenerImpl withHttp() { - this.innerModel().withProtocol(ApplicationGatewayProtocol.HTTP); - return this; - } - - @Override - public ApplicationGatewayListenerImpl withHttps() { - this.innerModel().withProtocol(ApplicationGatewayProtocol.HTTPS); - return this; - } - - @Override - public ApplicationGatewayListenerImpl withHostname(String hostname) { - this.innerModel().withHostname(hostname); - return this; - } - - @Override - public ApplicationGatewayListenerImpl withServerNameIndication() { - this.innerModel().withRequireServerNameIndication(true); - return this; - } - - @Override - public ApplicationGatewayListenerImpl withoutServerNameIndication() { - this.innerModel().withRequireServerNameIndication(false); - return this; - } - - @Override - public ApplicationGatewayListenerImpl withPrivateFrontend() { - this.withFrontend(this.parent().ensureDefaultPrivateFrontend().name()); - return this; - } - - @Override - public ApplicationGatewayListenerImpl withPublicFrontend() { - this.withFrontend(this.parent().ensureDefaultPublicFrontend().name()); - return this; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ApplicationGatewayPathRuleImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ApplicationGatewayPathRuleImpl.java deleted file mode 100644 index 658ccdc8d9c6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ApplicationGatewayPathRuleImpl.java +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.management.SubResource; -import com.azure.resourcemanager.network.models.ApplicationGateway; -import com.azure.resourcemanager.network.models.ApplicationGatewayBackend; -import com.azure.resourcemanager.network.models.ApplicationGatewayBackendHttpConfiguration; -import com.azure.resourcemanager.network.models.ApplicationGatewayPathRule; -import com.azure.resourcemanager.network.models.ApplicationGatewayRedirectConfiguration; -import com.azure.resourcemanager.network.models.ApplicationGatewayUrlPathMap; -import com.azure.resourcemanager.network.fluent.models.ApplicationGatewayPathRuleInner; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils; -import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.ChildResourceImpl; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; - -/** Implementation for application gateway path rule. */ -class ApplicationGatewayPathRuleImpl - extends ChildResourceImpl< - ApplicationGatewayPathRuleInner, ApplicationGatewayUrlPathMapImpl, ApplicationGatewayUrlPathMap> - implements ApplicationGatewayPathRule, - ApplicationGatewayPathRule.Definition< - ApplicationGatewayUrlPathMap.DefinitionStages.WithAttach< - ApplicationGateway.DefinitionStages.WithRequestRoutingRuleOrCreate>>, - ApplicationGatewayPathRule.UpdateDefinition< - ApplicationGatewayUrlPathMap.UpdateDefinitionStages.WithAttach>, - ApplicationGatewayPathRule.Update { - - ApplicationGatewayPathRuleImpl(ApplicationGatewayPathRuleInner inner, ApplicationGatewayUrlPathMapImpl parent) { - super(inner, parent); - } - - @Override - public String name() { - return this.innerModel().name(); - } - - @Override - public ApplicationGatewayUrlPathMapImpl attach() { - return this.parent().withPathRule(this); - } - - @Override - public ApplicationGatewayPathRuleImpl toBackendHttpConfiguration(String name) { - SubResource httpConfigRef = - new SubResource() - .withId(this.parent().parent().futureResourceId() + "/backendHttpSettingsCollection/" + name); - this.innerModel().withBackendHttpSettings(httpConfigRef); - return this; - } - - @Override - public ApplicationGatewayPathRuleImpl toBackend(String name) { - this.innerModel().withBackendAddressPool(this.parent().parent().ensureBackendRef(name)); - return this; - } - - @Override - public ApplicationGatewayPathRuleImpl withRedirectConfiguration(String name) { - if (name == null) { - this.innerModel().withRedirectConfiguration(null); - } else { - SubResource ref = - new SubResource().withId(this.parent().parent().futureResourceId() + "/redirectConfigurations/" + name); - this.innerModel().withRedirectConfiguration(ref); - } - return this; - } - - @Override - public ApplicationGatewayBackend backend() { - SubResource backendRef = this.innerModel().backendAddressPool(); - if (backendRef != null) { - String backendName = ResourceUtils.nameFromResourceId(backendRef.id()); - return this.parent().parent().backends().get(backendName); - } else { - return null; - } - } - - @Override - public ApplicationGatewayBackendHttpConfiguration backendHttpConfiguration() { - SubResource configRef = this.innerModel().backendHttpSettings(); - if (configRef != null) { - String configName = ResourceUtils.nameFromResourceId(configRef.id()); - return this.parent().parent().backendHttpConfigurations().get(configName); - } else { - return null; - } - } - - @Override - public ApplicationGatewayRedirectConfiguration redirectConfiguration() { - SubResource ref = this.innerModel().redirectConfiguration(); - if (ref == null) { - return null; - } else { - return this.parent().parent().redirectConfigurations().get(ResourceUtils.nameFromResourceId(ref.id())); - } - } - - @Override - public List paths() { - return Collections.unmodifiableList(innerModel().paths()); - } - - @Override - public ApplicationGatewayPathRuleImpl withPath(String path) { - if (innerModel().paths() == null) { - innerModel().withPaths(new ArrayList()); - } - innerModel().paths().add(path); - return this; - } - - @Override - public ApplicationGatewayPathRuleImpl withPaths(String... paths) { - innerModel().withPaths(Arrays.asList(paths)); - return this; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ApplicationGatewayProbeImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ApplicationGatewayProbeImpl.java deleted file mode 100644 index 8d914040da0d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ApplicationGatewayProbeImpl.java +++ /dev/null @@ -1,228 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.ApplicationGateway; -import com.azure.resourcemanager.network.models.ApplicationGatewayProbe; -import com.azure.resourcemanager.network.models.ApplicationGatewayProbeHealthResponseMatch; -import com.azure.resourcemanager.network.models.ApplicationGatewayProtocol; -import com.azure.resourcemanager.network.fluent.models.ApplicationGatewayProbeInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.ChildResourceImpl; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Set; -import java.util.TreeSet; - -/** Implementation for ApplicationGatewayProbe. */ -class ApplicationGatewayProbeImpl - extends ChildResourceImpl - implements ApplicationGatewayProbe, - ApplicationGatewayProbe.Definition, - ApplicationGatewayProbe.UpdateDefinition, - ApplicationGatewayProbe.Update { - private final ClientLogger logger = new ClientLogger(getClass()); - - ApplicationGatewayProbeImpl(ApplicationGatewayProbeInner inner, ApplicationGatewayImpl parent) { - super(inner, parent); - } - - // Getters - - @Override - public String name() { - return this.innerModel().name(); - } - - @Override - public String healthyHttpResponseBodyContents() { - ApplicationGatewayProbeHealthResponseMatch match = this.innerModel().match(); - if (match == null) { - return null; - } else { - return match.body(); - } - } - - @Override - public ApplicationGatewayProtocol protocol() { - return this.innerModel().protocol(); - } - - @Override - public int timeBetweenProbesInSeconds() { - return (this.innerModel().interval() != null) ? this.innerModel().interval().intValue() : 0; - } - - @Override - public String path() { - return this.innerModel().path(); - } - - @Override - public Set healthyHttpResponseStatusCodeRanges() { - Set httpResponseStatusCodeRanges = new TreeSet<>(); - if (this.innerModel().match() != null && this.innerModel().match().statusCodes() != null) { - httpResponseStatusCodeRanges.addAll(this.innerModel().match().statusCodes()); - } - - return Collections.unmodifiableSet(httpResponseStatusCodeRanges); - } - - @Override - public int timeoutInSeconds() { - return (this.innerModel().timeout() != null) ? this.innerModel().timeout().intValue() : 0; - } - - @Override - public int retriesBeforeUnhealthy() { - return (this.innerModel().unhealthyThreshold() != null) ? this.innerModel().unhealthyThreshold() : 0; - } - - @Override - public String host() { - return this.innerModel().host(); - } - - // Fluent setters - - @Override - public ApplicationGatewayProbeImpl withProtocol(ApplicationGatewayProtocol protocol) { - this.innerModel().withProtocol(protocol); - return this; - } - - @Override - public ApplicationGatewayProbeImpl withHttp() { - return this.withProtocol(ApplicationGatewayProtocol.HTTP); - } - - @Override - public ApplicationGatewayProbeImpl withHttps() { - return this.withProtocol(ApplicationGatewayProtocol.HTTPS); - } - - @Override - public ApplicationGatewayProbeImpl withPath(String path) { - if (path != null && !path.startsWith("/")) { - path = "/" + path; - } - this.innerModel().withPath(path); - return this; - } - - @Override - public ApplicationGatewayProbeImpl withHost(String host) { - this.innerModel().withHost(host); - return this; - } - - @Override - public ApplicationGatewayProbeImpl withTimeoutInSeconds(int seconds) { - this.innerModel().withTimeout(seconds); - return this; - } - - @Override - public ApplicationGatewayProbeImpl withTimeBetweenProbesInSeconds(int seconds) { - this.innerModel().withInterval(seconds); - return this; - } - - @Override - public ApplicationGatewayProbeImpl withRetriesBeforeUnhealthy(int retryCount) { - this.innerModel().withUnhealthyThreshold(retryCount); - return this; - } - - @Override - public ApplicationGatewayProbeImpl withHealthyHttpResponseStatusCodeRanges(Set ranges) { - if (ranges != null) { - for (String range : ranges) { - this.withHealthyHttpResponseStatusCodeRange(range); - } - } - return this; - } - - @Override - public ApplicationGatewayProbeImpl withHealthyHttpResponseStatusCodeRange(String range) { - if (range != null) { - ApplicationGatewayProbeHealthResponseMatch match = this.innerModel().match(); - if (match == null) { - match = new ApplicationGatewayProbeHealthResponseMatch(); - this.innerModel().withMatch(match); - } - - List ranges = match.statusCodes(); - if (ranges == null) { - ranges = new ArrayList<>(); - match.withStatusCodes(ranges); - } - - if (!ranges.contains(range)) { - ranges.add(range); - } - } - - return this; - } - - @Override - public ApplicationGatewayProbeImpl withHealthyHttpResponseStatusCodeRange(int from, int to) { - if (from < 0 || to < 0) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("The start and end of a range cannot be negative numbers.")); - } else if (to < from) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("The end of the range cannot be less than the start of the range.")); - } else { - return this.withHealthyHttpResponseStatusCodeRange(String.valueOf(from) + "-" + String.valueOf(to)); - } - } - - @Override - public ApplicationGatewayProbeImpl withoutHealthyHttpResponseStatusCodeRanges() { - ApplicationGatewayProbeHealthResponseMatch match = this.innerModel().match(); - if (match != null) { - match.withStatusCodes(null); - if (match.body() == null) { - this.innerModel().withMatch(null); - } - } - - return this; - } - - @Override - public ApplicationGatewayProbeImpl withHealthyHttpResponseBodyContents(String text) { - ApplicationGatewayProbeHealthResponseMatch match = this.innerModel().match(); - if (text != null) { - if (match == null) { - match = new ApplicationGatewayProbeHealthResponseMatch(); - this.innerModel().withMatch(match); - } - match.withBody(text); - } else { - if (match != null) { - if (match.statusCodes() == null || match.statusCodes().isEmpty()) { - // If match is becoming empty then remove altogether - this.innerModel().withMatch(null); - } else { - match.withBody(null); - } - } - } - return this; - } - - // Verbs - - @Override - public ApplicationGatewayImpl attach() { - return this.parent().withProbe(this); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ApplicationGatewayRedirectConfigurationImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ApplicationGatewayRedirectConfigurationImpl.java deleted file mode 100644 index bb64e6b303b1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ApplicationGatewayRedirectConfigurationImpl.java +++ /dev/null @@ -1,156 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.management.SubResource; -import com.azure.resourcemanager.network.models.ApplicationGateway; -import com.azure.resourcemanager.network.models.ApplicationGatewayListener; -import com.azure.resourcemanager.network.models.ApplicationGatewayRedirectConfiguration; -import com.azure.resourcemanager.network.models.ApplicationGatewayRedirectType; -import com.azure.resourcemanager.network.models.ApplicationGatewayRequestRoutingRule; -import com.azure.resourcemanager.network.fluent.models.ApplicationGatewayRedirectConfigurationInner; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils; -import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.ChildResourceImpl; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; - -import java.util.Collections; -import java.util.Map; -import java.util.TreeMap; - -/** Implementation for ApplicationGatewayRedirectConfiguration. */ -class ApplicationGatewayRedirectConfigurationImpl - extends ChildResourceImpl - implements ApplicationGatewayRedirectConfiguration, - ApplicationGatewayRedirectConfiguration.Definition, - ApplicationGatewayRedirectConfiguration.UpdateDefinition, - ApplicationGatewayRedirectConfiguration.Update { - - ApplicationGatewayRedirectConfigurationImpl( - ApplicationGatewayRedirectConfigurationInner inner, ApplicationGatewayImpl parent) { - super(inner, parent); - } - - // Getters - @Override - public String name() { - return this.innerModel().name(); - } - - @Override - public ApplicationGatewayRedirectType type() { - return this.innerModel().redirectType(); - } - - @Override - public ApplicationGatewayListener targetListener() { - SubResource ref = this.innerModel().targetListener(); - if (ref == null) { - return null; - } - - String name = ResourceUtils.nameFromResourceId(ref.id()); - return this.parent().listeners().get(name); - } - - @Override - public String targetUrl() { - return this.innerModel().targetUrl(); - } - - @Override - public Map requestRoutingRules() { - Map rules = new TreeMap<>(); - if (null != this.innerModel().requestRoutingRules()) { - for (SubResource ruleRef : this.innerModel().requestRoutingRules()) { - String ruleName = ResourceUtils.nameFromResourceId(ruleRef.id()); - ApplicationGatewayRequestRoutingRule rule = this.parent().requestRoutingRules().get(ruleName); - if (null != rule) { - rules.put(ruleName, rule); - } - } - } - - return Collections.unmodifiableMap(rules); - } - - @Override - public boolean isPathIncluded() { - return ResourceManagerUtils.toPrimitiveBoolean(this.innerModel().includePath()); - } - - @Override - public boolean isQueryStringIncluded() { - return ResourceManagerUtils.toPrimitiveBoolean(this.innerModel().includeQueryString()); - } - - // Verbs - - @Override - public ApplicationGatewayImpl attach() { - return this.parent().withRedirectConfiguration(this); - } - - // Helpers - - // Withers - - @Override - public ApplicationGatewayRedirectConfigurationImpl withTargetUrl(String url) { - this.innerModel().withTargetUrl(url).withTargetListener(null).withIncludePath(null); - return this; - } - - @Override - public ApplicationGatewayRedirectConfigurationImpl withTargetListener(String name) { - if (name == null) { - this.innerModel().withTargetListener(null); - } else { - SubResource ref = new SubResource().withId(this.parent().futureResourceId() + "/httpListeners/" + name); - this.innerModel().withTargetListener(ref).withTargetUrl(null); - } - - return this; - } - - @Override - public ApplicationGatewayRedirectConfigurationImpl withoutTargetListener() { - this.innerModel().withTargetListener(null); - return this; - } - - @Override - public ApplicationGatewayRedirectConfigurationImpl withoutTargetUrl() { - this.innerModel().withTargetUrl(null); - return this; - } - - @Override - public ApplicationGatewayRedirectConfigurationImpl withType(ApplicationGatewayRedirectType redirectType) { - this.innerModel().withRedirectType(redirectType); - return this; - } - - @Override - public ApplicationGatewayRedirectConfigurationImpl withPathIncluded() { - this.innerModel().withIncludePath(true); - return this; - } - - @Override - public ApplicationGatewayRedirectConfigurationImpl withQueryStringIncluded() { - this.innerModel().withIncludeQueryString(true); - return this; - } - - @Override - public ApplicationGatewayRedirectConfigurationImpl withoutPathIncluded() { - this.innerModel().withIncludePath(null); - return this; - } - - @Override - public ApplicationGatewayRedirectConfigurationImpl withoutQueryStringIncluded() { - this.innerModel().withIncludeQueryString(null); - return this; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ApplicationGatewayRequestRoutingRuleImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ApplicationGatewayRequestRoutingRuleImpl.java deleted file mode 100644 index 009718c5c463..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ApplicationGatewayRequestRoutingRuleImpl.java +++ /dev/null @@ -1,432 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.management.SubResource; -import com.azure.resourcemanager.network.models.ApplicationGateway; -import com.azure.resourcemanager.network.models.ApplicationGatewayBackend; -import com.azure.resourcemanager.network.models.ApplicationGatewayBackendAddress; -import com.azure.resourcemanager.network.models.ApplicationGatewayBackendHttpConfiguration; -import com.azure.resourcemanager.network.models.ApplicationGatewayListener; -import com.azure.resourcemanager.network.models.ApplicationGatewayProtocol; -import com.azure.resourcemanager.network.models.ApplicationGatewayRedirectConfiguration; -import com.azure.resourcemanager.network.models.ApplicationGatewayRequestRoutingRule; -import com.azure.resourcemanager.network.models.ApplicationGatewayRequestRoutingRuleType; -import com.azure.resourcemanager.network.models.ApplicationGatewaySslCertificate; -import com.azure.resourcemanager.network.models.ApplicationGatewayUrlPathMap; -import com.azure.resourcemanager.network.models.PublicIpAddress; -import com.azure.resourcemanager.network.fluent.models.ApplicationGatewayRequestRoutingRuleInner; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils; -import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.ChildResourceImpl; -import reactor.core.publisher.Mono; - -import java.io.File; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; - -/** Implementation for ApplicationGatewayRequestRoutingRule. */ -class ApplicationGatewayRequestRoutingRuleImpl - extends ChildResourceImpl - implements ApplicationGatewayRequestRoutingRule, - ApplicationGatewayRequestRoutingRule.Definition< - ApplicationGateway.DefinitionStages.WithRequestRoutingRuleOrCreate>, - ApplicationGatewayRequestRoutingRule.UpdateDefinition, - ApplicationGatewayRequestRoutingRule.Update { - - ApplicationGatewayRequestRoutingRuleImpl( - ApplicationGatewayRequestRoutingRuleInner inner, ApplicationGatewayImpl parent) { - super(inner, parent); - } - - private Boolean associateWithPublicFrontend = null; - - // Getters - - @Override - public Collection backendAddresses() { - Collection addresses = new ArrayList<>(); - ApplicationGatewayBackend backend = this.backend(); - if (backend != null && backend.addresses() != null) { - addresses = backend.addresses(); - } - return Collections.unmodifiableCollection(addresses); - } - - @Override - public ApplicationGatewayUrlPathMap urlPathMap() { - SubResource urlMapRef = this.innerModel().urlPathMap(); - if (urlMapRef != null) { - String urlMapName = ResourceUtils.nameFromResourceId(urlMapRef.id()); - return this.parent().urlPathMaps().get(urlMapName); - } else { - return null; - } - } - - @Override - public boolean cookieBasedAffinity() { - final ApplicationGatewayBackendHttpConfiguration backendConfig = this.backendHttpConfiguration(); - return (backendConfig != null) ? backendConfig.cookieBasedAffinity() : false; - } - - @Override - public int backendPort() { - final ApplicationGatewayBackendHttpConfiguration backendConfig = this.backendHttpConfiguration(); - return (backendConfig != null) ? backendConfig.port() : 0; - } - - @Override - public boolean requiresServerNameIndication() { - final ApplicationGatewayListener listener = this.listener(); - return (listener != null) ? listener.requiresServerNameIndication() : false; - } - - @Override - public String hostname() { - final ApplicationGatewayListener listener = this.listener(); - return (listener != null) ? listener.hostname() : null; - } - - @Override - public int frontendPort() { - final ApplicationGatewayListener listener = this.listener(); - return (listener != null) ? listener.frontendPortNumber() : 0; - } - - @Override - public ApplicationGatewaySslCertificate sslCertificate() { - final ApplicationGatewayListener listener = this.listener(); - return (listener != null) ? listener.sslCertificate() : null; - } - - @Override - public ApplicationGatewayProtocol frontendProtocol() { - final ApplicationGatewayListener listener = this.listener(); - return (listener != null) ? listener.protocol() : null; - } - - @Override - public String publicIpAddressId() { - final ApplicationGatewayListener listener = this.listener(); - return (listener != null) ? listener.publicIpAddressId() : null; - } - - @Override - public PublicIpAddress getPublicIpAddress() { - return this.getPublicIpAddressAsync().block(); - } - - @Override - public Mono getPublicIpAddressAsync() { - String pipId = this.publicIpAddressId(); - return pipId == null ? Mono.empty() : this.parent().manager().publicIpAddresses().getByIdAsync(pipId); - } - - @Override - public String name() { - return this.innerModel().name(); - } - - @Override - public ApplicationGatewayRequestRoutingRuleType ruleType() { - return this.innerModel().ruleType(); - } - - @Override - public ApplicationGatewayBackend backend() { - SubResource backendRef = this.innerModel().backendAddressPool(); - if (backendRef != null) { - String backendName = ResourceUtils.nameFromResourceId(backendRef.id()); - return this.parent().backends().get(backendName); - } else { - return null; - } - } - - @Override - public ApplicationGatewayBackendHttpConfigurationImpl backendHttpConfiguration() { - SubResource configRef = this.innerModel().backendHttpSettings(); - if (configRef != null) { - String configName = ResourceUtils.nameFromResourceId(configRef.id()); - return (ApplicationGatewayBackendHttpConfigurationImpl) - this.parent().backendHttpConfigurations().get(configName); - } else { - return null; - } - } - - @Override - public ApplicationGatewayListenerImpl listener() { - SubResource listenerRef = this.innerModel().httpListener(); - if (listenerRef != null) { - String listenerName = ResourceUtils.nameFromResourceId(listenerRef.id()); - return (ApplicationGatewayListenerImpl) this.parent().listeners().get(listenerName); - } else { - return null; - } - } - - @Override - public ApplicationGatewayRedirectConfiguration redirectConfiguration() { - SubResource ref = this.innerModel().redirectConfiguration(); - if (ref == null) { - return null; - } else { - return this.parent().redirectConfigurations().get(ResourceUtils.nameFromResourceId(ref.id())); - } - } - - // Verbs - - @Override - public ApplicationGatewayImpl attach() { - return this.parent().withRequestRoutingRule(this); - } - - // Withers - - // --- Frontend handling - - @Override - public ApplicationGatewayRequestRoutingRuleImpl fromPublicFrontend() { - this.associateWithPublicFrontend = true; - return this; - } - - @Override - public ApplicationGatewayRequestRoutingRuleImpl fromPrivateFrontend() { - this.associateWithPublicFrontend = false; - return this; - } - - @Override - public ApplicationGatewayRequestRoutingRuleImpl fromFrontendHttpPort(int portNumber) { - return this.fromFrontendPort(portNumber, ApplicationGatewayProtocol.HTTP, null); - } - - @Override - public ApplicationGatewayRequestRoutingRuleImpl fromFrontendHttpsPort(int portNumber) { - return this.fromFrontendPort(portNumber, ApplicationGatewayProtocol.HTTPS, null); - } - - // --- Backend HTTP config handling - - @Override - public ApplicationGatewayRequestRoutingRuleImpl toBackendHttpConfiguration(String name) { - SubResource httpConfigRef = - new SubResource().withId(this.parent().futureResourceId() + "/backendHttpSettingsCollection/" + name); - this.innerModel().withBackendHttpSettings(httpConfigRef); - return this; - } - - private ApplicationGatewayBackendHttpConfigurationImpl ensureBackendHttpConfig() { - ApplicationGatewayBackendHttpConfigurationImpl config = this.backendHttpConfiguration(); - if (config == null) { - final String name = this.parent().manager().resourceManager().internalContext() - .randomResourceName("bckcfg", 11); - config = this.parent().defineBackendHttpConfiguration(name); - config.attach(); - this.toBackendHttpConfiguration(name); - } - return config; - } - - @Override - public ApplicationGatewayRequestRoutingRuleImpl toBackendHttpPort(int portNumber) { - String name = this.parent().manager().resourceManager().internalContext().randomResourceName("backcfg", 12); - this.parent().defineBackendHttpConfiguration(name).withPort(portNumber).attach(); - return this.toBackendHttpConfiguration(name); - } - - @Override - public ApplicationGatewayRequestRoutingRuleImpl withCookieBasedAffinity() { - this.parent().updateBackendHttpConfiguration(ensureBackendHttpConfig().name()).withCookieBasedAffinity(); - return this; - } - - @Override - public ApplicationGatewayRequestRoutingRuleImpl withoutCookieBasedAffinity() { - this.parent().updateBackendHttpConfiguration(ensureBackendHttpConfig().name()).withoutCookieBasedAffinity(); - return this; - } - - // --- Listener handling - - @Override - public ApplicationGatewayRequestRoutingRuleImpl fromListener(String name) { - SubResource listenerRef = new SubResource().withId(this.parent().futureResourceId() + "/HTTPListeners/" + name); - this.innerModel().withHttpListener(listenerRef); - return this; - } - - private ApplicationGatewayRequestRoutingRuleImpl fromFrontendPort( - int portNumber, ApplicationGatewayProtocol protocol, String name) { - // Verify no conflicting listener exists - ApplicationGatewayListenerImpl listenerByPort = - (ApplicationGatewayListenerImpl) this.parent().listenerByPortNumber(portNumber); - ApplicationGatewayListenerImpl listenerByName = null; - if (name != null) { - listenerByName = (ApplicationGatewayListenerImpl) this.parent().listeners().get(name); - } - - ApplicationGatewayImpl.CreationState needToCreate = - this.parent().needToCreate(listenerByName, listenerByPort, name); - if (needToCreate == ApplicationGatewayImpl.CreationState.NeedToCreate) { - // If no listener exists for the requested port number yet and the name, create one - if (name == null) { - name = this.parent().manager().resourceManager().internalContext().randomResourceName("listener", 13); - } - - listenerByPort = this.parent().defineListener(name).withFrontendPort(portNumber); - - // Determine protocol - if (ApplicationGatewayProtocol.HTTP.equals(protocol)) { - listenerByPort.withHttp(); - } else if (ApplicationGatewayProtocol.HTTPS.equals(protocol)) { - listenerByPort.withHttps(); - } - - // Determine frontend - if (Boolean.TRUE.equals(this.associateWithPublicFrontend)) { - listenerByPort.withPublicFrontend(); - this.parent().withNewPublicIpAddress(); - } else if (Boolean.FALSE.equals(this.associateWithPublicFrontend)) { - listenerByPort.withPrivateFrontend(); - } - this.associateWithPublicFrontend = null; - - listenerByPort.attach(); - return this.fromListener(listenerByPort.name()); - } else { - // If matching listener already exists then fail - return null; - } - } - - private ApplicationGatewayListenerImpl ensureListener() { - ApplicationGatewayListenerImpl listener = this.listener(); - if (listener == null) { - final String name = this.parent().manager().resourceManager().internalContext() - .randomResourceName("listener", 13); - listener = this.parent().defineListener(name); - listener.attach(); - this.fromListener(name); - } - return listener; - } - - @Override - public ApplicationGatewayRequestRoutingRuleImpl withSslCertificate(String name) { - this.parent().updateListener(ensureListener().name()).withSslCertificate(name); - return this; - } - - @Override - public ApplicationGatewayRequestRoutingRuleImpl withSslCertificateFromKeyVaultSecretId(String keyVaultSecretId) { - this.parent().updateListener(ensureListener().name()).withSslCertificateFromKeyVaultSecretId(keyVaultSecretId); - return this; - } - - @Override - public ApplicationGatewayRequestRoutingRuleImpl withSslCertificateFromPfxFile(File pfxFile) throws IOException { - this.parent().updateListener(ensureListener().name()).withSslCertificateFromPfxFile(pfxFile); - return this; - } - - @Override - public ApplicationGatewayRequestRoutingRuleImpl withSslCertificatePassword(String password) { - this.parent().updateListener(ensureListener().name()).withSslCertificatePassword(password); - return this; - } - - @Override - public ApplicationGatewayRequestRoutingRuleImpl withHostname(String hostName) { - this.parent().updateListener(ensureListener().name()).withHostname(hostName); - return this; - } - - @Override - public ApplicationGatewayRequestRoutingRuleImpl withServerNameIndication() { - this.parent().updateListener(ensureListener().name()).withServerNameIndication(); - return this; - } - - @Override - public ApplicationGatewayRequestRoutingRuleImpl withoutServerNameIndication() { - this.parent().updateListener(ensureListener().name()).withoutServerNameIndication(); - return this; - } - - // --- Backend handling - - private ApplicationGatewayBackendImpl ensureBackend() { - ApplicationGatewayBackendImpl backend = (ApplicationGatewayBackendImpl) this.backend(); - if (backend == null) { - backend = this.parent().ensureUniqueBackend(); - this.toBackend(backend.name()); - } - - return backend; - } - - @Override - public ApplicationGatewayRequestRoutingRuleImpl toBackend(String name) { - this.innerModel().withBackendAddressPool(this.parent().ensureBackendRef(name)); - return this; - } - - @Override - public ApplicationGatewayRequestRoutingRuleImpl toBackendIPAddress(String ipAddress) { - this.parent().updateBackend(ensureBackend().name()).withIPAddress(ipAddress); - return this; - } - - @Override - public ApplicationGatewayRequestRoutingRuleImpl toBackendIPAddresses(String... ipAddresses) { - if (ipAddresses != null) { - for (String ipAddress : ipAddresses) { - this.toBackendIPAddress(ipAddress); - } - } - return this; - } - - @Override - public ApplicationGatewayRequestRoutingRuleImpl toBackendFqdn(String fqdn) { - this.parent().updateBackend(ensureBackend().name()).withFqdn(fqdn); - return this; - } - - @Override - public ApplicationGatewayRequestRoutingRuleImpl withRedirectConfiguration(String name) { - if (name == null) { - this.innerModel().withRedirectConfiguration(null); - } else { - SubResource ref = - new SubResource().withId(this.parent().futureResourceId() + "/redirectConfigurations/" + name); - this.innerModel().withRedirectConfiguration(ref).withBackendAddressPool(null).withBackendHttpSettings(null); - } - return this; - } - - @Override - public ApplicationGatewayRequestRoutingRuleImpl withoutRedirectConfiguration() { - this.innerModel().withRedirectConfiguration(null); - return this; - } - - @Override - public DefinitionStages.WithAttach - withUrlPathMap(String urlPathMapName) { - if (urlPathMapName == null) { - this.innerModel().withUrlPathMap(null); - } else { - SubResource ref = - new SubResource().withId(this.parent().futureResourceId() + "/urlPathMaps/" + urlPathMapName); - this.innerModel().withUrlPathMap(ref); - } - return this; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ApplicationGatewaySslCertificateImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ApplicationGatewaySslCertificateImpl.java deleted file mode 100644 index c6e8a11c8577..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ApplicationGatewaySslCertificateImpl.java +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.resourcemanager.network.models.ApplicationGateway; -import com.azure.resourcemanager.network.models.ApplicationGatewaySslCertificate; -import com.azure.resourcemanager.network.fluent.models.ApplicationGatewaySslCertificateInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.ChildResourceImpl; -import java.io.File; -import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.util.Base64; - -/** Implementation for ApplicationGatewaySslCertificate. */ -class ApplicationGatewaySslCertificateImpl - extends ChildResourceImpl - implements ApplicationGatewaySslCertificate, - ApplicationGatewaySslCertificate.Definition, - ApplicationGatewaySslCertificate.UpdateDefinition, - ApplicationGatewaySslCertificate.Update { - - ApplicationGatewaySslCertificateImpl(ApplicationGatewaySslCertificateInner inner, ApplicationGatewayImpl parent) { - super(inner, parent); - } - - // Helpers - - // Getters - - @Override - public String name() { - return this.innerModel().name(); - } - - @Override - public String publicData() { - return this.innerModel().publicCertData(); - } - - @Override - public String keyVaultSecretId() { - return this.innerModel().keyVaultSecretId(); - } - - // Verbs - - @Override - public ApplicationGatewayImpl attach() { - return this.parent().withSslCertificate(this); - } - - // Withers - - @Override - public ApplicationGatewaySslCertificateImpl withPfxFromBytes(byte[] pfxData) { - String encoded = new String(Base64.getEncoder().encode(pfxData), StandardCharsets.UTF_8); - this.innerModel().withData(encoded); - return this; - } - - @Override - public ApplicationGatewaySslCertificateImpl withPfxFromFile(File pfxFile) throws IOException { - if (pfxFile == null) { - return null; - } - - byte[] content = Files.readAllBytes(pfxFile.toPath()); - return withPfxFromBytes(content); - } - - @Override - public ApplicationGatewaySslCertificateImpl withPfxPassword(String password) { - this.innerModel().withPassword(password); - return this; - } - - @Override - public ApplicationGatewaySslCertificateImpl withKeyVaultSecretId(String keyVaultSecretId) { - this.innerModel().withKeyVaultSecretId(keyVaultSecretId); - return this; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ApplicationGatewayUrlPathMapImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ApplicationGatewayUrlPathMapImpl.java deleted file mode 100644 index 6db65dace682..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ApplicationGatewayUrlPathMapImpl.java +++ /dev/null @@ -1,175 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.management.SubResource; -import com.azure.resourcemanager.network.models.ApplicationGateway; -import com.azure.resourcemanager.network.models.ApplicationGatewayBackend; -import com.azure.resourcemanager.network.models.ApplicationGatewayBackendHttpConfiguration; -import com.azure.resourcemanager.network.models.ApplicationGatewayPathRule; -import com.azure.resourcemanager.network.models.ApplicationGatewayRedirectConfiguration; -import com.azure.resourcemanager.network.models.ApplicationGatewayUrlPathMap; -import com.azure.resourcemanager.network.fluent.models.ApplicationGatewayPathRuleInner; -import com.azure.resourcemanager.network.fluent.models.ApplicationGatewayUrlPathMapInner; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils; -import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.ChildResourceImpl; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; - -/** Implementation for application gateway URL path map. */ -class ApplicationGatewayUrlPathMapImpl - extends ChildResourceImpl - implements ApplicationGatewayUrlPathMap, - ApplicationGatewayUrlPathMap.Definition, - ApplicationGatewayUrlPathMap.UpdateDefinition, - ApplicationGatewayUrlPathMap.Update { - private Map pathRules; - - ApplicationGatewayUrlPathMapImpl(ApplicationGatewayUrlPathMapInner inner, ApplicationGatewayImpl parent) { - super(inner, parent); - initializePathRules(); - } - - private void initializePathRules() { - pathRules = new HashMap<>(); - if (innerModel().pathRules() != null) { - for (ApplicationGatewayPathRuleInner inner : innerModel().pathRules()) { - pathRules.put(inner.name(), new ApplicationGatewayPathRuleImpl(inner, this)); - } - } - } - - // Getters - @Override - public String name() { - return this.innerModel().name(); - } - - @Override - public Map pathRules() { - return Collections.unmodifiableMap(pathRules); - } - - @Override - public ApplicationGatewayBackend defaultBackend() { - SubResource backendRef = this.innerModel().defaultBackendAddressPool(); - return (backendRef != null) - ? this.parent().backends().get(ResourceUtils.nameFromResourceId(backendRef.id())) - : null; - } - - @Override - public ApplicationGatewayBackendHttpConfiguration defaultBackendHttpConfiguration() { - SubResource backendHttpConfigRef = this.innerModel().defaultBackendHttpSettings(); - return (backendHttpConfigRef != null) - ? this.parent().backendHttpConfigurations().get(ResourceUtils.nameFromResourceId(backendHttpConfigRef.id())) - : null; - } - - @Override - public ApplicationGatewayRedirectConfiguration defaultRedirectConfiguration() { - SubResource redirectRef = this.innerModel().defaultRedirectConfiguration(); - return (redirectRef != null) - ? this.parent().redirectConfigurations().get(ResourceUtils.nameFromResourceId(redirectRef.id())) - : null; - } - - // Verbs - - @Override - public ApplicationGatewayImpl attach() { - return this.parent().withUrlPathMap(this); - } - - @Override - public ApplicationGatewayUrlPathMapImpl toBackendHttpConfiguration(String name) { - SubResource httpConfigRef = - new SubResource().withId(this.parent().futureResourceId() + "/backendHttpSettingsCollection/" + name); - this.innerModel().withDefaultBackendHttpSettings(httpConfigRef); - return this; - } - - @Override - public ApplicationGatewayUrlPathMapImpl toBackendHttpPort(int portNumber) { - String name = this.parent().manager().resourceManager().internalContext().randomResourceName("backcfg", 12); - this.parent().defineBackendHttpConfiguration(name).withPort(portNumber).attach(); - return this.toBackendHttpConfiguration(name); - } - - @Override - public ApplicationGatewayUrlPathMapImpl toBackend(String name) { - this.innerModel().withDefaultBackendAddressPool(this.parent().ensureBackendRef(name)); - return this; - } - - @Override - public ApplicationGatewayUrlPathMapImpl withRedirectConfiguration(String name) { - if (name == null) { - this.innerModel().withDefaultRedirectConfiguration(null); - } else { - SubResource ref = - new SubResource().withId(this.parent().futureResourceId() + "/redirectConfigurations/" + name); - this - .innerModel() - .withDefaultRedirectConfiguration(ref) - .withDefaultBackendAddressPool(null) - .withDefaultBackendHttpSettings(null); - } - return this; - } - - @Override - public ApplicationGatewayPathRuleImpl definePathRule(String name) { - return new ApplicationGatewayPathRuleImpl(new ApplicationGatewayPathRuleInner().withName(name), this); - } - - ApplicationGatewayUrlPathMapImpl withPathRule(ApplicationGatewayPathRuleImpl pathRule) { - if (pathRule != null) { - if (innerModel().pathRules() == null) { - innerModel().withPathRules(new ArrayList()); - } - innerModel().pathRules().add(pathRule.innerModel()); - } - return this; - } - - @Override - public ApplicationGatewayUrlPathMapImpl fromListener(String name) { - SubResource listenerRef = new SubResource().withId(this.parent().futureResourceId() + "/HTTPListeners/" + name); - parent().requestRoutingRules().get(this.name()).innerModel().withHttpListener(listenerRef); - return this; - } - - @Override - public ApplicationGatewayUrlPathMapImpl toBackendIPAddress(String ipAddress) { - this.parent().updateBackend(ensureBackend().name()).withIPAddress(ipAddress); - return this; - } - - @Override - public ApplicationGatewayUrlPathMapImpl toBackendIPAddresses(String... ipAddresses) { - if (ipAddresses != null) { - for (String ipAddress : ipAddresses) { - this.toBackendIPAddress(ipAddress); - } - } - return this; - } - - @Override - public ApplicationGatewayUrlPathMapImpl toBackendFqdn(String fqdn) { - this.parent().updateBackend(ensureBackend().name()).withFqdn(fqdn); - return this; - } - - private ApplicationGatewayBackendImpl ensureBackend() { - ApplicationGatewayBackendImpl backend = (ApplicationGatewayBackendImpl) this.defaultBackend(); - if (backend == null) { - backend = this.parent().ensureUniqueBackend(); - this.toBackend(backend.name()); - } - return backend; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ApplicationGatewaysClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ApplicationGatewaysClientImpl.java deleted file mode 100644 index 3a8b19a29b16..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ApplicationGatewaysClientImpl.java +++ /dev/null @@ -1,3385 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.ApplicationGatewaysClient; -import com.azure.resourcemanager.network.fluent.models.ApplicationGatewayAvailableSslOptionsInner; -import com.azure.resourcemanager.network.fluent.models.ApplicationGatewayAvailableWafRuleSetsResultInner; -import com.azure.resourcemanager.network.fluent.models.ApplicationGatewayBackendHealthInner; -import com.azure.resourcemanager.network.fluent.models.ApplicationGatewayInner; -import com.azure.resourcemanager.network.fluent.models.ApplicationGatewaySslPredefinedPolicyInner; -import com.azure.resourcemanager.network.models.ApplicationGatewayAvailableSslPredefinedPolicies; -import com.azure.resourcemanager.network.models.ApplicationGatewayListResult; -import com.azure.resourcemanager.network.models.ErrorException; -import com.azure.resourcemanager.network.models.TagsObject; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import java.util.List; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ApplicationGatewaysClient. */ -public final class ApplicationGatewaysClientImpl - implements InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete, - ApplicationGatewaysClient { - private final ClientLogger logger = new ClientLogger(ApplicationGatewaysClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final ApplicationGatewaysService service; - - /** The service client containing this operation class. */ - private final NetworkManagementClientImpl client; - - /** - * Initializes an instance of ApplicationGatewaysClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ApplicationGatewaysClientImpl(NetworkManagementClientImpl client) { - this.service = - RestProxy.create(ApplicationGatewaysService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for NetworkManagementClientApplicationGateways to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "NetworkManagementCli") - private interface ApplicationGatewaysService { - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/applicationGateways/{applicationGatewayName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("applicationGatewayName") String applicationGatewayName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/applicationGateways/{applicationGatewayName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("applicationGatewayName") String applicationGatewayName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/applicationGateways/{applicationGatewayName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("applicationGatewayName") String applicationGatewayName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") ApplicationGatewayInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/applicationGateways/{applicationGatewayName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> updateTags( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("applicationGatewayName") String applicationGatewayName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") TagsObject parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/applicationGateways") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGateways") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/applicationGateways/{applicationGatewayName}/start") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> start( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("applicationGatewayName") String applicationGatewayName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/applicationGateways/{applicationGatewayName}/stop") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> stop( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("applicationGatewayName") String applicationGatewayName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/applicationGateways/{applicationGatewayName}/backendhealth") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> backendHealth( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("applicationGatewayName") String applicationGatewayName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("$expand") String expand, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableServerVariables") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ErrorException.class) - Mono>> listAvailableServerVariables( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableRequestHeaders") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ErrorException.class) - Mono>> listAvailableRequestHeaders( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableResponseHeaders") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ErrorException.class) - Mono>> listAvailableResponseHeaders( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableWafRuleSets") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAvailableWafRuleSets( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAvailableSslOptions( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default" - + "/predefinedPolicies") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAvailableSslPredefinedPolicies( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default" - + "/predefinedPolicies/{predefinedPolicyName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getSslPredefinedPolicy( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("predefinedPolicyName") String predefinedPolicyName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAllNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAvailableSslPredefinedPoliciesNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Deletes the specified application gateway. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync( - String resourceGroupName, String applicationGatewayName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (applicationGatewayName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - applicationGatewayName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the specified application gateway. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String applicationGatewayName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (applicationGatewayName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - applicationGatewayName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Deletes the specified application gateway. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String applicationGatewayName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, applicationGatewayName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deletes the specified application gateway. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String applicationGatewayName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, applicationGatewayName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes the specified application gateway. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete(String resourceGroupName, String applicationGatewayName) { - return beginDeleteAsync(resourceGroupName, applicationGatewayName).getSyncPoller(); - } - - /** - * Deletes the specified application gateway. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String applicationGatewayName, Context context) { - return beginDeleteAsync(resourceGroupName, applicationGatewayName, context).getSyncPoller(); - } - - /** - * Deletes the specified application gateway. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String applicationGatewayName) { - return beginDeleteAsync(resourceGroupName, applicationGatewayName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified application gateway. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String applicationGatewayName, Context context) { - return beginDeleteAsync(resourceGroupName, applicationGatewayName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified application gateway. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String applicationGatewayName) { - deleteAsync(resourceGroupName, applicationGatewayName).block(); - } - - /** - * Deletes the specified application gateway. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String applicationGatewayName, Context context) { - deleteAsync(resourceGroupName, applicationGatewayName, context).block(); - } - - /** - * Gets the specified application gateway. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified application gateway. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String applicationGatewayName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (applicationGatewayName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - applicationGatewayName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the specified application gateway. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified application gateway. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String applicationGatewayName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (applicationGatewayName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - applicationGatewayName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets the specified application gateway. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified application gateway. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync( - String resourceGroupName, String applicationGatewayName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, applicationGatewayName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the specified application gateway. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified application gateway. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ApplicationGatewayInner getByResourceGroup(String resourceGroupName, String applicationGatewayName) { - return getByResourceGroupAsync(resourceGroupName, applicationGatewayName).block(); - } - - /** - * Gets the specified application gateway. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified application gateway. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String applicationGatewayName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, applicationGatewayName, context).block(); - } - - /** - * Creates or updates the specified application gateway. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @param parameters Parameters supplied to the create or update application gateway operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return application gateway resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (applicationGatewayName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - applicationGatewayName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates the specified application gateway. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @param parameters Parameters supplied to the create or update application gateway operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return application gateway resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (applicationGatewayName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - applicationGatewayName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Creates or updates the specified application gateway. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @param parameters Parameters supplied to the create or update application gateway operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return application gateway resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, ApplicationGatewayInner> beginCreateOrUpdateAsync( - String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, applicationGatewayName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ApplicationGatewayInner.class, - ApplicationGatewayInner.class, - Context.NONE); - } - - /** - * Creates or updates the specified application gateway. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @param parameters Parameters supplied to the create or update application gateway operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return application gateway resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, ApplicationGatewayInner> beginCreateOrUpdateAsync( - String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, applicationGatewayName, parameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ApplicationGatewayInner.class, - ApplicationGatewayInner.class, - context); - } - - /** - * Creates or updates the specified application gateway. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @param parameters Parameters supplied to the create or update application gateway operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return application gateway resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, ApplicationGatewayInner> beginCreateOrUpdate( - String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, applicationGatewayName, parameters).getSyncPoller(); - } - - /** - * Creates or updates the specified application gateway. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @param parameters Parameters supplied to the create or update application gateway operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return application gateway resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, ApplicationGatewayInner> beginCreateOrUpdate( - String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, applicationGatewayName, parameters, context).getSyncPoller(); - } - - /** - * Creates or updates the specified application gateway. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @param parameters Parameters supplied to the create or update application gateway operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return application gateway resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, applicationGatewayName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates the specified application gateway. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @param parameters Parameters supplied to the create or update application gateway operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return application gateway resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, applicationGatewayName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates the specified application gateway. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @param parameters Parameters supplied to the create or update application gateway operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return application gateway resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ApplicationGatewayInner createOrUpdate( - String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters) { - return createOrUpdateAsync(resourceGroupName, applicationGatewayName, parameters).block(); - } - - /** - * Creates or updates the specified application gateway. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @param parameters Parameters supplied to the create or update application gateway operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return application gateway resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ApplicationGatewayInner createOrUpdate( - String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters, Context context) { - return createOrUpdateAsync(resourceGroupName, applicationGatewayName, parameters, context).block(); - } - - /** - * Updates the specified application gateway tags. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @param parameters Parameters supplied to update application gateway tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return application gateway resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateTagsWithResponseAsync( - String resourceGroupName, String applicationGatewayName, TagsObject parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (applicationGatewayName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updateTags( - this.client.getEndpoint(), - resourceGroupName, - applicationGatewayName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates the specified application gateway tags. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @param parameters Parameters supplied to update application gateway tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return application gateway resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateTagsWithResponseAsync( - String resourceGroupName, String applicationGatewayName, TagsObject parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (applicationGatewayName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updateTags( - this.client.getEndpoint(), - resourceGroupName, - applicationGatewayName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Updates the specified application gateway tags. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @param parameters Parameters supplied to update application gateway tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return application gateway resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, ApplicationGatewayInner> beginUpdateTagsAsync( - String resourceGroupName, String applicationGatewayName, TagsObject parameters) { - Mono>> mono = - updateTagsWithResponseAsync(resourceGroupName, applicationGatewayName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ApplicationGatewayInner.class, - ApplicationGatewayInner.class, - Context.NONE); - } - - /** - * Updates the specified application gateway tags. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @param parameters Parameters supplied to update application gateway tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return application gateway resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, ApplicationGatewayInner> beginUpdateTagsAsync( - String resourceGroupName, String applicationGatewayName, TagsObject parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - updateTagsWithResponseAsync(resourceGroupName, applicationGatewayName, parameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ApplicationGatewayInner.class, - ApplicationGatewayInner.class, - context); - } - - /** - * Updates the specified application gateway tags. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @param parameters Parameters supplied to update application gateway tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return application gateway resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, ApplicationGatewayInner> beginUpdateTags( - String resourceGroupName, String applicationGatewayName, TagsObject parameters) { - return beginUpdateTagsAsync(resourceGroupName, applicationGatewayName, parameters).getSyncPoller(); - } - - /** - * Updates the specified application gateway tags. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @param parameters Parameters supplied to update application gateway tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return application gateway resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, ApplicationGatewayInner> beginUpdateTags( - String resourceGroupName, String applicationGatewayName, TagsObject parameters, Context context) { - return beginUpdateTagsAsync(resourceGroupName, applicationGatewayName, parameters, context).getSyncPoller(); - } - - /** - * Updates the specified application gateway tags. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @param parameters Parameters supplied to update application gateway tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return application gateway resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateTagsAsync( - String resourceGroupName, String applicationGatewayName, TagsObject parameters) { - return beginUpdateTagsAsync(resourceGroupName, applicationGatewayName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates the specified application gateway tags. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @param parameters Parameters supplied to update application gateway tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return application gateway resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateTagsAsync( - String resourceGroupName, String applicationGatewayName, TagsObject parameters, Context context) { - return beginUpdateTagsAsync(resourceGroupName, applicationGatewayName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates the specified application gateway tags. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @param parameters Parameters supplied to update application gateway tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return application gateway resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ApplicationGatewayInner updateTags( - String resourceGroupName, String applicationGatewayName, TagsObject parameters) { - return updateTagsAsync(resourceGroupName, applicationGatewayName, parameters).block(); - } - - /** - * Updates the specified application gateway tags. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @param parameters Parameters supplied to update application gateway tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return application gateway resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ApplicationGatewayInner updateTags( - String resourceGroupName, String applicationGatewayName, TagsObject parameters, Context context) { - return updateTagsAsync(resourceGroupName, applicationGatewayName, parameters, context).block(); - } - - /** - * Lists all application gateways in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListApplicationGateways API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all application gateways in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListApplicationGateways API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists all application gateways in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListApplicationGateways API service call. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists all application gateways in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListApplicationGateways API service call. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all application gateways in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListApplicationGateways API service call. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * Lists all application gateways in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListApplicationGateways API service call. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * Gets all the application gateways in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the application gateways in a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all the application gateways in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the application gateways in a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all the application gateways in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the application gateways in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listAllNextSinglePageAsync(nextLink)); - } - - /** - * Gets all the application gateways in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the application gateways in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listAllNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all the application gateways in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the application gateways in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Gets all the application gateways in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the application gateways in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Starts the specified application gateway. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> startWithResponseAsync( - String resourceGroupName, String applicationGatewayName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (applicationGatewayName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - return FluxUtil - .withContext( - context -> - service - .start( - this.client.getEndpoint(), - resourceGroupName, - applicationGatewayName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Starts the specified application gateway. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> startWithResponseAsync( - String resourceGroupName, String applicationGatewayName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (applicationGatewayName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - context = this.client.mergeContext(context); - return service - .start( - this.client.getEndpoint(), - resourceGroupName, - applicationGatewayName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Starts the specified application gateway. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginStartAsync(String resourceGroupName, String applicationGatewayName) { - Mono>> mono = startWithResponseAsync(resourceGroupName, applicationGatewayName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Starts the specified application gateway. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginStartAsync( - String resourceGroupName, String applicationGatewayName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - startWithResponseAsync(resourceGroupName, applicationGatewayName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Starts the specified application gateway. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginStart(String resourceGroupName, String applicationGatewayName) { - return beginStartAsync(resourceGroupName, applicationGatewayName).getSyncPoller(); - } - - /** - * Starts the specified application gateway. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginStart( - String resourceGroupName, String applicationGatewayName, Context context) { - return beginStartAsync(resourceGroupName, applicationGatewayName, context).getSyncPoller(); - } - - /** - * Starts the specified application gateway. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono startAsync(String resourceGroupName, String applicationGatewayName) { - return beginStartAsync(resourceGroupName, applicationGatewayName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Starts the specified application gateway. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono startAsync(String resourceGroupName, String applicationGatewayName, Context context) { - return beginStartAsync(resourceGroupName, applicationGatewayName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Starts the specified application gateway. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void start(String resourceGroupName, String applicationGatewayName) { - startAsync(resourceGroupName, applicationGatewayName).block(); - } - - /** - * Starts the specified application gateway. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void start(String resourceGroupName, String applicationGatewayName, Context context) { - startAsync(resourceGroupName, applicationGatewayName, context).block(); - } - - /** - * Stops the specified application gateway in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> stopWithResponseAsync( - String resourceGroupName, String applicationGatewayName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (applicationGatewayName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - return FluxUtil - .withContext( - context -> - service - .stop( - this.client.getEndpoint(), - resourceGroupName, - applicationGatewayName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Stops the specified application gateway in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> stopWithResponseAsync( - String resourceGroupName, String applicationGatewayName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (applicationGatewayName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - context = this.client.mergeContext(context); - return service - .stop( - this.client.getEndpoint(), - resourceGroupName, - applicationGatewayName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Stops the specified application gateway in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginStopAsync(String resourceGroupName, String applicationGatewayName) { - Mono>> mono = stopWithResponseAsync(resourceGroupName, applicationGatewayName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Stops the specified application gateway in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginStopAsync( - String resourceGroupName, String applicationGatewayName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - stopWithResponseAsync(resourceGroupName, applicationGatewayName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Stops the specified application gateway in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginStop(String resourceGroupName, String applicationGatewayName) { - return beginStopAsync(resourceGroupName, applicationGatewayName).getSyncPoller(); - } - - /** - * Stops the specified application gateway in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginStop( - String resourceGroupName, String applicationGatewayName, Context context) { - return beginStopAsync(resourceGroupName, applicationGatewayName, context).getSyncPoller(); - } - - /** - * Stops the specified application gateway in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono stopAsync(String resourceGroupName, String applicationGatewayName) { - return beginStopAsync(resourceGroupName, applicationGatewayName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Stops the specified application gateway in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono stopAsync(String resourceGroupName, String applicationGatewayName, Context context) { - return beginStopAsync(resourceGroupName, applicationGatewayName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Stops the specified application gateway in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void stop(String resourceGroupName, String applicationGatewayName) { - stopAsync(resourceGroupName, applicationGatewayName).block(); - } - - /** - * Stops the specified application gateway in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void stop(String resourceGroupName, String applicationGatewayName, Context context) { - stopAsync(resourceGroupName, applicationGatewayName, context).block(); - } - - /** - * Gets the backend health of the specified application gateway in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the backend health of the specified application gateway in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> backendHealthWithResponseAsync( - String resourceGroupName, String applicationGatewayName, String expand) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (applicationGatewayName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .backendHealth( - this.client.getEndpoint(), - resourceGroupName, - applicationGatewayName, - apiVersion, - this.client.getSubscriptionId(), - expand, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the backend health of the specified application gateway in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the backend health of the specified application gateway in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> backendHealthWithResponseAsync( - String resourceGroupName, String applicationGatewayName, String expand, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (applicationGatewayName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .backendHealth( - this.client.getEndpoint(), - resourceGroupName, - applicationGatewayName, - apiVersion, - this.client.getSubscriptionId(), - expand, - accept, - context); - } - - /** - * Gets the backend health of the specified application gateway in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the backend health of the specified application gateway in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, ApplicationGatewayBackendHealthInner> - beginBackendHealthAsync(String resourceGroupName, String applicationGatewayName, String expand) { - Mono>> mono = - backendHealthWithResponseAsync(resourceGroupName, applicationGatewayName, expand); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ApplicationGatewayBackendHealthInner.class, - ApplicationGatewayBackendHealthInner.class, - Context.NONE); - } - - /** - * Gets the backend health of the specified application gateway in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the backend health of the specified application gateway in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, ApplicationGatewayBackendHealthInner> - beginBackendHealthAsync( - String resourceGroupName, String applicationGatewayName, String expand, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - backendHealthWithResponseAsync(resourceGroupName, applicationGatewayName, expand, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ApplicationGatewayBackendHealthInner.class, - ApplicationGatewayBackendHealthInner.class, - context); - } - - /** - * Gets the backend health of the specified application gateway in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the backend health of the specified application gateway in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, ApplicationGatewayBackendHealthInner> - beginBackendHealth(String resourceGroupName, String applicationGatewayName, String expand) { - return beginBackendHealthAsync(resourceGroupName, applicationGatewayName, expand).getSyncPoller(); - } - - /** - * Gets the backend health of the specified application gateway in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the backend health of the specified application gateway in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, ApplicationGatewayBackendHealthInner> - beginBackendHealth(String resourceGroupName, String applicationGatewayName, String expand, Context context) { - return beginBackendHealthAsync(resourceGroupName, applicationGatewayName, expand, context).getSyncPoller(); - } - - /** - * Gets the backend health of the specified application gateway in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the backend health of the specified application gateway in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono backendHealthAsync( - String resourceGroupName, String applicationGatewayName, String expand) { - return beginBackendHealthAsync(resourceGroupName, applicationGatewayName, expand) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Gets the backend health of the specified application gateway in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the backend health of the specified application gateway in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono backendHealthAsync( - String resourceGroupName, String applicationGatewayName) { - final String expand = null; - return beginBackendHealthAsync(resourceGroupName, applicationGatewayName, expand) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Gets the backend health of the specified application gateway in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the backend health of the specified application gateway in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono backendHealthAsync( - String resourceGroupName, String applicationGatewayName, String expand, Context context) { - return beginBackendHealthAsync(resourceGroupName, applicationGatewayName, expand, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Gets the backend health of the specified application gateway in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the backend health of the specified application gateway in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ApplicationGatewayBackendHealthInner backendHealth( - String resourceGroupName, String applicationGatewayName, String expand) { - return backendHealthAsync(resourceGroupName, applicationGatewayName, expand).block(); - } - - /** - * Gets the backend health of the specified application gateway in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the backend health of the specified application gateway in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ApplicationGatewayBackendHealthInner backendHealth(String resourceGroupName, String applicationGatewayName) { - final String expand = null; - return backendHealthAsync(resourceGroupName, applicationGatewayName, expand).block(); - } - - /** - * Gets the backend health of the specified application gateway in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param applicationGatewayName The name of the application gateway. - * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the backend health of the specified application gateway in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ApplicationGatewayBackendHealthInner backendHealth( - String resourceGroupName, String applicationGatewayName, String expand, Context context) { - return backendHealthAsync(resourceGroupName, applicationGatewayName, expand, context).block(); - } - - /** - * Lists all available server variables. - * - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ApplicationGatewayAvailableServerVariables API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> listAvailableServerVariablesWithResponseAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listAvailableServerVariables( - this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all available server variables. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ApplicationGatewayAvailableServerVariables API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> listAvailableServerVariablesWithResponseAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listAvailableServerVariables( - this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context); - } - - /** - * Lists all available server variables. - * - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ApplicationGatewayAvailableServerVariables API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listAvailableServerVariablesAsync() { - return listAvailableServerVariablesWithResponseAsync() - .flatMap( - (Response> res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Lists all available server variables. - * - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ApplicationGatewayAvailableServerVariables API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public List listAvailableServerVariables() { - return listAvailableServerVariablesAsync().block(); - } - - /** - * Lists all available server variables. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ApplicationGatewayAvailableServerVariables API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response> listAvailableServerVariablesWithResponse(Context context) { - return listAvailableServerVariablesWithResponseAsync(context).block(); - } - - /** - * Lists all available request headers. - * - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ApplicationGatewayAvailableRequestHeaders API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> listAvailableRequestHeadersWithResponseAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listAvailableRequestHeaders( - this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all available request headers. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ApplicationGatewayAvailableRequestHeaders API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> listAvailableRequestHeadersWithResponseAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listAvailableRequestHeaders( - this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context); - } - - /** - * Lists all available request headers. - * - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ApplicationGatewayAvailableRequestHeaders API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listAvailableRequestHeadersAsync() { - return listAvailableRequestHeadersWithResponseAsync() - .flatMap( - (Response> res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Lists all available request headers. - * - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ApplicationGatewayAvailableRequestHeaders API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public List listAvailableRequestHeaders() { - return listAvailableRequestHeadersAsync().block(); - } - - /** - * Lists all available request headers. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ApplicationGatewayAvailableRequestHeaders API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response> listAvailableRequestHeadersWithResponse(Context context) { - return listAvailableRequestHeadersWithResponseAsync(context).block(); - } - - /** - * Lists all available response headers. - * - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ApplicationGatewayAvailableResponseHeaders API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> listAvailableResponseHeadersWithResponseAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listAvailableResponseHeaders( - this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all available response headers. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ApplicationGatewayAvailableResponseHeaders API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> listAvailableResponseHeadersWithResponseAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listAvailableResponseHeaders( - this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context); - } - - /** - * Lists all available response headers. - * - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ApplicationGatewayAvailableResponseHeaders API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listAvailableResponseHeadersAsync() { - return listAvailableResponseHeadersWithResponseAsync() - .flatMap( - (Response> res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Lists all available response headers. - * - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ApplicationGatewayAvailableResponseHeaders API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public List listAvailableResponseHeaders() { - return listAvailableResponseHeadersAsync().block(); - } - - /** - * Lists all available response headers. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ApplicationGatewayAvailableResponseHeaders API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response> listAvailableResponseHeadersWithResponse(Context context) { - return listAvailableResponseHeadersWithResponseAsync(context).block(); - } - - /** - * Lists all available web application firewall rule sets. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ApplicationGatewayAvailableWafRuleSets API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> - listAvailableWafRuleSetsWithResponseAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listAvailableWafRuleSets( - this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all available web application firewall rule sets. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ApplicationGatewayAvailableWafRuleSets API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAvailableWafRuleSetsWithResponseAsync( - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listAvailableWafRuleSets( - this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context); - } - - /** - * Lists all available web application firewall rule sets. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ApplicationGatewayAvailableWafRuleSets API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listAvailableWafRuleSetsAsync() { - return listAvailableWafRuleSetsWithResponseAsync() - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Lists all available web application firewall rule sets. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ApplicationGatewayAvailableWafRuleSets API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ApplicationGatewayAvailableWafRuleSetsResultInner listAvailableWafRuleSets() { - return listAvailableWafRuleSetsAsync().block(); - } - - /** - * Lists all available web application firewall rule sets. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ApplicationGatewayAvailableWafRuleSets API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listAvailableWafRuleSetsWithResponse( - Context context) { - return listAvailableWafRuleSetsWithResponseAsync(context).block(); - } - - /** - * Lists available Ssl options for configuring Ssl policy. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ApplicationGatewayAvailableSslOptions API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listAvailableSslOptionsWithResponseAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listAvailableSslOptions( - this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists available Ssl options for configuring Ssl policy. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ApplicationGatewayAvailableSslOptions API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAvailableSslOptionsWithResponseAsync( - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listAvailableSslOptions( - this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context); - } - - /** - * Lists available Ssl options for configuring Ssl policy. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ApplicationGatewayAvailableSslOptions API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listAvailableSslOptionsAsync() { - return listAvailableSslOptionsWithResponseAsync() - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Lists available Ssl options for configuring Ssl policy. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ApplicationGatewayAvailableSslOptions API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ApplicationGatewayAvailableSslOptionsInner listAvailableSslOptions() { - return listAvailableSslOptionsAsync().block(); - } - - /** - * Lists available Ssl options for configuring Ssl policy. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ApplicationGatewayAvailableSslOptions API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listAvailableSslOptionsWithResponse(Context context) { - return listAvailableSslOptionsWithResponseAsync(context).block(); - } - - /** - * Lists all SSL predefined policies for configuring Ssl policy. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ApplicationGatewayAvailableSslOptions API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listAvailableSslPredefinedPoliciesSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listAvailableSslPredefinedPolicies( - this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all SSL predefined policies for configuring Ssl policy. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ApplicationGatewayAvailableSslOptions API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listAvailableSslPredefinedPoliciesSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listAvailableSslPredefinedPolicies( - this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists all SSL predefined policies for configuring Ssl policy. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ApplicationGatewayAvailableSslOptions API service call. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAvailableSslPredefinedPoliciesAsync() { - return new PagedFlux<>( - () -> listAvailableSslPredefinedPoliciesSinglePageAsync(), - nextLink -> listAvailableSslPredefinedPoliciesNextSinglePageAsync(nextLink)); - } - - /** - * Lists all SSL predefined policies for configuring Ssl policy. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ApplicationGatewayAvailableSslOptions API service call. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAvailableSslPredefinedPoliciesAsync( - Context context) { - return new PagedFlux<>( - () -> listAvailableSslPredefinedPoliciesSinglePageAsync(context), - nextLink -> listAvailableSslPredefinedPoliciesNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all SSL predefined policies for configuring Ssl policy. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ApplicationGatewayAvailableSslOptions API service call. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAvailableSslPredefinedPolicies() { - return new PagedIterable<>(listAvailableSslPredefinedPoliciesAsync()); - } - - /** - * Lists all SSL predefined policies for configuring Ssl policy. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ApplicationGatewayAvailableSslOptions API service call. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAvailableSslPredefinedPolicies( - Context context) { - return new PagedIterable<>(listAvailableSslPredefinedPoliciesAsync(context)); - } - - /** - * Gets Ssl predefined policy with the specified policy name. - * - * @param predefinedPolicyName Name of Ssl predefined policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ssl predefined policy with the specified policy name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getSslPredefinedPolicyWithResponseAsync( - String predefinedPolicyName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (predefinedPolicyName == null) { - return Mono - .error(new IllegalArgumentException("Parameter predefinedPolicyName is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getSslPredefinedPolicy( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - predefinedPolicyName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets Ssl predefined policy with the specified policy name. - * - * @param predefinedPolicyName Name of Ssl predefined policy. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ssl predefined policy with the specified policy name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getSslPredefinedPolicyWithResponseAsync( - String predefinedPolicyName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (predefinedPolicyName == null) { - return Mono - .error(new IllegalArgumentException("Parameter predefinedPolicyName is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getSslPredefinedPolicy( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - predefinedPolicyName, - accept, - context); - } - - /** - * Gets Ssl predefined policy with the specified policy name. - * - * @param predefinedPolicyName Name of Ssl predefined policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ssl predefined policy with the specified policy name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getSslPredefinedPolicyAsync(String predefinedPolicyName) { - return getSslPredefinedPolicyWithResponseAsync(predefinedPolicyName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets Ssl predefined policy with the specified policy name. - * - * @param predefinedPolicyName Name of Ssl predefined policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ssl predefined policy with the specified policy name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ApplicationGatewaySslPredefinedPolicyInner getSslPredefinedPolicy(String predefinedPolicyName) { - return getSslPredefinedPolicyAsync(predefinedPolicyName).block(); - } - - /** - * Gets Ssl predefined policy with the specified policy name. - * - * @param predefinedPolicyName Name of Ssl predefined policy. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ssl predefined policy with the specified policy name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getSslPredefinedPolicyWithResponse( - String predefinedPolicyName, Context context) { - return getSslPredefinedPolicyWithResponseAsync(predefinedPolicyName, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListApplicationGateways API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListApplicationGateways API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListApplicationGateways API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAllNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listAllNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListApplicationGateways API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAllNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listAllNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ApplicationGatewayAvailableSslOptions API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listAvailableSslPredefinedPoliciesNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listAvailableSslPredefinedPoliciesNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ApplicationGatewayAvailableSslOptions API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listAvailableSslPredefinedPoliciesNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listAvailableSslPredefinedPoliciesNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ApplicationGatewaysImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ApplicationGatewaysImpl.java deleted file mode 100644 index 003829dca483..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ApplicationGatewaysImpl.java +++ /dev/null @@ -1,125 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.network.fluent.ApplicationGatewaysClient; -import com.azure.resourcemanager.network.fluent.models.ApplicationGatewayInner; -import com.azure.resourcemanager.network.models.ApplicationGateway; -import com.azure.resourcemanager.network.models.ApplicationGatewaySkuName; -import com.azure.resourcemanager.network.models.ApplicationGateways; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.TopLevelModifiableResourcesImpl; -import com.azure.resourcemanager.resources.fluentcore.exception.AggregatedManagementException; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; - -/** Implementation for ApplicationGateways. */ -public class ApplicationGatewaysImpl - extends TopLevelModifiableResourcesImpl< - ApplicationGateway, ApplicationGatewayImpl, ApplicationGatewayInner, ApplicationGatewaysClient, NetworkManager> - implements ApplicationGateways { - - public ApplicationGatewaysImpl(final NetworkManager networkManager) { - super(networkManager.serviceClient().getApplicationGateways(), networkManager); - } - - @Override - public ApplicationGatewayImpl define(String name) { - return wrapModel(name).withSize(ApplicationGatewaySkuName.STANDARD_SMALL).withInstanceCount(1); - } - - // Fluent model create helpers - - @Override - protected ApplicationGatewayImpl wrapModel(String name) { - ApplicationGatewayInner inner = new ApplicationGatewayInner(); - return new ApplicationGatewayImpl(name, inner, this.manager()); - } - - @Override - protected ApplicationGatewayImpl wrapModel(ApplicationGatewayInner inner) { - return (inner == null) ? null : new ApplicationGatewayImpl(inner.name(), inner, this.manager()); - } - - @Override - public void start(String... applicationGatewayResourceId) { - if (applicationGatewayResourceId == null) { - return; - } - this.startAsync(applicationGatewayResourceId).blockLast(); - } - - @Override - public Flux startAsync(String... applicationGatewayResourceId) { - return this.startAsync(new ArrayList<>(Arrays.asList(applicationGatewayResourceId))); - } - - @Override - public void stop(String... applicationGatewayResourceIds) { - if (applicationGatewayResourceIds == null) { - return; - } - this.stopAsync(applicationGatewayResourceIds).blockLast(); - } - - @Override - public void start(Collection applicationGatewayResourceIds) { - this.startAsync(applicationGatewayResourceIds).blockLast(); - } - - @Override - public void stop(Collection applicationGatewayResourceIds) { - this.stopAsync(applicationGatewayResourceIds).blockLast(); - } - - @Override - public Flux stopAsync(String... applicationGatewayResourceIds) { - return this.stopAsync(new ArrayList<>(Arrays.asList(applicationGatewayResourceIds))); - } - - @Override - public Flux startAsync(Collection applicationGatewayResourceIds) { - if (applicationGatewayResourceIds == null) { - return Flux.empty(); - } else { - return Flux - .fromIterable(applicationGatewayResourceIds) - .flatMapDelayError( - id -> { - final String resourceGroupName = ResourceUtils.groupFromResourceId(id); - final String name = ResourceUtils.nameFromResourceId(id); - return this.inner().startAsync(resourceGroupName, name).then(Mono.just(id)); - }, - 32, - 32) - .onErrorMap(AggregatedManagementException::convertToManagementException) - .subscribeOn(ResourceManagerUtils.InternalRuntimeContext.getReactorScheduler()); - } - } - - @Override - public Flux stopAsync(Collection applicationGatewayResourceIds) { - if (applicationGatewayResourceIds == null) { - return Flux.empty(); - } else { - return Flux - .fromIterable(applicationGatewayResourceIds) - .flatMapDelayError( - id -> { - final String resourceGroupName = ResourceUtils.groupFromResourceId(id); - final String name = ResourceUtils.nameFromResourceId(id); - return this.inner().stopAsync(resourceGroupName, name).then(Mono.just(id)); - }, - 32, - 32) - .onErrorMap(AggregatedManagementException::convertToManagementException) - .subscribeOn(ResourceManagerUtils.InternalRuntimeContext.getReactorScheduler()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ApplicationSecurityGroupImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ApplicationSecurityGroupImpl.java deleted file mode 100644 index 9755e69fd47c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ApplicationSecurityGroupImpl.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.network.models.ApplicationSecurityGroup; -import com.azure.resourcemanager.network.fluent.models.ApplicationSecurityGroupInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.GroupableResourceImpl; -import reactor.core.publisher.Mono; - -/** Implementation for ApplicationSecurityGroup and its create and update interfaces. */ -class ApplicationSecurityGroupImpl - extends GroupableResourceImpl< - ApplicationSecurityGroup, ApplicationSecurityGroupInner, ApplicationSecurityGroupImpl, NetworkManager> - implements ApplicationSecurityGroup, ApplicationSecurityGroup.Definition, ApplicationSecurityGroup.Update { - - ApplicationSecurityGroupImpl( - final String name, final ApplicationSecurityGroupInner innerModel, final NetworkManager networkManager) { - super(name, innerModel, networkManager); - } - - @Override - protected Mono getInnerAsync() { - return this - .manager() - .serviceClient() - .getApplicationSecurityGroups() - .getByResourceGroupAsync(this.resourceGroupName(), this.name()); - } - - @Override - public Mono createResourceAsync() { - return this - .manager() - .serviceClient() - .getApplicationSecurityGroups() - .createOrUpdateAsync(resourceGroupName(), name(), innerModel()) - .map(innerToFluentMap(this)); - } - - @Override - public String resourceGuid() { - return innerModel().resourceGuid(); - } - - @Override - public String provisioningState() { - return innerModel().provisioningState(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ApplicationSecurityGroupsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ApplicationSecurityGroupsClientImpl.java deleted file mode 100644 index 98c43cbdfeee..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ApplicationSecurityGroupsClientImpl.java +++ /dev/null @@ -1,1603 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.ApplicationSecurityGroupsClient; -import com.azure.resourcemanager.network.fluent.models.ApplicationSecurityGroupInner; -import com.azure.resourcemanager.network.models.ApplicationSecurityGroupListResult; -import com.azure.resourcemanager.network.models.TagsObject; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ApplicationSecurityGroupsClient. */ -public final class ApplicationSecurityGroupsClientImpl - implements InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete, - ApplicationSecurityGroupsClient { - private final ClientLogger logger = new ClientLogger(ApplicationSecurityGroupsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final ApplicationSecurityGroupsService service; - - /** The service client containing this operation class. */ - private final NetworkManagementClientImpl client; - - /** - * Initializes an instance of ApplicationSecurityGroupsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ApplicationSecurityGroupsClientImpl(NetworkManagementClientImpl client) { - this.service = - RestProxy - .create( - ApplicationSecurityGroupsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for NetworkManagementClientApplicationSecurityGroups to be used by the - * proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "NetworkManagementCli") - private interface ApplicationSecurityGroupsService { - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/applicationSecurityGroups/{applicationSecurityGroupName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("applicationSecurityGroupName") String applicationSecurityGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/applicationSecurityGroups/{applicationSecurityGroupName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("applicationSecurityGroupName") String applicationSecurityGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/applicationSecurityGroups/{applicationSecurityGroupName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("applicationSecurityGroupName") String applicationSecurityGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") ApplicationSecurityGroupInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/applicationSecurityGroups/{applicationSecurityGroupName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> updateTags( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("applicationSecurityGroupName") String applicationSecurityGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") TagsObject parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationSecurityGroups") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/applicationSecurityGroups") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAllNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Deletes the specified application security group. - * - * @param resourceGroupName The name of the resource group. - * @param applicationSecurityGroupName The name of the application security group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync( - String resourceGroupName, String applicationSecurityGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (applicationSecurityGroupName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter applicationSecurityGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - applicationSecurityGroupName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the specified application security group. - * - * @param resourceGroupName The name of the resource group. - * @param applicationSecurityGroupName The name of the application security group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String applicationSecurityGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (applicationSecurityGroupName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter applicationSecurityGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - applicationSecurityGroupName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Deletes the specified application security group. - * - * @param resourceGroupName The name of the resource group. - * @param applicationSecurityGroupName The name of the application security group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String applicationSecurityGroupName) { - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, applicationSecurityGroupName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deletes the specified application security group. - * - * @param resourceGroupName The name of the resource group. - * @param applicationSecurityGroupName The name of the application security group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String applicationSecurityGroupName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, applicationSecurityGroupName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes the specified application security group. - * - * @param resourceGroupName The name of the resource group. - * @param applicationSecurityGroupName The name of the application security group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String applicationSecurityGroupName) { - return beginDeleteAsync(resourceGroupName, applicationSecurityGroupName).getSyncPoller(); - } - - /** - * Deletes the specified application security group. - * - * @param resourceGroupName The name of the resource group. - * @param applicationSecurityGroupName The name of the application security group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String applicationSecurityGroupName, Context context) { - return beginDeleteAsync(resourceGroupName, applicationSecurityGroupName, context).getSyncPoller(); - } - - /** - * Deletes the specified application security group. - * - * @param resourceGroupName The name of the resource group. - * @param applicationSecurityGroupName The name of the application security group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String applicationSecurityGroupName) { - return beginDeleteAsync(resourceGroupName, applicationSecurityGroupName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified application security group. - * - * @param resourceGroupName The name of the resource group. - * @param applicationSecurityGroupName The name of the application security group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String applicationSecurityGroupName, Context context) { - return beginDeleteAsync(resourceGroupName, applicationSecurityGroupName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified application security group. - * - * @param resourceGroupName The name of the resource group. - * @param applicationSecurityGroupName The name of the application security group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String applicationSecurityGroupName) { - deleteAsync(resourceGroupName, applicationSecurityGroupName).block(); - } - - /** - * Deletes the specified application security group. - * - * @param resourceGroupName The name of the resource group. - * @param applicationSecurityGroupName The name of the application security group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String applicationSecurityGroupName, Context context) { - deleteAsync(resourceGroupName, applicationSecurityGroupName, context).block(); - } - - /** - * Gets information about the specified application security group. - * - * @param resourceGroupName The name of the resource group. - * @param applicationSecurityGroupName The name of the application security group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified application security group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String applicationSecurityGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (applicationSecurityGroupName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter applicationSecurityGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - applicationSecurityGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets information about the specified application security group. - * - * @param resourceGroupName The name of the resource group. - * @param applicationSecurityGroupName The name of the application security group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified application security group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String applicationSecurityGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (applicationSecurityGroupName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter applicationSecurityGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - applicationSecurityGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets information about the specified application security group. - * - * @param resourceGroupName The name of the resource group. - * @param applicationSecurityGroupName The name of the application security group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified application security group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync( - String resourceGroupName, String applicationSecurityGroupName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, applicationSecurityGroupName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets information about the specified application security group. - * - * @param resourceGroupName The name of the resource group. - * @param applicationSecurityGroupName The name of the application security group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified application security group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ApplicationSecurityGroupInner getByResourceGroup( - String resourceGroupName, String applicationSecurityGroupName) { - return getByResourceGroupAsync(resourceGroupName, applicationSecurityGroupName).block(); - } - - /** - * Gets information about the specified application security group. - * - * @param resourceGroupName The name of the resource group. - * @param applicationSecurityGroupName The name of the application security group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified application security group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String applicationSecurityGroupName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, applicationSecurityGroupName, context).block(); - } - - /** - * Creates or updates an application security group. - * - * @param resourceGroupName The name of the resource group. - * @param applicationSecurityGroupName The name of the application security group. - * @param parameters Parameters supplied to the create or update ApplicationSecurityGroup operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an application security group in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String applicationSecurityGroupName, ApplicationSecurityGroupInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (applicationSecurityGroupName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter applicationSecurityGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - applicationSecurityGroupName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates an application security group. - * - * @param resourceGroupName The name of the resource group. - * @param applicationSecurityGroupName The name of the application security group. - * @param parameters Parameters supplied to the create or update ApplicationSecurityGroup operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an application security group in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String applicationSecurityGroupName, - ApplicationSecurityGroupInner parameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (applicationSecurityGroupName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter applicationSecurityGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - applicationSecurityGroupName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Creates or updates an application security group. - * - * @param resourceGroupName The name of the resource group. - * @param applicationSecurityGroupName The name of the application security group. - * @param parameters Parameters supplied to the create or update ApplicationSecurityGroup operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an application security group in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, ApplicationSecurityGroupInner> - beginCreateOrUpdateAsync( - String resourceGroupName, String applicationSecurityGroupName, ApplicationSecurityGroupInner parameters) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, applicationSecurityGroupName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ApplicationSecurityGroupInner.class, - ApplicationSecurityGroupInner.class, - Context.NONE); - } - - /** - * Creates or updates an application security group. - * - * @param resourceGroupName The name of the resource group. - * @param applicationSecurityGroupName The name of the application security group. - * @param parameters Parameters supplied to the create or update ApplicationSecurityGroup operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an application security group in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, ApplicationSecurityGroupInner> - beginCreateOrUpdateAsync( - String resourceGroupName, - String applicationSecurityGroupName, - ApplicationSecurityGroupInner parameters, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, applicationSecurityGroupName, parameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ApplicationSecurityGroupInner.class, - ApplicationSecurityGroupInner.class, - context); - } - - /** - * Creates or updates an application security group. - * - * @param resourceGroupName The name of the resource group. - * @param applicationSecurityGroupName The name of the application security group. - * @param parameters Parameters supplied to the create or update ApplicationSecurityGroup operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an application security group in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, ApplicationSecurityGroupInner> beginCreateOrUpdate( - String resourceGroupName, String applicationSecurityGroupName, ApplicationSecurityGroupInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, applicationSecurityGroupName, parameters).getSyncPoller(); - } - - /** - * Creates or updates an application security group. - * - * @param resourceGroupName The name of the resource group. - * @param applicationSecurityGroupName The name of the application security group. - * @param parameters Parameters supplied to the create or update ApplicationSecurityGroup operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an application security group in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, ApplicationSecurityGroupInner> beginCreateOrUpdate( - String resourceGroupName, - String applicationSecurityGroupName, - ApplicationSecurityGroupInner parameters, - Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, applicationSecurityGroupName, parameters, context) - .getSyncPoller(); - } - - /** - * Creates or updates an application security group. - * - * @param resourceGroupName The name of the resource group. - * @param applicationSecurityGroupName The name of the application security group. - * @param parameters Parameters supplied to the create or update ApplicationSecurityGroup operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an application security group in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, String applicationSecurityGroupName, ApplicationSecurityGroupInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, applicationSecurityGroupName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates an application security group. - * - * @param resourceGroupName The name of the resource group. - * @param applicationSecurityGroupName The name of the application security group. - * @param parameters Parameters supplied to the create or update ApplicationSecurityGroup operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an application security group in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, - String applicationSecurityGroupName, - ApplicationSecurityGroupInner parameters, - Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, applicationSecurityGroupName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates an application security group. - * - * @param resourceGroupName The name of the resource group. - * @param applicationSecurityGroupName The name of the application security group. - * @param parameters Parameters supplied to the create or update ApplicationSecurityGroup operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an application security group in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ApplicationSecurityGroupInner createOrUpdate( - String resourceGroupName, String applicationSecurityGroupName, ApplicationSecurityGroupInner parameters) { - return createOrUpdateAsync(resourceGroupName, applicationSecurityGroupName, parameters).block(); - } - - /** - * Creates or updates an application security group. - * - * @param resourceGroupName The name of the resource group. - * @param applicationSecurityGroupName The name of the application security group. - * @param parameters Parameters supplied to the create or update ApplicationSecurityGroup operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an application security group in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ApplicationSecurityGroupInner createOrUpdate( - String resourceGroupName, - String applicationSecurityGroupName, - ApplicationSecurityGroupInner parameters, - Context context) { - return createOrUpdateAsync(resourceGroupName, applicationSecurityGroupName, parameters, context).block(); - } - - /** - * Updates an application security group's tags. - * - * @param resourceGroupName The name of the resource group. - * @param applicationSecurityGroupName The name of the application security group. - * @param parameters Parameters supplied to update application security group tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an application security group in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateTagsWithResponseAsync( - String resourceGroupName, String applicationSecurityGroupName, TagsObject parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (applicationSecurityGroupName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter applicationSecurityGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updateTags( - this.client.getEndpoint(), - resourceGroupName, - applicationSecurityGroupName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates an application security group's tags. - * - * @param resourceGroupName The name of the resource group. - * @param applicationSecurityGroupName The name of the application security group. - * @param parameters Parameters supplied to update application security group tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an application security group in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateTagsWithResponseAsync( - String resourceGroupName, String applicationSecurityGroupName, TagsObject parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (applicationSecurityGroupName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter applicationSecurityGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updateTags( - this.client.getEndpoint(), - resourceGroupName, - applicationSecurityGroupName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Updates an application security group's tags. - * - * @param resourceGroupName The name of the resource group. - * @param applicationSecurityGroupName The name of the application security group. - * @param parameters Parameters supplied to update application security group tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an application security group in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, ApplicationSecurityGroupInner> beginUpdateTagsAsync( - String resourceGroupName, String applicationSecurityGroupName, TagsObject parameters) { - Mono>> mono = - updateTagsWithResponseAsync(resourceGroupName, applicationSecurityGroupName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ApplicationSecurityGroupInner.class, - ApplicationSecurityGroupInner.class, - Context.NONE); - } - - /** - * Updates an application security group's tags. - * - * @param resourceGroupName The name of the resource group. - * @param applicationSecurityGroupName The name of the application security group. - * @param parameters Parameters supplied to update application security group tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an application security group in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, ApplicationSecurityGroupInner> beginUpdateTagsAsync( - String resourceGroupName, String applicationSecurityGroupName, TagsObject parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - updateTagsWithResponseAsync(resourceGroupName, applicationSecurityGroupName, parameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ApplicationSecurityGroupInner.class, - ApplicationSecurityGroupInner.class, - context); - } - - /** - * Updates an application security group's tags. - * - * @param resourceGroupName The name of the resource group. - * @param applicationSecurityGroupName The name of the application security group. - * @param parameters Parameters supplied to update application security group tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an application security group in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, ApplicationSecurityGroupInner> beginUpdateTags( - String resourceGroupName, String applicationSecurityGroupName, TagsObject parameters) { - return beginUpdateTagsAsync(resourceGroupName, applicationSecurityGroupName, parameters).getSyncPoller(); - } - - /** - * Updates an application security group's tags. - * - * @param resourceGroupName The name of the resource group. - * @param applicationSecurityGroupName The name of the application security group. - * @param parameters Parameters supplied to update application security group tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an application security group in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, ApplicationSecurityGroupInner> beginUpdateTags( - String resourceGroupName, String applicationSecurityGroupName, TagsObject parameters, Context context) { - return beginUpdateTagsAsync(resourceGroupName, applicationSecurityGroupName, parameters, context) - .getSyncPoller(); - } - - /** - * Updates an application security group's tags. - * - * @param resourceGroupName The name of the resource group. - * @param applicationSecurityGroupName The name of the application security group. - * @param parameters Parameters supplied to update application security group tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an application security group in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateTagsAsync( - String resourceGroupName, String applicationSecurityGroupName, TagsObject parameters) { - return beginUpdateTagsAsync(resourceGroupName, applicationSecurityGroupName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates an application security group's tags. - * - * @param resourceGroupName The name of the resource group. - * @param applicationSecurityGroupName The name of the application security group. - * @param parameters Parameters supplied to update application security group tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an application security group in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateTagsAsync( - String resourceGroupName, String applicationSecurityGroupName, TagsObject parameters, Context context) { - return beginUpdateTagsAsync(resourceGroupName, applicationSecurityGroupName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates an application security group's tags. - * - * @param resourceGroupName The name of the resource group. - * @param applicationSecurityGroupName The name of the application security group. - * @param parameters Parameters supplied to update application security group tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an application security group in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ApplicationSecurityGroupInner updateTags( - String resourceGroupName, String applicationSecurityGroupName, TagsObject parameters) { - return updateTagsAsync(resourceGroupName, applicationSecurityGroupName, parameters).block(); - } - - /** - * Updates an application security group's tags. - * - * @param resourceGroupName The name of the resource group. - * @param applicationSecurityGroupName The name of the application security group. - * @param parameters Parameters supplied to update application security group tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an application security group in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ApplicationSecurityGroupInner updateTags( - String resourceGroupName, String applicationSecurityGroupName, TagsObject parameters, Context context) { - return updateTagsAsync(resourceGroupName, applicationSecurityGroupName, parameters, context).block(); - } - - /** - * Gets all application security groups in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all application security groups in a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all application security groups in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all application security groups in a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all application security groups in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all application security groups in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listAllNextSinglePageAsync(nextLink)); - } - - /** - * Gets all application security groups in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all application security groups in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listAllNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all application security groups in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all application security groups in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Gets all application security groups in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all application security groups in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Gets all the application security groups in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the application security groups in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all the application security groups in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the application security groups in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all the application security groups in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the application security groups in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets all the application security groups in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the application security groups in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync( - String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all the application security groups in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the application security groups in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * Gets all the application security groups in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the application security groups in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of application security groups. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAllNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listAllNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of application security groups. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAllNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listAllNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of application security groups. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of application security groups. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ApplicationSecurityGroupsImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ApplicationSecurityGroupsImpl.java deleted file mode 100644 index 20e49816ac65..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ApplicationSecurityGroupsImpl.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.network.fluent.ApplicationSecurityGroupsClient; -import com.azure.resourcemanager.network.fluent.models.ApplicationSecurityGroupInner; -import com.azure.resourcemanager.network.models.ApplicationSecurityGroup; -import com.azure.resourcemanager.network.models.ApplicationSecurityGroups; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.TopLevelModifiableResourcesImpl; - -/** Implementation for ApplicationSecurityGroups. */ -public class ApplicationSecurityGroupsImpl - extends TopLevelModifiableResourcesImpl< - ApplicationSecurityGroup, - ApplicationSecurityGroupImpl, - ApplicationSecurityGroupInner, - ApplicationSecurityGroupsClient, - NetworkManager> - implements ApplicationSecurityGroups { - - public ApplicationSecurityGroupsImpl(final NetworkManager networkManager) { - super(networkManager.serviceClient().getApplicationSecurityGroups(), networkManager); - } - - @Override - public ApplicationSecurityGroupImpl define(String name) { - return wrapModel(name); - } - - @Override - protected ApplicationSecurityGroupImpl wrapModel(String name) { - ApplicationSecurityGroupInner inner = new ApplicationSecurityGroupInner(); - return new ApplicationSecurityGroupImpl(name, inner, super.manager()); - } - - @Override - protected ApplicationSecurityGroupImpl wrapModel(ApplicationSecurityGroupInner inner) { - if (inner == null) { - return null; - } - return new ApplicationSecurityGroupImpl(inner.name(), inner, this.manager()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/AvailableDelegationsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/AvailableDelegationsClientImpl.java deleted file mode 100644 index 383620241599..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/AvailableDelegationsClientImpl.java +++ /dev/null @@ -1,309 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.AvailableDelegationsClient; -import com.azure.resourcemanager.network.fluent.models.AvailableDelegationInner; -import com.azure.resourcemanager.network.models.AvailableDelegationsResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in AvailableDelegationsClient. */ -public final class AvailableDelegationsClientImpl implements AvailableDelegationsClient { - private final ClientLogger logger = new ClientLogger(AvailableDelegationsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final AvailableDelegationsService service; - - /** The service client containing this operation class. */ - private final NetworkManagementClientImpl client; - - /** - * Initializes an instance of AvailableDelegationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - AvailableDelegationsClientImpl(NetworkManagementClientImpl client) { - this.service = - RestProxy - .create(AvailableDelegationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for NetworkManagementClientAvailableDelegations to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "NetworkManagementCli") - private interface AvailableDelegationsService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/availableDelegations") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("location") String location, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets all of the available subnet delegations for this subscription in this region. - * - * @param location The location of the subnet. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all of the available subnet delegations for this subscription in this region. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String location) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - location, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all of the available subnet delegations for this subscription in this region. - * - * @param location The location of the subnet. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all of the available subnet delegations for this subscription in this region. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String location, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), location, apiVersion, this.client.getSubscriptionId(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all of the available subnet delegations for this subscription in this region. - * - * @param location The location of the subnet. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all of the available subnet delegations for this subscription in this region. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String location) { - return new PagedFlux<>(() -> listSinglePageAsync(location), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets all of the available subnet delegations for this subscription in this region. - * - * @param location The location of the subnet. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all of the available subnet delegations for this subscription in this region. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String location, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(location, context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all of the available subnet delegations for this subscription in this region. - * - * @param location The location of the subnet. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all of the available subnet delegations for this subscription in this region. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String location) { - return new PagedIterable<>(listAsync(location)); - } - - /** - * Gets all of the available subnet delegations for this subscription in this region. - * - * @param location The location of the subnet. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all of the available subnet delegations for this subscription in this region. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String location, Context context) { - return new PagedIterable<>(listAsync(location, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an array of available delegations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an array of available delegations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/AvailableEndpointServicesClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/AvailableEndpointServicesClientImpl.java deleted file mode 100644 index 6109c12e4e05..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/AvailableEndpointServicesClientImpl.java +++ /dev/null @@ -1,312 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.AvailableEndpointServicesClient; -import com.azure.resourcemanager.network.fluent.models.EndpointServiceResultInner; -import com.azure.resourcemanager.network.models.EndpointServicesListResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in AvailableEndpointServicesClient. */ -public final class AvailableEndpointServicesClientImpl implements AvailableEndpointServicesClient { - private final ClientLogger logger = new ClientLogger(AvailableEndpointServicesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final AvailableEndpointServicesService service; - - /** The service client containing this operation class. */ - private final NetworkManagementClientImpl client; - - /** - * Initializes an instance of AvailableEndpointServicesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - AvailableEndpointServicesClientImpl(NetworkManagementClientImpl client) { - this.service = - RestProxy - .create( - AvailableEndpointServicesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for NetworkManagementClientAvailableEndpointServices to be used by the - * proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "NetworkManagementCli") - private interface AvailableEndpointServicesService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}" - + "/virtualNetworkAvailableEndpointServices") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("location") String location, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * List what values of endpoint services are available for use. - * - * @param location The location to check available endpoint services. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the ListAvailableEndpointServices API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String location) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - location, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List what values of endpoint services are available for use. - * - * @param location The location to check available endpoint services. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the ListAvailableEndpointServices API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String location, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), location, apiVersion, this.client.getSubscriptionId(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * List what values of endpoint services are available for use. - * - * @param location The location to check available endpoint services. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the ListAvailableEndpointServices API service call. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String location) { - return new PagedFlux<>(() -> listSinglePageAsync(location), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List what values of endpoint services are available for use. - * - * @param location The location to check available endpoint services. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the ListAvailableEndpointServices API service call. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String location, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(location, context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * List what values of endpoint services are available for use. - * - * @param location The location to check available endpoint services. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the ListAvailableEndpointServices API service call. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String location) { - return new PagedIterable<>(listAsync(location)); - } - - /** - * List what values of endpoint services are available for use. - * - * @param location The location to check available endpoint services. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the ListAvailableEndpointServices API service call. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String location, Context context) { - return new PagedIterable<>(listAsync(location, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the ListAvailableEndpointServices API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the ListAvailableEndpointServices API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/AvailableProvidersImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/AvailableProvidersImpl.java deleted file mode 100644 index 1a75dca8dc98..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/AvailableProvidersImpl.java +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.resourcemanager.network.models.AvailableProviders; -import com.azure.resourcemanager.network.models.AvailableProvidersListCountry; -import com.azure.resourcemanager.network.models.AvailableProvidersListParameters; -import com.azure.resourcemanager.network.models.NetworkWatcher; -import com.azure.resourcemanager.network.fluent.models.AvailableProvidersListInner; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.ExecutableImpl; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.TreeMap; -import reactor.core.publisher.Mono; - -/** The implementation of AvailableProviders. */ -class AvailableProvidersImpl extends ExecutableImpl - implements AvailableProviders, AvailableProviders.Definition { - private Map providersByCountry; - private final NetworkWatcherImpl parent; - private AvailableProvidersListParameters parameters = new AvailableProvidersListParameters(); - private AvailableProvidersListInner inner; - - AvailableProvidersImpl(NetworkWatcherImpl parent) { - this.parent = parent; - } - - @Override - public AvailableProvidersListParameters availableProvidersParameters() { - return parameters; - } - - @Override - public Map providersByCountry() { - return Collections.unmodifiableMap(this.providersByCountry); - } - - private void initializeResourcesFromInner() { - this.providersByCountry = new TreeMap<>(); - List availableProvidersList = this.innerModel().countries(); - if (availableProvidersList != null) { - for (AvailableProvidersListCountry resource : availableProvidersList) { - this.providersByCountry.put(resource.countryName(), resource); - } - } - } - - @Override - public NetworkWatcher parent() { - return parent; - } - - @Override - public AvailableProvidersListInner innerModel() { - return this.inner; - } - - @Override - public Mono executeWorkAsync() { - return this - .parent() - .manager() - .serviceClient() - .getNetworkWatchers() - .listAvailableProvidersAsync(parent().resourceGroupName(), parent().name(), parameters) - .map( - availableProvidersListInner -> { - AvailableProvidersImpl.this.inner = availableProvidersListInner; - AvailableProvidersImpl.this.initializeResourcesFromInner(); - return AvailableProvidersImpl.this; - }); - } - - @Override - public AvailableProvidersImpl withAzureLocations(String... azureLocations) { - parameters.withAzureLocations(Arrays.asList(azureLocations)); - return this; - } - - @Override - public AvailableProvidersImpl withAzureLocation(String azureLocation) { - if (parameters.azureLocations() == null) { - parameters.withAzureLocations(new ArrayList()); - } - parameters.azureLocations().add(azureLocation); - return this; - } - - @Override - public AvailableProvidersImpl withCountry(String country) { - parameters.withCountry(country); - return this; - } - - @Override - public AvailableProvidersImpl withState(String state) { - parameters.withState(state); - return this; - } - - @Override - public AvailableProvidersImpl withCity(String city) { - parameters.withCity(city); - return this; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/AvailableResourceGroupDelegationsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/AvailableResourceGroupDelegationsClientImpl.java deleted file mode 100644 index ce7d971037d7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/AvailableResourceGroupDelegationsClientImpl.java +++ /dev/null @@ -1,343 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.AvailableResourceGroupDelegationsClient; -import com.azure.resourcemanager.network.fluent.models.AvailableDelegationInner; -import com.azure.resourcemanager.network.models.AvailableDelegationsResult; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in AvailableResourceGroupDelegationsClient. - */ -public final class AvailableResourceGroupDelegationsClientImpl implements AvailableResourceGroupDelegationsClient { - private final ClientLogger logger = new ClientLogger(AvailableResourceGroupDelegationsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final AvailableResourceGroupDelegationsService service; - - /** The service client containing this operation class. */ - private final NetworkManagementClientImpl client; - - /** - * Initializes an instance of AvailableResourceGroupDelegationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - AvailableResourceGroupDelegationsClientImpl(NetworkManagementClientImpl client) { - this.service = - RestProxy - .create( - AvailableResourceGroupDelegationsService.class, - client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for NetworkManagementClientAvailableResourceGroupDelegations to be used - * by the proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "NetworkManagementCli") - private interface AvailableResourceGroupDelegationsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations" - + "/{location}/availableDelegations") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("location") String location, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets all of the available subnet delegations for this resource group in this region. - * - * @param location The location of the domain name. - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all of the available subnet delegations for this resource group in this region. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String location, String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - location, - resourceGroupName, - this.client.getSubscriptionId(), - apiVersion, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all of the available subnet delegations for this resource group in this region. - * - * @param location The location of the domain name. - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all of the available subnet delegations for this resource group in this region. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String location, String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - location, - resourceGroupName, - this.client.getSubscriptionId(), - apiVersion, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all of the available subnet delegations for this resource group in this region. - * - * @param location The location of the domain name. - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all of the available subnet delegations for this resource group in this region. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String location, String resourceGroupName) { - return new PagedFlux<>( - () -> listSinglePageAsync(location, resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets all of the available subnet delegations for this resource group in this region. - * - * @param location The location of the domain name. - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all of the available subnet delegations for this resource group in this region. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String location, String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(location, resourceGroupName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all of the available subnet delegations for this resource group in this region. - * - * @param location The location of the domain name. - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all of the available subnet delegations for this resource group in this region. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String location, String resourceGroupName) { - return new PagedIterable<>(listAsync(location, resourceGroupName)); - } - - /** - * Gets all of the available subnet delegations for this resource group in this region. - * - * @param location The location of the domain name. - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all of the available subnet delegations for this resource group in this region. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String location, String resourceGroupName, Context context) { - return new PagedIterable<>(listAsync(location, resourceGroupName, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an array of available delegations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an array of available delegations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/AzureFirewallFqdnTagsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/AzureFirewallFqdnTagsClientImpl.java deleted file mode 100644 index 7274233552c2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/AzureFirewallFqdnTagsClientImpl.java +++ /dev/null @@ -1,288 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.AzureFirewallFqdnTagsClient; -import com.azure.resourcemanager.network.fluent.models.AzureFirewallFqdnTagInner; -import com.azure.resourcemanager.network.models.AzureFirewallFqdnTagListResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in AzureFirewallFqdnTagsClient. */ -public final class AzureFirewallFqdnTagsClientImpl implements AzureFirewallFqdnTagsClient { - private final ClientLogger logger = new ClientLogger(AzureFirewallFqdnTagsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final AzureFirewallFqdnTagsService service; - - /** The service client containing this operation class. */ - private final NetworkManagementClientImpl client; - - /** - * Initializes an instance of AzureFirewallFqdnTagsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - AzureFirewallFqdnTagsClientImpl(NetworkManagementClientImpl client) { - this.service = - RestProxy - .create(AzureFirewallFqdnTagsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for NetworkManagementClientAzureFirewallFqdnTags to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "NetworkManagementCli") - private interface AzureFirewallFqdnTagsService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/azureFirewallFqdnTags") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAllNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets all the Azure Firewall FQDN Tags in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the Azure Firewall FQDN Tags in a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all the Azure Firewall FQDN Tags in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the Azure Firewall FQDN Tags in a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all the Azure Firewall FQDN Tags in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the Azure Firewall FQDN Tags in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listAllNextSinglePageAsync(nextLink)); - } - - /** - * Gets all the Azure Firewall FQDN Tags in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the Azure Firewall FQDN Tags in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listAllNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all the Azure Firewall FQDN Tags in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the Azure Firewall FQDN Tags in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Gets all the Azure Firewall FQDN Tags in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the Azure Firewall FQDN Tags in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListAzureFirewallFqdnTags API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAllNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listAllNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListAzureFirewallFqdnTags API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAllNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listAllNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/AzureFirewallsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/AzureFirewallsClientImpl.java deleted file mode 100644 index 3efad18fef5d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/AzureFirewallsClientImpl.java +++ /dev/null @@ -1,1259 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.AzureFirewallsClient; -import com.azure.resourcemanager.network.fluent.models.AzureFirewallInner; -import com.azure.resourcemanager.network.models.AzureFirewallListResult; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in AzureFirewallsClient. */ -public final class AzureFirewallsClientImpl - implements InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete, - AzureFirewallsClient { - private final ClientLogger logger = new ClientLogger(AzureFirewallsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final AzureFirewallsService service; - - /** The service client containing this operation class. */ - private final NetworkManagementClientImpl client; - - /** - * Initializes an instance of AzureFirewallsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - AzureFirewallsClientImpl(NetworkManagementClientImpl client) { - this.service = - RestProxy.create(AzureFirewallsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for NetworkManagementClientAzureFirewalls to be used by the proxy service - * to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "NetworkManagementCli") - private interface AzureFirewallsService { - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/azureFirewalls/{azureFirewallName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("azureFirewallName") String azureFirewallName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/azureFirewalls/{azureFirewallName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("azureFirewallName") String azureFirewallName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/azureFirewalls/{azureFirewallName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("azureFirewallName") String azureFirewallName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") AzureFirewallInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/azureFirewalls") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/azureFirewalls") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAllNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Deletes the specified Azure Firewall. - * - * @param resourceGroupName The name of the resource group. - * @param azureFirewallName The name of the Azure Firewall. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync( - String resourceGroupName, String azureFirewallName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (azureFirewallName == null) { - return Mono - .error(new IllegalArgumentException("Parameter azureFirewallName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - azureFirewallName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the specified Azure Firewall. - * - * @param resourceGroupName The name of the resource group. - * @param azureFirewallName The name of the Azure Firewall. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String azureFirewallName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (azureFirewallName == null) { - return Mono - .error(new IllegalArgumentException("Parameter azureFirewallName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - azureFirewallName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Deletes the specified Azure Firewall. - * - * @param resourceGroupName The name of the resource group. - * @param azureFirewallName The name of the Azure Firewall. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String azureFirewallName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, azureFirewallName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deletes the specified Azure Firewall. - * - * @param resourceGroupName The name of the resource group. - * @param azureFirewallName The name of the Azure Firewall. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String azureFirewallName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(resourceGroupName, azureFirewallName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes the specified Azure Firewall. - * - * @param resourceGroupName The name of the resource group. - * @param azureFirewallName The name of the Azure Firewall. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete(String resourceGroupName, String azureFirewallName) { - return beginDeleteAsync(resourceGroupName, azureFirewallName).getSyncPoller(); - } - - /** - * Deletes the specified Azure Firewall. - * - * @param resourceGroupName The name of the resource group. - * @param azureFirewallName The name of the Azure Firewall. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String azureFirewallName, Context context) { - return beginDeleteAsync(resourceGroupName, azureFirewallName, context).getSyncPoller(); - } - - /** - * Deletes the specified Azure Firewall. - * - * @param resourceGroupName The name of the resource group. - * @param azureFirewallName The name of the Azure Firewall. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String azureFirewallName) { - return beginDeleteAsync(resourceGroupName, azureFirewallName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified Azure Firewall. - * - * @param resourceGroupName The name of the resource group. - * @param azureFirewallName The name of the Azure Firewall. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String azureFirewallName, Context context) { - return beginDeleteAsync(resourceGroupName, azureFirewallName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified Azure Firewall. - * - * @param resourceGroupName The name of the resource group. - * @param azureFirewallName The name of the Azure Firewall. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String azureFirewallName) { - deleteAsync(resourceGroupName, azureFirewallName).block(); - } - - /** - * Deletes the specified Azure Firewall. - * - * @param resourceGroupName The name of the resource group. - * @param azureFirewallName The name of the Azure Firewall. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String azureFirewallName, Context context) { - deleteAsync(resourceGroupName, azureFirewallName, context).block(); - } - - /** - * Gets the specified Azure Firewall. - * - * @param resourceGroupName The name of the resource group. - * @param azureFirewallName The name of the Azure Firewall. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Azure Firewall. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String azureFirewallName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (azureFirewallName == null) { - return Mono - .error(new IllegalArgumentException("Parameter azureFirewallName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - azureFirewallName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the specified Azure Firewall. - * - * @param resourceGroupName The name of the resource group. - * @param azureFirewallName The name of the Azure Firewall. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Azure Firewall. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String azureFirewallName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (azureFirewallName == null) { - return Mono - .error(new IllegalArgumentException("Parameter azureFirewallName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - azureFirewallName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets the specified Azure Firewall. - * - * @param resourceGroupName The name of the resource group. - * @param azureFirewallName The name of the Azure Firewall. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Azure Firewall. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync(String resourceGroupName, String azureFirewallName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, azureFirewallName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the specified Azure Firewall. - * - * @param resourceGroupName The name of the resource group. - * @param azureFirewallName The name of the Azure Firewall. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Azure Firewall. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AzureFirewallInner getByResourceGroup(String resourceGroupName, String azureFirewallName) { - return getByResourceGroupAsync(resourceGroupName, azureFirewallName).block(); - } - - /** - * Gets the specified Azure Firewall. - * - * @param resourceGroupName The name of the resource group. - * @param azureFirewallName The name of the Azure Firewall. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Azure Firewall. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String azureFirewallName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, azureFirewallName, context).block(); - } - - /** - * Creates or updates the specified Azure Firewall. - * - * @param resourceGroupName The name of the resource group. - * @param azureFirewallName The name of the Azure Firewall. - * @param parameters Parameters supplied to the create or update Azure Firewall operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure Firewall resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String azureFirewallName, AzureFirewallInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (azureFirewallName == null) { - return Mono - .error(new IllegalArgumentException("Parameter azureFirewallName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - azureFirewallName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates the specified Azure Firewall. - * - * @param resourceGroupName The name of the resource group. - * @param azureFirewallName The name of the Azure Firewall. - * @param parameters Parameters supplied to the create or update Azure Firewall operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure Firewall resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String azureFirewallName, AzureFirewallInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (azureFirewallName == null) { - return Mono - .error(new IllegalArgumentException("Parameter azureFirewallName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - azureFirewallName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Creates or updates the specified Azure Firewall. - * - * @param resourceGroupName The name of the resource group. - * @param azureFirewallName The name of the Azure Firewall. - * @param parameters Parameters supplied to the create or update Azure Firewall operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure Firewall resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, AzureFirewallInner> beginCreateOrUpdateAsync( - String resourceGroupName, String azureFirewallName, AzureFirewallInner parameters) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, azureFirewallName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - AzureFirewallInner.class, - AzureFirewallInner.class, - this.client.getContext()); - } - - /** - * Creates or updates the specified Azure Firewall. - * - * @param resourceGroupName The name of the resource group. - * @param azureFirewallName The name of the Azure Firewall. - * @param parameters Parameters supplied to the create or update Azure Firewall operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure Firewall resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, AzureFirewallInner> beginCreateOrUpdateAsync( - String resourceGroupName, String azureFirewallName, AzureFirewallInner parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, azureFirewallName, parameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), AzureFirewallInner.class, AzureFirewallInner.class, context); - } - - /** - * Creates or updates the specified Azure Firewall. - * - * @param resourceGroupName The name of the resource group. - * @param azureFirewallName The name of the Azure Firewall. - * @param parameters Parameters supplied to the create or update Azure Firewall operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure Firewall resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, AzureFirewallInner> beginCreateOrUpdate( - String resourceGroupName, String azureFirewallName, AzureFirewallInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, azureFirewallName, parameters).getSyncPoller(); - } - - /** - * Creates or updates the specified Azure Firewall. - * - * @param resourceGroupName The name of the resource group. - * @param azureFirewallName The name of the Azure Firewall. - * @param parameters Parameters supplied to the create or update Azure Firewall operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure Firewall resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, AzureFirewallInner> beginCreateOrUpdate( - String resourceGroupName, String azureFirewallName, AzureFirewallInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, azureFirewallName, parameters, context).getSyncPoller(); - } - - /** - * Creates or updates the specified Azure Firewall. - * - * @param resourceGroupName The name of the resource group. - * @param azureFirewallName The name of the Azure Firewall. - * @param parameters Parameters supplied to the create or update Azure Firewall operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure Firewall resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, String azureFirewallName, AzureFirewallInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, azureFirewallName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates the specified Azure Firewall. - * - * @param resourceGroupName The name of the resource group. - * @param azureFirewallName The name of the Azure Firewall. - * @param parameters Parameters supplied to the create or update Azure Firewall operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure Firewall resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String azureFirewallName, AzureFirewallInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, azureFirewallName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates the specified Azure Firewall. - * - * @param resourceGroupName The name of the resource group. - * @param azureFirewallName The name of the Azure Firewall. - * @param parameters Parameters supplied to the create or update Azure Firewall operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure Firewall resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AzureFirewallInner createOrUpdate( - String resourceGroupName, String azureFirewallName, AzureFirewallInner parameters) { - return createOrUpdateAsync(resourceGroupName, azureFirewallName, parameters).block(); - } - - /** - * Creates or updates the specified Azure Firewall. - * - * @param resourceGroupName The name of the resource group. - * @param azureFirewallName The name of the Azure Firewall. - * @param parameters Parameters supplied to the create or update Azure Firewall operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure Firewall resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AzureFirewallInner createOrUpdate( - String resourceGroupName, String azureFirewallName, AzureFirewallInner parameters, Context context) { - return createOrUpdateAsync(resourceGroupName, azureFirewallName, parameters, context).block(); - } - - /** - * Lists all Azure Firewalls in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListAzureFirewalls API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all Azure Firewalls in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListAzureFirewalls API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists all Azure Firewalls in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListAzureFirewalls API service call. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists all Azure Firewalls in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListAzureFirewalls API service call. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all Azure Firewalls in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListAzureFirewalls API service call. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * Lists all Azure Firewalls in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListAzureFirewalls API service call. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * Gets all the Azure Firewalls in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the Azure Firewalls in a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all the Azure Firewalls in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the Azure Firewalls in a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all the Azure Firewalls in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the Azure Firewalls in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listAllNextSinglePageAsync(nextLink)); - } - - /** - * Gets all the Azure Firewalls in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the Azure Firewalls in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listAllNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all the Azure Firewalls in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the Azure Firewalls in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Gets all the Azure Firewalls in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the Azure Firewalls in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListAzureFirewalls API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListAzureFirewalls API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListAzureFirewalls API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAllNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listAllNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListAzureFirewalls API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAllNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listAllNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/AzureReachabilityReportImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/AzureReachabilityReportImpl.java deleted file mode 100644 index 4c1402fade55..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/AzureReachabilityReportImpl.java +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.resourcemanager.network.models.AzureReachabilityReport; -import com.azure.resourcemanager.network.models.AzureReachabilityReportItem; -import com.azure.resourcemanager.network.models.AzureReachabilityReportLocation; -import com.azure.resourcemanager.network.models.AzureReachabilityReportParameters; -import com.azure.resourcemanager.network.models.NetworkWatcher; -import com.azure.resourcemanager.network.fluent.models.AzureReachabilityReportInner; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.ExecutableImpl; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import reactor.core.publisher.Mono; - -/** The implementation of AzureReachabilityReport. */ -class AzureReachabilityReportImpl extends ExecutableImpl - implements AzureReachabilityReport, AzureReachabilityReport.Definition { - private final NetworkWatcherImpl parent; - private AzureReachabilityReportParameters parameters = new AzureReachabilityReportParameters(); - private AzureReachabilityReportInner inner; - - AzureReachabilityReportImpl(NetworkWatcherImpl parent) { - this.parent = parent; - } - - @Override - public String aggregationLevel() { - return inner.aggregationLevel(); - } - - @Override - public AzureReachabilityReportLocation providerLocation() { - return inner.providerLocation(); - } - - @Override - public List reachabilityReport() { - return Collections.unmodifiableList(inner.reachabilityReport()); - } - - @Override - public AzureReachabilityReportParameters azureReachabilityReportParameters() { - return parameters; - } - - @Override - public NetworkWatcher parent() { - return parent; - } - - @Override - public AzureReachabilityReportInner innerModel() { - return this.inner; - } - - @Override - public Mono executeWorkAsync() { - return this - .parent() - .manager() - .serviceClient() - .getNetworkWatchers() - .getAzureReachabilityReportAsync(parent().resourceGroupName(), parent().name(), parameters) - .map( - azureReachabilityReportListInner -> { - AzureReachabilityReportImpl.this.inner = azureReachabilityReportListInner; - return AzureReachabilityReportImpl.this; - }); - } - - @Override - public AzureReachabilityReportImpl withProviderLocation(String country) { - parameters.withProviderLocation(new AzureReachabilityReportLocation().withCountry(country)); - return this; - } - - @Override - public AzureReachabilityReportImpl withProviderLocation(String country, String state) { - parameters.withProviderLocation(new AzureReachabilityReportLocation().withCountry(country).withState(state)); - return this; - } - - @Override - public AzureReachabilityReportImpl withProviderLocation(String country, String state, String city) { - parameters - .withProviderLocation( - new AzureReachabilityReportLocation().withCountry(country).withState(state).withCity(city)); - return this; - } - - @Override - public AzureReachabilityReportImpl withStartTime(OffsetDateTime startTime) { - parameters.withStartTime(startTime); - return this; - } - - @Override - public AzureReachabilityReportImpl withEndTime(OffsetDateTime endTime) { - parameters.withEndTime(endTime); - return this; - } - - @Override - public DefinitionStages.WithExecute withAzureLocations(String... azureLocations) { - parameters.withAzureLocations(Arrays.asList(azureLocations)); - return this; - } - - @Override - public DefinitionStages.WithExecute withProviders(String... providers) { - parameters.withProviders(Arrays.asList(providers)); - return this; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/BgpServiceCommunitiesClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/BgpServiceCommunitiesClientImpl.java deleted file mode 100644 index 25ac4bce0f92..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/BgpServiceCommunitiesClientImpl.java +++ /dev/null @@ -1,287 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.BgpServiceCommunitiesClient; -import com.azure.resourcemanager.network.fluent.models.BgpServiceCommunityInner; -import com.azure.resourcemanager.network.models.BgpServiceCommunityListResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in BgpServiceCommunitiesClient. */ -public final class BgpServiceCommunitiesClientImpl implements BgpServiceCommunitiesClient { - private final ClientLogger logger = new ClientLogger(BgpServiceCommunitiesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final BgpServiceCommunitiesService service; - - /** The service client containing this operation class. */ - private final NetworkManagementClientImpl client; - - /** - * Initializes an instance of BgpServiceCommunitiesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - BgpServiceCommunitiesClientImpl(NetworkManagementClientImpl client) { - this.service = - RestProxy - .create(BgpServiceCommunitiesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for NetworkManagementClientBgpServiceCommunities to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "NetworkManagementCli") - private interface BgpServiceCommunitiesService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/bgpServiceCommunities") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets all the available bgp service communities. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the available bgp service communities. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all the available bgp service communities. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the available bgp service communities. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all the available bgp service communities. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the available bgp service communities. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets all the available bgp service communities. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the available bgp service communities. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all the available bgp service communities. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the available bgp service communities. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Gets all the available bgp service communities. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the available bgp service communities. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the ListServiceCommunity API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the ListServiceCommunity API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ConnectionMonitorImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ConnectionMonitorImpl.java deleted file mode 100644 index ae10aea11f03..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ConnectionMonitorImpl.java +++ /dev/null @@ -1,247 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.resourcemanager.network.fluent.ConnectionMonitorsClient; -import com.azure.resourcemanager.network.fluent.models.ConnectionMonitorInner; -import com.azure.resourcemanager.network.fluent.models.ConnectionMonitorResultInner; -import com.azure.resourcemanager.network.models.ConnectionMonitor; -import com.azure.resourcemanager.network.models.ConnectionMonitorDestination; -import com.azure.resourcemanager.network.models.ConnectionMonitorQueryResult; -import com.azure.resourcemanager.network.models.ConnectionMonitorSource; -import com.azure.resourcemanager.network.models.HasNetworkInterfaces; -import com.azure.resourcemanager.network.models.NetworkWatcher; -import com.azure.resourcemanager.network.models.ProvisioningState; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.CreatableUpdatableImpl; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import reactor.core.publisher.Mono; - -import java.time.OffsetDateTime; -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; -import java.util.TreeMap; - -/** Implementation for Connection Monitor and its create and update interfaces. */ -public class ConnectionMonitorImpl - extends CreatableUpdatableImpl - implements ConnectionMonitor, ConnectionMonitor.Definition { - private final ConnectionMonitorsClient client; - private final ConnectionMonitorInner createParameters; - private final NetworkWatcher parent; - - ConnectionMonitorImpl( - String name, - NetworkWatcherImpl parent, - ConnectionMonitorResultInner innerObject, - ConnectionMonitorsClient client) { - super(name, innerObject); - this.client = client; - this.parent = parent; - this.createParameters = new ConnectionMonitorInner().withLocation(parent.regionName()); - } - - @Override - protected Mono getInnerAsync() { - return this.client.getAsync(parent.resourceGroupName(), parent.name(), name()); - } - - @Override - public String location() { - return innerModel().location(); - } - - @Override - public Map tags() { - Map tags = this.innerModel().tags(); - if (tags == null) { - tags = new TreeMap<>(); - } - return Collections.unmodifiableMap(tags); - } - - @Override - public ConnectionMonitorSource source() { - return innerModel().source(); - } - - @Override - public ConnectionMonitorDestination destination() { - return innerModel().destination(); - } - - @Override - public boolean autoStart() { - return ResourceManagerUtils.toPrimitiveBoolean(innerModel().autoStart()); - } - - @Override - public ProvisioningState provisioningState() { - return innerModel().provisioningState(); - } - - @Override - public OffsetDateTime startTime() { - return innerModel().startTime(); - } - - @Override - public String monitoringStatus() { - return innerModel().monitoringStatus(); - } - - @Override - public int monitoringIntervalInSeconds() { - return ResourceManagerUtils.toPrimitiveInt(innerModel().monitoringIntervalInSeconds()); - } - - @Override - public void stop() { - stopAsync().block(); - } - - @Override - public Mono stopAsync() { - return this - .client - .stopAsync(parent.resourceGroupName(), parent.name(), name()) - .flatMap(aVoid -> refreshAsync()) - .then(); - } - - @Override - public void start() { - startAsync().block(); - } - - @Override - public Mono startAsync() { - return this - .client - .startAsync(parent.resourceGroupName(), parent.name(), name()) - .flatMap(aVoid -> refreshAsync()) - .then(); - } - - @Override - public ConnectionMonitorQueryResult query() { - return queryAsync().block(); - } - - @Override - public Mono queryAsync() { - return this - .client - .queryAsync(parent.resourceGroupName(), parent.name(), name()) - .map(inner -> new ConnectionMonitorQueryResultImpl(inner)); - } - - @Override - public boolean isInCreateMode() { - return this.innerModel().id() == null; - } - - @Override - public Mono createResourceAsync() { - return this - .client - .createOrUpdateAsync(parent.resourceGroupName(), parent.name(), this.name(), createParameters) - .map(innerToFluentMap(this)); - } - - @Override - public String id() { - return innerModel().id(); - } - - @Override - public ConnectionMonitorImpl withSourceId(String resourceId) { - ensureConnectionMonitorSource().withResourceId(resourceId); - return this; - } - - @Override - public ConnectionMonitorImpl withSource(HasNetworkInterfaces vm) { - ensureConnectionMonitorSource().withResourceId(vm.id()); - return this; - } - - @Override - public ConnectionMonitorImpl withDestinationId(String resourceId) { - ensureConnectionMonitorDestination().withResourceId(resourceId); - return this; - } - - @Override - public ConnectionMonitorImpl withDestination(HasNetworkInterfaces vm) { - ensureConnectionMonitorDestination().withResourceId(vm.id()); - return this; - } - - @Override - public DefinitionStages.WithDestinationPort withDestinationAddress(String address) { - ensureConnectionMonitorDestination().withAddress(address); - return this; - } - - private ConnectionMonitorSource ensureConnectionMonitorSource() { - if (createParameters.source() == null) { - createParameters.withSource(new ConnectionMonitorSource()); - } - return createParameters.source(); - } - - private ConnectionMonitorDestination ensureConnectionMonitorDestination() { - if (createParameters.destination() == null) { - createParameters.withDestination(new ConnectionMonitorDestination()); - } - return createParameters.destination(); - } - - @Override - public ConnectionMonitorImpl withDestinationPort(int port) { - ensureConnectionMonitorDestination().withPort(port); - return this; - } - - @Override - public ConnectionMonitorImpl withSourcePort(int port) { - ensureConnectionMonitorSource().withPort(port); - return this; - } - - @Override - public ConnectionMonitorImpl withoutAutoStart() { - createParameters.withAutoStart(false); - return this; - } - - @Override - public final ConnectionMonitorImpl withTags(Map tags) { - this.createParameters.withTags(new HashMap<>(tags)); - return this; - } - - @Override - public ConnectionMonitorImpl withTag(String key, String value) { - if (this.createParameters.tags() == null) { - this.createParameters.withTags(new HashMap()); - } - this.createParameters.tags().put(key, value); - return this; - } - - @Override - public ConnectionMonitorImpl withoutTag(String key) { - if (this.createParameters.tags() != null) { - this.createParameters.tags().remove(key); - } - return this; - } - - @Override - public ConnectionMonitorImpl withMonitoringInterval(int seconds) { - createParameters.withMonitoringIntervalInSeconds(seconds); - return this; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ConnectionMonitorQueryResultImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ConnectionMonitorQueryResultImpl.java deleted file mode 100644 index 8d242872bc9a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ConnectionMonitorQueryResultImpl.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.resourcemanager.network.models.ConnectionMonitorQueryResult; -import com.azure.resourcemanager.network.models.ConnectionMonitorSourceStatus; -import com.azure.resourcemanager.network.models.ConnectionStateSnapshot; -import com.azure.resourcemanager.network.fluent.models.ConnectionMonitorQueryResultInner; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.WrapperImpl; -import java.util.Collections; -import java.util.List; - -/** Implementation for {@link ConnectionMonitorQueryResult}. */ -class ConnectionMonitorQueryResultImpl extends WrapperImpl - implements ConnectionMonitorQueryResult { - ConnectionMonitorQueryResultImpl(ConnectionMonitorQueryResultInner innerObject) { - super(innerObject); - } - - @Override - public ConnectionMonitorSourceStatus sourceStatus() { - return innerModel().sourceStatus(); - } - - @Override - public List states() { - return Collections.unmodifiableList(innerModel().states()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ConnectionMonitorsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ConnectionMonitorsClientImpl.java deleted file mode 100644 index 31e7bb7f09ef..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ConnectionMonitorsClientImpl.java +++ /dev/null @@ -1,1915 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.ConnectionMonitorsClient; -import com.azure.resourcemanager.network.fluent.models.ConnectionMonitorInner; -import com.azure.resourcemanager.network.fluent.models.ConnectionMonitorQueryResultInner; -import com.azure.resourcemanager.network.fluent.models.ConnectionMonitorResultInner; -import com.azure.resourcemanager.network.models.ConnectionMonitorListResult; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ConnectionMonitorsClient. */ -public final class ConnectionMonitorsClientImpl implements ConnectionMonitorsClient { - private final ClientLogger logger = new ClientLogger(ConnectionMonitorsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final ConnectionMonitorsService service; - - /** The service client containing this operation class. */ - private final NetworkManagementClientImpl client; - - /** - * Initializes an instance of ConnectionMonitorsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ConnectionMonitorsClientImpl(NetworkManagementClientImpl client) { - this.service = - RestProxy.create(ConnectionMonitorsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for NetworkManagementClientConnectionMonitors to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "NetworkManagementCli") - private interface ConnectionMonitorsService { - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("networkWatcherName") String networkWatcherName, - @PathParam("connectionMonitorName") String connectionMonitorName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") ConnectionMonitorInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("networkWatcherName") String networkWatcherName, - @PathParam("connectionMonitorName") String connectionMonitorName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}") - @ExpectedResponses({202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("networkWatcherName") String networkWatcherName, - @PathParam("connectionMonitorName") String connectionMonitorName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/stop") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> stop( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("networkWatcherName") String networkWatcherName, - @PathParam("connectionMonitorName") String connectionMonitorName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/start") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> start( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("networkWatcherName") String networkWatcherName, - @PathParam("connectionMonitorName") String connectionMonitorName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/query") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> query( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("networkWatcherName") String networkWatcherName, - @PathParam("connectionMonitorName") String connectionMonitorName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/networkWatchers/{networkWatcherName}/connectionMonitors") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("networkWatcherName") String networkWatcherName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Create or update a connection monitor. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name of the connection monitor. - * @param parameters Parameters that define the operation to create a connection monitor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the connection monitor. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String networkWatcherName, - String connectionMonitorName, - ConnectionMonitorInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkWatcherName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); - } - if (connectionMonitorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter connectionMonitorName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - networkWatcherName, - connectionMonitorName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create or update a connection monitor. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name of the connection monitor. - * @param parameters Parameters that define the operation to create a connection monitor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the connection monitor. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String networkWatcherName, - String connectionMonitorName, - ConnectionMonitorInner parameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkWatcherName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); - } - if (connectionMonitorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter connectionMonitorName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - networkWatcherName, - connectionMonitorName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Create or update a connection monitor. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name of the connection monitor. - * @param parameters Parameters that define the operation to create a connection monitor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the connection monitor. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, ConnectionMonitorResultInner> beginCreateOrUpdateAsync( - String resourceGroupName, - String networkWatcherName, - String connectionMonitorName, - ConnectionMonitorInner parameters) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ConnectionMonitorResultInner.class, - ConnectionMonitorResultInner.class, - Context.NONE); - } - - /** - * Create or update a connection monitor. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name of the connection monitor. - * @param parameters Parameters that define the operation to create a connection monitor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the connection monitor. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, ConnectionMonitorResultInner> beginCreateOrUpdateAsync( - String resourceGroupName, - String networkWatcherName, - String connectionMonitorName, - ConnectionMonitorInner parameters, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync( - resourceGroupName, networkWatcherName, connectionMonitorName, parameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ConnectionMonitorResultInner.class, - ConnectionMonitorResultInner.class, - context); - } - - /** - * Create or update a connection monitor. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name of the connection monitor. - * @param parameters Parameters that define the operation to create a connection monitor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the connection monitor. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, ConnectionMonitorResultInner> beginCreateOrUpdate( - String resourceGroupName, - String networkWatcherName, - String connectionMonitorName, - ConnectionMonitorInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, networkWatcherName, connectionMonitorName, parameters) - .getSyncPoller(); - } - - /** - * Create or update a connection monitor. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name of the connection monitor. - * @param parameters Parameters that define the operation to create a connection monitor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the connection monitor. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, ConnectionMonitorResultInner> beginCreateOrUpdate( - String resourceGroupName, - String networkWatcherName, - String connectionMonitorName, - ConnectionMonitorInner parameters, - Context context) { - return beginCreateOrUpdateAsync( - resourceGroupName, networkWatcherName, connectionMonitorName, parameters, context) - .getSyncPoller(); - } - - /** - * Create or update a connection monitor. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name of the connection monitor. - * @param parameters Parameters that define the operation to create a connection monitor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the connection monitor. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, - String networkWatcherName, - String connectionMonitorName, - ConnectionMonitorInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, networkWatcherName, connectionMonitorName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create or update a connection monitor. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name of the connection monitor. - * @param parameters Parameters that define the operation to create a connection monitor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the connection monitor. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, - String networkWatcherName, - String connectionMonitorName, - ConnectionMonitorInner parameters, - Context context) { - return beginCreateOrUpdateAsync( - resourceGroupName, networkWatcherName, connectionMonitorName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create or update a connection monitor. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name of the connection monitor. - * @param parameters Parameters that define the operation to create a connection monitor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the connection monitor. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ConnectionMonitorResultInner createOrUpdate( - String resourceGroupName, - String networkWatcherName, - String connectionMonitorName, - ConnectionMonitorInner parameters) { - return createOrUpdateAsync(resourceGroupName, networkWatcherName, connectionMonitorName, parameters).block(); - } - - /** - * Create or update a connection monitor. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name of the connection monitor. - * @param parameters Parameters that define the operation to create a connection monitor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the connection monitor. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ConnectionMonitorResultInner createOrUpdate( - String resourceGroupName, - String networkWatcherName, - String connectionMonitorName, - ConnectionMonitorInner parameters, - Context context) { - return createOrUpdateAsync(resourceGroupName, networkWatcherName, connectionMonitorName, parameters, context) - .block(); - } - - /** - * Gets a connection monitor by name. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name of the connection monitor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a connection monitor by name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String resourceGroupName, String networkWatcherName, String connectionMonitorName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkWatcherName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); - } - if (connectionMonitorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter connectionMonitorName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - resourceGroupName, - networkWatcherName, - connectionMonitorName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a connection monitor by name. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name of the connection monitor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a connection monitor by name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkWatcherName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); - } - if (connectionMonitorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter connectionMonitorName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - resourceGroupName, - networkWatcherName, - connectionMonitorName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets a connection monitor by name. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name of the connection monitor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a connection monitor by name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync( - String resourceGroupName, String networkWatcherName, String connectionMonitorName) { - return getWithResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a connection monitor by name. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name of the connection monitor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a connection monitor by name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ConnectionMonitorResultInner get( - String resourceGroupName, String networkWatcherName, String connectionMonitorName) { - return getAsync(resourceGroupName, networkWatcherName, connectionMonitorName).block(); - } - - /** - * Gets a connection monitor by name. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name of the connection monitor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a connection monitor by name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context) { - return getWithResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName, context).block(); - } - - /** - * Deletes the specified connection monitor. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name of the connection monitor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync( - String resourceGroupName, String networkWatcherName, String connectionMonitorName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkWatcherName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); - } - if (connectionMonitorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter connectionMonitorName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - networkWatcherName, - connectionMonitorName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the specified connection monitor. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name of the connection monitor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkWatcherName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); - } - if (connectionMonitorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter connectionMonitorName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - networkWatcherName, - connectionMonitorName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Deletes the specified connection monitor. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name of the connection monitor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String networkWatcherName, String connectionMonitorName) { - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deletes the specified connection monitor. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name of the connection monitor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes the specified connection monitor. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name of the connection monitor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String networkWatcherName, String connectionMonitorName) { - return beginDeleteAsync(resourceGroupName, networkWatcherName, connectionMonitorName).getSyncPoller(); - } - - /** - * Deletes the specified connection monitor. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name of the connection monitor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context) { - return beginDeleteAsync(resourceGroupName, networkWatcherName, connectionMonitorName, context).getSyncPoller(); - } - - /** - * Deletes the specified connection monitor. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name of the connection monitor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { - return beginDeleteAsync(resourceGroupName, networkWatcherName, connectionMonitorName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified connection monitor. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name of the connection monitor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync( - String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context) { - return beginDeleteAsync(resourceGroupName, networkWatcherName, connectionMonitorName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified connection monitor. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name of the connection monitor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { - deleteAsync(resourceGroupName, networkWatcherName, connectionMonitorName).block(); - } - - /** - * Deletes the specified connection monitor. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name of the connection monitor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete( - String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context) { - deleteAsync(resourceGroupName, networkWatcherName, connectionMonitorName, context).block(); - } - - /** - * Stops the specified connection monitor. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name of the connection monitor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> stopWithResponseAsync( - String resourceGroupName, String networkWatcherName, String connectionMonitorName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkWatcherName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); - } - if (connectionMonitorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter connectionMonitorName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .stop( - this.client.getEndpoint(), - resourceGroupName, - networkWatcherName, - connectionMonitorName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Stops the specified connection monitor. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name of the connection monitor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> stopWithResponseAsync( - String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkWatcherName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); - } - if (connectionMonitorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter connectionMonitorName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .stop( - this.client.getEndpoint(), - resourceGroupName, - networkWatcherName, - connectionMonitorName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Stops the specified connection monitor. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name of the connection monitor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginStopAsync( - String resourceGroupName, String networkWatcherName, String connectionMonitorName) { - Mono>> mono = - stopWithResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Stops the specified connection monitor. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name of the connection monitor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginStopAsync( - String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - stopWithResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Stops the specified connection monitor. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name of the connection monitor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginStop( - String resourceGroupName, String networkWatcherName, String connectionMonitorName) { - return beginStopAsync(resourceGroupName, networkWatcherName, connectionMonitorName).getSyncPoller(); - } - - /** - * Stops the specified connection monitor. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name of the connection monitor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginStop( - String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context) { - return beginStopAsync(resourceGroupName, networkWatcherName, connectionMonitorName, context).getSyncPoller(); - } - - /** - * Stops the specified connection monitor. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name of the connection monitor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono stopAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { - return beginStopAsync(resourceGroupName, networkWatcherName, connectionMonitorName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Stops the specified connection monitor. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name of the connection monitor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono stopAsync( - String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context) { - return beginStopAsync(resourceGroupName, networkWatcherName, connectionMonitorName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Stops the specified connection monitor. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name of the connection monitor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void stop(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { - stopAsync(resourceGroupName, networkWatcherName, connectionMonitorName).block(); - } - - /** - * Stops the specified connection monitor. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name of the connection monitor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void stop( - String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context) { - stopAsync(resourceGroupName, networkWatcherName, connectionMonitorName, context).block(); - } - - /** - * Starts the specified connection monitor. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name of the connection monitor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> startWithResponseAsync( - String resourceGroupName, String networkWatcherName, String connectionMonitorName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkWatcherName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); - } - if (connectionMonitorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter connectionMonitorName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .start( - this.client.getEndpoint(), - resourceGroupName, - networkWatcherName, - connectionMonitorName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Starts the specified connection monitor. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name of the connection monitor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> startWithResponseAsync( - String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkWatcherName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); - } - if (connectionMonitorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter connectionMonitorName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .start( - this.client.getEndpoint(), - resourceGroupName, - networkWatcherName, - connectionMonitorName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Starts the specified connection monitor. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name of the connection monitor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginStartAsync( - String resourceGroupName, String networkWatcherName, String connectionMonitorName) { - Mono>> mono = - startWithResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Starts the specified connection monitor. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name of the connection monitor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginStartAsync( - String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - startWithResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Starts the specified connection monitor. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name of the connection monitor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginStart( - String resourceGroupName, String networkWatcherName, String connectionMonitorName) { - return beginStartAsync(resourceGroupName, networkWatcherName, connectionMonitorName).getSyncPoller(); - } - - /** - * Starts the specified connection monitor. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name of the connection monitor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginStart( - String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context) { - return beginStartAsync(resourceGroupName, networkWatcherName, connectionMonitorName, context).getSyncPoller(); - } - - /** - * Starts the specified connection monitor. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name of the connection monitor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono startAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { - return beginStartAsync(resourceGroupName, networkWatcherName, connectionMonitorName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Starts the specified connection monitor. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name of the connection monitor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono startAsync( - String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context) { - return beginStartAsync(resourceGroupName, networkWatcherName, connectionMonitorName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Starts the specified connection monitor. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name of the connection monitor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void start(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { - startAsync(resourceGroupName, networkWatcherName, connectionMonitorName).block(); - } - - /** - * Starts the specified connection monitor. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name of the connection monitor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void start( - String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context) { - startAsync(resourceGroupName, networkWatcherName, connectionMonitorName, context).block(); - } - - /** - * Query a snapshot of the most recent connection states. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name given to the connection monitor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of connection states snapshots. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> queryWithResponseAsync( - String resourceGroupName, String networkWatcherName, String connectionMonitorName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkWatcherName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); - } - if (connectionMonitorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter connectionMonitorName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .query( - this.client.getEndpoint(), - resourceGroupName, - networkWatcherName, - connectionMonitorName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Query a snapshot of the most recent connection states. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name given to the connection monitor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of connection states snapshots. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> queryWithResponseAsync( - String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkWatcherName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); - } - if (connectionMonitorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter connectionMonitorName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .query( - this.client.getEndpoint(), - resourceGroupName, - networkWatcherName, - connectionMonitorName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Query a snapshot of the most recent connection states. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name given to the connection monitor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of connection states snapshots. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, ConnectionMonitorQueryResultInner> beginQueryAsync( - String resourceGroupName, String networkWatcherName, String connectionMonitorName) { - Mono>> mono = - queryWithResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ConnectionMonitorQueryResultInner.class, - ConnectionMonitorQueryResultInner.class, - Context.NONE); - } - - /** - * Query a snapshot of the most recent connection states. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name given to the connection monitor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of connection states snapshots. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, ConnectionMonitorQueryResultInner> - beginQueryAsync( - String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - queryWithResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ConnectionMonitorQueryResultInner.class, - ConnectionMonitorQueryResultInner.class, - context); - } - - /** - * Query a snapshot of the most recent connection states. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name given to the connection monitor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of connection states snapshots. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, ConnectionMonitorQueryResultInner> beginQuery( - String resourceGroupName, String networkWatcherName, String connectionMonitorName) { - return beginQueryAsync(resourceGroupName, networkWatcherName, connectionMonitorName).getSyncPoller(); - } - - /** - * Query a snapshot of the most recent connection states. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name given to the connection monitor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of connection states snapshots. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, ConnectionMonitorQueryResultInner> beginQuery( - String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context) { - return beginQueryAsync(resourceGroupName, networkWatcherName, connectionMonitorName, context).getSyncPoller(); - } - - /** - * Query a snapshot of the most recent connection states. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name given to the connection monitor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of connection states snapshots. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono queryAsync( - String resourceGroupName, String networkWatcherName, String connectionMonitorName) { - return beginQueryAsync(resourceGroupName, networkWatcherName, connectionMonitorName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Query a snapshot of the most recent connection states. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name given to the connection monitor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of connection states snapshots. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono queryAsync( - String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context) { - return beginQueryAsync(resourceGroupName, networkWatcherName, connectionMonitorName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Query a snapshot of the most recent connection states. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name given to the connection monitor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of connection states snapshots. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ConnectionMonitorQueryResultInner query( - String resourceGroupName, String networkWatcherName, String connectionMonitorName) { - return queryAsync(resourceGroupName, networkWatcherName, connectionMonitorName).block(); - } - - /** - * Query a snapshot of the most recent connection states. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param connectionMonitorName The name given to the connection monitor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of connection states snapshots. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ConnectionMonitorQueryResultInner query( - String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context) { - return queryAsync(resourceGroupName, networkWatcherName, connectionMonitorName, context).block(); - } - - /** - * Lists all connection monitors for the specified Network Watcher. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of connection monitors. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String networkWatcherName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkWatcherName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - resourceGroupName, - networkWatcherName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all connection monitors for the specified Network Watcher. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of connection monitors. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String networkWatcherName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkWatcherName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - resourceGroupName, - networkWatcherName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); - } - - /** - * Lists all connection monitors for the specified Network Watcher. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of connection monitors. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String resourceGroupName, String networkWatcherName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, networkWatcherName)); - } - - /** - * Lists all connection monitors for the specified Network Watcher. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of connection monitors. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String networkWatcherName, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, networkWatcherName, context)); - } - - /** - * Lists all connection monitors for the specified Network Watcher. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of connection monitors. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String networkWatcherName) { - return new PagedIterable<>(listAsync(resourceGroupName, networkWatcherName)); - } - - /** - * Lists all connection monitors for the specified Network Watcher. - * - * @param resourceGroupName The name of the resource group containing Network Watcher. - * @param networkWatcherName The name of the Network Watcher resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of connection monitors. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, String networkWatcherName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, networkWatcherName, context)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ConnectionMonitorsImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ConnectionMonitorsImpl.java deleted file mode 100644 index a1b2dd44b7fe..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ConnectionMonitorsImpl.java +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.network.fluent.ConnectionMonitorsClient; -import com.azure.resourcemanager.network.fluent.models.ConnectionMonitorResultInner; -import com.azure.resourcemanager.network.models.ConnectionMonitor; -import com.azure.resourcemanager.network.models.ConnectionMonitors; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceId; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.CreatableResourcesImpl; -import reactor.core.publisher.Mono; - -/** Represents Connection Monitors collection associated with Network Watcher. */ -class ConnectionMonitorsImpl - extends CreatableResourcesImpl - implements ConnectionMonitors { - private final NetworkWatcherImpl parent; - private final ConnectionMonitorsClient innerCollection; - - /** - * Creates a new ConnectionMonitorsImpl. - * - * @param parent the Network Watcher associated with Connection Monitors - */ - ConnectionMonitorsImpl(ConnectionMonitorsClient innerCollection, NetworkWatcherImpl parent) { - this.parent = parent; - this.innerCollection = innerCollection; - } - - @Override - public final PagedIterable list() { - return wrapList(inner().list(parent.resourceGroupName(), parent.name())); - } - - /** @return an observable emits connection monitors in this collection */ - @Override - public PagedFlux listAsync() { - return wrapPageAsync(inner().listAsync(parent.resourceGroupName(), parent.name())); - } - - @Override - protected ConnectionMonitorImpl wrapModel(String name) { - return new ConnectionMonitorImpl(name, parent, new ConnectionMonitorResultInner(), inner()); - } - - protected ConnectionMonitorImpl wrapModel(ConnectionMonitorResultInner inner) { - return (inner == null) ? null : new ConnectionMonitorImpl(inner.name(), parent, inner, inner()); - } - - @Override - public ConnectionMonitorImpl define(String name) { - return new ConnectionMonitorImpl(name, parent, new ConnectionMonitorResultInner(), inner()); - } - - @Override - public Mono getByNameAsync(String name) { - return inner().getAsync(parent.resourceGroupName(), parent.name(), name).map(inner -> wrapModel(inner)); - } - - @Override - public ConnectionMonitor getByName(String name) { - return getByNameAsync(name).block(); - } - - @Override - public void deleteByName(String name) { - deleteByNameAsync(name).block(); - } - - @Override - public Mono deleteByNameAsync(String name) { - return this.inner().deleteAsync(parent.resourceGroupName(), parent.name(), name); - } - - public ConnectionMonitorsClient inner() { - return innerCollection; - } - - @Override - public Mono deleteByIdAsync(String id) { - ResourceId resourceId = ResourceId.fromString(id); - return this.inner().deleteAsync(resourceId.resourceGroupName(), resourceId.parent().name(), resourceId.name()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ConnectivityCheckImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ConnectivityCheckImpl.java deleted file mode 100644 index 8fbe90a56a10..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ConnectivityCheckImpl.java +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.resourcemanager.network.models.ConnectionStatus; -import com.azure.resourcemanager.network.models.ConnectivityCheck; -import com.azure.resourcemanager.network.models.ConnectivityDestination; -import com.azure.resourcemanager.network.models.ConnectivityHop; -import com.azure.resourcemanager.network.models.ConnectivityParameters; -import com.azure.resourcemanager.network.models.ConnectivitySource; -import com.azure.resourcemanager.network.models.Protocol; -import com.azure.resourcemanager.network.fluent.models.ConnectivityInformationInner; -import com.azure.resourcemanager.network.models.HasNetworkInterfaces; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.ExecutableImpl; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; - -import java.util.List; -import reactor.core.publisher.Mono; - -/** Implementation of ConnectivityCheck. */ -public class ConnectivityCheckImpl extends ExecutableImpl - implements ConnectivityCheck, ConnectivityCheck.Definition { - - private final NetworkWatcherImpl parent; - private ConnectivityParameters parameters = new ConnectivityParameters(); - private ConnectivityInformationInner result; - - ConnectivityCheckImpl(NetworkWatcherImpl parent) { - this.parent = parent; - } - - @Override - public ConnectivityCheckImpl fromSourceVirtualMachine(String sourceResourceId) { - ensureConnectivitySource().withResourceId(sourceResourceId); - return this; - } - - @Override - public DefinitionStages.WithExecute fromSourceVirtualMachine(HasNetworkInterfaces vm) { - ensureConnectivitySource().withResourceId(vm.id()); - return this; - } - - @Override - public ConnectivityCheckImpl toDestinationResourceId(String resourceId) { - ensureConnectivityDestination().withResourceId(resourceId); - return this; - } - - @Override - public ConnectivityCheckImpl toDestinationAddress(String address) { - ensureConnectivityDestination().withAddress(address); - return this; - } - - @Override - public ConnectivityCheckImpl toDestinationPort(int port) { - ensureConnectivityDestination().withPort(port); - return this; - } - - @Override - public ConnectivityCheckImpl fromSourcePort(int port) { - ensureConnectivitySource().withPort(port); - return this; - } - - @Override - public ConnectivityCheckImpl withProtocol(Protocol protocol) { - parameters.withProtocol(protocol); - return this; - } - - private ConnectivitySource ensureConnectivitySource() { - if (parameters.source() == null) { - parameters.withSource(new ConnectivitySource()); - } - return parameters.source(); - } - - private ConnectivityDestination ensureConnectivityDestination() { - if (parameters.destination() == null) { - parameters.withDestination(new ConnectivityDestination()); - } - return parameters.destination(); - } - - @Override - public NetworkWatcherImpl parent() { - return parent; - } - - @Override - public List hops() { - return result.hops(); - } - - @Override - public ConnectionStatus connectionStatus() { - return result.connectionStatus(); - } - - @Override - public int avgLatencyInMs() { - return ResourceManagerUtils.toPrimitiveInt(result.avgLatencyInMs()); - } - - @Override - public int minLatencyInMs() { - return ResourceManagerUtils.toPrimitiveInt(result.minLatencyInMs()); - } - - @Override - public int maxLatencyInMs() { - return ResourceManagerUtils.toPrimitiveInt(result.maxLatencyInMs()); - } - - @Override - public int probesSent() { - return ResourceManagerUtils.toPrimitiveInt(result.probesSent()); - } - - @Override - public int probesFailed() { - return ResourceManagerUtils.toPrimitiveInt(result.probesFailed()); - } - - @Override - public Mono executeWorkAsync() { - return this - .parent() - .manager() - .serviceClient() - .getNetworkWatchers() - .checkConnectivityAsync(parent.resourceGroupName(), parent.name(), parameters) - .map( - connectivityInformation -> { - ConnectivityCheckImpl.this.result = connectivityInformation; - return ConnectivityCheckImpl.this; - }); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/DdosCustomPoliciesClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/DdosCustomPoliciesClientImpl.java deleted file mode 100644 index fd304f33d2a9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/DdosCustomPoliciesClientImpl.java +++ /dev/null @@ -1,1062 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.DdosCustomPoliciesClient; -import com.azure.resourcemanager.network.fluent.models.DdosCustomPolicyInner; -import com.azure.resourcemanager.network.models.TagsObject; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in DdosCustomPoliciesClient. */ -public final class DdosCustomPoliciesClientImpl - implements InnerSupportsGet, InnerSupportsDelete, DdosCustomPoliciesClient { - private final ClientLogger logger = new ClientLogger(DdosCustomPoliciesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final DdosCustomPoliciesService service; - - /** The service client containing this operation class. */ - private final NetworkManagementClientImpl client; - - /** - * Initializes an instance of DdosCustomPoliciesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - DdosCustomPoliciesClientImpl(NetworkManagementClientImpl client) { - this.service = - RestProxy.create(DdosCustomPoliciesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for NetworkManagementClientDdosCustomPolicies to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "NetworkManagementCli") - private interface DdosCustomPoliciesService { - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/ddosCustomPolicies/{ddosCustomPolicyName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("ddosCustomPolicyName") String ddosCustomPolicyName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/ddosCustomPolicies/{ddosCustomPolicyName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("ddosCustomPolicyName") String ddosCustomPolicyName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/ddosCustomPolicies/{ddosCustomPolicyName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("ddosCustomPolicyName") String ddosCustomPolicyName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") DdosCustomPolicyInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/ddosCustomPolicies/{ddosCustomPolicyName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> updateTags( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("ddosCustomPolicyName") String ddosCustomPolicyName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") TagsObject parameters, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Deletes the specified DDoS custom policy. - * - * @param resourceGroupName The name of the resource group. - * @param ddosCustomPolicyName The name of the DDoS custom policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync( - String resourceGroupName, String ddosCustomPolicyName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ddosCustomPolicyName == null) { - return Mono - .error(new IllegalArgumentException("Parameter ddosCustomPolicyName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - ddosCustomPolicyName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the specified DDoS custom policy. - * - * @param resourceGroupName The name of the resource group. - * @param ddosCustomPolicyName The name of the DDoS custom policy. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String ddosCustomPolicyName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ddosCustomPolicyName == null) { - return Mono - .error(new IllegalArgumentException("Parameter ddosCustomPolicyName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - ddosCustomPolicyName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Deletes the specified DDoS custom policy. - * - * @param resourceGroupName The name of the resource group. - * @param ddosCustomPolicyName The name of the DDoS custom policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String ddosCustomPolicyName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, ddosCustomPolicyName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deletes the specified DDoS custom policy. - * - * @param resourceGroupName The name of the resource group. - * @param ddosCustomPolicyName The name of the DDoS custom policy. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String ddosCustomPolicyName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, ddosCustomPolicyName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes the specified DDoS custom policy. - * - * @param resourceGroupName The name of the resource group. - * @param ddosCustomPolicyName The name of the DDoS custom policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete(String resourceGroupName, String ddosCustomPolicyName) { - return beginDeleteAsync(resourceGroupName, ddosCustomPolicyName).getSyncPoller(); - } - - /** - * Deletes the specified DDoS custom policy. - * - * @param resourceGroupName The name of the resource group. - * @param ddosCustomPolicyName The name of the DDoS custom policy. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String ddosCustomPolicyName, Context context) { - return beginDeleteAsync(resourceGroupName, ddosCustomPolicyName, context).getSyncPoller(); - } - - /** - * Deletes the specified DDoS custom policy. - * - * @param resourceGroupName The name of the resource group. - * @param ddosCustomPolicyName The name of the DDoS custom policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String ddosCustomPolicyName) { - return beginDeleteAsync(resourceGroupName, ddosCustomPolicyName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified DDoS custom policy. - * - * @param resourceGroupName The name of the resource group. - * @param ddosCustomPolicyName The name of the DDoS custom policy. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String ddosCustomPolicyName, Context context) { - return beginDeleteAsync(resourceGroupName, ddosCustomPolicyName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified DDoS custom policy. - * - * @param resourceGroupName The name of the resource group. - * @param ddosCustomPolicyName The name of the DDoS custom policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String ddosCustomPolicyName) { - deleteAsync(resourceGroupName, ddosCustomPolicyName).block(); - } - - /** - * Deletes the specified DDoS custom policy. - * - * @param resourceGroupName The name of the resource group. - * @param ddosCustomPolicyName The name of the DDoS custom policy. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String ddosCustomPolicyName, Context context) { - deleteAsync(resourceGroupName, ddosCustomPolicyName, context).block(); - } - - /** - * Gets information about the specified DDoS custom policy. - * - * @param resourceGroupName The name of the resource group. - * @param ddosCustomPolicyName The name of the DDoS custom policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified DDoS custom policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String ddosCustomPolicyName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ddosCustomPolicyName == null) { - return Mono - .error(new IllegalArgumentException("Parameter ddosCustomPolicyName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - ddosCustomPolicyName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets information about the specified DDoS custom policy. - * - * @param resourceGroupName The name of the resource group. - * @param ddosCustomPolicyName The name of the DDoS custom policy. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified DDoS custom policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String ddosCustomPolicyName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ddosCustomPolicyName == null) { - return Mono - .error(new IllegalArgumentException("Parameter ddosCustomPolicyName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - ddosCustomPolicyName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets information about the specified DDoS custom policy. - * - * @param resourceGroupName The name of the resource group. - * @param ddosCustomPolicyName The name of the DDoS custom policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified DDoS custom policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync(String resourceGroupName, String ddosCustomPolicyName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, ddosCustomPolicyName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets information about the specified DDoS custom policy. - * - * @param resourceGroupName The name of the resource group. - * @param ddosCustomPolicyName The name of the DDoS custom policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified DDoS custom policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DdosCustomPolicyInner getByResourceGroup(String resourceGroupName, String ddosCustomPolicyName) { - return getByResourceGroupAsync(resourceGroupName, ddosCustomPolicyName).block(); - } - - /** - * Gets information about the specified DDoS custom policy. - * - * @param resourceGroupName The name of the resource group. - * @param ddosCustomPolicyName The name of the DDoS custom policy. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified DDoS custom policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String ddosCustomPolicyName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, ddosCustomPolicyName, context).block(); - } - - /** - * Creates or updates a DDoS custom policy. - * - * @param resourceGroupName The name of the resource group. - * @param ddosCustomPolicyName The name of the DDoS custom policy. - * @param parameters Parameters supplied to the create or update operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DDoS custom policy in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String ddosCustomPolicyName, DdosCustomPolicyInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ddosCustomPolicyName == null) { - return Mono - .error(new IllegalArgumentException("Parameter ddosCustomPolicyName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - ddosCustomPolicyName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a DDoS custom policy. - * - * @param resourceGroupName The name of the resource group. - * @param ddosCustomPolicyName The name of the DDoS custom policy. - * @param parameters Parameters supplied to the create or update operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DDoS custom policy in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String ddosCustomPolicyName, DdosCustomPolicyInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ddosCustomPolicyName == null) { - return Mono - .error(new IllegalArgumentException("Parameter ddosCustomPolicyName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - ddosCustomPolicyName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Creates or updates a DDoS custom policy. - * - * @param resourceGroupName The name of the resource group. - * @param ddosCustomPolicyName The name of the DDoS custom policy. - * @param parameters Parameters supplied to the create or update operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DDoS custom policy in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, DdosCustomPolicyInner> beginCreateOrUpdateAsync( - String resourceGroupName, String ddosCustomPolicyName, DdosCustomPolicyInner parameters) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, ddosCustomPolicyName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - DdosCustomPolicyInner.class, - DdosCustomPolicyInner.class, - Context.NONE); - } - - /** - * Creates or updates a DDoS custom policy. - * - * @param resourceGroupName The name of the resource group. - * @param ddosCustomPolicyName The name of the DDoS custom policy. - * @param parameters Parameters supplied to the create or update operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DDoS custom policy in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, DdosCustomPolicyInner> beginCreateOrUpdateAsync( - String resourceGroupName, String ddosCustomPolicyName, DdosCustomPolicyInner parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, ddosCustomPolicyName, parameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), DdosCustomPolicyInner.class, DdosCustomPolicyInner.class, context); - } - - /** - * Creates or updates a DDoS custom policy. - * - * @param resourceGroupName The name of the resource group. - * @param ddosCustomPolicyName The name of the DDoS custom policy. - * @param parameters Parameters supplied to the create or update operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DDoS custom policy in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, DdosCustomPolicyInner> beginCreateOrUpdate( - String resourceGroupName, String ddosCustomPolicyName, DdosCustomPolicyInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, ddosCustomPolicyName, parameters).getSyncPoller(); - } - - /** - * Creates or updates a DDoS custom policy. - * - * @param resourceGroupName The name of the resource group. - * @param ddosCustomPolicyName The name of the DDoS custom policy. - * @param parameters Parameters supplied to the create or update operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DDoS custom policy in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, DdosCustomPolicyInner> beginCreateOrUpdate( - String resourceGroupName, String ddosCustomPolicyName, DdosCustomPolicyInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, ddosCustomPolicyName, parameters, context).getSyncPoller(); - } - - /** - * Creates or updates a DDoS custom policy. - * - * @param resourceGroupName The name of the resource group. - * @param ddosCustomPolicyName The name of the DDoS custom policy. - * @param parameters Parameters supplied to the create or update operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DDoS custom policy in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, String ddosCustomPolicyName, DdosCustomPolicyInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, ddosCustomPolicyName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a DDoS custom policy. - * - * @param resourceGroupName The name of the resource group. - * @param ddosCustomPolicyName The name of the DDoS custom policy. - * @param parameters Parameters supplied to the create or update operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DDoS custom policy in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String ddosCustomPolicyName, DdosCustomPolicyInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, ddosCustomPolicyName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a DDoS custom policy. - * - * @param resourceGroupName The name of the resource group. - * @param ddosCustomPolicyName The name of the DDoS custom policy. - * @param parameters Parameters supplied to the create or update operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DDoS custom policy in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DdosCustomPolicyInner createOrUpdate( - String resourceGroupName, String ddosCustomPolicyName, DdosCustomPolicyInner parameters) { - return createOrUpdateAsync(resourceGroupName, ddosCustomPolicyName, parameters).block(); - } - - /** - * Creates or updates a DDoS custom policy. - * - * @param resourceGroupName The name of the resource group. - * @param ddosCustomPolicyName The name of the DDoS custom policy. - * @param parameters Parameters supplied to the create or update operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DDoS custom policy in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DdosCustomPolicyInner createOrUpdate( - String resourceGroupName, String ddosCustomPolicyName, DdosCustomPolicyInner parameters, Context context) { - return createOrUpdateAsync(resourceGroupName, ddosCustomPolicyName, parameters, context).block(); - } - - /** - * Update a DDoS custom policy tags. - * - * @param resourceGroupName The name of the resource group. - * @param ddosCustomPolicyName The name of the DDoS custom policy. - * @param parameters Parameters supplied to the update DDoS custom policy resource tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DDoS custom policy in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateTagsWithResponseAsync( - String resourceGroupName, String ddosCustomPolicyName, TagsObject parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ddosCustomPolicyName == null) { - return Mono - .error(new IllegalArgumentException("Parameter ddosCustomPolicyName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updateTags( - this.client.getEndpoint(), - resourceGroupName, - ddosCustomPolicyName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Update a DDoS custom policy tags. - * - * @param resourceGroupName The name of the resource group. - * @param ddosCustomPolicyName The name of the DDoS custom policy. - * @param parameters Parameters supplied to the update DDoS custom policy resource tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DDoS custom policy in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateTagsWithResponseAsync( - String resourceGroupName, String ddosCustomPolicyName, TagsObject parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ddosCustomPolicyName == null) { - return Mono - .error(new IllegalArgumentException("Parameter ddosCustomPolicyName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updateTags( - this.client.getEndpoint(), - resourceGroupName, - ddosCustomPolicyName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Update a DDoS custom policy tags. - * - * @param resourceGroupName The name of the resource group. - * @param ddosCustomPolicyName The name of the DDoS custom policy. - * @param parameters Parameters supplied to the update DDoS custom policy resource tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DDoS custom policy in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, DdosCustomPolicyInner> beginUpdateTagsAsync( - String resourceGroupName, String ddosCustomPolicyName, TagsObject parameters) { - Mono>> mono = - updateTagsWithResponseAsync(resourceGroupName, ddosCustomPolicyName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - DdosCustomPolicyInner.class, - DdosCustomPolicyInner.class, - Context.NONE); - } - - /** - * Update a DDoS custom policy tags. - * - * @param resourceGroupName The name of the resource group. - * @param ddosCustomPolicyName The name of the DDoS custom policy. - * @param parameters Parameters supplied to the update DDoS custom policy resource tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DDoS custom policy in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, DdosCustomPolicyInner> beginUpdateTagsAsync( - String resourceGroupName, String ddosCustomPolicyName, TagsObject parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - updateTagsWithResponseAsync(resourceGroupName, ddosCustomPolicyName, parameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), DdosCustomPolicyInner.class, DdosCustomPolicyInner.class, context); - } - - /** - * Update a DDoS custom policy tags. - * - * @param resourceGroupName The name of the resource group. - * @param ddosCustomPolicyName The name of the DDoS custom policy. - * @param parameters Parameters supplied to the update DDoS custom policy resource tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DDoS custom policy in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, DdosCustomPolicyInner> beginUpdateTags( - String resourceGroupName, String ddosCustomPolicyName, TagsObject parameters) { - return beginUpdateTagsAsync(resourceGroupName, ddosCustomPolicyName, parameters).getSyncPoller(); - } - - /** - * Update a DDoS custom policy tags. - * - * @param resourceGroupName The name of the resource group. - * @param ddosCustomPolicyName The name of the DDoS custom policy. - * @param parameters Parameters supplied to the update DDoS custom policy resource tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DDoS custom policy in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, DdosCustomPolicyInner> beginUpdateTags( - String resourceGroupName, String ddosCustomPolicyName, TagsObject parameters, Context context) { - return beginUpdateTagsAsync(resourceGroupName, ddosCustomPolicyName, parameters, context).getSyncPoller(); - } - - /** - * Update a DDoS custom policy tags. - * - * @param resourceGroupName The name of the resource group. - * @param ddosCustomPolicyName The name of the DDoS custom policy. - * @param parameters Parameters supplied to the update DDoS custom policy resource tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DDoS custom policy in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateTagsAsync( - String resourceGroupName, String ddosCustomPolicyName, TagsObject parameters) { - return beginUpdateTagsAsync(resourceGroupName, ddosCustomPolicyName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Update a DDoS custom policy tags. - * - * @param resourceGroupName The name of the resource group. - * @param ddosCustomPolicyName The name of the DDoS custom policy. - * @param parameters Parameters supplied to the update DDoS custom policy resource tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DDoS custom policy in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateTagsAsync( - String resourceGroupName, String ddosCustomPolicyName, TagsObject parameters, Context context) { - return beginUpdateTagsAsync(resourceGroupName, ddosCustomPolicyName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Update a DDoS custom policy tags. - * - * @param resourceGroupName The name of the resource group. - * @param ddosCustomPolicyName The name of the DDoS custom policy. - * @param parameters Parameters supplied to the update DDoS custom policy resource tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DDoS custom policy in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DdosCustomPolicyInner updateTags( - String resourceGroupName, String ddosCustomPolicyName, TagsObject parameters) { - return updateTagsAsync(resourceGroupName, ddosCustomPolicyName, parameters).block(); - } - - /** - * Update a DDoS custom policy tags. - * - * @param resourceGroupName The name of the resource group. - * @param ddosCustomPolicyName The name of the DDoS custom policy. - * @param parameters Parameters supplied to the update DDoS custom policy resource tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DDoS custom policy in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DdosCustomPolicyInner updateTags( - String resourceGroupName, String ddosCustomPolicyName, TagsObject parameters, Context context) { - return updateTagsAsync(resourceGroupName, ddosCustomPolicyName, parameters, context).block(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/DdosProtectionPlanImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/DdosProtectionPlanImpl.java deleted file mode 100644 index e4f5fe6216f0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/DdosProtectionPlanImpl.java +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.management.SubResource; -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.network.models.DdosProtectionPlan; -import com.azure.resourcemanager.network.fluent.models.DdosProtectionPlanInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.GroupableResourceImpl; -import java.util.Collections; -import java.util.List; -import reactor.core.publisher.Mono; - -/** Implementation for DdosProtectionPlan and its create and update interfaces. */ -class DdosProtectionPlanImpl - extends GroupableResourceImpl - implements DdosProtectionPlan, DdosProtectionPlan.Definition, DdosProtectionPlan.Update { - - DdosProtectionPlanImpl( - final String name, final DdosProtectionPlanInner innerModel, final NetworkManager networkManager) { - super(name, innerModel, networkManager); - } - - @Override - protected Mono getInnerAsync() { - return this - .manager() - .serviceClient() - .getDdosProtectionPlans() - .getByResourceGroupAsync(this.resourceGroupName(), this.name()); - } - - @Override - public Mono createResourceAsync() { - return this - .manager() - .serviceClient() - .getDdosProtectionPlans() - .createOrUpdateAsync(resourceGroupName(), name(), innerModel()) - .map(innerToFluentMap(this)); - } - - @Override - public String resourceGuid() { - return innerModel().resourceGuid(); - } - - @Override - public String provisioningState() { - return innerModel().provisioningState(); - } - - @Override - public List virtualNetworks() { - return Collections.unmodifiableList(innerModel().virtualNetworks()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/DdosProtectionPlansClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/DdosProtectionPlansClientImpl.java deleted file mode 100644 index 20d28403716b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/DdosProtectionPlansClientImpl.java +++ /dev/null @@ -1,1570 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.DdosProtectionPlansClient; -import com.azure.resourcemanager.network.fluent.models.DdosProtectionPlanInner; -import com.azure.resourcemanager.network.models.DdosProtectionPlanListResult; -import com.azure.resourcemanager.network.models.TagsObject; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in DdosProtectionPlansClient. */ -public final class DdosProtectionPlansClientImpl - implements InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete, - DdosProtectionPlansClient { - private final ClientLogger logger = new ClientLogger(DdosProtectionPlansClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final DdosProtectionPlansService service; - - /** The service client containing this operation class. */ - private final NetworkManagementClientImpl client; - - /** - * Initializes an instance of DdosProtectionPlansClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - DdosProtectionPlansClientImpl(NetworkManagementClientImpl client) { - this.service = - RestProxy.create(DdosProtectionPlansService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for NetworkManagementClientDdosProtectionPlans to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "NetworkManagementCli") - private interface DdosProtectionPlansService { - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/ddosProtectionPlans/{ddosProtectionPlanName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("ddosProtectionPlanName") String ddosProtectionPlanName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/ddosProtectionPlans/{ddosProtectionPlanName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("ddosProtectionPlanName") String ddosProtectionPlanName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/ddosProtectionPlans/{ddosProtectionPlanName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("ddosProtectionPlanName") String ddosProtectionPlanName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") DdosProtectionPlanInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/ddosProtectionPlans/{ddosProtectionPlanName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> updateTags( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("ddosProtectionPlanName") String ddosProtectionPlanName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") TagsObject parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/ddosProtectionPlans") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/ddosProtectionPlans") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Deletes the specified DDoS protection plan. - * - * @param resourceGroupName The name of the resource group. - * @param ddosProtectionPlanName The name of the DDoS protection plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync( - String resourceGroupName, String ddosProtectionPlanName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ddosProtectionPlanName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter ddosProtectionPlanName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - ddosProtectionPlanName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the specified DDoS protection plan. - * - * @param resourceGroupName The name of the resource group. - * @param ddosProtectionPlanName The name of the DDoS protection plan. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String ddosProtectionPlanName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ddosProtectionPlanName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter ddosProtectionPlanName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - ddosProtectionPlanName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Deletes the specified DDoS protection plan. - * - * @param resourceGroupName The name of the resource group. - * @param ddosProtectionPlanName The name of the DDoS protection plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String ddosProtectionPlanName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, ddosProtectionPlanName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deletes the specified DDoS protection plan. - * - * @param resourceGroupName The name of the resource group. - * @param ddosProtectionPlanName The name of the DDoS protection plan. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String ddosProtectionPlanName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, ddosProtectionPlanName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes the specified DDoS protection plan. - * - * @param resourceGroupName The name of the resource group. - * @param ddosProtectionPlanName The name of the DDoS protection plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete(String resourceGroupName, String ddosProtectionPlanName) { - return beginDeleteAsync(resourceGroupName, ddosProtectionPlanName).getSyncPoller(); - } - - /** - * Deletes the specified DDoS protection plan. - * - * @param resourceGroupName The name of the resource group. - * @param ddosProtectionPlanName The name of the DDoS protection plan. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String ddosProtectionPlanName, Context context) { - return beginDeleteAsync(resourceGroupName, ddosProtectionPlanName, context).getSyncPoller(); - } - - /** - * Deletes the specified DDoS protection plan. - * - * @param resourceGroupName The name of the resource group. - * @param ddosProtectionPlanName The name of the DDoS protection plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String ddosProtectionPlanName) { - return beginDeleteAsync(resourceGroupName, ddosProtectionPlanName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified DDoS protection plan. - * - * @param resourceGroupName The name of the resource group. - * @param ddosProtectionPlanName The name of the DDoS protection plan. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String ddosProtectionPlanName, Context context) { - return beginDeleteAsync(resourceGroupName, ddosProtectionPlanName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified DDoS protection plan. - * - * @param resourceGroupName The name of the resource group. - * @param ddosProtectionPlanName The name of the DDoS protection plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String ddosProtectionPlanName) { - deleteAsync(resourceGroupName, ddosProtectionPlanName).block(); - } - - /** - * Deletes the specified DDoS protection plan. - * - * @param resourceGroupName The name of the resource group. - * @param ddosProtectionPlanName The name of the DDoS protection plan. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String ddosProtectionPlanName, Context context) { - deleteAsync(resourceGroupName, ddosProtectionPlanName, context).block(); - } - - /** - * Gets information about the specified DDoS protection plan. - * - * @param resourceGroupName The name of the resource group. - * @param ddosProtectionPlanName The name of the DDoS protection plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified DDoS protection plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String ddosProtectionPlanName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ddosProtectionPlanName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter ddosProtectionPlanName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - ddosProtectionPlanName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets information about the specified DDoS protection plan. - * - * @param resourceGroupName The name of the resource group. - * @param ddosProtectionPlanName The name of the DDoS protection plan. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified DDoS protection plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String ddosProtectionPlanName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ddosProtectionPlanName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter ddosProtectionPlanName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - ddosProtectionPlanName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets information about the specified DDoS protection plan. - * - * @param resourceGroupName The name of the resource group. - * @param ddosProtectionPlanName The name of the DDoS protection plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified DDoS protection plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync( - String resourceGroupName, String ddosProtectionPlanName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, ddosProtectionPlanName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets information about the specified DDoS protection plan. - * - * @param resourceGroupName The name of the resource group. - * @param ddosProtectionPlanName The name of the DDoS protection plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified DDoS protection plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DdosProtectionPlanInner getByResourceGroup(String resourceGroupName, String ddosProtectionPlanName) { - return getByResourceGroupAsync(resourceGroupName, ddosProtectionPlanName).block(); - } - - /** - * Gets information about the specified DDoS protection plan. - * - * @param resourceGroupName The name of the resource group. - * @param ddosProtectionPlanName The name of the DDoS protection plan. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified DDoS protection plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String ddosProtectionPlanName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, ddosProtectionPlanName, context).block(); - } - - /** - * Creates or updates a DDoS protection plan. - * - * @param resourceGroupName The name of the resource group. - * @param ddosProtectionPlanName The name of the DDoS protection plan. - * @param parameters Parameters supplied to the create or update operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DDoS protection plan in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String ddosProtectionPlanName, DdosProtectionPlanInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ddosProtectionPlanName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter ddosProtectionPlanName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - ddosProtectionPlanName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a DDoS protection plan. - * - * @param resourceGroupName The name of the resource group. - * @param ddosProtectionPlanName The name of the DDoS protection plan. - * @param parameters Parameters supplied to the create or update operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DDoS protection plan in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String ddosProtectionPlanName, DdosProtectionPlanInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ddosProtectionPlanName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter ddosProtectionPlanName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - ddosProtectionPlanName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Creates or updates a DDoS protection plan. - * - * @param resourceGroupName The name of the resource group. - * @param ddosProtectionPlanName The name of the DDoS protection plan. - * @param parameters Parameters supplied to the create or update operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DDoS protection plan in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, DdosProtectionPlanInner> beginCreateOrUpdateAsync( - String resourceGroupName, String ddosProtectionPlanName, DdosProtectionPlanInner parameters) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, ddosProtectionPlanName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - DdosProtectionPlanInner.class, - DdosProtectionPlanInner.class, - Context.NONE); - } - - /** - * Creates or updates a DDoS protection plan. - * - * @param resourceGroupName The name of the resource group. - * @param ddosProtectionPlanName The name of the DDoS protection plan. - * @param parameters Parameters supplied to the create or update operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DDoS protection plan in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, DdosProtectionPlanInner> beginCreateOrUpdateAsync( - String resourceGroupName, String ddosProtectionPlanName, DdosProtectionPlanInner parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, ddosProtectionPlanName, parameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - DdosProtectionPlanInner.class, - DdosProtectionPlanInner.class, - context); - } - - /** - * Creates or updates a DDoS protection plan. - * - * @param resourceGroupName The name of the resource group. - * @param ddosProtectionPlanName The name of the DDoS protection plan. - * @param parameters Parameters supplied to the create or update operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DDoS protection plan in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, DdosProtectionPlanInner> beginCreateOrUpdate( - String resourceGroupName, String ddosProtectionPlanName, DdosProtectionPlanInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, ddosProtectionPlanName, parameters).getSyncPoller(); - } - - /** - * Creates or updates a DDoS protection plan. - * - * @param resourceGroupName The name of the resource group. - * @param ddosProtectionPlanName The name of the DDoS protection plan. - * @param parameters Parameters supplied to the create or update operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DDoS protection plan in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, DdosProtectionPlanInner> beginCreateOrUpdate( - String resourceGroupName, String ddosProtectionPlanName, DdosProtectionPlanInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, ddosProtectionPlanName, parameters, context).getSyncPoller(); - } - - /** - * Creates or updates a DDoS protection plan. - * - * @param resourceGroupName The name of the resource group. - * @param ddosProtectionPlanName The name of the DDoS protection plan. - * @param parameters Parameters supplied to the create or update operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DDoS protection plan in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, String ddosProtectionPlanName, DdosProtectionPlanInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, ddosProtectionPlanName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a DDoS protection plan. - * - * @param resourceGroupName The name of the resource group. - * @param ddosProtectionPlanName The name of the DDoS protection plan. - * @param parameters Parameters supplied to the create or update operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DDoS protection plan in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String ddosProtectionPlanName, DdosProtectionPlanInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, ddosProtectionPlanName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a DDoS protection plan. - * - * @param resourceGroupName The name of the resource group. - * @param ddosProtectionPlanName The name of the DDoS protection plan. - * @param parameters Parameters supplied to the create or update operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DDoS protection plan in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DdosProtectionPlanInner createOrUpdate( - String resourceGroupName, String ddosProtectionPlanName, DdosProtectionPlanInner parameters) { - return createOrUpdateAsync(resourceGroupName, ddosProtectionPlanName, parameters).block(); - } - - /** - * Creates or updates a DDoS protection plan. - * - * @param resourceGroupName The name of the resource group. - * @param ddosProtectionPlanName The name of the DDoS protection plan. - * @param parameters Parameters supplied to the create or update operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DDoS protection plan in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DdosProtectionPlanInner createOrUpdate( - String resourceGroupName, String ddosProtectionPlanName, DdosProtectionPlanInner parameters, Context context) { - return createOrUpdateAsync(resourceGroupName, ddosProtectionPlanName, parameters, context).block(); - } - - /** - * Update a DDoS protection plan tags. - * - * @param resourceGroupName The name of the resource group. - * @param ddosProtectionPlanName The name of the DDoS protection plan. - * @param parameters Parameters supplied to the update DDoS protection plan resource tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DDoS protection plan in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateTagsWithResponseAsync( - String resourceGroupName, String ddosProtectionPlanName, TagsObject parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ddosProtectionPlanName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter ddosProtectionPlanName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updateTags( - this.client.getEndpoint(), - resourceGroupName, - ddosProtectionPlanName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Update a DDoS protection plan tags. - * - * @param resourceGroupName The name of the resource group. - * @param ddosProtectionPlanName The name of the DDoS protection plan. - * @param parameters Parameters supplied to the update DDoS protection plan resource tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DDoS protection plan in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateTagsWithResponseAsync( - String resourceGroupName, String ddosProtectionPlanName, TagsObject parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ddosProtectionPlanName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter ddosProtectionPlanName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updateTags( - this.client.getEndpoint(), - resourceGroupName, - ddosProtectionPlanName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Update a DDoS protection plan tags. - * - * @param resourceGroupName The name of the resource group. - * @param ddosProtectionPlanName The name of the DDoS protection plan. - * @param parameters Parameters supplied to the update DDoS protection plan resource tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DDoS protection plan in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, DdosProtectionPlanInner> beginUpdateTagsAsync( - String resourceGroupName, String ddosProtectionPlanName, TagsObject parameters) { - Mono>> mono = - updateTagsWithResponseAsync(resourceGroupName, ddosProtectionPlanName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - DdosProtectionPlanInner.class, - DdosProtectionPlanInner.class, - Context.NONE); - } - - /** - * Update a DDoS protection plan tags. - * - * @param resourceGroupName The name of the resource group. - * @param ddosProtectionPlanName The name of the DDoS protection plan. - * @param parameters Parameters supplied to the update DDoS protection plan resource tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DDoS protection plan in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, DdosProtectionPlanInner> beginUpdateTagsAsync( - String resourceGroupName, String ddosProtectionPlanName, TagsObject parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - updateTagsWithResponseAsync(resourceGroupName, ddosProtectionPlanName, parameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - DdosProtectionPlanInner.class, - DdosProtectionPlanInner.class, - context); - } - - /** - * Update a DDoS protection plan tags. - * - * @param resourceGroupName The name of the resource group. - * @param ddosProtectionPlanName The name of the DDoS protection plan. - * @param parameters Parameters supplied to the update DDoS protection plan resource tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DDoS protection plan in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, DdosProtectionPlanInner> beginUpdateTags( - String resourceGroupName, String ddosProtectionPlanName, TagsObject parameters) { - return beginUpdateTagsAsync(resourceGroupName, ddosProtectionPlanName, parameters).getSyncPoller(); - } - - /** - * Update a DDoS protection plan tags. - * - * @param resourceGroupName The name of the resource group. - * @param ddosProtectionPlanName The name of the DDoS protection plan. - * @param parameters Parameters supplied to the update DDoS protection plan resource tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DDoS protection plan in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, DdosProtectionPlanInner> beginUpdateTags( - String resourceGroupName, String ddosProtectionPlanName, TagsObject parameters, Context context) { - return beginUpdateTagsAsync(resourceGroupName, ddosProtectionPlanName, parameters, context).getSyncPoller(); - } - - /** - * Update a DDoS protection plan tags. - * - * @param resourceGroupName The name of the resource group. - * @param ddosProtectionPlanName The name of the DDoS protection plan. - * @param parameters Parameters supplied to the update DDoS protection plan resource tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DDoS protection plan in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateTagsAsync( - String resourceGroupName, String ddosProtectionPlanName, TagsObject parameters) { - return beginUpdateTagsAsync(resourceGroupName, ddosProtectionPlanName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Update a DDoS protection plan tags. - * - * @param resourceGroupName The name of the resource group. - * @param ddosProtectionPlanName The name of the DDoS protection plan. - * @param parameters Parameters supplied to the update DDoS protection plan resource tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DDoS protection plan in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateTagsAsync( - String resourceGroupName, String ddosProtectionPlanName, TagsObject parameters, Context context) { - return beginUpdateTagsAsync(resourceGroupName, ddosProtectionPlanName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Update a DDoS protection plan tags. - * - * @param resourceGroupName The name of the resource group. - * @param ddosProtectionPlanName The name of the DDoS protection plan. - * @param parameters Parameters supplied to the update DDoS protection plan resource tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DDoS protection plan in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DdosProtectionPlanInner updateTags( - String resourceGroupName, String ddosProtectionPlanName, TagsObject parameters) { - return updateTagsAsync(resourceGroupName, ddosProtectionPlanName, parameters).block(); - } - - /** - * Update a DDoS protection plan tags. - * - * @param resourceGroupName The name of the resource group. - * @param ddosProtectionPlanName The name of the DDoS protection plan. - * @param parameters Parameters supplied to the update DDoS protection plan resource tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DDoS protection plan in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DdosProtectionPlanInner updateTags( - String resourceGroupName, String ddosProtectionPlanName, TagsObject parameters, Context context) { - return updateTagsAsync(resourceGroupName, ddosProtectionPlanName, parameters, context).block(); - } - - /** - * Gets all DDoS protection plans in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all DDoS protection plans in a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all DDoS protection plans in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all DDoS protection plans in a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all DDoS protection plans in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all DDoS protection plans in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets all DDoS protection plans in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all DDoS protection plans in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all DDoS protection plans in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all DDoS protection plans in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Gets all DDoS protection plans in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all DDoS protection plans in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Gets all the DDoS protection plans in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the DDoS protection plans in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all the DDoS protection plans in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the DDoS protection plans in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all the DDoS protection plans in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the DDoS protection plans in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * Gets all the DDoS protection plans in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the DDoS protection plans in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all the DDoS protection plans in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the DDoS protection plans in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * Gets all the DDoS protection plans in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the DDoS protection plans in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of DDoS protection plans. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of DDoS protection plans. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of DDoS protection plans. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of DDoS protection plans. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/DdosProtectionPlansImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/DdosProtectionPlansImpl.java deleted file mode 100644 index 93ca6fefc23a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/DdosProtectionPlansImpl.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.network.fluent.DdosProtectionPlansClient; -import com.azure.resourcemanager.network.fluent.models.DdosProtectionPlanInner; -import com.azure.resourcemanager.network.models.DdosProtectionPlan; -import com.azure.resourcemanager.network.models.DdosProtectionPlans; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.TopLevelModifiableResourcesImpl; - -/** Implementation for DdosProtectionPlans. */ -public class DdosProtectionPlansImpl - extends TopLevelModifiableResourcesImpl< - DdosProtectionPlan, DdosProtectionPlanImpl, DdosProtectionPlanInner, DdosProtectionPlansClient, NetworkManager> - implements DdosProtectionPlans { - - public DdosProtectionPlansImpl(final NetworkManager networkManager) { - super(networkManager.serviceClient().getDdosProtectionPlans(), networkManager); - } - - @Override - public DdosProtectionPlanImpl define(String name) { - return wrapModel(name); - } - - @Override - protected DdosProtectionPlanImpl wrapModel(String name) { - DdosProtectionPlanInner inner = new DdosProtectionPlanInner(); - return new DdosProtectionPlanImpl(name, inner, super.manager()); - } - - @Override - protected DdosProtectionPlanImpl wrapModel(DdosProtectionPlanInner inner) { - if (inner == null) { - return null; - } - return new DdosProtectionPlanImpl(inner.name(), inner, this.manager()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/DefaultSecurityRulesClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/DefaultSecurityRulesClientImpl.java deleted file mode 100644 index 7762cadb7643..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/DefaultSecurityRulesClientImpl.java +++ /dev/null @@ -1,536 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.DefaultSecurityRulesClient; -import com.azure.resourcemanager.network.fluent.models.SecurityRuleInner; -import com.azure.resourcemanager.network.models.SecurityRuleListResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in DefaultSecurityRulesClient. */ -public final class DefaultSecurityRulesClientImpl implements DefaultSecurityRulesClient { - private final ClientLogger logger = new ClientLogger(DefaultSecurityRulesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final DefaultSecurityRulesService service; - - /** The service client containing this operation class. */ - private final NetworkManagementClientImpl client; - - /** - * Initializes an instance of DefaultSecurityRulesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - DefaultSecurityRulesClientImpl(NetworkManagementClientImpl client) { - this.service = - RestProxy - .create(DefaultSecurityRulesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for NetworkManagementClientDefaultSecurityRules to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "NetworkManagementCli") - private interface DefaultSecurityRulesService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/networkSecurityGroups/{networkSecurityGroupName}/defaultSecurityRules") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("networkSecurityGroupName") String networkSecurityGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/networkSecurityGroups/{networkSecurityGroupName}/defaultSecurityRules/{defaultSecurityRuleName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("networkSecurityGroupName") String networkSecurityGroupName, - @PathParam("defaultSecurityRuleName") String defaultSecurityRuleName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets all default security rules in a network security group. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all default security rules in a network security group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String networkSecurityGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkSecurityGroupName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - resourceGroupName, - networkSecurityGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all default security rules in a network security group. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all default security rules in a network security group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String networkSecurityGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkSecurityGroupName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - resourceGroupName, - networkSecurityGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all default security rules in a network security group. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all default security rules in a network security group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String resourceGroupName, String networkSecurityGroupName) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, networkSecurityGroupName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets all default security rules in a network security group. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all default security rules in a network security group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String networkSecurityGroupName, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, networkSecurityGroupName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all default security rules in a network security group. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all default security rules in a network security group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String networkSecurityGroupName) { - return new PagedIterable<>(listAsync(resourceGroupName, networkSecurityGroupName)); - } - - /** - * Gets all default security rules in a network security group. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all default security rules in a network security group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, String networkSecurityGroupName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, networkSecurityGroupName, context)); - } - - /** - * Get the specified default network security rule. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param defaultSecurityRuleName The name of the default security rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified default network security rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String resourceGroupName, String networkSecurityGroupName, String defaultSecurityRuleName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkSecurityGroupName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null.")); - } - if (defaultSecurityRuleName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter defaultSecurityRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - resourceGroupName, - networkSecurityGroupName, - defaultSecurityRuleName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the specified default network security rule. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param defaultSecurityRuleName The name of the default security rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified default network security rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String networkSecurityGroupName, String defaultSecurityRuleName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkSecurityGroupName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null.")); - } - if (defaultSecurityRuleName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter defaultSecurityRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - resourceGroupName, - networkSecurityGroupName, - defaultSecurityRuleName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Get the specified default network security rule. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param defaultSecurityRuleName The name of the default security rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified default network security rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync( - String resourceGroupName, String networkSecurityGroupName, String defaultSecurityRuleName) { - return getWithResponseAsync(resourceGroupName, networkSecurityGroupName, defaultSecurityRuleName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get the specified default network security rule. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param defaultSecurityRuleName The name of the default security rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified default network security rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SecurityRuleInner get( - String resourceGroupName, String networkSecurityGroupName, String defaultSecurityRuleName) { - return getAsync(resourceGroupName, networkSecurityGroupName, defaultSecurityRuleName).block(); - } - - /** - * Get the specified default network security rule. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param defaultSecurityRuleName The name of the default security rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified default network security rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String networkSecurityGroupName, String defaultSecurityRuleName, Context context) { - return getWithResponseAsync(resourceGroupName, networkSecurityGroupName, defaultSecurityRuleName, context) - .block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListSecurityRule API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListSecurityRule API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ExpressRouteCircuitAuthorizationsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ExpressRouteCircuitAuthorizationsClientImpl.java deleted file mode 100644 index 51b9002fa9df..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ExpressRouteCircuitAuthorizationsClientImpl.java +++ /dev/null @@ -1,1177 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.ExpressRouteCircuitAuthorizationsClient; -import com.azure.resourcemanager.network.fluent.models.ExpressRouteCircuitAuthorizationInner; -import com.azure.resourcemanager.network.models.AuthorizationListResult; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in ExpressRouteCircuitAuthorizationsClient. - */ -public final class ExpressRouteCircuitAuthorizationsClientImpl implements ExpressRouteCircuitAuthorizationsClient { - private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitAuthorizationsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final ExpressRouteCircuitAuthorizationsService service; - - /** The service client containing this operation class. */ - private final NetworkManagementClientImpl client; - - /** - * Initializes an instance of ExpressRouteCircuitAuthorizationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ExpressRouteCircuitAuthorizationsClientImpl(NetworkManagementClientImpl client) { - this.service = - RestProxy - .create( - ExpressRouteCircuitAuthorizationsService.class, - client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for NetworkManagementClientExpressRouteCircuitAuthorizations to be used - * by the proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "NetworkManagementCli") - private interface ExpressRouteCircuitAuthorizationsService { - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("circuitName") String circuitName, - @PathParam("authorizationName") String authorizationName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("circuitName") String circuitName, - @PathParam("authorizationName") String authorizationName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("circuitName") String circuitName, - @PathParam("authorizationName") String authorizationName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") ExpressRouteCircuitAuthorizationInner authorizationParameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/expressRouteCircuits/{circuitName}/authorizations") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("circuitName") String circuitName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Deletes the specified authorization from the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param authorizationName The name of the authorization. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync( - String resourceGroupName, String circuitName, String authorizationName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (circuitName == null) { - return Mono.error(new IllegalArgumentException("Parameter circuitName is required and cannot be null.")); - } - if (authorizationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter authorizationName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - circuitName, - authorizationName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the specified authorization from the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param authorizationName The name of the authorization. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String circuitName, String authorizationName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (circuitName == null) { - return Mono.error(new IllegalArgumentException("Parameter circuitName is required and cannot be null.")); - } - if (authorizationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter authorizationName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - circuitName, - authorizationName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Deletes the specified authorization from the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param authorizationName The name of the authorization. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String circuitName, String authorizationName) { - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, circuitName, authorizationName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deletes the specified authorization from the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param authorizationName The name of the authorization. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String circuitName, String authorizationName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, circuitName, authorizationName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes the specified authorization from the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param authorizationName The name of the authorization. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String circuitName, String authorizationName) { - return beginDeleteAsync(resourceGroupName, circuitName, authorizationName).getSyncPoller(); - } - - /** - * Deletes the specified authorization from the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param authorizationName The name of the authorization. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String circuitName, String authorizationName, Context context) { - return beginDeleteAsync(resourceGroupName, circuitName, authorizationName, context).getSyncPoller(); - } - - /** - * Deletes the specified authorization from the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param authorizationName The name of the authorization. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String circuitName, String authorizationName) { - return beginDeleteAsync(resourceGroupName, circuitName, authorizationName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified authorization from the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param authorizationName The name of the authorization. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync( - String resourceGroupName, String circuitName, String authorizationName, Context context) { - return beginDeleteAsync(resourceGroupName, circuitName, authorizationName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified authorization from the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param authorizationName The name of the authorization. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String circuitName, String authorizationName) { - deleteAsync(resourceGroupName, circuitName, authorizationName).block(); - } - - /** - * Deletes the specified authorization from the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param authorizationName The name of the authorization. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String circuitName, String authorizationName, Context context) { - deleteAsync(resourceGroupName, circuitName, authorizationName, context).block(); - } - - /** - * Gets the specified authorization from the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param authorizationName The name of the authorization. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified authorization from the specified express route circuit. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String resourceGroupName, String circuitName, String authorizationName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (circuitName == null) { - return Mono.error(new IllegalArgumentException("Parameter circuitName is required and cannot be null.")); - } - if (authorizationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter authorizationName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - resourceGroupName, - circuitName, - authorizationName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the specified authorization from the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param authorizationName The name of the authorization. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified authorization from the specified express route circuit. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String circuitName, String authorizationName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (circuitName == null) { - return Mono.error(new IllegalArgumentException("Parameter circuitName is required and cannot be null.")); - } - if (authorizationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter authorizationName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - resourceGroupName, - circuitName, - authorizationName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets the specified authorization from the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param authorizationName The name of the authorization. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified authorization from the specified express route circuit. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync( - String resourceGroupName, String circuitName, String authorizationName) { - return getWithResponseAsync(resourceGroupName, circuitName, authorizationName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the specified authorization from the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param authorizationName The name of the authorization. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified authorization from the specified express route circuit. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ExpressRouteCircuitAuthorizationInner get( - String resourceGroupName, String circuitName, String authorizationName) { - return getAsync(resourceGroupName, circuitName, authorizationName).block(); - } - - /** - * Gets the specified authorization from the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param authorizationName The name of the authorization. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified authorization from the specified express route circuit. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String circuitName, String authorizationName, Context context) { - return getWithResponseAsync(resourceGroupName, circuitName, authorizationName, context).block(); - } - - /** - * Creates or updates an authorization in the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param authorizationName The name of the authorization. - * @param authorizationParameters Parameters supplied to the create or update express route circuit authorization - * operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return authorization in an ExpressRouteCircuit resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String circuitName, - String authorizationName, - ExpressRouteCircuitAuthorizationInner authorizationParameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (circuitName == null) { - return Mono.error(new IllegalArgumentException("Parameter circuitName is required and cannot be null.")); - } - if (authorizationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter authorizationName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (authorizationParameters == null) { - return Mono - .error( - new IllegalArgumentException("Parameter authorizationParameters is required and cannot be null.")); - } else { - authorizationParameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - circuitName, - authorizationName, - apiVersion, - this.client.getSubscriptionId(), - authorizationParameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates an authorization in the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param authorizationName The name of the authorization. - * @param authorizationParameters Parameters supplied to the create or update express route circuit authorization - * operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return authorization in an ExpressRouteCircuit resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String circuitName, - String authorizationName, - ExpressRouteCircuitAuthorizationInner authorizationParameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (circuitName == null) { - return Mono.error(new IllegalArgumentException("Parameter circuitName is required and cannot be null.")); - } - if (authorizationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter authorizationName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (authorizationParameters == null) { - return Mono - .error( - new IllegalArgumentException("Parameter authorizationParameters is required and cannot be null.")); - } else { - authorizationParameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - circuitName, - authorizationName, - apiVersion, - this.client.getSubscriptionId(), - authorizationParameters, - accept, - context); - } - - /** - * Creates or updates an authorization in the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param authorizationName The name of the authorization. - * @param authorizationParameters Parameters supplied to the create or update express route circuit authorization - * operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return authorization in an ExpressRouteCircuit resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, ExpressRouteCircuitAuthorizationInner> - beginCreateOrUpdateAsync( - String resourceGroupName, - String circuitName, - String authorizationName, - ExpressRouteCircuitAuthorizationInner authorizationParameters) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ExpressRouteCircuitAuthorizationInner.class, - ExpressRouteCircuitAuthorizationInner.class, - Context.NONE); - } - - /** - * Creates or updates an authorization in the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param authorizationName The name of the authorization. - * @param authorizationParameters Parameters supplied to the create or update express route circuit authorization - * operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return authorization in an ExpressRouteCircuit resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, ExpressRouteCircuitAuthorizationInner> - beginCreateOrUpdateAsync( - String resourceGroupName, - String circuitName, - String authorizationName, - ExpressRouteCircuitAuthorizationInner authorizationParameters, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync( - resourceGroupName, circuitName, authorizationName, authorizationParameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ExpressRouteCircuitAuthorizationInner.class, - ExpressRouteCircuitAuthorizationInner.class, - context); - } - - /** - * Creates or updates an authorization in the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param authorizationName The name of the authorization. - * @param authorizationParameters Parameters supplied to the create or update express route circuit authorization - * operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return authorization in an ExpressRouteCircuit resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, ExpressRouteCircuitAuthorizationInner> - beginCreateOrUpdate( - String resourceGroupName, - String circuitName, - String authorizationName, - ExpressRouteCircuitAuthorizationInner authorizationParameters) { - return beginCreateOrUpdateAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters) - .getSyncPoller(); - } - - /** - * Creates or updates an authorization in the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param authorizationName The name of the authorization. - * @param authorizationParameters Parameters supplied to the create or update express route circuit authorization - * operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return authorization in an ExpressRouteCircuit resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, ExpressRouteCircuitAuthorizationInner> - beginCreateOrUpdate( - String resourceGroupName, - String circuitName, - String authorizationName, - ExpressRouteCircuitAuthorizationInner authorizationParameters, - Context context) { - return beginCreateOrUpdateAsync( - resourceGroupName, circuitName, authorizationName, authorizationParameters, context) - .getSyncPoller(); - } - - /** - * Creates or updates an authorization in the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param authorizationName The name of the authorization. - * @param authorizationParameters Parameters supplied to the create or update express route circuit authorization - * operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return authorization in an ExpressRouteCircuit resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, - String circuitName, - String authorizationName, - ExpressRouteCircuitAuthorizationInner authorizationParameters) { - return beginCreateOrUpdateAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates an authorization in the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param authorizationName The name of the authorization. - * @param authorizationParameters Parameters supplied to the create or update express route circuit authorization - * operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return authorization in an ExpressRouteCircuit resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, - String circuitName, - String authorizationName, - ExpressRouteCircuitAuthorizationInner authorizationParameters, - Context context) { - return beginCreateOrUpdateAsync( - resourceGroupName, circuitName, authorizationName, authorizationParameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates an authorization in the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param authorizationName The name of the authorization. - * @param authorizationParameters Parameters supplied to the create or update express route circuit authorization - * operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return authorization in an ExpressRouteCircuit resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ExpressRouteCircuitAuthorizationInner createOrUpdate( - String resourceGroupName, - String circuitName, - String authorizationName, - ExpressRouteCircuitAuthorizationInner authorizationParameters) { - return createOrUpdateAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters).block(); - } - - /** - * Creates or updates an authorization in the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param authorizationName The name of the authorization. - * @param authorizationParameters Parameters supplied to the create or update express route circuit authorization - * operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return authorization in an ExpressRouteCircuit resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ExpressRouteCircuitAuthorizationInner createOrUpdate( - String resourceGroupName, - String circuitName, - String authorizationName, - ExpressRouteCircuitAuthorizationInner authorizationParameters, - Context context) { - return createOrUpdateAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters, context) - .block(); - } - - /** - * Gets all authorizations in an express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the circuit. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all authorizations in an express route circuit. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String circuitName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (circuitName == null) { - return Mono.error(new IllegalArgumentException("Parameter circuitName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - resourceGroupName, - circuitName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all authorizations in an express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the circuit. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all authorizations in an express route circuit. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String circuitName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (circuitName == null) { - return Mono.error(new IllegalArgumentException("Parameter circuitName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - resourceGroupName, - circuitName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all authorizations in an express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the circuit. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all authorizations in an express route circuit. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String resourceGroupName, String circuitName) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, circuitName), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets all authorizations in an express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the circuit. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all authorizations in an express route circuit. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String circuitName, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, circuitName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all authorizations in an express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the circuit. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all authorizations in an express route circuit. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String circuitName) { - return new PagedIterable<>(listAsync(resourceGroupName, circuitName)); - } - - /** - * Gets all authorizations in an express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the circuit. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all authorizations in an express route circuit. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, String circuitName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, circuitName, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListAuthorizations API service call retrieves all authorizations that belongs to an - * ExpressRouteCircuit. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListAuthorizations API service call retrieves all authorizations that belongs to an - * ExpressRouteCircuit. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ExpressRouteCircuitConnectionsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ExpressRouteCircuitConnectionsClientImpl.java deleted file mode 100644 index 64955a0c39aa..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ExpressRouteCircuitConnectionsClientImpl.java +++ /dev/null @@ -1,1279 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.ExpressRouteCircuitConnectionsClient; -import com.azure.resourcemanager.network.fluent.models.ExpressRouteCircuitConnectionInner; -import com.azure.resourcemanager.network.models.ExpressRouteCircuitConnectionListResult; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ExpressRouteCircuitConnectionsClient. */ -public final class ExpressRouteCircuitConnectionsClientImpl implements ExpressRouteCircuitConnectionsClient { - private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitConnectionsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final ExpressRouteCircuitConnectionsService service; - - /** The service client containing this operation class. */ - private final NetworkManagementClientImpl client; - - /** - * Initializes an instance of ExpressRouteCircuitConnectionsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ExpressRouteCircuitConnectionsClientImpl(NetworkManagementClientImpl client) { - this.service = - RestProxy - .create( - ExpressRouteCircuitConnectionsService.class, - client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for NetworkManagementClientExpressRouteCircuitConnections to be used by - * the proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "NetworkManagementCli") - private interface ExpressRouteCircuitConnectionsService { - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/expressRouteCircuits/{circuitName}/peerings/{peeringName}/connections/{connectionName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("circuitName") String circuitName, - @PathParam("peeringName") String peeringName, - @PathParam("connectionName") String connectionName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/expressRouteCircuits/{circuitName}/peerings/{peeringName}/connections/{connectionName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("circuitName") String circuitName, - @PathParam("peeringName") String peeringName, - @PathParam("connectionName") String connectionName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/expressRouteCircuits/{circuitName}/peerings/{peeringName}/connections/{connectionName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("circuitName") String circuitName, - @PathParam("peeringName") String peeringName, - @PathParam("connectionName") String connectionName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/expressRouteCircuits/{circuitName}/peerings/{peeringName}/connections") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("circuitName") String circuitName, - @PathParam("peeringName") String peeringName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Deletes the specified Express Route Circuit Connection from the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param connectionName The name of the express route circuit connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync( - String resourceGroupName, String circuitName, String peeringName, String connectionName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (circuitName == null) { - return Mono.error(new IllegalArgumentException("Parameter circuitName is required and cannot be null.")); - } - if (peeringName == null) { - return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); - } - if (connectionName == null) { - return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - circuitName, - peeringName, - connectionName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the specified Express Route Circuit Connection from the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param connectionName The name of the express route circuit connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String circuitName, String peeringName, String connectionName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (circuitName == null) { - return Mono.error(new IllegalArgumentException("Parameter circuitName is required and cannot be null.")); - } - if (peeringName == null) { - return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); - } - if (connectionName == null) { - return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - circuitName, - peeringName, - connectionName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Deletes the specified Express Route Circuit Connection from the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param connectionName The name of the express route circuit connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String circuitName, String peeringName, String connectionName) { - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, circuitName, peeringName, connectionName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deletes the specified Express Route Circuit Connection from the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param connectionName The name of the express route circuit connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String circuitName, String peeringName, String connectionName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, circuitName, peeringName, connectionName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes the specified Express Route Circuit Connection from the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param connectionName The name of the express route circuit connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String circuitName, String peeringName, String connectionName) { - return beginDeleteAsync(resourceGroupName, circuitName, peeringName, connectionName).getSyncPoller(); - } - - /** - * Deletes the specified Express Route Circuit Connection from the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param connectionName The name of the express route circuit connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String circuitName, String peeringName, String connectionName, Context context) { - return beginDeleteAsync(resourceGroupName, circuitName, peeringName, connectionName, context).getSyncPoller(); - } - - /** - * Deletes the specified Express Route Circuit Connection from the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param connectionName The name of the express route circuit connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync( - String resourceGroupName, String circuitName, String peeringName, String connectionName) { - return beginDeleteAsync(resourceGroupName, circuitName, peeringName, connectionName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified Express Route Circuit Connection from the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param connectionName The name of the express route circuit connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync( - String resourceGroupName, String circuitName, String peeringName, String connectionName, Context context) { - return beginDeleteAsync(resourceGroupName, circuitName, peeringName, connectionName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified Express Route Circuit Connection from the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param connectionName The name of the express route circuit connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String circuitName, String peeringName, String connectionName) { - deleteAsync(resourceGroupName, circuitName, peeringName, connectionName).block(); - } - - /** - * Deletes the specified Express Route Circuit Connection from the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param connectionName The name of the express route circuit connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete( - String resourceGroupName, String circuitName, String peeringName, String connectionName, Context context) { - deleteAsync(resourceGroupName, circuitName, peeringName, connectionName, context).block(); - } - - /** - * Gets the specified Express Route Circuit Connection from the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param connectionName The name of the express route circuit connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Express Route Circuit Connection from the specified express route circuit. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String resourceGroupName, String circuitName, String peeringName, String connectionName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (circuitName == null) { - return Mono.error(new IllegalArgumentException("Parameter circuitName is required and cannot be null.")); - } - if (peeringName == null) { - return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); - } - if (connectionName == null) { - return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - resourceGroupName, - circuitName, - peeringName, - connectionName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the specified Express Route Circuit Connection from the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param connectionName The name of the express route circuit connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Express Route Circuit Connection from the specified express route circuit. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String circuitName, String peeringName, String connectionName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (circuitName == null) { - return Mono.error(new IllegalArgumentException("Parameter circuitName is required and cannot be null.")); - } - if (peeringName == null) { - return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); - } - if (connectionName == null) { - return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - resourceGroupName, - circuitName, - peeringName, - connectionName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets the specified Express Route Circuit Connection from the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param connectionName The name of the express route circuit connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Express Route Circuit Connection from the specified express route circuit. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync( - String resourceGroupName, String circuitName, String peeringName, String connectionName) { - return getWithResponseAsync(resourceGroupName, circuitName, peeringName, connectionName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the specified Express Route Circuit Connection from the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param connectionName The name of the express route circuit connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Express Route Circuit Connection from the specified express route circuit. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ExpressRouteCircuitConnectionInner get( - String resourceGroupName, String circuitName, String peeringName, String connectionName) { - return getAsync(resourceGroupName, circuitName, peeringName, connectionName).block(); - } - - /** - * Gets the specified Express Route Circuit Connection from the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param connectionName The name of the express route circuit connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Express Route Circuit Connection from the specified express route circuit. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String circuitName, String peeringName, String connectionName, Context context) { - return getWithResponseAsync(resourceGroupName, circuitName, peeringName, connectionName, context).block(); - } - - /** - * Creates or updates a Express Route Circuit Connection in the specified express route circuits. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param connectionName The name of the express route circuit connection. - * @param expressRouteCircuitConnectionParameters Parameters supplied to the create or update express route circuit - * connection operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return express Route Circuit Connection in an ExpressRouteCircuitPeering resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String circuitName, - String peeringName, - String connectionName, - ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (circuitName == null) { - return Mono.error(new IllegalArgumentException("Parameter circuitName is required and cannot be null.")); - } - if (peeringName == null) { - return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); - } - if (connectionName == null) { - return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (expressRouteCircuitConnectionParameters == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter expressRouteCircuitConnectionParameters is required and cannot be null.")); - } else { - expressRouteCircuitConnectionParameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - circuitName, - peeringName, - connectionName, - apiVersion, - this.client.getSubscriptionId(), - expressRouteCircuitConnectionParameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a Express Route Circuit Connection in the specified express route circuits. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param connectionName The name of the express route circuit connection. - * @param expressRouteCircuitConnectionParameters Parameters supplied to the create or update express route circuit - * connection operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return express Route Circuit Connection in an ExpressRouteCircuitPeering resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String circuitName, - String peeringName, - String connectionName, - ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (circuitName == null) { - return Mono.error(new IllegalArgumentException("Parameter circuitName is required and cannot be null.")); - } - if (peeringName == null) { - return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); - } - if (connectionName == null) { - return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (expressRouteCircuitConnectionParameters == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter expressRouteCircuitConnectionParameters is required and cannot be null.")); - } else { - expressRouteCircuitConnectionParameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - circuitName, - peeringName, - connectionName, - apiVersion, - this.client.getSubscriptionId(), - expressRouteCircuitConnectionParameters, - accept, - context); - } - - /** - * Creates or updates a Express Route Circuit Connection in the specified express route circuits. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param connectionName The name of the express route circuit connection. - * @param expressRouteCircuitConnectionParameters Parameters supplied to the create or update express route circuit - * connection operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return express Route Circuit Connection in an ExpressRouteCircuitPeering resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, ExpressRouteCircuitConnectionInner> - beginCreateOrUpdateAsync( - String resourceGroupName, - String circuitName, - String peeringName, - String connectionName, - ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters) { - Mono>> mono = - createOrUpdateWithResponseAsync( - resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ExpressRouteCircuitConnectionInner.class, - ExpressRouteCircuitConnectionInner.class, - Context.NONE); - } - - /** - * Creates or updates a Express Route Circuit Connection in the specified express route circuits. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param connectionName The name of the express route circuit connection. - * @param expressRouteCircuitConnectionParameters Parameters supplied to the create or update express route circuit - * connection operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return express Route Circuit Connection in an ExpressRouteCircuitPeering resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, ExpressRouteCircuitConnectionInner> - beginCreateOrUpdateAsync( - String resourceGroupName, - String circuitName, - String peeringName, - String connectionName, - ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync( - resourceGroupName, - circuitName, - peeringName, - connectionName, - expressRouteCircuitConnectionParameters, - context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ExpressRouteCircuitConnectionInner.class, - ExpressRouteCircuitConnectionInner.class, - context); - } - - /** - * Creates or updates a Express Route Circuit Connection in the specified express route circuits. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param connectionName The name of the express route circuit connection. - * @param expressRouteCircuitConnectionParameters Parameters supplied to the create or update express route circuit - * connection operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return express Route Circuit Connection in an ExpressRouteCircuitPeering resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, ExpressRouteCircuitConnectionInner> - beginCreateOrUpdate( - String resourceGroupName, - String circuitName, - String peeringName, - String connectionName, - ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters) { - return beginCreateOrUpdateAsync( - resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters) - .getSyncPoller(); - } - - /** - * Creates or updates a Express Route Circuit Connection in the specified express route circuits. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param connectionName The name of the express route circuit connection. - * @param expressRouteCircuitConnectionParameters Parameters supplied to the create or update express route circuit - * connection operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return express Route Circuit Connection in an ExpressRouteCircuitPeering resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, ExpressRouteCircuitConnectionInner> - beginCreateOrUpdate( - String resourceGroupName, - String circuitName, - String peeringName, - String connectionName, - ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters, - Context context) { - return beginCreateOrUpdateAsync( - resourceGroupName, - circuitName, - peeringName, - connectionName, - expressRouteCircuitConnectionParameters, - context) - .getSyncPoller(); - } - - /** - * Creates or updates a Express Route Circuit Connection in the specified express route circuits. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param connectionName The name of the express route circuit connection. - * @param expressRouteCircuitConnectionParameters Parameters supplied to the create or update express route circuit - * connection operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return express Route Circuit Connection in an ExpressRouteCircuitPeering resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, - String circuitName, - String peeringName, - String connectionName, - ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters) { - return beginCreateOrUpdateAsync( - resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a Express Route Circuit Connection in the specified express route circuits. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param connectionName The name of the express route circuit connection. - * @param expressRouteCircuitConnectionParameters Parameters supplied to the create or update express route circuit - * connection operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return express Route Circuit Connection in an ExpressRouteCircuitPeering resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, - String circuitName, - String peeringName, - String connectionName, - ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters, - Context context) { - return beginCreateOrUpdateAsync( - resourceGroupName, - circuitName, - peeringName, - connectionName, - expressRouteCircuitConnectionParameters, - context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a Express Route Circuit Connection in the specified express route circuits. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param connectionName The name of the express route circuit connection. - * @param expressRouteCircuitConnectionParameters Parameters supplied to the create or update express route circuit - * connection operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return express Route Circuit Connection in an ExpressRouteCircuitPeering resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ExpressRouteCircuitConnectionInner createOrUpdate( - String resourceGroupName, - String circuitName, - String peeringName, - String connectionName, - ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters) { - return createOrUpdateAsync( - resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters) - .block(); - } - - /** - * Creates or updates a Express Route Circuit Connection in the specified express route circuits. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param connectionName The name of the express route circuit connection. - * @param expressRouteCircuitConnectionParameters Parameters supplied to the create or update express route circuit - * connection operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return express Route Circuit Connection in an ExpressRouteCircuitPeering resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ExpressRouteCircuitConnectionInner createOrUpdate( - String resourceGroupName, - String circuitName, - String peeringName, - String connectionName, - ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters, - Context context) { - return createOrUpdateAsync( - resourceGroupName, - circuitName, - peeringName, - connectionName, - expressRouteCircuitConnectionParameters, - context) - .block(); - } - - /** - * Gets all global reach connections associated with a private peering in an express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the circuit. - * @param peeringName The name of the peering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all global reach connections associated with a private peering in an express route circuit. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String circuitName, String peeringName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (circuitName == null) { - return Mono.error(new IllegalArgumentException("Parameter circuitName is required and cannot be null.")); - } - if (peeringName == null) { - return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - resourceGroupName, - circuitName, - peeringName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all global reach connections associated with a private peering in an express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the circuit. - * @param peeringName The name of the peering. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all global reach connections associated with a private peering in an express route circuit. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String circuitName, String peeringName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (circuitName == null) { - return Mono.error(new IllegalArgumentException("Parameter circuitName is required and cannot be null.")); - } - if (peeringName == null) { - return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - resourceGroupName, - circuitName, - peeringName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all global reach connections associated with a private peering in an express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the circuit. - * @param peeringName The name of the peering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all global reach connections associated with a private peering in an express route circuit. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync( - String resourceGroupName, String circuitName, String peeringName) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, circuitName, peeringName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets all global reach connections associated with a private peering in an express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the circuit. - * @param peeringName The name of the peering. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all global reach connections associated with a private peering in an express route circuit. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String circuitName, String peeringName, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, circuitName, peeringName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all global reach connections associated with a private peering in an express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the circuit. - * @param peeringName The name of the peering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all global reach connections associated with a private peering in an express route circuit. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, String circuitName, String peeringName) { - return new PagedIterable<>(listAsync(resourceGroupName, circuitName, peeringName)); - } - - /** - * Gets all global reach connections associated with a private peering in an express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the circuit. - * @param peeringName The name of the peering. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all global reach connections associated with a private peering in an express route circuit. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, String circuitName, String peeringName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, circuitName, peeringName, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListConnections API service call retrieves all global reach connections that belongs to a - * Private Peering for an ExpressRouteCircuit. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListConnections API service call retrieves all global reach connections that belongs to a - * Private Peering for an ExpressRouteCircuit. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ExpressRouteCircuitImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ExpressRouteCircuitImpl.java deleted file mode 100644 index 2b03080dcb7c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ExpressRouteCircuitImpl.java +++ /dev/null @@ -1,202 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.network.models.ExpressRouteCircuit; -import com.azure.resourcemanager.network.models.ExpressRouteCircuitPeering; -import com.azure.resourcemanager.network.models.ExpressRouteCircuitPeerings; -import com.azure.resourcemanager.network.models.ExpressRouteCircuitServiceProviderProperties; -import com.azure.resourcemanager.network.models.ExpressRouteCircuitSkuType; -import com.azure.resourcemanager.network.models.ServiceProviderProvisioningState; -import com.azure.resourcemanager.network.fluent.models.ExpressRouteCircuitAuthorizationInner; -import com.azure.resourcemanager.network.fluent.models.ExpressRouteCircuitInner; -import com.azure.resourcemanager.network.fluent.models.ExpressRouteCircuitPeeringInner; -import com.azure.resourcemanager.network.models.TagsObject; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import reactor.core.publisher.Mono; - -class ExpressRouteCircuitImpl - extends GroupableParentResourceWithTagsImpl< - ExpressRouteCircuit, ExpressRouteCircuitInner, ExpressRouteCircuitImpl, NetworkManager> - implements ExpressRouteCircuit, ExpressRouteCircuit.Definition, ExpressRouteCircuit.Update { - private ExpressRouteCircuitPeeringsImpl peerings; - private Map expressRouteCircuitPeerings; - - ExpressRouteCircuitImpl(String name, ExpressRouteCircuitInner innerObject, NetworkManager manager) { - super(name, innerObject, manager); - initializeChildrenFromInner(); - } - - @Override - public ExpressRouteCircuitImpl withServiceProvider(String serviceProviderName) { - ensureServiceProviderProperties().withServiceProviderName(serviceProviderName); - return this; - } - - @Override - public ExpressRouteCircuitImpl withPeeringLocation(String location) { - ensureServiceProviderProperties().withPeeringLocation(location); - return this; - } - - @Override - public ExpressRouteCircuitImpl withBandwidthInMbps(int bandwidthInMbps) { - ensureServiceProviderProperties().withBandwidthInMbps(bandwidthInMbps); - return this; - } - - @Override - public ExpressRouteCircuitImpl withSku(ExpressRouteCircuitSkuType sku) { - innerModel().withSku(sku.sku()); - return this; - } - - @Override - public ExpressRouteCircuitImpl withClassicOperations() { - innerModel().withAllowClassicOperations(true); - return this; - } - - @Override - public ExpressRouteCircuitImpl withoutClassicOperations() { - innerModel().withAllowClassicOperations(false); - return this; - } - - @Override - public ExpressRouteCircuitImpl withAuthorization(String authorizationName) { - ensureAuthorizations().add(new ExpressRouteCircuitAuthorizationInner().withName(authorizationName)); - return this; - } - - private List ensureAuthorizations() { - if (innerModel().authorizations() == null) { - innerModel().withAuthorizations(new ArrayList()); - } - return innerModel().authorizations(); - } - - private ExpressRouteCircuitServiceProviderProperties ensureServiceProviderProperties() { - if (innerModel().serviceProviderProperties() == null) { - innerModel().withServiceProviderProperties(new ExpressRouteCircuitServiceProviderProperties()); - } - return innerModel().serviceProviderProperties(); - } - - @Override - protected Mono createInner() { - return this - .manager() - .serviceClient() - .getExpressRouteCircuits() - .createOrUpdateAsync(this.resourceGroupName(), this.name(), this.innerModel()); - } - - @Override - protected void initializeChildrenFromInner() { - expressRouteCircuitPeerings = new HashMap<>(); - if (innerModel().peerings() != null) { - for (ExpressRouteCircuitPeeringInner peering : innerModel().peerings()) { - expressRouteCircuitPeerings - .put( - peering.name(), - new ExpressRouteCircuitPeeringImpl<>( - this, - peering, - manager().serviceClient().getExpressRouteCircuitPeerings(), - peering.peeringType())); - } - } - } - - @Override - protected Mono getInnerAsync() { - return this - .manager() - .serviceClient() - .getExpressRouteCircuits() - .getByResourceGroupAsync(this.resourceGroupName(), this.name()); - } - - @Override - public Mono refreshAsync() { - return super - .refreshAsync() - .map( - expressRouteCircuit -> { - ExpressRouteCircuitImpl impl = (ExpressRouteCircuitImpl) expressRouteCircuit; - impl.initializeChildrenFromInner(); - return impl; - }); - } - - @Override - protected Mono applyTagsToInnerAsync() { - return this - .manager() - .serviceClient() - .getExpressRouteCircuits() - .updateTagsAsync(resourceGroupName(), name(), new TagsObject().withTags(innerModel().tags())); - } - - // Getters - - @Override - public ExpressRouteCircuitPeerings peerings() { - if (peerings == null) { - peerings = new ExpressRouteCircuitPeeringsImpl(this); - } - return peerings; - } - - @Override - public ExpressRouteCircuitSkuType sku() { - return ExpressRouteCircuitSkuType.fromSku(innerModel().sku()); - } - - @Override - public boolean isAllowClassicOperations() { - return ResourceManagerUtils.toPrimitiveBoolean(innerModel().allowClassicOperations()); - } - - @Override - public String circuitProvisioningState() { - return innerModel().circuitProvisioningState(); - } - - @Override - public ServiceProviderProvisioningState serviceProviderProvisioningState() { - return innerModel().serviceProviderProvisioningState(); - } - - @Override - public String serviceKey() { - return innerModel().serviceKey(); - } - - @Override - public String serviceProviderNotes() { - return innerModel().serviceProviderNotes(); - } - - @Override - public ExpressRouteCircuitServiceProviderProperties serviceProviderProperties() { - return innerModel().serviceProviderProperties(); - } - - @Override - public String provisioningState() { - return innerModel().provisioningState(); - } - - @Override - public Map peeringsMap() { - return expressRouteCircuitPeerings; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ExpressRouteCircuitPeeringImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ExpressRouteCircuitPeeringImpl.java deleted file mode 100644 index 2a40f0337292..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ExpressRouteCircuitPeeringImpl.java +++ /dev/null @@ -1,200 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.network.fluent.ExpressRouteCircuitPeeringsClient; -import com.azure.resourcemanager.network.fluent.models.ExpressRouteCircuitPeeringInner; -import com.azure.resourcemanager.network.models.ExpressRouteCircuitPeering; -import com.azure.resourcemanager.network.models.ExpressRouteCircuitPeeringConfig; -import com.azure.resourcemanager.network.models.ExpressRoutePeeringState; -import com.azure.resourcemanager.network.models.ExpressRoutePeeringType; -import com.azure.resourcemanager.network.models.Ipv6ExpressRouteCircuitPeeringConfig; -import com.azure.resourcemanager.resources.fluentcore.arm.models.GroupableResource; -import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.CreatableUpdatableImpl; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import reactor.core.publisher.Mono; - -import java.util.Arrays; - -class ExpressRouteCircuitPeeringImpl< - ParentModelT, - ParentInnerT, - ParentT extends GroupableResource & Refreshable> - extends CreatableUpdatableImpl< - ExpressRouteCircuitPeering, - ExpressRouteCircuitPeeringInner, - ExpressRouteCircuitPeeringImpl> - implements ExpressRouteCircuitPeering, ExpressRouteCircuitPeering.Definition, ExpressRouteCircuitPeering.Update { - private final ExpressRouteCircuitPeeringsClient client; - private final ParentT parent; - private ExpressRouteCircuitStatsImpl stats; - - ExpressRouteCircuitPeeringImpl( - ParentT parent, - ExpressRouteCircuitPeeringInner innerObject, - ExpressRouteCircuitPeeringsClient client, - ExpressRoutePeeringType type) { - super(type.toString(), innerObject); - this.client = client; - this.parent = parent; - this.stats = new ExpressRouteCircuitStatsImpl(innerObject.stats()); - innerModel().withPeeringType(type); - } - - @Override - public ExpressRouteCircuitPeeringImpl withAdvertisedPublicPrefixes( - String publicPrefix) { - ensureMicrosoftPeeringConfig().withAdvertisedPublicPrefixes(Arrays.asList(publicPrefix)); - return this; - } - - private ExpressRouteCircuitPeeringConfig ensureMicrosoftPeeringConfig() { - if (innerModel().microsoftPeeringConfig() == null) { - innerModel().withMicrosoftPeeringConfig(new ExpressRouteCircuitPeeringConfig()); - } - return innerModel().microsoftPeeringConfig(); - } - - @Override - public ExpressRouteCircuitPeeringImpl withPrimaryPeerAddressPrefix( - String addressPrefix) { - innerModel().withPrimaryPeerAddressPrefix(addressPrefix); - return this; - } - - @Override - public ExpressRouteCircuitPeeringImpl withSecondaryPeerAddressPrefix( - String addressPrefix) { - innerModel().withSecondaryPeerAddressPrefix(addressPrefix); - return this; - } - - @Override - public ExpressRouteCircuitPeeringImpl withVlanId(int vlanId) { - innerModel().withVlanId(vlanId); - return this; - } - - @Override - public ExpressRouteCircuitPeeringImpl withPeerAsn(long peerASN) { - innerModel().withPeerAsn(peerASN); - return this; - } - - @Override - protected Mono getInnerAsync() { - return this.client.getAsync(parent.resourceGroupName(), parent.name(), name()); - } - - @Override - public boolean isInCreateMode() { - return this.innerModel().id() == null; - } - - @Override - public Mono createResourceAsync() { - return this - .client - .createOrUpdateAsync(parent.resourceGroupName(), parent.name(), this.name(), innerModel()) - .flatMap( - innerModel -> { - this.setInner(innerModel); - stats = new ExpressRouteCircuitStatsImpl(innerModel.stats()); - return parent.refreshAsync().then(Mono.just(this)); - }); - } - - // Getters - - @Override - public String id() { - return innerModel().id(); - } - - @Override - public ExpressRoutePeeringType peeringType() { - return innerModel().peeringType(); - } - - @Override - public ExpressRoutePeeringState state() { - return innerModel().state(); - } - - @Override - public int azureAsn() { - return ResourceManagerUtils.toPrimitiveInt(innerModel().azureAsn()); - } - - @Override - public long peerAsn() { - return ResourceManagerUtils.toPrimitiveLong(innerModel().peerAsn()); - } - - @Override - public String primaryPeerAddressPrefix() { - return innerModel().primaryPeerAddressPrefix(); - } - - @Override - public String secondaryPeerAddressPrefix() { - return innerModel().secondaryPeerAddressPrefix(); - } - - @Override - public String primaryAzurePort() { - return innerModel().primaryAzurePort(); - } - - @Override - public String secondaryAzurePort() { - return innerModel().secondaryAzurePort(); - } - - @Override - public String sharedKey() { - return innerModel().sharedKey(); - } - - @Override - public int vlanId() { - return ResourceManagerUtils.toPrimitiveInt(innerModel().vlanId()); - } - - @Override - public ExpressRouteCircuitPeeringConfig microsoftPeeringConfig() { - return innerModel().microsoftPeeringConfig(); - } - - @Override - public ExpressRouteCircuitStatsImpl stats() { - return stats; - } - - @Override - public String provisioningState() { - return innerModel().provisioningState(); - } - - @Override - public String lastModifiedBy() { - return innerModel().lastModifiedBy(); - } - - @Override - public Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig() { - return innerModel().ipv6PeeringConfig(); - } - - @Override - public NetworkManager manager() { - return parent.manager(); - } - - @Override - public String resourceGroupName() { - return parent.resourceGroupName(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ExpressRouteCircuitPeeringsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ExpressRouteCircuitPeeringsClientImpl.java deleted file mode 100644 index 681932303862..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ExpressRouteCircuitPeeringsClientImpl.java +++ /dev/null @@ -1,1143 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.ExpressRouteCircuitPeeringsClient; -import com.azure.resourcemanager.network.fluent.models.ExpressRouteCircuitPeeringInner; -import com.azure.resourcemanager.network.models.ExpressRouteCircuitPeeringListResult; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ExpressRouteCircuitPeeringsClient. */ -public final class ExpressRouteCircuitPeeringsClientImpl implements ExpressRouteCircuitPeeringsClient { - private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitPeeringsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final ExpressRouteCircuitPeeringsService service; - - /** The service client containing this operation class. */ - private final NetworkManagementClientImpl client; - - /** - * Initializes an instance of ExpressRouteCircuitPeeringsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ExpressRouteCircuitPeeringsClientImpl(NetworkManagementClientImpl client) { - this.service = - RestProxy - .create( - ExpressRouteCircuitPeeringsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for NetworkManagementClientExpressRouteCircuitPeerings to be used by the - * proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "NetworkManagementCli") - private interface ExpressRouteCircuitPeeringsService { - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/expressRouteCircuits/{circuitName}/peerings/{peeringName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("circuitName") String circuitName, - @PathParam("peeringName") String peeringName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/expressRouteCircuits/{circuitName}/peerings/{peeringName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("circuitName") String circuitName, - @PathParam("peeringName") String peeringName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/expressRouteCircuits/{circuitName}/peerings/{peeringName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("circuitName") String circuitName, - @PathParam("peeringName") String peeringName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") ExpressRouteCircuitPeeringInner peeringParameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/expressRouteCircuits/{circuitName}/peerings") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("circuitName") String circuitName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Deletes the specified peering from the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync( - String resourceGroupName, String circuitName, String peeringName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (circuitName == null) { - return Mono.error(new IllegalArgumentException("Parameter circuitName is required and cannot be null.")); - } - if (peeringName == null) { - return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - circuitName, - peeringName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the specified peering from the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String circuitName, String peeringName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (circuitName == null) { - return Mono.error(new IllegalArgumentException("Parameter circuitName is required and cannot be null.")); - } - if (peeringName == null) { - return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - circuitName, - peeringName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Deletes the specified peering from the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String circuitName, String peeringName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, circuitName, peeringName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deletes the specified peering from the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String circuitName, String peeringName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, circuitName, peeringName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes the specified peering from the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String circuitName, String peeringName) { - return beginDeleteAsync(resourceGroupName, circuitName, peeringName).getSyncPoller(); - } - - /** - * Deletes the specified peering from the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String circuitName, String peeringName, Context context) { - return beginDeleteAsync(resourceGroupName, circuitName, peeringName, context).getSyncPoller(); - } - - /** - * Deletes the specified peering from the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String circuitName, String peeringName) { - return beginDeleteAsync(resourceGroupName, circuitName, peeringName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified peering from the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String circuitName, String peeringName, Context context) { - return beginDeleteAsync(resourceGroupName, circuitName, peeringName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified peering from the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String circuitName, String peeringName) { - deleteAsync(resourceGroupName, circuitName, peeringName).block(); - } - - /** - * Deletes the specified peering from the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String circuitName, String peeringName, Context context) { - deleteAsync(resourceGroupName, circuitName, peeringName, context).block(); - } - - /** - * Gets the specified peering for the express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified peering for the express route circuit. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String resourceGroupName, String circuitName, String peeringName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (circuitName == null) { - return Mono.error(new IllegalArgumentException("Parameter circuitName is required and cannot be null.")); - } - if (peeringName == null) { - return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - resourceGroupName, - circuitName, - peeringName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the specified peering for the express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified peering for the express route circuit. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String circuitName, String peeringName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (circuitName == null) { - return Mono.error(new IllegalArgumentException("Parameter circuitName is required and cannot be null.")); - } - if (peeringName == null) { - return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - resourceGroupName, - circuitName, - peeringName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets the specified peering for the express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified peering for the express route circuit. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync( - String resourceGroupName, String circuitName, String peeringName) { - return getWithResponseAsync(resourceGroupName, circuitName, peeringName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the specified peering for the express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified peering for the express route circuit. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ExpressRouteCircuitPeeringInner get(String resourceGroupName, String circuitName, String peeringName) { - return getAsync(resourceGroupName, circuitName, peeringName).block(); - } - - /** - * Gets the specified peering for the express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified peering for the express route circuit. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String circuitName, String peeringName, Context context) { - return getWithResponseAsync(resourceGroupName, circuitName, peeringName, context).block(); - } - - /** - * Creates or updates a peering in the specified express route circuits. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param peeringParameters Parameters supplied to the create or update express route circuit peering operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return peering in an ExpressRouteCircuit resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String circuitName, - String peeringName, - ExpressRouteCircuitPeeringInner peeringParameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (circuitName == null) { - return Mono.error(new IllegalArgumentException("Parameter circuitName is required and cannot be null.")); - } - if (peeringName == null) { - return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (peeringParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter peeringParameters is required and cannot be null.")); - } else { - peeringParameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - circuitName, - peeringName, - apiVersion, - this.client.getSubscriptionId(), - peeringParameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a peering in the specified express route circuits. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param peeringParameters Parameters supplied to the create or update express route circuit peering operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return peering in an ExpressRouteCircuit resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String circuitName, - String peeringName, - ExpressRouteCircuitPeeringInner peeringParameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (circuitName == null) { - return Mono.error(new IllegalArgumentException("Parameter circuitName is required and cannot be null.")); - } - if (peeringName == null) { - return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (peeringParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter peeringParameters is required and cannot be null.")); - } else { - peeringParameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - circuitName, - peeringName, - apiVersion, - this.client.getSubscriptionId(), - peeringParameters, - accept, - context); - } - - /** - * Creates or updates a peering in the specified express route circuits. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param peeringParameters Parameters supplied to the create or update express route circuit peering operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return peering in an ExpressRouteCircuit resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, ExpressRouteCircuitPeeringInner> - beginCreateOrUpdateAsync( - String resourceGroupName, - String circuitName, - String peeringName, - ExpressRouteCircuitPeeringInner peeringParameters) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, circuitName, peeringName, peeringParameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ExpressRouteCircuitPeeringInner.class, - ExpressRouteCircuitPeeringInner.class, - Context.NONE); - } - - /** - * Creates or updates a peering in the specified express route circuits. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param peeringParameters Parameters supplied to the create or update express route circuit peering operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return peering in an ExpressRouteCircuit resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, ExpressRouteCircuitPeeringInner> - beginCreateOrUpdateAsync( - String resourceGroupName, - String circuitName, - String peeringName, - ExpressRouteCircuitPeeringInner peeringParameters, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, circuitName, peeringName, peeringParameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ExpressRouteCircuitPeeringInner.class, - ExpressRouteCircuitPeeringInner.class, - context); - } - - /** - * Creates or updates a peering in the specified express route circuits. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param peeringParameters Parameters supplied to the create or update express route circuit peering operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return peering in an ExpressRouteCircuit resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, ExpressRouteCircuitPeeringInner> beginCreateOrUpdate( - String resourceGroupName, - String circuitName, - String peeringName, - ExpressRouteCircuitPeeringInner peeringParameters) { - return beginCreateOrUpdateAsync(resourceGroupName, circuitName, peeringName, peeringParameters).getSyncPoller(); - } - - /** - * Creates or updates a peering in the specified express route circuits. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param peeringParameters Parameters supplied to the create or update express route circuit peering operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return peering in an ExpressRouteCircuit resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, ExpressRouteCircuitPeeringInner> beginCreateOrUpdate( - String resourceGroupName, - String circuitName, - String peeringName, - ExpressRouteCircuitPeeringInner peeringParameters, - Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, circuitName, peeringName, peeringParameters, context) - .getSyncPoller(); - } - - /** - * Creates or updates a peering in the specified express route circuits. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param peeringParameters Parameters supplied to the create or update express route circuit peering operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return peering in an ExpressRouteCircuit resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, - String circuitName, - String peeringName, - ExpressRouteCircuitPeeringInner peeringParameters) { - return beginCreateOrUpdateAsync(resourceGroupName, circuitName, peeringName, peeringParameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a peering in the specified express route circuits. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param peeringParameters Parameters supplied to the create or update express route circuit peering operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return peering in an ExpressRouteCircuit resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, - String circuitName, - String peeringName, - ExpressRouteCircuitPeeringInner peeringParameters, - Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, circuitName, peeringName, peeringParameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a peering in the specified express route circuits. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param peeringParameters Parameters supplied to the create or update express route circuit peering operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return peering in an ExpressRouteCircuit resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ExpressRouteCircuitPeeringInner createOrUpdate( - String resourceGroupName, - String circuitName, - String peeringName, - ExpressRouteCircuitPeeringInner peeringParameters) { - return createOrUpdateAsync(resourceGroupName, circuitName, peeringName, peeringParameters).block(); - } - - /** - * Creates or updates a peering in the specified express route circuits. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param peeringParameters Parameters supplied to the create or update express route circuit peering operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return peering in an ExpressRouteCircuit resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ExpressRouteCircuitPeeringInner createOrUpdate( - String resourceGroupName, - String circuitName, - String peeringName, - ExpressRouteCircuitPeeringInner peeringParameters, - Context context) { - return createOrUpdateAsync(resourceGroupName, circuitName, peeringName, peeringParameters, context).block(); - } - - /** - * Gets all peerings in a specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all peerings in a specified express route circuit. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String circuitName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (circuitName == null) { - return Mono.error(new IllegalArgumentException("Parameter circuitName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - resourceGroupName, - circuitName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all peerings in a specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all peerings in a specified express route circuit. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String circuitName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (circuitName == null) { - return Mono.error(new IllegalArgumentException("Parameter circuitName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - resourceGroupName, - circuitName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all peerings in a specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all peerings in a specified express route circuit. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String resourceGroupName, String circuitName) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, circuitName), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets all peerings in a specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all peerings in a specified express route circuit. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String circuitName, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, circuitName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all peerings in a specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all peerings in a specified express route circuit. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String circuitName) { - return new PagedIterable<>(listAsync(resourceGroupName, circuitName)); - } - - /** - * Gets all peerings in a specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all peerings in a specified express route circuit. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, String circuitName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, circuitName, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListPeering API service call retrieves all peerings that belong to an ExpressRouteCircuit. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListPeering API service call retrieves all peerings that belong to an ExpressRouteCircuit. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ExpressRouteCircuitPeeringsImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ExpressRouteCircuitPeeringsImpl.java deleted file mode 100644 index 31c1147ccc77..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ExpressRouteCircuitPeeringsImpl.java +++ /dev/null @@ -1,125 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.network.fluent.ExpressRouteCircuitPeeringsClient; -import com.azure.resourcemanager.network.fluent.models.ExpressRouteCircuitInner; -import com.azure.resourcemanager.network.fluent.models.ExpressRouteCircuitPeeringInner; -import com.azure.resourcemanager.network.models.ExpressRouteCircuit; -import com.azure.resourcemanager.network.models.ExpressRouteCircuitPeering; -import com.azure.resourcemanager.network.models.ExpressRouteCircuitPeerings; -import com.azure.resourcemanager.network.models.ExpressRoutePeeringType; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.IndependentChildrenImpl; -import reactor.core.publisher.Mono; - -/** Represents Express Route Circuit Peerings collection associated with Network Watcher. */ -class ExpressRouteCircuitPeeringsImpl - extends IndependentChildrenImpl< - ExpressRouteCircuitPeering, - ExpressRouteCircuitPeeringImpl, - ExpressRouteCircuitPeeringInner, - ExpressRouteCircuitPeeringsClient, - NetworkManager, - ExpressRouteCircuit> - implements ExpressRouteCircuitPeerings { - private final ExpressRouteCircuitImpl parent; - - /** - * Creates a new ExpressRouteCircuitPeeringsImpl. - * - * @param parent the Express Route Circuit associated with ExpressRouteCircuitPeering - */ - ExpressRouteCircuitPeeringsImpl(ExpressRouteCircuitImpl parent) { - super(parent.manager().serviceClient().getExpressRouteCircuitPeerings(), parent.manager()); - this.parent = parent; - } - - @Override - public final PagedIterable list() { - return wrapList(innerModel().list(parent.resourceGroupName(), parent.name())); - } - - /** @return an observable emits packet captures in this collection */ - @Override - public PagedFlux listAsync() { - return wrapPageAsync(innerModel().listAsync(parent.resourceGroupName(), parent.name())); - } - - @Override - protected ExpressRouteCircuitPeeringImpl - wrapModel(String name) { - return new ExpressRouteCircuitPeeringImpl<>( - parent, new ExpressRouteCircuitPeeringInner(), innerModel(), ExpressRoutePeeringType.fromString(name)); - } - - protected ExpressRouteCircuitPeeringImpl - wrapModel(ExpressRouteCircuitPeeringInner inner) { - return (inner == null) - ? null - : new ExpressRouteCircuitPeeringImpl<>(parent, inner, innerModel(), inner.peeringType()); - } - - @Override - public ExpressRouteCircuitPeeringImpl - defineAzurePrivatePeering() { - return new ExpressRouteCircuitPeeringImpl<>( - parent, new ExpressRouteCircuitPeeringInner(), innerModel(), ExpressRoutePeeringType.AZURE_PRIVATE_PEERING); - } - - @Override - public ExpressRouteCircuitPeeringImpl - defineAzurePublicPeering() { - return new ExpressRouteCircuitPeeringImpl<>( - parent, new ExpressRouteCircuitPeeringInner(), innerModel(), ExpressRoutePeeringType.AZURE_PUBLIC_PEERING); - } - - @Override - public ExpressRouteCircuitPeeringImpl - defineMicrosoftPeering() { - return new ExpressRouteCircuitPeeringImpl<>( - parent, new ExpressRouteCircuitPeeringInner(), innerModel(), ExpressRoutePeeringType.MICROSOFT_PEERING); - } - - @Override - public Mono getByNameAsync(String name) { - return innerModel().getAsync(parent.resourceGroupName(), parent.name(), name).map(inner -> wrapModel(inner)); - } - - @Override - public ExpressRouteCircuitPeering getByName(String name) { - return getByNameAsync(name).block(); - } - - @Override - public void deleteByName(String name) { - deleteByNameAsync(name).block(); - } - - @Override - public Mono deleteByNameAsync(String name) { - return this.innerModel().deleteAsync(parent.resourceGroupName(), parent.name(), name); - } - - @Override - public ExpressRouteCircuit parent() { - return parent; - } - - @Override - public Mono deleteByParentAsync(String groupName, String parentName, String name) { - return this.innerModel().deleteAsync(groupName, parentName, name); - } - - @Override - public Mono getByParentAsync(String resourceGroup, String parentName, String name) { - return innerModel().getAsync(resourceGroup, parentName, name).map(inner -> wrapModel((inner))); - } - - @Override - public PagedIterable listByParent(String resourceGroupName, String parentName) { - return wrapList(this.innerModel().list(resourceGroupName, parentName)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ExpressRouteCircuitStatsImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ExpressRouteCircuitStatsImpl.java deleted file mode 100644 index 2f22c84cebad..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ExpressRouteCircuitStatsImpl.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.resourcemanager.network.models.ExpressRouteCircuitStats; -import com.azure.resourcemanager.network.fluent.models.ExpressRouteCircuitStatsInner; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.WrapperImpl; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; - -/** Implementation for {@link ExpressRouteCircuitStats}. */ -public class ExpressRouteCircuitStatsImpl extends WrapperImpl - implements ExpressRouteCircuitStats { - ExpressRouteCircuitStatsImpl(ExpressRouteCircuitStatsInner innerObject) { - super(innerObject); - } - - @Override - public long primaryBytesIn() { - return ResourceManagerUtils.toPrimitiveLong(innerModel().primarybytesIn()); - } - - @Override - public long primaryBytesOut() { - return ResourceManagerUtils.toPrimitiveLong(innerModel().primarybytesOut()); - } - - @Override - public long secondaryBytesIn() { - return ResourceManagerUtils.toPrimitiveLong(innerModel().secondarybytesIn()); - } - - @Override - public long secondaryBytesOut() { - return ResourceManagerUtils.toPrimitiveLong(innerModel().secondarybytesOut()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ExpressRouteCircuitsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ExpressRouteCircuitsClientImpl.java deleted file mode 100644 index 35d2e69888bc..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ExpressRouteCircuitsClientImpl.java +++ /dev/null @@ -1,2852 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.ExpressRouteCircuitsClient; -import com.azure.resourcemanager.network.fluent.models.ExpressRouteCircuitInner; -import com.azure.resourcemanager.network.fluent.models.ExpressRouteCircuitStatsInner; -import com.azure.resourcemanager.network.fluent.models.ExpressRouteCircuitsArpTableListResultInner; -import com.azure.resourcemanager.network.fluent.models.ExpressRouteCircuitsRoutesTableListResultInner; -import com.azure.resourcemanager.network.fluent.models.ExpressRouteCircuitsRoutesTableSummaryListResultInner; -import com.azure.resourcemanager.network.models.ExpressRouteCircuitListResult; -import com.azure.resourcemanager.network.models.TagsObject; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ExpressRouteCircuitsClient. */ -public final class ExpressRouteCircuitsClientImpl - implements InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete, - ExpressRouteCircuitsClient { - private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final ExpressRouteCircuitsService service; - - /** The service client containing this operation class. */ - private final NetworkManagementClientImpl client; - - /** - * Initializes an instance of ExpressRouteCircuitsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ExpressRouteCircuitsClientImpl(NetworkManagementClientImpl client) { - this.service = - RestProxy - .create(ExpressRouteCircuitsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for NetworkManagementClientExpressRouteCircuits to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "NetworkManagementCli") - private interface ExpressRouteCircuitsService { - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/expressRouteCircuits/{circuitName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("circuitName") String circuitName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/expressRouteCircuits/{circuitName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("circuitName") String circuitName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/expressRouteCircuits/{circuitName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("circuitName") String circuitName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") ExpressRouteCircuitInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/expressRouteCircuits/{circuitName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> updateTags( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("circuitName") String circuitName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") TagsObject parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/expressRouteCircuits/{circuitName}/peerings/{peeringName}/arpTables/{devicePath}") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> listArpTable( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("circuitName") String circuitName, - @PathParam("peeringName") String peeringName, - @PathParam("devicePath") String devicePath, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTables/{devicePath}") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> listRoutesTable( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("circuitName") String circuitName, - @PathParam("peeringName") String peeringName, - @PathParam("devicePath") String devicePath, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTablesSummary/{devicePath}") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> listRoutesTableSummary( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("circuitName") String circuitName, - @PathParam("peeringName") String peeringName, - @PathParam("devicePath") String devicePath, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/expressRouteCircuits/{circuitName}/stats") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getStats( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("circuitName") String circuitName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/expressRouteCircuits/{circuitName}/peerings/{peeringName}/stats") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getPeeringStats( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("circuitName") String circuitName, - @PathParam("peeringName") String peeringName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/expressRouteCircuits") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteCircuits") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAllNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Deletes the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync(String resourceGroupName, String circuitName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (circuitName == null) { - return Mono.error(new IllegalArgumentException("Parameter circuitName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - circuitName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String circuitName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (circuitName == null) { - return Mono.error(new IllegalArgumentException("Parameter circuitName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - circuitName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Deletes the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String circuitName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, circuitName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deletes the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String circuitName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(resourceGroupName, circuitName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete(String resourceGroupName, String circuitName) { - return beginDeleteAsync(resourceGroupName, circuitName).getSyncPoller(); - } - - /** - * Deletes the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String circuitName, Context context) { - return beginDeleteAsync(resourceGroupName, circuitName, context).getSyncPoller(); - } - - /** - * Deletes the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String circuitName) { - return beginDeleteAsync(resourceGroupName, circuitName).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String circuitName, Context context) { - return beginDeleteAsync(resourceGroupName, circuitName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String circuitName) { - deleteAsync(resourceGroupName, circuitName).block(); - } - - /** - * Deletes the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String circuitName, Context context) { - deleteAsync(resourceGroupName, circuitName, context).block(); - } - - /** - * Gets information about the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of express route circuit. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified express route circuit. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String circuitName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (circuitName == null) { - return Mono.error(new IllegalArgumentException("Parameter circuitName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - circuitName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets information about the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of express route circuit. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified express route circuit. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String circuitName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (circuitName == null) { - return Mono.error(new IllegalArgumentException("Parameter circuitName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - circuitName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets information about the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of express route circuit. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified express route circuit. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync(String resourceGroupName, String circuitName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, circuitName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets information about the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of express route circuit. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified express route circuit. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ExpressRouteCircuitInner getByResourceGroup(String resourceGroupName, String circuitName) { - return getByResourceGroupAsync(resourceGroupName, circuitName).block(); - } - - /** - * Gets information about the specified express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of express route circuit. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified express route circuit. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String circuitName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, circuitName, context).block(); - } - - /** - * Creates or updates an express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the circuit. - * @param parameters Parameters supplied to the create or update express route circuit operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteCircuit resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (circuitName == null) { - return Mono.error(new IllegalArgumentException("Parameter circuitName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - circuitName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates an express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the circuit. - * @param parameters Parameters supplied to the create or update express route circuit operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteCircuit resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (circuitName == null) { - return Mono.error(new IllegalArgumentException("Parameter circuitName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - circuitName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Creates or updates an express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the circuit. - * @param parameters Parameters supplied to the create or update express route circuit operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteCircuit resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, ExpressRouteCircuitInner> beginCreateOrUpdateAsync( - String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, circuitName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ExpressRouteCircuitInner.class, - ExpressRouteCircuitInner.class, - Context.NONE); - } - - /** - * Creates or updates an express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the circuit. - * @param parameters Parameters supplied to the create or update express route circuit operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteCircuit resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, ExpressRouteCircuitInner> beginCreateOrUpdateAsync( - String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, circuitName, parameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ExpressRouteCircuitInner.class, - ExpressRouteCircuitInner.class, - context); - } - - /** - * Creates or updates an express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the circuit. - * @param parameters Parameters supplied to the create or update express route circuit operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteCircuit resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, ExpressRouteCircuitInner> beginCreateOrUpdate( - String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, circuitName, parameters).getSyncPoller(); - } - - /** - * Creates or updates an express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the circuit. - * @param parameters Parameters supplied to the create or update express route circuit operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteCircuit resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, ExpressRouteCircuitInner> beginCreateOrUpdate( - String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, circuitName, parameters, context).getSyncPoller(); - } - - /** - * Creates or updates an express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the circuit. - * @param parameters Parameters supplied to the create or update express route circuit operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteCircuit resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, circuitName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates an express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the circuit. - * @param parameters Parameters supplied to the create or update express route circuit operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteCircuit resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, circuitName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates an express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the circuit. - * @param parameters Parameters supplied to the create or update express route circuit operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteCircuit resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ExpressRouteCircuitInner createOrUpdate( - String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters) { - return createOrUpdateAsync(resourceGroupName, circuitName, parameters).block(); - } - - /** - * Creates or updates an express route circuit. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the circuit. - * @param parameters Parameters supplied to the create or update express route circuit operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteCircuit resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ExpressRouteCircuitInner createOrUpdate( - String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters, Context context) { - return createOrUpdateAsync(resourceGroupName, circuitName, parameters, context).block(); - } - - /** - * Updates an express route circuit tags. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the circuit. - * @param parameters Parameters supplied to update express route circuit tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteCircuit resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateTagsWithResponseAsync( - String resourceGroupName, String circuitName, TagsObject parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (circuitName == null) { - return Mono.error(new IllegalArgumentException("Parameter circuitName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updateTags( - this.client.getEndpoint(), - resourceGroupName, - circuitName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates an express route circuit tags. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the circuit. - * @param parameters Parameters supplied to update express route circuit tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteCircuit resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateTagsWithResponseAsync( - String resourceGroupName, String circuitName, TagsObject parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (circuitName == null) { - return Mono.error(new IllegalArgumentException("Parameter circuitName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updateTags( - this.client.getEndpoint(), - resourceGroupName, - circuitName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Updates an express route circuit tags. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the circuit. - * @param parameters Parameters supplied to update express route circuit tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteCircuit resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, ExpressRouteCircuitInner> beginUpdateTagsAsync( - String resourceGroupName, String circuitName, TagsObject parameters) { - Mono>> mono = updateTagsWithResponseAsync(resourceGroupName, circuitName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ExpressRouteCircuitInner.class, - ExpressRouteCircuitInner.class, - Context.NONE); - } - - /** - * Updates an express route circuit tags. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the circuit. - * @param parameters Parameters supplied to update express route circuit tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteCircuit resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, ExpressRouteCircuitInner> beginUpdateTagsAsync( - String resourceGroupName, String circuitName, TagsObject parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - updateTagsWithResponseAsync(resourceGroupName, circuitName, parameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ExpressRouteCircuitInner.class, - ExpressRouteCircuitInner.class, - context); - } - - /** - * Updates an express route circuit tags. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the circuit. - * @param parameters Parameters supplied to update express route circuit tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteCircuit resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, ExpressRouteCircuitInner> beginUpdateTags( - String resourceGroupName, String circuitName, TagsObject parameters) { - return beginUpdateTagsAsync(resourceGroupName, circuitName, parameters).getSyncPoller(); - } - - /** - * Updates an express route circuit tags. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the circuit. - * @param parameters Parameters supplied to update express route circuit tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteCircuit resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, ExpressRouteCircuitInner> beginUpdateTags( - String resourceGroupName, String circuitName, TagsObject parameters, Context context) { - return beginUpdateTagsAsync(resourceGroupName, circuitName, parameters, context).getSyncPoller(); - } - - /** - * Updates an express route circuit tags. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the circuit. - * @param parameters Parameters supplied to update express route circuit tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteCircuit resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateTagsAsync( - String resourceGroupName, String circuitName, TagsObject parameters) { - return beginUpdateTagsAsync(resourceGroupName, circuitName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates an express route circuit tags. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the circuit. - * @param parameters Parameters supplied to update express route circuit tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteCircuit resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateTagsAsync( - String resourceGroupName, String circuitName, TagsObject parameters, Context context) { - return beginUpdateTagsAsync(resourceGroupName, circuitName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates an express route circuit tags. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the circuit. - * @param parameters Parameters supplied to update express route circuit tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteCircuit resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ExpressRouteCircuitInner updateTags(String resourceGroupName, String circuitName, TagsObject parameters) { - return updateTagsAsync(resourceGroupName, circuitName, parameters).block(); - } - - /** - * Updates an express route circuit tags. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the circuit. - * @param parameters Parameters supplied to update express route circuit tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteCircuit resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ExpressRouteCircuitInner updateTags( - String resourceGroupName, String circuitName, TagsObject parameters, Context context) { - return updateTagsAsync(resourceGroupName, circuitName, parameters, context).block(); - } - - /** - * Gets the currently advertised ARP table associated with the express route circuit in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised ARP table associated with the express route circuit in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> listArpTableWithResponseAsync( - String resourceGroupName, String circuitName, String peeringName, String devicePath) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (circuitName == null) { - return Mono.error(new IllegalArgumentException("Parameter circuitName is required and cannot be null.")); - } - if (peeringName == null) { - return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); - } - if (devicePath == null) { - return Mono.error(new IllegalArgumentException("Parameter devicePath is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listArpTable( - this.client.getEndpoint(), - resourceGroupName, - circuitName, - peeringName, - devicePath, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the currently advertised ARP table associated with the express route circuit in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised ARP table associated with the express route circuit in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> listArpTableWithResponseAsync( - String resourceGroupName, String circuitName, String peeringName, String devicePath, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (circuitName == null) { - return Mono.error(new IllegalArgumentException("Parameter circuitName is required and cannot be null.")); - } - if (peeringName == null) { - return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); - } - if (devicePath == null) { - return Mono.error(new IllegalArgumentException("Parameter devicePath is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listArpTable( - this.client.getEndpoint(), - resourceGroupName, - circuitName, - peeringName, - devicePath, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets the currently advertised ARP table associated with the express route circuit in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised ARP table associated with the express route circuit in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux< - PollResult, ExpressRouteCircuitsArpTableListResultInner> - beginListArpTableAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { - Mono>> mono = - listArpTableWithResponseAsync(resourceGroupName, circuitName, peeringName, devicePath); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ExpressRouteCircuitsArpTableListResultInner.class, - ExpressRouteCircuitsArpTableListResultInner.class, - Context.NONE); - } - - /** - * Gets the currently advertised ARP table associated with the express route circuit in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised ARP table associated with the express route circuit in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux< - PollResult, ExpressRouteCircuitsArpTableListResultInner> - beginListArpTableAsync( - String resourceGroupName, String circuitName, String peeringName, String devicePath, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - listArpTableWithResponseAsync(resourceGroupName, circuitName, peeringName, devicePath, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ExpressRouteCircuitsArpTableListResultInner.class, - ExpressRouteCircuitsArpTableListResultInner.class, - context); - } - - /** - * Gets the currently advertised ARP table associated with the express route circuit in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised ARP table associated with the express route circuit in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller< - PollResult, ExpressRouteCircuitsArpTableListResultInner> - beginListArpTable(String resourceGroupName, String circuitName, String peeringName, String devicePath) { - return beginListArpTableAsync(resourceGroupName, circuitName, peeringName, devicePath).getSyncPoller(); - } - - /** - * Gets the currently advertised ARP table associated with the express route circuit in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised ARP table associated with the express route circuit in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller< - PollResult, ExpressRouteCircuitsArpTableListResultInner> - beginListArpTable( - String resourceGroupName, String circuitName, String peeringName, String devicePath, Context context) { - return beginListArpTableAsync(resourceGroupName, circuitName, peeringName, devicePath, context).getSyncPoller(); - } - - /** - * Gets the currently advertised ARP table associated with the express route circuit in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised ARP table associated with the express route circuit in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listArpTableAsync( - String resourceGroupName, String circuitName, String peeringName, String devicePath) { - return beginListArpTableAsync(resourceGroupName, circuitName, peeringName, devicePath) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Gets the currently advertised ARP table associated with the express route circuit in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised ARP table associated with the express route circuit in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listArpTableAsync( - String resourceGroupName, String circuitName, String peeringName, String devicePath, Context context) { - return beginListArpTableAsync(resourceGroupName, circuitName, peeringName, devicePath, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Gets the currently advertised ARP table associated with the express route circuit in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised ARP table associated with the express route circuit in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ExpressRouteCircuitsArpTableListResultInner listArpTable( - String resourceGroupName, String circuitName, String peeringName, String devicePath) { - return listArpTableAsync(resourceGroupName, circuitName, peeringName, devicePath).block(); - } - - /** - * Gets the currently advertised ARP table associated with the express route circuit in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised ARP table associated with the express route circuit in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ExpressRouteCircuitsArpTableListResultInner listArpTable( - String resourceGroupName, String circuitName, String peeringName, String devicePath, Context context) { - return listArpTableAsync(resourceGroupName, circuitName, peeringName, devicePath, context).block(); - } - - /** - * Gets the currently advertised routes table associated with the express route circuit in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised routes table associated with the express route circuit in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> listRoutesTableWithResponseAsync( - String resourceGroupName, String circuitName, String peeringName, String devicePath) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (circuitName == null) { - return Mono.error(new IllegalArgumentException("Parameter circuitName is required and cannot be null.")); - } - if (peeringName == null) { - return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); - } - if (devicePath == null) { - return Mono.error(new IllegalArgumentException("Parameter devicePath is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listRoutesTable( - this.client.getEndpoint(), - resourceGroupName, - circuitName, - peeringName, - devicePath, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the currently advertised routes table associated with the express route circuit in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised routes table associated with the express route circuit in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> listRoutesTableWithResponseAsync( - String resourceGroupName, String circuitName, String peeringName, String devicePath, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (circuitName == null) { - return Mono.error(new IllegalArgumentException("Parameter circuitName is required and cannot be null.")); - } - if (peeringName == null) { - return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); - } - if (devicePath == null) { - return Mono.error(new IllegalArgumentException("Parameter devicePath is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listRoutesTable( - this.client.getEndpoint(), - resourceGroupName, - circuitName, - peeringName, - devicePath, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets the currently advertised routes table associated with the express route circuit in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised routes table associated with the express route circuit in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux< - PollResult, ExpressRouteCircuitsRoutesTableListResultInner> - beginListRoutesTableAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { - Mono>> mono = - listRoutesTableWithResponseAsync(resourceGroupName, circuitName, peeringName, devicePath); - return this - .client - . - getLroResult( - mono, - this.client.getHttpPipeline(), - ExpressRouteCircuitsRoutesTableListResultInner.class, - ExpressRouteCircuitsRoutesTableListResultInner.class, - Context.NONE); - } - - /** - * Gets the currently advertised routes table associated with the express route circuit in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised routes table associated with the express route circuit in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux< - PollResult, ExpressRouteCircuitsRoutesTableListResultInner> - beginListRoutesTableAsync( - String resourceGroupName, String circuitName, String peeringName, String devicePath, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - listRoutesTableWithResponseAsync(resourceGroupName, circuitName, peeringName, devicePath, context); - return this - .client - . - getLroResult( - mono, - this.client.getHttpPipeline(), - ExpressRouteCircuitsRoutesTableListResultInner.class, - ExpressRouteCircuitsRoutesTableListResultInner.class, - context); - } - - /** - * Gets the currently advertised routes table associated with the express route circuit in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised routes table associated with the express route circuit in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller< - PollResult, ExpressRouteCircuitsRoutesTableListResultInner> - beginListRoutesTable(String resourceGroupName, String circuitName, String peeringName, String devicePath) { - return beginListRoutesTableAsync(resourceGroupName, circuitName, peeringName, devicePath).getSyncPoller(); - } - - /** - * Gets the currently advertised routes table associated with the express route circuit in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised routes table associated with the express route circuit in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller< - PollResult, ExpressRouteCircuitsRoutesTableListResultInner> - beginListRoutesTable( - String resourceGroupName, String circuitName, String peeringName, String devicePath, Context context) { - return beginListRoutesTableAsync(resourceGroupName, circuitName, peeringName, devicePath, context) - .getSyncPoller(); - } - - /** - * Gets the currently advertised routes table associated with the express route circuit in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised routes table associated with the express route circuit in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listRoutesTableAsync( - String resourceGroupName, String circuitName, String peeringName, String devicePath) { - return beginListRoutesTableAsync(resourceGroupName, circuitName, peeringName, devicePath) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Gets the currently advertised routes table associated with the express route circuit in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised routes table associated with the express route circuit in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listRoutesTableAsync( - String resourceGroupName, String circuitName, String peeringName, String devicePath, Context context) { - return beginListRoutesTableAsync(resourceGroupName, circuitName, peeringName, devicePath, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Gets the currently advertised routes table associated with the express route circuit in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised routes table associated with the express route circuit in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ExpressRouteCircuitsRoutesTableListResultInner listRoutesTable( - String resourceGroupName, String circuitName, String peeringName, String devicePath) { - return listRoutesTableAsync(resourceGroupName, circuitName, peeringName, devicePath).block(); - } - - /** - * Gets the currently advertised routes table associated with the express route circuit in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised routes table associated with the express route circuit in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ExpressRouteCircuitsRoutesTableListResultInner listRoutesTable( - String resourceGroupName, String circuitName, String peeringName, String devicePath, Context context) { - return listRoutesTableAsync(resourceGroupName, circuitName, peeringName, devicePath, context).block(); - } - - /** - * Gets the currently advertised routes table summary associated with the express route circuit in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised routes table summary associated with the express route circuit in a resource - * group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> listRoutesTableSummaryWithResponseAsync( - String resourceGroupName, String circuitName, String peeringName, String devicePath) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (circuitName == null) { - return Mono.error(new IllegalArgumentException("Parameter circuitName is required and cannot be null.")); - } - if (peeringName == null) { - return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); - } - if (devicePath == null) { - return Mono.error(new IllegalArgumentException("Parameter devicePath is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listRoutesTableSummary( - this.client.getEndpoint(), - resourceGroupName, - circuitName, - peeringName, - devicePath, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the currently advertised routes table summary associated with the express route circuit in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised routes table summary associated with the express route circuit in a resource - * group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> listRoutesTableSummaryWithResponseAsync( - String resourceGroupName, String circuitName, String peeringName, String devicePath, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (circuitName == null) { - return Mono.error(new IllegalArgumentException("Parameter circuitName is required and cannot be null.")); - } - if (peeringName == null) { - return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); - } - if (devicePath == null) { - return Mono.error(new IllegalArgumentException("Parameter devicePath is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listRoutesTableSummary( - this.client.getEndpoint(), - resourceGroupName, - circuitName, - peeringName, - devicePath, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets the currently advertised routes table summary associated with the express route circuit in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised routes table summary associated with the express route circuit in a resource - * group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux< - PollResult, - ExpressRouteCircuitsRoutesTableSummaryListResultInner> - beginListRoutesTableSummaryAsync( - String resourceGroupName, String circuitName, String peeringName, String devicePath) { - Mono>> mono = - listRoutesTableSummaryWithResponseAsync(resourceGroupName, circuitName, peeringName, devicePath); - return this - .client - . - getLroResult( - mono, - this.client.getHttpPipeline(), - ExpressRouteCircuitsRoutesTableSummaryListResultInner.class, - ExpressRouteCircuitsRoutesTableSummaryListResultInner.class, - Context.NONE); - } - - /** - * Gets the currently advertised routes table summary associated with the express route circuit in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised routes table summary associated with the express route circuit in a resource - * group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux< - PollResult, - ExpressRouteCircuitsRoutesTableSummaryListResultInner> - beginListRoutesTableSummaryAsync( - String resourceGroupName, String circuitName, String peeringName, String devicePath, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - listRoutesTableSummaryWithResponseAsync(resourceGroupName, circuitName, peeringName, devicePath, context); - return this - .client - . - getLroResult( - mono, - this.client.getHttpPipeline(), - ExpressRouteCircuitsRoutesTableSummaryListResultInner.class, - ExpressRouteCircuitsRoutesTableSummaryListResultInner.class, - context); - } - - /** - * Gets the currently advertised routes table summary associated with the express route circuit in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised routes table summary associated with the express route circuit in a resource - * group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller< - PollResult, - ExpressRouteCircuitsRoutesTableSummaryListResultInner> - beginListRoutesTableSummary( - String resourceGroupName, String circuitName, String peeringName, String devicePath) { - return beginListRoutesTableSummaryAsync(resourceGroupName, circuitName, peeringName, devicePath) - .getSyncPoller(); - } - - /** - * Gets the currently advertised routes table summary associated with the express route circuit in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised routes table summary associated with the express route circuit in a resource - * group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller< - PollResult, - ExpressRouteCircuitsRoutesTableSummaryListResultInner> - beginListRoutesTableSummary( - String resourceGroupName, String circuitName, String peeringName, String devicePath, Context context) { - return beginListRoutesTableSummaryAsync(resourceGroupName, circuitName, peeringName, devicePath, context) - .getSyncPoller(); - } - - /** - * Gets the currently advertised routes table summary associated with the express route circuit in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised routes table summary associated with the express route circuit in a resource - * group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listRoutesTableSummaryAsync( - String resourceGroupName, String circuitName, String peeringName, String devicePath) { - return beginListRoutesTableSummaryAsync(resourceGroupName, circuitName, peeringName, devicePath) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Gets the currently advertised routes table summary associated with the express route circuit in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised routes table summary associated with the express route circuit in a resource - * group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listRoutesTableSummaryAsync( - String resourceGroupName, String circuitName, String peeringName, String devicePath, Context context) { - return beginListRoutesTableSummaryAsync(resourceGroupName, circuitName, peeringName, devicePath, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Gets the currently advertised routes table summary associated with the express route circuit in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised routes table summary associated with the express route circuit in a resource - * group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ExpressRouteCircuitsRoutesTableSummaryListResultInner listRoutesTableSummary( - String resourceGroupName, String circuitName, String peeringName, String devicePath) { - return listRoutesTableSummaryAsync(resourceGroupName, circuitName, peeringName, devicePath).block(); - } - - /** - * Gets the currently advertised routes table summary associated with the express route circuit in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised routes table summary associated with the express route circuit in a resource - * group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ExpressRouteCircuitsRoutesTableSummaryListResultInner listRoutesTableSummary( - String resourceGroupName, String circuitName, String peeringName, String devicePath, Context context) { - return listRoutesTableSummaryAsync(resourceGroupName, circuitName, peeringName, devicePath, context).block(); - } - - /** - * Gets all the stats from an express route circuit in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the stats from an express route circuit in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getStatsWithResponseAsync( - String resourceGroupName, String circuitName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (circuitName == null) { - return Mono.error(new IllegalArgumentException("Parameter circuitName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getStats( - this.client.getEndpoint(), - resourceGroupName, - circuitName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all the stats from an express route circuit in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the stats from an express route circuit in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getStatsWithResponseAsync( - String resourceGroupName, String circuitName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (circuitName == null) { - return Mono.error(new IllegalArgumentException("Parameter circuitName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getStats( - this.client.getEndpoint(), - resourceGroupName, - circuitName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets all the stats from an express route circuit in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the stats from an express route circuit in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getStatsAsync(String resourceGroupName, String circuitName) { - return getStatsWithResponseAsync(resourceGroupName, circuitName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets all the stats from an express route circuit in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the stats from an express route circuit in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ExpressRouteCircuitStatsInner getStats(String resourceGroupName, String circuitName) { - return getStatsAsync(resourceGroupName, circuitName).block(); - } - - /** - * Gets all the stats from an express route circuit in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the stats from an express route circuit in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getStatsWithResponse( - String resourceGroupName, String circuitName, Context context) { - return getStatsWithResponseAsync(resourceGroupName, circuitName, context).block(); - } - - /** - * Gets all stats from an express route circuit in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all stats from an express route circuit in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getPeeringStatsWithResponseAsync( - String resourceGroupName, String circuitName, String peeringName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (circuitName == null) { - return Mono.error(new IllegalArgumentException("Parameter circuitName is required and cannot be null.")); - } - if (peeringName == null) { - return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getPeeringStats( - this.client.getEndpoint(), - resourceGroupName, - circuitName, - peeringName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all stats from an express route circuit in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all stats from an express route circuit in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getPeeringStatsWithResponseAsync( - String resourceGroupName, String circuitName, String peeringName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (circuitName == null) { - return Mono.error(new IllegalArgumentException("Parameter circuitName is required and cannot be null.")); - } - if (peeringName == null) { - return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getPeeringStats( - this.client.getEndpoint(), - resourceGroupName, - circuitName, - peeringName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets all stats from an express route circuit in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all stats from an express route circuit in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getPeeringStatsAsync( - String resourceGroupName, String circuitName, String peeringName) { - return getPeeringStatsWithResponseAsync(resourceGroupName, circuitName, peeringName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets all stats from an express route circuit in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all stats from an express route circuit in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ExpressRouteCircuitStatsInner getPeeringStats( - String resourceGroupName, String circuitName, String peeringName) { - return getPeeringStatsAsync(resourceGroupName, circuitName, peeringName).block(); - } - - /** - * Gets all stats from an express route circuit in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param circuitName The name of the express route circuit. - * @param peeringName The name of the peering. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all stats from an express route circuit in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getPeeringStatsWithResponse( - String resourceGroupName, String circuitName, String peeringName, Context context) { - return getPeeringStatsWithResponseAsync(resourceGroupName, circuitName, peeringName, context).block(); - } - - /** - * Gets all the express route circuits in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the express route circuits in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all the express route circuits in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the express route circuits in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all the express route circuits in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the express route circuits in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets all the express route circuits in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the express route circuits in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all the express route circuits in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the express route circuits in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * Gets all the express route circuits in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the express route circuits in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * Gets all the express route circuits in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the express route circuits in a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all the express route circuits in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the express route circuits in a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all the express route circuits in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the express route circuits in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listAllNextSinglePageAsync(nextLink)); - } - - /** - * Gets all the express route circuits in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the express route circuits in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listAllNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all the express route circuits in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the express route circuits in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Gets all the express route circuits in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the express route circuits in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListExpressRouteCircuit API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListExpressRouteCircuit API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListExpressRouteCircuit API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAllNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listAllNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListExpressRouteCircuit API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAllNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listAllNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ExpressRouteCircuitsImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ExpressRouteCircuitsImpl.java deleted file mode 100644 index 4bcab9491495..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ExpressRouteCircuitsImpl.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.network.fluent.ExpressRouteCircuitsClient; -import com.azure.resourcemanager.network.fluent.models.ExpressRouteCircuitInner; -import com.azure.resourcemanager.network.models.ExpressRouteCircuit; -import com.azure.resourcemanager.network.models.ExpressRouteCircuits; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.TopLevelModifiableResourcesImpl; - -public class ExpressRouteCircuitsImpl - extends TopLevelModifiableResourcesImpl< - ExpressRouteCircuit, - ExpressRouteCircuitImpl, - ExpressRouteCircuitInner, - ExpressRouteCircuitsClient, - NetworkManager> - implements ExpressRouteCircuits { - - public ExpressRouteCircuitsImpl(NetworkManager manager) { - super(manager.serviceClient().getExpressRouteCircuits(), manager); - } - - @Override - protected ExpressRouteCircuitImpl wrapModel(String name) { - ExpressRouteCircuitInner inner = new ExpressRouteCircuitInner(); - - return new ExpressRouteCircuitImpl(name, inner, super.manager()); - } - - @Override - protected ExpressRouteCircuitImpl wrapModel(ExpressRouteCircuitInner inner) { - if (inner == null) { - return null; - } - return new ExpressRouteCircuitImpl(inner.name(), inner, this.manager()); - } - - @Override - public ExpressRouteCircuitImpl define(String name) { - return wrapModel(name); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ExpressRouteConnectionsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ExpressRouteConnectionsClientImpl.java deleted file mode 100644 index cd4258269ace..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ExpressRouteConnectionsClientImpl.java +++ /dev/null @@ -1,1075 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.ExpressRouteConnectionsClient; -import com.azure.resourcemanager.network.fluent.models.ExpressRouteConnectionInner; -import com.azure.resourcemanager.network.fluent.models.ExpressRouteConnectionListInner; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ExpressRouteConnectionsClient. */ -public final class ExpressRouteConnectionsClientImpl implements ExpressRouteConnectionsClient { - private final ClientLogger logger = new ClientLogger(ExpressRouteConnectionsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final ExpressRouteConnectionsService service; - - /** The service client containing this operation class. */ - private final NetworkManagementClientImpl client; - - /** - * Initializes an instance of ExpressRouteConnectionsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ExpressRouteConnectionsClientImpl(NetworkManagementClientImpl client) { - this.service = - RestProxy - .create(ExpressRouteConnectionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for NetworkManagementClientExpressRouteConnections to be used by the - * proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "NetworkManagementCli") - private interface ExpressRouteConnectionsService { - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/expressRouteGateways/{expressRouteGatewayName}/expressRouteConnections/{connectionName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("expressRouteGatewayName") String expressRouteGatewayName, - @PathParam("connectionName") String connectionName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") ExpressRouteConnectionInner putExpressRouteConnectionParameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/expressRouteGateways/{expressRouteGatewayName}/expressRouteConnections/{connectionName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("expressRouteGatewayName") String expressRouteGatewayName, - @PathParam("connectionName") String connectionName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/expressRouteGateways/{expressRouteGatewayName}/expressRouteConnections/{connectionName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("expressRouteGatewayName") String expressRouteGatewayName, - @PathParam("connectionName") String connectionName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/expressRouteGateways/{expressRouteGatewayName}/expressRouteConnections") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("expressRouteGatewayName") String expressRouteGatewayName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @param connectionName The name of the connection subresource. - * @param putExpressRouteConnectionParameters Parameters required in an ExpressRouteConnection PUT operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteConnection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String expressRouteGatewayName, - String connectionName, - ExpressRouteConnectionInner putExpressRouteConnectionParameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (expressRouteGatewayName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter expressRouteGatewayName is required and cannot be null.")); - } - if (connectionName == null) { - return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (putExpressRouteConnectionParameters == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter putExpressRouteConnectionParameters is required and cannot be null.")); - } else { - putExpressRouteConnectionParameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - expressRouteGatewayName, - connectionName, - apiVersion, - this.client.getSubscriptionId(), - putExpressRouteConnectionParameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @param connectionName The name of the connection subresource. - * @param putExpressRouteConnectionParameters Parameters required in an ExpressRouteConnection PUT operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteConnection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String expressRouteGatewayName, - String connectionName, - ExpressRouteConnectionInner putExpressRouteConnectionParameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (expressRouteGatewayName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter expressRouteGatewayName is required and cannot be null.")); - } - if (connectionName == null) { - return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (putExpressRouteConnectionParameters == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter putExpressRouteConnectionParameters is required and cannot be null.")); - } else { - putExpressRouteConnectionParameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - expressRouteGatewayName, - connectionName, - apiVersion, - this.client.getSubscriptionId(), - putExpressRouteConnectionParameters, - accept, - context); - } - - /** - * Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @param connectionName The name of the connection subresource. - * @param putExpressRouteConnectionParameters Parameters required in an ExpressRouteConnection PUT operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteConnection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, ExpressRouteConnectionInner> beginCreateOrUpdateAsync( - String resourceGroupName, - String expressRouteGatewayName, - String connectionName, - ExpressRouteConnectionInner putExpressRouteConnectionParameters) { - Mono>> mono = - createOrUpdateWithResponseAsync( - resourceGroupName, expressRouteGatewayName, connectionName, putExpressRouteConnectionParameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ExpressRouteConnectionInner.class, - ExpressRouteConnectionInner.class, - Context.NONE); - } - - /** - * Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @param connectionName The name of the connection subresource. - * @param putExpressRouteConnectionParameters Parameters required in an ExpressRouteConnection PUT operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteConnection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, ExpressRouteConnectionInner> beginCreateOrUpdateAsync( - String resourceGroupName, - String expressRouteGatewayName, - String connectionName, - ExpressRouteConnectionInner putExpressRouteConnectionParameters, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync( - resourceGroupName, - expressRouteGatewayName, - connectionName, - putExpressRouteConnectionParameters, - context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ExpressRouteConnectionInner.class, - ExpressRouteConnectionInner.class, - context); - } - - /** - * Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @param connectionName The name of the connection subresource. - * @param putExpressRouteConnectionParameters Parameters required in an ExpressRouteConnection PUT operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteConnection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, ExpressRouteConnectionInner> beginCreateOrUpdate( - String resourceGroupName, - String expressRouteGatewayName, - String connectionName, - ExpressRouteConnectionInner putExpressRouteConnectionParameters) { - return beginCreateOrUpdateAsync( - resourceGroupName, expressRouteGatewayName, connectionName, putExpressRouteConnectionParameters) - .getSyncPoller(); - } - - /** - * Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @param connectionName The name of the connection subresource. - * @param putExpressRouteConnectionParameters Parameters required in an ExpressRouteConnection PUT operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteConnection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, ExpressRouteConnectionInner> beginCreateOrUpdate( - String resourceGroupName, - String expressRouteGatewayName, - String connectionName, - ExpressRouteConnectionInner putExpressRouteConnectionParameters, - Context context) { - return beginCreateOrUpdateAsync( - resourceGroupName, - expressRouteGatewayName, - connectionName, - putExpressRouteConnectionParameters, - context) - .getSyncPoller(); - } - - /** - * Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @param connectionName The name of the connection subresource. - * @param putExpressRouteConnectionParameters Parameters required in an ExpressRouteConnection PUT operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteConnection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, - String expressRouteGatewayName, - String connectionName, - ExpressRouteConnectionInner putExpressRouteConnectionParameters) { - return beginCreateOrUpdateAsync( - resourceGroupName, expressRouteGatewayName, connectionName, putExpressRouteConnectionParameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @param connectionName The name of the connection subresource. - * @param putExpressRouteConnectionParameters Parameters required in an ExpressRouteConnection PUT operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteConnection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, - String expressRouteGatewayName, - String connectionName, - ExpressRouteConnectionInner putExpressRouteConnectionParameters, - Context context) { - return beginCreateOrUpdateAsync( - resourceGroupName, - expressRouteGatewayName, - connectionName, - putExpressRouteConnectionParameters, - context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @param connectionName The name of the connection subresource. - * @param putExpressRouteConnectionParameters Parameters required in an ExpressRouteConnection PUT operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteConnection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ExpressRouteConnectionInner createOrUpdate( - String resourceGroupName, - String expressRouteGatewayName, - String connectionName, - ExpressRouteConnectionInner putExpressRouteConnectionParameters) { - return createOrUpdateAsync( - resourceGroupName, expressRouteGatewayName, connectionName, putExpressRouteConnectionParameters) - .block(); - } - - /** - * Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @param connectionName The name of the connection subresource. - * @param putExpressRouteConnectionParameters Parameters required in an ExpressRouteConnection PUT operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteConnection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ExpressRouteConnectionInner createOrUpdate( - String resourceGroupName, - String expressRouteGatewayName, - String connectionName, - ExpressRouteConnectionInner putExpressRouteConnectionParameters, - Context context) { - return createOrUpdateAsync( - resourceGroupName, - expressRouteGatewayName, - connectionName, - putExpressRouteConnectionParameters, - context) - .block(); - } - - /** - * Gets the specified ExpressRouteConnection. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @param connectionName The name of the ExpressRoute connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified ExpressRouteConnection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String resourceGroupName, String expressRouteGatewayName, String connectionName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (expressRouteGatewayName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter expressRouteGatewayName is required and cannot be null.")); - } - if (connectionName == null) { - return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - resourceGroupName, - expressRouteGatewayName, - connectionName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the specified ExpressRouteConnection. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @param connectionName The name of the ExpressRoute connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified ExpressRouteConnection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String expressRouteGatewayName, String connectionName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (expressRouteGatewayName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter expressRouteGatewayName is required and cannot be null.")); - } - if (connectionName == null) { - return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - resourceGroupName, - expressRouteGatewayName, - connectionName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets the specified ExpressRouteConnection. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @param connectionName The name of the ExpressRoute connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified ExpressRouteConnection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync( - String resourceGroupName, String expressRouteGatewayName, String connectionName) { - return getWithResponseAsync(resourceGroupName, expressRouteGatewayName, connectionName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the specified ExpressRouteConnection. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @param connectionName The name of the ExpressRoute connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified ExpressRouteConnection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ExpressRouteConnectionInner get( - String resourceGroupName, String expressRouteGatewayName, String connectionName) { - return getAsync(resourceGroupName, expressRouteGatewayName, connectionName).block(); - } - - /** - * Gets the specified ExpressRouteConnection. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @param connectionName The name of the ExpressRoute connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified ExpressRouteConnection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String expressRouteGatewayName, String connectionName, Context context) { - return getWithResponseAsync(resourceGroupName, expressRouteGatewayName, connectionName, context).block(); - } - - /** - * Deletes a connection to a ExpressRoute circuit. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @param connectionName The name of the connection subresource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync( - String resourceGroupName, String expressRouteGatewayName, String connectionName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (expressRouteGatewayName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter expressRouteGatewayName is required and cannot be null.")); - } - if (connectionName == null) { - return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - expressRouteGatewayName, - connectionName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a connection to a ExpressRoute circuit. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @param connectionName The name of the connection subresource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String expressRouteGatewayName, String connectionName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (expressRouteGatewayName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter expressRouteGatewayName is required and cannot be null.")); - } - if (connectionName == null) { - return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - expressRouteGatewayName, - connectionName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Deletes a connection to a ExpressRoute circuit. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @param connectionName The name of the connection subresource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String expressRouteGatewayName, String connectionName) { - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, expressRouteGatewayName, connectionName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deletes a connection to a ExpressRoute circuit. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @param connectionName The name of the connection subresource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String expressRouteGatewayName, String connectionName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, expressRouteGatewayName, connectionName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes a connection to a ExpressRoute circuit. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @param connectionName The name of the connection subresource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String expressRouteGatewayName, String connectionName) { - return beginDeleteAsync(resourceGroupName, expressRouteGatewayName, connectionName).getSyncPoller(); - } - - /** - * Deletes a connection to a ExpressRoute circuit. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @param connectionName The name of the connection subresource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String expressRouteGatewayName, String connectionName, Context context) { - return beginDeleteAsync(resourceGroupName, expressRouteGatewayName, connectionName, context).getSyncPoller(); - } - - /** - * Deletes a connection to a ExpressRoute circuit. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @param connectionName The name of the connection subresource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String expressRouteGatewayName, String connectionName) { - return beginDeleteAsync(resourceGroupName, expressRouteGatewayName, connectionName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a connection to a ExpressRoute circuit. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @param connectionName The name of the connection subresource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync( - String resourceGroupName, String expressRouteGatewayName, String connectionName, Context context) { - return beginDeleteAsync(resourceGroupName, expressRouteGatewayName, connectionName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a connection to a ExpressRoute circuit. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @param connectionName The name of the connection subresource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String expressRouteGatewayName, String connectionName) { - deleteAsync(resourceGroupName, expressRouteGatewayName, connectionName).block(); - } - - /** - * Deletes a connection to a ExpressRoute circuit. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @param connectionName The name of the connection subresource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete( - String resourceGroupName, String expressRouteGatewayName, String connectionName, Context context) { - deleteAsync(resourceGroupName, expressRouteGatewayName, connectionName, context).block(); - } - - /** - * Lists ExpressRouteConnections. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteConnection list. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listWithResponseAsync( - String resourceGroupName, String expressRouteGatewayName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (expressRouteGatewayName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter expressRouteGatewayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - resourceGroupName, - expressRouteGatewayName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists ExpressRouteConnections. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteConnection list. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync( - String resourceGroupName, String expressRouteGatewayName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (expressRouteGatewayName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter expressRouteGatewayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - resourceGroupName, - expressRouteGatewayName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Lists ExpressRouteConnections. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteConnection list. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listAsync(String resourceGroupName, String expressRouteGatewayName) { - return listWithResponseAsync(resourceGroupName, expressRouteGatewayName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Lists ExpressRouteConnections. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteConnection list. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ExpressRouteConnectionListInner list(String resourceGroupName, String expressRouteGatewayName) { - return listAsync(resourceGroupName, expressRouteGatewayName).block(); - } - - /** - * Lists ExpressRouteConnections. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteConnection list. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse( - String resourceGroupName, String expressRouteGatewayName, Context context) { - return listWithResponseAsync(resourceGroupName, expressRouteGatewayName, context).block(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ExpressRouteCrossConnectionImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ExpressRouteCrossConnectionImpl.java deleted file mode 100644 index 4ae6a4c910de..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ExpressRouteCrossConnectionImpl.java +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.network.models.ExpressRouteCircuitReference; -import com.azure.resourcemanager.network.models.ExpressRouteCrossConnection; -import com.azure.resourcemanager.network.models.ExpressRouteCrossConnectionPeering; -import com.azure.resourcemanager.network.models.ExpressRouteCrossConnectionPeerings; -import com.azure.resourcemanager.network.models.ServiceProviderProvisioningState; -import com.azure.resourcemanager.network.fluent.models.ExpressRouteCrossConnectionInner; -import com.azure.resourcemanager.network.fluent.models.ExpressRouteCrossConnectionPeeringInner; -import com.azure.resourcemanager.network.models.TagsObject; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; -import reactor.core.publisher.Mono; - -/** Implementation for ExpressRouteCrossConnection. */ -public class ExpressRouteCrossConnectionImpl - extends GroupableParentResourceWithTagsImpl< - ExpressRouteCrossConnection, ExpressRouteCrossConnectionInner, ExpressRouteCrossConnectionImpl, NetworkManager> - implements ExpressRouteCrossConnection, ExpressRouteCrossConnection.Update { - private ExpressRouteCrossConnectionPeeringsImpl peerings; - private Map crossConnectionPeerings; - - ExpressRouteCrossConnectionImpl(String name, ExpressRouteCrossConnectionInner innerObject, NetworkManager manager) { - super(name, innerObject, manager); - initializeChildrenFromInner(); - } - - @Override - protected Mono createInner() { - return this - .manager() - .serviceClient() - .getExpressRouteCrossConnections() - .createOrUpdateAsync(this.resourceGroupName(), this.name(), this.innerModel()); - } - - @Override - protected void initializeChildrenFromInner() { - crossConnectionPeerings = new HashMap<>(); - if (innerModel().peerings() != null) { - for (ExpressRouteCrossConnectionPeeringInner peering : innerModel().peerings()) { - crossConnectionPeerings - .put( - peering.name(), - new ExpressRouteCrossConnectionPeeringImpl(this, peering, peering.peeringType())); - } - } - } - - @Override - protected Mono getInnerAsync() { - return this - .manager() - .serviceClient() - .getExpressRouteCrossConnections() - .getByResourceGroupAsync(this.resourceGroupName(), this.name()); - } - - @Override - public Mono refreshAsync() { - return super - .refreshAsync() - .map( - expressRouteCrossConnection -> { - ExpressRouteCrossConnectionImpl impl = - (ExpressRouteCrossConnectionImpl) expressRouteCrossConnection; - impl.initializeChildrenFromInner(); - return impl; - }); - } - - @Override - protected Mono applyTagsToInnerAsync() { - return this - .manager() - .serviceClient() - .getExpressRouteCrossConnections() - .updateTagsAsync(resourceGroupName(), name(), new TagsObject().withTags(innerModel().tags())); - } - - @Override - public ExpressRouteCrossConnectionPeerings peerings() { - if (peerings == null) { - peerings = new ExpressRouteCrossConnectionPeeringsImpl(this); - } - return peerings; - } - - @Override - public String primaryAzurePort() { - return innerModel().primaryAzurePort(); - } - - @Override - public String secondaryAzurePort() { - return innerModel().secondaryAzurePort(); - } - - @Override - public Integer stag() { - return innerModel().stag(); - } - - @Override - public String peeringLocation() { - return innerModel().peeringLocation(); - } - - @Override - public int bandwidthInMbps() { - return ResourceManagerUtils.toPrimitiveInt(innerModel().bandwidthInMbps()); - } - - @Override - public ExpressRouteCircuitReference expressRouteCircuit() { - return innerModel().expressRouteCircuit(); - } - - @Override - public ServiceProviderProvisioningState serviceProviderProvisioningState() { - return innerModel().serviceProviderProvisioningState(); - } - - @Override - public String serviceProviderNotes() { - return innerModel().serviceProviderNotes(); - } - - @Override - public String provisioningState() { - return innerModel().provisioningState(); - } - - @Override - public Map peeringsMap() { - return Collections.unmodifiableMap(crossConnectionPeerings); - } - - @Override - public Update withServiceProviderProvisioningState(ServiceProviderProvisioningState state) { - innerModel().withServiceProviderProvisioningState(state); - return this; - } - - @Override - public Update withServiceProviderNotes(String notes) { - innerModel().withServiceProviderNotes(notes); - return this; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ExpressRouteCrossConnectionPeeringImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ExpressRouteCrossConnectionPeeringImpl.java deleted file mode 100644 index 00231e5aa4b8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ExpressRouteCrossConnectionPeeringImpl.java +++ /dev/null @@ -1,232 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.network.fluent.ExpressRouteCrossConnectionPeeringsClient; -import com.azure.resourcemanager.network.fluent.models.ExpressRouteCrossConnectionPeeringInner; -import com.azure.resourcemanager.network.models.ExpressRouteCircuitPeeringConfig; -import com.azure.resourcemanager.network.models.ExpressRouteCrossConnection; -import com.azure.resourcemanager.network.models.ExpressRouteCrossConnectionPeering; -import com.azure.resourcemanager.network.models.ExpressRoutePeeringState; -import com.azure.resourcemanager.network.models.ExpressRoutePeeringType; -import com.azure.resourcemanager.network.models.Ipv6ExpressRouteCircuitPeeringConfig; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.CreatableUpdatableImpl; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import reactor.core.publisher.Mono; - -import java.util.Arrays; - -class ExpressRouteCrossConnectionPeeringImpl - extends CreatableUpdatableImpl< - ExpressRouteCrossConnectionPeering, - ExpressRouteCrossConnectionPeeringInner, - ExpressRouteCrossConnectionPeeringImpl> - implements ExpressRouteCrossConnectionPeering, - ExpressRouteCrossConnectionPeering.Definition, - ExpressRouteCrossConnectionPeering.Update { - private final ExpressRouteCrossConnectionPeeringsClient client; - private final ExpressRouteCrossConnection parent; - - ExpressRouteCrossConnectionPeeringImpl( - ExpressRouteCrossConnectionImpl parent, - ExpressRouteCrossConnectionPeeringInner innerObject, - ExpressRoutePeeringType type) { - super(type.toString(), innerObject); - this.client = parent.manager().serviceClient().getExpressRouteCrossConnectionPeerings(); - this.parent = parent; - innerModel().withPeeringType(type); - } - - @Override - public ExpressRouteCrossConnectionPeeringImpl withAdvertisedPublicPrefixes(String publicPrefix) { - ensureMicrosoftPeeringConfig().withAdvertisedPublicPrefixes(Arrays.asList(publicPrefix)); - return this; - } - - private ExpressRouteCircuitPeeringConfig ensureMicrosoftPeeringConfig() { - if (innerModel().microsoftPeeringConfig() == null) { - innerModel().withMicrosoftPeeringConfig(new ExpressRouteCircuitPeeringConfig()); - } - return innerModel().microsoftPeeringConfig(); - } - - @Override - public ExpressRouteCrossConnectionPeeringImpl withPrimaryPeerAddressPrefix(String addressPrefix) { - innerModel().withPrimaryPeerAddressPrefix(addressPrefix); - return this; - } - - @Override - public ExpressRouteCrossConnectionPeeringImpl withSecondaryPeerAddressPrefix(String addressPrefix) { - innerModel().withSecondaryPeerAddressPrefix(addressPrefix); - return this; - } - - @Override - public ExpressRouteCrossConnectionPeeringImpl withVlanId(int vlanId) { - innerModel().withVlanId(vlanId); - return this; - } - - @Override - public ExpressRouteCrossConnectionPeeringImpl withPeerAsn(long peerASN) { - innerModel().withPeerAsn(peerASN); - return this; - } - - @Override - public DefinitionStages.WithCreate withSharedKey(String sharedKey) { - innerModel().withSharedKey(sharedKey); - return this; - } - - @Override - public Ipv6PeeringConfigImpl defineIpv6Config() { - return new Ipv6PeeringConfigImpl(new Ipv6ExpressRouteCircuitPeeringConfig(), this); - } - - @Override - public ExpressRouteCrossConnectionPeeringImpl withoutIpv6Config() { - innerModel().withIpv6PeeringConfig(null); - return this; - } - - ExpressRouteCrossConnectionPeeringImpl attachIpv6Config(Ipv6PeeringConfigImpl ipv6PeeringConfig) { - innerModel().withIpv6PeeringConfig(ipv6PeeringConfig.innerModel()); - return this; - } - - @Override - public ExpressRouteCrossConnectionPeeringImpl withCustomerAsn(int customerASN) { - ensureMicrosoftPeeringConfig().withCustomerAsn(customerASN); - return this; - } - - @Override - public ExpressRouteCrossConnectionPeeringImpl withRoutingRegistryName(String routingRegistryName) { - ensureMicrosoftPeeringConfig().withRoutingRegistryName(routingRegistryName); - return this; - } - - @Override - public ExpressRouteCrossConnectionPeeringImpl withState(ExpressRoutePeeringState state) { - innerModel().withState(state); - return this; - } - - @Override - protected Mono getInnerAsync() { - return this.client.getAsync(parent.resourceGroupName(), parent.name(), name()); - } - - @Override - public boolean isInCreateMode() { - return this.innerModel().id() == null; - } - - @Override - public Mono createResourceAsync() { - return this - .client - .createOrUpdateAsync(parent.resourceGroupName(), parent.name(), this.name(), innerModel()) - .map( - innerModel -> { - ExpressRouteCrossConnectionPeeringImpl.this.setInner(innerModel); - parent.refresh(); - return ExpressRouteCrossConnectionPeeringImpl.this; - }); - } - - // Getters - - @Override - public String id() { - return innerModel().id(); - } - - @Override - public NetworkManager manager() { - return parent.manager(); - } - - @Override - public String resourceGroupName() { - return parent.resourceGroupName(); - } - - @Override - public ExpressRoutePeeringType peeringType() { - return innerModel().peeringType(); - } - - @Override - public ExpressRoutePeeringState state() { - return innerModel().state(); - } - - @Override - public int azureAsn() { - return ResourceManagerUtils.toPrimitiveInt(innerModel().azureAsn()); - } - - @Override - public long peerAsn() { - return ResourceManagerUtils.toPrimitiveLong(innerModel().peerAsn()); - } - - @Override - public String primaryPeerAddressPrefix() { - return innerModel().primaryPeerAddressPrefix(); - } - - @Override - public String secondaryPeerAddressPrefix() { - return innerModel().secondaryPeerAddressPrefix(); - } - - @Override - public String primaryAzurePort() { - return innerModel().primaryAzurePort(); - } - - @Override - public String secondaryAzurePort() { - return innerModel().secondaryAzurePort(); - } - - @Override - public String sharedKey() { - return innerModel().sharedKey(); - } - - @Override - public int vlanId() { - return ResourceManagerUtils.toPrimitiveInt(innerModel().vlanId()); - } - - @Override - public ExpressRouteCircuitPeeringConfig microsoftPeeringConfig() { - return innerModel().microsoftPeeringConfig(); - } - - @Override - public String provisioningState() { - return innerModel().provisioningState(); - } - - @Override - public String gatewayManagerEtag() { - return innerModel().gatewayManagerEtag(); - } - - @Override - public String lastModifiedBy() { - return innerModel().lastModifiedBy(); - } - - @Override - public Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig() { - return innerModel().ipv6PeeringConfig(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ExpressRouteCrossConnectionPeeringsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ExpressRouteCrossConnectionPeeringsClientImpl.java deleted file mode 100644 index 4acfab3edb22..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ExpressRouteCrossConnectionPeeringsClientImpl.java +++ /dev/null @@ -1,1178 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.ExpressRouteCrossConnectionPeeringsClient; -import com.azure.resourcemanager.network.fluent.models.ExpressRouteCrossConnectionPeeringInner; -import com.azure.resourcemanager.network.models.ExpressRouteCrossConnectionPeeringList; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in ExpressRouteCrossConnectionPeeringsClient. - */ -public final class ExpressRouteCrossConnectionPeeringsClientImpl implements ExpressRouteCrossConnectionPeeringsClient { - private final ClientLogger logger = new ClientLogger(ExpressRouteCrossConnectionPeeringsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final ExpressRouteCrossConnectionPeeringsService service; - - /** The service client containing this operation class. */ - private final NetworkManagementClientImpl client; - - /** - * Initializes an instance of ExpressRouteCrossConnectionPeeringsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ExpressRouteCrossConnectionPeeringsClientImpl(NetworkManagementClientImpl client) { - this.service = - RestProxy - .create( - ExpressRouteCrossConnectionPeeringsService.class, - client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for NetworkManagementClientExpressRouteCrossConnectionPeerings to be used - * by the proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "NetworkManagementCli") - private interface ExpressRouteCrossConnectionPeeringsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/expressRouteCrossConnections/{crossConnectionName}/peerings") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("crossConnectionName") String crossConnectionName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("crossConnectionName") String crossConnectionName, - @PathParam("peeringName") String peeringName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("crossConnectionName") String crossConnectionName, - @PathParam("peeringName") String peeringName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("crossConnectionName") String crossConnectionName, - @PathParam("peeringName") String peeringName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") ExpressRouteCrossConnectionPeeringInner peeringParameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets all peerings in a specified ExpressRouteCrossConnection. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all peerings in a specified ExpressRouteCrossConnection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String crossConnectionName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (crossConnectionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - resourceGroupName, - crossConnectionName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all peerings in a specified ExpressRouteCrossConnection. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all peerings in a specified ExpressRouteCrossConnection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String crossConnectionName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (crossConnectionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - resourceGroupName, - crossConnectionName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all peerings in a specified ExpressRouteCrossConnection. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all peerings in a specified ExpressRouteCrossConnection. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync( - String resourceGroupName, String crossConnectionName) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, crossConnectionName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets all peerings in a specified ExpressRouteCrossConnection. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all peerings in a specified ExpressRouteCrossConnection. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String crossConnectionName, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, crossConnectionName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all peerings in a specified ExpressRouteCrossConnection. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all peerings in a specified ExpressRouteCrossConnection. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, String crossConnectionName) { - return new PagedIterable<>(listAsync(resourceGroupName, crossConnectionName)); - } - - /** - * Gets all peerings in a specified ExpressRouteCrossConnection. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all peerings in a specified ExpressRouteCrossConnection. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, String crossConnectionName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, crossConnectionName, context)); - } - - /** - * Deletes the specified peering from the ExpressRouteCrossConnection. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync( - String resourceGroupName, String crossConnectionName, String peeringName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (crossConnectionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null.")); - } - if (peeringName == null) { - return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - crossConnectionName, - peeringName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the specified peering from the ExpressRouteCrossConnection. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String crossConnectionName, String peeringName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (crossConnectionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null.")); - } - if (peeringName == null) { - return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - crossConnectionName, - peeringName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Deletes the specified peering from the ExpressRouteCrossConnection. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String crossConnectionName, String peeringName) { - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, crossConnectionName, peeringName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deletes the specified peering from the ExpressRouteCrossConnection. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String crossConnectionName, String peeringName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, crossConnectionName, peeringName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes the specified peering from the ExpressRouteCrossConnection. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String crossConnectionName, String peeringName) { - return beginDeleteAsync(resourceGroupName, crossConnectionName, peeringName).getSyncPoller(); - } - - /** - * Deletes the specified peering from the ExpressRouteCrossConnection. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String crossConnectionName, String peeringName, Context context) { - return beginDeleteAsync(resourceGroupName, crossConnectionName, peeringName, context).getSyncPoller(); - } - - /** - * Deletes the specified peering from the ExpressRouteCrossConnection. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String crossConnectionName, String peeringName) { - return beginDeleteAsync(resourceGroupName, crossConnectionName, peeringName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified peering from the ExpressRouteCrossConnection. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync( - String resourceGroupName, String crossConnectionName, String peeringName, Context context) { - return beginDeleteAsync(resourceGroupName, crossConnectionName, peeringName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified peering from the ExpressRouteCrossConnection. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String crossConnectionName, String peeringName) { - deleteAsync(resourceGroupName, crossConnectionName, peeringName).block(); - } - - /** - * Deletes the specified peering from the ExpressRouteCrossConnection. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String crossConnectionName, String peeringName, Context context) { - deleteAsync(resourceGroupName, crossConnectionName, peeringName, context).block(); - } - - /** - * Gets the specified peering for the ExpressRouteCrossConnection. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified peering for the ExpressRouteCrossConnection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String resourceGroupName, String crossConnectionName, String peeringName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (crossConnectionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null.")); - } - if (peeringName == null) { - return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - resourceGroupName, - crossConnectionName, - peeringName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the specified peering for the ExpressRouteCrossConnection. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified peering for the ExpressRouteCrossConnection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String crossConnectionName, String peeringName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (crossConnectionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null.")); - } - if (peeringName == null) { - return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - resourceGroupName, - crossConnectionName, - peeringName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets the specified peering for the ExpressRouteCrossConnection. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified peering for the ExpressRouteCrossConnection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync( - String resourceGroupName, String crossConnectionName, String peeringName) { - return getWithResponseAsync(resourceGroupName, crossConnectionName, peeringName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the specified peering for the ExpressRouteCrossConnection. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified peering for the ExpressRouteCrossConnection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ExpressRouteCrossConnectionPeeringInner get( - String resourceGroupName, String crossConnectionName, String peeringName) { - return getAsync(resourceGroupName, crossConnectionName, peeringName).block(); - } - - /** - * Gets the specified peering for the ExpressRouteCrossConnection. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified peering for the ExpressRouteCrossConnection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String crossConnectionName, String peeringName, Context context) { - return getWithResponseAsync(resourceGroupName, crossConnectionName, peeringName, context).block(); - } - - /** - * Creates or updates a peering in the specified ExpressRouteCrossConnection. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @param peeringParameters Parameters supplied to the create or update ExpressRouteCrossConnection peering - * operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return peering in an ExpressRoute Cross Connection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String crossConnectionName, - String peeringName, - ExpressRouteCrossConnectionPeeringInner peeringParameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (crossConnectionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null.")); - } - if (peeringName == null) { - return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (peeringParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter peeringParameters is required and cannot be null.")); - } else { - peeringParameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - crossConnectionName, - peeringName, - apiVersion, - this.client.getSubscriptionId(), - peeringParameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a peering in the specified ExpressRouteCrossConnection. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @param peeringParameters Parameters supplied to the create or update ExpressRouteCrossConnection peering - * operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return peering in an ExpressRoute Cross Connection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String crossConnectionName, - String peeringName, - ExpressRouteCrossConnectionPeeringInner peeringParameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (crossConnectionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null.")); - } - if (peeringName == null) { - return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (peeringParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter peeringParameters is required and cannot be null.")); - } else { - peeringParameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - crossConnectionName, - peeringName, - apiVersion, - this.client.getSubscriptionId(), - peeringParameters, - accept, - context); - } - - /** - * Creates or updates a peering in the specified ExpressRouteCrossConnection. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @param peeringParameters Parameters supplied to the create or update ExpressRouteCrossConnection peering - * operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return peering in an ExpressRoute Cross Connection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, ExpressRouteCrossConnectionPeeringInner> - beginCreateOrUpdateAsync( - String resourceGroupName, - String crossConnectionName, - String peeringName, - ExpressRouteCrossConnectionPeeringInner peeringParameters) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, crossConnectionName, peeringName, peeringParameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ExpressRouteCrossConnectionPeeringInner.class, - ExpressRouteCrossConnectionPeeringInner.class, - Context.NONE); - } - - /** - * Creates or updates a peering in the specified ExpressRouteCrossConnection. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @param peeringParameters Parameters supplied to the create or update ExpressRouteCrossConnection peering - * operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return peering in an ExpressRoute Cross Connection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, ExpressRouteCrossConnectionPeeringInner> - beginCreateOrUpdateAsync( - String resourceGroupName, - String crossConnectionName, - String peeringName, - ExpressRouteCrossConnectionPeeringInner peeringParameters, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync( - resourceGroupName, crossConnectionName, peeringName, peeringParameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ExpressRouteCrossConnectionPeeringInner.class, - ExpressRouteCrossConnectionPeeringInner.class, - context); - } - - /** - * Creates or updates a peering in the specified ExpressRouteCrossConnection. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @param peeringParameters Parameters supplied to the create or update ExpressRouteCrossConnection peering - * operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return peering in an ExpressRoute Cross Connection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, ExpressRouteCrossConnectionPeeringInner> - beginCreateOrUpdate( - String resourceGroupName, - String crossConnectionName, - String peeringName, - ExpressRouteCrossConnectionPeeringInner peeringParameters) { - return beginCreateOrUpdateAsync(resourceGroupName, crossConnectionName, peeringName, peeringParameters) - .getSyncPoller(); - } - - /** - * Creates or updates a peering in the specified ExpressRouteCrossConnection. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @param peeringParameters Parameters supplied to the create or update ExpressRouteCrossConnection peering - * operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return peering in an ExpressRoute Cross Connection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, ExpressRouteCrossConnectionPeeringInner> - beginCreateOrUpdate( - String resourceGroupName, - String crossConnectionName, - String peeringName, - ExpressRouteCrossConnectionPeeringInner peeringParameters, - Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, crossConnectionName, peeringName, peeringParameters, context) - .getSyncPoller(); - } - - /** - * Creates or updates a peering in the specified ExpressRouteCrossConnection. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @param peeringParameters Parameters supplied to the create or update ExpressRouteCrossConnection peering - * operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return peering in an ExpressRoute Cross Connection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, - String crossConnectionName, - String peeringName, - ExpressRouteCrossConnectionPeeringInner peeringParameters) { - return beginCreateOrUpdateAsync(resourceGroupName, crossConnectionName, peeringName, peeringParameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a peering in the specified ExpressRouteCrossConnection. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @param peeringParameters Parameters supplied to the create or update ExpressRouteCrossConnection peering - * operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return peering in an ExpressRoute Cross Connection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, - String crossConnectionName, - String peeringName, - ExpressRouteCrossConnectionPeeringInner peeringParameters, - Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, crossConnectionName, peeringName, peeringParameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a peering in the specified ExpressRouteCrossConnection. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @param peeringParameters Parameters supplied to the create or update ExpressRouteCrossConnection peering - * operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return peering in an ExpressRoute Cross Connection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ExpressRouteCrossConnectionPeeringInner createOrUpdate( - String resourceGroupName, - String crossConnectionName, - String peeringName, - ExpressRouteCrossConnectionPeeringInner peeringParameters) { - return createOrUpdateAsync(resourceGroupName, crossConnectionName, peeringName, peeringParameters).block(); - } - - /** - * Creates or updates a peering in the specified ExpressRouteCrossConnection. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @param peeringParameters Parameters supplied to the create or update ExpressRouteCrossConnection peering - * operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return peering in an ExpressRoute Cross Connection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ExpressRouteCrossConnectionPeeringInner createOrUpdate( - String resourceGroupName, - String crossConnectionName, - String peeringName, - ExpressRouteCrossConnectionPeeringInner peeringParameters, - Context context) { - return createOrUpdateAsync(resourceGroupName, crossConnectionName, peeringName, peeringParameters, context) - .block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListPeering API service call retrieves all peerings that belong to an - * ExpressRouteCrossConnection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListPeering API service call retrieves all peerings that belong to an - * ExpressRouteCrossConnection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ExpressRouteCrossConnectionPeeringsImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ExpressRouteCrossConnectionPeeringsImpl.java deleted file mode 100644 index 03568f72f547..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ExpressRouteCrossConnectionPeeringsImpl.java +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.network.fluent.ExpressRouteCrossConnectionPeeringsClient; -import com.azure.resourcemanager.network.fluent.models.ExpressRouteCrossConnectionPeeringInner; -import com.azure.resourcemanager.network.models.ExpressRouteCrossConnection; -import com.azure.resourcemanager.network.models.ExpressRouteCrossConnectionPeering; -import com.azure.resourcemanager.network.models.ExpressRouteCrossConnectionPeerings; -import com.azure.resourcemanager.network.models.ExpressRoutePeeringType; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.IndependentChildrenImpl; -import reactor.core.publisher.Mono; - -/** Represents Express Route Cross Connection Peerings collection associated with Network Watcher. */ -class ExpressRouteCrossConnectionPeeringsImpl - extends IndependentChildrenImpl< - ExpressRouteCrossConnectionPeering, - ExpressRouteCrossConnectionPeeringImpl, - ExpressRouteCrossConnectionPeeringInner, - ExpressRouteCrossConnectionPeeringsClient, - NetworkManager, - ExpressRouteCrossConnection> - implements ExpressRouteCrossConnectionPeerings { - private final ExpressRouteCrossConnectionImpl parent; - - /** - * Creates a new ExpressRouteCrossConnectionPeeringsImpl. - * - * @param parent the Express Route Circuit associated with ExpressRouteCrossConnectionPeering - */ - ExpressRouteCrossConnectionPeeringsImpl(ExpressRouteCrossConnectionImpl parent) { - super(parent.manager().serviceClient().getExpressRouteCrossConnectionPeerings(), parent.manager()); - this.parent = parent; - } - - @Override - public final PagedIterable list() { - return wrapList(innerModel().list(parent.resourceGroupName(), parent.name())); - } - - /** @return an observable emits packet captures in this collection */ - @Override - public PagedFlux listAsync() { - return wrapPageAsync(innerModel().listAsync(parent.resourceGroupName(), parent.name())); - } - - @Override - protected ExpressRouteCrossConnectionPeeringImpl wrapModel(String name) { - return new ExpressRouteCrossConnectionPeeringImpl( - parent, new ExpressRouteCrossConnectionPeeringInner(), ExpressRoutePeeringType.fromString(name)); - } - - protected ExpressRouteCrossConnectionPeeringImpl wrapModel(ExpressRouteCrossConnectionPeeringInner inner) { - return (inner == null) ? null : new ExpressRouteCrossConnectionPeeringImpl(parent, inner, inner.peeringType()); - } - - @Override - public ExpressRouteCrossConnectionPeeringImpl defineAzurePrivatePeering() { - return new ExpressRouteCrossConnectionPeeringImpl( - parent, new ExpressRouteCrossConnectionPeeringInner(), ExpressRoutePeeringType.AZURE_PRIVATE_PEERING); - } - - @Override - public ExpressRouteCrossConnectionPeeringImpl defineMicrosoftPeering() { - return new ExpressRouteCrossConnectionPeeringImpl( - parent, new ExpressRouteCrossConnectionPeeringInner(), ExpressRoutePeeringType.MICROSOFT_PEERING); - } - - @Override - public Mono getByNameAsync(String name) { - return innerModel().getAsync(parent.resourceGroupName(), parent.name(), name).map(inner -> wrapModel(inner)); - } - - @Override - public ExpressRouteCrossConnectionPeering getByName(String name) { - return getByNameAsync(name).block(); - } - - @Override - public void deleteByName(String name) { - deleteByNameAsync(name).block(); - } - - @Override - public Mono deleteByNameAsync(String name) { - return deleteByParentAsync(parent.resourceGroupName(), parent.name(), name); - } - - @Override - public ExpressRouteCrossConnection parent() { - return parent; - } - - @Override - public Mono deleteByParentAsync(String groupName, String parentName, String name) { - return this - .innerModel() - .deleteAsync(groupName, parentName, name) - .doOnSuccess( - result -> { - parent.refresh(); - }) - .then(); - } - - @Override - public Mono getByParentAsync( - String resourceGroup, String parentName, String name) { - return innerModel().getAsync(resourceGroup, parentName, name).map(inner -> wrapModel(inner)); - } - - @Override - public PagedIterable listByParent(String resourceGroupName, String parentName) { - return wrapList(this.innerModel().list(resourceGroupName, parentName)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ExpressRouteCrossConnectionsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ExpressRouteCrossConnectionsClientImpl.java deleted file mode 100644 index 918fc6b75a4e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ExpressRouteCrossConnectionsClientImpl.java +++ /dev/null @@ -1,2370 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.ExpressRouteCrossConnectionsClient; -import com.azure.resourcemanager.network.fluent.models.ExpressRouteCircuitsArpTableListResultInner; -import com.azure.resourcemanager.network.fluent.models.ExpressRouteCircuitsRoutesTableListResultInner; -import com.azure.resourcemanager.network.fluent.models.ExpressRouteCrossConnectionInner; -import com.azure.resourcemanager.network.fluent.models.ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner; -import com.azure.resourcemanager.network.models.ExpressRouteCrossConnectionListResult; -import com.azure.resourcemanager.network.models.TagsObject; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ExpressRouteCrossConnectionsClient. */ -public final class ExpressRouteCrossConnectionsClientImpl - implements InnerSupportsGet, - InnerSupportsListing, - ExpressRouteCrossConnectionsClient { - private final ClientLogger logger = new ClientLogger(ExpressRouteCrossConnectionsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final ExpressRouteCrossConnectionsService service; - - /** The service client containing this operation class. */ - private final NetworkManagementClientImpl client; - - /** - * Initializes an instance of ExpressRouteCrossConnectionsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ExpressRouteCrossConnectionsClientImpl(NetworkManagementClientImpl client) { - this.service = - RestProxy - .create( - ExpressRouteCrossConnectionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for NetworkManagementClientExpressRouteCrossConnections to be used by the - * proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "NetworkManagementCli") - private interface ExpressRouteCrossConnectionsService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteCrossConnections") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/expressRouteCrossConnections") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/expressRouteCrossConnections/{crossConnectionName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("crossConnectionName") String crossConnectionName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/expressRouteCrossConnections/{crossConnectionName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("crossConnectionName") String crossConnectionName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") ExpressRouteCrossConnectionInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/expressRouteCrossConnections/{crossConnectionName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> updateTags( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("crossConnectionName") String crossConnectionName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") TagsObject crossConnectionParameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/arpTables/{devicePath}") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> listArpTable( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("crossConnectionName") String crossConnectionName, - @PathParam("peeringName") String peeringName, - @PathParam("devicePath") String devicePath, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/routeTablesSummary" - + "/{devicePath}") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> listRoutesTableSummary( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("crossConnectionName") String crossConnectionName, - @PathParam("peeringName") String peeringName, - @PathParam("devicePath") String devicePath, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/routeTables/{devicePath}") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> listRoutesTable( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("crossConnectionName") String crossConnectionName, - @PathParam("peeringName") String peeringName, - @PathParam("devicePath") String devicePath, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Retrieves all the ExpressRouteCrossConnections in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListExpressRouteCrossConnection API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Retrieves all the ExpressRouteCrossConnections in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListExpressRouteCrossConnection API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Retrieves all the ExpressRouteCrossConnections in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListExpressRouteCrossConnection API service call. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Retrieves all the ExpressRouteCrossConnections in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListExpressRouteCrossConnection API service call. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Retrieves all the ExpressRouteCrossConnections in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListExpressRouteCrossConnection API service call. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Retrieves all the ExpressRouteCrossConnections in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListExpressRouteCrossConnection API service call. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Retrieves all the ExpressRouteCrossConnections in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListExpressRouteCrossConnection API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Retrieves all the ExpressRouteCrossConnections in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListExpressRouteCrossConnection API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Retrieves all the ExpressRouteCrossConnections in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListExpressRouteCrossConnection API service call. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * Retrieves all the ExpressRouteCrossConnections in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListExpressRouteCrossConnection API service call. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync( - String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * Retrieves all the ExpressRouteCrossConnections in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListExpressRouteCrossConnection API service call. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * Retrieves all the ExpressRouteCrossConnections in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListExpressRouteCrossConnection API service call. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup( - String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * Gets details about the specified ExpressRouteCrossConnection. - * - * @param resourceGroupName The name of the resource group (peering location of the circuit). - * @param crossConnectionName The name of the ExpressRouteCrossConnection (service key of the circuit). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return details about the specified ExpressRouteCrossConnection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String crossConnectionName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (crossConnectionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - crossConnectionName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets details about the specified ExpressRouteCrossConnection. - * - * @param resourceGroupName The name of the resource group (peering location of the circuit). - * @param crossConnectionName The name of the ExpressRouteCrossConnection (service key of the circuit). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return details about the specified ExpressRouteCrossConnection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String crossConnectionName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (crossConnectionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - crossConnectionName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets details about the specified ExpressRouteCrossConnection. - * - * @param resourceGroupName The name of the resource group (peering location of the circuit). - * @param crossConnectionName The name of the ExpressRouteCrossConnection (service key of the circuit). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return details about the specified ExpressRouteCrossConnection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync( - String resourceGroupName, String crossConnectionName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, crossConnectionName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets details about the specified ExpressRouteCrossConnection. - * - * @param resourceGroupName The name of the resource group (peering location of the circuit). - * @param crossConnectionName The name of the ExpressRouteCrossConnection (service key of the circuit). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return details about the specified ExpressRouteCrossConnection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ExpressRouteCrossConnectionInner getByResourceGroup(String resourceGroupName, String crossConnectionName) { - return getByResourceGroupAsync(resourceGroupName, crossConnectionName).block(); - } - - /** - * Gets details about the specified ExpressRouteCrossConnection. - * - * @param resourceGroupName The name of the resource group (peering location of the circuit). - * @param crossConnectionName The name of the ExpressRouteCrossConnection (service key of the circuit). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return details about the specified ExpressRouteCrossConnection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String crossConnectionName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, crossConnectionName, context).block(); - } - - /** - * Update the specified ExpressRouteCrossConnection. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param parameters Parameters supplied to the update express route crossConnection operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteCrossConnection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String crossConnectionName, ExpressRouteCrossConnectionInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (crossConnectionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - crossConnectionName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Update the specified ExpressRouteCrossConnection. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param parameters Parameters supplied to the update express route crossConnection operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteCrossConnection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String crossConnectionName, - ExpressRouteCrossConnectionInner parameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (crossConnectionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - crossConnectionName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Update the specified ExpressRouteCrossConnection. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param parameters Parameters supplied to the update express route crossConnection operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteCrossConnection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, ExpressRouteCrossConnectionInner> - beginCreateOrUpdateAsync( - String resourceGroupName, String crossConnectionName, ExpressRouteCrossConnectionInner parameters) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, crossConnectionName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ExpressRouteCrossConnectionInner.class, - ExpressRouteCrossConnectionInner.class, - Context.NONE); - } - - /** - * Update the specified ExpressRouteCrossConnection. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param parameters Parameters supplied to the update express route crossConnection operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteCrossConnection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, ExpressRouteCrossConnectionInner> - beginCreateOrUpdateAsync( - String resourceGroupName, - String crossConnectionName, - ExpressRouteCrossConnectionInner parameters, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, crossConnectionName, parameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ExpressRouteCrossConnectionInner.class, - ExpressRouteCrossConnectionInner.class, - context); - } - - /** - * Update the specified ExpressRouteCrossConnection. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param parameters Parameters supplied to the update express route crossConnection operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteCrossConnection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, ExpressRouteCrossConnectionInner> - beginCreateOrUpdate( - String resourceGroupName, String crossConnectionName, ExpressRouteCrossConnectionInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, crossConnectionName, parameters).getSyncPoller(); - } - - /** - * Update the specified ExpressRouteCrossConnection. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param parameters Parameters supplied to the update express route crossConnection operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteCrossConnection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, ExpressRouteCrossConnectionInner> - beginCreateOrUpdate( - String resourceGroupName, - String crossConnectionName, - ExpressRouteCrossConnectionInner parameters, - Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, crossConnectionName, parameters, context).getSyncPoller(); - } - - /** - * Update the specified ExpressRouteCrossConnection. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param parameters Parameters supplied to the update express route crossConnection operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteCrossConnection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, String crossConnectionName, ExpressRouteCrossConnectionInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, crossConnectionName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Update the specified ExpressRouteCrossConnection. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param parameters Parameters supplied to the update express route crossConnection operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteCrossConnection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, - String crossConnectionName, - ExpressRouteCrossConnectionInner parameters, - Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, crossConnectionName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Update the specified ExpressRouteCrossConnection. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param parameters Parameters supplied to the update express route crossConnection operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteCrossConnection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ExpressRouteCrossConnectionInner createOrUpdate( - String resourceGroupName, String crossConnectionName, ExpressRouteCrossConnectionInner parameters) { - return createOrUpdateAsync(resourceGroupName, crossConnectionName, parameters).block(); - } - - /** - * Update the specified ExpressRouteCrossConnection. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param parameters Parameters supplied to the update express route crossConnection operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteCrossConnection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ExpressRouteCrossConnectionInner createOrUpdate( - String resourceGroupName, - String crossConnectionName, - ExpressRouteCrossConnectionInner parameters, - Context context) { - return createOrUpdateAsync(resourceGroupName, crossConnectionName, parameters, context).block(); - } - - /** - * Updates an express route cross connection tags. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the cross connection. - * @param crossConnectionParameters Parameters supplied to update express route cross connection tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteCrossConnection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateTagsWithResponseAsync( - String resourceGroupName, String crossConnectionName, TagsObject crossConnectionParameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (crossConnectionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (crossConnectionParameters == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter crossConnectionParameters is required and cannot be null.")); - } else { - crossConnectionParameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updateTags( - this.client.getEndpoint(), - resourceGroupName, - crossConnectionName, - apiVersion, - this.client.getSubscriptionId(), - crossConnectionParameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates an express route cross connection tags. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the cross connection. - * @param crossConnectionParameters Parameters supplied to update express route cross connection tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteCrossConnection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateTagsWithResponseAsync( - String resourceGroupName, String crossConnectionName, TagsObject crossConnectionParameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (crossConnectionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (crossConnectionParameters == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter crossConnectionParameters is required and cannot be null.")); - } else { - crossConnectionParameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updateTags( - this.client.getEndpoint(), - resourceGroupName, - crossConnectionName, - apiVersion, - this.client.getSubscriptionId(), - crossConnectionParameters, - accept, - context); - } - - /** - * Updates an express route cross connection tags. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the cross connection. - * @param crossConnectionParameters Parameters supplied to update express route cross connection tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteCrossConnection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, ExpressRouteCrossConnectionInner> - beginUpdateTagsAsync( - String resourceGroupName, String crossConnectionName, TagsObject crossConnectionParameters) { - Mono>> mono = - updateTagsWithResponseAsync(resourceGroupName, crossConnectionName, crossConnectionParameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ExpressRouteCrossConnectionInner.class, - ExpressRouteCrossConnectionInner.class, - Context.NONE); - } - - /** - * Updates an express route cross connection tags. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the cross connection. - * @param crossConnectionParameters Parameters supplied to update express route cross connection tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteCrossConnection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, ExpressRouteCrossConnectionInner> - beginUpdateTagsAsync( - String resourceGroupName, - String crossConnectionName, - TagsObject crossConnectionParameters, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - updateTagsWithResponseAsync(resourceGroupName, crossConnectionName, crossConnectionParameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ExpressRouteCrossConnectionInner.class, - ExpressRouteCrossConnectionInner.class, - context); - } - - /** - * Updates an express route cross connection tags. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the cross connection. - * @param crossConnectionParameters Parameters supplied to update express route cross connection tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteCrossConnection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, ExpressRouteCrossConnectionInner> beginUpdateTags( - String resourceGroupName, String crossConnectionName, TagsObject crossConnectionParameters) { - return beginUpdateTagsAsync(resourceGroupName, crossConnectionName, crossConnectionParameters).getSyncPoller(); - } - - /** - * Updates an express route cross connection tags. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the cross connection. - * @param crossConnectionParameters Parameters supplied to update express route cross connection tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteCrossConnection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, ExpressRouteCrossConnectionInner> beginUpdateTags( - String resourceGroupName, String crossConnectionName, TagsObject crossConnectionParameters, Context context) { - return beginUpdateTagsAsync(resourceGroupName, crossConnectionName, crossConnectionParameters, context) - .getSyncPoller(); - } - - /** - * Updates an express route cross connection tags. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the cross connection. - * @param crossConnectionParameters Parameters supplied to update express route cross connection tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteCrossConnection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateTagsAsync( - String resourceGroupName, String crossConnectionName, TagsObject crossConnectionParameters) { - return beginUpdateTagsAsync(resourceGroupName, crossConnectionName, crossConnectionParameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates an express route cross connection tags. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the cross connection. - * @param crossConnectionParameters Parameters supplied to update express route cross connection tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteCrossConnection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateTagsAsync( - String resourceGroupName, String crossConnectionName, TagsObject crossConnectionParameters, Context context) { - return beginUpdateTagsAsync(resourceGroupName, crossConnectionName, crossConnectionParameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates an express route cross connection tags. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the cross connection. - * @param crossConnectionParameters Parameters supplied to update express route cross connection tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteCrossConnection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ExpressRouteCrossConnectionInner updateTags( - String resourceGroupName, String crossConnectionName, TagsObject crossConnectionParameters) { - return updateTagsAsync(resourceGroupName, crossConnectionName, crossConnectionParameters).block(); - } - - /** - * Updates an express route cross connection tags. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the cross connection. - * @param crossConnectionParameters Parameters supplied to update express route cross connection tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteCrossConnection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ExpressRouteCrossConnectionInner updateTags( - String resourceGroupName, String crossConnectionName, TagsObject crossConnectionParameters, Context context) { - return updateTagsAsync(resourceGroupName, crossConnectionName, crossConnectionParameters, context).block(); - } - - /** - * Gets the currently advertised ARP table associated with the express route cross connection in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised ARP table associated with the express route cross connection in a resource - * group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> listArpTableWithResponseAsync( - String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (crossConnectionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null.")); - } - if (peeringName == null) { - return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); - } - if (devicePath == null) { - return Mono.error(new IllegalArgumentException("Parameter devicePath is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listArpTable( - this.client.getEndpoint(), - resourceGroupName, - crossConnectionName, - peeringName, - devicePath, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the currently advertised ARP table associated with the express route cross connection in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised ARP table associated with the express route cross connection in a resource - * group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> listArpTableWithResponseAsync( - String resourceGroupName, String crossConnectionName, String peeringName, String devicePath, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (crossConnectionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null.")); - } - if (peeringName == null) { - return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); - } - if (devicePath == null) { - return Mono.error(new IllegalArgumentException("Parameter devicePath is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listArpTable( - this.client.getEndpoint(), - resourceGroupName, - crossConnectionName, - peeringName, - devicePath, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets the currently advertised ARP table associated with the express route cross connection in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised ARP table associated with the express route cross connection in a resource - * group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux< - PollResult, ExpressRouteCircuitsArpTableListResultInner> - beginListArpTableAsync( - String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { - Mono>> mono = - listArpTableWithResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ExpressRouteCircuitsArpTableListResultInner.class, - ExpressRouteCircuitsArpTableListResultInner.class, - Context.NONE); - } - - /** - * Gets the currently advertised ARP table associated with the express route cross connection in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised ARP table associated with the express route cross connection in a resource - * group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux< - PollResult, ExpressRouteCircuitsArpTableListResultInner> - beginListArpTableAsync( - String resourceGroupName, - String crossConnectionName, - String peeringName, - String devicePath, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - listArpTableWithResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ExpressRouteCircuitsArpTableListResultInner.class, - ExpressRouteCircuitsArpTableListResultInner.class, - context); - } - - /** - * Gets the currently advertised ARP table associated with the express route cross connection in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised ARP table associated with the express route cross connection in a resource - * group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller< - PollResult, ExpressRouteCircuitsArpTableListResultInner> - beginListArpTable(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { - return beginListArpTableAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).getSyncPoller(); - } - - /** - * Gets the currently advertised ARP table associated with the express route cross connection in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised ARP table associated with the express route cross connection in a resource - * group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller< - PollResult, ExpressRouteCircuitsArpTableListResultInner> - beginListArpTable( - String resourceGroupName, - String crossConnectionName, - String peeringName, - String devicePath, - Context context) { - return beginListArpTableAsync(resourceGroupName, crossConnectionName, peeringName, devicePath, context) - .getSyncPoller(); - } - - /** - * Gets the currently advertised ARP table associated with the express route cross connection in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised ARP table associated with the express route cross connection in a resource - * group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listArpTableAsync( - String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { - return beginListArpTableAsync(resourceGroupName, crossConnectionName, peeringName, devicePath) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Gets the currently advertised ARP table associated with the express route cross connection in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised ARP table associated with the express route cross connection in a resource - * group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listArpTableAsync( - String resourceGroupName, String crossConnectionName, String peeringName, String devicePath, Context context) { - return beginListArpTableAsync(resourceGroupName, crossConnectionName, peeringName, devicePath, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Gets the currently advertised ARP table associated with the express route cross connection in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised ARP table associated with the express route cross connection in a resource - * group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ExpressRouteCircuitsArpTableListResultInner listArpTable( - String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { - return listArpTableAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).block(); - } - - /** - * Gets the currently advertised ARP table associated with the express route cross connection in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised ARP table associated with the express route cross connection in a resource - * group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ExpressRouteCircuitsArpTableListResultInner listArpTable( - String resourceGroupName, String crossConnectionName, String peeringName, String devicePath, Context context) { - return listArpTableAsync(resourceGroupName, crossConnectionName, peeringName, devicePath, context).block(); - } - - /** - * Gets the route table summary associated with the express route cross connection in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the route table summary associated with the express route cross connection in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> listRoutesTableSummaryWithResponseAsync( - String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (crossConnectionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null.")); - } - if (peeringName == null) { - return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); - } - if (devicePath == null) { - return Mono.error(new IllegalArgumentException("Parameter devicePath is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listRoutesTableSummary( - this.client.getEndpoint(), - resourceGroupName, - crossConnectionName, - peeringName, - devicePath, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the route table summary associated with the express route cross connection in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the route table summary associated with the express route cross connection in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> listRoutesTableSummaryWithResponseAsync( - String resourceGroupName, String crossConnectionName, String peeringName, String devicePath, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (crossConnectionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null.")); - } - if (peeringName == null) { - return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); - } - if (devicePath == null) { - return Mono.error(new IllegalArgumentException("Parameter devicePath is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listRoutesTableSummary( - this.client.getEndpoint(), - resourceGroupName, - crossConnectionName, - peeringName, - devicePath, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets the route table summary associated with the express route cross connection in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the route table summary associated with the express route cross connection in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux< - PollResult, - ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner> - beginListRoutesTableSummaryAsync( - String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { - Mono>> mono = - listRoutesTableSummaryWithResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath); - return this - .client - . - getLroResult( - mono, - this.client.getHttpPipeline(), - ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner.class, - ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner.class, - Context.NONE); - } - - /** - * Gets the route table summary associated with the express route cross connection in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the route table summary associated with the express route cross connection in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux< - PollResult, - ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner> - beginListRoutesTableSummaryAsync( - String resourceGroupName, - String crossConnectionName, - String peeringName, - String devicePath, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - listRoutesTableSummaryWithResponseAsync( - resourceGroupName, crossConnectionName, peeringName, devicePath, context); - return this - .client - . - getLroResult( - mono, - this.client.getHttpPipeline(), - ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner.class, - ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner.class, - context); - } - - /** - * Gets the route table summary associated with the express route cross connection in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the route table summary associated with the express route cross connection in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller< - PollResult, - ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner> - beginListRoutesTableSummary( - String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { - return beginListRoutesTableSummaryAsync(resourceGroupName, crossConnectionName, peeringName, devicePath) - .getSyncPoller(); - } - - /** - * Gets the route table summary associated with the express route cross connection in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the route table summary associated with the express route cross connection in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller< - PollResult, - ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner> - beginListRoutesTableSummary( - String resourceGroupName, - String crossConnectionName, - String peeringName, - String devicePath, - Context context) { - return beginListRoutesTableSummaryAsync( - resourceGroupName, crossConnectionName, peeringName, devicePath, context) - .getSyncPoller(); - } - - /** - * Gets the route table summary associated with the express route cross connection in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the route table summary associated with the express route cross connection in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listRoutesTableSummaryAsync( - String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { - return beginListRoutesTableSummaryAsync(resourceGroupName, crossConnectionName, peeringName, devicePath) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Gets the route table summary associated with the express route cross connection in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the route table summary associated with the express route cross connection in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listRoutesTableSummaryAsync( - String resourceGroupName, String crossConnectionName, String peeringName, String devicePath, Context context) { - return beginListRoutesTableSummaryAsync( - resourceGroupName, crossConnectionName, peeringName, devicePath, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Gets the route table summary associated with the express route cross connection in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the route table summary associated with the express route cross connection in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner listRoutesTableSummary( - String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { - return listRoutesTableSummaryAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).block(); - } - - /** - * Gets the route table summary associated with the express route cross connection in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the route table summary associated with the express route cross connection in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner listRoutesTableSummary( - String resourceGroupName, String crossConnectionName, String peeringName, String devicePath, Context context) { - return listRoutesTableSummaryAsync(resourceGroupName, crossConnectionName, peeringName, devicePath, context) - .block(); - } - - /** - * Gets the currently advertised routes table associated with the express route cross connection in a resource - * group. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised routes table associated with the express route cross connection in a resource - * group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> listRoutesTableWithResponseAsync( - String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (crossConnectionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null.")); - } - if (peeringName == null) { - return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); - } - if (devicePath == null) { - return Mono.error(new IllegalArgumentException("Parameter devicePath is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listRoutesTable( - this.client.getEndpoint(), - resourceGroupName, - crossConnectionName, - peeringName, - devicePath, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the currently advertised routes table associated with the express route cross connection in a resource - * group. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised routes table associated with the express route cross connection in a resource - * group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> listRoutesTableWithResponseAsync( - String resourceGroupName, String crossConnectionName, String peeringName, String devicePath, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (crossConnectionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null.")); - } - if (peeringName == null) { - return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); - } - if (devicePath == null) { - return Mono.error(new IllegalArgumentException("Parameter devicePath is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listRoutesTable( - this.client.getEndpoint(), - resourceGroupName, - crossConnectionName, - peeringName, - devicePath, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets the currently advertised routes table associated with the express route cross connection in a resource - * group. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised routes table associated with the express route cross connection in a resource - * group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux< - PollResult, ExpressRouteCircuitsRoutesTableListResultInner> - beginListRoutesTableAsync( - String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { - Mono>> mono = - listRoutesTableWithResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath); - return this - .client - . - getLroResult( - mono, - this.client.getHttpPipeline(), - ExpressRouteCircuitsRoutesTableListResultInner.class, - ExpressRouteCircuitsRoutesTableListResultInner.class, - Context.NONE); - } - - /** - * Gets the currently advertised routes table associated with the express route cross connection in a resource - * group. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised routes table associated with the express route cross connection in a resource - * group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux< - PollResult, ExpressRouteCircuitsRoutesTableListResultInner> - beginListRoutesTableAsync( - String resourceGroupName, - String crossConnectionName, - String peeringName, - String devicePath, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - listRoutesTableWithResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath, context); - return this - .client - . - getLroResult( - mono, - this.client.getHttpPipeline(), - ExpressRouteCircuitsRoutesTableListResultInner.class, - ExpressRouteCircuitsRoutesTableListResultInner.class, - context); - } - - /** - * Gets the currently advertised routes table associated with the express route cross connection in a resource - * group. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised routes table associated with the express route cross connection in a resource - * group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller< - PollResult, ExpressRouteCircuitsRoutesTableListResultInner> - beginListRoutesTable( - String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { - return beginListRoutesTableAsync(resourceGroupName, crossConnectionName, peeringName, devicePath) - .getSyncPoller(); - } - - /** - * Gets the currently advertised routes table associated with the express route cross connection in a resource - * group. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised routes table associated with the express route cross connection in a resource - * group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller< - PollResult, ExpressRouteCircuitsRoutesTableListResultInner> - beginListRoutesTable( - String resourceGroupName, - String crossConnectionName, - String peeringName, - String devicePath, - Context context) { - return beginListRoutesTableAsync(resourceGroupName, crossConnectionName, peeringName, devicePath, context) - .getSyncPoller(); - } - - /** - * Gets the currently advertised routes table associated with the express route cross connection in a resource - * group. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised routes table associated with the express route cross connection in a resource - * group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listRoutesTableAsync( - String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { - return beginListRoutesTableAsync(resourceGroupName, crossConnectionName, peeringName, devicePath) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Gets the currently advertised routes table associated with the express route cross connection in a resource - * group. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised routes table associated with the express route cross connection in a resource - * group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listRoutesTableAsync( - String resourceGroupName, String crossConnectionName, String peeringName, String devicePath, Context context) { - return beginListRoutesTableAsync(resourceGroupName, crossConnectionName, peeringName, devicePath, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Gets the currently advertised routes table associated with the express route cross connection in a resource - * group. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised routes table associated with the express route cross connection in a resource - * group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ExpressRouteCircuitsRoutesTableListResultInner listRoutesTable( - String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { - return listRoutesTableAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).block(); - } - - /** - * Gets the currently advertised routes table associated with the express route cross connection in a resource - * group. - * - * @param resourceGroupName The name of the resource group. - * @param crossConnectionName The name of the ExpressRouteCrossConnection. - * @param peeringName The name of the peering. - * @param devicePath The path of the device. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently advertised routes table associated with the express route cross connection in a resource - * group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ExpressRouteCircuitsRoutesTableListResultInner listRoutesTable( - String resourceGroupName, String crossConnectionName, String peeringName, String devicePath, Context context) { - return listRoutesTableAsync(resourceGroupName, crossConnectionName, peeringName, devicePath, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListExpressRouteCrossConnection API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListExpressRouteCrossConnection API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListExpressRouteCrossConnection API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync( - String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListExpressRouteCrossConnection API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ExpressRouteCrossConnectionsImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ExpressRouteCrossConnectionsImpl.java deleted file mode 100644 index 97869d96462c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ExpressRouteCrossConnectionsImpl.java +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.CoreUtils; -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.network.fluent.ExpressRouteCrossConnectionsClient; -import com.azure.resourcemanager.network.fluent.models.ExpressRouteCrossConnectionInner; -import com.azure.resourcemanager.network.models.ExpressRouteCrossConnection; -import com.azure.resourcemanager.network.models.ExpressRouteCrossConnections; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceId; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.ReadableWrappersImpl; -import reactor.core.publisher.Mono; - -public class ExpressRouteCrossConnectionsImpl - extends ReadableWrappersImpl< - ExpressRouteCrossConnection, ExpressRouteCrossConnectionImpl, ExpressRouteCrossConnectionInner> - implements ExpressRouteCrossConnections { - private final NetworkManager manager; - - public ExpressRouteCrossConnectionsImpl(NetworkManager manager) { - this.manager = manager; - } - - @Override - protected ExpressRouteCrossConnectionImpl wrapModel(ExpressRouteCrossConnectionInner inner) { - if (inner == null) { - return null; - } - return new ExpressRouteCrossConnectionImpl(inner.name(), inner, this.manager()); - } - - @Override - public ExpressRouteCrossConnection getById(String id) { - return getByIdAsync(id).block(); - } - - @Override - public Mono getByIdAsync(String id) { - ResourceId resourceId = ResourceId.fromString(id); - return getByResourceGroupAsync(resourceId.resourceGroupName(), resourceId.name()); - } - - @Override - public ExpressRouteCrossConnection getByResourceGroup(String resourceGroupName, String name) { - return getByResourceGroupAsync(resourceGroupName, name).block(); - } - - @Override - public Mono getByResourceGroupAsync(String resourceGroupName, String name) { - if (CoreUtils.isNullOrEmpty(resourceGroupName)) { - return Mono.error( - new IllegalArgumentException("Parameter 'resourceGroupName' is required and cannot be null.")); - } - if (CoreUtils.isNullOrEmpty(name)) { - return Mono.error( - new IllegalArgumentException("Parameter 'name' is required and cannot be null.")); - } - return this.inner().getByResourceGroupAsync(resourceGroupName, name).map(inner -> wrapModel(inner)); - } - - @Override - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(this.listByResourceGroupAsync(resourceGroupName)); - } - - @Override - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - if (CoreUtils.isNullOrEmpty(resourceGroupName)) { - return new PagedFlux<>(() -> Mono.error( - new IllegalArgumentException("Parameter 'resourceGroupName' is required and cannot be null."))); - } - return wrapPageAsync(this.inner().listByResourceGroupAsync(resourceGroupName)); - } - - @Override - public NetworkManager manager() { - return manager; - } - - @Override - public PagedIterable list() { - return wrapList(inner().list()); - } - - @Override - public PagedFlux listAsync() { - return wrapPageAsync(inner().listAsync()); - } - - public ExpressRouteCrossConnectionsClient inner() { - return manager.serviceClient().getExpressRouteCrossConnections(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ExpressRouteGatewaysClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ExpressRouteGatewaysClientImpl.java deleted file mode 100644 index c359e7dc2d3b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ExpressRouteGatewaysClientImpl.java +++ /dev/null @@ -1,1103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.ExpressRouteGatewaysClient; -import com.azure.resourcemanager.network.fluent.models.ExpressRouteGatewayInner; -import com.azure.resourcemanager.network.fluent.models.ExpressRouteGatewayListInner; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ExpressRouteGatewaysClient. */ -public final class ExpressRouteGatewaysClientImpl - implements InnerSupportsGet, InnerSupportsDelete, ExpressRouteGatewaysClient { - private final ClientLogger logger = new ClientLogger(ExpressRouteGatewaysClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final ExpressRouteGatewaysService service; - - /** The service client containing this operation class. */ - private final NetworkManagementClientImpl client; - - /** - * Initializes an instance of ExpressRouteGatewaysClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ExpressRouteGatewaysClientImpl(NetworkManagementClientImpl client) { - this.service = - RestProxy - .create(ExpressRouteGatewaysService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for NetworkManagementClientExpressRouteGateways to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "NetworkManagementCli") - private interface ExpressRouteGatewaysService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteGateways") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySubscription( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/expressRouteGateways") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/expressRouteGateways/{expressRouteGatewayName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("expressRouteGatewayName") String expressRouteGatewayName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") ExpressRouteGatewayInner putExpressRouteGatewayParameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/expressRouteGateways/{expressRouteGatewayName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("expressRouteGatewayName") String expressRouteGatewayName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/expressRouteGateways/{expressRouteGatewayName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("expressRouteGatewayName") String expressRouteGatewayName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - } - - /** - * Lists ExpressRoute gateways under a given subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ExpressRoute gateways. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listBySubscriptionWithResponseAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listBySubscription( - this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists ExpressRoute gateways under a given subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ExpressRoute gateways. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionWithResponseAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listBySubscription( - this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context); - } - - /** - * Lists ExpressRoute gateways under a given subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ExpressRoute gateways. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listBySubscriptionAsync() { - return listBySubscriptionWithResponseAsync() - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Lists ExpressRoute gateways under a given subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ExpressRoute gateways. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ExpressRouteGatewayListInner listBySubscription() { - return listBySubscriptionAsync().block(); - } - - /** - * Lists ExpressRoute gateways under a given subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ExpressRoute gateways. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listBySubscriptionWithResponse(Context context) { - return listBySubscriptionWithResponseAsync(context).block(); - } - - /** - * Lists ExpressRoute gateways in a given resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ExpressRoute gateways. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listByResourceGroupWithResponseAsync(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists ExpressRoute gateways in a given resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ExpressRoute gateways. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupWithResponseAsync( - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Lists ExpressRoute gateways in a given resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ExpressRoute gateways. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listByResourceGroupAsync(String resourceGroupName) { - return listByResourceGroupWithResponseAsync(resourceGroupName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Lists ExpressRoute gateways in a given resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ExpressRoute gateways. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ExpressRouteGatewayListInner listByResourceGroup(String resourceGroupName) { - return listByResourceGroupAsync(resourceGroupName).block(); - } - - /** - * Lists ExpressRoute gateways in a given resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ExpressRoute gateways. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listByResourceGroupWithResponse( - String resourceGroupName, Context context) { - return listByResourceGroupWithResponseAsync(resourceGroupName, context).block(); - } - - /** - * Creates or updates a ExpressRoute gateway in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @param putExpressRouteGatewayParameters Parameters required in an ExpressRoute gateway PUT operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute gateway resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String expressRouteGatewayName, - ExpressRouteGatewayInner putExpressRouteGatewayParameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (expressRouteGatewayName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter expressRouteGatewayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (putExpressRouteGatewayParameters == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter putExpressRouteGatewayParameters is required and cannot be null.")); - } else { - putExpressRouteGatewayParameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - expressRouteGatewayName, - apiVersion, - this.client.getSubscriptionId(), - putExpressRouteGatewayParameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a ExpressRoute gateway in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @param putExpressRouteGatewayParameters Parameters required in an ExpressRoute gateway PUT operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute gateway resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String expressRouteGatewayName, - ExpressRouteGatewayInner putExpressRouteGatewayParameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (expressRouteGatewayName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter expressRouteGatewayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (putExpressRouteGatewayParameters == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter putExpressRouteGatewayParameters is required and cannot be null.")); - } else { - putExpressRouteGatewayParameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - expressRouteGatewayName, - apiVersion, - this.client.getSubscriptionId(), - putExpressRouteGatewayParameters, - accept, - context); - } - - /** - * Creates or updates a ExpressRoute gateway in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @param putExpressRouteGatewayParameters Parameters required in an ExpressRoute gateway PUT operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute gateway resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, ExpressRouteGatewayInner> beginCreateOrUpdateAsync( - String resourceGroupName, - String expressRouteGatewayName, - ExpressRouteGatewayInner putExpressRouteGatewayParameters) { - Mono>> mono = - createOrUpdateWithResponseAsync( - resourceGroupName, expressRouteGatewayName, putExpressRouteGatewayParameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ExpressRouteGatewayInner.class, - ExpressRouteGatewayInner.class, - Context.NONE); - } - - /** - * Creates or updates a ExpressRoute gateway in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @param putExpressRouteGatewayParameters Parameters required in an ExpressRoute gateway PUT operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute gateway resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, ExpressRouteGatewayInner> beginCreateOrUpdateAsync( - String resourceGroupName, - String expressRouteGatewayName, - ExpressRouteGatewayInner putExpressRouteGatewayParameters, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync( - resourceGroupName, expressRouteGatewayName, putExpressRouteGatewayParameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ExpressRouteGatewayInner.class, - ExpressRouteGatewayInner.class, - context); - } - - /** - * Creates or updates a ExpressRoute gateway in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @param putExpressRouteGatewayParameters Parameters required in an ExpressRoute gateway PUT operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute gateway resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, ExpressRouteGatewayInner> beginCreateOrUpdate( - String resourceGroupName, - String expressRouteGatewayName, - ExpressRouteGatewayInner putExpressRouteGatewayParameters) { - return beginCreateOrUpdateAsync(resourceGroupName, expressRouteGatewayName, putExpressRouteGatewayParameters) - .getSyncPoller(); - } - - /** - * Creates or updates a ExpressRoute gateway in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @param putExpressRouteGatewayParameters Parameters required in an ExpressRoute gateway PUT operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute gateway resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, ExpressRouteGatewayInner> beginCreateOrUpdate( - String resourceGroupName, - String expressRouteGatewayName, - ExpressRouteGatewayInner putExpressRouteGatewayParameters, - Context context) { - return beginCreateOrUpdateAsync( - resourceGroupName, expressRouteGatewayName, putExpressRouteGatewayParameters, context) - .getSyncPoller(); - } - - /** - * Creates or updates a ExpressRoute gateway in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @param putExpressRouteGatewayParameters Parameters required in an ExpressRoute gateway PUT operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute gateway resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, - String expressRouteGatewayName, - ExpressRouteGatewayInner putExpressRouteGatewayParameters) { - return beginCreateOrUpdateAsync(resourceGroupName, expressRouteGatewayName, putExpressRouteGatewayParameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a ExpressRoute gateway in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @param putExpressRouteGatewayParameters Parameters required in an ExpressRoute gateway PUT operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute gateway resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, - String expressRouteGatewayName, - ExpressRouteGatewayInner putExpressRouteGatewayParameters, - Context context) { - return beginCreateOrUpdateAsync( - resourceGroupName, expressRouteGatewayName, putExpressRouteGatewayParameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a ExpressRoute gateway in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @param putExpressRouteGatewayParameters Parameters required in an ExpressRoute gateway PUT operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute gateway resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ExpressRouteGatewayInner createOrUpdate( - String resourceGroupName, - String expressRouteGatewayName, - ExpressRouteGatewayInner putExpressRouteGatewayParameters) { - return createOrUpdateAsync(resourceGroupName, expressRouteGatewayName, putExpressRouteGatewayParameters) - .block(); - } - - /** - * Creates or updates a ExpressRoute gateway in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @param putExpressRouteGatewayParameters Parameters required in an ExpressRoute gateway PUT operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute gateway resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ExpressRouteGatewayInner createOrUpdate( - String resourceGroupName, - String expressRouteGatewayName, - ExpressRouteGatewayInner putExpressRouteGatewayParameters, - Context context) { - return createOrUpdateAsync( - resourceGroupName, expressRouteGatewayName, putExpressRouteGatewayParameters, context) - .block(); - } - - /** - * Fetches the details of a ExpressRoute gateway in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute gateway resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String expressRouteGatewayName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (expressRouteGatewayName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter expressRouteGatewayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - expressRouteGatewayName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Fetches the details of a ExpressRoute gateway in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute gateway resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String expressRouteGatewayName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (expressRouteGatewayName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter expressRouteGatewayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - expressRouteGatewayName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Fetches the details of a ExpressRoute gateway in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute gateway resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync( - String resourceGroupName, String expressRouteGatewayName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, expressRouteGatewayName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Fetches the details of a ExpressRoute gateway in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute gateway resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ExpressRouteGatewayInner getByResourceGroup(String resourceGroupName, String expressRouteGatewayName) { - return getByResourceGroupAsync(resourceGroupName, expressRouteGatewayName).block(); - } - - /** - * Fetches the details of a ExpressRoute gateway in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute gateway resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String expressRouteGatewayName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, expressRouteGatewayName, context).block(); - } - - /** - * Deletes the specified ExpressRoute gateway in a resource group. An ExpressRoute gateway resource can only be - * deleted when there are no connection subresources. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync( - String resourceGroupName, String expressRouteGatewayName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (expressRouteGatewayName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter expressRouteGatewayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - expressRouteGatewayName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the specified ExpressRoute gateway in a resource group. An ExpressRoute gateway resource can only be - * deleted when there are no connection subresources. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String expressRouteGatewayName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (expressRouteGatewayName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter expressRouteGatewayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - expressRouteGatewayName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Deletes the specified ExpressRoute gateway in a resource group. An ExpressRoute gateway resource can only be - * deleted when there are no connection subresources. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String expressRouteGatewayName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, expressRouteGatewayName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deletes the specified ExpressRoute gateway in a resource group. An ExpressRoute gateway resource can only be - * deleted when there are no connection subresources. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String expressRouteGatewayName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, expressRouteGatewayName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes the specified ExpressRoute gateway in a resource group. An ExpressRoute gateway resource can only be - * deleted when there are no connection subresources. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete(String resourceGroupName, String expressRouteGatewayName) { - return beginDeleteAsync(resourceGroupName, expressRouteGatewayName).getSyncPoller(); - } - - /** - * Deletes the specified ExpressRoute gateway in a resource group. An ExpressRoute gateway resource can only be - * deleted when there are no connection subresources. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String expressRouteGatewayName, Context context) { - return beginDeleteAsync(resourceGroupName, expressRouteGatewayName, context).getSyncPoller(); - } - - /** - * Deletes the specified ExpressRoute gateway in a resource group. An ExpressRoute gateway resource can only be - * deleted when there are no connection subresources. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String expressRouteGatewayName) { - return beginDeleteAsync(resourceGroupName, expressRouteGatewayName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified ExpressRoute gateway in a resource group. An ExpressRoute gateway resource can only be - * deleted when there are no connection subresources. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String expressRouteGatewayName, Context context) { - return beginDeleteAsync(resourceGroupName, expressRouteGatewayName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified ExpressRoute gateway in a resource group. An ExpressRoute gateway resource can only be - * deleted when there are no connection subresources. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String expressRouteGatewayName) { - deleteAsync(resourceGroupName, expressRouteGatewayName).block(); - } - - /** - * Deletes the specified ExpressRoute gateway in a resource group. An ExpressRoute gateway resource can only be - * deleted when there are no connection subresources. - * - * @param resourceGroupName The name of the resource group. - * @param expressRouteGatewayName The name of the ExpressRoute gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String expressRouteGatewayName, Context context) { - deleteAsync(resourceGroupName, expressRouteGatewayName, context).block(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ExpressRouteLinksClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ExpressRouteLinksClientImpl.java deleted file mode 100644 index 8d1f0c8c11a8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ExpressRouteLinksClientImpl.java +++ /dev/null @@ -1,525 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.ExpressRouteLinksClient; -import com.azure.resourcemanager.network.fluent.models.ExpressRouteLinkInner; -import com.azure.resourcemanager.network.models.ExpressRouteLinkListResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ExpressRouteLinksClient. */ -public final class ExpressRouteLinksClientImpl implements ExpressRouteLinksClient { - private final ClientLogger logger = new ClientLogger(ExpressRouteLinksClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final ExpressRouteLinksService service; - - /** The service client containing this operation class. */ - private final NetworkManagementClientImpl client; - - /** - * Initializes an instance of ExpressRouteLinksClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ExpressRouteLinksClientImpl(NetworkManagementClientImpl client) { - this.service = - RestProxy.create(ExpressRouteLinksService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for NetworkManagementClientExpressRouteLinks to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "NetworkManagementCli") - private interface ExpressRouteLinksService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/ExpressRoutePorts/{expressRoutePortName}/links/{linkName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("expressRoutePortName") String expressRoutePortName, - @PathParam("linkName") String linkName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/ExpressRoutePorts/{expressRoutePortName}/links") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("expressRoutePortName") String expressRoutePortName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Retrieves the specified ExpressRouteLink resource. - * - * @param resourceGroupName The name of the resource group. - * @param expressRoutePortName The name of the ExpressRoutePort resource. - * @param linkName The name of the ExpressRouteLink resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteLink. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String resourceGroupName, String expressRoutePortName, String linkName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (expressRoutePortName == null) { - return Mono - .error(new IllegalArgumentException("Parameter expressRoutePortName is required and cannot be null.")); - } - if (linkName == null) { - return Mono.error(new IllegalArgumentException("Parameter linkName is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - apiVersion, - resourceGroupName, - expressRoutePortName, - linkName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Retrieves the specified ExpressRouteLink resource. - * - * @param resourceGroupName The name of the resource group. - * @param expressRoutePortName The name of the ExpressRoutePort resource. - * @param linkName The name of the ExpressRouteLink resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteLink. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String expressRoutePortName, String linkName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (expressRoutePortName == null) { - return Mono - .error(new IllegalArgumentException("Parameter expressRoutePortName is required and cannot be null.")); - } - if (linkName == null) { - return Mono.error(new IllegalArgumentException("Parameter linkName is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - apiVersion, - resourceGroupName, - expressRoutePortName, - linkName, - accept, - context); - } - - /** - * Retrieves the specified ExpressRouteLink resource. - * - * @param resourceGroupName The name of the resource group. - * @param expressRoutePortName The name of the ExpressRoutePort resource. - * @param linkName The name of the ExpressRouteLink resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteLink. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync( - String resourceGroupName, String expressRoutePortName, String linkName) { - return getWithResponseAsync(resourceGroupName, expressRoutePortName, linkName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Retrieves the specified ExpressRouteLink resource. - * - * @param resourceGroupName The name of the resource group. - * @param expressRoutePortName The name of the ExpressRoutePort resource. - * @param linkName The name of the ExpressRouteLink resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteLink. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ExpressRouteLinkInner get(String resourceGroupName, String expressRoutePortName, String linkName) { - return getAsync(resourceGroupName, expressRoutePortName, linkName).block(); - } - - /** - * Retrieves the specified ExpressRouteLink resource. - * - * @param resourceGroupName The name of the resource group. - * @param expressRoutePortName The name of the ExpressRoutePort resource. - * @param linkName The name of the ExpressRouteLink resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteLink. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String expressRoutePortName, String linkName, Context context) { - return getWithResponseAsync(resourceGroupName, expressRoutePortName, linkName, context).block(); - } - - /** - * Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. - * - * @param resourceGroupName The name of the resource group. - * @param expressRoutePortName The name of the ExpressRoutePort resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteLink List Result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String expressRoutePortName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (expressRoutePortName == null) { - return Mono - .error(new IllegalArgumentException("Parameter expressRoutePortName is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - apiVersion, - resourceGroupName, - expressRoutePortName, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. - * - * @param resourceGroupName The name of the resource group. - * @param expressRoutePortName The name of the ExpressRoutePort resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteLink List Result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String expressRoutePortName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (expressRoutePortName == null) { - return Mono - .error(new IllegalArgumentException("Parameter expressRoutePortName is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - apiVersion, - resourceGroupName, - expressRoutePortName, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. - * - * @param resourceGroupName The name of the resource group. - * @param expressRoutePortName The name of the ExpressRoutePort resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteLink List Result. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String resourceGroupName, String expressRoutePortName) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, expressRoutePortName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. - * - * @param resourceGroupName The name of the resource group. - * @param expressRoutePortName The name of the ExpressRoutePort resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteLink List Result. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String expressRoutePortName, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, expressRoutePortName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. - * - * @param resourceGroupName The name of the resource group. - * @param expressRoutePortName The name of the ExpressRoutePort resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteLink List Result. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String expressRoutePortName) { - return new PagedIterable<>(listAsync(resourceGroupName, expressRoutePortName)); - } - - /** - * Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. - * - * @param resourceGroupName The name of the resource group. - * @param expressRoutePortName The name of the ExpressRoutePort resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteLink List Result. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, String expressRoutePortName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, expressRoutePortName, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteLink List Result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRouteLink List Result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ExpressRoutePortsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ExpressRoutePortsClientImpl.java deleted file mode 100644 index 0d8593a14c89..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ExpressRoutePortsClientImpl.java +++ /dev/null @@ -1,1552 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.ExpressRoutePortsClient; -import com.azure.resourcemanager.network.fluent.models.ExpressRoutePortInner; -import com.azure.resourcemanager.network.models.ExpressRoutePortListResult; -import com.azure.resourcemanager.network.models.TagsObject; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ExpressRoutePortsClient. */ -public final class ExpressRoutePortsClientImpl - implements InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete, - ExpressRoutePortsClient { - private final ClientLogger logger = new ClientLogger(ExpressRoutePortsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final ExpressRoutePortsService service; - - /** The service client containing this operation class. */ - private final NetworkManagementClientImpl client; - - /** - * Initializes an instance of ExpressRoutePortsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ExpressRoutePortsClientImpl(NetworkManagementClientImpl client) { - this.service = - RestProxy.create(ExpressRoutePortsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for NetworkManagementClientExpressRoutePorts to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "NetworkManagementCli") - private interface ExpressRoutePortsService { - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/ExpressRoutePorts/{expressRoutePortName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("expressRoutePortName") String expressRoutePortName, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/ExpressRoutePorts/{expressRoutePortName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("expressRoutePortName") String expressRoutePortName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/ExpressRoutePorts/{expressRoutePortName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("expressRoutePortName") String expressRoutePortName, - @BodyParam("application/json") ExpressRoutePortInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/ExpressRoutePorts/{expressRoutePortName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> updateTags( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("expressRoutePortName") String expressRoutePortName, - @BodyParam("application/json") TagsObject parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/ExpressRoutePorts") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @PathParam("resourceGroupName") String resourceGroupName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/ExpressRoutePorts") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Deletes the specified ExpressRoutePort resource. - * - * @param resourceGroupName The name of the resource group. - * @param expressRoutePortName The name of the ExpressRoutePort resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync( - String resourceGroupName, String expressRoutePortName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (expressRoutePortName == null) { - return Mono - .error(new IllegalArgumentException("Parameter expressRoutePortName is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - apiVersion, - resourceGroupName, - expressRoutePortName, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the specified ExpressRoutePort resource. - * - * @param resourceGroupName The name of the resource group. - * @param expressRoutePortName The name of the ExpressRoutePort resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String expressRoutePortName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (expressRoutePortName == null) { - return Mono - .error(new IllegalArgumentException("Parameter expressRoutePortName is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - apiVersion, - resourceGroupName, - expressRoutePortName, - context); - } - - /** - * Deletes the specified ExpressRoutePort resource. - * - * @param resourceGroupName The name of the resource group. - * @param expressRoutePortName The name of the ExpressRoutePort resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String expressRoutePortName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, expressRoutePortName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deletes the specified ExpressRoutePort resource. - * - * @param resourceGroupName The name of the resource group. - * @param expressRoutePortName The name of the ExpressRoutePort resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String expressRoutePortName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, expressRoutePortName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes the specified ExpressRoutePort resource. - * - * @param resourceGroupName The name of the resource group. - * @param expressRoutePortName The name of the ExpressRoutePort resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete(String resourceGroupName, String expressRoutePortName) { - return beginDeleteAsync(resourceGroupName, expressRoutePortName).getSyncPoller(); - } - - /** - * Deletes the specified ExpressRoutePort resource. - * - * @param resourceGroupName The name of the resource group. - * @param expressRoutePortName The name of the ExpressRoutePort resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String expressRoutePortName, Context context) { - return beginDeleteAsync(resourceGroupName, expressRoutePortName, context).getSyncPoller(); - } - - /** - * Deletes the specified ExpressRoutePort resource. - * - * @param resourceGroupName The name of the resource group. - * @param expressRoutePortName The name of the ExpressRoutePort resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String expressRoutePortName) { - return beginDeleteAsync(resourceGroupName, expressRoutePortName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified ExpressRoutePort resource. - * - * @param resourceGroupName The name of the resource group. - * @param expressRoutePortName The name of the ExpressRoutePort resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String expressRoutePortName, Context context) { - return beginDeleteAsync(resourceGroupName, expressRoutePortName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified ExpressRoutePort resource. - * - * @param resourceGroupName The name of the resource group. - * @param expressRoutePortName The name of the ExpressRoutePort resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String expressRoutePortName) { - deleteAsync(resourceGroupName, expressRoutePortName).block(); - } - - /** - * Deletes the specified ExpressRoutePort resource. - * - * @param resourceGroupName The name of the resource group. - * @param expressRoutePortName The name of the ExpressRoutePort resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String expressRoutePortName, Context context) { - deleteAsync(resourceGroupName, expressRoutePortName, context).block(); - } - - /** - * Retrieves the requested ExpressRoutePort resource. - * - * @param resourceGroupName The name of the resource group. - * @param expressRoutePortName The name of ExpressRoutePort. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute Port. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String expressRoutePortName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (expressRoutePortName == null) { - return Mono - .error(new IllegalArgumentException("Parameter expressRoutePortName is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - apiVersion, - resourceGroupName, - expressRoutePortName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Retrieves the requested ExpressRoutePort resource. - * - * @param resourceGroupName The name of the resource group. - * @param expressRoutePortName The name of ExpressRoutePort. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute Port. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String expressRoutePortName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (expressRoutePortName == null) { - return Mono - .error(new IllegalArgumentException("Parameter expressRoutePortName is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - apiVersion, - resourceGroupName, - expressRoutePortName, - accept, - context); - } - - /** - * Retrieves the requested ExpressRoutePort resource. - * - * @param resourceGroupName The name of the resource group. - * @param expressRoutePortName The name of ExpressRoutePort. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute Port. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync(String resourceGroupName, String expressRoutePortName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, expressRoutePortName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Retrieves the requested ExpressRoutePort resource. - * - * @param resourceGroupName The name of the resource group. - * @param expressRoutePortName The name of ExpressRoutePort. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute Port. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ExpressRoutePortInner getByResourceGroup(String resourceGroupName, String expressRoutePortName) { - return getByResourceGroupAsync(resourceGroupName, expressRoutePortName).block(); - } - - /** - * Retrieves the requested ExpressRoutePort resource. - * - * @param resourceGroupName The name of the resource group. - * @param expressRoutePortName The name of ExpressRoutePort. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute Port. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String expressRoutePortName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, expressRoutePortName, context).block(); - } - - /** - * Creates or updates the specified ExpressRoutePort resource. - * - * @param resourceGroupName The name of the resource group. - * @param expressRoutePortName The name of the ExpressRoutePort resource. - * @param parameters Parameters supplied to the create ExpressRoutePort operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute Port. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String expressRoutePortName, ExpressRoutePortInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (expressRoutePortName == null) { - return Mono - .error(new IllegalArgumentException("Parameter expressRoutePortName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - apiVersion, - resourceGroupName, - expressRoutePortName, - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates the specified ExpressRoutePort resource. - * - * @param resourceGroupName The name of the resource group. - * @param expressRoutePortName The name of the ExpressRoutePort resource. - * @param parameters Parameters supplied to the create ExpressRoutePort operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute Port. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String expressRoutePortName, ExpressRoutePortInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (expressRoutePortName == null) { - return Mono - .error(new IllegalArgumentException("Parameter expressRoutePortName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - apiVersion, - resourceGroupName, - expressRoutePortName, - parameters, - accept, - context); - } - - /** - * Creates or updates the specified ExpressRoutePort resource. - * - * @param resourceGroupName The name of the resource group. - * @param expressRoutePortName The name of the ExpressRoutePort resource. - * @param parameters Parameters supplied to the create ExpressRoutePort operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute Port. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, ExpressRoutePortInner> beginCreateOrUpdateAsync( - String resourceGroupName, String expressRoutePortName, ExpressRoutePortInner parameters) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, expressRoutePortName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ExpressRoutePortInner.class, - ExpressRoutePortInner.class, - Context.NONE); - } - - /** - * Creates or updates the specified ExpressRoutePort resource. - * - * @param resourceGroupName The name of the resource group. - * @param expressRoutePortName The name of the ExpressRoutePort resource. - * @param parameters Parameters supplied to the create ExpressRoutePort operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute Port. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, ExpressRoutePortInner> beginCreateOrUpdateAsync( - String resourceGroupName, String expressRoutePortName, ExpressRoutePortInner parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, expressRoutePortName, parameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), ExpressRoutePortInner.class, ExpressRoutePortInner.class, context); - } - - /** - * Creates or updates the specified ExpressRoutePort resource. - * - * @param resourceGroupName The name of the resource group. - * @param expressRoutePortName The name of the ExpressRoutePort resource. - * @param parameters Parameters supplied to the create ExpressRoutePort operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute Port. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, ExpressRoutePortInner> beginCreateOrUpdate( - String resourceGroupName, String expressRoutePortName, ExpressRoutePortInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, expressRoutePortName, parameters).getSyncPoller(); - } - - /** - * Creates or updates the specified ExpressRoutePort resource. - * - * @param resourceGroupName The name of the resource group. - * @param expressRoutePortName The name of the ExpressRoutePort resource. - * @param parameters Parameters supplied to the create ExpressRoutePort operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute Port. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, ExpressRoutePortInner> beginCreateOrUpdate( - String resourceGroupName, String expressRoutePortName, ExpressRoutePortInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, expressRoutePortName, parameters, context).getSyncPoller(); - } - - /** - * Creates or updates the specified ExpressRoutePort resource. - * - * @param resourceGroupName The name of the resource group. - * @param expressRoutePortName The name of the ExpressRoutePort resource. - * @param parameters Parameters supplied to the create ExpressRoutePort operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute Port. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, String expressRoutePortName, ExpressRoutePortInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, expressRoutePortName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates the specified ExpressRoutePort resource. - * - * @param resourceGroupName The name of the resource group. - * @param expressRoutePortName The name of the ExpressRoutePort resource. - * @param parameters Parameters supplied to the create ExpressRoutePort operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute Port. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String expressRoutePortName, ExpressRoutePortInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, expressRoutePortName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates the specified ExpressRoutePort resource. - * - * @param resourceGroupName The name of the resource group. - * @param expressRoutePortName The name of the ExpressRoutePort resource. - * @param parameters Parameters supplied to the create ExpressRoutePort operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute Port. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ExpressRoutePortInner createOrUpdate( - String resourceGroupName, String expressRoutePortName, ExpressRoutePortInner parameters) { - return createOrUpdateAsync(resourceGroupName, expressRoutePortName, parameters).block(); - } - - /** - * Creates or updates the specified ExpressRoutePort resource. - * - * @param resourceGroupName The name of the resource group. - * @param expressRoutePortName The name of the ExpressRoutePort resource. - * @param parameters Parameters supplied to the create ExpressRoutePort operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute Port. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ExpressRoutePortInner createOrUpdate( - String resourceGroupName, String expressRoutePortName, ExpressRoutePortInner parameters, Context context) { - return createOrUpdateAsync(resourceGroupName, expressRoutePortName, parameters, context).block(); - } - - /** - * Update ExpressRoutePort tags. - * - * @param resourceGroupName The name of the resource group. - * @param expressRoutePortName The name of the ExpressRoutePort resource. - * @param parameters Parameters supplied to update ExpressRoutePort resource tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute Port. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateTagsWithResponseAsync( - String resourceGroupName, String expressRoutePortName, TagsObject parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (expressRoutePortName == null) { - return Mono - .error(new IllegalArgumentException("Parameter expressRoutePortName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updateTags( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - apiVersion, - resourceGroupName, - expressRoutePortName, - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Update ExpressRoutePort tags. - * - * @param resourceGroupName The name of the resource group. - * @param expressRoutePortName The name of the ExpressRoutePort resource. - * @param parameters Parameters supplied to update ExpressRoutePort resource tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute Port. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateTagsWithResponseAsync( - String resourceGroupName, String expressRoutePortName, TagsObject parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (expressRoutePortName == null) { - return Mono - .error(new IllegalArgumentException("Parameter expressRoutePortName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updateTags( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - apiVersion, - resourceGroupName, - expressRoutePortName, - parameters, - accept, - context); - } - - /** - * Update ExpressRoutePort tags. - * - * @param resourceGroupName The name of the resource group. - * @param expressRoutePortName The name of the ExpressRoutePort resource. - * @param parameters Parameters supplied to update ExpressRoutePort resource tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute Port. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, ExpressRoutePortInner> beginUpdateTagsAsync( - String resourceGroupName, String expressRoutePortName, TagsObject parameters) { - Mono>> mono = - updateTagsWithResponseAsync(resourceGroupName, expressRoutePortName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ExpressRoutePortInner.class, - ExpressRoutePortInner.class, - Context.NONE); - } - - /** - * Update ExpressRoutePort tags. - * - * @param resourceGroupName The name of the resource group. - * @param expressRoutePortName The name of the ExpressRoutePort resource. - * @param parameters Parameters supplied to update ExpressRoutePort resource tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute Port. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, ExpressRoutePortInner> beginUpdateTagsAsync( - String resourceGroupName, String expressRoutePortName, TagsObject parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - updateTagsWithResponseAsync(resourceGroupName, expressRoutePortName, parameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), ExpressRoutePortInner.class, ExpressRoutePortInner.class, context); - } - - /** - * Update ExpressRoutePort tags. - * - * @param resourceGroupName The name of the resource group. - * @param expressRoutePortName The name of the ExpressRoutePort resource. - * @param parameters Parameters supplied to update ExpressRoutePort resource tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute Port. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, ExpressRoutePortInner> beginUpdateTags( - String resourceGroupName, String expressRoutePortName, TagsObject parameters) { - return beginUpdateTagsAsync(resourceGroupName, expressRoutePortName, parameters).getSyncPoller(); - } - - /** - * Update ExpressRoutePort tags. - * - * @param resourceGroupName The name of the resource group. - * @param expressRoutePortName The name of the ExpressRoutePort resource. - * @param parameters Parameters supplied to update ExpressRoutePort resource tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute Port. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, ExpressRoutePortInner> beginUpdateTags( - String resourceGroupName, String expressRoutePortName, TagsObject parameters, Context context) { - return beginUpdateTagsAsync(resourceGroupName, expressRoutePortName, parameters, context).getSyncPoller(); - } - - /** - * Update ExpressRoutePort tags. - * - * @param resourceGroupName The name of the resource group. - * @param expressRoutePortName The name of the ExpressRoutePort resource. - * @param parameters Parameters supplied to update ExpressRoutePort resource tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute Port. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateTagsAsync( - String resourceGroupName, String expressRoutePortName, TagsObject parameters) { - return beginUpdateTagsAsync(resourceGroupName, expressRoutePortName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Update ExpressRoutePort tags. - * - * @param resourceGroupName The name of the resource group. - * @param expressRoutePortName The name of the ExpressRoutePort resource. - * @param parameters Parameters supplied to update ExpressRoutePort resource tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute Port. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateTagsAsync( - String resourceGroupName, String expressRoutePortName, TagsObject parameters, Context context) { - return beginUpdateTagsAsync(resourceGroupName, expressRoutePortName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Update ExpressRoutePort tags. - * - * @param resourceGroupName The name of the resource group. - * @param expressRoutePortName The name of the ExpressRoutePort resource. - * @param parameters Parameters supplied to update ExpressRoutePort resource tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute Port. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ExpressRoutePortInner updateTags( - String resourceGroupName, String expressRoutePortName, TagsObject parameters) { - return updateTagsAsync(resourceGroupName, expressRoutePortName, parameters).block(); - } - - /** - * Update ExpressRoutePort tags. - * - * @param resourceGroupName The name of the resource group. - * @param expressRoutePortName The name of the ExpressRoutePort resource. - * @param parameters Parameters supplied to update ExpressRoutePort resource tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute Port. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ExpressRoutePortInner updateTags( - String resourceGroupName, String expressRoutePortName, TagsObject parameters, Context context) { - return updateTagsAsync(resourceGroupName, expressRoutePortName, parameters, context).block(); - } - - /** - * List all the ExpressRoutePort resources in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute Port List Result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - apiVersion, - resourceGroupName, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List all the ExpressRoutePort resources in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute Port List Result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - apiVersion, - resourceGroupName, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * List all the ExpressRoutePort resources in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute Port List Result. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * List all the ExpressRoutePort resources in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute Port List Result. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * List all the ExpressRoutePort resources in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute Port List Result. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * List all the ExpressRoutePort resources in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute Port List Result. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * List all the ExpressRoutePort resources in the specified subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute Port List Result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List all the ExpressRoutePort resources in the specified subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute Port List Result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * List all the ExpressRoutePort resources in the specified subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute Port List Result. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List all the ExpressRoutePort resources in the specified subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute Port List Result. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * List all the ExpressRoutePort resources in the specified subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute Port List Result. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * List all the ExpressRoutePort resources in the specified subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute Port List Result. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute Port List Result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute Port List Result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute Port List Result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute Port List Result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ExpressRoutePortsLocationsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ExpressRoutePortsLocationsClientImpl.java deleted file mode 100644 index d49b4a1e71a5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ExpressRoutePortsLocationsClientImpl.java +++ /dev/null @@ -1,439 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.ExpressRoutePortsLocationsClient; -import com.azure.resourcemanager.network.fluent.models.ExpressRoutePortsLocationInner; -import com.azure.resourcemanager.network.models.ExpressRoutePortsLocationListResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ExpressRoutePortsLocationsClient. */ -public final class ExpressRoutePortsLocationsClientImpl implements ExpressRoutePortsLocationsClient { - private final ClientLogger logger = new ClientLogger(ExpressRoutePortsLocationsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final ExpressRoutePortsLocationsService service; - - /** The service client containing this operation class. */ - private final NetworkManagementClientImpl client; - - /** - * Initializes an instance of ExpressRoutePortsLocationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ExpressRoutePortsLocationsClientImpl(NetworkManagementClientImpl client) { - this.service = - RestProxy - .create( - ExpressRoutePortsLocationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for NetworkManagementClientExpressRoutePortsLocations to be used by the - * proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "NetworkManagementCli") - private interface ExpressRoutePortsLocationsService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/ExpressRoutePortsLocations") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/ExpressRoutePortsLocations/{locationName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @PathParam("locationName") String locationName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Retrieves all ExpressRoutePort peering locations. Does not return available bandwidths for each location. - * Available bandwidths can only be obtained when retrieving a specific peering location. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoutePorts Location List Result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Retrieves all ExpressRoutePort peering locations. Does not return available bandwidths for each location. - * Available bandwidths can only be obtained when retrieving a specific peering location. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoutePorts Location List Result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Retrieves all ExpressRoutePort peering locations. Does not return available bandwidths for each location. - * Available bandwidths can only be obtained when retrieving a specific peering location. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoutePorts Location List Result. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Retrieves all ExpressRoutePort peering locations. Does not return available bandwidths for each location. - * Available bandwidths can only be obtained when retrieving a specific peering location. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoutePorts Location List Result. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Retrieves all ExpressRoutePort peering locations. Does not return available bandwidths for each location. - * Available bandwidths can only be obtained when retrieving a specific peering location. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoutePorts Location List Result. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Retrieves all ExpressRoutePort peering locations. Does not return available bandwidths for each location. - * Available bandwidths can only be obtained when retrieving a specific peering location. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoutePorts Location List Result. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Retrieves a single ExpressRoutePort peering location, including the list of available bandwidths available at - * said peering location. - * - * @param locationName Name of the requested ExpressRoutePort peering location. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoutePorts Peering Location. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync(String locationName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (locationName == null) { - return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - apiVersion, - locationName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Retrieves a single ExpressRoutePort peering location, including the list of available bandwidths available at - * said peering location. - * - * @param locationName Name of the requested ExpressRoutePort peering location. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoutePorts Peering Location. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String locationName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (locationName == null) { - return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, locationName, accept, context); - } - - /** - * Retrieves a single ExpressRoutePort peering location, including the list of available bandwidths available at - * said peering location. - * - * @param locationName Name of the requested ExpressRoutePort peering location. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoutePorts Peering Location. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync(String locationName) { - return getWithResponseAsync(locationName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Retrieves a single ExpressRoutePort peering location, including the list of available bandwidths available at - * said peering location. - * - * @param locationName Name of the requested ExpressRoutePort peering location. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoutePorts Peering Location. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ExpressRoutePortsLocationInner get(String locationName) { - return getAsync(locationName).block(); - } - - /** - * Retrieves a single ExpressRoutePort peering location, including the list of available bandwidths available at - * said peering location. - * - * @param locationName Name of the requested ExpressRoutePort peering location. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoutePorts Peering Location. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String locationName, Context context) { - return getWithResponseAsync(locationName, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoutePorts Location List Result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoutePorts Location List Result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ExpressRouteServiceProvidersClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ExpressRouteServiceProvidersClientImpl.java deleted file mode 100644 index c706ad7dca15..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ExpressRouteServiceProvidersClientImpl.java +++ /dev/null @@ -1,289 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.ExpressRouteServiceProvidersClient; -import com.azure.resourcemanager.network.fluent.models.ExpressRouteServiceProviderInner; -import com.azure.resourcemanager.network.models.ExpressRouteServiceProviderListResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ExpressRouteServiceProvidersClient. */ -public final class ExpressRouteServiceProvidersClientImpl implements ExpressRouteServiceProvidersClient { - private final ClientLogger logger = new ClientLogger(ExpressRouteServiceProvidersClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final ExpressRouteServiceProvidersService service; - - /** The service client containing this operation class. */ - private final NetworkManagementClientImpl client; - - /** - * Initializes an instance of ExpressRouteServiceProvidersClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ExpressRouteServiceProvidersClientImpl(NetworkManagementClientImpl client) { - this.service = - RestProxy - .create( - ExpressRouteServiceProvidersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for NetworkManagementClientExpressRouteServiceProviders to be used by the - * proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "NetworkManagementCli") - private interface ExpressRouteServiceProvidersService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteServiceProviders") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets all the available express route service providers. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the available express route service providers. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all the available express route service providers. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the available express route service providers. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all the available express route service providers. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the available express route service providers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets all the available express route service providers. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the available express route service providers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all the available express route service providers. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the available express route service providers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Gets all the available express route service providers. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the available express route service providers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the ListExpressRouteServiceProvider API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the ListExpressRouteServiceProvider API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/FlowLogSettingsImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/FlowLogSettingsImpl.java deleted file mode 100644 index 51c659fe4b29..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/FlowLogSettingsImpl.java +++ /dev/null @@ -1,166 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.network.models.FlowLogSettings; -import com.azure.resourcemanager.network.models.FlowLogStatusParameters; -import com.azure.resourcemanager.network.models.RetentionPolicyParameters; -import com.azure.resourcemanager.network.fluent.models.FlowLogInformationInner; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.RefreshableWrapperImpl; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import reactor.core.publisher.Mono; - -/** Implementation for {@link FlowLogSettings} and its create and update interfaces. */ -class FlowLogSettingsImpl extends RefreshableWrapperImpl - implements FlowLogSettings, FlowLogSettings.Update { - private final NetworkWatcherImpl parent; - private final String nsgId; - - FlowLogSettingsImpl(NetworkWatcherImpl parent, FlowLogInformationInner inner, String nsgId) { - super(inner); - this.parent = parent; - this.nsgId = nsgId; - } - - @Override - public FlowLogSettings apply() { - return applyAsync().block(); - } - - @Override - public Mono applyAsync() { - return applyAsync(Context.NONE); - } - - @Override - public FlowLogSettings apply(Context context) { - return applyAsync(context).block(); - } - - @Override - public Mono applyAsync(Context context) { - return this - .parent() - .manager() - .serviceClient() - .getNetworkWatchers() - .setFlowLogConfigurationAsync(parent().resourceGroupName(), parent().name(), this.innerModel()) - .contextWrite(c -> c.putAll(FluxUtil.toReactorContext(context).readOnly())) - .map( - flowLogInformationInner -> - new FlowLogSettingsImpl(FlowLogSettingsImpl.this.parent, flowLogInformationInner, nsgId)); - } - - @Override - public Update withLogging() { - this.innerModel().withEnabled(true); - return this; - } - - @Override - public Update withoutLogging() { - this.innerModel().withEnabled(false); - return this; - } - - @Override - public Update withStorageAccount(String storageId) { - this.innerModel().withStorageId(storageId); - return this; - } - - @Override - public Update withRetentionPolicyEnabled() { - ensureRetentionPolicy(); - this.innerModel().retentionPolicy().withEnabled(true); - return this; - } - - @Override - public Update withRetentionPolicyDisabled() { - ensureRetentionPolicy(); - this.innerModel().retentionPolicy().withEnabled(false); - return this; - } - - @Override - public Update withRetentionPolicyDays(int days) { - ensureRetentionPolicy(); - this.innerModel().retentionPolicy().withDays(days); - return this; - } - - private void ensureRetentionPolicy() { - if (this.innerModel().retentionPolicy() == null) { - this.innerModel().withRetentionPolicy(new RetentionPolicyParameters()); - } - } - - @Override - public Update update() { - if (this.innerModel().flowAnalyticsConfiguration() != null - && this.innerModel().flowAnalyticsConfiguration().networkWatcherFlowAnalyticsConfiguration() == null) { - // Service response could have such case, which is not valid in swagger that - // networkWatcherFlowAnalyticsConfiguration is a required field. - this.innerModel().withFlowAnalyticsConfiguration(null); - } - return this; - } - - @Override - protected Mono getInnerAsync() { - return this - .parent() - .manager() - .serviceClient() - .getNetworkWatchers() - .getFlowLogStatusAsync(parent().resourceGroupName(), parent().name(), - new FlowLogStatusParameters().withTargetResourceId(innerModel().targetResourceId())); - } - - @Override - public NetworkWatcherImpl parent() { - return parent; - } - - @Override - public String key() { - return null; - } - - @Override - public String targetResourceId() { - return innerModel().targetResourceId(); - } - - @Override - public String storageId() { - return innerModel().storageId(); - } - - @Override - public boolean enabled() { - return ResourceManagerUtils.toPrimitiveBoolean(innerModel().enabled()); - } - - @Override - public boolean isRetentionEnabled() { - // will return default values if server response for retention policy was empty - ensureRetentionPolicy(); - return ResourceManagerUtils.toPrimitiveBoolean(innerModel().retentionPolicy().enabled()); - } - - @Override - public int retentionDays() { - // will return default values if server response for retention policy was empty - ensureRetentionPolicy(); - return ResourceManagerUtils.toPrimitiveInt(innerModel().retentionPolicy().days()); - } - - @Override - public String networkSecurityGroupId() { - return nsgId; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/GroupableParentResourceWithTagsImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/GroupableParentResourceWithTagsImpl.java deleted file mode 100644 index 952f654fbb72..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/GroupableParentResourceWithTagsImpl.java +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.resourcemanager.network.models.AppliableWithTags; -import com.azure.resourcemanager.network.models.UpdatableWithTags; -import com.azure.resourcemanager.resources.fluentcore.arm.Manager; -import com.azure.resourcemanager.resources.fluentcore.arm.models.GroupableResource; -import com.azure.resourcemanager.resources.fluentcore.arm.models.Resource; -import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.GroupableParentResourceImpl; -import reactor.core.publisher.Mono; - -/** - * The implementation for {@link GroupableResource} that can update tags as a separate operation. - * - * @param The fluent model type - * @param Azure inner resource class type - * @param the implementation type of the fluent model type - * @param the service manager type - */ -public abstract class GroupableParentResourceWithTagsImpl< - FluentModelT extends Resource, - InnerModelT extends com.azure.core.management.Resource, - FluentModelImplT extends - GroupableParentResourceWithTagsImpl, - ManagerT extends Manager> - extends GroupableParentResourceImpl - implements UpdatableWithTags, AppliableWithTags { - protected GroupableParentResourceWithTagsImpl(String name, InnerModelT innerObject, ManagerT manager) { - super(name, innerObject, manager); - } - - @Override - @SuppressWarnings("unchecked") - public FluentModelImplT updateTags() { - return (FluentModelImplT) this; - } - - @Override - public FluentModelT applyTags() { - return applyTagsAsync().block(); - } - - protected abstract Mono applyTagsToInnerAsync(); - - @Override - public Mono applyTagsAsync() { - @SuppressWarnings("unchecked") - final FluentModelT self = (FluentModelT) this; - return applyTagsToInnerAsync() - .flatMap( - inner -> { - setInner(inner); - return Mono.just(self); - }); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/HubVirtualNetworkConnectionsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/HubVirtualNetworkConnectionsClientImpl.java deleted file mode 100644 index 267b6961c86e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/HubVirtualNetworkConnectionsClientImpl.java +++ /dev/null @@ -1,525 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.HubVirtualNetworkConnectionsClient; -import com.azure.resourcemanager.network.fluent.models.HubVirtualNetworkConnectionInner; -import com.azure.resourcemanager.network.models.ErrorException; -import com.azure.resourcemanager.network.models.ListHubVirtualNetworkConnectionsResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in HubVirtualNetworkConnectionsClient. */ -public final class HubVirtualNetworkConnectionsClientImpl implements HubVirtualNetworkConnectionsClient { - private final ClientLogger logger = new ClientLogger(HubVirtualNetworkConnectionsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final HubVirtualNetworkConnectionsService service; - - /** The service client containing this operation class. */ - private final NetworkManagementClientImpl client; - - /** - * Initializes an instance of HubVirtualNetworkConnectionsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - HubVirtualNetworkConnectionsClientImpl(NetworkManagementClientImpl client) { - this.service = - RestProxy - .create( - HubVirtualNetworkConnectionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for NetworkManagementClientHubVirtualNetworkConnections to be used by the - * proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "NetworkManagementCli") - private interface HubVirtualNetworkConnectionsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs" - + "/{virtualHubName}/hubVirtualNetworkConnections/{connectionName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ErrorException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualHubName") String virtualHubName, - @PathParam("connectionName") String connectionName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs" - + "/{virtualHubName}/hubVirtualNetworkConnections") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ErrorException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualHubName") String virtualHubName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ErrorException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Retrieves the details of a HubVirtualNetworkConnection. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param virtualHubName The name of the VirtualHub. - * @param connectionName The name of the vpn connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hubVirtualNetworkConnection Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String resourceGroupName, String virtualHubName, String connectionName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualHubName == null) { - return Mono.error(new IllegalArgumentException("Parameter virtualHubName is required and cannot be null.")); - } - if (connectionName == null) { - return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - virtualHubName, - connectionName, - apiVersion, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Retrieves the details of a HubVirtualNetworkConnection. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param virtualHubName The name of the VirtualHub. - * @param connectionName The name of the vpn connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hubVirtualNetworkConnection Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String virtualHubName, String connectionName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualHubName == null) { - return Mono.error(new IllegalArgumentException("Parameter virtualHubName is required and cannot be null.")); - } - if (connectionName == null) { - return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - virtualHubName, - connectionName, - apiVersion, - accept, - context); - } - - /** - * Retrieves the details of a HubVirtualNetworkConnection. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param virtualHubName The name of the VirtualHub. - * @param connectionName The name of the vpn connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hubVirtualNetworkConnection Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync( - String resourceGroupName, String virtualHubName, String connectionName) { - return getWithResponseAsync(resourceGroupName, virtualHubName, connectionName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Retrieves the details of a HubVirtualNetworkConnection. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param virtualHubName The name of the VirtualHub. - * @param connectionName The name of the vpn connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hubVirtualNetworkConnection Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public HubVirtualNetworkConnectionInner get( - String resourceGroupName, String virtualHubName, String connectionName) { - return getAsync(resourceGroupName, virtualHubName, connectionName).block(); - } - - /** - * Retrieves the details of a HubVirtualNetworkConnection. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param virtualHubName The name of the VirtualHub. - * @param connectionName The name of the vpn connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hubVirtualNetworkConnection Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String virtualHubName, String connectionName, Context context) { - return getWithResponseAsync(resourceGroupName, virtualHubName, connectionName, context).block(); - } - - /** - * Retrieves the details of all HubVirtualNetworkConnections. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param virtualHubName The name of the VirtualHub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of HubVirtualNetworkConnections and a URL nextLink to get the next set of results. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String virtualHubName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualHubName == null) { - return Mono.error(new IllegalArgumentException("Parameter virtualHubName is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - virtualHubName, - apiVersion, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Retrieves the details of all HubVirtualNetworkConnections. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param virtualHubName The name of the VirtualHub. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of HubVirtualNetworkConnections and a URL nextLink to get the next set of results. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String virtualHubName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualHubName == null) { - return Mono.error(new IllegalArgumentException("Parameter virtualHubName is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - virtualHubName, - apiVersion, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Retrieves the details of all HubVirtualNetworkConnections. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param virtualHubName The name of the VirtualHub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of HubVirtualNetworkConnections and a URL nextLink to get the next set of results. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String resourceGroupName, String virtualHubName) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, virtualHubName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Retrieves the details of all HubVirtualNetworkConnections. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param virtualHubName The name of the VirtualHub. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of HubVirtualNetworkConnections and a URL nextLink to get the next set of results. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String virtualHubName, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, virtualHubName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Retrieves the details of all HubVirtualNetworkConnections. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param virtualHubName The name of the VirtualHub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of HubVirtualNetworkConnections and a URL nextLink to get the next set of results. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String virtualHubName) { - return new PagedIterable<>(listAsync(resourceGroupName, virtualHubName)); - } - - /** - * Retrieves the details of all HubVirtualNetworkConnections. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param virtualHubName The name of the VirtualHub. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of HubVirtualNetworkConnections and a URL nextLink to get the next set of results. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, String virtualHubName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, virtualHubName, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of HubVirtualNetworkConnections and a URL nextLink to get the next set of results. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of HubVirtualNetworkConnections and a URL nextLink to get the next set of results. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/InboundNatRulesClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/InboundNatRulesClientImpl.java deleted file mode 100644 index 1b0e0e5797ab..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/InboundNatRulesClientImpl.java +++ /dev/null @@ -1,1196 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.InboundNatRulesClient; -import com.azure.resourcemanager.network.fluent.models.InboundNatRuleInner; -import com.azure.resourcemanager.network.models.InboundNatRuleListResult; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in InboundNatRulesClient. */ -public final class InboundNatRulesClientImpl implements InboundNatRulesClient { - private final ClientLogger logger = new ClientLogger(InboundNatRulesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final InboundNatRulesService service; - - /** The service client containing this operation class. */ - private final NetworkManagementClientImpl client; - - /** - * Initializes an instance of InboundNatRulesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - InboundNatRulesClientImpl(NetworkManagementClientImpl client) { - this.service = - RestProxy.create(InboundNatRulesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for NetworkManagementClientInboundNatRules to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "NetworkManagementCli") - private interface InboundNatRulesService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/loadBalancers/{loadBalancerName}/inboundNatRules") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("loadBalancerName") String loadBalancerName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("loadBalancerName") String loadBalancerName, - @PathParam("inboundNatRuleName") String inboundNatRuleName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("loadBalancerName") String loadBalancerName, - @PathParam("inboundNatRuleName") String inboundNatRuleName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("$expand") String expand, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("loadBalancerName") String loadBalancerName, - @PathParam("inboundNatRuleName") String inboundNatRuleName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") InboundNatRuleInner inboundNatRuleParameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets all the inbound nat rules in a load balancer. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the inbound nat rules in a load balancer. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String loadBalancerName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (loadBalancerName == null) { - return Mono - .error(new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - resourceGroupName, - loadBalancerName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all the inbound nat rules in a load balancer. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the inbound nat rules in a load balancer. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String loadBalancerName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (loadBalancerName == null) { - return Mono - .error(new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - resourceGroupName, - loadBalancerName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all the inbound nat rules in a load balancer. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the inbound nat rules in a load balancer. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String resourceGroupName, String loadBalancerName) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, loadBalancerName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets all the inbound nat rules in a load balancer. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the inbound nat rules in a load balancer. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String loadBalancerName, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, loadBalancerName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all the inbound nat rules in a load balancer. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the inbound nat rules in a load balancer. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String loadBalancerName) { - return new PagedIterable<>(listAsync(resourceGroupName, loadBalancerName)); - } - - /** - * Gets all the inbound nat rules in a load balancer. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the inbound nat rules in a load balancer. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String loadBalancerName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, loadBalancerName, context)); - } - - /** - * Deletes the specified load balancer inbound nat rule. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param inboundNatRuleName The name of the inbound nat rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync( - String resourceGroupName, String loadBalancerName, String inboundNatRuleName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (loadBalancerName == null) { - return Mono - .error(new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null.")); - } - if (inboundNatRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter inboundNatRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - loadBalancerName, - inboundNatRuleName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the specified load balancer inbound nat rule. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param inboundNatRuleName The name of the inbound nat rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String loadBalancerName, String inboundNatRuleName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (loadBalancerName == null) { - return Mono - .error(new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null.")); - } - if (inboundNatRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter inboundNatRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - loadBalancerName, - inboundNatRuleName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Deletes the specified load balancer inbound nat rule. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param inboundNatRuleName The name of the inbound nat rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String loadBalancerName, String inboundNatRuleName) { - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deletes the specified load balancer inbound nat rule. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param inboundNatRuleName The name of the inbound nat rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String loadBalancerName, String inboundNatRuleName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes the specified load balancer inbound nat rule. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param inboundNatRuleName The name of the inbound nat rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String loadBalancerName, String inboundNatRuleName) { - return beginDeleteAsync(resourceGroupName, loadBalancerName, inboundNatRuleName).getSyncPoller(); - } - - /** - * Deletes the specified load balancer inbound nat rule. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param inboundNatRuleName The name of the inbound nat rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String loadBalancerName, String inboundNatRuleName, Context context) { - return beginDeleteAsync(resourceGroupName, loadBalancerName, inboundNatRuleName, context).getSyncPoller(); - } - - /** - * Deletes the specified load balancer inbound nat rule. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param inboundNatRuleName The name of the inbound nat rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName) { - return beginDeleteAsync(resourceGroupName, loadBalancerName, inboundNatRuleName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified load balancer inbound nat rule. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param inboundNatRuleName The name of the inbound nat rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync( - String resourceGroupName, String loadBalancerName, String inboundNatRuleName, Context context) { - return beginDeleteAsync(resourceGroupName, loadBalancerName, inboundNatRuleName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified load balancer inbound nat rule. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param inboundNatRuleName The name of the inbound nat rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String loadBalancerName, String inboundNatRuleName) { - deleteAsync(resourceGroupName, loadBalancerName, inboundNatRuleName).block(); - } - - /** - * Deletes the specified load balancer inbound nat rule. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param inboundNatRuleName The name of the inbound nat rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String loadBalancerName, String inboundNatRuleName, Context context) { - deleteAsync(resourceGroupName, loadBalancerName, inboundNatRuleName, context).block(); - } - - /** - * Gets the specified load balancer inbound nat rule. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param inboundNatRuleName The name of the inbound nat rule. - * @param expand Expands referenced resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified load balancer inbound nat rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String resourceGroupName, String loadBalancerName, String inboundNatRuleName, String expand) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (loadBalancerName == null) { - return Mono - .error(new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null.")); - } - if (inboundNatRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter inboundNatRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - resourceGroupName, - loadBalancerName, - inboundNatRuleName, - apiVersion, - this.client.getSubscriptionId(), - expand, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the specified load balancer inbound nat rule. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param inboundNatRuleName The name of the inbound nat rule. - * @param expand Expands referenced resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified load balancer inbound nat rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String loadBalancerName, String inboundNatRuleName, String expand, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (loadBalancerName == null) { - return Mono - .error(new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null.")); - } - if (inboundNatRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter inboundNatRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - resourceGroupName, - loadBalancerName, - inboundNatRuleName, - apiVersion, - this.client.getSubscriptionId(), - expand, - accept, - context); - } - - /** - * Gets the specified load balancer inbound nat rule. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param inboundNatRuleName The name of the inbound nat rule. - * @param expand Expands referenced resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified load balancer inbound nat rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync( - String resourceGroupName, String loadBalancerName, String inboundNatRuleName, String expand) { - return getWithResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the specified load balancer inbound nat rule. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param inboundNatRuleName The name of the inbound nat rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified load balancer inbound nat rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync( - String resourceGroupName, String loadBalancerName, String inboundNatRuleName) { - final String expand = null; - return getWithResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the specified load balancer inbound nat rule. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param inboundNatRuleName The name of the inbound nat rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified load balancer inbound nat rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public InboundNatRuleInner get(String resourceGroupName, String loadBalancerName, String inboundNatRuleName) { - final String expand = null; - return getAsync(resourceGroupName, loadBalancerName, inboundNatRuleName, expand).block(); - } - - /** - * Gets the specified load balancer inbound nat rule. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param inboundNatRuleName The name of the inbound nat rule. - * @param expand Expands referenced resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified load balancer inbound nat rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String loadBalancerName, String inboundNatRuleName, String expand, Context context) { - return getWithResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName, expand, context).block(); - } - - /** - * Creates or updates a load balancer inbound nat rule. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param inboundNatRuleName The name of the inbound nat rule. - * @param inboundNatRuleParameters Parameters supplied to the create or update inbound nat rule operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return inbound NAT rule of the load balancer. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String loadBalancerName, - String inboundNatRuleName, - InboundNatRuleInner inboundNatRuleParameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (loadBalancerName == null) { - return Mono - .error(new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null.")); - } - if (inboundNatRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter inboundNatRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (inboundNatRuleParameters == null) { - return Mono - .error( - new IllegalArgumentException("Parameter inboundNatRuleParameters is required and cannot be null.")); - } else { - inboundNatRuleParameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - loadBalancerName, - inboundNatRuleName, - apiVersion, - this.client.getSubscriptionId(), - inboundNatRuleParameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a load balancer inbound nat rule. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param inboundNatRuleName The name of the inbound nat rule. - * @param inboundNatRuleParameters Parameters supplied to the create or update inbound nat rule operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return inbound NAT rule of the load balancer. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String loadBalancerName, - String inboundNatRuleName, - InboundNatRuleInner inboundNatRuleParameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (loadBalancerName == null) { - return Mono - .error(new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null.")); - } - if (inboundNatRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter inboundNatRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (inboundNatRuleParameters == null) { - return Mono - .error( - new IllegalArgumentException("Parameter inboundNatRuleParameters is required and cannot be null.")); - } else { - inboundNatRuleParameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - loadBalancerName, - inboundNatRuleName, - apiVersion, - this.client.getSubscriptionId(), - inboundNatRuleParameters, - accept, - context); - } - - /** - * Creates or updates a load balancer inbound nat rule. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param inboundNatRuleName The name of the inbound nat rule. - * @param inboundNatRuleParameters Parameters supplied to the create or update inbound nat rule operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return inbound NAT rule of the load balancer. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, InboundNatRuleInner> beginCreateOrUpdateAsync( - String resourceGroupName, - String loadBalancerName, - String inboundNatRuleName, - InboundNatRuleInner inboundNatRuleParameters) { - Mono>> mono = - createOrUpdateWithResponseAsync( - resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - InboundNatRuleInner.class, - InboundNatRuleInner.class, - Context.NONE); - } - - /** - * Creates or updates a load balancer inbound nat rule. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param inboundNatRuleName The name of the inbound nat rule. - * @param inboundNatRuleParameters Parameters supplied to the create or update inbound nat rule operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return inbound NAT rule of the load balancer. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, InboundNatRuleInner> beginCreateOrUpdateAsync( - String resourceGroupName, - String loadBalancerName, - String inboundNatRuleName, - InboundNatRuleInner inboundNatRuleParameters, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync( - resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), InboundNatRuleInner.class, InboundNatRuleInner.class, context); - } - - /** - * Creates or updates a load balancer inbound nat rule. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param inboundNatRuleName The name of the inbound nat rule. - * @param inboundNatRuleParameters Parameters supplied to the create or update inbound nat rule operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return inbound NAT rule of the load balancer. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, InboundNatRuleInner> beginCreateOrUpdate( - String resourceGroupName, - String loadBalancerName, - String inboundNatRuleName, - InboundNatRuleInner inboundNatRuleParameters) { - return beginCreateOrUpdateAsync( - resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters) - .getSyncPoller(); - } - - /** - * Creates or updates a load balancer inbound nat rule. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param inboundNatRuleName The name of the inbound nat rule. - * @param inboundNatRuleParameters Parameters supplied to the create or update inbound nat rule operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return inbound NAT rule of the load balancer. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, InboundNatRuleInner> beginCreateOrUpdate( - String resourceGroupName, - String loadBalancerName, - String inboundNatRuleName, - InboundNatRuleInner inboundNatRuleParameters, - Context context) { - return beginCreateOrUpdateAsync( - resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters, context) - .getSyncPoller(); - } - - /** - * Creates or updates a load balancer inbound nat rule. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param inboundNatRuleName The name of the inbound nat rule. - * @param inboundNatRuleParameters Parameters supplied to the create or update inbound nat rule operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return inbound NAT rule of the load balancer. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, - String loadBalancerName, - String inboundNatRuleName, - InboundNatRuleInner inboundNatRuleParameters) { - return beginCreateOrUpdateAsync( - resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a load balancer inbound nat rule. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param inboundNatRuleName The name of the inbound nat rule. - * @param inboundNatRuleParameters Parameters supplied to the create or update inbound nat rule operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return inbound NAT rule of the load balancer. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, - String loadBalancerName, - String inboundNatRuleName, - InboundNatRuleInner inboundNatRuleParameters, - Context context) { - return beginCreateOrUpdateAsync( - resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a load balancer inbound nat rule. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param inboundNatRuleName The name of the inbound nat rule. - * @param inboundNatRuleParameters Parameters supplied to the create or update inbound nat rule operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return inbound NAT rule of the load balancer. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public InboundNatRuleInner createOrUpdate( - String resourceGroupName, - String loadBalancerName, - String inboundNatRuleName, - InboundNatRuleInner inboundNatRuleParameters) { - return createOrUpdateAsync(resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters) - .block(); - } - - /** - * Creates or updates a load balancer inbound nat rule. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param inboundNatRuleName The name of the inbound nat rule. - * @param inboundNatRuleParameters Parameters supplied to the create or update inbound nat rule operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return inbound NAT rule of the load balancer. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public InboundNatRuleInner createOrUpdate( - String resourceGroupName, - String loadBalancerName, - String inboundNatRuleName, - InboundNatRuleInner inboundNatRuleParameters, - Context context) { - return createOrUpdateAsync( - resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters, context) - .block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListInboundNatRule API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListInboundNatRule API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/InterfaceEndpointsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/InterfaceEndpointsClientImpl.java deleted file mode 100644 index d11f820b7004..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/InterfaceEndpointsClientImpl.java +++ /dev/null @@ -1,1301 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.InterfaceEndpointsClient; -import com.azure.resourcemanager.network.fluent.models.InterfaceEndpointInner; -import com.azure.resourcemanager.network.models.InterfaceEndpointListResult; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in InterfaceEndpointsClient. */ -public final class InterfaceEndpointsClientImpl - implements InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete, - InterfaceEndpointsClient { - private final ClientLogger logger = new ClientLogger(InterfaceEndpointsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final InterfaceEndpointsService service; - - /** The service client containing this operation class. */ - private final NetworkManagementClientImpl client; - - /** - * Initializes an instance of InterfaceEndpointsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - InterfaceEndpointsClientImpl(NetworkManagementClientImpl client) { - this.service = - RestProxy.create(InterfaceEndpointsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for NetworkManagementClientInterfaceEndpoints to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "NetworkManagementCli") - private interface InterfaceEndpointsService { - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/interfaceEndpoints/{interfaceEndpointName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("interfaceEndpointName") String interfaceEndpointName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/interfaceEndpoints/{interfaceEndpointName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("interfaceEndpointName") String interfaceEndpointName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("$expand") String expand, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/interfaceEndpoints/{interfaceEndpointName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("interfaceEndpointName") String interfaceEndpointName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") InterfaceEndpointInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/interfaceEndpoints") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/interfaceEndpoints") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Deletes the specified interface endpoint. - * - * @param resourceGroupName The name of the resource group. - * @param interfaceEndpointName The name of the interface endpoint. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync( - String resourceGroupName, String interfaceEndpointName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (interfaceEndpointName == null) { - return Mono - .error(new IllegalArgumentException("Parameter interfaceEndpointName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - interfaceEndpointName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the specified interface endpoint. - * - * @param resourceGroupName The name of the resource group. - * @param interfaceEndpointName The name of the interface endpoint. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String interfaceEndpointName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (interfaceEndpointName == null) { - return Mono - .error(new IllegalArgumentException("Parameter interfaceEndpointName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - interfaceEndpointName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Deletes the specified interface endpoint. - * - * @param resourceGroupName The name of the resource group. - * @param interfaceEndpointName The name of the interface endpoint. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String interfaceEndpointName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, interfaceEndpointName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deletes the specified interface endpoint. - * - * @param resourceGroupName The name of the resource group. - * @param interfaceEndpointName The name of the interface endpoint. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String interfaceEndpointName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, interfaceEndpointName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes the specified interface endpoint. - * - * @param resourceGroupName The name of the resource group. - * @param interfaceEndpointName The name of the interface endpoint. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete(String resourceGroupName, String interfaceEndpointName) { - return beginDeleteAsync(resourceGroupName, interfaceEndpointName).getSyncPoller(); - } - - /** - * Deletes the specified interface endpoint. - * - * @param resourceGroupName The name of the resource group. - * @param interfaceEndpointName The name of the interface endpoint. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String interfaceEndpointName, Context context) { - return beginDeleteAsync(resourceGroupName, interfaceEndpointName, context).getSyncPoller(); - } - - /** - * Deletes the specified interface endpoint. - * - * @param resourceGroupName The name of the resource group. - * @param interfaceEndpointName The name of the interface endpoint. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String interfaceEndpointName) { - return beginDeleteAsync(resourceGroupName, interfaceEndpointName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified interface endpoint. - * - * @param resourceGroupName The name of the resource group. - * @param interfaceEndpointName The name of the interface endpoint. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String interfaceEndpointName, Context context) { - return beginDeleteAsync(resourceGroupName, interfaceEndpointName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified interface endpoint. - * - * @param resourceGroupName The name of the resource group. - * @param interfaceEndpointName The name of the interface endpoint. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String interfaceEndpointName) { - deleteAsync(resourceGroupName, interfaceEndpointName).block(); - } - - /** - * Deletes the specified interface endpoint. - * - * @param resourceGroupName The name of the resource group. - * @param interfaceEndpointName The name of the interface endpoint. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String interfaceEndpointName, Context context) { - deleteAsync(resourceGroupName, interfaceEndpointName, context).block(); - } - - /** - * Gets the specified interface endpoint by resource group. - * - * @param resourceGroupName The name of the resource group. - * @param interfaceEndpointName The name of the interface endpoint. - * @param expand Expands referenced resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified interface endpoint by resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String interfaceEndpointName, String expand) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (interfaceEndpointName == null) { - return Mono - .error(new IllegalArgumentException("Parameter interfaceEndpointName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - interfaceEndpointName, - apiVersion, - this.client.getSubscriptionId(), - expand, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the specified interface endpoint by resource group. - * - * @param resourceGroupName The name of the resource group. - * @param interfaceEndpointName The name of the interface endpoint. - * @param expand Expands referenced resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified interface endpoint by resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String interfaceEndpointName, String expand, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (interfaceEndpointName == null) { - return Mono - .error(new IllegalArgumentException("Parameter interfaceEndpointName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - interfaceEndpointName, - apiVersion, - this.client.getSubscriptionId(), - expand, - accept, - context); - } - - /** - * Gets the specified interface endpoint by resource group. - * - * @param resourceGroupName The name of the resource group. - * @param interfaceEndpointName The name of the interface endpoint. - * @param expand Expands referenced resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified interface endpoint by resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync( - String resourceGroupName, String interfaceEndpointName, String expand) { - return getByResourceGroupWithResponseAsync(resourceGroupName, interfaceEndpointName, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the specified interface endpoint by resource group. - * - * @param resourceGroupName The name of the resource group. - * @param interfaceEndpointName The name of the interface endpoint. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified interface endpoint by resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync( - String resourceGroupName, String interfaceEndpointName) { - final String expand = null; - return getByResourceGroupWithResponseAsync(resourceGroupName, interfaceEndpointName, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the specified interface endpoint by resource group. - * - * @param resourceGroupName The name of the resource group. - * @param interfaceEndpointName The name of the interface endpoint. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified interface endpoint by resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public InterfaceEndpointInner getByResourceGroup(String resourceGroupName, String interfaceEndpointName) { - final String expand = null; - return getByResourceGroupAsync(resourceGroupName, interfaceEndpointName, expand).block(); - } - - /** - * Gets the specified interface endpoint by resource group. - * - * @param resourceGroupName The name of the resource group. - * @param interfaceEndpointName The name of the interface endpoint. - * @param expand Expands referenced resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified interface endpoint by resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String interfaceEndpointName, String expand, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, interfaceEndpointName, expand, context).block(); - } - - /** - * Creates or updates an interface endpoint in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param interfaceEndpointName The name of the interface endpoint. - * @param parameters Parameters supplied to the create or update interface endpoint operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return interface endpoint resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String interfaceEndpointName, InterfaceEndpointInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (interfaceEndpointName == null) { - return Mono - .error(new IllegalArgumentException("Parameter interfaceEndpointName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - interfaceEndpointName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates an interface endpoint in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param interfaceEndpointName The name of the interface endpoint. - * @param parameters Parameters supplied to the create or update interface endpoint operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return interface endpoint resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String interfaceEndpointName, InterfaceEndpointInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (interfaceEndpointName == null) { - return Mono - .error(new IllegalArgumentException("Parameter interfaceEndpointName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - interfaceEndpointName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Creates or updates an interface endpoint in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param interfaceEndpointName The name of the interface endpoint. - * @param parameters Parameters supplied to the create or update interface endpoint operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return interface endpoint resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, InterfaceEndpointInner> beginCreateOrUpdateAsync( - String resourceGroupName, String interfaceEndpointName, InterfaceEndpointInner parameters) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, interfaceEndpointName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - InterfaceEndpointInner.class, - InterfaceEndpointInner.class, - Context.NONE); - } - - /** - * Creates or updates an interface endpoint in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param interfaceEndpointName The name of the interface endpoint. - * @param parameters Parameters supplied to the create or update interface endpoint operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return interface endpoint resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, InterfaceEndpointInner> beginCreateOrUpdateAsync( - String resourceGroupName, String interfaceEndpointName, InterfaceEndpointInner parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, interfaceEndpointName, parameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - InterfaceEndpointInner.class, - InterfaceEndpointInner.class, - context); - } - - /** - * Creates or updates an interface endpoint in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param interfaceEndpointName The name of the interface endpoint. - * @param parameters Parameters supplied to the create or update interface endpoint operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return interface endpoint resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, InterfaceEndpointInner> beginCreateOrUpdate( - String resourceGroupName, String interfaceEndpointName, InterfaceEndpointInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, interfaceEndpointName, parameters).getSyncPoller(); - } - - /** - * Creates or updates an interface endpoint in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param interfaceEndpointName The name of the interface endpoint. - * @param parameters Parameters supplied to the create or update interface endpoint operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return interface endpoint resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, InterfaceEndpointInner> beginCreateOrUpdate( - String resourceGroupName, String interfaceEndpointName, InterfaceEndpointInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, interfaceEndpointName, parameters, context).getSyncPoller(); - } - - /** - * Creates or updates an interface endpoint in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param interfaceEndpointName The name of the interface endpoint. - * @param parameters Parameters supplied to the create or update interface endpoint operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return interface endpoint resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, String interfaceEndpointName, InterfaceEndpointInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, interfaceEndpointName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates an interface endpoint in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param interfaceEndpointName The name of the interface endpoint. - * @param parameters Parameters supplied to the create or update interface endpoint operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return interface endpoint resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String interfaceEndpointName, InterfaceEndpointInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, interfaceEndpointName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates an interface endpoint in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param interfaceEndpointName The name of the interface endpoint. - * @param parameters Parameters supplied to the create or update interface endpoint operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return interface endpoint resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public InterfaceEndpointInner createOrUpdate( - String resourceGroupName, String interfaceEndpointName, InterfaceEndpointInner parameters) { - return createOrUpdateAsync(resourceGroupName, interfaceEndpointName, parameters).block(); - } - - /** - * Creates or updates an interface endpoint in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param interfaceEndpointName The name of the interface endpoint. - * @param parameters Parameters supplied to the create or update interface endpoint operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return interface endpoint resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public InterfaceEndpointInner createOrUpdate( - String resourceGroupName, String interfaceEndpointName, InterfaceEndpointInner parameters, Context context) { - return createOrUpdateAsync(resourceGroupName, interfaceEndpointName, parameters, context).block(); - } - - /** - * Gets all interface endpoints in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all interface endpoints in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all interface endpoints in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all interface endpoints in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all interface endpoints in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all interface endpoints in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets all interface endpoints in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all interface endpoints in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all interface endpoints in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all interface endpoints in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * Gets all interface endpoints in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all interface endpoints in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * Gets all interface endpoints in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all interface endpoints in a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all interface endpoints in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all interface endpoints in a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all interface endpoints in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all interface endpoints in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>( - () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); - } - - /** - * Gets all interface endpoints in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all interface endpoints in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all interface endpoints in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all interface endpoints in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Gets all interface endpoints in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all interface endpoints in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the ListInterfaceEndpoints API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the ListInterfaceEndpoints API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the ListInterfaceEndpoints API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the ListInterfaceEndpoints API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/Ipv6PeeringConfigImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/Ipv6PeeringConfigImpl.java deleted file mode 100644 index cced822618ca..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/Ipv6PeeringConfigImpl.java +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.resourcemanager.network.fluent.models.RouteFilterInner; -import com.azure.resourcemanager.network.models.ExpressRouteCircuitPeeringConfig; -import com.azure.resourcemanager.network.models.ExpressRouteCrossConnectionPeering; -import com.azure.resourcemanager.network.models.Ipv6ExpressRouteCircuitPeeringConfig; -import com.azure.resourcemanager.network.models.Ipv6PeeringConfig; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.IndexableWrapperImpl; -import java.util.ArrayList; -import java.util.List; - -/** Implementation for Ipv6PeeringConfig. */ -class Ipv6PeeringConfigImpl extends IndexableWrapperImpl - implements Ipv6PeeringConfig, - Ipv6PeeringConfig.Definition, - Ipv6PeeringConfig.UpdateDefinition, - Ipv6PeeringConfig.Update { - private final ExpressRouteCrossConnectionPeeringImpl parent; - - Ipv6PeeringConfigImpl( - Ipv6ExpressRouteCircuitPeeringConfig innerObject, ExpressRouteCrossConnectionPeeringImpl parent) { - super(innerObject); - this.parent = parent; - } - - @Override - public Ipv6PeeringConfigImpl withAdvertisedPublicPrefixes(List publicPrefixes) { - ensureMicrosoftPeeringConfig().withAdvertisedPublicPrefixes(publicPrefixes); - return this; - } - - @Override - public Ipv6PeeringConfigImpl withAdvertisedPublicPrefix(String publicPrefix) { - ExpressRouteCircuitPeeringConfig peeringConfig = ensureMicrosoftPeeringConfig(); - if (peeringConfig.advertisedPublicPrefixes() == null) { - peeringConfig.withAdvertisedPublicPrefixes(new ArrayList()); - } - peeringConfig.advertisedPublicPrefixes().add(publicPrefix); - return this; - } - - @Override - public Ipv6PeeringConfigImpl withPrimaryPeerAddressPrefix(String addressPrefix) { - innerModel().withPrimaryPeerAddressPrefix(addressPrefix); - return this; - } - - @Override - public Ipv6PeeringConfigImpl withSecondaryPeerAddressPrefix(String addressPrefix) { - innerModel().withSecondaryPeerAddressPrefix(addressPrefix); - return this; - } - - @Override - public Ipv6PeeringConfigImpl withCustomerAsn(int customerASN) { - ensureMicrosoftPeeringConfig().withCustomerAsn(customerASN); - return this; - } - - @Override - public Ipv6PeeringConfigImpl withRouteFilter(String routeFilterId) { - innerModel().withRouteFilter(new RouteFilterInner().withId(routeFilterId)); - return this; - } - - @Override - public Ipv6PeeringConfigImpl withoutRouteFilter() { - innerModel().withRouteFilter(null); - return this; - } - - @Override - public Ipv6PeeringConfigImpl withRoutingRegistryName(String routingRegistryName) { - ensureMicrosoftPeeringConfig().withRoutingRegistryName(routingRegistryName); - return this; - } - - private ExpressRouteCircuitPeeringConfig ensureMicrosoftPeeringConfig() { - if (innerModel().microsoftPeeringConfig() == null) { - innerModel().withMicrosoftPeeringConfig(new ExpressRouteCircuitPeeringConfig()); - } - return innerModel().microsoftPeeringConfig(); - } - - @Override - public ExpressRouteCrossConnectionPeeringImpl attach() { - return parent.attachIpv6Config(this); - } - - @Override - public ExpressRouteCrossConnectionPeeringImpl parent() { - return parent; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/LoadBalancerBackendAddressPoolsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/LoadBalancerBackendAddressPoolsClientImpl.java deleted file mode 100644 index 11b7762d4456..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/LoadBalancerBackendAddressPoolsClientImpl.java +++ /dev/null @@ -1,534 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.LoadBalancerBackendAddressPoolsClient; -import com.azure.resourcemanager.network.fluent.models.BackendAddressPoolInner; -import com.azure.resourcemanager.network.models.LoadBalancerBackendAddressPoolListResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in LoadBalancerBackendAddressPoolsClient. */ -public final class LoadBalancerBackendAddressPoolsClientImpl implements LoadBalancerBackendAddressPoolsClient { - private final ClientLogger logger = new ClientLogger(LoadBalancerBackendAddressPoolsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final LoadBalancerBackendAddressPoolsService service; - - /** The service client containing this operation class. */ - private final NetworkManagementClientImpl client; - - /** - * Initializes an instance of LoadBalancerBackendAddressPoolsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - LoadBalancerBackendAddressPoolsClientImpl(NetworkManagementClientImpl client) { - this.service = - RestProxy - .create( - LoadBalancerBackendAddressPoolsService.class, - client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for NetworkManagementClientLoadBalancerBackendAddressPools to be used by - * the proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "NetworkManagementCli") - private interface LoadBalancerBackendAddressPoolsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/loadBalancers/{loadBalancerName}/backendAddressPools") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("loadBalancerName") String loadBalancerName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("loadBalancerName") String loadBalancerName, - @PathParam("backendAddressPoolName") String backendAddressPoolName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets all the load balancer backed address pools. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the load balancer backed address pools. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String loadBalancerName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (loadBalancerName == null) { - return Mono - .error(new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - resourceGroupName, - loadBalancerName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all the load balancer backed address pools. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the load balancer backed address pools. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String loadBalancerName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (loadBalancerName == null) { - return Mono - .error(new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - resourceGroupName, - loadBalancerName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all the load balancer backed address pools. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the load balancer backed address pools. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String resourceGroupName, String loadBalancerName) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, loadBalancerName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets all the load balancer backed address pools. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the load balancer backed address pools. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String loadBalancerName, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, loadBalancerName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all the load balancer backed address pools. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the load balancer backed address pools. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String loadBalancerName) { - return new PagedIterable<>(listAsync(resourceGroupName, loadBalancerName)); - } - - /** - * Gets all the load balancer backed address pools. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the load balancer backed address pools. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, String loadBalancerName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, loadBalancerName, context)); - } - - /** - * Gets load balancer backend address pool. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param backendAddressPoolName The name of the backend address pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return load balancer backend address pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String resourceGroupName, String loadBalancerName, String backendAddressPoolName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (loadBalancerName == null) { - return Mono - .error(new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null.")); - } - if (backendAddressPoolName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter backendAddressPoolName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - resourceGroupName, - loadBalancerName, - backendAddressPoolName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets load balancer backend address pool. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param backendAddressPoolName The name of the backend address pool. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return load balancer backend address pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String loadBalancerName, String backendAddressPoolName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (loadBalancerName == null) { - return Mono - .error(new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null.")); - } - if (backendAddressPoolName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter backendAddressPoolName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - resourceGroupName, - loadBalancerName, - backendAddressPoolName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets load balancer backend address pool. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param backendAddressPoolName The name of the backend address pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return load balancer backend address pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync( - String resourceGroupName, String loadBalancerName, String backendAddressPoolName) { - return getWithResponseAsync(resourceGroupName, loadBalancerName, backendAddressPoolName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets load balancer backend address pool. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param backendAddressPoolName The name of the backend address pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return load balancer backend address pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BackendAddressPoolInner get( - String resourceGroupName, String loadBalancerName, String backendAddressPoolName) { - return getAsync(resourceGroupName, loadBalancerName, backendAddressPoolName).block(); - } - - /** - * Gets load balancer backend address pool. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param backendAddressPoolName The name of the backend address pool. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return load balancer backend address pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String loadBalancerName, String backendAddressPoolName, Context context) { - return getWithResponseAsync(resourceGroupName, loadBalancerName, backendAddressPoolName, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListBackendAddressPool API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListBackendAddressPool API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/LoadBalancerBackendImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/LoadBalancerBackendImpl.java deleted file mode 100644 index 4610589cf8ef..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/LoadBalancerBackendImpl.java +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.SubResource; -import com.azure.resourcemanager.network.models.LoadBalancer; -import com.azure.resourcemanager.network.models.LoadBalancerBackend; -import com.azure.resourcemanager.network.models.LoadBalancingRule; -import com.azure.resourcemanager.network.models.NetworkInterface; -import com.azure.resourcemanager.network.fluent.models.BackendAddressPoolInner; -import com.azure.resourcemanager.network.models.HasNetworkInterfaces; -import com.azure.resourcemanager.network.fluent.models.NetworkInterfaceIpConfigurationInner; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils; -import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.ChildResourceImpl; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; -import java.util.TreeMap; - -/** Implementation for LoadBalancerBackend. */ -class LoadBalancerBackendImpl extends ChildResourceImpl - implements LoadBalancerBackend, - LoadBalancerBackend.Definition, - LoadBalancerBackend.UpdateDefinition, - LoadBalancerBackend.Update { - - LoadBalancerBackendImpl(BackendAddressPoolInner inner, LoadBalancerImpl parent) { - super(inner, parent); - } - - // Getters - - @Override - public Map backendNicIPConfigurationNames() { - // This assumes a NIC can only have one IP config associated with the backend of an LB, - // which is correct at the time of this implementation and seems unlikely to ever change - final Map ipConfigNames = new TreeMap<>(); - if (this.innerModel().backendIpConfigurations() != null) { - for (NetworkInterfaceIpConfigurationInner inner : this.innerModel().backendIpConfigurations()) { - String nicId = ResourceUtils.parentResourceIdFromResourceId(inner.id()); - String ipConfigName = ResourceUtils.nameFromResourceId(inner.id()); - ipConfigNames.put(nicId, ipConfigName); - } - } - - return Collections.unmodifiableMap(ipConfigNames); - } - - @Override - public Map loadBalancingRules() { - final Map rules = new TreeMap<>(); - if (this.innerModel().loadBalancingRules() != null) { - for (SubResource inner : this.innerModel().loadBalancingRules()) { - String name = ResourceUtils.nameFromResourceId(inner.id()); - LoadBalancingRule rule = this.parent().loadBalancingRules().get(name); - if (rule != null) { - rules.put(name, rule); - } - } - } - - return Collections.unmodifiableMap(rules); - } - - @Override - public String name() { - return this.innerModel().name(); - } - - @Override - public Set getVirtualMachineIds() { - Set vmIds = new HashSet<>(); - Map nicConfigs = this.backendNicIPConfigurationNames(); - for (String nicId : nicConfigs.keySet()) { - try { - NetworkInterface nic = this.parent().manager().networkInterfaces().getById(nicId); - if (nic == null || nic.virtualMachineId() == null) { - continue; - } else { - vmIds.add(nic.virtualMachineId()); - } - } catch (ManagementException | IllegalArgumentException e) { - continue; - } - } - - return vmIds; - } - - // Verbs - - @Override - public LoadBalancerImpl attach() { - this.parent().withBackend(this); - return this.parent(); - } - - // Withers - @Override - public LoadBalancerBackendImpl withExistingVirtualMachines(HasNetworkInterfaces... vms) { - return (vms != null) ? this.withExistingVirtualMachines(Arrays.asList(vms)) : this; - } - - @Override - public LoadBalancerBackendImpl withExistingVirtualMachines(Collection vms) { - if (vms != null) { - for (HasNetworkInterfaces vm : vms) { - this.parent().withExistingVirtualMachine(vm, this.name()); - } - } - return this; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/LoadBalancerFrontendImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/LoadBalancerFrontendImpl.java deleted file mode 100644 index 2a98b0ed7506..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/LoadBalancerFrontendImpl.java +++ /dev/null @@ -1,295 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.management.SubResource; -import com.azure.resourcemanager.network.fluent.models.FrontendIpConfigurationInner; -import com.azure.resourcemanager.network.fluent.models.PublicIpAddressInner; -import com.azure.resourcemanager.network.fluent.models.SubnetInner; -import com.azure.resourcemanager.network.models.IpAllocationMethod; -import com.azure.resourcemanager.network.models.LoadBalancer; -import com.azure.resourcemanager.network.models.LoadBalancerFrontend; -import com.azure.resourcemanager.network.models.LoadBalancerInboundNatPool; -import com.azure.resourcemanager.network.models.LoadBalancerInboundNatRule; -import com.azure.resourcemanager.network.models.LoadBalancerOutboundRule; -import com.azure.resourcemanager.network.models.LoadBalancerPrivateFrontend; -import com.azure.resourcemanager.network.models.LoadBalancerPublicFrontend; -import com.azure.resourcemanager.network.models.LoadBalancingRule; -import com.azure.resourcemanager.network.models.Network; -import com.azure.resourcemanager.network.models.PublicIpAddress; -import com.azure.resourcemanager.network.models.Subnet; -import com.azure.resourcemanager.resources.fluentcore.arm.AvailabilityZoneId; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils; -import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.ChildResourceImpl; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import reactor.core.publisher.Mono; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; -import java.util.TreeMap; - -/** Implementation for LoadBalancerPublicFrontend. */ -class LoadBalancerFrontendImpl extends ChildResourceImpl - implements LoadBalancerFrontend, - LoadBalancerPrivateFrontend, - LoadBalancerPrivateFrontend.Definition, - LoadBalancerPrivateFrontend.UpdateDefinition, - LoadBalancerPrivateFrontend.Update, - LoadBalancerPublicFrontend, - LoadBalancerPublicFrontend.Definition, - LoadBalancerPublicFrontend.UpdateDefinition, - LoadBalancerPublicFrontend.Update { - - LoadBalancerFrontendImpl(FrontendIpConfigurationInner inner, LoadBalancerImpl parent) { - super(inner, parent); - } - - // Getters - - @Override - public String networkId() { - SubResource subnetRef = this.innerModel().subnet(); - if (subnetRef != null) { - return ResourceUtils.parentResourceIdFromResourceId(subnetRef.id()); - } else { - return null; - } - } - - @Override - public String subnetName() { - SubResource subnetRef = this.innerModel().subnet(); - if (subnetRef != null) { - return ResourceUtils.nameFromResourceId(subnetRef.id()); - } else { - return null; - } - } - - @Override - public String privateIpAddress() { - return this.innerModel().privateIpAddress(); - } - - @Override - public IpAllocationMethod privateIpAllocationMethod() { - return this.innerModel().privateIpAllocationMethod(); - } - - @Override - public String name() { - return this.innerModel().name(); - } - - @Override - public String publicIpAddressId() { - return this.innerModel().publicIpAddress().id(); - } - - @Override - public boolean isPublic() { - return (this.innerModel().publicIpAddress() != null); - } - - @Override - public Map loadBalancingRules() { - final Map rules = new TreeMap<>(); - if (this.innerModel().loadBalancingRules() != null) { - for (SubResource innerRef : this.innerModel().loadBalancingRules()) { - String name = ResourceUtils.nameFromResourceId(innerRef.id()); - LoadBalancingRule rule = this.parent().loadBalancingRules().get(name); - if (rule != null) { - rules.put(name, rule); - } - } - } - - return Collections.unmodifiableMap(rules); - } - - @Override - public Map inboundNatPools() { - final Map pools = new TreeMap<>(); - if (this.innerModel().inboundNatPools() != null) { - for (SubResource innerRef : this.innerModel().inboundNatPools()) { - String name = ResourceUtils.nameFromResourceId(innerRef.id()); - LoadBalancerInboundNatPool pool = this.parent().inboundNatPools().get(name); - if (pool != null) { - pools.put(name, pool); - } - } - } - - return Collections.unmodifiableMap(pools); - } - - @Override - public Map inboundNatRules() { - final Map rules = new TreeMap<>(); - if (this.innerModel().inboundNatRules() != null) { - for (SubResource innerRef : this.innerModel().inboundNatRules()) { - String name = ResourceUtils.nameFromResourceId(innerRef.id()); - LoadBalancerInboundNatRule rule = this.parent().inboundNatRules().get(name); - if (rule != null) { - rules.put(name, rule); - } - } - } - - return Collections.unmodifiableMap(rules); - } - - @Override - public Map outboundRules() { - final Map rules = new TreeMap<>(); - if (this.innerModel().outboundRules() != null) { - for (SubResource innerRef : this.innerModel().outboundRules()) { - String name = ResourceUtils.nameFromResourceId(innerRef.id()); - LoadBalancerOutboundRule rule = this.parent().outboundRules().get(name); - if (rule != null) { - rules.put(name, rule); - } - } - } - - return Collections.unmodifiableMap(rules); - } - - // Fluent setters - - @Override - public LoadBalancerFrontendImpl withExistingSubnet(Network network, String subnetName) { - return this.withExistingSubnet(network.id(), subnetName); - } - - @Override - public LoadBalancerFrontendImpl withExistingSubnet(String parentNetworkResourceId, String subnetName) { - SubnetInner subnetRef = new SubnetInner(); - subnetRef.withId(parentNetworkResourceId + "/subnets/" + subnetName); - this - .innerModel() - .withSubnet(subnetRef) - .withPublicIpAddress(null); // Ensure no conflicting public and private settings - return this; - } - - @Override - public LoadBalancerFrontendImpl withAvailabilityZone(AvailabilityZoneId zoneId) { - // Note: Zone is not updatable as of now, so this is available only during definition time. - // Service return `ResourceAvailabilityZonesCannotBeModified` upon attempt to append a new - // zone or remove one. Trying to remove the last one means attempt to change resource from - // zonal to regional, which is not supported. - // - // Zone is supported only for internal load balancer, hence exposed only for PrivateFrontEnd - // - if (this.innerModel().zones() == null) { - this.innerModel().withZones(new ArrayList()); - } - this.innerModel().zones().add(zoneId.toString()); - return this; - } - - @Override - public LoadBalancerFrontendImpl withExistingPublicIpAddress(PublicIpAddress pip) { - return this.withExistingPublicIpAddress(pip.id()); - } - - @Override - public LoadBalancerFrontendImpl withExistingPublicIpAddress(String resourceId) { - PublicIpAddressInner pipRef = new PublicIpAddressInner().withId(resourceId); - this - .innerModel() - .withPublicIpAddress(pipRef) - - // Ensure no conflicting public and private settings - .withSubnet(null) - .withPrivateIpAddress(null) - .withPrivateIpAllocationMethod(null); - return this; - } - - @Override - public LoadBalancerFrontendImpl withoutPublicIpAddress() { - this.innerModel().withPublicIpAddress(null); - return this; - } - - @Override - public LoadBalancerFrontendImpl withPrivateIpAddressDynamic() { - this - .innerModel() - .withPrivateIpAddress(null) - .withPrivateIpAllocationMethod(IpAllocationMethod.DYNAMIC) - - // Ensure no conflicting public and private settings - .withPublicIpAddress(null); - return this; - } - - @Override - public LoadBalancerFrontendImpl withPrivateIpAddressStatic(String ipAddress) { - this - .innerModel() - .withPrivateIpAddress(ipAddress) - .withPrivateIpAllocationMethod(IpAllocationMethod.STATIC) - - // Ensure no conflicting public and private settings - .withPublicIpAddress(null); - return this; - } - - @Override - public LoadBalancerFrontendImpl withNewPublicIpAddress(String leafDnsLabel) { - this.parent().withNewPublicIPAddress(leafDnsLabel, this.name()); - return this; - } - - @Override - public LoadBalancerFrontendImpl withNewPublicIpAddress(Creatable creatable) { - this.parent().withNewPublicIPAddress(creatable, this.name()); - return this; - } - - @Override - public LoadBalancerFrontendImpl withNewPublicIpAddress() { - String dnsLabel = this.parent().manager().resourceManager().internalContext().randomResourceName("fe", 20); - return this.withNewPublicIpAddress(dnsLabel); - } - - // Verbs - - @Override - public LoadBalancerImpl attach() { - return this.parent().withFrontend(this); - } - - @Override - public PublicIpAddress getPublicIpAddress() { - return this.getPublicIpAddressAsync().block(); - } - - @Override - public Mono getPublicIpAddressAsync() { - String pipId = this.publicIpAddressId(); - return pipId == null ? Mono.empty() : this.parent().manager().publicIpAddresses().getByIdAsync(pipId); - } - - @Override - public Subnet getSubnet() { - return Utils.getAssociatedSubnet(this.parent().manager(), this.innerModel().subnet()); - } - - @Override - public Set availabilityZones() { - Set zones = new HashSet<>(); - if (this.innerModel().zones() != null) { - for (String zone : this.innerModel().zones()) { - zones.add(AvailabilityZoneId.fromString(zone)); - } - } - return Collections.unmodifiableSet(zones); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/LoadBalancerFrontendIpConfigurationsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/LoadBalancerFrontendIpConfigurationsClientImpl.java deleted file mode 100644 index 38a2e658e3c0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/LoadBalancerFrontendIpConfigurationsClientImpl.java +++ /dev/null @@ -1,541 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.LoadBalancerFrontendIpConfigurationsClient; -import com.azure.resourcemanager.network.fluent.models.FrontendIpConfigurationInner; -import com.azure.resourcemanager.network.models.LoadBalancerFrontendIpConfigurationListResult; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in - * LoadBalancerFrontendIpConfigurationsClient. - */ -public final class LoadBalancerFrontendIpConfigurationsClientImpl - implements LoadBalancerFrontendIpConfigurationsClient { - private final ClientLogger logger = new ClientLogger(LoadBalancerFrontendIpConfigurationsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final LoadBalancerFrontendIpConfigurationsService service; - - /** The service client containing this operation class. */ - private final NetworkManagementClientImpl client; - - /** - * Initializes an instance of LoadBalancerFrontendIpConfigurationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - LoadBalancerFrontendIpConfigurationsClientImpl(NetworkManagementClientImpl client) { - this.service = - RestProxy - .create( - LoadBalancerFrontendIpConfigurationsService.class, - client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for NetworkManagementClientLoadBalancerFrontendIpConfigurations to be - * used by the proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "NetworkManagementCli") - private interface LoadBalancerFrontendIpConfigurationsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/loadBalancers/{loadBalancerName}/frontendIPConfigurations") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("loadBalancerName") String loadBalancerName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/loadBalancers/{loadBalancerName}/frontendIPConfigurations/{frontendIPConfigurationName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("loadBalancerName") String loadBalancerName, - @PathParam("frontendIPConfigurationName") String frontendIpConfigurationName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets all the load balancer frontend IP configurations. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the load balancer frontend IP configurations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String loadBalancerName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (loadBalancerName == null) { - return Mono - .error(new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - resourceGroupName, - loadBalancerName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all the load balancer frontend IP configurations. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the load balancer frontend IP configurations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String loadBalancerName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (loadBalancerName == null) { - return Mono - .error(new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - resourceGroupName, - loadBalancerName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all the load balancer frontend IP configurations. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the load balancer frontend IP configurations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String resourceGroupName, String loadBalancerName) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, loadBalancerName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets all the load balancer frontend IP configurations. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the load balancer frontend IP configurations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String loadBalancerName, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, loadBalancerName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all the load balancer frontend IP configurations. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the load balancer frontend IP configurations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String loadBalancerName) { - return new PagedIterable<>(listAsync(resourceGroupName, loadBalancerName)); - } - - /** - * Gets all the load balancer frontend IP configurations. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the load balancer frontend IP configurations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, String loadBalancerName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, loadBalancerName, context)); - } - - /** - * Gets load balancer frontend IP configuration. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param frontendIpConfigurationName The name of the frontend IP configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return load balancer frontend IP configuration. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String resourceGroupName, String loadBalancerName, String frontendIpConfigurationName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (loadBalancerName == null) { - return Mono - .error(new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null.")); - } - if (frontendIpConfigurationName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter frontendIpConfigurationName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - resourceGroupName, - loadBalancerName, - frontendIpConfigurationName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets load balancer frontend IP configuration. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param frontendIpConfigurationName The name of the frontend IP configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return load balancer frontend IP configuration. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String loadBalancerName, String frontendIpConfigurationName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (loadBalancerName == null) { - return Mono - .error(new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null.")); - } - if (frontendIpConfigurationName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter frontendIpConfigurationName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - resourceGroupName, - loadBalancerName, - frontendIpConfigurationName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets load balancer frontend IP configuration. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param frontendIpConfigurationName The name of the frontend IP configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return load balancer frontend IP configuration. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync( - String resourceGroupName, String loadBalancerName, String frontendIpConfigurationName) { - return getWithResponseAsync(resourceGroupName, loadBalancerName, frontendIpConfigurationName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets load balancer frontend IP configuration. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param frontendIpConfigurationName The name of the frontend IP configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return load balancer frontend IP configuration. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public FrontendIpConfigurationInner get( - String resourceGroupName, String loadBalancerName, String frontendIpConfigurationName) { - return getAsync(resourceGroupName, loadBalancerName, frontendIpConfigurationName).block(); - } - - /** - * Gets load balancer frontend IP configuration. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param frontendIpConfigurationName The name of the frontend IP configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return load balancer frontend IP configuration. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String loadBalancerName, String frontendIpConfigurationName, Context context) { - return getWithResponseAsync(resourceGroupName, loadBalancerName, frontendIpConfigurationName, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListFrontendIPConfiguration API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListFrontendIPConfiguration API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/LoadBalancerImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/LoadBalancerImpl.java deleted file mode 100644 index 017108ce203b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/LoadBalancerImpl.java +++ /dev/null @@ -1,920 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.network.fluent.models.BackendAddressPoolInner; -import com.azure.resourcemanager.network.fluent.models.FrontendIpConfigurationInner; -import com.azure.resourcemanager.network.fluent.models.InboundNatRuleInner; -import com.azure.resourcemanager.network.fluent.models.LoadBalancerInner; -import com.azure.resourcemanager.network.fluent.models.LoadBalancingRuleInner; -import com.azure.resourcemanager.network.fluent.models.OutboundRuleInner; -import com.azure.resourcemanager.network.fluent.models.ProbeInner; -import com.azure.resourcemanager.network.models.HasNetworkInterfaces; -import com.azure.resourcemanager.network.models.InboundNatPool; -import com.azure.resourcemanager.network.models.LoadBalancer; -import com.azure.resourcemanager.network.models.LoadBalancerBackend; -import com.azure.resourcemanager.network.models.LoadBalancerFrontend; -import com.azure.resourcemanager.network.models.LoadBalancerHttpProbe; -import com.azure.resourcemanager.network.models.LoadBalancerInboundNatPool; -import com.azure.resourcemanager.network.models.LoadBalancerInboundNatRule; -import com.azure.resourcemanager.network.models.LoadBalancerOutboundRule; -import com.azure.resourcemanager.network.models.LoadBalancerPrivateFrontend; -import com.azure.resourcemanager.network.models.LoadBalancerProbe; -import com.azure.resourcemanager.network.models.LoadBalancerPublicFrontend; -import com.azure.resourcemanager.network.models.LoadBalancerSkuType; -import com.azure.resourcemanager.network.models.LoadBalancerTcpProbe; -import com.azure.resourcemanager.network.models.LoadBalancingRule; -import com.azure.resourcemanager.network.models.NicIpConfiguration; -import com.azure.resourcemanager.network.models.ProbeProtocol; -import com.azure.resourcemanager.network.models.PublicIpAddress; -import com.azure.resourcemanager.network.models.TagsObject; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import reactor.core.Exceptions; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.Map.Entry; -import java.util.TreeMap; -import java.util.stream.Collectors; - -/** - * Implementation of the LoadBalancer interface. - */ -class LoadBalancerImpl - extends GroupableParentResourceWithTagsImpl - implements LoadBalancer, LoadBalancer.Definition, LoadBalancer.Update { - - private final ClientLogger logger = new ClientLogger(getClass()); - private final Map nicsInBackends = new HashMap<>(); - protected final Map creatablePIPKeys = new HashMap<>(); - - private Map backends; - private Map tcpProbes; - private Map httpProbes; - private Map httpsProbes; - private Map loadBalancingRules; - private Map frontends; - private Map inboundNatRules; - private Map inboundNatPools; - private Map outboundRules; - - LoadBalancerImpl(String name, final LoadBalancerInner innerModel, final NetworkManager networkManager) { - super(name, innerModel, networkManager); - } - - // Verbs - - @Override - public Mono refreshAsync() { - return super - .refreshAsync() - .map( - loadBalancer -> { - LoadBalancerImpl impl = (LoadBalancerImpl) loadBalancer; - impl.initializeChildrenFromInner(); - return impl; - }); - } - - @Override - protected Mono getInnerAsync() { - return this - .manager() - .serviceClient() - .getLoadBalancers() - .getByResourceGroupAsync(this.resourceGroupName(), this.name()); - } - - @Override - protected Mono applyTagsToInnerAsync() { - return this - .manager() - .serviceClient() - .getLoadBalancers() - .updateTagsAsync(resourceGroupName(), name(), new TagsObject().withTags(innerModel().tags())); - } - - // Helpers - - @Override - protected void initializeChildrenFromInner() { - initializeFrontendsFromInner(); - initializeProbesFromInner(); - initializeBackendsFromInner(); - initializeLoadBalancingRulesFromInner(); - initializeInboundNatRulesFromInner(); - initializeInboundNatPoolsFromInner(); - initializeOutboundRulesFromInner(); - } - - protected LoadBalancerBackendImpl ensureUniqueBackend() { - String name = this.manager().resourceManager().internalContext().randomResourceName("backend", 20); - LoadBalancerBackendImpl backend = this.defineBackend(name); - backend.attach(); - return backend; - } - - protected SubResource ensureFrontendRef(String name) { - // Ensure existence of frontend, creating one if needed - LoadBalancerFrontendImpl frontend; - if (name == null) { - frontend = this.ensureUniqueFrontend(); - } else { - frontend = this.defineFrontend(name); - frontend.attach(); - } - - // Return frontend reference - return new SubResource().withId(this.futureResourceId() + "/frontendIpConfigurations/" + frontend.name()); - } - - protected LoadBalancerFrontendImpl ensureUniqueFrontend() { - String name = this.manager().resourceManager().internalContext().randomResourceName("frontend", 20); - LoadBalancerFrontendImpl frontend = this.defineFrontend(name); - frontend.attach(); - return frontend; - } - - LoadBalancerPrivateFrontend findPrivateFrontendWithSubnet(String networkId, String subnetName) { - if (null == networkId || null == subnetName) { - return null; - } else { - // Use existing frontend already pointing at this PIP, if any - for (LoadBalancerPrivateFrontend frontend : this.privateFrontends().values()) { - if (frontend.networkId() == null || frontend.subnetName() == null) { - continue; - } else if (networkId.equalsIgnoreCase(frontend.networkId()) - && subnetName.equalsIgnoreCase(frontend.subnetName())) { - return frontend; - } - } - - return null; - } - } - - LoadBalancerPrivateFrontend ensurePrivateFrontendWithSubnet(String networkId, String subnetName) { - LoadBalancerPrivateFrontend frontend = this.findPrivateFrontendWithSubnet(networkId, subnetName); - if (networkId == null || subnetName == null) { - return null; - } else if (frontend != null) { - return frontend; - } else { - // Create new frontend - LoadBalancerFrontendImpl fe = - this.ensureUniqueFrontend().withExistingSubnet(networkId, subnetName).withPrivateIpAddressDynamic(); - fe.attach(); - return fe; - } - } - - LoadBalancerPublicFrontend ensurePublicFrontendWithPip(String pipId) { - LoadBalancerPublicFrontend frontend = this.findFrontendByPublicIpAddress(pipId); - if (pipId == null) { - return null; - } else if (frontend != null) { - return frontend; - } else { - // Create new frontend - LoadBalancerFrontendImpl fe = this.ensureUniqueFrontend().withExistingPublicIpAddress(pipId); - fe.attach(); - return fe; - } - } - - @Override - protected void beforeCreating() { - // Account for the newly created public IPs - if (this.creatablePIPKeys != null) { - for (Entry pipFrontendAssociation : this.creatablePIPKeys.entrySet()) { - PublicIpAddress pip = this.taskResult(pipFrontendAssociation.getKey()); - if (pip != null) { - withExistingPublicIPAddress(pip.id(), pipFrontendAssociation.getValue()); - } - } - this.creatablePIPKeys.clear(); - } - - // Reset and update probes - List innerProbes = innersFromWrappers(this.httpProbes.values()); - innerProbes = innersFromWrappers(this.httpsProbes.values(), innerProbes); - innerProbes = innersFromWrappers(this.tcpProbes.values(), innerProbes); - if (innerProbes == null) { - innerProbes = new ArrayList<>(); - } - this.innerModel().withProbes(innerProbes); - - // Reset and update backends - List innerBackends = innersFromWrappers(this.backends.values()); - if (null == innerBackends) { - innerBackends = new ArrayList<>(); - } - this.innerModel().withBackendAddressPools(innerBackends); - - // Reset and update frontends - List innerFrontends = innersFromWrappers(this.frontends.values()); - if (null == innerFrontends) { - innerFrontends = new ArrayList<>(); - } - this.innerModel().withFrontendIpConfigurations(innerFrontends); - - // Reset and update inbound NAT rules - List innerNatRules = innersFromWrappers(this.inboundNatRules.values()); - if (null == innerNatRules) { - innerNatRules = new ArrayList<>(); - } - this.innerModel().withInboundNatRules(innerNatRules); - - for (LoadBalancerInboundNatRule natRule : this.inboundNatRules.values()) { - // Clear deleted frontend references - SubResource ref = natRule.innerModel().frontendIpConfiguration(); - if (ref != null && !this.frontends().containsKey(ResourceUtils.nameFromResourceId(ref.id()))) { - natRule.innerModel().withFrontendIpConfiguration(null); - } - } - - // Reset and update inbound NAT pools - List innerNatPools = innersFromWrappers(this.inboundNatPools.values()); - if (null == innerNatPools) { - innerNatPools = new ArrayList<>(); - } - this.innerModel().withInboundNatPools(innerNatPools); - for (LoadBalancerInboundNatPool natPool : this.inboundNatPools.values()) { - // Clear deleted frontend references - SubResource ref = natPool.innerModel().frontendIpConfiguration(); - if (ref != null && !this.frontends().containsKey(ResourceUtils.nameFromResourceId(ref.id()))) { - natPool.innerModel().withFrontendIpConfiguration(null); - } - } - - // Reset and update outbound rules - List innerOutboundRules = innersFromWrappers(this.outboundRules.values()); - if (null == innerOutboundRules) { - innerOutboundRules = new ArrayList<>(); - } - this.innerModel().withOutboundRules(innerOutboundRules); - - for (LoadBalancerOutboundRule outboundRule : this.outboundRules.values()) { - // Clear deleted frontend references - List refs = outboundRule.innerModel().frontendIpConfigurations(); - if (refs != null && !refs.isEmpty()) { - List existingFrontendIpConfigurations = - refs.stream() - .filter(ref -> - this.frontends().containsKey(ResourceUtils.nameFromResourceId(ref.id())) - ) - .collect(Collectors.toList()); - existingFrontendIpConfigurations = existingFrontendIpConfigurations.isEmpty() ? null : existingFrontendIpConfigurations; - outboundRule.innerModel().withFrontendIpConfigurations(existingFrontendIpConfigurations); - } - // clear deleted backend references - SubResource ref = outboundRule.innerModel().backendAddressPool(); - if (ref != null && !this.backends().containsKey(ResourceUtils.nameFromResourceId(ref.id()))) { - outboundRule.innerModel().withBackendAddressPool(null); - } - } - - // Reset and update load balancing rules - List innerRules = innersFromWrappers(this.loadBalancingRules.values()); - if (innerRules == null) { - innerRules = new ArrayList<>(); - } - this.innerModel().withLoadBalancingRules(innerRules); - for (LoadBalancingRule lbRule : this.loadBalancingRules.values()) { - SubResource ref; - - // Clear deleted frontend references - ref = lbRule.innerModel().frontendIpConfiguration(); - if (ref != null && !this.frontends().containsKey(ResourceUtils.nameFromResourceId(ref.id()))) { - lbRule.innerModel().withFrontendIpConfiguration(null); - } - - // Clear deleted backend references - ref = lbRule.innerModel().backendAddressPool(); - if (ref != null && !this.backends().containsKey(ResourceUtils.nameFromResourceId(ref.id()))) { - lbRule.innerModel().withBackendAddressPool(null); - } - - // Clear deleted probe references - ref = lbRule.innerModel().probe(); - if (ref != null - && !this.httpProbes().containsKey(ResourceUtils.nameFromResourceId(ref.id())) - && !this.httpsProbes().containsKey(ResourceUtils.nameFromResourceId(ref.id())) - && !this.tcpProbes().containsKey(ResourceUtils.nameFromResourceId(ref.id()))) { - lbRule.innerModel().withProbe(null); - } - } - } - - protected Mono afterCreatingAsync() { - if (this.nicsInBackends != null) { - List nicExceptions = new ArrayList<>(); - - return Flux - .fromIterable(this.nicsInBackends.entrySet()) - .flatMap( - nicInBackend -> { - String nicId = nicInBackend.getKey(); - String backendName = nicInBackend.getValue(); - return this - .manager() - .networkInterfaces() - .getByIdAsync(nicId) - .flatMap( - nic -> { - NicIpConfiguration nicIP = nic.primaryIPConfiguration(); - return nic - .update() - .updateIPConfiguration(nicIP.name()) - .withExistingLoadBalancerBackend(this, backendName) - .parent() - .applyAsync(); - }); - }) - .onErrorResume( - t -> { - nicExceptions.add(t); - return Mono.empty(); - }) - .then( - Mono - .defer( - () -> { - if (!nicExceptions.isEmpty()) { - return Mono.error(Exceptions.multiple(nicExceptions)); - } else { - this.nicsInBackends.clear(); - return Mono.empty(); - } - })); - } - return Mono.empty(); - } - - @Override - protected Mono createInner() { - return this - .manager() - .serviceClient() - .getLoadBalancers() - .createOrUpdateAsync(this.resourceGroupName(), this.name(), this.innerModel()); - } - - @Override - public Mono createResourceAsync() { - beforeCreating(); - return createInner() - .flatMap( - inner -> { - setInner(inner); - initializeChildrenFromInner(); - return afterCreatingAsync().then(this.refreshAsync()); - }); - } - - private void initializeFrontendsFromInner() { - this.frontends = new TreeMap<>(); - List frontendsInner = this.innerModel().frontendIpConfigurations(); - if (frontendsInner != null) { - for (FrontendIpConfigurationInner frontendInner : frontendsInner) { - LoadBalancerFrontendImpl frontend = new LoadBalancerFrontendImpl(frontendInner, this); - this.frontends.put(frontendInner.name(), frontend); - } - } - } - - private void initializeBackendsFromInner() { - this.backends = new TreeMap<>(); - List backendsInner = this.innerModel().backendAddressPools(); - if (backendsInner != null) { - for (BackendAddressPoolInner backendInner : backendsInner) { - LoadBalancerBackendImpl backend = new LoadBalancerBackendImpl(backendInner, this); - this.backends.put(backendInner.name(), backend); - } - } - } - - private void initializeProbesFromInner() { - this.httpProbes = new TreeMap<>(); - this.httpsProbes = new TreeMap<>(); - this.tcpProbes = new TreeMap<>(); - if (this.innerModel().probes() != null) { - for (ProbeInner probeInner : this.innerModel().probes()) { - LoadBalancerProbeImpl probe = new LoadBalancerProbeImpl(probeInner, this); - if (probeInner.protocol().equals(ProbeProtocol.TCP)) { - this.tcpProbes.put(probeInner.name(), probe); - } else if (probeInner.protocol().equals(ProbeProtocol.HTTP)) { - this.httpProbes.put(probeInner.name(), probe); - } else if (probeInner.protocol().equals(ProbeProtocol.HTTPS)) { - this.httpsProbes.put(probeInner.name(), probe); - } - } - } - } - - private void initializeLoadBalancingRulesFromInner() { - this.loadBalancingRules = new TreeMap<>(); - List rulesInner = this.innerModel().loadBalancingRules(); - if (rulesInner != null) { - for (LoadBalancingRuleInner ruleInner : rulesInner) { - LoadBalancingRuleImpl rule = new LoadBalancingRuleImpl(ruleInner, this); - this.loadBalancingRules.put(ruleInner.name(), rule); - } - } - } - - private void initializeInboundNatPoolsFromInner() { - this.inboundNatPools = new TreeMap<>(); - List inners = this.innerModel().inboundNatPools(); - if (inners != null) { - for (InboundNatPool inner : inners) { - LoadBalancerInboundNatPoolImpl wrapper = new LoadBalancerInboundNatPoolImpl(inner, this); - this.inboundNatPools.put(wrapper.name(), wrapper); - } - } - } - - private void initializeInboundNatRulesFromInner() { - this.inboundNatRules = new TreeMap<>(); - List rulesInner = this.innerModel().inboundNatRules(); - if (rulesInner != null) { - for (InboundNatRuleInner ruleInner : rulesInner) { - LoadBalancerInboundNatRuleImpl rule = new LoadBalancerInboundNatRuleImpl(ruleInner, this); - this.inboundNatRules.put(ruleInner.name(), rule); - } - } - } - - private void initializeOutboundRulesFromInner() { - this.outboundRules = new TreeMap<>(); - List rulesInner = this.innerModel().outboundRules(); - if (rulesInner != null) { - for (OutboundRuleInner ruleInner : rulesInner) { - LoadBalancerOutboundRule rule = new LoadBalancerOutboundRuleImpl(ruleInner, this); - this.outboundRules.put(ruleInner.name(), rule); - } - } - } - - String futureResourceId() { - return new StringBuilder() - .append(super.resourceIdBase()) - .append("/providers/Microsoft.Network/loadBalancers/") - .append(this.name()) - .toString(); - } - - LoadBalancerImpl withFrontend(LoadBalancerFrontendImpl frontend) { - if (frontend != null) { - this.frontends.put(frontend.name(), frontend); - } - return this; - } - - LoadBalancerImpl withProbe(LoadBalancerProbeImpl probe) { - if (probe == null) { - return this; - } else if (probe.protocol() == ProbeProtocol.HTTP) { - httpProbes.put(probe.name(), probe); - } else if (probe.protocol() == ProbeProtocol.HTTPS) { - httpsProbes.put(probe.name(), probe); - } else if (probe.protocol() == ProbeProtocol.TCP) { - tcpProbes.put(probe.name(), probe); - } - return this; - } - - LoadBalancerImpl withLoadBalancingRule(LoadBalancingRuleImpl loadBalancingRule) { - if (loadBalancingRule != null) { - this.loadBalancingRules.put(loadBalancingRule.name(), loadBalancingRule); - } - return this; - } - - LoadBalancerImpl withInboundNatRule(LoadBalancerInboundNatRuleImpl inboundNatRule) { - if (inboundNatRule != null) { - this.inboundNatRules.put(inboundNatRule.name(), inboundNatRule); - } - return this; - } - - LoadBalancerImpl withInboundNatPool(LoadBalancerInboundNatPoolImpl inboundNatPool) { - if (inboundNatPool != null) { - this.inboundNatPools.put(inboundNatPool.name(), inboundNatPool); - } - return this; - } - - LoadBalancerImpl withOutboundRule(LoadBalancerOutboundRuleImpl outboundRule) { - if (outboundRule != null) { - this.outboundRules.put(outboundRule.name(), outboundRule); - } - return this; - } - - LoadBalancerImpl withBackend(LoadBalancerBackendImpl backend) { - if (backend != null) { - this.backends.put(backend.name(), backend); - } - return this; - } - - // Withers (fluent) - - LoadBalancerImpl withNewPublicIPAddress(String dnsLeafLabel, String frontendName) { - PublicIpAddress.DefinitionStages.WithGroup precreatablePIP = - manager().publicIpAddresses().define(dnsLeafLabel).withRegion(this.regionName()); - Creatable creatablePip; - if (super.creatableGroup == null) { - creatablePip = - precreatablePIP.withExistingResourceGroup(this.resourceGroupName()).withLeafDomainLabel(dnsLeafLabel); - } else { - creatablePip = precreatablePIP.withNewResourceGroup(super.creatableGroup).withLeafDomainLabel(dnsLeafLabel); - } - return withNewPublicIPAddress(creatablePip, frontendName); - } - - LoadBalancerImpl withNewPublicIPAddress(Creatable creatablePip, String frontendName) { - String existingPipFrontendName = this.creatablePIPKeys.get(creatablePip.key()); - if (frontendName == null) { - if (existingPipFrontendName != null) { - // Reuse frontend already associated with this PIP - frontendName = existingPipFrontendName; - } else { - // Auto-named unique frontend - frontendName = ensureUniqueFrontend().name(); - } - } - - if (existingPipFrontendName == null) { - // No frontend associated with this PIP yet so create new association - this.creatablePIPKeys.put(this.addDependency(creatablePip), frontendName); - } else if (!existingPipFrontendName.equalsIgnoreCase(frontendName)) { - // Existing PIP definition already in use but under a different frontend, so error - String exceptionMessage = - "This public IP address definition is already associated with a frontend under a different name."; - throw logger.logExceptionAsError(new IllegalArgumentException(exceptionMessage)); - } - - return this; - } - - protected LoadBalancerImpl withExistingPublicIPAddress(String resourceId, String frontendName) { - if (frontendName == null) { - return ensureUniqueFrontend().withExistingPublicIpAddress(resourceId).parent(); - } else { - return this.definePublicFrontend(frontendName).withExistingPublicIpAddress(resourceId).attach(); - } - } - - LoadBalancerImpl withExistingVirtualMachine(HasNetworkInterfaces vm, String backendName) { - if (backendName != null) { - this.defineBackend(backendName).attach(); - if (vm.primaryNetworkInterfaceId() != null) { - this.nicsInBackends.put(vm.primaryNetworkInterfaceId(), backendName.toLowerCase(Locale.ROOT)); - } - } - return this; - } - - @Override - public LoadBalancerProbeImpl defineTcpProbe(String name) { - LoadBalancerProbe probe = this.tcpProbes.get(name); - if (probe == null) { - ProbeInner inner = new ProbeInner().withName(name).withProtocol(ProbeProtocol.TCP); - return new LoadBalancerProbeImpl(inner, this); - } else { - return (LoadBalancerProbeImpl) probe; - } - } - - @Override - public LoadBalancerProbeImpl defineHttpProbe(String name) { - LoadBalancerProbe probe = this.httpProbes.get(name); - if (probe == null) { - ProbeInner inner = new ProbeInner().withName(name).withProtocol(ProbeProtocol.HTTP).withPort(80); - return new LoadBalancerProbeImpl(inner, this); - } else { - return (LoadBalancerProbeImpl) probe; - } - } - - @Override - public LoadBalancerProbeImpl defineHttpsProbe(String name) { - LoadBalancerProbe probe = this.httpsProbes.get(name); - if (probe == null) { - ProbeInner inner = new ProbeInner().withName(name).withProtocol(ProbeProtocol.HTTPS).withPort(443); - return new LoadBalancerProbeImpl(inner, this); - } else { - return (LoadBalancerProbeImpl) probe; - } - } - - @Override - public LoadBalancingRuleImpl defineLoadBalancingRule(String name) { - LoadBalancingRule lbRule = this.loadBalancingRules.get(name); - if (lbRule == null) { - LoadBalancingRuleInner inner = new LoadBalancingRuleInner().withName(name); - return new LoadBalancingRuleImpl(inner, this); - } else { - return (LoadBalancingRuleImpl) lbRule; - } - } - - @Override - public LoadBalancerInboundNatRuleImpl defineInboundNatRule(String name) { - LoadBalancerInboundNatRule natRule = this.inboundNatRules.get(name); - if (natRule == null) { - InboundNatRuleInner inner = new InboundNatRuleInner().withName(name); - return new LoadBalancerInboundNatRuleImpl(inner, this); - } else { - return (LoadBalancerInboundNatRuleImpl) natRule; - } - } - - @Override - public LoadBalancerInboundNatPoolImpl defineInboundNatPool(String name) { - LoadBalancerInboundNatPool natPool = this.inboundNatPools.get(name); - if (natPool == null) { - InboundNatPool inner = new InboundNatPool().withName(name); - return new LoadBalancerInboundNatPoolImpl(inner, this); - } else { - return (LoadBalancerInboundNatPoolImpl) natPool; - } - } - - @Override - public LoadBalancerFrontendImpl definePrivateFrontend(String name) { - return defineFrontend(name); - } - - @Override - public LoadBalancerFrontendImpl definePublicFrontend(String name) { - return defineFrontend(name); - } - - LoadBalancerFrontendImpl defineFrontend(String name) { - LoadBalancerFrontend frontend = this.frontends.get(name); - - // Create if non-existent - if (frontend == null) { - FrontendIpConfigurationInner inner = new FrontendIpConfigurationInner().withName(name); - return new LoadBalancerFrontendImpl(inner, this); - } else { - return (LoadBalancerFrontendImpl) frontend; - } - } - - @Override - public LoadBalancerBackendImpl defineBackend(String name) { - LoadBalancerBackend backend = this.backends.get(name); - - // Create if non-existent - if (backend == null) { - BackendAddressPoolInner inner = new BackendAddressPoolInner().withName(name); - return new LoadBalancerBackendImpl(inner, this); - } else { - return (LoadBalancerBackendImpl) backend; - } - } - - @Override - public LoadBalancerImpl withSku(LoadBalancerSkuType skuType) { - // Note: SKU is not updatable as of now, so this is available only during definition time - // Service return `SkuCannotBeChangedOnUpdate` upon attempt to change it. - // Service default is LoadBalancerSkuType.BASIC - // - this.innerModel().withSku(skuType.sku()); - return this; - } - - @Override - public LoadBalancerImpl withoutProbe(String name) { - if (this.httpProbes.containsKey(name)) { - this.httpProbes.remove(name); - } else if (this.httpsProbes.containsKey(name)) { - this.httpsProbes.remove(name); - } else if (this.tcpProbes.containsKey(name)) { - this.tcpProbes.remove(name); - } - return this; - } - - @Override - public LoadBalancerProbeImpl updateTcpProbe(String name) { - return (LoadBalancerProbeImpl) this.tcpProbes.get(name); - } - - @Override - public LoadBalancerBackendImpl updateBackend(String name) { - return (LoadBalancerBackendImpl) this.backends.get(name); - } - - @Override - public LoadBalancerFrontendImpl updatePublicFrontend(String name) { - return (LoadBalancerFrontendImpl) this.frontends.get(name); - } - - @Override - public LoadBalancerFrontendImpl updatePrivateFrontend(String name) { - return (LoadBalancerFrontendImpl) this.frontends.get(name); - } - - @Override - public LoadBalancerInboundNatRuleImpl updateInboundNatRule(String name) { - return (LoadBalancerInboundNatRuleImpl) this.inboundNatRules.get(name); - } - - @Override - public LoadBalancerInboundNatPoolImpl updateInboundNatPool(String name) { - return (LoadBalancerInboundNatPoolImpl) this.inboundNatPools.get(name); - } - - @Override - public LoadBalancerProbeImpl updateHttpProbe(String name) { - return (LoadBalancerProbeImpl) this.httpProbes.get(name); - } - - @Override - public LoadBalancerProbeImpl updateHttpsProbe(String name) { - return (LoadBalancerProbeImpl) this.httpsProbes.get(name); - } - - @Override - public LoadBalancingRuleImpl updateLoadBalancingRule(String name) { - return (LoadBalancingRuleImpl) this.loadBalancingRules.get(name); - } - - @Override - public LoadBalancerImpl withoutLoadBalancingRule(String name) { - this.loadBalancingRules.remove(name); - return this; - } - - @Override - public LoadBalancerImpl withoutInboundNatRule(String name) { - this.inboundNatRules.remove(name); - return this; - } - - @Override - public LoadBalancerImpl withoutBackend(String name) { - this.backends.remove(name); - return this; - } - - @Override - public Update withoutInboundNatPool(String name) { - this.inboundNatPools.remove(name); - return this; - } - - @Override - public LoadBalancerImpl withoutFrontend(String name) { - this.frontends.remove(name); - return this; - } - - // Getters - - @Override - public Map backends() { - return Collections.unmodifiableMap(this.backends); - } - - @Override - public Map inboundNatPools() { - return Collections.unmodifiableMap(this.inboundNatPools); - } - - @Override - public LoadBalancerSkuType sku() { - return LoadBalancerSkuType.fromSku(this.innerModel().sku()); - } - - @Override - public Map outboundRules() { - return Collections.unmodifiableMap(this.outboundRules); - } - - @Override - public Map tcpProbes() { - return Collections.unmodifiableMap(this.tcpProbes); - } - - @Override - public Map frontends() { - return Collections.unmodifiableMap(this.frontends); - } - - @Override - public Map privateFrontends() { - Map privateFrontends = new HashMap<>(); - for (LoadBalancerFrontend frontend : this.frontends().values()) { - if (!frontend.isPublic()) { - privateFrontends.put(frontend.name(), (LoadBalancerPrivateFrontend) frontend); - } - } - - return Collections.unmodifiableMap(privateFrontends); - } - - @Override - public Map publicFrontends() { - Map publicFrontends = new HashMap<>(); - for (LoadBalancerFrontend frontend : this.frontends().values()) { - if (frontend.isPublic()) { - publicFrontends.put(frontend.name(), (LoadBalancerPublicFrontend) frontend); - } - } - - return Collections.unmodifiableMap(publicFrontends); - } - - @Override - public Map inboundNatRules() { - return Collections.unmodifiableMap(this.inboundNatRules); - } - - @Override - public Map httpProbes() { - return Collections.unmodifiableMap(this.httpProbes); - } - - @Override - public Map httpsProbes() { - return Collections.unmodifiableMap(this.httpsProbes); - } - - @Override - public Map loadBalancingRules() { - return Collections.unmodifiableMap(this.loadBalancingRules); - } - - @Override - public List publicIpAddressIds() { - List publicIPAddressIds = new ArrayList<>(); - for (LoadBalancerFrontend frontend : this.frontends().values()) { - if (frontend.isPublic()) { - String pipId = ((LoadBalancerPublicFrontend) frontend).publicIpAddressId(); - publicIPAddressIds.add(pipId); - } - } - return Collections.unmodifiableList(publicIPAddressIds); - } - - @Override - public LoadBalancerPublicFrontend findFrontendByPublicIpAddress(String pipId) { - if (pipId == null) { - return null; - } - - // Use existing frontend already pointing at this PIP, if any - for (LoadBalancerPublicFrontend frontend : this.publicFrontends().values()) { - if (frontend.publicIpAddressId() == null) { - continue; - } else if (pipId.equalsIgnoreCase(frontend.publicIpAddressId())) { - return frontend; - } - } - - return null; - } - - @Override - public LoadBalancerPublicFrontend findFrontendByPublicIpAddress(PublicIpAddress publicIPAddress) { - return (publicIPAddress != null) ? this.findFrontendByPublicIpAddress(publicIPAddress.id()) : null; - } - - @Override - public LoadBalancerImpl withoutOutboundRule(String name) { - this.outboundRules.remove(name); - return this; - } - - @Override - public LoadBalancerOutboundRuleImpl defineOutboundRule(String name) { - LoadBalancerOutboundRule outboundRule = this.outboundRules.get(name); - if (outboundRule == null) { - OutboundRuleInner inner = new OutboundRuleInner().withName(name); - return new LoadBalancerOutboundRuleImpl(inner, this); - } else { - return (LoadBalancerOutboundRuleImpl) outboundRule; - } - } - - @Override - public LoadBalancerOutboundRuleImpl updateOutboundRule(String name) { - return (LoadBalancerOutboundRuleImpl) this.outboundRules.get(name); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/LoadBalancerInboundNatPoolImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/LoadBalancerInboundNatPoolImpl.java deleted file mode 100644 index 6c0b6b5e326a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/LoadBalancerInboundNatPoolImpl.java +++ /dev/null @@ -1,149 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.management.SubResource; -import com.azure.resourcemanager.network.models.InboundNatPool; -import com.azure.resourcemanager.network.models.LoadBalancer; -import com.azure.resourcemanager.network.models.LoadBalancerFrontend; -import com.azure.resourcemanager.network.models.LoadBalancerInboundNatPool; -import com.azure.resourcemanager.network.models.Network; -import com.azure.resourcemanager.network.models.PublicIpAddress; -import com.azure.resourcemanager.network.models.Subnet; -import com.azure.resourcemanager.network.models.TransportProtocol; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils; -import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.ChildResourceImpl; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; - -/** Implementation for LoadBalancerInboundNatRule. */ -class LoadBalancerInboundNatPoolImpl extends ChildResourceImpl - implements LoadBalancerInboundNatPool, - LoadBalancerInboundNatPool.Definition, - LoadBalancerInboundNatPool.UpdateDefinition, - LoadBalancerInboundNatPool.Update { - - LoadBalancerInboundNatPoolImpl(InboundNatPool inner, LoadBalancerImpl parent) { - super(inner, parent); - } - - // Getters - - @Override - public String name() { - return this.innerModel().name(); - } - - @Override - public TransportProtocol protocol() { - return this.innerModel().protocol(); - } - - @Override - public int backendPort() { - return ResourceManagerUtils.toPrimitiveInt(this.innerModel().backendPort()); - } - - @Override - public LoadBalancerFrontend frontend() { - return this - .parent() - .frontends() - .get(ResourceUtils.nameFromResourceId(this.innerModel().frontendIpConfiguration().id())); - } - - @Override - public int frontendPortRangeStart() { - return ResourceManagerUtils.toPrimitiveInt(this.innerModel().frontendPortRangeStart()); - } - - @Override - public int frontendPortRangeEnd() { - return ResourceManagerUtils.toPrimitiveInt(this.innerModel().frontendPortRangeEnd()); - } - - // Fluent setters - - @Override - public LoadBalancerInboundNatPoolImpl toBackendPort(int port) { - this.innerModel().withBackendPort(port); - return this; - } - - @Override - public LoadBalancerInboundNatPoolImpl withProtocol(TransportProtocol protocol) { - this.innerModel().withProtocol(protocol); - return this; - } - - @Override - public LoadBalancerInboundNatPoolImpl fromFrontend(String frontendName) { - SubResource frontendRef = this.parent().ensureFrontendRef(frontendName); - if (frontendRef != null) { - this.innerModel().withFrontendIpConfiguration(frontendRef); - } - return this; - } - - @Override - public LoadBalancerInboundNatPoolImpl fromFrontendPortRange(int from, int to) { - this.innerModel().withFrontendPortRangeStart(from).withFrontendPortRangeEnd(to); - return this; - } - - // Verbs - - @Override - public LoadBalancerImpl attach() { - return this.parent().withInboundNatPool(this); - } - - @Override - public LoadBalancerInboundNatPoolImpl fromExistingPublicIPAddress(PublicIpAddress publicIPAddress) { - return (publicIPAddress != null) ? this.fromExistingPublicIPAddress(publicIPAddress.id()) : this; - } - - @Override - public LoadBalancerInboundNatPoolImpl fromExistingPublicIPAddress(String resourceId) { - return (null != resourceId) - ? this.fromFrontend(this.parent().ensurePublicFrontendWithPip(resourceId).name()) - : this; - } - - @Override - public LoadBalancerInboundNatPoolImpl fromNewPublicIPAddress(String leafDnsLabel) { - String frontendName = this.parent().manager().resourceManager().internalContext().randomResourceName("fe", 20); - this.parent().withNewPublicIPAddress(leafDnsLabel, frontendName); - return fromFrontend(frontendName); - } - - @Override - public LoadBalancerInboundNatPoolImpl fromNewPublicIPAddress(Creatable pipDefinition) { - String frontendName = this.parent().manager().resourceManager().internalContext().randomResourceName("fe", 20); - this.parent().withNewPublicIPAddress(pipDefinition, frontendName); - return fromFrontend(frontendName); - } - - @Override - public LoadBalancerInboundNatPoolImpl fromNewPublicIPAddress() { - String dnsLabel = this.parent().manager().resourceManager().internalContext().randomResourceName("fe", 20); - return this.fromNewPublicIPAddress(dnsLabel); - } - - @Override - public LoadBalancerInboundNatPoolImpl fromExistingSubnet(String networkResourceId, String subnetName) { - return (null != networkResourceId && null != subnetName) - ? this.fromFrontend(this.parent().ensurePrivateFrontendWithSubnet(networkResourceId, subnetName).name()) - : this; - } - - @Override - public LoadBalancerInboundNatPoolImpl fromExistingSubnet(Network network, String subnetName) { - return (null != network && null != subnetName) ? this.fromExistingSubnet(network.id(), subnetName) : this; - } - - @Override - public LoadBalancerInboundNatPoolImpl fromExistingSubnet(Subnet subnet) { - return (null != subnet) ? this.fromExistingSubnet(subnet.parent().id(), subnet.name()) : this; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/LoadBalancerInboundNatRuleImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/LoadBalancerInboundNatRuleImpl.java deleted file mode 100644 index f394331a6507..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/LoadBalancerInboundNatRuleImpl.java +++ /dev/null @@ -1,201 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.management.SubResource; -import com.azure.resourcemanager.network.models.LoadBalancer; -import com.azure.resourcemanager.network.models.LoadBalancerFrontend; -import com.azure.resourcemanager.network.models.LoadBalancerInboundNatRule; -import com.azure.resourcemanager.network.models.Network; -import com.azure.resourcemanager.network.models.PublicIpAddress; -import com.azure.resourcemanager.network.models.Subnet; -import com.azure.resourcemanager.network.models.TransportProtocol; -import com.azure.resourcemanager.network.fluent.models.InboundNatRuleInner; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils; -import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.ChildResourceImpl; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; - -/** Implementation for LoadBalancerInboundNatRule. */ -class LoadBalancerInboundNatRuleImpl extends ChildResourceImpl - implements LoadBalancerInboundNatRule, - LoadBalancerInboundNatRule.Definition, - LoadBalancerInboundNatRule.UpdateDefinition, - LoadBalancerInboundNatRule.Update { - - LoadBalancerInboundNatRuleImpl(InboundNatRuleInner inner, LoadBalancerImpl parent) { - super(inner, parent); - } - - // Getters - - @Override - public String name() { - return this.innerModel().name(); - } - - @Override - public String backendNicIpConfigurationName() { - if (this.innerModel().backendIpConfiguration() == null) { - return null; - } else { - return ResourceUtils.nameFromResourceId(this.innerModel().backendIpConfiguration().id()); - } - } - - @Override - public int backendPort() { - return ResourceManagerUtils.toPrimitiveInt(this.innerModel().backendPort()); - } - - @Override - public String backendNetworkInterfaceId() { - if (this.innerModel().backendIpConfiguration() == null) { - return null; - } else { - return ResourceUtils.parentResourceIdFromResourceId(this.innerModel().backendIpConfiguration().id()); - } - } - - @Override - public TransportProtocol protocol() { - return this.innerModel().protocol(); - } - - @Override - public int frontendPort() { - return ResourceManagerUtils.toPrimitiveInt(this.innerModel().frontendPort()); - } - - @Override - public boolean floatingIPEnabled() { - return this.innerModel().enableFloatingIp().booleanValue(); - } - - @Override - public LoadBalancerFrontend frontend() { - return this - .parent() - .frontends() - .get(ResourceUtils.nameFromResourceId(this.innerModel().frontendIpConfiguration().id())); - } - - @Override - public int idleTimeoutInMinutes() { - return ResourceManagerUtils.toPrimitiveInt(this.innerModel().idleTimeoutInMinutes()); - } - - // Fluent setters - - @Override - public LoadBalancerInboundNatRuleImpl toBackendPort(int port) { - this.innerModel().withBackendPort(port); - return this; - } - - @Override - public LoadBalancerInboundNatRuleImpl withFloatingIPEnabled() { - return withFloatingIP(true); - } - - @Override - public LoadBalancerInboundNatRuleImpl withFloatingIPDisabled() { - return withFloatingIP(false); - } - - @Override - public LoadBalancerInboundNatRuleImpl withFloatingIP(boolean enabled) { - this.innerModel().withEnableFloatingIp(enabled); - return this; - } - - @Override - public LoadBalancerInboundNatRuleImpl fromFrontendPort(int port) { - this.innerModel().withFrontendPort(port); - if (this.backendPort() == 0) { - // By default, assume the same backend port - return this.toBackendPort(port); - } else { - return this; - } - } - - @Override - public LoadBalancerInboundNatRuleImpl withIdleTimeoutInMinutes(int minutes) { - this.innerModel().withIdleTimeoutInMinutes(minutes); - return this; - } - - @Override - public LoadBalancerInboundNatRuleImpl withProtocol(TransportProtocol protocol) { - this.innerModel().withProtocol(protocol); - return this; - } - - @Override - public LoadBalancerInboundNatRuleImpl fromFrontend(String frontendName) { - SubResource frontendRef = this.parent().ensureFrontendRef(frontendName); - if (frontendRef != null) { - this.innerModel().withFrontendIpConfiguration(frontendRef); - } - return this; - } - - // Verbs - - @Override - public LoadBalancerImpl attach() { - return this.parent().withInboundNatRule(this); - } - - @Override - public LoadBalancerInboundNatRuleImpl fromExistingPublicIPAddress(PublicIpAddress publicIPAddress) { - return (publicIPAddress != null) ? this.fromExistingPublicIPAddress(publicIPAddress.id()) : this; - } - - @Override - public LoadBalancerInboundNatRuleImpl fromExistingPublicIPAddress(String resourceId) { - return (null != resourceId) - ? this.fromFrontend(this.parent().ensurePublicFrontendWithPip(resourceId).name()) - : this; - } - - @Override - public LoadBalancerInboundNatRuleImpl fromNewPublicIPAddress(String leafDnsLabel) { - String frontendName = this.parent().manager().resourceManager().internalContext().randomResourceName("fe", 20); - this.parent().withNewPublicIPAddress(leafDnsLabel, frontendName); - this.fromFrontend(frontendName); - return this; - } - - @Override - public LoadBalancerInboundNatRuleImpl fromNewPublicIPAddress(Creatable pipDefinition) { - String frontendName = this.parent().manager().resourceManager().internalContext().randomResourceName("fe", 20); - this.parent().withNewPublicIPAddress(pipDefinition, frontendName); - this.fromFrontend(frontendName); - return this; - } - - @Override - public LoadBalancerInboundNatRuleImpl fromNewPublicIPAddress() { - String dnsLabel = this.parent().manager().resourceManager().internalContext().randomResourceName("fe", 20); - return this.fromNewPublicIPAddress(dnsLabel); - } - - @Override - public LoadBalancerInboundNatRuleImpl fromExistingSubnet(String networkResourceId, String subnetName) { - return (null != networkResourceId && null != subnetName) - ? this.fromFrontend(this.parent().ensurePrivateFrontendWithSubnet(networkResourceId, subnetName).name()) - : this; - } - - @Override - public LoadBalancerInboundNatRuleImpl fromExistingSubnet(Network network, String subnetName) { - return (null != network && null != subnetName) ? this.fromExistingSubnet(network.id(), subnetName) : this; - } - - @Override - public LoadBalancerInboundNatRuleImpl fromExistingSubnet(Subnet subnet) { - return (null != subnet) ? this.fromExistingSubnet(subnet.parent().id(), subnet.name()) : this; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/LoadBalancerLoadBalancingRulesClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/LoadBalancerLoadBalancingRulesClientImpl.java deleted file mode 100644 index ff8ccb9bac96..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/LoadBalancerLoadBalancingRulesClientImpl.java +++ /dev/null @@ -1,531 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.LoadBalancerLoadBalancingRulesClient; -import com.azure.resourcemanager.network.fluent.models.LoadBalancingRuleInner; -import com.azure.resourcemanager.network.models.LoadBalancerLoadBalancingRuleListResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in LoadBalancerLoadBalancingRulesClient. */ -public final class LoadBalancerLoadBalancingRulesClientImpl implements LoadBalancerLoadBalancingRulesClient { - private final ClientLogger logger = new ClientLogger(LoadBalancerLoadBalancingRulesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final LoadBalancerLoadBalancingRulesService service; - - /** The service client containing this operation class. */ - private final NetworkManagementClientImpl client; - - /** - * Initializes an instance of LoadBalancerLoadBalancingRulesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - LoadBalancerLoadBalancingRulesClientImpl(NetworkManagementClientImpl client) { - this.service = - RestProxy - .create( - LoadBalancerLoadBalancingRulesService.class, - client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for NetworkManagementClientLoadBalancerLoadBalancingRules to be used by - * the proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "NetworkManagementCli") - private interface LoadBalancerLoadBalancingRulesService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/loadBalancers/{loadBalancerName}/loadBalancingRules") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("loadBalancerName") String loadBalancerName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/loadBalancers/{loadBalancerName}/loadBalancingRules/{loadBalancingRuleName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("loadBalancerName") String loadBalancerName, - @PathParam("loadBalancingRuleName") String loadBalancingRuleName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets all the load balancing rules in a load balancer. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the load balancing rules in a load balancer. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String loadBalancerName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (loadBalancerName == null) { - return Mono - .error(new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - resourceGroupName, - loadBalancerName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all the load balancing rules in a load balancer. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the load balancing rules in a load balancer. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String loadBalancerName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (loadBalancerName == null) { - return Mono - .error(new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - resourceGroupName, - loadBalancerName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all the load balancing rules in a load balancer. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the load balancing rules in a load balancer. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String resourceGroupName, String loadBalancerName) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, loadBalancerName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets all the load balancing rules in a load balancer. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the load balancing rules in a load balancer. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String loadBalancerName, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, loadBalancerName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all the load balancing rules in a load balancer. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the load balancing rules in a load balancer. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String loadBalancerName) { - return new PagedIterable<>(listAsync(resourceGroupName, loadBalancerName)); - } - - /** - * Gets all the load balancing rules in a load balancer. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the load balancing rules in a load balancer. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, String loadBalancerName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, loadBalancerName, context)); - } - - /** - * Gets the specified load balancer load balancing rule. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param loadBalancingRuleName The name of the load balancing rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified load balancer load balancing rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String resourceGroupName, String loadBalancerName, String loadBalancingRuleName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (loadBalancerName == null) { - return Mono - .error(new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null.")); - } - if (loadBalancingRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter loadBalancingRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - resourceGroupName, - loadBalancerName, - loadBalancingRuleName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the specified load balancer load balancing rule. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param loadBalancingRuleName The name of the load balancing rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified load balancer load balancing rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String loadBalancerName, String loadBalancingRuleName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (loadBalancerName == null) { - return Mono - .error(new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null.")); - } - if (loadBalancingRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter loadBalancingRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - resourceGroupName, - loadBalancerName, - loadBalancingRuleName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets the specified load balancer load balancing rule. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param loadBalancingRuleName The name of the load balancing rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified load balancer load balancing rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync( - String resourceGroupName, String loadBalancerName, String loadBalancingRuleName) { - return getWithResponseAsync(resourceGroupName, loadBalancerName, loadBalancingRuleName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the specified load balancer load balancing rule. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param loadBalancingRuleName The name of the load balancing rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified load balancer load balancing rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public LoadBalancingRuleInner get(String resourceGroupName, String loadBalancerName, String loadBalancingRuleName) { - return getAsync(resourceGroupName, loadBalancerName, loadBalancingRuleName).block(); - } - - /** - * Gets the specified load balancer load balancing rule. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param loadBalancingRuleName The name of the load balancing rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified load balancer load balancing rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String loadBalancerName, String loadBalancingRuleName, Context context) { - return getWithResponseAsync(resourceGroupName, loadBalancerName, loadBalancingRuleName, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListLoadBalancingRule API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListLoadBalancingRule API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/LoadBalancerNetworkInterfacesClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/LoadBalancerNetworkInterfacesClientImpl.java deleted file mode 100644 index f1a58d68636f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/LoadBalancerNetworkInterfacesClientImpl.java +++ /dev/null @@ -1,346 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.LoadBalancerNetworkInterfacesClient; -import com.azure.resourcemanager.network.fluent.models.NetworkInterfaceInner; -import com.azure.resourcemanager.network.models.NetworkInterfaceListResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in LoadBalancerNetworkInterfacesClient. */ -public final class LoadBalancerNetworkInterfacesClientImpl implements LoadBalancerNetworkInterfacesClient { - private final ClientLogger logger = new ClientLogger(LoadBalancerNetworkInterfacesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final LoadBalancerNetworkInterfacesService service; - - /** The service client containing this operation class. */ - private final NetworkManagementClientImpl client; - - /** - * Initializes an instance of LoadBalancerNetworkInterfacesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - LoadBalancerNetworkInterfacesClientImpl(NetworkManagementClientImpl client) { - this.service = - RestProxy - .create( - LoadBalancerNetworkInterfacesService.class, - client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for NetworkManagementClientLoadBalancerNetworkInterfaces to be used by - * the proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "NetworkManagementCli") - private interface LoadBalancerNetworkInterfacesService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/loadBalancers/{loadBalancerName}/networkInterfaces") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("loadBalancerName") String loadBalancerName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets associated load balancer network interfaces. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return associated load balancer network interfaces. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String loadBalancerName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (loadBalancerName == null) { - return Mono - .error(new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - resourceGroupName, - loadBalancerName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets associated load balancer network interfaces. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return associated load balancer network interfaces. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String loadBalancerName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (loadBalancerName == null) { - return Mono - .error(new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - resourceGroupName, - loadBalancerName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets associated load balancer network interfaces. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return associated load balancer network interfaces. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String resourceGroupName, String loadBalancerName) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, loadBalancerName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets associated load balancer network interfaces. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return associated load balancer network interfaces. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String loadBalancerName, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, loadBalancerName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets associated load balancer network interfaces. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return associated load balancer network interfaces. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String loadBalancerName) { - return new PagedIterable<>(listAsync(resourceGroupName, loadBalancerName)); - } - - /** - * Gets associated load balancer network interfaces. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return associated load balancer network interfaces. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, String loadBalancerName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, loadBalancerName, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the ListNetworkInterface API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the ListNetworkInterface API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/LoadBalancerOutboundRuleImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/LoadBalancerOutboundRuleImpl.java deleted file mode 100644 index eac957a75df9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/LoadBalancerOutboundRuleImpl.java +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.management.SubResource; -import com.azure.resourcemanager.network.fluent.models.OutboundRuleInner; -import com.azure.resourcemanager.network.models.LoadBalancer; -import com.azure.resourcemanager.network.models.LoadBalancerBackend; -import com.azure.resourcemanager.network.models.LoadBalancerFrontend; -import com.azure.resourcemanager.network.models.LoadBalancerOutboundRule; -import com.azure.resourcemanager.network.models.LoadBalancerOutboundRuleProtocol; -import com.azure.resourcemanager.network.models.ProvisioningState; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils; -import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.ChildResourceImpl; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.TreeMap; - -public class LoadBalancerOutboundRuleImpl extends ChildResourceImpl - implements LoadBalancerOutboundRule, - LoadBalancerOutboundRule.Definition, - LoadBalancerOutboundRule.Update { - - LoadBalancerOutboundRuleImpl(OutboundRuleInner inner, LoadBalancerImpl parent) { - super(inner, parent); - } - - // Getters - @Override - public LoadBalancerOutboundRuleProtocol protocol() { - return this.innerModel().protocol(); - } - - @Override - public Map frontends() { - Map nameToFrontEndMap = new TreeMap<>(); - if (this.innerModel().frontendIpConfigurations() != null && !this.innerModel().frontendIpConfigurations().isEmpty()) { - for (SubResource frontendIpConfiguration : this.innerModel().frontendIpConfigurations()) { - LoadBalancerFrontend frontend = this.parent() - .frontends() - .get(ResourceUtils.nameFromResourceId(frontendIpConfiguration.id())); - nameToFrontEndMap.put(frontend.name(), frontend); - } - } - return Collections.unmodifiableMap(nameToFrontEndMap); - } - - @Override - public LoadBalancerBackend backend() { - return this - .parent() - .backends() - .get(ResourceUtils.nameFromResourceId(this.innerModel().backendAddressPool().id())); - } - - @Override - public int allocatedOutboundPorts() { - return this.innerModel().allocatedOutboundPorts(); - } - - @Override - public ProvisioningState provisioningState() { - return ProvisioningState.fromString(this.innerModel().provisioningState()); - } - - @Override - public int idleTimeoutInMinutes() { - return ResourceManagerUtils.toPrimitiveInt(this.innerModel().idleTimeoutInMinutes()); - } - - @Override - public boolean tcpResetEnabled() { - return this.innerModel().enableTcpReset().booleanValue(); - } - - @Override - public String name() { - return this.innerModel().name(); - } - - // Fluent setters - - @Override - public LoadBalancerOutboundRuleImpl withProtocol(LoadBalancerOutboundRuleProtocol protocol) { - this.innerModel().withProtocol(protocol); - return this; - } - - @Override - public LoadBalancerOutboundRuleImpl fromBackend(String name) { - // Ensure existence of backend, creating one if needed - this.parent().defineBackend(name).attach(); - - SubResource backendRef = - new SubResource().withId(this.parent().futureResourceId() + "/backendAddressPools/" + name); - this.innerModel().withBackendAddressPool(backendRef); - return this; - } - - @Override - public LoadBalancerOutboundRuleImpl toFrontend(String name) { - SubResource frontendRef = this.parent().ensureFrontendRef(name); - if (frontendRef != null) { - this.innerModel().withFrontendIpConfigurations(Arrays.asList(frontendRef)); - } - return this; - } - - @Override - public LoadBalancerOutboundRuleImpl toFrontends(List names) { - List frontendRefs = new ArrayList<>(); - if (names != null && !names.isEmpty()) { - for (String name : names) { - SubResource frontendRef = this.parent().ensureFrontendRef(name); - frontendRefs.add(frontendRef); - } - } - this.innerModel().withFrontendIpConfigurations(frontendRefs); - return this; - } - - @Override - public LoadBalancerOutboundRuleImpl withIdleTimeoutInMinutes(int minutes) { - this.innerModel().withIdleTimeoutInMinutes(minutes); - return this; - } - - @Override - public LoadBalancerOutboundRuleImpl withEnableTcpReset(boolean enableTcpReset) { - this.innerModel().withEnableTcpReset(enableTcpReset); - return this; - } - - // Verbs - @Override - public LoadBalancerImpl attach() { - return this.parent().withOutboundRule(this); - } - -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/LoadBalancerOutboundRulesClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/LoadBalancerOutboundRulesClientImpl.java deleted file mode 100644 index 666d578b4b43..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/LoadBalancerOutboundRulesClientImpl.java +++ /dev/null @@ -1,527 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.LoadBalancerOutboundRulesClient; -import com.azure.resourcemanager.network.fluent.models.OutboundRuleInner; -import com.azure.resourcemanager.network.models.LoadBalancerOutboundRuleListResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in LoadBalancerOutboundRulesClient. */ -public final class LoadBalancerOutboundRulesClientImpl implements LoadBalancerOutboundRulesClient { - private final ClientLogger logger = new ClientLogger(LoadBalancerOutboundRulesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final LoadBalancerOutboundRulesService service; - - /** The service client containing this operation class. */ - private final NetworkManagementClientImpl client; - - /** - * Initializes an instance of LoadBalancerOutboundRulesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - LoadBalancerOutboundRulesClientImpl(NetworkManagementClientImpl client) { - this.service = - RestProxy - .create( - LoadBalancerOutboundRulesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for NetworkManagementClientLoadBalancerOutboundRules to be used by the - * proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "NetworkManagementCli") - private interface LoadBalancerOutboundRulesService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/loadBalancers/{loadBalancerName}/outboundRules") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("loadBalancerName") String loadBalancerName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/loadBalancers/{loadBalancerName}/outboundRules/{outboundRuleName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("loadBalancerName") String loadBalancerName, - @PathParam("outboundRuleName") String outboundRuleName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets all the outbound rules in a load balancer. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the outbound rules in a load balancer. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String loadBalancerName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (loadBalancerName == null) { - return Mono - .error(new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - resourceGroupName, - loadBalancerName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all the outbound rules in a load balancer. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the outbound rules in a load balancer. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String loadBalancerName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (loadBalancerName == null) { - return Mono - .error(new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - resourceGroupName, - loadBalancerName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all the outbound rules in a load balancer. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the outbound rules in a load balancer. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String resourceGroupName, String loadBalancerName) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, loadBalancerName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets all the outbound rules in a load balancer. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the outbound rules in a load balancer. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String loadBalancerName, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, loadBalancerName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all the outbound rules in a load balancer. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the outbound rules in a load balancer. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String loadBalancerName) { - return new PagedIterable<>(listAsync(resourceGroupName, loadBalancerName)); - } - - /** - * Gets all the outbound rules in a load balancer. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the outbound rules in a load balancer. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String loadBalancerName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, loadBalancerName, context)); - } - - /** - * Gets the specified load balancer outbound rule. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param outboundRuleName The name of the outbound rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified load balancer outbound rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String resourceGroupName, String loadBalancerName, String outboundRuleName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (loadBalancerName == null) { - return Mono - .error(new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null.")); - } - if (outboundRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter outboundRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - resourceGroupName, - loadBalancerName, - outboundRuleName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the specified load balancer outbound rule. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param outboundRuleName The name of the outbound rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified load balancer outbound rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String loadBalancerName, String outboundRuleName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (loadBalancerName == null) { - return Mono - .error(new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null.")); - } - if (outboundRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter outboundRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - resourceGroupName, - loadBalancerName, - outboundRuleName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets the specified load balancer outbound rule. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param outboundRuleName The name of the outbound rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified load balancer outbound rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync( - String resourceGroupName, String loadBalancerName, String outboundRuleName) { - return getWithResponseAsync(resourceGroupName, loadBalancerName, outboundRuleName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the specified load balancer outbound rule. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param outboundRuleName The name of the outbound rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified load balancer outbound rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public OutboundRuleInner get(String resourceGroupName, String loadBalancerName, String outboundRuleName) { - return getAsync(resourceGroupName, loadBalancerName, outboundRuleName).block(); - } - - /** - * Gets the specified load balancer outbound rule. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param outboundRuleName The name of the outbound rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified load balancer outbound rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String loadBalancerName, String outboundRuleName, Context context) { - return getWithResponseAsync(resourceGroupName, loadBalancerName, outboundRuleName, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListOutboundRule API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListOutboundRule API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/LoadBalancerProbeImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/LoadBalancerProbeImpl.java deleted file mode 100644 index 1ef06fd4593b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/LoadBalancerProbeImpl.java +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.management.SubResource; -import com.azure.resourcemanager.network.models.LoadBalancer; -import com.azure.resourcemanager.network.models.LoadBalancerHttpProbe; -import com.azure.resourcemanager.network.models.LoadBalancerTcpProbe; -import com.azure.resourcemanager.network.models.LoadBalancingRule; -import com.azure.resourcemanager.network.models.ProbeProtocol; -import com.azure.resourcemanager.network.fluent.models.ProbeInner; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils; -import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.ChildResourceImpl; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; - -import java.util.Collections; -import java.util.Map; -import java.util.TreeMap; - -/** Implementation for LoadBalancerTcpProbe and its create and update interfaces. */ -class LoadBalancerProbeImpl extends ChildResourceImpl - implements LoadBalancerTcpProbe, - LoadBalancerTcpProbe.Definition, - LoadBalancerTcpProbe.UpdateDefinition, - LoadBalancerTcpProbe.Update, - LoadBalancerHttpProbe, - LoadBalancerHttpProbe.Definition, - LoadBalancerHttpProbe.UpdateDefinition, - LoadBalancerHttpProbe.Update { - - LoadBalancerProbeImpl(ProbeInner inner, LoadBalancerImpl parent) { - super(inner, parent); - } - - // Getters - - @Override - public int intervalInSeconds() { - return ResourceManagerUtils.toPrimitiveInt(this.innerModel().intervalInSeconds()); - } - - @Override - public int port() { - return ResourceManagerUtils.toPrimitiveInt(this.innerModel().port()); - } - - @Override - public int numberOfProbes() { - return ResourceManagerUtils.toPrimitiveInt(this.innerModel().numberOfProbes()); - } - - @Override - public String name() { - return this.innerModel().name(); - } - - @Override - public ProbeProtocol protocol() { - return this.innerModel().protocol(); - } - - @Override - public String requestPath() { - return this.innerModel().requestPath(); - } - - @Override - public Map loadBalancingRules() { - final Map rules = new TreeMap<>(); - if (this.innerModel().loadBalancingRules() != null) { - for (SubResource inner : this.innerModel().loadBalancingRules()) { - String name = ResourceUtils.nameFromResourceId(inner.id()); - LoadBalancingRule rule = this.parent().loadBalancingRules().get(name); - if (rule != null) { - rules.put(name, rule); - } - } - } - - return Collections.unmodifiableMap(rules); - } - - // Fluent setters - - @Override - public LoadBalancerProbeImpl withPort(int port) { - this.innerModel().withPort(port); - return this; - } - - @Override - public LoadBalancerProbeImpl withRequestPath(String requestPath) { - this.innerModel().withRequestPath(requestPath); - return this; - } - - @Override - public LoadBalancerProbeImpl withIntervalInSeconds(int seconds) { - this.innerModel().withIntervalInSeconds(seconds); - return this; - } - - @Override - public LoadBalancerProbeImpl withNumberOfProbes(int probes) { - this.innerModel().withNumberOfProbes(probes); - return this; - } - - // Verbs - - @Override - public LoadBalancerImpl attach() { - return this.parent().withProbe(this); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/LoadBalancerProbesClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/LoadBalancerProbesClientImpl.java deleted file mode 100644 index 1ec776efdd15..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/LoadBalancerProbesClientImpl.java +++ /dev/null @@ -1,521 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.LoadBalancerProbesClient; -import com.azure.resourcemanager.network.fluent.models.ProbeInner; -import com.azure.resourcemanager.network.models.LoadBalancerProbeListResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in LoadBalancerProbesClient. */ -public final class LoadBalancerProbesClientImpl implements LoadBalancerProbesClient { - private final ClientLogger logger = new ClientLogger(LoadBalancerProbesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final LoadBalancerProbesService service; - - /** The service client containing this operation class. */ - private final NetworkManagementClientImpl client; - - /** - * Initializes an instance of LoadBalancerProbesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - LoadBalancerProbesClientImpl(NetworkManagementClientImpl client) { - this.service = - RestProxy.create(LoadBalancerProbesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for NetworkManagementClientLoadBalancerProbes to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "NetworkManagementCli") - private interface LoadBalancerProbesService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/loadBalancers/{loadBalancerName}/probes") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("loadBalancerName") String loadBalancerName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/loadBalancers/{loadBalancerName}/probes/{probeName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("loadBalancerName") String loadBalancerName, - @PathParam("probeName") String probeName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets all the load balancer probes. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the load balancer probes. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String loadBalancerName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (loadBalancerName == null) { - return Mono - .error(new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - resourceGroupName, - loadBalancerName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all the load balancer probes. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the load balancer probes. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String loadBalancerName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (loadBalancerName == null) { - return Mono - .error(new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - resourceGroupName, - loadBalancerName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all the load balancer probes. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the load balancer probes. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String resourceGroupName, String loadBalancerName) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, loadBalancerName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets all the load balancer probes. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the load balancer probes. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String loadBalancerName, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, loadBalancerName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all the load balancer probes. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the load balancer probes. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String loadBalancerName) { - return new PagedIterable<>(listAsync(resourceGroupName, loadBalancerName)); - } - - /** - * Gets all the load balancer probes. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the load balancer probes. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String loadBalancerName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, loadBalancerName, context)); - } - - /** - * Gets load balancer probe. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param probeName The name of the probe. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return load balancer probe. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String resourceGroupName, String loadBalancerName, String probeName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (loadBalancerName == null) { - return Mono - .error(new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null.")); - } - if (probeName == null) { - return Mono.error(new IllegalArgumentException("Parameter probeName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - resourceGroupName, - loadBalancerName, - probeName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets load balancer probe. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param probeName The name of the probe. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return load balancer probe. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String loadBalancerName, String probeName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (loadBalancerName == null) { - return Mono - .error(new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null.")); - } - if (probeName == null) { - return Mono.error(new IllegalArgumentException("Parameter probeName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - resourceGroupName, - loadBalancerName, - probeName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets load balancer probe. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param probeName The name of the probe. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return load balancer probe. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync(String resourceGroupName, String loadBalancerName, String probeName) { - return getWithResponseAsync(resourceGroupName, loadBalancerName, probeName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets load balancer probe. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param probeName The name of the probe. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return load balancer probe. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ProbeInner get(String resourceGroupName, String loadBalancerName, String probeName) { - return getAsync(resourceGroupName, loadBalancerName, probeName).block(); - } - - /** - * Gets load balancer probe. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param probeName The name of the probe. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return load balancer probe. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String loadBalancerName, String probeName, Context context) { - return getWithResponseAsync(resourceGroupName, loadBalancerName, probeName, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListProbe API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListProbe API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/LoadBalancersClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/LoadBalancersClientImpl.java deleted file mode 100644 index 91123d7bf849..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/LoadBalancersClientImpl.java +++ /dev/null @@ -1,1579 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.LoadBalancersClient; -import com.azure.resourcemanager.network.fluent.models.LoadBalancerInner; -import com.azure.resourcemanager.network.models.LoadBalancerListResult; -import com.azure.resourcemanager.network.models.TagsObject; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in LoadBalancersClient. */ -public final class LoadBalancersClientImpl - implements InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete, - LoadBalancersClient { - private final ClientLogger logger = new ClientLogger(LoadBalancersClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final LoadBalancersService service; - - /** The service client containing this operation class. */ - private final NetworkManagementClientImpl client; - - /** - * Initializes an instance of LoadBalancersClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - LoadBalancersClientImpl(NetworkManagementClientImpl client) { - this.service = - RestProxy.create(LoadBalancersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for NetworkManagementClientLoadBalancers to be used by the proxy service - * to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "NetworkManagementCli") - private interface LoadBalancersService { - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/loadBalancers/{loadBalancerName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("loadBalancerName") String loadBalancerName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/loadBalancers/{loadBalancerName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("loadBalancerName") String loadBalancerName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("$expand") String expand, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/loadBalancers/{loadBalancerName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("loadBalancerName") String loadBalancerName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") LoadBalancerInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/loadBalancers/{loadBalancerName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> updateTags( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("loadBalancerName") String loadBalancerName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") TagsObject parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/loadBalancers") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/loadBalancers") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAllNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Deletes the specified load balancer. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync(String resourceGroupName, String loadBalancerName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (loadBalancerName == null) { - return Mono - .error(new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - loadBalancerName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the specified load balancer. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String loadBalancerName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (loadBalancerName == null) { - return Mono - .error(new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - loadBalancerName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Deletes the specified load balancer. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String loadBalancerName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, loadBalancerName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deletes the specified load balancer. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String loadBalancerName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(resourceGroupName, loadBalancerName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes the specified load balancer. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete(String resourceGroupName, String loadBalancerName) { - return beginDeleteAsync(resourceGroupName, loadBalancerName).getSyncPoller(); - } - - /** - * Deletes the specified load balancer. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String loadBalancerName, Context context) { - return beginDeleteAsync(resourceGroupName, loadBalancerName, context).getSyncPoller(); - } - - /** - * Deletes the specified load balancer. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String loadBalancerName) { - return beginDeleteAsync(resourceGroupName, loadBalancerName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified load balancer. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String loadBalancerName, Context context) { - return beginDeleteAsync(resourceGroupName, loadBalancerName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified load balancer. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String loadBalancerName) { - deleteAsync(resourceGroupName, loadBalancerName).block(); - } - - /** - * Deletes the specified load balancer. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String loadBalancerName, Context context) { - deleteAsync(resourceGroupName, loadBalancerName, context).block(); - } - - /** - * Gets the specified load balancer. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param expand Expands referenced resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified load balancer. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String loadBalancerName, String expand) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (loadBalancerName == null) { - return Mono - .error(new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - loadBalancerName, - apiVersion, - this.client.getSubscriptionId(), - expand, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the specified load balancer. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param expand Expands referenced resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified load balancer. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String loadBalancerName, String expand, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (loadBalancerName == null) { - return Mono - .error(new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - loadBalancerName, - apiVersion, - this.client.getSubscriptionId(), - expand, - accept, - context); - } - - /** - * Gets the specified load balancer. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param expand Expands referenced resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified load balancer. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync( - String resourceGroupName, String loadBalancerName, String expand) { - return getByResourceGroupWithResponseAsync(resourceGroupName, loadBalancerName, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the specified load balancer. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified load balancer. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync(String resourceGroupName, String loadBalancerName) { - final String expand = null; - return getByResourceGroupWithResponseAsync(resourceGroupName, loadBalancerName, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the specified load balancer. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified load balancer. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public LoadBalancerInner getByResourceGroup(String resourceGroupName, String loadBalancerName) { - final String expand = null; - return getByResourceGroupAsync(resourceGroupName, loadBalancerName, expand).block(); - } - - /** - * Gets the specified load balancer. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param expand Expands referenced resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified load balancer. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String loadBalancerName, String expand, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, loadBalancerName, expand, context).block(); - } - - /** - * Creates or updates a load balancer. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param parameters Parameters supplied to the create or update load balancer operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return loadBalancer resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (loadBalancerName == null) { - return Mono - .error(new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - loadBalancerName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a load balancer. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param parameters Parameters supplied to the create or update load balancer operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return loadBalancer resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (loadBalancerName == null) { - return Mono - .error(new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - loadBalancerName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Creates or updates a load balancer. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param parameters Parameters supplied to the create or update load balancer operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return loadBalancer resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, LoadBalancerInner> beginCreateOrUpdateAsync( - String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, loadBalancerName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - LoadBalancerInner.class, - LoadBalancerInner.class, - this.client.getContext()); - } - - /** - * Creates or updates a load balancer. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param parameters Parameters supplied to the create or update load balancer operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return loadBalancer resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, LoadBalancerInner> beginCreateOrUpdateAsync( - String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, loadBalancerName, parameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), LoadBalancerInner.class, LoadBalancerInner.class, context); - } - - /** - * Creates or updates a load balancer. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param parameters Parameters supplied to the create or update load balancer operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return loadBalancer resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, LoadBalancerInner> beginCreateOrUpdate( - String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, loadBalancerName, parameters).getSyncPoller(); - } - - /** - * Creates or updates a load balancer. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param parameters Parameters supplied to the create or update load balancer operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return loadBalancer resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, LoadBalancerInner> beginCreateOrUpdate( - String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, loadBalancerName, parameters, context).getSyncPoller(); - } - - /** - * Creates or updates a load balancer. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param parameters Parameters supplied to the create or update load balancer operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return loadBalancer resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, loadBalancerName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a load balancer. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param parameters Parameters supplied to the create or update load balancer operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return loadBalancer resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, loadBalancerName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a load balancer. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param parameters Parameters supplied to the create or update load balancer operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return loadBalancer resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public LoadBalancerInner createOrUpdate( - String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters) { - return createOrUpdateAsync(resourceGroupName, loadBalancerName, parameters).block(); - } - - /** - * Creates or updates a load balancer. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param parameters Parameters supplied to the create or update load balancer operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return loadBalancer resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public LoadBalancerInner createOrUpdate( - String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters, Context context) { - return createOrUpdateAsync(resourceGroupName, loadBalancerName, parameters, context).block(); - } - - /** - * Updates a load balancer tags. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param parameters Parameters supplied to update load balancer tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return loadBalancer resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateTagsWithResponseAsync( - String resourceGroupName, String loadBalancerName, TagsObject parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (loadBalancerName == null) { - return Mono - .error(new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updateTags( - this.client.getEndpoint(), - resourceGroupName, - loadBalancerName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates a load balancer tags. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param parameters Parameters supplied to update load balancer tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return loadBalancer resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateTagsWithResponseAsync( - String resourceGroupName, String loadBalancerName, TagsObject parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (loadBalancerName == null) { - return Mono - .error(new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updateTags( - this.client.getEndpoint(), - resourceGroupName, - loadBalancerName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Updates a load balancer tags. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param parameters Parameters supplied to update load balancer tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return loadBalancer resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, LoadBalancerInner> beginUpdateTagsAsync( - String resourceGroupName, String loadBalancerName, TagsObject parameters) { - Mono>> mono = - updateTagsWithResponseAsync(resourceGroupName, loadBalancerName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - LoadBalancerInner.class, - LoadBalancerInner.class, - this.client.getContext()); - } - - /** - * Updates a load balancer tags. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param parameters Parameters supplied to update load balancer tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return loadBalancer resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, LoadBalancerInner> beginUpdateTagsAsync( - String resourceGroupName, String loadBalancerName, TagsObject parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - updateTagsWithResponseAsync(resourceGroupName, loadBalancerName, parameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), LoadBalancerInner.class, LoadBalancerInner.class, context); - } - - /** - * Updates a load balancer tags. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param parameters Parameters supplied to update load balancer tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return loadBalancer resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, LoadBalancerInner> beginUpdateTags( - String resourceGroupName, String loadBalancerName, TagsObject parameters) { - return beginUpdateTagsAsync(resourceGroupName, loadBalancerName, parameters).getSyncPoller(); - } - - /** - * Updates a load balancer tags. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param parameters Parameters supplied to update load balancer tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return loadBalancer resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, LoadBalancerInner> beginUpdateTags( - String resourceGroupName, String loadBalancerName, TagsObject parameters, Context context) { - return beginUpdateTagsAsync(resourceGroupName, loadBalancerName, parameters, context).getSyncPoller(); - } - - /** - * Updates a load balancer tags. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param parameters Parameters supplied to update load balancer tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return loadBalancer resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateTagsAsync( - String resourceGroupName, String loadBalancerName, TagsObject parameters) { - return beginUpdateTagsAsync(resourceGroupName, loadBalancerName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates a load balancer tags. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param parameters Parameters supplied to update load balancer tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return loadBalancer resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateTagsAsync( - String resourceGroupName, String loadBalancerName, TagsObject parameters, Context context) { - return beginUpdateTagsAsync(resourceGroupName, loadBalancerName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates a load balancer tags. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param parameters Parameters supplied to update load balancer tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return loadBalancer resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public LoadBalancerInner updateTags(String resourceGroupName, String loadBalancerName, TagsObject parameters) { - return updateTagsAsync(resourceGroupName, loadBalancerName, parameters).block(); - } - - /** - * Updates a load balancer tags. - * - * @param resourceGroupName The name of the resource group. - * @param loadBalancerName The name of the load balancer. - * @param parameters Parameters supplied to update load balancer tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return loadBalancer resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public LoadBalancerInner updateTags( - String resourceGroupName, String loadBalancerName, TagsObject parameters, Context context) { - return updateTagsAsync(resourceGroupName, loadBalancerName, parameters, context).block(); - } - - /** - * Gets all the load balancers in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the load balancers in a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all the load balancers in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the load balancers in a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all the load balancers in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the load balancers in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listAllNextSinglePageAsync(nextLink)); - } - - /** - * Gets all the load balancers in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the load balancers in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listAllNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all the load balancers in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the load balancers in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Gets all the load balancers in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the load balancers in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Gets all the load balancers in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the load balancers in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all the load balancers in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the load balancers in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all the load balancers in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the load balancers in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets all the load balancers in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the load balancers in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all the load balancers in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the load balancers in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * Gets all the load balancers in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the load balancers in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListLoadBalancers API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAllNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listAllNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListLoadBalancers API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAllNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listAllNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListLoadBalancers API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListLoadBalancers API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/LoadBalancersImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/LoadBalancersImpl.java deleted file mode 100644 index 19890d46f9ef..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/LoadBalancersImpl.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.network.models.LoadBalancer; -import com.azure.resourcemanager.network.models.LoadBalancers; -import com.azure.resourcemanager.network.fluent.models.LoadBalancerInner; -import com.azure.resourcemanager.network.fluent.LoadBalancersClient; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.TopLevelModifiableResourcesImpl; - -/** Implementation for {@link LoadBalancers}. */ -public class LoadBalancersImpl - extends TopLevelModifiableResourcesImpl< - LoadBalancer, LoadBalancerImpl, LoadBalancerInner, LoadBalancersClient, NetworkManager> - implements LoadBalancers { - - public LoadBalancersImpl(final NetworkManager networkManager) { - super(networkManager.serviceClient().getLoadBalancers(), networkManager); - } - - @Override - public LoadBalancerImpl define(String name) { - return wrapModel(name); - } - - // Fluent model create helpers - - @Override - protected LoadBalancerImpl wrapModel(String name) { - LoadBalancerInner inner = new LoadBalancerInner(); - return new LoadBalancerImpl(name, inner, this.manager()); - } - - @Override - protected LoadBalancerImpl wrapModel(LoadBalancerInner inner) { - if (inner == null) { - return null; - } - return new LoadBalancerImpl(inner.name(), inner, this.manager()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/LoadBalancingRuleImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/LoadBalancingRuleImpl.java deleted file mode 100644 index d738cc4243d9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/LoadBalancingRuleImpl.java +++ /dev/null @@ -1,269 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.management.SubResource; -import com.azure.resourcemanager.network.models.LoadBalancer; -import com.azure.resourcemanager.network.models.LoadBalancerBackend; -import com.azure.resourcemanager.network.models.LoadBalancerFrontend; -import com.azure.resourcemanager.network.models.LoadBalancerProbe; -import com.azure.resourcemanager.network.models.LoadBalancingRule; -import com.azure.resourcemanager.network.models.LoadDistribution; -import com.azure.resourcemanager.network.models.Network; -import com.azure.resourcemanager.network.models.PublicIpAddress; -import com.azure.resourcemanager.network.models.Subnet; -import com.azure.resourcemanager.network.models.TransportProtocol; -import com.azure.resourcemanager.network.models.HasNetworkInterfaces; -import com.azure.resourcemanager.network.fluent.models.LoadBalancingRuleInner; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils; -import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.ChildResourceImpl; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; - -import java.util.Arrays; -import java.util.Collection; - -/** Implementation for LoadBalancingRule. */ -class LoadBalancingRuleImpl extends ChildResourceImpl - implements LoadBalancingRule, - LoadBalancingRule.Definition, - LoadBalancingRule.UpdateDefinition, - LoadBalancingRule.Update { - - LoadBalancingRuleImpl(LoadBalancingRuleInner inner, LoadBalancerImpl parent) { - super(inner, parent); - } - - // Getters - - @Override - public String name() { - return this.innerModel().name(); - } - - @Override - public TransportProtocol protocol() { - return this.innerModel().protocol(); - } - - @Override - public boolean floatingIPEnabled() { - return this.innerModel().enableFloatingIp(); - } - - @Override - public int idleTimeoutInMinutes() { - return ResourceManagerUtils.toPrimitiveInt(this.innerModel().idleTimeoutInMinutes()); - } - - @Override - public int frontendPort() { - return ResourceManagerUtils.toPrimitiveInt(this.innerModel().frontendPort()); - } - - @Override - public int backendPort() { - return ResourceManagerUtils.toPrimitiveInt(this.innerModel().backendPort()); - } - - @Override - public LoadDistribution loadDistribution() { - return this.innerModel().loadDistribution(); - } - - @Override - public LoadBalancerFrontend frontend() { - SubResource frontendRef = this.innerModel().frontendIpConfiguration(); - if (frontendRef == null) { - return null; - } else { - String frontendName = ResourceUtils.nameFromResourceId(frontendRef.id()); - return this.parent().frontends().get(frontendName); - } - } - - @Override - public LoadBalancerBackend backend() { - SubResource backendRef = this.innerModel().backendAddressPool(); - if (backendRef == null) { - return null; - } else { - String backendName = ResourceUtils.nameFromResourceId(backendRef.id()); - return this.parent().backends().get(backendName); - } - } - - @Override - public LoadBalancerProbe probe() { - SubResource probeRef = this.innerModel().probe(); - if (probeRef == null) { - return null; - } else { - String probeName = ResourceUtils.nameFromResourceId(probeRef.id()); - if (this.parent().httpProbes().containsKey(probeName)) { - return this.parent().httpProbes().get(probeName); - } else if (this.parent().tcpProbes().containsKey(probeName)) { - return this.parent().tcpProbes().get(probeName); - } else { - return null; - } - } - } - - // Fluent withers - - @Override - public LoadBalancingRuleImpl fromExistingPublicIPAddress(PublicIpAddress publicIPAddress) { - return (publicIPAddress != null) ? this.fromExistingPublicIPAddress(publicIPAddress.id()) : this; - } - - @Override - public LoadBalancingRuleImpl fromExistingPublicIPAddress(String resourceId) { - return (null != resourceId) - ? this.fromFrontend(this.parent().ensurePublicFrontendWithPip(resourceId).name()) - : this; - } - - @Override - public LoadBalancingRuleImpl fromNewPublicIPAddress(String leafDnsLabel) { - String frontendName = this.parent().manager().resourceManager().internalContext().randomResourceName("fe", 20); - this.parent().withNewPublicIPAddress(leafDnsLabel, frontendName); - return fromFrontend(frontendName); - } - - @Override - public LoadBalancingRuleImpl fromNewPublicIPAddress(Creatable pipDefinition) { - String frontendName = this.parent().manager().resourceManager().internalContext().randomResourceName("fe", 20); - this.parent().withNewPublicIPAddress(pipDefinition, frontendName); - return fromFrontend(frontendName); - } - - @Override - public LoadBalancingRuleImpl fromNewPublicIPAddress() { - String dnsLabel = this.parent().manager().resourceManager().internalContext().randomResourceName("fe", 20); - return this.fromNewPublicIPAddress(dnsLabel); - } - - @Override - public LoadBalancingRuleImpl fromExistingSubnet(String networkResourceId, String subnetName) { - return (null != networkResourceId && null != subnetName) - ? this.fromFrontend(this.parent().ensurePrivateFrontendWithSubnet(networkResourceId, subnetName).name()) - : this; - } - - @Override - public LoadBalancingRuleImpl fromExistingSubnet(Network network, String subnetName) { - return (null != network && null != subnetName) ? this.fromExistingSubnet(network.id(), subnetName) : this; - } - - @Override - public LoadBalancingRuleImpl fromExistingSubnet(Subnet subnet) { - return (null != subnet) ? this.fromExistingSubnet(subnet.parent().id(), subnet.name()) : this; - } - - @Override - public LoadBalancingRuleImpl withIdleTimeoutInMinutes(int minutes) { - this.innerModel().withIdleTimeoutInMinutes(minutes); - return this; - } - - @Override - public LoadBalancingRuleImpl withFloatingIP(boolean enable) { - this.innerModel().withEnableFloatingIp(enable); - return this; - } - - @Override - public LoadBalancingRuleImpl withFloatingIPEnabled() { - return withFloatingIP(true); - } - - @Override - public LoadBalancingRuleImpl withFloatingIPDisabled() { - return withFloatingIP(false); - } - - @Override - public LoadBalancingRuleImpl withProtocol(TransportProtocol protocol) { - this.innerModel().withProtocol(protocol); - return this; - } - - @Override - public LoadBalancingRuleImpl fromFrontendPort(int port) { - this.innerModel().withFrontendPort(port); - - // If backend port not specified earlier, make it the same as the frontend by default - if (this.innerModel().backendPort() == null || this.innerModel().backendPort() == 0) { - this.innerModel().withBackendPort(port); - } - - return this; - } - - @Override - public LoadBalancingRuleImpl toBackendPort(int port) { - this.innerModel().withBackendPort(port); - return this; - } - - @Override - public LoadBalancingRuleImpl toExistingVirtualMachines(HasNetworkInterfaces... vms) { - return (vms != null) ? this.toExistingVirtualMachines(Arrays.asList(vms)) : this; - } - - @Override - public LoadBalancingRuleImpl toExistingVirtualMachines(Collection vms) { - if (vms != null) { - LoadBalancerBackendImpl backend = this.parent().ensureUniqueBackend().withExistingVirtualMachines(vms); - this.toBackend(backend.name()); - } - return this; - } - - @Override - public LoadBalancingRuleImpl withLoadDistribution(LoadDistribution loadDistribution) { - this.innerModel().withLoadDistribution(loadDistribution); - return this; - } - - @Override - public LoadBalancingRuleImpl fromFrontend(String frontendName) { - SubResource frontendRef = this.parent().ensureFrontendRef(frontendName); - if (frontendRef != null) { - this.innerModel().withFrontendIpConfiguration(frontendRef); - } - return this; - } - - @Override - public LoadBalancingRuleImpl toBackend(String backendName) { - // Ensure existence of backend, creating one if needed - this.parent().defineBackend(backendName).attach(); - - SubResource backendRef = - new SubResource().withId(this.parent().futureResourceId() + "/backendAddressPools/" + backendName); - this.innerModel().withBackendAddressPool(backendRef); - return this; - } - - @Override - public LoadBalancingRuleImpl withProbe(String name) { - SubResource probeRef = new SubResource().withId(this.parent().futureResourceId() + "/probes/" + name); - this.innerModel().withProbe(probeRef); - return this; - } - - @Override - public LoadBalancingRuleImpl withoutProbe() { - this.innerModel().withProbe(null); - return this; - } - - // Verbs - - @Override - public LoadBalancerImpl attach() { - return this.parent().withLoadBalancingRule(this); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/LocalNetworkGatewayImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/LocalNetworkGatewayImpl.java deleted file mode 100644 index 3da52abc4d22..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/LocalNetworkGatewayImpl.java +++ /dev/null @@ -1,148 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.network.models.AddressSpace; -import com.azure.resourcemanager.network.models.BgpSettings; -import com.azure.resourcemanager.network.models.LocalNetworkGateway; -import com.azure.resourcemanager.network.models.AppliableWithTags; -import com.azure.resourcemanager.network.fluent.models.LocalNetworkGatewayInner; -import com.azure.resourcemanager.network.models.TagsObject; -import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.GroupableResourceImpl; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashSet; -import java.util.Set; -import reactor.core.publisher.Mono; - -/** Implementation for LocalNetworkGateway and its create and update interfaces. */ -class LocalNetworkGatewayImpl - extends GroupableResourceImpl< - LocalNetworkGateway, LocalNetworkGatewayInner, LocalNetworkGatewayImpl, NetworkManager> - implements LocalNetworkGateway, - LocalNetworkGateway.Definition, - LocalNetworkGateway.Update, - AppliableWithTags { - - LocalNetworkGatewayImpl( - String name, final LocalNetworkGatewayInner innerModel, final NetworkManager networkManager) { - super(name, innerModel, networkManager); - } - - @Override - public String ipAddress() { - return innerModel().gatewayIpAddress(); - } - - @Override - public BgpSettings bgpSettings() { - return innerModel().bgpSettings(); - } - - @Override - public Set addressSpaces() { - Set addressSpaces = new HashSet<>(); - if (this.innerModel().localNetworkAddressSpace() != null - && this.innerModel().localNetworkAddressSpace().addressPrefixes() != null) { - addressSpaces.addAll(this.innerModel().localNetworkAddressSpace().addressPrefixes()); - } - return Collections.unmodifiableSet(addressSpaces); - } - - @Override - public String provisioningState() { - return innerModel().provisioningState(); - } - - @Override - public LocalNetworkGatewayImpl withIPAddress(String ipAddress) { - this.innerModel().withGatewayIpAddress(ipAddress); - return this; - } - - @Override - public LocalNetworkGatewayImpl withAddressSpace(String cidr) { - if (this.innerModel().localNetworkAddressSpace() == null) { - this.innerModel().withLocalNetworkAddressSpace(new AddressSpace()); - } - if (this.innerModel().localNetworkAddressSpace().addressPrefixes() == null) { - this.innerModel().localNetworkAddressSpace().withAddressPrefixes(new ArrayList()); - } - - this.innerModel().localNetworkAddressSpace().addressPrefixes().add(cidr); - return this; - } - - @Override - public LocalNetworkGatewayImpl withoutAddressSpace(String cidr) { - if (this.innerModel().localNetworkAddressSpace() == null - || this.innerModel().localNetworkAddressSpace().addressPrefixes() == null) { - return this; - } - this.innerModel().localNetworkAddressSpace().addressPrefixes().remove(cidr); - return this; - } - - @Override - public LocalNetworkGatewayImpl withBgp(long asn, String bgpPeeringAddress) { - ensureBgpSettings().withAsn(asn).withBgpPeeringAddress(bgpPeeringAddress); - return this; - } - - @Override - public LocalNetworkGatewayImpl withoutBgp() { - innerModel().withBgpSettings(null); - return this; - } - - @Override - protected Mono getInnerAsync() { - return this - .manager() - .serviceClient() - .getLocalNetworkGateways() - .getByResourceGroupAsync(this.resourceGroupName(), this.name()); - } - - @Override - public Mono createResourceAsync() { - return this - .manager() - .serviceClient() - .getLocalNetworkGateways() - .createOrUpdateAsync(resourceGroupName(), name(), innerModel()) - .map(innerToFluentMap(this)); - } - - private BgpSettings ensureBgpSettings() { - if (innerModel().bgpSettings() == null) { - innerModel().withBgpSettings(new BgpSettings()); - } - return innerModel().bgpSettings(); - } - - @Override - public LocalNetworkGatewayImpl updateTags() { - return this; - } - - @Override - public LocalNetworkGateway applyTags() { - return applyTagsAsync().block(); - } - - @Override - public Mono applyTagsAsync() { - return this - .manager() - .serviceClient() - .getLocalNetworkGateways() - .updateTagsAsync(resourceGroupName(), name(), new TagsObject().withTags(innerModel().tags())) - .flatMap( - inner -> { - setInner(inner); - return Mono.just((LocalNetworkGateway) LocalNetworkGatewayImpl.this); - }); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/LocalNetworkGatewaysClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/LocalNetworkGatewaysClientImpl.java deleted file mode 100644 index 6c5bbcf06ef8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/LocalNetworkGatewaysClientImpl.java +++ /dev/null @@ -1,1356 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.LocalNetworkGatewaysClient; -import com.azure.resourcemanager.network.fluent.models.LocalNetworkGatewayInner; -import com.azure.resourcemanager.network.models.LocalNetworkGatewayListResult; -import com.azure.resourcemanager.network.models.TagsObject; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in LocalNetworkGatewaysClient. */ -public final class LocalNetworkGatewaysClientImpl - implements InnerSupportsGet, InnerSupportsDelete, LocalNetworkGatewaysClient { - private final ClientLogger logger = new ClientLogger(LocalNetworkGatewaysClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final LocalNetworkGatewaysService service; - - /** The service client containing this operation class. */ - private final NetworkManagementClientImpl client; - - /** - * Initializes an instance of LocalNetworkGatewaysClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - LocalNetworkGatewaysClientImpl(NetworkManagementClientImpl client) { - this.service = - RestProxy - .create(LocalNetworkGatewaysService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for NetworkManagementClientLocalNetworkGateways to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "NetworkManagementCli") - private interface LocalNetworkGatewaysService { - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/localNetworkGateways/{localNetworkGatewayName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("localNetworkGatewayName") String localNetworkGatewayName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") LocalNetworkGatewayInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/localNetworkGateways/{localNetworkGatewayName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("localNetworkGatewayName") String localNetworkGatewayName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/localNetworkGateways/{localNetworkGatewayName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("localNetworkGatewayName") String localNetworkGatewayName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/localNetworkGateways/{localNetworkGatewayName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> updateTags( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("localNetworkGatewayName") String localNetworkGatewayName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") TagsObject parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/localNetworkGateways") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Creates or updates a local network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param localNetworkGatewayName The name of the local network gateway. - * @param parameters Parameters supplied to the create or update local network gateway operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String localNetworkGatewayName, LocalNetworkGatewayInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (localNetworkGatewayName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter localNetworkGatewayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - localNetworkGatewayName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a local network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param localNetworkGatewayName The name of the local network gateway. - * @param parameters Parameters supplied to the create or update local network gateway operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String localNetworkGatewayName, - LocalNetworkGatewayInner parameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (localNetworkGatewayName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter localNetworkGatewayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - localNetworkGatewayName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Creates or updates a local network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param localNetworkGatewayName The name of the local network gateway. - * @param parameters Parameters supplied to the create or update local network gateway operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, LocalNetworkGatewayInner> beginCreateOrUpdateAsync( - String resourceGroupName, String localNetworkGatewayName, LocalNetworkGatewayInner parameters) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, localNetworkGatewayName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - LocalNetworkGatewayInner.class, - LocalNetworkGatewayInner.class, - Context.NONE); - } - - /** - * Creates or updates a local network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param localNetworkGatewayName The name of the local network gateway. - * @param parameters Parameters supplied to the create or update local network gateway operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, LocalNetworkGatewayInner> beginCreateOrUpdateAsync( - String resourceGroupName, - String localNetworkGatewayName, - LocalNetworkGatewayInner parameters, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, localNetworkGatewayName, parameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - LocalNetworkGatewayInner.class, - LocalNetworkGatewayInner.class, - context); - } - - /** - * Creates or updates a local network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param localNetworkGatewayName The name of the local network gateway. - * @param parameters Parameters supplied to the create or update local network gateway operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, LocalNetworkGatewayInner> beginCreateOrUpdate( - String resourceGroupName, String localNetworkGatewayName, LocalNetworkGatewayInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, localNetworkGatewayName, parameters).getSyncPoller(); - } - - /** - * Creates or updates a local network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param localNetworkGatewayName The name of the local network gateway. - * @param parameters Parameters supplied to the create or update local network gateway operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, LocalNetworkGatewayInner> beginCreateOrUpdate( - String resourceGroupName, - String localNetworkGatewayName, - LocalNetworkGatewayInner parameters, - Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, localNetworkGatewayName, parameters, context) - .getSyncPoller(); - } - - /** - * Creates or updates a local network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param localNetworkGatewayName The name of the local network gateway. - * @param parameters Parameters supplied to the create or update local network gateway operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, String localNetworkGatewayName, LocalNetworkGatewayInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, localNetworkGatewayName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a local network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param localNetworkGatewayName The name of the local network gateway. - * @param parameters Parameters supplied to the create or update local network gateway operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, - String localNetworkGatewayName, - LocalNetworkGatewayInner parameters, - Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, localNetworkGatewayName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a local network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param localNetworkGatewayName The name of the local network gateway. - * @param parameters Parameters supplied to the create or update local network gateway operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public LocalNetworkGatewayInner createOrUpdate( - String resourceGroupName, String localNetworkGatewayName, LocalNetworkGatewayInner parameters) { - return createOrUpdateAsync(resourceGroupName, localNetworkGatewayName, parameters).block(); - } - - /** - * Creates or updates a local network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param localNetworkGatewayName The name of the local network gateway. - * @param parameters Parameters supplied to the create or update local network gateway operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public LocalNetworkGatewayInner createOrUpdate( - String resourceGroupName, - String localNetworkGatewayName, - LocalNetworkGatewayInner parameters, - Context context) { - return createOrUpdateAsync(resourceGroupName, localNetworkGatewayName, parameters, context).block(); - } - - /** - * Gets the specified local network gateway in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param localNetworkGatewayName The name of the local network gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified local network gateway in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String localNetworkGatewayName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (localNetworkGatewayName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter localNetworkGatewayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - localNetworkGatewayName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the specified local network gateway in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param localNetworkGatewayName The name of the local network gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified local network gateway in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String localNetworkGatewayName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (localNetworkGatewayName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter localNetworkGatewayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - localNetworkGatewayName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets the specified local network gateway in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param localNetworkGatewayName The name of the local network gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified local network gateway in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync( - String resourceGroupName, String localNetworkGatewayName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, localNetworkGatewayName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the specified local network gateway in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param localNetworkGatewayName The name of the local network gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified local network gateway in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public LocalNetworkGatewayInner getByResourceGroup(String resourceGroupName, String localNetworkGatewayName) { - return getByResourceGroupAsync(resourceGroupName, localNetworkGatewayName).block(); - } - - /** - * Gets the specified local network gateway in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param localNetworkGatewayName The name of the local network gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified local network gateway in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String localNetworkGatewayName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, localNetworkGatewayName, context).block(); - } - - /** - * Deletes the specified local network gateway. - * - * @param resourceGroupName The name of the resource group. - * @param localNetworkGatewayName The name of the local network gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync( - String resourceGroupName, String localNetworkGatewayName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (localNetworkGatewayName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter localNetworkGatewayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - localNetworkGatewayName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the specified local network gateway. - * - * @param resourceGroupName The name of the resource group. - * @param localNetworkGatewayName The name of the local network gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String localNetworkGatewayName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (localNetworkGatewayName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter localNetworkGatewayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - localNetworkGatewayName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Deletes the specified local network gateway. - * - * @param resourceGroupName The name of the resource group. - * @param localNetworkGatewayName The name of the local network gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String localNetworkGatewayName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, localNetworkGatewayName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deletes the specified local network gateway. - * - * @param resourceGroupName The name of the resource group. - * @param localNetworkGatewayName The name of the local network gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String localNetworkGatewayName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, localNetworkGatewayName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes the specified local network gateway. - * - * @param resourceGroupName The name of the resource group. - * @param localNetworkGatewayName The name of the local network gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete(String resourceGroupName, String localNetworkGatewayName) { - return beginDeleteAsync(resourceGroupName, localNetworkGatewayName).getSyncPoller(); - } - - /** - * Deletes the specified local network gateway. - * - * @param resourceGroupName The name of the resource group. - * @param localNetworkGatewayName The name of the local network gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String localNetworkGatewayName, Context context) { - return beginDeleteAsync(resourceGroupName, localNetworkGatewayName, context).getSyncPoller(); - } - - /** - * Deletes the specified local network gateway. - * - * @param resourceGroupName The name of the resource group. - * @param localNetworkGatewayName The name of the local network gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String localNetworkGatewayName) { - return beginDeleteAsync(resourceGroupName, localNetworkGatewayName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified local network gateway. - * - * @param resourceGroupName The name of the resource group. - * @param localNetworkGatewayName The name of the local network gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String localNetworkGatewayName, Context context) { - return beginDeleteAsync(resourceGroupName, localNetworkGatewayName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified local network gateway. - * - * @param resourceGroupName The name of the resource group. - * @param localNetworkGatewayName The name of the local network gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String localNetworkGatewayName) { - deleteAsync(resourceGroupName, localNetworkGatewayName).block(); - } - - /** - * Deletes the specified local network gateway. - * - * @param resourceGroupName The name of the resource group. - * @param localNetworkGatewayName The name of the local network gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String localNetworkGatewayName, Context context) { - deleteAsync(resourceGroupName, localNetworkGatewayName, context).block(); - } - - /** - * Updates a local network gateway tags. - * - * @param resourceGroupName The name of the resource group. - * @param localNetworkGatewayName The name of the local network gateway. - * @param parameters Parameters supplied to update local network gateway tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateTagsWithResponseAsync( - String resourceGroupName, String localNetworkGatewayName, TagsObject parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (localNetworkGatewayName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter localNetworkGatewayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updateTags( - this.client.getEndpoint(), - resourceGroupName, - localNetworkGatewayName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates a local network gateway tags. - * - * @param resourceGroupName The name of the resource group. - * @param localNetworkGatewayName The name of the local network gateway. - * @param parameters Parameters supplied to update local network gateway tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateTagsWithResponseAsync( - String resourceGroupName, String localNetworkGatewayName, TagsObject parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (localNetworkGatewayName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter localNetworkGatewayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updateTags( - this.client.getEndpoint(), - resourceGroupName, - localNetworkGatewayName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Updates a local network gateway tags. - * - * @param resourceGroupName The name of the resource group. - * @param localNetworkGatewayName The name of the local network gateway. - * @param parameters Parameters supplied to update local network gateway tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, LocalNetworkGatewayInner> beginUpdateTagsAsync( - String resourceGroupName, String localNetworkGatewayName, TagsObject parameters) { - Mono>> mono = - updateTagsWithResponseAsync(resourceGroupName, localNetworkGatewayName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - LocalNetworkGatewayInner.class, - LocalNetworkGatewayInner.class, - Context.NONE); - } - - /** - * Updates a local network gateway tags. - * - * @param resourceGroupName The name of the resource group. - * @param localNetworkGatewayName The name of the local network gateway. - * @param parameters Parameters supplied to update local network gateway tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, LocalNetworkGatewayInner> beginUpdateTagsAsync( - String resourceGroupName, String localNetworkGatewayName, TagsObject parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - updateTagsWithResponseAsync(resourceGroupName, localNetworkGatewayName, parameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - LocalNetworkGatewayInner.class, - LocalNetworkGatewayInner.class, - context); - } - - /** - * Updates a local network gateway tags. - * - * @param resourceGroupName The name of the resource group. - * @param localNetworkGatewayName The name of the local network gateway. - * @param parameters Parameters supplied to update local network gateway tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, LocalNetworkGatewayInner> beginUpdateTags( - String resourceGroupName, String localNetworkGatewayName, TagsObject parameters) { - return beginUpdateTagsAsync(resourceGroupName, localNetworkGatewayName, parameters).getSyncPoller(); - } - - /** - * Updates a local network gateway tags. - * - * @param resourceGroupName The name of the resource group. - * @param localNetworkGatewayName The name of the local network gateway. - * @param parameters Parameters supplied to update local network gateway tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, LocalNetworkGatewayInner> beginUpdateTags( - String resourceGroupName, String localNetworkGatewayName, TagsObject parameters, Context context) { - return beginUpdateTagsAsync(resourceGroupName, localNetworkGatewayName, parameters, context).getSyncPoller(); - } - - /** - * Updates a local network gateway tags. - * - * @param resourceGroupName The name of the resource group. - * @param localNetworkGatewayName The name of the local network gateway. - * @param parameters Parameters supplied to update local network gateway tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateTagsAsync( - String resourceGroupName, String localNetworkGatewayName, TagsObject parameters) { - return beginUpdateTagsAsync(resourceGroupName, localNetworkGatewayName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates a local network gateway tags. - * - * @param resourceGroupName The name of the resource group. - * @param localNetworkGatewayName The name of the local network gateway. - * @param parameters Parameters supplied to update local network gateway tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateTagsAsync( - String resourceGroupName, String localNetworkGatewayName, TagsObject parameters, Context context) { - return beginUpdateTagsAsync(resourceGroupName, localNetworkGatewayName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates a local network gateway tags. - * - * @param resourceGroupName The name of the resource group. - * @param localNetworkGatewayName The name of the local network gateway. - * @param parameters Parameters supplied to update local network gateway tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public LocalNetworkGatewayInner updateTags( - String resourceGroupName, String localNetworkGatewayName, TagsObject parameters) { - return updateTagsAsync(resourceGroupName, localNetworkGatewayName, parameters).block(); - } - - /** - * Updates a local network gateway tags. - * - * @param resourceGroupName The name of the resource group. - * @param localNetworkGatewayName The name of the local network gateway. - * @param parameters Parameters supplied to update local network gateway tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public LocalNetworkGatewayInner updateTags( - String resourceGroupName, String localNetworkGatewayName, TagsObject parameters, Context context) { - return updateTagsAsync(resourceGroupName, localNetworkGatewayName, parameters, context).block(); - } - - /** - * Gets all the local network gateways in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the local network gateways in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all the local network gateways in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the local network gateways in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all the local network gateways in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the local network gateways in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets all the local network gateways in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the local network gateways in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all the local network gateways in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the local network gateways in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * Gets all the local network gateways in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the local network gateways in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListLocalNetworkGateways API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListLocalNetworkGateways API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/LocalNetworkGatewaysImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/LocalNetworkGatewaysImpl.java deleted file mode 100644 index 1a3e101cae60..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/LocalNetworkGatewaysImpl.java +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.CoreUtils; -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.network.fluent.LocalNetworkGatewaysClient; -import com.azure.resourcemanager.network.fluent.models.LocalNetworkGatewayInner; -import com.azure.resourcemanager.network.models.LocalNetworkGateway; -import com.azure.resourcemanager.network.models.LocalNetworkGateways; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.GroupableResourcesImpl; -import com.azure.resourcemanager.resources.fluentcore.utils.PagedConverter; -import reactor.core.publisher.Mono; - -/** Implementation for LocalNetworkGateways. */ -public class LocalNetworkGatewaysImpl - extends GroupableResourcesImpl< - LocalNetworkGateway, - LocalNetworkGatewayImpl, - LocalNetworkGatewayInner, - LocalNetworkGatewaysClient, - NetworkManager> - implements LocalNetworkGateways { - - public LocalNetworkGatewaysImpl(final NetworkManager networkManager) { - super(networkManager.serviceClient().getLocalNetworkGateways(), networkManager); - } - - @Override - public LocalNetworkGatewayImpl define(String name) { - return wrapModel(name); - } - - @Override - public PagedIterable list() { - return new PagedIterable<>(this.listAsync()); - } - - @Override - public PagedFlux listAsync() { - return PagedConverter.mapPage(PagedConverter.mergePagedFlux(this.manager().resourceManager().resourceGroups().listAsync(), - rg -> inner().listByResourceGroupAsync(rg.name())), this::wrapModel); - } - - @Override - public PagedIterable listByResourceGroup(String groupName) { - return new PagedIterable<>(this.listByResourceGroupAsync(groupName)); - } - - @Override - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - if (CoreUtils.isNullOrEmpty(resourceGroupName)) { - return new PagedFlux<>(() -> Mono.error( - new IllegalArgumentException("Parameter 'resourceGroupName' is required and cannot be null."))); - } - return wrapPageAsync(this.inner().listByResourceGroupAsync(resourceGroupName)); - } - - @Override - protected Mono getInnerAsync(String groupName, String name) { - return this.inner().getByResourceGroupAsync(groupName, name); - } - - @Override - protected Mono deleteInnerAsync(String groupName, String name) { - return this.inner().deleteAsync(groupName, name); - } - - // Fluent model create helpers - - @Override - protected LocalNetworkGatewayImpl wrapModel(String name) { - LocalNetworkGatewayInner inner = new LocalNetworkGatewayInner(); - - return new LocalNetworkGatewayImpl(name, inner, super.manager()); - } - - @Override - protected LocalNetworkGatewayImpl wrapModel(LocalNetworkGatewayInner inner) { - if (inner == null) { - return null; - } - return new LocalNetworkGatewayImpl(inner.name(), inner, this.manager()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NetworkImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NetworkImpl.java deleted file mode 100644 index f57abb958346..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NetworkImpl.java +++ /dev/null @@ -1,329 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.management.SubResource; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.network.fluent.models.IpAddressAvailabilityResultInner; -import com.azure.resourcemanager.network.fluent.models.SubnetInner; -import com.azure.resourcemanager.network.fluent.models.VirtualNetworkInner; -import com.azure.resourcemanager.network.models.AddressSpace; -import com.azure.resourcemanager.network.models.DdosProtectionPlan; -import com.azure.resourcemanager.network.models.DhcpOptions; -import com.azure.resourcemanager.network.models.Network; -import com.azure.resourcemanager.network.models.NetworkPeerings; -import com.azure.resourcemanager.network.models.Subnet; -import com.azure.resourcemanager.network.models.TagsObject; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import reactor.core.publisher.Mono; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.TreeMap; - -/** Implementation for Network and its create and update interfaces. */ -class NetworkImpl extends GroupableParentResourceWithTagsImpl - implements Network, Network.Definition, Network.Update { - - private final ClientLogger logger = new ClientLogger(getClass()); - private Map subnets; - private NetworkPeeringsImpl peerings; - private Creatable ddosProtectionPlanCreatable; - - NetworkImpl(String name, final VirtualNetworkInner innerModel, final NetworkManager networkManager) { - super(name, innerModel, networkManager); - } - - @Override - protected void initializeChildrenFromInner() { - // Initialize subnets - this.subnets = new TreeMap<>(); - List inners = this.innerModel().subnets(); - if (inners != null) { - for (SubnetInner inner : inners) { - SubnetImpl subnet = new SubnetImpl(inner, this); - this.subnets.put(inner.name(), subnet); - } - } - - this.peerings = new NetworkPeeringsImpl(this); - } - - // Verbs - - @Override - public Mono refreshAsync() { - return super - .refreshAsync() - .map( - network -> { - NetworkImpl impl = (NetworkImpl) network; - impl.initializeChildrenFromInner(); - return impl; - }); - } - - @Override - protected Mono getInnerAsync() { - return this - .manager() - .serviceClient() - .getVirtualNetworks() - .getByResourceGroupAsync(this.resourceGroupName(), this.name()); - } - - @Override - protected Mono applyTagsToInnerAsync() { - return this - .manager() - .serviceClient() - .getVirtualNetworks() - .updateTagsAsync(resourceGroupName(), name(), new TagsObject().withTags(innerModel().tags())); - } - - @Override - public boolean isPrivateIPAddressAvailable(String ipAddress) { - IpAddressAvailabilityResultInner result = checkIPAvailability(ipAddress); - return (result != null) ? result.available() : false; - } - - @Override - public boolean isPrivateIPAddressInNetwork(String ipAddress) { - IpAddressAvailabilityResultInner result = checkIPAvailability(ipAddress); - return result != null; - } - - // Helpers - - private IpAddressAvailabilityResultInner checkIPAvailability(String ipAddress) { - if (ipAddress == null) { - return null; - } - IpAddressAvailabilityResultInner result = null; - try { - result = - this - .manager() - .serviceClient() - .getVirtualNetworks() - .checkIpAddressAvailability(this.resourceGroupName(), this.name(), ipAddress); - } catch (ManagementException e) { - if (!e.getValue().getCode().equalsIgnoreCase("PrivateIPAddressNotInAnySubnet")) { - throw logger.logExceptionAsError(e); - // Rethrow if the exception reason is anything other than IP address not found - } - } - return result; - } - - NetworkImpl withSubnet(SubnetImpl subnet) { - this.subnets.put(subnet.name(), subnet); - return this; - } - - // Setters (fluent) - - @Override - public NetworkImpl withDnsServer(String ipAddress) { - if (this.innerModel().dhcpOptions() == null) { - this.innerModel().withDhcpOptions(new DhcpOptions()); - } - - if (this.innerModel().dhcpOptions().dnsServers() == null) { - this.innerModel().dhcpOptions().withDnsServers(new ArrayList()); - } - - this.innerModel().dhcpOptions().dnsServers().add(ipAddress); - return this; - } - - @Override - public NetworkImpl withSubnet(String name, String cidr) { - return this.defineSubnet(name).withAddressPrefix(cidr).attach(); - } - - @Override - public NetworkImpl withSubnets(Map nameCidrPairs) { - this.subnets.clear(); - for (Entry pair : nameCidrPairs.entrySet()) { - this.withSubnet(pair.getKey(), pair.getValue()); - } - return this; - } - - @Override - public NetworkImpl withoutSubnet(String name) { - this.subnets.remove(name); - return this; - } - - @Override - public NetworkImpl withAddressSpace(String cidr) { - if (this.innerModel().addressSpace() == null) { - this.innerModel().withAddressSpace(new AddressSpace()); - } - - if (this.innerModel().addressSpace().addressPrefixes() == null) { - this.innerModel().addressSpace().withAddressPrefixes(new ArrayList()); - } - - this.innerModel().addressSpace().addressPrefixes().add(cidr); - return this; - } - - @Override - public SubnetImpl defineSubnet(String name) { - SubnetInner inner = new SubnetInner().withName(name); - return new SubnetImpl(inner, this); - } - - @Override - public NetworkImpl withoutAddressSpace(String cidr) { - if (cidr != null - && this.innerModel().addressSpace() != null - && this.innerModel().addressSpace().addressPrefixes() != null) { - this.innerModel().addressSpace().addressPrefixes().remove(cidr); - } - return this; - } - - // Getters - - @Override - public List addressSpaces() { - List addressSpaces = new ArrayList(); - if (this.innerModel().addressSpace() == null) { - return Collections.unmodifiableList(addressSpaces); - } else if (this.innerModel().addressSpace().addressPrefixes() == null) { - return Collections.unmodifiableList(addressSpaces); - } else { - return Collections.unmodifiableList(this.innerModel().addressSpace().addressPrefixes()); - } - } - - @Override - public List dnsServerIPs() { - List ips = new ArrayList(); - if (this.innerModel().dhcpOptions() == null) { - return Collections.unmodifiableList(ips); - } else if (this.innerModel().dhcpOptions().dnsServers() == null) { - return Collections.unmodifiableList(ips); - } else { - return this.innerModel().dhcpOptions().dnsServers(); - } - } - - @Override - public Map subnets() { - return Collections.unmodifiableMap(this.subnets); - } - - @Override - protected void beforeCreating() { - // Ensure address spaces - if (this.addressSpaces().size() == 0) { - this.withAddressSpace("10.0.0.0/16"); - } - - if (isInCreateMode()) { - // Create a subnet as needed, covering the entire first address space - if (this.subnets.size() == 0) { - this.withSubnet("subnet1", this.addressSpaces().get(0)); - } - } - - // Reset and update subnets - this.innerModel().withSubnets(innersFromWrappers(this.subnets.values())); - } - - @Override - public SubnetImpl updateSubnet(String name) { - return (SubnetImpl) this.subnets.get(name); - } - - @Override - protected Mono createInner() { - if (ddosProtectionPlanCreatable != null && this.taskResult(ddosProtectionPlanCreatable.key()) != null) { - DdosProtectionPlan ddosProtectionPlan = - this.taskResult(ddosProtectionPlanCreatable.key()); - withExistingDdosProtectionPlan(ddosProtectionPlan.id()); - } - return this - .manager() - .serviceClient() - .getVirtualNetworks() - .createOrUpdateAsync(this.resourceGroupName(), this.name(), this.innerModel()) - .map( - virtualNetworkInner -> { - NetworkImpl.this.ddosProtectionPlanCreatable = null; - return virtualNetworkInner; - }); - } - - @Override - public NetworkPeerings peerings() { - return this.peerings; - } - - @Override - public boolean isDdosProtectionEnabled() { - return ResourceManagerUtils.toPrimitiveBoolean(innerModel().enableDdosProtection()); - } - - @Override - public boolean isVmProtectionEnabled() { - return ResourceManagerUtils.toPrimitiveBoolean(innerModel().enableVmProtection()); - } - - @Override - public String ddosProtectionPlanId() { - return innerModel().ddosProtectionPlan() == null ? null : innerModel().ddosProtectionPlan().id(); - } - - @Override - public NetworkImpl withNewDdosProtectionPlan() { - innerModel().withEnableDdosProtection(true); - DdosProtectionPlan.DefinitionStages.WithGroup ddosProtectionPlanWithGroup = - manager() - .ddosProtectionPlans() - .define(this.manager().resourceManager().internalContext().randomResourceName(name(), 20)) - .withRegion(region()); - if (super.creatableGroup != null && isInCreateMode()) { - ddosProtectionPlanCreatable = ddosProtectionPlanWithGroup.withNewResourceGroup(super.creatableGroup); - } else { - ddosProtectionPlanCreatable = ddosProtectionPlanWithGroup.withExistingResourceGroup(resourceGroupName()); - } - this.addDependency(ddosProtectionPlanCreatable); - return this; - } - - @Override - public NetworkImpl withExistingDdosProtectionPlan(String planId) { - innerModel().withEnableDdosProtection(true).withDdosProtectionPlan(new SubResource().withId(planId)); - return this; - } - - @Override - public NetworkImpl withoutDdosProtectionPlan() { - innerModel().withEnableDdosProtection(false).withDdosProtectionPlan(null); - return this; - } - - @Override - public NetworkImpl withVmProtection() { - innerModel().withEnableVmProtection(true); - return this; - } - - @Override - public NetworkImpl withoutVmProtection() { - innerModel().withEnableVmProtection(false); - return this; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NetworkInterfaceImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NetworkInterfaceImpl.java deleted file mode 100644 index 5656f7878c41..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NetworkInterfaceImpl.java +++ /dev/null @@ -1,569 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.management.provider.IdentifierProvider; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.network.fluent.models.ApplicationSecurityGroupInner; -import com.azure.resourcemanager.network.models.ApplicationSecurityGroup; -import com.azure.resourcemanager.network.models.IpAllocationMethod; -import com.azure.resourcemanager.network.models.LoadBalancer; -import com.azure.resourcemanager.network.models.Network; -import com.azure.resourcemanager.network.models.NetworkInterface; -import com.azure.resourcemanager.network.models.NetworkSecurityGroup; -import com.azure.resourcemanager.network.models.NicIpConfiguration; -import com.azure.resourcemanager.network.models.PublicIpAddress; -import com.azure.resourcemanager.network.fluent.models.NetworkInterfaceIpConfigurationInner; -import com.azure.resourcemanager.network.fluent.models.NetworkInterfaceInner; -import com.azure.resourcemanager.network.fluent.models.NetworkSecurityGroupInner; -import com.azure.resourcemanager.network.models.TagsObject; -import com.azure.resourcemanager.resources.fluentcore.model.Accepted; -import com.azure.resourcemanager.resources.fluentcore.model.Indexable; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.AcceptedImpl; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import com.azure.resourcemanager.resources.models.ResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils; -import com.azure.resourcemanager.resources.fluentcore.arm.models.Resource; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.TreeMap; - -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** Implementation for NetworkInterface and its create and update interfaces. */ -class NetworkInterfaceImpl - extends GroupableParentResourceWithTagsImpl< - NetworkInterface, NetworkInterfaceInner, NetworkInterfaceImpl, NetworkManager> - implements NetworkInterface, NetworkInterface.Definition, NetworkInterface.Update { - - private final ClientLogger logger = new ClientLogger(this.getClass()); - - /** the name of the network interface. */ - private final String nicName; - /** used to generate unique name for any dependency resources. */ - protected final IdentifierProvider namer; - /** references to all ip configuration. */ - private Map nicIPConfigurations; - /** unique key of a creatable network security group to be associated with the network interface. */ - private String creatableNetworkSecurityGroupKey; - /** reference to an network security group to be associated with the network interface. */ - private NetworkSecurityGroup existingNetworkSecurityGroupToAssociate; - /** cached related resources. */ - private NetworkSecurityGroup networkSecurityGroup; - - NetworkInterfaceImpl(String name, NetworkInterfaceInner innerModel, final NetworkManager networkManager) { - super(name, innerModel, networkManager); - this.nicName = name; - this.namer = this.manager().resourceManager().internalContext().createIdentifierProvider(this.nicName); - initializeChildrenFromInner(); - } - - // Verbs - - @Override - public Mono refreshAsync() { - return super - .refreshAsync() - .map( - networkInterface -> { - NetworkInterfaceImpl impl = (NetworkInterfaceImpl) networkInterface; - impl.clearCachedRelatedResources(); - impl.initializeChildrenFromInner(); - return impl; - }); - } - - @Override - protected Mono getInnerAsync() { - return this - .manager() - .serviceClient() - .getNetworkInterfaces() - .getByResourceGroupAsync(this.resourceGroupName(), this.name()); - } - - @Override - protected Mono applyTagsToInnerAsync() { - return this - .manager() - .serviceClient() - .getNetworkInterfaces() - .updateTagsAsync(resourceGroupName(), name(), new TagsObject().withTags(innerModel().tags())); - } - - // Setters (fluent) - - @Override - public NetworkInterfaceImpl withAcceleratedNetworking() { - this.innerModel().withEnableAcceleratedNetworking(true); - return this; - } - - @Override - public NetworkInterfaceImpl withoutAcceleratedNetworking() { - this.innerModel().withEnableAcceleratedNetworking(false); - return this; - } - - @Override - public NetworkInterfaceImpl withNewPrimaryNetwork(Creatable creatable) { - this.primaryIPConfiguration().withNewNetwork(creatable); - return this; - } - - @Override - public NetworkInterfaceImpl withNewPrimaryNetwork(String name, String addressSpaceCidr) { - this.primaryIPConfiguration().withNewNetwork(name, addressSpaceCidr); - return this; - } - - @Override - public NetworkInterfaceImpl withNewPrimaryNetwork(String addressSpaceCidr) { - this.primaryIPConfiguration().withNewNetwork(addressSpaceCidr); - return this; - } - - @Override - public NetworkInterfaceImpl withExistingPrimaryNetwork(Network network) { - this.primaryIPConfiguration().withExistingNetwork(network); - return this; - } - - @Override - public NetworkInterfaceImpl withNewPrimaryPublicIPAddress(Creatable creatable) { - this.primaryIPConfiguration().withNewPublicIpAddress(creatable); - return this; - } - - @Override - public NetworkInterfaceImpl withNewPrimaryPublicIPAddress() { - this.primaryIPConfiguration().withNewPublicIpAddress(); - return this; - } - - @Override - public NetworkInterfaceImpl withNewPrimaryPublicIPAddress(String leafDnsLabel) { - this.primaryIPConfiguration().withNewPublicIpAddress(leafDnsLabel); - return this; - } - - @Override - public NetworkInterfaceImpl withExistingLoadBalancerBackend(LoadBalancer loadBalancer, String backendName) { - this.primaryIPConfiguration().withExistingLoadBalancerBackend(loadBalancer, backendName); - return this; - } - - @Override - public NetworkInterfaceImpl withExistingLoadBalancerInboundNatRule( - LoadBalancer loadBalancer, String inboundNatRuleName) { - this.primaryIPConfiguration().withExistingLoadBalancerInboundNatRule(loadBalancer, inboundNatRuleName); - return this; - } - - @Override - public Update withoutLoadBalancerBackends() { - for (NicIpConfiguration ipConfig : this.ipConfigurations().values()) { - this.updateIPConfiguration(ipConfig.name()).withoutLoadBalancerBackends(); - } - return this; - } - - @Override - public Update withoutLoadBalancerInboundNatRules() { - for (NicIpConfiguration ipConfig : this.ipConfigurations().values()) { - this.updateIPConfiguration(ipConfig.name()).withoutLoadBalancerInboundNatRules(); - } - return this; - } - - @Override - public NetworkInterfaceImpl withoutPrimaryPublicIPAddress() { - this.primaryIPConfiguration().withoutPublicIpAddress(); - return this; - } - - @Override - public NetworkInterfaceImpl withExistingPrimaryPublicIPAddress(PublicIpAddress publicIPAddress) { - this.primaryIPConfiguration().withExistingPublicIpAddress(publicIPAddress); - this.primaryIPConfiguration().withPrivateIpVersion(publicIPAddress.version()); - return this; - } - - @Override - public NetworkInterfaceImpl withPrimaryPrivateIPAddressDynamic() { - this.primaryIPConfiguration().withPrivateIpAddressDynamic(); - return this; - } - - @Override - public NetworkInterfaceImpl withPrimaryPrivateIPAddressStatic(String staticPrivateIPAddress) { - this.primaryIPConfiguration().withPrivateIpAddressStatic(staticPrivateIPAddress); - return this; - } - - @Override - public NetworkInterfaceImpl withNewNetworkSecurityGroup(Creatable creatable) { - if (this.creatableNetworkSecurityGroupKey == null) { - this.creatableNetworkSecurityGroupKey = this.addDependency(creatable); - } - return this; - } - - @Override - public NetworkInterfaceImpl withExistingNetworkSecurityGroup(NetworkSecurityGroup networkSecurityGroup) { - this.existingNetworkSecurityGroupToAssociate = networkSecurityGroup; - return this; - } - - @Override - public NetworkInterfaceImpl withoutNetworkSecurityGroup() { - this.innerModel().withNetworkSecurityGroup(null); - return this; - } - - @Override - public NetworkInterfaceImpl withExistingApplicationSecurityGroup( - ApplicationSecurityGroup applicationSecurityGroup) { - // update application security group for all ip configurations, - // as nic requires same set for all ip configurations. - for (NicIpConfiguration ipConfiguration : this.nicIPConfigurations.values()) { - ((NicIpConfigurationImpl) ipConfiguration).withExistingApplicationSecurityGroup(applicationSecurityGroup); - } - return this; - } - - @Override - public NetworkInterfaceImpl withoutApplicationSecurityGroup(String applicationSecurityGroupName) { - for (NicIpConfiguration ipConfiguration : this.nicIPConfigurations.values()) { - ((NicIpConfigurationImpl) ipConfiguration).withoutApplicationSecurityGroup(applicationSecurityGroupName); - } - return this; - } - - @Override - public NicIpConfigurationImpl defineSecondaryIPConfiguration(String name) { - NicIpConfigurationImpl nicIpConfiguration = prepareNewNicIPConfiguration(name); - - // copy application security group from primary to secondary, - // as nic requires same set for all ip configurations. - List inners = - this.primaryIPConfiguration().innerModel().applicationSecurityGroups(); - if (inners != null) { - for (ApplicationSecurityGroupInner inner : inners) { - nicIpConfiguration.withExistingApplicationSecurityGroup(inner); - } - } - return nicIpConfiguration; - } - - @Override - public NicIpConfigurationImpl updateIPConfiguration(String name) { - return (NicIpConfigurationImpl) this.nicIPConfigurations.get(name); - } - - @Override - public NetworkInterfaceImpl withIPForwarding() { - this.innerModel().withEnableIpForwarding(true); - return this; - } - - @Override - public NetworkInterfaceImpl withoutIPConfiguration(String name) { - this.nicIPConfigurations.remove(name); - return this; - } - - @Override - public NetworkInterfaceImpl withoutIPForwarding() { - this.innerModel().withEnableIpForwarding(false); - return this; - } - - @Override - public NetworkInterfaceImpl withDnsServer(String ipAddress) { - this.dnsServerIPs().add(ipAddress); - return this; - } - - @Override - public NetworkInterfaceImpl withoutDnsServer(String ipAddress) { - this.dnsServerIPs().remove(ipAddress); - return this; - } - - @Override - public NetworkInterfaceImpl withAzureDnsServer() { - this.dnsServerIPs().clear(); - return this; - } - - @Override - public NetworkInterfaceImpl withSubnet(String name) { - this.primaryIPConfiguration().withSubnet(name); - return this; - } - - @Override - public NetworkInterfaceImpl withInternalDnsNameLabel(String dnsNameLabel) { - this.innerModel().dnsSettings().withInternalDnsNameLabel(dnsNameLabel); - return this; - } - - // Getters - - @Override - public boolean isAcceleratedNetworkingEnabled() { - return ResourceManagerUtils.toPrimitiveBoolean(this.innerModel().enableAcceleratedNetworking()); - } - - @Override - public String virtualMachineId() { - if (this.innerModel().virtualMachine() != null) { - return this.innerModel().virtualMachine().id(); - } else { - return null; - } - } - - @Override - public boolean isIPForwardingEnabled() { - return ResourceManagerUtils.toPrimitiveBoolean(this.innerModel().enableIpForwarding()); - } - - @Override - public String macAddress() { - return this.innerModel().macAddress(); - } - - @Override - public String internalDnsNameLabel() { - return (this.innerModel().dnsSettings() != null) - ? this.innerModel().dnsSettings().internalDnsNameLabel() - : null; - } - - @Override - public String internalDomainNameSuffix() { - return (this.innerModel().dnsSettings() != null) - ? this.innerModel().dnsSettings().internalDomainNameSuffix() - : null; - } - - @Override - public List appliedDnsServers() { - List dnsServers = new ArrayList(); - if (this.innerModel().dnsSettings() == null) { - return Collections.unmodifiableList(dnsServers); - } else if (this.innerModel().dnsSettings().appliedDnsServers() == null) { - return Collections.unmodifiableList(dnsServers); - } else { - return Collections.unmodifiableList(this.innerModel().dnsSettings().appliedDnsServers()); - } - } - - @Override - public String internalFqdn() { - return (this.innerModel().dnsSettings() != null) ? this.innerModel().dnsSettings().internalFqdn() : null; - } - - @Override - public List dnsServers() { - return this.dnsServerIPs(); - } - - @Override - public String primaryPrivateIP() { - return this.primaryIPConfiguration().privateIpAddress(); - } - - @Override - public IpAllocationMethod primaryPrivateIpAllocationMethod() { - return this.primaryIPConfiguration().privateIpAllocationMethod(); - } - - @Override - public Map ipConfigurations() { - return Collections.unmodifiableMap(this.nicIPConfigurations); - } - - @Override - public String networkSecurityGroupId() { - return (this.innerModel().networkSecurityGroup() != null) - ? this.innerModel().networkSecurityGroup().id() - : null; - } - - @Override - public NetworkSecurityGroup getNetworkSecurityGroup() { - if (this.networkSecurityGroup == null && this.networkSecurityGroupId() != null) { - String id = this.networkSecurityGroupId(); - this.networkSecurityGroup = - super - .myManager - .networkSecurityGroups() - .getByResourceGroup(ResourceUtils.groupFromResourceId(id), ResourceUtils.nameFromResourceId(id)); - } - return this.networkSecurityGroup; - } - - /** @return the primary IP configuration of the network interface */ - @Override - public NicIpConfigurationImpl primaryIPConfiguration() { - NicIpConfigurationImpl primaryIPConfig = null; - if (this.nicIPConfigurations.size() == 0) { - // If no primary IP config found yet, then create one automatically, otherwise the NIC is in a bad state - primaryIPConfig = prepareNewNicIPConfiguration("primary"); - primaryIPConfig.innerModel().withPrimary(true); - withIPConfiguration(primaryIPConfig); - } else if (this.nicIPConfigurations.size() == 1) { - // If there is only one IP config, assume it is primary, regardless of the Primary flag - primaryIPConfig = (NicIpConfigurationImpl) this.nicIPConfigurations.values().iterator().next(); - } else { - // If multiple IP configs, then find the one marked as primary - for (NicIpConfiguration ipConfig : this.nicIPConfigurations.values()) { - if (ipConfig.isPrimary()) { - primaryIPConfig = (NicIpConfigurationImpl) ipConfig; - break; - } - } - } - - // Return the found primary IP config, including null, if no primary IP config can be identified - // in which case the NIC is in a bad state anyway - return primaryIPConfig; - } - - /** @return the list of DNS server IPs from the DNS settings */ - private List dnsServerIPs() { - List dnsServers = new ArrayList(); - if (this.innerModel().dnsSettings() == null) { - return dnsServers; - } else if (this.innerModel().dnsSettings().dnsServers() == null) { - return dnsServers; - } else { - return this.innerModel().dnsSettings().dnsServers(); - } - } - - @Override - protected void initializeChildrenFromInner() { - this.nicIPConfigurations = new TreeMap<>(); - List inners = this.innerModel().ipConfigurations(); - if (inners != null) { - for (NetworkInterfaceIpConfigurationInner inner : inners) { - NicIpConfigurationImpl nicIPConfiguration = - new NicIpConfigurationImpl(inner, this, super.myManager, false); - this.nicIPConfigurations.put(nicIPConfiguration.name(), nicIPConfiguration); - } - } - } - - /** - * Gets a new IP configuration child resource {@link NicIpConfiguration} wrapping {@link - * NetworkInterfaceIpConfigurationInner}. - * - * @param name the name for the new ip configuration - * @return {@link NicIpConfiguration} - */ - private NicIpConfigurationImpl prepareNewNicIPConfiguration(String name) { - NicIpConfigurationImpl nicIPConfiguration = - NicIpConfigurationImpl.prepareNicIPConfiguration(name, this, super.myManager); - return nicIPConfiguration; - } - - private void clearCachedRelatedResources() { - this.networkSecurityGroup = null; - } - - NetworkInterfaceImpl withIPConfiguration(NicIpConfigurationImpl nicIPConfiguration) { - this.nicIPConfigurations.put(nicIPConfiguration.name(), nicIPConfiguration); - return this; - } - - void addToCreatableDependencies(Creatable creatableResource) { - this.addDependency(creatableResource); - } - - Resource createdDependencyResource(String key) { - return this.taskResult(key); - } - - Creatable newGroup() { - return this.creatableGroup; - } - - @Override - public Accepted beginCreate() { - return AcceptedImpl - .newAccepted( - logger, - this.manager().serviceClient().getHttpPipeline(), - this.manager().serviceClient().getDefaultPollInterval(), - () -> - this - .manager() - .serviceClient() - .getNetworkInterfaces() - .createOrUpdateWithResponseAsync(resourceGroupName(), name(), this.innerModel()) - .block(), - inner -> new NetworkInterfaceImpl(inner.name(), inner, this.manager()), - NetworkInterfaceInner.class, - () -> { - Flux dependencyTasksAsync = - taskGroup().invokeDependencyAsync(taskGroup().newInvocationContext()); - dependencyTasksAsync.blockLast(); - - beforeCreating(); - }, - inner -> { - innerToFluentMap(this); - initializeChildrenFromInner(); - afterCreating(); - }, - Context.NONE); - } - - @Override - protected Mono createInner() { - return this - .manager() - .serviceClient() - .getNetworkInterfaces() - .createOrUpdateAsync(this.resourceGroupName(), this.name(), this.innerModel()); - } - - @Override - protected void afterCreating() { - clearCachedRelatedResources(); - } - - @Override - protected void beforeCreating() { - NetworkSecurityGroup networkSecurityGroup = null; - if (creatableNetworkSecurityGroupKey != null) { - networkSecurityGroup = this.taskResult(creatableNetworkSecurityGroupKey); - } else if (existingNetworkSecurityGroupToAssociate != null) { - networkSecurityGroup = existingNetworkSecurityGroupToAssociate; - } - - // Associate an NSG if needed - if (networkSecurityGroup != null) { - this - .innerModel() - .withNetworkSecurityGroup(new NetworkSecurityGroupInner().withId(networkSecurityGroup.id())); - } - - NicIpConfigurationImpl.ensureConfigurations(this.nicIPConfigurations.values()); - - // Reset and update IP configs - this.innerModel().withIpConfigurations(innersFromWrappers(this.nicIPConfigurations.values())); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NetworkInterfaceIpConfigurationsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NetworkInterfaceIpConfigurationsClientImpl.java deleted file mode 100644 index e0ee43b4bcdb..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NetworkInterfaceIpConfigurationsClientImpl.java +++ /dev/null @@ -1,537 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.NetworkInterfaceIpConfigurationsClient; -import com.azure.resourcemanager.network.fluent.models.NetworkInterfaceIpConfigurationInner; -import com.azure.resourcemanager.network.models.NetworkInterfaceIpConfigurationListResult; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in NetworkInterfaceIpConfigurationsClient. - */ -public final class NetworkInterfaceIpConfigurationsClientImpl implements NetworkInterfaceIpConfigurationsClient { - private final ClientLogger logger = new ClientLogger(NetworkInterfaceIpConfigurationsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final NetworkInterfaceIpConfigurationsService service; - - /** The service client containing this operation class. */ - private final NetworkManagementClientImpl client; - - /** - * Initializes an instance of NetworkInterfaceIpConfigurationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - NetworkInterfaceIpConfigurationsClientImpl(NetworkManagementClientImpl client) { - this.service = - RestProxy - .create( - NetworkInterfaceIpConfigurationsService.class, - client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for NetworkManagementClientNetworkInterfaceIpConfigurations to be used by - * the proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "NetworkManagementCli") - private interface NetworkInterfaceIpConfigurationsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/networkInterfaces/{networkInterfaceName}/ipConfigurations") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("networkInterfaceName") String networkInterfaceName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/networkInterfaces/{networkInterfaceName}/ipConfigurations/{ipConfigurationName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("networkInterfaceName") String networkInterfaceName, - @PathParam("ipConfigurationName") String ipConfigurationName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Get all ip configurations in a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all ip configurations in a network interface. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String networkInterfaceName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkInterfaceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - resourceGroupName, - networkInterfaceName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get all ip configurations in a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all ip configurations in a network interface. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String networkInterfaceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkInterfaceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - resourceGroupName, - networkInterfaceName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get all ip configurations in a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all ip configurations in a network interface. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync( - String resourceGroupName, String networkInterfaceName) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, networkInterfaceName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Get all ip configurations in a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all ip configurations in a network interface. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String networkInterfaceName, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, networkInterfaceName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Get all ip configurations in a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all ip configurations in a network interface. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, String networkInterfaceName) { - return new PagedIterable<>(listAsync(resourceGroupName, networkInterfaceName)); - } - - /** - * Get all ip configurations in a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all ip configurations in a network interface. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, String networkInterfaceName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, networkInterfaceName, context)); - } - - /** - * Gets the specified network interface ip configuration. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param ipConfigurationName The name of the ip configuration name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network interface ip configuration. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String resourceGroupName, String networkInterfaceName, String ipConfigurationName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkInterfaceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null.")); - } - if (ipConfigurationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter ipConfigurationName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - resourceGroupName, - networkInterfaceName, - ipConfigurationName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the specified network interface ip configuration. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param ipConfigurationName The name of the ip configuration name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network interface ip configuration. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String networkInterfaceName, String ipConfigurationName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkInterfaceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null.")); - } - if (ipConfigurationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter ipConfigurationName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - resourceGroupName, - networkInterfaceName, - ipConfigurationName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets the specified network interface ip configuration. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param ipConfigurationName The name of the ip configuration name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network interface ip configuration. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync( - String resourceGroupName, String networkInterfaceName, String ipConfigurationName) { - return getWithResponseAsync(resourceGroupName, networkInterfaceName, ipConfigurationName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the specified network interface ip configuration. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param ipConfigurationName The name of the ip configuration name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network interface ip configuration. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public NetworkInterfaceIpConfigurationInner get( - String resourceGroupName, String networkInterfaceName, String ipConfigurationName) { - return getAsync(resourceGroupName, networkInterfaceName, ipConfigurationName).block(); - } - - /** - * Gets the specified network interface ip configuration. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param ipConfigurationName The name of the ip configuration name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network interface ip configuration. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String networkInterfaceName, String ipConfigurationName, Context context) { - return getWithResponseAsync(resourceGroupName, networkInterfaceName, ipConfigurationName, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for list ip configurations API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for list ip configurations API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NetworkInterfaceLoadBalancersClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NetworkInterfaceLoadBalancersClientImpl.java deleted file mode 100644 index fd7118893099..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NetworkInterfaceLoadBalancersClientImpl.java +++ /dev/null @@ -1,346 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.NetworkInterfaceLoadBalancersClient; -import com.azure.resourcemanager.network.fluent.models.LoadBalancerInner; -import com.azure.resourcemanager.network.models.NetworkInterfaceLoadBalancerListResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in NetworkInterfaceLoadBalancersClient. */ -public final class NetworkInterfaceLoadBalancersClientImpl implements NetworkInterfaceLoadBalancersClient { - private final ClientLogger logger = new ClientLogger(NetworkInterfaceLoadBalancersClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final NetworkInterfaceLoadBalancersService service; - - /** The service client containing this operation class. */ - private final NetworkManagementClientImpl client; - - /** - * Initializes an instance of NetworkInterfaceLoadBalancersClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - NetworkInterfaceLoadBalancersClientImpl(NetworkManagementClientImpl client) { - this.service = - RestProxy - .create( - NetworkInterfaceLoadBalancersService.class, - client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for NetworkManagementClientNetworkInterfaceLoadBalancers to be used by - * the proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "NetworkManagementCli") - private interface NetworkInterfaceLoadBalancersService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/networkInterfaces/{networkInterfaceName}/loadBalancers") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("networkInterfaceName") String networkInterfaceName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * List all load balancers in a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for list ip configurations API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String networkInterfaceName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkInterfaceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - resourceGroupName, - networkInterfaceName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List all load balancers in a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for list ip configurations API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String networkInterfaceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkInterfaceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - resourceGroupName, - networkInterfaceName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * List all load balancers in a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for list ip configurations API service call. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String resourceGroupName, String networkInterfaceName) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, networkInterfaceName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List all load balancers in a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for list ip configurations API service call. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String networkInterfaceName, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, networkInterfaceName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * List all load balancers in a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for list ip configurations API service call. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String networkInterfaceName) { - return new PagedIterable<>(listAsync(resourceGroupName, networkInterfaceName)); - } - - /** - * List all load balancers in a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for list ip configurations API service call. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, String networkInterfaceName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, networkInterfaceName, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for list ip configurations API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for list ip configurations API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NetworkInterfaceTapConfigurationsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NetworkInterfaceTapConfigurationsClientImpl.java deleted file mode 100644 index 891942f70c21..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NetworkInterfaceTapConfigurationsClientImpl.java +++ /dev/null @@ -1,1185 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.NetworkInterfaceTapConfigurationsClient; -import com.azure.resourcemanager.network.fluent.models.NetworkInterfaceTapConfigurationInner; -import com.azure.resourcemanager.network.models.NetworkInterfaceTapConfigurationListResult; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in NetworkInterfaceTapConfigurationsClient. - */ -public final class NetworkInterfaceTapConfigurationsClientImpl implements NetworkInterfaceTapConfigurationsClient { - private final ClientLogger logger = new ClientLogger(NetworkInterfaceTapConfigurationsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final NetworkInterfaceTapConfigurationsService service; - - /** The service client containing this operation class. */ - private final NetworkManagementClientImpl client; - - /** - * Initializes an instance of NetworkInterfaceTapConfigurationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - NetworkInterfaceTapConfigurationsClientImpl(NetworkManagementClientImpl client) { - this.service = - RestProxy - .create( - NetworkInterfaceTapConfigurationsService.class, - client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for NetworkManagementClientNetworkInterfaceTapConfigurations to be used - * by the proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "NetworkManagementCli") - private interface NetworkInterfaceTapConfigurationsService { - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/networkInterfaces/{networkInterfaceName}/tapConfigurations/{tapConfigurationName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("networkInterfaceName") String networkInterfaceName, - @PathParam("tapConfigurationName") String tapConfigurationName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/networkInterfaces/{networkInterfaceName}/tapConfigurations/{tapConfigurationName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("networkInterfaceName") String networkInterfaceName, - @PathParam("tapConfigurationName") String tapConfigurationName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/networkInterfaces/{networkInterfaceName}/tapConfigurations/{tapConfigurationName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("networkInterfaceName") String networkInterfaceName, - @PathParam("tapConfigurationName") String tapConfigurationName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") NetworkInterfaceTapConfigurationInner tapConfigurationParameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/networkInterfaces/{networkInterfaceName}/tapConfigurations") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("networkInterfaceName") String networkInterfaceName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Deletes the specified tap configuration from the NetworkInterface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param tapConfigurationName The name of the tap configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync( - String resourceGroupName, String networkInterfaceName, String tapConfigurationName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkInterfaceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null.")); - } - if (tapConfigurationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter tapConfigurationName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - networkInterfaceName, - tapConfigurationName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the specified tap configuration from the NetworkInterface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param tapConfigurationName The name of the tap configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String networkInterfaceName, String tapConfigurationName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkInterfaceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null.")); - } - if (tapConfigurationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter tapConfigurationName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - networkInterfaceName, - tapConfigurationName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Deletes the specified tap configuration from the NetworkInterface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param tapConfigurationName The name of the tap configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String networkInterfaceName, String tapConfigurationName) { - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, networkInterfaceName, tapConfigurationName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deletes the specified tap configuration from the NetworkInterface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param tapConfigurationName The name of the tap configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String networkInterfaceName, String tapConfigurationName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, networkInterfaceName, tapConfigurationName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes the specified tap configuration from the NetworkInterface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param tapConfigurationName The name of the tap configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String networkInterfaceName, String tapConfigurationName) { - return beginDeleteAsync(resourceGroupName, networkInterfaceName, tapConfigurationName).getSyncPoller(); - } - - /** - * Deletes the specified tap configuration from the NetworkInterface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param tapConfigurationName The name of the tap configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String networkInterfaceName, String tapConfigurationName, Context context) { - return beginDeleteAsync(resourceGroupName, networkInterfaceName, tapConfigurationName, context).getSyncPoller(); - } - - /** - * Deletes the specified tap configuration from the NetworkInterface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param tapConfigurationName The name of the tap configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String networkInterfaceName, String tapConfigurationName) { - return beginDeleteAsync(resourceGroupName, networkInterfaceName, tapConfigurationName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified tap configuration from the NetworkInterface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param tapConfigurationName The name of the tap configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync( - String resourceGroupName, String networkInterfaceName, String tapConfigurationName, Context context) { - return beginDeleteAsync(resourceGroupName, networkInterfaceName, tapConfigurationName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified tap configuration from the NetworkInterface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param tapConfigurationName The name of the tap configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String networkInterfaceName, String tapConfigurationName) { - deleteAsync(resourceGroupName, networkInterfaceName, tapConfigurationName).block(); - } - - /** - * Deletes the specified tap configuration from the NetworkInterface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param tapConfigurationName The name of the tap configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete( - String resourceGroupName, String networkInterfaceName, String tapConfigurationName, Context context) { - deleteAsync(resourceGroupName, networkInterfaceName, tapConfigurationName, context).block(); - } - - /** - * Get the specified tap configuration on a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param tapConfigurationName The name of the tap configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified tap configuration on a network interface. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String resourceGroupName, String networkInterfaceName, String tapConfigurationName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkInterfaceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null.")); - } - if (tapConfigurationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter tapConfigurationName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - resourceGroupName, - networkInterfaceName, - tapConfigurationName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the specified tap configuration on a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param tapConfigurationName The name of the tap configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified tap configuration on a network interface. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String networkInterfaceName, String tapConfigurationName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkInterfaceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null.")); - } - if (tapConfigurationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter tapConfigurationName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - resourceGroupName, - networkInterfaceName, - tapConfigurationName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Get the specified tap configuration on a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param tapConfigurationName The name of the tap configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified tap configuration on a network interface. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync( - String resourceGroupName, String networkInterfaceName, String tapConfigurationName) { - return getWithResponseAsync(resourceGroupName, networkInterfaceName, tapConfigurationName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get the specified tap configuration on a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param tapConfigurationName The name of the tap configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified tap configuration on a network interface. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public NetworkInterfaceTapConfigurationInner get( - String resourceGroupName, String networkInterfaceName, String tapConfigurationName) { - return getAsync(resourceGroupName, networkInterfaceName, tapConfigurationName).block(); - } - - /** - * Get the specified tap configuration on a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param tapConfigurationName The name of the tap configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified tap configuration on a network interface. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String networkInterfaceName, String tapConfigurationName, Context context) { - return getWithResponseAsync(resourceGroupName, networkInterfaceName, tapConfigurationName, context).block(); - } - - /** - * Creates or updates a Tap configuration in the specified NetworkInterface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param tapConfigurationName The name of the tap configuration. - * @param tapConfigurationParameters Parameters supplied to the create or update tap configuration operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return tap configuration in a Network Interface. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String networkInterfaceName, - String tapConfigurationName, - NetworkInterfaceTapConfigurationInner tapConfigurationParameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkInterfaceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null.")); - } - if (tapConfigurationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter tapConfigurationName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (tapConfigurationParameters == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter tapConfigurationParameters is required and cannot be null.")); - } else { - tapConfigurationParameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - networkInterfaceName, - tapConfigurationName, - apiVersion, - this.client.getSubscriptionId(), - tapConfigurationParameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a Tap configuration in the specified NetworkInterface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param tapConfigurationName The name of the tap configuration. - * @param tapConfigurationParameters Parameters supplied to the create or update tap configuration operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return tap configuration in a Network Interface. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String networkInterfaceName, - String tapConfigurationName, - NetworkInterfaceTapConfigurationInner tapConfigurationParameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkInterfaceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null.")); - } - if (tapConfigurationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter tapConfigurationName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (tapConfigurationParameters == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter tapConfigurationParameters is required and cannot be null.")); - } else { - tapConfigurationParameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - networkInterfaceName, - tapConfigurationName, - apiVersion, - this.client.getSubscriptionId(), - tapConfigurationParameters, - accept, - context); - } - - /** - * Creates or updates a Tap configuration in the specified NetworkInterface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param tapConfigurationName The name of the tap configuration. - * @param tapConfigurationParameters Parameters supplied to the create or update tap configuration operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return tap configuration in a Network Interface. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, NetworkInterfaceTapConfigurationInner> - beginCreateOrUpdateAsync( - String resourceGroupName, - String networkInterfaceName, - String tapConfigurationName, - NetworkInterfaceTapConfigurationInner tapConfigurationParameters) { - Mono>> mono = - createOrUpdateWithResponseAsync( - resourceGroupName, networkInterfaceName, tapConfigurationName, tapConfigurationParameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - NetworkInterfaceTapConfigurationInner.class, - NetworkInterfaceTapConfigurationInner.class, - Context.NONE); - } - - /** - * Creates or updates a Tap configuration in the specified NetworkInterface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param tapConfigurationName The name of the tap configuration. - * @param tapConfigurationParameters Parameters supplied to the create or update tap configuration operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return tap configuration in a Network Interface. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, NetworkInterfaceTapConfigurationInner> - beginCreateOrUpdateAsync( - String resourceGroupName, - String networkInterfaceName, - String tapConfigurationName, - NetworkInterfaceTapConfigurationInner tapConfigurationParameters, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync( - resourceGroupName, networkInterfaceName, tapConfigurationName, tapConfigurationParameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - NetworkInterfaceTapConfigurationInner.class, - NetworkInterfaceTapConfigurationInner.class, - context); - } - - /** - * Creates or updates a Tap configuration in the specified NetworkInterface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param tapConfigurationName The name of the tap configuration. - * @param tapConfigurationParameters Parameters supplied to the create or update tap configuration operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return tap configuration in a Network Interface. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, NetworkInterfaceTapConfigurationInner> - beginCreateOrUpdate( - String resourceGroupName, - String networkInterfaceName, - String tapConfigurationName, - NetworkInterfaceTapConfigurationInner tapConfigurationParameters) { - return beginCreateOrUpdateAsync( - resourceGroupName, networkInterfaceName, tapConfigurationName, tapConfigurationParameters) - .getSyncPoller(); - } - - /** - * Creates or updates a Tap configuration in the specified NetworkInterface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param tapConfigurationName The name of the tap configuration. - * @param tapConfigurationParameters Parameters supplied to the create or update tap configuration operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return tap configuration in a Network Interface. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, NetworkInterfaceTapConfigurationInner> - beginCreateOrUpdate( - String resourceGroupName, - String networkInterfaceName, - String tapConfigurationName, - NetworkInterfaceTapConfigurationInner tapConfigurationParameters, - Context context) { - return beginCreateOrUpdateAsync( - resourceGroupName, networkInterfaceName, tapConfigurationName, tapConfigurationParameters, context) - .getSyncPoller(); - } - - /** - * Creates or updates a Tap configuration in the specified NetworkInterface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param tapConfigurationName The name of the tap configuration. - * @param tapConfigurationParameters Parameters supplied to the create or update tap configuration operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return tap configuration in a Network Interface. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, - String networkInterfaceName, - String tapConfigurationName, - NetworkInterfaceTapConfigurationInner tapConfigurationParameters) { - return beginCreateOrUpdateAsync( - resourceGroupName, networkInterfaceName, tapConfigurationName, tapConfigurationParameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a Tap configuration in the specified NetworkInterface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param tapConfigurationName The name of the tap configuration. - * @param tapConfigurationParameters Parameters supplied to the create or update tap configuration operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return tap configuration in a Network Interface. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, - String networkInterfaceName, - String tapConfigurationName, - NetworkInterfaceTapConfigurationInner tapConfigurationParameters, - Context context) { - return beginCreateOrUpdateAsync( - resourceGroupName, networkInterfaceName, tapConfigurationName, tapConfigurationParameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a Tap configuration in the specified NetworkInterface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param tapConfigurationName The name of the tap configuration. - * @param tapConfigurationParameters Parameters supplied to the create or update tap configuration operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return tap configuration in a Network Interface. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public NetworkInterfaceTapConfigurationInner createOrUpdate( - String resourceGroupName, - String networkInterfaceName, - String tapConfigurationName, - NetworkInterfaceTapConfigurationInner tapConfigurationParameters) { - return createOrUpdateAsync( - resourceGroupName, networkInterfaceName, tapConfigurationName, tapConfigurationParameters) - .block(); - } - - /** - * Creates or updates a Tap configuration in the specified NetworkInterface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param tapConfigurationName The name of the tap configuration. - * @param tapConfigurationParameters Parameters supplied to the create or update tap configuration operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return tap configuration in a Network Interface. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public NetworkInterfaceTapConfigurationInner createOrUpdate( - String resourceGroupName, - String networkInterfaceName, - String tapConfigurationName, - NetworkInterfaceTapConfigurationInner tapConfigurationParameters, - Context context) { - return createOrUpdateAsync( - resourceGroupName, networkInterfaceName, tapConfigurationName, tapConfigurationParameters, context) - .block(); - } - - /** - * Get all Tap configurations in a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all Tap configurations in a network interface. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String networkInterfaceName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkInterfaceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - resourceGroupName, - networkInterfaceName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get all Tap configurations in a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all Tap configurations in a network interface. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String networkInterfaceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkInterfaceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - resourceGroupName, - networkInterfaceName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get all Tap configurations in a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all Tap configurations in a network interface. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync( - String resourceGroupName, String networkInterfaceName) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, networkInterfaceName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Get all Tap configurations in a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all Tap configurations in a network interface. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String networkInterfaceName, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, networkInterfaceName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Get all Tap configurations in a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all Tap configurations in a network interface. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, String networkInterfaceName) { - return new PagedIterable<>(listAsync(resourceGroupName, networkInterfaceName)); - } - - /** - * Get all Tap configurations in a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all Tap configurations in a network interface. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, String networkInterfaceName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, networkInterfaceName, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for list tap configurations API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for list tap configurations API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NetworkInterfacesClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NetworkInterfacesClientImpl.java deleted file mode 100644 index 377bda621160..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NetworkInterfacesClientImpl.java +++ /dev/null @@ -1,3748 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.NetworkInterfacesClient; -import com.azure.resourcemanager.network.fluent.models.EffectiveNetworkSecurityGroupListResultInner; -import com.azure.resourcemanager.network.fluent.models.EffectiveRouteListResultInner; -import com.azure.resourcemanager.network.fluent.models.NetworkInterfaceInner; -import com.azure.resourcemanager.network.fluent.models.NetworkInterfaceIpConfigurationInner; -import com.azure.resourcemanager.network.models.NetworkInterfaceIpConfigurationListResult; -import com.azure.resourcemanager.network.models.NetworkInterfaceListResult; -import com.azure.resourcemanager.network.models.TagsObject; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in NetworkInterfacesClient. */ -public final class NetworkInterfacesClientImpl - implements InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete, - NetworkInterfacesClient { - private final ClientLogger logger = new ClientLogger(NetworkInterfacesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final NetworkInterfacesService service; - - /** The service client containing this operation class. */ - private final NetworkManagementClientImpl client; - - /** - * Initializes an instance of NetworkInterfacesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - NetworkInterfacesClientImpl(NetworkManagementClientImpl client) { - this.service = - RestProxy.create(NetworkInterfacesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for NetworkManagementClientNetworkInterfaces to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "NetworkManagementCli") - private interface NetworkInterfacesService { - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/networkInterfaces/{networkInterfaceName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("networkInterfaceName") String networkInterfaceName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/networkInterfaces/{networkInterfaceName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("networkInterfaceName") String networkInterfaceName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("$expand") String expand, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/networkInterfaces/{networkInterfaceName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("networkInterfaceName") String networkInterfaceName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") NetworkInterfaceInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/networkInterfaces/{networkInterfaceName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> updateTags( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("networkInterfaceName") String networkInterfaceName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") TagsObject parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkInterfaces") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/networkInterfaces") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/networkInterfaces/{networkInterfaceName}/effectiveRouteTable") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> getEffectiveRouteTable( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("networkInterfaceName") String networkInterfaceName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/networkInterfaces/{networkInterfaceName}/effectiveNetworkSecurityGroups") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> listEffectiveNetworkSecurityGroups( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("networkInterfaceName") String networkInterfaceName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute" - + "/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}" - + "/networkInterfaces") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listVirtualMachineScaleSetVMNetworkInterfaces( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualMachineScaleSetName") String virtualMachineScaleSetName, - @PathParam("virtualmachineIndex") String virtualmachineIndex, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute" - + "/virtualMachineScaleSets/{virtualMachineScaleSetName}/networkInterfaces") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listVirtualMachineScaleSetNetworkInterfaces( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualMachineScaleSetName") String virtualMachineScaleSetName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute" - + "/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}" - + "/networkInterfaces/{networkInterfaceName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getVirtualMachineScaleSetNetworkInterface( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualMachineScaleSetName") String virtualMachineScaleSetName, - @PathParam("virtualmachineIndex") String virtualmachineIndex, - @PathParam("networkInterfaceName") String networkInterfaceName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("$expand") String expand, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute" - + "/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}" - + "/networkInterfaces/{networkInterfaceName}/ipConfigurations") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listVirtualMachineScaleSetIpConfigurations( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualMachineScaleSetName") String virtualMachineScaleSetName, - @PathParam("virtualmachineIndex") String virtualmachineIndex, - @PathParam("networkInterfaceName") String networkInterfaceName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("$expand") String expand, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute" - + "/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}" - + "/networkInterfaces/{networkInterfaceName}/ipConfigurations/{ipConfigurationName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getVirtualMachineScaleSetIpConfiguration( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualMachineScaleSetName") String virtualMachineScaleSetName, - @PathParam("virtualmachineIndex") String virtualmachineIndex, - @PathParam("networkInterfaceName") String networkInterfaceName, - @PathParam("ipConfigurationName") String ipConfigurationName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("$expand") String expand, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAllNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listVirtualMachineScaleSetVMNetworkInterfacesNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listVirtualMachineScaleSetNetworkInterfacesNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listVirtualMachineScaleSetIpConfigurationsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Deletes the specified network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync( - String resourceGroupName, String networkInterfaceName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkInterfaceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - networkInterfaceName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the specified network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String networkInterfaceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkInterfaceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - networkInterfaceName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Deletes the specified network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String networkInterfaceName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, networkInterfaceName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deletes the specified network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String networkInterfaceName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, networkInterfaceName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes the specified network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete(String resourceGroupName, String networkInterfaceName) { - return beginDeleteAsync(resourceGroupName, networkInterfaceName).getSyncPoller(); - } - - /** - * Deletes the specified network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String networkInterfaceName, Context context) { - return beginDeleteAsync(resourceGroupName, networkInterfaceName, context).getSyncPoller(); - } - - /** - * Deletes the specified network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String networkInterfaceName) { - return beginDeleteAsync(resourceGroupName, networkInterfaceName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String networkInterfaceName, Context context) { - return beginDeleteAsync(resourceGroupName, networkInterfaceName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String networkInterfaceName) { - deleteAsync(resourceGroupName, networkInterfaceName).block(); - } - - /** - * Deletes the specified network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String networkInterfaceName, Context context) { - deleteAsync(resourceGroupName, networkInterfaceName, context).block(); - } - - /** - * Gets information about the specified network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param expand Expands referenced resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified network interface. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String networkInterfaceName, String expand) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkInterfaceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - networkInterfaceName, - apiVersion, - this.client.getSubscriptionId(), - expand, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets information about the specified network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param expand Expands referenced resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified network interface. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String networkInterfaceName, String expand, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkInterfaceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - networkInterfaceName, - apiVersion, - this.client.getSubscriptionId(), - expand, - accept, - context); - } - - /** - * Gets information about the specified network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param expand Expands referenced resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified network interface. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync( - String resourceGroupName, String networkInterfaceName, String expand) { - return getByResourceGroupWithResponseAsync(resourceGroupName, networkInterfaceName, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets information about the specified network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified network interface. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync(String resourceGroupName, String networkInterfaceName) { - final String expand = null; - return getByResourceGroupWithResponseAsync(resourceGroupName, networkInterfaceName, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets information about the specified network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified network interface. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public NetworkInterfaceInner getByResourceGroup(String resourceGroupName, String networkInterfaceName) { - final String expand = null; - return getByResourceGroupAsync(resourceGroupName, networkInterfaceName, expand).block(); - } - - /** - * Gets information about the specified network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param expand Expands referenced resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified network interface. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String networkInterfaceName, String expand, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, networkInterfaceName, expand, context).block(); - } - - /** - * Creates or updates a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param parameters Parameters supplied to the create or update network interface operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a network interface in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkInterfaceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - networkInterfaceName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param parameters Parameters supplied to the create or update network interface operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a network interface in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkInterfaceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - networkInterfaceName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Creates or updates a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param parameters Parameters supplied to the create or update network interface operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a network interface in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, NetworkInterfaceInner> beginCreateOrUpdateAsync( - String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, networkInterfaceName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - NetworkInterfaceInner.class, - NetworkInterfaceInner.class, - Context.NONE); - } - - /** - * Creates or updates a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param parameters Parameters supplied to the create or update network interface operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a network interface in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, NetworkInterfaceInner> beginCreateOrUpdateAsync( - String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, networkInterfaceName, parameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), NetworkInterfaceInner.class, NetworkInterfaceInner.class, context); - } - - /** - * Creates or updates a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param parameters Parameters supplied to the create or update network interface operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a network interface in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, NetworkInterfaceInner> beginCreateOrUpdate( - String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, networkInterfaceName, parameters).getSyncPoller(); - } - - /** - * Creates or updates a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param parameters Parameters supplied to the create or update network interface operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a network interface in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, NetworkInterfaceInner> beginCreateOrUpdate( - String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, networkInterfaceName, parameters, context).getSyncPoller(); - } - - /** - * Creates or updates a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param parameters Parameters supplied to the create or update network interface operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a network interface in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, networkInterfaceName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param parameters Parameters supplied to the create or update network interface operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a network interface in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, networkInterfaceName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param parameters Parameters supplied to the create or update network interface operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a network interface in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public NetworkInterfaceInner createOrUpdate( - String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters) { - return createOrUpdateAsync(resourceGroupName, networkInterfaceName, parameters).block(); - } - - /** - * Creates or updates a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param parameters Parameters supplied to the create or update network interface operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a network interface in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public NetworkInterfaceInner createOrUpdate( - String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters, Context context) { - return createOrUpdateAsync(resourceGroupName, networkInterfaceName, parameters, context).block(); - } - - /** - * Updates a network interface tags. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param parameters Parameters supplied to update network interface tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a network interface in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateTagsWithResponseAsync( - String resourceGroupName, String networkInterfaceName, TagsObject parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkInterfaceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updateTags( - this.client.getEndpoint(), - resourceGroupName, - networkInterfaceName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates a network interface tags. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param parameters Parameters supplied to update network interface tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a network interface in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateTagsWithResponseAsync( - String resourceGroupName, String networkInterfaceName, TagsObject parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkInterfaceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updateTags( - this.client.getEndpoint(), - resourceGroupName, - networkInterfaceName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Updates a network interface tags. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param parameters Parameters supplied to update network interface tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a network interface in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, NetworkInterfaceInner> beginUpdateTagsAsync( - String resourceGroupName, String networkInterfaceName, TagsObject parameters) { - Mono>> mono = - updateTagsWithResponseAsync(resourceGroupName, networkInterfaceName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - NetworkInterfaceInner.class, - NetworkInterfaceInner.class, - Context.NONE); - } - - /** - * Updates a network interface tags. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param parameters Parameters supplied to update network interface tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a network interface in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, NetworkInterfaceInner> beginUpdateTagsAsync( - String resourceGroupName, String networkInterfaceName, TagsObject parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - updateTagsWithResponseAsync(resourceGroupName, networkInterfaceName, parameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), NetworkInterfaceInner.class, NetworkInterfaceInner.class, context); - } - - /** - * Updates a network interface tags. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param parameters Parameters supplied to update network interface tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a network interface in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, NetworkInterfaceInner> beginUpdateTags( - String resourceGroupName, String networkInterfaceName, TagsObject parameters) { - return beginUpdateTagsAsync(resourceGroupName, networkInterfaceName, parameters).getSyncPoller(); - } - - /** - * Updates a network interface tags. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param parameters Parameters supplied to update network interface tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a network interface in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, NetworkInterfaceInner> beginUpdateTags( - String resourceGroupName, String networkInterfaceName, TagsObject parameters, Context context) { - return beginUpdateTagsAsync(resourceGroupName, networkInterfaceName, parameters, context).getSyncPoller(); - } - - /** - * Updates a network interface tags. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param parameters Parameters supplied to update network interface tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a network interface in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateTagsAsync( - String resourceGroupName, String networkInterfaceName, TagsObject parameters) { - return beginUpdateTagsAsync(resourceGroupName, networkInterfaceName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates a network interface tags. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param parameters Parameters supplied to update network interface tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a network interface in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateTagsAsync( - String resourceGroupName, String networkInterfaceName, TagsObject parameters, Context context) { - return beginUpdateTagsAsync(resourceGroupName, networkInterfaceName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates a network interface tags. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param parameters Parameters supplied to update network interface tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a network interface in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public NetworkInterfaceInner updateTags( - String resourceGroupName, String networkInterfaceName, TagsObject parameters) { - return updateTagsAsync(resourceGroupName, networkInterfaceName, parameters).block(); - } - - /** - * Updates a network interface tags. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param parameters Parameters supplied to update network interface tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a network interface in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public NetworkInterfaceInner updateTags( - String resourceGroupName, String networkInterfaceName, TagsObject parameters, Context context) { - return updateTagsAsync(resourceGroupName, networkInterfaceName, parameters, context).block(); - } - - /** - * Gets all network interfaces in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network interfaces in a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all network interfaces in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network interfaces in a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all network interfaces in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network interfaces in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listAllNextSinglePageAsync(nextLink)); - } - - /** - * Gets all network interfaces in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network interfaces in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listAllNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all network interfaces in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network interfaces in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Gets all network interfaces in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network interfaces in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Gets all network interfaces in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network interfaces in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all network interfaces in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network interfaces in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all network interfaces in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network interfaces in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets all network interfaces in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network interfaces in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all network interfaces in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network interfaces in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * Gets all network interfaces in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network interfaces in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * Gets all route tables applied to a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all route tables applied to a network interface. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> getEffectiveRouteTableWithResponseAsync( - String resourceGroupName, String networkInterfaceName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkInterfaceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getEffectiveRouteTable( - this.client.getEndpoint(), - resourceGroupName, - networkInterfaceName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all route tables applied to a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all route tables applied to a network interface. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> getEffectiveRouteTableWithResponseAsync( - String resourceGroupName, String networkInterfaceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkInterfaceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getEffectiveRouteTable( - this.client.getEndpoint(), - resourceGroupName, - networkInterfaceName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets all route tables applied to a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all route tables applied to a network interface. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, EffectiveRouteListResultInner> - beginGetEffectiveRouteTableAsync(String resourceGroupName, String networkInterfaceName) { - Mono>> mono = - getEffectiveRouteTableWithResponseAsync(resourceGroupName, networkInterfaceName); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - EffectiveRouteListResultInner.class, - EffectiveRouteListResultInner.class, - Context.NONE); - } - - /** - * Gets all route tables applied to a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all route tables applied to a network interface. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, EffectiveRouteListResultInner> - beginGetEffectiveRouteTableAsync(String resourceGroupName, String networkInterfaceName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - getEffectiveRouteTableWithResponseAsync(resourceGroupName, networkInterfaceName, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - EffectiveRouteListResultInner.class, - EffectiveRouteListResultInner.class, - context); - } - - /** - * Gets all route tables applied to a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all route tables applied to a network interface. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, EffectiveRouteListResultInner> - beginGetEffectiveRouteTable(String resourceGroupName, String networkInterfaceName) { - return beginGetEffectiveRouteTableAsync(resourceGroupName, networkInterfaceName).getSyncPoller(); - } - - /** - * Gets all route tables applied to a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all route tables applied to a network interface. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, EffectiveRouteListResultInner> - beginGetEffectiveRouteTable(String resourceGroupName, String networkInterfaceName, Context context) { - return beginGetEffectiveRouteTableAsync(resourceGroupName, networkInterfaceName, context).getSyncPoller(); - } - - /** - * Gets all route tables applied to a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all route tables applied to a network interface. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getEffectiveRouteTableAsync( - String resourceGroupName, String networkInterfaceName) { - return beginGetEffectiveRouteTableAsync(resourceGroupName, networkInterfaceName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Gets all route tables applied to a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all route tables applied to a network interface. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getEffectiveRouteTableAsync( - String resourceGroupName, String networkInterfaceName, Context context) { - return beginGetEffectiveRouteTableAsync(resourceGroupName, networkInterfaceName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Gets all route tables applied to a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all route tables applied to a network interface. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public EffectiveRouteListResultInner getEffectiveRouteTable(String resourceGroupName, String networkInterfaceName) { - return getEffectiveRouteTableAsync(resourceGroupName, networkInterfaceName).block(); - } - - /** - * Gets all route tables applied to a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all route tables applied to a network interface. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public EffectiveRouteListResultInner getEffectiveRouteTable( - String resourceGroupName, String networkInterfaceName, Context context) { - return getEffectiveRouteTableAsync(resourceGroupName, networkInterfaceName, context).block(); - } - - /** - * Gets all network security groups applied to a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network security groups applied to a network interface. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> listEffectiveNetworkSecurityGroupsWithResponseAsync( - String resourceGroupName, String networkInterfaceName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkInterfaceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listEffectiveNetworkSecurityGroups( - this.client.getEndpoint(), - resourceGroupName, - networkInterfaceName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all network security groups applied to a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network security groups applied to a network interface. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> listEffectiveNetworkSecurityGroupsWithResponseAsync( - String resourceGroupName, String networkInterfaceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkInterfaceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listEffectiveNetworkSecurityGroups( - this.client.getEndpoint(), - resourceGroupName, - networkInterfaceName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets all network security groups applied to a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network security groups applied to a network interface. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux< - PollResult, EffectiveNetworkSecurityGroupListResultInner> - beginListEffectiveNetworkSecurityGroupsAsync(String resourceGroupName, String networkInterfaceName) { - Mono>> mono = - listEffectiveNetworkSecurityGroupsWithResponseAsync(resourceGroupName, networkInterfaceName); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - EffectiveNetworkSecurityGroupListResultInner.class, - EffectiveNetworkSecurityGroupListResultInner.class, - Context.NONE); - } - - /** - * Gets all network security groups applied to a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network security groups applied to a network interface. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux< - PollResult, EffectiveNetworkSecurityGroupListResultInner> - beginListEffectiveNetworkSecurityGroupsAsync( - String resourceGroupName, String networkInterfaceName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - listEffectiveNetworkSecurityGroupsWithResponseAsync(resourceGroupName, networkInterfaceName, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - EffectiveNetworkSecurityGroupListResultInner.class, - EffectiveNetworkSecurityGroupListResultInner.class, - context); - } - - /** - * Gets all network security groups applied to a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network security groups applied to a network interface. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller< - PollResult, EffectiveNetworkSecurityGroupListResultInner> - beginListEffectiveNetworkSecurityGroups(String resourceGroupName, String networkInterfaceName) { - return beginListEffectiveNetworkSecurityGroupsAsync(resourceGroupName, networkInterfaceName).getSyncPoller(); - } - - /** - * Gets all network security groups applied to a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network security groups applied to a network interface. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller< - PollResult, EffectiveNetworkSecurityGroupListResultInner> - beginListEffectiveNetworkSecurityGroups( - String resourceGroupName, String networkInterfaceName, Context context) { - return beginListEffectiveNetworkSecurityGroupsAsync(resourceGroupName, networkInterfaceName, context) - .getSyncPoller(); - } - - /** - * Gets all network security groups applied to a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network security groups applied to a network interface. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listEffectiveNetworkSecurityGroupsAsync( - String resourceGroupName, String networkInterfaceName) { - return beginListEffectiveNetworkSecurityGroupsAsync(resourceGroupName, networkInterfaceName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Gets all network security groups applied to a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network security groups applied to a network interface. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listEffectiveNetworkSecurityGroupsAsync( - String resourceGroupName, String networkInterfaceName, Context context) { - return beginListEffectiveNetworkSecurityGroupsAsync(resourceGroupName, networkInterfaceName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Gets all network security groups applied to a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network security groups applied to a network interface. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public EffectiveNetworkSecurityGroupListResultInner listEffectiveNetworkSecurityGroups( - String resourceGroupName, String networkInterfaceName) { - return listEffectiveNetworkSecurityGroupsAsync(resourceGroupName, networkInterfaceName).block(); - } - - /** - * Gets all network security groups applied to a network interface. - * - * @param resourceGroupName The name of the resource group. - * @param networkInterfaceName The name of the network interface. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network security groups applied to a network interface. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public EffectiveNetworkSecurityGroupListResultInner listEffectiveNetworkSecurityGroups( - String resourceGroupName, String networkInterfaceName, Context context) { - return listEffectiveNetworkSecurityGroupsAsync(resourceGroupName, networkInterfaceName, context).block(); - } - - /** - * Gets information about all network interfaces in a virtual machine in a virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @param virtualmachineIndex The virtual machine index. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about all network interfaces in a virtual machine in a virtual machine scale set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listVirtualMachineScaleSetVMNetworkInterfacesSinglePageAsync( - String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualMachineScaleSetName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualMachineScaleSetName is required and cannot be null.")); - } - if (virtualmachineIndex == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualmachineIndex is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-03-30"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listVirtualMachineScaleSetVMNetworkInterfaces( - this.client.getEndpoint(), - resourceGroupName, - virtualMachineScaleSetName, - virtualmachineIndex, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets information about all network interfaces in a virtual machine in a virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @param virtualmachineIndex The virtual machine index. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about all network interfaces in a virtual machine in a virtual machine scale set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listVirtualMachineScaleSetVMNetworkInterfacesSinglePageAsync( - String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualMachineScaleSetName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualMachineScaleSetName is required and cannot be null.")); - } - if (virtualmachineIndex == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualmachineIndex is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-03-30"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listVirtualMachineScaleSetVMNetworkInterfaces( - this.client.getEndpoint(), - resourceGroupName, - virtualMachineScaleSetName, - virtualmachineIndex, - apiVersion, - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets information about all network interfaces in a virtual machine in a virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @param virtualmachineIndex The virtual machine index. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about all network interfaces in a virtual machine in a virtual machine scale set. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listVirtualMachineScaleSetVMNetworkInterfacesAsync( - String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex) { - return new PagedFlux<>( - () -> - listVirtualMachineScaleSetVMNetworkInterfacesSinglePageAsync( - resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex), - nextLink -> listVirtualMachineScaleSetVMNetworkInterfacesNextSinglePageAsync(nextLink)); - } - - /** - * Gets information about all network interfaces in a virtual machine in a virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @param virtualmachineIndex The virtual machine index. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about all network interfaces in a virtual machine in a virtual machine scale set. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listVirtualMachineScaleSetVMNetworkInterfacesAsync( - String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, Context context) { - return new PagedFlux<>( - () -> - listVirtualMachineScaleSetVMNetworkInterfacesSinglePageAsync( - resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, context), - nextLink -> listVirtualMachineScaleSetVMNetworkInterfacesNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets information about all network interfaces in a virtual machine in a virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @param virtualmachineIndex The virtual machine index. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about all network interfaces in a virtual machine in a virtual machine scale set. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listVirtualMachineScaleSetVMNetworkInterfaces( - String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex) { - return new PagedIterable<>( - listVirtualMachineScaleSetVMNetworkInterfacesAsync( - resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex)); - } - - /** - * Gets information about all network interfaces in a virtual machine in a virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @param virtualmachineIndex The virtual machine index. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about all network interfaces in a virtual machine in a virtual machine scale set. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listVirtualMachineScaleSetVMNetworkInterfaces( - String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, Context context) { - return new PagedIterable<>( - listVirtualMachineScaleSetVMNetworkInterfacesAsync( - resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, context)); - } - - /** - * Gets all network interfaces in a virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network interfaces in a virtual machine scale set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listVirtualMachineScaleSetNetworkInterfacesSinglePageAsync( - String resourceGroupName, String virtualMachineScaleSetName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualMachineScaleSetName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualMachineScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-03-30"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listVirtualMachineScaleSetNetworkInterfaces( - this.client.getEndpoint(), - resourceGroupName, - virtualMachineScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all network interfaces in a virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network interfaces in a virtual machine scale set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listVirtualMachineScaleSetNetworkInterfacesSinglePageAsync( - String resourceGroupName, String virtualMachineScaleSetName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualMachineScaleSetName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualMachineScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-03-30"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listVirtualMachineScaleSetNetworkInterfaces( - this.client.getEndpoint(), - resourceGroupName, - virtualMachineScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all network interfaces in a virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network interfaces in a virtual machine scale set. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listVirtualMachineScaleSetNetworkInterfacesAsync( - String resourceGroupName, String virtualMachineScaleSetName) { - return new PagedFlux<>( - () -> - listVirtualMachineScaleSetNetworkInterfacesSinglePageAsync( - resourceGroupName, virtualMachineScaleSetName), - nextLink -> listVirtualMachineScaleSetNetworkInterfacesNextSinglePageAsync(nextLink)); - } - - /** - * Gets all network interfaces in a virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network interfaces in a virtual machine scale set. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listVirtualMachineScaleSetNetworkInterfacesAsync( - String resourceGroupName, String virtualMachineScaleSetName, Context context) { - return new PagedFlux<>( - () -> - listVirtualMachineScaleSetNetworkInterfacesSinglePageAsync( - resourceGroupName, virtualMachineScaleSetName, context), - nextLink -> listVirtualMachineScaleSetNetworkInterfacesNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all network interfaces in a virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network interfaces in a virtual machine scale set. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listVirtualMachineScaleSetNetworkInterfaces( - String resourceGroupName, String virtualMachineScaleSetName) { - return new PagedIterable<>( - listVirtualMachineScaleSetNetworkInterfacesAsync(resourceGroupName, virtualMachineScaleSetName)); - } - - /** - * Gets all network interfaces in a virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network interfaces in a virtual machine scale set. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listVirtualMachineScaleSetNetworkInterfaces( - String resourceGroupName, String virtualMachineScaleSetName, Context context) { - return new PagedIterable<>( - listVirtualMachineScaleSetNetworkInterfacesAsync(resourceGroupName, virtualMachineScaleSetName, context)); - } - - /** - * Get the specified network interface in a virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @param virtualmachineIndex The virtual machine index. - * @param networkInterfaceName The name of the network interface. - * @param expand Expands referenced resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network interface in a virtual machine scale set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getVirtualMachineScaleSetNetworkInterfaceWithResponseAsync( - String resourceGroupName, - String virtualMachineScaleSetName, - String virtualmachineIndex, - String networkInterfaceName, - String expand) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualMachineScaleSetName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualMachineScaleSetName is required and cannot be null.")); - } - if (virtualmachineIndex == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualmachineIndex is required and cannot be null.")); - } - if (networkInterfaceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-03-30"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getVirtualMachineScaleSetNetworkInterface( - this.client.getEndpoint(), - resourceGroupName, - virtualMachineScaleSetName, - virtualmachineIndex, - networkInterfaceName, - apiVersion, - this.client.getSubscriptionId(), - expand, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the specified network interface in a virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @param virtualmachineIndex The virtual machine index. - * @param networkInterfaceName The name of the network interface. - * @param expand Expands referenced resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network interface in a virtual machine scale set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getVirtualMachineScaleSetNetworkInterfaceWithResponseAsync( - String resourceGroupName, - String virtualMachineScaleSetName, - String virtualmachineIndex, - String networkInterfaceName, - String expand, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualMachineScaleSetName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualMachineScaleSetName is required and cannot be null.")); - } - if (virtualmachineIndex == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualmachineIndex is required and cannot be null.")); - } - if (networkInterfaceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-03-30"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getVirtualMachineScaleSetNetworkInterface( - this.client.getEndpoint(), - resourceGroupName, - virtualMachineScaleSetName, - virtualmachineIndex, - networkInterfaceName, - apiVersion, - this.client.getSubscriptionId(), - expand, - accept, - context); - } - - /** - * Get the specified network interface in a virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @param virtualmachineIndex The virtual machine index. - * @param networkInterfaceName The name of the network interface. - * @param expand Expands referenced resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network interface in a virtual machine scale set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getVirtualMachineScaleSetNetworkInterfaceAsync( - String resourceGroupName, - String virtualMachineScaleSetName, - String virtualmachineIndex, - String networkInterfaceName, - String expand) { - return getVirtualMachineScaleSetNetworkInterfaceWithResponseAsync( - resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get the specified network interface in a virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @param virtualmachineIndex The virtual machine index. - * @param networkInterfaceName The name of the network interface. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network interface in a virtual machine scale set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getVirtualMachineScaleSetNetworkInterfaceAsync( - String resourceGroupName, - String virtualMachineScaleSetName, - String virtualmachineIndex, - String networkInterfaceName) { - final String expand = null; - return getVirtualMachineScaleSetNetworkInterfaceWithResponseAsync( - resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get the specified network interface in a virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @param virtualmachineIndex The virtual machine index. - * @param networkInterfaceName The name of the network interface. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network interface in a virtual machine scale set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public NetworkInterfaceInner getVirtualMachineScaleSetNetworkInterface( - String resourceGroupName, - String virtualMachineScaleSetName, - String virtualmachineIndex, - String networkInterfaceName) { - final String expand = null; - return getVirtualMachineScaleSetNetworkInterfaceAsync( - resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, expand) - .block(); - } - - /** - * Get the specified network interface in a virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @param virtualmachineIndex The virtual machine index. - * @param networkInterfaceName The name of the network interface. - * @param expand Expands referenced resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network interface in a virtual machine scale set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getVirtualMachineScaleSetNetworkInterfaceWithResponse( - String resourceGroupName, - String virtualMachineScaleSetName, - String virtualmachineIndex, - String networkInterfaceName, - String expand, - Context context) { - return getVirtualMachineScaleSetNetworkInterfaceWithResponseAsync( - resourceGroupName, - virtualMachineScaleSetName, - virtualmachineIndex, - networkInterfaceName, - expand, - context) - .block(); - } - - /** - * Get the specified network interface ip configuration in a virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @param virtualmachineIndex The virtual machine index. - * @param networkInterfaceName The name of the network interface. - * @param expand Expands referenced resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network interface ip configuration in a virtual machine scale set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listVirtualMachineScaleSetIpConfigurationsSinglePageAsync( - String resourceGroupName, - String virtualMachineScaleSetName, - String virtualmachineIndex, - String networkInterfaceName, - String expand) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualMachineScaleSetName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualMachineScaleSetName is required and cannot be null.")); - } - if (virtualmachineIndex == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualmachineIndex is required and cannot be null.")); - } - if (networkInterfaceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-03-30"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listVirtualMachineScaleSetIpConfigurations( - this.client.getEndpoint(), - resourceGroupName, - virtualMachineScaleSetName, - virtualmachineIndex, - networkInterfaceName, - apiVersion, - this.client.getSubscriptionId(), - expand, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the specified network interface ip configuration in a virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @param virtualmachineIndex The virtual machine index. - * @param networkInterfaceName The name of the network interface. - * @param expand Expands referenced resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network interface ip configuration in a virtual machine scale set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listVirtualMachineScaleSetIpConfigurationsSinglePageAsync( - String resourceGroupName, - String virtualMachineScaleSetName, - String virtualmachineIndex, - String networkInterfaceName, - String expand, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualMachineScaleSetName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualMachineScaleSetName is required and cannot be null.")); - } - if (virtualmachineIndex == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualmachineIndex is required and cannot be null.")); - } - if (networkInterfaceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-03-30"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listVirtualMachineScaleSetIpConfigurations( - this.client.getEndpoint(), - resourceGroupName, - virtualMachineScaleSetName, - virtualmachineIndex, - networkInterfaceName, - apiVersion, - this.client.getSubscriptionId(), - expand, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the specified network interface ip configuration in a virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @param virtualmachineIndex The virtual machine index. - * @param networkInterfaceName The name of the network interface. - * @param expand Expands referenced resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network interface ip configuration in a virtual machine scale set. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listVirtualMachineScaleSetIpConfigurationsAsync( - String resourceGroupName, - String virtualMachineScaleSetName, - String virtualmachineIndex, - String networkInterfaceName, - String expand) { - return new PagedFlux<>( - () -> - listVirtualMachineScaleSetIpConfigurationsSinglePageAsync( - resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, expand), - nextLink -> listVirtualMachineScaleSetIpConfigurationsNextSinglePageAsync(nextLink)); - } - - /** - * Get the specified network interface ip configuration in a virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @param virtualmachineIndex The virtual machine index. - * @param networkInterfaceName The name of the network interface. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network interface ip configuration in a virtual machine scale set. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listVirtualMachineScaleSetIpConfigurationsAsync( - String resourceGroupName, - String virtualMachineScaleSetName, - String virtualmachineIndex, - String networkInterfaceName) { - final String expand = null; - return new PagedFlux<>( - () -> - listVirtualMachineScaleSetIpConfigurationsSinglePageAsync( - resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, expand), - nextLink -> listVirtualMachineScaleSetIpConfigurationsNextSinglePageAsync(nextLink)); - } - - /** - * Get the specified network interface ip configuration in a virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @param virtualmachineIndex The virtual machine index. - * @param networkInterfaceName The name of the network interface. - * @param expand Expands referenced resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network interface ip configuration in a virtual machine scale set. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listVirtualMachineScaleSetIpConfigurationsAsync( - String resourceGroupName, - String virtualMachineScaleSetName, - String virtualmachineIndex, - String networkInterfaceName, - String expand, - Context context) { - return new PagedFlux<>( - () -> - listVirtualMachineScaleSetIpConfigurationsSinglePageAsync( - resourceGroupName, - virtualMachineScaleSetName, - virtualmachineIndex, - networkInterfaceName, - expand, - context), - nextLink -> listVirtualMachineScaleSetIpConfigurationsNextSinglePageAsync(nextLink, context)); - } - - /** - * Get the specified network interface ip configuration in a virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @param virtualmachineIndex The virtual machine index. - * @param networkInterfaceName The name of the network interface. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network interface ip configuration in a virtual machine scale set. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listVirtualMachineScaleSetIpConfigurations( - String resourceGroupName, - String virtualMachineScaleSetName, - String virtualmachineIndex, - String networkInterfaceName) { - final String expand = null; - return new PagedIterable<>( - listVirtualMachineScaleSetIpConfigurationsAsync( - resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, expand)); - } - - /** - * Get the specified network interface ip configuration in a virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @param virtualmachineIndex The virtual machine index. - * @param networkInterfaceName The name of the network interface. - * @param expand Expands referenced resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network interface ip configuration in a virtual machine scale set. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listVirtualMachineScaleSetIpConfigurations( - String resourceGroupName, - String virtualMachineScaleSetName, - String virtualmachineIndex, - String networkInterfaceName, - String expand, - Context context) { - return new PagedIterable<>( - listVirtualMachineScaleSetIpConfigurationsAsync( - resourceGroupName, - virtualMachineScaleSetName, - virtualmachineIndex, - networkInterfaceName, - expand, - context)); - } - - /** - * Get the specified network interface ip configuration in a virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @param virtualmachineIndex The virtual machine index. - * @param networkInterfaceName The name of the network interface. - * @param ipConfigurationName The name of the ip configuration. - * @param expand Expands referenced resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network interface ip configuration in a virtual machine scale set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> - getVirtualMachineScaleSetIpConfigurationWithResponseAsync( - String resourceGroupName, - String virtualMachineScaleSetName, - String virtualmachineIndex, - String networkInterfaceName, - String ipConfigurationName, - String expand) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualMachineScaleSetName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualMachineScaleSetName is required and cannot be null.")); - } - if (virtualmachineIndex == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualmachineIndex is required and cannot be null.")); - } - if (networkInterfaceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null.")); - } - if (ipConfigurationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter ipConfigurationName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-03-30"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getVirtualMachineScaleSetIpConfiguration( - this.client.getEndpoint(), - resourceGroupName, - virtualMachineScaleSetName, - virtualmachineIndex, - networkInterfaceName, - ipConfigurationName, - apiVersion, - this.client.getSubscriptionId(), - expand, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the specified network interface ip configuration in a virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @param virtualmachineIndex The virtual machine index. - * @param networkInterfaceName The name of the network interface. - * @param ipConfigurationName The name of the ip configuration. - * @param expand Expands referenced resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network interface ip configuration in a virtual machine scale set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - getVirtualMachineScaleSetIpConfigurationWithResponseAsync( - String resourceGroupName, - String virtualMachineScaleSetName, - String virtualmachineIndex, - String networkInterfaceName, - String ipConfigurationName, - String expand, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualMachineScaleSetName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualMachineScaleSetName is required and cannot be null.")); - } - if (virtualmachineIndex == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualmachineIndex is required and cannot be null.")); - } - if (networkInterfaceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null.")); - } - if (ipConfigurationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter ipConfigurationName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-03-30"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getVirtualMachineScaleSetIpConfiguration( - this.client.getEndpoint(), - resourceGroupName, - virtualMachineScaleSetName, - virtualmachineIndex, - networkInterfaceName, - ipConfigurationName, - apiVersion, - this.client.getSubscriptionId(), - expand, - accept, - context); - } - - /** - * Get the specified network interface ip configuration in a virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @param virtualmachineIndex The virtual machine index. - * @param networkInterfaceName The name of the network interface. - * @param ipConfigurationName The name of the ip configuration. - * @param expand Expands referenced resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network interface ip configuration in a virtual machine scale set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getVirtualMachineScaleSetIpConfigurationAsync( - String resourceGroupName, - String virtualMachineScaleSetName, - String virtualmachineIndex, - String networkInterfaceName, - String ipConfigurationName, - String expand) { - return getVirtualMachineScaleSetIpConfigurationWithResponseAsync( - resourceGroupName, - virtualMachineScaleSetName, - virtualmachineIndex, - networkInterfaceName, - ipConfigurationName, - expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get the specified network interface ip configuration in a virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @param virtualmachineIndex The virtual machine index. - * @param networkInterfaceName The name of the network interface. - * @param ipConfigurationName The name of the ip configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network interface ip configuration in a virtual machine scale set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getVirtualMachineScaleSetIpConfigurationAsync( - String resourceGroupName, - String virtualMachineScaleSetName, - String virtualmachineIndex, - String networkInterfaceName, - String ipConfigurationName) { - final String expand = null; - return getVirtualMachineScaleSetIpConfigurationWithResponseAsync( - resourceGroupName, - virtualMachineScaleSetName, - virtualmachineIndex, - networkInterfaceName, - ipConfigurationName, - expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get the specified network interface ip configuration in a virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @param virtualmachineIndex The virtual machine index. - * @param networkInterfaceName The name of the network interface. - * @param ipConfigurationName The name of the ip configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network interface ip configuration in a virtual machine scale set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public NetworkInterfaceIpConfigurationInner getVirtualMachineScaleSetIpConfiguration( - String resourceGroupName, - String virtualMachineScaleSetName, - String virtualmachineIndex, - String networkInterfaceName, - String ipConfigurationName) { - final String expand = null; - return getVirtualMachineScaleSetIpConfigurationAsync( - resourceGroupName, - virtualMachineScaleSetName, - virtualmachineIndex, - networkInterfaceName, - ipConfigurationName, - expand) - .block(); - } - - /** - * Get the specified network interface ip configuration in a virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @param virtualmachineIndex The virtual machine index. - * @param networkInterfaceName The name of the network interface. - * @param ipConfigurationName The name of the ip configuration. - * @param expand Expands referenced resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network interface ip configuration in a virtual machine scale set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getVirtualMachineScaleSetIpConfigurationWithResponse( - String resourceGroupName, - String virtualMachineScaleSetName, - String virtualmachineIndex, - String networkInterfaceName, - String ipConfigurationName, - String expand, - Context context) { - return getVirtualMachineScaleSetIpConfigurationWithResponseAsync( - resourceGroupName, - virtualMachineScaleSetName, - virtualmachineIndex, - networkInterfaceName, - ipConfigurationName, - expand, - context) - .block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the ListNetworkInterface API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAllNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listAllNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the ListNetworkInterface API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAllNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listAllNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the ListNetworkInterface API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the ListNetworkInterface API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the ListNetworkInterface API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listVirtualMachineScaleSetVMNetworkInterfacesNextSinglePageAsync( - String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listVirtualMachineScaleSetVMNetworkInterfacesNext( - nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the ListNetworkInterface API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listVirtualMachineScaleSetVMNetworkInterfacesNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listVirtualMachineScaleSetVMNetworkInterfacesNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the ListNetworkInterface API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listVirtualMachineScaleSetNetworkInterfacesNextSinglePageAsync( - String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listVirtualMachineScaleSetNetworkInterfacesNext( - nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the ListNetworkInterface API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listVirtualMachineScaleSetNetworkInterfacesNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listVirtualMachineScaleSetNetworkInterfacesNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for list ip configurations API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listVirtualMachineScaleSetIpConfigurationsNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listVirtualMachineScaleSetIpConfigurationsNext( - nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for list ip configurations API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listVirtualMachineScaleSetIpConfigurationsNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listVirtualMachineScaleSetIpConfigurationsNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NetworkInterfacesImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NetworkInterfacesImpl.java deleted file mode 100644 index cf4b898bf3c8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NetworkInterfacesImpl.java +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.network.fluent.NetworkInterfacesClient; -import com.azure.resourcemanager.network.fluent.models.NetworkInterfaceInner; -import com.azure.resourcemanager.network.fluent.models.NetworkInterfaceIpConfigurationInner; -import com.azure.resourcemanager.network.models.NetworkInterface; -import com.azure.resourcemanager.network.models.NetworkInterfaceDnsSettings; -import com.azure.resourcemanager.network.models.NetworkInterfaces; -import com.azure.resourcemanager.network.models.VirtualMachineScaleSetNetworkInterface; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.TopLevelModifiableResourcesImpl; -import com.azure.resourcemanager.resources.fluentcore.model.Accepted; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.AcceptedImpl; - -import java.util.ArrayList; -import java.util.function.Function; - -/** Implementation for {@link NetworkInterfaces}. */ -public class NetworkInterfacesImpl - extends TopLevelModifiableResourcesImpl< - NetworkInterface, NetworkInterfaceImpl, NetworkInterfaceInner, NetworkInterfacesClient, NetworkManager> - implements NetworkInterfaces { - - private final ClientLogger logger = new ClientLogger(this.getClass()); - - public NetworkInterfacesImpl(final NetworkManager networkManager) { - super(networkManager.serviceClient().getNetworkInterfaces(), networkManager); - } - - @Override - public VirtualMachineScaleSetNetworkInterface getByVirtualMachineScaleSetInstanceId( - String resourceGroupName, String scaleSetName, String instanceId, String name) { - VirtualMachineScaleSetNetworkInterfacesImpl scaleSetNetworkInterfaces = - new VirtualMachineScaleSetNetworkInterfacesImpl(resourceGroupName, scaleSetName, this.manager()); - return scaleSetNetworkInterfaces.getByVirtualMachineInstanceId(instanceId, name); - } - - @Override - public PagedIterable listByVirtualMachineScaleSet( - String resourceGroupName, String scaleSetName) { - VirtualMachineScaleSetNetworkInterfacesImpl scaleSetNetworkInterfaces = - new VirtualMachineScaleSetNetworkInterfacesImpl(resourceGroupName, scaleSetName, this.manager()); - return scaleSetNetworkInterfaces.list(); - } - - @Override - public PagedIterable listByVirtualMachineScaleSetId(String id) { - return this - .listByVirtualMachineScaleSet(ResourceUtils.groupFromResourceId(id), ResourceUtils.nameFromResourceId(id)); - } - - @Override - public PagedIterable listByVirtualMachineScaleSetInstanceId( - String resourceGroupName, String scaleSetName, String instanceId) { - VirtualMachineScaleSetNetworkInterfacesImpl scaleSetNetworkInterfaces = - new VirtualMachineScaleSetNetworkInterfacesImpl(resourceGroupName, scaleSetName, this.manager()); - return scaleSetNetworkInterfaces.listByVirtualMachineInstanceId(instanceId); - } - - @Override - public PagedFlux listByVirtualMachineScaleSetInstanceIdAsync( - String resourceGroupName, String scaleSetName, String instanceId) { - VirtualMachineScaleSetNetworkInterfacesImpl scaleSetNetworkInterfaces = - new VirtualMachineScaleSetNetworkInterfacesImpl(resourceGroupName, scaleSetName, this.manager()); - return scaleSetNetworkInterfaces.listByVirtualMachineInstanceIdAsync(instanceId); - } - - @Override - public NetworkInterfaceImpl define(String name) { - return wrapModel(name); - } - - @Override - protected NetworkInterfaceImpl wrapModel(String name) { - NetworkInterfaceInner inner = new NetworkInterfaceInner(); - inner.withIpConfigurations(new ArrayList()); - inner.withDnsSettings(new NetworkInterfaceDnsSettings()); - return new NetworkInterfaceImpl(name, inner, super.manager()); - } - - @Override - protected NetworkInterfaceImpl wrapModel(NetworkInterfaceInner inner) { - if (inner == null) { - return null; - } - return new NetworkInterfaceImpl(inner.name(), inner, this.manager()); - } - - @Override - public Accepted beginDeleteById(String id) { - return beginDeleteByResourceGroup(ResourceUtils.groupFromResourceId(id), ResourceUtils.nameFromResourceId(id)); - } - - @Override - public Accepted beginDeleteByResourceGroup(String resourceGroupName, String name) { - return AcceptedImpl - .newAccepted( - logger, - this.manager().serviceClient().getHttpPipeline(), - this.manager().serviceClient().getDefaultPollInterval(), - () -> this.inner().deleteWithResponseAsync(resourceGroupName, name).block(), - Function.identity(), - Void.class, - null, - Context.NONE); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NetworkManagementClientBuilder.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NetworkManagementClientBuilder.java deleted file mode 100644 index dc868e1c118c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NetworkManagementClientBuilder.java +++ /dev/null @@ -1,149 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.annotation.ServiceClientBuilder; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.policy.CookiePolicy; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerAdapter; -import java.time.Duration; - -/** A builder for creating a new instance of the NetworkManagementClientImpl type. */ -@ServiceClientBuilder(serviceClients = {NetworkManagementClientImpl.class}) -public final class NetworkManagementClientBuilder { - /* - * The subscription credentials which uniquely identify the Microsoft Azure - * subscription. The subscription ID forms part of the URI for every - * service call. - */ - private String subscriptionId; - - /** - * Sets The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID - * forms part of the URI for every service call. - * - * @param subscriptionId the subscriptionId value. - * @return the NetworkManagementClientBuilder. - */ - public NetworkManagementClientBuilder subscriptionId(String subscriptionId) { - this.subscriptionId = subscriptionId; - return this; - } - - /* - * server parameter - */ - private String endpoint; - - /** - * Sets server parameter. - * - * @param endpoint the endpoint value. - * @return the NetworkManagementClientBuilder. - */ - public NetworkManagementClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * The environment to connect to - */ - private AzureEnvironment environment; - - /** - * Sets The environment to connect to. - * - * @param environment the environment value. - * @return the NetworkManagementClientBuilder. - */ - public NetworkManagementClientBuilder environment(AzureEnvironment environment) { - this.environment = environment; - return this; - } - - /* - * The default poll interval for long-running operation - */ - private Duration defaultPollInterval; - - /** - * Sets The default poll interval for long-running operation. - * - * @param defaultPollInterval the defaultPollInterval value. - * @return the NetworkManagementClientBuilder. - */ - public NetworkManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = defaultPollInterval; - return this; - } - - /* - * The HTTP pipeline to send requests through - */ - private HttpPipeline pipeline; - - /** - * Sets The HTTP pipeline to send requests through. - * - * @param pipeline the pipeline value. - * @return the NetworkManagementClientBuilder. - */ - public NetworkManagementClientBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; - return this; - } - - /* - * The serializer to serialize an object into a string - */ - private SerializerAdapter serializerAdapter; - - /** - * Sets The serializer to serialize an object into a string. - * - * @param serializerAdapter the serializerAdapter value. - * @return the NetworkManagementClientBuilder. - */ - public NetworkManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { - this.serializerAdapter = serializerAdapter; - return this; - } - - /** - * Builds an instance of NetworkManagementClientImpl with the provided parameters. - * - * @return an instance of NetworkManagementClientImpl. - */ - public NetworkManagementClientImpl buildClient() { - if (endpoint == null) { - this.endpoint = "https://management.azure.com"; - } - if (environment == null) { - this.environment = AzureEnvironment.AZURE; - } - if (defaultPollInterval == null) { - this.defaultPollInterval = Duration.ofSeconds(30); - } - if (pipeline == null) { - this.pipeline = - new HttpPipelineBuilder() - .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) - .build(); - } - if (serializerAdapter == null) { - this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); - } - NetworkManagementClientImpl client = - new NetworkManagementClientImpl( - pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); - return client; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NetworkManagementClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NetworkManagementClientImpl.java deleted file mode 100644 index e44c5c589272..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NetworkManagementClientImpl.java +++ /dev/null @@ -1,1416 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.serializer.SerializerAdapter; -import com.azure.resourcemanager.network.fluent.ApplicationGatewaysClient; -import com.azure.resourcemanager.network.fluent.ApplicationSecurityGroupsClient; -import com.azure.resourcemanager.network.fluent.AvailableDelegationsClient; -import com.azure.resourcemanager.network.fluent.AvailableEndpointServicesClient; -import com.azure.resourcemanager.network.fluent.AvailableResourceGroupDelegationsClient; -import com.azure.resourcemanager.network.fluent.AzureFirewallFqdnTagsClient; -import com.azure.resourcemanager.network.fluent.AzureFirewallsClient; -import com.azure.resourcemanager.network.fluent.BgpServiceCommunitiesClient; -import com.azure.resourcemanager.network.fluent.ConnectionMonitorsClient; -import com.azure.resourcemanager.network.fluent.DdosCustomPoliciesClient; -import com.azure.resourcemanager.network.fluent.DdosProtectionPlansClient; -import com.azure.resourcemanager.network.fluent.DefaultSecurityRulesClient; -import com.azure.resourcemanager.network.fluent.ExpressRouteCircuitAuthorizationsClient; -import com.azure.resourcemanager.network.fluent.ExpressRouteCircuitConnectionsClient; -import com.azure.resourcemanager.network.fluent.ExpressRouteCircuitPeeringsClient; -import com.azure.resourcemanager.network.fluent.ExpressRouteCircuitsClient; -import com.azure.resourcemanager.network.fluent.ExpressRouteConnectionsClient; -import com.azure.resourcemanager.network.fluent.ExpressRouteCrossConnectionPeeringsClient; -import com.azure.resourcemanager.network.fluent.ExpressRouteCrossConnectionsClient; -import com.azure.resourcemanager.network.fluent.ExpressRouteGatewaysClient; -import com.azure.resourcemanager.network.fluent.ExpressRouteLinksClient; -import com.azure.resourcemanager.network.fluent.ExpressRoutePortsClient; -import com.azure.resourcemanager.network.fluent.ExpressRoutePortsLocationsClient; -import com.azure.resourcemanager.network.fluent.ExpressRouteServiceProvidersClient; -import com.azure.resourcemanager.network.fluent.HubVirtualNetworkConnectionsClient; -import com.azure.resourcemanager.network.fluent.InboundNatRulesClient; -import com.azure.resourcemanager.network.fluent.InterfaceEndpointsClient; -import com.azure.resourcemanager.network.fluent.LoadBalancerBackendAddressPoolsClient; -import com.azure.resourcemanager.network.fluent.LoadBalancerFrontendIpConfigurationsClient; -import com.azure.resourcemanager.network.fluent.LoadBalancerLoadBalancingRulesClient; -import com.azure.resourcemanager.network.fluent.LoadBalancerNetworkInterfacesClient; -import com.azure.resourcemanager.network.fluent.LoadBalancerOutboundRulesClient; -import com.azure.resourcemanager.network.fluent.LoadBalancerProbesClient; -import com.azure.resourcemanager.network.fluent.LoadBalancersClient; -import com.azure.resourcemanager.network.fluent.LocalNetworkGatewaysClient; -import com.azure.resourcemanager.network.fluent.NetworkInterfaceIpConfigurationsClient; -import com.azure.resourcemanager.network.fluent.NetworkInterfaceLoadBalancersClient; -import com.azure.resourcemanager.network.fluent.NetworkInterfaceTapConfigurationsClient; -import com.azure.resourcemanager.network.fluent.NetworkInterfacesClient; -import com.azure.resourcemanager.network.fluent.NetworkManagementClient; -import com.azure.resourcemanager.network.fluent.NetworkProfilesClient; -import com.azure.resourcemanager.network.fluent.NetworkSecurityGroupsClient; -import com.azure.resourcemanager.network.fluent.NetworkWatchersClient; -import com.azure.resourcemanager.network.fluent.OperationsClient; -import com.azure.resourcemanager.network.fluent.P2SVpnGatewaysClient; -import com.azure.resourcemanager.network.fluent.P2SVpnServerConfigurationsClient; -import com.azure.resourcemanager.network.fluent.PacketCapturesClient; -import com.azure.resourcemanager.network.fluent.PublicIpAddressesClient; -import com.azure.resourcemanager.network.fluent.PublicIpPrefixesClient; -import com.azure.resourcemanager.network.fluent.RouteFilterRulesClient; -import com.azure.resourcemanager.network.fluent.RouteFiltersClient; -import com.azure.resourcemanager.network.fluent.RouteTablesClient; -import com.azure.resourcemanager.network.fluent.RoutesClient; -import com.azure.resourcemanager.network.fluent.SecurityRulesClient; -import com.azure.resourcemanager.network.fluent.ServiceEndpointPoliciesClient; -import com.azure.resourcemanager.network.fluent.ServiceEndpointPolicyDefinitionsClient; -import com.azure.resourcemanager.network.fluent.SubnetsClient; -import com.azure.resourcemanager.network.fluent.UsagesClient; -import com.azure.resourcemanager.network.fluent.VirtualHubsClient; -import com.azure.resourcemanager.network.fluent.VirtualNetworkGatewayConnectionsClient; -import com.azure.resourcemanager.network.fluent.VirtualNetworkGatewaysClient; -import com.azure.resourcemanager.network.fluent.VirtualNetworkPeeringsClient; -import com.azure.resourcemanager.network.fluent.VirtualNetworkTapsClient; -import com.azure.resourcemanager.network.fluent.VirtualNetworksClient; -import com.azure.resourcemanager.network.fluent.VirtualWansClient; -import com.azure.resourcemanager.network.fluent.VpnConnectionsClient; -import com.azure.resourcemanager.network.fluent.VpnGatewaysClient; -import com.azure.resourcemanager.network.fluent.VpnSitesClient; -import com.azure.resourcemanager.network.fluent.VpnSitesConfigurationsClient; -import com.azure.resourcemanager.network.fluent.models.DnsNameAvailabilityResultInner; -import com.azure.resourcemanager.network.fluent.models.VirtualWanSecurityProvidersInner; -import com.azure.resourcemanager.network.models.ErrorException; -import com.azure.resourcemanager.resources.fluentcore.AzureServiceClient; -import java.time.Duration; -import reactor.core.publisher.Mono; - -/** Initializes a new instance of the NetworkManagementClientImpl type. */ -@ServiceClient(builder = NetworkManagementClientBuilder.class) -public final class NetworkManagementClientImpl extends AzureServiceClient implements NetworkManagementClient { - private final ClientLogger logger = new ClientLogger(NetworkManagementClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final NetworkManagementClientService service; - - /** - * The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms - * part of the URI for every service call. - */ - private final String subscriptionId; - - /** - * Gets The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID - * forms part of the URI for every service call. - * - * @return the subscriptionId value. - */ - public String getSubscriptionId() { - return this.subscriptionId; - } - - /** server parameter. */ - private final String endpoint; - - /** - * Gets server parameter. - * - * @return the endpoint value. - */ - public String getEndpoint() { - return this.endpoint; - } - - /** The HTTP pipeline to send requests through. */ - private final HttpPipeline httpPipeline; - - /** - * Gets The HTTP pipeline to send requests through. - * - * @return the httpPipeline value. - */ - public HttpPipeline getHttpPipeline() { - return this.httpPipeline; - } - - /** The serializer to serialize an object into a string. */ - private final SerializerAdapter serializerAdapter; - - /** - * Gets The serializer to serialize an object into a string. - * - * @return the serializerAdapter value. - */ - SerializerAdapter getSerializerAdapter() { - return this.serializerAdapter; - } - - /** The default poll interval for long-running operation. */ - private final Duration defaultPollInterval; - - /** - * Gets The default poll interval for long-running operation. - * - * @return the defaultPollInterval value. - */ - public Duration getDefaultPollInterval() { - return this.defaultPollInterval; - } - - /** The ApplicationGatewaysClient object to access its operations. */ - private final ApplicationGatewaysClient applicationGateways; - - /** - * Gets the ApplicationGatewaysClient object to access its operations. - * - * @return the ApplicationGatewaysClient object. - */ - public ApplicationGatewaysClient getApplicationGateways() { - return this.applicationGateways; - } - - /** The ApplicationSecurityGroupsClient object to access its operations. */ - private final ApplicationSecurityGroupsClient applicationSecurityGroups; - - /** - * Gets the ApplicationSecurityGroupsClient object to access its operations. - * - * @return the ApplicationSecurityGroupsClient object. - */ - public ApplicationSecurityGroupsClient getApplicationSecurityGroups() { - return this.applicationSecurityGroups; - } - - /** The AvailableDelegationsClient object to access its operations. */ - private final AvailableDelegationsClient availableDelegations; - - /** - * Gets the AvailableDelegationsClient object to access its operations. - * - * @return the AvailableDelegationsClient object. - */ - public AvailableDelegationsClient getAvailableDelegations() { - return this.availableDelegations; - } - - /** The AvailableResourceGroupDelegationsClient object to access its operations. */ - private final AvailableResourceGroupDelegationsClient availableResourceGroupDelegations; - - /** - * Gets the AvailableResourceGroupDelegationsClient object to access its operations. - * - * @return the AvailableResourceGroupDelegationsClient object. - */ - public AvailableResourceGroupDelegationsClient getAvailableResourceGroupDelegations() { - return this.availableResourceGroupDelegations; - } - - /** The AzureFirewallsClient object to access its operations. */ - private final AzureFirewallsClient azureFirewalls; - - /** - * Gets the AzureFirewallsClient object to access its operations. - * - * @return the AzureFirewallsClient object. - */ - public AzureFirewallsClient getAzureFirewalls() { - return this.azureFirewalls; - } - - /** The AzureFirewallFqdnTagsClient object to access its operations. */ - private final AzureFirewallFqdnTagsClient azureFirewallFqdnTags; - - /** - * Gets the AzureFirewallFqdnTagsClient object to access its operations. - * - * @return the AzureFirewallFqdnTagsClient object. - */ - public AzureFirewallFqdnTagsClient getAzureFirewallFqdnTags() { - return this.azureFirewallFqdnTags; - } - - /** The DdosCustomPoliciesClient object to access its operations. */ - private final DdosCustomPoliciesClient ddosCustomPolicies; - - /** - * Gets the DdosCustomPoliciesClient object to access its operations. - * - * @return the DdosCustomPoliciesClient object. - */ - public DdosCustomPoliciesClient getDdosCustomPolicies() { - return this.ddosCustomPolicies; - } - - /** The DdosProtectionPlansClient object to access its operations. */ - private final DdosProtectionPlansClient ddosProtectionPlans; - - /** - * Gets the DdosProtectionPlansClient object to access its operations. - * - * @return the DdosProtectionPlansClient object. - */ - public DdosProtectionPlansClient getDdosProtectionPlans() { - return this.ddosProtectionPlans; - } - - /** The AvailableEndpointServicesClient object to access its operations. */ - private final AvailableEndpointServicesClient availableEndpointServices; - - /** - * Gets the AvailableEndpointServicesClient object to access its operations. - * - * @return the AvailableEndpointServicesClient object. - */ - public AvailableEndpointServicesClient getAvailableEndpointServices() { - return this.availableEndpointServices; - } - - /** The ExpressRouteCircuitAuthorizationsClient object to access its operations. */ - private final ExpressRouteCircuitAuthorizationsClient expressRouteCircuitAuthorizations; - - /** - * Gets the ExpressRouteCircuitAuthorizationsClient object to access its operations. - * - * @return the ExpressRouteCircuitAuthorizationsClient object. - */ - public ExpressRouteCircuitAuthorizationsClient getExpressRouteCircuitAuthorizations() { - return this.expressRouteCircuitAuthorizations; - } - - /** The ExpressRouteCircuitPeeringsClient object to access its operations. */ - private final ExpressRouteCircuitPeeringsClient expressRouteCircuitPeerings; - - /** - * Gets the ExpressRouteCircuitPeeringsClient object to access its operations. - * - * @return the ExpressRouteCircuitPeeringsClient object. - */ - public ExpressRouteCircuitPeeringsClient getExpressRouteCircuitPeerings() { - return this.expressRouteCircuitPeerings; - } - - /** The ExpressRouteCircuitConnectionsClient object to access its operations. */ - private final ExpressRouteCircuitConnectionsClient expressRouteCircuitConnections; - - /** - * Gets the ExpressRouteCircuitConnectionsClient object to access its operations. - * - * @return the ExpressRouteCircuitConnectionsClient object. - */ - public ExpressRouteCircuitConnectionsClient getExpressRouteCircuitConnections() { - return this.expressRouteCircuitConnections; - } - - /** The ExpressRouteCircuitsClient object to access its operations. */ - private final ExpressRouteCircuitsClient expressRouteCircuits; - - /** - * Gets the ExpressRouteCircuitsClient object to access its operations. - * - * @return the ExpressRouteCircuitsClient object. - */ - public ExpressRouteCircuitsClient getExpressRouteCircuits() { - return this.expressRouteCircuits; - } - - /** The ExpressRouteServiceProvidersClient object to access its operations. */ - private final ExpressRouteServiceProvidersClient expressRouteServiceProviders; - - /** - * Gets the ExpressRouteServiceProvidersClient object to access its operations. - * - * @return the ExpressRouteServiceProvidersClient object. - */ - public ExpressRouteServiceProvidersClient getExpressRouteServiceProviders() { - return this.expressRouteServiceProviders; - } - - /** The ExpressRouteCrossConnectionsClient object to access its operations. */ - private final ExpressRouteCrossConnectionsClient expressRouteCrossConnections; - - /** - * Gets the ExpressRouteCrossConnectionsClient object to access its operations. - * - * @return the ExpressRouteCrossConnectionsClient object. - */ - public ExpressRouteCrossConnectionsClient getExpressRouteCrossConnections() { - return this.expressRouteCrossConnections; - } - - /** The ExpressRouteCrossConnectionPeeringsClient object to access its operations. */ - private final ExpressRouteCrossConnectionPeeringsClient expressRouteCrossConnectionPeerings; - - /** - * Gets the ExpressRouteCrossConnectionPeeringsClient object to access its operations. - * - * @return the ExpressRouteCrossConnectionPeeringsClient object. - */ - public ExpressRouteCrossConnectionPeeringsClient getExpressRouteCrossConnectionPeerings() { - return this.expressRouteCrossConnectionPeerings; - } - - /** The ExpressRouteGatewaysClient object to access its operations. */ - private final ExpressRouteGatewaysClient expressRouteGateways; - - /** - * Gets the ExpressRouteGatewaysClient object to access its operations. - * - * @return the ExpressRouteGatewaysClient object. - */ - public ExpressRouteGatewaysClient getExpressRouteGateways() { - return this.expressRouteGateways; - } - - /** The ExpressRouteConnectionsClient object to access its operations. */ - private final ExpressRouteConnectionsClient expressRouteConnections; - - /** - * Gets the ExpressRouteConnectionsClient object to access its operations. - * - * @return the ExpressRouteConnectionsClient object. - */ - public ExpressRouteConnectionsClient getExpressRouteConnections() { - return this.expressRouteConnections; - } - - /** The ExpressRoutePortsLocationsClient object to access its operations. */ - private final ExpressRoutePortsLocationsClient expressRoutePortsLocations; - - /** - * Gets the ExpressRoutePortsLocationsClient object to access its operations. - * - * @return the ExpressRoutePortsLocationsClient object. - */ - public ExpressRoutePortsLocationsClient getExpressRoutePortsLocations() { - return this.expressRoutePortsLocations; - } - - /** The ExpressRoutePortsClient object to access its operations. */ - private final ExpressRoutePortsClient expressRoutePorts; - - /** - * Gets the ExpressRoutePortsClient object to access its operations. - * - * @return the ExpressRoutePortsClient object. - */ - public ExpressRoutePortsClient getExpressRoutePorts() { - return this.expressRoutePorts; - } - - /** The ExpressRouteLinksClient object to access its operations. */ - private final ExpressRouteLinksClient expressRouteLinks; - - /** - * Gets the ExpressRouteLinksClient object to access its operations. - * - * @return the ExpressRouteLinksClient object. - */ - public ExpressRouteLinksClient getExpressRouteLinks() { - return this.expressRouteLinks; - } - - /** The InterfaceEndpointsClient object to access its operations. */ - private final InterfaceEndpointsClient interfaceEndpoints; - - /** - * Gets the InterfaceEndpointsClient object to access its operations. - * - * @return the InterfaceEndpointsClient object. - */ - public InterfaceEndpointsClient getInterfaceEndpoints() { - return this.interfaceEndpoints; - } - - /** The LoadBalancersClient object to access its operations. */ - private final LoadBalancersClient loadBalancers; - - /** - * Gets the LoadBalancersClient object to access its operations. - * - * @return the LoadBalancersClient object. - */ - public LoadBalancersClient getLoadBalancers() { - return this.loadBalancers; - } - - /** The LoadBalancerBackendAddressPoolsClient object to access its operations. */ - private final LoadBalancerBackendAddressPoolsClient loadBalancerBackendAddressPools; - - /** - * Gets the LoadBalancerBackendAddressPoolsClient object to access its operations. - * - * @return the LoadBalancerBackendAddressPoolsClient object. - */ - public LoadBalancerBackendAddressPoolsClient getLoadBalancerBackendAddressPools() { - return this.loadBalancerBackendAddressPools; - } - - /** The LoadBalancerFrontendIpConfigurationsClient object to access its operations. */ - private final LoadBalancerFrontendIpConfigurationsClient loadBalancerFrontendIpConfigurations; - - /** - * Gets the LoadBalancerFrontendIpConfigurationsClient object to access its operations. - * - * @return the LoadBalancerFrontendIpConfigurationsClient object. - */ - public LoadBalancerFrontendIpConfigurationsClient getLoadBalancerFrontendIpConfigurations() { - return this.loadBalancerFrontendIpConfigurations; - } - - /** The InboundNatRulesClient object to access its operations. */ - private final InboundNatRulesClient inboundNatRules; - - /** - * Gets the InboundNatRulesClient object to access its operations. - * - * @return the InboundNatRulesClient object. - */ - public InboundNatRulesClient getInboundNatRules() { - return this.inboundNatRules; - } - - /** The LoadBalancerLoadBalancingRulesClient object to access its operations. */ - private final LoadBalancerLoadBalancingRulesClient loadBalancerLoadBalancingRules; - - /** - * Gets the LoadBalancerLoadBalancingRulesClient object to access its operations. - * - * @return the LoadBalancerLoadBalancingRulesClient object. - */ - public LoadBalancerLoadBalancingRulesClient getLoadBalancerLoadBalancingRules() { - return this.loadBalancerLoadBalancingRules; - } - - /** The LoadBalancerOutboundRulesClient object to access its operations. */ - private final LoadBalancerOutboundRulesClient loadBalancerOutboundRules; - - /** - * Gets the LoadBalancerOutboundRulesClient object to access its operations. - * - * @return the LoadBalancerOutboundRulesClient object. - */ - public LoadBalancerOutboundRulesClient getLoadBalancerOutboundRules() { - return this.loadBalancerOutboundRules; - } - - /** The LoadBalancerNetworkInterfacesClient object to access its operations. */ - private final LoadBalancerNetworkInterfacesClient loadBalancerNetworkInterfaces; - - /** - * Gets the LoadBalancerNetworkInterfacesClient object to access its operations. - * - * @return the LoadBalancerNetworkInterfacesClient object. - */ - public LoadBalancerNetworkInterfacesClient getLoadBalancerNetworkInterfaces() { - return this.loadBalancerNetworkInterfaces; - } - - /** The LoadBalancerProbesClient object to access its operations. */ - private final LoadBalancerProbesClient loadBalancerProbes; - - /** - * Gets the LoadBalancerProbesClient object to access its operations. - * - * @return the LoadBalancerProbesClient object. - */ - public LoadBalancerProbesClient getLoadBalancerProbes() { - return this.loadBalancerProbes; - } - - /** The NetworkInterfacesClient object to access its operations. */ - private final NetworkInterfacesClient networkInterfaces; - - /** - * Gets the NetworkInterfacesClient object to access its operations. - * - * @return the NetworkInterfacesClient object. - */ - public NetworkInterfacesClient getNetworkInterfaces() { - return this.networkInterfaces; - } - - /** The NetworkInterfaceIpConfigurationsClient object to access its operations. */ - private final NetworkInterfaceIpConfigurationsClient networkInterfaceIpConfigurations; - - /** - * Gets the NetworkInterfaceIpConfigurationsClient object to access its operations. - * - * @return the NetworkInterfaceIpConfigurationsClient object. - */ - public NetworkInterfaceIpConfigurationsClient getNetworkInterfaceIpConfigurations() { - return this.networkInterfaceIpConfigurations; - } - - /** The NetworkInterfaceLoadBalancersClient object to access its operations. */ - private final NetworkInterfaceLoadBalancersClient networkInterfaceLoadBalancers; - - /** - * Gets the NetworkInterfaceLoadBalancersClient object to access its operations. - * - * @return the NetworkInterfaceLoadBalancersClient object. - */ - public NetworkInterfaceLoadBalancersClient getNetworkInterfaceLoadBalancers() { - return this.networkInterfaceLoadBalancers; - } - - /** The NetworkInterfaceTapConfigurationsClient object to access its operations. */ - private final NetworkInterfaceTapConfigurationsClient networkInterfaceTapConfigurations; - - /** - * Gets the NetworkInterfaceTapConfigurationsClient object to access its operations. - * - * @return the NetworkInterfaceTapConfigurationsClient object. - */ - public NetworkInterfaceTapConfigurationsClient getNetworkInterfaceTapConfigurations() { - return this.networkInterfaceTapConfigurations; - } - - /** The NetworkProfilesClient object to access its operations. */ - private final NetworkProfilesClient networkProfiles; - - /** - * Gets the NetworkProfilesClient object to access its operations. - * - * @return the NetworkProfilesClient object. - */ - public NetworkProfilesClient getNetworkProfiles() { - return this.networkProfiles; - } - - /** The NetworkSecurityGroupsClient object to access its operations. */ - private final NetworkSecurityGroupsClient networkSecurityGroups; - - /** - * Gets the NetworkSecurityGroupsClient object to access its operations. - * - * @return the NetworkSecurityGroupsClient object. - */ - public NetworkSecurityGroupsClient getNetworkSecurityGroups() { - return this.networkSecurityGroups; - } - - /** The SecurityRulesClient object to access its operations. */ - private final SecurityRulesClient securityRules; - - /** - * Gets the SecurityRulesClient object to access its operations. - * - * @return the SecurityRulesClient object. - */ - public SecurityRulesClient getSecurityRules() { - return this.securityRules; - } - - /** The DefaultSecurityRulesClient object to access its operations. */ - private final DefaultSecurityRulesClient defaultSecurityRules; - - /** - * Gets the DefaultSecurityRulesClient object to access its operations. - * - * @return the DefaultSecurityRulesClient object. - */ - public DefaultSecurityRulesClient getDefaultSecurityRules() { - return this.defaultSecurityRules; - } - - /** The NetworkWatchersClient object to access its operations. */ - private final NetworkWatchersClient networkWatchers; - - /** - * Gets the NetworkWatchersClient object to access its operations. - * - * @return the NetworkWatchersClient object. - */ - public NetworkWatchersClient getNetworkWatchers() { - return this.networkWatchers; - } - - /** The PacketCapturesClient object to access its operations. */ - private final PacketCapturesClient packetCaptures; - - /** - * Gets the PacketCapturesClient object to access its operations. - * - * @return the PacketCapturesClient object. - */ - public PacketCapturesClient getPacketCaptures() { - return this.packetCaptures; - } - - /** The ConnectionMonitorsClient object to access its operations. */ - private final ConnectionMonitorsClient connectionMonitors; - - /** - * Gets the ConnectionMonitorsClient object to access its operations. - * - * @return the ConnectionMonitorsClient object. - */ - public ConnectionMonitorsClient getConnectionMonitors() { - return this.connectionMonitors; - } - - /** The OperationsClient object to access its operations. */ - private final OperationsClient operations; - - /** - * Gets the OperationsClient object to access its operations. - * - * @return the OperationsClient object. - */ - public OperationsClient getOperations() { - return this.operations; - } - - /** The PublicIpAddressesClient object to access its operations. */ - private final PublicIpAddressesClient publicIpAddresses; - - /** - * Gets the PublicIpAddressesClient object to access its operations. - * - * @return the PublicIpAddressesClient object. - */ - public PublicIpAddressesClient getPublicIpAddresses() { - return this.publicIpAddresses; - } - - /** The PublicIpPrefixesClient object to access its operations. */ - private final PublicIpPrefixesClient publicIpPrefixes; - - /** - * Gets the PublicIpPrefixesClient object to access its operations. - * - * @return the PublicIpPrefixesClient object. - */ - public PublicIpPrefixesClient getPublicIpPrefixes() { - return this.publicIpPrefixes; - } - - /** The RouteFiltersClient object to access its operations. */ - private final RouteFiltersClient routeFilters; - - /** - * Gets the RouteFiltersClient object to access its operations. - * - * @return the RouteFiltersClient object. - */ - public RouteFiltersClient getRouteFilters() { - return this.routeFilters; - } - - /** The RouteFilterRulesClient object to access its operations. */ - private final RouteFilterRulesClient routeFilterRules; - - /** - * Gets the RouteFilterRulesClient object to access its operations. - * - * @return the RouteFilterRulesClient object. - */ - public RouteFilterRulesClient getRouteFilterRules() { - return this.routeFilterRules; - } - - /** The RouteTablesClient object to access its operations. */ - private final RouteTablesClient routeTables; - - /** - * Gets the RouteTablesClient object to access its operations. - * - * @return the RouteTablesClient object. - */ - public RouteTablesClient getRouteTables() { - return this.routeTables; - } - - /** The RoutesClient object to access its operations. */ - private final RoutesClient routes; - - /** - * Gets the RoutesClient object to access its operations. - * - * @return the RoutesClient object. - */ - public RoutesClient getRoutes() { - return this.routes; - } - - /** The BgpServiceCommunitiesClient object to access its operations. */ - private final BgpServiceCommunitiesClient bgpServiceCommunities; - - /** - * Gets the BgpServiceCommunitiesClient object to access its operations. - * - * @return the BgpServiceCommunitiesClient object. - */ - public BgpServiceCommunitiesClient getBgpServiceCommunities() { - return this.bgpServiceCommunities; - } - - /** The ServiceEndpointPoliciesClient object to access its operations. */ - private final ServiceEndpointPoliciesClient serviceEndpointPolicies; - - /** - * Gets the ServiceEndpointPoliciesClient object to access its operations. - * - * @return the ServiceEndpointPoliciesClient object. - */ - public ServiceEndpointPoliciesClient getServiceEndpointPolicies() { - return this.serviceEndpointPolicies; - } - - /** The ServiceEndpointPolicyDefinitionsClient object to access its operations. */ - private final ServiceEndpointPolicyDefinitionsClient serviceEndpointPolicyDefinitions; - - /** - * Gets the ServiceEndpointPolicyDefinitionsClient object to access its operations. - * - * @return the ServiceEndpointPolicyDefinitionsClient object. - */ - public ServiceEndpointPolicyDefinitionsClient getServiceEndpointPolicyDefinitions() { - return this.serviceEndpointPolicyDefinitions; - } - - /** The UsagesClient object to access its operations. */ - private final UsagesClient usages; - - /** - * Gets the UsagesClient object to access its operations. - * - * @return the UsagesClient object. - */ - public UsagesClient getUsages() { - return this.usages; - } - - /** The VirtualNetworksClient object to access its operations. */ - private final VirtualNetworksClient virtualNetworks; - - /** - * Gets the VirtualNetworksClient object to access its operations. - * - * @return the VirtualNetworksClient object. - */ - public VirtualNetworksClient getVirtualNetworks() { - return this.virtualNetworks; - } - - /** The SubnetsClient object to access its operations. */ - private final SubnetsClient subnets; - - /** - * Gets the SubnetsClient object to access its operations. - * - * @return the SubnetsClient object. - */ - public SubnetsClient getSubnets() { - return this.subnets; - } - - /** The VirtualNetworkPeeringsClient object to access its operations. */ - private final VirtualNetworkPeeringsClient virtualNetworkPeerings; - - /** - * Gets the VirtualNetworkPeeringsClient object to access its operations. - * - * @return the VirtualNetworkPeeringsClient object. - */ - public VirtualNetworkPeeringsClient getVirtualNetworkPeerings() { - return this.virtualNetworkPeerings; - } - - /** The VirtualNetworkGatewaysClient object to access its operations. */ - private final VirtualNetworkGatewaysClient virtualNetworkGateways; - - /** - * Gets the VirtualNetworkGatewaysClient object to access its operations. - * - * @return the VirtualNetworkGatewaysClient object. - */ - public VirtualNetworkGatewaysClient getVirtualNetworkGateways() { - return this.virtualNetworkGateways; - } - - /** The VirtualNetworkGatewayConnectionsClient object to access its operations. */ - private final VirtualNetworkGatewayConnectionsClient virtualNetworkGatewayConnections; - - /** - * Gets the VirtualNetworkGatewayConnectionsClient object to access its operations. - * - * @return the VirtualNetworkGatewayConnectionsClient object. - */ - public VirtualNetworkGatewayConnectionsClient getVirtualNetworkGatewayConnections() { - return this.virtualNetworkGatewayConnections; - } - - /** The LocalNetworkGatewaysClient object to access its operations. */ - private final LocalNetworkGatewaysClient localNetworkGateways; - - /** - * Gets the LocalNetworkGatewaysClient object to access its operations. - * - * @return the LocalNetworkGatewaysClient object. - */ - public LocalNetworkGatewaysClient getLocalNetworkGateways() { - return this.localNetworkGateways; - } - - /** The VirtualNetworkTapsClient object to access its operations. */ - private final VirtualNetworkTapsClient virtualNetworkTaps; - - /** - * Gets the VirtualNetworkTapsClient object to access its operations. - * - * @return the VirtualNetworkTapsClient object. - */ - public VirtualNetworkTapsClient getVirtualNetworkTaps() { - return this.virtualNetworkTaps; - } - - /** The VirtualWansClient object to access its operations. */ - private final VirtualWansClient virtualWans; - - /** - * Gets the VirtualWansClient object to access its operations. - * - * @return the VirtualWansClient object. - */ - public VirtualWansClient getVirtualWans() { - return this.virtualWans; - } - - /** The VpnSitesClient object to access its operations. */ - private final VpnSitesClient vpnSites; - - /** - * Gets the VpnSitesClient object to access its operations. - * - * @return the VpnSitesClient object. - */ - public VpnSitesClient getVpnSites() { - return this.vpnSites; - } - - /** The VpnSitesConfigurationsClient object to access its operations. */ - private final VpnSitesConfigurationsClient vpnSitesConfigurations; - - /** - * Gets the VpnSitesConfigurationsClient object to access its operations. - * - * @return the VpnSitesConfigurationsClient object. - */ - public VpnSitesConfigurationsClient getVpnSitesConfigurations() { - return this.vpnSitesConfigurations; - } - - /** The VirtualHubsClient object to access its operations. */ - private final VirtualHubsClient virtualHubs; - - /** - * Gets the VirtualHubsClient object to access its operations. - * - * @return the VirtualHubsClient object. - */ - public VirtualHubsClient getVirtualHubs() { - return this.virtualHubs; - } - - /** The HubVirtualNetworkConnectionsClient object to access its operations. */ - private final HubVirtualNetworkConnectionsClient hubVirtualNetworkConnections; - - /** - * Gets the HubVirtualNetworkConnectionsClient object to access its operations. - * - * @return the HubVirtualNetworkConnectionsClient object. - */ - public HubVirtualNetworkConnectionsClient getHubVirtualNetworkConnections() { - return this.hubVirtualNetworkConnections; - } - - /** The VpnGatewaysClient object to access its operations. */ - private final VpnGatewaysClient vpnGateways; - - /** - * Gets the VpnGatewaysClient object to access its operations. - * - * @return the VpnGatewaysClient object. - */ - public VpnGatewaysClient getVpnGateways() { - return this.vpnGateways; - } - - /** The VpnConnectionsClient object to access its operations. */ - private final VpnConnectionsClient vpnConnections; - - /** - * Gets the VpnConnectionsClient object to access its operations. - * - * @return the VpnConnectionsClient object. - */ - public VpnConnectionsClient getVpnConnections() { - return this.vpnConnections; - } - - /** The P2SVpnServerConfigurationsClient object to access its operations. */ - private final P2SVpnServerConfigurationsClient p2SVpnServerConfigurations; - - /** - * Gets the P2SVpnServerConfigurationsClient object to access its operations. - * - * @return the P2SVpnServerConfigurationsClient object. - */ - public P2SVpnServerConfigurationsClient getP2SVpnServerConfigurations() { - return this.p2SVpnServerConfigurations; - } - - /** The P2SVpnGatewaysClient object to access its operations. */ - private final P2SVpnGatewaysClient p2SVpnGateways; - - /** - * Gets the P2SVpnGatewaysClient object to access its operations. - * - * @return the P2SVpnGatewaysClient object. - */ - public P2SVpnGatewaysClient getP2SVpnGateways() { - return this.p2SVpnGateways; - } - - /** - * Initializes an instance of NetworkManagementClient client. - * - * @param httpPipeline The HTTP pipeline to send requests through. - * @param serializerAdapter The serializer to serialize an object into a string. - * @param defaultPollInterval The default poll interval for long-running operation. - * @param environment The Azure environment. - * @param subscriptionId The subscription credentials which uniquely identify the Microsoft Azure subscription. The - * subscription ID forms part of the URI for every service call. - * @param endpoint server parameter. - */ - NetworkManagementClientImpl( - HttpPipeline httpPipeline, - SerializerAdapter serializerAdapter, - Duration defaultPollInterval, - AzureEnvironment environment, - String subscriptionId, - String endpoint) { - super(httpPipeline, serializerAdapter, environment); - this.httpPipeline = httpPipeline; - this.serializerAdapter = serializerAdapter; - this.defaultPollInterval = defaultPollInterval; - this.subscriptionId = subscriptionId; - this.endpoint = endpoint; - this.applicationGateways = new ApplicationGatewaysClientImpl(this); - this.applicationSecurityGroups = new ApplicationSecurityGroupsClientImpl(this); - this.availableDelegations = new AvailableDelegationsClientImpl(this); - this.availableResourceGroupDelegations = new AvailableResourceGroupDelegationsClientImpl(this); - this.azureFirewalls = new AzureFirewallsClientImpl(this); - this.azureFirewallFqdnTags = new AzureFirewallFqdnTagsClientImpl(this); - this.ddosCustomPolicies = new DdosCustomPoliciesClientImpl(this); - this.ddosProtectionPlans = new DdosProtectionPlansClientImpl(this); - this.availableEndpointServices = new AvailableEndpointServicesClientImpl(this); - this.expressRouteCircuitAuthorizations = new ExpressRouteCircuitAuthorizationsClientImpl(this); - this.expressRouteCircuitPeerings = new ExpressRouteCircuitPeeringsClientImpl(this); - this.expressRouteCircuitConnections = new ExpressRouteCircuitConnectionsClientImpl(this); - this.expressRouteCircuits = new ExpressRouteCircuitsClientImpl(this); - this.expressRouteServiceProviders = new ExpressRouteServiceProvidersClientImpl(this); - this.expressRouteCrossConnections = new ExpressRouteCrossConnectionsClientImpl(this); - this.expressRouteCrossConnectionPeerings = new ExpressRouteCrossConnectionPeeringsClientImpl(this); - this.expressRouteGateways = new ExpressRouteGatewaysClientImpl(this); - this.expressRouteConnections = new ExpressRouteConnectionsClientImpl(this); - this.expressRoutePortsLocations = new ExpressRoutePortsLocationsClientImpl(this); - this.expressRoutePorts = new ExpressRoutePortsClientImpl(this); - this.expressRouteLinks = new ExpressRouteLinksClientImpl(this); - this.interfaceEndpoints = new InterfaceEndpointsClientImpl(this); - this.loadBalancers = new LoadBalancersClientImpl(this); - this.loadBalancerBackendAddressPools = new LoadBalancerBackendAddressPoolsClientImpl(this); - this.loadBalancerFrontendIpConfigurations = new LoadBalancerFrontendIpConfigurationsClientImpl(this); - this.inboundNatRules = new InboundNatRulesClientImpl(this); - this.loadBalancerLoadBalancingRules = new LoadBalancerLoadBalancingRulesClientImpl(this); - this.loadBalancerOutboundRules = new LoadBalancerOutboundRulesClientImpl(this); - this.loadBalancerNetworkInterfaces = new LoadBalancerNetworkInterfacesClientImpl(this); - this.loadBalancerProbes = new LoadBalancerProbesClientImpl(this); - this.networkInterfaces = new NetworkInterfacesClientImpl(this); - this.networkInterfaceIpConfigurations = new NetworkInterfaceIpConfigurationsClientImpl(this); - this.networkInterfaceLoadBalancers = new NetworkInterfaceLoadBalancersClientImpl(this); - this.networkInterfaceTapConfigurations = new NetworkInterfaceTapConfigurationsClientImpl(this); - this.networkProfiles = new NetworkProfilesClientImpl(this); - this.networkSecurityGroups = new NetworkSecurityGroupsClientImpl(this); - this.securityRules = new SecurityRulesClientImpl(this); - this.defaultSecurityRules = new DefaultSecurityRulesClientImpl(this); - this.networkWatchers = new NetworkWatchersClientImpl(this); - this.packetCaptures = new PacketCapturesClientImpl(this); - this.connectionMonitors = new ConnectionMonitorsClientImpl(this); - this.operations = new OperationsClientImpl(this); - this.publicIpAddresses = new PublicIpAddressesClientImpl(this); - this.publicIpPrefixes = new PublicIpPrefixesClientImpl(this); - this.routeFilters = new RouteFiltersClientImpl(this); - this.routeFilterRules = new RouteFilterRulesClientImpl(this); - this.routeTables = new RouteTablesClientImpl(this); - this.routes = new RoutesClientImpl(this); - this.bgpServiceCommunities = new BgpServiceCommunitiesClientImpl(this); - this.serviceEndpointPolicies = new ServiceEndpointPoliciesClientImpl(this); - this.serviceEndpointPolicyDefinitions = new ServiceEndpointPolicyDefinitionsClientImpl(this); - this.usages = new UsagesClientImpl(this); - this.virtualNetworks = new VirtualNetworksClientImpl(this); - this.subnets = new SubnetsClientImpl(this); - this.virtualNetworkPeerings = new VirtualNetworkPeeringsClientImpl(this); - this.virtualNetworkGateways = new VirtualNetworkGatewaysClientImpl(this); - this.virtualNetworkGatewayConnections = new VirtualNetworkGatewayConnectionsClientImpl(this); - this.localNetworkGateways = new LocalNetworkGatewaysClientImpl(this); - this.virtualNetworkTaps = new VirtualNetworkTapsClientImpl(this); - this.virtualWans = new VirtualWansClientImpl(this); - this.vpnSites = new VpnSitesClientImpl(this); - this.vpnSitesConfigurations = new VpnSitesConfigurationsClientImpl(this); - this.virtualHubs = new VirtualHubsClientImpl(this); - this.hubVirtualNetworkConnections = new HubVirtualNetworkConnectionsClientImpl(this); - this.vpnGateways = new VpnGatewaysClientImpl(this); - this.vpnConnections = new VpnConnectionsClientImpl(this); - this.p2SVpnServerConfigurations = new P2SVpnServerConfigurationsClientImpl(this); - this.p2SVpnGateways = new P2SVpnGatewaysClientImpl(this); - this.service = - RestProxy.create(NetworkManagementClientService.class, this.httpPipeline, this.getSerializerAdapter()); - } - - /** - * The interface defining all the services for NetworkManagementClient to be used by the proxy service to perform - * REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "NetworkManagementCli") - private interface NetworkManagementClientService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/CheckDnsNameAvailability") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> checkDnsNameAvailability( - @HostParam("$host") String endpoint, - @PathParam("location") String location, - @QueryParam("domainNameLabel") String domainNameLabel, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans" - + "/{virtualWANName}/supportedSecurityProviders") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ErrorException.class) - Mono> supportedSecurityProviders( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualWANName") String virtualWanName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Checks whether a domain name in the cloudapp.azure.com zone is available for use. - * - * @param location The location of the domain name. - * @param domainNameLabel The domain name to be verified. It must conform to the following regular expression: - * ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the CheckDnsNameAvailability API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> checkDnsNameAvailabilityWithResponseAsync( - String location, String domainNameLabel) { - if (this.getEndpoint() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.getEndpoint() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (domainNameLabel == null) { - return Mono - .error(new IllegalArgumentException("Parameter domainNameLabel is required and cannot be null.")); - } - if (this.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException("Parameter this.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .checkDnsNameAvailability( - this.getEndpoint(), - location, - domainNameLabel, - apiVersion, - this.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.getContext()).readOnly())); - } - - /** - * Checks whether a domain name in the cloudapp.azure.com zone is available for use. - * - * @param location The location of the domain name. - * @param domainNameLabel The domain name to be verified. It must conform to the following regular expression: - * ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the CheckDnsNameAvailability API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> checkDnsNameAvailabilityWithResponseAsync( - String location, String domainNameLabel, Context context) { - if (this.getEndpoint() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.getEndpoint() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (domainNameLabel == null) { - return Mono - .error(new IllegalArgumentException("Parameter domainNameLabel is required and cannot be null.")); - } - if (this.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException("Parameter this.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.mergeContext(context); - return service - .checkDnsNameAvailability( - this.getEndpoint(), location, domainNameLabel, apiVersion, this.getSubscriptionId(), accept, context); - } - - /** - * Checks whether a domain name in the cloudapp.azure.com zone is available for use. - * - * @param location The location of the domain name. - * @param domainNameLabel The domain name to be verified. It must conform to the following regular expression: - * ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the CheckDnsNameAvailability API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono checkDnsNameAvailabilityAsync(String location, String domainNameLabel) { - return checkDnsNameAvailabilityWithResponseAsync(location, domainNameLabel) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Checks whether a domain name in the cloudapp.azure.com zone is available for use. - * - * @param location The location of the domain name. - * @param domainNameLabel The domain name to be verified. It must conform to the following regular expression: - * ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the CheckDnsNameAvailability API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DnsNameAvailabilityResultInner checkDnsNameAvailability(String location, String domainNameLabel) { - return checkDnsNameAvailabilityAsync(location, domainNameLabel).block(); - } - - /** - * Checks whether a domain name in the cloudapp.azure.com zone is available for use. - * - * @param location The location of the domain name. - * @param domainNameLabel The domain name to be verified. It must conform to the following regular expression: - * ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the CheckDnsNameAvailability API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response checkDnsNameAvailabilityWithResponse( - String location, String domainNameLabel, Context context) { - return checkDnsNameAvailabilityWithResponseAsync(location, domainNameLabel, context).block(); - } - - /** - * Gives the supported security providers for the virtual wan. - * - * @param resourceGroupName The resource group name. - * @param virtualWanName The name of the VirtualWAN for which supported security providers are needed. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of SecurityProviders. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> supportedSecurityProvidersWithResponseAsync( - String resourceGroupName, String virtualWanName) { - if (this.getEndpoint() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.getEndpoint() is required and cannot be null.")); - } - if (this.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException("Parameter this.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualWanName == null) { - return Mono.error(new IllegalArgumentException("Parameter virtualWanName is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .supportedSecurityProviders( - this.getEndpoint(), - this.getSubscriptionId(), - resourceGroupName, - virtualWanName, - apiVersion, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.getContext()).readOnly())); - } - - /** - * Gives the supported security providers for the virtual wan. - * - * @param resourceGroupName The resource group name. - * @param virtualWanName The name of the VirtualWAN for which supported security providers are needed. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of SecurityProviders. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> supportedSecurityProvidersWithResponseAsync( - String resourceGroupName, String virtualWanName, Context context) { - if (this.getEndpoint() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.getEndpoint() is required and cannot be null.")); - } - if (this.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException("Parameter this.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualWanName == null) { - return Mono.error(new IllegalArgumentException("Parameter virtualWanName is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.mergeContext(context); - return service - .supportedSecurityProviders( - this.getEndpoint(), - this.getSubscriptionId(), - resourceGroupName, - virtualWanName, - apiVersion, - accept, - context); - } - - /** - * Gives the supported security providers for the virtual wan. - * - * @param resourceGroupName The resource group name. - * @param virtualWanName The name of the VirtualWAN for which supported security providers are needed. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of SecurityProviders. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono supportedSecurityProvidersAsync( - String resourceGroupName, String virtualWanName) { - return supportedSecurityProvidersWithResponseAsync(resourceGroupName, virtualWanName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gives the supported security providers for the virtual wan. - * - * @param resourceGroupName The resource group name. - * @param virtualWanName The name of the VirtualWAN for which supported security providers are needed. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of SecurityProviders. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualWanSecurityProvidersInner supportedSecurityProviders( - String resourceGroupName, String virtualWanName) { - return supportedSecurityProvidersAsync(resourceGroupName, virtualWanName).block(); - } - - /** - * Gives the supported security providers for the virtual wan. - * - * @param resourceGroupName The resource group name. - * @param virtualWanName The name of the VirtualWAN for which supported security providers are needed. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of SecurityProviders. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response supportedSecurityProvidersWithResponse( - String resourceGroupName, String virtualWanName, Context context) { - return supportedSecurityProvidersWithResponseAsync(resourceGroupName, virtualWanName, context).block(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NetworkPeeringImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NetworkPeeringImpl.java deleted file mode 100644 index 3a775b5d1111..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NetworkPeeringImpl.java +++ /dev/null @@ -1,510 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.management.SubResource; -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.network.fluent.models.VirtualNetworkPeeringInner; -import com.azure.resourcemanager.network.models.Network; -import com.azure.resourcemanager.network.models.NetworkPeering; -import com.azure.resourcemanager.network.models.NetworkPeering.DefinitionStages.WithCreate; -import com.azure.resourcemanager.network.models.NetworkPeeringGatewayUse; -import com.azure.resourcemanager.network.models.VirtualNetworkPeeringState; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils; -import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.IndependentChildImpl; -import com.azure.resourcemanager.resources.fluentcore.model.Indexable; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import reactor.core.publisher.Mono; - -import java.util.Collections; -import java.util.List; - -/** Implementation for network peering. */ -class NetworkPeeringImpl - extends IndependentChildImpl< - NetworkPeering, Network, VirtualNetworkPeeringInner, NetworkPeeringImpl, NetworkManager> - implements NetworkPeering, NetworkPeering.Definition, NetworkPeering.Update { - - private NetworkImpl parent; - private Network remoteNetwork; - private Boolean remoteAccess; // Controls the allowAccess setting on the remote peering (null means no change) - private Boolean - remoteForwarding; // Controls the trafficForwarding setting on the remote peering (null means no change) - private Boolean - startGatewayUseByRemoteNetwork; // Controls the UseGateway setting on the remote network (null means no change) - private Boolean - allowGatewayUseOnRemoteNetwork; // Controls the AllowGatewayTransit setting on the remote network (null means no - // change) - - NetworkPeeringImpl(VirtualNetworkPeeringInner inner, NetworkImpl parent) { - super(inner.name(), inner, parent.manager()); - this.parent = parent; - this.remoteAccess = null; - this.remoteForwarding = null; - } - - // Getters - - @Override - public boolean isSameSubscription() { - if (this.remoteNetworkId() == null) { - return false; - } - String localSubscriptionId = ResourceUtils.subscriptionFromResourceId(this.id()); - String remoteSubscriptionId = ResourceUtils.subscriptionFromResourceId(this.remoteNetworkId()); - return localSubscriptionId.equalsIgnoreCase(remoteSubscriptionId); - } - - @Override - public VirtualNetworkPeeringState state() { - return this.innerModel().peeringState(); - } - - @Override - public String name() { - return this.innerModel().name(); - } - - @Override - public String id() { - return this.innerModel().id(); - } - - @Override - public String networkId() { - return this.parent.id(); - } - - @Override - public List remoteAddressSpaces() { - if (innerModel().remoteAddressSpace() == null || innerModel().remoteAddressSpace().addressPrefixes() == null) { - return null; - } - return Collections.unmodifiableList(innerModel().remoteAddressSpace().addressPrefixes()); - } - - @Override - public String remoteNetworkId() { - return (this.innerModel().remoteVirtualNetwork() != null) - ? this.innerModel().remoteVirtualNetwork().id() - : null; - } - - @Override - public boolean isTrafficForwardingFromRemoteNetworkAllowed() { - return ResourceManagerUtils.toPrimitiveBoolean(this.innerModel().allowForwardedTraffic()); - } - - private boolean isAccessFromRemoteNetworkAllowed() { - return ResourceManagerUtils.toPrimitiveBoolean(this.innerModel().allowVirtualNetworkAccess()); - } - - // Fluent setters - - private NetworkPeeringImpl withoutAccessFromRemoteNetwork() { - this.innerModel().withAllowVirtualNetworkAccess(false); - return this; - } - - private NetworkPeeringImpl withAccessFromRemoteNetwork() { - this.innerModel().withAllowVirtualNetworkAccess(true); - return this; - } - - @Override - public NetworkPeeringImpl withAccessBetweenBothNetworks() { - return this.withAccessFromRemoteNetwork().withAccessToRemoteNetwork(); - } - - @Override - public NetworkPeeringImpl withoutAccessFromEitherNetwork() { - return this.withoutAccessFromRemoteNetwork().withoutAccessToRemoteNetwork(); - } - - @Override - public NetworkPeeringImpl withRemoteNetwork(String resourceId) { - SubResource networkRef = new SubResource().withId(resourceId); - this.innerModel().withRemoteVirtualNetwork(networkRef); - return this; - } - - @Override - public NetworkPeeringImpl withRemoteNetwork(Network network) { - if (network != null) { - this.remoteNetwork = network; - return this.withRemoteNetwork(network.id()); - } - return this; - } - - @Override - public NetworkPeeringImpl withTrafficForwardingFromRemoteNetwork() { - this.innerModel().withAllowForwardedTraffic(true); - return this; - } - - @Override - public NetworkPeeringImpl withoutTrafficForwardingFromRemoteNetwork() { - this.innerModel().withAllowForwardedTraffic(false); - return this; - } - - @Override - public NetworkPeeringImpl withoutTrafficForwardingFromEitherNetwork() { - return this.withoutTrafficForwardingFromRemoteNetwork().withoutTrafficForwardingToRemoteNetwork(); - } - - @Override - public NetworkPeeringImpl withTrafficForwardingToRemoteNetwork() { - this.remoteForwarding = true; - return this; - } - - @Override - public NetworkPeeringImpl withoutTrafficForwardingToRemoteNetwork() { - this.remoteForwarding = false; - return this; - } - - @Override - public NetworkPeeringImpl withTrafficForwardingBetweenBothNetworks() { - return this.withTrafficForwardingFromRemoteNetwork().withTrafficForwardingToRemoteNetwork(); - } - - private NetworkPeeringImpl withoutAccessToRemoteNetwork() { - this.remoteAccess = false; - return this; - } - - private NetworkPeeringImpl withAccessToRemoteNetwork() { - this.remoteAccess = true; - return this; - } - - @Override - public NetworkPeeringImpl withGatewayUseByRemoteNetworkAllowed() { - this.innerModel().withAllowGatewayTransit(true).withUseRemoteGateways(false); - this.startGatewayUseByRemoteNetwork = null; - this.allowGatewayUseOnRemoteNetwork = false; - return this; - } - - @Override - public NetworkPeeringImpl withGatewayUseByRemoteNetworkStarted() { - this.startGatewayUseByRemoteNetwork = true; - this.allowGatewayUseOnRemoteNetwork = false; - return this.withGatewayUseByRemoteNetworkAllowed(); - } - - @Override - public NetworkPeeringImpl withGatewayUseOnRemoteNetworkStarted() { - this.innerModel().withAllowGatewayTransit(false).withUseRemoteGateways(true); - this.startGatewayUseByRemoteNetwork = false; - this.allowGatewayUseOnRemoteNetwork = true; - return this; - } - - @Override - public NetworkPeeringImpl withoutAnyGatewayUse() { - this.innerModel().withAllowGatewayTransit(false); - return this.withoutGatewayUseOnRemoteNetwork().withoutGatewayUseByRemoteNetwork(); - } - - @Override - public NetworkPeeringImpl withoutGatewayUseByRemoteNetwork() { - this.startGatewayUseByRemoteNetwork = false; - this.allowGatewayUseOnRemoteNetwork = false; - return this; - } - - @Override - public NetworkPeeringImpl withoutGatewayUseOnRemoteNetwork() { - this.innerModel().withUseRemoteGateways(false); - return this; - } - - // Actions - - @Override - public boolean checkAccessBetweenNetworks() { - if (!ResourceManagerUtils.toPrimitiveBoolean(this.innerModel().allowVirtualNetworkAccess())) { - // If network access is disabled on this peering, then it's disabled for both networks, regardless of what - // the remote peering says - return false; - } - - // Check the access setting on the remote peering - NetworkPeering remotePeering = this.getRemotePeering(); - if (remotePeering == null) { - return false; - } else { - // Access is enabled on local peering, so up to the remote peering to determine whether it's enabled or - // disabled overall - return ResourceManagerUtils.toPrimitiveBoolean(remotePeering.innerModel().allowVirtualNetworkAccess()); - } - } - - @Override - protected Mono createChildResourceAsync() { - final NetworkPeeringImpl localPeering = this; - final String networkName = ResourceUtils.nameFromResourceId(this.networkId()); - return this - .manager() - .serviceClient() - .getVirtualNetworkPeerings() - .createOrUpdateAsync(this.parent.resourceGroupName(), networkName, this.name(), this.innerModel()) - // After successful creation, update the inner - .doOnNext( - inner -> { - setInner(inner); - }) - - // Then get the remote network to update it if needed and in the same subscription - .flatMap( - inner -> { - SubResource networkRef = inner.remoteVirtualNetwork(); - if (localPeering.isSameSubscription()) { - // Update the remote network only if it is in the same subscription - return localPeering.manager().networks().getByIdAsync(networkRef.id()); - } else { - // Otherwise, skip this - return Mono.empty(); - } - }) - - // Then update the existing remote network if needed, flatMap will skip when input is empty - .flatMap( - remoteNetwork -> { - // Check if any peering is already pointing at this network - return remoteNetwork - .peerings() - .listAsync() - .filter( - remotePeering -> - (remotePeering != null - && remotePeering.remoteNetworkId() != null - && remotePeering.remoteNetworkId().equalsIgnoreCase(localPeering.parent.id()))) - .collectList() - .flatMap( - remotePeerings -> { - if (remotePeerings.isEmpty()) { - return Mono.empty(); - } else { - return Mono.justOrEmpty(remotePeerings.get(remotePeerings.size() - 1)); - } - }) - - // Depending on the existence of a matching remote peering, create one or update existing - .flatMap( - remotePeering -> { - // Matching peering exists, so update as needed - Update remotePeeringUpdate = remotePeering.update(); - boolean isUpdateNeeded = false; - - // Update traffic forwarding on the remote peering if needed - if (localPeering.remoteForwarding != null) { - if (localPeering.remoteForwarding.booleanValue() - && !remotePeering.isTrafficForwardingFromRemoteNetworkAllowed()) { - isUpdateNeeded = true; - remotePeeringUpdate = - remotePeeringUpdate.withTrafficForwardingFromRemoteNetwork(); - } else if (!localPeering.remoteForwarding.booleanValue() - && remotePeering.isTrafficForwardingFromRemoteNetworkAllowed()) { - isUpdateNeeded = true; - remotePeeringUpdate = - remotePeeringUpdate.withoutTrafficForwardingFromRemoteNetwork(); - } - } - - // Update network access on the remote peering if needed - if (localPeering.remoteAccess != null) { - if (localPeering.remoteAccess.booleanValue() - && !((NetworkPeeringImpl) remotePeering).isAccessFromRemoteNetworkAllowed()) { - isUpdateNeeded = true; - remotePeeringUpdate = - ((NetworkPeeringImpl) remotePeeringUpdate).withAccessFromRemoteNetwork(); - } else if (!localPeering.remoteAccess.booleanValue() - && ((NetworkPeeringImpl) remotePeering).isAccessFromRemoteNetworkAllowed()) { - isUpdateNeeded = true; - remotePeeringUpdate = - ((NetworkPeeringImpl) remotePeeringUpdate).withoutAccessFromRemoteNetwork(); - } - } - - // Update gateway use permission on the remote peering if needed - if (localPeering.allowGatewayUseOnRemoteNetwork != null) { - if (localPeering.allowGatewayUseOnRemoteNetwork.booleanValue() - && remotePeering.gatewayUse() != NetworkPeeringGatewayUse.BY_REMOTE_NETWORK) { - // Allow gateway use on remote network - isUpdateNeeded = true; - remotePeeringUpdate.withGatewayUseByRemoteNetworkAllowed(); - } else if (!localPeering.allowGatewayUseOnRemoteNetwork.booleanValue() - && remotePeering.gatewayUse() == NetworkPeeringGatewayUse.BY_REMOTE_NETWORK) { - // Disallow gateway use on remote network - isUpdateNeeded = true; - remotePeeringUpdate.withoutGatewayUseByRemoteNetwork(); - } - } - - // Update gateway use start on the remote peering if needed - if (localPeering.startGatewayUseByRemoteNetwork != null) { - if (localPeering.startGatewayUseByRemoteNetwork.booleanValue() - && remotePeering.gatewayUse() != NetworkPeeringGatewayUse.ON_REMOTE_NETWORK) { - remotePeeringUpdate.withGatewayUseOnRemoteNetworkStarted(); - isUpdateNeeded = true; - } else if (!localPeering.startGatewayUseByRemoteNetwork.booleanValue() - && remotePeering.gatewayUse() == NetworkPeeringGatewayUse.ON_REMOTE_NETWORK) { - remotePeeringUpdate.withoutGatewayUseOnRemoteNetwork(); - isUpdateNeeded = true; - } - } - - if (isUpdateNeeded) { - localPeering.remoteForwarding = null; - localPeering.remoteAccess = null; - localPeering.startGatewayUseByRemoteNetwork = null; - localPeering.allowGatewayUseOnRemoteNetwork = null; - return remotePeeringUpdate.applyAsync(); - } else { - return Mono.just((Indexable) localPeering); - } - }) - .switchIfEmpty( - Mono - .defer( - () -> { - // No matching remote peering, so create one on the remote network - String peeringName = this.manager().resourceManager().internalContext() - .randomResourceName("peer", 15); - - WithCreate remotePeeringDefinition = - remoteNetwork - .peerings() - .define(peeringName) - .withRemoteNetwork(localPeering.parent.id()); - - // Process remote network's UseRemoteGateways setting - if (localPeering.startGatewayUseByRemoteNetwork != null) { - if (localPeering.startGatewayUseByRemoteNetwork.booleanValue()) { - // Start gateway use on this network by the remote network - remotePeeringDefinition.withGatewayUseOnRemoteNetworkStarted(); - } - } - - // Process remote network's AllowGatewayTransit setting - if (localPeering.allowGatewayUseOnRemoteNetwork != null) { - if (localPeering.allowGatewayUseOnRemoteNetwork.booleanValue()) { - // Allow gateway use on remote network - remotePeeringDefinition.withGatewayUseByRemoteNetworkAllowed(); - } - } - - if (localPeering.remoteAccess != null && !localPeering.remoteAccess) { - ((NetworkPeeringImpl) remotePeeringDefinition) - .withoutAccessFromRemoteNetwork(); // Assumes by default access is on - // for new peerings - } - - if (localPeering.remoteForwarding != null - && localPeering.remoteForwarding.booleanValue()) { - remotePeeringDefinition - .withTrafficForwardingFromRemoteNetwork(); // Assumes by default - // forwarding is off for new - // peerings - } - - localPeering.remoteAccess = null; - localPeering.remoteForwarding = null; - localPeering.startGatewayUseByRemoteNetwork = null; - localPeering.allowGatewayUseOnRemoteNetwork = null; - return remotePeeringDefinition.createAsync(); - })); - }) - - // Then refresh the parent local network, if available - .flatMap(remotePeering -> (localPeering.parent != null) ? localPeering.parent.refreshAsync() : Mono.empty()) - - // Then refresh the remote network, if available and in the same subscription - .flatMap( - t -> { - if (localPeering.remoteNetwork != null && localPeering.isSameSubscription()) { - return localPeering.remoteNetwork.refreshAsync(); - } else { - return Mono.empty(); - } - }) - - // Then return the created local peering - .then(Mono.just(localPeering)); - } - - @Override - protected Mono getInnerAsync() { - this.remoteNetwork = null; - return this - .manager() - .serviceClient() - .getVirtualNetworkPeerings() - .getAsync( - this.resourceGroupName(), ResourceUtils.nameFromResourceId(this.networkId()), this.innerModel().name()); - } - - @Override - public Network getRemoteNetwork() { - return this.getRemoteNetworkAsync().block(); - } - - @Override - public Mono getRemoteNetworkAsync() { - final NetworkPeeringImpl self = this; - if (self.remoteNetwork != null) { - return Mono.just(self.remoteNetwork); - } else if (this.isSameSubscription()) { - // Fetch the remote network if within the same subscription - return this - .manager() - .networks() - .getByIdAsync(this.remoteNetworkId()) - .doOnNext( - network -> { - self.remoteNetwork = network; - }); - } else { - // Otherwise bail out - self.remoteNetwork = null; - return Mono.empty(); - } - } - - @Override - public NetworkPeering getRemotePeering() { - Network network = this.getRemoteNetwork(); - return (network != null) ? network.peerings().getByRemoteNetwork(this.networkId()) : null; - } - - @Override - public Mono getRemotePeeringAsync() { - final NetworkPeeringImpl self = this; - return this - .getRemoteNetworkAsync() - .flatMap( - remoteNetwork -> { - if (remoteNetwork == null) { - return Mono.empty(); - } else { - return remoteNetwork.peerings().getByRemoteNetworkAsync(self.networkId()); - } - }); - } - - @Override - public NetworkPeeringGatewayUse gatewayUse() { - if (ResourceManagerUtils.toPrimitiveBoolean(this.innerModel().allowGatewayTransit())) { - return NetworkPeeringGatewayUse.BY_REMOTE_NETWORK; - } else if (ResourceManagerUtils.toPrimitiveBoolean(this.innerModel().useRemoteGateways())) { - return NetworkPeeringGatewayUse.ON_REMOTE_NETWORK; - } else { - return NetworkPeeringGatewayUse.NONE; - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NetworkPeeringsImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NetworkPeeringsImpl.java deleted file mode 100644 index ed024305999a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NetworkPeeringsImpl.java +++ /dev/null @@ -1,170 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.network.fluent.VirtualNetworkPeeringsClient; -import com.azure.resourcemanager.network.models.Network; -import com.azure.resourcemanager.network.models.NetworkPeering; -import com.azure.resourcemanager.network.models.NetworkPeerings; -import com.azure.resourcemanager.network.fluent.models.VirtualNetworkPeeringInner; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.IndependentChildrenImpl; -import reactor.core.publisher.Mono; - -/** Implementation for network peerings. */ -class NetworkPeeringsImpl - extends IndependentChildrenImpl< - NetworkPeering, - NetworkPeeringImpl, - VirtualNetworkPeeringInner, - VirtualNetworkPeeringsClient, - NetworkManager, - Network> - implements NetworkPeerings { - - private final NetworkImpl network; - - // Constructor to use from the context of a parent - NetworkPeeringsImpl(final NetworkImpl parent) { - super(parent.manager().serviceClient().getVirtualNetworkPeerings(), parent.manager()); - this.network = parent; - } - - @Override - public NetworkPeeringImpl define(String name) { - return wrapModel(name); - } - - // Fluent model create helpers - - @Override - protected NetworkPeeringImpl wrapModel(String name) { - VirtualNetworkPeeringInner inner = new VirtualNetworkPeeringInner().withName(name); - return new NetworkPeeringImpl(inner, this.network); - } - - @Override - protected NetworkPeeringImpl wrapModel(VirtualNetworkPeeringInner inner) { - return (inner != null) ? new NetworkPeeringImpl(inner, this.network) : null; - } - - @Override - public Mono deleteByParentAsync(String groupName, String parentName, final String name) { - return this - .manager() - .networks() - // Get the parent network of the peering to delete - .getByResourceGroupAsync(groupName, parentName) - - // Then find the local peering to delete - .flatMap( - localNetwork -> { - if (localNetwork == null) { - return Mono.empty(); // Missing local network, so nothing else to do - } else { - String peeringId = localNetwork.id() + "/peerings/" + name; - return localNetwork.peerings().getByIdAsync(peeringId); - } - }) - .flux() - - // Then get the remote peering if available and possible to delete - .flatMap( - localPeering -> { - if (localPeering == null) { - return Mono.empty(); - } else if (!localPeering.isSameSubscription()) { - return Mono.just(localPeering); - } else { - return Mono.just(localPeering).concatWith(localPeering.getRemotePeeringAsync()); - } - }) - - // Then delete each peering (this will be called for each of the peerings, so at least once for the local - // peering, and second time for the remote one if any - .flatMap( - peering -> { - if (peering == null) { - return Mono.empty(); - } else { - String networkName = ResourceUtils.nameFromResourceId(peering.networkId()); - return peering - .manager() - .serviceClient() - .getVirtualNetworkPeerings() - .deleteAsync(peering.resourceGroupName(), networkName, peering.name()); - } - }) - - // Then continue till the last peering is deleted - .then(); - } - - @Override - public Mono getByParentAsync(String resourceGroup, String parentName, String name) { - return this.innerModel().getAsync(resourceGroup, parentName, name).map(inner -> wrapModel(inner)); - } - - @Override - public PagedIterable listByParent(String resourceGroupName, String parentName) { - return wrapList(this.innerModel().list(resourceGroupName, parentName)); - } - - @Override - public PagedIterable list() { - return this.wrapList(this.innerModel().list(this.network.resourceGroupName(), this.network.name())); - } - - @Override - public PagedFlux listAsync() { - return this.wrapPageAsync(this.innerModel().listAsync(this.network.resourceGroupName(), this.network.name())); - } - - @Override - public NetworkPeering getByRemoteNetwork(Network network) { - return (network != null) ? this.getByRemoteNetwork(network.id()) : null; - } - - @Override - public NetworkPeering getByRemoteNetwork(String remoteNetworkResourceId) { - if (remoteNetworkResourceId != null) { - for (NetworkPeering peering : this.list()) { - if (peering.remoteNetworkId().equalsIgnoreCase(remoteNetworkResourceId)) { - return peering; - } - } - } - return null; - } - - @Override - public Mono getByRemoteNetworkAsync(Network network) { - if (network != null) { - return this.getByRemoteNetworkAsync(network.id()); - } else { - return Mono.empty(); - } - } - - @Override - public Mono getByRemoteNetworkAsync(final String remoteNetworkResourceId) { - if (remoteNetworkResourceId == null) { - return Mono.empty(); - } else { - return this - .listAsync() - .filter( - peering -> { - if (peering == null) { - return false; - } else { - return remoteNetworkResourceId.equalsIgnoreCase(peering.remoteNetworkId()); - } - }) - .last(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NetworkProfileImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NetworkProfileImpl.java deleted file mode 100644 index ae327e1876c6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NetworkProfileImpl.java +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.network.implementation; - -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.network.fluent.models.IpConfigurationProfileInner; -import com.azure.resourcemanager.network.fluent.models.NetworkProfileInner; -import com.azure.resourcemanager.network.fluent.models.SubnetInner; -import com.azure.resourcemanager.network.models.ContainerNetworkInterfaceConfiguration; -import com.azure.resourcemanager.network.models.NetworkProfile; -import com.azure.resourcemanager.network.models.Subnet; -import com.azure.resourcemanager.network.models.TagsObject; -import reactor.core.publisher.Mono; - -import java.util.Collections; -import java.util.List; - -final class NetworkProfileImpl extends - GroupableParentResourceWithTagsImpl - implements NetworkProfile, NetworkProfile.Definition, NetworkProfile.Update { - - NetworkProfileImpl(String name, NetworkProfileInner innerObject, NetworkManager manager) { - super(name, innerObject, manager); - } - - @Override - public List containerNetworkInterfaceConfigurations() { - List inner = - this.innerModel().containerNetworkInterfaceConfigurations(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - @Override - protected Mono applyTagsToInnerAsync() { - return this - .manager() - .serviceClient() - .getNetworkProfiles() - .updateTagsAsync(resourceGroupName(), name(), new TagsObject().withTags(innerModel().tags())); - } - - @Override - protected Mono createInner() { - return this - .manager() - .serviceClient() - .getNetworkProfiles() - .createOrUpdateAsync(this.resourceGroupName(), this.name(), this.innerModel()); - } - - @Override - protected void initializeChildrenFromInner() { - } - - @Override - protected Mono getInnerAsync() { - return this - .manager() - .serviceClient() - .getNetworkProfiles() - .getByResourceGroupAsync(this.resourceGroupName(), this.name()); - } - - - @Override - public NetworkProfileImpl withContainerNetworkInterfaceConfiguration( - String name, String ipConfigName, String virtualNetworkId, String subnetName) { - String subnetId = String.format("%s/subnets/%s", virtualNetworkId, subnetName); - return withContainerNetworkInterfaceConfiguration(name, ipConfigName, subnetId); - } - - @Override - public NetworkProfileImpl withContainerNetworkInterfaceConfiguration( - String name, String ipConfigName, Subnet subnet) { - return withContainerNetworkInterfaceConfiguration(name, ipConfigName, subnet.id()); - } - - private NetworkProfileImpl withContainerNetworkInterfaceConfiguration( - String name, String ipConfigName, String subnetId) { - this.innerModel().withContainerNetworkInterfaceConfigurations( - Collections - .singletonList( - new ContainerNetworkInterfaceConfiguration() - .withName(name) - .withIpConfigurations( - Collections - .singletonList( - new IpConfigurationProfileInner() - .withName(ipConfigName) - .withSubnet(new SubnetInner().withId(subnetId)))))); - return this; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NetworkProfilesClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NetworkProfilesClientImpl.java deleted file mode 100644 index 1400a4f80c29..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NetworkProfilesClientImpl.java +++ /dev/null @@ -1,1382 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.NetworkProfilesClient; -import com.azure.resourcemanager.network.fluent.models.NetworkProfileInner; -import com.azure.resourcemanager.network.models.NetworkProfileListResult; -import com.azure.resourcemanager.network.models.TagsObject; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in NetworkProfilesClient. */ -public final class NetworkProfilesClientImpl - implements InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete, - NetworkProfilesClient { - private final ClientLogger logger = new ClientLogger(NetworkProfilesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final NetworkProfilesService service; - - /** The service client containing this operation class. */ - private final NetworkManagementClientImpl client; - - /** - * Initializes an instance of NetworkProfilesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - NetworkProfilesClientImpl(NetworkManagementClientImpl client) { - this.service = - RestProxy.create(NetworkProfilesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for NetworkManagementClientNetworkProfiles to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "NetworkManagementCli") - private interface NetworkProfilesService { - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/networkProfiles/{networkProfileName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("networkProfileName") String networkProfileName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/networkProfiles/{networkProfileName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("networkProfileName") String networkProfileName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("$expand") String expand, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/networkProfiles/{networkProfileName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("networkProfileName") String networkProfileName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") NetworkProfileInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/networkProfiles/{networkProfileName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> updateTags( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("networkProfileName") String networkProfileName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") TagsObject parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkProfiles") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/networkProfiles") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAllNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Deletes the specified network profile. - * - * @param resourceGroupName The name of the resource group. - * @param networkProfileName The name of the NetworkProfile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync( - String resourceGroupName, String networkProfileName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkProfileName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - networkProfileName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the specified network profile. - * - * @param resourceGroupName The name of the resource group. - * @param networkProfileName The name of the NetworkProfile. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String networkProfileName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkProfileName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - networkProfileName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Deletes the specified network profile. - * - * @param resourceGroupName The name of the resource group. - * @param networkProfileName The name of the NetworkProfile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String networkProfileName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, networkProfileName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deletes the specified network profile. - * - * @param resourceGroupName The name of the resource group. - * @param networkProfileName The name of the NetworkProfile. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String networkProfileName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(resourceGroupName, networkProfileName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes the specified network profile. - * - * @param resourceGroupName The name of the resource group. - * @param networkProfileName The name of the NetworkProfile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete(String resourceGroupName, String networkProfileName) { - return beginDeleteAsync(resourceGroupName, networkProfileName).getSyncPoller(); - } - - /** - * Deletes the specified network profile. - * - * @param resourceGroupName The name of the resource group. - * @param networkProfileName The name of the NetworkProfile. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String networkProfileName, Context context) { - return beginDeleteAsync(resourceGroupName, networkProfileName, context).getSyncPoller(); - } - - /** - * Deletes the specified network profile. - * - * @param resourceGroupName The name of the resource group. - * @param networkProfileName The name of the NetworkProfile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String networkProfileName) { - return beginDeleteAsync(resourceGroupName, networkProfileName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified network profile. - * - * @param resourceGroupName The name of the resource group. - * @param networkProfileName The name of the NetworkProfile. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String networkProfileName, Context context) { - return beginDeleteAsync(resourceGroupName, networkProfileName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified network profile. - * - * @param resourceGroupName The name of the resource group. - * @param networkProfileName The name of the NetworkProfile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String networkProfileName) { - deleteAsync(resourceGroupName, networkProfileName).block(); - } - - /** - * Deletes the specified network profile. - * - * @param resourceGroupName The name of the resource group. - * @param networkProfileName The name of the NetworkProfile. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String networkProfileName, Context context) { - deleteAsync(resourceGroupName, networkProfileName, context).block(); - } - - /** - * Gets the specified network profile in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param networkProfileName The name of the PublicIPPrefix. - * @param expand Expands referenced resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network profile in a specified resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String networkProfileName, String expand) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkProfileName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - networkProfileName, - apiVersion, - this.client.getSubscriptionId(), - expand, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the specified network profile in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param networkProfileName The name of the PublicIPPrefix. - * @param expand Expands referenced resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network profile in a specified resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String networkProfileName, String expand, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkProfileName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - networkProfileName, - apiVersion, - this.client.getSubscriptionId(), - expand, - accept, - context); - } - - /** - * Gets the specified network profile in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param networkProfileName The name of the PublicIPPrefix. - * @param expand Expands referenced resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network profile in a specified resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync( - String resourceGroupName, String networkProfileName, String expand) { - return getByResourceGroupWithResponseAsync(resourceGroupName, networkProfileName, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the specified network profile in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param networkProfileName The name of the PublicIPPrefix. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network profile in a specified resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync(String resourceGroupName, String networkProfileName) { - final String expand = null; - return getByResourceGroupWithResponseAsync(resourceGroupName, networkProfileName, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the specified network profile in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param networkProfileName The name of the PublicIPPrefix. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network profile in a specified resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public NetworkProfileInner getByResourceGroup(String resourceGroupName, String networkProfileName) { - final String expand = null; - return getByResourceGroupAsync(resourceGroupName, networkProfileName, expand).block(); - } - - /** - * Gets the specified network profile in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param networkProfileName The name of the PublicIPPrefix. - * @param expand Expands referenced resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network profile in a specified resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String networkProfileName, String expand, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, networkProfileName, expand, context).block(); - } - - /** - * Creates or updates a network profile. - * - * @param resourceGroupName The name of the resource group. - * @param networkProfileName The name of the network profile. - * @param parameters Parameters supplied to the create or update network profile operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return network profile resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String networkProfileName, NetworkProfileInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkProfileName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - networkProfileName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a network profile. - * - * @param resourceGroupName The name of the resource group. - * @param networkProfileName The name of the network profile. - * @param parameters Parameters supplied to the create or update network profile operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return network profile resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String networkProfileName, NetworkProfileInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkProfileName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - networkProfileName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Creates or updates a network profile. - * - * @param resourceGroupName The name of the resource group. - * @param networkProfileName The name of the network profile. - * @param parameters Parameters supplied to the create or update network profile operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return network profile resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, String networkProfileName, NetworkProfileInner parameters) { - return createOrUpdateWithResponseAsync(resourceGroupName, networkProfileName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates or updates a network profile. - * - * @param resourceGroupName The name of the resource group. - * @param networkProfileName The name of the network profile. - * @param parameters Parameters supplied to the create or update network profile operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return network profile resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public NetworkProfileInner createOrUpdate( - String resourceGroupName, String networkProfileName, NetworkProfileInner parameters) { - return createOrUpdateAsync(resourceGroupName, networkProfileName, parameters).block(); - } - - /** - * Creates or updates a network profile. - * - * @param resourceGroupName The name of the resource group. - * @param networkProfileName The name of the network profile. - * @param parameters Parameters supplied to the create or update network profile operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return network profile resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceGroupName, String networkProfileName, NetworkProfileInner parameters, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, networkProfileName, parameters, context).block(); - } - - /** - * Updates network profile tags. - * - * @param resourceGroupName The name of the resource group. - * @param networkProfileName The name of the network profile. - * @param parameters Parameters supplied to update network profile tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return network profile resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateTagsWithResponseAsync( - String resourceGroupName, String networkProfileName, TagsObject parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkProfileName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updateTags( - this.client.getEndpoint(), - resourceGroupName, - networkProfileName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates network profile tags. - * - * @param resourceGroupName The name of the resource group. - * @param networkProfileName The name of the network profile. - * @param parameters Parameters supplied to update network profile tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return network profile resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateTagsWithResponseAsync( - String resourceGroupName, String networkProfileName, TagsObject parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkProfileName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updateTags( - this.client.getEndpoint(), - resourceGroupName, - networkProfileName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Updates network profile tags. - * - * @param resourceGroupName The name of the resource group. - * @param networkProfileName The name of the network profile. - * @param parameters Parameters supplied to update network profile tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return network profile resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateTagsAsync( - String resourceGroupName, String networkProfileName, TagsObject parameters) { - return updateTagsWithResponseAsync(resourceGroupName, networkProfileName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Updates network profile tags. - * - * @param resourceGroupName The name of the resource group. - * @param networkProfileName The name of the network profile. - * @param parameters Parameters supplied to update network profile tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return network profile resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public NetworkProfileInner updateTags(String resourceGroupName, String networkProfileName, TagsObject parameters) { - return updateTagsAsync(resourceGroupName, networkProfileName, parameters).block(); - } - - /** - * Updates network profile tags. - * - * @param resourceGroupName The name of the resource group. - * @param networkProfileName The name of the network profile. - * @param parameters Parameters supplied to update network profile tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return network profile resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateTagsWithResponse( - String resourceGroupName, String networkProfileName, TagsObject parameters, Context context) { - return updateTagsWithResponseAsync(resourceGroupName, networkProfileName, parameters, context).block(); - } - - /** - * Gets all the network profiles in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the network profiles in a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all the network profiles in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the network profiles in a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all the network profiles in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the network profiles in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listAllNextSinglePageAsync(nextLink)); - } - - /** - * Gets all the network profiles in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the network profiles in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listAllNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all the network profiles in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the network profiles in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Gets all the network profiles in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the network profiles in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Gets all network profiles in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network profiles in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all network profiles in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network profiles in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all network profiles in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network profiles in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets all network profiles in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network profiles in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all network profiles in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network profiles in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * Gets all network profiles in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network profiles in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListNetworkProfiles API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAllNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listAllNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListNetworkProfiles API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAllNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listAllNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListNetworkProfiles API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListNetworkProfiles API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NetworkProfilesImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NetworkProfilesImpl.java deleted file mode 100644 index db083f2eb8c5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NetworkProfilesImpl.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.network.implementation; - -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.network.fluent.NetworkProfilesClient; -import com.azure.resourcemanager.network.fluent.models.NetworkProfileInner; -import com.azure.resourcemanager.network.models.NetworkProfile; -import com.azure.resourcemanager.network.models.NetworkProfiles; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.TopLevelModifiableResourcesImpl; - -public final class NetworkProfilesImpl extends - TopLevelModifiableResourcesImpl - implements NetworkProfiles { - - public NetworkProfilesImpl(final NetworkManager networkManager) { - super(networkManager.serviceClient().getNetworkProfiles(), networkManager); - } - - @Override - public NetworkProfileImpl define(String name) { - return wrapModel(name); - } - - @Override - protected NetworkProfileImpl wrapModel(String name) { - return new NetworkProfileImpl(name, new NetworkProfileInner(), this.manager()); - } - - @Override - protected NetworkProfileImpl wrapModel(NetworkProfileInner inner) { - if (inner == null) { - return null; - } - return new NetworkProfileImpl(inner.name(), inner, this.manager()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NetworkSecurityGroupImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NetworkSecurityGroupImpl.java deleted file mode 100644 index 9a9f56f4d5f7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NetworkSecurityGroupImpl.java +++ /dev/null @@ -1,156 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.network.fluent.models.NetworkInterfaceInner; -import com.azure.resourcemanager.network.fluent.models.NetworkSecurityGroupInner; -import com.azure.resourcemanager.network.fluent.models.SecurityRuleInner; -import com.azure.resourcemanager.network.models.NetworkSecurityGroup; -import com.azure.resourcemanager.network.models.NetworkSecurityRule; -import com.azure.resourcemanager.network.models.Subnet; -import com.azure.resourcemanager.network.models.TagsObject; -import reactor.core.publisher.Mono; - -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.TreeMap; -import java.util.TreeSet; - -/** Implementation for NetworkSecurityGroup and its create and update interfaces. */ -class NetworkSecurityGroupImpl - extends GroupableParentResourceWithTagsImpl< - NetworkSecurityGroup, NetworkSecurityGroupInner, NetworkSecurityGroupImpl, NetworkManager> - implements NetworkSecurityGroup, NetworkSecurityGroup.Definition, NetworkSecurityGroup.Update { - - private Map rules; - private Map defaultRules; - - NetworkSecurityGroupImpl( - final String name, final NetworkSecurityGroupInner innerModel, final NetworkManager networkManager) { - super(name, innerModel, networkManager); - } - - @Override - protected void initializeChildrenFromInner() { - this.rules = new TreeMap<>(); - List inners = this.innerModel().securityRules(); - if (inners != null) { - for (SecurityRuleInner inner : inners) { - this.rules.put(inner.name(), new NetworkSecurityRuleImpl(inner, this)); - } - } - - this.defaultRules = new TreeMap<>(); - inners = this.innerModel().defaultSecurityRules(); - if (inners != null) { - for (SecurityRuleInner inner : inners) { - this.defaultRules.put(inner.name(), new NetworkSecurityRuleImpl(inner, this)); - } - } - } - - // Verbs - - @Override - public NetworkSecurityRuleImpl updateRule(String name) { - return (NetworkSecurityRuleImpl) this.rules.get(name); - } - - @Override - public NetworkSecurityRuleImpl defineRule(String name) { - SecurityRuleInner inner = new SecurityRuleInner(); - inner.withName(name); - inner.withPriority(100); // Must be at least 100 - return new NetworkSecurityRuleImpl(inner, this); - } - - @Override - public Mono refreshAsync() { - return super - .refreshAsync() - .map( - networkSecurityGroup -> { - NetworkSecurityGroupImpl impl = (NetworkSecurityGroupImpl) networkSecurityGroup; - - impl.initializeChildrenFromInner(); - return impl; - }); - } - - @Override - protected Mono getInnerAsync() { - return this - .manager() - .serviceClient() - .getNetworkSecurityGroups() - .getByResourceGroupAsync(this.resourceGroupName(), this.name()); - } - - @Override - protected Mono applyTagsToInnerAsync() { - return this - .manager() - .serviceClient() - .getNetworkSecurityGroups() - .updateTagsAsync(resourceGroupName(), name(), new TagsObject().withTags(innerModel().tags())); - } - - @Override - public List listAssociatedSubnets() { - return Utils.listAssociatedSubnets(this.myManager, this.innerModel().subnets()); - } - - // Setters (fluent) - - @Override - public Update withoutRule(String name) { - this.rules.remove(name); - return this; - } - - NetworkSecurityGroupImpl withRule(NetworkSecurityRuleImpl rule) { - this.rules.put(rule.name(), rule); - return this; - } - - // Getters - - @Override - public Map securityRules() { - return Collections.unmodifiableMap(this.rules); - } - - @Override - public Map defaultSecurityRules() { - return Collections.unmodifiableMap(this.defaultRules); - } - - @Override - public Set networkInterfaceIds() { - Set ids = new TreeSet<>(String.CASE_INSENSITIVE_ORDER); - if (this.innerModel().networkInterfaces() != null) { - for (NetworkInterfaceInner inner : this.innerModel().networkInterfaces()) { - ids.add(inner.id()); - } - } - return Collections.unmodifiableSet(ids); - } - - @Override - protected void beforeCreating() { - // Reset and update subnets - this.innerModel().withSecurityRules(innersFromWrappers(this.rules.values())); - } - - @Override - protected Mono createInner() { - return this - .manager() - .serviceClient() - .getNetworkSecurityGroups() - .createOrUpdateAsync(this.resourceGroupName(), this.name(), this.innerModel()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NetworkSecurityGroupsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NetworkSecurityGroupsClientImpl.java deleted file mode 100644 index 292cc90ef3e8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NetworkSecurityGroupsClientImpl.java +++ /dev/null @@ -1,1620 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.NetworkSecurityGroupsClient; -import com.azure.resourcemanager.network.fluent.models.NetworkSecurityGroupInner; -import com.azure.resourcemanager.network.models.NetworkSecurityGroupListResult; -import com.azure.resourcemanager.network.models.TagsObject; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in NetworkSecurityGroupsClient. */ -public final class NetworkSecurityGroupsClientImpl - implements InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete, - NetworkSecurityGroupsClient { - private final ClientLogger logger = new ClientLogger(NetworkSecurityGroupsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final NetworkSecurityGroupsService service; - - /** The service client containing this operation class. */ - private final NetworkManagementClientImpl client; - - /** - * Initializes an instance of NetworkSecurityGroupsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - NetworkSecurityGroupsClientImpl(NetworkManagementClientImpl client) { - this.service = - RestProxy - .create(NetworkSecurityGroupsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for NetworkManagementClientNetworkSecurityGroups to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "NetworkManagementCli") - private interface NetworkSecurityGroupsService { - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/networkSecurityGroups/{networkSecurityGroupName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("networkSecurityGroupName") String networkSecurityGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/networkSecurityGroups/{networkSecurityGroupName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("networkSecurityGroupName") String networkSecurityGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("$expand") String expand, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/networkSecurityGroups/{networkSecurityGroupName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("networkSecurityGroupName") String networkSecurityGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") NetworkSecurityGroupInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/networkSecurityGroups/{networkSecurityGroupName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> updateTags( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("networkSecurityGroupName") String networkSecurityGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") TagsObject parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkSecurityGroups") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/networkSecurityGroups") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAllNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Deletes the specified network security group. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync( - String resourceGroupName, String networkSecurityGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkSecurityGroupName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - networkSecurityGroupName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the specified network security group. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String networkSecurityGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkSecurityGroupName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - networkSecurityGroupName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Deletes the specified network security group. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String networkSecurityGroupName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, networkSecurityGroupName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deletes the specified network security group. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String networkSecurityGroupName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, networkSecurityGroupName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes the specified network security group. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete(String resourceGroupName, String networkSecurityGroupName) { - return beginDeleteAsync(resourceGroupName, networkSecurityGroupName).getSyncPoller(); - } - - /** - * Deletes the specified network security group. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String networkSecurityGroupName, Context context) { - return beginDeleteAsync(resourceGroupName, networkSecurityGroupName, context).getSyncPoller(); - } - - /** - * Deletes the specified network security group. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String networkSecurityGroupName) { - return beginDeleteAsync(resourceGroupName, networkSecurityGroupName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified network security group. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String networkSecurityGroupName, Context context) { - return beginDeleteAsync(resourceGroupName, networkSecurityGroupName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified network security group. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String networkSecurityGroupName) { - deleteAsync(resourceGroupName, networkSecurityGroupName).block(); - } - - /** - * Deletes the specified network security group. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String networkSecurityGroupName, Context context) { - deleteAsync(resourceGroupName, networkSecurityGroupName, context).block(); - } - - /** - * Gets the specified network security group. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param expand Expands referenced resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network security group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String networkSecurityGroupName, String expand) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkSecurityGroupName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - networkSecurityGroupName, - apiVersion, - this.client.getSubscriptionId(), - expand, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the specified network security group. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param expand Expands referenced resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network security group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String networkSecurityGroupName, String expand, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkSecurityGroupName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - networkSecurityGroupName, - apiVersion, - this.client.getSubscriptionId(), - expand, - accept, - context); - } - - /** - * Gets the specified network security group. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param expand Expands referenced resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network security group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync( - String resourceGroupName, String networkSecurityGroupName, String expand) { - return getByResourceGroupWithResponseAsync(resourceGroupName, networkSecurityGroupName, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the specified network security group. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network security group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync( - String resourceGroupName, String networkSecurityGroupName) { - final String expand = null; - return getByResourceGroupWithResponseAsync(resourceGroupName, networkSecurityGroupName, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the specified network security group. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network security group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public NetworkSecurityGroupInner getByResourceGroup(String resourceGroupName, String networkSecurityGroupName) { - final String expand = null; - return getByResourceGroupAsync(resourceGroupName, networkSecurityGroupName, expand).block(); - } - - /** - * Gets the specified network security group. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param expand Expands referenced resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network security group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String networkSecurityGroupName, String expand, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, networkSecurityGroupName, expand, context) - .block(); - } - - /** - * Creates or updates a network security group in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param parameters Parameters supplied to the create or update network security group operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return networkSecurityGroup resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String networkSecurityGroupName, NetworkSecurityGroupInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkSecurityGroupName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - networkSecurityGroupName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a network security group in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param parameters Parameters supplied to the create or update network security group operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return networkSecurityGroup resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String networkSecurityGroupName, - NetworkSecurityGroupInner parameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkSecurityGroupName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - networkSecurityGroupName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Creates or updates a network security group in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param parameters Parameters supplied to the create or update network security group operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return networkSecurityGroup resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, NetworkSecurityGroupInner> beginCreateOrUpdateAsync( - String resourceGroupName, String networkSecurityGroupName, NetworkSecurityGroupInner parameters) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, networkSecurityGroupName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - NetworkSecurityGroupInner.class, - NetworkSecurityGroupInner.class, - Context.NONE); - } - - /** - * Creates or updates a network security group in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param parameters Parameters supplied to the create or update network security group operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return networkSecurityGroup resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, NetworkSecurityGroupInner> beginCreateOrUpdateAsync( - String resourceGroupName, - String networkSecurityGroupName, - NetworkSecurityGroupInner parameters, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, networkSecurityGroupName, parameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - NetworkSecurityGroupInner.class, - NetworkSecurityGroupInner.class, - context); - } - - /** - * Creates or updates a network security group in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param parameters Parameters supplied to the create or update network security group operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return networkSecurityGroup resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, NetworkSecurityGroupInner> beginCreateOrUpdate( - String resourceGroupName, String networkSecurityGroupName, NetworkSecurityGroupInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, networkSecurityGroupName, parameters).getSyncPoller(); - } - - /** - * Creates or updates a network security group in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param parameters Parameters supplied to the create or update network security group operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return networkSecurityGroup resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, NetworkSecurityGroupInner> beginCreateOrUpdate( - String resourceGroupName, - String networkSecurityGroupName, - NetworkSecurityGroupInner parameters, - Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, networkSecurityGroupName, parameters, context) - .getSyncPoller(); - } - - /** - * Creates or updates a network security group in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param parameters Parameters supplied to the create or update network security group operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return networkSecurityGroup resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, String networkSecurityGroupName, NetworkSecurityGroupInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, networkSecurityGroupName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a network security group in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param parameters Parameters supplied to the create or update network security group operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return networkSecurityGroup resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, - String networkSecurityGroupName, - NetworkSecurityGroupInner parameters, - Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, networkSecurityGroupName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a network security group in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param parameters Parameters supplied to the create or update network security group operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return networkSecurityGroup resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public NetworkSecurityGroupInner createOrUpdate( - String resourceGroupName, String networkSecurityGroupName, NetworkSecurityGroupInner parameters) { - return createOrUpdateAsync(resourceGroupName, networkSecurityGroupName, parameters).block(); - } - - /** - * Creates or updates a network security group in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param parameters Parameters supplied to the create or update network security group operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return networkSecurityGroup resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public NetworkSecurityGroupInner createOrUpdate( - String resourceGroupName, - String networkSecurityGroupName, - NetworkSecurityGroupInner parameters, - Context context) { - return createOrUpdateAsync(resourceGroupName, networkSecurityGroupName, parameters, context).block(); - } - - /** - * Updates a network security group tags. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param parameters Parameters supplied to update network security group tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return networkSecurityGroup resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateTagsWithResponseAsync( - String resourceGroupName, String networkSecurityGroupName, TagsObject parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkSecurityGroupName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updateTags( - this.client.getEndpoint(), - resourceGroupName, - networkSecurityGroupName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates a network security group tags. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param parameters Parameters supplied to update network security group tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return networkSecurityGroup resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateTagsWithResponseAsync( - String resourceGroupName, String networkSecurityGroupName, TagsObject parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkSecurityGroupName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updateTags( - this.client.getEndpoint(), - resourceGroupName, - networkSecurityGroupName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Updates a network security group tags. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param parameters Parameters supplied to update network security group tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return networkSecurityGroup resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, NetworkSecurityGroupInner> beginUpdateTagsAsync( - String resourceGroupName, String networkSecurityGroupName, TagsObject parameters) { - Mono>> mono = - updateTagsWithResponseAsync(resourceGroupName, networkSecurityGroupName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - NetworkSecurityGroupInner.class, - NetworkSecurityGroupInner.class, - Context.NONE); - } - - /** - * Updates a network security group tags. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param parameters Parameters supplied to update network security group tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return networkSecurityGroup resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, NetworkSecurityGroupInner> beginUpdateTagsAsync( - String resourceGroupName, String networkSecurityGroupName, TagsObject parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - updateTagsWithResponseAsync(resourceGroupName, networkSecurityGroupName, parameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - NetworkSecurityGroupInner.class, - NetworkSecurityGroupInner.class, - context); - } - - /** - * Updates a network security group tags. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param parameters Parameters supplied to update network security group tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return networkSecurityGroup resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, NetworkSecurityGroupInner> beginUpdateTags( - String resourceGroupName, String networkSecurityGroupName, TagsObject parameters) { - return beginUpdateTagsAsync(resourceGroupName, networkSecurityGroupName, parameters).getSyncPoller(); - } - - /** - * Updates a network security group tags. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param parameters Parameters supplied to update network security group tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return networkSecurityGroup resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, NetworkSecurityGroupInner> beginUpdateTags( - String resourceGroupName, String networkSecurityGroupName, TagsObject parameters, Context context) { - return beginUpdateTagsAsync(resourceGroupName, networkSecurityGroupName, parameters, context).getSyncPoller(); - } - - /** - * Updates a network security group tags. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param parameters Parameters supplied to update network security group tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return networkSecurityGroup resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateTagsAsync( - String resourceGroupName, String networkSecurityGroupName, TagsObject parameters) { - return beginUpdateTagsAsync(resourceGroupName, networkSecurityGroupName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates a network security group tags. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param parameters Parameters supplied to update network security group tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return networkSecurityGroup resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateTagsAsync( - String resourceGroupName, String networkSecurityGroupName, TagsObject parameters, Context context) { - return beginUpdateTagsAsync(resourceGroupName, networkSecurityGroupName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates a network security group tags. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param parameters Parameters supplied to update network security group tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return networkSecurityGroup resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public NetworkSecurityGroupInner updateTags( - String resourceGroupName, String networkSecurityGroupName, TagsObject parameters) { - return updateTagsAsync(resourceGroupName, networkSecurityGroupName, parameters).block(); - } - - /** - * Updates a network security group tags. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param parameters Parameters supplied to update network security group tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return networkSecurityGroup resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public NetworkSecurityGroupInner updateTags( - String resourceGroupName, String networkSecurityGroupName, TagsObject parameters, Context context) { - return updateTagsAsync(resourceGroupName, networkSecurityGroupName, parameters, context).block(); - } - - /** - * Gets all network security groups in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network security groups in a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all network security groups in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network security groups in a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all network security groups in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network security groups in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listAllNextSinglePageAsync(nextLink)); - } - - /** - * Gets all network security groups in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network security groups in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listAllNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all network security groups in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network security groups in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Gets all network security groups in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network security groups in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Gets all network security groups in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network security groups in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all network security groups in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network security groups in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all network security groups in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network security groups in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets all network security groups in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network security groups in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all network security groups in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network security groups in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * Gets all network security groups in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network security groups in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListNetworkSecurityGroups API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAllNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listAllNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListNetworkSecurityGroups API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAllNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listAllNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListNetworkSecurityGroups API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListNetworkSecurityGroups API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NetworkSecurityGroupsImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NetworkSecurityGroupsImpl.java deleted file mode 100644 index 6aa3375528b2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NetworkSecurityGroupsImpl.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.util.CoreUtils; -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.network.fluent.NetworkSecurityGroupsClient; -import com.azure.resourcemanager.network.fluent.models.NetworkSecurityGroupInner; -import com.azure.resourcemanager.network.models.NetworkSecurityGroup; -import com.azure.resourcemanager.network.models.NetworkSecurityGroups; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.TopLevelModifiableResourcesImpl; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** Implementation for NetworkSecurityGroups. */ -public class NetworkSecurityGroupsImpl - extends TopLevelModifiableResourcesImpl< - NetworkSecurityGroup, - NetworkSecurityGroupImpl, - NetworkSecurityGroupInner, - NetworkSecurityGroupsClient, - NetworkManager> - implements NetworkSecurityGroups { - - public NetworkSecurityGroupsImpl(final NetworkManager networkManager) { - super(networkManager.serviceClient().getNetworkSecurityGroups(), networkManager); - } - - @Override - public Mono deleteByResourceGroupAsync(String resourceGroupName, String name) { - if (CoreUtils.isNullOrEmpty(resourceGroupName)) { - return Mono.error( - new IllegalArgumentException("Parameter 'resourceGroupName' is required and cannot be null.")); - } - if (CoreUtils.isNullOrEmpty(name)) { - return Mono.error( - new IllegalArgumentException("Parameter 'name' is required and cannot be null.")); - } - // Clear NIC references if any - return getByResourceGroupAsync(resourceGroupName, name) - .flatMapMany(nsg -> Flux.fromIterable(nsg.networkInterfaceIds()) - .flatMap(nicRef -> this.manager().networkInterfaces().getByIdAsync(nicRef)) - .flatMap(nic -> { - if (nic == null) { - return Mono.empty(); - } else if (!nsg.id().equalsIgnoreCase(nic.networkSecurityGroupId())) { - return Mono.empty(); - } else { - return nic.update().withoutNetworkSecurityGroup().applyAsync(); - } - })) - .then(this.deleteInnerAsync(resourceGroupName, name)) - .subscribeOn(ResourceManagerUtils.InternalRuntimeContext.getReactorScheduler()); - } - - @Override - public NetworkSecurityGroupImpl define(String name) { - return wrapModel(name); - } - - // Fluent model create helpers - - @Override - protected NetworkSecurityGroupImpl wrapModel(String name) { - NetworkSecurityGroupInner inner = new NetworkSecurityGroupInner(); - return new NetworkSecurityGroupImpl(name, inner, this.manager()); - } - - @Override - protected NetworkSecurityGroupImpl wrapModel(NetworkSecurityGroupInner inner) { - if (inner == null) { - return null; - } - return new NetworkSecurityGroupImpl(inner.name(), inner, this.manager()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NetworkSecurityRuleImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NetworkSecurityRuleImpl.java deleted file mode 100644 index 504ef2d462d8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NetworkSecurityRuleImpl.java +++ /dev/null @@ -1,359 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.models.NetworkSecurityGroup; -import com.azure.resourcemanager.network.models.NetworkSecurityRule; -import com.azure.resourcemanager.network.models.SecurityRuleAccess; -import com.azure.resourcemanager.network.models.SecurityRuleDirection; -import com.azure.resourcemanager.network.models.SecurityRuleProtocol; -import com.azure.resourcemanager.network.fluent.models.ApplicationSecurityGroupInner; -import com.azure.resourcemanager.network.fluent.models.SecurityRuleInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.ChildResourceImpl; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.function.Function; -import java.util.stream.Collectors; - -/** Implementation for {@link NetworkSecurityRule} and its create and update interfaces. */ -class NetworkSecurityRuleImpl - extends ChildResourceImpl - implements NetworkSecurityRule, - NetworkSecurityRule.Definition, - NetworkSecurityRule.UpdateDefinition, - NetworkSecurityRule.Update { - private Map sourceAsgs = new HashMap<>(); - private Map destinationAsgs = new HashMap<>(); - private final ClientLogger logger = new ClientLogger(getClass()); - - NetworkSecurityRuleImpl(SecurityRuleInner inner, NetworkSecurityGroupImpl parent) { - super(inner, parent); - if (inner.sourceApplicationSecurityGroups() != null) { - for (ApplicationSecurityGroupInner asg : inner.sourceApplicationSecurityGroups()) { - sourceAsgs.put(asg.id(), asg); - } - } - if (inner.destinationApplicationSecurityGroups() != null) { - for (ApplicationSecurityGroupInner asg : inner.destinationApplicationSecurityGroups()) { - destinationAsgs.put(asg.id(), asg); - } - } - } - - // Getters - - @Override - public String name() { - return this.innerModel().name(); - } - - @Override - public SecurityRuleDirection direction() { - return this.innerModel().direction(); - } - - @Override - public SecurityRuleProtocol protocol() { - return this.innerModel().protocol(); - } - - @Override - public SecurityRuleAccess access() { - return this.innerModel().access(); - } - - @Override - public String sourceAddressPrefix() { - return this.innerModel().sourceAddressPrefix(); - } - - @Override - public List sourceAddressPrefixes() { - return Collections.unmodifiableList(this.innerModel().sourceAddressPrefixes()); - } - - @Override - public String sourcePortRange() { - return this.innerModel().sourcePortRange(); - } - - @Override - public List sourcePortRanges() { - return Collections.unmodifiableList(innerModel().sourcePortRanges()); - } - - @Override - public String destinationAddressPrefix() { - return this.innerModel().destinationAddressPrefix(); - } - - @Override - public List destinationAddressPrefixes() { - return Collections.unmodifiableList(this.innerModel().destinationAddressPrefixes()); - } - - @Override - public String destinationPortRange() { - return this.innerModel().destinationPortRange(); - } - - @Override - public List destinationPortRanges() { - return Collections.unmodifiableList(innerModel().destinationPortRanges()); - } - - @Override - public int priority() { - return ResourceManagerUtils.toPrimitiveInt(this.innerModel().priority()); - } - - @Override - public Set sourceApplicationSecurityGroupIds() { - return Collections.unmodifiableSet(sourceAsgs.keySet()); - } - - @Override - public Set destinationApplicationSecurityGroupIds() { - return Collections.unmodifiableSet(destinationAsgs.keySet()); - } - - // Fluent setters - - @Override - public NetworkSecurityRuleImpl allowInbound() { - return this.withDirection(SecurityRuleDirection.INBOUND).withAccess(SecurityRuleAccess.ALLOW); - } - - @Override - public NetworkSecurityRuleImpl allowOutbound() { - return this.withDirection(SecurityRuleDirection.OUTBOUND).withAccess(SecurityRuleAccess.ALLOW); - } - - @Override - public NetworkSecurityRuleImpl denyInbound() { - return this.withDirection(SecurityRuleDirection.INBOUND).withAccess(SecurityRuleAccess.DENY); - } - - @Override - public NetworkSecurityRuleImpl denyOutbound() { - return this.withDirection(SecurityRuleDirection.OUTBOUND).withAccess(SecurityRuleAccess.DENY); - } - - @Override - public NetworkSecurityRuleImpl withProtocol(SecurityRuleProtocol protocol) { - this.innerModel().withProtocol(protocol); - return this; - } - - @Override - public NetworkSecurityRuleImpl withAnyProtocol() { - return this.withProtocol(SecurityRuleProtocol.ASTERISK); - } - - @Override - public NetworkSecurityRuleImpl fromAddress(String cidr) { - this.innerModel().withSourceAddressPrefix(cidr); - this.innerModel().withSourceAddressPrefixes(null); - this.innerModel().withSourceApplicationSecurityGroups(null); - return this; - } - - @Override - public NetworkSecurityRuleImpl fromAnyAddress() { - this.innerModel().withSourceAddressPrefix("*"); - this.innerModel().withSourceAddressPrefixes(null); - this.innerModel().withSourceApplicationSecurityGroups(null); - return this; - } - - @Override - public NetworkSecurityRuleImpl fromAddresses(String... addresses) { - this.innerModel().withSourceAddressPrefixes(Arrays.asList(addresses)); - this.innerModel().withSourceAddressPrefix(null); - this.innerModel().withSourceApplicationSecurityGroups(null); - return this; - } - - @Override - public NetworkSecurityRuleImpl fromPort(int port) { - this.innerModel().withSourcePortRange(String.valueOf(port)); - this.innerModel().withSourcePortRanges(null); - return this; - } - - @Override - public NetworkSecurityRuleImpl fromAnyPort() { - this.innerModel().withSourcePortRange("*"); - this.innerModel().withSourcePortRanges(null); - return this; - } - - @Override - public NetworkSecurityRuleImpl fromPortRange(int from, int to) { - this.innerModel().withSourcePortRange(String.valueOf(from) + "-" + String.valueOf(to)); - this.innerModel().withSourcePortRanges(null); - return this; - } - - @Override - public NetworkSecurityRuleImpl fromPortRanges(String... ranges) { - this.innerModel().withSourcePortRanges(Arrays.asList(ranges)); - this.innerModel().withSourcePortRange(null); - return this; - } - - @Override - public NetworkSecurityRuleImpl toAddress(String cidr) { - this.innerModel().withDestinationAddressPrefix(cidr); - this.innerModel().withDestinationAddressPrefixes(null); - this.innerModel().withDestinationApplicationSecurityGroups(null); - return this; - } - - @Override - public NetworkSecurityRuleImpl toAddresses(String... addresses) { - this.innerModel().withDestinationAddressPrefixes(Arrays.asList(addresses)); - this.innerModel().withDestinationAddressPrefix(null); - this.innerModel().withDestinationApplicationSecurityGroups(null); - return this; - } - - @Override - public NetworkSecurityRuleImpl toAnyAddress() { - this.innerModel().withDestinationAddressPrefix("*"); - this.innerModel().withDestinationAddressPrefixes(null); - this.innerModel().withDestinationApplicationSecurityGroups(null); - return this; - } - - @Override - public NetworkSecurityRuleImpl toPort(int port) { - this.innerModel().withDestinationPortRange(String.valueOf(port)); - this.innerModel().withDestinationPortRanges(null); - return this; - } - - @Override - public NetworkSecurityRuleImpl toAnyPort() { - this.innerModel().withDestinationPortRange("*"); - this.innerModel().withDestinationPortRanges(null); - return this; - } - - @Override - public NetworkSecurityRuleImpl toPortRange(int from, int to) { - this.innerModel().withDestinationPortRange(String.valueOf(from) + "-" + String.valueOf(to)); - this.innerModel().withDestinationPortRanges(null); - return this; - } - - @Override - public NetworkSecurityRuleImpl toPortRanges(String... ranges) { - this.innerModel().withDestinationPortRanges(Arrays.asList(ranges)); - this.innerModel().withDestinationPortRange(null); - return this; - } - - @Override - public NetworkSecurityRuleImpl withPriority(int priority) { - if (priority < 100 || priority > 4096) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "The priority number of a network security rule must be between 100 and 4096.")); - } - - this.innerModel().withPriority(priority); - return this; - } - - @Override - public NetworkSecurityRuleImpl withDescription(String description) { - this.innerModel().withDescription(description); - return this; - } - - @Override - public NetworkSecurityRuleImpl withSourceApplicationSecurityGroup(String id) { - sourceAsgs.put(id, new ApplicationSecurityGroupInner().withId(id)); - innerModel().withSourceAddressPrefix(null); - innerModel().withSourceAddressPrefixes(null); - return this; - } - - @Override - public NetworkSecurityRuleImpl withoutSourceApplicationSecurityGroup(String id) { - sourceAsgs.remove(id); - return this; - } - - @Override - public NetworkSecurityRuleImpl withSourceApplicationSecurityGroup(String... ids) { - sourceAsgs = Arrays.stream(ids) - .collect(Collectors.toMap(Function.identity(), id -> new ApplicationSecurityGroupInner().withId(id))); - innerModel().withSourceAddressPrefix(null); - innerModel().withSourceAddressPrefixes(null); - return this; - } - - @Override - public NetworkSecurityRuleImpl withDestinationApplicationSecurityGroup(String id) { - destinationAsgs.put(id, new ApplicationSecurityGroupInner().withId(id)); - innerModel().withDestinationAddressPrefix(null); - innerModel().withDestinationAddressPrefixes(null); - return this; - } - - @Override - public NetworkSecurityRuleImpl withoutDestinationApplicationSecurityGroup(String id) { - destinationAsgs.remove(id); - return this; - } - - @Override - public NetworkSecurityRuleImpl withDestinationApplicationSecurityGroup(String... ids) { - destinationAsgs = Arrays.stream(ids) - .collect(Collectors.toMap(Function.identity(), id -> new ApplicationSecurityGroupInner().withId(id))); - innerModel().withDestinationAddressPrefix(null); - innerModel().withDestinationAddressPrefixes(null); - return this; - } - - // Helpers - - private NetworkSecurityRuleImpl withDirection(SecurityRuleDirection direction) { - this.innerModel().withDirection(direction); - return this; - } - - private NetworkSecurityRuleImpl withAccess(SecurityRuleAccess permission) { - this.innerModel().withAccess(permission); - return this; - } - - // Verbs - - @Override - public NetworkSecurityGroupImpl attach() { - return this.parent().withRule(this); - } - - @Override - public NetworkSecurityGroupImpl parent() { - innerModel().withSourceApplicationSecurityGroups(new ArrayList<>(sourceAsgs.values())); - innerModel().withDestinationApplicationSecurityGroups(new ArrayList<>(destinationAsgs.values())); - return super.parent(); - } - - @Override - public String description() { - return this.innerModel().description(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NetworkUsageImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NetworkUsageImpl.java deleted file mode 100644 index fd897d492fb6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NetworkUsageImpl.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.resourcemanager.network.models.NetworkUsage; -import com.azure.resourcemanager.network.models.UsageName; -import com.azure.resourcemanager.network.fluent.models.UsageInner; -import com.azure.resourcemanager.network.models.UsageUnit; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.WrapperImpl; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; - -/** The implementation of {@link NetworkUsage}. */ -class NetworkUsageImpl extends WrapperImpl implements NetworkUsage { - NetworkUsageImpl(UsageInner innerObject) { - super(innerObject); - } - - @Override - public UsageUnit unit() { - return innerModel().unit(); - } - - @Override - public long currentValue() { - return ResourceManagerUtils.toPrimitiveLong(innerModel().currentValue()); - } - - @Override - public long limit() { - return ResourceManagerUtils.toPrimitiveLong(innerModel().limit()); - } - - @Override - public UsageName name() { - return innerModel().name(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NetworkUsagesImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NetworkUsagesImpl.java deleted file mode 100644 index 89a35b8d3b64..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NetworkUsagesImpl.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.network.models.NetworkUsage; -import com.azure.resourcemanager.network.models.NetworkUsages; -import com.azure.resourcemanager.network.fluent.NetworkManagementClient; -import com.azure.resourcemanager.network.fluent.models.UsageInner; -import com.azure.core.management.Region; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.ReadableWrappersImpl; - -/** The implementation of NetworkUsages. */ -public class NetworkUsagesImpl extends ReadableWrappersImpl - implements NetworkUsages { - private final NetworkManagementClient client; - - public NetworkUsagesImpl(NetworkManagementClient client) { - this.client = client; - } - - @Override - public PagedIterable listByRegion(Region region) { - return listByRegion(region.name()); - } - - @Override - public PagedIterable listByRegion(String regionName) { - return wrapList(client.getUsages().list(regionName)); - } - - @Override - public PagedFlux listByRegionAsync(Region region) { - return listByRegionAsync(region.name()); - } - - @Override - public PagedFlux listByRegionAsync(String regionName) { - return wrapPageAsync(client.getUsages().listAsync(regionName)); - } - - @Override - protected NetworkUsageImpl wrapModel(UsageInner usageInner) { - if (usageInner == null) { - return null; - } - return new NetworkUsageImpl(usageInner); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NetworkWatcherImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NetworkWatcherImpl.java deleted file mode 100644 index 6cdc3d4ab435..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NetworkWatcherImpl.java +++ /dev/null @@ -1,166 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.network.models.FlowLogSettings; -import com.azure.resourcemanager.network.models.FlowLogStatusParameters; -import com.azure.resourcemanager.network.models.NetworkWatcher; -import com.azure.resourcemanager.network.models.SecurityGroupView; -import com.azure.resourcemanager.network.models.AppliableWithTags; -import com.azure.resourcemanager.network.fluent.models.FlowLogInformationInner; -import com.azure.resourcemanager.network.fluent.models.NetworkWatcherInner; -import com.azure.resourcemanager.network.fluent.models.SecurityGroupViewResultInner; -import com.azure.resourcemanager.network.models.SecurityGroupViewParameters; -import com.azure.resourcemanager.network.models.TagsObject; -import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.GroupableResourceImpl; -import reactor.core.publisher.Mono; - -/** Implementation for Network Watcher and its create and update interfaces. */ -class NetworkWatcherImpl - extends GroupableResourceImpl - implements NetworkWatcher, NetworkWatcher.Definition, NetworkWatcher.Update, AppliableWithTags { - - private PacketCapturesImpl packetCaptures; - private ConnectionMonitorsImpl connectionMonitors; - - NetworkWatcherImpl(String name, final NetworkWatcherInner innerModel, final NetworkManager networkManager) { - super(name, innerModel, networkManager); - this.packetCaptures = new PacketCapturesImpl(networkManager.serviceClient().getPacketCaptures(), this); - this.connectionMonitors = - new ConnectionMonitorsImpl(networkManager.serviceClient().getConnectionMonitors(), this); - } - - public PacketCapturesImpl packetCaptures() { - return packetCaptures; - } - - @Override - public ConnectionMonitorsImpl connectionMonitors() { - return connectionMonitors; - } - - // Verbs - - @Override - public TopologyImpl topology() { - return new TopologyImpl(this); - } - - @Override - public SecurityGroupView getSecurityGroupView(String vmId) { - SecurityGroupViewResultInner securityGroupViewResultInner = - this - .manager() - .serviceClient() - .getNetworkWatchers() - .getVMSecurityRules(this.resourceGroupName(), this.name(), - new SecurityGroupViewParameters().withTargetResourceId(vmId)); - return new SecurityGroupViewImpl(this, securityGroupViewResultInner, vmId); - } - - @Override - public Mono getSecurityGroupViewAsync(final String vmId) { - return this - .manager() - .serviceClient() - .getNetworkWatchers() - .getVMSecurityRulesAsync(this.resourceGroupName(), this.name(), - new SecurityGroupViewParameters().withTargetResourceId(vmId)) - .map(inner -> new SecurityGroupViewImpl(NetworkWatcherImpl.this, inner, vmId)); - } - - public FlowLogSettings getFlowLogSettings(String nsgId) { - FlowLogInformationInner flowLogInformationInner = - this - .manager() - .serviceClient() - .getNetworkWatchers() - .getFlowLogStatus(this.resourceGroupName(), this.name(), - new FlowLogStatusParameters().withTargetResourceId(nsgId)); - return new FlowLogSettingsImpl(this, flowLogInformationInner, nsgId); - } - - @Override - public Mono getFlowLogSettingsAsync(final String nsgId) { - return this - .manager() - .serviceClient() - .getNetworkWatchers() - .getFlowLogStatusAsync(this.resourceGroupName(), this.name(), - new FlowLogStatusParameters().withTargetResourceId(nsgId)) - .map(inner -> new FlowLogSettingsImpl(NetworkWatcherImpl.this, inner, nsgId)); - } - - public NextHopImpl nextHop() { - return new NextHopImpl(this); - } - - @Override - public VerificationIPFlowImpl verifyIPFlow() { - return new VerificationIPFlowImpl(this); - } - - @Override - public ConnectivityCheckImpl checkConnectivity() { - return new ConnectivityCheckImpl(this); - } - - @Override - public TroubleshootingImpl troubleshoot() { - return new TroubleshootingImpl(this); - } - - @Override - public AvailableProvidersImpl availableProviders() { - return new AvailableProvidersImpl(this); - } - - @Override - public AzureReachabilityReportImpl azureReachabilityReport() { - return new AzureReachabilityReportImpl(this); - } - - @Override - public Mono createResourceAsync() { - return this - .manager() - .serviceClient() - .getNetworkWatchers() - .createOrUpdateAsync(this.resourceGroupName(), this.name(), this.innerModel()) - .map(innerToFluentMap(this)); - } - - @Override - protected Mono getInnerAsync() { - return this - .manager() - .serviceClient() - .getNetworkWatchers() - .getByResourceGroupAsync(this.resourceGroupName(), this.name()); - } - - @Override - public NetworkWatcherImpl updateTags() { - return this; - } - - @Override - public NetworkWatcher applyTags() { - return applyTagsAsync().block(); - } - - @Override - public Mono applyTagsAsync() { - return this - .manager() - .serviceClient() - .getNetworkWatchers() - .updateTagsAsync(resourceGroupName(), name(), new TagsObject().withTags(innerModel().tags())) - .flatMap( - inner -> { - setInner(inner); - return Mono.just((NetworkWatcher) NetworkWatcherImpl.this); - }); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NetworkWatchersClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NetworkWatchersClientImpl.java deleted file mode 100644 index d9de1148937b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NetworkWatchersClientImpl.java +++ /dev/null @@ -1,4676 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.NetworkWatchersClient; -import com.azure.resourcemanager.network.fluent.models.AvailableProvidersListInner; -import com.azure.resourcemanager.network.fluent.models.AzureReachabilityReportInner; -import com.azure.resourcemanager.network.fluent.models.ConnectivityInformationInner; -import com.azure.resourcemanager.network.fluent.models.FlowLogInformationInner; -import com.azure.resourcemanager.network.fluent.models.NetworkConfigurationDiagnosticResponseInner; -import com.azure.resourcemanager.network.fluent.models.NetworkWatcherInner; -import com.azure.resourcemanager.network.fluent.models.NextHopResultInner; -import com.azure.resourcemanager.network.fluent.models.SecurityGroupViewResultInner; -import com.azure.resourcemanager.network.fluent.models.TopologyInner; -import com.azure.resourcemanager.network.fluent.models.TroubleshootingResultInner; -import com.azure.resourcemanager.network.fluent.models.VerificationIpFlowResultInner; -import com.azure.resourcemanager.network.models.AvailableProvidersListParameters; -import com.azure.resourcemanager.network.models.AzureReachabilityReportParameters; -import com.azure.resourcemanager.network.models.ConnectivityParameters; -import com.azure.resourcemanager.network.models.FlowLogStatusParameters; -import com.azure.resourcemanager.network.models.NetworkConfigurationDiagnosticParameters; -import com.azure.resourcemanager.network.models.NetworkWatcherListResult; -import com.azure.resourcemanager.network.models.NextHopParameters; -import com.azure.resourcemanager.network.models.QueryTroubleshootingParameters; -import com.azure.resourcemanager.network.models.SecurityGroupViewParameters; -import com.azure.resourcemanager.network.models.TagsObject; -import com.azure.resourcemanager.network.models.TopologyParameters; -import com.azure.resourcemanager.network.models.TroubleshootingParameters; -import com.azure.resourcemanager.network.models.VerificationIpFlowParameters; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in NetworkWatchersClient. */ -public final class NetworkWatchersClientImpl - implements InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete, - NetworkWatchersClient { - private final ClientLogger logger = new ClientLogger(NetworkWatchersClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final NetworkWatchersService service; - - /** The service client containing this operation class. */ - private final NetworkManagementClientImpl client; - - /** - * Initializes an instance of NetworkWatchersClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - NetworkWatchersClientImpl(NetworkManagementClientImpl client) { - this.service = - RestProxy.create(NetworkWatchersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for NetworkManagementClientNetworkWatchers to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "NetworkManagementCli") - private interface NetworkWatchersService { - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/networkWatchers/{networkWatcherName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("networkWatcherName") String networkWatcherName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") NetworkWatcherInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/networkWatchers/{networkWatcherName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("networkWatcherName") String networkWatcherName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/networkWatchers/{networkWatcherName}") - @ExpectedResponses({202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("networkWatcherName") String networkWatcherName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/networkWatchers/{networkWatcherName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> updateTags( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("networkWatcherName") String networkWatcherName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") TagsObject parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/networkWatchers") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkWatchers") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/networkWatchers/{networkWatcherName}/topology") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getTopology( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("networkWatcherName") String networkWatcherName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") TopologyParameters parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/networkWatchers/{networkWatcherName}/ipFlowVerify") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> verifyIpFlow( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("networkWatcherName") String networkWatcherName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VerificationIpFlowParameters parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/networkWatchers/{networkWatcherName}/nextHop") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> getNextHop( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("networkWatcherName") String networkWatcherName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") NextHopParameters parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/networkWatchers/{networkWatcherName}/securityGroupView") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> getVMSecurityRules( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("networkWatcherName") String networkWatcherName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") SecurityGroupViewParameters parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/networkWatchers/{networkWatcherName}/troubleshoot") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> getTroubleshooting( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("networkWatcherName") String networkWatcherName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") TroubleshootingParameters parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/networkWatchers/{networkWatcherName}/queryTroubleshootResult") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> getTroubleshootingResult( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("networkWatcherName") String networkWatcherName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") QueryTroubleshootingParameters parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/networkWatchers/{networkWatcherName}/configureFlowLog") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> setFlowLogConfiguration( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("networkWatcherName") String networkWatcherName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") FlowLogInformationInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/networkWatchers/{networkWatcherName}/queryFlowLogStatus") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> getFlowLogStatus( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("networkWatcherName") String networkWatcherName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") FlowLogStatusParameters parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/networkWatchers/{networkWatcherName}/connectivityCheck") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> checkConnectivity( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("networkWatcherName") String networkWatcherName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") ConnectivityParameters parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/networkWatchers/{networkWatcherName}/azureReachabilityReport") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> getAzureReachabilityReport( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("networkWatcherName") String networkWatcherName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") AzureReachabilityReportParameters parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/networkWatchers/{networkWatcherName}/availableProvidersList") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> listAvailableProviders( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("networkWatcherName") String networkWatcherName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") AvailableProvidersListParameters parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/networkWatchers/{networkWatcherName}/networkConfigurationDiagnostic") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> getNetworkConfigurationDiagnostic( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("networkWatcherName") String networkWatcherName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") NetworkConfigurationDiagnosticParameters parameters, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Creates or updates a network watcher in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters that define the network watcher resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return network watcher in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String networkWatcherName, NetworkWatcherInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkWatcherName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - networkWatcherName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a network watcher in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters that define the network watcher resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return network watcher in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String networkWatcherName, NetworkWatcherInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkWatcherName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - networkWatcherName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Creates or updates a network watcher in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters that define the network watcher resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return network watcher in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, String networkWatcherName, NetworkWatcherInner parameters) { - return createOrUpdateWithResponseAsync(resourceGroupName, networkWatcherName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates or updates a network watcher in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters that define the network watcher resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return network watcher in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public NetworkWatcherInner createOrUpdate( - String resourceGroupName, String networkWatcherName, NetworkWatcherInner parameters) { - return createOrUpdateAsync(resourceGroupName, networkWatcherName, parameters).block(); - } - - /** - * Creates or updates a network watcher in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters that define the network watcher resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return network watcher in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceGroupName, String networkWatcherName, NetworkWatcherInner parameters, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, networkWatcherName, parameters, context).block(); - } - - /** - * Gets the specified network watcher by resource group. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network watcher by resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String networkWatcherName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkWatcherName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - networkWatcherName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the specified network watcher by resource group. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network watcher by resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String networkWatcherName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkWatcherName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - networkWatcherName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets the specified network watcher by resource group. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network watcher by resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync(String resourceGroupName, String networkWatcherName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, networkWatcherName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the specified network watcher by resource group. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network watcher by resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public NetworkWatcherInner getByResourceGroup(String resourceGroupName, String networkWatcherName) { - return getByResourceGroupAsync(resourceGroupName, networkWatcherName).block(); - } - - /** - * Gets the specified network watcher by resource group. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network watcher by resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String networkWatcherName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, networkWatcherName, context).block(); - } - - /** - * Deletes the specified network watcher resource. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync( - String resourceGroupName, String networkWatcherName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkWatcherName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - networkWatcherName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the specified network watcher resource. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String networkWatcherName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkWatcherName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - networkWatcherName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Deletes the specified network watcher resource. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String networkWatcherName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, networkWatcherName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deletes the specified network watcher resource. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String networkWatcherName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(resourceGroupName, networkWatcherName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes the specified network watcher resource. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete(String resourceGroupName, String networkWatcherName) { - return beginDeleteAsync(resourceGroupName, networkWatcherName).getSyncPoller(); - } - - /** - * Deletes the specified network watcher resource. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String networkWatcherName, Context context) { - return beginDeleteAsync(resourceGroupName, networkWatcherName, context).getSyncPoller(); - } - - /** - * Deletes the specified network watcher resource. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String networkWatcherName) { - return beginDeleteAsync(resourceGroupName, networkWatcherName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified network watcher resource. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String networkWatcherName, Context context) { - return beginDeleteAsync(resourceGroupName, networkWatcherName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified network watcher resource. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String networkWatcherName) { - deleteAsync(resourceGroupName, networkWatcherName).block(); - } - - /** - * Deletes the specified network watcher resource. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String networkWatcherName, Context context) { - deleteAsync(resourceGroupName, networkWatcherName, context).block(); - } - - /** - * Updates a network watcher tags. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters supplied to update network watcher tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return network watcher in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateTagsWithResponseAsync( - String resourceGroupName, String networkWatcherName, TagsObject parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkWatcherName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updateTags( - this.client.getEndpoint(), - resourceGroupName, - networkWatcherName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates a network watcher tags. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters supplied to update network watcher tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return network watcher in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateTagsWithResponseAsync( - String resourceGroupName, String networkWatcherName, TagsObject parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkWatcherName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updateTags( - this.client.getEndpoint(), - resourceGroupName, - networkWatcherName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Updates a network watcher tags. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters supplied to update network watcher tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return network watcher in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateTagsAsync( - String resourceGroupName, String networkWatcherName, TagsObject parameters) { - return updateTagsWithResponseAsync(resourceGroupName, networkWatcherName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Updates a network watcher tags. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters supplied to update network watcher tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return network watcher in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public NetworkWatcherInner updateTags(String resourceGroupName, String networkWatcherName, TagsObject parameters) { - return updateTagsAsync(resourceGroupName, networkWatcherName, parameters).block(); - } - - /** - * Updates a network watcher tags. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters supplied to update network watcher tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return network watcher in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateTagsWithResponse( - String resourceGroupName, String networkWatcherName, TagsObject parameters, Context context) { - return updateTagsWithResponseAsync(resourceGroupName, networkWatcherName, parameters, context).block(); - } - - /** - * Gets all network watchers by resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network watchers by resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all network watchers by resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network watchers by resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); - } - - /** - * Gets all network watchers by resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network watchers by resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName)); - } - - /** - * Gets all network watchers by resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network watchers by resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context)); - } - - /** - * Gets all network watchers by resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network watchers by resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * Gets all network watchers by resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network watchers by resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * Gets all network watchers by subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network watchers by subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all network watchers by subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network watchers by subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); - } - - /** - * Gets all network watchers by subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network watchers by subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync()); - } - - /** - * Gets all network watchers by subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network watchers by subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context)); - } - - /** - * Gets all network watchers by subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network watchers by subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Gets all network watchers by subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all network watchers by subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Gets the current network topology by resource group. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters that define the representation of topology. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the current network topology by resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getTopologyWithResponseAsync( - String resourceGroupName, String networkWatcherName, TopologyParameters parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkWatcherName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getTopology( - this.client.getEndpoint(), - resourceGroupName, - networkWatcherName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the current network topology by resource group. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters that define the representation of topology. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the current network topology by resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getTopologyWithResponseAsync( - String resourceGroupName, String networkWatcherName, TopologyParameters parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkWatcherName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getTopology( - this.client.getEndpoint(), - resourceGroupName, - networkWatcherName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Gets the current network topology by resource group. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters that define the representation of topology. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the current network topology by resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getTopologyAsync( - String resourceGroupName, String networkWatcherName, TopologyParameters parameters) { - return getTopologyWithResponseAsync(resourceGroupName, networkWatcherName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the current network topology by resource group. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters that define the representation of topology. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the current network topology by resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public TopologyInner getTopology( - String resourceGroupName, String networkWatcherName, TopologyParameters parameters) { - return getTopologyAsync(resourceGroupName, networkWatcherName, parameters).block(); - } - - /** - * Gets the current network topology by resource group. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters that define the representation of topology. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the current network topology by resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getTopologyWithResponse( - String resourceGroupName, String networkWatcherName, TopologyParameters parameters, Context context) { - return getTopologyWithResponseAsync(resourceGroupName, networkWatcherName, parameters, context).block(); - } - - /** - * Verify IP flow from the specified VM to a location given the currently configured NSG rules. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters that define the IP flow to be verified. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return results of IP flow verification on the target resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> verifyIpFlowWithResponseAsync( - String resourceGroupName, String networkWatcherName, VerificationIpFlowParameters parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkWatcherName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .verifyIpFlow( - this.client.getEndpoint(), - resourceGroupName, - networkWatcherName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Verify IP flow from the specified VM to a location given the currently configured NSG rules. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters that define the IP flow to be verified. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return results of IP flow verification on the target resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> verifyIpFlowWithResponseAsync( - String resourceGroupName, String networkWatcherName, VerificationIpFlowParameters parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkWatcherName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .verifyIpFlow( - this.client.getEndpoint(), - resourceGroupName, - networkWatcherName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Verify IP flow from the specified VM to a location given the currently configured NSG rules. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters that define the IP flow to be verified. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return results of IP flow verification on the target resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, VerificationIpFlowResultInner> beginVerifyIpFlowAsync( - String resourceGroupName, String networkWatcherName, VerificationIpFlowParameters parameters) { - Mono>> mono = - verifyIpFlowWithResponseAsync(resourceGroupName, networkWatcherName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VerificationIpFlowResultInner.class, - VerificationIpFlowResultInner.class, - Context.NONE); - } - - /** - * Verify IP flow from the specified VM to a location given the currently configured NSG rules. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters that define the IP flow to be verified. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return results of IP flow verification on the target resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, VerificationIpFlowResultInner> beginVerifyIpFlowAsync( - String resourceGroupName, String networkWatcherName, VerificationIpFlowParameters parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - verifyIpFlowWithResponseAsync(resourceGroupName, networkWatcherName, parameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VerificationIpFlowResultInner.class, - VerificationIpFlowResultInner.class, - context); - } - - /** - * Verify IP flow from the specified VM to a location given the currently configured NSG rules. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters that define the IP flow to be verified. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return results of IP flow verification on the target resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VerificationIpFlowResultInner> beginVerifyIpFlow( - String resourceGroupName, String networkWatcherName, VerificationIpFlowParameters parameters) { - return beginVerifyIpFlowAsync(resourceGroupName, networkWatcherName, parameters).getSyncPoller(); - } - - /** - * Verify IP flow from the specified VM to a location given the currently configured NSG rules. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters that define the IP flow to be verified. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return results of IP flow verification on the target resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VerificationIpFlowResultInner> beginVerifyIpFlow( - String resourceGroupName, String networkWatcherName, VerificationIpFlowParameters parameters, Context context) { - return beginVerifyIpFlowAsync(resourceGroupName, networkWatcherName, parameters, context).getSyncPoller(); - } - - /** - * Verify IP flow from the specified VM to a location given the currently configured NSG rules. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters that define the IP flow to be verified. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return results of IP flow verification on the target resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono verifyIpFlowAsync( - String resourceGroupName, String networkWatcherName, VerificationIpFlowParameters parameters) { - return beginVerifyIpFlowAsync(resourceGroupName, networkWatcherName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Verify IP flow from the specified VM to a location given the currently configured NSG rules. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters that define the IP flow to be verified. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return results of IP flow verification on the target resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono verifyIpFlowAsync( - String resourceGroupName, String networkWatcherName, VerificationIpFlowParameters parameters, Context context) { - return beginVerifyIpFlowAsync(resourceGroupName, networkWatcherName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Verify IP flow from the specified VM to a location given the currently configured NSG rules. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters that define the IP flow to be verified. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return results of IP flow verification on the target resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VerificationIpFlowResultInner verifyIpFlow( - String resourceGroupName, String networkWatcherName, VerificationIpFlowParameters parameters) { - return verifyIpFlowAsync(resourceGroupName, networkWatcherName, parameters).block(); - } - - /** - * Verify IP flow from the specified VM to a location given the currently configured NSG rules. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters that define the IP flow to be verified. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return results of IP flow verification on the target resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VerificationIpFlowResultInner verifyIpFlow( - String resourceGroupName, String networkWatcherName, VerificationIpFlowParameters parameters, Context context) { - return verifyIpFlowAsync(resourceGroupName, networkWatcherName, parameters, context).block(); - } - - /** - * Gets the next hop from the specified VM. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters that define the source and destination endpoint. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the next hop from the specified VM. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> getNextHopWithResponseAsync( - String resourceGroupName, String networkWatcherName, NextHopParameters parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkWatcherName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getNextHop( - this.client.getEndpoint(), - resourceGroupName, - networkWatcherName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the next hop from the specified VM. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters that define the source and destination endpoint. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the next hop from the specified VM. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> getNextHopWithResponseAsync( - String resourceGroupName, String networkWatcherName, NextHopParameters parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkWatcherName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getNextHop( - this.client.getEndpoint(), - resourceGroupName, - networkWatcherName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Gets the next hop from the specified VM. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters that define the source and destination endpoint. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the next hop from the specified VM. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, NextHopResultInner> beginGetNextHopAsync( - String resourceGroupName, String networkWatcherName, NextHopParameters parameters) { - Mono>> mono = - getNextHopWithResponseAsync(resourceGroupName, networkWatcherName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - NextHopResultInner.class, - NextHopResultInner.class, - this.client.getContext()); - } - - /** - * Gets the next hop from the specified VM. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters that define the source and destination endpoint. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the next hop from the specified VM. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, NextHopResultInner> beginGetNextHopAsync( - String resourceGroupName, String networkWatcherName, NextHopParameters parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - getNextHopWithResponseAsync(resourceGroupName, networkWatcherName, parameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), NextHopResultInner.class, NextHopResultInner.class, context); - } - - /** - * Gets the next hop from the specified VM. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters that define the source and destination endpoint. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the next hop from the specified VM. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, NextHopResultInner> beginGetNextHop( - String resourceGroupName, String networkWatcherName, NextHopParameters parameters) { - return beginGetNextHopAsync(resourceGroupName, networkWatcherName, parameters).getSyncPoller(); - } - - /** - * Gets the next hop from the specified VM. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters that define the source and destination endpoint. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the next hop from the specified VM. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, NextHopResultInner> beginGetNextHop( - String resourceGroupName, String networkWatcherName, NextHopParameters parameters, Context context) { - return beginGetNextHopAsync(resourceGroupName, networkWatcherName, parameters, context).getSyncPoller(); - } - - /** - * Gets the next hop from the specified VM. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters that define the source and destination endpoint. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the next hop from the specified VM. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getNextHopAsync( - String resourceGroupName, String networkWatcherName, NextHopParameters parameters) { - return beginGetNextHopAsync(resourceGroupName, networkWatcherName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Gets the next hop from the specified VM. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters that define the source and destination endpoint. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the next hop from the specified VM. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getNextHopAsync( - String resourceGroupName, String networkWatcherName, NextHopParameters parameters, Context context) { - return beginGetNextHopAsync(resourceGroupName, networkWatcherName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Gets the next hop from the specified VM. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters that define the source and destination endpoint. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the next hop from the specified VM. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public NextHopResultInner getNextHop( - String resourceGroupName, String networkWatcherName, NextHopParameters parameters) { - return getNextHopAsync(resourceGroupName, networkWatcherName, parameters).block(); - } - - /** - * Gets the next hop from the specified VM. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters that define the source and destination endpoint. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the next hop from the specified VM. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public NextHopResultInner getNextHop( - String resourceGroupName, String networkWatcherName, NextHopParameters parameters, Context context) { - return getNextHopAsync(resourceGroupName, networkWatcherName, parameters, context).block(); - } - - /** - * Gets the configured and effective security group rules on the specified VM. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters that define the VM to check security groups for. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the configured and effective security group rules on the specified VM. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> getVMSecurityRulesWithResponseAsync( - String resourceGroupName, String networkWatcherName, SecurityGroupViewParameters parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkWatcherName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getVMSecurityRules( - this.client.getEndpoint(), - resourceGroupName, - networkWatcherName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the configured and effective security group rules on the specified VM. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters that define the VM to check security groups for. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the configured and effective security group rules on the specified VM. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> getVMSecurityRulesWithResponseAsync( - String resourceGroupName, String networkWatcherName, SecurityGroupViewParameters parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkWatcherName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getVMSecurityRules( - this.client.getEndpoint(), - resourceGroupName, - networkWatcherName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Gets the configured and effective security group rules on the specified VM. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters that define the VM to check security groups for. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the configured and effective security group rules on the specified VM. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, SecurityGroupViewResultInner> - beginGetVMSecurityRulesAsync( - String resourceGroupName, String networkWatcherName, SecurityGroupViewParameters parameters) { - Mono>> mono = - getVMSecurityRulesWithResponseAsync(resourceGroupName, networkWatcherName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - SecurityGroupViewResultInner.class, - SecurityGroupViewResultInner.class, - Context.NONE); - } - - /** - * Gets the configured and effective security group rules on the specified VM. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters that define the VM to check security groups for. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the configured and effective security group rules on the specified VM. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, SecurityGroupViewResultInner> - beginGetVMSecurityRulesAsync( - String resourceGroupName, - String networkWatcherName, - SecurityGroupViewParameters parameters, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - getVMSecurityRulesWithResponseAsync(resourceGroupName, networkWatcherName, parameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - SecurityGroupViewResultInner.class, - SecurityGroupViewResultInner.class, - context); - } - - /** - * Gets the configured and effective security group rules on the specified VM. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters that define the VM to check security groups for. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the configured and effective security group rules on the specified VM. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, SecurityGroupViewResultInner> beginGetVMSecurityRules( - String resourceGroupName, String networkWatcherName, SecurityGroupViewParameters parameters) { - return beginGetVMSecurityRulesAsync(resourceGroupName, networkWatcherName, parameters).getSyncPoller(); - } - - /** - * Gets the configured and effective security group rules on the specified VM. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters that define the VM to check security groups for. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the configured and effective security group rules on the specified VM. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, SecurityGroupViewResultInner> beginGetVMSecurityRules( - String resourceGroupName, String networkWatcherName, SecurityGroupViewParameters parameters, Context context) { - return beginGetVMSecurityRulesAsync(resourceGroupName, networkWatcherName, parameters, context).getSyncPoller(); - } - - /** - * Gets the configured and effective security group rules on the specified VM. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters that define the VM to check security groups for. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the configured and effective security group rules on the specified VM. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getVMSecurityRulesAsync( - String resourceGroupName, String networkWatcherName, SecurityGroupViewParameters parameters) { - return beginGetVMSecurityRulesAsync(resourceGroupName, networkWatcherName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Gets the configured and effective security group rules on the specified VM. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters that define the VM to check security groups for. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the configured and effective security group rules on the specified VM. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getVMSecurityRulesAsync( - String resourceGroupName, String networkWatcherName, SecurityGroupViewParameters parameters, Context context) { - return beginGetVMSecurityRulesAsync(resourceGroupName, networkWatcherName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Gets the configured and effective security group rules on the specified VM. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters that define the VM to check security groups for. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the configured and effective security group rules on the specified VM. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SecurityGroupViewResultInner getVMSecurityRules( - String resourceGroupName, String networkWatcherName, SecurityGroupViewParameters parameters) { - return getVMSecurityRulesAsync(resourceGroupName, networkWatcherName, parameters).block(); - } - - /** - * Gets the configured and effective security group rules on the specified VM. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters that define the VM to check security groups for. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the configured and effective security group rules on the specified VM. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SecurityGroupViewResultInner getVMSecurityRules( - String resourceGroupName, String networkWatcherName, SecurityGroupViewParameters parameters, Context context) { - return getVMSecurityRulesAsync(resourceGroupName, networkWatcherName, parameters, context).block(); - } - - /** - * Initiate troubleshooting on a specified resource. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that define the resource to troubleshoot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return troubleshooting information gained from specified resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> getTroubleshootingWithResponseAsync( - String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkWatcherName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getTroubleshooting( - this.client.getEndpoint(), - resourceGroupName, - networkWatcherName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Initiate troubleshooting on a specified resource. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that define the resource to troubleshoot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return troubleshooting information gained from specified resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> getTroubleshootingWithResponseAsync( - String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkWatcherName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getTroubleshooting( - this.client.getEndpoint(), - resourceGroupName, - networkWatcherName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Initiate troubleshooting on a specified resource. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that define the resource to troubleshoot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return troubleshooting information gained from specified resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, TroubleshootingResultInner> beginGetTroubleshootingAsync( - String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters) { - Mono>> mono = - getTroubleshootingWithResponseAsync(resourceGroupName, networkWatcherName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - TroubleshootingResultInner.class, - TroubleshootingResultInner.class, - Context.NONE); - } - - /** - * Initiate troubleshooting on a specified resource. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that define the resource to troubleshoot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return troubleshooting information gained from specified resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, TroubleshootingResultInner> beginGetTroubleshootingAsync( - String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - getTroubleshootingWithResponseAsync(resourceGroupName, networkWatcherName, parameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - TroubleshootingResultInner.class, - TroubleshootingResultInner.class, - context); - } - - /** - * Initiate troubleshooting on a specified resource. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that define the resource to troubleshoot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return troubleshooting information gained from specified resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, TroubleshootingResultInner> beginGetTroubleshooting( - String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters) { - return beginGetTroubleshootingAsync(resourceGroupName, networkWatcherName, parameters).getSyncPoller(); - } - - /** - * Initiate troubleshooting on a specified resource. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that define the resource to troubleshoot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return troubleshooting information gained from specified resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, TroubleshootingResultInner> beginGetTroubleshooting( - String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters, Context context) { - return beginGetTroubleshootingAsync(resourceGroupName, networkWatcherName, parameters, context).getSyncPoller(); - } - - /** - * Initiate troubleshooting on a specified resource. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that define the resource to troubleshoot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return troubleshooting information gained from specified resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getTroubleshootingAsync( - String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters) { - return beginGetTroubleshootingAsync(resourceGroupName, networkWatcherName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Initiate troubleshooting on a specified resource. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that define the resource to troubleshoot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return troubleshooting information gained from specified resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getTroubleshootingAsync( - String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters, Context context) { - return beginGetTroubleshootingAsync(resourceGroupName, networkWatcherName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Initiate troubleshooting on a specified resource. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that define the resource to troubleshoot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return troubleshooting information gained from specified resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public TroubleshootingResultInner getTroubleshooting( - String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters) { - return getTroubleshootingAsync(resourceGroupName, networkWatcherName, parameters).block(); - } - - /** - * Initiate troubleshooting on a specified resource. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that define the resource to troubleshoot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return troubleshooting information gained from specified resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public TroubleshootingResultInner getTroubleshooting( - String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters, Context context) { - return getTroubleshootingAsync(resourceGroupName, networkWatcherName, parameters, context).block(); - } - - /** - * Get the last completed troubleshooting result on a specified resource. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that define the resource to query the troubleshooting result. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the last completed troubleshooting result on a specified resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> getTroubleshootingResultWithResponseAsync( - String resourceGroupName, String networkWatcherName, QueryTroubleshootingParameters parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkWatcherName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getTroubleshootingResult( - this.client.getEndpoint(), - resourceGroupName, - networkWatcherName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the last completed troubleshooting result on a specified resource. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that define the resource to query the troubleshooting result. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the last completed troubleshooting result on a specified resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> getTroubleshootingResultWithResponseAsync( - String resourceGroupName, - String networkWatcherName, - QueryTroubleshootingParameters parameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkWatcherName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getTroubleshootingResult( - this.client.getEndpoint(), - resourceGroupName, - networkWatcherName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Get the last completed troubleshooting result on a specified resource. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that define the resource to query the troubleshooting result. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the last completed troubleshooting result on a specified resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, TroubleshootingResultInner> - beginGetTroubleshootingResultAsync( - String resourceGroupName, String networkWatcherName, QueryTroubleshootingParameters parameters) { - Mono>> mono = - getTroubleshootingResultWithResponseAsync(resourceGroupName, networkWatcherName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - TroubleshootingResultInner.class, - TroubleshootingResultInner.class, - Context.NONE); - } - - /** - * Get the last completed troubleshooting result on a specified resource. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that define the resource to query the troubleshooting result. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the last completed troubleshooting result on a specified resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, TroubleshootingResultInner> - beginGetTroubleshootingResultAsync( - String resourceGroupName, - String networkWatcherName, - QueryTroubleshootingParameters parameters, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - getTroubleshootingResultWithResponseAsync(resourceGroupName, networkWatcherName, parameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - TroubleshootingResultInner.class, - TroubleshootingResultInner.class, - context); - } - - /** - * Get the last completed troubleshooting result on a specified resource. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that define the resource to query the troubleshooting result. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the last completed troubleshooting result on a specified resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, TroubleshootingResultInner> beginGetTroubleshootingResult( - String resourceGroupName, String networkWatcherName, QueryTroubleshootingParameters parameters) { - return beginGetTroubleshootingResultAsync(resourceGroupName, networkWatcherName, parameters).getSyncPoller(); - } - - /** - * Get the last completed troubleshooting result on a specified resource. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that define the resource to query the troubleshooting result. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the last completed troubleshooting result on a specified resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, TroubleshootingResultInner> beginGetTroubleshootingResult( - String resourceGroupName, - String networkWatcherName, - QueryTroubleshootingParameters parameters, - Context context) { - return beginGetTroubleshootingResultAsync(resourceGroupName, networkWatcherName, parameters, context) - .getSyncPoller(); - } - - /** - * Get the last completed troubleshooting result on a specified resource. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that define the resource to query the troubleshooting result. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the last completed troubleshooting result on a specified resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getTroubleshootingResultAsync( - String resourceGroupName, String networkWatcherName, QueryTroubleshootingParameters parameters) { - return beginGetTroubleshootingResultAsync(resourceGroupName, networkWatcherName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Get the last completed troubleshooting result on a specified resource. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that define the resource to query the troubleshooting result. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the last completed troubleshooting result on a specified resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getTroubleshootingResultAsync( - String resourceGroupName, - String networkWatcherName, - QueryTroubleshootingParameters parameters, - Context context) { - return beginGetTroubleshootingResultAsync(resourceGroupName, networkWatcherName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Get the last completed troubleshooting result on a specified resource. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that define the resource to query the troubleshooting result. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the last completed troubleshooting result on a specified resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public TroubleshootingResultInner getTroubleshootingResult( - String resourceGroupName, String networkWatcherName, QueryTroubleshootingParameters parameters) { - return getTroubleshootingResultAsync(resourceGroupName, networkWatcherName, parameters).block(); - } - - /** - * Get the last completed troubleshooting result on a specified resource. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that define the resource to query the troubleshooting result. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the last completed troubleshooting result on a specified resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public TroubleshootingResultInner getTroubleshootingResult( - String resourceGroupName, - String networkWatcherName, - QueryTroubleshootingParameters parameters, - Context context) { - return getTroubleshootingResultAsync(resourceGroupName, networkWatcherName, parameters, context).block(); - } - - /** - * Configures flow log and traffic analytics (optional) on a specified resource. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that define the configuration of flow log. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information on the configuration of flow log and traffic analytics (optional). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> setFlowLogConfigurationWithResponseAsync( - String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkWatcherName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .setFlowLogConfiguration( - this.client.getEndpoint(), - resourceGroupName, - networkWatcherName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Configures flow log and traffic analytics (optional) on a specified resource. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that define the configuration of flow log. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information on the configuration of flow log and traffic analytics (optional). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> setFlowLogConfigurationWithResponseAsync( - String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkWatcherName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .setFlowLogConfiguration( - this.client.getEndpoint(), - resourceGroupName, - networkWatcherName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Configures flow log and traffic analytics (optional) on a specified resource. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that define the configuration of flow log. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information on the configuration of flow log and traffic analytics (optional). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, FlowLogInformationInner> beginSetFlowLogConfigurationAsync( - String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters) { - Mono>> mono = - setFlowLogConfigurationWithResponseAsync(resourceGroupName, networkWatcherName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - FlowLogInformationInner.class, - FlowLogInformationInner.class, - Context.NONE); - } - - /** - * Configures flow log and traffic analytics (optional) on a specified resource. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that define the configuration of flow log. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information on the configuration of flow log and traffic analytics (optional). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, FlowLogInformationInner> beginSetFlowLogConfigurationAsync( - String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - setFlowLogConfigurationWithResponseAsync(resourceGroupName, networkWatcherName, parameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - FlowLogInformationInner.class, - FlowLogInformationInner.class, - context); - } - - /** - * Configures flow log and traffic analytics (optional) on a specified resource. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that define the configuration of flow log. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information on the configuration of flow log and traffic analytics (optional). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, FlowLogInformationInner> beginSetFlowLogConfiguration( - String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters) { - return beginSetFlowLogConfigurationAsync(resourceGroupName, networkWatcherName, parameters).getSyncPoller(); - } - - /** - * Configures flow log and traffic analytics (optional) on a specified resource. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that define the configuration of flow log. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information on the configuration of flow log and traffic analytics (optional). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, FlowLogInformationInner> beginSetFlowLogConfiguration( - String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters, Context context) { - return beginSetFlowLogConfigurationAsync(resourceGroupName, networkWatcherName, parameters, context) - .getSyncPoller(); - } - - /** - * Configures flow log and traffic analytics (optional) on a specified resource. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that define the configuration of flow log. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information on the configuration of flow log and traffic analytics (optional). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono setFlowLogConfigurationAsync( - String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters) { - return beginSetFlowLogConfigurationAsync(resourceGroupName, networkWatcherName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Configures flow log and traffic analytics (optional) on a specified resource. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that define the configuration of flow log. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information on the configuration of flow log and traffic analytics (optional). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono setFlowLogConfigurationAsync( - String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters, Context context) { - return beginSetFlowLogConfigurationAsync(resourceGroupName, networkWatcherName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Configures flow log and traffic analytics (optional) on a specified resource. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that define the configuration of flow log. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information on the configuration of flow log and traffic analytics (optional). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public FlowLogInformationInner setFlowLogConfiguration( - String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters) { - return setFlowLogConfigurationAsync(resourceGroupName, networkWatcherName, parameters).block(); - } - - /** - * Configures flow log and traffic analytics (optional) on a specified resource. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that define the configuration of flow log. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information on the configuration of flow log and traffic analytics (optional). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public FlowLogInformationInner setFlowLogConfiguration( - String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters, Context context) { - return setFlowLogConfigurationAsync(resourceGroupName, networkWatcherName, parameters, context).block(); - } - - /** - * Queries status of flow log and traffic analytics (optional) on a specified resource. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that define a resource to query flow log and traffic analytics (optional) status. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information on the configuration of flow log and traffic analytics (optional). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> getFlowLogStatusWithResponseAsync( - String resourceGroupName, String networkWatcherName, FlowLogStatusParameters parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkWatcherName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getFlowLogStatus( - this.client.getEndpoint(), - resourceGroupName, - networkWatcherName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Queries status of flow log and traffic analytics (optional) on a specified resource. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that define a resource to query flow log and traffic analytics (optional) status. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information on the configuration of flow log and traffic analytics (optional). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> getFlowLogStatusWithResponseAsync( - String resourceGroupName, String networkWatcherName, FlowLogStatusParameters parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkWatcherName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getFlowLogStatus( - this.client.getEndpoint(), - resourceGroupName, - networkWatcherName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Queries status of flow log and traffic analytics (optional) on a specified resource. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that define a resource to query flow log and traffic analytics (optional) status. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information on the configuration of flow log and traffic analytics (optional). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, FlowLogInformationInner> beginGetFlowLogStatusAsync( - String resourceGroupName, String networkWatcherName, FlowLogStatusParameters parameters) { - Mono>> mono = - getFlowLogStatusWithResponseAsync(resourceGroupName, networkWatcherName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - FlowLogInformationInner.class, - FlowLogInformationInner.class, - Context.NONE); - } - - /** - * Queries status of flow log and traffic analytics (optional) on a specified resource. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that define a resource to query flow log and traffic analytics (optional) status. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information on the configuration of flow log and traffic analytics (optional). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, FlowLogInformationInner> beginGetFlowLogStatusAsync( - String resourceGroupName, String networkWatcherName, FlowLogStatusParameters parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - getFlowLogStatusWithResponseAsync(resourceGroupName, networkWatcherName, parameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - FlowLogInformationInner.class, - FlowLogInformationInner.class, - context); - } - - /** - * Queries status of flow log and traffic analytics (optional) on a specified resource. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that define a resource to query flow log and traffic analytics (optional) status. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information on the configuration of flow log and traffic analytics (optional). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, FlowLogInformationInner> beginGetFlowLogStatus( - String resourceGroupName, String networkWatcherName, FlowLogStatusParameters parameters) { - return beginGetFlowLogStatusAsync(resourceGroupName, networkWatcherName, parameters).getSyncPoller(); - } - - /** - * Queries status of flow log and traffic analytics (optional) on a specified resource. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that define a resource to query flow log and traffic analytics (optional) status. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information on the configuration of flow log and traffic analytics (optional). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, FlowLogInformationInner> beginGetFlowLogStatus( - String resourceGroupName, String networkWatcherName, FlowLogStatusParameters parameters, Context context) { - return beginGetFlowLogStatusAsync(resourceGroupName, networkWatcherName, parameters, context).getSyncPoller(); - } - - /** - * Queries status of flow log and traffic analytics (optional) on a specified resource. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that define a resource to query flow log and traffic analytics (optional) status. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information on the configuration of flow log and traffic analytics (optional). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getFlowLogStatusAsync( - String resourceGroupName, String networkWatcherName, FlowLogStatusParameters parameters) { - return beginGetFlowLogStatusAsync(resourceGroupName, networkWatcherName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Queries status of flow log and traffic analytics (optional) on a specified resource. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that define a resource to query flow log and traffic analytics (optional) status. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information on the configuration of flow log and traffic analytics (optional). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getFlowLogStatusAsync( - String resourceGroupName, String networkWatcherName, FlowLogStatusParameters parameters, Context context) { - return beginGetFlowLogStatusAsync(resourceGroupName, networkWatcherName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Queries status of flow log and traffic analytics (optional) on a specified resource. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that define a resource to query flow log and traffic analytics (optional) status. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information on the configuration of flow log and traffic analytics (optional). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public FlowLogInformationInner getFlowLogStatus( - String resourceGroupName, String networkWatcherName, FlowLogStatusParameters parameters) { - return getFlowLogStatusAsync(resourceGroupName, networkWatcherName, parameters).block(); - } - - /** - * Queries status of flow log and traffic analytics (optional) on a specified resource. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that define a resource to query flow log and traffic analytics (optional) status. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information on the configuration of flow log and traffic analytics (optional). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public FlowLogInformationInner getFlowLogStatus( - String resourceGroupName, String networkWatcherName, FlowLogStatusParameters parameters, Context context) { - return getFlowLogStatusAsync(resourceGroupName, networkWatcherName, parameters, context).block(); - } - - /** - * Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint - * including another VM or an arbitrary remote server. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that determine how the connectivity check will be performed. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information on the connectivity status. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> checkConnectivityWithResponseAsync( - String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkWatcherName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .checkConnectivity( - this.client.getEndpoint(), - resourceGroupName, - networkWatcherName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint - * including another VM or an arbitrary remote server. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that determine how the connectivity check will be performed. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information on the connectivity status. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> checkConnectivityWithResponseAsync( - String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkWatcherName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .checkConnectivity( - this.client.getEndpoint(), - resourceGroupName, - networkWatcherName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint - * including another VM or an arbitrary remote server. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that determine how the connectivity check will be performed. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information on the connectivity status. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, ConnectivityInformationInner> - beginCheckConnectivityAsync( - String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters) { - Mono>> mono = - checkConnectivityWithResponseAsync(resourceGroupName, networkWatcherName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ConnectivityInformationInner.class, - ConnectivityInformationInner.class, - Context.NONE); - } - - /** - * Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint - * including another VM or an arbitrary remote server. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that determine how the connectivity check will be performed. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information on the connectivity status. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, ConnectivityInformationInner> - beginCheckConnectivityAsync( - String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - checkConnectivityWithResponseAsync(resourceGroupName, networkWatcherName, parameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ConnectivityInformationInner.class, - ConnectivityInformationInner.class, - context); - } - - /** - * Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint - * including another VM or an arbitrary remote server. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that determine how the connectivity check will be performed. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information on the connectivity status. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, ConnectivityInformationInner> beginCheckConnectivity( - String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters) { - return beginCheckConnectivityAsync(resourceGroupName, networkWatcherName, parameters).getSyncPoller(); - } - - /** - * Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint - * including another VM or an arbitrary remote server. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that determine how the connectivity check will be performed. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information on the connectivity status. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, ConnectivityInformationInner> beginCheckConnectivity( - String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters, Context context) { - return beginCheckConnectivityAsync(resourceGroupName, networkWatcherName, parameters, context).getSyncPoller(); - } - - /** - * Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint - * including another VM or an arbitrary remote server. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that determine how the connectivity check will be performed. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information on the connectivity status. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono checkConnectivityAsync( - String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters) { - return beginCheckConnectivityAsync(resourceGroupName, networkWatcherName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint - * including another VM or an arbitrary remote server. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that determine how the connectivity check will be performed. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information on the connectivity status. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono checkConnectivityAsync( - String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters, Context context) { - return beginCheckConnectivityAsync(resourceGroupName, networkWatcherName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint - * including another VM or an arbitrary remote server. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that determine how the connectivity check will be performed. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information on the connectivity status. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ConnectivityInformationInner checkConnectivity( - String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters) { - return checkConnectivityAsync(resourceGroupName, networkWatcherName, parameters).block(); - } - - /** - * Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint - * including another VM or an arbitrary remote server. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that determine how the connectivity check will be performed. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information on the connectivity status. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ConnectivityInformationInner checkConnectivity( - String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters, Context context) { - return checkConnectivityAsync(resourceGroupName, networkWatcherName, parameters, context).block(); - } - - /** - * Gets the relative latency score for internet service providers from a specified location to Azure regions. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that determine Azure reachability report configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the relative latency score for internet service providers from a specified location to Azure regions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> getAzureReachabilityReportWithResponseAsync( - String resourceGroupName, String networkWatcherName, AzureReachabilityReportParameters parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkWatcherName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getAzureReachabilityReport( - this.client.getEndpoint(), - resourceGroupName, - networkWatcherName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the relative latency score for internet service providers from a specified location to Azure regions. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that determine Azure reachability report configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the relative latency score for internet service providers from a specified location to Azure regions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> getAzureReachabilityReportWithResponseAsync( - String resourceGroupName, - String networkWatcherName, - AzureReachabilityReportParameters parameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkWatcherName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getAzureReachabilityReport( - this.client.getEndpoint(), - resourceGroupName, - networkWatcherName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Gets the relative latency score for internet service providers from a specified location to Azure regions. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that determine Azure reachability report configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the relative latency score for internet service providers from a specified location to Azure regions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, AzureReachabilityReportInner> - beginGetAzureReachabilityReportAsync( - String resourceGroupName, String networkWatcherName, AzureReachabilityReportParameters parameters) { - Mono>> mono = - getAzureReachabilityReportWithResponseAsync(resourceGroupName, networkWatcherName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - AzureReachabilityReportInner.class, - AzureReachabilityReportInner.class, - Context.NONE); - } - - /** - * Gets the relative latency score for internet service providers from a specified location to Azure regions. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that determine Azure reachability report configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the relative latency score for internet service providers from a specified location to Azure regions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, AzureReachabilityReportInner> - beginGetAzureReachabilityReportAsync( - String resourceGroupName, - String networkWatcherName, - AzureReachabilityReportParameters parameters, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - getAzureReachabilityReportWithResponseAsync(resourceGroupName, networkWatcherName, parameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - AzureReachabilityReportInner.class, - AzureReachabilityReportInner.class, - context); - } - - /** - * Gets the relative latency score for internet service providers from a specified location to Azure regions. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that determine Azure reachability report configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the relative latency score for internet service providers from a specified location to Azure regions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, AzureReachabilityReportInner> - beginGetAzureReachabilityReport( - String resourceGroupName, String networkWatcherName, AzureReachabilityReportParameters parameters) { - return beginGetAzureReachabilityReportAsync(resourceGroupName, networkWatcherName, parameters).getSyncPoller(); - } - - /** - * Gets the relative latency score for internet service providers from a specified location to Azure regions. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that determine Azure reachability report configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the relative latency score for internet service providers from a specified location to Azure regions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, AzureReachabilityReportInner> - beginGetAzureReachabilityReport( - String resourceGroupName, - String networkWatcherName, - AzureReachabilityReportParameters parameters, - Context context) { - return beginGetAzureReachabilityReportAsync(resourceGroupName, networkWatcherName, parameters, context) - .getSyncPoller(); - } - - /** - * Gets the relative latency score for internet service providers from a specified location to Azure regions. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that determine Azure reachability report configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the relative latency score for internet service providers from a specified location to Azure regions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAzureReachabilityReportAsync( - String resourceGroupName, String networkWatcherName, AzureReachabilityReportParameters parameters) { - return beginGetAzureReachabilityReportAsync(resourceGroupName, networkWatcherName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Gets the relative latency score for internet service providers from a specified location to Azure regions. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that determine Azure reachability report configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the relative latency score for internet service providers from a specified location to Azure regions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAzureReachabilityReportAsync( - String resourceGroupName, - String networkWatcherName, - AzureReachabilityReportParameters parameters, - Context context) { - return beginGetAzureReachabilityReportAsync(resourceGroupName, networkWatcherName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Gets the relative latency score for internet service providers from a specified location to Azure regions. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that determine Azure reachability report configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the relative latency score for internet service providers from a specified location to Azure regions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AzureReachabilityReportInner getAzureReachabilityReport( - String resourceGroupName, String networkWatcherName, AzureReachabilityReportParameters parameters) { - return getAzureReachabilityReportAsync(resourceGroupName, networkWatcherName, parameters).block(); - } - - /** - * Gets the relative latency score for internet service providers from a specified location to Azure regions. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that determine Azure reachability report configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the relative latency score for internet service providers from a specified location to Azure regions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AzureReachabilityReportInner getAzureReachabilityReport( - String resourceGroupName, - String networkWatcherName, - AzureReachabilityReportParameters parameters, - Context context) { - return getAzureReachabilityReportAsync(resourceGroupName, networkWatcherName, parameters, context).block(); - } - - /** - * Lists all available internet service providers for a specified Azure region. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that scope the list of available providers. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of available countries with details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> listAvailableProvidersWithResponseAsync( - String resourceGroupName, String networkWatcherName, AvailableProvidersListParameters parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkWatcherName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listAvailableProviders( - this.client.getEndpoint(), - resourceGroupName, - networkWatcherName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all available internet service providers for a specified Azure region. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that scope the list of available providers. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of available countries with details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> listAvailableProvidersWithResponseAsync( - String resourceGroupName, - String networkWatcherName, - AvailableProvidersListParameters parameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkWatcherName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listAvailableProviders( - this.client.getEndpoint(), - resourceGroupName, - networkWatcherName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Lists all available internet service providers for a specified Azure region. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that scope the list of available providers. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of available countries with details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, AvailableProvidersListInner> - beginListAvailableProvidersAsync( - String resourceGroupName, String networkWatcherName, AvailableProvidersListParameters parameters) { - Mono>> mono = - listAvailableProvidersWithResponseAsync(resourceGroupName, networkWatcherName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - AvailableProvidersListInner.class, - AvailableProvidersListInner.class, - Context.NONE); - } - - /** - * Lists all available internet service providers for a specified Azure region. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that scope the list of available providers. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of available countries with details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, AvailableProvidersListInner> - beginListAvailableProvidersAsync( - String resourceGroupName, - String networkWatcherName, - AvailableProvidersListParameters parameters, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - listAvailableProvidersWithResponseAsync(resourceGroupName, networkWatcherName, parameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - AvailableProvidersListInner.class, - AvailableProvidersListInner.class, - context); - } - - /** - * Lists all available internet service providers for a specified Azure region. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that scope the list of available providers. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of available countries with details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, AvailableProvidersListInner> beginListAvailableProviders( - String resourceGroupName, String networkWatcherName, AvailableProvidersListParameters parameters) { - return beginListAvailableProvidersAsync(resourceGroupName, networkWatcherName, parameters).getSyncPoller(); - } - - /** - * Lists all available internet service providers for a specified Azure region. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that scope the list of available providers. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of available countries with details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, AvailableProvidersListInner> beginListAvailableProviders( - String resourceGroupName, - String networkWatcherName, - AvailableProvidersListParameters parameters, - Context context) { - return beginListAvailableProvidersAsync(resourceGroupName, networkWatcherName, parameters, context) - .getSyncPoller(); - } - - /** - * Lists all available internet service providers for a specified Azure region. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that scope the list of available providers. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of available countries with details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listAvailableProvidersAsync( - String resourceGroupName, String networkWatcherName, AvailableProvidersListParameters parameters) { - return beginListAvailableProvidersAsync(resourceGroupName, networkWatcherName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Lists all available internet service providers for a specified Azure region. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that scope the list of available providers. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of available countries with details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listAvailableProvidersAsync( - String resourceGroupName, - String networkWatcherName, - AvailableProvidersListParameters parameters, - Context context) { - return beginListAvailableProvidersAsync(resourceGroupName, networkWatcherName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Lists all available internet service providers for a specified Azure region. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that scope the list of available providers. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of available countries with details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AvailableProvidersListInner listAvailableProviders( - String resourceGroupName, String networkWatcherName, AvailableProvidersListParameters parameters) { - return listAvailableProvidersAsync(resourceGroupName, networkWatcherName, parameters).block(); - } - - /** - * Lists all available internet service providers for a specified Azure region. - * - * @param resourceGroupName The name of the network watcher resource group. - * @param networkWatcherName The name of the network watcher resource. - * @param parameters Parameters that scope the list of available providers. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of available countries with details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AvailableProvidersListInner listAvailableProviders( - String resourceGroupName, - String networkWatcherName, - AvailableProvidersListParameters parameters, - Context context) { - return listAvailableProvidersAsync(resourceGroupName, networkWatcherName, parameters, context).block(); - } - - /** - * Get network configuration diagnostic. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters to get network configuration diagnostic. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return network configuration diagnostic. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> getNetworkConfigurationDiagnosticWithResponseAsync( - String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkWatcherName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getNetworkConfigurationDiagnostic( - this.client.getEndpoint(), - resourceGroupName, - networkWatcherName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get network configuration diagnostic. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters to get network configuration diagnostic. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return network configuration diagnostic. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> getNetworkConfigurationDiagnosticWithResponseAsync( - String resourceGroupName, - String networkWatcherName, - NetworkConfigurationDiagnosticParameters parameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkWatcherName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getNetworkConfigurationDiagnostic( - this.client.getEndpoint(), - resourceGroupName, - networkWatcherName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Get network configuration diagnostic. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters to get network configuration diagnostic. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return network configuration diagnostic. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux< - PollResult, NetworkConfigurationDiagnosticResponseInner> - beginGetNetworkConfigurationDiagnosticAsync( - String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters) { - Mono>> mono = - getNetworkConfigurationDiagnosticWithResponseAsync(resourceGroupName, networkWatcherName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - NetworkConfigurationDiagnosticResponseInner.class, - NetworkConfigurationDiagnosticResponseInner.class, - Context.NONE); - } - - /** - * Get network configuration diagnostic. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters to get network configuration diagnostic. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return network configuration diagnostic. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux< - PollResult, NetworkConfigurationDiagnosticResponseInner> - beginGetNetworkConfigurationDiagnosticAsync( - String resourceGroupName, - String networkWatcherName, - NetworkConfigurationDiagnosticParameters parameters, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - getNetworkConfigurationDiagnosticWithResponseAsync( - resourceGroupName, networkWatcherName, parameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - NetworkConfigurationDiagnosticResponseInner.class, - NetworkConfigurationDiagnosticResponseInner.class, - context); - } - - /** - * Get network configuration diagnostic. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters to get network configuration diagnostic. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return network configuration diagnostic. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller< - PollResult, NetworkConfigurationDiagnosticResponseInner> - beginGetNetworkConfigurationDiagnostic( - String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters) { - return beginGetNetworkConfigurationDiagnosticAsync(resourceGroupName, networkWatcherName, parameters) - .getSyncPoller(); - } - - /** - * Get network configuration diagnostic. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters to get network configuration diagnostic. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return network configuration diagnostic. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller< - PollResult, NetworkConfigurationDiagnosticResponseInner> - beginGetNetworkConfigurationDiagnostic( - String resourceGroupName, - String networkWatcherName, - NetworkConfigurationDiagnosticParameters parameters, - Context context) { - return beginGetNetworkConfigurationDiagnosticAsync(resourceGroupName, networkWatcherName, parameters, context) - .getSyncPoller(); - } - - /** - * Get network configuration diagnostic. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters to get network configuration diagnostic. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return network configuration diagnostic. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getNetworkConfigurationDiagnosticAsync( - String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters) { - return beginGetNetworkConfigurationDiagnosticAsync(resourceGroupName, networkWatcherName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Get network configuration diagnostic. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters to get network configuration diagnostic. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return network configuration diagnostic. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getNetworkConfigurationDiagnosticAsync( - String resourceGroupName, - String networkWatcherName, - NetworkConfigurationDiagnosticParameters parameters, - Context context) { - return beginGetNetworkConfigurationDiagnosticAsync(resourceGroupName, networkWatcherName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Get network configuration diagnostic. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters to get network configuration diagnostic. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return network configuration diagnostic. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public NetworkConfigurationDiagnosticResponseInner getNetworkConfigurationDiagnostic( - String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters) { - return getNetworkConfigurationDiagnosticAsync(resourceGroupName, networkWatcherName, parameters).block(); - } - - /** - * Get network configuration diagnostic. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param parameters Parameters to get network configuration diagnostic. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return network configuration diagnostic. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public NetworkConfigurationDiagnosticResponseInner getNetworkConfigurationDiagnostic( - String resourceGroupName, - String networkWatcherName, - NetworkConfigurationDiagnosticParameters parameters, - Context context) { - return getNetworkConfigurationDiagnosticAsync(resourceGroupName, networkWatcherName, parameters, context) - .block(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NetworkWatchersImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NetworkWatchersImpl.java deleted file mode 100644 index 23708c3d9899..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NetworkWatchersImpl.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.network.fluent.NetworkWatchersClient; -import com.azure.resourcemanager.network.fluent.models.NetworkWatcherInner; -import com.azure.resourcemanager.network.models.NetworkWatcher; -import com.azure.resourcemanager.network.models.NetworkWatchers; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.TopLevelModifiableResourcesImpl; - -/** Implementation for Network Watchers. */ -public class NetworkWatchersImpl - extends TopLevelModifiableResourcesImpl< - NetworkWatcher, NetworkWatcherImpl, NetworkWatcherInner, NetworkWatchersClient, NetworkManager> - implements NetworkWatchers { - - public NetworkWatchersImpl(final NetworkManager networkManager) { - super(networkManager.serviceClient().getNetworkWatchers(), networkManager); - } - - @Override - public NetworkWatcherImpl define(String name) { - return wrapModel(name); - } - - // Fluent model create helpers - - @Override - protected NetworkWatcherImpl wrapModel(String name) { - return new NetworkWatcherImpl(name, new NetworkWatcherInner(), super.manager()); - } - - @Override - protected NetworkWatcherImpl wrapModel(NetworkWatcherInner inner) { - if (inner == null) { - return null; - } - return new NetworkWatcherImpl(inner.name(), inner, this.manager()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NetworksImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NetworksImpl.java deleted file mode 100644 index 120133a6ee0e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NetworksImpl.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.network.fluent.VirtualNetworksClient; -import com.azure.resourcemanager.network.fluent.models.SubnetInner; -import com.azure.resourcemanager.network.fluent.models.VirtualNetworkInner; -import com.azure.resourcemanager.network.models.AddressSpace; -import com.azure.resourcemanager.network.models.DhcpOptions; -import com.azure.resourcemanager.network.models.Network; -import com.azure.resourcemanager.network.models.Networks; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.TopLevelModifiableResourcesImpl; - -import java.util.ArrayList; - -/** Implementation for Networks. */ -public class NetworksImpl - extends TopLevelModifiableResourcesImpl< - Network, NetworkImpl, VirtualNetworkInner, VirtualNetworksClient, NetworkManager> - implements Networks { - - public NetworksImpl(final NetworkManager networkManager) { - super(networkManager.serviceClient().getVirtualNetworks(), networkManager); - } - - @Override - public NetworkImpl define(String name) { - return wrapModel(name); - } - - // Fluent model create helpers - - @Override - protected NetworkImpl wrapModel(String name) { - VirtualNetworkInner inner = new VirtualNetworkInner(); - - // Initialize address space - AddressSpace addressSpace = inner.addressSpace(); - if (addressSpace == null) { - addressSpace = new AddressSpace(); - inner.withAddressSpace(addressSpace); - } - - if (addressSpace.addressPrefixes() == null) { - addressSpace.withAddressPrefixes(new ArrayList()); - } - - // Initialize subnets - if (inner.subnets() == null) { - inner.withSubnets(new ArrayList()); - } - - // Initialize DHCP options (DNS servers) - DhcpOptions dhcp = inner.dhcpOptions(); - if (dhcp == null) { - dhcp = new DhcpOptions(); - inner.withDhcpOptions(dhcp); - } - - if (dhcp.dnsServers() == null) { - dhcp.withDnsServers(new ArrayList()); - } - - return new NetworkImpl(name, inner, super.manager()); - } - - @Override - protected NetworkImpl wrapModel(VirtualNetworkInner inner) { - if (inner == null) { - return null; - } - return new NetworkImpl(inner.name(), inner, this.manager()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NextHopImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NextHopImpl.java deleted file mode 100644 index 771b506b0fd2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NextHopImpl.java +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.resourcemanager.network.models.NextHop; -import com.azure.resourcemanager.network.models.NextHopParameters; -import com.azure.resourcemanager.network.models.NextHopType; -import com.azure.resourcemanager.network.fluent.models.NextHopResultInner; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.ExecutableImpl; -import reactor.core.publisher.Mono; - -/** Implementation of NextHop. */ -public class NextHopImpl extends ExecutableImpl implements NextHop, NextHop.Definition { - private final NetworkWatcherImpl parent; - private NextHopParameters parameters = new NextHopParameters(); - private NextHopResultInner result; - - NextHopImpl(NetworkWatcherImpl parent) { - this.parent = parent; - } - - @Override - public NextHopImpl withTargetResourceId(String targetResourceId) { - this.parameters.withTargetResourceId(targetResourceId); - return this; - } - - @Override - public NextHopImpl withSourceIpAddress(String sourceIpAddress) { - this.parameters.withSourceIpAddress(sourceIpAddress); - return this; - } - - @Override - public NextHopImpl withDestinationIpAddress(String destinationIpAddress) { - this.parameters.withDestinationIpAddress(destinationIpAddress); - return this; - } - - @Override - public NextHopImpl withTargetNetworkInterfaceId(String targetNetworkInterfaceId) { - this.parameters.withTargetNicResourceId(targetNetworkInterfaceId); - return this; - } - - @Override - public NetworkWatcherImpl parent() { - return parent; - } - - @Override - public String targetResourceId() { - return parameters.targetResourceId(); - } - - @Override - public String sourceIpAddress() { - return parameters.sourceIpAddress(); - } - - @Override - public String destinationIpAddress() { - return parameters.destinationIpAddress(); - } - - @Override - public String targetNetworkInterfaceId() { - return parameters.destinationIpAddress(); - } - - @Override - public NextHopType nextHopType() { - return result.nextHopType(); - } - - @Override - public String nextHopIpAddress() { - return result.nextHopIpAddress(); - } - - @Override - public String routeTableId() { - return result.routeTableId(); - } - - @Override - public Mono executeWorkAsync() { - return this - .parent() - .manager() - .serviceClient() - .getNetworkWatchers() - .getNextHopAsync(parent.resourceGroupName(), parent.name(), parameters) - .map( - nextHopResultInner -> { - NextHopImpl.this.result = nextHopResultInner; - return NextHopImpl.this; - }); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NicIpConfigurationBaseImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NicIpConfigurationBaseImpl.java deleted file mode 100644 index 8d969ee416ee..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NicIpConfigurationBaseImpl.java +++ /dev/null @@ -1,192 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.management.SubResource; -import com.azure.core.util.CoreUtils; -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.network.fluent.models.ApplicationSecurityGroupInner; -import com.azure.resourcemanager.network.models.ApplicationGatewayBackend; -import com.azure.resourcemanager.network.models.ApplicationSecurityGroup; -import com.azure.resourcemanager.network.models.IpAllocationMethod; -import com.azure.resourcemanager.network.models.IpVersion; -import com.azure.resourcemanager.network.models.LoadBalancer; -import com.azure.resourcemanager.network.models.LoadBalancerBackend; -import com.azure.resourcemanager.network.models.LoadBalancerInboundNatRule; -import com.azure.resourcemanager.network.models.Network; -import com.azure.resourcemanager.network.models.NetworkSecurityGroup; -import com.azure.resourcemanager.network.models.NicIpConfigurationBase; -import com.azure.resourcemanager.network.models.Subnet; -import com.azure.resourcemanager.network.fluent.models.BackendAddressPoolInner; -import com.azure.resourcemanager.network.fluent.models.InboundNatRuleInner; -import com.azure.resourcemanager.network.fluent.models.NetworkInterfaceIpConfigurationInner; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.ChildResourceImpl; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import reactor.core.publisher.Flux; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Locale; -import java.util.Map; - -/** - * Base class implementation for various network interface IP configurations. - * - * @param parent implementation - * @param parent interface - */ -abstract class NicIpConfigurationBaseImpl> - extends ChildResourceImpl - implements NicIpConfigurationBase { - /** the network client. */ - private final NetworkManager networkManager; - - protected NicIpConfigurationBaseImpl( - NetworkInterfaceIpConfigurationInner inner, ParentImplT parent, NetworkManager networkManager) { - super(inner, parent); - this.networkManager = networkManager; - } - - public String name() { - return innerModel().name(); - } - - public boolean isPrimary() { - return ResourceManagerUtils.toPrimitiveBoolean(this.innerModel().primary()); - } - - @Override - public NetworkSecurityGroup getNetworkSecurityGroup() { - Network network = this.getNetwork(); - if (network == null) { - return null; - } - - String subnetName = this.subnetName(); - if (subnetName == null) { - return null; - } - - Subnet subnet = network.subnets().get(subnetName); - if (subnet == null) { - return null; - } - - return subnet.getNetworkSecurityGroup(); - } - - @Override - public String privateIpAddress() { - return this.innerModel().privateIpAddress(); - } - - @Override - public IpAllocationMethod privateIpAllocationMethod() { - return this.innerModel().privateIpAllocationMethod(); - } - - @Override - public IpVersion privateIpAddressVersion() { - return this.innerModel().privateIpAddressVersion(); - } - - public String networkId() { - SubResource subnetRef = this.innerModel().subnet(); - if (subnetRef == null) { - return null; - } - return ResourceUtils.parentResourceIdFromResourceId(subnetRef.id()); - } - - public Network getNetwork() { - String id = this.networkId(); - if (id == null) { - return null; - } - return this.networkManager.networks().getById(id); - } - - @Override - public String subnetName() { - SubResource subnetRef = this.innerModel().subnet(); - if (subnetRef == null) { - return null; - } - return ResourceUtils.nameFromResourceId(subnetRef.id()); - } - - @Override - public Collection listAssociatedApplicationGatewayBackends() { - return com - .azure - .resourcemanager - .network - .implementation - .Utils - .listAssociatedApplicationGatewayBackends( - this.parent().manager(), this.innerModel().applicationGatewayBackendAddressPools()); - } - - @Override - public List listAssociatedLoadBalancerBackends() { - final List backendRefs = this.innerModel().loadBalancerBackendAddressPools(); - if (backendRefs == null) { - return Collections.unmodifiableList(new ArrayList()); - } - final Map loadBalancers = new HashMap<>(); - final List backends = new ArrayList<>(); - for (BackendAddressPoolInner backendRef : backendRefs) { - String loadBalancerId = ResourceUtils.parentResourceIdFromResourceId(backendRef.id()); - LoadBalancer loadBalancer = loadBalancers.get(loadBalancerId.toLowerCase(Locale.ROOT)); - if (loadBalancer == null) { - loadBalancer = this.networkManager.loadBalancers().getById(loadBalancerId); - loadBalancers.put(loadBalancerId.toLowerCase(Locale.ROOT), loadBalancer); - } - String backendName = ResourceUtils.nameFromResourceId(backendRef.id()); - backends.add(loadBalancer.backends().get(backendName)); - } - return Collections.unmodifiableList(backends); - } - - @Override - public List listAssociatedLoadBalancerInboundNatRules() { - final List inboundNatPoolRefs = this.innerModel().loadBalancerInboundNatRules(); - if (inboundNatPoolRefs == null) { - return Collections.unmodifiableList(new ArrayList()); - } - final Map loadBalancers = new HashMap<>(); - final List rules = new ArrayList<>(); - for (InboundNatRuleInner ref : inboundNatPoolRefs) { - String loadBalancerId = ResourceUtils.parentResourceIdFromResourceId(ref.id()); - LoadBalancer loadBalancer = loadBalancers.get(loadBalancerId.toLowerCase(Locale.ROOT)); - if (loadBalancer == null) { - loadBalancer = this.networkManager.loadBalancers().getById(loadBalancerId); - loadBalancers.put(loadBalancerId.toLowerCase(Locale.ROOT), loadBalancer); - } - String ruleName = ResourceUtils.nameFromResourceId(ref.id()); - rules.add(loadBalancer.inboundNatRules().get(ruleName)); - } - return Collections.unmodifiableList(rules); - } - - @Override - public List listAssociatedApplicationSecurityGroups() { - if (CoreUtils.isNullOrEmpty(this.innerModel().applicationSecurityGroups())) { - return Collections.emptyList(); - } - - List applicationSecurityGroups = Flux - .fromStream(this.innerModel().applicationSecurityGroups().stream().map(ApplicationSecurityGroupInner::id)) - .flatMapSequential(id -> this.networkManager.applicationSecurityGroups().getByIdAsync(id)) - .collectList().block(); - return applicationSecurityGroups == null - ? Collections.emptyList() - : Collections.unmodifiableList(applicationSecurityGroups); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NicIpConfigurationImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NicIpConfigurationImpl.java deleted file mode 100644 index aa05e3df0d12..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NicIpConfigurationImpl.java +++ /dev/null @@ -1,403 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.network.fluent.models.ApplicationSecurityGroupInner; -import com.azure.resourcemanager.network.models.ApplicationGateway; -import com.azure.resourcemanager.network.models.ApplicationGatewayBackendAddressPool; -import com.azure.resourcemanager.network.models.ApplicationSecurityGroup; -import com.azure.resourcemanager.network.models.IpAllocationMethod; -import com.azure.resourcemanager.network.models.IpVersion; -import com.azure.resourcemanager.network.models.LoadBalancer; -import com.azure.resourcemanager.network.models.Network; -import com.azure.resourcemanager.network.models.NetworkInterface; -import com.azure.resourcemanager.network.models.NicIpConfiguration; -import com.azure.resourcemanager.network.models.PublicIpAddress; -import com.azure.resourcemanager.network.fluent.models.BackendAddressPoolInner; -import com.azure.resourcemanager.network.fluent.models.InboundNatRuleInner; -import com.azure.resourcemanager.network.fluent.models.NetworkInterfaceIpConfigurationInner; -import com.azure.resourcemanager.network.fluent.models.PublicIpAddressInner; -import com.azure.resourcemanager.network.fluent.models.SubnetInner; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import reactor.core.publisher.Mono; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import java.util.Objects; - -/** Implementation for NicIPConfiguration and its create and update interfaces. */ -class NicIpConfigurationImpl extends NicIpConfigurationBaseImpl - implements NicIpConfiguration, - NicIpConfiguration.Definition, - NicIpConfiguration.UpdateDefinition, - NicIpConfiguration.Update { - /** the network client. */ - private final NetworkManager networkManager; - /** flag indicating whether IP configuration is in create or update mode. */ - private final boolean isInCreateMode; - /** unique key of a creatable virtual network to be associated with the ip configuration. */ - private String creatableVirtualNetworkKey; - /** unique key of a creatable public IP to be associated with the ip configuration. */ - private String creatablePublicIPKey; - /** reference to an existing virtual network to be associated with the ip configuration. */ - private Network existingVirtualNetworkToAssociate; - /** reference to an existing public IP to be associated with the ip configuration. */ - private String existingPublicIPAddressIdToAssociate; - /** name of an existing subnet to be associated with a new or existing IP configuration. */ - private String subnetToAssociate; - /** flag indicating to remove public IP association from the ip configuration during update. */ - private boolean removePrimaryPublicIPAssociation; - - private final ClientLogger logger = new ClientLogger(getClass()); - - protected NicIpConfigurationImpl( - NetworkInterfaceIpConfigurationInner inner, - NetworkInterfaceImpl parent, - NetworkManager networkManager, - final boolean isInCreateModel) { - super(inner, parent, networkManager); - this.isInCreateMode = isInCreateModel; - this.networkManager = networkManager; - } - - protected static NicIpConfigurationImpl prepareNicIPConfiguration( - String name, NetworkInterfaceImpl parent, final NetworkManager networkManager) { - NetworkInterfaceIpConfigurationInner ipConfigurationInner = new NetworkInterfaceIpConfigurationInner(); - ipConfigurationInner.withName(name); - return new NicIpConfigurationImpl(ipConfigurationInner, parent, networkManager, true); - } - - @Override - public String publicIpAddressId() { - if (this.innerModel().publicIpAddress() == null) { - return null; - } - return this.innerModel().publicIpAddress().id(); - } - - @Override - public PublicIpAddress getPublicIpAddress() { - return this.getPublicIpAddressAsync().block(); - } - - @Override - public Mono getPublicIpAddressAsync() { - String pipId = this.publicIpAddressId(); - return pipId == null ? Mono.empty() : this.networkManager.publicIpAddresses().getByIdAsync(pipId); - } - - @Override - public NetworkInterfaceImpl attach() { - return parent().withIPConfiguration(this); - } - - @Override - public NicIpConfigurationImpl withNewNetwork(Creatable creatable) { - this.creatableVirtualNetworkKey = creatable.key(); - this.parent().addToCreatableDependencies(creatable); - return this; - } - - @Override - public NicIpConfigurationImpl withNewNetwork(String name, String addressSpaceCidr) { - Network.DefinitionStages.WithGroup definitionWithGroup = - this.networkManager.networks().define(name).withRegion(this.parent().regionName()); - - Network.DefinitionStages.WithCreate definitionAfterGroup; - if (this.parent().newGroup() != null) { - definitionAfterGroup = definitionWithGroup.withNewResourceGroup(this.parent().newGroup()); - } else { - definitionAfterGroup = definitionWithGroup.withExistingResourceGroup(this.parent().resourceGroupName()); - } - return withNewNetwork(definitionAfterGroup.withAddressSpace(addressSpaceCidr)); - } - - @Override - public NicIpConfigurationImpl withNewNetwork(String addressSpaceCidr) { - return withNewNetwork(this.parent().namer.getRandomName("vnet", 20), addressSpaceCidr); - } - - @Override - public NicIpConfigurationImpl withExistingNetwork(Network network) { - this.existingVirtualNetworkToAssociate = network; - return this; - } - - @Override - public NicIpConfigurationImpl withPrivateIpAddressDynamic() { - this.innerModel().withPrivateIpAllocationMethod(IpAllocationMethod.DYNAMIC); - this.innerModel().withPrivateIpAddress(null); - return this; - } - - @Override - public NicIpConfigurationImpl withPrivateIpAddressStatic(String staticPrivateIPAddress) { - this.innerModel().withPrivateIpAllocationMethod(IpAllocationMethod.STATIC); - this.innerModel().withPrivateIpAddress(staticPrivateIPAddress); - return this; - } - - @Override - public NicIpConfigurationImpl withNewPublicIpAddress(Creatable creatable) { - if (this.creatablePublicIPKey == null) { - this.creatablePublicIPKey = creatable.key(); - this.parent().addToCreatableDependencies(creatable); - } - return this; - } - - @Override - public NicIpConfigurationImpl withNewPublicIpAddress() { - String name = this.parent().namer.getRandomName("pip", 15); - return withNewPublicIpAddress(prepareCreatablePublicIP(name, name)); - } - - @Override - public NicIpConfigurationImpl withNewPublicIpAddress(String leafDnsLabel) { - return withNewPublicIpAddress( - prepareCreatablePublicIP(this.parent().namer.getRandomName("pip", 15), leafDnsLabel)); - } - - @Override - public NicIpConfigurationImpl withExistingPublicIpAddress(PublicIpAddress publicIpAddress) { - return this.withExistingPublicIpAddress(publicIpAddress.id()); - } - - @Override - public NicIpConfigurationImpl withExistingPublicIpAddress(String resourceId) { - this.existingPublicIPAddressIdToAssociate = resourceId; - return this; - } - - @Override - public NicIpConfigurationImpl withoutPublicIpAddress() { - this.removePrimaryPublicIPAssociation = true; - return this; - } - - @Override - public NicIpConfigurationImpl withSubnet(String name) { - this.subnetToAssociate = name; - return this; - } - - @Override - public NicIpConfigurationImpl withExistingLoadBalancerBackend(LoadBalancer loadBalancer, String backendName) { - if (loadBalancer != null) { - for (BackendAddressPoolInner pool : loadBalancer.innerModel().backendAddressPools()) { - if (pool.name().equalsIgnoreCase(backendName)) { - ensureLoadBalancerBackendAddressPools().add(pool); - return this; - } - } - } - - return null; - } - - @Override - public NicIpConfigurationImpl withExistingApplicationGatewayBackend( - ApplicationGateway appGateway, String backendName) { - if (appGateway != null) { - for (ApplicationGatewayBackendAddressPool pool : appGateway.innerModel().backendAddressPools()) { - if (pool.name().equalsIgnoreCase(backendName)) { - ensureAppGatewayBackendAddressPools().add(pool); - return this; - } - } - } - - return null; - } - - @Override - public NicIpConfigurationImpl withExistingLoadBalancerInboundNatRule( - LoadBalancer loadBalancer, String inboundNatRuleName) { - if (loadBalancer != null) { - for (InboundNatRuleInner rule : loadBalancer.innerModel().inboundNatRules()) { - if (rule.name().equalsIgnoreCase(inboundNatRuleName)) { - ensureInboundNatRules().add(rule); - return this; - } - } - } - - return null; - } - - private List ensureAppGatewayBackendAddressPools() { - List poolRefs = this.innerModel().applicationGatewayBackendAddressPools(); - if (poolRefs == null) { - poolRefs = new ArrayList<>(); - this.innerModel().withApplicationGatewayBackendAddressPools(poolRefs); - } - return poolRefs; - } - - private List ensureLoadBalancerBackendAddressPools() { - List poolRefs = this.innerModel().loadBalancerBackendAddressPools(); - if (poolRefs == null) { - poolRefs = new ArrayList<>(); - this.innerModel().withLoadBalancerBackendAddressPools(poolRefs); - } - return poolRefs; - } - - private List ensureInboundNatRules() { - List natRefs = this.innerModel().loadBalancerInboundNatRules(); - if (natRefs == null) { - natRefs = new ArrayList<>(); - this.innerModel().withLoadBalancerInboundNatRules(natRefs); - } - return natRefs; - } - - protected static void ensureConfigurations(Collection nicIPConfigurations) { - for (NicIpConfiguration nicIPConfiguration : nicIPConfigurations) { - NicIpConfigurationImpl config = (NicIpConfigurationImpl) nicIPConfiguration; - config.innerModel().withSubnet(config.subnetToAssociate()); - config.innerModel().withPublicIpAddress(config.publicIPToAssociate()); - } - } - - // Creates a creatable public IP address definition with the given name and DNS label. - private Creatable prepareCreatablePublicIP(String name, String leafDnsLabel) { - PublicIpAddress.DefinitionStages.WithGroup definitionWithGroup = - this.networkManager.publicIpAddresses().define(name).withRegion(this.parent().regionName()); - - PublicIpAddress.DefinitionStages.WithCreate definitionAfterGroup; - if (this.parent().newGroup() != null) { - definitionAfterGroup = definitionWithGroup.withNewResourceGroup(this.parent().newGroup()); - } else { - definitionAfterGroup = definitionWithGroup.withExistingResourceGroup(this.parent().resourceGroupName()); - } - return definitionAfterGroup.withLeafDomainLabel(leafDnsLabel); - } - - /** - * Gets the subnet to associate with the IP configuration. - * - *

    This method will never return null as subnet is required for a IP configuration, in case of update mode if - * user didn't choose to change the subnet then existing subnet will be returned. Updating the nic subnet has a - * restriction, the new subnet must reside in the same virtual network as the current one. - * - * @return the subnet resource - */ - private SubnetInner subnetToAssociate() { - SubnetInner subnetInner = new SubnetInner(); - if (this.isInCreateMode) { - if (this.creatableVirtualNetworkKey != null) { - Network network = (Network) parent().createdDependencyResource(this.creatableVirtualNetworkKey); - subnetInner.withId(network.innerModel().subnets().get(0).id()); - return subnetInner; - } - - for (SubnetInner subnet : this.existingVirtualNetworkToAssociate.innerModel().subnets()) { - if (subnet.name().equalsIgnoreCase(this.subnetToAssociate)) { - subnetInner.withId(subnet.id()); - return subnetInner; - } - } - - throw logger - .logExceptionAsError( - new RuntimeException( - "A subnet with name '" - + subnetToAssociate - + "' not found under the network '" - + this.existingVirtualNetworkToAssociate.name() - + "'")); - - } else { - if (subnetToAssociate != null) { - int idx = this.innerModel().subnet().id().lastIndexOf('/'); - subnetInner.withId(this.innerModel().subnet().id().substring(0, idx + 1) + subnetToAssociate); - } else { - subnetInner.withId(this.innerModel().subnet().id()); - } - return subnetInner; - } - } - - /** - * Get the SubResource instance representing a public IP that needs to be associated with the IP configuration. - * - *

    null will be returned if withoutPublicIP() is specified in the update fluent chain or user did't opt for - * public IP in create fluent chain. In case of update chain, if withoutPublicIP(..) is not specified then existing - * associated (if any) public IP will be returned. - * - * @return public IP SubResource - */ - private PublicIpAddressInner publicIPToAssociate() { - String pipId = null; - if (this.removePrimaryPublicIPAssociation) { - return null; - } else if (this.creatablePublicIPKey != null) { - pipId = ((PublicIpAddress) this.parent().createdDependencyResource(this.creatablePublicIPKey)).id(); - } else if (this.existingPublicIPAddressIdToAssociate != null) { - pipId = this.existingPublicIPAddressIdToAssociate; - } - - if (pipId != null) { - return new PublicIpAddressInner().withId(pipId); - } else if (!this.isInCreateMode) { - return this.innerModel().publicIpAddress(); - } else { - return null; - } - } - - @Override - public NicIpConfigurationImpl withPrivateIpVersion(IpVersion ipVersion) { - this.innerModel().withPrivateIpAddressVersion(ipVersion); - return this; - } - - @Override - public NicIpConfigurationImpl withoutApplicationGatewayBackends() { - this.innerModel().withApplicationGatewayBackendAddressPools(null); - return this; - } - - @Override - public NicIpConfigurationImpl withoutLoadBalancerBackends() { - this.innerModel().withLoadBalancerBackendAddressPools(null); - return this; - } - - @Override - public NicIpConfigurationImpl withoutLoadBalancerInboundNatRules() { - this.innerModel().withLoadBalancerInboundNatRules(null); - return this; - } - - NicIpConfigurationImpl withExistingApplicationSecurityGroup(ApplicationSecurityGroup applicationSecurityGroup) { - this.withExistingApplicationSecurityGroup(applicationSecurityGroup.innerModel()); - return this; - } - - NicIpConfigurationImpl withExistingApplicationSecurityGroup(ApplicationSecurityGroupInner inner) { - if (this.innerModel().applicationSecurityGroups() == null) { - this.innerModel().withApplicationSecurityGroups(new ArrayList<>()); - } - this.innerModel().applicationSecurityGroups().add(inner); - return this; - } - - NicIpConfigurationImpl withoutApplicationSecurityGroup(String name) { - if (this.innerModel().applicationSecurityGroups() != null) { - this.innerModel().applicationSecurityGroups().removeIf(asg -> { - String asgName = asg.name() == null - ? ResourceUtils.nameFromResourceId(asg.id()) - : asg.name(); - return Objects.equals(name, asgName); - }); - } - return this; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/OperationsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/OperationsClientImpl.java deleted file mode 100644 index 0452bc028cf3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/OperationsClientImpl.java +++ /dev/null @@ -1,270 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.OperationsClient; -import com.azure.resourcemanager.network.fluent.models.OperationInner; -import com.azure.resourcemanager.network.models.OperationListResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in OperationsClient. */ -public final class OperationsClientImpl implements OperationsClient { - private final ClientLogger logger = new ClientLogger(OperationsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final OperationsService service; - - /** The service client containing this operation class. */ - private final NetworkManagementClientImpl client; - - /** - * Initializes an instance of OperationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - OperationsClientImpl(NetworkManagementClientImpl client) { - this.service = - RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for NetworkManagementClientOperations to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "NetworkManagementCli") - private interface OperationsService { - @Headers({"Content-Type: application/json"}) - @Get("/providers/Microsoft.Network/operations") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Lists all of the available Network Rest API operations. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Network operations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all of the available Network Rest API operations. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Network operations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists all of the available Network Rest API operations. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Network operations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists all of the available Network Rest API operations. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Network operations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all of the available Network Rest API operations. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Network operations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Lists all of the available Network Rest API operations. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Network operations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Network operations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Network operations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/P2SVpnGatewaysClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/P2SVpnGatewaysClientImpl.java deleted file mode 100644 index e515c210d8d2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/P2SVpnGatewaysClientImpl.java +++ /dev/null @@ -1,1847 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.P2SVpnGatewaysClient; -import com.azure.resourcemanager.network.fluent.models.P2SVpnGatewayInner; -import com.azure.resourcemanager.network.fluent.models.VpnProfileResponseInner; -import com.azure.resourcemanager.network.models.ErrorException; -import com.azure.resourcemanager.network.models.ListP2SVpnGatewaysResult; -import com.azure.resourcemanager.network.models.P2SVpnProfileParameters; -import com.azure.resourcemanager.network.models.TagsObject; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in P2SVpnGatewaysClient. */ -public final class P2SVpnGatewaysClientImpl - implements InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete, - P2SVpnGatewaysClient { - private final ClientLogger logger = new ClientLogger(P2SVpnGatewaysClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final P2SVpnGatewaysService service; - - /** The service client containing this operation class. */ - private final NetworkManagementClientImpl client; - - /** - * Initializes an instance of P2SVpnGatewaysClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - P2SVpnGatewaysClientImpl(NetworkManagementClientImpl client) { - this.service = - RestProxy.create(P2SVpnGatewaysService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for NetworkManagementClientP2SVpnGateways to be used by the proxy service - * to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "NetworkManagementCli") - private interface P2SVpnGatewaysService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/p2svpnGateways/{gatewayName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ErrorException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("gatewayName") String gatewayName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/p2svpnGateways/{gatewayName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ErrorException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("gatewayName") String gatewayName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") P2SVpnGatewayInner p2SVpnGatewayParameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/p2svpnGateways/{gatewayName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ErrorException.class) - Mono>> updateTags( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("gatewayName") String gatewayName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") TagsObject p2SVpnGatewayParameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/p2svpnGateways/{gatewayName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ErrorException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("gatewayName") String gatewayName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/p2svpnGateways") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ErrorException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/p2svpnGateways") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ErrorException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/p2svpnGateways/{gatewayName}/generatevpnprofile") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> generateVpnProfile( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("gatewayName") String gatewayName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") P2SVpnProfileParameters parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ErrorException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ErrorException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Retrieves the details of a virtual wan p2s vpn gateway. - * - * @param resourceGroupName The resource group name of the P2SVpnGateway. - * @param gatewayName The name of the gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return p2SVpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String gatewayName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (gatewayName == null) { - return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - gatewayName, - apiVersion, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Retrieves the details of a virtual wan p2s vpn gateway. - * - * @param resourceGroupName The resource group name of the P2SVpnGateway. - * @param gatewayName The name of the gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return p2SVpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String gatewayName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (gatewayName == null) { - return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - gatewayName, - apiVersion, - accept, - context); - } - - /** - * Retrieves the details of a virtual wan p2s vpn gateway. - * - * @param resourceGroupName The resource group name of the P2SVpnGateway. - * @param gatewayName The name of the gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return p2SVpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync(String resourceGroupName, String gatewayName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, gatewayName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Retrieves the details of a virtual wan p2s vpn gateway. - * - * @param resourceGroupName The resource group name of the P2SVpnGateway. - * @param gatewayName The name of the gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return p2SVpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public P2SVpnGatewayInner getByResourceGroup(String resourceGroupName, String gatewayName) { - return getByResourceGroupAsync(resourceGroupName, gatewayName).block(); - } - - /** - * Retrieves the details of a virtual wan p2s vpn gateway. - * - * @param resourceGroupName The resource group name of the P2SVpnGateway. - * @param gatewayName The name of the gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return p2SVpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String gatewayName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, gatewayName, context).block(); - } - - /** - * Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. - * - * @param resourceGroupName The resource group name of the P2SVpnGateway. - * @param gatewayName The name of the gateway. - * @param p2SVpnGatewayParameters Parameters supplied to create or Update a virtual wan p2s vpn gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return p2SVpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String gatewayName, P2SVpnGatewayInner p2SVpnGatewayParameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (gatewayName == null) { - return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); - } - if (p2SVpnGatewayParameters == null) { - return Mono - .error( - new IllegalArgumentException("Parameter p2SVpnGatewayParameters is required and cannot be null.")); - } else { - p2SVpnGatewayParameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - gatewayName, - apiVersion, - p2SVpnGatewayParameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. - * - * @param resourceGroupName The resource group name of the P2SVpnGateway. - * @param gatewayName The name of the gateway. - * @param p2SVpnGatewayParameters Parameters supplied to create or Update a virtual wan p2s vpn gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return p2SVpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String gatewayName, P2SVpnGatewayInner p2SVpnGatewayParameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (gatewayName == null) { - return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); - } - if (p2SVpnGatewayParameters == null) { - return Mono - .error( - new IllegalArgumentException("Parameter p2SVpnGatewayParameters is required and cannot be null.")); - } else { - p2SVpnGatewayParameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - gatewayName, - apiVersion, - p2SVpnGatewayParameters, - accept, - context); - } - - /** - * Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. - * - * @param resourceGroupName The resource group name of the P2SVpnGateway. - * @param gatewayName The name of the gateway. - * @param p2SVpnGatewayParameters Parameters supplied to create or Update a virtual wan p2s vpn gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return p2SVpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, P2SVpnGatewayInner> beginCreateOrUpdateAsync( - String resourceGroupName, String gatewayName, P2SVpnGatewayInner p2SVpnGatewayParameters) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, gatewayName, p2SVpnGatewayParameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - P2SVpnGatewayInner.class, - P2SVpnGatewayInner.class, - this.client.getContext()); - } - - /** - * Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. - * - * @param resourceGroupName The resource group name of the P2SVpnGateway. - * @param gatewayName The name of the gateway. - * @param p2SVpnGatewayParameters Parameters supplied to create or Update a virtual wan p2s vpn gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return p2SVpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, P2SVpnGatewayInner> beginCreateOrUpdateAsync( - String resourceGroupName, String gatewayName, P2SVpnGatewayInner p2SVpnGatewayParameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, gatewayName, p2SVpnGatewayParameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), P2SVpnGatewayInner.class, P2SVpnGatewayInner.class, context); - } - - /** - * Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. - * - * @param resourceGroupName The resource group name of the P2SVpnGateway. - * @param gatewayName The name of the gateway. - * @param p2SVpnGatewayParameters Parameters supplied to create or Update a virtual wan p2s vpn gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return p2SVpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, P2SVpnGatewayInner> beginCreateOrUpdate( - String resourceGroupName, String gatewayName, P2SVpnGatewayInner p2SVpnGatewayParameters) { - return beginCreateOrUpdateAsync(resourceGroupName, gatewayName, p2SVpnGatewayParameters).getSyncPoller(); - } - - /** - * Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. - * - * @param resourceGroupName The resource group name of the P2SVpnGateway. - * @param gatewayName The name of the gateway. - * @param p2SVpnGatewayParameters Parameters supplied to create or Update a virtual wan p2s vpn gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return p2SVpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, P2SVpnGatewayInner> beginCreateOrUpdate( - String resourceGroupName, String gatewayName, P2SVpnGatewayInner p2SVpnGatewayParameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, gatewayName, p2SVpnGatewayParameters, context) - .getSyncPoller(); - } - - /** - * Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. - * - * @param resourceGroupName The resource group name of the P2SVpnGateway. - * @param gatewayName The name of the gateway. - * @param p2SVpnGatewayParameters Parameters supplied to create or Update a virtual wan p2s vpn gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return p2SVpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, String gatewayName, P2SVpnGatewayInner p2SVpnGatewayParameters) { - return beginCreateOrUpdateAsync(resourceGroupName, gatewayName, p2SVpnGatewayParameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. - * - * @param resourceGroupName The resource group name of the P2SVpnGateway. - * @param gatewayName The name of the gateway. - * @param p2SVpnGatewayParameters Parameters supplied to create or Update a virtual wan p2s vpn gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return p2SVpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String gatewayName, P2SVpnGatewayInner p2SVpnGatewayParameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, gatewayName, p2SVpnGatewayParameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. - * - * @param resourceGroupName The resource group name of the P2SVpnGateway. - * @param gatewayName The name of the gateway. - * @param p2SVpnGatewayParameters Parameters supplied to create or Update a virtual wan p2s vpn gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return p2SVpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public P2SVpnGatewayInner createOrUpdate( - String resourceGroupName, String gatewayName, P2SVpnGatewayInner p2SVpnGatewayParameters) { - return createOrUpdateAsync(resourceGroupName, gatewayName, p2SVpnGatewayParameters).block(); - } - - /** - * Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. - * - * @param resourceGroupName The resource group name of the P2SVpnGateway. - * @param gatewayName The name of the gateway. - * @param p2SVpnGatewayParameters Parameters supplied to create or Update a virtual wan p2s vpn gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return p2SVpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public P2SVpnGatewayInner createOrUpdate( - String resourceGroupName, String gatewayName, P2SVpnGatewayInner p2SVpnGatewayParameters, Context context) { - return createOrUpdateAsync(resourceGroupName, gatewayName, p2SVpnGatewayParameters, context).block(); - } - - /** - * Updates virtual wan p2s vpn gateway tags. - * - * @param resourceGroupName The resource group name of the P2SVpnGateway. - * @param gatewayName The name of the gateway. - * @param p2SVpnGatewayParameters Parameters supplied to update a virtual wan p2s vpn gateway tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return p2SVpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateTagsWithResponseAsync( - String resourceGroupName, String gatewayName, TagsObject p2SVpnGatewayParameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (gatewayName == null) { - return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); - } - if (p2SVpnGatewayParameters == null) { - return Mono - .error( - new IllegalArgumentException("Parameter p2SVpnGatewayParameters is required and cannot be null.")); - } else { - p2SVpnGatewayParameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updateTags( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - gatewayName, - apiVersion, - p2SVpnGatewayParameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates virtual wan p2s vpn gateway tags. - * - * @param resourceGroupName The resource group name of the P2SVpnGateway. - * @param gatewayName The name of the gateway. - * @param p2SVpnGatewayParameters Parameters supplied to update a virtual wan p2s vpn gateway tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return p2SVpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateTagsWithResponseAsync( - String resourceGroupName, String gatewayName, TagsObject p2SVpnGatewayParameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (gatewayName == null) { - return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); - } - if (p2SVpnGatewayParameters == null) { - return Mono - .error( - new IllegalArgumentException("Parameter p2SVpnGatewayParameters is required and cannot be null.")); - } else { - p2SVpnGatewayParameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updateTags( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - gatewayName, - apiVersion, - p2SVpnGatewayParameters, - accept, - context); - } - - /** - * Updates virtual wan p2s vpn gateway tags. - * - * @param resourceGroupName The resource group name of the P2SVpnGateway. - * @param gatewayName The name of the gateway. - * @param p2SVpnGatewayParameters Parameters supplied to update a virtual wan p2s vpn gateway tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return p2SVpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, P2SVpnGatewayInner> beginUpdateTagsAsync( - String resourceGroupName, String gatewayName, TagsObject p2SVpnGatewayParameters) { - Mono>> mono = - updateTagsWithResponseAsync(resourceGroupName, gatewayName, p2SVpnGatewayParameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - P2SVpnGatewayInner.class, - P2SVpnGatewayInner.class, - this.client.getContext()); - } - - /** - * Updates virtual wan p2s vpn gateway tags. - * - * @param resourceGroupName The resource group name of the P2SVpnGateway. - * @param gatewayName The name of the gateway. - * @param p2SVpnGatewayParameters Parameters supplied to update a virtual wan p2s vpn gateway tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return p2SVpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, P2SVpnGatewayInner> beginUpdateTagsAsync( - String resourceGroupName, String gatewayName, TagsObject p2SVpnGatewayParameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - updateTagsWithResponseAsync(resourceGroupName, gatewayName, p2SVpnGatewayParameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), P2SVpnGatewayInner.class, P2SVpnGatewayInner.class, context); - } - - /** - * Updates virtual wan p2s vpn gateway tags. - * - * @param resourceGroupName The resource group name of the P2SVpnGateway. - * @param gatewayName The name of the gateway. - * @param p2SVpnGatewayParameters Parameters supplied to update a virtual wan p2s vpn gateway tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return p2SVpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, P2SVpnGatewayInner> beginUpdateTags( - String resourceGroupName, String gatewayName, TagsObject p2SVpnGatewayParameters) { - return beginUpdateTagsAsync(resourceGroupName, gatewayName, p2SVpnGatewayParameters).getSyncPoller(); - } - - /** - * Updates virtual wan p2s vpn gateway tags. - * - * @param resourceGroupName The resource group name of the P2SVpnGateway. - * @param gatewayName The name of the gateway. - * @param p2SVpnGatewayParameters Parameters supplied to update a virtual wan p2s vpn gateway tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return p2SVpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, P2SVpnGatewayInner> beginUpdateTags( - String resourceGroupName, String gatewayName, TagsObject p2SVpnGatewayParameters, Context context) { - return beginUpdateTagsAsync(resourceGroupName, gatewayName, p2SVpnGatewayParameters, context).getSyncPoller(); - } - - /** - * Updates virtual wan p2s vpn gateway tags. - * - * @param resourceGroupName The resource group name of the P2SVpnGateway. - * @param gatewayName The name of the gateway. - * @param p2SVpnGatewayParameters Parameters supplied to update a virtual wan p2s vpn gateway tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return p2SVpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateTagsAsync( - String resourceGroupName, String gatewayName, TagsObject p2SVpnGatewayParameters) { - return beginUpdateTagsAsync(resourceGroupName, gatewayName, p2SVpnGatewayParameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates virtual wan p2s vpn gateway tags. - * - * @param resourceGroupName The resource group name of the P2SVpnGateway. - * @param gatewayName The name of the gateway. - * @param p2SVpnGatewayParameters Parameters supplied to update a virtual wan p2s vpn gateway tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return p2SVpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateTagsAsync( - String resourceGroupName, String gatewayName, TagsObject p2SVpnGatewayParameters, Context context) { - return beginUpdateTagsAsync(resourceGroupName, gatewayName, p2SVpnGatewayParameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates virtual wan p2s vpn gateway tags. - * - * @param resourceGroupName The resource group name of the P2SVpnGateway. - * @param gatewayName The name of the gateway. - * @param p2SVpnGatewayParameters Parameters supplied to update a virtual wan p2s vpn gateway tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return p2SVpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public P2SVpnGatewayInner updateTags( - String resourceGroupName, String gatewayName, TagsObject p2SVpnGatewayParameters) { - return updateTagsAsync(resourceGroupName, gatewayName, p2SVpnGatewayParameters).block(); - } - - /** - * Updates virtual wan p2s vpn gateway tags. - * - * @param resourceGroupName The resource group name of the P2SVpnGateway. - * @param gatewayName The name of the gateway. - * @param p2SVpnGatewayParameters Parameters supplied to update a virtual wan p2s vpn gateway tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return p2SVpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public P2SVpnGatewayInner updateTags( - String resourceGroupName, String gatewayName, TagsObject p2SVpnGatewayParameters, Context context) { - return updateTagsAsync(resourceGroupName, gatewayName, p2SVpnGatewayParameters, context).block(); - } - - /** - * Deletes a virtual wan p2s vpn gateway. - * - * @param resourceGroupName The resource group name of the P2SVpnGateway. - * @param gatewayName The name of the gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync(String resourceGroupName, String gatewayName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (gatewayName == null) { - return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - gatewayName, - apiVersion, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a virtual wan p2s vpn gateway. - * - * @param resourceGroupName The resource group name of the P2SVpnGateway. - * @param gatewayName The name of the gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String gatewayName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (gatewayName == null) { - return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - gatewayName, - apiVersion, - accept, - context); - } - - /** - * Deletes a virtual wan p2s vpn gateway. - * - * @param resourceGroupName The resource group name of the P2SVpnGateway. - * @param gatewayName The name of the gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String gatewayName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, gatewayName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deletes a virtual wan p2s vpn gateway. - * - * @param resourceGroupName The resource group name of the P2SVpnGateway. - * @param gatewayName The name of the gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String gatewayName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(resourceGroupName, gatewayName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes a virtual wan p2s vpn gateway. - * - * @param resourceGroupName The resource group name of the P2SVpnGateway. - * @param gatewayName The name of the gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete(String resourceGroupName, String gatewayName) { - return beginDeleteAsync(resourceGroupName, gatewayName).getSyncPoller(); - } - - /** - * Deletes a virtual wan p2s vpn gateway. - * - * @param resourceGroupName The resource group name of the P2SVpnGateway. - * @param gatewayName The name of the gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String gatewayName, Context context) { - return beginDeleteAsync(resourceGroupName, gatewayName, context).getSyncPoller(); - } - - /** - * Deletes a virtual wan p2s vpn gateway. - * - * @param resourceGroupName The resource group name of the P2SVpnGateway. - * @param gatewayName The name of the gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String gatewayName) { - return beginDeleteAsync(resourceGroupName, gatewayName).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a virtual wan p2s vpn gateway. - * - * @param resourceGroupName The resource group name of the P2SVpnGateway. - * @param gatewayName The name of the gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String gatewayName, Context context) { - return beginDeleteAsync(resourceGroupName, gatewayName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a virtual wan p2s vpn gateway. - * - * @param resourceGroupName The resource group name of the P2SVpnGateway. - * @param gatewayName The name of the gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String gatewayName) { - deleteAsync(resourceGroupName, gatewayName).block(); - } - - /** - * Deletes a virtual wan p2s vpn gateway. - * - * @param resourceGroupName The resource group name of the P2SVpnGateway. - * @param gatewayName The name of the gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String gatewayName, Context context) { - deleteAsync(resourceGroupName, gatewayName, context).block(); - } - - /** - * Lists all the P2SVpnGateways in a resource group. - * - * @param resourceGroupName The resource group name of the P2SVpnGateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list P2SVpnGateways. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - apiVersion, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all the P2SVpnGateways in a resource group. - * - * @param resourceGroupName The resource group name of the P2SVpnGateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list P2SVpnGateways. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - apiVersion, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists all the P2SVpnGateways in a resource group. - * - * @param resourceGroupName The resource group name of the P2SVpnGateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list P2SVpnGateways. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * Lists all the P2SVpnGateways in a resource group. - * - * @param resourceGroupName The resource group name of the P2SVpnGateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list P2SVpnGateways. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all the P2SVpnGateways in a resource group. - * - * @param resourceGroupName The resource group name of the P2SVpnGateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list P2SVpnGateways. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * Lists all the P2SVpnGateways in a resource group. - * - * @param resourceGroupName The resource group name of the P2SVpnGateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list P2SVpnGateways. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * Lists all the P2SVpnGateways in a subscription. - * - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list P2SVpnGateways. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all the P2SVpnGateways in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list P2SVpnGateways. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists all the P2SVpnGateways in a subscription. - * - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list P2SVpnGateways. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists all the P2SVpnGateways in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list P2SVpnGateways. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all the P2SVpnGateways in a subscription. - * - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list P2SVpnGateways. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Lists all the P2SVpnGateways in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list P2SVpnGateways. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param gatewayName The name of the P2SVpnGateway. - * @param parameters Parameters supplied to the generate P2SVpnGateway VPN client package operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpn Profile Response for package generation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> generateVpnProfileWithResponseAsync( - String resourceGroupName, String gatewayName, P2SVpnProfileParameters parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (gatewayName == null) { - return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .generateVpnProfile( - this.client.getEndpoint(), - resourceGroupName, - gatewayName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param gatewayName The name of the P2SVpnGateway. - * @param parameters Parameters supplied to the generate P2SVpnGateway VPN client package operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpn Profile Response for package generation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> generateVpnProfileWithResponseAsync( - String resourceGroupName, String gatewayName, P2SVpnProfileParameters parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (gatewayName == null) { - return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .generateVpnProfile( - this.client.getEndpoint(), - resourceGroupName, - gatewayName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param gatewayName The name of the P2SVpnGateway. - * @param parameters Parameters supplied to the generate P2SVpnGateway VPN client package operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpn Profile Response for package generation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, VpnProfileResponseInner> beginGenerateVpnProfileAsync( - String resourceGroupName, String gatewayName, P2SVpnProfileParameters parameters) { - Mono>> mono = - generateVpnProfileWithResponseAsync(resourceGroupName, gatewayName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VpnProfileResponseInner.class, - VpnProfileResponseInner.class, - Context.NONE); - } - - /** - * Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param gatewayName The name of the P2SVpnGateway. - * @param parameters Parameters supplied to the generate P2SVpnGateway VPN client package operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpn Profile Response for package generation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, VpnProfileResponseInner> beginGenerateVpnProfileAsync( - String resourceGroupName, String gatewayName, P2SVpnProfileParameters parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - generateVpnProfileWithResponseAsync(resourceGroupName, gatewayName, parameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VpnProfileResponseInner.class, - VpnProfileResponseInner.class, - context); - } - - /** - * Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param gatewayName The name of the P2SVpnGateway. - * @param parameters Parameters supplied to the generate P2SVpnGateway VPN client package operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpn Profile Response for package generation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VpnProfileResponseInner> beginGenerateVpnProfile( - String resourceGroupName, String gatewayName, P2SVpnProfileParameters parameters) { - return beginGenerateVpnProfileAsync(resourceGroupName, gatewayName, parameters).getSyncPoller(); - } - - /** - * Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param gatewayName The name of the P2SVpnGateway. - * @param parameters Parameters supplied to the generate P2SVpnGateway VPN client package operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpn Profile Response for package generation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VpnProfileResponseInner> beginGenerateVpnProfile( - String resourceGroupName, String gatewayName, P2SVpnProfileParameters parameters, Context context) { - return beginGenerateVpnProfileAsync(resourceGroupName, gatewayName, parameters, context).getSyncPoller(); - } - - /** - * Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param gatewayName The name of the P2SVpnGateway. - * @param parameters Parameters supplied to the generate P2SVpnGateway VPN client package operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpn Profile Response for package generation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono generateVpnProfileAsync( - String resourceGroupName, String gatewayName, P2SVpnProfileParameters parameters) { - return beginGenerateVpnProfileAsync(resourceGroupName, gatewayName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param gatewayName The name of the P2SVpnGateway. - * @param parameters Parameters supplied to the generate P2SVpnGateway VPN client package operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpn Profile Response for package generation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono generateVpnProfileAsync( - String resourceGroupName, String gatewayName, P2SVpnProfileParameters parameters, Context context) { - return beginGenerateVpnProfileAsync(resourceGroupName, gatewayName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param gatewayName The name of the P2SVpnGateway. - * @param parameters Parameters supplied to the generate P2SVpnGateway VPN client package operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpn Profile Response for package generation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VpnProfileResponseInner generateVpnProfile( - String resourceGroupName, String gatewayName, P2SVpnProfileParameters parameters) { - return generateVpnProfileAsync(resourceGroupName, gatewayName, parameters).block(); - } - - /** - * Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param gatewayName The name of the P2SVpnGateway. - * @param parameters Parameters supplied to the generate P2SVpnGateway VPN client package operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpn Profile Response for package generation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VpnProfileResponseInner generateVpnProfile( - String resourceGroupName, String gatewayName, P2SVpnProfileParameters parameters, Context context) { - return generateVpnProfileAsync(resourceGroupName, gatewayName, parameters, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list P2SVpnGateways. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list P2SVpnGateways. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list P2SVpnGateways. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list P2SVpnGateways. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/P2SVpnServerConfigurationsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/P2SVpnServerConfigurationsClientImpl.java deleted file mode 100644 index 04b865038242..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/P2SVpnServerConfigurationsClientImpl.java +++ /dev/null @@ -1,1216 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.P2SVpnServerConfigurationsClient; -import com.azure.resourcemanager.network.fluent.models.P2SVpnServerConfigurationInner; -import com.azure.resourcemanager.network.models.ErrorException; -import com.azure.resourcemanager.network.models.ListP2SVpnServerConfigurationsResult; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in P2SVpnServerConfigurationsClient. */ -public final class P2SVpnServerConfigurationsClientImpl implements P2SVpnServerConfigurationsClient { - private final ClientLogger logger = new ClientLogger(P2SVpnServerConfigurationsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final P2SVpnServerConfigurationsService service; - - /** The service client containing this operation class. */ - private final NetworkManagementClientImpl client; - - /** - * Initializes an instance of P2SVpnServerConfigurationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - P2SVpnServerConfigurationsClientImpl(NetworkManagementClientImpl client) { - this.service = - RestProxy - .create( - P2SVpnServerConfigurationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for NetworkManagementClientP2SVpnServerConfigurations to be used by the - * proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "NetworkManagementCli") - private interface P2SVpnServerConfigurationsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans" - + "/{virtualWanName}/p2sVpnServerConfigurations/{p2SVpnServerConfigurationName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ErrorException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualWanName") String virtualWanName, - @PathParam("p2SVpnServerConfigurationName") String p2SVpnServerConfigurationName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans" - + "/{virtualWanName}/p2sVpnServerConfigurations/{p2SVpnServerConfigurationName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ErrorException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualWanName") String virtualWanName, - @PathParam("p2SVpnServerConfigurationName") String p2SVpnServerConfigurationName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") P2SVpnServerConfigurationInner p2SVpnServerConfigurationParameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans" - + "/{virtualWanName}/p2sVpnServerConfigurations/{p2SVpnServerConfigurationName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ErrorException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualWanName") String virtualWanName, - @PathParam("p2SVpnServerConfigurationName") String p2SVpnServerConfigurationName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans" - + "/{virtualWanName}/p2sVpnServerConfigurations") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ErrorException.class) - Mono> listByVirtualWan( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualWanName") String virtualWanName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ErrorException.class) - Mono> listByVirtualWanNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Retrieves the details of a P2SVpnServerConfiguration. - * - * @param resourceGroupName The resource group name of the P2SVpnServerConfiguration. - * @param virtualWanName The name of the VirtualWan. - * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return p2SVpnServerConfiguration Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String resourceGroupName, String virtualWanName, String p2SVpnServerConfigurationName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualWanName == null) { - return Mono.error(new IllegalArgumentException("Parameter virtualWanName is required and cannot be null.")); - } - if (p2SVpnServerConfigurationName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter p2SVpnServerConfigurationName is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - virtualWanName, - p2SVpnServerConfigurationName, - apiVersion, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Retrieves the details of a P2SVpnServerConfiguration. - * - * @param resourceGroupName The resource group name of the P2SVpnServerConfiguration. - * @param virtualWanName The name of the VirtualWan. - * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return p2SVpnServerConfiguration Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String virtualWanName, String p2SVpnServerConfigurationName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualWanName == null) { - return Mono.error(new IllegalArgumentException("Parameter virtualWanName is required and cannot be null.")); - } - if (p2SVpnServerConfigurationName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter p2SVpnServerConfigurationName is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - virtualWanName, - p2SVpnServerConfigurationName, - apiVersion, - accept, - context); - } - - /** - * Retrieves the details of a P2SVpnServerConfiguration. - * - * @param resourceGroupName The resource group name of the P2SVpnServerConfiguration. - * @param virtualWanName The name of the VirtualWan. - * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return p2SVpnServerConfiguration Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync( - String resourceGroupName, String virtualWanName, String p2SVpnServerConfigurationName) { - return getWithResponseAsync(resourceGroupName, virtualWanName, p2SVpnServerConfigurationName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Retrieves the details of a P2SVpnServerConfiguration. - * - * @param resourceGroupName The resource group name of the P2SVpnServerConfiguration. - * @param virtualWanName The name of the VirtualWan. - * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return p2SVpnServerConfiguration Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public P2SVpnServerConfigurationInner get( - String resourceGroupName, String virtualWanName, String p2SVpnServerConfigurationName) { - return getAsync(resourceGroupName, virtualWanName, p2SVpnServerConfigurationName).block(); - } - - /** - * Retrieves the details of a P2SVpnServerConfiguration. - * - * @param resourceGroupName The resource group name of the P2SVpnServerConfiguration. - * @param virtualWanName The name of the VirtualWan. - * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return p2SVpnServerConfiguration Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String virtualWanName, String p2SVpnServerConfigurationName, Context context) { - return getWithResponseAsync(resourceGroupName, virtualWanName, p2SVpnServerConfigurationName, context).block(); - } - - /** - * Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it doesn't exist else updates the existing - * P2SVpnServerConfiguration. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWan. - * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. - * @param p2SVpnServerConfigurationParameters Parameters supplied to create or Update a P2SVpnServerConfiguration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return p2SVpnServerConfiguration Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String virtualWanName, - String p2SVpnServerConfigurationName, - P2SVpnServerConfigurationInner p2SVpnServerConfigurationParameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualWanName == null) { - return Mono.error(new IllegalArgumentException("Parameter virtualWanName is required and cannot be null.")); - } - if (p2SVpnServerConfigurationName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter p2SVpnServerConfigurationName is required and cannot be null.")); - } - if (p2SVpnServerConfigurationParameters == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter p2SVpnServerConfigurationParameters is required and cannot be null.")); - } else { - p2SVpnServerConfigurationParameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - virtualWanName, - p2SVpnServerConfigurationName, - apiVersion, - p2SVpnServerConfigurationParameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it doesn't exist else updates the existing - * P2SVpnServerConfiguration. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWan. - * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. - * @param p2SVpnServerConfigurationParameters Parameters supplied to create or Update a P2SVpnServerConfiguration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return p2SVpnServerConfiguration Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String virtualWanName, - String p2SVpnServerConfigurationName, - P2SVpnServerConfigurationInner p2SVpnServerConfigurationParameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualWanName == null) { - return Mono.error(new IllegalArgumentException("Parameter virtualWanName is required and cannot be null.")); - } - if (p2SVpnServerConfigurationName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter p2SVpnServerConfigurationName is required and cannot be null.")); - } - if (p2SVpnServerConfigurationParameters == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter p2SVpnServerConfigurationParameters is required and cannot be null.")); - } else { - p2SVpnServerConfigurationParameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - virtualWanName, - p2SVpnServerConfigurationName, - apiVersion, - p2SVpnServerConfigurationParameters, - accept, - context); - } - - /** - * Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it doesn't exist else updates the existing - * P2SVpnServerConfiguration. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWan. - * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. - * @param p2SVpnServerConfigurationParameters Parameters supplied to create or Update a P2SVpnServerConfiguration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return p2SVpnServerConfiguration Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, P2SVpnServerConfigurationInner> - beginCreateOrUpdateAsync( - String resourceGroupName, - String virtualWanName, - String p2SVpnServerConfigurationName, - P2SVpnServerConfigurationInner p2SVpnServerConfigurationParameters) { - Mono>> mono = - createOrUpdateWithResponseAsync( - resourceGroupName, virtualWanName, p2SVpnServerConfigurationName, p2SVpnServerConfigurationParameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - P2SVpnServerConfigurationInner.class, - P2SVpnServerConfigurationInner.class, - Context.NONE); - } - - /** - * Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it doesn't exist else updates the existing - * P2SVpnServerConfiguration. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWan. - * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. - * @param p2SVpnServerConfigurationParameters Parameters supplied to create or Update a P2SVpnServerConfiguration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return p2SVpnServerConfiguration Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, P2SVpnServerConfigurationInner> - beginCreateOrUpdateAsync( - String resourceGroupName, - String virtualWanName, - String p2SVpnServerConfigurationName, - P2SVpnServerConfigurationInner p2SVpnServerConfigurationParameters, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync( - resourceGroupName, - virtualWanName, - p2SVpnServerConfigurationName, - p2SVpnServerConfigurationParameters, - context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - P2SVpnServerConfigurationInner.class, - P2SVpnServerConfigurationInner.class, - context); - } - - /** - * Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it doesn't exist else updates the existing - * P2SVpnServerConfiguration. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWan. - * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. - * @param p2SVpnServerConfigurationParameters Parameters supplied to create or Update a P2SVpnServerConfiguration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return p2SVpnServerConfiguration Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, P2SVpnServerConfigurationInner> beginCreateOrUpdate( - String resourceGroupName, - String virtualWanName, - String p2SVpnServerConfigurationName, - P2SVpnServerConfigurationInner p2SVpnServerConfigurationParameters) { - return beginCreateOrUpdateAsync( - resourceGroupName, virtualWanName, p2SVpnServerConfigurationName, p2SVpnServerConfigurationParameters) - .getSyncPoller(); - } - - /** - * Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it doesn't exist else updates the existing - * P2SVpnServerConfiguration. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWan. - * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. - * @param p2SVpnServerConfigurationParameters Parameters supplied to create or Update a P2SVpnServerConfiguration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return p2SVpnServerConfiguration Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, P2SVpnServerConfigurationInner> beginCreateOrUpdate( - String resourceGroupName, - String virtualWanName, - String p2SVpnServerConfigurationName, - P2SVpnServerConfigurationInner p2SVpnServerConfigurationParameters, - Context context) { - return beginCreateOrUpdateAsync( - resourceGroupName, - virtualWanName, - p2SVpnServerConfigurationName, - p2SVpnServerConfigurationParameters, - context) - .getSyncPoller(); - } - - /** - * Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it doesn't exist else updates the existing - * P2SVpnServerConfiguration. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWan. - * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. - * @param p2SVpnServerConfigurationParameters Parameters supplied to create or Update a P2SVpnServerConfiguration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return p2SVpnServerConfiguration Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, - String virtualWanName, - String p2SVpnServerConfigurationName, - P2SVpnServerConfigurationInner p2SVpnServerConfigurationParameters) { - return beginCreateOrUpdateAsync( - resourceGroupName, virtualWanName, p2SVpnServerConfigurationName, p2SVpnServerConfigurationParameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it doesn't exist else updates the existing - * P2SVpnServerConfiguration. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWan. - * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. - * @param p2SVpnServerConfigurationParameters Parameters supplied to create or Update a P2SVpnServerConfiguration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return p2SVpnServerConfiguration Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, - String virtualWanName, - String p2SVpnServerConfigurationName, - P2SVpnServerConfigurationInner p2SVpnServerConfigurationParameters, - Context context) { - return beginCreateOrUpdateAsync( - resourceGroupName, - virtualWanName, - p2SVpnServerConfigurationName, - p2SVpnServerConfigurationParameters, - context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it doesn't exist else updates the existing - * P2SVpnServerConfiguration. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWan. - * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. - * @param p2SVpnServerConfigurationParameters Parameters supplied to create or Update a P2SVpnServerConfiguration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return p2SVpnServerConfiguration Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public P2SVpnServerConfigurationInner createOrUpdate( - String resourceGroupName, - String virtualWanName, - String p2SVpnServerConfigurationName, - P2SVpnServerConfigurationInner p2SVpnServerConfigurationParameters) { - return createOrUpdateAsync( - resourceGroupName, virtualWanName, p2SVpnServerConfigurationName, p2SVpnServerConfigurationParameters) - .block(); - } - - /** - * Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it doesn't exist else updates the existing - * P2SVpnServerConfiguration. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWan. - * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. - * @param p2SVpnServerConfigurationParameters Parameters supplied to create or Update a P2SVpnServerConfiguration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return p2SVpnServerConfiguration Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public P2SVpnServerConfigurationInner createOrUpdate( - String resourceGroupName, - String virtualWanName, - String p2SVpnServerConfigurationName, - P2SVpnServerConfigurationInner p2SVpnServerConfigurationParameters, - Context context) { - return createOrUpdateAsync( - resourceGroupName, - virtualWanName, - p2SVpnServerConfigurationName, - p2SVpnServerConfigurationParameters, - context) - .block(); - } - - /** - * Deletes a P2SVpnServerConfiguration. - * - * @param resourceGroupName The resource group name of the P2SVpnServerConfiguration. - * @param virtualWanName The name of the VirtualWan. - * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync( - String resourceGroupName, String virtualWanName, String p2SVpnServerConfigurationName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualWanName == null) { - return Mono.error(new IllegalArgumentException("Parameter virtualWanName is required and cannot be null.")); - } - if (p2SVpnServerConfigurationName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter p2SVpnServerConfigurationName is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - virtualWanName, - p2SVpnServerConfigurationName, - apiVersion, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a P2SVpnServerConfiguration. - * - * @param resourceGroupName The resource group name of the P2SVpnServerConfiguration. - * @param virtualWanName The name of the VirtualWan. - * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String virtualWanName, String p2SVpnServerConfigurationName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualWanName == null) { - return Mono.error(new IllegalArgumentException("Parameter virtualWanName is required and cannot be null.")); - } - if (p2SVpnServerConfigurationName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter p2SVpnServerConfigurationName is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - virtualWanName, - p2SVpnServerConfigurationName, - apiVersion, - accept, - context); - } - - /** - * Deletes a P2SVpnServerConfiguration. - * - * @param resourceGroupName The resource group name of the P2SVpnServerConfiguration. - * @param virtualWanName The name of the VirtualWan. - * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String virtualWanName, String p2SVpnServerConfigurationName) { - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, virtualWanName, p2SVpnServerConfigurationName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deletes a P2SVpnServerConfiguration. - * - * @param resourceGroupName The resource group name of the P2SVpnServerConfiguration. - * @param virtualWanName The name of the VirtualWan. - * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String virtualWanName, String p2SVpnServerConfigurationName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, virtualWanName, p2SVpnServerConfigurationName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes a P2SVpnServerConfiguration. - * - * @param resourceGroupName The resource group name of the P2SVpnServerConfiguration. - * @param virtualWanName The name of the VirtualWan. - * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String virtualWanName, String p2SVpnServerConfigurationName) { - return beginDeleteAsync(resourceGroupName, virtualWanName, p2SVpnServerConfigurationName).getSyncPoller(); - } - - /** - * Deletes a P2SVpnServerConfiguration. - * - * @param resourceGroupName The resource group name of the P2SVpnServerConfiguration. - * @param virtualWanName The name of the VirtualWan. - * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String virtualWanName, String p2SVpnServerConfigurationName, Context context) { - return beginDeleteAsync(resourceGroupName, virtualWanName, p2SVpnServerConfigurationName, context) - .getSyncPoller(); - } - - /** - * Deletes a P2SVpnServerConfiguration. - * - * @param resourceGroupName The resource group name of the P2SVpnServerConfiguration. - * @param virtualWanName The name of the VirtualWan. - * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync( - String resourceGroupName, String virtualWanName, String p2SVpnServerConfigurationName) { - return beginDeleteAsync(resourceGroupName, virtualWanName, p2SVpnServerConfigurationName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a P2SVpnServerConfiguration. - * - * @param resourceGroupName The resource group name of the P2SVpnServerConfiguration. - * @param virtualWanName The name of the VirtualWan. - * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync( - String resourceGroupName, String virtualWanName, String p2SVpnServerConfigurationName, Context context) { - return beginDeleteAsync(resourceGroupName, virtualWanName, p2SVpnServerConfigurationName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a P2SVpnServerConfiguration. - * - * @param resourceGroupName The resource group name of the P2SVpnServerConfiguration. - * @param virtualWanName The name of the VirtualWan. - * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String virtualWanName, String p2SVpnServerConfigurationName) { - deleteAsync(resourceGroupName, virtualWanName, p2SVpnServerConfigurationName).block(); - } - - /** - * Deletes a P2SVpnServerConfiguration. - * - * @param resourceGroupName The resource group name of the P2SVpnServerConfiguration. - * @param virtualWanName The name of the VirtualWan. - * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete( - String resourceGroupName, String virtualWanName, String p2SVpnServerConfigurationName, Context context) { - deleteAsync(resourceGroupName, virtualWanName, p2SVpnServerConfigurationName, context).block(); - } - - /** - * Retrieves all P2SVpnServerConfigurations for a particular VirtualWan. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list all P2SVpnServerConfigurations associated to a VirtualWan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByVirtualWanSinglePageAsync( - String resourceGroupName, String virtualWanName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualWanName == null) { - return Mono.error(new IllegalArgumentException("Parameter virtualWanName is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByVirtualWan( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - virtualWanName, - apiVersion, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Retrieves all P2SVpnServerConfigurations for a particular VirtualWan. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWan. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list all P2SVpnServerConfigurations associated to a VirtualWan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByVirtualWanSinglePageAsync( - String resourceGroupName, String virtualWanName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualWanName == null) { - return Mono.error(new IllegalArgumentException("Parameter virtualWanName is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByVirtualWan( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - virtualWanName, - apiVersion, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Retrieves all P2SVpnServerConfigurations for a particular VirtualWan. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list all P2SVpnServerConfigurations associated to a VirtualWan. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByVirtualWanAsync( - String resourceGroupName, String virtualWanName) { - return new PagedFlux<>( - () -> listByVirtualWanSinglePageAsync(resourceGroupName, virtualWanName), - nextLink -> listByVirtualWanNextSinglePageAsync(nextLink)); - } - - /** - * Retrieves all P2SVpnServerConfigurations for a particular VirtualWan. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWan. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list all P2SVpnServerConfigurations associated to a VirtualWan. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByVirtualWanAsync( - String resourceGroupName, String virtualWanName, Context context) { - return new PagedFlux<>( - () -> listByVirtualWanSinglePageAsync(resourceGroupName, virtualWanName, context), - nextLink -> listByVirtualWanNextSinglePageAsync(nextLink, context)); - } - - /** - * Retrieves all P2SVpnServerConfigurations for a particular VirtualWan. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list all P2SVpnServerConfigurations associated to a VirtualWan. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByVirtualWan( - String resourceGroupName, String virtualWanName) { - return new PagedIterable<>(listByVirtualWanAsync(resourceGroupName, virtualWanName)); - } - - /** - * Retrieves all P2SVpnServerConfigurations for a particular VirtualWan. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWan. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list all P2SVpnServerConfigurations associated to a VirtualWan. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByVirtualWan( - String resourceGroupName, String virtualWanName, Context context) { - return new PagedIterable<>(listByVirtualWanAsync(resourceGroupName, virtualWanName, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list all P2SVpnServerConfigurations associated to a VirtualWan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByVirtualWanNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByVirtualWanNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list all P2SVpnServerConfigurations associated to a VirtualWan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByVirtualWanNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByVirtualWanNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/PCFilterImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/PCFilterImpl.java deleted file mode 100644 index 312c8a1422b6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/PCFilterImpl.java +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.resourcemanager.network.models.PCFilter; -import com.azure.resourcemanager.network.models.PacketCapture; -import com.azure.resourcemanager.network.models.PacketCaptureFilter; -import com.azure.resourcemanager.network.models.PcProtocol; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.IndexableWrapperImpl; -import java.util.List; - -/** Represents Packet Capture filter. */ -class PCFilterImpl extends IndexableWrapperImpl - implements PCFilter, PCFilter.Definition { - private static final String DELIMITER = ";"; - private static final String RANGE_DELIMITER = "-"; - private PacketCaptureImpl parent; - - PCFilterImpl(PacketCaptureFilter inner, PacketCaptureImpl parent) { - super(inner); - this.parent = parent; - } - - @Override - public PcProtocol protocol() { - return this.innerModel().protocol(); - } - - @Override - public String localIpAddress() { - return this.innerModel().localIpAddress(); - } - - @Override - public String remoteIpAddress() { - return this.innerModel().remoteIpAddress(); - } - - @Override - public String localPort() { - return this.innerModel().localPort(); - } - - @Override - public String remotePort() { - return this.innerModel().remotePort(); - } - - @Override - public PCFilterImpl withProtocol(PcProtocol protocol) { - this.innerModel().withProtocol(protocol); - return this; - } - - @Override - public PCFilterImpl withLocalIpAddress(String ipAddress) { - this.innerModel().withLocalIpAddress(ipAddress); - return this; - } - - @Override - public Definition withLocalIpAddressesRange( - String startIpAddress, String endIpAddress) { - this.innerModel().withLocalIpAddress(startIpAddress + RANGE_DELIMITER + endIpAddress); - return this; - } - - @Override - public Definition withLocalIpAddresses(List ipAddresses) { - StringBuilder ipAddressesString = new StringBuilder(); - for (String ipAddress : ipAddresses) { - ipAddressesString.append(ipAddress).append(DELIMITER); - } - this.innerModel().withLocalIpAddress(ipAddressesString.substring(0, ipAddressesString.length() - 1)); - return this; - } - - @Override - public PCFilterImpl withRemoteIpAddress(String ipAddress) { - this.innerModel().withRemoteIpAddress(ipAddress); - return this; - } - - @Override - public Definition withRemoteIpAddressesRange( - String startIpAddress, String endIpAddress) { - this.innerModel().withRemoteIpAddress(startIpAddress + RANGE_DELIMITER + endIpAddress); - return this; - } - - @Override - public Definition withRemoteIpAddresses(List ipAddresses) { - StringBuilder ipAddressesString = new StringBuilder(); - for (String ipAddress : ipAddresses) { - ipAddressesString.append(ipAddress).append(DELIMITER); - } - this.innerModel().withRemoteIpAddress(ipAddressesString.substring(0, ipAddressesString.length() - 1)); - return this; - } - - @Override - public PacketCapture parent() { - return parent; - } - - @Override - public PacketCaptureImpl attach() { - this.parent.attachPCFilter(this); - return parent; - } - - @Override - public Definition withLocalPort(int port) { - this.innerModel().withLocalPort(String.valueOf(port)); - return this; - } - - @Override - public Definition withLocalPortRange(int startPort, int endPort) { - this.innerModel().withLocalPort(startPort + RANGE_DELIMITER + endPort); - return this; - } - - @Override - public Definition withLocalPorts(List ports) { - StringBuilder portsString = new StringBuilder(); - for (int port : ports) { - portsString.append(port).append(DELIMITER); - } - this.innerModel().withLocalPort(portsString.substring(0, portsString.length() - 1)); - return this; - } - - @Override - public Definition withRemotePort(int port) { - this.innerModel().withRemotePort(String.valueOf(port)); - return this; - } - - @Override - public Definition withRemotePortRange(int startPort, int endPort) { - this.innerModel().withRemotePort(startPort + RANGE_DELIMITER + endPort); - return this; - } - - @Override - public Definition withRemotePorts(List ports) { - StringBuilder portsString = new StringBuilder(); - for (int port : ports) { - portsString.append(port).append(DELIMITER); - } - this.innerModel().withRemotePort(portsString.substring(0, portsString.length() - 1)); - return this; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/PacketCaptureImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/PacketCaptureImpl.java deleted file mode 100644 index 0939e2f9f24f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/PacketCaptureImpl.java +++ /dev/null @@ -1,180 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.resourcemanager.network.fluent.PacketCapturesClient; -import com.azure.resourcemanager.network.fluent.models.PacketCaptureInner; -import com.azure.resourcemanager.network.fluent.models.PacketCaptureResultInner; -import com.azure.resourcemanager.network.models.NetworkWatcher; -import com.azure.resourcemanager.network.models.PCFilter; -import com.azure.resourcemanager.network.models.PacketCapture; -import com.azure.resourcemanager.network.models.PacketCaptureFilter; -import com.azure.resourcemanager.network.models.PacketCaptureStatus; -import com.azure.resourcemanager.network.models.PacketCaptureStorageLocation; -import com.azure.resourcemanager.network.models.ProvisioningState; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.CreatableUpdatableImpl; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import reactor.core.publisher.Mono; - -import java.util.ArrayList; -import java.util.List; - -/** Implementation for Packet Capture and its create and update interfaces. */ -public class PacketCaptureImpl - extends CreatableUpdatableImpl - implements PacketCapture, PacketCapture.Definition { - private final PacketCapturesClient client; - private final PacketCaptureInner createParameters; - private final NetworkWatcher parent; - - PacketCaptureImpl( - String name, NetworkWatcherImpl parent, PacketCaptureResultInner innerObject, PacketCapturesClient client) { - super(name, innerObject); - this.client = client; - this.parent = parent; - this.createParameters = new PacketCaptureInner(); - } - - @Override - protected Mono getInnerAsync() { - return this.client.getAsync(parent.resourceGroupName(), parent.name(), name()); - } - - @Override - public void stop() { - stopAsync().block(); - } - - @Override - public Mono stopAsync() { - return this.client.stopAsync(parent.resourceGroupName(), parent.name(), name()); - } - - @Override - public PacketCaptureStatus getStatus() { - return getStatusAsync().block(); - } - - @Override - public Mono getStatusAsync() { - return this - .client - .getStatusAsync(parent.resourceGroupName(), parent.name(), name()) - .map(inner -> new PacketCaptureStatusImpl(inner)); - } - - @Override - public PacketCaptureImpl withTarget(String target) { - createParameters.withTarget(target); - return this; - } - - @Override - public PacketCaptureImpl withStorageAccountId(String storageId) { - PacketCaptureStorageLocation storageLocation = createParameters.storageLocation(); - if (storageLocation == null) { - storageLocation = new PacketCaptureStorageLocation(); - } - createParameters.withStorageLocation(storageLocation.withStorageId(storageId)); - return this; - } - - @Override - public DefinitionStages.WithCreate withStoragePath(String storagePath) { - createParameters.storageLocation().withStoragePath(storagePath); - return this; - } - - @Override - public PacketCaptureImpl withFilePath(String filePath) { - PacketCaptureStorageLocation storageLocation = createParameters.storageLocation(); - if (storageLocation == null) { - storageLocation = new PacketCaptureStorageLocation(); - } - createParameters.withStorageLocation(storageLocation.withFilePath(filePath)); - return this; - } - - @Override - public PacketCaptureImpl withBytesToCapturePerPacket(long bytesToCapturePerPacket) { - createParameters.withBytesToCapturePerPacket((int) bytesToCapturePerPacket); - return this; - } - - @Override - public PacketCaptureImpl withTotalBytesPerSession(long totalBytesPerSession) { - createParameters.withTotalBytesPerSession((int) totalBytesPerSession); - return this; - } - - @Override - public PacketCaptureImpl withTimeLimitInSeconds(int timeLimitInSeconds) { - createParameters.withTimeLimitInSeconds(timeLimitInSeconds); - return this; - } - - @Override - public PCFilter.Definition definePacketCaptureFilter() { - return new PCFilterImpl(new PacketCaptureFilter(), this); - } - - void attachPCFilter(PCFilterImpl pcFilter) { - if (createParameters.filters() == null) { - createParameters.withFilters(new ArrayList()); - } - createParameters.filters().add(pcFilter.innerModel()); - } - - @Override - public boolean isInCreateMode() { - return this.innerModel().id() == null; - } - - @Override - public Mono createResourceAsync() { - return this - .client - .createAsync(parent.resourceGroupName(), parent.name(), this.name(), createParameters) - .map(innerToFluentMap(this)); - } - - @Override - public String id() { - return innerModel().id(); - } - - @Override - public String targetId() { - return innerModel().target(); - } - - @Override - public long bytesToCapturePerPacket() { - return ResourceManagerUtils.toPrimitiveInt(innerModel().bytesToCapturePerPacket()); - } - - @Override - public long totalBytesPerSession() { - return ResourceManagerUtils.toPrimitiveInt(innerModel().totalBytesPerSession()); - } - - @Override - public int timeLimitInSeconds() { - return ResourceManagerUtils.toPrimitiveInt(innerModel().timeLimitInSeconds()); - } - - @Override - public PacketCaptureStorageLocation storageLocation() { - return innerModel().storageLocation(); - } - - @Override - public List filters() { - return innerModel().filters(); - } - - @Override - public ProvisioningState provisioningState() { - return innerModel().provisioningState(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/PacketCaptureStatusImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/PacketCaptureStatusImpl.java deleted file mode 100644 index 6f67dc952905..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/PacketCaptureStatusImpl.java +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.resourcemanager.network.models.PacketCaptureStatus; -import com.azure.resourcemanager.network.models.PcError; -import com.azure.resourcemanager.network.models.PcStatus; -import com.azure.resourcemanager.network.fluent.models.PacketCaptureQueryStatusResultInner; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.WrapperImpl; -import java.time.OffsetDateTime; -import java.util.List; - -/** Implementation for {@link PacketCaptureStatus}. */ -class PacketCaptureStatusImpl extends WrapperImpl implements PacketCaptureStatus { - PacketCaptureStatusImpl(PacketCaptureQueryStatusResultInner innerObject) { - super(innerObject); - } - - @Override - public String name() { - return innerModel().name(); - } - - @Override - public String id() { - return innerModel().id(); - } - - @Override - public OffsetDateTime captureStartTime() { - return innerModel().captureStartTime(); - } - - @Override - public PcStatus packetCaptureStatus() { - return innerModel().packetCaptureStatus(); - } - - @Override - public String stopReason() { - return innerModel().stopReason(); - } - - @Override - public List packetCaptureErrors() { - return innerModel().packetCaptureError(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/PacketCapturesClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/PacketCapturesClientImpl.java deleted file mode 100644 index 7f476e3ed691..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/PacketCapturesClientImpl.java +++ /dev/null @@ -1,1616 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.PacketCapturesClient; -import com.azure.resourcemanager.network.fluent.models.PacketCaptureInner; -import com.azure.resourcemanager.network.fluent.models.PacketCaptureQueryStatusResultInner; -import com.azure.resourcemanager.network.fluent.models.PacketCaptureResultInner; -import com.azure.resourcemanager.network.models.PacketCaptureListResult; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in PacketCapturesClient. */ -public final class PacketCapturesClientImpl implements PacketCapturesClient { - private final ClientLogger logger = new ClientLogger(PacketCapturesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final PacketCapturesService service; - - /** The service client containing this operation class. */ - private final NetworkManagementClientImpl client; - - /** - * Initializes an instance of PacketCapturesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - PacketCapturesClientImpl(NetworkManagementClientImpl client) { - this.service = - RestProxy.create(PacketCapturesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for NetworkManagementClientPacketCaptures to be used by the proxy service - * to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "NetworkManagementCli") - private interface PacketCapturesService { - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}") - @ExpectedResponses({201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> create( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("networkWatcherName") String networkWatcherName, - @PathParam("packetCaptureName") String packetCaptureName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") PacketCaptureInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("networkWatcherName") String networkWatcherName, - @PathParam("packetCaptureName") String packetCaptureName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}") - @ExpectedResponses({202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("networkWatcherName") String networkWatcherName, - @PathParam("packetCaptureName") String packetCaptureName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/stop") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> stop( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("networkWatcherName") String networkWatcherName, - @PathParam("packetCaptureName") String packetCaptureName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/queryStatus") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> getStatus( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("networkWatcherName") String networkWatcherName, - @PathParam("packetCaptureName") String packetCaptureName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/networkWatchers/{networkWatcherName}/packetCaptures") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("networkWatcherName") String networkWatcherName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Create and start a packet capture on the specified VM. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param packetCaptureName The name of the packet capture session. - * @param parameters Parameters that define the create packet capture operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about packet capture session. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createWithResponseAsync( - String resourceGroupName, String networkWatcherName, String packetCaptureName, PacketCaptureInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkWatcherName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); - } - if (packetCaptureName == null) { - return Mono - .error(new IllegalArgumentException("Parameter packetCaptureName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .create( - this.client.getEndpoint(), - resourceGroupName, - networkWatcherName, - packetCaptureName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create and start a packet capture on the specified VM. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param packetCaptureName The name of the packet capture session. - * @param parameters Parameters that define the create packet capture operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about packet capture session. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createWithResponseAsync( - String resourceGroupName, - String networkWatcherName, - String packetCaptureName, - PacketCaptureInner parameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkWatcherName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); - } - if (packetCaptureName == null) { - return Mono - .error(new IllegalArgumentException("Parameter packetCaptureName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .create( - this.client.getEndpoint(), - resourceGroupName, - networkWatcherName, - packetCaptureName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Create and start a packet capture on the specified VM. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param packetCaptureName The name of the packet capture session. - * @param parameters Parameters that define the create packet capture operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about packet capture session. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, PacketCaptureResultInner> beginCreateAsync( - String resourceGroupName, String networkWatcherName, String packetCaptureName, PacketCaptureInner parameters) { - Mono>> mono = - createWithResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - PacketCaptureResultInner.class, - PacketCaptureResultInner.class, - Context.NONE); - } - - /** - * Create and start a packet capture on the specified VM. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param packetCaptureName The name of the packet capture session. - * @param parameters Parameters that define the create packet capture operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about packet capture session. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, PacketCaptureResultInner> beginCreateAsync( - String resourceGroupName, - String networkWatcherName, - String packetCaptureName, - PacketCaptureInner parameters, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createWithResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName, parameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - PacketCaptureResultInner.class, - PacketCaptureResultInner.class, - context); - } - - /** - * Create and start a packet capture on the specified VM. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param packetCaptureName The name of the packet capture session. - * @param parameters Parameters that define the create packet capture operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about packet capture session. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, PacketCaptureResultInner> beginCreate( - String resourceGroupName, String networkWatcherName, String packetCaptureName, PacketCaptureInner parameters) { - return beginCreateAsync(resourceGroupName, networkWatcherName, packetCaptureName, parameters).getSyncPoller(); - } - - /** - * Create and start a packet capture on the specified VM. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param packetCaptureName The name of the packet capture session. - * @param parameters Parameters that define the create packet capture operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about packet capture session. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, PacketCaptureResultInner> beginCreate( - String resourceGroupName, - String networkWatcherName, - String packetCaptureName, - PacketCaptureInner parameters, - Context context) { - return beginCreateAsync(resourceGroupName, networkWatcherName, packetCaptureName, parameters, context) - .getSyncPoller(); - } - - /** - * Create and start a packet capture on the specified VM. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param packetCaptureName The name of the packet capture session. - * @param parameters Parameters that define the create packet capture operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about packet capture session. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createAsync( - String resourceGroupName, String networkWatcherName, String packetCaptureName, PacketCaptureInner parameters) { - return beginCreateAsync(resourceGroupName, networkWatcherName, packetCaptureName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create and start a packet capture on the specified VM. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param packetCaptureName The name of the packet capture session. - * @param parameters Parameters that define the create packet capture operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about packet capture session. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync( - String resourceGroupName, - String networkWatcherName, - String packetCaptureName, - PacketCaptureInner parameters, - Context context) { - return beginCreateAsync(resourceGroupName, networkWatcherName, packetCaptureName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create and start a packet capture on the specified VM. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param packetCaptureName The name of the packet capture session. - * @param parameters Parameters that define the create packet capture operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about packet capture session. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PacketCaptureResultInner create( - String resourceGroupName, String networkWatcherName, String packetCaptureName, PacketCaptureInner parameters) { - return createAsync(resourceGroupName, networkWatcherName, packetCaptureName, parameters).block(); - } - - /** - * Create and start a packet capture on the specified VM. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param packetCaptureName The name of the packet capture session. - * @param parameters Parameters that define the create packet capture operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about packet capture session. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PacketCaptureResultInner create( - String resourceGroupName, - String networkWatcherName, - String packetCaptureName, - PacketCaptureInner parameters, - Context context) { - return createAsync(resourceGroupName, networkWatcherName, packetCaptureName, parameters, context).block(); - } - - /** - * Gets a packet capture session by name. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param packetCaptureName The name of the packet capture session. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a packet capture session by name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String resourceGroupName, String networkWatcherName, String packetCaptureName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkWatcherName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); - } - if (packetCaptureName == null) { - return Mono - .error(new IllegalArgumentException("Parameter packetCaptureName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - resourceGroupName, - networkWatcherName, - packetCaptureName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a packet capture session by name. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param packetCaptureName The name of the packet capture session. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a packet capture session by name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String networkWatcherName, String packetCaptureName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkWatcherName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); - } - if (packetCaptureName == null) { - return Mono - .error(new IllegalArgumentException("Parameter packetCaptureName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - resourceGroupName, - networkWatcherName, - packetCaptureName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets a packet capture session by name. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param packetCaptureName The name of the packet capture session. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a packet capture session by name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync( - String resourceGroupName, String networkWatcherName, String packetCaptureName) { - return getWithResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a packet capture session by name. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param packetCaptureName The name of the packet capture session. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a packet capture session by name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PacketCaptureResultInner get(String resourceGroupName, String networkWatcherName, String packetCaptureName) { - return getAsync(resourceGroupName, networkWatcherName, packetCaptureName).block(); - } - - /** - * Gets a packet capture session by name. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param packetCaptureName The name of the packet capture session. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a packet capture session by name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String networkWatcherName, String packetCaptureName, Context context) { - return getWithResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName, context).block(); - } - - /** - * Deletes the specified packet capture session. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param packetCaptureName The name of the packet capture session. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync( - String resourceGroupName, String networkWatcherName, String packetCaptureName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkWatcherName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); - } - if (packetCaptureName == null) { - return Mono - .error(new IllegalArgumentException("Parameter packetCaptureName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - networkWatcherName, - packetCaptureName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the specified packet capture session. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param packetCaptureName The name of the packet capture session. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String networkWatcherName, String packetCaptureName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkWatcherName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); - } - if (packetCaptureName == null) { - return Mono - .error(new IllegalArgumentException("Parameter packetCaptureName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - networkWatcherName, - packetCaptureName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Deletes the specified packet capture session. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param packetCaptureName The name of the packet capture session. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String networkWatcherName, String packetCaptureName) { - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deletes the specified packet capture session. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param packetCaptureName The name of the packet capture session. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String networkWatcherName, String packetCaptureName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes the specified packet capture session. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param packetCaptureName The name of the packet capture session. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String networkWatcherName, String packetCaptureName) { - return beginDeleteAsync(resourceGroupName, networkWatcherName, packetCaptureName).getSyncPoller(); - } - - /** - * Deletes the specified packet capture session. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param packetCaptureName The name of the packet capture session. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String networkWatcherName, String packetCaptureName, Context context) { - return beginDeleteAsync(resourceGroupName, networkWatcherName, packetCaptureName, context).getSyncPoller(); - } - - /** - * Deletes the specified packet capture session. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param packetCaptureName The name of the packet capture session. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName) { - return beginDeleteAsync(resourceGroupName, networkWatcherName, packetCaptureName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified packet capture session. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param packetCaptureName The name of the packet capture session. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync( - String resourceGroupName, String networkWatcherName, String packetCaptureName, Context context) { - return beginDeleteAsync(resourceGroupName, networkWatcherName, packetCaptureName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified packet capture session. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param packetCaptureName The name of the packet capture session. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String networkWatcherName, String packetCaptureName) { - deleteAsync(resourceGroupName, networkWatcherName, packetCaptureName).block(); - } - - /** - * Deletes the specified packet capture session. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param packetCaptureName The name of the packet capture session. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String networkWatcherName, String packetCaptureName, Context context) { - deleteAsync(resourceGroupName, networkWatcherName, packetCaptureName, context).block(); - } - - /** - * Stops a specified packet capture session. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param packetCaptureName The name of the packet capture session. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> stopWithResponseAsync( - String resourceGroupName, String networkWatcherName, String packetCaptureName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkWatcherName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); - } - if (packetCaptureName == null) { - return Mono - .error(new IllegalArgumentException("Parameter packetCaptureName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .stop( - this.client.getEndpoint(), - resourceGroupName, - networkWatcherName, - packetCaptureName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Stops a specified packet capture session. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param packetCaptureName The name of the packet capture session. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> stopWithResponseAsync( - String resourceGroupName, String networkWatcherName, String packetCaptureName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkWatcherName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); - } - if (packetCaptureName == null) { - return Mono - .error(new IllegalArgumentException("Parameter packetCaptureName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .stop( - this.client.getEndpoint(), - resourceGroupName, - networkWatcherName, - packetCaptureName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Stops a specified packet capture session. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param packetCaptureName The name of the packet capture session. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginStopAsync( - String resourceGroupName, String networkWatcherName, String packetCaptureName) { - Mono>> mono = - stopWithResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Stops a specified packet capture session. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param packetCaptureName The name of the packet capture session. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginStopAsync( - String resourceGroupName, String networkWatcherName, String packetCaptureName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - stopWithResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Stops a specified packet capture session. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param packetCaptureName The name of the packet capture session. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginStop( - String resourceGroupName, String networkWatcherName, String packetCaptureName) { - return beginStopAsync(resourceGroupName, networkWatcherName, packetCaptureName).getSyncPoller(); - } - - /** - * Stops a specified packet capture session. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param packetCaptureName The name of the packet capture session. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginStop( - String resourceGroupName, String networkWatcherName, String packetCaptureName, Context context) { - return beginStopAsync(resourceGroupName, networkWatcherName, packetCaptureName, context).getSyncPoller(); - } - - /** - * Stops a specified packet capture session. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param packetCaptureName The name of the packet capture session. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono stopAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName) { - return beginStopAsync(resourceGroupName, networkWatcherName, packetCaptureName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Stops a specified packet capture session. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param packetCaptureName The name of the packet capture session. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono stopAsync( - String resourceGroupName, String networkWatcherName, String packetCaptureName, Context context) { - return beginStopAsync(resourceGroupName, networkWatcherName, packetCaptureName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Stops a specified packet capture session. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param packetCaptureName The name of the packet capture session. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void stop(String resourceGroupName, String networkWatcherName, String packetCaptureName) { - stopAsync(resourceGroupName, networkWatcherName, packetCaptureName).block(); - } - - /** - * Stops a specified packet capture session. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param packetCaptureName The name of the packet capture session. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void stop(String resourceGroupName, String networkWatcherName, String packetCaptureName, Context context) { - stopAsync(resourceGroupName, networkWatcherName, packetCaptureName, context).block(); - } - - /** - * Query the status of a running packet capture session. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the Network Watcher resource. - * @param packetCaptureName The name given to the packet capture session. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return status of packet capture session. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> getStatusWithResponseAsync( - String resourceGroupName, String networkWatcherName, String packetCaptureName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkWatcherName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); - } - if (packetCaptureName == null) { - return Mono - .error(new IllegalArgumentException("Parameter packetCaptureName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getStatus( - this.client.getEndpoint(), - resourceGroupName, - networkWatcherName, - packetCaptureName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Query the status of a running packet capture session. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the Network Watcher resource. - * @param packetCaptureName The name given to the packet capture session. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return status of packet capture session. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> getStatusWithResponseAsync( - String resourceGroupName, String networkWatcherName, String packetCaptureName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkWatcherName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); - } - if (packetCaptureName == null) { - return Mono - .error(new IllegalArgumentException("Parameter packetCaptureName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getStatus( - this.client.getEndpoint(), - resourceGroupName, - networkWatcherName, - packetCaptureName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Query the status of a running packet capture session. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the Network Watcher resource. - * @param packetCaptureName The name given to the packet capture session. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return status of packet capture session. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, PacketCaptureQueryStatusResultInner> - beginGetStatusAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName) { - Mono>> mono = - getStatusWithResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - PacketCaptureQueryStatusResultInner.class, - PacketCaptureQueryStatusResultInner.class, - Context.NONE); - } - - /** - * Query the status of a running packet capture session. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the Network Watcher resource. - * @param packetCaptureName The name given to the packet capture session. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return status of packet capture session. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, PacketCaptureQueryStatusResultInner> - beginGetStatusAsync( - String resourceGroupName, String networkWatcherName, String packetCaptureName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - getStatusWithResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - PacketCaptureQueryStatusResultInner.class, - PacketCaptureQueryStatusResultInner.class, - context); - } - - /** - * Query the status of a running packet capture session. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the Network Watcher resource. - * @param packetCaptureName The name given to the packet capture session. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return status of packet capture session. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, PacketCaptureQueryStatusResultInner> - beginGetStatus(String resourceGroupName, String networkWatcherName, String packetCaptureName) { - return beginGetStatusAsync(resourceGroupName, networkWatcherName, packetCaptureName).getSyncPoller(); - } - - /** - * Query the status of a running packet capture session. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the Network Watcher resource. - * @param packetCaptureName The name given to the packet capture session. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return status of packet capture session. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, PacketCaptureQueryStatusResultInner> - beginGetStatus(String resourceGroupName, String networkWatcherName, String packetCaptureName, Context context) { - return beginGetStatusAsync(resourceGroupName, networkWatcherName, packetCaptureName, context).getSyncPoller(); - } - - /** - * Query the status of a running packet capture session. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the Network Watcher resource. - * @param packetCaptureName The name given to the packet capture session. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return status of packet capture session. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getStatusAsync( - String resourceGroupName, String networkWatcherName, String packetCaptureName) { - return beginGetStatusAsync(resourceGroupName, networkWatcherName, packetCaptureName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Query the status of a running packet capture session. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the Network Watcher resource. - * @param packetCaptureName The name given to the packet capture session. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return status of packet capture session. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getStatusAsync( - String resourceGroupName, String networkWatcherName, String packetCaptureName, Context context) { - return beginGetStatusAsync(resourceGroupName, networkWatcherName, packetCaptureName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Query the status of a running packet capture session. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the Network Watcher resource. - * @param packetCaptureName The name given to the packet capture session. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return status of packet capture session. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PacketCaptureQueryStatusResultInner getStatus( - String resourceGroupName, String networkWatcherName, String packetCaptureName) { - return getStatusAsync(resourceGroupName, networkWatcherName, packetCaptureName).block(); - } - - /** - * Query the status of a running packet capture session. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the Network Watcher resource. - * @param packetCaptureName The name given to the packet capture session. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return status of packet capture session. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PacketCaptureQueryStatusResultInner getStatus( - String resourceGroupName, String networkWatcherName, String packetCaptureName, Context context) { - return getStatusAsync(resourceGroupName, networkWatcherName, packetCaptureName, context).block(); - } - - /** - * Lists all packet capture sessions within the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the Network Watcher resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of packet capture sessions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String networkWatcherName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkWatcherName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - resourceGroupName, - networkWatcherName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all packet capture sessions within the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the Network Watcher resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of packet capture sessions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String networkWatcherName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkWatcherName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - resourceGroupName, - networkWatcherName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); - } - - /** - * Lists all packet capture sessions within the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the Network Watcher resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of packet capture sessions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String resourceGroupName, String networkWatcherName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, networkWatcherName)); - } - - /** - * Lists all packet capture sessions within the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the Network Watcher resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of packet capture sessions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String networkWatcherName, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, networkWatcherName, context)); - } - - /** - * Lists all packet capture sessions within the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the Network Watcher resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of packet capture sessions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String networkWatcherName) { - return new PagedIterable<>(listAsync(resourceGroupName, networkWatcherName)); - } - - /** - * Lists all packet capture sessions within the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the Network Watcher resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of packet capture sessions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, String networkWatcherName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, networkWatcherName, context)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/PacketCapturesImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/PacketCapturesImpl.java deleted file mode 100644 index 41244d01c2ff..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/PacketCapturesImpl.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.network.fluent.PacketCapturesClient; -import com.azure.resourcemanager.network.fluent.models.PacketCaptureResultInner; -import com.azure.resourcemanager.network.models.PacketCapture; -import com.azure.resourcemanager.network.models.PacketCaptures; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceId; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.CreatableResourcesImpl; -import reactor.core.publisher.Mono; - -/** Represents Packet Captures collection associated with Network Watcher. */ -class PacketCapturesImpl extends CreatableResourcesImpl - implements PacketCaptures { - private final NetworkWatcherImpl parent; - protected final PacketCapturesClient innerCollection; - - /** - * Creates a new PacketCapturesImpl. - * - * @param parent the Network Watcher associated with Packet Captures - */ - PacketCapturesImpl(PacketCapturesClient innerCollection, NetworkWatcherImpl parent) { - this.parent = parent; - this.innerCollection = innerCollection; - } - - @Override - public final PagedIterable list() { - return wrapList(inner().list(parent.resourceGroupName(), parent.name())); - } - - /** @return an observable emits packet captures in this collection */ - @Override - public PagedFlux listAsync() { - return wrapPageAsync(inner().listAsync(parent.resourceGroupName(), parent.name())); - } - - @Override - protected PacketCaptureImpl wrapModel(String name) { - return new PacketCaptureImpl(name, parent, new PacketCaptureResultInner(), inner()); - } - - protected PacketCaptureImpl wrapModel(PacketCaptureResultInner inner) { - return (inner == null) ? null : new PacketCaptureImpl(inner.name(), parent, inner, inner()); - } - - @Override - public PacketCaptureImpl define(String name) { - return new PacketCaptureImpl(name, parent, new PacketCaptureResultInner(), inner()); - } - - @Override - public Mono getByNameAsync(String name) { - return inner().getAsync(parent.resourceGroupName(), parent.name(), name).map(inner -> wrapModel(inner)); - } - - @Override - public PacketCapture getByName(String name) { - return getByNameAsync(name).block(); - } - - @Override - public void deleteByName(String name) { - deleteByNameAsync(name).block(); - } - - @Override - public Mono deleteByNameAsync(String name) { - return this.inner().deleteAsync(parent.resourceGroupName(), parent.name(), name); - } - - public PacketCapturesClient inner() { - return innerCollection; - } - - @Override - public Mono deleteByIdAsync(String id) { - ResourceId resourceId = ResourceId.fromString(id); - return this.inner().deleteAsync(resourceId.resourceGroupName(), resourceId.parent().name(), resourceId.name()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/PointToSiteConfigurationImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/PointToSiteConfigurationImpl.java deleted file mode 100644 index 4685711a7200..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/PointToSiteConfigurationImpl.java +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.resourcemanager.network.models.AddressSpace; -import com.azure.resourcemanager.network.models.PointToSiteConfiguration; -import com.azure.resourcemanager.network.models.VirtualNetworkGateway; -import com.azure.resourcemanager.network.models.VpnClientConfiguration; -import com.azure.resourcemanager.network.models.VpnClientProtocol; -import com.azure.resourcemanager.network.models.VpnClientRevokedCertificate; -import com.azure.resourcemanager.network.models.VpnClientRootCertificate; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.IndexableWrapperImpl; -import java.io.File; -import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -/** Implementation for PointToSiteConfiguration and its create and update interfaces. */ -class PointToSiteConfigurationImpl extends IndexableWrapperImpl - implements PointToSiteConfiguration, - PointToSiteConfiguration.Definition, - PointToSiteConfiguration.Update { - private static final String BEGIN_CERT = "-----BEGIN CERTIFICATE-----"; - private static final String END_CERT = "-----END CERTIFICATE-----"; - - private VirtualNetworkGatewayImpl parent; - - PointToSiteConfigurationImpl(VpnClientConfiguration inner, VirtualNetworkGatewayImpl parent) { - super(inner); - this.parent = parent; - } - - @Override - public VirtualNetworkGatewayImpl attach() { - parent.attachPointToSiteConfiguration(this); - return parent; - } - - @Override - public PointToSiteConfigurationImpl withAddressPool(String addressPool) { - List addressPrefixes = new ArrayList<>(); - addressPrefixes.add(addressPool); - innerModel().withVpnClientAddressPool(new AddressSpace().withAddressPrefixes(addressPrefixes)); - return this; - } - - @Override - public PointToSiteConfigurationImpl withAzureCertificate(String name, String certificateData) { - if (innerModel().vpnClientRootCertificates() == null) { - innerModel().withVpnClientRootCertificates(new ArrayList()); - } - innerModel() - .vpnClientRootCertificates() - .add(new VpnClientRootCertificate().withName(name).withPublicCertData(certificateData)); - innerModel().withRadiusServerAddress(null).withRadiusServerSecret(null); - return this; - } - - @Override - public PointToSiteConfigurationImpl withAzureCertificateFromFile(String name, File certificateFile) - throws IOException { - if (certificateFile == null) { - return this; - } else { - byte[] content = Files.readAllBytes(certificateFile.toPath()); - String certificate = - new String(content, StandardCharsets.UTF_8).replace(BEGIN_CERT, "").replace(END_CERT, ""); - return this.withAzureCertificate(name, certificate); - } - } - - @Override - public Update withoutAzureCertificate(String name) { - if (innerModel().vpnClientRootCertificates() != null) { - for (VpnClientRootCertificate certificateInner : innerModel().vpnClientRootCertificates()) { - if (name.equals(certificateInner.name())) { - innerModel().vpnClientRootCertificates().remove(certificateInner); - break; - } - } - } - return this; - } - - @Override - public PointToSiteConfigurationImpl withRadiusAuthentication(String serverIPAddress, String serverSecret) { - innerModel().withRadiusServerAddress(serverIPAddress).withRadiusServerSecret(serverSecret); - innerModel().withVpnClientRootCertificates(null); - innerModel().withVpnClientRevokedCertificates(null); - return this; - } - - @Override - public PointToSiteConfigurationImpl withRevokedCertificate(String name, String thumbprint) { - if (innerModel().vpnClientRevokedCertificates() == null) { - innerModel().withVpnClientRevokedCertificates(new ArrayList()); - } - innerModel() - .vpnClientRevokedCertificates() - .add(new VpnClientRevokedCertificate().withName(name).withThumbprint(thumbprint)); - innerModel().withRadiusServerAddress(null).withRadiusServerSecret(null); - return this; - } - - @Override - public PointToSiteConfigurationImpl withSstpOnly() { - innerModel().withVpnClientProtocols(Collections.singletonList(VpnClientProtocol.SSTP)); - return this; - } - - @Override - public PointToSiteConfigurationImpl withIkeV2Only() { - innerModel().withVpnClientProtocols(Collections.singletonList(VpnClientProtocol.IKE_V2)); - return this; - } - - @Override - public VirtualNetworkGateway.Update parent() { - return parent; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/PublicIpAddressImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/PublicIpAddressImpl.java deleted file mode 100644 index ea2b32e114b1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/PublicIpAddressImpl.java +++ /dev/null @@ -1,371 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.network.models.IpAllocationMethod; -import com.azure.resourcemanager.network.models.IpTag; -import com.azure.resourcemanager.network.models.IpVersion; -import com.azure.resourcemanager.network.models.LoadBalancer; -import com.azure.resourcemanager.network.models.LoadBalancerPublicFrontend; -import com.azure.resourcemanager.network.models.NetworkInterface; -import com.azure.resourcemanager.network.models.NicIpConfiguration; -import com.azure.resourcemanager.network.models.PublicIpAddress; -import com.azure.resourcemanager.network.models.PublicIpAddressDnsSettings; -import com.azure.resourcemanager.network.models.PublicIPSkuType; -import com.azure.resourcemanager.network.models.AppliableWithTags; -import com.azure.resourcemanager.network.fluent.models.IpConfigurationInner; -import com.azure.resourcemanager.network.fluent.models.PublicIpAddressInner; -import com.azure.resourcemanager.network.models.TagsObject; -import com.azure.resourcemanager.resources.fluentcore.arm.AvailabilityZoneId; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils; -import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.GroupableResourceImpl; -import com.azure.resourcemanager.resources.fluentcore.model.Accepted; -import com.azure.resourcemanager.resources.fluentcore.model.Indexable; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.AcceptedImpl; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashSet; -import java.util.List; -import java.util.Locale; -import java.util.Set; - -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** Implementation for PublicIPAddress and its create and update interfaces. */ -class PublicIpAddressImpl - extends GroupableResourceImpl - implements PublicIpAddress, PublicIpAddress.Definition, PublicIpAddress.Update, AppliableWithTags { - - private final ClientLogger logger = new ClientLogger(this.getClass()); - - PublicIpAddressImpl(String name, PublicIpAddressInner innerModel, final NetworkManager networkManager) { - super(name, innerModel, networkManager); - } - - // Verbs - - @Override - protected Mono getInnerAsync() { - return this - .manager() - .serviceClient() - .getPublicIpAddresses() - .getByResourceGroupAsync(this.resourceGroupName(), this.name(), null); - } - - // Setters (fluent) - - @Override - public PublicIpAddressImpl withIdleTimeoutInMinutes(int minutes) { - this.innerModel().withIdleTimeoutInMinutes(minutes); - return this; - } - - @Override - public PublicIpAddressImpl withStaticIP() { - this.innerModel().withPublicIpAllocationMethod(IpAllocationMethod.STATIC); - return this; - } - - @Override - public PublicIpAddressImpl withDynamicIP() { - this.innerModel().withPublicIpAllocationMethod(IpAllocationMethod.DYNAMIC); - return this; - } - - @Override - public PublicIpAddressImpl withLeafDomainLabel(String dnsName) { - if (this.innerModel().dnsSettings() == null) { - this.innerModel().withDnsSettings(new PublicIpAddressDnsSettings()); - } - this - .innerModel() - .dnsSettings() - .withDomainNameLabel((dnsName == null) ? null : dnsName.toLowerCase(Locale.ROOT)); - return this; - } - - @Override - public PublicIpAddressImpl withAvailabilityZone(AvailabilityZoneId zoneId) { - // Note: Zone is not updatable as of now, so this is available only during definition time. - // Service return `ResourceAvailabilityZonesCannotBeModified` upon attempt to append a new - // zone or remove one. Trying to remove the last one means attempt to change resource from - // zonal to regional, which is not supported. - // - if (this.innerModel().zones() == null) { - this.innerModel().withZones(new ArrayList()); - } - this.innerModel().zones().add(zoneId.toString()); - return this; - } - - @Override - public PublicIpAddressImpl withSku(PublicIPSkuType skuType) { - // Note: SKU is not updatable as of now, so this is available only during definition time. - // Service return `SkuCannotBeChangedOnUpdate` upon attempt to change it. - // Service default is PublicIPSkuType.BASIC - // - this.innerModel().withSku(skuType.sku()); - return this; - } - - @Override - public PublicIpAddressImpl withoutLeafDomainLabel() { - this.innerModel().withDnsSettings(null); - return this; - } - - @Override - public PublicIpAddressImpl withReverseFqdn(String reverseFqdn) { - if (this.innerModel().dnsSettings() == null) { - this.innerModel().withDnsSettings(new PublicIpAddressDnsSettings()); - } - this - .innerModel() - .dnsSettings() - .withReverseFqdn(reverseFqdn != null ? reverseFqdn.toLowerCase(Locale.ROOT) : null); - return this; - } - - @Override - public PublicIpAddressImpl withoutReverseFqdn() { - return this.withReverseFqdn(null); - } - - // Getters - - @Override - public int idleTimeoutInMinutes() { - return ResourceManagerUtils.toPrimitiveInt(this.innerModel().idleTimeoutInMinutes()); - } - - @Override - public IpAllocationMethod ipAllocationMethod() { - return this.innerModel().publicIpAllocationMethod(); - } - - @Override - public IpVersion version() { - return this.innerModel().publicIpAddressVersion(); - } - - @Override - public String fqdn() { - if (this.innerModel().dnsSettings() != null) { - return this.innerModel().dnsSettings().fqdn(); - } else { - return null; - } - } - - @Override - public String reverseFqdn() { - if (this.innerModel().dnsSettings() != null) { - return this.innerModel().dnsSettings().reverseFqdn(); - } else { - return null; - } - } - - @Override - public String ipAddress() { - return this.innerModel().ipAddress(); - } - - @Override - public String leafDomainLabel() { - if (this.innerModel().dnsSettings() == null) { - return null; - } else { - return this.innerModel().dnsSettings().domainNameLabel(); - } - } - - @Override - public Accepted beginCreate() { - return AcceptedImpl - .newAccepted( - logger, - this.manager().serviceClient().getHttpPipeline(), - this.manager().serviceClient().getDefaultPollInterval(), - () -> - this - .manager() - .serviceClient() - .getPublicIpAddresses() - .createOrUpdateWithResponseAsync(resourceGroupName(), name(), this.innerModel()) - .block(), - inner -> new PublicIpAddressImpl(inner.name(), inner, this.manager()), - PublicIpAddressInner.class, - () -> { - Flux dependencyTasksAsync = - taskGroup().invokeDependencyAsync(taskGroup().newInvocationContext()); - dependencyTasksAsync.blockLast(); - - this.cleanupDnsSettings(); - }, - this::setInner, - Context.NONE); - } - - // CreateUpdateTaskGroup.ResourceCreator implementation - @Override - public Mono createResourceAsync() { - this.cleanupDnsSettings(); - - return this - .manager() - .serviceClient() - .getPublicIpAddresses() - .createOrUpdateAsync(this.resourceGroupName(), this.name(), this.innerModel()) - .map(innerToFluentMap(this)); - } - - private void cleanupDnsSettings() { - // Clean up empty DNS settings - final PublicIpAddressDnsSettings dnsSettings = this.innerModel().dnsSettings(); - if (dnsSettings != null) { - if ((dnsSettings.domainNameLabel() == null || dnsSettings.domainNameLabel().isEmpty()) - && (dnsSettings.fqdn() == null || dnsSettings.fqdn().isEmpty()) - && (dnsSettings.reverseFqdn() == null || dnsSettings.reverseFqdn().isEmpty())) { - this.innerModel().withDnsSettings(null); - } - } - } - - private boolean equalsResourceType(String resourceType) { - IpConfigurationInner ipConfig = this.innerModel().ipConfiguration(); - if (ipConfig == null || resourceType == null) { - return false; - } else { - final String refId = this.innerModel().ipConfiguration().id(); - final String resourceType2 = ResourceUtils.resourceTypeFromResourceId(refId); - return resourceType.equalsIgnoreCase(resourceType2); - } - } - - @Override - public boolean hasAssignedLoadBalancer() { - return equalsResourceType("frontendIPConfigurations"); - } - - @Override - public LoadBalancerPublicFrontend getAssignedLoadBalancerFrontend() { - if (this.hasAssignedLoadBalancer()) { - final String refId = this.innerModel().ipConfiguration().id(); - final String loadBalancerId = ResourceUtils.parentResourceIdFromResourceId(refId); - final LoadBalancer lb = this.myManager.loadBalancers().getById(loadBalancerId); - final String frontendName = ResourceUtils.nameFromResourceId(refId); - return (LoadBalancerPublicFrontend) lb.frontends().get(frontendName); - } else { - return null; - } - } - - @Override - public boolean hasAssignedNetworkInterface() { - return equalsResourceType("ipConfigurations"); - } - - @Override - public Set availabilityZones() { - Set zones = new HashSet<>(); - if (this.innerModel().zones() != null) { - for (String zone : this.innerModel().zones()) { - zones.add(AvailabilityZoneId.fromString(zone)); - } - } - return Collections.unmodifiableSet(zones); - } - - @Override - public PublicIPSkuType sku() { - return PublicIPSkuType.fromSku(this.innerModel().sku()); - } - - @Override - public List ipTags() { - return Collections - .unmodifiableList(innerModel().ipTags() == null ? new ArrayList() : innerModel().ipTags()); - } - - @Override - public NicIpConfiguration getAssignedNetworkInterfaceIPConfiguration() { - if (this.hasAssignedNetworkInterface()) { - final String refId = this.innerModel().ipConfiguration().id(); - final String parentId = ResourceUtils.parentResourceIdFromResourceId(refId); - final NetworkInterface nic = this.myManager.networkInterfaces().getById(parentId); - final String childName = ResourceUtils.nameFromResourceId(refId); - return nic.ipConfigurations().get(childName); - } else { - return null; - } - } - - @Override - public PublicIpAddressImpl updateTags() { - return this; - } - - @Override - public PublicIpAddress applyTags() { - return applyTagsAsync().block(); - } - - @Override - public Mono applyTagsAsync() { - return this - .manager() - .serviceClient() - .getPublicIpAddresses() - .updateTagsAsync(resourceGroupName(), name(), new TagsObject().withTags(innerModel().tags())) - .flatMap( - inner -> { - setInner(inner); - return Mono.just((PublicIpAddress) PublicIpAddressImpl.this); - }); - } - - @Override - public PublicIpAddressImpl withIpTag(String tag) { - if (innerModel().ipTags() == null) { - innerModel().withIpTags(new ArrayList()); - } - ipTags().add(new IpTag().withTag(tag)); - return this; - } - - @Override - public PublicIpAddressImpl withIpTag(String tag, String ipTagType) { - if (innerModel().ipTags() == null) { - innerModel().withIpTags(new ArrayList()); - } - innerModel().ipTags().add(new IpTag().withTag(tag).withIpTagType(ipTagType)); - return this; - } - - @Override - public PublicIpAddressImpl withoutIpTag(String tag) { - if (tag != null && innerModel().ipTags() != null) { - for (IpTag ipTag : innerModel().ipTags()) { - if (tag.equals(ipTag.tag())) { - innerModel().ipTags().remove(ipTag); - return this; - } - } - } - return this; - } - - @Override - public PublicIpAddressImpl withIpAddressVersion(IpVersion ipVersion) { - this.innerModel().withPublicIpAddressVersion(ipVersion); - return this; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/PublicIpAddressesClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/PublicIpAddressesClientImpl.java deleted file mode 100644 index 5b8312c1f7e5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/PublicIpAddressesClientImpl.java +++ /dev/null @@ -1,2633 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.PublicIpAddressesClient; -import com.azure.resourcemanager.network.fluent.models.PublicIpAddressInner; -import com.azure.resourcemanager.network.models.PublicIpAddressListResult; -import com.azure.resourcemanager.network.models.TagsObject; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in PublicIpAddressesClient. */ -public final class PublicIpAddressesClientImpl - implements InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete, - PublicIpAddressesClient { - private final ClientLogger logger = new ClientLogger(PublicIpAddressesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final PublicIpAddressesService service; - - /** The service client containing this operation class. */ - private final NetworkManagementClientImpl client; - - /** - * Initializes an instance of PublicIpAddressesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - PublicIpAddressesClientImpl(NetworkManagementClientImpl client) { - this.service = - RestProxy.create(PublicIpAddressesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for NetworkManagementClientPublicIpAddresses to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "NetworkManagementCli") - private interface PublicIpAddressesService { - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/publicIPAddresses/{publicIpAddressName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("publicIpAddressName") String publicIpAddressName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/publicIPAddresses/{publicIpAddressName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("publicIpAddressName") String publicIpAddressName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("$expand") String expand, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/publicIPAddresses/{publicIpAddressName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("publicIpAddressName") String publicIpAddressName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") PublicIpAddressInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/publicIPAddresses/{publicIpAddressName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> updateTags( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("publicIpAddressName") String publicIpAddressName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") TagsObject parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/publicIPAddresses") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/publicIPAddresses") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{virtualMachineScaleSetName}/publicipaddresses") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listVirtualMachineScaleSetPublicIpAddresses( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualMachineScaleSetName") String virtualMachineScaleSetName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}" - + "/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listVirtualMachineScaleSetVMPublicIpAddresses( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualMachineScaleSetName") String virtualMachineScaleSetName, - @PathParam("virtualmachineIndex") String virtualmachineIndex, - @PathParam("networkInterfaceName") String networkInterfaceName, - @PathParam("ipConfigurationName") String ipConfigurationName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}" - + "/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses" - + "/{publicIpAddressName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getVirtualMachineScaleSetPublicIpAddress( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualMachineScaleSetName") String virtualMachineScaleSetName, - @PathParam("virtualmachineIndex") String virtualmachineIndex, - @PathParam("networkInterfaceName") String networkInterfaceName, - @PathParam("ipConfigurationName") String ipConfigurationName, - @PathParam("publicIpAddressName") String publicIpAddressName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("$expand") String expand, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAllNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listVirtualMachineScaleSetPublicIpAddressesNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listVirtualMachineScaleSetVMPublicIpAddressesNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Deletes the specified public IP address. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpAddressName The name of the subnet. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync( - String resourceGroupName, String publicIpAddressName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (publicIpAddressName == null) { - return Mono - .error(new IllegalArgumentException("Parameter publicIpAddressName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - publicIpAddressName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the specified public IP address. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpAddressName The name of the subnet. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String publicIpAddressName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (publicIpAddressName == null) { - return Mono - .error(new IllegalArgumentException("Parameter publicIpAddressName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - publicIpAddressName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Deletes the specified public IP address. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpAddressName The name of the subnet. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String publicIpAddressName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, publicIpAddressName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deletes the specified public IP address. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpAddressName The name of the subnet. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String publicIpAddressName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, publicIpAddressName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes the specified public IP address. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpAddressName The name of the subnet. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete(String resourceGroupName, String publicIpAddressName) { - return beginDeleteAsync(resourceGroupName, publicIpAddressName).getSyncPoller(); - } - - /** - * Deletes the specified public IP address. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpAddressName The name of the subnet. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String publicIpAddressName, Context context) { - return beginDeleteAsync(resourceGroupName, publicIpAddressName, context).getSyncPoller(); - } - - /** - * Deletes the specified public IP address. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpAddressName The name of the subnet. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String publicIpAddressName) { - return beginDeleteAsync(resourceGroupName, publicIpAddressName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified public IP address. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpAddressName The name of the subnet. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String publicIpAddressName, Context context) { - return beginDeleteAsync(resourceGroupName, publicIpAddressName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified public IP address. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpAddressName The name of the subnet. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String publicIpAddressName) { - deleteAsync(resourceGroupName, publicIpAddressName).block(); - } - - /** - * Deletes the specified public IP address. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpAddressName The name of the subnet. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String publicIpAddressName, Context context) { - deleteAsync(resourceGroupName, publicIpAddressName, context).block(); - } - - /** - * Gets the specified public IP address in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpAddressName The name of the subnet. - * @param expand Expands referenced resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified public IP address in a specified resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String publicIpAddressName, String expand) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (publicIpAddressName == null) { - return Mono - .error(new IllegalArgumentException("Parameter publicIpAddressName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - publicIpAddressName, - apiVersion, - this.client.getSubscriptionId(), - expand, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the specified public IP address in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpAddressName The name of the subnet. - * @param expand Expands referenced resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified public IP address in a specified resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String publicIpAddressName, String expand, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (publicIpAddressName == null) { - return Mono - .error(new IllegalArgumentException("Parameter publicIpAddressName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - publicIpAddressName, - apiVersion, - this.client.getSubscriptionId(), - expand, - accept, - context); - } - - /** - * Gets the specified public IP address in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpAddressName The name of the subnet. - * @param expand Expands referenced resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified public IP address in a specified resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync( - String resourceGroupName, String publicIpAddressName, String expand) { - return getByResourceGroupWithResponseAsync(resourceGroupName, publicIpAddressName, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the specified public IP address in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpAddressName The name of the subnet. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified public IP address in a specified resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync(String resourceGroupName, String publicIpAddressName) { - final String expand = null; - return getByResourceGroupWithResponseAsync(resourceGroupName, publicIpAddressName, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the specified public IP address in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpAddressName The name of the subnet. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified public IP address in a specified resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PublicIpAddressInner getByResourceGroup(String resourceGroupName, String publicIpAddressName) { - final String expand = null; - return getByResourceGroupAsync(resourceGroupName, publicIpAddressName, expand).block(); - } - - /** - * Gets the specified public IP address in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpAddressName The name of the subnet. - * @param expand Expands referenced resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified public IP address in a specified resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String publicIpAddressName, String expand, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, publicIpAddressName, expand, context).block(); - } - - /** - * Creates or updates a static or dynamic public IP address. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpAddressName The name of the public IP address. - * @param parameters Parameters supplied to the create or update public IP address operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public IP address resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String publicIpAddressName, PublicIpAddressInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (publicIpAddressName == null) { - return Mono - .error(new IllegalArgumentException("Parameter publicIpAddressName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - publicIpAddressName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a static or dynamic public IP address. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpAddressName The name of the public IP address. - * @param parameters Parameters supplied to the create or update public IP address operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public IP address resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String publicIpAddressName, PublicIpAddressInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (publicIpAddressName == null) { - return Mono - .error(new IllegalArgumentException("Parameter publicIpAddressName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - publicIpAddressName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Creates or updates a static or dynamic public IP address. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpAddressName The name of the public IP address. - * @param parameters Parameters supplied to the create or update public IP address operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public IP address resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, PublicIpAddressInner> beginCreateOrUpdateAsync( - String resourceGroupName, String publicIpAddressName, PublicIpAddressInner parameters) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, publicIpAddressName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - PublicIpAddressInner.class, - PublicIpAddressInner.class, - Context.NONE); - } - - /** - * Creates or updates a static or dynamic public IP address. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpAddressName The name of the public IP address. - * @param parameters Parameters supplied to the create or update public IP address operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public IP address resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, PublicIpAddressInner> beginCreateOrUpdateAsync( - String resourceGroupName, String publicIpAddressName, PublicIpAddressInner parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, publicIpAddressName, parameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), PublicIpAddressInner.class, PublicIpAddressInner.class, context); - } - - /** - * Creates or updates a static or dynamic public IP address. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpAddressName The name of the public IP address. - * @param parameters Parameters supplied to the create or update public IP address operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public IP address resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, PublicIpAddressInner> beginCreateOrUpdate( - String resourceGroupName, String publicIpAddressName, PublicIpAddressInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, publicIpAddressName, parameters).getSyncPoller(); - } - - /** - * Creates or updates a static or dynamic public IP address. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpAddressName The name of the public IP address. - * @param parameters Parameters supplied to the create or update public IP address operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public IP address resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, PublicIpAddressInner> beginCreateOrUpdate( - String resourceGroupName, String publicIpAddressName, PublicIpAddressInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, publicIpAddressName, parameters, context).getSyncPoller(); - } - - /** - * Creates or updates a static or dynamic public IP address. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpAddressName The name of the public IP address. - * @param parameters Parameters supplied to the create or update public IP address operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public IP address resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, String publicIpAddressName, PublicIpAddressInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, publicIpAddressName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a static or dynamic public IP address. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpAddressName The name of the public IP address. - * @param parameters Parameters supplied to the create or update public IP address operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public IP address resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String publicIpAddressName, PublicIpAddressInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, publicIpAddressName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a static or dynamic public IP address. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpAddressName The name of the public IP address. - * @param parameters Parameters supplied to the create or update public IP address operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public IP address resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PublicIpAddressInner createOrUpdate( - String resourceGroupName, String publicIpAddressName, PublicIpAddressInner parameters) { - return createOrUpdateAsync(resourceGroupName, publicIpAddressName, parameters).block(); - } - - /** - * Creates or updates a static or dynamic public IP address. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpAddressName The name of the public IP address. - * @param parameters Parameters supplied to the create or update public IP address operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public IP address resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PublicIpAddressInner createOrUpdate( - String resourceGroupName, String publicIpAddressName, PublicIpAddressInner parameters, Context context) { - return createOrUpdateAsync(resourceGroupName, publicIpAddressName, parameters, context).block(); - } - - /** - * Updates public IP address tags. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpAddressName The name of the public IP address. - * @param parameters Parameters supplied to update public IP address tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public IP address resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateTagsWithResponseAsync( - String resourceGroupName, String publicIpAddressName, TagsObject parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (publicIpAddressName == null) { - return Mono - .error(new IllegalArgumentException("Parameter publicIpAddressName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updateTags( - this.client.getEndpoint(), - resourceGroupName, - publicIpAddressName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates public IP address tags. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpAddressName The name of the public IP address. - * @param parameters Parameters supplied to update public IP address tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public IP address resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateTagsWithResponseAsync( - String resourceGroupName, String publicIpAddressName, TagsObject parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (publicIpAddressName == null) { - return Mono - .error(new IllegalArgumentException("Parameter publicIpAddressName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updateTags( - this.client.getEndpoint(), - resourceGroupName, - publicIpAddressName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Updates public IP address tags. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpAddressName The name of the public IP address. - * @param parameters Parameters supplied to update public IP address tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public IP address resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, PublicIpAddressInner> beginUpdateTagsAsync( - String resourceGroupName, String publicIpAddressName, TagsObject parameters) { - Mono>> mono = - updateTagsWithResponseAsync(resourceGroupName, publicIpAddressName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - PublicIpAddressInner.class, - PublicIpAddressInner.class, - Context.NONE); - } - - /** - * Updates public IP address tags. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpAddressName The name of the public IP address. - * @param parameters Parameters supplied to update public IP address tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public IP address resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, PublicIpAddressInner> beginUpdateTagsAsync( - String resourceGroupName, String publicIpAddressName, TagsObject parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - updateTagsWithResponseAsync(resourceGroupName, publicIpAddressName, parameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), PublicIpAddressInner.class, PublicIpAddressInner.class, context); - } - - /** - * Updates public IP address tags. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpAddressName The name of the public IP address. - * @param parameters Parameters supplied to update public IP address tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public IP address resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, PublicIpAddressInner> beginUpdateTags( - String resourceGroupName, String publicIpAddressName, TagsObject parameters) { - return beginUpdateTagsAsync(resourceGroupName, publicIpAddressName, parameters).getSyncPoller(); - } - - /** - * Updates public IP address tags. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpAddressName The name of the public IP address. - * @param parameters Parameters supplied to update public IP address tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public IP address resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, PublicIpAddressInner> beginUpdateTags( - String resourceGroupName, String publicIpAddressName, TagsObject parameters, Context context) { - return beginUpdateTagsAsync(resourceGroupName, publicIpAddressName, parameters, context).getSyncPoller(); - } - - /** - * Updates public IP address tags. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpAddressName The name of the public IP address. - * @param parameters Parameters supplied to update public IP address tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public IP address resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateTagsAsync( - String resourceGroupName, String publicIpAddressName, TagsObject parameters) { - return beginUpdateTagsAsync(resourceGroupName, publicIpAddressName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates public IP address tags. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpAddressName The name of the public IP address. - * @param parameters Parameters supplied to update public IP address tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public IP address resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateTagsAsync( - String resourceGroupName, String publicIpAddressName, TagsObject parameters, Context context) { - return beginUpdateTagsAsync(resourceGroupName, publicIpAddressName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates public IP address tags. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpAddressName The name of the public IP address. - * @param parameters Parameters supplied to update public IP address tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public IP address resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PublicIpAddressInner updateTags( - String resourceGroupName, String publicIpAddressName, TagsObject parameters) { - return updateTagsAsync(resourceGroupName, publicIpAddressName, parameters).block(); - } - - /** - * Updates public IP address tags. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpAddressName The name of the public IP address. - * @param parameters Parameters supplied to update public IP address tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public IP address resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PublicIpAddressInner updateTags( - String resourceGroupName, String publicIpAddressName, TagsObject parameters, Context context) { - return updateTagsAsync(resourceGroupName, publicIpAddressName, parameters, context).block(); - } - - /** - * Gets all the public IP addresses in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the public IP addresses in a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all the public IP addresses in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the public IP addresses in a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all the public IP addresses in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the public IP addresses in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listAllNextSinglePageAsync(nextLink)); - } - - /** - * Gets all the public IP addresses in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the public IP addresses in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listAllNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all the public IP addresses in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the public IP addresses in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Gets all the public IP addresses in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the public IP addresses in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Gets all public IP addresses in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all public IP addresses in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all public IP addresses in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all public IP addresses in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all public IP addresses in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all public IP addresses in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets all public IP addresses in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all public IP addresses in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all public IP addresses in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all public IP addresses in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * Gets all public IP addresses in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all public IP addresses in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * Gets information about all public IP addresses on a virtual machine scale set level. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about all public IP addresses on a virtual machine scale set level. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listVirtualMachineScaleSetPublicIpAddressesSinglePageAsync( - String resourceGroupName, String virtualMachineScaleSetName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualMachineScaleSetName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualMachineScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-03-30"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listVirtualMachineScaleSetPublicIpAddresses( - this.client.getEndpoint(), - resourceGroupName, - virtualMachineScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets information about all public IP addresses on a virtual machine scale set level. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about all public IP addresses on a virtual machine scale set level. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listVirtualMachineScaleSetPublicIpAddressesSinglePageAsync( - String resourceGroupName, String virtualMachineScaleSetName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualMachineScaleSetName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualMachineScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-03-30"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listVirtualMachineScaleSetPublicIpAddresses( - this.client.getEndpoint(), - resourceGroupName, - virtualMachineScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets information about all public IP addresses on a virtual machine scale set level. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about all public IP addresses on a virtual machine scale set level. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listVirtualMachineScaleSetPublicIpAddressesAsync( - String resourceGroupName, String virtualMachineScaleSetName) { - return new PagedFlux<>( - () -> - listVirtualMachineScaleSetPublicIpAddressesSinglePageAsync( - resourceGroupName, virtualMachineScaleSetName), - nextLink -> listVirtualMachineScaleSetPublicIpAddressesNextSinglePageAsync(nextLink)); - } - - /** - * Gets information about all public IP addresses on a virtual machine scale set level. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about all public IP addresses on a virtual machine scale set level. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listVirtualMachineScaleSetPublicIpAddressesAsync( - String resourceGroupName, String virtualMachineScaleSetName, Context context) { - return new PagedFlux<>( - () -> - listVirtualMachineScaleSetPublicIpAddressesSinglePageAsync( - resourceGroupName, virtualMachineScaleSetName, context), - nextLink -> listVirtualMachineScaleSetPublicIpAddressesNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets information about all public IP addresses on a virtual machine scale set level. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about all public IP addresses on a virtual machine scale set level. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listVirtualMachineScaleSetPublicIpAddresses( - String resourceGroupName, String virtualMachineScaleSetName) { - return new PagedIterable<>( - listVirtualMachineScaleSetPublicIpAddressesAsync(resourceGroupName, virtualMachineScaleSetName)); - } - - /** - * Gets information about all public IP addresses on a virtual machine scale set level. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about all public IP addresses on a virtual machine scale set level. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listVirtualMachineScaleSetPublicIpAddresses( - String resourceGroupName, String virtualMachineScaleSetName, Context context) { - return new PagedIterable<>( - listVirtualMachineScaleSetPublicIpAddressesAsync(resourceGroupName, virtualMachineScaleSetName, context)); - } - - /** - * Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale - * set. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @param virtualmachineIndex The virtual machine index. - * @param networkInterfaceName The network interface name. - * @param ipConfigurationName The IP configuration name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about all public IP addresses in a virtual machine IP configuration in a virtual machine - * scale set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listVirtualMachineScaleSetVMPublicIpAddressesSinglePageAsync( - String resourceGroupName, - String virtualMachineScaleSetName, - String virtualmachineIndex, - String networkInterfaceName, - String ipConfigurationName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualMachineScaleSetName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualMachineScaleSetName is required and cannot be null.")); - } - if (virtualmachineIndex == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualmachineIndex is required and cannot be null.")); - } - if (networkInterfaceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null.")); - } - if (ipConfigurationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter ipConfigurationName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-03-30"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listVirtualMachineScaleSetVMPublicIpAddresses( - this.client.getEndpoint(), - resourceGroupName, - virtualMachineScaleSetName, - virtualmachineIndex, - networkInterfaceName, - ipConfigurationName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale - * set. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @param virtualmachineIndex The virtual machine index. - * @param networkInterfaceName The network interface name. - * @param ipConfigurationName The IP configuration name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about all public IP addresses in a virtual machine IP configuration in a virtual machine - * scale set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listVirtualMachineScaleSetVMPublicIpAddressesSinglePageAsync( - String resourceGroupName, - String virtualMachineScaleSetName, - String virtualmachineIndex, - String networkInterfaceName, - String ipConfigurationName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualMachineScaleSetName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualMachineScaleSetName is required and cannot be null.")); - } - if (virtualmachineIndex == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualmachineIndex is required and cannot be null.")); - } - if (networkInterfaceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null.")); - } - if (ipConfigurationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter ipConfigurationName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-03-30"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listVirtualMachineScaleSetVMPublicIpAddresses( - this.client.getEndpoint(), - resourceGroupName, - virtualMachineScaleSetName, - virtualmachineIndex, - networkInterfaceName, - ipConfigurationName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale - * set. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @param virtualmachineIndex The virtual machine index. - * @param networkInterfaceName The network interface name. - * @param ipConfigurationName The IP configuration name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about all public IP addresses in a virtual machine IP configuration in a virtual machine - * scale set. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listVirtualMachineScaleSetVMPublicIpAddressesAsync( - String resourceGroupName, - String virtualMachineScaleSetName, - String virtualmachineIndex, - String networkInterfaceName, - String ipConfigurationName) { - return new PagedFlux<>( - () -> - listVirtualMachineScaleSetVMPublicIpAddressesSinglePageAsync( - resourceGroupName, - virtualMachineScaleSetName, - virtualmachineIndex, - networkInterfaceName, - ipConfigurationName), - nextLink -> listVirtualMachineScaleSetVMPublicIpAddressesNextSinglePageAsync(nextLink)); - } - - /** - * Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale - * set. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @param virtualmachineIndex The virtual machine index. - * @param networkInterfaceName The network interface name. - * @param ipConfigurationName The IP configuration name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about all public IP addresses in a virtual machine IP configuration in a virtual machine - * scale set. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listVirtualMachineScaleSetVMPublicIpAddressesAsync( - String resourceGroupName, - String virtualMachineScaleSetName, - String virtualmachineIndex, - String networkInterfaceName, - String ipConfigurationName, - Context context) { - return new PagedFlux<>( - () -> - listVirtualMachineScaleSetVMPublicIpAddressesSinglePageAsync( - resourceGroupName, - virtualMachineScaleSetName, - virtualmachineIndex, - networkInterfaceName, - ipConfigurationName, - context), - nextLink -> listVirtualMachineScaleSetVMPublicIpAddressesNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale - * set. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @param virtualmachineIndex The virtual machine index. - * @param networkInterfaceName The network interface name. - * @param ipConfigurationName The IP configuration name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about all public IP addresses in a virtual machine IP configuration in a virtual machine - * scale set. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listVirtualMachineScaleSetVMPublicIpAddresses( - String resourceGroupName, - String virtualMachineScaleSetName, - String virtualmachineIndex, - String networkInterfaceName, - String ipConfigurationName) { - return new PagedIterable<>( - listVirtualMachineScaleSetVMPublicIpAddressesAsync( - resourceGroupName, - virtualMachineScaleSetName, - virtualmachineIndex, - networkInterfaceName, - ipConfigurationName)); - } - - /** - * Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale - * set. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @param virtualmachineIndex The virtual machine index. - * @param networkInterfaceName The network interface name. - * @param ipConfigurationName The IP configuration name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about all public IP addresses in a virtual machine IP configuration in a virtual machine - * scale set. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listVirtualMachineScaleSetVMPublicIpAddresses( - String resourceGroupName, - String virtualMachineScaleSetName, - String virtualmachineIndex, - String networkInterfaceName, - String ipConfigurationName, - Context context) { - return new PagedIterable<>( - listVirtualMachineScaleSetVMPublicIpAddressesAsync( - resourceGroupName, - virtualMachineScaleSetName, - virtualmachineIndex, - networkInterfaceName, - ipConfigurationName, - context)); - } - - /** - * Get the specified public IP address in a virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @param virtualmachineIndex The virtual machine index. - * @param networkInterfaceName The name of the network interface. - * @param ipConfigurationName The name of the IP configuration. - * @param publicIpAddressName The name of the public IP Address. - * @param expand Expands referenced resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified public IP address in a virtual machine scale set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getVirtualMachineScaleSetPublicIpAddressWithResponseAsync( - String resourceGroupName, - String virtualMachineScaleSetName, - String virtualmachineIndex, - String networkInterfaceName, - String ipConfigurationName, - String publicIpAddressName, - String expand) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualMachineScaleSetName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualMachineScaleSetName is required and cannot be null.")); - } - if (virtualmachineIndex == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualmachineIndex is required and cannot be null.")); - } - if (networkInterfaceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null.")); - } - if (ipConfigurationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter ipConfigurationName is required and cannot be null.")); - } - if (publicIpAddressName == null) { - return Mono - .error(new IllegalArgumentException("Parameter publicIpAddressName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-03-30"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getVirtualMachineScaleSetPublicIpAddress( - this.client.getEndpoint(), - resourceGroupName, - virtualMachineScaleSetName, - virtualmachineIndex, - networkInterfaceName, - ipConfigurationName, - publicIpAddressName, - apiVersion, - this.client.getSubscriptionId(), - expand, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the specified public IP address in a virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @param virtualmachineIndex The virtual machine index. - * @param networkInterfaceName The name of the network interface. - * @param ipConfigurationName The name of the IP configuration. - * @param publicIpAddressName The name of the public IP Address. - * @param expand Expands referenced resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified public IP address in a virtual machine scale set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getVirtualMachineScaleSetPublicIpAddressWithResponseAsync( - String resourceGroupName, - String virtualMachineScaleSetName, - String virtualmachineIndex, - String networkInterfaceName, - String ipConfigurationName, - String publicIpAddressName, - String expand, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualMachineScaleSetName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualMachineScaleSetName is required and cannot be null.")); - } - if (virtualmachineIndex == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualmachineIndex is required and cannot be null.")); - } - if (networkInterfaceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null.")); - } - if (ipConfigurationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter ipConfigurationName is required and cannot be null.")); - } - if (publicIpAddressName == null) { - return Mono - .error(new IllegalArgumentException("Parameter publicIpAddressName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-03-30"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getVirtualMachineScaleSetPublicIpAddress( - this.client.getEndpoint(), - resourceGroupName, - virtualMachineScaleSetName, - virtualmachineIndex, - networkInterfaceName, - ipConfigurationName, - publicIpAddressName, - apiVersion, - this.client.getSubscriptionId(), - expand, - accept, - context); - } - - /** - * Get the specified public IP address in a virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @param virtualmachineIndex The virtual machine index. - * @param networkInterfaceName The name of the network interface. - * @param ipConfigurationName The name of the IP configuration. - * @param publicIpAddressName The name of the public IP Address. - * @param expand Expands referenced resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified public IP address in a virtual machine scale set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getVirtualMachineScaleSetPublicIpAddressAsync( - String resourceGroupName, - String virtualMachineScaleSetName, - String virtualmachineIndex, - String networkInterfaceName, - String ipConfigurationName, - String publicIpAddressName, - String expand) { - return getVirtualMachineScaleSetPublicIpAddressWithResponseAsync( - resourceGroupName, - virtualMachineScaleSetName, - virtualmachineIndex, - networkInterfaceName, - ipConfigurationName, - publicIpAddressName, - expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get the specified public IP address in a virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @param virtualmachineIndex The virtual machine index. - * @param networkInterfaceName The name of the network interface. - * @param ipConfigurationName The name of the IP configuration. - * @param publicIpAddressName The name of the public IP Address. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified public IP address in a virtual machine scale set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getVirtualMachineScaleSetPublicIpAddressAsync( - String resourceGroupName, - String virtualMachineScaleSetName, - String virtualmachineIndex, - String networkInterfaceName, - String ipConfigurationName, - String publicIpAddressName) { - final String expand = null; - return getVirtualMachineScaleSetPublicIpAddressWithResponseAsync( - resourceGroupName, - virtualMachineScaleSetName, - virtualmachineIndex, - networkInterfaceName, - ipConfigurationName, - publicIpAddressName, - expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get the specified public IP address in a virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @param virtualmachineIndex The virtual machine index. - * @param networkInterfaceName The name of the network interface. - * @param ipConfigurationName The name of the IP configuration. - * @param publicIpAddressName The name of the public IP Address. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified public IP address in a virtual machine scale set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PublicIpAddressInner getVirtualMachineScaleSetPublicIpAddress( - String resourceGroupName, - String virtualMachineScaleSetName, - String virtualmachineIndex, - String networkInterfaceName, - String ipConfigurationName, - String publicIpAddressName) { - final String expand = null; - return getVirtualMachineScaleSetPublicIpAddressAsync( - resourceGroupName, - virtualMachineScaleSetName, - virtualmachineIndex, - networkInterfaceName, - ipConfigurationName, - publicIpAddressName, - expand) - .block(); - } - - /** - * Get the specified public IP address in a virtual machine scale set. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @param virtualmachineIndex The virtual machine index. - * @param networkInterfaceName The name of the network interface. - * @param ipConfigurationName The name of the IP configuration. - * @param publicIpAddressName The name of the public IP Address. - * @param expand Expands referenced resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified public IP address in a virtual machine scale set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getVirtualMachineScaleSetPublicIpAddressWithResponse( - String resourceGroupName, - String virtualMachineScaleSetName, - String virtualmachineIndex, - String networkInterfaceName, - String ipConfigurationName, - String publicIpAddressName, - String expand, - Context context) { - return getVirtualMachineScaleSetPublicIpAddressWithResponseAsync( - resourceGroupName, - virtualMachineScaleSetName, - virtualmachineIndex, - networkInterfaceName, - ipConfigurationName, - publicIpAddressName, - expand, - context) - .block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListPublicIpAddresses API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAllNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listAllNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListPublicIpAddresses API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAllNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listAllNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListPublicIpAddresses API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListPublicIpAddresses API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListPublicIpAddresses API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listVirtualMachineScaleSetPublicIpAddressesNextSinglePageAsync( - String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listVirtualMachineScaleSetPublicIpAddressesNext( - nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListPublicIpAddresses API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listVirtualMachineScaleSetPublicIpAddressesNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listVirtualMachineScaleSetPublicIpAddressesNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListPublicIpAddresses API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listVirtualMachineScaleSetVMPublicIpAddressesNextSinglePageAsync( - String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listVirtualMachineScaleSetVMPublicIpAddressesNext( - nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListPublicIpAddresses API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listVirtualMachineScaleSetVMPublicIpAddressesNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listVirtualMachineScaleSetVMPublicIpAddressesNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/PublicIpAddressesImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/PublicIpAddressesImpl.java deleted file mode 100644 index 87324801fffa..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/PublicIpAddressesImpl.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.network.fluent.PublicIpAddressesClient; -import com.azure.resourcemanager.network.fluent.models.PublicIpAddressInner; -import com.azure.resourcemanager.network.models.PublicIpAddress; -import com.azure.resourcemanager.network.models.PublicIpAddressDnsSettings; -import com.azure.resourcemanager.network.models.PublicIpAddresses; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.TopLevelModifiableResourcesImpl; -import com.azure.resourcemanager.resources.fluentcore.model.Accepted; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.AcceptedImpl; - -import java.util.function.Function; - -/** Implementation for {@link PublicIpAddresses}. */ -public class PublicIpAddressesImpl - extends TopLevelModifiableResourcesImpl< - PublicIpAddress, PublicIpAddressImpl, PublicIpAddressInner, PublicIpAddressesClient, NetworkManager> - implements PublicIpAddresses { - - private final ClientLogger logger = new ClientLogger(this.getClass()); - - public PublicIpAddressesImpl(final NetworkManager networkManager) { - super(networkManager.serviceClient().getPublicIpAddresses(), networkManager); - } - - @Override - public PublicIpAddressImpl define(String name) { - return wrapModel(name); - } - - // Fluent model create helpers - - @Override - protected PublicIpAddressImpl wrapModel(String name) { - PublicIpAddressInner inner = new PublicIpAddressInner(); - - if (null == inner.dnsSettings()) { - inner.withDnsSettings(new PublicIpAddressDnsSettings()); - } - - return new PublicIpAddressImpl(name, inner, this.manager()); - } - - @Override - protected PublicIpAddressImpl wrapModel(PublicIpAddressInner inner) { - if (inner == null) { - return null; - } - return new PublicIpAddressImpl(inner.id(), inner, this.manager()); - } - - @Override - public Accepted beginDeleteById(String id) { - return beginDeleteByResourceGroup(ResourceUtils.groupFromResourceId(id), ResourceUtils.nameFromResourceId(id)); - } - - @Override - public Accepted beginDeleteByResourceGroup(String resourceGroupName, String name) { - return AcceptedImpl - .newAccepted( - logger, - this.manager().serviceClient().getHttpPipeline(), - this.manager().serviceClient().getDefaultPollInterval(), - () -> this.inner().deleteWithResponseAsync(resourceGroupName, name).block(), - Function.identity(), - Void.class, - null, - Context.NONE); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/PublicIpPrefixImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/PublicIpPrefixImpl.java deleted file mode 100644 index 3d3a7a377772..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/PublicIpPrefixImpl.java +++ /dev/null @@ -1,181 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.management.SubResource; -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.network.fluent.PublicIpPrefixesClient; -import com.azure.resourcemanager.network.fluent.models.PublicIpPrefixInner; -import com.azure.resourcemanager.network.models.AppliableWithTags; -import com.azure.resourcemanager.network.models.IpTag; -import com.azure.resourcemanager.network.models.IpVersion; -import com.azure.resourcemanager.network.models.ProvisioningState; -import com.azure.resourcemanager.network.models.PublicIpPrefix; -import com.azure.resourcemanager.network.models.PublicIpPrefixSku; -import com.azure.resourcemanager.network.models.ReferencedPublicIpAddress; -import com.azure.resourcemanager.network.models.TagsObject; -import com.azure.resourcemanager.resources.fluentcore.arm.AvailabilityZoneId; -import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.GroupableResourceImpl; -import reactor.core.publisher.Mono; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -class PublicIpPrefixImpl - extends GroupableResourceImpl - implements PublicIpPrefix, PublicIpPrefix.Definition, PublicIpPrefix.Update, AppliableWithTags { - - PublicIpPrefixImpl(String name, PublicIpPrefixInner inner, NetworkManager manager) { - super(name, inner, manager); - } - - @Override - public Mono createResourceAsync() { - PublicIpPrefixesClient client = this.manager().serviceClient().getPublicIpPrefixes(); - return client - .createOrUpdateAsync(this.resourceGroupName(), this.name(), this.innerModel()) - .map(innerToFluentMap(this)); - } - - @Override - public Mono updateResourceAsync() { - PublicIpPrefixesClient client = this.manager().serviceClient().getPublicIpPrefixes(); - return client - .createOrUpdateAsync(this.resourceGroupName(), this.name(), this.innerModel()) - .map(innerToFluentMap(this)); - } - - @Override - protected Mono getInnerAsync() { - PublicIpPrefixesClient client = this.manager().serviceClient().getPublicIpPrefixes(); - return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); - } - - @Override - public PublicIpPrefixImpl updateTags() { - return this; - } - - @Override - public PublicIpPrefix applyTags() { - return applyTagsAsync().block(); - } - - @Override - public Mono applyTagsAsync() { - return this - .manager() - .serviceClient() - .getPublicIpPrefixes() - .updateTagsAsync(resourceGroupName(), name(), new TagsObject().withTags(innerModel().tags())) - .map( - inner -> { - setInner(inner); - return PublicIpPrefixImpl.this; - }); - } - - @Override - public boolean isInCreateMode() { - return this.innerModel().id() == null; - } - - @Override - public String ipPrefix() { - return this.innerModel().ipPrefix(); - } - - @Override - public List ipTags() { - return Collections.unmodifiableList(innerModel().ipTags() == null ? new ArrayList<>() : innerModel().ipTags()); - } - - @Override - public SubResource loadBalancerFrontendIpConfiguration() { - return this.innerModel().loadBalancerFrontendIpConfiguration(); - } - - @Override - public Integer prefixLength() { - return this.innerModel().prefixLength(); - } - - @Override - public ProvisioningState provisioningState() { - return ProvisioningState.fromString(innerModel().provisioningState()); - } - - @Override - public List publicIpAddresses() { - return Collections - .unmodifiableList( - innerModel().publicIpAddresses() == null ? new ArrayList<>() : this.innerModel().publicIpAddresses()); - } - - @Override - public IpVersion publicIpAddressVersion() { - return this.innerModel().publicIpAddressVersion(); - } - - @Override - public String resourceGuid() { - return this.innerModel().resourceGuid(); - } - - @Override - public PublicIpPrefixSku sku() { - return this.innerModel().sku(); - } - - @Override - public Set availabilityZones() { - Set zones = new HashSet<>(); - if (this.innerModel().zones() != null) { - for (String zone : this.innerModel().zones()) { - zones.add(AvailabilityZoneId.fromString(zone)); - } - } - return Collections.unmodifiableSet(zones); - } - - @Override - public PublicIpPrefixImpl withIpTags(List ipTags) { - this.innerModel().withIpTags(ipTags); - return this; - } - - @Override - public PublicIpPrefixImpl withPrefixLength(Integer prefixLength) { - this.innerModel().withPrefixLength(prefixLength); - return this; - } - - @Override - public PublicIpPrefixImpl withPublicIpAddressVersion(IpVersion publicIpAddressVersion) { - this.innerModel().withPublicIpAddressVersion(publicIpAddressVersion); - return this; - } - - @Override - public PublicIpPrefixImpl withSku(PublicIpPrefixSku sku) { - this.innerModel().withSku(sku); - return this; - } - - @Override - public PublicIpPrefixImpl withAvailabilityZone(AvailabilityZoneId zoneId) { - // Note: Zone is not updatable as of now, so this is available only during definition time. - // Service return `ResourceAvailabilityZonesCannotBeModified` upon attempt to append a new - // zone or remove one. Trying to remove the last one means attempt to change resource from - // zonal to regional, which is not supported. - // - if (this.innerModel().zones() == null) { - this.innerModel().withZones(new ArrayList<>()); - } - this.innerModel().zones().add(zoneId.toString()); - return this; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/PublicIpPrefixesClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/PublicIpPrefixesClientImpl.java deleted file mode 100644 index b28da187038b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/PublicIpPrefixesClientImpl.java +++ /dev/null @@ -1,1580 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.PublicIpPrefixesClient; -import com.azure.resourcemanager.network.fluent.models.PublicIpPrefixInner; -import com.azure.resourcemanager.network.models.PublicIpPrefixListResult; -import com.azure.resourcemanager.network.models.TagsObject; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in PublicIpPrefixesClient. */ -public final class PublicIpPrefixesClientImpl - implements InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete, - PublicIpPrefixesClient { - private final ClientLogger logger = new ClientLogger(PublicIpPrefixesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final PublicIpPrefixesService service; - - /** The service client containing this operation class. */ - private final NetworkManagementClientImpl client; - - /** - * Initializes an instance of PublicIpPrefixesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - PublicIpPrefixesClientImpl(NetworkManagementClientImpl client) { - this.service = - RestProxy.create(PublicIpPrefixesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for NetworkManagementClientPublicIpPrefixes to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "NetworkManagementCli") - private interface PublicIpPrefixesService { - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/publicIPPrefixes/{publicIpPrefixName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("publicIpPrefixName") String publicIpPrefixName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/publicIPPrefixes/{publicIpPrefixName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("publicIpPrefixName") String publicIpPrefixName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("$expand") String expand, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/publicIPPrefixes/{publicIpPrefixName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("publicIpPrefixName") String publicIpPrefixName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") PublicIpPrefixInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/publicIPPrefixes/{publicIpPrefixName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> updateTags( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("publicIpPrefixName") String publicIpPrefixName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") TagsObject parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/publicIPPrefixes") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/publicIPPrefixes") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAllNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Deletes the specified public IP prefix. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpPrefixName The name of the PublicIpPrefix. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync( - String resourceGroupName, String publicIpPrefixName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (publicIpPrefixName == null) { - return Mono - .error(new IllegalArgumentException("Parameter publicIpPrefixName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - publicIpPrefixName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the specified public IP prefix. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpPrefixName The name of the PublicIpPrefix. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String publicIpPrefixName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (publicIpPrefixName == null) { - return Mono - .error(new IllegalArgumentException("Parameter publicIpPrefixName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - publicIpPrefixName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Deletes the specified public IP prefix. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpPrefixName The name of the PublicIpPrefix. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String publicIpPrefixName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, publicIpPrefixName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deletes the specified public IP prefix. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpPrefixName The name of the PublicIpPrefix. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String publicIpPrefixName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(resourceGroupName, publicIpPrefixName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes the specified public IP prefix. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpPrefixName The name of the PublicIpPrefix. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete(String resourceGroupName, String publicIpPrefixName) { - return beginDeleteAsync(resourceGroupName, publicIpPrefixName).getSyncPoller(); - } - - /** - * Deletes the specified public IP prefix. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpPrefixName The name of the PublicIpPrefix. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String publicIpPrefixName, Context context) { - return beginDeleteAsync(resourceGroupName, publicIpPrefixName, context).getSyncPoller(); - } - - /** - * Deletes the specified public IP prefix. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpPrefixName The name of the PublicIpPrefix. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String publicIpPrefixName) { - return beginDeleteAsync(resourceGroupName, publicIpPrefixName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified public IP prefix. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpPrefixName The name of the PublicIpPrefix. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String publicIpPrefixName, Context context) { - return beginDeleteAsync(resourceGroupName, publicIpPrefixName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified public IP prefix. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpPrefixName The name of the PublicIpPrefix. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String publicIpPrefixName) { - deleteAsync(resourceGroupName, publicIpPrefixName).block(); - } - - /** - * Deletes the specified public IP prefix. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpPrefixName The name of the PublicIpPrefix. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String publicIpPrefixName, Context context) { - deleteAsync(resourceGroupName, publicIpPrefixName, context).block(); - } - - /** - * Gets the specified public IP prefix in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpPrefixName The name of the PublicIPPrefix. - * @param expand Expands referenced resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified public IP prefix in a specified resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String publicIpPrefixName, String expand) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (publicIpPrefixName == null) { - return Mono - .error(new IllegalArgumentException("Parameter publicIpPrefixName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - publicIpPrefixName, - apiVersion, - this.client.getSubscriptionId(), - expand, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the specified public IP prefix in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpPrefixName The name of the PublicIPPrefix. - * @param expand Expands referenced resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified public IP prefix in a specified resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String publicIpPrefixName, String expand, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (publicIpPrefixName == null) { - return Mono - .error(new IllegalArgumentException("Parameter publicIpPrefixName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - publicIpPrefixName, - apiVersion, - this.client.getSubscriptionId(), - expand, - accept, - context); - } - - /** - * Gets the specified public IP prefix in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpPrefixName The name of the PublicIPPrefix. - * @param expand Expands referenced resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified public IP prefix in a specified resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync( - String resourceGroupName, String publicIpPrefixName, String expand) { - return getByResourceGroupWithResponseAsync(resourceGroupName, publicIpPrefixName, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the specified public IP prefix in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpPrefixName The name of the PublicIPPrefix. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified public IP prefix in a specified resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync(String resourceGroupName, String publicIpPrefixName) { - final String expand = null; - return getByResourceGroupWithResponseAsync(resourceGroupName, publicIpPrefixName, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the specified public IP prefix in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpPrefixName The name of the PublicIPPrefix. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified public IP prefix in a specified resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PublicIpPrefixInner getByResourceGroup(String resourceGroupName, String publicIpPrefixName) { - final String expand = null; - return getByResourceGroupAsync(resourceGroupName, publicIpPrefixName, expand).block(); - } - - /** - * Gets the specified public IP prefix in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpPrefixName The name of the PublicIPPrefix. - * @param expand Expands referenced resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified public IP prefix in a specified resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String publicIpPrefixName, String expand, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, publicIpPrefixName, expand, context).block(); - } - - /** - * Creates or updates a static or dynamic public IP prefix. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpPrefixName The name of the public IP prefix. - * @param parameters Parameters supplied to the create or update public IP prefix operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public IP prefix resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String publicIpPrefixName, PublicIpPrefixInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (publicIpPrefixName == null) { - return Mono - .error(new IllegalArgumentException("Parameter publicIpPrefixName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - publicIpPrefixName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a static or dynamic public IP prefix. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpPrefixName The name of the public IP prefix. - * @param parameters Parameters supplied to the create or update public IP prefix operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public IP prefix resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String publicIpPrefixName, PublicIpPrefixInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (publicIpPrefixName == null) { - return Mono - .error(new IllegalArgumentException("Parameter publicIpPrefixName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - publicIpPrefixName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Creates or updates a static or dynamic public IP prefix. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpPrefixName The name of the public IP prefix. - * @param parameters Parameters supplied to the create or update public IP prefix operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public IP prefix resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, PublicIpPrefixInner> beginCreateOrUpdateAsync( - String resourceGroupName, String publicIpPrefixName, PublicIpPrefixInner parameters) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, publicIpPrefixName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - PublicIpPrefixInner.class, - PublicIpPrefixInner.class, - Context.NONE); - } - - /** - * Creates or updates a static or dynamic public IP prefix. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpPrefixName The name of the public IP prefix. - * @param parameters Parameters supplied to the create or update public IP prefix operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public IP prefix resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, PublicIpPrefixInner> beginCreateOrUpdateAsync( - String resourceGroupName, String publicIpPrefixName, PublicIpPrefixInner parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, publicIpPrefixName, parameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), PublicIpPrefixInner.class, PublicIpPrefixInner.class, context); - } - - /** - * Creates or updates a static or dynamic public IP prefix. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpPrefixName The name of the public IP prefix. - * @param parameters Parameters supplied to the create or update public IP prefix operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public IP prefix resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, PublicIpPrefixInner> beginCreateOrUpdate( - String resourceGroupName, String publicIpPrefixName, PublicIpPrefixInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, publicIpPrefixName, parameters).getSyncPoller(); - } - - /** - * Creates or updates a static or dynamic public IP prefix. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpPrefixName The name of the public IP prefix. - * @param parameters Parameters supplied to the create or update public IP prefix operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public IP prefix resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, PublicIpPrefixInner> beginCreateOrUpdate( - String resourceGroupName, String publicIpPrefixName, PublicIpPrefixInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, publicIpPrefixName, parameters, context).getSyncPoller(); - } - - /** - * Creates or updates a static or dynamic public IP prefix. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpPrefixName The name of the public IP prefix. - * @param parameters Parameters supplied to the create or update public IP prefix operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public IP prefix resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, String publicIpPrefixName, PublicIpPrefixInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, publicIpPrefixName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a static or dynamic public IP prefix. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpPrefixName The name of the public IP prefix. - * @param parameters Parameters supplied to the create or update public IP prefix operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public IP prefix resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String publicIpPrefixName, PublicIpPrefixInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, publicIpPrefixName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a static or dynamic public IP prefix. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpPrefixName The name of the public IP prefix. - * @param parameters Parameters supplied to the create or update public IP prefix operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public IP prefix resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PublicIpPrefixInner createOrUpdate( - String resourceGroupName, String publicIpPrefixName, PublicIpPrefixInner parameters) { - return createOrUpdateAsync(resourceGroupName, publicIpPrefixName, parameters).block(); - } - - /** - * Creates or updates a static or dynamic public IP prefix. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpPrefixName The name of the public IP prefix. - * @param parameters Parameters supplied to the create or update public IP prefix operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public IP prefix resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PublicIpPrefixInner createOrUpdate( - String resourceGroupName, String publicIpPrefixName, PublicIpPrefixInner parameters, Context context) { - return createOrUpdateAsync(resourceGroupName, publicIpPrefixName, parameters, context).block(); - } - - /** - * Updates public IP prefix tags. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpPrefixName The name of the public IP prefix. - * @param parameters Parameters supplied to update public IP prefix tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public IP prefix resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateTagsWithResponseAsync( - String resourceGroupName, String publicIpPrefixName, TagsObject parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (publicIpPrefixName == null) { - return Mono - .error(new IllegalArgumentException("Parameter publicIpPrefixName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updateTags( - this.client.getEndpoint(), - resourceGroupName, - publicIpPrefixName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates public IP prefix tags. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpPrefixName The name of the public IP prefix. - * @param parameters Parameters supplied to update public IP prefix tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public IP prefix resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateTagsWithResponseAsync( - String resourceGroupName, String publicIpPrefixName, TagsObject parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (publicIpPrefixName == null) { - return Mono - .error(new IllegalArgumentException("Parameter publicIpPrefixName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updateTags( - this.client.getEndpoint(), - resourceGroupName, - publicIpPrefixName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Updates public IP prefix tags. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpPrefixName The name of the public IP prefix. - * @param parameters Parameters supplied to update public IP prefix tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public IP prefix resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, PublicIpPrefixInner> beginUpdateTagsAsync( - String resourceGroupName, String publicIpPrefixName, TagsObject parameters) { - Mono>> mono = - updateTagsWithResponseAsync(resourceGroupName, publicIpPrefixName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - PublicIpPrefixInner.class, - PublicIpPrefixInner.class, - Context.NONE); - } - - /** - * Updates public IP prefix tags. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpPrefixName The name of the public IP prefix. - * @param parameters Parameters supplied to update public IP prefix tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public IP prefix resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, PublicIpPrefixInner> beginUpdateTagsAsync( - String resourceGroupName, String publicIpPrefixName, TagsObject parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - updateTagsWithResponseAsync(resourceGroupName, publicIpPrefixName, parameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), PublicIpPrefixInner.class, PublicIpPrefixInner.class, context); - } - - /** - * Updates public IP prefix tags. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpPrefixName The name of the public IP prefix. - * @param parameters Parameters supplied to update public IP prefix tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public IP prefix resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, PublicIpPrefixInner> beginUpdateTags( - String resourceGroupName, String publicIpPrefixName, TagsObject parameters) { - return beginUpdateTagsAsync(resourceGroupName, publicIpPrefixName, parameters).getSyncPoller(); - } - - /** - * Updates public IP prefix tags. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpPrefixName The name of the public IP prefix. - * @param parameters Parameters supplied to update public IP prefix tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public IP prefix resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, PublicIpPrefixInner> beginUpdateTags( - String resourceGroupName, String publicIpPrefixName, TagsObject parameters, Context context) { - return beginUpdateTagsAsync(resourceGroupName, publicIpPrefixName, parameters, context).getSyncPoller(); - } - - /** - * Updates public IP prefix tags. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpPrefixName The name of the public IP prefix. - * @param parameters Parameters supplied to update public IP prefix tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public IP prefix resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateTagsAsync( - String resourceGroupName, String publicIpPrefixName, TagsObject parameters) { - return beginUpdateTagsAsync(resourceGroupName, publicIpPrefixName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates public IP prefix tags. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpPrefixName The name of the public IP prefix. - * @param parameters Parameters supplied to update public IP prefix tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public IP prefix resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateTagsAsync( - String resourceGroupName, String publicIpPrefixName, TagsObject parameters, Context context) { - return beginUpdateTagsAsync(resourceGroupName, publicIpPrefixName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates public IP prefix tags. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpPrefixName The name of the public IP prefix. - * @param parameters Parameters supplied to update public IP prefix tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public IP prefix resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PublicIpPrefixInner updateTags(String resourceGroupName, String publicIpPrefixName, TagsObject parameters) { - return updateTagsAsync(resourceGroupName, publicIpPrefixName, parameters).block(); - } - - /** - * Updates public IP prefix tags. - * - * @param resourceGroupName The name of the resource group. - * @param publicIpPrefixName The name of the public IP prefix. - * @param parameters Parameters supplied to update public IP prefix tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public IP prefix resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PublicIpPrefixInner updateTags( - String resourceGroupName, String publicIpPrefixName, TagsObject parameters, Context context) { - return updateTagsAsync(resourceGroupName, publicIpPrefixName, parameters, context).block(); - } - - /** - * Gets all the public IP prefixes in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the public IP prefixes in a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all the public IP prefixes in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the public IP prefixes in a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all the public IP prefixes in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the public IP prefixes in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listAllNextSinglePageAsync(nextLink)); - } - - /** - * Gets all the public IP prefixes in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the public IP prefixes in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listAllNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all the public IP prefixes in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the public IP prefixes in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Gets all the public IP prefixes in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the public IP prefixes in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Gets all public IP prefixes in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all public IP prefixes in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all public IP prefixes in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all public IP prefixes in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all public IP prefixes in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all public IP prefixes in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets all public IP prefixes in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all public IP prefixes in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all public IP prefixes in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all public IP prefixes in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * Gets all public IP prefixes in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all public IP prefixes in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListPublicIpPrefixes API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAllNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listAllNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListPublicIpPrefixes API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAllNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listAllNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListPublicIpPrefixes API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListPublicIpPrefixes API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/PublicIpPrefixesImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/PublicIpPrefixesImpl.java deleted file mode 100644 index bb92be6d6e88..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/PublicIpPrefixesImpl.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.network.fluent.PublicIpPrefixesClient; -import com.azure.resourcemanager.network.fluent.models.PublicIpPrefixInner; -import com.azure.resourcemanager.network.models.PublicIpPrefix; -import com.azure.resourcemanager.network.models.PublicIpPrefixes; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.TopLevelModifiableResourcesImpl; - -public class PublicIpPrefixesImpl - extends TopLevelModifiableResourcesImpl< - PublicIpPrefix, PublicIpPrefixImpl, PublicIpPrefixInner, PublicIpPrefixesClient, NetworkManager> - implements PublicIpPrefixes { - - public PublicIpPrefixesImpl(final NetworkManager networkManager) { - super(networkManager.serviceClient().getPublicIpPrefixes(), networkManager); - } - - @Override - public PublicIpPrefixImpl define(String name) { - return wrapModel(name); - } - - @Override - protected PublicIpPrefixImpl wrapModel(PublicIpPrefixInner inner) { - return new PublicIpPrefixImpl(inner.name(), inner, manager()); - } - - @Override - protected PublicIpPrefixImpl wrapModel(String name) { - return new PublicIpPrefixImpl(name, new PublicIpPrefixInner(), this.manager()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/RouteFilterImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/RouteFilterImpl.java deleted file mode 100644 index 40489e29184b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/RouteFilterImpl.java +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.network.models.Access; -import com.azure.resourcemanager.network.models.ExpressRouteCircuitPeering; -import com.azure.resourcemanager.network.models.RouteFilter; -import com.azure.resourcemanager.network.models.RouteFilterRule; -import com.azure.resourcemanager.network.models.RouteFilterRuleType; -import com.azure.resourcemanager.network.fluent.models.ExpressRouteCircuitPeeringInner; -import com.azure.resourcemanager.network.fluent.models.RouteFilterInner; -import com.azure.resourcemanager.network.fluent.models.RouteFilterRuleInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.GroupableParentResourceImpl; -import reactor.core.publisher.Mono; - -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.TreeMap; -import java.util.stream.Collectors; - -/** Implementation for RouteFilter and its create and update interfaces. */ -class RouteFilterImpl - extends GroupableParentResourceImpl - implements RouteFilter, RouteFilter.Definition, RouteFilter.Update { - private static final String RULE_TYPE = "Community"; - - private Map rules; - private Map peerings; - - RouteFilterImpl(final String name, final RouteFilterInner innerModel, final NetworkManager networkManager) { - super(name, innerModel, networkManager); - } - - @Override - protected Mono createInner() { - return this - .manager() - .serviceClient() - .getRouteFilters() - .createOrUpdateAsync(resourceGroupName(), name(), innerModel()); - } - - @Override - protected void initializeChildrenFromInner() { - this.rules = new TreeMap<>(); - List inners = this.innerModel().rules(); - if (inners != null) { - for (RouteFilterRuleInner inner : inners) { - this.rules.put(inner.name(), new RouteFilterRuleImpl(inner, this)); - } - } - - if (this.innerModel().peerings() != null) { - this.peerings = - this - .innerModel() - .peerings() - .stream() - .collect( - Collectors - .toMap( - ExpressRouteCircuitPeeringInner::name, - peering -> - new ExpressRouteCircuitPeeringImpl<>( - this, - peering, - manager().serviceClient().getExpressRouteCircuitPeerings(), - peering.peeringType()))); - } else { - this.peerings = new HashMap<>(); - } - } - - @Override - protected void beforeCreating() { - this.innerModel().withRules(innersFromWrappers(this.rules.values())); - } - - @Override - protected Mono getInnerAsync() { - return this - .manager() - .serviceClient() - .getRouteFilters() - .getByResourceGroupAsync(this.resourceGroupName(), this.name()); - } - - @Override - public Mono refreshAsync() { - return super - .refreshAsync() - .map( - routeFilter -> { - RouteFilterImpl impl = (RouteFilterImpl) routeFilter; - impl.initializeChildrenFromInner(); - return impl; - }); - } - - @Override - public String provisioningState() { - return innerModel().provisioningState(); - } - - @Override - public Map rules() { - return Collections.unmodifiableMap(this.rules); - } - - @Override - public Map peerings() { - return Collections.unmodifiableMap(this.peerings); - } - - RouteFilterImpl withRule(RouteFilterRuleImpl rule) { - this.rules.put(rule.name(), rule); - return this; - } - - @Override - public Update withoutRule(String name) { - this.rules.remove(name); - return this; - } - - @Override - public RouteFilterRuleImpl defineRule(String name) { - RouteFilterRuleInner inner = new RouteFilterRuleInner(); - inner.withName(name); - inner.withRouteFilterRuleType(RouteFilterRuleType.COMMUNITY); - inner.withAccess(Access.ALLOW); - return new RouteFilterRuleImpl(inner, this); - } - - @Override - public RouteFilterRule.Update updateRule(String name) { - return (RouteFilterRuleImpl) this.rules.get(name); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/RouteFilterRuleImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/RouteFilterRuleImpl.java deleted file mode 100644 index 99aac6152921..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/RouteFilterRuleImpl.java +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.resourcemanager.network.models.Access; -import com.azure.resourcemanager.network.models.RouteFilter; -import com.azure.resourcemanager.network.models.RouteFilterRule; -import com.azure.resourcemanager.network.models.RouteFilterRuleType; -import com.azure.resourcemanager.network.fluent.models.RouteFilterRuleInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.ChildResourceImpl; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; - -/** Implementation for {@link RouteFilterRule} and its create and update interfaces. */ -class RouteFilterRuleImpl extends ChildResourceImpl - implements RouteFilterRule, - RouteFilterRule.Definition, - RouteFilterRule.UpdateDefinition, - RouteFilterRule.Update { - - RouteFilterRuleImpl(RouteFilterRuleInner inner, RouteFilterImpl parent) { - super(inner, parent); - } - - @Override - public RouteFilterImpl attach() { - return this.parent().withRule(this); - } - - @Override - public RouteFilterRuleImpl withBgpCommunities(String... communities) { - innerModel().withCommunities(Arrays.asList(communities)); - return this; - } - - @Override - public RouteFilterRuleImpl withBgpCommunity(String community) { - if (innerModel().communities() == null) { - innerModel().withCommunities(new ArrayList()); - } - innerModel().communities().add(community); - return this; - } - - @Override - public Update withoutBgpCommunity(String community) { - if (innerModel().communities() != null) { - innerModel().communities().remove(community); - } - return this; - } - - @Override - public RouteFilterRuleImpl allowAccess() { - innerModel().withAccess(Access.ALLOW); - return this; - } - - @Override - public RouteFilterRuleImpl denyAccess() { - innerModel().withAccess(Access.DENY); - return this; - } - - @Override - public String name() { - return innerModel().name(); - } - - @Override - public Access access() { - return innerModel().access(); - } - - @Override - public RouteFilterRuleType routeFilterRuleType() { - return innerModel().routeFilterRuleType(); - } - - @Override - public List communities() { - return Collections.unmodifiableList(innerModel().communities()); - } - - @Override - public String provisioningState() { - return innerModel().provisioningState(); - } - - @Override - public String location() { - return innerModel().location(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/RouteFilterRulesClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/RouteFilterRulesClientImpl.java deleted file mode 100644 index 23596ad97bdc..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/RouteFilterRulesClientImpl.java +++ /dev/null @@ -1,1503 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.RouteFilterRulesClient; -import com.azure.resourcemanager.network.fluent.models.RouteFilterRuleInner; -import com.azure.resourcemanager.network.models.PatchRouteFilterRule; -import com.azure.resourcemanager.network.models.RouteFilterRuleListResult; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in RouteFilterRulesClient. */ -public final class RouteFilterRulesClientImpl implements RouteFilterRulesClient { - private final ClientLogger logger = new ClientLogger(RouteFilterRulesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final RouteFilterRulesService service; - - /** The service client containing this operation class. */ - private final NetworkManagementClientImpl client; - - /** - * Initializes an instance of RouteFilterRulesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - RouteFilterRulesClientImpl(NetworkManagementClientImpl client) { - this.service = - RestProxy.create(RouteFilterRulesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for NetworkManagementClientRouteFilterRules to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "NetworkManagementCli") - private interface RouteFilterRulesService { - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("routeFilterName") String routeFilterName, - @PathParam("ruleName") String ruleName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("routeFilterName") String routeFilterName, - @PathParam("ruleName") String ruleName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("routeFilterName") String routeFilterName, - @PathParam("ruleName") String ruleName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") RouteFilterRuleInner routeFilterRuleParameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("routeFilterName") String routeFilterName, - @PathParam("ruleName") String ruleName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") PatchRouteFilterRule routeFilterRuleParameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/routeFilters/{routeFilterName}/routeFilterRules") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByRouteFilter( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("routeFilterName") String routeFilterName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByRouteFilterNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Deletes the specified rule from a route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param ruleName The name of the rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync( - String resourceGroupName, String routeFilterName, String ruleName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (routeFilterName == null) { - return Mono - .error(new IllegalArgumentException("Parameter routeFilterName is required and cannot be null.")); - } - if (ruleName == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - routeFilterName, - ruleName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the specified rule from a route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param ruleName The name of the rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String routeFilterName, String ruleName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (routeFilterName == null) { - return Mono - .error(new IllegalArgumentException("Parameter routeFilterName is required and cannot be null.")); - } - if (ruleName == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - routeFilterName, - ruleName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Deletes the specified rule from a route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param ruleName The name of the rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String routeFilterName, String ruleName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, routeFilterName, ruleName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deletes the specified rule from a route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param ruleName The name of the rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String routeFilterName, String ruleName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, routeFilterName, ruleName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes the specified rule from a route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param ruleName The name of the rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String routeFilterName, String ruleName) { - return beginDeleteAsync(resourceGroupName, routeFilterName, ruleName).getSyncPoller(); - } - - /** - * Deletes the specified rule from a route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param ruleName The name of the rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String routeFilterName, String ruleName, Context context) { - return beginDeleteAsync(resourceGroupName, routeFilterName, ruleName, context).getSyncPoller(); - } - - /** - * Deletes the specified rule from a route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param ruleName The name of the rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String routeFilterName, String ruleName) { - return beginDeleteAsync(resourceGroupName, routeFilterName, ruleName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified rule from a route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param ruleName The name of the rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String routeFilterName, String ruleName, Context context) { - return beginDeleteAsync(resourceGroupName, routeFilterName, ruleName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified rule from a route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param ruleName The name of the rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String routeFilterName, String ruleName) { - deleteAsync(resourceGroupName, routeFilterName, ruleName).block(); - } - - /** - * Deletes the specified rule from a route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param ruleName The name of the rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String routeFilterName, String ruleName, Context context) { - deleteAsync(resourceGroupName, routeFilterName, ruleName, context).block(); - } - - /** - * Gets the specified rule from a route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param ruleName The name of the rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified rule from a route filter. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String resourceGroupName, String routeFilterName, String ruleName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (routeFilterName == null) { - return Mono - .error(new IllegalArgumentException("Parameter routeFilterName is required and cannot be null.")); - } - if (ruleName == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - resourceGroupName, - routeFilterName, - ruleName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the specified rule from a route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param ruleName The name of the rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified rule from a route filter. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String routeFilterName, String ruleName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (routeFilterName == null) { - return Mono - .error(new IllegalArgumentException("Parameter routeFilterName is required and cannot be null.")); - } - if (ruleName == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - resourceGroupName, - routeFilterName, - ruleName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets the specified rule from a route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param ruleName The name of the rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified rule from a route filter. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync(String resourceGroupName, String routeFilterName, String ruleName) { - return getWithResponseAsync(resourceGroupName, routeFilterName, ruleName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the specified rule from a route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param ruleName The name of the rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified rule from a route filter. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RouteFilterRuleInner get(String resourceGroupName, String routeFilterName, String ruleName) { - return getAsync(resourceGroupName, routeFilterName, ruleName).block(); - } - - /** - * Gets the specified rule from a route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param ruleName The name of the rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified rule from a route filter. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String routeFilterName, String ruleName, Context context) { - return getWithResponseAsync(resourceGroupName, routeFilterName, ruleName, context).block(); - } - - /** - * Creates or updates a route in the specified route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param ruleName The name of the route filter rule. - * @param routeFilterRuleParameters Parameters supplied to the create or update route filter rule operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route Filter Rule Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String routeFilterName, - String ruleName, - RouteFilterRuleInner routeFilterRuleParameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (routeFilterName == null) { - return Mono - .error(new IllegalArgumentException("Parameter routeFilterName is required and cannot be null.")); - } - if (ruleName == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (routeFilterRuleParameters == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter routeFilterRuleParameters is required and cannot be null.")); - } else { - routeFilterRuleParameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - routeFilterName, - ruleName, - apiVersion, - this.client.getSubscriptionId(), - routeFilterRuleParameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a route in the specified route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param ruleName The name of the route filter rule. - * @param routeFilterRuleParameters Parameters supplied to the create or update route filter rule operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route Filter Rule Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String routeFilterName, - String ruleName, - RouteFilterRuleInner routeFilterRuleParameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (routeFilterName == null) { - return Mono - .error(new IllegalArgumentException("Parameter routeFilterName is required and cannot be null.")); - } - if (ruleName == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (routeFilterRuleParameters == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter routeFilterRuleParameters is required and cannot be null.")); - } else { - routeFilterRuleParameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - routeFilterName, - ruleName, - apiVersion, - this.client.getSubscriptionId(), - routeFilterRuleParameters, - accept, - context); - } - - /** - * Creates or updates a route in the specified route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param ruleName The name of the route filter rule. - * @param routeFilterRuleParameters Parameters supplied to the create or update route filter rule operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route Filter Rule Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, RouteFilterRuleInner> beginCreateOrUpdateAsync( - String resourceGroupName, - String routeFilterName, - String ruleName, - RouteFilterRuleInner routeFilterRuleParameters) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - RouteFilterRuleInner.class, - RouteFilterRuleInner.class, - Context.NONE); - } - - /** - * Creates or updates a route in the specified route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param ruleName The name of the route filter rule. - * @param routeFilterRuleParameters Parameters supplied to the create or update route filter rule operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route Filter Rule Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, RouteFilterRuleInner> beginCreateOrUpdateAsync( - String resourceGroupName, - String routeFilterName, - String ruleName, - RouteFilterRuleInner routeFilterRuleParameters, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync( - resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), RouteFilterRuleInner.class, RouteFilterRuleInner.class, context); - } - - /** - * Creates or updates a route in the specified route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param ruleName The name of the route filter rule. - * @param routeFilterRuleParameters Parameters supplied to the create or update route filter rule operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route Filter Rule Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, RouteFilterRuleInner> beginCreateOrUpdate( - String resourceGroupName, - String routeFilterName, - String ruleName, - RouteFilterRuleInner routeFilterRuleParameters) { - return beginCreateOrUpdateAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters) - .getSyncPoller(); - } - - /** - * Creates or updates a route in the specified route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param ruleName The name of the route filter rule. - * @param routeFilterRuleParameters Parameters supplied to the create or update route filter rule operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route Filter Rule Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, RouteFilterRuleInner> beginCreateOrUpdate( - String resourceGroupName, - String routeFilterName, - String ruleName, - RouteFilterRuleInner routeFilterRuleParameters, - Context context) { - return beginCreateOrUpdateAsync( - resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters, context) - .getSyncPoller(); - } - - /** - * Creates or updates a route in the specified route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param ruleName The name of the route filter rule. - * @param routeFilterRuleParameters Parameters supplied to the create or update route filter rule operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route Filter Rule Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, - String routeFilterName, - String ruleName, - RouteFilterRuleInner routeFilterRuleParameters) { - return beginCreateOrUpdateAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a route in the specified route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param ruleName The name of the route filter rule. - * @param routeFilterRuleParameters Parameters supplied to the create or update route filter rule operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route Filter Rule Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, - String routeFilterName, - String ruleName, - RouteFilterRuleInner routeFilterRuleParameters, - Context context) { - return beginCreateOrUpdateAsync( - resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a route in the specified route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param ruleName The name of the route filter rule. - * @param routeFilterRuleParameters Parameters supplied to the create or update route filter rule operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route Filter Rule Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RouteFilterRuleInner createOrUpdate( - String resourceGroupName, - String routeFilterName, - String ruleName, - RouteFilterRuleInner routeFilterRuleParameters) { - return createOrUpdateAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters).block(); - } - - /** - * Creates or updates a route in the specified route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param ruleName The name of the route filter rule. - * @param routeFilterRuleParameters Parameters supplied to the create or update route filter rule operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route Filter Rule Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RouteFilterRuleInner createOrUpdate( - String resourceGroupName, - String routeFilterName, - String ruleName, - RouteFilterRuleInner routeFilterRuleParameters, - Context context) { - return createOrUpdateAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters, context) - .block(); - } - - /** - * Updates a route in the specified route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param ruleName The name of the route filter rule. - * @param routeFilterRuleParameters Parameters supplied to the update route filter rule operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route Filter Rule Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateWithResponseAsync( - String resourceGroupName, - String routeFilterName, - String ruleName, - PatchRouteFilterRule routeFilterRuleParameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (routeFilterName == null) { - return Mono - .error(new IllegalArgumentException("Parameter routeFilterName is required and cannot be null.")); - } - if (ruleName == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (routeFilterRuleParameters == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter routeFilterRuleParameters is required and cannot be null.")); - } else { - routeFilterRuleParameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - resourceGroupName, - routeFilterName, - ruleName, - apiVersion, - this.client.getSubscriptionId(), - routeFilterRuleParameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates a route in the specified route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param ruleName The name of the route filter rule. - * @param routeFilterRuleParameters Parameters supplied to the update route filter rule operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route Filter Rule Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, - String routeFilterName, - String ruleName, - PatchRouteFilterRule routeFilterRuleParameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (routeFilterName == null) { - return Mono - .error(new IllegalArgumentException("Parameter routeFilterName is required and cannot be null.")); - } - if (ruleName == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (routeFilterRuleParameters == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter routeFilterRuleParameters is required and cannot be null.")); - } else { - routeFilterRuleParameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - resourceGroupName, - routeFilterName, - ruleName, - apiVersion, - this.client.getSubscriptionId(), - routeFilterRuleParameters, - accept, - context); - } - - /** - * Updates a route in the specified route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param ruleName The name of the route filter rule. - * @param routeFilterRuleParameters Parameters supplied to the update route filter rule operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route Filter Rule Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, RouteFilterRuleInner> beginUpdateAsync( - String resourceGroupName, - String routeFilterName, - String ruleName, - PatchRouteFilterRule routeFilterRuleParameters) { - Mono>> mono = - updateWithResponseAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - RouteFilterRuleInner.class, - RouteFilterRuleInner.class, - Context.NONE); - } - - /** - * Updates a route in the specified route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param ruleName The name of the route filter rule. - * @param routeFilterRuleParameters Parameters supplied to the update route filter rule operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route Filter Rule Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, RouteFilterRuleInner> beginUpdateAsync( - String resourceGroupName, - String routeFilterName, - String ruleName, - PatchRouteFilterRule routeFilterRuleParameters, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - updateWithResponseAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), RouteFilterRuleInner.class, RouteFilterRuleInner.class, context); - } - - /** - * Updates a route in the specified route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param ruleName The name of the route filter rule. - * @param routeFilterRuleParameters Parameters supplied to the update route filter rule operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route Filter Rule Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, RouteFilterRuleInner> beginUpdate( - String resourceGroupName, - String routeFilterName, - String ruleName, - PatchRouteFilterRule routeFilterRuleParameters) { - return beginUpdateAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters) - .getSyncPoller(); - } - - /** - * Updates a route in the specified route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param ruleName The name of the route filter rule. - * @param routeFilterRuleParameters Parameters supplied to the update route filter rule operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route Filter Rule Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, RouteFilterRuleInner> beginUpdate( - String resourceGroupName, - String routeFilterName, - String ruleName, - PatchRouteFilterRule routeFilterRuleParameters, - Context context) { - return beginUpdateAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters, context) - .getSyncPoller(); - } - - /** - * Updates a route in the specified route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param ruleName The name of the route filter rule. - * @param routeFilterRuleParameters Parameters supplied to the update route filter rule operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route Filter Rule Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync( - String resourceGroupName, - String routeFilterName, - String ruleName, - PatchRouteFilterRule routeFilterRuleParameters) { - return beginUpdateAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates a route in the specified route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param ruleName The name of the route filter rule. - * @param routeFilterRuleParameters Parameters supplied to the update route filter rule operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route Filter Rule Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, - String routeFilterName, - String ruleName, - PatchRouteFilterRule routeFilterRuleParameters, - Context context) { - return beginUpdateAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates a route in the specified route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param ruleName The name of the route filter rule. - * @param routeFilterRuleParameters Parameters supplied to the update route filter rule operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route Filter Rule Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RouteFilterRuleInner update( - String resourceGroupName, - String routeFilterName, - String ruleName, - PatchRouteFilterRule routeFilterRuleParameters) { - return updateAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters).block(); - } - - /** - * Updates a route in the specified route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param ruleName The name of the route filter rule. - * @param routeFilterRuleParameters Parameters supplied to the update route filter rule operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route Filter Rule Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RouteFilterRuleInner update( - String resourceGroupName, - String routeFilterName, - String ruleName, - PatchRouteFilterRule routeFilterRuleParameters, - Context context) { - return updateAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters, context).block(); - } - - /** - * Gets all RouteFilterRules in a route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all RouteFilterRules in a route filter. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByRouteFilterSinglePageAsync( - String resourceGroupName, String routeFilterName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (routeFilterName == null) { - return Mono - .error(new IllegalArgumentException("Parameter routeFilterName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByRouteFilter( - this.client.getEndpoint(), - resourceGroupName, - routeFilterName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all RouteFilterRules in a route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all RouteFilterRules in a route filter. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByRouteFilterSinglePageAsync( - String resourceGroupName, String routeFilterName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (routeFilterName == null) { - return Mono - .error(new IllegalArgumentException("Parameter routeFilterName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByRouteFilter( - this.client.getEndpoint(), - resourceGroupName, - routeFilterName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all RouteFilterRules in a route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all RouteFilterRules in a route filter. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByRouteFilterAsync(String resourceGroupName, String routeFilterName) { - return new PagedFlux<>( - () -> listByRouteFilterSinglePageAsync(resourceGroupName, routeFilterName), - nextLink -> listByRouteFilterNextSinglePageAsync(nextLink)); - } - - /** - * Gets all RouteFilterRules in a route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all RouteFilterRules in a route filter. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByRouteFilterAsync( - String resourceGroupName, String routeFilterName, Context context) { - return new PagedFlux<>( - () -> listByRouteFilterSinglePageAsync(resourceGroupName, routeFilterName, context), - nextLink -> listByRouteFilterNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all RouteFilterRules in a route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all RouteFilterRules in a route filter. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByRouteFilter(String resourceGroupName, String routeFilterName) { - return new PagedIterable<>(listByRouteFilterAsync(resourceGroupName, routeFilterName)); - } - - /** - * Gets all RouteFilterRules in a route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all RouteFilterRules in a route filter. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByRouteFilter( - String resourceGroupName, String routeFilterName, Context context) { - return new PagedIterable<>(listByRouteFilterAsync(resourceGroupName, routeFilterName, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the ListRouteFilterRules API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByRouteFilterNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByRouteFilterNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the ListRouteFilterRules API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByRouteFilterNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByRouteFilterNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/RouteFiltersClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/RouteFiltersClientImpl.java deleted file mode 100644 index 01ad511e2fb4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/RouteFiltersClientImpl.java +++ /dev/null @@ -1,1588 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.RouteFiltersClient; -import com.azure.resourcemanager.network.fluent.models.RouteFilterInner; -import com.azure.resourcemanager.network.models.PatchRouteFilter; -import com.azure.resourcemanager.network.models.RouteFilterListResult; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in RouteFiltersClient. */ -public final class RouteFiltersClientImpl - implements InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete, - RouteFiltersClient { - private final ClientLogger logger = new ClientLogger(RouteFiltersClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final RouteFiltersService service; - - /** The service client containing this operation class. */ - private final NetworkManagementClientImpl client; - - /** - * Initializes an instance of RouteFiltersClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - RouteFiltersClientImpl(NetworkManagementClientImpl client) { - this.service = - RestProxy.create(RouteFiltersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for NetworkManagementClientRouteFilters to be used by the proxy service - * to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "NetworkManagementCli") - private interface RouteFiltersService { - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/routeFilters/{routeFilterName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("routeFilterName") String routeFilterName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/routeFilters/{routeFilterName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("routeFilterName") String routeFilterName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("$expand") String expand, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/routeFilters/{routeFilterName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("routeFilterName") String routeFilterName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") RouteFilterInner routeFilterParameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/routeFilters/{routeFilterName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("routeFilterName") String routeFilterName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") PatchRouteFilter routeFilterParameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/routeFilters") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/routeFilters") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Deletes the specified route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync(String resourceGroupName, String routeFilterName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (routeFilterName == null) { - return Mono - .error(new IllegalArgumentException("Parameter routeFilterName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - routeFilterName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the specified route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String routeFilterName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (routeFilterName == null) { - return Mono - .error(new IllegalArgumentException("Parameter routeFilterName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - routeFilterName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Deletes the specified route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String routeFilterName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, routeFilterName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deletes the specified route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String routeFilterName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(resourceGroupName, routeFilterName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes the specified route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete(String resourceGroupName, String routeFilterName) { - return beginDeleteAsync(resourceGroupName, routeFilterName).getSyncPoller(); - } - - /** - * Deletes the specified route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String routeFilterName, Context context) { - return beginDeleteAsync(resourceGroupName, routeFilterName, context).getSyncPoller(); - } - - /** - * Deletes the specified route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String routeFilterName) { - return beginDeleteAsync(resourceGroupName, routeFilterName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String routeFilterName, Context context) { - return beginDeleteAsync(resourceGroupName, routeFilterName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String routeFilterName) { - deleteAsync(resourceGroupName, routeFilterName).block(); - } - - /** - * Deletes the specified route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String routeFilterName, Context context) { - deleteAsync(resourceGroupName, routeFilterName, context).block(); - } - - /** - * Gets the specified route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param expand Expands referenced express route bgp peering resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified route filter. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String routeFilterName, String expand) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (routeFilterName == null) { - return Mono - .error(new IllegalArgumentException("Parameter routeFilterName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - routeFilterName, - apiVersion, - this.client.getSubscriptionId(), - expand, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the specified route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param expand Expands referenced express route bgp peering resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified route filter. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String routeFilterName, String expand, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (routeFilterName == null) { - return Mono - .error(new IllegalArgumentException("Parameter routeFilterName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - routeFilterName, - apiVersion, - this.client.getSubscriptionId(), - expand, - accept, - context); - } - - /** - * Gets the specified route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param expand Expands referenced express route bgp peering resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified route filter. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync( - String resourceGroupName, String routeFilterName, String expand) { - return getByResourceGroupWithResponseAsync(resourceGroupName, routeFilterName, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the specified route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified route filter. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync(String resourceGroupName, String routeFilterName) { - final String expand = null; - return getByResourceGroupWithResponseAsync(resourceGroupName, routeFilterName, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the specified route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified route filter. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RouteFilterInner getByResourceGroup(String resourceGroupName, String routeFilterName) { - final String expand = null; - return getByResourceGroupAsync(resourceGroupName, routeFilterName, expand).block(); - } - - /** - * Gets the specified route filter. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param expand Expands referenced express route bgp peering resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified route filter. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String routeFilterName, String expand, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, routeFilterName, expand, context).block(); - } - - /** - * Creates or updates a route filter in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param routeFilterParameters Parameters supplied to the create or update route filter operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route Filter Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String routeFilterName, RouteFilterInner routeFilterParameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (routeFilterName == null) { - return Mono - .error(new IllegalArgumentException("Parameter routeFilterName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (routeFilterParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter routeFilterParameters is required and cannot be null.")); - } else { - routeFilterParameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - routeFilterName, - apiVersion, - this.client.getSubscriptionId(), - routeFilterParameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a route filter in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param routeFilterParameters Parameters supplied to the create or update route filter operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route Filter Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String routeFilterName, RouteFilterInner routeFilterParameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (routeFilterName == null) { - return Mono - .error(new IllegalArgumentException("Parameter routeFilterName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (routeFilterParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter routeFilterParameters is required and cannot be null.")); - } else { - routeFilterParameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - routeFilterName, - apiVersion, - this.client.getSubscriptionId(), - routeFilterParameters, - accept, - context); - } - - /** - * Creates or updates a route filter in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param routeFilterParameters Parameters supplied to the create or update route filter operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route Filter Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, RouteFilterInner> beginCreateOrUpdateAsync( - String resourceGroupName, String routeFilterName, RouteFilterInner routeFilterParameters) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, routeFilterName, routeFilterParameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - RouteFilterInner.class, - RouteFilterInner.class, - this.client.getContext()); - } - - /** - * Creates or updates a route filter in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param routeFilterParameters Parameters supplied to the create or update route filter operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route Filter Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, RouteFilterInner> beginCreateOrUpdateAsync( - String resourceGroupName, String routeFilterName, RouteFilterInner routeFilterParameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, routeFilterName, routeFilterParameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), RouteFilterInner.class, RouteFilterInner.class, context); - } - - /** - * Creates or updates a route filter in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param routeFilterParameters Parameters supplied to the create or update route filter operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route Filter Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, RouteFilterInner> beginCreateOrUpdate( - String resourceGroupName, String routeFilterName, RouteFilterInner routeFilterParameters) { - return beginCreateOrUpdateAsync(resourceGroupName, routeFilterName, routeFilterParameters).getSyncPoller(); - } - - /** - * Creates or updates a route filter in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param routeFilterParameters Parameters supplied to the create or update route filter operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route Filter Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, RouteFilterInner> beginCreateOrUpdate( - String resourceGroupName, String routeFilterName, RouteFilterInner routeFilterParameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, routeFilterName, routeFilterParameters, context) - .getSyncPoller(); - } - - /** - * Creates or updates a route filter in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param routeFilterParameters Parameters supplied to the create or update route filter operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route Filter Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, String routeFilterName, RouteFilterInner routeFilterParameters) { - return beginCreateOrUpdateAsync(resourceGroupName, routeFilterName, routeFilterParameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a route filter in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param routeFilterParameters Parameters supplied to the create or update route filter operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route Filter Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String routeFilterName, RouteFilterInner routeFilterParameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, routeFilterName, routeFilterParameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a route filter in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param routeFilterParameters Parameters supplied to the create or update route filter operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route Filter Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RouteFilterInner createOrUpdate( - String resourceGroupName, String routeFilterName, RouteFilterInner routeFilterParameters) { - return createOrUpdateAsync(resourceGroupName, routeFilterName, routeFilterParameters).block(); - } - - /** - * Creates or updates a route filter in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param routeFilterParameters Parameters supplied to the create or update route filter operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route Filter Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RouteFilterInner createOrUpdate( - String resourceGroupName, String routeFilterName, RouteFilterInner routeFilterParameters, Context context) { - return createOrUpdateAsync(resourceGroupName, routeFilterName, routeFilterParameters, context).block(); - } - - /** - * Updates a route filter in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param routeFilterParameters Parameters supplied to the update route filter operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route Filter Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateWithResponseAsync( - String resourceGroupName, String routeFilterName, PatchRouteFilter routeFilterParameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (routeFilterName == null) { - return Mono - .error(new IllegalArgumentException("Parameter routeFilterName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (routeFilterParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter routeFilterParameters is required and cannot be null.")); - } else { - routeFilterParameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - resourceGroupName, - routeFilterName, - apiVersion, - this.client.getSubscriptionId(), - routeFilterParameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates a route filter in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param routeFilterParameters Parameters supplied to the update route filter operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route Filter Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, String routeFilterName, PatchRouteFilter routeFilterParameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (routeFilterName == null) { - return Mono - .error(new IllegalArgumentException("Parameter routeFilterName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (routeFilterParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter routeFilterParameters is required and cannot be null.")); - } else { - routeFilterParameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - resourceGroupName, - routeFilterName, - apiVersion, - this.client.getSubscriptionId(), - routeFilterParameters, - accept, - context); - } - - /** - * Updates a route filter in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param routeFilterParameters Parameters supplied to the update route filter operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route Filter Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, RouteFilterInner> beginUpdateAsync( - String resourceGroupName, String routeFilterName, PatchRouteFilter routeFilterParameters) { - Mono>> mono = - updateWithResponseAsync(resourceGroupName, routeFilterName, routeFilterParameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - RouteFilterInner.class, - RouteFilterInner.class, - this.client.getContext()); - } - - /** - * Updates a route filter in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param routeFilterParameters Parameters supplied to the update route filter operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route Filter Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, RouteFilterInner> beginUpdateAsync( - String resourceGroupName, String routeFilterName, PatchRouteFilter routeFilterParameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - updateWithResponseAsync(resourceGroupName, routeFilterName, routeFilterParameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), RouteFilterInner.class, RouteFilterInner.class, context); - } - - /** - * Updates a route filter in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param routeFilterParameters Parameters supplied to the update route filter operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route Filter Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, RouteFilterInner> beginUpdate( - String resourceGroupName, String routeFilterName, PatchRouteFilter routeFilterParameters) { - return beginUpdateAsync(resourceGroupName, routeFilterName, routeFilterParameters).getSyncPoller(); - } - - /** - * Updates a route filter in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param routeFilterParameters Parameters supplied to the update route filter operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route Filter Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, RouteFilterInner> beginUpdate( - String resourceGroupName, String routeFilterName, PatchRouteFilter routeFilterParameters, Context context) { - return beginUpdateAsync(resourceGroupName, routeFilterName, routeFilterParameters, context).getSyncPoller(); - } - - /** - * Updates a route filter in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param routeFilterParameters Parameters supplied to the update route filter operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route Filter Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync( - String resourceGroupName, String routeFilterName, PatchRouteFilter routeFilterParameters) { - return beginUpdateAsync(resourceGroupName, routeFilterName, routeFilterParameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates a route filter in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param routeFilterParameters Parameters supplied to the update route filter operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route Filter Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, String routeFilterName, PatchRouteFilter routeFilterParameters, Context context) { - return beginUpdateAsync(resourceGroupName, routeFilterName, routeFilterParameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates a route filter in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param routeFilterParameters Parameters supplied to the update route filter operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route Filter Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RouteFilterInner update( - String resourceGroupName, String routeFilterName, PatchRouteFilter routeFilterParameters) { - return updateAsync(resourceGroupName, routeFilterName, routeFilterParameters).block(); - } - - /** - * Updates a route filter in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param routeFilterName The name of the route filter. - * @param routeFilterParameters Parameters supplied to the update route filter operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route Filter Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RouteFilterInner update( - String resourceGroupName, String routeFilterName, PatchRouteFilter routeFilterParameters, Context context) { - return updateAsync(resourceGroupName, routeFilterName, routeFilterParameters, context).block(); - } - - /** - * Gets all route filters in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all route filters in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all route filters in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all route filters in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all route filters in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all route filters in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * Gets all route filters in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all route filters in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all route filters in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all route filters in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * Gets all route filters in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all route filters in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * Gets all route filters in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all route filters in a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all route filters in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all route filters in a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all route filters in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all route filters in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets all route filters in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all route filters in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all route filters in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all route filters in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Gets all route filters in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all route filters in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the ListRouteFilters API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the ListRouteFilters API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the ListRouteFilters API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the ListRouteFilters API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/RouteFiltersImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/RouteFiltersImpl.java deleted file mode 100644 index 18847171ecce..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/RouteFiltersImpl.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.network.fluent.RouteFiltersClient; -import com.azure.resourcemanager.network.fluent.models.RouteFilterInner; -import com.azure.resourcemanager.network.models.RouteFilter; -import com.azure.resourcemanager.network.models.RouteFilters; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.TopLevelModifiableResourcesImpl; - -/** Implementation for RouteFilters. */ -public class RouteFiltersImpl - extends TopLevelModifiableResourcesImpl< - RouteFilter, RouteFilterImpl, RouteFilterInner, RouteFiltersClient, NetworkManager> - implements RouteFilters { - - public RouteFiltersImpl(final NetworkManager networkManager) { - super(networkManager.serviceClient().getRouteFilters(), networkManager); - } - - @Override - public RouteFilterImpl define(String name) { - return wrapModel(name); - } - - @Override - protected RouteFilterImpl wrapModel(String name) { - RouteFilterInner inner = new RouteFilterInner(); - return new RouteFilterImpl(name, inner, super.manager()); - } - - @Override - protected RouteFilterImpl wrapModel(RouteFilterInner inner) { - if (inner == null) { - return null; - } - return new RouteFilterImpl(inner.name(), inner, this.manager()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/RouteImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/RouteImpl.java deleted file mode 100644 index 3245b5be5c89..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/RouteImpl.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.resourcemanager.network.models.Route; -import com.azure.resourcemanager.network.models.RouteNextHopType; -import com.azure.resourcemanager.network.models.RouteTable; -import com.azure.resourcemanager.network.fluent.models.RouteInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.ChildResourceImpl; - -/** Implementation of Route. */ -class RouteImpl extends ChildResourceImpl - implements Route, - Route.Definition, - Route.UpdateDefinition, - Route.Update { - - RouteImpl(RouteInner inner, RouteTableImpl parent) { - super(inner, parent); - } - - // Getters - @Override - public String name() { - return this.innerModel().name(); - } - - @Override - public String destinationAddressPrefix() { - return this.innerModel().addressPrefix(); - } - - @Override - public RouteNextHopType nextHopType() { - return this.innerModel().nextHopType(); - } - - @Override - public String nextHopIpAddress() { - return this.innerModel().nextHopIpAddress(); - } - - // Fluent setters - - @Override - public RouteImpl withNextHop(RouteNextHopType nextHopType) { - this.innerModel().withNextHopType(nextHopType); - return this; - } - - @Override - public RouteImpl withDestinationAddressPrefix(String cidr) { - this.innerModel().withAddressPrefix(cidr); - return this; - } - - @Override - public RouteImpl withNextHopToVirtualAppliance(String ipAddress) { - this.innerModel().withNextHopType(RouteNextHopType.VIRTUAL_APPLIANCE).withNextHopIpAddress(ipAddress); - return this; - } - - // Verbs - - @Override - public RouteTableImpl attach() { - return this.parent().withRoute(this); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/RouteTableImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/RouteTableImpl.java deleted file mode 100644 index 5e3969a2a71c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/RouteTableImpl.java +++ /dev/null @@ -1,169 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.network.fluent.models.RouteInner; -import com.azure.resourcemanager.network.fluent.models.RouteTableInner; -import com.azure.resourcemanager.network.models.Route; -import com.azure.resourcemanager.network.models.RouteNextHopType; -import com.azure.resourcemanager.network.models.RouteTable; -import com.azure.resourcemanager.network.models.Subnet; -import com.azure.resourcemanager.network.models.TagsObject; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import reactor.core.publisher.Mono; - -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.TreeMap; - -/** Implementation for RouteTable. */ -class RouteTableImpl - extends GroupableParentResourceWithTagsImpl - implements RouteTable, RouteTable.Definition, RouteTable.Update { - - private Map routes; - - RouteTableImpl(String name, final RouteTableInner innerModel, final NetworkManager networkManager) { - super(name, innerModel, networkManager); - } - - @Override - protected Mono applyTagsToInnerAsync() { - return this - .manager() - .serviceClient() - .getRouteTables() - .updateTagsAsync(resourceGroupName(), name(), new TagsObject().withTags(innerModel().tags())); - } - - @Override - protected void initializeChildrenFromInner() { - this.routes = new TreeMap<>(); - List inners = this.innerModel().routes(); - if (inners != null) { - for (RouteInner inner : inners) { - RouteImpl route = new RouteImpl(inner, this); - this.routes.put(inner.name(), route); - } - } - } - - // Getters - - // Verbs - - @Override - public Mono refreshAsync() { - return super - .refreshAsync() - .map( - routeTable -> { - RouteTableImpl impl = (RouteTableImpl) routeTable; - impl.initializeChildrenFromInner(); - return impl; - }); - } - - @Override - protected Mono getInnerAsync() { - return this - .manager() - .serviceClient() - .getRouteTables() - .getByResourceGroupAsync(this.resourceGroupName(), this.name()); - } - - @Override - public List listAssociatedSubnets() { - return com - .azure - .resourcemanager - .network - .implementation - .Utils - .listAssociatedSubnets(this.myManager, this.innerModel().subnets()); - } - - // Setters (fluent) - - @Override - public RouteImpl defineRoute(String name) { - RouteInner inner = new RouteInner().withName(name); - return new RouteImpl(inner, this); - } - - @Override - public RouteImpl updateRoute(String name) { - return (RouteImpl) this.routes.get(name); - } - - @Override - public Update withoutRoute(String name) { - this.routes.remove(name); - return this; - } - - @Override - public RouteTableImpl withRoute(String destinationAddressPrefix, RouteNextHopType nextHop) { - return this - .defineRoute("route_" + this.name() + System.currentTimeMillis()) - .withDestinationAddressPrefix(destinationAddressPrefix) - .withNextHop(nextHop) - .attach(); - } - - @Override - public RouteTableImpl withRouteViaVirtualAppliance(String destinationAddressPrefix, String ipAddress) { - return this - .defineRoute("route_" + this.name() + System.currentTimeMillis()) - .withDestinationAddressPrefix(destinationAddressPrefix) - .withNextHopToVirtualAppliance(ipAddress) - .attach(); - } - - RouteTableImpl withRoute(RouteImpl route) { - this.routes.put(route.name(), route); - return this; - } - - // Helpers - - @Override - protected void beforeCreating() { - // Reset and update routes - this.innerModel().withRoutes(innersFromWrappers(this.routes.values())); - } - - @Override - protected Mono createInner() { - return this - .manager() - .serviceClient() - .getRouteTables() - .createOrUpdateAsync(this.resourceGroupName(), this.name(), this.innerModel()); - } - - @Override - public Map routes() { - return Collections.unmodifiableMap(this.routes); - } - - @Override - public boolean isBgpRoutePropagationDisabled() { - return ResourceManagerUtils.toPrimitiveBoolean(innerModel().disableBgpRoutePropagation()); - } - - @Override - public RouteTableImpl withDisableBgpRoutePropagation() { - innerModel().withDisableBgpRoutePropagation(true); - return this; - } - - @Override - public RouteTableImpl withEnableBgpRoutePropagation() { - innerModel().withDisableBgpRoutePropagation(false); - return this; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/RouteTablesClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/RouteTablesClientImpl.java deleted file mode 100644 index f98b24dde77e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/RouteTablesClientImpl.java +++ /dev/null @@ -1,1570 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.RouteTablesClient; -import com.azure.resourcemanager.network.fluent.models.RouteTableInner; -import com.azure.resourcemanager.network.models.RouteTableListResult; -import com.azure.resourcemanager.network.models.TagsObject; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in RouteTablesClient. */ -public final class RouteTablesClientImpl - implements InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete, - RouteTablesClient { - private final ClientLogger logger = new ClientLogger(RouteTablesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final RouteTablesService service; - - /** The service client containing this operation class. */ - private final NetworkManagementClientImpl client; - - /** - * Initializes an instance of RouteTablesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - RouteTablesClientImpl(NetworkManagementClientImpl client) { - this.service = - RestProxy.create(RouteTablesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for NetworkManagementClientRouteTables to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "NetworkManagementCli") - private interface RouteTablesService { - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables" - + "/{routeTableName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("routeTableName") String routeTableName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables" - + "/{routeTableName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("routeTableName") String routeTableName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("$expand") String expand, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables" - + "/{routeTableName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("routeTableName") String routeTableName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") RouteTableInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables" - + "/{routeTableName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> updateTags( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("routeTableName") String routeTableName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") TagsObject parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/routeTables") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/routeTables") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAllNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Deletes the specified route table. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync(String resourceGroupName, String routeTableName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (routeTableName == null) { - return Mono.error(new IllegalArgumentException("Parameter routeTableName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - routeTableName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the specified route table. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String routeTableName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (routeTableName == null) { - return Mono.error(new IllegalArgumentException("Parameter routeTableName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - routeTableName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Deletes the specified route table. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String routeTableName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, routeTableName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deletes the specified route table. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String routeTableName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(resourceGroupName, routeTableName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes the specified route table. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete(String resourceGroupName, String routeTableName) { - return beginDeleteAsync(resourceGroupName, routeTableName).getSyncPoller(); - } - - /** - * Deletes the specified route table. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String routeTableName, Context context) { - return beginDeleteAsync(resourceGroupName, routeTableName, context).getSyncPoller(); - } - - /** - * Deletes the specified route table. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String routeTableName) { - return beginDeleteAsync(resourceGroupName, routeTableName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified route table. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String routeTableName, Context context) { - return beginDeleteAsync(resourceGroupName, routeTableName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified route table. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String routeTableName) { - deleteAsync(resourceGroupName, routeTableName).block(); - } - - /** - * Deletes the specified route table. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String routeTableName, Context context) { - deleteAsync(resourceGroupName, routeTableName, context).block(); - } - - /** - * Gets the specified route table. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param expand Expands referenced resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified route table. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String routeTableName, String expand) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (routeTableName == null) { - return Mono.error(new IllegalArgumentException("Parameter routeTableName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - routeTableName, - apiVersion, - this.client.getSubscriptionId(), - expand, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the specified route table. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param expand Expands referenced resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified route table. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String routeTableName, String expand, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (routeTableName == null) { - return Mono.error(new IllegalArgumentException("Parameter routeTableName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - routeTableName, - apiVersion, - this.client.getSubscriptionId(), - expand, - accept, - context); - } - - /** - * Gets the specified route table. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param expand Expands referenced resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified route table. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync( - String resourceGroupName, String routeTableName, String expand) { - return getByResourceGroupWithResponseAsync(resourceGroupName, routeTableName, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the specified route table. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified route table. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync(String resourceGroupName, String routeTableName) { - final String expand = null; - return getByResourceGroupWithResponseAsync(resourceGroupName, routeTableName, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the specified route table. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified route table. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RouteTableInner getByResourceGroup(String resourceGroupName, String routeTableName) { - final String expand = null; - return getByResourceGroupAsync(resourceGroupName, routeTableName, expand).block(); - } - - /** - * Gets the specified route table. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param expand Expands referenced resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified route table. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String routeTableName, String expand, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, routeTableName, expand, context).block(); - } - - /** - * Create or updates a route table in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param parameters Parameters supplied to the create or update route table operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route table resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String routeTableName, RouteTableInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (routeTableName == null) { - return Mono.error(new IllegalArgumentException("Parameter routeTableName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - routeTableName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create or updates a route table in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param parameters Parameters supplied to the create or update route table operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route table resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String routeTableName, RouteTableInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (routeTableName == null) { - return Mono.error(new IllegalArgumentException("Parameter routeTableName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - routeTableName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Create or updates a route table in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param parameters Parameters supplied to the create or update route table operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route table resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, RouteTableInner> beginCreateOrUpdateAsync( - String resourceGroupName, String routeTableName, RouteTableInner parameters) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, routeTableName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - RouteTableInner.class, - RouteTableInner.class, - this.client.getContext()); - } - - /** - * Create or updates a route table in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param parameters Parameters supplied to the create or update route table operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route table resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, RouteTableInner> beginCreateOrUpdateAsync( - String resourceGroupName, String routeTableName, RouteTableInner parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, routeTableName, parameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), RouteTableInner.class, RouteTableInner.class, context); - } - - /** - * Create or updates a route table in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param parameters Parameters supplied to the create or update route table operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route table resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, RouteTableInner> beginCreateOrUpdate( - String resourceGroupName, String routeTableName, RouteTableInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, routeTableName, parameters).getSyncPoller(); - } - - /** - * Create or updates a route table in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param parameters Parameters supplied to the create or update route table operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route table resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, RouteTableInner> beginCreateOrUpdate( - String resourceGroupName, String routeTableName, RouteTableInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, routeTableName, parameters, context).getSyncPoller(); - } - - /** - * Create or updates a route table in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param parameters Parameters supplied to the create or update route table operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route table resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, String routeTableName, RouteTableInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, routeTableName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create or updates a route table in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param parameters Parameters supplied to the create or update route table operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route table resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String routeTableName, RouteTableInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, routeTableName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create or updates a route table in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param parameters Parameters supplied to the create or update route table operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route table resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RouteTableInner createOrUpdate(String resourceGroupName, String routeTableName, RouteTableInner parameters) { - return createOrUpdateAsync(resourceGroupName, routeTableName, parameters).block(); - } - - /** - * Create or updates a route table in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param parameters Parameters supplied to the create or update route table operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route table resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RouteTableInner createOrUpdate( - String resourceGroupName, String routeTableName, RouteTableInner parameters, Context context) { - return createOrUpdateAsync(resourceGroupName, routeTableName, parameters, context).block(); - } - - /** - * Updates a route table tags. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param parameters Parameters supplied to update route table tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route table resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateTagsWithResponseAsync( - String resourceGroupName, String routeTableName, TagsObject parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (routeTableName == null) { - return Mono.error(new IllegalArgumentException("Parameter routeTableName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updateTags( - this.client.getEndpoint(), - resourceGroupName, - routeTableName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates a route table tags. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param parameters Parameters supplied to update route table tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route table resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateTagsWithResponseAsync( - String resourceGroupName, String routeTableName, TagsObject parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (routeTableName == null) { - return Mono.error(new IllegalArgumentException("Parameter routeTableName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updateTags( - this.client.getEndpoint(), - resourceGroupName, - routeTableName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Updates a route table tags. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param parameters Parameters supplied to update route table tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route table resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, RouteTableInner> beginUpdateTagsAsync( - String resourceGroupName, String routeTableName, TagsObject parameters) { - Mono>> mono = - updateTagsWithResponseAsync(resourceGroupName, routeTableName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - RouteTableInner.class, - RouteTableInner.class, - this.client.getContext()); - } - - /** - * Updates a route table tags. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param parameters Parameters supplied to update route table tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route table resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, RouteTableInner> beginUpdateTagsAsync( - String resourceGroupName, String routeTableName, TagsObject parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - updateTagsWithResponseAsync(resourceGroupName, routeTableName, parameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), RouteTableInner.class, RouteTableInner.class, context); - } - - /** - * Updates a route table tags. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param parameters Parameters supplied to update route table tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route table resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, RouteTableInner> beginUpdateTags( - String resourceGroupName, String routeTableName, TagsObject parameters) { - return beginUpdateTagsAsync(resourceGroupName, routeTableName, parameters).getSyncPoller(); - } - - /** - * Updates a route table tags. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param parameters Parameters supplied to update route table tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route table resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, RouteTableInner> beginUpdateTags( - String resourceGroupName, String routeTableName, TagsObject parameters, Context context) { - return beginUpdateTagsAsync(resourceGroupName, routeTableName, parameters, context).getSyncPoller(); - } - - /** - * Updates a route table tags. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param parameters Parameters supplied to update route table tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route table resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateTagsAsync( - String resourceGroupName, String routeTableName, TagsObject parameters) { - return beginUpdateTagsAsync(resourceGroupName, routeTableName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates a route table tags. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param parameters Parameters supplied to update route table tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route table resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateTagsAsync( - String resourceGroupName, String routeTableName, TagsObject parameters, Context context) { - return beginUpdateTagsAsync(resourceGroupName, routeTableName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates a route table tags. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param parameters Parameters supplied to update route table tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route table resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RouteTableInner updateTags(String resourceGroupName, String routeTableName, TagsObject parameters) { - return updateTagsAsync(resourceGroupName, routeTableName, parameters).block(); - } - - /** - * Updates a route table tags. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param parameters Parameters supplied to update route table tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route table resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RouteTableInner updateTags( - String resourceGroupName, String routeTableName, TagsObject parameters, Context context) { - return updateTagsAsync(resourceGroupName, routeTableName, parameters, context).block(); - } - - /** - * Gets all route tables in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all route tables in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all route tables in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all route tables in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all route tables in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all route tables in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets all route tables in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all route tables in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all route tables in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all route tables in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * Gets all route tables in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all route tables in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * Gets all route tables in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all route tables in a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all route tables in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all route tables in a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all route tables in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all route tables in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listAllNextSinglePageAsync(nextLink)); - } - - /** - * Gets all route tables in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all route tables in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listAllNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all route tables in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all route tables in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Gets all route tables in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all route tables in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the ListRouteTable API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the ListRouteTable API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the ListRouteTable API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAllNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listAllNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the ListRouteTable API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAllNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listAllNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/RouteTablesImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/RouteTablesImpl.java deleted file mode 100644 index ec29bac4c002..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/RouteTablesImpl.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.network.fluent.RouteTablesClient; -import com.azure.resourcemanager.network.fluent.models.RouteTableInner; -import com.azure.resourcemanager.network.models.RouteTable; -import com.azure.resourcemanager.network.models.RouteTables; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.TopLevelModifiableResourcesImpl; - -/** Implementation for RouteTables. */ -public class RouteTablesImpl - extends TopLevelModifiableResourcesImpl< - RouteTable, RouteTableImpl, RouteTableInner, RouteTablesClient, NetworkManager> - implements RouteTables { - - public RouteTablesImpl(final NetworkManager networkManager) { - super(networkManager.serviceClient().getRouteTables(), networkManager); - } - - @Override - public RouteTableImpl define(String name) { - return wrapModel(name); - } - - // Fluent model create helpers - - @Override - protected RouteTableImpl wrapModel(String name) { - RouteTableInner inner = new RouteTableInner(); - - return new RouteTableImpl(name, inner, this.manager()); - } - - @Override - protected RouteTableImpl wrapModel(RouteTableInner inner) { - return new RouteTableImpl(inner.name(), inner, this.manager()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/RoutesClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/RoutesClientImpl.java deleted file mode 100644 index 1fbcfba936e8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/RoutesClientImpl.java +++ /dev/null @@ -1,1111 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.RoutesClient; -import com.azure.resourcemanager.network.fluent.models.RouteInner; -import com.azure.resourcemanager.network.models.RouteListResult; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in RoutesClient. */ -public final class RoutesClientImpl implements RoutesClient { - private final ClientLogger logger = new ClientLogger(RoutesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final RoutesService service; - - /** The service client containing this operation class. */ - private final NetworkManagementClientImpl client; - - /** - * Initializes an instance of RoutesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - RoutesClientImpl(NetworkManagementClientImpl client) { - this.service = RestProxy.create(RoutesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for NetworkManagementClientRoutes to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "NetworkManagementCli") - private interface RoutesService { - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables" - + "/{routeTableName}/routes/{routeName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("routeTableName") String routeTableName, - @PathParam("routeName") String routeName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables" - + "/{routeTableName}/routes/{routeName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("routeTableName") String routeTableName, - @PathParam("routeName") String routeName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables" - + "/{routeTableName}/routes/{routeName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("routeTableName") String routeTableName, - @PathParam("routeName") String routeName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") RouteInner routeParameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables" - + "/{routeTableName}/routes") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("routeTableName") String routeTableName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Deletes the specified route from a route table. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param routeName The name of the route. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync( - String resourceGroupName, String routeTableName, String routeName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (routeTableName == null) { - return Mono.error(new IllegalArgumentException("Parameter routeTableName is required and cannot be null.")); - } - if (routeName == null) { - return Mono.error(new IllegalArgumentException("Parameter routeName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - routeTableName, - routeName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the specified route from a route table. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param routeName The name of the route. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String routeTableName, String routeName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (routeTableName == null) { - return Mono.error(new IllegalArgumentException("Parameter routeTableName is required and cannot be null.")); - } - if (routeName == null) { - return Mono.error(new IllegalArgumentException("Parameter routeName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - routeTableName, - routeName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Deletes the specified route from a route table. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param routeName The name of the route. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String routeTableName, String routeName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, routeTableName, routeName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deletes the specified route from a route table. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param routeName The name of the route. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String routeTableName, String routeName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, routeTableName, routeName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes the specified route from a route table. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param routeName The name of the route. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String routeTableName, String routeName) { - return beginDeleteAsync(resourceGroupName, routeTableName, routeName).getSyncPoller(); - } - - /** - * Deletes the specified route from a route table. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param routeName The name of the route. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String routeTableName, String routeName, Context context) { - return beginDeleteAsync(resourceGroupName, routeTableName, routeName, context).getSyncPoller(); - } - - /** - * Deletes the specified route from a route table. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param routeName The name of the route. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String routeTableName, String routeName) { - return beginDeleteAsync(resourceGroupName, routeTableName, routeName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified route from a route table. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param routeName The name of the route. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String routeTableName, String routeName, Context context) { - return beginDeleteAsync(resourceGroupName, routeTableName, routeName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified route from a route table. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param routeName The name of the route. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String routeTableName, String routeName) { - deleteAsync(resourceGroupName, routeTableName, routeName).block(); - } - - /** - * Deletes the specified route from a route table. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param routeName The name of the route. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String routeTableName, String routeName, Context context) { - deleteAsync(resourceGroupName, routeTableName, routeName, context).block(); - } - - /** - * Gets the specified route from a route table. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param routeName The name of the route. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified route from a route table. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String resourceGroupName, String routeTableName, String routeName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (routeTableName == null) { - return Mono.error(new IllegalArgumentException("Parameter routeTableName is required and cannot be null.")); - } - if (routeName == null) { - return Mono.error(new IllegalArgumentException("Parameter routeName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - resourceGroupName, - routeTableName, - routeName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the specified route from a route table. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param routeName The name of the route. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified route from a route table. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String routeTableName, String routeName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (routeTableName == null) { - return Mono.error(new IllegalArgumentException("Parameter routeTableName is required and cannot be null.")); - } - if (routeName == null) { - return Mono.error(new IllegalArgumentException("Parameter routeName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - resourceGroupName, - routeTableName, - routeName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets the specified route from a route table. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param routeName The name of the route. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified route from a route table. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync(String resourceGroupName, String routeTableName, String routeName) { - return getWithResponseAsync(resourceGroupName, routeTableName, routeName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the specified route from a route table. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param routeName The name of the route. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified route from a route table. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RouteInner get(String resourceGroupName, String routeTableName, String routeName) { - return getAsync(resourceGroupName, routeTableName, routeName).block(); - } - - /** - * Gets the specified route from a route table. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param routeName The name of the route. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified route from a route table. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String routeTableName, String routeName, Context context) { - return getWithResponseAsync(resourceGroupName, routeTableName, routeName, context).block(); - } - - /** - * Creates or updates a route in the specified route table. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param routeName The name of the route. - * @param routeParameters Parameters supplied to the create or update route operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String routeTableName, String routeName, RouteInner routeParameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (routeTableName == null) { - return Mono.error(new IllegalArgumentException("Parameter routeTableName is required and cannot be null.")); - } - if (routeName == null) { - return Mono.error(new IllegalArgumentException("Parameter routeName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (routeParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter routeParameters is required and cannot be null.")); - } else { - routeParameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - routeTableName, - routeName, - apiVersion, - this.client.getSubscriptionId(), - routeParameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a route in the specified route table. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param routeName The name of the route. - * @param routeParameters Parameters supplied to the create or update route operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String routeTableName, - String routeName, - RouteInner routeParameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (routeTableName == null) { - return Mono.error(new IllegalArgumentException("Parameter routeTableName is required and cannot be null.")); - } - if (routeName == null) { - return Mono.error(new IllegalArgumentException("Parameter routeName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (routeParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter routeParameters is required and cannot be null.")); - } else { - routeParameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - routeTableName, - routeName, - apiVersion, - this.client.getSubscriptionId(), - routeParameters, - accept, - context); - } - - /** - * Creates or updates a route in the specified route table. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param routeName The name of the route. - * @param routeParameters Parameters supplied to the create or update route operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, RouteInner> beginCreateOrUpdateAsync( - String resourceGroupName, String routeTableName, String routeName, RouteInner routeParameters) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, routeTableName, routeName, routeParameters); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), RouteInner.class, RouteInner.class, this.client.getContext()); - } - - /** - * Creates or updates a route in the specified route table. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param routeName The name of the route. - * @param routeParameters Parameters supplied to the create or update route operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, RouteInner> beginCreateOrUpdateAsync( - String resourceGroupName, - String routeTableName, - String routeName, - RouteInner routeParameters, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, routeTableName, routeName, routeParameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), RouteInner.class, RouteInner.class, context); - } - - /** - * Creates or updates a route in the specified route table. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param routeName The name of the route. - * @param routeParameters Parameters supplied to the create or update route operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, RouteInner> beginCreateOrUpdate( - String resourceGroupName, String routeTableName, String routeName, RouteInner routeParameters) { - return beginCreateOrUpdateAsync(resourceGroupName, routeTableName, routeName, routeParameters).getSyncPoller(); - } - - /** - * Creates or updates a route in the specified route table. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param routeName The name of the route. - * @param routeParameters Parameters supplied to the create or update route operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, RouteInner> beginCreateOrUpdate( - String resourceGroupName, - String routeTableName, - String routeName, - RouteInner routeParameters, - Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, routeTableName, routeName, routeParameters, context) - .getSyncPoller(); - } - - /** - * Creates or updates a route in the specified route table. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param routeName The name of the route. - * @param routeParameters Parameters supplied to the create or update route operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, String routeTableName, String routeName, RouteInner routeParameters) { - return beginCreateOrUpdateAsync(resourceGroupName, routeTableName, routeName, routeParameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a route in the specified route table. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param routeName The name of the route. - * @param routeParameters Parameters supplied to the create or update route operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, - String routeTableName, - String routeName, - RouteInner routeParameters, - Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, routeTableName, routeName, routeParameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a route in the specified route table. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param routeName The name of the route. - * @param routeParameters Parameters supplied to the create or update route operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RouteInner createOrUpdate( - String resourceGroupName, String routeTableName, String routeName, RouteInner routeParameters) { - return createOrUpdateAsync(resourceGroupName, routeTableName, routeName, routeParameters).block(); - } - - /** - * Creates or updates a route in the specified route table. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param routeName The name of the route. - * @param routeParameters Parameters supplied to the create or update route operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return route resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RouteInner createOrUpdate( - String resourceGroupName, - String routeTableName, - String routeName, - RouteInner routeParameters, - Context context) { - return createOrUpdateAsync(resourceGroupName, routeTableName, routeName, routeParameters, context).block(); - } - - /** - * Gets all routes in a route table. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all routes in a route table. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String routeTableName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (routeTableName == null) { - return Mono.error(new IllegalArgumentException("Parameter routeTableName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - resourceGroupName, - routeTableName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all routes in a route table. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all routes in a route table. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String routeTableName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (routeTableName == null) { - return Mono.error(new IllegalArgumentException("Parameter routeTableName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - resourceGroupName, - routeTableName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all routes in a route table. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all routes in a route table. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String resourceGroupName, String routeTableName) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, routeTableName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets all routes in a route table. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all routes in a route table. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String routeTableName, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, routeTableName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all routes in a route table. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all routes in a route table. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String routeTableName) { - return new PagedIterable<>(listAsync(resourceGroupName, routeTableName)); - } - - /** - * Gets all routes in a route table. - * - * @param resourceGroupName The name of the resource group. - * @param routeTableName The name of the route table. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all routes in a route table. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String routeTableName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, routeTableName, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the ListRoute API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the ListRoute API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/SecurityGroupViewImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/SecurityGroupViewImpl.java deleted file mode 100644 index c8fdfa1dec6d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/SecurityGroupViewImpl.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.resourcemanager.network.models.NetworkWatcher; -import com.azure.resourcemanager.network.models.SecurityGroupNetworkInterface; -import com.azure.resourcemanager.network.models.SecurityGroupView; -import com.azure.resourcemanager.network.fluent.models.SecurityGroupViewResultInner; -import com.azure.resourcemanager.network.models.SecurityGroupViewParameters; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.RefreshableWrapperImpl; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.TreeMap; -import reactor.core.publisher.Mono; - -/** The implementation of SecurityGroupView. */ -class SecurityGroupViewImpl extends RefreshableWrapperImpl - implements SecurityGroupView { - private Map networkInterfaces; - private final NetworkWatcherImpl parent; - private final String vmId; - - SecurityGroupViewImpl(NetworkWatcherImpl parent, SecurityGroupViewResultInner innerObject, String vmId) { - super(innerObject); - this.parent = parent; - this.vmId = vmId; - initializeFromInner(); - } - - private void initializeFromInner() { - this.networkInterfaces = new TreeMap<>(); - List securityGroupNetworkInterfaces = this.innerModel().networkInterfaces(); - if (securityGroupNetworkInterfaces != null) { - for (SecurityGroupNetworkInterface networkInterface : securityGroupNetworkInterfaces) { - this.networkInterfaces.put(networkInterface.id(), networkInterface); - } - } - } - - @Override - public Map networkInterfaces() { - return Collections.unmodifiableMap(this.networkInterfaces); - } - - @Override - public String vmId() { - return vmId; - } - - @Override - public NetworkWatcher parent() { - return parent; - } - - @Override - public Mono refreshAsync() { - return super - .refreshAsync() - .map( - securityGroupView -> { - SecurityGroupViewImpl impl = (SecurityGroupViewImpl) securityGroupView; - impl.initializeFromInner(); - return impl; - }); - } - - @Override - protected Mono getInnerAsync() { - return this - .parent() - .manager() - .serviceClient() - .getNetworkWatchers() - .getVMSecurityRulesAsync(parent.resourceGroupName(), parent.name(), - new SecurityGroupViewParameters().withTargetResourceId(vmId)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/SecurityRulesClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/SecurityRulesClientImpl.java deleted file mode 100644 index 9da358c48551..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/SecurityRulesClientImpl.java +++ /dev/null @@ -1,1173 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.SecurityRulesClient; -import com.azure.resourcemanager.network.fluent.models.SecurityRuleInner; -import com.azure.resourcemanager.network.models.SecurityRuleListResult; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in SecurityRulesClient. */ -public final class SecurityRulesClientImpl implements SecurityRulesClient { - private final ClientLogger logger = new ClientLogger(SecurityRulesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final SecurityRulesService service; - - /** The service client containing this operation class. */ - private final NetworkManagementClientImpl client; - - /** - * Initializes an instance of SecurityRulesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - SecurityRulesClientImpl(NetworkManagementClientImpl client) { - this.service = - RestProxy.create(SecurityRulesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for NetworkManagementClientSecurityRules to be used by the proxy service - * to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "NetworkManagementCli") - private interface SecurityRulesService { - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("networkSecurityGroupName") String networkSecurityGroupName, - @PathParam("securityRuleName") String securityRuleName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("networkSecurityGroupName") String networkSecurityGroupName, - @PathParam("securityRuleName") String securityRuleName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("networkSecurityGroupName") String networkSecurityGroupName, - @PathParam("securityRuleName") String securityRuleName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") SecurityRuleInner securityRuleParameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/networkSecurityGroups/{networkSecurityGroupName}/securityRules") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("networkSecurityGroupName") String networkSecurityGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Deletes the specified network security rule. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param securityRuleName The name of the security rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync( - String resourceGroupName, String networkSecurityGroupName, String securityRuleName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkSecurityGroupName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null.")); - } - if (securityRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - networkSecurityGroupName, - securityRuleName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the specified network security rule. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param securityRuleName The name of the security rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String networkSecurityGroupName, String securityRuleName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkSecurityGroupName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null.")); - } - if (securityRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - networkSecurityGroupName, - securityRuleName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Deletes the specified network security rule. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param securityRuleName The name of the security rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String networkSecurityGroupName, String securityRuleName) { - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deletes the specified network security rule. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param securityRuleName The name of the security rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String networkSecurityGroupName, String securityRuleName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes the specified network security rule. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param securityRuleName The name of the security rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String networkSecurityGroupName, String securityRuleName) { - return beginDeleteAsync(resourceGroupName, networkSecurityGroupName, securityRuleName).getSyncPoller(); - } - - /** - * Deletes the specified network security rule. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param securityRuleName The name of the security rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String networkSecurityGroupName, String securityRuleName, Context context) { - return beginDeleteAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, context).getSyncPoller(); - } - - /** - * Deletes the specified network security rule. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param securityRuleName The name of the security rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName) { - return beginDeleteAsync(resourceGroupName, networkSecurityGroupName, securityRuleName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified network security rule. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param securityRuleName The name of the security rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync( - String resourceGroupName, String networkSecurityGroupName, String securityRuleName, Context context) { - return beginDeleteAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified network security rule. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param securityRuleName The name of the security rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String networkSecurityGroupName, String securityRuleName) { - deleteAsync(resourceGroupName, networkSecurityGroupName, securityRuleName).block(); - } - - /** - * Deletes the specified network security rule. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param securityRuleName The name of the security rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete( - String resourceGroupName, String networkSecurityGroupName, String securityRuleName, Context context) { - deleteAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, context).block(); - } - - /** - * Get the specified network security rule. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param securityRuleName The name of the security rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network security rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String resourceGroupName, String networkSecurityGroupName, String securityRuleName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkSecurityGroupName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null.")); - } - if (securityRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - resourceGroupName, - networkSecurityGroupName, - securityRuleName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the specified network security rule. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param securityRuleName The name of the security rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network security rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String networkSecurityGroupName, String securityRuleName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkSecurityGroupName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null.")); - } - if (securityRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - resourceGroupName, - networkSecurityGroupName, - securityRuleName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Get the specified network security rule. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param securityRuleName The name of the security rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network security rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync( - String resourceGroupName, String networkSecurityGroupName, String securityRuleName) { - return getWithResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get the specified network security rule. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param securityRuleName The name of the security rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network security rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SecurityRuleInner get(String resourceGroupName, String networkSecurityGroupName, String securityRuleName) { - return getAsync(resourceGroupName, networkSecurityGroupName, securityRuleName).block(); - } - - /** - * Get the specified network security rule. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param securityRuleName The name of the security rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified network security rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String networkSecurityGroupName, String securityRuleName, Context context) { - return getWithResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, context).block(); - } - - /** - * Creates or updates a security rule in the specified network security group. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param securityRuleName The name of the security rule. - * @param securityRuleParameters Parameters supplied to the create or update network security rule operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return network security rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String networkSecurityGroupName, - String securityRuleName, - SecurityRuleInner securityRuleParameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkSecurityGroupName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null.")); - } - if (securityRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (securityRuleParameters == null) { - return Mono - .error( - new IllegalArgumentException("Parameter securityRuleParameters is required and cannot be null.")); - } else { - securityRuleParameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - networkSecurityGroupName, - securityRuleName, - apiVersion, - this.client.getSubscriptionId(), - securityRuleParameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a security rule in the specified network security group. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param securityRuleName The name of the security rule. - * @param securityRuleParameters Parameters supplied to the create or update network security rule operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return network security rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String networkSecurityGroupName, - String securityRuleName, - SecurityRuleInner securityRuleParameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkSecurityGroupName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null.")); - } - if (securityRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (securityRuleParameters == null) { - return Mono - .error( - new IllegalArgumentException("Parameter securityRuleParameters is required and cannot be null.")); - } else { - securityRuleParameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - networkSecurityGroupName, - securityRuleName, - apiVersion, - this.client.getSubscriptionId(), - securityRuleParameters, - accept, - context); - } - - /** - * Creates or updates a security rule in the specified network security group. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param securityRuleName The name of the security rule. - * @param securityRuleParameters Parameters supplied to the create or update network security rule operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return network security rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, SecurityRuleInner> beginCreateOrUpdateAsync( - String resourceGroupName, - String networkSecurityGroupName, - String securityRuleName, - SecurityRuleInner securityRuleParameters) { - Mono>> mono = - createOrUpdateWithResponseAsync( - resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - SecurityRuleInner.class, - SecurityRuleInner.class, - this.client.getContext()); - } - - /** - * Creates or updates a security rule in the specified network security group. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param securityRuleName The name of the security rule. - * @param securityRuleParameters Parameters supplied to the create or update network security rule operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return network security rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, SecurityRuleInner> beginCreateOrUpdateAsync( - String resourceGroupName, - String networkSecurityGroupName, - String securityRuleName, - SecurityRuleInner securityRuleParameters, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync( - resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), SecurityRuleInner.class, SecurityRuleInner.class, context); - } - - /** - * Creates or updates a security rule in the specified network security group. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param securityRuleName The name of the security rule. - * @param securityRuleParameters Parameters supplied to the create or update network security rule operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return network security rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, SecurityRuleInner> beginCreateOrUpdate( - String resourceGroupName, - String networkSecurityGroupName, - String securityRuleName, - SecurityRuleInner securityRuleParameters) { - return beginCreateOrUpdateAsync( - resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters) - .getSyncPoller(); - } - - /** - * Creates or updates a security rule in the specified network security group. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param securityRuleName The name of the security rule. - * @param securityRuleParameters Parameters supplied to the create or update network security rule operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return network security rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, SecurityRuleInner> beginCreateOrUpdate( - String resourceGroupName, - String networkSecurityGroupName, - String securityRuleName, - SecurityRuleInner securityRuleParameters, - Context context) { - return beginCreateOrUpdateAsync( - resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters, context) - .getSyncPoller(); - } - - /** - * Creates or updates a security rule in the specified network security group. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param securityRuleName The name of the security rule. - * @param securityRuleParameters Parameters supplied to the create or update network security rule operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return network security rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, - String networkSecurityGroupName, - String securityRuleName, - SecurityRuleInner securityRuleParameters) { - return beginCreateOrUpdateAsync( - resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a security rule in the specified network security group. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param securityRuleName The name of the security rule. - * @param securityRuleParameters Parameters supplied to the create or update network security rule operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return network security rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, - String networkSecurityGroupName, - String securityRuleName, - SecurityRuleInner securityRuleParameters, - Context context) { - return beginCreateOrUpdateAsync( - resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a security rule in the specified network security group. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param securityRuleName The name of the security rule. - * @param securityRuleParameters Parameters supplied to the create or update network security rule operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return network security rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SecurityRuleInner createOrUpdate( - String resourceGroupName, - String networkSecurityGroupName, - String securityRuleName, - SecurityRuleInner securityRuleParameters) { - return createOrUpdateAsync( - resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters) - .block(); - } - - /** - * Creates or updates a security rule in the specified network security group. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param securityRuleName The name of the security rule. - * @param securityRuleParameters Parameters supplied to the create or update network security rule operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return network security rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SecurityRuleInner createOrUpdate( - String resourceGroupName, - String networkSecurityGroupName, - String securityRuleName, - SecurityRuleInner securityRuleParameters, - Context context) { - return createOrUpdateAsync( - resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters, context) - .block(); - } - - /** - * Gets all security rules in a network security group. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all security rules in a network security group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String networkSecurityGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkSecurityGroupName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - resourceGroupName, - networkSecurityGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all security rules in a network security group. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all security rules in a network security group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String networkSecurityGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (networkSecurityGroupName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - resourceGroupName, - networkSecurityGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all security rules in a network security group. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all security rules in a network security group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String resourceGroupName, String networkSecurityGroupName) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, networkSecurityGroupName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets all security rules in a network security group. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all security rules in a network security group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String networkSecurityGroupName, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, networkSecurityGroupName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all security rules in a network security group. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all security rules in a network security group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String networkSecurityGroupName) { - return new PagedIterable<>(listAsync(resourceGroupName, networkSecurityGroupName)); - } - - /** - * Gets all security rules in a network security group. - * - * @param resourceGroupName The name of the resource group. - * @param networkSecurityGroupName The name of the network security group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all security rules in a network security group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, String networkSecurityGroupName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, networkSecurityGroupName, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListSecurityRule API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListSecurityRule API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ServiceEndpointPoliciesClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ServiceEndpointPoliciesClientImpl.java deleted file mode 100644 index 5330ba2fd0b5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ServiceEndpointPoliciesClientImpl.java +++ /dev/null @@ -1,1630 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.ServiceEndpointPoliciesClient; -import com.azure.resourcemanager.network.fluent.models.ServiceEndpointPolicyInner; -import com.azure.resourcemanager.network.models.ServiceEndpointPolicyListResult; -import com.azure.resourcemanager.network.models.TagsObject; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ServiceEndpointPoliciesClient. */ -public final class ServiceEndpointPoliciesClientImpl - implements InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete, - ServiceEndpointPoliciesClient { - private final ClientLogger logger = new ClientLogger(ServiceEndpointPoliciesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final ServiceEndpointPoliciesService service; - - /** The service client containing this operation class. */ - private final NetworkManagementClientImpl client; - - /** - * Initializes an instance of ServiceEndpointPoliciesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ServiceEndpointPoliciesClientImpl(NetworkManagementClientImpl client) { - this.service = - RestProxy - .create(ServiceEndpointPoliciesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for NetworkManagementClientServiceEndpointPolicies to be used by the - * proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "NetworkManagementCli") - private interface ServiceEndpointPoliciesService { - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/serviceEndpointPolicies/{serviceEndpointPolicyName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("serviceEndpointPolicyName") String serviceEndpointPolicyName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/serviceEndpointPolicies/{serviceEndpointPolicyName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("serviceEndpointPolicyName") String serviceEndpointPolicyName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("$expand") String expand, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/serviceEndpointPolicies/{serviceEndpointPolicyName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("serviceEndpointPolicyName") String serviceEndpointPolicyName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") ServiceEndpointPolicyInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/serviceEndpointPolicies/{serviceEndpointPolicyName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("serviceEndpointPolicyName") String serviceEndpointPolicyName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") TagsObject parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/ServiceEndpointPolicies") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/serviceEndpointPolicies") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Deletes the specified service endpoint policy. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync( - String resourceGroupName, String serviceEndpointPolicyName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serviceEndpointPolicyName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter serviceEndpointPolicyName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - serviceEndpointPolicyName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the specified service endpoint policy. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String serviceEndpointPolicyName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serviceEndpointPolicyName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter serviceEndpointPolicyName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - serviceEndpointPolicyName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Deletes the specified service endpoint policy. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String serviceEndpointPolicyName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, serviceEndpointPolicyName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deletes the specified service endpoint policy. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String serviceEndpointPolicyName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, serviceEndpointPolicyName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes the specified service endpoint policy. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete(String resourceGroupName, String serviceEndpointPolicyName) { - return beginDeleteAsync(resourceGroupName, serviceEndpointPolicyName).getSyncPoller(); - } - - /** - * Deletes the specified service endpoint policy. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String serviceEndpointPolicyName, Context context) { - return beginDeleteAsync(resourceGroupName, serviceEndpointPolicyName, context).getSyncPoller(); - } - - /** - * Deletes the specified service endpoint policy. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String serviceEndpointPolicyName) { - return beginDeleteAsync(resourceGroupName, serviceEndpointPolicyName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified service endpoint policy. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String serviceEndpointPolicyName, Context context) { - return beginDeleteAsync(resourceGroupName, serviceEndpointPolicyName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified service endpoint policy. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String serviceEndpointPolicyName) { - deleteAsync(resourceGroupName, serviceEndpointPolicyName).block(); - } - - /** - * Deletes the specified service endpoint policy. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String serviceEndpointPolicyName, Context context) { - deleteAsync(resourceGroupName, serviceEndpointPolicyName, context).block(); - } - - /** - * Gets the specified service Endpoint Policies in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy. - * @param expand Expands referenced resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified service Endpoint Policies in a specified resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String serviceEndpointPolicyName, String expand) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serviceEndpointPolicyName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter serviceEndpointPolicyName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - serviceEndpointPolicyName, - apiVersion, - this.client.getSubscriptionId(), - expand, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the specified service Endpoint Policies in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy. - * @param expand Expands referenced resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified service Endpoint Policies in a specified resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String serviceEndpointPolicyName, String expand, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serviceEndpointPolicyName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter serviceEndpointPolicyName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - serviceEndpointPolicyName, - apiVersion, - this.client.getSubscriptionId(), - expand, - accept, - context); - } - - /** - * Gets the specified service Endpoint Policies in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy. - * @param expand Expands referenced resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified service Endpoint Policies in a specified resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync( - String resourceGroupName, String serviceEndpointPolicyName, String expand) { - return getByResourceGroupWithResponseAsync(resourceGroupName, serviceEndpointPolicyName, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the specified service Endpoint Policies in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified service Endpoint Policies in a specified resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync( - String resourceGroupName, String serviceEndpointPolicyName) { - final String expand = null; - return getByResourceGroupWithResponseAsync(resourceGroupName, serviceEndpointPolicyName, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the specified service Endpoint Policies in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified service Endpoint Policies in a specified resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ServiceEndpointPolicyInner getByResourceGroup(String resourceGroupName, String serviceEndpointPolicyName) { - final String expand = null; - return getByResourceGroupAsync(resourceGroupName, serviceEndpointPolicyName, expand).block(); - } - - /** - * Gets the specified service Endpoint Policies in a specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy. - * @param expand Expands referenced resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified service Endpoint Policies in a specified resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String serviceEndpointPolicyName, String expand, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, serviceEndpointPolicyName, expand, context) - .block(); - } - - /** - * Creates or updates a service Endpoint Policies. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy. - * @param parameters Parameters supplied to the create or update service endpoint policy operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service End point policy resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String serviceEndpointPolicyName, ServiceEndpointPolicyInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serviceEndpointPolicyName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter serviceEndpointPolicyName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - serviceEndpointPolicyName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a service Endpoint Policies. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy. - * @param parameters Parameters supplied to the create or update service endpoint policy operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service End point policy resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String serviceEndpointPolicyName, - ServiceEndpointPolicyInner parameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serviceEndpointPolicyName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter serviceEndpointPolicyName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - serviceEndpointPolicyName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Creates or updates a service Endpoint Policies. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy. - * @param parameters Parameters supplied to the create or update service endpoint policy operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service End point policy resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, ServiceEndpointPolicyInner> beginCreateOrUpdateAsync( - String resourceGroupName, String serviceEndpointPolicyName, ServiceEndpointPolicyInner parameters) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, serviceEndpointPolicyName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ServiceEndpointPolicyInner.class, - ServiceEndpointPolicyInner.class, - Context.NONE); - } - - /** - * Creates or updates a service Endpoint Policies. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy. - * @param parameters Parameters supplied to the create or update service endpoint policy operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service End point policy resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, ServiceEndpointPolicyInner> beginCreateOrUpdateAsync( - String resourceGroupName, - String serviceEndpointPolicyName, - ServiceEndpointPolicyInner parameters, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, serviceEndpointPolicyName, parameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ServiceEndpointPolicyInner.class, - ServiceEndpointPolicyInner.class, - context); - } - - /** - * Creates or updates a service Endpoint Policies. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy. - * @param parameters Parameters supplied to the create or update service endpoint policy operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service End point policy resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, ServiceEndpointPolicyInner> beginCreateOrUpdate( - String resourceGroupName, String serviceEndpointPolicyName, ServiceEndpointPolicyInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, serviceEndpointPolicyName, parameters).getSyncPoller(); - } - - /** - * Creates or updates a service Endpoint Policies. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy. - * @param parameters Parameters supplied to the create or update service endpoint policy operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service End point policy resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, ServiceEndpointPolicyInner> beginCreateOrUpdate( - String resourceGroupName, - String serviceEndpointPolicyName, - ServiceEndpointPolicyInner parameters, - Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, serviceEndpointPolicyName, parameters, context) - .getSyncPoller(); - } - - /** - * Creates or updates a service Endpoint Policies. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy. - * @param parameters Parameters supplied to the create or update service endpoint policy operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service End point policy resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, String serviceEndpointPolicyName, ServiceEndpointPolicyInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, serviceEndpointPolicyName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a service Endpoint Policies. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy. - * @param parameters Parameters supplied to the create or update service endpoint policy operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service End point policy resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, - String serviceEndpointPolicyName, - ServiceEndpointPolicyInner parameters, - Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, serviceEndpointPolicyName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a service Endpoint Policies. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy. - * @param parameters Parameters supplied to the create or update service endpoint policy operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service End point policy resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ServiceEndpointPolicyInner createOrUpdate( - String resourceGroupName, String serviceEndpointPolicyName, ServiceEndpointPolicyInner parameters) { - return createOrUpdateAsync(resourceGroupName, serviceEndpointPolicyName, parameters).block(); - } - - /** - * Creates or updates a service Endpoint Policies. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy. - * @param parameters Parameters supplied to the create or update service endpoint policy operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service End point policy resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ServiceEndpointPolicyInner createOrUpdate( - String resourceGroupName, - String serviceEndpointPolicyName, - ServiceEndpointPolicyInner parameters, - Context context) { - return createOrUpdateAsync(resourceGroupName, serviceEndpointPolicyName, parameters, context).block(); - } - - /** - * Updates service Endpoint Policies. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy. - * @param parameters Parameters supplied to update service endpoint policy tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service End point policy resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateWithResponseAsync( - String resourceGroupName, String serviceEndpointPolicyName, TagsObject parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serviceEndpointPolicyName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter serviceEndpointPolicyName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - resourceGroupName, - serviceEndpointPolicyName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates service Endpoint Policies. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy. - * @param parameters Parameters supplied to update service endpoint policy tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service End point policy resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, String serviceEndpointPolicyName, TagsObject parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serviceEndpointPolicyName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter serviceEndpointPolicyName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - resourceGroupName, - serviceEndpointPolicyName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Updates service Endpoint Policies. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy. - * @param parameters Parameters supplied to update service endpoint policy tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service End point policy resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, ServiceEndpointPolicyInner> beginUpdateAsync( - String resourceGroupName, String serviceEndpointPolicyName, TagsObject parameters) { - Mono>> mono = - updateWithResponseAsync(resourceGroupName, serviceEndpointPolicyName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ServiceEndpointPolicyInner.class, - ServiceEndpointPolicyInner.class, - Context.NONE); - } - - /** - * Updates service Endpoint Policies. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy. - * @param parameters Parameters supplied to update service endpoint policy tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service End point policy resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, ServiceEndpointPolicyInner> beginUpdateAsync( - String resourceGroupName, String serviceEndpointPolicyName, TagsObject parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - updateWithResponseAsync(resourceGroupName, serviceEndpointPolicyName, parameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ServiceEndpointPolicyInner.class, - ServiceEndpointPolicyInner.class, - context); - } - - /** - * Updates service Endpoint Policies. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy. - * @param parameters Parameters supplied to update service endpoint policy tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service End point policy resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, ServiceEndpointPolicyInner> beginUpdate( - String resourceGroupName, String serviceEndpointPolicyName, TagsObject parameters) { - return beginUpdateAsync(resourceGroupName, serviceEndpointPolicyName, parameters).getSyncPoller(); - } - - /** - * Updates service Endpoint Policies. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy. - * @param parameters Parameters supplied to update service endpoint policy tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service End point policy resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, ServiceEndpointPolicyInner> beginUpdate( - String resourceGroupName, String serviceEndpointPolicyName, TagsObject parameters, Context context) { - return beginUpdateAsync(resourceGroupName, serviceEndpointPolicyName, parameters, context).getSyncPoller(); - } - - /** - * Updates service Endpoint Policies. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy. - * @param parameters Parameters supplied to update service endpoint policy tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service End point policy resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync( - String resourceGroupName, String serviceEndpointPolicyName, TagsObject parameters) { - return beginUpdateAsync(resourceGroupName, serviceEndpointPolicyName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates service Endpoint Policies. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy. - * @param parameters Parameters supplied to update service endpoint policy tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service End point policy resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, String serviceEndpointPolicyName, TagsObject parameters, Context context) { - return beginUpdateAsync(resourceGroupName, serviceEndpointPolicyName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates service Endpoint Policies. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy. - * @param parameters Parameters supplied to update service endpoint policy tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service End point policy resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ServiceEndpointPolicyInner update( - String resourceGroupName, String serviceEndpointPolicyName, TagsObject parameters) { - return updateAsync(resourceGroupName, serviceEndpointPolicyName, parameters).block(); - } - - /** - * Updates service Endpoint Policies. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy. - * @param parameters Parameters supplied to update service endpoint policy tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service End point policy resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ServiceEndpointPolicyInner update( - String resourceGroupName, String serviceEndpointPolicyName, TagsObject parameters, Context context) { - return updateAsync(resourceGroupName, serviceEndpointPolicyName, parameters, context).block(); - } - - /** - * Gets all the service endpoint policies in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the service endpoint policies in a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all the service endpoint policies in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the service endpoint policies in a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all the service endpoint policies in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the service endpoint policies in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets all the service endpoint policies in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the service endpoint policies in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all the service endpoint policies in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the service endpoint policies in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Gets all the service endpoint policies in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the service endpoint policies in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Gets all service endpoint Policies in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all service endpoint Policies in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all service endpoint Policies in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all service endpoint Policies in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all service endpoint Policies in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all service endpoint Policies in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * Gets all service endpoint Policies in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all service endpoint Policies in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all service endpoint Policies in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all service endpoint Policies in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * Gets all service endpoint Policies in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all service endpoint Policies in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListServiceEndpointPolicies API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListServiceEndpointPolicies API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListServiceEndpointPolicies API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListServiceEndpointPolicies API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ServiceEndpointPolicyDefinitionsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ServiceEndpointPolicyDefinitionsClientImpl.java deleted file mode 100644 index 7c9b551e6889..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ServiceEndpointPolicyDefinitionsClientImpl.java +++ /dev/null @@ -1,1286 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.ServiceEndpointPolicyDefinitionsClient; -import com.azure.resourcemanager.network.fluent.models.ServiceEndpointPolicyDefinitionInner; -import com.azure.resourcemanager.network.models.ServiceEndpointPolicyDefinitionListResult; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in ServiceEndpointPolicyDefinitionsClient. - */ -public final class ServiceEndpointPolicyDefinitionsClientImpl implements ServiceEndpointPolicyDefinitionsClient { - private final ClientLogger logger = new ClientLogger(ServiceEndpointPolicyDefinitionsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final ServiceEndpointPolicyDefinitionsService service; - - /** The service client containing this operation class. */ - private final NetworkManagementClientImpl client; - - /** - * Initializes an instance of ServiceEndpointPolicyDefinitionsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ServiceEndpointPolicyDefinitionsClientImpl(NetworkManagementClientImpl client) { - this.service = - RestProxy - .create( - ServiceEndpointPolicyDefinitionsService.class, - client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for NetworkManagementClientServiceEndpointPolicyDefinitions to be used by - * the proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "NetworkManagementCli") - private interface ServiceEndpointPolicyDefinitionsService { - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions" - + "/{serviceEndpointPolicyDefinitionName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("serviceEndpointPolicyName") String serviceEndpointPolicyName, - @PathParam("serviceEndpointPolicyDefinitionName") String serviceEndpointPolicyDefinitionName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions" - + "/{serviceEndpointPolicyDefinitionName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("serviceEndpointPolicyName") String serviceEndpointPolicyName, - @PathParam("serviceEndpointPolicyDefinitionName") String serviceEndpointPolicyDefinitionName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions" - + "/{serviceEndpointPolicyDefinitionName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("serviceEndpointPolicyName") String serviceEndpointPolicyName, - @PathParam("serviceEndpointPolicyDefinitionName") String serviceEndpointPolicyDefinitionName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") ServiceEndpointPolicyDefinitionInner serviceEndpointPolicyDefinitions, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("serviceEndpointPolicyName") String serviceEndpointPolicyName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Deletes the specified ServiceEndpoint policy definitions. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the Service Endpoint Policy. - * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync( - String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serviceEndpointPolicyName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter serviceEndpointPolicyName is required and cannot be null.")); - } - if (serviceEndpointPolicyDefinitionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter serviceEndpointPolicyDefinitionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - serviceEndpointPolicyName, - serviceEndpointPolicyDefinitionName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the specified ServiceEndpoint policy definitions. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the Service Endpoint Policy. - * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, - String serviceEndpointPolicyName, - String serviceEndpointPolicyDefinitionName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serviceEndpointPolicyName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter serviceEndpointPolicyName is required and cannot be null.")); - } - if (serviceEndpointPolicyDefinitionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter serviceEndpointPolicyDefinitionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - serviceEndpointPolicyName, - serviceEndpointPolicyDefinitionName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Deletes the specified ServiceEndpoint policy definitions. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the Service Endpoint Policy. - * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName) { - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deletes the specified ServiceEndpoint policy definitions. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the Service Endpoint Policy. - * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, - String serviceEndpointPolicyName, - String serviceEndpointPolicyDefinitionName, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync( - resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes the specified ServiceEndpoint policy definitions. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the Service Endpoint Policy. - * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName) { - return beginDeleteAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName) - .getSyncPoller(); - } - - /** - * Deletes the specified ServiceEndpoint policy definitions. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the Service Endpoint Policy. - * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, - String serviceEndpointPolicyName, - String serviceEndpointPolicyDefinitionName, - Context context) { - return beginDeleteAsync( - resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, context) - .getSyncPoller(); - } - - /** - * Deletes the specified ServiceEndpoint policy definitions. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the Service Endpoint Policy. - * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync( - String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName) { - return beginDeleteAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified ServiceEndpoint policy definitions. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the Service Endpoint Policy. - * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync( - String resourceGroupName, - String serviceEndpointPolicyName, - String serviceEndpointPolicyDefinitionName, - Context context) { - return beginDeleteAsync( - resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified ServiceEndpoint policy definitions. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the Service Endpoint Policy. - * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete( - String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName) { - deleteAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName).block(); - } - - /** - * Deletes the specified ServiceEndpoint policy definitions. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the Service Endpoint Policy. - * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete( - String resourceGroupName, - String serviceEndpointPolicyName, - String serviceEndpointPolicyDefinitionName, - Context context) { - deleteAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, context).block(); - } - - /** - * Get the specified service endpoint policy definitions from service endpoint policy. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy name. - * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified service endpoint policy definitions from service endpoint policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serviceEndpointPolicyName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter serviceEndpointPolicyName is required and cannot be null.")); - } - if (serviceEndpointPolicyDefinitionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter serviceEndpointPolicyDefinitionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - resourceGroupName, - serviceEndpointPolicyName, - serviceEndpointPolicyDefinitionName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the specified service endpoint policy definitions from service endpoint policy. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy name. - * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified service endpoint policy definitions from service endpoint policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, - String serviceEndpointPolicyName, - String serviceEndpointPolicyDefinitionName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serviceEndpointPolicyName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter serviceEndpointPolicyName is required and cannot be null.")); - } - if (serviceEndpointPolicyDefinitionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter serviceEndpointPolicyDefinitionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - resourceGroupName, - serviceEndpointPolicyName, - serviceEndpointPolicyDefinitionName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Get the specified service endpoint policy definitions from service endpoint policy. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy name. - * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified service endpoint policy definitions from service endpoint policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync( - String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName) { - return getWithResponseAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get the specified service endpoint policy definitions from service endpoint policy. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy name. - * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified service endpoint policy definitions from service endpoint policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ServiceEndpointPolicyDefinitionInner get( - String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName) { - return getAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName).block(); - } - - /** - * Get the specified service endpoint policy definitions from service endpoint policy. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy name. - * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified service endpoint policy definitions from service endpoint policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, - String serviceEndpointPolicyName, - String serviceEndpointPolicyDefinitionName, - Context context) { - return getWithResponseAsync( - resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, context) - .block(); - } - - /** - * Creates or updates a service endpoint policy definition in the specified service endpoint policy. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy. - * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition name. - * @param serviceEndpointPolicyDefinitions Parameters supplied to the create or update service endpoint policy - * operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service Endpoint policy definitions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String serviceEndpointPolicyName, - String serviceEndpointPolicyDefinitionName, - ServiceEndpointPolicyDefinitionInner serviceEndpointPolicyDefinitions) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serviceEndpointPolicyName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter serviceEndpointPolicyName is required and cannot be null.")); - } - if (serviceEndpointPolicyDefinitionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter serviceEndpointPolicyDefinitionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (serviceEndpointPolicyDefinitions == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter serviceEndpointPolicyDefinitions is required and cannot be null.")); - } else { - serviceEndpointPolicyDefinitions.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - serviceEndpointPolicyName, - serviceEndpointPolicyDefinitionName, - apiVersion, - this.client.getSubscriptionId(), - serviceEndpointPolicyDefinitions, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a service endpoint policy definition in the specified service endpoint policy. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy. - * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition name. - * @param serviceEndpointPolicyDefinitions Parameters supplied to the create or update service endpoint policy - * operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service Endpoint policy definitions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String serviceEndpointPolicyName, - String serviceEndpointPolicyDefinitionName, - ServiceEndpointPolicyDefinitionInner serviceEndpointPolicyDefinitions, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serviceEndpointPolicyName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter serviceEndpointPolicyName is required and cannot be null.")); - } - if (serviceEndpointPolicyDefinitionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter serviceEndpointPolicyDefinitionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (serviceEndpointPolicyDefinitions == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter serviceEndpointPolicyDefinitions is required and cannot be null.")); - } else { - serviceEndpointPolicyDefinitions.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - serviceEndpointPolicyName, - serviceEndpointPolicyDefinitionName, - apiVersion, - this.client.getSubscriptionId(), - serviceEndpointPolicyDefinitions, - accept, - context); - } - - /** - * Creates or updates a service endpoint policy definition in the specified service endpoint policy. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy. - * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition name. - * @param serviceEndpointPolicyDefinitions Parameters supplied to the create or update service endpoint policy - * operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service Endpoint policy definitions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, ServiceEndpointPolicyDefinitionInner> - beginCreateOrUpdateAsync( - String resourceGroupName, - String serviceEndpointPolicyName, - String serviceEndpointPolicyDefinitionName, - ServiceEndpointPolicyDefinitionInner serviceEndpointPolicyDefinitions) { - Mono>> mono = - createOrUpdateWithResponseAsync( - resourceGroupName, - serviceEndpointPolicyName, - serviceEndpointPolicyDefinitionName, - serviceEndpointPolicyDefinitions); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ServiceEndpointPolicyDefinitionInner.class, - ServiceEndpointPolicyDefinitionInner.class, - Context.NONE); - } - - /** - * Creates or updates a service endpoint policy definition in the specified service endpoint policy. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy. - * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition name. - * @param serviceEndpointPolicyDefinitions Parameters supplied to the create or update service endpoint policy - * operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service Endpoint policy definitions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, ServiceEndpointPolicyDefinitionInner> - beginCreateOrUpdateAsync( - String resourceGroupName, - String serviceEndpointPolicyName, - String serviceEndpointPolicyDefinitionName, - ServiceEndpointPolicyDefinitionInner serviceEndpointPolicyDefinitions, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync( - resourceGroupName, - serviceEndpointPolicyName, - serviceEndpointPolicyDefinitionName, - serviceEndpointPolicyDefinitions, - context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ServiceEndpointPolicyDefinitionInner.class, - ServiceEndpointPolicyDefinitionInner.class, - context); - } - - /** - * Creates or updates a service endpoint policy definition in the specified service endpoint policy. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy. - * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition name. - * @param serviceEndpointPolicyDefinitions Parameters supplied to the create or update service endpoint policy - * operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service Endpoint policy definitions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, ServiceEndpointPolicyDefinitionInner> - beginCreateOrUpdate( - String resourceGroupName, - String serviceEndpointPolicyName, - String serviceEndpointPolicyDefinitionName, - ServiceEndpointPolicyDefinitionInner serviceEndpointPolicyDefinitions) { - return beginCreateOrUpdateAsync( - resourceGroupName, - serviceEndpointPolicyName, - serviceEndpointPolicyDefinitionName, - serviceEndpointPolicyDefinitions) - .getSyncPoller(); - } - - /** - * Creates or updates a service endpoint policy definition in the specified service endpoint policy. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy. - * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition name. - * @param serviceEndpointPolicyDefinitions Parameters supplied to the create or update service endpoint policy - * operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service Endpoint policy definitions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, ServiceEndpointPolicyDefinitionInner> - beginCreateOrUpdate( - String resourceGroupName, - String serviceEndpointPolicyName, - String serviceEndpointPolicyDefinitionName, - ServiceEndpointPolicyDefinitionInner serviceEndpointPolicyDefinitions, - Context context) { - return beginCreateOrUpdateAsync( - resourceGroupName, - serviceEndpointPolicyName, - serviceEndpointPolicyDefinitionName, - serviceEndpointPolicyDefinitions, - context) - .getSyncPoller(); - } - - /** - * Creates or updates a service endpoint policy definition in the specified service endpoint policy. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy. - * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition name. - * @param serviceEndpointPolicyDefinitions Parameters supplied to the create or update service endpoint policy - * operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service Endpoint policy definitions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, - String serviceEndpointPolicyName, - String serviceEndpointPolicyDefinitionName, - ServiceEndpointPolicyDefinitionInner serviceEndpointPolicyDefinitions) { - return beginCreateOrUpdateAsync( - resourceGroupName, - serviceEndpointPolicyName, - serviceEndpointPolicyDefinitionName, - serviceEndpointPolicyDefinitions) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a service endpoint policy definition in the specified service endpoint policy. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy. - * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition name. - * @param serviceEndpointPolicyDefinitions Parameters supplied to the create or update service endpoint policy - * operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service Endpoint policy definitions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, - String serviceEndpointPolicyName, - String serviceEndpointPolicyDefinitionName, - ServiceEndpointPolicyDefinitionInner serviceEndpointPolicyDefinitions, - Context context) { - return beginCreateOrUpdateAsync( - resourceGroupName, - serviceEndpointPolicyName, - serviceEndpointPolicyDefinitionName, - serviceEndpointPolicyDefinitions, - context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a service endpoint policy definition in the specified service endpoint policy. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy. - * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition name. - * @param serviceEndpointPolicyDefinitions Parameters supplied to the create or update service endpoint policy - * operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service Endpoint policy definitions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ServiceEndpointPolicyDefinitionInner createOrUpdate( - String resourceGroupName, - String serviceEndpointPolicyName, - String serviceEndpointPolicyDefinitionName, - ServiceEndpointPolicyDefinitionInner serviceEndpointPolicyDefinitions) { - return createOrUpdateAsync( - resourceGroupName, - serviceEndpointPolicyName, - serviceEndpointPolicyDefinitionName, - serviceEndpointPolicyDefinitions) - .block(); - } - - /** - * Creates or updates a service endpoint policy definition in the specified service endpoint policy. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy. - * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition name. - * @param serviceEndpointPolicyDefinitions Parameters supplied to the create or update service endpoint policy - * operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service Endpoint policy definitions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ServiceEndpointPolicyDefinitionInner createOrUpdate( - String resourceGroupName, - String serviceEndpointPolicyName, - String serviceEndpointPolicyDefinitionName, - ServiceEndpointPolicyDefinitionInner serviceEndpointPolicyDefinitions, - Context context) { - return createOrUpdateAsync( - resourceGroupName, - serviceEndpointPolicyName, - serviceEndpointPolicyDefinitionName, - serviceEndpointPolicyDefinitions, - context) - .block(); - } - - /** - * Gets all service endpoint policy definitions in a service end point policy. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all service endpoint policy definitions in a service end point policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, String serviceEndpointPolicyName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serviceEndpointPolicyName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter serviceEndpointPolicyName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - serviceEndpointPolicyName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all service endpoint policy definitions in a service end point policy. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all service endpoint policy definitions in a service end point policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, String serviceEndpointPolicyName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serviceEndpointPolicyName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter serviceEndpointPolicyName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - serviceEndpointPolicyName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all service endpoint policy definitions in a service end point policy. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all service endpoint policy definitions in a service end point policy. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync( - String resourceGroupName, String serviceEndpointPolicyName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, serviceEndpointPolicyName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * Gets all service endpoint policy definitions in a service end point policy. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all service endpoint policy definitions in a service end point policy. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync( - String resourceGroupName, String serviceEndpointPolicyName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, serviceEndpointPolicyName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all service endpoint policy definitions in a service end point policy. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all service endpoint policy definitions in a service end point policy. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup( - String resourceGroupName, String serviceEndpointPolicyName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, serviceEndpointPolicyName)); - } - - /** - * Gets all service endpoint policy definitions in a service end point policy. - * - * @param resourceGroupName The name of the resource group. - * @param serviceEndpointPolicyName The name of the service endpoint policy name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all service endpoint policy definitions in a service end point policy. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup( - String resourceGroupName, String serviceEndpointPolicyName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, serviceEndpointPolicyName, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListServiceEndpointPolicyDefinition API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync( - String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListServiceEndpointPolicyDefinition API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/SubnetImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/SubnetImpl.java deleted file mode 100644 index 82d9a2429baf..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/SubnetImpl.java +++ /dev/null @@ -1,299 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.resourcemanager.network.models.Delegation; -import com.azure.resourcemanager.network.models.Network; -import com.azure.resourcemanager.network.models.NetworkInterface; -import com.azure.resourcemanager.network.models.NetworkSecurityGroup; -import com.azure.resourcemanager.network.models.NicIpConfiguration; -import com.azure.resourcemanager.network.models.RouteTable; -import com.azure.resourcemanager.network.models.ServiceEndpointPropertiesFormat; -import com.azure.resourcemanager.network.models.ServiceEndpointType; -import com.azure.resourcemanager.network.models.Subnet; -import com.azure.resourcemanager.network.fluent.models.IpAddressAvailabilityResultInner; -import com.azure.resourcemanager.network.fluent.models.IpConfigurationInner; -import com.azure.resourcemanager.network.fluent.models.NetworkSecurityGroupInner; -import com.azure.resourcemanager.network.fluent.models.RouteTableInner; -import com.azure.resourcemanager.network.fluent.models.SubnetInner; -import com.azure.core.management.Region; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils; -import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.ChildResourceImpl; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.Set; -import java.util.TreeMap; -import java.util.TreeSet; - -/** Implementation for Subnet and its create and update interfaces. */ -class SubnetImpl extends ChildResourceImpl - implements Subnet, - Subnet.Definition, - Subnet.UpdateDefinition, - Subnet.Update { - - SubnetImpl(SubnetInner inner, NetworkImpl parent) { - super(inner, parent); - } - - // Getters - @Override - public int networkInterfaceIPConfigurationCount() { - List ipConfigRefs = this.innerModel().ipConfigurations(); - if (ipConfigRefs != null) { - return ipConfigRefs.size(); - } else { - return 0; - } - } - - @Override - public String addressPrefix() { - return this.innerModel().addressPrefix(); - } - - @Override - public String name() { - return this.innerModel().name(); - } - - @Override - public String networkSecurityGroupId() { - return (this.innerModel().networkSecurityGroup() != null) - ? this.innerModel().networkSecurityGroup().id() - : null; - } - - @Override - public String routeTableId() { - return (this.innerModel().routeTable() != null) ? this.innerModel().routeTable().id() : null; - } - - @Override - public Map> servicesWithAccess() { - Map> services = new HashMap<>(); - if (this.innerModel().serviceEndpoints() != null) { - for (ServiceEndpointPropertiesFormat endpoint : this.innerModel().serviceEndpoints()) { - ServiceEndpointType serviceEndpointType = ServiceEndpointType.fromString(endpoint.service()); - if (!services.containsKey(serviceEndpointType)) { - services.put(serviceEndpointType, new ArrayList()); - } - if (endpoint.locations() != null) { - List regions = new ArrayList<>(); - for (String location : endpoint.locations()) { - regions.add(Region.fromName(location)); - } - services.get(serviceEndpointType).addAll(regions); - } - } - } - return services; - } - - @Override - public String id() { - return this.innerModel().id(); - } - - // Fluent setters - - @Override - public SubnetImpl withoutNetworkSecurityGroup() { - this.innerModel().withNetworkSecurityGroup(null); - return this; - } - - @Override - public SubnetImpl withExistingNetworkSecurityGroup(NetworkSecurityGroup nsg) { - return withExistingNetworkSecurityGroup(nsg.id()); - } - - @Override - public SubnetImpl withExistingNetworkSecurityGroup(String resourceId) { - // Workaround for REST API's expectation of an object rather than string ID - should be fixed in Swagger specs - // or REST - NetworkSecurityGroupInner reference = new NetworkSecurityGroupInner().withId(resourceId); - this.innerModel().withNetworkSecurityGroup(reference); - return this; - } - - @Override - public SubnetImpl withExistingRouteTable(String resourceId) { - RouteTableInner reference = new RouteTableInner().withId(resourceId); - this.innerModel().withRouteTable(reference); - return this; - } - - @Override - public SubnetImpl withExistingRouteTable(RouteTable routeTable) { - return this.withExistingRouteTable(routeTable.id()); - } - - @Override - public Update withoutRouteTable() { - this.innerModel().withRouteTable(null); - return this; - } - - @Override - public SubnetImpl withAddressPrefix(String cidr) { - this.innerModel().withAddressPrefix(cidr); - return this; - } - - @Override - public SubnetImpl withAccessFromService(ServiceEndpointType service) { - if (this.innerModel().serviceEndpoints() == null) { - this.innerModel().withServiceEndpoints(new ArrayList()); - } - boolean found = false; - for (ServiceEndpointPropertiesFormat endpoint : this.innerModel().serviceEndpoints()) { - if (endpoint.service().equalsIgnoreCase(service.toString())) { - found = true; - break; - } - } - if (!found) { - this - .innerModel() - .serviceEndpoints() - .add( - new ServiceEndpointPropertiesFormat() - .withService(service.toString()) - .withLocations(new ArrayList())); - } - return this; - } - - @Override - public Update withoutAccessFromService(ServiceEndpointType service) { - if (this.innerModel().serviceEndpoints() != null) { - int foundIndex = -1; - int i = 0; - for (ServiceEndpointPropertiesFormat endpoint : this.innerModel().serviceEndpoints()) { - if (endpoint.service().equalsIgnoreCase(service.toString())) { - foundIndex = i; - break; - } - i++; - } - if (foundIndex != -1) { - this.innerModel().serviceEndpoints().remove(foundIndex); - } - } - return this; - } - - // Verbs - - @Override - public NetworkImpl attach() { - return this.parent().withSubnet(this); - } - - @Override - public RouteTable getRouteTable() { - return (this.routeTableId() != null) - ? this.parent().manager().routeTables().getById(this.routeTableId()) - : null; - } - - @Override - public NetworkSecurityGroup getNetworkSecurityGroup() { - String nsgId = this.networkSecurityGroupId(); - return (nsgId != null) ? this.parent().manager().networkSecurityGroups().getById(nsgId) : null; - } - - @Override - public Collection listNetworkInterfaceIPConfigurations() { - Collection ipConfigs = new ArrayList<>(); - Map nics = new TreeMap<>(); - List ipConfigRefs = this.innerModel().ipConfigurations(); - if (ipConfigRefs == null) { - return ipConfigs; - } - - for (IpConfigurationInner ipConfigRef : ipConfigRefs) { - String nicID = ResourceUtils.parentResourceIdFromResourceId(ipConfigRef.id()); - String ipConfigName = ResourceUtils.nameFromResourceId(ipConfigRef.id()); - // Check if NIC already cached - NetworkInterface nic = nics.get(nicID.toLowerCase(Locale.ROOT)); - if (nic == null) { - // NIC not previously found, so ask Azure for it - nic = this.parent().manager().networkInterfaces().getById(nicID); - } - - if (nic == null) { - // NIC doesn't exist so ignore this bad reference - continue; - } - - // Cache the NIC - nics.put(nic.id().toLowerCase(Locale.ROOT), nic); - - // Get the IP config - NicIpConfiguration ipConfig = nic.ipConfigurations().get(ipConfigName); - if (ipConfig == null) { - // IP config not found, so ignore this bad reference - continue; - } - - ipConfigs.add(ipConfig); - } - - return Collections.unmodifiableCollection(ipConfigs); - } - - @Override - public Set listAvailablePrivateIPAddresses() { - Set ipAddresses = new TreeSet<>(); - - String cidr = this.addressPrefix(); - if (cidr == null) { - return ipAddresses; // Should never happen, but just in case - } - String takenIPAddress = cidr.split("/")[0]; - - IpAddressAvailabilityResultInner result = - this - .parent() - .manager() - .serviceClient() - .getVirtualNetworks() - .checkIpAddressAvailability(this.parent().resourceGroupName(), this.parent().name(), takenIPAddress); - if (result == null) { - return ipAddresses; - } - - ipAddresses.addAll(result.availableIpAddresses()); - return ipAddresses; - } - - @Override - public SubnetImpl withDelegation(String serviceName) { - if (innerModel().delegations() == null) { - innerModel().withDelegations(new ArrayList<>()); - } - innerModel().delegations().add(new Delegation().withName(serviceName).withServiceName(serviceName)); - return this; - } - - @Override - public SubnetImpl withoutDelegation(String serviceName) { - if (innerModel().delegations() != null) { - for (int i = 0; i < innerModel().delegations().size();) { - if (serviceName.equalsIgnoreCase(innerModel().delegations().get(i).serviceName())) { - innerModel().delegations().remove(i); - } else { - ++i; - } - } - } - return this; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/SubnetsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/SubnetsClientImpl.java deleted file mode 100644 index 3ac19799fe52..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/SubnetsClientImpl.java +++ /dev/null @@ -1,1158 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.SubnetsClient; -import com.azure.resourcemanager.network.fluent.models.SubnetInner; -import com.azure.resourcemanager.network.models.SubnetListResult; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in SubnetsClient. */ -public final class SubnetsClientImpl implements SubnetsClient { - private final ClientLogger logger = new ClientLogger(SubnetsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final SubnetsService service; - - /** The service client containing this operation class. */ - private final NetworkManagementClientImpl client; - - /** - * Initializes an instance of SubnetsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - SubnetsClientImpl(NetworkManagementClientImpl client) { - this.service = RestProxy.create(SubnetsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for NetworkManagementClientSubnets to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "NetworkManagementCli") - private interface SubnetsService { - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualNetworkName") String virtualNetworkName, - @PathParam("subnetName") String subnetName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualNetworkName") String virtualNetworkName, - @PathParam("subnetName") String subnetName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("$expand") String expand, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualNetworkName") String virtualNetworkName, - @PathParam("subnetName") String subnetName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") SubnetInner subnetParameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/virtualNetworks/{virtualNetworkName}/subnets") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualNetworkName") String virtualNetworkName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Deletes the specified subnet. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param subnetName The name of the subnet. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync( - String resourceGroupName, String virtualNetworkName, String subnetName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualNetworkName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); - } - if (subnetName == null) { - return Mono.error(new IllegalArgumentException("Parameter subnetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - virtualNetworkName, - subnetName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the specified subnet. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param subnetName The name of the subnet. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String virtualNetworkName, String subnetName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualNetworkName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); - } - if (subnetName == null) { - return Mono.error(new IllegalArgumentException("Parameter subnetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - virtualNetworkName, - subnetName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Deletes the specified subnet. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param subnetName The name of the subnet. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String virtualNetworkName, String subnetName) { - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, virtualNetworkName, subnetName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deletes the specified subnet. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param subnetName The name of the subnet. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String virtualNetworkName, String subnetName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, virtualNetworkName, subnetName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes the specified subnet. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param subnetName The name of the subnet. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String virtualNetworkName, String subnetName) { - return beginDeleteAsync(resourceGroupName, virtualNetworkName, subnetName).getSyncPoller(); - } - - /** - * Deletes the specified subnet. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param subnetName The name of the subnet. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String virtualNetworkName, String subnetName, Context context) { - return beginDeleteAsync(resourceGroupName, virtualNetworkName, subnetName, context).getSyncPoller(); - } - - /** - * Deletes the specified subnet. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param subnetName The name of the subnet. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String virtualNetworkName, String subnetName) { - return beginDeleteAsync(resourceGroupName, virtualNetworkName, subnetName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified subnet. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param subnetName The name of the subnet. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync( - String resourceGroupName, String virtualNetworkName, String subnetName, Context context) { - return beginDeleteAsync(resourceGroupName, virtualNetworkName, subnetName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified subnet. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param subnetName The name of the subnet. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String virtualNetworkName, String subnetName) { - deleteAsync(resourceGroupName, virtualNetworkName, subnetName).block(); - } - - /** - * Deletes the specified subnet. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param subnetName The name of the subnet. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String virtualNetworkName, String subnetName, Context context) { - deleteAsync(resourceGroupName, virtualNetworkName, subnetName, context).block(); - } - - /** - * Gets the specified subnet by virtual network and resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param subnetName The name of the subnet. - * @param expand Expands referenced resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified subnet by virtual network and resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String resourceGroupName, String virtualNetworkName, String subnetName, String expand) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualNetworkName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); - } - if (subnetName == null) { - return Mono.error(new IllegalArgumentException("Parameter subnetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - resourceGroupName, - virtualNetworkName, - subnetName, - apiVersion, - this.client.getSubscriptionId(), - expand, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the specified subnet by virtual network and resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param subnetName The name of the subnet. - * @param expand Expands referenced resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified subnet by virtual network and resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String virtualNetworkName, String subnetName, String expand, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualNetworkName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); - } - if (subnetName == null) { - return Mono.error(new IllegalArgumentException("Parameter subnetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - resourceGroupName, - virtualNetworkName, - subnetName, - apiVersion, - this.client.getSubscriptionId(), - expand, - accept, - context); - } - - /** - * Gets the specified subnet by virtual network and resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param subnetName The name of the subnet. - * @param expand Expands referenced resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified subnet by virtual network and resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync( - String resourceGroupName, String virtualNetworkName, String subnetName, String expand) { - return getWithResponseAsync(resourceGroupName, virtualNetworkName, subnetName, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the specified subnet by virtual network and resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param subnetName The name of the subnet. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified subnet by virtual network and resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync(String resourceGroupName, String virtualNetworkName, String subnetName) { - final String expand = null; - return getWithResponseAsync(resourceGroupName, virtualNetworkName, subnetName, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the specified subnet by virtual network and resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param subnetName The name of the subnet. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified subnet by virtual network and resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SubnetInner get(String resourceGroupName, String virtualNetworkName, String subnetName) { - final String expand = null; - return getAsync(resourceGroupName, virtualNetworkName, subnetName, expand).block(); - } - - /** - * Gets the specified subnet by virtual network and resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param subnetName The name of the subnet. - * @param expand Expands referenced resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified subnet by virtual network and resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String virtualNetworkName, String subnetName, String expand, Context context) { - return getWithResponseAsync(resourceGroupName, virtualNetworkName, subnetName, expand, context).block(); - } - - /** - * Creates or updates a subnet in the specified virtual network. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param subnetName The name of the subnet. - * @param subnetParameters Parameters supplied to the create or update subnet operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return subnet in a virtual network resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String virtualNetworkName, String subnetName, SubnetInner subnetParameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualNetworkName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); - } - if (subnetName == null) { - return Mono.error(new IllegalArgumentException("Parameter subnetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (subnetParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter subnetParameters is required and cannot be null.")); - } else { - subnetParameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - virtualNetworkName, - subnetName, - apiVersion, - this.client.getSubscriptionId(), - subnetParameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a subnet in the specified virtual network. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param subnetName The name of the subnet. - * @param subnetParameters Parameters supplied to the create or update subnet operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return subnet in a virtual network resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String virtualNetworkName, - String subnetName, - SubnetInner subnetParameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualNetworkName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); - } - if (subnetName == null) { - return Mono.error(new IllegalArgumentException("Parameter subnetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (subnetParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter subnetParameters is required and cannot be null.")); - } else { - subnetParameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - virtualNetworkName, - subnetName, - apiVersion, - this.client.getSubscriptionId(), - subnetParameters, - accept, - context); - } - - /** - * Creates or updates a subnet in the specified virtual network. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param subnetName The name of the subnet. - * @param subnetParameters Parameters supplied to the create or update subnet operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return subnet in a virtual network resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, SubnetInner> beginCreateOrUpdateAsync( - String resourceGroupName, String virtualNetworkName, String subnetName, SubnetInner subnetParameters) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), SubnetInner.class, SubnetInner.class, this.client.getContext()); - } - - /** - * Creates or updates a subnet in the specified virtual network. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param subnetName The name of the subnet. - * @param subnetParameters Parameters supplied to the create or update subnet operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return subnet in a virtual network resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, SubnetInner> beginCreateOrUpdateAsync( - String resourceGroupName, - String virtualNetworkName, - String subnetName, - SubnetInner subnetParameters, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync( - resourceGroupName, virtualNetworkName, subnetName, subnetParameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), SubnetInner.class, SubnetInner.class, context); - } - - /** - * Creates or updates a subnet in the specified virtual network. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param subnetName The name of the subnet. - * @param subnetParameters Parameters supplied to the create or update subnet operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return subnet in a virtual network resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, SubnetInner> beginCreateOrUpdate( - String resourceGroupName, String virtualNetworkName, String subnetName, SubnetInner subnetParameters) { - return beginCreateOrUpdateAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters) - .getSyncPoller(); - } - - /** - * Creates or updates a subnet in the specified virtual network. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param subnetName The name of the subnet. - * @param subnetParameters Parameters supplied to the create or update subnet operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return subnet in a virtual network resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, SubnetInner> beginCreateOrUpdate( - String resourceGroupName, - String virtualNetworkName, - String subnetName, - SubnetInner subnetParameters, - Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters, context) - .getSyncPoller(); - } - - /** - * Creates or updates a subnet in the specified virtual network. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param subnetName The name of the subnet. - * @param subnetParameters Parameters supplied to the create or update subnet operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return subnet in a virtual network resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, String virtualNetworkName, String subnetName, SubnetInner subnetParameters) { - return beginCreateOrUpdateAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a subnet in the specified virtual network. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param subnetName The name of the subnet. - * @param subnetParameters Parameters supplied to the create or update subnet operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return subnet in a virtual network resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, - String virtualNetworkName, - String subnetName, - SubnetInner subnetParameters, - Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a subnet in the specified virtual network. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param subnetName The name of the subnet. - * @param subnetParameters Parameters supplied to the create or update subnet operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return subnet in a virtual network resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SubnetInner createOrUpdate( - String resourceGroupName, String virtualNetworkName, String subnetName, SubnetInner subnetParameters) { - return createOrUpdateAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters).block(); - } - - /** - * Creates or updates a subnet in the specified virtual network. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param subnetName The name of the subnet. - * @param subnetParameters Parameters supplied to the create or update subnet operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return subnet in a virtual network resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SubnetInner createOrUpdate( - String resourceGroupName, - String virtualNetworkName, - String subnetName, - SubnetInner subnetParameters, - Context context) { - return createOrUpdateAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters, context) - .block(); - } - - /** - * Gets all subnets in a virtual network. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all subnets in a virtual network. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String virtualNetworkName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualNetworkName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - resourceGroupName, - virtualNetworkName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all subnets in a virtual network. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all subnets in a virtual network. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String virtualNetworkName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualNetworkName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - resourceGroupName, - virtualNetworkName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all subnets in a virtual network. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all subnets in a virtual network. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String resourceGroupName, String virtualNetworkName) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, virtualNetworkName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets all subnets in a virtual network. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all subnets in a virtual network. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String virtualNetworkName, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, virtualNetworkName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all subnets in a virtual network. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all subnets in a virtual network. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String virtualNetworkName) { - return new PagedIterable<>(listAsync(resourceGroupName, virtualNetworkName)); - } - - /** - * Gets all subnets in a virtual network. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all subnets in a virtual network. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String virtualNetworkName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, virtualNetworkName, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListSubnets API service callRetrieves all subnet that belongs to a virtual network. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListSubnets API service callRetrieves all subnet that belongs to a virtual network. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/TopologyImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/TopologyImpl.java deleted file mode 100644 index 80e3c2f8d3af..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/TopologyImpl.java +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.management.SubResource; -import com.azure.resourcemanager.network.models.NetworkWatcher; -import com.azure.resourcemanager.network.models.Topology; -import com.azure.resourcemanager.network.models.TopologyParameters; -import com.azure.resourcemanager.network.models.TopologyResource; -import com.azure.resourcemanager.network.fluent.models.TopologyInner; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.ExecutableImpl; -import java.time.OffsetDateTime; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.TreeMap; -import reactor.core.publisher.Mono; - -/** The implementation of Topology. */ -class TopologyImpl extends ExecutableImpl implements Topology, Topology.Definition { - private Map resources; - private final NetworkWatcherImpl parent; - private TopologyParameters parameters = new TopologyParameters(); - private TopologyInner inner; - - TopologyImpl(NetworkWatcherImpl parent) { - this.parent = parent; - } - - @Override - public String id() { - return innerModel().id(); - } - - @Override - public TopologyParameters topologyParameters() { - return parameters; - } - - @Override - public OffsetDateTime createdTime() { - return innerModel().createdDateTime(); - } - - @Override - public OffsetDateTime lastModifiedTime() { - return innerModel().lastModified(); - } - - @Override - public Map resources() { - return Collections.unmodifiableMap(this.resources); - } - - private void initializeResourcesFromInner() { - this.resources = new TreeMap<>(); - List topologyResources = this.innerModel().resources(); - if (topologyResources != null) { - for (TopologyResource resource : topologyResources) { - this.resources.put(resource.id(), resource); - } - } - } - - @Override - public NetworkWatcher parent() { - return parent; - } - - @Override - public TopologyImpl withTargetResourceGroup(String resourceGroupName) { - parameters.withTargetResourceGroupName(resourceGroupName); - return this; - } - - @Override - public TopologyImpl withTargetNetwork(String networkId) { - parameters.withTargetVirtualNetwork(new SubResource().withId(networkId)); - return this; - } - - @Override - public TopologyImpl withTargetSubnet(String subnetName) { - parameters - .withTargetSubnet( - new SubResource().withId(parameters.targetVirtualNetwork().id() + "/subnets/" + subnetName)); - return this; - } - - @Override - public TopologyInner innerModel() { - return this.inner; - } - - @Override - public Mono executeWorkAsync() { - return this - .parent() - .manager() - .serviceClient() - .getNetworkWatchers() - .getTopologyAsync(parent().resourceGroupName(), parent().name(), parameters) - .map( - topologyInner -> { - TopologyImpl.this.inner = topologyInner; - TopologyImpl.this.initializeResourcesFromInner(); - return TopologyImpl.this; - }); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/TroubleshootingImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/TroubleshootingImpl.java deleted file mode 100644 index 4abb1dcd1e64..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/TroubleshootingImpl.java +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.resourcemanager.network.models.NetworkWatcher; -import com.azure.resourcemanager.network.models.Troubleshooting; -import com.azure.resourcemanager.network.models.TroubleshootingDetails; -import com.azure.resourcemanager.network.models.TroubleshootingParameters; -import com.azure.resourcemanager.network.fluent.models.TroubleshootingResultInner; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.ExecutableImpl; -import java.time.OffsetDateTime; -import java.util.List; -import reactor.core.publisher.Mono; - -/** Implementation of Troubleshooting interface. */ -class TroubleshootingImpl extends ExecutableImpl - implements Troubleshooting, Troubleshooting.Definition { - - private final NetworkWatcherImpl parent; - private TroubleshootingParameters parameters = new TroubleshootingParameters(); - private TroubleshootingResultInner result; - - TroubleshootingImpl(NetworkWatcherImpl parent) { - this.parent = parent; - } - - @Override - public TroubleshootingImpl withTargetResourceId(String targetResourceId) { - parameters.withTargetResourceId(targetResourceId); - return this; - } - - @Override - public TroubleshootingImpl withStorageAccount(String storageAccountId) { - parameters.withStorageId(storageAccountId); - return this; - } - - @Override - public TroubleshootingImpl withStoragePath(String storagePath) { - parameters.withStoragePath(storagePath); - return this; - } - - @Override - public NetworkWatcher parent() { - return parent; - } - - @Override - public Mono executeWorkAsync() { - return this - .parent() - .manager() - .serviceClient() - .getNetworkWatchers() - .getTroubleshootingAsync(parent.resourceGroupName(), parent.name(), parameters) - .map( - troubleshootingResultInner -> { - TroubleshootingImpl.this.result = troubleshootingResultInner; - return TroubleshootingImpl.this; - }); - } - - // Getters - - @Override - public String targetResourceId() { - return parameters.targetResourceId(); - } - - @Override - public String storageId() { - return parameters.storageId(); - } - - @Override - public String storagePath() { - return parameters.storagePath(); - } - - @Override - public OffsetDateTime startTime() { - return result.startTime(); - } - - @Override - public OffsetDateTime endTime() { - return result.endTime(); - } - - @Override - public String code() { - return result.code(); - } - - @Override - public List results() { - return result.results(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/UsagesClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/UsagesClientImpl.java deleted file mode 100644 index c48dbda93f47..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/UsagesClientImpl.java +++ /dev/null @@ -1,307 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.UsagesClient; -import com.azure.resourcemanager.network.fluent.models.UsageInner; -import com.azure.resourcemanager.network.models.UsagesListResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in UsagesClient. */ -public final class UsagesClientImpl implements UsagesClient { - private final ClientLogger logger = new ClientLogger(UsagesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final UsagesService service; - - /** The service client containing this operation class. */ - private final NetworkManagementClientImpl client; - - /** - * Initializes an instance of UsagesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - UsagesClientImpl(NetworkManagementClientImpl client) { - this.service = RestProxy.create(UsagesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for NetworkManagementClientUsages to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "NetworkManagementCli") - private interface UsagesService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/usages") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("location") String location, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * List network usages for a subscription. - * - * @param location The location where resource usage is queried. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list usages operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String location) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - location, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List network usages for a subscription. - * - * @param location The location where resource usage is queried. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list usages operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String location, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), location, apiVersion, this.client.getSubscriptionId(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * List network usages for a subscription. - * - * @param location The location where resource usage is queried. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list usages operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String location) { - return new PagedFlux<>(() -> listSinglePageAsync(location), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List network usages for a subscription. - * - * @param location The location where resource usage is queried. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list usages operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String location, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(location, context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * List network usages for a subscription. - * - * @param location The location where resource usage is queried. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list usages operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String location) { - return new PagedIterable<>(listAsync(location)); - } - - /** - * List network usages for a subscription. - * - * @param location The location where resource usage is queried. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list usages operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String location, Context context) { - return new PagedIterable<>(listAsync(location, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list usages operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list usages operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/Utils.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/Utils.java deleted file mode 100644 index a75b7769f5c2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/Utils.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.management.SubResource; -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.network.fluent.models.SubnetInner; -import com.azure.resourcemanager.network.models.ApplicationGateway; -import com.azure.resourcemanager.network.models.ApplicationGatewayBackend; -import com.azure.resourcemanager.network.models.ApplicationGatewayBackendAddressPool; -import com.azure.resourcemanager.network.models.Network; -import com.azure.resourcemanager.network.models.Subnet; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Locale; -import java.util.Map; - -/** Defines a few utilities. */ -public final class Utils { - - private Utils() { - } - - // Internal utility function - static Subnet getAssociatedSubnet(NetworkManager manager, SubResource subnetRef) { - if (subnetRef == null) { - return null; - } - - String vnetId = ResourceUtils.parentResourceIdFromResourceId(subnetRef.id()); - String subnetName = ResourceUtils.nameFromResourceId(subnetRef.id()); - - if (vnetId == null || subnetName == null) { - return null; - } - - Network network = manager.networks().getById(vnetId); - if (network == null) { - return null; - } - - return network.subnets().get(subnetName); - } - - // Internal utility function - static List listAssociatedSubnets(NetworkManager manager, List subnetRefs) { - final Map networks = new HashMap<>(); - final List subnets = new ArrayList<>(); - - if (subnetRefs != null) { - for (SubnetInner subnetRef : subnetRefs) { - String networkId = ResourceUtils.parentResourceIdFromResourceId(subnetRef.id()); - Network network = networks.get(networkId.toLowerCase(Locale.ROOT)); - if (network == null) { - network = manager.networks().getById(networkId); - networks.put(networkId.toLowerCase(Locale.ROOT), network); - } - - String subnetName = ResourceUtils.nameFromResourceId(subnetRef.id()); - subnets.add(network.subnets().get(subnetName)); - } - } - - return Collections.unmodifiableList(subnets); - } - - // Internal utility function - static Collection listAssociatedApplicationGatewayBackends( - NetworkManager manager, List backendRefs) { - final Map appGateways = new HashMap<>(); - final List backends = new ArrayList<>(); - - if (backendRefs != null) { - for (ApplicationGatewayBackendAddressPool backendRef : backendRefs) { - String appGatewayId = ResourceUtils.parentResourceIdFromResourceId(backendRef.id()); - ApplicationGateway appGateway = appGateways.get(appGatewayId.toLowerCase(Locale.ROOT)); - if (appGateway == null) { - appGateway = manager.applicationGateways().getById(appGatewayId); - appGateways.put(appGatewayId.toLowerCase(Locale.ROOT), appGateway); - } - - String backendName = ResourceUtils.nameFromResourceId(backendRef.id()); - backends.add(appGateway.backends().get(backendName)); - } - } - - return Collections.unmodifiableCollection(backends); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/VerificationIPFlowImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/VerificationIPFlowImpl.java deleted file mode 100644 index a43182884cc4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/VerificationIPFlowImpl.java +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.resourcemanager.network.models.Access; -import com.azure.resourcemanager.network.models.Direction; -import com.azure.resourcemanager.network.models.IpFlowProtocol; -import com.azure.resourcemanager.network.models.VerificationIPFlow; -import com.azure.resourcemanager.network.models.VerificationIpFlowParameters; -import com.azure.resourcemanager.network.fluent.models.VerificationIpFlowResultInner; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.ExecutableImpl; -import reactor.core.publisher.Mono; - -/** Implementation of VerificationIPFlow. */ -public class VerificationIPFlowImpl extends ExecutableImpl - implements VerificationIPFlow, VerificationIPFlow.Definition { - private final NetworkWatcherImpl parent; - private VerificationIpFlowParameters parameters = new VerificationIpFlowParameters(); - private VerificationIpFlowResultInner result; - - VerificationIPFlowImpl(NetworkWatcherImpl parent) { - this.parent = parent; - } - - @Override - public VerificationIPFlowImpl withTargetResourceId(String targetResourceId) { - parameters.withTargetResourceId(targetResourceId); - return this; - } - - @Override - public VerificationIPFlowImpl withDirection(Direction direction) { - parameters.withDirection(direction); - return this; - } - - @Override - public DefinitionStages.WithProtocol inbound() { - return withDirection(Direction.INBOUND); - } - - @Override - public DefinitionStages.WithProtocol outbound() { - return withDirection(Direction.OUTBOUND); - } - - @Override - public VerificationIPFlowImpl withProtocol(IpFlowProtocol protocol) { - parameters.withProtocol(protocol); - return this; - } - - @Override - public DefinitionStages.WithLocalIP withTCP() { - return withProtocol(IpFlowProtocol.TCP); - } - - @Override - public DefinitionStages.WithLocalIP withUDP() { - return withProtocol(IpFlowProtocol.UDP); - } - - @Override - public VerificationIPFlowImpl withLocalPort(String localPort) { - parameters.withLocalPort(localPort); - return this; - } - - @Override - public VerificationIPFlowImpl withRemotePort(String remotePort) { - parameters.withRemotePort(remotePort); - return this; - } - - @Override - public VerificationIPFlowImpl withLocalIPAddress(String localIPAddress) { - parameters.withLocalIpAddress(localIPAddress); - return this; - } - - @Override - public VerificationIPFlowImpl withRemoteIPAddress(String remoteIPAddress) { - parameters.withRemoteIpAddress(remoteIPAddress); - return this; - } - - @Override - public VerificationIPFlow withTargetNetworkInterfaceId(String targetNetworkInterfaceId) { - parameters.withTargetNicResourceId(targetNetworkInterfaceId); - return this; - } - - @Override - public NetworkWatcherImpl parent() { - return parent; - } - - @Override - public Access access() { - return this.result.access(); - } - - @Override - public String ruleName() { - return this.result.ruleName(); - } - - @Override - public Mono executeWorkAsync() { - return this - .parent() - .manager() - .serviceClient() - .getNetworkWatchers() - .verifyIpFlowAsync(parent.resourceGroupName(), parent.name(), parameters) - .map( - verificationIPFlowResultInner -> { - VerificationIPFlowImpl.this.result = verificationIPFlowResultInner; - return VerificationIPFlowImpl.this; - }); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/VirtualHubsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/VirtualHubsClientImpl.java deleted file mode 100644 index c1d8143e1410..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/VirtualHubsClientImpl.java +++ /dev/null @@ -1,1552 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.VirtualHubsClient; -import com.azure.resourcemanager.network.fluent.models.VirtualHubInner; -import com.azure.resourcemanager.network.models.ErrorException; -import com.azure.resourcemanager.network.models.ListVirtualHubsResult; -import com.azure.resourcemanager.network.models.TagsObject; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in VirtualHubsClient. */ -public final class VirtualHubsClientImpl - implements InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete, - VirtualHubsClient { - private final ClientLogger logger = new ClientLogger(VirtualHubsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final VirtualHubsService service; - - /** The service client containing this operation class. */ - private final NetworkManagementClientImpl client; - - /** - * Initializes an instance of VirtualHubsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - VirtualHubsClientImpl(NetworkManagementClientImpl client) { - this.service = - RestProxy.create(VirtualHubsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for NetworkManagementClientVirtualHubs to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "NetworkManagementCli") - private interface VirtualHubsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs" - + "/{virtualHubName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ErrorException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualHubName") String virtualHubName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs" - + "/{virtualHubName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ErrorException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualHubName") String virtualHubName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") VirtualHubInner virtualHubParameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs" - + "/{virtualHubName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ErrorException.class) - Mono>> updateTags( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualHubName") String virtualHubName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") TagsObject virtualHubParameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs" - + "/{virtualHubName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ErrorException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualHubName") String virtualHubName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/virtualHubs") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ErrorException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualHubs") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ErrorException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ErrorException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ErrorException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Retrieves the details of a VirtualHub. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param virtualHubName The name of the VirtualHub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualHub Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String virtualHubName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualHubName == null) { - return Mono.error(new IllegalArgumentException("Parameter virtualHubName is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - virtualHubName, - apiVersion, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Retrieves the details of a VirtualHub. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param virtualHubName The name of the VirtualHub. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualHub Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String virtualHubName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualHubName == null) { - return Mono.error(new IllegalArgumentException("Parameter virtualHubName is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - virtualHubName, - apiVersion, - accept, - context); - } - - /** - * Retrieves the details of a VirtualHub. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param virtualHubName The name of the VirtualHub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualHub Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync(String resourceGroupName, String virtualHubName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, virtualHubName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Retrieves the details of a VirtualHub. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param virtualHubName The name of the VirtualHub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualHub Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualHubInner getByResourceGroup(String resourceGroupName, String virtualHubName) { - return getByResourceGroupAsync(resourceGroupName, virtualHubName).block(); - } - - /** - * Retrieves the details of a VirtualHub. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param virtualHubName The name of the VirtualHub. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualHub Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String virtualHubName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, virtualHubName, context).block(); - } - - /** - * Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param virtualHubName The name of the VirtualHub. - * @param virtualHubParameters Parameters supplied to create or update VirtualHub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualHub Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String virtualHubName, VirtualHubInner virtualHubParameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualHubName == null) { - return Mono.error(new IllegalArgumentException("Parameter virtualHubName is required and cannot be null.")); - } - if (virtualHubParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualHubParameters is required and cannot be null.")); - } else { - virtualHubParameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - virtualHubName, - apiVersion, - virtualHubParameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param virtualHubName The name of the VirtualHub. - * @param virtualHubParameters Parameters supplied to create or update VirtualHub. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualHub Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String virtualHubName, VirtualHubInner virtualHubParameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualHubName == null) { - return Mono.error(new IllegalArgumentException("Parameter virtualHubName is required and cannot be null.")); - } - if (virtualHubParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualHubParameters is required and cannot be null.")); - } else { - virtualHubParameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - virtualHubName, - apiVersion, - virtualHubParameters, - accept, - context); - } - - /** - * Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param virtualHubName The name of the VirtualHub. - * @param virtualHubParameters Parameters supplied to create or update VirtualHub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualHub Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, VirtualHubInner> beginCreateOrUpdateAsync( - String resourceGroupName, String virtualHubName, VirtualHubInner virtualHubParameters) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, virtualHubName, virtualHubParameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VirtualHubInner.class, - VirtualHubInner.class, - this.client.getContext()); - } - - /** - * Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param virtualHubName The name of the VirtualHub. - * @param virtualHubParameters Parameters supplied to create or update VirtualHub. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualHub Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, VirtualHubInner> beginCreateOrUpdateAsync( - String resourceGroupName, String virtualHubName, VirtualHubInner virtualHubParameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, virtualHubName, virtualHubParameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), VirtualHubInner.class, VirtualHubInner.class, context); - } - - /** - * Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param virtualHubName The name of the VirtualHub. - * @param virtualHubParameters Parameters supplied to create or update VirtualHub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualHub Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VirtualHubInner> beginCreateOrUpdate( - String resourceGroupName, String virtualHubName, VirtualHubInner virtualHubParameters) { - return beginCreateOrUpdateAsync(resourceGroupName, virtualHubName, virtualHubParameters).getSyncPoller(); - } - - /** - * Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param virtualHubName The name of the VirtualHub. - * @param virtualHubParameters Parameters supplied to create or update VirtualHub. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualHub Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VirtualHubInner> beginCreateOrUpdate( - String resourceGroupName, String virtualHubName, VirtualHubInner virtualHubParameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, virtualHubName, virtualHubParameters, context) - .getSyncPoller(); - } - - /** - * Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param virtualHubName The name of the VirtualHub. - * @param virtualHubParameters Parameters supplied to create or update VirtualHub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualHub Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, String virtualHubName, VirtualHubInner virtualHubParameters) { - return beginCreateOrUpdateAsync(resourceGroupName, virtualHubName, virtualHubParameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param virtualHubName The name of the VirtualHub. - * @param virtualHubParameters Parameters supplied to create or update VirtualHub. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualHub Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String virtualHubName, VirtualHubInner virtualHubParameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, virtualHubName, virtualHubParameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param virtualHubName The name of the VirtualHub. - * @param virtualHubParameters Parameters supplied to create or update VirtualHub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualHub Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualHubInner createOrUpdate( - String resourceGroupName, String virtualHubName, VirtualHubInner virtualHubParameters) { - return createOrUpdateAsync(resourceGroupName, virtualHubName, virtualHubParameters).block(); - } - - /** - * Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param virtualHubName The name of the VirtualHub. - * @param virtualHubParameters Parameters supplied to create or update VirtualHub. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualHub Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualHubInner createOrUpdate( - String resourceGroupName, String virtualHubName, VirtualHubInner virtualHubParameters, Context context) { - return createOrUpdateAsync(resourceGroupName, virtualHubName, virtualHubParameters, context).block(); - } - - /** - * Updates VirtualHub tags. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param virtualHubName The name of the VirtualHub. - * @param virtualHubParameters Parameters supplied to update VirtualHub tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualHub Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateTagsWithResponseAsync( - String resourceGroupName, String virtualHubName, TagsObject virtualHubParameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualHubName == null) { - return Mono.error(new IllegalArgumentException("Parameter virtualHubName is required and cannot be null.")); - } - if (virtualHubParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualHubParameters is required and cannot be null.")); - } else { - virtualHubParameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updateTags( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - virtualHubName, - apiVersion, - virtualHubParameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates VirtualHub tags. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param virtualHubName The name of the VirtualHub. - * @param virtualHubParameters Parameters supplied to update VirtualHub tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualHub Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateTagsWithResponseAsync( - String resourceGroupName, String virtualHubName, TagsObject virtualHubParameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualHubName == null) { - return Mono.error(new IllegalArgumentException("Parameter virtualHubName is required and cannot be null.")); - } - if (virtualHubParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualHubParameters is required and cannot be null.")); - } else { - virtualHubParameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updateTags( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - virtualHubName, - apiVersion, - virtualHubParameters, - accept, - context); - } - - /** - * Updates VirtualHub tags. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param virtualHubName The name of the VirtualHub. - * @param virtualHubParameters Parameters supplied to update VirtualHub tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualHub Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, VirtualHubInner> beginUpdateTagsAsync( - String resourceGroupName, String virtualHubName, TagsObject virtualHubParameters) { - Mono>> mono = - updateTagsWithResponseAsync(resourceGroupName, virtualHubName, virtualHubParameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VirtualHubInner.class, - VirtualHubInner.class, - this.client.getContext()); - } - - /** - * Updates VirtualHub tags. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param virtualHubName The name of the VirtualHub. - * @param virtualHubParameters Parameters supplied to update VirtualHub tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualHub Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, VirtualHubInner> beginUpdateTagsAsync( - String resourceGroupName, String virtualHubName, TagsObject virtualHubParameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - updateTagsWithResponseAsync(resourceGroupName, virtualHubName, virtualHubParameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), VirtualHubInner.class, VirtualHubInner.class, context); - } - - /** - * Updates VirtualHub tags. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param virtualHubName The name of the VirtualHub. - * @param virtualHubParameters Parameters supplied to update VirtualHub tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualHub Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VirtualHubInner> beginUpdateTags( - String resourceGroupName, String virtualHubName, TagsObject virtualHubParameters) { - return beginUpdateTagsAsync(resourceGroupName, virtualHubName, virtualHubParameters).getSyncPoller(); - } - - /** - * Updates VirtualHub tags. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param virtualHubName The name of the VirtualHub. - * @param virtualHubParameters Parameters supplied to update VirtualHub tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualHub Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VirtualHubInner> beginUpdateTags( - String resourceGroupName, String virtualHubName, TagsObject virtualHubParameters, Context context) { - return beginUpdateTagsAsync(resourceGroupName, virtualHubName, virtualHubParameters, context).getSyncPoller(); - } - - /** - * Updates VirtualHub tags. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param virtualHubName The name of the VirtualHub. - * @param virtualHubParameters Parameters supplied to update VirtualHub tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualHub Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateTagsAsync( - String resourceGroupName, String virtualHubName, TagsObject virtualHubParameters) { - return beginUpdateTagsAsync(resourceGroupName, virtualHubName, virtualHubParameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates VirtualHub tags. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param virtualHubName The name of the VirtualHub. - * @param virtualHubParameters Parameters supplied to update VirtualHub tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualHub Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateTagsAsync( - String resourceGroupName, String virtualHubName, TagsObject virtualHubParameters, Context context) { - return beginUpdateTagsAsync(resourceGroupName, virtualHubName, virtualHubParameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates VirtualHub tags. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param virtualHubName The name of the VirtualHub. - * @param virtualHubParameters Parameters supplied to update VirtualHub tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualHub Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualHubInner updateTags( - String resourceGroupName, String virtualHubName, TagsObject virtualHubParameters) { - return updateTagsAsync(resourceGroupName, virtualHubName, virtualHubParameters).block(); - } - - /** - * Updates VirtualHub tags. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param virtualHubName The name of the VirtualHub. - * @param virtualHubParameters Parameters supplied to update VirtualHub tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualHub Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualHubInner updateTags( - String resourceGroupName, String virtualHubName, TagsObject virtualHubParameters, Context context) { - return updateTagsAsync(resourceGroupName, virtualHubName, virtualHubParameters, context).block(); - } - - /** - * Deletes a VirtualHub. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param virtualHubName The name of the VirtualHub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync(String resourceGroupName, String virtualHubName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualHubName == null) { - return Mono.error(new IllegalArgumentException("Parameter virtualHubName is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - virtualHubName, - apiVersion, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a VirtualHub. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param virtualHubName The name of the VirtualHub. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String virtualHubName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualHubName == null) { - return Mono.error(new IllegalArgumentException("Parameter virtualHubName is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - virtualHubName, - apiVersion, - accept, - context); - } - - /** - * Deletes a VirtualHub. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param virtualHubName The name of the VirtualHub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String virtualHubName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, virtualHubName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deletes a VirtualHub. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param virtualHubName The name of the VirtualHub. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String virtualHubName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(resourceGroupName, virtualHubName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes a VirtualHub. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param virtualHubName The name of the VirtualHub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete(String resourceGroupName, String virtualHubName) { - return beginDeleteAsync(resourceGroupName, virtualHubName).getSyncPoller(); - } - - /** - * Deletes a VirtualHub. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param virtualHubName The name of the VirtualHub. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String virtualHubName, Context context) { - return beginDeleteAsync(resourceGroupName, virtualHubName, context).getSyncPoller(); - } - - /** - * Deletes a VirtualHub. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param virtualHubName The name of the VirtualHub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String virtualHubName) { - return beginDeleteAsync(resourceGroupName, virtualHubName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a VirtualHub. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param virtualHubName The name of the VirtualHub. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String virtualHubName, Context context) { - return beginDeleteAsync(resourceGroupName, virtualHubName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a VirtualHub. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param virtualHubName The name of the VirtualHub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String virtualHubName) { - deleteAsync(resourceGroupName, virtualHubName).block(); - } - - /** - * Deletes a VirtualHub. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param virtualHubName The name of the VirtualHub. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String virtualHubName, Context context) { - deleteAsync(resourceGroupName, virtualHubName, context).block(); - } - - /** - * Lists all the VirtualHubs in a resource group. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VirtualHubs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - apiVersion, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all the VirtualHubs in a resource group. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VirtualHubs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - apiVersion, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists all the VirtualHubs in a resource group. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VirtualHubs. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * Lists all the VirtualHubs in a resource group. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VirtualHubs. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all the VirtualHubs in a resource group. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VirtualHubs. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * Lists all the VirtualHubs in a resource group. - * - * @param resourceGroupName The resource group name of the VirtualHub. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VirtualHubs. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * Lists all the VirtualHubs in a subscription. - * - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VirtualHubs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all the VirtualHubs in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VirtualHubs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists all the VirtualHubs in a subscription. - * - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VirtualHubs. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists all the VirtualHubs in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VirtualHubs. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all the VirtualHubs in a subscription. - * - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VirtualHubs. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Lists all the VirtualHubs in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VirtualHubs. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VirtualHubs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VirtualHubs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VirtualHubs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VirtualHubs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/VirtualMachineScaleSetNetworkInterfaceImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/VirtualMachineScaleSetNetworkInterfaceImpl.java deleted file mode 100644 index 273f3540498a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/VirtualMachineScaleSetNetworkInterfaceImpl.java +++ /dev/null @@ -1,201 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.network.models.IpAllocationMethod; -import com.azure.resourcemanager.network.models.NetworkSecurityGroup; -import com.azure.resourcemanager.network.models.VirtualMachineScaleSetNetworkInterface; -import com.azure.resourcemanager.network.models.VirtualMachineScaleSetNicIpConfiguration; -import com.azure.resourcemanager.network.fluent.models.NetworkInterfaceIpConfigurationInner; -import com.azure.resourcemanager.network.fluent.models.NetworkInterfaceInner; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils; -import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.ResourceImpl; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.TreeMap; -import reactor.core.publisher.Mono; - -/** The implementation for VirtualMachineScaleSetNetworkInterface. */ -class VirtualMachineScaleSetNetworkInterfaceImpl - extends ResourceImpl< - VirtualMachineScaleSetNetworkInterface, NetworkInterfaceInner, VirtualMachineScaleSetNetworkInterfaceImpl> - implements VirtualMachineScaleSetNetworkInterface { - /** the network client. */ - private final NetworkManager networkManager; - /** name of the parent scale set. */ - private final String scaleSetName; - /** resource group this nic belongs to. */ - private final String resourceGroupName; - - private final ClientLogger logger = new ClientLogger(getClass()); - - VirtualMachineScaleSetNetworkInterfaceImpl( - String name, - String scaleSetName, - String resourceGroupName, - NetworkInterfaceInner innerObject, - NetworkManager networkManager) { - super(name, innerObject); - this.scaleSetName = scaleSetName; - this.resourceGroupName = resourceGroupName; - this.networkManager = networkManager; - } - - @Override - public boolean isIPForwardingEnabled() { - return ResourceManagerUtils.toPrimitiveBoolean(this.innerModel().enableIpForwarding()); - } - - @Override - public String macAddress() { - return this.innerModel().macAddress(); - } - - @Override - public String internalDnsNameLabel() { - if (this.innerModel().dnsSettings() == null) { - return null; - } - return this.innerModel().dnsSettings().internalDnsNameLabel(); - } - - @Override - public String internalFqdn() { - if (this.innerModel().dnsSettings() == null) { - return null; - } - return this.innerModel().dnsSettings().internalFqdn(); - } - - @Override - public String internalDomainNameSuffix() { - if (this.innerModel().dnsSettings() == null) { - return null; - } - return this.innerModel().dnsSettings().internalDomainNameSuffix(); - } - - @Override - public List dnsServers() { - if (this.innerModel().dnsSettings() == null || this.innerModel().dnsSettings().dnsServers() == null) { - return Collections.unmodifiableList(new ArrayList()); - } - return Collections.unmodifiableList(this.innerModel().dnsSettings().dnsServers()); - } - - @Override - public List appliedDnsServers() { - List dnsServers = new ArrayList<>(); - if (this.innerModel().dnsSettings() == null || this.innerModel().dnsSettings().appliedDnsServers() == null) { - return Collections.unmodifiableList(dnsServers); - } - return Collections.unmodifiableList(this.innerModel().dnsSettings().appliedDnsServers()); - } - - @Override - public String primaryPrivateIP() { - VirtualMachineScaleSetNicIpConfiguration primaryIPConfig = this.primaryIPConfiguration(); - if (primaryIPConfig == null) { - return null; - } - return primaryIPConfig.privateIpAddress(); - } - - @Override - public IpAllocationMethod primaryPrivateIpAllocationMethod() { - VirtualMachineScaleSetNicIpConfiguration primaryIPConfig = this.primaryIPConfiguration(); - if (primaryIPConfig == null) { - return null; - } - return primaryIPConfig.privateIpAllocationMethod(); - } - - @Override - public Map ipConfigurations() { - List inners = this.innerModel().ipConfigurations(); - if (inners == null || inners.size() == 0) { - return Collections.unmodifiableMap(new TreeMap()); - } - Map nicIPConfigurations = new TreeMap<>(); - for (NetworkInterfaceIpConfigurationInner inner : inners) { - VirtualMachineScaleSetNicIpConfigurationImpl nicIPConfiguration = - new VirtualMachineScaleSetNicIpConfigurationImpl(inner, this, this.networkManager); - nicIPConfigurations.put(nicIPConfiguration.name(), nicIPConfiguration); - } - return Collections.unmodifiableMap(nicIPConfigurations); - } - - @Override - public VirtualMachineScaleSetNicIpConfiguration primaryIPConfiguration() { - for (VirtualMachineScaleSetNicIpConfiguration ipConfiguration : this.ipConfigurations().values()) { - if (ipConfiguration.isPrimary()) { - return ipConfiguration; - } - } - return null; - } - - @Override - public String networkSecurityGroupId() { - if (this.innerModel().networkSecurityGroup() == null) { - return null; - } - return this.innerModel().networkSecurityGroup().id(); - } - - @Override - public NetworkSecurityGroup getNetworkSecurityGroup() { - String nsgId = this.networkSecurityGroupId(); - if (nsgId == null) { - return null; - } - return this - .manager() - .networkSecurityGroups() - .getByResourceGroup(ResourceUtils.groupFromResourceId(nsgId), ResourceUtils.nameFromResourceId(nsgId)); - } - - @Override - public String virtualMachineId() { - if (this.innerModel().virtualMachine() == null) { - return null; - } - return this.innerModel().virtualMachine().id(); - } - - @Override - public Mono createResourceAsync() { - // VMSS NIC is a read-only resource hence this operation is not supported. - throw logger.logExceptionAsError(new UnsupportedOperationException()); - } - - @Override - protected Mono getInnerAsync() { - return this - .manager() - .serviceClient() - .getNetworkInterfaces() - .getVirtualMachineScaleSetNetworkInterfaceAsync( - this.resourceGroupName, - this.scaleSetName, - ResourceUtils.nameFromResourceId(this.virtualMachineId()), - this.name()); - } - - @Override - public NetworkManager manager() { - return this.networkManager; - } - - @Override - public boolean isAcceleratedNetworkingEnabled() { - return ResourceManagerUtils.toPrimitiveBoolean(this.innerModel().enableAcceleratedNetworking()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/VirtualMachineScaleSetNetworkInterfacesImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/VirtualMachineScaleSetNetworkInterfacesImpl.java deleted file mode 100644 index e808b5d89b08..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/VirtualMachineScaleSetNetworkInterfacesImpl.java +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.network.fluent.NetworkInterfacesClient; -import com.azure.resourcemanager.network.fluent.models.NetworkInterfaceInner; -import com.azure.resourcemanager.network.models.VirtualMachineScaleSetNetworkInterface; -import com.azure.resourcemanager.network.models.VirtualMachineScaleSetNetworkInterfaces; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.ReadableWrappersImpl; - -/** Implementation for VirtualMachineScaleSetNetworkInterfaces. */ -class VirtualMachineScaleSetNetworkInterfacesImpl - extends ReadableWrappersImpl< - VirtualMachineScaleSetNetworkInterface, VirtualMachineScaleSetNetworkInterfaceImpl, NetworkInterfaceInner> - implements VirtualMachineScaleSetNetworkInterfaces { - private final String resourceGroupName; - private final String scaleSetName; - private final NetworkManager networkManager; - - VirtualMachineScaleSetNetworkInterfacesImpl( - String resourceGroupName, String scaleSetName, NetworkManager networkManager) { - this.resourceGroupName = resourceGroupName; - this.scaleSetName = scaleSetName; - this.networkManager = networkManager; - } - - public NetworkInterfacesClient inner() { - return this.manager().serviceClient().getNetworkInterfaces(); - } - - @Override - public NetworkManager manager() { - return this.networkManager; - } - - @Override - protected VirtualMachineScaleSetNetworkInterfaceImpl wrapModel(NetworkInterfaceInner inner) { - if (inner == null) { - return null; - } - return new VirtualMachineScaleSetNetworkInterfaceImpl( - inner.name(), this.scaleSetName, this.resourceGroupName, inner, this.manager()); - } - - @Override - public VirtualMachineScaleSetNetworkInterface getByVirtualMachineInstanceId(String instanceId, String name) { - NetworkInterfaceInner networkInterfaceInner = - this - .inner() - .getVirtualMachineScaleSetNetworkInterface(this.resourceGroupName, this.scaleSetName, instanceId, name); - if (networkInterfaceInner == null) { - return null; - } - return this.wrapModel(networkInterfaceInner); - } - - @Override - public PagedIterable list() { - return super - .wrapList( - this.inner().listVirtualMachineScaleSetNetworkInterfaces(this.resourceGroupName, this.scaleSetName)); - } - - @Override - public PagedFlux listAsync() { - return wrapPageAsync(this.inner().listAsync()); - } - - @Override - public PagedIterable listByVirtualMachineInstanceId(String instanceId) { - return super - .wrapList( - this - .inner() - .listVirtualMachineScaleSetVMNetworkInterfaces( - this.resourceGroupName, this.scaleSetName, instanceId)); - } - - @Override - public PagedFlux listByVirtualMachineInstanceIdAsync(String instanceId) { - return super - .wrapPageAsync( - this - .inner() - .listVirtualMachineScaleSetVMNetworkInterfacesAsync( - this.resourceGroupName, this.scaleSetName, instanceId)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/VirtualMachineScaleSetNicIpConfigurationImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/VirtualMachineScaleSetNicIpConfigurationImpl.java deleted file mode 100644 index e35f9d6d79a2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/VirtualMachineScaleSetNicIpConfigurationImpl.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.network.implementation; - -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.network.models.VirtualMachineScaleSetNetworkInterface; -import com.azure.resourcemanager.network.models.VirtualMachineScaleSetNicIpConfiguration; -import com.azure.resourcemanager.network.fluent.models.NetworkInterfaceIpConfigurationInner; - -/** Implementation for NicIPConfiguration for network interfaces associated with virtual machine scale set. */ -class VirtualMachineScaleSetNicIpConfigurationImpl - extends NicIpConfigurationBaseImpl< - VirtualMachineScaleSetNetworkInterfaceImpl, VirtualMachineScaleSetNetworkInterface> - implements VirtualMachineScaleSetNicIpConfiguration { - VirtualMachineScaleSetNicIpConfigurationImpl( - NetworkInterfaceIpConfigurationInner inner, - VirtualMachineScaleSetNetworkInterfaceImpl parent, - NetworkManager networkManager) { - super(inner, parent, networkManager); - } - - // Note: The inner ipConfig contains a property with name 'publicIPAddress' - // which is valid only when the inner is explicitly created i.e. the one - // associated with normal virtual machines. In VMSS case the inner ipConfig - // is implicitly created for the scale set vm instances and 'publicIPAddress' - // property is null. - // -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/VirtualNetworkGatewayConnectionImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/VirtualNetworkGatewayConnectionImpl.java deleted file mode 100644 index 27bf1ec489b3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/VirtualNetworkGatewayConnectionImpl.java +++ /dev/null @@ -1,262 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.management.SubResource; -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.network.fluent.models.ConnectionSharedKeyInner; -import com.azure.resourcemanager.network.models.ExpressRouteCircuit; -import com.azure.resourcemanager.network.models.IpsecPolicy; -import com.azure.resourcemanager.network.models.LocalNetworkGateway; -import com.azure.resourcemanager.network.models.TagsObject; -import com.azure.resourcemanager.network.models.TunnelConnectionHealth; -import com.azure.resourcemanager.network.models.VirtualNetworkGateway; -import com.azure.resourcemanager.network.models.VirtualNetworkGatewayConnection; -import com.azure.resourcemanager.network.models.VirtualNetworkGatewayConnectionStatus; -import com.azure.resourcemanager.network.models.VirtualNetworkGatewayConnectionType; -import com.azure.resourcemanager.network.models.AppliableWithTags; -import com.azure.resourcemanager.network.fluent.models.VirtualNetworkGatewayConnectionInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.GroupableResourceImpl; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; - -import java.util.Collection; -import java.util.Collections; -import reactor.core.publisher.Mono; - -/** Implementation for VirtualNetworkGatewayConnection and its create and update interfaces. */ -public class VirtualNetworkGatewayConnectionImpl - extends GroupableResourceImpl< - VirtualNetworkGatewayConnection, - VirtualNetworkGatewayConnectionInner, - VirtualNetworkGatewayConnectionImpl, - NetworkManager> - implements VirtualNetworkGatewayConnection, - VirtualNetworkGatewayConnection.Definition, - VirtualNetworkGatewayConnection.Update, - AppliableWithTags { - private final VirtualNetworkGateway parent; - private String updateSharedKey; - - VirtualNetworkGatewayConnectionImpl( - String name, VirtualNetworkGatewayImpl parent, VirtualNetworkGatewayConnectionInner inner) { - super(name, inner, parent.manager()); - this.parent = parent; - } - - @Override - public VirtualNetworkGateway parent() { - return parent; - } - - @Override - public String authorizationKey() { - return innerModel().authorizationKey(); - } - - @Override - public String virtualNetworkGateway1Id() { - if (innerModel().virtualNetworkGateway1() == null) { - return null; - } - return innerModel().virtualNetworkGateway1().id(); - } - - @Override - public String virtualNetworkGateway2Id() { - if (innerModel().virtualNetworkGateway2() == null) { - return null; - } - return innerModel().virtualNetworkGateway2().id(); - } - - @Override - public String localNetworkGateway2Id() { - if (innerModel().localNetworkGateway2() == null) { - return null; - } - return innerModel().localNetworkGateway2().id(); - } - - @Override - public VirtualNetworkGatewayConnectionType connectionType() { - return innerModel().connectionType(); - } - - @Override - public int routingWeight() { - return ResourceManagerUtils.toPrimitiveInt(innerModel().routingWeight()); - } - - @Override - public String sharedKey() { - return innerModel().sharedKey(); - } - - @Override - public VirtualNetworkGatewayConnectionStatus connectionStatus() { - return innerModel().connectionStatus(); - } - - @Override - public Collection tunnelConnectionStatus() { - return Collections.unmodifiableCollection(innerModel().tunnelConnectionStatus()); - } - - @Override - public long egressBytesTransferred() { - return ResourceManagerUtils.toPrimitiveLong(innerModel().egressBytesTransferred()); - } - - @Override - public long ingressBytesTransferred() { - return ResourceManagerUtils.toPrimitiveLong(innerModel().ingressBytesTransferred()); - } - - @Override - public String peerId() { - return innerModel().peer() == null ? null : innerModel().peer().id(); - } - - @Override - public boolean isBgpEnabled() { - return ResourceManagerUtils.toPrimitiveBoolean(innerModel().enableBgp()); - } - - @Override - public boolean usePolicyBasedTrafficSelectors() { - return ResourceManagerUtils.toPrimitiveBoolean(innerModel().usePolicyBasedTrafficSelectors()); - } - - @Override - public Collection ipsecPolicies() { - return Collections.unmodifiableCollection(innerModel().ipsecPolicies()); - } - - @Override - public String provisioningState() { - return innerModel().provisioningState(); - } - - @Override - public VirtualNetworkGatewayConnectionImpl withSiteToSite() { - innerModel().withConnectionType(VirtualNetworkGatewayConnectionType.IPSEC); - return this; - } - - @Override - public VirtualNetworkGatewayConnectionImpl withVNetToVNet() { - innerModel().withConnectionType(VirtualNetworkGatewayConnectionType.VNET2VNET); - return this; - } - - @Override - public VirtualNetworkGatewayConnectionImpl withExpressRoute(String circuitId) { - innerModel().withConnectionType(VirtualNetworkGatewayConnectionType.EXPRESS_ROUTE); - innerModel().withPeer(new SubResource().withId(circuitId)); - return this; - } - - @Override - public VirtualNetworkGatewayConnectionImpl withExpressRoute(ExpressRouteCircuit circuit) { - return withExpressRoute(circuit.id()); - } - - @Override - public VirtualNetworkGatewayConnectionImpl withLocalNetworkGateway(LocalNetworkGateway localNetworkGateway) { - innerModel().withLocalNetworkGateway2(localNetworkGateway.innerModel()); - return this; - } - - @Override - public VirtualNetworkGatewayConnectionImpl withSecondVirtualNetworkGateway( - VirtualNetworkGateway virtualNetworkGateway2) { - innerModel().withVirtualNetworkGateway2(virtualNetworkGateway2.innerModel()); - return this; - } - - @Override - public VirtualNetworkGatewayConnectionImpl withSharedKey(String sharedKey) { - if (isInCreateMode()) { - innerModel().withSharedKey(sharedKey); - } else { - updateSharedKey = sharedKey; - } - return this; - } - - @Override - public VirtualNetworkGatewayConnectionImpl withBgp() { - innerModel().withEnableBgp(true); - return this; - } - - @Override - public VirtualNetworkGatewayConnectionImpl withoutBgp() { - innerModel().withEnableBgp(false); - return this; - } - - @Override - public VirtualNetworkGatewayConnectionImpl withAuthorization(String authorizationKey) { - innerModel().withAuthorizationKey(authorizationKey); - return this; - } - - @Override - protected Mono getInnerAsync() { - return myManager - .serviceClient() - .getVirtualNetworkGatewayConnections() - .getByResourceGroupAsync(resourceGroupName(), name()); - } - - @Override - public Mono createResourceAsync() { - beforeCreating(); - return myManager - .serviceClient() - .getVirtualNetworkGatewayConnections() - .createOrUpdateAsync(this.resourceGroupName(), this.name(), this.innerModel()) - .map(innerToFluentMap(this)) - .flatMap(virtualNetworkGatewayConnection -> { - if (updateSharedKey == null) { - return Mono.just(virtualNetworkGatewayConnection); - } - return myManager.serviceClient().getVirtualNetworkGatewayConnections() - .setSharedKeyAsync( - this.resourceGroupName(), - this.name(), - new ConnectionSharedKeyInner().withValue(updateSharedKey)) - .doOnSuccess(inner -> { - updateSharedKey = null; - }) - .then(myManager.serviceClient().getVirtualNetworkGatewayConnections() - .getByResourceGroupAsync(this.resourceGroupName(), this.name()) - .map(innerToFluentMap(this))); - }); - } - - private void beforeCreating() { - innerModel().withVirtualNetworkGateway1(parent.innerModel()); - } - - @Override - public VirtualNetworkGatewayConnectionImpl updateTags() { - return this; - } - - @Override - public VirtualNetworkGatewayConnection applyTags() { - return applyTagsAsync().block(); - } - - @Override - public Mono applyTagsAsync() { - return this - .manager() - .serviceClient() - .getVirtualNetworkGatewayConnections() - .updateTagsAsync(resourceGroupName(), name(), new TagsObject().withTags(innerModel().tags())) - .flatMap(inner -> refreshAsync()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/VirtualNetworkGatewayConnectionsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/VirtualNetworkGatewayConnectionsClientImpl.java deleted file mode 100644 index c173d26ce6ee..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/VirtualNetworkGatewayConnectionsClientImpl.java +++ /dev/null @@ -1,2280 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.VirtualNetworkGatewayConnectionsClient; -import com.azure.resourcemanager.network.fluent.models.ConnectionResetSharedKeyInner; -import com.azure.resourcemanager.network.fluent.models.ConnectionSharedKeyInner; -import com.azure.resourcemanager.network.fluent.models.VirtualNetworkGatewayConnectionInner; -import com.azure.resourcemanager.network.models.TagsObject; -import com.azure.resourcemanager.network.models.VirtualNetworkGatewayConnectionListResult; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in VirtualNetworkGatewayConnectionsClient. - */ -public final class VirtualNetworkGatewayConnectionsClientImpl - implements InnerSupportsGet, - InnerSupportsDelete, - VirtualNetworkGatewayConnectionsClient { - private final ClientLogger logger = new ClientLogger(VirtualNetworkGatewayConnectionsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final VirtualNetworkGatewayConnectionsService service; - - /** The service client containing this operation class. */ - private final NetworkManagementClientImpl client; - - /** - * Initializes an instance of VirtualNetworkGatewayConnectionsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - VirtualNetworkGatewayConnectionsClientImpl(NetworkManagementClientImpl client) { - this.service = - RestProxy - .create( - VirtualNetworkGatewayConnectionsService.class, - client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for NetworkManagementClientVirtualNetworkGatewayConnections to be used by - * the proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "NetworkManagementCli") - private interface VirtualNetworkGatewayConnectionsService { - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections" - + "/{virtualNetworkGatewayConnectionName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VirtualNetworkGatewayConnectionInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections" - + "/{virtualNetworkGatewayConnectionName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections" - + "/{virtualNetworkGatewayConnectionName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections" - + "/{virtualNetworkGatewayConnectionName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> updateTags( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") TagsObject parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections" - + "/{virtualNetworkGatewayConnectionName}/sharedkey") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> setSharedKey( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") ConnectionSharedKeyInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections" - + "/{virtualNetworkGatewayConnectionName}/sharedkey") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getSharedKey( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/connections") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections" - + "/{virtualNetworkGatewayConnectionName}/sharedkey/reset") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> resetSharedKey( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") ConnectionResetSharedKeyInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Creates or updates a virtual network gateway connection in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. - * @param parameters Parameters supplied to the create or update virtual network gateway connection operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String virtualNetworkGatewayConnectionName, - VirtualNetworkGatewayConnectionInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualNetworkGatewayConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualNetworkGatewayConnectionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - virtualNetworkGatewayConnectionName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a virtual network gateway connection in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. - * @param parameters Parameters supplied to the create or update virtual network gateway connection operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String virtualNetworkGatewayConnectionName, - VirtualNetworkGatewayConnectionInner parameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualNetworkGatewayConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualNetworkGatewayConnectionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - virtualNetworkGatewayConnectionName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Creates or updates a virtual network gateway connection in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. - * @param parameters Parameters supplied to the create or update virtual network gateway connection operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, VirtualNetworkGatewayConnectionInner> - beginCreateOrUpdateAsync( - String resourceGroupName, - String virtualNetworkGatewayConnectionName, - VirtualNetworkGatewayConnectionInner parameters) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VirtualNetworkGatewayConnectionInner.class, - VirtualNetworkGatewayConnectionInner.class, - Context.NONE); - } - - /** - * Creates or updates a virtual network gateway connection in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. - * @param parameters Parameters supplied to the create or update virtual network gateway connection operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, VirtualNetworkGatewayConnectionInner> - beginCreateOrUpdateAsync( - String resourceGroupName, - String virtualNetworkGatewayConnectionName, - VirtualNetworkGatewayConnectionInner parameters, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync( - resourceGroupName, virtualNetworkGatewayConnectionName, parameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VirtualNetworkGatewayConnectionInner.class, - VirtualNetworkGatewayConnectionInner.class, - context); - } - - /** - * Creates or updates a virtual network gateway connection in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. - * @param parameters Parameters supplied to the create or update virtual network gateway connection operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VirtualNetworkGatewayConnectionInner> - beginCreateOrUpdate( - String resourceGroupName, - String virtualNetworkGatewayConnectionName, - VirtualNetworkGatewayConnectionInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters) - .getSyncPoller(); - } - - /** - * Creates or updates a virtual network gateway connection in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. - * @param parameters Parameters supplied to the create or update virtual network gateway connection operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VirtualNetworkGatewayConnectionInner> - beginCreateOrUpdate( - String resourceGroupName, - String virtualNetworkGatewayConnectionName, - VirtualNetworkGatewayConnectionInner parameters, - Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, context) - .getSyncPoller(); - } - - /** - * Creates or updates a virtual network gateway connection in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. - * @param parameters Parameters supplied to the create or update virtual network gateway connection operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, - String virtualNetworkGatewayConnectionName, - VirtualNetworkGatewayConnectionInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a virtual network gateway connection in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. - * @param parameters Parameters supplied to the create or update virtual network gateway connection operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, - String virtualNetworkGatewayConnectionName, - VirtualNetworkGatewayConnectionInner parameters, - Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a virtual network gateway connection in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. - * @param parameters Parameters supplied to the create or update virtual network gateway connection operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualNetworkGatewayConnectionInner createOrUpdate( - String resourceGroupName, - String virtualNetworkGatewayConnectionName, - VirtualNetworkGatewayConnectionInner parameters) { - return createOrUpdateAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).block(); - } - - /** - * Creates or updates a virtual network gateway connection in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. - * @param parameters Parameters supplied to the create or update virtual network gateway connection operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualNetworkGatewayConnectionInner createOrUpdate( - String resourceGroupName, - String virtualNetworkGatewayConnectionName, - VirtualNetworkGatewayConnectionInner parameters, - Context context) { - return createOrUpdateAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, context).block(); - } - - /** - * Gets the specified virtual network gateway connection by resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified virtual network gateway connection by resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String virtualNetworkGatewayConnectionName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualNetworkGatewayConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualNetworkGatewayConnectionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - virtualNetworkGatewayConnectionName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the specified virtual network gateway connection by resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified virtual network gateway connection by resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String virtualNetworkGatewayConnectionName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualNetworkGatewayConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualNetworkGatewayConnectionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - virtualNetworkGatewayConnectionName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets the specified virtual network gateway connection by resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified virtual network gateway connection by resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync( - String resourceGroupName, String virtualNetworkGatewayConnectionName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the specified virtual network gateway connection by resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified virtual network gateway connection by resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualNetworkGatewayConnectionInner getByResourceGroup( - String resourceGroupName, String virtualNetworkGatewayConnectionName) { - return getByResourceGroupAsync(resourceGroupName, virtualNetworkGatewayConnectionName).block(); - } - - /** - * Gets the specified virtual network gateway connection by resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified virtual network gateway connection by resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String virtualNetworkGatewayConnectionName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, context) - .block(); - } - - /** - * Deletes the specified virtual network Gateway connection. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync( - String resourceGroupName, String virtualNetworkGatewayConnectionName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualNetworkGatewayConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualNetworkGatewayConnectionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - virtualNetworkGatewayConnectionName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the specified virtual network Gateway connection. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String virtualNetworkGatewayConnectionName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualNetworkGatewayConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualNetworkGatewayConnectionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - virtualNetworkGatewayConnectionName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Deletes the specified virtual network Gateway connection. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String virtualNetworkGatewayConnectionName) { - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deletes the specified virtual network Gateway connection. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String virtualNetworkGatewayConnectionName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes the specified virtual network Gateway connection. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String virtualNetworkGatewayConnectionName) { - return beginDeleteAsync(resourceGroupName, virtualNetworkGatewayConnectionName).getSyncPoller(); - } - - /** - * Deletes the specified virtual network Gateway connection. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String virtualNetworkGatewayConnectionName, Context context) { - return beginDeleteAsync(resourceGroupName, virtualNetworkGatewayConnectionName, context).getSyncPoller(); - } - - /** - * Deletes the specified virtual network Gateway connection. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName) { - return beginDeleteAsync(resourceGroupName, virtualNetworkGatewayConnectionName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified virtual network Gateway connection. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync( - String resourceGroupName, String virtualNetworkGatewayConnectionName, Context context) { - return beginDeleteAsync(resourceGroupName, virtualNetworkGatewayConnectionName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified virtual network Gateway connection. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String virtualNetworkGatewayConnectionName) { - deleteAsync(resourceGroupName, virtualNetworkGatewayConnectionName).block(); - } - - /** - * Deletes the specified virtual network Gateway connection. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String virtualNetworkGatewayConnectionName, Context context) { - deleteAsync(resourceGroupName, virtualNetworkGatewayConnectionName, context).block(); - } - - /** - * Updates a virtual network gateway connection tags. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. - * @param parameters Parameters supplied to update virtual network gateway connection tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateTagsWithResponseAsync( - String resourceGroupName, String virtualNetworkGatewayConnectionName, TagsObject parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualNetworkGatewayConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualNetworkGatewayConnectionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updateTags( - this.client.getEndpoint(), - resourceGroupName, - virtualNetworkGatewayConnectionName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates a virtual network gateway connection tags. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. - * @param parameters Parameters supplied to update virtual network gateway connection tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateTagsWithResponseAsync( - String resourceGroupName, String virtualNetworkGatewayConnectionName, TagsObject parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualNetworkGatewayConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualNetworkGatewayConnectionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updateTags( - this.client.getEndpoint(), - resourceGroupName, - virtualNetworkGatewayConnectionName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Updates a virtual network gateway connection tags. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. - * @param parameters Parameters supplied to update virtual network gateway connection tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, VirtualNetworkGatewayConnectionInner> - beginUpdateTagsAsync( - String resourceGroupName, String virtualNetworkGatewayConnectionName, TagsObject parameters) { - Mono>> mono = - updateTagsWithResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VirtualNetworkGatewayConnectionInner.class, - VirtualNetworkGatewayConnectionInner.class, - Context.NONE); - } - - /** - * Updates a virtual network gateway connection tags. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. - * @param parameters Parameters supplied to update virtual network gateway connection tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, VirtualNetworkGatewayConnectionInner> - beginUpdateTagsAsync( - String resourceGroupName, - String virtualNetworkGatewayConnectionName, - TagsObject parameters, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - updateTagsWithResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VirtualNetworkGatewayConnectionInner.class, - VirtualNetworkGatewayConnectionInner.class, - context); - } - - /** - * Updates a virtual network gateway connection tags. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. - * @param parameters Parameters supplied to update virtual network gateway connection tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VirtualNetworkGatewayConnectionInner> - beginUpdateTags(String resourceGroupName, String virtualNetworkGatewayConnectionName, TagsObject parameters) { - return beginUpdateTagsAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).getSyncPoller(); - } - - /** - * Updates a virtual network gateway connection tags. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. - * @param parameters Parameters supplied to update virtual network gateway connection tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VirtualNetworkGatewayConnectionInner> - beginUpdateTags( - String resourceGroupName, - String virtualNetworkGatewayConnectionName, - TagsObject parameters, - Context context) { - return beginUpdateTagsAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, context) - .getSyncPoller(); - } - - /** - * Updates a virtual network gateway connection tags. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. - * @param parameters Parameters supplied to update virtual network gateway connection tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateTagsAsync( - String resourceGroupName, String virtualNetworkGatewayConnectionName, TagsObject parameters) { - return beginUpdateTagsAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates a virtual network gateway connection tags. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. - * @param parameters Parameters supplied to update virtual network gateway connection tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateTagsAsync( - String resourceGroupName, String virtualNetworkGatewayConnectionName, TagsObject parameters, Context context) { - return beginUpdateTagsAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates a virtual network gateway connection tags. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. - * @param parameters Parameters supplied to update virtual network gateway connection tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualNetworkGatewayConnectionInner updateTags( - String resourceGroupName, String virtualNetworkGatewayConnectionName, TagsObject parameters) { - return updateTagsAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).block(); - } - - /** - * Updates a virtual network gateway connection tags. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. - * @param parameters Parameters supplied to update virtual network gateway connection tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualNetworkGatewayConnectionInner updateTags( - String resourceGroupName, String virtualNetworkGatewayConnectionName, TagsObject parameters, Context context) { - return updateTagsAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, context).block(); - } - - /** - * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key - * for passed virtual network gateway connection in the specified resource group through Network resource provider. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name. - * @param parameters Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation - * throughNetwork resource provider. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for GetConnectionSharedKey API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> setSharedKeyWithResponseAsync( - String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionSharedKeyInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualNetworkGatewayConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualNetworkGatewayConnectionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .setSharedKey( - this.client.getEndpoint(), - resourceGroupName, - virtualNetworkGatewayConnectionName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key - * for passed virtual network gateway connection in the specified resource group through Network resource provider. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name. - * @param parameters Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation - * throughNetwork resource provider. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for GetConnectionSharedKey API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> setSharedKeyWithResponseAsync( - String resourceGroupName, - String virtualNetworkGatewayConnectionName, - ConnectionSharedKeyInner parameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualNetworkGatewayConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualNetworkGatewayConnectionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .setSharedKey( - this.client.getEndpoint(), - resourceGroupName, - virtualNetworkGatewayConnectionName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key - * for passed virtual network gateway connection in the specified resource group through Network resource provider. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name. - * @param parameters Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation - * throughNetwork resource provider. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for GetConnectionSharedKey API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, ConnectionSharedKeyInner> beginSetSharedKeyAsync( - String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionSharedKeyInner parameters) { - Mono>> mono = - setSharedKeyWithResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ConnectionSharedKeyInner.class, - ConnectionSharedKeyInner.class, - Context.NONE); - } - - /** - * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key - * for passed virtual network gateway connection in the specified resource group through Network resource provider. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name. - * @param parameters Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation - * throughNetwork resource provider. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for GetConnectionSharedKey API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, ConnectionSharedKeyInner> beginSetSharedKeyAsync( - String resourceGroupName, - String virtualNetworkGatewayConnectionName, - ConnectionSharedKeyInner parameters, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - setSharedKeyWithResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ConnectionSharedKeyInner.class, - ConnectionSharedKeyInner.class, - context); - } - - /** - * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key - * for passed virtual network gateway connection in the specified resource group through Network resource provider. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name. - * @param parameters Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation - * throughNetwork resource provider. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for GetConnectionSharedKey API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, ConnectionSharedKeyInner> beginSetSharedKey( - String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionSharedKeyInner parameters) { - return beginSetSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters) - .getSyncPoller(); - } - - /** - * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key - * for passed virtual network gateway connection in the specified resource group through Network resource provider. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name. - * @param parameters Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation - * throughNetwork resource provider. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for GetConnectionSharedKey API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, ConnectionSharedKeyInner> beginSetSharedKey( - String resourceGroupName, - String virtualNetworkGatewayConnectionName, - ConnectionSharedKeyInner parameters, - Context context) { - return beginSetSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, context) - .getSyncPoller(); - } - - /** - * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key - * for passed virtual network gateway connection in the specified resource group through Network resource provider. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name. - * @param parameters Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation - * throughNetwork resource provider. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for GetConnectionSharedKey API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono setSharedKeyAsync( - String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionSharedKeyInner parameters) { - return beginSetSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key - * for passed virtual network gateway connection in the specified resource group through Network resource provider. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name. - * @param parameters Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation - * throughNetwork resource provider. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for GetConnectionSharedKey API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono setSharedKeyAsync( - String resourceGroupName, - String virtualNetworkGatewayConnectionName, - ConnectionSharedKeyInner parameters, - Context context) { - return beginSetSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key - * for passed virtual network gateway connection in the specified resource group through Network resource provider. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name. - * @param parameters Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation - * throughNetwork resource provider. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for GetConnectionSharedKey API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ConnectionSharedKeyInner setSharedKey( - String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionSharedKeyInner parameters) { - return setSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).block(); - } - - /** - * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key - * for passed virtual network gateway connection in the specified resource group through Network resource provider. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name. - * @param parameters Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation - * throughNetwork resource provider. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for GetConnectionSharedKey API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ConnectionSharedKeyInner setSharedKey( - String resourceGroupName, - String virtualNetworkGatewayConnectionName, - ConnectionSharedKeyInner parameters, - Context context) { - return setSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, context).block(); - } - - /** - * The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual - * network gateway connection shared key through Network resource provider. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The virtual network gateway connection shared key name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for GetConnectionSharedKey API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getSharedKeyWithResponseAsync( - String resourceGroupName, String virtualNetworkGatewayConnectionName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualNetworkGatewayConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualNetworkGatewayConnectionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getSharedKey( - this.client.getEndpoint(), - resourceGroupName, - virtualNetworkGatewayConnectionName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual - * network gateway connection shared key through Network resource provider. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The virtual network gateway connection shared key name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for GetConnectionSharedKey API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getSharedKeyWithResponseAsync( - String resourceGroupName, String virtualNetworkGatewayConnectionName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualNetworkGatewayConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualNetworkGatewayConnectionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getSharedKey( - this.client.getEndpoint(), - resourceGroupName, - virtualNetworkGatewayConnectionName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual - * network gateway connection shared key through Network resource provider. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The virtual network gateway connection shared key name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for GetConnectionSharedKey API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getSharedKeyAsync( - String resourceGroupName, String virtualNetworkGatewayConnectionName) { - return getSharedKeyWithResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual - * network gateway connection shared key through Network resource provider. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The virtual network gateway connection shared key name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for GetConnectionSharedKey API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ConnectionSharedKeyInner getSharedKey(String resourceGroupName, String virtualNetworkGatewayConnectionName) { - return getSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName).block(); - } - - /** - * The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual - * network gateway connection shared key through Network resource provider. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The virtual network gateway connection shared key name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for GetConnectionSharedKey API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getSharedKeyWithResponse( - String resourceGroupName, String virtualNetworkGatewayConnectionName, Context context) { - return getSharedKeyWithResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, context).block(); - } - - /** - * The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections - * created. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the ListVirtualNetworkGatewayConnections API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections - * created. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the ListVirtualNetworkGatewayConnections API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections - * created. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the ListVirtualNetworkGatewayConnections API service call. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections - * created. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the ListVirtualNetworkGatewayConnections API service call. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync( - String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections - * created. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the ListVirtualNetworkGatewayConnections API service call. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections - * created. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the ListVirtualNetworkGatewayConnections API service call. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup( - String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared - * key for passed virtual network gateway connection in the specified resource group through Network resource - * provider. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. - * @param parameters Parameters supplied to the begin reset virtual network gateway connection shared key operation - * through network resource provider. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the virtual network connection reset shared key. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> resetSharedKeyWithResponseAsync( - String resourceGroupName, - String virtualNetworkGatewayConnectionName, - ConnectionResetSharedKeyInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualNetworkGatewayConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualNetworkGatewayConnectionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .resetSharedKey( - this.client.getEndpoint(), - resourceGroupName, - virtualNetworkGatewayConnectionName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared - * key for passed virtual network gateway connection in the specified resource group through Network resource - * provider. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. - * @param parameters Parameters supplied to the begin reset virtual network gateway connection shared key operation - * through network resource provider. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the virtual network connection reset shared key. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> resetSharedKeyWithResponseAsync( - String resourceGroupName, - String virtualNetworkGatewayConnectionName, - ConnectionResetSharedKeyInner parameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualNetworkGatewayConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualNetworkGatewayConnectionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .resetSharedKey( - this.client.getEndpoint(), - resourceGroupName, - virtualNetworkGatewayConnectionName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared - * key for passed virtual network gateway connection in the specified resource group through Network resource - * provider. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. - * @param parameters Parameters supplied to the begin reset virtual network gateway connection shared key operation - * through network resource provider. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the virtual network connection reset shared key. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, ConnectionResetSharedKeyInner> - beginResetSharedKeyAsync( - String resourceGroupName, - String virtualNetworkGatewayConnectionName, - ConnectionResetSharedKeyInner parameters) { - Mono>> mono = - resetSharedKeyWithResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ConnectionResetSharedKeyInner.class, - ConnectionResetSharedKeyInner.class, - Context.NONE); - } - - /** - * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared - * key for passed virtual network gateway connection in the specified resource group through Network resource - * provider. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. - * @param parameters Parameters supplied to the begin reset virtual network gateway connection shared key operation - * through network resource provider. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the virtual network connection reset shared key. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, ConnectionResetSharedKeyInner> - beginResetSharedKeyAsync( - String resourceGroupName, - String virtualNetworkGatewayConnectionName, - ConnectionResetSharedKeyInner parameters, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - resetSharedKeyWithResponseAsync( - resourceGroupName, virtualNetworkGatewayConnectionName, parameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ConnectionResetSharedKeyInner.class, - ConnectionResetSharedKeyInner.class, - context); - } - - /** - * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared - * key for passed virtual network gateway connection in the specified resource group through Network resource - * provider. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. - * @param parameters Parameters supplied to the begin reset virtual network gateway connection shared key operation - * through network resource provider. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the virtual network connection reset shared key. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, ConnectionResetSharedKeyInner> beginResetSharedKey( - String resourceGroupName, - String virtualNetworkGatewayConnectionName, - ConnectionResetSharedKeyInner parameters) { - return beginResetSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters) - .getSyncPoller(); - } - - /** - * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared - * key for passed virtual network gateway connection in the specified resource group through Network resource - * provider. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. - * @param parameters Parameters supplied to the begin reset virtual network gateway connection shared key operation - * through network resource provider. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the virtual network connection reset shared key. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, ConnectionResetSharedKeyInner> beginResetSharedKey( - String resourceGroupName, - String virtualNetworkGatewayConnectionName, - ConnectionResetSharedKeyInner parameters, - Context context) { - return beginResetSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, context) - .getSyncPoller(); - } - - /** - * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared - * key for passed virtual network gateway connection in the specified resource group through Network resource - * provider. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. - * @param parameters Parameters supplied to the begin reset virtual network gateway connection shared key operation - * through network resource provider. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the virtual network connection reset shared key. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono resetSharedKeyAsync( - String resourceGroupName, - String virtualNetworkGatewayConnectionName, - ConnectionResetSharedKeyInner parameters) { - return beginResetSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared - * key for passed virtual network gateway connection in the specified resource group through Network resource - * provider. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. - * @param parameters Parameters supplied to the begin reset virtual network gateway connection shared key operation - * through network resource provider. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the virtual network connection reset shared key. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono resetSharedKeyAsync( - String resourceGroupName, - String virtualNetworkGatewayConnectionName, - ConnectionResetSharedKeyInner parameters, - Context context) { - return beginResetSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared - * key for passed virtual network gateway connection in the specified resource group through Network resource - * provider. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. - * @param parameters Parameters supplied to the begin reset virtual network gateway connection shared key operation - * through network resource provider. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the virtual network connection reset shared key. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ConnectionResetSharedKeyInner resetSharedKey( - String resourceGroupName, - String virtualNetworkGatewayConnectionName, - ConnectionResetSharedKeyInner parameters) { - return resetSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).block(); - } - - /** - * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared - * key for passed virtual network gateway connection in the specified resource group through Network resource - * provider. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. - * @param parameters Parameters supplied to the begin reset virtual network gateway connection shared key operation - * through network resource provider. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the virtual network connection reset shared key. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ConnectionResetSharedKeyInner resetSharedKey( - String resourceGroupName, - String virtualNetworkGatewayConnectionName, - ConnectionResetSharedKeyInner parameters, - Context context) { - return resetSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the ListVirtualNetworkGatewayConnections API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the ListVirtualNetworkGatewayConnections API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/VirtualNetworkGatewayConnectionsImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/VirtualNetworkGatewayConnectionsImpl.java deleted file mode 100644 index 93b21bbd9f53..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/VirtualNetworkGatewayConnectionsImpl.java +++ /dev/null @@ -1,141 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.network.fluent.VirtualNetworkGatewayConnectionsClient; -import com.azure.resourcemanager.network.fluent.models.ConnectionSharedKeyInner; -import com.azure.resourcemanager.network.fluent.models.VirtualNetworkGatewayConnectionInner; -import com.azure.resourcemanager.network.models.VirtualNetworkGateway; -import com.azure.resourcemanager.network.models.VirtualNetworkGatewayConnection; -import com.azure.resourcemanager.network.models.VirtualNetworkGatewayConnections; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.GroupableResourcesImpl; -import com.azure.resourcemanager.resources.fluentcore.utils.PagedConverter; -import reactor.core.publisher.Mono; - -/** The implementation of VirtualNetworkGatewayConnections. */ -class VirtualNetworkGatewayConnectionsImpl - extends GroupableResourcesImpl< - VirtualNetworkGatewayConnection, - VirtualNetworkGatewayConnectionImpl, - VirtualNetworkGatewayConnectionInner, - VirtualNetworkGatewayConnectionsClient, - NetworkManager> - implements VirtualNetworkGatewayConnections { - - private final VirtualNetworkGatewayImpl parent; - - VirtualNetworkGatewayConnectionsImpl(final VirtualNetworkGatewayImpl parent) { - super(parent.manager().serviceClient().getVirtualNetworkGatewayConnections(), parent.manager()); - this.parent = parent; - } - - @Override - protected VirtualNetworkGatewayConnectionImpl wrapModel(String name) { - return new VirtualNetworkGatewayConnectionImpl(name, parent, new VirtualNetworkGatewayConnectionInner()) - .withRegion(parent.regionName()) - .withExistingResourceGroup(parent.resourceGroupName()); - } - - @Override - protected VirtualNetworkGatewayConnectionImpl wrapModel(VirtualNetworkGatewayConnectionInner inner) { - if (inner == null) { - return null; - } - return new VirtualNetworkGatewayConnectionImpl(inner.name(), parent, inner); - } - - @Override - public VirtualNetworkGatewayConnectionImpl define(String name) { - return wrapModel(name); - } - - @Override - public void deleteByName(String name) { - deleteByNameAsync(name).block(); - } - - @Override - public Mono deleteByNameAsync(String name) { - return this.inner().deleteAsync(parent.resourceGroupName(), name); - } - - @Override - public PagedIterable list() { - return new PagedIterable<>(this.listAsync()); - } - - @Override - public VirtualNetworkGatewayConnection getByName(String name) { - VirtualNetworkGatewayConnectionInner inner = - this - .manager() - .serviceClient() - .getVirtualNetworkGatewayConnections() - .getByResourceGroup(this.parent().resourceGroupName(), name); - return new VirtualNetworkGatewayConnectionImpl(name, parent, inner); - } - - @Override - public VirtualNetworkGateway parent() { - return this.parent; - } - - @Override - public PagedFlux listAsync() { - return PagedConverter.mapPage(PagedConverter.mergePagedFlux(this.manager().resourceManager().resourceGroups().listAsync(), rg -> - inner().listByResourceGroupAsync(rg.name())), this::wrapModel); - } - - @Override - protected Mono getInnerAsync(String resourceGroupName, String name) { - return inner().getByResourceGroupAsync(resourceGroupName, name); - } - - @Override - protected Mono deleteInnerAsync(String resourceGroupName, String name) { - return inner().deleteAsync(resourceGroupName, name); - } - - @Override - public Mono getByNameAsync(String name) { - return inner().getByResourceGroupAsync(parent.resourceGroupName(), name).map(this::wrapModel); - } - - @Override - public String getSharedKeyById(String id) { - return getSharedKeyByIdAsync(id).block(); - } - - @Override - public Mono getSharedKeyByIdAsync(String id) { - return inner().getSharedKeyAsync(ResourceUtils.groupFromResourceId(id), ResourceUtils.nameFromResourceId(id)) - .map(ConnectionSharedKeyInner::value); - } - - @Override - public String setSharedKeyById(String id, String sharedKey) { - return setSharedKeyByIdAsync(id, sharedKey).block(); - } - - @Override - public Mono setSharedKeyByIdAsync(String id, String sharedKey) { - return setSharedKeyByNameAsync(ResourceUtils.nameFromResourceId(id), sharedKey); - } - - @Override - public String setSharedKeyByName(String name, String sharedKey) { - return setSharedKeyByNameAsync(name, sharedKey).block(); - } - - @Override - public Mono setSharedKeyByNameAsync(String name, String sharedKey) { - return inner().setSharedKeyAsync( - this.parent().resourceGroupName(), name, new ConnectionSharedKeyInner().withValue(sharedKey)) - .map(ConnectionSharedKeyInner::value); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/VirtualNetworkGatewayImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/VirtualNetworkGatewayImpl.java deleted file mode 100644 index 8d1e7dd6e53d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/VirtualNetworkGatewayImpl.java +++ /dev/null @@ -1,462 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.network.models.BgpSettings; -import com.azure.resourcemanager.network.models.Network; -import com.azure.resourcemanager.network.models.PublicIpAddress; -import com.azure.resourcemanager.network.models.TagsObject; -import com.azure.resourcemanager.network.models.VirtualNetworkGateway; -import com.azure.resourcemanager.network.models.VirtualNetworkGatewayConnection; -import com.azure.resourcemanager.network.models.VirtualNetworkGatewayConnections; -import com.azure.resourcemanager.network.models.VirtualNetworkGatewayIpConfiguration; -import com.azure.resourcemanager.network.models.VirtualNetworkGatewaySku; -import com.azure.resourcemanager.network.models.VirtualNetworkGatewaySkuName; -import com.azure.resourcemanager.network.models.VirtualNetworkGatewaySkuTier; -import com.azure.resourcemanager.network.models.VirtualNetworkGatewayType; -import com.azure.resourcemanager.network.models.VpnClientConfiguration; -import com.azure.resourcemanager.network.models.VpnClientParameters; -import com.azure.resourcemanager.network.models.VpnType; -import com.azure.resourcemanager.network.fluent.models.VirtualNetworkGatewayConnectionListEntityInner; -import com.azure.resourcemanager.network.fluent.models.VirtualNetworkGatewayIpConfigurationInner; -import com.azure.resourcemanager.network.fluent.models.VirtualNetworkGatewayInner; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import com.azure.resourcemanager.resources.models.ResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.models.Resource; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.utils.PagedConverter; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -import java.util.Collection; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.TreeMap; - -/** Implementation for VirtualNetworkGateway and its create and update interfaces. */ -class VirtualNetworkGatewayImpl - extends GroupableParentResourceWithTagsImpl< - VirtualNetworkGateway, VirtualNetworkGatewayInner, VirtualNetworkGatewayImpl, NetworkManager> - implements VirtualNetworkGateway, VirtualNetworkGateway.Definition, VirtualNetworkGateway.Update { - private static final String GATEWAY_SUBNET = "GatewaySubnet"; - private final ClientLogger logger = new ClientLogger(getClass()); - - private Map ipConfigs; - private VirtualNetworkGatewayConnections connections; - private Creatable creatableNetwork; - private Creatable creatablePip; - - VirtualNetworkGatewayImpl( - String name, final VirtualNetworkGatewayInner innerModel, final NetworkManager networkManager) { - super(name, innerModel, networkManager); - } - - @Override - public VirtualNetworkGatewayImpl withExpressRoute() { - innerModel().withGatewayType(VirtualNetworkGatewayType.EXPRESS_ROUTE); - return this; - } - - @Override - public VirtualNetworkGatewayImpl withRouteBasedVpn() { - innerModel().withGatewayType(VirtualNetworkGatewayType.VPN); - innerModel().withVpnType(VpnType.ROUTE_BASED); - return this; - } - - @Override - public VirtualNetworkGatewayImpl withPolicyBasedVpn() { - innerModel().withGatewayType(VirtualNetworkGatewayType.VPN); - innerModel().withVpnType(VpnType.POLICY_BASED); - return this; - } - - @Override - public VirtualNetworkGatewayImpl withSku(VirtualNetworkGatewaySkuName skuName) { - VirtualNetworkGatewaySku sku = - new VirtualNetworkGatewaySku() - .withName(skuName) - // same sku tier as sku name - .withTier(VirtualNetworkGatewaySkuTier.fromString(skuName.toString())); - this.innerModel().withSku(sku); - return this; - } - - @Override - public VirtualNetworkGatewayImpl withNewNetwork(Creatable creatable) { - this.creatableNetwork = creatable; - return this; - } - - @Override - public VirtualNetworkGatewayImpl withNewNetwork(String name, String addressSpace, String subnetAddressSpaceCidr) { - Network.DefinitionStages.WithGroup definitionWithGroup = - this.manager().networks().define(name).withRegion(this.regionName()); - - Network.DefinitionStages.WithCreate definitionAfterGroup; - if (this.newGroup() != null) { - definitionAfterGroup = definitionWithGroup.withNewResourceGroup(this.newGroup()); - } else { - definitionAfterGroup = definitionWithGroup.withExistingResourceGroup(this.resourceGroupName()); - } - Creatable network = - definitionAfterGroup.withAddressSpace(addressSpace).withSubnet(GATEWAY_SUBNET, subnetAddressSpaceCidr); - return withNewNetwork(network); - } - - @Override - public VirtualNetworkGatewayImpl withNewNetwork(String addressSpaceCidr, String subnetAddressSpaceCidr) { - withNewNetwork( - this.manager().resourceManager().internalContext().randomResourceName("vnet", 8), - addressSpaceCidr, - subnetAddressSpaceCidr); - return this; - } - - @Override - public VirtualNetworkGatewayImpl withExistingNetwork(Network network) { - ensureDefaultIPConfig().withExistingSubnet(network, GATEWAY_SUBNET); - return this; - } - - @Override - public VirtualNetworkGatewayImpl withExistingPublicIpAddress(PublicIpAddress publicIPAddress) { - ensureDefaultIPConfig().withExistingPublicIpAddress(publicIPAddress); - return this; - } - - @Override - public VirtualNetworkGatewayImpl withExistingPublicIpAddress(String resourceId) { - ensureDefaultIPConfig().withExistingPublicIpAddress(resourceId); - return this; - } - - @Override - public VirtualNetworkGatewayImpl withNewPublicIpAddress(Creatable creatable) { - this.creatablePip = creatable; - return this; - } - - @Override - public VirtualNetworkGatewayImpl withNewPublicIpAddress() { - final String pipName = this.manager().resourceManager().internalContext().randomResourceName("pip", 9); - this.creatablePip = - this - .manager() - .publicIpAddresses() - .define(pipName) - .withRegion(this.regionName()) - .withExistingResourceGroup(this.resourceGroupName()); - return this; - } - - @Override - public VirtualNetworkGatewayImpl withoutBgp() { - innerModel().withBgpSettings(null); - innerModel().withEnableBgp(false); - return this; - } - - @Override - public VirtualNetworkGatewayImpl withBgp(long asn, String bgpPeeringAddress) { - innerModel().withEnableBgp(true); - ensureBgpSettings().withAsn(asn).withBgpPeeringAddress(bgpPeeringAddress); - return this; - } - - void attachPointToSiteConfiguration(PointToSiteConfigurationImpl pointToSiteConfiguration) { - innerModel().withVpnClientConfiguration(pointToSiteConfiguration.innerModel()); - } - - @Override - public void reset() { - resetAsync().block(); - } - - @Override - public Mono resetAsync() { - return this - .manager() - .serviceClient() - .getVirtualNetworkGateways() - .resetAsync(resourceGroupName(), name()) - .map( - inner -> { - VirtualNetworkGatewayImpl.this.setInner(inner); - return Mono.empty(); - }) - .then(); - } - - @Override - public PagedIterable listConnections() { - return new PagedIterable<>(this.listConnectionsAsync()); - } - - @Override - public PagedFlux listConnectionsAsync() { - PagedFlux connectionInners = - this - .manager() - .serviceClient() - .getVirtualNetworkGateways() - .listConnectionsAsync(this.resourceGroupName(), this.name()); - return PagedConverter - .flatMapPage(connectionInners, connectionInner -> connections().getByIdAsync(connectionInner.id())); - } - - @Override - public String generateVpnProfile() { - return this - .manager() - .serviceClient() - .getVirtualNetworkGateways() - .generateVpnProfile(resourceGroupName(), name(), new VpnClientParameters()); - } - - @Override - public Mono generateVpnProfileAsync() { - return this - .manager() - .serviceClient() - .getVirtualNetworkGateways() - .generateVpnProfileAsync(resourceGroupName(), name(), new VpnClientParameters()); - } - - @Override - protected Mono applyTagsToInnerAsync() { - return this - .manager() - .serviceClient() - .getVirtualNetworkGateways() - .updateTagsAsync(resourceGroupName(), name(), new TagsObject().withTags(innerModel().tags())); - } - - @Override - public VirtualNetworkGatewayConnections connections() { - if (connections == null) { - connections = new VirtualNetworkGatewayConnectionsImpl(this); - } - return connections; - } - - @Override - public VirtualNetworkGatewayType gatewayType() { - return innerModel().gatewayType(); - } - - @Override - public VpnType vpnType() { - return innerModel().vpnType(); - } - - @Override - public boolean isBgpEnabled() { - return ResourceManagerUtils.toPrimitiveBoolean(innerModel().enableBgp()); - } - - @Override - public boolean activeActive() { - return ResourceManagerUtils.toPrimitiveBoolean(innerModel().active()); - } - - @Override - public String gatewayDefaultSiteResourceId() { - return innerModel().gatewayDefaultSite() == null ? null : innerModel().gatewayDefaultSite().id(); - } - - @Override - public VirtualNetworkGatewaySku sku() { - return this.innerModel().sku(); - } - - public VpnClientConfiguration vpnClientConfiguration() { - return innerModel().vpnClientConfiguration(); - } - - @Override - public BgpSettings bgpSettings() { - return innerModel().bgpSettings(); - } - - @Override - public Collection ipConfigurations() { - return Collections.unmodifiableCollection(ipConfigs.values()); - } - - Creatable newGroup() { - return this.creatableGroup; - } - - @Override - protected void initializeChildrenFromInner() { - initializeIPConfigsFromInner(); - } - - @Override - public Mono refreshAsync() { - return super - .refreshAsync() - .map( - virtualNetworkGateway -> { - VirtualNetworkGatewayImpl impl = (VirtualNetworkGatewayImpl) virtualNetworkGateway; - impl.initializeChildrenFromInner(); - return impl; - }); - } - - @Override - protected Mono getInnerAsync() { - return this - .manager() - .serviceClient() - .getVirtualNetworkGateways() - .getByResourceGroupAsync(this.resourceGroupName(), this.name()); - } - - VirtualNetworkGatewayImpl withConfig(VirtualNetworkGatewayIpConfigurationImpl config) { - if (config != null) { - this.ipConfigs.put(config.name(), config); - } - return this; - } - - private VirtualNetworkGatewayIpConfigurationImpl defineIPConfiguration(String name) { - VirtualNetworkGatewayIpConfiguration ipConfig = this.ipConfigs.get(name); - if (ipConfig == null) { - VirtualNetworkGatewayIpConfigurationInner inner = - new VirtualNetworkGatewayIpConfigurationInner().withName(name); - return new VirtualNetworkGatewayIpConfigurationImpl(inner, this); - } else { - return (VirtualNetworkGatewayIpConfigurationImpl) ipConfig; - } - } - - private void initializeIPConfigsFromInner() { - this.ipConfigs = new TreeMap<>(); - List inners = this.innerModel().ipConfigurations(); - if (inners != null) { - for (VirtualNetworkGatewayIpConfigurationInner inner : inners) { - VirtualNetworkGatewayIpConfigurationImpl config = - new VirtualNetworkGatewayIpConfigurationImpl(inner, this); - this.ipConfigs.put(inner.name(), config); - } - } - } - - @Override - protected void beforeCreating() { - // Reset and update IP configs - ensureDefaultIPConfig(); - this.innerModel().withIpConfigurations(innersFromWrappers(this.ipConfigs.values())); - } - - private BgpSettings ensureBgpSettings() { - if (innerModel().bgpSettings() == null) { - innerModel().withBgpSettings(new BgpSettings()); - } - return innerModel().bgpSettings(); - } - - private VirtualNetworkGatewayIpConfigurationImpl ensureDefaultIPConfig() { - VirtualNetworkGatewayIpConfigurationImpl ipConfig = - (VirtualNetworkGatewayIpConfigurationImpl) defaultIPConfiguration(); - if (ipConfig == null) { - String name = this.manager().resourceManager().internalContext().randomResourceName("ipcfg", 11); - ipConfig = this.defineIPConfiguration(name); - ipConfig.attach(); - } - return ipConfig; - } - - private Creatable ensureDefaultPipDefinition() { - if (this.creatablePip == null) { - final String pipName = this.manager().resourceManager().internalContext().randomResourceName("pip", 9); - this.creatablePip = - this - .manager() - .publicIpAddresses() - .define(pipName) - .withRegion(this.regionName()) - .withExistingResourceGroup(this.resourceGroupName()); - } - return this.creatablePip; - } - - VirtualNetworkGatewayIpConfiguration defaultIPConfiguration() { - // Default means the only one - if (this.ipConfigs.size() == 1) { - return this.ipConfigs.values().iterator().next(); - } else { - return null; - } - } - - @Override - protected Mono createInner() { - // Determine if a default public frontend PIP should be created - final VirtualNetworkGatewayIpConfigurationImpl defaultIPConfig = ensureDefaultIPConfig(); - final Mono pipObservable; - if (defaultIPConfig.publicIpAddressId() == null) { - // If public ip not specified, then create a default PIP - pipObservable = - ensureDefaultPipDefinition() - .createAsync() - .map( - publicIPAddress -> { - defaultIPConfig.withExistingPublicIpAddress(publicIPAddress); - return publicIPAddress; - }); - } else { - // If existing public ip address specified, skip creating the PIP - pipObservable = Mono.empty(); - } - - final Mono networkObservable; - // Determine if default VNet should be created - if (defaultIPConfig.subnetName() != null) { - // ...and no need to create VNet - networkObservable = Mono.empty(); // ...and don't create another VNet - } else if (creatableNetwork != null) { - // But if default IP config does not have a subnet specified, then create a VNet - networkObservable = - creatableNetwork - .createAsync() - .map( - network -> { - // ... and assign the created VNet to the default IP config - defaultIPConfig.withExistingSubnet(network, GATEWAY_SUBNET); - return network; - }); - } else { - throw logger.logExceptionAsError(new IllegalStateException("Creatable Network should not be null")); - } - - return Flux - .merge(networkObservable, pipObservable) - .last(Resource.DUMMY) - .flatMap( - resource -> - VirtualNetworkGatewayImpl - .this - .manager() - .serviceClient() - .getVirtualNetworkGateways() - .createOrUpdateAsync(resourceGroupName(), name(), innerModel())); - } - - @Override - public PointToSiteConfigurationImpl definePointToSiteConfiguration() { - return new PointToSiteConfigurationImpl(new VpnClientConfiguration(), this); - } - - @Override - public PointToSiteConfigurationImpl updatePointToSiteConfiguration() { - return new PointToSiteConfigurationImpl(innerModel().vpnClientConfiguration(), this); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/VirtualNetworkGatewayIpConfigurationImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/VirtualNetworkGatewayIpConfigurationImpl.java deleted file mode 100644 index 1a324f36fc37..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/VirtualNetworkGatewayIpConfigurationImpl.java +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.management.SubResource; -import com.azure.resourcemanager.network.models.IpAllocationMethod; -import com.azure.resourcemanager.network.models.Network; -import com.azure.resourcemanager.network.models.PublicIpAddress; -import com.azure.resourcemanager.network.models.Subnet; -import com.azure.resourcemanager.network.models.VirtualNetworkGateway; -import com.azure.resourcemanager.network.models.VirtualNetworkGatewayIpConfiguration; -import com.azure.resourcemanager.network.fluent.models.VirtualNetworkGatewayIpConfigurationInner; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils; -import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.ChildResourceImpl; - -/** Implementation for VirtualNetworkGatewayIpConfiguration. */ -class VirtualNetworkGatewayIpConfigurationImpl - extends ChildResourceImpl< - VirtualNetworkGatewayIpConfigurationInner, VirtualNetworkGatewayImpl, VirtualNetworkGateway> - implements VirtualNetworkGatewayIpConfiguration, - VirtualNetworkGatewayIpConfiguration.Definition, - VirtualNetworkGatewayIpConfiguration.UpdateDefinition, - VirtualNetworkGatewayIpConfiguration.Update { - - VirtualNetworkGatewayIpConfigurationImpl( - VirtualNetworkGatewayIpConfigurationInner inner, VirtualNetworkGatewayImpl parent) { - super(inner, parent); - } - - @Override - public String name() { - return this.innerModel().name(); - } - - @Override - public String publicIpAddressId() { - if (this.innerModel().publicIpAddress() != null) { - return this.innerModel().publicIpAddress().id(); - } else { - return null; - } - } - - @Override - public String networkId() { - SubResource subnetRef = this.innerModel().subnet(); - if (subnetRef != null) { - return ResourceUtils.parentResourceIdFromResourceId(subnetRef.id()); - } else { - return null; - } - } - - @Override - public String subnetName() { - SubResource subnetRef = this.innerModel().subnet(); - if (subnetRef != null) { - return ResourceUtils.nameFromResourceId(subnetRef.id()); - } else { - return null; - } - } - - @Override - public IpAllocationMethod privateIpAllocationMethod() { - return innerModel().privateIpAllocationMethod(); - } - - @Override - public Subnet getSubnet() { - return Utils.getAssociatedSubnet(this.parent().manager(), this.innerModel().subnet()); - } - - @Override - public VirtualNetworkGatewayIpConfigurationImpl withExistingSubnet(String networkId, String subnetName) { - SubResource subnetRef = new SubResource().withId(networkId + "/subnets/" + subnetName); - this.innerModel().withSubnet(subnetRef); - return this; - } - - @Override - public VirtualNetworkGatewayIpConfigurationImpl withExistingSubnet(Subnet subnet) { - return this.withExistingSubnet(subnet.parent().id(), subnet.name()); - } - - @Override - public VirtualNetworkGatewayIpConfigurationImpl withExistingSubnet(Network network, String subnetName) { - return this.withExistingSubnet(network.id(), subnetName); - } - - @Override - public VirtualNetworkGatewayImpl attach() { - return this.parent().withConfig(this); - } - - @Override - public VirtualNetworkGatewayIpConfigurationImpl withExistingPublicIpAddress(PublicIpAddress pip) { - return this.withExistingPublicIpAddress(pip.id()); - } - - @Override - public VirtualNetworkGatewayIpConfigurationImpl withExistingPublicIpAddress(String resourceId) { - SubResource pipRef = new SubResource().withId(resourceId); - this.innerModel().withPublicIpAddress(pipRef); - return this; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/VirtualNetworkGatewaysClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/VirtualNetworkGatewaysClientImpl.java deleted file mode 100644 index b9e25a519372..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/VirtualNetworkGatewaysClientImpl.java +++ /dev/null @@ -1,5012 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.VirtualNetworkGatewaysClient; -import com.azure.resourcemanager.network.fluent.models.BgpPeerStatusListResultInner; -import com.azure.resourcemanager.network.fluent.models.GatewayRouteListResultInner; -import com.azure.resourcemanager.network.fluent.models.VirtualNetworkGatewayConnectionListEntityInner; -import com.azure.resourcemanager.network.fluent.models.VirtualNetworkGatewayInner; -import com.azure.resourcemanager.network.fluent.models.VpnClientIPsecParametersInner; -import com.azure.resourcemanager.network.models.TagsObject; -import com.azure.resourcemanager.network.models.VirtualNetworkGatewayListConnectionsResult; -import com.azure.resourcemanager.network.models.VirtualNetworkGatewayListResult; -import com.azure.resourcemanager.network.models.VpnClientParameters; -import com.azure.resourcemanager.network.models.VpnDeviceScriptParameters; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in VirtualNetworkGatewaysClient. */ -public final class VirtualNetworkGatewaysClientImpl - implements InnerSupportsGet, InnerSupportsDelete, VirtualNetworkGatewaysClient { - private final ClientLogger logger = new ClientLogger(VirtualNetworkGatewaysClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final VirtualNetworkGatewaysService service; - - /** The service client containing this operation class. */ - private final NetworkManagementClientImpl client; - - /** - * Initializes an instance of VirtualNetworkGatewaysClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - VirtualNetworkGatewaysClientImpl(NetworkManagementClientImpl client) { - this.service = - RestProxy - .create(VirtualNetworkGatewaysService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for NetworkManagementClientVirtualNetworkGateways to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "NetworkManagementCli") - private interface VirtualNetworkGatewaysService { - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/virtualNetworkGateways/{virtualNetworkGatewayName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualNetworkGatewayName") String virtualNetworkGatewayName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VirtualNetworkGatewayInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/virtualNetworkGateways/{virtualNetworkGatewayName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualNetworkGatewayName") String virtualNetworkGatewayName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/virtualNetworkGateways/{virtualNetworkGatewayName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualNetworkGatewayName") String virtualNetworkGatewayName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/virtualNetworkGateways/{virtualNetworkGatewayName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> updateTags( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualNetworkGatewayName") String virtualNetworkGatewayName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") TagsObject parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/virtualNetworkGateways") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/virtualNetworkGateways/{virtualNetworkGatewayName}/connections") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listConnections( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualNetworkGatewayName") String virtualNetworkGatewayName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/virtualNetworkGateways/{virtualNetworkGatewayName}/reset") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> reset( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualNetworkGatewayName") String virtualNetworkGatewayName, - @QueryParam("gatewayVip") String gatewayVip, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/virtualNetworkGateways/{virtualNetworkGatewayName}/resetvpnclientsharedkey") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> resetVpnClientSharedKey( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualNetworkGatewayName") String virtualNetworkGatewayName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> generatevpnclientpackage( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualNetworkGatewayName") String virtualNetworkGatewayName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VpnClientParameters parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnprofile") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> generateVpnProfile( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualNetworkGatewayName") String virtualNetworkGatewayName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VpnClientParameters parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/virtualNetworkGateways/{virtualNetworkGatewayName}/getvpnprofilepackageurl") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> getVpnProfilePackageUrl( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualNetworkGatewayName") String virtualNetworkGatewayName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/virtualNetworkGateways/{virtualNetworkGatewayName}/getBgpPeerStatus") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> getBgpPeerStatus( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualNetworkGatewayName") String virtualNetworkGatewayName, - @QueryParam("peer") String peer, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/virtualNetworkGateways/{virtualNetworkGatewayName}/supportedvpndevices") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> supportedVpnDevices( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualNetworkGatewayName") String virtualNetworkGatewayName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/virtualNetworkGateways/{virtualNetworkGatewayName}/getLearnedRoutes") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> getLearnedRoutes( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualNetworkGatewayName") String virtualNetworkGatewayName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/virtualNetworkGateways/{virtualNetworkGatewayName}/getAdvertisedRoutes") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> getAdvertisedRoutes( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualNetworkGatewayName") String virtualNetworkGatewayName, - @QueryParam("peer") String peer, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/virtualNetworkGateways/{virtualNetworkGatewayName}/setvpnclientipsecparameters") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> setVpnclientIpsecParameters( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualNetworkGatewayName") String virtualNetworkGatewayName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VpnClientIPsecParametersInner vpnclientIpsecParams, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/virtualNetworkGateways/{virtualNetworkGatewayName}/getvpnclientipsecparameters") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> getVpnclientIpsecParameters( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualNetworkGatewayName") String virtualNetworkGatewayName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections" - + "/{virtualNetworkGatewayConnectionName}/vpndeviceconfigurationscript") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> vpnDeviceConfigurationScript( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VpnDeviceScriptParameters parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listConnectionsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Creates or updates a virtual network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to create or update virtual network gateway operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualNetworkGatewayName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualNetworkGatewayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - virtualNetworkGatewayName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a virtual network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to create or update virtual network gateway operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String virtualNetworkGatewayName, - VirtualNetworkGatewayInner parameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualNetworkGatewayName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualNetworkGatewayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - virtualNetworkGatewayName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Creates or updates a virtual network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to create or update virtual network gateway operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, VirtualNetworkGatewayInner> beginCreateOrUpdateAsync( - String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VirtualNetworkGatewayInner.class, - VirtualNetworkGatewayInner.class, - Context.NONE); - } - - /** - * Creates or updates a virtual network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to create or update virtual network gateway operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, VirtualNetworkGatewayInner> beginCreateOrUpdateAsync( - String resourceGroupName, - String virtualNetworkGatewayName, - VirtualNetworkGatewayInner parameters, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VirtualNetworkGatewayInner.class, - VirtualNetworkGatewayInner.class, - context); - } - - /** - * Creates or updates a virtual network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to create or update virtual network gateway operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VirtualNetworkGatewayInner> beginCreateOrUpdate( - String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, virtualNetworkGatewayName, parameters).getSyncPoller(); - } - - /** - * Creates or updates a virtual network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to create or update virtual network gateway operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VirtualNetworkGatewayInner> beginCreateOrUpdate( - String resourceGroupName, - String virtualNetworkGatewayName, - VirtualNetworkGatewayInner parameters, - Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, virtualNetworkGatewayName, parameters, context) - .getSyncPoller(); - } - - /** - * Creates or updates a virtual network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to create or update virtual network gateway operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, virtualNetworkGatewayName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a virtual network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to create or update virtual network gateway operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, - String virtualNetworkGatewayName, - VirtualNetworkGatewayInner parameters, - Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, virtualNetworkGatewayName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a virtual network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to create or update virtual network gateway operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualNetworkGatewayInner createOrUpdate( - String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters) { - return createOrUpdateAsync(resourceGroupName, virtualNetworkGatewayName, parameters).block(); - } - - /** - * Creates or updates a virtual network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to create or update virtual network gateway operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualNetworkGatewayInner createOrUpdate( - String resourceGroupName, - String virtualNetworkGatewayName, - VirtualNetworkGatewayInner parameters, - Context context) { - return createOrUpdateAsync(resourceGroupName, virtualNetworkGatewayName, parameters, context).block(); - } - - /** - * Gets the specified virtual network gateway by resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified virtual network gateway by resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String virtualNetworkGatewayName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualNetworkGatewayName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualNetworkGatewayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - virtualNetworkGatewayName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the specified virtual network gateway by resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified virtual network gateway by resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String virtualNetworkGatewayName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualNetworkGatewayName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualNetworkGatewayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - virtualNetworkGatewayName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets the specified virtual network gateway by resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified virtual network gateway by resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync( - String resourceGroupName, String virtualNetworkGatewayName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, virtualNetworkGatewayName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the specified virtual network gateway by resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified virtual network gateway by resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualNetworkGatewayInner getByResourceGroup(String resourceGroupName, String virtualNetworkGatewayName) { - return getByResourceGroupAsync(resourceGroupName, virtualNetworkGatewayName).block(); - } - - /** - * Gets the specified virtual network gateway by resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified virtual network gateway by resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String virtualNetworkGatewayName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, virtualNetworkGatewayName, context).block(); - } - - /** - * Deletes the specified virtual network gateway. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync( - String resourceGroupName, String virtualNetworkGatewayName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualNetworkGatewayName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualNetworkGatewayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - virtualNetworkGatewayName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the specified virtual network gateway. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String virtualNetworkGatewayName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualNetworkGatewayName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualNetworkGatewayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - virtualNetworkGatewayName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Deletes the specified virtual network gateway. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String virtualNetworkGatewayName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, virtualNetworkGatewayName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deletes the specified virtual network gateway. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String virtualNetworkGatewayName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, virtualNetworkGatewayName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes the specified virtual network gateway. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete(String resourceGroupName, String virtualNetworkGatewayName) { - return beginDeleteAsync(resourceGroupName, virtualNetworkGatewayName).getSyncPoller(); - } - - /** - * Deletes the specified virtual network gateway. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String virtualNetworkGatewayName, Context context) { - return beginDeleteAsync(resourceGroupName, virtualNetworkGatewayName, context).getSyncPoller(); - } - - /** - * Deletes the specified virtual network gateway. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String virtualNetworkGatewayName) { - return beginDeleteAsync(resourceGroupName, virtualNetworkGatewayName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified virtual network gateway. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String virtualNetworkGatewayName, Context context) { - return beginDeleteAsync(resourceGroupName, virtualNetworkGatewayName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified virtual network gateway. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String virtualNetworkGatewayName) { - deleteAsync(resourceGroupName, virtualNetworkGatewayName).block(); - } - - /** - * Deletes the specified virtual network gateway. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String virtualNetworkGatewayName, Context context) { - deleteAsync(resourceGroupName, virtualNetworkGatewayName, context).block(); - } - - /** - * Updates a virtual network gateway tags. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to update virtual network gateway tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateTagsWithResponseAsync( - String resourceGroupName, String virtualNetworkGatewayName, TagsObject parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualNetworkGatewayName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualNetworkGatewayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updateTags( - this.client.getEndpoint(), - resourceGroupName, - virtualNetworkGatewayName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates a virtual network gateway tags. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to update virtual network gateway tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateTagsWithResponseAsync( - String resourceGroupName, String virtualNetworkGatewayName, TagsObject parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualNetworkGatewayName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualNetworkGatewayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updateTags( - this.client.getEndpoint(), - resourceGroupName, - virtualNetworkGatewayName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Updates a virtual network gateway tags. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to update virtual network gateway tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, VirtualNetworkGatewayInner> beginUpdateTagsAsync( - String resourceGroupName, String virtualNetworkGatewayName, TagsObject parameters) { - Mono>> mono = - updateTagsWithResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VirtualNetworkGatewayInner.class, - VirtualNetworkGatewayInner.class, - Context.NONE); - } - - /** - * Updates a virtual network gateway tags. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to update virtual network gateway tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, VirtualNetworkGatewayInner> beginUpdateTagsAsync( - String resourceGroupName, String virtualNetworkGatewayName, TagsObject parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - updateTagsWithResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VirtualNetworkGatewayInner.class, - VirtualNetworkGatewayInner.class, - context); - } - - /** - * Updates a virtual network gateway tags. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to update virtual network gateway tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VirtualNetworkGatewayInner> beginUpdateTags( - String resourceGroupName, String virtualNetworkGatewayName, TagsObject parameters) { - return beginUpdateTagsAsync(resourceGroupName, virtualNetworkGatewayName, parameters).getSyncPoller(); - } - - /** - * Updates a virtual network gateway tags. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to update virtual network gateway tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VirtualNetworkGatewayInner> beginUpdateTags( - String resourceGroupName, String virtualNetworkGatewayName, TagsObject parameters, Context context) { - return beginUpdateTagsAsync(resourceGroupName, virtualNetworkGatewayName, parameters, context).getSyncPoller(); - } - - /** - * Updates a virtual network gateway tags. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to update virtual network gateway tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateTagsAsync( - String resourceGroupName, String virtualNetworkGatewayName, TagsObject parameters) { - return beginUpdateTagsAsync(resourceGroupName, virtualNetworkGatewayName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates a virtual network gateway tags. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to update virtual network gateway tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateTagsAsync( - String resourceGroupName, String virtualNetworkGatewayName, TagsObject parameters, Context context) { - return beginUpdateTagsAsync(resourceGroupName, virtualNetworkGatewayName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates a virtual network gateway tags. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to update virtual network gateway tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualNetworkGatewayInner updateTags( - String resourceGroupName, String virtualNetworkGatewayName, TagsObject parameters) { - return updateTagsAsync(resourceGroupName, virtualNetworkGatewayName, parameters).block(); - } - - /** - * Updates a virtual network gateway tags. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to update virtual network gateway tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualNetworkGatewayInner updateTags( - String resourceGroupName, String virtualNetworkGatewayName, TagsObject parameters, Context context) { - return updateTagsAsync(resourceGroupName, virtualNetworkGatewayName, parameters, context).block(); - } - - /** - * Gets all virtual network gateways by resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all virtual network gateways by resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all virtual network gateways by resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all virtual network gateways by resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all virtual network gateways by resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all virtual network gateways by resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets all virtual network gateways by resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all virtual network gateways by resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all virtual network gateways by resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all virtual network gateways by resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * Gets all virtual network gateways by resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all virtual network gateways by resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * Gets all the connections in a virtual network gateway. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the connections in a virtual network gateway. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listConnectionsSinglePageAsync( - String resourceGroupName, String virtualNetworkGatewayName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualNetworkGatewayName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualNetworkGatewayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listConnections( - this.client.getEndpoint(), - resourceGroupName, - virtualNetworkGatewayName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all the connections in a virtual network gateway. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the connections in a virtual network gateway. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listConnectionsSinglePageAsync( - String resourceGroupName, String virtualNetworkGatewayName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualNetworkGatewayName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualNetworkGatewayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listConnections( - this.client.getEndpoint(), - resourceGroupName, - virtualNetworkGatewayName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all the connections in a virtual network gateway. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the connections in a virtual network gateway. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listConnectionsAsync( - String resourceGroupName, String virtualNetworkGatewayName) { - return new PagedFlux<>( - () -> listConnectionsSinglePageAsync(resourceGroupName, virtualNetworkGatewayName), - nextLink -> listConnectionsNextSinglePageAsync(nextLink)); - } - - /** - * Gets all the connections in a virtual network gateway. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the connections in a virtual network gateway. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listConnectionsAsync( - String resourceGroupName, String virtualNetworkGatewayName, Context context) { - return new PagedFlux<>( - () -> listConnectionsSinglePageAsync(resourceGroupName, virtualNetworkGatewayName, context), - nextLink -> listConnectionsNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all the connections in a virtual network gateway. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the connections in a virtual network gateway. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listConnections( - String resourceGroupName, String virtualNetworkGatewayName) { - return new PagedIterable<>(listConnectionsAsync(resourceGroupName, virtualNetworkGatewayName)); - } - - /** - * Gets all the connections in a virtual network gateway. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the connections in a virtual network gateway. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listConnections( - String resourceGroupName, String virtualNetworkGatewayName, Context context) { - return new PagedIterable<>(listConnectionsAsync(resourceGroupName, virtualNetworkGatewayName, context)); - } - - /** - * Resets the primary of the virtual network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param gatewayVip Virtual network gateway vip address supplied to the begin reset of the active-active feature - * enabled gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> resetWithResponseAsync( - String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualNetworkGatewayName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualNetworkGatewayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .reset( - this.client.getEndpoint(), - resourceGroupName, - virtualNetworkGatewayName, - gatewayVip, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Resets the primary of the virtual network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param gatewayVip Virtual network gateway vip address supplied to the begin reset of the active-active feature - * enabled gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> resetWithResponseAsync( - String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualNetworkGatewayName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualNetworkGatewayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .reset( - this.client.getEndpoint(), - resourceGroupName, - virtualNetworkGatewayName, - gatewayVip, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Resets the primary of the virtual network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param gatewayVip Virtual network gateway vip address supplied to the begin reset of the active-active feature - * enabled gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, VirtualNetworkGatewayInner> beginResetAsync( - String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip) { - Mono>> mono = - resetWithResponseAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VirtualNetworkGatewayInner.class, - VirtualNetworkGatewayInner.class, - Context.NONE); - } - - /** - * Resets the primary of the virtual network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param gatewayVip Virtual network gateway vip address supplied to the begin reset of the active-active feature - * enabled gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, VirtualNetworkGatewayInner> beginResetAsync( - String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - resetWithResponseAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VirtualNetworkGatewayInner.class, - VirtualNetworkGatewayInner.class, - context); - } - - /** - * Resets the primary of the virtual network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param gatewayVip Virtual network gateway vip address supplied to the begin reset of the active-active feature - * enabled gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VirtualNetworkGatewayInner> beginReset( - String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip) { - return beginResetAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip).getSyncPoller(); - } - - /** - * Resets the primary of the virtual network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param gatewayVip Virtual network gateway vip address supplied to the begin reset of the active-active feature - * enabled gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VirtualNetworkGatewayInner> beginReset( - String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip, Context context) { - return beginResetAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip, context).getSyncPoller(); - } - - /** - * Resets the primary of the virtual network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param gatewayVip Virtual network gateway vip address supplied to the begin reset of the active-active feature - * enabled gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono resetAsync( - String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip) { - return beginResetAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Resets the primary of the virtual network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono resetAsync(String resourceGroupName, String virtualNetworkGatewayName) { - final String gatewayVip = null; - return beginResetAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Resets the primary of the virtual network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param gatewayVip Virtual network gateway vip address supplied to the begin reset of the active-active feature - * enabled gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono resetAsync( - String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip, Context context) { - return beginResetAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Resets the primary of the virtual network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param gatewayVip Virtual network gateway vip address supplied to the begin reset of the active-active feature - * enabled gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualNetworkGatewayInner reset( - String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip) { - return resetAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip).block(); - } - - /** - * Resets the primary of the virtual network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualNetworkGatewayInner reset(String resourceGroupName, String virtualNetworkGatewayName) { - final String gatewayVip = null; - return resetAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip).block(); - } - - /** - * Resets the primary of the virtual network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param gatewayVip Virtual network gateway vip address supplied to the begin reset of the active-active feature - * enabled gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a common class for general resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualNetworkGatewayInner reset( - String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip, Context context) { - return resetAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip, context).block(); - } - - /** - * Resets the VPN client shared key of the virtual network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> resetVpnClientSharedKeyWithResponseAsync( - String resourceGroupName, String virtualNetworkGatewayName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualNetworkGatewayName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualNetworkGatewayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - return FluxUtil - .withContext( - context -> - service - .resetVpnClientSharedKey( - this.client.getEndpoint(), - resourceGroupName, - virtualNetworkGatewayName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Resets the VPN client shared key of the virtual network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> resetVpnClientSharedKeyWithResponseAsync( - String resourceGroupName, String virtualNetworkGatewayName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualNetworkGatewayName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualNetworkGatewayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - context = this.client.mergeContext(context); - return service - .resetVpnClientSharedKey( - this.client.getEndpoint(), - resourceGroupName, - virtualNetworkGatewayName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Resets the VPN client shared key of the virtual network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginResetVpnClientSharedKeyAsync( - String resourceGroupName, String virtualNetworkGatewayName) { - Mono>> mono = - resetVpnClientSharedKeyWithResponseAsync(resourceGroupName, virtualNetworkGatewayName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Resets the VPN client shared key of the virtual network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginResetVpnClientSharedKeyAsync( - String resourceGroupName, String virtualNetworkGatewayName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - resetVpnClientSharedKeyWithResponseAsync(resourceGroupName, virtualNetworkGatewayName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Resets the VPN client shared key of the virtual network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginResetVpnClientSharedKey( - String resourceGroupName, String virtualNetworkGatewayName) { - return beginResetVpnClientSharedKeyAsync(resourceGroupName, virtualNetworkGatewayName).getSyncPoller(); - } - - /** - * Resets the VPN client shared key of the virtual network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginResetVpnClientSharedKey( - String resourceGroupName, String virtualNetworkGatewayName, Context context) { - return beginResetVpnClientSharedKeyAsync(resourceGroupName, virtualNetworkGatewayName, context).getSyncPoller(); - } - - /** - * Resets the VPN client shared key of the virtual network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono resetVpnClientSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayName) { - return beginResetVpnClientSharedKeyAsync(resourceGroupName, virtualNetworkGatewayName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Resets the VPN client shared key of the virtual network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono resetVpnClientSharedKeyAsync( - String resourceGroupName, String virtualNetworkGatewayName, Context context) { - return beginResetVpnClientSharedKeyAsync(resourceGroupName, virtualNetworkGatewayName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Resets the VPN client shared key of the virtual network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void resetVpnClientSharedKey(String resourceGroupName, String virtualNetworkGatewayName) { - resetVpnClientSharedKeyAsync(resourceGroupName, virtualNetworkGatewayName).block(); - } - - /** - * Resets the VPN client shared key of the virtual network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void resetVpnClientSharedKey(String resourceGroupName, String virtualNetworkGatewayName, Context context) { - resetVpnClientSharedKeyAsync(resourceGroupName, virtualNetworkGatewayName, context).block(); - } - - /** - * Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> generatevpnclientpackageWithResponseAsync( - String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualNetworkGatewayName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualNetworkGatewayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .generatevpnclientpackage( - this.client.getEndpoint(), - resourceGroupName, - virtualNetworkGatewayName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> generatevpnclientpackageWithResponseAsync( - String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualNetworkGatewayName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualNetworkGatewayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .generatevpnclientpackage( - this.client.getEndpoint(), - resourceGroupName, - virtualNetworkGatewayName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, String> beginGeneratevpnclientpackageAsync( - String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { - Mono>> mono = - generatevpnclientpackageWithResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), String.class, String.class, this.client.getContext()); - } - - /** - * Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, String> beginGeneratevpnclientpackageAsync( - String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - generatevpnclientpackageWithResponseAsync( - resourceGroupName, virtualNetworkGatewayName, parameters, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), String.class, String.class, context); - } - - /** - * Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, String> beginGeneratevpnclientpackage( - String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { - return beginGeneratevpnclientpackageAsync(resourceGroupName, virtualNetworkGatewayName, parameters) - .getSyncPoller(); - } - - /** - * Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, String> beginGeneratevpnclientpackage( - String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters, Context context) { - return beginGeneratevpnclientpackageAsync(resourceGroupName, virtualNetworkGatewayName, parameters, context) - .getSyncPoller(); - } - - /** - * Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono generatevpnclientpackageAsync( - String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { - return beginGeneratevpnclientpackageAsync(resourceGroupName, virtualNetworkGatewayName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono generatevpnclientpackageAsync( - String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters, Context context) { - return beginGeneratevpnclientpackageAsync(resourceGroupName, virtualNetworkGatewayName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public String generatevpnclientpackage( - String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { - return generatevpnclientpackageAsync(resourceGroupName, virtualNetworkGatewayName, parameters).block(); - } - - /** - * Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public String generatevpnclientpackage( - String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters, Context context) { - return generatevpnclientpackageAsync(resourceGroupName, virtualNetworkGatewayName, parameters, context).block(); - } - - /** - * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for - * IKEV2 and radius based authentication. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> generateVpnProfileWithResponseAsync( - String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualNetworkGatewayName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualNetworkGatewayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .generateVpnProfile( - this.client.getEndpoint(), - resourceGroupName, - virtualNetworkGatewayName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for - * IKEV2 and radius based authentication. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> generateVpnProfileWithResponseAsync( - String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualNetworkGatewayName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualNetworkGatewayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .generateVpnProfile( - this.client.getEndpoint(), - resourceGroupName, - virtualNetworkGatewayName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for - * IKEV2 and radius based authentication. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, String> beginGenerateVpnProfileAsync( - String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { - Mono>> mono = - generateVpnProfileWithResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), String.class, String.class, this.client.getContext()); - } - - /** - * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for - * IKEV2 and radius based authentication. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, String> beginGenerateVpnProfileAsync( - String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - generateVpnProfileWithResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), String.class, String.class, context); - } - - /** - * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for - * IKEV2 and radius based authentication. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, String> beginGenerateVpnProfile( - String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { - return beginGenerateVpnProfileAsync(resourceGroupName, virtualNetworkGatewayName, parameters).getSyncPoller(); - } - - /** - * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for - * IKEV2 and radius based authentication. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, String> beginGenerateVpnProfile( - String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters, Context context) { - return beginGenerateVpnProfileAsync(resourceGroupName, virtualNetworkGatewayName, parameters, context) - .getSyncPoller(); - } - - /** - * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for - * IKEV2 and radius based authentication. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono generateVpnProfileAsync( - String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { - return beginGenerateVpnProfileAsync(resourceGroupName, virtualNetworkGatewayName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for - * IKEV2 and radius based authentication. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono generateVpnProfileAsync( - String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters, Context context) { - return beginGenerateVpnProfileAsync(resourceGroupName, virtualNetworkGatewayName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for - * IKEV2 and radius based authentication. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public String generateVpnProfile( - String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { - return generateVpnProfileAsync(resourceGroupName, virtualNetworkGatewayName, parameters).block(); - } - - /** - * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for - * IKEV2 and radius based authentication. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public String generateVpnProfile( - String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters, Context context) { - return generateVpnProfileAsync(resourceGroupName, virtualNetworkGatewayName, parameters, context).block(); - } - - /** - * Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The - * profile needs to be generated first using generateVpnProfile. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> getVpnProfilePackageUrlWithResponseAsync( - String resourceGroupName, String virtualNetworkGatewayName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualNetworkGatewayName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualNetworkGatewayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getVpnProfilePackageUrl( - this.client.getEndpoint(), - resourceGroupName, - virtualNetworkGatewayName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The - * profile needs to be generated first using generateVpnProfile. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> getVpnProfilePackageUrlWithResponseAsync( - String resourceGroupName, String virtualNetworkGatewayName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualNetworkGatewayName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualNetworkGatewayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getVpnProfilePackageUrl( - this.client.getEndpoint(), - resourceGroupName, - virtualNetworkGatewayName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The - * profile needs to be generated first using generateVpnProfile. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, String> beginGetVpnProfilePackageUrlAsync( - String resourceGroupName, String virtualNetworkGatewayName) { - Mono>> mono = - getVpnProfilePackageUrlWithResponseAsync(resourceGroupName, virtualNetworkGatewayName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), String.class, String.class, this.client.getContext()); - } - - /** - * Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The - * profile needs to be generated first using generateVpnProfile. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, String> beginGetVpnProfilePackageUrlAsync( - String resourceGroupName, String virtualNetworkGatewayName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - getVpnProfilePackageUrlWithResponseAsync(resourceGroupName, virtualNetworkGatewayName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), String.class, String.class, context); - } - - /** - * Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The - * profile needs to be generated first using generateVpnProfile. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, String> beginGetVpnProfilePackageUrl( - String resourceGroupName, String virtualNetworkGatewayName) { - return beginGetVpnProfilePackageUrlAsync(resourceGroupName, virtualNetworkGatewayName).getSyncPoller(); - } - - /** - * Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The - * profile needs to be generated first using generateVpnProfile. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, String> beginGetVpnProfilePackageUrl( - String resourceGroupName, String virtualNetworkGatewayName, Context context) { - return beginGetVpnProfilePackageUrlAsync(resourceGroupName, virtualNetworkGatewayName, context).getSyncPoller(); - } - - /** - * Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The - * profile needs to be generated first using generateVpnProfile. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getVpnProfilePackageUrlAsync(String resourceGroupName, String virtualNetworkGatewayName) { - return beginGetVpnProfilePackageUrlAsync(resourceGroupName, virtualNetworkGatewayName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The - * profile needs to be generated first using generateVpnProfile. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getVpnProfilePackageUrlAsync( - String resourceGroupName, String virtualNetworkGatewayName, Context context) { - return beginGetVpnProfilePackageUrlAsync(resourceGroupName, virtualNetworkGatewayName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The - * profile needs to be generated first using generateVpnProfile. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public String getVpnProfilePackageUrl(String resourceGroupName, String virtualNetworkGatewayName) { - return getVpnProfilePackageUrlAsync(resourceGroupName, virtualNetworkGatewayName).block(); - } - - /** - * Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The - * profile needs to be generated first using generateVpnProfile. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public String getVpnProfilePackageUrl(String resourceGroupName, String virtualNetworkGatewayName, Context context) { - return getVpnProfilePackageUrlAsync(resourceGroupName, virtualNetworkGatewayName, context).block(); - } - - /** - * The GetBgpPeerStatus operation retrieves the status of all BGP peers. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param peer The IP address of the peer to retrieve the status of. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for list BGP peer status API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> getBgpPeerStatusWithResponseAsync( - String resourceGroupName, String virtualNetworkGatewayName, String peer) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualNetworkGatewayName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualNetworkGatewayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getBgpPeerStatus( - this.client.getEndpoint(), - resourceGroupName, - virtualNetworkGatewayName, - peer, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * The GetBgpPeerStatus operation retrieves the status of all BGP peers. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param peer The IP address of the peer to retrieve the status of. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for list BGP peer status API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> getBgpPeerStatusWithResponseAsync( - String resourceGroupName, String virtualNetworkGatewayName, String peer, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualNetworkGatewayName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualNetworkGatewayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getBgpPeerStatus( - this.client.getEndpoint(), - resourceGroupName, - virtualNetworkGatewayName, - peer, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * The GetBgpPeerStatus operation retrieves the status of all BGP peers. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param peer The IP address of the peer to retrieve the status of. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for list BGP peer status API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, BgpPeerStatusListResultInner> - beginGetBgpPeerStatusAsync(String resourceGroupName, String virtualNetworkGatewayName, String peer) { - Mono>> mono = - getBgpPeerStatusWithResponseAsync(resourceGroupName, virtualNetworkGatewayName, peer); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - BgpPeerStatusListResultInner.class, - BgpPeerStatusListResultInner.class, - Context.NONE); - } - - /** - * The GetBgpPeerStatus operation retrieves the status of all BGP peers. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param peer The IP address of the peer to retrieve the status of. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for list BGP peer status API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, BgpPeerStatusListResultInner> - beginGetBgpPeerStatusAsync( - String resourceGroupName, String virtualNetworkGatewayName, String peer, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - getBgpPeerStatusWithResponseAsync(resourceGroupName, virtualNetworkGatewayName, peer, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - BgpPeerStatusListResultInner.class, - BgpPeerStatusListResultInner.class, - context); - } - - /** - * The GetBgpPeerStatus operation retrieves the status of all BGP peers. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param peer The IP address of the peer to retrieve the status of. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for list BGP peer status API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, BgpPeerStatusListResultInner> beginGetBgpPeerStatus( - String resourceGroupName, String virtualNetworkGatewayName, String peer) { - return beginGetBgpPeerStatusAsync(resourceGroupName, virtualNetworkGatewayName, peer).getSyncPoller(); - } - - /** - * The GetBgpPeerStatus operation retrieves the status of all BGP peers. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param peer The IP address of the peer to retrieve the status of. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for list BGP peer status API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, BgpPeerStatusListResultInner> beginGetBgpPeerStatus( - String resourceGroupName, String virtualNetworkGatewayName, String peer, Context context) { - return beginGetBgpPeerStatusAsync(resourceGroupName, virtualNetworkGatewayName, peer, context).getSyncPoller(); - } - - /** - * The GetBgpPeerStatus operation retrieves the status of all BGP peers. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param peer The IP address of the peer to retrieve the status of. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for list BGP peer status API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getBgpPeerStatusAsync( - String resourceGroupName, String virtualNetworkGatewayName, String peer) { - return beginGetBgpPeerStatusAsync(resourceGroupName, virtualNetworkGatewayName, peer) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * The GetBgpPeerStatus operation retrieves the status of all BGP peers. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for list BGP peer status API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getBgpPeerStatusAsync( - String resourceGroupName, String virtualNetworkGatewayName) { - final String peer = null; - return beginGetBgpPeerStatusAsync(resourceGroupName, virtualNetworkGatewayName, peer) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * The GetBgpPeerStatus operation retrieves the status of all BGP peers. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param peer The IP address of the peer to retrieve the status of. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for list BGP peer status API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getBgpPeerStatusAsync( - String resourceGroupName, String virtualNetworkGatewayName, String peer, Context context) { - return beginGetBgpPeerStatusAsync(resourceGroupName, virtualNetworkGatewayName, peer, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * The GetBgpPeerStatus operation retrieves the status of all BGP peers. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param peer The IP address of the peer to retrieve the status of. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for list BGP peer status API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BgpPeerStatusListResultInner getBgpPeerStatus( - String resourceGroupName, String virtualNetworkGatewayName, String peer) { - return getBgpPeerStatusAsync(resourceGroupName, virtualNetworkGatewayName, peer).block(); - } - - /** - * The GetBgpPeerStatus operation retrieves the status of all BGP peers. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for list BGP peer status API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BgpPeerStatusListResultInner getBgpPeerStatus(String resourceGroupName, String virtualNetworkGatewayName) { - final String peer = null; - return getBgpPeerStatusAsync(resourceGroupName, virtualNetworkGatewayName, peer).block(); - } - - /** - * The GetBgpPeerStatus operation retrieves the status of all BGP peers. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param peer The IP address of the peer to retrieve the status of. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for list BGP peer status API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BgpPeerStatusListResultInner getBgpPeerStatus( - String resourceGroupName, String virtualNetworkGatewayName, String peer, Context context) { - return getBgpPeerStatusAsync(resourceGroupName, virtualNetworkGatewayName, peer, context).block(); - } - - /** - * Gets a xml format representation for supported vpn devices. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a xml format representation for supported vpn devices. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> supportedVpnDevicesWithResponseAsync( - String resourceGroupName, String virtualNetworkGatewayName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualNetworkGatewayName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualNetworkGatewayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .supportedVpnDevices( - this.client.getEndpoint(), - resourceGroupName, - virtualNetworkGatewayName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a xml format representation for supported vpn devices. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a xml format representation for supported vpn devices. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> supportedVpnDevicesWithResponseAsync( - String resourceGroupName, String virtualNetworkGatewayName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualNetworkGatewayName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualNetworkGatewayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .supportedVpnDevices( - this.client.getEndpoint(), - resourceGroupName, - virtualNetworkGatewayName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets a xml format representation for supported vpn devices. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a xml format representation for supported vpn devices. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono supportedVpnDevicesAsync(String resourceGroupName, String virtualNetworkGatewayName) { - return supportedVpnDevicesWithResponseAsync(resourceGroupName, virtualNetworkGatewayName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a xml format representation for supported vpn devices. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a xml format representation for supported vpn devices. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public String supportedVpnDevices(String resourceGroupName, String virtualNetworkGatewayName) { - return supportedVpnDevicesAsync(resourceGroupName, virtualNetworkGatewayName).block(); - } - - /** - * Gets a xml format representation for supported vpn devices. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a xml format representation for supported vpn devices. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response supportedVpnDevicesWithResponse( - String resourceGroupName, String virtualNetworkGatewayName, Context context) { - return supportedVpnDevicesWithResponseAsync(resourceGroupName, virtualNetworkGatewayName, context).block(); - } - - /** - * This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from - * BGP peers. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of virtual network gateway routes. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> getLearnedRoutesWithResponseAsync( - String resourceGroupName, String virtualNetworkGatewayName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualNetworkGatewayName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualNetworkGatewayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getLearnedRoutes( - this.client.getEndpoint(), - resourceGroupName, - virtualNetworkGatewayName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from - * BGP peers. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of virtual network gateway routes. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> getLearnedRoutesWithResponseAsync( - String resourceGroupName, String virtualNetworkGatewayName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualNetworkGatewayName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualNetworkGatewayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getLearnedRoutes( - this.client.getEndpoint(), - resourceGroupName, - virtualNetworkGatewayName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from - * BGP peers. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of virtual network gateway routes. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, GatewayRouteListResultInner> beginGetLearnedRoutesAsync( - String resourceGroupName, String virtualNetworkGatewayName) { - Mono>> mono = - getLearnedRoutesWithResponseAsync(resourceGroupName, virtualNetworkGatewayName); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - GatewayRouteListResultInner.class, - GatewayRouteListResultInner.class, - Context.NONE); - } - - /** - * This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from - * BGP peers. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of virtual network gateway routes. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, GatewayRouteListResultInner> beginGetLearnedRoutesAsync( - String resourceGroupName, String virtualNetworkGatewayName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - getLearnedRoutesWithResponseAsync(resourceGroupName, virtualNetworkGatewayName, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - GatewayRouteListResultInner.class, - GatewayRouteListResultInner.class, - context); - } - - /** - * This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from - * BGP peers. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of virtual network gateway routes. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, GatewayRouteListResultInner> beginGetLearnedRoutes( - String resourceGroupName, String virtualNetworkGatewayName) { - return beginGetLearnedRoutesAsync(resourceGroupName, virtualNetworkGatewayName).getSyncPoller(); - } - - /** - * This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from - * BGP peers. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of virtual network gateway routes. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, GatewayRouteListResultInner> beginGetLearnedRoutes( - String resourceGroupName, String virtualNetworkGatewayName, Context context) { - return beginGetLearnedRoutesAsync(resourceGroupName, virtualNetworkGatewayName, context).getSyncPoller(); - } - - /** - * This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from - * BGP peers. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of virtual network gateway routes. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getLearnedRoutesAsync( - String resourceGroupName, String virtualNetworkGatewayName) { - return beginGetLearnedRoutesAsync(resourceGroupName, virtualNetworkGatewayName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from - * BGP peers. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of virtual network gateway routes. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getLearnedRoutesAsync( - String resourceGroupName, String virtualNetworkGatewayName, Context context) { - return beginGetLearnedRoutesAsync(resourceGroupName, virtualNetworkGatewayName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from - * BGP peers. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of virtual network gateway routes. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GatewayRouteListResultInner getLearnedRoutes(String resourceGroupName, String virtualNetworkGatewayName) { - return getLearnedRoutesAsync(resourceGroupName, virtualNetworkGatewayName).block(); - } - - /** - * This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from - * BGP peers. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of virtual network gateway routes. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GatewayRouteListResultInner getLearnedRoutes( - String resourceGroupName, String virtualNetworkGatewayName, Context context) { - return getLearnedRoutesAsync(resourceGroupName, virtualNetworkGatewayName, context).block(); - } - - /** - * This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param peer The IP address of the peer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of virtual network gateway routes. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> getAdvertisedRoutesWithResponseAsync( - String resourceGroupName, String virtualNetworkGatewayName, String peer) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualNetworkGatewayName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualNetworkGatewayName is required and cannot be null.")); - } - if (peer == null) { - return Mono.error(new IllegalArgumentException("Parameter peer is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getAdvertisedRoutes( - this.client.getEndpoint(), - resourceGroupName, - virtualNetworkGatewayName, - peer, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param peer The IP address of the peer. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of virtual network gateway routes. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> getAdvertisedRoutesWithResponseAsync( - String resourceGroupName, String virtualNetworkGatewayName, String peer, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualNetworkGatewayName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualNetworkGatewayName is required and cannot be null.")); - } - if (peer == null) { - return Mono.error(new IllegalArgumentException("Parameter peer is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getAdvertisedRoutes( - this.client.getEndpoint(), - resourceGroupName, - virtualNetworkGatewayName, - peer, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param peer The IP address of the peer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of virtual network gateway routes. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, GatewayRouteListResultInner> - beginGetAdvertisedRoutesAsync(String resourceGroupName, String virtualNetworkGatewayName, String peer) { - Mono>> mono = - getAdvertisedRoutesWithResponseAsync(resourceGroupName, virtualNetworkGatewayName, peer); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - GatewayRouteListResultInner.class, - GatewayRouteListResultInner.class, - Context.NONE); - } - - /** - * This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param peer The IP address of the peer. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of virtual network gateway routes. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, GatewayRouteListResultInner> - beginGetAdvertisedRoutesAsync( - String resourceGroupName, String virtualNetworkGatewayName, String peer, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - getAdvertisedRoutesWithResponseAsync(resourceGroupName, virtualNetworkGatewayName, peer, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - GatewayRouteListResultInner.class, - GatewayRouteListResultInner.class, - context); - } - - /** - * This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param peer The IP address of the peer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of virtual network gateway routes. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, GatewayRouteListResultInner> beginGetAdvertisedRoutes( - String resourceGroupName, String virtualNetworkGatewayName, String peer) { - return beginGetAdvertisedRoutesAsync(resourceGroupName, virtualNetworkGatewayName, peer).getSyncPoller(); - } - - /** - * This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param peer The IP address of the peer. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of virtual network gateway routes. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, GatewayRouteListResultInner> beginGetAdvertisedRoutes( - String resourceGroupName, String virtualNetworkGatewayName, String peer, Context context) { - return beginGetAdvertisedRoutesAsync(resourceGroupName, virtualNetworkGatewayName, peer, context) - .getSyncPoller(); - } - - /** - * This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param peer The IP address of the peer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of virtual network gateway routes. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAdvertisedRoutesAsync( - String resourceGroupName, String virtualNetworkGatewayName, String peer) { - return beginGetAdvertisedRoutesAsync(resourceGroupName, virtualNetworkGatewayName, peer) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param peer The IP address of the peer. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of virtual network gateway routes. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAdvertisedRoutesAsync( - String resourceGroupName, String virtualNetworkGatewayName, String peer, Context context) { - return beginGetAdvertisedRoutesAsync(resourceGroupName, virtualNetworkGatewayName, peer, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param peer The IP address of the peer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of virtual network gateway routes. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GatewayRouteListResultInner getAdvertisedRoutes( - String resourceGroupName, String virtualNetworkGatewayName, String peer) { - return getAdvertisedRoutesAsync(resourceGroupName, virtualNetworkGatewayName, peer).block(); - } - - /** - * This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param peer The IP address of the peer. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of virtual network gateway routes. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GatewayRouteListResultInner getAdvertisedRoutes( - String resourceGroupName, String virtualNetworkGatewayName, String peer, Context context) { - return getAdvertisedRoutesAsync(resourceGroupName, virtualNetworkGatewayName, peer, context).block(); - } - - /** - * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network - * gateway in the specified resource group through Network resource provider. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param vpnclientIpsecParams Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual Network - * Gateway P2S client operation through Network resource provider. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an IPSec parameters for a virtual network gateway P2S connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> setVpnclientIpsecParametersWithResponseAsync( - String resourceGroupName, - String virtualNetworkGatewayName, - VpnClientIPsecParametersInner vpnclientIpsecParams) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualNetworkGatewayName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualNetworkGatewayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (vpnclientIpsecParams == null) { - return Mono - .error(new IllegalArgumentException("Parameter vpnclientIpsecParams is required and cannot be null.")); - } else { - vpnclientIpsecParams.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .setVpnclientIpsecParameters( - this.client.getEndpoint(), - resourceGroupName, - virtualNetworkGatewayName, - apiVersion, - this.client.getSubscriptionId(), - vpnclientIpsecParams, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network - * gateway in the specified resource group through Network resource provider. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param vpnclientIpsecParams Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual Network - * Gateway P2S client operation through Network resource provider. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an IPSec parameters for a virtual network gateway P2S connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> setVpnclientIpsecParametersWithResponseAsync( - String resourceGroupName, - String virtualNetworkGatewayName, - VpnClientIPsecParametersInner vpnclientIpsecParams, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualNetworkGatewayName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualNetworkGatewayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (vpnclientIpsecParams == null) { - return Mono - .error(new IllegalArgumentException("Parameter vpnclientIpsecParams is required and cannot be null.")); - } else { - vpnclientIpsecParams.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .setVpnclientIpsecParameters( - this.client.getEndpoint(), - resourceGroupName, - virtualNetworkGatewayName, - apiVersion, - this.client.getSubscriptionId(), - vpnclientIpsecParams, - accept, - context); - } - - /** - * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network - * gateway in the specified resource group through Network resource provider. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param vpnclientIpsecParams Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual Network - * Gateway P2S client operation through Network resource provider. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an IPSec parameters for a virtual network gateway P2S connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, VpnClientIPsecParametersInner> - beginSetVpnclientIpsecParametersAsync( - String resourceGroupName, - String virtualNetworkGatewayName, - VpnClientIPsecParametersInner vpnclientIpsecParams) { - Mono>> mono = - setVpnclientIpsecParametersWithResponseAsync( - resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VpnClientIPsecParametersInner.class, - VpnClientIPsecParametersInner.class, - Context.NONE); - } - - /** - * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network - * gateway in the specified resource group through Network resource provider. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param vpnclientIpsecParams Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual Network - * Gateway P2S client operation through Network resource provider. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an IPSec parameters for a virtual network gateway P2S connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, VpnClientIPsecParametersInner> - beginSetVpnclientIpsecParametersAsync( - String resourceGroupName, - String virtualNetworkGatewayName, - VpnClientIPsecParametersInner vpnclientIpsecParams, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - setVpnclientIpsecParametersWithResponseAsync( - resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VpnClientIPsecParametersInner.class, - VpnClientIPsecParametersInner.class, - context); - } - - /** - * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network - * gateway in the specified resource group through Network resource provider. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param vpnclientIpsecParams Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual Network - * Gateway P2S client operation through Network resource provider. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an IPSec parameters for a virtual network gateway P2S connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VpnClientIPsecParametersInner> - beginSetVpnclientIpsecParameters( - String resourceGroupName, - String virtualNetworkGatewayName, - VpnClientIPsecParametersInner vpnclientIpsecParams) { - return beginSetVpnclientIpsecParametersAsync(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams) - .getSyncPoller(); - } - - /** - * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network - * gateway in the specified resource group through Network resource provider. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param vpnclientIpsecParams Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual Network - * Gateway P2S client operation through Network resource provider. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an IPSec parameters for a virtual network gateway P2S connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VpnClientIPsecParametersInner> - beginSetVpnclientIpsecParameters( - String resourceGroupName, - String virtualNetworkGatewayName, - VpnClientIPsecParametersInner vpnclientIpsecParams, - Context context) { - return beginSetVpnclientIpsecParametersAsync( - resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams, context) - .getSyncPoller(); - } - - /** - * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network - * gateway in the specified resource group through Network resource provider. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param vpnclientIpsecParams Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual Network - * Gateway P2S client operation through Network resource provider. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an IPSec parameters for a virtual network gateway P2S connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono setVpnclientIpsecParametersAsync( - String resourceGroupName, - String virtualNetworkGatewayName, - VpnClientIPsecParametersInner vpnclientIpsecParams) { - return beginSetVpnclientIpsecParametersAsync(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network - * gateway in the specified resource group through Network resource provider. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param vpnclientIpsecParams Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual Network - * Gateway P2S client operation through Network resource provider. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an IPSec parameters for a virtual network gateway P2S connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono setVpnclientIpsecParametersAsync( - String resourceGroupName, - String virtualNetworkGatewayName, - VpnClientIPsecParametersInner vpnclientIpsecParams, - Context context) { - return beginSetVpnclientIpsecParametersAsync( - resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network - * gateway in the specified resource group through Network resource provider. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param vpnclientIpsecParams Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual Network - * Gateway P2S client operation through Network resource provider. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an IPSec parameters for a virtual network gateway P2S connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VpnClientIPsecParametersInner setVpnclientIpsecParameters( - String resourceGroupName, - String virtualNetworkGatewayName, - VpnClientIPsecParametersInner vpnclientIpsecParams) { - return setVpnclientIpsecParametersAsync(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams) - .block(); - } - - /** - * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network - * gateway in the specified resource group through Network resource provider. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param vpnclientIpsecParams Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual Network - * Gateway P2S client operation through Network resource provider. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an IPSec parameters for a virtual network gateway P2S connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VpnClientIPsecParametersInner setVpnclientIpsecParameters( - String resourceGroupName, - String virtualNetworkGatewayName, - VpnClientIPsecParametersInner vpnclientIpsecParams, - Context context) { - return setVpnclientIpsecParametersAsync( - resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams, context) - .block(); - } - - /** - * The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client - * of virtual network gateway in the specified resource group through Network resource provider. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The virtual network gateway name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an IPSec parameters for a virtual network gateway P2S connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> getVpnclientIpsecParametersWithResponseAsync( - String resourceGroupName, String virtualNetworkGatewayName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualNetworkGatewayName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualNetworkGatewayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getVpnclientIpsecParameters( - this.client.getEndpoint(), - resourceGroupName, - virtualNetworkGatewayName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client - * of virtual network gateway in the specified resource group through Network resource provider. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The virtual network gateway name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an IPSec parameters for a virtual network gateway P2S connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> getVpnclientIpsecParametersWithResponseAsync( - String resourceGroupName, String virtualNetworkGatewayName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualNetworkGatewayName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualNetworkGatewayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getVpnclientIpsecParameters( - this.client.getEndpoint(), - resourceGroupName, - virtualNetworkGatewayName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client - * of virtual network gateway in the specified resource group through Network resource provider. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The virtual network gateway name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an IPSec parameters for a virtual network gateway P2S connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, VpnClientIPsecParametersInner> - beginGetVpnclientIpsecParametersAsync(String resourceGroupName, String virtualNetworkGatewayName) { - Mono>> mono = - getVpnclientIpsecParametersWithResponseAsync(resourceGroupName, virtualNetworkGatewayName); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VpnClientIPsecParametersInner.class, - VpnClientIPsecParametersInner.class, - Context.NONE); - } - - /** - * The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client - * of virtual network gateway in the specified resource group through Network resource provider. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The virtual network gateway name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an IPSec parameters for a virtual network gateway P2S connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, VpnClientIPsecParametersInner> - beginGetVpnclientIpsecParametersAsync( - String resourceGroupName, String virtualNetworkGatewayName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - getVpnclientIpsecParametersWithResponseAsync(resourceGroupName, virtualNetworkGatewayName, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VpnClientIPsecParametersInner.class, - VpnClientIPsecParametersInner.class, - context); - } - - /** - * The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client - * of virtual network gateway in the specified resource group through Network resource provider. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The virtual network gateway name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an IPSec parameters for a virtual network gateway P2S connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VpnClientIPsecParametersInner> - beginGetVpnclientIpsecParameters(String resourceGroupName, String virtualNetworkGatewayName) { - return beginGetVpnclientIpsecParametersAsync(resourceGroupName, virtualNetworkGatewayName).getSyncPoller(); - } - - /** - * The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client - * of virtual network gateway in the specified resource group through Network resource provider. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The virtual network gateway name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an IPSec parameters for a virtual network gateway P2S connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VpnClientIPsecParametersInner> - beginGetVpnclientIpsecParameters(String resourceGroupName, String virtualNetworkGatewayName, Context context) { - return beginGetVpnclientIpsecParametersAsync(resourceGroupName, virtualNetworkGatewayName, context) - .getSyncPoller(); - } - - /** - * The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client - * of virtual network gateway in the specified resource group through Network resource provider. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The virtual network gateway name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an IPSec parameters for a virtual network gateway P2S connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getVpnclientIpsecParametersAsync( - String resourceGroupName, String virtualNetworkGatewayName) { - return beginGetVpnclientIpsecParametersAsync(resourceGroupName, virtualNetworkGatewayName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client - * of virtual network gateway in the specified resource group through Network resource provider. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The virtual network gateway name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an IPSec parameters for a virtual network gateway P2S connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getVpnclientIpsecParametersAsync( - String resourceGroupName, String virtualNetworkGatewayName, Context context) { - return beginGetVpnclientIpsecParametersAsync(resourceGroupName, virtualNetworkGatewayName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client - * of virtual network gateway in the specified resource group through Network resource provider. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The virtual network gateway name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an IPSec parameters for a virtual network gateway P2S connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VpnClientIPsecParametersInner getVpnclientIpsecParameters( - String resourceGroupName, String virtualNetworkGatewayName) { - return getVpnclientIpsecParametersAsync(resourceGroupName, virtualNetworkGatewayName).block(); - } - - /** - * The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client - * of virtual network gateway in the specified resource group through Network resource provider. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The virtual network gateway name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an IPSec parameters for a virtual network gateway P2S connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VpnClientIPsecParametersInner getVpnclientIpsecParameters( - String resourceGroupName, String virtualNetworkGatewayName, Context context) { - return getVpnclientIpsecParametersAsync(resourceGroupName, virtualNetworkGatewayName, context).block(); - } - - /** - * Gets a xml format representation for vpn device configuration script. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection for which the - * configuration script is generated. - * @param parameters Parameters supplied to the generate vpn device script operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a xml format representation for vpn device configuration script. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> vpnDeviceConfigurationScriptWithResponseAsync( - String resourceGroupName, String virtualNetworkGatewayConnectionName, VpnDeviceScriptParameters parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualNetworkGatewayConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualNetworkGatewayConnectionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .vpnDeviceConfigurationScript( - this.client.getEndpoint(), - resourceGroupName, - virtualNetworkGatewayConnectionName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a xml format representation for vpn device configuration script. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection for which the - * configuration script is generated. - * @param parameters Parameters supplied to the generate vpn device script operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a xml format representation for vpn device configuration script. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> vpnDeviceConfigurationScriptWithResponseAsync( - String resourceGroupName, - String virtualNetworkGatewayConnectionName, - VpnDeviceScriptParameters parameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualNetworkGatewayConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualNetworkGatewayConnectionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .vpnDeviceConfigurationScript( - this.client.getEndpoint(), - resourceGroupName, - virtualNetworkGatewayConnectionName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Gets a xml format representation for vpn device configuration script. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection for which the - * configuration script is generated. - * @param parameters Parameters supplied to the generate vpn device script operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a xml format representation for vpn device configuration script. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono vpnDeviceConfigurationScriptAsync( - String resourceGroupName, String virtualNetworkGatewayConnectionName, VpnDeviceScriptParameters parameters) { - return vpnDeviceConfigurationScriptWithResponseAsync( - resourceGroupName, virtualNetworkGatewayConnectionName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a xml format representation for vpn device configuration script. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection for which the - * configuration script is generated. - * @param parameters Parameters supplied to the generate vpn device script operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a xml format representation for vpn device configuration script. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public String vpnDeviceConfigurationScript( - String resourceGroupName, String virtualNetworkGatewayConnectionName, VpnDeviceScriptParameters parameters) { - return vpnDeviceConfigurationScriptAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters) - .block(); - } - - /** - * Gets a xml format representation for vpn device configuration script. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection for which the - * configuration script is generated. - * @param parameters Parameters supplied to the generate vpn device script operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a xml format representation for vpn device configuration script. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response vpnDeviceConfigurationScriptWithResponse( - String resourceGroupName, - String virtualNetworkGatewayConnectionName, - VpnDeviceScriptParameters parameters, - Context context) { - return vpnDeviceConfigurationScriptWithResponseAsync( - resourceGroupName, virtualNetworkGatewayConnectionName, parameters, context) - .block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the ListVirtualNetworkGateways API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the ListVirtualNetworkGateways API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the VirtualNetworkGatewayListConnections API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listConnectionsNextSinglePageAsync( - String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listConnectionsNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the VirtualNetworkGatewayListConnections API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listConnectionsNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listConnectionsNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/VirtualNetworkGatewaysImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/VirtualNetworkGatewaysImpl.java deleted file mode 100644 index 618a36c4007b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/VirtualNetworkGatewaysImpl.java +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.CoreUtils; -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.network.fluent.VirtualNetworkGatewaysClient; -import com.azure.resourcemanager.network.fluent.models.VirtualNetworkGatewayInner; -import com.azure.resourcemanager.network.models.VirtualNetworkGateway; -import com.azure.resourcemanager.network.models.VirtualNetworkGateways; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.GroupableResourcesImpl; -import com.azure.resourcemanager.resources.fluentcore.utils.PagedConverter; -import reactor.core.publisher.Mono; - -/** Implementation for VirtualNetworkGateways. */ -public class VirtualNetworkGatewaysImpl - extends GroupableResourcesImpl< - VirtualNetworkGateway, - VirtualNetworkGatewayImpl, - VirtualNetworkGatewayInner, - VirtualNetworkGatewaysClient, - NetworkManager> - implements VirtualNetworkGateways { - - public VirtualNetworkGatewaysImpl(final NetworkManager networkManager) { - super(networkManager.serviceClient().getVirtualNetworkGateways(), networkManager); - } - - @Override - public VirtualNetworkGatewayImpl define(String name) { - return wrapModel(name); - } - - @Override - public PagedIterable list() { - return new PagedIterable<>(this.listAsync()); - } - - // TODO: Test this - @Override - public PagedFlux listAsync() { - return PagedConverter.mapPage(PagedConverter.mergePagedFlux(this.manager().resourceManager().resourceGroups().listAsync(), - rg -> inner().listByResourceGroupAsync(rg.name())), this::wrapModel); - } - - @Override - public PagedIterable listByResourceGroup(String groupName) { - return new PagedIterable<>(this.listByResourceGroupAsync(groupName)); - } - - @Override - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - if (CoreUtils.isNullOrEmpty(resourceGroupName)) { - return new PagedFlux<>(() -> Mono.error( - new IllegalArgumentException("Parameter 'resourceGroupName' is required and cannot be null."))); - } - return wrapPageAsync(this.inner().listByResourceGroupAsync(resourceGroupName)); - } - - @Override - protected Mono getInnerAsync(String groupName, String name) { - return this.inner().getByResourceGroupAsync(groupName, name); - } - - @Override - protected Mono deleteInnerAsync(String groupName, String name) { - return this.inner().deleteAsync(groupName, name); - } - - // Fluent model create helpers - - @Override - protected VirtualNetworkGatewayImpl wrapModel(String name) { - VirtualNetworkGatewayInner inner = new VirtualNetworkGatewayInner(); - - return new VirtualNetworkGatewayImpl(name, inner, super.manager()); - } - - @Override - protected VirtualNetworkGatewayImpl wrapModel(VirtualNetworkGatewayInner inner) { - if (inner == null) { - return null; - } - return new VirtualNetworkGatewayImpl(inner.name(), inner, this.manager()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/VirtualNetworkPeeringsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/VirtualNetworkPeeringsClientImpl.java deleted file mode 100644 index 1497c9c49bc7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/VirtualNetworkPeeringsClientImpl.java +++ /dev/null @@ -1,1213 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.VirtualNetworkPeeringsClient; -import com.azure.resourcemanager.network.fluent.models.VirtualNetworkPeeringInner; -import com.azure.resourcemanager.network.models.VirtualNetworkPeeringListResult; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in VirtualNetworkPeeringsClient. */ -public final class VirtualNetworkPeeringsClientImpl implements VirtualNetworkPeeringsClient { - private final ClientLogger logger = new ClientLogger(VirtualNetworkPeeringsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final VirtualNetworkPeeringsService service; - - /** The service client containing this operation class. */ - private final NetworkManagementClientImpl client; - - /** - * Initializes an instance of VirtualNetworkPeeringsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - VirtualNetworkPeeringsClientImpl(NetworkManagementClientImpl client) { - this.service = - RestProxy - .create(VirtualNetworkPeeringsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for NetworkManagementClientVirtualNetworkPeerings to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "NetworkManagementCli") - private interface VirtualNetworkPeeringsService { - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualNetworkName") String virtualNetworkName, - @PathParam("virtualNetworkPeeringName") String virtualNetworkPeeringName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualNetworkName") String virtualNetworkName, - @PathParam("virtualNetworkPeeringName") String virtualNetworkPeeringName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualNetworkName") String virtualNetworkName, - @PathParam("virtualNetworkPeeringName") String virtualNetworkPeeringName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VirtualNetworkPeeringInner virtualNetworkPeeringParameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualNetworkName") String virtualNetworkName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Deletes the specified virtual network peering. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param virtualNetworkPeeringName The name of the virtual network peering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync( - String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualNetworkName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); - } - if (virtualNetworkPeeringName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualNetworkPeeringName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - virtualNetworkName, - virtualNetworkPeeringName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the specified virtual network peering. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param virtualNetworkPeeringName The name of the virtual network peering. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualNetworkName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); - } - if (virtualNetworkPeeringName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualNetworkPeeringName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - virtualNetworkName, - virtualNetworkPeeringName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Deletes the specified virtual network peering. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param virtualNetworkPeeringName The name of the virtual network peering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName) { - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deletes the specified virtual network peering. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param virtualNetworkPeeringName The name of the virtual network peering. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes the specified virtual network peering. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param virtualNetworkPeeringName The name of the virtual network peering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName) { - return beginDeleteAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName).getSyncPoller(); - } - - /** - * Deletes the specified virtual network peering. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param virtualNetworkPeeringName The name of the virtual network peering. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, Context context) { - return beginDeleteAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, context) - .getSyncPoller(); - } - - /** - * Deletes the specified virtual network peering. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param virtualNetworkPeeringName The name of the virtual network peering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync( - String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName) { - return beginDeleteAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified virtual network peering. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param virtualNetworkPeeringName The name of the virtual network peering. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync( - String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, Context context) { - return beginDeleteAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified virtual network peering. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param virtualNetworkPeeringName The name of the virtual network peering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName) { - deleteAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName).block(); - } - - /** - * Deletes the specified virtual network peering. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param virtualNetworkPeeringName The name of the virtual network peering. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete( - String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, Context context) { - deleteAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, context).block(); - } - - /** - * Gets the specified virtual network peering. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param virtualNetworkPeeringName The name of the virtual network peering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified virtual network peering. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualNetworkName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); - } - if (virtualNetworkPeeringName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualNetworkPeeringName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - resourceGroupName, - virtualNetworkName, - virtualNetworkPeeringName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the specified virtual network peering. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param virtualNetworkPeeringName The name of the virtual network peering. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified virtual network peering. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualNetworkName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); - } - if (virtualNetworkPeeringName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualNetworkPeeringName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - resourceGroupName, - virtualNetworkName, - virtualNetworkPeeringName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets the specified virtual network peering. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param virtualNetworkPeeringName The name of the virtual network peering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified virtual network peering. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync( - String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName) { - return getWithResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the specified virtual network peering. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param virtualNetworkPeeringName The name of the virtual network peering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified virtual network peering. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualNetworkPeeringInner get( - String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName) { - return getAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName).block(); - } - - /** - * Gets the specified virtual network peering. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param virtualNetworkPeeringName The name of the virtual network peering. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified virtual network peering. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, Context context) { - return getWithResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, context).block(); - } - - /** - * Creates or updates a peering in the specified virtual network. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param virtualNetworkPeeringName The name of the peering. - * @param virtualNetworkPeeringParameters Parameters supplied to the create or update virtual network peering - * operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return peerings in a virtual network resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String virtualNetworkName, - String virtualNetworkPeeringName, - VirtualNetworkPeeringInner virtualNetworkPeeringParameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualNetworkName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); - } - if (virtualNetworkPeeringName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualNetworkPeeringName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (virtualNetworkPeeringParameters == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualNetworkPeeringParameters is required and cannot be null.")); - } else { - virtualNetworkPeeringParameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - virtualNetworkName, - virtualNetworkPeeringName, - apiVersion, - this.client.getSubscriptionId(), - virtualNetworkPeeringParameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a peering in the specified virtual network. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param virtualNetworkPeeringName The name of the peering. - * @param virtualNetworkPeeringParameters Parameters supplied to the create or update virtual network peering - * operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return peerings in a virtual network resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String virtualNetworkName, - String virtualNetworkPeeringName, - VirtualNetworkPeeringInner virtualNetworkPeeringParameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualNetworkName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); - } - if (virtualNetworkPeeringName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualNetworkPeeringName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (virtualNetworkPeeringParameters == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualNetworkPeeringParameters is required and cannot be null.")); - } else { - virtualNetworkPeeringParameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - virtualNetworkName, - virtualNetworkPeeringName, - apiVersion, - this.client.getSubscriptionId(), - virtualNetworkPeeringParameters, - accept, - context); - } - - /** - * Creates or updates a peering in the specified virtual network. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param virtualNetworkPeeringName The name of the peering. - * @param virtualNetworkPeeringParameters Parameters supplied to the create or update virtual network peering - * operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return peerings in a virtual network resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, VirtualNetworkPeeringInner> beginCreateOrUpdateAsync( - String resourceGroupName, - String virtualNetworkName, - String virtualNetworkPeeringName, - VirtualNetworkPeeringInner virtualNetworkPeeringParameters) { - Mono>> mono = - createOrUpdateWithResponseAsync( - resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VirtualNetworkPeeringInner.class, - VirtualNetworkPeeringInner.class, - Context.NONE); - } - - /** - * Creates or updates a peering in the specified virtual network. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param virtualNetworkPeeringName The name of the peering. - * @param virtualNetworkPeeringParameters Parameters supplied to the create or update virtual network peering - * operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return peerings in a virtual network resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, VirtualNetworkPeeringInner> beginCreateOrUpdateAsync( - String resourceGroupName, - String virtualNetworkName, - String virtualNetworkPeeringName, - VirtualNetworkPeeringInner virtualNetworkPeeringParameters, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync( - resourceGroupName, - virtualNetworkName, - virtualNetworkPeeringName, - virtualNetworkPeeringParameters, - context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VirtualNetworkPeeringInner.class, - VirtualNetworkPeeringInner.class, - context); - } - - /** - * Creates or updates a peering in the specified virtual network. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param virtualNetworkPeeringName The name of the peering. - * @param virtualNetworkPeeringParameters Parameters supplied to the create or update virtual network peering - * operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return peerings in a virtual network resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VirtualNetworkPeeringInner> beginCreateOrUpdate( - String resourceGroupName, - String virtualNetworkName, - String virtualNetworkPeeringName, - VirtualNetworkPeeringInner virtualNetworkPeeringParameters) { - return beginCreateOrUpdateAsync( - resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters) - .getSyncPoller(); - } - - /** - * Creates or updates a peering in the specified virtual network. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param virtualNetworkPeeringName The name of the peering. - * @param virtualNetworkPeeringParameters Parameters supplied to the create or update virtual network peering - * operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return peerings in a virtual network resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VirtualNetworkPeeringInner> beginCreateOrUpdate( - String resourceGroupName, - String virtualNetworkName, - String virtualNetworkPeeringName, - VirtualNetworkPeeringInner virtualNetworkPeeringParameters, - Context context) { - return beginCreateOrUpdateAsync( - resourceGroupName, - virtualNetworkName, - virtualNetworkPeeringName, - virtualNetworkPeeringParameters, - context) - .getSyncPoller(); - } - - /** - * Creates or updates a peering in the specified virtual network. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param virtualNetworkPeeringName The name of the peering. - * @param virtualNetworkPeeringParameters Parameters supplied to the create or update virtual network peering - * operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return peerings in a virtual network resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, - String virtualNetworkName, - String virtualNetworkPeeringName, - VirtualNetworkPeeringInner virtualNetworkPeeringParameters) { - return beginCreateOrUpdateAsync( - resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a peering in the specified virtual network. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param virtualNetworkPeeringName The name of the peering. - * @param virtualNetworkPeeringParameters Parameters supplied to the create or update virtual network peering - * operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return peerings in a virtual network resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, - String virtualNetworkName, - String virtualNetworkPeeringName, - VirtualNetworkPeeringInner virtualNetworkPeeringParameters, - Context context) { - return beginCreateOrUpdateAsync( - resourceGroupName, - virtualNetworkName, - virtualNetworkPeeringName, - virtualNetworkPeeringParameters, - context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a peering in the specified virtual network. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param virtualNetworkPeeringName The name of the peering. - * @param virtualNetworkPeeringParameters Parameters supplied to the create or update virtual network peering - * operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return peerings in a virtual network resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualNetworkPeeringInner createOrUpdate( - String resourceGroupName, - String virtualNetworkName, - String virtualNetworkPeeringName, - VirtualNetworkPeeringInner virtualNetworkPeeringParameters) { - return createOrUpdateAsync( - resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters) - .block(); - } - - /** - * Creates or updates a peering in the specified virtual network. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param virtualNetworkPeeringName The name of the peering. - * @param virtualNetworkPeeringParameters Parameters supplied to the create or update virtual network peering - * operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return peerings in a virtual network resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualNetworkPeeringInner createOrUpdate( - String resourceGroupName, - String virtualNetworkName, - String virtualNetworkPeeringName, - VirtualNetworkPeeringInner virtualNetworkPeeringParameters, - Context context) { - return createOrUpdateAsync( - resourceGroupName, - virtualNetworkName, - virtualNetworkPeeringName, - virtualNetworkPeeringParameters, - context) - .block(); - } - - /** - * Gets all virtual network peerings in a virtual network. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all virtual network peerings in a virtual network. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String virtualNetworkName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualNetworkName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - resourceGroupName, - virtualNetworkName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all virtual network peerings in a virtual network. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all virtual network peerings in a virtual network. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String virtualNetworkName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualNetworkName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - resourceGroupName, - virtualNetworkName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all virtual network peerings in a virtual network. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all virtual network peerings in a virtual network. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String resourceGroupName, String virtualNetworkName) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, virtualNetworkName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets all virtual network peerings in a virtual network. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all virtual network peerings in a virtual network. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String virtualNetworkName, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, virtualNetworkName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all virtual network peerings in a virtual network. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all virtual network peerings in a virtual network. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String virtualNetworkName) { - return new PagedIterable<>(listAsync(resourceGroupName, virtualNetworkName)); - } - - /** - * Gets all virtual network peerings in a virtual network. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all virtual network peerings in a virtual network. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, String virtualNetworkName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, virtualNetworkName, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListSubnets API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListSubnets API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/VirtualNetworkTapsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/VirtualNetworkTapsClientImpl.java deleted file mode 100644 index 1cd991d5a4b1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/VirtualNetworkTapsClientImpl.java +++ /dev/null @@ -1,1544 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.VirtualNetworkTapsClient; -import com.azure.resourcemanager.network.fluent.models.VirtualNetworkTapInner; -import com.azure.resourcemanager.network.models.TagsObject; -import com.azure.resourcemanager.network.models.VirtualNetworkTapListResult; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in VirtualNetworkTapsClient. */ -public final class VirtualNetworkTapsClientImpl - implements InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete, - VirtualNetworkTapsClient { - private final ClientLogger logger = new ClientLogger(VirtualNetworkTapsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final VirtualNetworkTapsService service; - - /** The service client containing this operation class. */ - private final NetworkManagementClientImpl client; - - /** - * Initializes an instance of VirtualNetworkTapsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - VirtualNetworkTapsClientImpl(NetworkManagementClientImpl client) { - this.service = - RestProxy.create(VirtualNetworkTapsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for NetworkManagementClientVirtualNetworkTaps to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "NetworkManagementCli") - private interface VirtualNetworkTapsService { - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/virtualNetworkTaps/{tapName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("tapName") String tapName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/virtualNetworkTaps/{tapName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("tapName") String tapName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/virtualNetworkTaps/{tapName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("tapName") String tapName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VirtualNetworkTapInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/virtualNetworkTaps/{tapName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> updateTags( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("tapName") String tapName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") TagsObject tapParameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualNetworkTaps") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/virtualNetworkTaps") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAllNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Deletes the specified virtual network tap. - * - * @param resourceGroupName The name of the resource group. - * @param tapName The name of the virtual network tap. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync(String resourceGroupName, String tapName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (tapName == null) { - return Mono.error(new IllegalArgumentException("Parameter tapName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - tapName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the specified virtual network tap. - * - * @param resourceGroupName The name of the resource group. - * @param tapName The name of the virtual network tap. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String tapName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (tapName == null) { - return Mono.error(new IllegalArgumentException("Parameter tapName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - tapName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Deletes the specified virtual network tap. - * - * @param resourceGroupName The name of the resource group. - * @param tapName The name of the virtual network tap. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String tapName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, tapName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deletes the specified virtual network tap. - * - * @param resourceGroupName The name of the resource group. - * @param tapName The name of the virtual network tap. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String tapName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(resourceGroupName, tapName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes the specified virtual network tap. - * - * @param resourceGroupName The name of the resource group. - * @param tapName The name of the virtual network tap. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete(String resourceGroupName, String tapName) { - return beginDeleteAsync(resourceGroupName, tapName).getSyncPoller(); - } - - /** - * Deletes the specified virtual network tap. - * - * @param resourceGroupName The name of the resource group. - * @param tapName The name of the virtual network tap. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete(String resourceGroupName, String tapName, Context context) { - return beginDeleteAsync(resourceGroupName, tapName, context).getSyncPoller(); - } - - /** - * Deletes the specified virtual network tap. - * - * @param resourceGroupName The name of the resource group. - * @param tapName The name of the virtual network tap. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String tapName) { - return beginDeleteAsync(resourceGroupName, tapName).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified virtual network tap. - * - * @param resourceGroupName The name of the resource group. - * @param tapName The name of the virtual network tap. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String tapName, Context context) { - return beginDeleteAsync(resourceGroupName, tapName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified virtual network tap. - * - * @param resourceGroupName The name of the resource group. - * @param tapName The name of the virtual network tap. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String tapName) { - deleteAsync(resourceGroupName, tapName).block(); - } - - /** - * Deletes the specified virtual network tap. - * - * @param resourceGroupName The name of the resource group. - * @param tapName The name of the virtual network tap. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String tapName, Context context) { - deleteAsync(resourceGroupName, tapName, context).block(); - } - - /** - * Gets information about the specified virtual network tap. - * - * @param resourceGroupName The name of the resource group. - * @param tapName The name of virtual network tap. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified virtual network tap. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String tapName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (tapName == null) { - return Mono.error(new IllegalArgumentException("Parameter tapName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - tapName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets information about the specified virtual network tap. - * - * @param resourceGroupName The name of the resource group. - * @param tapName The name of virtual network tap. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified virtual network tap. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String tapName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (tapName == null) { - return Mono.error(new IllegalArgumentException("Parameter tapName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - tapName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets information about the specified virtual network tap. - * - * @param resourceGroupName The name of the resource group. - * @param tapName The name of virtual network tap. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified virtual network tap. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync(String resourceGroupName, String tapName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, tapName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets information about the specified virtual network tap. - * - * @param resourceGroupName The name of the resource group. - * @param tapName The name of virtual network tap. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified virtual network tap. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualNetworkTapInner getByResourceGroup(String resourceGroupName, String tapName) { - return getByResourceGroupAsync(resourceGroupName, tapName).block(); - } - - /** - * Gets information about the specified virtual network tap. - * - * @param resourceGroupName The name of the resource group. - * @param tapName The name of virtual network tap. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified virtual network tap. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String tapName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, tapName, context).block(); - } - - /** - * Creates or updates a Virtual Network Tap. - * - * @param resourceGroupName The name of the resource group. - * @param tapName The name of the virtual network tap. - * @param parameters Parameters supplied to the create or update virtual network tap operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network Tap resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String tapName, VirtualNetworkTapInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (tapName == null) { - return Mono.error(new IllegalArgumentException("Parameter tapName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - tapName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a Virtual Network Tap. - * - * @param resourceGroupName The name of the resource group. - * @param tapName The name of the virtual network tap. - * @param parameters Parameters supplied to the create or update virtual network tap operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network Tap resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String tapName, VirtualNetworkTapInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (tapName == null) { - return Mono.error(new IllegalArgumentException("Parameter tapName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - tapName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Creates or updates a Virtual Network Tap. - * - * @param resourceGroupName The name of the resource group. - * @param tapName The name of the virtual network tap. - * @param parameters Parameters supplied to the create or update virtual network tap operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network Tap resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, VirtualNetworkTapInner> beginCreateOrUpdateAsync( - String resourceGroupName, String tapName, VirtualNetworkTapInner parameters) { - Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, tapName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VirtualNetworkTapInner.class, - VirtualNetworkTapInner.class, - Context.NONE); - } - - /** - * Creates or updates a Virtual Network Tap. - * - * @param resourceGroupName The name of the resource group. - * @param tapName The name of the virtual network tap. - * @param parameters Parameters supplied to the create or update virtual network tap operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network Tap resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, VirtualNetworkTapInner> beginCreateOrUpdateAsync( - String resourceGroupName, String tapName, VirtualNetworkTapInner parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, tapName, parameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VirtualNetworkTapInner.class, - VirtualNetworkTapInner.class, - context); - } - - /** - * Creates or updates a Virtual Network Tap. - * - * @param resourceGroupName The name of the resource group. - * @param tapName The name of the virtual network tap. - * @param parameters Parameters supplied to the create or update virtual network tap operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network Tap resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VirtualNetworkTapInner> beginCreateOrUpdate( - String resourceGroupName, String tapName, VirtualNetworkTapInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, tapName, parameters).getSyncPoller(); - } - - /** - * Creates or updates a Virtual Network Tap. - * - * @param resourceGroupName The name of the resource group. - * @param tapName The name of the virtual network tap. - * @param parameters Parameters supplied to the create or update virtual network tap operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network Tap resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VirtualNetworkTapInner> beginCreateOrUpdate( - String resourceGroupName, String tapName, VirtualNetworkTapInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, tapName, parameters, context).getSyncPoller(); - } - - /** - * Creates or updates a Virtual Network Tap. - * - * @param resourceGroupName The name of the resource group. - * @param tapName The name of the virtual network tap. - * @param parameters Parameters supplied to the create or update virtual network tap operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network Tap resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, String tapName, VirtualNetworkTapInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, tapName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a Virtual Network Tap. - * - * @param resourceGroupName The name of the resource group. - * @param tapName The name of the virtual network tap. - * @param parameters Parameters supplied to the create or update virtual network tap operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network Tap resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String tapName, VirtualNetworkTapInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, tapName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a Virtual Network Tap. - * - * @param resourceGroupName The name of the resource group. - * @param tapName The name of the virtual network tap. - * @param parameters Parameters supplied to the create or update virtual network tap operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network Tap resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualNetworkTapInner createOrUpdate( - String resourceGroupName, String tapName, VirtualNetworkTapInner parameters) { - return createOrUpdateAsync(resourceGroupName, tapName, parameters).block(); - } - - /** - * Creates or updates a Virtual Network Tap. - * - * @param resourceGroupName The name of the resource group. - * @param tapName The name of the virtual network tap. - * @param parameters Parameters supplied to the create or update virtual network tap operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network Tap resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualNetworkTapInner createOrUpdate( - String resourceGroupName, String tapName, VirtualNetworkTapInner parameters, Context context) { - return createOrUpdateAsync(resourceGroupName, tapName, parameters, context).block(); - } - - /** - * Updates an VirtualNetworkTap tags. - * - * @param resourceGroupName The name of the resource group. - * @param tapName The name of the tap. - * @param tapParameters Parameters supplied to update VirtualNetworkTap tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network Tap resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateTagsWithResponseAsync( - String resourceGroupName, String tapName, TagsObject tapParameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (tapName == null) { - return Mono.error(new IllegalArgumentException("Parameter tapName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (tapParameters == null) { - return Mono.error(new IllegalArgumentException("Parameter tapParameters is required and cannot be null.")); - } else { - tapParameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updateTags( - this.client.getEndpoint(), - resourceGroupName, - tapName, - apiVersion, - this.client.getSubscriptionId(), - tapParameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates an VirtualNetworkTap tags. - * - * @param resourceGroupName The name of the resource group. - * @param tapName The name of the tap. - * @param tapParameters Parameters supplied to update VirtualNetworkTap tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network Tap resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateTagsWithResponseAsync( - String resourceGroupName, String tapName, TagsObject tapParameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (tapName == null) { - return Mono.error(new IllegalArgumentException("Parameter tapName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (tapParameters == null) { - return Mono.error(new IllegalArgumentException("Parameter tapParameters is required and cannot be null.")); - } else { - tapParameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updateTags( - this.client.getEndpoint(), - resourceGroupName, - tapName, - apiVersion, - this.client.getSubscriptionId(), - tapParameters, - accept, - context); - } - - /** - * Updates an VirtualNetworkTap tags. - * - * @param resourceGroupName The name of the resource group. - * @param tapName The name of the tap. - * @param tapParameters Parameters supplied to update VirtualNetworkTap tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network Tap resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, VirtualNetworkTapInner> beginUpdateTagsAsync( - String resourceGroupName, String tapName, TagsObject tapParameters) { - Mono>> mono = updateTagsWithResponseAsync(resourceGroupName, tapName, tapParameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VirtualNetworkTapInner.class, - VirtualNetworkTapInner.class, - Context.NONE); - } - - /** - * Updates an VirtualNetworkTap tags. - * - * @param resourceGroupName The name of the resource group. - * @param tapName The name of the tap. - * @param tapParameters Parameters supplied to update VirtualNetworkTap tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network Tap resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, VirtualNetworkTapInner> beginUpdateTagsAsync( - String resourceGroupName, String tapName, TagsObject tapParameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - updateTagsWithResponseAsync(resourceGroupName, tapName, tapParameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VirtualNetworkTapInner.class, - VirtualNetworkTapInner.class, - context); - } - - /** - * Updates an VirtualNetworkTap tags. - * - * @param resourceGroupName The name of the resource group. - * @param tapName The name of the tap. - * @param tapParameters Parameters supplied to update VirtualNetworkTap tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network Tap resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VirtualNetworkTapInner> beginUpdateTags( - String resourceGroupName, String tapName, TagsObject tapParameters) { - return beginUpdateTagsAsync(resourceGroupName, tapName, tapParameters).getSyncPoller(); - } - - /** - * Updates an VirtualNetworkTap tags. - * - * @param resourceGroupName The name of the resource group. - * @param tapName The name of the tap. - * @param tapParameters Parameters supplied to update VirtualNetworkTap tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network Tap resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VirtualNetworkTapInner> beginUpdateTags( - String resourceGroupName, String tapName, TagsObject tapParameters, Context context) { - return beginUpdateTagsAsync(resourceGroupName, tapName, tapParameters, context).getSyncPoller(); - } - - /** - * Updates an VirtualNetworkTap tags. - * - * @param resourceGroupName The name of the resource group. - * @param tapName The name of the tap. - * @param tapParameters Parameters supplied to update VirtualNetworkTap tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network Tap resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateTagsAsync( - String resourceGroupName, String tapName, TagsObject tapParameters) { - return beginUpdateTagsAsync(resourceGroupName, tapName, tapParameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates an VirtualNetworkTap tags. - * - * @param resourceGroupName The name of the resource group. - * @param tapName The name of the tap. - * @param tapParameters Parameters supplied to update VirtualNetworkTap tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network Tap resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateTagsAsync( - String resourceGroupName, String tapName, TagsObject tapParameters, Context context) { - return beginUpdateTagsAsync(resourceGroupName, tapName, tapParameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates an VirtualNetworkTap tags. - * - * @param resourceGroupName The name of the resource group. - * @param tapName The name of the tap. - * @param tapParameters Parameters supplied to update VirtualNetworkTap tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network Tap resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualNetworkTapInner updateTags(String resourceGroupName, String tapName, TagsObject tapParameters) { - return updateTagsAsync(resourceGroupName, tapName, tapParameters).block(); - } - - /** - * Updates an VirtualNetworkTap tags. - * - * @param resourceGroupName The name of the resource group. - * @param tapName The name of the tap. - * @param tapParameters Parameters supplied to update VirtualNetworkTap tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network Tap resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualNetworkTapInner updateTags( - String resourceGroupName, String tapName, TagsObject tapParameters, Context context) { - return updateTagsAsync(resourceGroupName, tapName, tapParameters, context).block(); - } - - /** - * Gets all the VirtualNetworkTaps in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the VirtualNetworkTaps in a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all the VirtualNetworkTaps in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the VirtualNetworkTaps in a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all the VirtualNetworkTaps in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the VirtualNetworkTaps in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listAllNextSinglePageAsync(nextLink)); - } - - /** - * Gets all the VirtualNetworkTaps in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the VirtualNetworkTaps in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listAllNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all the VirtualNetworkTaps in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the VirtualNetworkTaps in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Gets all the VirtualNetworkTaps in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the VirtualNetworkTaps in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Gets all the VirtualNetworkTaps in a subscription. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the VirtualNetworkTaps in a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all the VirtualNetworkTaps in a subscription. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the VirtualNetworkTaps in a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all the VirtualNetworkTaps in a subscription. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the VirtualNetworkTaps in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * Gets all the VirtualNetworkTaps in a subscription. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the VirtualNetworkTaps in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all the VirtualNetworkTaps in a subscription. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the VirtualNetworkTaps in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * Gets all the VirtualNetworkTaps in a subscription. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the VirtualNetworkTaps in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListVirtualNetworkTap API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAllNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listAllNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListVirtualNetworkTap API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAllNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listAllNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListVirtualNetworkTap API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ListVirtualNetworkTap API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/VirtualNetworksClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/VirtualNetworksClientImpl.java deleted file mode 100644 index fc92887e3627..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/VirtualNetworksClientImpl.java +++ /dev/null @@ -1,2049 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.VirtualNetworksClient; -import com.azure.resourcemanager.network.fluent.models.IpAddressAvailabilityResultInner; -import com.azure.resourcemanager.network.fluent.models.VirtualNetworkInner; -import com.azure.resourcemanager.network.fluent.models.VirtualNetworkUsageInner; -import com.azure.resourcemanager.network.models.TagsObject; -import com.azure.resourcemanager.network.models.VirtualNetworkListResult; -import com.azure.resourcemanager.network.models.VirtualNetworkListUsageResult; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in VirtualNetworksClient. */ -public final class VirtualNetworksClientImpl - implements InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete, - VirtualNetworksClient { - private final ClientLogger logger = new ClientLogger(VirtualNetworksClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final VirtualNetworksService service; - - /** The service client containing this operation class. */ - private final NetworkManagementClientImpl client; - - /** - * Initializes an instance of VirtualNetworksClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - VirtualNetworksClientImpl(NetworkManagementClientImpl client) { - this.service = - RestProxy.create(VirtualNetworksService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for NetworkManagementClientVirtualNetworks to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "NetworkManagementCli") - private interface VirtualNetworksService { - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/virtualNetworks/{virtualNetworkName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualNetworkName") String virtualNetworkName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/virtualNetworks/{virtualNetworkName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualNetworkName") String virtualNetworkName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("$expand") String expand, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/virtualNetworks/{virtualNetworkName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualNetworkName") String virtualNetworkName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VirtualNetworkInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/virtualNetworks/{virtualNetworkName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> updateTags( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualNetworkName") String virtualNetworkName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") TagsObject parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualNetworks") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/virtualNetworks") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/virtualNetworks/{virtualNetworkName}/CheckIPAddressAvailability") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> checkIpAddressAvailability( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualNetworkName") String virtualNetworkName, - @QueryParam("ipAddress") String ipAddress, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/virtualNetworks/{virtualNetworkName}/usages") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listUsage( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualNetworkName") String virtualNetworkName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAllNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listUsageNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Deletes the specified virtual network. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync( - String resourceGroupName, String virtualNetworkName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualNetworkName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - virtualNetworkName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the specified virtual network. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String virtualNetworkName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualNetworkName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - virtualNetworkName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Deletes the specified virtual network. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String virtualNetworkName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, virtualNetworkName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deletes the specified virtual network. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String virtualNetworkName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(resourceGroupName, virtualNetworkName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes the specified virtual network. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete(String resourceGroupName, String virtualNetworkName) { - return beginDeleteAsync(resourceGroupName, virtualNetworkName).getSyncPoller(); - } - - /** - * Deletes the specified virtual network. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String virtualNetworkName, Context context) { - return beginDeleteAsync(resourceGroupName, virtualNetworkName, context).getSyncPoller(); - } - - /** - * Deletes the specified virtual network. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String virtualNetworkName) { - return beginDeleteAsync(resourceGroupName, virtualNetworkName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified virtual network. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String virtualNetworkName, Context context) { - return beginDeleteAsync(resourceGroupName, virtualNetworkName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified virtual network. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String virtualNetworkName) { - deleteAsync(resourceGroupName, virtualNetworkName).block(); - } - - /** - * Deletes the specified virtual network. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String virtualNetworkName, Context context) { - deleteAsync(resourceGroupName, virtualNetworkName, context).block(); - } - - /** - * Gets the specified virtual network by resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param expand Expands referenced resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified virtual network by resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String virtualNetworkName, String expand) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualNetworkName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - virtualNetworkName, - apiVersion, - this.client.getSubscriptionId(), - expand, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the specified virtual network by resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param expand Expands referenced resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified virtual network by resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String virtualNetworkName, String expand, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualNetworkName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - virtualNetworkName, - apiVersion, - this.client.getSubscriptionId(), - expand, - accept, - context); - } - - /** - * Gets the specified virtual network by resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param expand Expands referenced resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified virtual network by resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync( - String resourceGroupName, String virtualNetworkName, String expand) { - return getByResourceGroupWithResponseAsync(resourceGroupName, virtualNetworkName, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the specified virtual network by resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified virtual network by resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync(String resourceGroupName, String virtualNetworkName) { - final String expand = null; - return getByResourceGroupWithResponseAsync(resourceGroupName, virtualNetworkName, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the specified virtual network by resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified virtual network by resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualNetworkInner getByResourceGroup(String resourceGroupName, String virtualNetworkName) { - final String expand = null; - return getByResourceGroupAsync(resourceGroupName, virtualNetworkName, expand).block(); - } - - /** - * Gets the specified virtual network by resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param expand Expands referenced resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified virtual network by resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String virtualNetworkName, String expand, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, virtualNetworkName, expand, context).block(); - } - - /** - * Creates or updates a virtual network in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param parameters Parameters supplied to the create or update virtual network operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String virtualNetworkName, VirtualNetworkInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualNetworkName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - virtualNetworkName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a virtual network in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param parameters Parameters supplied to the create or update virtual network operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String virtualNetworkName, VirtualNetworkInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualNetworkName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - virtualNetworkName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Creates or updates a virtual network in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param parameters Parameters supplied to the create or update virtual network operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, VirtualNetworkInner> beginCreateOrUpdateAsync( - String resourceGroupName, String virtualNetworkName, VirtualNetworkInner parameters) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, virtualNetworkName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VirtualNetworkInner.class, - VirtualNetworkInner.class, - Context.NONE); - } - - /** - * Creates or updates a virtual network in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param parameters Parameters supplied to the create or update virtual network operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, VirtualNetworkInner> beginCreateOrUpdateAsync( - String resourceGroupName, String virtualNetworkName, VirtualNetworkInner parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, virtualNetworkName, parameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), VirtualNetworkInner.class, VirtualNetworkInner.class, context); - } - - /** - * Creates or updates a virtual network in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param parameters Parameters supplied to the create or update virtual network operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VirtualNetworkInner> beginCreateOrUpdate( - String resourceGroupName, String virtualNetworkName, VirtualNetworkInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, virtualNetworkName, parameters).getSyncPoller(); - } - - /** - * Creates or updates a virtual network in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param parameters Parameters supplied to the create or update virtual network operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VirtualNetworkInner> beginCreateOrUpdate( - String resourceGroupName, String virtualNetworkName, VirtualNetworkInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, virtualNetworkName, parameters, context).getSyncPoller(); - } - - /** - * Creates or updates a virtual network in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param parameters Parameters supplied to the create or update virtual network operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, String virtualNetworkName, VirtualNetworkInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, virtualNetworkName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a virtual network in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param parameters Parameters supplied to the create or update virtual network operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String virtualNetworkName, VirtualNetworkInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, virtualNetworkName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a virtual network in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param parameters Parameters supplied to the create or update virtual network operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualNetworkInner createOrUpdate( - String resourceGroupName, String virtualNetworkName, VirtualNetworkInner parameters) { - return createOrUpdateAsync(resourceGroupName, virtualNetworkName, parameters).block(); - } - - /** - * Creates or updates a virtual network in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param parameters Parameters supplied to the create or update virtual network operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualNetworkInner createOrUpdate( - String resourceGroupName, String virtualNetworkName, VirtualNetworkInner parameters, Context context) { - return createOrUpdateAsync(resourceGroupName, virtualNetworkName, parameters, context).block(); - } - - /** - * Updates a virtual network tags. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param parameters Parameters supplied to update virtual network tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateTagsWithResponseAsync( - String resourceGroupName, String virtualNetworkName, TagsObject parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualNetworkName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updateTags( - this.client.getEndpoint(), - resourceGroupName, - virtualNetworkName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates a virtual network tags. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param parameters Parameters supplied to update virtual network tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateTagsWithResponseAsync( - String resourceGroupName, String virtualNetworkName, TagsObject parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualNetworkName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updateTags( - this.client.getEndpoint(), - resourceGroupName, - virtualNetworkName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Updates a virtual network tags. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param parameters Parameters supplied to update virtual network tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, VirtualNetworkInner> beginUpdateTagsAsync( - String resourceGroupName, String virtualNetworkName, TagsObject parameters) { - Mono>> mono = - updateTagsWithResponseAsync(resourceGroupName, virtualNetworkName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VirtualNetworkInner.class, - VirtualNetworkInner.class, - Context.NONE); - } - - /** - * Updates a virtual network tags. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param parameters Parameters supplied to update virtual network tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, VirtualNetworkInner> beginUpdateTagsAsync( - String resourceGroupName, String virtualNetworkName, TagsObject parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - updateTagsWithResponseAsync(resourceGroupName, virtualNetworkName, parameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), VirtualNetworkInner.class, VirtualNetworkInner.class, context); - } - - /** - * Updates a virtual network tags. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param parameters Parameters supplied to update virtual network tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VirtualNetworkInner> beginUpdateTags( - String resourceGroupName, String virtualNetworkName, TagsObject parameters) { - return beginUpdateTagsAsync(resourceGroupName, virtualNetworkName, parameters).getSyncPoller(); - } - - /** - * Updates a virtual network tags. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param parameters Parameters supplied to update virtual network tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VirtualNetworkInner> beginUpdateTags( - String resourceGroupName, String virtualNetworkName, TagsObject parameters, Context context) { - return beginUpdateTagsAsync(resourceGroupName, virtualNetworkName, parameters, context).getSyncPoller(); - } - - /** - * Updates a virtual network tags. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param parameters Parameters supplied to update virtual network tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateTagsAsync( - String resourceGroupName, String virtualNetworkName, TagsObject parameters) { - return beginUpdateTagsAsync(resourceGroupName, virtualNetworkName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates a virtual network tags. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param parameters Parameters supplied to update virtual network tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateTagsAsync( - String resourceGroupName, String virtualNetworkName, TagsObject parameters, Context context) { - return beginUpdateTagsAsync(resourceGroupName, virtualNetworkName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates a virtual network tags. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param parameters Parameters supplied to update virtual network tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualNetworkInner updateTags(String resourceGroupName, String virtualNetworkName, TagsObject parameters) { - return updateTagsAsync(resourceGroupName, virtualNetworkName, parameters).block(); - } - - /** - * Updates a virtual network tags. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param parameters Parameters supplied to update virtual network tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual Network resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualNetworkInner updateTags( - String resourceGroupName, String virtualNetworkName, TagsObject parameters, Context context) { - return updateTagsAsync(resourceGroupName, virtualNetworkName, parameters, context).block(); - } - - /** - * Gets all virtual networks in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all virtual networks in a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all virtual networks in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all virtual networks in a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all virtual networks in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all virtual networks in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listAllNextSinglePageAsync(nextLink)); - } - - /** - * Gets all virtual networks in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all virtual networks in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listAllNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all virtual networks in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all virtual networks in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Gets all virtual networks in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all virtual networks in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Gets all virtual networks in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all virtual networks in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all virtual networks in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all virtual networks in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all virtual networks in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all virtual networks in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets all virtual networks in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all virtual networks in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all virtual networks in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all virtual networks in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * Gets all virtual networks in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all virtual networks in a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * Checks whether a private IP address is available for use. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param ipAddress The private IP address to be verified. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for CheckIPAddressAvailability API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> checkIpAddressAvailabilityWithResponseAsync( - String resourceGroupName, String virtualNetworkName, String ipAddress) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualNetworkName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); - } - if (ipAddress == null) { - return Mono.error(new IllegalArgumentException("Parameter ipAddress is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .checkIpAddressAvailability( - this.client.getEndpoint(), - resourceGroupName, - virtualNetworkName, - ipAddress, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Checks whether a private IP address is available for use. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param ipAddress The private IP address to be verified. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for CheckIPAddressAvailability API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> checkIpAddressAvailabilityWithResponseAsync( - String resourceGroupName, String virtualNetworkName, String ipAddress, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualNetworkName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); - } - if (ipAddress == null) { - return Mono.error(new IllegalArgumentException("Parameter ipAddress is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .checkIpAddressAvailability( - this.client.getEndpoint(), - resourceGroupName, - virtualNetworkName, - ipAddress, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Checks whether a private IP address is available for use. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param ipAddress The private IP address to be verified. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for CheckIPAddressAvailability API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono checkIpAddressAvailabilityAsync( - String resourceGroupName, String virtualNetworkName, String ipAddress) { - return checkIpAddressAvailabilityWithResponseAsync(resourceGroupName, virtualNetworkName, ipAddress) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Checks whether a private IP address is available for use. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param ipAddress The private IP address to be verified. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for CheckIPAddressAvailability API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public IpAddressAvailabilityResultInner checkIpAddressAvailability( - String resourceGroupName, String virtualNetworkName, String ipAddress) { - return checkIpAddressAvailabilityAsync(resourceGroupName, virtualNetworkName, ipAddress).block(); - } - - /** - * Checks whether a private IP address is available for use. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param ipAddress The private IP address to be verified. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for CheckIPAddressAvailability API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response checkIpAddressAvailabilityWithResponse( - String resourceGroupName, String virtualNetworkName, String ipAddress, Context context) { - return checkIpAddressAvailabilityWithResponseAsync(resourceGroupName, virtualNetworkName, ipAddress, context) - .block(); - } - - /** - * Lists usage stats. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the virtual networks GetUsage API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listUsageSinglePageAsync( - String resourceGroupName, String virtualNetworkName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualNetworkName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listUsage( - this.client.getEndpoint(), - resourceGroupName, - virtualNetworkName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists usage stats. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the virtual networks GetUsage API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listUsageSinglePageAsync( - String resourceGroupName, String virtualNetworkName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualNetworkName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listUsage( - this.client.getEndpoint(), - resourceGroupName, - virtualNetworkName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists usage stats. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the virtual networks GetUsage API service call. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listUsageAsync(String resourceGroupName, String virtualNetworkName) { - return new PagedFlux<>( - () -> listUsageSinglePageAsync(resourceGroupName, virtualNetworkName), - nextLink -> listUsageNextSinglePageAsync(nextLink)); - } - - /** - * Lists usage stats. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the virtual networks GetUsage API service call. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listUsageAsync( - String resourceGroupName, String virtualNetworkName, Context context) { - return new PagedFlux<>( - () -> listUsageSinglePageAsync(resourceGroupName, virtualNetworkName, context), - nextLink -> listUsageNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists usage stats. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the virtual networks GetUsage API service call. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listUsage(String resourceGroupName, String virtualNetworkName) { - return new PagedIterable<>(listUsageAsync(resourceGroupName, virtualNetworkName)); - } - - /** - * Lists usage stats. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName The name of the virtual network. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the virtual networks GetUsage API service call. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listUsage( - String resourceGroupName, String virtualNetworkName, Context context) { - return new PagedIterable<>(listUsageAsync(resourceGroupName, virtualNetworkName, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the ListVirtualNetworks API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAllNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listAllNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the ListVirtualNetworks API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAllNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listAllNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the ListVirtualNetworks API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the ListVirtualNetworks API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the virtual networks GetUsage API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listUsageNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listUsageNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the virtual networks GetUsage API service call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listUsageNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listUsageNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/VirtualWansClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/VirtualWansClientImpl.java deleted file mode 100644 index 40d9da2276ce..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/VirtualWansClientImpl.java +++ /dev/null @@ -1,1546 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.VirtualWansClient; -import com.azure.resourcemanager.network.fluent.models.VirtualWanInner; -import com.azure.resourcemanager.network.models.ErrorException; -import com.azure.resourcemanager.network.models.ListVirtualWansResult; -import com.azure.resourcemanager.network.models.TagsObject; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in VirtualWansClient. */ -public final class VirtualWansClientImpl - implements InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete, - VirtualWansClient { - private final ClientLogger logger = new ClientLogger(VirtualWansClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final VirtualWansService service; - - /** The service client containing this operation class. */ - private final NetworkManagementClientImpl client; - - /** - * Initializes an instance of VirtualWansClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - VirtualWansClientImpl(NetworkManagementClientImpl client) { - this.service = - RestProxy.create(VirtualWansService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for NetworkManagementClientVirtualWans to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "NetworkManagementCli") - private interface VirtualWansService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans" - + "/{VirtualWANName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ErrorException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("VirtualWANName") String virtualWanName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans" - + "/{VirtualWANName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ErrorException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("VirtualWANName") String virtualWanName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") VirtualWanInner wanParameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans" - + "/{VirtualWANName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ErrorException.class) - Mono>> updateTags( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("VirtualWANName") String virtualWanName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") TagsObject wanParameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans" - + "/{VirtualWANName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ErrorException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("VirtualWANName") String virtualWanName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/virtualWans") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ErrorException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualWans") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ErrorException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ErrorException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ErrorException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Retrieves the details of a VirtualWAN. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWAN being retrieved. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualWAN Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String virtualWanName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualWanName == null) { - return Mono.error(new IllegalArgumentException("Parameter virtualWanName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - virtualWanName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Retrieves the details of a VirtualWAN. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWAN being retrieved. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualWAN Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String virtualWanName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualWanName == null) { - return Mono.error(new IllegalArgumentException("Parameter virtualWanName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - virtualWanName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Retrieves the details of a VirtualWAN. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWAN being retrieved. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualWAN Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync(String resourceGroupName, String virtualWanName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, virtualWanName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Retrieves the details of a VirtualWAN. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWAN being retrieved. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualWAN Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualWanInner getByResourceGroup(String resourceGroupName, String virtualWanName) { - return getByResourceGroupAsync(resourceGroupName, virtualWanName).block(); - } - - /** - * Retrieves the details of a VirtualWAN. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWAN being retrieved. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualWAN Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String virtualWanName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, virtualWanName, context).block(); - } - - /** - * Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWAN being created or updated. - * @param wanParameters Parameters supplied to create or update VirtualWAN. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualWAN Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String virtualWanName, VirtualWanInner wanParameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualWanName == null) { - return Mono.error(new IllegalArgumentException("Parameter virtualWanName is required and cannot be null.")); - } - if (wanParameters == null) { - return Mono.error(new IllegalArgumentException("Parameter wanParameters is required and cannot be null.")); - } else { - wanParameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - virtualWanName, - apiVersion, - wanParameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWAN being created or updated. - * @param wanParameters Parameters supplied to create or update VirtualWAN. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualWAN Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String virtualWanName, VirtualWanInner wanParameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualWanName == null) { - return Mono.error(new IllegalArgumentException("Parameter virtualWanName is required and cannot be null.")); - } - if (wanParameters == null) { - return Mono.error(new IllegalArgumentException("Parameter wanParameters is required and cannot be null.")); - } else { - wanParameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - virtualWanName, - apiVersion, - wanParameters, - accept, - context); - } - - /** - * Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWAN being created or updated. - * @param wanParameters Parameters supplied to create or update VirtualWAN. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualWAN Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, VirtualWanInner> beginCreateOrUpdateAsync( - String resourceGroupName, String virtualWanName, VirtualWanInner wanParameters) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, virtualWanName, wanParameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VirtualWanInner.class, - VirtualWanInner.class, - this.client.getContext()); - } - - /** - * Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWAN being created or updated. - * @param wanParameters Parameters supplied to create or update VirtualWAN. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualWAN Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, VirtualWanInner> beginCreateOrUpdateAsync( - String resourceGroupName, String virtualWanName, VirtualWanInner wanParameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, virtualWanName, wanParameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), VirtualWanInner.class, VirtualWanInner.class, context); - } - - /** - * Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWAN being created or updated. - * @param wanParameters Parameters supplied to create or update VirtualWAN. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualWAN Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VirtualWanInner> beginCreateOrUpdate( - String resourceGroupName, String virtualWanName, VirtualWanInner wanParameters) { - return beginCreateOrUpdateAsync(resourceGroupName, virtualWanName, wanParameters).getSyncPoller(); - } - - /** - * Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWAN being created or updated. - * @param wanParameters Parameters supplied to create or update VirtualWAN. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualWAN Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VirtualWanInner> beginCreateOrUpdate( - String resourceGroupName, String virtualWanName, VirtualWanInner wanParameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, virtualWanName, wanParameters, context).getSyncPoller(); - } - - /** - * Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWAN being created or updated. - * @param wanParameters Parameters supplied to create or update VirtualWAN. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualWAN Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, String virtualWanName, VirtualWanInner wanParameters) { - return beginCreateOrUpdateAsync(resourceGroupName, virtualWanName, wanParameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWAN being created or updated. - * @param wanParameters Parameters supplied to create or update VirtualWAN. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualWAN Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String virtualWanName, VirtualWanInner wanParameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, virtualWanName, wanParameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWAN being created or updated. - * @param wanParameters Parameters supplied to create or update VirtualWAN. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualWAN Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualWanInner createOrUpdate( - String resourceGroupName, String virtualWanName, VirtualWanInner wanParameters) { - return createOrUpdateAsync(resourceGroupName, virtualWanName, wanParameters).block(); - } - - /** - * Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWAN being created or updated. - * @param wanParameters Parameters supplied to create or update VirtualWAN. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualWAN Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualWanInner createOrUpdate( - String resourceGroupName, String virtualWanName, VirtualWanInner wanParameters, Context context) { - return createOrUpdateAsync(resourceGroupName, virtualWanName, wanParameters, context).block(); - } - - /** - * Updates a VirtualWAN tags. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWAN being updated. - * @param wanParameters Parameters supplied to Update VirtualWAN tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualWAN Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateTagsWithResponseAsync( - String resourceGroupName, String virtualWanName, TagsObject wanParameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualWanName == null) { - return Mono.error(new IllegalArgumentException("Parameter virtualWanName is required and cannot be null.")); - } - if (wanParameters == null) { - return Mono.error(new IllegalArgumentException("Parameter wanParameters is required and cannot be null.")); - } else { - wanParameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updateTags( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - virtualWanName, - apiVersion, - wanParameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates a VirtualWAN tags. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWAN being updated. - * @param wanParameters Parameters supplied to Update VirtualWAN tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualWAN Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateTagsWithResponseAsync( - String resourceGroupName, String virtualWanName, TagsObject wanParameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualWanName == null) { - return Mono.error(new IllegalArgumentException("Parameter virtualWanName is required and cannot be null.")); - } - if (wanParameters == null) { - return Mono.error(new IllegalArgumentException("Parameter wanParameters is required and cannot be null.")); - } else { - wanParameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updateTags( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - virtualWanName, - apiVersion, - wanParameters, - accept, - context); - } - - /** - * Updates a VirtualWAN tags. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWAN being updated. - * @param wanParameters Parameters supplied to Update VirtualWAN tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualWAN Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, VirtualWanInner> beginUpdateTagsAsync( - String resourceGroupName, String virtualWanName, TagsObject wanParameters) { - Mono>> mono = - updateTagsWithResponseAsync(resourceGroupName, virtualWanName, wanParameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VirtualWanInner.class, - VirtualWanInner.class, - this.client.getContext()); - } - - /** - * Updates a VirtualWAN tags. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWAN being updated. - * @param wanParameters Parameters supplied to Update VirtualWAN tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualWAN Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, VirtualWanInner> beginUpdateTagsAsync( - String resourceGroupName, String virtualWanName, TagsObject wanParameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - updateTagsWithResponseAsync(resourceGroupName, virtualWanName, wanParameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), VirtualWanInner.class, VirtualWanInner.class, context); - } - - /** - * Updates a VirtualWAN tags. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWAN being updated. - * @param wanParameters Parameters supplied to Update VirtualWAN tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualWAN Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VirtualWanInner> beginUpdateTags( - String resourceGroupName, String virtualWanName, TagsObject wanParameters) { - return beginUpdateTagsAsync(resourceGroupName, virtualWanName, wanParameters).getSyncPoller(); - } - - /** - * Updates a VirtualWAN tags. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWAN being updated. - * @param wanParameters Parameters supplied to Update VirtualWAN tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualWAN Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VirtualWanInner> beginUpdateTags( - String resourceGroupName, String virtualWanName, TagsObject wanParameters, Context context) { - return beginUpdateTagsAsync(resourceGroupName, virtualWanName, wanParameters, context).getSyncPoller(); - } - - /** - * Updates a VirtualWAN tags. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWAN being updated. - * @param wanParameters Parameters supplied to Update VirtualWAN tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualWAN Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateTagsAsync( - String resourceGroupName, String virtualWanName, TagsObject wanParameters) { - return beginUpdateTagsAsync(resourceGroupName, virtualWanName, wanParameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates a VirtualWAN tags. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWAN being updated. - * @param wanParameters Parameters supplied to Update VirtualWAN tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualWAN Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateTagsAsync( - String resourceGroupName, String virtualWanName, TagsObject wanParameters, Context context) { - return beginUpdateTagsAsync(resourceGroupName, virtualWanName, wanParameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates a VirtualWAN tags. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWAN being updated. - * @param wanParameters Parameters supplied to Update VirtualWAN tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualWAN Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualWanInner updateTags(String resourceGroupName, String virtualWanName, TagsObject wanParameters) { - return updateTagsAsync(resourceGroupName, virtualWanName, wanParameters).block(); - } - - /** - * Updates a VirtualWAN tags. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWAN being updated. - * @param wanParameters Parameters supplied to Update VirtualWAN tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtualWAN Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualWanInner updateTags( - String resourceGroupName, String virtualWanName, TagsObject wanParameters, Context context) { - return updateTagsAsync(resourceGroupName, virtualWanName, wanParameters, context).block(); - } - - /** - * Deletes a VirtualWAN. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWAN being deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync(String resourceGroupName, String virtualWanName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualWanName == null) { - return Mono.error(new IllegalArgumentException("Parameter virtualWanName is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - virtualWanName, - apiVersion, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a VirtualWAN. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWAN being deleted. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String virtualWanName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualWanName == null) { - return Mono.error(new IllegalArgumentException("Parameter virtualWanName is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - virtualWanName, - apiVersion, - accept, - context); - } - - /** - * Deletes a VirtualWAN. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWAN being deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String virtualWanName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, virtualWanName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deletes a VirtualWAN. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWAN being deleted. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String virtualWanName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(resourceGroupName, virtualWanName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes a VirtualWAN. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWAN being deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete(String resourceGroupName, String virtualWanName) { - return beginDeleteAsync(resourceGroupName, virtualWanName).getSyncPoller(); - } - - /** - * Deletes a VirtualWAN. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWAN being deleted. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String virtualWanName, Context context) { - return beginDeleteAsync(resourceGroupName, virtualWanName, context).getSyncPoller(); - } - - /** - * Deletes a VirtualWAN. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWAN being deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String virtualWanName) { - return beginDeleteAsync(resourceGroupName, virtualWanName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a VirtualWAN. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWAN being deleted. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String virtualWanName, Context context) { - return beginDeleteAsync(resourceGroupName, virtualWanName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a VirtualWAN. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWAN being deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String virtualWanName) { - deleteAsync(resourceGroupName, virtualWanName).block(); - } - - /** - * Deletes a VirtualWAN. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param virtualWanName The name of the VirtualWAN being deleted. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String virtualWanName, Context context) { - deleteAsync(resourceGroupName, virtualWanName, context).block(); - } - - /** - * Lists all the VirtualWANs in a resource group. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VirtualWANs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - apiVersion, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all the VirtualWANs in a resource group. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VirtualWANs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - apiVersion, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists all the VirtualWANs in a resource group. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VirtualWANs. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * Lists all the VirtualWANs in a resource group. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VirtualWANs. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all the VirtualWANs in a resource group. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VirtualWANs. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * Lists all the VirtualWANs in a resource group. - * - * @param resourceGroupName The resource group name of the VirtualWan. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VirtualWANs. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * Lists all the VirtualWANs in a subscription. - * - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VirtualWANs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all the VirtualWANs in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VirtualWANs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists all the VirtualWANs in a subscription. - * - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VirtualWANs. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists all the VirtualWANs in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VirtualWANs. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all the VirtualWANs in a subscription. - * - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VirtualWANs. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Lists all the VirtualWANs in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VirtualWANs. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VirtualWANs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VirtualWANs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VirtualWANs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VirtualWANs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/VpnConnectionsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/VpnConnectionsClientImpl.java deleted file mode 100644 index 78a0959e527d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/VpnConnectionsClientImpl.java +++ /dev/null @@ -1,1148 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.VpnConnectionsClient; -import com.azure.resourcemanager.network.fluent.models.VpnConnectionInner; -import com.azure.resourcemanager.network.models.ErrorException; -import com.azure.resourcemanager.network.models.ListVpnConnectionsResult; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in VpnConnectionsClient. */ -public final class VpnConnectionsClientImpl implements VpnConnectionsClient { - private final ClientLogger logger = new ClientLogger(VpnConnectionsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final VpnConnectionsService service; - - /** The service client containing this operation class. */ - private final NetworkManagementClientImpl client; - - /** - * Initializes an instance of VpnConnectionsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - VpnConnectionsClientImpl(NetworkManagementClientImpl client) { - this.service = - RestProxy.create(VpnConnectionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for NetworkManagementClientVpnConnections to be used by the proxy service - * to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "NetworkManagementCli") - private interface VpnConnectionsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways" - + "/{gatewayName}/vpnConnections/{connectionName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ErrorException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("gatewayName") String gatewayName, - @PathParam("connectionName") String connectionName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways" - + "/{gatewayName}/vpnConnections/{connectionName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ErrorException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("gatewayName") String gatewayName, - @PathParam("connectionName") String connectionName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") VpnConnectionInner vpnConnectionParameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways" - + "/{gatewayName}/vpnConnections/{connectionName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ErrorException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("gatewayName") String gatewayName, - @PathParam("connectionName") String connectionName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways" - + "/{gatewayName}/vpnConnections") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ErrorException.class) - Mono> listByVpnGateway( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("gatewayName") String gatewayName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ErrorException.class) - Mono> listByVpnGatewayNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Retrieves the details of a vpn connection. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param connectionName The name of the vpn connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnConnection Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String resourceGroupName, String gatewayName, String connectionName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (gatewayName == null) { - return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); - } - if (connectionName == null) { - return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - gatewayName, - connectionName, - apiVersion, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Retrieves the details of a vpn connection. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param connectionName The name of the vpn connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnConnection Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String gatewayName, String connectionName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (gatewayName == null) { - return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); - } - if (connectionName == null) { - return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - gatewayName, - connectionName, - apiVersion, - accept, - context); - } - - /** - * Retrieves the details of a vpn connection. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param connectionName The name of the vpn connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnConnection Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync(String resourceGroupName, String gatewayName, String connectionName) { - return getWithResponseAsync(resourceGroupName, gatewayName, connectionName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Retrieves the details of a vpn connection. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param connectionName The name of the vpn connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnConnection Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VpnConnectionInner get(String resourceGroupName, String gatewayName, String connectionName) { - return getAsync(resourceGroupName, gatewayName, connectionName).block(); - } - - /** - * Retrieves the details of a vpn connection. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param connectionName The name of the vpn connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnConnection Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String gatewayName, String connectionName, Context context) { - return getWithResponseAsync(resourceGroupName, gatewayName, connectionName, context).block(); - } - - /** - * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param connectionName The name of the connection. - * @param vpnConnectionParameters Parameters supplied to create or Update a VPN Connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnConnection Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String gatewayName, - String connectionName, - VpnConnectionInner vpnConnectionParameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (gatewayName == null) { - return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); - } - if (connectionName == null) { - return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); - } - if (vpnConnectionParameters == null) { - return Mono - .error( - new IllegalArgumentException("Parameter vpnConnectionParameters is required and cannot be null.")); - } else { - vpnConnectionParameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - gatewayName, - connectionName, - apiVersion, - vpnConnectionParameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param connectionName The name of the connection. - * @param vpnConnectionParameters Parameters supplied to create or Update a VPN Connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnConnection Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String gatewayName, - String connectionName, - VpnConnectionInner vpnConnectionParameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (gatewayName == null) { - return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); - } - if (connectionName == null) { - return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); - } - if (vpnConnectionParameters == null) { - return Mono - .error( - new IllegalArgumentException("Parameter vpnConnectionParameters is required and cannot be null.")); - } else { - vpnConnectionParameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - gatewayName, - connectionName, - apiVersion, - vpnConnectionParameters, - accept, - context); - } - - /** - * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param connectionName The name of the connection. - * @param vpnConnectionParameters Parameters supplied to create or Update a VPN Connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnConnection Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, VpnConnectionInner> beginCreateOrUpdateAsync( - String resourceGroupName, - String gatewayName, - String connectionName, - VpnConnectionInner vpnConnectionParameters) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VpnConnectionInner.class, - VpnConnectionInner.class, - this.client.getContext()); - } - - /** - * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param connectionName The name of the connection. - * @param vpnConnectionParameters Parameters supplied to create or Update a VPN Connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnConnection Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, VpnConnectionInner> beginCreateOrUpdateAsync( - String resourceGroupName, - String gatewayName, - String connectionName, - VpnConnectionInner vpnConnectionParameters, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync( - resourceGroupName, gatewayName, connectionName, vpnConnectionParameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), VpnConnectionInner.class, VpnConnectionInner.class, context); - } - - /** - * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param connectionName The name of the connection. - * @param vpnConnectionParameters Parameters supplied to create or Update a VPN Connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnConnection Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VpnConnectionInner> beginCreateOrUpdate( - String resourceGroupName, - String gatewayName, - String connectionName, - VpnConnectionInner vpnConnectionParameters) { - return beginCreateOrUpdateAsync(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters) - .getSyncPoller(); - } - - /** - * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param connectionName The name of the connection. - * @param vpnConnectionParameters Parameters supplied to create or Update a VPN Connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnConnection Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VpnConnectionInner> beginCreateOrUpdate( - String resourceGroupName, - String gatewayName, - String connectionName, - VpnConnectionInner vpnConnectionParameters, - Context context) { - return beginCreateOrUpdateAsync( - resourceGroupName, gatewayName, connectionName, vpnConnectionParameters, context) - .getSyncPoller(); - } - - /** - * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param connectionName The name of the connection. - * @param vpnConnectionParameters Parameters supplied to create or Update a VPN Connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnConnection Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, - String gatewayName, - String connectionName, - VpnConnectionInner vpnConnectionParameters) { - return beginCreateOrUpdateAsync(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param connectionName The name of the connection. - * @param vpnConnectionParameters Parameters supplied to create or Update a VPN Connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnConnection Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, - String gatewayName, - String connectionName, - VpnConnectionInner vpnConnectionParameters, - Context context) { - return beginCreateOrUpdateAsync( - resourceGroupName, gatewayName, connectionName, vpnConnectionParameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param connectionName The name of the connection. - * @param vpnConnectionParameters Parameters supplied to create or Update a VPN Connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnConnection Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VpnConnectionInner createOrUpdate( - String resourceGroupName, - String gatewayName, - String connectionName, - VpnConnectionInner vpnConnectionParameters) { - return createOrUpdateAsync(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters).block(); - } - - /** - * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param connectionName The name of the connection. - * @param vpnConnectionParameters Parameters supplied to create or Update a VPN Connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnConnection Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VpnConnectionInner createOrUpdate( - String resourceGroupName, - String gatewayName, - String connectionName, - VpnConnectionInner vpnConnectionParameters, - Context context) { - return createOrUpdateAsync(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters, context) - .block(); - } - - /** - * Deletes a vpn connection. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param connectionName The name of the connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync( - String resourceGroupName, String gatewayName, String connectionName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (gatewayName == null) { - return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); - } - if (connectionName == null) { - return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - gatewayName, - connectionName, - apiVersion, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a vpn connection. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param connectionName The name of the connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String gatewayName, String connectionName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (gatewayName == null) { - return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); - } - if (connectionName == null) { - return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - gatewayName, - connectionName, - apiVersion, - accept, - context); - } - - /** - * Deletes a vpn connection. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param connectionName The name of the connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String gatewayName, String connectionName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, gatewayName, connectionName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deletes a vpn connection. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param connectionName The name of the connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String gatewayName, String connectionName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, gatewayName, connectionName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes a vpn connection. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param connectionName The name of the connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String gatewayName, String connectionName) { - return beginDeleteAsync(resourceGroupName, gatewayName, connectionName).getSyncPoller(); - } - - /** - * Deletes a vpn connection. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param connectionName The name of the connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String gatewayName, String connectionName, Context context) { - return beginDeleteAsync(resourceGroupName, gatewayName, connectionName, context).getSyncPoller(); - } - - /** - * Deletes a vpn connection. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param connectionName The name of the connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String gatewayName, String connectionName) { - return beginDeleteAsync(resourceGroupName, gatewayName, connectionName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a vpn connection. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param connectionName The name of the connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync( - String resourceGroupName, String gatewayName, String connectionName, Context context) { - return beginDeleteAsync(resourceGroupName, gatewayName, connectionName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a vpn connection. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param connectionName The name of the connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String gatewayName, String connectionName) { - deleteAsync(resourceGroupName, gatewayName, connectionName).block(); - } - - /** - * Deletes a vpn connection. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param connectionName The name of the connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String gatewayName, String connectionName, Context context) { - deleteAsync(resourceGroupName, gatewayName, connectionName, context).block(); - } - - /** - * Retrieves all vpn connections for a particular virtual wan vpn gateway. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list all vpn connections to a virtual wan vpn gateway. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByVpnGatewaySinglePageAsync( - String resourceGroupName, String gatewayName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (gatewayName == null) { - return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByVpnGateway( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - gatewayName, - apiVersion, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Retrieves all vpn connections for a particular virtual wan vpn gateway. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list all vpn connections to a virtual wan vpn gateway. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByVpnGatewaySinglePageAsync( - String resourceGroupName, String gatewayName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (gatewayName == null) { - return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByVpnGateway( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - gatewayName, - apiVersion, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Retrieves all vpn connections for a particular virtual wan vpn gateway. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list all vpn connections to a virtual wan vpn gateway. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByVpnGatewayAsync(String resourceGroupName, String gatewayName) { - return new PagedFlux<>( - () -> listByVpnGatewaySinglePageAsync(resourceGroupName, gatewayName), - nextLink -> listByVpnGatewayNextSinglePageAsync(nextLink)); - } - - /** - * Retrieves all vpn connections for a particular virtual wan vpn gateway. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list all vpn connections to a virtual wan vpn gateway. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByVpnGatewayAsync( - String resourceGroupName, String gatewayName, Context context) { - return new PagedFlux<>( - () -> listByVpnGatewaySinglePageAsync(resourceGroupName, gatewayName, context), - nextLink -> listByVpnGatewayNextSinglePageAsync(nextLink, context)); - } - - /** - * Retrieves all vpn connections for a particular virtual wan vpn gateway. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list all vpn connections to a virtual wan vpn gateway. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByVpnGateway(String resourceGroupName, String gatewayName) { - return new PagedIterable<>(listByVpnGatewayAsync(resourceGroupName, gatewayName)); - } - - /** - * Retrieves all vpn connections for a particular virtual wan vpn gateway. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list all vpn connections to a virtual wan vpn gateway. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByVpnGateway( - String resourceGroupName, String gatewayName, Context context) { - return new PagedIterable<>(listByVpnGatewayAsync(resourceGroupName, gatewayName, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list all vpn connections to a virtual wan vpn gateway. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByVpnGatewayNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByVpnGatewayNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list all vpn connections to a virtual wan vpn gateway. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByVpnGatewayNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByVpnGatewayNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/VpnGatewaysClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/VpnGatewaysClientImpl.java deleted file mode 100644 index 393b1caae620..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/VpnGatewaysClientImpl.java +++ /dev/null @@ -1,1548 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.VpnGatewaysClient; -import com.azure.resourcemanager.network.fluent.models.VpnGatewayInner; -import com.azure.resourcemanager.network.models.ErrorException; -import com.azure.resourcemanager.network.models.ListVpnGatewaysResult; -import com.azure.resourcemanager.network.models.TagsObject; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in VpnGatewaysClient. */ -public final class VpnGatewaysClientImpl - implements InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete, - VpnGatewaysClient { - private final ClientLogger logger = new ClientLogger(VpnGatewaysClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final VpnGatewaysService service; - - /** The service client containing this operation class. */ - private final NetworkManagementClientImpl client; - - /** - * Initializes an instance of VpnGatewaysClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - VpnGatewaysClientImpl(NetworkManagementClientImpl client) { - this.service = - RestProxy.create(VpnGatewaysService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for NetworkManagementClientVpnGateways to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "NetworkManagementCli") - private interface VpnGatewaysService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways" - + "/{gatewayName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ErrorException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("gatewayName") String gatewayName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways" - + "/{gatewayName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ErrorException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("gatewayName") String gatewayName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") VpnGatewayInner vpnGatewayParameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways" - + "/{gatewayName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ErrorException.class) - Mono>> updateTags( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("gatewayName") String gatewayName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") TagsObject vpnGatewayParameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways" - + "/{gatewayName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ErrorException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("gatewayName") String gatewayName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" - + "/vpnGateways") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ErrorException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/vpnGateways") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ErrorException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ErrorException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ErrorException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Retrieves the details of a virtual wan vpn gateway. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String gatewayName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (gatewayName == null) { - return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - gatewayName, - apiVersion, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Retrieves the details of a virtual wan vpn gateway. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String gatewayName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (gatewayName == null) { - return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - gatewayName, - apiVersion, - accept, - context); - } - - /** - * Retrieves the details of a virtual wan vpn gateway. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync(String resourceGroupName, String gatewayName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, gatewayName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Retrieves the details of a virtual wan vpn gateway. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VpnGatewayInner getByResourceGroup(String resourceGroupName, String gatewayName) { - return getByResourceGroupAsync(resourceGroupName, gatewayName).block(); - } - - /** - * Retrieves the details of a virtual wan vpn gateway. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String gatewayName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, gatewayName, context).block(); - } - - /** - * Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param vpnGatewayParameters Parameters supplied to create or Update a virtual wan vpn gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String gatewayName, VpnGatewayInner vpnGatewayParameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (gatewayName == null) { - return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); - } - if (vpnGatewayParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter vpnGatewayParameters is required and cannot be null.")); - } else { - vpnGatewayParameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - gatewayName, - apiVersion, - vpnGatewayParameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param vpnGatewayParameters Parameters supplied to create or Update a virtual wan vpn gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String gatewayName, VpnGatewayInner vpnGatewayParameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (gatewayName == null) { - return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); - } - if (vpnGatewayParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter vpnGatewayParameters is required and cannot be null.")); - } else { - vpnGatewayParameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - gatewayName, - apiVersion, - vpnGatewayParameters, - accept, - context); - } - - /** - * Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param vpnGatewayParameters Parameters supplied to create or Update a virtual wan vpn gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, VpnGatewayInner> beginCreateOrUpdateAsync( - String resourceGroupName, String gatewayName, VpnGatewayInner vpnGatewayParameters) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, gatewayName, vpnGatewayParameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VpnGatewayInner.class, - VpnGatewayInner.class, - this.client.getContext()); - } - - /** - * Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param vpnGatewayParameters Parameters supplied to create or Update a virtual wan vpn gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, VpnGatewayInner> beginCreateOrUpdateAsync( - String resourceGroupName, String gatewayName, VpnGatewayInner vpnGatewayParameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, gatewayName, vpnGatewayParameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), VpnGatewayInner.class, VpnGatewayInner.class, context); - } - - /** - * Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param vpnGatewayParameters Parameters supplied to create or Update a virtual wan vpn gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VpnGatewayInner> beginCreateOrUpdate( - String resourceGroupName, String gatewayName, VpnGatewayInner vpnGatewayParameters) { - return beginCreateOrUpdateAsync(resourceGroupName, gatewayName, vpnGatewayParameters).getSyncPoller(); - } - - /** - * Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param vpnGatewayParameters Parameters supplied to create or Update a virtual wan vpn gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VpnGatewayInner> beginCreateOrUpdate( - String resourceGroupName, String gatewayName, VpnGatewayInner vpnGatewayParameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, gatewayName, vpnGatewayParameters, context).getSyncPoller(); - } - - /** - * Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param vpnGatewayParameters Parameters supplied to create or Update a virtual wan vpn gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, String gatewayName, VpnGatewayInner vpnGatewayParameters) { - return beginCreateOrUpdateAsync(resourceGroupName, gatewayName, vpnGatewayParameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param vpnGatewayParameters Parameters supplied to create or Update a virtual wan vpn gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String gatewayName, VpnGatewayInner vpnGatewayParameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, gatewayName, vpnGatewayParameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param vpnGatewayParameters Parameters supplied to create or Update a virtual wan vpn gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VpnGatewayInner createOrUpdate( - String resourceGroupName, String gatewayName, VpnGatewayInner vpnGatewayParameters) { - return createOrUpdateAsync(resourceGroupName, gatewayName, vpnGatewayParameters).block(); - } - - /** - * Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param vpnGatewayParameters Parameters supplied to create or Update a virtual wan vpn gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VpnGatewayInner createOrUpdate( - String resourceGroupName, String gatewayName, VpnGatewayInner vpnGatewayParameters, Context context) { - return createOrUpdateAsync(resourceGroupName, gatewayName, vpnGatewayParameters, context).block(); - } - - /** - * Updates virtual wan vpn gateway tags. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param vpnGatewayParameters Parameters supplied to update a virtual wan vpn gateway tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateTagsWithResponseAsync( - String resourceGroupName, String gatewayName, TagsObject vpnGatewayParameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (gatewayName == null) { - return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); - } - if (vpnGatewayParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter vpnGatewayParameters is required and cannot be null.")); - } else { - vpnGatewayParameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updateTags( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - gatewayName, - apiVersion, - vpnGatewayParameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates virtual wan vpn gateway tags. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param vpnGatewayParameters Parameters supplied to update a virtual wan vpn gateway tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateTagsWithResponseAsync( - String resourceGroupName, String gatewayName, TagsObject vpnGatewayParameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (gatewayName == null) { - return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); - } - if (vpnGatewayParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter vpnGatewayParameters is required and cannot be null.")); - } else { - vpnGatewayParameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updateTags( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - gatewayName, - apiVersion, - vpnGatewayParameters, - accept, - context); - } - - /** - * Updates virtual wan vpn gateway tags. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param vpnGatewayParameters Parameters supplied to update a virtual wan vpn gateway tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, VpnGatewayInner> beginUpdateTagsAsync( - String resourceGroupName, String gatewayName, TagsObject vpnGatewayParameters) { - Mono>> mono = - updateTagsWithResponseAsync(resourceGroupName, gatewayName, vpnGatewayParameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VpnGatewayInner.class, - VpnGatewayInner.class, - this.client.getContext()); - } - - /** - * Updates virtual wan vpn gateway tags. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param vpnGatewayParameters Parameters supplied to update a virtual wan vpn gateway tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, VpnGatewayInner> beginUpdateTagsAsync( - String resourceGroupName, String gatewayName, TagsObject vpnGatewayParameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - updateTagsWithResponseAsync(resourceGroupName, gatewayName, vpnGatewayParameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), VpnGatewayInner.class, VpnGatewayInner.class, context); - } - - /** - * Updates virtual wan vpn gateway tags. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param vpnGatewayParameters Parameters supplied to update a virtual wan vpn gateway tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VpnGatewayInner> beginUpdateTags( - String resourceGroupName, String gatewayName, TagsObject vpnGatewayParameters) { - return beginUpdateTagsAsync(resourceGroupName, gatewayName, vpnGatewayParameters).getSyncPoller(); - } - - /** - * Updates virtual wan vpn gateway tags. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param vpnGatewayParameters Parameters supplied to update a virtual wan vpn gateway tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VpnGatewayInner> beginUpdateTags( - String resourceGroupName, String gatewayName, TagsObject vpnGatewayParameters, Context context) { - return beginUpdateTagsAsync(resourceGroupName, gatewayName, vpnGatewayParameters, context).getSyncPoller(); - } - - /** - * Updates virtual wan vpn gateway tags. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param vpnGatewayParameters Parameters supplied to update a virtual wan vpn gateway tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateTagsAsync( - String resourceGroupName, String gatewayName, TagsObject vpnGatewayParameters) { - return beginUpdateTagsAsync(resourceGroupName, gatewayName, vpnGatewayParameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates virtual wan vpn gateway tags. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param vpnGatewayParameters Parameters supplied to update a virtual wan vpn gateway tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateTagsAsync( - String resourceGroupName, String gatewayName, TagsObject vpnGatewayParameters, Context context) { - return beginUpdateTagsAsync(resourceGroupName, gatewayName, vpnGatewayParameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates virtual wan vpn gateway tags. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param vpnGatewayParameters Parameters supplied to update a virtual wan vpn gateway tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VpnGatewayInner updateTags(String resourceGroupName, String gatewayName, TagsObject vpnGatewayParameters) { - return updateTagsAsync(resourceGroupName, gatewayName, vpnGatewayParameters).block(); - } - - /** - * Updates virtual wan vpn gateway tags. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param vpnGatewayParameters Parameters supplied to update a virtual wan vpn gateway tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnGateway Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VpnGatewayInner updateTags( - String resourceGroupName, String gatewayName, TagsObject vpnGatewayParameters, Context context) { - return updateTagsAsync(resourceGroupName, gatewayName, vpnGatewayParameters, context).block(); - } - - /** - * Deletes a virtual wan vpn gateway. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync(String resourceGroupName, String gatewayName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (gatewayName == null) { - return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - gatewayName, - apiVersion, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a virtual wan vpn gateway. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String gatewayName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (gatewayName == null) { - return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - gatewayName, - apiVersion, - accept, - context); - } - - /** - * Deletes a virtual wan vpn gateway. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String gatewayName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, gatewayName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deletes a virtual wan vpn gateway. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String gatewayName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(resourceGroupName, gatewayName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes a virtual wan vpn gateway. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete(String resourceGroupName, String gatewayName) { - return beginDeleteAsync(resourceGroupName, gatewayName).getSyncPoller(); - } - - /** - * Deletes a virtual wan vpn gateway. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String gatewayName, Context context) { - return beginDeleteAsync(resourceGroupName, gatewayName, context).getSyncPoller(); - } - - /** - * Deletes a virtual wan vpn gateway. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String gatewayName) { - return beginDeleteAsync(resourceGroupName, gatewayName).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a virtual wan vpn gateway. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String gatewayName, Context context) { - return beginDeleteAsync(resourceGroupName, gatewayName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a virtual wan vpn gateway. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String gatewayName) { - deleteAsync(resourceGroupName, gatewayName).block(); - } - - /** - * Deletes a virtual wan vpn gateway. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param gatewayName The name of the gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String gatewayName, Context context) { - deleteAsync(resourceGroupName, gatewayName, context).block(); - } - - /** - * Lists all the VpnGateways in a resource group. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VpnGateways. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - apiVersion, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all the VpnGateways in a resource group. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VpnGateways. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - apiVersion, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists all the VpnGateways in a resource group. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VpnGateways. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * Lists all the VpnGateways in a resource group. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VpnGateways. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all the VpnGateways in a resource group. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VpnGateways. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * Lists all the VpnGateways in a resource group. - * - * @param resourceGroupName The resource group name of the VpnGateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VpnGateways. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * Lists all the VpnGateways in a subscription. - * - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VpnGateways. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all the VpnGateways in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VpnGateways. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists all the VpnGateways in a subscription. - * - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VpnGateways. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists all the VpnGateways in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VpnGateways. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all the VpnGateways in a subscription. - * - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VpnGateways. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Lists all the VpnGateways in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VpnGateways. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VpnGateways. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VpnGateways. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VpnGateways. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VpnGateways. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/VpnSitesClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/VpnSitesClientImpl.java deleted file mode 100644 index c019ea040be9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/VpnSitesClientImpl.java +++ /dev/null @@ -1,1535 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.VpnSitesClient; -import com.azure.resourcemanager.network.fluent.models.VpnSiteInner; -import com.azure.resourcemanager.network.models.ErrorException; -import com.azure.resourcemanager.network.models.ListVpnSitesResult; -import com.azure.resourcemanager.network.models.TagsObject; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in VpnSitesClient. */ -public final class VpnSitesClientImpl - implements InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete, - VpnSitesClient { - private final ClientLogger logger = new ClientLogger(VpnSitesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final VpnSitesService service; - - /** The service client containing this operation class. */ - private final NetworkManagementClientImpl client; - - /** - * Initializes an instance of VpnSitesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - VpnSitesClientImpl(NetworkManagementClientImpl client) { - this.service = RestProxy.create(VpnSitesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for NetworkManagementClientVpnSites to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "NetworkManagementCli") - private interface VpnSitesService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites" - + "/{vpnSiteName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ErrorException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vpnSiteName") String vpnSiteName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites" - + "/{vpnSiteName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ErrorException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vpnSiteName") String vpnSiteName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") VpnSiteInner vpnSiteParameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites" - + "/{vpnSiteName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ErrorException.class) - Mono>> updateTags( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vpnSiteName") String vpnSiteName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") TagsObject vpnSiteParameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites" - + "/{vpnSiteName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ErrorException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vpnSiteName") String vpnSiteName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ErrorException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/vpnSites") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ErrorException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ErrorException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ErrorException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Retrieves the details of a VPN site. - * - * @param resourceGroupName The resource group name of the VpnSite. - * @param vpnSiteName The name of the VpnSite being retrieved. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnSite Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String vpnSiteName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vpnSiteName == null) { - return Mono.error(new IllegalArgumentException("Parameter vpnSiteName is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - vpnSiteName, - apiVersion, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Retrieves the details of a VPN site. - * - * @param resourceGroupName The resource group name of the VpnSite. - * @param vpnSiteName The name of the VpnSite being retrieved. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnSite Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String vpnSiteName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vpnSiteName == null) { - return Mono.error(new IllegalArgumentException("Parameter vpnSiteName is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - vpnSiteName, - apiVersion, - accept, - context); - } - - /** - * Retrieves the details of a VPN site. - * - * @param resourceGroupName The resource group name of the VpnSite. - * @param vpnSiteName The name of the VpnSite being retrieved. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnSite Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync(String resourceGroupName, String vpnSiteName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, vpnSiteName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Retrieves the details of a VPN site. - * - * @param resourceGroupName The resource group name of the VpnSite. - * @param vpnSiteName The name of the VpnSite being retrieved. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnSite Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VpnSiteInner getByResourceGroup(String resourceGroupName, String vpnSiteName) { - return getByResourceGroupAsync(resourceGroupName, vpnSiteName).block(); - } - - /** - * Retrieves the details of a VPN site. - * - * @param resourceGroupName The resource group name of the VpnSite. - * @param vpnSiteName The name of the VpnSite being retrieved. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnSite Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String vpnSiteName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, vpnSiteName, context).block(); - } - - /** - * Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. - * - * @param resourceGroupName The resource group name of the VpnSite. - * @param vpnSiteName The name of the VpnSite being created or updated. - * @param vpnSiteParameters Parameters supplied to create or update VpnSite. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnSite Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String vpnSiteName, VpnSiteInner vpnSiteParameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vpnSiteName == null) { - return Mono.error(new IllegalArgumentException("Parameter vpnSiteName is required and cannot be null.")); - } - if (vpnSiteParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter vpnSiteParameters is required and cannot be null.")); - } else { - vpnSiteParameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - vpnSiteName, - apiVersion, - vpnSiteParameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. - * - * @param resourceGroupName The resource group name of the VpnSite. - * @param vpnSiteName The name of the VpnSite being created or updated. - * @param vpnSiteParameters Parameters supplied to create or update VpnSite. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnSite Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String vpnSiteName, VpnSiteInner vpnSiteParameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vpnSiteName == null) { - return Mono.error(new IllegalArgumentException("Parameter vpnSiteName is required and cannot be null.")); - } - if (vpnSiteParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter vpnSiteParameters is required and cannot be null.")); - } else { - vpnSiteParameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - vpnSiteName, - apiVersion, - vpnSiteParameters, - accept, - context); - } - - /** - * Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. - * - * @param resourceGroupName The resource group name of the VpnSite. - * @param vpnSiteName The name of the VpnSite being created or updated. - * @param vpnSiteParameters Parameters supplied to create or update VpnSite. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnSite Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, VpnSiteInner> beginCreateOrUpdateAsync( - String resourceGroupName, String vpnSiteName, VpnSiteInner vpnSiteParameters) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, vpnSiteName, vpnSiteParameters); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), VpnSiteInner.class, VpnSiteInner.class, this.client.getContext()); - } - - /** - * Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. - * - * @param resourceGroupName The resource group name of the VpnSite. - * @param vpnSiteName The name of the VpnSite being created or updated. - * @param vpnSiteParameters Parameters supplied to create or update VpnSite. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnSite Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, VpnSiteInner> beginCreateOrUpdateAsync( - String resourceGroupName, String vpnSiteName, VpnSiteInner vpnSiteParameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, vpnSiteName, vpnSiteParameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), VpnSiteInner.class, VpnSiteInner.class, context); - } - - /** - * Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. - * - * @param resourceGroupName The resource group name of the VpnSite. - * @param vpnSiteName The name of the VpnSite being created or updated. - * @param vpnSiteParameters Parameters supplied to create or update VpnSite. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnSite Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VpnSiteInner> beginCreateOrUpdate( - String resourceGroupName, String vpnSiteName, VpnSiteInner vpnSiteParameters) { - return beginCreateOrUpdateAsync(resourceGroupName, vpnSiteName, vpnSiteParameters).getSyncPoller(); - } - - /** - * Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. - * - * @param resourceGroupName The resource group name of the VpnSite. - * @param vpnSiteName The name of the VpnSite being created or updated. - * @param vpnSiteParameters Parameters supplied to create or update VpnSite. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnSite Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VpnSiteInner> beginCreateOrUpdate( - String resourceGroupName, String vpnSiteName, VpnSiteInner vpnSiteParameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, vpnSiteName, vpnSiteParameters, context).getSyncPoller(); - } - - /** - * Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. - * - * @param resourceGroupName The resource group name of the VpnSite. - * @param vpnSiteName The name of the VpnSite being created or updated. - * @param vpnSiteParameters Parameters supplied to create or update VpnSite. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnSite Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, String vpnSiteName, VpnSiteInner vpnSiteParameters) { - return beginCreateOrUpdateAsync(resourceGroupName, vpnSiteName, vpnSiteParameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. - * - * @param resourceGroupName The resource group name of the VpnSite. - * @param vpnSiteName The name of the VpnSite being created or updated. - * @param vpnSiteParameters Parameters supplied to create or update VpnSite. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnSite Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String vpnSiteName, VpnSiteInner vpnSiteParameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, vpnSiteName, vpnSiteParameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. - * - * @param resourceGroupName The resource group name of the VpnSite. - * @param vpnSiteName The name of the VpnSite being created or updated. - * @param vpnSiteParameters Parameters supplied to create or update VpnSite. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnSite Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VpnSiteInner createOrUpdate(String resourceGroupName, String vpnSiteName, VpnSiteInner vpnSiteParameters) { - return createOrUpdateAsync(resourceGroupName, vpnSiteName, vpnSiteParameters).block(); - } - - /** - * Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. - * - * @param resourceGroupName The resource group name of the VpnSite. - * @param vpnSiteName The name of the VpnSite being created or updated. - * @param vpnSiteParameters Parameters supplied to create or update VpnSite. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnSite Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VpnSiteInner createOrUpdate( - String resourceGroupName, String vpnSiteName, VpnSiteInner vpnSiteParameters, Context context) { - return createOrUpdateAsync(resourceGroupName, vpnSiteName, vpnSiteParameters, context).block(); - } - - /** - * Updates VpnSite tags. - * - * @param resourceGroupName The resource group name of the VpnSite. - * @param vpnSiteName The name of the VpnSite being updated. - * @param vpnSiteParameters Parameters supplied to update VpnSite tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnSite Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateTagsWithResponseAsync( - String resourceGroupName, String vpnSiteName, TagsObject vpnSiteParameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vpnSiteName == null) { - return Mono.error(new IllegalArgumentException("Parameter vpnSiteName is required and cannot be null.")); - } - if (vpnSiteParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter vpnSiteParameters is required and cannot be null.")); - } else { - vpnSiteParameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updateTags( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - vpnSiteName, - apiVersion, - vpnSiteParameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates VpnSite tags. - * - * @param resourceGroupName The resource group name of the VpnSite. - * @param vpnSiteName The name of the VpnSite being updated. - * @param vpnSiteParameters Parameters supplied to update VpnSite tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnSite Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateTagsWithResponseAsync( - String resourceGroupName, String vpnSiteName, TagsObject vpnSiteParameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vpnSiteName == null) { - return Mono.error(new IllegalArgumentException("Parameter vpnSiteName is required and cannot be null.")); - } - if (vpnSiteParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter vpnSiteParameters is required and cannot be null.")); - } else { - vpnSiteParameters.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updateTags( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - vpnSiteName, - apiVersion, - vpnSiteParameters, - accept, - context); - } - - /** - * Updates VpnSite tags. - * - * @param resourceGroupName The resource group name of the VpnSite. - * @param vpnSiteName The name of the VpnSite being updated. - * @param vpnSiteParameters Parameters supplied to update VpnSite tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnSite Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, VpnSiteInner> beginUpdateTagsAsync( - String resourceGroupName, String vpnSiteName, TagsObject vpnSiteParameters) { - Mono>> mono = - updateTagsWithResponseAsync(resourceGroupName, vpnSiteName, vpnSiteParameters); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), VpnSiteInner.class, VpnSiteInner.class, this.client.getContext()); - } - - /** - * Updates VpnSite tags. - * - * @param resourceGroupName The resource group name of the VpnSite. - * @param vpnSiteName The name of the VpnSite being updated. - * @param vpnSiteParameters Parameters supplied to update VpnSite tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnSite Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, VpnSiteInner> beginUpdateTagsAsync( - String resourceGroupName, String vpnSiteName, TagsObject vpnSiteParameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - updateTagsWithResponseAsync(resourceGroupName, vpnSiteName, vpnSiteParameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), VpnSiteInner.class, VpnSiteInner.class, context); - } - - /** - * Updates VpnSite tags. - * - * @param resourceGroupName The resource group name of the VpnSite. - * @param vpnSiteName The name of the VpnSite being updated. - * @param vpnSiteParameters Parameters supplied to update VpnSite tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnSite Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VpnSiteInner> beginUpdateTags( - String resourceGroupName, String vpnSiteName, TagsObject vpnSiteParameters) { - return beginUpdateTagsAsync(resourceGroupName, vpnSiteName, vpnSiteParameters).getSyncPoller(); - } - - /** - * Updates VpnSite tags. - * - * @param resourceGroupName The resource group name of the VpnSite. - * @param vpnSiteName The name of the VpnSite being updated. - * @param vpnSiteParameters Parameters supplied to update VpnSite tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnSite Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VpnSiteInner> beginUpdateTags( - String resourceGroupName, String vpnSiteName, TagsObject vpnSiteParameters, Context context) { - return beginUpdateTagsAsync(resourceGroupName, vpnSiteName, vpnSiteParameters, context).getSyncPoller(); - } - - /** - * Updates VpnSite tags. - * - * @param resourceGroupName The resource group name of the VpnSite. - * @param vpnSiteName The name of the VpnSite being updated. - * @param vpnSiteParameters Parameters supplied to update VpnSite tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnSite Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateTagsAsync( - String resourceGroupName, String vpnSiteName, TagsObject vpnSiteParameters) { - return beginUpdateTagsAsync(resourceGroupName, vpnSiteName, vpnSiteParameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates VpnSite tags. - * - * @param resourceGroupName The resource group name of the VpnSite. - * @param vpnSiteName The name of the VpnSite being updated. - * @param vpnSiteParameters Parameters supplied to update VpnSite tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnSite Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateTagsAsync( - String resourceGroupName, String vpnSiteName, TagsObject vpnSiteParameters, Context context) { - return beginUpdateTagsAsync(resourceGroupName, vpnSiteName, vpnSiteParameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates VpnSite tags. - * - * @param resourceGroupName The resource group name of the VpnSite. - * @param vpnSiteName The name of the VpnSite being updated. - * @param vpnSiteParameters Parameters supplied to update VpnSite tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnSite Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VpnSiteInner updateTags(String resourceGroupName, String vpnSiteName, TagsObject vpnSiteParameters) { - return updateTagsAsync(resourceGroupName, vpnSiteName, vpnSiteParameters).block(); - } - - /** - * Updates VpnSite tags. - * - * @param resourceGroupName The resource group name of the VpnSite. - * @param vpnSiteName The name of the VpnSite being updated. - * @param vpnSiteParameters Parameters supplied to update VpnSite tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vpnSite Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VpnSiteInner updateTags( - String resourceGroupName, String vpnSiteName, TagsObject vpnSiteParameters, Context context) { - return updateTagsAsync(resourceGroupName, vpnSiteName, vpnSiteParameters, context).block(); - } - - /** - * Deletes a VpnSite. - * - * @param resourceGroupName The resource group name of the VpnSite. - * @param vpnSiteName The name of the VpnSite being deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync(String resourceGroupName, String vpnSiteName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vpnSiteName == null) { - return Mono.error(new IllegalArgumentException("Parameter vpnSiteName is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - vpnSiteName, - apiVersion, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a VpnSite. - * - * @param resourceGroupName The resource group name of the VpnSite. - * @param vpnSiteName The name of the VpnSite being deleted. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String vpnSiteName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vpnSiteName == null) { - return Mono.error(new IllegalArgumentException("Parameter vpnSiteName is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - vpnSiteName, - apiVersion, - accept, - context); - } - - /** - * Deletes a VpnSite. - * - * @param resourceGroupName The resource group name of the VpnSite. - * @param vpnSiteName The name of the VpnSite being deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String vpnSiteName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, vpnSiteName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deletes a VpnSite. - * - * @param resourceGroupName The resource group name of the VpnSite. - * @param vpnSiteName The name of the VpnSite being deleted. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String vpnSiteName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(resourceGroupName, vpnSiteName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes a VpnSite. - * - * @param resourceGroupName The resource group name of the VpnSite. - * @param vpnSiteName The name of the VpnSite being deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete(String resourceGroupName, String vpnSiteName) { - return beginDeleteAsync(resourceGroupName, vpnSiteName).getSyncPoller(); - } - - /** - * Deletes a VpnSite. - * - * @param resourceGroupName The resource group name of the VpnSite. - * @param vpnSiteName The name of the VpnSite being deleted. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String vpnSiteName, Context context) { - return beginDeleteAsync(resourceGroupName, vpnSiteName, context).getSyncPoller(); - } - - /** - * Deletes a VpnSite. - * - * @param resourceGroupName The resource group name of the VpnSite. - * @param vpnSiteName The name of the VpnSite being deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String vpnSiteName) { - return beginDeleteAsync(resourceGroupName, vpnSiteName).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a VpnSite. - * - * @param resourceGroupName The resource group name of the VpnSite. - * @param vpnSiteName The name of the VpnSite being deleted. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String vpnSiteName, Context context) { - return beginDeleteAsync(resourceGroupName, vpnSiteName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a VpnSite. - * - * @param resourceGroupName The resource group name of the VpnSite. - * @param vpnSiteName The name of the VpnSite being deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String vpnSiteName) { - deleteAsync(resourceGroupName, vpnSiteName).block(); - } - - /** - * Deletes a VpnSite. - * - * @param resourceGroupName The resource group name of the VpnSite. - * @param vpnSiteName The name of the VpnSite being deleted. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String vpnSiteName, Context context) { - deleteAsync(resourceGroupName, vpnSiteName, context).block(); - } - - /** - * Lists all the vpnSites in a resource group. - * - * @param resourceGroupName The resource group name of the VpnSite. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VpnSites. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - apiVersion, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all the vpnSites in a resource group. - * - * @param resourceGroupName The resource group name of the VpnSite. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VpnSites. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - apiVersion, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists all the vpnSites in a resource group. - * - * @param resourceGroupName The resource group name of the VpnSite. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VpnSites. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * Lists all the vpnSites in a resource group. - * - * @param resourceGroupName The resource group name of the VpnSite. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VpnSites. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all the vpnSites in a resource group. - * - * @param resourceGroupName The resource group name of the VpnSite. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VpnSites. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * Lists all the vpnSites in a resource group. - * - * @param resourceGroupName The resource group name of the VpnSite. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VpnSites. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * Lists all the VpnSites in a subscription. - * - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VpnSites. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all the VpnSites in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VpnSites. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists all the VpnSites in a subscription. - * - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VpnSites. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists all the VpnSites in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VpnSites. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all the VpnSites in a subscription. - * - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VpnSites. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Lists all the VpnSites in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VpnSites. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VpnSites. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VpnSites. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VpnSites. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list VpnSites. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/VpnSitesConfigurationsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/VpnSitesConfigurationsClientImpl.java deleted file mode 100644 index ca5833869195..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/VpnSitesConfigurationsClientImpl.java +++ /dev/null @@ -1,340 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.network.fluent.VpnSitesConfigurationsClient; -import com.azure.resourcemanager.network.models.ErrorException; -import com.azure.resourcemanager.network.models.GetVpnSitesConfigurationRequest; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in VpnSitesConfigurationsClient. */ -public final class VpnSitesConfigurationsClientImpl implements VpnSitesConfigurationsClient { - private final ClientLogger logger = new ClientLogger(VpnSitesConfigurationsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final VpnSitesConfigurationsService service; - - /** The service client containing this operation class. */ - private final NetworkManagementClientImpl client; - - /** - * Initializes an instance of VpnSitesConfigurationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - VpnSitesConfigurationsClientImpl(NetworkManagementClientImpl client) { - this.service = - RestProxy - .create(VpnSitesConfigurationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for NetworkManagementClientVpnSitesConfigurations to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "NetworkManagementCli") - private interface VpnSitesConfigurationsService { - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans" - + "/{virtualWANName}/vpnConfiguration") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ErrorException.class) - Mono>> download( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualWANName") String virtualWanName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") GetVpnSitesConfigurationRequest request, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gives the sas-url to download the configurations for vpn-sites in a resource group. - * - * @param resourceGroupName The resource group name. - * @param virtualWanName The name of the VirtualWAN for which configuration of all vpn-sites is needed. - * @param request Parameters supplied to download vpn-sites configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> downloadWithResponseAsync( - String resourceGroupName, String virtualWanName, GetVpnSitesConfigurationRequest request) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualWanName == null) { - return Mono.error(new IllegalArgumentException("Parameter virtualWanName is required and cannot be null.")); - } - if (request == null) { - return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); - } else { - request.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .download( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - virtualWanName, - apiVersion, - request, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gives the sas-url to download the configurations for vpn-sites in a resource group. - * - * @param resourceGroupName The resource group name. - * @param virtualWanName The name of the VirtualWAN for which configuration of all vpn-sites is needed. - * @param request Parameters supplied to download vpn-sites configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> downloadWithResponseAsync( - String resourceGroupName, String virtualWanName, GetVpnSitesConfigurationRequest request, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualWanName == null) { - return Mono.error(new IllegalArgumentException("Parameter virtualWanName is required and cannot be null.")); - } - if (request == null) { - return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); - } else { - request.validate(); - } - final String apiVersion = "2018-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .download( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - virtualWanName, - apiVersion, - request, - accept, - context); - } - - /** - * Gives the sas-url to download the configurations for vpn-sites in a resource group. - * - * @param resourceGroupName The resource group name. - * @param virtualWanName The name of the VirtualWAN for which configuration of all vpn-sites is needed. - * @param request Parameters supplied to download vpn-sites configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDownloadAsync( - String resourceGroupName, String virtualWanName, GetVpnSitesConfigurationRequest request) { - Mono>> mono = downloadWithResponseAsync(resourceGroupName, virtualWanName, request); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Gives the sas-url to download the configurations for vpn-sites in a resource group. - * - * @param resourceGroupName The resource group name. - * @param virtualWanName The name of the VirtualWAN for which configuration of all vpn-sites is needed. - * @param request Parameters supplied to download vpn-sites configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDownloadAsync( - String resourceGroupName, String virtualWanName, GetVpnSitesConfigurationRequest request, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - downloadWithResponseAsync(resourceGroupName, virtualWanName, request, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Gives the sas-url to download the configurations for vpn-sites in a resource group. - * - * @param resourceGroupName The resource group name. - * @param virtualWanName The name of the VirtualWAN for which configuration of all vpn-sites is needed. - * @param request Parameters supplied to download vpn-sites configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDownload( - String resourceGroupName, String virtualWanName, GetVpnSitesConfigurationRequest request) { - return beginDownloadAsync(resourceGroupName, virtualWanName, request).getSyncPoller(); - } - - /** - * Gives the sas-url to download the configurations for vpn-sites in a resource group. - * - * @param resourceGroupName The resource group name. - * @param virtualWanName The name of the VirtualWAN for which configuration of all vpn-sites is needed. - * @param request Parameters supplied to download vpn-sites configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDownload( - String resourceGroupName, String virtualWanName, GetVpnSitesConfigurationRequest request, Context context) { - return beginDownloadAsync(resourceGroupName, virtualWanName, request, context).getSyncPoller(); - } - - /** - * Gives the sas-url to download the configurations for vpn-sites in a resource group. - * - * @param resourceGroupName The resource group name. - * @param virtualWanName The name of the VirtualWAN for which configuration of all vpn-sites is needed. - * @param request Parameters supplied to download vpn-sites configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono downloadAsync( - String resourceGroupName, String virtualWanName, GetVpnSitesConfigurationRequest request) { - return beginDownloadAsync(resourceGroupName, virtualWanName, request) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Gives the sas-url to download the configurations for vpn-sites in a resource group. - * - * @param resourceGroupName The resource group name. - * @param virtualWanName The name of the VirtualWAN for which configuration of all vpn-sites is needed. - * @param request Parameters supplied to download vpn-sites configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono downloadAsync( - String resourceGroupName, String virtualWanName, GetVpnSitesConfigurationRequest request, Context context) { - return beginDownloadAsync(resourceGroupName, virtualWanName, request, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Gives the sas-url to download the configurations for vpn-sites in a resource group. - * - * @param resourceGroupName The resource group name. - * @param virtualWanName The name of the VirtualWAN for which configuration of all vpn-sites is needed. - * @param request Parameters supplied to download vpn-sites configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void download(String resourceGroupName, String virtualWanName, GetVpnSitesConfigurationRequest request) { - downloadAsync(resourceGroupName, virtualWanName, request).block(); - } - - /** - * Gives the sas-url to download the configurations for vpn-sites in a resource group. - * - * @param resourceGroupName The resource group name. - * @param virtualWanName The name of the VirtualWAN for which configuration of all vpn-sites is needed. - * @param request Parameters supplied to download vpn-sites configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void download( - String resourceGroupName, String virtualWanName, GetVpnSitesConfigurationRequest request, Context context) { - downloadAsync(resourceGroupName, virtualWanName, request, context).block(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/Access.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/Access.java deleted file mode 100644 index e0f7c6f1e562..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/Access.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for Access. */ -public final class Access extends ExpandableStringEnum { - /** Static value Allow for Access. */ - public static final Access ALLOW = fromString("Allow"); - - /** Static value Deny for Access. */ - public static final Access DENY = fromString("Deny"); - - /** - * Creates or finds a Access from its string representation. - * - * @param name a name to look for. - * @return the corresponding Access. - */ - @JsonCreator - public static Access fromString(String name) { - return fromString(name, Access.class); - } - - /** @return known Access values. */ - public static Collection values() { - return values(Access.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AddressSpace.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AddressSpace.java deleted file mode 100644 index 3e76e1563281..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AddressSpace.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** AddressSpace contains an array of IP address ranges that can be used by subnets of the virtual network. */ -@Fluent -public final class AddressSpace { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AddressSpace.class); - - /* - * A list of address blocks reserved for this virtual network in CIDR - * notation. - */ - @JsonProperty(value = "addressPrefixes") - private List addressPrefixes; - - /** - * Get the addressPrefixes property: A list of address blocks reserved for this virtual network in CIDR notation. - * - * @return the addressPrefixes value. - */ - public List addressPrefixes() { - return this.addressPrefixes; - } - - /** - * Set the addressPrefixes property: A list of address blocks reserved for this virtual network in CIDR notation. - * - * @param addressPrefixes the addressPrefixes value to set. - * @return the AddressSpace object itself. - */ - public AddressSpace withAddressPrefixes(List addressPrefixes) { - this.addressPrefixes = addressPrefixes; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AppliableWithTags.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AppliableWithTags.java deleted file mode 100644 index 1e515ee11f57..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AppliableWithTags.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.network.models; - -import reactor.core.publisher.Mono; - -/** - * The base interface for all template interfaces that support update tags operations. - * - * @param the type of the resource returned from the update. - */ -public interface AppliableWithTags extends UpdatableWithTags.UpdateWithTags { - /** - * Execute the update request. - * - * @return the updated resource - */ - T applyTags(); - - /** - * Execute the update request asynchronously. - * - * @return the handle to the REST call - */ - Mono applyTagsAsync(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGateway.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGateway.java deleted file mode 100644 index 62c603d32529..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGateway.java +++ /dev/null @@ -1,1237 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.network.fluent.models.ApplicationGatewayInner; -import com.azure.resourcemanager.resources.fluentcore.arm.AvailabilityZoneId; -import com.azure.resourcemanager.resources.fluentcore.arm.models.GroupableResource; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasSubnet; -import com.azure.resourcemanager.resources.fluentcore.arm.models.Resource; -import com.azure.resourcemanager.resources.fluentcore.model.Appliable; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; -import com.azure.resourcemanager.resources.fluentcore.model.Updatable; -import java.util.Collection; -import java.util.Map; -import java.util.Set; -import reactor.core.publisher.Mono; - -/** Entry point for application gateway management API in Azure. */ -public interface ApplicationGateway - extends GroupableResource, - Refreshable, - Updatable, - UpdatableWithTags, - HasSubnet, - HasPrivateIpAddress { - - // Actions - - /** Starts the application gateway. */ - void start(); - - /** - * Checks the backend health. - * - * @return backend healths indexed by backend name - */ - Map checkBackendHealth(); - - /** - * Checks the backend health asynchronously. - * - * @return a representation of the future computation of this call - */ - Mono> checkBackendHealthAsync(); - - /** Stops the application gateway. */ - void stop(); - - /** - * Starts the application gateway asynchronously. - * - * @return a representation of the deferred computation of this call - */ - Mono startAsync(); - - /** - * Stops the application gateway asynchronously. - * - * @return a representation of the deferred computation of this call - */ - Mono stopAsync(); - - // Getters - - /** @return disabled SSL protocols */ - Collection disabledSslProtocols(); - - /** - * @return true if the application gateway has at least one internally load balanced frontend accessible within the - * virtual network - */ - boolean isPrivate(); - - /** @return true if the application gateway has at least one Internet-facing frontend */ - boolean isPublic(); - - /** - * @return the frontend IP configuration associated with a public IP address, if any, that frontend listeners and - * request routing rules can reference implicitly - */ - ApplicationGatewayFrontend defaultPublicFrontend(); - - /** - * @return the frontend IP configuration associated with a private IP address, if any, that frontend listeners and - * request routing rules can reference implicitly - */ - ApplicationGatewayFrontend defaultPrivateFrontend(); - - /** @return the SKU of this application gateway */ - ApplicationGatewaySku sku(); - - /** @return number of instances */ - int instanceCount(); - - /** @return the size of the application gateway */ - ApplicationGatewaySkuName size(); - - /** @return the tier of the application gateway */ - ApplicationGatewayTier tier(); - - /** @return the autoscaleConfiguration value. */ - ApplicationGatewayAutoscaleConfiguration autoscaleConfiguration(); - - /** @return the webApplicationFirewallConfiguration value. */ - ApplicationGatewayWebApplicationFirewallConfiguration webApplicationFirewallConfiguration(); - - /** @return the operational state of the application gateway */ - ApplicationGatewayOperationalState operationalState(); - - /** @return IP configurations of this application gateway, indexed by name */ - Map ipConfigurations(); - - /** @return backend address pools of this application gateway, indexed by name */ - Map backends(); - - /** @return probes of this application gateway, indexed by name */ - Map probes(); - - /** @return the existing IP configurations if only one exists, else null */ - ApplicationGatewayIpConfiguration defaultIPConfiguration(); - - /** @return frontend IP configurations, indexed by name */ - Map frontends(); - - /** @return frontend IP configurations with a public IP address, indexed by name */ - Map publicFrontends(); - - /** @return frontend IP configurations with a private IP address within a subnet, indexed by name */ - Map privateFrontends(); - - /** @return named frontend ports of this application gateway, indexed by name */ - Map frontendPorts(); - - /** @return backend HTTP configurations of this application gateway, indexed by name */ - Map backendHttpConfigurations(); - - /** @return SSL certificates, indexed by name */ - Map sslCertificates(); - - /** @return frontend listeners, indexed by name */ - Map listeners(); - - /** @return redirect configurations, indexed by name */ - Map redirectConfigurations(); - - /** @return URL path maps, indexed by name (case sensitive) */ - Map urlPathMaps(); - - /** @return request routing rules, indexed by name */ - Map requestRoutingRules(); - - /** @return authentication certificates */ - Map authenticationCertificates(); - - /** @return whether HTTP2 enabled for the application gateway */ - boolean isHttp2Enabled(); - - /** - * The availability zones assigned to the application gateway. - * - *

    Note, this functionality is not enabled for most subscriptions and is subject to significant redesign and/or - * removal in the future. - * - * @return the availability zones assigned to the application gateway. - */ - Set availabilityZones(); - - /** - * Returns the name of the existing port, if any, that is associated with the specified port number. - * - * @param portNumber a port number - * @return the existing port name for that port number, or null if none found - */ - String frontendPortNameFromNumber(int portNumber); - - /** - * Finds a front end listener associated with the specified front end port number, if any. - * - * @param portNumber a used port number - * @return a front end listener, or null if none found - */ - ApplicationGatewayListener listenerByPortNumber(int portNumber); - - /** Grouping of application gateway definition stages. */ - interface DefinitionStages { - /** The first stage of an application gateway definition. */ - interface Blank extends GroupableResource.DefinitionWithRegion { - } - - /** The stage of an application gateway definition allowing to specify the resource group. */ - interface WithGroup extends GroupableResource.DefinitionStages.WithGroup { - } - - /** - * The stage of an application gateway definition allowing to add a new Internet-facing frontend with a public - * IP address. - */ - interface WithPublicIPAddress - extends HasPublicIpAddress.DefinitionStages.WithPublicIPAddressNoDnsLabel { - } - - /** - * The stage of an application gateway definition allowing to define one or more public, or Internet-facing, - * frontends. - */ - interface WithPublicFrontend extends WithPublicIPAddress { - /** - * Specifies that the application gateway should not be Internet-facing. - * - * @return the next stage of the definition - */ - WithCreate withoutPublicFrontend(); - } - - /** - * The stage of an internal application gateway definition allowing to make the application gateway accessible - * to its virtual network. - */ - interface WithPrivateFrontend { - /** - * Enables a private (internal) default frontend within the subnet containing the application gateway. - * - *

    A frontend with an automatically generated name will be created if none exists. - * - * @return the next stage of the definition - */ - WithCreate withPrivateFrontend(); - - /** - * Specifies that no private (internal) frontend should be enabled. - * - * @return the next stage of the definition - */ - WithCreate withoutPrivateFrontend(); - } - - /** The stage of an application gateway definition allowing to add a listener. */ - interface WithListener { - /** - * Begins the definition of a new application gateway listener to be attached to the gateway. - * - * @param name a unique name for the listener - * @return the first stage of the listener definition - */ - ApplicationGatewayListener.DefinitionStages.Blank defineListener(String name); - } - - /** The stage of an application gateway definition allowing to add a redirect configuration. */ - interface WithRedirectConfiguration { - /** - * Begins the definition of a new application gateway redirect configuration to be attached to the gateway. - * - * @param name a unique name for the redirect configuration - * @return the first stage of the redirect configuration definition - */ - ApplicationGatewayRedirectConfiguration.DefinitionStages.Blank defineRedirectConfiguration( - String name); - } - - /** The stage of an application gateway definition allowing to add a probe. */ - interface WithProbe { - /** - * Begins the definition of a new probe. - * - * @param name a unique name for the probe - * @return the first stage of a probe definition - */ - ApplicationGatewayProbe.DefinitionStages.Blank defineProbe(String name); - } - - /** The stage of an application gateway definition allowing to add a frontend port. */ - interface WithFrontendPort { - /** - * Creates a frontend port with an auto-generated name and the specified port number, unless one already - * exists. - * - * @param portNumber a port number - * @return the next stage of the definition - */ - WithCreate withFrontendPort(int portNumber); - - /** - * Creates a frontend port with the specified name and port number, unless a port matching this name and/or - * number already exists. - * - * @param portNumber a port number - * @param name the name to assign to the port - * @return the next stage of the definition, or null if a port matching either the name or the number, but - * not both, already exists. - */ - WithCreate withFrontendPort(int portNumber, String name); - } - - /** - * The stage of an application gateway definition allowing to add an SSL certificate to be used by HTTPS - * listeners. - */ - interface WithSslCert { - /** - * Begins the definition of a new application gateway SSL certificate to be attached to the gateway for use - * in HTTPS listeners. - * - * @param name a unique name for the certificate - * @return the first stage of the certificate definition - */ - ApplicationGatewaySslCertificate.DefinitionStages.Blank defineSslCertificate(String name); - } - - /** - * The stage of an application gateway definition allowing to add an authentication certificate for the backends - * to use. - */ - interface WithAuthenticationCertificate { - /** - * Begins the definition of a new application gateway authentication certificate to be attached to the - * gateway for use by the backends. - * - * @param name a unique name for the certificate - * @return the first stage of the certificate definition - */ - ApplicationGatewayAuthenticationCertificate.DefinitionStages.Blank - defineAuthenticationCertificate(String name); - } - - /** The stage of an application gateway definition allowing to add a backend. */ - interface WithBackend { - /** - * Begins the definition of a new application gateway backend to be attached to the gateway. - * - * @param name a unique name for the backend - * @return the first stage of the backend definition - */ - ApplicationGatewayBackend.DefinitionStages.Blank defineBackend(String name); - } - - /** The stage of an application gateway definition allowing to add a backend HTTP configuration. */ - interface WithBackendHttpConfig { - /** - * Begins the definition of a new application gateway backend HTTP configuration to be attached to the - * gateway. - * - * @param name a unique name for the backend HTTP configuration - * @return the first stage of the backend HTTP configuration definition - */ - ApplicationGatewayBackendHttpConfiguration.DefinitionStages.Blank - defineBackendHttpConfiguration(String name); - } - - /** The stage of an application gateway definition allowing to add a request routing rule. */ - interface WithRequestRoutingRule { - /** - * Begins the definition of a request routing rule for this application gateway. - * - * @param name a unique name for the request routing rule - * @return the first stage of the request routing rule - */ - ApplicationGatewayRequestRoutingRule.DefinitionStages.Blank - defineRequestRoutingRule(String name); - - /** - * Begins the definition of a new application gateway path-based request routing rule and URL path map to be - * attached to the gateway. Note: both will be created with the same name and attached to the gateway. - * - * @param name a unique name for the URL path map - * @return the first stage of the URL path map definition - */ - ApplicationGatewayUrlPathMap.DefinitionStages.Blank - definePathBasedRoutingRule(String name); - } - - /** - * The stage of an application gateway definition allowing to continue adding more request routing rules, or - * start specifying optional settings, or create the application gateway. - */ - interface WithRequestRoutingRuleOrCreate extends WithRequestRoutingRule, WithCreate { - } - - /** The stage of an application gateway update allowing to specify the sku. */ - interface WithSku { - /** - * Set tier of an application gateway. Possible values include: 'Standard', 'WAF', 'Standard_v2', 'WAF_v2'. - * - * @param tier the tier value to set - * @return the next stage of the definition - */ - WithCreate withTier(ApplicationGatewayTier tier); - - /** - * Specifies the size of the application gateway to create within the context of the selected tier. The API - * refers to this as the "SKU"/"SkuName", the docs refer to this as the "size" (and docs call Standard vs - * WAF as the "SKU"), while the portal refers to this as the "SKU size"... The documentation naming sounds - * the most correct, so following that here. - * - *

    By default, the smallest size is used. - * - * @param size an application gateway SKU name - * @return the next stage of the definition - */ - WithCreate withSize(ApplicationGatewaySkuName size); - } - - /** The stage of the applicationgateway update allowing to specify WebApplicationFirewallConfiguration. */ - interface WithWebApplicationFirewall { - - /** - * Specifies webApplicationFirewallConfiguration with default values. - * - * @param enabled enable the firewall when created - * @param mode Web application firewall mode. - * @return the next stage of the definition - */ - WithCreate withWebApplicationFirewall(boolean enabled, ApplicationGatewayFirewallMode mode); - - /** - * Specifies webApplicationFirewallConfiguration. - * - * @param webApplicationFirewallConfiguration Web application firewall configuration - * @return the next stage of the definition - */ - WithCreate withWebApplicationFirewall( - ApplicationGatewayWebApplicationFirewallConfiguration webApplicationFirewallConfiguration); - } - - /** - * The stage of an application gateway definition allowing to specify the capacity (number of instances) of the - * application gateway. - */ - interface WithInstanceCount { - /** - * Specifies the capacity (number of instances) for the application gateway. The API refers to this as - * "Capacity", but the portal and the docs refer to this as "instance count", so using that naming here - * - *

    By default, 1 instance is used. - * - * @param instanceCount the capacity as a number between 1 and 10 but also based on the limits imposed by - * the selected application gateway size - * @return the next stage of the definition - */ - WithCreate withInstanceCount(int instanceCount); - - /** - * Specifies the min and max auto scale bound. - * - * @param minCapacity Lower bound on number of Application Gateway capacity. - * @param maxCapacity Upper bound on number of Application Gateway capacity. - * @return the next stage of the definition - */ - WithCreate withAutoScale(int minCapacity, int maxCapacity); - } - - /** - * The stage of an application gateway definition allowing to specify the subnet the app gateway is getting its - * private IP address from. - */ - interface WithExistingSubnet extends HasSubnet.DefinitionStages.WithSubnet { - /** - * Specifies the subnet the application gateway gets its private IP address from. - * - *

    This will create a new IP configuration, if it does not already exist. - * - *

    Private (internal) frontends, if any have been enabled, will be configured to use this subnet as well. - * - * @param subnet an existing subnet - * @return the next stage of the definition - */ - WithCreate withExistingSubnet(Subnet subnet); - - /** - * Specifies the subnet the application gateway gets its private IP address from. - * - *

    This will create a new IP configuration, if it does not already exist. - * - *

    Private (internal) frontends, if any have been enabled, will be configured to use this subnet as well. - * - * @param network the virtual network the subnet is part of - * @param subnetName the name of a subnet within the selected network - * @return the next stage of the definition - */ - WithCreate withExistingSubnet(Network network, String subnetName); - } - - /** - * The stage of an application gateway definition allowing to specify the default IP address the app gateway - * will be internally available at, if a default private frontend has been enabled. - */ - interface WithPrivateIPAddress extends HasPrivateIpAddress.DefinitionStages.WithPrivateIPAddress { - } - - /** The stage of an application gateway definition allowing to specify Managed Service Identities. */ - interface WithManagedServiceIdentity { - /** - * Specifies an identity to be associated with the application gateway. - * - * @param identity the identity - * @return the next stage of the definition - */ - WithCreate withIdentity(ManagedServiceIdentity identity); - } - - /** The stage of an application gateway definition allowing to specify the SSL protocols to disable. */ - interface WithDisabledSslProtocol { - /** - * Disables the specified SSL protocol. - * - * @param protocol an SSL protocol - * @return the next stage of the definition - */ - WithCreate withDisabledSslProtocol(ApplicationGatewaySslProtocol protocol); - - /** - * Disables the specified SSL protocols. - * - * @param protocols SSL protocols - * @return the next stage of the definition - */ - WithCreate withDisabledSslProtocols(ApplicationGatewaySslProtocol... protocols); - } - - /** The stage of the application gateway definition allowing to specify availability zone. */ - interface WithAvailabilityZone { - /** - * Specifies the availability zone for the application gateway. - * - *

    Note, this functionality is not enabled for most subscriptions and is subject to significant redesign - * and/or removal in the future. - * - * @param zoneId the zone identifier. - * @return the next stage of the definition - */ - WithCreate withAvailabilityZone(AvailabilityZoneId zoneId); - } - - /** - * The stage of the application gateway definition allowing to specify whether HTTP2 is enabled on the - * application gateway. - */ - interface WithHttp2 { - /** - * Enables HTTP2 for the application gateway. - * - * @return the next stage of the definition - */ - WithCreate withHttp2(); - - /** - * Disables HTTP2 for the application gateway. - * - * @return the next stage of the definition - */ - WithCreate withoutHttp2(); - } - - /** - * The stage of an application gateway definition containing all the required inputs for the resource to be - * created, but also allowing for any other optional settings to be specified. - */ - interface WithCreate - extends Creatable, - Resource.DefinitionWithTags, - WithSku, - WithInstanceCount, - WithWebApplicationFirewall, - WithSslCert, - WithFrontendPort, - WithListener, - WithBackendHttpConfig, - WithBackend, - WithExistingSubnet, - WithPrivateIPAddress, - WithPrivateFrontend, - WithPublicFrontend, - WithPublicIPAddress, - WithProbe, - WithDisabledSslProtocol, - WithAuthenticationCertificate, - WithRedirectConfiguration, - WithAvailabilityZone, - WithManagedServiceIdentity, - WithHttp2 { - } - } - - /** The entirety of the application gateway definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithGroup, - DefinitionStages.WithCreate, - DefinitionStages.WithRequestRoutingRule, - DefinitionStages.WithRequestRoutingRuleOrCreate { - } - - /** Grouping of application gateway update stages. */ - interface UpdateStages { - /** - * The stage of an application gateway update allowing to manage authentication certificates for the backends to - * use. - */ - interface WithAuthenticationCertificate { - /** - * Begins the definition of a new application gateway authentication certificate to be attached to the - * gateway for use by the backends. - * - * @param name a unique name for the certificate - * @return the first stage of the certificate definition - */ - ApplicationGatewayAuthenticationCertificate.UpdateDefinitionStages.Blank - defineAuthenticationCertificate(String name); - - /** - * Removes an existing application gateway authentication certificate. - * - * @param name the name of an existing certificate - * @return the next stage of the update - */ - Update withoutAuthenticationCertificate(String name); - } - - /** - * The stage of an internal application gateway update allowing to make the application gateway accessible to - * its virtual network. - */ - interface WithPrivateFrontend { - /** - * Enables a private (internal) default front end in the subnet containing the application gateway. - * - *

    A front end with an automatically generated name will be created if none exists. - * - * @return the next stage of the update - */ - Update withPrivateFrontend(); - - /** - * Specifies that no private, or internal, front end should be enabled. - * - * @return the next stage of the definition - */ - Update withoutPrivateFrontend(); - } - - /** - * The stage of an application gateway update allowing to specify the subnet the app gateway is getting its - * private IP address from. - */ - interface WithExistingSubnet extends HasSubnet.UpdateStages.WithSubnet { - /** - * Specifies the subnet the application gateway gets its private IP address from. - * - *

    This will create a new IP configuration, if it does not already exist. - * - *

    Private (internal) frontends, if any have been enabled, will be configured to use this subnet as well. - * - * @param subnet an existing subnet - * @return the next stage of the update - */ - Update withExistingSubnet(Subnet subnet); - - /** - * Specifies the subnet the application gateway gets its private IP address from. - * - *

    This will create a new IP configuration, if it does not already exist. - * - *

    Private (internal) front ends, if any have been enabled, will be configured to use this subnet as - * well. - * - * @param network the virtual network the subnet is part of - * @param subnetName the name of a subnet within the selected network - * @return the next stage of the update - */ - Update withExistingSubnet(Network network, String subnetName); - } - - /** The stage of an application gateway update allowing to modify IP configurations. */ - interface WithIPConfig { - /** - * Removes the specified IP configuration. - * - *

    Note that removing an IP configuration referenced by other settings may break the application gateway. - * Also, there must be at least one IP configuration for the application gateway to function. - * - * @param ipConfigurationName the name of the IP configuration to remove - * @return the next stage of the update - */ - Update withoutIPConfiguration(String ipConfigurationName); - - /** - * Begins the update of an existing IP configuration. - * - * @param ipConfigurationName the name of an existing IP configuration - * @return the first stage of an IP configuration update - */ - ApplicationGatewayIpConfiguration.Update updateIPConfiguration(String ipConfigurationName); - - /** - * Begins the update of the default IP configuration i.e. the only one IP configuration that exists, - * assuming only one exists. - * - * @return the first stage of an IP configuration update. - */ - ApplicationGatewayIpConfiguration.Update updateDefaultIPConfiguration(); - - /** - * Begins the definition of the default IP configuration. - * - *

    If a default IP configuration already exists, it will be this is equivalent to - * updateDefaultIPConfiguration(). - * - * @return the first stage of an IP configuration update - */ - ApplicationGatewayIpConfiguration.UpdateDefinitionStages.Blank defineDefaultIPConfiguration(); - } - - /** The stage of an application gateway update allowing to modify front end ports. */ - interface WithFrontendPort { - /** - * Creates a front end port with an auto-generated name and the specified port number, unless one already - * exists. - * - * @param portNumber a port number - * @return the next stage of the definition - */ - Update withFrontendPort(int portNumber); - - /** - * Creates a front end port with the specified name and port number, unless a port matching this name and/or - * number already exists. - * - * @param portNumber a port number - * @param name the name to assign to the port - * @return the next stage of the definition, or null if a port matching either the name or the number, but - * not both, already exists. - */ - Update withFrontendPort(int portNumber, String name); - - /** - * Removes the specified frontend port. - * - *

    Note that removing a frontend port referenced by other settings may break the application gateway. - * - * @param name the name of the frontend port to remove - * @return the next stage of the update - */ - Update withoutFrontendPort(String name); - - /** - * Removes the specified frontend port. - * - *

    Note that removing a frontend port referenced by other settings may break the application gateway. - * - * @param portNumber the port number of the frontend port to remove - * @return the next stage of the update - */ - Update withoutFrontendPort(int portNumber); - } - - /** - * The stage of an application gateway update allowing to specify a public IP address for the public frontend. - */ - interface WithPublicIPAddress extends HasPublicIpAddress.UpdateStages.WithPublicIPAddressNoDnsLabel { - } - - /** The stage of an application gateway update allowing to modify frontend IP configurations. */ - interface WithFrontend { - /** - * Removes the specified front end IP configuration. - * - *

    Note that removing a front end referenced by other settings may break the application gateway. - * - * @param frontendName the name of the front end IP configuration to remove - * @return the next stage of the update - */ - Update withoutFrontend(String frontendName); - - /** - * Begins the update of an existing front end IP configuration. - * - * @param frontendName the name of an existing front end IP configuration - * @return the first stage of the front end IP configuration update - */ - ApplicationGatewayFrontend.Update updateFrontend(String frontendName); - - /** - * Specifies that the application gateway should not be Internet-facing. - * - *

    Note that if there are any other settings referencing the public front end, removing it may break the - * application gateway. - * - * @return the next stage of the update - */ - Update withoutPublicFrontend(); - - /** - * Specifies that the application gateway should not be private, i.e. its endpoints should not be internally - * accessible from within the virtual network. - * - *

    Note that if there are any other settings referencing the private front end, removing it may break the - * application gateway. - * - * @return the next stage of the update - */ - Update withoutPrivateFrontend(); - - /** - * Begins the update of the public front end IP configuration, if it exists. - * - * @return the first stage of a front end update or null if no public front end exists - */ - ApplicationGatewayFrontend.Update updatePublicFrontend(); - - /** - * Begins the update of the private front end IP configuration, if it exists. - * - * @return the first stage of a front end update or null if no private front end exists - */ - /* TODO: Nothing to update in the private frontend today - changing Subnet and/or private IP not supported - * @Method - * ApplicationGatewayFrontend.Update updatePrivateFrontend(); - */ - - /** - * Begins the definition of the default public front end IP configuration, creating one if it does not - * already exist. - * - * @return the first stage of a front end definition - */ - ApplicationGatewayFrontend.UpdateDefinitionStages.Blank definePublicFrontend(); - - /** - * Begins the definition of the default private front end IP configuration, creating one if it does not - * already exist. - * - * @return the first stage of a front end definition - */ - ApplicationGatewayFrontend.UpdateDefinitionStages.Blank definePrivateFrontend(); - } - - /** The stage of an application gateway update allowing to modify backends. */ - interface WithBackend { - /** - * Begins the definition of a new application gateway backend to be attached to the gateway. - * - * @param name a unique name for the backend - * @return the first stage of the backend definition - */ - ApplicationGatewayBackend.UpdateDefinitionStages.Blank defineBackend(String name); - - /** - * Ensures the specified fully qualified domain name (FQDN) is not associated with any backend. - * - * @param fqdn a fully qualified domain name (FQDN) - * @return the next stage of the update - */ - Update withoutBackendFqdn(String fqdn); - - /** - * Ensures the specified IP address is not associated with any backend. - * - * @param ipAddress an IP address - * @return the next stage of the update - */ - Update withoutBackendIPAddress(String ipAddress); - - /** - * Removes the specified backend. - * - *

    Note that removing a backend referenced by other settings may break the application gateway. - * - * @param backendName the name of an existing backend on this application gateway - * @return the next stage of the update - */ - Update withoutBackend(String backendName); - - /** - * Begins the update of an existing backend on this application gateway. - * - * @param name the name of the backend - * @return the first stage of an update of the backend - */ - ApplicationGatewayBackend.Update updateBackend(String name); - } - - /** The stage of an application gateway update allowing to modify probes. */ - interface WithProbe { - /** - * Begins the definition of a new probe. - * - * @param name a unique name for the probe - * @return the first stage of a probe definition - */ - ApplicationGatewayProbe.UpdateDefinitionStages.Blank defineProbe(String name); - - /** - * Begins the update of an existing probe. - * - * @param name the name of an existing probe - * @return the first stage of a probe update - */ - ApplicationGatewayProbe.Update updateProbe(String name); - - /** - * Removes a probe from the application gateway. - * - *

    Any references to this probe from backend HTTP configurations will be automatically removed. - * - * @param name the name of an existing probe - * @return the next stage of the update - */ - Update withoutProbe(String name); - } - - /** The stage of an application gateway update allowing to specify the sku. */ - interface WithSku { - /** - * Set tier of an application gateway. Possible values include: 'Standard', 'WAF', 'Standard_v2', 'WAF_v2'. - * - * @param tier the tier value to set - * @return the next stage of the update - */ - Update withTier(ApplicationGatewayTier tier); - - /** - * Specifies the size of the application gateway to use within the context of the selected tier. - * - * @param size an application gateway size name - * @return the next stage of the update - */ - Update withSize(ApplicationGatewaySkuName size); - } - - /** The stage of the applicationgateway update allowing to specify WebApplicationFirewallConfiguration. */ - interface WithWebApplicationFirewall { - /** - * Specifies webApplicationFirewallConfiguration. - * - * @param config Web application firewall configuration - * @return the next update stage - */ - Update withWebApplicationFirewall(ApplicationGatewayWebApplicationFirewallConfiguration config); - } - - /** - * The stage of an application gateway update allowing to specify the capacity (number of instances) of the - * application gateway. - */ - interface WithInstanceCount { - /** - * Specifies the capacity (number of instances) for the application gateway. - * - * @param instanceCount the capacity as a number between 1 and 10 but also based on the limits imposed by - * the selected applicatiob gateway size - * @return the next stage of the update - */ - Update withInstanceCount(int instanceCount); - - /** - * Specifies the min and max auto scale bound. - * - * @param minCapacity lower bound on number of Application Gateway capacity. - * @param maxCapacity upper bound on number of Application Gateway capacity. - * @return the next stage of the update - */ - Update withAutoScale(int minCapacity, int maxCapacity); - } - - /** The stage of an application gateway update allowing to modify SSL certificates. */ - interface WithSslCert { - /** - * Begins the definition of a new application gateway SSL certificate to be attached to the gateway for use - * in frontend HTTPS listeners. - * - * @param name a unique name for the certificate - * @return the first stage of the certificate definition - */ - ApplicationGatewaySslCertificate.UpdateDefinitionStages.Blank defineSslCertificate(String name); - - /** - * Removes the specified SSL certificate from the application gateway. - * - *

    Note that removing a certificate referenced by other settings may break the application gateway. - * - * @param name the name of the certificate to remove - * @return the next stage of the update - */ - Update withoutSslCertificate(String name); - } - - /** The stage of an application gateway update allowing to modify frontend listeners. */ - interface WithListener { - /** - * Begins the definition of a new application gateway listener to be attached to the gateway. - * - * @param name a unique name for the listener - * @return the first stage of the listener definition - */ - ApplicationGatewayListener.UpdateDefinitionStages.Blank defineListener(String name); - - /** - * Removes a frontend listener from the application gateway. - * - *

    Note that removing a listener referenced by other settings may break the application gateway. - * - * @param name the name of the listener to remove - * @return the next stage of the update - */ - Update withoutListener(String name); - - /** - * Begins the update of a listener. - * - * @param name the name of an existing listener to update - * @return the next stage of the definition or null if the requested listener does not exist - */ - ApplicationGatewayListener.Update updateListener(String name); - } - - /** The stage of an application gateway definition allowing to add a redirect configuration. */ - interface WithRedirectConfiguration { - /** - * Begins the definition of a new application gateway redirect configuration to be attached to the gateway. - * - * @param name a unique name for the redirect configuration - * @return the first stage of the redirect configuration definition - */ - ApplicationGatewayRedirectConfiguration.UpdateDefinitionStages.Blank defineRedirectConfiguration( - String name); - - /** - * Removes a redirect configuration from the application gateway. - * - *

    Note that removing a redirect configuration referenced by other settings may break the application - * gateway. - * - * @param name the name of the redirect configuration to remove - * @return the next stage of the update - */ - Update withoutRedirectConfiguration(String name); - - /** - * Begins the update of a redirect configuration. - * - * @param name the name of an existing redirect configuration to update - * @return the next stage of the definition or null if the requested redirect configuration does not exist - */ - ApplicationGatewayRedirectConfiguration.Update updateRedirectConfiguration(String name); - } - - /** The stage of an application gateway definition allowing to modify URL path maps. */ - interface WithUrlPathMap { - /** - * Removes a URL path map from the application gateway. - * - *

    Note that removing a URL path map referenced by other settings may break the application gateway. - * - * @param name the name of the URL path map to remove (case sensitive) - * @return the next stage of the update - */ - Update withoutUrlPathMap(String name); - - /** - * Begins the update of a URL path map. - * - * @param name the name of an existing redirect configuration to update (case sensitive) - * @return the next stage of the definition or null if the requested URL path map does not exist - */ - ApplicationGatewayUrlPathMap.Update updateUrlPathMap(String name); - } - - /** The stage of an application gateway update allowing to modify backend HTTP configurations. */ - interface WithBackendHttpConfig { - /** - * Begins the definition of a new application gateway backend HTTP configuration to be attached to the - * gateway. - * - * @param name a unique name for the backend HTTP configuration - * @return the first stage of the backend HTTP configuration definition - */ - ApplicationGatewayBackendHttpConfiguration.UpdateDefinitionStages.Blank - defineBackendHttpConfiguration(String name); - - /** - * Removes the specified backend HTTP configuration from this application gateway. - * - *

    Note that removing a backend HTTP configuration referenced by other settings may break the application - * gateway. - * - * @param name the name of an existing backend HTTP configuration on this application gateway - * @return the next stage of the update - */ - Update withoutBackendHttpConfiguration(String name); - - /** - * Begins the update of a backend HTTP configuration. - * - * @param name the name of an existing backend HTTP configuration on this application gateway - * @return the next stage of the update - */ - ApplicationGatewayBackendHttpConfiguration.Update updateBackendHttpConfiguration(String name); - } - - /** The stage of an application gateway update allowing to modify request routing rules. */ - interface WithRequestRoutingRule { - /** - * Begins the definition of a request routing rule for this application gateway. - * - * @param name a unique name for the request routing rule - * @return the first stage of the request routing rule - */ - ApplicationGatewayRequestRoutingRule.UpdateDefinitionStages.Blank defineRequestRoutingRule( - String name); - - /** - * Removes a request routing rule from the application gateway. - * - * @param name the name of the request routing rule to remove - * @return the next stage of the update - */ - Update withoutRequestRoutingRule(String name); - - /** - * Begins the update of a request routing rule. - * - * @param name the name of an existing request routing rule - * @return the first stage of a request routing rule update or null if the requested rule does not exist - */ - ApplicationGatewayRequestRoutingRule.Update updateRequestRoutingRule(String name); - - /** - * Begins the definition of a new application gateway path-based request routing rule and URL path map to be - * attached to the gateway. Note: both will be created with the same name and attached to the gateway. - * - * @param name a unique name for the URL path map - * @return the first stage of the URL path map definition - */ - ApplicationGatewayUrlPathMap.UpdateDefinitionStages.Blank definePathBasedRoutingRule(String name); - } - - /** The stage of an application gateway update allowing to specify Managed Service Identities. */ - interface WithManagedServiceIdentity { - /** - * Specifies an identity to be associated with the application gateway. - * - * @param identity the identity - * @return the next stage of the update - */ - Update withIdentity(ManagedServiceIdentity identity); - } - - /** The stage of an application gateway definition allowing to specify the SSL protocols to disable. */ - interface WithDisabledSslProtocol { - /** - * Disables the specified SSL protocol. - * - * @param protocol an SSL protocol - * @return the next stage of the update - */ - Update withDisabledSslProtocol(ApplicationGatewaySslProtocol protocol); - - /** - * Disables the specified SSL protocols. - * - * @param protocols SSL protocols - * @return the next stage of the update - */ - Update withDisabledSslProtocols(ApplicationGatewaySslProtocol... protocols); - - /** - * Enables the specified SSL protocol, if previously disabled. - * - * @param protocol an SSL protocol - * @return the next stage of the update - */ - Update withoutDisabledSslProtocol(ApplicationGatewaySslProtocol protocol); - - /** - * Enables the specified SSL protocols, if previously disabled. - * - * @param protocols SSL protocols - * @return the next stage of the update - */ - Update withoutDisabledSslProtocols(ApplicationGatewaySslProtocol... protocols); - - /** - * Enables all SSL protocols, if previously disabled. - * - * @return the next stage of the update - */ - Update withoutAnyDisabledSslProtocols(); - } - - /** - * The stage of the application gateway update allowing to specify whether HTTP2 is enabled on the application - * gateway. - */ - interface WithHttp2 { - /** - * Enables HTTP2 for the application gateway. - * - * @return the next stage of the update - */ - Update withHttp2(); - - /** - * Disables HTTP2 for the application gateway. - * - * @return the next stage of the update - */ - Update withoutHttp2(); - } - } - - /** The template for an application gateway update operation, containing all the settings that can be modified. */ - interface Update - extends Appliable, - Resource.UpdateWithTags, - UpdateStages.WithSku, - UpdateStages.WithInstanceCount, - UpdateStages.WithWebApplicationFirewall, - UpdateStages.WithBackend, - UpdateStages.WithBackendHttpConfig, - UpdateStages.WithIPConfig, - UpdateStages.WithFrontend, - UpdateStages.WithPublicIPAddress, - UpdateStages.WithFrontendPort, - UpdateStages.WithSslCert, - UpdateStages.WithListener, - UpdateStages.WithRequestRoutingRule, - UpdateStages.WithExistingSubnet, - UpdateStages.WithProbe, - UpdateStages.WithDisabledSslProtocol, - UpdateStages.WithAuthenticationCertificate, - UpdateStages.WithRedirectConfiguration, - UpdateStages.WithUrlPathMap, - UpdateStages.WithManagedServiceIdentity, - UpdateStages.WithHttp2 { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayAuthenticationCertificate.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayAuthenticationCertificate.java deleted file mode 100644 index 087b958da726..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayAuthenticationCertificate.java +++ /dev/null @@ -1,176 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.network.fluent.models.ApplicationGatewayAuthenticationCertificateInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.ChildResource; -import com.azure.resourcemanager.resources.fluentcore.model.Attachable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.model.Settable; -import java.io.File; -import java.io.IOException; - -/** A client-side representation of an application gateway authentication certificate. */ -@Fluent() -public interface ApplicationGatewayAuthenticationCertificate - extends HasInnerModel, ChildResource { - - /** @return base-64 encoded bytes of the X.509 certificate */ - String data(); - - /** Grouping of application gateway authentication certificate stages. */ - interface DefinitionStages { - /** - * The first stage of an application gateway authentication certificate definition. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface Blank extends WithData { - } - - /** - * The stage of an application gateway authentication certificate definition allowing to specify the data of the - * certificate. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface WithData { - /** - * Specifies an X.509 certificate to upload. - * - * @param derData the DER-encoded bytes of an X.509 certificate - * @return the next stage of the definition - */ - WithAttach fromBytes(byte[] derData); - - /** - * Specifies an X.509 certificate to upload. - * - * @param certificateFile a DER encoded X.509 certificate file - * @return the next stage of the definition - * @throws IOException when there are problems reading the certificate file - */ - WithAttach fromFile(File certificateFile) throws IOException; - - /** - * Specifies an X.509 certificate to upload. - * - * @param base64data base-64 encoded data of the certificate - * @return the next stage of the definition - */ - WithAttach fromBase64(String base64data); - } - - /** - * The final stage of an application gateway authentication certificate definition. - * - *

    At this stage, any remaining optional settings can be specified, or the definition can be attached to the - * parent application gateway definition. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface WithAttach extends Attachable.InDefinition { - } - } - - /** - * The entirety of an application gateway authentication certificate definition. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithAttach, - DefinitionStages.WithData { - } - - /** Grouping of application gateway authentication certificate update stages. */ - interface UpdateStages { - } - - /** - * The entirety of an application gateway authentication certificate update as part of an application gateway - * update. - */ - interface Update extends Settable { - } - - /** - * Grouping of application gateway authentication certificate definition stages applicable as part of an application - * gateway update. - */ - interface UpdateDefinitionStages { - /** - * The first stage of an application gateway authentication certificate definition. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface Blank extends WithData { - } - - /** - * The stage of an application gateway authentication certificate definition allowing to specify the data of the - * certificate. - * - * @param the stage of the parent application gateway update to return to after attaching this - * definition - */ - interface WithData { - /** - * Specifies an X.509 certificate to upload. - * - * @param data the DER-encoded bytes of an X.509 certificate - * @return the next stage of the definition - */ - WithAttach fromBytes(byte[] data); - - /** - * Specifies an X.509 certificate to upload. - * - * @param certificateFile a DER encoded X.509 certificate file - * @return the next stage of the definition - * @throws IOException when there are problems reading the certificate file - */ - WithAttach fromFile(File certificateFile) throws IOException; - - /** - * Specifies an X.509 certificate to upload. - * - * @param base64data base-64 encoded data of the certificate - * @return the next stage of the definition - */ - WithAttach fromBase64(String base64data); - } - - /** - * The final stage of an application gateway authentication certificate definition. - * - *

    At this stage, any remaining optional settings can be specified, or the definition can be attached to the - * parent application gateway definition. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface WithAttach extends Attachable.InUpdate { - } - } - - /** - * The entirety of an application gateway authentication certificate definition as part of an application gateway - * update. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface UpdateDefinition - extends UpdateDefinitionStages.Blank, - UpdateDefinitionStages.WithAttach, - UpdateDefinitionStages.WithData { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayAutoscaleConfiguration.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayAutoscaleConfiguration.java deleted file mode 100644 index ab88c4146477..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayAutoscaleConfiguration.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Application Gateway autoscale configuration. */ -@Fluent -public final class ApplicationGatewayAutoscaleConfiguration { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayAutoscaleConfiguration.class); - - /* - * Lower bound on number of Application Gateway capacity - */ - @JsonProperty(value = "minCapacity", required = true) - private int minCapacity; - - /* - * Upper bound on number of Application Gateway capacity - */ - @JsonProperty(value = "maxCapacity") - private Integer maxCapacity; - - /** - * Get the minCapacity property: Lower bound on number of Application Gateway capacity. - * - * @return the minCapacity value. - */ - public int minCapacity() { - return this.minCapacity; - } - - /** - * Set the minCapacity property: Lower bound on number of Application Gateway capacity. - * - * @param minCapacity the minCapacity value to set. - * @return the ApplicationGatewayAutoscaleConfiguration object itself. - */ - public ApplicationGatewayAutoscaleConfiguration withMinCapacity(int minCapacity) { - this.minCapacity = minCapacity; - return this; - } - - /** - * Get the maxCapacity property: Upper bound on number of Application Gateway capacity. - * - * @return the maxCapacity value. - */ - public Integer maxCapacity() { - return this.maxCapacity; - } - - /** - * Set the maxCapacity property: Upper bound on number of Application Gateway capacity. - * - * @param maxCapacity the maxCapacity value to set. - * @return the ApplicationGatewayAutoscaleConfiguration object itself. - */ - public ApplicationGatewayAutoscaleConfiguration withMaxCapacity(Integer maxCapacity) { - this.maxCapacity = maxCapacity; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayAvailableSslPredefinedPolicies.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayAvailableSslPredefinedPolicies.java deleted file mode 100644 index 980bf4997693..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayAvailableSslPredefinedPolicies.java +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.ApplicationGatewaySslPredefinedPolicyInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Response for ApplicationGatewayAvailableSslOptions API service call. */ -@Fluent -public final class ApplicationGatewayAvailableSslPredefinedPolicies { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(ApplicationGatewayAvailableSslPredefinedPolicies.class); - - /* - * List of available Ssl predefined policy. - */ - @JsonProperty(value = "value") - private List value; - - /* - * URL to get the next set of results. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: List of available Ssl predefined policy. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: List of available Ssl predefined policy. - * - * @param value the value value to set. - * @return the ApplicationGatewayAvailableSslPredefinedPolicies object itself. - */ - public ApplicationGatewayAvailableSslPredefinedPolicies withValue( - List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: URL to get the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: URL to get the next set of results. - * - * @param nextLink the nextLink value to set. - * @return the ApplicationGatewayAvailableSslPredefinedPolicies object itself. - */ - public ApplicationGatewayAvailableSslPredefinedPolicies withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayBackend.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayBackend.java deleted file mode 100644 index 8cd1e922140c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayBackend.java +++ /dev/null @@ -1,206 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.arm.models.ChildResource; -import com.azure.resourcemanager.resources.fluentcore.model.Attachable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.model.Settable; -import java.util.Collection; - -/** A client-side representation of an application gateway backend. */ -@Fluent() -public interface ApplicationGatewayBackend - extends HasInnerModel, ChildResource, HasBackendNics { - - /** @return addresses on the backend of the application gateway */ - Collection addresses(); - - /** - * Checks whether the specified IP address is referenced by this backend address pool. - * - * @param ipAddress an IP address - * @return true if the specified IP address is referenced by this backend, else false - */ - boolean containsIPAddress(String ipAddress); - - /** - * Checks whether the specified FQDN is referenced by this backend address pool. - * - * @param fqdn a fully qualified domain name (FQDN) - * @return true if the specified FQDN is referenced by this backend, else false - */ - boolean containsFqdn(String fqdn); - - /** Grouping of application gateway backend definition stages. */ - interface DefinitionStages { - /** - * The first stage of an application gateway backend definition. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface Blank extends WithAttach { - } - - /** - * The stage of an application gateway backend definition allowing to add an address to the backend. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface WithAddress { - /** - * Adds the specified existing IP address to the backend. - * - *

    This call can be made in a sequence to add multiple IP addresses. - * - * @param ipAddress an IP address - * @return the next stage of the definition - */ - WithAttach withIPAddress(String ipAddress); - - /** - * Adds the specified existing fully qualified domain name (FQDN) to the backend. - * - *

    This call can be made in a sequence to add multiple FQDNs. - * - * @param fqdn a fully qualified domain name (FQDN) - * @return the next stage of the definition - */ - WithAttach withFqdn(String fqdn); - } - - /** - * The final stage of an application gateway backend definition. - * - *

    At this stage, any remaining optional settings can be specified, or the definition can be attached to the - * parent application gateway definition. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface WithAttach extends Attachable.InDefinition, WithAddress { - } - } - - /** - * The entirety of an application gateway backend definition. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithAttach { - } - - /** Grouping of application gateway backend update stages. */ - interface UpdateStages { - /** The stage of an application gateway backend update allowing to add an address to the backend. */ - interface WithAddress { - /** - * Adds the specified existing IP address to the backend. - * - * @param ipAddress an IP address - * @return the next stage of the update - */ - Update withIPAddress(String ipAddress); - - /** - * Adds the specified existing fully qualified domain name (FQDN) to the backend. - * - * @param fqdn a fully qualified domain name (FQDN) - * @return the next stage of the update - */ - Update withFqdn(String fqdn); - - /** - * Ensures the specified IP address is not associated with this backend. - * - * @param ipAddress an IP address - * @return the next stage of the update - */ - Update withoutIPAddress(String ipAddress); - - /** - * Ensure the specified address is not associated with this backend. - * - * @param address an existing address currently associated with the backend - * @return the next stage of the update - */ - Update withoutAddress(ApplicationGatewayBackendAddress address); - - /** - * Ensures the specified fully qualified domain name (FQDN) is not associated with this backend. - * - * @param fqdn a fully qualified domain name - * @return the next stage of the update - */ - Update withoutFqdn(String fqdn); - } - } - - /** The entirety of an application gateway backend update as part of an application gateway update. */ - interface Update extends Settable, UpdateStages.WithAddress { - } - - /** - * Grouping of application gateway backend definition stages applicable as part of an application gateway update. - */ - interface UpdateDefinitionStages { - /** - * The first stage of an application gateway backend definition. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface Blank extends WithAttach { - } - - /** - * The stage of an application gateway backed definition allowing to add an address to the backend. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface WithAddress { - /** - * Adds the specified existing IP address to the backend. - * - * @param ipAddress an IP address - * @return the next stage of the definition - */ - WithAttach withIPAddress(String ipAddress); - - /** - * Adds the specified existing fully qualified domain name (FQDN) to the backend. - * - * @param fqdn a fully qualified domain name (FQDN) - * @return the next stage of the definition - */ - WithAttach withFqdn(String fqdn); - } - - /** - * The final stage of an application gateway backend definition. - * - *

    At this stage, any remaining optional settings can be specified, or the definition can be attached to the - * parent application gateway definition. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface WithAttach extends Attachable.InUpdate, WithAddress { - } - } - - /** - * The entirety of an application gateway backend definition as part of an application gateway update. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface UpdateDefinition - extends UpdateDefinitionStages.Blank, UpdateDefinitionStages.WithAttach { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayBackendAddress.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayBackendAddress.java deleted file mode 100644 index 519f6ed632f8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayBackendAddress.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Backend address of an application gateway. */ -@Fluent -public final class ApplicationGatewayBackendAddress { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayBackendAddress.class); - - /* - * Fully qualified domain name (FQDN). - */ - @JsonProperty(value = "fqdn") - private String fqdn; - - /* - * IP address - */ - @JsonProperty(value = "ipAddress") - private String ipAddress; - - /** - * Get the fqdn property: Fully qualified domain name (FQDN). - * - * @return the fqdn value. - */ - public String fqdn() { - return this.fqdn; - } - - /** - * Set the fqdn property: Fully qualified domain name (FQDN). - * - * @param fqdn the fqdn value to set. - * @return the ApplicationGatewayBackendAddress object itself. - */ - public ApplicationGatewayBackendAddress withFqdn(String fqdn) { - this.fqdn = fqdn; - return this; - } - - /** - * Get the ipAddress property: IP address. - * - * @return the ipAddress value. - */ - public String ipAddress() { - return this.ipAddress; - } - - /** - * Set the ipAddress property: IP address. - * - * @param ipAddress the ipAddress value to set. - * @return the ApplicationGatewayBackendAddress object itself. - */ - public ApplicationGatewayBackendAddress withIpAddress(String ipAddress) { - this.ipAddress = ipAddress; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayBackendAddressPool.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayBackendAddressPool.java deleted file mode 100644 index 8d0c12ec6b17..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayBackendAddressPool.java +++ /dev/null @@ -1,205 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.ApplicationGatewayBackendAddressPoolPropertiesFormat; -import com.azure.resourcemanager.network.fluent.models.NetworkInterfaceIpConfigurationInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Backend Address Pool of an application gateway. */ -@Fluent -public final class ApplicationGatewayBackendAddressPool extends SubResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayBackendAddressPool.class); - - /* - * Properties of Backend Address Pool of an application gateway. - */ - @JsonProperty(value = "properties") - private ApplicationGatewayBackendAddressPoolPropertiesFormat innerProperties; - - /* - * Name of the backend address pool that is unique within an Application - * Gateway. - */ - @JsonProperty(value = "name") - private String name; - - /* - * A unique read-only string that changes whenever the resource is updated. - */ - @JsonProperty(value = "etag") - private String etag; - - /* - * Type of the resource. - */ - @JsonProperty(value = "type") - private String type; - - /** - * Get the innerProperties property: Properties of Backend Address Pool of an application gateway. - * - * @return the innerProperties value. - */ - private ApplicationGatewayBackendAddressPoolPropertiesFormat innerProperties() { - return this.innerProperties; - } - - /** - * Get the name property: Name of the backend address pool that is unique within an Application Gateway. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Name of the backend address pool that is unique within an Application Gateway. - * - * @param name the name value to set. - * @return the ApplicationGatewayBackendAddressPool object itself. - */ - public ApplicationGatewayBackendAddressPool withName(String name) { - this.name = name; - return this; - } - - /** - * Get the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @param etag the etag value to set. - * @return the ApplicationGatewayBackendAddressPool object itself. - */ - public ApplicationGatewayBackendAddressPool withEtag(String etag) { - this.etag = etag; - return this; - } - - /** - * Get the type property: Type of the resource. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Set the type property: Type of the resource. - * - * @param type the type value to set. - * @return the ApplicationGatewayBackendAddressPool object itself. - */ - public ApplicationGatewayBackendAddressPool withType(String type) { - this.type = type; - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicationGatewayBackendAddressPool withId(String id) { - super.withId(id); - return this; - } - - /** - * Get the backendIpConfigurations property: Collection of references to IPs defined in network interfaces. - * - * @return the backendIpConfigurations value. - */ - public List backendIpConfigurations() { - return this.innerProperties() == null ? null : this.innerProperties().backendIpConfigurations(); - } - - /** - * Set the backendIpConfigurations property: Collection of references to IPs defined in network interfaces. - * - * @param backendIpConfigurations the backendIpConfigurations value to set. - * @return the ApplicationGatewayBackendAddressPool object itself. - */ - public ApplicationGatewayBackendAddressPool withBackendIpConfigurations( - List backendIpConfigurations) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayBackendAddressPoolPropertiesFormat(); - } - this.innerProperties().withBackendIpConfigurations(backendIpConfigurations); - return this; - } - - /** - * Get the backendAddresses property: Backend addresses. - * - * @return the backendAddresses value. - */ - public List backendAddresses() { - return this.innerProperties() == null ? null : this.innerProperties().backendAddresses(); - } - - /** - * Set the backendAddresses property: Backend addresses. - * - * @param backendAddresses the backendAddresses value to set. - * @return the ApplicationGatewayBackendAddressPool object itself. - */ - public ApplicationGatewayBackendAddressPool withBackendAddresses( - List backendAddresses) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayBackendAddressPoolPropertiesFormat(); - } - this.innerProperties().withBackendAddresses(backendAddresses); - return this; - } - - /** - * Get the provisioningState property: Provisioning state of the backend address pool resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Set the provisioningState property: Provisioning state of the backend address pool resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param provisioningState the provisioningState value to set. - * @return the ApplicationGatewayBackendAddressPool object itself. - */ - public ApplicationGatewayBackendAddressPool withProvisioningState(String provisioningState) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayBackendAddressPoolPropertiesFormat(); - } - this.innerProperties().withProvisioningState(provisioningState); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayBackendHealth.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayBackendHealth.java deleted file mode 100644 index 2542d63835d1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayBackendHealth.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasName; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasParent; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import java.util.Map; - -/** A client-side representation of the health information of an application gateway backend. */ -@Fluent -public interface ApplicationGatewayBackendHealth - extends HasInnerModel, HasName, HasParent { - - /** @return the application gateway backend address pool that is health information pertains to */ - ApplicationGatewayBackend backend(); - - /** @return the health information about each associated backend HTTP settings configuration, indexed by its name */ - Map httpConfigurationHealths(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayBackendHealthHttpSettings.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayBackendHealthHttpSettings.java deleted file mode 100644 index 1a28f6f396b9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayBackendHealthHttpSettings.java +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.ApplicationGatewayBackendHealthServerInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Application gateway BackendHealthHttp settings. */ -@Fluent -public final class ApplicationGatewayBackendHealthHttpSettings { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayBackendHealthHttpSettings.class); - - /* - * Reference of an ApplicationGatewayBackendHttpSettings resource. - */ - @JsonProperty(value = "backendHttpSettings") - private ApplicationGatewayBackendHttpSettings backendHttpSettings; - - /* - * List of ApplicationGatewayBackendHealthServer resources. - */ - @JsonProperty(value = "servers") - private List servers; - - /** - * Get the backendHttpSettings property: Reference of an ApplicationGatewayBackendHttpSettings resource. - * - * @return the backendHttpSettings value. - */ - public ApplicationGatewayBackendHttpSettings backendHttpSettings() { - return this.backendHttpSettings; - } - - /** - * Set the backendHttpSettings property: Reference of an ApplicationGatewayBackendHttpSettings resource. - * - * @param backendHttpSettings the backendHttpSettings value to set. - * @return the ApplicationGatewayBackendHealthHttpSettings object itself. - */ - public ApplicationGatewayBackendHealthHttpSettings withBackendHttpSettings( - ApplicationGatewayBackendHttpSettings backendHttpSettings) { - this.backendHttpSettings = backendHttpSettings; - return this; - } - - /** - * Get the servers property: List of ApplicationGatewayBackendHealthServer resources. - * - * @return the servers value. - */ - public List servers() { - return this.servers; - } - - /** - * Set the servers property: List of ApplicationGatewayBackendHealthServer resources. - * - * @param servers the servers value to set. - * @return the ApplicationGatewayBackendHealthHttpSettings object itself. - */ - public ApplicationGatewayBackendHealthHttpSettings withServers( - List servers) { - this.servers = servers; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (backendHttpSettings() != null) { - backendHttpSettings().validate(); - } - if (servers() != null) { - servers().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayBackendHealthPool.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayBackendHealthPool.java deleted file mode 100644 index 2a8b90e3d147..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayBackendHealthPool.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Application gateway BackendHealth pool. */ -@Fluent -public final class ApplicationGatewayBackendHealthPool { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayBackendHealthPool.class); - - /* - * Reference of an ApplicationGatewayBackendAddressPool resource. - */ - @JsonProperty(value = "backendAddressPool") - private ApplicationGatewayBackendAddressPool backendAddressPool; - - /* - * List of ApplicationGatewayBackendHealthHttpSettings resources. - */ - @JsonProperty(value = "backendHttpSettingsCollection") - private List backendHttpSettingsCollection; - - /** - * Get the backendAddressPool property: Reference of an ApplicationGatewayBackendAddressPool resource. - * - * @return the backendAddressPool value. - */ - public ApplicationGatewayBackendAddressPool backendAddressPool() { - return this.backendAddressPool; - } - - /** - * Set the backendAddressPool property: Reference of an ApplicationGatewayBackendAddressPool resource. - * - * @param backendAddressPool the backendAddressPool value to set. - * @return the ApplicationGatewayBackendHealthPool object itself. - */ - public ApplicationGatewayBackendHealthPool withBackendAddressPool( - ApplicationGatewayBackendAddressPool backendAddressPool) { - this.backendAddressPool = backendAddressPool; - return this; - } - - /** - * Get the backendHttpSettingsCollection property: List of ApplicationGatewayBackendHealthHttpSettings resources. - * - * @return the backendHttpSettingsCollection value. - */ - public List backendHttpSettingsCollection() { - return this.backendHttpSettingsCollection; - } - - /** - * Set the backendHttpSettingsCollection property: List of ApplicationGatewayBackendHealthHttpSettings resources. - * - * @param backendHttpSettingsCollection the backendHttpSettingsCollection value to set. - * @return the ApplicationGatewayBackendHealthPool object itself. - */ - public ApplicationGatewayBackendHealthPool withBackendHttpSettingsCollection( - List backendHttpSettingsCollection) { - this.backendHttpSettingsCollection = backendHttpSettingsCollection; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (backendAddressPool() != null) { - backendAddressPool().validate(); - } - if (backendHttpSettingsCollection() != null) { - backendHttpSettingsCollection().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayBackendHealthServerHealth.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayBackendHealthServerHealth.java deleted file mode 100644 index 4836b4d0b085..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayBackendHealthServerHealth.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ApplicationGatewayBackendHealthServerHealth. */ -public final class ApplicationGatewayBackendHealthServerHealth - extends ExpandableStringEnum { - /** Static value Unknown for ApplicationGatewayBackendHealthServerHealth. */ - public static final ApplicationGatewayBackendHealthServerHealth UNKNOWN = fromString("Unknown"); - - /** Static value Up for ApplicationGatewayBackendHealthServerHealth. */ - public static final ApplicationGatewayBackendHealthServerHealth UP = fromString("Up"); - - /** Static value Down for ApplicationGatewayBackendHealthServerHealth. */ - public static final ApplicationGatewayBackendHealthServerHealth DOWN = fromString("Down"); - - /** Static value Partial for ApplicationGatewayBackendHealthServerHealth. */ - public static final ApplicationGatewayBackendHealthServerHealth PARTIAL = fromString("Partial"); - - /** Static value Draining for ApplicationGatewayBackendHealthServerHealth. */ - public static final ApplicationGatewayBackendHealthServerHealth DRAINING = fromString("Draining"); - - /** - * Creates or finds a ApplicationGatewayBackendHealthServerHealth from its string representation. - * - * @param name a name to look for. - * @return the corresponding ApplicationGatewayBackendHealthServerHealth. - */ - @JsonCreator - public static ApplicationGatewayBackendHealthServerHealth fromString(String name) { - return fromString(name, ApplicationGatewayBackendHealthServerHealth.class); - } - - /** @return known ApplicationGatewayBackendHealthServerHealth values. */ - public static Collection values() { - return values(ApplicationGatewayBackendHealthServerHealth.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayBackendHealthStatus.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayBackendHealthStatus.java deleted file mode 100644 index cb26e8aab368..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayBackendHealthStatus.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** Application gateway backend health status. */ -public class ApplicationGatewayBackendHealthStatus extends ExpandableStringEnum { - /** Unknown health status. */ - public static final ApplicationGatewayBackendHealthStatus UNKNOWN = - fromString(ApplicationGatewayBackendHealthServerHealth.UNKNOWN.toString()); - - /** The server is up. */ - public static final ApplicationGatewayBackendHealthStatus UP = - fromString(ApplicationGatewayBackendHealthServerHealth.UP.toString()); - - /** The server is down. */ - public static final ApplicationGatewayBackendHealthStatus DOWN = - fromString(ApplicationGatewayBackendHealthServerHealth.DOWN.toString()); - - /** Partial health status. */ - public static final ApplicationGatewayBackendHealthStatus PARTIAL = - fromString(ApplicationGatewayBackendHealthServerHealth.PARTIAL.toString()); - - /** The server is draining. */ - public static final ApplicationGatewayBackendHealthStatus DRAINING = - fromString(ApplicationGatewayBackendHealthServerHealth.DRAINING.toString()); - - /** The server is unhealthy. */ - public static final ApplicationGatewayBackendHealthStatus UNHEALTHY = fromString("Unhealthy"); - - /** - * Finds or creates a backend health status based on the specified name. - * - * @param name a name - * @return an instance of ApplicationGatewayBackendHealthStatus - */ - public static ApplicationGatewayBackendHealthStatus fromString(String name) { - return fromString(name, ApplicationGatewayBackendHealthStatus.class); - } - - /** @return known application gateway backend health statuses */ - public static Collection values() { - return values(ApplicationGatewayBackendHealthStatus.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayBackendHttpConfiguration.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayBackendHttpConfiguration.java deleted file mode 100644 index f63c45ad0f0c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayBackendHttpConfiguration.java +++ /dev/null @@ -1,812 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.arm.models.ChildResource; -import com.azure.resourcemanager.resources.fluentcore.model.Attachable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.model.Settable; -import java.io.File; -import java.io.IOException; -import java.util.Map; - -/** A client-side representation of an application gateway's backend HTTP configuration. */ -@Fluent() -public interface ApplicationGatewayBackendHttpConfiguration - extends HasInnerModel, - ChildResource, - HasProtocol, - HasPort { - /** @return authentication certificates associated with this backend HTTPS configuration */ - Map authenticationCertificates(); - - /** @return true if cookie based affinity (sticky sessions) is enabled, else false */ - boolean cookieBasedAffinity(); - - /** - * @return HTTP request timeout in seconds. Requests will fail if no response is received within the specified time. - */ - int requestTimeout(); - - /** @return the probe associated with this backend */ - ApplicationGatewayProbe probe(); - - /** @return host header to be sent to the backend servers */ - String hostHeader(); - - /** @return whether the host header should come from the host name of the backend server */ - boolean isHostHeaderFromBackend(); - - /** @return true if the probe is enabled */ - boolean isProbeEnabled(); - - /** - * @return if 0 then connection draining is not enabled, otherwise if between 1 and 3600, then the number of seconds - * when connection draining is active - */ - int connectionDrainingTimeoutInSeconds(); - - /** @return name used for the affinity cookie */ - String affinityCookieName(); - - /** @return the path, if any, used as a prefix for all HTTP requests */ - String path(); - - /** Grouping of application gateway backend HTTPS configuration stages. */ - interface DefinitionStages { - /** - * The first stage of an application gateway backend HTTP configuration. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface Blank extends WithAttach { - } - - /** - * The stage of an application gateway backend HTTP configuration allowing to specify the port number. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface WithPort extends HasPort.DefinitionStages.WithPort> { - } - - /** - * The stage of an application gateway backend HTTP configuration allowing to specify the protocol. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface WithProtocol { - /** - * Specifies HTTPS as the protocol. - * - * @return the next stage of the definition - */ - WithAttachAndAuthCert withHttps(); - } - - /** - * The stage of an application gateway backend HTTP configuration allowing to enable cookie based affinity. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface WithAffinity { - /** - * Enables cookie based affinity. - * - * @return the next stage of the update - */ - WithAttach withCookieBasedAffinity(); - } - - /** - * The stage of an application gateway backend HTTP configuration allowing to specify the name for the affinity - * cookie. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface WithCookieName { - /** - * Specifies the name for the affinity cookie. - * - * @param name a name - * @return the next stage of the definition - */ - WithAttach withAffinityCookieName(String name); - } - - /** - * The stage of an application gateway backend HTTP configuration allowing to specify the path to use as the - * prefix for all HTTP requests. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface WithPath { - /** - * Specifies the path prefix for all HTTP requests. - * - * @param path a path - * @return the next stage of the definition - */ - WithAttach withPath(String path); - } - - /** - * The stage of an application gateway backend HTTP configuration allowing to specify the request timeout. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface WithRequestTimeout { - /** - * Specifies the request timeout. - * - * @param seconds a number of seconds - * @return the next stage of the definition - */ - WithAttach withRequestTimeout(int seconds); - } - - /** - * The stage of an application gateway backend HTTP configuration allowing to associate an existing probe. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface WithProbe { - /** - * Specifies an existing probe on this application gateway to associate with this backend. - * - *

    If the probe with the specified name does not yet exist, it must be defined separately in the optional - * part of the application gateway definition. This only adds a reference to the probe by its name. - * - * @param name the name of an existing probe - * @return the next stage of the definition - */ - WithAttach withProbe(String name); - } - - /** - * The stage of an application gateway backend HTTP configuration allowing to specify the host header. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface WithHostHeader { - /** - * Specifies that the host header should come from the host name of the backend server. - * - * @return the next stage of the definition - */ - WithAttach withHostHeaderFromBackend(); - - /** - * Specifies the host header. - * - * @param hostHeader the host header - * @return the next stage of the definition - */ - WithAttach withHostHeader(String hostHeader); - } - - /** - * The stage of an application gateway backend HTTP configuration allowing to control connection draining. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface WithConnectionDraining { - /** - * Specifies the number of seconds when connection draining is active. - * - * @param seconds a number of seconds between 1 and 3600 - * @return the next stage of the definition - */ - WithAttach withConnectionDrainingTimeoutInSeconds(int seconds); - } - - /** - * The stage of an application gateway backend HTTP configuration allowing to add an authentication certificate. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface WithAuthenticationCertificate { - /** - * Associates the specified authentication certificate that exists on this application gateway with this - * backend HTTP confifuration. - * - *

    Multiple calls to this method will add additional certificate references. - * - * @param name the name of an existing authentication certificate - * @return the next stage of the definition - */ - WithAttachAndAuthCert withAuthenticationCertificate(String name); - - /** - * Associates a new, automatically named certificate with this HTTP backend configuration based on the - * specified data. - * - *

    Multiple calls to this method will add additional certificate references. - * - * @param derData the DER-encoded data of an X.509 certificate - * @return the next stage of the definition - */ - WithAttachAndAuthCert withAuthenticationCertificateFromBytes(byte[] derData); - - /** - * Associates a new, automatically named certificate with this HTTP backend configuration loaded from the - * specified file. - * - *

    Multiple calls to this method will add additional certificate references. - * - * @param certificateFile a file containing the DER format representation of an X.509 certificate - * @return the next stage of the definition - * @throws IOException when there are issues reading from the specified file - */ - WithAttachAndAuthCert withAuthenticationCertificateFromFile(File certificateFile) - throws IOException; - - /** - * Associates a new, automatically named certificate with this HTTP backend configuration loaded from the - * specified file. - * - *

    Multiple calls to this method will add additional certificate references. - * - * @param base64Data the base-64 encoded data of an X.509 certificate - * @return the next stage of the definition - */ - WithAttachAndAuthCert withAuthenticationCertificateFromBase64(String base64Data); - } - - /** - * The stage of an application gateway backend HTTP configuration allowing to add an authentication certificate, - * specify other options or attach to the parent application gateway definition. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface WithAttachAndAuthCert extends WithAttach, WithAuthenticationCertificate { - } - - /** - * The final stage of an application gateway backend HTTP configuration. - * - *

    At this stage, any remaining optional settings can be specified, or the definition can be attached to the - * parent application gateway definition using {@link WithAttach#attach()}. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface WithAttach - extends Attachable.InDefinition, - WithPort, - WithAffinity, - WithProtocol, - WithRequestTimeout, - WithProbe, - WithHostHeader, - WithConnectionDraining, - WithCookieName, - WithPath { - } - } - - /** - * The entirety of an application gateway backend HTTPS configuration definition. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithAttach, - DefinitionStages.WithAttachAndAuthCert { - } - - /** Grouping of application gateway backend HTTPS configuration update stages. */ - interface UpdateStages { - /** The stage of an application gateway backend HTTP configuration allowing to specify the port number. */ - interface WithPort extends HasPort.UpdateStages.WithPort { - } - - /** - * The stage of an application gateway backend HTTP configuration allowing to enable or disable cookie based - * affinity. - */ - interface WithAffinity { - /** - * Enables cookie based affinity. - * - * @return the next stage of the update - */ - Update withCookieBasedAffinity(); - - /** - * Disables cookie based affinity. - * - * @return the next stage of the update. - */ - Update withoutCookieBasedAffinity(); - } - - /** The stage of an application gateway backend HTTP configuration allowing to specify the protocol. */ - interface WithProtocol { - /** - * Specifies HTTPS as the protocol. - * - * @return the next stage of the update - */ - Update withHttps(); - - /** - * Specifies HTTP as the protocol. - * - * @return the next stage of the update - */ - Update withHttp(); - } - - /** The stage of an application gateway backend HTTP configuration allowing to specify the request timeout. */ - interface WithRequestTimeout { - /** - * Specifies the request timeout. - * - * @param seconds a number of seconds - * @return the next stage of the definition - */ - Update withRequestTimeout(int seconds); - } - - /** The stage of an application gateway backend HTTP configuration allowing to associate an existing probe. */ - interface WithProbe { - /** - * Specifies an existing probe on this application gateway to associate with this backend. - * - *

    If the probe with the specified name does not yet exist, it must be defined separately in the optional - * part of the application gateway definition. This only adds a reference to the probe by its name. - * - * @param name the name of an existing probe - * @return the next stage of the update - */ - Update withProbe(String name); - - /** - * Removes the association with a probe. - * - * @return the next stage of the update - */ - Update withoutProbe(); - } - - /** The stage of an application gateway backend HTTP configuration allowing to specify the host header. */ - interface WithHostHeader { - /** - * Specifies that the host header should come from the host name of the backend server. - * - * @return the next stage of the update - */ - Update withHostHeaderFromBackend(); - - /** - * Specifies that no host header should be used. - * - * @return the next stage of the update - */ - Update withoutHostHeader(); - - /** - * Specifies the host header. - * - * @param hostHeader the host header - * @return the next stage of the definition - */ - Update withHostHeader(String hostHeader); - } - - /** The stage of an application gateway backend HTTP configuration allowing to control connection draining. */ - interface WithConnectionDraining { - /** - * Specifies the number of seconds when connection draining is active. - * - * @param seconds a number of seconds between 1 and 3600 - * @return the next stage of the update - */ - Update withConnectionDrainingTimeoutInSeconds(int seconds); - - /** - * Disables connection draining. - * - * @return the next stage of the update - */ - Update withoutConnectionDraining(); - } - - /** - * The stage of an application gateway backend HTTP configuration allowing to specify the name for the affinity - * cookie. - */ - interface WithCookieName { - /** - * Specifies the name for the affinity cookie. - * - * @param name a name - * @return the next stage of the update - */ - Update withAffinityCookieName(String name); - } - - /** - * The stage of an application gateway backend HTTP configuration allowing to specify the path to use as the - * prefix for all HTTP requests. - */ - interface WithPath { - /** - * Specifies the path prefix for all HTTP requests. - * - * @param path a path - * @return the next stage of the update - */ - Update withPath(String path); - } - - /** - * The stage of an application gateway backend HTTP configuration allowing to add an authentication certificate. - */ - interface WithAuthenticationCertificate { - /** - * Associates the specified authentication certificate that exists on this application gateway with this - * backend HTTP confifuration. - * - *

    Multiple calls to this method will add additional certificate references. - * - * @param name the name of an existing authentication certificate - * @return the next stage of the update - */ - Update withAuthenticationCertificate(String name); - - /** - * Associates a new, automatically named certificate with this HTTP backend configuration based on the - * specified data. - * - *

    Multiple calls to this method will add additional certificate references. - * - * @param derData the DER-encoded data of an X.509 certificate - * @return the next stage of the update - */ - Update withAuthenticationCertificateFromBytes(byte[] derData); - - /** - * Associates a new, automatically named certificate with this HTTP backend configuration loaded from the - * specified file. - * - * @param certificateFile a file containing the DER representation of an X.509 certificate - * @return the next stage of the update - * @throws IOException when there are issues reading the specified file - */ - Update withAuthenticationCertificateFromFile(File certificateFile) throws IOException; - - /** - * Associates a new, automatically named certificate with this HTTP backend configuration loaded from the - * specified file. - * - *

    Multiple calls to this method will add additional certificate references. - * - * @param base64Data the base-64 encoded data of an X.509 certificate - * @return the next stage of the update - */ - Update withAuthenticationCertificateFromBase64(String base64Data); - - /** - * Removes the reference to the specified authentication certificate from this HTTP backend configuration. - * - *

    Note the certificate will remain associated with the application gateway until removed from it - * explicitly. - * - * @param name the name of an existing authentication certificate associated with this HTTP backend - * configuration - * @return the next stage of the update - */ - Update withoutAuthenticationCertificate(String name); - - /** - * Removes all references to any authentication certificates. - * - * @return the next stage of the update - */ - Update withoutAuthenticationCertificates(); - } - } - - /** - * The entirety of an application gateway backend HTTPS configuration update as part of an application gateway - * update. - */ - interface Update - extends Settable, - UpdateStages.WithPort, - UpdateStages.WithAffinity, - UpdateStages.WithProtocol, - UpdateStages.WithRequestTimeout, - UpdateStages.WithProbe, - UpdateStages.WithHostHeader, - UpdateStages.WithConnectionDraining, - UpdateStages.WithCookieName, - UpdateStages.WithPath, - UpdateStages.WithAuthenticationCertificate { - } - - /** - * Grouping of application gateway backend HTTPS configuration definition stages applicable as part of an - * application gateway update. - */ - interface UpdateDefinitionStages { - /** - * The first stage of an application gateway backend HTTP configuration definition. - * - * @param the stage of the parent application gateway update to return to after attaching this - * definition - */ - interface Blank extends WithAttach { - } - - /** - * The stage of an application gateway backend HTTP configuration allowing to add an authentication certificate, - * specify other options or attach to the parent application gateway update. - * - * @param the stage of the parent application gateway update to return to after attaching this - * definition - */ - interface WithAttachAndAuthCert extends WithAttach, WithAuthenticationCertificate { - } - - /** - * The final stage of an application gateway backend HTTP configuration definition. - * - *

    At this stage, any remaining optional settings can be specified, or the definition can be attached to the - * parent application gateway definition using {@link WithAttach#attach()}. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface WithAttach - extends Attachable.InUpdate, - WithPort, - WithAffinity, - WithProtocol, - WithRequestTimeout, - WithHostHeader, - WithConnectionDraining, - WithCookieName, - WithPath, - WithAuthenticationCertificate { - } - - /** - * The stage of an application gateway backend HTTP configuration allowing to add an authentication certificate. - * - * @param the stage of the parent application gateway update to return to after attaching this - * definition - */ - interface WithAuthenticationCertificate { - /** - * Associates the specified authentication certificate that exists on this application gateway with this - * backend HTTP confifuration. - * - *

    Multiple calls to this method will add additional certificate references. - * - * @param name the name of an existing authentication certificate - * @return the next stage of the definition - */ - WithAttachAndAuthCert withAuthenticationCertificate(String name); - - /** - * Associates a new, automatically named certificate with this HTTP backend configuration based on the - * specified data. - * - *

    Multiple calls to this method will add additional certificate references. - * - * @param derData the DER encoded data of an X.509 certificate - * @return the next stage of the definition - */ - WithAttachAndAuthCert withAuthenticationCertificateFromBytes(byte[] derData); - - /** - * Associates a new, automatically named certificate with this HTTP backend configuration loaded from the - * specified file. - * - *

    Multiple calls to this method will add additional certificate references. - * - * @param certificateFile a file containing the DER representation of an X.509 certificate - * @return the next stage of the definition - * @throws IOException when there are issues reading from the specified file - */ - WithAttachAndAuthCert withAuthenticationCertificateFromFile(File certificateFile) - throws IOException; - - /** - * Associates a new, automatically named certificate with this HTTP backend configuration loaded from the - * specified file. - * - *

    Multiple calls to this method will add additional certificate references. - * - * @param base64Data the base-64 encoded data of an X.509 certificate - * @return the next stage of the definition - */ - WithAttachAndAuthCert withAuthenticationCertificateFromBase64(String base64Data); - } - - /** - * The stage of an application gateway backend HTTP configuration allowing to specify the port number. - * - * @param the stage of the parent application gateway update to return to after attaching this - * definition - */ - interface WithPort extends HasPort.UpdateDefinitionStages.WithPort> { - } - - /** - * The stage of an application gateway backend HTTP configuration allowing to specify the request timeout. - * - * @param the stage of the parent application gateway update to return to after attaching this - * definition - */ - interface WithRequestTimeout { - /** - * Specifies the request timeout. - * - * @param seconds a number of seconds - * @return the next stage of the definition - */ - WithAttach withRequestTimeout(int seconds); - } - - /** - * The stage of an application gateway backend HTTP configuration allowing to specify the protocol. - * - * @param the stage of the parent application gateway update to return to after attaching this - * definition - */ - interface WithProtocol { - /** - * Specifies HTTPS as the protocol. - * - * @return the next stage of the definition - */ - WithAttachAndAuthCert withHttps(); - } - - /** - * The stage of an application gateway backend HTTP configuration allowing to enable or disable cookie based - * affinity. - * - * @param the stage of the parent application gateway update to return to after attaching this - * definition - */ - interface WithAffinity { - /** - * Enables cookie based affinity. - * - * @return the next stage of the update - */ - WithAttach withCookieBasedAffinity(); - - /** - * Disables cookie based affinity. - * - * @return the next stage of the update - */ - WithAttach withoutCookieBasedAffinity(); - } - - /** - * The stage of an application gateway backend HTTP configuration allowing to specify the name for the affinity - * cookie. - * - * @param the stage of the parent application gateway update to return to after attaching this - * definition - */ - interface WithCookieName { - /** - * Specifies the name for the affinity cookie. - * - * @param name a name - * @return the next stage of the definition - */ - WithAttach withAffinityCookieName(String name); - } - - /** - * The stage of an application gateway backend HTTP configuration allowing to specify the path to use as the - * prefix for all HTTP requests. - * - * @param the stage of the parent application gateway update to return to after attaching this - * definition - */ - interface WithPath { - /** - * Specifies the path prefix for all HTTP requests. - * - * @param path a path - * @return the next stage of the definition - */ - WithAttach withPath(String path); - } - - /** - * The stage of an application gateway backend HTTP configuration allowing to associate an existing probe. - * - * @param the stage of the parent application gateway update to return to after attaching this - * definition - */ - interface WithProbe { - /** - * Specifies an existing probe on this application gateway to associate with this backend. - * - *

    If the probe with the specified name does not yet exist, it must be defined separately in the optional - * part of the application gateway definition. This only adds a reference to the probe by its name. - * - * @param name the name of an existing probe - * @return the next stage of the definition - */ - WithAttach withProbe(String name); - } - - /** - * The stage of an application gateway backend HTTP configuration allowing to specify the host header. - * - * @param the stage of the parent application gateway update to return to after attaching this - * definition - */ - interface WithHostHeader { - /** - * Specifies the host header. - * - * @param hostHeader the host header - * @return the next stage of the definition - */ - WithAttach withHostHeader(String hostHeader); - - /** - * Specifies that the host header should come from the host name of the backend server. - * - * @return the next stage of the definition - */ - WithAttach withHostHeaderFromBackend(); - } - - /** - * The stage of an application gateway backend HTTP configuration allowing to control connection draining. - * - * @param the stage of the parent application gateway update to return to after attaching this - * definition - */ - interface WithConnectionDraining { - /** - * Specifies the number of seconds when connection draining is active. - * - * @param seconds a number of seconds between 1 and 3600 - * @return the next stage of the definition - */ - WithAttach withConnectionDrainingTimeoutInSeconds(int seconds); - } - } - - /** - * The entirety of an application gateway backend HTTPS configuration definition as part of an application gateway - * update. - * - * @param the stage of the parent application gateway update to return to after attaching this definition - */ - interface UpdateDefinition - extends UpdateDefinitionStages.Blank, - UpdateDefinitionStages.WithAttach, - UpdateDefinitionStages.WithAttachAndAuthCert { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayBackendHttpConfigurationHealth.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayBackendHttpConfigurationHealth.java deleted file mode 100644 index 5c69cde4a6c7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayBackendHttpConfigurationHealth.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasName; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasParent; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import java.util.Map; - -/** - * A client-side representation of the health information of an application gateway backend HTTP settings configuration. - */ -@Fluent -public interface ApplicationGatewayBackendHttpConfigurationHealth - extends HasInnerModel, - HasParent, - HasName { - - /** - * @return the associated application gateway backend HTTP configuration settings this health information pertains - * to - */ - ApplicationGatewayBackendHttpConfiguration backendHttpConfiguration(); - - /** @return information about the health of each backend server, indexed by the server's IP address */ - Map serverHealths(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayBackendHttpSettings.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayBackendHttpSettings.java deleted file mode 100644 index 439ee68b9190..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayBackendHttpSettings.java +++ /dev/null @@ -1,470 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.ApplicationGatewayBackendHttpSettingsPropertiesFormat; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Backend address pool settings of an application gateway. */ -@Fluent -public final class ApplicationGatewayBackendHttpSettings extends SubResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayBackendHttpSettings.class); - - /* - * Properties of Backend address pool settings of an application gateway. - */ - @JsonProperty(value = "properties") - private ApplicationGatewayBackendHttpSettingsPropertiesFormat innerProperties; - - /* - * Name of the backend http settings that is unique within an Application - * Gateway. - */ - @JsonProperty(value = "name") - private String name; - - /* - * A unique read-only string that changes whenever the resource is updated. - */ - @JsonProperty(value = "etag") - private String etag; - - /* - * Type of the resource. - */ - @JsonProperty(value = "type") - private String type; - - /** - * Get the innerProperties property: Properties of Backend address pool settings of an application gateway. - * - * @return the innerProperties value. - */ - private ApplicationGatewayBackendHttpSettingsPropertiesFormat innerProperties() { - return this.innerProperties; - } - - /** - * Get the name property: Name of the backend http settings that is unique within an Application Gateway. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Name of the backend http settings that is unique within an Application Gateway. - * - * @param name the name value to set. - * @return the ApplicationGatewayBackendHttpSettings object itself. - */ - public ApplicationGatewayBackendHttpSettings withName(String name) { - this.name = name; - return this; - } - - /** - * Get the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @param etag the etag value to set. - * @return the ApplicationGatewayBackendHttpSettings object itself. - */ - public ApplicationGatewayBackendHttpSettings withEtag(String etag) { - this.etag = etag; - return this; - } - - /** - * Get the type property: Type of the resource. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Set the type property: Type of the resource. - * - * @param type the type value to set. - * @return the ApplicationGatewayBackendHttpSettings object itself. - */ - public ApplicationGatewayBackendHttpSettings withType(String type) { - this.type = type; - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicationGatewayBackendHttpSettings withId(String id) { - super.withId(id); - return this; - } - - /** - * Get the port property: The destination port on the backend. - * - * @return the port value. - */ - public Integer port() { - return this.innerProperties() == null ? null : this.innerProperties().port(); - } - - /** - * Set the port property: The destination port on the backend. - * - * @param port the port value to set. - * @return the ApplicationGatewayBackendHttpSettings object itself. - */ - public ApplicationGatewayBackendHttpSettings withPort(Integer port) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayBackendHttpSettingsPropertiesFormat(); - } - this.innerProperties().withPort(port); - return this; - } - - /** - * Get the protocol property: The protocol used to communicate with the backend. Possible values are 'Http' and - * 'Https'. - * - * @return the protocol value. - */ - public ApplicationGatewayProtocol protocol() { - return this.innerProperties() == null ? null : this.innerProperties().protocol(); - } - - /** - * Set the protocol property: The protocol used to communicate with the backend. Possible values are 'Http' and - * 'Https'. - * - * @param protocol the protocol value to set. - * @return the ApplicationGatewayBackendHttpSettings object itself. - */ - public ApplicationGatewayBackendHttpSettings withProtocol(ApplicationGatewayProtocol protocol) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayBackendHttpSettingsPropertiesFormat(); - } - this.innerProperties().withProtocol(protocol); - return this; - } - - /** - * Get the cookieBasedAffinity property: Cookie based affinity. - * - * @return the cookieBasedAffinity value. - */ - public ApplicationGatewayCookieBasedAffinity cookieBasedAffinity() { - return this.innerProperties() == null ? null : this.innerProperties().cookieBasedAffinity(); - } - - /** - * Set the cookieBasedAffinity property: Cookie based affinity. - * - * @param cookieBasedAffinity the cookieBasedAffinity value to set. - * @return the ApplicationGatewayBackendHttpSettings object itself. - */ - public ApplicationGatewayBackendHttpSettings withCookieBasedAffinity( - ApplicationGatewayCookieBasedAffinity cookieBasedAffinity) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayBackendHttpSettingsPropertiesFormat(); - } - this.innerProperties().withCookieBasedAffinity(cookieBasedAffinity); - return this; - } - - /** - * Get the requestTimeout property: Request timeout in seconds. Application Gateway will fail the request if - * response is not received within RequestTimeout. Acceptable values are from 1 second to 86400 seconds. - * - * @return the requestTimeout value. - */ - public Integer requestTimeout() { - return this.innerProperties() == null ? null : this.innerProperties().requestTimeout(); - } - - /** - * Set the requestTimeout property: Request timeout in seconds. Application Gateway will fail the request if - * response is not received within RequestTimeout. Acceptable values are from 1 second to 86400 seconds. - * - * @param requestTimeout the requestTimeout value to set. - * @return the ApplicationGatewayBackendHttpSettings object itself. - */ - public ApplicationGatewayBackendHttpSettings withRequestTimeout(Integer requestTimeout) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayBackendHttpSettingsPropertiesFormat(); - } - this.innerProperties().withRequestTimeout(requestTimeout); - return this; - } - - /** - * Get the probe property: Probe resource of an application gateway. - * - * @return the probe value. - */ - public SubResource probe() { - return this.innerProperties() == null ? null : this.innerProperties().probe(); - } - - /** - * Set the probe property: Probe resource of an application gateway. - * - * @param probe the probe value to set. - * @return the ApplicationGatewayBackendHttpSettings object itself. - */ - public ApplicationGatewayBackendHttpSettings withProbe(SubResource probe) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayBackendHttpSettingsPropertiesFormat(); - } - this.innerProperties().withProbe(probe); - return this; - } - - /** - * Get the authenticationCertificates property: Array of references to application gateway authentication - * certificates. - * - * @return the authenticationCertificates value. - */ - public List authenticationCertificates() { - return this.innerProperties() == null ? null : this.innerProperties().authenticationCertificates(); - } - - /** - * Set the authenticationCertificates property: Array of references to application gateway authentication - * certificates. - * - * @param authenticationCertificates the authenticationCertificates value to set. - * @return the ApplicationGatewayBackendHttpSettings object itself. - */ - public ApplicationGatewayBackendHttpSettings withAuthenticationCertificates( - List authenticationCertificates) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayBackendHttpSettingsPropertiesFormat(); - } - this.innerProperties().withAuthenticationCertificates(authenticationCertificates); - return this; - } - - /** - * Get the trustedRootCertificates property: Array of references to application gateway trusted root certificates. - * - * @return the trustedRootCertificates value. - */ - public List trustedRootCertificates() { - return this.innerProperties() == null ? null : this.innerProperties().trustedRootCertificates(); - } - - /** - * Set the trustedRootCertificates property: Array of references to application gateway trusted root certificates. - * - * @param trustedRootCertificates the trustedRootCertificates value to set. - * @return the ApplicationGatewayBackendHttpSettings object itself. - */ - public ApplicationGatewayBackendHttpSettings withTrustedRootCertificates( - List trustedRootCertificates) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayBackendHttpSettingsPropertiesFormat(); - } - this.innerProperties().withTrustedRootCertificates(trustedRootCertificates); - return this; - } - - /** - * Get the connectionDraining property: Connection draining of the backend http settings resource. - * - * @return the connectionDraining value. - */ - public ApplicationGatewayConnectionDraining connectionDraining() { - return this.innerProperties() == null ? null : this.innerProperties().connectionDraining(); - } - - /** - * Set the connectionDraining property: Connection draining of the backend http settings resource. - * - * @param connectionDraining the connectionDraining value to set. - * @return the ApplicationGatewayBackendHttpSettings object itself. - */ - public ApplicationGatewayBackendHttpSettings withConnectionDraining( - ApplicationGatewayConnectionDraining connectionDraining) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayBackendHttpSettingsPropertiesFormat(); - } - this.innerProperties().withConnectionDraining(connectionDraining); - return this; - } - - /** - * Get the hostname property: Host header to be sent to the backend servers. - * - * @return the hostname value. - */ - public String hostname() { - return this.innerProperties() == null ? null : this.innerProperties().hostname(); - } - - /** - * Set the hostname property: Host header to be sent to the backend servers. - * - * @param hostname the hostname value to set. - * @return the ApplicationGatewayBackendHttpSettings object itself. - */ - public ApplicationGatewayBackendHttpSettings withHostname(String hostname) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayBackendHttpSettingsPropertiesFormat(); - } - this.innerProperties().withHostname(hostname); - return this; - } - - /** - * Get the pickHostnameFromBackendAddress property: Whether to pick host header should be picked from the host name - * of the backend server. Default value is false. - * - * @return the pickHostnameFromBackendAddress value. - */ - public Boolean pickHostnameFromBackendAddress() { - return this.innerProperties() == null ? null : this.innerProperties().pickHostnameFromBackendAddress(); - } - - /** - * Set the pickHostnameFromBackendAddress property: Whether to pick host header should be picked from the host name - * of the backend server. Default value is false. - * - * @param pickHostnameFromBackendAddress the pickHostnameFromBackendAddress value to set. - * @return the ApplicationGatewayBackendHttpSettings object itself. - */ - public ApplicationGatewayBackendHttpSettings withPickHostnameFromBackendAddress( - Boolean pickHostnameFromBackendAddress) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayBackendHttpSettingsPropertiesFormat(); - } - this.innerProperties().withPickHostnameFromBackendAddress(pickHostnameFromBackendAddress); - return this; - } - - /** - * Get the affinityCookieName property: Cookie name to use for the affinity cookie. - * - * @return the affinityCookieName value. - */ - public String affinityCookieName() { - return this.innerProperties() == null ? null : this.innerProperties().affinityCookieName(); - } - - /** - * Set the affinityCookieName property: Cookie name to use for the affinity cookie. - * - * @param affinityCookieName the affinityCookieName value to set. - * @return the ApplicationGatewayBackendHttpSettings object itself. - */ - public ApplicationGatewayBackendHttpSettings withAffinityCookieName(String affinityCookieName) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayBackendHttpSettingsPropertiesFormat(); - } - this.innerProperties().withAffinityCookieName(affinityCookieName); - return this; - } - - /** - * Get the probeEnabled property: Whether the probe is enabled. Default value is false. - * - * @return the probeEnabled value. - */ - public Boolean probeEnabled() { - return this.innerProperties() == null ? null : this.innerProperties().probeEnabled(); - } - - /** - * Set the probeEnabled property: Whether the probe is enabled. Default value is false. - * - * @param probeEnabled the probeEnabled value to set. - * @return the ApplicationGatewayBackendHttpSettings object itself. - */ - public ApplicationGatewayBackendHttpSettings withProbeEnabled(Boolean probeEnabled) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayBackendHttpSettingsPropertiesFormat(); - } - this.innerProperties().withProbeEnabled(probeEnabled); - return this; - } - - /** - * Get the path property: Path which should be used as a prefix for all HTTP requests. Null means no path will be - * prefixed. Default value is null. - * - * @return the path value. - */ - public String path() { - return this.innerProperties() == null ? null : this.innerProperties().path(); - } - - /** - * Set the path property: Path which should be used as a prefix for all HTTP requests. Null means no path will be - * prefixed. Default value is null. - * - * @param path the path value to set. - * @return the ApplicationGatewayBackendHttpSettings object itself. - */ - public ApplicationGatewayBackendHttpSettings withPath(String path) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayBackendHttpSettingsPropertiesFormat(); - } - this.innerProperties().withPath(path); - return this; - } - - /** - * Get the provisioningState property: Provisioning state of the backend http settings resource. Possible values - * are: 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Set the provisioningState property: Provisioning state of the backend http settings resource. Possible values - * are: 'Updating', 'Deleting', and 'Failed'. - * - * @param provisioningState the provisioningState value to set. - * @return the ApplicationGatewayBackendHttpSettings object itself. - */ - public ApplicationGatewayBackendHttpSettings withProvisioningState(String provisioningState) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayBackendHttpSettingsPropertiesFormat(); - } - this.innerProperties().withProvisioningState(provisioningState); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayBackendServerHealth.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayBackendServerHealth.java deleted file mode 100644 index 632326285fbe..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayBackendServerHealth.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.network.fluent.models.ApplicationGatewayBackendHealthServerInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasParent; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; - -/** A client-side representation of the health information of an application gateway backend server. */ -@Fluent -public interface ApplicationGatewayBackendServerHealth - extends HasInnerModel, - HasParent { - - /** @return IP address of the server this health information pertains to */ - String ipAddress(); - - /** - * Gets the IP configuration of the network interface this health information pertains to. - * - * @return a network interface IP configuration - */ - NicIpConfiguration getNetworkInterfaceIPConfiguration(); - - /** @return the health status of the server */ - ApplicationGatewayBackendHealthStatus status(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayConnectionDraining.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayConnectionDraining.java deleted file mode 100644 index 7955588f8948..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayConnectionDraining.java +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Connection draining allows open connections to a backend server to be active for a specified time after the backend - * server got removed from the configuration. - */ -@Fluent -public final class ApplicationGatewayConnectionDraining { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayConnectionDraining.class); - - /* - * Whether connection draining is enabled or not. - */ - @JsonProperty(value = "enabled", required = true) - private boolean enabled; - - /* - * The number of seconds connection draining is active. Acceptable values - * are from 1 second to 3600 seconds. - */ - @JsonProperty(value = "drainTimeoutInSec", required = true) - private int drainTimeoutInSec; - - /** - * Get the enabled property: Whether connection draining is enabled or not. - * - * @return the enabled value. - */ - public boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Whether connection draining is enabled or not. - * - * @param enabled the enabled value to set. - * @return the ApplicationGatewayConnectionDraining object itself. - */ - public ApplicationGatewayConnectionDraining withEnabled(boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the drainTimeoutInSec property: The number of seconds connection draining is active. Acceptable values are - * from 1 second to 3600 seconds. - * - * @return the drainTimeoutInSec value. - */ - public int drainTimeoutInSec() { - return this.drainTimeoutInSec; - } - - /** - * Set the drainTimeoutInSec property: The number of seconds connection draining is active. Acceptable values are - * from 1 second to 3600 seconds. - * - * @param drainTimeoutInSec the drainTimeoutInSec value to set. - * @return the ApplicationGatewayConnectionDraining object itself. - */ - public ApplicationGatewayConnectionDraining withDrainTimeoutInSec(int drainTimeoutInSec) { - this.drainTimeoutInSec = drainTimeoutInSec; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayCookieBasedAffinity.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayCookieBasedAffinity.java deleted file mode 100644 index a6ebe7c15289..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayCookieBasedAffinity.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ApplicationGatewayCookieBasedAffinity. */ -public final class ApplicationGatewayCookieBasedAffinity - extends ExpandableStringEnum { - /** Static value Enabled for ApplicationGatewayCookieBasedAffinity. */ - public static final ApplicationGatewayCookieBasedAffinity ENABLED = fromString("Enabled"); - - /** Static value Disabled for ApplicationGatewayCookieBasedAffinity. */ - public static final ApplicationGatewayCookieBasedAffinity DISABLED = fromString("Disabled"); - - /** - * Creates or finds a ApplicationGatewayCookieBasedAffinity from its string representation. - * - * @param name a name to look for. - * @return the corresponding ApplicationGatewayCookieBasedAffinity. - */ - @JsonCreator - public static ApplicationGatewayCookieBasedAffinity fromString(String name) { - return fromString(name, ApplicationGatewayCookieBasedAffinity.class); - } - - /** @return known ApplicationGatewayCookieBasedAffinity values. */ - public static Collection values() { - return values(ApplicationGatewayCookieBasedAffinity.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayCustomError.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayCustomError.java deleted file mode 100644 index f7eaf345bbd1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayCustomError.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Customer error of an application gateway. */ -@Fluent -public final class ApplicationGatewayCustomError { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayCustomError.class); - - /* - * Status code of the application gateway customer error. - */ - @JsonProperty(value = "statusCode") - private ApplicationGatewayCustomErrorStatusCode statusCode; - - /* - * Error page URL of the application gateway customer error. - */ - @JsonProperty(value = "customErrorPageUrl") - private String customErrorPageUrl; - - /** - * Get the statusCode property: Status code of the application gateway customer error. - * - * @return the statusCode value. - */ - public ApplicationGatewayCustomErrorStatusCode statusCode() { - return this.statusCode; - } - - /** - * Set the statusCode property: Status code of the application gateway customer error. - * - * @param statusCode the statusCode value to set. - * @return the ApplicationGatewayCustomError object itself. - */ - public ApplicationGatewayCustomError withStatusCode(ApplicationGatewayCustomErrorStatusCode statusCode) { - this.statusCode = statusCode; - return this; - } - - /** - * Get the customErrorPageUrl property: Error page URL of the application gateway customer error. - * - * @return the customErrorPageUrl value. - */ - public String customErrorPageUrl() { - return this.customErrorPageUrl; - } - - /** - * Set the customErrorPageUrl property: Error page URL of the application gateway customer error. - * - * @param customErrorPageUrl the customErrorPageUrl value to set. - * @return the ApplicationGatewayCustomError object itself. - */ - public ApplicationGatewayCustomError withCustomErrorPageUrl(String customErrorPageUrl) { - this.customErrorPageUrl = customErrorPageUrl; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayCustomErrorStatusCode.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayCustomErrorStatusCode.java deleted file mode 100644 index 08d2a5307c16..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayCustomErrorStatusCode.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ApplicationGatewayCustomErrorStatusCode. */ -public final class ApplicationGatewayCustomErrorStatusCode - extends ExpandableStringEnum { - /** Static value HttpStatus403 for ApplicationGatewayCustomErrorStatusCode. */ - public static final ApplicationGatewayCustomErrorStatusCode HTTP_STATUS403 = fromString("HttpStatus403"); - - /** Static value HttpStatus502 for ApplicationGatewayCustomErrorStatusCode. */ - public static final ApplicationGatewayCustomErrorStatusCode HTTP_STATUS502 = fromString("HttpStatus502"); - - /** - * Creates or finds a ApplicationGatewayCustomErrorStatusCode from its string representation. - * - * @param name a name to look for. - * @return the corresponding ApplicationGatewayCustomErrorStatusCode. - */ - @JsonCreator - public static ApplicationGatewayCustomErrorStatusCode fromString(String name) { - return fromString(name, ApplicationGatewayCustomErrorStatusCode.class); - } - - /** @return known ApplicationGatewayCustomErrorStatusCode values. */ - public static Collection values() { - return values(ApplicationGatewayCustomErrorStatusCode.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayFirewallDisabledRuleGroup.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayFirewallDisabledRuleGroup.java deleted file mode 100644 index 5c9402b813dc..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayFirewallDisabledRuleGroup.java +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Allows to disable rules within a rule group or an entire rule group. */ -@Fluent -public final class ApplicationGatewayFirewallDisabledRuleGroup { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayFirewallDisabledRuleGroup.class); - - /* - * The name of the rule group that will be disabled. - */ - @JsonProperty(value = "ruleGroupName", required = true) - private String ruleGroupName; - - /* - * The list of rules that will be disabled. If null, all rules of the rule - * group will be disabled. - */ - @JsonProperty(value = "rules") - private List rules; - - /** - * Get the ruleGroupName property: The name of the rule group that will be disabled. - * - * @return the ruleGroupName value. - */ - public String ruleGroupName() { - return this.ruleGroupName; - } - - /** - * Set the ruleGroupName property: The name of the rule group that will be disabled. - * - * @param ruleGroupName the ruleGroupName value to set. - * @return the ApplicationGatewayFirewallDisabledRuleGroup object itself. - */ - public ApplicationGatewayFirewallDisabledRuleGroup withRuleGroupName(String ruleGroupName) { - this.ruleGroupName = ruleGroupName; - return this; - } - - /** - * Get the rules property: The list of rules that will be disabled. If null, all rules of the rule group will be - * disabled. - * - * @return the rules value. - */ - public List rules() { - return this.rules; - } - - /** - * Set the rules property: The list of rules that will be disabled. If null, all rules of the rule group will be - * disabled. - * - * @param rules the rules value to set. - * @return the ApplicationGatewayFirewallDisabledRuleGroup object itself. - */ - public ApplicationGatewayFirewallDisabledRuleGroup withRules(List rules) { - this.rules = rules; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (ruleGroupName() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property ruleGroupName in model" - + " ApplicationGatewayFirewallDisabledRuleGroup")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayFirewallExclusion.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayFirewallExclusion.java deleted file mode 100644 index 9ed551464fdc..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayFirewallExclusion.java +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Allow to exclude some variable satisfy the condition for the WAF check. */ -@Fluent -public final class ApplicationGatewayFirewallExclusion { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayFirewallExclusion.class); - - /* - * The variable to be excluded. - */ - @JsonProperty(value = "matchVariable", required = true) - private String matchVariable; - - /* - * When matchVariable is a collection, operate on the selector to specify - * which elements in the collection this exclusion applies to. - */ - @JsonProperty(value = "selectorMatchOperator", required = true) - private String selectorMatchOperator; - - /* - * When matchVariable is a collection, operator used to specify which - * elements in the collection this exclusion applies to. - */ - @JsonProperty(value = "selector", required = true) - private String selector; - - /** - * Get the matchVariable property: The variable to be excluded. - * - * @return the matchVariable value. - */ - public String matchVariable() { - return this.matchVariable; - } - - /** - * Set the matchVariable property: The variable to be excluded. - * - * @param matchVariable the matchVariable value to set. - * @return the ApplicationGatewayFirewallExclusion object itself. - */ - public ApplicationGatewayFirewallExclusion withMatchVariable(String matchVariable) { - this.matchVariable = matchVariable; - return this; - } - - /** - * Get the selectorMatchOperator property: When matchVariable is a collection, operate on the selector to specify - * which elements in the collection this exclusion applies to. - * - * @return the selectorMatchOperator value. - */ - public String selectorMatchOperator() { - return this.selectorMatchOperator; - } - - /** - * Set the selectorMatchOperator property: When matchVariable is a collection, operate on the selector to specify - * which elements in the collection this exclusion applies to. - * - * @param selectorMatchOperator the selectorMatchOperator value to set. - * @return the ApplicationGatewayFirewallExclusion object itself. - */ - public ApplicationGatewayFirewallExclusion withSelectorMatchOperator(String selectorMatchOperator) { - this.selectorMatchOperator = selectorMatchOperator; - return this; - } - - /** - * Get the selector property: When matchVariable is a collection, operator used to specify which elements in the - * collection this exclusion applies to. - * - * @return the selector value. - */ - public String selector() { - return this.selector; - } - - /** - * Set the selector property: When matchVariable is a collection, operator used to specify which elements in the - * collection this exclusion applies to. - * - * @param selector the selector value to set. - * @return the ApplicationGatewayFirewallExclusion object itself. - */ - public ApplicationGatewayFirewallExclusion withSelector(String selector) { - this.selector = selector; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (matchVariable() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property matchVariable in model ApplicationGatewayFirewallExclusion")); - } - if (selectorMatchOperator() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property selectorMatchOperator in model" - + " ApplicationGatewayFirewallExclusion")); - } - if (selector() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property selector in model ApplicationGatewayFirewallExclusion")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayFirewallMode.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayFirewallMode.java deleted file mode 100644 index bdf125efe273..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayFirewallMode.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ApplicationGatewayFirewallMode. */ -public final class ApplicationGatewayFirewallMode extends ExpandableStringEnum { - /** Static value Detection for ApplicationGatewayFirewallMode. */ - public static final ApplicationGatewayFirewallMode DETECTION = fromString("Detection"); - - /** Static value Prevention for ApplicationGatewayFirewallMode. */ - public static final ApplicationGatewayFirewallMode PREVENTION = fromString("Prevention"); - - /** - * Creates or finds a ApplicationGatewayFirewallMode from its string representation. - * - * @param name a name to look for. - * @return the corresponding ApplicationGatewayFirewallMode. - */ - @JsonCreator - public static ApplicationGatewayFirewallMode fromString(String name) { - return fromString(name, ApplicationGatewayFirewallMode.class); - } - - /** @return known ApplicationGatewayFirewallMode values. */ - public static Collection values() { - return values(ApplicationGatewayFirewallMode.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayFirewallRule.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayFirewallRule.java deleted file mode 100644 index e7cf6419f6a3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayFirewallRule.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** A web application firewall rule. */ -@Fluent -public final class ApplicationGatewayFirewallRule { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayFirewallRule.class); - - /* - * The identifier of the web application firewall rule. - */ - @JsonProperty(value = "ruleId", required = true) - private int ruleId; - - /* - * The description of the web application firewall rule. - */ - @JsonProperty(value = "description") - private String description; - - /** - * Get the ruleId property: The identifier of the web application firewall rule. - * - * @return the ruleId value. - */ - public int ruleId() { - return this.ruleId; - } - - /** - * Set the ruleId property: The identifier of the web application firewall rule. - * - * @param ruleId the ruleId value to set. - * @return the ApplicationGatewayFirewallRule object itself. - */ - public ApplicationGatewayFirewallRule withRuleId(int ruleId) { - this.ruleId = ruleId; - return this; - } - - /** - * Get the description property: The description of the web application firewall rule. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: The description of the web application firewall rule. - * - * @param description the description value to set. - * @return the ApplicationGatewayFirewallRule object itself. - */ - public ApplicationGatewayFirewallRule withDescription(String description) { - this.description = description; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayFirewallRuleGroup.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayFirewallRuleGroup.java deleted file mode 100644 index 4ac49d56110c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayFirewallRuleGroup.java +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** A web application firewall rule group. */ -@Fluent -public final class ApplicationGatewayFirewallRuleGroup { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayFirewallRuleGroup.class); - - /* - * The name of the web application firewall rule group. - */ - @JsonProperty(value = "ruleGroupName", required = true) - private String ruleGroupName; - - /* - * The description of the web application firewall rule group. - */ - @JsonProperty(value = "description") - private String description; - - /* - * The rules of the web application firewall rule group. - */ - @JsonProperty(value = "rules", required = true) - private List rules; - - /** - * Get the ruleGroupName property: The name of the web application firewall rule group. - * - * @return the ruleGroupName value. - */ - public String ruleGroupName() { - return this.ruleGroupName; - } - - /** - * Set the ruleGroupName property: The name of the web application firewall rule group. - * - * @param ruleGroupName the ruleGroupName value to set. - * @return the ApplicationGatewayFirewallRuleGroup object itself. - */ - public ApplicationGatewayFirewallRuleGroup withRuleGroupName(String ruleGroupName) { - this.ruleGroupName = ruleGroupName; - return this; - } - - /** - * Get the description property: The description of the web application firewall rule group. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: The description of the web application firewall rule group. - * - * @param description the description value to set. - * @return the ApplicationGatewayFirewallRuleGroup object itself. - */ - public ApplicationGatewayFirewallRuleGroup withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the rules property: The rules of the web application firewall rule group. - * - * @return the rules value. - */ - public List rules() { - return this.rules; - } - - /** - * Set the rules property: The rules of the web application firewall rule group. - * - * @param rules the rules value to set. - * @return the ApplicationGatewayFirewallRuleGroup object itself. - */ - public ApplicationGatewayFirewallRuleGroup withRules(List rules) { - this.rules = rules; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (ruleGroupName() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property ruleGroupName in model ApplicationGatewayFirewallRuleGroup")); - } - if (rules() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property rules in model ApplicationGatewayFirewallRuleGroup")); - } else { - rules().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayFirewallRuleSet.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayFirewallRuleSet.java deleted file mode 100644 index 83b9fa48321b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayFirewallRuleSet.java +++ /dev/null @@ -1,178 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.ApplicationGatewayFirewallRuleSetPropertiesFormat; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** A web application firewall rule set. */ -@Fluent -public final class ApplicationGatewayFirewallRuleSet extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayFirewallRuleSet.class); - - /* - * Properties of the web application firewall rule set. - */ - @JsonProperty(value = "properties") - private ApplicationGatewayFirewallRuleSetPropertiesFormat innerProperties; - - /* - * Resource ID. - */ - @JsonProperty(value = "id") - private String id; - - /** - * Get the innerProperties property: Properties of the web application firewall rule set. - * - * @return the innerProperties value. - */ - private ApplicationGatewayFirewallRuleSetPropertiesFormat innerProperties() { - return this.innerProperties; - } - - /** - * Get the id property: Resource ID. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: Resource ID. - * - * @param id the id value to set. - * @return the ApplicationGatewayFirewallRuleSet object itself. - */ - public ApplicationGatewayFirewallRuleSet withId(String id) { - this.id = id; - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicationGatewayFirewallRuleSet withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicationGatewayFirewallRuleSet withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the web application firewall rule set. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Set the provisioningState property: The provisioning state of the web application firewall rule set. - * - * @param provisioningState the provisioningState value to set. - * @return the ApplicationGatewayFirewallRuleSet object itself. - */ - public ApplicationGatewayFirewallRuleSet withProvisioningState(String provisioningState) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayFirewallRuleSetPropertiesFormat(); - } - this.innerProperties().withProvisioningState(provisioningState); - return this; - } - - /** - * Get the ruleSetType property: The type of the web application firewall rule set. - * - * @return the ruleSetType value. - */ - public String ruleSetType() { - return this.innerProperties() == null ? null : this.innerProperties().ruleSetType(); - } - - /** - * Set the ruleSetType property: The type of the web application firewall rule set. - * - * @param ruleSetType the ruleSetType value to set. - * @return the ApplicationGatewayFirewallRuleSet object itself. - */ - public ApplicationGatewayFirewallRuleSet withRuleSetType(String ruleSetType) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayFirewallRuleSetPropertiesFormat(); - } - this.innerProperties().withRuleSetType(ruleSetType); - return this; - } - - /** - * Get the ruleSetVersion property: The version of the web application firewall rule set type. - * - * @return the ruleSetVersion value. - */ - public String ruleSetVersion() { - return this.innerProperties() == null ? null : this.innerProperties().ruleSetVersion(); - } - - /** - * Set the ruleSetVersion property: The version of the web application firewall rule set type. - * - * @param ruleSetVersion the ruleSetVersion value to set. - * @return the ApplicationGatewayFirewallRuleSet object itself. - */ - public ApplicationGatewayFirewallRuleSet withRuleSetVersion(String ruleSetVersion) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayFirewallRuleSetPropertiesFormat(); - } - this.innerProperties().withRuleSetVersion(ruleSetVersion); - return this; - } - - /** - * Get the ruleGroups property: The rule groups of the web application firewall rule set. - * - * @return the ruleGroups value. - */ - public List ruleGroups() { - return this.innerProperties() == null ? null : this.innerProperties().ruleGroups(); - } - - /** - * Set the ruleGroups property: The rule groups of the web application firewall rule set. - * - * @param ruleGroups the ruleGroups value to set. - * @return the ApplicationGatewayFirewallRuleSet object itself. - */ - public ApplicationGatewayFirewallRuleSet withRuleGroups(List ruleGroups) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayFirewallRuleSetPropertiesFormat(); - } - this.innerProperties().withRuleGroups(ruleGroups); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayFrontend.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayFrontend.java deleted file mode 100644 index 8551ebe6116b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayFrontend.java +++ /dev/null @@ -1,199 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.arm.models.ChildResource; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasSubnet; -import com.azure.resourcemanager.resources.fluentcore.model.Attachable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.model.Settable; - -/** A client-side representation of an application gateway frontend. */ -@Fluent() -public interface ApplicationGatewayFrontend - extends HasInnerModel, - ChildResource, - HasPrivateIpAddress, - HasSubnet, - HasPublicIpAddress { - - /** @return true if the frontend is accessible via a public IP address, else false */ - boolean isPublic(); - - /** @return true is the frontend is accessible via an private IP address */ - boolean isPrivate(); - - /** @return the associated subnet */ - Subnet getSubnet(); - - /** Grouping of application gateway frontend definition stages. */ - interface DefinitionStages { - /** - * The first stage of an application gateway frontend definition. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface Blank extends WithSubnet { - } - - /** - * The stage of an application gateway frontend definition allowing to specify a subnet from the selected - * network to make this application gateway visible to. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface WithSubnet extends HasSubnet.DefinitionStages.WithSubnet> { - /** - * Assigns the specified subnet to this private frontend. - * - * @param network the virtual network the subnet exists in - * @param subnetName the name of a subnet - * @return the next stage of the definition - */ - WithAttach withExistingSubnet(Network network, String subnetName); - } - - /** - * The stage of an application gateway frontend definition allowing to specify the private IP address this - * application gateway should be available at within the selected subnet. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface WithPrivateIP - extends HasPrivateIpAddress.DefinitionStages.WithPrivateIPAddress> { - } - - /** - * The stage of an application gateway frontend definition allowing to specify an existing public IP address to - * make the application gateway available at as Internet-facing. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface WithPublicIPAddress - extends HasPublicIpAddress.DefinitionStages.WithExistingPublicIPAddress> { - } - - /** - * The final stage of an application gateway frontend definition. - * - *

    At this stage, any remaining optional settings can be specified, or the frontend definition can be - * attached to the parent application gateway definition. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface WithAttach - extends Attachable.InDefinitionAlt, WithSubnet, WithPrivateIP { - } - } - - /** - * The entirety of an application gateway frontend definition. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithAttach, - DefinitionStages.WithPublicIPAddress { - } - - /** Grouping of application gateway frontend update stages. */ - interface UpdateStages { - /** - * The stage of an application gateway frontend definition allowing to specify an existing public IP address to - * make the application gateway available at as Internet-facing. - */ - interface WithPublicIPAddress extends HasPublicIpAddress.UpdateStages.WithExistingPublicIPAddress { - } - } - - /** The entirety of an application gateway frontend update as part of an application gateway update. */ - interface Update extends Settable, UpdateStages.WithPublicIPAddress { - } - - /** - * Grouping of application gateway frontend definition stages applicable as part of an application gateway update. - */ - interface UpdateDefinitionStages { - /** - * The first stage of an application gateway frontend definition. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface Blank extends WithSubnet { - } - - /** - * The stage of an application gateway frontend definition allowing to specify an existing public IP address to - * make the application gateway available at as Internet-facing. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithPublicIPAddress - extends HasPublicIpAddress.UpdateDefinitionStages.WithExistingPublicIPAddress> { - } - - /** - * The stage of an application gateway frontend definition allowing to specify a subnet from the selected - * network to make this application gateway visible to. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface WithSubnet extends HasSubnet.UpdateDefinitionStages.WithSubnet> { - /** - * Assigns the specified subnet to this private frontend. - * - * @param network the virtual network the subnet exists in - * @param subnetName the name of a subnet - * @return the next stage of the definition - */ - WithAttach withExistingSubnet(Network network, String subnetName); - } - - /** - * The stage of an application gateway frontend definition allowing to specify the private IP address this - * application gateway should be available at within the selected virtual network. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface WithPrivateIP - extends HasPrivateIpAddress.UpdateDefinitionStages.WithPrivateIPAddress> { - } - - /** - * The final stage of an application gateway frontend definition. - * - *

    At this stage, any remaining optional settings can be specified, or the frontend definition can be - * attached to the parent application gateway definition. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface WithAttach - extends Attachable.InUpdateAlt, - WithPublicIPAddress, - WithSubnet, - WithPrivateIP { - } - } - - /** - * The entirety of an application gateway frontend definition as part of an application gateway update. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface UpdateDefinition - extends UpdateDefinitionStages.Blank, UpdateDefinitionStages.WithAttach { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayFrontendIpConfiguration.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayFrontendIpConfiguration.java deleted file mode 100644 index 3ab3aed4203d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayFrontendIpConfiguration.java +++ /dev/null @@ -1,248 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.ApplicationGatewayFrontendIpConfigurationPropertiesFormat; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Frontend IP configuration of an application gateway. */ -@Fluent -public final class ApplicationGatewayFrontendIpConfiguration extends SubResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayFrontendIpConfiguration.class); - - /* - * Properties of Frontend IP configuration of an application gateway. - */ - @JsonProperty(value = "properties") - private ApplicationGatewayFrontendIpConfigurationPropertiesFormat innerProperties; - - /* - * Name of the frontend IP configuration that is unique within an - * Application Gateway. - */ - @JsonProperty(value = "name") - private String name; - - /* - * A unique read-only string that changes whenever the resource is updated. - */ - @JsonProperty(value = "etag") - private String etag; - - /* - * Type of the resource. - */ - @JsonProperty(value = "type") - private String type; - - /** - * Get the innerProperties property: Properties of Frontend IP configuration of an application gateway. - * - * @return the innerProperties value. - */ - private ApplicationGatewayFrontendIpConfigurationPropertiesFormat innerProperties() { - return this.innerProperties; - } - - /** - * Get the name property: Name of the frontend IP configuration that is unique within an Application Gateway. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Name of the frontend IP configuration that is unique within an Application Gateway. - * - * @param name the name value to set. - * @return the ApplicationGatewayFrontendIpConfiguration object itself. - */ - public ApplicationGatewayFrontendIpConfiguration withName(String name) { - this.name = name; - return this; - } - - /** - * Get the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @param etag the etag value to set. - * @return the ApplicationGatewayFrontendIpConfiguration object itself. - */ - public ApplicationGatewayFrontendIpConfiguration withEtag(String etag) { - this.etag = etag; - return this; - } - - /** - * Get the type property: Type of the resource. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Set the type property: Type of the resource. - * - * @param type the type value to set. - * @return the ApplicationGatewayFrontendIpConfiguration object itself. - */ - public ApplicationGatewayFrontendIpConfiguration withType(String type) { - this.type = type; - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicationGatewayFrontendIpConfiguration withId(String id) { - super.withId(id); - return this; - } - - /** - * Get the privateIpAddress property: PrivateIPAddress of the network interface IP Configuration. - * - * @return the privateIpAddress value. - */ - public String privateIpAddress() { - return this.innerProperties() == null ? null : this.innerProperties().privateIpAddress(); - } - - /** - * Set the privateIpAddress property: PrivateIPAddress of the network interface IP Configuration. - * - * @param privateIpAddress the privateIpAddress value to set. - * @return the ApplicationGatewayFrontendIpConfiguration object itself. - */ - public ApplicationGatewayFrontendIpConfiguration withPrivateIpAddress(String privateIpAddress) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayFrontendIpConfigurationPropertiesFormat(); - } - this.innerProperties().withPrivateIpAddress(privateIpAddress); - return this; - } - - /** - * Get the privateIpAllocationMethod property: PrivateIP allocation method. - * - * @return the privateIpAllocationMethod value. - */ - public IpAllocationMethod privateIpAllocationMethod() { - return this.innerProperties() == null ? null : this.innerProperties().privateIpAllocationMethod(); - } - - /** - * Set the privateIpAllocationMethod property: PrivateIP allocation method. - * - * @param privateIpAllocationMethod the privateIpAllocationMethod value to set. - * @return the ApplicationGatewayFrontendIpConfiguration object itself. - */ - public ApplicationGatewayFrontendIpConfiguration withPrivateIpAllocationMethod( - IpAllocationMethod privateIpAllocationMethod) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayFrontendIpConfigurationPropertiesFormat(); - } - this.innerProperties().withPrivateIpAllocationMethod(privateIpAllocationMethod); - return this; - } - - /** - * Get the subnet property: Reference of the subnet resource. - * - * @return the subnet value. - */ - public SubResource subnet() { - return this.innerProperties() == null ? null : this.innerProperties().subnet(); - } - - /** - * Set the subnet property: Reference of the subnet resource. - * - * @param subnet the subnet value to set. - * @return the ApplicationGatewayFrontendIpConfiguration object itself. - */ - public ApplicationGatewayFrontendIpConfiguration withSubnet(SubResource subnet) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayFrontendIpConfigurationPropertiesFormat(); - } - this.innerProperties().withSubnet(subnet); - return this; - } - - /** - * Get the publicIpAddress property: Reference of the PublicIP resource. - * - * @return the publicIpAddress value. - */ - public SubResource publicIpAddress() { - return this.innerProperties() == null ? null : this.innerProperties().publicIpAddress(); - } - - /** - * Set the publicIpAddress property: Reference of the PublicIP resource. - * - * @param publicIpAddress the publicIpAddress value to set. - * @return the ApplicationGatewayFrontendIpConfiguration object itself. - */ - public ApplicationGatewayFrontendIpConfiguration withPublicIpAddress(SubResource publicIpAddress) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayFrontendIpConfigurationPropertiesFormat(); - } - this.innerProperties().withPublicIpAddress(publicIpAddress); - return this; - } - - /** - * Get the provisioningState property: Provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Set the provisioningState property: Provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param provisioningState the provisioningState value to set. - * @return the ApplicationGatewayFrontendIpConfiguration object itself. - */ - public ApplicationGatewayFrontendIpConfiguration withProvisioningState(String provisioningState) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayFrontendIpConfigurationPropertiesFormat(); - } - this.innerProperties().withProvisioningState(provisioningState); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayFrontendPort.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayFrontendPort.java deleted file mode 100644 index 5d099a8a8a9d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayFrontendPort.java +++ /dev/null @@ -1,177 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.ApplicationGatewayFrontendPortPropertiesFormat; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Frontend port of an application gateway. */ -@Fluent -public final class ApplicationGatewayFrontendPort extends SubResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayFrontendPort.class); - - /* - * Properties of Frontend port of an application gateway. - */ - @JsonProperty(value = "properties") - private ApplicationGatewayFrontendPortPropertiesFormat innerProperties; - - /* - * Name of the frontend port that is unique within an Application Gateway - */ - @JsonProperty(value = "name") - private String name; - - /* - * A unique read-only string that changes whenever the resource is updated. - */ - @JsonProperty(value = "etag") - private String etag; - - /* - * Type of the resource. - */ - @JsonProperty(value = "type") - private String type; - - /** - * Get the innerProperties property: Properties of Frontend port of an application gateway. - * - * @return the innerProperties value. - */ - private ApplicationGatewayFrontendPortPropertiesFormat innerProperties() { - return this.innerProperties; - } - - /** - * Get the name property: Name of the frontend port that is unique within an Application Gateway. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Name of the frontend port that is unique within an Application Gateway. - * - * @param name the name value to set. - * @return the ApplicationGatewayFrontendPort object itself. - */ - public ApplicationGatewayFrontendPort withName(String name) { - this.name = name; - return this; - } - - /** - * Get the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @param etag the etag value to set. - * @return the ApplicationGatewayFrontendPort object itself. - */ - public ApplicationGatewayFrontendPort withEtag(String etag) { - this.etag = etag; - return this; - } - - /** - * Get the type property: Type of the resource. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Set the type property: Type of the resource. - * - * @param type the type value to set. - * @return the ApplicationGatewayFrontendPort object itself. - */ - public ApplicationGatewayFrontendPort withType(String type) { - this.type = type; - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicationGatewayFrontendPort withId(String id) { - super.withId(id); - return this; - } - - /** - * Get the port property: Frontend port. - * - * @return the port value. - */ - public Integer port() { - return this.innerProperties() == null ? null : this.innerProperties().port(); - } - - /** - * Set the port property: Frontend port. - * - * @param port the port value to set. - * @return the ApplicationGatewayFrontendPort object itself. - */ - public ApplicationGatewayFrontendPort withPort(Integer port) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayFrontendPortPropertiesFormat(); - } - this.innerProperties().withPort(port); - return this; - } - - /** - * Get the provisioningState property: Provisioning state of the frontend port resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Set the provisioningState property: Provisioning state of the frontend port resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param provisioningState the provisioningState value to set. - * @return the ApplicationGatewayFrontendPort object itself. - */ - public ApplicationGatewayFrontendPort withProvisioningState(String provisioningState) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayFrontendPortPropertiesFormat(); - } - this.innerProperties().withProvisioningState(provisioningState); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayHeaderConfiguration.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayHeaderConfiguration.java deleted file mode 100644 index 3352a2e0e6fa..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayHeaderConfiguration.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Header configuration of the Actions set in Application Gateway. */ -@Fluent -public final class ApplicationGatewayHeaderConfiguration { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayHeaderConfiguration.class); - - /* - * Header name of the header configuration - */ - @JsonProperty(value = "headerName") - private String headerName; - - /* - * Header value of the header configuration - */ - @JsonProperty(value = "headerValue") - private String headerValue; - - /** - * Get the headerName property: Header name of the header configuration. - * - * @return the headerName value. - */ - public String headerName() { - return this.headerName; - } - - /** - * Set the headerName property: Header name of the header configuration. - * - * @param headerName the headerName value to set. - * @return the ApplicationGatewayHeaderConfiguration object itself. - */ - public ApplicationGatewayHeaderConfiguration withHeaderName(String headerName) { - this.headerName = headerName; - return this; - } - - /** - * Get the headerValue property: Header value of the header configuration. - * - * @return the headerValue value. - */ - public String headerValue() { - return this.headerValue; - } - - /** - * Set the headerValue property: Header value of the header configuration. - * - * @param headerValue the headerValue value to set. - * @return the ApplicationGatewayHeaderConfiguration object itself. - */ - public ApplicationGatewayHeaderConfiguration withHeaderValue(String headerValue) { - this.headerValue = headerValue; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayHttpListener.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayHttpListener.java deleted file mode 100644 index c1d8a72e163e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayHttpListener.java +++ /dev/null @@ -1,319 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.ApplicationGatewayHttpListenerPropertiesFormat; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Http listener of an application gateway. */ -@Fluent -public final class ApplicationGatewayHttpListener extends SubResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayHttpListener.class); - - /* - * Properties of HTTP listener of an application gateway. - */ - @JsonProperty(value = "properties") - private ApplicationGatewayHttpListenerPropertiesFormat innerProperties; - - /* - * Name of the HTTP listener that is unique within an Application Gateway. - */ - @JsonProperty(value = "name") - private String name; - - /* - * A unique read-only string that changes whenever the resource is updated. - */ - @JsonProperty(value = "etag") - private String etag; - - /* - * Type of the resource. - */ - @JsonProperty(value = "type") - private String type; - - /** - * Get the innerProperties property: Properties of HTTP listener of an application gateway. - * - * @return the innerProperties value. - */ - private ApplicationGatewayHttpListenerPropertiesFormat innerProperties() { - return this.innerProperties; - } - - /** - * Get the name property: Name of the HTTP listener that is unique within an Application Gateway. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Name of the HTTP listener that is unique within an Application Gateway. - * - * @param name the name value to set. - * @return the ApplicationGatewayHttpListener object itself. - */ - public ApplicationGatewayHttpListener withName(String name) { - this.name = name; - return this; - } - - /** - * Get the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @param etag the etag value to set. - * @return the ApplicationGatewayHttpListener object itself. - */ - public ApplicationGatewayHttpListener withEtag(String etag) { - this.etag = etag; - return this; - } - - /** - * Get the type property: Type of the resource. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Set the type property: Type of the resource. - * - * @param type the type value to set. - * @return the ApplicationGatewayHttpListener object itself. - */ - public ApplicationGatewayHttpListener withType(String type) { - this.type = type; - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicationGatewayHttpListener withId(String id) { - super.withId(id); - return this; - } - - /** - * Get the frontendIpConfiguration property: Frontend IP configuration resource of an application gateway. - * - * @return the frontendIpConfiguration value. - */ - public SubResource frontendIpConfiguration() { - return this.innerProperties() == null ? null : this.innerProperties().frontendIpConfiguration(); - } - - /** - * Set the frontendIpConfiguration property: Frontend IP configuration resource of an application gateway. - * - * @param frontendIpConfiguration the frontendIpConfiguration value to set. - * @return the ApplicationGatewayHttpListener object itself. - */ - public ApplicationGatewayHttpListener withFrontendIpConfiguration(SubResource frontendIpConfiguration) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayHttpListenerPropertiesFormat(); - } - this.innerProperties().withFrontendIpConfiguration(frontendIpConfiguration); - return this; - } - - /** - * Get the frontendPort property: Frontend port resource of an application gateway. - * - * @return the frontendPort value. - */ - public SubResource frontendPort() { - return this.innerProperties() == null ? null : this.innerProperties().frontendPort(); - } - - /** - * Set the frontendPort property: Frontend port resource of an application gateway. - * - * @param frontendPort the frontendPort value to set. - * @return the ApplicationGatewayHttpListener object itself. - */ - public ApplicationGatewayHttpListener withFrontendPort(SubResource frontendPort) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayHttpListenerPropertiesFormat(); - } - this.innerProperties().withFrontendPort(frontendPort); - return this; - } - - /** - * Get the protocol property: Protocol of the HTTP listener. Possible values are 'Http' and 'Https'. - * - * @return the protocol value. - */ - public ApplicationGatewayProtocol protocol() { - return this.innerProperties() == null ? null : this.innerProperties().protocol(); - } - - /** - * Set the protocol property: Protocol of the HTTP listener. Possible values are 'Http' and 'Https'. - * - * @param protocol the protocol value to set. - * @return the ApplicationGatewayHttpListener object itself. - */ - public ApplicationGatewayHttpListener withProtocol(ApplicationGatewayProtocol protocol) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayHttpListenerPropertiesFormat(); - } - this.innerProperties().withProtocol(protocol); - return this; - } - - /** - * Get the hostname property: Host name of HTTP listener. - * - * @return the hostname value. - */ - public String hostname() { - return this.innerProperties() == null ? null : this.innerProperties().hostname(); - } - - /** - * Set the hostname property: Host name of HTTP listener. - * - * @param hostname the hostname value to set. - * @return the ApplicationGatewayHttpListener object itself. - */ - public ApplicationGatewayHttpListener withHostname(String hostname) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayHttpListenerPropertiesFormat(); - } - this.innerProperties().withHostname(hostname); - return this; - } - - /** - * Get the sslCertificate property: SSL certificate resource of an application gateway. - * - * @return the sslCertificate value. - */ - public SubResource sslCertificate() { - return this.innerProperties() == null ? null : this.innerProperties().sslCertificate(); - } - - /** - * Set the sslCertificate property: SSL certificate resource of an application gateway. - * - * @param sslCertificate the sslCertificate value to set. - * @return the ApplicationGatewayHttpListener object itself. - */ - public ApplicationGatewayHttpListener withSslCertificate(SubResource sslCertificate) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayHttpListenerPropertiesFormat(); - } - this.innerProperties().withSslCertificate(sslCertificate); - return this; - } - - /** - * Get the requireServerNameIndication property: Applicable only if protocol is https. Enables SNI for - * multi-hosting. - * - * @return the requireServerNameIndication value. - */ - public Boolean requireServerNameIndication() { - return this.innerProperties() == null ? null : this.innerProperties().requireServerNameIndication(); - } - - /** - * Set the requireServerNameIndication property: Applicable only if protocol is https. Enables SNI for - * multi-hosting. - * - * @param requireServerNameIndication the requireServerNameIndication value to set. - * @return the ApplicationGatewayHttpListener object itself. - */ - public ApplicationGatewayHttpListener withRequireServerNameIndication(Boolean requireServerNameIndication) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayHttpListenerPropertiesFormat(); - } - this.innerProperties().withRequireServerNameIndication(requireServerNameIndication); - return this; - } - - /** - * Get the provisioningState property: Provisioning state of the HTTP listener resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Set the provisioningState property: Provisioning state of the HTTP listener resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param provisioningState the provisioningState value to set. - * @return the ApplicationGatewayHttpListener object itself. - */ - public ApplicationGatewayHttpListener withProvisioningState(String provisioningState) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayHttpListenerPropertiesFormat(); - } - this.innerProperties().withProvisioningState(provisioningState); - return this; - } - - /** - * Get the customErrorConfigurations property: Custom error configurations of the HTTP listener. - * - * @return the customErrorConfigurations value. - */ - public List customErrorConfigurations() { - return this.innerProperties() == null ? null : this.innerProperties().customErrorConfigurations(); - } - - /** - * Set the customErrorConfigurations property: Custom error configurations of the HTTP listener. - * - * @param customErrorConfigurations the customErrorConfigurations value to set. - * @return the ApplicationGatewayHttpListener object itself. - */ - public ApplicationGatewayHttpListener withCustomErrorConfigurations( - List customErrorConfigurations) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayHttpListenerPropertiesFormat(); - } - this.innerProperties().withCustomErrorConfigurations(customErrorConfigurations); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayIpConfiguration.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayIpConfiguration.java deleted file mode 100644 index e43de9eae546..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayIpConfiguration.java +++ /dev/null @@ -1,187 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.network.fluent.models.ApplicationGatewayIpConfigurationInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.ChildResource; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasSubnet; -import com.azure.resourcemanager.resources.fluentcore.model.Attachable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.model.Settable; - -/** A client-side representation of an application gateway IP configuration. */ -@Fluent() -public interface ApplicationGatewayIpConfiguration - extends HasInnerModel, ChildResource { - - /** @return the resource ID of the virtual network the application gateway is in */ - String networkId(); - - /** @return the name of the subnet the application gateway is in */ - String subnetName(); - - /** - * @return the subnet the application gateway is in - *

    Note, this results in a separate call to Azure. - */ - Subnet getSubnet(); - - /** Grouping of application gateway IP configuration definition stages. */ - interface DefinitionStages { - /** - * The first stage of an application gateway IP configuration definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface Blank extends WithSubnet { - } - - /** - * The stage of an application gateway IP configuration definition allowing to specify the subnet the - * application gateway is on. - * - * @param the stage of the application gateway definition to return to after attaching this definition - */ - interface WithSubnet extends HasSubnet.DefinitionStages.WithSubnet> { - /** - * Specifies an existing subnet the application gateway should be part of and get its private IP address - * from. - * - * @param subnet an existing subnet - * @return the next stage of the definition - */ - WithAttach withExistingSubnet(Subnet subnet); - - /** - * Specifies an existing subnet the application gateway should be part of and get its private IP address - * from. - * - * @param network an existing virtual network - * @param subnetName the name of a subnet within the selected network - * @return the next stage of the definition - */ - WithAttach withExistingSubnet(Network network, String subnetName); - } - - /** - * The final stage of the application gateway IP configuration definition. - * - *

    At this stage, any remaining optional settings can be specified, or the definition can be attached to the - * parent application gateway definition. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface WithAttach extends Attachable.InDefinition { - } - } - - /** - * The entirety of an application gateway IP configuration definition. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithSubnet, - DefinitionStages.WithAttach { - } - - /** Grouping of application gateway IP configuration update stages. */ - interface UpdateStages { - /** - * The stage of an application gateway IP configuration update allowing to modify the subnet the application - * gateway is part of. - */ - interface WithSubnet extends HasSubnet.UpdateStages.WithSubnet { - /** - * Specifies an existing subnet the application gateway should be part of and get its private IP address - * from. - * - * @param subnet an existing subnet - * @return the next stage of the update - */ - Update withExistingSubnet(Subnet subnet); - - /** - * Specifies an existing subnet the application gateway should be part of and get its private IP address - * from. - * - * @param network an existing virtual network - * @param subnetName the name of a subnet within the selected network - * @return the next stage of the update - */ - Update withExistingSubnet(Network network, String subnetName); - } - } - - /** The entirety of an application gateway IP configuration update as part of an application gateway update. */ - interface Update extends Settable, UpdateStages.WithSubnet { - } - - /** - * Grouping of application gateway IP configuration definition stages applicable as part of an application gateway - * update. - */ - interface UpdateDefinitionStages { - /** - * The first stage of an application gateway IP configuration definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface Blank extends WithSubnet { - } - - /** - * The stage of an application gateway IP configuration definition allowing to specify the subnet the - * application gateway is on. - * - * @param the parent type - */ - interface WithSubnet extends HasSubnet.UpdateDefinitionStages.WithSubnet> { - /** - * Specifies an existing subnet the application gateway should be part of and get its private IP address - * from. - * - * @param subnet an existing subnet - * @return the next stage of the definition - */ - WithAttach withExistingSubnet(Subnet subnet); - - /** - * Specifies an existing subnet the application gateway should be part of and get its private IP address - * from. - * - * @param network an existing virtual network - * @param subnetName the name of a subnet within the selected network - * @return the next stage of the definition - */ - WithAttach withExistingSubnet(Network network, String subnetName); - } - - /** - * The final stage of an application gateway IP configuration definition. - * - *

    At this stage, any remaining optional settings can be specified, or the definition can be attached to the - * parent application gateway definition. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface WithAttach extends Attachable.InUpdate { - } - } - - /** - * The entirety of an application gateway IP configuration definition as part of an application gateway update. - * - * @param the parent type - */ - interface UpdateDefinition - extends UpdateDefinitionStages.Blank, - UpdateDefinitionStages.WithSubnet, - UpdateDefinitionStages.WithAttach { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayListResult.java deleted file mode 100644 index 7f10f8508de5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayListResult.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.ApplicationGatewayInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Response for ListApplicationGateways API service call. */ -@Fluent -public final class ApplicationGatewayListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayListResult.class); - - /* - * List of an application gateways in a resource group. - */ - @JsonProperty(value = "value") - private List value; - - /* - * URL to get the next set of results. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: List of an application gateways in a resource group. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: List of an application gateways in a resource group. - * - * @param value the value value to set. - * @return the ApplicationGatewayListResult object itself. - */ - public ApplicationGatewayListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: URL to get the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: URL to get the next set of results. - * - * @param nextLink the nextLink value to set. - * @return the ApplicationGatewayListResult object itself. - */ - public ApplicationGatewayListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayListener.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayListener.java deleted file mode 100644 index 43b02fa6c3d0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayListener.java +++ /dev/null @@ -1,478 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.arm.models.ChildResource; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasSubnet; -import com.azure.resourcemanager.resources.fluentcore.model.Attachable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.model.Settable; - -/** A client-side representation of an application gateway's HTTP listener. */ -@Fluent() -public interface ApplicationGatewayListener - extends HasInnerModel, - ChildResource, - HasSslCertificate, - HasPublicIpAddress, - HasProtocol, - HasHostname, - HasServerNameIndication, - HasSubnet { - - /** @return the frontend IP configuration this listener is associated with. */ - ApplicationGatewayFrontend frontend(); - - /** @return the number of the frontend port the listener is listening on */ - int frontendPortNumber(); - - /** @return the name of the frontend port the listener is listening on */ - String frontendPortName(); - - /** Grouping of application gateway HTTP listener configuration stages. */ - interface DefinitionStages { - /** - * The first stage of an application gateway HTTP listener. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface Blank extends WithFrontend { - } - - /** - * The final stage of an application gateway HTTP listener. - * - *

    At this stage, any remaining optional settings can be specified, or the definition can be attached to the - * parent application gateway definition. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface WithAttach - extends Attachable.InDefinition, - WithProtocol, - WithHostname, - WithServerNameIndication { - } - - /** - * The stage of an application gateway frontend listener definition allowing to specify the frontend IP - * configuration to associate the listener with. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface WithFrontend { - /** - * Associates the listener with the application gateway's private (internal) frontend. - * - *

    If the private frontend does not exist yet, it will be created under an auto-generated name and - * associated with the application gateway's subnet. - * - * @return the next stage of the definition - */ - WithFrontendPort withPrivateFrontend(); - - /** - * Associates the listener with the application gateway's public (Internet-facing) frontend. - * - *

    If the public frontend does not exist yet, it will be created under an auto-generated name and - * associated with the application gateway's public IP address. - * - * @return the next stage of the definition - */ - WithFrontendPort withPublicFrontend(); - } - - /** - * The stage of an application gateway frontend listener definition allowing to specify the frontend port to - * associate the listener with. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface WithFrontendPort { - /** - * Enables the listener to listen on the specified existing frontend port. - * - * @param name the name of an existing frontend port - * @return the next stage of the definition - */ - WithAttach withFrontendPort(String name); - - /** - * Enables the listener to listen on the specified frontend port number. - * - *

    If a frontend port for this port number does not yet exist, a new will be created with an - * auto-generated name. - * - * @param portNumber a port number - * @return the next stage of the definition - */ - WithAttach withFrontendPort(int portNumber); - } - - /** - * The stage of an application gateway frontend listener definition allowing to specify the SSL certificate to - * associate with the listener. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface WithSslCertificate - extends HasSslCertificate.DefinitionStages.WithSslCertificate> { - } - - /** - * The stage of an application gateway frontend listener definition allowing to specify the password for the - * private key of the imported SSL certificate. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface WithSslPassword - extends HasSslCertificate.DefinitionStages.WithSslPassword> { - } - - /** - * The stage of an application gateway frontend listener definition allowing to specify the protocol. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface WithProtocol { - /** - * Specifies that the listener is for the HTTP protocol. - * - * @return the next stage of the definition - */ - WithAttach withHttp(); - - /** - * Specifies that the listener is for the HTTPS protocol. - * - * @return the next stage of the definition - */ - WithSslCertificate withHttps(); - } - - /** - * The stage of an application gateway frontend listener definition allowing to specify the hostname of the - * website for which the traffic is received. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface WithHostname extends HasHostname.DefinitionStages.WithHostname> { - } - - /** - * The stage of an application gateway frontend listener definition allowing to require server name indication - * (SNI). - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface WithServerNameIndication - extends HasServerNameIndication.DefinitionStages.WithServerNameIndication> { - } - } - - /** - * The entirety of an application gateway HTTP listener definition. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithAttach, - DefinitionStages.WithFrontend, - DefinitionStages.WithFrontendPort, - DefinitionStages.WithSslCertificate, - DefinitionStages.WithSslPassword, - DefinitionStages.WithHostname { - } - - /** Grouping of application gateway HTTP listener update stages. */ - interface UpdateStages { - /** - * The stage of an application gateway frontend listener update allowing to specify the frontend IP - * configuration to associate the listener with. - */ - interface WithFrontend { - /** - * Associates the listener with the application gateway's private (internal) frontend. - * - *

    If the private frontend does not exist yet, it will be created under an auto-generated name and - * associated with the application gateway's subnet. - * - * @return the next stage of the update - */ - Update withPrivateFrontend(); - - /** - * Associates the listener with the application gateway's public (Internet-facing) frontend. - * - *

    If the public frontend does not exist yet, it will be created under an auto-generated name and - * associated with the application gateway's public IP address. - * - * @return the next stage of the update - */ - Update withPublicFrontend(); - } - - /** - * The stage of an application gateway frontend listener update allowing to specify the frontend port to - * associate the listener with. - */ - interface WithFrontendPort { - /** - * Enables the listener to listen on the specified existing frontend port. - * - * @param name the name of an existing frontend port - * @return the next stage of the definition - */ - Update withFrontendPort(String name); - - /** - * Enables the listener to listen on the specified frontend port number. - * - *

    If a frontend port for this port number does not yet exist, a new will be created with an - * auto-generated name. - * - * @param portNumber a port number - * @return the next stage of the definition - */ - Update withFrontendPort(int portNumber); - } - - /** - * The stage of an application gateway frontend listener update allowing to specify the SSL certificate to - * associate with the listener. - */ - interface WithSslCertificate extends HasSslCertificate.UpdateStages.WithSslCertificate { - } - - /** - * The stage of an application gateway frontend listener update allowing to specify the password for the private - * key of the imported SSL certificate. - */ - interface WithSslPassword extends HasSslCertificate.UpdateStages.WithSslPassword { - } - - /** The stage of an application gateway frontend listener update allowing to specify the protocol. */ - interface WithProtocol { - /** - * Specifies that the listener is for the HTTP protocol. - * - * @return the next stage of the update - */ - Update withHttp(); - - /** - * Specifies that the listener is for the HTTPS protocol. - * - * @return the next stage of the update - */ - WithSslCertificate withHttps(); - } - - /** - * The stage of an application gateway frontend listener update allowing to require server name indication - * (SNI). - */ - interface WithServerNameIndication - extends HasServerNameIndication.UpdateStages.WithServerNameIndication { - } - - /** - * The stage of an application gateway frontend listener update allowing to specify the hostname of the website - * for which the traffic is received. - */ - interface WithHostname extends HasHostname.UpdateStages.WithHostname { - } - } - - /** The entirety of an application gateway HTTP listener update as part of an application gateway update. */ - interface Update - extends Settable, - UpdateStages.WithServerNameIndication, - UpdateStages.WithHostname, - UpdateStages.WithProtocol, - UpdateStages.WithSslCertificate, - UpdateStages.WithSslPassword, - UpdateStages.WithFrontendPort, - UpdateStages.WithFrontend { - } - - /** - * Grouping of application gateway HTTP listener definition stages applicable as part of an application gateway - * update. - */ - interface UpdateDefinitionStages { - /** - * The first stage of an application gateway HTTP listener configuration definition. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface Blank extends WithFrontend { - } - - /** - * The stage of an application gateway frontend listener definition allowing to specify the frontend IP - * configuration to associate the listener with. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface WithFrontend { - /** - * Associates the listener with the application gateway's private (internal) frontend. - * - *

    If the private frontend does not exist yet, it will be created under an auto-generated name and - * associated with the application gateway's subnet. - * - * @return the next stage of the definition - */ - WithFrontendPort withPrivateFrontend(); - - /** - * Associates the listener with the application gateway's public (Internet-facing) frontend. - * - *

    If the public frontend does not exist yet, it will be created under an auto-generated name and - * associated with the application gateway's public IP address. - * - * @return the next stage of the definition - */ - WithFrontendPort withPublicFrontend(); - } - - /** - * The stage of an application gateway frontend listener definition allowing to specify the frontend port to - * associate the listener with. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface WithFrontendPort { - /** - * Enables the listener to listen on the specified existing frontend port. - * - * @param name the name of an existing frontend port - * @return the next stage of the definition - */ - WithAttach withFrontendPort(String name); - - /** - * Enables the listener to listen on the specified frontend port number. - * - *

    If a frontend port for this port number does not yet exist, a new will be created with an - * auto-generated name. - * - * @param portNumber a port number - * @return the next stage of the definition - */ - WithAttach withFrontendPort(int portNumber); - } - - /** - * The stage of an application gateway frontend listener definition allowing to specify the protocol. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface WithProtocol { - /** - * Specifies that the listener is for the HTTP protocol. - * - * @return the next stage of the definition - */ - WithAttach withHttp(); - - /** - * Specifies that the listener is for the HTTPS protocol. - * - * @return the next stage of the definition - */ - WithSslCertificate withHttps(); - } - - /** - * The stage of an application gateway frontend listener definition allowing to specify the SSL certificate to - * associate with the listener. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface WithSslCertificate - extends HasSslCertificate.UpdateDefinitionStages.WithSslCertificate> { - } - - /** - * The stage of an application gateway frontend listener definition allowing to specify the password for the - * private key of the imported SSL certificate. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface WithSslPassword - extends HasSslCertificate.UpdateDefinitionStages.WithSslPassword> { - } - - /** - * The stage of an application gateway frontend listener definition allowing to specify the hostname of the - * website for which the traffic is received. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface WithHostname extends HasHostname.UpdateDefinitionStages.WithHostname> { - } - - /** - * The stage of an application gateway frontend listener definition allowing to require server name indication - * (SNI). - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface WithServerNameIndication - extends HasServerNameIndication.UpdateDefinitionStages.WithServerNameIndication> { - } - - /** - * The final stage of an application gateway HTTP listener definition. - * - *

    At this stage, any remaining optional settings can be specified, or the definition can be attached to the - * parent application gateway definition. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface WithAttach - extends Attachable.InUpdate, - UpdateDefinitionStages.WithServerNameIndication, - UpdateDefinitionStages.WithHostname, - UpdateDefinitionStages.WithProtocol { - } - } - - /** - * The entirety of an application gateway HTTP listener definition as part of an application gateway update. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface UpdateDefinition - extends UpdateDefinitionStages.Blank, - UpdateDefinitionStages.WithFrontend, - UpdateDefinitionStages.WithFrontendPort, - UpdateDefinitionStages.WithAttach, - UpdateDefinitionStages.WithSslCertificate, - UpdateDefinitionStages.WithSslPassword { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayOperationalState.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayOperationalState.java deleted file mode 100644 index cb5ec7b75bec..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayOperationalState.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ApplicationGatewayOperationalState. */ -public final class ApplicationGatewayOperationalState extends ExpandableStringEnum { - /** Static value Stopped for ApplicationGatewayOperationalState. */ - public static final ApplicationGatewayOperationalState STOPPED = fromString("Stopped"); - - /** Static value Starting for ApplicationGatewayOperationalState. */ - public static final ApplicationGatewayOperationalState STARTING = fromString("Starting"); - - /** Static value Running for ApplicationGatewayOperationalState. */ - public static final ApplicationGatewayOperationalState RUNNING = fromString("Running"); - - /** Static value Stopping for ApplicationGatewayOperationalState. */ - public static final ApplicationGatewayOperationalState STOPPING = fromString("Stopping"); - - /** - * Creates or finds a ApplicationGatewayOperationalState from its string representation. - * - * @param name a name to look for. - * @return the corresponding ApplicationGatewayOperationalState. - */ - @JsonCreator - public static ApplicationGatewayOperationalState fromString(String name) { - return fromString(name, ApplicationGatewayOperationalState.class); - } - - /** @return known ApplicationGatewayOperationalState values. */ - public static Collection values() { - return values(ApplicationGatewayOperationalState.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayPathRule.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayPathRule.java deleted file mode 100644 index be8afe6a91bf..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayPathRule.java +++ /dev/null @@ -1,260 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.network.fluent.models.ApplicationGatewayPathRuleInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.ChildResource; -import com.azure.resourcemanager.resources.fluentcore.model.Attachable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.model.Settable; -import java.util.List; - -/** A client-side representation of an application gateway's URL path map. */ -@Fluent -public interface ApplicationGatewayPathRule - extends HasInnerModel, ChildResource { - - /** @return backend address pool resource of URL path map path rule */ - ApplicationGatewayBackend backend(); - - /** @return backend http settings resource of URL path map path rule */ - ApplicationGatewayBackendHttpConfiguration backendHttpConfiguration(); - - /** @return redirect configuration resource of URL path map path rule */ - ApplicationGatewayRedirectConfiguration redirectConfiguration(); - - /** @return paths for URL path map rule. */ - List paths(); - - /** Grouping of application gateway URL path map definition stages. */ - interface DefinitionStages { - /** - * The first stage of an application gateway URL path map definition. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface Blank extends WithBackendHttpConfiguration { - } - - /** - * The stage of an application gateway path rule definition allowing to specify the the paths to associate with - * path rule. - * - * @param the stage of the application gateway URL path map definition to return to after attaching - * this definition - */ - interface WithPath { - /** - * @param path for the path rule - * @return the next stage of the definition - */ - WithAttach withPath(String path); - - /** - * @param paths for the path rule - * @return the next stage of the definition - */ - WithAttach withPaths(String... paths); - } - - /** - * The stage of an application gateway request routing rule definition allowing to specify the backend HTTP - * settings configuration to associate the routing rule with. - * - * @param the stage of the application gateway definition to return to after attaching this definition - */ - interface WithBackendHttpConfiguration { - /** - * Associates the specified backend HTTP settings configuration with this path rule. - * - *

    If the backend configuration does not exist yet, it must be defined in the optional part of the - * application gateway definition. The request routing rule references it only by name. - * - * @param name the name of a backend HTTP settings configuration - * @return the next stage of the definition - */ - WithBackend toBackendHttpConfiguration(String name); - } - - /** - * The stage of an application gateway request routing rule definition allowing to specify the backend to - * associate the routing rule with. - * - * @param the stage of the application gateway definition to return to after attaching this definition - */ - interface WithBackend { - /** - * Associates the path rule with a backend on this application gateway. - * - *

    If the backend does not yet exist, it will be automatically created. - * - * @param name the name of an existing backend - * @return the next stage of the definition - */ - WithPath toBackend(String name); - } - - /** - * The stage of path rule of URL path map definition allowing to associate the rule with a redirect - * configuration. - * - * @param the stage of the application gateway URL path map definition to return to after attaching - * this definition - */ - interface WithRedirectConfig { - /** - * Associates the specified redirect configuration with this path rule. - * - * @param name the name of a redirect configuration on this application gateway - * @return the next stage of the definition - */ - WithAttach withRedirectConfiguration(String name); - } - - /** - * The final stage of a path rule of URL path map definition. - * - *

    At this stage, any remaining optional settings can be specified, or the definition can be attached to the - * parent application gateway definition. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface WithAttach - extends Attachable.InDefinition, WithPath, WithRedirectConfig { - } - } - - /** - * The entirety of a path rule of URL path map definition. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithBackendHttpConfiguration, - DefinitionStages.WithBackend, - DefinitionStages.WithAttach { - } - - /** The entirety of path rule of URL path map update as part of an application gateway update. */ - interface Update extends Settable { - } - - /** Grouping of path rule of URL path map definition stages applicable as part of an application gateway update. */ - interface UpdateDefinitionStages { - /** - * The first stage of path rule of URL path map definition. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface Blank extends WithBackendHttpConfiguration { - } - - /** - * The stage of path rule of URL path map allowing to specify the backend HTTP settings configuration to - * associate the path rule with. - * - * @param the stage of the application gateway definition to return to after attaching this definition - */ - interface WithBackendHttpConfiguration { - /** - * Associates the specified backend HTTP settings configuration with this path rule. - * - *

    If the backend configuration does not exist yet, it must be defined in the optional part of the - * application gateway definition. The path rule references it only by name. - * - * @param name the name of a backend HTTP settings configuration - * @return the next stage of the definition - */ - WithBackend toBackendHttpConfiguration(String name); - } - - /** - * The stage of an application gateway path rule definition allowing to specify the backend to associate with - * path rule. - * - * @param the stage of the application gateway URL path map definition to return to after attaching - * this definition - */ - interface WithBackend { - /** - * Associates the path rule with a backend on this application gateway. - * - *

    If the backend does not yet exist, it will be automatically created. - * - * @param name the name of an existing backend - * @return the next stage of the definition - */ - WithPath toBackend(String name); - } - - /** - * The stage of an application gateway path rule definition allowing to specify the the paths to associate with - * path rule. - * - * @param the stage of the application gateway URL path map definition to return to after attaching - * this definition - */ - interface WithPath { - /** - * @param path for the path rule - * @return the next stage of the definition - */ - WithAttach withPath(String path); - - /** - * @param paths for the path rule - * @return the next stage of the definition - */ - WithAttach withPaths(String... paths); - } - - /** - * The stage of path rule of URL path map definition allowing to associate the rule with a redirect - * configuration. - * - * @param the stage of the application gateway definition to return to after attaching this definition - */ - interface WithRedirectConfig { - /** - * Associates the specified redirect configuration with this path rule. - * - * @param name the name of a redirect configuration on this application gateway - * @return the next stage of the definition - */ - WithAttach withRedirectConfiguration(String name); - } - - /** - * The final stage of path rule of URL path map definition. - * - *

    At this stage, any remaining optional settings can be specified, or the definition can be attached to the - * parent application gateway definition. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface WithAttach - extends Attachable.InUpdate, UpdateDefinitionStages.WithRedirectConfig { - } - } - - /** - * The entirety of path rule of URL path map definition as part of an application gateway update. - * - * @param the stage of the parent application gateway URL path map definition to return to after attaching - * this definition - */ - interface UpdateDefinition - extends UpdateDefinitionStages.Blank, - UpdateDefinitionStages.WithBackendHttpConfiguration, - UpdateDefinitionStages.WithBackend, - UpdateDefinitionStages.WithPath, - UpdateDefinitionStages.WithAttach { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayProbe.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayProbe.java deleted file mode 100644 index dfda6843a254..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayProbe.java +++ /dev/null @@ -1,619 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.network.fluent.models.ApplicationGatewayProbeInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.ChildResource; -import com.azure.resourcemanager.resources.fluentcore.model.Attachable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.model.Settable; -import java.util.Set; - -/** A client-side representation of an application gateway probe. */ -@Fluent() -public interface ApplicationGatewayProbe - extends HasInnerModel, - ChildResource, - HasProtocol { - - /** @return the number of seconds between probe retries */ - int timeBetweenProbesInSeconds(); - - /** - * @return HTTP response code ranges in the format ###-### returned by the backend which the probe considers - * healthy. - */ - Set healthyHttpResponseStatusCodeRanges(); - - /** - * @return the body contents of an HTTP response to a probe to check for to determine backend health, or null if - * none specified - */ - String healthyHttpResponseBodyContents(); - - /** @return the relative path to be called by the probe */ - String path(); - - /** - * @return the number of seconds waiting for a response after which the probe times out and it is marked as failed - *

    Acceptable values are from 1 to 86400 seconds. - */ - int timeoutInSeconds(); - - /** - * @return the number of failed retry probes before the backend server is marked as being down - *

    Acceptable values are from 1 second to 20. - */ - int retriesBeforeUnhealthy(); - - /** @return host name to send the probe to */ - String host(); - - /** Grouping of application gateway probe definition stages. */ - interface DefinitionStages { - /** - * The first stage of an application gateway probe definition. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface Blank extends WithHost { - } - - /** - * Stage of an application gateway probe definition allowing to specify the host to send the probe to. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface WithHost { - /** - * Specifies the host name to send the probe to. - * - * @param host a host name - * @return the next stage of the definition - */ - WithPath withHost(String host); - } - - /** - * Stage of an application gateway probe definition allowing to specify the relative path to send the probe to. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface WithPath { - /** - * Specifies the relative path for the probe to call. - * - *

    A probe is sent to <protocol>://<host>:<port><path>. - * - * @param path a relative path - * @return the next stage of the definition - */ - WithProtocol withPath(String path); - } - - /** - * Stage of an application gateway probe update allowing to specify the protocol of the probe. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface WithProtocol - extends HasProtocol.DefinitionStages.WithProtocol, ApplicationGatewayProtocol> { - /** - * Specifies HTTP as the probe protocol. - * - * @return the next stage of the definition - */ - WithTimeout withHttp(); - - /** - * Specifies HTTPS as the probe protocol. - * - * @return the next stage of the definition - */ - WithTimeout withHttps(); - } - - /** - * Stage of an application gateway probe definition allowing to specify the amount of time to after which the - * probe is considered failed. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface WithTimeout { - /** - * Specifies the amount of time in seconds waiting for a response before the probe is considered failed. - * - * @param seconds a number of seconds, between 1 and 86400 - * @return the next stage of the definition - */ - WithAttach withTimeoutInSeconds(int seconds); - } - - /** - * Stage of an application gateway probe definition allowing to specify the time interval between consecutive - * probes. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface WithInterval { - /** - * Specifies the time interval in seconds between consecutive probes. - * - * @param seconds a number of seconds between 1 and 86400 - * @return the next stage of the definition - */ - WithAttach withTimeBetweenProbesInSeconds(int seconds); - } - - /** - * Stage of an application gateway probe definition allowing to specify the number of retries before the server - * is considered unhealthy. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface WithRetries { - /** - * Specifies the number of retries before the server is considered unhealthy. - * - * @param retryCount a number between 1 and 20 - * @return the next stage of the definition - */ - WithAttach withRetriesBeforeUnhealthy(int retryCount); - } - - /** - * The stage of an application gateway probe definition allowing to specify healthy HTTP response status code - * ranges. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface WithHealthyHttpResponseStatusCodeRanges { - /** - * Specifies the ranges of the backend's HTTP response status codes that are to be considered healthy. - * - * @param ranges number ranges expressed in the format "###-###", for example "200-399", which is the - * default - * @return the next stage of the definition - */ - WithAttach withHealthyHttpResponseStatusCodeRanges(Set ranges); - - /** - * Adds the specified range of the backend's HTTP response status codes that are to be considered healthy. - * - * @param range a number range expressed in the format "###-###", for example "200-399", which is the - * default - * @return the next stage of the definition - */ - WithAttach withHealthyHttpResponseStatusCodeRange(String range); - - /** - * Adds the specified range of the backend's HTTP response status codes that are to be considered healthy. - * - * @param from the lowest number in the range - * @param to the highest number in the range - * @return the next stage of the definition - */ - WithAttach withHealthyHttpResponseStatusCodeRange(int from, int to); - } - - /** - * The stage of an application gateway probe definition allowing to specify the body contents of a healthy HTTP - * response to a probe. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface WithHealthyHttpResponseBodyContents { - /** - * Specifies the content, if any, to look for in the body of an HTTP response to a probe to determine the - * health status of the backend. - * - * @param text contents to look for - * @return the next stage of the definition - */ - WithAttach withHealthyHttpResponseBodyContents(String text); - } - - /** - * The final stage of an application gateway probe definition. - * - *

    At this stage, any remaining optional settings can be specified, or the probe definition can be attached - * to the parent application gateway definition. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface WithAttach - extends Attachable.InDefinitionAlt, - WithInterval, - WithRetries, - WithHealthyHttpResponseStatusCodeRanges, - WithHealthyHttpResponseBodyContents { - } - } - - /** - * The entirety of an application gateway probe definition. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithAttach, - DefinitionStages.WithProtocol, - DefinitionStages.WithPath, - DefinitionStages.WithHost, - DefinitionStages.WithTimeout { - } - - /** Grouping of application gateway probe update stages. */ - interface UpdateStages { - /** Stage of an application gateway probe update allowing to specify the host to send the probe to. */ - interface WithHost { - /** - * Specifies the host name to send the probe to. - * - * @param host a host name - * @return the next stage of the update - */ - Update withHost(String host); - } - - /** Stage of an application gateway probe update allowing to specify the protocol of the probe. */ - interface WithProtocol extends HasProtocol.UpdateStages.WithProtocol { - /** - * Specifies HTTP as the probe protocol. - * - * @return the next stage of the update - */ - Update withHttp(); - - /** - * Specifies HTTPS as the probe protocol. - * - * @return the next stage of the update - */ - Update withHttps(); - } - - /** Stage of an application gateway probe update allowing to specify the path to send the probe to. */ - interface WithPath { - /** - * Specifies the relative path for the probe to call. - * - *

    A probe is sent to <protocol>://<host>:<port><path>. - * - * @param path a relative path - * @return the next stage of the update - */ - Update withPath(String path); - } - - /** - * Stage of an application gateway probe update allowing to specify the amount of time to after which the probe - * is considered failed. - */ - interface WithTimeout { - /** - * Specifies the amount of time in seconds waiting for a response before the probe is considered failed. - * - * @param seconds a number of seconds between 1 and 86400 - * @return the next stage of the update - */ - Update withTimeoutInSeconds(int seconds); - } - - /** - * Stage of an application gateway probe update allowing to specify the time interval between consecutive - * probes. - */ - interface WithInterval { - /** - * Specifies the time interval in seconds between consecutive probes. - * - * @param seconds a number of seconds between 1 and 86400 - * @return the next stage of the update - */ - Update withTimeBetweenProbesInSeconds(int seconds); - } - - /** - * Stage of an application gateway probe update allowing to specify the number of retries before the server is - * considered unhealthy. - */ - interface WithRetries { - /** - * Specifies the number of retries before the server is considered unhealthy. - * - * @param retryCount a number between 1 and 20 - * @return the next stage of the update - */ - Update withRetriesBeforeUnhealthy(int retryCount); - } - - /** - * The stage of an application gateway probe update allowing to specify healthy HTTP response status code - * ranges. - */ - interface WithHealthyHttpResponseStatusCodeRanges { - /** - * Specifies the ranges of the backend's HTTP response status codes that are to be considered healthy. - * - * @param ranges number ranges expressed in the format "###-###", for example "200-399", which is the - * default - * @return the next stage of the update - */ - Update withHealthyHttpResponseStatusCodeRanges(Set ranges); - - /** - * Adds the specified range of the backend's HTTP response status codes that are to be considered healthy. - * - * @param range a number range expressed in the format "###-###", for example "200-399", which is the - * default - * @return the next stage of the update - */ - Update withHealthyHttpResponseStatusCodeRange(String range); - - /** - * Adds the specified range of the backend's HTTP response status codes that are to be considered healthy. - * - * @param from the lowest number in the range - * @param to the highest number in the range - * @return the next stage of the update - */ - Update withHealthyHttpResponseStatusCodeRange(int from, int to); - - /** - * Removes all healthy HTTP status response code ranges. - * - * @return the next stage of the update - */ - Update withoutHealthyHttpResponseStatusCodeRanges(); - } - - /** - * The stage of an application gateway probe update allowing to specify the body contents of a healthy HTTP - * response to a probe. - */ - interface WithHealthyHttpResponseBodyContents { - /** - * Specifies the content, if any, to look for in the body of an HTTP response to a probe to determine the - * health status of the backend. - * - * @param text contents to look for - * @return the next stage of the definition - */ - Update withHealthyHttpResponseBodyContents(String text); - } - } - - /** The entirety of an application gateway probe update as part of an application gateway update. */ - interface Update - extends Settable, - UpdateStages.WithProtocol, - UpdateStages.WithPath, - UpdateStages.WithHost, - UpdateStages.WithTimeout, - UpdateStages.WithInterval, - UpdateStages.WithRetries, - UpdateStages.WithHealthyHttpResponseStatusCodeRanges, - UpdateStages.WithHealthyHttpResponseBodyContents { - } - - /** Grouping of application gateway probe definition stages applicable as part of an application gateway update. */ - interface UpdateDefinitionStages { - /** - * The first stage of an application gateway probe definition. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface Blank extends WithHost { - } - - /** - * Stage of an application gateway probe definition allowing to specify the host to send the probe to. - * - * @param the stage of the parent application gateway update to return to after attaching this - * definition - */ - interface WithHost { - /** - * Specifies the host name to send the probe to. - * - * @param host a host name - * @return the next stage of the definition - */ - WithPath withHost(String host); - } - - /** - * Stage of an application gateway probe definition allowing to specify the protocol of the probe. - * - * @param the stage of the parent application gateway update to return to after attaching this - * definition - */ - interface WithProtocol - extends HasProtocol.UpdateDefinitionStages.WithProtocol, ApplicationGatewayProtocol> { - /** - * Specifies HTTP as the probe protocol. - * - * @return the next stage of the definition - */ - WithTimeout withHttp(); - - /** - * Specifies HTTPS as the probe protocol. - * - * @return the next stage of the definition - */ - WithTimeout withHttps(); - } - - /** - * Stage of an application gateway probe definition allowing to specify the amount of time to after which the - * probe is considered failed. - * - * @param the stage of the parent application gateway update to return to after attaching this - * definition - */ - interface WithTimeout { - /** - * Specifies the amount of time in seconds waiting for a response before the probe is considered failed. - * - * @param seconds a number of seconds between 1 and 86400 - * @return the next stage of the definition - */ - WithAttach withTimeoutInSeconds(int seconds); - } - - /** - * Stage of an application gateway probe definition allowing to specify the path to send the probe to. - * - * @param the stage of the parent application gateway update to return to after attaching this - * definition - */ - interface WithPath { - /** - * Specifies the relative path for the probe to call. - * - *

    A probe is sent to <protocol>://<host>:<port><path>. - * - * @param path a relative path - * @return the next stage of the definition - */ - WithProtocol withPath(String path); - } - - /** - * Stage of an application gateway probe definition allowing to specify the time interval between consecutive - * probes. - * - * @param the stage of the parent application gateway update to return to after attaching this - * definition - */ - interface WithInterval { - /** - * Specifies the time interval in seconds between consecutive probes. - * - * @param seconds a number of seconds between 1 and 86400 - * @return the next stage of the definition - */ - WithAttach withTimeBetweenProbesInSeconds(int seconds); - } - - /** - * Stage of an application gateway probe definition allowing to specify the number of retries before the server - * is considered unhealthy. - * - * @param the stage of the parent application gateway update to return to after attaching this - * definition - */ - interface WithRetries { - /** - * Specifies the number of retries before the server is considered unhealthy. - * - * @param retryCount a number between 1 and 20 - * @return the next stage of the definition - */ - WithAttach withRetriesBeforeUnhealthy(int retryCount); - } - - /** - * The stage of an application gateway probe definition allowing to specify healthy HTTP response status code - * ranges. - * - * @param the stage of the parent application gateway update to return to after attaching this - * definition - */ - interface WithHealthyHttpResponseStatusCodeRanges { - /** - * Specifies the ranges of the backend's HTTP response status codes that are to be considered healthy. - * - * @param ranges number ranges expressed in the format "###-###", for example "200-399", which is the - * default - * @return the next stage of the definition - */ - WithAttach withHealthyHttpResponseStatusCodeRanges(Set ranges); - - /** - * Adds the specified range of the backend's HTTP response status codes that are to be considered healthy. - * - * @param range a number range expressed in the format "###-###", for example "200-399", which is the - * default - * @return the next stage of the definition - */ - WithAttach withHealthyHttpResponseStatusCodeRange(String range); - - /** - * Adds the specified range of the backend's HTTP response status codes that are to be considered healthy. - * - * @param from the lowest number in the range - * @param to the highest number in the range - * @return the next stage of the definition - */ - WithAttach withHealthyHttpResponseStatusCodeRange(int from, int to); - } - - /** - * The stage of an application gateway probe definition allowing to specify the body contents of a healthy HTTP - * response to a probe. - * - * @param the stage of the parent application gateway update to return to after attaching this - * definition - */ - interface WithHealthyHttpResponseBodyContents { - /** - * Specifies the content, if any, to look for in the body of an HTTP response to a probe to determine the - * health status of the backend. - * - * @param text contents to look for - * @return the next stage of the definition - */ - WithAttach withHealthyHttpResponseBodyContents(String text); - } - - /** - * The final stage of an application gateway probe definition. - * - *

    At this stage, any remaining optional settings can be specified, or the probe definition can be attached - * to the parent application gateway definition. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface WithAttach - extends Attachable.InUpdateAlt, - WithInterval, - WithRetries, - WithHealthyHttpResponseStatusCodeRanges, - WithHealthyHttpResponseBodyContents { - } - } - - /** - * The entirety of an application gateway probe definition as part of an application gateway update. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface UpdateDefinition - extends UpdateDefinitionStages.Blank, - UpdateDefinitionStages.WithAttach, - UpdateDefinitionStages.WithProtocol, - UpdateDefinitionStages.WithPath, - UpdateDefinitionStages.WithHost, - UpdateDefinitionStages.WithTimeout, - UpdateDefinitionStages.WithInterval { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayProbeHealthResponseMatch.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayProbeHealthResponseMatch.java deleted file mode 100644 index 776d0e0c0d78..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayProbeHealthResponseMatch.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Application gateway probe health response match. */ -@Fluent -public final class ApplicationGatewayProbeHealthResponseMatch { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayProbeHealthResponseMatch.class); - - /* - * Body that must be contained in the health response. Default value is - * empty. - */ - @JsonProperty(value = "body") - private String body; - - /* - * Allowed ranges of healthy status codes. Default range of healthy status - * codes is 200-399. - */ - @JsonProperty(value = "statusCodes") - private List statusCodes; - - /** - * Get the body property: Body that must be contained in the health response. Default value is empty. - * - * @return the body value. - */ - public String body() { - return this.body; - } - - /** - * Set the body property: Body that must be contained in the health response. Default value is empty. - * - * @param body the body value to set. - * @return the ApplicationGatewayProbeHealthResponseMatch object itself. - */ - public ApplicationGatewayProbeHealthResponseMatch withBody(String body) { - this.body = body; - return this; - } - - /** - * Get the statusCodes property: Allowed ranges of healthy status codes. Default range of healthy status codes is - * 200-399. - * - * @return the statusCodes value. - */ - public List statusCodes() { - return this.statusCodes; - } - - /** - * Set the statusCodes property: Allowed ranges of healthy status codes. Default range of healthy status codes is - * 200-399. - * - * @param statusCodes the statusCodes value to set. - * @return the ApplicationGatewayProbeHealthResponseMatch object itself. - */ - public ApplicationGatewayProbeHealthResponseMatch withStatusCodes(List statusCodes) { - this.statusCodes = statusCodes; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayProtocol.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayProtocol.java deleted file mode 100644 index 467aaa1ca424..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayProtocol.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ApplicationGatewayProtocol. */ -public final class ApplicationGatewayProtocol extends ExpandableStringEnum { - /** Static value Http for ApplicationGatewayProtocol. */ - public static final ApplicationGatewayProtocol HTTP = fromString("Http"); - - /** Static value Https for ApplicationGatewayProtocol. */ - public static final ApplicationGatewayProtocol HTTPS = fromString("Https"); - - /** - * Creates or finds a ApplicationGatewayProtocol from its string representation. - * - * @param name a name to look for. - * @return the corresponding ApplicationGatewayProtocol. - */ - @JsonCreator - public static ApplicationGatewayProtocol fromString(String name) { - return fromString(name, ApplicationGatewayProtocol.class); - } - - /** @return known ApplicationGatewayProtocol values. */ - public static Collection values() { - return values(ApplicationGatewayProtocol.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayRedirectConfiguration.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayRedirectConfiguration.java deleted file mode 100644 index 0433236b0aa3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayRedirectConfiguration.java +++ /dev/null @@ -1,390 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.network.fluent.models.ApplicationGatewayRedirectConfigurationInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.ChildResource; -import com.azure.resourcemanager.resources.fluentcore.model.Attachable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.model.Settable; -import java.util.Map; - -/** A client-side representation of an application gateway's redirect configuration. */ -@Fluent() -public interface ApplicationGatewayRedirectConfiguration - extends HasInnerModel, ChildResource { - - /** @return the type of redirection. */ - ApplicationGatewayRedirectType type(); - - /** @return the target listener on this application network traffic is redirected to */ - ApplicationGatewayListener targetListener(); - - /** @return the target URL network traffic is redirected to */ - String targetUrl(); - - /** @return request routing rules on this application referencing this redirect configuration, indexed by name */ - Map requestRoutingRules(); - - /** @return true if the path is included in the redirected URL, otherwise false */ - boolean isPathIncluded(); - - /** @return true if the query string is included in the redirected URL, otherwise false */ - boolean isQueryStringIncluded(); - - /** Grouping of application gateway redirect configuration configuration stages. */ - interface DefinitionStages { - /** - * The first stage of an application gateway redirect configuration. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface Blank extends WithType { - } - - /** - * The stage of an application gateway redirect configuration allowing to specify the target URL or listener for - * the redirection. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface WithTarget { - /** - * Specifies the URL to redirect to. - * - * @param url a URL - * @return the next stage of the definition - */ - WithAttach withTargetUrl(String url); - - /** - * Specifies the listener on this application gateway to redirect to. - * - * @param name the name of a listener on this application gateway - * @return the next stage of the definition - */ - WithAttachAndPath withTargetListener(String name); - } - - /** - * The stage of an application gateway redirect configuration allowing to specify the type of the redirection. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface WithType { - /** - * Specifies the redirection type. - * - * @param redirectType a redirection type - * @return the next stage of the definition - */ - WithTarget withType(ApplicationGatewayRedirectType redirectType); - } - - /** - * The stage of an application gateway redirect configuration allowing to specify whether the path should be - * included in the redirected URL. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface WithPathIncluded { - /** - * Specifies that the path should be included in the redirected URL. - * - *

    Note that this setting is valid only when the target of the redirection is a listener, not a URL. - * - * @return the next stage of the definition - */ - WithAttach withPathIncluded(); - } - - /** - * The stage of an application gateway redirect configuration allowing to specify whether the query string - * should be included in the redirected URL. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface WithQueryStringIncluded { - /** - * Specifies that the query string should be included in the redirected URL. - * - * @return the next stage of the definition - */ - WithAttach withQueryStringIncluded(); - } - - /** - * The stage of an application gateway redirect configuration allowing to specify whether the query string - * should be included in the redirected URL or other optional settings. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface WithAttachAndPath extends WithAttach, WithPathIncluded { - } - - /** - * The final stage of an application gateway redirect configuration. - * - *

    At this stage, any remaining optional settings can be specified, or the definition can be attached to the - * parent application gateway definition. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface WithAttach extends Attachable.InDefinition, WithQueryStringIncluded { - } - } - - /** - * The entirety of an application gateway redirect configuration definition. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithAttach, - DefinitionStages.WithAttachAndPath, - DefinitionStages.WithTarget, - DefinitionStages.WithType { - } - - /** Grouping of application gateway redirect configuration update stages. */ - interface UpdateStages { - /** - * The stage of an application gateway redirect configuration allowing to specify the target URL or listener for - * the redirection. - */ - interface WithTarget { - /** - * Specifies the URL to redirect to. - * - * @param url a URL - * @return the next stage of the update - */ - Update withTargetUrl(String url); - - /** - * Specifies the listener on this application gateway to redirect to. - * - * @param name the name of a listener on this application gateway - * @return the next stage of the update - */ - Update withTargetListener(String name); - - /** - * Removes the reference to the target listener. - * - * @return the next stage of the update - */ - Update withoutTargetListener(); - - /** - * Removes the reference to the target URL. - * - * @return the next stage of the update - */ - Update withoutTargetUrl(); - } - - /** - * The stage of an application gateway redirect configuration allowing to specify the type of the redirection. - */ - interface WithType { - /** - * Specifies the redirection type. - * - * @param redirectType a redirection type - * @return the next stage of the update - */ - Update withType(ApplicationGatewayRedirectType redirectType); - } - - /** - * The stage of an application gateway redirect configuration allowing to specify whether the path should be - * included in the redirected URL. - */ - interface WithPathIncluded { - /** - * Specifies that the path should be included in the redirected URL. - * - *

    Note that this setting is valid only when the target of the redirection is a listener, not a URL. - * - * @return the next stage of the update - */ - Update withPathIncluded(); - - /** - * Specifies that the path should not be included in the redirected URL. - * - * @return the next stage of the update - */ - Update withoutPathIncluded(); - } - - /** - * The stage of an application gateway redirect configuration allowing to specify whether the query string - * should be included in the redirected URL. - */ - interface WithQueryStringIncluded { - /** - * Specifies that the query string should be included in the redirected URL. - * - * @return the next stage of the update - */ - Update withQueryStringIncluded(); - - /** - * Specifies that the query string should not be included in the redirected URL. - * - * @return the next stage of the update - */ - Update withoutQueryStringIncluded(); - } - } - - /** - * The entirety of an application gateway redirect configuration update as part of an application gateway update. - */ - interface Update - extends Settable, - UpdateStages.WithTarget, - UpdateStages.WithType, - UpdateStages.WithPathIncluded, - UpdateStages.WithQueryStringIncluded { - } - - /** - * Grouping of application gateway redirect configuration definition stages applicable as part of an application - * gateway update. - */ - interface UpdateDefinitionStages { - /** - * The first stage of an application gateway redirect configuration configuration definition. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface Blank extends WithType { - } - - /** - * The stage of an application gateway redirect configuration allowing to specify the target URL or listener for - * the redirection. - * - * @param the stage of the parent application gateway update to return to after attaching this - * definition - */ - interface WithTarget { - /** - * Specifies the URL to redirect to. - * - * @param url a URL - * @return the next stage of the definition - */ - WithAttach withTargetUrl(String url); - - /** - * Specifies the listener on this application gateway to redirect to. - * - * @param name the name of a listener on this application gateway - * @return the next stage of the definition - */ - WithAttachAndPath withTargetListener(String name); - } - - /** - * The stage of an application gateway redirect configuration allowing to specify the type of the redirection. - * - * @param the stage of the parent application gateway update to return to after attaching this - * definition - */ - interface WithType { - /** - * Specifies the redirection type. - * - * @param redirectType a redirection type - * @return the next stage of the definition - */ - WithTarget withType(ApplicationGatewayRedirectType redirectType); - } - - /** - * The stage of an application gateway redirect configuration allowing to specify whether the path should be - * included in the redirected URL. - * - * @param the stage of the parent application gateway update to return to after attaching this - * definition - */ - interface WithPathIncluded { - /** - * Specifies that the path should be included in the redirected URL. - * - *

    Note that this setting is valid only when the target of the redirection is a listener, not a URL. - * - * @return the next stage of the definition - */ - WithAttach withPathIncluded(); - } - - /** - * The stage of an application gateway redirect configuration allowing to specify whether the query string - * should be included in the redirected URL. - * - * @param the stage of the parent application gateway update to return to after attaching this - * definition - */ - interface WithQueryStringIncluded { - /** - * Specifies that the query string should be included in the redirected URL. - * - * @return the next stage of the definition - */ - WithAttach withQueryStringIncluded(); - } - - /** - * The stage of an application gateway redirect configuration allowing to specify whether the query string - * should be included in the redirected URL or other optional settings. - * - * @param the stage of the parent application gateway update to return to after attaching this - * definition - */ - interface WithAttachAndPath extends WithAttach, WithPathIncluded { - } - - /** - * The final stage of an application gateway redirect configuration definition. - * - *

    At this stage, any remaining optional settings can be specified, or the definition can be attached to the - * parent application gateway definition. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface WithAttach extends Attachable.InUpdate, WithQueryStringIncluded { - } - } - - /** - * The entirety of an application gateway redirect configuration definition as part of an application gateway - * update. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface UpdateDefinition - extends UpdateDefinitionStages.Blank, - UpdateDefinitionStages.WithAttach, - UpdateDefinitionStages.WithAttachAndPath, - UpdateDefinitionStages.WithTarget, - UpdateDefinitionStages.WithType { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayRedirectType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayRedirectType.java deleted file mode 100644 index 98ccfdebf1e5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayRedirectType.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ApplicationGatewayRedirectType. */ -public final class ApplicationGatewayRedirectType extends ExpandableStringEnum { - /** Static value Permanent for ApplicationGatewayRedirectType. */ - public static final ApplicationGatewayRedirectType PERMANENT = fromString("Permanent"); - - /** Static value Found for ApplicationGatewayRedirectType. */ - public static final ApplicationGatewayRedirectType FOUND = fromString("Found"); - - /** Static value SeeOther for ApplicationGatewayRedirectType. */ - public static final ApplicationGatewayRedirectType SEE_OTHER = fromString("SeeOther"); - - /** Static value Temporary for ApplicationGatewayRedirectType. */ - public static final ApplicationGatewayRedirectType TEMPORARY = fromString("Temporary"); - - /** - * Creates or finds a ApplicationGatewayRedirectType from its string representation. - * - * @param name a name to look for. - * @return the corresponding ApplicationGatewayRedirectType. - */ - @JsonCreator - public static ApplicationGatewayRedirectType fromString(String name) { - return fromString(name, ApplicationGatewayRedirectType.class); - } - - /** @return known ApplicationGatewayRedirectType values. */ - public static Collection values() { - return values(ApplicationGatewayRedirectType.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayRequestRoutingRule.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayRequestRoutingRule.java deleted file mode 100644 index cc091442c35c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayRequestRoutingRule.java +++ /dev/null @@ -1,869 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.network.fluent.models.ApplicationGatewayRequestRoutingRuleInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.ChildResource; -import com.azure.resourcemanager.resources.fluentcore.model.Attachable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.model.Settable; - -import java.util.Collection; - -/** A client-side representation of an application gateway request routing rule. */ -@Fluent() -public interface ApplicationGatewayRequestRoutingRule - extends HasInnerModel, - ChildResource, - HasPublicIpAddress, - HasSslCertificate, - HasFrontendPort, - HasBackendPort, - HasHostname, - HasCookieBasedAffinity, - HasServerNameIndication { - - /** @return the redirect configuration associated with this request routing rule, if any */ - ApplicationGatewayRedirectConfiguration redirectConfiguration(); - - /** @return the frontend protocol */ - ApplicationGatewayProtocol frontendProtocol(); - - /** @return rule type */ - ApplicationGatewayRequestRoutingRuleType ruleType(); - - /** @return the associated backend address pool */ - ApplicationGatewayBackend backend(); - - /** @return the associated backend HTTP settings configuration */ - ApplicationGatewayBackendHttpConfiguration backendHttpConfiguration(); - - /** @return the associated frontend HTTP listener */ - ApplicationGatewayListener listener(); - - /** @return the addresses assigned to the associated backend */ - Collection backendAddresses(); - - /** @return the associated URL path map */ - ApplicationGatewayUrlPathMap urlPathMap(); - - /** Grouping of application gateway request routing rule definition stages. */ - interface DefinitionStages { - /** - * The first stage of an application gateway request routing rule definition. - * - * @param the stage of the application gateway definition to return to after attaching this definition - */ - interface Blank extends WithListenerOrFrontend { - } - - /** - * The final stage of an application gateway request routing rule definition. - * - *

    At this stage, any remaining optional settings can be specified, or the definition can be attached to the - * parent application gateway definition. - * - * @param the stage of the application gateway definition to return to after attaching this definition - */ - interface WithAttach - extends Attachable.InDefinition, - WithHostname, - WithCookieBasedAffinity, - WithUrlPathMap { - } - - /** - * The stage of an application gateway request routing rule definition allowing to specify an existing listener - * to associate the routing rule with. - * - * @param the stage of the application gateway definition to return to after attaching this definition - */ - interface WithListener { - /** - * Associates the request routing rule with a frontend listener. - * - *

    If the listener with the specified name does not yet exist, it must be defined separately in the - * optional stages of the application gateway definition. This only adds a reference to the listener by its - * name. - * - *

    Also, note that a given listener can be used by no more than one request routing rule at a time. - * - * @param name the name of a listener to reference - * @return the next stage of the definition - */ - WithBackendHttpConfigOrRedirect fromListener(String name); - } - - /** - * The stage of an application gateway request routing rule definition allowing to associate an existing - * listener with the rule, or create a new one implicitly by specifying the frontend to listen to. - * - * @param the stage of the application gateway definition to return to after attaching this definition - */ - interface WithListenerOrFrontend extends WithListener, WithFrontend { - } - - /** - * The stage of an application gateway request routing rule definition allowing to specify the frontend for the - * rule to apply to. - * - * @param the stage of the application gateway definition to return to after attaching this definition - */ - interface WithFrontend { - /** - * Enables the rule to apply to the application gateway's public (Internet-facing) frontend. - * - *

    If the public frontend IP configuration does not yet exist, it will be created under an auto-generated - * name. - * - *

    If the application gateway does not have a public IP address specified for its public frontend, one - * will be created automatically, unless a specific public IP address is specified in the application - * gateway definition's optional settings. - * - * @return the next stage of the definition - */ - WithFrontendPort fromPublicFrontend(); - - /** - * Enables the rule to apply to the application gateway's private (internal) frontend. - * - *

    If the private frontend IP configuration does not yet exist, it will be created under an - * auto-generated name. - * - *

    If the application gateway does not have a subnet specified for its private frontend, one will be - * created automatically, unless a specific subnet is specified in the application gateway definition's - * optional settings. - * - * @return the next stage of the definition - */ - WithFrontendPort fromPrivateFrontend(); - } - - /** - * The stage of an application gateway request routing rule definition allowing to create an associate listener - * and frontend for a specific port number and protocol. - * - * @param the stage of the application gateway definition to return to after attaching this definition - */ - interface WithFrontendPort { - /** - * Associates a new listener for the specified port number and the HTTP protocol with this rule. - * - * @param portNumber the port number to listen to - * @return the next stage of the definition, or null if the specified port number is already used for a - * different protocol - */ - WithBackendHttpConfigOrRedirect fromFrontendHttpPort(int portNumber); - - /** - * Associates a new listener for the specified port number and the HTTPS protocol with this rule. - * - * @param portNumber the port number to listen to - * @return the next stage of the definition, or null if the specified port number is already used for a - * different protocol - */ - WithSslCertificate fromFrontendHttpsPort(int portNumber); - } - - /** - * The stage of an application gateway request routing rule allowing to specify an SSL certificate. - * - * @param the stage of the application gateway definition to return to after attaching this definition - */ - interface WithSslCertificate - extends HasSslCertificate.DefinitionStages.WithSslCertificate< - WithBackendHttpConfigOrSniOrRedirect> { - } - - /** - * The stage of an application gateway request routing rule allowing to specify backend HTTP settings, or SNI, - * or a redirect configuration. - * - * @param the stage of the application gateway definition to return to after attaching this definition - */ - interface WithBackendHttpConfigOrSniOrRedirect - extends WithBackendHttpConfigurationOrSni, WithRedirectConfig { - } - - /** - * The stage of an application gateway request routing rule allowing to specify an SSL certificate. - * - * @param the stage of the application gateway definition to return to after attaching this definition - */ - interface WithSslPassword extends HasSslCertificate.DefinitionStages.WithSslPassword { - } - - /** - * The stage of an application gateway request routing rule allowing to enable cookie based affinity. - * - * @param the stage of the application gateway definition to return to after attaching this definition - */ - interface WithCookieBasedAffinity - extends HasCookieBasedAffinity.DefinitionStages.WithCookieBasedAffinity> { - } - - /** - * The stage of an application gateway request routing rule definition allowing to specify the backend to - * associate the routing rule with. - * - * @param the stage of the application gateway definition to return to after attaching this definition - */ - interface WithBackend { - /** - * Associates the request routing rule with a backend on this application gateway. - * - *

    If the backend does not yet exist, it will be automatically created. - * - * @param name the name of an existing backend - * @return the next stage of the definition - */ - WithAttach toBackend(String name); - } - - /** - * The stage of an application gateway request routing rule definition allowing to add an address to the backend - * used by this request routing rule. - * - *

    A new backend will be created if none is associated with this rule yet. - * - * @param the stage of the application gateway definition to return to after attaching this definition - */ - interface WithBackendAddress { - /** - * Adds an IP address to the backend associated with this rule. - * - *

    If no backend has been associated with this rule yet, a new one will be created with an auto-generated - * name. - * - *

    This call can be used in a sequence to add multiple IP addresses. - * - * @param ipAddress an IP address - * @return the next stage of the definition - */ - WithBackendAddressOrAttach toBackendIPAddress(String ipAddress); - - /** - * Adds the specified IP addresses to the backend associated with this rule. - * - * @param ipAddresses IP addresses to add - * @return the next stage of the definition - */ - WithBackendAddressOrAttach toBackendIPAddresses(String... ipAddresses); - - /** - * Adds an FQDN (fully qualified domain name) to the backend associated with this rule. - * - *

    If no backend has been associated with this rule yet, a new one will be created with an auto-generated - * name. - * - *

    This call can be used in a sequence to add multiple FQDNs. - * - * @param fqdn a fully qualified domain name - * @return the next stage of the definition - */ - WithBackendAddressOrAttach toBackendFqdn(String fqdn); - } - - /** - * The stage of an application gateway request routing rule definition allowing to add more backend addresses, - * start specifying optional settings, or finish the definition by attaching it to the parent application - * gateway. - * - * @param the stage of the application gateway definition to return to after attaching this definition - */ - interface WithBackendAddressOrAttach extends WithBackendAddress, WithAttach { - } - - /** - * The stage of an application gateway request routing rule definition allowing to add an address to specify an - * existing backend to associate with this request routing rule or create a new backend with an auto-generated - * name and addresses to it. - * - * @param the stage of the application gateway definition to return to after attaching this definition - */ - interface WithBackendOrAddress extends WithBackend, WithBackendAddress { - } - - /** - * The stage of an application gateway request routing rule definition allowing to require server name - * indication if the application gateway is serving multiple websites in its backends and SSL is required. - * - * @param the stage of the application gateway definition to return to after attaching this definition - */ - interface WithBackendHttpConfigurationOrSni - extends WithBackendHttpConfiguration, - HasServerNameIndication.DefinitionStages.WithServerNameIndication< - WithBackendHttpConfiguration> { - } - - /** - * The stage of an application gateway request routing rule definition allowing to specify the backend HTTP - * settings configuration to associate the routing rule with. - * - * @param the stage of the application gateway definition to return to after attaching this definition - */ - interface WithBackendHttpConfiguration { - /** - * Associates the specified backend HTTP settings configuration with this request routing rule. - * - *

    If the backend configuration does not exist yet, it must be defined in the optional part of the - * application gateway definition. The request routing rule references it only by name. - * - * @param name the name of a backend HTTP settings configuration - * @return the next stage of the definition - */ - WithBackendOrAddress toBackendHttpConfiguration(String name); - - /** - * Creates a backend HTTP settings configuration for the specified backend port and the HTTP protocol, and - * associates it with this request routing rule. - * - *

    An auto-generated name will be used for this newly created configuration. - * - * @param portNumber the port number for a new backend HTTP settings configuration - * @return the next stage of the definition - */ - WithBackendOrAddress toBackendHttpPort(int portNumber); - - // TODO: toBackendHttpsPort(int portNumber) ? - } - - /** - * The stage of an application gateway request routing rule definition allowing to select either a backend or a - * redirect configuration. - * - * @param the stage of the application gateway definition to return to after attaching this definition - */ - interface WithBackendHttpConfigOrRedirect - extends WithBackendHttpConfiguration, WithRedirectConfig { - } - - /** - * The stage of an application gateway request routing rule definition allowing to specify the host name of a - * backend website for the listener to receive traffic for. - * - * @param the stage of the application gateway definition to return to after attaching this definition - */ - interface WithHostname extends HasHostname.DefinitionStages.WithHostname> { - } - - /** - * The stage of an application gateway request routing rule definition allowing to require server name - * indication. - * - * @param the stage of the application gateway definition to return to after attaching this definition - */ - interface WithServerNameIndication - extends HasServerNameIndication.DefinitionStages.WithServerNameIndication> { - } - - /** - * The stage of an application gateway request routing rule definition allowing to associate the rule with a - * redirect configuration. - * - * @param the stage of the application gateway definition to return to after attaching this definition - */ - interface WithRedirectConfig { - /** - * Associates the specified redirect configuration with this request routing rule. - * - * @param name the name of a redirect configuration on this application gateway - * @return the next stage of the definition - */ - WithAttach withRedirectConfiguration(String name); - } - - /** - * The stage of an application gateway request routing rule definition allowing to associate the rule with a - * URL path map. - * - * @param the stage of the application gateway definition to return to after attaching this definition - */ - interface WithUrlPathMap { - /** - * Associates the specified URL path map with this request routing rule. - * - * @param urlPathMapName the name of a URL path map on this application gateway - * @return the next stage of the definition - */ - WithAttach withUrlPathMap(String urlPathMapName); - } - } - - /** - * The entirety of an application gateway request routing rule definition. - * - * @param the stage of the application gateway definition to return to after attaching this definition - */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithAttach, - DefinitionStages.WithFrontend, - DefinitionStages.WithListener, - DefinitionStages.WithFrontendPort, - DefinitionStages.WithListenerOrFrontend, - DefinitionStages.WithBackend, - DefinitionStages.WithBackendAddress, - DefinitionStages.WithBackendOrAddress, - DefinitionStages.WithBackendAddressOrAttach, - DefinitionStages.WithBackendHttpConfigOrRedirect, - DefinitionStages.WithBackendHttpConfiguration, - DefinitionStages.WithBackendHttpConfigurationOrSni, - DefinitionStages.WithSslCertificate, - DefinitionStages.WithBackendHttpConfigOrSniOrRedirect, - DefinitionStages.WithSslPassword>, - DefinitionStages.WithUrlPathMap { - } - - /** Grouping of application gateway request routing rule update stages. */ - interface UpdateStages { - /** - * The stage of an application gateway request routing rule update allowing to associate the rule with a - * redirect configuration. - */ - interface WithRedirectConfig { - /** - * Associates the specified redirect configuration with this request routing rule. - * - *

    Note that no backend can be associated with this request routing rule if it has a redirect - * configuration assigned to it, so this will also remove any backend and backend HTTP settings - * configuration. - * - * @param name the name of a redirect configuration on this application gateway - * @return the next stage of the update - */ - Update withRedirectConfiguration(String name); - - /** - * Removes the association with a redirect configuration, if any. - * - * @return the next stage of the update - */ - Update withoutRedirectConfiguration(); - } - - /** - * The stage of an application gateway request routing rule update allowing to specify an existing listener to - * associate the routing rule with. - */ - interface WithListener { - /** - * Associates the request routing rule with an existing frontend listener. - * - *

    Also, note that a given listener can be used by no more than one request routing rule at a time. - * - * @param name the name of a listener to reference - * @return the next stage of the update - */ - Update fromListener(String name); - } - - /** - * The stage of an application gateway request routing rule update allowing to specify the backend to associate - * the routing rule with. - */ - interface WithBackend { - /** - * Associates the request routing rule with a backend on this application gateway. - * - *

    If the specified backend does not yet exist, it will be automatically created. - * - * @param name the name of a backend - * @return the next stage of the update - */ - Update toBackend(String name); - } - - /** - * The stage of an application gateway request routing rule update allowing to specify the backend HTTP settings - * configuration to associate the routing rule with. - */ - interface WithBackendHttpConfiguration { - /** - * Associates the specified backend HTTP settings configuration with this request routing rule. - * - * @param name the name of a backend HTTP settings configuration - * @return the next stage of the update - */ - Update toBackendHttpConfiguration(String name); - } - - /** The stage of an application gateway request routing rule allowing to specify an SSL certificate. */ - interface WithSslCertificate extends HasSslCertificate.UpdateStages.WithSslCertificate { - } - - /** - * The stage of an application gateway request routing rule allowing to specify password of the SSL certificate - * pfx file. - */ - interface WithSslPassword extends HasSslCertificate.UpdateStages.WithSslPassword { - } - } - - /** The entirety of an application gateway request routing rule update as part of an application gateway update. */ - interface Update - extends Settable, - UpdateStages.WithListener, - UpdateStages.WithBackend, - UpdateStages.WithBackendHttpConfiguration, - UpdateStages.WithSslCertificate, - UpdateStages.WithSslPassword, - UpdateStages.WithRedirectConfig { - } - - /** - * Grouping of application gateway request routing rule definition stages applicable as part of an application - * gateway update. - */ - interface UpdateDefinitionStages { - /** - * The first stage of an application gateway request routing rule definition. - * - * @param the stage of the application gateway definition to return to after attaching this definition - */ - interface Blank extends WithListenerOrFrontend { - } - - /** - * The final stage of an application gateway request routing rule definition. - * - *

    At this stage, any remaining optional settings can be specified, or the definition can be attached to the - * parent application gateway definition. - * - * @param the stage of the application gateway definition to return to after attaching this definition - */ - interface WithAttach - extends Attachable.InUpdate, - WithHostname, - WithCookieBasedAffinity, - WithRedirectConfig { - } - - /** - * The stage of an application gateway request routing rule definition allowing to select either a backend or a - * redirect configuration. - * - * @param the stage of the application gateway update to return to after attaching this definition - */ - interface WithBackendHttpConfigOrRedirect - extends WithBackendHttpConfiguration, WithRedirectConfig { - } - - /** - * The stage of an application gateway request routing rule definition allowing to associate the rule with a - * redirect configuration. - * - * @param the stage of the application gateway update to return to after attaching this definition - */ - interface WithRedirectConfig { - /** - * Associates the specified redirect configuration with this request routing rule. - * - * @param name the name of a redirect configuration on this application gateway - * @return the next stage of the definition - */ - WithAttach withRedirectConfiguration(String name); - } - - /** - * The stage of an application gateway request routing rule definition allowing to specify an existing listener - * to associate the routing rule with. - * - * @param the stage of the application gateway definition to return to after attaching this definition - */ - interface WithListener { - /** - * Associates the request routing rule with a frontend listener. - * - *

    If the listener with the specified name does not yet exist, it must be defined separately in the - * optional part of the application gateway definition. This only adds a reference to the listener by its - * name. - * - *

    Also, note that a given listener can be used by no more than one request routing rule at a time. - * - * @param name the name of a listener to reference - * @return the next stage of the definition - */ - WithBackendHttpConfigOrRedirect fromListener(String name); - } - - /** - * The stage of an application gateway request routing rule definition allowing to associate an existing - * listener with the rule, or create a new one implicitly by specifying the frontend to listen to. - * - * @param the stage of the application gateway definition to return to after attaching this definition - */ - interface WithListenerOrFrontend extends WithListener, WithFrontend { - } - - /** - * The stage of an application gateway request routing rule definition allowing to specify the frontend for the - * rule to apply to. - * - * @param the stage of the application gateway definition to return to after attaching this definition - */ - interface WithFrontend { - /** - * Enables the rule to apply to the application gateway's public (Internet-facing) frontend. - * - *

    If the public frontend IP configuration does not yet exist, it will be created under an auto-generated - * name. - * - *

    If the application gateway does not have a public IP address specified for its public frontend, one - * will be created automatically, unless a specific public IP address is specified in the application - * gateway definition's optional settings. - * - * @return the next stage of the definition - */ - WithFrontendPort fromPublicFrontend(); - - /** - * Enables the rule to apply to the application gateway's private (internal) frontend. - * - *

    If the private frontend IP configuration does not yet exist, it will be created under an - * auto-generated name. - * - *

    If the application gateway does not have a subnet specified for its private frontend, one will be - * created automatically, unless a specific subnet is specified in the application gateway definition's - * optional settings. - * - * @return the next stage of the definition - */ - WithFrontendPort fromPrivateFrontend(); - } - - /** - * The stage of an application gateway request routing rule definition allowing to create an associate listener - * and frontend for a specific port number and protocol. - * - * @param the stage of the application gateway definition to return to after attaching this definition - */ - interface WithFrontendPort { - /** - * Associates a new listener for the specified port number and the HTTP protocol with this rule. - * - * @param portNumber the port number to listen to - * @return the next stage of the definition, or null if the specified port number is already used for a - * different protocol - */ - WithBackendHttpConfigOrRedirect fromFrontendHttpPort(int portNumber); - - /** - * Associates a new listener for the specified port number and the HTTPS protocol with this rule. - * - * @param portNumber the port number to listen to - * @return the next stage of the definition, or null if the specified port number is already used for a - * different protocol - */ - WithSslCertificate fromFrontendHttpsPort(int portNumber); - } - - /** - * The stage of an application gateway request routing rule allowing to specify an SSL certificate. - * - * @param the next stage of the definition - */ - interface WithSslCertificate - extends HasSslCertificate.UpdateDefinitionStages.WithSslCertificate< - WithBackendHttpConfigOrSniOrRedirect> { - } - - /** - * The stage of an application gateway request routing rule allowing to specify an SSL certificate. - * - * @param the next stage of the definition - */ - interface WithSslPassword extends HasSslCertificate.UpdateDefinitionStages.WithSslPassword { - } - - /** - * The stage of an application gateway request routing rule allowing to enable cookie based affinity. - * - * @param the next stage of the definition - */ - interface WithCookieBasedAffinity - extends HasCookieBasedAffinity.UpdateDefinitionStages.WithCookieBasedAffinity> { - } - - /** - * The stage of an application gateway request routing rule definition allowing to specify the backend to - * associate the routing rule with. - * - * @param the stage of the application gateway definition to return to after attaching this definition - */ - interface WithBackend { - /** - * Associates the request routing rule with a backend on this application gateway. - * - *

    If the backend does not yet exist, it will be automatically created. - * - * @param name the name of an existing backend - * @return the next stage of the definition - */ - WithAttach toBackend(String name); - } - - /** - * The stage of an application gateway request routing rule definition allowing to add an address to the backend - * used by this request routing rule. - * - *

    A new backend will be created if none is associated with this rule yet. - * - * @param the stage of the application gateway definition to return to after attaching this definition - */ - interface WithBackendAddress { - /** - * Adds an IP address to the backend associated with this rule. - * - *

    If no backend has been associated with this rule yet, a new one will be created with an auto-generated - * name. - * - *

    This call can be used in a sequence to add multiple IP addresses. - * - * @param ipAddress an IP address - * @return the next stage of the definition - */ - WithBackendAddressOrAttach toBackendIPAddress(String ipAddress); - - /** - * Adds the specified IP addresses to the backend associated with this rule. - * - * @param ipAddresses IP addresses to add - * @return the next stage of the definition - */ - WithBackendAddressOrAttach toBackendIPAddresses(String... ipAddresses); - - /** - * Adds an FQDN (fully qualified domain name) to the backend associated with this rule. - * - *

    If no backend has been associated with this rule yet, a new one will be created with an auto-generated - * name. - * - *

    This call can be used in a sequence to add multiple FQDNs. - * - * @param fqdn a fully qualified domain name - * @return the next stage of the definition - */ - WithBackendAddressOrAttach toBackendFqdn(String fqdn); - } - - /** - * The stage of an application gateway request routing rule definition allowing to add more backend addresses, - * start specifying optional settings, or finish the definition by attaching it to the parent application - * gateway. - * - * @param the stage of the application gateway definition to return to after attaching this definition - */ - interface WithBackendAddressOrAttach extends WithBackendAddress, WithAttach { - } - - /** - * The stage of an application gateway request routing rule definition allowing to add an address to specify an - * existing backend to associate with this request routing rule or create a new backend with an auto-generated - * name and addresses to it. - * - * @param the stage of the application gateway definition to return to after attaching this definition - */ - interface WithBackendOrAddress extends WithBackend, WithBackendAddress { - } - - /** - * The stage of an application gateway request routing rule definition allowing to require server name - * indication if the application gateway is serving multiple websites in its backends and SSL is required. - * - * @param the stage of the application gateway definition to return to after attaching this definition - */ - interface WithBackendHttpConfigurationOrSni - extends WithBackendHttpConfiguration, - HasServerNameIndication.UpdateDefinitionStages.WithServerNameIndication< - WithBackendHttpConfiguration> { - } - - /** - * The stage of an application gateway request routing rule allowing to specify backend HTTP settings, or SNI, - * or a redirect configuration. - * - * @param the stage of the application gateway update to return to after attaching this definition - */ - interface WithBackendHttpConfigOrSniOrRedirect - extends WithBackendHttpConfigurationOrSni, WithRedirectConfig { - } - - /** - * The stage of an application gateway request routing rule definition allowing to specify the backend HTTP - * settings configuration to associate the routing rule with. - * - * @param the stage of the application gateway definition to return to after attaching this definition - */ - interface WithBackendHttpConfiguration { - /** - * Associates the specified backend HTTP settings configuration with this request routing rule. - * - *

    If the backend configuration does not exist yet, it must be defined in the optional part of the - * application gateway definition. The request routing rule references it only by name. - * - * @param name the name of a backend HTTP settings configuration - * @return the next stage of the definition - */ - WithBackendOrAddress toBackendHttpConfiguration(String name); - - /** - * Creates a backend HTTP settings configuration for the specified backend port and the HTTP protocol, and - * associates it with this request routing rule. - * - *

    An auto-generated name will be used for this newly created configuration. - * - * @param portNumber the port number for a new backend HTTP settings configuration - * @return the next stage of the definition - */ - WithBackendOrAddress toBackendHttpPort(int portNumber); - - // TODO: toBackendHttpsPort(int portNumber) ? - } - - /** - * The stage of an application gateway request routing rule definition allowing to specify the host name of a - * backend website for the listener to receive traffic for. - * - * @param the stage of the application gateway definition to return to after attaching this definition - */ - interface WithHostname extends HasHostname.UpdateDefinitionStages.WithHostname> { - } - - /** - * The stage of an application gateway request routing rule definition allowing to require server name - * indication. - * - * @param the stage of the application gateway definition to return to after attaching this definition - */ - interface WithServerNameIndication - extends HasServerNameIndication.UpdateDefinitionStages.WithServerNameIndication> { - } - } - - /** - * The entirety of an application gateway request routing rule definition as part of an application gateway update. - * - * @param the stage of the application gateway definition to return to after attaching this definition - */ - interface UpdateDefinition - extends UpdateDefinitionStages.Blank, - UpdateDefinitionStages.WithAttach, - UpdateDefinitionStages.WithFrontend, - UpdateDefinitionStages.WithListener, - UpdateDefinitionStages.WithFrontendPort, - UpdateDefinitionStages.WithListenerOrFrontend, - UpdateDefinitionStages.WithBackend, - UpdateDefinitionStages.WithBackendAddress, - UpdateDefinitionStages.WithBackendOrAddress, - UpdateDefinitionStages.WithBackendAddressOrAttach, - UpdateDefinitionStages.WithBackendHttpConfiguration, - UpdateDefinitionStages.WithBackendHttpConfigOrRedirect, - UpdateDefinitionStages.WithBackendHttpConfigurationOrSni, - UpdateDefinitionStages.WithBackendHttpConfigOrSniOrRedirect, - UpdateDefinitionStages.WithSslCertificate, - UpdateDefinitionStages.WithSslPassword< - UpdateDefinitionStages.WithBackendHttpConfigOrSniOrRedirect> { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayRequestRoutingRuleType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayRequestRoutingRuleType.java deleted file mode 100644 index 1b61141cf864..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayRequestRoutingRuleType.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ApplicationGatewayRequestRoutingRuleType. */ -public final class ApplicationGatewayRequestRoutingRuleType - extends ExpandableStringEnum { - /** Static value Basic for ApplicationGatewayRequestRoutingRuleType. */ - public static final ApplicationGatewayRequestRoutingRuleType BASIC = fromString("Basic"); - - /** Static value PathBasedRouting for ApplicationGatewayRequestRoutingRuleType. */ - public static final ApplicationGatewayRequestRoutingRuleType PATH_BASED_ROUTING = fromString("PathBasedRouting"); - - /** - * Creates or finds a ApplicationGatewayRequestRoutingRuleType from its string representation. - * - * @param name a name to look for. - * @return the corresponding ApplicationGatewayRequestRoutingRuleType. - */ - @JsonCreator - public static ApplicationGatewayRequestRoutingRuleType fromString(String name) { - return fromString(name, ApplicationGatewayRequestRoutingRuleType.class); - } - - /** @return known ApplicationGatewayRequestRoutingRuleType values. */ - public static Collection values() { - return values(ApplicationGatewayRequestRoutingRuleType.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayRewriteRule.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayRewriteRule.java deleted file mode 100644 index 14bd885614a6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayRewriteRule.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Rewrite rule of an application gateway. */ -@Fluent -public final class ApplicationGatewayRewriteRule { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayRewriteRule.class); - - /* - * Name of the rewrite rule that is unique within an Application Gateway. - */ - @JsonProperty(value = "name") - private String name; - - /* - * Set of actions to be done as part of the rewrite Rule. - */ - @JsonProperty(value = "actionSet") - private ApplicationGatewayRewriteRuleActionSet actionSet; - - /** - * Get the name property: Name of the rewrite rule that is unique within an Application Gateway. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Name of the rewrite rule that is unique within an Application Gateway. - * - * @param name the name value to set. - * @return the ApplicationGatewayRewriteRule object itself. - */ - public ApplicationGatewayRewriteRule withName(String name) { - this.name = name; - return this; - } - - /** - * Get the actionSet property: Set of actions to be done as part of the rewrite Rule. - * - * @return the actionSet value. - */ - public ApplicationGatewayRewriteRuleActionSet actionSet() { - return this.actionSet; - } - - /** - * Set the actionSet property: Set of actions to be done as part of the rewrite Rule. - * - * @param actionSet the actionSet value to set. - * @return the ApplicationGatewayRewriteRule object itself. - */ - public ApplicationGatewayRewriteRule withActionSet(ApplicationGatewayRewriteRuleActionSet actionSet) { - this.actionSet = actionSet; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (actionSet() != null) { - actionSet().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayRewriteRuleActionSet.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayRewriteRuleActionSet.java deleted file mode 100644 index ceb534d1bf6a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayRewriteRuleActionSet.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Set of actions in the Rewrite Rule in Application Gateway. */ -@Fluent -public final class ApplicationGatewayRewriteRuleActionSet { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayRewriteRuleActionSet.class); - - /* - * Request Header Actions in the Action Set - */ - @JsonProperty(value = "requestHeaderConfigurations") - private List requestHeaderConfigurations; - - /* - * Response Header Actions in the Action Set - */ - @JsonProperty(value = "responseHeaderConfigurations") - private List responseHeaderConfigurations; - - /** - * Get the requestHeaderConfigurations property: Request Header Actions in the Action Set. - * - * @return the requestHeaderConfigurations value. - */ - public List requestHeaderConfigurations() { - return this.requestHeaderConfigurations; - } - - /** - * Set the requestHeaderConfigurations property: Request Header Actions in the Action Set. - * - * @param requestHeaderConfigurations the requestHeaderConfigurations value to set. - * @return the ApplicationGatewayRewriteRuleActionSet object itself. - */ - public ApplicationGatewayRewriteRuleActionSet withRequestHeaderConfigurations( - List requestHeaderConfigurations) { - this.requestHeaderConfigurations = requestHeaderConfigurations; - return this; - } - - /** - * Get the responseHeaderConfigurations property: Response Header Actions in the Action Set. - * - * @return the responseHeaderConfigurations value. - */ - public List responseHeaderConfigurations() { - return this.responseHeaderConfigurations; - } - - /** - * Set the responseHeaderConfigurations property: Response Header Actions in the Action Set. - * - * @param responseHeaderConfigurations the responseHeaderConfigurations value to set. - * @return the ApplicationGatewayRewriteRuleActionSet object itself. - */ - public ApplicationGatewayRewriteRuleActionSet withResponseHeaderConfigurations( - List responseHeaderConfigurations) { - this.responseHeaderConfigurations = responseHeaderConfigurations; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (requestHeaderConfigurations() != null) { - requestHeaderConfigurations().forEach(e -> e.validate()); - } - if (responseHeaderConfigurations() != null) { - responseHeaderConfigurations().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayRewriteRuleSet.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayRewriteRuleSet.java deleted file mode 100644 index d9df4c2da6c5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayRewriteRuleSet.java +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.ApplicationGatewayRewriteRuleSetPropertiesFormat; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Rewrite rule set of an application gateway. */ -@Fluent -public final class ApplicationGatewayRewriteRuleSet extends SubResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayRewriteRuleSet.class); - - /* - * Properties of rewrite rule set of the application gateway. - */ - @JsonProperty(value = "properties") - private ApplicationGatewayRewriteRuleSetPropertiesFormat innerProperties; - - /* - * Name of the rewrite rule set that is unique within an Application - * Gateway. - */ - @JsonProperty(value = "name") - private String name; - - /* - * A unique read-only string that changes whenever the resource is updated. - */ - @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) - private String etag; - - /** - * Get the innerProperties property: Properties of rewrite rule set of the application gateway. - * - * @return the innerProperties value. - */ - private ApplicationGatewayRewriteRuleSetPropertiesFormat innerProperties() { - return this.innerProperties; - } - - /** - * Get the name property: Name of the rewrite rule set that is unique within an Application Gateway. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Name of the rewrite rule set that is unique within an Application Gateway. - * - * @param name the name value to set. - * @return the ApplicationGatewayRewriteRuleSet object itself. - */ - public ApplicationGatewayRewriteRuleSet withName(String name) { - this.name = name; - return this; - } - - /** - * Get the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** {@inheritDoc} */ - @Override - public ApplicationGatewayRewriteRuleSet withId(String id) { - super.withId(id); - return this; - } - - /** - * Get the rewriteRules property: Rewrite rules in the rewrite rule set. - * - * @return the rewriteRules value. - */ - public List rewriteRules() { - return this.innerProperties() == null ? null : this.innerProperties().rewriteRules(); - } - - /** - * Set the rewriteRules property: Rewrite rules in the rewrite rule set. - * - * @param rewriteRules the rewriteRules value to set. - * @return the ApplicationGatewayRewriteRuleSet object itself. - */ - public ApplicationGatewayRewriteRuleSet withRewriteRules(List rewriteRules) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayRewriteRuleSetPropertiesFormat(); - } - this.innerProperties().withRewriteRules(rewriteRules); - return this; - } - - /** - * Get the provisioningState property: Provisioning state of the rewrite rule set resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewaySku.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewaySku.java deleted file mode 100644 index 897242fa317f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewaySku.java +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** SKU of an application gateway. */ -@Fluent -public final class ApplicationGatewaySku { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewaySku.class); - - /* - * Name of an application gateway SKU. - */ - @JsonProperty(value = "name") - private ApplicationGatewaySkuName name; - - /* - * Tier of an application gateway. - */ - @JsonProperty(value = "tier") - private ApplicationGatewayTier tier; - - /* - * Capacity (instance count) of an application gateway. - */ - @JsonProperty(value = "capacity") - private Integer capacity; - - /** - * Get the name property: Name of an application gateway SKU. - * - * @return the name value. - */ - public ApplicationGatewaySkuName name() { - return this.name; - } - - /** - * Set the name property: Name of an application gateway SKU. - * - * @param name the name value to set. - * @return the ApplicationGatewaySku object itself. - */ - public ApplicationGatewaySku withName(ApplicationGatewaySkuName name) { - this.name = name; - return this; - } - - /** - * Get the tier property: Tier of an application gateway. - * - * @return the tier value. - */ - public ApplicationGatewayTier tier() { - return this.tier; - } - - /** - * Set the tier property: Tier of an application gateway. - * - * @param tier the tier value to set. - * @return the ApplicationGatewaySku object itself. - */ - public ApplicationGatewaySku withTier(ApplicationGatewayTier tier) { - this.tier = tier; - return this; - } - - /** - * Get the capacity property: Capacity (instance count) of an application gateway. - * - * @return the capacity value. - */ - public Integer capacity() { - return this.capacity; - } - - /** - * Set the capacity property: Capacity (instance count) of an application gateway. - * - * @param capacity the capacity value to set. - * @return the ApplicationGatewaySku object itself. - */ - public ApplicationGatewaySku withCapacity(Integer capacity) { - this.capacity = capacity; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewaySkuName.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewaySkuName.java deleted file mode 100644 index 1662724adb34..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewaySkuName.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ApplicationGatewaySkuName. */ -public final class ApplicationGatewaySkuName extends ExpandableStringEnum { - /** Static value Standard_Small for ApplicationGatewaySkuName. */ - public static final ApplicationGatewaySkuName STANDARD_SMALL = fromString("Standard_Small"); - - /** Static value Standard_Medium for ApplicationGatewaySkuName. */ - public static final ApplicationGatewaySkuName STANDARD_MEDIUM = fromString("Standard_Medium"); - - /** Static value Standard_Large for ApplicationGatewaySkuName. */ - public static final ApplicationGatewaySkuName STANDARD_LARGE = fromString("Standard_Large"); - - /** Static value WAF_Medium for ApplicationGatewaySkuName. */ - public static final ApplicationGatewaySkuName WAF_MEDIUM = fromString("WAF_Medium"); - - /** Static value WAF_Large for ApplicationGatewaySkuName. */ - public static final ApplicationGatewaySkuName WAF_LARGE = fromString("WAF_Large"); - - /** Static value Standard_v2 for ApplicationGatewaySkuName. */ - public static final ApplicationGatewaySkuName STANDARD_V2 = fromString("Standard_v2"); - - /** Static value WAF_v2 for ApplicationGatewaySkuName. */ - public static final ApplicationGatewaySkuName WAF_V2 = fromString("WAF_v2"); - - /** - * Creates or finds a ApplicationGatewaySkuName from its string representation. - * - * @param name a name to look for. - * @return the corresponding ApplicationGatewaySkuName. - */ - @JsonCreator - public static ApplicationGatewaySkuName fromString(String name) { - return fromString(name, ApplicationGatewaySkuName.class); - } - - /** @return known ApplicationGatewaySkuName values. */ - public static Collection values() { - return values(ApplicationGatewaySkuName.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewaySslCertificate.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewaySslCertificate.java deleted file mode 100644 index 7455f73319c1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewaySslCertificate.java +++ /dev/null @@ -1,203 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.network.fluent.models.ApplicationGatewaySslCertificateInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.ChildResource; -import com.azure.resourcemanager.resources.fluentcore.model.Attachable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.model.Settable; -import java.io.File; -import java.io.IOException; - -/** A client-side representation of an application gateway SSL certificate. */ -@Fluent() -public interface ApplicationGatewaySslCertificate - extends HasInnerModel, ChildResource { - - /** @return the public data of the certificate */ - String publicData(); - - /** - * Get Secret Id of (base-64 encoded unencrypted pfx) 'Secret' or 'Certificate' object stored in KeyVault. - * - * @return the secret id - */ - String keyVaultSecretId(); - - /** Grouping of application gateway SSL certificate definition stages. */ - interface DefinitionStages { - /** - * The first stage of an application gateway SSL certificate. - * - * @param the parent application gateway type - */ - interface Blank extends WithData { - } - - /** - * The final stage of an application gateway SSL certificate definition. - * - *

    At this stage, any remaining optional settings can be specified, or the definition can be attached to the - * parent application gateway definition. - * - * @param the stage of the parent application gateway definition to return to after attaching - */ - interface WithAttach extends Attachable.InDefinition { - } - - /** - * The stage of an SSL certificate definition allowing to specify the contents of the SSL certificate. - * - * @param the stage of the parent application gateway to return to after attaching - */ - interface WithData { - /** - * Specifies the contents of the private key in the PFX (PKCS#12) format, not base64-encoded. - * - * @param pfxData the contents of the private key in the PFX format - * @return the next stage of the definition - */ - WithPassword withPfxFromBytes(byte[] pfxData); - - /** - * Specifies the PFX (PKCS#12) file to get the private key content from. - * - * @param pfxFile a file in the PFX format - * @return the next stage of the definition - * @throws java.io.IOException when there are problems with the provided file - */ - WithPassword withPfxFromFile(File pfxFile) throws IOException; - - /** - * Sepecifies the content of the private key using key vault. - * - * @param keyVaultSecretId the secret id of key vault - * @return the next stage of the definition - */ - WithAttach withKeyVaultSecretId(String keyVaultSecretId); - } - - /** - * The stage of an SSL certificate definition allowing to specify the password for the private key (PFX) content - * of the certificate. - * - * @param the stage of the parent application gateway to return to after attaching - */ - interface WithPassword { - /** - * Specifies the password currently used to protect the provided PFX content of the SSL certificate. - * - * @param password a password - * @return the next stage of the definition - */ - WithAttach withPfxPassword(String password); - } - } - - /** - * The entirety of an application gateway SSL certificate definition. - * - * @param the stage of the parent application gateway definition to return to after attaching - */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithAttach, - DefinitionStages.WithData, - DefinitionStages.WithPassword { - } - - /** Grouping of application gateway SSL certificate update stages. */ - interface UpdateStages { - } - - /** The entirety of an application gateway SSL certificate update as part of an application gateway update. */ - interface Update extends Settable { - } - - /** - * Grouping of application gateway SSL certificate definition stages applicable as part of an application gateway - * update. - */ - interface UpdateDefinitionStages { - /** - * The first stage of an application gateway authentication certificate definition. - * - * @param the stage of the parent application gateway definition to return to after attaching - */ - interface Blank extends WithData { - } - - /** - * The final stage of an application gateway SSL certificate definition. - * - *

    At this stage, any remaining optional settings can be specified, or the definition can be attached to the - * parent application gateway definition. - * - * @param the stage of the parent application gateway definition to return to after attaching - */ - interface WithAttach extends Attachable.InUpdate { - } - - /** - * The stage of an SSL certificate definition allowing to specify the contents of the SSL certificate. - * - * @param the stage of the parent application gateway to return to after attaching - */ - interface WithData { - /** - * Specifies the contents of the private key in the PFX (PKCS#12) format, not base64-encoded. - * - * @param pfxData the contents of the private key in the PFX format - * @return the next stage of the definition - */ - WithPassword withPfxFromBytes(byte[] pfxData); - - /** - * Specifies the PFX (PKCS#12) file to get the private key content from. - * - * @param pfxFile a file in the PFX format - * @return the next stage of the definition - * @throws java.io.IOException when there are problems with the provided file - */ - WithPassword withPfxFromFile(File pfxFile) throws IOException; - - /** - * Sepecifies the content of the private key using key vault. - * - * @param keyVaultSecretId the secret id of key vault - * @return the next stage of the definition - */ - WithAttach withKeyVaultSecretId(String keyVaultSecretId); - } - - /** - * The stage of an SSL certificate definition allowing to specify the password for the private key (PFX) content - * of the certificate. - * - * @param the stage of the parent application gateway to return to after attaching - */ - interface WithPassword { - /** - * Specifies the password currently used to protect the provided PFX content of the SSL certificate. - * - * @param password a password - * @return the next stage of the definition - */ - WithAttach withPfxPassword(String password); - } - } - - /** - * The entirety of an application gateway SSL certificate definition as part of an application gateway update. - * - * @param the stage of the parent application gateway definition to return to after attaching - */ - interface UpdateDefinition - extends UpdateDefinitionStages.Blank, - UpdateDefinitionStages.WithData, - UpdateDefinitionStages.WithPassword, - UpdateDefinitionStages.WithAttach { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewaySslCipherSuite.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewaySslCipherSuite.java deleted file mode 100644 index a034434f050d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewaySslCipherSuite.java +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ApplicationGatewaySslCipherSuite. */ -public final class ApplicationGatewaySslCipherSuite extends ExpandableStringEnum { - /** Static value TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 for ApplicationGatewaySslCipherSuite. */ - public static final ApplicationGatewaySslCipherSuite TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 = - fromString("TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384"); - - /** Static value TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 for ApplicationGatewaySslCipherSuite. */ - public static final ApplicationGatewaySslCipherSuite TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 = - fromString("TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256"); - - /** Static value TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA for ApplicationGatewaySslCipherSuite. */ - public static final ApplicationGatewaySslCipherSuite TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA = - fromString("TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA"); - - /** Static value TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA for ApplicationGatewaySslCipherSuite. */ - public static final ApplicationGatewaySslCipherSuite TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA = - fromString("TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA"); - - /** Static value TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 for ApplicationGatewaySslCipherSuite. */ - public static final ApplicationGatewaySslCipherSuite TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 = - fromString("TLS_DHE_RSA_WITH_AES_256_GCM_SHA384"); - - /** Static value TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 for ApplicationGatewaySslCipherSuite. */ - public static final ApplicationGatewaySslCipherSuite TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 = - fromString("TLS_DHE_RSA_WITH_AES_128_GCM_SHA256"); - - /** Static value TLS_DHE_RSA_WITH_AES_256_CBC_SHA for ApplicationGatewaySslCipherSuite. */ - public static final ApplicationGatewaySslCipherSuite TLS_DHE_RSA_WITH_AES_256_CBC_SHA = - fromString("TLS_DHE_RSA_WITH_AES_256_CBC_SHA"); - - /** Static value TLS_DHE_RSA_WITH_AES_128_CBC_SHA for ApplicationGatewaySslCipherSuite. */ - public static final ApplicationGatewaySslCipherSuite TLS_DHE_RSA_WITH_AES_128_CBC_SHA = - fromString("TLS_DHE_RSA_WITH_AES_128_CBC_SHA"); - - /** Static value TLS_RSA_WITH_AES_256_GCM_SHA384 for ApplicationGatewaySslCipherSuite. */ - public static final ApplicationGatewaySslCipherSuite TLS_RSA_WITH_AES_256_GCM_SHA384 = - fromString("TLS_RSA_WITH_AES_256_GCM_SHA384"); - - /** Static value TLS_RSA_WITH_AES_128_GCM_SHA256 for ApplicationGatewaySslCipherSuite. */ - public static final ApplicationGatewaySslCipherSuite TLS_RSA_WITH_AES_128_GCM_SHA256 = - fromString("TLS_RSA_WITH_AES_128_GCM_SHA256"); - - /** Static value TLS_RSA_WITH_AES_256_CBC_SHA256 for ApplicationGatewaySslCipherSuite. */ - public static final ApplicationGatewaySslCipherSuite TLS_RSA_WITH_AES_256_CBC_SHA256 = - fromString("TLS_RSA_WITH_AES_256_CBC_SHA256"); - - /** Static value TLS_RSA_WITH_AES_128_CBC_SHA256 for ApplicationGatewaySslCipherSuite. */ - public static final ApplicationGatewaySslCipherSuite TLS_RSA_WITH_AES_128_CBC_SHA256 = - fromString("TLS_RSA_WITH_AES_128_CBC_SHA256"); - - /** Static value TLS_RSA_WITH_AES_256_CBC_SHA for ApplicationGatewaySslCipherSuite. */ - public static final ApplicationGatewaySslCipherSuite TLS_RSA_WITH_AES_256_CBC_SHA = - fromString("TLS_RSA_WITH_AES_256_CBC_SHA"); - - /** Static value TLS_RSA_WITH_AES_128_CBC_SHA for ApplicationGatewaySslCipherSuite. */ - public static final ApplicationGatewaySslCipherSuite TLS_RSA_WITH_AES_128_CBC_SHA = - fromString("TLS_RSA_WITH_AES_128_CBC_SHA"); - - /** Static value TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 for ApplicationGatewaySslCipherSuite. */ - public static final ApplicationGatewaySslCipherSuite TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 = - fromString("TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384"); - - /** Static value TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 for ApplicationGatewaySslCipherSuite. */ - public static final ApplicationGatewaySslCipherSuite TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 = - fromString("TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256"); - - /** Static value TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 for ApplicationGatewaySslCipherSuite. */ - public static final ApplicationGatewaySslCipherSuite TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 = - fromString("TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384"); - - /** Static value TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 for ApplicationGatewaySslCipherSuite. */ - public static final ApplicationGatewaySslCipherSuite TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 = - fromString("TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256"); - - /** Static value TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA for ApplicationGatewaySslCipherSuite. */ - public static final ApplicationGatewaySslCipherSuite TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA = - fromString("TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA"); - - /** Static value TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA for ApplicationGatewaySslCipherSuite. */ - public static final ApplicationGatewaySslCipherSuite TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA = - fromString("TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA"); - - /** Static value TLS_DHE_DSS_WITH_AES_256_CBC_SHA256 for ApplicationGatewaySslCipherSuite. */ - public static final ApplicationGatewaySslCipherSuite TLS_DHE_DSS_WITH_AES_256_CBC_SHA256 = - fromString("TLS_DHE_DSS_WITH_AES_256_CBC_SHA256"); - - /** Static value TLS_DHE_DSS_WITH_AES_128_CBC_SHA256 for ApplicationGatewaySslCipherSuite. */ - public static final ApplicationGatewaySslCipherSuite TLS_DHE_DSS_WITH_AES_128_CBC_SHA256 = - fromString("TLS_DHE_DSS_WITH_AES_128_CBC_SHA256"); - - /** Static value TLS_DHE_DSS_WITH_AES_256_CBC_SHA for ApplicationGatewaySslCipherSuite. */ - public static final ApplicationGatewaySslCipherSuite TLS_DHE_DSS_WITH_AES_256_CBC_SHA = - fromString("TLS_DHE_DSS_WITH_AES_256_CBC_SHA"); - - /** Static value TLS_DHE_DSS_WITH_AES_128_CBC_SHA for ApplicationGatewaySslCipherSuite. */ - public static final ApplicationGatewaySslCipherSuite TLS_DHE_DSS_WITH_AES_128_CBC_SHA = - fromString("TLS_DHE_DSS_WITH_AES_128_CBC_SHA"); - - /** Static value TLS_RSA_WITH_3DES_EDE_CBC_SHA for ApplicationGatewaySslCipherSuite. */ - public static final ApplicationGatewaySslCipherSuite TLS_RSA_WITH_3DES_EDE_CBC_SHA = - fromString("TLS_RSA_WITH_3DES_EDE_CBC_SHA"); - - /** Static value TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA for ApplicationGatewaySslCipherSuite. */ - public static final ApplicationGatewaySslCipherSuite TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA = - fromString("TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA"); - - /** Static value TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 for ApplicationGatewaySslCipherSuite. */ - public static final ApplicationGatewaySslCipherSuite TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 = - fromString("TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256"); - - /** Static value TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 for ApplicationGatewaySslCipherSuite. */ - public static final ApplicationGatewaySslCipherSuite TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 = - fromString("TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384"); - - /** - * Creates or finds a ApplicationGatewaySslCipherSuite from its string representation. - * - * @param name a name to look for. - * @return the corresponding ApplicationGatewaySslCipherSuite. - */ - @JsonCreator - public static ApplicationGatewaySslCipherSuite fromString(String name) { - return fromString(name, ApplicationGatewaySslCipherSuite.class); - } - - /** @return known ApplicationGatewaySslCipherSuite values. */ - public static Collection values() { - return values(ApplicationGatewaySslCipherSuite.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewaySslPolicy.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewaySslPolicy.java deleted file mode 100644 index 0cf6babd9ae1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewaySslPolicy.java +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Application Gateway Ssl policy. */ -@Fluent -public final class ApplicationGatewaySslPolicy { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewaySslPolicy.class); - - /* - * Ssl protocols to be disabled on application gateway. - */ - @JsonProperty(value = "disabledSslProtocols") - private List disabledSslProtocols; - - /* - * Type of Ssl Policy - */ - @JsonProperty(value = "policyType") - private ApplicationGatewaySslPolicyType policyType; - - /* - * Name of Ssl predefined policy - */ - @JsonProperty(value = "policyName") - private ApplicationGatewaySslPolicyName policyName; - - /* - * Ssl cipher suites to be enabled in the specified order to application - * gateway. - */ - @JsonProperty(value = "cipherSuites") - private List cipherSuites; - - /* - * Minimum version of Ssl protocol to be supported on application gateway. - */ - @JsonProperty(value = "minProtocolVersion") - private ApplicationGatewaySslProtocol minProtocolVersion; - - /** - * Get the disabledSslProtocols property: Ssl protocols to be disabled on application gateway. - * - * @return the disabledSslProtocols value. - */ - public List disabledSslProtocols() { - return this.disabledSslProtocols; - } - - /** - * Set the disabledSslProtocols property: Ssl protocols to be disabled on application gateway. - * - * @param disabledSslProtocols the disabledSslProtocols value to set. - * @return the ApplicationGatewaySslPolicy object itself. - */ - public ApplicationGatewaySslPolicy withDisabledSslProtocols( - List disabledSslProtocols) { - this.disabledSslProtocols = disabledSslProtocols; - return this; - } - - /** - * Get the policyType property: Type of Ssl Policy. - * - * @return the policyType value. - */ - public ApplicationGatewaySslPolicyType policyType() { - return this.policyType; - } - - /** - * Set the policyType property: Type of Ssl Policy. - * - * @param policyType the policyType value to set. - * @return the ApplicationGatewaySslPolicy object itself. - */ - public ApplicationGatewaySslPolicy withPolicyType(ApplicationGatewaySslPolicyType policyType) { - this.policyType = policyType; - return this; - } - - /** - * Get the policyName property: Name of Ssl predefined policy. - * - * @return the policyName value. - */ - public ApplicationGatewaySslPolicyName policyName() { - return this.policyName; - } - - /** - * Set the policyName property: Name of Ssl predefined policy. - * - * @param policyName the policyName value to set. - * @return the ApplicationGatewaySslPolicy object itself. - */ - public ApplicationGatewaySslPolicy withPolicyName(ApplicationGatewaySslPolicyName policyName) { - this.policyName = policyName; - return this; - } - - /** - * Get the cipherSuites property: Ssl cipher suites to be enabled in the specified order to application gateway. - * - * @return the cipherSuites value. - */ - public List cipherSuites() { - return this.cipherSuites; - } - - /** - * Set the cipherSuites property: Ssl cipher suites to be enabled in the specified order to application gateway. - * - * @param cipherSuites the cipherSuites value to set. - * @return the ApplicationGatewaySslPolicy object itself. - */ - public ApplicationGatewaySslPolicy withCipherSuites(List cipherSuites) { - this.cipherSuites = cipherSuites; - return this; - } - - /** - * Get the minProtocolVersion property: Minimum version of Ssl protocol to be supported on application gateway. - * - * @return the minProtocolVersion value. - */ - public ApplicationGatewaySslProtocol minProtocolVersion() { - return this.minProtocolVersion; - } - - /** - * Set the minProtocolVersion property: Minimum version of Ssl protocol to be supported on application gateway. - * - * @param minProtocolVersion the minProtocolVersion value to set. - * @return the ApplicationGatewaySslPolicy object itself. - */ - public ApplicationGatewaySslPolicy withMinProtocolVersion(ApplicationGatewaySslProtocol minProtocolVersion) { - this.minProtocolVersion = minProtocolVersion; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewaySslPolicyName.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewaySslPolicyName.java deleted file mode 100644 index c4ebb4d600b7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewaySslPolicyName.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ApplicationGatewaySslPolicyName. */ -public final class ApplicationGatewaySslPolicyName extends ExpandableStringEnum { - /** Static value AppGwSslPolicy20150501 for ApplicationGatewaySslPolicyName. */ - public static final ApplicationGatewaySslPolicyName APP_GW_SSL_POLICY20150501 = - fromString("AppGwSslPolicy20150501"); - - /** Static value AppGwSslPolicy20170401 for ApplicationGatewaySslPolicyName. */ - public static final ApplicationGatewaySslPolicyName APP_GW_SSL_POLICY20170401 = - fromString("AppGwSslPolicy20170401"); - - /** Static value AppGwSslPolicy20170401S for ApplicationGatewaySslPolicyName. */ - public static final ApplicationGatewaySslPolicyName APP_GW_SSL_POLICY20170401S = - fromString("AppGwSslPolicy20170401S"); - - /** - * Creates or finds a ApplicationGatewaySslPolicyName from its string representation. - * - * @param name a name to look for. - * @return the corresponding ApplicationGatewaySslPolicyName. - */ - @JsonCreator - public static ApplicationGatewaySslPolicyName fromString(String name) { - return fromString(name, ApplicationGatewaySslPolicyName.class); - } - - /** @return known ApplicationGatewaySslPolicyName values. */ - public static Collection values() { - return values(ApplicationGatewaySslPolicyName.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewaySslPolicyType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewaySslPolicyType.java deleted file mode 100644 index 2a60038fdddf..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewaySslPolicyType.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ApplicationGatewaySslPolicyType. */ -public final class ApplicationGatewaySslPolicyType extends ExpandableStringEnum { - /** Static value Predefined for ApplicationGatewaySslPolicyType. */ - public static final ApplicationGatewaySslPolicyType PREDEFINED = fromString("Predefined"); - - /** Static value Custom for ApplicationGatewaySslPolicyType. */ - public static final ApplicationGatewaySslPolicyType CUSTOM = fromString("Custom"); - - /** - * Creates or finds a ApplicationGatewaySslPolicyType from its string representation. - * - * @param name a name to look for. - * @return the corresponding ApplicationGatewaySslPolicyType. - */ - @JsonCreator - public static ApplicationGatewaySslPolicyType fromString(String name) { - return fromString(name, ApplicationGatewaySslPolicyType.class); - } - - /** @return known ApplicationGatewaySslPolicyType values. */ - public static Collection values() { - return values(ApplicationGatewaySslPolicyType.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewaySslProtocol.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewaySslProtocol.java deleted file mode 100644 index db85e4957b1b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewaySslProtocol.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ApplicationGatewaySslProtocol. */ -public final class ApplicationGatewaySslProtocol extends ExpandableStringEnum { - /** Static value TLSv1_0 for ApplicationGatewaySslProtocol. */ - public static final ApplicationGatewaySslProtocol TLSV1_0 = fromString("TLSv1_0"); - - /** Static value TLSv1_1 for ApplicationGatewaySslProtocol. */ - public static final ApplicationGatewaySslProtocol TLSV1_1 = fromString("TLSv1_1"); - - /** Static value TLSv1_2 for ApplicationGatewaySslProtocol. */ - public static final ApplicationGatewaySslProtocol TLSV1_2 = fromString("TLSv1_2"); - - /** - * Creates or finds a ApplicationGatewaySslProtocol from its string representation. - * - * @param name a name to look for. - * @return the corresponding ApplicationGatewaySslProtocol. - */ - @JsonCreator - public static ApplicationGatewaySslProtocol fromString(String name) { - return fromString(name, ApplicationGatewaySslProtocol.class); - } - - /** @return known ApplicationGatewaySslProtocol values. */ - public static Collection values() { - return values(ApplicationGatewaySslProtocol.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayTier.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayTier.java deleted file mode 100644 index f8101ec7c167..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayTier.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ApplicationGatewayTier. */ -public final class ApplicationGatewayTier extends ExpandableStringEnum { - /** Static value Standard for ApplicationGatewayTier. */ - public static final ApplicationGatewayTier STANDARD = fromString("Standard"); - - /** Static value WAF for ApplicationGatewayTier. */ - public static final ApplicationGatewayTier WAF = fromString("WAF"); - - /** Static value Standard_v2 for ApplicationGatewayTier. */ - public static final ApplicationGatewayTier STANDARD_V2 = fromString("Standard_v2"); - - /** Static value WAF_v2 for ApplicationGatewayTier. */ - public static final ApplicationGatewayTier WAF_V2 = fromString("WAF_v2"); - - /** - * Creates or finds a ApplicationGatewayTier from its string representation. - * - * @param name a name to look for. - * @return the corresponding ApplicationGatewayTier. - */ - @JsonCreator - public static ApplicationGatewayTier fromString(String name) { - return fromString(name, ApplicationGatewayTier.class); - } - - /** @return known ApplicationGatewayTier values. */ - public static Collection values() { - return values(ApplicationGatewayTier.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayTrustedRootCertificate.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayTrustedRootCertificate.java deleted file mode 100644 index fa1df1d71c41..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayTrustedRootCertificate.java +++ /dev/null @@ -1,203 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.ApplicationGatewayTrustedRootCertificatePropertiesFormat; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Trusted Root certificates of an application gateway. */ -@Fluent -public final class ApplicationGatewayTrustedRootCertificate extends SubResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayTrustedRootCertificate.class); - - /* - * Trusted Root certificates properties of an application gateway. - */ - @JsonProperty(value = "properties") - private ApplicationGatewayTrustedRootCertificatePropertiesFormat innerProperties; - - /* - * Name of the trusted root certificate that is unique within an - * Application Gateway. - */ - @JsonProperty(value = "name") - private String name; - - /* - * A unique read-only string that changes whenever the resource is updated. - */ - @JsonProperty(value = "etag") - private String etag; - - /* - * Type of the resource. - */ - @JsonProperty(value = "type") - private String type; - - /** - * Get the innerProperties property: Trusted Root certificates properties of an application gateway. - * - * @return the innerProperties value. - */ - private ApplicationGatewayTrustedRootCertificatePropertiesFormat innerProperties() { - return this.innerProperties; - } - - /** - * Get the name property: Name of the trusted root certificate that is unique within an Application Gateway. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Name of the trusted root certificate that is unique within an Application Gateway. - * - * @param name the name value to set. - * @return the ApplicationGatewayTrustedRootCertificate object itself. - */ - public ApplicationGatewayTrustedRootCertificate withName(String name) { - this.name = name; - return this; - } - - /** - * Get the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @param etag the etag value to set. - * @return the ApplicationGatewayTrustedRootCertificate object itself. - */ - public ApplicationGatewayTrustedRootCertificate withEtag(String etag) { - this.etag = etag; - return this; - } - - /** - * Get the type property: Type of the resource. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Set the type property: Type of the resource. - * - * @param type the type value to set. - * @return the ApplicationGatewayTrustedRootCertificate object itself. - */ - public ApplicationGatewayTrustedRootCertificate withType(String type) { - this.type = type; - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicationGatewayTrustedRootCertificate withId(String id) { - super.withId(id); - return this; - } - - /** - * Get the data property: Certificate public data. - * - * @return the data value. - */ - public String data() { - return this.innerProperties() == null ? null : this.innerProperties().data(); - } - - /** - * Set the data property: Certificate public data. - * - * @param data the data value to set. - * @return the ApplicationGatewayTrustedRootCertificate object itself. - */ - public ApplicationGatewayTrustedRootCertificate withData(String data) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayTrustedRootCertificatePropertiesFormat(); - } - this.innerProperties().withData(data); - return this; - } - - /** - * Get the keyVaultSecretId property: Secret Id of (base-64 encoded unencrypted pfx) 'Secret' or 'Certificate' - * object stored in KeyVault. - * - * @return the keyVaultSecretId value. - */ - public String keyVaultSecretId() { - return this.innerProperties() == null ? null : this.innerProperties().keyVaultSecretId(); - } - - /** - * Set the keyVaultSecretId property: Secret Id of (base-64 encoded unencrypted pfx) 'Secret' or 'Certificate' - * object stored in KeyVault. - * - * @param keyVaultSecretId the keyVaultSecretId value to set. - * @return the ApplicationGatewayTrustedRootCertificate object itself. - */ - public ApplicationGatewayTrustedRootCertificate withKeyVaultSecretId(String keyVaultSecretId) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayTrustedRootCertificatePropertiesFormat(); - } - this.innerProperties().withKeyVaultSecretId(keyVaultSecretId); - return this; - } - - /** - * Get the provisioningState property: Provisioning state of the trusted root certificate resource. Possible values - * are: 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Set the provisioningState property: Provisioning state of the trusted root certificate resource. Possible values - * are: 'Updating', 'Deleting', and 'Failed'. - * - * @param provisioningState the provisioningState value to set. - * @return the ApplicationGatewayTrustedRootCertificate object itself. - */ - public ApplicationGatewayTrustedRootCertificate withProvisioningState(String provisioningState) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGatewayTrustedRootCertificatePropertiesFormat(); - } - this.innerProperties().withProvisioningState(provisioningState); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayUrlPathMap.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayUrlPathMap.java deleted file mode 100644 index 58874ec67254..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayUrlPathMap.java +++ /dev/null @@ -1,381 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.network.fluent.models.ApplicationGatewayUrlPathMapInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.ChildResource; -import com.azure.resourcemanager.resources.fluentcore.model.Attachable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.model.Settable; -import java.util.Map; - -/** A client-side representation of an application gateway's URL path map. */ -@Fluent -public interface ApplicationGatewayUrlPathMap - extends HasInnerModel, ChildResource { - - /** @return default backend address pool */ - ApplicationGatewayBackend defaultBackend(); - - /** @return default backend HTTP settings configuration */ - ApplicationGatewayBackendHttpConfiguration defaultBackendHttpConfiguration(); - - /** @return default redirect configuration */ - ApplicationGatewayRedirectConfiguration defaultRedirectConfiguration(); - - /** @return path rules of URL path map resource */ - Map pathRules(); - - /** Grouping of application gateway URL path map definition stages. */ - interface DefinitionStages { - /** - * The first stage of an application gateway URL path map definition. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface Blank extends WithListener { - } - - /** - * The stage of an application gateway URL path map definition allowing to specify an existing listener to - * associate the URL path map with. - * - * @param the stage of the application gateway definition to return to after attaching this definition - */ - interface WithListener { - /** - * Associates the application gateway URL path map with a frontend listener. - * - *

    If the listener with the specified name does not yet exist, it must be defined separately in the - * optional stages of the application gateway definition. This only adds a reference to the listener by its - * name. - * - *

    Also, note that a given listener can be used by no more than one request routing rule at a time. - * - * @param name the name of a listener to reference - * @return the next stage of the definition - */ - WithBackendHttpConfiguration fromListener(String name); - } - - /** - * The stage of an application gateway URL path map definition allowing to specify the backend HTTP settings - * configuration to associate the routing rule with. - * - * @param the stage of the application gateway definition to return to after attaching this definition - */ - interface WithBackendHttpConfiguration { - /** - * Associates the specified backend HTTP settings configuration with this application gateway URL path map. - * - *

    If the backend configuration does not exist yet, it must be defined in the optional part of the - * application gateway definition. The request routing rule references it only by name. - * - * @param name the name of a backend HTTP settings configuration - * @return the next stage of the definition - */ - WithBackend toBackendHttpConfiguration(String name); - - /** - * Creates a backend HTTP settings configuration for the specified backend port and the HTTP protocol, and - * associates it with this URL path map. - * - *

    An auto-generated name will be used for this newly created configuration. - * - * @param portNumber the port number for a new backend HTTP settings configuration - * @return the next stage of the definition - */ - WithBackend toBackendHttpPort(int portNumber); - } - - /** - * The stage of an application gateway URL path map definition allowing to specify the backend to associate the - * URL path map with. - * - * @param the stage of the application gateway definition to return to after attaching this definition - */ - interface WithBackend { - /** - * Associates the URL path map with a backend on this application gateway. - * - *

    If the backend does not yet exist, it will be automatically created. - * - * @param name the name of an existing backend - * @return the next stage of the definition - */ - WithPathRule toBackend(String name); - } - - /** - * The stage of an application gateway URL path map definition allowing to associate the URL path map with a - * redirect configuration. - * - * @param the stage of the application gateway definition to return to after attaching this definition - */ - interface WithRedirectConfig { - /** - * Associates the specified redirect configuration with this URL path map. - * - * @param name the name of a redirect configuration on this application gateway - * @return the next stage of the definition - */ - WithAttach withRedirectConfiguration(String name); - } - - /** - * The stage of an application gateway URL path map definition allowing to specify path rules. - * - * @param the stage of the application gateway definition to return to after attaching this definition - */ - interface WithPathRule { - /** - * Begins the definition of path rule. - * - * @param name name of the path rule - * @return next stage of the path rule definition - */ - ApplicationGatewayPathRule.DefinitionStages.Blank> definePathRule(String name); - } - - /** - * The final stage of an application gateway URL path map definition. - * - *

    At this stage, any remaining optional settings can be specified, or the definition can be attached to the - * parent application gateway definition. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface WithAttach - extends Attachable.InDefinition, WithPathRule, WithRedirectConfig { - } - } - - /** - * The entirety of an application gateway URL path map definition. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithBackendHttpConfiguration, - DefinitionStages.WithBackend, - DefinitionStages.WithPathRule, - DefinitionStages.WithAttach { - } - - /** The entirety of an application gateway URL path map update as part of an application gateway update. */ - interface Update extends Settable { - } - - /** - * Grouping of application gateway URL path map definition stages applicable as part of an application gateway - * update. - */ - interface UpdateDefinitionStages { - /** - * The first stage of an application gateway URL path map definition. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface Blank extends WithListener { - } - - /** - * The stage of an application gateway URL path map definition allowing to specify an existing listener to - * associate the URL path map with. - * - * @param the stage of the application gateway definition to return to after attaching this definition - */ - interface WithListener { - /** - * Associates the URL path map with a frontend listener. - * - *

    If the listener with the specified name does not yet exist, it must be defined separately in the - * optional stages of the application gateway definition. This only adds a reference to the listener by its - * name. - * - *

    Also, note that a given listener can be used by no more than one request routing rule at a time. - * - * @param name the name of a listener to reference - * @return the next stage of the definition - */ - WithBackendHttpConfiguration fromListener(String name); - } - - /** - * The stage of an application gateway URL path map definition allowing to specify the backend HTTP settings - * configuration to associate the URL path map with. - * - * @param the stage of the application gateway definition to return to after attaching this definition - */ - interface WithBackendHttpConfiguration { - /** - * Associates the specified backend HTTP settings configuration with this URL path map. - * - *

    If the backend configuration does not exist yet, it must be defined in the optional part of the - * application gateway definition. The URL path map references it only by name. - * - * @param name the name of a backend HTTP settings configuration - * @return the next stage of the definition - */ - WithBackend toBackendHttpConfiguration(String name); - - /** - * Creates a backend HTTP settings configuration for the specified backend port and the HTTP protocol, and - * associates it with this URL path map. - * - *

    An auto-generated name will be used for this newly created configuration. - * - * @param portNumber the port number for a new backend HTTP settings configuration - * @return the next stage of the definition - */ - WithBackendOrAddress toBackendHttpPort(int portNumber); - } - - /** - * The stage of an application gateway URL path map definition allowing to add an address to specify an existing - * backend to associate with this URL path map or create a new backend with an auto-generated name and addresses - * to it. - * - * @param the stage of the application gateway definition to return to after attaching this definition - */ - interface WithBackendOrAddress extends WithBackend, WithBackendAddress { - } - - /** - * The stage of an application gateway URL path map definition allowing to add an address to the backend used by - * this URL path map. - * - *

    A new backend will be created if none is associated with this rule yet. - * - * @param the stage of the application gateway definition to return to after attaching this definition - */ - interface WithBackendAddress { - /** - * Adds an IP address to the backend associated with this URL path map. - * - *

    If no backend has been associated with this URL path map yet, a new one will be created with an - * auto-generated name. - * - *

    This call can be used in a sequence to add multiple IP addresses. - * - * @param ipAddress an IP address - * @return the next stage of the definition - */ - WithBackendAddressOrPath toBackendIPAddress(String ipAddress); - - /** - * Adds the specified IP addresses to the backend associated with this URL path map. - * - * @param ipAddresses IP addresses to add - * @return the next stage of the definition - */ - WithBackendAddressOrPath toBackendIPAddresses(String... ipAddresses); - - /** - * Adds an FQDN (fully qualified domain name) to the backend associated with this URL path map. - * - *

    If no backend has been associated with this URL path map yet, a new one will be created with an - * auto-generated name. - * - *

    This call can be used in a sequence to add multiple FQDNs. - * - * @param fqdn a fully qualified domain name - * @return the next stage of the definition - */ - WithBackendAddressOrPath toBackendFqdn(String fqdn); - } - - /** - * The stage of an application gateway URL path map definition allowing to add more backend addresses, start - * specifying optional settings, or finish the definition by attaching it to the parent application gateway. - * - * @param the stage of the application gateway definition to return to after attaching this definition - */ - interface WithBackendAddressOrPath extends WithBackendAddress, WithPathRule { - } - - /** - * The stage of an application gateway URL path map definition allowing to specify the backend to associate the - * URL path map with. - * - * @param the stage of the application gateway definition to return to after attaching this definition - */ - interface WithBackend { - /** - * Associates the URL path map with a backend on this application gateway. - * - *

    If the backend does not yet exist, it will be automatically created. - * - * @param name the name of an existing backend - * @return the next stage of the definition - */ - WithPathRule toBackend(String name); - } - - /** - * The stage of an application gateway URL path map definition allowing to specify the path rule to associate - * the URL path map with. - * - * @param the stage of the application gateway definition to return to after attaching this definition - */ - interface WithPathRule { - /** - * Associates the URL path map with a path rule on this application gateway. - * - * @param name the name of an existing path rule - * @return the next stage of the definition - */ - ApplicationGatewayPathRule.UpdateDefinitionStages.Blank> definePathRule(String name); - } - - /** - * The stage of an application gateway URL path map definition allowing to associate the URL path map with a - * redirect configuration. - * - * @param the stage of the application gateway definition to return to after attaching this definition - */ - interface WithRedirectConfig { - /** - * Associates the specified redirect configuration with this request routing rule. - * - * @param name the name of a redirect configuration on this application gateway - * @return the next stage of the definition - */ - WithAttach withRedirectConfiguration(String name); - } - - /** - * The final stage of an application gateway URL path map definition. - * - *

    At this stage, any remaining optional settings can be specified, or the definition can be attached to the - * parent application gateway definition. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface WithAttach - extends Attachable.InDefinitionAlt, WithPathRule, WithRedirectConfig { - } - } - - /** - * The entirety of an application gateway URL path map definition as part of an application gateway update. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface UpdateDefinition - extends UpdateDefinitionStages.Blank, - UpdateDefinitionStages.WithBackendOrAddress, - UpdateDefinitionStages.WithBackendHttpConfiguration, - UpdateDefinitionStages.WithBackendAddressOrPath, - UpdateDefinitionStages.WithPathRule, - UpdateDefinitionStages.WithAttach { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayWebApplicationFirewallConfiguration.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayWebApplicationFirewallConfiguration.java deleted file mode 100644 index f0c082d26e61..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGatewayWebApplicationFirewallConfiguration.java +++ /dev/null @@ -1,318 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Application gateway web application firewall configuration. */ -@Fluent -public final class ApplicationGatewayWebApplicationFirewallConfiguration { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(ApplicationGatewayWebApplicationFirewallConfiguration.class); - - /* - * Whether the web application firewall is enabled or not. - */ - @JsonProperty(value = "enabled", required = true) - private boolean enabled; - - /* - * Web application firewall mode. - */ - @JsonProperty(value = "firewallMode", required = true) - private ApplicationGatewayFirewallMode firewallMode; - - /* - * The type of the web application firewall rule set. Possible values are: - * 'OWASP'. - */ - @JsonProperty(value = "ruleSetType", required = true) - private String ruleSetType; - - /* - * The version of the rule set type. - */ - @JsonProperty(value = "ruleSetVersion", required = true) - private String ruleSetVersion; - - /* - * The disabled rule groups. - */ - @JsonProperty(value = "disabledRuleGroups") - private List disabledRuleGroups; - - /* - * Whether allow WAF to check request Body. - */ - @JsonProperty(value = "requestBodyCheck") - private Boolean requestBodyCheck; - - /* - * Maximum request body size for WAF. - */ - @JsonProperty(value = "maxRequestBodySize") - private Integer maxRequestBodySize; - - /* - * Maximum request body size in Kb for WAF. - */ - @JsonProperty(value = "maxRequestBodySizeInKb") - private Integer maxRequestBodySizeInKb; - - /* - * Maximum file upload size in Mb for WAF. - */ - @JsonProperty(value = "fileUploadLimitInMb") - private Integer fileUploadLimitInMb; - - /* - * The exclusion list. - */ - @JsonProperty(value = "exclusions") - private List exclusions; - - /** - * Get the enabled property: Whether the web application firewall is enabled or not. - * - * @return the enabled value. - */ - public boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Whether the web application firewall is enabled or not. - * - * @param enabled the enabled value to set. - * @return the ApplicationGatewayWebApplicationFirewallConfiguration object itself. - */ - public ApplicationGatewayWebApplicationFirewallConfiguration withEnabled(boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the firewallMode property: Web application firewall mode. - * - * @return the firewallMode value. - */ - public ApplicationGatewayFirewallMode firewallMode() { - return this.firewallMode; - } - - /** - * Set the firewallMode property: Web application firewall mode. - * - * @param firewallMode the firewallMode value to set. - * @return the ApplicationGatewayWebApplicationFirewallConfiguration object itself. - */ - public ApplicationGatewayWebApplicationFirewallConfiguration withFirewallMode( - ApplicationGatewayFirewallMode firewallMode) { - this.firewallMode = firewallMode; - return this; - } - - /** - * Get the ruleSetType property: The type of the web application firewall rule set. Possible values are: 'OWASP'. - * - * @return the ruleSetType value. - */ - public String ruleSetType() { - return this.ruleSetType; - } - - /** - * Set the ruleSetType property: The type of the web application firewall rule set. Possible values are: 'OWASP'. - * - * @param ruleSetType the ruleSetType value to set. - * @return the ApplicationGatewayWebApplicationFirewallConfiguration object itself. - */ - public ApplicationGatewayWebApplicationFirewallConfiguration withRuleSetType(String ruleSetType) { - this.ruleSetType = ruleSetType; - return this; - } - - /** - * Get the ruleSetVersion property: The version of the rule set type. - * - * @return the ruleSetVersion value. - */ - public String ruleSetVersion() { - return this.ruleSetVersion; - } - - /** - * Set the ruleSetVersion property: The version of the rule set type. - * - * @param ruleSetVersion the ruleSetVersion value to set. - * @return the ApplicationGatewayWebApplicationFirewallConfiguration object itself. - */ - public ApplicationGatewayWebApplicationFirewallConfiguration withRuleSetVersion(String ruleSetVersion) { - this.ruleSetVersion = ruleSetVersion; - return this; - } - - /** - * Get the disabledRuleGroups property: The disabled rule groups. - * - * @return the disabledRuleGroups value. - */ - public List disabledRuleGroups() { - return this.disabledRuleGroups; - } - - /** - * Set the disabledRuleGroups property: The disabled rule groups. - * - * @param disabledRuleGroups the disabledRuleGroups value to set. - * @return the ApplicationGatewayWebApplicationFirewallConfiguration object itself. - */ - public ApplicationGatewayWebApplicationFirewallConfiguration withDisabledRuleGroups( - List disabledRuleGroups) { - this.disabledRuleGroups = disabledRuleGroups; - return this; - } - - /** - * Get the requestBodyCheck property: Whether allow WAF to check request Body. - * - * @return the requestBodyCheck value. - */ - public Boolean requestBodyCheck() { - return this.requestBodyCheck; - } - - /** - * Set the requestBodyCheck property: Whether allow WAF to check request Body. - * - * @param requestBodyCheck the requestBodyCheck value to set. - * @return the ApplicationGatewayWebApplicationFirewallConfiguration object itself. - */ - public ApplicationGatewayWebApplicationFirewallConfiguration withRequestBodyCheck(Boolean requestBodyCheck) { - this.requestBodyCheck = requestBodyCheck; - return this; - } - - /** - * Get the maxRequestBodySize property: Maximum request body size for WAF. - * - * @return the maxRequestBodySize value. - */ - public Integer maxRequestBodySize() { - return this.maxRequestBodySize; - } - - /** - * Set the maxRequestBodySize property: Maximum request body size for WAF. - * - * @param maxRequestBodySize the maxRequestBodySize value to set. - * @return the ApplicationGatewayWebApplicationFirewallConfiguration object itself. - */ - public ApplicationGatewayWebApplicationFirewallConfiguration withMaxRequestBodySize(Integer maxRequestBodySize) { - this.maxRequestBodySize = maxRequestBodySize; - return this; - } - - /** - * Get the maxRequestBodySizeInKb property: Maximum request body size in Kb for WAF. - * - * @return the maxRequestBodySizeInKb value. - */ - public Integer maxRequestBodySizeInKb() { - return this.maxRequestBodySizeInKb; - } - - /** - * Set the maxRequestBodySizeInKb property: Maximum request body size in Kb for WAF. - * - * @param maxRequestBodySizeInKb the maxRequestBodySizeInKb value to set. - * @return the ApplicationGatewayWebApplicationFirewallConfiguration object itself. - */ - public ApplicationGatewayWebApplicationFirewallConfiguration withMaxRequestBodySizeInKb( - Integer maxRequestBodySizeInKb) { - this.maxRequestBodySizeInKb = maxRequestBodySizeInKb; - return this; - } - - /** - * Get the fileUploadLimitInMb property: Maximum file upload size in Mb for WAF. - * - * @return the fileUploadLimitInMb value. - */ - public Integer fileUploadLimitInMb() { - return this.fileUploadLimitInMb; - } - - /** - * Set the fileUploadLimitInMb property: Maximum file upload size in Mb for WAF. - * - * @param fileUploadLimitInMb the fileUploadLimitInMb value to set. - * @return the ApplicationGatewayWebApplicationFirewallConfiguration object itself. - */ - public ApplicationGatewayWebApplicationFirewallConfiguration withFileUploadLimitInMb(Integer fileUploadLimitInMb) { - this.fileUploadLimitInMb = fileUploadLimitInMb; - return this; - } - - /** - * Get the exclusions property: The exclusion list. - * - * @return the exclusions value. - */ - public List exclusions() { - return this.exclusions; - } - - /** - * Set the exclusions property: The exclusion list. - * - * @param exclusions the exclusions value to set. - * @return the ApplicationGatewayWebApplicationFirewallConfiguration object itself. - */ - public ApplicationGatewayWebApplicationFirewallConfiguration withExclusions( - List exclusions) { - this.exclusions = exclusions; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (firewallMode() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property firewallMode in model" - + " ApplicationGatewayWebApplicationFirewallConfiguration")); - } - if (ruleSetType() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property ruleSetType in model" - + " ApplicationGatewayWebApplicationFirewallConfiguration")); - } - if (ruleSetVersion() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property ruleSetVersion in model" - + " ApplicationGatewayWebApplicationFirewallConfiguration")); - } - if (disabledRuleGroups() != null) { - disabledRuleGroups().forEach(e -> e.validate()); - } - if (exclusions() != null) { - exclusions().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGateways.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGateways.java deleted file mode 100644 index 792a2189e3ab..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationGateways.java +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsBatchDeletion; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsDeletingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsListingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsBatchCreation; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsCreating; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingById; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; -import reactor.core.publisher.Flux; - -import java.util.Collection; - -/** Entry point to application gateway management API in Azure. */ -@Fluent() -public interface ApplicationGateways - extends SupportsCreating, - SupportsListing, - SupportsListingByResourceGroup, - SupportsGettingByResourceGroup, - SupportsGettingById, - SupportsDeletingById, - SupportsDeletingByResourceGroup, - SupportsBatchCreation, - SupportsBatchDeletion, - HasManager { - - /** - * Starts the specified application gateways. - * - * @param ids application gateway resource ids - */ - void start(String... ids); - - /** - * Starts the specified application gateways. - * - * @param ids application gateway resource ids - */ - void start(Collection ids); - - /** - * Starts the specified application gateways in parallel asynchronously. - * - * @param ids application gateway resource id - * @return an emitter of the resource ID for each successfully started application gateway - */ - Flux startAsync(String... ids); - - /** - * Starts the specified application gateways in parallel asynchronously. - * - * @param ids application gateway resource id - * @return an emitter of the resource ID for each successfully started application gateway - */ - Flux startAsync(Collection ids); - - /** - * Stops the specified application gateways. - * - * @param ids application gateway resource ids - */ - void stop(String... ids); - - /** - * Stops the specified application gateways. - * - * @param ids application gateway resource ids - */ - void stop(Collection ids); - - /** - * Stops the specified application gateways in parallel asynchronously. - * - * @param ids application gateway resource ids - * @return an emitter of the resource ID for each successfully stopped application gateway - */ - Flux stopAsync(String... ids); - - /** - * Stops the specified application gateways in parallel asynchronously. - * - * @param ids application gateway resource id - * @return an emitter of the resource ID for each successfully stopped application gateway - */ - Flux stopAsync(Collection ids); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationSecurityGroup.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationSecurityGroup.java deleted file mode 100644 index 2e98ee0fcb7c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationSecurityGroup.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.network.fluent.models.ApplicationSecurityGroupInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.GroupableResource; -import com.azure.resourcemanager.resources.fluentcore.arm.models.Resource; -import com.azure.resourcemanager.resources.fluentcore.model.Appliable; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; -import com.azure.resourcemanager.resources.fluentcore.model.Updatable; - -/** Application security group. */ -@Fluent -public interface ApplicationSecurityGroup - extends GroupableResource, - Refreshable, - Updatable { - /** - * @return the resource GUID property of the application security group resource. It uniquely identifies a resource, - * even if the user changes its name or migrate the resource across subscriptions or resource groups. - */ - String resourceGuid(); - - /** @return the provisioning state of the application security group resource */ - String provisioningState(); - - // Fluent interfaces for creating Application Security Groups - - /** The entirety of the application security group definition. */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { - } - - /** Grouping of application security group definition stages. */ - interface DefinitionStages { - /** The first stage of the definition. */ - interface Blank extends GroupableResource.DefinitionWithRegion { - } - - /** The stage allowing to specify the resource group. */ - interface WithGroup extends GroupableResource.DefinitionStages.WithGroup { - } - - /** - * The stage of the definition which contains all the minimum required inputs for the resource to be created - * (via {@link WithCreate#create()}), but also allows for any other optional settings to be specified. - */ - interface WithCreate extends Creatable, Resource.DefinitionWithTags { - } - } - - /** - * The template for an update operation, containing all the settings that can be modified. - * - *

    Call {@link Update#apply()} to apply the changes to the resource in Azure. - */ - interface Update extends Appliable, Resource.UpdateWithTags { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationSecurityGroupListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationSecurityGroupListResult.java deleted file mode 100644 index 71b58cd50a53..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationSecurityGroupListResult.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.ApplicationSecurityGroupInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** A list of application security groups. */ -@Fluent -public final class ApplicationSecurityGroupListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationSecurityGroupListResult.class); - - /* - * A list of application security groups. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to get the next set of results. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: A list of application security groups. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: A list of application security groups. - * - * @param value the value value to set. - * @return the ApplicationSecurityGroupListResult object itself. - */ - public ApplicationSecurityGroupListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to get the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationSecurityGroups.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationSecurityGroups.java deleted file mode 100644 index 5722a6dc58ec..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ApplicationSecurityGroups.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsBatchDeletion; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsDeletingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsListingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsBatchCreation; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsCreating; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingById; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; - -/** Entry point to application security group management. */ -@Fluent -public interface ApplicationSecurityGroups - extends SupportsCreating, - SupportsListing, - SupportsListingByResourceGroup, - SupportsGettingByResourceGroup, - SupportsGettingById, - SupportsDeletingById, - SupportsDeletingByResourceGroup, - SupportsBatchCreation, - SupportsBatchDeletion, - HasManager { -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AssociationType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AssociationType.java deleted file mode 100644 index 16364202caf6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AssociationType.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for AssociationType. */ -public final class AssociationType extends ExpandableStringEnum { - /** Static value Associated for AssociationType. */ - public static final AssociationType ASSOCIATED = fromString("Associated"); - - /** Static value Contains for AssociationType. */ - public static final AssociationType CONTAINS = fromString("Contains"); - - /** - * Creates or finds a AssociationType from its string representation. - * - * @param name a name to look for. - * @return the corresponding AssociationType. - */ - @JsonCreator - public static AssociationType fromString(String name) { - return fromString(name, AssociationType.class); - } - - /** @return known AssociationType values. */ - public static Collection values() { - return values(AssociationType.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AuthenticationMethod.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AuthenticationMethod.java deleted file mode 100644 index 816329496734..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AuthenticationMethod.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for AuthenticationMethod. */ -public final class AuthenticationMethod extends ExpandableStringEnum { - /** Static value EAPTLS for AuthenticationMethod. */ - public static final AuthenticationMethod EAPTLS = fromString("EAPTLS"); - - /** Static value EAPMSCHAPv2 for AuthenticationMethod. */ - public static final AuthenticationMethod EAPMSCHAPV2 = fromString("EAPMSCHAPv2"); - - /** - * Creates or finds a AuthenticationMethod from its string representation. - * - * @param name a name to look for. - * @return the corresponding AuthenticationMethod. - */ - @JsonCreator - public static AuthenticationMethod fromString(String name) { - return fromString(name, AuthenticationMethod.class); - } - - /** @return known AuthenticationMethod values. */ - public static Collection values() { - return values(AuthenticationMethod.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AuthorizationListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AuthorizationListResult.java deleted file mode 100644 index 7e57d1fe4d06..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AuthorizationListResult.java +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.ExpressRouteCircuitAuthorizationInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** - * Response for ListAuthorizations API service call retrieves all authorizations that belongs to an ExpressRouteCircuit. - */ -@Fluent -public final class AuthorizationListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AuthorizationListResult.class); - - /* - * The authorizations in an ExpressRoute Circuit. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to get the next set of results. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: The authorizations in an ExpressRoute Circuit. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The authorizations in an ExpressRoute Circuit. - * - * @param value the value value to set. - * @return the AuthorizationListResult object itself. - */ - public AuthorizationListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to get the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The URL to get the next set of results. - * - * @param nextLink the nextLink value to set. - * @return the AuthorizationListResult object itself. - */ - public AuthorizationListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AuthorizationUseStatus.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AuthorizationUseStatus.java deleted file mode 100644 index 38911a9486fe..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AuthorizationUseStatus.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for AuthorizationUseStatus. */ -public final class AuthorizationUseStatus extends ExpandableStringEnum { - /** Static value Available for AuthorizationUseStatus. */ - public static final AuthorizationUseStatus AVAILABLE = fromString("Available"); - - /** Static value InUse for AuthorizationUseStatus. */ - public static final AuthorizationUseStatus IN_USE = fromString("InUse"); - - /** - * Creates or finds a AuthorizationUseStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding AuthorizationUseStatus. - */ - @JsonCreator - public static AuthorizationUseStatus fromString(String name) { - return fromString(name, AuthorizationUseStatus.class); - } - - /** @return known AuthorizationUseStatus values. */ - public static Collection values() { - return values(AuthorizationUseStatus.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/Availability.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/Availability.java deleted file mode 100644 index 68c902bffc01..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/Availability.java +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Availability of the metric. */ -@Fluent -public final class Availability { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Availability.class); - - /* - * The time grain of the availability. - */ - @JsonProperty(value = "timeGrain") - private String timeGrain; - - /* - * The retention of the availability. - */ - @JsonProperty(value = "retention") - private String retention; - - /* - * Duration of the availability blob. - */ - @JsonProperty(value = "blobDuration") - private String blobDuration; - - /** - * Get the timeGrain property: The time grain of the availability. - * - * @return the timeGrain value. - */ - public String timeGrain() { - return this.timeGrain; - } - - /** - * Set the timeGrain property: The time grain of the availability. - * - * @param timeGrain the timeGrain value to set. - * @return the Availability object itself. - */ - public Availability withTimeGrain(String timeGrain) { - this.timeGrain = timeGrain; - return this; - } - - /** - * Get the retention property: The retention of the availability. - * - * @return the retention value. - */ - public String retention() { - return this.retention; - } - - /** - * Set the retention property: The retention of the availability. - * - * @param retention the retention value to set. - * @return the Availability object itself. - */ - public Availability withRetention(String retention) { - this.retention = retention; - return this; - } - - /** - * Get the blobDuration property: Duration of the availability blob. - * - * @return the blobDuration value. - */ - public String blobDuration() { - return this.blobDuration; - } - - /** - * Set the blobDuration property: Duration of the availability blob. - * - * @param blobDuration the blobDuration value to set. - * @return the Availability object itself. - */ - public Availability withBlobDuration(String blobDuration) { - this.blobDuration = blobDuration; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AvailableDelegationsResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AvailableDelegationsResult.java deleted file mode 100644 index 8d94a1611c3e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AvailableDelegationsResult.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.AvailableDelegationInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** An array of available delegations. */ -@Fluent -public final class AvailableDelegationsResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailableDelegationsResult.class); - - /* - * An array of available delegations. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to get the next set of results. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: An array of available delegations. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: An array of available delegations. - * - * @param value the value value to set. - * @return the AvailableDelegationsResult object itself. - */ - public AvailableDelegationsResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to get the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AvailableProviders.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AvailableProviders.java deleted file mode 100644 index dc45bbcac3a9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AvailableProviders.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.network.fluent.models.AvailableProvidersListInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasParent; -import com.azure.resourcemanager.resources.fluentcore.model.Executable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import java.util.Map; - -/** An immutable client-side representation of available Internet service providers. */ -@Fluent -public interface AvailableProviders - extends Executable, HasInnerModel, HasParent { - /** @return parameters used to query available internet providers */ - AvailableProvidersListParameters availableProvidersParameters(); - - /** @return read-only map of available internet providers, indexed by country */ - Map providersByCountry(); - - /** The entirety of available providers parameters definition. */ - interface Definition - extends DefinitionStages.WithExecuteAndCountry, - DefinitionStages.WithExecuteAndState, - DefinitionStages.WithExecuteAndCity { - } - - /** Grouping of available providers parameters definition stages. */ - interface DefinitionStages { - /** The first stage of available providers parameters definition. */ - interface WithAzureLocations { - /** - * Set the list of Azure regions. Note: this will overwrite locations if already set. - * - * @param azureLocations locations list - * @return the AvailableProviders object itself. - */ - WithExecute withAzureLocations(String... azureLocations); - - /** - * Sets Azure region name. Note: this method has additive effect. - * - * @param azureLocation region name - * @return the AvailableProviders object itself. - */ - WithExecuteAndCountry withAzureLocation(String azureLocation); - } - - /** - * The stage of the definition which contains all the minimum required inputs for execution, but also allows for - * any other optional settings to be specified. - */ - interface WithExecute extends Executable, DefinitionStages.WithAzureLocations { - } - - /** The stage of the definition which allows to specify country or execute the query. */ - interface WithExecuteAndCountry extends WithExecute { - /** - * @param country the country for available providers list - * @return the next stage of the definition - */ - WithExecuteAndState withCountry(String country); - } - - /** The stage of the definition which allows to specify state or execute the query. */ - interface WithExecuteAndState extends WithExecute { - /** - * @param state the state for available providers list - * @return the next stage of the definition - */ - WithExecuteAndCity withState(String state); - } - - /** The stage of the definition which allows to specify city or execute the query. */ - interface WithExecuteAndCity extends WithExecute { - /** - * @param city the city or town for available providers list - * @return the next stage of the definition - */ - WithExecute withCity(String city); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AvailableProvidersListCity.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AvailableProvidersListCity.java deleted file mode 100644 index 69cb63a1e3c3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AvailableProvidersListCity.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** City or town details. */ -@Fluent -public final class AvailableProvidersListCity { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailableProvidersListCity.class); - - /* - * The city or town name. - */ - @JsonProperty(value = "cityName") - private String cityName; - - /* - * A list of Internet service providers. - */ - @JsonProperty(value = "providers") - private List providers; - - /** - * Get the cityName property: The city or town name. - * - * @return the cityName value. - */ - public String cityName() { - return this.cityName; - } - - /** - * Set the cityName property: The city or town name. - * - * @param cityName the cityName value to set. - * @return the AvailableProvidersListCity object itself. - */ - public AvailableProvidersListCity withCityName(String cityName) { - this.cityName = cityName; - return this; - } - - /** - * Get the providers property: A list of Internet service providers. - * - * @return the providers value. - */ - public List providers() { - return this.providers; - } - - /** - * Set the providers property: A list of Internet service providers. - * - * @param providers the providers value to set. - * @return the AvailableProvidersListCity object itself. - */ - public AvailableProvidersListCity withProviders(List providers) { - this.providers = providers; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AvailableProvidersListCountry.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AvailableProvidersListCountry.java deleted file mode 100644 index e987235c80a2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AvailableProvidersListCountry.java +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Country details. */ -@Fluent -public final class AvailableProvidersListCountry { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailableProvidersListCountry.class); - - /* - * The country name. - */ - @JsonProperty(value = "countryName") - private String countryName; - - /* - * A list of Internet service providers. - */ - @JsonProperty(value = "providers") - private List providers; - - /* - * List of available states in the country. - */ - @JsonProperty(value = "states") - private List states; - - /** - * Get the countryName property: The country name. - * - * @return the countryName value. - */ - public String countryName() { - return this.countryName; - } - - /** - * Set the countryName property: The country name. - * - * @param countryName the countryName value to set. - * @return the AvailableProvidersListCountry object itself. - */ - public AvailableProvidersListCountry withCountryName(String countryName) { - this.countryName = countryName; - return this; - } - - /** - * Get the providers property: A list of Internet service providers. - * - * @return the providers value. - */ - public List providers() { - return this.providers; - } - - /** - * Set the providers property: A list of Internet service providers. - * - * @param providers the providers value to set. - * @return the AvailableProvidersListCountry object itself. - */ - public AvailableProvidersListCountry withProviders(List providers) { - this.providers = providers; - return this; - } - - /** - * Get the states property: List of available states in the country. - * - * @return the states value. - */ - public List states() { - return this.states; - } - - /** - * Set the states property: List of available states in the country. - * - * @param states the states value to set. - * @return the AvailableProvidersListCountry object itself. - */ - public AvailableProvidersListCountry withStates(List states) { - this.states = states; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (states() != null) { - states().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AvailableProvidersListParameters.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AvailableProvidersListParameters.java deleted file mode 100644 index 7c620bbd5fac..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AvailableProvidersListParameters.java +++ /dev/null @@ -1,129 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Constraints that determine the list of available Internet service providers. */ -@Fluent -public final class AvailableProvidersListParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailableProvidersListParameters.class); - - /* - * A list of Azure regions. - */ - @JsonProperty(value = "azureLocations") - private List azureLocations; - - /* - * The country for available providers list. - */ - @JsonProperty(value = "country") - private String country; - - /* - * The state for available providers list. - */ - @JsonProperty(value = "state") - private String state; - - /* - * The city or town for available providers list. - */ - @JsonProperty(value = "city") - private String city; - - /** - * Get the azureLocations property: A list of Azure regions. - * - * @return the azureLocations value. - */ - public List azureLocations() { - return this.azureLocations; - } - - /** - * Set the azureLocations property: A list of Azure regions. - * - * @param azureLocations the azureLocations value to set. - * @return the AvailableProvidersListParameters object itself. - */ - public AvailableProvidersListParameters withAzureLocations(List azureLocations) { - this.azureLocations = azureLocations; - return this; - } - - /** - * Get the country property: The country for available providers list. - * - * @return the country value. - */ - public String country() { - return this.country; - } - - /** - * Set the country property: The country for available providers list. - * - * @param country the country value to set. - * @return the AvailableProvidersListParameters object itself. - */ - public AvailableProvidersListParameters withCountry(String country) { - this.country = country; - return this; - } - - /** - * Get the state property: The state for available providers list. - * - * @return the state value. - */ - public String state() { - return this.state; - } - - /** - * Set the state property: The state for available providers list. - * - * @param state the state value to set. - * @return the AvailableProvidersListParameters object itself. - */ - public AvailableProvidersListParameters withState(String state) { - this.state = state; - return this; - } - - /** - * Get the city property: The city or town for available providers list. - * - * @return the city value. - */ - public String city() { - return this.city; - } - - /** - * Set the city property: The city or town for available providers list. - * - * @param city the city value to set. - * @return the AvailableProvidersListParameters object itself. - */ - public AvailableProvidersListParameters withCity(String city) { - this.city = city; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AvailableProvidersListState.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AvailableProvidersListState.java deleted file mode 100644 index a7695b0df02f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AvailableProvidersListState.java +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** State details. */ -@Fluent -public final class AvailableProvidersListState { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailableProvidersListState.class); - - /* - * The state name. - */ - @JsonProperty(value = "stateName") - private String stateName; - - /* - * A list of Internet service providers. - */ - @JsonProperty(value = "providers") - private List providers; - - /* - * List of available cities or towns in the state. - */ - @JsonProperty(value = "cities") - private List cities; - - /** - * Get the stateName property: The state name. - * - * @return the stateName value. - */ - public String stateName() { - return this.stateName; - } - - /** - * Set the stateName property: The state name. - * - * @param stateName the stateName value to set. - * @return the AvailableProvidersListState object itself. - */ - public AvailableProvidersListState withStateName(String stateName) { - this.stateName = stateName; - return this; - } - - /** - * Get the providers property: A list of Internet service providers. - * - * @return the providers value. - */ - public List providers() { - return this.providers; - } - - /** - * Set the providers property: A list of Internet service providers. - * - * @param providers the providers value to set. - * @return the AvailableProvidersListState object itself. - */ - public AvailableProvidersListState withProviders(List providers) { - this.providers = providers; - return this; - } - - /** - * Get the cities property: List of available cities or towns in the state. - * - * @return the cities value. - */ - public List cities() { - return this.cities; - } - - /** - * Set the cities property: List of available cities or towns in the state. - * - * @param cities the cities value to set. - * @return the AvailableProvidersListState object itself. - */ - public AvailableProvidersListState withCities(List cities) { - this.cities = cities; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (cities() != null) { - cities().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AzureFirewallApplicationRule.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AzureFirewallApplicationRule.java deleted file mode 100644 index 8d42b98c60b8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AzureFirewallApplicationRule.java +++ /dev/null @@ -1,184 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Properties of an application rule. */ -@Fluent -public final class AzureFirewallApplicationRule { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureFirewallApplicationRule.class); - - /* - * Name of the application rule. - */ - @JsonProperty(value = "name") - private String name; - - /* - * Description of the rule. - */ - @JsonProperty(value = "description") - private String description; - - /* - * List of source IP addresses for this rule. - */ - @JsonProperty(value = "sourceAddresses") - private List sourceAddresses; - - /* - * Array of ApplicationRuleProtocols. - */ - @JsonProperty(value = "protocols") - private List protocols; - - /* - * List of FQDNs for this rule. - */ - @JsonProperty(value = "targetFqdns") - private List targetFqdns; - - /* - * List of FQDN Tags for this rule. - */ - @JsonProperty(value = "fqdnTags") - private List fqdnTags; - - /** - * Get the name property: Name of the application rule. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Name of the application rule. - * - * @param name the name value to set. - * @return the AzureFirewallApplicationRule object itself. - */ - public AzureFirewallApplicationRule withName(String name) { - this.name = name; - return this; - } - - /** - * Get the description property: Description of the rule. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: Description of the rule. - * - * @param description the description value to set. - * @return the AzureFirewallApplicationRule object itself. - */ - public AzureFirewallApplicationRule withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the sourceAddresses property: List of source IP addresses for this rule. - * - * @return the sourceAddresses value. - */ - public List sourceAddresses() { - return this.sourceAddresses; - } - - /** - * Set the sourceAddresses property: List of source IP addresses for this rule. - * - * @param sourceAddresses the sourceAddresses value to set. - * @return the AzureFirewallApplicationRule object itself. - */ - public AzureFirewallApplicationRule withSourceAddresses(List sourceAddresses) { - this.sourceAddresses = sourceAddresses; - return this; - } - - /** - * Get the protocols property: Array of ApplicationRuleProtocols. - * - * @return the protocols value. - */ - public List protocols() { - return this.protocols; - } - - /** - * Set the protocols property: Array of ApplicationRuleProtocols. - * - * @param protocols the protocols value to set. - * @return the AzureFirewallApplicationRule object itself. - */ - public AzureFirewallApplicationRule withProtocols(List protocols) { - this.protocols = protocols; - return this; - } - - /** - * Get the targetFqdns property: List of FQDNs for this rule. - * - * @return the targetFqdns value. - */ - public List targetFqdns() { - return this.targetFqdns; - } - - /** - * Set the targetFqdns property: List of FQDNs for this rule. - * - * @param targetFqdns the targetFqdns value to set. - * @return the AzureFirewallApplicationRule object itself. - */ - public AzureFirewallApplicationRule withTargetFqdns(List targetFqdns) { - this.targetFqdns = targetFqdns; - return this; - } - - /** - * Get the fqdnTags property: List of FQDN Tags for this rule. - * - * @return the fqdnTags value. - */ - public List fqdnTags() { - return this.fqdnTags; - } - - /** - * Set the fqdnTags property: List of FQDN Tags for this rule. - * - * @param fqdnTags the fqdnTags value to set. - * @return the AzureFirewallApplicationRule object itself. - */ - public AzureFirewallApplicationRule withFqdnTags(List fqdnTags) { - this.fqdnTags = fqdnTags; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (protocols() != null) { - protocols().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AzureFirewallApplicationRuleCollection.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AzureFirewallApplicationRuleCollection.java deleted file mode 100644 index 688b97d13ed8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AzureFirewallApplicationRuleCollection.java +++ /dev/null @@ -1,189 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.AzureFirewallApplicationRuleCollectionPropertiesFormat; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Application rule collection resource. */ -@Fluent -public final class AzureFirewallApplicationRuleCollection extends SubResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureFirewallApplicationRuleCollection.class); - - /* - * Properties of the application rule collection. - */ - @JsonProperty(value = "properties") - private AzureFirewallApplicationRuleCollectionPropertiesFormat innerProperties; - - /* - * Gets name of the resource that is unique within a resource group. This - * name can be used to access the resource. - */ - @JsonProperty(value = "name") - private String name; - - /* - * Gets a unique read-only string that changes whenever the resource is - * updated. - */ - @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) - private String etag; - - /** - * Get the innerProperties property: Properties of the application rule collection. - * - * @return the innerProperties value. - */ - private AzureFirewallApplicationRuleCollectionPropertiesFormat innerProperties() { - return this.innerProperties; - } - - /** - * Get the name property: Gets name of the resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Gets name of the resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @param name the name value to set. - * @return the AzureFirewallApplicationRuleCollection object itself. - */ - public AzureFirewallApplicationRuleCollection withName(String name) { - this.name = name; - return this; - } - - /** - * Get the etag property: Gets a unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** {@inheritDoc} */ - @Override - public AzureFirewallApplicationRuleCollection withId(String id) { - super.withId(id); - return this; - } - - /** - * Get the priority property: Priority of the application rule collection resource. - * - * @return the priority value. - */ - public Integer priority() { - return this.innerProperties() == null ? null : this.innerProperties().priority(); - } - - /** - * Set the priority property: Priority of the application rule collection resource. - * - * @param priority the priority value to set. - * @return the AzureFirewallApplicationRuleCollection object itself. - */ - public AzureFirewallApplicationRuleCollection withPriority(Integer priority) { - if (this.innerProperties() == null) { - this.innerProperties = new AzureFirewallApplicationRuleCollectionPropertiesFormat(); - } - this.innerProperties().withPriority(priority); - return this; - } - - /** - * Get the action property: The action type of a rule collection. - * - * @return the action value. - */ - public AzureFirewallRCAction action() { - return this.innerProperties() == null ? null : this.innerProperties().action(); - } - - /** - * Set the action property: The action type of a rule collection. - * - * @param action the action value to set. - * @return the AzureFirewallApplicationRuleCollection object itself. - */ - public AzureFirewallApplicationRuleCollection withAction(AzureFirewallRCAction action) { - if (this.innerProperties() == null) { - this.innerProperties = new AzureFirewallApplicationRuleCollectionPropertiesFormat(); - } - this.innerProperties().withAction(action); - return this; - } - - /** - * Get the rules property: Collection of rules used by a application rule collection. - * - * @return the rules value. - */ - public List rules() { - return this.innerProperties() == null ? null : this.innerProperties().rules(); - } - - /** - * Set the rules property: Collection of rules used by a application rule collection. - * - * @param rules the rules value to set. - * @return the AzureFirewallApplicationRuleCollection object itself. - */ - public AzureFirewallApplicationRuleCollection withRules(List rules) { - if (this.innerProperties() == null) { - this.innerProperties = new AzureFirewallApplicationRuleCollectionPropertiesFormat(); - } - this.innerProperties().withRules(rules); - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the resource. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Set the provisioningState property: The provisioning state of the resource. - * - * @param provisioningState the provisioningState value to set. - * @return the AzureFirewallApplicationRuleCollection object itself. - */ - public AzureFirewallApplicationRuleCollection withProvisioningState(ProvisioningState provisioningState) { - if (this.innerProperties() == null) { - this.innerProperties = new AzureFirewallApplicationRuleCollectionPropertiesFormat(); - } - this.innerProperties().withProvisioningState(provisioningState); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AzureFirewallApplicationRuleProtocol.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AzureFirewallApplicationRuleProtocol.java deleted file mode 100644 index 08d4545d2925..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AzureFirewallApplicationRuleProtocol.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Properties of the application rule protocol. */ -@Fluent -public final class AzureFirewallApplicationRuleProtocol { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureFirewallApplicationRuleProtocol.class); - - /* - * Protocol type - */ - @JsonProperty(value = "protocolType") - private AzureFirewallApplicationRuleProtocolType protocolType; - - /* - * Port number for the protocol, cannot be greater than 64000. This field - * is optional. - */ - @JsonProperty(value = "port") - private Integer port; - - /** - * Get the protocolType property: Protocol type. - * - * @return the protocolType value. - */ - public AzureFirewallApplicationRuleProtocolType protocolType() { - return this.protocolType; - } - - /** - * Set the protocolType property: Protocol type. - * - * @param protocolType the protocolType value to set. - * @return the AzureFirewallApplicationRuleProtocol object itself. - */ - public AzureFirewallApplicationRuleProtocol withProtocolType( - AzureFirewallApplicationRuleProtocolType protocolType) { - this.protocolType = protocolType; - return this; - } - - /** - * Get the port property: Port number for the protocol, cannot be greater than 64000. This field is optional. - * - * @return the port value. - */ - public Integer port() { - return this.port; - } - - /** - * Set the port property: Port number for the protocol, cannot be greater than 64000. This field is optional. - * - * @param port the port value to set. - * @return the AzureFirewallApplicationRuleProtocol object itself. - */ - public AzureFirewallApplicationRuleProtocol withPort(Integer port) { - this.port = port; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AzureFirewallApplicationRuleProtocolType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AzureFirewallApplicationRuleProtocolType.java deleted file mode 100644 index 97ffc6d80cda..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AzureFirewallApplicationRuleProtocolType.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for AzureFirewallApplicationRuleProtocolType. */ -public final class AzureFirewallApplicationRuleProtocolType - extends ExpandableStringEnum { - /** Static value Http for AzureFirewallApplicationRuleProtocolType. */ - public static final AzureFirewallApplicationRuleProtocolType HTTP = fromString("Http"); - - /** Static value Https for AzureFirewallApplicationRuleProtocolType. */ - public static final AzureFirewallApplicationRuleProtocolType HTTPS = fromString("Https"); - - /** - * Creates or finds a AzureFirewallApplicationRuleProtocolType from its string representation. - * - * @param name a name to look for. - * @return the corresponding AzureFirewallApplicationRuleProtocolType. - */ - @JsonCreator - public static AzureFirewallApplicationRuleProtocolType fromString(String name) { - return fromString(name, AzureFirewallApplicationRuleProtocolType.class); - } - - /** @return known AzureFirewallApplicationRuleProtocolType values. */ - public static Collection values() { - return values(AzureFirewallApplicationRuleProtocolType.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AzureFirewallFqdnTagListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AzureFirewallFqdnTagListResult.java deleted file mode 100644 index 2603a33bea7a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AzureFirewallFqdnTagListResult.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.AzureFirewallFqdnTagInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Response for ListAzureFirewallFqdnTags API service call. */ -@Fluent -public final class AzureFirewallFqdnTagListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureFirewallFqdnTagListResult.class); - - /* - * List of Azure Firewall FQDN Tags in a resource group. - */ - @JsonProperty(value = "value") - private List value; - - /* - * URL to get the next set of results. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: List of Azure Firewall FQDN Tags in a resource group. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: List of Azure Firewall FQDN Tags in a resource group. - * - * @param value the value value to set. - * @return the AzureFirewallFqdnTagListResult object itself. - */ - public AzureFirewallFqdnTagListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: URL to get the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: URL to get the next set of results. - * - * @param nextLink the nextLink value to set. - * @return the AzureFirewallFqdnTagListResult object itself. - */ - public AzureFirewallFqdnTagListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AzureFirewallIpConfiguration.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AzureFirewallIpConfiguration.java deleted file mode 100644 index 81d45d9e84e3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AzureFirewallIpConfiguration.java +++ /dev/null @@ -1,176 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.AzureFirewallIpConfigurationPropertiesFormat; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** IP configuration of an Azure Firewall. */ -@Fluent -public final class AzureFirewallIpConfiguration extends SubResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureFirewallIpConfiguration.class); - - /* - * Properties of IP configuration of an Azure Firewall. - */ - @JsonProperty(value = "properties") - private AzureFirewallIpConfigurationPropertiesFormat innerProperties; - - /* - * Name of the resource that is unique within a resource group. This name - * can be used to access the resource. - */ - @JsonProperty(value = "name") - private String name; - - /* - * A unique read-only string that changes whenever the resource is updated. - */ - @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) - private String etag; - - /** - * Get the innerProperties property: Properties of IP configuration of an Azure Firewall. - * - * @return the innerProperties value. - */ - private AzureFirewallIpConfigurationPropertiesFormat innerProperties() { - return this.innerProperties; - } - - /** - * Get the name property: Name of the resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Name of the resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @param name the name value to set. - * @return the AzureFirewallIpConfiguration object itself. - */ - public AzureFirewallIpConfiguration withName(String name) { - this.name = name; - return this; - } - - /** - * Get the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** {@inheritDoc} */ - @Override - public AzureFirewallIpConfiguration withId(String id) { - super.withId(id); - return this; - } - - /** - * Get the privateIpAddress property: The Firewall Internal Load Balancer IP to be used as the next hop in User - * Defined Routes. - * - * @return the privateIpAddress value. - */ - public String privateIpAddress() { - return this.innerProperties() == null ? null : this.innerProperties().privateIpAddress(); - } - - /** - * Get the subnet property: Reference of the subnet resource. This resource must be named 'AzureFirewallSubnet'. - * - * @return the subnet value. - */ - public SubResource subnet() { - return this.innerProperties() == null ? null : this.innerProperties().subnet(); - } - - /** - * Set the subnet property: Reference of the subnet resource. This resource must be named 'AzureFirewallSubnet'. - * - * @param subnet the subnet value to set. - * @return the AzureFirewallIpConfiguration object itself. - */ - public AzureFirewallIpConfiguration withSubnet(SubResource subnet) { - if (this.innerProperties() == null) { - this.innerProperties = new AzureFirewallIpConfigurationPropertiesFormat(); - } - this.innerProperties().withSubnet(subnet); - return this; - } - - /** - * Get the publicIpAddress property: Reference of the PublicIP resource. This field is a mandatory input if subnet - * is not null. - * - * @return the publicIpAddress value. - */ - public SubResource publicIpAddress() { - return this.innerProperties() == null ? null : this.innerProperties().publicIpAddress(); - } - - /** - * Set the publicIpAddress property: Reference of the PublicIP resource. This field is a mandatory input if subnet - * is not null. - * - * @param publicIpAddress the publicIpAddress value to set. - * @return the AzureFirewallIpConfiguration object itself. - */ - public AzureFirewallIpConfiguration withPublicIpAddress(SubResource publicIpAddress) { - if (this.innerProperties() == null) { - this.innerProperties = new AzureFirewallIpConfigurationPropertiesFormat(); - } - this.innerProperties().withPublicIpAddress(publicIpAddress); - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the resource. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Set the provisioningState property: The provisioning state of the resource. - * - * @param provisioningState the provisioningState value to set. - * @return the AzureFirewallIpConfiguration object itself. - */ - public AzureFirewallIpConfiguration withProvisioningState(ProvisioningState provisioningState) { - if (this.innerProperties() == null) { - this.innerProperties = new AzureFirewallIpConfigurationPropertiesFormat(); - } - this.innerProperties().withProvisioningState(provisioningState); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AzureFirewallListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AzureFirewallListResult.java deleted file mode 100644 index 675032a5d526..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AzureFirewallListResult.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.AzureFirewallInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Response for ListAzureFirewalls API service call. */ -@Fluent -public final class AzureFirewallListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureFirewallListResult.class); - - /* - * List of Azure Firewalls in a resource group. - */ - @JsonProperty(value = "value") - private List value; - - /* - * URL to get the next set of results. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: List of Azure Firewalls in a resource group. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: List of Azure Firewalls in a resource group. - * - * @param value the value value to set. - * @return the AzureFirewallListResult object itself. - */ - public AzureFirewallListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: URL to get the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: URL to get the next set of results. - * - * @param nextLink the nextLink value to set. - * @return the AzureFirewallListResult object itself. - */ - public AzureFirewallListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AzureFirewallNatRCAction.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AzureFirewallNatRCAction.java deleted file mode 100644 index fe86a4bf0e51..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AzureFirewallNatRCAction.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** AzureFirewall NAT Rule Collection Action. */ -@Fluent -public final class AzureFirewallNatRCAction { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureFirewallNatRCAction.class); - - /* - * The type of action. - */ - @JsonProperty(value = "type") - private AzureFirewallNatRCActionType type; - - /** - * Get the type property: The type of action. - * - * @return the type value. - */ - public AzureFirewallNatRCActionType type() { - return this.type; - } - - /** - * Set the type property: The type of action. - * - * @param type the type value to set. - * @return the AzureFirewallNatRCAction object itself. - */ - public AzureFirewallNatRCAction withType(AzureFirewallNatRCActionType type) { - this.type = type; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AzureFirewallNatRCActionType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AzureFirewallNatRCActionType.java deleted file mode 100644 index fba0c6a6da73..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AzureFirewallNatRCActionType.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for AzureFirewallNatRCActionType. */ -public final class AzureFirewallNatRCActionType extends ExpandableStringEnum { - /** Static value Snat for AzureFirewallNatRCActionType. */ - public static final AzureFirewallNatRCActionType SNAT = fromString("Snat"); - - /** Static value Dnat for AzureFirewallNatRCActionType. */ - public static final AzureFirewallNatRCActionType DNAT = fromString("Dnat"); - - /** - * Creates or finds a AzureFirewallNatRCActionType from its string representation. - * - * @param name a name to look for. - * @return the corresponding AzureFirewallNatRCActionType. - */ - @JsonCreator - public static AzureFirewallNatRCActionType fromString(String name) { - return fromString(name, AzureFirewallNatRCActionType.class); - } - - /** @return known AzureFirewallNatRCActionType values. */ - public static Collection values() { - return values(AzureFirewallNatRCActionType.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AzureFirewallNatRule.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AzureFirewallNatRule.java deleted file mode 100644 index 8ea53a1c768f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AzureFirewallNatRule.java +++ /dev/null @@ -1,233 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Properties of a NAT rule. */ -@Fluent -public final class AzureFirewallNatRule { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureFirewallNatRule.class); - - /* - * Name of the NAT rule. - */ - @JsonProperty(value = "name") - private String name; - - /* - * Description of the rule. - */ - @JsonProperty(value = "description") - private String description; - - /* - * List of source IP addresses for this rule. - */ - @JsonProperty(value = "sourceAddresses") - private List sourceAddresses; - - /* - * List of destination IP addresses for this rule. - */ - @JsonProperty(value = "destinationAddresses") - private List destinationAddresses; - - /* - * List of destination ports. - */ - @JsonProperty(value = "destinationPorts") - private List destinationPorts; - - /* - * Array of AzureFirewallNetworkRuleProtocols applicable to this NAT rule. - */ - @JsonProperty(value = "protocols") - private List protocols; - - /* - * The translated address for this NAT rule. - */ - @JsonProperty(value = "translatedAddress") - private String translatedAddress; - - /* - * The translated port for this NAT rule. - */ - @JsonProperty(value = "translatedPort") - private String translatedPort; - - /** - * Get the name property: Name of the NAT rule. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Name of the NAT rule. - * - * @param name the name value to set. - * @return the AzureFirewallNatRule object itself. - */ - public AzureFirewallNatRule withName(String name) { - this.name = name; - return this; - } - - /** - * Get the description property: Description of the rule. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: Description of the rule. - * - * @param description the description value to set. - * @return the AzureFirewallNatRule object itself. - */ - public AzureFirewallNatRule withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the sourceAddresses property: List of source IP addresses for this rule. - * - * @return the sourceAddresses value. - */ - public List sourceAddresses() { - return this.sourceAddresses; - } - - /** - * Set the sourceAddresses property: List of source IP addresses for this rule. - * - * @param sourceAddresses the sourceAddresses value to set. - * @return the AzureFirewallNatRule object itself. - */ - public AzureFirewallNatRule withSourceAddresses(List sourceAddresses) { - this.sourceAddresses = sourceAddresses; - return this; - } - - /** - * Get the destinationAddresses property: List of destination IP addresses for this rule. - * - * @return the destinationAddresses value. - */ - public List destinationAddresses() { - return this.destinationAddresses; - } - - /** - * Set the destinationAddresses property: List of destination IP addresses for this rule. - * - * @param destinationAddresses the destinationAddresses value to set. - * @return the AzureFirewallNatRule object itself. - */ - public AzureFirewallNatRule withDestinationAddresses(List destinationAddresses) { - this.destinationAddresses = destinationAddresses; - return this; - } - - /** - * Get the destinationPorts property: List of destination ports. - * - * @return the destinationPorts value. - */ - public List destinationPorts() { - return this.destinationPorts; - } - - /** - * Set the destinationPorts property: List of destination ports. - * - * @param destinationPorts the destinationPorts value to set. - * @return the AzureFirewallNatRule object itself. - */ - public AzureFirewallNatRule withDestinationPorts(List destinationPorts) { - this.destinationPorts = destinationPorts; - return this; - } - - /** - * Get the protocols property: Array of AzureFirewallNetworkRuleProtocols applicable to this NAT rule. - * - * @return the protocols value. - */ - public List protocols() { - return this.protocols; - } - - /** - * Set the protocols property: Array of AzureFirewallNetworkRuleProtocols applicable to this NAT rule. - * - * @param protocols the protocols value to set. - * @return the AzureFirewallNatRule object itself. - */ - public AzureFirewallNatRule withProtocols(List protocols) { - this.protocols = protocols; - return this; - } - - /** - * Get the translatedAddress property: The translated address for this NAT rule. - * - * @return the translatedAddress value. - */ - public String translatedAddress() { - return this.translatedAddress; - } - - /** - * Set the translatedAddress property: The translated address for this NAT rule. - * - * @param translatedAddress the translatedAddress value to set. - * @return the AzureFirewallNatRule object itself. - */ - public AzureFirewallNatRule withTranslatedAddress(String translatedAddress) { - this.translatedAddress = translatedAddress; - return this; - } - - /** - * Get the translatedPort property: The translated port for this NAT rule. - * - * @return the translatedPort value. - */ - public String translatedPort() { - return this.translatedPort; - } - - /** - * Set the translatedPort property: The translated port for this NAT rule. - * - * @param translatedPort the translatedPort value to set. - * @return the AzureFirewallNatRule object itself. - */ - public AzureFirewallNatRule withTranslatedPort(String translatedPort) { - this.translatedPort = translatedPort; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AzureFirewallNatRuleCollection.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AzureFirewallNatRuleCollection.java deleted file mode 100644 index 87f516ea7092..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AzureFirewallNatRuleCollection.java +++ /dev/null @@ -1,189 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.AzureFirewallNatRuleCollectionProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** NAT rule collection resource. */ -@Fluent -public final class AzureFirewallNatRuleCollection extends SubResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureFirewallNatRuleCollection.class); - - /* - * Properties of the NAT rule collection. - */ - @JsonProperty(value = "properties") - private AzureFirewallNatRuleCollectionProperties innerProperties; - - /* - * Gets name of the resource that is unique within a resource group. This - * name can be used to access the resource. - */ - @JsonProperty(value = "name") - private String name; - - /* - * Gets a unique read-only string that changes whenever the resource is - * updated. - */ - @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) - private String etag; - - /** - * Get the innerProperties property: Properties of the NAT rule collection. - * - * @return the innerProperties value. - */ - private AzureFirewallNatRuleCollectionProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the name property: Gets name of the resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Gets name of the resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @param name the name value to set. - * @return the AzureFirewallNatRuleCollection object itself. - */ - public AzureFirewallNatRuleCollection withName(String name) { - this.name = name; - return this; - } - - /** - * Get the etag property: Gets a unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** {@inheritDoc} */ - @Override - public AzureFirewallNatRuleCollection withId(String id) { - super.withId(id); - return this; - } - - /** - * Get the priority property: Priority of the NAT rule collection resource. - * - * @return the priority value. - */ - public Integer priority() { - return this.innerProperties() == null ? null : this.innerProperties().priority(); - } - - /** - * Set the priority property: Priority of the NAT rule collection resource. - * - * @param priority the priority value to set. - * @return the AzureFirewallNatRuleCollection object itself. - */ - public AzureFirewallNatRuleCollection withPriority(Integer priority) { - if (this.innerProperties() == null) { - this.innerProperties = new AzureFirewallNatRuleCollectionProperties(); - } - this.innerProperties().withPriority(priority); - return this; - } - - /** - * Get the action property: The action type of a NAT rule collection. - * - * @return the action value. - */ - public AzureFirewallNatRCAction action() { - return this.innerProperties() == null ? null : this.innerProperties().action(); - } - - /** - * Set the action property: The action type of a NAT rule collection. - * - * @param action the action value to set. - * @return the AzureFirewallNatRuleCollection object itself. - */ - public AzureFirewallNatRuleCollection withAction(AzureFirewallNatRCAction action) { - if (this.innerProperties() == null) { - this.innerProperties = new AzureFirewallNatRuleCollectionProperties(); - } - this.innerProperties().withAction(action); - return this; - } - - /** - * Get the rules property: Collection of rules used by a NAT rule collection. - * - * @return the rules value. - */ - public List rules() { - return this.innerProperties() == null ? null : this.innerProperties().rules(); - } - - /** - * Set the rules property: Collection of rules used by a NAT rule collection. - * - * @param rules the rules value to set. - * @return the AzureFirewallNatRuleCollection object itself. - */ - public AzureFirewallNatRuleCollection withRules(List rules) { - if (this.innerProperties() == null) { - this.innerProperties = new AzureFirewallNatRuleCollectionProperties(); - } - this.innerProperties().withRules(rules); - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the resource. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Set the provisioningState property: The provisioning state of the resource. - * - * @param provisioningState the provisioningState value to set. - * @return the AzureFirewallNatRuleCollection object itself. - */ - public AzureFirewallNatRuleCollection withProvisioningState(ProvisioningState provisioningState) { - if (this.innerProperties() == null) { - this.innerProperties = new AzureFirewallNatRuleCollectionProperties(); - } - this.innerProperties().withProvisioningState(provisioningState); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AzureFirewallNetworkRule.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AzureFirewallNetworkRule.java deleted file mode 100644 index 8522f60b732f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AzureFirewallNetworkRule.java +++ /dev/null @@ -1,181 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Properties of the network rule. */ -@Fluent -public final class AzureFirewallNetworkRule { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureFirewallNetworkRule.class); - - /* - * Name of the network rule. - */ - @JsonProperty(value = "name") - private String name; - - /* - * Description of the rule. - */ - @JsonProperty(value = "description") - private String description; - - /* - * Array of AzureFirewallNetworkRuleProtocols. - */ - @JsonProperty(value = "protocols") - private List protocols; - - /* - * List of source IP addresses for this rule. - */ - @JsonProperty(value = "sourceAddresses") - private List sourceAddresses; - - /* - * List of destination IP addresses. - */ - @JsonProperty(value = "destinationAddresses") - private List destinationAddresses; - - /* - * List of destination ports. - */ - @JsonProperty(value = "destinationPorts") - private List destinationPorts; - - /** - * Get the name property: Name of the network rule. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Name of the network rule. - * - * @param name the name value to set. - * @return the AzureFirewallNetworkRule object itself. - */ - public AzureFirewallNetworkRule withName(String name) { - this.name = name; - return this; - } - - /** - * Get the description property: Description of the rule. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: Description of the rule. - * - * @param description the description value to set. - * @return the AzureFirewallNetworkRule object itself. - */ - public AzureFirewallNetworkRule withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the protocols property: Array of AzureFirewallNetworkRuleProtocols. - * - * @return the protocols value. - */ - public List protocols() { - return this.protocols; - } - - /** - * Set the protocols property: Array of AzureFirewallNetworkRuleProtocols. - * - * @param protocols the protocols value to set. - * @return the AzureFirewallNetworkRule object itself. - */ - public AzureFirewallNetworkRule withProtocols(List protocols) { - this.protocols = protocols; - return this; - } - - /** - * Get the sourceAddresses property: List of source IP addresses for this rule. - * - * @return the sourceAddresses value. - */ - public List sourceAddresses() { - return this.sourceAddresses; - } - - /** - * Set the sourceAddresses property: List of source IP addresses for this rule. - * - * @param sourceAddresses the sourceAddresses value to set. - * @return the AzureFirewallNetworkRule object itself. - */ - public AzureFirewallNetworkRule withSourceAddresses(List sourceAddresses) { - this.sourceAddresses = sourceAddresses; - return this; - } - - /** - * Get the destinationAddresses property: List of destination IP addresses. - * - * @return the destinationAddresses value. - */ - public List destinationAddresses() { - return this.destinationAddresses; - } - - /** - * Set the destinationAddresses property: List of destination IP addresses. - * - * @param destinationAddresses the destinationAddresses value to set. - * @return the AzureFirewallNetworkRule object itself. - */ - public AzureFirewallNetworkRule withDestinationAddresses(List destinationAddresses) { - this.destinationAddresses = destinationAddresses; - return this; - } - - /** - * Get the destinationPorts property: List of destination ports. - * - * @return the destinationPorts value. - */ - public List destinationPorts() { - return this.destinationPorts; - } - - /** - * Set the destinationPorts property: List of destination ports. - * - * @param destinationPorts the destinationPorts value to set. - * @return the AzureFirewallNetworkRule object itself. - */ - public AzureFirewallNetworkRule withDestinationPorts(List destinationPorts) { - this.destinationPorts = destinationPorts; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AzureFirewallNetworkRuleCollection.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AzureFirewallNetworkRuleCollection.java deleted file mode 100644 index 10f8e6ba7370..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AzureFirewallNetworkRuleCollection.java +++ /dev/null @@ -1,189 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.AzureFirewallNetworkRuleCollectionPropertiesFormat; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Network rule collection resource. */ -@Fluent -public final class AzureFirewallNetworkRuleCollection extends SubResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureFirewallNetworkRuleCollection.class); - - /* - * Properties of the network rule collection. - */ - @JsonProperty(value = "properties") - private AzureFirewallNetworkRuleCollectionPropertiesFormat innerProperties; - - /* - * Gets name of the resource that is unique within a resource group. This - * name can be used to access the resource. - */ - @JsonProperty(value = "name") - private String name; - - /* - * Gets a unique read-only string that changes whenever the resource is - * updated. - */ - @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) - private String etag; - - /** - * Get the innerProperties property: Properties of the network rule collection. - * - * @return the innerProperties value. - */ - private AzureFirewallNetworkRuleCollectionPropertiesFormat innerProperties() { - return this.innerProperties; - } - - /** - * Get the name property: Gets name of the resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Gets name of the resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @param name the name value to set. - * @return the AzureFirewallNetworkRuleCollection object itself. - */ - public AzureFirewallNetworkRuleCollection withName(String name) { - this.name = name; - return this; - } - - /** - * Get the etag property: Gets a unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** {@inheritDoc} */ - @Override - public AzureFirewallNetworkRuleCollection withId(String id) { - super.withId(id); - return this; - } - - /** - * Get the priority property: Priority of the network rule collection resource. - * - * @return the priority value. - */ - public Integer priority() { - return this.innerProperties() == null ? null : this.innerProperties().priority(); - } - - /** - * Set the priority property: Priority of the network rule collection resource. - * - * @param priority the priority value to set. - * @return the AzureFirewallNetworkRuleCollection object itself. - */ - public AzureFirewallNetworkRuleCollection withPriority(Integer priority) { - if (this.innerProperties() == null) { - this.innerProperties = new AzureFirewallNetworkRuleCollectionPropertiesFormat(); - } - this.innerProperties().withPriority(priority); - return this; - } - - /** - * Get the action property: The action type of a rule collection. - * - * @return the action value. - */ - public AzureFirewallRCAction action() { - return this.innerProperties() == null ? null : this.innerProperties().action(); - } - - /** - * Set the action property: The action type of a rule collection. - * - * @param action the action value to set. - * @return the AzureFirewallNetworkRuleCollection object itself. - */ - public AzureFirewallNetworkRuleCollection withAction(AzureFirewallRCAction action) { - if (this.innerProperties() == null) { - this.innerProperties = new AzureFirewallNetworkRuleCollectionPropertiesFormat(); - } - this.innerProperties().withAction(action); - return this; - } - - /** - * Get the rules property: Collection of rules used by a network rule collection. - * - * @return the rules value. - */ - public List rules() { - return this.innerProperties() == null ? null : this.innerProperties().rules(); - } - - /** - * Set the rules property: Collection of rules used by a network rule collection. - * - * @param rules the rules value to set. - * @return the AzureFirewallNetworkRuleCollection object itself. - */ - public AzureFirewallNetworkRuleCollection withRules(List rules) { - if (this.innerProperties() == null) { - this.innerProperties = new AzureFirewallNetworkRuleCollectionPropertiesFormat(); - } - this.innerProperties().withRules(rules); - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the resource. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Set the provisioningState property: The provisioning state of the resource. - * - * @param provisioningState the provisioningState value to set. - * @return the AzureFirewallNetworkRuleCollection object itself. - */ - public AzureFirewallNetworkRuleCollection withProvisioningState(ProvisioningState provisioningState) { - if (this.innerProperties() == null) { - this.innerProperties = new AzureFirewallNetworkRuleCollectionPropertiesFormat(); - } - this.innerProperties().withProvisioningState(provisioningState); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AzureFirewallNetworkRuleProtocol.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AzureFirewallNetworkRuleProtocol.java deleted file mode 100644 index e9eda27bb562..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AzureFirewallNetworkRuleProtocol.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for AzureFirewallNetworkRuleProtocol. */ -public final class AzureFirewallNetworkRuleProtocol extends ExpandableStringEnum { - /** Static value TCP for AzureFirewallNetworkRuleProtocol. */ - public static final AzureFirewallNetworkRuleProtocol TCP = fromString("TCP"); - - /** Static value UDP for AzureFirewallNetworkRuleProtocol. */ - public static final AzureFirewallNetworkRuleProtocol UDP = fromString("UDP"); - - /** Static value Any for AzureFirewallNetworkRuleProtocol. */ - public static final AzureFirewallNetworkRuleProtocol ANY = fromString("Any"); - - /** Static value ICMP for AzureFirewallNetworkRuleProtocol. */ - public static final AzureFirewallNetworkRuleProtocol ICMP = fromString("ICMP"); - - /** - * Creates or finds a AzureFirewallNetworkRuleProtocol from its string representation. - * - * @param name a name to look for. - * @return the corresponding AzureFirewallNetworkRuleProtocol. - */ - @JsonCreator - public static AzureFirewallNetworkRuleProtocol fromString(String name) { - return fromString(name, AzureFirewallNetworkRuleProtocol.class); - } - - /** @return known AzureFirewallNetworkRuleProtocol values. */ - public static Collection values() { - return values(AzureFirewallNetworkRuleProtocol.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AzureFirewallRCAction.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AzureFirewallRCAction.java deleted file mode 100644 index 9c00219eecee..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AzureFirewallRCAction.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Properties of the AzureFirewallRCAction. */ -@Fluent -public final class AzureFirewallRCAction { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureFirewallRCAction.class); - - /* - * The type of action. - */ - @JsonProperty(value = "type") - private AzureFirewallRCActionType type; - - /** - * Get the type property: The type of action. - * - * @return the type value. - */ - public AzureFirewallRCActionType type() { - return this.type; - } - - /** - * Set the type property: The type of action. - * - * @param type the type value to set. - * @return the AzureFirewallRCAction object itself. - */ - public AzureFirewallRCAction withType(AzureFirewallRCActionType type) { - this.type = type; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AzureFirewallRCActionType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AzureFirewallRCActionType.java deleted file mode 100644 index 776d04813aae..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AzureFirewallRCActionType.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for AzureFirewallRCActionType. */ -public final class AzureFirewallRCActionType extends ExpandableStringEnum { - /** Static value Allow for AzureFirewallRCActionType. */ - public static final AzureFirewallRCActionType ALLOW = fromString("Allow"); - - /** Static value Deny for AzureFirewallRCActionType. */ - public static final AzureFirewallRCActionType DENY = fromString("Deny"); - - /** - * Creates or finds a AzureFirewallRCActionType from its string representation. - * - * @param name a name to look for. - * @return the corresponding AzureFirewallRCActionType. - */ - @JsonCreator - public static AzureFirewallRCActionType fromString(String name) { - return fromString(name, AzureFirewallRCActionType.class); - } - - /** @return known AzureFirewallRCActionType values. */ - public static Collection values() { - return values(AzureFirewallRCActionType.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AzureReachabilityReport.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AzureReachabilityReport.java deleted file mode 100644 index 77e06ea91db7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AzureReachabilityReport.java +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.network.fluent.models.AzureReachabilityReportInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasParent; -import com.azure.resourcemanager.resources.fluentcore.model.Executable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import java.time.OffsetDateTime; -import java.util.List; - -/** An immutable client-side representation of Azure reachability report details. */ -@Fluent -public interface AzureReachabilityReport - extends Executable, - HasInnerModel, - HasParent { - /** @return the aggregation level of Azure reachability report. Can be Country, State or City. */ - String aggregationLevel(); - - /** @return the providerLocation property */ - AzureReachabilityReportLocation providerLocation(); - - /** @return list of Azure reachability report items. */ - List reachabilityReport(); - /** @return parameters used to query available internet providers */ - AzureReachabilityReportParameters azureReachabilityReportParameters(); - - /** The entirety of Azure reachability report parameters definition. */ - interface Definition - extends DefinitionStages.WithProviderLocation, - DefinitionStages.WithStartTime, - DefinitionStages.WithEndTime, - DefinitionStages.WithExecute { - } - - /** Grouping of Azure reachability report definition stages. */ - interface DefinitionStages { - /** The first stage of Azure reachability report parameters definition. */ - interface WithProviderLocation { - /** - * @param country the name of the country - * @return the AzureReachabilityReport object itself - */ - WithStartTime withProviderLocation(String country); - /** - * @param country the name of the country - * @param state the name of the state - * @return the AzureReachabilityReport object itself - */ - WithStartTime withProviderLocation(String country, String state); - /** - * @param country the name of the country - * @param state the name of the state - * @param city the name of the city - * @return the AzureReachabilityReport object itself - */ - WithStartTime withProviderLocation(String country, String state, String city); - } - - /** Sets the start time for the Azure reachability report. */ - interface WithStartTime { - /** - * @param startTime the start time for the Azure reachability report - * @return the next stage of the definition - */ - WithEndTime withStartTime(OffsetDateTime startTime); - } - - /** Sets the end time for the Azure reachability report. */ - interface WithEndTime { - /** - * @param endTime the start time for the Azure reachability report - * @return the next stage of the definition - */ - WithExecute withEndTime(OffsetDateTime endTime); - } - - /** - * Sets Azure regions to scope the query to. Note: if none or multiple Azure regions specified, only one - * provider should be set. If none or multiple providers specified, only one Azure region should be set. - */ - interface WithAzureLocations { - /** - * @param azureLocations the Azure locations for the Azure reachability report - * @return the next stage of the definition - */ - WithExecute withAzureLocations(String... azureLocations); - } - - /** - * Sets the list of Internet service providers. Note: if none or multiple Azure regions specified, only one - * provider should be set. If none or multiple providers specified, only one Azure region should be set. - */ - interface WithProviders { - /** - * @param providers the list of Internet service providers - * @return the next stage of the definition - */ - WithExecute withProviders(String... providers); - } - - /** - * The stage of the definition which contains all the minimum required inputs for execution, but also allows for - * any other optional settings to be specified. - */ - interface WithExecute - extends Executable, - DefinitionStages.WithAzureLocations, - DefinitionStages.WithProviders { - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AzureReachabilityReportItem.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AzureReachabilityReportItem.java deleted file mode 100644 index 69ec2ecb6f8c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AzureReachabilityReportItem.java +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Azure reachability report details for a given provider location. */ -@Fluent -public final class AzureReachabilityReportItem { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureReachabilityReportItem.class); - - /* - * The Internet service provider. - */ - @JsonProperty(value = "provider") - private String provider; - - /* - * The Azure region. - */ - @JsonProperty(value = "azureLocation") - private String azureLocation; - - /* - * List of latency details for each of the time series. - */ - @JsonProperty(value = "latencies") - private List latencies; - - /** - * Get the provider property: The Internet service provider. - * - * @return the provider value. - */ - public String provider() { - return this.provider; - } - - /** - * Set the provider property: The Internet service provider. - * - * @param provider the provider value to set. - * @return the AzureReachabilityReportItem object itself. - */ - public AzureReachabilityReportItem withProvider(String provider) { - this.provider = provider; - return this; - } - - /** - * Get the azureLocation property: The Azure region. - * - * @return the azureLocation value. - */ - public String azureLocation() { - return this.azureLocation; - } - - /** - * Set the azureLocation property: The Azure region. - * - * @param azureLocation the azureLocation value to set. - * @return the AzureReachabilityReportItem object itself. - */ - public AzureReachabilityReportItem withAzureLocation(String azureLocation) { - this.azureLocation = azureLocation; - return this; - } - - /** - * Get the latencies property: List of latency details for each of the time series. - * - * @return the latencies value. - */ - public List latencies() { - return this.latencies; - } - - /** - * Set the latencies property: List of latency details for each of the time series. - * - * @param latencies the latencies value to set. - * @return the AzureReachabilityReportItem object itself. - */ - public AzureReachabilityReportItem withLatencies(List latencies) { - this.latencies = latencies; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (latencies() != null) { - latencies().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AzureReachabilityReportLatencyInfo.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AzureReachabilityReportLatencyInfo.java deleted file mode 100644 index ae9d35a2ddfe..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AzureReachabilityReportLatencyInfo.java +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** Details on latency for a time series. */ -@Fluent -public final class AzureReachabilityReportLatencyInfo { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureReachabilityReportLatencyInfo.class); - - /* - * The time stamp. - */ - @JsonProperty(value = "timeStamp") - private OffsetDateTime timestamp; - - /* - * The relative latency score between 1 and 100, higher values indicating a - * faster connection. - */ - @JsonProperty(value = "score") - private Integer score; - - /** - * Get the timestamp property: The time stamp. - * - * @return the timestamp value. - */ - public OffsetDateTime timestamp() { - return this.timestamp; - } - - /** - * Set the timestamp property: The time stamp. - * - * @param timestamp the timestamp value to set. - * @return the AzureReachabilityReportLatencyInfo object itself. - */ - public AzureReachabilityReportLatencyInfo withTimestamp(OffsetDateTime timestamp) { - this.timestamp = timestamp; - return this; - } - - /** - * Get the score property: The relative latency score between 1 and 100, higher values indicating a faster - * connection. - * - * @return the score value. - */ - public Integer score() { - return this.score; - } - - /** - * Set the score property: The relative latency score between 1 and 100, higher values indicating a faster - * connection. - * - * @param score the score value to set. - * @return the AzureReachabilityReportLatencyInfo object itself. - */ - public AzureReachabilityReportLatencyInfo withScore(Integer score) { - this.score = score; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AzureReachabilityReportLocation.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AzureReachabilityReportLocation.java deleted file mode 100644 index 7275388af493..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AzureReachabilityReportLocation.java +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Parameters that define a geographic location. */ -@Fluent -public final class AzureReachabilityReportLocation { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureReachabilityReportLocation.class); - - /* - * The name of the country. - */ - @JsonProperty(value = "country", required = true) - private String country; - - /* - * The name of the state. - */ - @JsonProperty(value = "state") - private String state; - - /* - * The name of the city or town. - */ - @JsonProperty(value = "city") - private String city; - - /** - * Get the country property: The name of the country. - * - * @return the country value. - */ - public String country() { - return this.country; - } - - /** - * Set the country property: The name of the country. - * - * @param country the country value to set. - * @return the AzureReachabilityReportLocation object itself. - */ - public AzureReachabilityReportLocation withCountry(String country) { - this.country = country; - return this; - } - - /** - * Get the state property: The name of the state. - * - * @return the state value. - */ - public String state() { - return this.state; - } - - /** - * Set the state property: The name of the state. - * - * @param state the state value to set. - * @return the AzureReachabilityReportLocation object itself. - */ - public AzureReachabilityReportLocation withState(String state) { - this.state = state; - return this; - } - - /** - * Get the city property: The name of the city or town. - * - * @return the city value. - */ - public String city() { - return this.city; - } - - /** - * Set the city property: The name of the city or town. - * - * @param city the city value to set. - * @return the AzureReachabilityReportLocation object itself. - */ - public AzureReachabilityReportLocation withCity(String city) { - this.city = city; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (country() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property country in model AzureReachabilityReportLocation")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AzureReachabilityReportParameters.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AzureReachabilityReportParameters.java deleted file mode 100644 index eba36b9dcb6a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/AzureReachabilityReportParameters.java +++ /dev/null @@ -1,176 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; - -/** Geographic and time constraints for Azure reachability report. */ -@Fluent -public final class AzureReachabilityReportParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureReachabilityReportParameters.class); - - /* - * Parameters that define a geographic location. - */ - @JsonProperty(value = "providerLocation", required = true) - private AzureReachabilityReportLocation providerLocation; - - /* - * List of Internet service providers. - */ - @JsonProperty(value = "providers") - private List providers; - - /* - * Optional Azure regions to scope the query to. - */ - @JsonProperty(value = "azureLocations") - private List azureLocations; - - /* - * The start time for the Azure reachability report. - */ - @JsonProperty(value = "startTime", required = true) - private OffsetDateTime startTime; - - /* - * The end time for the Azure reachability report. - */ - @JsonProperty(value = "endTime", required = true) - private OffsetDateTime endTime; - - /** - * Get the providerLocation property: Parameters that define a geographic location. - * - * @return the providerLocation value. - */ - public AzureReachabilityReportLocation providerLocation() { - return this.providerLocation; - } - - /** - * Set the providerLocation property: Parameters that define a geographic location. - * - * @param providerLocation the providerLocation value to set. - * @return the AzureReachabilityReportParameters object itself. - */ - public AzureReachabilityReportParameters withProviderLocation(AzureReachabilityReportLocation providerLocation) { - this.providerLocation = providerLocation; - return this; - } - - /** - * Get the providers property: List of Internet service providers. - * - * @return the providers value. - */ - public List providers() { - return this.providers; - } - - /** - * Set the providers property: List of Internet service providers. - * - * @param providers the providers value to set. - * @return the AzureReachabilityReportParameters object itself. - */ - public AzureReachabilityReportParameters withProviders(List providers) { - this.providers = providers; - return this; - } - - /** - * Get the azureLocations property: Optional Azure regions to scope the query to. - * - * @return the azureLocations value. - */ - public List azureLocations() { - return this.azureLocations; - } - - /** - * Set the azureLocations property: Optional Azure regions to scope the query to. - * - * @param azureLocations the azureLocations value to set. - * @return the AzureReachabilityReportParameters object itself. - */ - public AzureReachabilityReportParameters withAzureLocations(List azureLocations) { - this.azureLocations = azureLocations; - return this; - } - - /** - * Get the startTime property: The start time for the Azure reachability report. - * - * @return the startTime value. - */ - public OffsetDateTime startTime() { - return this.startTime; - } - - /** - * Set the startTime property: The start time for the Azure reachability report. - * - * @param startTime the startTime value to set. - * @return the AzureReachabilityReportParameters object itself. - */ - public AzureReachabilityReportParameters withStartTime(OffsetDateTime startTime) { - this.startTime = startTime; - return this; - } - - /** - * Get the endTime property: The end time for the Azure reachability report. - * - * @return the endTime value. - */ - public OffsetDateTime endTime() { - return this.endTime; - } - - /** - * Set the endTime property: The end time for the Azure reachability report. - * - * @param endTime the endTime value to set. - * @return the AzureReachabilityReportParameters object itself. - */ - public AzureReachabilityReportParameters withEndTime(OffsetDateTime endTime) { - this.endTime = endTime; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (providerLocation() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property providerLocation in model AzureReachabilityReportParameters")); - } else { - providerLocation().validate(); - } - if (startTime() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property startTime in model AzureReachabilityReportParameters")); - } - if (endTime() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property endTime in model AzureReachabilityReportParameters")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/BgpCommunity.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/BgpCommunity.java deleted file mode 100644 index 23557f569811..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/BgpCommunity.java +++ /dev/null @@ -1,184 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Contains bgp community information offered in Service Community resources. */ -@Fluent -public final class BgpCommunity { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BgpCommunity.class); - - /* - * The region which the service support. e.g. For O365, region is Global. - */ - @JsonProperty(value = "serviceSupportedRegion") - private String serviceSupportedRegion; - - /* - * The name of the bgp community. e.g. Skype. - */ - @JsonProperty(value = "communityName") - private String communityName; - - /* - * The value of the bgp community. For more information: - * https://docs.microsoft.com/en-us/azure/expressroute/expressroute-routing. - */ - @JsonProperty(value = "communityValue") - private String communityValue; - - /* - * The prefixes that the bgp community contains. - */ - @JsonProperty(value = "communityPrefixes") - private List communityPrefixes; - - /* - * Customer is authorized to use bgp community or not. - */ - @JsonProperty(value = "isAuthorizedToUse") - private Boolean isAuthorizedToUse; - - /* - * The service group of the bgp community contains. - */ - @JsonProperty(value = "serviceGroup") - private String serviceGroup; - - /** - * Get the serviceSupportedRegion property: The region which the service support. e.g. For O365, region is Global. - * - * @return the serviceSupportedRegion value. - */ - public String serviceSupportedRegion() { - return this.serviceSupportedRegion; - } - - /** - * Set the serviceSupportedRegion property: The region which the service support. e.g. For O365, region is Global. - * - * @param serviceSupportedRegion the serviceSupportedRegion value to set. - * @return the BgpCommunity object itself. - */ - public BgpCommunity withServiceSupportedRegion(String serviceSupportedRegion) { - this.serviceSupportedRegion = serviceSupportedRegion; - return this; - } - - /** - * Get the communityName property: The name of the bgp community. e.g. Skype. - * - * @return the communityName value. - */ - public String communityName() { - return this.communityName; - } - - /** - * Set the communityName property: The name of the bgp community. e.g. Skype. - * - * @param communityName the communityName value to set. - * @return the BgpCommunity object itself. - */ - public BgpCommunity withCommunityName(String communityName) { - this.communityName = communityName; - return this; - } - - /** - * Get the communityValue property: The value of the bgp community. For more information: - * https://docs.microsoft.com/en-us/azure/expressroute/expressroute-routing. - * - * @return the communityValue value. - */ - public String communityValue() { - return this.communityValue; - } - - /** - * Set the communityValue property: The value of the bgp community. For more information: - * https://docs.microsoft.com/en-us/azure/expressroute/expressroute-routing. - * - * @param communityValue the communityValue value to set. - * @return the BgpCommunity object itself. - */ - public BgpCommunity withCommunityValue(String communityValue) { - this.communityValue = communityValue; - return this; - } - - /** - * Get the communityPrefixes property: The prefixes that the bgp community contains. - * - * @return the communityPrefixes value. - */ - public List communityPrefixes() { - return this.communityPrefixes; - } - - /** - * Set the communityPrefixes property: The prefixes that the bgp community contains. - * - * @param communityPrefixes the communityPrefixes value to set. - * @return the BgpCommunity object itself. - */ - public BgpCommunity withCommunityPrefixes(List communityPrefixes) { - this.communityPrefixes = communityPrefixes; - return this; - } - - /** - * Get the isAuthorizedToUse property: Customer is authorized to use bgp community or not. - * - * @return the isAuthorizedToUse value. - */ - public Boolean isAuthorizedToUse() { - return this.isAuthorizedToUse; - } - - /** - * Set the isAuthorizedToUse property: Customer is authorized to use bgp community or not. - * - * @param isAuthorizedToUse the isAuthorizedToUse value to set. - * @return the BgpCommunity object itself. - */ - public BgpCommunity withIsAuthorizedToUse(Boolean isAuthorizedToUse) { - this.isAuthorizedToUse = isAuthorizedToUse; - return this; - } - - /** - * Get the serviceGroup property: The service group of the bgp community contains. - * - * @return the serviceGroup value. - */ - public String serviceGroup() { - return this.serviceGroup; - } - - /** - * Set the serviceGroup property: The service group of the bgp community contains. - * - * @param serviceGroup the serviceGroup value to set. - * @return the BgpCommunity object itself. - */ - public BgpCommunity withServiceGroup(String serviceGroup) { - this.serviceGroup = serviceGroup; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/BgpPeerState.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/BgpPeerState.java deleted file mode 100644 index 6e9978ea24ae..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/BgpPeerState.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for BgpPeerState. */ -public final class BgpPeerState extends ExpandableStringEnum { - /** Static value Unknown for BgpPeerState. */ - public static final BgpPeerState UNKNOWN = fromString("Unknown"); - - /** Static value Stopped for BgpPeerState. */ - public static final BgpPeerState STOPPED = fromString("Stopped"); - - /** Static value Idle for BgpPeerState. */ - public static final BgpPeerState IDLE = fromString("Idle"); - - /** Static value Connecting for BgpPeerState. */ - public static final BgpPeerState CONNECTING = fromString("Connecting"); - - /** Static value Connected for BgpPeerState. */ - public static final BgpPeerState CONNECTED = fromString("Connected"); - - /** - * Creates or finds a BgpPeerState from its string representation. - * - * @param name a name to look for. - * @return the corresponding BgpPeerState. - */ - @JsonCreator - public static BgpPeerState fromString(String name) { - return fromString(name, BgpPeerState.class); - } - - /** @return known BgpPeerState values. */ - public static Collection values() { - return values(BgpPeerState.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/BgpPeerStatus.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/BgpPeerStatus.java deleted file mode 100644 index 1fa382aec47c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/BgpPeerStatus.java +++ /dev/null @@ -1,144 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** BGP peer status details. */ -@Immutable -public final class BgpPeerStatus { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BgpPeerStatus.class); - - /* - * The virtual network gateway's local address - */ - @JsonProperty(value = "localAddress", access = JsonProperty.Access.WRITE_ONLY) - private String localAddress; - - /* - * The remote BGP peer - */ - @JsonProperty(value = "neighbor", access = JsonProperty.Access.WRITE_ONLY) - private String neighbor; - - /* - * The autonomous system number of the remote BGP peer - */ - @JsonProperty(value = "asn", access = JsonProperty.Access.WRITE_ONLY) - private Integer asn; - - /* - * The BGP peer state - */ - @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) - private BgpPeerState state; - - /* - * For how long the peering has been up - */ - @JsonProperty(value = "connectedDuration", access = JsonProperty.Access.WRITE_ONLY) - private String connectedDuration; - - /* - * The number of routes learned from this peer - */ - @JsonProperty(value = "routesReceived", access = JsonProperty.Access.WRITE_ONLY) - private Long routesReceived; - - /* - * The number of BGP messages sent - */ - @JsonProperty(value = "messagesSent", access = JsonProperty.Access.WRITE_ONLY) - private Long messagesSent; - - /* - * The number of BGP messages received - */ - @JsonProperty(value = "messagesReceived", access = JsonProperty.Access.WRITE_ONLY) - private Long messagesReceived; - - /** - * Get the localAddress property: The virtual network gateway's local address. - * - * @return the localAddress value. - */ - public String localAddress() { - return this.localAddress; - } - - /** - * Get the neighbor property: The remote BGP peer. - * - * @return the neighbor value. - */ - public String neighbor() { - return this.neighbor; - } - - /** - * Get the asn property: The autonomous system number of the remote BGP peer. - * - * @return the asn value. - */ - public Integer asn() { - return this.asn; - } - - /** - * Get the state property: The BGP peer state. - * - * @return the state value. - */ - public BgpPeerState state() { - return this.state; - } - - /** - * Get the connectedDuration property: For how long the peering has been up. - * - * @return the connectedDuration value. - */ - public String connectedDuration() { - return this.connectedDuration; - } - - /** - * Get the routesReceived property: The number of routes learned from this peer. - * - * @return the routesReceived value. - */ - public Long routesReceived() { - return this.routesReceived; - } - - /** - * Get the messagesSent property: The number of BGP messages sent. - * - * @return the messagesSent value. - */ - public Long messagesSent() { - return this.messagesSent; - } - - /** - * Get the messagesReceived property: The number of BGP messages received. - * - * @return the messagesReceived value. - */ - public Long messagesReceived() { - return this.messagesReceived; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/BgpServiceCommunityListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/BgpServiceCommunityListResult.java deleted file mode 100644 index df964c837588..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/BgpServiceCommunityListResult.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.BgpServiceCommunityInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Response for the ListServiceCommunity API service call. */ -@Fluent -public final class BgpServiceCommunityListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BgpServiceCommunityListResult.class); - - /* - * A list of service community resources. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to get the next set of results. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: A list of service community resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: A list of service community resources. - * - * @param value the value value to set. - * @return the BgpServiceCommunityListResult object itself. - */ - public BgpServiceCommunityListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to get the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The URL to get the next set of results. - * - * @param nextLink the nextLink value to set. - * @return the BgpServiceCommunityListResult object itself. - */ - public BgpServiceCommunityListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/BgpSettings.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/BgpSettings.java deleted file mode 100644 index 765610cc78ff..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/BgpSettings.java +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** BGP settings details. */ -@Fluent -public final class BgpSettings { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BgpSettings.class); - - /* - * The BGP speaker's ASN. - */ - @JsonProperty(value = "asn") - private Long asn; - - /* - * The BGP peering address and BGP identifier of this BGP speaker. - */ - @JsonProperty(value = "bgpPeeringAddress") - private String bgpPeeringAddress; - - /* - * The weight added to routes learned from this BGP speaker. - */ - @JsonProperty(value = "peerWeight") - private Integer peerWeight; - - /** - * Get the asn property: The BGP speaker's ASN. - * - * @return the asn value. - */ - public Long asn() { - return this.asn; - } - - /** - * Set the asn property: The BGP speaker's ASN. - * - * @param asn the asn value to set. - * @return the BgpSettings object itself. - */ - public BgpSettings withAsn(Long asn) { - this.asn = asn; - return this; - } - - /** - * Get the bgpPeeringAddress property: The BGP peering address and BGP identifier of this BGP speaker. - * - * @return the bgpPeeringAddress value. - */ - public String bgpPeeringAddress() { - return this.bgpPeeringAddress; - } - - /** - * Set the bgpPeeringAddress property: The BGP peering address and BGP identifier of this BGP speaker. - * - * @param bgpPeeringAddress the bgpPeeringAddress value to set. - * @return the BgpSettings object itself. - */ - public BgpSettings withBgpPeeringAddress(String bgpPeeringAddress) { - this.bgpPeeringAddress = bgpPeeringAddress; - return this; - } - - /** - * Get the peerWeight property: The weight added to routes learned from this BGP speaker. - * - * @return the peerWeight value. - */ - public Integer peerWeight() { - return this.peerWeight; - } - - /** - * Set the peerWeight property: The weight added to routes learned from this BGP speaker. - * - * @param peerWeight the peerWeight value to set. - * @return the BgpSettings object itself. - */ - public BgpSettings withPeerWeight(Integer peerWeight) { - this.peerWeight = peerWeight; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/CircuitConnectionStatus.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/CircuitConnectionStatus.java deleted file mode 100644 index 5b516e631587..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/CircuitConnectionStatus.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for CircuitConnectionStatus. */ -public final class CircuitConnectionStatus extends ExpandableStringEnum { - /** Static value Connected for CircuitConnectionStatus. */ - public static final CircuitConnectionStatus CONNECTED = fromString("Connected"); - - /** Static value Connecting for CircuitConnectionStatus. */ - public static final CircuitConnectionStatus CONNECTING = fromString("Connecting"); - - /** Static value Disconnected for CircuitConnectionStatus. */ - public static final CircuitConnectionStatus DISCONNECTED = fromString("Disconnected"); - - /** - * Creates or finds a CircuitConnectionStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding CircuitConnectionStatus. - */ - @JsonCreator - public static CircuitConnectionStatus fromString(String name) { - return fromString(name, CircuitConnectionStatus.class); - } - - /** @return known CircuitConnectionStatus values. */ - public static Collection values() { - return values(CircuitConnectionStatus.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ConnectionMonitor.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ConnectionMonitor.java deleted file mode 100644 index 6278e5a78e12..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ConnectionMonitor.java +++ /dev/null @@ -1,206 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.network.fluent.models.ConnectionMonitorResultInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasId; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasName; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.model.Indexable; -import java.time.OffsetDateTime; -import java.util.Map; -import reactor.core.publisher.Mono; - -/** Client-side representation of Connection Monitor object, associated with Network Watcher. */ -@Fluent -public interface ConnectionMonitor extends HasInnerModel, HasName, HasId, Indexable { - /** @return connection monitor location */ - String location(); - - /** @return connection monitor tags */ - Map tags(); - - /** @return the source property */ - ConnectionMonitorSource source(); - - /** @return the destination property */ - ConnectionMonitorDestination destination(); - - /** - * Determines if the connection monitor will start automatically once created. - * - * @return true if the connection monitor will start automatically once created, false otherwise - */ - boolean autoStart(); - - /** @return the provisioning state of the connection monitor */ - ProvisioningState provisioningState(); - - /** @return the date and time when the connection monitor was started */ - OffsetDateTime startTime(); - - /** @return the monitoring status of the connection monitor */ - String monitoringStatus(); - - /** @return monitoring interval in seconds */ - int monitoringIntervalInSeconds(); - - /** Stops a specified connection monitor. */ - void stop(); - - /** - * Stops a specified connection monitor asynchronously. - * - * @return the handle to the REST call - */ - Mono stopAsync(); - - /** Starts a specified connection monitor. */ - void start(); - - /** - * Starts a specified connection monitor asynchronously. - * - * @return the handle to the REST call - */ - Mono startAsync(); - - /** - * Query a snapshot of the most recent connection state of a connection monitor. - * - * @return snapshot of the most recent connection state - */ - ConnectionMonitorQueryResult query(); - - /** - * Query a snapshot of the most recent connection state of a connection monitor asynchronously. - * - * @return snapshot of the most recent connection state - */ - Mono queryAsync(); - - /** The entirety of the connection monitor definition. */ - interface Definition - extends DefinitionStages.WithSource, - DefinitionStages.WithDestination, - DefinitionStages.WithDestinationPort, - DefinitionStages.WithCreate { - } - - /** Grouping of connection monitor definition stages. */ - interface DefinitionStages { - - /** Sets the source property. */ - interface WithSource { - /** - * @param resourceId the ID of the resource used as the source by connection monitor - * @return next definition stage - */ - WithDestination withSourceId(String resourceId); - - /** - * @param vm virtual machine used as the source by connection monitor - * @return next definition stage - */ - WithDestination withSource(HasNetworkInterfaces vm); - } - - /** Sets the source port used by connection monitor. */ - interface WithSourcePort { - /** - * @param port source port used by connection monitor - * @return next definition stage - */ - WithDestination withSourcePort(int port); - } - - /** Sets the destination. */ - interface WithDestination { - /** - * @param resourceId the ID of the resource used as the source by connection monitor - * @return next definition stage - */ - WithDestinationPort withDestinationId(String resourceId); - - /** - * @param vm virtual machine used as the source by connection monitor - * @return next definition stage - */ - WithDestinationPort withDestination(HasNetworkInterfaces vm); - - /** - * @param address address of the connection monitor destination (IP or domain name) - * @return next definition stage - */ - WithDestinationPort withDestinationAddress(String address); - } - - /** Sets the destination port used by connection monitor. */ - interface WithDestinationPort { - /** - * @param port the ID of the resource used as the source by connection monitor - * @return next definition stage - */ - WithCreate withDestinationPort(int port); - } - - /** - * Determines if the connection monitor will start automatically once created. By default it is started - * automatically. - */ - interface WithAutoStart { - /** - * Disable auto start. - * - * @return next definition stage - */ - WithCreate withoutAutoStart(); - } - - /** Sets monitoring interval in seconds. */ - interface WithMonitoringInterval { - /** - * @param seconds monitoring interval in seconds - * @return next definition stage - */ - WithCreate withMonitoringInterval(int seconds); - } - - /** The stage of the connection monitor definition allowing to add or update tags. */ - interface WithTags { - /** - * Specifies tags for the connection monitor. - * - * @param tags tags indexed by name - * @return the next stage of the definition - */ - WithCreate withTags(Map tags); - - /** - * Adds a tag to the connection monitor. - * - * @param key the key for the tag - * @param value the value for the tag - * @return the next stage of the definition - */ - WithCreate withTag(String key, String value); - - /** - * Removes a tag from the connection monitor. - * - * @param key the key of the tag to remove - * @return the next stage of the definition - */ - WithCreate withoutTag(String key); - } - - /** - * The stage of the connection monitor definition allowing creating and updating. - */ - interface WithCreate - extends Creatable, WithSourcePort, WithAutoStart, WithMonitoringInterval, WithTags { - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ConnectionMonitorDestination.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ConnectionMonitorDestination.java deleted file mode 100644 index 6f733fc10745..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ConnectionMonitorDestination.java +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describes the destination of connection monitor. */ -@Fluent -public final class ConnectionMonitorDestination { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectionMonitorDestination.class); - - /* - * The ID of the resource used as the destination by connection monitor. - */ - @JsonProperty(value = "resourceId") - private String resourceId; - - /* - * Address of the connection monitor destination (IP or domain name). - */ - @JsonProperty(value = "address") - private String address; - - /* - * The destination port used by connection monitor. - */ - @JsonProperty(value = "port") - private Integer port; - - /** - * Get the resourceId property: The ID of the resource used as the destination by connection monitor. - * - * @return the resourceId value. - */ - public String resourceId() { - return this.resourceId; - } - - /** - * Set the resourceId property: The ID of the resource used as the destination by connection monitor. - * - * @param resourceId the resourceId value to set. - * @return the ConnectionMonitorDestination object itself. - */ - public ConnectionMonitorDestination withResourceId(String resourceId) { - this.resourceId = resourceId; - return this; - } - - /** - * Get the address property: Address of the connection monitor destination (IP or domain name). - * - * @return the address value. - */ - public String address() { - return this.address; - } - - /** - * Set the address property: Address of the connection monitor destination (IP or domain name). - * - * @param address the address value to set. - * @return the ConnectionMonitorDestination object itself. - */ - public ConnectionMonitorDestination withAddress(String address) { - this.address = address; - return this; - } - - /** - * Get the port property: The destination port used by connection monitor. - * - * @return the port value. - */ - public Integer port() { - return this.port; - } - - /** - * Set the port property: The destination port used by connection monitor. - * - * @param port the port value to set. - * @return the ConnectionMonitorDestination object itself. - */ - public ConnectionMonitorDestination withPort(Integer port) { - this.port = port; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ConnectionMonitorListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ConnectionMonitorListResult.java deleted file mode 100644 index 7c81f71caef1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ConnectionMonitorListResult.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.ConnectionMonitorResultInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** List of connection monitors. */ -@Fluent -public final class ConnectionMonitorListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectionMonitorListResult.class); - - /* - * Information about connection monitors. - */ - @JsonProperty(value = "value") - private List value; - - /** - * Get the value property: Information about connection monitors. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Information about connection monitors. - * - * @param value the value value to set. - * @return the ConnectionMonitorListResult object itself. - */ - public ConnectionMonitorListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ConnectionMonitorQueryResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ConnectionMonitorQueryResult.java deleted file mode 100644 index 58701f2f37ab..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ConnectionMonitorQueryResult.java +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.network.fluent.models.ConnectionMonitorQueryResultInner; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import java.util.List; - -/** List of connection states snaphots. */ -@Fluent -public interface ConnectionMonitorQueryResult extends HasInnerModel { - /** @return status of connection monitor source */ - ConnectionMonitorSourceStatus sourceStatus(); - - /** @return information about connection states */ - List states(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ConnectionMonitorSource.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ConnectionMonitorSource.java deleted file mode 100644 index f555f31e75a3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ConnectionMonitorSource.java +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describes the source of connection monitor. */ -@Fluent -public final class ConnectionMonitorSource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectionMonitorSource.class); - - /* - * The ID of the resource used as the source by connection monitor. - */ - @JsonProperty(value = "resourceId", required = true) - private String resourceId; - - /* - * The source port used by connection monitor. - */ - @JsonProperty(value = "port") - private Integer port; - - /** - * Get the resourceId property: The ID of the resource used as the source by connection monitor. - * - * @return the resourceId value. - */ - public String resourceId() { - return this.resourceId; - } - - /** - * Set the resourceId property: The ID of the resource used as the source by connection monitor. - * - * @param resourceId the resourceId value to set. - * @return the ConnectionMonitorSource object itself. - */ - public ConnectionMonitorSource withResourceId(String resourceId) { - this.resourceId = resourceId; - return this; - } - - /** - * Get the port property: The source port used by connection monitor. - * - * @return the port value. - */ - public Integer port() { - return this.port; - } - - /** - * Set the port property: The source port used by connection monitor. - * - * @param port the port value to set. - * @return the ConnectionMonitorSource object itself. - */ - public ConnectionMonitorSource withPort(Integer port) { - this.port = port; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (resourceId() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property resourceId in model ConnectionMonitorSource")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ConnectionMonitorSourceStatus.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ConnectionMonitorSourceStatus.java deleted file mode 100644 index 9cd3a74e500b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ConnectionMonitorSourceStatus.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ConnectionMonitorSourceStatus. */ -public final class ConnectionMonitorSourceStatus extends ExpandableStringEnum { - /** Static value Uknown for ConnectionMonitorSourceStatus. */ - public static final ConnectionMonitorSourceStatus UKNOWN = fromString("Uknown"); - - /** Static value Active for ConnectionMonitorSourceStatus. */ - public static final ConnectionMonitorSourceStatus ACTIVE = fromString("Active"); - - /** Static value Inactive for ConnectionMonitorSourceStatus. */ - public static final ConnectionMonitorSourceStatus INACTIVE = fromString("Inactive"); - - /** - * Creates or finds a ConnectionMonitorSourceStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding ConnectionMonitorSourceStatus. - */ - @JsonCreator - public static ConnectionMonitorSourceStatus fromString(String name) { - return fromString(name, ConnectionMonitorSourceStatus.class); - } - - /** @return known ConnectionMonitorSourceStatus values. */ - public static Collection values() { - return values(ConnectionMonitorSourceStatus.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ConnectionMonitors.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ConnectionMonitors.java deleted file mode 100644 index 30db728d2fb7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ConnectionMonitors.java +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingByName; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsCreating; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingByName; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; - -/** Entry point to connection monitors management API in Azure. */ -@Fluent -public interface ConnectionMonitors - extends SupportsCreating, - SupportsListing, - SupportsGettingByName, - SupportsDeletingByName { -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ConnectionState.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ConnectionState.java deleted file mode 100644 index ce3dff04b16b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ConnectionState.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ConnectionState. */ -public final class ConnectionState extends ExpandableStringEnum { - /** Static value Reachable for ConnectionState. */ - public static final ConnectionState REACHABLE = fromString("Reachable"); - - /** Static value Unreachable for ConnectionState. */ - public static final ConnectionState UNREACHABLE = fromString("Unreachable"); - - /** Static value Unknown for ConnectionState. */ - public static final ConnectionState UNKNOWN = fromString("Unknown"); - - /** - * Creates or finds a ConnectionState from its string representation. - * - * @param name a name to look for. - * @return the corresponding ConnectionState. - */ - @JsonCreator - public static ConnectionState fromString(String name) { - return fromString(name, ConnectionState.class); - } - - /** @return known ConnectionState values. */ - public static Collection values() { - return values(ConnectionState.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ConnectionStateSnapshot.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ConnectionStateSnapshot.java deleted file mode 100644 index 5b619c64e954..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ConnectionStateSnapshot.java +++ /dev/null @@ -1,278 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; - -/** Connection state snapshot. */ -@Fluent -public final class ConnectionStateSnapshot { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectionStateSnapshot.class); - - /* - * The connection state. - */ - @JsonProperty(value = "connectionState") - private ConnectionState connectionState; - - /* - * The start time of the connection snapshot. - */ - @JsonProperty(value = "startTime") - private OffsetDateTime startTime; - - /* - * The end time of the connection snapshot. - */ - @JsonProperty(value = "endTime") - private OffsetDateTime endTime; - - /* - * Connectivity analysis evaluation state. - */ - @JsonProperty(value = "evaluationState") - private EvaluationState evaluationState; - - /* - * Average latency in ms. - */ - @JsonProperty(value = "avgLatencyInMs") - private Integer avgLatencyInMs; - - /* - * Minimum latency in ms. - */ - @JsonProperty(value = "minLatencyInMs") - private Integer minLatencyInMs; - - /* - * Maximum latency in ms. - */ - @JsonProperty(value = "maxLatencyInMs") - private Integer maxLatencyInMs; - - /* - * The number of sent probes. - */ - @JsonProperty(value = "probesSent") - private Integer probesSent; - - /* - * The number of failed probes. - */ - @JsonProperty(value = "probesFailed") - private Integer probesFailed; - - /* - * List of hops between the source and the destination. - */ - @JsonProperty(value = "hops", access = JsonProperty.Access.WRITE_ONLY) - private List hops; - - /** - * Get the connectionState property: The connection state. - * - * @return the connectionState value. - */ - public ConnectionState connectionState() { - return this.connectionState; - } - - /** - * Set the connectionState property: The connection state. - * - * @param connectionState the connectionState value to set. - * @return the ConnectionStateSnapshot object itself. - */ - public ConnectionStateSnapshot withConnectionState(ConnectionState connectionState) { - this.connectionState = connectionState; - return this; - } - - /** - * Get the startTime property: The start time of the connection snapshot. - * - * @return the startTime value. - */ - public OffsetDateTime startTime() { - return this.startTime; - } - - /** - * Set the startTime property: The start time of the connection snapshot. - * - * @param startTime the startTime value to set. - * @return the ConnectionStateSnapshot object itself. - */ - public ConnectionStateSnapshot withStartTime(OffsetDateTime startTime) { - this.startTime = startTime; - return this; - } - - /** - * Get the endTime property: The end time of the connection snapshot. - * - * @return the endTime value. - */ - public OffsetDateTime endTime() { - return this.endTime; - } - - /** - * Set the endTime property: The end time of the connection snapshot. - * - * @param endTime the endTime value to set. - * @return the ConnectionStateSnapshot object itself. - */ - public ConnectionStateSnapshot withEndTime(OffsetDateTime endTime) { - this.endTime = endTime; - return this; - } - - /** - * Get the evaluationState property: Connectivity analysis evaluation state. - * - * @return the evaluationState value. - */ - public EvaluationState evaluationState() { - return this.evaluationState; - } - - /** - * Set the evaluationState property: Connectivity analysis evaluation state. - * - * @param evaluationState the evaluationState value to set. - * @return the ConnectionStateSnapshot object itself. - */ - public ConnectionStateSnapshot withEvaluationState(EvaluationState evaluationState) { - this.evaluationState = evaluationState; - return this; - } - - /** - * Get the avgLatencyInMs property: Average latency in ms. - * - * @return the avgLatencyInMs value. - */ - public Integer avgLatencyInMs() { - return this.avgLatencyInMs; - } - - /** - * Set the avgLatencyInMs property: Average latency in ms. - * - * @param avgLatencyInMs the avgLatencyInMs value to set. - * @return the ConnectionStateSnapshot object itself. - */ - public ConnectionStateSnapshot withAvgLatencyInMs(Integer avgLatencyInMs) { - this.avgLatencyInMs = avgLatencyInMs; - return this; - } - - /** - * Get the minLatencyInMs property: Minimum latency in ms. - * - * @return the minLatencyInMs value. - */ - public Integer minLatencyInMs() { - return this.minLatencyInMs; - } - - /** - * Set the minLatencyInMs property: Minimum latency in ms. - * - * @param minLatencyInMs the minLatencyInMs value to set. - * @return the ConnectionStateSnapshot object itself. - */ - public ConnectionStateSnapshot withMinLatencyInMs(Integer minLatencyInMs) { - this.minLatencyInMs = minLatencyInMs; - return this; - } - - /** - * Get the maxLatencyInMs property: Maximum latency in ms. - * - * @return the maxLatencyInMs value. - */ - public Integer maxLatencyInMs() { - return this.maxLatencyInMs; - } - - /** - * Set the maxLatencyInMs property: Maximum latency in ms. - * - * @param maxLatencyInMs the maxLatencyInMs value to set. - * @return the ConnectionStateSnapshot object itself. - */ - public ConnectionStateSnapshot withMaxLatencyInMs(Integer maxLatencyInMs) { - this.maxLatencyInMs = maxLatencyInMs; - return this; - } - - /** - * Get the probesSent property: The number of sent probes. - * - * @return the probesSent value. - */ - public Integer probesSent() { - return this.probesSent; - } - - /** - * Set the probesSent property: The number of sent probes. - * - * @param probesSent the probesSent value to set. - * @return the ConnectionStateSnapshot object itself. - */ - public ConnectionStateSnapshot withProbesSent(Integer probesSent) { - this.probesSent = probesSent; - return this; - } - - /** - * Get the probesFailed property: The number of failed probes. - * - * @return the probesFailed value. - */ - public Integer probesFailed() { - return this.probesFailed; - } - - /** - * Set the probesFailed property: The number of failed probes. - * - * @param probesFailed the probesFailed value to set. - * @return the ConnectionStateSnapshot object itself. - */ - public ConnectionStateSnapshot withProbesFailed(Integer probesFailed) { - this.probesFailed = probesFailed; - return this; - } - - /** - * Get the hops property: List of hops between the source and the destination. - * - * @return the hops value. - */ - public List hops() { - return this.hops; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (hops() != null) { - hops().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ConnectionStatus.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ConnectionStatus.java deleted file mode 100644 index 6b070d344c07..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ConnectionStatus.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ConnectionStatus. */ -public final class ConnectionStatus extends ExpandableStringEnum { - /** Static value Unknown for ConnectionStatus. */ - public static final ConnectionStatus UNKNOWN = fromString("Unknown"); - - /** Static value Connected for ConnectionStatus. */ - public static final ConnectionStatus CONNECTED = fromString("Connected"); - - /** Static value Disconnected for ConnectionStatus. */ - public static final ConnectionStatus DISCONNECTED = fromString("Disconnected"); - - /** Static value Degraded for ConnectionStatus. */ - public static final ConnectionStatus DEGRADED = fromString("Degraded"); - - /** - * Creates or finds a ConnectionStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding ConnectionStatus. - */ - @JsonCreator - public static ConnectionStatus fromString(String name) { - return fromString(name, ConnectionStatus.class); - } - - /** @return known ConnectionStatus values. */ - public static Collection values() { - return values(ConnectionStatus.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ConnectivityCheck.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ConnectivityCheck.java deleted file mode 100644 index 6b2783c9143e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ConnectivityCheck.java +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasParent; -import com.azure.resourcemanager.resources.fluentcore.model.Executable; -import java.util.List; - -/** - * A client-side representation allowing user to verify the possibility of establishing a direct TCP connection from a - * virtual machine to a given endpoint including another VM or an arbitrary remote server. - */ -@Fluent -public interface ConnectivityCheck extends Executable, HasParent { - /** @return list of hops between the source and the destination */ - List hops(); - - /** @return the connection status */ - ConnectionStatus connectionStatus(); - - /** @return average latency in milliseconds */ - int avgLatencyInMs(); - - /** @return minimum latency in milliseconds */ - int minLatencyInMs(); - - /** @return maximum latency in milliseconds */ - int maxLatencyInMs(); - - /** @return total number of probes sent */ - int probesSent(); - - /** @return number of failed probes */ - int probesFailed(); - - /** The entirety of connectivity check parameters definition. */ - interface Definition - extends DefinitionStages.ToDestination, - DefinitionStages.ToDestinationPort, - DefinitionStages.FromSourceVirtualMachine, - DefinitionStages.WithExecute { - } - - /** Grouping of connectivity check parameters definition stages. */ - interface DefinitionStages { - /** Sets the source property. */ - interface FromSourceVirtualMachine { - /** - * @param resourceId the ID of the virtual machine from which a connectivity check will be initiated - * @return next definition stage - */ - WithExecute fromSourceVirtualMachine(String resourceId); - /** - * @param vm virtual machine from which a connectivity check will be initiated - * @return next definition stage - */ - WithExecute fromSourceVirtualMachine(HasNetworkInterfaces vm); - } - - /** Sets the destination property. */ - interface ToDestination { - /** - * @param resourceId the ID of the resource to which a connection attempt will be made - * @return next definition stage - */ - ToDestinationPort toDestinationResourceId(String resourceId); - - /** - * @param address the IP address or URI the resource to which a connection attempt will be made - * @return next definition stage - */ - ToDestinationPort toDestinationAddress(String address); - } - - /** Sets the destination port on which check connectivity will be performed. */ - interface ToDestinationPort { - /** - * @param port destination port - * @return next definition stage - */ - FromSourceVirtualMachine toDestinationPort(int port); - } - - /** Sets the source port from which a connectivity check will be performed. */ - interface FromSourcePort { - /** - * @param port source port - * @return next definition stage - */ - WithExecute fromSourcePort(int port); - } - - /** - * The stage of the definition which contains all the minimum required inputs for execution, but also allows for - * any other optional settings to be specified. - */ - interface WithExecute - extends Executable, - FromSourcePort, - HasProtocol.DefinitionStages.WithProtocol { - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ConnectivityDestination.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ConnectivityDestination.java deleted file mode 100644 index ce2bea6c7523..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ConnectivityDestination.java +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Parameters that define destination of connection. */ -@Fluent -public final class ConnectivityDestination { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectivityDestination.class); - - /* - * The ID of the resource to which a connection attempt will be made. - */ - @JsonProperty(value = "resourceId") - private String resourceId; - - /* - * The IP address or URI the resource to which a connection attempt will be - * made. - */ - @JsonProperty(value = "address") - private String address; - - /* - * Port on which check connectivity will be performed. - */ - @JsonProperty(value = "port") - private Integer port; - - /** - * Get the resourceId property: The ID of the resource to which a connection attempt will be made. - * - * @return the resourceId value. - */ - public String resourceId() { - return this.resourceId; - } - - /** - * Set the resourceId property: The ID of the resource to which a connection attempt will be made. - * - * @param resourceId the resourceId value to set. - * @return the ConnectivityDestination object itself. - */ - public ConnectivityDestination withResourceId(String resourceId) { - this.resourceId = resourceId; - return this; - } - - /** - * Get the address property: The IP address or URI the resource to which a connection attempt will be made. - * - * @return the address value. - */ - public String address() { - return this.address; - } - - /** - * Set the address property: The IP address or URI the resource to which a connection attempt will be made. - * - * @param address the address value to set. - * @return the ConnectivityDestination object itself. - */ - public ConnectivityDestination withAddress(String address) { - this.address = address; - return this; - } - - /** - * Get the port property: Port on which check connectivity will be performed. - * - * @return the port value. - */ - public Integer port() { - return this.port; - } - - /** - * Set the port property: Port on which check connectivity will be performed. - * - * @param port the port value to set. - * @return the ConnectivityDestination object itself. - */ - public ConnectivityDestination withPort(Integer port) { - this.port = port; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ConnectivityHop.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ConnectivityHop.java deleted file mode 100644 index a44378207ede..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ConnectivityHop.java +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Information about a hop between the source and the destination. */ -@Immutable -public final class ConnectivityHop { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectivityHop.class); - - /* - * The type of the hop. - */ - @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) - private String type; - - /* - * The ID of the hop. - */ - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) - private String id; - - /* - * The IP address of the hop. - */ - @JsonProperty(value = "address", access = JsonProperty.Access.WRITE_ONLY) - private String address; - - /* - * The ID of the resource corresponding to this hop. - */ - @JsonProperty(value = "resourceId", access = JsonProperty.Access.WRITE_ONLY) - private String resourceId; - - /* - * List of next hop identifiers. - */ - @JsonProperty(value = "nextHopIds", access = JsonProperty.Access.WRITE_ONLY) - private List nextHopIds; - - /* - * List of issues. - */ - @JsonProperty(value = "issues", access = JsonProperty.Access.WRITE_ONLY) - private List issues; - - /** - * Get the type property: The type of the hop. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Get the id property: The ID of the hop. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Get the address property: The IP address of the hop. - * - * @return the address value. - */ - public String address() { - return this.address; - } - - /** - * Get the resourceId property: The ID of the resource corresponding to this hop. - * - * @return the resourceId value. - */ - public String resourceId() { - return this.resourceId; - } - - /** - * Get the nextHopIds property: List of next hop identifiers. - * - * @return the nextHopIds value. - */ - public List nextHopIds() { - return this.nextHopIds; - } - - /** - * Get the issues property: List of issues. - * - * @return the issues value. - */ - public List issues() { - return this.issues; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (issues() != null) { - issues().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ConnectivityIssue.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ConnectivityIssue.java deleted file mode 100644 index 9e52b34296c6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ConnectivityIssue.java +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** Information about an issue encountered in the process of checking for connectivity. */ -@Immutable -public final class ConnectivityIssue { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectivityIssue.class); - - /* - * The origin of the issue. - */ - @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) - private Origin origin; - - /* - * The severity of the issue. - */ - @JsonProperty(value = "severity", access = JsonProperty.Access.WRITE_ONLY) - private Severity severity; - - /* - * The type of issue. - */ - @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) - private IssueType type; - - /* - * Provides additional context on the issue. - */ - @JsonProperty(value = "context", access = JsonProperty.Access.WRITE_ONLY) - private List> context; - - /** - * Get the origin property: The origin of the issue. - * - * @return the origin value. - */ - public Origin origin() { - return this.origin; - } - - /** - * Get the severity property: The severity of the issue. - * - * @return the severity value. - */ - public Severity severity() { - return this.severity; - } - - /** - * Get the type property: The type of issue. - * - * @return the type value. - */ - public IssueType type() { - return this.type; - } - - /** - * Get the context property: Provides additional context on the issue. - * - * @return the context value. - */ - public List> context() { - return this.context; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ConnectivityParameters.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ConnectivityParameters.java deleted file mode 100644 index d3f610b60497..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ConnectivityParameters.java +++ /dev/null @@ -1,146 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Parameters that determine how the connectivity check will be performed. */ -@Fluent -public final class ConnectivityParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectivityParameters.class); - - /* - * Parameters that define the source of the connection. - */ - @JsonProperty(value = "source", required = true) - private ConnectivitySource source; - - /* - * Parameters that define destination of connection. - */ - @JsonProperty(value = "destination", required = true) - private ConnectivityDestination destination; - - /* - * Network protocol. - */ - @JsonProperty(value = "protocol") - private Protocol protocol; - - /* - * Configuration of the protocol. - */ - @JsonProperty(value = "protocolConfiguration") - private ProtocolConfiguration protocolConfiguration; - - /** - * Get the source property: Parameters that define the source of the connection. - * - * @return the source value. - */ - public ConnectivitySource source() { - return this.source; - } - - /** - * Set the source property: Parameters that define the source of the connection. - * - * @param source the source value to set. - * @return the ConnectivityParameters object itself. - */ - public ConnectivityParameters withSource(ConnectivitySource source) { - this.source = source; - return this; - } - - /** - * Get the destination property: Parameters that define destination of connection. - * - * @return the destination value. - */ - public ConnectivityDestination destination() { - return this.destination; - } - - /** - * Set the destination property: Parameters that define destination of connection. - * - * @param destination the destination value to set. - * @return the ConnectivityParameters object itself. - */ - public ConnectivityParameters withDestination(ConnectivityDestination destination) { - this.destination = destination; - return this; - } - - /** - * Get the protocol property: Network protocol. - * - * @return the protocol value. - */ - public Protocol protocol() { - return this.protocol; - } - - /** - * Set the protocol property: Network protocol. - * - * @param protocol the protocol value to set. - * @return the ConnectivityParameters object itself. - */ - public ConnectivityParameters withProtocol(Protocol protocol) { - this.protocol = protocol; - return this; - } - - /** - * Get the protocolConfiguration property: Configuration of the protocol. - * - * @return the protocolConfiguration value. - */ - public ProtocolConfiguration protocolConfiguration() { - return this.protocolConfiguration; - } - - /** - * Set the protocolConfiguration property: Configuration of the protocol. - * - * @param protocolConfiguration the protocolConfiguration value to set. - * @return the ConnectivityParameters object itself. - */ - public ConnectivityParameters withProtocolConfiguration(ProtocolConfiguration protocolConfiguration) { - this.protocolConfiguration = protocolConfiguration; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (source() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property source in model ConnectivityParameters")); - } else { - source().validate(); - } - if (destination() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property destination in model ConnectivityParameters")); - } else { - destination().validate(); - } - if (protocolConfiguration() != null) { - protocolConfiguration().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ConnectivitySource.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ConnectivitySource.java deleted file mode 100644 index 72c6d8e69b13..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ConnectivitySource.java +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Parameters that define the source of the connection. */ -@Fluent -public final class ConnectivitySource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectivitySource.class); - - /* - * The ID of the resource from which a connectivity check will be - * initiated. - */ - @JsonProperty(value = "resourceId", required = true) - private String resourceId; - - /* - * The source port from which a connectivity check will be performed. - */ - @JsonProperty(value = "port") - private Integer port; - - /** - * Get the resourceId property: The ID of the resource from which a connectivity check will be initiated. - * - * @return the resourceId value. - */ - public String resourceId() { - return this.resourceId; - } - - /** - * Set the resourceId property: The ID of the resource from which a connectivity check will be initiated. - * - * @param resourceId the resourceId value to set. - * @return the ConnectivitySource object itself. - */ - public ConnectivitySource withResourceId(String resourceId) { - this.resourceId = resourceId; - return this; - } - - /** - * Get the port property: The source port from which a connectivity check will be performed. - * - * @return the port value. - */ - public Integer port() { - return this.port; - } - - /** - * Set the port property: The source port from which a connectivity check will be performed. - * - * @param port the port value to set. - * @return the ConnectivitySource object itself. - */ - public ConnectivitySource withPort(Integer port) { - this.port = port; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (resourceId() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property resourceId in model ConnectivitySource")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/Container.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/Container.java deleted file mode 100644 index 46ecc10a050d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/Container.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; - -/** Reference to container resource in remote resource provider. */ -@Fluent -public final class Container extends SubResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Container.class); - - /** {@inheritDoc} */ - @Override - public Container withId(String id) { - super.withId(id); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ContainerNetworkInterface.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ContainerNetworkInterface.java deleted file mode 100644 index 39733ba5cf00..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ContainerNetworkInterface.java +++ /dev/null @@ -1,201 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.ContainerNetworkInterfacePropertiesFormat; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Container network interface child resource. */ -@Fluent -public final class ContainerNetworkInterface extends SubResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ContainerNetworkInterface.class); - - /* - * Container network interface properties. - */ - @JsonProperty(value = "properties") - private ContainerNetworkInterfacePropertiesFormat innerProperties; - - /* - * The name of the resource. This name can be used to access the resource. - */ - @JsonProperty(value = "name") - private String name; - - /* - * Sub Resource type. - */ - @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) - private String type; - - /* - * A unique read-only string that changes whenever the resource is updated. - */ - @JsonProperty(value = "etag") - private String etag; - - /** - * Get the innerProperties property: Container network interface properties. - * - * @return the innerProperties value. - */ - private ContainerNetworkInterfacePropertiesFormat innerProperties() { - return this.innerProperties; - } - - /** - * Get the name property: The name of the resource. This name can be used to access the resource. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the resource. This name can be used to access the resource. - * - * @param name the name value to set. - * @return the ContainerNetworkInterface object itself. - */ - public ContainerNetworkInterface withName(String name) { - this.name = name; - return this; - } - - /** - * Get the type property: Sub Resource type. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Get the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @param etag the etag value to set. - * @return the ContainerNetworkInterface object itself. - */ - public ContainerNetworkInterface withEtag(String etag) { - this.etag = etag; - return this; - } - - /** {@inheritDoc} */ - @Override - public ContainerNetworkInterface withId(String id) { - super.withId(id); - return this; - } - - /** - * Get the containerNetworkInterfaceConfiguration property: Container network interface configuration from which - * this container network interface is created. - * - * @return the containerNetworkInterfaceConfiguration value. - */ - public ContainerNetworkInterfaceConfiguration containerNetworkInterfaceConfiguration() { - return this.innerProperties() == null ? null : this.innerProperties().containerNetworkInterfaceConfiguration(); - } - - /** - * Set the containerNetworkInterfaceConfiguration property: Container network interface configuration from which - * this container network interface is created. - * - * @param containerNetworkInterfaceConfiguration the containerNetworkInterfaceConfiguration value to set. - * @return the ContainerNetworkInterface object itself. - */ - public ContainerNetworkInterface withContainerNetworkInterfaceConfiguration( - ContainerNetworkInterfaceConfiguration containerNetworkInterfaceConfiguration) { - if (this.innerProperties() == null) { - this.innerProperties = new ContainerNetworkInterfacePropertiesFormat(); - } - this.innerProperties().withContainerNetworkInterfaceConfiguration(containerNetworkInterfaceConfiguration); - return this; - } - - /** - * Get the container property: Reference to the container to which this container network interface is attached. - * - * @return the container value. - */ - public Container container() { - return this.innerProperties() == null ? null : this.innerProperties().container(); - } - - /** - * Set the container property: Reference to the container to which this container network interface is attached. - * - * @param container the container value to set. - * @return the ContainerNetworkInterface object itself. - */ - public ContainerNetworkInterface withContainer(Container container) { - if (this.innerProperties() == null) { - this.innerProperties = new ContainerNetworkInterfacePropertiesFormat(); - } - this.innerProperties().withContainer(container); - return this; - } - - /** - * Get the ipConfigurations property: Reference to the ip configuration on this container nic. - * - * @return the ipConfigurations value. - */ - public List ipConfigurations() { - return this.innerProperties() == null ? null : this.innerProperties().ipConfigurations(); - } - - /** - * Set the ipConfigurations property: Reference to the ip configuration on this container nic. - * - * @param ipConfigurations the ipConfigurations value to set. - * @return the ContainerNetworkInterface object itself. - */ - public ContainerNetworkInterface withIpConfigurations( - List ipConfigurations) { - if (this.innerProperties() == null) { - this.innerProperties = new ContainerNetworkInterfacePropertiesFormat(); - } - this.innerProperties().withIpConfigurations(ipConfigurations); - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the resource. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ContainerNetworkInterfaceConfiguration.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ContainerNetworkInterfaceConfiguration.java deleted file mode 100644 index 11d55dbac772..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ContainerNetworkInterfaceConfiguration.java +++ /dev/null @@ -1,179 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.ContainerNetworkInterfaceConfigurationPropertiesFormat; -import com.azure.resourcemanager.network.fluent.models.IpConfigurationProfileInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Container network interface configuration child resource. */ -@Fluent -public final class ContainerNetworkInterfaceConfiguration extends SubResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ContainerNetworkInterfaceConfiguration.class); - - /* - * Container network interface configuration properties. - */ - @JsonProperty(value = "properties") - private ContainerNetworkInterfaceConfigurationPropertiesFormat innerProperties; - - /* - * The name of the resource. This name can be used to access the resource. - */ - @JsonProperty(value = "name") - private String name; - - /* - * Sub Resource type. - */ - @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) - private String type; - - /* - * A unique read-only string that changes whenever the resource is updated. - */ - @JsonProperty(value = "etag") - private String etag; - - /** - * Get the innerProperties property: Container network interface configuration properties. - * - * @return the innerProperties value. - */ - private ContainerNetworkInterfaceConfigurationPropertiesFormat innerProperties() { - return this.innerProperties; - } - - /** - * Get the name property: The name of the resource. This name can be used to access the resource. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the resource. This name can be used to access the resource. - * - * @param name the name value to set. - * @return the ContainerNetworkInterfaceConfiguration object itself. - */ - public ContainerNetworkInterfaceConfiguration withName(String name) { - this.name = name; - return this; - } - - /** - * Get the type property: Sub Resource type. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Get the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @param etag the etag value to set. - * @return the ContainerNetworkInterfaceConfiguration object itself. - */ - public ContainerNetworkInterfaceConfiguration withEtag(String etag) { - this.etag = etag; - return this; - } - - /** {@inheritDoc} */ - @Override - public ContainerNetworkInterfaceConfiguration withId(String id) { - super.withId(id); - return this; - } - - /** - * Get the ipConfigurations property: A list of ip configurations of the container network interface configuration. - * - * @return the ipConfigurations value. - */ - public List ipConfigurations() { - return this.innerProperties() == null ? null : this.innerProperties().ipConfigurations(); - } - - /** - * Set the ipConfigurations property: A list of ip configurations of the container network interface configuration. - * - * @param ipConfigurations the ipConfigurations value to set. - * @return the ContainerNetworkInterfaceConfiguration object itself. - */ - public ContainerNetworkInterfaceConfiguration withIpConfigurations( - List ipConfigurations) { - if (this.innerProperties() == null) { - this.innerProperties = new ContainerNetworkInterfaceConfigurationPropertiesFormat(); - } - this.innerProperties().withIpConfigurations(ipConfigurations); - return this; - } - - /** - * Get the containerNetworkInterfaces property: A list of container network interfaces created from this container - * network interface configuration. - * - * @return the containerNetworkInterfaces value. - */ - public List containerNetworkInterfaces() { - return this.innerProperties() == null ? null : this.innerProperties().containerNetworkInterfaces(); - } - - /** - * Set the containerNetworkInterfaces property: A list of container network interfaces created from this container - * network interface configuration. - * - * @param containerNetworkInterfaces the containerNetworkInterfaces value to set. - * @return the ContainerNetworkInterfaceConfiguration object itself. - */ - public ContainerNetworkInterfaceConfiguration withContainerNetworkInterfaces( - List containerNetworkInterfaces) { - if (this.innerProperties() == null) { - this.innerProperties = new ContainerNetworkInterfaceConfigurationPropertiesFormat(); - } - this.innerProperties().withContainerNetworkInterfaces(containerNetworkInterfaces); - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the resource. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ContainerNetworkInterfaceIpConfiguration.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ContainerNetworkInterfaceIpConfiguration.java deleted file mode 100644 index 09884b4375ac..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ContainerNetworkInterfaceIpConfiguration.java +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.ContainerNetworkInterfaceIpConfigurationPropertiesFormat; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The ip configuration for a container network interface. */ -@Fluent -public final class ContainerNetworkInterfaceIpConfiguration { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ContainerNetworkInterfaceIpConfiguration.class); - - /* - * Properties of the container network interface IP configuration. - */ - @JsonProperty(value = "properties") - private ContainerNetworkInterfaceIpConfigurationPropertiesFormat innerProperties; - - /* - * The name of the resource. This name can be used to access the resource. - */ - @JsonProperty(value = "name") - private String name; - - /* - * Sub Resource type. - */ - @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) - private String type; - - /* - * A unique read-only string that changes whenever the resource is updated. - */ - @JsonProperty(value = "etag") - private String etag; - - /** - * Get the innerProperties property: Properties of the container network interface IP configuration. - * - * @return the innerProperties value. - */ - private ContainerNetworkInterfaceIpConfigurationPropertiesFormat innerProperties() { - return this.innerProperties; - } - - /** - * Get the name property: The name of the resource. This name can be used to access the resource. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the resource. This name can be used to access the resource. - * - * @param name the name value to set. - * @return the ContainerNetworkInterfaceIpConfiguration object itself. - */ - public ContainerNetworkInterfaceIpConfiguration withName(String name) { - this.name = name; - return this; - } - - /** - * Get the type property: Sub Resource type. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Get the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @param etag the etag value to set. - * @return the ContainerNetworkInterfaceIpConfiguration object itself. - */ - public ContainerNetworkInterfaceIpConfiguration withEtag(String etag) { - this.etag = etag; - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the resource. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/DdosCustomPolicyProtocol.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/DdosCustomPolicyProtocol.java deleted file mode 100644 index 8620ace1e0ca..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/DdosCustomPolicyProtocol.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for DdosCustomPolicyProtocol. */ -public final class DdosCustomPolicyProtocol extends ExpandableStringEnum { - /** Static value Tcp for DdosCustomPolicyProtocol. */ - public static final DdosCustomPolicyProtocol TCP = fromString("Tcp"); - - /** Static value Udp for DdosCustomPolicyProtocol. */ - public static final DdosCustomPolicyProtocol UDP = fromString("Udp"); - - /** Static value Syn for DdosCustomPolicyProtocol. */ - public static final DdosCustomPolicyProtocol SYN = fromString("Syn"); - - /** - * Creates or finds a DdosCustomPolicyProtocol from its string representation. - * - * @param name a name to look for. - * @return the corresponding DdosCustomPolicyProtocol. - */ - @JsonCreator - public static DdosCustomPolicyProtocol fromString(String name) { - return fromString(name, DdosCustomPolicyProtocol.class); - } - - /** @return known DdosCustomPolicyProtocol values. */ - public static Collection values() { - return values(DdosCustomPolicyProtocol.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/DdosCustomPolicyTriggerSensitivityOverride.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/DdosCustomPolicyTriggerSensitivityOverride.java deleted file mode 100644 index 940349d1cbd8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/DdosCustomPolicyTriggerSensitivityOverride.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for DdosCustomPolicyTriggerSensitivityOverride. */ -public final class DdosCustomPolicyTriggerSensitivityOverride - extends ExpandableStringEnum { - /** Static value Relaxed for DdosCustomPolicyTriggerSensitivityOverride. */ - public static final DdosCustomPolicyTriggerSensitivityOverride RELAXED = fromString("Relaxed"); - - /** Static value Low for DdosCustomPolicyTriggerSensitivityOverride. */ - public static final DdosCustomPolicyTriggerSensitivityOverride LOW = fromString("Low"); - - /** Static value Default for DdosCustomPolicyTriggerSensitivityOverride. */ - public static final DdosCustomPolicyTriggerSensitivityOverride DEFAULT = fromString("Default"); - - /** Static value High for DdosCustomPolicyTriggerSensitivityOverride. */ - public static final DdosCustomPolicyTriggerSensitivityOverride HIGH = fromString("High"); - - /** - * Creates or finds a DdosCustomPolicyTriggerSensitivityOverride from its string representation. - * - * @param name a name to look for. - * @return the corresponding DdosCustomPolicyTriggerSensitivityOverride. - */ - @JsonCreator - public static DdosCustomPolicyTriggerSensitivityOverride fromString(String name) { - return fromString(name, DdosCustomPolicyTriggerSensitivityOverride.class); - } - - /** @return known DdosCustomPolicyTriggerSensitivityOverride values. */ - public static Collection values() { - return values(DdosCustomPolicyTriggerSensitivityOverride.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/DdosProtectionPlan.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/DdosProtectionPlan.java deleted file mode 100644 index 82c0126a014c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/DdosProtectionPlan.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.network.fluent.models.DdosProtectionPlanInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.GroupableResource; -import com.azure.resourcemanager.resources.fluentcore.arm.models.Resource; -import com.azure.resourcemanager.resources.fluentcore.model.Appliable; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; -import com.azure.resourcemanager.resources.fluentcore.model.Updatable; -import java.util.List; - -/** DDoS protection plan. */ -@Fluent -public interface DdosProtectionPlan - extends GroupableResource, - Refreshable, - Updatable { - /** - * @return the resource GUID property of the DDoS protection plan resource. It uniquely identifies a resource, even - * if the user changes its name or migrate the resource across subscriptions or resource groups. - */ - String resourceGuid(); - - /** @return the provisioning state of the DDoS protection plan resource */ - String provisioningState(); - - /** - * @return the list of virtual networks associated with the DDoS protection plan resource. This list is read-only. - */ - List virtualNetworks(); - - // Fluent interfaces for creating DDoS protection plan - - /** The entirety of the DDoS protection plan definition. */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { - } - - /** Grouping of DDoS protection plan definition stages. */ - interface DefinitionStages { - /** The first stage of the definition. */ - interface Blank extends GroupableResource.DefinitionWithRegion { - } - - /** The stage allowing to specify the resource group. */ - interface WithGroup extends GroupableResource.DefinitionStages.WithGroup { - } - - /** - * The stage of the definition which contains all the minimum required inputs for the resource to be created - * (via {@link WithCreate#create()}), but also allows for any other optional settings to be specified. - */ - interface WithCreate extends Creatable, Resource.DefinitionWithTags { - } - } - - /** - * The template for an update operation, containing all the settings that can be modified. - * - *

    Call {@link Update#apply()} to apply the changes to the resource in Azure. - */ - interface Update extends Appliable, Resource.UpdateWithTags { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/DdosProtectionPlanListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/DdosProtectionPlanListResult.java deleted file mode 100644 index e951d03e9884..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/DdosProtectionPlanListResult.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.DdosProtectionPlanInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** A list of DDoS protection plans. */ -@Fluent -public final class DdosProtectionPlanListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DdosProtectionPlanListResult.class); - - /* - * A list of DDoS protection plans. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to get the next set of results. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: A list of DDoS protection plans. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: A list of DDoS protection plans. - * - * @param value the value value to set. - * @return the DdosProtectionPlanListResult object itself. - */ - public DdosProtectionPlanListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to get the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/DdosProtectionPlans.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/DdosProtectionPlans.java deleted file mode 100644 index dced3184b0e1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/DdosProtectionPlans.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsBatchDeletion; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsDeletingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsListingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsBatchCreation; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsCreating; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingById; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; - -/** Entry point to DDoS protection plans management. */ -@Fluent -public interface DdosProtectionPlans - extends SupportsCreating, - SupportsListing, - SupportsListingByResourceGroup, - SupportsGettingByResourceGroup, - SupportsGettingById, - SupportsDeletingById, - SupportsDeletingByResourceGroup, - SupportsBatchCreation, - SupportsBatchDeletion, - HasManager { -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/DdosSettings.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/DdosSettings.java deleted file mode 100644 index 9bf0af1944a0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/DdosSettings.java +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Contains the DDoS protection settings of the public IP. */ -@Fluent -public final class DdosSettings { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DdosSettings.class); - - /* - * The DDoS custom policy associated with the public IP. - */ - @JsonProperty(value = "ddosCustomPolicy") - private SubResource ddosCustomPolicy; - - /* - * The DDoS protection policy customizability of the public IP. Only - * standard coverage will have the ability to be customized. - */ - @JsonProperty(value = "protectionCoverage") - private DdosSettingsProtectionCoverage protectionCoverage; - - /** - * Get the ddosCustomPolicy property: The DDoS custom policy associated with the public IP. - * - * @return the ddosCustomPolicy value. - */ - public SubResource ddosCustomPolicy() { - return this.ddosCustomPolicy; - } - - /** - * Set the ddosCustomPolicy property: The DDoS custom policy associated with the public IP. - * - * @param ddosCustomPolicy the ddosCustomPolicy value to set. - * @return the DdosSettings object itself. - */ - public DdosSettings withDdosCustomPolicy(SubResource ddosCustomPolicy) { - this.ddosCustomPolicy = ddosCustomPolicy; - return this; - } - - /** - * Get the protectionCoverage property: The DDoS protection policy customizability of the public IP. Only standard - * coverage will have the ability to be customized. - * - * @return the protectionCoverage value. - */ - public DdosSettingsProtectionCoverage protectionCoverage() { - return this.protectionCoverage; - } - - /** - * Set the protectionCoverage property: The DDoS protection policy customizability of the public IP. Only standard - * coverage will have the ability to be customized. - * - * @param protectionCoverage the protectionCoverage value to set. - * @return the DdosSettings object itself. - */ - public DdosSettings withProtectionCoverage(DdosSettingsProtectionCoverage protectionCoverage) { - this.protectionCoverage = protectionCoverage; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/DdosSettingsProtectionCoverage.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/DdosSettingsProtectionCoverage.java deleted file mode 100644 index a113f7fd42a7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/DdosSettingsProtectionCoverage.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for DdosSettingsProtectionCoverage. */ -public final class DdosSettingsProtectionCoverage extends ExpandableStringEnum { - /** Static value Basic for DdosSettingsProtectionCoverage. */ - public static final DdosSettingsProtectionCoverage BASIC = fromString("Basic"); - - /** Static value Standard for DdosSettingsProtectionCoverage. */ - public static final DdosSettingsProtectionCoverage STANDARD = fromString("Standard"); - - /** - * Creates or finds a DdosSettingsProtectionCoverage from its string representation. - * - * @param name a name to look for. - * @return the corresponding DdosSettingsProtectionCoverage. - */ - @JsonCreator - public static DdosSettingsProtectionCoverage fromString(String name) { - return fromString(name, DdosSettingsProtectionCoverage.class); - } - - /** @return known DdosSettingsProtectionCoverage values. */ - public static Collection values() { - return values(DdosSettingsProtectionCoverage.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/Delegation.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/Delegation.java deleted file mode 100644 index 468e080210e0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/Delegation.java +++ /dev/null @@ -1,164 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.ServiceDelegationPropertiesFormat; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Details the service to which the subnet is delegated. */ -@Fluent -public final class Delegation extends SubResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Delegation.class); - - /* - * Properties of the subnet. - */ - @JsonProperty(value = "properties") - private ServiceDelegationPropertiesFormat innerProperties; - - /* - * The name of the resource that is unique within a subnet. This name can - * be used to access the resource. - */ - @JsonProperty(value = "name") - private String name; - - /* - * A unique read-only string that changes whenever the resource is updated. - */ - @JsonProperty(value = "etag") - private String etag; - - /** - * Get the innerProperties property: Properties of the subnet. - * - * @return the innerProperties value. - */ - private ServiceDelegationPropertiesFormat innerProperties() { - return this.innerProperties; - } - - /** - * Get the name property: The name of the resource that is unique within a subnet. This name can be used to access - * the resource. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the resource that is unique within a subnet. This name can be used to access - * the resource. - * - * @param name the name value to set. - * @return the Delegation object itself. - */ - public Delegation withName(String name) { - this.name = name; - return this; - } - - /** - * Get the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @param etag the etag value to set. - * @return the Delegation object itself. - */ - public Delegation withEtag(String etag) { - this.etag = etag; - return this; - } - - /** {@inheritDoc} */ - @Override - public Delegation withId(String id) { - super.withId(id); - return this; - } - - /** - * Get the serviceName property: The name of the service to whom the subnet should be delegated (e.g. - * Microsoft.Sql/servers). - * - * @return the serviceName value. - */ - public String serviceName() { - return this.innerProperties() == null ? null : this.innerProperties().serviceName(); - } - - /** - * Set the serviceName property: The name of the service to whom the subnet should be delegated (e.g. - * Microsoft.Sql/servers). - * - * @param serviceName the serviceName value to set. - * @return the Delegation object itself. - */ - public Delegation withServiceName(String serviceName) { - if (this.innerProperties() == null) { - this.innerProperties = new ServiceDelegationPropertiesFormat(); - } - this.innerProperties().withServiceName(serviceName); - return this; - } - - /** - * Get the actions property: Describes the actions permitted to the service upon delegation. - * - * @return the actions value. - */ - public List actions() { - return this.innerProperties() == null ? null : this.innerProperties().actions(); - } - - /** - * Set the actions property: Describes the actions permitted to the service upon delegation. - * - * @param actions the actions value to set. - * @return the Delegation object itself. - */ - public Delegation withActions(List actions) { - if (this.innerProperties() == null) { - this.innerProperties = new ServiceDelegationPropertiesFormat(); - } - this.innerProperties().withActions(actions); - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the resource. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/DeviceProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/DeviceProperties.java deleted file mode 100644 index d44e9893bc30..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/DeviceProperties.java +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** List of properties of the device. */ -@Fluent -public final class DeviceProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DeviceProperties.class); - - /* - * Name of the device Vendor. - */ - @JsonProperty(value = "deviceVendor") - private String deviceVendor; - - /* - * Model of the device. - */ - @JsonProperty(value = "deviceModel") - private String deviceModel; - - /* - * Link speed. - */ - @JsonProperty(value = "linkSpeedInMbps") - private Integer linkSpeedInMbps; - - /** - * Get the deviceVendor property: Name of the device Vendor. - * - * @return the deviceVendor value. - */ - public String deviceVendor() { - return this.deviceVendor; - } - - /** - * Set the deviceVendor property: Name of the device Vendor. - * - * @param deviceVendor the deviceVendor value to set. - * @return the DeviceProperties object itself. - */ - public DeviceProperties withDeviceVendor(String deviceVendor) { - this.deviceVendor = deviceVendor; - return this; - } - - /** - * Get the deviceModel property: Model of the device. - * - * @return the deviceModel value. - */ - public String deviceModel() { - return this.deviceModel; - } - - /** - * Set the deviceModel property: Model of the device. - * - * @param deviceModel the deviceModel value to set. - * @return the DeviceProperties object itself. - */ - public DeviceProperties withDeviceModel(String deviceModel) { - this.deviceModel = deviceModel; - return this; - } - - /** - * Get the linkSpeedInMbps property: Link speed. - * - * @return the linkSpeedInMbps value. - */ - public Integer linkSpeedInMbps() { - return this.linkSpeedInMbps; - } - - /** - * Set the linkSpeedInMbps property: Link speed. - * - * @param linkSpeedInMbps the linkSpeedInMbps value to set. - * @return the DeviceProperties object itself. - */ - public DeviceProperties withLinkSpeedInMbps(Integer linkSpeedInMbps) { - this.linkSpeedInMbps = linkSpeedInMbps; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/DhGroup.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/DhGroup.java deleted file mode 100644 index e524c7752d6f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/DhGroup.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for DhGroup. */ -public final class DhGroup extends ExpandableStringEnum { - /** Static value None for DhGroup. */ - public static final DhGroup NONE = fromString("None"); - - /** Static value DHGroup1 for DhGroup. */ - public static final DhGroup DHGROUP1 = fromString("DHGroup1"); - - /** Static value DHGroup2 for DhGroup. */ - public static final DhGroup DHGROUP2 = fromString("DHGroup2"); - - /** Static value DHGroup14 for DhGroup. */ - public static final DhGroup DHGROUP14 = fromString("DHGroup14"); - - /** Static value DHGroup2048 for DhGroup. */ - public static final DhGroup DHGROUP2048 = fromString("DHGroup2048"); - - /** Static value ECP256 for DhGroup. */ - public static final DhGroup ECP256 = fromString("ECP256"); - - /** Static value ECP384 for DhGroup. */ - public static final DhGroup ECP384 = fromString("ECP384"); - - /** Static value DHGroup24 for DhGroup. */ - public static final DhGroup DHGROUP24 = fromString("DHGroup24"); - - /** - * Creates or finds a DhGroup from its string representation. - * - * @param name a name to look for. - * @return the corresponding DhGroup. - */ - @JsonCreator - public static DhGroup fromString(String name) { - return fromString(name, DhGroup.class); - } - - /** @return known DhGroup values. */ - public static Collection values() { - return values(DhGroup.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/DhcpOptions.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/DhcpOptions.java deleted file mode 100644 index 39311d11cc45..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/DhcpOptions.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** - * DhcpOptions contains an array of DNS servers available to VMs deployed in the virtual network. Standard DHCP option - * for a subnet overrides VNET DHCP options. - */ -@Fluent -public final class DhcpOptions { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DhcpOptions.class); - - /* - * The list of DNS servers IP addresses. - */ - @JsonProperty(value = "dnsServers") - private List dnsServers; - - /** - * Get the dnsServers property: The list of DNS servers IP addresses. - * - * @return the dnsServers value. - */ - public List dnsServers() { - return this.dnsServers; - } - - /** - * Set the dnsServers property: The list of DNS servers IP addresses. - * - * @param dnsServers the dnsServers value to set. - * @return the DhcpOptions object itself. - */ - public DhcpOptions withDnsServers(List dnsServers) { - this.dnsServers = dnsServers; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/Dimension.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/Dimension.java deleted file mode 100644 index 33783d5328ed..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/Dimension.java +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Dimension of the metric. */ -@Fluent -public final class Dimension { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Dimension.class); - - /* - * The name of the dimension. - */ - @JsonProperty(value = "name") - private String name; - - /* - * The display name of the dimension. - */ - @JsonProperty(value = "displayName") - private String displayName; - - /* - * The internal name of the dimension. - */ - @JsonProperty(value = "internalName") - private String internalName; - - /** - * Get the name property: The name of the dimension. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the dimension. - * - * @param name the name value to set. - * @return the Dimension object itself. - */ - public Dimension withName(String name) { - this.name = name; - return this; - } - - /** - * Get the displayName property: The display name of the dimension. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Set the displayName property: The display name of the dimension. - * - * @param displayName the displayName value to set. - * @return the Dimension object itself. - */ - public Dimension withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - - /** - * Get the internalName property: The internal name of the dimension. - * - * @return the internalName value. - */ - public String internalName() { - return this.internalName; - } - - /** - * Set the internalName property: The internal name of the dimension. - * - * @param internalName the internalName value to set. - * @return the Dimension object itself. - */ - public Dimension withInternalName(String internalName) { - this.internalName = internalName; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/Direction.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/Direction.java deleted file mode 100644 index 1c157a50e9e4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/Direction.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for Direction. */ -public final class Direction extends ExpandableStringEnum { - /** Static value Inbound for Direction. */ - public static final Direction INBOUND = fromString("Inbound"); - - /** Static value Outbound for Direction. */ - public static final Direction OUTBOUND = fromString("Outbound"); - - /** - * Creates or finds a Direction from its string representation. - * - * @param name a name to look for. - * @return the corresponding Direction. - */ - @JsonCreator - public static Direction fromString(String name) { - return fromString(name, Direction.class); - } - - /** @return known Direction values. */ - public static Collection values() { - return values(Direction.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/EffectiveNetworkSecurityGroup.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/EffectiveNetworkSecurityGroup.java deleted file mode 100644 index ab984b6fac6b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/EffectiveNetworkSecurityGroup.java +++ /dev/null @@ -1,137 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Effective network security group. */ -@Fluent -public final class EffectiveNetworkSecurityGroup { - @JsonIgnore private final ClientLogger logger = new ClientLogger(EffectiveNetworkSecurityGroup.class); - - /* - * The ID of network security group that is applied. - */ - @JsonProperty(value = "networkSecurityGroup") - private SubResource networkSecurityGroup; - - /* - * Associated resources. - */ - @JsonProperty(value = "association") - private EffectiveNetworkSecurityGroupAssociation association; - - /* - * A collection of effective security rules. - */ - @JsonProperty(value = "effectiveSecurityRules") - private List effectiveSecurityRules; - - /* - * Mapping of tags to list of IP Addresses included within the tag. - */ - @JsonProperty(value = "tagMap") - private String tagMap; - - /** - * Get the networkSecurityGroup property: The ID of network security group that is applied. - * - * @return the networkSecurityGroup value. - */ - public SubResource networkSecurityGroup() { - return this.networkSecurityGroup; - } - - /** - * Set the networkSecurityGroup property: The ID of network security group that is applied. - * - * @param networkSecurityGroup the networkSecurityGroup value to set. - * @return the EffectiveNetworkSecurityGroup object itself. - */ - public EffectiveNetworkSecurityGroup withNetworkSecurityGroup(SubResource networkSecurityGroup) { - this.networkSecurityGroup = networkSecurityGroup; - return this; - } - - /** - * Get the association property: Associated resources. - * - * @return the association value. - */ - public EffectiveNetworkSecurityGroupAssociation association() { - return this.association; - } - - /** - * Set the association property: Associated resources. - * - * @param association the association value to set. - * @return the EffectiveNetworkSecurityGroup object itself. - */ - public EffectiveNetworkSecurityGroup withAssociation(EffectiveNetworkSecurityGroupAssociation association) { - this.association = association; - return this; - } - - /** - * Get the effectiveSecurityRules property: A collection of effective security rules. - * - * @return the effectiveSecurityRules value. - */ - public List effectiveSecurityRules() { - return this.effectiveSecurityRules; - } - - /** - * Set the effectiveSecurityRules property: A collection of effective security rules. - * - * @param effectiveSecurityRules the effectiveSecurityRules value to set. - * @return the EffectiveNetworkSecurityGroup object itself. - */ - public EffectiveNetworkSecurityGroup withEffectiveSecurityRules( - List effectiveSecurityRules) { - this.effectiveSecurityRules = effectiveSecurityRules; - return this; - } - - /** - * Get the tagMap property: Mapping of tags to list of IP Addresses included within the tag. - * - * @return the tagMap value. - */ - public String tagMap() { - return this.tagMap; - } - - /** - * Set the tagMap property: Mapping of tags to list of IP Addresses included within the tag. - * - * @param tagMap the tagMap value to set. - * @return the EffectiveNetworkSecurityGroup object itself. - */ - public EffectiveNetworkSecurityGroup withTagMap(String tagMap) { - this.tagMap = tagMap; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (association() != null) { - association().validate(); - } - if (effectiveSecurityRules() != null) { - effectiveSecurityRules().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/EffectiveNetworkSecurityGroupAssociation.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/EffectiveNetworkSecurityGroupAssociation.java deleted file mode 100644 index d5ec73f33b9b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/EffectiveNetworkSecurityGroupAssociation.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The effective network security group association. */ -@Fluent -public final class EffectiveNetworkSecurityGroupAssociation { - @JsonIgnore private final ClientLogger logger = new ClientLogger(EffectiveNetworkSecurityGroupAssociation.class); - - /* - * The ID of the subnet if assigned. - */ - @JsonProperty(value = "subnet") - private SubResource subnet; - - /* - * The ID of the network interface if assigned. - */ - @JsonProperty(value = "networkInterface") - private SubResource networkInterface; - - /** - * Get the subnet property: The ID of the subnet if assigned. - * - * @return the subnet value. - */ - public SubResource subnet() { - return this.subnet; - } - - /** - * Set the subnet property: The ID of the subnet if assigned. - * - * @param subnet the subnet value to set. - * @return the EffectiveNetworkSecurityGroupAssociation object itself. - */ - public EffectiveNetworkSecurityGroupAssociation withSubnet(SubResource subnet) { - this.subnet = subnet; - return this; - } - - /** - * Get the networkInterface property: The ID of the network interface if assigned. - * - * @return the networkInterface value. - */ - public SubResource networkInterface() { - return this.networkInterface; - } - - /** - * Set the networkInterface property: The ID of the network interface if assigned. - * - * @param networkInterface the networkInterface value to set. - * @return the EffectiveNetworkSecurityGroupAssociation object itself. - */ - public EffectiveNetworkSecurityGroupAssociation withNetworkInterface(SubResource networkInterface) { - this.networkInterface = networkInterface; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/EffectiveNetworkSecurityRule.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/EffectiveNetworkSecurityRule.java deleted file mode 100644 index 3d3e8a1eb75d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/EffectiveNetworkSecurityRule.java +++ /dev/null @@ -1,437 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Effective network security rules. */ -@Fluent -public final class EffectiveNetworkSecurityRule { - @JsonIgnore private final ClientLogger logger = new ClientLogger(EffectiveNetworkSecurityRule.class); - - /* - * The name of the security rule specified by the user (if created by the - * user). - */ - @JsonProperty(value = "name") - private String name; - - /* - * The network protocol this rule applies to. Possible values are: 'Tcp', - * 'Udp', and 'All'. - */ - @JsonProperty(value = "protocol") - private EffectiveSecurityRuleProtocol protocol; - - /* - * The source port or range. - */ - @JsonProperty(value = "sourcePortRange") - private String sourcePortRange; - - /* - * The destination port or range. - */ - @JsonProperty(value = "destinationPortRange") - private String destinationPortRange; - - /* - * The source port ranges. Expected values include a single integer between - * 0 and 65535, a range using '-' as separator (e.g. 100-400), or an - * asterisk (*) - */ - @JsonProperty(value = "sourcePortRanges") - private List sourcePortRanges; - - /* - * The destination port ranges. Expected values include a single integer - * between 0 and 65535, a range using '-' as separator (e.g. 100-400), or - * an asterisk (*) - */ - @JsonProperty(value = "destinationPortRanges") - private List destinationPortRanges; - - /* - * The source address prefix. - */ - @JsonProperty(value = "sourceAddressPrefix") - private String sourceAddressPrefix; - - /* - * The destination address prefix. - */ - @JsonProperty(value = "destinationAddressPrefix") - private String destinationAddressPrefix; - - /* - * The source address prefixes. Expected values include CIDR IP ranges, - * Default Tags (VirtualNetwork, AzureLoadBalancer, Internet), System Tags, - * and the asterisk (*). - */ - @JsonProperty(value = "sourceAddressPrefixes") - private List sourceAddressPrefixes; - - /* - * The destination address prefixes. Expected values include CIDR IP - * ranges, Default Tags (VirtualNetwork, AzureLoadBalancer, Internet), - * System Tags, and the asterisk (*). - */ - @JsonProperty(value = "destinationAddressPrefixes") - private List destinationAddressPrefixes; - - /* - * The expanded source address prefix. - */ - @JsonProperty(value = "expandedSourceAddressPrefix") - private List expandedSourceAddressPrefix; - - /* - * Expanded destination address prefix. - */ - @JsonProperty(value = "expandedDestinationAddressPrefix") - private List expandedDestinationAddressPrefix; - - /* - * Whether network traffic is allowed or denied. Possible values are: - * 'Allow' and 'Deny'. - */ - @JsonProperty(value = "access") - private SecurityRuleAccess access; - - /* - * The priority of the rule. - */ - @JsonProperty(value = "priority") - private Integer priority; - - /* - * The direction of the rule. Possible values are: 'Inbound and Outbound'. - */ - @JsonProperty(value = "direction") - private SecurityRuleDirection direction; - - /** - * Get the name property: The name of the security rule specified by the user (if created by the user). - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the security rule specified by the user (if created by the user). - * - * @param name the name value to set. - * @return the EffectiveNetworkSecurityRule object itself. - */ - public EffectiveNetworkSecurityRule withName(String name) { - this.name = name; - return this; - } - - /** - * Get the protocol property: The network protocol this rule applies to. Possible values are: 'Tcp', 'Udp', and - * 'All'. - * - * @return the protocol value. - */ - public EffectiveSecurityRuleProtocol protocol() { - return this.protocol; - } - - /** - * Set the protocol property: The network protocol this rule applies to. Possible values are: 'Tcp', 'Udp', and - * 'All'. - * - * @param protocol the protocol value to set. - * @return the EffectiveNetworkSecurityRule object itself. - */ - public EffectiveNetworkSecurityRule withProtocol(EffectiveSecurityRuleProtocol protocol) { - this.protocol = protocol; - return this; - } - - /** - * Get the sourcePortRange property: The source port or range. - * - * @return the sourcePortRange value. - */ - public String sourcePortRange() { - return this.sourcePortRange; - } - - /** - * Set the sourcePortRange property: The source port or range. - * - * @param sourcePortRange the sourcePortRange value to set. - * @return the EffectiveNetworkSecurityRule object itself. - */ - public EffectiveNetworkSecurityRule withSourcePortRange(String sourcePortRange) { - this.sourcePortRange = sourcePortRange; - return this; - } - - /** - * Get the destinationPortRange property: The destination port or range. - * - * @return the destinationPortRange value. - */ - public String destinationPortRange() { - return this.destinationPortRange; - } - - /** - * Set the destinationPortRange property: The destination port or range. - * - * @param destinationPortRange the destinationPortRange value to set. - * @return the EffectiveNetworkSecurityRule object itself. - */ - public EffectiveNetworkSecurityRule withDestinationPortRange(String destinationPortRange) { - this.destinationPortRange = destinationPortRange; - return this; - } - - /** - * Get the sourcePortRanges property: The source port ranges. Expected values include a single integer between 0 and - * 65535, a range using '-' as separator (e.g. 100-400), or an asterisk (*). - * - * @return the sourcePortRanges value. - */ - public List sourcePortRanges() { - return this.sourcePortRanges; - } - - /** - * Set the sourcePortRanges property: The source port ranges. Expected values include a single integer between 0 and - * 65535, a range using '-' as separator (e.g. 100-400), or an asterisk (*). - * - * @param sourcePortRanges the sourcePortRanges value to set. - * @return the EffectiveNetworkSecurityRule object itself. - */ - public EffectiveNetworkSecurityRule withSourcePortRanges(List sourcePortRanges) { - this.sourcePortRanges = sourcePortRanges; - return this; - } - - /** - * Get the destinationPortRanges property: The destination port ranges. Expected values include a single integer - * between 0 and 65535, a range using '-' as separator (e.g. 100-400), or an asterisk (*). - * - * @return the destinationPortRanges value. - */ - public List destinationPortRanges() { - return this.destinationPortRanges; - } - - /** - * Set the destinationPortRanges property: The destination port ranges. Expected values include a single integer - * between 0 and 65535, a range using '-' as separator (e.g. 100-400), or an asterisk (*). - * - * @param destinationPortRanges the destinationPortRanges value to set. - * @return the EffectiveNetworkSecurityRule object itself. - */ - public EffectiveNetworkSecurityRule withDestinationPortRanges(List destinationPortRanges) { - this.destinationPortRanges = destinationPortRanges; - return this; - } - - /** - * Get the sourceAddressPrefix property: The source address prefix. - * - * @return the sourceAddressPrefix value. - */ - public String sourceAddressPrefix() { - return this.sourceAddressPrefix; - } - - /** - * Set the sourceAddressPrefix property: The source address prefix. - * - * @param sourceAddressPrefix the sourceAddressPrefix value to set. - * @return the EffectiveNetworkSecurityRule object itself. - */ - public EffectiveNetworkSecurityRule withSourceAddressPrefix(String sourceAddressPrefix) { - this.sourceAddressPrefix = sourceAddressPrefix; - return this; - } - - /** - * Get the destinationAddressPrefix property: The destination address prefix. - * - * @return the destinationAddressPrefix value. - */ - public String destinationAddressPrefix() { - return this.destinationAddressPrefix; - } - - /** - * Set the destinationAddressPrefix property: The destination address prefix. - * - * @param destinationAddressPrefix the destinationAddressPrefix value to set. - * @return the EffectiveNetworkSecurityRule object itself. - */ - public EffectiveNetworkSecurityRule withDestinationAddressPrefix(String destinationAddressPrefix) { - this.destinationAddressPrefix = destinationAddressPrefix; - return this; - } - - /** - * Get the sourceAddressPrefixes property: The source address prefixes. Expected values include CIDR IP ranges, - * Default Tags (VirtualNetwork, AzureLoadBalancer, Internet), System Tags, and the asterisk (*). - * - * @return the sourceAddressPrefixes value. - */ - public List sourceAddressPrefixes() { - return this.sourceAddressPrefixes; - } - - /** - * Set the sourceAddressPrefixes property: The source address prefixes. Expected values include CIDR IP ranges, - * Default Tags (VirtualNetwork, AzureLoadBalancer, Internet), System Tags, and the asterisk (*). - * - * @param sourceAddressPrefixes the sourceAddressPrefixes value to set. - * @return the EffectiveNetworkSecurityRule object itself. - */ - public EffectiveNetworkSecurityRule withSourceAddressPrefixes(List sourceAddressPrefixes) { - this.sourceAddressPrefixes = sourceAddressPrefixes; - return this; - } - - /** - * Get the destinationAddressPrefixes property: The destination address prefixes. Expected values include CIDR IP - * ranges, Default Tags (VirtualNetwork, AzureLoadBalancer, Internet), System Tags, and the asterisk (*). - * - * @return the destinationAddressPrefixes value. - */ - public List destinationAddressPrefixes() { - return this.destinationAddressPrefixes; - } - - /** - * Set the destinationAddressPrefixes property: The destination address prefixes. Expected values include CIDR IP - * ranges, Default Tags (VirtualNetwork, AzureLoadBalancer, Internet), System Tags, and the asterisk (*). - * - * @param destinationAddressPrefixes the destinationAddressPrefixes value to set. - * @return the EffectiveNetworkSecurityRule object itself. - */ - public EffectiveNetworkSecurityRule withDestinationAddressPrefixes(List destinationAddressPrefixes) { - this.destinationAddressPrefixes = destinationAddressPrefixes; - return this; - } - - /** - * Get the expandedSourceAddressPrefix property: The expanded source address prefix. - * - * @return the expandedSourceAddressPrefix value. - */ - public List expandedSourceAddressPrefix() { - return this.expandedSourceAddressPrefix; - } - - /** - * Set the expandedSourceAddressPrefix property: The expanded source address prefix. - * - * @param expandedSourceAddressPrefix the expandedSourceAddressPrefix value to set. - * @return the EffectiveNetworkSecurityRule object itself. - */ - public EffectiveNetworkSecurityRule withExpandedSourceAddressPrefix(List expandedSourceAddressPrefix) { - this.expandedSourceAddressPrefix = expandedSourceAddressPrefix; - return this; - } - - /** - * Get the expandedDestinationAddressPrefix property: Expanded destination address prefix. - * - * @return the expandedDestinationAddressPrefix value. - */ - public List expandedDestinationAddressPrefix() { - return this.expandedDestinationAddressPrefix; - } - - /** - * Set the expandedDestinationAddressPrefix property: Expanded destination address prefix. - * - * @param expandedDestinationAddressPrefix the expandedDestinationAddressPrefix value to set. - * @return the EffectiveNetworkSecurityRule object itself. - */ - public EffectiveNetworkSecurityRule withExpandedDestinationAddressPrefix( - List expandedDestinationAddressPrefix) { - this.expandedDestinationAddressPrefix = expandedDestinationAddressPrefix; - return this; - } - - /** - * Get the access property: Whether network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'. - * - * @return the access value. - */ - public SecurityRuleAccess access() { - return this.access; - } - - /** - * Set the access property: Whether network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'. - * - * @param access the access value to set. - * @return the EffectiveNetworkSecurityRule object itself. - */ - public EffectiveNetworkSecurityRule withAccess(SecurityRuleAccess access) { - this.access = access; - return this; - } - - /** - * Get the priority property: The priority of the rule. - * - * @return the priority value. - */ - public Integer priority() { - return this.priority; - } - - /** - * Set the priority property: The priority of the rule. - * - * @param priority the priority value to set. - * @return the EffectiveNetworkSecurityRule object itself. - */ - public EffectiveNetworkSecurityRule withPriority(Integer priority) { - this.priority = priority; - return this; - } - - /** - * Get the direction property: The direction of the rule. Possible values are: 'Inbound and Outbound'. - * - * @return the direction value. - */ - public SecurityRuleDirection direction() { - return this.direction; - } - - /** - * Set the direction property: The direction of the rule. Possible values are: 'Inbound and Outbound'. - * - * @param direction the direction value to set. - * @return the EffectiveNetworkSecurityRule object itself. - */ - public EffectiveNetworkSecurityRule withDirection(SecurityRuleDirection direction) { - this.direction = direction; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/EffectiveRoute.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/EffectiveRoute.java deleted file mode 100644 index 8bbe862f6559..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/EffectiveRoute.java +++ /dev/null @@ -1,189 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Effective Route. */ -@Fluent -public final class EffectiveRoute { - @JsonIgnore private final ClientLogger logger = new ClientLogger(EffectiveRoute.class); - - /* - * The name of the user defined route. This is optional. - */ - @JsonProperty(value = "name") - private String name; - - /* - * Who created the route. Possible values are: 'Unknown', 'User', - * 'VirtualNetworkGateway', and 'Default'. - */ - @JsonProperty(value = "source") - private EffectiveRouteSource source; - - /* - * The value of effective route. Possible values are: 'Active' and - * 'Invalid'. - */ - @JsonProperty(value = "state") - private EffectiveRouteState state; - - /* - * The address prefixes of the effective routes in CIDR notation. - */ - @JsonProperty(value = "addressPrefix") - private List addressPrefix; - - /* - * The IP address of the next hop of the effective route. - */ - @JsonProperty(value = "nextHopIpAddress") - private List nextHopIpAddress; - - /* - * The type of Azure hop the packet should be sent to. Possible values are: - * 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', - * and 'None'. - */ - @JsonProperty(value = "nextHopType") - private RouteNextHopType nextHopType; - - /** - * Get the name property: The name of the user defined route. This is optional. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the user defined route. This is optional. - * - * @param name the name value to set. - * @return the EffectiveRoute object itself. - */ - public EffectiveRoute withName(String name) { - this.name = name; - return this; - } - - /** - * Get the source property: Who created the route. Possible values are: 'Unknown', 'User', 'VirtualNetworkGateway', - * and 'Default'. - * - * @return the source value. - */ - public EffectiveRouteSource source() { - return this.source; - } - - /** - * Set the source property: Who created the route. Possible values are: 'Unknown', 'User', 'VirtualNetworkGateway', - * and 'Default'. - * - * @param source the source value to set. - * @return the EffectiveRoute object itself. - */ - public EffectiveRoute withSource(EffectiveRouteSource source) { - this.source = source; - return this; - } - - /** - * Get the state property: The value of effective route. Possible values are: 'Active' and 'Invalid'. - * - * @return the state value. - */ - public EffectiveRouteState state() { - return this.state; - } - - /** - * Set the state property: The value of effective route. Possible values are: 'Active' and 'Invalid'. - * - * @param state the state value to set. - * @return the EffectiveRoute object itself. - */ - public EffectiveRoute withState(EffectiveRouteState state) { - this.state = state; - return this; - } - - /** - * Get the addressPrefix property: The address prefixes of the effective routes in CIDR notation. - * - * @return the addressPrefix value. - */ - public List addressPrefix() { - return this.addressPrefix; - } - - /** - * Set the addressPrefix property: The address prefixes of the effective routes in CIDR notation. - * - * @param addressPrefix the addressPrefix value to set. - * @return the EffectiveRoute object itself. - */ - public EffectiveRoute withAddressPrefix(List addressPrefix) { - this.addressPrefix = addressPrefix; - return this; - } - - /** - * Get the nextHopIpAddress property: The IP address of the next hop of the effective route. - * - * @return the nextHopIpAddress value. - */ - public List nextHopIpAddress() { - return this.nextHopIpAddress; - } - - /** - * Set the nextHopIpAddress property: The IP address of the next hop of the effective route. - * - * @param nextHopIpAddress the nextHopIpAddress value to set. - * @return the EffectiveRoute object itself. - */ - public EffectiveRoute withNextHopIpAddress(List nextHopIpAddress) { - this.nextHopIpAddress = nextHopIpAddress; - return this; - } - - /** - * Get the nextHopType property: The type of Azure hop the packet should be sent to. Possible values are: - * 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'. - * - * @return the nextHopType value. - */ - public RouteNextHopType nextHopType() { - return this.nextHopType; - } - - /** - * Set the nextHopType property: The type of Azure hop the packet should be sent to. Possible values are: - * 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'. - * - * @param nextHopType the nextHopType value to set. - * @return the EffectiveRoute object itself. - */ - public EffectiveRoute withNextHopType(RouteNextHopType nextHopType) { - this.nextHopType = nextHopType; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/EffectiveRouteSource.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/EffectiveRouteSource.java deleted file mode 100644 index 3af19545159f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/EffectiveRouteSource.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for EffectiveRouteSource. */ -public final class EffectiveRouteSource extends ExpandableStringEnum { - /** Static value Unknown for EffectiveRouteSource. */ - public static final EffectiveRouteSource UNKNOWN = fromString("Unknown"); - - /** Static value User for EffectiveRouteSource. */ - public static final EffectiveRouteSource USER = fromString("User"); - - /** Static value VirtualNetworkGateway for EffectiveRouteSource. */ - public static final EffectiveRouteSource VIRTUAL_NETWORK_GATEWAY = fromString("VirtualNetworkGateway"); - - /** Static value Default for EffectiveRouteSource. */ - public static final EffectiveRouteSource DEFAULT = fromString("Default"); - - /** - * Creates or finds a EffectiveRouteSource from its string representation. - * - * @param name a name to look for. - * @return the corresponding EffectiveRouteSource. - */ - @JsonCreator - public static EffectiveRouteSource fromString(String name) { - return fromString(name, EffectiveRouteSource.class); - } - - /** @return known EffectiveRouteSource values. */ - public static Collection values() { - return values(EffectiveRouteSource.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/EffectiveRouteState.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/EffectiveRouteState.java deleted file mode 100644 index 782daea81f60..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/EffectiveRouteState.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for EffectiveRouteState. */ -public final class EffectiveRouteState extends ExpandableStringEnum { - /** Static value Active for EffectiveRouteState. */ - public static final EffectiveRouteState ACTIVE = fromString("Active"); - - /** Static value Invalid for EffectiveRouteState. */ - public static final EffectiveRouteState INVALID = fromString("Invalid"); - - /** - * Creates or finds a EffectiveRouteState from its string representation. - * - * @param name a name to look for. - * @return the corresponding EffectiveRouteState. - */ - @JsonCreator - public static EffectiveRouteState fromString(String name) { - return fromString(name, EffectiveRouteState.class); - } - - /** @return known EffectiveRouteState values. */ - public static Collection values() { - return values(EffectiveRouteState.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/EffectiveSecurityRuleProtocol.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/EffectiveSecurityRuleProtocol.java deleted file mode 100644 index 405bbe2a7567..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/EffectiveSecurityRuleProtocol.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for EffectiveSecurityRuleProtocol. */ -public final class EffectiveSecurityRuleProtocol extends ExpandableStringEnum { - /** Static value Tcp for EffectiveSecurityRuleProtocol. */ - public static final EffectiveSecurityRuleProtocol TCP = fromString("Tcp"); - - /** Static value Udp for EffectiveSecurityRuleProtocol. */ - public static final EffectiveSecurityRuleProtocol UDP = fromString("Udp"); - - /** Static value All for EffectiveSecurityRuleProtocol. */ - public static final EffectiveSecurityRuleProtocol ALL = fromString("All"); - - /** - * Creates or finds a EffectiveSecurityRuleProtocol from its string representation. - * - * @param name a name to look for. - * @return the corresponding EffectiveSecurityRuleProtocol. - */ - @JsonCreator - public static EffectiveSecurityRuleProtocol fromString(String name) { - return fromString(name, EffectiveSecurityRuleProtocol.class); - } - - /** @return known EffectiveSecurityRuleProtocol values. */ - public static Collection values() { - return values(EffectiveSecurityRuleProtocol.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/EndpointService.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/EndpointService.java deleted file mode 100644 index 604ea9784270..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/EndpointService.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Identifies the service being brought into the virtual network. */ -@Fluent -public final class EndpointService { - @JsonIgnore private final ClientLogger logger = new ClientLogger(EndpointService.class); - - /* - * A unique identifier of the service being referenced by the interface - * endpoint. - */ - @JsonProperty(value = "id") - private String id; - - /** - * Get the id property: A unique identifier of the service being referenced by the interface endpoint. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: A unique identifier of the service being referenced by the interface endpoint. - * - * @param id the id value to set. - * @return the EndpointService object itself. - */ - public EndpointService withId(String id) { - this.id = id; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/EndpointServicesListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/EndpointServicesListResult.java deleted file mode 100644 index 3a14fc265427..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/EndpointServicesListResult.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.EndpointServiceResultInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Response for the ListAvailableEndpointServices API service call. */ -@Fluent -public final class EndpointServicesListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(EndpointServicesListResult.class); - - /* - * List of available endpoint services in a region. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to get the next set of results. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: List of available endpoint services in a region. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: List of available endpoint services in a region. - * - * @param value the value value to set. - * @return the EndpointServicesListResult object itself. - */ - public EndpointServicesListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to get the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The URL to get the next set of results. - * - * @param nextLink the nextLink value to set. - * @return the EndpointServicesListResult object itself. - */ - public EndpointServicesListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/Error.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/Error.java deleted file mode 100644 index 595c2896ee46..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/Error.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.exception.ManagementError; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The Error model. */ -@Immutable -public final class Error extends ManagementError { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Error.class); - - /* - * The innerError property. - */ - @JsonProperty(value = "innerError", access = JsonProperty.Access.WRITE_ONLY) - private String innerError; - - /** - * Get the innerError property: The innerError property. - * - * @return the innerError value. - */ - public String getInnerError() { - return this.innerError; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ErrorException.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ErrorException.java deleted file mode 100644 index 0440d190acad..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ErrorException.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.http.HttpResponse; -import com.azure.core.management.exception.ManagementException; - -/** Exception thrown for an invalid response with Error information. */ -public final class ErrorException extends ManagementException { - /** - * Initializes a new instance of the ErrorException class. - * - * @param message the exception message or the response content if a message is not available. - * @param response the HTTP response. - */ - public ErrorException(String message, HttpResponse response) { - super(message, response); - } - - /** - * Initializes a new instance of the ErrorException class. - * - * @param message the exception message or the response content if a message is not available. - * @param response the HTTP response. - * @param value the deserialized response value. - */ - public ErrorException(String message, HttpResponse response, Error value) { - super(message, response, value); - } - - @Override - public Error getValue() { - return (Error) super.getValue(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/EvaluatedNetworkSecurityGroup.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/EvaluatedNetworkSecurityGroup.java deleted file mode 100644 index a8948e4d6d7c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/EvaluatedNetworkSecurityGroup.java +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Results of network security group evaluation. */ -@Fluent -public final class EvaluatedNetworkSecurityGroup { - @JsonIgnore private final ClientLogger logger = new ClientLogger(EvaluatedNetworkSecurityGroup.class); - - /* - * Network security group ID. - */ - @JsonProperty(value = "networkSecurityGroupId") - private String networkSecurityGroupId; - - /* - * Resource ID of nic or subnet to which network security group is applied. - */ - @JsonProperty(value = "appliedTo") - private String appliedTo; - - /* - * Matched rule. - */ - @JsonProperty(value = "matchedRule") - private MatchedRule matchedRule; - - /* - * List of network security rules evaluation results. - */ - @JsonProperty(value = "rulesEvaluationResult", access = JsonProperty.Access.WRITE_ONLY) - private List rulesEvaluationResult; - - /** - * Get the networkSecurityGroupId property: Network security group ID. - * - * @return the networkSecurityGroupId value. - */ - public String networkSecurityGroupId() { - return this.networkSecurityGroupId; - } - - /** - * Set the networkSecurityGroupId property: Network security group ID. - * - * @param networkSecurityGroupId the networkSecurityGroupId value to set. - * @return the EvaluatedNetworkSecurityGroup object itself. - */ - public EvaluatedNetworkSecurityGroup withNetworkSecurityGroupId(String networkSecurityGroupId) { - this.networkSecurityGroupId = networkSecurityGroupId; - return this; - } - - /** - * Get the appliedTo property: Resource ID of nic or subnet to which network security group is applied. - * - * @return the appliedTo value. - */ - public String appliedTo() { - return this.appliedTo; - } - - /** - * Set the appliedTo property: Resource ID of nic or subnet to which network security group is applied. - * - * @param appliedTo the appliedTo value to set. - * @return the EvaluatedNetworkSecurityGroup object itself. - */ - public EvaluatedNetworkSecurityGroup withAppliedTo(String appliedTo) { - this.appliedTo = appliedTo; - return this; - } - - /** - * Get the matchedRule property: Matched rule. - * - * @return the matchedRule value. - */ - public MatchedRule matchedRule() { - return this.matchedRule; - } - - /** - * Set the matchedRule property: Matched rule. - * - * @param matchedRule the matchedRule value to set. - * @return the EvaluatedNetworkSecurityGroup object itself. - */ - public EvaluatedNetworkSecurityGroup withMatchedRule(MatchedRule matchedRule) { - this.matchedRule = matchedRule; - return this; - } - - /** - * Get the rulesEvaluationResult property: List of network security rules evaluation results. - * - * @return the rulesEvaluationResult value. - */ - public List rulesEvaluationResult() { - return this.rulesEvaluationResult; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (matchedRule() != null) { - matchedRule().validate(); - } - if (rulesEvaluationResult() != null) { - rulesEvaluationResult().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/EvaluationState.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/EvaluationState.java deleted file mode 100644 index c40a94701380..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/EvaluationState.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for EvaluationState. */ -public final class EvaluationState extends ExpandableStringEnum { - /** Static value NotStarted for EvaluationState. */ - public static final EvaluationState NOT_STARTED = fromString("NotStarted"); - - /** Static value InProgress for EvaluationState. */ - public static final EvaluationState IN_PROGRESS = fromString("InProgress"); - - /** Static value Completed for EvaluationState. */ - public static final EvaluationState COMPLETED = fromString("Completed"); - - /** - * Creates or finds a EvaluationState from its string representation. - * - * @param name a name to look for. - * @return the corresponding EvaluationState. - */ - @JsonCreator - public static EvaluationState fromString(String name) { - return fromString(name, EvaluationState.class); - } - - /** @return known EvaluationState values. */ - public static Collection values() { - return values(EvaluationState.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCircuit.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCircuit.java deleted file mode 100644 index 56c9ab7a34a5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCircuit.java +++ /dev/null @@ -1,226 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.network.fluent.models.ExpressRouteCircuitInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.GroupableResource; -import com.azure.resourcemanager.resources.fluentcore.arm.models.Resource; -import com.azure.resourcemanager.resources.fluentcore.model.Appliable; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; -import com.azure.resourcemanager.resources.fluentcore.model.Updatable; -import java.util.Map; - -/** Entry point for Express Route Circuit management API in Azure. */ -@Fluent -public interface ExpressRouteCircuit - extends GroupableResource, - Refreshable, - Updatable, - UpdatableWithTags { - - // Actions - - /** @return entry point to manage express route peerings associated with express route circuit */ - ExpressRouteCircuitPeerings peerings(); - - // Getters - - /** @return the SKU type */ - ExpressRouteCircuitSkuType sku(); - - /** @return the flag indicating if classic operations allowed */ - boolean isAllowClassicOperations(); - - /** @return the CircuitProvisioningState state of the resource */ - String circuitProvisioningState(); - - /** - * The ServiceProviderProvisioningState state of the resource. - * - * @return serviceProviderProvisioningState - */ - ServiceProviderProvisioningState serviceProviderProvisioningState(); - - /** @return the peerings associated with this express route circuit, indexed by name */ - Map peeringsMap(); - - /** @return the ServiceKey */ - String serviceKey(); - - /** @return the ServiceProviderNotes */ - String serviceProviderNotes(); - - /** @return the ServiceProviderProperties */ - ExpressRouteCircuitServiceProviderProperties serviceProviderProperties(); - - /** - * Gets the provisioning state of the express route circuit resource. - * - * @return provisioningState - */ - String provisioningState(); - - /** The entirety of the express route circuit definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithGroup, - DefinitionStages.WithServiceProvider, - DefinitionStages.WithPeeringLocation, - DefinitionStages.WithBandwidth, - DefinitionStages.WithSku, - DefinitionStages.WithCreate { - } - - /** Grouping of express route circuit definition stages. */ - interface DefinitionStages { - /** The first stage of express route circuit definition. */ - interface Blank extends GroupableResource.DefinitionWithRegion { - } - - /** The stage of express route circuit definition allowing to specify the resource group. */ - interface WithGroup extends GroupableResource.DefinitionStages.WithGroup { - } - - /** The stage of express route circuit definition allowing to specify service provider name. */ - interface WithServiceProvider { - /** - * Specifies the service provider name for the express route circuit. - * - * @param serviceProviderName the service provider name - * @return the next stage of the definition - */ - WithPeeringLocation withServiceProvider(String serviceProviderName); - } - - /** The stage of express route circuit definition allowing to specify service provider peering location. */ - interface WithPeeringLocation { - /** - * Specifies the location for the express route circuit. - * - * @param location the location - * @return the next stage of the definition - */ - WithBandwidth withPeeringLocation(String location); - } - - /** The stage of express route circuit definition allowing to specify service provider bandwidth. */ - interface WithBandwidth { - /** - * Specifies the bandwidth in Mbps for the express route circuit. - * - * @param bandwidthInMbps the bandwidth in Mbps - * @return the next stage of the definition - */ - WithSku withBandwidthInMbps(int bandwidthInMbps); - } - - /** The stage of express route circuit definition allowing to specify SKU tier and family. */ - interface WithSku { - /** - * Specifies the SKU type for the express route circuit. - * - * @param skuType the SKU type - * @return the next stage of the definition - */ - WithCreate withSku(ExpressRouteCircuitSkuType skuType); - } - - /** The stage of express route circuit definition allowing to enable/disable classic operations. */ - interface WithAllowClassicOperations { - /** - * Specifies whether classic operations are enabled. - * - * @return the next stage of the definition - */ - WithCreate withClassicOperations(); - } - - /** The stage of definition allowing to add authorization. */ - interface WithAuthorization { - /** - * Specifies the authorization name for the express route circuit. - * - * @param authorizationName the authorization name - * @return the next stage of the definition - */ - WithCreate withAuthorization(String authorizationName); - } - - /** - * The stage of the express route circuit definition which contains all the minimum required inputs for the - * resource to be created, but also allows for any other optional settings to be specified. - */ - interface WithCreate - extends Creatable, - Resource.DefinitionWithTags, - WithAllowClassicOperations, - WithAuthorization { - } - } - - /** Grouping of express route circuit update stages. */ - interface UpdateStages { - /** The stage of express route circuit update allowing to specify service provider bandwidth. */ - interface WithBandwidth { - /** - * Specifies the bandwidth in Mbps for the express route circuit. - * - * @param bandwidthInMbps the bandwidth in Mbps - * @return the next stage of the update - */ - Update withBandwidthInMbps(int bandwidthInMbps); - } - - /** The stage of express route circuit update allowing to specify SKU tier and family. */ - interface WithSku { - /** - * Specifies the SKU for the express route circuit. - * - * @param sku the SKI - * @return the next stage of the update - */ - Update withSku(ExpressRouteCircuitSkuType sku); - } - - /** The stage of express route circuit update allowing to enable/disable classic operations. */ - interface WithAllowClassicOperations { - /** - * Specifies whether classic operations are enabled. - * - * @return the next stage of the update - */ - Update withClassicOperations(); - - /** - * Specifies whether classic operations are disabled. - * - * @return the next stage of the update - */ - Update withoutClassicOperations(); - } - - /** The stage of express route circuit update allowing to add authorization. */ - interface WithAuthorization { - /** - * Specifies the authorization name for the express route circuit. - * - * @param authorizationName the authorization name - * @return the next stage of the update - */ - Update withAuthorization(String authorizationName); - } - } - - /** The template for a express route circuit update operation, containing all the settings that can be modified. */ - interface Update - extends Appliable, - Resource.UpdateWithTags, - UpdateStages.WithBandwidth, - UpdateStages.WithSku, - UpdateStages.WithAllowClassicOperations, - UpdateStages.WithAuthorization { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCircuitArpTable.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCircuitArpTable.java deleted file mode 100644 index ab93ba53ae73..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCircuitArpTable.java +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The ARP table associated with the ExpressRouteCircuit. */ -@Fluent -public final class ExpressRouteCircuitArpTable { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitArpTable.class); - - /* - * Entry age in minutes - */ - @JsonProperty(value = "age") - private Integer age; - - /* - * Interface address - */ - @JsonProperty(value = "interface") - private String interfaceProperty; - - /* - * The IP address. - */ - @JsonProperty(value = "ipAddress") - private String ipAddress; - - /* - * The MAC address. - */ - @JsonProperty(value = "macAddress") - private String macAddress; - - /** - * Get the age property: Entry age in minutes. - * - * @return the age value. - */ - public Integer age() { - return this.age; - } - - /** - * Set the age property: Entry age in minutes. - * - * @param age the age value to set. - * @return the ExpressRouteCircuitArpTable object itself. - */ - public ExpressRouteCircuitArpTable withAge(Integer age) { - this.age = age; - return this; - } - - /** - * Get the interfaceProperty property: Interface address. - * - * @return the interfaceProperty value. - */ - public String interfaceProperty() { - return this.interfaceProperty; - } - - /** - * Set the interfaceProperty property: Interface address. - * - * @param interfaceProperty the interfaceProperty value to set. - * @return the ExpressRouteCircuitArpTable object itself. - */ - public ExpressRouteCircuitArpTable withInterfaceProperty(String interfaceProperty) { - this.interfaceProperty = interfaceProperty; - return this; - } - - /** - * Get the ipAddress property: The IP address. - * - * @return the ipAddress value. - */ - public String ipAddress() { - return this.ipAddress; - } - - /** - * Set the ipAddress property: The IP address. - * - * @param ipAddress the ipAddress value to set. - * @return the ExpressRouteCircuitArpTable object itself. - */ - public ExpressRouteCircuitArpTable withIpAddress(String ipAddress) { - this.ipAddress = ipAddress; - return this; - } - - /** - * Get the macAddress property: The MAC address. - * - * @return the macAddress value. - */ - public String macAddress() { - return this.macAddress; - } - - /** - * Set the macAddress property: The MAC address. - * - * @param macAddress the macAddress value to set. - * @return the ExpressRouteCircuitArpTable object itself. - */ - public ExpressRouteCircuitArpTable withMacAddress(String macAddress) { - this.macAddress = macAddress; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCircuitConnectionListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCircuitConnectionListResult.java deleted file mode 100644 index 1f903de06add..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCircuitConnectionListResult.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.ExpressRouteCircuitConnectionInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** - * Response for ListConnections API service call retrieves all global reach connections that belongs to a Private - * Peering for an ExpressRouteCircuit. - */ -@Fluent -public final class ExpressRouteCircuitConnectionListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitConnectionListResult.class); - - /* - * The global reach connection associated with Private Peering in an - * ExpressRoute Circuit. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to get the next set of results. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: The global reach connection associated with Private Peering in an ExpressRoute Circuit. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The global reach connection associated with Private Peering in an ExpressRoute Circuit. - * - * @param value the value value to set. - * @return the ExpressRouteCircuitConnectionListResult object itself. - */ - public ExpressRouteCircuitConnectionListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to get the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The URL to get the next set of results. - * - * @param nextLink the nextLink value to set. - * @return the ExpressRouteCircuitConnectionListResult object itself. - */ - public ExpressRouteCircuitConnectionListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCircuitListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCircuitListResult.java deleted file mode 100644 index c94e8ff28f9a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCircuitListResult.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.ExpressRouteCircuitInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Response for ListExpressRouteCircuit API service call. */ -@Fluent -public final class ExpressRouteCircuitListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitListResult.class); - - /* - * A list of ExpressRouteCircuits in a resource group. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to get the next set of results. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: A list of ExpressRouteCircuits in a resource group. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: A list of ExpressRouteCircuits in a resource group. - * - * @param value the value value to set. - * @return the ExpressRouteCircuitListResult object itself. - */ - public ExpressRouteCircuitListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to get the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The URL to get the next set of results. - * - * @param nextLink the nextLink value to set. - * @return the ExpressRouteCircuitListResult object itself. - */ - public ExpressRouteCircuitListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCircuitPeering.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCircuitPeering.java deleted file mode 100644 index 0b514e1e5a1c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCircuitPeering.java +++ /dev/null @@ -1,229 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.network.fluent.models.ExpressRouteCircuitPeeringInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.IndependentChild; -import com.azure.resourcemanager.resources.fluentcore.model.Appliable; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; -import com.azure.resourcemanager.resources.fluentcore.model.Updatable; - -/** Client-side representation of express route circuit peering object, associated with express route circuit. */ -@Fluent -public interface ExpressRouteCircuitPeering - extends IndependentChild, - HasInnerModel, - Refreshable, - Updatable { - - // Getters - - /** @return peering type */ - ExpressRoutePeeringType peeringType(); - - /** - * Gets the state of peering. - * - * @return peering state - */ - ExpressRoutePeeringState state(); - - /** @return the Azure ASN */ - int azureAsn(); - - /** @return the peer ASN */ - long peerAsn(); - - /** @return the primary address prefix */ - String primaryPeerAddressPrefix(); - - /** @return the secondary address prefix. */ - String secondaryPeerAddressPrefix(); - - /** @return the primary port */ - String primaryAzurePort(); - - /** @return the secondary port */ - String secondaryAzurePort(); - - /** @return the shared key */ - String sharedKey(); - - /** @return the VLAN ID */ - int vlanId(); - - /** @return The Microsoft peering configuration. */ - ExpressRouteCircuitPeeringConfig microsoftPeeringConfig(); - - /** @return peering stats */ - ExpressRouteCircuitStats stats(); - - /** - * Gets the provisioning state of the resource. - * - * @return provisioningState - */ - String provisioningState(); - - /** @return whether the provider or the customer last modified the peering */ - String lastModifiedBy(); - - /** @return the IPv6 peering configuration */ - Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig(); - - /** The entirety of the express route circuit peering definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithAdvertisedPublicPrefixes, - DefinitionStages.WithPrimaryPeerAddressPrefix, - DefinitionStages.WithSecondaryPeerAddressPrefix, - DefinitionStages.WithVlanId, - DefinitionStages.WithPeerAsn, - DefinitionStages.WithCreate { - } - - /** Grouping of express route circuit peering definition stages. */ - interface DefinitionStages { - /** - * The first stage of an Express Route Circuit Peering configuration. - */ - interface Blank extends WithPrimaryPeerAddressPrefix { - } - - /** The stage of Express Route Circuit Peering definition allowing to specify advertised address prefixes. */ - interface WithAdvertisedPublicPrefixes { - /** - * Specify advertised prefixes: sets a list of all prefixes that are planned to advertise over the BGP - * session. Only public IP address prefixes are accepted. A set of prefixes can be sent as a comma-separated - * list. These prefixes must be registered to you in an RIR / IRR. - * - * @param publicPrefixes advertised prefixes - * @return next stage of definition - */ - WithPrimaryPeerAddressPrefix withAdvertisedPublicPrefixes(String publicPrefixes); - } - - /** The stage of Express Route Circuit Peering definition allowing to specify primary address prefix. */ - interface WithPrimaryPeerAddressPrefix { - /** - * Specifies the primary peer address prefix for the Express Route Circuit Peering. - * - * @param addressPrefix the primary peer address prefix - * @return next stage of definition - */ - WithSecondaryPeerAddressPrefix withPrimaryPeerAddressPrefix(String addressPrefix); - } - - /** The stage of Express Route Circuit Peering definition allowing to specify secondary address prefix. */ - interface WithSecondaryPeerAddressPrefix { - /** - * Specifies the secondary peer address prefix for the Express Route Circuit Peering. - * - * @param addressPrefix the secondary peer address prefix - * @return next stage of definition - */ - WithVlanId withSecondaryPeerAddressPrefix(String addressPrefix); - } - - /** The stage of Express Route Circuit Peering definition allowing to specify VLAN ID. */ - interface WithVlanId { - /** - * @param vlanId a valid VLAN ID to establish this peering on. No other peering in the circuit can use the - * same VLAN ID - * @return next stage of definition - */ - WithPeerAsn withVlanId(int vlanId); - } - - /** The stage of Express Route Circuit Peering definition allowing to specify AS number for peering. */ - interface WithPeerAsn { - /** - * @param peerAsn AS number for peering. Both 2-byte and 4-byte AS numbers can be used - * @return next stage of definition - */ - WithCreate withPeerAsn(long peerAsn); - } - - /** - * The stage of the Express Route Circuit Peering definition which contains all the minimum required inputs for - * the resource to be created, but also allows for any other optional settings to be specified. - */ - interface WithCreate extends Creatable { - } - } - - /** Grouping of express route circuit peering update stages. */ - interface Update - extends Appliable, - UpdateStages.WithAdvertisedPublicPrefixes, - UpdateStages.WithPrimaryPeerAddressPrefix, - UpdateStages.WithSecondaryPeerAddressPrefix, - UpdateStages.WithVlanId, - UpdateStages.WithPeerAsn { - } - - /** - * The template for express route circuit peering update operation, containing all the settings that can be - * modified. - */ - interface UpdateStages { - /** The stage of Express Route Circuit Peering update allowing to specify advertised address prefixes. */ - interface WithAdvertisedPublicPrefixes { - /** - * Specifies the advertised public prefixes for the Express Route Circuit Peering. - * - * @param publicPrefixes the advertised public prefixes - * @return next stage of update - */ - Update withAdvertisedPublicPrefixes(String publicPrefixes); - } - - /** The stage of Express Route Circuit Peering update allowing to specify primary address prefix. */ - interface WithPrimaryPeerAddressPrefix { - /** - * Specifies the primary peer address prefix for the Express Route Circuit Peering. - * - * @param addressPrefix the primary peer address prefix - * @return next stage of update - */ - Update withPrimaryPeerAddressPrefix(String addressPrefix); - } - - /** The stage of Express Route Circuit Peering update allowing to specify secondary address prefix. */ - interface WithSecondaryPeerAddressPrefix { - /** - * Specifies the secondary peer address prefix for the Express Route Circuit Peering. - * - * @param addressPrefix the secondary peer address prefix - * @return next stage of update - */ - Update withSecondaryPeerAddressPrefix(String addressPrefix); - } - - /** The stage of Express Route Circuit Peering update allowing to specify VLAN ID. */ - interface WithVlanId { - /** - * Specifies the VLAN ID for the Express Route Circuit Peering. - * - * @param vlanId the VLAN ID - * @return next stage of update - */ - Update withVlanId(int vlanId); - } - - /** The stage of Express Route Circuit Peering update allowing to specify AS number for peering. */ - interface WithPeerAsn { - /** - * Specifies the peer AS number for the Express Route Circuit Peering. - * - * @param peerAsn the peer AS number - * @return next stage of update - */ - Update withPeerAsn(long peerAsn); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCircuitPeeringAdvertisedPublicPrefixState.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCircuitPeeringAdvertisedPublicPrefixState.java deleted file mode 100644 index e315295f7b14..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCircuitPeeringAdvertisedPublicPrefixState.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ExpressRouteCircuitPeeringAdvertisedPublicPrefixState. */ -public final class ExpressRouteCircuitPeeringAdvertisedPublicPrefixState - extends ExpandableStringEnum { - /** Static value NotConfigured for ExpressRouteCircuitPeeringAdvertisedPublicPrefixState. */ - public static final ExpressRouteCircuitPeeringAdvertisedPublicPrefixState NOT_CONFIGURED = - fromString("NotConfigured"); - - /** Static value Configuring for ExpressRouteCircuitPeeringAdvertisedPublicPrefixState. */ - public static final ExpressRouteCircuitPeeringAdvertisedPublicPrefixState CONFIGURING = fromString("Configuring"); - - /** Static value Configured for ExpressRouteCircuitPeeringAdvertisedPublicPrefixState. */ - public static final ExpressRouteCircuitPeeringAdvertisedPublicPrefixState CONFIGURED = fromString("Configured"); - - /** Static value ValidationNeeded for ExpressRouteCircuitPeeringAdvertisedPublicPrefixState. */ - public static final ExpressRouteCircuitPeeringAdvertisedPublicPrefixState VALIDATION_NEEDED = - fromString("ValidationNeeded"); - - /** - * Creates or finds a ExpressRouteCircuitPeeringAdvertisedPublicPrefixState from its string representation. - * - * @param name a name to look for. - * @return the corresponding ExpressRouteCircuitPeeringAdvertisedPublicPrefixState. - */ - @JsonCreator - public static ExpressRouteCircuitPeeringAdvertisedPublicPrefixState fromString(String name) { - return fromString(name, ExpressRouteCircuitPeeringAdvertisedPublicPrefixState.class); - } - - /** @return known ExpressRouteCircuitPeeringAdvertisedPublicPrefixState values. */ - public static Collection values() { - return values(ExpressRouteCircuitPeeringAdvertisedPublicPrefixState.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCircuitPeeringConfig.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCircuitPeeringConfig.java deleted file mode 100644 index 56cba4b50080..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCircuitPeeringConfig.java +++ /dev/null @@ -1,185 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Specifies the peering configuration. */ -@Fluent -public final class ExpressRouteCircuitPeeringConfig { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitPeeringConfig.class); - - /* - * The reference of AdvertisedPublicPrefixes. - */ - @JsonProperty(value = "advertisedPublicPrefixes") - private List advertisedPublicPrefixes; - - /* - * The communities of bgp peering. Specified for microsoft peering - */ - @JsonProperty(value = "advertisedCommunities") - private List advertisedCommunities; - - /* - * AdvertisedPublicPrefixState of the Peering resource. Possible values are - * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. - */ - @JsonProperty(value = "advertisedPublicPrefixesState") - private ExpressRouteCircuitPeeringAdvertisedPublicPrefixState advertisedPublicPrefixesState; - - /* - * The legacy mode of the peering. - */ - @JsonProperty(value = "legacyMode") - private Integer legacyMode; - - /* - * The CustomerASN of the peering. - */ - @JsonProperty(value = "customerASN") - private Integer customerAsn; - - /* - * The RoutingRegistryName of the configuration. - */ - @JsonProperty(value = "routingRegistryName") - private String routingRegistryName; - - /** - * Get the advertisedPublicPrefixes property: The reference of AdvertisedPublicPrefixes. - * - * @return the advertisedPublicPrefixes value. - */ - public List advertisedPublicPrefixes() { - return this.advertisedPublicPrefixes; - } - - /** - * Set the advertisedPublicPrefixes property: The reference of AdvertisedPublicPrefixes. - * - * @param advertisedPublicPrefixes the advertisedPublicPrefixes value to set. - * @return the ExpressRouteCircuitPeeringConfig object itself. - */ - public ExpressRouteCircuitPeeringConfig withAdvertisedPublicPrefixes(List advertisedPublicPrefixes) { - this.advertisedPublicPrefixes = advertisedPublicPrefixes; - return this; - } - - /** - * Get the advertisedCommunities property: The communities of bgp peering. Specified for microsoft peering. - * - * @return the advertisedCommunities value. - */ - public List advertisedCommunities() { - return this.advertisedCommunities; - } - - /** - * Set the advertisedCommunities property: The communities of bgp peering. Specified for microsoft peering. - * - * @param advertisedCommunities the advertisedCommunities value to set. - * @return the ExpressRouteCircuitPeeringConfig object itself. - */ - public ExpressRouteCircuitPeeringConfig withAdvertisedCommunities(List advertisedCommunities) { - this.advertisedCommunities = advertisedCommunities; - return this; - } - - /** - * Get the advertisedPublicPrefixesState property: AdvertisedPublicPrefixState of the Peering resource. Possible - * values are 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. - * - * @return the advertisedPublicPrefixesState value. - */ - public ExpressRouteCircuitPeeringAdvertisedPublicPrefixState advertisedPublicPrefixesState() { - return this.advertisedPublicPrefixesState; - } - - /** - * Set the advertisedPublicPrefixesState property: AdvertisedPublicPrefixState of the Peering resource. Possible - * values are 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. - * - * @param advertisedPublicPrefixesState the advertisedPublicPrefixesState value to set. - * @return the ExpressRouteCircuitPeeringConfig object itself. - */ - public ExpressRouteCircuitPeeringConfig withAdvertisedPublicPrefixesState( - ExpressRouteCircuitPeeringAdvertisedPublicPrefixState advertisedPublicPrefixesState) { - this.advertisedPublicPrefixesState = advertisedPublicPrefixesState; - return this; - } - - /** - * Get the legacyMode property: The legacy mode of the peering. - * - * @return the legacyMode value. - */ - public Integer legacyMode() { - return this.legacyMode; - } - - /** - * Set the legacyMode property: The legacy mode of the peering. - * - * @param legacyMode the legacyMode value to set. - * @return the ExpressRouteCircuitPeeringConfig object itself. - */ - public ExpressRouteCircuitPeeringConfig withLegacyMode(Integer legacyMode) { - this.legacyMode = legacyMode; - return this; - } - - /** - * Get the customerAsn property: The CustomerASN of the peering. - * - * @return the customerAsn value. - */ - public Integer customerAsn() { - return this.customerAsn; - } - - /** - * Set the customerAsn property: The CustomerASN of the peering. - * - * @param customerAsn the customerAsn value to set. - * @return the ExpressRouteCircuitPeeringConfig object itself. - */ - public ExpressRouteCircuitPeeringConfig withCustomerAsn(Integer customerAsn) { - this.customerAsn = customerAsn; - return this; - } - - /** - * Get the routingRegistryName property: The RoutingRegistryName of the configuration. - * - * @return the routingRegistryName value. - */ - public String routingRegistryName() { - return this.routingRegistryName; - } - - /** - * Set the routingRegistryName property: The RoutingRegistryName of the configuration. - * - * @param routingRegistryName the routingRegistryName value to set. - * @return the ExpressRouteCircuitPeeringConfig object itself. - */ - public ExpressRouteCircuitPeeringConfig withRoutingRegistryName(String routingRegistryName) { - this.routingRegistryName = routingRegistryName; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCircuitPeeringId.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCircuitPeeringId.java deleted file mode 100644 index f3cfbb18a125..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCircuitPeeringId.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** ExpressRoute circuit peering identifier. */ -@Fluent -public final class ExpressRouteCircuitPeeringId { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitPeeringId.class); - - /* - * The ID of the ExpressRoute circuit peering. - */ - @JsonProperty(value = "id") - private String id; - - /** - * Get the id property: The ID of the ExpressRoute circuit peering. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: The ID of the ExpressRoute circuit peering. - * - * @param id the id value to set. - * @return the ExpressRouteCircuitPeeringId object itself. - */ - public ExpressRouteCircuitPeeringId withId(String id) { - this.id = id; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCircuitPeeringListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCircuitPeeringListResult.java deleted file mode 100644 index cdfd2cb5d50e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCircuitPeeringListResult.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.ExpressRouteCircuitPeeringInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Response for ListPeering API service call retrieves all peerings that belong to an ExpressRouteCircuit. */ -@Fluent -public final class ExpressRouteCircuitPeeringListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitPeeringListResult.class); - - /* - * The peerings in an express route circuit. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to get the next set of results. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: The peerings in an express route circuit. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The peerings in an express route circuit. - * - * @param value the value value to set. - * @return the ExpressRouteCircuitPeeringListResult object itself. - */ - public ExpressRouteCircuitPeeringListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to get the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The URL to get the next set of results. - * - * @param nextLink the nextLink value to set. - * @return the ExpressRouteCircuitPeeringListResult object itself. - */ - public ExpressRouteCircuitPeeringListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCircuitPeeringState.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCircuitPeeringState.java deleted file mode 100644 index 2abe57a2f4cb..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCircuitPeeringState.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ExpressRouteCircuitPeeringState. */ -public final class ExpressRouteCircuitPeeringState extends ExpandableStringEnum { - /** Static value Disabled for ExpressRouteCircuitPeeringState. */ - public static final ExpressRouteCircuitPeeringState DISABLED = fromString("Disabled"); - - /** Static value Enabled for ExpressRouteCircuitPeeringState. */ - public static final ExpressRouteCircuitPeeringState ENABLED = fromString("Enabled"); - - /** - * Creates or finds a ExpressRouteCircuitPeeringState from its string representation. - * - * @param name a name to look for. - * @return the corresponding ExpressRouteCircuitPeeringState. - */ - @JsonCreator - public static ExpressRouteCircuitPeeringState fromString(String name) { - return fromString(name, ExpressRouteCircuitPeeringState.class); - } - - /** @return known ExpressRouteCircuitPeeringState values. */ - public static Collection values() { - return values(ExpressRouteCircuitPeeringState.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCircuitPeerings.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCircuitPeerings.java deleted file mode 100644 index 11a45324718f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCircuitPeerings.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingByName; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasParent; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingById; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingByName; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; - -/** Entry point for express route circuit peerings management API in Azure. */ -@Fluent -public interface ExpressRouteCircuitPeerings - extends SupportsListing, - SupportsGettingByName, - SupportsGettingById, - SupportsDeletingByName, - SupportsDeletingById, - HasParent { - /** - * Begins definition of Azure private peering. - * - * @return next peering definition stage - */ - ExpressRouteCircuitPeering.DefinitionStages.Blank defineAzurePrivatePeering(); - - /** - * Begins definition of Azure public peering. - * - * @return next peering definition stage - */ - ExpressRouteCircuitPeering.DefinitionStages.Blank defineAzurePublicPeering(); - - /** - * Begins definition of Microsoft peering. - * - * @return next peering definition stage - */ - ExpressRouteCircuitPeering.DefinitionStages.WithAdvertisedPublicPrefixes defineMicrosoftPeering(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCircuitReference.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCircuitReference.java deleted file mode 100644 index 6f09a36eaca9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCircuitReference.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The ExpressRouteCircuitReference model. */ -@Fluent -public final class ExpressRouteCircuitReference { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitReference.class); - - /* - * Corresponding Express Route Circuit Id. - */ - @JsonProperty(value = "id") - private String id; - - /** - * Get the id property: Corresponding Express Route Circuit Id. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: Corresponding Express Route Circuit Id. - * - * @param id the id value to set. - * @return the ExpressRouteCircuitReference object itself. - */ - public ExpressRouteCircuitReference withId(String id) { - this.id = id; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCircuitRoutesTable.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCircuitRoutesTable.java deleted file mode 100644 index d154bca50d09..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCircuitRoutesTable.java +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The routes table associated with the ExpressRouteCircuit. */ -@Fluent -public final class ExpressRouteCircuitRoutesTable { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitRoutesTable.class); - - /* - * IP address of a network entity - */ - @JsonProperty(value = "network") - private String network; - - /* - * NextHop address - */ - @JsonProperty(value = "nextHop") - private String nextHop; - - /* - * Local preference value as set with the set local-preference route-map - * configuration command - */ - @JsonProperty(value = "locPrf") - private String locPrf; - - /* - * Route Weight. - */ - @JsonProperty(value = "weight") - private Integer weight; - - /* - * Autonomous system paths to the destination network. - */ - @JsonProperty(value = "path") - private String path; - - /** - * Get the network property: IP address of a network entity. - * - * @return the network value. - */ - public String network() { - return this.network; - } - - /** - * Set the network property: IP address of a network entity. - * - * @param network the network value to set. - * @return the ExpressRouteCircuitRoutesTable object itself. - */ - public ExpressRouteCircuitRoutesTable withNetwork(String network) { - this.network = network; - return this; - } - - /** - * Get the nextHop property: NextHop address. - * - * @return the nextHop value. - */ - public String nextHop() { - return this.nextHop; - } - - /** - * Set the nextHop property: NextHop address. - * - * @param nextHop the nextHop value to set. - * @return the ExpressRouteCircuitRoutesTable object itself. - */ - public ExpressRouteCircuitRoutesTable withNextHop(String nextHop) { - this.nextHop = nextHop; - return this; - } - - /** - * Get the locPrf property: Local preference value as set with the set local-preference route-map configuration - * command. - * - * @return the locPrf value. - */ - public String locPrf() { - return this.locPrf; - } - - /** - * Set the locPrf property: Local preference value as set with the set local-preference route-map configuration - * command. - * - * @param locPrf the locPrf value to set. - * @return the ExpressRouteCircuitRoutesTable object itself. - */ - public ExpressRouteCircuitRoutesTable withLocPrf(String locPrf) { - this.locPrf = locPrf; - return this; - } - - /** - * Get the weight property: Route Weight. - * - * @return the weight value. - */ - public Integer weight() { - return this.weight; - } - - /** - * Set the weight property: Route Weight. - * - * @param weight the weight value to set. - * @return the ExpressRouteCircuitRoutesTable object itself. - */ - public ExpressRouteCircuitRoutesTable withWeight(Integer weight) { - this.weight = weight; - return this; - } - - /** - * Get the path property: Autonomous system paths to the destination network. - * - * @return the path value. - */ - public String path() { - return this.path; - } - - /** - * Set the path property: Autonomous system paths to the destination network. - * - * @param path the path value to set. - * @return the ExpressRouteCircuitRoutesTable object itself. - */ - public ExpressRouteCircuitRoutesTable withPath(String path) { - this.path = path; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCircuitRoutesTableSummary.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCircuitRoutesTableSummary.java deleted file mode 100644 index 5cd06f3360c5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCircuitRoutesTableSummary.java +++ /dev/null @@ -1,160 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The routes table associated with the ExpressRouteCircuit. */ -@Fluent -public final class ExpressRouteCircuitRoutesTableSummary { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitRoutesTableSummary.class); - - /* - * IP address of the neighbor. - */ - @JsonProperty(value = "neighbor") - private String neighbor; - - /* - * BGP version number spoken to the neighbor. - */ - @JsonProperty(value = "v") - private Integer v; - - /* - * Autonomous system number. - */ - @JsonProperty(value = "as") - private Integer as; - - /* - * The length of time that the BGP session has been in the Established - * state, or the current status if not in the Established state. - */ - @JsonProperty(value = "upDown") - private String upDown; - - /* - * Current state of the BGP session, and the number of prefixes that have - * been received from a neighbor or peer group. - */ - @JsonProperty(value = "statePfxRcd") - private String statePfxRcd; - - /** - * Get the neighbor property: IP address of the neighbor. - * - * @return the neighbor value. - */ - public String neighbor() { - return this.neighbor; - } - - /** - * Set the neighbor property: IP address of the neighbor. - * - * @param neighbor the neighbor value to set. - * @return the ExpressRouteCircuitRoutesTableSummary object itself. - */ - public ExpressRouteCircuitRoutesTableSummary withNeighbor(String neighbor) { - this.neighbor = neighbor; - return this; - } - - /** - * Get the v property: BGP version number spoken to the neighbor. - * - * @return the v value. - */ - public Integer v() { - return this.v; - } - - /** - * Set the v property: BGP version number spoken to the neighbor. - * - * @param v the v value to set. - * @return the ExpressRouteCircuitRoutesTableSummary object itself. - */ - public ExpressRouteCircuitRoutesTableSummary withV(Integer v) { - this.v = v; - return this; - } - - /** - * Get the as property: Autonomous system number. - * - * @return the as value. - */ - public Integer as() { - return this.as; - } - - /** - * Set the as property: Autonomous system number. - * - * @param as the as value to set. - * @return the ExpressRouteCircuitRoutesTableSummary object itself. - */ - public ExpressRouteCircuitRoutesTableSummary withAs(Integer as) { - this.as = as; - return this; - } - - /** - * Get the upDown property: The length of time that the BGP session has been in the Established state, or the - * current status if not in the Established state. - * - * @return the upDown value. - */ - public String upDown() { - return this.upDown; - } - - /** - * Set the upDown property: The length of time that the BGP session has been in the Established state, or the - * current status if not in the Established state. - * - * @param upDown the upDown value to set. - * @return the ExpressRouteCircuitRoutesTableSummary object itself. - */ - public ExpressRouteCircuitRoutesTableSummary withUpDown(String upDown) { - this.upDown = upDown; - return this; - } - - /** - * Get the statePfxRcd property: Current state of the BGP session, and the number of prefixes that have been - * received from a neighbor or peer group. - * - * @return the statePfxRcd value. - */ - public String statePfxRcd() { - return this.statePfxRcd; - } - - /** - * Set the statePfxRcd property: Current state of the BGP session, and the number of prefixes that have been - * received from a neighbor or peer group. - * - * @param statePfxRcd the statePfxRcd value to set. - * @return the ExpressRouteCircuitRoutesTableSummary object itself. - */ - public ExpressRouteCircuitRoutesTableSummary withStatePfxRcd(String statePfxRcd) { - this.statePfxRcd = statePfxRcd; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCircuitServiceProviderProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCircuitServiceProviderProperties.java deleted file mode 100644 index ee56b3232981..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCircuitServiceProviderProperties.java +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Contains ServiceProviderProperties in an ExpressRouteCircuit. */ -@Fluent -public final class ExpressRouteCircuitServiceProviderProperties { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitServiceProviderProperties.class); - - /* - * The serviceProviderName. - */ - @JsonProperty(value = "serviceProviderName") - private String serviceProviderName; - - /* - * The peering location. - */ - @JsonProperty(value = "peeringLocation") - private String peeringLocation; - - /* - * The BandwidthInMbps. - */ - @JsonProperty(value = "bandwidthInMbps") - private Integer bandwidthInMbps; - - /** - * Get the serviceProviderName property: The serviceProviderName. - * - * @return the serviceProviderName value. - */ - public String serviceProviderName() { - return this.serviceProviderName; - } - - /** - * Set the serviceProviderName property: The serviceProviderName. - * - * @param serviceProviderName the serviceProviderName value to set. - * @return the ExpressRouteCircuitServiceProviderProperties object itself. - */ - public ExpressRouteCircuitServiceProviderProperties withServiceProviderName(String serviceProviderName) { - this.serviceProviderName = serviceProviderName; - return this; - } - - /** - * Get the peeringLocation property: The peering location. - * - * @return the peeringLocation value. - */ - public String peeringLocation() { - return this.peeringLocation; - } - - /** - * Set the peeringLocation property: The peering location. - * - * @param peeringLocation the peeringLocation value to set. - * @return the ExpressRouteCircuitServiceProviderProperties object itself. - */ - public ExpressRouteCircuitServiceProviderProperties withPeeringLocation(String peeringLocation) { - this.peeringLocation = peeringLocation; - return this; - } - - /** - * Get the bandwidthInMbps property: The BandwidthInMbps. - * - * @return the bandwidthInMbps value. - */ - public Integer bandwidthInMbps() { - return this.bandwidthInMbps; - } - - /** - * Set the bandwidthInMbps property: The BandwidthInMbps. - * - * @param bandwidthInMbps the bandwidthInMbps value to set. - * @return the ExpressRouteCircuitServiceProviderProperties object itself. - */ - public ExpressRouteCircuitServiceProviderProperties withBandwidthInMbps(Integer bandwidthInMbps) { - this.bandwidthInMbps = bandwidthInMbps; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCircuitSku.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCircuitSku.java deleted file mode 100644 index f6da3cda9154..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCircuitSku.java +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Contains SKU in an ExpressRouteCircuit. */ -@Fluent -public final class ExpressRouteCircuitSku { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitSku.class); - - /* - * The name of the SKU. - */ - @JsonProperty(value = "name") - private String name; - - /* - * The tier of the SKU. Possible values are 'Standard', 'Premium' or - * 'Basic'. - */ - @JsonProperty(value = "tier") - private ExpressRouteCircuitSkuTier tier; - - /* - * The family of the SKU. Possible values are: 'UnlimitedData' and - * 'MeteredData'. - */ - @JsonProperty(value = "family") - private ExpressRouteCircuitSkuFamily family; - - /** - * Get the name property: The name of the SKU. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the SKU. - * - * @param name the name value to set. - * @return the ExpressRouteCircuitSku object itself. - */ - public ExpressRouteCircuitSku withName(String name) { - this.name = name; - return this; - } - - /** - * Get the tier property: The tier of the SKU. Possible values are 'Standard', 'Premium' or 'Basic'. - * - * @return the tier value. - */ - public ExpressRouteCircuitSkuTier tier() { - return this.tier; - } - - /** - * Set the tier property: The tier of the SKU. Possible values are 'Standard', 'Premium' or 'Basic'. - * - * @param tier the tier value to set. - * @return the ExpressRouteCircuitSku object itself. - */ - public ExpressRouteCircuitSku withTier(ExpressRouteCircuitSkuTier tier) { - this.tier = tier; - return this; - } - - /** - * Get the family property: The family of the SKU. Possible values are: 'UnlimitedData' and 'MeteredData'. - * - * @return the family value. - */ - public ExpressRouteCircuitSkuFamily family() { - return this.family; - } - - /** - * Set the family property: The family of the SKU. Possible values are: 'UnlimitedData' and 'MeteredData'. - * - * @param family the family value to set. - * @return the ExpressRouteCircuitSku object itself. - */ - public ExpressRouteCircuitSku withFamily(ExpressRouteCircuitSkuFamily family) { - this.family = family; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCircuitSkuFamily.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCircuitSkuFamily.java deleted file mode 100644 index 0fd7c92cf14d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCircuitSkuFamily.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ExpressRouteCircuitSkuFamily. */ -public final class ExpressRouteCircuitSkuFamily extends ExpandableStringEnum { - /** Static value UnlimitedData for ExpressRouteCircuitSkuFamily. */ - public static final ExpressRouteCircuitSkuFamily UNLIMITED_DATA = fromString("UnlimitedData"); - - /** Static value MeteredData for ExpressRouteCircuitSkuFamily. */ - public static final ExpressRouteCircuitSkuFamily METERED_DATA = fromString("MeteredData"); - - /** - * Creates or finds a ExpressRouteCircuitSkuFamily from its string representation. - * - * @param name a name to look for. - * @return the corresponding ExpressRouteCircuitSkuFamily. - */ - @JsonCreator - public static ExpressRouteCircuitSkuFamily fromString(String name) { - return fromString(name, ExpressRouteCircuitSkuFamily.class); - } - - /** @return known ExpressRouteCircuitSkuFamily values. */ - public static Collection values() { - return values(ExpressRouteCircuitSkuFamily.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCircuitSkuTier.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCircuitSkuTier.java deleted file mode 100644 index d6351a923d8e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCircuitSkuTier.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ExpressRouteCircuitSkuTier. */ -public final class ExpressRouteCircuitSkuTier extends ExpandableStringEnum { - /** Static value Standard for ExpressRouteCircuitSkuTier. */ - public static final ExpressRouteCircuitSkuTier STANDARD = fromString("Standard"); - - /** Static value Premium for ExpressRouteCircuitSkuTier. */ - public static final ExpressRouteCircuitSkuTier PREMIUM = fromString("Premium"); - - /** Static value Basic for ExpressRouteCircuitSkuTier. */ - public static final ExpressRouteCircuitSkuTier BASIC = fromString("Basic"); - - /** - * Creates or finds a ExpressRouteCircuitSkuTier from its string representation. - * - * @param name a name to look for. - * @return the corresponding ExpressRouteCircuitSkuTier. - */ - @JsonCreator - public static ExpressRouteCircuitSkuTier fromString(String name) { - return fromString(name, ExpressRouteCircuitSkuTier.class); - } - - /** @return known ExpressRouteCircuitSkuTier values. */ - public static Collection values() { - return values(ExpressRouteCircuitSkuTier.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCircuitSkuType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCircuitSkuType.java deleted file mode 100644 index 4c5762f67aa7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCircuitSkuType.java +++ /dev/null @@ -1,132 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import java.util.Collection; -import java.util.HashMap; -import java.util.Locale; -import java.util.Map; - -/** Express route circuit sku type. */ -public class ExpressRouteCircuitSkuType { - private static final Map VALUES_BY_NAME = new HashMap<>(); - - /** Static value for Standard sku tier and MeteredData sku family. */ - public static final ExpressRouteCircuitSkuType STANDARD_METEREDDATA = - new ExpressRouteCircuitSkuType(ExpressRouteCircuitSkuTier.STANDARD, ExpressRouteCircuitSkuFamily.METERED_DATA); - /** Static value for Standard sku tier and UnlimitedData sku family. */ - public static final ExpressRouteCircuitSkuType STANDARD_UNLIMITEDDATA = - new ExpressRouteCircuitSkuType( - ExpressRouteCircuitSkuTier.STANDARD, ExpressRouteCircuitSkuFamily.UNLIMITED_DATA); - /** Static value for Premium sku tier and MeteredData sku family. */ - public static final ExpressRouteCircuitSkuType PREMIUM_METEREDDATA = - new ExpressRouteCircuitSkuType(ExpressRouteCircuitSkuTier.PREMIUM, ExpressRouteCircuitSkuFamily.METERED_DATA); - /** Static value for Premium sku tier and UnlimitedData sku family. */ - public static final ExpressRouteCircuitSkuType PREMIUM_UNLIMITEDDATA = - new ExpressRouteCircuitSkuType(ExpressRouteCircuitSkuTier.PREMIUM, ExpressRouteCircuitSkuFamily.UNLIMITED_DATA); - - /** the SKU corresponding to this type. */ - private final ExpressRouteCircuitSku sku; - - /** The string value of the SKU. */ - private final String value; - - /** @return predefined Express Route circuit SKU types */ - public static ExpressRouteCircuitSkuType[] values() { - Collection valuesCollection = VALUES_BY_NAME.values(); - return valuesCollection.toArray(new ExpressRouteCircuitSkuType[valuesCollection.size()]); - } - - /** - * Creates a custom value for ExpressRouteCircuitSkuType. - * - * @param skuTier a SKU tier - * @param skuFamily an SKU family - */ - public ExpressRouteCircuitSkuType(ExpressRouteCircuitSkuTier skuTier, ExpressRouteCircuitSkuFamily skuFamily) { - this( - new ExpressRouteCircuitSku() - .withName( - (skuTier == null ? "" : skuTier.toString()) + "_" + (skuFamily == null ? "" : skuFamily.toString())) - .withTier(skuTier) - .withFamily(skuFamily)); - } - - /** - * Creates a custom value for ExpressRouteCircuitSkuType. - * - * @param sku the SKU - */ - public ExpressRouteCircuitSkuType(ExpressRouteCircuitSku sku) { - // Store Sku copy since original user provided sku can be modified - // by the user. - // - this.sku = createCopy(sku); - - this.value = this.sku.name(); - VALUES_BY_NAME.put(this.value.toLowerCase(Locale.ROOT), this); - } - - /** - * Searches for an SKU type and creates a new Express Route circuit SKU type instance if not found among the - * existing ones. - * - * @param sku an Express Route circuit SKU - * @return the parsed or created Express Route circuit SKU type - */ - public static ExpressRouteCircuitSkuType fromSku(ExpressRouteCircuitSku sku) { - if (sku == null) { - return null; - } - - String nameToLookFor = sku.name(); - - ExpressRouteCircuitSkuType result = VALUES_BY_NAME.get(nameToLookFor.toLowerCase(Locale.ROOT)); - if (result != null) { - return result; - } else { - return new ExpressRouteCircuitSkuType(sku); - } - } - - /** @return the SKU */ - public ExpressRouteCircuitSku sku() { - // Return copy of sku to guard ExpressRouteCircuitSkuType from ending up with invalid - // sku in case consumer changes the returned Sku instance. - // - return createCopy(this.sku); - } - - @Override - public String toString() { - return this.value; - } - - @Override - public int hashCode() { - return this.value.hashCode(); - } - - @Override - public boolean equals(Object obj) { - if (!(obj instanceof ExpressRouteCircuitSkuType)) { - return false; - } else if (obj == this) { - return true; - } else if (value == null) { - return ((ExpressRouteCircuitSkuType) obj).value == null; - } else { - return value.equalsIgnoreCase(((ExpressRouteCircuitSkuType) obj).value.toLowerCase(Locale.ROOT)); - } - } - - /** - * Creates a copy of the given sku. - * - * @param sku the sku to create copy of - * @return the copy - */ - private static ExpressRouteCircuitSku createCopy(ExpressRouteCircuitSku sku) { - return new ExpressRouteCircuitSku().withName(sku.name()).withTier(sku.tier()).withFamily(sku.family()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCircuitStats.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCircuitStats.java deleted file mode 100644 index a246de940d47..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCircuitStats.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.network.fluent.models.ExpressRouteCircuitStatsInner; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; - -/** Contains stats associated with the peering. */ -@Fluent -public interface ExpressRouteCircuitStats extends HasInnerModel { - /** @return inbound bytes through primary channel of the peering */ - long primaryBytesIn(); - - /** @return outbound bytes through primary channel of the peering */ - long primaryBytesOut(); - - /** @return inbound bytes through secondary channel of the peering */ - long secondaryBytesIn(); - - /** @return outbound bytes through secondary channel of the peering */ - long secondaryBytesOut(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCircuits.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCircuits.java deleted file mode 100644 index 0295f5940f1a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCircuits.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsDeletingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsListingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsBatchCreation; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsCreating; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingById; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; - -/** Entry point to express route circuits management API in Azure. */ -@Fluent -public interface ExpressRouteCircuits - extends SupportsCreating, - SupportsListing, - SupportsListingByResourceGroup, - SupportsGettingByResourceGroup, - SupportsGettingById, - SupportsDeletingById, - SupportsDeletingByResourceGroup, - SupportsBatchCreation, - HasManager { -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteConnectionId.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteConnectionId.java deleted file mode 100644 index 9eb4a18fb967..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteConnectionId.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The ID of the ExpressRouteConnection. */ -@Immutable -public final class ExpressRouteConnectionId { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteConnectionId.class); - - /* - * The ID of the ExpressRouteConnection. - */ - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) - private String id; - - /** - * Get the id property: The ID of the ExpressRouteConnection. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCrossConnection.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCrossConnection.java deleted file mode 100644 index fa2319270ddf..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCrossConnection.java +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.network.fluent.models.ExpressRouteCrossConnectionInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.GroupableResource; -import com.azure.resourcemanager.resources.fluentcore.arm.models.Resource; -import com.azure.resourcemanager.resources.fluentcore.model.Appliable; -import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; -import com.azure.resourcemanager.resources.fluentcore.model.Updatable; -import java.util.Map; - -/** Entry point for Express Route Cross Connection management API in Azure. */ -@Fluent -public interface ExpressRouteCrossConnection - extends GroupableResource, - Refreshable, - Updatable, - UpdatableWithTags { - - /** @return entry point to manage express route peerings associated with express route circuit */ - ExpressRouteCrossConnectionPeerings peerings(); - - /** @return the name of the primary port */ - String primaryAzurePort(); - - /** @return the name of the secondary port */ - String secondaryAzurePort(); - - /** @return the identifier of the circuit traffic */ - Integer stag(); - - /** @return the peering location of the ExpressRoute circuit */ - String peeringLocation(); - - /** @return the circuit bandwidth In Mbps */ - int bandwidthInMbps(); - - /** @return the ExpressRouteCircuit */ - ExpressRouteCircuitReference expressRouteCircuit(); - - /** @return the provisioning state of the circuit in the connectivity provider system */ - ServiceProviderProvisioningState serviceProviderProvisioningState(); - - /** @return additional read only notes set by the connectivity provider */ - String serviceProviderNotes(); - - /** @return the provisioning state of the express route cross connection resource */ - String provisioningState(); - - /** @return the peerings associated with this express route cross connection, indexed by name */ - Map peeringsMap(); - - /** Grouping of express route cross connection update stages. */ - interface UpdateStages { - /** - * The stage of express route cross connection update allowing to specify service provider provisioning state. - */ - interface WithServiceProviderProviosioningState { - /** - * Specifies the service provider provisioning state for the express route cross connection. - * - * @param state the service provider provisioning state - * @return next stage of update - */ - Update withServiceProviderProvisioningState(ServiceProviderProvisioningState state); - } - - /** The stage of express route cross connection update allowing to specify service provider notes. */ - interface WithServiceProviderNotes { - /** - * Specifies the service provider notes for the express route cross connection. - * - * @param notes the service provider notes - * @return next stage of update - */ - Update withServiceProviderNotes(String notes); - } - } - - /** - * The template for a express route cross connection update operation, containing all the settings that can be - * modified. - */ - interface Update - extends Appliable, - Resource.UpdateWithTags, - UpdateStages.WithServiceProviderProviosioningState, - UpdateStages.WithServiceProviderNotes { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCrossConnectionListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCrossConnectionListResult.java deleted file mode 100644 index 341f2943863a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCrossConnectionListResult.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.ExpressRouteCrossConnectionInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Response for ListExpressRouteCrossConnection API service call. */ -@Fluent -public final class ExpressRouteCrossConnectionListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteCrossConnectionListResult.class); - - /* - * A list of ExpressRouteCrossConnection resources. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to get the next set of results. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: A list of ExpressRouteCrossConnection resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: A list of ExpressRouteCrossConnection resources. - * - * @param value the value value to set. - * @return the ExpressRouteCrossConnectionListResult object itself. - */ - public ExpressRouteCrossConnectionListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to get the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCrossConnectionPeering.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCrossConnectionPeering.java deleted file mode 100644 index f7bb4d89884d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCrossConnectionPeering.java +++ /dev/null @@ -1,349 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.network.fluent.models.ExpressRouteCrossConnectionPeeringInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.IndependentChild; -import com.azure.resourcemanager.resources.fluentcore.model.Appliable; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; -import com.azure.resourcemanager.resources.fluentcore.model.Updatable; - -/** - * Client-side representation of express route cross connection peering object, associated with express route cross - * connection. - */ -@Fluent -public interface ExpressRouteCrossConnectionPeering - extends IndependentChild, - HasInnerModel, - Refreshable, - Updatable { - /** @return the peering type */ - ExpressRoutePeeringType peeringType(); - - /** @return the peering state */ - ExpressRoutePeeringState state(); - - /** @return the Azure ASN */ - int azureAsn(); - - /** @return the peer ASN */ - long peerAsn(); - - /** @return the primary address prefix */ - String primaryPeerAddressPrefix(); - - /** @return the secondary address prefix */ - String secondaryPeerAddressPrefix(); - - /** @return the primary port */ - String primaryAzurePort(); - - /** @return the secondary port */ - String secondaryAzurePort(); - - /** @return the shared key */ - String sharedKey(); - - /** @return the VLAN ID */ - int vlanId(); - - /** @return the Microsoft peering configuration */ - ExpressRouteCircuitPeeringConfig microsoftPeeringConfig(); - - /** @return the provisioning state of the public IP resource */ - String provisioningState(); - - /** @return the GatewayManager Etag */ - String gatewayManagerEtag(); - - /** @return whether the provider or the customer last modified the peering */ - String lastModifiedBy(); - - /** @return the IPv6 peering configuration. */ - Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig(); - - /** The entirety of the express route Cross Connection peering definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithAdvertisedPublicPrefixes, - DefinitionStages.WithCustomerASN, - DefinitionStages.WithRoutingRegistryName, - DefinitionStages.WithPrimaryPeerAddressPrefix, - DefinitionStages.WithSecondaryPeerAddressPrefix, - DefinitionStages.WithVlanId, - DefinitionStages.WithPeerASN, - DefinitionStages.WithCreate { - } - - /** Grouping of express route Cross Connection peering definition stages. */ - interface DefinitionStages { - /** - * The first stage of an Express Route Cross Connection Peering configuration. - */ - interface Blank extends WithPrimaryPeerAddressPrefix { - } - - /** - * The stage of Express Route Cross Connection Peering definition allowing to specify advertised address - * prefixes. - */ - interface WithAdvertisedPublicPrefixes { - /** - * Specify advertised prefixes: sets a list of all prefixes that are planned to advertise over the BGP - * session. Only public IP address prefixes are accepted. A set of prefixes can be sent as a comma-separated - * list. These prefixes must be registered to you in an RIR / IRR. - * - * @param publicPrefixes advertised prefixes - * @return next stage of definition - */ - WithCustomerASN withAdvertisedPublicPrefixes(String publicPrefixes); - } - - /** The stage of Cross Connection Peering configuration definition allowing to specify customer ASN. */ - interface WithCustomerASN { - /** - * Specifies customer ASN. - * - * @param customerASN customer ASN - * @return the next satge of the definition - */ - WithRoutingRegistryName withCustomerAsn(int customerASN); - } - - /** The stage of Cross Connection Peering definition allowing to specify routing registry name. */ - interface WithRoutingRegistryName { - /** - * Specifies routing registry name. - * - * @param routingRegistryName routing registry name - * @return the next stage of the definition - */ - WithPrimaryPeerAddressPrefix withRoutingRegistryName(String routingRegistryName); - } - - /** - * The stage of Express Route Cross Connection Peering definition allowing to specify primary address prefix. - */ - interface WithPrimaryPeerAddressPrefix { - /** - * Specifies the primary peer address prefix. - * - * @param addressPrefix the primary peer address prefix - * @return the next stage of the definition - */ - WithSecondaryPeerAddressPrefix withPrimaryPeerAddressPrefix(String addressPrefix); - } - - /** - * The stage of Express Route Cross Connection Peering definition allowing to specify secondary address prefix. - */ - interface WithSecondaryPeerAddressPrefix { - /** - * Specifies the secondary peer address prefix. - * - * @param addressPrefix the secondary peer address prefix - * @return the next stage of the definition - */ - WithVlanId withSecondaryPeerAddressPrefix(String addressPrefix); - } - - /** The stage of Express Route Cross Connection Peering definition allowing to specify VLAN ID. */ - interface WithVlanId { - /** - * @param vlanId a valid VLAN ID to establish this peering on. No other peering in the circuit can use the - * same VLAN ID - * @return next stage of definition - */ - WithPeerASN withVlanId(int vlanId); - } - - /** The stage of Express Route Cross Connection Peering definition allowing to specify AS number for peering. */ - interface WithPeerASN { - /** - * @param peerASN AS number for peering. Both 2-byte and 4-byte AS numbers can be used - * @return next stage of definition - */ - WithCreate withPeerAsn(long peerASN); - } - - /** The stage of Express Route Cross Connection Peering definition allowing to specify a Shared Key. */ - interface WithSharedKey { - /** - * Specifies the shared key. - * - * @param sharedKey the shared key - * @return the next stage of the definition - */ - WithCreate withSharedKey(String sharedKey); - } - - /** Specifies IPv6 configuration. */ - interface WithIpv6PeeringConfig { - /** - * Begins the definition of IPv6 configuration. - * - * @return next stage of Ipv6 configuration definition - */ - Ipv6PeeringConfig.DefinitionStages.Blank defineIpv6Config(); - - /** - * Removes IPv6 configuration from peering. - * - * @return the next stage of the update - */ - WithCreate withoutIpv6Config(); - } - - /** The stage of Express Route Cross Connection Peering definition allowing to specify the peering state. */ - interface WithState { - /** - * Specifies the peering state. - * - * @param state the peering state - * @return the next stage of the definition - */ - WithCreate withState(ExpressRoutePeeringState state); - } - - /** - * The stage of the Express Route Cross Connection Peering definition which contains all the minimum required - * inputs for the resource to be created, but also allows for any other optional settings to be specified. - */ - interface WithCreate - extends Creatable, - DefinitionStages.WithSharedKey, - DefinitionStages.WithIpv6PeeringConfig, - DefinitionStages.WithState { - } - } - - /** Grouping of express route cross connection peering update stages. */ - interface Update - extends Appliable, - UpdateStages.WithAdvertisedPublicPrefixes, - UpdateStages.WithCustomerASN, - UpdateStages.WithRoutingRegistryName, - UpdateStages.WithPrimaryPeerAddressPrefix, - UpdateStages.WithSecondaryPeerAddressPrefix, - UpdateStages.WithVlanId, - UpdateStages.WithPeerASN, - UpdateStages.WithIpv6PeeringConfig, - UpdateStages.WithState { - } - - /** - * The template for express route Cross Connection peering update operation, containing all the settings that can be - * modified. - */ - interface UpdateStages { - /** - * The stage of Express Route Cross Connection Peering update allowing to specify advertised address prefixes. - */ - interface WithAdvertisedPublicPrefixes { - /** - * Specifies the advertised public prefixes. - * - * @param publicPrefixes the advertised public prefixes - * @return the next stage of the definition - */ - Update withAdvertisedPublicPrefixes(String publicPrefixes); - } - - /** The stage of Cross Connection Peering configuration definition allowing to specify customer ASN. */ - interface WithCustomerASN { - /** - * Specifies customer ASN. - * - * @param customerASN customer ASN - * @return the next stage of the update - */ - Update withCustomerAsn(int customerASN); - } - - /** The stage of Cross Connection Peering definition allowing to specify routing registry name. */ - interface WithRoutingRegistryName { - /** - * Specifies routing registry name. - * - * @param routingRegistryName routing registry name - * @return the next stage of the update - */ - Update withRoutingRegistryName(String routingRegistryName); - } - - /** The stage of Express Route Cross Connection Peering update allowing to specify primary address prefix. */ - interface WithPrimaryPeerAddressPrefix { - /** - * Specifies the primary peer address prefix. - * - * @param addressPrefix the primary peer address prefix - * @return the next stage of the update - */ - Update withPrimaryPeerAddressPrefix(String addressPrefix); - } - - /** The stage of Express Route Cross Connection Peering update allowing to specify secondary address prefix. */ - interface WithSecondaryPeerAddressPrefix { - /** - * @param addressPrefix secondary address prefix - * @return the next stage of the update - */ - Update withSecondaryPeerAddressPrefix(String addressPrefix); - } - - /** The stage of Express Route Cross Connection Peering update allowing to specify VLAN ID. */ - interface WithVlanId { - /** - * Sets the VLAN ID. - * - * @param vlanId VLAN ID - * @return the next stage of the update - */ - Update withVlanId(int vlanId); - } - - /** The stage of Express Route Cross Connection Peering update allowing to specify AS number for peering. */ - interface WithPeerASN { - /** - * Sets peer ASN. - * - * @param peerASN the AS number for peering - * @return the next stage of the update - */ - Update withPeerAsn(long peerASN); - } - - /** Specifies IPv6 configuration. */ - interface WithIpv6PeeringConfig { - /** - * Begins the definition of IPv6 configuration. - * - * @return next stage of Ipv6 configuration definition - */ - Ipv6PeeringConfig.UpdateDefinitionStages.Blank defineIpv6Config(); - - /** - * Removes IPv6 configuration from peering. - * - * @return the next stage of the update - */ - Update withoutIpv6Config(); - } - - /** The stage of Express Route Cross Connection Peering update allowing to specify the peering state. */ - interface WithState { - /** - * Specifies the peering state. - * - * @param state the peering state - * @return the next stage of the update - */ - Update withState(ExpressRoutePeeringState state); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCrossConnectionPeeringList.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCrossConnectionPeeringList.java deleted file mode 100644 index 36c6f4bc66f7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCrossConnectionPeeringList.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.ExpressRouteCrossConnectionPeeringInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Response for ListPeering API service call retrieves all peerings that belong to an ExpressRouteCrossConnection. */ -@Fluent -public final class ExpressRouteCrossConnectionPeeringList { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteCrossConnectionPeeringList.class); - - /* - * The peerings in an express route cross connection. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to get the next set of results. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: The peerings in an express route cross connection. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The peerings in an express route cross connection. - * - * @param value the value value to set. - * @return the ExpressRouteCrossConnectionPeeringList object itself. - */ - public ExpressRouteCrossConnectionPeeringList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to get the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCrossConnectionPeerings.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCrossConnectionPeerings.java deleted file mode 100644 index 21963ba6b305..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCrossConnectionPeerings.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingByName; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasParent; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingById; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingByName; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; - -/** Entry point for express route cross connection peerings management API in Azure. */ -@Fluent -public interface ExpressRouteCrossConnectionPeerings - extends SupportsListing, - SupportsGettingByName, - SupportsGettingById, - SupportsDeletingByName, - SupportsDeletingById, - HasParent { - /** - * Begins definition of Azure private peering. - * - * @return next peering definition stage - */ - ExpressRouteCrossConnectionPeering.DefinitionStages.Blank defineAzurePrivatePeering(); - - /** - * Begins definition of Microsoft peering. - * - * @return next peering definition stage - */ - ExpressRouteCrossConnectionPeering.DefinitionStages.WithAdvertisedPublicPrefixes defineMicrosoftPeering(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCrossConnectionRoutesTableSummary.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCrossConnectionRoutesTableSummary.java deleted file mode 100644 index ad980aa607ea..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCrossConnectionRoutesTableSummary.java +++ /dev/null @@ -1,135 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The routes table associated with the ExpressRouteCircuit. */ -@Fluent -public final class ExpressRouteCrossConnectionRoutesTableSummary { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(ExpressRouteCrossConnectionRoutesTableSummary.class); - - /* - * IP address of Neighbor router - */ - @JsonProperty(value = "neighbor") - private String neighbor; - - /* - * Autonomous system number. - */ - @JsonProperty(value = "asn") - private Integer asn; - - /* - * The length of time that the BGP session has been in the Established - * state, or the current status if not in the Established state. - */ - @JsonProperty(value = "upDown") - private String upDown; - - /* - * Current state of the BGP session, and the number of prefixes that have - * been received from a neighbor or peer group. - */ - @JsonProperty(value = "stateOrPrefixesReceived") - private String stateOrPrefixesReceived; - - /** - * Get the neighbor property: IP address of Neighbor router. - * - * @return the neighbor value. - */ - public String neighbor() { - return this.neighbor; - } - - /** - * Set the neighbor property: IP address of Neighbor router. - * - * @param neighbor the neighbor value to set. - * @return the ExpressRouteCrossConnectionRoutesTableSummary object itself. - */ - public ExpressRouteCrossConnectionRoutesTableSummary withNeighbor(String neighbor) { - this.neighbor = neighbor; - return this; - } - - /** - * Get the asn property: Autonomous system number. - * - * @return the asn value. - */ - public Integer asn() { - return this.asn; - } - - /** - * Set the asn property: Autonomous system number. - * - * @param asn the asn value to set. - * @return the ExpressRouteCrossConnectionRoutesTableSummary object itself. - */ - public ExpressRouteCrossConnectionRoutesTableSummary withAsn(Integer asn) { - this.asn = asn; - return this; - } - - /** - * Get the upDown property: The length of time that the BGP session has been in the Established state, or the - * current status if not in the Established state. - * - * @return the upDown value. - */ - public String upDown() { - return this.upDown; - } - - /** - * Set the upDown property: The length of time that the BGP session has been in the Established state, or the - * current status if not in the Established state. - * - * @param upDown the upDown value to set. - * @return the ExpressRouteCrossConnectionRoutesTableSummary object itself. - */ - public ExpressRouteCrossConnectionRoutesTableSummary withUpDown(String upDown) { - this.upDown = upDown; - return this; - } - - /** - * Get the stateOrPrefixesReceived property: Current state of the BGP session, and the number of prefixes that have - * been received from a neighbor or peer group. - * - * @return the stateOrPrefixesReceived value. - */ - public String stateOrPrefixesReceived() { - return this.stateOrPrefixesReceived; - } - - /** - * Set the stateOrPrefixesReceived property: Current state of the BGP session, and the number of prefixes that have - * been received from a neighbor or peer group. - * - * @param stateOrPrefixesReceived the stateOrPrefixesReceived value to set. - * @return the ExpressRouteCrossConnectionRoutesTableSummary object itself. - */ - public ExpressRouteCrossConnectionRoutesTableSummary withStateOrPrefixesReceived(String stateOrPrefixesReceived) { - this.stateOrPrefixesReceived = stateOrPrefixesReceived; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCrossConnections.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCrossConnections.java deleted file mode 100644 index cab0f2c88b0e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteCrossConnections.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsListingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; - -/** Entry point to express route crosss connections management API in Azure. */ -@Fluent -public interface ExpressRouteCrossConnections - extends SupportsListing, - SupportsListingByResourceGroup, - SupportsGettingByResourceGroup, - SupportsGettingById, - HasManager { -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteGatewayPropertiesAutoScaleConfiguration.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteGatewayPropertiesAutoScaleConfiguration.java deleted file mode 100644 index 330da0356bd3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteGatewayPropertiesAutoScaleConfiguration.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Configuration for auto scaling. */ -@Fluent -public final class ExpressRouteGatewayPropertiesAutoScaleConfiguration { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(ExpressRouteGatewayPropertiesAutoScaleConfiguration.class); - - /* - * Minimum and maximum number of scale units to deploy. - */ - @JsonProperty(value = "bounds") - private ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds bounds; - - /** - * Get the bounds property: Minimum and maximum number of scale units to deploy. - * - * @return the bounds value. - */ - public ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds bounds() { - return this.bounds; - } - - /** - * Set the bounds property: Minimum and maximum number of scale units to deploy. - * - * @param bounds the bounds value to set. - * @return the ExpressRouteGatewayPropertiesAutoScaleConfiguration object itself. - */ - public ExpressRouteGatewayPropertiesAutoScaleConfiguration withBounds( - ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds bounds) { - this.bounds = bounds; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (bounds() != null) { - bounds().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds.java deleted file mode 100644 index 59f670f58687..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Minimum and maximum number of scale units to deploy. */ -@Fluent -public final class ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds { - @JsonIgnore - private final ClientLogger logger = - new ClientLogger(ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds.class); - - /* - * Minimum number of scale units deployed for ExpressRoute gateway. - */ - @JsonProperty(value = "min") - private Integer min; - - /* - * Maximum number of scale units deployed for ExpressRoute gateway. - */ - @JsonProperty(value = "max") - private Integer max; - - /** - * Get the min property: Minimum number of scale units deployed for ExpressRoute gateway. - * - * @return the min value. - */ - public Integer min() { - return this.min; - } - - /** - * Set the min property: Minimum number of scale units deployed for ExpressRoute gateway. - * - * @param min the min value to set. - * @return the ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds object itself. - */ - public ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds withMin(Integer min) { - this.min = min; - return this; - } - - /** - * Get the max property: Maximum number of scale units deployed for ExpressRoute gateway. - * - * @return the max value. - */ - public Integer max() { - return this.max; - } - - /** - * Set the max property: Maximum number of scale units deployed for ExpressRoute gateway. - * - * @param max the max value to set. - * @return the ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds object itself. - */ - public ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds withMax(Integer max) { - this.max = max; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteLinkAdminState.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteLinkAdminState.java deleted file mode 100644 index 207d8b06de51..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteLinkAdminState.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ExpressRouteLinkAdminState. */ -public final class ExpressRouteLinkAdminState extends ExpandableStringEnum { - /** Static value Enabled for ExpressRouteLinkAdminState. */ - public static final ExpressRouteLinkAdminState ENABLED = fromString("Enabled"); - - /** Static value Disabled for ExpressRouteLinkAdminState. */ - public static final ExpressRouteLinkAdminState DISABLED = fromString("Disabled"); - - /** - * Creates or finds a ExpressRouteLinkAdminState from its string representation. - * - * @param name a name to look for. - * @return the corresponding ExpressRouteLinkAdminState. - */ - @JsonCreator - public static ExpressRouteLinkAdminState fromString(String name) { - return fromString(name, ExpressRouteLinkAdminState.class); - } - - /** @return known ExpressRouteLinkAdminState values. */ - public static Collection values() { - return values(ExpressRouteLinkAdminState.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteLinkConnectorType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteLinkConnectorType.java deleted file mode 100644 index 2729a316ba67..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteLinkConnectorType.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ExpressRouteLinkConnectorType. */ -public final class ExpressRouteLinkConnectorType extends ExpandableStringEnum { - /** Static value LC for ExpressRouteLinkConnectorType. */ - public static final ExpressRouteLinkConnectorType LC = fromString("LC"); - - /** Static value SC for ExpressRouteLinkConnectorType. */ - public static final ExpressRouteLinkConnectorType SC = fromString("SC"); - - /** - * Creates or finds a ExpressRouteLinkConnectorType from its string representation. - * - * @param name a name to look for. - * @return the corresponding ExpressRouteLinkConnectorType. - */ - @JsonCreator - public static ExpressRouteLinkConnectorType fromString(String name) { - return fromString(name, ExpressRouteLinkConnectorType.class); - } - - /** @return known ExpressRouteLinkConnectorType values. */ - public static Collection values() { - return values(ExpressRouteLinkConnectorType.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteLinkListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteLinkListResult.java deleted file mode 100644 index 3260e2d72963..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteLinkListResult.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.ExpressRouteLinkInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** ExpressRouteLink List Result Response for ListExpressRouteLinks API service call. */ -@Fluent -public final class ExpressRouteLinkListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteLinkListResult.class); - - /* - * The list of ExpressRouteLink sub-resources. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to get the next set of results. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: The list of ExpressRouteLink sub-resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The list of ExpressRouteLink sub-resources. - * - * @param value the value value to set. - * @return the ExpressRouteLinkListResult object itself. - */ - public ExpressRouteLinkListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to get the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The URL to get the next set of results. - * - * @param nextLink the nextLink value to set. - * @return the ExpressRouteLinkListResult object itself. - */ - public ExpressRouteLinkListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRoutePeeringState.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRoutePeeringState.java deleted file mode 100644 index 6b2aedad1374..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRoutePeeringState.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ExpressRoutePeeringState. */ -public final class ExpressRoutePeeringState extends ExpandableStringEnum { - /** Static value Disabled for ExpressRoutePeeringState. */ - public static final ExpressRoutePeeringState DISABLED = fromString("Disabled"); - - /** Static value Enabled for ExpressRoutePeeringState. */ - public static final ExpressRoutePeeringState ENABLED = fromString("Enabled"); - - /** - * Creates or finds a ExpressRoutePeeringState from its string representation. - * - * @param name a name to look for. - * @return the corresponding ExpressRoutePeeringState. - */ - @JsonCreator - public static ExpressRoutePeeringState fromString(String name) { - return fromString(name, ExpressRoutePeeringState.class); - } - - /** @return known ExpressRoutePeeringState values. */ - public static Collection values() { - return values(ExpressRoutePeeringState.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRoutePeeringType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRoutePeeringType.java deleted file mode 100644 index a35536189e4c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRoutePeeringType.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ExpressRoutePeeringType. */ -public final class ExpressRoutePeeringType extends ExpandableStringEnum { - /** Static value AzurePublicPeering for ExpressRoutePeeringType. */ - public static final ExpressRoutePeeringType AZURE_PUBLIC_PEERING = fromString("AzurePublicPeering"); - - /** Static value AzurePrivatePeering for ExpressRoutePeeringType. */ - public static final ExpressRoutePeeringType AZURE_PRIVATE_PEERING = fromString("AzurePrivatePeering"); - - /** Static value MicrosoftPeering for ExpressRoutePeeringType. */ - public static final ExpressRoutePeeringType MICROSOFT_PEERING = fromString("MicrosoftPeering"); - - /** - * Creates or finds a ExpressRoutePeeringType from its string representation. - * - * @param name a name to look for. - * @return the corresponding ExpressRoutePeeringType. - */ - @JsonCreator - public static ExpressRoutePeeringType fromString(String name) { - return fromString(name, ExpressRoutePeeringType.class); - } - - /** @return known ExpressRoutePeeringType values. */ - public static Collection values() { - return values(ExpressRoutePeeringType.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRoutePortListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRoutePortListResult.java deleted file mode 100644 index 8035663b1d40..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRoutePortListResult.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.ExpressRoutePortInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** ExpressRoute Port List Result Response for ListExpressRoutePorts API service call. */ -@Fluent -public final class ExpressRoutePortListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRoutePortListResult.class); - - /* - * A list of ExpressRoutePort resources. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to get the next set of results. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: A list of ExpressRoutePort resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: A list of ExpressRoutePort resources. - * - * @param value the value value to set. - * @return the ExpressRoutePortListResult object itself. - */ - public ExpressRoutePortListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to get the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The URL to get the next set of results. - * - * @param nextLink the nextLink value to set. - * @return the ExpressRoutePortListResult object itself. - */ - public ExpressRoutePortListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRoutePortsEncapsulation.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRoutePortsEncapsulation.java deleted file mode 100644 index aa571d853a61..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRoutePortsEncapsulation.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ExpressRoutePortsEncapsulation. */ -public final class ExpressRoutePortsEncapsulation extends ExpandableStringEnum { - /** Static value Dot1Q for ExpressRoutePortsEncapsulation. */ - public static final ExpressRoutePortsEncapsulation DOT1Q = fromString("Dot1Q"); - - /** Static value QinQ for ExpressRoutePortsEncapsulation. */ - public static final ExpressRoutePortsEncapsulation QINQ = fromString("QinQ"); - - /** - * Creates or finds a ExpressRoutePortsEncapsulation from its string representation. - * - * @param name a name to look for. - * @return the corresponding ExpressRoutePortsEncapsulation. - */ - @JsonCreator - public static ExpressRoutePortsEncapsulation fromString(String name) { - return fromString(name, ExpressRoutePortsEncapsulation.class); - } - - /** @return known ExpressRoutePortsEncapsulation values. */ - public static Collection values() { - return values(ExpressRoutePortsEncapsulation.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRoutePortsLocationBandwidths.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRoutePortsLocationBandwidths.java deleted file mode 100644 index 27484b45f8fd..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRoutePortsLocationBandwidths.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** ExpressRoutePorts Location Bandwidths Real-time inventory of available ExpressRoute port bandwidths. */ -@Immutable -public final class ExpressRoutePortsLocationBandwidths { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRoutePortsLocationBandwidths.class); - - /* - * Bandwidth descriptive name - */ - @JsonProperty(value = "offerName", access = JsonProperty.Access.WRITE_ONLY) - private String offerName; - - /* - * Bandwidth value in Gbps - */ - @JsonProperty(value = "valueInGbps", access = JsonProperty.Access.WRITE_ONLY) - private Integer valueInGbps; - - /** - * Get the offerName property: Bandwidth descriptive name. - * - * @return the offerName value. - */ - public String offerName() { - return this.offerName; - } - - /** - * Get the valueInGbps property: Bandwidth value in Gbps. - * - * @return the valueInGbps value. - */ - public Integer valueInGbps() { - return this.valueInGbps; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRoutePortsLocationListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRoutePortsLocationListResult.java deleted file mode 100644 index e4e9d7c69132..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRoutePortsLocationListResult.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.ExpressRoutePortsLocationInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** ExpressRoutePorts Location List Result Response for ListExpressRoutePortsLocations API service call. */ -@Fluent -public final class ExpressRoutePortsLocationListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRoutePortsLocationListResult.class); - - /* - * The list of all ExpressRoutePort peering locations. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to get the next set of results. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: The list of all ExpressRoutePort peering locations. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The list of all ExpressRoutePort peering locations. - * - * @param value the value value to set. - * @return the ExpressRoutePortsLocationListResult object itself. - */ - public ExpressRoutePortsLocationListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to get the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The URL to get the next set of results. - * - * @param nextLink the nextLink value to set. - * @return the ExpressRoutePortsLocationListResult object itself. - */ - public ExpressRoutePortsLocationListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteServiceProviderBandwidthsOffered.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteServiceProviderBandwidthsOffered.java deleted file mode 100644 index 81b818486292..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteServiceProviderBandwidthsOffered.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Contains bandwidths offered in ExpressRouteServiceProvider resources. */ -@Fluent -public final class ExpressRouteServiceProviderBandwidthsOffered { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(ExpressRouteServiceProviderBandwidthsOffered.class); - - /* - * The OfferName. - */ - @JsonProperty(value = "offerName") - private String offerName; - - /* - * The ValueInMbps. - */ - @JsonProperty(value = "valueInMbps") - private Integer valueInMbps; - - /** - * Get the offerName property: The OfferName. - * - * @return the offerName value. - */ - public String offerName() { - return this.offerName; - } - - /** - * Set the offerName property: The OfferName. - * - * @param offerName the offerName value to set. - * @return the ExpressRouteServiceProviderBandwidthsOffered object itself. - */ - public ExpressRouteServiceProviderBandwidthsOffered withOfferName(String offerName) { - this.offerName = offerName; - return this; - } - - /** - * Get the valueInMbps property: The ValueInMbps. - * - * @return the valueInMbps value. - */ - public Integer valueInMbps() { - return this.valueInMbps; - } - - /** - * Set the valueInMbps property: The ValueInMbps. - * - * @param valueInMbps the valueInMbps value to set. - * @return the ExpressRouteServiceProviderBandwidthsOffered object itself. - */ - public ExpressRouteServiceProviderBandwidthsOffered withValueInMbps(Integer valueInMbps) { - this.valueInMbps = valueInMbps; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteServiceProviderListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteServiceProviderListResult.java deleted file mode 100644 index 8a5567adfb83..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ExpressRouteServiceProviderListResult.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.ExpressRouteServiceProviderInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Response for the ListExpressRouteServiceProvider API service call. */ -@Fluent -public final class ExpressRouteServiceProviderListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteServiceProviderListResult.class); - - /* - * A list of ExpressRouteResourceProvider resources. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to get the next set of results. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: A list of ExpressRouteResourceProvider resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: A list of ExpressRouteResourceProvider resources. - * - * @param value the value value to set. - * @return the ExpressRouteServiceProviderListResult object itself. - */ - public ExpressRouteServiceProviderListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to get the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The URL to get the next set of results. - * - * @param nextLink the nextLink value to set. - * @return the ExpressRouteServiceProviderListResult object itself. - */ - public ExpressRouteServiceProviderListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/FlowLogFormatParameters.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/FlowLogFormatParameters.java deleted file mode 100644 index b56a3b7fdc8c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/FlowLogFormatParameters.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Parameters that define the flow log format. */ -@Fluent -public final class FlowLogFormatParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(FlowLogFormatParameters.class); - - /* - * The file type of flow log. - */ - @JsonProperty(value = "type") - private FlowLogFormatType type; - - /* - * The version (revision) of the flow log. - */ - @JsonProperty(value = "version") - private Integer version; - - /** - * Get the type property: The file type of flow log. - * - * @return the type value. - */ - public FlowLogFormatType type() { - return this.type; - } - - /** - * Set the type property: The file type of flow log. - * - * @param type the type value to set. - * @return the FlowLogFormatParameters object itself. - */ - public FlowLogFormatParameters withType(FlowLogFormatType type) { - this.type = type; - return this; - } - - /** - * Get the version property: The version (revision) of the flow log. - * - * @return the version value. - */ - public Integer version() { - return this.version; - } - - /** - * Set the version property: The version (revision) of the flow log. - * - * @param version the version value to set. - * @return the FlowLogFormatParameters object itself. - */ - public FlowLogFormatParameters withVersion(Integer version) { - this.version = version; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/FlowLogFormatType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/FlowLogFormatType.java deleted file mode 100644 index fddce7ca6e0d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/FlowLogFormatType.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for FlowLogFormatType. */ -public final class FlowLogFormatType extends ExpandableStringEnum { - /** Static value JSON for FlowLogFormatType. */ - public static final FlowLogFormatType JSON = fromString("JSON"); - - /** - * Creates or finds a FlowLogFormatType from its string representation. - * - * @param name a name to look for. - * @return the corresponding FlowLogFormatType. - */ - @JsonCreator - public static FlowLogFormatType fromString(String name) { - return fromString(name, FlowLogFormatType.class); - } - - /** @return known FlowLogFormatType values. */ - public static Collection values() { - return values(FlowLogFormatType.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/FlowLogSettings.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/FlowLogSettings.java deleted file mode 100644 index 8e00e2135275..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/FlowLogSettings.java +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.network.fluent.models.FlowLogInformationInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasParent; -import com.azure.resourcemanager.resources.fluentcore.model.Appliable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; -import com.azure.resourcemanager.resources.fluentcore.model.Updatable; - -/** - * Client-side representation of the configuration of flow log, associated with network watcher and an Azure resource. - */ -@Fluent -public interface FlowLogSettings - extends HasParent, - HasInnerModel, - Updatable, - Refreshable { - /** - * Get the ID of the resource to configure for flow logging. - * - * @return the targetResourceId value - */ - String targetResourceId(); - - /** @return the id of the storage account used to store the flow log */ - String storageId(); - - /** @return true if logging is enabled, false otherwise */ - boolean enabled(); - - /** @return true if retention policy enabled, false otherwise */ - boolean isRetentionEnabled(); - - /** @return the number of days to retain flow log records */ - int retentionDays(); - - /** @return network security group id these flow log settings apply to */ - String networkSecurityGroupId(); - - /** Grouping of flow log information update stages. */ - interface UpdateStages { - /** The stage of the flow log information update allowing to set enable/disable property. */ - interface WithEnabled { - /** - * Enable flow logging. - * - * @return the next stage of the flow log information update - */ - Update withLogging(); - - /** - * Disable flow logging. - * - * @return the next stage of the flow log information update - */ - Update withoutLogging(); - } - - /** The stage of the flow log information update allowing to specify storage account. */ - interface WithStorageAccount { - /** - * Specifies the storage account to use for storing log. - * - * @param storageId id of the storage account - * @return the next stage of the flow log information update - */ - Update withStorageAccount(String storageId); - } - - /** The stage of the flow log information update allowing to configure retention policy. */ - interface WithRetentionPolicy { - /** - * Enable retention policy. - * - * @return the next stage of the flow log information update - */ - Update withRetentionPolicyEnabled(); - - /** - * Disable retention policy. - * - * @return the next stage of the flow log information update - */ - Update withRetentionPolicyDisabled(); - - /** - * Set the number of days to store flow log. - * - * @param days the number of days - * @return the next stage of the flow log information update - */ - Update withRetentionPolicyDays(int days); - } - } - - /** - * The template for a flow log information update operation, containing all the settings that can be modified. - * - *

    Call {@link Update#apply()} to apply the changes to the resource in Azure. - */ - interface Update - extends Appliable, - UpdateStages.WithEnabled, - UpdateStages.WithStorageAccount, - UpdateStages.WithRetentionPolicy { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/FlowLogStatusParameters.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/FlowLogStatusParameters.java deleted file mode 100644 index 3b6de029df2c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/FlowLogStatusParameters.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Parameters that define a resource to query flow log and traffic analytics (optional) status. */ -@Fluent -public final class FlowLogStatusParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(FlowLogStatusParameters.class); - - /* - * The target resource where getting the flow log and traffic analytics - * (optional) status. - */ - @JsonProperty(value = "targetResourceId", required = true) - private String targetResourceId; - - /** - * Get the targetResourceId property: The target resource where getting the flow log and traffic analytics - * (optional) status. - * - * @return the targetResourceId value. - */ - public String targetResourceId() { - return this.targetResourceId; - } - - /** - * Set the targetResourceId property: The target resource where getting the flow log and traffic analytics - * (optional) status. - * - * @param targetResourceId the targetResourceId value to set. - * @return the FlowLogStatusParameters object itself. - */ - public FlowLogStatusParameters withTargetResourceId(String targetResourceId) { - this.targetResourceId = targetResourceId; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (targetResourceId() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property targetResourceId in model FlowLogStatusParameters")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/GatewayRoute.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/GatewayRoute.java deleted file mode 100644 index 6657e43dbfe6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/GatewayRoute.java +++ /dev/null @@ -1,129 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Gateway routing details. */ -@Immutable -public final class GatewayRoute { - @JsonIgnore private final ClientLogger logger = new ClientLogger(GatewayRoute.class); - - /* - * The gateway's local address - */ - @JsonProperty(value = "localAddress", access = JsonProperty.Access.WRITE_ONLY) - private String localAddress; - - /* - * The route's network prefix - */ - @JsonProperty(value = "network", access = JsonProperty.Access.WRITE_ONLY) - private String network; - - /* - * The route's next hop - */ - @JsonProperty(value = "nextHop", access = JsonProperty.Access.WRITE_ONLY) - private String nextHop; - - /* - * The peer this route was learned from - */ - @JsonProperty(value = "sourcePeer", access = JsonProperty.Access.WRITE_ONLY) - private String sourcePeer; - - /* - * The source this route was learned from - */ - @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) - private String origin; - - /* - * The route's AS path sequence - */ - @JsonProperty(value = "asPath", access = JsonProperty.Access.WRITE_ONLY) - private String asPath; - - /* - * The route's weight - */ - @JsonProperty(value = "weight", access = JsonProperty.Access.WRITE_ONLY) - private Integer weight; - - /** - * Get the localAddress property: The gateway's local address. - * - * @return the localAddress value. - */ - public String localAddress() { - return this.localAddress; - } - - /** - * Get the network property: The route's network prefix. - * - * @return the network value. - */ - public String network() { - return this.network; - } - - /** - * Get the nextHop property: The route's next hop. - * - * @return the nextHop value. - */ - public String nextHop() { - return this.nextHop; - } - - /** - * Get the sourcePeer property: The peer this route was learned from. - * - * @return the sourcePeer value. - */ - public String sourcePeer() { - return this.sourcePeer; - } - - /** - * Get the origin property: The source this route was learned from. - * - * @return the origin value. - */ - public String origin() { - return this.origin; - } - - /** - * Get the asPath property: The route's AS path sequence. - * - * @return the asPath value. - */ - public String asPath() { - return this.asPath; - } - - /** - * Get the weight property: The route's weight. - * - * @return the weight value. - */ - public Integer weight() { - return this.weight; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/GetVpnSitesConfigurationRequest.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/GetVpnSitesConfigurationRequest.java deleted file mode 100644 index 2e6d677ffe1c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/GetVpnSitesConfigurationRequest.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** List of Vpn-Sites. */ -@Fluent -public final class GetVpnSitesConfigurationRequest { - @JsonIgnore private final ClientLogger logger = new ClientLogger(GetVpnSitesConfigurationRequest.class); - - /* - * List of resource-ids of the vpn-sites for which config is to be - * downloaded. - */ - @JsonProperty(value = "vpnSites") - private List vpnSites; - - /* - * The sas-url to download the configurations for vpn-sites - */ - @JsonProperty(value = "outputBlobSasUrl") - private String outputBlobSasUrl; - - /** - * Get the vpnSites property: List of resource-ids of the vpn-sites for which config is to be downloaded. - * - * @return the vpnSites value. - */ - public List vpnSites() { - return this.vpnSites; - } - - /** - * Set the vpnSites property: List of resource-ids of the vpn-sites for which config is to be downloaded. - * - * @param vpnSites the vpnSites value to set. - * @return the GetVpnSitesConfigurationRequest object itself. - */ - public GetVpnSitesConfigurationRequest withVpnSites(List vpnSites) { - this.vpnSites = vpnSites; - return this; - } - - /** - * Get the outputBlobSasUrl property: The sas-url to download the configurations for vpn-sites. - * - * @return the outputBlobSasUrl value. - */ - public String outputBlobSasUrl() { - return this.outputBlobSasUrl; - } - - /** - * Set the outputBlobSasUrl property: The sas-url to download the configurations for vpn-sites. - * - * @param outputBlobSasUrl the outputBlobSasUrl value to set. - * @return the GetVpnSitesConfigurationRequest object itself. - */ - public GetVpnSitesConfigurationRequest withOutputBlobSasUrl(String outputBlobSasUrl) { - this.outputBlobSasUrl = outputBlobSasUrl; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/HasAssociatedSubnets.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/HasAssociatedSubnets.java deleted file mode 100644 index cccb2c98757d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/HasAssociatedSubnets.java +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; - -import java.util.List; - -/** An interface representing a model's ability to reference a list of associated subnets. */ -@Fluent() -public interface HasAssociatedSubnets { - /** @return list of subnets associated with this resource */ - List listAssociatedSubnets(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/HasBackendNics.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/HasBackendNics.java deleted file mode 100644 index 3f9f2b395c55..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/HasBackendNics.java +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import java.util.Map; - -/** An interface representing a backend's ability to reference a list of associated network interfaces. */ -@Fluent() -public interface HasBackendNics { - /** - * @return a map of names of the IP configurations of network interfaces assigned to this backend, indexed by their - * NIC's resource id - */ - Map backendNicIPConfigurationNames(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/HasBackendPort.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/HasBackendPort.java deleted file mode 100644 index 8a4453fd2234..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/HasBackendPort.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; - -/** An interface representing a model's ability to reference a backend port. */ -@Fluent -public interface HasBackendPort { - /** @return the backend port number the network traffic is sent to */ - int backendPort(); - - /** Grouping of definition stages involving specifying a backend port. */ - interface DefinitionStages { - /** - * The stage of a definition allowing to specify the backend port. - * - * @param the next stage of the definition - */ - interface WithBackendPort { - /** - * Specifies a backend port to send network traffic to. - * - *

    If not specified, the same backend port number is assumed as that used by the frontend. - * - * @param port a port number - * @return the next stage of the definition - */ - ReturnT toBackendPort(int port); - } - } - - /** Grouping of update stages involving modifying a backend port. */ - interface UpdateStages { - /** - * The stage of an update allowing to modify the backend port. - * - * @param the next stage of the update - */ - interface WithBackendPort { - /** - * Specifies a backend port to send network traffic to. - * - * @param port a port number - * @return the next stage of the update - */ - ReturnT toBackendPort(int port); - } - } - - /** Grouping of definition stages applicable as part of a resource update, involving modifying the backend port. */ - interface UpdateDefinitionStages { - /** - * The stage of a definition allowing to specify the backend port. - * - * @param the next stage of the definition - */ - interface WithBackendPort { - /** - * Specifies a backend port to send network traffic to. - * - *

    If not specified, the same backend port number is assumed as that used by the frontend. - * - * @param port a port number - * @return the next stage of the definition - */ - ReturnT toBackendPort(int port); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/HasCookieBasedAffinity.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/HasCookieBasedAffinity.java deleted file mode 100644 index e6e227c50333..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/HasCookieBasedAffinity.java +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; - -/** An interface representing a model's ability to support cookie based affinity. */ -@Fluent -public interface HasCookieBasedAffinity { - /** @return the backend port number the network traffic is sent to */ - boolean cookieBasedAffinity(); - - /** Grouping of definition stages involving enabling cookie based affinity. */ - interface DefinitionStages { - /** - * The stage of a definition allowing to enable cookie based affinity. - * - * @param the next stage of the definition - */ - interface WithCookieBasedAffinity { - /** - * Enables cookie based affinity. - * - * @return the next stage of the definition - */ - ReturnT withCookieBasedAffinity(); - - /** - * Disables cookie based affinity. - * - * @return the next stage of the definition - */ - ReturnT withoutCookieBasedAffinity(); - } - } - - /** Grouping of update stages involving modifying cookie based affinity. */ - interface UpdateStages { - /** - * The stage of an update allowing to modify cookie based affinity. - * - * @param the next stage of the update - */ - interface WithCookieBasedAffinity { - /** - * Enables cookie based affinity. - * - * @return the next stage of the update - */ - ReturnT withCookieBasedAffinity(); - - /** - * Disables cookie based affinity. - * - * @return the next stage of the update - */ - ReturnT withoutCookieBasedAffinity(); - } - } - - /** - * Grouping of definition stages applicable as part of a resource update, involving modifying cookie based affinity. - */ - interface UpdateDefinitionStages { - /** - * The stage of a definition allowing to enable or disable cookie based affinity. - * - * @param the next stage of the definition - */ - interface WithCookieBasedAffinity { - /** - * Enables cookie based affinity. - * - * @return the next stage of the update - */ - ReturnT withCookieBasedAffinity(); - - /** - * Disables cookie based affinity. - * - * @return the next stage of the update - */ - ReturnT withoutCookieBasedAffinity(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/HasFloatingIP.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/HasFloatingIP.java deleted file mode 100644 index a88638dc1339..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/HasFloatingIP.java +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -/** An interface representing a model's ability to have floating IP support. */ -public interface HasFloatingIP { - /** @return the state of the floating IP enablement */ - boolean floatingIPEnabled(); - - /** Grouping of definition stages involving enabling or disabling floating IP support. */ - interface DefinitionStages { - /** - * The stage of a definition allowing to control floating IP support. - * - * @param the next stage of the definition - */ - interface WithFloatingIP { - /** - * Enables floating IP support. - * - * @return the next stage of the definition - */ - ReturnT withFloatingIPEnabled(); - - /** - * Disables floating IP support. - * - * @return the next stage of the definition - */ - ReturnT withFloatingIPDisabled(); - - /** - * Sets the floating IP enablement. - * - * @param enabled true if floating IP should be enabled - * @return the next stage of the definition - */ - ReturnT withFloatingIP(boolean enabled); - } - } - - /** Grouping of update stages involving enabling or disabling floating IP support. */ - interface UpdateStages { - /** - * The stage of an update allowing to control floating IP support. - * - * @param the next stage of the definition - */ - interface WithFloatingIP { - /** - * Enables floating IP support. - * - * @return the next stage of the definition - */ - ReturnT withFloatingIPEnabled(); - - /** - * Disables floating IP support. - * - * @return the next stage of the definition - */ - ReturnT withFloatingIPDisabled(); - - /** - * Sets the floating IP enablement. - * - * @param enabled true if floating IP should be enabled - * @return the next stage of the definition - */ - ReturnT withFloatingIP(boolean enabled); - } - } - - /** - * Grouping of definition stages applicable as part of a load balancer update, involving enabling or disabling - * floating IP support. - */ - interface UpdateDefinitionStages { - /** - * The stage of a definition allowing to control floating IP support. - * - * @param the next stage of the definition - */ - interface WithFloatingIP { - /** - * Enables floating IP support. - * - * @return the next stage of the definition - */ - ReturnT withFloatingIPEnabled(); - - /** - * Disables floating IP support. - * - * @return the next stage of the definition - */ - ReturnT withFloatingIPDisabled(); - - /** - * Sets the floating IP enablement. - * - * @param enabled true if floating IP should be enabled - * @return the next stage of the definition - */ - ReturnT withFloatingIP(boolean enabled); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/HasFrontend.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/HasFrontend.java deleted file mode 100644 index 2abf8b992fea..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/HasFrontend.java +++ /dev/null @@ -1,227 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; - -/** An interface representing a model's ability to references a frontend. */ -@Fluent -public interface HasFrontend { - /** @return the associated frontend */ - LoadBalancerFrontend frontend(); - - /** Grouping of definition stages involving specifying the frontend. */ - interface DefinitionStages { - /** - * The stage of a definition allowing to specify a load balancer frontend. - * - * @param the next stage of the definition - */ - interface WithFrontend { - /** - * Specifies the frontend to receive network traffic from. - * - * @param frontendName an existing frontend name on this load balancer - * @return the next stage of the definition - */ - ReturnT fromFrontend(String frontendName); - - /** - * Specifies that network traffic should be received on a new public IP address that is to be created along - * with the load balancer in the same region and resource group but under the provided leaf DNS label, - * assuming it is available. - * - *

    A new automatically-named public frontend will be implicitly created on this load balancer for each - * such new public IP address, so make sure to use a unique DNS label. - * - * @param leafDnsLabel a unique leaf DNS label to create the public IP address under - * @return the next stage of the definition - */ - ReturnT fromNewPublicIPAddress(String leafDnsLabel); - - /** - * Specifies that network traffic should be received on a new public IP address that is to be created along - * with the load balancer based on the provided definition. - * - *

    A new automatically-named public frontend will be implicitly created on this load balancer for each - * such new public IP address. - * - * @param pipDefinition a definition for the new public IP - * @return the next stage of the definition - */ - ReturnT fromNewPublicIPAddress(Creatable pipDefinition); - - /** - * Specifies that network traffic should be received on a new public IP address that is to be automatically - * created woth default settings along with the load balancer. - * - *

    A new automatically-named public frontend will be implicitly created on this load balancer for each - * such new public IP address. - * - * @return the next stage of the definition - */ - ReturnT fromNewPublicIPAddress(); - - /** - * Specifies an existing public IP address to receive network traffic from. - * - *

    If this load balancer already has a frontend referencing this public IP address, that is the frontend - * that will be used. Else, an automatically named new public frontend will be created implicitly on the - * load balancer. - * - * @param publicIPAddress an existing public IP address - * @return the next stage of the definition - */ - ReturnT fromExistingPublicIPAddress(PublicIpAddress publicIPAddress); - - /** - * Specifies an existing public IP address to receive network traffic from. - * - *

    If this load balancer already has a frontend referencing this public IP address, that is the frontend - * that will be used. Else, an automatically named new public frontend will be created implicitly on the - * load balancer. - * - * @param resourceId the resource ID of an existing public IP address - * @return the next stage of the definition - */ - ReturnT fromExistingPublicIPAddress(String resourceId); - - /** - * Specifies an existing private subnet to receive network traffic from. - * - *

    If this load balancer already has a frontend referencing this subnet, that is the frontend that will - * be used. Else, an automatically named new private frontend will be created implicitly on the load - * balancer. - * - * @param network an existing network - * @param subnetName the name of an existing subnet within the specified network - * @return the next stage of the definition - */ - ReturnT fromExistingSubnet(Network network, String subnetName); - - /** - * Specifies an existing private subnet to receive network traffic from. - * - *

    If this load balancer already has a frontend referencing this subnet, that is the frontend that will - * be used. Else, an automatically named new private frontend will be created implicitly on the load - * balancer. - * - * @param networkResourceId the resource ID of an existing network - * @param subnetName the name of an existing subnet within the specified network - * @return the next stage of the definition - */ - ReturnT fromExistingSubnet(String networkResourceId, String subnetName); - - /** - * Specifies an existing private subnet to receive network traffic from. - * - *

    If this load balancer already has a frontend referencing this subnet, that is the frontend that will - * be used. Else, an automatically named new private frontend will be created implicitly on the load - * balancer. - * - * @param subnet an existing subnet - * @return the next stage of the definition - */ - ReturnT fromExistingSubnet(Subnet subnet); - } - } - - /** Grouping of update stages involving specifying the frontend. */ - interface UpdateStages { - /** - * The stage of an update allowing to specify a frontend. - * - * @param the next stage of the update - */ - interface WithFrontend { - /** - * Specifies the frontend. - * - * @param frontendName an existing frontend name from this load balancer - * @return the next stage of the update - */ - ReturnT fromFrontend(String frontendName); - } - } - - /** Grouping of definition stages applicable as part of a resource update involving modifying the frontend. */ - interface UpdateDefinitionStages { - /** - * The stage of a definition allowing to specify a frontend from to associate. - * - * @param the next stage of the definition - */ - interface WithFrontend { - /** - * Specifies the frontend to associate. - * - * @param frontendName an existing frontend name - * @return the next stage of the definition - */ - ReturnT fromFrontend(String frontendName); - - /** - * Specifies an existing public IP address to receive network traffic from. - * - *

    If this load balancer already has a frontend referencing this public IP address, that is the frontend - * that will be used. Else, an automatically named new public frontend will be created implicitly on the - * load balancer. - * - * @param publicIPAddress an existing public IP address - * @return the next stage of the definition - */ - ReturnT fromExistingPublicIPAddress(PublicIpAddress publicIPAddress); - - /** - * Specifies an existing public IP address to receive network traffic from. - * - *

    If this load balancer already has a frontend referencing this public IP address, that is the frontend - * that will be used. Else, an automatically named new public frontend will be created implicitly on the - * load balancer. - * - * @param resourceId the resource ID of an existing public IP address - * @return the next stage of the definition - */ - ReturnT fromExistingPublicIPAddress(String resourceId); - - /** - * Specifies an existing private subnet to receive network traffic from. - * - *

    If this load balancer already has a frontend referencing this subnet, that is the frontend that will - * be used. Else, an automatically named new private frontend will be created implicitly on the load - * balancer. - * - * @param network an existing network - * @param subnetName the name of an existing subnet within the specified network - * @return the next stage of the definition - */ - ReturnT fromExistingSubnet(Network network, String subnetName); - - /** - * Specifies an existing private subnet to receive network traffic from. - * - *

    If this load balancer already has a frontend referencing this subnet, that is the frontend that will - * be used. Else, an automatically named new private frontend will be created implicitly on the load - * balancer. - * - * @param networkResourceId the resource ID of an existing network - * @param subnetName the name of an existing subnet within the specified network - * @return the next stage of the definition - */ - ReturnT fromExistingSubnet(String networkResourceId, String subnetName); - - /** - * Specifies an existing private subnet to receive network traffic from. - * - *

    If this load balancer already has a frontend referencing this subnet, that is the frontend that will - * be used. Else, an automatically named new private frontend will be created implicitly on the load - * balancer. - * - * @param subnet an existing subnet - * @return the next stage of the definition - */ - ReturnT fromExistingSubnet(Subnet subnet); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/HasFrontendPort.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/HasFrontendPort.java deleted file mode 100644 index 4f54ff25dca0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/HasFrontendPort.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; - -/** An interface representing a model's ability to reference a frontend port. */ -@Fluent -public interface HasFrontendPort { - /** @return the frontend port number the inbound network traffic is received on */ - int frontendPort(); - - /** Grouping of definition stages involving specifying a frontend port. */ - interface DefinitionStages { - /** - * The stage of a definition allowing to specify the frontend port. - * - * @param the next stage of the definition - */ - interface WithFrontendPort { - /** - * Specifies the frontend port to receive network traffic on. - * - * @param port a port number - * @return the next stage of the definition - */ - ReturnT fromFrontendPort(int port); - } - } - - /** Grouping of update stages involving modifying a frontend port. */ - interface UpdateStages { - /** - * The stage of an update allowing to specify the frontend port. - * - * @param the next stage of the update - */ - interface WithFrontendPort { - /** - * Specifies the frontend port to receive network traffic on. - * - * @param port a port number - * @return the next stage of the definition - */ - ReturnT fromFrontendPort(int port); - } - } - - /** Grouping of definition stages applicable as part of a resource update, involving modifying the frontend port. */ - interface UpdateDefinitionStages { - /** - * The stage of a definition allowing to specify the frontend port. - * - * @param the next stage of the definition - */ - interface WithFrontendPort { - /** - * Specifies the frontend port to receive network traffic on. - * - * @param port a port number - * @return the next stage of the definition - */ - ReturnT fromFrontendPort(int port); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/HasHostname.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/HasHostname.java deleted file mode 100644 index 742f5d433c2b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/HasHostname.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; - -/** An interface representing a model's ability to reference a host name. */ -@Fluent -public interface HasHostname { - /** @return the associated host name */ - String hostname(); - - /** Grouping of definition stages involving specifying the host name. */ - interface DefinitionStages { - /** - * The stage of a definition allowing to specify a host name. - * - * @param the next stage of the definition - */ - interface WithHostname { - /** - * Specifies the hostname to reference. - * - * @param hostname an existing frontend name on this load balancer - * @return the next stage of the definition - */ - ReturnT withHostname(String hostname); - } - } - - /** Grouping of update stages involving specifying the host name. */ - interface UpdateStages { - /** - * The stage of an update allowing to specify a host name. - * - * @param the next stage of the update - */ - interface WithHostname { - /** - * Specifies the host name. - * - * @param hostname an existing host name - * @return the next stage of the update - */ - ReturnT withHostname(String hostname); - } - } - - /** Grouping of definition stages applicable as part of a parent resource update. */ - interface UpdateDefinitionStages { - /** - * The stage of a definition allowing to specify a host name. - * - * @param the next stage of the definition - */ - interface WithHostname { - /** - * Specifies the host name to reference. - * - * @param hostname an existing host name - * @return the next stage of the definition - */ - ReturnT withHostname(String hostname); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/HasLoadBalancingRules.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/HasLoadBalancingRules.java deleted file mode 100644 index 405425c359f3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/HasLoadBalancingRules.java +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; - -import java.util.Map; - -/** An interface representing a model's ability to reference load balancing rules. */ -@Fluent() -public interface HasLoadBalancingRules { - /** @return the associated load balancing rules from this load balancer, indexed by their names */ - Map loadBalancingRules(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/HasNetworkInterfaces.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/HasNetworkInterfaces.java deleted file mode 100644 index c3faaed43187..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/HasNetworkInterfaces.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasId; -import reactor.core.publisher.Mono; - -import java.util.List; - -/** Interface exposing a list of network interfaces. */ -public interface HasNetworkInterfaces extends HasId { - /** - * Gets the primary network interface. - * - *

    Note that this method can result in a call to the cloud to fetch the network interface information. - * - * @return the primary network interface associated with this resource - */ - NetworkInterface getPrimaryNetworkInterface(); - - /** - * Gets the primary network interface. - * - *

    Note that this method can result in a call to the cloud to fetch the network interface information. - * - * @return the primary network interface associated with this resource - */ - Mono getPrimaryNetworkInterfaceAsync(); - - /** @return the resource id of the primary network interface associated with this resource */ - String primaryNetworkInterfaceId(); - - /** @return the list of resource IDs of the network interfaces associated with this resource */ - List networkInterfaceIds(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/HasPort.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/HasPort.java deleted file mode 100644 index 04c34f89c20d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/HasPort.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; - -/** An interface representing a model's ability to have a port number. */ -@Fluent -public interface HasPort { - /** @return the port number */ - int port(); - - /** Grouping of definition stages involving specifying a port number. */ - interface DefinitionStages { - /** - * The stage of a definition allowing to specify the port number. - * - * @param the next stage of the definition - */ - interface WithPort { - /** - * Specifies the port number. - * - * @param portNumber a port number - * @return the next stage of the definition - */ - ReturnT withPort(int portNumber); - } - } - - /** Grouping of update stages involving specifying the port number. */ - interface UpdateStages { - /** - * The stage of a definition allowing to specify a port number. - * - * @param the next stage of the update - */ - interface WithPort { - /** - * Specifies the port number. - * - * @param portNumber a port number - * @return the next stage of the update - */ - ReturnT withPort(int portNumber); - } - } - - /** Grouping of definition stages of a parent resource update involving specifying a port number. */ - interface UpdateDefinitionStages { - /** - * The stage of a definition allowing to specify the port number. - * - * @param the next stage of the definition - */ - interface WithPort { - /** - * Specifies the port number. - * - * @param portNumber a port number - * @return the next stage of the definition - */ - ReturnT withPort(int portNumber); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/HasPrivateIpAddress.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/HasPrivateIpAddress.java deleted file mode 100644 index 98cfad493811..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/HasPrivateIpAddress.java +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; - -/** An interface representing a model's ability to reference a private IP address. */ -@Fluent -public interface HasPrivateIpAddress { - /** @return the private IP address associated with this resource */ - String privateIpAddress(); - - /** @return the private IP address allocation method within the associated subnet */ - IpAllocationMethod privateIpAllocationMethod(); - - /** Grouping of definition stages involving specifying the private IP address. */ - interface DefinitionStages { - /** - * The stage of a definition allowing to specify the private IP address. - * - * @param the next stage of the definition - */ - interface WithPrivateIPAddress { - /** - * Enables dynamic private IP address allocation within the associated subnet. - * - * @return the next stage of the definition - */ - ReturnT withPrivateIpAddressDynamic(); - - /** - * Assigns the specified static private IP address within the associated subnet. - * - * @param ipAddress a static IP address within the associated private IP range - * @return the next stage of the definition - */ - ReturnT withPrivateIpAddressStatic(String ipAddress); - } - } - - /** Grouping of update stages involving modifying the private IP address. */ - interface UpdateStages { - /** - * The stage of an update allowing to modify the private IP address. - * - * @param the next stage of the update - */ - interface WithPrivateIPAddress { - /** - * Enables dynamic private IP address allocation within the associated subnet. - * - * @return the next stage of the update - */ - ReturnT withPrivateIpAddressDynamic(); - - /** - * Assigns the specified static private IP address within the associated subnet. - * - * @param ipAddress a static IP address within the associated private IP range - * @return the next stage of the update - */ - ReturnT withPrivateIpAddressStatic(String ipAddress); - } - } - - /** - * Grouping of definition stages applicable as part of a parent resource update, involving specifying the private IP - * address. - */ - interface UpdateDefinitionStages { - /** - * The stage of a definition allowing to specify the private IP address. - * - * @param the next stage of the definition - */ - interface WithPrivateIPAddress { - /** - * Enables dynamic private IP address allocation within the associated subnet. - * - * @return the next stage of the definition - */ - ReturnT withPrivateIpAddressDynamic(); - - /** - * Assigns the specified static private IP address within the associated subnet. - * - * @param ipAddress a static IP address within the associated private IP range - * @return the next stage of the definition - */ - ReturnT withPrivateIpAddressStatic(String ipAddress); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/HasProtocol.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/HasProtocol.java deleted file mode 100644 index 700bc8985d6a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/HasProtocol.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; - -/** - * An interface representing a model's ability to reference a transport protocol. - * - * @param the protocol type of the value - */ -@Fluent() -public interface HasProtocol { - /** @return the protocol */ - ProtocolT protocol(); - - /** Grouping of definition stages involving specifying the protocol. */ - interface DefinitionStages { - /** - * The stage of a definition allowing to specify the protocol. - * - * @param the next stage of the definition - * @param the type of the protocol value - */ - interface WithProtocol { - /** - * Specifies the transport protocol. - * - * @param protocol a transport protocol - * @return the next stage of the definition - */ - ReturnT withProtocol(ProtocolT protocol); - } - } - - /** Grouping of update stages involving modifying the protocol. */ - interface UpdateStages { - /** - * The stage of an update allowing to modify the transport protocol. - * - * @param the next stage of the update - * @param the type of the protocol value - */ - interface WithProtocol { - /** - * Specifies the transport protocol. - * - * @param protocol a transport protocol - * @return the next stage of the update - */ - ReturnT withProtocol(ProtocolT protocol); - } - } - - /** - * Grouping of definition stages applicable as part of a load balancer update, involving specifying the protocol. - */ - interface UpdateDefinitionStages { - /** - * The stage of a definition allowing to specify the protocol. - * - * @param the next stage of the definition - * @param the protocol type of the value - */ - interface WithProtocol { - /** - * Specifies the transport protocol. - * - * @param protocol a transport protocol - * @return the next stage of the definition - */ - ReturnT withProtocol(ProtocolT protocol); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/HasPublicIpAddress.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/HasPublicIpAddress.java deleted file mode 100644 index cf1014f76c09..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/HasPublicIpAddress.java +++ /dev/null @@ -1,292 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import reactor.core.publisher.Mono; - -/** An interface representing a model's ability to reference a public IP address. */ -public interface HasPublicIpAddress { - /** @return the resource ID of the associated public IP address */ - String publicIpAddressId(); - - /** @return the associated public IP address */ - PublicIpAddress getPublicIpAddress(); - - /** @return the associated public IP address */ - Mono getPublicIpAddressAsync(); - - /** Grouping of definition stages involving specifying the public IP address. */ - interface DefinitionStages { - /** - * The stage of the definition allowing to associate the resource with an existing public IP address. - * - * @param the next stage of the definition - */ - interface WithExistingPublicIPAddress { - /** - * Associates an existing public IP address with the resource. - * - * @param publicIPAddress an existing public IP address - * @return the next stage of the definition - */ - ReturnT withExistingPublicIpAddress(PublicIpAddress publicIPAddress); - - /** - * Associates an existing public IP address with the resource. - * - * @param resourceId the resource ID of an existing public IP address - * @return the next stage of the definition - */ - ReturnT withExistingPublicIpAddress(String resourceId); - } - - /** - * The stage of the definition allowing to associate the resource with a new public IP address. - * - * @param the next stage of the definition - */ - interface WithNewPublicIPAddressNoDnsLabel { - /** - * Creates a new public IP address to associate with the resource. - * - * @param creatable a creatable definition for a new public IP - * @return the next stage of the definition - */ - ReturnT withNewPublicIpAddress(Creatable creatable); - - /** - * Creates a new public IP address in the same region and group as the resource and associates it with the - * resource. - * - *

    The internal name and DNS label for the public IP address will be derived from the resource's name. - * - * @return the next stage of the definition - */ - ReturnT withNewPublicIpAddress(); - } - - /** - * The stage of the definition allowing to associate the resource with a new public IP address. - * - * @param the next stage of the definition - */ - interface WithNewPublicIPAddress extends WithNewPublicIPAddressNoDnsLabel { - /** - * Creates a new public IP address in the same region and group as the resource, with the specified DNS - * label and associates it with the resource. - * - *

    The internal name for the public IP address will be derived from the DNS label. - * - * @param leafDnsLabel the leaf domain label - * @return the next stage of the definition - */ - ReturnT withNewPublicIpAddress(String leafDnsLabel); - } - - /** - * The stage of the definition allowing to associate the resource with a public IP address, but not allowing to - * create one with a DNS leaf label. - * - * @param the next stage of the definition - */ - interface WithPublicIPAddressNoDnsLabel - extends WithExistingPublicIPAddress, WithNewPublicIPAddressNoDnsLabel { - } - - /** - * The stage of the definition allowing to associate the resource with a public IP address. - * - * @param the next stage of the definition - */ - interface WithPublicIPAddress - extends WithExistingPublicIPAddress, WithNewPublicIPAddress { - } - } - - /** Grouping of update stages involving modifying an existing reference to a public IP address. */ - interface UpdateStages { - /** - * The stage of the update allowing to associate the resource with an existing public IP address. - * - * @param the next stage of the update - */ - interface WithExistingPublicIPAddress { - /** - * Associates an existing public IP address with the resource. - * - * @param publicIPAddress an existing public IP address - * @return the next stage of the update - */ - ReturnT withExistingPublicIpAddress(PublicIpAddress publicIPAddress); - - /** - * Associates an existing public IP address with the resource. - * - * @param resourceId the resource ID of an existing public IP address - * @return the next stage of the definition - */ - ReturnT withExistingPublicIpAddress(String resourceId); - - /** - * Removes the existing reference to a public IP address. - * - * @return the next stage of the update. - */ - ReturnT withoutPublicIpAddress(); - } - - /** - * The stage of the update allowing to associate the resource with a new public IP address. - * - * @param the next stage of the definition - */ - interface WithNewPublicIPAddressNoDnsLabel { - /** - * Creates a new public IP address to associate with the resource. - * - * @param creatable a creatable definition for a new public IP - * @return the next stage of the definition - */ - ReturnT withNewPublicIpAddress(Creatable creatable); - - /** - * Creates a new public IP address in the same region and group as the resource and associates it with the - * resource. - * - *

    The internal name and DNS label for the public IP address will be derived from the resource's name. - * - * @return the next stage of the definition - */ - ReturnT withNewPublicIpAddress(); - } - - /** - * The stage of the update allowing to associate the resource with a new public IP address. - * - * @param the next stage of the definition - */ - interface WithNewPublicIPAddress extends WithNewPublicIPAddressNoDnsLabel { - /** - * Creates a new public IP address in the same region and group as the resource, with the specified DNS - * label and associates it with the resource. - * - *

    The internal name for the public IP address will be derived from the DNS label. - * - * @param leafDnsLabel the leaf domain label - * @return the next stage of the definition - */ - ReturnT withNewPublicIpAddress(String leafDnsLabel); - } - - /** - * The stage of the update allowing to associate the resource with a public IP address, but not allowing to - * create one with a DNS leaf label. - * - * @param the next stage of the definition - */ - interface WithPublicIPAddressNoDnsLabel - extends WithExistingPublicIPAddress, WithNewPublicIPAddressNoDnsLabel { - } - - /** - * The stage definition allowing to associate the resource with a public IP address. - * - * @param the next stage of the update - */ - interface WithPublicIPAddress - extends WithExistingPublicIPAddress, WithNewPublicIPAddress { - } - } - - /** - * Grouping of definition stages applicable as part of a parent resource update, involving specifying a public IP - * address. - */ - interface UpdateDefinitionStages { - /** - * The stage of the definition allowing to associate the resource with an existing public IP address. - * - * @param the next stage of the definition - */ - interface WithExistingPublicIPAddress { - /** - * Associates an existing public IP address with the resource. - * - * @param publicIPAddress an existing public IP address - * @return the next stage of the definition - */ - ReturnT withExistingPublicIpAddress(PublicIpAddress publicIPAddress); - - /** - * Associates an existing public IP address with the resource. - * - * @param resourceId the resource ID of an existing public IP address - * @return the next stage of the definition - */ - ReturnT withExistingPublicIpAddress(String resourceId); - } - - /** - * The stage of the definition allowing to associate the resource with a new public IP address. - * - * @param the next stage of the definition - */ - interface WithNewPublicIPAddressNoDnsLabel { - /** - * Creates a new public IP address to associate with the resource. - * - * @param creatable a creatable definition for a new public IP - * @return the next stage of the definition - */ - ReturnT withNewPublicIpAddress(Creatable creatable); - - /** - * Creates a new public IP address in the same region and group as the resource and associates it with the - * resource. - * - *

    The internal name and DNS label for the public IP address will be derived from the resource's name. - * - * @return the next stage of the definition - */ - ReturnT withNewPublicIpAddress(); - } - - /** - * The stage of the definition allowing to associate the resource with a public IP address, but not allowing to - * create one with a DNS leaf label. - * - * @param the next stage of the definition - */ - interface WithPublicIPAddressNoDnsLabel - extends WithExistingPublicIPAddress, WithNewPublicIPAddressNoDnsLabel { - } - - /** - * The stage of the definition allowing to associate the resource with a new public IP address. - * - * @param the next stage of the definition - */ - interface WithNewPublicIPAddress extends WithNewPublicIPAddressNoDnsLabel { - /** - * Creates a new public IP address in the same region and group as the resource, with the specified DNS - * label and associates it with the resource. - * - *

    The internal name for the public IP address will be derived from the DNS label. - * - * @param leafDnsLabel the leaf domain label - * @return the next stage of the definition - */ - ReturnT withNewPublicIpAddress(String leafDnsLabel); - } - - /** - * The stage of the definition allowing to associate the resource with a public IP address. - * - * @param the next stage of the definition - */ - interface WithPublicIPAddress - extends WithExistingPublicIPAddress, WithNewPublicIPAddress { - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/HasServerNameIndication.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/HasServerNameIndication.java deleted file mode 100644 index d9d6ba58e0d0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/HasServerNameIndication.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; - -/** An interface representing a model's ability to require server name indication. */ -@Fluent -public interface HasServerNameIndication { - /** @return true if server name indication (SNI) is required, else false. */ - boolean requiresServerNameIndication(); - - /** Grouping of definition stages involving requiring the server name indication. */ - interface DefinitionStages { - /** - * The stage of a definition allowing to require server name indication (SNI). - * - * @param the next stage of the definition - */ - interface WithServerNameIndication { - /** - * Requires server name indication (SNI). - * - * @return the next stage of the definition - */ - ReturnT withServerNameIndication(); - - /** - * Ensures server name indication (SNI) is not required. - * - * @return the next stage of the definition - */ - ReturnT withoutServerNameIndication(); - } - } - - /** Grouping of update stages involving requiring the server name indication. */ - interface UpdateStages { - /** - * The stage of an update allowing to require server name indication (SNI). - * - * @param the next stage of the update - */ - interface WithServerNameIndication { - /** - * Requires server name indication (SNI). - * - * @return the next stage of the update - */ - ReturnT withServerNameIndication(); - - /** - * Ensures server name indication (SNI) is not required. - * - * @return the next stage of the update - */ - ReturnT withoutServerNameIndication(); - } - } - - /** Grouping of definition stages applicable as part of a parent resource update. */ - interface UpdateDefinitionStages { - /** - * The stage of a definition allowing to require server name indication (SNI). - * - * @param the next stage of the definition - */ - interface WithServerNameIndication { - /** - * Requires server name indication (SNI). - * - * @return the next stage of the definition - */ - ReturnT withServerNameIndication(); - - /** - * Ensures server name indication (SNI) is not required. - * - * @return the next stage of the definition - */ - ReturnT withoutServerNameIndication(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/HasSslCertificate.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/HasSslCertificate.java deleted file mode 100644 index 0aaf22c933d3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/HasSslCertificate.java +++ /dev/null @@ -1,190 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import java.io.File; -import java.io.IOException; - -/** - * An interface representing a model's ability to reference an SSL certificate. - * - * @param the SSL certificate type - */ -@Fluent -public interface HasSslCertificate { - /** @return the associated SSL certificate, if any */ - T sslCertificate(); - - /** Grouping of definition stages involving specifying an SSL certificate. */ - interface DefinitionStages { - /** - * The stage of a resource definition allowing to specify the SSL certificate to associate with it. - * - * @param the next stage of the definition - */ - interface WithSslCertificate { - /** - * Specifies an SSL certificate to associate with this resource. - * - *

    If the certificate does not exist yet, it must be defined in the optional part of the parent resource - * definition. - * - * @param name the name of an existing SSL certificate. - * @return the next stage of the definition - */ - ReturnT withSslCertificate(String name); - - /** - * Sepecifies the content of the private key using key vault. - * - * @param keyVaultSecretId the secret id of key vault - * @return the next stage of the definition - */ - ReturnT withSslCertificateFromKeyVaultSecretId(String keyVaultSecretId); - - /** - * Specifies the PFX file to import the SSL certificate from to associated with this resource. - * - *

    The certificate will be named using an auto-generated name. - * - * @param pfxFile an existing PFX file - * @return the next stage of the definition - * @throws IOException when there are issues with the provided file - */ - WithSslPassword withSslCertificateFromPfxFile(File pfxFile) throws IOException; - } - - /** - * The stage of a resource definition allowing to specify the password for the private key of the imported SSL - * certificate. - * - * @param the next stage of the definition - */ - interface WithSslPassword { - /** - * Specifies the password for the specified PFX file containing the private key of the imported SSL - * certificate. - * - * @param password the password of the imported PFX file - * @return the next stage of the definition - */ - ReturnT withSslCertificatePassword(String password); - } - } - - /** Grouping of update stages involving modifying SSL certificates. */ - interface UpdateStages { - /** - * The stage of a resource update allowing to specify the SSL certificate to associate with it. - * - * @param the next stage of the update - */ - interface WithSslCertificate { - /** - * Specifies an SSL certificate to associate with this resource. - * - *

    If the certificate does not exist yet, it must be defined in the parent resource update. - * - * @param name the name of an existing SSL certificate associated with this application gateway - * @return the next stage of the update - */ - ReturnT withSslCertificate(String name); - - /** - * Sepecifies the content of the private key using key vault. - * - * @param keyVaultSecretId the secret id of key vault - * @return the next stage of the update - */ - ReturnT withSslCertificateFromKeyVaultSecretId(String keyVaultSecretId); - - /** - * Specifies the PFX file to import the SSL certificate from to associate with this resource. - * - *

    The certificate will be named using an auto-generated name. - * - * @param pfxFile an existing PFX file - * @return the next stage of the definition - * @throws IOException when there are issues with the provided file - */ - WithSslPassword withSslCertificateFromPfxFile(File pfxFile) throws IOException; - } - - /** - * The stage of a resource update allowing to specify the password for the private key of the imported SSL - * certificate. - * - * @param the next stage of the update - */ - interface WithSslPassword { - /** - * Specifies the password for the specified PFX file containing the private key of the imported SSL - * certificate. - * - * @param password the password of the imported PFX file - * @return the next stage of the definition - */ - ReturnT withSslCertificatePassword(String password); - } - } - - /** - * Grouping of definition stages applicable as part of a resource update, involving modifying the SSL certificates. - */ - interface UpdateDefinitionStages { - /** - * The stage of a resource definition allowing to specify the SSL certificate to associate with it. - * - * @param the next stage of the definition - */ - interface WithSslCertificate { - /** - * Specifies an SSL certificate to associate with this resource. - * - *

    If the certificate does not exist yet, it must be defined in the optional part of the parent resource - * definition. - * - * @param name the name of an existing SSL certificate. - * @return the next stage of the definition - */ - ReturnT withSslCertificate(String name); - - /** - * Sepecifies the content of the private key using key vault. - * - * @param keyVaultSecretId the secret id of key vault - * @return the next stage of the definition - */ - ReturnT withSslCertificateFromKeyVaultSecretId(String keyVaultSecretId); - - /** - * Specifies the PFX file to import the SSL certificate from to associated with this resource. - * - *

    The certificate will be named using an auto-generated name. - * - * @param pfxFile an existing PFX file - * @return the next stage of the definition - * @throws IOException when there are issues with the provided file - */ - WithSslPassword withSslCertificateFromPfxFile(File pfxFile) throws IOException; - } - - /** - * The stage of a resource definition allowing to specify the password for the private key of the imported SSL - * certificate. - * - * @param the next stage of the definition - */ - interface WithSslPassword { - /** - * Specifies the password for the specified PFX file containing the private key of the imported SSL - * certificate. - * - * @param password the password of the imported PFX file - * @return the next stage of the definition - */ - ReturnT withSslCertificatePassword(String password); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/HttpConfiguration.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/HttpConfiguration.java deleted file mode 100644 index baf08ee7b973..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/HttpConfiguration.java +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** HTTP configuration of the connectivity check. */ -@Fluent -public final class HttpConfiguration { - @JsonIgnore private final ClientLogger logger = new ClientLogger(HttpConfiguration.class); - - /* - * HTTP method. - */ - @JsonProperty(value = "method") - private HttpMethod method; - - /* - * List of HTTP headers. - */ - @JsonProperty(value = "headers") - private List headers; - - /* - * Valid status codes. - */ - @JsonProperty(value = "validStatusCodes") - private List validStatusCodes; - - /** - * Get the method property: HTTP method. - * - * @return the method value. - */ - public HttpMethod method() { - return this.method; - } - - /** - * Set the method property: HTTP method. - * - * @param method the method value to set. - * @return the HttpConfiguration object itself. - */ - public HttpConfiguration withMethod(HttpMethod method) { - this.method = method; - return this; - } - - /** - * Get the headers property: List of HTTP headers. - * - * @return the headers value. - */ - public List headers() { - return this.headers; - } - - /** - * Set the headers property: List of HTTP headers. - * - * @param headers the headers value to set. - * @return the HttpConfiguration object itself. - */ - public HttpConfiguration withHeaders(List headers) { - this.headers = headers; - return this; - } - - /** - * Get the validStatusCodes property: Valid status codes. - * - * @return the validStatusCodes value. - */ - public List validStatusCodes() { - return this.validStatusCodes; - } - - /** - * Set the validStatusCodes property: Valid status codes. - * - * @param validStatusCodes the validStatusCodes value to set. - * @return the HttpConfiguration object itself. - */ - public HttpConfiguration withValidStatusCodes(List validStatusCodes) { - this.validStatusCodes = validStatusCodes; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (headers() != null) { - headers().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/HttpHeader.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/HttpHeader.java deleted file mode 100644 index 5a141ff55054..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/HttpHeader.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describes the HTTP header. */ -@Fluent -public final class HttpHeader { - @JsonIgnore private final ClientLogger logger = new ClientLogger(HttpHeader.class); - - /* - * The name in HTTP header. - */ - @JsonProperty(value = "name") - private String name; - - /* - * The value in HTTP header. - */ - @JsonProperty(value = "value") - private String value; - - /** - * Get the name property: The name in HTTP header. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name in HTTP header. - * - * @param name the name value to set. - * @return the HttpHeader object itself. - */ - public HttpHeader withName(String name) { - this.name = name; - return this; - } - - /** - * Get the value property: The value in HTTP header. - * - * @return the value value. - */ - public String value() { - return this.value; - } - - /** - * Set the value property: The value in HTTP header. - * - * @param value the value value to set. - * @return the HttpHeader object itself. - */ - public HttpHeader withValue(String value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/HttpMethod.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/HttpMethod.java deleted file mode 100644 index c4b10a52e74d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/HttpMethod.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for HttpMethod. */ -public final class HttpMethod extends ExpandableStringEnum { - /** Static value Get for HttpMethod. */ - public static final HttpMethod GET = fromString("Get"); - - /** - * Creates or finds a HttpMethod from its string representation. - * - * @param name a name to look for. - * @return the corresponding HttpMethod. - */ - @JsonCreator - public static HttpMethod fromString(String name) { - return fromString(name, HttpMethod.class); - } - - /** @return known HttpMethod values. */ - public static Collection values() { - return values(HttpMethod.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/IkeEncryption.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/IkeEncryption.java deleted file mode 100644 index f6dcc5babf77..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/IkeEncryption.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for IkeEncryption. */ -public final class IkeEncryption extends ExpandableStringEnum { - /** Static value DES for IkeEncryption. */ - public static final IkeEncryption DES = fromString("DES"); - - /** Static value DES3 for IkeEncryption. */ - public static final IkeEncryption DES3 = fromString("DES3"); - - /** Static value AES128 for IkeEncryption. */ - public static final IkeEncryption AES128 = fromString("AES128"); - - /** Static value AES192 for IkeEncryption. */ - public static final IkeEncryption AES192 = fromString("AES192"); - - /** Static value AES256 for IkeEncryption. */ - public static final IkeEncryption AES256 = fromString("AES256"); - - /** Static value GCMAES256 for IkeEncryption. */ - public static final IkeEncryption GCMAES256 = fromString("GCMAES256"); - - /** Static value GCMAES128 for IkeEncryption. */ - public static final IkeEncryption GCMAES128 = fromString("GCMAES128"); - - /** - * Creates or finds a IkeEncryption from its string representation. - * - * @param name a name to look for. - * @return the corresponding IkeEncryption. - */ - @JsonCreator - public static IkeEncryption fromString(String name) { - return fromString(name, IkeEncryption.class); - } - - /** @return known IkeEncryption values. */ - public static Collection values() { - return values(IkeEncryption.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/IkeIntegrity.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/IkeIntegrity.java deleted file mode 100644 index ece75ceab247..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/IkeIntegrity.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for IkeIntegrity. */ -public final class IkeIntegrity extends ExpandableStringEnum { - /** Static value MD5 for IkeIntegrity. */ - public static final IkeIntegrity MD5 = fromString("MD5"); - - /** Static value SHA1 for IkeIntegrity. */ - public static final IkeIntegrity SHA1 = fromString("SHA1"); - - /** Static value SHA256 for IkeIntegrity. */ - public static final IkeIntegrity SHA256 = fromString("SHA256"); - - /** Static value SHA384 for IkeIntegrity. */ - public static final IkeIntegrity SHA384 = fromString("SHA384"); - - /** Static value GCMAES256 for IkeIntegrity. */ - public static final IkeIntegrity GCMAES256 = fromString("GCMAES256"); - - /** Static value GCMAES128 for IkeIntegrity. */ - public static final IkeIntegrity GCMAES128 = fromString("GCMAES128"); - - /** - * Creates or finds a IkeIntegrity from its string representation. - * - * @param name a name to look for. - * @return the corresponding IkeIntegrity. - */ - @JsonCreator - public static IkeIntegrity fromString(String name) { - return fromString(name, IkeIntegrity.class); - } - - /** @return known IkeIntegrity values. */ - public static Collection values() { - return values(IkeIntegrity.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/InboundNatPool.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/InboundNatPool.java deleted file mode 100644 index f4008231a425..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/InboundNatPool.java +++ /dev/null @@ -1,329 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.InboundNatPoolPropertiesFormat; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Inbound NAT pool of the load balancer. */ -@Fluent -public final class InboundNatPool extends SubResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(InboundNatPool.class); - - /* - * Properties of load balancer inbound nat pool. - */ - @JsonProperty(value = "properties") - private InboundNatPoolPropertiesFormat innerProperties; - - /* - * The name of the resource that is unique within a resource group. This - * name can be used to access the resource. - */ - @JsonProperty(value = "name") - private String name; - - /* - * A unique read-only string that changes whenever the resource is updated. - */ - @JsonProperty(value = "etag") - private String etag; - - /** - * Get the innerProperties property: Properties of load balancer inbound nat pool. - * - * @return the innerProperties value. - */ - private InboundNatPoolPropertiesFormat innerProperties() { - return this.innerProperties; - } - - /** - * Get the name property: The name of the resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @param name the name value to set. - * @return the InboundNatPool object itself. - */ - public InboundNatPool withName(String name) { - this.name = name; - return this; - } - - /** - * Get the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @param etag the etag value to set. - * @return the InboundNatPool object itself. - */ - public InboundNatPool withEtag(String etag) { - this.etag = etag; - return this; - } - - /** {@inheritDoc} */ - @Override - public InboundNatPool withId(String id) { - super.withId(id); - return this; - } - - /** - * Get the frontendIpConfiguration property: A reference to frontend IP addresses. - * - * @return the frontendIpConfiguration value. - */ - public SubResource frontendIpConfiguration() { - return this.innerProperties() == null ? null : this.innerProperties().frontendIpConfiguration(); - } - - /** - * Set the frontendIpConfiguration property: A reference to frontend IP addresses. - * - * @param frontendIpConfiguration the frontendIpConfiguration value to set. - * @return the InboundNatPool object itself. - */ - public InboundNatPool withFrontendIpConfiguration(SubResource frontendIpConfiguration) { - if (this.innerProperties() == null) { - this.innerProperties = new InboundNatPoolPropertiesFormat(); - } - this.innerProperties().withFrontendIpConfiguration(frontendIpConfiguration); - return this; - } - - /** - * Get the protocol property: The transport protocol for the endpoint. Possible values are 'Udp' or 'Tcp' or 'All'. - * - * @return the protocol value. - */ - public TransportProtocol protocol() { - return this.innerProperties() == null ? null : this.innerProperties().protocol(); - } - - /** - * Set the protocol property: The transport protocol for the endpoint. Possible values are 'Udp' or 'Tcp' or 'All'. - * - * @param protocol the protocol value to set. - * @return the InboundNatPool object itself. - */ - public InboundNatPool withProtocol(TransportProtocol protocol) { - if (this.innerProperties() == null) { - this.innerProperties = new InboundNatPoolPropertiesFormat(); - } - this.innerProperties().withProtocol(protocol); - return this; - } - - /** - * Get the frontendPortRangeStart property: The first port number in the range of external ports that will be used - * to provide Inbound Nat to NICs associated with a load balancer. Acceptable values range between 1 and 65534. - * - * @return the frontendPortRangeStart value. - */ - public Integer frontendPortRangeStart() { - return this.innerProperties() == null ? null : this.innerProperties().frontendPortRangeStart(); - } - - /** - * Set the frontendPortRangeStart property: The first port number in the range of external ports that will be used - * to provide Inbound Nat to NICs associated with a load balancer. Acceptable values range between 1 and 65534. - * - * @param frontendPortRangeStart the frontendPortRangeStart value to set. - * @return the InboundNatPool object itself. - */ - public InboundNatPool withFrontendPortRangeStart(Integer frontendPortRangeStart) { - if (this.innerProperties() == null) { - this.innerProperties = new InboundNatPoolPropertiesFormat(); - } - this.innerProperties().withFrontendPortRangeStart(frontendPortRangeStart); - return this; - } - - /** - * Get the frontendPortRangeEnd property: The last port number in the range of external ports that will be used to - * provide Inbound Nat to NICs associated with a load balancer. Acceptable values range between 1 and 65535. - * - * @return the frontendPortRangeEnd value. - */ - public Integer frontendPortRangeEnd() { - return this.innerProperties() == null ? null : this.innerProperties().frontendPortRangeEnd(); - } - - /** - * Set the frontendPortRangeEnd property: The last port number in the range of external ports that will be used to - * provide Inbound Nat to NICs associated with a load balancer. Acceptable values range between 1 and 65535. - * - * @param frontendPortRangeEnd the frontendPortRangeEnd value to set. - * @return the InboundNatPool object itself. - */ - public InboundNatPool withFrontendPortRangeEnd(Integer frontendPortRangeEnd) { - if (this.innerProperties() == null) { - this.innerProperties = new InboundNatPoolPropertiesFormat(); - } - this.innerProperties().withFrontendPortRangeEnd(frontendPortRangeEnd); - return this; - } - - /** - * Get the backendPort property: The port used for internal connections on the endpoint. Acceptable values are - * between 1 and 65535. - * - * @return the backendPort value. - */ - public Integer backendPort() { - return this.innerProperties() == null ? null : this.innerProperties().backendPort(); - } - - /** - * Set the backendPort property: The port used for internal connections on the endpoint. Acceptable values are - * between 1 and 65535. - * - * @param backendPort the backendPort value to set. - * @return the InboundNatPool object itself. - */ - public InboundNatPool withBackendPort(Integer backendPort) { - if (this.innerProperties() == null) { - this.innerProperties = new InboundNatPoolPropertiesFormat(); - } - this.innerProperties().withBackendPort(backendPort); - return this; - } - - /** - * Get the idleTimeoutInMinutes property: The timeout for the TCP idle connection. The value can be set between 4 - * and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP. - * - * @return the idleTimeoutInMinutes value. - */ - public Integer idleTimeoutInMinutes() { - return this.innerProperties() == null ? null : this.innerProperties().idleTimeoutInMinutes(); - } - - /** - * Set the idleTimeoutInMinutes property: The timeout for the TCP idle connection. The value can be set between 4 - * and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP. - * - * @param idleTimeoutInMinutes the idleTimeoutInMinutes value to set. - * @return the InboundNatPool object itself. - */ - public InboundNatPool withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes) { - if (this.innerProperties() == null) { - this.innerProperties = new InboundNatPoolPropertiesFormat(); - } - this.innerProperties().withIdleTimeoutInMinutes(idleTimeoutInMinutes); - return this; - } - - /** - * Get the enableFloatingIp property: Configures a virtual machine's endpoint for the floating IP capability - * required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn - * Availability Groups in SQL server. This setting can't be changed after you create the endpoint. - * - * @return the enableFloatingIp value. - */ - public Boolean enableFloatingIp() { - return this.innerProperties() == null ? null : this.innerProperties().enableFloatingIp(); - } - - /** - * Set the enableFloatingIp property: Configures a virtual machine's endpoint for the floating IP capability - * required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn - * Availability Groups in SQL server. This setting can't be changed after you create the endpoint. - * - * @param enableFloatingIp the enableFloatingIp value to set. - * @return the InboundNatPool object itself. - */ - public InboundNatPool withEnableFloatingIp(Boolean enableFloatingIp) { - if (this.innerProperties() == null) { - this.innerProperties = new InboundNatPoolPropertiesFormat(); - } - this.innerProperties().withEnableFloatingIp(enableFloatingIp); - return this; - } - - /** - * Get the enableTcpReset property: Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected - * connection termination. This element is only used when the protocol is set to TCP. - * - * @return the enableTcpReset value. - */ - public Boolean enableTcpReset() { - return this.innerProperties() == null ? null : this.innerProperties().enableTcpReset(); - } - - /** - * Set the enableTcpReset property: Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected - * connection termination. This element is only used when the protocol is set to TCP. - * - * @param enableTcpReset the enableTcpReset value to set. - * @return the InboundNatPool object itself. - */ - public InboundNatPool withEnableTcpReset(Boolean enableTcpReset) { - if (this.innerProperties() == null) { - this.innerProperties = new InboundNatPoolPropertiesFormat(); - } - this.innerProperties().withEnableTcpReset(enableTcpReset); - return this; - } - - /** - * Get the provisioningState property: Gets the provisioning state of the PublicIP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Set the provisioningState property: Gets the provisioning state of the PublicIP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param provisioningState the provisioningState value to set. - * @return the InboundNatPool object itself. - */ - public InboundNatPool withProvisioningState(String provisioningState) { - if (this.innerProperties() == null) { - this.innerProperties = new InboundNatPoolPropertiesFormat(); - } - this.innerProperties().withProvisioningState(provisioningState); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/InboundNatRuleListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/InboundNatRuleListResult.java deleted file mode 100644 index 77d4987515e3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/InboundNatRuleListResult.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.InboundNatRuleInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Response for ListInboundNatRule API service call. */ -@Fluent -public final class InboundNatRuleListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(InboundNatRuleListResult.class); - - /* - * A list of inbound nat rules in a load balancer. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to get the next set of results. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: A list of inbound nat rules in a load balancer. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: A list of inbound nat rules in a load balancer. - * - * @param value the value value to set. - * @return the InboundNatRuleListResult object itself. - */ - public InboundNatRuleListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to get the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/InterfaceEndpointListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/InterfaceEndpointListResult.java deleted file mode 100644 index acbd457e5e26..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/InterfaceEndpointListResult.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.InterfaceEndpointInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Response for the ListInterfaceEndpoints API service call. */ -@Fluent -public final class InterfaceEndpointListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(InterfaceEndpointListResult.class); - - /* - * Gets a list of InterfaceEndpoint resources in a resource group. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to get the next set of results. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: Gets a list of InterfaceEndpoint resources in a resource group. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Gets a list of InterfaceEndpoint resources in a resource group. - * - * @param value the value value to set. - * @return the InterfaceEndpointListResult object itself. - */ - public InterfaceEndpointListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to get the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/IpAllocationMethod.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/IpAllocationMethod.java deleted file mode 100644 index 8a019fada06b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/IpAllocationMethod.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for IpAllocationMethod. */ -public final class IpAllocationMethod extends ExpandableStringEnum { - /** Static value Static for IpAllocationMethod. */ - public static final IpAllocationMethod STATIC = fromString("Static"); - - /** Static value Dynamic for IpAllocationMethod. */ - public static final IpAllocationMethod DYNAMIC = fromString("Dynamic"); - - /** - * Creates or finds a IpAllocationMethod from its string representation. - * - * @param name a name to look for. - * @return the corresponding IpAllocationMethod. - */ - @JsonCreator - public static IpAllocationMethod fromString(String name) { - return fromString(name, IpAllocationMethod.class); - } - - /** @return known IpAllocationMethod values. */ - public static Collection values() { - return values(IpAllocationMethod.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/IpFlowProtocol.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/IpFlowProtocol.java deleted file mode 100644 index 15307c425b68..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/IpFlowProtocol.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for IpFlowProtocol. */ -public final class IpFlowProtocol extends ExpandableStringEnum { - /** Static value TCP for IpFlowProtocol. */ - public static final IpFlowProtocol TCP = fromString("TCP"); - - /** Static value UDP for IpFlowProtocol. */ - public static final IpFlowProtocol UDP = fromString("UDP"); - - /** - * Creates or finds a IpFlowProtocol from its string representation. - * - * @param name a name to look for. - * @return the corresponding IpFlowProtocol. - */ - @JsonCreator - public static IpFlowProtocol fromString(String name) { - return fromString(name, IpFlowProtocol.class); - } - - /** @return known IpFlowProtocol values. */ - public static Collection values() { - return values(IpFlowProtocol.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/IpTag.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/IpTag.java deleted file mode 100644 index 196c943b9df3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/IpTag.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Contains the IpTag associated with the object. */ -@Fluent -public final class IpTag { - @JsonIgnore private final ClientLogger logger = new ClientLogger(IpTag.class); - - /* - * Gets or sets the ipTag type: Example FirstPartyUsage. - */ - @JsonProperty(value = "ipTagType") - private String ipTagType; - - /* - * Gets or sets value of the IpTag associated with the public IP. Example - * SQL, Storage etc - */ - @JsonProperty(value = "tag") - private String tag; - - /** - * Get the ipTagType property: Gets or sets the ipTag type: Example FirstPartyUsage. - * - * @return the ipTagType value. - */ - public String ipTagType() { - return this.ipTagType; - } - - /** - * Set the ipTagType property: Gets or sets the ipTag type: Example FirstPartyUsage. - * - * @param ipTagType the ipTagType value to set. - * @return the IpTag object itself. - */ - public IpTag withIpTagType(String ipTagType) { - this.ipTagType = ipTagType; - return this; - } - - /** - * Get the tag property: Gets or sets value of the IpTag associated with the public IP. Example SQL, Storage etc. - * - * @return the tag value. - */ - public String tag() { - return this.tag; - } - - /** - * Set the tag property: Gets or sets value of the IpTag associated with the public IP. Example SQL, Storage etc. - * - * @param tag the tag value to set. - * @return the IpTag object itself. - */ - public IpTag withTag(String tag) { - this.tag = tag; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/IpVersion.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/IpVersion.java deleted file mode 100644 index 0bd13ce11916..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/IpVersion.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for IpVersion. */ -public final class IpVersion extends ExpandableStringEnum { - /** Static value IPv4 for IpVersion. */ - public static final IpVersion IPV4 = fromString("IPv4"); - - /** Static value IPv6 for IpVersion. */ - public static final IpVersion IPV6 = fromString("IPv6"); - - /** - * Creates or finds a IpVersion from its string representation. - * - * @param name a name to look for. - * @return the corresponding IpVersion. - */ - @JsonCreator - public static IpVersion fromString(String name) { - return fromString(name, IpVersion.class); - } - - /** @return known IpVersion values. */ - public static Collection values() { - return values(IpVersion.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/IpsecEncryption.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/IpsecEncryption.java deleted file mode 100644 index 5810f2b9bfc6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/IpsecEncryption.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for IpsecEncryption. */ -public final class IpsecEncryption extends ExpandableStringEnum { - /** Static value None for IpsecEncryption. */ - public static final IpsecEncryption NONE = fromString("None"); - - /** Static value DES for IpsecEncryption. */ - public static final IpsecEncryption DES = fromString("DES"); - - /** Static value DES3 for IpsecEncryption. */ - public static final IpsecEncryption DES3 = fromString("DES3"); - - /** Static value AES128 for IpsecEncryption. */ - public static final IpsecEncryption AES128 = fromString("AES128"); - - /** Static value AES192 for IpsecEncryption. */ - public static final IpsecEncryption AES192 = fromString("AES192"); - - /** Static value AES256 for IpsecEncryption. */ - public static final IpsecEncryption AES256 = fromString("AES256"); - - /** Static value GCMAES128 for IpsecEncryption. */ - public static final IpsecEncryption GCMAES128 = fromString("GCMAES128"); - - /** Static value GCMAES192 for IpsecEncryption. */ - public static final IpsecEncryption GCMAES192 = fromString("GCMAES192"); - - /** Static value GCMAES256 for IpsecEncryption. */ - public static final IpsecEncryption GCMAES256 = fromString("GCMAES256"); - - /** - * Creates or finds a IpsecEncryption from its string representation. - * - * @param name a name to look for. - * @return the corresponding IpsecEncryption. - */ - @JsonCreator - public static IpsecEncryption fromString(String name) { - return fromString(name, IpsecEncryption.class); - } - - /** @return known IpsecEncryption values. */ - public static Collection values() { - return values(IpsecEncryption.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/IpsecIntegrity.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/IpsecIntegrity.java deleted file mode 100644 index f8846888f5a1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/IpsecIntegrity.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for IpsecIntegrity. */ -public final class IpsecIntegrity extends ExpandableStringEnum { - /** Static value MD5 for IpsecIntegrity. */ - public static final IpsecIntegrity MD5 = fromString("MD5"); - - /** Static value SHA1 for IpsecIntegrity. */ - public static final IpsecIntegrity SHA1 = fromString("SHA1"); - - /** Static value SHA256 for IpsecIntegrity. */ - public static final IpsecIntegrity SHA256 = fromString("SHA256"); - - /** Static value GCMAES128 for IpsecIntegrity. */ - public static final IpsecIntegrity GCMAES128 = fromString("GCMAES128"); - - /** Static value GCMAES192 for IpsecIntegrity. */ - public static final IpsecIntegrity GCMAES192 = fromString("GCMAES192"); - - /** Static value GCMAES256 for IpsecIntegrity. */ - public static final IpsecIntegrity GCMAES256 = fromString("GCMAES256"); - - /** - * Creates or finds a IpsecIntegrity from its string representation. - * - * @param name a name to look for. - * @return the corresponding IpsecIntegrity. - */ - @JsonCreator - public static IpsecIntegrity fromString(String name) { - return fromString(name, IpsecIntegrity.class); - } - - /** @return known IpsecIntegrity values. */ - public static Collection values() { - return values(IpsecIntegrity.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/IpsecPolicy.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/IpsecPolicy.java deleted file mode 100644 index a4d6dbe7d3db..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/IpsecPolicy.java +++ /dev/null @@ -1,268 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** An IPSec Policy configuration for a virtual network gateway connection. */ -@Fluent -public final class IpsecPolicy { - @JsonIgnore private final ClientLogger logger = new ClientLogger(IpsecPolicy.class); - - /* - * The IPSec Security Association (also called Quick Mode or Phase 2 SA) - * lifetime in seconds for a site to site VPN tunnel. - */ - @JsonProperty(value = "saLifeTimeSeconds", required = true) - private int saLifeTimeSeconds; - - /* - * The IPSec Security Association (also called Quick Mode or Phase 2 SA) - * payload size in KB for a site to site VPN tunnel. - */ - @JsonProperty(value = "saDataSizeKilobytes", required = true) - private int saDataSizeKilobytes; - - /* - * The IPSec encryption algorithm (IKE phase 1). - */ - @JsonProperty(value = "ipsecEncryption", required = true) - private IpsecEncryption ipsecEncryption; - - /* - * The IPSec integrity algorithm (IKE phase 1). - */ - @JsonProperty(value = "ipsecIntegrity", required = true) - private IpsecIntegrity ipsecIntegrity; - - /* - * The IKE encryption algorithm (IKE phase 2). - */ - @JsonProperty(value = "ikeEncryption", required = true) - private IkeEncryption ikeEncryption; - - /* - * The IKE integrity algorithm (IKE phase 2). - */ - @JsonProperty(value = "ikeIntegrity", required = true) - private IkeIntegrity ikeIntegrity; - - /* - * The DH Groups used in IKE Phase 1 for initial SA. - */ - @JsonProperty(value = "dhGroup", required = true) - private DhGroup dhGroup; - - /* - * The Pfs Groups used in IKE Phase 2 for new child SA. - */ - @JsonProperty(value = "pfsGroup", required = true) - private PfsGroup pfsGroup; - - /** - * Get the saLifeTimeSeconds property: The IPSec Security Association (also called Quick Mode or Phase 2 SA) - * lifetime in seconds for a site to site VPN tunnel. - * - * @return the saLifeTimeSeconds value. - */ - public int saLifeTimeSeconds() { - return this.saLifeTimeSeconds; - } - - /** - * Set the saLifeTimeSeconds property: The IPSec Security Association (also called Quick Mode or Phase 2 SA) - * lifetime in seconds for a site to site VPN tunnel. - * - * @param saLifeTimeSeconds the saLifeTimeSeconds value to set. - * @return the IpsecPolicy object itself. - */ - public IpsecPolicy withSaLifeTimeSeconds(int saLifeTimeSeconds) { - this.saLifeTimeSeconds = saLifeTimeSeconds; - return this; - } - - /** - * Get the saDataSizeKilobytes property: The IPSec Security Association (also called Quick Mode or Phase 2 SA) - * payload size in KB for a site to site VPN tunnel. - * - * @return the saDataSizeKilobytes value. - */ - public int saDataSizeKilobytes() { - return this.saDataSizeKilobytes; - } - - /** - * Set the saDataSizeKilobytes property: The IPSec Security Association (also called Quick Mode or Phase 2 SA) - * payload size in KB for a site to site VPN tunnel. - * - * @param saDataSizeKilobytes the saDataSizeKilobytes value to set. - * @return the IpsecPolicy object itself. - */ - public IpsecPolicy withSaDataSizeKilobytes(int saDataSizeKilobytes) { - this.saDataSizeKilobytes = saDataSizeKilobytes; - return this; - } - - /** - * Get the ipsecEncryption property: The IPSec encryption algorithm (IKE phase 1). - * - * @return the ipsecEncryption value. - */ - public IpsecEncryption ipsecEncryption() { - return this.ipsecEncryption; - } - - /** - * Set the ipsecEncryption property: The IPSec encryption algorithm (IKE phase 1). - * - * @param ipsecEncryption the ipsecEncryption value to set. - * @return the IpsecPolicy object itself. - */ - public IpsecPolicy withIpsecEncryption(IpsecEncryption ipsecEncryption) { - this.ipsecEncryption = ipsecEncryption; - return this; - } - - /** - * Get the ipsecIntegrity property: The IPSec integrity algorithm (IKE phase 1). - * - * @return the ipsecIntegrity value. - */ - public IpsecIntegrity ipsecIntegrity() { - return this.ipsecIntegrity; - } - - /** - * Set the ipsecIntegrity property: The IPSec integrity algorithm (IKE phase 1). - * - * @param ipsecIntegrity the ipsecIntegrity value to set. - * @return the IpsecPolicy object itself. - */ - public IpsecPolicy withIpsecIntegrity(IpsecIntegrity ipsecIntegrity) { - this.ipsecIntegrity = ipsecIntegrity; - return this; - } - - /** - * Get the ikeEncryption property: The IKE encryption algorithm (IKE phase 2). - * - * @return the ikeEncryption value. - */ - public IkeEncryption ikeEncryption() { - return this.ikeEncryption; - } - - /** - * Set the ikeEncryption property: The IKE encryption algorithm (IKE phase 2). - * - * @param ikeEncryption the ikeEncryption value to set. - * @return the IpsecPolicy object itself. - */ - public IpsecPolicy withIkeEncryption(IkeEncryption ikeEncryption) { - this.ikeEncryption = ikeEncryption; - return this; - } - - /** - * Get the ikeIntegrity property: The IKE integrity algorithm (IKE phase 2). - * - * @return the ikeIntegrity value. - */ - public IkeIntegrity ikeIntegrity() { - return this.ikeIntegrity; - } - - /** - * Set the ikeIntegrity property: The IKE integrity algorithm (IKE phase 2). - * - * @param ikeIntegrity the ikeIntegrity value to set. - * @return the IpsecPolicy object itself. - */ - public IpsecPolicy withIkeIntegrity(IkeIntegrity ikeIntegrity) { - this.ikeIntegrity = ikeIntegrity; - return this; - } - - /** - * Get the dhGroup property: The DH Groups used in IKE Phase 1 for initial SA. - * - * @return the dhGroup value. - */ - public DhGroup dhGroup() { - return this.dhGroup; - } - - /** - * Set the dhGroup property: The DH Groups used in IKE Phase 1 for initial SA. - * - * @param dhGroup the dhGroup value to set. - * @return the IpsecPolicy object itself. - */ - public IpsecPolicy withDhGroup(DhGroup dhGroup) { - this.dhGroup = dhGroup; - return this; - } - - /** - * Get the pfsGroup property: The Pfs Groups used in IKE Phase 2 for new child SA. - * - * @return the pfsGroup value. - */ - public PfsGroup pfsGroup() { - return this.pfsGroup; - } - - /** - * Set the pfsGroup property: The Pfs Groups used in IKE Phase 2 for new child SA. - * - * @param pfsGroup the pfsGroup value to set. - * @return the IpsecPolicy object itself. - */ - public IpsecPolicy withPfsGroup(PfsGroup pfsGroup) { - this.pfsGroup = pfsGroup; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (ipsecEncryption() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property ipsecEncryption in model IpsecPolicy")); - } - if (ipsecIntegrity() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property ipsecIntegrity in model IpsecPolicy")); - } - if (ikeEncryption() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property ikeEncryption in model IpsecPolicy")); - } - if (ikeIntegrity() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property ikeIntegrity in model IpsecPolicy")); - } - if (dhGroup() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property dhGroup in model IpsecPolicy")); - } - if (pfsGroup() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property pfsGroup in model IpsecPolicy")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/Ipv6ExpressRouteCircuitPeeringConfig.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/Ipv6ExpressRouteCircuitPeeringConfig.java deleted file mode 100644 index 91a406e382c9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/Ipv6ExpressRouteCircuitPeeringConfig.java +++ /dev/null @@ -1,162 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.RouteFilterInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Contains IPv6 peering config. */ -@Fluent -public final class Ipv6ExpressRouteCircuitPeeringConfig { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Ipv6ExpressRouteCircuitPeeringConfig.class); - - /* - * The primary address prefix. - */ - @JsonProperty(value = "primaryPeerAddressPrefix") - private String primaryPeerAddressPrefix; - - /* - * The secondary address prefix. - */ - @JsonProperty(value = "secondaryPeerAddressPrefix") - private String secondaryPeerAddressPrefix; - - /* - * The Microsoft peering configuration. - */ - @JsonProperty(value = "microsoftPeeringConfig") - private ExpressRouteCircuitPeeringConfig microsoftPeeringConfig; - - /* - * The reference of the RouteFilter resource. - */ - @JsonProperty(value = "routeFilter") - private RouteFilterInner routeFilter; - - /* - * The state of peering. Possible values are: 'Disabled' and 'Enabled' - */ - @JsonProperty(value = "state") - private ExpressRouteCircuitPeeringState state; - - /** - * Get the primaryPeerAddressPrefix property: The primary address prefix. - * - * @return the primaryPeerAddressPrefix value. - */ - public String primaryPeerAddressPrefix() { - return this.primaryPeerAddressPrefix; - } - - /** - * Set the primaryPeerAddressPrefix property: The primary address prefix. - * - * @param primaryPeerAddressPrefix the primaryPeerAddressPrefix value to set. - * @return the Ipv6ExpressRouteCircuitPeeringConfig object itself. - */ - public Ipv6ExpressRouteCircuitPeeringConfig withPrimaryPeerAddressPrefix(String primaryPeerAddressPrefix) { - this.primaryPeerAddressPrefix = primaryPeerAddressPrefix; - return this; - } - - /** - * Get the secondaryPeerAddressPrefix property: The secondary address prefix. - * - * @return the secondaryPeerAddressPrefix value. - */ - public String secondaryPeerAddressPrefix() { - return this.secondaryPeerAddressPrefix; - } - - /** - * Set the secondaryPeerAddressPrefix property: The secondary address prefix. - * - * @param secondaryPeerAddressPrefix the secondaryPeerAddressPrefix value to set. - * @return the Ipv6ExpressRouteCircuitPeeringConfig object itself. - */ - public Ipv6ExpressRouteCircuitPeeringConfig withSecondaryPeerAddressPrefix(String secondaryPeerAddressPrefix) { - this.secondaryPeerAddressPrefix = secondaryPeerAddressPrefix; - return this; - } - - /** - * Get the microsoftPeeringConfig property: The Microsoft peering configuration. - * - * @return the microsoftPeeringConfig value. - */ - public ExpressRouteCircuitPeeringConfig microsoftPeeringConfig() { - return this.microsoftPeeringConfig; - } - - /** - * Set the microsoftPeeringConfig property: The Microsoft peering configuration. - * - * @param microsoftPeeringConfig the microsoftPeeringConfig value to set. - * @return the Ipv6ExpressRouteCircuitPeeringConfig object itself. - */ - public Ipv6ExpressRouteCircuitPeeringConfig withMicrosoftPeeringConfig( - ExpressRouteCircuitPeeringConfig microsoftPeeringConfig) { - this.microsoftPeeringConfig = microsoftPeeringConfig; - return this; - } - - /** - * Get the routeFilter property: The reference of the RouteFilter resource. - * - * @return the routeFilter value. - */ - public RouteFilterInner routeFilter() { - return this.routeFilter; - } - - /** - * Set the routeFilter property: The reference of the RouteFilter resource. - * - * @param routeFilter the routeFilter value to set. - * @return the Ipv6ExpressRouteCircuitPeeringConfig object itself. - */ - public Ipv6ExpressRouteCircuitPeeringConfig withRouteFilter(RouteFilterInner routeFilter) { - this.routeFilter = routeFilter; - return this; - } - - /** - * Get the state property: The state of peering. Possible values are: 'Disabled' and 'Enabled'. - * - * @return the state value. - */ - public ExpressRouteCircuitPeeringState state() { - return this.state; - } - - /** - * Set the state property: The state of peering. Possible values are: 'Disabled' and 'Enabled'. - * - * @param state the state value to set. - * @return the Ipv6ExpressRouteCircuitPeeringConfig object itself. - */ - public Ipv6ExpressRouteCircuitPeeringConfig withState(ExpressRouteCircuitPeeringState state) { - this.state = state; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (microsoftPeeringConfig() != null) { - microsoftPeeringConfig().validate(); - } - if (routeFilter() != null) { - routeFilter().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/Ipv6PeeringConfig.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/Ipv6PeeringConfig.java deleted file mode 100644 index 70215c7c7de1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/Ipv6PeeringConfig.java +++ /dev/null @@ -1,382 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.model.Attachable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.model.Settable; -import java.util.List; - -/** An client-side representation of a load balancer frontend. */ -@Fluent -public interface Ipv6PeeringConfig extends HasInnerModel { - - /** Grouping of public frontend definition stages. */ - interface DefinitionStages { - /** - * The first stage of a public frontend definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface Blank extends WithAdvertisedPublicPrefixes { - } - - /** - * The stage of Cross Connection Peering IPv6 configuration definition allowing to specify primary address - * prefix. - */ - interface WithPrimaryPeerAddressPrefix { - /** - * @param addressPrefix primary peer address prefix - * @return the next stage of the definition - */ - WithSecondaryPeerAddressPrefix withPrimaryPeerAddressPrefix(String addressPrefix); - } - - /** - * The stage of Cross Connection Peering IPv6 configuration definition allowing to specify secondary address - * prefix. - */ - interface WithSecondaryPeerAddressPrefix { - /** - * @param addressPrefix secondary peer address prefix - * @return the next stage of the definition - */ - WithAttach withSecondaryPeerAddressPrefix(String addressPrefix); - } - - /** The stage of Cross Connection Peering IPv6 configuration definition allowing to specify customer ASN. */ - interface WithCustomerASN { - /** - * Specifies customer ASN. - * - * @param customerASN customer ASN - * @return the next satge of the definition - */ - WithRoutingRegistryName withCustomerAsn(int customerASN); - } - - /** - * The stage of Cross Connection Peering IPv6 configuration definition allowing to specify routing registry - * name. - */ - interface WithRoutingRegistryName { - /** - * Specifies routing registry name. - * - * @param routingRegistryName routing registry name - * @return the next stage of the definition - */ - WithPrimaryPeerAddressPrefix withRoutingRegistryName(String routingRegistryName); - } - - /** - * The stage of Cross Connection Peering IPv6 configuration definition allowing to specify secondary address - * prefix. - */ - interface WithAdvertisedPublicPrefixes { - /** - * Specify advertised prefixes: sets a list of all prefixes that are planned to advertise over the BGP - * session. Method will overwrite existing list. Only public IP address prefixes are accepted. A set of - * prefixes can be sent as a comma-separated list. These prefixes must be registered to you in an RIR / IRR. - * - * @param publicPrefixes advertised prefixes - * @return next stage of definition - */ - WithCustomerASN withAdvertisedPublicPrefixes(List publicPrefixes); - - /** - * Specify advertised prefix: sets a prefix that is planned to advertise over the BGP session. Method will - * add a prefix to existing list. Only public IP address prefixes are accepted. A set of prefixes can be - * sent as a comma-separated list. These prefixes must be registered to you in an RIR / IRR. - * - * @param publicPrefix advertised prefix - * @return next stage of definition - */ - WithCustomerASN withAdvertisedPublicPrefix(String publicPrefix); - } - - /** The stage of Cross Connection Peering IPv6 configuration definition allowing to specify route filter. */ - interface WithRouteFilter { - /** - * Sets route filter id. - * - * @param routeFilterId route filter id - * @return the next stage of the definition - */ - WithAttach withRouteFilter(String routeFilterId); - - /** - * Remove route filter from IPv6 configuration. - * - * @return the next stage of the definition - */ - WithAttach withoutRouteFilter(); - } - - /** - * The final stage of a public frontend definition. - * - *

    At this stage, any remaining optional settings can be specified, or the frontend definition can be - * attached to the parent load balancer definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithAttach extends Attachable.InDefinition, WithRouteFilter { - } - } - - /** - * The entirety of a public frontend definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithAttach, - DefinitionStages.WithPrimaryPeerAddressPrefix, - DefinitionStages.WithSecondaryPeerAddressPrefix, - DefinitionStages.WithCustomerASN, - DefinitionStages.WithRoutingRegistryName { - } - - /** Grouping of public frontend update stages. */ - interface UpdateStages { - /** The stage of a public frontend update allowing to specify an existing public IP address. */ - interface WithAdvertisedPublicPrefixes { - /** - * Specify advertised prefixes: sets a list of all prefixes that are planned to advertise over the BGP - * session. Only public IP address prefixes are accepted. A set of prefixes can be sent as a comma-separated - * list. These prefixes must be registered to you in an RIR / IRR. - * - * @param publicPrefixes advertised prefixes - * @return next stage of update - */ - Update withAdvertisedPublicPrefixes(List publicPrefixes); - - /** - * Specify advertised prefix: sets a prefix that is planned to advertise over the BGP session. Method will - * add a prefix to existing list. Only public IP address prefixes are accepted. A set of prefixes can be - * sent as a comma-separated list. These prefixes must be registered to you in an RIR / IRR. - * - * @param publicPrefix advertised prefix - * @return next stage of definition - */ - Update withAdvertisedPublicPrefix(String publicPrefix); - } - - /** - * The stage of Cross Connection Peering IPv6 configuration update allowing to specify primary address prefix. - */ - interface WithPrimaryPeerAddressPrefix { - /** - * @param addressPrefix primary peer address prefix - * @return the next stage of the update - */ - Update withPrimaryPeerAddressPrefix(String addressPrefix); - } - - /** - * The stage of Cross Connection Peering IPv6 configuration update allowing to specify secondary address prefix. - */ - interface WithSecondaryPeerAddressPrefix { - /** - * @param addressPrefix secondary peer address prefix - * @return the next stage of the update - */ - Update withSecondaryPeerAddressPrefix(String addressPrefix); - } - - /** - * The stage of Cross Connection Peering IPv6 configuration update allowing to specify secondary customer ASN. - */ - interface WithCustomerASN { - /** - * Specifies customer ASN. - * - * @param customerASN customer ASN - * @return the next stage of the update - */ - Update withCustomerAsn(int customerASN); - } - - /** - * The stage of Cross Connection Peering IPv6 configuration update allowing to specify routing registry name. - */ - interface WithRoutingRegistryName { - /** - * Specifies routing registry name. - * - * @param routingRegistryName routing registry name - * @return the next stage of the definition - */ - Update withRoutingRegistryName(String routingRegistryName); - } - - /** The stage of Cross Connection Peering IPv6 configuration update allowing to specify route filter. */ - interface WithRouteFilter { - /** - * Sets route filter id. - * - * @param routeFilterId route filter id - * @return the next stage of the definition - */ - Update withRouteFilter(String routeFilterId); - - /** - * Remove route filter from IPv6 configuration. - * - * @return the next stage of the definition - */ - Update withoutRouteFilter(); - } - } - - /** The entirety of a public frontend update as part of an Internet-facing load balancer update. */ - interface Update - extends Settable, - UpdateStages.WithAdvertisedPublicPrefixes, - UpdateStages.WithPrimaryPeerAddressPrefix, - UpdateStages.WithSecondaryPeerAddressPrefix, - UpdateStages.WithCustomerASN, - UpdateStages.WithRoutingRegistryName, - UpdateStages.WithRouteFilter { - } - - /** Grouping of public frontend definition stages applicable as part of an Internet-facing load balancer update. */ - interface UpdateDefinitionStages { - /** - * The first stage of a public frontend definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface Blank extends UpdateDefinitionStages.WithAdvertisedPublicPrefixes { - } - - /** - * The stage of Cross Connection Peering IPv6 configuration definition allowing to specify the advertised public - * prefixes. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithAdvertisedPublicPrefixes { - /** - * Specify advertised prefixes: sets a list of all prefixes that are planned to advertise over the BGP - * session. Only public IP address prefixes are accepted. A set of prefixes can be sent as a comma-separated - * list. These prefixes must be registered to you in an RIR / IRR. - * - * @param publicPrefixes advertised prefixes - * @return next stage of definition - */ - WithCustomerASN withAdvertisedPublicPrefixes(List publicPrefixes); - - /** - * Specify advertised prefix: sets a prefix that is planned to advertise over the BGP session. Method will - * add a prefix to existing list. Only public IP address prefixes are accepted. A set of prefixes can be - * sent as a comma-separated list. These prefixes must be registered to you in an RIR / IRR. - * - * @param publicPrefix advertised prefix - * @return next stage of definition - */ - WithCustomerASN withAdvertisedPublicPrefix(String publicPrefix); - } - - /** - * The stage of Cross Connection Peering IPv6 configuration definition allowing to specify primary address - * prefix. - */ - interface WithPrimaryPeerAddressPrefix { - /** - * @param addressPrefix primary peer address prefix - * @return the next stage of the definition - */ - WithSecondaryPeerAddressPrefix withPrimaryPeerAddressPrefix(String addressPrefix); - } - - /** - * The stage of Cross Connection Peering IPv6 configuration definition allowing to specify secondary address - * prefix. - */ - interface WithSecondaryPeerAddressPrefix { - /** - * @param addressPrefix secondary peer address prefix - * @return the next stage of the definition - */ - WithAttach withSecondaryPeerAddressPrefix(String addressPrefix); - } - - /** - * The stage of Cross Connection Peering IPv6 configuration definition allowing to specify secondary customer - * ASN. - */ - interface WithCustomerASN { - /** - * Specifies customer ASN. - * - * @param customerASN customer ASN - * @return the next satge of the definition - */ - WithRoutingRegistryName withCustomerAsn(int customerASN); - } - - /** - * The stage of Cross Connection Peering IPv6 configuration definition allowing to specify routing registry - * name. - */ - interface WithRoutingRegistryName { - /** - * Specifies routing registry name. - * - * @param routingRegistryName routing registry name - * @return the next stage of the definition - */ - WithPrimaryPeerAddressPrefix withRoutingRegistryName(String routingRegistryName); - } - - /** The stage of Cross Connection Peering IPv6 configuration definition allowing to specify route filter. */ - interface WithRouteFilter { - /** - * Sets route filter id. - * - * @param routeFilterId route filter id - * @return the next stage of the definition - */ - WithAttach withRouteFilter(String routeFilterId); - - /** - * Remove route filter from IPv6 configuration. - * - * @return the next stage of the definition - */ - WithAttach withoutRouteFilter(); - } - - /** - * The final stage of peering IPv6 configuration definition. - * - *

    At this stage, any remaining optional settings can be specified, or the frontend definition can be - * attached to the parent peering definition definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithAttach extends Attachable.InUpdate, WithRouteFilter { - } - } - - /** - * The entirety of Cross Connection Peering IPv6 configuration definition as part of Cross Connection Peering - * update. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface UpdateDefinition - extends UpdateDefinitionStages.Blank, - UpdateDefinitionStages.WithAttach, - UpdateDefinitionStages.WithAdvertisedPublicPrefixes, - UpdateDefinitionStages.WithPrimaryPeerAddressPrefix, - UpdateDefinitionStages.WithSecondaryPeerAddressPrefix, - UpdateDefinitionStages.WithCustomerASN, - UpdateDefinitionStages.WithRoutingRegistryName { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/IssueType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/IssueType.java deleted file mode 100644 index d8611abba55e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/IssueType.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for IssueType. */ -public final class IssueType extends ExpandableStringEnum { - /** Static value Unknown for IssueType. */ - public static final IssueType UNKNOWN = fromString("Unknown"); - - /** Static value AgentStopped for IssueType. */ - public static final IssueType AGENT_STOPPED = fromString("AgentStopped"); - - /** Static value GuestFirewall for IssueType. */ - public static final IssueType GUEST_FIREWALL = fromString("GuestFirewall"); - - /** Static value DnsResolution for IssueType. */ - public static final IssueType DNS_RESOLUTION = fromString("DnsResolution"); - - /** Static value SocketBind for IssueType. */ - public static final IssueType SOCKET_BIND = fromString("SocketBind"); - - /** Static value NetworkSecurityRule for IssueType. */ - public static final IssueType NETWORK_SECURITY_RULE = fromString("NetworkSecurityRule"); - - /** Static value UserDefinedRoute for IssueType. */ - public static final IssueType USER_DEFINED_ROUTE = fromString("UserDefinedRoute"); - - /** Static value PortThrottled for IssueType. */ - public static final IssueType PORT_THROTTLED = fromString("PortThrottled"); - - /** Static value Platform for IssueType. */ - public static final IssueType PLATFORM = fromString("Platform"); - - /** - * Creates or finds a IssueType from its string representation. - * - * @param name a name to look for. - * @return the corresponding IssueType. - */ - @JsonCreator - public static IssueType fromString(String name) { - return fromString(name, IssueType.class); - } - - /** @return known IssueType values. */ - public static Collection values() { - return values(IssueType.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ListHubVirtualNetworkConnectionsResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ListHubVirtualNetworkConnectionsResult.java deleted file mode 100644 index 0bd4dde2af72..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ListHubVirtualNetworkConnectionsResult.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.HubVirtualNetworkConnectionInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** List of HubVirtualNetworkConnections and a URL nextLink to get the next set of results. */ -@Fluent -public final class ListHubVirtualNetworkConnectionsResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ListHubVirtualNetworkConnectionsResult.class); - - /* - * List of HubVirtualNetworkConnections. - */ - @JsonProperty(value = "value") - private List value; - - /* - * URL to get the next set of operation list results if there are any. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: List of HubVirtualNetworkConnections. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: List of HubVirtualNetworkConnections. - * - * @param value the value value to set. - * @return the ListHubVirtualNetworkConnectionsResult object itself. - */ - public ListHubVirtualNetworkConnectionsResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: URL to get the next set of operation list results if there are any. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: URL to get the next set of operation list results if there are any. - * - * @param nextLink the nextLink value to set. - * @return the ListHubVirtualNetworkConnectionsResult object itself. - */ - public ListHubVirtualNetworkConnectionsResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ListP2SVpnGatewaysResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ListP2SVpnGatewaysResult.java deleted file mode 100644 index 2405c865375d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ListP2SVpnGatewaysResult.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.P2SVpnGatewayInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** - * Result of the request to list P2SVpnGateways. It contains a list of P2SVpnGateways and a URL nextLink to get the next - * set of results. - */ -@Fluent -public final class ListP2SVpnGatewaysResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ListP2SVpnGatewaysResult.class); - - /* - * List of P2SVpnGateways. - */ - @JsonProperty(value = "value") - private List value; - - /* - * URL to get the next set of operation list results if there are any. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: List of P2SVpnGateways. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: List of P2SVpnGateways. - * - * @param value the value value to set. - * @return the ListP2SVpnGatewaysResult object itself. - */ - public ListP2SVpnGatewaysResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: URL to get the next set of operation list results if there are any. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: URL to get the next set of operation list results if there are any. - * - * @param nextLink the nextLink value to set. - * @return the ListP2SVpnGatewaysResult object itself. - */ - public ListP2SVpnGatewaysResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ListP2SVpnServerConfigurationsResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ListP2SVpnServerConfigurationsResult.java deleted file mode 100644 index fb7e107bcfc2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ListP2SVpnServerConfigurationsResult.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.P2SVpnServerConfigurationInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** - * Result of the request to list all P2SVpnServerConfigurations associated to a VirtualWan. It contains a list of - * P2SVpnServerConfigurations and a URL nextLink to get the next set of results. - */ -@Fluent -public final class ListP2SVpnServerConfigurationsResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ListP2SVpnServerConfigurationsResult.class); - - /* - * List of P2SVpnServerConfigurations. - */ - @JsonProperty(value = "value") - private List value; - - /* - * URL to get the next set of operation list results if there are any. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: List of P2SVpnServerConfigurations. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: List of P2SVpnServerConfigurations. - * - * @param value the value value to set. - * @return the ListP2SVpnServerConfigurationsResult object itself. - */ - public ListP2SVpnServerConfigurationsResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: URL to get the next set of operation list results if there are any. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: URL to get the next set of operation list results if there are any. - * - * @param nextLink the nextLink value to set. - * @return the ListP2SVpnServerConfigurationsResult object itself. - */ - public ListP2SVpnServerConfigurationsResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ListVirtualHubsResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ListVirtualHubsResult.java deleted file mode 100644 index b40e6472275e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ListVirtualHubsResult.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.VirtualHubInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** - * Result of the request to list VirtualHubs. It contains a list of VirtualHubs and a URL nextLink to get the next set - * of results. - */ -@Fluent -public final class ListVirtualHubsResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ListVirtualHubsResult.class); - - /* - * List of VirtualHubs. - */ - @JsonProperty(value = "value") - private List value; - - /* - * URL to get the next set of operation list results if there are any. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: List of VirtualHubs. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: List of VirtualHubs. - * - * @param value the value value to set. - * @return the ListVirtualHubsResult object itself. - */ - public ListVirtualHubsResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: URL to get the next set of operation list results if there are any. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: URL to get the next set of operation list results if there are any. - * - * @param nextLink the nextLink value to set. - * @return the ListVirtualHubsResult object itself. - */ - public ListVirtualHubsResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ListVirtualWansResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ListVirtualWansResult.java deleted file mode 100644 index 100a7ed29606..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ListVirtualWansResult.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.VirtualWanInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** - * Result of the request to list VirtualWANs. It contains a list of VirtualWANs and a URL nextLink to get the next set - * of results. - */ -@Fluent -public final class ListVirtualWansResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ListVirtualWansResult.class); - - /* - * List of VirtualWANs. - */ - @JsonProperty(value = "value") - private List value; - - /* - * URL to get the next set of operation list results if there are any. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: List of VirtualWANs. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: List of VirtualWANs. - * - * @param value the value value to set. - * @return the ListVirtualWansResult object itself. - */ - public ListVirtualWansResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: URL to get the next set of operation list results if there are any. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: URL to get the next set of operation list results if there are any. - * - * @param nextLink the nextLink value to set. - * @return the ListVirtualWansResult object itself. - */ - public ListVirtualWansResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ListVpnConnectionsResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ListVpnConnectionsResult.java deleted file mode 100644 index 444d23165811..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ListVpnConnectionsResult.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.VpnConnectionInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** - * Result of the request to list all vpn connections to a virtual wan vpn gateway. It contains a list of Vpn Connections - * and a URL nextLink to get the next set of results. - */ -@Fluent -public final class ListVpnConnectionsResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ListVpnConnectionsResult.class); - - /* - * List of Vpn Connections. - */ - @JsonProperty(value = "value") - private List value; - - /* - * URL to get the next set of operation list results if there are any. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: List of Vpn Connections. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: List of Vpn Connections. - * - * @param value the value value to set. - * @return the ListVpnConnectionsResult object itself. - */ - public ListVpnConnectionsResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: URL to get the next set of operation list results if there are any. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: URL to get the next set of operation list results if there are any. - * - * @param nextLink the nextLink value to set. - * @return the ListVpnConnectionsResult object itself. - */ - public ListVpnConnectionsResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ListVpnGatewaysResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ListVpnGatewaysResult.java deleted file mode 100644 index b9bad1753c11..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ListVpnGatewaysResult.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.VpnGatewayInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** - * Result of the request to list VpnGateways. It contains a list of VpnGateways and a URL nextLink to get the next set - * of results. - */ -@Fluent -public final class ListVpnGatewaysResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ListVpnGatewaysResult.class); - - /* - * List of VpnGateways. - */ - @JsonProperty(value = "value") - private List value; - - /* - * URL to get the next set of operation list results if there are any. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: List of VpnGateways. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: List of VpnGateways. - * - * @param value the value value to set. - * @return the ListVpnGatewaysResult object itself. - */ - public ListVpnGatewaysResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: URL to get the next set of operation list results if there are any. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: URL to get the next set of operation list results if there are any. - * - * @param nextLink the nextLink value to set. - * @return the ListVpnGatewaysResult object itself. - */ - public ListVpnGatewaysResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ListVpnSitesResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ListVpnSitesResult.java deleted file mode 100644 index cdc714b78dc6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ListVpnSitesResult.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.VpnSiteInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** - * Result of the request to list VpnSites. It contains a list of VpnSites and a URL nextLink to get the next set of - * results. - */ -@Fluent -public final class ListVpnSitesResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ListVpnSitesResult.class); - - /* - * List of VpnSites. - */ - @JsonProperty(value = "value") - private List value; - - /* - * URL to get the next set of operation list results if there are any. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: List of VpnSites. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: List of VpnSites. - * - * @param value the value value to set. - * @return the ListVpnSitesResult object itself. - */ - public ListVpnSitesResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: URL to get the next set of operation list results if there are any. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: URL to get the next set of operation list results if there are any. - * - * @param nextLink the nextLink value to set. - * @return the ListVpnSitesResult object itself. - */ - public ListVpnSitesResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LoadBalancer.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LoadBalancer.java deleted file mode 100644 index a4fcb890d6fe..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LoadBalancer.java +++ /dev/null @@ -1,568 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.network.fluent.models.LoadBalancerInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.GroupableResource; -import com.azure.resourcemanager.resources.fluentcore.arm.models.Resource; -import com.azure.resourcemanager.resources.fluentcore.model.Appliable; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; -import com.azure.resourcemanager.resources.fluentcore.model.Updatable; -import java.util.List; -import java.util.Map; - -/** Entry point for load balancer management API in Azure. */ -@Fluent -public interface LoadBalancer - extends GroupableResource, - Refreshable, - Updatable, - UpdatableWithTags, - HasLoadBalancingRules { - - // Getters - - /** @return resource IDs of the public IP addresses assigned to the frontends of this load balancer */ - List publicIpAddressIds(); - - /** @return TCP probes of this load balancer, indexed by the name */ - Map tcpProbes(); - - /** @return HTTP probes of this load balancer, indexed by the name */ - Map httpProbes(); - - /** @return HTTPS probes of this load balancer, indexed by the name */ - Map httpsProbes(); - - /** @return backends for this load balancer to load balance the incoming traffic among, indexed by name */ - Map backends(); - - /** @return inbound NAT rules for this balancer */ - Map inboundNatRules(); - - /** @return frontends for this load balancer, for the incoming traffic to come from. */ - Map frontends(); - - /** @return private (internal) frontends */ - Map privateFrontends(); - - /** - * Searches for the public frontend that is associated with the provided public IP address, if one exists. - * - * @param publicIPAddress a public IP address to search by - * @return a public frontend associated with the provided public IP address - */ - LoadBalancerPublicFrontend findFrontendByPublicIpAddress(PublicIpAddress publicIPAddress); - - /** - * Searches for the public frontend that is associated with the provided public IP address, if one exists. - * - * @param publicIPAddressId the resource ID of a public IP address to search by - * @return a public frontend associated with the provided public IP address - */ - LoadBalancerPublicFrontend findFrontendByPublicIpAddress(String publicIPAddressId); - - /** @return public (Internet-facing) frontends */ - Map publicFrontends(); - - /** @return inbound NAT pools, indexed by name */ - Map inboundNatPools(); - - /** @return load balancer sku. */ - LoadBalancerSkuType sku(); - - /** @return outbound rules for this balancer */ - Map outboundRules(); - - /** The entirety of the load balancer definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithGroup, - DefinitionStages.WithCreate, - DefinitionStages.WithBackend, - DefinitionStages.WithLoadBalancingRule, - DefinitionStages.WithLBRuleOrNat, - DefinitionStages.WithLBRuleOrNatOrCreate, - DefinitionStages.WithCreateAndInboundNatPool, - DefinitionStages.WithCreateAndInboundNatRule, - DefinitionStages.WithCreateAndOutboundRule, - DefinitionStages.WithCreateAndNatChoice { - } - - /** Grouping of load balancer definition stages. */ - interface DefinitionStages { - /** The first stage of a load balancer definition. */ - interface Blank extends GroupableResource.DefinitionWithRegion { - } - - /** The stage of the load balancer definition allowing to specify the resource group. */ - interface WithGroup extends GroupableResource.DefinitionStages.WithGroup { - } - - /** - * The stage of a load balancer definition describing the nature of the frontend of the load balancer: internal - * or Internet-facing. - */ - interface WithFrontend extends WithPublicFrontend, WithPrivateFrontend { - } - - /** The stage of an internal load balancer definition allowing to define one or more private frontends. */ - interface WithPrivateFrontend { - /** - * Begins an explicit definition of a new private (internal) load balancer frontend. - * - *

    (Note that private frontends can also be created implicitly as part of a load balancing rule, inbound - * NAT rule or inbound NAT pool definition, by referencing an existing subnet within those definitions.) - * - * @param name the name for the frontend - * @return the first stage of a new frontend definition - */ - LoadBalancerPrivateFrontend.DefinitionStages.Blank definePrivateFrontend(String name); - } - - /** The stage of an Internet-facing load balancer definition allowing to define one or more public frontends. */ - interface WithPublicFrontend { - /** - * Begins an explicit definition of a new public (Internet-facing) load balancer frontend. - * - *

    (Note that frontends can also be created implicitly as part of a load balancing rule, inbound NAT rule - * or inbound NAT pool definition, by referencing an existing public IP address within those definitions.) - * - * @param name the name for the frontend - * @return the first stage of a new frontend definition - */ - LoadBalancerPublicFrontend.DefinitionStages.Blank definePublicFrontend(String name); - } - - /** The stage of a load balancer definition allowing to add a backend. */ - interface WithBackend { - /** - * Starts the definition of a backend. - * - * @param name the name to assign to the backend - * @return the next stage of the update - */ - LoadBalancerBackend.DefinitionStages.Blank defineBackend(String name); - } - - /** - * The stage of a load balancer definition allowing to add a load blanacing rule, or an inbound NAT rule or - * pool. - */ - interface WithLBRuleOrNat extends WithLoadBalancingRule, WithInboundNatRule, WithInboundNatPool { - } - - /** The stage of the load balancer definition allowing to add a load balancing probe. */ - interface WithProbe { - /** - * Begins the definition of a new TCP probe to add to the load balancer. - * - * @param name the name of the probe - * @return the first stage of the new probe definition - */ - LoadBalancerTcpProbe.DefinitionStages.Blank defineTcpProbe(String name); - - /** - * Begins the definition of a new HTTP probe to add to the load balancer. - * - * @param name the name of the probe - * @return the first stage of the new probe definition - */ - LoadBalancerHttpProbe.DefinitionStages.Blank defineHttpProbe(String name); - - /** - * Begins the definition of a new HTTPS probe to add to the load balancer. - * - * @param name the name of the probe - * @return the first stage of the new probe definition - */ - LoadBalancerHttpProbe.DefinitionStages.Blank defineHttpsProbe(String name); - } - - /** The stage of a load balancer definition allowing to create a load balancing rule. */ - interface WithLoadBalancingRule { - /** - * Begins the definition of a new load balancing rule to add to the load balancer. - * - * @param name the name of the load balancing rule - * @return the first stage of the new load balancing rule definition - */ - LoadBalancingRule.DefinitionStages.Blank defineLoadBalancingRule(String name); - } - - /** - * The stage of a load balancer definition allowing to create a load balancing rule or create the load balancer. - */ - interface WithLBRuleOrNatOrCreate extends WithLoadBalancingRule, WithCreateAndNatChoice { - } - - /** The stage of the load balancer definition allowing to specify SKU. */ - interface WithSku { - /** - * Specifies the SKU for the load balancer. - * - * @param skuType the SKU type - * @return the next stage of the definition - */ - WithCreate withSku(LoadBalancerSkuType skuType); - } - - /** - * The stage of a load balancer definition containing all the required inputs for the resource to be created, - * but also allowing for any other optional settings to be specified. - */ - interface WithCreate - extends Creatable, - Resource.DefinitionWithTags, - WithBackend, - WithFrontend, - WithProbe, - WithSku { - } - - /** - * The stage of a load balancer definition allowing to create the load balancer or start configuring optional - * inbound NAT rules or pools. - */ - interface WithCreateAndNatChoice extends WithCreate, WithInboundNatRule, WithInboundNatPool { - } - - /** The stage of a load balancer definition allowing to create the load balancer or add an inbound NAT pool. */ - interface WithCreateAndInboundNatPool extends WithCreate, WithInboundNatPool { - } - - /** The stage of a load balancer definition allowing to create the load balancer or add an inbound NAT rule. */ - interface WithCreateAndInboundNatRule extends WithCreate, WithInboundNatRule { - } - - /** - * The stage of a load balancer definition allowing to create the load balancer or add an outbound rule - */ - interface WithCreateAndOutboundRule extends WithCreate, WithOutboundRule { - } - - /** The stage of a load balancer definition allowing to create a new inbound NAT rule. */ - interface WithInboundNatRule { - /** - * Begins the definition of a new inbound NAT rule to add to the load balancer. - * - * @param name the name of the inbound NAT rule - * @return the first stage of the new inbound NAT rule definition - */ - LoadBalancerInboundNatRule.DefinitionStages.Blank defineInboundNatRule( - String name); - } - - /** - * The stage of a load balancer definition allowing to create a new outbound rule - */ - interface WithOutboundRule { - /** - * Begins the definition of a new outbound rule to add to the load balancer - * - * @param name the name of the outbound rule - * @return the first stage of the new outbound rule definition - */ - LoadBalancerOutboundRule.DefinitionStages.Blank defineOutboundRule(String name); - } - - /** - * The stage of a load balancer definition allowing to create a new inbound NAT pool for a virtual machine scale - * set. - */ - interface WithInboundNatPool { - /** - * Begins the definition of a new inbount NAT pool to add to the load balancer. - * - *

    The definition must be completed with a call to {@link - * LoadBalancerInboundNatPool.DefinitionStages.WithAttach#attach()} - * - * @param name the name of the inbound NAT pool - * @return the first stage of the new inbound NAT pool definition - */ - LoadBalancerInboundNatPool.DefinitionStages.Blank defineInboundNatPool( - String name); - } - } - - /** Grouping of load balancer update stages. */ - interface UpdateStages { - /** The stage of the load balancer update allowing to add or remove backends. */ - interface WithBackend { - /** - * Removes the specified backend from the load balancer. - * - * @param name the name of the backend to remove - * @return the next stage of the update - */ - Update withoutBackend(String name); - - /** - * Begins the definition of a new backend as part of this load balancer update. - * - * @param name the name for the new backend - * @return the first stage of the backend definition - */ - LoadBalancerBackend.UpdateDefinitionStages.Blank defineBackend(String name); - - /** - * Begins the description of an update to an existing backend of this load balancer. - * - * @param name the name of the backend to update - * @return the first stage of the update - */ - LoadBalancerBackend.Update updateBackend(String name); - } - - /** The stage of the load balancer update allowing to add, remove or modify probes. */ - interface WithProbe { - /** - * Begins the definition of a new HTTP probe to add to the load balancer. - * - *

    The definition must be completed with a call to {@link - * LoadBalancerHttpProbe.DefinitionStages.WithAttach#attach()} - * - * @param name the name of the new probe - * @return the next stage of the definition - */ - LoadBalancerHttpProbe.UpdateDefinitionStages.Blank defineHttpProbe(String name); - - /** - * Begins the definition of a new HTTPS probe to add to the load balancer. - * - *

    The definition must be completed with a call to {@link - * LoadBalancerHttpProbe.DefinitionStages.WithAttach#attach()} - * - * @param name the name of the new probe - * @return the next stage of the definition - */ - LoadBalancerHttpProbe.UpdateDefinitionStages.Blank defineHttpsProbe(String name); - - /** - * Begins the definition of a new TCP probe to add to the load balancer. - * - *

    The definition must be completed with a call to {@link - * LoadBalancerHttpProbe.DefinitionStages.WithAttach#attach()} - * - * @param name the name of the new probe - * @return the next stage of the definition - */ - LoadBalancerTcpProbe.UpdateDefinitionStages.Blank defineTcpProbe(String name); - - /** - * Removes the specified probe from the load balancer, if present. - * - * @param name the name of the probe to remove - * @return the next stage of the update - */ - Update withoutProbe(String name); - - /** - * Begins the description of an update to an existing TCP probe on this load balancer. - * - * @param name the name of the probe to update - * @return the first stage of the probe update - */ - LoadBalancerTcpProbe.Update updateTcpProbe(String name); - - /** - * Begins the description of an update to an existing HTTP probe on this load balancer. - * - * @param name the name of the probe to update - * @return the first stage of the probe update - */ - LoadBalancerHttpProbe.Update updateHttpProbe(String name); - - /** - * Begins the description of an update to an existing HTTPS probe on this load balancer. - * - * @param name the name of the probe to update - * @return the first stage of the probe update - */ - LoadBalancerHttpProbe.Update updateHttpsProbe(String name); - } - - /** The stage of the load balancer update allowing to add, remove or modify load balancing rules. */ - interface WithLoadBalancingRule { - /** - * Begins the definition of a new load balancing rule to add to the load balancer. - * - * @param name the name of the load balancing rule - * @return the first stage of the new load balancing rule definition - */ - LoadBalancingRule.UpdateDefinitionStages.Blank defineLoadBalancingRule(String name); - - /** - * Removes the specified load balancing rule from the load balancer, if present. - * - * @param name the name of the load balancing rule to remove - * @return the next stage of the update - */ - Update withoutLoadBalancingRule(String name); - - /** - * Begins the description of an update to an existing load balancing rule on this load balancer. - * - * @param name the name of the load balancing rule to update - * @return the first stage of the load balancing rule update - */ - LoadBalancingRule.Update updateLoadBalancingRule(String name); - } - - /** The stage of a load balancer update allowing to define, remove or edit Internet-facing frontends. */ - interface WithPublicFrontend { - /** - * Begins the update of a load balancer frontend. - * - *

    The definition must be completed with a call to {@link - * LoadBalancerPublicFrontend.UpdateDefinitionStages.WithAttach#attach()} - * - * @param name the name for the frontend - * @return the first stage of the new frontend definition - */ - LoadBalancerPublicFrontend.UpdateDefinitionStages.Blank definePublicFrontend(String name); - - /** - * Removes the specified frontend from the load balancer. - * - * @param name the name of an existing front end on this load balancer - * @return the next stage of the update - */ - Update withoutFrontend(String name); - - /** - * Begins the description of an update to an existing Internet-facing frontend. - * - * @param name the name of the frontend to update - * @return the first stage of the frontend update - */ - LoadBalancerPublicFrontend.Update updatePublicFrontend(String name); - } - - /** The stage of a load balancer update allowing to define one or more private frontends. */ - interface WithPrivateFrontend { - /** - * Begins the update of an internal load balancer frontend. - * - * @param name the name for the frontend - * @return the first stage of the new frontend definition - */ - LoadBalancerPrivateFrontend.UpdateDefinitionStages.Blank definePrivateFrontend(String name); - - /** - * Begins the description of an update to an existing internal frontend. - * - * @param name the name of an existing frontend from this load balancer - * @return the first stage of the frontend update - */ - LoadBalancerPrivateFrontend.Update updatePrivateFrontend(String name); - } - - /** The stage of a load balancer update allowing to define, remove or edit inbound NAT rules. */ - interface WithInboundNatRule { - /** - * Removes the specified inbound NAT rule from the load balancer. - * - * @param name the name of an existing inbound NAT rule on this load balancer - * @return the next stage of the update - */ - Update withoutInboundNatRule(String name); - - /** - * Begins the definition of a new inbound NAT rule. - * - *

    The definition must be completed with a call to {@link - * LoadBalancerInboundNatRule.UpdateDefinitionStages.WithAttach#attach()} - * - * @param name the name for the inbound NAT rule - * @return the first stage of the new inbound NAT rule definition - */ - LoadBalancerInboundNatRule.UpdateDefinitionStages.Blank defineInboundNatRule(String name); - - /** - * Begins the description of an update to an existing inbound NAT rule. - * - * @param name the name of the inbound NAT rule to update - * @return the first stage of the inbound NAT rule update - */ - LoadBalancerInboundNatRule.Update updateInboundNatRule(String name); - } - - /** - * The stage of a load balancer update allowing to create a new inbound NAT pool for a virtual machine scale - * set. - */ - interface WithInboundNatPool { - /** - * Removes the specified inbound NAT pool from the load balancer. - * - * @param name the name of an existing inbound NAT pool on this load balancer - * @return the next stage of the update - */ - Update withoutInboundNatPool(String name); - - /** - * Begins the definition of a new inbound NAT pool. - * - * @param name the name of the inbound NAT pool - * @return the first stage of the new inbound NAT pool definition - */ - LoadBalancerInboundNatPool.UpdateDefinitionStages.Blank defineInboundNatPool(String name); - - /** - * Begins the description of an update to an existing inbound NAT pool. - * - * @param name the name of the inbound NAT pool to update - * @return the first stage of the inbound NAT pool update - */ - LoadBalancerInboundNatPool.Update updateInboundNatPool(String name); - } - - /** The stage of a load balancer update allowing to define, remove or edit outbound rules. */ - interface WithOutboundRule { - /** - * Removes the specified outbound rule from the load balancer. - * - * @param name the name of an existing outbound rule on this load balancer - * @return the next stage of the update - */ - Update withoutOutboundRule(String name); - - /** - * Begins the definition of a new inbound NAT rule. - * - *

    The definition must be completed with a call to {@link - * LoadBalancerOutboundRule.DefinitionStages.WithAttach#attach()} - * - * @param name the name for the outbound rule - * @return the first stage of the new outbound rule definition - */ - LoadBalancerOutboundRule.DefinitionStages.Blank defineOutboundRule(String name); - - /** - * Begins the description of an update to an existing outbound rule. - * - * @param name the name of the outbound rule to update - * @return the first stage of the outbound rule update - */ - LoadBalancerOutboundRule.Update updateOutboundRule(String name); - } - } - - /** The template for a load balancer update operation, containing all the settings that can be modified. */ - interface Update - extends Appliable, - Resource.UpdateWithTags, - UpdateStages.WithProbe, - UpdateStages.WithBackend, - UpdateStages.WithLoadBalancingRule, - UpdateStages.WithPublicFrontend, - UpdateStages.WithPrivateFrontend, - UpdateStages.WithOutboundRule, - UpdateStages.WithInboundNatRule, - UpdateStages.WithInboundNatPool { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LoadBalancerBackend.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LoadBalancerBackend.java deleted file mode 100644 index 5b7d81a28daa..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LoadBalancerBackend.java +++ /dev/null @@ -1,178 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.network.fluent.models.BackendAddressPoolInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.ChildResource; -import com.azure.resourcemanager.resources.fluentcore.model.Attachable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.model.Settable; -import java.util.Collection; -import java.util.Set; - -/** A client-side representation of a load balancer backend address pool. */ -@Fluent() -public interface LoadBalancerBackend - extends HasInnerModel, ChildResource, HasLoadBalancingRules, HasBackendNics { - - /** @return a list of the resource IDs of the virtual machines associated with this backend */ - Set getVirtualMachineIds(); - - /** Grouping of load balancer backend definition stages. */ - interface DefinitionStages { - /** - * The first stage of a load balancer backend definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface Blank extends WithAttach { - } - - /** - * The stage of a load balancer backend definition allowing to select a set of virtual machines to load balance - * the network traffic among. - * - * @param the next stage of the definition - */ - interface WithVirtualMachine { - /** - * Adds the specified set of virtual machines, assuming they are from the same availability set, to this - * backend address pool. - * - *

    This will add references to the primary IP configurations of the primary network interfaces of the - * provided set of virtual machines. - * - *

    If the virtual machines are not in the same availability set, they will not be associated with this - * back end. - * - *

    Only those virtual machines will be associated with the load balancer that already have an existing - * network interface. Virtual machines without a network interface will be skipped. - * - * @param vms existing virtual machines - * @return the next stage of the definition - */ - WithAttach withExistingVirtualMachines(HasNetworkInterfaces... vms); - - /** - * Adds the specified set of virtual machines, assuming they are from the same availability set, to this - * backend address pool. - * - *

    This will add references to the primary IP configurations of the primary network interfaces of the - * provided set of virtual machines. - * - *

    If the virtual machines are not in the same availability set, they will not be associated with this - * back end. - * - *

    Only those virtual machines will be associated with the load balancer that already have an existing - * network interface. Virtual machines without a network interface will be skipped. - * - * @param vms existing virtual machines - * @return the next stage of the definition - */ - WithAttach withExistingVirtualMachines(Collection vms); - } - - /** - * The final stage of a load balancer backend definition. - * - *

    At this stage, any remaining optional settings can be specified, or the definition can be attached to the - * parent load balancer definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithAttach extends Attachable.InDefinition, WithVirtualMachine { - } - } - - /** - * The entirety of a load balancer backend definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithAttach { - } - - /** Grouping of load balancer backend update stages. */ - interface UpdateStages { - } - - /** The entirety of a load balancer backend update as part of a load balancer update. */ - interface Update extends Settable { - } - - /** Grouping of load balancer backend definition stages applicable as part of a load balancer update. */ - interface UpdateDefinitionStages { - /** - * The first stage of a load balancer backend definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface Blank extends WithAttach { - } - - /** - * The stage of a load balancer backend definition allowing to select a set of virtual machines to load balance - * the network traffic among. - * - * @param the next stage of the definition - */ - interface WithVirtualMachine { - /** - * Adds the specified set of virtual machines, assuming they are from the same availability set, to this - * back end address pool. - * - *

    This will add references to the primary IP configurations of the primary network interfaces of the - * provided set of virtual machines. - * - *

    If the virtual machines are not in the same availability set, they will not be associated with this - * back end. - * - *

    Only those virtual machines will be associated with the load balancer that already have an existing - * network interface. Virtual machines without a network interface will be skipped. - * - * @param vms existing virtual machines - * @return the next stage of the definition - */ - WithAttach withExistingVirtualMachines(HasNetworkInterfaces... vms); - - /** - * Adds the specified set of virtual machines, assuming they are from the same availability set, to this - * backend address pool. - * - *

    This will add references to the primary IP configurations of the primary network interfaces of the - * provided set of virtual machines. - * - *

    If the virtual machines are not in the same availability set, they will not be associated with this - * back end. - * - *

    Only those virtual machines will be associated with the load balancer that already have an existing - * network interface. Virtual machines without a network interface will be skipped. - * - * @param vms existing virtual machines - * @return the next stage of the definition - */ - WithAttach withExistingVirtualMachines(Collection vms); - } - - /** - * The final stage of a load balancer backend definition. - * - *

    At this stage, any remaining optional settings can be specified, or the definition can be attached to the - * parent load balancer definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithAttach extends Attachable.InUpdate, WithVirtualMachine { - } - } - - /** - * The entirety of a load balancer backend definition as part of a load balancer update. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface UpdateDefinition - extends UpdateDefinitionStages.Blank, UpdateDefinitionStages.WithAttach { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LoadBalancerBackendAddressPoolListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LoadBalancerBackendAddressPoolListResult.java deleted file mode 100644 index a61c1a910407..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LoadBalancerBackendAddressPoolListResult.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.BackendAddressPoolInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Response for ListBackendAddressPool API service call. */ -@Fluent -public final class LoadBalancerBackendAddressPoolListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LoadBalancerBackendAddressPoolListResult.class); - - /* - * A list of backend address pools in a load balancer. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to get the next set of results. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: A list of backend address pools in a load balancer. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: A list of backend address pools in a load balancer. - * - * @param value the value value to set. - * @return the LoadBalancerBackendAddressPoolListResult object itself. - */ - public LoadBalancerBackendAddressPoolListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to get the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LoadBalancerFrontend.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LoadBalancerFrontend.java deleted file mode 100644 index e4b78acec604..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LoadBalancerFrontend.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.network.fluent.models.FrontendIpConfigurationInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.ChildResource; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import java.util.Map; - -/** An client-side representation of a load balancer frontend. */ -@Fluent() -public interface LoadBalancerFrontend - extends HasInnerModel, ChildResource, HasLoadBalancingRules { - - /** @return true if the frontend is public, i.e. it has a public IP address associated with it */ - boolean isPublic(); - - /** @return the inbound NAT pools on this load balancer that use this frontend, indexed by their names */ - Map inboundNatPools(); - - /** @return the inbound NAT rules on this load balancer that use this frontend, indexed by their names */ - Map inboundNatRules(); - - /** @return the outbound rules on this load balancer that use this frontend, indexed by their names */ - Map outboundRules(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LoadBalancerFrontendIpConfigurationListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LoadBalancerFrontendIpConfigurationListResult.java deleted file mode 100644 index 1e4d5da4a556..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LoadBalancerFrontendIpConfigurationListResult.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.FrontendIpConfigurationInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Response for ListFrontendIPConfiguration API service call. */ -@Fluent -public final class LoadBalancerFrontendIpConfigurationListResult { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(LoadBalancerFrontendIpConfigurationListResult.class); - - /* - * A list of frontend IP configurations in a load balancer. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to get the next set of results. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: A list of frontend IP configurations in a load balancer. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: A list of frontend IP configurations in a load balancer. - * - * @param value the value value to set. - * @return the LoadBalancerFrontendIpConfigurationListResult object itself. - */ - public LoadBalancerFrontendIpConfigurationListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to get the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LoadBalancerHttpProbe.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LoadBalancerHttpProbe.java deleted file mode 100644 index ac8bce7f9fde..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LoadBalancerHttpProbe.java +++ /dev/null @@ -1,270 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.model.Attachable; -import com.azure.resourcemanager.resources.fluentcore.model.Settable; - -/** A client-side representation of an HTTP load balancing probe. */ -@Fluent() -public interface LoadBalancerHttpProbe extends LoadBalancerProbe { - - /** @return the HTTP request path for the HTTP probe to call to check the health status */ - String requestPath(); - - /** Grouping of probe definition stages. */ - interface DefinitionStages { - /** - * The first stage of the probe definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface Blank extends WithRequestPath { - } - - /** - * The final stage of the probe definition. - * - *

    At this stage, any remaining optional settings can be specified, or the probe definition can be attached - * to the parent load balancer definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithAttach - extends Attachable.InDefinition, - WithPort, - WithIntervalInSeconds, - WithNumberOfProbes { - } - - /** - * The stage of the probe definition allowing to specify the HTTP request path for the probe to monitor. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithRequestPath { - /** - * Specifies the request path. - * - * @param requestPath the request path - * @return the next stage of the definition - */ - WithAttach withRequestPath(String requestPath); - } - - /** - * The stage of the HTTP probe definition allowing to specify the probe interval. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithIntervalInSeconds { - /** - * Specifies the interval between probes, in seconds. - * - * @param seconds number of seconds - * @return the next stage of the definition - */ - WithAttach withIntervalInSeconds(int seconds); - } - - /** - * The stage of the probe definition allowing to specify the port to monitor. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithPort { - /** - * Specifies the port number to call for health monitoring. - * - * @param port a port number - * @return the next stage of the definition - */ - WithAttach withPort(int port); - } - - /** - * The stage of the HTTP probe definition allowing to specify the number of unsuccessful probes before failure - * is determined. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithNumberOfProbes { - /** - * Specifies the number of unsuccessful probes before failure is determined. - * - * @param probes number of probes - * @return the next stage of the definition - */ - WithAttach withNumberOfProbes(int probes); - } - } - - /** - * The entirety of a probe definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithAttach, - DefinitionStages.WithRequestPath { - } - - /** Grouping of probe update stages. */ - interface UpdateStages { - /** The stage of the HTTP probe update allowing to modify the port number to monitor. */ - interface WithPort { - /** - * Specifies the port number to call for health monitoring. - * - * @param port a port number - * @return the next stage of the update - */ - Update withPort(int port); - } - - /** The stage of the HTTP probe update allowing to modify the probe interval. */ - interface WithIntervalInSeconds { - /** - * Specifies the interval between probes, in seconds. - * - * @param seconds number of seconds - * @return the next stage of the update - */ - Update withIntervalInSeconds(int seconds); - } - - /** - * The stage of the HTTP probe update allowing to modify the number of unsuccessful probes before failure is - * determined. - */ - interface WithNumberOfProbes { - /** - * Specifies the number of unsuccessful probes before failure is determined. - * - * @param probes number of probes - * @return the next stage of the update - */ - Update withNumberOfProbes(int probes); - } - - /** The stage of the HTTP probe update allowing to modify the HTTP request path for the probe to monitor. */ - interface WithRequestPath { - /** - * Specifies the HTTP request path for the probe to monitor. - * - * @param requestPath a request path - * @return the next stage of the definition - */ - Update withRequestPath(String requestPath); - } - } - - /** The entirety of a probe update as part of a load balancer update. */ - interface Update - extends Settable, - UpdateStages.WithIntervalInSeconds, - UpdateStages.WithNumberOfProbes, - UpdateStages.WithPort, - UpdateStages.WithRequestPath { - } - - /** Grouping of probe definition stages applicable as part of a load balancer update. */ - interface UpdateDefinitionStages { - /** - * The first stage of the probe definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface Blank extends WithRequestPath { - } - - /** - * The final stage of the probe definition. - * - *

    At this stage, any remaining optional settings can be specified, or the probe definition can be attached - * to the parent load balancer definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithAttach - extends Attachable.InUpdate, - WithPort, - WithIntervalInSeconds, - WithNumberOfProbes { - } - - /** - * The stage of the probe definition allowing to specify the HTTP request path for the probe to monitor. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithRequestPath { - /** - * Specifies the HTTP request path for the probe to monitor. - * - * @param requestPath a request path - * @return the next stage of the definition - */ - WithAttach withRequestPath(String requestPath); - } - - /** - * The stage of the HTTP probe definition allowing to specify the probe interval. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithIntervalInSeconds { - /** - * Specifies the interval between probes, in seconds. - * - * @param seconds number of seconds - * @return the next stage of the definition - */ - WithAttach withIntervalInSeconds(int seconds); - } - - /** - * The stage of the probe definition allowing to specify the port to monitor. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithPort { - /** - * Specifies the port number to call for health monitoring. - * - * @param port a port number - * @return the next stage of the definition - */ - WithAttach withPort(int port); - } - - /** - * The stage of the HTTP probe definition allowing to specify the number of unsuccessful probes before failure - * is determined. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithNumberOfProbes { - /** - * Specifies the number of unsuccessful probes before failure is determined. - * - * @param probes number of probes - * @return the next stage of the definition - */ - WithAttach withNumberOfProbes(int probes); - } - } - - /** - * The entirety of a probe definition as part of a load balancer update. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface UpdateDefinition - extends UpdateDefinitionStages.Blank, - UpdateDefinitionStages.WithAttach, - UpdateDefinitionStages.WithRequestPath { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LoadBalancerInboundNatPool.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LoadBalancerInboundNatPool.java deleted file mode 100644 index 8ac39b0fb332..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LoadBalancerInboundNatPool.java +++ /dev/null @@ -1,227 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.arm.models.ChildResource; -import com.azure.resourcemanager.resources.fluentcore.model.Attachable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.model.Settable; - -/** A client-side representation of an inbound NAT pool. */ -@Fluent() -public interface LoadBalancerInboundNatPool - extends HasFrontend, - HasBackendPort, - HasProtocol, - HasInnerModel, - ChildResource { - - /** @return the starting frontend port number */ - int frontendPortRangeStart(); - - /** @return the ending frontend port number */ - int frontendPortRangeEnd(); - - /** Grouping of inbound NAT pool definition stages. */ - interface DefinitionStages { - /** - * The first stage of the inbound NAT pool definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface Blank extends WithProtocol { - } - - /** - * The final stage of the inbound NAT pool definition. - * - *

    At this stage, any remaining optional settings can be specified, or the inbound NAT pool definition can be - * attached to the parent load balancer definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithAttach extends Attachable.InDefinition { - } - - /** - * The stage of an inbound NAT pool definition allowing to specify the transport protocol for the pool to apply - * to. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithProtocol - extends HasProtocol.DefinitionStages.WithProtocol, TransportProtocol> { - } - - /** - * The stage of an inbound NAT pool definition allowing to specify the frontend for the inbound NAT rules in the - * pool to apply to. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithFrontend - extends HasFrontend.DefinitionStages.WithFrontend> { - } - - /** - * The stage of an inbound NAT pool definition allowing to specify the frontend port range. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithFrontendPortRange { - /** - * Specifies the frontend port range to receive network traffic from. - * - * @param from the starting port number, between 1 and 65534 - * @param to the ending port number, greater than the starting port number and no more than 65534 - * @return the next stage of the definition - */ - WithBackendPort fromFrontendPortRange(int from, int to); - } - - /** - * The stage of an inbound NAT pool definition allowing to specify the backend port. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithBackendPort - extends HasBackendPort.DefinitionStages.WithBackendPort> { - } - } - - /** - * The entirety of an inbound NAT pool definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithAttach, - DefinitionStages.WithProtocol, - DefinitionStages.WithFrontend, - DefinitionStages.WithFrontendPortRange, - DefinitionStages.WithBackendPort { - } - - /** Grouping of inbound NAT pool update stages. */ - interface UpdateStages { - /** - * The stage of an inbound NAT pool update allowing to specify the transport protocol for the pool to apply to. - */ - interface WithProtocol extends HasProtocol.UpdateStages.WithProtocol { - } - - /** - * The stage of an inbound NAT pool update allowing to specify the frontend for the inbound NAT rules in the - * pool to apply to. - */ - interface WithFrontend extends HasFrontend.UpdateStages.WithFrontend { - } - - /** The stage of an inbound NAT pool update allowing to specify the frontend port range. */ - interface WithFrontendPortRange { - /** - * Specifies the frontend port range. - * - * @param from the starting port number, between 1 and 65534 - * @param to the ending port number, greater than the starting port number and no more than 65534 - * @return the next stage of the definition - */ - Update fromFrontendPortRange(int from, int to); - } - - /** The stage of an inbound NAT pool update allowing to specify the backend port. */ - interface WithBackendPort extends HasBackendPort.UpdateStages.WithBackendPort { - } - } - - /** The entirety of an inbound NAT pool update as part of a load balancer update. */ - interface Update - extends Settable, - UpdateStages.WithProtocol, - UpdateStages.WithFrontend, - UpdateStages.WithBackendPort, - UpdateStages.WithFrontendPortRange { - } - - /** Grouping of inbound NAT pool definition stages applicable as part of a load balancer update. */ - interface UpdateDefinitionStages { - /** - * The first stage of the inbound NAT pool definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface Blank extends WithProtocol { - } - - /** - * The final stage of the inbound NAT pool definition. - * - *

    At this stage, any remaining optional settings can be specified, or the inbound NAT pool definition can be - * attached to the parent load balancer definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithAttach extends Attachable.InUpdate { - } - - /** - * The stage of an inbound NAT pool definition allowing to specify the transport protocol for the pool to apply - * to. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithProtocol - extends HasProtocol.UpdateDefinitionStages.WithProtocol, TransportProtocol> { - } - - /** - * The stage of an inbound NAT pool definition allowing to specify the frontend for the inbound NAT rules in the - * pool to apply to. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithFrontend extends HasFrontend.UpdateDefinitionStages.WithFrontend> { - } - - /** - * The stage of an inbound NAT pool definition allowing to specify the frontend port range. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithFrontendPortRange { - /** - * Specified the frontend port range. - * - * @param from the starting port number, between 1 and 65534 - * @param to the ending port number, greater than the starting port number and no more than 65534 - * @return the next stage of the definition - */ - WithAttach fromFrontendPortRange(int from, int to); - } - - /** - * The stage of an inbound NAT pool definition allowing to specify the backend port. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithBackendPort - extends HasBackendPort.UpdateDefinitionStages.WithBackendPort> { - } - } - - /** - * The entirety of an inbound NAT pool definition as part of a load balancer update. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface UpdateDefinition - extends UpdateDefinitionStages.Blank, - UpdateDefinitionStages.WithAttach, - UpdateDefinitionStages.WithProtocol, - UpdateDefinitionStages.WithFrontend, - UpdateDefinitionStages.WithFrontendPortRange, - UpdateDefinitionStages.WithBackendPort { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LoadBalancerInboundNatRule.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LoadBalancerInboundNatRule.java deleted file mode 100644 index ac0407a67874..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LoadBalancerInboundNatRule.java +++ /dev/null @@ -1,279 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.network.fluent.models.InboundNatRuleInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.ChildResource; -import com.azure.resourcemanager.resources.fluentcore.model.Attachable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.model.Settable; - -/** An immutable client-side representation of an inbound NAT rule. */ -@Fluent() -public interface LoadBalancerInboundNatRule - extends HasFrontend, - HasBackendPort, - HasProtocol, - HasFloatingIP, - HasFrontendPort, - HasInnerModel, - ChildResource { - - /** @return the name of the IP configuration within the network interface associated with this NAT rule */ - String backendNicIpConfigurationName(); - - /** @return the resource ID of the network interface assigned as the backend of this inbound NAT rule */ - String backendNetworkInterfaceId(); - - /** @return the number of minutes before an idle connection is closed */ - int idleTimeoutInMinutes(); - - /** Grouping of inbound NAT rule definition stages. */ - interface DefinitionStages { - /** - * The first stage of the inbound NAT rule definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface Blank extends WithProtocol { - } - - /** - * The final stage of the inbound NAT rule definition. - * - *

    At this stage, any remaining optional settings can be specified, or the inbound NAT rule definition can be - * attached to the parent load balancer definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithAttach - extends Attachable.InDefinition, - DefinitionStages.WithBackendPort, - DefinitionStages.WithFloatingIP, - DefinitionStages.WithIdleTimeout { - } - - /** - * The stage of an inbound NAT rule definition allowing to specify the transport protocol. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithProtocol - extends HasProtocol.DefinitionStages.WithProtocol, TransportProtocol> { - } - - /** - * The stage of an inbound NAT rule definition allowing to specify a frontend for the rule to apply to. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithFrontend extends HasFrontend.DefinitionStages.WithFrontend> { - } - - /** - * The stage of an inbound NAT rule definition allowing to specify the backend port. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithBackendPort - extends HasBackendPort.DefinitionStages.WithBackendPort> { - } - - /** - * The stage of an inbound NAT rule definition allowing to specify whether floating IP should be enabled. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithFloatingIP extends HasFloatingIP.DefinitionStages.WithFloatingIP> { - } - - /** - * The stage of an inbound NAT rule definition allowing to specify the frontend port. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithFrontendPort - extends HasFrontendPort.DefinitionStages.WithFrontendPort> { - } - - /** - * The stage of an inbound NAT rule definition allowing to specify the idle connection timeout for this inbound - * NAT rule. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithIdleTimeout { - /** - * Specifies the idle connection timeout in minutes. - * - * @param minutes a number of minutes - * @return the next stage of the definition - */ - WithAttach withIdleTimeoutInMinutes(int minutes); - } - } - - /** - * The entirety of an inbound NAT rule definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithProtocol, - DefinitionStages.WithFrontend, - DefinitionStages.WithFrontendPort, - DefinitionStages.WithAttach { - } - - /** Grouping of inbound NAT rule update stages. */ - interface UpdateStages { - /** The stage of an inbound NAT rule update allowing to specify the backend port. */ - interface WithBackendPort extends HasBackendPort.UpdateStages.WithBackendPort { - } - - /** The stage of an inbound NAT rule update allowing to specify a frontend for the rule to apply to. */ - interface WithFrontend extends HasFrontend.UpdateStages.WithFrontend { - } - - /** - * The stage of an inbound NAT rule update allowing to specify the transport protocol for the rule to apply to. - */ - interface WithProtocol extends HasProtocol.UpdateStages.WithProtocol { - } - - /** The stage of an inbound NAT rule update allowing to specify whether floating IP should be enabled. */ - interface WithFloatingIP extends HasFloatingIP.UpdateStages.WithFloatingIP { - } - - /** The stage of an inbound NAT rule update allowing to specify the frontend port. */ - interface WithFrontendPort extends HasFrontendPort.UpdateStages.WithFrontendPort { - } - - /** - * The stage of an inbound NAT rule update allowing to specify the idle connection timeout for this inbound NAT - * rule. - */ - interface WithIdleTimeout { - /** - * Specifies the idle connection timeout in minutes. - * - * @param minutes a number of minutes - * @return the next stage of the update - */ - Update withIdleTimeoutInMinutes(int minutes); - } - } - - /** The entirety of an inbound NAT rule update as part of a load balancer update. */ - interface Update - extends Settable, - UpdateStages.WithBackendPort, - UpdateStages.WithFloatingIP, - UpdateStages.WithFrontend, - UpdateStages.WithFrontendPort, - UpdateStages.WithIdleTimeout, - UpdateStages.WithProtocol { - } - - /** Grouping of inbound NAT rule definition stages as part of a load balancer update. */ - interface UpdateDefinitionStages { - /** - * The first stage of the inbound NAT rule definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface Blank extends WithProtocol { - } - - /** - * The final stage of the inbound NAT rule definition. - * - *

    At this stage, any remaining optional settings can be specified, or the inbound NAT rule definition can be - * attached to the parent load balancer definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithAttach - extends Attachable.InUpdate, - UpdateDefinitionStages.WithBackendPort, - UpdateDefinitionStages.WithFloatingIP, - UpdateDefinitionStages.WithIdleTimeout { - } - - /** - * The stage of an inbound NAT rule definition allowing to specify the transport protocol. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithProtocol - extends HasProtocol.UpdateDefinitionStages.WithProtocol, TransportProtocol> { - } - - /** - * The stage of an inbound NAT rule definition allowing to specify a frontend for the rule to apply to. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithFrontend - extends HasFrontend.UpdateDefinitionStages.WithFrontend> { - } - - /** - * The stage of an inbound NAT rule definition allowing to specify the backend port. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithBackendPort - extends HasBackendPort.UpdateDefinitionStages.WithBackendPort> { - } - - /** - * The stage of an inbound NAT rule definition allowing to specify whether floating IP should be enabled. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithFloatingIP - extends HasFloatingIP.UpdateDefinitionStages.WithFloatingIP> { - } - - /** - * The stage of an inbound NAT rule definition allowing to specify the frontend port. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithFrontendPort - extends HasFrontendPort.UpdateDefinitionStages.WithFrontendPort> { - } - - /** - * The stage of an inbound NAT rule definition allowing to specify the idle connection timeout for this inbound - * NAT rule. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithIdleTimeout { - /** - * Specifies the idle connection timeout in minutes. - * - * @param minutes a number of minutes - * @return the next stage of the definition - */ - WithAttach withIdleTimeoutInMinutes(int minutes); - } - } - - /** - * The entirety of an inbound NAT rule definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface UpdateDefinition - extends UpdateDefinitionStages.Blank, - UpdateDefinitionStages.WithProtocol, - UpdateDefinitionStages.WithFrontend, - UpdateDefinitionStages.WithFrontendPort, - UpdateDefinitionStages.WithAttach { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LoadBalancerListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LoadBalancerListResult.java deleted file mode 100644 index 3e1d534b13f1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LoadBalancerListResult.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.LoadBalancerInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Response for ListLoadBalancers API service call. */ -@Fluent -public final class LoadBalancerListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LoadBalancerListResult.class); - - /* - * A list of load balancers in a resource group. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to get the next set of results. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: A list of load balancers in a resource group. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: A list of load balancers in a resource group. - * - * @param value the value value to set. - * @return the LoadBalancerListResult object itself. - */ - public LoadBalancerListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to get the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LoadBalancerLoadBalancingRuleListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LoadBalancerLoadBalancingRuleListResult.java deleted file mode 100644 index 3b03d88fd3da..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LoadBalancerLoadBalancingRuleListResult.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.LoadBalancingRuleInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Response for ListLoadBalancingRule API service call. */ -@Fluent -public final class LoadBalancerLoadBalancingRuleListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LoadBalancerLoadBalancingRuleListResult.class); - - /* - * A list of load balancing rules in a load balancer. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to get the next set of results. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: A list of load balancing rules in a load balancer. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: A list of load balancing rules in a load balancer. - * - * @param value the value value to set. - * @return the LoadBalancerLoadBalancingRuleListResult object itself. - */ - public LoadBalancerLoadBalancingRuleListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to get the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LoadBalancerOutboundRule.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LoadBalancerOutboundRule.java deleted file mode 100644 index 5694e9bed5f3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LoadBalancerOutboundRule.java +++ /dev/null @@ -1,231 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.network.models; - -import com.azure.resourcemanager.network.fluent.models.OutboundRuleInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.ChildResource; -import com.azure.resourcemanager.resources.fluentcore.model.Attachable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.model.Settable; - -import java.util.List; -import java.util.Map; - -/** An immutable client-side representation of an outbound rule. */ -public interface LoadBalancerOutboundRule - extends HasInnerModel, - HasProtocol, - ChildResource { - - /** @return the associated frontends */ - Map frontends(); - - /** @return the associated backend */ - LoadBalancerBackend backend(); - - /** @return the number of outbound ports to be used for NAT */ - int allocatedOutboundPorts(); - - /** @return the provisioning state of the outbound rule resource */ - ProvisioningState provisioningState(); - - /** @return the number of minutes before an idle connection is closed */ - int idleTimeoutInMinutes(); - - /** @return if TCP reset is enabled */ - boolean tcpResetEnabled(); - - /** @return outbound rule protocol */ - LoadBalancerOutboundRuleProtocol protocol(); - - /** Grouping of outbound rule definition stages. */ - interface DefinitionStages { - /** - * The first stage of the outbound rule definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface Blank extends LoadBalancerOutboundRule.DefinitionStages.WithProtocol { - } - - /** - * The final stage of the outbound rule definition. - * - *

    At this stage, any remaining optional settings can be specified, or the outbound rule definition can be - * attached to the parent load balancer definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithAttach - extends Attachable.InDefinition, - LoadBalancerOutboundRule.DefinitionStages.WithEnableTcpReset, - LoadBalancerOutboundRule.DefinitionStages.WithIdleTimeout { - } - - /** - * The stage of an outbound rule definition allowing to specify the transport protocol. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithProtocol - extends HasProtocol.DefinitionStages.WithProtocol, LoadBalancerOutboundRuleProtocol> { - } - - /** - * The stage of an outbound rule definition allowing to specify a backend pool for the rule to apply to. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithBackend { - /** - * Specifies a backend for outbound rule to apply to - * @param name the backend name - * @return the next stage of the definition - */ - LoadBalancerOutboundRule.DefinitionStages.WithFrontend fromBackend(String name); - } - - /** - * The stage of an outbound rule definition allowing to specify the frontend IP address. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithFrontend { - /** - * Specifies a frontend for outbound rule to apply to - * @param name the frontend name - * @return the next stage of the definition - */ - LoadBalancerOutboundRule.DefinitionStages.WithAttach toFrontend(String name); - - /** - * Specifies a list of frontends for outbound rule to apply to - * @param names a list of frontend names - * @return the next stage of the definition - */ - LoadBalancerOutboundRule.DefinitionStages.WithAttach toFrontends(List names); - } - - /** - * The stage of an outbound rule definition allowing to specify the idle connection timeout for this outbound - * rule. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithIdleTimeout { - /** - * Specifies the idle connection timeout in minutes. - * - * @param minutes a number of minutes - * @return the next stage of the definition - */ - LoadBalancerOutboundRule.DefinitionStages.WithAttach withIdleTimeoutInMinutes(int minutes); - } - - /** - * The stage of an outbound rule definition allowing to specify the TCP reset enablement for this outbound - * rule. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithEnableTcpReset { - /** - * Specifies the TCP reset enablement for this outbound rule - * @param enableTcpReset boolean value indicating enable TCP reset or not - * @return the next stage of the definition - */ - LoadBalancerOutboundRule.DefinitionStages.WithAttach withEnableTcpReset(boolean enableTcpReset); - } - } - - /** - * The entirety of an outbound rule definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface Definition - extends LoadBalancerOutboundRule.DefinitionStages.Blank, - LoadBalancerOutboundRule.DefinitionStages.WithProtocol, - LoadBalancerOutboundRule.DefinitionStages.WithBackend, - LoadBalancerOutboundRule.DefinitionStages.WithFrontend, - LoadBalancerOutboundRule.DefinitionStages.WithAttach { - } - - /** Grouping of outbound rule update stages. */ - interface UpdateStages { - /** The stage of an outbound rule update allowing to specify the backend pool. */ - interface WithBackend { - /** - * Specifies the backend pool. - * - * @param name backend pool name - * @return the next stage of the update - */ - Update fromBackend(String name); - } - - /** The stage of an outbound rule update allowing to specify a frontend for the rule to apply to. */ - interface WithFrontend { - /** - * Specifies the frontend IP Address - * @param name frontend name - * @return the next stage of the update - */ - Update toFrontend(String name); - - /** - * Specifies the frontend IP Addresses - * @param names a list of frontend names - * @return the next stage of the update - */ - Update toFrontends(List names); - } - - /** - * The stage of an outbound rule update allowing to specify the transport protocol for the rule to apply to. - */ - interface WithProtocol extends HasProtocol.UpdateStages.WithProtocol, LoadBalancerOutboundRuleProtocol> { - } - - /** - * The stage of an outbound rule definition allowing to update the TCP reset enablement for this outbound - * rule. - * - */ - interface WithEnableTcpReset { - /** - * Specifies the idle connection timeout in minutes. - * - * @param enableTcpReset the TCP reset enablement boolean - * @return the next stage of the update - */ - Update withEnableTcpReset(boolean enableTcpReset); - } - - /** - * The stage of an inbound NAT rule update allowing to specify the idle connection timeout for this inbound NAT - * rule. - */ - interface WithIdleTimeout { - /** - * Specifies the idle connection timeout in minutes. - * - * @param minutes a number of minutes - * @return the next stage of the update - */ - Update withIdleTimeoutInMinutes(int minutes); - } - } - - /** The entirety of an inbound NAT rule update as part of a load balancer update. */ - interface Update - extends Settable, - LoadBalancerOutboundRule.UpdateStages.WithProtocol, - LoadBalancerOutboundRule.UpdateStages.WithBackend, - LoadBalancerOutboundRule.UpdateStages.WithFrontend, - LoadBalancerOutboundRule.UpdateStages.WithEnableTcpReset, - LoadBalancerOutboundRule.UpdateStages.WithIdleTimeout { - } - -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LoadBalancerOutboundRuleListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LoadBalancerOutboundRuleListResult.java deleted file mode 100644 index d483a11750f2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LoadBalancerOutboundRuleListResult.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.OutboundRuleInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Response for ListOutboundRule API service call. */ -@Fluent -public final class LoadBalancerOutboundRuleListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LoadBalancerOutboundRuleListResult.class); - - /* - * A list of outbound rules in a load balancer. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to get the next set of results. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: A list of outbound rules in a load balancer. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: A list of outbound rules in a load balancer. - * - * @param value the value value to set. - * @return the LoadBalancerOutboundRuleListResult object itself. - */ - public LoadBalancerOutboundRuleListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to get the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LoadBalancerOutboundRuleProtocol.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LoadBalancerOutboundRuleProtocol.java deleted file mode 100644 index e73089453b35..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LoadBalancerOutboundRuleProtocol.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for LoadBalancerOutboundRuleProtocol. */ -public final class LoadBalancerOutboundRuleProtocol extends ExpandableStringEnum { - /** Static value Tcp for LoadBalancerOutboundRuleProtocol. */ - public static final LoadBalancerOutboundRuleProtocol TCP = fromString("Tcp"); - - /** Static value Udp for LoadBalancerOutboundRuleProtocol. */ - public static final LoadBalancerOutboundRuleProtocol UDP = fromString("Udp"); - - /** Static value All for LoadBalancerOutboundRuleProtocol. */ - public static final LoadBalancerOutboundRuleProtocol ALL = fromString("All"); - - /** - * Creates or finds a LoadBalancerOutboundRuleProtocol from its string representation. - * - * @param name a name to look for. - * @return the corresponding LoadBalancerOutboundRuleProtocol. - */ - @JsonCreator - public static LoadBalancerOutboundRuleProtocol fromString(String name) { - return fromString(name, LoadBalancerOutboundRuleProtocol.class); - } - - /** @return known LoadBalancerOutboundRuleProtocol values. */ - public static Collection values() { - return values(LoadBalancerOutboundRuleProtocol.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LoadBalancerPrivateFrontend.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LoadBalancerPrivateFrontend.java deleted file mode 100644 index 44c3f7f15496..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LoadBalancerPrivateFrontend.java +++ /dev/null @@ -1,180 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.arm.AvailabilityZoneId; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasSubnet; -import com.azure.resourcemanager.resources.fluentcore.model.Attachable; -import com.azure.resourcemanager.resources.fluentcore.model.Settable; -import java.util.Set; - -/** A client-side representation of a private frontend of an internal load balancer. */ -@Fluent() -public interface LoadBalancerPrivateFrontend extends LoadBalancerFrontend, HasPrivateIpAddress, HasSubnet { - - /** - * @return associated subnet - *

    Note this makes a separate call to Azure. - */ - Subnet getSubnet(); - - /** @return the availability zones assigned to private frontend. */ - Set availabilityZones(); - - /** Grouping of private frontend definition stages. */ - interface DefinitionStages { - /** - * The first stage of a private frontend definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface Blank extends WithSubnet { - } - - /** - * The stage of a private frontend definition allowing to specify a subnet from the selected network. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithSubnet extends HasSubnet.DefinitionStages.WithSubnet> { - /** - * Assigns the specified subnet to this private frontend of an internal load balancer. - * - * @param network the virtual network the subnet exists in - * @param subnetName the name of a subnet - * @return the next stage of the definition - */ - WithAttach withExistingSubnet(Network network, String subnetName); - } - - /** - * The stage of a private frontend definition allowing to specify availability zone. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithAvailabilityZone { - /** - * Specifies the availability zone for the private frontend. - * - * @param zoneId the zone identifier. - * @return the next stage of the definition - */ - WithAttach withAvailabilityZone(AvailabilityZoneId zoneId); - } - - /** - * The final stage of a private frontend definition. - * - *

    At this stage, any remaining optional settings can be specified, or the frontend definition can be - * attached to the parent load balancer definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithAttach - extends Attachable.InDefinitionAlt, - HasPrivateIpAddress.DefinitionStages.WithPrivateIPAddress>, - DefinitionStages.WithAvailabilityZone { - } - } - - /** - * The entirety of a private frontend definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithAttach, - DefinitionStages.WithSubnet { - } - - /** Grouping of private frontend update stages. */ - interface UpdateStages { - /** The stage of a private frontend update allowing to specify a subnet from the selected network. */ - interface WithSubnet { - /** - * Assigns the specified subnet to this private frontend of the internal load balancer. - * - * @param network the virtual network the subnet exists in - * @param subnetName the name of a subnet - * @return the next stage of the definition - */ - Update withExistingSubnet(Network network, String subnetName); - } - } - - /** The entirety of a private frontend update as part of a load balancer update. */ - interface Update - extends Settable, - UpdateStages.WithSubnet, - HasPrivateIpAddress.UpdateStages.WithPrivateIPAddress { - } - - /** Grouping of private frontend definition stages applicable as part of a load balancer update. */ - interface UpdateDefinitionStages { - /** - * The first stage of a private frontend definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface Blank extends WithSubnet { - } - - /** - * The stage of a private frontend definition allowing to specify a subnet from the selected network. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithSubnet { - /** - * Assigns the specified subnet to this private frontend of the internal load balancer. - * - * @param network the virtual network the subnet exists in - * @param subnetName the name of a subnet - * @return the next stage of the definition - */ - WithAttach withExistingSubnet(Network network, String subnetName); - } - - /** - * The stage of a private frontend definition allowing to specify availability zone. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithAvailabilityZone { - /** - * Specifies the availability zone for the private frontend. - * - * @param zoneId the zone identifier. - * @return the next stage of the definition - */ - WithAttach withAvailabilityZone(AvailabilityZoneId zoneId); - } - - /** - * The final stage of an internal frontend definition. - * - *

    At this stage, any remaining optional settings can be specified, or the frontend definition can be - * attached to the parent load balancer definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithAttach - extends Attachable.InUpdateAlt, - HasPrivateIpAddress.UpdateDefinitionStages.WithPrivateIPAddress>, - WithAvailabilityZone { - } - } - - /** - * The entirety of a private frontend definition as part of a load balancer update. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface UpdateDefinition - extends UpdateDefinitionStages.Blank, - UpdateDefinitionStages.WithAttach, - UpdateDefinitionStages.WithSubnet { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LoadBalancerProbe.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LoadBalancerProbe.java deleted file mode 100644 index 5dd964bd8145..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LoadBalancerProbe.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.network.fluent.models.ProbeInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.ChildResource; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; - -/** A client-side representation of a load balancing probe. */ -@Fluent() -public interface LoadBalancerProbe - extends HasInnerModel, - ChildResource, - HasLoadBalancingRules, - HasProtocol, - HasPort { - - /** @return number of seconds between probes */ - int intervalInSeconds(); - - /** @return number of failed probes before the node is determined to be unhealthy */ - int numberOfProbes(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LoadBalancerProbeListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LoadBalancerProbeListResult.java deleted file mode 100644 index b81abd14047a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LoadBalancerProbeListResult.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.ProbeInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Response for ListProbe API service call. */ -@Fluent -public final class LoadBalancerProbeListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LoadBalancerProbeListResult.class); - - /* - * A list of probes in a load balancer. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to get the next set of results. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: A list of probes in a load balancer. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: A list of probes in a load balancer. - * - * @param value the value value to set. - * @return the LoadBalancerProbeListResult object itself. - */ - public LoadBalancerProbeListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to get the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LoadBalancerPublicFrontend.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LoadBalancerPublicFrontend.java deleted file mode 100644 index 7c6ebbae3a34..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LoadBalancerPublicFrontend.java +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.model.Attachable; -import com.azure.resourcemanager.resources.fluentcore.model.Settable; - -/** A client-side representation of a public frontend of an Internet-facing load balancer. */ -@Fluent() -public interface LoadBalancerPublicFrontend extends LoadBalancerFrontend, HasPublicIpAddress { - - /** Grouping of public frontend definition stages. */ - interface DefinitionStages { - /** - * The first stage of a public frontend definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface Blank extends WithPublicIPAddress { - } - - /** - * The stage of a public frontend definition allowing to specify an existing public IP address. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithPublicIPAddress - extends HasPublicIpAddress.DefinitionStages.WithPublicIPAddress> { - } - - /** - * The final stage of a public frontend definition. - * - *

    At this stage, any remaining optional settings can be specified, or the frontend definition can be - * attached to the parent load balancer definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithAttach extends Attachable.InDefinition { - } - } - - /** - * The entirety of a public frontend definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithAttach, - DefinitionStages.WithPublicIPAddress { - } - - /** Grouping of public frontend update stages. */ - interface UpdateStages { - /** The stage of a public frontend update allowing to specify an existing public IP address. */ - interface WithPublicIPAddress extends HasPublicIpAddress.UpdateStages.WithPublicIPAddress { - } - } - - /** The entirety of a public frontend update as part of an Internet-facing load balancer update. */ - interface Update extends Settable, UpdateStages.WithPublicIPAddress { - } - - /** Grouping of public frontend definition stages applicable as part of an Internet-facing load balancer update. */ - interface UpdateDefinitionStages { - /** - * The first stage of a public frontend definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface Blank extends WithPublicIPAddress { - } - - /** - * The stage of a public frontend definition allowing to specify an existing public IP address. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithPublicIPAddress - extends HasPublicIpAddress.UpdateDefinitionStages.WithPublicIPAddress> { - } - - /** - * The final stage of the public frontend definition. - * - *

    At this stage, any remaining optional settings can be specified, or the frontend definition can be - * attached to the parent load balancer definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithAttach extends Attachable.InUpdate { - } - } - - /** - * The entirety of a public frontend definition as part of an Internet-facing load balancer update. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface UpdateDefinition - extends UpdateDefinitionStages.Blank, - UpdateDefinitionStages.WithAttach, - UpdateDefinitionStages.WithPublicIPAddress { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LoadBalancerSku.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LoadBalancerSku.java deleted file mode 100644 index 340f6b34de5e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LoadBalancerSku.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** SKU of a load balancer. */ -@Fluent -public final class LoadBalancerSku { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LoadBalancerSku.class); - - /* - * Name of a load balancer SKU. - */ - @JsonProperty(value = "name") - private LoadBalancerSkuName name; - - /** - * Get the name property: Name of a load balancer SKU. - * - * @return the name value. - */ - public LoadBalancerSkuName name() { - return this.name; - } - - /** - * Set the name property: Name of a load balancer SKU. - * - * @param name the name value to set. - * @return the LoadBalancerSku object itself. - */ - public LoadBalancerSku withName(LoadBalancerSkuName name) { - this.name = name; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LoadBalancerSkuName.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LoadBalancerSkuName.java deleted file mode 100644 index ab666d6277c0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LoadBalancerSkuName.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for LoadBalancerSkuName. */ -public final class LoadBalancerSkuName extends ExpandableStringEnum { - /** Static value Basic for LoadBalancerSkuName. */ - public static final LoadBalancerSkuName BASIC = fromString("Basic"); - - /** Static value Standard for LoadBalancerSkuName. */ - public static final LoadBalancerSkuName STANDARD = fromString("Standard"); - - /** - * Creates or finds a LoadBalancerSkuName from its string representation. - * - * @param name a name to look for. - * @return the corresponding LoadBalancerSkuName. - */ - @JsonCreator - public static LoadBalancerSkuName fromString(String name) { - return fromString(name, LoadBalancerSkuName.class); - } - - /** @return known LoadBalancerSkuName values. */ - public static Collection values() { - return values(LoadBalancerSkuName.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LoadBalancerSkuType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LoadBalancerSkuType.java deleted file mode 100644 index c3cbdca7f022..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LoadBalancerSkuType.java +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.network.models; - -import java.util.Collection; -import java.util.HashMap; -import java.util.Locale; -import java.util.Map; - -/** Defines values for LoadBalancerSkuType. */ -public final class LoadBalancerSkuType { - // This needs to be at the beginning for the initialization to happen correctly - private static final Map VALUES_BY_NAME = new HashMap<>(); - - /** Static value Basic for LoadBalancerSkuType. */ - public static final LoadBalancerSkuType BASIC = new LoadBalancerSkuType(LoadBalancerSkuName.BASIC); - - /** Static value Standard for LoadBalancerSkuType. */ - public static final LoadBalancerSkuType STANDARD = new LoadBalancerSkuType(LoadBalancerSkuName.STANDARD); - - /** The actual serialized value for a LoadBalancerSkuType instance. */ - private final LoadBalancerSkuName skuName; - - /** @return predefined LoadBalancer SKU types */ - public static LoadBalancerSkuType[] values() { - Collection valuesCollection = VALUES_BY_NAME.values(); - return valuesCollection.toArray(new LoadBalancerSkuType[valuesCollection.size()]); - } - - /** - * Creates a LoadBalancerSkuType from sku name. - * - * @param skuName the sku name - */ - private LoadBalancerSkuType(LoadBalancerSkuName skuName) { - this.skuName = skuName; - if (skuName != null) { - VALUES_BY_NAME.put(skuName.toString().toLowerCase(Locale.ROOT), this); - } - } - - /** - * Parses a value into a SKU type and creates a new LoadBalancerSkuType instance if not found among the existing - * ones. - * - * @param lbSku a sku - * @return the LoadBalancerSkuType - */ - public static LoadBalancerSkuType fromSku(LoadBalancerSku lbSku) { - if (lbSku == null) { - return null; - } - if (lbSku.name() == null) { - return null; - } - LoadBalancerSkuType result = VALUES_BY_NAME.get(lbSku.name().toString().toLowerCase(Locale.ROOT)); - if (result != null) { - return result; - } else { - return new LoadBalancerSkuType(lbSku.name()); - } - } - - /** @return the LoadBalancerSku associated with the LoadBalancerSkuType. */ - public LoadBalancerSku sku() { - return (new LoadBalancerSku()).withName(this.skuName); - } - - @Override - public int hashCode() { - return skuName.hashCode(); - } - - @Override - public boolean equals(Object obj) { - if (!(obj instanceof LoadBalancerSkuType)) { - return false; - } else if (obj == this) { - return true; - } else if (skuName == null) { - return ((LoadBalancerSkuType) obj).skuName == null; - } else { - return skuName.equals(((LoadBalancerSkuType) obj).skuName); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LoadBalancerTcpProbe.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LoadBalancerTcpProbe.java deleted file mode 100644 index ecf0cd81c2a5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LoadBalancerTcpProbe.java +++ /dev/null @@ -1,219 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.model.Attachable; -import com.azure.resourcemanager.resources.fluentcore.model.Settable; - -/** A client-side representation of a TCP load balancing probe. */ -@Fluent() -public interface LoadBalancerTcpProbe extends LoadBalancerProbe { - - /** Grouping of probe definition stages. */ - interface DefinitionStages { - /** - * The first stage of the probe definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface Blank extends WithPort { - } - - /** - * The stage of the TCP probe definition allowing to specify the port number to monitor. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithPort { - /** - * Specifies the port number to call for health monitoring. - * - * @param port a port number - * @return the next stage of the definition - */ - WithAttach withPort(int port); - } - - /** - * The stage of the TCP probe definition allowing to specify the probe interval. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithIntervalInSeconds { - /** - * Specifies the interval between probes, in seconds. - * - * @param seconds number of seconds - * @return the next stage of the definition - */ - WithAttach withIntervalInSeconds(int seconds); - } - - /** - * The stage of the TCP probe definition allowing to specify the number of unsuccessful probes before failure is - * determined. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithNumberOfProbes { - /** - * Specifies the number of unsuccessful probes before failure is determined. - * - * @param probes number of probes - * @return the next stage of the definition - */ - WithAttach withNumberOfProbes(int probes); - } - - /** - * The final stage of the probe definition. - * - *

    At this stage, any remaining optional settings can be specified, or the probe definition can be attached - * to the parent load balancer definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithAttach - extends Attachable.InDefinition, WithIntervalInSeconds, WithNumberOfProbes { - } - } - - /** - * The entirety of a probe definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithAttach, - DefinitionStages.WithPort { - } - - /** Grouping of probe update stages. */ - interface UpdateStages { - /** The stage of the TCP probe update allowing to modify the port number to monitor. */ - interface WithPort { - /** - * Specifies the port number to call for health monitoring. - * - * @param port a port number - * @return the next stage of the update - */ - Update withPort(int port); - } - - /** The stage of the TCP probe update allowing to modify the probe interval. */ - interface WithIntervalInSeconds { - /** - * Specifies the interval between probes, in seconds. - * - * @param seconds number of seconds - * @return the next stage of the update - */ - Update withIntervalInSeconds(int seconds); - } - - /** - * The stage of the TCP probe update allowing to modify the number of unsuccessful probes before failure is - * determined. - */ - interface WithNumberOfProbes { - /** - * Specifies the number of unsuccessful probes before failure is determined. - * - * @param probes number of probes - * @return the next stage of the update - */ - Update withNumberOfProbes(int probes); - } - } - - /** The entirety of a probe update as part of a load balancer update. */ - interface Update - extends Settable, - UpdateStages.WithPort, - UpdateStages.WithIntervalInSeconds, - UpdateStages.WithNumberOfProbes { - } - - /** Grouping of probe definition stages applicable as part of a load balancer update. */ - interface UpdateDefinitionStages { - /** - * The first stage of the probe definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface Blank extends WithPort { - } - - /** - * The stage of the TCP probe definition allowing to specify the port number to monitor. - * - * @param the parent resource type - */ - interface WithPort { - /** - * Specifies the port number to call for health monitoring. - * - * @param port a port number - * @return the next stage of the definition - */ - WithAttach withPort(int port); - } - - /** - * The stage of the TCP probe definition allowing to specify the probe interval. - * - * @param the parent resource type - */ - interface WithIntervalInSeconds { - /** - * Specifies the interval between probes, in seconds. - * - * @param seconds number of seconds - * @return the next stage of the definition - */ - WithAttach withIntervalInSeconds(int seconds); - } - - /** - * The stage of the TCP probe definition allowing to specify the number of unsuccessful probes before failure is - * determined. - * - * @param the parent resource type - */ - interface WithNumberOfProbes { - /** - * Specifies the number of unsuccessful probes before failure is determined. - * - * @param probes number of probes - * @return the next stage of the definition - */ - WithAttach withNumberOfProbes(int probes); - } - - /** - * The final stage of the probe definition. - * - *

    At this stage, any remaining optional settings can be specified, or the probe definition can be attached - * to the parent load balancer definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithAttach - extends Attachable.InUpdate, WithNumberOfProbes, WithIntervalInSeconds { - } - } - - /** - * The entirety of a probe definition as part of a load balancer update. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface UpdateDefinition - extends UpdateDefinitionStages.Blank, - UpdateDefinitionStages.WithAttach, - UpdateDefinitionStages.WithPort { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LoadBalancers.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LoadBalancers.java deleted file mode 100644 index 07b912a76432..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LoadBalancers.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsBatchDeletion; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsDeletingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsListingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsBatchCreation; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsCreating; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingById; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; - -/** Entry point to load balancer management API in Azure. */ -@Fluent() -public interface LoadBalancers - extends SupportsCreating, - SupportsListing, - SupportsListingByResourceGroup, - SupportsGettingByResourceGroup, - SupportsGettingById, - SupportsDeletingById, - SupportsDeletingByResourceGroup, - SupportsBatchCreation, - SupportsBatchDeletion, - HasManager { -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LoadBalancingRule.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LoadBalancingRule.java deleted file mode 100644 index 9f6fbe9c4767..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LoadBalancingRule.java +++ /dev/null @@ -1,502 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.network.fluent.models.LoadBalancingRuleInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.ChildResource; -import com.azure.resourcemanager.resources.fluentcore.model.Attachable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.model.Settable; -import java.util.Collection; - -/** A client-side representation of an HTTP load balancing rule. */ -@Fluent() -public interface LoadBalancingRule - extends HasInnerModel, - ChildResource, - HasBackendPort, - HasFrontend, - HasFloatingIP, - HasProtocol, - HasFrontendPort { - - /** @return the method of load distribution */ - LoadDistribution loadDistribution(); - - /** @return the number of minutes before an inactive connection is closed */ - int idleTimeoutInMinutes(); - - /** @return the backend associated with the load balancing rule */ - LoadBalancerBackend backend(); - - /** @return the probe associated with the load balancing rule */ - LoadBalancerProbe probe(); - - /** Grouping of load balancing rule definition stages. */ - interface DefinitionStages { - /** - * The first stage of the load balancing rule definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface Blank extends WithProtocol { - } - - /** - * The stage of a load balancing rule definition allowing to specify the transport protocol to apply the rule - * to. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithProtocol - extends HasProtocol.DefinitionStages.WithProtocol, TransportProtocol> { - } - - /** - * The stage of a load balancing rule definition allowing to specify the frontend port to load balance. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithFrontendPort - extends HasFrontendPort.DefinitionStages.WithFrontendPort> { - } - - /** - * The stage of a load balancing rule definition allowing to specify the frontend to associate with the rule. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithFrontend extends HasFrontend.DefinitionStages.WithFrontend> { - } - - /** - * The stage of a load balancing rule definition allowing to specify the probe to associate with the rule. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithProbe { - /** - * Associates the specified existing HTTP or TCP probe of this load balancer with the load balancing rule. - * - * @param name the name of an existing HTTP or TCP probe - * @return the next stage of the definition - */ - WithAttach withProbe(String name); - } - - /** - * The stage of a load balancing rule definition allowing to specify the backend to associate the rule with. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithBackend extends WithVirtualMachine { - /** - * Specifies a backend on this load balancer to send network traffic to. - * - *

    If a backend with the specified name does not yet exist on this load balancer, it will be created - * automatically. - * - * @param backendName the name of a backend - * @return the next stage of the definition - */ - WithBackendPort toBackend(String backendName); - } - - /** - * The stage of a load balancing rule definition allowing to select a set of virtual machines to load balance - * the network traffic among. - * - * @param the next stage of the definition - */ - interface WithVirtualMachine { - /** - * Adds the specified set of virtual machines, assuming they are from the same availability set, to a new - * back end address pool to be associated with this load balancing rule. - * - *

    This will add references to the primary IP configurations of the primary network interfaces of the - * provided set of virtual machines. - * - *

    If the virtual machines are not in the same availability set, they will not be associated with the - * backend. - * - *

    Only those virtual machines will be associated with the load balancer that already have an existing - * network interface. Virtual machines without a network interface will be skipped. - * - * @param vms existing virtual machines - * @return the next stage of the definition - */ - WithBackendPort toExistingVirtualMachines(HasNetworkInterfaces... vms); - - /** - * Adds the specified set of virtual machines, assuming they are from the same availability set, to a new - * back end address pool to be associated with this load balancing rule. - * - *

    This will add references to the primary IP configurations of the primary network interfaces of the - * provided set of virtual machines. - * - *

    If the virtual machines are not in the same availability set, they will not be associated with the - * backend. - * - *

    Only those virtual machines will be associated with the load balancer that already have an existing - * network interface. Virtual machines without a network interface will be skipped. - * - * @param vms existing virtual machines - * @return the next stage of the definition - */ - WithBackendPort toExistingVirtualMachines(Collection vms); - } - - /** - * The stage of a load balancing rule definition allowing to specify the backend port to send the load-balanced - * traffic to. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithBackendPort - extends HasBackendPort.DefinitionStages.WithBackendPort>, WithAttach { - } - - /** - * The final stage of the load balancing rule definition. - * - *

    At this stage, any remaining optional settings can be specified, or the load balancing rule definition can - * be attached to the parent load balancer definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithAttach - extends Attachable.InDefinition, - DefinitionStages.WithFloatingIP, - DefinitionStages.WithIdleTimeoutInMinutes, - DefinitionStages.WithLoadDistribution, - DefinitionStages.WithProbe { - } - - /** - * The stage of a load balancing rule definition allowing to enable the floating IP functionality. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithFloatingIP extends HasFloatingIP.DefinitionStages.WithFloatingIP> { - } - - /** - * The stage of a load balancing rule definition allowing to specify the connection timeout for idle - * connections. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithIdleTimeoutInMinutes { - /** - * Specifies the number of minutes before an idle connection is closed. - * - * @param minutes the desired number of minutes - * @return the next stage of the definition - */ - WithAttach withIdleTimeoutInMinutes(int minutes); - } - - /** - * The stage of a load balancing rule definition allowing to specify the load distribution. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithLoadDistribution { - /** - * Specifies the load distribution mode. - * - * @param loadDistribution a supported load distribution mode - * @return the next stage of the definition - */ - WithAttach withLoadDistribution(LoadDistribution loadDistribution); - } - } - - /** - * The entirety of a load balancing rule definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithAttach, - DefinitionStages.WithProtocol, - DefinitionStages.WithFrontendPort, - DefinitionStages.WithFrontend, - DefinitionStages.WithBackend, - DefinitionStages.WithBackendPort { - } - - /** Grouping of load balancing rule update stages. */ - interface UpdateStages { - /** The stage of a load balancing rule update allowing to modify the transport protocol the rule applies to. */ - interface WithProtocol extends HasProtocol.UpdateStages.WithProtocol { - } - - /** The stage of a load balancing rule update allowing to modify the frontend port. */ - interface WithFrontendPort extends HasFrontendPort.UpdateStages.WithFrontendPort { - } - - /** The stage of a load balancing rule update allowing to modify the frontend reference. */ - interface WithFrontend extends HasFrontend.UpdateStages.WithFrontend { - } - - /** The stage of a load balancing rule update allowing to modify the backend port. */ - interface WithBackendPort extends HasBackendPort.UpdateStages.WithBackendPort { - } - - /** The stage of a load balancing rule update allowing to enable the floating IP functionality. */ - interface WithFloatingIP extends HasFloatingIP.UpdateStages.WithFloatingIP { - } - - /** The stage of a load balancing rule update allowing to modify the connection timeout for idle connections. */ - interface WithIdleTimeoutInMinutes { - /** - * Specifies the number of minutes before an idle connection is closed. - * - * @param minutes the desired number of minutes - * @return the next stage of the update - */ - Update withIdleTimeoutInMinutes(int minutes); - } - - /** The stage of a load balancing rule update allowing to specify the probe to associate with the rule. */ - interface WithProbe { - /** - * Associates the specified existing HTTP or TCP probe of this load balancer with the load balancing rule. - * - * @param name the name of an existing HTTP or TCP probe - * @return the next stage of the update - */ - Update withProbe(String name); - - /** - * Removes any association with a probe and falls back to Azure's default probing mechanism. - * - * @return the next stage of the update - */ - Update withoutProbe(); - } - - /** The stage of a load balancing rule update allowing to modify the load distribution. */ - interface WithLoadDistribution { - /** - * Specifies the load distribution mode. - * - * @param loadDistribution a supported load distribution mode - * @return the next stage of the definition - */ - Update withLoadDistribution(LoadDistribution loadDistribution); - } - } - - /** The entirety of a load balancing rule update as part of a load balancer update. */ - interface Update - extends Settable, - UpdateStages.WithFrontendPort, - UpdateStages.WithFrontend, - UpdateStages.WithProtocol, - UpdateStages.WithBackendPort, - UpdateStages.WithFloatingIP, - UpdateStages.WithIdleTimeoutInMinutes, - UpdateStages.WithLoadDistribution, - UpdateStages.WithProbe { - } - - /** Grouping of load balancing rule definition stages applicable as part of a load balancer update. */ - interface UpdateDefinitionStages { - /** - * The first stage of the load balancing rule definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface Blank extends WithProtocol { - } - - /** - * The stage of a load balancing rule definition allowing to specify the transport protocol to apply the rule - * to. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithProtocol - extends HasProtocol.UpdateDefinitionStages.WithProtocol, TransportProtocol> { - } - - /** - * The stage of a load balancing rule definition allowing to specify the frontend port to load balance. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithFrontendPort - extends HasFrontendPort.UpdateDefinitionStages.WithFrontendPort> { - } - - /** - * The stage of a load balancing rule definition allowing to specify the frontend to associate with the rule. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithFrontend - extends HasFrontend.UpdateDefinitionStages.WithFrontend> { - } - - /** - * The stage of a load balancing rule definition allowing to specify the probe to associate with the rule. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithProbe { - /** - * Associates the specified existing HTTP or TCP probe of this load balancer with the load balancing rule. - * - * @param name the name of an existing HTTP or TCP probe - * @return the next stage of the definition - */ - WithAttach withProbe(String name); - } - - /** - * The stage of a load balancing rule definition allowing to specify the backend to associate the rule with. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithBackend extends WithVirtualMachine { - /** - * Specifies a backend on this load balancer to send network traffic to. - * - *

    If a backend with the specified name does not yet exist, it will be created automatically. - * - * @param backendName the name of an existing backend - * @return the next stage of the definition - */ - WithBackendPort toBackend(String backendName); - } - - /** - * The stage of a load balancing rule definition allowing to select a set of virtual machines to load balance - * the network traffic among. - * - * @param the next stage of the definition - */ - interface WithVirtualMachine { - /** - * Adds the specified set of virtual machines, assuming they are from the same availability set, to a new - * back end address pool to be associated with this load balancing rule. - * - *

    This will add references to the primary IP configurations of the primary network interfaces of the - * provided set of virtual machines. - * - *

    If the virtual machines are not in the same availability set, they will not be associated with the - * backend. - * - *

    Only those virtual machines will be associated with the load balancer that already have an existing - * network interface. Virtual machines without a network interface will be skipped. - * - * @param vms existing virtual machines - * @return the next stage of the definition - */ - WithBackendPort toExistingVirtualMachines(HasNetworkInterfaces... vms); - - /** - * Adds the specified set of virtual machines, assuming they are from the same availability set, to a new - * back end address pool to be associated with this load balancing rule. - * - *

    This will add references to the primary IP configurations of the primary network interfaces of the - * provided set of virtual machines. - * - *

    If the virtual machines are not in the same availability set, they will not be associated with the - * backend. - * - *

    Only those virtual machines will be associated with the load balancer that already have an existing - * network interface. Virtual machines without a network interface will be skipped. - * - * @param vms existing virtual machines - * @return the next stage of the definition - */ - WithBackendPort toExistingVirtualMachines(Collection vms); - } - - /** - * The stage of a load balancing rule definition allowing to specify the backend port to send the load-balanced - * traffic to. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithBackendPort - extends HasBackendPort.UpdateDefinitionStages.WithBackendPort>, WithAttach { - } - - /** - * The stage of a load balancing rule definition allowing to enable the floating IP functionality. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithFloatingIP - extends HasFloatingIP.UpdateDefinitionStages.WithFloatingIP> { - } - - /** - * The stage of a load balancing rule definition allowing to specify the connection timeout for idle - * connections. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithIdleTimeoutInMinutes { - /** - * Specifies the number of minutes before an idle connection is closed. - * - * @param minutes the desired number of minutes - * @return the next stage of the definition - */ - WithAttach withIdleTimeoutInMinutes(int minutes); - } - - /** - * The stage of a load balancing rule definition allowing to specify the load distribution. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithLoadDistribution { - /** - * Specifies the load distribution mode. - * - * @param loadDistribution a supported load distribution mode - * @return the next stage of the definition - */ - WithAttach withLoadDistribution(LoadDistribution loadDistribution); - } - - /** - * The final stage of the load balancing rule definition. - * - *

    At this stage, any remaining optional settings can be specified, or the load balancing rule definition can - * be attached to the parent load balancer definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithAttach - extends Attachable.InUpdate, - UpdateDefinitionStages.WithFloatingIP, - UpdateDefinitionStages.WithIdleTimeoutInMinutes, - UpdateDefinitionStages.WithLoadDistribution, - UpdateDefinitionStages.WithProbe { - } - } - - /** - * The entirety of a load balancing rule definition as part of a load balancer update. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface UpdateDefinition - extends UpdateDefinitionStages.Blank, - UpdateDefinitionStages.WithAttach, - UpdateDefinitionStages.WithProtocol, - UpdateDefinitionStages.WithFrontendPort, - UpdateDefinitionStages.WithFrontend, - UpdateDefinitionStages.WithBackend, - UpdateDefinitionStages.WithBackendPort { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LoadDistribution.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LoadDistribution.java deleted file mode 100644 index d65b5c262871..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LoadDistribution.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for LoadDistribution. */ -public final class LoadDistribution extends ExpandableStringEnum { - /** Static value Default for LoadDistribution. */ - public static final LoadDistribution DEFAULT = fromString("Default"); - - /** Static value SourceIP for LoadDistribution. */ - public static final LoadDistribution SOURCE_IP = fromString("SourceIP"); - - /** Static value SourceIPProtocol for LoadDistribution. */ - public static final LoadDistribution SOURCE_IPPROTOCOL = fromString("SourceIPProtocol"); - - /** - * Creates or finds a LoadDistribution from its string representation. - * - * @param name a name to look for. - * @return the corresponding LoadDistribution. - */ - @JsonCreator - public static LoadDistribution fromString(String name) { - return fromString(name, LoadDistribution.class); - } - - /** @return known LoadDistribution values. */ - public static Collection values() { - return values(LoadDistribution.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LocalNetworkGateway.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LocalNetworkGateway.java deleted file mode 100644 index 8ead6c3c9d6f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LocalNetworkGateway.java +++ /dev/null @@ -1,166 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.network.fluent.models.LocalNetworkGatewayInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.GroupableResource; -import com.azure.resourcemanager.resources.fluentcore.arm.models.Resource; -import com.azure.resourcemanager.resources.fluentcore.model.Appliable; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; -import com.azure.resourcemanager.resources.fluentcore.model.Updatable; -import java.util.Set; - -/** Entry point for Local Network Gateway management API in Azure. */ -@Fluent -public interface LocalNetworkGateway - extends GroupableResource, - Refreshable, - Updatable, - UpdatableWithTags { - - // Getters - - /** @return IP address of local network gateway */ - String ipAddress(); - - /** @return local network gateway's BGP speaker settings */ - BgpSettings bgpSettings(); - - /** @return local network site address spaces */ - Set addressSpaces(); - - /** @return the provisioning state of the LocalNetworkGateway resource */ - String provisioningState(); - - /** The entirety of the local network gateway definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithGroup, - DefinitionStages.WithIPAddress, - DefinitionStages.WithCreate { - } - - /** Grouping of local network gateway definition stages. */ - interface DefinitionStages { - /** The first stage of a local network gateway definition. */ - interface Blank extends GroupableResource.DefinitionWithRegion { - } - - /** The stage of the local network gateway definition allowing to specify the resource group. */ - interface WithGroup extends GroupableResource.DefinitionStages.WithGroup { - } - - /** - * The stage of the local network gateway definition allowing to specify IP address of local network gateway. - */ - interface WithIPAddress { - /** - * Specifies the IP address of the local network gateway. - * - * @param ipAddress an IP address - * @return the next stage of the definition - */ - WithAddressSpace withIPAddress(String ipAddress); - } - - /** The stage of the local network gateway definition allowing to specify the address space. */ - interface WithAddressSpace { - /** - * Adds address space. Note: this method's effect is additive, i.e. each time it is used, a new address - * space is added to the network. - * - * @param cidr the CIDR representation of the local network site address space - * @return the next stage of the definition - */ - WithCreate withAddressSpace(String cidr); - } - - /** The stage of definition allowing to specify local network gateway's BGP speaker settings. */ - interface WithBgp { - /** - * Enables BGP. - * - * @param asn the BGP speaker's ASN - * @param bgpPeeringAddress the BGP peering address and BGP identifier of this BGP speaker - * @return the next stage of the definition - */ - WithCreate withBgp(long asn, String bgpPeeringAddress); - } - - /** - * The stage of the local network gateway definition which contains all the minimum required inputs for the - * resource to be created (via {@link WithCreate#create()}). - */ - interface WithCreate - extends Creatable, - Resource.DefinitionWithTags, - DefinitionStages.WithAddressSpace, - DefinitionStages.WithBgp { - } - } - - /** Grouping of local network gateway update stages. */ - interface UpdateStages { - /** The stage of the local network gateway update allowing to change IP address of local network gateway. */ - interface WithIPAddress { - /** - * Specifies the IP address. - * - * @param ipAddress the IP address - * @return the next stage of the update - */ - Update withIPAddress(String ipAddress); - } - - /** The stage of the local network gateway update allowing to specify the address spaces. */ - interface WithAddressSpace { - /** - * Adds address space. Note: this method's effect is additive, i.e. each time it is used, a new address - * space is added to the network. - * - * @param cidr the CIDR representation of the local network site address space - * @return the next stage of the update - */ - Update withAddressSpace(String cidr); - - /** - * Remove address space. Note: address space will be removed only in case of exact cidr string match. - * - * @param cidr the CIDR representation of the local network site address space - * @return the next stage of the update - */ - Update withoutAddressSpace(String cidr); - } - - /** The stage of update allowing to specify local network gateway's BGP speaker settings. */ - interface WithBgp { - /** - * Enables BGP. - * - * @param asn the BGP speaker's ASN - * @param bgpPeeringAddress the BGP peering address and BGP identifier of this BGP speaker - * @return the next stage of the update - */ - Update withBgp(long asn, String bgpPeeringAddress); - - /** - * Disables BGP. - * - * @return the next stage of the update - */ - Update withoutBgp(); - } - } - - /** The template for a local network gateway update operation, containing all the settings that can be modified. */ - interface Update - extends Appliable, - Resource.UpdateWithTags, - UpdateStages.WithIPAddress, - UpdateStages.WithAddressSpace, - UpdateStages.WithBgp { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LocalNetworkGatewayListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LocalNetworkGatewayListResult.java deleted file mode 100644 index ebf2c6e0bfcb..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LocalNetworkGatewayListResult.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.LocalNetworkGatewayInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Response for ListLocalNetworkGateways API service call. */ -@Fluent -public final class LocalNetworkGatewayListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LocalNetworkGatewayListResult.class); - - /* - * A list of local network gateways that exists in a resource group. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to get the next set of results. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: A list of local network gateways that exists in a resource group. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: A list of local network gateways that exists in a resource group. - * - * @param value the value value to set. - * @return the LocalNetworkGatewayListResult object itself. - */ - public LocalNetworkGatewayListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to get the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LocalNetworkGateways.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LocalNetworkGateways.java deleted file mode 100644 index 063f0e5c7596..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LocalNetworkGateways.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsDeletingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsListingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsCreating; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingById; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; - -/** Entry point to local network gateways management API in Azure. */ -@Fluent -public interface LocalNetworkGateways - extends SupportsCreating, - SupportsListing, - SupportsListingByResourceGroup, - SupportsGettingByResourceGroup, - SupportsGettingById, - SupportsDeletingById, - SupportsDeletingByResourceGroup, - HasManager { -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LogSpecification.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LogSpecification.java deleted file mode 100644 index c029f2b3693e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/LogSpecification.java +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Description of logging specification. */ -@Fluent -public final class LogSpecification { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LogSpecification.class); - - /* - * The name of the specification. - */ - @JsonProperty(value = "name") - private String name; - - /* - * The display name of the specification. - */ - @JsonProperty(value = "displayName") - private String displayName; - - /* - * Duration of the blob. - */ - @JsonProperty(value = "blobDuration") - private String blobDuration; - - /** - * Get the name property: The name of the specification. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the specification. - * - * @param name the name value to set. - * @return the LogSpecification object itself. - */ - public LogSpecification withName(String name) { - this.name = name; - return this; - } - - /** - * Get the displayName property: The display name of the specification. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Set the displayName property: The display name of the specification. - * - * @param displayName the displayName value to set. - * @return the LogSpecification object itself. - */ - public LogSpecification withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - - /** - * Get the blobDuration property: Duration of the blob. - * - * @return the blobDuration value. - */ - public String blobDuration() { - return this.blobDuration; - } - - /** - * Set the blobDuration property: Duration of the blob. - * - * @param blobDuration the blobDuration value to set. - * @return the LogSpecification object itself. - */ - public LogSpecification withBlobDuration(String blobDuration) { - this.blobDuration = blobDuration; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ManagedServiceIdentity.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ManagedServiceIdentity.java deleted file mode 100644 index 2a4b6898007e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ManagedServiceIdentity.java +++ /dev/null @@ -1,137 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** Identity for the resource. */ -@Fluent -public class ManagedServiceIdentity { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedServiceIdentity.class); - - /* - * The principal id of the system assigned identity. This property will - * only be provided for a system assigned identity. - */ - @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) - private String principalId; - - /* - * The tenant id of the system assigned identity. This property will only - * be provided for a system assigned identity. - */ - @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) - private String tenantId; - - /* - * The type of identity used for the resource. The type 'SystemAssigned, - * UserAssigned' includes both an implicitly created identity and a set of - * user assigned identities. The type 'None' will remove any identities - * from the virtual machine. - */ - @JsonProperty(value = "type") - private ResourceIdentityType type; - - /* - * The list of user identities associated with resource. The user identity - * dictionary key references will be ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - */ - @JsonProperty(value = "userAssignedIdentities") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map userAssignedIdentities; - - /** - * Get the principalId property: The principal id of the system assigned identity. This property will only be - * provided for a system assigned identity. - * - * @return the principalId value. - */ - public String principalId() { - return this.principalId; - } - - /** - * Get the tenantId property: The tenant id of the system assigned identity. This property will only be provided for - * a system assigned identity. - * - * @return the tenantId value. - */ - public String tenantId() { - return this.tenantId; - } - - /** - * Get the type property: The type of identity used for the resource. The type 'SystemAssigned, UserAssigned' - * includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove - * any identities from the virtual machine. - * - * @return the type value. - */ - public ResourceIdentityType type() { - return this.type; - } - - /** - * Set the type property: The type of identity used for the resource. The type 'SystemAssigned, UserAssigned' - * includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove - * any identities from the virtual machine. - * - * @param type the type value to set. - * @return the ManagedServiceIdentity object itself. - */ - public ManagedServiceIdentity withType(ResourceIdentityType type) { - this.type = type; - return this; - } - - /** - * Get the userAssignedIdentities property: The list of user identities associated with resource. The user identity - * dictionary key references will be ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - * - * @return the userAssignedIdentities value. - */ - public Map userAssignedIdentities() { - return this.userAssignedIdentities; - } - - /** - * Set the userAssignedIdentities property: The list of user identities associated with resource. The user identity - * dictionary key references will be ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - * - * @param userAssignedIdentities the userAssignedIdentities value to set. - * @return the ManagedServiceIdentity object itself. - */ - public ManagedServiceIdentity withUserAssignedIdentities( - Map userAssignedIdentities) { - this.userAssignedIdentities = userAssignedIdentities; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (userAssignedIdentities() != null) { - userAssignedIdentities() - .values() - .forEach( - e -> { - if (e != null) { - e.validate(); - } - }); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ManagedServiceIdentityUserAssignedIdentities.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ManagedServiceIdentityUserAssignedIdentities.java deleted file mode 100644 index bfd38529894d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ManagedServiceIdentityUserAssignedIdentities.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The ManagedServiceIdentityUserAssignedIdentities model. */ -@Immutable -public final class ManagedServiceIdentityUserAssignedIdentities { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(ManagedServiceIdentityUserAssignedIdentities.class); - - /* - * The principal id of user assigned identity. - */ - @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) - private String principalId; - - /* - * The client id of user assigned identity. - */ - @JsonProperty(value = "clientId", access = JsonProperty.Access.WRITE_ONLY) - private String clientId; - - /** - * Get the principalId property: The principal id of user assigned identity. - * - * @return the principalId value. - */ - public String principalId() { - return this.principalId; - } - - /** - * Get the clientId property: The client id of user assigned identity. - * - * @return the clientId value. - */ - public String clientId() { - return this.clientId; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/MatchedRule.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/MatchedRule.java deleted file mode 100644 index 7c2877ae986f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/MatchedRule.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Matched rule. */ -@Fluent -public final class MatchedRule { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MatchedRule.class); - - /* - * Name of the matched network security rule. - */ - @JsonProperty(value = "ruleName") - private String ruleName; - - /* - * The network traffic is allowed or denied. Possible values are 'Allow' - * and 'Deny'. - */ - @JsonProperty(value = "action") - private String action; - - /** - * Get the ruleName property: Name of the matched network security rule. - * - * @return the ruleName value. - */ - public String ruleName() { - return this.ruleName; - } - - /** - * Set the ruleName property: Name of the matched network security rule. - * - * @param ruleName the ruleName value to set. - * @return the MatchedRule object itself. - */ - public MatchedRule withRuleName(String ruleName) { - this.ruleName = ruleName; - return this; - } - - /** - * Get the action property: The network traffic is allowed or denied. Possible values are 'Allow' and 'Deny'. - * - * @return the action value. - */ - public String action() { - return this.action; - } - - /** - * Set the action property: The network traffic is allowed or denied. Possible values are 'Allow' and 'Deny'. - * - * @param action the action value to set. - * @return the MatchedRule object itself. - */ - public MatchedRule withAction(String action) { - this.action = action; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/MetricSpecification.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/MetricSpecification.java deleted file mode 100644 index af1867e04732..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/MetricSpecification.java +++ /dev/null @@ -1,395 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Description of metrics specification. */ -@Fluent -public final class MetricSpecification { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MetricSpecification.class); - - /* - * The name of the metric. - */ - @JsonProperty(value = "name") - private String name; - - /* - * The display name of the metric. - */ - @JsonProperty(value = "displayName") - private String displayName; - - /* - * The description of the metric. - */ - @JsonProperty(value = "displayDescription") - private String displayDescription; - - /* - * Units the metric to be displayed in. - */ - @JsonProperty(value = "unit") - private String unit; - - /* - * The aggregation type. - */ - @JsonProperty(value = "aggregationType") - private String aggregationType; - - /* - * List of availability. - */ - @JsonProperty(value = "availabilities") - private List availabilities; - - /* - * Whether regional MDM account enabled. - */ - @JsonProperty(value = "enableRegionalMdmAccount") - private Boolean enableRegionalMdmAccount; - - /* - * Whether gaps would be filled with zeros. - */ - @JsonProperty(value = "fillGapWithZero") - private Boolean fillGapWithZero; - - /* - * Pattern for the filter of the metric. - */ - @JsonProperty(value = "metricFilterPattern") - private String metricFilterPattern; - - /* - * List of dimensions. - */ - @JsonProperty(value = "dimensions") - private List dimensions; - - /* - * Whether the metric is internal. - */ - @JsonProperty(value = "isInternal") - private Boolean isInternal; - - /* - * The source MDM account. - */ - @JsonProperty(value = "sourceMdmAccount") - private String sourceMdmAccount; - - /* - * The source MDM namespace. - */ - @JsonProperty(value = "sourceMdmNamespace") - private String sourceMdmNamespace; - - /* - * The resource Id dimension name override. - */ - @JsonProperty(value = "resourceIdDimensionNameOverride") - private String resourceIdDimensionNameOverride; - - /** - * Get the name property: The name of the metric. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the metric. - * - * @param name the name value to set. - * @return the MetricSpecification object itself. - */ - public MetricSpecification withName(String name) { - this.name = name; - return this; - } - - /** - * Get the displayName property: The display name of the metric. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Set the displayName property: The display name of the metric. - * - * @param displayName the displayName value to set. - * @return the MetricSpecification object itself. - */ - public MetricSpecification withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - - /** - * Get the displayDescription property: The description of the metric. - * - * @return the displayDescription value. - */ - public String displayDescription() { - return this.displayDescription; - } - - /** - * Set the displayDescription property: The description of the metric. - * - * @param displayDescription the displayDescription value to set. - * @return the MetricSpecification object itself. - */ - public MetricSpecification withDisplayDescription(String displayDescription) { - this.displayDescription = displayDescription; - return this; - } - - /** - * Get the unit property: Units the metric to be displayed in. - * - * @return the unit value. - */ - public String unit() { - return this.unit; - } - - /** - * Set the unit property: Units the metric to be displayed in. - * - * @param unit the unit value to set. - * @return the MetricSpecification object itself. - */ - public MetricSpecification withUnit(String unit) { - this.unit = unit; - return this; - } - - /** - * Get the aggregationType property: The aggregation type. - * - * @return the aggregationType value. - */ - public String aggregationType() { - return this.aggregationType; - } - - /** - * Set the aggregationType property: The aggregation type. - * - * @param aggregationType the aggregationType value to set. - * @return the MetricSpecification object itself. - */ - public MetricSpecification withAggregationType(String aggregationType) { - this.aggregationType = aggregationType; - return this; - } - - /** - * Get the availabilities property: List of availability. - * - * @return the availabilities value. - */ - public List availabilities() { - return this.availabilities; - } - - /** - * Set the availabilities property: List of availability. - * - * @param availabilities the availabilities value to set. - * @return the MetricSpecification object itself. - */ - public MetricSpecification withAvailabilities(List availabilities) { - this.availabilities = availabilities; - return this; - } - - /** - * Get the enableRegionalMdmAccount property: Whether regional MDM account enabled. - * - * @return the enableRegionalMdmAccount value. - */ - public Boolean enableRegionalMdmAccount() { - return this.enableRegionalMdmAccount; - } - - /** - * Set the enableRegionalMdmAccount property: Whether regional MDM account enabled. - * - * @param enableRegionalMdmAccount the enableRegionalMdmAccount value to set. - * @return the MetricSpecification object itself. - */ - public MetricSpecification withEnableRegionalMdmAccount(Boolean enableRegionalMdmAccount) { - this.enableRegionalMdmAccount = enableRegionalMdmAccount; - return this; - } - - /** - * Get the fillGapWithZero property: Whether gaps would be filled with zeros. - * - * @return the fillGapWithZero value. - */ - public Boolean fillGapWithZero() { - return this.fillGapWithZero; - } - - /** - * Set the fillGapWithZero property: Whether gaps would be filled with zeros. - * - * @param fillGapWithZero the fillGapWithZero value to set. - * @return the MetricSpecification object itself. - */ - public MetricSpecification withFillGapWithZero(Boolean fillGapWithZero) { - this.fillGapWithZero = fillGapWithZero; - return this; - } - - /** - * Get the metricFilterPattern property: Pattern for the filter of the metric. - * - * @return the metricFilterPattern value. - */ - public String metricFilterPattern() { - return this.metricFilterPattern; - } - - /** - * Set the metricFilterPattern property: Pattern for the filter of the metric. - * - * @param metricFilterPattern the metricFilterPattern value to set. - * @return the MetricSpecification object itself. - */ - public MetricSpecification withMetricFilterPattern(String metricFilterPattern) { - this.metricFilterPattern = metricFilterPattern; - return this; - } - - /** - * Get the dimensions property: List of dimensions. - * - * @return the dimensions value. - */ - public List dimensions() { - return this.dimensions; - } - - /** - * Set the dimensions property: List of dimensions. - * - * @param dimensions the dimensions value to set. - * @return the MetricSpecification object itself. - */ - public MetricSpecification withDimensions(List dimensions) { - this.dimensions = dimensions; - return this; - } - - /** - * Get the isInternal property: Whether the metric is internal. - * - * @return the isInternal value. - */ - public Boolean isInternal() { - return this.isInternal; - } - - /** - * Set the isInternal property: Whether the metric is internal. - * - * @param isInternal the isInternal value to set. - * @return the MetricSpecification object itself. - */ - public MetricSpecification withIsInternal(Boolean isInternal) { - this.isInternal = isInternal; - return this; - } - - /** - * Get the sourceMdmAccount property: The source MDM account. - * - * @return the sourceMdmAccount value. - */ - public String sourceMdmAccount() { - return this.sourceMdmAccount; - } - - /** - * Set the sourceMdmAccount property: The source MDM account. - * - * @param sourceMdmAccount the sourceMdmAccount value to set. - * @return the MetricSpecification object itself. - */ - public MetricSpecification withSourceMdmAccount(String sourceMdmAccount) { - this.sourceMdmAccount = sourceMdmAccount; - return this; - } - - /** - * Get the sourceMdmNamespace property: The source MDM namespace. - * - * @return the sourceMdmNamespace value. - */ - public String sourceMdmNamespace() { - return this.sourceMdmNamespace; - } - - /** - * Set the sourceMdmNamespace property: The source MDM namespace. - * - * @param sourceMdmNamespace the sourceMdmNamespace value to set. - * @return the MetricSpecification object itself. - */ - public MetricSpecification withSourceMdmNamespace(String sourceMdmNamespace) { - this.sourceMdmNamespace = sourceMdmNamespace; - return this; - } - - /** - * Get the resourceIdDimensionNameOverride property: The resource Id dimension name override. - * - * @return the resourceIdDimensionNameOverride value. - */ - public String resourceIdDimensionNameOverride() { - return this.resourceIdDimensionNameOverride; - } - - /** - * Set the resourceIdDimensionNameOverride property: The resource Id dimension name override. - * - * @param resourceIdDimensionNameOverride the resourceIdDimensionNameOverride value to set. - * @return the MetricSpecification object itself. - */ - public MetricSpecification withResourceIdDimensionNameOverride(String resourceIdDimensionNameOverride) { - this.resourceIdDimensionNameOverride = resourceIdDimensionNameOverride; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (availabilities() != null) { - availabilities().forEach(e -> e.validate()); - } - if (dimensions() != null) { - dimensions().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/Network.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/Network.java deleted file mode 100644 index 7e2274a16300..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/Network.java +++ /dev/null @@ -1,368 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.network.fluent.models.VirtualNetworkInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.GroupableResource; -import com.azure.resourcemanager.resources.fluentcore.arm.models.Resource; -import com.azure.resourcemanager.resources.fluentcore.model.Appliable; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; -import com.azure.resourcemanager.resources.fluentcore.model.Updatable; -import java.util.List; -import java.util.Map; - -/** Entry point for Virtual Network management API in Azure. */ -@Fluent() -public interface Network - extends GroupableResource, - Refreshable, - Updatable, - UpdatableWithTags { - - /** - * Checks if the specified private IP address is available in this network. - * - * @param ipAddress an IP address from this network's address space - * @return true if the address is within this network's address space and is available - */ - boolean isPrivateIPAddressAvailable(String ipAddress); - - /** - * Checks if the specified private IP address is within this network's address space. - * - * @param ipAddress an IP address - * @return true if the specified IP address is within this network's address space, otherwise false - */ - boolean isPrivateIPAddressInNetwork(String ipAddress); - - /** @return list of address spaces associated with this virtual network, in the CIDR notation */ - List addressSpaces(); - - /** @return list of DNS server IP addresses associated with this virtual network */ - List dnsServerIPs(); - - /** - * @return subnets of this virtual network as a map indexed by subnet name - *

    Note that when a virtual network is created with no subnets explicitly defined, a default subnet is - * automatically created with the name "subnet1". - */ - Map subnets(); - - /** @return entry point to managing virtual network peerings for this network */ - NetworkPeerings peerings(); - - /** - * @return whether DDoS protection is enabled for all the protected resources in the virtual network. It requires a - * DDoS protection plan associated with the resource. - */ - boolean isDdosProtectionEnabled(); - - /** - * @return whether VM protection is enabled for all the subnets in the virtual network - * @deprecated use {@link Network#isDdosProtectionEnabled()} - * */ - @Deprecated - boolean isVmProtectionEnabled(); - - /** @return the DDoS protection plan id associated with the virtual network */ - String ddosProtectionPlanId(); - - /** The entirety of the virtual network definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithGroup, - DefinitionStages.WithSubnet, - DefinitionStages.WithCreate, - DefinitionStages.WithCreateAndSubnet { - } - - /** Grouping of virtual network definition stages. */ - interface DefinitionStages { - /** The first stage of a virtual network definition. */ - interface Blank extends GroupableResource.DefinitionWithRegion { - } - - /** The stage of the virtual network definition allowing to specify the resource group. */ - interface WithGroup extends GroupableResource.DefinitionStages.WithGroup { - } - - /** The stage of the virtual network definition allowing to add subnets. */ - interface WithSubnet { - /** - * Explicitly adds a subnet to the virtual network. - * - *

    If no subnets are explicitly specified, a default subnet called "subnet1" covering the entire first - * address space will be created. - * - *

    Note this method's effect is additive, i.e. each time it is used, a new subnet is added to the - * network. - * - * @param name the name to assign to the subnet - * @param cidr the address space of the subnet, within the address space of the network, using the CIDR - * notation - * @return the next stage of the definition - */ - DefinitionStages.WithCreateAndSubnet withSubnet(String name, String cidr); - - /** - * Explicitly defines subnets in the virtual network based on the provided map. - * - * @param nameCidrPairs a {@link Map} of CIDR addresses for the subnets, indexed by the name of each subnet - * to be defined - * @return the next stage of the definition - */ - DefinitionStages.WithCreateAndSubnet withSubnets(Map nameCidrPairs); - - /** - * Begins the definition of a new subnet to add to the virtual network. - * - *

    The definition must be completed with a call to {@link Subnet.DefinitionStages.WithAttach#attach()} - * - * @param name the name of the subnet - * @return the first stage of the new subnet definition - */ - Subnet.DefinitionStages.Blank defineSubnet(String name); - } - - /** The stage of the virtual network definition allowing to specify DDoS protection plan. */ - interface WithDdosProtectionPlan { - /** - * Creates a new DDoS protection plan in the same region and group as the virtual network and associates it - * with the resource. The internal name the DDoS protection plan will be derived from the resource's name. - * - * @return the next stage of the definition - */ - WithCreateAndSubnet withNewDdosProtectionPlan(); - - /** - * Associates existing DDoS protection plan with the virtual network. - * - * @param planId DDoS protection plan resource id - * @return the next stage of the definition - */ - WithCreateAndSubnet withExistingDdosProtectionPlan(String planId); - } - - /** - * The stage of the virtual network definition allowing to enable VM protection for all the subnets in the - * virtual network. - */ - interface WithVmProtection { - /** - * Enable VM protection for all the subnets in the virtual network. - * - * @return the next stage of the definition - * @deprecated use withNewDdosProtectionPlan() or withExistingDdosProtectionPlan() - */ - @Deprecated - WithCreateAndSubnet withVmProtection(); - } - - /** - * The stage of the virtual network definition which contains all the minimum required inputs for the resource - * to be created, but also allows for any other optional settings to be specified, except for adding subnets. - * - *

    Subnets can be added only right after the address space is explicitly specified. - */ - interface WithCreate - extends Creatable, - Resource.DefinitionWithTags, - DefinitionStages.WithDdosProtectionPlan, - DefinitionStages.WithVmProtection { - - /** - * Specifies the IP address of an existing DNS server to associate with the virtual network. - * - *

    Note this method's effect is additive, i.e. each time it is used, a new dns server is added to the - * network. - * - * @param ipAddress the IP address of the DNS server - * @return the next stage of the definition - */ - WithCreate withDnsServer(String ipAddress); - - /** - * Explicitly adds an address space to the virtual network. - * - *

    If no address spaces are explicitly specified, a default address space with the CIDR "10.0.0.0/16" - * will be assigned to the virtual network. - * - *

    Note that this method's effect is additive, i.e. each time it is used, a new address space is added to - * the network. This method does not check for conflicts or overlaps with other address spaces. If there is - * a conflict, a cloud exception may be thrown at the time the network is created. - * - * @param cidr the CIDR representation of the address space - * @return the next stage of the definition - */ - WithCreateAndSubnet withAddressSpace(String cidr); - } - - /** - * The stage of the public IP definition which contains all the minimum required inputs for the resource to be - * created (via {@link WithCreate#create()}), but also allows for any other optional settings to be specified, - * including adding subnets. - */ - interface WithCreateAndSubnet extends DefinitionStages.WithCreate, DefinitionStages.WithSubnet { - } - } - - /** Grouping of virtual network update stages. */ - interface UpdateStages { - /** The stage of the virtual network update allowing to add or remove subnets. */ - interface WithSubnet { - /** - * Explicitly adds a subnet to the virtual network. - * - *

    Note this method's effect is additive, i.e. each time it is used, a new subnet is added to the - * network. - * - * @param name the name to assign to the subnet - * @param cidr the address space of the subnet, within the address space of the network, using the CIDR - * notation - * @return the next stage of the virtual network update - */ - Update withSubnet(String name, String cidr); - - /** - * Explicitly defines all the subnets in the virtual network based on the provided map. - * - *

    This replaces any previously existing subnets. - * - * @param nameCidrPairs a {@link Map} of CIDR addresses for the subnets, indexed by the name of each subnet - * to be added - * @return the next stage of the virtual network update - */ - Update withSubnets(Map nameCidrPairs); - - /** - * Removes a subnet from the virtual network. - * - * @param name name of the subnet to remove - * @return the next stage of the virtual network update - */ - Update withoutSubnet(String name); - - /** - * Begins the description of an update of an existing subnet of this network. - * - * @param name the name of an existing subnet - * @return the first stage of the subnet update description - */ - Subnet.Update updateSubnet(String name); - - /** - * Begins the definition of a new subnet to be added to this virtual network. - * - * @param name the name of the new subnet - * @return the first stage of the new subnet definition - */ - Subnet.UpdateDefinitionStages.Blank defineSubnet(String name); - } - - /** The stage of the virtual network update allowing to specify the DNS server. */ - interface WithDnsServer { - /** - * Specifies the IP address of the DNS server to associate with the virtual network. - * - *

    Note this method's effect is additive, i.e. each time it is used, a new DNS server is added to the - * network - * - * @param ipAddress the IP address of the DNS server - * @return the next stage of the virtual network update - */ - Update withDnsServer(String ipAddress); - } - - /** The stage of the virtual network update allowing to specify the address space. */ - interface WithAddressSpace { - /** - * Explicitly adds an address space to the virtual network. - * - *

    Note this method's effect is additive, i.e. each time it is used, a new address space is added to the - * network. - * - *

    This method does not check for conflicts or overlaps with other address spaces. If there is a - * conflict, a cloud exception may be thrown after the update is applied. - * - * @param cidr the CIDR representation of the address space - * @return the next stage of the update - */ - Update withAddressSpace(String cidr); - - /** - * Removes the specified address space from the virtual network, assuming it's not in use bu any of the - * subnets. - * - * @param cidr the address space to remove, in CIDR format, matching exactly one of the CIDRs associated - * with this network - * @return the next stage of the update - */ - Update withoutAddressSpace(String cidr); - } - - /** The stage of the virtual network update allowing to specify DDoS protection plan. */ - interface WithDdosProtectionPlan { - /** - * Creates a new DDoS protection plan in the same region and group as the virtual network and associates it - * with the resource. The internal name the DDoS protection plan will be derived from the resource's name. - * - * @return the next stage of the update - */ - Update withNewDdosProtectionPlan(); - - /** - * Associates existing DDoS protection plan with the virtual network. - * - * @param planId DDoS protection plan resource id - * @return the next stage of the update - */ - Update withExistingDdosProtectionPlan(String planId); - - /** - * Disassociates DDoS protection plan and disables Standard DDoS protection for this virtual network. Note: - * Plan resource is not deleted from Azure. - * - * @return the next stage of the update - */ - Update withoutDdosProtectionPlan(); - } - - /** - * The stage of the virtual network update allowing to enable/disable VM protection for all the subnets in the - * virtual network. - */ - interface WithVmProtection { - /** - * Enable VM protection for all the subnets in the virtual network. - * - * @return the next stage of the update - * @deprecated use withNewDdosProtectionPlan() or withExistingDdosProtectionPlan() - */ - @Deprecated - Update withVmProtection(); - - /** - * Disable VM protection for all the subnets in the virtual network. - * - * @return the next stage of the update - * @deprecated use withoutDdosProtectionPlan() - */ - @Deprecated - Update withoutVmProtection(); - } - } - - /** The template for a virtual network update operation, containing all the settings that can be modified. */ - interface Update - extends Appliable, - Resource.UpdateWithTags, - UpdateStages.WithSubnet, - UpdateStages.WithDnsServer, - UpdateStages.WithAddressSpace, - UpdateStages.WithDdosProtectionPlan, - UpdateStages.WithVmProtection { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkConfigurationDiagnosticParameters.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkConfigurationDiagnosticParameters.java deleted file mode 100644 index 5e9d222da836..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkConfigurationDiagnosticParameters.java +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Parameters to get network configuration diagnostic. */ -@Fluent -public final class NetworkConfigurationDiagnosticParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkConfigurationDiagnosticParameters.class); - - /* - * The ID of the target resource to perform network configuration - * diagnostic. Valid options are VM, NetworkInterface, - * VMSS/NetworkInterface and Application Gateway. - */ - @JsonProperty(value = "targetResourceId", required = true) - private String targetResourceId; - - /* - * Verbosity level. Accepted values are 'Normal', 'Minimum', 'Full'. - */ - @JsonProperty(value = "verbosityLevel") - private VerbosityLevel verbosityLevel; - - /* - * List of network configuration diagnostic profiles. - */ - @JsonProperty(value = "profiles", required = true) - private List profiles; - - /** - * Get the targetResourceId property: The ID of the target resource to perform network configuration diagnostic. - * Valid options are VM, NetworkInterface, VMSS/NetworkInterface and Application Gateway. - * - * @return the targetResourceId value. - */ - public String targetResourceId() { - return this.targetResourceId; - } - - /** - * Set the targetResourceId property: The ID of the target resource to perform network configuration diagnostic. - * Valid options are VM, NetworkInterface, VMSS/NetworkInterface and Application Gateway. - * - * @param targetResourceId the targetResourceId value to set. - * @return the NetworkConfigurationDiagnosticParameters object itself. - */ - public NetworkConfigurationDiagnosticParameters withTargetResourceId(String targetResourceId) { - this.targetResourceId = targetResourceId; - return this; - } - - /** - * Get the verbosityLevel property: Verbosity level. Accepted values are 'Normal', 'Minimum', 'Full'. - * - * @return the verbosityLevel value. - */ - public VerbosityLevel verbosityLevel() { - return this.verbosityLevel; - } - - /** - * Set the verbosityLevel property: Verbosity level. Accepted values are 'Normal', 'Minimum', 'Full'. - * - * @param verbosityLevel the verbosityLevel value to set. - * @return the NetworkConfigurationDiagnosticParameters object itself. - */ - public NetworkConfigurationDiagnosticParameters withVerbosityLevel(VerbosityLevel verbosityLevel) { - this.verbosityLevel = verbosityLevel; - return this; - } - - /** - * Get the profiles property: List of network configuration diagnostic profiles. - * - * @return the profiles value. - */ - public List profiles() { - return this.profiles; - } - - /** - * Set the profiles property: List of network configuration diagnostic profiles. - * - * @param profiles the profiles value to set. - * @return the NetworkConfigurationDiagnosticParameters object itself. - */ - public NetworkConfigurationDiagnosticParameters withProfiles(List profiles) { - this.profiles = profiles; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (targetResourceId() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property targetResourceId in model" - + " NetworkConfigurationDiagnosticParameters")); - } - if (profiles() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property profiles in model NetworkConfigurationDiagnosticParameters")); - } else { - profiles().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkConfigurationDiagnosticProfile.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkConfigurationDiagnosticProfile.java deleted file mode 100644 index 2fcac88504e5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkConfigurationDiagnosticProfile.java +++ /dev/null @@ -1,189 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Parameters to compare with network configuration. */ -@Fluent -public final class NetworkConfigurationDiagnosticProfile { - @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkConfigurationDiagnosticProfile.class); - - /* - * The direction of the traffic. Accepted values are 'Inbound' and - * 'Outbound'. - */ - @JsonProperty(value = "direction", required = true) - private Direction direction; - - /* - * Protocol to be verified on. Accepted values are '*', TCP, UDP. - */ - @JsonProperty(value = "protocol", required = true) - private String protocol; - - /* - * Traffic source. Accepted values are '*', IP Address/CIDR, Service Tag. - */ - @JsonProperty(value = "source", required = true) - private String source; - - /* - * Traffic destination. Accepted values are: '*', IP Address/CIDR, Service - * Tag. - */ - @JsonProperty(value = "destination", required = true) - private String destination; - - /* - * Traffic destination port. Accepted values are '*', port (for example, - * 3389) and port range (for example, 80-100). - */ - @JsonProperty(value = "destinationPort", required = true) - private String destinationPort; - - /** - * Get the direction property: The direction of the traffic. Accepted values are 'Inbound' and 'Outbound'. - * - * @return the direction value. - */ - public Direction direction() { - return this.direction; - } - - /** - * Set the direction property: The direction of the traffic. Accepted values are 'Inbound' and 'Outbound'. - * - * @param direction the direction value to set. - * @return the NetworkConfigurationDiagnosticProfile object itself. - */ - public NetworkConfigurationDiagnosticProfile withDirection(Direction direction) { - this.direction = direction; - return this; - } - - /** - * Get the protocol property: Protocol to be verified on. Accepted values are '*', TCP, UDP. - * - * @return the protocol value. - */ - public String protocol() { - return this.protocol; - } - - /** - * Set the protocol property: Protocol to be verified on. Accepted values are '*', TCP, UDP. - * - * @param protocol the protocol value to set. - * @return the NetworkConfigurationDiagnosticProfile object itself. - */ - public NetworkConfigurationDiagnosticProfile withProtocol(String protocol) { - this.protocol = protocol; - return this; - } - - /** - * Get the source property: Traffic source. Accepted values are '*', IP Address/CIDR, Service Tag. - * - * @return the source value. - */ - public String source() { - return this.source; - } - - /** - * Set the source property: Traffic source. Accepted values are '*', IP Address/CIDR, Service Tag. - * - * @param source the source value to set. - * @return the NetworkConfigurationDiagnosticProfile object itself. - */ - public NetworkConfigurationDiagnosticProfile withSource(String source) { - this.source = source; - return this; - } - - /** - * Get the destination property: Traffic destination. Accepted values are: '*', IP Address/CIDR, Service Tag. - * - * @return the destination value. - */ - public String destination() { - return this.destination; - } - - /** - * Set the destination property: Traffic destination. Accepted values are: '*', IP Address/CIDR, Service Tag. - * - * @param destination the destination value to set. - * @return the NetworkConfigurationDiagnosticProfile object itself. - */ - public NetworkConfigurationDiagnosticProfile withDestination(String destination) { - this.destination = destination; - return this; - } - - /** - * Get the destinationPort property: Traffic destination port. Accepted values are '*', port (for example, 3389) and - * port range (for example, 80-100). - * - * @return the destinationPort value. - */ - public String destinationPort() { - return this.destinationPort; - } - - /** - * Set the destinationPort property: Traffic destination port. Accepted values are '*', port (for example, 3389) and - * port range (for example, 80-100). - * - * @param destinationPort the destinationPort value to set. - * @return the NetworkConfigurationDiagnosticProfile object itself. - */ - public NetworkConfigurationDiagnosticProfile withDestinationPort(String destinationPort) { - this.destinationPort = destinationPort; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (direction() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property direction in model NetworkConfigurationDiagnosticProfile")); - } - if (protocol() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property protocol in model NetworkConfigurationDiagnosticProfile")); - } - if (source() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property source in model NetworkConfigurationDiagnosticProfile")); - } - if (destination() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property destination in model NetworkConfigurationDiagnosticProfile")); - } - if (destinationPort() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property destinationPort in model NetworkConfigurationDiagnosticProfile")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkConfigurationDiagnosticResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkConfigurationDiagnosticResult.java deleted file mode 100644 index 4f2da705b122..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkConfigurationDiagnosticResult.java +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Network configuration diagnostic result corresponded to provided traffic query. */ -@Fluent -public final class NetworkConfigurationDiagnosticResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkConfigurationDiagnosticResult.class); - - /* - * Parameters to compare with network configuration. - */ - @JsonProperty(value = "profile") - private NetworkConfigurationDiagnosticProfile profile; - - /* - * Network configuration diagnostic result corresponded provided traffic - * query. - */ - @JsonProperty(value = "networkSecurityGroupResult") - private NetworkSecurityGroupResult networkSecurityGroupResult; - - /** - * Get the profile property: Parameters to compare with network configuration. - * - * @return the profile value. - */ - public NetworkConfigurationDiagnosticProfile profile() { - return this.profile; - } - - /** - * Set the profile property: Parameters to compare with network configuration. - * - * @param profile the profile value to set. - * @return the NetworkConfigurationDiagnosticResult object itself. - */ - public NetworkConfigurationDiagnosticResult withProfile(NetworkConfigurationDiagnosticProfile profile) { - this.profile = profile; - return this; - } - - /** - * Get the networkSecurityGroupResult property: Network configuration diagnostic result corresponded provided - * traffic query. - * - * @return the networkSecurityGroupResult value. - */ - public NetworkSecurityGroupResult networkSecurityGroupResult() { - return this.networkSecurityGroupResult; - } - - /** - * Set the networkSecurityGroupResult property: Network configuration diagnostic result corresponded provided - * traffic query. - * - * @param networkSecurityGroupResult the networkSecurityGroupResult value to set. - * @return the NetworkConfigurationDiagnosticResult object itself. - */ - public NetworkConfigurationDiagnosticResult withNetworkSecurityGroupResult( - NetworkSecurityGroupResult networkSecurityGroupResult) { - this.networkSecurityGroupResult = networkSecurityGroupResult; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (profile() != null) { - profile().validate(); - } - if (networkSecurityGroupResult() != null) { - networkSecurityGroupResult().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkInterface.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkInterface.java deleted file mode 100644 index 84f1a5cb888d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkInterface.java +++ /dev/null @@ -1,596 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.network.fluent.models.NetworkInterfaceInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.GroupableResource; -import com.azure.resourcemanager.resources.fluentcore.arm.models.Resource; -import com.azure.resourcemanager.resources.fluentcore.model.Accepted; -import com.azure.resourcemanager.resources.fluentcore.model.Appliable; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; -import com.azure.resourcemanager.resources.fluentcore.model.Updatable; -import java.util.Map; - -/** Network interface. */ -@Fluent -public interface NetworkInterface - extends NetworkInterfaceBase, - GroupableResource, - Refreshable, - Updatable, - UpdatableWithTags { - /** @return the IP configurations of this network interface, indexed by their names. */ - Map ipConfigurations(); - - /** @return the primary IP configuration of this network interface */ - NicIpConfiguration primaryIPConfiguration(); - - /** The entirety of the network interface definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithGroup, - DefinitionStages.WithPrimaryNetwork, - DefinitionStages.WithPrimaryNetworkSubnet, - DefinitionStages.WithPrimaryPrivateIP, - DefinitionStages.WithCreate { - } - - /** Grouping of network interface definition stages. */ - interface DefinitionStages { - /** The stage of the network interface definition allowing to associate it with a load balancer. */ - interface WithLoadBalancer { - /** - * Associates the network interface's primary IP configuration with a backend of an existing load balancer. - * - * @param loadBalancer an existing load balancer - * @param backendName the name of an existing backend on that load balancer - * @return the next stage of the definition - */ - WithCreate withExistingLoadBalancerBackend(LoadBalancer loadBalancer, String backendName); - - /** - * Associates the network interface's primary IP configuration with an inbound NAT rule of an existing load - * balancer. - * - * @param loadBalancer an existing load balancer - * @param inboundNatRuleName the name of an existing inbound NAT rule on the selected load balancer - * @return the next stage of the definition - */ - WithCreate withExistingLoadBalancerInboundNatRule(LoadBalancer loadBalancer, String inboundNatRuleName); - } - - /** The first stage of the network interface. */ - interface Blank extends GroupableResource.DefinitionWithRegion { - } - - /** The stage of the network interface definition allowing to specify the resource group. */ - interface WithGroup extends GroupableResource.DefinitionStages.WithGroup { - } - - /** - * The stage of the network interface definition allowing to specify the virtual network for primary IP - * configuration. - */ - interface WithPrimaryNetwork { - /** - * Create a new virtual network to associate with the network interface's primary IP configuration, based on - * the provided definition. - * - * @param creatable a creatable definition for a new virtual network - * @return the next stage of the definition - */ - WithPrimaryPrivateIP withNewPrimaryNetwork(Creatable creatable); - - /** - * Creates a new virtual network to associate with the network interface's primary IP configuration. - * - *

    The virtual network will be created in the same resource group and region as of network interface, it - * will be created with the specified address space and a default subnet covering the entirety of the - * network IP address space. - * - * @param name the name of the new virtual network - * @param addressSpace the address space for rhe virtual network - * @return the next stage of the definition - */ - WithPrimaryPrivateIP withNewPrimaryNetwork(String name, String addressSpace); - - /** - * Creates a new virtual network to associate with the network interface's primary IP configuration. - * - *

    The virtual network will be created in the same resource group and region as of network interface, it - * will be created with the specified address space and a default subnet covering the entirety of the - * network IP address space. - * - * @param addressSpace the address space for the virtual network - * @return the next stage of the definition - */ - WithPrimaryPrivateIP withNewPrimaryNetwork(String addressSpace); - - /** - * Associate an existing virtual network with the network interface's primary IP configuration. - * - * @param network an existing virtual network - * @return the next stage of the definition - */ - WithPrimaryNetworkSubnet withExistingPrimaryNetwork(Network network); - } - - /** The stage of the network interface definition allowing to specify subnet. */ - interface WithPrimaryNetworkSubnet { - /** - * Associate a subnet with the network interface's primary IP configuration. - * - * @param name the subnet name - * @return the next stage of the definition - */ - WithPrimaryPrivateIP withSubnet(String name); - } - - /** - * The stage of the network interface definition allowing to specify private IP address within a virtual network - * subnet. - */ - interface WithPrimaryPrivateIP { - /** - * Enables dynamic private IP address allocation within the specified existing virtual network subnet for - * the network interface's primary IP configuration. - * - * @return the next stage of network interface definition - */ - WithCreate withPrimaryPrivateIPAddressDynamic(); - - /** - * Assigns the specified static private IP address within the specified existing virtual network subnet to - * the network interface's primary IP configuration. - * - * @param staticPrivateIPAddress the static IP address within the specified subnet to assign to the network - * interface - * @return the next stage of network interface definition - */ - WithCreate withPrimaryPrivateIPAddressStatic(String staticPrivateIPAddress); - } - - /** - * The stage of the network interface definition allowing to associate public IP address with it's primary IP - * configuration. - */ - interface WithPrimaryPublicIPAddress { - /** - * Create a new public IP address to associate with network interface's primary IP configuration, based on - * the provided definition. - * - * @param creatable a creatable definition for a new public IP - * @return the next stage of the definition - */ - WithCreate withNewPrimaryPublicIPAddress(Creatable creatable); - - /** - * Creates a new public IP address in the same region and group as the resource and associate it with the - * network interface's primary IP configuration. - * - *

    the internal name and DNS label for the public IP address will be derived from the network interface - * name - * - * @return the next stage of the definition - */ - WithCreate withNewPrimaryPublicIPAddress(); - - /** - * Creates a new public IP address in the same region and group as the resource, with the specified DNS - * label and associate it with the network interface's primary IP configuration. - * - *

    the internal name for the public IP address will be derived from the DNS label - * - * @param leafDnsLabel the leaf domain label - * @return the next stage of the definition - */ - WithCreate withNewPrimaryPublicIPAddress(String leafDnsLabel); - - /** - * Associates an existing public IP address with the network interface's primary IP configuration. - * - * @param publicIPAddress an existing public IP address - * @return the next stage of the definition - */ - WithCreate withExistingPrimaryPublicIPAddress(PublicIpAddress publicIPAddress); - } - - /** The stage of the network interface definition allowing to associate a network security group. */ - interface WithNetworkSecurityGroup { - /** - * Create a new network security group to associate with network interface, based on the provided - * definition. - * - * @param creatable a creatable definition for a new network security group - * @return the next stage of the definition - */ - WithCreate withNewNetworkSecurityGroup(Creatable creatable); - - /** - * Associates an existing network security group with the network interface. - * - * @param networkSecurityGroup an existing network security group - * @return the next stage of the definition - */ - WithCreate withExistingNetworkSecurityGroup(NetworkSecurityGroup networkSecurityGroup); - } - - /** The stage of the network interface definition allowing to associate a application security group. */ - interface WithApplicationSecurityGroup { - /** - * Associates an existing application security group with the network interface. - * - * @param applicationSecurityGroup an existing application security group - * @return the next stage of the definition - */ - WithCreate withExistingApplicationSecurityGroup(ApplicationSecurityGroup applicationSecurityGroup); - } - - /** The stage of the network interface definition allowing to associate a secondary IP configurations. */ - interface WithSecondaryIPConfiguration { - /** - * Starts definition of a secondary IP configuration. - * - * @param name name for the IP configuration - * @return the first stage of a secondary IP configuration definition - */ - NicIpConfiguration.DefinitionStages.Blank defineSecondaryIPConfiguration(String name); - } - - /** The stage of the network interface definition allowing to enable accelerated networking. */ - interface WithAcceleratedNetworking { - /** - * Enables accelerated networking. - * - *

    Note that additional steps need to be taken in the virtual machine itself for the virtual machine - * associated with this network interface to be able to take advantage of accelerated networking. This - * feature might not be available in some regions, virtual machine sizes, or operating system versions. It - * can be enabled only during the creation of a network interface, not during an update. - * - * @return the next stage of the definition - */ - WithCreate withAcceleratedNetworking(); - } - - /** - * The stage of the network interface definition which contains all the minimum required inputs for the resource - * to be created, but also allows for any other optional settings to be specified. - */ - interface WithCreate - extends Creatable, - Resource.DefinitionWithTags, - WithPrimaryPublicIPAddress, - WithNetworkSecurityGroup, - WithSecondaryIPConfiguration, - WithAcceleratedNetworking, - WithLoadBalancer, - WithApplicationSecurityGroup { - /** - * Enables IP forwarding in the network interface. - * - * @return the next stage of the definition - */ - WithCreate withIPForwarding(); - - /** - * Specifies the IP address of the custom DNS server to associate with the network interface. - * - *

    Note this method's effect is additive, i.e. each time it is used, the new dns server is added to the - * network interface. - * - * @param ipAddress the IP address of the DNS server - * @return the next stage of the definition - */ - WithCreate withDnsServer(String ipAddress); - - /** - * Specifies the internal DNS name label for the network interface. - * - * @param dnsNameLabel the internal DNS name label - * @return the next stage of the definition - */ - WithCreate withInternalDnsNameLabel(String dnsNameLabel); - - /** - * Begins creating the network interface resource. - * - * @return the accepted create operation - */ - Accepted beginCreate(); - } - } - - /** Grouping of network interface update stages. */ - interface UpdateStages { - /** The stage of the network interface update allowing to specify subnet. */ - interface WithPrimaryNetworkSubnet { - /** - * Associate a subnet with the network interface. - * - * @param name the subnet name - * @return the next stage of the network interface update - */ - Update withSubnet(String name); - } - - /** - * The stage of the network interface update allowing to specify private IP address within a virtual network - * subnet. - */ - interface WithPrimaryPrivateIP { - /** - * Enables dynamic private IP address allocation within the specified existing virtual network subnet for - * the network interface's primary IP configuration. - * - * @return the next stage of network interface update - */ - Update withPrimaryPrivateIPAddressDynamic(); - - /** - * Assigns the specified static private IP address within the specified existing virtual network subnet to - * the network interface's primary IP configuration. - * - * @param staticPrivateIPAddress the static IP address within the specified subnet to assign to the primary - * IP configuration - * @return the next stage of network interface update - */ - Update withPrimaryPrivateIPAddressStatic(String staticPrivateIPAddress); - } - - /** - * The stage of the network interface update allowing to associate public IP address with it's primary IP - * configuration. - */ - interface WithPrimaryPublicIPAddress { - /** - * Create a new public IP address to associate the network interface's primary IP configuration, based on - * the provided definition. - * - *

    if there is public IP associated with the primary IP configuration then that will be removed in favour - * of this - * - * @param creatable a creatable definition for a new public IP - * @return the next stage of the network interface update - */ - Update withNewPrimaryPublicIPAddress(Creatable creatable); - - /** - * Creates a new public IP address in the same region and group as the resource and associate it with the - * network interface's primary IP configuration. - * - *

    the internal name and DNS label for the public IP address will be derived from the network interface - * name, if there is an existing public IP association then that will be removed in favour of this - * - * @return the next stage of the network interface update - */ - Update withNewPrimaryPublicIPAddress(); - - /** - * Creates a new public IP address in the same region and group as the resource, with the specified DNS - * label and associate it with the network interface's primary IP configuration. - * - *

    the internal name for the public IP address will be derived from the DNS label, if there is an - * existing public IP association then that will be removed in favour of this - * - * @param leafDnsLabel the leaf domain label - * @return the next stage of the network interface update - */ - Update withNewPrimaryPublicIPAddress(String leafDnsLabel); - - /** - * Specifies that remove any public IP associated with the network interface's primary IP configuration. - * - * @return the next stage of the network interface update - */ - Update withoutPrimaryPublicIPAddress(); - - /** - * Associates an existing public IP address with the network interface's primary IP configuration. if there - * is an existing public IP association then that will be removed in favour of this - * - * @param publicIPAddress an existing public IP address - * @return the next stage of the network interface update - */ - Update withExistingPrimaryPublicIPAddress(PublicIpAddress publicIPAddress); - } - - /** The stage of the network interface update allowing to associate network security group. */ - interface WithNetworkSecurityGroup { - /** - * Create a new network security group to associate with network interface, based on the provided - * definition. - * - * @param creatable a creatable definition for a new network security group - * @return the next stage of the network interface update - */ - Update withNewNetworkSecurityGroup(Creatable creatable); - - /** - * Associates an existing network security group with the network interface. - * - * @param networkSecurityGroup an existing network security group - * @return the next stage of the network interface update - */ - Update withExistingNetworkSecurityGroup(NetworkSecurityGroup networkSecurityGroup); - - /** - * Specifies that remove any network security group associated with the network interface. - * - * @return the next stage of the network interface update - */ - Update withoutNetworkSecurityGroup(); - } - - /** The stage of the network interface update allowing to associate a application security group. */ - interface WithApplicationSecurityGroup { - /** - * Associates an existing application security group with the network interface. - * - * @param applicationSecurityGroup an existing application security group - * @return the next stage of the update - */ - Update withExistingApplicationSecurityGroup(ApplicationSecurityGroup applicationSecurityGroup); - - /** - * Removes the application security group from the network interface. - * - * @param applicationSecurityGroupName the name of the application security group - * @return the next stage of the update - */ - Update withoutApplicationSecurityGroup(String applicationSecurityGroupName); - } - - /** The stage of the network interface update allowing to enable or disable IP forwarding. */ - interface WithIPForwarding { - /** - * Enable IP forwarding in the network interface. - * - * @return the next stage of the network interface update - */ - Update withIPForwarding(); - - /** - * Disable IP forwarding in the network interface. - * - * @return the next stage of the network interface update - */ - Update withoutIPForwarding(); - } - - /** The stage of the network interface update allowing to specify DNS servers. */ - interface WithDnsServer { - /** - * Specifies the IP address of the custom DNS server to associate with the network interface. - * - *

    Note this method's effect is additive, i.e. each time it is used, the new dns server is added to the - * network interface. - * - * @param ipAddress the IP address of the DNS server - * @return the next stage of the network interface update - */ - Update withDnsServer(String ipAddress); - - /** - * Removes a DNS server associated with the network interface. - * - * @param ipAddress the IP address of the DNS server - * @return the next stage of the network interface update - */ - Update withoutDnsServer(String ipAddress); - - /** - * Specifies to use the default Azure DNS server for the network interface. - * - *

    Using azure DNS server will remove any custom DNS server associated with this network interface. - * - * @return the next stage of the network interface update - */ - Update withAzureDnsServer(); - } - - /** The stage of the network interface update allowing to configure IP configuration. */ - interface WithIPConfiguration { - /** - * Starts definition of a secondary IP configuration. - * - * @param name name for the IP configuration - * @return the first stage of the update - */ - NicIpConfiguration.UpdateDefinitionStages.Blank defineSecondaryIPConfiguration( - String name); - - /** - * Starts update of an IP configuration. - * - * @param name name of the IP configuration - * @return the first stage of the update - */ - NicIpConfiguration.Update updateIPConfiguration(String name); - - /** - * Removes the specified IP configuration. - * - * @param name the name of an existing IP configuration - * @return the next stage of the update - */ - Update withoutIPConfiguration(String name); - } - - /** The stage of the network interface definition allowing to specify accelerated networking. */ - interface WithAcceleratedNetworking { - /** - * Enables accelerated networking. - *

    - * Note that additional steps need to be taken in the virtual machine itself for the virtual machine - * associated with this network interface to be able to take advantage of accelerated networking. - * This feature might not be available in some regions, virtual machine sizes, or operating system versions. - * It cannot be enabled if it has already been attached to a running virtual machine. - * @return the next stage of the update - */ - Update withAcceleratedNetworking(); - - /** - * Disables accelerated networking. - * - * @return the next stage of the update - */ - Update withoutAcceleratedNetworking(); - } - - /** The stage of the network interface update allowing to associate it with a load balancer. */ - interface WithLoadBalancer { - /** - * Associates the network interface's primary IP configuration with a backend of an existing load balancer. - * - * @param loadBalancer an existing load balancer - * @param backendName the name of an existing backend on that load balancer - * @return the next stage of the update - */ - Update withExistingLoadBalancerBackend(LoadBalancer loadBalancer, String backendName); - - /** - * Associates the network interface's primary IP configuration with an inbound NAT rule of an existing load - * balancer. - * - * @param loadBalancer an existing load balancer - * @param inboundNatRuleName the name of an existing inbound NAT rule on the selected load balancer - * @return the next stage of the update - */ - Update withExistingLoadBalancerInboundNatRule(LoadBalancer loadBalancer, String inboundNatRuleName); - - /** - * Removes all the existing associations with any load balancer backends. - * - * @return the next stage of the update - */ - Update withoutLoadBalancerBackends(); - - /** - * Removes all the existing associations with any load balancer inbound NAT rules. - * - * @return the next stage of the update - */ - Update withoutLoadBalancerInboundNatRules(); - } - } - - /** The template for an update operation, containing all the settings that can be modified. */ - interface Update - extends Appliable, - Resource.UpdateWithTags, - UpdateStages.WithPrimaryNetworkSubnet, - UpdateStages.WithPrimaryPrivateIP, - UpdateStages.WithPrimaryPublicIPAddress, - UpdateStages.WithNetworkSecurityGroup, - UpdateStages.WithIPForwarding, - UpdateStages.WithDnsServer, - UpdateStages.WithIPConfiguration, - UpdateStages.WithLoadBalancer, - UpdateStages.WithAcceleratedNetworking, - UpdateStages.WithApplicationSecurityGroup { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkInterfaceAssociation.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkInterfaceAssociation.java deleted file mode 100644 index 9ef0c7994b36..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkInterfaceAssociation.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.SecurityRuleInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Network interface and its custom security rules. */ -@Fluent -public final class NetworkInterfaceAssociation { - @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkInterfaceAssociation.class); - - /* - * Network interface ID. - */ - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) - private String id; - - /* - * Collection of custom security rules. - */ - @JsonProperty(value = "securityRules") - private List securityRules; - - /** - * Get the id property: Network interface ID. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Get the securityRules property: Collection of custom security rules. - * - * @return the securityRules value. - */ - public List securityRules() { - return this.securityRules; - } - - /** - * Set the securityRules property: Collection of custom security rules. - * - * @param securityRules the securityRules value to set. - * @return the NetworkInterfaceAssociation object itself. - */ - public NetworkInterfaceAssociation withSecurityRules(List securityRules) { - this.securityRules = securityRules; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (securityRules() != null) { - securityRules().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkInterfaceBase.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkInterfaceBase.java deleted file mode 100644 index 7b8e471f2fa3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkInterfaceBase.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.network.fluent.models.NetworkInterfaceInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import java.util.List; - -/** The base network interface shared across regular and virtual machine scale set network interface. */ -@Fluent -public interface NetworkInterfaceBase extends HasManager, HasInnerModel { - - /** @return true if accelerated networking is enabled for this network interface */ - boolean isAcceleratedNetworkingEnabled(); - - /** @return true if IP forwarding is enabled in this network interface */ - boolean isIPForwardingEnabled(); - - /** @return the MAC Address of the network interface */ - String macAddress(); - - /** @return the Internal DNS name assigned to this network interface */ - String internalDnsNameLabel(); - - /** - * Gets the fully qualified domain name of this network interface. - * - *

    A network interface receives FQDN as a part of assigning it to a virtual machine. - * - * @return the qualified domain name - */ - String internalFqdn(); - - /** @return the internal domain name suffix */ - String internalDomainNameSuffix(); - - /** @return IP addresses of this network interface's DNS servers */ - List dnsServers(); - - /** @return applied DNS servers */ - List appliedDnsServers(); - - /** @return the network security group resource id associated with this network interface */ - String networkSecurityGroupId(); - - /** - * Gets the network security group associated this network interface. - * - *

    This method makes a rest API call to fetch the Network Security Group resource. - * - * @return the network security group associated with this network interface. - */ - NetworkSecurityGroup getNetworkSecurityGroup(); - - /** @return the resource ID of the associated virtual machine, or null if none. */ - String virtualMachineId(); - - /** - * Gets the private IP address allocated to this network interface's primary IP configuration. - * - *

    The private IP will be within the virtual network subnet of this network interface. - * - * @return the private IP addresses - */ - String primaryPrivateIP(); - - /** - * @return the private IP allocation method (Dynamic, Static) of this network interface's primary IP configuration. - */ - IpAllocationMethod primaryPrivateIpAllocationMethod(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkInterfaceDnsSettings.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkInterfaceDnsSettings.java deleted file mode 100644 index 06b36854bb1e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkInterfaceDnsSettings.java +++ /dev/null @@ -1,181 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** DNS settings of a network interface. */ -@Fluent -public final class NetworkInterfaceDnsSettings { - @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkInterfaceDnsSettings.class); - - /* - * List of DNS servers IP addresses. Use 'AzureProvidedDNS' to switch to - * azure provided DNS resolution. 'AzureProvidedDNS' value cannot be - * combined with other IPs, it must be the only value in dnsServers - * collection. - */ - @JsonProperty(value = "dnsServers") - private List dnsServers; - - /* - * If the VM that uses this NIC is part of an Availability Set, then this - * list will have the union of all DNS servers from all NICs that are part - * of the Availability Set. This property is what is configured on each of - * those VMs. - */ - @JsonProperty(value = "appliedDnsServers") - private List appliedDnsServers; - - /* - * Relative DNS name for this NIC used for internal communications between - * VMs in the same virtual network. - */ - @JsonProperty(value = "internalDnsNameLabel") - private String internalDnsNameLabel; - - /* - * Fully qualified DNS name supporting internal communications between VMs - * in the same virtual network. - */ - @JsonProperty(value = "internalFqdn") - private String internalFqdn; - - /* - * Even if internalDnsNameLabel is not specified, a DNS entry is created - * for the primary NIC of the VM. This DNS name can be constructed by - * concatenating the VM name with the value of internalDomainNameSuffix. - */ - @JsonProperty(value = "internalDomainNameSuffix") - private String internalDomainNameSuffix; - - /** - * Get the dnsServers property: List of DNS servers IP addresses. Use 'AzureProvidedDNS' to switch to azure provided - * DNS resolution. 'AzureProvidedDNS' value cannot be combined with other IPs, it must be the only value in - * dnsServers collection. - * - * @return the dnsServers value. - */ - public List dnsServers() { - return this.dnsServers; - } - - /** - * Set the dnsServers property: List of DNS servers IP addresses. Use 'AzureProvidedDNS' to switch to azure provided - * DNS resolution. 'AzureProvidedDNS' value cannot be combined with other IPs, it must be the only value in - * dnsServers collection. - * - * @param dnsServers the dnsServers value to set. - * @return the NetworkInterfaceDnsSettings object itself. - */ - public NetworkInterfaceDnsSettings withDnsServers(List dnsServers) { - this.dnsServers = dnsServers; - return this; - } - - /** - * Get the appliedDnsServers property: If the VM that uses this NIC is part of an Availability Set, then this list - * will have the union of all DNS servers from all NICs that are part of the Availability Set. This property is what - * is configured on each of those VMs. - * - * @return the appliedDnsServers value. - */ - public List appliedDnsServers() { - return this.appliedDnsServers; - } - - /** - * Set the appliedDnsServers property: If the VM that uses this NIC is part of an Availability Set, then this list - * will have the union of all DNS servers from all NICs that are part of the Availability Set. This property is what - * is configured on each of those VMs. - * - * @param appliedDnsServers the appliedDnsServers value to set. - * @return the NetworkInterfaceDnsSettings object itself. - */ - public NetworkInterfaceDnsSettings withAppliedDnsServers(List appliedDnsServers) { - this.appliedDnsServers = appliedDnsServers; - return this; - } - - /** - * Get the internalDnsNameLabel property: Relative DNS name for this NIC used for internal communications between - * VMs in the same virtual network. - * - * @return the internalDnsNameLabel value. - */ - public String internalDnsNameLabel() { - return this.internalDnsNameLabel; - } - - /** - * Set the internalDnsNameLabel property: Relative DNS name for this NIC used for internal communications between - * VMs in the same virtual network. - * - * @param internalDnsNameLabel the internalDnsNameLabel value to set. - * @return the NetworkInterfaceDnsSettings object itself. - */ - public NetworkInterfaceDnsSettings withInternalDnsNameLabel(String internalDnsNameLabel) { - this.internalDnsNameLabel = internalDnsNameLabel; - return this; - } - - /** - * Get the internalFqdn property: Fully qualified DNS name supporting internal communications between VMs in the - * same virtual network. - * - * @return the internalFqdn value. - */ - public String internalFqdn() { - return this.internalFqdn; - } - - /** - * Set the internalFqdn property: Fully qualified DNS name supporting internal communications between VMs in the - * same virtual network. - * - * @param internalFqdn the internalFqdn value to set. - * @return the NetworkInterfaceDnsSettings object itself. - */ - public NetworkInterfaceDnsSettings withInternalFqdn(String internalFqdn) { - this.internalFqdn = internalFqdn; - return this; - } - - /** - * Get the internalDomainNameSuffix property: Even if internalDnsNameLabel is not specified, a DNS entry is created - * for the primary NIC of the VM. This DNS name can be constructed by concatenating the VM name with the value of - * internalDomainNameSuffix. - * - * @return the internalDomainNameSuffix value. - */ - public String internalDomainNameSuffix() { - return this.internalDomainNameSuffix; - } - - /** - * Set the internalDomainNameSuffix property: Even if internalDnsNameLabel is not specified, a DNS entry is created - * for the primary NIC of the VM. This DNS name can be constructed by concatenating the VM name with the value of - * internalDomainNameSuffix. - * - * @param internalDomainNameSuffix the internalDomainNameSuffix value to set. - * @return the NetworkInterfaceDnsSettings object itself. - */ - public NetworkInterfaceDnsSettings withInternalDomainNameSuffix(String internalDomainNameSuffix) { - this.internalDomainNameSuffix = internalDomainNameSuffix; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkInterfaceIpConfigurationListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkInterfaceIpConfigurationListResult.java deleted file mode 100644 index ec95b3bb1593..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkInterfaceIpConfigurationListResult.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.NetworkInterfaceIpConfigurationInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Response for list ip configurations API service call. */ -@Fluent -public final class NetworkInterfaceIpConfigurationListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkInterfaceIpConfigurationListResult.class); - - /* - * A list of ip configurations. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to get the next set of results. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: A list of ip configurations. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: A list of ip configurations. - * - * @param value the value value to set. - * @return the NetworkInterfaceIpConfigurationListResult object itself. - */ - public NetworkInterfaceIpConfigurationListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to get the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkInterfaceListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkInterfaceListResult.java deleted file mode 100644 index e623a1414cfb..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkInterfaceListResult.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.NetworkInterfaceInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Response for the ListNetworkInterface API service call. */ -@Fluent -public final class NetworkInterfaceListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkInterfaceListResult.class); - - /* - * A list of network interfaces in a resource group. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to get the next set of results. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: A list of network interfaces in a resource group. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: A list of network interfaces in a resource group. - * - * @param value the value value to set. - * @return the NetworkInterfaceListResult object itself. - */ - public NetworkInterfaceListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to get the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkInterfaceLoadBalancerListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkInterfaceLoadBalancerListResult.java deleted file mode 100644 index 031b1a0b20ce..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkInterfaceLoadBalancerListResult.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.LoadBalancerInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Response for list ip configurations API service call. */ -@Fluent -public final class NetworkInterfaceLoadBalancerListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkInterfaceLoadBalancerListResult.class); - - /* - * A list of load balancers. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to get the next set of results. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: A list of load balancers. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: A list of load balancers. - * - * @param value the value value to set. - * @return the NetworkInterfaceLoadBalancerListResult object itself. - */ - public NetworkInterfaceLoadBalancerListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to get the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkInterfaceTapConfigurationListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkInterfaceTapConfigurationListResult.java deleted file mode 100644 index 714feb28c54c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkInterfaceTapConfigurationListResult.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.NetworkInterfaceTapConfigurationInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Response for list tap configurations API service call. */ -@Fluent -public final class NetworkInterfaceTapConfigurationListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkInterfaceTapConfigurationListResult.class); - - /* - * A list of tap configurations. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to get the next set of results. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: A list of tap configurations. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: A list of tap configurations. - * - * @param value the value value to set. - * @return the NetworkInterfaceTapConfigurationListResult object itself. - */ - public NetworkInterfaceTapConfigurationListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to get the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkInterfaces.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkInterfaces.java deleted file mode 100644 index d71c2dce8ed9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkInterfaces.java +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsBatchDeletion; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsDeletingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsListingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsBatchCreation; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsCreating; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingById; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; -import com.azure.resourcemanager.resources.fluentcore.model.Accepted; - -/** Entry point to network interface management. */ -@Fluent -public interface NetworkInterfaces - extends SupportsCreating, - SupportsListing, - SupportsListingByResourceGroup, - SupportsGettingByResourceGroup, - SupportsGettingById, - SupportsDeletingById, - SupportsDeletingByResourceGroup, - SupportsBatchCreation, - SupportsBatchDeletion, - HasManager { - - /** - * Gets a network interface associated with a virtual machine scale set instance. - * - * @param resourceGroupName virtual machine scale set resource group name - * @param scaleSetName scale set name - * @param instanceId the virtual machine scale set vm instance id - * @param name the network interface name - * @return network interface - */ - VirtualMachineScaleSetNetworkInterface getByVirtualMachineScaleSetInstanceId( - String resourceGroupName, String scaleSetName, String instanceId, String name); - - /** - * List the network interfaces associated with a virtual machine scale set. - * - * @param resourceGroupName virtual machine scale set resource group name - * @param scaleSetName scale set name - * @return list of network interfaces - */ - PagedIterable listByVirtualMachineScaleSet( - String resourceGroupName, String scaleSetName); - - /** - * List the network interfaces associated with a virtual machine scale set. - * - * @param id virtual machine scale set resource id - * @return list of network interfaces - */ - PagedIterable listByVirtualMachineScaleSetId(String id); - - /** - * List the network interfaces associated with a specific virtual machine instance in a scale set. - * - * @param resourceGroupName virtual machine scale set resource group name - * @param scaleSetName scale set name - * @param instanceId the virtual machine scale set vm instance id - * @return list of network interfaces - */ - PagedIterable listByVirtualMachineScaleSetInstanceId( - String resourceGroupName, String scaleSetName, String instanceId); - - /** - * List the network interfaces associated with a specific virtual machine instance in a scale set asynchronously. - * - * @param resourceGroupName virtual machine scale set resource group name - * @param scaleSetName scale set name - * @param instanceId the virtual machine scale set vm instance id - * @return list of network interfaces - */ - PagedFlux listByVirtualMachineScaleSetInstanceIdAsync( - String resourceGroupName, String scaleSetName, String instanceId); - - /** - * Begins deleting a virtual machine from Azure, identifying it by its resource ID. - * - * @param id the resource ID of the virtual machine to delete - * @return the accepted deleting operation - */ - Accepted beginDeleteById(String id); - - /** - * Begins deleting a virtual machine from Azure, identifying it by its name and its resource group. - * - * @param resourceGroupName the resource group the resource is part of - * @param name the virtual machine name - * @return the accepted deleting operation - */ - Accepted beginDeleteByResourceGroup(String resourceGroupName, String name); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkPeering.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkPeering.java deleted file mode 100644 index 484213606caa..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkPeering.java +++ /dev/null @@ -1,402 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.network.fluent.models.VirtualNetworkPeeringInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.IndependentChild; -import com.azure.resourcemanager.resources.fluentcore.model.Appliable; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; -import com.azure.resourcemanager.resources.fluentcore.model.Updatable; -import java.util.List; -import reactor.core.publisher.Mono; - -/** An client-side representation of a network peering. */ -@Fluent() -public interface NetworkPeering - extends IndependentChild, - HasInnerModel, - Refreshable, - Updatable { - - /** @return the local virtual network's ID */ - String networkId(); - - /** @return the reference of the remote virtual network address space */ - List remoteAddressSpaces(); - - /** - * @return true if the peering enables IP addresses within the peered networks to be accessible from both networks, - * otherwise false - *

    (Note this method makes a separate call to Azure.) - */ - boolean checkAccessBetweenNetworks(); - - /** @return the associated remote virtual network's ID */ - String remoteNetworkId(); - - /** @return the remote network if it is in the same subscription, otherwise null. */ - Network getRemoteNetwork(); - - /** - * Gets the remote network associated with this peering asynchronously. - * - * @return a representation of the future computation of this call - */ - Mono getRemoteNetworkAsync(); - - /** - * @return the associated matching peering on the remote network if it is in the same subscription, otherwise this - * future computation will evaluate to null. - */ - NetworkPeering getRemotePeering(); - - /** - * Gets the associated matching peering on the remote network if it is in the same subscription. - * - * @return a representation of the future computation of this call. - */ - Mono getRemotePeeringAsync(); - - /** @return the state of the peering between the two networks */ - VirtualNetworkPeeringState state(); - - /** @return the type of gateway use enabled for this network */ - NetworkPeeringGatewayUse gatewayUse(); - - /** @return true if traffic forwarding from the remote network is allowed into this network */ - boolean isTrafficForwardingFromRemoteNetworkAllowed(); - - /** @return true if the peered networks are in the same subscription, otherwise false */ - boolean isSameSubscription(); - - /** Grouping of all the network peering definition stages. */ - interface DefinitionStages { - - /** The first stage of a network peering definition. */ - interface Blank extends WithRemoteNetwork { - } - - /** The stage of a network peering definition allowing to specify the remote virtual network. */ - interface WithRemoteNetwork { - // The remote network can only be specified at the time of the peering creation, not update - - /** - * Specifies the remote network to peer with. - * - *

    The remote network will have the matching peering associated with it automatically. - * - * @param resourceId the resource ID of an existing network - * @return the next stage of the definition - */ - WithCreate withRemoteNetwork(String resourceId); - - /** - * Specifies the remote network to peer with. - * - *

    The remote network will have the matching peering associated with it automatically. - * - * @param network an existing network - * @return the next stage of the definition - */ - WithCreate withRemoteNetwork(Network network); - } - - /** - * The stage of a network peering definition allowing to control traffic forwarding from or to the remote - * network. - */ - interface WithTrafficForwarding { - /** - * Allows traffic forwarded from the remote network. - * - * @return the next stage of the definition - */ - WithCreate withTrafficForwardingFromRemoteNetwork(); - - /** - * Allows traffic forwarding from this network to the remote network. - * - *

    This setting will have effect only if the remote network is in the same subscription. Otherwise, it - * will be ignored and you need to change the corresponding traffic forwarding setting on the remote - * network's matching peering explicitly. - * - * @return the next stage of the definition - */ - WithCreate withTrafficForwardingToRemoteNetwork(); - - /** - * Allows traffic forwarding both from either peered network into the other. - * - *

    This setting will have effect on the remote network only if the remote network is in the same - * subscription. Otherwise, it will be ignored and you need to change the corresponding traffic forwarding - * setting on the remote network's matching peering explicitly. - * - * @return the next stage of the definition - */ - WithCreate withTrafficForwardingBetweenBothNetworks(); - } - - /** - * The stage of a network peering definition allowing to control the gateway use by or on the remote network. - */ - interface WithGatewayUse { - /** - * Allows the remote network to use this network's gateway (a.k.a. gateway transit), but does not start the - * use of the gateway by the remote network. - * - *

    If this network is currently configured to use the remote network's gateway, that use will be - * automatically disabled, as these two settings cannot be used together. - * - * @return the next stage of the definition - */ - WithCreate withGatewayUseByRemoteNetworkAllowed(); - - /** - * Allows and starts the use of this network's gateway by the remote network (a.k.a. gateway transit). - * - *

    If the remote network is not in the same subscription as this network, then gateway use by the remote - * gateway will only be allowed on this network, but not started. The matching peering on the remote network - * must be modified explicitly to start it. - * - *

    If this network is currently configured to use the remote network's gateway, that use will be - * automatically disabled, as these two settings cannot be used together. - * - *

    Before gateway use by a remote network can be started, a working gateway must already be in place - * within this network. - * - * @return the next stage of the definition - */ - WithCreate withGatewayUseByRemoteNetworkStarted(); - - /** - * Starts the use of the remote network's gateway. - * - *

    If the remote network is in the same subscription, remote gateway use by this network (a.k.a. gateway - * transit) will also be automatically allowed on the remote network's side. Otherwise, this network will - * only be configured to use the remote gateway, but the matching peering on the remote network must still - * be additionally modified explicitly to allow gateway use by this network. - * - *

    If this network is currently configured to allow the remote network to use its gateway, that use will - * be automatically disabled, as these two settings cannot be used together. - * - *

    Before gateway use on a remote network can be started, a working gateway must already be in place - * within the remote network. - * - * @return the next stage of the definition - */ - WithCreate withGatewayUseOnRemoteNetworkStarted(); - - /** - * Disables any gateway use by this network and the remote one. - * - * @return the next stage of the definition - */ - WithCreate withoutAnyGatewayUse(); - } - - /** The stage of a network peering definition allowing to control access from and to the remote network. */ - interface WithAccess { - /** - * Disallows access to either peered network from the other. - * - *

    This setting will have effect on the remote network only if the remote network is in the same - * subscription. Otherwise, it will be ignored and you need to change the corresponding access setting on - * the remote network's matching peering explicitly. - * - * @return the next stage of the definition - */ - WithCreate withoutAccessFromEitherNetwork(); - } - - /** - * The stage of a network peering definition with sufficient inputs to create a new network peering in the - * cloud, but exposing additional optional settings to specify. - */ - interface WithCreate extends Creatable, WithGatewayUse, WithTrafficForwarding, WithAccess { - } - } - - /** The entirety of the network peering definition. */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithCreate, DefinitionStages.WithRemoteNetwork { - } - - /** The template for a network peering update operation, containing all the settings that can be modified. */ - interface Update - extends Appliable, - UpdateStages.WithTrafficForwarding, - UpdateStages.WithAccess, - UpdateStages.WithGatewayUse { - } - - /** Grouping of all the network peering update stages. */ - interface UpdateStages { - - /** The stage of a network peering update allowing to control the gateway use by or on the remote network. */ - interface WithGatewayUse { - /** - * Allows the remote network to use this network's gateway (a.k.a. gateway transit), but does not start the - * use of the gateway by the remote network. - * - *

    If this network is currently configured to use the remote network's gateway, that use will be - * automatically disabled, as these two settings cannot be used together. - * - * @return the next stage of the update - */ - Update withGatewayUseByRemoteNetworkAllowed(); - - /** - * Allows and starts the use of this network's gateway by the remote network (a.k.a. gateway transit). - * - *

    If the remote network is not in the same subscription as this network, then gateway use by the remote - * gateway will only be allowed on this network, but not started. The matching peering on the remote network - * must be modified explicitly to start it. - * - *

    If this network is currently configured to use the remote network's gateway, that use will be - * automatically disabled, as these two settings cannot be used together. - * - *

    Before gateway use by a remote network can be started, a working gateway must already be in place - * within this network. - * - * @return the next stage of the update - */ - Update withGatewayUseByRemoteNetworkStarted(); - - /** - * Starts the use of the remote network's gateway. - * - *

    If the remote network is in the same subscription, remote gateway use by this network (a.k.a. gateway - * transit) will also be automatically allowed on the remote network's side. Otherwise, this network will - * only be configured to use the remote gateway, but the matching peering on the remote network must still - * be additionally modified explicitly to allow gateway use by this network. - * - *

    If this network is currently configured to allow the remote network to use its gateway, that use will - * be automatically disabled, as these two settings cannot be used together. - * - *

    Before gateway use on a remote network can be started, a working gateway must already be in place - * within the remote network. - * - * @return the next stage of the update - */ - Update withGatewayUseOnRemoteNetworkStarted(); - - /** - * Stops this network's use of the remote network's gateway. - * - * @return the next stage of the definition. - */ - Update withoutGatewayUseOnRemoteNetwork(); - - /** - * Disables any gateway use by this network and the remote one. - * - *

    This will have effect on the remote network only if the remote network is in the same subscription as - * this network. Otherwise, only this network's use of the remote network's gateway will be stopped, but the - * use of this network's gateway by the remote network will only be disallowed. You will have to update the - * remote network's peering explicitly to properly stop its use of this network's gateway. - * - * @return the next stage of the update - */ - Update withoutAnyGatewayUse(); - - /** - * Stops and disallows the use of this network's gateway by the remote network. - * - *

    If the remote network is not in the same subscription, then the use of that network's gateway by this - * network will be stopped but not disallowed by the remote network. The matching peering on the remote - * network must still be explicitly updated to also disallow such use. - * - * @return the next stage of the update - */ - Update withoutGatewayUseByRemoteNetwork(); - } - - /** - * The stage of a network peering update allowing to control traffic forwarding from or to the remote network. - */ - interface WithTrafficForwarding { - /** - * Allows traffic forwarding from the remote network. - * - * @return the next stage of the update - */ - Update withTrafficForwardingFromRemoteNetwork(); - - /** - * Prevents traffic forwarding from the remote network. - * - * @return the next stage of the update - */ - Update withoutTrafficForwardingFromRemoteNetwork(); - - /** - * Allows traffic forwarding from this network to the remote network. - * - *

    This setting will only work here if the remote network is in the same subscription. Otherwise, it will - * be ignored and you need to change the corresponding traffic forwarding setting on the remote network's - * matching peering explicitly. - * - * @return the next stage of the update - */ - Update withTrafficForwardingToRemoteNetwork(); - - /** - * Disables traffic forwarding to the remote network. - * - * @return the next stage of the update - */ - Update withoutTrafficForwardingToRemoteNetwork(); - - /** - * Allows traffic forwarding both from either peered network to the other. - * - *

    This setting will have effect on the remote network only if the remote network is in the same - * subscription. Otherwise, it will be ignored and you need to change the corresponding traffic forwarding - * setting on the remote network's matching peering explicitly. - * - * @return the next stage of the update - */ - Update withTrafficForwardingBetweenBothNetworks(); - - /** - * Disables traffic forwarding from either peered network to the other. - * - *

    This setting will have effect on the remote network only if the remote network is in the same - * subscription. Otherwise, it will be ignored and you need to change the corresponding traffic forwarding - * setting on the remote network's matching peering explicitly. - * - * @return the next stage of the update - */ - Update withoutTrafficForwardingFromEitherNetwork(); - } - - /** The stage of a network peering update allowing to control access from and to the remote network. */ - interface WithAccess { - /** - * Enables access to either peered virtual network from the other. - * - *

    This setting will have effect on the remote network only if the remote network is in the same - * subscription. Otherwise, it will be ignored and you need to change the corresponding access setting on - * the remote network's matching peering explicitly. - * - * @return the next stage of the update - */ - Update withAccessBetweenBothNetworks(); - - /** - * Disallows access to either peered network from the other. - * - *

    This setting will have effect on the remote network only if the remote network is in the same - * subscription. Otherwise, it will be ignored and you need to change the corresponding access setting on - * the remote network's matching peering explicitly. - * - * @return the next stage of the update - */ - Update withoutAccessFromEitherNetwork(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkPeeringGatewayUse.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkPeeringGatewayUse.java deleted file mode 100644 index d1b97e93d0d0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkPeeringGatewayUse.java +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -/** Possible gateway use scenarios. */ -public enum NetworkPeeringGatewayUse { - /** The remote network is allowed to use this network's gateway (but not necessarily using it currently). */ - BY_REMOTE_NETWORK, - - /** This network is configured to use the remote network's gateway. */ - ON_REMOTE_NETWORK, - - /** No gateway use is configured. */ - NONE -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkPeerings.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkPeerings.java deleted file mode 100644 index 5dda8634ed64..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkPeerings.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsDeletingByParent; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsBatchCreation; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsCreating; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingById; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; -import reactor.core.publisher.Mono; - -/** Entry point to network peering management API. */ -@Fluent -public interface NetworkPeerings - extends SupportsCreating, - SupportsDeletingById, - SupportsGettingById, - SupportsBatchCreation, - SupportsDeletingByParent, - SupportsListing, - HasManager { - - /** - * Finds the peering, if any, that is associated with the specified network. - * - *

    (Note that this makes a separate call to Azure.) - * - * @param network an existing network - * @return a network peering, or null if none exists - */ - NetworkPeering getByRemoteNetwork(Network network); - - /** - * Finds the peering, if any, that is associated with the specified network. - * - *

    (Note that this makes a separate call to Azure.) - * - * @param remoteNetworkResourceId the resource ID of an existing network - * @return a network peering, or null if none exists - */ - NetworkPeering getByRemoteNetwork(String remoteNetworkResourceId); - - /** - * Asynchronously finds the peering, if any, that is associated with the specified network. - * - *

    (Note that this makes a separate call to Azure.) - * - * @param network an existing network - * @return a representation of the future computation of this call, evaluating to null if no such peering is found - */ - Mono getByRemoteNetworkAsync(Network network); - - /** - * Asynchronously finds the peering, if any, that is associated with the specified network. - * - *

    (Note that this makes a separate call to Azure.) - * - * @param remoteNetworkResourceId the resource ID of an existing network - * @return a representation of the future computation of this call, evaluating to null if no such peering is found - */ - Mono getByRemoteNetworkAsync(String remoteNetworkResourceId); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkProfile.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkProfile.java deleted file mode 100644 index 9800e818db9c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkProfile.java +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.network.models; - -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.network.fluent.models.NetworkProfileInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.GroupableResource; -import com.azure.resourcemanager.resources.fluentcore.arm.models.Resource; -import com.azure.resourcemanager.resources.fluentcore.model.Appliable; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; -import com.azure.resourcemanager.resources.fluentcore.model.Updatable; - -import java.util.List; - -/** An immutable client-side representation of NetworkProfile. */ -public interface NetworkProfile extends - GroupableResource, - Refreshable, - Updatable, - UpdatableWithTags { - - /** - * Gets the containerNetworkInterfaceConfigurations property: List of chid container network interface - * configurations. - * - * @return the containerNetworkInterfaceConfigurations value. - */ - List containerNetworkInterfaceConfigurations(); - - /** The entirety of the NetworkProfile definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithGroup, - DefinitionStages.WithContainerNetworkInterfaceConfigurations, - DefinitionStages.WithCreate { - } - /** The NetworkProfile definition stages. */ - interface DefinitionStages { - /** - * The first stage of the NetworkProfile definition. - */ - interface Blank extends - GroupableResource.DefinitionWithRegion { - } - - /** - * The stage of the NetworkProfile definition allowing to specify parent resource. - */ - interface WithGroup extends - GroupableResource.DefinitionStages.WithGroup - { - } - - /** - * The stage of the NetworkProfile definition which contains all the minimum required properties for the - * resource to be created, but also allows for any other optional properties to be specified. - */ - interface WithCreate - extends Creatable, - Resource.DefinitionWithTags { - } - - /** - * The stage of the NetworkProfile definition allowing to specify network interface configurations for - * container. - */ - interface WithContainerNetworkInterfaceConfigurations { - /** - * Specifies the network interface configuration for container. - * - * @param name the name - * @param ipConfigName the name of ip configuration - * @param virtualNetworkId the ID of the virtual network - * @param subnetName the name of the subnet - * @return the next stage - */ - WithCreate withContainerNetworkInterfaceConfiguration( - String name, String ipConfigName, String virtualNetworkId, String subnetName); - - /** - * Specifies the network interface configuration for container. - * - * @param name the name - * @param ipConfigName the name of ip configuration - * @param subnet the Subnet resource - * @return the next stage - */ - WithCreate withContainerNetworkInterfaceConfiguration( - String name, String ipConfigName, Subnet subnet); - } - } - - /** The template for NetworkProfile update. */ - interface Update extends - Appliable, - Resource.UpdateWithTags { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkProfileListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkProfileListResult.java deleted file mode 100644 index 6ed964372947..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkProfileListResult.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.NetworkProfileInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Response for ListNetworkProfiles API service call. */ -@Fluent -public final class NetworkProfileListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkProfileListResult.class); - - /* - * A list of network profiles that exist in a resource group. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to get the next set of results. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: A list of network profiles that exist in a resource group. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: A list of network profiles that exist in a resource group. - * - * @param value the value value to set. - * @return the NetworkProfileListResult object itself. - */ - public NetworkProfileListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to get the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The URL to get the next set of results. - * - * @param nextLink the nextLink value to set. - * @return the NetworkProfileListResult object itself. - */ - public NetworkProfileListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkProfiles.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkProfiles.java deleted file mode 100644 index f2ea4341c4da..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkProfiles.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.network.models; - -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsDeletingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsListingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsCreating; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingById; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; - -/** Resource collection API of NetworkProfiles. */ -public interface NetworkProfiles extends - SupportsCreating, - SupportsListing, - SupportsListingByResourceGroup, - SupportsGettingByResourceGroup, - SupportsGettingById, - SupportsDeletingById, - SupportsDeletingByResourceGroup, - HasManager { -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkSecurityGroup.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkSecurityGroup.java deleted file mode 100644 index b83e4472506d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkSecurityGroup.java +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.network.fluent.models.NetworkSecurityGroupInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.GroupableResource; -import com.azure.resourcemanager.resources.fluentcore.arm.models.Resource; -import com.azure.resourcemanager.resources.fluentcore.model.Appliable; -import com.azure.resourcemanager.resources.fluentcore.model.Attachable; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; -import com.azure.resourcemanager.resources.fluentcore.model.Updatable; -import java.util.Map; -import java.util.Set; - -/** Network security group. */ -@Fluent() -public interface NetworkSecurityGroup - extends GroupableResource, - Refreshable, - Updatable, - UpdatableWithTags, - HasAssociatedSubnets { - - // Getters - - /** @return security rules associated with this network security group, indexed by their names */ - Map securityRules(); - - /** @return default security rules associated with this network security group, indexed by their name */ - Map defaultSecurityRules(); - - /** @return the IDs of the network interfaces associated with this network security group */ - Set networkInterfaceIds(); - - // Fluent interfaces for creating NSGs - - /** The entirety of the network security group definition. */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { - } - - /** Grouping of network security group definition stages. */ - interface DefinitionStages { - /** The first stage of the definition. */ - interface Blank extends GroupableResource.DefinitionWithRegion { - } - - /** The stage allowing to specify the resource group. */ - interface WithGroup extends GroupableResource.DefinitionStages.WithGroup { - } - - /** - * The stage allowing to define a new security rule. - * - *

    When the security rule description is complete enough, use {@link Attachable#attach()} to attach it to - * this network security group. - */ - interface WithRule { - /** - * Starts the definition of a new security rule. - * - * @param name the name for the new security rule - * @return the first stage of the security rule definition - */ - NetworkSecurityRule.DefinitionStages.Blank defineRule(String name); - } - - /** - * The stage of the definition which contains all the minimum required inputs for the resource to be created - * (via {@link WithCreate#create()}), but also allows for any other optional settings to be specified. - */ - interface WithCreate - extends Creatable, - Resource.DefinitionWithTags, - DefinitionStages.WithRule { - } - } - - /** Grouping of network security group update stages. */ - interface UpdateStages { - /** The stage of the resource definition allowing to add or remove security rules. */ - interface WithRule { - /** - * Removes an existing security rule. - * - * @param name the name of the security rule to remove - * @return the next stage of the network security group description - */ - Update withoutRule(String name); - - /** - * Begins the definition of a new security rule to be added to this network security group. - * - * @param name the name of the new security rule - * @return the first stage of the new security rule definition - */ - NetworkSecurityRule.UpdateDefinitionStages.Blank defineRule(String name); - - /** - * Begins the description of an update of an existing security rule of this network security group. - * - * @param name the name of an existing security rule - * @return the first stage of the security rule update description - */ - NetworkSecurityRule.Update updateRule(String name); - } - } - - /** - * The template for an update operation, containing all the settings that can be modified. - * - *

    Call {@link Update#apply()} to apply the changes to the resource in Azure. - */ - interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithRule { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkSecurityGroupListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkSecurityGroupListResult.java deleted file mode 100644 index 74f0d2af0a5f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkSecurityGroupListResult.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.NetworkSecurityGroupInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Response for ListNetworkSecurityGroups API service call. */ -@Fluent -public final class NetworkSecurityGroupListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkSecurityGroupListResult.class); - - /* - * A list of NetworkSecurityGroup resources. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to get the next set of results. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: A list of NetworkSecurityGroup resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: A list of NetworkSecurityGroup resources. - * - * @param value the value value to set. - * @return the NetworkSecurityGroupListResult object itself. - */ - public NetworkSecurityGroupListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to get the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The URL to get the next set of results. - * - * @param nextLink the nextLink value to set. - * @return the NetworkSecurityGroupListResult object itself. - */ - public NetworkSecurityGroupListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkSecurityGroupResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkSecurityGroupResult.java deleted file mode 100644 index ee4a9db95b8d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkSecurityGroupResult.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Network configuration diagnostic result corresponded provided traffic query. */ -@Fluent -public final class NetworkSecurityGroupResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkSecurityGroupResult.class); - - /* - * The network traffic is allowed or denied. Possible values are 'Allow' - * and 'Deny'. - */ - @JsonProperty(value = "securityRuleAccessResult") - private SecurityRuleAccess securityRuleAccessResult; - - /* - * List of results network security groups diagnostic. - */ - @JsonProperty(value = "evaluatedNetworkSecurityGroups", access = JsonProperty.Access.WRITE_ONLY) - private List evaluatedNetworkSecurityGroups; - - /** - * Get the securityRuleAccessResult property: The network traffic is allowed or denied. Possible values are 'Allow' - * and 'Deny'. - * - * @return the securityRuleAccessResult value. - */ - public SecurityRuleAccess securityRuleAccessResult() { - return this.securityRuleAccessResult; - } - - /** - * Set the securityRuleAccessResult property: The network traffic is allowed or denied. Possible values are 'Allow' - * and 'Deny'. - * - * @param securityRuleAccessResult the securityRuleAccessResult value to set. - * @return the NetworkSecurityGroupResult object itself. - */ - public NetworkSecurityGroupResult withSecurityRuleAccessResult(SecurityRuleAccess securityRuleAccessResult) { - this.securityRuleAccessResult = securityRuleAccessResult; - return this; - } - - /** - * Get the evaluatedNetworkSecurityGroups property: List of results network security groups diagnostic. - * - * @return the evaluatedNetworkSecurityGroups value. - */ - public List evaluatedNetworkSecurityGroups() { - return this.evaluatedNetworkSecurityGroups; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (evaluatedNetworkSecurityGroups() != null) { - evaluatedNetworkSecurityGroups().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkSecurityGroups.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkSecurityGroups.java deleted file mode 100644 index d56aa9fd4dd9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkSecurityGroups.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsBatchDeletion; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsDeletingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsListingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsBatchCreation; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsCreating; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingById; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; - -/** Entry point to network security group management. */ -@Fluent() -public interface NetworkSecurityGroups - extends SupportsCreating, - SupportsListing, - SupportsListingByResourceGroup, - SupportsGettingByResourceGroup, - SupportsGettingById, - SupportsDeletingById, - SupportsDeletingByResourceGroup, - SupportsBatchCreation, - SupportsBatchDeletion, - HasManager { -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkSecurityRule.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkSecurityRule.java deleted file mode 100644 index 67da7b0688ea..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkSecurityRule.java +++ /dev/null @@ -1,912 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.network.fluent.models.SecurityRuleInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.ChildResource; -import com.azure.resourcemanager.resources.fluentcore.model.Attachable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.model.Settable; - -import java.util.List; -import java.util.Set; - -/** A network security rule in a network security group. */ -@Fluent -public interface NetworkSecurityRule extends HasInnerModel, ChildResource { - - /** @return the direction of the network traffic that the network security rule applies to. */ - SecurityRuleDirection direction(); - - /** @return the network protocol the rule applies to */ - SecurityRuleProtocol protocol(); - - /** @return the user-defined description of the security rule */ - String description(); - - /** @return the type of access the rule enforces */ - SecurityRuleAccess access(); - - /** - * @return the source address prefix the rule applies to, expressed using the CIDR notation in the format: - * "###.###.###.###/##", and "*" means "any" - */ - String sourceAddressPrefix(); - - /** - * @return the list of source address prefixes the rule applies to, expressed using the CIDR notation in the format: - * "###.###.###.###/##", and "*" means "any", or IP addresses - */ - List sourceAddressPrefixes(); - - /** @return the source port range that the rule applies to, in the format "##-##", where "*" means "any" */ - String sourcePortRange(); - - /** @return the source port ranges that the rule applies to, in the format "##-##", where "*" means "any" */ - List sourcePortRanges(); - - /** - * @return the destination address prefix the rule applies to, expressed using the CIDR notation in the format: - * "###.###.###.###/##", and "*" means "any" - */ - String destinationAddressPrefix(); - - /** - * @return the list of destination address prefixes the rule applies to, expressed using the CIDR notation in the - * format: "###.###.###.###/##", and "*" means "any", or IP addresses - */ - List destinationAddressPrefixes(); - - /** @return the destination port range that the rule applies to, in the format "##-##", where "*" means any */ - String destinationPortRange(); - - /** @return the destination port ranges that the rule applies to, in the format "##-##", where "*" means any */ - List destinationPortRanges(); - - /** - * @return the priority number of this rule based on which this rule will be applied relative to the priority - * numbers of any other rules specified for this network security group - */ - int priority(); - - /** @return list of application security group ids specified as source */ - Set sourceApplicationSecurityGroupIds(); - - /** @return list of application security group ids specified as destination */ - Set destinationApplicationSecurityGroupIds(); - - /** - * The entirety of a network security rule definition. - * - * @param the return type of the final {@link Attachable#attach()} - */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithAttach, - DefinitionStages.WithDirectionAccess, - DefinitionStages.WithSourceAddressOrSecurityGroup, - DefinitionStages.WithSourcePort, - DefinitionStages.WithDestinationAddressOrSecurityGroup, - DefinitionStages.WithDestinationPort, - DefinitionStages.WithProtocol { - } - - /** Grouping of security rule definition stages applicable as part of a network security group creation. */ - interface DefinitionStages { - /** - * The first stage of a security rule definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface Blank extends WithDirectionAccess { - } - - /** - * The stage of the security rule definition allowing the protocol that the rule applies to to be specified. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithProtocol { - /** - * Specifies the protocol that this rule applies to. - * - * @param protocol one of the supported protocols - * @return the next stage of the definition - */ - WithAttach withProtocol(SecurityRuleProtocol protocol); - - /** - * Makes this rule apply to any supported protocol. - * - * @return the next stage of the definition - */ - WithAttach withAnyProtocol(); - } - - /** - * The stage of the network rule definition allowing the destination port(s) to be specified. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithDestinationPort { - /** - * Specifies the destination port to which this rule applies. - * - * @param port the destination port number - * @return the next stage of the definition - */ - WithProtocol toPort(int port); - - /** - * Makes this rule apply to any destination port. - * - * @return the next stage of the definition - */ - WithProtocol toAnyPort(); - - /** - * Specifies the destination port range to which this rule applies. - * - * @param from the starting port number - * @param to the ending port number - * @return the next stage of the definition - */ - WithProtocol toPortRange(int from, int to); - - /** - * Specifies the destination port ranges to which this rule applies. - * - * @param ranges the destination port ranges - * @return the next stage of the definition - */ - WithProtocol toPortRanges(String... ranges); - } - - /** - * The stage of the network rule definition allowing the destination address to be specified. Note: network - * security rule must specify a non empty value for exactly one of: DestinationAddressPrefixes, - * DestinationAddressPrefix, DestinationApplicationSecurityGroups. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithDestinationAddressOrSecurityGroup { - /** - * Specifies the traffic destination address range to which this rule applies. - * - * @param cidr an IP address range expressed in the CIDR notation - * @return the next stage of the definition - */ - WithDestinationPort toAddress(String cidr); - - /** - * Specifies the traffic destination address prefixes to which this rule applies. - * - * @param addresses IP address prefixes in CIDR notation or IP addresses - * @return the next stage of the definition - */ - WithDestinationPort toAddresses(String... addresses); - - /** - * Makes the rule apply to any traffic destination address. - * - * @return the next stage of the definition - */ - WithDestinationPort toAnyAddress(); - - /** - * Sets the application security group specified as destination. - * - * @param id application security group id - * @return the next stage of the definition - */ - WithDestinationPort withDestinationApplicationSecurityGroup(String id); - - /** - * Sets the application security group specified as destination. - * - * @param ids the collection of application security group ID - * @return the next stage of the definition - */ - WithDestinationPort withDestinationApplicationSecurityGroup(String... ids); - } - - /** - * The stage of the network rule definition allowing the source port(s) to be specified. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithSourcePort { - /** - * Specifies the source port to which this rule applies. - * - * @param port the source port number - * @return the next stage of the definition - */ - WithDestinationAddressOrSecurityGroup fromPort(int port); - - /** - * Makes this rule apply to any source port. - * - * @return the next stage of the definition - */ - WithDestinationAddressOrSecurityGroup fromAnyPort(); - - /** - * Specifies the source port range to which this rule applies. - * - * @param from the starting port number - * @param to the ending port number - * @return the next stage of the definition - */ - WithDestinationAddressOrSecurityGroup fromPortRange(int from, int to); - - /** - * Specifies the source port ranges to which this rule applies. - * - * @param ranges the starting port ranges - * @return the next stage of the definition - */ - WithDestinationAddressOrSecurityGroup fromPortRanges(String... ranges); - } - - /** - * The stage of the network rule definition allowing the source address to be specified. Note: network security - * rule must specify a non empty value for exactly one of: SourceAddressPrefixes, SourceAddressPrefix, - * SourceApplicationSecurityGroups. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithSourceAddressOrSecurityGroup { - /** - * Specifies the traffic source address prefix to which this rule applies. - * - * @param cidr an IP address prefix expressed in the CIDR notation - * @return the next stage of the definition - */ - WithSourcePort fromAddress(String cidr); - - /** - * Specifies that the rule applies to any traffic source address. - * - * @return the next stage of the definition - */ - WithSourcePort fromAnyAddress(); - - /** - * Specifies the traffic source address prefixes to which this rule applies. - * - * @param addresses IP address prefixes in CIDR notation or IP addresses - * @return the next stage of the definition - */ - WithSourcePort fromAddresses(String... addresses); - - /** - * Sets the application security group specified as source. - * - * @param id application security group id - * @return the next stage of the definition - */ - WithSourcePort withSourceApplicationSecurityGroup(String id); - - /** - * Sets the application security group specified as source. - * - * @param ids the collection of application security group ID - * @return the next stage of the definition - */ - WithSourcePort withSourceApplicationSecurityGroup(String... ids); - } - - /** - * The stage of the network rule definition allowing the direction and the access type to be specified. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithDirectionAccess { - /** - * Allows inbound traffic. - * - * @return the next stage of the definition - */ - WithSourceAddressOrSecurityGroup allowInbound(); - - /** - * Allows outbound traffic. - * - * @return the next stage of the definition - */ - WithSourceAddressOrSecurityGroup allowOutbound(); - - /** - * Blocks inbound traffic. - * - * @return the next stage of the definition - */ - WithSourceAddressOrSecurityGroup denyInbound(); - - /** - * Blocks outbound traffic. - * - * @return the next stage of the definition - */ - WithSourceAddressOrSecurityGroup denyOutbound(); - } - - /** - * The stage of the network rule definition allowing the priority to be specified. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithPriority { - /** - * Specifies the priority to assign to this rule. - * - *

    Security rules are applied in the order of their assigned priority. - * - * @param priority the priority number in the range 100 to 4096 - * @return the next stage - */ - WithAttach withPriority(int priority); - } - - /** - * The stage of the network rule definition allowing the description to be specified. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithDescription { - /** - * Specifies a description for this security rule. - * - * @param description the text description to associate with this security rule - * @return the next stage - */ - WithAttach withDescription(String description); - } - - /** - * The final stage of the security rule definition. - * - *

    At this stage, any remaining optional settings can be specified, or the security rule definition can be - * attached to the parent network security group definition using {@link WithAttach#attach()}. - * - * @param the return type of {@link WithAttach#attach()} - */ - interface WithAttach - extends Attachable.InDefinition, WithPriority, WithDescription { - } - } - - /** - * The entirety of a network security rule definition as part of a network security group update. - * - * @param the return type of the final {@link UpdateDefinitionStages.WithAttach#attach()} - */ - interface UpdateDefinition - extends UpdateDefinitionStages.Blank, - UpdateDefinitionStages.WithDirectionAccess, - UpdateDefinitionStages.WithSourceAddressOrSecurityGroup, - UpdateDefinitionStages.WithSourcePort, - UpdateDefinitionStages.WithDestinationAddressOrSecurityGroup, - UpdateDefinitionStages.WithDestinationPort, - UpdateDefinitionStages.WithProtocol, - UpdateDefinitionStages.WithAttach { - } - - /** Grouping of security rule definition stages applicable as part of a network security group update. */ - interface UpdateDefinitionStages { - /** - * The first stage of a security rule description as part of an update of a networking security group. - * - * @param the return type of the final {@link Attachable#attach()} - */ - interface Blank extends WithDirectionAccess { - } - - /** - * The stage of the network rule description allowing the direction and the access type to be specified. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithDirectionAccess { - /** - * Allows inbound traffic. - * - * @return the next stage of the definition - */ - WithSourceAddressOrSecurityGroup allowInbound(); - - /** - * Allows outbound traffic. - * - * @return the next stage of the definition - */ - WithSourceAddressOrSecurityGroup allowOutbound(); - - /** - * Blocks inbound traffic. - * - * @return the next stage of the definition - */ - WithSourceAddressOrSecurityGroup denyInbound(); - - /** - * Blocks outbound traffic. - * - * @return the next stage of the definition - */ - WithSourceAddressOrSecurityGroup denyOutbound(); - } - - /** - * The stage of the network rule definition allowing the source address to be specified. Note: network security - * rule must specify a non empty value for exactly one of: SourceAddressPrefixes, SourceAddressPrefix, - * SourceApplicationSecurityGroups. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithSourceAddressOrSecurityGroup { - /** - * Specifies the traffic source address prefix to which this rule applies. - * - * @param cidr an IP address prefix expressed in the CIDR notation - * @return the next stage of the definition - */ - WithSourcePort fromAddress(String cidr); - - /** - * Specifies the traffic source address prefixes to which this rule applies. - * - * @param addresses IP address prefixes in CIDR notation or IP addresses - * @return the next stage of the definition - */ - WithSourcePort fromAddresses(String... addresses); - - /** - * Specifies that the rule applies to any traffic source address. - * - * @return the next stage of the definition - */ - WithSourcePort fromAnyAddress(); - - /** - * Sets the application security group specified as source. - * - * @param id application security group id - * @return the next stage of the update - */ - WithSourcePort withSourceApplicationSecurityGroup(String id); - - /** - * Sets the application security group specified as source. - * - * @param ids the collection of application security group ID - * @return the next stage of the definition - */ - WithSourcePort withSourceApplicationSecurityGroup(String... ids); - } - - /** - * The stage of the network rule definition allowing the source port(s) to be specified. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithSourcePort { - /** - * Specifies the source port to which this rule applies. - * - * @param port the source port number - * @return the next stage of the definition - */ - WithDestinationAddressOrSecurityGroup fromPort(int port); - - /** - * Makes this rule apply to any source port. - * - * @return the next stage of the definition - */ - WithDestinationAddressOrSecurityGroup fromAnyPort(); - - /** - * Specifies the source port range to which this rule applies. - * - * @param from the starting port number - * @param to the ending port number - * @return the next stage of the definition - */ - WithDestinationAddressOrSecurityGroup fromPortRange(int from, int to); - - /** - * Specifies the source port ranges to which this rule applies. - * - * @param ranges the starting port ranges - * @return the next stage of the definition - */ - WithDestinationAddressOrSecurityGroup fromPortRanges(String... ranges); - } - - /** - * The stage of the network rule definition allowing the destination address to be specified. Note: network - * security rule must specify a non empty value for exactly one of: DestinationAddressPrefixes, - * DestinationAddressPrefix, DestinationApplicationSecurityGroups. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithDestinationAddressOrSecurityGroup { - /** - * Specifies the traffic destination address range to which this rule applies. - * - * @param cidr an IP address range expressed in the CIDR notation - * @return the next stage of the definition - */ - WithDestinationPort toAddress(String cidr); - - /** - * Specifies the traffic destination address prefixes to which this rule applies. - * - * @param addresses IP address prefixes in CIDR notation or IP addresses - * @return the next stage of the definition - */ - WithDestinationPort toAddresses(String... addresses); - - /** - * Makes the rule apply to any traffic destination address. - * - * @return the next stage of the definition - */ - WithDestinationPort toAnyAddress(); - - /** - * Sets the application security group specified as destination. - * - * @param id application security group id - * @return the next stage of the definition - */ - WithDestinationPort withDestinationApplicationSecurityGroup(String id); - - /** - * Sets the application security group specified as destination. - * - * @param ids the collection of application security group ID - * @return the next stage of the definition - */ - WithDestinationPort withDestinationApplicationSecurityGroup(String... ids); - } - - /** - * The stage of the network rule definition allowing the destination port(s) to be specified. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithDestinationPort { - /** - * Specifies the destination port to which this rule applies. - * - * @param port the destination port number - * @return the next stage of the definition - */ - WithProtocol toPort(int port); - - /** - * Makes this rule apply to any destination port. - * - * @return the next stage of the definition - */ - WithProtocol toAnyPort(); - - /** - * Specifies the destination port range to which this rule applies. - * - * @param from the starting port number - * @param to the ending port number - * @return the next stage of the definition - */ - WithProtocol toPortRange(int from, int to); - - /** - * Specifies the destination port ranges to which this rule applies. - * - * @param ranges the destination port ranges - * @return the next stage of the definition - */ - WithProtocol toPortRanges(String... ranges); - } - - /** - * The stage of the security rule definition allowing the protocol that the rule applies to to be specified. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithProtocol { - /** - * Specifies the protocol that this rule applies to. - * - * @param protocol one of the supported protocols - * @return the next stage of the definition - */ - WithAttach withProtocol(SecurityRuleProtocol protocol); - - /** - * Makes this rule apply to any supported protocol. - * - * @return the next stage of the definition - */ - WithAttach withAnyProtocol(); - } - - /** - * The final stage of the security rule definition. - * - *

    At this stage, any remaining optional settings can be specified, or the security rule definition can be - * attached to the parent network security group definition using {@link WithAttach#attach()}. - * - * @param the return type of {@link WithAttach#attach()} - */ - interface WithAttach extends Attachable.InUpdate { - - /** - * Specifies the priority to assign to this rule. - * - *

    Security rules are applied in the order of their assigned priority. - * - * @param priority the priority number in the range 100 to 4096 - * @return the next stage of the update - */ - WithAttach withPriority(int priority); - - /** - * Specifies a description for this security rule. - * - * @param descrtiption a text description to associate with the security rule - * @return the next stage - */ - WithAttach withDescription(String descrtiption); - } - } - - /** The entirety of a security rule update as part of a network security group update. */ - interface Update - extends UpdateStages.WithDirectionAccess, - UpdateStages.WithSourceAddressOrSecurityGroup, - UpdateStages.WithSourcePort, - UpdateStages.WithDestinationAddressOrSecurityGroup, - UpdateStages.WithDestinationPort, - UpdateStages.WithProtocol, - Settable { - - /** - * Specifies the priority to assign to this security rule. - * - *

    Security rules are applied in the order of their assigned priority. - * - * @param priority the priority number in the range 100 to 4096 - * @return the next stage of the update - */ - Update withPriority(int priority); - - /** - * Specifies a description for this security rule. - * - * @param description a text description to associate with this security rule - * @return the next stage - */ - Update withDescription(String description); - } - - /** Grouping of security rule update stages. */ - interface UpdateStages { - /** The stage of the network rule description allowing the direction and the access type to be specified. */ - interface WithDirectionAccess { - /** - * Allows inbound traffic. - * - * @return the next stage of the definition - */ - Update allowInbound(); - - /** - * Allows outbound traffic. - * - * @return the next stage of the definition - */ - Update allowOutbound(); - - /** - * Blocks inbound traffic. - * - * @return the next stage of the definition - */ - Update denyInbound(); - - /** - * Blocks outbound traffic. - * - * @return the next stage of the definition - */ - Update denyOutbound(); - } - - /** - * The stage of the network rule description allowing the source address to be specified. Note: network security - * rule must specify a non empty value for exactly one of: SourceAddressPrefixes, SourceAddressPrefix, - * SourceApplicationSecurityGroups. - */ - interface WithSourceAddressOrSecurityGroup { - /** - * Specifies the traffic source address prefix to which this rule applies. - * - * @param cidr an IP address prefix expressed in the CIDR notation - * @return the next stage of the definition - */ - Update fromAddress(String cidr); - - /** - * Specifies the traffic source address prefixes to which this rule applies. - * - * @param addresses IP address prefixes in CIDR notation or IP addresses - * @return the next stage of the definition - */ - Update fromAddresses(String... addresses); - - /** - * Specifies that the rule applies to any traffic source address. - * - * @return the next stage of the definition - */ - Update fromAnyAddress(); - - /** - * Sets the application security group specified as source. - * - * @param id application security group id - * @return the next stage of the update - */ - Update withSourceApplicationSecurityGroup(String id); - - /** - * Removes the application security group specified as source. - * - * @param id application security group id - * @return the next stage of the update - */ - Update withoutSourceApplicationSecurityGroup(String id); - } - - /** The stage of the network rule description allowing the source port(s) to be specified. */ - interface WithSourcePort { - /** - * Specifies the source port to which this rule applies. - * - * @param port the source port number - * @return the next stage of the definition - */ - Update fromPort(int port); - - /** - * Makes this rule apply to any source port. - * - * @return the next stage of the definition - */ - Update fromAnyPort(); - - /** - * Specifies the source port range to which this rule applies. - * - * @param from the starting port number - * @param to the ending port number - * @return the next stage of the definition - */ - Update fromPortRange(int from, int to); - - /** - * Specifies the source port ranges to which this rule applies. - * - * @param ranges the starting port ranges - * @return the next stage of the definition - */ - Update fromPortRanges(String... ranges); - } - - /** - * The stage of the network rule description allowing the destination address to be specified. Note: network - * security rule must specify a non empty value for exactly one of: DestinationAddressPrefixes, - * DestinationAddressPrefix, DestinationApplicationSecurityGroups. - */ - interface WithDestinationAddressOrSecurityGroup { - /** - * Specifies the traffic destination address range to which this rule applies. - * - * @param cidr an IP address range expressed in the CIDR notation - * @return the next stage of the update - */ - Update toAddress(String cidr); - - /** - * Makes the rule apply to any traffic destination address. - * - * @return the next stage of the update - */ - Update toAnyAddress(); - - /** - * Specifies the traffic destination address prefixes to which this rule applies. - * - * @param addresses IP address prefixes in CIDR notation or IP addresses - * @return the next stage of the definition - */ - Update toAddresses(String... addresses); - - /** - * Sets the application security group specified as destination. - * - * @param id application security group id - * @return the next stage of the update - */ - Update withDestinationApplicationSecurityGroup(String id); - - /** - * Removes the application security group specified as destination. - * - * @param id application security group id - * @return the next stage of the definition - */ - Update withoutDestinationApplicationSecurityGroup(String id); - } - - /** The stage of the network rule description allowing the destination port(s) to be specified. */ - interface WithDestinationPort { - /** - * Specifies the destination port to which this rule applies. - * - * @param port the destination port number - * @return the next stage of the definition - */ - Update toPort(int port); - - /** - * Makes this rule apply to any destination port. - * - * @return the next stage of the definition - */ - Update toAnyPort(); - - /** - * Specifies the destination port range to which this rule applies. - * - * @param from the starting port number - * @param to the ending port number - * @return the next stage of the definition - */ - Update toPortRange(int from, int to); - - /** - * Specifies the destination port ranges to which this rule applies. - * - * @param ranges the destination port ranges - * @return the next stage of the definition - */ - Update toPortRanges(String... ranges); - } - - /** - * The stage of the security rule description allowing the protocol that the rule applies to to be specified. - */ - interface WithProtocol { - /** - * Specifies the protocol that this rule applies to. - * - * @param protocol one of the supported protocols - * @return the next stage of the definition - */ - Update withProtocol(SecurityRuleProtocol protocol); - - /** - * Makes this rule apply to any supported protocol. - * - * @return the next stage of the definition - */ - Update withAnyProtocol(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkSecurityRulesEvaluationResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkSecurityRulesEvaluationResult.java deleted file mode 100644 index 3f1711ac4226..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkSecurityRulesEvaluationResult.java +++ /dev/null @@ -1,180 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Network security rules evaluation result. */ -@Fluent -public final class NetworkSecurityRulesEvaluationResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkSecurityRulesEvaluationResult.class); - - /* - * Name of the network security rule. - */ - @JsonProperty(value = "name") - private String name; - - /* - * Value indicating whether protocol is matched. - */ - @JsonProperty(value = "protocolMatched") - private Boolean protocolMatched; - - /* - * Value indicating whether source is matched. - */ - @JsonProperty(value = "sourceMatched") - private Boolean sourceMatched; - - /* - * Value indicating whether source port is matched. - */ - @JsonProperty(value = "sourcePortMatched") - private Boolean sourcePortMatched; - - /* - * Value indicating whether destination is matched. - */ - @JsonProperty(value = "destinationMatched") - private Boolean destinationMatched; - - /* - * Value indicating whether destination port is matched. - */ - @JsonProperty(value = "destinationPortMatched") - private Boolean destinationPortMatched; - - /** - * Get the name property: Name of the network security rule. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Name of the network security rule. - * - * @param name the name value to set. - * @return the NetworkSecurityRulesEvaluationResult object itself. - */ - public NetworkSecurityRulesEvaluationResult withName(String name) { - this.name = name; - return this; - } - - /** - * Get the protocolMatched property: Value indicating whether protocol is matched. - * - * @return the protocolMatched value. - */ - public Boolean protocolMatched() { - return this.protocolMatched; - } - - /** - * Set the protocolMatched property: Value indicating whether protocol is matched. - * - * @param protocolMatched the protocolMatched value to set. - * @return the NetworkSecurityRulesEvaluationResult object itself. - */ - public NetworkSecurityRulesEvaluationResult withProtocolMatched(Boolean protocolMatched) { - this.protocolMatched = protocolMatched; - return this; - } - - /** - * Get the sourceMatched property: Value indicating whether source is matched. - * - * @return the sourceMatched value. - */ - public Boolean sourceMatched() { - return this.sourceMatched; - } - - /** - * Set the sourceMatched property: Value indicating whether source is matched. - * - * @param sourceMatched the sourceMatched value to set. - * @return the NetworkSecurityRulesEvaluationResult object itself. - */ - public NetworkSecurityRulesEvaluationResult withSourceMatched(Boolean sourceMatched) { - this.sourceMatched = sourceMatched; - return this; - } - - /** - * Get the sourcePortMatched property: Value indicating whether source port is matched. - * - * @return the sourcePortMatched value. - */ - public Boolean sourcePortMatched() { - return this.sourcePortMatched; - } - - /** - * Set the sourcePortMatched property: Value indicating whether source port is matched. - * - * @param sourcePortMatched the sourcePortMatched value to set. - * @return the NetworkSecurityRulesEvaluationResult object itself. - */ - public NetworkSecurityRulesEvaluationResult withSourcePortMatched(Boolean sourcePortMatched) { - this.sourcePortMatched = sourcePortMatched; - return this; - } - - /** - * Get the destinationMatched property: Value indicating whether destination is matched. - * - * @return the destinationMatched value. - */ - public Boolean destinationMatched() { - return this.destinationMatched; - } - - /** - * Set the destinationMatched property: Value indicating whether destination is matched. - * - * @param destinationMatched the destinationMatched value to set. - * @return the NetworkSecurityRulesEvaluationResult object itself. - */ - public NetworkSecurityRulesEvaluationResult withDestinationMatched(Boolean destinationMatched) { - this.destinationMatched = destinationMatched; - return this; - } - - /** - * Get the destinationPortMatched property: Value indicating whether destination port is matched. - * - * @return the destinationPortMatched value. - */ - public Boolean destinationPortMatched() { - return this.destinationPortMatched; - } - - /** - * Set the destinationPortMatched property: Value indicating whether destination port is matched. - * - * @param destinationPortMatched the destinationPortMatched value to set. - * @return the NetworkSecurityRulesEvaluationResult object itself. - */ - public NetworkSecurityRulesEvaluationResult withDestinationPortMatched(Boolean destinationPortMatched) { - this.destinationPortMatched = destinationPortMatched; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkUsage.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkUsage.java deleted file mode 100644 index 2a76cd6f0e39..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkUsage.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.network.fluent.models.UsageInner; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; - -/** An immutable client-side representation of an Azure compute resource usage info object. */ -@Fluent -public interface NetworkUsage extends HasInnerModel { - /** @return the unit of measurement. */ - UsageUnit unit(); - - /** @return the current count of the allocated resources in the subscription */ - long currentValue(); - - /** @return the maximum count of the resources that can be allocated in the subscription */ - long limit(); - - /** @return the name of the type of usage */ - UsageName name(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkUsages.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkUsages.java deleted file mode 100644 index 966d2cb803e6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkUsages.java +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListingByRegion; - -/** Entry point for network resource usage management API. */ -@Fluent -public interface NetworkUsages extends SupportsListingByRegion { -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkWatcher.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkWatcher.java deleted file mode 100644 index 5dee5568241d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkWatcher.java +++ /dev/null @@ -1,137 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.network.fluent.models.NetworkWatcherInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.GroupableResource; -import com.azure.resourcemanager.resources.fluentcore.arm.models.Resource; -import com.azure.resourcemanager.resources.fluentcore.model.Appliable; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; -import com.azure.resourcemanager.resources.fluentcore.model.Updatable; -import reactor.core.publisher.Mono; - -/** Entry point for Network Watcher API in Azure. */ -@Fluent -public interface NetworkWatcher - extends GroupableResource, - Refreshable, - Updatable, - UpdatableWithTags { - - /** @return entry point to manage packet captures associated with network watcher */ - PacketCaptures packetCaptures(); - - /** @return entry point to manage connection monitors associated with network watcher */ - ConnectionMonitors connectionMonitors(); - - /** - * First step specifying parameters to get topology of a resource group. - * - * @return current network topology by resource group - */ - Topology.DefinitionStages.WithTargetResourceGroup topology(); - - /** - * Gets the configured and effective security group rules on the specified VM. - * - * @param vmId ID of the target VM - * @return the configured and effective security group rules on the specified VM - */ - SecurityGroupView getSecurityGroupView(String vmId); - - /** - * Gets the configured and effective security group rules on the specified VM asynchronously. - * - * @param vmId ID of the target VM - * @return the configured and effective security group rules on the specified VM - */ - Mono getSecurityGroupViewAsync(String vmId); - - /** - * Gets the information on the configuration of flow log. - * - * @param nsgId the name of the target resource group to get flow log status for - * @return information on the configuration of flow log - */ - FlowLogSettings getFlowLogSettings(String nsgId); - - /** - * Gets the information on the configuration of flow log asynchronously. - * - * @param nsgId the name of the target resource group to get flow log status for - * @return information on the configuration of flow log - */ - Mono getFlowLogSettingsAsync(String nsgId); - - /** - * First step specifying the parameters to get next hop for the VM. - * - * @return a stage to specify parameters for next hop - */ - NextHop.DefinitionStages.WithTargetResource nextHop(); - - /** - * Verify IP flow from the specified VM to a location given the currently configured NSG rules. - * - * @return a stage to specify parameters for ip flow verification - */ - VerificationIPFlow.DefinitionStages.WithTargetResource verifyIPFlow(); - - /** - * Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint - * including another virtual machine or an arbitrary remote server. - * - * @return a stage to specify parameters for connectivity check - */ - ConnectivityCheck.DefinitionStages.ToDestination checkConnectivity(); - - /** - * Initiate troubleshooting on a specified resource (virtual network gateway or virtual network gateway connection). - * - * @return troubleshooting result information - */ - Troubleshooting.DefinitionStages.WithTargetResource troubleshoot(); - - /** - * Lists all available internet service providers for a specified Azure region. - * - * @return a stage to specify parameters for internet providers list - */ - AvailableProviders.DefinitionStages.WithExecute availableProviders(); - - /** - * Gets the relative latency score for internet service providers from a specified location to Azure regions. - * - * @return a stage to specify parameters for internet providers list - */ - AzureReachabilityReport.DefinitionStages.WithProviderLocation azureReachabilityReport(); - - /** Container interface for all the definitions. */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { - } - - /** Grouping of network watcher definition stages. */ - interface DefinitionStages { - /** The first stage of a network watcher definition. */ - interface Blank extends GroupableResource.DefinitionWithRegion { - } - - /** The stage of the network watcher definition allowing to specify the resource group. */ - interface WithGroup extends GroupableResource.DefinitionStages.WithGroup { - } - - /** - * A network watcher with sufficient inputs to create a new network watcher in the cloud, but exposing - * additional optional inputs to specify. - */ - interface WithCreate extends Creatable, Resource.DefinitionWithTags { - } - } - - /** The template for update operation, containing all the settings that can be modified. */ - interface Update extends Appliable, Resource.UpdateWithTags { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkWatcherListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkWatcherListResult.java deleted file mode 100644 index e8955f6a9577..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkWatcherListResult.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.NetworkWatcherInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** List of network watcher resources. */ -@Fluent -public final class NetworkWatcherListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkWatcherListResult.class); - - /* - * The value property. - */ - @JsonProperty(value = "value") - private List value; - - /** - * Get the value property: The value property. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The value property. - * - * @param value the value value to set. - * @return the NetworkWatcherListResult object itself. - */ - public NetworkWatcherListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkWatchers.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkWatchers.java deleted file mode 100644 index 8583ec5597c0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkWatchers.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsBatchDeletion; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsDeletingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsListingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsBatchCreation; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsCreating; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingById; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; - -/** Entry point for Network Watcher API in Azure. */ -@Fluent -public interface NetworkWatchers - extends SupportsListing, - SupportsCreating, - SupportsDeletingById, - SupportsListingByResourceGroup, - SupportsGettingByResourceGroup, - SupportsGettingById, - SupportsDeletingByResourceGroup, - SupportsBatchCreation, - SupportsBatchDeletion, - HasManager { -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/Networks.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/Networks.java deleted file mode 100644 index 737b114a25bc..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/Networks.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsBatchDeletion; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsDeletingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsListingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsBatchCreation; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsCreating; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingById; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; - -/** Entry point to virtual network management API in Azure. */ -@Fluent() -public interface Networks - extends SupportsCreating, - SupportsListing, - SupportsListingByResourceGroup, - SupportsGettingByResourceGroup, - SupportsGettingById, - SupportsDeletingById, - SupportsDeletingByResourceGroup, - SupportsBatchCreation, - SupportsBatchDeletion, - HasManager { -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NextHop.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NextHop.java deleted file mode 100644 index 45a2a92c246d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NextHop.java +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasParent; -import com.azure.resourcemanager.resources.fluentcore.model.Executable; - -/** A client-side representation allowing user to get next hop for a packet from specific vm. */ -@Fluent -public interface NextHop extends Executable, HasParent { - /** - * Get the resource identifier of the target resource against which the action is to be performed. - * - * @return the targetResourceId value - */ - String targetResourceId(); - - /** @return the source IP address */ - String sourceIpAddress(); - - /** @return the destination IP address */ - String destinationIpAddress(); - - /** @return the network interface id */ - String targetNetworkInterfaceId(); - - /** @return the next hop type */ - NextHopType nextHopType(); - - /** @return the next hop IP Address */ - String nextHopIpAddress(); - - /** - * Get the resource identifier for the route table associated with the route being returned. If the route being - * returned does not correspond to any user created routes then this field will be the string 'System Route'. - * - * @return the routeTableId value - */ - String routeTableId(); - - /** The entirety of next hop parameters definition. */ - interface Definition - extends DefinitionStages.WithTargetResource, - DefinitionStages.WithSourceIP, - DefinitionStages.WithDestinationIP, - DefinitionStages.WithExecute { - } - - /** Grouping of next hop definition stages. */ - interface DefinitionStages { - /** The first stage of next hop parameters definition. */ - interface WithTargetResource { - /** - * Set the targetResourceId value. - * - * @param vmId the targetResourceId value to set - * @return the VerificationIPFlow object itself. - */ - WithSourceIP withTargetResourceId(String vmId); - } - - /** Sets the source IP address. */ - interface WithSourceIP { - /** - * Set the sourceIPAddress value. - * - * @param sourceIPAddress the sourceIPAddress value to set - * @return the VerificationIPFlow object itself. - */ - WithDestinationIP withSourceIpAddress(String sourceIPAddress); - } - - /** Sets the destination IP address. */ - interface WithDestinationIP { - /** - * Set the destinationIPAddress value. - * - * @param destinationIPAddress the destinationIPAddress value to set - * @return the VerificationIPFlow object itself. - */ - WithExecute withDestinationIpAddress(String destinationIPAddress); - } - - /** - * Sets the NIC ID. (If VM has multiple NICs and IP forwarding is enabled on any of the nics, then this - * parameter must be specified. Otherwise optional). - */ - interface WithNetworkInterface { - /** - * Set the targetNetworkInterfaceId value. - * - * @param targetNetworkInterfaceId the targetNetworkInterfaceId value to set - * @return the VerificationIPFlow object itself. - */ - WithExecute withTargetNetworkInterfaceId(String targetNetworkInterfaceId); - } - - /** - * The stage of the definition which contains all the minimum required inputs for execution, but also allows for - * any other optional settings to be specified. - */ - interface WithExecute extends Executable, WithNetworkInterface { - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NextHopParameters.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NextHopParameters.java deleted file mode 100644 index 3d47bbae346a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NextHopParameters.java +++ /dev/null @@ -1,152 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Parameters that define the source and destination endpoint. */ -@Fluent -public final class NextHopParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(NextHopParameters.class); - - /* - * The resource identifier of the target resource against which the action - * is to be performed. - */ - @JsonProperty(value = "targetResourceId", required = true) - private String targetResourceId; - - /* - * The source IP address. - */ - @JsonProperty(value = "sourceIPAddress", required = true) - private String sourceIpAddress; - - /* - * The destination IP address. - */ - @JsonProperty(value = "destinationIPAddress", required = true) - private String destinationIpAddress; - - /* - * The NIC ID. (If VM has multiple NICs and IP forwarding is enabled on any - * of the nics, then this parameter must be specified. Otherwise optional). - */ - @JsonProperty(value = "targetNicResourceId") - private String targetNicResourceId; - - /** - * Get the targetResourceId property: The resource identifier of the target resource against which the action is to - * be performed. - * - * @return the targetResourceId value. - */ - public String targetResourceId() { - return this.targetResourceId; - } - - /** - * Set the targetResourceId property: The resource identifier of the target resource against which the action is to - * be performed. - * - * @param targetResourceId the targetResourceId value to set. - * @return the NextHopParameters object itself. - */ - public NextHopParameters withTargetResourceId(String targetResourceId) { - this.targetResourceId = targetResourceId; - return this; - } - - /** - * Get the sourceIpAddress property: The source IP address. - * - * @return the sourceIpAddress value. - */ - public String sourceIpAddress() { - return this.sourceIpAddress; - } - - /** - * Set the sourceIpAddress property: The source IP address. - * - * @param sourceIpAddress the sourceIpAddress value to set. - * @return the NextHopParameters object itself. - */ - public NextHopParameters withSourceIpAddress(String sourceIpAddress) { - this.sourceIpAddress = sourceIpAddress; - return this; - } - - /** - * Get the destinationIpAddress property: The destination IP address. - * - * @return the destinationIpAddress value. - */ - public String destinationIpAddress() { - return this.destinationIpAddress; - } - - /** - * Set the destinationIpAddress property: The destination IP address. - * - * @param destinationIpAddress the destinationIpAddress value to set. - * @return the NextHopParameters object itself. - */ - public NextHopParameters withDestinationIpAddress(String destinationIpAddress) { - this.destinationIpAddress = destinationIpAddress; - return this; - } - - /** - * Get the targetNicResourceId property: The NIC ID. (If VM has multiple NICs and IP forwarding is enabled on any of - * the nics, then this parameter must be specified. Otherwise optional). - * - * @return the targetNicResourceId value. - */ - public String targetNicResourceId() { - return this.targetNicResourceId; - } - - /** - * Set the targetNicResourceId property: The NIC ID. (If VM has multiple NICs and IP forwarding is enabled on any of - * the nics, then this parameter must be specified. Otherwise optional). - * - * @param targetNicResourceId the targetNicResourceId value to set. - * @return the NextHopParameters object itself. - */ - public NextHopParameters withTargetNicResourceId(String targetNicResourceId) { - this.targetNicResourceId = targetNicResourceId; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (targetResourceId() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property targetResourceId in model NextHopParameters")); - } - if (sourceIpAddress() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property sourceIpAddress in model NextHopParameters")); - } - if (destinationIpAddress() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property destinationIpAddress in model NextHopParameters")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NextHopType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NextHopType.java deleted file mode 100644 index ff638185c4b7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NextHopType.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for NextHopType. */ -public final class NextHopType extends ExpandableStringEnum { - /** Static value Internet for NextHopType. */ - public static final NextHopType INTERNET = fromString("Internet"); - - /** Static value VirtualAppliance for NextHopType. */ - public static final NextHopType VIRTUAL_APPLIANCE = fromString("VirtualAppliance"); - - /** Static value VirtualNetworkGateway for NextHopType. */ - public static final NextHopType VIRTUAL_NETWORK_GATEWAY = fromString("VirtualNetworkGateway"); - - /** Static value VnetLocal for NextHopType. */ - public static final NextHopType VNET_LOCAL = fromString("VnetLocal"); - - /** Static value HyperNetGateway for NextHopType. */ - public static final NextHopType HYPER_NET_GATEWAY = fromString("HyperNetGateway"); - - /** Static value None for NextHopType. */ - public static final NextHopType NONE = fromString("None"); - - /** - * Creates or finds a NextHopType from its string representation. - * - * @param name a name to look for. - * @return the corresponding NextHopType. - */ - @JsonCreator - public static NextHopType fromString(String name) { - return fromString(name, NextHopType.class); - } - - /** @return known NextHopType values. */ - public static Collection values() { - return values(NextHopType.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NicIpConfiguration.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NicIpConfiguration.java deleted file mode 100644 index 2441c4d31d57..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NicIpConfiguration.java +++ /dev/null @@ -1,490 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.network.fluent.models.NetworkInterfaceIpConfigurationInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.ChildResource; -import com.azure.resourcemanager.resources.fluentcore.model.Attachable; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.model.Settable; - -/** An IP configuration in a network interface. */ -@Fluent() -public interface NicIpConfiguration - extends NicIpConfigurationBase, - HasInnerModel, - ChildResource, - HasPublicIpAddress { - - /** - * The entirety of the network interface IP configuration definition. - * - * @param the stage of the parent network interface definition to return to after attaching this - * definition - */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithAttach, - DefinitionStages.WithNetwork, - DefinitionStages.WithSubnet, - DefinitionStages.WithPrivateIP { - } - - /** - * Grouping of network interface IP configuration definition stages applicable as part of a network interface - * update. - */ - interface DefinitionStages { - /** - * The first stage of network interface IP configuration definition. - * - * @param the stage of the parent network interface definition to return to after attaching this - * definition - */ - interface Blank extends WithNetwork { - } - - /** - * The stage of the network interface IP configuration definition allowing to specify the virtual network. - * - * @param the stage of the parent network interface definition to return to after attaching this - * definition - */ - interface WithNetwork { - /** - * Create a new virtual network to associate with the network interface IP configuration, based on the - * provided definition. - * - * @param creatable a creatable definition for a new virtual network - * @return the next stage of the definition - */ - WithPrivateIP withNewNetwork(Creatable creatable); - - /** - * Creates a new virtual network to associate with the network interface IP configuration. - * - *

    the virtual network will be created in the same resource group and region as of parent network - * interface, it will be created with the specified address space and a default subnet covering the entirety - * of the network IP address space. - * - * @param name the name of the new virtual network - * @param addressSpace the address space for rhe virtual network - * @return the next stage of the definition - */ - WithPrivateIP withNewNetwork(String name, String addressSpace); - - /** - * Creates a new virtual network to associate with the network interface IP configuration. - * - *

    the virtual network will be created in the same resource group and region as of parent network - * interface, it will be created with the specified address space and a default subnet covering the entirety - * of the network IP address space. - * - * @param addressSpace the address space for the virtual network - * @return the next stage of the definition - */ - WithPrivateIP withNewNetwork(String addressSpace); - - /** - * Associate an existing virtual network with the network interface IP configuration. - * - * @param network an existing virtual network - * @return the next stage of the definition - */ - WithSubnet withExistingNetwork(Network network); - } - - /** - * The stage of the network interface IP configuration definition allowing to specify private IP address within - * a virtual network subnet. - * - * @param the stage of the parent network interface definition to return to after attaching this - * definition - */ - interface WithPrivateIP - extends HasPrivateIpAddress.DefinitionStages.WithPrivateIPAddress> { - /** - * Specifies the IP version for the private IP address. - * - * @param ipVersion an IP version - * @return the next stage of the definition - */ - WithAttach withPrivateIpVersion(IpVersion ipVersion); - } - - /** - * The stage of the network interface IP configuration definition allowing to specify subnet. - * - * @param the return type of the final {@link Attachable#attach()} - */ - interface WithSubnet { - /** - * Associate a subnet with the network interface IP configuration. - * - * @param name the subnet name - * @return the next stage of the definition - */ - WithPrivateIP withSubnet(String name); - } - - /** - * The stage of the network interface IP configuration definition allowing to associate it with a public IP - * address. - * - * @param the stage of the parent network interface definition to return to after attaching this - * definition - */ - interface WithPublicIPAddress - extends HasPublicIpAddress.DefinitionStages.WithPublicIPAddress> { - } - - /** - * The stage of the network interface IP configuration definition allowing to specify the load balancer to - * associate this IP configuration with. - * - * @param the stage of the parent network interface definition to return to after attaching this - * definition - */ - interface WithLoadBalancer { - /** - * Specifies the load balancer backend to associate this IP configuration with. - * - * @param loadBalancer an existing load balancer - * @param backendName the name of an existing backend on that load balancer - * @return the next stage of the definition - */ - WithAttach withExistingLoadBalancerBackend(LoadBalancer loadBalancer, String backendName); - - /** - * Specifies the load balancer inbound NAT rule to associate this IP configuration with. - * - * @param loadBalancer an existing load balancer - * @param inboundNatRuleName the name of an existing inbound NAT rule on the selected load balancer - * @return the next stage of the definition - */ - WithAttach withExistingLoadBalancerInboundNatRule( - LoadBalancer loadBalancer, String inboundNatRuleName); - } - - /** - * The stage of the network interface IP configuration definition allowing to specify the load balancer to - * associate this IP configuration with. - * - * @param the stage of the parent network interface definition to return to after attaching this - * definition - */ - interface WithApplicationGateway { - /** - * Specifies the application gateway backend to associate this IP configuration with. - * - * @param appGateway an existing application gateway - * @param backendName the name of an existing backend on the application gateway - * @return the next stage of the definition - */ - WithAttach withExistingApplicationGatewayBackend( - ApplicationGateway appGateway, String backendName); - } - - /** - * The final stage of network interface IP configuration. - * - *

    At this stage, any remaining optional settings can be specified, or the network interface IP configuration - * definition can be attached to the parent network interface definition. - * - * @param the stage of the parent network interface definition to return to after attaching this - * definition - */ - interface WithAttach - extends Attachable.InDefinition, - WithPublicIPAddress, - WithLoadBalancer, - WithApplicationGateway { - } - } - - /** - * The entirety of a network interface IP configuration definition as part of a network interface update. - * - * @param the return type of the final {@link UpdateDefinitionStages.WithAttach#attach()} - */ - interface UpdateDefinition - extends UpdateDefinitionStages.Blank, - UpdateDefinitionStages.WithAttach, - UpdateDefinitionStages.WithNetwork, - UpdateDefinitionStages.WithPrivateIP, - UpdateDefinitionStages.WithSubnet, - UpdateDefinitionStages.WithPublicIPAddress { - } - - /** Grouping of network interface IP configuration definition stages. */ - interface UpdateDefinitionStages { - /** - * The first stage of network interface IP configuration definition. - * - * @param the stage of the parent network interface update to return to after attaching this - * definition - */ - interface Blank extends WithNetwork { - } - - /** - * The stage of the network interface IP configuration definition allowing to specify the virtual network. - * - * @param the stage of the parent network interface update to return to after attaching this - * definition - */ - interface WithNetwork { - /** - * Create a new virtual network to associate with the network interface IP configuration, based on the - * provided definition. - * - * @param creatable a creatable definition for a new virtual network - * @return the next stage of the definition - */ - WithPrivateIP withNewNetwork(Creatable creatable); - - /** - * Creates a new virtual network to associate with the network interface IP configuration. - * - *

    the virtual network will be created in the same resource group and region as of parent network - * interface, it will be created with the specified address space and a default subnet covering the entirety - * of the network IP address space. - * - * @param name the name of the new virtual network - * @param addressSpace the address space for rhe virtual network - * @return the next stage of the definition - */ - WithPrivateIP withNewNetwork(String name, String addressSpace); - - /** - * Creates a new virtual network to associate with the network interface IP configuration. - * - *

    the virtual network will be created in the same resource group and region as of parent network - * interface, it will be created with the specified address space and a default subnet covering the entirety - * of the network IP address space. - * - * @param addressSpace the address space for the virtual network - * @return the next stage of the definition - */ - WithPrivateIP withNewNetwork(String addressSpace); - - /** - * Associate an existing virtual network with the network interface IP configuration. - * - * @param network an existing virtual network - * @return the next stage of the definition - */ - WithSubnet withExistingNetwork(Network network); - } - - /** - * The stage of the network interface IP configuration definition allowing to specify private IP address within - * a virtual network subnet. - * - * @param the stage of the parent network interface update to return to after attaching this - * definition - */ - interface WithPrivateIP - extends HasPrivateIpAddress.UpdateDefinitionStages.WithPrivateIPAddress> { - /** - * Specifies the IP version for the private IP address. - * - * @param ipVersion an IP version - * @return the next stage of the definition - */ - WithAttach withPrivateIpVersion(IpVersion ipVersion); - } - - /** - * The stage of the network interface IP configuration definition allowing to specify subnet. - * - * @param the stage of the parent network interface update to return to after attaching this - * definition - */ - interface WithSubnet { - /** - * Associate a subnet with the network interface IP configuration. - * - * @param name the subnet name - * @return the next stage of the definition - */ - WithPrivateIP withSubnet(String name); - } - - /** - * The stage of the network interface IP configuration definition allowing to associate it with a public IP - * address. - * - * @param the stage of the parent network interface update to return to after attaching this - * definition - */ - interface WithPublicIPAddress - extends HasPublicIpAddress.UpdateDefinitionStages.WithPublicIPAddress> { - } - - /** - * The stage of the network interface IP configuration definition allowing to specify the load balancer to - * associate this IP configuration with. - * - * @param the stage of the parent network interface update to return to after attaching this - * definition - */ - interface WithLoadBalancer { - /** - * Specifies the load balancer to associate this IP configuration with. - * - * @param loadBalancer an existing load balancer - * @param backendName the name of an existing backend on that load balancer - * @return the next stage of the update - */ - WithAttach withExistingLoadBalancerBackend(LoadBalancer loadBalancer, String backendName); - - /** - * Specifies the load balancer inbound NAT rule to associate this IP configuration with. - * - * @param loadBalancer an existing load balancer - * @param inboundNatRuleName the name of an existing inbound NAT rule on the selected load balancer - * @return the next stage of the update - */ - WithAttach withExistingLoadBalancerInboundNatRule( - LoadBalancer loadBalancer, String inboundNatRuleName); - } - - /** - * The stage of the network interface IP configuration definition allowing to specify the load balancer to - * associate this IP configuration with. - * - * @param the stage of the parent network interface update to return to after attaching this - * definition - */ - interface WithApplicationGateway { - /** - * Specifies the application gateway backend to associate this IP configuration with. - * - * @param appGateway an existing application gateway - * @param backendName the name of an existing backend on the application gateway - * @return the next stage of the definition - */ - WithAttach withExistingApplicationGatewayBackend( - ApplicationGateway appGateway, String backendName); - } - - /** - * The final stage of network interface IP configuration. - * - *

    At this stage, any remaining optional settings can be specified, or the network interface IP configuration - * definition can be attached to the parent network interface definition using {@link WithAttach#attach()}. - * - * @param the stage of the parent network interface update to return to after attaching this - * definition - */ - interface WithAttach - extends Attachable.InUpdate, - WithPublicIPAddress, - WithLoadBalancer, - WithApplicationGateway { - } - } - - /** The entirety of a network interface IP configuration update as part of a network interface update. */ - interface Update - extends Settable, - UpdateStages.WithSubnet, - UpdateStages.WithPrivateIP, - UpdateStages.WithPublicIPAddress, - UpdateStages.WithLoadBalancer, - UpdateStages.WithApplicationGateway { - } - - /** Grouping of network interface IP configuration update stages. */ - interface UpdateStages { - /** The stage of the network interface IP configuration update allowing to specify subnet. */ - interface WithSubnet { - /** - * Associate a subnet with the network interface IP configuration. - * - * @param name the subnet name - * @return the next stage of the network interface IP configuration update - */ - Update withSubnet(String name); - } - - /** The stage of the network interface IP configuration update allowing to specify private IP. */ - interface WithPrivateIP extends HasPrivateIpAddress.UpdateStages.WithPrivateIPAddress { - /** - * Specifies the IP version for the private IP address. - * - * @param ipVersion an IP version - * @return the next stage of the update - */ - Update withPrivateIpVersion(IpVersion ipVersion); - } - - /** The stage of the network interface IP configuration update allowing to specify public IP address. */ - interface WithPublicIPAddress extends HasPublicIpAddress.UpdateStages.WithPublicIPAddress { - } - - /** - * The stage of the network interface's IP configuration allowing to specify the load balancer to associate this - * IP configuration with. - */ - interface WithLoadBalancer { - /** - * Specifies the load balancer to associate this IP configuration with. - * - * @param loadBalancer an existing load balancer - * @param backendName the name of an existing backend on that load balancer - * @return the next stage of the update - */ - Update withExistingLoadBalancerBackend(LoadBalancer loadBalancer, String backendName); - - /** - * Specifies the load balancer inbound NAT rule to associate this IP configuration with. - * - * @param loadBalancer an existing load balancer - * @param inboundNatRuleName the name of an existing inbound NAT rule on the selected load balancer - * @return the next stage of the update - */ - Update withExistingLoadBalancerInboundNatRule(LoadBalancer loadBalancer, String inboundNatRuleName); - - /** - * Removes all the existing associations with load balancer backends. - * - * @return the next stage of the update - */ - Update withoutLoadBalancerBackends(); - - /** - * Removes all the existing associations with load balancer inbound NAT rules. - * - * @return the next stage of the update - */ - Update withoutLoadBalancerInboundNatRules(); - } - - /** - * The stage of the network interface IP configuration update allowing to specify the load balancer to associate - * this IP configuration with. - */ - interface WithApplicationGateway { - /** - * Specifies the application gateway backend to associate this IP configuration with. - * - * @param appGateway an existing application gateway - * @param backendName the name of an existing backend on the application gateway - * @return the next stage of the update - */ - Update withExistingApplicationGatewayBackend(ApplicationGateway appGateway, String backendName); - - /** - * Removes all existing associations with application gateway backends. - * - * @return the next stage of the update - */ - Update withoutApplicationGatewayBackends(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NicIpConfigurationBase.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NicIpConfigurationBase.java deleted file mode 100644 index 06c0920c5e91..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NicIpConfigurationBase.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasSubnet; -import java.util.Collection; -import java.util.List; - -/** - * The base IP configuration shared across IP configurations in regular and virtual machine scale set network interface. - */ -@Fluent -public interface NicIpConfigurationBase extends HasSubnet, HasPrivateIpAddress { - /** @return true if this is the primary IP configuration */ - boolean isPrimary(); - - /** @return the virtual network associated with this IP configuration */ - Network getNetwork(); - - /** - * @return the network security group, if any, associated with the subnet, if any, assigned to this network - * interface IP configuration - *

    (Note that this results in additional calls to Azure.) - */ - NetworkSecurityGroup getNetworkSecurityGroup(); - - /** @return private IP address version */ - IpVersion privateIpAddressVersion(); - - /** @return the load balancer backends associated with this network interface IP configuration */ - // TODO: This should be a Collection - List listAssociatedLoadBalancerBackends(); - - /** @return the load balancer inbound NAT rules associated with this network interface IP configuration */ - // TODO: This should be a Collection - List listAssociatedLoadBalancerInboundNatRules(); - - /** @return the application gateway backends associated with this network IP configuration */ - Collection listAssociatedApplicationGatewayBackends(); - - /** - * @return the application security groups associated with this network IP configuration - */ - List listAssociatedApplicationSecurityGroups(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/OfficeTrafficCategory.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/OfficeTrafficCategory.java deleted file mode 100644 index 648624fdc716..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/OfficeTrafficCategory.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for OfficeTrafficCategory. */ -public final class OfficeTrafficCategory extends ExpandableStringEnum { - /** Static value Optimize for OfficeTrafficCategory. */ - public static final OfficeTrafficCategory OPTIMIZE = fromString("Optimize"); - - /** Static value OptimizeAndAllow for OfficeTrafficCategory. */ - public static final OfficeTrafficCategory OPTIMIZE_AND_ALLOW = fromString("OptimizeAndAllow"); - - /** Static value All for OfficeTrafficCategory. */ - public static final OfficeTrafficCategory ALL = fromString("All"); - - /** Static value None for OfficeTrafficCategory. */ - public static final OfficeTrafficCategory NONE = fromString("None"); - - /** - * Creates or finds a OfficeTrafficCategory from its string representation. - * - * @param name a name to look for. - * @return the corresponding OfficeTrafficCategory. - */ - @JsonCreator - public static OfficeTrafficCategory fromString(String name) { - return fromString(name, OfficeTrafficCategory.class); - } - - /** @return known OfficeTrafficCategory values. */ - public static Collection values() { - return values(OfficeTrafficCategory.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/OperationDisplay.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/OperationDisplay.java deleted file mode 100644 index 5b35a6f89299..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/OperationDisplay.java +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Display metadata associated with the operation. */ -@Fluent -public final class OperationDisplay { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationDisplay.class); - - /* - * Service provider: Microsoft Network. - */ - @JsonProperty(value = "provider") - private String provider; - - /* - * Resource on which the operation is performed. - */ - @JsonProperty(value = "resource") - private String resource; - - /* - * Type of the operation: get, read, delete, etc. - */ - @JsonProperty(value = "operation") - private String operation; - - /* - * Description of the operation. - */ - @JsonProperty(value = "description") - private String description; - - /** - * Get the provider property: Service provider: Microsoft Network. - * - * @return the provider value. - */ - public String provider() { - return this.provider; - } - - /** - * Set the provider property: Service provider: Microsoft Network. - * - * @param provider the provider value to set. - * @return the OperationDisplay object itself. - */ - public OperationDisplay withProvider(String provider) { - this.provider = provider; - return this; - } - - /** - * Get the resource property: Resource on which the operation is performed. - * - * @return the resource value. - */ - public String resource() { - return this.resource; - } - - /** - * Set the resource property: Resource on which the operation is performed. - * - * @param resource the resource value to set. - * @return the OperationDisplay object itself. - */ - public OperationDisplay withResource(String resource) { - this.resource = resource; - return this; - } - - /** - * Get the operation property: Type of the operation: get, read, delete, etc. - * - * @return the operation value. - */ - public String operation() { - return this.operation; - } - - /** - * Set the operation property: Type of the operation: get, read, delete, etc. - * - * @param operation the operation value to set. - * @return the OperationDisplay object itself. - */ - public OperationDisplay withOperation(String operation) { - this.operation = operation; - return this; - } - - /** - * Get the description property: Description of the operation. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: Description of the operation. - * - * @param description the description value to set. - * @return the OperationDisplay object itself. - */ - public OperationDisplay withDescription(String description) { - this.description = description; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/OperationListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/OperationListResult.java deleted file mode 100644 index 917bbd5e6a5b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/OperationListResult.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.OperationInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** - * Result of the request to list Network operations. It contains a list of operations and a URL link to get the next set - * of results. - */ -@Fluent -public final class OperationListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationListResult.class); - - /* - * List of Network operations supported by the Network resource provider. - */ - @JsonProperty(value = "value") - private List value; - - /* - * URL to get the next set of operation list results if there are any. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: List of Network operations supported by the Network resource provider. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: List of Network operations supported by the Network resource provider. - * - * @param value the value value to set. - * @return the OperationListResult object itself. - */ - public OperationListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: URL to get the next set of operation list results if there are any. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: URL to get the next set of operation list results if there are any. - * - * @param nextLink the nextLink value to set. - * @return the OperationListResult object itself. - */ - public OperationListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/OperationPropertiesFormatServiceSpecification.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/OperationPropertiesFormatServiceSpecification.java deleted file mode 100644 index 0546be0bc436..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/OperationPropertiesFormatServiceSpecification.java +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Specification of the service. */ -@Fluent -public final class OperationPropertiesFormatServiceSpecification { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(OperationPropertiesFormatServiceSpecification.class); - - /* - * Operation service specification. - */ - @JsonProperty(value = "metricSpecifications") - private List metricSpecifications; - - /* - * Operation log specification. - */ - @JsonProperty(value = "logSpecifications") - private List logSpecifications; - - /** - * Get the metricSpecifications property: Operation service specification. - * - * @return the metricSpecifications value. - */ - public List metricSpecifications() { - return this.metricSpecifications; - } - - /** - * Set the metricSpecifications property: Operation service specification. - * - * @param metricSpecifications the metricSpecifications value to set. - * @return the OperationPropertiesFormatServiceSpecification object itself. - */ - public OperationPropertiesFormatServiceSpecification withMetricSpecifications( - List metricSpecifications) { - this.metricSpecifications = metricSpecifications; - return this; - } - - /** - * Get the logSpecifications property: Operation log specification. - * - * @return the logSpecifications value. - */ - public List logSpecifications() { - return this.logSpecifications; - } - - /** - * Set the logSpecifications property: Operation log specification. - * - * @param logSpecifications the logSpecifications value to set. - * @return the OperationPropertiesFormatServiceSpecification object itself. - */ - public OperationPropertiesFormatServiceSpecification withLogSpecifications( - List logSpecifications) { - this.logSpecifications = logSpecifications; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (metricSpecifications() != null) { - metricSpecifications().forEach(e -> e.validate()); - } - if (logSpecifications() != null) { - logSpecifications().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/Origin.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/Origin.java deleted file mode 100644 index f33787f9b08f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/Origin.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for Origin. */ -public final class Origin extends ExpandableStringEnum { - /** Static value Local for Origin. */ - public static final Origin LOCAL = fromString("Local"); - - /** Static value Inbound for Origin. */ - public static final Origin INBOUND = fromString("Inbound"); - - /** Static value Outbound for Origin. */ - public static final Origin OUTBOUND = fromString("Outbound"); - - /** - * Creates or finds a Origin from its string representation. - * - * @param name a name to look for. - * @return the corresponding Origin. - */ - @JsonCreator - public static Origin fromString(String name) { - return fromString(name, Origin.class); - } - - /** @return known Origin values. */ - public static Collection values() { - return values(Origin.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/P2SVpnProfileParameters.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/P2SVpnProfileParameters.java deleted file mode 100644 index 9e5e5809e633..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/P2SVpnProfileParameters.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Vpn Client Parameters for package generation. */ -@Fluent -public final class P2SVpnProfileParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(P2SVpnProfileParameters.class); - - /* - * VPN client Authentication Method. Possible values are: 'EAPTLS' and - * 'EAPMSCHAPv2'. - */ - @JsonProperty(value = "authenticationMethod") - private AuthenticationMethod authenticationMethod; - - /** - * Get the authenticationMethod property: VPN client Authentication Method. Possible values are: 'EAPTLS' and - * 'EAPMSCHAPv2'. - * - * @return the authenticationMethod value. - */ - public AuthenticationMethod authenticationMethod() { - return this.authenticationMethod; - } - - /** - * Set the authenticationMethod property: VPN client Authentication Method. Possible values are: 'EAPTLS' and - * 'EAPMSCHAPv2'. - * - * @param authenticationMethod the authenticationMethod value to set. - * @return the P2SVpnProfileParameters object itself. - */ - public P2SVpnProfileParameters withAuthenticationMethod(AuthenticationMethod authenticationMethod) { - this.authenticationMethod = authenticationMethod; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/P2SVpnServerConfigRadiusClientRootCertificate.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/P2SVpnServerConfigRadiusClientRootCertificate.java deleted file mode 100644 index 30cfc4e1cf24..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/P2SVpnServerConfigRadiusClientRootCertificate.java +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.P2SVpnServerConfigRadiusClientRootCertificatePropertiesFormat; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Radius client root certificate of P2SVpnServerConfiguration. */ -@Fluent -public final class P2SVpnServerConfigRadiusClientRootCertificate extends SubResource { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(P2SVpnServerConfigRadiusClientRootCertificate.class); - - /* - * Properties of the Radius client root certificate. - */ - @JsonProperty(value = "properties") - private P2SVpnServerConfigRadiusClientRootCertificatePropertiesFormat innerProperties; - - /* - * The name of the resource that is unique within a resource group. This - * name can be used to access the resource. - */ - @JsonProperty(value = "name") - private String name; - - /* - * A unique read-only string that changes whenever the resource is updated. - */ - @JsonProperty(value = "etag") - private String etag; - - /** - * Get the innerProperties property: Properties of the Radius client root certificate. - * - * @return the innerProperties value. - */ - private P2SVpnServerConfigRadiusClientRootCertificatePropertiesFormat innerProperties() { - return this.innerProperties; - } - - /** - * Get the name property: The name of the resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @param name the name value to set. - * @return the P2SVpnServerConfigRadiusClientRootCertificate object itself. - */ - public P2SVpnServerConfigRadiusClientRootCertificate withName(String name) { - this.name = name; - return this; - } - - /** - * Get the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @param etag the etag value to set. - * @return the P2SVpnServerConfigRadiusClientRootCertificate object itself. - */ - public P2SVpnServerConfigRadiusClientRootCertificate withEtag(String etag) { - this.etag = etag; - return this; - } - - /** {@inheritDoc} */ - @Override - public P2SVpnServerConfigRadiusClientRootCertificate withId(String id) { - super.withId(id); - return this; - } - - /** - * Get the thumbprint property: The Radius client root certificate thumbprint. - * - * @return the thumbprint value. - */ - public String thumbprint() { - return this.innerProperties() == null ? null : this.innerProperties().thumbprint(); - } - - /** - * Set the thumbprint property: The Radius client root certificate thumbprint. - * - * @param thumbprint the thumbprint value to set. - * @return the P2SVpnServerConfigRadiusClientRootCertificate object itself. - */ - public P2SVpnServerConfigRadiusClientRootCertificate withThumbprint(String thumbprint) { - if (this.innerProperties() == null) { - this.innerProperties = new P2SVpnServerConfigRadiusClientRootCertificatePropertiesFormat(); - } - this.innerProperties().withThumbprint(thumbprint); - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the Radius client root certificate resource. - * Possible values are: 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/P2SVpnServerConfigRadiusServerRootCertificate.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/P2SVpnServerConfigRadiusServerRootCertificate.java deleted file mode 100644 index b727ea631622..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/P2SVpnServerConfigRadiusServerRootCertificate.java +++ /dev/null @@ -1,148 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.P2SVpnServerConfigRadiusServerRootCertificatePropertiesFormat; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Radius Server root certificate of P2SVpnServerConfiguration. */ -@Fluent -public final class P2SVpnServerConfigRadiusServerRootCertificate extends SubResource { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(P2SVpnServerConfigRadiusServerRootCertificate.class); - - /* - * Properties of the P2SVpnServerConfiguration Radius Server root - * certificate. - */ - @JsonProperty(value = "properties", required = true) - private P2SVpnServerConfigRadiusServerRootCertificatePropertiesFormat innerProperties = - new P2SVpnServerConfigRadiusServerRootCertificatePropertiesFormat(); - - /* - * The name of the resource that is unique within a resource group. This - * name can be used to access the resource. - */ - @JsonProperty(value = "name") - private String name; - - /* - * A unique read-only string that changes whenever the resource is updated. - */ - @JsonProperty(value = "etag") - private String etag; - - /** - * Get the innerProperties property: Properties of the P2SVpnServerConfiguration Radius Server root certificate. - * - * @return the innerProperties value. - */ - private P2SVpnServerConfigRadiusServerRootCertificatePropertiesFormat innerProperties() { - return this.innerProperties; - } - - /** - * Get the name property: The name of the resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @param name the name value to set. - * @return the P2SVpnServerConfigRadiusServerRootCertificate object itself. - */ - public P2SVpnServerConfigRadiusServerRootCertificate withName(String name) { - this.name = name; - return this; - } - - /** - * Get the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @param etag the etag value to set. - * @return the P2SVpnServerConfigRadiusServerRootCertificate object itself. - */ - public P2SVpnServerConfigRadiusServerRootCertificate withEtag(String etag) { - this.etag = etag; - return this; - } - - /** {@inheritDoc} */ - @Override - public P2SVpnServerConfigRadiusServerRootCertificate withId(String id) { - super.withId(id); - return this; - } - - /** - * Get the publicCertData property: The certificate public data. - * - * @return the publicCertData value. - */ - public String publicCertData() { - return this.innerProperties() == null ? null : this.innerProperties().publicCertData(); - } - - /** - * Set the publicCertData property: The certificate public data. - * - * @param publicCertData the publicCertData value to set. - * @return the P2SVpnServerConfigRadiusServerRootCertificate object itself. - */ - public P2SVpnServerConfigRadiusServerRootCertificate withPublicCertData(String publicCertData) { - if (this.innerProperties() == null) { - this.innerProperties = new P2SVpnServerConfigRadiusServerRootCertificatePropertiesFormat(); - } - this.innerProperties().withPublicCertData(publicCertData); - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the P2SVpnServerConfiguration Radius Server root - * certificate resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property innerProperties in model" - + " P2SVpnServerConfigRadiusServerRootCertificate")); - } else { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/P2SVpnServerConfigVpnClientRevokedCertificate.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/P2SVpnServerConfigVpnClientRevokedCertificate.java deleted file mode 100644 index fee7e0480919..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/P2SVpnServerConfigVpnClientRevokedCertificate.java +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.P2SVpnServerConfigVpnClientRevokedCertificatePropertiesFormat; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** VPN client revoked certificate of P2SVpnServerConfiguration. */ -@Fluent -public final class P2SVpnServerConfigVpnClientRevokedCertificate extends SubResource { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(P2SVpnServerConfigVpnClientRevokedCertificate.class); - - /* - * Properties of the vpn client revoked certificate. - */ - @JsonProperty(value = "properties") - private P2SVpnServerConfigVpnClientRevokedCertificatePropertiesFormat innerProperties; - - /* - * The name of the resource that is unique within a resource group. This - * name can be used to access the resource. - */ - @JsonProperty(value = "name") - private String name; - - /* - * A unique read-only string that changes whenever the resource is updated. - */ - @JsonProperty(value = "etag") - private String etag; - - /** - * Get the innerProperties property: Properties of the vpn client revoked certificate. - * - * @return the innerProperties value. - */ - private P2SVpnServerConfigVpnClientRevokedCertificatePropertiesFormat innerProperties() { - return this.innerProperties; - } - - /** - * Get the name property: The name of the resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @param name the name value to set. - * @return the P2SVpnServerConfigVpnClientRevokedCertificate object itself. - */ - public P2SVpnServerConfigVpnClientRevokedCertificate withName(String name) { - this.name = name; - return this; - } - - /** - * Get the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @param etag the etag value to set. - * @return the P2SVpnServerConfigVpnClientRevokedCertificate object itself. - */ - public P2SVpnServerConfigVpnClientRevokedCertificate withEtag(String etag) { - this.etag = etag; - return this; - } - - /** {@inheritDoc} */ - @Override - public P2SVpnServerConfigVpnClientRevokedCertificate withId(String id) { - super.withId(id); - return this; - } - - /** - * Get the thumbprint property: The revoked VPN client certificate thumbprint. - * - * @return the thumbprint value. - */ - public String thumbprint() { - return this.innerProperties() == null ? null : this.innerProperties().thumbprint(); - } - - /** - * Set the thumbprint property: The revoked VPN client certificate thumbprint. - * - * @param thumbprint the thumbprint value to set. - * @return the P2SVpnServerConfigVpnClientRevokedCertificate object itself. - */ - public P2SVpnServerConfigVpnClientRevokedCertificate withThumbprint(String thumbprint) { - if (this.innerProperties() == null) { - this.innerProperties = new P2SVpnServerConfigVpnClientRevokedCertificatePropertiesFormat(); - } - this.innerProperties().withThumbprint(thumbprint); - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the VPN client revoked certificate resource. - * Possible values are: 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/P2SVpnServerConfigVpnClientRootCertificate.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/P2SVpnServerConfigVpnClientRootCertificate.java deleted file mode 100644 index 326dc84615b6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/P2SVpnServerConfigVpnClientRootCertificate.java +++ /dev/null @@ -1,146 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.P2SVpnServerConfigVpnClientRootCertificatePropertiesFormat; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** VPN client root certificate of P2SVpnServerConfiguration. */ -@Fluent -public final class P2SVpnServerConfigVpnClientRootCertificate extends SubResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(P2SVpnServerConfigVpnClientRootCertificate.class); - - /* - * Properties of the P2SVpnServerConfiguration VPN client root certificate. - */ - @JsonProperty(value = "properties", required = true) - private P2SVpnServerConfigVpnClientRootCertificatePropertiesFormat innerProperties = - new P2SVpnServerConfigVpnClientRootCertificatePropertiesFormat(); - - /* - * The name of the resource that is unique within a resource group. This - * name can be used to access the resource. - */ - @JsonProperty(value = "name") - private String name; - - /* - * A unique read-only string that changes whenever the resource is updated. - */ - @JsonProperty(value = "etag") - private String etag; - - /** - * Get the innerProperties property: Properties of the P2SVpnServerConfiguration VPN client root certificate. - * - * @return the innerProperties value. - */ - private P2SVpnServerConfigVpnClientRootCertificatePropertiesFormat innerProperties() { - return this.innerProperties; - } - - /** - * Get the name property: The name of the resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @param name the name value to set. - * @return the P2SVpnServerConfigVpnClientRootCertificate object itself. - */ - public P2SVpnServerConfigVpnClientRootCertificate withName(String name) { - this.name = name; - return this; - } - - /** - * Get the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @param etag the etag value to set. - * @return the P2SVpnServerConfigVpnClientRootCertificate object itself. - */ - public P2SVpnServerConfigVpnClientRootCertificate withEtag(String etag) { - this.etag = etag; - return this; - } - - /** {@inheritDoc} */ - @Override - public P2SVpnServerConfigVpnClientRootCertificate withId(String id) { - super.withId(id); - return this; - } - - /** - * Get the publicCertData property: The certificate public data. - * - * @return the publicCertData value. - */ - public String publicCertData() { - return this.innerProperties() == null ? null : this.innerProperties().publicCertData(); - } - - /** - * Set the publicCertData property: The certificate public data. - * - * @param publicCertData the publicCertData value to set. - * @return the P2SVpnServerConfigVpnClientRootCertificate object itself. - */ - public P2SVpnServerConfigVpnClientRootCertificate withPublicCertData(String publicCertData) { - if (this.innerProperties() == null) { - this.innerProperties = new P2SVpnServerConfigVpnClientRootCertificatePropertiesFormat(); - } - this.innerProperties().withPublicCertData(publicCertData); - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the P2SVpnServerConfiguration VPN client root - * certificate resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property innerProperties in model" - + " P2SVpnServerConfigVpnClientRootCertificate")); - } else { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/PCFilter.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/PCFilter.java deleted file mode 100644 index 2181c1482eb7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/PCFilter.java +++ /dev/null @@ -1,207 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasParent; -import com.azure.resourcemanager.resources.fluentcore.model.Attachable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.model.Indexable; -import java.util.List; - -/** Client-side representation of packet capture filter. */ -@Fluent -public interface PCFilter extends Indexable, HasParent, HasInnerModel { - /** @return protocol to be filtered on. */ - PcProtocol protocol(); - - /** - * @return local IP Address to be filtered on. Notation: "127.0.0.1" for single address entry. - * "127.0.0.1-127.0.0.255" for range. "127.0.0.1;127.0.0.5"? for multiple entries. Multiple ranges not currently - * supported. Mixing ranges with multiple entries not currently supported. Default = null. - */ - String localIpAddress(); - - /** - * @return remote IP Address to be filtered on. Notation: "127.0.0.1" for single address entry. - * "127.0.0.1-127.0.0.255" for range. "127.0.0.1;127.0.0.5;" for multiple entries. Multiple ranges not currently - * supported. Mixing ranges with multiple entries not currently supported. Default = null. - */ - String remoteIpAddress(); - - /** - * @return local port to be filtered on. Notation: "80" for single port entry."80-85" for range. "80;443;" for - * multiple entries. Multiple ranges not currently supported. Mixing ranges with multiple entries not currently - * supported. Default = null. - */ - String localPort(); - - /** - * @return remote port to be filtered on. Notation: "80" for single port entry."80-85" for range. "80;443;" for - * multiple entries. Multiple ranges not currently supported. Mixing ranges with multiple entries not currently - * supported. Default = null. - */ - String remotePort(); - - /** - * Definition of packet capture filter. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface Definition extends PCFilter.DefinitionStages.WithAttach { - } - - /** Definition stages for packet capture filter. */ - interface DefinitionStages { - - /** - * The first stage of a packet capture filter definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithAttach extends Attachable.InDefinition, Blank { - } - - /** - * The first stage of a packet capture filter definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface Blank - extends HasProtocol.DefinitionStages.WithProtocol< - WithAttach, PcProtocol>, - WithLocalIP, - WithRemoteIpAddress, - WithLocalPort, - WithRemotePort { - } - - /** - * Set local IP Address to be filtered on. Notation: "127.0.0.1" for single address entry. - * "127.0.0.1-127.0.0.255" for range. "127.0.0.1;127.0.0.5" for multiple entries. Multiple ranges not currently - * supported. Mixing ranges with multiple entries not currently supported. Default = null. - */ - interface WithLocalIP { - /** - * Set local IP address to be filtered on. - * - * @param ipAddress local IP address - * @return the next stage - */ - Definition withLocalIpAddress(String ipAddress); - - /** - * Set local IP addresses range to be filtered on. - * - * @param startIpAddress range start IP address - * @param endIpAddress range end IP address - * @return the next stage - */ - Definition withLocalIpAddressesRange(String startIpAddress, String endIpAddress); - - /** - * Set list of local IP addresses to be filtered on. - * - * @param ipAddresses list of IP address - * @return the next stage - */ - Definition withLocalIpAddresses(List ipAddresses); - } - - /** - * Set remote IP Address to be filtered on. Notation: "127.0.0.1" for single address entry. - * "127.0.0.1-127.0.0.255" for range. "127.0.0.1;127.0.0.5" for multiple entries. Multiple ranges not currently - * supported. Mixing ranges with multiple entries not currently supported. Default = null. - */ - interface WithRemoteIpAddress { - /** - * Set remote IP address to be filtered on. - * - * @param ipAddress remote IP address - * @return the next stage - */ - Definition withRemoteIpAddress(String ipAddress); - - /** - * Set remote IP addresses range to be filtered on. - * - * @param startIpAddress range start IP address - * @param endIpAddress range end IP address - * @return the next stage - */ - Definition withRemoteIpAddressesRange(String startIpAddress, String endIpAddress); - - /** - * Set list of remote IP addresses to be filtered on. - * - * @param ipAddresses list of IP addresses - * @return the next stage - */ - Definition withRemoteIpAddresses(List ipAddresses); - } - - /** - * Set local port to be filtered on. Notation: "80" for single port entry."80-85" for range. "80;443;" for - * multiple entries. Multiple ranges not currently supported. Mixing ranges with multiple entries not currently - * supported. Default = null. - */ - interface WithLocalPort { - /** - * Set the local port to be filtered on. - * - * @param port port number - * @return the next stage - */ - Definition withLocalPort(int port); - - /** - * Set the local port range to be filtered on. - * - * @param startPort range start port number - * @param endPort range end port number - * @return the next stage - */ - Definition withLocalPortRange(int startPort, int endPort); - - /** - * Set the list of local ports to be filtered on. - * - * @param ports list of local ports - * @return the next stage - */ - Definition withLocalPorts(List ports); - } - - /** - * Set local port to be filtered on. Notation: "80" for single port entry."80-85" for range. "80;443;" for - * multiple entries. Multiple ranges not currently supported. Mixing ranges with multiple entries not currently - * supported. Default = null. - */ - interface WithRemotePort { - /** - * Set the remote port to be filtered on. - * - * @param port port number - * @return the next stage - */ - Definition withRemotePort(int port); - - /** - * Set the remote port range to be filtered on. - * - * @param startPort range start port number - * @param endPort range end port number - * @return the next stage - */ - Definition withRemotePortRange(int startPort, int endPort); - - /** - * Set the list of remote ports to be filtered on. - * - * @param ports list of remote ports - * @return the next stage - */ - Definition withRemotePorts(List ports); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/PacketCapture.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/PacketCapture.java deleted file mode 100644 index 99e39c39107b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/PacketCapture.java +++ /dev/null @@ -1,167 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.network.fluent.models.PacketCaptureResultInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasId; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasName; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.model.Indexable; -import java.util.List; -import reactor.core.publisher.Mono; - -/** Client-side representation of Packet capture object, associated with Network Watcher. */ -@Fluent -public interface PacketCapture extends HasInnerModel, HasName, HasId, Indexable { - /** @return the target id value */ - String targetId(); - - /** @return the number of bytes captured per packet, the remaining bytes are truncated. */ - long bytesToCapturePerPacket(); - - /** @return the maximum size of the capture output */ - long totalBytesPerSession(); - - /** @return the maximum duration of the capture session in seconds */ - int timeLimitInSeconds(); - - /** @return the storageLocation value */ - PacketCaptureStorageLocation storageLocation(); - - /** @return the filters value */ - List filters(); - - /** - * Get the provisioning state of the packet capture session. - * - * @return the provisioningState value - */ - ProvisioningState provisioningState(); - - /** Stops a specified packet capture session. */ - void stop(); - - /** - * Stops a specified packet capture session asynchronously. - * - * @return the handle to the REST call - */ - Mono stopAsync(); - - /** - * Query the status of a running packet capture session. - * - * @return packet capture status - */ - PacketCaptureStatus getStatus(); - - /** - * Query the status of a running packet capture session asynchronously. - * - * @return packet capture status - */ - Mono getStatusAsync(); - - /** The entirety of the packet capture definition. */ - interface Definition - extends PacketCapture.DefinitionStages.WithTarget, - PacketCapture.DefinitionStages.WithStorageLocation, - PacketCapture.DefinitionStages.WithCreateAndStoragePath { - } - - /** Grouping of Packet Capture definition stages. */ - interface DefinitionStages { - - /** - * The stage of the Packet Capture definition allowing to specify the target. - */ - interface WithTarget { - /** - * Set target resource ID, only VM is currently supported. - * - * @param target The ID of the targeted resource - * @return the next stage - */ - WithStorageLocation withTarget(String target); - } - - /** - * The stage of the Packet Capture definition allowing to specify the storage location. - */ - interface WithStorageLocation { - /** - * The ID of the storage account to save the packet capture session. Required if no local file path is - * provided. - * - * @param storageId The ID of the storage account to save the packet capture session - * @return the next stage of the definition - */ - WithCreateAndStoragePath withStorageAccountId(String storageId); - - /** - * A valid local path on the targeting VM. Must include the name of the capture file (*.cap). For linux - * virtual machine it must start with /var/captures. Required if no storage ID is provided, otherwise - * optional. - * - * @param filePath A valid local path on the targeting VM - * @return the next stage - */ - WithCreate withFilePath(String filePath); - } - - /** - * The stage of the Packet Capture definition which contains all the minimum required inputs for the resource - * to be created, but also allows for any other optional settings to be specified. - */ - interface WithCreate extends Creatable { - /** - * Set number of bytes captured per packet, the remaining bytes are truncated. - * - * @param bytesToCapturePerPacket Number of bytes captured per packet - * @return the next stage - */ - WithCreate withBytesToCapturePerPacket(long bytesToCapturePerPacket); - - /** - * Set maximum size of the capture output. - * - * @param totalBytesPerSession Maximum size of the capture output - * @return the next stage - */ - WithCreate withTotalBytesPerSession(long totalBytesPerSession); - - /** - * Set maximum duration of the capture session in seconds. - * - * @param timeLimitInSeconds Maximum duration of the capture session in seconds - * @return the next stage - */ - WithCreate withTimeLimitInSeconds(int timeLimitInSeconds); - - /** - * Begin the definition of packet capture filter. - * - * @return the next stage - */ - PCFilter.DefinitionStages.Blank definePacketCaptureFilter(); - } - - /** - * The stage of the Packet Capture definition which contains all the minimum required inputs for the resource - * to be created, but also allows for any other optional settings to be specified. - */ - interface WithCreateAndStoragePath extends WithCreate { - /** - * The URI of the storage path to save the packet capture. Must be a well-formed URI describing the location - * to save the packet capture. - * - * @param storagePath The URI of the storage path to save the packet capture. Must be a well-formed URI - * describing the location to save the packet capture. - * @return the next stage - */ - WithCreate withStoragePath(String storagePath); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/PacketCaptureFilter.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/PacketCaptureFilter.java deleted file mode 100644 index 9fdc58d8fade..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/PacketCaptureFilter.java +++ /dev/null @@ -1,182 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Filter that is applied to packet capture request. Multiple filters can be applied. */ -@Fluent -public final class PacketCaptureFilter { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PacketCaptureFilter.class); - - /* - * Protocol to be filtered on. - */ - @JsonProperty(value = "protocol") - private PcProtocol protocol; - - /* - * Local IP Address to be filtered on. Notation: "127.0.0.1" for single - * address entry. "127.0.0.1-127.0.0.255" for range. "127.0.0.1;127.0.0.5"? - * for multiple entries. Multiple ranges not currently supported. Mixing - * ranges with multiple entries not currently supported. Default = null. - */ - @JsonProperty(value = "localIPAddress") - private String localIpAddress; - - /* - * Local IP Address to be filtered on. Notation: "127.0.0.1" for single - * address entry. "127.0.0.1-127.0.0.255" for range. "127.0.0.1;127.0.0.5;" - * for multiple entries. Multiple ranges not currently supported. Mixing - * ranges with multiple entries not currently supported. Default = null. - */ - @JsonProperty(value = "remoteIPAddress") - private String remoteIpAddress; - - /* - * Local port to be filtered on. Notation: "80" for single port - * entry."80-85" for range. "80;443;" for multiple entries. Multiple ranges - * not currently supported. Mixing ranges with multiple entries not - * currently supported. Default = null. - */ - @JsonProperty(value = "localPort") - private String localPort; - - /* - * Remote port to be filtered on. Notation: "80" for single port - * entry."80-85" for range. "80;443;" for multiple entries. Multiple ranges - * not currently supported. Mixing ranges with multiple entries not - * currently supported. Default = null. - */ - @JsonProperty(value = "remotePort") - private String remotePort; - - /** - * Get the protocol property: Protocol to be filtered on. - * - * @return the protocol value. - */ - public PcProtocol protocol() { - return this.protocol; - } - - /** - * Set the protocol property: Protocol to be filtered on. - * - * @param protocol the protocol value to set. - * @return the PacketCaptureFilter object itself. - */ - public PacketCaptureFilter withProtocol(PcProtocol protocol) { - this.protocol = protocol; - return this; - } - - /** - * Get the localIpAddress property: Local IP Address to be filtered on. Notation: "127.0.0.1" for single address - * entry. "127.0.0.1-127.0.0.255" for range. "127.0.0.1;127.0.0.5"? for multiple entries. Multiple ranges not - * currently supported. Mixing ranges with multiple entries not currently supported. Default = null. - * - * @return the localIpAddress value. - */ - public String localIpAddress() { - return this.localIpAddress; - } - - /** - * Set the localIpAddress property: Local IP Address to be filtered on. Notation: "127.0.0.1" for single address - * entry. "127.0.0.1-127.0.0.255" for range. "127.0.0.1;127.0.0.5"? for multiple entries. Multiple ranges not - * currently supported. Mixing ranges with multiple entries not currently supported. Default = null. - * - * @param localIpAddress the localIpAddress value to set. - * @return the PacketCaptureFilter object itself. - */ - public PacketCaptureFilter withLocalIpAddress(String localIpAddress) { - this.localIpAddress = localIpAddress; - return this; - } - - /** - * Get the remoteIpAddress property: Local IP Address to be filtered on. Notation: "127.0.0.1" for single address - * entry. "127.0.0.1-127.0.0.255" for range. "127.0.0.1;127.0.0.5;" for multiple entries. Multiple ranges not - * currently supported. Mixing ranges with multiple entries not currently supported. Default = null. - * - * @return the remoteIpAddress value. - */ - public String remoteIpAddress() { - return this.remoteIpAddress; - } - - /** - * Set the remoteIpAddress property: Local IP Address to be filtered on. Notation: "127.0.0.1" for single address - * entry. "127.0.0.1-127.0.0.255" for range. "127.0.0.1;127.0.0.5;" for multiple entries. Multiple ranges not - * currently supported. Mixing ranges with multiple entries not currently supported. Default = null. - * - * @param remoteIpAddress the remoteIpAddress value to set. - * @return the PacketCaptureFilter object itself. - */ - public PacketCaptureFilter withRemoteIpAddress(String remoteIpAddress) { - this.remoteIpAddress = remoteIpAddress; - return this; - } - - /** - * Get the localPort property: Local port to be filtered on. Notation: "80" for single port entry."80-85" for range. - * "80;443;" for multiple entries. Multiple ranges not currently supported. Mixing ranges with multiple entries not - * currently supported. Default = null. - * - * @return the localPort value. - */ - public String localPort() { - return this.localPort; - } - - /** - * Set the localPort property: Local port to be filtered on. Notation: "80" for single port entry."80-85" for range. - * "80;443;" for multiple entries. Multiple ranges not currently supported. Mixing ranges with multiple entries not - * currently supported. Default = null. - * - * @param localPort the localPort value to set. - * @return the PacketCaptureFilter object itself. - */ - public PacketCaptureFilter withLocalPort(String localPort) { - this.localPort = localPort; - return this; - } - - /** - * Get the remotePort property: Remote port to be filtered on. Notation: "80" for single port entry."80-85" for - * range. "80;443;" for multiple entries. Multiple ranges not currently supported. Mixing ranges with multiple - * entries not currently supported. Default = null. - * - * @return the remotePort value. - */ - public String remotePort() { - return this.remotePort; - } - - /** - * Set the remotePort property: Remote port to be filtered on. Notation: "80" for single port entry."80-85" for - * range. "80;443;" for multiple entries. Multiple ranges not currently supported. Mixing ranges with multiple - * entries not currently supported. Default = null. - * - * @param remotePort the remotePort value to set. - * @return the PacketCaptureFilter object itself. - */ - public PacketCaptureFilter withRemotePort(String remotePort) { - this.remotePort = remotePort; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/PacketCaptureListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/PacketCaptureListResult.java deleted file mode 100644 index 20cca6f28663..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/PacketCaptureListResult.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.PacketCaptureResultInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** List of packet capture sessions. */ -@Fluent -public final class PacketCaptureListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PacketCaptureListResult.class); - - /* - * Information about packet capture sessions. - */ - @JsonProperty(value = "value") - private List value; - - /** - * Get the value property: Information about packet capture sessions. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Information about packet capture sessions. - * - * @param value the value value to set. - * @return the PacketCaptureListResult object itself. - */ - public PacketCaptureListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/PacketCaptureStatus.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/PacketCaptureStatus.java deleted file mode 100644 index 348855d3836b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/PacketCaptureStatus.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.network.fluent.models.PacketCaptureQueryStatusResultInner; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import java.time.OffsetDateTime; -import java.util.List; - -/** Status of packet capture session. */ -@Fluent -public interface PacketCaptureStatus extends HasInnerModel { - /** @return the name of the packet capture resource */ - String name(); - - /** @return the ID of the packet capture resource */ - String id(); - - /** @return the start time of the packet capture session */ - OffsetDateTime captureStartTime(); - - /** - * Get the status of the packet capture session. - * - * @return the packetCaptureStatus value - */ - PcStatus packetCaptureStatus(); - - /** @return the reason the current packet capture session was stopped */ - String stopReason(); - - /** @return the list of errors of packet capture session */ - List packetCaptureErrors(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/PacketCaptureStorageLocation.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/PacketCaptureStorageLocation.java deleted file mode 100644 index c098db127730..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/PacketCaptureStorageLocation.java +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describes the storage location for a packet capture session. */ -@Fluent -public final class PacketCaptureStorageLocation { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PacketCaptureStorageLocation.class); - - /* - * The ID of the storage account to save the packet capture session. - * Required if no local file path is provided. - */ - @JsonProperty(value = "storageId") - private String storageId; - - /* - * The URI of the storage path to save the packet capture. Must be a - * well-formed URI describing the location to save the packet capture. - */ - @JsonProperty(value = "storagePath") - private String storagePath; - - /* - * A valid local path on the targeting VM. Must include the name of the - * capture file (*.cap). For linux virtual machine it must start with - * /var/captures. Required if no storage ID is provided, otherwise - * optional. - */ - @JsonProperty(value = "filePath") - private String filePath; - - /** - * Get the storageId property: The ID of the storage account to save the packet capture session. Required if no - * local file path is provided. - * - * @return the storageId value. - */ - public String storageId() { - return this.storageId; - } - - /** - * Set the storageId property: The ID of the storage account to save the packet capture session. Required if no - * local file path is provided. - * - * @param storageId the storageId value to set. - * @return the PacketCaptureStorageLocation object itself. - */ - public PacketCaptureStorageLocation withStorageId(String storageId) { - this.storageId = storageId; - return this; - } - - /** - * Get the storagePath property: The URI of the storage path to save the packet capture. Must be a well-formed URI - * describing the location to save the packet capture. - * - * @return the storagePath value. - */ - public String storagePath() { - return this.storagePath; - } - - /** - * Set the storagePath property: The URI of the storage path to save the packet capture. Must be a well-formed URI - * describing the location to save the packet capture. - * - * @param storagePath the storagePath value to set. - * @return the PacketCaptureStorageLocation object itself. - */ - public PacketCaptureStorageLocation withStoragePath(String storagePath) { - this.storagePath = storagePath; - return this; - } - - /** - * Get the filePath property: A valid local path on the targeting VM. Must include the name of the capture file - * (*.cap). For linux virtual machine it must start with /var/captures. Required if no storage ID is provided, - * otherwise optional. - * - * @return the filePath value. - */ - public String filePath() { - return this.filePath; - } - - /** - * Set the filePath property: A valid local path on the targeting VM. Must include the name of the capture file - * (*.cap). For linux virtual machine it must start with /var/captures. Required if no storage ID is provided, - * otherwise optional. - * - * @param filePath the filePath value to set. - * @return the PacketCaptureStorageLocation object itself. - */ - public PacketCaptureStorageLocation withFilePath(String filePath) { - this.filePath = filePath; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/PacketCaptures.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/PacketCaptures.java deleted file mode 100644 index 6040e638d1f8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/PacketCaptures.java +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingByName; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsCreating; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingByName; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; - -/** Entry point to packet captures management API in Azure. */ -@Fluent -public interface PacketCaptures - extends SupportsCreating, - SupportsListing, - SupportsGettingByName, - SupportsDeletingByName { -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/PatchRouteFilter.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/PatchRouteFilter.java deleted file mode 100644 index ebec45e4388f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/PatchRouteFilter.java +++ /dev/null @@ -1,186 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.ExpressRouteCircuitPeeringInner; -import com.azure.resourcemanager.network.fluent.models.RouteFilterPropertiesFormat; -import com.azure.resourcemanager.network.fluent.models.RouteFilterRuleInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** Route Filter Resource. */ -@Fluent -public final class PatchRouteFilter extends SubResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PatchRouteFilter.class); - - /* - * Route Filter Resource - */ - @JsonProperty(value = "properties") - private RouteFilterPropertiesFormat innerProperties; - - /* - * The name of the resource that is unique within a resource group. This - * name can be used to access the resource. - */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) - private String name; - - /* - * A unique read-only string that changes whenever the resource is updated. - */ - @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) - private String etag; - - /* - * Resource type. - */ - @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) - private String type; - - /* - * Resource tags. - */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map tags; - - /** - * Get the innerProperties property: Route Filter Resource. - * - * @return the innerProperties value. - */ - private RouteFilterPropertiesFormat innerProperties() { - return this.innerProperties; - } - - /** - * Get the name property: The name of the resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Get the type property: Resource type. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Resource tags. - * - * @param tags the tags value to set. - * @return the PatchRouteFilter object itself. - */ - public PatchRouteFilter withTags(Map tags) { - this.tags = tags; - return this; - } - - /** {@inheritDoc} */ - @Override - public PatchRouteFilter withId(String id) { - super.withId(id); - return this; - } - - /** - * Get the rules property: Collection of RouteFilterRules contained within a route filter. - * - * @return the rules value. - */ - public List rules() { - return this.innerProperties() == null ? null : this.innerProperties().rules(); - } - - /** - * Set the rules property: Collection of RouteFilterRules contained within a route filter. - * - * @param rules the rules value to set. - * @return the PatchRouteFilter object itself. - */ - public PatchRouteFilter withRules(List rules) { - if (this.innerProperties() == null) { - this.innerProperties = new RouteFilterPropertiesFormat(); - } - this.innerProperties().withRules(rules); - return this; - } - - /** - * Get the peerings property: A collection of references to express route circuit peerings. - * - * @return the peerings value. - */ - public List peerings() { - return this.innerProperties() == null ? null : this.innerProperties().peerings(); - } - - /** - * Set the peerings property: A collection of references to express route circuit peerings. - * - * @param peerings the peerings value to set. - * @return the PatchRouteFilter object itself. - */ - public PatchRouteFilter withPeerings(List peerings) { - if (this.innerProperties() == null) { - this.innerProperties = new RouteFilterPropertiesFormat(); - } - this.innerProperties().withPeerings(peerings); - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', 'Succeeded' and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/PatchRouteFilterRule.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/PatchRouteFilterRule.java deleted file mode 100644 index 161e783d0525..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/PatchRouteFilterRule.java +++ /dev/null @@ -1,165 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.RouteFilterRulePropertiesFormat; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Route Filter Rule Resource. */ -@Fluent -public final class PatchRouteFilterRule extends SubResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PatchRouteFilterRule.class); - - /* - * Route Filter Rule Resource - */ - @JsonProperty(value = "properties") - private RouteFilterRulePropertiesFormat innerProperties; - - /* - * The name of the resource that is unique within a resource group. This - * name can be used to access the resource. - */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) - private String name; - - /* - * A unique read-only string that changes whenever the resource is updated. - */ - @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) - private String etag; - - /** - * Get the innerProperties property: Route Filter Rule Resource. - * - * @return the innerProperties value. - */ - private RouteFilterRulePropertiesFormat innerProperties() { - return this.innerProperties; - } - - /** - * Get the name property: The name of the resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** {@inheritDoc} */ - @Override - public PatchRouteFilterRule withId(String id) { - super.withId(id); - return this; - } - - /** - * Get the access property: The access type of the rule. Valid values are: 'Allow', 'Deny'. - * - * @return the access value. - */ - public Access access() { - return this.innerProperties() == null ? null : this.innerProperties().access(); - } - - /** - * Set the access property: The access type of the rule. Valid values are: 'Allow', 'Deny'. - * - * @param access the access value to set. - * @return the PatchRouteFilterRule object itself. - */ - public PatchRouteFilterRule withAccess(Access access) { - if (this.innerProperties() == null) { - this.innerProperties = new RouteFilterRulePropertiesFormat(); - } - this.innerProperties().withAccess(access); - return this; - } - - /** - * Get the routeFilterRuleType property: The rule type of the rule. Valid value is: 'Community'. - * - * @return the routeFilterRuleType value. - */ - public RouteFilterRuleType routeFilterRuleType() { - return this.innerProperties() == null ? null : this.innerProperties().routeFilterRuleType(); - } - - /** - * Set the routeFilterRuleType property: The rule type of the rule. Valid value is: 'Community'. - * - * @param routeFilterRuleType the routeFilterRuleType value to set. - * @return the PatchRouteFilterRule object itself. - */ - public PatchRouteFilterRule withRouteFilterRuleType(RouteFilterRuleType routeFilterRuleType) { - if (this.innerProperties() == null) { - this.innerProperties = new RouteFilterRulePropertiesFormat(); - } - this.innerProperties().withRouteFilterRuleType(routeFilterRuleType); - return this; - } - - /** - * Get the communities property: The collection for bgp community values to filter on. e.g. - * ['12076:5010','12076:5020']. - * - * @return the communities value. - */ - public List communities() { - return this.innerProperties() == null ? null : this.innerProperties().communities(); - } - - /** - * Set the communities property: The collection for bgp community values to filter on. e.g. - * ['12076:5010','12076:5020']. - * - * @param communities the communities value to set. - * @return the PatchRouteFilterRule object itself. - */ - public PatchRouteFilterRule withCommunities(List communities) { - if (this.innerProperties() == null) { - this.innerProperties = new RouteFilterRulePropertiesFormat(); - } - this.innerProperties().withCommunities(communities); - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', 'Succeeded' and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/PcError.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/PcError.java deleted file mode 100644 index 33bba277efb9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/PcError.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for PcError. */ -public final class PcError extends ExpandableStringEnum { - /** Static value InternalError for PcError. */ - public static final PcError INTERNAL_ERROR = fromString("InternalError"); - - /** Static value AgentStopped for PcError. */ - public static final PcError AGENT_STOPPED = fromString("AgentStopped"); - - /** Static value CaptureFailed for PcError. */ - public static final PcError CAPTURE_FAILED = fromString("CaptureFailed"); - - /** Static value LocalFileFailed for PcError. */ - public static final PcError LOCAL_FILE_FAILED = fromString("LocalFileFailed"); - - /** Static value StorageFailed for PcError. */ - public static final PcError STORAGE_FAILED = fromString("StorageFailed"); - - /** - * Creates or finds a PcError from its string representation. - * - * @param name a name to look for. - * @return the corresponding PcError. - */ - @JsonCreator - public static PcError fromString(String name) { - return fromString(name, PcError.class); - } - - /** @return known PcError values. */ - public static Collection values() { - return values(PcError.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/PcProtocol.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/PcProtocol.java deleted file mode 100644 index 1de0ef42525f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/PcProtocol.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for PcProtocol. */ -public final class PcProtocol extends ExpandableStringEnum { - /** Static value TCP for PcProtocol. */ - public static final PcProtocol TCP = fromString("TCP"); - - /** Static value UDP for PcProtocol. */ - public static final PcProtocol UDP = fromString("UDP"); - - /** Static value Any for PcProtocol. */ - public static final PcProtocol ANY = fromString("Any"); - - /** - * Creates or finds a PcProtocol from its string representation. - * - * @param name a name to look for. - * @return the corresponding PcProtocol. - */ - @JsonCreator - public static PcProtocol fromString(String name) { - return fromString(name, PcProtocol.class); - } - - /** @return known PcProtocol values. */ - public static Collection values() { - return values(PcProtocol.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/PcStatus.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/PcStatus.java deleted file mode 100644 index 8e4b1d73fd43..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/PcStatus.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for PcStatus. */ -public final class PcStatus extends ExpandableStringEnum { - /** Static value NotStarted for PcStatus. */ - public static final PcStatus NOT_STARTED = fromString("NotStarted"); - - /** Static value Running for PcStatus. */ - public static final PcStatus RUNNING = fromString("Running"); - - /** Static value Stopped for PcStatus. */ - public static final PcStatus STOPPED = fromString("Stopped"); - - /** Static value Error for PcStatus. */ - public static final PcStatus ERROR = fromString("Error"); - - /** Static value Unknown for PcStatus. */ - public static final PcStatus UNKNOWN = fromString("Unknown"); - - /** - * Creates or finds a PcStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding PcStatus. - */ - @JsonCreator - public static PcStatus fromString(String name) { - return fromString(name, PcStatus.class); - } - - /** @return known PcStatus values. */ - public static Collection values() { - return values(PcStatus.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/PfsGroup.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/PfsGroup.java deleted file mode 100644 index bd0fe2a04fec..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/PfsGroup.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for PfsGroup. */ -public final class PfsGroup extends ExpandableStringEnum { - /** Static value None for PfsGroup. */ - public static final PfsGroup NONE = fromString("None"); - - /** Static value PFS1 for PfsGroup. */ - public static final PfsGroup PFS1 = fromString("PFS1"); - - /** Static value PFS2 for PfsGroup. */ - public static final PfsGroup PFS2 = fromString("PFS2"); - - /** Static value PFS2048 for PfsGroup. */ - public static final PfsGroup PFS2048 = fromString("PFS2048"); - - /** Static value ECP256 for PfsGroup. */ - public static final PfsGroup ECP256 = fromString("ECP256"); - - /** Static value ECP384 for PfsGroup. */ - public static final PfsGroup ECP384 = fromString("ECP384"); - - /** Static value PFS24 for PfsGroup. */ - public static final PfsGroup PFS24 = fromString("PFS24"); - - /** Static value PFS14 for PfsGroup. */ - public static final PfsGroup PFS14 = fromString("PFS14"); - - /** Static value PFSMM for PfsGroup. */ - public static final PfsGroup PFSMM = fromString("PFSMM"); - - /** - * Creates or finds a PfsGroup from its string representation. - * - * @param name a name to look for. - * @return the corresponding PfsGroup. - */ - @JsonCreator - public static PfsGroup fromString(String name) { - return fromString(name, PfsGroup.class); - } - - /** @return known PfsGroup values. */ - public static Collection values() { - return values(PfsGroup.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/PointToSiteConfiguration.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/PointToSiteConfiguration.java deleted file mode 100644 index 9de2f22a9daf..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/PointToSiteConfiguration.java +++ /dev/null @@ -1,256 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.model.Attachable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.model.Settable; -import java.io.File; -import java.io.IOException; - -/** A client-side representation of point-to-site configuration for a virtual network gateway. */ -@Fluent -public interface PointToSiteConfiguration extends HasInnerModel { - /** Grouping of point-to-site configuration definition stages. */ - interface DefinitionStages { - /** - * The first stage of the point-to-site configuration definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface Blank extends WithAddressPool { - } - - /** - * the stage of the point-to-site configuration definition allowing to specify the address pool. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithAddressPool { - /** - * Specifies the address pool. - * - * @param addressPool the address pool - * @return the next stage of the definition - */ - WithAuthenticationType withAddressPool(String addressPool); - } - - /** - * The stage of the point-to-site configuration definition allowing to specify authentication type. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithAuthenticationType extends WithAzureCertificate { - /** - * Specifies that RADIUS server will be used for authentication. - * - * @param serverIPAddress the radius server address - * @param serverSecret the radius server secret - * @return the next stage of the definition - */ - WithAttach withRadiusAuthentication(String serverIPAddress, String serverSecret); - } - - /** - * The stage of the point-to-site configuration definition allowing to add root certificate for Azure - * authentication. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithAzureCertificate { - /** - * Specifies that Azure certificate authentication type will be used and certificate to use for Azure - * authentication. - * - * @param name name of certificate - * @param certificateData the certificate public data - * @return the next stage of the definition - */ - WithAttachAndAzureCertificate withAzureCertificate(String name, String certificateData); - - /** - * Specifies that Azure certificate authentication type will be used and certificate to use for Azure - * authentication. - * - * @param name name of certificate - * @param certificateFile public Base64-encoded certificate file - * @return the next stage of the definition - * @throws IOException the IO Exception - */ - WithAttachAndAzureCertificate withAzureCertificateFromFile(String name, File certificateFile) - throws IOException; - } - - /** - * The stage of the point-to-site configuration definition allowing to specify the revoked certificate. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithRevokedCertificate { - /** - * Specifies the revoked certificate. - * - * @param name name of the certificate - * @param thumbprint thumbprint of the certificate - * @return the next stage of the definition - */ - WithAttach withRevokedCertificate(String name, String thumbprint); - } - - /** - * The stage of a point-to-site configuration definition allowing to specify which tunnel type will be used. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithTunnelType { - /** - * Specifies that only SSTP tunnel type will be used. - * - * @return the next stage of the definition - */ - WithAttach withSstpOnly(); - /** - * Specifies that only IKEv2 VPN tunnel type will be used. - * - * @return the next stage of the definition - */ - WithAttach withIkeV2Only(); - } - - /** - * The final stage of the point-to-site configuration definition. - * - *

    At this stage, any remaining optional settings can be specified, or the point-to-site configuration - * definition can be attached to the parent virtual network gateway definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithAttach extends Attachable.InDefinition, WithTunnelType { - } - - /** - * The final stage of the point-to-site configuration definition. - * - *

    At this stage, any remaining optional settings can be specified, or the point-to-site configuration - * definition can be attached to the parent virtual network gateway definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithAttachAndAzureCertificate - extends WithAttach, - WithTunnelType, - WithAzureCertificate, - WithRevokedCertificate { - } - } - - /** - * The entirety of a point-to-site configuration definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithAuthenticationType, - DefinitionStages.WithAddressPool, - DefinitionStages.WithAttachAndAzureCertificate { - } - - /** Grouping of point-to-site configuration update stages. */ - interface UpdateStages { - /** The stage of the point-to-site configuration definition allowing to specify address pool. */ - interface WithAddressPool { - /** - * Specifies address pool. - * - * @param addressPool address pool - * @return the next stage of the update - */ - Update withAddressPool(String addressPool); - } - - /** Specifies authentication type of the point-to-site configuration. */ - interface WithAuthenticationType extends WithAzureCertificate { - /** - * Specifies that RADIUS authentication type will be used. - * - * @param serverIPAddress the radius server address - * @param serverSecret the radius server secret - * @return the next stage of the update - */ - Update withRadiusAuthentication(String serverIPAddress, String serverSecret); - } - - /** Specifies Azure certificate for authentication. */ - interface WithAzureCertificate { - /** - * Specifies that Azure certificate authentication type will be used and certificate to use for Azure - * authentication. - * - * @param name name of certificate - * @param certificateData the certificate public data - * @return the next stage of the update - */ - Update withAzureCertificate(String name, String certificateData); - - /** - * Specifies that azure certificate authentication type will be used and certificate to use for Azure - * authentication. - * - * @param name name of certificate - * @param certificateFile public Base64-encoded certificate file - * @return the next stage of the update - * @throws IOException the IO Exception - */ - Update withAzureCertificateFromFile(String name, File certificateFile) throws IOException; - - /** - * Removes attached azure certificate with specified name. - * - * @param name name of the certificate - * @return the next stage of the update - */ - Update withoutAzureCertificate(String name); - } - - /** Specifies revoked certificate for azure authentication. */ - interface WithRevokedCertificate { - /** - * Specifies revoked certificate. - * - * @param name certificate name - * @param thumbprint certificate thumbprint - * @return the next stage of the update - */ - Update withRevokedCertificate(String name, String thumbprint); - } - - /** The stage of a point-to-site configuration definition allowing to specify which tunnel type will be used. */ - interface WithTunnelType { - /** - * Specifies that only SSTP tunnel type will be used. - * - * @return the next stage of the update - */ - Update withSstpOnly(); - - /** - * Specifies that only IKEv2 VPN tunnel type will be used. - * - * @return the next stage of the update - */ - Update withIkeV2Only(); - } - } - - /** The entirety of a subnet update as part of a network update. */ - interface Update - extends UpdateStages.WithAddressPool, - UpdateStages.WithAuthenticationType, - UpdateStages.WithRevokedCertificate, - UpdateStages.WithTunnelType, - Settable { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ProbeProtocol.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ProbeProtocol.java deleted file mode 100644 index 5922a4d0338b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ProbeProtocol.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ProbeProtocol. */ -public final class ProbeProtocol extends ExpandableStringEnum { - /** Static value Http for ProbeProtocol. */ - public static final ProbeProtocol HTTP = fromString("Http"); - - /** Static value Tcp for ProbeProtocol. */ - public static final ProbeProtocol TCP = fromString("Tcp"); - - /** Static value Https for ProbeProtocol. */ - public static final ProbeProtocol HTTPS = fromString("Https"); - - /** - * Creates or finds a ProbeProtocol from its string representation. - * - * @param name a name to look for. - * @return the corresponding ProbeProtocol. - */ - @JsonCreator - public static ProbeProtocol fromString(String name) { - return fromString(name, ProbeProtocol.class); - } - - /** @return known ProbeProtocol values. */ - public static Collection values() { - return values(ProbeProtocol.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ProcessorArchitecture.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ProcessorArchitecture.java deleted file mode 100644 index 8c28f0171e2a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ProcessorArchitecture.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ProcessorArchitecture. */ -public final class ProcessorArchitecture extends ExpandableStringEnum { - /** Static value Amd64 for ProcessorArchitecture. */ - public static final ProcessorArchitecture AMD64 = fromString("Amd64"); - - /** Static value X86 for ProcessorArchitecture. */ - public static final ProcessorArchitecture X86 = fromString("X86"); - - /** - * Creates or finds a ProcessorArchitecture from its string representation. - * - * @param name a name to look for. - * @return the corresponding ProcessorArchitecture. - */ - @JsonCreator - public static ProcessorArchitecture fromString(String name) { - return fromString(name, ProcessorArchitecture.class); - } - - /** @return known ProcessorArchitecture values. */ - public static Collection values() { - return values(ProcessorArchitecture.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/Protocol.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/Protocol.java deleted file mode 100644 index 3b6b83e7e080..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/Protocol.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for Protocol. */ -public final class Protocol extends ExpandableStringEnum { - /** Static value Tcp for Protocol. */ - public static final Protocol TCP = fromString("Tcp"); - - /** Static value Http for Protocol. */ - public static final Protocol HTTP = fromString("Http"); - - /** Static value Https for Protocol. */ - public static final Protocol HTTPS = fromString("Https"); - - /** Static value Icmp for Protocol. */ - public static final Protocol ICMP = fromString("Icmp"); - - /** - * Creates or finds a Protocol from its string representation. - * - * @param name a name to look for. - * @return the corresponding Protocol. - */ - @JsonCreator - public static Protocol fromString(String name) { - return fromString(name, Protocol.class); - } - - /** @return known Protocol values. */ - public static Collection values() { - return values(Protocol.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ProtocolConfiguration.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ProtocolConfiguration.java deleted file mode 100644 index 863ee5e1e3cc..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ProtocolConfiguration.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Configuration of the protocol. */ -@Fluent -public final class ProtocolConfiguration { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ProtocolConfiguration.class); - - /* - * HTTP configuration of the connectivity check. - */ - @JsonProperty(value = "HTTPConfiguration") - private HttpConfiguration httpConfiguration; - - /** - * Get the httpConfiguration property: HTTP configuration of the connectivity check. - * - * @return the httpConfiguration value. - */ - public HttpConfiguration httpConfiguration() { - return this.httpConfiguration; - } - - /** - * Set the httpConfiguration property: HTTP configuration of the connectivity check. - * - * @param httpConfiguration the httpConfiguration value to set. - * @return the ProtocolConfiguration object itself. - */ - public ProtocolConfiguration withHttpConfiguration(HttpConfiguration httpConfiguration) { - this.httpConfiguration = httpConfiguration; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (httpConfiguration() != null) { - httpConfiguration().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ProtocolCustomSettingsFormat.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ProtocolCustomSettingsFormat.java deleted file mode 100644 index 6826037ee117..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ProtocolCustomSettingsFormat.java +++ /dev/null @@ -1,139 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** DDoS custom policy properties. */ -@Fluent -public final class ProtocolCustomSettingsFormat { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ProtocolCustomSettingsFormat.class); - - /* - * The protocol for which the DDoS protection policy is being customized. - */ - @JsonProperty(value = "protocol") - private DdosCustomPolicyProtocol protocol; - - /* - * The customized DDoS protection trigger rate. - */ - @JsonProperty(value = "triggerRateOverride") - private String triggerRateOverride; - - /* - * The customized DDoS protection source rate. - */ - @JsonProperty(value = "sourceRateOverride") - private String sourceRateOverride; - - /* - * The customized DDoS protection trigger rate sensitivity degrees. High: - * Trigger rate set with most sensitivity w.r.t. normal traffic. Default: - * Trigger rate set with moderate sensitivity w.r.t. normal traffic. Low: - * Trigger rate set with less sensitivity w.r.t. normal traffic. Relaxed: - * Trigger rate set with least sensitivity w.r.t. normal traffic. - */ - @JsonProperty(value = "triggerSensitivityOverride") - private DdosCustomPolicyTriggerSensitivityOverride triggerSensitivityOverride; - - /** - * Get the protocol property: The protocol for which the DDoS protection policy is being customized. - * - * @return the protocol value. - */ - public DdosCustomPolicyProtocol protocol() { - return this.protocol; - } - - /** - * Set the protocol property: The protocol for which the DDoS protection policy is being customized. - * - * @param protocol the protocol value to set. - * @return the ProtocolCustomSettingsFormat object itself. - */ - public ProtocolCustomSettingsFormat withProtocol(DdosCustomPolicyProtocol protocol) { - this.protocol = protocol; - return this; - } - - /** - * Get the triggerRateOverride property: The customized DDoS protection trigger rate. - * - * @return the triggerRateOverride value. - */ - public String triggerRateOverride() { - return this.triggerRateOverride; - } - - /** - * Set the triggerRateOverride property: The customized DDoS protection trigger rate. - * - * @param triggerRateOverride the triggerRateOverride value to set. - * @return the ProtocolCustomSettingsFormat object itself. - */ - public ProtocolCustomSettingsFormat withTriggerRateOverride(String triggerRateOverride) { - this.triggerRateOverride = triggerRateOverride; - return this; - } - - /** - * Get the sourceRateOverride property: The customized DDoS protection source rate. - * - * @return the sourceRateOverride value. - */ - public String sourceRateOverride() { - return this.sourceRateOverride; - } - - /** - * Set the sourceRateOverride property: The customized DDoS protection source rate. - * - * @param sourceRateOverride the sourceRateOverride value to set. - * @return the ProtocolCustomSettingsFormat object itself. - */ - public ProtocolCustomSettingsFormat withSourceRateOverride(String sourceRateOverride) { - this.sourceRateOverride = sourceRateOverride; - return this; - } - - /** - * Get the triggerSensitivityOverride property: The customized DDoS protection trigger rate sensitivity degrees. - * High: Trigger rate set with most sensitivity w.r.t. normal traffic. Default: Trigger rate set with moderate - * sensitivity w.r.t. normal traffic. Low: Trigger rate set with less sensitivity w.r.t. normal traffic. Relaxed: - * Trigger rate set with least sensitivity w.r.t. normal traffic. - * - * @return the triggerSensitivityOverride value. - */ - public DdosCustomPolicyTriggerSensitivityOverride triggerSensitivityOverride() { - return this.triggerSensitivityOverride; - } - - /** - * Set the triggerSensitivityOverride property: The customized DDoS protection trigger rate sensitivity degrees. - * High: Trigger rate set with most sensitivity w.r.t. normal traffic. Default: Trigger rate set with moderate - * sensitivity w.r.t. normal traffic. Low: Trigger rate set with less sensitivity w.r.t. normal traffic. Relaxed: - * Trigger rate set with least sensitivity w.r.t. normal traffic. - * - * @param triggerSensitivityOverride the triggerSensitivityOverride value to set. - * @return the ProtocolCustomSettingsFormat object itself. - */ - public ProtocolCustomSettingsFormat withTriggerSensitivityOverride( - DdosCustomPolicyTriggerSensitivityOverride triggerSensitivityOverride) { - this.triggerSensitivityOverride = triggerSensitivityOverride; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ProvisioningState.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ProvisioningState.java deleted file mode 100644 index 854342dc10df..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ProvisioningState.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ProvisioningState. */ -public final class ProvisioningState extends ExpandableStringEnum { - /** Static value Succeeded for ProvisioningState. */ - public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); - - /** Static value Updating for ProvisioningState. */ - public static final ProvisioningState UPDATING = fromString("Updating"); - - /** Static value Deleting for ProvisioningState. */ - public static final ProvisioningState DELETING = fromString("Deleting"); - - /** Static value Failed for ProvisioningState. */ - public static final ProvisioningState FAILED = fromString("Failed"); - - /** - * Creates or finds a ProvisioningState from its string representation. - * - * @param name a name to look for. - * @return the corresponding ProvisioningState. - */ - @JsonCreator - public static ProvisioningState fromString(String name) { - return fromString(name, ProvisioningState.class); - } - - /** @return known ProvisioningState values. */ - public static Collection values() { - return values(ProvisioningState.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/PublicIPSkuType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/PublicIPSkuType.java deleted file mode 100644 index c3720081309b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/PublicIPSkuType.java +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.network.models; - -import java.util.Collection; -import java.util.HashMap; -import java.util.Locale; -import java.util.Map; - -/** Defines values for PublicIPSkuType. */ -public final class PublicIPSkuType { - // This needs to be at the beginning for the initialization to happen correctly - private static final Map VALUES_BY_NAME = new HashMap<>(); - - /** Static value Basic for PublicIPSkuType. */ - public static final PublicIPSkuType BASIC = new PublicIPSkuType(PublicIpAddressSkuName.BASIC); - - /** Static value Standard for PublicIPSkuType. */ - public static final PublicIPSkuType STANDARD = new PublicIPSkuType(PublicIpAddressSkuName.STANDARD); - - /** The actual serialized value for a PublicIPSkuType instance. */ - private final PublicIpAddressSkuName skuName; - - /** @return predefined publicIP SKU types */ - public static PublicIPSkuType[] values() { - Collection valuesCollection = VALUES_BY_NAME.values(); - return valuesCollection.toArray(new PublicIPSkuType[valuesCollection.size()]); - } - - /** - * Creates a PublicIPSkuType from sku name. - * - * @param skuName the sku name - */ - private PublicIPSkuType(PublicIpAddressSkuName skuName) { - this.skuName = skuName; - if (skuName != null) { - VALUES_BY_NAME.put(skuName.toString().toLowerCase(Locale.ROOT), this); - } - } - - /** - * Parses a value into a SKU type and creates a new PublicIPSkuType instance if not found among the existing ones. - * - * @param pipSku a sku - * @return the PublicIPSkuType - */ - public static PublicIPSkuType fromSku(PublicIpAddressSku pipSku) { - if (pipSku == null) { - return null; - } - if (pipSku.name() == null) { - return null; - } - PublicIPSkuType result = VALUES_BY_NAME.get(pipSku.name().toString().toLowerCase(Locale.ROOT)); - if (result != null) { - return result; - } else { - return new PublicIPSkuType(pipSku.name()); - } - } - - /** @return the PublicIpAddressSku associated with the PublicIpAddressSkuType. */ - public PublicIpAddressSku sku() { - return (new PublicIpAddressSku()).withName(this.skuName); - } - - @Override - public int hashCode() { - return skuName.hashCode(); - } - - @Override - public boolean equals(Object obj) { - if (!(obj instanceof PublicIPSkuType)) { - return false; - } else if (obj == this) { - return true; - } else if (skuName == null) { - return ((PublicIPSkuType) obj).skuName == null; - } else { - return skuName.equals(((PublicIPSkuType) obj).skuName); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/PublicIpAddress.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/PublicIpAddress.java deleted file mode 100644 index b180f9674d10..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/PublicIpAddress.java +++ /dev/null @@ -1,366 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.network.fluent.models.PublicIpAddressInner; -import com.azure.resourcemanager.resources.fluentcore.arm.AvailabilityZoneId; -import com.azure.resourcemanager.resources.fluentcore.arm.models.GroupableResource; -import com.azure.resourcemanager.resources.fluentcore.arm.models.Resource; -import com.azure.resourcemanager.resources.fluentcore.model.Accepted; -import com.azure.resourcemanager.resources.fluentcore.model.Appliable; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; -import com.azure.resourcemanager.resources.fluentcore.model.Updatable; -import java.util.List; -import java.util.Set; - -/** Public IP address. */ -@Fluent() -public interface PublicIpAddress - extends GroupableResource, - Refreshable, - Updatable, - UpdatableWithTags { - - // Getters - - /** @return the IP version of the public IP address */ - IpVersion version(); - - /** @return the assigned IP address */ - String ipAddress(); - - /** @return the assigned leaf domain label */ - String leafDomainLabel(); - - /** @return the assigned FQDN (fully qualified domain name) */ - String fqdn(); - - /** @return the assigned reverse FQDN, if any */ - String reverseFqdn(); - - /** @return the IP address allocation method (Static/Dynamic) */ - IpAllocationMethod ipAllocationMethod(); - - /** @return the idle connection timeout setting (in minutes) */ - int idleTimeoutInMinutes(); - - /** @return the load balancer public frontend that this public IP address is assigned to */ - LoadBalancerPublicFrontend getAssignedLoadBalancerFrontend(); - - /** @return true if this public IP address is assigned to a load balancer */ - boolean hasAssignedLoadBalancer(); - - /** @return the network interface IP configuration that this public IP address is assigned to */ - NicIpConfiguration getAssignedNetworkInterfaceIPConfiguration(); - - /** @return true if this public IP address is assigned to a network interface */ - boolean hasAssignedNetworkInterface(); - - /** @return the availability zones assigned to the public IP address */ - Set availabilityZones(); - - /** @return public IP address sku. */ - PublicIPSkuType sku(); - - /** @return read-only list of ipTags assosiated with public ip address */ - List ipTags(); - - /** Container interface for all the definitions. */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { - } - - /** Grouping of public IP address definition stages. */ - interface DefinitionStages { - /** The first stage of a public IP address definition. */ - interface Blank extends GroupableResource.DefinitionWithRegion { - } - - /** The stage of the public IP address definition allowing to specify the resource group. */ - interface WithGroup extends GroupableResource.DefinitionStages.WithGroup { - } - - /** A public IP address definition allowing to set the IP allocation method (static or dynamic). */ - interface WithIPAddress { - /** - * Enables static IP address allocation. - * - *

    Use {@link PublicIpAddress#ipAddress()} after the public IP address is created to obtain the actual IP - * address allocated for this resource by Azure - * - * @return the next stage of the definition - */ - WithCreate withStaticIP(); - - /** - * Enables dynamic IP address allocation. - * - * @return the next stage of the definition - */ - WithCreate withDynamicIP(); - } - - /** A public IP address definition allowing to specify the leaf domain label, if any. */ - interface WithLeafDomainLabel { - /** - * Specifies the leaf domain label to associate with this public IP address. - * - *

    The fully qualified domain name (FQDN) will be constructed automatically by appending the rest of the - * domain to this label. - * - * @param dnsName the leaf domain label to use. This must follow the required naming convention for leaf - * domain names. - * @return the next stage of the definition - */ - WithCreate withLeafDomainLabel(String dnsName); - - /** - * Ensures that no leaf domain label will be used. - * - *

    This means that this public IP address will not be associated with a domain name. - * - * @return the next stage of the definition - */ - WithCreate withoutLeafDomainLabel(); - } - - /** A public IP address definition allowing the reverse FQDN to be specified. */ - interface WithReverseFQDN { - /** - * Specifies the reverse FQDN to assign to this public IP address. - * - * @param reverseFQDN the reverse FQDN to assign - * @return the next stage of the definition - */ - WithCreate withReverseFqdn(String reverseFQDN); - - /** - * Ensures that no reverse FQDN will be used. - * - * @return the next stage of the definition - */ - WithCreate withoutReverseFqdn(); - } - - /** A public IP address definition allowing the idle timeout to be specified. */ - interface WithIdleTimeout { - /** - * Specifies the timeout (in minutes) for an idle connection. - * - * @param minutes the length of the time out in minutes - * @return the next stage of the definition - */ - WithCreate withIdleTimeoutInMinutes(int minutes); - } - - /** The stage of the IP address definition allowing to specify availability zone. */ - interface WithAvailabilityZone { - /** - * Specifies the availability zone for the IP address. - * - * @param zoneId the zone identifier. - * @return the next stage of the definition - */ - WithCreate withAvailabilityZone(AvailabilityZoneId zoneId); - } - - /** The stage of the IP address definition allowing to specify SKU. */ - interface WithSku { - /** - * Specifies the SKU for the IP address. - * - * @param skuType the SKU type - * @return the next stage of the definition - */ - WithCreate withSku(PublicIPSkuType skuType); - } - - /** The stage of the definition allowing to specify ipTags associated with the public IP address. */ - interface WithIpTag { - /** - * Sets an ipTag associated with the public IP address. - * - * @param tag ip tag value - * @return the next stage of the definition - */ - WithCreate withIpTag(String tag); - - /** - * Sets an ipTag associated with the public IP address. - * - * @param tag ip tag value - * @param ipTagType ipTagType - * @return the next stage of the definition - */ - WithCreate withIpTag(String tag, String ipTagType); - } - - /** The stage of the definition allowing to specify IP address version associated with the public IP address. */ - interface WithIpAddressVersion { - /** - * Sets IP address version. - * - * @param ipVersion IP address version - * @return the next stage of the definition - */ - WithCreate withIpAddressVersion(IpVersion ipVersion); - } - - /** - * The stage of the public IP definition which contains all the minimum required inputs for the resource to be - * created (via {@link WithCreate#create()}), but also allows for any other optional settings to be specified. - */ - interface WithCreate - extends Creatable, - DefinitionStages.WithLeafDomainLabel, - DefinitionStages.WithIPAddress, - DefinitionStages.WithReverseFQDN, - DefinitionStages.WithIdleTimeout, - DefinitionStages.WithAvailabilityZone, - DefinitionStages.WithSku, - DefinitionStages.WithIpTag, - DefinitionStages.WithIpAddressVersion, - Resource.DefinitionWithTags { - - /** - * Begins creating the public IP address resource. - * - * @return the accepted create operation - */ - Accepted beginCreate(); - } - } - - /** - * Container interface for all the updates. - * - *

    Use {@link Update#apply()} to apply the changes to the resource in Azure. - */ - interface Update - extends Appliable, - UpdateStages.WithIPAddress, - UpdateStages.WithLeafDomainLabel, - UpdateStages.WithReverseFQDN, - UpdateStages.WithIdleTimout, - UpdateStages.WithIpTag, - UpdateStages.WithIpAddressVersion, - Resource.UpdateWithTags { - } - - /** Grouping of public IP address update stages. */ - interface UpdateStages { - /** A public IP address update allowing to change the IP allocation method (static or dynamic). */ - interface WithIPAddress { - /** - * Enables static IP address allocation. - * - *

    Use {@link PublicIpAddress#ipAddress()} after the public IP address is updated to obtain the actual IP - * address allocated for this resource by Azure - * - * @return the next stage of the resource update - */ - Update withStaticIP(); - - /** - * Enables dynamic IP address allocation. - * - * @return the next stage of the resource update - */ - Update withDynamicIP(); - } - - /** A public IP address update allowing to change the leaf domain label, if any. */ - interface WithLeafDomainLabel { - /** - * Specifies the leaf domain label to associate with this public IP address. - * - *

    The fully qualified domain name (FQDN) will be constructed automatically by appending the rest of the - * domain to this label. - * - * @param dnsName the leaf domain label to use. This must follow the required naming convention for leaf - * domain names. - * @return the next stage of the resource update - */ - Update withLeafDomainLabel(String dnsName); - - /** - * Ensures that no leaf domain label will be used. - * - *

    This means that this public IP address will not be associated with a domain name. - * - * @return the next stage of the resource update - */ - Update withoutLeafDomainLabel(); - } - - /** A public IP address update allowing the reverse FQDN to be changed. */ - interface WithReverseFQDN { - /** - * Specifies the reverse FQDN to assign to this public IP address. - * - * @param reverseFQDN the reverse FQDN to assign - * @return the next stage of the resource update - */ - Update withReverseFqdn(String reverseFQDN); - - /** - * Ensures that no reverse FQDN will be used. - * - * @return The next stage of the resource update - */ - Update withoutReverseFqdn(); - } - - /** A public IP address update allowing the idle timeout to be changed. */ - interface WithIdleTimout { - /** - * Specifies the timeout (in minutes) for an idle connection. - * - * @param minutes the length of the time out in minutes - * @return the next stage of the resource update - */ - Update withIdleTimeoutInMinutes(int minutes); - } - - /** The stage of the update allowing to specify ipTags associated with the public IP address. */ - interface WithIpTag { - /** - * Sets an ipTag associated with the public IP address. - * - * @param tag ip tag value - * @return the next stage of the update - */ - Update withIpTag(String tag); - - /** - * Sets an ipTag associated with the public IP address. - * - * @param tag ip tag value - * @param ipTagType ipTagType - * @return the next stage of the update - */ - Update withIpTag(String tag, String ipTagType); - - /** - * Removes an ipTag associated with the public IP address. - * - * @param tag ip tag value - * @return the next stage of the update - */ - Update withoutIpTag(String tag); - } - - /** The stage of the update allowing to specify IP address version associated with the public IP address. */ - interface WithIpAddressVersion { - /** - * Sets IP address version. - * - * @param ipVersion IP address version - * @return the next stage of the definition - */ - Update withIpAddressVersion(IpVersion ipVersion); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/PublicIpAddressDnsSettings.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/PublicIpAddressDnsSettings.java deleted file mode 100644 index 4f44266a3ae7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/PublicIpAddressDnsSettings.java +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Contains FQDN of the DNS record associated with the public IP address. */ -@Fluent -public final class PublicIpAddressDnsSettings { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PublicIpAddressDnsSettings.class); - - /* - * Gets or sets the Domain name label.The concatenation of the domain name - * label and the regionalized DNS zone make up the fully qualified domain - * name associated with the public IP address. If a domain name label is - * specified, an A DNS record is created for the public IP in the Microsoft - * Azure DNS system. - */ - @JsonProperty(value = "domainNameLabel") - private String domainNameLabel; - - /* - * Gets the FQDN, Fully qualified domain name of the A DNS record - * associated with the public IP. This is the concatenation of the - * domainNameLabel and the regionalized DNS zone. - */ - @JsonProperty(value = "fqdn") - private String fqdn; - - /* - * Gets or Sets the Reverse FQDN. A user-visible, fully qualified domain - * name that resolves to this public IP address. If the reverseFqdn is - * specified, then a PTR DNS record is created pointing from the IP address - * in the in-addr.arpa domain to the reverse FQDN. - */ - @JsonProperty(value = "reverseFqdn") - private String reverseFqdn; - - /** - * Get the domainNameLabel property: Gets or sets the Domain name label.The concatenation of the domain name label - * and the regionalized DNS zone make up the fully qualified domain name associated with the public IP address. If a - * domain name label is specified, an A DNS record is created for the public IP in the Microsoft Azure DNS system. - * - * @return the domainNameLabel value. - */ - public String domainNameLabel() { - return this.domainNameLabel; - } - - /** - * Set the domainNameLabel property: Gets or sets the Domain name label.The concatenation of the domain name label - * and the regionalized DNS zone make up the fully qualified domain name associated with the public IP address. If a - * domain name label is specified, an A DNS record is created for the public IP in the Microsoft Azure DNS system. - * - * @param domainNameLabel the domainNameLabel value to set. - * @return the PublicIpAddressDnsSettings object itself. - */ - public PublicIpAddressDnsSettings withDomainNameLabel(String domainNameLabel) { - this.domainNameLabel = domainNameLabel; - return this; - } - - /** - * Get the fqdn property: Gets the FQDN, Fully qualified domain name of the A DNS record associated with the public - * IP. This is the concatenation of the domainNameLabel and the regionalized DNS zone. - * - * @return the fqdn value. - */ - public String fqdn() { - return this.fqdn; - } - - /** - * Set the fqdn property: Gets the FQDN, Fully qualified domain name of the A DNS record associated with the public - * IP. This is the concatenation of the domainNameLabel and the regionalized DNS zone. - * - * @param fqdn the fqdn value to set. - * @return the PublicIpAddressDnsSettings object itself. - */ - public PublicIpAddressDnsSettings withFqdn(String fqdn) { - this.fqdn = fqdn; - return this; - } - - /** - * Get the reverseFqdn property: Gets or Sets the Reverse FQDN. A user-visible, fully qualified domain name that - * resolves to this public IP address. If the reverseFqdn is specified, then a PTR DNS record is created pointing - * from the IP address in the in-addr.arpa domain to the reverse FQDN. - * - * @return the reverseFqdn value. - */ - public String reverseFqdn() { - return this.reverseFqdn; - } - - /** - * Set the reverseFqdn property: Gets or Sets the Reverse FQDN. A user-visible, fully qualified domain name that - * resolves to this public IP address. If the reverseFqdn is specified, then a PTR DNS record is created pointing - * from the IP address in the in-addr.arpa domain to the reverse FQDN. - * - * @param reverseFqdn the reverseFqdn value to set. - * @return the PublicIpAddressDnsSettings object itself. - */ - public PublicIpAddressDnsSettings withReverseFqdn(String reverseFqdn) { - this.reverseFqdn = reverseFqdn; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/PublicIpAddressListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/PublicIpAddressListResult.java deleted file mode 100644 index 330f7a3f9f67..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/PublicIpAddressListResult.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.PublicIpAddressInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Response for ListPublicIpAddresses API service call. */ -@Fluent -public final class PublicIpAddressListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PublicIpAddressListResult.class); - - /* - * A list of public IP addresses that exists in a resource group. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to get the next set of results. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: A list of public IP addresses that exists in a resource group. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: A list of public IP addresses that exists in a resource group. - * - * @param value the value value to set. - * @return the PublicIpAddressListResult object itself. - */ - public PublicIpAddressListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to get the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The URL to get the next set of results. - * - * @param nextLink the nextLink value to set. - * @return the PublicIpAddressListResult object itself. - */ - public PublicIpAddressListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/PublicIpAddressSku.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/PublicIpAddressSku.java deleted file mode 100644 index 4f6eda138985..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/PublicIpAddressSku.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** SKU of a public IP address. */ -@Fluent -public final class PublicIpAddressSku { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PublicIpAddressSku.class); - - /* - * Name of a public IP address SKU. - */ - @JsonProperty(value = "name") - private PublicIpAddressSkuName name; - - /** - * Get the name property: Name of a public IP address SKU. - * - * @return the name value. - */ - public PublicIpAddressSkuName name() { - return this.name; - } - - /** - * Set the name property: Name of a public IP address SKU. - * - * @param name the name value to set. - * @return the PublicIpAddressSku object itself. - */ - public PublicIpAddressSku withName(PublicIpAddressSkuName name) { - this.name = name; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/PublicIpAddressSkuName.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/PublicIpAddressSkuName.java deleted file mode 100644 index c1b7084c2541..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/PublicIpAddressSkuName.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for PublicIpAddressSkuName. */ -public final class PublicIpAddressSkuName extends ExpandableStringEnum { - /** Static value Basic for PublicIpAddressSkuName. */ - public static final PublicIpAddressSkuName BASIC = fromString("Basic"); - - /** Static value Standard for PublicIpAddressSkuName. */ - public static final PublicIpAddressSkuName STANDARD = fromString("Standard"); - - /** - * Creates or finds a PublicIpAddressSkuName from its string representation. - * - * @param name a name to look for. - * @return the corresponding PublicIpAddressSkuName. - */ - @JsonCreator - public static PublicIpAddressSkuName fromString(String name) { - return fromString(name, PublicIpAddressSkuName.class); - } - - /** @return known PublicIpAddressSkuName values. */ - public static Collection values() { - return values(PublicIpAddressSkuName.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/PublicIpAddresses.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/PublicIpAddresses.java deleted file mode 100644 index 2cb586572e8a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/PublicIpAddresses.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsBatchDeletion; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsDeletingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsListingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsBatchCreation; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsCreating; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingById; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; -import com.azure.resourcemanager.resources.fluentcore.model.Accepted; - -/** Entry point to public IP address management. */ -@Fluent() -public interface PublicIpAddresses - extends SupportsListing, - SupportsCreating, - SupportsDeletingById, - SupportsListingByResourceGroup, - SupportsGettingByResourceGroup, - SupportsGettingById, - SupportsDeletingByResourceGroup, - SupportsBatchCreation, - SupportsBatchDeletion, - HasManager { - - /** - * Begins deleting a public IP address from Azure, identifying it by its resource ID. - * - * @param id the resource ID of the public IP address to delete - * @return the accepted deleting operation - */ - Accepted beginDeleteById(String id); - - /** - * Begins deleting a public IP address from Azure, identifying it by its name and its resource group. - * - * @param resourceGroupName the resource group the resource is part of - * @param name the public IP address name - * @return the accepted deleting operation - */ - Accepted beginDeleteByResourceGroup(String resourceGroupName, String name); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/PublicIpPrefix.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/PublicIpPrefix.java deleted file mode 100644 index 5ce00ca6d90e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/PublicIpPrefix.java +++ /dev/null @@ -1,156 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.management.SubResource; -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.network.fluent.models.PublicIpPrefixInner; -import com.azure.resourcemanager.resources.fluentcore.arm.AvailabilityZoneId; -import com.azure.resourcemanager.resources.fluentcore.arm.models.GroupableResource; -import com.azure.resourcemanager.resources.fluentcore.arm.models.Resource; -import com.azure.resourcemanager.resources.fluentcore.model.Appliable; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; -import com.azure.resourcemanager.resources.fluentcore.model.Updatable; - -import java.util.List; -import java.util.Set; - -/** Type representing PublicIpPrefix. */ -public interface PublicIpPrefix - extends GroupableResource, - Refreshable, - Updatable, - UpdatableWithTags { - /** @return the ipPrefix value. */ - String ipPrefix(); - - /** @return the ipTags value. */ - List ipTags(); - - /** @return the loadBalancerFrontendIpConfiguration value. */ - SubResource loadBalancerFrontendIpConfiguration(); - - /** @return the prefixLength value. */ - Integer prefixLength(); - - /** @return the provisioningState value. */ - ProvisioningState provisioningState(); - - /** @return the publicIpAddresses value. */ - List publicIpAddresses(); - - /** @return the publicIpAddressVersion value. */ - IpVersion publicIpAddressVersion(); - - /** @return the resourceGuid value. */ - String resourceGuid(); - - /** @return the sku value. */ - PublicIpPrefixSku sku(); - - /** @return the availability zones assigned to the public Ip prefix */ - Set availabilityZones(); - - /** The entirety of the PublicIpPrefix definition. */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { - } - - /** Grouping of PublicIpPrefix definition stages. */ - interface DefinitionStages { - /** The first stage of a PublicIpPrefix definition. */ - interface Blank extends GroupableResource.DefinitionWithRegion { - } - - /** The stage of the PublicIpPrefix definition allowing to specify the resource group. */ - interface WithGroup extends GroupableResource.DefinitionStages.WithGroup { - } - - /** The stage of the publicipprefix definition allowing to specify IpTags. */ - interface WithIpTags { - /** - * Specifies ipTags. - * - * @param ipTags The list of tags associated with the public Ip prefix - * @return the next definition stage - */ - WithCreate withIpTags(List ipTags); - } - - /** The stage of the publicipprefix definition allowing to specify PrefixLength. */ - interface WithPrefixLength { - /** - * Specifies prefixLength. - * - * @param prefixLength The Length of the Public Ip Prefix - * @return the next definition stage - */ - WithCreate withPrefixLength(Integer prefixLength); - } - - /** The stage of the publicipprefix definition allowing to specify PublicIpAddressVersion. */ - interface WithPublicIpAddressVersion { - /** - * Specifies publicIpAddressVersion. - * - * @param publicIpAddressVersion The public Ip address version. Possible values include: 'Ipv4', 'Ipv6' - * @return the next definition stage - */ - WithCreate withPublicIpAddressVersion(IpVersion publicIpAddressVersion); - } - - /** The stage of the publicipprefix definition allowing to specify Sku. */ - interface WithSku { - /** - * Specifies sku. - * - * @param sku The public Ip prefix SKU - * @return the next definition stage - */ - WithCreate withSku(PublicIpPrefixSku sku); - } - - /** The stage of the Ip public prefix definition allowing to specify availability zone. */ - interface WithAvailabilityZone { - /** - * Specifies the availability zone for the Ip address. - * - * @param zoneId the zone identifier. - * @return the next stage of the definition - */ - WithCreate withAvailabilityZone(AvailabilityZoneId zoneId); - } - - /** - * The stage of the definition which contains all the minimum required inputs for the resource to be created - * (via {@link WithCreate#create()}), but also allows for any other optional settings to be specified. - */ - interface WithCreate - extends Creatable, - Resource.DefinitionWithTags, - DefinitionStages.WithIpTags, - DefinitionStages.WithPrefixLength, - DefinitionStages.WithPublicIpAddressVersion, - DefinitionStages.WithSku, - DefinitionStages.WithAvailabilityZone { - } - } - - /** The template for a PublicIpPrefix update operation, containing all the settings that can be modified. */ - interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithIpTags { - } - - /** Grouping of PublicIpPrefix update stages. */ - interface UpdateStages { - /** The stage of the publicipprefix update allowing to specify IpTags. */ - interface WithIpTags { - /** - * Specifies ipTags. - * - * @param ipTags The list of tags associated with the public Ip prefix - * @return the next update stage - */ - Update withIpTags(List ipTags); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/PublicIpPrefixListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/PublicIpPrefixListResult.java deleted file mode 100644 index c7de29e80424..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/PublicIpPrefixListResult.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.PublicIpPrefixInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Response for ListPublicIpPrefixes API service call. */ -@Fluent -public final class PublicIpPrefixListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PublicIpPrefixListResult.class); - - /* - * A list of public IP prefixes that exists in a resource group. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to get the next set of results. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: A list of public IP prefixes that exists in a resource group. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: A list of public IP prefixes that exists in a resource group. - * - * @param value the value value to set. - * @return the PublicIpPrefixListResult object itself. - */ - public PublicIpPrefixListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to get the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The URL to get the next set of results. - * - * @param nextLink the nextLink value to set. - * @return the PublicIpPrefixListResult object itself. - */ - public PublicIpPrefixListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/PublicIpPrefixSku.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/PublicIpPrefixSku.java deleted file mode 100644 index 0780f1822136..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/PublicIpPrefixSku.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** SKU of a public IP prefix. */ -@Fluent -public final class PublicIpPrefixSku { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PublicIpPrefixSku.class); - - /* - * Name of a public IP prefix SKU. - */ - @JsonProperty(value = "name") - private PublicIpPrefixSkuName name; - - /** - * Get the name property: Name of a public IP prefix SKU. - * - * @return the name value. - */ - public PublicIpPrefixSkuName name() { - return this.name; - } - - /** - * Set the name property: Name of a public IP prefix SKU. - * - * @param name the name value to set. - * @return the PublicIpPrefixSku object itself. - */ - public PublicIpPrefixSku withName(PublicIpPrefixSkuName name) { - this.name = name; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/PublicIpPrefixSkuName.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/PublicIpPrefixSkuName.java deleted file mode 100644 index 3607cb9e7d74..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/PublicIpPrefixSkuName.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for PublicIpPrefixSkuName. */ -public final class PublicIpPrefixSkuName extends ExpandableStringEnum { - /** Static value Standard for PublicIpPrefixSkuName. */ - public static final PublicIpPrefixSkuName STANDARD = fromString("Standard"); - - /** - * Creates or finds a PublicIpPrefixSkuName from its string representation. - * - * @param name a name to look for. - * @return the corresponding PublicIpPrefixSkuName. - */ - @JsonCreator - public static PublicIpPrefixSkuName fromString(String name) { - return fromString(name, PublicIpPrefixSkuName.class); - } - - /** @return known PublicIpPrefixSkuName values. */ - public static Collection values() { - return values(PublicIpPrefixSkuName.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/PublicIpPrefixes.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/PublicIpPrefixes.java deleted file mode 100644 index 1188b4e275e3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/PublicIpPrefixes.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsBatchDeletion; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsDeletingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsListingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsBatchCreation; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsCreating; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingById; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; - -/** Type representing PublicIpPrefixes. */ -public interface PublicIpPrefixes - extends SupportsListing, - SupportsCreating, - SupportsDeletingById, - SupportsListingByResourceGroup, - SupportsGettingByResourceGroup, - SupportsGettingById, - SupportsDeletingByResourceGroup, - SupportsBatchCreation, - SupportsBatchDeletion, - HasManager { -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/QueryTroubleshootingParameters.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/QueryTroubleshootingParameters.java deleted file mode 100644 index cae3bd96f839..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/QueryTroubleshootingParameters.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Parameters that define the resource to query the troubleshooting result. */ -@Fluent -public final class QueryTroubleshootingParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(QueryTroubleshootingParameters.class); - - /* - * The target resource ID to query the troubleshooting result. - */ - @JsonProperty(value = "targetResourceId", required = true) - private String targetResourceId; - - /** - * Get the targetResourceId property: The target resource ID to query the troubleshooting result. - * - * @return the targetResourceId value. - */ - public String targetResourceId() { - return this.targetResourceId; - } - - /** - * Set the targetResourceId property: The target resource ID to query the troubleshooting result. - * - * @param targetResourceId the targetResourceId value to set. - * @return the QueryTroubleshootingParameters object itself. - */ - public QueryTroubleshootingParameters withTargetResourceId(String targetResourceId) { - this.targetResourceId = targetResourceId; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (targetResourceId() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property targetResourceId in model QueryTroubleshootingParameters")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ReferencedPublicIpAddress.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ReferencedPublicIpAddress.java deleted file mode 100644 index 9b1ab99b7cd5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ReferencedPublicIpAddress.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The ReferencedPublicIpAddress model. */ -@Fluent -public final class ReferencedPublicIpAddress { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ReferencedPublicIpAddress.class); - - /* - * The PublicIPAddress Reference - */ - @JsonProperty(value = "id") - private String id; - - /** - * Get the id property: The PublicIPAddress Reference. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: The PublicIPAddress Reference. - * - * @param id the id value to set. - * @return the ReferencedPublicIpAddress object itself. - */ - public ReferencedPublicIpAddress withId(String id) { - this.id = id; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ResourceIdentityType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ResourceIdentityType.java deleted file mode 100644 index ef25a6fa43e9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ResourceIdentityType.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for ResourceIdentityType. */ -public enum ResourceIdentityType { - /** Enum value SystemAssigned. */ - SYSTEM_ASSIGNED("SystemAssigned"), - - /** Enum value UserAssigned. */ - USER_ASSIGNED("UserAssigned"), - - /** Enum value SystemAssigned, UserAssigned. */ - SYSTEM_ASSIGNED_USER_ASSIGNED("SystemAssigned, UserAssigned"), - - /** Enum value None. */ - NONE("None"); - - /** The actual serialized value for a ResourceIdentityType instance. */ - private final String value; - - ResourceIdentityType(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a ResourceIdentityType instance. - * - * @param value the serialized value to parse. - * @return the parsed ResourceIdentityType object, or null if unable to parse. - */ - @JsonCreator - public static ResourceIdentityType fromString(String value) { - ResourceIdentityType[] items = ResourceIdentityType.values(); - for (ResourceIdentityType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ResourceNavigationLink.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ResourceNavigationLink.java deleted file mode 100644 index b1e1879c48e5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ResourceNavigationLink.java +++ /dev/null @@ -1,150 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.ResourceNavigationLinkFormat; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** ResourceNavigationLink resource. */ -@Fluent -public final class ResourceNavigationLink extends SubResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceNavigationLink.class); - - /* - * Resource navigation link properties format. - */ - @JsonProperty(value = "properties") - private ResourceNavigationLinkFormat innerProperties; - - /* - * Name of the resource that is unique within a resource group. This name - * can be used to access the resource. - */ - @JsonProperty(value = "name") - private String name; - - /* - * A unique read-only string that changes whenever the resource is updated. - */ - @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) - private String etag; - - /** - * Get the innerProperties property: Resource navigation link properties format. - * - * @return the innerProperties value. - */ - private ResourceNavigationLinkFormat innerProperties() { - return this.innerProperties; - } - - /** - * Get the name property: Name of the resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Name of the resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @param name the name value to set. - * @return the ResourceNavigationLink object itself. - */ - public ResourceNavigationLink withName(String name) { - this.name = name; - return this; - } - - /** - * Get the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** {@inheritDoc} */ - @Override - public ResourceNavigationLink withId(String id) { - super.withId(id); - return this; - } - - /** - * Get the linkedResourceType property: Resource type of the linked resource. - * - * @return the linkedResourceType value. - */ - public String linkedResourceType() { - return this.innerProperties() == null ? null : this.innerProperties().linkedResourceType(); - } - - /** - * Set the linkedResourceType property: Resource type of the linked resource. - * - * @param linkedResourceType the linkedResourceType value to set. - * @return the ResourceNavigationLink object itself. - */ - public ResourceNavigationLink withLinkedResourceType(String linkedResourceType) { - if (this.innerProperties() == null) { - this.innerProperties = new ResourceNavigationLinkFormat(); - } - this.innerProperties().withLinkedResourceType(linkedResourceType); - return this; - } - - /** - * Get the link property: Link to the external resource. - * - * @return the link value. - */ - public String link() { - return this.innerProperties() == null ? null : this.innerProperties().link(); - } - - /** - * Set the link property: Link to the external resource. - * - * @param link the link value to set. - * @return the ResourceNavigationLink object itself. - */ - public ResourceNavigationLink withLink(String link) { - if (this.innerProperties() == null) { - this.innerProperties = new ResourceNavigationLinkFormat(); - } - this.innerProperties().withLink(link); - return this; - } - - /** - * Get the provisioningState property: Provisioning state of the ResourceNavigationLink resource. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/RetentionPolicyParameters.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/RetentionPolicyParameters.java deleted file mode 100644 index 6e65966ad828..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/RetentionPolicyParameters.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Parameters that define the retention policy for flow log. */ -@Fluent -public final class RetentionPolicyParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RetentionPolicyParameters.class); - - /* - * Number of days to retain flow log records. - */ - @JsonProperty(value = "days") - private Integer days; - - /* - * Flag to enable/disable retention. - */ - @JsonProperty(value = "enabled") - private Boolean enabled; - - /** - * Get the days property: Number of days to retain flow log records. - * - * @return the days value. - */ - public Integer days() { - return this.days; - } - - /** - * Set the days property: Number of days to retain flow log records. - * - * @param days the days value to set. - * @return the RetentionPolicyParameters object itself. - */ - public RetentionPolicyParameters withDays(Integer days) { - this.days = days; - return this; - } - - /** - * Get the enabled property: Flag to enable/disable retention. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Flag to enable/disable retention. - * - * @param enabled the enabled value to set. - * @return the RetentionPolicyParameters object itself. - */ - public RetentionPolicyParameters withEnabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/Route.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/Route.java deleted file mode 100644 index 727de3deb6c7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/Route.java +++ /dev/null @@ -1,217 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.network.fluent.models.RouteInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.ChildResource; -import com.azure.resourcemanager.resources.fluentcore.model.Attachable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.model.Settable; - -/** An immutable client-side representation of a route of a route table. */ -@Fluent() -public interface Route extends HasInnerModel, ChildResource { - - /** @return the destination address prefix, expressed using the CIDR notation, to which the route applies */ - String destinationAddressPrefix(); - - /** @return the type of the next hop */ - RouteNextHopType nextHopType(); - - /** @return the IP address of the next hop */ - String nextHopIpAddress(); - - // Grouping of route definition stages - - /** Grouping of route definition stages. */ - interface DefinitionStages { - /** - * The first stage of a route definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface Blank extends WithDestinationAddressPrefix { - } - - /** - * The final stage of a route definition. - * - *

    At this stage, any remaining optional settings can be specified, or the route definition can be attached - * to the parent route table definition using {@link WithAttach#attach()}. - * - * @param the return type of {@link WithAttach#attach()} - */ - interface WithAttach extends Attachable.InDefinition { - } - - /** - * The stage of a route definition allowing to specify the destination address prefix. - * - * @param the return type of {@link WithAttach#attach()} - */ - interface WithDestinationAddressPrefix { - /** - * Specifies the destination address prefix to apply the route to. - * - * @param cidr an address prefix expressed in the CIDR notation - * @return the next stage of the definition - */ - WithNextHopType withDestinationAddressPrefix(String cidr); - } - - /** - * The stage of a route definition allowing to specify the next hop type. - * - * @param the return type of {@link WithAttach#attach()} - */ - interface WithNextHopType { - /** - * Specifies the next hop type. - * - *

    To use a virtual appliance, use {@link #withNextHopToVirtualAppliance(String)} instead and specify its - * IP address. - * - * @param nextHopType a hop type - * @return the next stage of the definition - */ - WithAttach withNextHop(RouteNextHopType nextHopType); - - /** - * Specifies the IP address of the virtual appliance for the next hop to go to. - * - * @param ipAddress an IP address of an existing virtual appliance (virtual machine) - * @return the next stage of the definition - */ - WithAttach withNextHopToVirtualAppliance(String ipAddress); - } - } - - /** - * The entirety of a route definition. - * - * @param the return type of the final {@link DefinitionStages.WithAttach#attach()} - */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithAttach, - DefinitionStages.WithNextHopType, - DefinitionStages.WithDestinationAddressPrefix { - } - - /** Grouping of route update stages. */ - interface UpdateStages { - /** The stage of a route update allowing to modify the destination address prefix. */ - interface WithDestinationAddressPrefix { - /** - * Specifies the destination address prefix to apply the route to. - * - * @param cidr an address prefix expressed in the CIDR notation - * @return the next stage of the update - */ - Update withDestinationAddressPrefix(String cidr); - } - - /** The stage of a route update allowing to specify the next hop type. */ - interface WithNextHopType { - /** - * Specifies the next hop type. - * - *

    To use a virtual appliance, use {@link #withNextHopToVirtualAppliance(String)} instead and specify its - * IP address. - * - * @param nextHopType a hop type - * @return the next stage of the update - */ - Update withNextHop(RouteNextHopType nextHopType); - - /** - * Specifies the IP address of the virtual appliance for the next hop to go to. - * - * @param ipAddress an IP address of an existing virtual appliance (virtual machine) - * @return the next stage of the update - */ - Update withNextHopToVirtualAppliance(String ipAddress); - } - } - - /** The entirety of a route update as part of a route table update. */ - interface Update - extends Settable, UpdateStages.WithDestinationAddressPrefix, UpdateStages.WithNextHopType { - } - - /** Grouping of route definition stages applicable as part of a route table update. */ - interface UpdateDefinitionStages { - /** - * The first stage of a route definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface Blank extends WithDestinationAddressPrefix { - } - - /** - * The final stage of a route definition. - * - *

    At this stage, any remaining optional settings can be specified, or the route definition can be attached - * to the parent route table definition using {@link WithAttach#attach()}. - * - * @param the return type of {@link WithAttach#attach()} - */ - interface WithAttach extends Attachable.InUpdate { - } - - /** - * The stage of a route definition allowing to specify the destination address prefix. - * - * @param the return type of {@link WithAttach#attach()} - */ - interface WithDestinationAddressPrefix { - /** - * Specifies the destination address prefix to apply the route to. - * - * @param cidr an address prefix expressed in the CIDR notation - * @return the next stage of the definition - */ - WithNextHopType withDestinationAddressPrefix(String cidr); - } - - /** - * The stage of a route definition allowing to specify the next hop type. - * - * @param the return type of {@link WithAttach#attach()} - */ - interface WithNextHopType { - /** - * Specifies the next hop type. - * - *

    To use a virtual appliance, use {@link #withNextHopToVirtualAppliance(String)} instead and specify its - * IP address. - * - * @param nextHopType a hop type - * @return the next stage of the definition - */ - WithAttach withNextHop(RouteNextHopType nextHopType); - - /** - * Specifies the IP address of the virtual appliance for the next hop to go to. - * - * @param ipAddress an IP address of an existing virtual appliance (virtual machine) - * @return the next stage of the definition - */ - WithAttach withNextHopToVirtualAppliance(String ipAddress); - } - } - - /** - * The entirety of a route definition as part of a route table update. - * - * @param the return type of the final {@link UpdateDefinitionStages.WithAttach#attach()} - */ - interface UpdateDefinition - extends UpdateDefinitionStages.Blank, - UpdateDefinitionStages.WithAttach, - UpdateDefinitionStages.WithNextHopType, - UpdateDefinitionStages.WithDestinationAddressPrefix { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/RouteFilter.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/RouteFilter.java deleted file mode 100644 index d7272df5c057..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/RouteFilter.java +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.network.fluent.models.RouteFilterInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.GroupableResource; -import com.azure.resourcemanager.resources.fluentcore.arm.models.Resource; -import com.azure.resourcemanager.resources.fluentcore.model.Appliable; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; -import com.azure.resourcemanager.resources.fluentcore.model.Updatable; -import java.util.Map; - -/** Route filter. */ -@Fluent -public interface RouteFilter - extends GroupableResource, - Refreshable, - Updatable { - /** @return rules associated with this route filter, indexed by their names */ - Map rules(); - - /** @return express route circuit peerings associated with this route filter, indexed by their names */ - Map peerings(); - - /** @return the provisioning state of the route filter resource */ - String provisioningState(); - - // Fluent interfaces for creating Route Filter - - /** The entirety of the aroute filter definition. */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { - } - - /** Grouping of route filter definition stages. */ - interface DefinitionStages { - /** The first stage of the definition. */ - interface Blank extends GroupableResource.DefinitionWithRegion { - } - - /** The stage allowing to specify the resource group. */ - interface WithGroup extends GroupableResource.DefinitionStages.WithGroup { - } - - /** - * The stage of the definition which contains all the minimum required inputs for the resource to be created - * (via {@link WithCreate#create()}), but also allows for any other optional settings to be specified. - */ - interface WithCreate extends Creatable, Resource.DefinitionWithTags { - } - } - - /** Grouping of route filter update stages. */ - interface UpdateStages { - /** The stage of the resource update allowing to add or remove route filter rules. */ - interface WithRule { - /** - * Removes an route filter rule. - * - * @param name the name of the route filter rule to remove - * @return the next stage of the route filter update - */ - Update withoutRule(String name); - - /** - * Begins the definition of a new route filter rule to be added to this route filter. - * - * @param name the name of the route filter rule - * @return the first stage of the new route filter rule definition - */ - RouteFilterRule.UpdateDefinitionStages.Blank defineRule(String name); - - /** - * Begins the description of an update of an existing route filter rule of this route filter. - * - * @param name the name of an existing route filter rule - * @return the first stage of the route filter rule update description - */ - RouteFilterRule.Update updateRule(String name); - } - } - - /** - * The template for an update operation, containing all the settings that can be modified. - * - *

    Call {@link Update#apply()} to apply the changes to the resource in Azure. - */ - interface Update extends Appliable, UpdateStages.WithRule, Resource.UpdateWithTags { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/RouteFilterListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/RouteFilterListResult.java deleted file mode 100644 index 6f23dbe2d2e6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/RouteFilterListResult.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.RouteFilterInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Response for the ListRouteFilters API service call. */ -@Fluent -public final class RouteFilterListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RouteFilterListResult.class); - - /* - * Gets a list of route filters in a resource group. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to get the next set of results. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: Gets a list of route filters in a resource group. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Gets a list of route filters in a resource group. - * - * @param value the value value to set. - * @return the RouteFilterListResult object itself. - */ - public RouteFilterListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to get the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The URL to get the next set of results. - * - * @param nextLink the nextLink value to set. - * @return the RouteFilterListResult object itself. - */ - public RouteFilterListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/RouteFilterRule.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/RouteFilterRule.java deleted file mode 100644 index 1087eb52f9ba..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/RouteFilterRule.java +++ /dev/null @@ -1,240 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.network.fluent.models.RouteFilterRuleInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.ChildResource; -import com.azure.resourcemanager.resources.fluentcore.model.Attachable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.model.Settable; -import java.util.List; - -/** A route filter rule in a route filter group. */ -@Fluent -public interface RouteFilterRule extends HasInnerModel, ChildResource { - - /** @return the access type of the rule */ - Access access(); - - /** @return the rule type of the rule */ - RouteFilterRuleType routeFilterRuleType(); - - /** - * The collection for bgp community values to filter on. e.g. ['12076:5010','12076:5020']. - * - * @return collection of community values - */ - List communities(); - - /** @return the provisioning state of the resource */ - String provisioningState(); - - /** @return resource location */ - String location(); - - /** - * The entirety of a route filter rule definition. - * - * @param the return type of the final {@link Attachable#attach()} - */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithBgpCommunities, - DefinitionStages.WithAttach { - } - - /** Grouping of route filter rule definition stages applicable as part of a route filter group creation. */ - interface DefinitionStages { - /** - * The first stage of a route filter rule definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface Blank extends WithBgpCommunities { - } - - /** The stage of the route filter rule definition allowing bgp service communities to be specified. */ - interface WithBgpCommunities { - /** - * Set the collection for bgp community values to filter on. e.g. ['12076:5010','12076:5020']. - * - * @param communities service communities - * @return the next stage of the definition - */ - WithAttach withBgpCommunities(String... communities); - - /** - * Set bgp community value to filter on. e.g. '12076:5020'. - * - * @param community service community - * @return the next stage of the definition - */ - WithAttach withBgpCommunity(String community); - - /** - * Remove the bgp community value to filter on. e.g. '12076:5010' - * - * @param community the bgp community value - * @return the next stage of the update - */ - Update withoutBgpCommunity(String community); - } - - /** The stage of the route filter rule definition allowing access type of the rule. */ - interface WithAccessType { - /** - * Set 'Allow' acces type of the rule. - * - * @return the next stage of the definition - */ - WithAttach allowAccess(); - - /** - * Set 'Deny' access type of the rule. - * - * @return the next stage of the definition - */ - WithAttach denyAccess(); - } - - /** - * The final stage of the route filter rule definition. - * - *

    At this stage, any remaining optional settings can be specified, or the route filter rule definition can - * be attached to the parent route filter group definition using {@link WithAttach#attach()}. - * - * @param the return type of {@link WithAttach#attach()} - */ - interface WithAttach extends Attachable.InDefinition, WithAccessType { - } - } - - /** - * The entirety of a route filter rule definition as part of a route filter group update. - * - * @param the return type of the final {@link UpdateDefinitionStages.WithAttach#attach()} - */ - interface UpdateDefinition - extends UpdateDefinitionStages.Blank, UpdateDefinitionStages.WithAttach { - } - - /** Grouping of route filter rule definition stages applicable as part of a route filter group update. */ - interface UpdateDefinitionStages { - /** - * The first stage of a route filter rule description as part of an update of a networking route filter group. - * - * @param the return type of the final {@link Attachable#attach()} - */ - interface Blank extends UpdateDefinitionStages.WithBgpCommunities { - } - - /** The stage of the route filter rule definition allowing bgp service communities to be specified. */ - interface WithBgpCommunities { - /** - * Set the collection for bgp community values to filter on. e.g. ['12076:5010','12076:5020']. - * - * @param communities service communities - * @return the next stage of the definition - */ - UpdateDefinitionStages.WithAttach withBgpCommunities(String... communities); - - /** - * Set bgp community value to filter on. e.g. '12076:5020'. - * - * @param community service community - * @return the next stage of the definition - */ - UpdateDefinitionStages.WithAttach withBgpCommunity(String community); - - /** - * Remove the bgp community value to filter on. e.g. '12076:5010' - * - * @param community the bgp community value - * @return the next stage of the update - */ - Update withoutBgpCommunity(String community); - } - - /** The stage of the route filter rule definition allowing access type of the rule. */ - interface WithAccessType { - /** - * Set 'Allow' acces type of the rule. - * - * @return the next stage of the definition - */ - WithAttach allowAccess(); - - /** - * Set 'Deny' access type of the rule. - * - * @return the next stage of the definition - */ - WithAttach denyAccess(); - } - - /** - * The final stage of the route filter rule definition. - * - *

    At this stage, any remaining optional settings can be specified, or the route filter rule definition can - * be attached to the parent route filter group definition using {@link WithAttach#attach()}. - * - * @param the return type of {@link WithAttach#attach()} - */ - interface WithAttach extends Attachable.InUpdate { - } - } - - /** The entirety of a route filter rule update as part of a route filter group update. */ - interface Update - extends UpdateStages.WithBgpCommunities, UpdateStages.WithAccessType, Settable { - } - - /** Grouping of route filter rule update stages. */ - interface UpdateStages { - /** The stage of the route filter rule description allowing bgp service communities to be specified. */ - interface WithBgpCommunities { - /** - * The collection for bgp community values to filter on. e.g. ['12076:5010','12076:5020']. Note: this method - * will overwrite existing communities. - * - * @param communities service communities - * @return the next stage of the update - */ - Update withBgpCommunities(String... communities); - - /** - * The bgp community values to filter on. e.g. '12076:5010'. This method has additive effect. - * - * @param community the bgp community value - * @return the next stage of the update - */ - Update withBgpCommunity(String community); - - /** - * Remove the bgp community value to filter on. e.g. '12076:5010' - * - * @param community the bgp community value - * @return the next stage of the update - */ - Update withoutBgpCommunity(String community); - } - - /** The stage of the route filter rule definition allowing access type of the rule. */ - interface WithAccessType { - /** - * Set 'Allow' acces type of the rule. - * - * @return the next stage of the definition - */ - Update allowAccess(); - - /** - * Set 'Deny' access type of the rule. - * - * @return the next stage of the definition - */ - Update denyAccess(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/RouteFilterRuleListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/RouteFilterRuleListResult.java deleted file mode 100644 index a37bb8bfae7e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/RouteFilterRuleListResult.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.RouteFilterRuleInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Response for the ListRouteFilterRules API service call. */ -@Fluent -public final class RouteFilterRuleListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RouteFilterRuleListResult.class); - - /* - * Gets a list of RouteFilterRules in a resource group. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to get the next set of results. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: Gets a list of RouteFilterRules in a resource group. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Gets a list of RouteFilterRules in a resource group. - * - * @param value the value value to set. - * @return the RouteFilterRuleListResult object itself. - */ - public RouteFilterRuleListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to get the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The URL to get the next set of results. - * - * @param nextLink the nextLink value to set. - * @return the RouteFilterRuleListResult object itself. - */ - public RouteFilterRuleListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/RouteFilterRuleType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/RouteFilterRuleType.java deleted file mode 100644 index 6b9a5c0f7e96..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/RouteFilterRuleType.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for RouteFilterRuleType. */ -public final class RouteFilterRuleType extends ExpandableStringEnum { - /** Static value Community for RouteFilterRuleType. */ - public static final RouteFilterRuleType COMMUNITY = fromString("Community"); - - /** - * Creates or finds a RouteFilterRuleType from its string representation. - * - * @param name a name to look for. - * @return the corresponding RouteFilterRuleType. - */ - @JsonCreator - public static RouteFilterRuleType fromString(String name) { - return fromString(name, RouteFilterRuleType.class); - } - - /** @return known RouteFilterRuleType values. */ - public static Collection values() { - return values(RouteFilterRuleType.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/RouteFilters.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/RouteFilters.java deleted file mode 100644 index ae59e68a0580..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/RouteFilters.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsBatchDeletion; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsDeletingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsListingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsBatchCreation; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsCreating; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingById; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; - -/** Entry point to application security group management. */ -@Fluent -public interface RouteFilters - extends SupportsCreating, - SupportsListing, - SupportsListingByResourceGroup, - SupportsGettingByResourceGroup, - SupportsGettingById, - SupportsDeletingById, - SupportsDeletingByResourceGroup, - SupportsBatchCreation, - SupportsBatchDeletion, - HasManager { -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/RouteListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/RouteListResult.java deleted file mode 100644 index be32504ca1e2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/RouteListResult.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.RouteInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Response for the ListRoute API service call. */ -@Fluent -public final class RouteListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RouteListResult.class); - - /* - * Gets a list of routes in a resource group. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to get the next set of results. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: Gets a list of routes in a resource group. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Gets a list of routes in a resource group. - * - * @param value the value value to set. - * @return the RouteListResult object itself. - */ - public RouteListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to get the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The URL to get the next set of results. - * - * @param nextLink the nextLink value to set. - * @return the RouteListResult object itself. - */ - public RouteListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/RouteNextHopType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/RouteNextHopType.java deleted file mode 100644 index 243b1c024610..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/RouteNextHopType.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for RouteNextHopType. */ -public final class RouteNextHopType extends ExpandableStringEnum { - /** Static value VirtualNetworkGateway for RouteNextHopType. */ - public static final RouteNextHopType VIRTUAL_NETWORK_GATEWAY = fromString("VirtualNetworkGateway"); - - /** Static value VnetLocal for RouteNextHopType. */ - public static final RouteNextHopType VNET_LOCAL = fromString("VnetLocal"); - - /** Static value Internet for RouteNextHopType. */ - public static final RouteNextHopType INTERNET = fromString("Internet"); - - /** Static value VirtualAppliance for RouteNextHopType. */ - public static final RouteNextHopType VIRTUAL_APPLIANCE = fromString("VirtualAppliance"); - - /** Static value None for RouteNextHopType. */ - public static final RouteNextHopType NONE = fromString("None"); - - /** - * Creates or finds a RouteNextHopType from its string representation. - * - * @param name a name to look for. - * @return the corresponding RouteNextHopType. - */ - @JsonCreator - public static RouteNextHopType fromString(String name) { - return fromString(name, RouteNextHopType.class); - } - - /** @return known RouteNextHopType values. */ - public static Collection values() { - return values(RouteNextHopType.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/RouteTable.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/RouteTable.java deleted file mode 100644 index 23e4607e5164..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/RouteTable.java +++ /dev/null @@ -1,190 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.network.fluent.models.RouteTableInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.GroupableResource; -import com.azure.resourcemanager.resources.fluentcore.arm.models.Resource; -import com.azure.resourcemanager.resources.fluentcore.model.Appliable; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; -import com.azure.resourcemanager.resources.fluentcore.model.Updatable; -import java.util.Map; - -/** Entry point for route table management. */ -@Fluent() -public interface RouteTable - extends GroupableResource, - Refreshable, - Updatable, - UpdatableWithTags, - HasAssociatedSubnets { - - /** @return the routes of this route table */ - Map routes(); - - /** @return whether to disable the routes learned by BGP on that route table. True means disable. */ - boolean isBgpRoutePropagationDisabled(); - - /** The entirety of a route table definition. */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { - } - - /** Grouping of route table definition stages. */ - interface DefinitionStages { - /** The first stage of a route table definition. */ - interface Blank extends GroupableResource.DefinitionWithRegion { - } - - /** The stage of a route table definition allowing to specify the resource group. */ - interface WithGroup extends GroupableResource.DefinitionStages.WithGroup { - } - - /** The stage of the route table definition allowing to add routes. */ - interface WithRoute { - /** - * Begins the definition of a new route to add to the route table. - * - *

    The definition must be completed with a call to {@link Route.DefinitionStages.WithAttach#attach()} - * - * @param name the name of the route - * @return the first stage of the definition - */ - Route.DefinitionStages.Blank defineRoute(String name); - - /** - * Creates a non-virtual appliance route. - * - *

    The name is generated automatically. - * - * @param destinationAddressPrefix the destination address prefix, expressed in the CIDR notation, for the - * route to apply to - * @param nextHop the next hop type - * @return the next stage of the definition - */ - WithCreate withRoute(String destinationAddressPrefix, RouteNextHopType nextHop); - - /** - * Creates a route via a virtual appliance. - * - * @param destinationAddressPrefix the destination address prefix, expressed in the CIDR notation, for the - * route to apply to - * @param ipAddress the IP address of the virtual appliance to route the traffic through - * @return the next stage of the definition - */ - WithCreate withRouteViaVirtualAppliance(String destinationAddressPrefix, String ipAddress); - } - - /** - * The stage of the route table definition allowing to specify whether to disable the routes learned by BGP on - * that route table. - */ - interface WithBgpRoutePropagation { - /** - * Disable the routes learned by BGP on that route table. - * - * @return the next stage of the definition - */ - WithCreate withDisableBgpRoutePropagation(); - } - - /** - * The stage of a route table definition which contains all the minimum required inputs for the resource to be - * created (via {@link WithCreate#create()}), but also allows for any other optional settings to be specified. - */ - interface WithCreate - extends Creatable, - Resource.DefinitionWithTags, - DefinitionStages.WithRoute, - DefinitionStages.WithBgpRoutePropagation { - } - } - - /** Grouping of route table update stages. */ - interface UpdateStages { - /** The stage of the route table definition allowing to add, remove or modify routes. */ - interface WithRoute { - /** - * Creates a non-virtual appliance route. - * - *

    The name is generated automatically. - * - * @param destinationAddressPrefix the destination address prefix, expressed in the CIDR notation, for the - * route to apply to - * @param nextHop the next hop type - * @return the next stage of the update - */ - Update withRoute(String destinationAddressPrefix, RouteNextHopType nextHop); - - /** - * Creates a route via a virtual appliance. - * - * @param destinationAddressPrefix the destination address prefix, expressed in the CIDR notation, for the - * route to apply to - * @param ipAddress the IP address of the virtual appliance to route the traffic through - * @return the next stage of the update - */ - Update withRouteViaVirtualAppliance(String destinationAddressPrefix, String ipAddress); - - /** - * Begins the definition of a new route to add to the route table. - * - *

    The definition must be completed with a call to {@link - * Route.UpdateDefinitionStages.WithAttach#attach()} - * - * @param name the name of the route - * @return the first stage of the definition - */ - Route.UpdateDefinitionStages.Blank defineRoute(String name); - - /** - * Removes the specified route from the route table. - * - * @param name the name of an existing route on this route table - * @return the next stage of the update - */ - Update withoutRoute(String name); - - /** - * Begins the update of an existing route on this route table. - * - * @param name the name of an existing route - * @return the first stage of the update - */ - Route.Update updateRoute(String name); - } - - /** - * The stage of the route table update allowing to specify whether to disable the routes learned by BGP on that - * route table. - */ - interface WithBgpRoutePropagation { - /** - * Disable the routes learned by BGP on that route table. - * - * @return the next stage of the update - */ - Update withDisableBgpRoutePropagation(); - /** - * Enable the routes learned by BGP on that route table. - * - * @return the next stage of the update - */ - Update withEnableBgpRoutePropagation(); - } - } - - /** - * The template for a route table update operation, containing all the settings that can be modified. - * - *

    Call {@link Update#apply()} to apply the changes to the resource in Azure. - */ - interface Update - extends Appliable, - Resource.UpdateWithTags, - UpdateStages.WithRoute, - UpdateStages.WithBgpRoutePropagation { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/RouteTableListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/RouteTableListResult.java deleted file mode 100644 index adaeb1a1ffaf..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/RouteTableListResult.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.RouteTableInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Response for the ListRouteTable API service call. */ -@Fluent -public final class RouteTableListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RouteTableListResult.class); - - /* - * Gets a list of route tables in a resource group. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to get the next set of results. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: Gets a list of route tables in a resource group. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Gets a list of route tables in a resource group. - * - * @param value the value value to set. - * @return the RouteTableListResult object itself. - */ - public RouteTableListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to get the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The URL to get the next set of results. - * - * @param nextLink the nextLink value to set. - * @return the RouteTableListResult object itself. - */ - public RouteTableListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/RouteTables.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/RouteTables.java deleted file mode 100644 index fbc78a4a5bf1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/RouteTables.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsBatchDeletion; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsDeletingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsListingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsBatchCreation; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsCreating; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingById; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; - -/** Entry point to route table management. */ -@Fluent() -public interface RouteTables - extends SupportsCreating, - SupportsListing, - SupportsListingByResourceGroup, - SupportsGettingByResourceGroup, - SupportsGettingById, - SupportsDeletingById, - SupportsDeletingByResourceGroup, - SupportsBatchCreation, - SupportsBatchDeletion, - HasManager { -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/SecurityGroupNetworkInterface.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/SecurityGroupNetworkInterface.java deleted file mode 100644 index a6b2c3f0b345..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/SecurityGroupNetworkInterface.java +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Network interface and all its associated security rules. */ -@Fluent -public final class SecurityGroupNetworkInterface { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SecurityGroupNetworkInterface.class); - - /* - * ID of the network interface. - */ - @JsonProperty(value = "id") - private String id; - - /* - * All security rules associated with the network interface. - */ - @JsonProperty(value = "securityRuleAssociations") - private SecurityRuleAssociations securityRuleAssociations; - - /** - * Get the id property: ID of the network interface. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: ID of the network interface. - * - * @param id the id value to set. - * @return the SecurityGroupNetworkInterface object itself. - */ - public SecurityGroupNetworkInterface withId(String id) { - this.id = id; - return this; - } - - /** - * Get the securityRuleAssociations property: All security rules associated with the network interface. - * - * @return the securityRuleAssociations value. - */ - public SecurityRuleAssociations securityRuleAssociations() { - return this.securityRuleAssociations; - } - - /** - * Set the securityRuleAssociations property: All security rules associated with the network interface. - * - * @param securityRuleAssociations the securityRuleAssociations value to set. - * @return the SecurityGroupNetworkInterface object itself. - */ - public SecurityGroupNetworkInterface withSecurityRuleAssociations( - SecurityRuleAssociations securityRuleAssociations) { - this.securityRuleAssociations = securityRuleAssociations; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (securityRuleAssociations() != null) { - securityRuleAssociations().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/SecurityGroupView.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/SecurityGroupView.java deleted file mode 100644 index caf958e5f954..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/SecurityGroupView.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.network.fluent.models.SecurityGroupViewResultInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasParent; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; -import java.util.Map; - -/** The information about security rules applied to the specified VM.. */ -@Fluent -public interface SecurityGroupView - extends HasInnerModel, HasParent, Refreshable { - /** @return network interfaces on the specified VM */ - Map networkInterfaces(); - - /** @return virtual machine id */ - String vmId(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/SecurityGroupViewParameters.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/SecurityGroupViewParameters.java deleted file mode 100644 index ff05f7838642..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/SecurityGroupViewParameters.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Parameters that define the VM to check security groups for. */ -@Fluent -public final class SecurityGroupViewParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SecurityGroupViewParameters.class); - - /* - * ID of the target VM. - */ - @JsonProperty(value = "targetResourceId", required = true) - private String targetResourceId; - - /** - * Get the targetResourceId property: ID of the target VM. - * - * @return the targetResourceId value. - */ - public String targetResourceId() { - return this.targetResourceId; - } - - /** - * Set the targetResourceId property: ID of the target VM. - * - * @param targetResourceId the targetResourceId value to set. - * @return the SecurityGroupViewParameters object itself. - */ - public SecurityGroupViewParameters withTargetResourceId(String targetResourceId) { - this.targetResourceId = targetResourceId; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (targetResourceId() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property targetResourceId in model SecurityGroupViewParameters")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/SecurityRuleAccess.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/SecurityRuleAccess.java deleted file mode 100644 index 78bc3e6d1a05..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/SecurityRuleAccess.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for SecurityRuleAccess. */ -public final class SecurityRuleAccess extends ExpandableStringEnum { - /** Static value Allow for SecurityRuleAccess. */ - public static final SecurityRuleAccess ALLOW = fromString("Allow"); - - /** Static value Deny for SecurityRuleAccess. */ - public static final SecurityRuleAccess DENY = fromString("Deny"); - - /** - * Creates or finds a SecurityRuleAccess from its string representation. - * - * @param name a name to look for. - * @return the corresponding SecurityRuleAccess. - */ - @JsonCreator - public static SecurityRuleAccess fromString(String name) { - return fromString(name, SecurityRuleAccess.class); - } - - /** @return known SecurityRuleAccess values. */ - public static Collection values() { - return values(SecurityRuleAccess.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/SecurityRuleAssociations.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/SecurityRuleAssociations.java deleted file mode 100644 index dfb77b6ff55d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/SecurityRuleAssociations.java +++ /dev/null @@ -1,144 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.SecurityRuleInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** All security rules associated with the network interface. */ -@Fluent -public final class SecurityRuleAssociations { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SecurityRuleAssociations.class); - - /* - * Network interface and its custom security rules. - */ - @JsonProperty(value = "networkInterfaceAssociation") - private NetworkInterfaceAssociation networkInterfaceAssociation; - - /* - * Network interface and its custom security rules. - */ - @JsonProperty(value = "subnetAssociation") - private SubnetAssociation subnetAssociation; - - /* - * Collection of default security rules of the network security group. - */ - @JsonProperty(value = "defaultSecurityRules") - private List defaultSecurityRules; - - /* - * Collection of effective security rules. - */ - @JsonProperty(value = "effectiveSecurityRules") - private List effectiveSecurityRules; - - /** - * Get the networkInterfaceAssociation property: Network interface and its custom security rules. - * - * @return the networkInterfaceAssociation value. - */ - public NetworkInterfaceAssociation networkInterfaceAssociation() { - return this.networkInterfaceAssociation; - } - - /** - * Set the networkInterfaceAssociation property: Network interface and its custom security rules. - * - * @param networkInterfaceAssociation the networkInterfaceAssociation value to set. - * @return the SecurityRuleAssociations object itself. - */ - public SecurityRuleAssociations withNetworkInterfaceAssociation( - NetworkInterfaceAssociation networkInterfaceAssociation) { - this.networkInterfaceAssociation = networkInterfaceAssociation; - return this; - } - - /** - * Get the subnetAssociation property: Network interface and its custom security rules. - * - * @return the subnetAssociation value. - */ - public SubnetAssociation subnetAssociation() { - return this.subnetAssociation; - } - - /** - * Set the subnetAssociation property: Network interface and its custom security rules. - * - * @param subnetAssociation the subnetAssociation value to set. - * @return the SecurityRuleAssociations object itself. - */ - public SecurityRuleAssociations withSubnetAssociation(SubnetAssociation subnetAssociation) { - this.subnetAssociation = subnetAssociation; - return this; - } - - /** - * Get the defaultSecurityRules property: Collection of default security rules of the network security group. - * - * @return the defaultSecurityRules value. - */ - public List defaultSecurityRules() { - return this.defaultSecurityRules; - } - - /** - * Set the defaultSecurityRules property: Collection of default security rules of the network security group. - * - * @param defaultSecurityRules the defaultSecurityRules value to set. - * @return the SecurityRuleAssociations object itself. - */ - public SecurityRuleAssociations withDefaultSecurityRules(List defaultSecurityRules) { - this.defaultSecurityRules = defaultSecurityRules; - return this; - } - - /** - * Get the effectiveSecurityRules property: Collection of effective security rules. - * - * @return the effectiveSecurityRules value. - */ - public List effectiveSecurityRules() { - return this.effectiveSecurityRules; - } - - /** - * Set the effectiveSecurityRules property: Collection of effective security rules. - * - * @param effectiveSecurityRules the effectiveSecurityRules value to set. - * @return the SecurityRuleAssociations object itself. - */ - public SecurityRuleAssociations withEffectiveSecurityRules( - List effectiveSecurityRules) { - this.effectiveSecurityRules = effectiveSecurityRules; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (networkInterfaceAssociation() != null) { - networkInterfaceAssociation().validate(); - } - if (subnetAssociation() != null) { - subnetAssociation().validate(); - } - if (defaultSecurityRules() != null) { - defaultSecurityRules().forEach(e -> e.validate()); - } - if (effectiveSecurityRules() != null) { - effectiveSecurityRules().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/SecurityRuleDirection.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/SecurityRuleDirection.java deleted file mode 100644 index 1957b600e72e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/SecurityRuleDirection.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for SecurityRuleDirection. */ -public final class SecurityRuleDirection extends ExpandableStringEnum { - /** Static value Inbound for SecurityRuleDirection. */ - public static final SecurityRuleDirection INBOUND = fromString("Inbound"); - - /** Static value Outbound for SecurityRuleDirection. */ - public static final SecurityRuleDirection OUTBOUND = fromString("Outbound"); - - /** - * Creates or finds a SecurityRuleDirection from its string representation. - * - * @param name a name to look for. - * @return the corresponding SecurityRuleDirection. - */ - @JsonCreator - public static SecurityRuleDirection fromString(String name) { - return fromString(name, SecurityRuleDirection.class); - } - - /** @return known SecurityRuleDirection values. */ - public static Collection values() { - return values(SecurityRuleDirection.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/SecurityRuleListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/SecurityRuleListResult.java deleted file mode 100644 index f839a910ff4e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/SecurityRuleListResult.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.SecurityRuleInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** - * Response for ListSecurityRule API service call. Retrieves all security rules that belongs to a network security - * group. - */ -@Fluent -public final class SecurityRuleListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SecurityRuleListResult.class); - - /* - * The security rules in a network security group. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to get the next set of results. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: The security rules in a network security group. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The security rules in a network security group. - * - * @param value the value value to set. - * @return the SecurityRuleListResult object itself. - */ - public SecurityRuleListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to get the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The URL to get the next set of results. - * - * @param nextLink the nextLink value to set. - * @return the SecurityRuleListResult object itself. - */ - public SecurityRuleListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/SecurityRuleProtocol.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/SecurityRuleProtocol.java deleted file mode 100644 index 8d61cbaf1dc5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/SecurityRuleProtocol.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for SecurityRuleProtocol. */ -public final class SecurityRuleProtocol extends ExpandableStringEnum { - /** Static value Tcp for SecurityRuleProtocol. */ - public static final SecurityRuleProtocol TCP = fromString("Tcp"); - - /** Static value Udp for SecurityRuleProtocol. */ - public static final SecurityRuleProtocol UDP = fromString("Udp"); - - /** Static value * for SecurityRuleProtocol. */ - public static final SecurityRuleProtocol ASTERISK = fromString("*"); - - /** - * Creates or finds a SecurityRuleProtocol from its string representation. - * - * @param name a name to look for. - * @return the corresponding SecurityRuleProtocol. - */ - @JsonCreator - public static SecurityRuleProtocol fromString(String name) { - return fromString(name, SecurityRuleProtocol.class); - } - - /** @return known SecurityRuleProtocol values. */ - public static Collection values() { - return values(SecurityRuleProtocol.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ServiceAssociationLink.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ServiceAssociationLink.java deleted file mode 100644 index 4de2f87fbc1e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ServiceAssociationLink.java +++ /dev/null @@ -1,150 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.ServiceAssociationLinkPropertiesFormat; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** ServiceAssociationLink resource. */ -@Fluent -public final class ServiceAssociationLink extends SubResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceAssociationLink.class); - - /* - * Resource navigation link properties format. - */ - @JsonProperty(value = "properties") - private ServiceAssociationLinkPropertiesFormat innerProperties; - - /* - * Name of the resource that is unique within a resource group. This name - * can be used to access the resource. - */ - @JsonProperty(value = "name") - private String name; - - /* - * A unique read-only string that changes whenever the resource is updated. - */ - @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) - private String etag; - - /** - * Get the innerProperties property: Resource navigation link properties format. - * - * @return the innerProperties value. - */ - private ServiceAssociationLinkPropertiesFormat innerProperties() { - return this.innerProperties; - } - - /** - * Get the name property: Name of the resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Name of the resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @param name the name value to set. - * @return the ServiceAssociationLink object itself. - */ - public ServiceAssociationLink withName(String name) { - this.name = name; - return this; - } - - /** - * Get the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** {@inheritDoc} */ - @Override - public ServiceAssociationLink withId(String id) { - super.withId(id); - return this; - } - - /** - * Get the linkedResourceType property: Resource type of the linked resource. - * - * @return the linkedResourceType value. - */ - public String linkedResourceType() { - return this.innerProperties() == null ? null : this.innerProperties().linkedResourceType(); - } - - /** - * Set the linkedResourceType property: Resource type of the linked resource. - * - * @param linkedResourceType the linkedResourceType value to set. - * @return the ServiceAssociationLink object itself. - */ - public ServiceAssociationLink withLinkedResourceType(String linkedResourceType) { - if (this.innerProperties() == null) { - this.innerProperties = new ServiceAssociationLinkPropertiesFormat(); - } - this.innerProperties().withLinkedResourceType(linkedResourceType); - return this; - } - - /** - * Get the link property: Link to the external resource. - * - * @return the link value. - */ - public String link() { - return this.innerProperties() == null ? null : this.innerProperties().link(); - } - - /** - * Set the link property: Link to the external resource. - * - * @param link the link value to set. - * @return the ServiceAssociationLink object itself. - */ - public ServiceAssociationLink withLink(String link) { - if (this.innerProperties() == null) { - this.innerProperties = new ServiceAssociationLinkPropertiesFormat(); - } - this.innerProperties().withLink(link); - return this; - } - - /** - * Get the provisioningState property: Provisioning state of the ServiceAssociationLink resource. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ServiceEndpointPolicyDefinitionListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ServiceEndpointPolicyDefinitionListResult.java deleted file mode 100644 index f39dcb95ad2f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ServiceEndpointPolicyDefinitionListResult.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.ServiceEndpointPolicyDefinitionInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** - * Response for ListServiceEndpointPolicyDefinition API service call. Retrieves all service endpoint policy definition - * that belongs to a service endpoint policy. - */ -@Fluent -public final class ServiceEndpointPolicyDefinitionListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceEndpointPolicyDefinitionListResult.class); - - /* - * The service endpoint policy definition in a service endpoint policy. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to get the next set of results. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: The service endpoint policy definition in a service endpoint policy. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The service endpoint policy definition in a service endpoint policy. - * - * @param value the value value to set. - * @return the ServiceEndpointPolicyDefinitionListResult object itself. - */ - public ServiceEndpointPolicyDefinitionListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to get the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The URL to get the next set of results. - * - * @param nextLink the nextLink value to set. - * @return the ServiceEndpointPolicyDefinitionListResult object itself. - */ - public ServiceEndpointPolicyDefinitionListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ServiceEndpointPolicyListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ServiceEndpointPolicyListResult.java deleted file mode 100644 index 06e7200fe06b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ServiceEndpointPolicyListResult.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.ServiceEndpointPolicyInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Response for ListServiceEndpointPolicies API service call. */ -@Fluent -public final class ServiceEndpointPolicyListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceEndpointPolicyListResult.class); - - /* - * A list of ServiceEndpointPolicy resources. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to get the next set of results. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: A list of ServiceEndpointPolicy resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: A list of ServiceEndpointPolicy resources. - * - * @param value the value value to set. - * @return the ServiceEndpointPolicyListResult object itself. - */ - public ServiceEndpointPolicyListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to get the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ServiceEndpointPropertiesFormat.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ServiceEndpointPropertiesFormat.java deleted file mode 100644 index 2388f6537773..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ServiceEndpointPropertiesFormat.java +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The service endpoint properties. */ -@Fluent -public final class ServiceEndpointPropertiesFormat { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceEndpointPropertiesFormat.class); - - /* - * The type of the endpoint service. - */ - @JsonProperty(value = "service") - private String service; - - /* - * A list of locations. - */ - @JsonProperty(value = "locations") - private List locations; - - /* - * The provisioning state of the resource. - */ - @JsonProperty(value = "provisioningState") - private String provisioningState; - - /** - * Get the service property: The type of the endpoint service. - * - * @return the service value. - */ - public String service() { - return this.service; - } - - /** - * Set the service property: The type of the endpoint service. - * - * @param service the service value to set. - * @return the ServiceEndpointPropertiesFormat object itself. - */ - public ServiceEndpointPropertiesFormat withService(String service) { - this.service = service; - return this; - } - - /** - * Get the locations property: A list of locations. - * - * @return the locations value. - */ - public List locations() { - return this.locations; - } - - /** - * Set the locations property: A list of locations. - * - * @param locations the locations value to set. - * @return the ServiceEndpointPropertiesFormat object itself. - */ - public ServiceEndpointPropertiesFormat withLocations(List locations) { - this.locations = locations; - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the resource. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Set the provisioningState property: The provisioning state of the resource. - * - * @param provisioningState the provisioningState value to set. - * @return the ServiceEndpointPropertiesFormat object itself. - */ - public ServiceEndpointPropertiesFormat withProvisioningState(String provisioningState) { - this.provisioningState = provisioningState; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ServiceEndpointType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ServiceEndpointType.java deleted file mode 100644 index 7be6d0460416..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ServiceEndpointType.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ServiceEndpointType. */ -public final class ServiceEndpointType extends ExpandableStringEnum { - /** Static value Microsoft.Storage for ServiceEndpointType. */ - public static final ServiceEndpointType MICROSOFT_STORAGE = fromString("Microsoft.Storage"); - - /** Static value Microsoft.Sql for ServiceEndpointType. */ - public static final ServiceEndpointType MICROSOFT_SQL = fromString("Microsoft.Sql"); - - /** Static value Microsoft.AzureCosmosDB for ServiceEndpointType. */ - public static final ServiceEndpointType MICROSOFT_AZURECOSMOSDB = fromString("Microsoft.AzureCosmosDB"); - - /** Static value Microsoft.Web for ServiceEndpointType. */ - public static final ServiceEndpointType MICROSOFT_WEB = fromString("Microsoft.Web"); - - /** - * Creates or finds a ServiceEndpointType from its string representation. - * - * @param name a name to look for - * @return the corresponding ServiceEndpointType - */ - @JsonCreator - public static ServiceEndpointType fromString(String name) { - return fromString(name, ServiceEndpointType.class); - } - - /** @return known ServiceEndpointType values */ - public static Collection values() { - return values(ServiceEndpointType.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ServiceProviderProvisioningState.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ServiceProviderProvisioningState.java deleted file mode 100644 index d3f2d70f00a5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/ServiceProviderProvisioningState.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ServiceProviderProvisioningState. */ -public final class ServiceProviderProvisioningState extends ExpandableStringEnum { - /** Static value NotProvisioned for ServiceProviderProvisioningState. */ - public static final ServiceProviderProvisioningState NOT_PROVISIONED = fromString("NotProvisioned"); - - /** Static value Provisioning for ServiceProviderProvisioningState. */ - public static final ServiceProviderProvisioningState PROVISIONING = fromString("Provisioning"); - - /** Static value Provisioned for ServiceProviderProvisioningState. */ - public static final ServiceProviderProvisioningState PROVISIONED = fromString("Provisioned"); - - /** Static value Deprovisioning for ServiceProviderProvisioningState. */ - public static final ServiceProviderProvisioningState DEPROVISIONING = fromString("Deprovisioning"); - - /** - * Creates or finds a ServiceProviderProvisioningState from its string representation. - * - * @param name a name to look for. - * @return the corresponding ServiceProviderProvisioningState. - */ - @JsonCreator - public static ServiceProviderProvisioningState fromString(String name) { - return fromString(name, ServiceProviderProvisioningState.class); - } - - /** @return known ServiceProviderProvisioningState values. */ - public static Collection values() { - return values(ServiceProviderProvisioningState.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/Severity.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/Severity.java deleted file mode 100644 index 7d12c920bb7a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/Severity.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for Severity. */ -public final class Severity extends ExpandableStringEnum { - /** Static value Error for Severity. */ - public static final Severity ERROR = fromString("Error"); - - /** Static value Warning for Severity. */ - public static final Severity WARNING = fromString("Warning"); - - /** - * Creates or finds a Severity from its string representation. - * - * @param name a name to look for. - * @return the corresponding Severity. - */ - @JsonCreator - public static Severity fromString(String name) { - return fromString(name, Severity.class); - } - - /** @return known Severity values. */ - public static Collection values() { - return values(Severity.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/Subnet.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/Subnet.java deleted file mode 100644 index 94fdbf5f5265..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/Subnet.java +++ /dev/null @@ -1,441 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.network.fluent.models.SubnetInner; -import com.azure.core.management.Region; -import com.azure.resourcemanager.resources.fluentcore.arm.models.ChildResource; -import com.azure.resourcemanager.resources.fluentcore.model.Attachable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.model.Settable; -import java.util.Collection; -import java.util.List; -import java.util.Map; -import java.util.Set; - -/** A client-side representation of a subnet of a virtual network. */ -@Fluent() -public interface Subnet extends HasInnerModel, ChildResource { - - /** - * @return network interface IP configurations that are associated with this subnet - *

    Note that this call may result in multiple calls to Azure to fetch all the referenced interfaces each time - * it is invoked. - */ - Collection listNetworkInterfaceIPConfigurations(); - - /** @return available private IP addresses within this network */ - Set listAvailablePrivateIPAddresses(); - - /** @return number of network interface IP configurations associated with this subnet */ - int networkInterfaceIPConfigurationCount(); - - /** @return the address space prefix, in CIDR notation, assigned to this subnet */ - String addressPrefix(); - - /** - * @return the network security group associated with this subnet, if any - *

    Note that this method will result in a call to Azure each time it is invoked. - */ - NetworkSecurityGroup getNetworkSecurityGroup(); - - /** @return the resource ID of the network security group associated with this subnet, if any */ - String networkSecurityGroupId(); - - /** - * @return the route table associated with this subnet, if any - *

    Note that this method will result in a call to Azure each time it is invoked. - */ - RouteTable getRouteTable(); - - /** @return the resource ID of the route table associated with this subnet, if any */ - String routeTableId(); - - /** @return the services that has access to the subnet. */ - Map> servicesWithAccess(); - - /** @return the ID of the subnet. */ - String id(); - - /** Grouping of subnet definition stages. */ - interface DefinitionStages { - /** - * The first stage of the subnet definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface Blank extends WithAddressPrefix { - } - - /** - * The stage of the subnet definition allowing to specify the address space for the subnet. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithAddressPrefix { - /** - * Specifies the IP address space of the subnet, within the address space of the network. - * - * @param cidr the IP address space prefix using the CIDR notation - * @return the next stage of the definition - */ - WithAttach withAddressPrefix(String cidr); - } - - /** - * The stage of the subnet definition allowing to specify the network security group to assign to the subnet. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithNetworkSecurityGroup { - /** - * Assigns an existing network security group to this subnet. - * - * @param resourceId the resource ID of the network security group - * @return the next stage of the definition - */ - WithAttach withExistingNetworkSecurityGroup(String resourceId); - - /** - * Assigns an existing network security group to this subnet. - * - * @param nsg the network security group to assign - * @return the next stage of the definition - */ - WithAttach withExistingNetworkSecurityGroup(NetworkSecurityGroup nsg); - } - - /** - * The stage of a subnet definition allowing to specify a route table to associate with the subnet. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithRouteTable { - /** - * Specifies an existing route table to associate with the subnet. - * - * @param routeTable an existing route table to associate - * @return the next stage of the definition - */ - WithAttach withExistingRouteTable(RouteTable routeTable); - - /** - * Specifies an existing route table to associate with the subnet. - * - * @param resourceId the resource ID of an existing route table - * @return the next stage of the definition - */ - WithAttach withExistingRouteTable(String resourceId); - } - - /** - * The stage of the subnet definition allowing to specify the subnet delegation. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithDelegation { - - /** - * Specifies a subnet delegation. - * - * @param serviceName the service name for the delegation - * @return the next stage of the definition - */ - WithAttach withDelegation(String serviceName); - } - - /** - * The stage of a subnet definition allowing to enable access from a service endpoint to the subnet. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithServiceEndpoint { - /** - * Specifies a service endpoint to enable access from. - * - * @param service the service type - * @return the next stage of the definition - */ - WithAttach withAccessFromService(ServiceEndpointType service); - } - - /** - * The final stage of the subnet definition. - * - *

    At this stage, any remaining optional settings can be specified, or the subnet definition can be attached - * to the parent virtual network definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithAttach - extends Attachable.InDefinition, - WithNetworkSecurityGroup, - WithRouteTable, - WithDelegation, - WithServiceEndpoint { - } - } - - /** - * The entirety of a Subnet definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithAddressPrefix, - DefinitionStages.WithAttach { - } - - /** Grouping of subnet update stages. */ - interface UpdateStages { - /** The stage of the subnet update allowing to change the address space for the subnet. */ - interface WithAddressPrefix { - /** - * Specifies the IP address space of the subnet, within the address space of the network. - * - * @param cidr the IP address space prefix using the CIDR notation - * @return the next stage - */ - Update withAddressPrefix(String cidr); - } - - /** The stage of the subnet update allowing to change the network security group to assign to the subnet. */ - interface WithNetworkSecurityGroup { - /** - * Assigns an existing network security group to this subnet. - * - * @param resourceId the resource ID of the network security group - * @return the next stage of the update - */ - Update withExistingNetworkSecurityGroup(String resourceId); - - /** - * Assigns an existing network security group to this subnet. - * - * @param nsg the network security group to assign - * @return the next stage of the update - */ - Update withExistingNetworkSecurityGroup(NetworkSecurityGroup nsg); - - /** - * Removes the association of this subnet with any network security group. - * - * @return the next stage of the update - */ - Update withoutNetworkSecurityGroup(); - } - - /** - * The stage of a subnet update allowing to specify a route table to associate with the subnet, or remove an - * existing association. - */ - interface WithRouteTable { - /** - * Specifies an existing route table to associate with the subnet. - * - * @param routeTable an existing route table to associate - * @return the next stage of the update - */ - Update withExistingRouteTable(RouteTable routeTable); - - /** - * Specifies an existing route table to associate with the subnet. - * - * @param resourceId the resource ID of an existing route table - * @return the next stage of the update - */ - Update withExistingRouteTable(String resourceId); - - /** - * Removes the association with a route table, if any. - * - * @return the next stage of the update - */ - Update withoutRouteTable(); - } - - /** The stage of the subnet definition allowing to specify the subnet delegation. */ - interface WithDelegation { - - /** - * Specifies a subnet delegation. - * - * @param serviceName the service name for the delegation - * @return the next stage of the definition - */ - Update withDelegation(String serviceName); - - /** - * Removes a subnet delegation. - * - * @param serviceName the service name for the delegation - * @return the next stage of the definition - */ - Update withoutDelegation(String serviceName); - } - - /** - * The stage of a subnet definition allowing to enable or disable access from a service endpoint to the subnet. - */ - interface WithServiceEndpoint { - /** - * Specifies a service endpoint to enable access from. - * - * @param service the service type - * @return the next stage of the definition - */ - Update withAccessFromService(ServiceEndpointType service); - - /** - * Specifies that existing access from a service endpoint should be removed. - * - * @param service the service type - * @return the next stage of the definition - */ - Update withoutAccessFromService(ServiceEndpointType service); - } - } - - /** The entirety of a subnet update as part of a network update. */ - interface Update - extends UpdateStages.WithAddressPrefix, - UpdateStages.WithNetworkSecurityGroup, - UpdateStages.WithRouteTable, - UpdateStages.WithDelegation, - UpdateStages.WithServiceEndpoint, - Settable { - } - - /** Grouping of subnet definition stages applicable as part of a virtual network update. */ - interface UpdateDefinitionStages { - /** - * The first stage of the subnet definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface Blank extends WithAddressPrefix { - } - - /** - * The stage of the subnet definition allowing to specify the address space for the subnet. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithAddressPrefix { - /** - * Specifies the IP address space of the subnet, within the address space of the network. - * - * @param cidr the IP address space prefix using the CIDR notation - * @return the next stage of the definition - */ - WithAttach withAddressPrefix(String cidr); - } - - /** - * The stage of the subnet definition allowing to specify the network security group to assign to the subnet. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithNetworkSecurityGroup { - /** - * Assigns an existing network security group to this subnet. - * - * @param resourceId the resource ID of the network security group - * @return the next stage of the definition - */ - WithAttach withExistingNetworkSecurityGroup(String resourceId); - - /** - * Assigns an existing network security group to this subnet. - * - * @param nsg the network security group to assign - * @return the next stage of the definition - */ - WithAttach withExistingNetworkSecurityGroup(NetworkSecurityGroup nsg); - } - - /** - * The stage of a subnet definition allowing to specify a route table to associate with the subnet. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithRouteTable { - /** - * Specifies an existing route table to associate with the subnet. - * - * @param routeTable an existing route table to associate - * @return the next stage of the definition - */ - WithAttach withExistingRouteTable(RouteTable routeTable); - - /** - * Specifies an existing route table to associate with the subnet. - * - * @param resourceId the resource ID of an existing route table - * @return the next stage of the definition - */ - WithAttach withExistingRouteTable(String resourceId); - } - - /** - * The stage of the subnet definition allowing to specify the subnet delegation. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithDelegation { - - /** - * Specifies a subnet delegation. - * - * @param serviceName the service name for the delegation - * @return the next stage of the definition - */ - WithAttach withDelegation(String serviceName); - } - - /** - * The stage of a subnet definition allowing to enable access from a service endpoint to the subnet. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithServiceEndpoint { - /** - * Specifies a service endpoint to enable access from. - * - * @param service the service type - * @return the next stage of the definition - */ - WithAttach withAccessFromService(ServiceEndpointType service); - } - - /** - * The final stage of the subnet definition. - * - *

    At this stage, any remaining optional settings can be specified, or the subnet definition can be attached - * to the parent virtual network definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface WithAttach - extends Attachable.InUpdate, - WithNetworkSecurityGroup, - WithRouteTable, - WithDelegation, - WithServiceEndpoint { - } - } - - /** - * The entirety of a subnet definition as part of a virtual network update. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface UpdateDefinition - extends UpdateDefinitionStages.Blank, - UpdateDefinitionStages.WithAddressPrefix, - UpdateDefinitionStages.WithNetworkSecurityGroup, - UpdateDefinitionStages.WithAttach { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/SubnetAssociation.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/SubnetAssociation.java deleted file mode 100644 index 2e6cf404a30b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/SubnetAssociation.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.SecurityRuleInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Network interface and its custom security rules. */ -@Fluent -public final class SubnetAssociation { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SubnetAssociation.class); - - /* - * Subnet ID. - */ - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) - private String id; - - /* - * Collection of custom security rules. - */ - @JsonProperty(value = "securityRules") - private List securityRules; - - /** - * Get the id property: Subnet ID. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Get the securityRules property: Collection of custom security rules. - * - * @return the securityRules value. - */ - public List securityRules() { - return this.securityRules; - } - - /** - * Set the securityRules property: Collection of custom security rules. - * - * @param securityRules the securityRules value to set. - * @return the SubnetAssociation object itself. - */ - public SubnetAssociation withSecurityRules(List securityRules) { - this.securityRules = securityRules; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (securityRules() != null) { - securityRules().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/SubnetListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/SubnetListResult.java deleted file mode 100644 index 01f0e189a6f8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/SubnetListResult.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.SubnetInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Response for ListSubnets API service callRetrieves all subnet that belongs to a virtual network. */ -@Fluent -public final class SubnetListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SubnetListResult.class); - - /* - * The subnets in a virtual network. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to get the next set of results. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: The subnets in a virtual network. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The subnets in a virtual network. - * - * @param value the value value to set. - * @return the SubnetListResult object itself. - */ - public SubnetListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to get the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The URL to get the next set of results. - * - * @param nextLink the nextLink value to set. - * @return the SubnetListResult object itself. - */ - public SubnetListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/TagsObject.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/TagsObject.java deleted file mode 100644 index 7ea8073a5c98..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/TagsObject.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** Tags object for patch operations. */ -@Fluent -public final class TagsObject { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TagsObject.class); - - /* - * Resource tags. - */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map tags; - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Resource tags. - * - * @param tags the tags value to set. - * @return the TagsObject object itself. - */ - public TagsObject withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/Topology.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/Topology.java deleted file mode 100644 index 1b80132e1403..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/Topology.java +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.network.fluent.models.TopologyInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasParent; -import com.azure.resourcemanager.resources.fluentcore.model.Executable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import java.time.OffsetDateTime; -import java.util.Map; - -/** An immutable client-side representation of an Azure Topology info object, associated with network watcher. */ -@Fluent -public interface Topology extends Executable, HasInnerModel, HasParent { - /** @return GUID representing the id */ - String id(); - - /** @return parameters used to query this topology */ - TopologyParameters topologyParameters(); - - /** @return the datetime when the topology was initially created for the resource group. */ - OffsetDateTime createdTime(); - - /** @return the datetime when the topology was last modified */ - OffsetDateTime lastModifiedTime(); - - /** @return The resources in this topology */ - Map resources(); - - /** The entirety of topology parameters definition. */ - interface Definition - extends DefinitionStages.WithTargetResourceGroup, - DefinitionStages.WithExecute, - DefinitionStages.WithExecuteAndSubnet { - } - - /** Grouping of topology definition stages. */ - interface DefinitionStages { - /** The first stage of topology parameters definition. */ - interface WithTargetResourceGroup { - /** - * Set the targetResourceId value. - * - * @param resourceGroupName the name of the target resource group to perform getTopology on - * @return the Topology object itself. - */ - DefinitionStages.WithExecute withTargetResourceGroup(String resourceGroupName); - } - - /** Sets the target virtual network. */ - interface WithTargetNetwork { - /** - * Set the target virtual network. - * - * @param networkId the target network id value to set - * @return the Topology object itself. - */ - DefinitionStages.WithExecuteAndSubnet withTargetNetwork(String networkId); - } - - /** Sets the target subnet. */ - interface WithTargetSubnet { - /** - * Set the subnetName value. - * - * @param subnetName the destinationIPAddress value to set - * @return the Topology object itself. - */ - DefinitionStages.WithExecute withTargetSubnet(String subnetName); - } - - /** - * The stage of the definition which contains all the minimum required inputs for execution, but also allows for - * any other optional settings to be specified. - */ - interface WithExecute extends Executable, DefinitionStages.WithTargetNetwork { - } - - /** - * The stage of the definition which contains all the minimum required inputs for execution, but also allows for - * any other optional settings to be specified. - */ - interface WithExecuteAndSubnet extends Executable, DefinitionStages.WithTargetSubnet { - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/TopologyAssociation.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/TopologyAssociation.java deleted file mode 100644 index a220a96542fc..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/TopologyAssociation.java +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Resources that have an association with the parent resource. */ -@Fluent -public final class TopologyAssociation { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TopologyAssociation.class); - - /* - * The name of the resource that is associated with the parent resource. - */ - @JsonProperty(value = "name") - private String name; - - /* - * The ID of the resource that is associated with the parent resource. - */ - @JsonProperty(value = "resourceId") - private String resourceId; - - /* - * The association type of the child resource to the parent resource. - */ - @JsonProperty(value = "associationType") - private AssociationType associationType; - - /** - * Get the name property: The name of the resource that is associated with the parent resource. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the resource that is associated with the parent resource. - * - * @param name the name value to set. - * @return the TopologyAssociation object itself. - */ - public TopologyAssociation withName(String name) { - this.name = name; - return this; - } - - /** - * Get the resourceId property: The ID of the resource that is associated with the parent resource. - * - * @return the resourceId value. - */ - public String resourceId() { - return this.resourceId; - } - - /** - * Set the resourceId property: The ID of the resource that is associated with the parent resource. - * - * @param resourceId the resourceId value to set. - * @return the TopologyAssociation object itself. - */ - public TopologyAssociation withResourceId(String resourceId) { - this.resourceId = resourceId; - return this; - } - - /** - * Get the associationType property: The association type of the child resource to the parent resource. - * - * @return the associationType value. - */ - public AssociationType associationType() { - return this.associationType; - } - - /** - * Set the associationType property: The association type of the child resource to the parent resource. - * - * @param associationType the associationType value to set. - * @return the TopologyAssociation object itself. - */ - public TopologyAssociation withAssociationType(AssociationType associationType) { - this.associationType = associationType; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/TopologyParameters.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/TopologyParameters.java deleted file mode 100644 index 975a41671750..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/TopologyParameters.java +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Parameters that define the representation of topology. */ -@Fluent -public final class TopologyParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TopologyParameters.class); - - /* - * The name of the target resource group to perform topology on. - */ - @JsonProperty(value = "targetResourceGroupName") - private String targetResourceGroupName; - - /* - * The reference of the Virtual Network resource. - */ - @JsonProperty(value = "targetVirtualNetwork") - private SubResource targetVirtualNetwork; - - /* - * The reference of the Subnet resource. - */ - @JsonProperty(value = "targetSubnet") - private SubResource targetSubnet; - - /** - * Get the targetResourceGroupName property: The name of the target resource group to perform topology on. - * - * @return the targetResourceGroupName value. - */ - public String targetResourceGroupName() { - return this.targetResourceGroupName; - } - - /** - * Set the targetResourceGroupName property: The name of the target resource group to perform topology on. - * - * @param targetResourceGroupName the targetResourceGroupName value to set. - * @return the TopologyParameters object itself. - */ - public TopologyParameters withTargetResourceGroupName(String targetResourceGroupName) { - this.targetResourceGroupName = targetResourceGroupName; - return this; - } - - /** - * Get the targetVirtualNetwork property: The reference of the Virtual Network resource. - * - * @return the targetVirtualNetwork value. - */ - public SubResource targetVirtualNetwork() { - return this.targetVirtualNetwork; - } - - /** - * Set the targetVirtualNetwork property: The reference of the Virtual Network resource. - * - * @param targetVirtualNetwork the targetVirtualNetwork value to set. - * @return the TopologyParameters object itself. - */ - public TopologyParameters withTargetVirtualNetwork(SubResource targetVirtualNetwork) { - this.targetVirtualNetwork = targetVirtualNetwork; - return this; - } - - /** - * Get the targetSubnet property: The reference of the Subnet resource. - * - * @return the targetSubnet value. - */ - public SubResource targetSubnet() { - return this.targetSubnet; - } - - /** - * Set the targetSubnet property: The reference of the Subnet resource. - * - * @param targetSubnet the targetSubnet value to set. - * @return the TopologyParameters object itself. - */ - public TopologyParameters withTargetSubnet(SubResource targetSubnet) { - this.targetSubnet = targetSubnet; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/TopologyResource.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/TopologyResource.java deleted file mode 100644 index 99bf3bc26534..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/TopologyResource.java +++ /dev/null @@ -1,135 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The network resource topology information for the given resource group. */ -@Fluent -public final class TopologyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TopologyResource.class); - - /* - * Name of the resource. - */ - @JsonProperty(value = "name") - private String name; - - /* - * ID of the resource. - */ - @JsonProperty(value = "id") - private String id; - - /* - * Resource location. - */ - @JsonProperty(value = "location") - private String location; - - /* - * Holds the associations the resource has with other resources in the - * resource group. - */ - @JsonProperty(value = "associations") - private List associations; - - /** - * Get the name property: Name of the resource. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Name of the resource. - * - * @param name the name value to set. - * @return the TopologyResource object itself. - */ - public TopologyResource withName(String name) { - this.name = name; - return this; - } - - /** - * Get the id property: ID of the resource. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: ID of the resource. - * - * @param id the id value to set. - * @return the TopologyResource object itself. - */ - public TopologyResource withId(String id) { - this.id = id; - return this; - } - - /** - * Get the location property: Resource location. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Set the location property: Resource location. - * - * @param location the location value to set. - * @return the TopologyResource object itself. - */ - public TopologyResource withLocation(String location) { - this.location = location; - return this; - } - - /** - * Get the associations property: Holds the associations the resource has with other resources in the resource - * group. - * - * @return the associations value. - */ - public List associations() { - return this.associations; - } - - /** - * Set the associations property: Holds the associations the resource has with other resources in the resource - * group. - * - * @param associations the associations value to set. - * @return the TopologyResource object itself. - */ - public TopologyResource withAssociations(List associations) { - this.associations = associations; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (associations() != null) { - associations().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/TrafficAnalyticsConfigurationProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/TrafficAnalyticsConfigurationProperties.java deleted file mode 100644 index a72cab164103..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/TrafficAnalyticsConfigurationProperties.java +++ /dev/null @@ -1,176 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Parameters that define the configuration of traffic analytics. */ -@Fluent -public final class TrafficAnalyticsConfigurationProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TrafficAnalyticsConfigurationProperties.class); - - /* - * Flag to enable/disable traffic analytics. - */ - @JsonProperty(value = "enabled", required = true) - private boolean enabled; - - /* - * The resource guid of the attached workspace - */ - @JsonProperty(value = "workspaceId", required = true) - private String workspaceId; - - /* - * The location of the attached workspace - */ - @JsonProperty(value = "workspaceRegion", required = true) - private String workspaceRegion; - - /* - * Resource Id of the attached workspace - */ - @JsonProperty(value = "workspaceResourceId", required = true) - private String workspaceResourceId; - - /* - * The interval in minutes which would decide how frequently TA service - * should do flow analytics - */ - @JsonProperty(value = "trafficAnalyticsInterval") - private Integer trafficAnalyticsInterval; - - /** - * Get the enabled property: Flag to enable/disable traffic analytics. - * - * @return the enabled value. - */ - public boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Flag to enable/disable traffic analytics. - * - * @param enabled the enabled value to set. - * @return the TrafficAnalyticsConfigurationProperties object itself. - */ - public TrafficAnalyticsConfigurationProperties withEnabled(boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the workspaceId property: The resource guid of the attached workspace. - * - * @return the workspaceId value. - */ - public String workspaceId() { - return this.workspaceId; - } - - /** - * Set the workspaceId property: The resource guid of the attached workspace. - * - * @param workspaceId the workspaceId value to set. - * @return the TrafficAnalyticsConfigurationProperties object itself. - */ - public TrafficAnalyticsConfigurationProperties withWorkspaceId(String workspaceId) { - this.workspaceId = workspaceId; - return this; - } - - /** - * Get the workspaceRegion property: The location of the attached workspace. - * - * @return the workspaceRegion value. - */ - public String workspaceRegion() { - return this.workspaceRegion; - } - - /** - * Set the workspaceRegion property: The location of the attached workspace. - * - * @param workspaceRegion the workspaceRegion value to set. - * @return the TrafficAnalyticsConfigurationProperties object itself. - */ - public TrafficAnalyticsConfigurationProperties withWorkspaceRegion(String workspaceRegion) { - this.workspaceRegion = workspaceRegion; - return this; - } - - /** - * Get the workspaceResourceId property: Resource Id of the attached workspace. - * - * @return the workspaceResourceId value. - */ - public String workspaceResourceId() { - return this.workspaceResourceId; - } - - /** - * Set the workspaceResourceId property: Resource Id of the attached workspace. - * - * @param workspaceResourceId the workspaceResourceId value to set. - * @return the TrafficAnalyticsConfigurationProperties object itself. - */ - public TrafficAnalyticsConfigurationProperties withWorkspaceResourceId(String workspaceResourceId) { - this.workspaceResourceId = workspaceResourceId; - return this; - } - - /** - * Get the trafficAnalyticsInterval property: The interval in minutes which would decide how frequently TA service - * should do flow analytics. - * - * @return the trafficAnalyticsInterval value. - */ - public Integer trafficAnalyticsInterval() { - return this.trafficAnalyticsInterval; - } - - /** - * Set the trafficAnalyticsInterval property: The interval in minutes which would decide how frequently TA service - * should do flow analytics. - * - * @param trafficAnalyticsInterval the trafficAnalyticsInterval value to set. - * @return the TrafficAnalyticsConfigurationProperties object itself. - */ - public TrafficAnalyticsConfigurationProperties withTrafficAnalyticsInterval(Integer trafficAnalyticsInterval) { - this.trafficAnalyticsInterval = trafficAnalyticsInterval; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (workspaceId() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property workspaceId in model TrafficAnalyticsConfigurationProperties")); - } - if (workspaceRegion() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property workspaceRegion in model TrafficAnalyticsConfigurationProperties")); - } - if (workspaceResourceId() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property workspaceResourceId in model" - + " TrafficAnalyticsConfigurationProperties")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/TrafficAnalyticsProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/TrafficAnalyticsProperties.java deleted file mode 100644 index 5f0c3e44b3af..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/TrafficAnalyticsProperties.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Parameters that define the configuration of traffic analytics. */ -@Fluent -public final class TrafficAnalyticsProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TrafficAnalyticsProperties.class); - - /* - * Parameters that define the configuration of traffic analytics. - */ - @JsonProperty(value = "networkWatcherFlowAnalyticsConfiguration", required = true) - private TrafficAnalyticsConfigurationProperties networkWatcherFlowAnalyticsConfiguration; - - /** - * Get the networkWatcherFlowAnalyticsConfiguration property: Parameters that define the configuration of traffic - * analytics. - * - * @return the networkWatcherFlowAnalyticsConfiguration value. - */ - public TrafficAnalyticsConfigurationProperties networkWatcherFlowAnalyticsConfiguration() { - return this.networkWatcherFlowAnalyticsConfiguration; - } - - /** - * Set the networkWatcherFlowAnalyticsConfiguration property: Parameters that define the configuration of traffic - * analytics. - * - * @param networkWatcherFlowAnalyticsConfiguration the networkWatcherFlowAnalyticsConfiguration value to set. - * @return the TrafficAnalyticsProperties object itself. - */ - public TrafficAnalyticsProperties withNetworkWatcherFlowAnalyticsConfiguration( - TrafficAnalyticsConfigurationProperties networkWatcherFlowAnalyticsConfiguration) { - this.networkWatcherFlowAnalyticsConfiguration = networkWatcherFlowAnalyticsConfiguration; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (networkWatcherFlowAnalyticsConfiguration() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property networkWatcherFlowAnalyticsConfiguration in model" - + " TrafficAnalyticsProperties")); - } else { - networkWatcherFlowAnalyticsConfiguration().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/TransportProtocol.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/TransportProtocol.java deleted file mode 100644 index 9061868047c6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/TransportProtocol.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for TransportProtocol. */ -public final class TransportProtocol extends ExpandableStringEnum { - /** Static value Udp for TransportProtocol. */ - public static final TransportProtocol UDP = fromString("Udp"); - - /** Static value Tcp for TransportProtocol. */ - public static final TransportProtocol TCP = fromString("Tcp"); - - /** Static value All for TransportProtocol. */ - public static final TransportProtocol ALL = fromString("All"); - - /** - * Creates or finds a TransportProtocol from its string representation. - * - * @param name a name to look for. - * @return the corresponding TransportProtocol. - */ - @JsonCreator - public static TransportProtocol fromString(String name) { - return fromString(name, TransportProtocol.class); - } - - /** @return known TransportProtocol values. */ - public static Collection values() { - return values(TransportProtocol.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/Troubleshooting.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/Troubleshooting.java deleted file mode 100644 index ac176c2c3a30..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/Troubleshooting.java +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasParent; -import com.azure.resourcemanager.resources.fluentcore.model.Executable; -import java.time.OffsetDateTime; -import java.util.List; - -/** - * A client-side representation allowing user to get troubleshooting information for virtual network gateway or virtual - * network gateway connection. - */ -@Fluent -public interface Troubleshooting extends Executable, HasParent { - /** - * Get the resource identifier of the target resource against which the action is to be performed. - * - * @return the targetResourceId value - */ - String targetResourceId(); - - /** @return id of the storage account where troubleshooting information was saved */ - String storageId(); - - /** @return the path to the blob to save the troubleshoot result in */ - String storagePath(); - - /** @return The start time of the troubleshooting */ - OffsetDateTime startTime(); - - /** @return the end time of the troubleshooting */ - OffsetDateTime endTime(); - - /** @return the result code of the troubleshooting */ - String code(); - - /** @return information from troubleshooting */ - List results(); - - /** The entirety of troubleshooting parameters definition. */ - interface Definition - extends DefinitionStages.WithTargetResource, - DefinitionStages.WithStorageAccount, - DefinitionStages.WithStoragePath, - DefinitionStages.WithExecute { - } - - /** Grouping of troubleshooting definition stages. */ - interface DefinitionStages { - /** The first stage of troubleshooting parameters definition. */ - interface WithTargetResource { - /** - * Set the targetResourceId value (virtual network gateway or virtual network gateway connecyion id). - * - * @param targetResourceId the targetResourceId value to set - * @return the next stage of definition - */ - WithStorageAccount withTargetResourceId(String targetResourceId); - } - - /** Sets the storage account to save the troubleshoot result. */ - interface WithStorageAccount { - /** - * Set the storageAccountId value. - * - * @param storageAccountId the ID for the storage account to save the troubleshoot result - * @return the next stage of definition. - */ - WithStoragePath withStorageAccount(String storageAccountId); - } - - /** Sets the path to the blob to save the troubleshoot result in. */ - interface WithStoragePath { - /** - * Specifies the storage path. - * - * @param storagePath the storage path - * @return the next stage of definition. - */ - WithExecute withStoragePath(String storagePath); - } - - /** - * The stage of the definition which contains all the minimum required inputs for execution, but also allows for - * any other optional settings to be specified. - */ - interface WithExecute extends Executable { - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/TroubleshootingDetails.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/TroubleshootingDetails.java deleted file mode 100644 index 1e24ddd74253..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/TroubleshootingDetails.java +++ /dev/null @@ -1,158 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Information gained from troubleshooting of specified resource. */ -@Fluent -public final class TroubleshootingDetails { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TroubleshootingDetails.class); - - /* - * The id of the get troubleshoot operation. - */ - @JsonProperty(value = "id") - private String id; - - /* - * Reason type of failure. - */ - @JsonProperty(value = "reasonType") - private String reasonType; - - /* - * A summary of troubleshooting. - */ - @JsonProperty(value = "summary") - private String summary; - - /* - * Details on troubleshooting results. - */ - @JsonProperty(value = "detail") - private String detail; - - /* - * List of recommended actions. - */ - @JsonProperty(value = "recommendedActions") - private List recommendedActions; - - /** - * Get the id property: The id of the get troubleshoot operation. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: The id of the get troubleshoot operation. - * - * @param id the id value to set. - * @return the TroubleshootingDetails object itself. - */ - public TroubleshootingDetails withId(String id) { - this.id = id; - return this; - } - - /** - * Get the reasonType property: Reason type of failure. - * - * @return the reasonType value. - */ - public String reasonType() { - return this.reasonType; - } - - /** - * Set the reasonType property: Reason type of failure. - * - * @param reasonType the reasonType value to set. - * @return the TroubleshootingDetails object itself. - */ - public TroubleshootingDetails withReasonType(String reasonType) { - this.reasonType = reasonType; - return this; - } - - /** - * Get the summary property: A summary of troubleshooting. - * - * @return the summary value. - */ - public String summary() { - return this.summary; - } - - /** - * Set the summary property: A summary of troubleshooting. - * - * @param summary the summary value to set. - * @return the TroubleshootingDetails object itself. - */ - public TroubleshootingDetails withSummary(String summary) { - this.summary = summary; - return this; - } - - /** - * Get the detail property: Details on troubleshooting results. - * - * @return the detail value. - */ - public String detail() { - return this.detail; - } - - /** - * Set the detail property: Details on troubleshooting results. - * - * @param detail the detail value to set. - * @return the TroubleshootingDetails object itself. - */ - public TroubleshootingDetails withDetail(String detail) { - this.detail = detail; - return this; - } - - /** - * Get the recommendedActions property: List of recommended actions. - * - * @return the recommendedActions value. - */ - public List recommendedActions() { - return this.recommendedActions; - } - - /** - * Set the recommendedActions property: List of recommended actions. - * - * @param recommendedActions the recommendedActions value to set. - * @return the TroubleshootingDetails object itself. - */ - public TroubleshootingDetails withRecommendedActions(List recommendedActions) { - this.recommendedActions = recommendedActions; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (recommendedActions() != null) { - recommendedActions().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/TroubleshootingParameters.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/TroubleshootingParameters.java deleted file mode 100644 index e9ea2b30ef4d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/TroubleshootingParameters.java +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.TroubleshootingProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Parameters that define the resource to troubleshoot. */ -@Fluent -public final class TroubleshootingParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TroubleshootingParameters.class); - - /* - * The target resource to troubleshoot. - */ - @JsonProperty(value = "targetResourceId", required = true) - private String targetResourceId; - - /* - * Storage location provided for troubleshoot. - */ - @JsonProperty(value = "properties", required = true) - private TroubleshootingProperties innerProperties = new TroubleshootingProperties(); - - /** - * Get the targetResourceId property: The target resource to troubleshoot. - * - * @return the targetResourceId value. - */ - public String targetResourceId() { - return this.targetResourceId; - } - - /** - * Set the targetResourceId property: The target resource to troubleshoot. - * - * @param targetResourceId the targetResourceId value to set. - * @return the TroubleshootingParameters object itself. - */ - public TroubleshootingParameters withTargetResourceId(String targetResourceId) { - this.targetResourceId = targetResourceId; - return this; - } - - /** - * Get the innerProperties property: Storage location provided for troubleshoot. - * - * @return the innerProperties value. - */ - private TroubleshootingProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the storageId property: The ID for the storage account to save the troubleshoot result. - * - * @return the storageId value. - */ - public String storageId() { - return this.innerProperties() == null ? null : this.innerProperties().storageId(); - } - - /** - * Set the storageId property: The ID for the storage account to save the troubleshoot result. - * - * @param storageId the storageId value to set. - * @return the TroubleshootingParameters object itself. - */ - public TroubleshootingParameters withStorageId(String storageId) { - if (this.innerProperties() == null) { - this.innerProperties = new TroubleshootingProperties(); - } - this.innerProperties().withStorageId(storageId); - return this; - } - - /** - * Get the storagePath property: The path to the blob to save the troubleshoot result in. - * - * @return the storagePath value. - */ - public String storagePath() { - return this.innerProperties() == null ? null : this.innerProperties().storagePath(); - } - - /** - * Set the storagePath property: The path to the blob to save the troubleshoot result in. - * - * @param storagePath the storagePath value to set. - * @return the TroubleshootingParameters object itself. - */ - public TroubleshootingParameters withStoragePath(String storagePath) { - if (this.innerProperties() == null) { - this.innerProperties = new TroubleshootingProperties(); - } - this.innerProperties().withStoragePath(storagePath); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (targetResourceId() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property targetResourceId in model TroubleshootingParameters")); - } - if (innerProperties() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property innerProperties in model TroubleshootingParameters")); - } else { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/TroubleshootingRecommendedActions.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/TroubleshootingRecommendedActions.java deleted file mode 100644 index 76b752cc338a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/TroubleshootingRecommendedActions.java +++ /dev/null @@ -1,130 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Recommended actions based on discovered issues. */ -@Fluent -public final class TroubleshootingRecommendedActions { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TroubleshootingRecommendedActions.class); - - /* - * ID of the recommended action. - */ - @JsonProperty(value = "actionId") - private String actionId; - - /* - * Description of recommended actions. - */ - @JsonProperty(value = "actionText") - private String actionText; - - /* - * The uri linking to a documentation for the recommended troubleshooting - * actions. - */ - @JsonProperty(value = "actionUri") - private String actionUri; - - /* - * The information from the URI for the recommended troubleshooting - * actions. - */ - @JsonProperty(value = "actionUriText") - private String actionUriText; - - /** - * Get the actionId property: ID of the recommended action. - * - * @return the actionId value. - */ - public String actionId() { - return this.actionId; - } - - /** - * Set the actionId property: ID of the recommended action. - * - * @param actionId the actionId value to set. - * @return the TroubleshootingRecommendedActions object itself. - */ - public TroubleshootingRecommendedActions withActionId(String actionId) { - this.actionId = actionId; - return this; - } - - /** - * Get the actionText property: Description of recommended actions. - * - * @return the actionText value. - */ - public String actionText() { - return this.actionText; - } - - /** - * Set the actionText property: Description of recommended actions. - * - * @param actionText the actionText value to set. - * @return the TroubleshootingRecommendedActions object itself. - */ - public TroubleshootingRecommendedActions withActionText(String actionText) { - this.actionText = actionText; - return this; - } - - /** - * Get the actionUri property: The uri linking to a documentation for the recommended troubleshooting actions. - * - * @return the actionUri value. - */ - public String actionUri() { - return this.actionUri; - } - - /** - * Set the actionUri property: The uri linking to a documentation for the recommended troubleshooting actions. - * - * @param actionUri the actionUri value to set. - * @return the TroubleshootingRecommendedActions object itself. - */ - public TroubleshootingRecommendedActions withActionUri(String actionUri) { - this.actionUri = actionUri; - return this; - } - - /** - * Get the actionUriText property: The information from the URI for the recommended troubleshooting actions. - * - * @return the actionUriText value. - */ - public String actionUriText() { - return this.actionUriText; - } - - /** - * Set the actionUriText property: The information from the URI for the recommended troubleshooting actions. - * - * @param actionUriText the actionUriText value to set. - * @return the TroubleshootingRecommendedActions object itself. - */ - public TroubleshootingRecommendedActions withActionUriText(String actionUriText) { - this.actionUriText = actionUriText; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/TunnelConnectionHealth.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/TunnelConnectionHealth.java deleted file mode 100644 index e0e36c309d08..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/TunnelConnectionHealth.java +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** VirtualNetworkGatewayConnection properties. */ -@Immutable -public final class TunnelConnectionHealth { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TunnelConnectionHealth.class); - - /* - * Tunnel name. - */ - @JsonProperty(value = "tunnel", access = JsonProperty.Access.WRITE_ONLY) - private String tunnel; - - /* - * Virtual network Gateway connection status - */ - @JsonProperty(value = "connectionStatus", access = JsonProperty.Access.WRITE_ONLY) - private VirtualNetworkGatewayConnectionStatus connectionStatus; - - /* - * The Ingress Bytes Transferred in this connection - */ - @JsonProperty(value = "ingressBytesTransferred", access = JsonProperty.Access.WRITE_ONLY) - private Long ingressBytesTransferred; - - /* - * The Egress Bytes Transferred in this connection - */ - @JsonProperty(value = "egressBytesTransferred", access = JsonProperty.Access.WRITE_ONLY) - private Long egressBytesTransferred; - - /* - * The time at which connection was established in Utc format. - */ - @JsonProperty(value = "lastConnectionEstablishedUtcTime", access = JsonProperty.Access.WRITE_ONLY) - private String lastConnectionEstablishedUtcTime; - - /** - * Get the tunnel property: Tunnel name. - * - * @return the tunnel value. - */ - public String tunnel() { - return this.tunnel; - } - - /** - * Get the connectionStatus property: Virtual network Gateway connection status. - * - * @return the connectionStatus value. - */ - public VirtualNetworkGatewayConnectionStatus connectionStatus() { - return this.connectionStatus; - } - - /** - * Get the ingressBytesTransferred property: The Ingress Bytes Transferred in this connection. - * - * @return the ingressBytesTransferred value. - */ - public Long ingressBytesTransferred() { - return this.ingressBytesTransferred; - } - - /** - * Get the egressBytesTransferred property: The Egress Bytes Transferred in this connection. - * - * @return the egressBytesTransferred value. - */ - public Long egressBytesTransferred() { - return this.egressBytesTransferred; - } - - /** - * Get the lastConnectionEstablishedUtcTime property: The time at which connection was established in Utc format. - * - * @return the lastConnectionEstablishedUtcTime value. - */ - public String lastConnectionEstablishedUtcTime() { - return this.lastConnectionEstablishedUtcTime; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/UpdatableWithTags.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/UpdatableWithTags.java deleted file mode 100644 index 627ccadfacbf..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/UpdatableWithTags.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.network.models; - -import java.util.Map; - -/** - * Interface for a resource which tags can be updated as a separate operation. - * - * @param the fluent type of the resource - */ -public interface UpdatableWithTags { - /** - * Begins a tags update for a resource. - * - *

    This is the beginning of the builder pattern used to update tags for a resources in Azure. The final method - * completing the definition and starting the actual resource update process in Azure is {@link - * AppliableWithTags#applyTags()}. - * - * @return the stage of new resource update - */ - UpdateWithTags updateTags(); - - /** - * An update allowing tags to be modified for the resource. - * - * @param the type of the resource being update - */ - interface UpdateWithTags { - /** - * Specifies tags for the resource as a {@link Map}. - * - * @param tags a {@link Map} of tags - * @return the next stage of the resource update - */ - AppliableWithTags withTags(Map tags); - - /** - * Adds a tag to the resource. - * - * @param key the key for the tag - * @param value the value for the tag - * @return the next stage of the resource update - */ - AppliableWithTags withTag(String key, String value); - - /** - * Removes a tag from the resource. - * - * @param key the key of the tag to remove - * @return the next stage of the resource update - */ - AppliableWithTags withoutTag(String key); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/UsageName.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/UsageName.java deleted file mode 100644 index 333b8a15fd80..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/UsageName.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The usage names. */ -@Fluent -public final class UsageName { - @JsonIgnore private final ClientLogger logger = new ClientLogger(UsageName.class); - - /* - * A string describing the resource name. - */ - @JsonProperty(value = "value") - private String value; - - /* - * A localized string describing the resource name. - */ - @JsonProperty(value = "localizedValue") - private String localizedValue; - - /** - * Get the value property: A string describing the resource name. - * - * @return the value value. - */ - public String value() { - return this.value; - } - - /** - * Set the value property: A string describing the resource name. - * - * @param value the value value to set. - * @return the UsageName object itself. - */ - public UsageName withValue(String value) { - this.value = value; - return this; - } - - /** - * Get the localizedValue property: A localized string describing the resource name. - * - * @return the localizedValue value. - */ - public String localizedValue() { - return this.localizedValue; - } - - /** - * Set the localizedValue property: A localized string describing the resource name. - * - * @param localizedValue the localizedValue value to set. - * @return the UsageName object itself. - */ - public UsageName withLocalizedValue(String localizedValue) { - this.localizedValue = localizedValue; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/UsageUnit.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/UsageUnit.java deleted file mode 100644 index 66d59e6a65d5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/UsageUnit.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for UsageUnit. */ -public final class UsageUnit extends ExpandableStringEnum { - /** Static value Count for UsageUnit. */ - public static final UsageUnit COUNT = fromString("Count"); - - /** - * Creates or finds a UsageUnit from its string representation. - * - * @param name a name to look for. - * @return the corresponding UsageUnit. - */ - @JsonCreator - public static UsageUnit fromString(String name) { - return fromString(name, UsageUnit.class); - } - - /** @return known UsageUnit values. */ - public static Collection values() { - return values(UsageUnit.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/UsagesListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/UsagesListResult.java deleted file mode 100644 index ecad3f9d02c1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/UsagesListResult.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.UsageInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The list usages operation response. */ -@Fluent -public final class UsagesListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(UsagesListResult.class); - - /* - * The list network resource usages. - */ - @JsonProperty(value = "value") - private List value; - - /* - * URL to get the next set of results. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: The list network resource usages. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The list network resource usages. - * - * @param value the value value to set. - * @return the UsagesListResult object itself. - */ - public UsagesListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: URL to get the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: URL to get the next set of results. - * - * @param nextLink the nextLink value to set. - * @return the UsagesListResult object itself. - */ - public UsagesListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VerbosityLevel.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VerbosityLevel.java deleted file mode 100644 index 6a7565c20f7b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VerbosityLevel.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for VerbosityLevel. */ -public final class VerbosityLevel extends ExpandableStringEnum { - /** Static value Normal for VerbosityLevel. */ - public static final VerbosityLevel NORMAL = fromString("Normal"); - - /** Static value Minimum for VerbosityLevel. */ - public static final VerbosityLevel MINIMUM = fromString("Minimum"); - - /** Static value Full for VerbosityLevel. */ - public static final VerbosityLevel FULL = fromString("Full"); - - /** - * Creates or finds a VerbosityLevel from its string representation. - * - * @param name a name to look for. - * @return the corresponding VerbosityLevel. - */ - @JsonCreator - public static VerbosityLevel fromString(String name) { - return fromString(name, VerbosityLevel.class); - } - - /** @return known VerbosityLevel values. */ - public static Collection values() { - return values(VerbosityLevel.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VerificationIPFlow.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VerificationIPFlow.java deleted file mode 100644 index dd38ee6954cf..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VerificationIPFlow.java +++ /dev/null @@ -1,167 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasParent; -import com.azure.resourcemanager.resources.fluentcore.model.Executable; - -/** - * A client-side representation allowing to verify IP packet flow from specific VM based on direction, protocol, local - * IP, remote IP, local port and remote port. - */ -@Fluent -public interface VerificationIPFlow extends Executable, HasParent { - /** - * Get the access value. Indicates whether the traffic is allowed or denied. - * - * @return the access value - */ - Access access(); - - /** - * Get the ruleName value. If input is not matched against any security rule, it is not displayed. - * - * @return the ruleName value - */ - String ruleName(); - - /** The entirety of verification ip flow parameters definition. */ - interface Definition - extends DefinitionStages.WithTargetResource, - DefinitionStages.WithDirection, - DefinitionStages.WithProtocol, - DefinitionStages.WithLocalIP, - DefinitionStages.WithRemoteIP, - DefinitionStages.WithLocalPort, - DefinitionStages.WithRemotePort, - DefinitionStages.WithExecute { - } - - /** Grouping of verification ip flow parameters. */ - interface DefinitionStages { - /** The ID of the target resource to perform next-hop on. */ - interface WithTargetResource { - /** - * Set the targetResourceId value. - * - * @param vmId the targetResourceId value to set - * @return the next stage of the definition. - */ - WithDirection withTargetResourceId(String vmId); - } - - /** The direction of the packet represented as a 5-tuple. */ - interface WithDirection { - /** - * Set the direction value. - * - * @param direction the direction value to set - * @return the next stage of the definition. - */ - WithProtocol withDirection(Direction direction); - - /** - * Set inbound direction. - * - * @return the next stage of the definition. - */ - WithProtocol inbound(); - - /** - * Set outbound direction. - * - * @return the next stage of the definition. - */ - WithProtocol outbound(); - } - - /** Protocol to be verified on. Possible values include: 'TCP', 'UDP'. */ - interface WithProtocol extends HasProtocol.DefinitionStages.WithProtocol { - /** - * Set TCP protocol. - * - * @return the next stage of the definition - */ - WithLocalIP withTCP(); - - /** - * Set UDP protocol. - * - * @return the next stage of the definition - */ - WithLocalIP withUDP(); - } - - /** The local IP address. Acceptable values are valid IPv4 addresses. */ - interface WithLocalIP { - /** - * Set the localIPAddress value. - * - * @param localIPAddress the localIPAddress value to set - * @return the next stage of the definition. - */ - WithRemoteIP withLocalIPAddress(String localIPAddress); - } - - /** The remote IP address. Acceptable values are valid IPv4 addresses. */ - interface WithRemoteIP { - /** - * Set the remoteIPAddress value. - * - * @param remoteIPAddress the remoteIPAddress value to set - * @return the next stage of the definition. - */ - WithLocalPort withRemoteIPAddress(String remoteIPAddress); - } - - /** - * The local port. Acceptable values are a single integer in the range (0-65535). Support for * for the source - * port, which depends on the direction. - */ - interface WithLocalPort { - /** - * Set the localPort value. - * - * @param localPort the localPort value to set - * @return the next stage of the definition. - */ - WithRemotePort withLocalPort(String localPort); - } - - /** - * The remote port. Acceptable values are a single integer in the range (0-65535). Support for * for the source - * port, which depends on the direction. - */ - interface WithRemotePort { - /** - * Set the remotePort value. - * - * @param remotePort the remotePort value to set - * @return the next stage of the definition. - */ - WithExecute withRemotePort(String remotePort); - } - - /** - * The NIC ID. (If VM has multiple NICs and IP forwarding is enabled on any of them, then this parameter must be - * specified. Otherwise optional). - */ - interface WithNetworkInterface { - /** - * Set the targetNetworkInterfaceId value. - * - * @param targetNetworkInterfaceId the targetNetworkInterfaceId value to set - * @return the next stage of the definition. - */ - VerificationIPFlow withTargetNetworkInterfaceId(String targetNetworkInterfaceId); - } - - /** - * The stage of the definition which contains all the minimum required parameters to execute an action, but also - * allows for any other optional settings to be specified. - */ - interface WithExecute extends Executable, WithNetworkInterface { - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VerificationIpFlowParameters.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VerificationIpFlowParameters.java deleted file mode 100644 index d5ba92367ea0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VerificationIpFlowParameters.java +++ /dev/null @@ -1,285 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Parameters that define the IP flow to be verified. */ -@Fluent -public final class VerificationIpFlowParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VerificationIpFlowParameters.class); - - /* - * The ID of the target resource to perform next-hop on. - */ - @JsonProperty(value = "targetResourceId", required = true) - private String targetResourceId; - - /* - * The direction of the packet represented as a 5-tuple. - */ - @JsonProperty(value = "direction", required = true) - private Direction direction; - - /* - * Protocol to be verified on. - */ - @JsonProperty(value = "protocol", required = true) - private IpFlowProtocol protocol; - - /* - * The local port. Acceptable values are a single integer in the range - * (0-65535). Support for * for the source port, which depends on the - * direction. - */ - @JsonProperty(value = "localPort", required = true) - private String localPort; - - /* - * The remote port. Acceptable values are a single integer in the range - * (0-65535). Support for * for the source port, which depends on the - * direction. - */ - @JsonProperty(value = "remotePort", required = true) - private String remotePort; - - /* - * The local IP address. Acceptable values are valid IPv4 addresses. - */ - @JsonProperty(value = "localIPAddress", required = true) - private String localIpAddress; - - /* - * The remote IP address. Acceptable values are valid IPv4 addresses. - */ - @JsonProperty(value = "remoteIPAddress", required = true) - private String remoteIpAddress; - - /* - * The NIC ID. (If VM has multiple NICs and IP forwarding is enabled on any - * of them, then this parameter must be specified. Otherwise optional). - */ - @JsonProperty(value = "targetNicResourceId") - private String targetNicResourceId; - - /** - * Get the targetResourceId property: The ID of the target resource to perform next-hop on. - * - * @return the targetResourceId value. - */ - public String targetResourceId() { - return this.targetResourceId; - } - - /** - * Set the targetResourceId property: The ID of the target resource to perform next-hop on. - * - * @param targetResourceId the targetResourceId value to set. - * @return the VerificationIpFlowParameters object itself. - */ - public VerificationIpFlowParameters withTargetResourceId(String targetResourceId) { - this.targetResourceId = targetResourceId; - return this; - } - - /** - * Get the direction property: The direction of the packet represented as a 5-tuple. - * - * @return the direction value. - */ - public Direction direction() { - return this.direction; - } - - /** - * Set the direction property: The direction of the packet represented as a 5-tuple. - * - * @param direction the direction value to set. - * @return the VerificationIpFlowParameters object itself. - */ - public VerificationIpFlowParameters withDirection(Direction direction) { - this.direction = direction; - return this; - } - - /** - * Get the protocol property: Protocol to be verified on. - * - * @return the protocol value. - */ - public IpFlowProtocol protocol() { - return this.protocol; - } - - /** - * Set the protocol property: Protocol to be verified on. - * - * @param protocol the protocol value to set. - * @return the VerificationIpFlowParameters object itself. - */ - public VerificationIpFlowParameters withProtocol(IpFlowProtocol protocol) { - this.protocol = protocol; - return this; - } - - /** - * Get the localPort property: The local port. Acceptable values are a single integer in the range (0-65535). - * Support for * for the source port, which depends on the direction. - * - * @return the localPort value. - */ - public String localPort() { - return this.localPort; - } - - /** - * Set the localPort property: The local port. Acceptable values are a single integer in the range (0-65535). - * Support for * for the source port, which depends on the direction. - * - * @param localPort the localPort value to set. - * @return the VerificationIpFlowParameters object itself. - */ - public VerificationIpFlowParameters withLocalPort(String localPort) { - this.localPort = localPort; - return this; - } - - /** - * Get the remotePort property: The remote port. Acceptable values are a single integer in the range (0-65535). - * Support for * for the source port, which depends on the direction. - * - * @return the remotePort value. - */ - public String remotePort() { - return this.remotePort; - } - - /** - * Set the remotePort property: The remote port. Acceptable values are a single integer in the range (0-65535). - * Support for * for the source port, which depends on the direction. - * - * @param remotePort the remotePort value to set. - * @return the VerificationIpFlowParameters object itself. - */ - public VerificationIpFlowParameters withRemotePort(String remotePort) { - this.remotePort = remotePort; - return this; - } - - /** - * Get the localIpAddress property: The local IP address. Acceptable values are valid IPv4 addresses. - * - * @return the localIpAddress value. - */ - public String localIpAddress() { - return this.localIpAddress; - } - - /** - * Set the localIpAddress property: The local IP address. Acceptable values are valid IPv4 addresses. - * - * @param localIpAddress the localIpAddress value to set. - * @return the VerificationIpFlowParameters object itself. - */ - public VerificationIpFlowParameters withLocalIpAddress(String localIpAddress) { - this.localIpAddress = localIpAddress; - return this; - } - - /** - * Get the remoteIpAddress property: The remote IP address. Acceptable values are valid IPv4 addresses. - * - * @return the remoteIpAddress value. - */ - public String remoteIpAddress() { - return this.remoteIpAddress; - } - - /** - * Set the remoteIpAddress property: The remote IP address. Acceptable values are valid IPv4 addresses. - * - * @param remoteIpAddress the remoteIpAddress value to set. - * @return the VerificationIpFlowParameters object itself. - */ - public VerificationIpFlowParameters withRemoteIpAddress(String remoteIpAddress) { - this.remoteIpAddress = remoteIpAddress; - return this; - } - - /** - * Get the targetNicResourceId property: The NIC ID. (If VM has multiple NICs and IP forwarding is enabled on any of - * them, then this parameter must be specified. Otherwise optional). - * - * @return the targetNicResourceId value. - */ - public String targetNicResourceId() { - return this.targetNicResourceId; - } - - /** - * Set the targetNicResourceId property: The NIC ID. (If VM has multiple NICs and IP forwarding is enabled on any of - * them, then this parameter must be specified. Otherwise optional). - * - * @param targetNicResourceId the targetNicResourceId value to set. - * @return the VerificationIpFlowParameters object itself. - */ - public VerificationIpFlowParameters withTargetNicResourceId(String targetNicResourceId) { - this.targetNicResourceId = targetNicResourceId; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (targetResourceId() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property targetResourceId in model VerificationIpFlowParameters")); - } - if (direction() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property direction in model VerificationIpFlowParameters")); - } - if (protocol() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property protocol in model VerificationIpFlowParameters")); - } - if (localPort() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property localPort in model VerificationIpFlowParameters")); - } - if (remotePort() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property remotePort in model VerificationIpFlowParameters")); - } - if (localIpAddress() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property localIpAddress in model VerificationIpFlowParameters")); - } - if (remoteIpAddress() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property remoteIpAddress in model VerificationIpFlowParameters")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualHubId.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualHubId.java deleted file mode 100644 index d07d4850cbc8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualHubId.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Virtual Hub identifier. */ -@Fluent -public final class VirtualHubId { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualHubId.class); - - /* - * The resource URI for the Virtual Hub where the ExpressRoute gateway is - * or will be deployed. The Virtual Hub resource and the ExpressRoute - * gateway resource reside in the same subscription. - */ - @JsonProperty(value = "id") - private String id; - - /** - * Get the id property: The resource URI for the Virtual Hub where the ExpressRoute gateway is or will be deployed. - * The Virtual Hub resource and the ExpressRoute gateway resource reside in the same subscription. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: The resource URI for the Virtual Hub where the ExpressRoute gateway is or will be deployed. - * The Virtual Hub resource and the ExpressRoute gateway resource reside in the same subscription. - * - * @param id the id value to set. - * @return the VirtualHubId object itself. - */ - public VirtualHubId withId(String id) { - this.id = id; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualHubRoute.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualHubRoute.java deleted file mode 100644 index fe2ac12f2272..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualHubRoute.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** VirtualHub route. */ -@Fluent -public final class VirtualHubRoute { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualHubRoute.class); - - /* - * list of all addressPrefixes. - */ - @JsonProperty(value = "addressPrefixes") - private List addressPrefixes; - - /* - * NextHop ip address. - */ - @JsonProperty(value = "nextHopIpAddress") - private String nextHopIpAddress; - - /** - * Get the addressPrefixes property: list of all addressPrefixes. - * - * @return the addressPrefixes value. - */ - public List addressPrefixes() { - return this.addressPrefixes; - } - - /** - * Set the addressPrefixes property: list of all addressPrefixes. - * - * @param addressPrefixes the addressPrefixes value to set. - * @return the VirtualHubRoute object itself. - */ - public VirtualHubRoute withAddressPrefixes(List addressPrefixes) { - this.addressPrefixes = addressPrefixes; - return this; - } - - /** - * Get the nextHopIpAddress property: NextHop ip address. - * - * @return the nextHopIpAddress value. - */ - public String nextHopIpAddress() { - return this.nextHopIpAddress; - } - - /** - * Set the nextHopIpAddress property: NextHop ip address. - * - * @param nextHopIpAddress the nextHopIpAddress value to set. - * @return the VirtualHubRoute object itself. - */ - public VirtualHubRoute withNextHopIpAddress(String nextHopIpAddress) { - this.nextHopIpAddress = nextHopIpAddress; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualHubRouteTable.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualHubRouteTable.java deleted file mode 100644 index 02f0b822056a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualHubRouteTable.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** VirtualHub route table. */ -@Fluent -public final class VirtualHubRouteTable { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualHubRouteTable.class); - - /* - * list of all routes. - */ - @JsonProperty(value = "routes") - private List routes; - - /** - * Get the routes property: list of all routes. - * - * @return the routes value. - */ - public List routes() { - return this.routes; - } - - /** - * Set the routes property: list of all routes. - * - * @param routes the routes value to set. - * @return the VirtualHubRouteTable object itself. - */ - public VirtualHubRouteTable withRoutes(List routes) { - this.routes = routes; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (routes() != null) { - routes().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualMachineScaleSetNetworkInterface.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualMachineScaleSetNetworkInterface.java deleted file mode 100644 index abe624822c30..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualMachineScaleSetNetworkInterface.java +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.arm.models.Resource; -import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; -import java.util.Map; - -/** Virtual machine scale set network interface. */ -@Fluent -public interface VirtualMachineScaleSetNetworkInterface - extends NetworkInterfaceBase, Resource, Refreshable { - /** @return the IP configurations of this network interface, indexed by their names */ - Map ipConfigurations(); - - /** @return the primary IP configuration of this network interface */ - VirtualMachineScaleSetNicIpConfiguration primaryIPConfiguration(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualMachineScaleSetNetworkInterfaces.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualMachineScaleSetNetworkInterfaces.java deleted file mode 100644 index d045efd3ef84..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualMachineScaleSetNetworkInterfaces.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; - -/** Entry point to virtual machine scale set network interface management API. */ -@Fluent -public interface VirtualMachineScaleSetNetworkInterfaces - extends SupportsListing, HasManager { - /** - * Gets a network interface associated with a virtual machine scale set instance. - * - * @param instanceId the virtual machine scale set vm instance id - * @param name the network interface name - * @return the network interface - */ - VirtualMachineScaleSetNetworkInterface getByVirtualMachineInstanceId(String instanceId, String name); - - /** - * Lists all the network interfaces associated with a virtual machine instance in the scale set. - * - * @param instanceId virtual machine scale set vm instance id - * @return list of network interfaces - */ - PagedIterable listByVirtualMachineInstanceId(String instanceId); - - /** - * Lists all the network interfaces associated with a virtual machine instance in the scale set asynchronously. - * - * @param instanceId virtual machine scale set vm instance id - * @return list of network interfaces - */ - PagedFlux listByVirtualMachineInstanceIdAsync(String instanceId); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualMachineScaleSetNicIpConfiguration.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualMachineScaleSetNicIpConfiguration.java deleted file mode 100644 index f79912e22118..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualMachineScaleSetNicIpConfiguration.java +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.network.fluent.models.NetworkInterfaceIpConfigurationInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.ChildResource; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasSubnet; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; - -/** An IP configuration in a network interface associated with a virtual machine scale set. */ -@Fluent -public interface VirtualMachineScaleSetNicIpConfiguration - extends NicIpConfigurationBase, - HasInnerModel, - ChildResource, - HasPrivateIpAddress, - HasSubnet { -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualNetworkConnectionGatewayReference.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualNetworkConnectionGatewayReference.java deleted file mode 100644 index 034428a409a9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualNetworkConnectionGatewayReference.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** A reference to VirtualNetworkGateway or LocalNetworkGateway resource. */ -@Fluent -public final class VirtualNetworkConnectionGatewayReference { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkConnectionGatewayReference.class); - - /* - * The ID of VirtualNetworkGateway or LocalNetworkGateway resource. - */ - @JsonProperty(value = "id", required = true) - private String id; - - /** - * Get the id property: The ID of VirtualNetworkGateway or LocalNetworkGateway resource. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: The ID of VirtualNetworkGateway or LocalNetworkGateway resource. - * - * @param id the id value to set. - * @return the VirtualNetworkConnectionGatewayReference object itself. - */ - public VirtualNetworkConnectionGatewayReference withId(String id) { - this.id = id; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (id() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property id in model VirtualNetworkConnectionGatewayReference")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualNetworkGateway.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualNetworkGateway.java deleted file mode 100644 index 9662c761ce2f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualNetworkGateway.java +++ /dev/null @@ -1,298 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.network.fluent.models.VirtualNetworkGatewayInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.GroupableResource; -import com.azure.resourcemanager.resources.fluentcore.arm.models.Resource; -import com.azure.resourcemanager.resources.fluentcore.model.Appliable; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; -import com.azure.resourcemanager.resources.fluentcore.model.Updatable; -import java.util.Collection; -import reactor.core.publisher.Mono; - -/** Entry point for Virtual Network Gateway management API in Azure. */ -@Fluent -public interface VirtualNetworkGateway - extends GroupableResource, - Refreshable, - Updatable, - UpdatableWithTags { - - // Actions - - /** Resets the primary of the virtual network gateway. */ - void reset(); - - /** - * Resets the primary of the virtual network gateway asynchronously. - * - * @return a representation of the deferred computation of this call - */ - Mono resetAsync(); - - /** @return all the connections associated with this virtual network gateway */ - PagedIterable listConnections(); - - /** - * Get all the connections associated with this virtual network gateway asynchronously. - * - * @return all the connections associated with this virtual network gateway - */ - PagedFlux listConnectionsAsync(); - - /** - * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for - * IKEV2 and radius based authentication. - * - * @return String object if successful - */ - String generateVpnProfile(); - - /** - * Generates asynchronously VPN profile for P2S client of the virtual network gateway in the specified resource - * group. Used for IKEV2 and radius based authentication. - * - * @return String object if successful - */ - Mono generateVpnProfileAsync(); - - /** - * @return the entry point to virtual network gateway connections management API for this virtual network gateway - */ - VirtualNetworkGatewayConnections connections(); - - // Getters - - /** @return the gatewayType value */ - VirtualNetworkGatewayType gatewayType(); - - /** @return the type of this virtual network gateway */ - VpnType vpnType(); - - /** @return whether BGP is enabled for this virtual network gateway or not */ - boolean isBgpEnabled(); - - /** @return activeActive flag */ - boolean activeActive(); - - /** - * @return the resource id of the LocalNetworkGateway resource which represents local network site having default - * routes - */ - String gatewayDefaultSiteResourceId(); - - /** @return the SKU of this virtual network gateway */ - VirtualNetworkGatewaySku sku(); - - /** - * @return the reference of the VpnClientConfiguration resource which represents the P2S VpnClient configurations - */ - VpnClientConfiguration vpnClientConfiguration(); - - /** @return virtual network gateway's BGP speaker settings */ - BgpSettings bgpSettings(); - - /** @return IP configurations for virtual network gateway */ - Collection ipConfigurations(); - - /** The entirety of the virtual network gateway definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithGroup, - DefinitionStages.WithGatewayType, - DefinitionStages.WithSku, - DefinitionStages.WithNetwork, - DefinitionStages.WithBgp, - DefinitionStages.WithCreate { - } - - /** Grouping of virtual network gateway definition stages. */ - interface DefinitionStages { - /** The first stage of a virtual network gateway definition. */ - interface Blank extends GroupableResource.DefinitionWithRegion { - } - - /** The stage of the virtual network gateway definition allowing to specify the resource group. */ - interface WithGroup extends GroupableResource.DefinitionStages.WithGroup { - } - - /** The stage of virtual network gateway definition allowing to specify virtual network gateway type. */ - interface WithGatewayType { - /** - * Use Express route gateway type. - * - * @return the next stage of the definition - */ - WithSku withExpressRoute(); - - /** - * Use Route-based VPN type. - * - * @return the next stage of the definition - */ - WithSku withRouteBasedVpn(); - - /** - * Use Policy-based VPN type. Note: this is available only for Basic SKU. - * - * @return the next stage of the definition - */ - WithCreate withPolicyBasedVpn(); - } - - /** The stage of the virtual network gateway definition allowing to specify the virtual network. */ - interface WithNetwork { - /** - * Create a new virtual network to associate with the virtual network gateway, based on the provided - * definition. - * - * @param creatable a creatable definition for a new virtual network - * @return the next stage of the definition - */ - WithGatewayType withNewNetwork(Creatable creatable); - - /** - * Creates a new virtual network to associate with the virtual network gateway. the virtual network will be - * created in the same resource group and region as of parent virtual network gateway, it will be created - * with the specified address space and a subnet for virtual network gateway. - * - * @param name the name of the new virtual network - * @param addressSpace the address space for the virtual network - * @param subnetAddressSpaceCidr the address space for the subnet - * @return the next stage of the definition - */ - WithGatewayType withNewNetwork(String name, String addressSpace, String subnetAddressSpaceCidr); - - /** - * Creates a new virtual network to associate with the virtual network gateway. the virtual network will be - * created in the same resource group and region as of parent virtual network gateway, it will be created - * with the specified address space and a default subnet for virtual network gateway. - * - * @param addressSpaceCidr the address space for the virtual network - * @param subnetAddressSpaceCidr the address space for the subnet - * @return the next stage of the definition - */ - WithGatewayType withNewNetwork(String addressSpaceCidr, String subnetAddressSpaceCidr); - - /** - * Associate an existing virtual network with the virtual network gateway. - * - * @param network an existing virtual network - * @return the next stage of the definition - */ - WithGatewayType withExistingNetwork(Network network); - } - - /** The stage of virtual network gateway definition allowing to specify SKU. */ - interface WithSku { - /** - * Specifies the SKU. - * - * @param skuName the SKU - * @return the next stage of the definition - */ - WithCreate withSku(VirtualNetworkGatewaySkuName skuName); - } - - /** - * The stage of virtual network gateway definition allowing to specify public IP address for IP configuration. - */ - interface WithPublicIPAddress - extends HasPublicIpAddress.DefinitionStages.WithPublicIPAddressNoDnsLabel { - } - - /** - * The stage of definition allowing to specify virtual network gateway's BGP speaker settings. Note: BGP is - * supported on Route-Based VPN gateways only. - */ - interface WithBgp { - /** - * @param asn the BGP speaker's ASN - * @param bgpPeeringAddress the BGP peering address and BGP identifier of this BGP speaker - * @return the next stage of the definition - */ - WithCreate withBgp(long asn, String bgpPeeringAddress); - } - - /** - * The stage of the virtual network gateway definition which contains all the minimum required inputs for the - * resource to be created, but also allows for any other optional settings to be specified. - */ - interface WithCreate - extends Creatable, - Resource.DefinitionWithTags, - DefinitionStages.WithPublicIPAddress, - DefinitionStages.WithBgp { - } - } - - /** Grouping of virtual network gateway update stages. */ - interface UpdateStages { - /** The stage of virtual network gateway update allowing to change SKU. */ - interface WithSku { - /** - * Specifies the SKU. - * @param skuName the SKU - * @return the next stage of the update - */ - Update withSku(VirtualNetworkGatewaySkuName skuName); - } - - /** - * The stage of update allowing to specify virtual network gateway's BGP speaker settings. Note: BGP is - * supported on Route-Based VPN gateways only. - */ - interface WithBgp { - /** - * Enables BGP. - * - * @param asn the BGP speaker's ASN - * @param bgpPeeringAddress the BGP peering address and BGP identifier of this BGP speaker - * @return the next stage of the update - */ - Update withBgp(long asn, String bgpPeeringAddress); - - /** - * Disables BGP for this virtual network gateway. - * - * @return the next stage of the update - */ - Update withoutBgp(); - } - - /** The stage of update allowing to specify virtual network gateway's point-to-site configuration. */ - interface WithPointToSiteConfiguration { - - /** - * Begins the definition of point-to-site configuration to be added to this virtual network gateway. - * - * @return the first stage of the point-to-site configuration definition - */ - PointToSiteConfiguration.DefinitionStages.Blank definePointToSiteConfiguration(); - - /** - * Begins the update of point-to-site configuration to be added to this virtual network gateway. - * - * @return the first stage of the point-to-site configuration update - */ - PointToSiteConfiguration.Update updatePointToSiteConfiguration(); - } - } - - /** - * The template for a virtual network gateway update operation, containing all the settings that can be modified. - */ - interface Update - extends Appliable, - Resource.UpdateWithTags, - UpdateStages.WithSku, - UpdateStages.WithBgp, - UpdateStages.WithPointToSiteConfiguration { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualNetworkGatewayConnection.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualNetworkGatewayConnection.java deleted file mode 100644 index c12e9da211f8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualNetworkGatewayConnection.java +++ /dev/null @@ -1,254 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.network.fluent.models.VirtualNetworkGatewayConnectionInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasParent; -import com.azure.resourcemanager.resources.fluentcore.arm.models.IndependentChildResource; -import com.azure.resourcemanager.resources.fluentcore.arm.models.Resource; -import com.azure.resourcemanager.resources.fluentcore.model.Appliable; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; -import com.azure.resourcemanager.resources.fluentcore.model.Updatable; -import java.util.Collection; - -/** Client-side representation of Virtual Network Gateway Connection object, associated with Virtual Network Gateway. */ -@Fluent -public interface VirtualNetworkGatewayConnection - extends IndependentChildResource, - Refreshable, - Updatable, - UpdatableWithTags, - HasParent { - - /** - * Get the authorizationKey value. - * - * @return the authorizationKey value - */ - String authorizationKey(); - - /** @return the reference to virtual network gateway resource */ - String virtualNetworkGateway1Id(); - - /** @return the reference to virtual network gateway resource. */ - String virtualNetworkGateway2Id(); - - /** @return the reference to local network gateway resource */ - String localNetworkGateway2Id(); - - /** - * Get the gateway connection type. - * - * @return the connectionType value - */ - VirtualNetworkGatewayConnectionType connectionType(); - - /** @return the routing weight */ - int routingWeight(); - - /** @return the IPSec shared key */ - String sharedKey(); - - /** - * Get the Virtual Network Gateway connection status. - * - * @return the connectionStatus value - */ - VirtualNetworkGatewayConnectionStatus connectionStatus(); - - /** - * Get the tunnelConnectionStatus value. - * - * @return collection of all tunnels' connection health status - */ - Collection tunnelConnectionStatus(); - - /** @return the egress bytes transferred in this connection */ - long egressBytesTransferred(); - - /** @return the egress bytes transferred in this connection. */ - long ingressBytesTransferred(); - - /** @return the reference to peerings resource */ - String peerId(); - - /** @return the enableBgp flag */ - boolean isBgpEnabled(); - - /** @return if policy-based traffic selectors enabled */ - boolean usePolicyBasedTrafficSelectors(); - - /** @return the IPSec Policies to be considered by this connection */ - Collection ipsecPolicies(); - - /** @return the provisioning state of the VirtualNetworkGatewayConnection resource */ - String provisioningState(); - - /** The entirety of the virtual network gateway connection definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithConnectionType, - DefinitionStages.WithLocalNetworkGateway, - DefinitionStages.WithSecondVirtualNetworkGateway, - DefinitionStages.WithSharedKey, - DefinitionStages.WithAuthorization, - DefinitionStages.WithCreate { - } - - /** Grouping of virtual network gateway connection definition stages. */ - interface DefinitionStages { - /** The first stage of virtual network gateway connection definition. */ - interface Blank extends WithConnectionType { - } - - /** Stage of definition allowing to specify connection type. */ - interface WithConnectionType { - /** - * Create Site-to-Site connection. - * - * @return next stage of definition, allowing to specify local network gateway - */ - WithLocalNetworkGateway withSiteToSite(); - - /** - * Create VNet-to-VNet connection. - * - * @return the next stage of the definition, allowing to specify virtual network gateway to connect to. - */ - WithSecondVirtualNetworkGateway withVNetToVNet(); - - /** - * Create Express Route connection. - * - * @param circuitId id of Express Route circuit used for connection - * @return next stage of definition - */ - WithCreate withExpressRoute(String circuitId); - - /** - * Create Express Route connection. - * - * @param circuit Express Route circuit used for connection - * @return the next stage of the definition - */ - WithCreate withExpressRoute(ExpressRouteCircuit circuit); - } - - /** Stage of definition allowing to specify local network gateway to connect to. */ - interface WithLocalNetworkGateway { - /** - * @param localNetworkGateway local network gateway to connect to - * @return the next stage of the definition - */ - WithSharedKey withLocalNetworkGateway(LocalNetworkGateway localNetworkGateway); - } - - /** Stage of definition allowing to specify virtual network gateway to connect to. */ - interface WithSecondVirtualNetworkGateway { - /** - * @param virtualNetworkGateway2 virtual network gateway to connect to - * @return the next stage of the definition - */ - WithSharedKey withSecondVirtualNetworkGateway(VirtualNetworkGateway virtualNetworkGateway2); - } - - /** Stage of definition allowing to specify shared key for the connection. */ - interface WithSharedKey { - /** - * Specify shared key. - * - * @param sharedKey shared key - * @return the next stage of the definition - */ - WithCreate withSharedKey(String sharedKey); - } - - /** Stage of definition allowing to enable BGP for the connection. */ - interface WithBgp { - /** - * Enable BGP for the connection. - * - * @return the next stage of the definition - */ - WithCreate withBgp(); - } - - /** Stage of definition allowing to add authorization for the connection. */ - interface WithAuthorization { - /** - * Specify authorization key. This is required in case of Express Route connection if Express Route circuit - * and virtual network gateway reside in different subscriptions. - * - * @param authorizationKey authorization key to use - * @return the next stage of the definition - */ - WithCreate withAuthorization(String authorizationKey); - } - - /** - * The stage of a virtual network gateway connection definition with sufficient inputs to create a new - * connection in the cloud, but exposing additional optional settings to specify. - */ - interface WithCreate - extends Creatable, - Resource.DefinitionWithTags, - WithBgp, - WithAuthorization { - } - } - - /** Grouping of virtual network gateway connection update stages. */ - interface Update - extends Appliable, - Resource.UpdateWithTags, - UpdateStages.WithBgp, - UpdateStages.WithSharedKey, - UpdateStages.WithAuthorization { - } - - /** Grouping of virtual network gateway connection update stages. */ - interface UpdateStages { - /** Stage of virtual network gateway connection update allowing to enable or disable BGP for the connection. */ - interface WithBgp { - /** - * Enable BGP for the connection. - * - * @return the next stage of the update - */ - Update withBgp(); - - /** - * Disable BGP for the connection. - * - * @return the next stage of the update - */ - Update withoutBgp(); - } - - /** Stage of virtual network gateway connection update allowing to specify shared key for the connection. */ - interface WithSharedKey { - /** - * Specify shared key. - * - * @param sharedKey shared key - * @return the next stage of the update - */ - Update withSharedKey(String sharedKey); - } - - /** Stage of virtual network gateway connection update allowing to add authorization for the connection. */ - interface WithAuthorization { - /** - * Specify authorization key. This is required in case of Express Route connection if Express Route circuit - * and virtual network gateway reside in different subscriptions. - * - * @param authorizationKey authorization key to use - * @return the next stage of the update - */ - Update withAuthorization(String authorizationKey); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualNetworkGatewayConnectionListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualNetworkGatewayConnectionListResult.java deleted file mode 100644 index 15b67029a984..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualNetworkGatewayConnectionListResult.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.VirtualNetworkGatewayConnectionInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Response for the ListVirtualNetworkGatewayConnections API service call. */ -@Fluent -public final class VirtualNetworkGatewayConnectionListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkGatewayConnectionListResult.class); - - /* - * Gets a list of VirtualNetworkGatewayConnection resources that exists in - * a resource group. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to get the next set of results. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: Gets a list of VirtualNetworkGatewayConnection resources that exists in a resource group. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Gets a list of VirtualNetworkGatewayConnection resources that exists in a resource group. - * - * @param value the value value to set. - * @return the VirtualNetworkGatewayConnectionListResult object itself. - */ - public VirtualNetworkGatewayConnectionListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to get the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualNetworkGatewayConnectionProtocol.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualNetworkGatewayConnectionProtocol.java deleted file mode 100644 index 0fc6c532a4ee..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualNetworkGatewayConnectionProtocol.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for VirtualNetworkGatewayConnectionProtocol. */ -public final class VirtualNetworkGatewayConnectionProtocol - extends ExpandableStringEnum { - /** Static value IKEv2 for VirtualNetworkGatewayConnectionProtocol. */ - public static final VirtualNetworkGatewayConnectionProtocol IKEV2 = fromString("IKEv2"); - - /** Static value IKEv1 for VirtualNetworkGatewayConnectionProtocol. */ - public static final VirtualNetworkGatewayConnectionProtocol IKEV1 = fromString("IKEv1"); - - /** - * Creates or finds a VirtualNetworkGatewayConnectionProtocol from its string representation. - * - * @param name a name to look for. - * @return the corresponding VirtualNetworkGatewayConnectionProtocol. - */ - @JsonCreator - public static VirtualNetworkGatewayConnectionProtocol fromString(String name) { - return fromString(name, VirtualNetworkGatewayConnectionProtocol.class); - } - - /** @return known VirtualNetworkGatewayConnectionProtocol values. */ - public static Collection values() { - return values(VirtualNetworkGatewayConnectionProtocol.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualNetworkGatewayConnectionStatus.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualNetworkGatewayConnectionStatus.java deleted file mode 100644 index d9074d0f7640..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualNetworkGatewayConnectionStatus.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for VirtualNetworkGatewayConnectionStatus. */ -public final class VirtualNetworkGatewayConnectionStatus - extends ExpandableStringEnum { - /** Static value Unknown for VirtualNetworkGatewayConnectionStatus. */ - public static final VirtualNetworkGatewayConnectionStatus UNKNOWN = fromString("Unknown"); - - /** Static value Connecting for VirtualNetworkGatewayConnectionStatus. */ - public static final VirtualNetworkGatewayConnectionStatus CONNECTING = fromString("Connecting"); - - /** Static value Connected for VirtualNetworkGatewayConnectionStatus. */ - public static final VirtualNetworkGatewayConnectionStatus CONNECTED = fromString("Connected"); - - /** Static value NotConnected for VirtualNetworkGatewayConnectionStatus. */ - public static final VirtualNetworkGatewayConnectionStatus NOT_CONNECTED = fromString("NotConnected"); - - /** - * Creates or finds a VirtualNetworkGatewayConnectionStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding VirtualNetworkGatewayConnectionStatus. - */ - @JsonCreator - public static VirtualNetworkGatewayConnectionStatus fromString(String name) { - return fromString(name, VirtualNetworkGatewayConnectionStatus.class); - } - - /** @return known VirtualNetworkGatewayConnectionStatus values. */ - public static Collection values() { - return values(VirtualNetworkGatewayConnectionStatus.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualNetworkGatewayConnectionType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualNetworkGatewayConnectionType.java deleted file mode 100644 index 8329dd9621c5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualNetworkGatewayConnectionType.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for VirtualNetworkGatewayConnectionType. */ -public final class VirtualNetworkGatewayConnectionType - extends ExpandableStringEnum { - /** Static value IPsec for VirtualNetworkGatewayConnectionType. */ - public static final VirtualNetworkGatewayConnectionType IPSEC = fromString("IPsec"); - - /** Static value Vnet2Vnet for VirtualNetworkGatewayConnectionType. */ - public static final VirtualNetworkGatewayConnectionType VNET2VNET = fromString("Vnet2Vnet"); - - /** Static value ExpressRoute for VirtualNetworkGatewayConnectionType. */ - public static final VirtualNetworkGatewayConnectionType EXPRESS_ROUTE = fromString("ExpressRoute"); - - /** Static value VPNClient for VirtualNetworkGatewayConnectionType. */ - public static final VirtualNetworkGatewayConnectionType VPNCLIENT = fromString("VPNClient"); - - /** - * Creates or finds a VirtualNetworkGatewayConnectionType from its string representation. - * - * @param name a name to look for. - * @return the corresponding VirtualNetworkGatewayConnectionType. - */ - @JsonCreator - public static VirtualNetworkGatewayConnectionType fromString(String name) { - return fromString(name, VirtualNetworkGatewayConnectionType.class); - } - - /** @return known VirtualNetworkGatewayConnectionType values. */ - public static Collection values() { - return values(VirtualNetworkGatewayConnectionType.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualNetworkGatewayConnections.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualNetworkGatewayConnections.java deleted file mode 100644 index 0078cb540d40..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualNetworkGatewayConnections.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingByName; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasParent; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsCreating; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingById; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingByName; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; -import reactor.core.publisher.Mono; - -/** Entry point for virtual network gateway connections management API in Azure. */ -@Fluent -public interface VirtualNetworkGatewayConnections - extends SupportsCreating, - SupportsListing, - SupportsGettingByName, - SupportsGettingById, - SupportsDeletingByName, - SupportsDeletingById, - HasParent { - - /** - * Gets the shared key of the virtual network gateway connection by resource ID. - * - * @param id the resource ID. - * @return the shared key. - */ - String getSharedKeyById(String id); - - /** - * Gets the shared key of the virtual network gateway connection by resource ID. - * - * @param id the resource ID. - * @return A {@link Mono} that emits the found resource asynchronously. - */ - Mono getSharedKeyByIdAsync(String id); - - /** - * Sets the shared key of the virtual network gateway connection. - * - * @param id the resource ID. - * @param sharedKey the shared key. - * @return the shared key. - */ - String setSharedKeyById(String id, String sharedKey); - - /** - * Sets the shared key of the virtual network gateway connection. - * - * @param id the resource ID. - * @param sharedKey the shared key. - * @return A {@link Mono} that emits the found resource asynchronously. - */ - Mono setSharedKeyByIdAsync(String id, String sharedKey); - - /** - * Sets the shared key of the virtual network gateway connection. - * - * @param name the resource name. - * @param sharedKey the shared key. - * @return the shared key. - */ - String setSharedKeyByName(String name, String sharedKey); - - /** - * Sets the shared key of the virtual network gateway connection. - * - * @param name the resource name. - * @param sharedKey the shared key. - * @return A {@link Mono} that emits the found resource asynchronously. - */ - Mono setSharedKeyByNameAsync(String name, String sharedKey); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualNetworkGatewayIpConfiguration.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualNetworkGatewayIpConfiguration.java deleted file mode 100644 index 28d001fade3a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualNetworkGatewayIpConfiguration.java +++ /dev/null @@ -1,148 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.network.fluent.models.VirtualNetworkGatewayIpConfigurationInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.ChildResource; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasSubnet; -import com.azure.resourcemanager.resources.fluentcore.model.Attachable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.model.Settable; - -/** A client-side representation of an virtual network gateway IP configuration. */ -@Fluent -public interface VirtualNetworkGatewayIpConfiguration - extends HasInnerModel, ChildResource { - /** @return the resource ID of the virtual network the application gateway is in */ - String networkId(); - - /** @return the resource id of associated public IP address */ - String publicIpAddressId(); - - /** @return the name of the subnet the virtual network gateway is in */ - String subnetName(); - - /** @return the private IP allocation method. Possible values are: 'Static' and 'Dynamic'. */ - IpAllocationMethod privateIpAllocationMethod(); - - /** @return the subnet the virtual network gateway is in Note, this results in a separate call to Azure. */ - Subnet getSubnet(); - - /** Grouping of virtual network gateway IP configuration definition stages. */ - interface DefinitionStages { - /** - * The first stage of an virtual network gateway IP configuration definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface Blank extends WithSubnet { - } - - /** - * The stage of virtual network gateway IP configuration definition allowing to specify the subnet the virtual - * network gateway is on. - * - * @param the stage of the virtual network gateway definition to return to after attaching this - * definition - */ - interface WithSubnet extends HasSubnet.DefinitionStages.WithSubnet> { - /** - * Specifies an existing subnet the virtual network gateway should be part of and get its private IP address - * from. - * - * @param subnet an existing subnet - * @return the next stage of the definition - */ - WithAttach withExistingSubnet(Subnet subnet); - - /** - * Specifies an existing subnet the virtual network gateway should be part of and get its private IP address - * from. - * - * @param network an existing virtual network - * @param subnetName the name of a subnet within the selected network - * @return the next stage of the definition - */ - WithAttach withExistingSubnet(Network network, String subnetName); - } - - /** - * The stage of virtual network gateway frontend definition allowing to specify an existing public IP address to - * make the virtual network gateway available at as Internet-facing. - * - * @param the stage of the parent virtual network gateway definition to return to after attaching this - * definition - */ - interface WithPublicIPAddress - extends HasPublicIpAddress.DefinitionStages.WithExistingPublicIPAddress> { - } - - /** - * The final stage of the virtual network gateway IP configuration definition. - * - *

    At this stage, any remaining optional settings can be specified, or the definition can be attached to the - * parent virtual network gateway definition. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface WithAttach extends Attachable.InDefinition { - } - } - - /** - * The entirety of virtual network gateway IP configuration definition. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithAttach, - DefinitionStages.WithPublicIPAddress { - } - - /** Grouping of application gateway IP configuration update stages. */ - interface UpdateStages { - } - - /** The entirety of an application gateway IP configuration update as part of a virtual network gateway update. */ - interface Update extends Settable { - } - - /** - * Grouping of application gateway IP configuration definition stages applicable as part of a virtual network - * gateway update. - */ - interface UpdateDefinitionStages { - /** - * The first stage of a virtual network gateway IP configuration definition. - * - * @param the stage of the parent definition to return to after attaching this definition - */ - interface Blank { - } - - /** - * The final stage of a virtual network gateway IP configuration definition. - * - *

    At this stage, any remaining optional settings can be specified, or the definition can be attached to the - * parent application gateway definition. - * - * @param the stage of the parent application gateway definition to return to after attaching this - * definition - */ - interface WithAttach extends Attachable.InUpdate { - } - } - - /** - * The entirety of an application gateway IP configuration definition as part of a virtual network gateway update. - * - * @param the parent type - */ - interface UpdateDefinition - extends UpdateDefinitionStages.Blank, UpdateDefinitionStages.WithAttach { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualNetworkGatewayListConnectionsResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualNetworkGatewayListConnectionsResult.java deleted file mode 100644 index d77e61687911..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualNetworkGatewayListConnectionsResult.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.VirtualNetworkGatewayConnectionListEntityInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Response for the VirtualNetworkGatewayListConnections API service call. */ -@Fluent -public final class VirtualNetworkGatewayListConnectionsResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkGatewayListConnectionsResult.class); - - /* - * Gets a list of VirtualNetworkGatewayConnection resources that exists in - * a resource group. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to get the next set of results. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: Gets a list of VirtualNetworkGatewayConnection resources that exists in a resource group. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Gets a list of VirtualNetworkGatewayConnection resources that exists in a resource group. - * - * @param value the value value to set. - * @return the VirtualNetworkGatewayListConnectionsResult object itself. - */ - public VirtualNetworkGatewayListConnectionsResult withValue( - List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to get the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualNetworkGatewayListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualNetworkGatewayListResult.java deleted file mode 100644 index da6dde09e247..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualNetworkGatewayListResult.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.VirtualNetworkGatewayInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Response for the ListVirtualNetworkGateways API service call. */ -@Fluent -public final class VirtualNetworkGatewayListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkGatewayListResult.class); - - /* - * Gets a list of VirtualNetworkGateway resources that exists in a resource - * group. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to get the next set of results. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: Gets a list of VirtualNetworkGateway resources that exists in a resource group. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Gets a list of VirtualNetworkGateway resources that exists in a resource group. - * - * @param value the value value to set. - * @return the VirtualNetworkGatewayListResult object itself. - */ - public VirtualNetworkGatewayListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to get the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualNetworkGatewaySku.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualNetworkGatewaySku.java deleted file mode 100644 index c305528c6a46..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualNetworkGatewaySku.java +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** VirtualNetworkGatewaySku details. */ -@Fluent -public final class VirtualNetworkGatewaySku { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkGatewaySku.class); - - /* - * Gateway SKU name. - */ - @JsonProperty(value = "name") - private VirtualNetworkGatewaySkuName name; - - /* - * Gateway SKU tier. - */ - @JsonProperty(value = "tier") - private VirtualNetworkGatewaySkuTier tier; - - /* - * The capacity. - */ - @JsonProperty(value = "capacity") - private Integer capacity; - - /** - * Get the name property: Gateway SKU name. - * - * @return the name value. - */ - public VirtualNetworkGatewaySkuName name() { - return this.name; - } - - /** - * Set the name property: Gateway SKU name. - * - * @param name the name value to set. - * @return the VirtualNetworkGatewaySku object itself. - */ - public VirtualNetworkGatewaySku withName(VirtualNetworkGatewaySkuName name) { - this.name = name; - return this; - } - - /** - * Get the tier property: Gateway SKU tier. - * - * @return the tier value. - */ - public VirtualNetworkGatewaySkuTier tier() { - return this.tier; - } - - /** - * Set the tier property: Gateway SKU tier. - * - * @param tier the tier value to set. - * @return the VirtualNetworkGatewaySku object itself. - */ - public VirtualNetworkGatewaySku withTier(VirtualNetworkGatewaySkuTier tier) { - this.tier = tier; - return this; - } - - /** - * Get the capacity property: The capacity. - * - * @return the capacity value. - */ - public Integer capacity() { - return this.capacity; - } - - /** - * Set the capacity property: The capacity. - * - * @param capacity the capacity value to set. - * @return the VirtualNetworkGatewaySku object itself. - */ - public VirtualNetworkGatewaySku withCapacity(Integer capacity) { - this.capacity = capacity; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualNetworkGatewaySkuName.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualNetworkGatewaySkuName.java deleted file mode 100644 index 8ac546ed35f0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualNetworkGatewaySkuName.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for VirtualNetworkGatewaySkuName. */ -public final class VirtualNetworkGatewaySkuName extends ExpandableStringEnum { - /** Static value Basic for VirtualNetworkGatewaySkuName. */ - public static final VirtualNetworkGatewaySkuName BASIC = fromString("Basic"); - - /** Static value HighPerformance for VirtualNetworkGatewaySkuName. */ - public static final VirtualNetworkGatewaySkuName HIGH_PERFORMANCE = fromString("HighPerformance"); - - /** Static value Standard for VirtualNetworkGatewaySkuName. */ - public static final VirtualNetworkGatewaySkuName STANDARD = fromString("Standard"); - - /** Static value UltraPerformance for VirtualNetworkGatewaySkuName. */ - public static final VirtualNetworkGatewaySkuName ULTRA_PERFORMANCE = fromString("UltraPerformance"); - - /** Static value VpnGw1 for VirtualNetworkGatewaySkuName. */ - public static final VirtualNetworkGatewaySkuName VPN_GW1 = fromString("VpnGw1"); - - /** Static value VpnGw2 for VirtualNetworkGatewaySkuName. */ - public static final VirtualNetworkGatewaySkuName VPN_GW2 = fromString("VpnGw2"); - - /** Static value VpnGw3 for VirtualNetworkGatewaySkuName. */ - public static final VirtualNetworkGatewaySkuName VPN_GW3 = fromString("VpnGw3"); - - /** Static value VpnGw1AZ for VirtualNetworkGatewaySkuName. */ - public static final VirtualNetworkGatewaySkuName VPN_GW1AZ = fromString("VpnGw1AZ"); - - /** Static value VpnGw2AZ for VirtualNetworkGatewaySkuName. */ - public static final VirtualNetworkGatewaySkuName VPN_GW2AZ = fromString("VpnGw2AZ"); - - /** Static value VpnGw3AZ for VirtualNetworkGatewaySkuName. */ - public static final VirtualNetworkGatewaySkuName VPN_GW3AZ = fromString("VpnGw3AZ"); - - /** Static value ErGw1AZ for VirtualNetworkGatewaySkuName. */ - public static final VirtualNetworkGatewaySkuName ER_GW1AZ = fromString("ErGw1AZ"); - - /** Static value ErGw2AZ for VirtualNetworkGatewaySkuName. */ - public static final VirtualNetworkGatewaySkuName ER_GW2AZ = fromString("ErGw2AZ"); - - /** Static value ErGw3AZ for VirtualNetworkGatewaySkuName. */ - public static final VirtualNetworkGatewaySkuName ER_GW3AZ = fromString("ErGw3AZ"); - - /** - * Creates or finds a VirtualNetworkGatewaySkuName from its string representation. - * - * @param name a name to look for. - * @return the corresponding VirtualNetworkGatewaySkuName. - */ - @JsonCreator - public static VirtualNetworkGatewaySkuName fromString(String name) { - return fromString(name, VirtualNetworkGatewaySkuName.class); - } - - /** @return known VirtualNetworkGatewaySkuName values. */ - public static Collection values() { - return values(VirtualNetworkGatewaySkuName.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualNetworkGatewaySkuTier.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualNetworkGatewaySkuTier.java deleted file mode 100644 index 9690259f72e3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualNetworkGatewaySkuTier.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for VirtualNetworkGatewaySkuTier. */ -public final class VirtualNetworkGatewaySkuTier extends ExpandableStringEnum { - /** Static value Basic for VirtualNetworkGatewaySkuTier. */ - public static final VirtualNetworkGatewaySkuTier BASIC = fromString("Basic"); - - /** Static value HighPerformance for VirtualNetworkGatewaySkuTier. */ - public static final VirtualNetworkGatewaySkuTier HIGH_PERFORMANCE = fromString("HighPerformance"); - - /** Static value Standard for VirtualNetworkGatewaySkuTier. */ - public static final VirtualNetworkGatewaySkuTier STANDARD = fromString("Standard"); - - /** Static value UltraPerformance for VirtualNetworkGatewaySkuTier. */ - public static final VirtualNetworkGatewaySkuTier ULTRA_PERFORMANCE = fromString("UltraPerformance"); - - /** Static value VpnGw1 for VirtualNetworkGatewaySkuTier. */ - public static final VirtualNetworkGatewaySkuTier VPN_GW1 = fromString("VpnGw1"); - - /** Static value VpnGw2 for VirtualNetworkGatewaySkuTier. */ - public static final VirtualNetworkGatewaySkuTier VPN_GW2 = fromString("VpnGw2"); - - /** Static value VpnGw3 for VirtualNetworkGatewaySkuTier. */ - public static final VirtualNetworkGatewaySkuTier VPN_GW3 = fromString("VpnGw3"); - - /** Static value VpnGw1AZ for VirtualNetworkGatewaySkuTier. */ - public static final VirtualNetworkGatewaySkuTier VPN_GW1AZ = fromString("VpnGw1AZ"); - - /** Static value VpnGw2AZ for VirtualNetworkGatewaySkuTier. */ - public static final VirtualNetworkGatewaySkuTier VPN_GW2AZ = fromString("VpnGw2AZ"); - - /** Static value VpnGw3AZ for VirtualNetworkGatewaySkuTier. */ - public static final VirtualNetworkGatewaySkuTier VPN_GW3AZ = fromString("VpnGw3AZ"); - - /** Static value ErGw1AZ for VirtualNetworkGatewaySkuTier. */ - public static final VirtualNetworkGatewaySkuTier ER_GW1AZ = fromString("ErGw1AZ"); - - /** Static value ErGw2AZ for VirtualNetworkGatewaySkuTier. */ - public static final VirtualNetworkGatewaySkuTier ER_GW2AZ = fromString("ErGw2AZ"); - - /** Static value ErGw3AZ for VirtualNetworkGatewaySkuTier. */ - public static final VirtualNetworkGatewaySkuTier ER_GW3AZ = fromString("ErGw3AZ"); - - /** - * Creates or finds a VirtualNetworkGatewaySkuTier from its string representation. - * - * @param name a name to look for. - * @return the corresponding VirtualNetworkGatewaySkuTier. - */ - @JsonCreator - public static VirtualNetworkGatewaySkuTier fromString(String name) { - return fromString(name, VirtualNetworkGatewaySkuTier.class); - } - - /** @return known VirtualNetworkGatewaySkuTier values. */ - public static Collection values() { - return values(VirtualNetworkGatewaySkuTier.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualNetworkGatewayType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualNetworkGatewayType.java deleted file mode 100644 index ef011cf692a6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualNetworkGatewayType.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for VirtualNetworkGatewayType. */ -public final class VirtualNetworkGatewayType extends ExpandableStringEnum { - /** Static value Vpn for VirtualNetworkGatewayType. */ - public static final VirtualNetworkGatewayType VPN = fromString("Vpn"); - - /** Static value ExpressRoute for VirtualNetworkGatewayType. */ - public static final VirtualNetworkGatewayType EXPRESS_ROUTE = fromString("ExpressRoute"); - - /** - * Creates or finds a VirtualNetworkGatewayType from its string representation. - * - * @param name a name to look for. - * @return the corresponding VirtualNetworkGatewayType. - */ - @JsonCreator - public static VirtualNetworkGatewayType fromString(String name) { - return fromString(name, VirtualNetworkGatewayType.class); - } - - /** @return known VirtualNetworkGatewayType values. */ - public static Collection values() { - return values(VirtualNetworkGatewayType.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualNetworkGateways.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualNetworkGateways.java deleted file mode 100644 index ddbf34852cbf..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualNetworkGateways.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsDeletingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsListingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsBatchCreation; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsCreating; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingById; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; - -/** Entry point to virtual network gateways management API in Azure. */ -@Fluent -public interface VirtualNetworkGateways - extends SupportsCreating, - SupportsListing, - SupportsListingByResourceGroup, - SupportsGettingByResourceGroup, - SupportsGettingById, - SupportsDeletingById, - SupportsDeletingByResourceGroup, - SupportsBatchCreation, - HasManager { -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualNetworkListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualNetworkListResult.java deleted file mode 100644 index 029e551eb764..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualNetworkListResult.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.VirtualNetworkInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Response for the ListVirtualNetworks API service call. */ -@Fluent -public final class VirtualNetworkListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkListResult.class); - - /* - * Gets a list of VirtualNetwork resources in a resource group. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to get the next set of results. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: Gets a list of VirtualNetwork resources in a resource group. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Gets a list of VirtualNetwork resources in a resource group. - * - * @param value the value value to set. - * @return the VirtualNetworkListResult object itself. - */ - public VirtualNetworkListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to get the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The URL to get the next set of results. - * - * @param nextLink the nextLink value to set. - * @return the VirtualNetworkListResult object itself. - */ - public VirtualNetworkListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualNetworkListUsageResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualNetworkListUsageResult.java deleted file mode 100644 index 1e6cf2a51fbc..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualNetworkListUsageResult.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.VirtualNetworkUsageInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Response for the virtual networks GetUsage API service call. */ -@Fluent -public final class VirtualNetworkListUsageResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkListUsageResult.class); - - /* - * VirtualNetwork usage stats. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /* - * The URL to get the next set of results. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: VirtualNetwork usage stats. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The URL to get the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The URL to get the next set of results. - * - * @param nextLink the nextLink value to set. - * @return the VirtualNetworkListUsageResult object itself. - */ - public VirtualNetworkListUsageResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualNetworkPeeringListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualNetworkPeeringListResult.java deleted file mode 100644 index cdef77e0fcb3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualNetworkPeeringListResult.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.VirtualNetworkPeeringInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Response for ListSubnets API service call. Retrieves all subnets that belong to a virtual network. */ -@Fluent -public final class VirtualNetworkPeeringListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkPeeringListResult.class); - - /* - * The peerings in a virtual network. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to get the next set of results. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: The peerings in a virtual network. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The peerings in a virtual network. - * - * @param value the value value to set. - * @return the VirtualNetworkPeeringListResult object itself. - */ - public VirtualNetworkPeeringListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to get the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The URL to get the next set of results. - * - * @param nextLink the nextLink value to set. - * @return the VirtualNetworkPeeringListResult object itself. - */ - public VirtualNetworkPeeringListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualNetworkPeeringState.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualNetworkPeeringState.java deleted file mode 100644 index 4a464a696b7b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualNetworkPeeringState.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for VirtualNetworkPeeringState. */ -public final class VirtualNetworkPeeringState extends ExpandableStringEnum { - /** Static value Initiated for VirtualNetworkPeeringState. */ - public static final VirtualNetworkPeeringState INITIATED = fromString("Initiated"); - - /** Static value Connected for VirtualNetworkPeeringState. */ - public static final VirtualNetworkPeeringState CONNECTED = fromString("Connected"); - - /** Static value Disconnected for VirtualNetworkPeeringState. */ - public static final VirtualNetworkPeeringState DISCONNECTED = fromString("Disconnected"); - - /** - * Creates or finds a VirtualNetworkPeeringState from its string representation. - * - * @param name a name to look for. - * @return the corresponding VirtualNetworkPeeringState. - */ - @JsonCreator - public static VirtualNetworkPeeringState fromString(String name) { - return fromString(name, VirtualNetworkPeeringState.class); - } - - /** @return known VirtualNetworkPeeringState values. */ - public static Collection values() { - return values(VirtualNetworkPeeringState.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualNetworkTapListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualNetworkTapListResult.java deleted file mode 100644 index 2d1d68b566fc..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualNetworkTapListResult.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.VirtualNetworkTapInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Response for ListVirtualNetworkTap API service call. */ -@Fluent -public final class VirtualNetworkTapListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkTapListResult.class); - - /* - * A list of VirtualNetworkTaps in a resource group. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to get the next set of results. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: A list of VirtualNetworkTaps in a resource group. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: A list of VirtualNetworkTaps in a resource group. - * - * @param value the value value to set. - * @return the VirtualNetworkTapListResult object itself. - */ - public VirtualNetworkTapListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to get the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The URL to get the next set of results. - * - * @param nextLink the nextLink value to set. - * @return the VirtualNetworkTapListResult object itself. - */ - public VirtualNetworkTapListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualNetworkUsageName.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualNetworkUsageName.java deleted file mode 100644 index ccaf7c6bd33d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualNetworkUsageName.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Usage strings container. */ -@Immutable -public final class VirtualNetworkUsageName { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkUsageName.class); - - /* - * Localized subnet size and usage string. - */ - @JsonProperty(value = "localizedValue", access = JsonProperty.Access.WRITE_ONLY) - private String localizedValue; - - /* - * Subnet size and usage string. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private String value; - - /** - * Get the localizedValue property: Localized subnet size and usage string. - * - * @return the localizedValue value. - */ - public String localizedValue() { - return this.localizedValue; - } - - /** - * Get the value property: Subnet size and usage string. - * - * @return the value value. - */ - public String value() { - return this.value; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualWanSecurityProvider.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualWanSecurityProvider.java deleted file mode 100644 index f7b585a91452..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualWanSecurityProvider.java +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Collection of SecurityProviders. */ -@Fluent -public final class VirtualWanSecurityProvider { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualWanSecurityProvider.class); - - /* - * Name of the security provider. - */ - @JsonProperty(value = "name") - private String name; - - /* - * Url of the security provider. - */ - @JsonProperty(value = "url") - private String url; - - /* - * Name of the security provider. - */ - @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) - private VirtualWanSecurityProviderType type; - - /** - * Get the name property: Name of the security provider. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Name of the security provider. - * - * @param name the name value to set. - * @return the VirtualWanSecurityProvider object itself. - */ - public VirtualWanSecurityProvider withName(String name) { - this.name = name; - return this; - } - - /** - * Get the url property: Url of the security provider. - * - * @return the url value. - */ - public String url() { - return this.url; - } - - /** - * Set the url property: Url of the security provider. - * - * @param url the url value to set. - * @return the VirtualWanSecurityProvider object itself. - */ - public VirtualWanSecurityProvider withUrl(String url) { - this.url = url; - return this; - } - - /** - * Get the type property: Name of the security provider. - * - * @return the type value. - */ - public VirtualWanSecurityProviderType type() { - return this.type; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualWanSecurityProviderType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualWanSecurityProviderType.java deleted file mode 100644 index e765eb43d327..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VirtualWanSecurityProviderType.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for VirtualWanSecurityProviderType. */ -public final class VirtualWanSecurityProviderType extends ExpandableStringEnum { - /** Static value External for VirtualWanSecurityProviderType. */ - public static final VirtualWanSecurityProviderType EXTERNAL = fromString("External"); - - /** Static value Native for VirtualWanSecurityProviderType. */ - public static final VirtualWanSecurityProviderType NATIVE = fromString("Native"); - - /** - * Creates or finds a VirtualWanSecurityProviderType from its string representation. - * - * @param name a name to look for. - * @return the corresponding VirtualWanSecurityProviderType. - */ - @JsonCreator - public static VirtualWanSecurityProviderType fromString(String name) { - return fromString(name, VirtualWanSecurityProviderType.class); - } - - /** @return known VirtualWanSecurityProviderType values. */ - public static Collection values() { - return values(VirtualWanSecurityProviderType.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VpnClientConfiguration.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VpnClientConfiguration.java deleted file mode 100644 index a0d2087ba389..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VpnClientConfiguration.java +++ /dev/null @@ -1,230 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** VpnClientConfiguration for P2S client. */ -@Fluent -public final class VpnClientConfiguration { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnClientConfiguration.class); - - /* - * The reference of the address space resource which represents Address - * space for P2S VpnClient. - */ - @JsonProperty(value = "vpnClientAddressPool") - private AddressSpace vpnClientAddressPool; - - /* - * VpnClientRootCertificate for virtual network gateway. - */ - @JsonProperty(value = "vpnClientRootCertificates") - private List vpnClientRootCertificates; - - /* - * VpnClientRevokedCertificate for Virtual network gateway. - */ - @JsonProperty(value = "vpnClientRevokedCertificates") - private List vpnClientRevokedCertificates; - - /* - * VpnClientProtocols for Virtual network gateway. - */ - @JsonProperty(value = "vpnClientProtocols") - private List vpnClientProtocols; - - /* - * VpnClientIpsecPolicies for virtual network gateway P2S client. - */ - @JsonProperty(value = "vpnClientIpsecPolicies") - private List vpnClientIpsecPolicies; - - /* - * The radius server address property of the VirtualNetworkGateway resource - * for vpn client connection. - */ - @JsonProperty(value = "radiusServerAddress") - private String radiusServerAddress; - - /* - * The radius secret property of the VirtualNetworkGateway resource for vpn - * client connection. - */ - @JsonProperty(value = "radiusServerSecret") - private String radiusServerSecret; - - /** - * Get the vpnClientAddressPool property: The reference of the address space resource which represents Address space - * for P2S VpnClient. - * - * @return the vpnClientAddressPool value. - */ - public AddressSpace vpnClientAddressPool() { - return this.vpnClientAddressPool; - } - - /** - * Set the vpnClientAddressPool property: The reference of the address space resource which represents Address space - * for P2S VpnClient. - * - * @param vpnClientAddressPool the vpnClientAddressPool value to set. - * @return the VpnClientConfiguration object itself. - */ - public VpnClientConfiguration withVpnClientAddressPool(AddressSpace vpnClientAddressPool) { - this.vpnClientAddressPool = vpnClientAddressPool; - return this; - } - - /** - * Get the vpnClientRootCertificates property: VpnClientRootCertificate for virtual network gateway. - * - * @return the vpnClientRootCertificates value. - */ - public List vpnClientRootCertificates() { - return this.vpnClientRootCertificates; - } - - /** - * Set the vpnClientRootCertificates property: VpnClientRootCertificate for virtual network gateway. - * - * @param vpnClientRootCertificates the vpnClientRootCertificates value to set. - * @return the VpnClientConfiguration object itself. - */ - public VpnClientConfiguration withVpnClientRootCertificates( - List vpnClientRootCertificates) { - this.vpnClientRootCertificates = vpnClientRootCertificates; - return this; - } - - /** - * Get the vpnClientRevokedCertificates property: VpnClientRevokedCertificate for Virtual network gateway. - * - * @return the vpnClientRevokedCertificates value. - */ - public List vpnClientRevokedCertificates() { - return this.vpnClientRevokedCertificates; - } - - /** - * Set the vpnClientRevokedCertificates property: VpnClientRevokedCertificate for Virtual network gateway. - * - * @param vpnClientRevokedCertificates the vpnClientRevokedCertificates value to set. - * @return the VpnClientConfiguration object itself. - */ - public VpnClientConfiguration withVpnClientRevokedCertificates( - List vpnClientRevokedCertificates) { - this.vpnClientRevokedCertificates = vpnClientRevokedCertificates; - return this; - } - - /** - * Get the vpnClientProtocols property: VpnClientProtocols for Virtual network gateway. - * - * @return the vpnClientProtocols value. - */ - public List vpnClientProtocols() { - return this.vpnClientProtocols; - } - - /** - * Set the vpnClientProtocols property: VpnClientProtocols for Virtual network gateway. - * - * @param vpnClientProtocols the vpnClientProtocols value to set. - * @return the VpnClientConfiguration object itself. - */ - public VpnClientConfiguration withVpnClientProtocols(List vpnClientProtocols) { - this.vpnClientProtocols = vpnClientProtocols; - return this; - } - - /** - * Get the vpnClientIpsecPolicies property: VpnClientIpsecPolicies for virtual network gateway P2S client. - * - * @return the vpnClientIpsecPolicies value. - */ - public List vpnClientIpsecPolicies() { - return this.vpnClientIpsecPolicies; - } - - /** - * Set the vpnClientIpsecPolicies property: VpnClientIpsecPolicies for virtual network gateway P2S client. - * - * @param vpnClientIpsecPolicies the vpnClientIpsecPolicies value to set. - * @return the VpnClientConfiguration object itself. - */ - public VpnClientConfiguration withVpnClientIpsecPolicies(List vpnClientIpsecPolicies) { - this.vpnClientIpsecPolicies = vpnClientIpsecPolicies; - return this; - } - - /** - * Get the radiusServerAddress property: The radius server address property of the VirtualNetworkGateway resource - * for vpn client connection. - * - * @return the radiusServerAddress value. - */ - public String radiusServerAddress() { - return this.radiusServerAddress; - } - - /** - * Set the radiusServerAddress property: The radius server address property of the VirtualNetworkGateway resource - * for vpn client connection. - * - * @param radiusServerAddress the radiusServerAddress value to set. - * @return the VpnClientConfiguration object itself. - */ - public VpnClientConfiguration withRadiusServerAddress(String radiusServerAddress) { - this.radiusServerAddress = radiusServerAddress; - return this; - } - - /** - * Get the radiusServerSecret property: The radius secret property of the VirtualNetworkGateway resource for vpn - * client connection. - * - * @return the radiusServerSecret value. - */ - public String radiusServerSecret() { - return this.radiusServerSecret; - } - - /** - * Set the radiusServerSecret property: The radius secret property of the VirtualNetworkGateway resource for vpn - * client connection. - * - * @param radiusServerSecret the radiusServerSecret value to set. - * @return the VpnClientConfiguration object itself. - */ - public VpnClientConfiguration withRadiusServerSecret(String radiusServerSecret) { - this.radiusServerSecret = radiusServerSecret; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (vpnClientAddressPool() != null) { - vpnClientAddressPool().validate(); - } - if (vpnClientRootCertificates() != null) { - vpnClientRootCertificates().forEach(e -> e.validate()); - } - if (vpnClientRevokedCertificates() != null) { - vpnClientRevokedCertificates().forEach(e -> e.validate()); - } - if (vpnClientIpsecPolicies() != null) { - vpnClientIpsecPolicies().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VpnClientConnectionHealth.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VpnClientConnectionHealth.java deleted file mode 100644 index dddfcb03d8cd..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VpnClientConnectionHealth.java +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** VpnClientConnectionHealth properties. */ -@Fluent -public final class VpnClientConnectionHealth { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnClientConnectionHealth.class); - - /* - * Total of the Ingress Bytes Transferred in this P2S Vpn connection - */ - @JsonProperty(value = "totalIngressBytesTransferred", access = JsonProperty.Access.WRITE_ONLY) - private Long totalIngressBytesTransferred; - - /* - * Total of the Egress Bytes Transferred in this connection - */ - @JsonProperty(value = "totalEgressBytesTransferred", access = JsonProperty.Access.WRITE_ONLY) - private Long totalEgressBytesTransferred; - - /* - * The total of p2s vpn clients connected at this time to this - * P2SVpnGateway. - */ - @JsonProperty(value = "vpnClientConnectionsCount") - private Integer vpnClientConnectionsCount; - - /* - * List of allocated ip addresses to the connected p2s vpn clients. - */ - @JsonProperty(value = "allocatedIpAddresses") - private List allocatedIpAddresses; - - /** - * Get the totalIngressBytesTransferred property: Total of the Ingress Bytes Transferred in this P2S Vpn connection. - * - * @return the totalIngressBytesTransferred value. - */ - public Long totalIngressBytesTransferred() { - return this.totalIngressBytesTransferred; - } - - /** - * Get the totalEgressBytesTransferred property: Total of the Egress Bytes Transferred in this connection. - * - * @return the totalEgressBytesTransferred value. - */ - public Long totalEgressBytesTransferred() { - return this.totalEgressBytesTransferred; - } - - /** - * Get the vpnClientConnectionsCount property: The total of p2s vpn clients connected at this time to this - * P2SVpnGateway. - * - * @return the vpnClientConnectionsCount value. - */ - public Integer vpnClientConnectionsCount() { - return this.vpnClientConnectionsCount; - } - - /** - * Set the vpnClientConnectionsCount property: The total of p2s vpn clients connected at this time to this - * P2SVpnGateway. - * - * @param vpnClientConnectionsCount the vpnClientConnectionsCount value to set. - * @return the VpnClientConnectionHealth object itself. - */ - public VpnClientConnectionHealth withVpnClientConnectionsCount(Integer vpnClientConnectionsCount) { - this.vpnClientConnectionsCount = vpnClientConnectionsCount; - return this; - } - - /** - * Get the allocatedIpAddresses property: List of allocated ip addresses to the connected p2s vpn clients. - * - * @return the allocatedIpAddresses value. - */ - public List allocatedIpAddresses() { - return this.allocatedIpAddresses; - } - - /** - * Set the allocatedIpAddresses property: List of allocated ip addresses to the connected p2s vpn clients. - * - * @param allocatedIpAddresses the allocatedIpAddresses value to set. - * @return the VpnClientConnectionHealth object itself. - */ - public VpnClientConnectionHealth withAllocatedIpAddresses(List allocatedIpAddresses) { - this.allocatedIpAddresses = allocatedIpAddresses; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VpnClientParameters.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VpnClientParameters.java deleted file mode 100644 index 2ae5216563ca..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VpnClientParameters.java +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Vpn Client Parameters for package generation. */ -@Fluent -public final class VpnClientParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnClientParameters.class); - - /* - * VPN client Processor Architecture. Possible values are: 'AMD64' and - * 'X86'. - */ - @JsonProperty(value = "processorArchitecture") - private ProcessorArchitecture processorArchitecture; - - /* - * VPN client Authentication Method. Possible values are: 'EAPTLS' and - * 'EAPMSCHAPv2'. - */ - @JsonProperty(value = "authenticationMethod") - private AuthenticationMethod authenticationMethod; - - /* - * The public certificate data for the radius server authentication - * certificate as a Base-64 encoded string. Required only if external - * radius authentication has been configured with EAPTLS authentication. - */ - @JsonProperty(value = "radiusServerAuthCertificate") - private String radiusServerAuthCertificate; - - /* - * A list of client root certificates public certificate data encoded as - * Base-64 strings. Optional parameter for external radius based - * authentication with EAPTLS. - */ - @JsonProperty(value = "clientRootCertificates") - private List clientRootCertificates; - - /** - * Get the processorArchitecture property: VPN client Processor Architecture. Possible values are: 'AMD64' and - * 'X86'. - * - * @return the processorArchitecture value. - */ - public ProcessorArchitecture processorArchitecture() { - return this.processorArchitecture; - } - - /** - * Set the processorArchitecture property: VPN client Processor Architecture. Possible values are: 'AMD64' and - * 'X86'. - * - * @param processorArchitecture the processorArchitecture value to set. - * @return the VpnClientParameters object itself. - */ - public VpnClientParameters withProcessorArchitecture(ProcessorArchitecture processorArchitecture) { - this.processorArchitecture = processorArchitecture; - return this; - } - - /** - * Get the authenticationMethod property: VPN client Authentication Method. Possible values are: 'EAPTLS' and - * 'EAPMSCHAPv2'. - * - * @return the authenticationMethod value. - */ - public AuthenticationMethod authenticationMethod() { - return this.authenticationMethod; - } - - /** - * Set the authenticationMethod property: VPN client Authentication Method. Possible values are: 'EAPTLS' and - * 'EAPMSCHAPv2'. - * - * @param authenticationMethod the authenticationMethod value to set. - * @return the VpnClientParameters object itself. - */ - public VpnClientParameters withAuthenticationMethod(AuthenticationMethod authenticationMethod) { - this.authenticationMethod = authenticationMethod; - return this; - } - - /** - * Get the radiusServerAuthCertificate property: The public certificate data for the radius server authentication - * certificate as a Base-64 encoded string. Required only if external radius authentication has been configured with - * EAPTLS authentication. - * - * @return the radiusServerAuthCertificate value. - */ - public String radiusServerAuthCertificate() { - return this.radiusServerAuthCertificate; - } - - /** - * Set the radiusServerAuthCertificate property: The public certificate data for the radius server authentication - * certificate as a Base-64 encoded string. Required only if external radius authentication has been configured with - * EAPTLS authentication. - * - * @param radiusServerAuthCertificate the radiusServerAuthCertificate value to set. - * @return the VpnClientParameters object itself. - */ - public VpnClientParameters withRadiusServerAuthCertificate(String radiusServerAuthCertificate) { - this.radiusServerAuthCertificate = radiusServerAuthCertificate; - return this; - } - - /** - * Get the clientRootCertificates property: A list of client root certificates public certificate data encoded as - * Base-64 strings. Optional parameter for external radius based authentication with EAPTLS. - * - * @return the clientRootCertificates value. - */ - public List clientRootCertificates() { - return this.clientRootCertificates; - } - - /** - * Set the clientRootCertificates property: A list of client root certificates public certificate data encoded as - * Base-64 strings. Optional parameter for external radius based authentication with EAPTLS. - * - * @param clientRootCertificates the clientRootCertificates value to set. - * @return the VpnClientParameters object itself. - */ - public VpnClientParameters withClientRootCertificates(List clientRootCertificates) { - this.clientRootCertificates = clientRootCertificates; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VpnClientProtocol.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VpnClientProtocol.java deleted file mode 100644 index e3c5ad7fb5e9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VpnClientProtocol.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for VpnClientProtocol. */ -public final class VpnClientProtocol extends ExpandableStringEnum { - /** Static value IkeV2 for VpnClientProtocol. */ - public static final VpnClientProtocol IKE_V2 = fromString("IkeV2"); - - /** Static value SSTP for VpnClientProtocol. */ - public static final VpnClientProtocol SSTP = fromString("SSTP"); - - /** Static value OpenVPN for VpnClientProtocol. */ - public static final VpnClientProtocol OPEN_VPN = fromString("OpenVPN"); - - /** - * Creates or finds a VpnClientProtocol from its string representation. - * - * @param name a name to look for. - * @return the corresponding VpnClientProtocol. - */ - @JsonCreator - public static VpnClientProtocol fromString(String name) { - return fromString(name, VpnClientProtocol.class); - } - - /** @return known VpnClientProtocol values. */ - public static Collection values() { - return values(VpnClientProtocol.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VpnClientRevokedCertificate.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VpnClientRevokedCertificate.java deleted file mode 100644 index 326bf47ea1e6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VpnClientRevokedCertificate.java +++ /dev/null @@ -1,139 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.VpnClientRevokedCertificatePropertiesFormat; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** VPN client revoked certificate of virtual network gateway. */ -@Fluent -public final class VpnClientRevokedCertificate extends SubResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnClientRevokedCertificate.class); - - /* - * Properties of the vpn client revoked certificate. - */ - @JsonProperty(value = "properties") - private VpnClientRevokedCertificatePropertiesFormat innerProperties; - - /* - * The name of the resource that is unique within a resource group. This - * name can be used to access the resource. - */ - @JsonProperty(value = "name") - private String name; - - /* - * A unique read-only string that changes whenever the resource is updated. - */ - @JsonProperty(value = "etag") - private String etag; - - /** - * Get the innerProperties property: Properties of the vpn client revoked certificate. - * - * @return the innerProperties value. - */ - private VpnClientRevokedCertificatePropertiesFormat innerProperties() { - return this.innerProperties; - } - - /** - * Get the name property: The name of the resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @param name the name value to set. - * @return the VpnClientRevokedCertificate object itself. - */ - public VpnClientRevokedCertificate withName(String name) { - this.name = name; - return this; - } - - /** - * Get the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @param etag the etag value to set. - * @return the VpnClientRevokedCertificate object itself. - */ - public VpnClientRevokedCertificate withEtag(String etag) { - this.etag = etag; - return this; - } - - /** {@inheritDoc} */ - @Override - public VpnClientRevokedCertificate withId(String id) { - super.withId(id); - return this; - } - - /** - * Get the thumbprint property: The revoked VPN client certificate thumbprint. - * - * @return the thumbprint value. - */ - public String thumbprint() { - return this.innerProperties() == null ? null : this.innerProperties().thumbprint(); - } - - /** - * Set the thumbprint property: The revoked VPN client certificate thumbprint. - * - * @param thumbprint the thumbprint value to set. - * @return the VpnClientRevokedCertificate object itself. - */ - public VpnClientRevokedCertificate withThumbprint(String thumbprint) { - if (this.innerProperties() == null) { - this.innerProperties = new VpnClientRevokedCertificatePropertiesFormat(); - } - this.innerProperties().withThumbprint(thumbprint); - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the VPN client revoked certificate resource. - * Possible values are: 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VpnClientRootCertificate.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VpnClientRootCertificate.java deleted file mode 100644 index da00044c8680..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VpnClientRootCertificate.java +++ /dev/null @@ -1,144 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.network.fluent.models.VpnClientRootCertificatePropertiesFormat; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** VPN client root certificate of virtual network gateway. */ -@Fluent -public final class VpnClientRootCertificate extends SubResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnClientRootCertificate.class); - - /* - * Properties of the vpn client root certificate. - */ - @JsonProperty(value = "properties", required = true) - private VpnClientRootCertificatePropertiesFormat innerProperties = new VpnClientRootCertificatePropertiesFormat(); - - /* - * The name of the resource that is unique within a resource group. This - * name can be used to access the resource. - */ - @JsonProperty(value = "name") - private String name; - - /* - * A unique read-only string that changes whenever the resource is updated. - */ - @JsonProperty(value = "etag") - private String etag; - - /** - * Get the innerProperties property: Properties of the vpn client root certificate. - * - * @return the innerProperties value. - */ - private VpnClientRootCertificatePropertiesFormat innerProperties() { - return this.innerProperties; - } - - /** - * Get the name property: The name of the resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @param name the name value to set. - * @return the VpnClientRootCertificate object itself. - */ - public VpnClientRootCertificate withName(String name) { - this.name = name; - return this; - } - - /** - * Get the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @param etag the etag value to set. - * @return the VpnClientRootCertificate object itself. - */ - public VpnClientRootCertificate withEtag(String etag) { - this.etag = etag; - return this; - } - - /** {@inheritDoc} */ - @Override - public VpnClientRootCertificate withId(String id) { - super.withId(id); - return this; - } - - /** - * Get the publicCertData property: The certificate public data. - * - * @return the publicCertData value. - */ - public String publicCertData() { - return this.innerProperties() == null ? null : this.innerProperties().publicCertData(); - } - - /** - * Set the publicCertData property: The certificate public data. - * - * @param publicCertData the publicCertData value to set. - * @return the VpnClientRootCertificate object itself. - */ - public VpnClientRootCertificate withPublicCertData(String publicCertData) { - if (this.innerProperties() == null) { - this.innerProperties = new VpnClientRootCertificatePropertiesFormat(); - } - this.innerProperties().withPublicCertData(publicCertData); - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the VPN client root certificate resource. Possible - * values are: 'Updating', 'Deleting', and 'Failed'. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property innerProperties in model VpnClientRootCertificate")); - } else { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VpnConnectionStatus.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VpnConnectionStatus.java deleted file mode 100644 index 1501a61b350e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VpnConnectionStatus.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for VpnConnectionStatus. */ -public final class VpnConnectionStatus extends ExpandableStringEnum { - /** Static value Unknown for VpnConnectionStatus. */ - public static final VpnConnectionStatus UNKNOWN = fromString("Unknown"); - - /** Static value Connecting for VpnConnectionStatus. */ - public static final VpnConnectionStatus CONNECTING = fromString("Connecting"); - - /** Static value Connected for VpnConnectionStatus. */ - public static final VpnConnectionStatus CONNECTED = fromString("Connected"); - - /** Static value NotConnected for VpnConnectionStatus. */ - public static final VpnConnectionStatus NOT_CONNECTED = fromString("NotConnected"); - - /** - * Creates or finds a VpnConnectionStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding VpnConnectionStatus. - */ - @JsonCreator - public static VpnConnectionStatus fromString(String name) { - return fromString(name, VpnConnectionStatus.class); - } - - /** @return known VpnConnectionStatus values. */ - public static Collection values() { - return values(VpnConnectionStatus.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VpnDeviceScriptParameters.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VpnDeviceScriptParameters.java deleted file mode 100644 index 54737d6cc701..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VpnDeviceScriptParameters.java +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Vpn device configuration script generation parameters. */ -@Fluent -public final class VpnDeviceScriptParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnDeviceScriptParameters.class); - - /* - * The vendor for the vpn device. - */ - @JsonProperty(value = "vendor") - private String vendor; - - /* - * The device family for the vpn device. - */ - @JsonProperty(value = "deviceFamily") - private String deviceFamily; - - /* - * The firmware version for the vpn device. - */ - @JsonProperty(value = "firmwareVersion") - private String firmwareVersion; - - /** - * Get the vendor property: The vendor for the vpn device. - * - * @return the vendor value. - */ - public String vendor() { - return this.vendor; - } - - /** - * Set the vendor property: The vendor for the vpn device. - * - * @param vendor the vendor value to set. - * @return the VpnDeviceScriptParameters object itself. - */ - public VpnDeviceScriptParameters withVendor(String vendor) { - this.vendor = vendor; - return this; - } - - /** - * Get the deviceFamily property: The device family for the vpn device. - * - * @return the deviceFamily value. - */ - public String deviceFamily() { - return this.deviceFamily; - } - - /** - * Set the deviceFamily property: The device family for the vpn device. - * - * @param deviceFamily the deviceFamily value to set. - * @return the VpnDeviceScriptParameters object itself. - */ - public VpnDeviceScriptParameters withDeviceFamily(String deviceFamily) { - this.deviceFamily = deviceFamily; - return this; - } - - /** - * Get the firmwareVersion property: The firmware version for the vpn device. - * - * @return the firmwareVersion value. - */ - public String firmwareVersion() { - return this.firmwareVersion; - } - - /** - * Set the firmwareVersion property: The firmware version for the vpn device. - * - * @param firmwareVersion the firmwareVersion value to set. - * @return the VpnDeviceScriptParameters object itself. - */ - public VpnDeviceScriptParameters withFirmwareVersion(String firmwareVersion) { - this.firmwareVersion = firmwareVersion; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VpnGatewayTunnelingProtocol.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VpnGatewayTunnelingProtocol.java deleted file mode 100644 index 12e9e886938c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VpnGatewayTunnelingProtocol.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for VpnGatewayTunnelingProtocol. */ -public final class VpnGatewayTunnelingProtocol extends ExpandableStringEnum { - /** Static value IkeV2 for VpnGatewayTunnelingProtocol. */ - public static final VpnGatewayTunnelingProtocol IKE_V2 = fromString("IkeV2"); - - /** Static value OpenVPN for VpnGatewayTunnelingProtocol. */ - public static final VpnGatewayTunnelingProtocol OPEN_VPN = fromString("OpenVPN"); - - /** - * Creates or finds a VpnGatewayTunnelingProtocol from its string representation. - * - * @param name a name to look for. - * @return the corresponding VpnGatewayTunnelingProtocol. - */ - @JsonCreator - public static VpnGatewayTunnelingProtocol fromString(String name) { - return fromString(name, VpnGatewayTunnelingProtocol.class); - } - - /** @return known VpnGatewayTunnelingProtocol values. */ - public static Collection values() { - return values(VpnGatewayTunnelingProtocol.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VpnType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VpnType.java deleted file mode 100644 index e44a23e3a104..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/VpnType.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for VpnType. */ -public final class VpnType extends ExpandableStringEnum { - /** Static value PolicyBased for VpnType. */ - public static final VpnType POLICY_BASED = fromString("PolicyBased"); - - /** Static value RouteBased for VpnType. */ - public static final VpnType ROUTE_BASED = fromString("RouteBased"); - - /** - * Creates or finds a VpnType from its string representation. - * - * @param name a name to look for. - * @return the corresponding VpnType. - */ - @JsonCreator - public static VpnType fromString(String name) { - return fromString(name, VpnType.class); - } - - /** @return known VpnType values. */ - public static Collection values() { - return values(VpnType.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/package-info.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/package-info.java deleted file mode 100644 index c4fc0c8f773c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** Package containing the data models for NetworkManagementClient. Network Client. */ -package com.azure.resourcemanager.network.models; diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/package-info.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/package-info.java deleted file mode 100644 index 3b919a5fa768..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** Package containing the classes for NetworkManagementClient. Network Client. */ -package com.azure.resourcemanager.network; diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/module-info.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/module-info.java deleted file mode 100644 index b321030b467f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/module-info.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -module com.azure.resourcemanager.network { - requires transitive com.azure.resourcemanager.resources; - - // export public APIs of network - exports com.azure.resourcemanager.network; - exports com.azure.resourcemanager.network.fluent; - exports com.azure.resourcemanager.network.fluent.models; - exports com.azure.resourcemanager.network.models; - - // open packages specifically for azure core and jackson - opens com.azure.resourcemanager.network.fluent.models to - com.azure.core, - com.fasterxml.jackson.databind; - opens com.azure.resourcemanager.network.models to - com.azure.core, - com.fasterxml.jackson.databind; -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/samples/java/com/azure/resourcemanager/network/ReadmeSamples.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/samples/java/com/azure/resourcemanager/network/ReadmeSamples.java deleted file mode 100644 index ab72580155a1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/samples/java/com/azure/resourcemanager/network/ReadmeSamples.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.network; - -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpMethod; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.util.serializer.JacksonAdapter; -import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.identity.DefaultAzureCredentialBuilder; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.ArrayNode; - -import java.io.IOException; -import java.util.HashMap; - -public class ReadmeSamples { - - public void authenticate() { - // BEGIN: com.azure.resourcemanager.network.authenticate - String armEndpoint = "https://management.."; - AzureProfile profile = new AzureProfile(getAzureEnvironmentFromArmEndpoint(armEndpoint)); - TokenCredential credential = new DefaultAzureCredentialBuilder() - .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) - .build(); - NetworkManager manager = NetworkManager - .authenticate(credential, profile); - // END: com.azure.resourcemanager.network.authenticate - } - - // BEGIN: com.azure.resourcemanager.network.getazureenvironment - private static AzureEnvironment getAzureEnvironmentFromArmEndpoint(String armEndpoint) { - // Create HTTP client and request - HttpClient httpClient = HttpClient.createDefault(); - - HttpRequest request = new HttpRequest(HttpMethod.GET, - String.format("%s/metadata/endpoints?api-version=2019-10-01", armEndpoint)) - .setHeader("accept", "application/json"); - - // Execute the request and read the response - HttpResponse response = httpClient.send(request).block(); - if (response.getStatusCode() != 200) { - throw new RuntimeException("Failed : HTTP error code : " + response.getStatusCode()); - } - String body = response.getBodyAsString().block(); - try { - ArrayNode metadataArray = JacksonAdapter.createDefaultSerializerAdapter() - .deserialize(body, ArrayNode.class, SerializerEncoding.JSON); - - if (metadataArray == null || metadataArray.isEmpty()) { - throw new RuntimeException("Failed to find metadata : " + body); - } - - JsonNode metadata = metadataArray.iterator().next(); - AzureEnvironment azureEnvironment = new AzureEnvironment(new HashMap() { - { - put("managementEndpointUrl", metadata.at("/authentication/audiences/0").asText()); - put("resourceManagerEndpointUrl", armEndpoint); - put("galleryEndpointUrl", metadata.at("/gallery").asText()); - put("activeDirectoryEndpointUrl", metadata.at("/authentication/loginEndpoint").asText()); - put("activeDirectoryResourceId", metadata.at("/authentication/audiences/0").asText()); - put("activeDirectoryGraphResourceId", metadata.at("/graph").asText()); - put("storageEndpointSuffix", "." + metadata.at("/suffixes/storage").asText()); - put("keyVaultDnsSuffix", "." + metadata.at("/suffixes/keyVaultDns").asText()); - } - }); - return azureEnvironment; - } catch (IOException ioe) { - ioe.printStackTrace(); - throw new RuntimeException(ioe); - } - } - // END: com.azure.resourcemanager.network.getazureenvironment -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/test/java/com/azure/resourcemanager/network/ApplicationGatewayTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/test/java/com/azure/resourcemanager/network/ApplicationGatewayTests.java deleted file mode 100644 index e8c4a6ae2c23..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/test/java/com/azure/resourcemanager/network/ApplicationGatewayTests.java +++ /dev/null @@ -1,358 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.network; - -import com.azure.core.test.annotation.DoNotRecord; -import com.azure.core.util.serializer.JacksonAdapter; -import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.resourcemanager.keyvault.models.Secret; -import com.azure.resourcemanager.keyvault.models.Vault; -import com.azure.resourcemanager.msi.models.Identity; -import com.azure.resourcemanager.network.models.ApplicationGateway; -import com.azure.resourcemanager.network.models.ApplicationGatewayFirewallDisabledRuleGroup; -import com.azure.resourcemanager.network.models.ApplicationGatewayFirewallExclusion; -import com.azure.resourcemanager.network.models.ApplicationGatewayFirewallMode; -import com.azure.resourcemanager.network.models.ApplicationGatewaySkuName; -import com.azure.resourcemanager.network.models.ApplicationGatewayTier; -import com.azure.resourcemanager.network.models.ApplicationGatewayWebApplicationFirewallConfiguration; -import com.azure.resourcemanager.network.models.ManagedServiceIdentity; -import com.azure.resourcemanager.network.models.ManagedServiceIdentityUserAssignedIdentities; -import com.azure.resourcemanager.network.models.PublicIPSkuType; -import com.azure.resourcemanager.network.models.PublicIpAddress; -import com.azure.resourcemanager.network.models.ResourceIdentityType; -import com.azure.core.management.Region; -import com.azure.security.keyvault.certificates.CertificateClient; -import com.azure.security.keyvault.certificates.CertificateClientBuilder; -import com.azure.security.keyvault.certificates.models.CertificatePolicy; -import com.azure.security.keyvault.certificates.models.KeyVaultCertificateWithPolicy; - -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.ObjectNode; - -import java.io.BufferedReader; -import java.io.File; -import java.io.FileReader; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public class ApplicationGatewayTests extends NetworkManagementTest { - - @Test - public void canCRUDApplicationGatewayWithWAF() throws Exception { - String appGatewayName = generateRandomResourceName("agwaf", 15); - String appPublicIp = generateRandomResourceName("pip", 15); - - PublicIpAddress pip = - networkManager - .publicIpAddresses() - .define(appPublicIp) - .withRegion(locationOrDefault(Region.US_EAST)) - .withNewResourceGroup(rgName) - .withSku(PublicIPSkuType.STANDARD) - .withStaticIP() - .create(); - - ApplicationGateway appGateway = - networkManager - .applicationGateways() - .define(appGatewayName) - .withRegion(locationOrDefault(Region.US_EAST)) - .withExistingResourceGroup(rgName) - // Request routing rules - .defineRequestRoutingRule("rule1") - .fromPublicFrontend() - .fromFrontendHttpPort(80) - .toBackendHttpPort(8080) - .toBackendIPAddress("11.1.1.1") - .toBackendIPAddress("11.1.1.2") - .attach() - .withExistingPublicIpAddress(pip) - .withTier(ApplicationGatewayTier.WAF_V2) - .withSize(ApplicationGatewaySkuName.WAF_V2) - .withAutoScale(2, 5) - .withWebApplicationFirewall(true, ApplicationGatewayFirewallMode.PREVENTION) - .create(); - - Assertions.assertTrue(appGateway != null); - Assertions.assertTrue(ApplicationGatewayTier.WAF_V2.equals(appGateway.tier())); - Assertions.assertTrue(ApplicationGatewaySkuName.WAF_V2.equals(appGateway.size())); - Assertions.assertTrue(appGateway.autoscaleConfiguration().minCapacity() == 2); - Assertions.assertTrue(appGateway.autoscaleConfiguration().maxCapacity() == 5); - - ApplicationGatewayWebApplicationFirewallConfiguration config = appGateway.webApplicationFirewallConfiguration(); - config.withFileUploadLimitInMb(200); - config - .withDisabledRuleGroups( - Arrays - .asList( - new ApplicationGatewayFirewallDisabledRuleGroup() - .withRuleGroupName("REQUEST-943-APPLICATION-ATTACK-SESSION-FIXATION"))); - config.withRequestBodyCheck(true); - config.withMaxRequestBodySizeInKb(64); - config - .withExclusions( - Arrays - .asList( - new ApplicationGatewayFirewallExclusion() - .withMatchVariable("RequestHeaderNames") - .withSelectorMatchOperator("StartsWith") - .withSelector("User-Agent"))); - appGateway.update().withWebApplicationFirewall(config).apply(); - - appGateway.refresh(); - - // Verify WAF - Assertions.assertTrue(appGateway.webApplicationFirewallConfiguration().fileUploadLimitInMb() == 200); - Assertions.assertTrue(appGateway.webApplicationFirewallConfiguration().requestBodyCheck()); - Assertions - .assertEquals(appGateway.webApplicationFirewallConfiguration().maxRequestBodySizeInKb(), (Integer) 64); - - Assertions.assertEquals(appGateway.webApplicationFirewallConfiguration().exclusions().size(), 1); - - Assertions - .assertEquals( - appGateway.webApplicationFirewallConfiguration().exclusions().get(0).matchVariable(), - "RequestHeaderNames"); - Assertions - .assertEquals( - appGateway.webApplicationFirewallConfiguration().exclusions().get(0).selectorMatchOperator(), - "StartsWith"); - Assertions - .assertEquals( - appGateway.webApplicationFirewallConfiguration().exclusions().get(0).selector(), "User-Agent"); - - Assertions.assertEquals(appGateway.webApplicationFirewallConfiguration().disabledRuleGroups().size(), 1); - Assertions - .assertEquals( - appGateway.webApplicationFirewallConfiguration().disabledRuleGroups().get(0).ruleGroupName(), - "REQUEST-943-APPLICATION-ATTACK-SESSION-FIXATION"); - } - - @Test - @Disabled("Need client id for key vault usage") - public void canCreateApplicationGatewayWithSecret() throws Exception { - String appGatewayName = generateRandomResourceName("agwaf", 15); - String appPublicIp = generateRandomResourceName("pip", 15); - String identityName = generateRandomResourceName("id", 10); - - PublicIpAddress pip = - networkManager - .publicIpAddresses() - .define(appPublicIp) - .withRegion(locationOrDefault(Region.US_EAST)) - .withNewResourceGroup(rgName) - .withSku(PublicIPSkuType.STANDARD) - .withStaticIP() - .create(); - - Identity identity = - msiManager - .identities() - .define(identityName) - .withRegion(locationOrDefault(Region.US_EAST)) - .withExistingResourceGroup(rgName) - .create(); - - Assertions.assertNotNull(identity.name()); - Assertions.assertNotNull(identity.principalId()); - - Secret secret1 = createKeyVaultSecret(clientIdFromFile(), identity.principalId()); - Secret secret2 = createKeyVaultSecret(clientIdFromFile(), identity.principalId()); - - ManagedServiceIdentity serviceIdentity = createManagedServiceIdentityFromIdentity(identity); - - ApplicationGateway appGateway = - networkManager - .applicationGateways() - .define(appGatewayName) - .withRegion(locationOrDefault(Region.US_EAST)) - .withExistingResourceGroup(rgName) - // Request routing rules - .defineRequestRoutingRule("rule1") - .fromPublicFrontend() - .fromFrontendHttpsPort(443) - .withSslCertificate("ssl1") - .toBackendHttpPort(8080) - .toBackendIPAddress("11.1.1.1") - .toBackendIPAddress("11.1.1.2") - .attach() - .withIdentity(serviceIdentity) - .defineSslCertificate("ssl1") - .withKeyVaultSecretId(secret1.id()) - .attach() - .withExistingPublicIpAddress(pip) - .withTier(ApplicationGatewayTier.WAF_V2) - .withSize(ApplicationGatewaySkuName.WAF_V2) - .withAutoScale(2, 5) - .withWebApplicationFirewall(true, ApplicationGatewayFirewallMode.PREVENTION) - .create(); - - Assertions.assertEquals(secret1.id(), appGateway.sslCertificates().get("ssl1").keyVaultSecretId()); - Assertions - .assertEquals( - secret1.id(), appGateway.requestRoutingRules().get("rule1").sslCertificate().keyVaultSecretId()); - - appGateway = - appGateway.update().defineSslCertificate("ssl2").withKeyVaultSecretId(secret2.id()).attach().apply(); - - Assertions.assertEquals(secret2.id(), appGateway.sslCertificates().get("ssl2").keyVaultSecretId()); - } - - @Test - @DoNotRecord(skipInPlayback = true) - public void canCreateApplicationGatewayWithSslCertificate() throws Exception { - String appGatewayName = generateRandomResourceName("agwaf", 15); - String appPublicIp = generateRandomResourceName("pip", 15); - String identityName = generateRandomResourceName("id", 10); - - PublicIpAddress pip = - networkManager - .publicIpAddresses() - .define(appPublicIp) - .withRegion(locationOrDefault(Region.US_EAST)) - .withNewResourceGroup(rgName) - .withSku(PublicIPSkuType.STANDARD) - .withStaticIP() - .create(); - - Identity identity = - msiManager - .identities() - .define(identityName) - .withRegion(locationOrDefault(Region.US_EAST)) - .withExistingResourceGroup(rgName) - .create(); - - Assertions.assertNotNull(identity.name()); - Assertions.assertNotNull(identity.principalId()); - - ManagedServiceIdentity serviceIdentity = createManagedServiceIdentityFromIdentity(identity); - - String secretId = createKeyVaultCertificate(clientIdFromFile(), identity.principalId()); - - ApplicationGateway appGateway = - networkManager - .applicationGateways() - .define(appGatewayName) - .withRegion(locationOrDefault(Region.US_EAST)) - .withExistingResourceGroup(rgName) - // Request routing rules - .defineRequestRoutingRule("rule1") - .fromPublicFrontend() - .fromFrontendHttpsPort(443) - .withSslCertificate("ssl1") - .toBackendHttpPort(8080) - .toBackendIPAddress("11.1.1.1") - .toBackendIPAddress("11.1.1.2") - .attach() - .withIdentity(serviceIdentity) - .defineSslCertificate("ssl1") - .withKeyVaultSecretId(secretId) - .attach() - .withExistingPublicIpAddress(pip) - .withTier(ApplicationGatewayTier.WAF_V2) - .withSize(ApplicationGatewaySkuName.WAF_V2) - .withAutoScale(2, 5) - .withWebApplicationFirewall(true, ApplicationGatewayFirewallMode.PREVENTION) - .create(); - - Assertions.assertEquals(secretId, appGateway.sslCertificates().get("ssl1").keyVaultSecretId()); - Assertions.assertEquals(secretId, appGateway.requestRoutingRules().get("rule1").sslCertificate().keyVaultSecretId()); - } - - private String createKeyVaultCertificate(String servicePrincipal, String identityPrincipal) { - String vaultName = generateRandomResourceName("vlt", 10); - String secretName = generateRandomResourceName("srt", 10); - - Vault vault = - keyVaultManager - .vaults() - .define(vaultName) - .withRegion(locationOrDefault(Region.US_EAST)) - .withExistingResourceGroup(rgName) - .defineAccessPolicy() - .forServicePrincipal(servicePrincipal) - .allowSecretAllPermissions() - .allowCertificateAllPermissions() - .attach() - .defineAccessPolicy() - .forObjectId(identityPrincipal) - .allowSecretAllPermissions() - .attach() - .withAccessFromAzureServices() - .withDeploymentEnabled() -// // Important!! Only soft delete enabled key vault can be assigned to application gateway -// // See also: https://github.com/MicrosoftDocs/azure-docs/issues/34382 -// .withSoftDeleteEnabled() - .create(); - - // create certificate - CertificateClient certificateClient = new CertificateClientBuilder() - .vaultUrl(vault.vaultUri()) - .pipeline(vault.vaultHttpPipeline()) - .buildClient(); - KeyVaultCertificateWithPolicy certificate = certificateClient.beginCreateCertificate(secretName, CertificatePolicy.getDefault()).getFinalResult(); - - // take secret ID of the certificate - return certificate.getSecretId(); - } - - private Secret createKeyVaultSecret(String servicePrincipal, String identityPrincipal) throws Exception { - String vaultName = generateRandomResourceName("vlt", 10); - String secretName = generateRandomResourceName("srt", 10); - BufferedReader buff = new BufferedReader(new FileReader(new File(getClass().getClassLoader() - .getResource("test.certificate").getFile()))); - String secretValue = buff.readLine(); - - Vault vault = - keyVaultManager - .vaults() - .define(vaultName) - .withRegion(locationOrDefault(Region.US_EAST)) - .withExistingResourceGroup(rgName) - .defineAccessPolicy() - .forServicePrincipal(servicePrincipal) - .allowSecretAllPermissions() - .attach() - .defineAccessPolicy() - .forObjectId(identityPrincipal) - .allowSecretAllPermissions() - .attach() - .withAccessFromAzureServices() - .withDeploymentEnabled() -// // Important!! Only soft delete enabled key vault can be assigned to application gateway -// // See also: https://github.com/MicrosoftDocs/azure-docs/issues/34382 -// .withSoftDeleteEnabled() - .create(); - - return vault.secrets().define(secretName).withValue(secretValue).create(); - } - - private static ManagedServiceIdentity createManagedServiceIdentityFromIdentity(Identity identity) throws Exception { - ObjectMapper mapper = new ObjectMapper(); - JsonNode userAssignedIdentitiesValueObject = mapper.createObjectNode(); - ((ObjectNode) userAssignedIdentitiesValueObject).put("principalId", identity.principalId()); - ((ObjectNode) userAssignedIdentitiesValueObject).put("clientId", identity.clientId()); - ManagedServiceIdentityUserAssignedIdentities userAssignedIdentitiesValue = - new JacksonAdapter() - .deserialize( - mapper.writerWithDefaultPrettyPrinter().writeValueAsString(userAssignedIdentitiesValueObject), - ManagedServiceIdentityUserAssignedIdentities.class, - SerializerEncoding.JSON); - - Map userAssignedIdentities = new HashMap<>(); - userAssignedIdentities.put(identity.id(), userAssignedIdentitiesValue); - - ManagedServiceIdentity serviceIdentity = new ManagedServiceIdentity(); - serviceIdentity.withType(ResourceIdentityType.USER_ASSIGNED); - serviceIdentity.withUserAssignedIdentities(userAssignedIdentities); - return serviceIdentity; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/test/java/com/azure/resourcemanager/network/ApplicationSecurityGroupTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/test/java/com/azure/resourcemanager/network/ApplicationSecurityGroupTests.java deleted file mode 100644 index 0185458b7a73..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/test/java/com/azure/resourcemanager/network/ApplicationSecurityGroupTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.network; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.network.models.ApplicationSecurityGroup; -import com.azure.resourcemanager.test.utils.TestUtilities; -import com.azure.core.management.Region; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public class ApplicationSecurityGroupTests extends NetworkManagementTest { - - @Test - public void canCRUDApplicationSecurityGroup() throws Exception { - String asgName = generateRandomResourceName("asg", 15); - - ApplicationSecurityGroup applicationSecurityGroup = - networkManager - .applicationSecurityGroups() - .define(asgName) - .withRegion(locationOrDefault(Region.US_SOUTH_CENTRAL)) - .withNewResourceGroup(rgName) - .withTag("tag1", "value1") - .create(); - Assertions.assertEquals("value1", applicationSecurityGroup.tags().get("tag1")); - - PagedIterable asgList = networkManager.applicationSecurityGroups().list(); - Assertions.assertTrue(TestUtilities.getSize(asgList) > 0); - - asgList = networkManager.applicationSecurityGroups().listByResourceGroup(rgName); - Assertions.assertTrue(TestUtilities.getSize(asgList) > 0); - - networkManager.applicationSecurityGroups().deleteById(applicationSecurityGroup.id()); - asgList = networkManager.applicationSecurityGroups().listByResourceGroup(rgName); - Assertions.assertTrue(TestUtilities.isEmpty(asgList)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/test/java/com/azure/resourcemanager/network/DdosProtectionPlanTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/test/java/com/azure/resourcemanager/network/DdosProtectionPlanTests.java deleted file mode 100644 index 0d791ed5b55a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/test/java/com/azure/resourcemanager/network/DdosProtectionPlanTests.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.network.models.DdosProtectionPlan; -import com.azure.resourcemanager.test.utils.TestUtilities; -import com.azure.core.management.Region; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public class DdosProtectionPlanTests extends NetworkManagementTest { - - @Test - public void canCRUDDdosProtectionPlan() throws Exception { - String ppName = generateRandomResourceName("ddosplan", 15); - - DdosProtectionPlan pPlan = - networkManager - .ddosProtectionPlans() - .define(ppName) - .withRegion(locationOrDefault(Region.US_SOUTH_CENTRAL)) - .withNewResourceGroup(rgName) - .withTag("tag1", "value1") - .create(); - Assertions.assertEquals("value1", pPlan.tags().get("tag1")); - - PagedIterable ppList = networkManager.ddosProtectionPlans().list(); - Assertions.assertTrue(TestUtilities.getSize(ppList) > 0); - - ppList = networkManager.ddosProtectionPlans().listByResourceGroup(rgName); - Assertions.assertTrue(TestUtilities.getSize(ppList) > 0); - - networkManager.ddosProtectionPlans().deleteById(pPlan.id()); - ppList = networkManager.ddosProtectionPlans().listByResourceGroup(rgName); - Assertions.assertTrue(TestUtilities.isEmpty(ppList)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/test/java/com/azure/resourcemanager/network/LoadBalancerTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/test/java/com/azure/resourcemanager/network/LoadBalancerTests.java deleted file mode 100644 index 817b8cb7a423..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/test/java/com/azure/resourcemanager/network/LoadBalancerTests.java +++ /dev/null @@ -1,379 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network; - -import com.azure.core.management.Region; -import com.azure.resourcemanager.network.models.LoadBalancer; -import com.azure.resourcemanager.network.models.LoadBalancerFrontend; -import com.azure.resourcemanager.network.models.LoadBalancerHttpProbe; -import com.azure.resourcemanager.network.models.LoadBalancerOutboundRule; -import com.azure.resourcemanager.network.models.LoadBalancerPublicFrontend; -import com.azure.resourcemanager.network.models.LoadBalancerSkuType; -import com.azure.resourcemanager.network.models.Network; -import com.azure.resourcemanager.network.models.LoadBalancerOutboundRuleProtocol; -import com.azure.resourcemanager.network.models.ProbeProtocol; -import com.azure.resourcemanager.network.models.PublicIPSkuType; -import com.azure.resourcemanager.network.models.PublicIpAddress; -import com.azure.resourcemanager.network.models.TransportProtocol; -import com.azure.resourcemanager.resources.models.ResourceGroup; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -public class LoadBalancerTests extends NetworkManagementTest { - static final String SUBNET_NAME = "subnet1"; - static final String RULE_NAME_1 = "httpRule"; - static final String RULE_NAME_2 = "httpsRule"; - static final String PROBE_NAME_1 = "httpProbe"; - static final String PROBE_NAME_2 = "httpsProbe"; - - @Test - public void canCRUDProbe() throws Exception { - String vmName = generateRandomResourceName("vm", 8); - String lbName = generateRandomResourceName("lb", 8); - - ResourceGroup resourceGroup = - resourceManager.resourceGroups().define(rgName).withRegion(locationOrDefault(Region.US_EAST)).create(); - - Network network = - networkManager - .networks() - .define(vmName) - .withRegion(resourceGroup.region()) - .withExistingResourceGroup(resourceGroup.name()) - .withAddressSpace("172.18.0.0/28") - .withSubnet(SUBNET_NAME, "172.18.0.0/28") - .create(); - - LoadBalancer loadBalancer = createLoadBalancerWithPrivateFrontend(networkManager, resourceGroup, network, lbName); - - // verify created probes - Assertions.assertEquals(2, loadBalancer.loadBalancingRules().size()); - Assertions.assertEquals(0, loadBalancer.tcpProbes().size()); - Assertions.assertEquals(1, loadBalancer.httpProbes().size()); - Assertions.assertEquals(1, loadBalancer.httpsProbes().size()); - LoadBalancerHttpProbe httpProbe = loadBalancer.httpProbes().get(PROBE_NAME_1); - Assertions.assertNotNull(httpProbe); - Assertions.assertEquals(1, httpProbe.loadBalancingRules().size()); - LoadBalancerHttpProbe httpsProbe = loadBalancer.httpsProbes().get(PROBE_NAME_2); - Assertions.assertEquals(1, httpsProbe.loadBalancingRules().size()); - // verify https probe - Assertions.assertEquals(ProbeProtocol.HTTPS, httpsProbe.protocol()); - Assertions.assertEquals(443, httpsProbe.port()); - Assertions.assertEquals("/", httpsProbe.requestPath()); - - // update probe - loadBalancer - .update() - .updateHttpsProbe(PROBE_NAME_2) - .withIntervalInSeconds(60) - .withRequestPath("/health") - .parent() - .apply(); - - // verify probe updated - Assertions.assertEquals(1, loadBalancer.httpProbes().size()); - Assertions.assertEquals(1, loadBalancer.httpsProbes().size()); - Assertions.assertEquals(1, httpProbe.loadBalancingRules().size()); - httpsProbe = loadBalancer.httpsProbes().get(PROBE_NAME_2); - Assertions.assertEquals(1, httpsProbe.loadBalancingRules().size()); - Assertions.assertEquals(ProbeProtocol.HTTPS, httpsProbe.protocol()); - Assertions.assertEquals(443, httpsProbe.port()); - Assertions.assertEquals(60, httpsProbe.intervalInSeconds()); - Assertions.assertEquals("/health", httpsProbe.requestPath()); - - // delete probe - loadBalancer.update().withoutProbe(PROBE_NAME_2).apply(); - - // verify probe deleted (and deref from rule) - Assertions.assertEquals(1, loadBalancer.httpProbes().size()); - Assertions.assertEquals(0, loadBalancer.httpsProbes().size()); - Assertions.assertNull(loadBalancer.loadBalancingRules().get(RULE_NAME_2).probe()); - - // add probe - loadBalancer.update().defineHttpsProbe(PROBE_NAME_2).withRequestPath("/").attach().apply(); - - // verify probe added - loadBalancer.refresh(); - Assertions.assertEquals(1, loadBalancer.httpProbes().size()); - Assertions.assertEquals(1, loadBalancer.httpsProbes().size()); - httpsProbe = loadBalancer.httpsProbes().get(PROBE_NAME_2); - Assertions.assertEquals(0, httpsProbe.loadBalancingRules().size()); - } - - @Test - public void canCreateOutboundRule() { - String lbName = generateRandomResourceName("lb", 8); - - String frontendName1 = lbName + "-FE1"; - String frontendName2 = lbName + "-FE2"; - String backendPoolName = lbName + "-BAP1"; - String publicIpName1 = generateRandomResourceName("pip", 15); - String publicIpName2 = generateRandomResourceName("pip", 15); - String outboundRuleName = lbName + "-OutboundRule1"; - - ResourceGroup resourceGroup = - resourceManager.resourceGroups().define(rgName).withRegion(locationOrDefault(Region.US_EAST)).create(); - - LoadBalancer loadBalancer = createLoadBalancerWithPublicFrontendAndOutboundRule(networkManager, resourceGroup, lbName, frontendName1, frontendName2, backendPoolName, publicIpName1, publicIpName2, outboundRuleName); - - // assertions for loadbalancer properties - Assertions.assertEquals(lbName, loadBalancer.name()); - Assertions.assertEquals(1, loadBalancer.loadBalancingRules().size()); - Assertions.assertEquals(1, loadBalancer.httpProbes().size()); - - List frontends = new ArrayList<>(loadBalancer.frontends().values()); - Assertions.assertEquals(2, frontends.size()); - Assertions.assertEquals(frontendName1, frontends.get(0).name()); - Assertions.assertEquals(0, frontends.get(0).outboundRules().size()); - Assertions.assertEquals(true, frontends.get(0).isPublic()); - LoadBalancerPublicFrontend publicFrontend1 = (LoadBalancerPublicFrontend) frontends.get(0); - Assertions.assertNotNull(publicFrontend1.getPublicIpAddress()); - Assertions.assertEquals(publicIpName1, publicFrontend1.getPublicIpAddress().name()); - - Assertions.assertEquals(frontendName2, frontends.get(1).name()); - Assertions.assertEquals(1, frontends.get(1).outboundRules().size()); - Assertions.assertTrue(frontends.get(1).outboundRules().containsKey(outboundRuleName)); - Assertions.assertEquals(true, frontends.get(1).isPublic()); - LoadBalancerPublicFrontend publicFrontend2 = (LoadBalancerPublicFrontend) frontends.get(1); - Assertions.assertNotNull(publicFrontend2.getPublicIpAddress()); - Assertions.assertEquals(publicIpName2, publicFrontend2.getPublicIpAddress().name()); - - Assertions.assertEquals(1, loadBalancer.backends().size()); - Assertions.assertTrue(loadBalancer.backends().containsKey(backendPoolName)); - - // assertions for outbound rule - Map outboundRules = loadBalancer.outboundRules(); - Assertions.assertEquals(1, outboundRules.size()); - Assertions.assertTrue(outboundRules.containsKey(outboundRuleName)); - LoadBalancerOutboundRule outboundRule = outboundRules.get(outboundRuleName); - Assertions.assertEquals(outboundRuleName, outboundRule.name()); - Assertions.assertEquals(1024, outboundRule.allocatedOutboundPorts()); - Assertions.assertEquals(backendPoolName, outboundRule.backend().name()); - Assertions.assertEquals(5, outboundRule.idleTimeoutInMinutes()); - Assertions.assertEquals(false, outboundRule.tcpResetEnabled()); - - List outboundRuleFrontends = new ArrayList<>(outboundRule.frontends().values()); - Assertions.assertEquals(1, outboundRuleFrontends.size()); - Assertions.assertEquals(frontendName2, outboundRuleFrontends.get(0).name()); - Assertions.assertEquals(true, outboundRuleFrontends.get(0).isPublic()); - LoadBalancerPublicFrontend publicFrontend = (LoadBalancerPublicFrontend) outboundRuleFrontends.get(0); - Assertions.assertNotNull(publicFrontend.getPublicIpAddress()); - Assertions.assertEquals(publicIpName2, publicFrontend2.getPublicIpAddress().name()); - - } - - @Test - public void canUpdateOutboundRule() { - String lbName = generateRandomResourceName("lb", 8); - - String frontendName1 = lbName + "-FE1"; - String frontendName2 = lbName + "-FE2"; - String backendPoolName = lbName + "-BAP1"; - String publicIpName1 = generateRandomResourceName("pip", 15); - String publicIpName2 = generateRandomResourceName("pip", 15); - String outboundRuleName1 = lbName + "-OutboundRule1"; - String outboundRuleName2 = lbName + "-OutboundRule2"; - - ResourceGroup resourceGroup = - resourceManager.resourceGroups().define(rgName).withRegion(locationOrDefault(Region.US_EAST)).create(); - - - - LoadBalancer loadBalancer = createLoadBalancerWithPublicFrontendAndOutboundRule(networkManager, resourceGroup, lbName, frontendName1, frontendName2, backendPoolName, publicIpName1, publicIpName2, outboundRuleName1); - // 1. update loadbalancer, update outbound rule - loadBalancer - .update() - .updateOutboundRule(outboundRuleName1) - .withIdleTimeoutInMinutes(50) - .parent() - .apply(); - - Map outboundRules = loadBalancer.outboundRules(); - Assertions.assertEquals(1, outboundRules.size()); - Assertions.assertTrue(outboundRules.containsKey(outboundRuleName1)); - LoadBalancerOutboundRule outboundRule = outboundRules.get(outboundRuleName1); - Assertions.assertEquals(outboundRuleName1, outboundRule.name()); - Assertions.assertEquals(1024, outboundRule.allocatedOutboundPorts()); - Assertions.assertEquals(backendPoolName, outboundRule.backend().name()); - - List outboundRuleFrontends = new ArrayList<>(outboundRule.frontends().values()); - Assertions.assertEquals(1, outboundRuleFrontends.size()); - Assertions.assertEquals(frontendName2, outboundRuleFrontends.get(0).name()); - Assertions.assertEquals(1, outboundRuleFrontends.get(0).outboundRules().size()); - Assertions.assertTrue(outboundRuleFrontends.get(0).outboundRules().containsKey(outboundRuleName1)); - Assertions.assertEquals(true, outboundRuleFrontends.get(0).isPublic()); - LoadBalancerPublicFrontend publicFrontend = (LoadBalancerPublicFrontend) outboundRuleFrontends.get(0); - Assertions.assertNotNull(publicFrontend.getPublicIpAddress()); - Assertions.assertEquals(publicIpName2, publicFrontend.getPublicIpAddress().name()); - - Assertions.assertEquals(50, outboundRule.idleTimeoutInMinutes()); - Assertions.assertEquals(false, outboundRule.tcpResetEnabled()); - - // 2. update loadbalancer, remove outbound rule - loadBalancer - .update() - .withoutOutboundRule(outboundRuleName1) - .apply(); - - Assertions.assertEquals(0, loadBalancer.outboundRules().size()); - - // 3. update loadbalancer, define a new outbound rule - loadBalancer - .update() - .defineOutboundRule(outboundRuleName2) - .withProtocol(LoadBalancerOutboundRuleProtocol.TCP) - .fromBackend(backendPoolName) - .toFrontend(frontendName2) - .withIdleTimeoutInMinutes(10) - .attach() - .apply(); - - Map outboundRulesOnUpdateDefine = loadBalancer.outboundRules(); - Assertions.assertEquals(1, outboundRulesOnUpdateDefine.size()); - Assertions.assertTrue(outboundRulesOnUpdateDefine.containsKey(outboundRuleName2)); - LoadBalancerOutboundRule outboundRuleOnUpdateDefine = outboundRulesOnUpdateDefine.get(outboundRuleName2); - Assertions.assertEquals(outboundRuleName2, outboundRuleOnUpdateDefine.name()); - Assertions.assertEquals(1024, outboundRuleOnUpdateDefine.allocatedOutboundPorts()); - Assertions.assertEquals(backendPoolName, outboundRuleOnUpdateDefine.backend().name()); - - List outboundRuleFrontendsOnUpdateDefine = new ArrayList<>(outboundRuleOnUpdateDefine.frontends().values()); - Assertions.assertEquals(1, outboundRuleFrontendsOnUpdateDefine.size()); - Assertions.assertEquals(frontendName2, outboundRuleFrontendsOnUpdateDefine.get(0).name()); - Assertions.assertEquals(1, outboundRuleFrontendsOnUpdateDefine.get(0).outboundRules().size()); - Assertions.assertTrue(outboundRuleFrontendsOnUpdateDefine.get(0).outboundRules().containsKey(outboundRuleName2)); - Assertions.assertEquals(true, outboundRuleFrontendsOnUpdateDefine.get(0).isPublic()); - LoadBalancerPublicFrontend publicFrontendOnUpdateDefine = (LoadBalancerPublicFrontend) outboundRuleFrontendsOnUpdateDefine.get(0); - Assertions.assertNotNull(publicFrontendOnUpdateDefine.getPublicIpAddress()); - Assertions.assertEquals(publicIpName2, publicFrontendOnUpdateDefine.getPublicIpAddress().name()); - - Assertions.assertEquals(10, outboundRuleOnUpdateDefine.idleTimeoutInMinutes()); - Assertions.assertEquals(false, outboundRuleOnUpdateDefine.tcpResetEnabled()); - - } - - private static LoadBalancer createLoadBalancerWithPrivateFrontend( - NetworkManager networkManager, ResourceGroup resourceGroup, Network network, String lbName) { - final String frontendName = lbName + "-FE1"; - final String backendPoolName1 = lbName + "-BAP1"; - final String backendPoolName2 = lbName + "-BAP2"; - final String natPool50XXto22 = lbName + "natPool50XXto22"; - final String natPool60XXto23 = lbName + "natPool60XXto23"; - - LoadBalancer loadBalancer1 = - networkManager - .loadBalancers() - .define(lbName) - .withRegion(resourceGroup.region()) - .withExistingResourceGroup(resourceGroup.name()) - // Add two rules that uses above backend and probe - .defineLoadBalancingRule(RULE_NAME_1) - .withProtocol(TransportProtocol.TCP) - .fromFrontend(frontendName) - .fromFrontendPort(80) - .toBackend(backendPoolName1) - .withProbe(PROBE_NAME_1) - .attach() - .defineLoadBalancingRule(RULE_NAME_2) - .withProtocol(TransportProtocol.TCP) - .fromFrontend(frontendName) - .fromFrontendPort(443) - .toBackend(backendPoolName2) - .withProbe(PROBE_NAME_2) - .attach() - // Add nat pools to enable direct VM connectivity for - // SSH to port 22 and TELNET to port 23 - .defineInboundNatPool(natPool50XXto22) - .withProtocol(TransportProtocol.TCP) - .fromFrontend(frontendName) - .fromFrontendPortRange(5000, 5099) - .toBackendPort(22) - .attach() - .defineInboundNatPool(natPool60XXto23) - .withProtocol(TransportProtocol.TCP) - .fromFrontend(frontendName) - .fromFrontendPortRange(6000, 6099) - .toBackendPort(23) - .attach() - // Explicitly define the frontend - .definePrivateFrontend(frontendName) - .withExistingSubnet(network, SUBNET_NAME) - .attach() - // Add two probes one per rule - .defineHttpProbe(PROBE_NAME_1) - .withRequestPath("/") - .attach() - .defineHttpsProbe(PROBE_NAME_2) - .withRequestPath("/") - .attach() - .withSku(LoadBalancerSkuType.STANDARD) - .create(); - - return loadBalancer1; - } - - private static LoadBalancer createLoadBalancerWithPublicFrontendAndOutboundRule( - NetworkManager networkManager, ResourceGroup resourceGroup, String lbName, String frontendName1, String frontendName2, String backendPoolName, String publicIpName1, String publicIpName2, String outboundRuleName) { - - PublicIpAddress pip1 = - networkManager - .publicIpAddresses() - .define(publicIpName1) - .withRegion(locationOrDefault(Region.US_EAST)) - .withExistingResourceGroup(resourceGroup) - .withSku(PublicIPSkuType.STANDARD) - .withStaticIP() - .create(); - - PublicIpAddress pip2 = - networkManager - .publicIpAddresses() - .define(publicIpName2) - .withRegion(locationOrDefault(Region.US_EAST)) - .withExistingResourceGroup(resourceGroup) - .withSku(PublicIPSkuType.STANDARD) - .withStaticIP() - .create(); - - LoadBalancer loadBalancer1 = - networkManager - .loadBalancers() - .define(lbName) - .withRegion(resourceGroup.region()) - .withExistingResourceGroup(resourceGroup) - // Add rule that uses above backend and probe - .defineLoadBalancingRule(RULE_NAME_1) - .withProtocol(TransportProtocol.TCP) - .fromFrontend(frontendName1) - .fromFrontendPort(80) - .toBackend(backendPoolName) - .withProbe(PROBE_NAME_1) - .attach() - // Explicitly define the frontend - .definePublicFrontend(frontendName1) - .withExistingPublicIpAddress(pip1) - .attach() - .definePublicFrontend(frontendName2) - .withExistingPublicIpAddress(pip2) - .attach() - // add outbound rule - .defineOutboundRule(outboundRuleName) - .withProtocol(LoadBalancerOutboundRuleProtocol.TCP) - .fromBackend(backendPoolName) - .toFrontend(frontendName2) - .withEnableTcpReset(false) - .withIdleTimeoutInMinutes(5) - .attach() - // Add one probe - .defineHttpProbe(PROBE_NAME_1) - .withRequestPath("/") - .attach() - .withSku(LoadBalancerSkuType.STANDARD) - .create(); - - return loadBalancer1; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/test/java/com/azure/resourcemanager/network/NetworkInterfaceOperationsTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/test/java/com/azure/resourcemanager/network/NetworkInterfaceOperationsTests.java deleted file mode 100644 index 37f23f09a958..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/test/java/com/azure/resourcemanager/network/NetworkInterfaceOperationsTests.java +++ /dev/null @@ -1,427 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.network; - -import com.azure.resourcemanager.network.models.ApplicationSecurityGroup; -import com.azure.resourcemanager.network.models.Network; -import com.azure.resourcemanager.network.models.NetworkInterface; -import com.azure.resourcemanager.network.models.NetworkInterfaces; -import com.azure.resourcemanager.network.models.Networks; -import com.azure.resourcemanager.network.models.NicIpConfiguration; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils; -import com.azure.resourcemanager.resources.models.ResourceGroup; -import com.azure.resourcemanager.resources.models.ResourceGroups; -import com.azure.core.management.Region; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.CreatedResources; -import java.util.Arrays; -import java.util.Collection; -import java.util.HashMap; -import java.util.HashSet; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.atomic.AtomicInteger; -import java.util.stream.Collectors; - -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public class NetworkInterfaceOperationsTests extends NetworkManagementTest { - - @Test - @SuppressWarnings({"unchecked", "rawtypes"}) - public void canUseMultipleIPConfigs() throws Exception { - String networkName = generateRandomResourceName("net", 15); - String[] nicNames = new String[3]; - for (int i = 0; i < nicNames.length; i++) { - nicNames[i] = generateRandomResourceName("nic", 15); - } - - Network network = - networkManager - .networks() - .define(networkName) - .withRegion(locationOrDefault(Region.US_EAST)) - .withNewResourceGroup(rgName) - .withAddressSpace("10.0.0.0/27") - .withSubnet("subnet1", "10.0.0.0/28") - .withSubnet("subnet2", "10.0.0.16/28") - .create(); - - List> nicDefinitions = - Arrays - .asList( - // 0 - NIC that starts with one IP config and ends with two - (Creatable) - (networkManager - .networkInterfaces() - .define(nicNames[0]) - .withRegion(locationOrDefault(Region.US_EAST)) - .withNewResourceGroup(rgName) - .withExistingPrimaryNetwork(network) - .withSubnet("subnet1") - .withPrimaryPrivateIPAddressDynamic()), - - // 1 - NIC that starts with two IP configs and ends with one - networkManager - .networkInterfaces() - .define(nicNames[1]) - .withRegion(locationOrDefault(Region.US_EAST)) - .withNewResourceGroup(rgName) - .withExistingPrimaryNetwork(network) - .withSubnet("subnet1") - .withPrimaryPrivateIPAddressDynamic() - .defineSecondaryIPConfiguration("nicip2") - .withExistingNetwork(network) - .withSubnet("subnet1") - .withPrivateIpAddressDynamic() - .attach(), - - // 2 - NIC that starts with two IP configs and ends with two - networkManager - .networkInterfaces() - .define(nicNames[2]) - .withRegion(locationOrDefault(Region.US_EAST)) - .withNewResourceGroup(rgName) - .withExistingPrimaryNetwork(network) - .withSubnet("subnet1") - .withPrimaryPrivateIPAddressDynamic() - .defineSecondaryIPConfiguration("nicip2") - .withExistingNetwork(network) - .withSubnet("subnet1") - .withPrivateIpAddressDynamic() - .attach()); - - // Create the NICs in parallel - CreatedResources createdNics = networkManager.networkInterfaces().create(nicDefinitions); - - NetworkInterface[] nics = new NetworkInterface[nicDefinitions.size()]; - for (int i = 0; i < nicDefinitions.size(); i++) { - nics[i] = createdNics.get(nicDefinitions.get(i).key()); - } - - NicIpConfiguration primaryIPConfig, secondaryIPConfig; - NetworkInterface nic; - - // Verify NIC0 - nic = nics[0]; - Assertions.assertNotNull(nic); - primaryIPConfig = nic.primaryIPConfiguration(); - Assertions.assertNotNull(primaryIPConfig); - Assertions.assertTrue("subnet1".equalsIgnoreCase(primaryIPConfig.subnetName())); - Assertions.assertTrue(network.id().equalsIgnoreCase(primaryIPConfig.networkId())); - - // Verify NIC1 - nic = nics[1]; - Assertions.assertNotNull(nic); - Assertions.assertEquals(2, nic.ipConfigurations().size()); - - primaryIPConfig = nic.primaryIPConfiguration(); - Assertions.assertNotNull(primaryIPConfig); - Assertions.assertTrue("subnet1".equalsIgnoreCase(primaryIPConfig.subnetName())); - Assertions.assertTrue(network.id().equalsIgnoreCase(primaryIPConfig.networkId())); - - secondaryIPConfig = nic.ipConfigurations().get("nicip2"); - Assertions.assertNotNull(secondaryIPConfig); - Assertions.assertTrue("subnet1".equalsIgnoreCase(primaryIPConfig.subnetName())); - Assertions.assertTrue(network.id().equalsIgnoreCase(secondaryIPConfig.networkId())); - - // Verify NIC2 - nic = nics[2]; - Assertions.assertNotNull(nic); - Assertions.assertEquals(2, nic.ipConfigurations().size()); - - primaryIPConfig = nic.primaryIPConfiguration(); - Assertions.assertNotNull(primaryIPConfig); - Assertions.assertTrue("subnet1".equalsIgnoreCase(primaryIPConfig.subnetName())); - Assertions.assertTrue(network.id().equalsIgnoreCase(primaryIPConfig.networkId())); - - secondaryIPConfig = nic.ipConfigurations().get("nicip2"); - Assertions.assertNotNull(secondaryIPConfig); - Assertions.assertTrue("subnet1".equalsIgnoreCase(secondaryIPConfig.subnetName())); - Assertions.assertTrue(network.id().equalsIgnoreCase(secondaryIPConfig.networkId())); - - nic = null; - - List> nicUpdates = - Arrays - .asList( - // Update NIC0 - nics[0] - .update() - .defineSecondaryIPConfiguration("nicip2") - .withExistingNetwork(network) - .withSubnet("subnet1") - .withPrivateIpAddressDynamic() - .attach() - .applyAsync(), - - // Update NIC2 - nics[1] - .update() - .withoutIPConfiguration("nicip2") - .updateIPConfiguration("primary") - .withSubnet("subnet2") - .parent() - .applyAsync(), - - // Update NIC3 - nics[2] - .update() - .withoutIPConfiguration("nicip2") - .defineSecondaryIPConfiguration("nicip3") - .withExistingNetwork(network) - .withSubnet("subnet1") - .withPrivateIpAddressDynamic() - .attach() - .applyAsync()); - - List updatedNics = - Flux - .mergeDelayError(32, (Mono[]) nicUpdates.toArray(new Mono[0])) - .collectList() - .block(); - - // Verify updated NICs - for (NetworkInterface n : updatedNics) { - Assertions.assertNotNull(n); - if (n.id().equalsIgnoreCase(nics[0].id())) { - // Verify NIC0 - Assertions.assertEquals(2, n.ipConfigurations().size()); - - primaryIPConfig = n.primaryIPConfiguration(); - Assertions.assertNotNull(primaryIPConfig); - Assertions.assertTrue("subnet1".equalsIgnoreCase(primaryIPConfig.subnetName())); - Assertions.assertTrue(network.id().equalsIgnoreCase(primaryIPConfig.networkId())); - - secondaryIPConfig = n.ipConfigurations().get("nicip2"); - Assertions.assertNotNull(secondaryIPConfig); - Assertions.assertTrue("subnet1".equalsIgnoreCase(secondaryIPConfig.subnetName())); - Assertions.assertTrue(network.id().equalsIgnoreCase(secondaryIPConfig.networkId())); - - } else if (n.id().equals(nics[1].id())) { - // Verify NIC1 - Assertions.assertEquals(1, n.ipConfigurations().size()); - primaryIPConfig = n.primaryIPConfiguration(); - Assertions.assertNotNull(primaryIPConfig); - Assertions.assertNotEquals("nicip2", primaryIPConfig.name()); - Assertions.assertTrue("subnet2".equalsIgnoreCase(primaryIPConfig.subnetName())); - Assertions.assertTrue(network.id().equalsIgnoreCase(primaryIPConfig.networkId())); - - } else if (n.id().equals(nics[2].id())) { - // Verify NIC - Assertions.assertEquals(2, n.ipConfigurations().size()); - - primaryIPConfig = n.primaryIPConfiguration(); - Assertions.assertNotNull(primaryIPConfig); - Assertions.assertNotEquals("nicip2", primaryIPConfig.name()); - Assertions.assertNotEquals("nicip3", primaryIPConfig.name()); - Assertions.assertTrue("subnet1".equalsIgnoreCase(primaryIPConfig.subnetName())); - Assertions.assertTrue(network.id().equalsIgnoreCase(primaryIPConfig.networkId())); - - secondaryIPConfig = n.ipConfigurations().get("nicip3"); - Assertions.assertNotNull(secondaryIPConfig); - Assertions.assertTrue("subnet1".equalsIgnoreCase(secondaryIPConfig.subnetName())); - Assertions.assertTrue(network.id().equalsIgnoreCase(secondaryIPConfig.networkId())); - } else { - Assertions.assertTrue(false, "Unrecognized NIC ID"); - } - } - } - - @Test - public void canCreateBatchOfNetworkInterfaces() throws Exception { - ResourceGroups resourceGroups = resourceManager.resourceGroups(); - Networks networks = networkManager.networks(); - NetworkInterfaces networkInterfaces = networkManager.networkInterfaces(); - - Creatable resourceGroupCreatable = resourceGroups.define(rgName).withRegion(locationOrDefault(Region.US_EAST)); - - final String vnetName = "vnet1212"; - Creatable networkCreatable = - networks - .define(vnetName) - .withRegion(locationOrDefault(Region.US_EAST)) - .withNewResourceGroup(resourceGroupCreatable) - .withAddressSpace("10.0.0.0/28"); - - // Prepare a batch of nics - // - final String nic1Name = "nic1"; - Creatable networkInterface1Creatable = - networkInterfaces - .define(nic1Name) - .withRegion(locationOrDefault(Region.US_EAST)) - .withNewResourceGroup(resourceGroupCreatable) - .withNewPrimaryNetwork(networkCreatable) - .withPrimaryPrivateIPAddressStatic("10.0.0.5"); - - final String nic2Name = "nic2"; - Creatable networkInterface2Creatable = - networkInterfaces - .define(nic2Name) - .withRegion(locationOrDefault(Region.US_EAST)) - .withNewResourceGroup(resourceGroupCreatable) - .withNewPrimaryNetwork(networkCreatable) - .withPrimaryPrivateIPAddressStatic("10.0.0.6"); - - final String nic3Name = "nic3"; - Creatable networkInterface3Creatable = - networkInterfaces - .define(nic3Name) - .withRegion(locationOrDefault(Region.US_EAST)) - .withNewResourceGroup(resourceGroupCreatable) - .withNewPrimaryNetwork(networkCreatable) - .withPrimaryPrivateIPAddressStatic("10.0.0.7"); - - final String nic4Name = "nic4"; - Creatable networkInterface4Creatable = - networkInterfaces - .define(nic4Name) - .withRegion(locationOrDefault(Region.US_EAST)) - .withNewResourceGroup(resourceGroupCreatable) - .withNewPrimaryNetwork(networkCreatable) - .withPrimaryPrivateIPAddressStatic("10.0.0.8"); - - @SuppressWarnings("unchecked") - Collection batchNics = - networkInterfaces - .create( - networkInterface1Creatable, - networkInterface2Creatable, - networkInterface3Creatable, - networkInterface4Creatable) - .values(); - - Assertions.assertTrue(batchNics.size() == 4); - HashMap found = new LinkedHashMap<>(); - for (NetworkInterface nic : batchNics) { - if (nic.name().equalsIgnoreCase(nic1Name)) { - found.put(nic1Name, true); - } - if (nic.name().equalsIgnoreCase(nic2Name)) { - found.put(nic2Name, true); - } - if (nic.name().equalsIgnoreCase(nic3Name)) { - found.put(nic3Name, true); - } - if (nic.name().equalsIgnoreCase(nic4Name)) { - found.put(nic4Name, true); - } - } - Assertions.assertTrue(found.size() == 4); - } - - @Test - public void canCreateNicWithApplicationSecurityGroup() { - Network network = - networkManager - .networks() - .define("vnet1") - .withRegion(locationOrDefault(Region.US_EAST)) - .withNewResourceGroup(rgName) - .withAddressSpace("10.0.0.0/27") - .withSubnet("subnet1", "10.0.0.0/28") - .withSubnet("subnet2", "10.0.0.16/28") - .create(); - - ApplicationSecurityGroup asg1 = networkManager.applicationSecurityGroups().define("asg1") - .withRegion(locationOrDefault(Region.US_EAST)) - .withExistingResourceGroup(rgName) - .create(); - - NetworkInterface nic = networkManager.networkInterfaces().define("nic1") - .withRegion(locationOrDefault(Region.US_EAST)) - .withExistingResourceGroup(rgName) - .withExistingPrimaryNetwork(network) - .withSubnet("subnet1") - .withPrimaryPrivateIPAddressDynamic() - .withExistingApplicationSecurityGroup(asg1) - .create(); - - List applicationSecurityGroups = nic.primaryIPConfiguration().listAssociatedApplicationSecurityGroups(); - Assertions.assertEquals(1, applicationSecurityGroups.size()); - Assertions.assertEquals("asg1", applicationSecurityGroups.iterator().next().name()); - - ApplicationSecurityGroup asg2 = networkManager.applicationSecurityGroups().define("asg2") - .withRegion(locationOrDefault(Region.US_EAST)) - .withExistingResourceGroup(rgName) - .create(); - - nic.update() - .withoutApplicationSecurityGroup(asg1.name()) - .withExistingApplicationSecurityGroup(asg2) - .defineSecondaryIPConfiguration("nicip2") - .withExistingNetwork(network) - .withSubnet("subnet1") - .withPrivateIpAddressDynamic() - .attach() - .apply(); - - applicationSecurityGroups = nic.primaryIPConfiguration().listAssociatedApplicationSecurityGroups(); - Assertions.assertEquals(1, applicationSecurityGroups.size()); - Assertions.assertEquals("asg2", applicationSecurityGroups.iterator().next().name()); - - nic.update() - .withoutApplicationSecurityGroup(asg1.name()) - .withExistingApplicationSecurityGroup(asg1) - .apply(); - - Assertions.assertEquals(2, nic.ipConfigurations().get("nicip2").innerModel().applicationSecurityGroups().size()); - Assertions.assertEquals( - new HashSet<>(Arrays.asList("asg1", "asg2")), - nic.ipConfigurations().get("nicip2").innerModel().applicationSecurityGroups().stream().map(inner -> ResourceUtils.nameFromResourceId(inner.id())).collect(Collectors.toSet())); - if (!isPlaybackMode()) { - // avoid concurrent request in playback - applicationSecurityGroups = nic.ipConfigurations().get("nicip2").listAssociatedApplicationSecurityGroups(); - Assertions.assertEquals(2, applicationSecurityGroups.size()); - Assertions.assertEquals( - new HashSet<>(Arrays.asList("asg1", "asg2")), - applicationSecurityGroups.stream().map(ApplicationSecurityGroup::name).collect(Collectors.toSet())); - } - } - - @Test - @Disabled("Deadlock from CountDownLatch") - public void canDeleteNetworkWithServiceCallBack() { - String vnetName = generateRandomResourceName("vnet", 15); - networkManager - .networks() - .define(vnetName) - .withRegion(locationOrDefault(Region.US_EAST)) - .withNewResourceGroup(rgName) - .withAddressSpace("172.16.0.0/16") - .defineSubnet("Front-end") - .withAddressPrefix("172.16.1.0/24") - .attach() - .defineSubnet("Back-end") - .withAddressPrefix("172.16.3.0/24") - .attach() - .create(); - - // TODO: Fix deadlock - final CountDownLatch latch = new CountDownLatch(1); - final AtomicInteger counter = new AtomicInteger(0); - networkManager - .networks() - .deleteByResourceGroupAsync(rgName, vnetName) - .doOnSuccess( - aVoid -> { - counter.incrementAndGet(); - latch.countDown(); - }) - .doOnError(throwable -> latch.countDown()); - - try { - latch.await(); - } catch (InterruptedException exception) { - throw new RuntimeException(exception); - } - Assertions.assertEquals(counter.intValue(), 1); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/test/java/com/azure/resourcemanager/network/NetworkManagementTest.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/test/java/com/azure/resourcemanager/network/NetworkManagementTest.java deleted file mode 100644 index 33bc063e932a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/test/java/com/azure/resourcemanager/network/NetworkManagementTest.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.network; - -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.policy.HttpLogOptions; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.resourcemanager.keyvault.KeyVaultManager; -import com.azure.resourcemanager.msi.MsiManager; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.resources.ResourceManager; -import com.azure.resourcemanager.resources.fluentcore.utils.HttpPipelineProvider; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import com.azure.resourcemanager.test.ResourceManagerTestBase; -import com.azure.resourcemanager.test.utils.TestDelayProvider; -import com.azure.resourcemanager.test.utils.TestIdentifierProvider; - -import java.time.temporal.ChronoUnit; -import java.util.List; - -public class NetworkManagementTest extends ResourceManagerTestBase { - protected ResourceManager resourceManager; - protected NetworkManager networkManager; - protected KeyVaultManager keyVaultManager; - protected MsiManager msiManager; - protected String rgName = ""; - - @Override - protected HttpPipeline buildHttpPipeline( - TokenCredential credential, - AzureProfile profile, - HttpLogOptions httpLogOptions, - List policies, - HttpClient httpClient) { - return HttpPipelineProvider.buildHttpPipeline( - credential, - profile, - null, - httpLogOptions, - null, - new RetryPolicy("Retry-After", ChronoUnit.SECONDS), - policies, - httpClient); - } - - @Override - protected void initializeClients(HttpPipeline httpPipeline, AzureProfile profile) { - ResourceManagerUtils.InternalRuntimeContext.setDelayProvider(new TestDelayProvider(!isPlaybackMode())); - ResourceManagerUtils.InternalRuntimeContext internalContext = new ResourceManagerUtils.InternalRuntimeContext(); - internalContext.setIdentifierFunction(name -> new TestIdentifierProvider(testResourceNamer)); - rgName = generateRandomResourceName("javanwmrg", 15); - networkManager = buildManager(NetworkManager.class, httpPipeline, profile); - keyVaultManager = buildManager(KeyVaultManager.class, httpPipeline, profile); - msiManager = buildManager(MsiManager.class, httpPipeline, profile); - resourceManager = networkManager.resourceManager(); - setInternalContext(internalContext, networkManager); - } - - @Override - protected void cleanUpResources() { - resourceManager.resourceGroups().beginDeleteByName(rgName); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/test/java/com/azure/resourcemanager/network/NetworkProfileTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/test/java/com/azure/resourcemanager/network/NetworkProfileTests.java deleted file mode 100644 index be1dbf81cc71..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/test/java/com/azure/resourcemanager/network/NetworkProfileTests.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.network; - -import com.azure.core.management.Region; -import com.azure.resourcemanager.network.models.ContainerNetworkInterfaceConfiguration; -import com.azure.resourcemanager.network.models.Network; -import com.azure.resourcemanager.network.models.NetworkProfile; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public class NetworkProfileTests extends NetworkManagementTest { - - @Test - public void canCRUDNetworkProfile() { - Network network = networkManager.networks().define("vnet1") - .withRegion(locationOrDefault(Region.US_EAST)) - .withNewResourceGroup(rgName) - .withAddressSpace("10.0.0.0/24") - .withSubnet("default", "10.0.0.0/24") - .create(); - - NetworkProfile networkProfile = networkManager.networkProfiles().define("profile1") - .withRegion(locationOrDefault(Region.US_EAST)) - .withExistingResourceGroup(rgName) - .withContainerNetworkInterfaceConfiguration("eth1", "ipconfig1", network.id(), "default") - .withTag("tag.1", "value.1") - .create(); - - Assertions.assertEquals(1, networkProfile.containerNetworkInterfaceConfigurations().size()); - ContainerNetworkInterfaceConfiguration configuration = networkProfile.containerNetworkInterfaceConfigurations().iterator().next(); - Assertions.assertEquals("eth1", configuration.name()); - Assertions.assertEquals("ipconfig1", configuration.ipConfigurations().iterator().next().name()); - Assertions.assertEquals(network.subnets().get("default").id(), configuration.ipConfigurations().iterator().next().subnet().id()); - - Assertions.assertEquals(1, networkManager.networkProfiles().listByResourceGroup(rgName).stream().count()); - Assertions.assertEquals(networkProfile.name(), networkManager.networkProfiles().getById(networkProfile.id()).name()); - - networkProfile.update() - .withTag("tag.2", "value.2") - .apply(); - - Assertions.assertEquals(1, networkProfile.containerNetworkInterfaceConfigurations().size()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/test/java/com/azure/resourcemanager/network/NetworkSecurityGroupTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/test/java/com/azure/resourcemanager/network/NetworkSecurityGroupTests.java deleted file mode 100644 index 4f866d2d1236..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/test/java/com/azure/resourcemanager/network/NetworkSecurityGroupTests.java +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.network; - -import com.azure.core.management.Region; -import com.azure.resourcemanager.network.models.ApplicationSecurityGroup; -import com.azure.resourcemanager.network.models.NetworkSecurityGroup; -import com.azure.resourcemanager.network.models.SecurityRuleProtocol; - -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -import java.util.Arrays; -import java.util.HashSet; - -public class NetworkSecurityGroupTests extends NetworkManagementTest { - - @Test - public void canCRUDNetworkSecurityGroup() { - - final String asgName = generateRandomResourceName("asg", 8); - final String asgName2 = generateRandomResourceName("asg", 8); - final String asgName3 = generateRandomResourceName("asg", 8); - final String asgName4 = generateRandomResourceName("asg", 8); - final String asgName5 = generateRandomResourceName("asg", 8); - final String asgName6 = generateRandomResourceName("asg", 8); - final String nsgName = generateRandomResourceName("nsg", 8); - - final Region region = locationOrDefault(Region.US_SOUTH_CENTRAL); - - ApplicationSecurityGroup asg = networkManager.applicationSecurityGroups().define(asgName) - .withRegion(region) - .withNewResourceGroup(rgName) - .create(); - - ApplicationSecurityGroup asg2 = networkManager.applicationSecurityGroups().define(asgName2) - .withRegion(region) - .withExistingResourceGroup(rgName) - .create(); - - ApplicationSecurityGroup asg3 = networkManager.applicationSecurityGroups().define(asgName3) - .withRegion(region) - .withExistingResourceGroup(rgName) - .create(); - - ApplicationSecurityGroup asg4 = networkManager.applicationSecurityGroups().define(asgName4) - .withRegion(region) - .withExistingResourceGroup(rgName) - .create(); - - NetworkSecurityGroup nsg = networkManager.networkSecurityGroups().define(nsgName) - .withRegion(region) - .withExistingResourceGroup(rgName) - .defineRule("rule1") - .allowOutbound() - .fromAnyAddress() - .fromAnyPort() - .toAnyAddress() - .toPort(80) - .withProtocol(SecurityRuleProtocol.TCP) - .attach() - .defineRule("rule2") - .allowInbound() - .withSourceApplicationSecurityGroup(asg.id(), asg2.id()) - .fromAnyPort() - .toAnyAddress() - .toPortRange(22, 25) - .withAnyProtocol() - .withPriority(200) - .withDescription("foo!!") - .attach() - .defineRule("rule3") - .denyInbound() - .fromAnyAddress() - .fromAnyPort() - .withDestinationApplicationSecurityGroup(asg3.id(), asg4.id()) - .toPort(22) - .withAnyProtocol() - .withPriority(300) - .attach() - .create(); - - Assertions.assertEquals(2, nsg.securityRules().get("rule2").sourceApplicationSecurityGroupIds().size()); - Assertions.assertEquals(2, nsg.securityRules().get("rule3").destinationApplicationSecurityGroupIds().size()); - Assertions.assertEquals(new HashSet<>(Arrays.asList(asg.id(), asg2.id())), nsg.securityRules().get("rule2").sourceApplicationSecurityGroupIds()); - Assertions.assertEquals(new HashSet<>(Arrays.asList(asg3.id(), asg4.id())), nsg.securityRules().get("rule3").destinationApplicationSecurityGroupIds()); - - ApplicationSecurityGroup asg5 = networkManager.applicationSecurityGroups().define(asgName5) - .withRegion(region) - .withExistingResourceGroup(rgName) - .create(); - - ApplicationSecurityGroup asg6 = networkManager.applicationSecurityGroups().define(asgName6) - .withRegion(region) - .withExistingResourceGroup(rgName) - .create(); - - nsg.update() - .updateRule("rule2") - .withoutSourceApplicationSecurityGroup(asg2.id()) - .withSourceApplicationSecurityGroup(asg5.id()) - .parent() - .updateRule("rule3") - .withoutDestinationApplicationSecurityGroup(asg4.id()) - .withDestinationApplicationSecurityGroup(asg6.id()) - .parent() - .apply(); - - Assertions.assertEquals(2, nsg.securityRules().get("rule2").sourceApplicationSecurityGroupIds().size()); - Assertions.assertEquals(2, nsg.securityRules().get("rule3").destinationApplicationSecurityGroupIds().size()); - Assertions.assertEquals(new HashSet<>(Arrays.asList(asg.id(), asg5.id())), nsg.securityRules().get("rule2").sourceApplicationSecurityGroupIds()); - Assertions.assertEquals(new HashSet<>(Arrays.asList(asg3.id(), asg6.id())), nsg.securityRules().get("rule3").destinationApplicationSecurityGroupIds()); - - networkManager.networkSecurityGroups().deleteById(nsg.id()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/test/java/com/azure/resourcemanager/network/NetworkUsageOperationsTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/test/java/com/azure/resourcemanager/network/NetworkUsageOperationsTests.java deleted file mode 100644 index 7315a7c5c518..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/test/java/com/azure/resourcemanager/network/NetworkUsageOperationsTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.network; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.network.models.NetworkUsage; -import com.azure.resourcemanager.test.utils.TestUtilities; -import com.azure.core.management.Region; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public class NetworkUsageOperationsTests extends NetworkManagementTest { - @Test - public void canListNetworkUsages() throws Exception { - PagedIterable usages = networkManager.usages().listByRegion(locationOrDefault(Region.US_EAST)); - Assertions.assertTrue(TestUtilities.getSize(usages) > 0); - } - - @Override - protected void cleanUpResources() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/test/java/com/azure/resourcemanager/network/NetworkWatcherTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/test/java/com/azure/resourcemanager/network/NetworkWatcherTests.java deleted file mode 100644 index 8b63c170c19e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/test/java/com/azure/resourcemanager/network/NetworkWatcherTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.network.models.AvailableProviders; -import com.azure.resourcemanager.network.models.AzureReachabilityReport; -import com.azure.resourcemanager.network.models.NetworkWatcher; -import com.azure.core.management.Region; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public class NetworkWatcherTests extends NetworkManagementTest { - - @Test - @Disabled("https://github.com/Azure/azure-rest-api-specs/issues/7579") - public void canListProvidersAndGetReachabilityReport() throws Exception { - String nwName = generateRandomResourceName("nw", 8); - Region region = locationOrDefault(Region.US_WEST); - // make sure Network Watcher is disabled in current subscription and region as only one can exist - PagedIterable nwList = networkManager.networkWatchers().list(); - for (NetworkWatcher nw : nwList) { - if (region.equals(nw.region())) { - networkManager.networkWatchers().deleteById(nw.id()); - } - } - // create Network Watcher - NetworkWatcher nw = - networkManager.networkWatchers().define(nwName).withRegion(region).withNewResourceGroup(rgName).create(); - AvailableProviders providers = nw.availableProviders().execute(); - Assertions.assertTrue(providers.providersByCountry().size() > 1); - Assertions.assertNotNull(providers.providersByCountry().get("United States")); - - providers = - nw - .availableProviders() - .withAzureLocation(locationOrDefault("West US")) - .withCountry("United States") - .withState("washington") - .execute(); - Assertions.assertEquals(1, providers.providersByCountry().size()); - Assertions - .assertEquals( - "washington", providers.providersByCountry().get("United States").states().get(0).stateName()); - Assertions - .assertTrue(providers.providersByCountry().get("United States").states().get(0).providers().size() > 0); - - String localProvider = providers.providersByCountry().get("United States").states().get(0).providers().get(0); - AzureReachabilityReport report = - nw - .azureReachabilityReport() - .withProviderLocation("United States", "washington") - .withStartTime(OffsetDateTime.parse("2018-04-10")) - .withEndTime(OffsetDateTime.parse("2018-04-12")) - .withProviders(localProvider) - .withAzureLocations(locationOrDefault("West US")) - .execute(); - Assertions.assertEquals("State", report.aggregationLevel()); - Assertions.assertTrue(report.reachabilityReport().size() > 0); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/test/java/com/azure/resourcemanager/network/RouteFilterTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/test/java/com/azure/resourcemanager/network/RouteFilterTests.java deleted file mode 100644 index d5c0821ef6bc..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/test/java/com/azure/resourcemanager/network/RouteFilterTests.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.network; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.network.models.Access; -import com.azure.resourcemanager.network.models.RouteFilter; -import com.azure.resourcemanager.test.utils.TestUtilities; -import com.azure.core.management.Region; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public class RouteFilterTests extends NetworkManagementTest { - - @Test - public void canCRUDRouteFilter() throws Exception { - String rfName = generateRandomResourceName("rf", 15); - - RouteFilter routeFilter = - networkManager - .routeFilters() - .define(rfName) - .withRegion(locationOrDefault(Region.US_SOUTH_CENTRAL)) - .withNewResourceGroup(rgName) - .withTag("tag1", "value1") - .create(); - Assertions.assertEquals("value1", routeFilter.tags().get("tag1")); - - PagedIterable rfList = networkManager.routeFilters().list(); - Assertions.assertTrue(TestUtilities.getSize(rfList) > 0); - - rfList = networkManager.routeFilters().listByResourceGroup(rgName); - Assertions.assertTrue(TestUtilities.getSize(rfList) > 0); - - networkManager.routeFilters().deleteById(routeFilter.id()); - rfList = networkManager.routeFilters().listByResourceGroup(rgName); - Assertions.assertTrue(TestUtilities.isEmpty(rfList)); - } - - @Test - public void canCreateRouteFilterRule() throws Exception { - String rfName = generateRandomResourceName("rf", 15); - String ruleName = "mynewrule"; - RouteFilter routeFilter = - networkManager - .routeFilters() - .define(rfName) - .withRegion(locationOrDefault(Region.US_SOUTH_CENTRAL)) - .withNewResourceGroup(rgName) - .create(); - - routeFilter.update().defineRule(ruleName).withBgpCommunity("12076:51004").attach().apply(); - Assertions.assertEquals(1, routeFilter.rules().size()); - Assertions.assertEquals(1, routeFilter.rules().get(ruleName).communities().size()); - Assertions.assertEquals("12076:51004", routeFilter.rules().get(ruleName).communities().get(0)); - - routeFilter - .update() - .updateRule(ruleName) - .withBgpCommunities("12076:51005", "12076:51026") - .denyAccess() - .parent() - .apply(); - Assertions.assertEquals(2, routeFilter.rules().get(ruleName).communities().size()); - Assertions.assertEquals(Access.DENY, routeFilter.rules().get(ruleName).access()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/test/resources/junit-platform.properties b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/test/resources/junit-platform.properties deleted file mode 100644 index 202d099b3ee8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/test/resources/junit-platform.properties +++ /dev/null @@ -1,4 +0,0 @@ -junit.jupiter.execution.parallel.enabled=true -junit.jupiter.execution.parallel.mode.default=concurrent -junit.jupiter.execution.parallel.config.strategy=fixed -junit.jupiter.execution.parallel.config.fixed.parallelism=32 diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/test/resources/test.certificate b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/test/resources/test.certificate deleted file mode 100644 index a72f45580849..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/test/resources/test.certificate +++ /dev/null @@ -1 +0,0 @@ -MIIKPAIBAzCCCfwGCSqGSIb3DQEHAaCCCe0EggnpMIIJ5TCCBhYGCSqGSIb3DQEHAaCCBgcEggYDMIIF/zCCBfsGCyqGSIb3DQEMCgECoIIE/jCCBPowHAYKKoZIhvcNAQwBAzAOBAiOxat3N9NKKwICB9AEggTYPSm3EObigQcausAjcvRGLyPmNMKXFW5IaURTUeeQzd56lNisV7ESyxhdUsXHNDsvfvQuJDXeROCsHBRfLzrDkzd8jVkHDj4jXtjn24i92jiZUdGacU/FOCgaWxCG/huPg/wpJqCphgAe3HGLgSOT9iP0sYmB1UYwNGCcYS4TaOIxV7+H++1Qh7DW7MzFod3h3EczbZPunGMuPvp0N+jQOgaUWDZmwlHlmttIJSwRjwKXSAIiTMHfi3DpWegaLVmBfULqoNzesRCF4xYV11DquQscF4rq5CMZ6XmJL21dltywEOItJGoJXDA3vPwZ8RwA6N5sez7ZE4PuSOk8F5l4ZLpQkIG0CWU/deMTw0aNUqiR+N9Zzggu7C0pL9lr6xdfM4+hw3FXH7UrRrd00F79shoxzfW2aZlJX1OAI75AkUUlWjY+0w3REUw/LEk1qV9ktTfE2nt9ZCvr4W+M8Cf5dSiccdg7B5nEws/adHCMcWb4sPSDHPzf4jNNeuMTArDxex9wU3u2Q2p97Mg6w3uvaGsshBTtCp49YEo6iQwnDBgEpqmQXFm66S6g4GG8K5x37BicJcF9+ViPhr6sA10qZ3EYLY0/gL88bvnX1aRwG+rABrAytHsdfo+14BeY5aReNqCSNdGc+anGr2UjtMvFsBJN14JLq1gGm1ddXTPAHtObUvaf8cl/yIr4ATMKst936ZdimNnppf33GEWoCTOTO1yNAUSmzxwv3k4N60O7EvhYNPoOvqPcD7gZY4hlSDBCQxqCkpZTQFQcd8tr0eM3X/1sH9saSNa19nuc3IbXLgqaNNX5monqNIIeKRgBW7WfZqbLZIzY2vVEKeuRYRlUAusz+S6ic9y1kUteq3aAkDbv7vqXDrw8N+1F5tsQjhdqMpMo8MYtcx2b7l3L/gTVvTYD49AbU6AFXJYOD4fhXeQI1VcVYvegKWlC2/HvOgT02a6gfHu70QLah8EplV5ME6blnSbjTy3PmI0n71NRAN3dThmL7Dk8A7CpCmjTw65/OOuzUgvSYoiuUI4kd6Bc/yFwqFSFzDzxHDX7jD1cl3dlSZISMKEjDApqFw7IxEH7fN18wshpZdDfgF5cT2rmqqxYnAtHhKs0/4aJBkw5hvXI0/nyMrijzzigXEgD0MHWlivGylsVOlSxqqQWDHYMC6k0w+yFeHxo3essjp+ck2y69JK4+nstEVJbXXE9/0ZN77F4Qr8T1x9RlIzcD1I3dEl49ZWNmfZLgFgncQWx55mkXrWIbkM7A+LiLnpAjxOFsZ1xG3L6VtQYkRRvUslcBfjwZg+AIdMkjxyNknTChqLQbjoCoAExzRvWCLbzvSAN3lsd80m5BD6Jj8BQ6+AjO8mrIamtRyyDSLqqXUjUZEHWoCr1we8La4ckI82qHCCt2Q+2JnGs818SvcyJNxDGiU1HJ1Lhi+CfLof7mhBBAjxko+JMK/hxgF5tPowA6qEPDRQPqBiHeuJK6Ri+jQa6DxzxFP3qctRX1yR3NLvif/wsUdQELYuvUxqGJYxldB076xpKyALNsw4aDNAtzRr5rfcYVKT2VpvRVJAgn5cizMHbLuF+0wnuwEhNtwaOFOD69wXzsEw1CrSeJY8/1UTyi8t3JOlRrOT84Leo6DyJ/qVaHn31K2YWfjGB6TATBgkqhkiG9w0BCRUxBgQEAQAAADBXBgkqhkiG9w0BCRQxSh5IAGEAZgBlADgAYgA5ADAAMwAtAGQANgA4ADAALQA0ADkAZQBkAC0AOQAwADgAOAAtADgAYwAyAGQAYgBiADMANAAzADkANABjMHkGCSsGAQQBgjcRATFsHmoATQBpAGMAcgBvAHMAbwBmAHQAIABFAG4AaABhAG4AYwBlAGQAIABSAFMAQQAgAGEAbgBkACAAQQBFAFMAIABDAHIAeQBwAHQAbwBnAHIAYQBwAGgAaQBjACAAUAByAG8AdgBpAGQAZQByMIIDxwYJKoZIhvcNAQcGoIIDuDCCA7QCAQAwggOtBgkqhkiG9w0BBwEwHAYKKoZIhvcNAQwBBjAOBAiJWQVecvbwSgICB9CAggOANLdFaUlfaxuUn2UjyJDMeqFXxD7TPaYbrHHLAcJ3Oa3YnkWLfnnoY2mrJqqCNaQqEwQNNlnLv1CPNH3muxeRtHBc4Fi22S20fl1f56OSPmF9FNGc9U0Mje8s7F5utB8o/fd+2nNmhEkew5Xjl9DEQ14Qxu5nYubTDilk+KihEw2OfB8qtq5UTFEltDpXkZLupEp/Tpink2qJTj91+3aGcebbgTx6Ao2QXVtWM40yPov6KvOfVU1+ZDybUPI5F92afjkxPMGGidH1mpImXyTra8tCwY/7X6y68+F3fTYxg/sHLDNX8q5MPTKUczT7Q3P/Oz1cvMflQaa8SHZ2xTufZqaTTfxOX3vcwU63yTzkDKSnX4oIy8nJWAvjeDU8vT6nMP8NWsp7Xs5qV1hY8Y2iOgpXVjLy5j2U9sv75FZUTcP7+zPUcBDitb1Wb9wqD2NJFLbH8tTIjPX6w7dzXOKM2ynvBR97Lm73K6OCXYDkn4rmd357qMlDdXQSv0PNQfoMBaCqr8BmyCbkuk6jxw+Et2MWPV+tk+Y6wxhJs/XnKtAzIrbiV/40C8LMh63NJLegKcnw3MH5EWIYtNfWqoiG4FnA4L9Aq8trljGSZmCypStYrsUdMAHTTDEKi0KJQm2DMTYQOp7xRfhTnmLrC+AzKMUnxJhzh2MxgiEZUbtGmIh+W2NS4M1yJokCeiJ3nMfG/X+mGukcVJ6M0nF8Een40O4OB8Vnj5uhNkudhymURU0klSahG211IS+sKkbap0hnw2mlG0cKdDLDR4co/ZQRuhGO3TJ7BSNM59DfWs9Cg9X/g85lc50b/P8B2/EjdIwZ8lq4uEY5AKCdQOuerxc2n8o6XeDw7tWHe4GwyK8rUE8DDeJ3SRDOiu5iz9Ol9OUnlV1a9PPeOSRxl7oc4rq8P2u/JdNfWfipqOS1tsSJcJvj0R3izYe3PHHtfjsdZErC590UeH8FjXFeE0gsdlEzHMbIbMVNVYQ2W0i7ySN0cekC75PBFVtLaWByWHpBVtYFo/c5JSCR1yokBc1l1gRPMjN7tyXyuzm2Aj7piOpIif5na8hAwvTIr9qfVcDhYXtwa27iS94qk1qN9mzx+SiSce5pd0ENcEIkPNM4MbqgSAUbWABglgPXdVPTE7XGXn1rUaHjRGZDfmJRN2T4e7j3bA9FndDTSA7OQCJH0tddvY0wNzAfMAcGBSsOAwIaBBSoj0xcV/9PmaKGAoL57rEHrbZNpgQUdhORL1kXZ+PV5To+JecGwAPX9pM= \ No newline at end of file diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/CHANGELOG.md b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/CHANGELOG.md deleted file mode 100644 index 0a32aa5f07c3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/CHANGELOG.md +++ /dev/null @@ -1,10 +0,0 @@ -# Release History - -## 1.0.0-hybrid (2022-01-12) - -- Fixed a bug that `ResourceManager.pipeline()` be `null`. - -- Azure Resource Manager resources client library for Java (Hybrid) using API Profiles to allow building hybrid cloud solutions -that target both Azure and Azure Stack Hub. -- Supports api versions in the 2020-09-01-hybrid api profile -- Requires Azure Stack Update 2102+ diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/README.md b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/README.md deleted file mode 100644 index ca59774e35e0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/README.md +++ /dev/null @@ -1,136 +0,0 @@ -# Azure Resource Manager resources client library for Java (Hybrid) - -Azure Resource Manager resources client library for Java (Hybrid) using [API Profiles][api_profile] to allow building hybrid cloud solutions -that target both Azure and Azure Stack Hub. - -For documentation on how to use this package, please see [Azure Management Libraries for Java (Hybrid)][resourcemanagerhybrid_lib]. - -## Getting started - -### Prerequisites - -- [Java Development Kit (JDK)][jdk] with version 8 or above -- [Azure Subscription][azure_subscription] - -### Adding the package to your product - -```xml - - com.azure.resourcemanager - azure-resourcemanager-resources - 1.0.0-hybrid - -``` - -### Include the recommended packages - -Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. - -[Azure Identity][azure_identity] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation. - -### Authentication - -By default, Azure Active Directory token authentication depends on correct configure of following environment variables. - -- `AZURE_CLIENT_ID` for Azure client ID. -- `AZURE_TENANT_ID` for Azure tenant ID. -- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. - -In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`. - -With above configuration, `azure` client can be authenticated by following code: - -```java com.azure.resourcemanager.resources.authenticate -String armEndpoint = "https://management.."; -AzureProfile profile = new AzureProfile(getAzureEnvironmentFromArmEndpoint(armEndpoint)); -TokenCredential credential = new DefaultAzureCredentialBuilder() - .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) - .build(); -ResourceManager manager = ResourceManager - .authenticate(credential, profile) - .withDefaultSubscription(); -``` - -Change `armEndpoint` to point to the Azure Resource Manager endpoint of your Azure Stack Hub. The azure environment's -properties above can be populated with the following example: - -```java com.azure.resourcemanager.resources.getazureenvironment -private static AzureEnvironment getAzureEnvironmentFromArmEndpoint(String armEndpoint) { - // Create HTTP client and request - HttpClient httpClient = HttpClient.createDefault(); - - HttpRequest request = new HttpRequest(HttpMethod.GET, - String.format("%s/metadata/endpoints?api-version=2019-10-01", armEndpoint)) - .setHeader("accept", "application/json"); - - // Execute the request and read the response - HttpResponse response = httpClient.send(request).block(); - if (response.getStatusCode() != 200) { - throw new RuntimeException("Failed : HTTP error code : " + response.getStatusCode()); - } - String body = response.getBodyAsString().block(); - try { - ArrayNode metadataArray = JacksonAdapter.createDefaultSerializerAdapter() - .deserialize(body, ArrayNode.class, SerializerEncoding.JSON); - - if (metadataArray == null || metadataArray.isEmpty()) { - throw new RuntimeException("Failed to find metadata : " + body); - } - - JsonNode metadata = metadataArray.iterator().next(); - AzureEnvironment azureEnvironment = new AzureEnvironment(new HashMap() { - { - put("managementEndpointUrl", metadata.at("/authentication/audiences/0").asText()); - put("resourceManagerEndpointUrl", armEndpoint); - put("galleryEndpointUrl", metadata.at("/gallery").asText()); - put("activeDirectoryEndpointUrl", metadata.at("/authentication/loginEndpoint").asText()); - put("activeDirectoryResourceId", metadata.at("/authentication/audiences/0").asText()); - put("activeDirectoryGraphResourceId", metadata.at("/graph").asText()); - put("storageEndpointSuffix", "." + metadata.at("/suffixes/storage").asText()); - put("keyVaultDnsSuffix", "." + metadata.at("/suffixes/keyVaultDns").asText()); - } - }); - return azureEnvironment; - } catch (IOException ioe) { - ioe.printStackTrace(); - throw new RuntimeException(ioe); - } -} -``` - -When targeting a hybrid solution to global Azure instead of your Azure Stack Hub, `AzureEnvironment.AZURE` can be used instead. - -See [Authentication][authenticate] for more options. - -## Key concepts - -See [API design][design] for general introduction on design and key concepts on Azure Management Libraries. - -## Examples - -See [Samples][sample] for code snippets and samples. - -## Troubleshooting - -## Next steps - -## Contributing - -For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). - -1. Fork it -1. Create your feature branch (`git checkout -b my-new-feature`) -1. Commit your changes (`git commit -am 'Add some feature'`) -1. Push to the branch (`git push origin my-new-feature`) -1. Create new Pull Request - - -[jdk]: https://learn.microsoft.com/java/azure/jdk/ -[azure_subscription]: https://azure.microsoft.com/free/ -[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity -[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty -[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md -[sample]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/SAMPLE.md -[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md -[api_profile]: https://learn.microsoft.com/azure-stack/user/azure-stack-version-profiles -[resourcemanagerhybrid_lib]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanagerhybrid diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/pom.xml b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/pom.xml deleted file mode 100644 index c7ba52c3b47b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/pom.xml +++ /dev/null @@ -1,170 +0,0 @@ - - - 4.0.0 - - com.azure - azure-client-sdk-parent - 1.7.0 - ../../parents/azure-client-sdk-parent - - - com.azure.resourcemanager - azure-resourcemanager-resources - 1.0.0-hybrid - jar - - Microsoft Azure SDK for Resource Management (Hybrid) - This package contains Microsoft Azure Resource Management Hybrid SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt - https://github.com/Azure/azure-sdk-for-java - - - - The MIT License (MIT) - http://opensource.org/licenses/MIT - repo - - - - - https://github.com/Azure/azure-sdk-for-java - scm:git:git@github.com:Azure/azure-sdk-for-java.git - HEAD - - - - - 0.10 - 0.10 - - - --add-opens com.azure.resourcemanager.resources/com.azure.resourcemanager.resources=ALL-UNNAMED - --add-opens com.azure.core/com.azure.core.http=com.azure.resourcemanager.resources - --add-opens com.azure.core/com.azure.core.http.policy=com.azure.resourcemanager.resources - --add-opens com.azure.core/com.azure.core.implementation.jackson=ALL-UNNAMED - - - - - - microsoft - Microsoft - - - - - - com.azure - azure-core - 1.57.0 - - - com.azure - azure-core-management - 1.19.2 - - - org.slf4j - slf4j-simple - 1.7.36 - test - - - org.junit.jupiter - junit-jupiter-engine - 5.13.4 - test - - - org.junit.jupiter - junit-jupiter-api - 5.13.4 - test - - - com.azure - azure-core-http-netty - 1.16.2 - test - - - io.projectreactor - reactor-test - 3.7.11 - test - - - - - azure-mgmt-sdk-test-jar - - - !maven.test.skip - - - - - com.azure.resourcemanager - azure-resourcemanager-test - 1.0.0-hybrid - test - - - - - - - - src/main/resources - true - - - - - - org.apache.maven.plugins - maven-jar-plugin - 3.4.2 - - - - true - true - - - - - - org.apache.maven.plugins - maven-enforcer-plugin - 3.6.1 - - - - - com.github.spotbugs:spotbugs-annotations:[4.8.3] - - - - - - - - org.jacoco - jacoco-maven-plugin - 0.8.13 - - - com/azure/resourcemanager/**/fluent/**/* - com/azure/resourcemanager/**/models/**/* - com/azure/resourcemanager/**/implementation/*ClientImpl* - com/azure/resourcemanager/**/implementation/*ClientBuilder* - - - - - - diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/ResourceManager.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/ResourceManager.java deleted file mode 100644 index a0db446ce8c5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/ResourceManager.java +++ /dev/null @@ -1,410 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources; - -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpPipeline; -import com.azure.resourcemanager.resources.fluent.FeatureClient; -import com.azure.resourcemanager.resources.fluent.ManagementLockClient; -import com.azure.resourcemanager.resources.fluentcore.policy.ProviderRegistrationPolicy; -import com.azure.resourcemanager.resources.implementation.FeatureClientBuilder; -import com.azure.resourcemanager.resources.fluent.PolicyClient; -import com.azure.resourcemanager.resources.implementation.ManagementLockClientBuilder; -import com.azure.resourcemanager.resources.implementation.ManagementLocksImpl; -import com.azure.resourcemanager.resources.implementation.PolicyClientBuilder; -import com.azure.resourcemanager.resources.fluent.ResourceManagementClient; -import com.azure.resourcemanager.resources.implementation.ResourceManagementClientBuilder; -import com.azure.resourcemanager.resources.fluent.SubscriptionClient; -import com.azure.resourcemanager.resources.implementation.SubscriptionClientBuilder; -import com.azure.resourcemanager.resources.fluentcore.arm.Manager; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import com.azure.resourcemanager.resources.implementation.DeploymentsImpl; -import com.azure.resourcemanager.resources.implementation.FeaturesImpl; -import com.azure.resourcemanager.resources.implementation.GenericResourcesImpl; -import com.azure.resourcemanager.resources.implementation.PolicyAssignmentsImpl; -import com.azure.resourcemanager.resources.implementation.PolicyDefinitionsImpl; -import com.azure.resourcemanager.resources.implementation.ProvidersImpl; -import com.azure.resourcemanager.resources.implementation.ResourceGroupsImpl; -import com.azure.resourcemanager.resources.implementation.SubscriptionsImpl; -import com.azure.resourcemanager.resources.implementation.TagOperationsImpl; -import com.azure.resourcemanager.resources.implementation.TenantsImpl; -import com.azure.resourcemanager.resources.models.Deployments; -import com.azure.resourcemanager.resources.models.Features; -import com.azure.resourcemanager.resources.models.GenericResources; -import com.azure.resourcemanager.resources.models.ManagementLocks; -import com.azure.resourcemanager.resources.models.PolicyAssignments; -import com.azure.resourcemanager.resources.models.PolicyDefinitions; -import com.azure.resourcemanager.resources.models.Providers; -import com.azure.resourcemanager.resources.models.ResourceGroups; -import com.azure.resourcemanager.resources.models.Subscriptions; -import com.azure.resourcemanager.resources.models.TagOperations; -import com.azure.resourcemanager.resources.models.Tenants; -import com.azure.resourcemanager.resources.fluentcore.arm.AzureConfigurable; -import com.azure.resourcemanager.resources.fluentcore.arm.implementation.AzureConfigurableImpl; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.resources.fluentcore.utils.HttpPipelineProvider; - -import java.util.Objects; - -/** - * Entry point to Azure resource management. - */ -public final class ResourceManager extends Manager { - // The sdk clients - private final FeatureClient featureClient; - private final SubscriptionClient subscriptionClient; - private final PolicyClient policyClient; - private final ManagementLockClient managementLockClient; - // The collections - private ResourceGroups resourceGroups; - private GenericResources genericResources; - private Deployments deployments; - private Features features; - private Providers providers; - private PolicyDefinitions policyDefinitions; - private PolicyAssignments policyAssignments; - private Subscriptions subscriptions; - private Tenants tenants; - private ManagementLocks managementLocks; - private TagOperations tagOperations; - - private ResourceManagerUtils.InternalRuntimeContext internalContext; - - /** - * Creates an instance of ResourceManager that exposes resource management API entry points. - * - * @param credential the credential to use - * @param profile the profile used in resource management - * @return the ResourceManager instance - */ - public static ResourceManager.Authenticated authenticate(TokenCredential credential, AzureProfile profile) { - Objects.requireNonNull(credential, "'credential' cannot be null."); - Objects.requireNonNull(profile, "'profile' cannot be null."); - return new AuthenticatedImpl(HttpPipelineProvider.buildHttpPipeline(credential, profile), profile); - } - - /** - * Creates an instance of ResourceManager that exposes resource management API entry points. - * - * @param httpPipeline the HttpPipeline to be used for API calls - * @param profile the profile used in resource management - * @return the interface exposing resource management API entry points that work across subscriptions - */ - public static ResourceManager.Authenticated authenticate(HttpPipeline httpPipeline, AzureProfile profile) { - Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); - Objects.requireNonNull(profile, "'profile' cannot be null."); - return new AuthenticatedImpl(httpPipeline, profile); - } - - /** - * Get a Configurable instance that can be used to create ResourceManager with optional configuration. - * - * @return the instance allowing configurations - */ - public static Configurable configure() { - return new ResourceManager.ConfigurableImpl(); - } - - /** - * The interface allowing configurations to be set. - */ - public interface Configurable extends AzureConfigurable { - /** - * Creates an instance of ResourceManager that exposes resource management API entry points. - * - * @param credential the credential to use - * @param profile the profile used in resource management - * @return the interface exposing resource management API entry points that work across subscriptions - */ - ResourceManager.Authenticated authenticate(TokenCredential credential, AzureProfile profile); - } - - /** - * The implementation for Configurable interface. - */ - private static class ConfigurableImpl extends AzureConfigurableImpl implements Configurable { - public ResourceManager.Authenticated authenticate(TokenCredential credential, AzureProfile profile) { - return ResourceManager.authenticate(buildHttpPipeline(credential, profile), profile); - } - } - - /** - * The interface exposing resource management API entry points that work across subscriptions. - */ - public interface Authenticated { - /** - * @return the entry point to tenant management API. - */ - Tenants tenants(); - - /** - * @return the entry point to subscription management API. - */ - Subscriptions subscriptions(); - - /** - * Specifies a subscription to expose resource management API entry points that work in a subscription. - * - * @param subscriptionId the subscription UUID - * @return the ResourceManager instance with entry points that work in a subscription - */ - ResourceManager withSubscription(String subscriptionId); - - /** - * Specifies to use subscription from {@link AzureProfile}. If no subscription provided, we will - * try to set the only subscription if applicable returned by {@link Authenticated#subscriptions()}. - * - * @throws IllegalStateException when no subscription or more than one subscription found in the tenant. - * @return the ResourceManager instance with entry points that work in a subscription - */ - ResourceManager withDefaultSubscription(); - } - - /** - * The implementation for Authenticated interface. - */ - private static final class AuthenticatedImpl implements Authenticated { - private final HttpPipeline httpPipeline; - private AzureProfile profile; - private final SubscriptionClient subscriptionClient; - // The subscription less collections - private Subscriptions subscriptions; - private Tenants tenants; - - AuthenticatedImpl(HttpPipeline httpPipeline, AzureProfile profile) { - this.httpPipeline = httpPipeline; - this.profile = profile; - this.subscriptionClient = new SubscriptionClientBuilder() - .pipeline(httpPipeline) - .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) - .buildClient(); - } - - public Subscriptions subscriptions() { - if (subscriptions == null) { - subscriptions = new SubscriptionsImpl(subscriptionClient.getSubscriptions()); - } - return subscriptions; - } - - public Tenants tenants() { - if (tenants == null) { - tenants = new TenantsImpl(subscriptionClient.getTenants()); - } - return tenants; - } - - @Override - public ResourceManager withSubscription(String subscriptionId) { - Objects.requireNonNull(subscriptionId); - profile = new AzureProfile(profile.getTenantId(), subscriptionId, profile.getEnvironment()); - return new ResourceManager(httpPipeline, profile); - } - - @Override - public ResourceManager withDefaultSubscription() { - if (profile.getSubscriptionId() == null) { - String subscriptionId = ResourceManagerUtils.getDefaultSubscription(this.subscriptions().list()); - profile = new AzureProfile(profile.getTenantId(), subscriptionId, profile.getEnvironment()); - } - return new ResourceManager(httpPipeline, profile); - } - } - - private ResourceManager(HttpPipeline httpPipeline, AzureProfile profile) { - super( - null, - profile, - new ResourceManagementClientBuilder() - .pipeline(httpPipeline) - .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) - .subscriptionId(profile.getSubscriptionId()) - .buildClient()); - super.withResourceManager(this); - - this.featureClient = new FeatureClientBuilder() - .pipeline(httpPipeline) - .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) - .subscriptionId(profile.getSubscriptionId()) - .buildClient(); - - this.subscriptionClient = new SubscriptionClientBuilder() - .pipeline(httpPipeline) - .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) - .buildClient(); - - this.policyClient = new PolicyClientBuilder() - .pipeline(httpPipeline) - .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) - .subscriptionId(profile.getSubscriptionId()) - .buildClient(); - - this.managementLockClient = new ManagementLockClientBuilder() - .pipeline(httpPipeline) - .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) - .subscriptionId(profile.getSubscriptionId()) - .buildClient(); - - for (int i = 0; i < httpPipeline.getPolicyCount(); ++i) { - if (httpPipeline.getPolicy(i) instanceof ProviderRegistrationPolicy) { - ProviderRegistrationPolicy policy = (ProviderRegistrationPolicy) httpPipeline.getPolicy(i); - if (policy.getProviders() == null) { - policy.setProviders(providers()); - } - } - } - } - - /** - * @return wrapped inner feature client providing direct access to auto-generated API implementation, - * based on Azure REST API. - */ - public FeatureClient featureClient() { - return featureClient; - } - - /** - * @return wrapped inner subscription client providing direct access to auto-generated API implementation, - * based on Azure REST API. - */ - public SubscriptionClient subscriptionClient() { - return subscriptionClient; - } - - /** - * @return wrapped inner policy client providing direct access to auto-generated API implementation, - * based on Azure REST API. - */ - public PolicyClient policyClient() { - return policyClient; - } - - /** - * @return wrapped inner policy client providing direct access to auto-generated API implementation, - * based on Azure REST API. - */ - public ManagementLockClient managementLockClient() { - return managementLockClient; - } - - /** - * @return the resource group management API entry point - */ - public ResourceGroups resourceGroups() { - if (resourceGroups == null) { - resourceGroups = new ResourceGroupsImpl(this); - } - return resourceGroups; - } - - /** - * @return the generic resource management API entry point - */ - public GenericResources genericResources() { - if (genericResources == null) { - genericResources = new GenericResourcesImpl(this); - } - return genericResources; - } - - /** - * @return the deployment management API entry point - */ - public Deployments deployments() { - if (deployments == null) { - deployments = new DeploymentsImpl(this); - } - return deployments; - } - - /** - * @return the feature management API entry point - */ - public Features features() { - if (features == null) { - features = new FeaturesImpl(featureClient.getFeatures()); - } - return features; - } - - /** - * @return the resource provider management API entry point - */ - public Providers providers() { - if (providers == null) { - providers = new ProvidersImpl(serviceClient().getProviders()); - } - return providers; - } - - /** - * @return the policy definition management API entry point - */ - public PolicyDefinitions policyDefinitions() { - if (policyDefinitions == null) { - policyDefinitions = new PolicyDefinitionsImpl(policyClient.getPolicyDefinitions()); - } - return policyDefinitions; - } - - /** - * @return the policy assignment management API entry point - */ - public PolicyAssignments policyAssignments() { - if (policyAssignments == null) { - policyAssignments = new PolicyAssignmentsImpl(policyClient.getPolicyAssignments()); - } - return policyAssignments; - } - - /** - * @return the subscription management API entry point - */ - public Subscriptions subscriptions() { - if (subscriptions == null) { - subscriptions = new SubscriptionsImpl(subscriptionClient.getSubscriptions()); - } - return subscriptions; - } - - /** - * @return the tenant management API entry point - */ - public Tenants tenants() { - if (tenants == null) { - tenants = new TenantsImpl(subscriptionClient.getTenants()); - } - return tenants; - } - - /** - * @return the locks management API entry point - */ - public ManagementLocks managementLocks() { - if (managementLocks == null) { - managementLocks = new ManagementLocksImpl(this); - } - return managementLocks; - } - - /** - * @return the tag management API entry point - */ - public TagOperations tagOperations() { - if (tagOperations == null) { - tagOperations = new TagOperationsImpl(this); - } - return tagOperations; - } - - /** - * @return the {@link ResourceManagerUtils.InternalRuntimeContext} associated with this manager - */ - public ResourceManagerUtils.InternalRuntimeContext internalContext() { - if (internalContext == null) { - internalContext = new ResourceManagerUtils.InternalRuntimeContext(); - } - return this.internalContext; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/AuthorizationOperationsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/AuthorizationOperationsClient.java deleted file mode 100644 index 2fbd2217a65f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/AuthorizationOperationsClient.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.resources.fluent.models.OperationInner; - -/** An instance of this class provides access to all the operations defined in AuthorizationOperationsClient. */ -public interface AuthorizationOperationsClient { - /** - * Lists all of the available Microsoft.Authorization REST API operations. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Microsoft.Authorization operations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Lists all of the available Microsoft.Authorization REST API operations. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Microsoft.Authorization operations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Lists all of the available Microsoft.Authorization REST API operations. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Microsoft.Authorization operations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/DeploymentOperationsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/DeploymentOperationsClient.java deleted file mode 100644 index 6861cd007b76..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/DeploymentOperationsClient.java +++ /dev/null @@ -1,578 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.resources.fluent.models.DeploymentOperationInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in DeploymentOperationsClient. */ -public interface DeploymentOperationsClient { - /** - * Gets a deployments operation. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param operationId The ID of the operation to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployments operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getAtScopeWithResponseAsync( - String scope, String deploymentName, String operationId); - - /** - * Gets a deployments operation. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param operationId The ID of the operation to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployments operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAtScopeAsync(String scope, String deploymentName, String operationId); - - /** - * Gets a deployments operation. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param operationId The ID of the operation to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployments operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DeploymentOperationInner getAtScope(String scope, String deploymentName, String operationId); - - /** - * Gets a deployments operation. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param operationId The ID of the operation to get. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployments operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getAtScopeWithResponse( - String scope, String deploymentName, String operationId, Context context); - - /** - * Gets all deployments operations for a deployment. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param top The number of results to return. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments operations for a deployment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAtScopeAsync(String scope, String deploymentName, Integer top); - - /** - * Gets all deployments operations for a deployment. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments operations for a deployment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAtScopeAsync(String scope, String deploymentName); - - /** - * Gets all deployments operations for a deployment. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments operations for a deployment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listAtScope(String scope, String deploymentName); - - /** - * Gets all deployments operations for a deployment. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param top The number of results to return. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments operations for a deployment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listAtScope( - String scope, String deploymentName, Integer top, Context context); - - /** - * Gets a deployments operation. - * - * @param deploymentName The name of the deployment. - * @param operationId The ID of the operation to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployments operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getAtTenantScopeWithResponseAsync( - String deploymentName, String operationId); - - /** - * Gets a deployments operation. - * - * @param deploymentName The name of the deployment. - * @param operationId The ID of the operation to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployments operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAtTenantScopeAsync(String deploymentName, String operationId); - - /** - * Gets a deployments operation. - * - * @param deploymentName The name of the deployment. - * @param operationId The ID of the operation to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployments operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DeploymentOperationInner getAtTenantScope(String deploymentName, String operationId); - - /** - * Gets a deployments operation. - * - * @param deploymentName The name of the deployment. - * @param operationId The ID of the operation to get. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployments operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getAtTenantScopeWithResponse( - String deploymentName, String operationId, Context context); - - /** - * Gets all deployments operations for a deployment. - * - * @param deploymentName The name of the deployment. - * @param top The number of results to return. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments operations for a deployment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAtTenantScopeAsync(String deploymentName, Integer top); - - /** - * Gets all deployments operations for a deployment. - * - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments operations for a deployment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAtTenantScopeAsync(String deploymentName); - - /** - * Gets all deployments operations for a deployment. - * - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments operations for a deployment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listAtTenantScope(String deploymentName); - - /** - * Gets all deployments operations for a deployment. - * - * @param deploymentName The name of the deployment. - * @param top The number of results to return. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments operations for a deployment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listAtTenantScope(String deploymentName, Integer top, Context context); - - /** - * Gets a deployments operation. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param operationId The ID of the operation to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployments operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getAtManagementGroupScopeWithResponseAsync( - String groupId, String deploymentName, String operationId); - - /** - * Gets a deployments operation. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param operationId The ID of the operation to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployments operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAtManagementGroupScopeAsync( - String groupId, String deploymentName, String operationId); - - /** - * Gets a deployments operation. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param operationId The ID of the operation to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployments operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DeploymentOperationInner getAtManagementGroupScope(String groupId, String deploymentName, String operationId); - - /** - * Gets a deployments operation. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param operationId The ID of the operation to get. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployments operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getAtManagementGroupScopeWithResponse( - String groupId, String deploymentName, String operationId, Context context); - - /** - * Gets all deployments operations for a deployment. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param top The number of results to return. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments operations for a deployment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAtManagementGroupScopeAsync( - String groupId, String deploymentName, Integer top); - - /** - * Gets all deployments operations for a deployment. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments operations for a deployment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAtManagementGroupScopeAsync(String groupId, String deploymentName); - - /** - * Gets all deployments operations for a deployment. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments operations for a deployment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listAtManagementGroupScope(String groupId, String deploymentName); - - /** - * Gets all deployments operations for a deployment. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param top The number of results to return. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments operations for a deployment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listAtManagementGroupScope( - String groupId, String deploymentName, Integer top, Context context); - - /** - * Gets a deployments operation. - * - * @param deploymentName The name of the deployment. - * @param operationId The ID of the operation to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployments operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getAtSubscriptionScopeWithResponseAsync( - String deploymentName, String operationId); - - /** - * Gets a deployments operation. - * - * @param deploymentName The name of the deployment. - * @param operationId The ID of the operation to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployments operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAtSubscriptionScopeAsync(String deploymentName, String operationId); - - /** - * Gets a deployments operation. - * - * @param deploymentName The name of the deployment. - * @param operationId The ID of the operation to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployments operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DeploymentOperationInner getAtSubscriptionScope(String deploymentName, String operationId); - - /** - * Gets a deployments operation. - * - * @param deploymentName The name of the deployment. - * @param operationId The ID of the operation to get. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployments operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getAtSubscriptionScopeWithResponse( - String deploymentName, String operationId, Context context); - - /** - * Gets all deployments operations for a deployment. - * - * @param deploymentName The name of the deployment. - * @param top The number of results to return. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments operations for a deployment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAtSubscriptionScopeAsync(String deploymentName, Integer top); - - /** - * Gets all deployments operations for a deployment. - * - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments operations for a deployment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAtSubscriptionScopeAsync(String deploymentName); - - /** - * Gets all deployments operations for a deployment. - * - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments operations for a deployment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listAtSubscriptionScope(String deploymentName); - - /** - * Gets all deployments operations for a deployment. - * - * @param deploymentName The name of the deployment. - * @param top The number of results to return. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments operations for a deployment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listAtSubscriptionScope( - String deploymentName, Integer top, Context context); - - /** - * Gets a deployments operation. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of the deployment. - * @param operationId The ID of the operation to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployments operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync( - String resourceGroupName, String deploymentName, String operationId); - - /** - * Gets a deployments operation. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of the deployment. - * @param operationId The ID of the operation to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployments operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync(String resourceGroupName, String deploymentName, String operationId); - - /** - * Gets a deployments operation. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of the deployment. - * @param operationId The ID of the operation to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployments operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DeploymentOperationInner get(String resourceGroupName, String deploymentName, String operationId); - - /** - * Gets a deployments operation. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of the deployment. - * @param operationId The ID of the operation to get. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployments operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String deploymentName, String operationId, Context context); - - /** - * Gets all deployments operations for a deployment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of the deployment. - * @param top The number of results to return. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments operations for a deployment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync( - String resourceGroupName, String deploymentName, Integer top); - - /** - * Gets all deployments operations for a deployment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments operations for a deployment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName, String deploymentName); - - /** - * Gets all deployments operations for a deployment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments operations for a deployment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, String deploymentName); - - /** - * Gets all deployments operations for a deployment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of the deployment. - * @param top The number of results to return. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments operations for a deployment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup( - String resourceGroupName, String deploymentName, Integer top, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/DeploymentsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/DeploymentsClient.java deleted file mode 100644 index 8d654cca5426..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/DeploymentsClient.java +++ /dev/null @@ -1,3568 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.resources.fluent.models.DeploymentExportResultInner; -import com.azure.resourcemanager.resources.fluent.models.DeploymentExtendedInner; -import com.azure.resourcemanager.resources.fluent.models.DeploymentInner; -import com.azure.resourcemanager.resources.fluent.models.DeploymentValidateResultInner; -import com.azure.resourcemanager.resources.fluent.models.TemplateHashResultInner; -import com.azure.resourcemanager.resources.fluent.models.WhatIfOperationResultInner; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import com.azure.resourcemanager.resources.models.DeploymentWhatIf; -import com.azure.resourcemanager.resources.models.ScopedDeployment; -import com.azure.resourcemanager.resources.models.ScopedDeploymentWhatIf; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in DeploymentsClient. */ -public interface DeploymentsClient - extends InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete { - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteAtScopeWithResponseAsync(String scope, String deploymentName); - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAtScopeAsync(String scope, String deploymentName); - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDeleteAtScope(String scope, String deploymentName); - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDeleteAtScope(String scope, String deploymentName, Context context); - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAtScopeAsync(String scope, String deploymentName); - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deleteAtScope(String scope, String deploymentName); - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deleteAtScope(String scope, String deploymentName, Context context); - - /** - * Checks whether the deployment exists. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> checkExistenceAtScopeWithResponseAsync(String scope, String deploymentName); - - /** - * Checks whether the deployment exists. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono checkExistenceAtScopeAsync(String scope, String deploymentName); - - /** - * Checks whether the deployment exists. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - boolean checkExistenceAtScope(String scope, String deploymentName); - - /** - * Checks whether the deployment exists. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response checkExistenceAtScopeWithResponse(String scope, String deploymentName, Context context); - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateAtScopeWithResponseAsync( - String scope, String deploymentName, DeploymentInner parameters); - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, DeploymentExtendedInner> beginCreateOrUpdateAtScopeAsync( - String scope, String deploymentName, DeploymentInner parameters); - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, DeploymentExtendedInner> beginCreateOrUpdateAtScope( - String scope, String deploymentName, DeploymentInner parameters); - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, DeploymentExtendedInner> beginCreateOrUpdateAtScope( - String scope, String deploymentName, DeploymentInner parameters, Context context); - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAtScopeAsync( - String scope, String deploymentName, DeploymentInner parameters); - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DeploymentExtendedInner createOrUpdateAtScope(String scope, String deploymentName, DeploymentInner parameters); - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DeploymentExtendedInner createOrUpdateAtScope( - String scope, String deploymentName, DeploymentInner parameters, Context context); - - /** - * Gets a deployment. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getAtScopeWithResponseAsync(String scope, String deploymentName); - - /** - * Gets a deployment. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAtScopeAsync(String scope, String deploymentName); - - /** - * Gets a deployment. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DeploymentExtendedInner getAtScope(String scope, String deploymentName); - - /** - * Gets a deployment. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getAtScopeWithResponse(String scope, String deploymentName, Context context); - - /** - * You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is - * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running - * template deployment and leaves the resources partially deployed. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> cancelAtScopeWithResponseAsync(String scope, String deploymentName); - - /** - * You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is - * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running - * template deployment and leaves the resources partially deployed. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono cancelAtScopeAsync(String scope, String deploymentName); - - /** - * You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is - * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running - * template deployment and leaves the resources partially deployed. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void cancelAtScope(String scope, String deploymentName); - - /** - * You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is - * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running - * template deployment and leaves the resources partially deployed. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response cancelAtScopeWithResponse(String scope, String deploymentName, Context context); - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> validateAtScopeWithResponseAsync( - String scope, String deploymentName, DeploymentInner parameters); - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, DeploymentValidateResultInner> beginValidateAtScopeAsync( - String scope, String deploymentName, DeploymentInner parameters); - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, DeploymentValidateResultInner> beginValidateAtScope( - String scope, String deploymentName, DeploymentInner parameters); - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, DeploymentValidateResultInner> beginValidateAtScope( - String scope, String deploymentName, DeploymentInner parameters, Context context); - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono validateAtScopeAsync( - String scope, String deploymentName, DeploymentInner parameters); - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DeploymentValidateResultInner validateAtScope(String scope, String deploymentName, DeploymentInner parameters); - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DeploymentValidateResultInner validateAtScope( - String scope, String deploymentName, DeploymentInner parameters, Context context); - - /** - * Exports the template used for specified deployment. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deployment export result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> exportTemplateAtScopeWithResponseAsync( - String scope, String deploymentName); - - /** - * Exports the template used for specified deployment. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deployment export result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono exportTemplateAtScopeAsync(String scope, String deploymentName); - - /** - * Exports the template used for specified deployment. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deployment export result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DeploymentExportResultInner exportTemplateAtScope(String scope, String deploymentName); - - /** - * Exports the template used for specified deployment. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deployment export result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response exportTemplateAtScopeWithResponse( - String scope, String deploymentName, Context context); - - /** - * Get all the deployments at the given scope. - * - * @param scope The resource scope. - * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq - * '{state}'. - * @param top The number of results to get. If null is passed, returns all deployments. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the deployments at the given scope. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAtScopeAsync(String scope, String filter, Integer top); - - /** - * Get all the deployments at the given scope. - * - * @param scope The resource scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the deployments at the given scope. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAtScopeAsync(String scope); - - /** - * Get all the deployments at the given scope. - * - * @param scope The resource scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the deployments at the given scope. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listAtScope(String scope); - - /** - * Get all the deployments at the given scope. - * - * @param scope The resource scope. - * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq - * '{state}'. - * @param top The number of results to get. If null is passed, returns all deployments. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the deployments at the given scope. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listAtScope(String scope, String filter, Integer top, Context context); - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. - * - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteAtTenantScopeWithResponseAsync(String deploymentName); - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. - * - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAtTenantScopeAsync(String deploymentName); - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. - * - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDeleteAtTenantScope(String deploymentName); - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. - * - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDeleteAtTenantScope(String deploymentName, Context context); - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. - * - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAtTenantScopeAsync(String deploymentName); - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. - * - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deleteAtTenantScope(String deploymentName); - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. - * - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deleteAtTenantScope(String deploymentName, Context context); - - /** - * Checks whether the deployment exists. - * - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> checkExistenceAtTenantScopeWithResponseAsync(String deploymentName); - - /** - * Checks whether the deployment exists. - * - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono checkExistenceAtTenantScopeAsync(String deploymentName); - - /** - * Checks whether the deployment exists. - * - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - boolean checkExistenceAtTenantScope(String deploymentName); - - /** - * Checks whether the deployment exists. - * - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response checkExistenceAtTenantScopeWithResponse(String deploymentName, Context context); - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateAtTenantScopeWithResponseAsync( - String deploymentName, ScopedDeployment parameters); - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, DeploymentExtendedInner> beginCreateOrUpdateAtTenantScopeAsync( - String deploymentName, ScopedDeployment parameters); - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, DeploymentExtendedInner> beginCreateOrUpdateAtTenantScope( - String deploymentName, ScopedDeployment parameters); - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, DeploymentExtendedInner> beginCreateOrUpdateAtTenantScope( - String deploymentName, ScopedDeployment parameters, Context context); - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAtTenantScopeAsync(String deploymentName, ScopedDeployment parameters); - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DeploymentExtendedInner createOrUpdateAtTenantScope(String deploymentName, ScopedDeployment parameters); - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DeploymentExtendedInner createOrUpdateAtTenantScope( - String deploymentName, ScopedDeployment parameters, Context context); - - /** - * Gets a deployment. - * - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getAtTenantScopeWithResponseAsync(String deploymentName); - - /** - * Gets a deployment. - * - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAtTenantScopeAsync(String deploymentName); - - /** - * Gets a deployment. - * - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DeploymentExtendedInner getAtTenantScope(String deploymentName); - - /** - * Gets a deployment. - * - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getAtTenantScopeWithResponse(String deploymentName, Context context); - - /** - * You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is - * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running - * template deployment and leaves the resources partially deployed. - * - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> cancelAtTenantScopeWithResponseAsync(String deploymentName); - - /** - * You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is - * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running - * template deployment and leaves the resources partially deployed. - * - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono cancelAtTenantScopeAsync(String deploymentName); - - /** - * You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is - * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running - * template deployment and leaves the resources partially deployed. - * - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void cancelAtTenantScope(String deploymentName); - - /** - * You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is - * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running - * template deployment and leaves the resources partially deployed. - * - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response cancelAtTenantScopeWithResponse(String deploymentName, Context context); - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> validateAtTenantScopeWithResponseAsync( - String deploymentName, ScopedDeployment parameters); - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, DeploymentValidateResultInner> - beginValidateAtTenantScopeAsync(String deploymentName, ScopedDeployment parameters); - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, DeploymentValidateResultInner> beginValidateAtTenantScope( - String deploymentName, ScopedDeployment parameters); - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, DeploymentValidateResultInner> beginValidateAtTenantScope( - String deploymentName, ScopedDeployment parameters, Context context); - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono validateAtTenantScopeAsync(String deploymentName, ScopedDeployment parameters); - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DeploymentValidateResultInner validateAtTenantScope(String deploymentName, ScopedDeployment parameters); - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DeploymentValidateResultInner validateAtTenantScope( - String deploymentName, ScopedDeployment parameters, Context context); - - /** - * Returns changes that will be made by the deployment if executed at the scope of the tenant group. - * - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the What-If operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> whatIfAtTenantScopeWithResponseAsync( - String deploymentName, ScopedDeploymentWhatIf parameters); - - /** - * Returns changes that will be made by the deployment if executed at the scope of the tenant group. - * - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the What-If operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, WhatIfOperationResultInner> beginWhatIfAtTenantScopeAsync( - String deploymentName, ScopedDeploymentWhatIf parameters); - - /** - * Returns changes that will be made by the deployment if executed at the scope of the tenant group. - * - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the What-If operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, WhatIfOperationResultInner> beginWhatIfAtTenantScope( - String deploymentName, ScopedDeploymentWhatIf parameters); - - /** - * Returns changes that will be made by the deployment if executed at the scope of the tenant group. - * - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the What-If operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, WhatIfOperationResultInner> beginWhatIfAtTenantScope( - String deploymentName, ScopedDeploymentWhatIf parameters, Context context); - - /** - * Returns changes that will be made by the deployment if executed at the scope of the tenant group. - * - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the What-If operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono whatIfAtTenantScopeAsync(String deploymentName, ScopedDeploymentWhatIf parameters); - - /** - * Returns changes that will be made by the deployment if executed at the scope of the tenant group. - * - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the What-If operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - WhatIfOperationResultInner whatIfAtTenantScope(String deploymentName, ScopedDeploymentWhatIf parameters); - - /** - * Returns changes that will be made by the deployment if executed at the scope of the tenant group. - * - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the What-If operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - WhatIfOperationResultInner whatIfAtTenantScope( - String deploymentName, ScopedDeploymentWhatIf parameters, Context context); - - /** - * Exports the template used for specified deployment. - * - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deployment export result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> exportTemplateAtTenantScopeWithResponseAsync(String deploymentName); - - /** - * Exports the template used for specified deployment. - * - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deployment export result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono exportTemplateAtTenantScopeAsync(String deploymentName); - - /** - * Exports the template used for specified deployment. - * - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deployment export result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DeploymentExportResultInner exportTemplateAtTenantScope(String deploymentName); - - /** - * Exports the template used for specified deployment. - * - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deployment export result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response exportTemplateAtTenantScopeWithResponse( - String deploymentName, Context context); - - /** - * Get all the deployments at the tenant scope. - * - * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq - * '{state}'. - * @param top The number of results to get. If null is passed, returns all deployments. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the deployments at the tenant scope. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAtTenantScopeAsync(String filter, Integer top); - - /** - * Get all the deployments at the tenant scope. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the deployments at the tenant scope. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAtTenantScopeAsync(); - - /** - * Get all the deployments at the tenant scope. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the deployments at the tenant scope. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listAtTenantScope(); - - /** - * Get all the deployments at the tenant scope. - * - * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq - * '{state}'. - * @param top The number of results to get. If null is passed, returns all deployments. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the deployments at the tenant scope. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listAtTenantScope(String filter, Integer top, Context context); - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteAtManagementGroupScopeWithResponseAsync( - String groupId, String deploymentName); - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAtManagementGroupScopeAsync(String groupId, String deploymentName); - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDeleteAtManagementGroupScope(String groupId, String deploymentName); - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDeleteAtManagementGroupScope( - String groupId, String deploymentName, Context context); - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAtManagementGroupScopeAsync(String groupId, String deploymentName); - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deleteAtManagementGroupScope(String groupId, String deploymentName); - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deleteAtManagementGroupScope(String groupId, String deploymentName, Context context); - - /** - * Checks whether the deployment exists. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> checkExistenceAtManagementGroupScopeWithResponseAsync( - String groupId, String deploymentName); - - /** - * Checks whether the deployment exists. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono checkExistenceAtManagementGroupScopeAsync(String groupId, String deploymentName); - - /** - * Checks whether the deployment exists. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - boolean checkExistenceAtManagementGroupScope(String groupId, String deploymentName); - - /** - * Checks whether the deployment exists. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response checkExistenceAtManagementGroupScopeWithResponse( - String groupId, String deploymentName, Context context); - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateAtManagementGroupScopeWithResponseAsync( - String groupId, String deploymentName, ScopedDeployment parameters); - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, DeploymentExtendedInner> - beginCreateOrUpdateAtManagementGroupScopeAsync( - String groupId, String deploymentName, ScopedDeployment parameters); - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, DeploymentExtendedInner> beginCreateOrUpdateAtManagementGroupScope( - String groupId, String deploymentName, ScopedDeployment parameters); - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, DeploymentExtendedInner> beginCreateOrUpdateAtManagementGroupScope( - String groupId, String deploymentName, ScopedDeployment parameters, Context context); - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAtManagementGroupScopeAsync( - String groupId, String deploymentName, ScopedDeployment parameters); - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DeploymentExtendedInner createOrUpdateAtManagementGroupScope( - String groupId, String deploymentName, ScopedDeployment parameters); - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DeploymentExtendedInner createOrUpdateAtManagementGroupScope( - String groupId, String deploymentName, ScopedDeployment parameters, Context context); - - /** - * Gets a deployment. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getAtManagementGroupScopeWithResponseAsync( - String groupId, String deploymentName); - - /** - * Gets a deployment. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAtManagementGroupScopeAsync(String groupId, String deploymentName); - - /** - * Gets a deployment. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DeploymentExtendedInner getAtManagementGroupScope(String groupId, String deploymentName); - - /** - * Gets a deployment. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getAtManagementGroupScopeWithResponse( - String groupId, String deploymentName, Context context); - - /** - * You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is - * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running - * template deployment and leaves the resources partially deployed. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> cancelAtManagementGroupScopeWithResponseAsync(String groupId, String deploymentName); - - /** - * You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is - * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running - * template deployment and leaves the resources partially deployed. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono cancelAtManagementGroupScopeAsync(String groupId, String deploymentName); - - /** - * You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is - * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running - * template deployment and leaves the resources partially deployed. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void cancelAtManagementGroupScope(String groupId, String deploymentName); - - /** - * You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is - * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running - * template deployment and leaves the resources partially deployed. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response cancelAtManagementGroupScopeWithResponse(String groupId, String deploymentName, Context context); - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> validateAtManagementGroupScopeWithResponseAsync( - String groupId, String deploymentName, ScopedDeployment parameters); - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, DeploymentValidateResultInner> - beginValidateAtManagementGroupScopeAsync(String groupId, String deploymentName, ScopedDeployment parameters); - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, DeploymentValidateResultInner> - beginValidateAtManagementGroupScope(String groupId, String deploymentName, ScopedDeployment parameters); - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, DeploymentValidateResultInner> - beginValidateAtManagementGroupScope( - String groupId, String deploymentName, ScopedDeployment parameters, Context context); - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono validateAtManagementGroupScopeAsync( - String groupId, String deploymentName, ScopedDeployment parameters); - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DeploymentValidateResultInner validateAtManagementGroupScope( - String groupId, String deploymentName, ScopedDeployment parameters); - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DeploymentValidateResultInner validateAtManagementGroupScope( - String groupId, String deploymentName, ScopedDeployment parameters, Context context); - - /** - * Returns changes that will be made by the deployment if executed at the scope of the management group. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the What-If operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> whatIfAtManagementGroupScopeWithResponseAsync( - String groupId, String deploymentName, ScopedDeploymentWhatIf parameters); - - /** - * Returns changes that will be made by the deployment if executed at the scope of the management group. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the What-If operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, WhatIfOperationResultInner> - beginWhatIfAtManagementGroupScopeAsync( - String groupId, String deploymentName, ScopedDeploymentWhatIf parameters); - - /** - * Returns changes that will be made by the deployment if executed at the scope of the management group. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the What-If operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, WhatIfOperationResultInner> beginWhatIfAtManagementGroupScope( - String groupId, String deploymentName, ScopedDeploymentWhatIf parameters); - - /** - * Returns changes that will be made by the deployment if executed at the scope of the management group. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the What-If operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, WhatIfOperationResultInner> beginWhatIfAtManagementGroupScope( - String groupId, String deploymentName, ScopedDeploymentWhatIf parameters, Context context); - - /** - * Returns changes that will be made by the deployment if executed at the scope of the management group. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the What-If operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono whatIfAtManagementGroupScopeAsync( - String groupId, String deploymentName, ScopedDeploymentWhatIf parameters); - - /** - * Returns changes that will be made by the deployment if executed at the scope of the management group. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the What-If operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - WhatIfOperationResultInner whatIfAtManagementGroupScope( - String groupId, String deploymentName, ScopedDeploymentWhatIf parameters); - - /** - * Returns changes that will be made by the deployment if executed at the scope of the management group. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the What-If operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - WhatIfOperationResultInner whatIfAtManagementGroupScope( - String groupId, String deploymentName, ScopedDeploymentWhatIf parameters, Context context); - - /** - * Exports the template used for specified deployment. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deployment export result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> exportTemplateAtManagementGroupScopeWithResponseAsync( - String groupId, String deploymentName); - - /** - * Exports the template used for specified deployment. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deployment export result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono exportTemplateAtManagementGroupScopeAsync(String groupId, String deploymentName); - - /** - * Exports the template used for specified deployment. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deployment export result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DeploymentExportResultInner exportTemplateAtManagementGroupScope(String groupId, String deploymentName); - - /** - * Exports the template used for specified deployment. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deployment export result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response exportTemplateAtManagementGroupScopeWithResponse( - String groupId, String deploymentName, Context context); - - /** - * Get all the deployments for a management group. - * - * @param groupId The management group ID. - * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq - * '{state}'. - * @param top The number of results to get. If null is passed, returns all deployments. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the deployments for a management group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAtManagementGroupScopeAsync(String groupId, String filter, Integer top); - - /** - * Get all the deployments for a management group. - * - * @param groupId The management group ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the deployments for a management group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAtManagementGroupScopeAsync(String groupId); - - /** - * Get all the deployments for a management group. - * - * @param groupId The management group ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the deployments for a management group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listAtManagementGroupScope(String groupId); - - /** - * Get all the deployments for a management group. - * - * @param groupId The management group ID. - * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq - * '{state}'. - * @param top The number of results to get. If null is passed, returns all deployments. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the deployments for a management group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listAtManagementGroupScope( - String groupId, String filter, Integer top, Context context); - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. - * - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteAtSubscriptionScopeWithResponseAsync(String deploymentName); - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. - * - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAtSubscriptionScopeAsync(String deploymentName); - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. - * - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDeleteAtSubscriptionScope(String deploymentName); - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. - * - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDeleteAtSubscriptionScope(String deploymentName, Context context); - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. - * - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAtSubscriptionScopeAsync(String deploymentName); - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. - * - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deleteAtSubscriptionScope(String deploymentName); - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. - * - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deleteAtSubscriptionScope(String deploymentName, Context context); - - /** - * Checks whether the deployment exists. - * - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> checkExistenceAtSubscriptionScopeWithResponseAsync(String deploymentName); - - /** - * Checks whether the deployment exists. - * - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono checkExistenceAtSubscriptionScopeAsync(String deploymentName); - - /** - * Checks whether the deployment exists. - * - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - boolean checkExistenceAtSubscriptionScope(String deploymentName); - - /** - * Checks whether the deployment exists. - * - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response checkExistenceAtSubscriptionScopeWithResponse(String deploymentName, Context context); - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateAtSubscriptionScopeWithResponseAsync( - String deploymentName, DeploymentInner parameters); - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, DeploymentExtendedInner> - beginCreateOrUpdateAtSubscriptionScopeAsync(String deploymentName, DeploymentInner parameters); - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, DeploymentExtendedInner> beginCreateOrUpdateAtSubscriptionScope( - String deploymentName, DeploymentInner parameters); - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, DeploymentExtendedInner> beginCreateOrUpdateAtSubscriptionScope( - String deploymentName, DeploymentInner parameters, Context context); - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAtSubscriptionScopeAsync( - String deploymentName, DeploymentInner parameters); - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DeploymentExtendedInner createOrUpdateAtSubscriptionScope(String deploymentName, DeploymentInner parameters); - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DeploymentExtendedInner createOrUpdateAtSubscriptionScope( - String deploymentName, DeploymentInner parameters, Context context); - - /** - * Gets a deployment. - * - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getAtSubscriptionScopeWithResponseAsync(String deploymentName); - - /** - * Gets a deployment. - * - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAtSubscriptionScopeAsync(String deploymentName); - - /** - * Gets a deployment. - * - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DeploymentExtendedInner getAtSubscriptionScope(String deploymentName); - - /** - * Gets a deployment. - * - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getAtSubscriptionScopeWithResponse(String deploymentName, Context context); - - /** - * You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is - * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running - * template deployment and leaves the resources partially deployed. - * - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> cancelAtSubscriptionScopeWithResponseAsync(String deploymentName); - - /** - * You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is - * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running - * template deployment and leaves the resources partially deployed. - * - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono cancelAtSubscriptionScopeAsync(String deploymentName); - - /** - * You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is - * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running - * template deployment and leaves the resources partially deployed. - * - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void cancelAtSubscriptionScope(String deploymentName); - - /** - * You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is - * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running - * template deployment and leaves the resources partially deployed. - * - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response cancelAtSubscriptionScopeWithResponse(String deploymentName, Context context); - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> validateAtSubscriptionScopeWithResponseAsync( - String deploymentName, DeploymentInner parameters); - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, DeploymentValidateResultInner> - beginValidateAtSubscriptionScopeAsync(String deploymentName, DeploymentInner parameters); - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, DeploymentValidateResultInner> - beginValidateAtSubscriptionScope(String deploymentName, DeploymentInner parameters); - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, DeploymentValidateResultInner> - beginValidateAtSubscriptionScope(String deploymentName, DeploymentInner parameters, Context context); - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono validateAtSubscriptionScopeAsync( - String deploymentName, DeploymentInner parameters); - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DeploymentValidateResultInner validateAtSubscriptionScope(String deploymentName, DeploymentInner parameters); - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DeploymentValidateResultInner validateAtSubscriptionScope( - String deploymentName, DeploymentInner parameters, Context context); - - /** - * Returns changes that will be made by the deployment if executed at the scope of the subscription. - * - * @param deploymentName The name of the deployment. - * @param parameters Parameters to What If. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the What-If operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> whatIfAtSubscriptionScopeWithResponseAsync( - String deploymentName, DeploymentWhatIf parameters); - - /** - * Returns changes that will be made by the deployment if executed at the scope of the subscription. - * - * @param deploymentName The name of the deployment. - * @param parameters Parameters to What If. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the What-If operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, WhatIfOperationResultInner> beginWhatIfAtSubscriptionScopeAsync( - String deploymentName, DeploymentWhatIf parameters); - - /** - * Returns changes that will be made by the deployment if executed at the scope of the subscription. - * - * @param deploymentName The name of the deployment. - * @param parameters Parameters to What If. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the What-If operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, WhatIfOperationResultInner> beginWhatIfAtSubscriptionScope( - String deploymentName, DeploymentWhatIf parameters); - - /** - * Returns changes that will be made by the deployment if executed at the scope of the subscription. - * - * @param deploymentName The name of the deployment. - * @param parameters Parameters to What If. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the What-If operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, WhatIfOperationResultInner> beginWhatIfAtSubscriptionScope( - String deploymentName, DeploymentWhatIf parameters, Context context); - - /** - * Returns changes that will be made by the deployment if executed at the scope of the subscription. - * - * @param deploymentName The name of the deployment. - * @param parameters Parameters to What If. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the What-If operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono whatIfAtSubscriptionScopeAsync(String deploymentName, DeploymentWhatIf parameters); - - /** - * Returns changes that will be made by the deployment if executed at the scope of the subscription. - * - * @param deploymentName The name of the deployment. - * @param parameters Parameters to What If. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the What-If operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - WhatIfOperationResultInner whatIfAtSubscriptionScope(String deploymentName, DeploymentWhatIf parameters); - - /** - * Returns changes that will be made by the deployment if executed at the scope of the subscription. - * - * @param deploymentName The name of the deployment. - * @param parameters Parameters to What If. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the What-If operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - WhatIfOperationResultInner whatIfAtSubscriptionScope( - String deploymentName, DeploymentWhatIf parameters, Context context); - - /** - * Exports the template used for specified deployment. - * - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deployment export result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> exportTemplateAtSubscriptionScopeWithResponseAsync( - String deploymentName); - - /** - * Exports the template used for specified deployment. - * - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deployment export result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono exportTemplateAtSubscriptionScopeAsync(String deploymentName); - - /** - * Exports the template used for specified deployment. - * - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deployment export result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DeploymentExportResultInner exportTemplateAtSubscriptionScope(String deploymentName); - - /** - * Exports the template used for specified deployment. - * - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deployment export result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response exportTemplateAtSubscriptionScopeWithResponse( - String deploymentName, Context context); - - /** - * Get all the deployments for a subscription. - * - * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq - * '{state}'. - * @param top The number of results to get. If null is passed, returns all deployments. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the deployments for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String filter, Integer top); - - /** - * Get all the deployments for a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the deployments for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Get all the deployments for a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the deployments for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Get all the deployments for a subscription. - * - * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq - * '{state}'. - * @param top The number of results to get. If null is passed, returns all deployments. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the deployments for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String filter, Integer top, Context context); - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. Deleting a template deployment does not affect the state of the resource group. - * This is an asynchronous operation that returns a status of 202 until the template deployment is successfully - * deleted. The Location response header contains the URI that is used to obtain the status of the process. While - * the process is running, a call to the URI in the Location header returns a status of 202. When the process - * finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, - * the URI in the Location header returns an error-level status code. - * - * @param resourceGroupName The name of the resource group with the deployment to delete. The name is case - * insensitive. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync(String resourceGroupName, String deploymentName); - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. Deleting a template deployment does not affect the state of the resource group. - * This is an asynchronous operation that returns a status of 202 until the template deployment is successfully - * deleted. The Location response header contains the URI that is used to obtain the status of the process. While - * the process is running, a call to the URI in the Location header returns a status of 202. When the process - * finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, - * the URI in the Location header returns an error-level status code. - * - * @param resourceGroupName The name of the resource group with the deployment to delete. The name is case - * insensitive. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String deploymentName); - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. Deleting a template deployment does not affect the state of the resource group. - * This is an asynchronous operation that returns a status of 202 until the template deployment is successfully - * deleted. The Location response header contains the URI that is used to obtain the status of the process. While - * the process is running, a call to the URI in the Location header returns a status of 202. When the process - * finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, - * the URI in the Location header returns an error-level status code. - * - * @param resourceGroupName The name of the resource group with the deployment to delete. The name is case - * insensitive. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String deploymentName); - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. Deleting a template deployment does not affect the state of the resource group. - * This is an asynchronous operation that returns a status of 202 until the template deployment is successfully - * deleted. The Location response header contains the URI that is used to obtain the status of the process. While - * the process is running, a call to the URI in the Location header returns a status of 202. When the process - * finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, - * the URI in the Location header returns an error-level status code. - * - * @param resourceGroupName The name of the resource group with the deployment to delete. The name is case - * insensitive. - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String deploymentName, Context context); - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. Deleting a template deployment does not affect the state of the resource group. - * This is an asynchronous operation that returns a status of 202 until the template deployment is successfully - * deleted. The Location response header contains the URI that is used to obtain the status of the process. While - * the process is running, a call to the URI in the Location header returns a status of 202. When the process - * finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, - * the URI in the Location header returns an error-level status code. - * - * @param resourceGroupName The name of the resource group with the deployment to delete. The name is case - * insensitive. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String deploymentName); - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. Deleting a template deployment does not affect the state of the resource group. - * This is an asynchronous operation that returns a status of 202 until the template deployment is successfully - * deleted. The Location response header contains the URI that is used to obtain the status of the process. While - * the process is running, a call to the URI in the Location header returns a status of 202. When the process - * finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, - * the URI in the Location header returns an error-level status code. - * - * @param resourceGroupName The name of the resource group with the deployment to delete. The name is case - * insensitive. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String deploymentName); - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. Deleting a template deployment does not affect the state of the resource group. - * This is an asynchronous operation that returns a status of 202 until the template deployment is successfully - * deleted. The Location response header contains the URI that is used to obtain the status of the process. While - * the process is running, a call to the URI in the Location header returns a status of 202. When the process - * finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, - * the URI in the Location header returns an error-level status code. - * - * @param resourceGroupName The name of the resource group with the deployment to delete. The name is case - * insensitive. - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String deploymentName, Context context); - - /** - * Checks whether the deployment exists. - * - * @param resourceGroupName The name of the resource group with the deployment to check. The name is case - * insensitive. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> checkExistenceWithResponseAsync(String resourceGroupName, String deploymentName); - - /** - * Checks whether the deployment exists. - * - * @param resourceGroupName The name of the resource group with the deployment to check. The name is case - * insensitive. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono checkExistenceAsync(String resourceGroupName, String deploymentName); - - /** - * Checks whether the deployment exists. - * - * @param resourceGroupName The name of the resource group with the deployment to check. The name is case - * insensitive. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - boolean checkExistence(String resourceGroupName, String deploymentName); - - /** - * Checks whether the deployment exists. - * - * @param resourceGroupName The name of the resource group with the deployment to check. The name is case - * insensitive. - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response checkExistenceWithResponse(String resourceGroupName, String deploymentName, Context context); - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param resourceGroupName The name of the resource group to deploy the resources to. The name is case insensitive. - * The resource group must already exist. - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String deploymentName, DeploymentInner parameters); - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param resourceGroupName The name of the resource group to deploy the resources to. The name is case insensitive. - * The resource group must already exist. - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, DeploymentExtendedInner> beginCreateOrUpdateAsync( - String resourceGroupName, String deploymentName, DeploymentInner parameters); - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param resourceGroupName The name of the resource group to deploy the resources to. The name is case insensitive. - * The resource group must already exist. - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, DeploymentExtendedInner> beginCreateOrUpdate( - String resourceGroupName, String deploymentName, DeploymentInner parameters); - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param resourceGroupName The name of the resource group to deploy the resources to. The name is case insensitive. - * The resource group must already exist. - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, DeploymentExtendedInner> beginCreateOrUpdate( - String resourceGroupName, String deploymentName, DeploymentInner parameters, Context context); - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param resourceGroupName The name of the resource group to deploy the resources to. The name is case insensitive. - * The resource group must already exist. - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, String deploymentName, DeploymentInner parameters); - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param resourceGroupName The name of the resource group to deploy the resources to. The name is case insensitive. - * The resource group must already exist. - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DeploymentExtendedInner createOrUpdate(String resourceGroupName, String deploymentName, DeploymentInner parameters); - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param resourceGroupName The name of the resource group to deploy the resources to. The name is case insensitive. - * The resource group must already exist. - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DeploymentExtendedInner createOrUpdate( - String resourceGroupName, String deploymentName, DeploymentInner parameters, Context context); - - /** - * Gets a deployment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String deploymentName); - - /** - * Gets a deployment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync(String resourceGroupName, String deploymentName); - - /** - * Gets a deployment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DeploymentExtendedInner getByResourceGroup(String resourceGroupName, String deploymentName); - - /** - * Gets a deployment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String deploymentName, Context context); - - /** - * You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is - * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running - * template deployment and leaves the resource group partially deployed. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> cancelWithResponseAsync(String resourceGroupName, String deploymentName); - - /** - * You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is - * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running - * template deployment and leaves the resource group partially deployed. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono cancelAsync(String resourceGroupName, String deploymentName); - - /** - * You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is - * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running - * template deployment and leaves the resource group partially deployed. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void cancel(String resourceGroupName, String deploymentName); - - /** - * You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is - * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running - * template deployment and leaves the resource group partially deployed. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response cancelWithResponse(String resourceGroupName, String deploymentName, Context context); - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case - * insensitive. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> validateWithResponseAsync( - String resourceGroupName, String deploymentName, DeploymentInner parameters); - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case - * insensitive. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, DeploymentValidateResultInner> beginValidateAsync( - String resourceGroupName, String deploymentName, DeploymentInner parameters); - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case - * insensitive. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, DeploymentValidateResultInner> beginValidate( - String resourceGroupName, String deploymentName, DeploymentInner parameters); - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case - * insensitive. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, DeploymentValidateResultInner> beginValidate( - String resourceGroupName, String deploymentName, DeploymentInner parameters, Context context); - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case - * insensitive. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono validateAsync( - String resourceGroupName, String deploymentName, DeploymentInner parameters); - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case - * insensitive. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DeploymentValidateResultInner validate(String resourceGroupName, String deploymentName, DeploymentInner parameters); - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case - * insensitive. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DeploymentValidateResultInner validate( - String resourceGroupName, String deploymentName, DeploymentInner parameters, Context context); - - /** - * Returns changes that will be made by the deployment if executed at the scope of the resource group. - * - * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case - * insensitive. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the What-If operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> whatIfWithResponseAsync( - String resourceGroupName, String deploymentName, DeploymentWhatIf parameters); - - /** - * Returns changes that will be made by the deployment if executed at the scope of the resource group. - * - * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case - * insensitive. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the What-If operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, WhatIfOperationResultInner> beginWhatIfAsync( - String resourceGroupName, String deploymentName, DeploymentWhatIf parameters); - - /** - * Returns changes that will be made by the deployment if executed at the scope of the resource group. - * - * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case - * insensitive. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the What-If operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, WhatIfOperationResultInner> beginWhatIf( - String resourceGroupName, String deploymentName, DeploymentWhatIf parameters); - - /** - * Returns changes that will be made by the deployment if executed at the scope of the resource group. - * - * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case - * insensitive. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the What-If operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, WhatIfOperationResultInner> beginWhatIf( - String resourceGroupName, String deploymentName, DeploymentWhatIf parameters, Context context); - - /** - * Returns changes that will be made by the deployment if executed at the scope of the resource group. - * - * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case - * insensitive. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the What-If operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono whatIfAsync( - String resourceGroupName, String deploymentName, DeploymentWhatIf parameters); - - /** - * Returns changes that will be made by the deployment if executed at the scope of the resource group. - * - * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case - * insensitive. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the What-If operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - WhatIfOperationResultInner whatIf(String resourceGroupName, String deploymentName, DeploymentWhatIf parameters); - - /** - * Returns changes that will be made by the deployment if executed at the scope of the resource group. - * - * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case - * insensitive. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the What-If operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - WhatIfOperationResultInner whatIf( - String resourceGroupName, String deploymentName, DeploymentWhatIf parameters, Context context); - - /** - * Exports the template used for specified deployment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deployment export result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> exportTemplateWithResponseAsync( - String resourceGroupName, String deploymentName); - - /** - * Exports the template used for specified deployment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deployment export result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono exportTemplateAsync(String resourceGroupName, String deploymentName); - - /** - * Exports the template used for specified deployment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deployment export result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DeploymentExportResultInner exportTemplate(String resourceGroupName, String deploymentName); - - /** - * Exports the template used for specified deployment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deployment export result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response exportTemplateWithResponse( - String resourceGroupName, String deploymentName, Context context); - - /** - * Get all the deployments for a resource group. - * - * @param resourceGroupName The name of the resource group with the deployments to get. The name is case - * insensitive. - * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq - * '{state}'. - * @param top The number of results to get. If null is passed, returns all deployments. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the deployments for a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName, String filter, Integer top); - - /** - * Get all the deployments for a resource group. - * - * @param resourceGroupName The name of the resource group with the deployments to get. The name is case - * insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the deployments for a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName); - - /** - * Get all the deployments for a resource group. - * - * @param resourceGroupName The name of the resource group with the deployments to get. The name is case - * insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the deployments for a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Get all the deployments for a resource group. - * - * @param resourceGroupName The name of the resource group with the deployments to get. The name is case - * insensitive. - * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq - * '{state}'. - * @param top The number of results to get. If null is passed, returns all deployments. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the deployments for a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup( - String resourceGroupName, String filter, Integer top, Context context); - - /** - * Calculate the hash of the given template. - * - * @param template The template provided to calculate hash. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to calculate template hash. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> calculateTemplateHashWithResponseAsync(Object template); - - /** - * Calculate the hash of the given template. - * - * @param template The template provided to calculate hash. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to calculate template hash. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono calculateTemplateHashAsync(Object template); - - /** - * Calculate the hash of the given template. - * - * @param template The template provided to calculate hash. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to calculate template hash. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - TemplateHashResultInner calculateTemplateHash(Object template); - - /** - * Calculate the hash of the given template. - * - * @param template The template provided to calculate hash. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to calculate template hash. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response calculateTemplateHashWithResponse(Object template, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/FeatureClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/FeatureClient.java deleted file mode 100644 index da508383c523..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/FeatureClient.java +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.resources.fluent.models.OperationInner; -import java.time.Duration; - -/** The interface for FeatureClient class. */ -public interface FeatureClient { - /** - * Gets The ID of the target subscription. - * - * @return the subscriptionId value. - */ - String getSubscriptionId(); - - /** - * Gets server parameter. - * - * @return the endpoint value. - */ - String getEndpoint(); - - /** - * Gets Api Version. - * - * @return the apiVersion value. - */ - String getApiVersion(); - - /** - * Gets The HTTP pipeline to send requests through. - * - * @return the httpPipeline value. - */ - HttpPipeline getHttpPipeline(); - - /** - * Gets The default poll interval for long-running operation. - * - * @return the defaultPollInterval value. - */ - Duration getDefaultPollInterval(); - - /** - * Gets the FeaturesClient object to access its operations. - * - * @return the FeaturesClient object. - */ - FeaturesClient getFeatures(); - - /** - * Lists all of the available Microsoft.Features REST API operations. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Microsoft.Features operations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listOperationsAsync(); - - /** - * Lists all of the available Microsoft.Features REST API operations. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Microsoft.Features operations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listOperations(); - - /** - * Lists all of the available Microsoft.Features REST API operations. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Microsoft.Features operations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listOperations(Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/FeaturesClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/FeaturesClient.java deleted file mode 100644 index 8ee7ea6e0142..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/FeaturesClient.java +++ /dev/null @@ -1,248 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.resources.fluent.models.FeatureResultInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in FeaturesClient. */ -public interface FeaturesClient { - /** - * Gets all the preview features that are available through AFEC for the subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the preview features that are available through AFEC for the subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAllAsync(); - - /** - * Gets all the preview features that are available through AFEC for the subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the preview features that are available through AFEC for the subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listAll(); - - /** - * Gets all the preview features that are available through AFEC for the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the preview features that are available through AFEC for the subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listAll(Context context); - - /** - * Gets all the preview features in a provider namespace that are available through AFEC for the subscription. - * - * @param resourceProviderNamespace The namespace of the resource provider for getting features. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the preview features in a provider namespace that are available through AFEC for the subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String resourceProviderNamespace); - - /** - * Gets all the preview features in a provider namespace that are available through AFEC for the subscription. - * - * @param resourceProviderNamespace The namespace of the resource provider for getting features. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the preview features in a provider namespace that are available through AFEC for the subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceProviderNamespace); - - /** - * Gets all the preview features in a provider namespace that are available through AFEC for the subscription. - * - * @param resourceProviderNamespace The namespace of the resource provider for getting features. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the preview features in a provider namespace that are available through AFEC for the subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceProviderNamespace, Context context); - - /** - * Gets the preview feature with the specified name. - * - * @param resourceProviderNamespace The resource provider namespace for the feature. - * @param featureName The name of the feature to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the preview feature with the specified name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync(String resourceProviderNamespace, String featureName); - - /** - * Gets the preview feature with the specified name. - * - * @param resourceProviderNamespace The resource provider namespace for the feature. - * @param featureName The name of the feature to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the preview feature with the specified name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync(String resourceProviderNamespace, String featureName); - - /** - * Gets the preview feature with the specified name. - * - * @param resourceProviderNamespace The resource provider namespace for the feature. - * @param featureName The name of the feature to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the preview feature with the specified name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - FeatureResultInner get(String resourceProviderNamespace, String featureName); - - /** - * Gets the preview feature with the specified name. - * - * @param resourceProviderNamespace The resource provider namespace for the feature. - * @param featureName The name of the feature to get. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the preview feature with the specified name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceProviderNamespace, String featureName, Context context); - - /** - * Registers the preview feature for the subscription. - * - * @param resourceProviderNamespace The namespace of the resource provider. - * @param featureName The name of the feature to register. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return previewed feature information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> registerWithResponseAsync(String resourceProviderNamespace, String featureName); - - /** - * Registers the preview feature for the subscription. - * - * @param resourceProviderNamespace The namespace of the resource provider. - * @param featureName The name of the feature to register. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return previewed feature information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono registerAsync(String resourceProviderNamespace, String featureName); - - /** - * Registers the preview feature for the subscription. - * - * @param resourceProviderNamespace The namespace of the resource provider. - * @param featureName The name of the feature to register. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return previewed feature information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - FeatureResultInner register(String resourceProviderNamespace, String featureName); - - /** - * Registers the preview feature for the subscription. - * - * @param resourceProviderNamespace The namespace of the resource provider. - * @param featureName The name of the feature to register. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return previewed feature information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response registerWithResponse( - String resourceProviderNamespace, String featureName, Context context); - - /** - * Unregisters the preview feature for the subscription. - * - * @param resourceProviderNamespace The namespace of the resource provider. - * @param featureName The name of the feature to unregister. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return previewed feature information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> unregisterWithResponseAsync( - String resourceProviderNamespace, String featureName); - - /** - * Unregisters the preview feature for the subscription. - * - * @param resourceProviderNamespace The namespace of the resource provider. - * @param featureName The name of the feature to unregister. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return previewed feature information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono unregisterAsync(String resourceProviderNamespace, String featureName); - - /** - * Unregisters the preview feature for the subscription. - * - * @param resourceProviderNamespace The namespace of the resource provider. - * @param featureName The name of the feature to unregister. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return previewed feature information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - FeatureResultInner unregister(String resourceProviderNamespace, String featureName); - - /** - * Unregisters the preview feature for the subscription. - * - * @param resourceProviderNamespace The namespace of the resource provider. - * @param featureName The name of the feature to unregister. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return previewed feature information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response unregisterWithResponse( - String resourceProviderNamespace, String featureName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/ManagementLockClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/ManagementLockClient.java deleted file mode 100644 index 5bb35f46e7bf..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/ManagementLockClient.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.fluent; - -import com.azure.core.http.HttpPipeline; -import java.time.Duration; - -/** The interface for ManagementLockClient class. */ -public interface ManagementLockClient { - /** - * Gets The ID of the target subscription. - * - * @return the subscriptionId value. - */ - String getSubscriptionId(); - - /** - * Gets server parameter. - * - * @return the endpoint value. - */ - String getEndpoint(); - - /** - * Gets Api Version. - * - * @return the apiVersion value. - */ - String getApiVersion(); - - /** - * Gets The HTTP pipeline to send requests through. - * - * @return the httpPipeline value. - */ - HttpPipeline getHttpPipeline(); - - /** - * Gets The default poll interval for long-running operation. - * - * @return the defaultPollInterval value. - */ - Duration getDefaultPollInterval(); - - /** - * Gets the AuthorizationOperationsClient object to access its operations. - * - * @return the AuthorizationOperationsClient object. - */ - AuthorizationOperationsClient getAuthorizationOperations(); - - /** - * Gets the ManagementLocksClient object to access its operations. - * - * @return the ManagementLocksClient object. - */ - ManagementLocksClient getManagementLocks(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/ManagementLocksClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/ManagementLocksClient.java deleted file mode 100644 index 6cb2efb44fda..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/ManagementLocksClient.java +++ /dev/null @@ -1,1121 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.resources.fluent.models.ManagementLockObjectInner; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ManagementLocksClient. */ -public interface ManagementLocksClient - extends InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete { - /** - * When you apply a lock at a parent scope, all child resources inherit the same lock. To create management locks, - * you must have access to Microsoft.Authorization/* or Microsoft.Authorization/locks/* actions. Of the built-in - * roles, only Owner and User Access Administrator are granted those actions. - * - * @param resourceGroupName The name of the resource group to lock. - * @param lockName The lock name. The lock name can be a maximum of 260 characters. It cannot contain <, > %, - * &, :, \, ?, /, or any control characters. - * @param parameters The management lock parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the lock information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createOrUpdateAtResourceGroupLevelWithResponseAsync( - String resourceGroupName, String lockName, ManagementLockObjectInner parameters); - - /** - * When you apply a lock at a parent scope, all child resources inherit the same lock. To create management locks, - * you must have access to Microsoft.Authorization/* or Microsoft.Authorization/locks/* actions. Of the built-in - * roles, only Owner and User Access Administrator are granted those actions. - * - * @param resourceGroupName The name of the resource group to lock. - * @param lockName The lock name. The lock name can be a maximum of 260 characters. It cannot contain <, > %, - * &, :, \, ?, /, or any control characters. - * @param parameters The management lock parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the lock information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAtResourceGroupLevelAsync( - String resourceGroupName, String lockName, ManagementLockObjectInner parameters); - - /** - * When you apply a lock at a parent scope, all child resources inherit the same lock. To create management locks, - * you must have access to Microsoft.Authorization/* or Microsoft.Authorization/locks/* actions. Of the built-in - * roles, only Owner and User Access Administrator are granted those actions. - * - * @param resourceGroupName The name of the resource group to lock. - * @param lockName The lock name. The lock name can be a maximum of 260 characters. It cannot contain <, > %, - * &, :, \, ?, /, or any control characters. - * @param parameters The management lock parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the lock information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ManagementLockObjectInner createOrUpdateAtResourceGroupLevel( - String resourceGroupName, String lockName, ManagementLockObjectInner parameters); - - /** - * When you apply a lock at a parent scope, all child resources inherit the same lock. To create management locks, - * you must have access to Microsoft.Authorization/* or Microsoft.Authorization/locks/* actions. Of the built-in - * roles, only Owner and User Access Administrator are granted those actions. - * - * @param resourceGroupName The name of the resource group to lock. - * @param lockName The lock name. The lock name can be a maximum of 260 characters. It cannot contain <, > %, - * &, :, \, ?, /, or any control characters. - * @param parameters The management lock parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the lock information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateAtResourceGroupLevelWithResponse( - String resourceGroupName, String lockName, ManagementLockObjectInner parameters, Context context); - - /** - * To delete management locks, you must have access to Microsoft.Authorization/* or Microsoft.Authorization/locks/* - * actions. Of the built-in roles, only Owner and User Access Administrator are granted those actions. - * - * @param resourceGroupName The name of the resource group containing the lock. - * @param lockName The name of lock to delete. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteWithResponseAsync(String resourceGroupName, String lockName); - - /** - * To delete management locks, you must have access to Microsoft.Authorization/* or Microsoft.Authorization/locks/* - * actions. Of the built-in roles, only Owner and User Access Administrator are granted those actions. - * - * @param resourceGroupName The name of the resource group containing the lock. - * @param lockName The name of lock to delete. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String lockName); - - /** - * To delete management locks, you must have access to Microsoft.Authorization/* or Microsoft.Authorization/locks/* - * actions. Of the built-in roles, only Owner and User Access Administrator are granted those actions. - * - * @param resourceGroupName The name of the resource group containing the lock. - * @param lockName The name of lock to delete. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String lockName); - - /** - * To delete management locks, you must have access to Microsoft.Authorization/* or Microsoft.Authorization/locks/* - * actions. Of the built-in roles, only Owner and User Access Administrator are granted those actions. - * - * @param resourceGroupName The name of the resource group containing the lock. - * @param lockName The name of lock to delete. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String lockName, Context context); - - /** - * Gets a management lock at the resource group level. - * - * @param resourceGroupName The name of the locked resource group. - * @param lockName The name of the lock to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a management lock at the resource group level. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String lockName); - - /** - * Gets a management lock at the resource group level. - * - * @param resourceGroupName The name of the locked resource group. - * @param lockName The name of the lock to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a management lock at the resource group level. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync(String resourceGroupName, String lockName); - - /** - * Gets a management lock at the resource group level. - * - * @param resourceGroupName The name of the locked resource group. - * @param lockName The name of the lock to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a management lock at the resource group level. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ManagementLockObjectInner getByResourceGroup(String resourceGroupName, String lockName); - - /** - * Gets a management lock at the resource group level. - * - * @param resourceGroupName The name of the locked resource group. - * @param lockName The name of the lock to get. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a management lock at the resource group level. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String lockName, Context context); - - /** - * Create or update a management lock by scope. - * - * @param scope The scope for the lock. When providing a scope for the assignment, use - * '/subscriptions/{subscriptionId}' for subscriptions, - * '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}' for resource groups, and - * '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePathIfPresent}/{resourceType}/{resourceName}' - * for resources. - * @param lockName The name of lock. - * @param parameters Create or update management lock parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the lock information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createOrUpdateByScopeWithResponseAsync( - String scope, String lockName, ManagementLockObjectInner parameters); - - /** - * Create or update a management lock by scope. - * - * @param scope The scope for the lock. When providing a scope for the assignment, use - * '/subscriptions/{subscriptionId}' for subscriptions, - * '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}' for resource groups, and - * '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePathIfPresent}/{resourceType}/{resourceName}' - * for resources. - * @param lockName The name of lock. - * @param parameters Create or update management lock parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the lock information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateByScopeAsync( - String scope, String lockName, ManagementLockObjectInner parameters); - - /** - * Create or update a management lock by scope. - * - * @param scope The scope for the lock. When providing a scope for the assignment, use - * '/subscriptions/{subscriptionId}' for subscriptions, - * '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}' for resource groups, and - * '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePathIfPresent}/{resourceType}/{resourceName}' - * for resources. - * @param lockName The name of lock. - * @param parameters Create or update management lock parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the lock information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ManagementLockObjectInner createOrUpdateByScope( - String scope, String lockName, ManagementLockObjectInner parameters); - - /** - * Create or update a management lock by scope. - * - * @param scope The scope for the lock. When providing a scope for the assignment, use - * '/subscriptions/{subscriptionId}' for subscriptions, - * '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}' for resource groups, and - * '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePathIfPresent}/{resourceType}/{resourceName}' - * for resources. - * @param lockName The name of lock. - * @param parameters Create or update management lock parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the lock information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateByScopeWithResponse( - String scope, String lockName, ManagementLockObjectInner parameters, Context context); - - /** - * Delete a management lock by scope. - * - * @param scope The scope for the lock. - * @param lockName The name of lock. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteByScopeWithResponseAsync(String scope, String lockName); - - /** - * Delete a management lock by scope. - * - * @param scope The scope for the lock. - * @param lockName The name of lock. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteByScopeAsync(String scope, String lockName); - - /** - * Delete a management lock by scope. - * - * @param scope The scope for the lock. - * @param lockName The name of lock. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deleteByScope(String scope, String lockName); - - /** - * Delete a management lock by scope. - * - * @param scope The scope for the lock. - * @param lockName The name of lock. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteByScopeWithResponse(String scope, String lockName, Context context); - - /** - * Get a management lock by scope. - * - * @param scope The scope for the lock. - * @param lockName The name of lock. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a management lock by scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByScopeWithResponseAsync(String scope, String lockName); - - /** - * Get a management lock by scope. - * - * @param scope The scope for the lock. - * @param lockName The name of lock. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a management lock by scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByScopeAsync(String scope, String lockName); - - /** - * Get a management lock by scope. - * - * @param scope The scope for the lock. - * @param lockName The name of lock. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a management lock by scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ManagementLockObjectInner getByScope(String scope, String lockName); - - /** - * Get a management lock by scope. - * - * @param scope The scope for the lock. - * @param lockName The name of lock. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a management lock by scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByScopeWithResponse(String scope, String lockName, Context context); - - /** - * When you apply a lock at a parent scope, all child resources inherit the same lock. To create management locks, - * you must have access to Microsoft.Authorization/* or Microsoft.Authorization/locks/* actions. Of the built-in - * roles, only Owner and User Access Administrator are granted those actions. - * - * @param resourceGroupName The name of the resource group containing the resource to lock. - * @param resourceProviderNamespace The resource provider namespace of the resource to lock. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource to lock. - * @param resourceName The name of the resource to lock. - * @param lockName The name of lock. The lock name can be a maximum of 260 characters. It cannot contain <, > - * %, &, :, \, ?, /, or any control characters. - * @param parameters Parameters for creating or updating a management lock. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the lock information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createOrUpdateAtResourceLevelWithResponseAsync( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String lockName, - ManagementLockObjectInner parameters); - - /** - * When you apply a lock at a parent scope, all child resources inherit the same lock. To create management locks, - * you must have access to Microsoft.Authorization/* or Microsoft.Authorization/locks/* actions. Of the built-in - * roles, only Owner and User Access Administrator are granted those actions. - * - * @param resourceGroupName The name of the resource group containing the resource to lock. - * @param resourceProviderNamespace The resource provider namespace of the resource to lock. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource to lock. - * @param resourceName The name of the resource to lock. - * @param lockName The name of lock. The lock name can be a maximum of 260 characters. It cannot contain <, > - * %, &, :, \, ?, /, or any control characters. - * @param parameters Parameters for creating or updating a management lock. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the lock information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAtResourceLevelAsync( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String lockName, - ManagementLockObjectInner parameters); - - /** - * When you apply a lock at a parent scope, all child resources inherit the same lock. To create management locks, - * you must have access to Microsoft.Authorization/* or Microsoft.Authorization/locks/* actions. Of the built-in - * roles, only Owner and User Access Administrator are granted those actions. - * - * @param resourceGroupName The name of the resource group containing the resource to lock. - * @param resourceProviderNamespace The resource provider namespace of the resource to lock. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource to lock. - * @param resourceName The name of the resource to lock. - * @param lockName The name of lock. The lock name can be a maximum of 260 characters. It cannot contain <, > - * %, &, :, \, ?, /, or any control characters. - * @param parameters Parameters for creating or updating a management lock. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the lock information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ManagementLockObjectInner createOrUpdateAtResourceLevel( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String lockName, - ManagementLockObjectInner parameters); - - /** - * When you apply a lock at a parent scope, all child resources inherit the same lock. To create management locks, - * you must have access to Microsoft.Authorization/* or Microsoft.Authorization/locks/* actions. Of the built-in - * roles, only Owner and User Access Administrator are granted those actions. - * - * @param resourceGroupName The name of the resource group containing the resource to lock. - * @param resourceProviderNamespace The resource provider namespace of the resource to lock. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource to lock. - * @param resourceName The name of the resource to lock. - * @param lockName The name of lock. The lock name can be a maximum of 260 characters. It cannot contain <, > - * %, &, :, \, ?, /, or any control characters. - * @param parameters Parameters for creating or updating a management lock. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the lock information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateAtResourceLevelWithResponse( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String lockName, - ManagementLockObjectInner parameters, - Context context); - - /** - * To delete management locks, you must have access to Microsoft.Authorization/* or Microsoft.Authorization/locks/* - * actions. Of the built-in roles, only Owner and User Access Administrator are granted those actions. - * - * @param resourceGroupName The name of the resource group containing the resource with the lock to delete. - * @param resourceProviderNamespace The resource provider namespace of the resource with the lock to delete. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource with the lock to delete. - * @param resourceName The name of the resource with the lock to delete. - * @param lockName The name of the lock to delete. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteAtResourceLevelWithResponseAsync( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String lockName); - - /** - * To delete management locks, you must have access to Microsoft.Authorization/* or Microsoft.Authorization/locks/* - * actions. Of the built-in roles, only Owner and User Access Administrator are granted those actions. - * - * @param resourceGroupName The name of the resource group containing the resource with the lock to delete. - * @param resourceProviderNamespace The resource provider namespace of the resource with the lock to delete. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource with the lock to delete. - * @param resourceName The name of the resource with the lock to delete. - * @param lockName The name of the lock to delete. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAtResourceLevelAsync( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String lockName); - - /** - * To delete management locks, you must have access to Microsoft.Authorization/* or Microsoft.Authorization/locks/* - * actions. Of the built-in roles, only Owner and User Access Administrator are granted those actions. - * - * @param resourceGroupName The name of the resource group containing the resource with the lock to delete. - * @param resourceProviderNamespace The resource provider namespace of the resource with the lock to delete. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource with the lock to delete. - * @param resourceName The name of the resource with the lock to delete. - * @param lockName The name of the lock to delete. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deleteAtResourceLevel( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String lockName); - - /** - * To delete management locks, you must have access to Microsoft.Authorization/* or Microsoft.Authorization/locks/* - * actions. Of the built-in roles, only Owner and User Access Administrator are granted those actions. - * - * @param resourceGroupName The name of the resource group containing the resource with the lock to delete. - * @param resourceProviderNamespace The resource provider namespace of the resource with the lock to delete. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource with the lock to delete. - * @param resourceName The name of the resource with the lock to delete. - * @param lockName The name of the lock to delete. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteAtResourceLevelWithResponse( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String lockName, - Context context); - - /** - * Get the management lock of a resource or any level below resource. - * - * @param resourceGroupName The name of the resource group. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath An extra path parameter needed in some services, like SQL Databases. - * @param resourceType The type of the resource. - * @param resourceName The name of the resource. - * @param lockName The name of lock. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the management lock of a resource or any level below resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getAtResourceLevelWithResponseAsync( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String lockName); - - /** - * Get the management lock of a resource or any level below resource. - * - * @param resourceGroupName The name of the resource group. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath An extra path parameter needed in some services, like SQL Databases. - * @param resourceType The type of the resource. - * @param resourceName The name of the resource. - * @param lockName The name of lock. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the management lock of a resource or any level below resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAtResourceLevelAsync( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String lockName); - - /** - * Get the management lock of a resource or any level below resource. - * - * @param resourceGroupName The name of the resource group. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath An extra path parameter needed in some services, like SQL Databases. - * @param resourceType The type of the resource. - * @param resourceName The name of the resource. - * @param lockName The name of lock. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the management lock of a resource or any level below resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ManagementLockObjectInner getAtResourceLevel( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String lockName); - - /** - * Get the management lock of a resource or any level below resource. - * - * @param resourceGroupName The name of the resource group. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath An extra path parameter needed in some services, like SQL Databases. - * @param resourceType The type of the resource. - * @param resourceName The name of the resource. - * @param lockName The name of lock. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the management lock of a resource or any level below resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getAtResourceLevelWithResponse( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String lockName, - Context context); - - /** - * When you apply a lock at a parent scope, all child resources inherit the same lock. To create management locks, - * you must have access to Microsoft.Authorization/* or Microsoft.Authorization/locks/* actions. Of the built-in - * roles, only Owner and User Access Administrator are granted those actions. - * - * @param lockName The name of lock. The lock name can be a maximum of 260 characters. It cannot contain <, > - * %, &, :, \, ?, /, or any control characters. - * @param parameters The management lock parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the lock information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createOrUpdateAtSubscriptionLevelWithResponseAsync( - String lockName, ManagementLockObjectInner parameters); - - /** - * When you apply a lock at a parent scope, all child resources inherit the same lock. To create management locks, - * you must have access to Microsoft.Authorization/* or Microsoft.Authorization/locks/* actions. Of the built-in - * roles, only Owner and User Access Administrator are granted those actions. - * - * @param lockName The name of lock. The lock name can be a maximum of 260 characters. It cannot contain <, > - * %, &, :, \, ?, /, or any control characters. - * @param parameters The management lock parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the lock information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAtSubscriptionLevelAsync( - String lockName, ManagementLockObjectInner parameters); - - /** - * When you apply a lock at a parent scope, all child resources inherit the same lock. To create management locks, - * you must have access to Microsoft.Authorization/* or Microsoft.Authorization/locks/* actions. Of the built-in - * roles, only Owner and User Access Administrator are granted those actions. - * - * @param lockName The name of lock. The lock name can be a maximum of 260 characters. It cannot contain <, > - * %, &, :, \, ?, /, or any control characters. - * @param parameters The management lock parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the lock information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ManagementLockObjectInner createOrUpdateAtSubscriptionLevel(String lockName, ManagementLockObjectInner parameters); - - /** - * When you apply a lock at a parent scope, all child resources inherit the same lock. To create management locks, - * you must have access to Microsoft.Authorization/* or Microsoft.Authorization/locks/* actions. Of the built-in - * roles, only Owner and User Access Administrator are granted those actions. - * - * @param lockName The name of lock. The lock name can be a maximum of 260 characters. It cannot contain <, > - * %, &, :, \, ?, /, or any control characters. - * @param parameters The management lock parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the lock information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateAtSubscriptionLevelWithResponse( - String lockName, ManagementLockObjectInner parameters, Context context); - - /** - * To delete management locks, you must have access to Microsoft.Authorization/* or Microsoft.Authorization/locks/* - * actions. Of the built-in roles, only Owner and User Access Administrator are granted those actions. - * - * @param lockName The name of lock to delete. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteAtSubscriptionLevelWithResponseAsync(String lockName); - - /** - * To delete management locks, you must have access to Microsoft.Authorization/* or Microsoft.Authorization/locks/* - * actions. Of the built-in roles, only Owner and User Access Administrator are granted those actions. - * - * @param lockName The name of lock to delete. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAtSubscriptionLevelAsync(String lockName); - - /** - * To delete management locks, you must have access to Microsoft.Authorization/* or Microsoft.Authorization/locks/* - * actions. Of the built-in roles, only Owner and User Access Administrator are granted those actions. - * - * @param lockName The name of lock to delete. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deleteAtSubscriptionLevel(String lockName); - - /** - * To delete management locks, you must have access to Microsoft.Authorization/* or Microsoft.Authorization/locks/* - * actions. Of the built-in roles, only Owner and User Access Administrator are granted those actions. - * - * @param lockName The name of lock to delete. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteAtSubscriptionLevelWithResponse(String lockName, Context context); - - /** - * Gets a management lock at the subscription level. - * - * @param lockName The name of the lock to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a management lock at the subscription level. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getAtSubscriptionLevelWithResponseAsync(String lockName); - - /** - * Gets a management lock at the subscription level. - * - * @param lockName The name of the lock to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a management lock at the subscription level. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAtSubscriptionLevelAsync(String lockName); - - /** - * Gets a management lock at the subscription level. - * - * @param lockName The name of the lock to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a management lock at the subscription level. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ManagementLockObjectInner getAtSubscriptionLevel(String lockName); - - /** - * Gets a management lock at the subscription level. - * - * @param lockName The name of the lock to get. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a management lock at the subscription level. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getAtSubscriptionLevelWithResponse(String lockName, Context context); - - /** - * Gets all the management locks for a resource group. - * - * @param resourceGroupName The name of the resource group containing the locks to get. - * @param filter The filter to apply on the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the management locks for a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName, String filter); - - /** - * Gets all the management locks for a resource group. - * - * @param resourceGroupName The name of the resource group containing the locks to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the management locks for a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName); - - /** - * Gets all the management locks for a resource group. - * - * @param resourceGroupName The name of the resource group containing the locks to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the management locks for a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Gets all the management locks for a resource group. - * - * @param resourceGroupName The name of the resource group containing the locks to get. - * @param filter The filter to apply on the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the management locks for a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup( - String resourceGroupName, String filter, Context context); - - /** - * Gets all the management locks for a resource or any level below resource. - * - * @param resourceGroupName The name of the resource group containing the locked resource. The name is case - * insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the locked resource. - * @param resourceName The name of the locked resource. - * @param filter The filter to apply on the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the management locks for a resource or any level below resource. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAtResourceLevelAsync( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String filter); - - /** - * Gets all the management locks for a resource or any level below resource. - * - * @param resourceGroupName The name of the resource group containing the locked resource. The name is case - * insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the locked resource. - * @param resourceName The name of the locked resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the management locks for a resource or any level below resource. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAtResourceLevelAsync( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName); - - /** - * Gets all the management locks for a resource or any level below resource. - * - * @param resourceGroupName The name of the resource group containing the locked resource. The name is case - * insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the locked resource. - * @param resourceName The name of the locked resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the management locks for a resource or any level below resource. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listAtResourceLevel( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName); - - /** - * Gets all the management locks for a resource or any level below resource. - * - * @param resourceGroupName The name of the resource group containing the locked resource. The name is case - * insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the locked resource. - * @param resourceName The name of the locked resource. - * @param filter The filter to apply on the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the management locks for a resource or any level below resource. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listAtResourceLevel( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String filter, - Context context); - - /** - * Gets all the management locks for a subscription. - * - * @param filter The filter to apply on the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the management locks for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String filter); - - /** - * Gets all the management locks for a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the management locks for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Gets all the management locks for a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the management locks for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Gets all the management locks for a subscription. - * - * @param filter The filter to apply on the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the management locks for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String filter, Context context); - - /** - * Gets all the management locks for a scope. - * - * @param scope The scope for the lock. When providing a scope for the assignment, use - * '/subscriptions/{subscriptionId}' for subscriptions, - * '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}' for resource groups, and - * '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePathIfPresent}/{resourceType}/{resourceName}' - * for resources. - * @param filter The filter to apply on the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the management locks for a scope. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByScopeAsync(String scope, String filter); - - /** - * Gets all the management locks for a scope. - * - * @param scope The scope for the lock. When providing a scope for the assignment, use - * '/subscriptions/{subscriptionId}' for subscriptions, - * '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}' for resource groups, and - * '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePathIfPresent}/{resourceType}/{resourceName}' - * for resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the management locks for a scope. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByScopeAsync(String scope); - - /** - * Gets all the management locks for a scope. - * - * @param scope The scope for the lock. When providing a scope for the assignment, use - * '/subscriptions/{subscriptionId}' for subscriptions, - * '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}' for resource groups, and - * '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePathIfPresent}/{resourceType}/{resourceName}' - * for resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the management locks for a scope. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByScope(String scope); - - /** - * Gets all the management locks for a scope. - * - * @param scope The scope for the lock. When providing a scope for the assignment, use - * '/subscriptions/{subscriptionId}' for subscriptions, - * '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}' for resource groups, and - * '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePathIfPresent}/{resourceType}/{resourceName}' - * for resources. - * @param filter The filter to apply on the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the management locks for a scope. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByScope(String scope, String filter, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/OperationsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/OperationsClient.java deleted file mode 100644 index eecc7313820a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/OperationsClient.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.resources.fluent.models.OperationInner; - -/** An instance of this class provides access to all the operations defined in OperationsClient. */ -public interface OperationsClient { - /** - * Lists all of the available Microsoft.Resources REST API operations. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Microsoft.Resources operations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Lists all of the available Microsoft.Resources REST API operations. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Microsoft.Resources operations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Lists all of the available Microsoft.Resources REST API operations. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Microsoft.Resources operations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/PolicyAssignmentsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/PolicyAssignmentsClient.java deleted file mode 100644 index 017d366c4644..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/PolicyAssignmentsClient.java +++ /dev/null @@ -1,585 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.resources.fluent.models.PolicyAssignmentInner; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in PolicyAssignmentsClient. */ -public interface PolicyAssignmentsClient - extends InnerSupportsListing, InnerSupportsDelete { - /** - * Deletes a policy assignment. - * - * @param scope The scope of the policy assignment. - * @param policyAssignmentName The name of the policy assignment to delete. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteWithResponseAsync(String scope, String policyAssignmentName); - - /** - * Deletes a policy assignment. - * - * @param scope The scope of the policy assignment. - * @param policyAssignmentName The name of the policy assignment to delete. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String scope, String policyAssignmentName); - - /** - * Deletes a policy assignment. - * - * @param scope The scope of the policy assignment. - * @param policyAssignmentName The name of the policy assignment to delete. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PolicyAssignmentInner delete(String scope, String policyAssignmentName); - - /** - * Deletes a policy assignment. - * - * @param scope The scope of the policy assignment. - * @param policyAssignmentName The name of the policy assignment to delete. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String scope, String policyAssignmentName, Context context); - - /** - * Policy assignments are inherited by child resources. For example, when you apply a policy to a resource group - * that policy is assigned to all resources in the group. - * - * @param scope The scope of the policy assignment. - * @param policyAssignmentName The name of the policy assignment. - * @param parameters Parameters for the policy assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createWithResponseAsync( - String scope, String policyAssignmentName, PolicyAssignmentInner parameters); - - /** - * Policy assignments are inherited by child resources. For example, when you apply a policy to a resource group - * that policy is assigned to all resources in the group. - * - * @param scope The scope of the policy assignment. - * @param policyAssignmentName The name of the policy assignment. - * @param parameters Parameters for the policy assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createAsync( - String scope, String policyAssignmentName, PolicyAssignmentInner parameters); - - /** - * Policy assignments are inherited by child resources. For example, when you apply a policy to a resource group - * that policy is assigned to all resources in the group. - * - * @param scope The scope of the policy assignment. - * @param policyAssignmentName The name of the policy assignment. - * @param parameters Parameters for the policy assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PolicyAssignmentInner create(String scope, String policyAssignmentName, PolicyAssignmentInner parameters); - - /** - * Policy assignments are inherited by child resources. For example, when you apply a policy to a resource group - * that policy is assigned to all resources in the group. - * - * @param scope The scope of the policy assignment. - * @param policyAssignmentName The name of the policy assignment. - * @param parameters Parameters for the policy assignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createWithResponse( - String scope, String policyAssignmentName, PolicyAssignmentInner parameters, Context context); - - /** - * Gets a policy assignment. - * - * @param scope The scope of the policy assignment. - * @param policyAssignmentName The name of the policy assignment to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a policy assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync(String scope, String policyAssignmentName); - - /** - * Gets a policy assignment. - * - * @param scope The scope of the policy assignment. - * @param policyAssignmentName The name of the policy assignment to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a policy assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync(String scope, String policyAssignmentName); - - /** - * Gets a policy assignment. - * - * @param scope The scope of the policy assignment. - * @param policyAssignmentName The name of the policy assignment to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a policy assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PolicyAssignmentInner get(String scope, String policyAssignmentName); - - /** - * Gets a policy assignment. - * - * @param scope The scope of the policy assignment. - * @param policyAssignmentName The name of the policy assignment to get. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a policy assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String scope, String policyAssignmentName, Context context); - - /** - * Gets policy assignments for the resource group. - * - * @param resourceGroupName The name of the resource group that contains policy assignments. - * @param filter The filter to apply on the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return policy assignments for the resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName, String filter); - - /** - * Gets policy assignments for the resource group. - * - * @param resourceGroupName The name of the resource group that contains policy assignments. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return policy assignments for the resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName); - - /** - * Gets policy assignments for the resource group. - * - * @param resourceGroupName The name of the resource group that contains policy assignments. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return policy assignments for the resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Gets policy assignments for the resource group. - * - * @param resourceGroupName The name of the resource group that contains policy assignments. - * @param filter The filter to apply on the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return policy assignments for the resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, String filter, Context context); - - /** - * Gets policy assignments for a resource. - * - * @param resourceGroupName The name of the resource group containing the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource path. - * @param resourceType The resource type. - * @param resourceName The name of the resource with policy assignments. - * @param filter The filter to apply on the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return policy assignments for a resource. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listForResourceAsync( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String filter); - - /** - * Gets policy assignments for a resource. - * - * @param resourceGroupName The name of the resource group containing the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource path. - * @param resourceType The resource type. - * @param resourceName The name of the resource with policy assignments. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return policy assignments for a resource. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listForResourceAsync( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName); - - /** - * Gets policy assignments for a resource. - * - * @param resourceGroupName The name of the resource group containing the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource path. - * @param resourceType The resource type. - * @param resourceName The name of the resource with policy assignments. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return policy assignments for a resource. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listForResource( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName); - - /** - * Gets policy assignments for a resource. - * - * @param resourceGroupName The name of the resource group containing the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource path. - * @param resourceType The resource type. - * @param resourceName The name of the resource with policy assignments. - * @param filter The filter to apply on the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return policy assignments for a resource. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listForResource( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String filter, - Context context); - - /** - * Gets all the policy assignments for a subscription. - * - * @param filter The filter to apply on the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the policy assignments for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String filter); - - /** - * Gets all the policy assignments for a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the policy assignments for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Gets all the policy assignments for a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the policy assignments for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Gets all the policy assignments for a subscription. - * - * @param filter The filter to apply on the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the policy assignments for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String filter, Context context); - - /** - * When providing a scope for the assignment, use '/subscriptions/{subscription-id}/' for subscriptions, - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' - * for resources. - * - * @param policyAssignmentId The ID of the policy assignment to delete. Use the format - * '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteByIdWithResponseAsync(String policyAssignmentId); - - /** - * When providing a scope for the assignment, use '/subscriptions/{subscription-id}/' for subscriptions, - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' - * for resources. - * - * @param policyAssignmentId The ID of the policy assignment to delete. Use the format - * '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteByIdAsync(String policyAssignmentId); - - /** - * When providing a scope for the assignment, use '/subscriptions/{subscription-id}/' for subscriptions, - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' - * for resources. - * - * @param policyAssignmentId The ID of the policy assignment to delete. Use the format - * '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PolicyAssignmentInner deleteById(String policyAssignmentId); - - /** - * When providing a scope for the assignment, use '/subscriptions/{subscription-id}/' for subscriptions, - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' - * for resources. - * - * @param policyAssignmentId The ID of the policy assignment to delete. Use the format - * '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteByIdWithResponse(String policyAssignmentId, Context context); - - /** - * Policy assignments are inherited by child resources. For example, when you apply a policy to a resource group - * that policy is assigned to all resources in the group. When providing a scope for the assignment, use - * '/subscriptions/{subscription-id}/' for subscriptions, - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' - * for resources. - * - * @param policyAssignmentId The ID of the policy assignment to create. Use the format - * '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'. - * @param parameters Parameters for policy assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createByIdWithResponseAsync( - String policyAssignmentId, PolicyAssignmentInner parameters); - - /** - * Policy assignments are inherited by child resources. For example, when you apply a policy to a resource group - * that policy is assigned to all resources in the group. When providing a scope for the assignment, use - * '/subscriptions/{subscription-id}/' for subscriptions, - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' - * for resources. - * - * @param policyAssignmentId The ID of the policy assignment to create. Use the format - * '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'. - * @param parameters Parameters for policy assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createByIdAsync(String policyAssignmentId, PolicyAssignmentInner parameters); - - /** - * Policy assignments are inherited by child resources. For example, when you apply a policy to a resource group - * that policy is assigned to all resources in the group. When providing a scope for the assignment, use - * '/subscriptions/{subscription-id}/' for subscriptions, - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' - * for resources. - * - * @param policyAssignmentId The ID of the policy assignment to create. Use the format - * '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'. - * @param parameters Parameters for policy assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PolicyAssignmentInner createById(String policyAssignmentId, PolicyAssignmentInner parameters); - - /** - * Policy assignments are inherited by child resources. For example, when you apply a policy to a resource group - * that policy is assigned to all resources in the group. When providing a scope for the assignment, use - * '/subscriptions/{subscription-id}/' for subscriptions, - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' - * for resources. - * - * @param policyAssignmentId The ID of the policy assignment to create. Use the format - * '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'. - * @param parameters Parameters for policy assignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createByIdWithResponse( - String policyAssignmentId, PolicyAssignmentInner parameters, Context context); - - /** - * When providing a scope for the assignment, use '/subscriptions/{subscription-id}/' for subscriptions, - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' - * for resources. - * - * @param policyAssignmentId The ID of the policy assignment to get. Use the format - * '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByIdWithResponseAsync(String policyAssignmentId); - - /** - * When providing a scope for the assignment, use '/subscriptions/{subscription-id}/' for subscriptions, - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' - * for resources. - * - * @param policyAssignmentId The ID of the policy assignment to get. Use the format - * '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByIdAsync(String policyAssignmentId); - - /** - * When providing a scope for the assignment, use '/subscriptions/{subscription-id}/' for subscriptions, - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' - * for resources. - * - * @param policyAssignmentId The ID of the policy assignment to get. Use the format - * '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PolicyAssignmentInner getById(String policyAssignmentId); - - /** - * When providing a scope for the assignment, use '/subscriptions/{subscription-id}/' for subscriptions, - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' - * for resources. - * - * @param policyAssignmentId The ID of the policy assignment to get. Use the format - * '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByIdWithResponse(String policyAssignmentId, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/PolicyClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/PolicyClient.java deleted file mode 100644 index b9eb1686c231..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/PolicyClient.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.fluent; - -import com.azure.core.http.HttpPipeline; -import java.time.Duration; - -/** The interface for PolicyClient class. */ -public interface PolicyClient { - /** - * Gets The ID of the target subscription. - * - * @return the subscriptionId value. - */ - String getSubscriptionId(); - - /** - * Gets server parameter. - * - * @return the endpoint value. - */ - String getEndpoint(); - - /** - * Gets Api Version. - * - * @return the apiVersion value. - */ - String getApiVersion(); - - /** - * Gets The HTTP pipeline to send requests through. - * - * @return the httpPipeline value. - */ - HttpPipeline getHttpPipeline(); - - /** - * Gets The default poll interval for long-running operation. - * - * @return the defaultPollInterval value. - */ - Duration getDefaultPollInterval(); - - /** - * Gets the PolicyDefinitionsClient object to access its operations. - * - * @return the PolicyDefinitionsClient object. - */ - PolicyDefinitionsClient getPolicyDefinitions(); - - /** - * Gets the PolicyAssignmentsClient object to access its operations. - * - * @return the PolicyAssignmentsClient object. - */ - PolicyAssignmentsClient getPolicyAssignments(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/PolicyDefinitionsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/PolicyDefinitionsClient.java deleted file mode 100644 index 19e210d29082..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/PolicyDefinitionsClient.java +++ /dev/null @@ -1,489 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.resources.fluent.models.PolicyDefinitionInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in PolicyDefinitionsClient. */ -public interface PolicyDefinitionsClient { - /** - * Creates or updates a policy definition. - * - * @param policyDefinitionName The name of the policy definition to create. - * @param parameters The policy definition properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createOrUpdateWithResponseAsync( - String policyDefinitionName, PolicyDefinitionInner parameters); - - /** - * Creates or updates a policy definition. - * - * @param policyDefinitionName The name of the policy definition to create. - * @param parameters The policy definition properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync(String policyDefinitionName, PolicyDefinitionInner parameters); - - /** - * Creates or updates a policy definition. - * - * @param policyDefinitionName The name of the policy definition to create. - * @param parameters The policy definition properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PolicyDefinitionInner createOrUpdate(String policyDefinitionName, PolicyDefinitionInner parameters); - - /** - * Creates or updates a policy definition. - * - * @param policyDefinitionName The name of the policy definition to create. - * @param parameters The policy definition properties. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String policyDefinitionName, PolicyDefinitionInner parameters, Context context); - - /** - * Deletes a policy definition. - * - * @param policyDefinitionName The name of the policy definition to delete. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteWithResponseAsync(String policyDefinitionName); - - /** - * Deletes a policy definition. - * - * @param policyDefinitionName The name of the policy definition to delete. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String policyDefinitionName); - - /** - * Deletes a policy definition. - * - * @param policyDefinitionName The name of the policy definition to delete. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String policyDefinitionName); - - /** - * Deletes a policy definition. - * - * @param policyDefinitionName The name of the policy definition to delete. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String policyDefinitionName, Context context); - - /** - * Gets the policy definition. - * - * @param policyDefinitionName The name of the policy definition to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync(String policyDefinitionName); - - /** - * Gets the policy definition. - * - * @param policyDefinitionName The name of the policy definition to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync(String policyDefinitionName); - - /** - * Gets the policy definition. - * - * @param policyDefinitionName The name of the policy definition to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PolicyDefinitionInner get(String policyDefinitionName); - - /** - * Gets the policy definition. - * - * @param policyDefinitionName The name of the policy definition to get. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String policyDefinitionName, Context context); - - /** - * Gets the built in policy definition. - * - * @param policyDefinitionName The name of the built in policy definition to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the built in policy definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getBuiltInWithResponseAsync(String policyDefinitionName); - - /** - * Gets the built in policy definition. - * - * @param policyDefinitionName The name of the built in policy definition to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the built in policy definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getBuiltInAsync(String policyDefinitionName); - - /** - * Gets the built in policy definition. - * - * @param policyDefinitionName The name of the built in policy definition to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the built in policy definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PolicyDefinitionInner getBuiltIn(String policyDefinitionName); - - /** - * Gets the built in policy definition. - * - * @param policyDefinitionName The name of the built in policy definition to get. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the built in policy definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getBuiltInWithResponse(String policyDefinitionName, Context context); - - /** - * Creates or updates a policy definition at management group level. - * - * @param policyDefinitionName The name of the policy definition to create. - * @param managementGroupId The ID of the management group. - * @param parameters The policy definition properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createOrUpdateAtManagementGroupWithResponseAsync( - String policyDefinitionName, String managementGroupId, PolicyDefinitionInner parameters); - - /** - * Creates or updates a policy definition at management group level. - * - * @param policyDefinitionName The name of the policy definition to create. - * @param managementGroupId The ID of the management group. - * @param parameters The policy definition properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAtManagementGroupAsync( - String policyDefinitionName, String managementGroupId, PolicyDefinitionInner parameters); - - /** - * Creates or updates a policy definition at management group level. - * - * @param policyDefinitionName The name of the policy definition to create. - * @param managementGroupId The ID of the management group. - * @param parameters The policy definition properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PolicyDefinitionInner createOrUpdateAtManagementGroup( - String policyDefinitionName, String managementGroupId, PolicyDefinitionInner parameters); - - /** - * Creates or updates a policy definition at management group level. - * - * @param policyDefinitionName The name of the policy definition to create. - * @param managementGroupId The ID of the management group. - * @param parameters The policy definition properties. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateAtManagementGroupWithResponse( - String policyDefinitionName, String managementGroupId, PolicyDefinitionInner parameters, Context context); - - /** - * Deletes a policy definition at management group level. - * - * @param policyDefinitionName The name of the policy definition to delete. - * @param managementGroupId The ID of the management group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteAtManagementGroupWithResponseAsync( - String policyDefinitionName, String managementGroupId); - - /** - * Deletes a policy definition at management group level. - * - * @param policyDefinitionName The name of the policy definition to delete. - * @param managementGroupId The ID of the management group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAtManagementGroupAsync(String policyDefinitionName, String managementGroupId); - - /** - * Deletes a policy definition at management group level. - * - * @param policyDefinitionName The name of the policy definition to delete. - * @param managementGroupId The ID of the management group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deleteAtManagementGroup(String policyDefinitionName, String managementGroupId); - - /** - * Deletes a policy definition at management group level. - * - * @param policyDefinitionName The name of the policy definition to delete. - * @param managementGroupId The ID of the management group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteAtManagementGroupWithResponse( - String policyDefinitionName, String managementGroupId, Context context); - - /** - * Gets the policy definition at management group level. - * - * @param policyDefinitionName The name of the policy definition to get. - * @param managementGroupId The ID of the management group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy definition at management group level. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getAtManagementGroupWithResponseAsync( - String policyDefinitionName, String managementGroupId); - - /** - * Gets the policy definition at management group level. - * - * @param policyDefinitionName The name of the policy definition to get. - * @param managementGroupId The ID of the management group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy definition at management group level. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAtManagementGroupAsync(String policyDefinitionName, String managementGroupId); - - /** - * Gets the policy definition at management group level. - * - * @param policyDefinitionName The name of the policy definition to get. - * @param managementGroupId The ID of the management group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy definition at management group level. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PolicyDefinitionInner getAtManagementGroup(String policyDefinitionName, String managementGroupId); - - /** - * Gets the policy definition at management group level. - * - * @param policyDefinitionName The name of the policy definition to get. - * @param managementGroupId The ID of the management group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy definition at management group level. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getAtManagementGroupWithResponse( - String policyDefinitionName, String managementGroupId, Context context); - - /** - * Gets all the policy definitions for a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the policy definitions for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Gets all the policy definitions for a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the policy definitions for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Gets all the policy definitions for a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the policy definitions for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Gets all the built in policy definitions. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the built in policy definitions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listBuiltInAsync(); - - /** - * Gets all the built in policy definitions. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the built in policy definitions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listBuiltIn(); - - /** - * Gets all the built in policy definitions. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the built in policy definitions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listBuiltIn(Context context); - - /** - * Gets all the policy definitions for a subscription at management group level. - * - * @param managementGroupId The ID of the management group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the policy definitions for a subscription at management group level. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByManagementGroupAsync(String managementGroupId); - - /** - * Gets all the policy definitions for a subscription at management group level. - * - * @param managementGroupId The ID of the management group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the policy definitions for a subscription at management group level. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByManagementGroup(String managementGroupId); - - /** - * Gets all the policy definitions for a subscription at management group level. - * - * @param managementGroupId The ID of the management group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the policy definitions for a subscription at management group level. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByManagementGroup(String managementGroupId, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/ProvidersClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/ProvidersClient.java deleted file mode 100644 index dd754a772140..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/ProvidersClient.java +++ /dev/null @@ -1,352 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.resources.fluent.models.ProviderInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ProvidersClient. */ -public interface ProvidersClient { - /** - * Unregisters a subscription from a resource provider. - * - * @param resourceProviderNamespace The namespace of the resource provider to unregister. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource provider information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> unregisterWithResponseAsync(String resourceProviderNamespace); - - /** - * Unregisters a subscription from a resource provider. - * - * @param resourceProviderNamespace The namespace of the resource provider to unregister. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource provider information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono unregisterAsync(String resourceProviderNamespace); - - /** - * Unregisters a subscription from a resource provider. - * - * @param resourceProviderNamespace The namespace of the resource provider to unregister. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource provider information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ProviderInner unregister(String resourceProviderNamespace); - - /** - * Unregisters a subscription from a resource provider. - * - * @param resourceProviderNamespace The namespace of the resource provider to unregister. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource provider information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response unregisterWithResponse(String resourceProviderNamespace, Context context); - - /** - * Registers a subscription with a resource provider. - * - * @param resourceProviderNamespace The namespace of the resource provider to register. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource provider information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> registerWithResponseAsync(String resourceProviderNamespace); - - /** - * Registers a subscription with a resource provider. - * - * @param resourceProviderNamespace The namespace of the resource provider to register. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource provider information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono registerAsync(String resourceProviderNamespace); - - /** - * Registers a subscription with a resource provider. - * - * @param resourceProviderNamespace The namespace of the resource provider to register. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource provider information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ProviderInner register(String resourceProviderNamespace); - - /** - * Registers a subscription with a resource provider. - * - * @param resourceProviderNamespace The namespace of the resource provider to register. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource provider information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response registerWithResponse(String resourceProviderNamespace, Context context); - - /** - * Gets all resource providers for a subscription. - * - * @param top The number of results to return. If null is passed returns all deployments. - * @param expand The properties to include in the results. For example, use &$expand=metadata in the query - * string to retrieve resource provider metadata. To include property aliases in response, use - * $expand=resourceTypes/aliases. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all resource providers for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(Integer top, String expand); - - /** - * Gets all resource providers for a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all resource providers for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Gets all resource providers for a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all resource providers for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Gets all resource providers for a subscription. - * - * @param top The number of results to return. If null is passed returns all deployments. - * @param expand The properties to include in the results. For example, use &$expand=metadata in the query - * string to retrieve resource provider metadata. To include property aliases in response, use - * $expand=resourceTypes/aliases. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all resource providers for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Integer top, String expand, Context context); - - /** - * Gets all resource providers for the tenant. - * - * @param top The number of results to return. If null is passed returns all providers. - * @param expand The properties to include in the results. For example, use &$expand=metadata in the query - * string to retrieve resource provider metadata. To include property aliases in response, use - * $expand=resourceTypes/aliases. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all resource providers for the tenant. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAtTenantScopeAsync(Integer top, String expand); - - /** - * Gets all resource providers for the tenant. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all resource providers for the tenant. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAtTenantScopeAsync(); - - /** - * Gets all resource providers for the tenant. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all resource providers for the tenant. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listAtTenantScope(); - - /** - * Gets all resource providers for the tenant. - * - * @param top The number of results to return. If null is passed returns all providers. - * @param expand The properties to include in the results. For example, use &$expand=metadata in the query - * string to retrieve resource provider metadata. To include property aliases in response, use - * $expand=resourceTypes/aliases. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all resource providers for the tenant. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listAtTenantScope(Integer top, String expand, Context context); - - /** - * Gets the specified resource provider. - * - * @param resourceProviderNamespace The namespace of the resource provider. - * @param expand The $expand query parameter. For example, to include property aliases in response, use - * $expand=resourceTypes/aliases. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified resource provider. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync(String resourceProviderNamespace, String expand); - - /** - * Gets the specified resource provider. - * - * @param resourceProviderNamespace The namespace of the resource provider. - * @param expand The $expand query parameter. For example, to include property aliases in response, use - * $expand=resourceTypes/aliases. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified resource provider. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync(String resourceProviderNamespace, String expand); - - /** - * Gets the specified resource provider. - * - * @param resourceProviderNamespace The namespace of the resource provider. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified resource provider. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync(String resourceProviderNamespace); - - /** - * Gets the specified resource provider. - * - * @param resourceProviderNamespace The namespace of the resource provider. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified resource provider. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ProviderInner get(String resourceProviderNamespace); - - /** - * Gets the specified resource provider. - * - * @param resourceProviderNamespace The namespace of the resource provider. - * @param expand The $expand query parameter. For example, to include property aliases in response, use - * $expand=resourceTypes/aliases. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified resource provider. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceProviderNamespace, String expand, Context context); - - /** - * Gets the specified resource provider at the tenant level. - * - * @param resourceProviderNamespace The namespace of the resource provider. - * @param expand The $expand query parameter. For example, to include property aliases in response, use - * $expand=resourceTypes/aliases. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified resource provider at the tenant level. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getAtTenantScopeWithResponseAsync(String resourceProviderNamespace, String expand); - - /** - * Gets the specified resource provider at the tenant level. - * - * @param resourceProviderNamespace The namespace of the resource provider. - * @param expand The $expand query parameter. For example, to include property aliases in response, use - * $expand=resourceTypes/aliases. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified resource provider at the tenant level. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAtTenantScopeAsync(String resourceProviderNamespace, String expand); - - /** - * Gets the specified resource provider at the tenant level. - * - * @param resourceProviderNamespace The namespace of the resource provider. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified resource provider at the tenant level. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAtTenantScopeAsync(String resourceProviderNamespace); - - /** - * Gets the specified resource provider at the tenant level. - * - * @param resourceProviderNamespace The namespace of the resource provider. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified resource provider at the tenant level. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ProviderInner getAtTenantScope(String resourceProviderNamespace); - - /** - * Gets the specified resource provider at the tenant level. - * - * @param resourceProviderNamespace The namespace of the resource provider. - * @param expand The $expand query parameter. For example, to include property aliases in response, use - * $expand=resourceTypes/aliases. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified resource provider at the tenant level. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getAtTenantScopeWithResponse( - String resourceProviderNamespace, String expand, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/ResourceGroupsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/ResourceGroupsClient.java deleted file mode 100644 index 4cd8127180f8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/ResourceGroupsClient.java +++ /dev/null @@ -1,484 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.resources.fluent.models.ResourceGroupExportResultInner; -import com.azure.resourcemanager.resources.fluent.models.ResourceGroupInner; -import com.azure.resourcemanager.resources.models.ExportTemplateRequest; -import com.azure.resourcemanager.resources.models.ResourceGroupPatchable; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ResourceGroupsClient. */ -public interface ResourceGroupsClient { - /** - * Checks whether a resource group exists. - * - * @param resourceGroupName The name of the resource group to check. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> checkExistenceWithResponseAsync(String resourceGroupName); - - /** - * Checks whether a resource group exists. - * - * @param resourceGroupName The name of the resource group to check. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono checkExistenceAsync(String resourceGroupName); - - /** - * Checks whether a resource group exists. - * - * @param resourceGroupName The name of the resource group to check. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - boolean checkExistence(String resourceGroupName); - - /** - * Checks whether a resource group exists. - * - * @param resourceGroupName The name of the resource group to check. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response checkExistenceWithResponse(String resourceGroupName, Context context); - - /** - * Creates or updates a resource group. - * - * @param resourceGroupName The name of the resource group to create or update. Can include alphanumeric, - * underscore, parentheses, hyphen, period (except at end), and Unicode characters that match the allowed - * characters. - * @param parameters Parameters supplied to the create or update a resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource group information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, ResourceGroupInner parameters); - - /** - * Creates or updates a resource group. - * - * @param resourceGroupName The name of the resource group to create or update. Can include alphanumeric, - * underscore, parentheses, hyphen, period (except at end), and Unicode characters that match the allowed - * characters. - * @param parameters Parameters supplied to the create or update a resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource group information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync(String resourceGroupName, ResourceGroupInner parameters); - - /** - * Creates or updates a resource group. - * - * @param resourceGroupName The name of the resource group to create or update. Can include alphanumeric, - * underscore, parentheses, hyphen, period (except at end), and Unicode characters that match the allowed - * characters. - * @param parameters Parameters supplied to the create or update a resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource group information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ResourceGroupInner createOrUpdate(String resourceGroupName, ResourceGroupInner parameters); - - /** - * Creates or updates a resource group. - * - * @param resourceGroupName The name of the resource group to create or update. Can include alphanumeric, - * underscore, parentheses, hyphen, period (except at end), and Unicode characters that match the allowed - * characters. - * @param parameters Parameters supplied to the create or update a resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource group information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, ResourceGroupInner parameters, Context context); - - /** - * When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of - * its template deployments and currently stored operations. - * - * @param resourceGroupName The name of the resource group to delete. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync(String resourceGroupName); - - /** - * When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of - * its template deployments and currently stored operations. - * - * @param resourceGroupName The name of the resource group to delete. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAsync(String resourceGroupName); - - /** - * When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of - * its template deployments and currently stored operations. - * - * @param resourceGroupName The name of the resource group to delete. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName); - - /** - * When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of - * its template deployments and currently stored operations. - * - * @param resourceGroupName The name of the resource group to delete. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, Context context); - - /** - * When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of - * its template deployments and currently stored operations. - * - * @param resourceGroupName The name of the resource group to delete. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName); - - /** - * When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of - * its template deployments and currently stored operations. - * - * @param resourceGroupName The name of the resource group to delete. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName); - - /** - * When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of - * its template deployments and currently stored operations. - * - * @param resourceGroupName The name of the resource group to delete. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, Context context); - - /** - * Gets a resource group. - * - * @param resourceGroupName The name of the resource group to get. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync(String resourceGroupName); - - /** - * Gets a resource group. - * - * @param resourceGroupName The name of the resource group to get. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync(String resourceGroupName); - - /** - * Gets a resource group. - * - * @param resourceGroupName The name of the resource group to get. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ResourceGroupInner get(String resourceGroupName); - - /** - * Gets a resource group. - * - * @param resourceGroupName The name of the resource group to get. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, Context context); - - /** - * Resource groups can be updated through a simple PATCH operation to a group address. The format of the request is - * the same as that for creating a resource group. If a field is unspecified, the current value is retained. - * - * @param resourceGroupName The name of the resource group to update. The name is case insensitive. - * @param parameters Parameters supplied to update a resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource group information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateWithResponseAsync( - String resourceGroupName, ResourceGroupPatchable parameters); - - /** - * Resource groups can be updated through a simple PATCH operation to a group address. The format of the request is - * the same as that for creating a resource group. If a field is unspecified, the current value is retained. - * - * @param resourceGroupName The name of the resource group to update. The name is case insensitive. - * @param parameters Parameters supplied to update a resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource group information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAsync(String resourceGroupName, ResourceGroupPatchable parameters); - - /** - * Resource groups can be updated through a simple PATCH operation to a group address. The format of the request is - * the same as that for creating a resource group. If a field is unspecified, the current value is retained. - * - * @param resourceGroupName The name of the resource group to update. The name is case insensitive. - * @param parameters Parameters supplied to update a resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource group information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ResourceGroupInner update(String resourceGroupName, ResourceGroupPatchable parameters); - - /** - * Resource groups can be updated through a simple PATCH operation to a group address. The format of the request is - * the same as that for creating a resource group. If a field is unspecified, the current value is retained. - * - * @param resourceGroupName The name of the resource group to update. The name is case insensitive. - * @param parameters Parameters supplied to update a resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource group information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String resourceGroupName, ResourceGroupPatchable parameters, Context context); - - /** - * Captures the specified resource group as a template. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters Parameters for exporting the template. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource group export result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> exportTemplateWithResponseAsync( - String resourceGroupName, ExportTemplateRequest parameters); - - /** - * Captures the specified resource group as a template. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters Parameters for exporting the template. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource group export result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, ResourceGroupExportResultInner> beginExportTemplateAsync( - String resourceGroupName, ExportTemplateRequest parameters); - - /** - * Captures the specified resource group as a template. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters Parameters for exporting the template. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource group export result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ResourceGroupExportResultInner> beginExportTemplate( - String resourceGroupName, ExportTemplateRequest parameters); - - /** - * Captures the specified resource group as a template. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters Parameters for exporting the template. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource group export result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ResourceGroupExportResultInner> beginExportTemplate( - String resourceGroupName, ExportTemplateRequest parameters, Context context); - - /** - * Captures the specified resource group as a template. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters Parameters for exporting the template. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource group export result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono exportTemplateAsync( - String resourceGroupName, ExportTemplateRequest parameters); - - /** - * Captures the specified resource group as a template. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters Parameters for exporting the template. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource group export result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ResourceGroupExportResultInner exportTemplate(String resourceGroupName, ExportTemplateRequest parameters); - - /** - * Captures the specified resource group as a template. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters Parameters for exporting the template. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource group export result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ResourceGroupExportResultInner exportTemplate( - String resourceGroupName, ExportTemplateRequest parameters, Context context); - - /** - * Gets all the resource groups for a subscription. - * - * @param filter The filter to apply on the operation.<br><br>You can filter by tag names and values. - * For example, to filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'. - * @param top The number of results to return. If null is passed, returns all resource groups. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the resource groups for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String filter, Integer top); - - /** - * Gets all the resource groups for a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the resource groups for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Gets all the resource groups for a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the resource groups for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Gets all the resource groups for a subscription. - * - * @param filter The filter to apply on the operation.<br><br>You can filter by tag names and values. - * For example, to filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'. - * @param top The number of results to return. If null is passed, returns all resource groups. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the resource groups for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String filter, Integer top, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/ResourceManagementClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/ResourceManagementClient.java deleted file mode 100644 index 12627d09a8e8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/ResourceManagementClient.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.fluent; - -import com.azure.core.http.HttpPipeline; -import java.time.Duration; - -/** The interface for ResourceManagementClient class. */ -public interface ResourceManagementClient { - /** - * Gets The ID of the target subscription. - * - * @return the subscriptionId value. - */ - String getSubscriptionId(); - - /** - * Gets server parameter. - * - * @return the endpoint value. - */ - String getEndpoint(); - - /** - * Gets Api Version. - * - * @return the apiVersion value. - */ - String getApiVersion(); - - /** - * Gets The HTTP pipeline to send requests through. - * - * @return the httpPipeline value. - */ - HttpPipeline getHttpPipeline(); - - /** - * Gets The default poll interval for long-running operation. - * - * @return the defaultPollInterval value. - */ - Duration getDefaultPollInterval(); - - /** - * Gets the OperationsClient object to access its operations. - * - * @return the OperationsClient object. - */ - OperationsClient getOperations(); - - /** - * Gets the DeploymentsClient object to access its operations. - * - * @return the DeploymentsClient object. - */ - DeploymentsClient getDeployments(); - - /** - * Gets the ProvidersClient object to access its operations. - * - * @return the ProvidersClient object. - */ - ProvidersClient getProviders(); - - /** - * Gets the ResourcesClient object to access its operations. - * - * @return the ResourcesClient object. - */ - ResourcesClient getResources(); - - /** - * Gets the ResourceGroupsClient object to access its operations. - * - * @return the ResourceGroupsClient object. - */ - ResourceGroupsClient getResourceGroups(); - - /** - * Gets the TagOperationsClient object to access its operations. - * - * @return the TagOperationsClient object. - */ - TagOperationsClient getTagOperations(); - - /** - * Gets the DeploymentOperationsClient object to access its operations. - * - * @return the DeploymentOperationsClient object. - */ - DeploymentOperationsClient getDeploymentOperations(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/ResourceNamesClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/ResourceNamesClient.java deleted file mode 100644 index b99f43013ecb..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/ResourceNamesClient.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.resources.fluent.models.CheckResourceNameResultInner; -import com.azure.resourcemanager.resources.models.ResourceName; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ResourceNamesClient. */ -public interface ResourceNamesClient { - /** - * A resource name is valid if it is not a reserved word, does not contains a reserved word and does not start with - * a reserved word. - * - * @param resourceNameDefinition Resource object with values for resource name and resource type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource Name valid if not a reserved word, does not contain a reserved word and does not start with a - * reserved word. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> checkResourceNameWithResponseAsync( - ResourceName resourceNameDefinition); - - /** - * A resource name is valid if it is not a reserved word, does not contains a reserved word and does not start with - * a reserved word. - * - * @param resourceNameDefinition Resource object with values for resource name and resource type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource Name valid if not a reserved word, does not contain a reserved word and does not start with a - * reserved word. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono checkResourceNameAsync(ResourceName resourceNameDefinition); - - /** - * A resource name is valid if it is not a reserved word, does not contains a reserved word and does not start with - * a reserved word. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource Name valid if not a reserved word, does not contain a reserved word and does not start with a - * reserved word. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono checkResourceNameAsync(); - - /** - * A resource name is valid if it is not a reserved word, does not contains a reserved word and does not start with - * a reserved word. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource Name valid if not a reserved word, does not contain a reserved word and does not start with a - * reserved word. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - CheckResourceNameResultInner checkResourceName(); - - /** - * A resource name is valid if it is not a reserved word, does not contains a reserved word and does not start with - * a reserved word. - * - * @param resourceNameDefinition Resource object with values for resource name and resource type. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource Name valid if not a reserved word, does not contain a reserved word and does not start with a - * reserved word. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response checkResourceNameWithResponse( - ResourceName resourceNameDefinition, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/ResourcesClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/ResourcesClient.java deleted file mode 100644 index 80b89f038544..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/ResourcesClient.java +++ /dev/null @@ -1,1604 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.resources.fluent.models.GenericResourceExpandedInner; -import com.azure.resourcemanager.resources.fluent.models.GenericResourceInner; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import com.azure.resourcemanager.resources.models.ResourcesMoveInfo; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ResourcesClient. */ -public interface ResourcesClient extends InnerSupportsListing { - /** - * Get all the resources for a resource group. - * - * @param resourceGroupName The resource group with the resources to get. - * @param filter The filter to apply on the operation.<br><br>The properties you can use for eq (equals) - * or ne (not equals) are: location, resourceType, name, resourceGroup, identity, identity/principalId, plan, - * plan/publisher, plan/product, plan/name, plan/version, and plan/promotionCode.<br><br>For - * example, to filter by a resource type, use: $filter=resourceType eq - * 'Microsoft.Network/virtualNetworks'<br><br>You can use substringof(value, property) in the - * filter. The properties you can use for substring are: name and resourceGroup.<br><br>For example, - * to get all resources with 'demo' anywhere in the name, use: $filter=substringof('demo', - * name)<br><br>You can link more than one substringof together by adding and/or - * operators.<br><br>You can filter by tag names and values. For example, to filter for a tag name - * and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'. When you filter by a tag name and value, - * the tags for each resource are not returned in the results.<br><br>You can use some properties - * together when filtering. The combinations you can use are: substringof and/or resourceType, plan and - * plan/publisher and plan/name, identity and identity/principalId. - * @param expand Comma-separated list of additional properties to be included in the response. Valid values include - * `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`. - * @param top The maximum number of results to return. If null is passed, returns all resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the resources for a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync( - String resourceGroupName, String filter, String expand, Integer top); - - /** - * Get all the resources for a resource group. - * - * @param resourceGroupName The resource group with the resources to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the resources for a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName); - - /** - * Get all the resources for a resource group. - * - * @param resourceGroupName The resource group with the resources to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the resources for a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Get all the resources for a resource group. - * - * @param resourceGroupName The resource group with the resources to get. - * @param filter The filter to apply on the operation.<br><br>The properties you can use for eq (equals) - * or ne (not equals) are: location, resourceType, name, resourceGroup, identity, identity/principalId, plan, - * plan/publisher, plan/product, plan/name, plan/version, and plan/promotionCode.<br><br>For - * example, to filter by a resource type, use: $filter=resourceType eq - * 'Microsoft.Network/virtualNetworks'<br><br>You can use substringof(value, property) in the - * filter. The properties you can use for substring are: name and resourceGroup.<br><br>For example, - * to get all resources with 'demo' anywhere in the name, use: $filter=substringof('demo', - * name)<br><br>You can link more than one substringof together by adding and/or - * operators.<br><br>You can filter by tag names and values. For example, to filter for a tag name - * and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'. When you filter by a tag name and value, - * the tags for each resource are not returned in the results.<br><br>You can use some properties - * together when filtering. The combinations you can use are: substringof and/or resourceType, plan and - * plan/publisher and plan/name, identity and identity/principalId. - * @param expand Comma-separated list of additional properties to be included in the response. Valid values include - * `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`. - * @param top The maximum number of results to return. If null is passed, returns all resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the resources for a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup( - String resourceGroupName, String filter, String expand, Integer top, Context context); - - /** - * The resources to move must be in the same source resource group. The target resource group may be in a different - * subscription. When moving resources, both the source group and the target group are locked for the duration of - * the operation. Write and delete operations are blocked on the groups until the move completes. - * - * @param sourceResourceGroupName The name of the resource group containing the resources to move. - * @param parameters Parameters for moving resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> moveResourcesWithResponseAsync( - String sourceResourceGroupName, ResourcesMoveInfo parameters); - - /** - * The resources to move must be in the same source resource group. The target resource group may be in a different - * subscription. When moving resources, both the source group and the target group are locked for the duration of - * the operation. Write and delete operations are blocked on the groups until the move completes. - * - * @param sourceResourceGroupName The name of the resource group containing the resources to move. - * @param parameters Parameters for moving resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginMoveResourcesAsync( - String sourceResourceGroupName, ResourcesMoveInfo parameters); - - /** - * The resources to move must be in the same source resource group. The target resource group may be in a different - * subscription. When moving resources, both the source group and the target group are locked for the duration of - * the operation. Write and delete operations are blocked on the groups until the move completes. - * - * @param sourceResourceGroupName The name of the resource group containing the resources to move. - * @param parameters Parameters for moving resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginMoveResources(String sourceResourceGroupName, ResourcesMoveInfo parameters); - - /** - * The resources to move must be in the same source resource group. The target resource group may be in a different - * subscription. When moving resources, both the source group and the target group are locked for the duration of - * the operation. Write and delete operations are blocked on the groups until the move completes. - * - * @param sourceResourceGroupName The name of the resource group containing the resources to move. - * @param parameters Parameters for moving resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginMoveResources( - String sourceResourceGroupName, ResourcesMoveInfo parameters, Context context); - - /** - * The resources to move must be in the same source resource group. The target resource group may be in a different - * subscription. When moving resources, both the source group and the target group are locked for the duration of - * the operation. Write and delete operations are blocked on the groups until the move completes. - * - * @param sourceResourceGroupName The name of the resource group containing the resources to move. - * @param parameters Parameters for moving resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono moveResourcesAsync(String sourceResourceGroupName, ResourcesMoveInfo parameters); - - /** - * The resources to move must be in the same source resource group. The target resource group may be in a different - * subscription. When moving resources, both the source group and the target group are locked for the duration of - * the operation. Write and delete operations are blocked on the groups until the move completes. - * - * @param sourceResourceGroupName The name of the resource group containing the resources to move. - * @param parameters Parameters for moving resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void moveResources(String sourceResourceGroupName, ResourcesMoveInfo parameters); - - /** - * The resources to move must be in the same source resource group. The target resource group may be in a different - * subscription. When moving resources, both the source group and the target group are locked for the duration of - * the operation. Write and delete operations are blocked on the groups until the move completes. - * - * @param sourceResourceGroupName The name of the resource group containing the resources to move. - * @param parameters Parameters for moving resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void moveResources(String sourceResourceGroupName, ResourcesMoveInfo parameters, Context context); - - /** - * This operation checks whether the specified resources can be moved to the target. The resources to move must be - * in the same source resource group. The target resource group may be in a different subscription. If validation - * succeeds, it returns HTTP response code 204 (no content). If validation fails, it returns HTTP response code 409 - * (Conflict) with an error message. Retrieve the URL in the Location header value to check the result of the - * long-running operation. - * - * @param sourceResourceGroupName The name of the resource group containing the resources to validate for move. - * @param parameters Parameters for moving resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> validateMoveResourcesWithResponseAsync( - String sourceResourceGroupName, ResourcesMoveInfo parameters); - - /** - * This operation checks whether the specified resources can be moved to the target. The resources to move must be - * in the same source resource group. The target resource group may be in a different subscription. If validation - * succeeds, it returns HTTP response code 204 (no content). If validation fails, it returns HTTP response code 409 - * (Conflict) with an error message. Retrieve the URL in the Location header value to check the result of the - * long-running operation. - * - * @param sourceResourceGroupName The name of the resource group containing the resources to validate for move. - * @param parameters Parameters for moving resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginValidateMoveResourcesAsync( - String sourceResourceGroupName, ResourcesMoveInfo parameters); - - /** - * This operation checks whether the specified resources can be moved to the target. The resources to move must be - * in the same source resource group. The target resource group may be in a different subscription. If validation - * succeeds, it returns HTTP response code 204 (no content). If validation fails, it returns HTTP response code 409 - * (Conflict) with an error message. Retrieve the URL in the Location header value to check the result of the - * long-running operation. - * - * @param sourceResourceGroupName The name of the resource group containing the resources to validate for move. - * @param parameters Parameters for moving resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginValidateMoveResources( - String sourceResourceGroupName, ResourcesMoveInfo parameters); - - /** - * This operation checks whether the specified resources can be moved to the target. The resources to move must be - * in the same source resource group. The target resource group may be in a different subscription. If validation - * succeeds, it returns HTTP response code 204 (no content). If validation fails, it returns HTTP response code 409 - * (Conflict) with an error message. Retrieve the URL in the Location header value to check the result of the - * long-running operation. - * - * @param sourceResourceGroupName The name of the resource group containing the resources to validate for move. - * @param parameters Parameters for moving resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginValidateMoveResources( - String sourceResourceGroupName, ResourcesMoveInfo parameters, Context context); - - /** - * This operation checks whether the specified resources can be moved to the target. The resources to move must be - * in the same source resource group. The target resource group may be in a different subscription. If validation - * succeeds, it returns HTTP response code 204 (no content). If validation fails, it returns HTTP response code 409 - * (Conflict) with an error message. Retrieve the URL in the Location header value to check the result of the - * long-running operation. - * - * @param sourceResourceGroupName The name of the resource group containing the resources to validate for move. - * @param parameters Parameters for moving resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono validateMoveResourcesAsync(String sourceResourceGroupName, ResourcesMoveInfo parameters); - - /** - * This operation checks whether the specified resources can be moved to the target. The resources to move must be - * in the same source resource group. The target resource group may be in a different subscription. If validation - * succeeds, it returns HTTP response code 204 (no content). If validation fails, it returns HTTP response code 409 - * (Conflict) with an error message. Retrieve the URL in the Location header value to check the result of the - * long-running operation. - * - * @param sourceResourceGroupName The name of the resource group containing the resources to validate for move. - * @param parameters Parameters for moving resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void validateMoveResources(String sourceResourceGroupName, ResourcesMoveInfo parameters); - - /** - * This operation checks whether the specified resources can be moved to the target. The resources to move must be - * in the same source resource group. The target resource group may be in a different subscription. If validation - * succeeds, it returns HTTP response code 204 (no content). If validation fails, it returns HTTP response code 409 - * (Conflict) with an error message. Retrieve the URL in the Location header value to check the result of the - * long-running operation. - * - * @param sourceResourceGroupName The name of the resource group containing the resources to validate for move. - * @param parameters Parameters for moving resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void validateMoveResources(String sourceResourceGroupName, ResourcesMoveInfo parameters, Context context); - - /** - * Get all the resources in a subscription. - * - * @param filter The filter to apply on the operation.<br><br>The properties you can use for eq (equals) - * or ne (not equals) are: location, resourceType, name, resourceGroup, identity, identity/principalId, plan, - * plan/publisher, plan/product, plan/name, plan/version, and plan/promotionCode.<br><br>For - * example, to filter by a resource type, use: $filter=resourceType eq - * 'Microsoft.Network/virtualNetworks'<br><br>You can use substringof(value, property) in the - * filter. The properties you can use for substring are: name and resourceGroup.<br><br>For example, - * to get all resources with 'demo' anywhere in the name, use: $filter=substringof('demo', - * name)<br><br>You can link more than one substringof together by adding and/or - * operators.<br><br>You can filter by tag names and values. For example, to filter for a tag name - * and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'. When you filter by a tag name and value, - * the tags for each resource are not returned in the results.<br><br>You can use some properties - * together when filtering. The combinations you can use are: substringof and/or resourceType, plan and - * plan/publisher and plan/name, identity and identity/principalId. - * @param expand Comma-separated list of additional properties to be included in the response. Valid values include - * `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`. - * @param top The maximum number of results to return. If null is passed, returns all resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the resources in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String filter, String expand, Integer top); - - /** - * Get all the resources in a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the resources in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Get all the resources in a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the resources in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Get all the resources in a subscription. - * - * @param filter The filter to apply on the operation.<br><br>The properties you can use for eq (equals) - * or ne (not equals) are: location, resourceType, name, resourceGroup, identity, identity/principalId, plan, - * plan/publisher, plan/product, plan/name, plan/version, and plan/promotionCode.<br><br>For - * example, to filter by a resource type, use: $filter=resourceType eq - * 'Microsoft.Network/virtualNetworks'<br><br>You can use substringof(value, property) in the - * filter. The properties you can use for substring are: name and resourceGroup.<br><br>For example, - * to get all resources with 'demo' anywhere in the name, use: $filter=substringof('demo', - * name)<br><br>You can link more than one substringof together by adding and/or - * operators.<br><br>You can filter by tag names and values. For example, to filter for a tag name - * and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'. When you filter by a tag name and value, - * the tags for each resource are not returned in the results.<br><br>You can use some properties - * together when filtering. The combinations you can use are: substringof and/or resourceType, plan and - * plan/publisher and plan/name, identity and identity/principalId. - * @param expand Comma-separated list of additional properties to be included in the response. Valid values include - * `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`. - * @param top The maximum number of results to return. If null is passed, returns all resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the resources in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String filter, String expand, Integer top, Context context); - - /** - * Checks whether a resource exists. - * - * @param resourceGroupName The name of the resource group containing the resource to check. The name is case - * insensitive. - * @param resourceProviderNamespace The resource provider of the resource to check. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type. - * @param resourceName The name of the resource to check whether it exists. - * @param apiVersion The API version to use for the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> checkExistenceWithResponseAsync( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String apiVersion); - - /** - * Checks whether a resource exists. - * - * @param resourceGroupName The name of the resource group containing the resource to check. The name is case - * insensitive. - * @param resourceProviderNamespace The resource provider of the resource to check. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type. - * @param resourceName The name of the resource to check whether it exists. - * @param apiVersion The API version to use for the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono checkExistenceAsync( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String apiVersion); - - /** - * Checks whether a resource exists. - * - * @param resourceGroupName The name of the resource group containing the resource to check. The name is case - * insensitive. - * @param resourceProviderNamespace The resource provider of the resource to check. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type. - * @param resourceName The name of the resource to check whether it exists. - * @param apiVersion The API version to use for the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - boolean checkExistence( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String apiVersion); - - /** - * Checks whether a resource exists. - * - * @param resourceGroupName The name of the resource group containing the resource to check. The name is case - * insensitive. - * @param resourceProviderNamespace The resource provider of the resource to check. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type. - * @param resourceName The name of the resource to check whether it exists. - * @param apiVersion The API version to use for the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response checkExistenceWithResponse( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String apiVersion, - Context context); - - /** - * Deletes a resource. - * - * @param resourceGroupName The name of the resource group that contains the resource to delete. The name is case - * insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type. - * @param resourceName The name of the resource to delete. - * @param apiVersion The API version to use for the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String apiVersion); - - /** - * Deletes a resource. - * - * @param resourceGroupName The name of the resource group that contains the resource to delete. The name is case - * insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type. - * @param resourceName The name of the resource to delete. - * @param apiVersion The API version to use for the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String apiVersion); - - /** - * Deletes a resource. - * - * @param resourceGroupName The name of the resource group that contains the resource to delete. The name is case - * insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type. - * @param resourceName The name of the resource to delete. - * @param apiVersion The API version to use for the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String apiVersion); - - /** - * Deletes a resource. - * - * @param resourceGroupName The name of the resource group that contains the resource to delete. The name is case - * insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type. - * @param resourceName The name of the resource to delete. - * @param apiVersion The API version to use for the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String apiVersion, - Context context); - - /** - * Deletes a resource. - * - * @param resourceGroupName The name of the resource group that contains the resource to delete. The name is case - * insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type. - * @param resourceName The name of the resource to delete. - * @param apiVersion The API version to use for the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String apiVersion); - - /** - * Deletes a resource. - * - * @param resourceGroupName The name of the resource group that contains the resource to delete. The name is case - * insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type. - * @param resourceName The name of the resource to delete. - * @param apiVersion The API version to use for the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String apiVersion); - - /** - * Deletes a resource. - * - * @param resourceGroupName The name of the resource group that contains the resource to delete. The name is case - * insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type. - * @param resourceName The name of the resource to delete. - * @param apiVersion The API version to use for the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String apiVersion, - Context context); - - /** - * Creates a resource. - * - * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource to create. - * @param resourceName The name of the resource to create. - * @param apiVersion The API version to use for the operation. - * @param parameters Parameters for creating or updating the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String apiVersion, - GenericResourceInner parameters); - - /** - * Creates a resource. - * - * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource to create. - * @param resourceName The name of the resource to create. - * @param apiVersion The API version to use for the operation. - * @param parameters Parameters for creating or updating the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, GenericResourceInner> beginCreateOrUpdateAsync( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String apiVersion, - GenericResourceInner parameters); - - /** - * Creates a resource. - * - * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource to create. - * @param resourceName The name of the resource to create. - * @param apiVersion The API version to use for the operation. - * @param parameters Parameters for creating or updating the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, GenericResourceInner> beginCreateOrUpdate( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String apiVersion, - GenericResourceInner parameters); - - /** - * Creates a resource. - * - * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource to create. - * @param resourceName The name of the resource to create. - * @param apiVersion The API version to use for the operation. - * @param parameters Parameters for creating or updating the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, GenericResourceInner> beginCreateOrUpdate( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String apiVersion, - GenericResourceInner parameters, - Context context); - - /** - * Creates a resource. - * - * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource to create. - * @param resourceName The name of the resource to create. - * @param apiVersion The API version to use for the operation. - * @param parameters Parameters for creating or updating the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String apiVersion, - GenericResourceInner parameters); - - /** - * Creates a resource. - * - * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource to create. - * @param resourceName The name of the resource to create. - * @param apiVersion The API version to use for the operation. - * @param parameters Parameters for creating or updating the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GenericResourceInner createOrUpdate( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String apiVersion, - GenericResourceInner parameters); - - /** - * Creates a resource. - * - * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource to create. - * @param resourceName The name of the resource to create. - * @param apiVersion The API version to use for the operation. - * @param parameters Parameters for creating or updating the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GenericResourceInner createOrUpdate( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String apiVersion, - GenericResourceInner parameters, - Context context); - - /** - * Updates a resource. - * - * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource to update. - * @param resourceName The name of the resource to update. - * @param apiVersion The API version to use for the operation. - * @param parameters Parameters for updating the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> updateWithResponseAsync( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String apiVersion, - GenericResourceInner parameters); - - /** - * Updates a resource. - * - * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource to update. - * @param resourceName The name of the resource to update. - * @param apiVersion The API version to use for the operation. - * @param parameters Parameters for updating the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, GenericResourceInner> beginUpdateAsync( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String apiVersion, - GenericResourceInner parameters); - - /** - * Updates a resource. - * - * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource to update. - * @param resourceName The name of the resource to update. - * @param apiVersion The API version to use for the operation. - * @param parameters Parameters for updating the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, GenericResourceInner> beginUpdate( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String apiVersion, - GenericResourceInner parameters); - - /** - * Updates a resource. - * - * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource to update. - * @param resourceName The name of the resource to update. - * @param apiVersion The API version to use for the operation. - * @param parameters Parameters for updating the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, GenericResourceInner> beginUpdate( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String apiVersion, - GenericResourceInner parameters, - Context context); - - /** - * Updates a resource. - * - * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource to update. - * @param resourceName The name of the resource to update. - * @param apiVersion The API version to use for the operation. - * @param parameters Parameters for updating the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAsync( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String apiVersion, - GenericResourceInner parameters); - - /** - * Updates a resource. - * - * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource to update. - * @param resourceName The name of the resource to update. - * @param apiVersion The API version to use for the operation. - * @param parameters Parameters for updating the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GenericResourceInner update( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String apiVersion, - GenericResourceInner parameters); - - /** - * Updates a resource. - * - * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource to update. - * @param resourceName The name of the resource to update. - * @param apiVersion The API version to use for the operation. - * @param parameters Parameters for updating the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GenericResourceInner update( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String apiVersion, - GenericResourceInner parameters, - Context context); - - /** - * Gets a resource. - * - * @param resourceGroupName The name of the resource group containing the resource to get. The name is case - * insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource. - * @param resourceName The name of the resource to get. - * @param apiVersion The API version to use for the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String apiVersion); - - /** - * Gets a resource. - * - * @param resourceGroupName The name of the resource group containing the resource to get. The name is case - * insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource. - * @param resourceName The name of the resource to get. - * @param apiVersion The API version to use for the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String apiVersion); - - /** - * Gets a resource. - * - * @param resourceGroupName The name of the resource group containing the resource to get. The name is case - * insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource. - * @param resourceName The name of the resource to get. - * @param apiVersion The API version to use for the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GenericResourceInner get( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String apiVersion); - - /** - * Gets a resource. - * - * @param resourceGroupName The name of the resource group containing the resource to get. The name is case - * insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource. - * @param resourceName The name of the resource to get. - * @param apiVersion The API version to use for the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String apiVersion, - Context context); - - /** - * Checks by ID whether a resource exists. - * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> checkExistenceByIdWithResponseAsync(String resourceId, String apiVersion); - - /** - * Checks by ID whether a resource exists. - * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono checkExistenceByIdAsync(String resourceId, String apiVersion); - - /** - * Checks by ID whether a resource exists. - * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - boolean checkExistenceById(String resourceId, String apiVersion); - - /** - * Checks by ID whether a resource exists. - * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response checkExistenceByIdWithResponse(String resourceId, String apiVersion, Context context); - - /** - * Deletes a resource by ID. - * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteByIdWithResponseAsync(String resourceId, String apiVersion); - - /** - * Deletes a resource by ID. - * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginDeleteByIdAsync(String resourceId, String apiVersion); - - /** - * Deletes a resource by ID. - * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDeleteById(String resourceId, String apiVersion); - - /** - * Deletes a resource by ID. - * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDeleteById(String resourceId, String apiVersion, Context context); - - /** - * Deletes a resource by ID. - * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteByIdAsync(String resourceId, String apiVersion); - - /** - * Deletes a resource by ID. - * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deleteById(String resourceId, String apiVersion); - - /** - * Deletes a resource by ID. - * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deleteById(String resourceId, String apiVersion, Context context); - - /** - * Create a resource by ID. - * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param parameters Create or update resource parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateByIdWithResponseAsync( - String resourceId, String apiVersion, GenericResourceInner parameters); - - /** - * Create a resource by ID. - * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param parameters Create or update resource parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, GenericResourceInner> beginCreateOrUpdateByIdAsync( - String resourceId, String apiVersion, GenericResourceInner parameters); - - /** - * Create a resource by ID. - * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param parameters Create or update resource parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, GenericResourceInner> beginCreateOrUpdateById( - String resourceId, String apiVersion, GenericResourceInner parameters); - - /** - * Create a resource by ID. - * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param parameters Create or update resource parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, GenericResourceInner> beginCreateOrUpdateById( - String resourceId, String apiVersion, GenericResourceInner parameters, Context context); - - /** - * Create a resource by ID. - * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param parameters Create or update resource parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateByIdAsync( - String resourceId, String apiVersion, GenericResourceInner parameters); - - /** - * Create a resource by ID. - * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param parameters Create or update resource parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GenericResourceInner createOrUpdateById(String resourceId, String apiVersion, GenericResourceInner parameters); - - /** - * Create a resource by ID. - * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param parameters Create or update resource parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GenericResourceInner createOrUpdateById( - String resourceId, String apiVersion, GenericResourceInner parameters, Context context); - - /** - * Updates a resource by ID. - * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param parameters Update resource parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> updateByIdWithResponseAsync( - String resourceId, String apiVersion, GenericResourceInner parameters); - - /** - * Updates a resource by ID. - * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param parameters Update resource parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, GenericResourceInner> beginUpdateByIdAsync( - String resourceId, String apiVersion, GenericResourceInner parameters); - - /** - * Updates a resource by ID. - * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param parameters Update resource parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, GenericResourceInner> beginUpdateById( - String resourceId, String apiVersion, GenericResourceInner parameters); - - /** - * Updates a resource by ID. - * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param parameters Update resource parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, GenericResourceInner> beginUpdateById( - String resourceId, String apiVersion, GenericResourceInner parameters, Context context); - - /** - * Updates a resource by ID. - * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param parameters Update resource parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateByIdAsync(String resourceId, String apiVersion, GenericResourceInner parameters); - - /** - * Updates a resource by ID. - * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param parameters Update resource parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GenericResourceInner updateById(String resourceId, String apiVersion, GenericResourceInner parameters); - - /** - * Updates a resource by ID. - * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param parameters Update resource parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GenericResourceInner updateById( - String resourceId, String apiVersion, GenericResourceInner parameters, Context context); - - /** - * Gets a resource by ID. - * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a resource by ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByIdWithResponseAsync(String resourceId, String apiVersion); - - /** - * Gets a resource by ID. - * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a resource by ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByIdAsync(String resourceId, String apiVersion); - - /** - * Gets a resource by ID. - * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a resource by ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GenericResourceInner getById(String resourceId, String apiVersion); - - /** - * Gets a resource by ID. - * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a resource by ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByIdWithResponse(String resourceId, String apiVersion, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/SubscriptionClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/SubscriptionClient.java deleted file mode 100644 index 155143c483e1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/SubscriptionClient.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.fluent; - -import com.azure.core.http.HttpPipeline; -import java.time.Duration; - -/** The interface for SubscriptionClient class. */ -public interface SubscriptionClient { - /** - * Gets server parameter. - * - * @return the endpoint value. - */ - String getEndpoint(); - - /** - * Gets Api Version. - * - * @return the apiVersion value. - */ - String getApiVersion(); - - /** - * Gets The HTTP pipeline to send requests through. - * - * @return the httpPipeline value. - */ - HttpPipeline getHttpPipeline(); - - /** - * Gets The default poll interval for long-running operation. - * - * @return the defaultPollInterval value. - */ - Duration getDefaultPollInterval(); - - /** - * Gets the SubscriptionsClient object to access its operations. - * - * @return the SubscriptionsClient object. - */ - SubscriptionsClient getSubscriptions(); - - /** - * Gets the TenantsClient object to access its operations. - * - * @return the TenantsClient object. - */ - TenantsClient getTenants(); - - /** - * Gets the ResourceNamesClient object to access its operations. - * - * @return the ResourceNamesClient object. - */ - ResourceNamesClient getResourceNames(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/SubscriptionsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/SubscriptionsClient.java deleted file mode 100644 index 986d61b6527e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/SubscriptionsClient.java +++ /dev/null @@ -1,139 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.resources.fluent.models.LocationInner; -import com.azure.resourcemanager.resources.fluent.models.SubscriptionInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in SubscriptionsClient. */ -public interface SubscriptionsClient { - /** - * This operation provides all the locations that are available for resource providers; however, each resource - * provider may support a subset of this list. - * - * @param subscriptionId The ID of the target subscription. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return location list operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listLocationsAsync(String subscriptionId); - - /** - * This operation provides all the locations that are available for resource providers; however, each resource - * provider may support a subset of this list. - * - * @param subscriptionId The ID of the target subscription. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return location list operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listLocations(String subscriptionId); - - /** - * This operation provides all the locations that are available for resource providers; however, each resource - * provider may support a subset of this list. - * - * @param subscriptionId The ID of the target subscription. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return location list operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listLocations(String subscriptionId, Context context); - - /** - * Gets details about a specified subscription. - * - * @param subscriptionId The ID of the target subscription. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return details about a specified subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync(String subscriptionId); - - /** - * Gets details about a specified subscription. - * - * @param subscriptionId The ID of the target subscription. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return details about a specified subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync(String subscriptionId); - - /** - * Gets details about a specified subscription. - * - * @param subscriptionId The ID of the target subscription. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return details about a specified subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SubscriptionInner get(String subscriptionId); - - /** - * Gets details about a specified subscription. - * - * @param subscriptionId The ID of the target subscription. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return details about a specified subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String subscriptionId, Context context); - - /** - * Gets all subscriptions for a tenant. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all subscriptions for a tenant. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Gets all subscriptions for a tenant. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all subscriptions for a tenant. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Gets all subscriptions for a tenant. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all subscriptions for a tenant. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/TagOperationsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/TagOperationsClient.java deleted file mode 100644 index 13e2dd0b3c84..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/TagOperationsClient.java +++ /dev/null @@ -1,509 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.resources.fluent.models.TagDetailsInner; -import com.azure.resourcemanager.resources.fluent.models.TagValueInner; -import com.azure.resourcemanager.resources.fluent.models.TagsResourceInner; -import com.azure.resourcemanager.resources.models.TagsPatchResource; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in TagOperationsClient. */ -public interface TagOperationsClient { - /** - * This operation allows deleting a value from the list of predefined values for an existing predefined tag name. - * The value being deleted must not be in use as a tag value for the given tag name for any resource. - * - * @param tagName The name of the tag. - * @param tagValue The value of the tag to delete. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteValueWithResponseAsync(String tagName, String tagValue); - - /** - * This operation allows deleting a value from the list of predefined values for an existing predefined tag name. - * The value being deleted must not be in use as a tag value for the given tag name for any resource. - * - * @param tagName The name of the tag. - * @param tagValue The value of the tag to delete. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteValueAsync(String tagName, String tagValue); - - /** - * This operation allows deleting a value from the list of predefined values for an existing predefined tag name. - * The value being deleted must not be in use as a tag value for the given tag name for any resource. - * - * @param tagName The name of the tag. - * @param tagValue The value of the tag to delete. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deleteValue(String tagName, String tagValue); - - /** - * This operation allows deleting a value from the list of predefined values for an existing predefined tag name. - * The value being deleted must not be in use as a tag value for the given tag name for any resource. - * - * @param tagName The name of the tag. - * @param tagValue The value of the tag to delete. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteValueWithResponse(String tagName, String tagValue, Context context); - - /** - * This operation allows adding a value to the list of predefined values for an existing predefined tag name. A tag - * value can have a maximum of 256 characters. - * - * @param tagName The name of the tag. - * @param tagValue The value of the tag to create. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return tag information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createOrUpdateValueWithResponseAsync(String tagName, String tagValue); - - /** - * This operation allows adding a value to the list of predefined values for an existing predefined tag name. A tag - * value can have a maximum of 256 characters. - * - * @param tagName The name of the tag. - * @param tagValue The value of the tag to create. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return tag information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateValueAsync(String tagName, String tagValue); - - /** - * This operation allows adding a value to the list of predefined values for an existing predefined tag name. A tag - * value can have a maximum of 256 characters. - * - * @param tagName The name of the tag. - * @param tagValue The value of the tag to create. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return tag information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - TagValueInner createOrUpdateValue(String tagName, String tagValue); - - /** - * This operation allows adding a value to the list of predefined values for an existing predefined tag name. A tag - * value can have a maximum of 256 characters. - * - * @param tagName The name of the tag. - * @param tagValue The value of the tag to create. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return tag information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateValueWithResponse(String tagName, String tagValue, Context context); - - /** - * This operation allows adding a name to the list of predefined tag names for the given subscription. A tag name - * can have a maximum of 512 characters and is case-insensitive. Tag names cannot have the following prefixes which - * are reserved for Azure use: 'microsoft', 'azure', 'windows'. - * - * @param tagName The name of the tag to create. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return tag details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createOrUpdateWithResponseAsync(String tagName); - - /** - * This operation allows adding a name to the list of predefined tag names for the given subscription. A tag name - * can have a maximum of 512 characters and is case-insensitive. Tag names cannot have the following prefixes which - * are reserved for Azure use: 'microsoft', 'azure', 'windows'. - * - * @param tagName The name of the tag to create. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return tag details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync(String tagName); - - /** - * This operation allows adding a name to the list of predefined tag names for the given subscription. A tag name - * can have a maximum of 512 characters and is case-insensitive. Tag names cannot have the following prefixes which - * are reserved for Azure use: 'microsoft', 'azure', 'windows'. - * - * @param tagName The name of the tag to create. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return tag details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - TagDetailsInner createOrUpdate(String tagName); - - /** - * This operation allows adding a name to the list of predefined tag names for the given subscription. A tag name - * can have a maximum of 512 characters and is case-insensitive. Tag names cannot have the following prefixes which - * are reserved for Azure use: 'microsoft', 'azure', 'windows'. - * - * @param tagName The name of the tag to create. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return tag details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse(String tagName, Context context); - - /** - * This operation allows deleting a name from the list of predefined tag names for the given subscription. The name - * being deleted must not be in use as a tag name for any resource. All predefined values for the given name must - * have already been deleted. - * - * @param tagName The name of the tag. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteWithResponseAsync(String tagName); - - /** - * This operation allows deleting a name from the list of predefined tag names for the given subscription. The name - * being deleted must not be in use as a tag name for any resource. All predefined values for the given name must - * have already been deleted. - * - * @param tagName The name of the tag. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String tagName); - - /** - * This operation allows deleting a name from the list of predefined tag names for the given subscription. The name - * being deleted must not be in use as a tag name for any resource. All predefined values for the given name must - * have already been deleted. - * - * @param tagName The name of the tag. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String tagName); - - /** - * This operation allows deleting a name from the list of predefined tag names for the given subscription. The name - * being deleted must not be in use as a tag name for any resource. All predefined values for the given name must - * have already been deleted. - * - * @param tagName The name of the tag. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String tagName, Context context); - - /** - * This operation performs a union of predefined tags, resource tags, resource group tags and subscription tags, and - * returns a summary of usage for each tag name and value under the given subscription. In case of a large number of - * tags, this operation may return a previously cached result. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of subscription tags. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * This operation performs a union of predefined tags, resource tags, resource group tags and subscription tags, and - * returns a summary of usage for each tag name and value under the given subscription. In case of a large number of - * tags, this operation may return a previously cached result. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of subscription tags. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * This operation performs a union of predefined tags, resource tags, resource group tags and subscription tags, and - * returns a summary of usage for each tag name and value under the given subscription. In case of a large number of - * tags, this operation may return a previously cached result. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of subscription tags. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The - * specified entity can have a maximum of 50 tags. - * - * @param scope The resource scope. - * @param parameters Wrapper resource for tags API requests and responses. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return wrapper resource for tags API requests and responses. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createOrUpdateAtScopeWithResponseAsync( - String scope, TagsResourceInner parameters); - - /** - * This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The - * specified entity can have a maximum of 50 tags. - * - * @param scope The resource scope. - * @param parameters Wrapper resource for tags API requests and responses. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return wrapper resource for tags API requests and responses. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAtScopeAsync(String scope, TagsResourceInner parameters); - - /** - * This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The - * specified entity can have a maximum of 50 tags. - * - * @param scope The resource scope. - * @param parameters Wrapper resource for tags API requests and responses. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return wrapper resource for tags API requests and responses. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - TagsResourceInner createOrUpdateAtScope(String scope, TagsResourceInner parameters); - - /** - * This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The - * specified entity can have a maximum of 50 tags. - * - * @param scope The resource scope. - * @param parameters Wrapper resource for tags API requests and responses. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return wrapper resource for tags API requests and responses. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateAtScopeWithResponse( - String scope, TagsResourceInner parameters, Context context); - - /** - * This operation allows replacing, merging or selectively deleting tags on the specified resource or subscription. - * The specified entity can have a maximum of 50 tags at the end of the operation. The 'replace' option replaces the - * entire set of existing tags with a new set. The 'merge' option allows adding tags with new names and updating the - * values of tags with existing names. The 'delete' option allows selectively deleting tags based on given names or - * name/value pairs. - * - * @param scope The resource scope. - * @param parameters Wrapper resource for tags patch API request only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return wrapper resource for tags API requests and responses. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateAtScopeWithResponseAsync(String scope, TagsPatchResource parameters); - - /** - * This operation allows replacing, merging or selectively deleting tags on the specified resource or subscription. - * The specified entity can have a maximum of 50 tags at the end of the operation. The 'replace' option replaces the - * entire set of existing tags with a new set. The 'merge' option allows adding tags with new names and updating the - * values of tags with existing names. The 'delete' option allows selectively deleting tags based on given names or - * name/value pairs. - * - * @param scope The resource scope. - * @param parameters Wrapper resource for tags patch API request only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return wrapper resource for tags API requests and responses. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAtScopeAsync(String scope, TagsPatchResource parameters); - - /** - * This operation allows replacing, merging or selectively deleting tags on the specified resource or subscription. - * The specified entity can have a maximum of 50 tags at the end of the operation. The 'replace' option replaces the - * entire set of existing tags with a new set. The 'merge' option allows adding tags with new names and updating the - * values of tags with existing names. The 'delete' option allows selectively deleting tags based on given names or - * name/value pairs. - * - * @param scope The resource scope. - * @param parameters Wrapper resource for tags patch API request only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return wrapper resource for tags API requests and responses. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - TagsResourceInner updateAtScope(String scope, TagsPatchResource parameters); - - /** - * This operation allows replacing, merging or selectively deleting tags on the specified resource or subscription. - * The specified entity can have a maximum of 50 tags at the end of the operation. The 'replace' option replaces the - * entire set of existing tags with a new set. The 'merge' option allows adding tags with new names and updating the - * values of tags with existing names. The 'delete' option allows selectively deleting tags based on given names or - * name/value pairs. - * - * @param scope The resource scope. - * @param parameters Wrapper resource for tags patch API request only. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return wrapper resource for tags API requests and responses. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateAtScopeWithResponse(String scope, TagsPatchResource parameters, Context context); - - /** - * Gets the entire set of tags on a resource or subscription. - * - * @param scope The resource scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the entire set of tags on a resource or subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getAtScopeWithResponseAsync(String scope); - - /** - * Gets the entire set of tags on a resource or subscription. - * - * @param scope The resource scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the entire set of tags on a resource or subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAtScopeAsync(String scope); - - /** - * Gets the entire set of tags on a resource or subscription. - * - * @param scope The resource scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the entire set of tags on a resource or subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - TagsResourceInner getAtScope(String scope); - - /** - * Gets the entire set of tags on a resource or subscription. - * - * @param scope The resource scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the entire set of tags on a resource or subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getAtScopeWithResponse(String scope, Context context); - - /** - * Deletes the entire set of tags on a resource or subscription. - * - * @param scope The resource scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteAtScopeWithResponseAsync(String scope); - - /** - * Deletes the entire set of tags on a resource or subscription. - * - * @param scope The resource scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAtScopeAsync(String scope); - - /** - * Deletes the entire set of tags on a resource or subscription. - * - * @param scope The resource scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deleteAtScope(String scope); - - /** - * Deletes the entire set of tags on a resource or subscription. - * - * @param scope The resource scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteAtScopeWithResponse(String scope, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/TenantsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/TenantsClient.java deleted file mode 100644 index 632b8307f39e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/TenantsClient.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.resources.fluent.models.TenantIdDescriptionInner; - -/** An instance of this class provides access to all the operations defined in TenantsClient. */ -public interface TenantsClient { - /** - * Gets the tenants for your account. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the tenants for your account. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Gets the tenants for your account. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the tenants for your account. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Gets the tenants for your account. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the tenants for your account. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/CheckResourceNameResultInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/CheckResourceNameResultInner.java deleted file mode 100644 index 48134f82de3f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/CheckResourceNameResultInner.java +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.resources.models.ResourceNameStatus; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Resource Name valid if not a reserved word, does not contain a reserved word and does not start with a reserved word. - */ -@Fluent -public final class CheckResourceNameResultInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CheckResourceNameResultInner.class); - - /* - * Name of Resource - */ - @JsonProperty(value = "name") - private String name; - - /* - * Type of Resource - */ - @JsonProperty(value = "type") - private String type; - - /* - * Is the resource name Allowed or Reserved - */ - @JsonProperty(value = "status") - private ResourceNameStatus status; - - /** - * Get the name property: Name of Resource. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Name of Resource. - * - * @param name the name value to set. - * @return the CheckResourceNameResultInner object itself. - */ - public CheckResourceNameResultInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the type property: Type of Resource. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Set the type property: Type of Resource. - * - * @param type the type value to set. - * @return the CheckResourceNameResultInner object itself. - */ - public CheckResourceNameResultInner withType(String type) { - this.type = type; - return this; - } - - /** - * Get the status property: Is the resource name Allowed or Reserved. - * - * @return the status value. - */ - public ResourceNameStatus status() { - return this.status; - } - - /** - * Set the status property: Is the resource name Allowed or Reserved. - * - * @param status the status value to set. - * @return the CheckResourceNameResultInner object itself. - */ - public CheckResourceNameResultInner withStatus(ResourceNameStatus status) { - this.status = status; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentExportResultInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentExportResultInner.java deleted file mode 100644 index f5ef9d7b1060..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentExportResultInner.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The deployment export result. */ -@Fluent -public final class DeploymentExportResultInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DeploymentExportResultInner.class); - - /* - * The template content. - */ - @JsonProperty(value = "template") - private Object template; - - /** - * Get the template property: The template content. - * - * @return the template value. - */ - public Object template() { - return this.template; - } - - /** - * Set the template property: The template content. - * - * @param template the template value to set. - * @return the DeploymentExportResultInner object itself. - */ - public DeploymentExportResultInner withTemplate(Object template) { - this.template = template; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentExtendedInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentExtendedInner.java deleted file mode 100644 index 31e6ca5fc081..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentExtendedInner.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.resources.models.DeploymentPropertiesExtended; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** Deployment information. */ -@Fluent -public final class DeploymentExtendedInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DeploymentExtendedInner.class); - - /* - * Deployment properties. - */ - @JsonProperty(value = "properties") - private DeploymentPropertiesExtended properties; - - /** - * Get the properties property: Deployment properties. - * - * @return the properties value. - */ - public DeploymentPropertiesExtended properties() { - return this.properties; - } - - /** - * Set the properties property: Deployment properties. - * - * @param properties the properties value to set. - * @return the DeploymentExtendedInner object itself. - */ - public DeploymentExtendedInner withProperties(DeploymentPropertiesExtended properties) { - this.properties = properties; - return this; - } - - /** {@inheritDoc} */ - @Override - public DeploymentExtendedInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public DeploymentExtendedInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentInner.java deleted file mode 100644 index e765833d64fc..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentInner.java +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.resources.models.DeploymentProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** Deployment operation parameters. */ -@Fluent -public final class DeploymentInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DeploymentInner.class); - - /* - * The location to store the deployment data. - */ - @JsonProperty(value = "location") - private String location; - - /* - * The deployment properties. - */ - @JsonProperty(value = "properties", required = true) - private DeploymentProperties properties; - - /* - * Deployment tags - */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map tags; - - /** - * Get the location property: The location to store the deployment data. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Set the location property: The location to store the deployment data. - * - * @param location the location value to set. - * @return the DeploymentInner object itself. - */ - public DeploymentInner withLocation(String location) { - this.location = location; - return this; - } - - /** - * Get the properties property: The deployment properties. - * - * @return the properties value. - */ - public DeploymentProperties properties() { - return this.properties; - } - - /** - * Set the properties property: The deployment properties. - * - * @param properties the properties value to set. - * @return the DeploymentInner object itself. - */ - public DeploymentInner withProperties(DeploymentProperties properties) { - this.properties = properties; - return this; - } - - /** - * Get the tags property: Deployment tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Deployment tags. - * - * @param tags the tags value to set. - * @return the DeploymentInner object itself. - */ - public DeploymentInner withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property properties in model DeploymentInner")); - } else { - properties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentOperationInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentOperationInner.java deleted file mode 100644 index b67df2489f72..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentOperationInner.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.resources.models.DeploymentOperationProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Deployment operation information. */ -@Fluent -public final class DeploymentOperationInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DeploymentOperationInner.class); - - /* - * Full deployment operation ID. - */ - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) - private String id; - - /* - * Deployment operation ID. - */ - @JsonProperty(value = "operationId", access = JsonProperty.Access.WRITE_ONLY) - private String operationId; - - /* - * Deployment properties. - */ - @JsonProperty(value = "properties") - private DeploymentOperationProperties properties; - - /** - * Get the id property: Full deployment operation ID. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Get the operationId property: Deployment operation ID. - * - * @return the operationId value. - */ - public String operationId() { - return this.operationId; - } - - /** - * Get the properties property: Deployment properties. - * - * @return the properties value. - */ - public DeploymentOperationProperties properties() { - return this.properties; - } - - /** - * Set the properties property: Deployment properties. - * - * @param properties the properties value to set. - * @return the DeploymentOperationInner object itself. - */ - public DeploymentOperationInner withProperties(DeploymentOperationProperties properties) { - this.properties = properties; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentValidateResultInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentValidateResultInner.java deleted file mode 100644 index fa30abffdb42..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentValidateResultInner.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.exception.ManagementError; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.resources.models.DeploymentPropertiesExtended; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Information from validate template deployment response. */ -@Fluent -public final class DeploymentValidateResultInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DeploymentValidateResultInner.class); - - /* - * Error Response The deployment validation error. - */ - @JsonProperty(value = "error", access = JsonProperty.Access.WRITE_ONLY) - private ManagementError error; - - /* - * The template deployment properties. - */ - @JsonProperty(value = "properties") - private DeploymentPropertiesExtended properties; - - /** - * Get the error property: Error Response The deployment validation error. - * - * @return the error value. - */ - public ManagementError error() { - return this.error; - } - - /** - * Get the properties property: The template deployment properties. - * - * @return the properties value. - */ - public DeploymentPropertiesExtended properties() { - return this.properties; - } - - /** - * Set the properties property: The template deployment properties. - * - * @param properties the properties value to set. - * @return the DeploymentValidateResultInner object itself. - */ - public DeploymentValidateResultInner withProperties(DeploymentPropertiesExtended properties) { - this.properties = properties; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/FeatureResultInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/FeatureResultInner.java deleted file mode 100644 index bf7c24e85533..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/FeatureResultInner.java +++ /dev/null @@ -1,132 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.resources.models.FeatureProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Previewed feature information. */ -@Fluent -public final class FeatureResultInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(FeatureResultInner.class); - - /* - * The name of the feature. - */ - @JsonProperty(value = "name") - private String name; - - /* - * Properties of the previewed feature. - */ - @JsonProperty(value = "properties") - private FeatureProperties properties; - - /* - * The resource ID of the feature. - */ - @JsonProperty(value = "id") - private String id; - - /* - * The resource type of the feature. - */ - @JsonProperty(value = "type") - private String type; - - /** - * Get the name property: The name of the feature. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the feature. - * - * @param name the name value to set. - * @return the FeatureResultInner object itself. - */ - public FeatureResultInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the properties property: Properties of the previewed feature. - * - * @return the properties value. - */ - public FeatureProperties properties() { - return this.properties; - } - - /** - * Set the properties property: Properties of the previewed feature. - * - * @param properties the properties value to set. - * @return the FeatureResultInner object itself. - */ - public FeatureResultInner withProperties(FeatureProperties properties) { - this.properties = properties; - return this; - } - - /** - * Get the id property: The resource ID of the feature. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: The resource ID of the feature. - * - * @param id the id value to set. - * @return the FeatureResultInner object itself. - */ - public FeatureResultInner withId(String id) { - this.id = id; - return this; - } - - /** - * Get the type property: The resource type of the feature. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Set the type property: The resource type of the feature. - * - * @param type the type value to set. - * @return the FeatureResultInner object itself. - */ - public FeatureResultInner withType(String type) { - this.type = type; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/GenericResourceExpandedInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/GenericResourceExpandedInner.java deleted file mode 100644 index 31c5db0f6d0a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/GenericResourceExpandedInner.java +++ /dev/null @@ -1,138 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.resources.models.Identity; -import com.azure.resourcemanager.resources.models.Plan; -import com.azure.resourcemanager.resources.models.Sku; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.Map; - -/** Resource information. */ -@Fluent -public final class GenericResourceExpandedInner extends GenericResourceInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(GenericResourceExpandedInner.class); - - /* - * The created time of the resource. This is only present if requested via - * the $expand query parameter. - */ - @JsonProperty(value = "createdTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime createdTime; - - /* - * The changed time of the resource. This is only present if requested via - * the $expand query parameter. - */ - @JsonProperty(value = "changedTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime changedTime; - - /* - * The provisioning state of the resource. This is only present if - * requested via the $expand query parameter. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; - - /** - * Get the createdTime property: The created time of the resource. This is only present if requested via the $expand - * query parameter. - * - * @return the createdTime value. - */ - public OffsetDateTime createdTime() { - return this.createdTime; - } - - /** - * Get the changedTime property: The changed time of the resource. This is only present if requested via the $expand - * query parameter. - * - * @return the changedTime value. - */ - public OffsetDateTime changedTime() { - return this.changedTime; - } - - /** - * Get the provisioningState property: The provisioning state of the resource. This is only present if requested via - * the $expand query parameter. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** {@inheritDoc} */ - @Override - public GenericResourceExpandedInner withPlan(Plan plan) { - super.withPlan(plan); - return this; - } - - /** {@inheritDoc} */ - @Override - public GenericResourceExpandedInner withProperties(Object properties) { - super.withProperties(properties); - return this; - } - - /** {@inheritDoc} */ - @Override - public GenericResourceExpandedInner withKind(String kind) { - super.withKind(kind); - return this; - } - - /** {@inheritDoc} */ - @Override - public GenericResourceExpandedInner withManagedBy(String managedBy) { - super.withManagedBy(managedBy); - return this; - } - - /** {@inheritDoc} */ - @Override - public GenericResourceExpandedInner withSku(Sku sku) { - super.withSku(sku); - return this; - } - - /** {@inheritDoc} */ - @Override - public GenericResourceExpandedInner withIdentity(Identity identity) { - super.withIdentity(identity); - return this; - } - - /** {@inheritDoc} */ - @Override - public GenericResourceExpandedInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public GenericResourceExpandedInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/GenericResourceInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/GenericResourceInner.java deleted file mode 100644 index 8d19403542af..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/GenericResourceInner.java +++ /dev/null @@ -1,208 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.resources.models.Identity; -import com.azure.resourcemanager.resources.models.Plan; -import com.azure.resourcemanager.resources.models.Sku; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** Resource information. */ -@Fluent -public class GenericResourceInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(GenericResourceInner.class); - - /* - * The plan of the resource. - */ - @JsonProperty(value = "plan") - private Plan plan; - - /* - * The resource properties. - */ - @JsonProperty(value = "properties") - private Object properties; - - /* - * The kind of the resource. - */ - @JsonProperty(value = "kind") - private String kind; - - /* - * ID of the resource that manages this resource. - */ - @JsonProperty(value = "managedBy") - private String managedBy; - - /* - * The SKU of the resource. - */ - @JsonProperty(value = "sku") - private Sku sku; - - /* - * The identity of the resource. - */ - @JsonProperty(value = "identity") - private Identity identity; - - /** - * Get the plan property: The plan of the resource. - * - * @return the plan value. - */ - public Plan plan() { - return this.plan; - } - - /** - * Set the plan property: The plan of the resource. - * - * @param plan the plan value to set. - * @return the GenericResourceInner object itself. - */ - public GenericResourceInner withPlan(Plan plan) { - this.plan = plan; - return this; - } - - /** - * Get the properties property: The resource properties. - * - * @return the properties value. - */ - public Object properties() { - return this.properties; - } - - /** - * Set the properties property: The resource properties. - * - * @param properties the properties value to set. - * @return the GenericResourceInner object itself. - */ - public GenericResourceInner withProperties(Object properties) { - this.properties = properties; - return this; - } - - /** - * Get the kind property: The kind of the resource. - * - * @return the kind value. - */ - public String kind() { - return this.kind; - } - - /** - * Set the kind property: The kind of the resource. - * - * @param kind the kind value to set. - * @return the GenericResourceInner object itself. - */ - public GenericResourceInner withKind(String kind) { - this.kind = kind; - return this; - } - - /** - * Get the managedBy property: ID of the resource that manages this resource. - * - * @return the managedBy value. - */ - public String managedBy() { - return this.managedBy; - } - - /** - * Set the managedBy property: ID of the resource that manages this resource. - * - * @param managedBy the managedBy value to set. - * @return the GenericResourceInner object itself. - */ - public GenericResourceInner withManagedBy(String managedBy) { - this.managedBy = managedBy; - return this; - } - - /** - * Get the sku property: The SKU of the resource. - * - * @return the sku value. - */ - public Sku sku() { - return this.sku; - } - - /** - * Set the sku property: The SKU of the resource. - * - * @param sku the sku value to set. - * @return the GenericResourceInner object itself. - */ - public GenericResourceInner withSku(Sku sku) { - this.sku = sku; - return this; - } - - /** - * Get the identity property: The identity of the resource. - * - * @return the identity value. - */ - public Identity identity() { - return this.identity; - } - - /** - * Set the identity property: The identity of the resource. - * - * @param identity the identity value to set. - * @return the GenericResourceInner object itself. - */ - public GenericResourceInner withIdentity(Identity identity) { - this.identity = identity; - return this; - } - - /** {@inheritDoc} */ - @Override - public GenericResourceInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public GenericResourceInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (plan() != null) { - plan().validate(); - } - if (sku() != null) { - sku().validate(); - } - if (identity() != null) { - identity().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/LocationInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/LocationInner.java deleted file mode 100644 index 4db96aa49186..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/LocationInner.java +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Location information. */ -@Immutable -public final class LocationInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LocationInner.class); - - /* - * The fully qualified ID of the location. For example, - * /subscriptions/00000000-0000-0000-0000-000000000000/locations/westus. - */ - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) - private String id; - - /* - * The subscription ID. - */ - @JsonProperty(value = "subscriptionId", access = JsonProperty.Access.WRITE_ONLY) - private String subscriptionId; - - /* - * The location name. - */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) - private String name; - - /* - * The display name of the location. - */ - @JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY) - private String displayName; - - /* - * The latitude of the location. - */ - @JsonProperty(value = "latitude", access = JsonProperty.Access.WRITE_ONLY) - private String latitude; - - /* - * The longitude of the location. - */ - @JsonProperty(value = "longitude", access = JsonProperty.Access.WRITE_ONLY) - private String longitude; - - /** - * Get the id property: The fully qualified ID of the location. For example, - * /subscriptions/00000000-0000-0000-0000-000000000000/locations/westus. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Get the subscriptionId property: The subscription ID. - * - * @return the subscriptionId value. - */ - public String subscriptionId() { - return this.subscriptionId; - } - - /** - * Get the name property: The location name. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the displayName property: The display name of the location. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Get the latitude property: The latitude of the location. - * - * @return the latitude value. - */ - public String latitude() { - return this.latitude; - } - - /** - * Get the longitude property: The longitude of the location. - * - * @return the longitude value. - */ - public String longitude() { - return this.longitude; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/ManagementLockObjectInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/ManagementLockObjectInner.java deleted file mode 100644 index bb3d7fa9e673..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/ManagementLockObjectInner.java +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.resources.models.LockLevel; -import com.azure.resourcemanager.resources.models.ManagementLockOwner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The lock information. */ -@Fluent -public final class ManagementLockObjectInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagementLockObjectInner.class); - - /* - * The properties of the lock. - */ - @JsonProperty(value = "properties", required = true) - private ManagementLockProperties innerProperties = new ManagementLockProperties(); - - /** - * Get the innerProperties property: The properties of the lock. - * - * @return the innerProperties value. - */ - private ManagementLockProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the level property: The level of the lock. Possible values are: NotSpecified, CanNotDelete, ReadOnly. - * CanNotDelete means authorized users are able to read and modify the resources, but not delete. ReadOnly means - * authorized users can only read from a resource, but they can't modify or delete it. - * - * @return the level value. - */ - public LockLevel level() { - return this.innerProperties() == null ? null : this.innerProperties().level(); - } - - /** - * Set the level property: The level of the lock. Possible values are: NotSpecified, CanNotDelete, ReadOnly. - * CanNotDelete means authorized users are able to read and modify the resources, but not delete. ReadOnly means - * authorized users can only read from a resource, but they can't modify or delete it. - * - * @param level the level value to set. - * @return the ManagementLockObjectInner object itself. - */ - public ManagementLockObjectInner withLevel(LockLevel level) { - if (this.innerProperties() == null) { - this.innerProperties = new ManagementLockProperties(); - } - this.innerProperties().withLevel(level); - return this; - } - - /** - * Get the notes property: Notes about the lock. Maximum of 512 characters. - * - * @return the notes value. - */ - public String notes() { - return this.innerProperties() == null ? null : this.innerProperties().notes(); - } - - /** - * Set the notes property: Notes about the lock. Maximum of 512 characters. - * - * @param notes the notes value to set. - * @return the ManagementLockObjectInner object itself. - */ - public ManagementLockObjectInner withNotes(String notes) { - if (this.innerProperties() == null) { - this.innerProperties = new ManagementLockProperties(); - } - this.innerProperties().withNotes(notes); - return this; - } - - /** - * Get the owners property: The owners of the lock. - * - * @return the owners value. - */ - public List owners() { - return this.innerProperties() == null ? null : this.innerProperties().owners(); - } - - /** - * Set the owners property: The owners of the lock. - * - * @param owners the owners value to set. - * @return the ManagementLockObjectInner object itself. - */ - public ManagementLockObjectInner withOwners(List owners) { - if (this.innerProperties() == null) { - this.innerProperties = new ManagementLockProperties(); - } - this.innerProperties().withOwners(owners); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property innerProperties in model ManagementLockObjectInner")); - } else { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/ManagementLockProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/ManagementLockProperties.java deleted file mode 100644 index 6ec567a91e92..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/ManagementLockProperties.java +++ /dev/null @@ -1,120 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.resources.models.LockLevel; -import com.azure.resourcemanager.resources.models.ManagementLockOwner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The lock properties. */ -@Fluent -public final class ManagementLockProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagementLockProperties.class); - - /* - * The level of the lock. Possible values are: NotSpecified, CanNotDelete, - * ReadOnly. CanNotDelete means authorized users are able to read and - * modify the resources, but not delete. ReadOnly means authorized users - * can only read from a resource, but they can't modify or delete it. - */ - @JsonProperty(value = "level", required = true) - private LockLevel level; - - /* - * Notes about the lock. Maximum of 512 characters. - */ - @JsonProperty(value = "notes") - private String notes; - - /* - * The owners of the lock. - */ - @JsonProperty(value = "owners") - private List owners; - - /** - * Get the level property: The level of the lock. Possible values are: NotSpecified, CanNotDelete, ReadOnly. - * CanNotDelete means authorized users are able to read and modify the resources, but not delete. ReadOnly means - * authorized users can only read from a resource, but they can't modify or delete it. - * - * @return the level value. - */ - public LockLevel level() { - return this.level; - } - - /** - * Set the level property: The level of the lock. Possible values are: NotSpecified, CanNotDelete, ReadOnly. - * CanNotDelete means authorized users are able to read and modify the resources, but not delete. ReadOnly means - * authorized users can only read from a resource, but they can't modify or delete it. - * - * @param level the level value to set. - * @return the ManagementLockProperties object itself. - */ - public ManagementLockProperties withLevel(LockLevel level) { - this.level = level; - return this; - } - - /** - * Get the notes property: Notes about the lock. Maximum of 512 characters. - * - * @return the notes value. - */ - public String notes() { - return this.notes; - } - - /** - * Set the notes property: Notes about the lock. Maximum of 512 characters. - * - * @param notes the notes value to set. - * @return the ManagementLockProperties object itself. - */ - public ManagementLockProperties withNotes(String notes) { - this.notes = notes; - return this; - } - - /** - * Get the owners property: The owners of the lock. - * - * @return the owners value. - */ - public List owners() { - return this.owners; - } - - /** - * Set the owners property: The owners of the lock. - * - * @param owners the owners value to set. - * @return the ManagementLockProperties object itself. - */ - public ManagementLockProperties withOwners(List owners) { - this.owners = owners; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (level() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property level in model ManagementLockProperties")); - } - if (owners() != null) { - owners().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/OperationInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/OperationInner.java deleted file mode 100644 index cf98c58876a9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/OperationInner.java +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.resources.models.OperationDisplay; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Microsoft.Resources operation. */ -@Fluent -public final class OperationInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationInner.class); - - /* - * Operation name: {provider}/{resource}/{operation} - */ - @JsonProperty(value = "name") - private String name; - - /* - * The object that represents the operation. - */ - @JsonProperty(value = "display") - private OperationDisplay display; - - /** - * Get the name property: Operation name: {provider}/{resource}/{operation}. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Operation name: {provider}/{resource}/{operation}. - * - * @param name the name value to set. - * @return the OperationInner object itself. - */ - public OperationInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the display property: The object that represents the operation. - * - * @return the display value. - */ - public OperationDisplay display() { - return this.display; - } - - /** - * Set the display property: The object that represents the operation. - * - * @param display the display value to set. - * @return the OperationInner object itself. - */ - public OperationInner withDisplay(OperationDisplay display) { - this.display = display; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (display() != null) { - display().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyAssignmentInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyAssignmentInner.java deleted file mode 100644 index 541e024920f6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyAssignmentInner.java +++ /dev/null @@ -1,210 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The policy assignment. */ -@Fluent -public final class PolicyAssignmentInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PolicyAssignmentInner.class); - - /* - * Properties for the policy assignment. - */ - @JsonProperty(value = "properties") - private PolicyAssignmentProperties innerProperties; - - /* - * The type of the policy assignment. - */ - @JsonProperty(value = "type") - private String type; - - /* - * The name of the policy assignment. - */ - @JsonProperty(value = "name") - private String name; - - /** - * Get the innerProperties property: Properties for the policy assignment. - * - * @return the innerProperties value. - */ - private PolicyAssignmentProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the type property: The type of the policy assignment. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Set the type property: The type of the policy assignment. - * - * @param type the type value to set. - * @return the PolicyAssignmentInner object itself. - */ - public PolicyAssignmentInner withType(String type) { - this.type = type; - return this; - } - - /** - * Get the name property: The name of the policy assignment. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the policy assignment. - * - * @param name the name value to set. - * @return the PolicyAssignmentInner object itself. - */ - public PolicyAssignmentInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the displayName property: The display name of the policy assignment. - * - * @return the displayName value. - */ - public String displayName() { - return this.innerProperties() == null ? null : this.innerProperties().displayName(); - } - - /** - * Set the displayName property: The display name of the policy assignment. - * - * @param displayName the displayName value to set. - * @return the PolicyAssignmentInner object itself. - */ - public PolicyAssignmentInner withDisplayName(String displayName) { - if (this.innerProperties() == null) { - this.innerProperties = new PolicyAssignmentProperties(); - } - this.innerProperties().withDisplayName(displayName); - return this; - } - - /** - * Get the policyDefinitionId property: The ID of the policy definition. - * - * @return the policyDefinitionId value. - */ - public String policyDefinitionId() { - return this.innerProperties() == null ? null : this.innerProperties().policyDefinitionId(); - } - - /** - * Set the policyDefinitionId property: The ID of the policy definition. - * - * @param policyDefinitionId the policyDefinitionId value to set. - * @return the PolicyAssignmentInner object itself. - */ - public PolicyAssignmentInner withPolicyDefinitionId(String policyDefinitionId) { - if (this.innerProperties() == null) { - this.innerProperties = new PolicyAssignmentProperties(); - } - this.innerProperties().withPolicyDefinitionId(policyDefinitionId); - return this; - } - - /** - * Get the scope property: The scope for the policy assignment. - * - * @return the scope value. - */ - public String scope() { - return this.innerProperties() == null ? null : this.innerProperties().scope(); - } - - /** - * Set the scope property: The scope for the policy assignment. - * - * @param scope the scope value to set. - * @return the PolicyAssignmentInner object itself. - */ - public PolicyAssignmentInner withScope(String scope) { - if (this.innerProperties() == null) { - this.innerProperties = new PolicyAssignmentProperties(); - } - this.innerProperties().withScope(scope); - return this; - } - - /** - * Get the parameters property: Required if a parameter is used in policy rule. - * - * @return the parameters value. - */ - public Object parameters() { - return this.innerProperties() == null ? null : this.innerProperties().parameters(); - } - - /** - * Set the parameters property: Required if a parameter is used in policy rule. - * - * @param parameters the parameters value to set. - * @return the PolicyAssignmentInner object itself. - */ - public PolicyAssignmentInner withParameters(Object parameters) { - if (this.innerProperties() == null) { - this.innerProperties = new PolicyAssignmentProperties(); - } - this.innerProperties().withParameters(parameters); - return this; - } - - /** - * Get the description property: This message will be part of response in case of policy violation. - * - * @return the description value. - */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); - } - - /** - * Set the description property: This message will be part of response in case of policy violation. - * - * @param description the description value to set. - * @return the PolicyAssignmentInner object itself. - */ - public PolicyAssignmentInner withDescription(String description) { - if (this.innerProperties() == null) { - this.innerProperties = new PolicyAssignmentProperties(); - } - this.innerProperties().withDescription(description); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyAssignmentProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyAssignmentProperties.java deleted file mode 100644 index 5ae0e2ad0c81..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyAssignmentProperties.java +++ /dev/null @@ -1,154 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The policy assignment properties. */ -@Fluent -public final class PolicyAssignmentProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PolicyAssignmentProperties.class); - - /* - * The display name of the policy assignment. - */ - @JsonProperty(value = "displayName") - private String displayName; - - /* - * The ID of the policy definition. - */ - @JsonProperty(value = "policyDefinitionId") - private String policyDefinitionId; - - /* - * The scope for the policy assignment. - */ - @JsonProperty(value = "scope") - private String scope; - - /* - * Required if a parameter is used in policy rule. - */ - @JsonProperty(value = "parameters") - private Object parameters; - - /* - * This message will be part of response in case of policy violation. - */ - @JsonProperty(value = "description") - private String description; - - /** - * Get the displayName property: The display name of the policy assignment. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Set the displayName property: The display name of the policy assignment. - * - * @param displayName the displayName value to set. - * @return the PolicyAssignmentProperties object itself. - */ - public PolicyAssignmentProperties withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - - /** - * Get the policyDefinitionId property: The ID of the policy definition. - * - * @return the policyDefinitionId value. - */ - public String policyDefinitionId() { - return this.policyDefinitionId; - } - - /** - * Set the policyDefinitionId property: The ID of the policy definition. - * - * @param policyDefinitionId the policyDefinitionId value to set. - * @return the PolicyAssignmentProperties object itself. - */ - public PolicyAssignmentProperties withPolicyDefinitionId(String policyDefinitionId) { - this.policyDefinitionId = policyDefinitionId; - return this; - } - - /** - * Get the scope property: The scope for the policy assignment. - * - * @return the scope value. - */ - public String scope() { - return this.scope; - } - - /** - * Set the scope property: The scope for the policy assignment. - * - * @param scope the scope value to set. - * @return the PolicyAssignmentProperties object itself. - */ - public PolicyAssignmentProperties withScope(String scope) { - this.scope = scope; - return this; - } - - /** - * Get the parameters property: Required if a parameter is used in policy rule. - * - * @return the parameters value. - */ - public Object parameters() { - return this.parameters; - } - - /** - * Set the parameters property: Required if a parameter is used in policy rule. - * - * @param parameters the parameters value to set. - * @return the PolicyAssignmentProperties object itself. - */ - public PolicyAssignmentProperties withParameters(Object parameters) { - this.parameters = parameters; - return this; - } - - /** - * Get the description property: This message will be part of response in case of policy violation. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: This message will be part of response in case of policy violation. - * - * @param description the description value to set. - * @return the PolicyAssignmentProperties object itself. - */ - public PolicyAssignmentProperties withDescription(String description) { - this.description = description; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyDefinitionInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyDefinitionInner.java deleted file mode 100644 index cc670c2e69af..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyDefinitionInner.java +++ /dev/null @@ -1,237 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.resources.models.PolicyMode; -import com.azure.resourcemanager.resources.models.PolicyType; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The policy definition. */ -@Fluent -public final class PolicyDefinitionInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PolicyDefinitionInner.class); - - /* - * The policy definition properties. - */ - @JsonProperty(value = "properties") - private PolicyDefinitionProperties innerProperties; - - /* - * The ID of the policy definition. - */ - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) - private String id; - - /* - * The name of the policy definition. - */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) - private String name; - - /** - * Get the innerProperties property: The policy definition properties. - * - * @return the innerProperties value. - */ - private PolicyDefinitionProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the id property: The ID of the policy definition. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Get the name property: The name of the policy definition. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the policyType property: The type of policy definition. Possible values are NotSpecified, BuiltIn, and - * Custom. - * - * @return the policyType value. - */ - public PolicyType policyType() { - return this.innerProperties() == null ? null : this.innerProperties().policyType(); - } - - /** - * Set the policyType property: The type of policy definition. Possible values are NotSpecified, BuiltIn, and - * Custom. - * - * @param policyType the policyType value to set. - * @return the PolicyDefinitionInner object itself. - */ - public PolicyDefinitionInner withPolicyType(PolicyType policyType) { - if (this.innerProperties() == null) { - this.innerProperties = new PolicyDefinitionProperties(); - } - this.innerProperties().withPolicyType(policyType); - return this; - } - - /** - * Get the mode property: The policy definition mode. Possible values are NotSpecified, Indexed, and All. - * - * @return the mode value. - */ - public PolicyMode mode() { - return this.innerProperties() == null ? null : this.innerProperties().mode(); - } - - /** - * Set the mode property: The policy definition mode. Possible values are NotSpecified, Indexed, and All. - * - * @param mode the mode value to set. - * @return the PolicyDefinitionInner object itself. - */ - public PolicyDefinitionInner withMode(PolicyMode mode) { - if (this.innerProperties() == null) { - this.innerProperties = new PolicyDefinitionProperties(); - } - this.innerProperties().withMode(mode); - return this; - } - - /** - * Get the displayName property: The display name of the policy definition. - * - * @return the displayName value. - */ - public String displayName() { - return this.innerProperties() == null ? null : this.innerProperties().displayName(); - } - - /** - * Set the displayName property: The display name of the policy definition. - * - * @param displayName the displayName value to set. - * @return the PolicyDefinitionInner object itself. - */ - public PolicyDefinitionInner withDisplayName(String displayName) { - if (this.innerProperties() == null) { - this.innerProperties = new PolicyDefinitionProperties(); - } - this.innerProperties().withDisplayName(displayName); - return this; - } - - /** - * Get the description property: The policy definition description. - * - * @return the description value. - */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); - } - - /** - * Set the description property: The policy definition description. - * - * @param description the description value to set. - * @return the PolicyDefinitionInner object itself. - */ - public PolicyDefinitionInner withDescription(String description) { - if (this.innerProperties() == null) { - this.innerProperties = new PolicyDefinitionProperties(); - } - this.innerProperties().withDescription(description); - return this; - } - - /** - * Get the policyRule property: The policy rule. - * - * @return the policyRule value. - */ - public Object policyRule() { - return this.innerProperties() == null ? null : this.innerProperties().policyRule(); - } - - /** - * Set the policyRule property: The policy rule. - * - * @param policyRule the policyRule value to set. - * @return the PolicyDefinitionInner object itself. - */ - public PolicyDefinitionInner withPolicyRule(Object policyRule) { - if (this.innerProperties() == null) { - this.innerProperties = new PolicyDefinitionProperties(); - } - this.innerProperties().withPolicyRule(policyRule); - return this; - } - - /** - * Get the metadata property: The policy definition metadata. - * - * @return the metadata value. - */ - public Object metadata() { - return this.innerProperties() == null ? null : this.innerProperties().metadata(); - } - - /** - * Set the metadata property: The policy definition metadata. - * - * @param metadata the metadata value to set. - * @return the PolicyDefinitionInner object itself. - */ - public PolicyDefinitionInner withMetadata(Object metadata) { - if (this.innerProperties() == null) { - this.innerProperties = new PolicyDefinitionProperties(); - } - this.innerProperties().withMetadata(metadata); - return this; - } - - /** - * Get the parameters property: Required if a parameter is used in policy rule. - * - * @return the parameters value. - */ - public Object parameters() { - return this.innerProperties() == null ? null : this.innerProperties().parameters(); - } - - /** - * Set the parameters property: Required if a parameter is used in policy rule. - * - * @param parameters the parameters value to set. - * @return the PolicyDefinitionInner object itself. - */ - public PolicyDefinitionInner withParameters(Object parameters) { - if (this.innerProperties() == null) { - this.innerProperties = new PolicyDefinitionProperties(); - } - this.innerProperties().withParameters(parameters); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyDefinitionProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyDefinitionProperties.java deleted file mode 100644 index de5bdb5dca3b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyDefinitionProperties.java +++ /dev/null @@ -1,212 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.resources.models.PolicyMode; -import com.azure.resourcemanager.resources.models.PolicyType; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The policy definition properties. */ -@Fluent -public final class PolicyDefinitionProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PolicyDefinitionProperties.class); - - /* - * The type of policy definition. Possible values are NotSpecified, - * BuiltIn, and Custom. - */ - @JsonProperty(value = "policyType") - private PolicyType policyType; - - /* - * The policy definition mode. Possible values are NotSpecified, Indexed, - * and All. - */ - @JsonProperty(value = "mode") - private PolicyMode mode; - - /* - * The display name of the policy definition. - */ - @JsonProperty(value = "displayName") - private String displayName; - - /* - * The policy definition description. - */ - @JsonProperty(value = "description") - private String description; - - /* - * The policy rule. - */ - @JsonProperty(value = "policyRule") - private Object policyRule; - - /* - * The policy definition metadata. - */ - @JsonProperty(value = "metadata") - private Object metadata; - - /* - * Required if a parameter is used in policy rule. - */ - @JsonProperty(value = "parameters") - private Object parameters; - - /** - * Get the policyType property: The type of policy definition. Possible values are NotSpecified, BuiltIn, and - * Custom. - * - * @return the policyType value. - */ - public PolicyType policyType() { - return this.policyType; - } - - /** - * Set the policyType property: The type of policy definition. Possible values are NotSpecified, BuiltIn, and - * Custom. - * - * @param policyType the policyType value to set. - * @return the PolicyDefinitionProperties object itself. - */ - public PolicyDefinitionProperties withPolicyType(PolicyType policyType) { - this.policyType = policyType; - return this; - } - - /** - * Get the mode property: The policy definition mode. Possible values are NotSpecified, Indexed, and All. - * - * @return the mode value. - */ - public PolicyMode mode() { - return this.mode; - } - - /** - * Set the mode property: The policy definition mode. Possible values are NotSpecified, Indexed, and All. - * - * @param mode the mode value to set. - * @return the PolicyDefinitionProperties object itself. - */ - public PolicyDefinitionProperties withMode(PolicyMode mode) { - this.mode = mode; - return this; - } - - /** - * Get the displayName property: The display name of the policy definition. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Set the displayName property: The display name of the policy definition. - * - * @param displayName the displayName value to set. - * @return the PolicyDefinitionProperties object itself. - */ - public PolicyDefinitionProperties withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - - /** - * Get the description property: The policy definition description. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: The policy definition description. - * - * @param description the description value to set. - * @return the PolicyDefinitionProperties object itself. - */ - public PolicyDefinitionProperties withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the policyRule property: The policy rule. - * - * @return the policyRule value. - */ - public Object policyRule() { - return this.policyRule; - } - - /** - * Set the policyRule property: The policy rule. - * - * @param policyRule the policyRule value to set. - * @return the PolicyDefinitionProperties object itself. - */ - public PolicyDefinitionProperties withPolicyRule(Object policyRule) { - this.policyRule = policyRule; - return this; - } - - /** - * Get the metadata property: The policy definition metadata. - * - * @return the metadata value. - */ - public Object metadata() { - return this.metadata; - } - - /** - * Set the metadata property: The policy definition metadata. - * - * @param metadata the metadata value to set. - * @return the PolicyDefinitionProperties object itself. - */ - public PolicyDefinitionProperties withMetadata(Object metadata) { - this.metadata = metadata; - return this; - } - - /** - * Get the parameters property: Required if a parameter is used in policy rule. - * - * @return the parameters value. - */ - public Object parameters() { - return this.parameters; - } - - /** - * Set the parameters property: Required if a parameter is used in policy rule. - * - * @param parameters the parameters value to set. - * @return the PolicyDefinitionProperties object itself. - */ - public PolicyDefinitionProperties withParameters(Object parameters) { - this.parameters = parameters; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/ProviderInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/ProviderInner.java deleted file mode 100644 index 4924af9166cc..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/ProviderInner.java +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.resources.models.ProviderResourceType; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Resource provider information. */ -@Fluent -public final class ProviderInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ProviderInner.class); - - /* - * The provider ID. - */ - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) - private String id; - - /* - * The namespace of the resource provider. - */ - @JsonProperty(value = "namespace") - private String namespace; - - /* - * The registration state of the resource provider. - */ - @JsonProperty(value = "registrationState", access = JsonProperty.Access.WRITE_ONLY) - private String registrationState; - - /* - * The registration policy of the resource provider. - */ - @JsonProperty(value = "registrationPolicy", access = JsonProperty.Access.WRITE_ONLY) - private String registrationPolicy; - - /* - * The collection of provider resource types. - */ - @JsonProperty(value = "resourceTypes", access = JsonProperty.Access.WRITE_ONLY) - private List resourceTypes; - - /** - * Get the id property: The provider ID. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Get the namespace property: The namespace of the resource provider. - * - * @return the namespace value. - */ - public String namespace() { - return this.namespace; - } - - /** - * Set the namespace property: The namespace of the resource provider. - * - * @param namespace the namespace value to set. - * @return the ProviderInner object itself. - */ - public ProviderInner withNamespace(String namespace) { - this.namespace = namespace; - return this; - } - - /** - * Get the registrationState property: The registration state of the resource provider. - * - * @return the registrationState value. - */ - public String registrationState() { - return this.registrationState; - } - - /** - * Get the registrationPolicy property: The registration policy of the resource provider. - * - * @return the registrationPolicy value. - */ - public String registrationPolicy() { - return this.registrationPolicy; - } - - /** - * Get the resourceTypes property: The collection of provider resource types. - * - * @return the resourceTypes value. - */ - public List resourceTypes() { - return this.resourceTypes; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (resourceTypes() != null) { - resourceTypes().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/ResourceGroupExportResultInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/ResourceGroupExportResultInner.java deleted file mode 100644 index 72b0eaab7ef2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/ResourceGroupExportResultInner.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.exception.ManagementError; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Resource group export result. */ -@Fluent -public final class ResourceGroupExportResultInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceGroupExportResultInner.class); - - /* - * The template content. - */ - @JsonProperty(value = "template") - private Object template; - - /* - * Error Response The template export error. - */ - @JsonProperty(value = "error") - private ManagementError error; - - /** - * Get the template property: The template content. - * - * @return the template value. - */ - public Object template() { - return this.template; - } - - /** - * Set the template property: The template content. - * - * @param template the template value to set. - * @return the ResourceGroupExportResultInner object itself. - */ - public ResourceGroupExportResultInner withTemplate(Object template) { - this.template = template; - return this; - } - - /** - * Get the error property: Error Response The template export error. - * - * @return the error value. - */ - public ManagementError error() { - return this.error; - } - - /** - * Set the error property: Error Response The template export error. - * - * @param error the error value to set. - * @return the ResourceGroupExportResultInner object itself. - */ - public ResourceGroupExportResultInner withError(ManagementError error) { - this.error = error; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/ResourceGroupInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/ResourceGroupInner.java deleted file mode 100644 index e68495656519..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/ResourceGroupInner.java +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.resources.models.ResourceGroupProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** Resource group information. */ -@Fluent -public final class ResourceGroupInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceGroupInner.class); - - /* - * The resource group properties. - */ - @JsonProperty(value = "properties") - private ResourceGroupProperties properties; - - /* - * The ID of the resource that manages this resource group. - */ - @JsonProperty(value = "managedBy") - private String managedBy; - - /** - * Get the properties property: The resource group properties. - * - * @return the properties value. - */ - public ResourceGroupProperties properties() { - return this.properties; - } - - /** - * Set the properties property: The resource group properties. - * - * @param properties the properties value to set. - * @return the ResourceGroupInner object itself. - */ - public ResourceGroupInner withProperties(ResourceGroupProperties properties) { - this.properties = properties; - return this; - } - - /** - * Get the managedBy property: The ID of the resource that manages this resource group. - * - * @return the managedBy value. - */ - public String managedBy() { - return this.managedBy; - } - - /** - * Set the managedBy property: The ID of the resource that manages this resource group. - * - * @param managedBy the managedBy value to set. - * @return the ResourceGroupInner object itself. - */ - public ResourceGroupInner withManagedBy(String managedBy) { - this.managedBy = managedBy; - return this; - } - - /** {@inheritDoc} */ - @Override - public ResourceGroupInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public ResourceGroupInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/SubscriptionInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/SubscriptionInner.java deleted file mode 100644 index 0f8c8c8588d8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/SubscriptionInner.java +++ /dev/null @@ -1,149 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.resources.models.SubscriptionPolicies; -import com.azure.resourcemanager.resources.models.SubscriptionState; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Subscription information. */ -@Fluent -public final class SubscriptionInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SubscriptionInner.class); - - /* - * The fully qualified ID for the subscription. For example, - * /subscriptions/00000000-0000-0000-0000-000000000000. - */ - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) - private String id; - - /* - * The subscription ID. - */ - @JsonProperty(value = "subscriptionId", access = JsonProperty.Access.WRITE_ONLY) - private String subscriptionId; - - /* - * The subscription display name. - */ - @JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY) - private String displayName; - - /* - * The subscription state. Possible values are Enabled, Warned, PastDue, - * Disabled, and Deleted. - */ - @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) - private SubscriptionState state; - - /* - * The subscription policies. - */ - @JsonProperty(value = "subscriptionPolicies") - private SubscriptionPolicies subscriptionPolicies; - - /* - * The authorization source of the request. Valid values are one or more - * combinations of Legacy, RoleBased, Bypassed, Direct and Management. For - * example, 'Legacy, RoleBased'. - */ - @JsonProperty(value = "authorizationSource") - private String authorizationSource; - - /** - * Get the id property: The fully qualified ID for the subscription. For example, - * /subscriptions/00000000-0000-0000-0000-000000000000. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Get the subscriptionId property: The subscription ID. - * - * @return the subscriptionId value. - */ - public String subscriptionId() { - return this.subscriptionId; - } - - /** - * Get the displayName property: The subscription display name. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Get the state property: The subscription state. Possible values are Enabled, Warned, PastDue, Disabled, and - * Deleted. - * - * @return the state value. - */ - public SubscriptionState state() { - return this.state; - } - - /** - * Get the subscriptionPolicies property: The subscription policies. - * - * @return the subscriptionPolicies value. - */ - public SubscriptionPolicies subscriptionPolicies() { - return this.subscriptionPolicies; - } - - /** - * Set the subscriptionPolicies property: The subscription policies. - * - * @param subscriptionPolicies the subscriptionPolicies value to set. - * @return the SubscriptionInner object itself. - */ - public SubscriptionInner withSubscriptionPolicies(SubscriptionPolicies subscriptionPolicies) { - this.subscriptionPolicies = subscriptionPolicies; - return this; - } - - /** - * Get the authorizationSource property: The authorization source of the request. Valid values are one or more - * combinations of Legacy, RoleBased, Bypassed, Direct and Management. For example, 'Legacy, RoleBased'. - * - * @return the authorizationSource value. - */ - public String authorizationSource() { - return this.authorizationSource; - } - - /** - * Set the authorizationSource property: The authorization source of the request. Valid values are one or more - * combinations of Legacy, RoleBased, Bypassed, Direct and Management. For example, 'Legacy, RoleBased'. - * - * @param authorizationSource the authorizationSource value to set. - * @return the SubscriptionInner object itself. - */ - public SubscriptionInner withAuthorizationSource(String authorizationSource) { - this.authorizationSource = authorizationSource; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (subscriptionPolicies() != null) { - subscriptionPolicies().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/TagDetailsInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/TagDetailsInner.java deleted file mode 100644 index ee82cb381ce5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/TagDetailsInner.java +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.resources.models.TagCount; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Tag details. */ -@Fluent -public final class TagDetailsInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TagDetailsInner.class); - - /* - * The tag name ID. - */ - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) - private String id; - - /* - * The tag name. - */ - @JsonProperty(value = "tagName") - private String tagName; - - /* - * The total number of resources that use the resource tag. When a tag is - * initially created and has no associated resources, the value is 0. - */ - @JsonProperty(value = "count") - private TagCount count; - - /* - * The list of tag values. - */ - @JsonProperty(value = "values") - private List values; - - /** - * Get the id property: The tag name ID. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Get the tagName property: The tag name. - * - * @return the tagName value. - */ - public String tagName() { - return this.tagName; - } - - /** - * Set the tagName property: The tag name. - * - * @param tagName the tagName value to set. - * @return the TagDetailsInner object itself. - */ - public TagDetailsInner withTagName(String tagName) { - this.tagName = tagName; - return this; - } - - /** - * Get the count property: The total number of resources that use the resource tag. When a tag is initially created - * and has no associated resources, the value is 0. - * - * @return the count value. - */ - public TagCount count() { - return this.count; - } - - /** - * Set the count property: The total number of resources that use the resource tag. When a tag is initially created - * and has no associated resources, the value is 0. - * - * @param count the count value to set. - * @return the TagDetailsInner object itself. - */ - public TagDetailsInner withCount(TagCount count) { - this.count = count; - return this; - } - - /** - * Get the values property: The list of tag values. - * - * @return the values value. - */ - public List values() { - return this.values; - } - - /** - * Set the values property: The list of tag values. - * - * @param values the values value to set. - * @return the TagDetailsInner object itself. - */ - public TagDetailsInner withValues(List values) { - this.values = values; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (count() != null) { - count().validate(); - } - if (values() != null) { - values().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/TagValueInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/TagValueInner.java deleted file mode 100644 index ce5c074cb72f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/TagValueInner.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.resources.models.TagCount; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Tag information. */ -@Fluent -public final class TagValueInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TagValueInner.class); - - /* - * The tag value ID. - */ - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) - private String id; - - /* - * The tag value. - */ - @JsonProperty(value = "tagValue") - private String tagValue; - - /* - * The tag value count. - */ - @JsonProperty(value = "count") - private TagCount count; - - /** - * Get the id property: The tag value ID. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Get the tagValue property: The tag value. - * - * @return the tagValue value. - */ - public String tagValue() { - return this.tagValue; - } - - /** - * Set the tagValue property: The tag value. - * - * @param tagValue the tagValue value to set. - * @return the TagValueInner object itself. - */ - public TagValueInner withTagValue(String tagValue) { - this.tagValue = tagValue; - return this; - } - - /** - * Get the count property: The tag value count. - * - * @return the count value. - */ - public TagCount count() { - return this.count; - } - - /** - * Set the count property: The tag value count. - * - * @param count the count value to set. - * @return the TagValueInner object itself. - */ - public TagValueInner withCount(TagCount count) { - this.count = count; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (count() != null) { - count().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/TagsResourceInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/TagsResourceInner.java deleted file mode 100644 index 2bbfde355b0a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/TagsResourceInner.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.resources.models.Tags; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Wrapper resource for tags API requests and responses. */ -@Fluent -public final class TagsResourceInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TagsResourceInner.class); - - /* - * The set of tags. - */ - @JsonProperty(value = "properties", required = true) - private Tags properties; - - /** - * Get the properties property: The set of tags. - * - * @return the properties value. - */ - public Tags properties() { - return this.properties; - } - - /** - * Set the properties property: The set of tags. - * - * @param properties the properties value to set. - * @return the TagsResourceInner object itself. - */ - public TagsResourceInner withProperties(Tags properties) { - this.properties = properties; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property properties in model TagsResourceInner")); - } else { - properties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/TemplateHashResultInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/TemplateHashResultInner.java deleted file mode 100644 index cf092afa3798..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/TemplateHashResultInner.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Result of the request to calculate template hash. It contains a string of minified template and its hash. */ -@Fluent -public final class TemplateHashResultInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TemplateHashResultInner.class); - - /* - * The minified template string. - */ - @JsonProperty(value = "minifiedTemplate") - private String minifiedTemplate; - - /* - * The template hash. - */ - @JsonProperty(value = "templateHash") - private String templateHash; - - /** - * Get the minifiedTemplate property: The minified template string. - * - * @return the minifiedTemplate value. - */ - public String minifiedTemplate() { - return this.minifiedTemplate; - } - - /** - * Set the minifiedTemplate property: The minified template string. - * - * @param minifiedTemplate the minifiedTemplate value to set. - * @return the TemplateHashResultInner object itself. - */ - public TemplateHashResultInner withMinifiedTemplate(String minifiedTemplate) { - this.minifiedTemplate = minifiedTemplate; - return this; - } - - /** - * Get the templateHash property: The template hash. - * - * @return the templateHash value. - */ - public String templateHash() { - return this.templateHash; - } - - /** - * Set the templateHash property: The template hash. - * - * @param templateHash the templateHash value to set. - * @return the TemplateHashResultInner object itself. - */ - public TemplateHashResultInner withTemplateHash(String templateHash) { - this.templateHash = templateHash; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/TenantIdDescriptionInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/TenantIdDescriptionInner.java deleted file mode 100644 index 56ab5f846e5e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/TenantIdDescriptionInner.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Tenant Id information. */ -@Immutable -public final class TenantIdDescriptionInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TenantIdDescriptionInner.class); - - /* - * The fully qualified ID of the tenant. For example, - * /tenants/00000000-0000-0000-0000-000000000000. - */ - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) - private String id; - - /* - * The tenant ID. For example, 00000000-0000-0000-0000-000000000000. - */ - @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) - private String tenantId; - - /** - * Get the id property: The fully qualified ID of the tenant. For example, - * /tenants/00000000-0000-0000-0000-000000000000. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Get the tenantId property: The tenant ID. For example, 00000000-0000-0000-0000-000000000000. - * - * @return the tenantId value. - */ - public String tenantId() { - return this.tenantId; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/WhatIfOperationProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/WhatIfOperationProperties.java deleted file mode 100644 index 678468b3c053..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/WhatIfOperationProperties.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.resources.models.WhatIfChange; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Deployment operation properties. */ -@Fluent -public final class WhatIfOperationProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(WhatIfOperationProperties.class); - - /* - * List of resource changes predicted by What-If operation. - */ - @JsonProperty(value = "changes") - private List changes; - - /** - * Get the changes property: List of resource changes predicted by What-If operation. - * - * @return the changes value. - */ - public List changes() { - return this.changes; - } - - /** - * Set the changes property: List of resource changes predicted by What-If operation. - * - * @param changes the changes value to set. - * @return the WhatIfOperationProperties object itself. - */ - public WhatIfOperationProperties withChanges(List changes) { - this.changes = changes; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (changes() != null) { - changes().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/WhatIfOperationResultInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/WhatIfOperationResultInner.java deleted file mode 100644 index 3d0dea32e545..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/WhatIfOperationResultInner.java +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.exception.ManagementError; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.resources.models.WhatIfChange; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** - * Result of the What-If operation. Contains a list of predicted changes and a URL link to get to the next set of - * results. - */ -@Fluent -public final class WhatIfOperationResultInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(WhatIfOperationResultInner.class); - - /* - * Status of the What-If operation. - */ - @JsonProperty(value = "status") - private String status; - - /* - * What-If operation properties. - */ - @JsonProperty(value = "properties") - private WhatIfOperationProperties innerProperties; - - /* - * Error Response Error when What-If operation fails. - */ - @JsonProperty(value = "error") - private ManagementError error; - - /** - * Get the status property: Status of the What-If operation. - * - * @return the status value. - */ - public String status() { - return this.status; - } - - /** - * Set the status property: Status of the What-If operation. - * - * @param status the status value to set. - * @return the WhatIfOperationResultInner object itself. - */ - public WhatIfOperationResultInner withStatus(String status) { - this.status = status; - return this; - } - - /** - * Get the innerProperties property: What-If operation properties. - * - * @return the innerProperties value. - */ - private WhatIfOperationProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the error property: Error Response Error when What-If operation fails. - * - * @return the error value. - */ - public ManagementError error() { - return this.error; - } - - /** - * Set the error property: Error Response Error when What-If operation fails. - * - * @param error the error value to set. - * @return the WhatIfOperationResultInner object itself. - */ - public WhatIfOperationResultInner withError(ManagementError error) { - this.error = error; - return this; - } - - /** - * Get the changes property: List of resource changes predicted by What-If operation. - * - * @return the changes value. - */ - public List changes() { - return this.innerProperties() == null ? null : this.innerProperties().changes(); - } - - /** - * Set the changes property: List of resource changes predicted by What-If operation. - * - * @param changes the changes value to set. - * @return the WhatIfOperationResultInner object itself. - */ - public WhatIfOperationResultInner withChanges(List changes) { - if (this.innerProperties() == null) { - this.innerProperties = new WhatIfOperationProperties(); - } - this.innerProperties().withChanges(changes); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/package-info.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/package-info.java deleted file mode 100644 index 368133e2f172..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** - * Package containing the inner data models for ResourceManagementClient. Provides operations for working with resources - * and resource groups. - */ -package com.azure.resourcemanager.resources.fluent.models; diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/package-info.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/package-info.java deleted file mode 100644 index 72001bcfaed4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** - * Package containing the service clients for ResourceManagementClient. Provides operations for working with resources - * and resource groups. - */ -package com.azure.resourcemanager.resources.fluent; diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/AzureServiceClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/AzureServiceClient.java deleted file mode 100644 index 1ca0b9e5dbad..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/AzureServiceClient.java +++ /dev/null @@ -1,245 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore; - -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.Response; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.exception.ManagementError; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollerFactory; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.CoreUtils; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.AsyncPollResponse; -import com.azure.core.util.polling.LongRunningOperationStatus; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.serializer.SerializerAdapter; -import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -import java.io.IOException; -import java.lang.reflect.Type; -import java.nio.ByteBuffer; -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; -import java.time.Duration; -import java.util.Map; - -/** - * ServiceClient is the abstraction for accessing REST operations and their payload data types. - */ -public abstract class AzureServiceClient { - - private final ClientLogger logger = new ClientLogger(getClass()); - - private static final Map PROPERTIES = - CoreUtils.getProperties("azure.properties"); - - private static final String SDK_VERSION; - static { - SDK_VERSION = PROPERTIES.getOrDefault("version", "UnknownVersion"); - } - - private final SerializerAdapter serializerAdapter; - private final HttpPipeline httpPipeline; - - private final String sdkName; - - /** - * Creates a new instance of {@link AzureServiceClient}. - * - * @param httpPipeline The HttpPipline used by the client. - * @param serializerAdapter The SerializerAdapter used by the client. - * @param environment The AzureEnvironment used by the client. - */ - protected AzureServiceClient(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, - AzureEnvironment environment) { - this.httpPipeline = httpPipeline; - this.serializerAdapter = serializerAdapter; - - String packageName = this.getClass().getPackage().getName(); - String implementationSegment = ".implementation"; - if (packageName.endsWith(implementationSegment)) { - packageName = packageName.substring(0, packageName.length() - implementationSegment.length()); - } - this.sdkName = packageName; - } - - /** - * Gets serializer adapter for JSON serialization/de-serialization. - * - * @return the serializer adapter. - */ - private SerializerAdapter getSerializerAdapter() { - return this.serializerAdapter; - } - - /** - * Gets The HTTP pipeline to send requests through. - * - * @return the httpPipeline value. - */ - public HttpPipeline getHttpPipeline() { - return this.httpPipeline; - } - - /** - * Gets The default poll interval for long-running operation. - * - * @return the defaultPollInterval value. - */ - public abstract Duration getDefaultPollInterval(); - - /** - * Gets default client context. - * - * @return the default client context. - */ - public Context getContext() { - return new Context("Sdk-Name", sdkName) - .addData("Sdk-Version", SDK_VERSION); - } - - /** - * Merges default client context with provided context. - * - * @param context the context to be merged with default client context. - * @return the merged context. - */ - public Context mergeContext(Context context) { - for (Map.Entry entry : this.getContext().getValues().entrySet()) { - context = context.addData(entry.getKey(), entry.getValue()); - } - return context; - } - - /** - * Gets long running operation result. - * - * @param lroInit the raw response of init operation. - * @param httpPipeline the http pipeline. - * @param pollResultType type of poll result. - * @param finalResultType type of final result. - * @param context the context shared by all requests. - * @param type of poll result. - * @param type of final result. - * @return poller flux for poll result and final result. - */ - public PollerFlux, U> getLroResult(Mono>> lroInit, - HttpPipeline httpPipeline, - Type pollResultType, Type finalResultType, - Context context) { - return PollerFactory.create( - getSerializerAdapter(), - httpPipeline, - pollResultType, - finalResultType, - ResourceManagerUtils.InternalRuntimeContext.getDelayDuration(this.getDefaultPollInterval()), - lroInit, - context - ); - } - - /** - * Gets the final result, or an error, based on last async poll response. - * - * @param response the last async poll response. - * @param type of poll result. - * @param type of final result. - * @return the final result, or an error. - */ - public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { - if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { - String errorMessage; - ManagementError managementError = null; - HttpResponse errorResponse = null; - PollResult.Error lroError = response.getValue().getError(); - if (lroError != null) { - errorResponse = new HttpResponseImpl(lroError.getResponseStatusCode(), - lroError.getResponseHeaders(), lroError.getResponseBody()); - - errorMessage = response.getValue().getError().getMessage(); - String errorBody = response.getValue().getError().getResponseBody(); - if (errorBody != null) { - // try to deserialize error body to ManagementError - try { - managementError = this.getSerializerAdapter().deserialize( - errorBody, - ManagementError.class, - SerializerEncoding.JSON); - if (managementError.getCode() == null || managementError.getMessage() == null) { - managementError = null; - } - } catch (IOException | RuntimeException ioe) { - logger.logThrowableAsWarning(ioe); - } - } - } else { - // fallback to default error message - errorMessage = "Long running operation failed."; - } - if (managementError == null) { - // fallback to default ManagementError - managementError = new ManagementError(response.getStatus().toString(), errorMessage); - } - return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); - } else { - return response.getFinalResult(); - } - } - - private static class HttpResponseImpl extends HttpResponse { - private final int statusCode; - private final byte[] responseBody; - private final HttpHeaders httpHeaders; - - HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { - super(null); - this.statusCode = statusCode; - this.httpHeaders = httpHeaders; - this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); - } - - @Override - public int getStatusCode() { - return statusCode; - } - - @Override - public String getHeaderValue(String s) { - return httpHeaders.getValue(s); - } - - @Override - public HttpHeaders getHeaders() { - return httpHeaders; - } - - @Override - public Flux getBody() { - return Flux.just(ByteBuffer.wrap(responseBody)); - } - - @Override - public Mono getBodyAsByteArray() { - return Mono.just(responseBody); - } - - @Override - public Mono getBodyAsString() { - return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); - } - - @Override - public Mono getBodyAsString(Charset charset) { - return Mono.just(new String(responseBody, charset)); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/AvailabilityZoneId.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/AvailabilityZoneId.java deleted file mode 100644 index 6edcbe3408db..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/AvailabilityZoneId.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.arm; - -import com.azure.core.util.ExpandableStringEnum; - -import java.util.Collection; - -/** - * Availability zone identifiers. - */ -public class AvailabilityZoneId extends ExpandableStringEnum { - /** - * Static value 1 for AvailabilityZoneId. - */ - public static final AvailabilityZoneId ZONE_1 = fromString("1"); - - /** - * Static value 2 for AvailabilityZoneId. - */ - public static final AvailabilityZoneId ZONE_2 = fromString("2"); - - /** - * Static value 3 for AvailabilityZoneId. - */ - public static final AvailabilityZoneId ZONE_3 = fromString("3"); - - /** - * Finds or creates an availability zone identifier based on the specified identifier in string format. - * - * @param id the zone identifier in string format - * @return an instance of AvailabilityZone - */ - public static AvailabilityZoneId fromString(String id) { - return fromString(id, AvailabilityZoneId.class); - } - - /** - * @return known availability zone identifiers - */ - public static Collection values() { - return values(AvailabilityZoneId.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/AzureConfigurable.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/AzureConfigurable.java deleted file mode 100644 index e061f497bb4b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/AzureConfigurable.java +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.arm; - -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.policy.HttpLogDetailLevel; -import com.azure.core.http.policy.HttpLogOptions; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.http.policy.RetryOptions; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.util.Configuration; - -import java.util.List; - -/** - * The base interface for allowing configurations to be made on the HTTP client. - * - * @param the actual type of the interface extending this interface - */ -public interface AzureConfigurable> { - - /** - * Set the logging options on the HTTP client. - * - * @param logOptions the HttpLogDetailLevel logging options - * @return the configurable object itself - */ - T withLogOptions(HttpLogOptions logOptions); - - /** - * Sets the logging detail level on the HTTP client. - * - * If set, this configure will override {@link HttpLogOptions#setLogLevel(HttpLogDetailLevel)} configure of - * {@link AzureConfigurable#withLogOptions(HttpLogOptions)}. - - * @param logLevel the logging level - * @return the configurable object itself - */ - T withLogLevel(HttpLogDetailLevel logLevel); - - /** - * Plug in a policy into the HTTP pipeline. - * - * @param policy the policy to plug in - * @return the configurable object itself - */ - T withPolicy(HttpPipelinePolicy policy); - - /** - * Set the cross-tenant auxiliary credentials for Azure which can hold up to three. - * - * @param token the auxiliary credential - * @return the configurable object itself - */ - T withAuxiliaryCredential(TokenCredential token); - - /** - * Set the cross-tenant auxiliary credentials for Azure which can hold up to three. - * - * @param tokens the auxiliary credentials - * @return the configurable object itself - */ - T withAuxiliaryCredentials(List tokens); - - /** - * Sets the retry policy used in HTTP pipeline. - * - * @param retryPolicy the retry policy - * @return the configurable object itself for chaining - */ - T withRetryPolicy(RetryPolicy retryPolicy); - - /** - * Sets the credential scope. - * - * @param scope the credential scope - * @return the configurable object itself for chaining - */ - T withScope(String scope); - - /** - * Sets the credential scopes. - * - * @param scopes the credential scope - * @return the configurable object itself for chaining - */ - T withScopes(List scopes); - - /** - * Sets the HTTP client. - * - * @param httpClient the HTTP client - * @return the configurable object itself for chaining - */ - T withHttpClient(HttpClient httpClient); - - /** - * Sets the configuration. - * - * @param configuration the proxy to use - * @return the configurable object itself for chaining - */ - T withConfiguration(Configuration configuration); - - /** - * Sets the retry options for the HTTP pipeline retry policy. - *

    - * This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. - * - * @param retryOptions the retry options for the HTTP pipeline retry policy. - * @return the configurable object itself. - */ - T withRetryOptions(RetryOptions retryOptions); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/CountryIsoCode.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/CountryIsoCode.java deleted file mode 100644 index ad7c841408b6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/CountryIsoCode.java +++ /dev/null @@ -1,981 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.arm; - -import com.azure.core.util.ExpandableStringEnum; - -import java.util.Collection; - -/** - * Defines values for country codes in ISO standard. - * E.g. the country code for United Kingdom is 'GB'. - */ -public final class CountryIsoCode extends ExpandableStringEnum { - // CHECKSTYLE IGNORE Javadoc FOR NEXT 237 LINES - /** - * Country ISO code {@code AF}. - */ - public static final CountryIsoCode AFGHANISTAN = fromString("AF"); - /** - * Country ISO code {@code AL}. - */ - public static final CountryIsoCode ALBANIA = fromString("AL"); - /** - * Country ISO code {@code DZ}. - */ - public static final CountryIsoCode ALGERIA = fromString("DZ"); - /** - * Country ISO code {@code AS}. - */ - public static final CountryIsoCode AMERICAN_SAMOA = fromString("AS"); - /** - * Country ISO code {@code AD}. - */ - public static final CountryIsoCode ANDORRA = fromString("AD"); - /** - * Country ISO code {@code AO}. - */ - public static final CountryIsoCode ANGOLA = fromString("AO"); - /** - * Country ISO code {@code AI}. - */ - public static final CountryIsoCode ANGUILLA = fromString("AI"); - /** - * Country ISO code {@code AQ}. - */ - public static final CountryIsoCode ANTARCTICA = fromString("AQ"); - /** - * Country ISO code {@code AG}. - */ - public static final CountryIsoCode ANTIGUA_AND_BARBUDA = fromString("AG"); - /** - * Country ISO code {@code AR}. - */ - public static final CountryIsoCode ARGENTINA = fromString("AR"); - /** - * Country ISO code {@code AM}. - */ - public static final CountryIsoCode ARMENIA = fromString("AM"); - /** - * Country ISO code {@code AW}. - */ - public static final CountryIsoCode ARUBA = fromString("AW"); - /** - * Country ISO code {@code AU}. - */ - public static final CountryIsoCode AUSTRALIA = fromString("AU"); - /** - * Country ISO code {@code AT}. - */ - public static final CountryIsoCode AUSTRIA = fromString("AT"); - /** - * Country ISO code {@code AZ}. - */ - public static final CountryIsoCode AZERBAIJAN = fromString("AZ"); - /** - * Country ISO code {@code BS}. - */ - public static final CountryIsoCode BAHAMAS = fromString("BS"); - /** - * Country ISO code {@code BH}. - */ - public static final CountryIsoCode BAHRAIN = fromString("BH"); - /** - * Country ISO code {@code BD}. - */ - public static final CountryIsoCode BANGLADESH = fromString("BD"); - /** - * Country ISO code {@code BB}. - */ - public static final CountryIsoCode BARBADOS = fromString("BB"); - /** - * Country ISO code {@code BY}. - */ - public static final CountryIsoCode BELARUS = fromString("BY"); - /** - * Country ISO code {@code BE}. - */ - public static final CountryIsoCode BELGIUM = fromString("BE"); - /** - * Country ISO code {@code BZ}. - */ - public static final CountryIsoCode BELIZE = fromString("BZ"); - /** - * Country ISO code {@code BJ}. - */ - public static final CountryIsoCode BENIN = fromString("BJ"); - /** - * Country ISO code {@code BM}. - */ - public static final CountryIsoCode BERMUDA = fromString("BM"); - /** - * Country ISO code {@code BT}. - */ - public static final CountryIsoCode BHUTAN = fromString("BT"); - /** - * Country ISO code {@code BO}. - */ - public static final CountryIsoCode BOLIVIA = fromString("BO"); - /** - * Country ISO code {@code BA}. - */ - public static final CountryIsoCode BOSNIA_AND_HERZEGOVINA = fromString("BA"); - /** - * Country ISO code {@code BW}. - */ - public static final CountryIsoCode BOTSWANA = fromString("BW"); - /** - * Country ISO code {@code BV}. - */ - public static final CountryIsoCode BOUVET_ISLAND = fromString("BV"); - /** - * Country ISO code {@code BR}. - */ - public static final CountryIsoCode BRAZIL = fromString("BR"); - /** - * Country ISO code {@code IO}. - */ - public static final CountryIsoCode BRITISH_INDIAN_OCEAN_TERRITORY = fromString("IO"); - /** - * Country ISO code {@code BN}. - */ - public static final CountryIsoCode BRUNEI_DARUSSALAM = fromString("BN"); - /** - * Country ISO code {@code BG}. - */ - public static final CountryIsoCode BULGARIA = fromString("BG"); - /** - * Country ISO code {@code BF}. - */ - public static final CountryIsoCode BURKINA_FASO = fromString("BF"); - /** - * Country ISO code {@code BI}. - */ - public static final CountryIsoCode BURUNDI = fromString("BI"); - /** - * Country ISO code {@code KH}. - */ - public static final CountryIsoCode CAMBODIA = fromString("KH"); - /** - * Country ISO code {@code CM}. - */ - public static final CountryIsoCode CAMEROON = fromString("CM"); - /** - * Country ISO code {@code CA}. - */ - public static final CountryIsoCode CANADA = fromString("CA"); - /** - * Country ISO code {@code CV}. - */ - public static final CountryIsoCode CAPE_VERDE = fromString("CV"); - /** - * Country ISO code {@code KY}. - */ - public static final CountryIsoCode CAYMAN_ISLANDS = fromString("KY"); - /** - * Country ISO code {@code CF}. - */ - public static final CountryIsoCode CENTRAL_AFRICAN_REPUBLIC = fromString("CF"); - /** - * Country ISO code {@code TD}. - */ - public static final CountryIsoCode CHAD = fromString("TD"); - /** - * Country ISO code {@code CL}. - */ - public static final CountryIsoCode CHILE = fromString("CL"); - /** - * Country ISO code {@code CN}. - */ - public static final CountryIsoCode CHINA = fromString("CN"); - /** - * Country ISO code {@code CX}. - */ - public static final CountryIsoCode CHRISTMAS_ISLAND = fromString("CX"); - /** - * Country ISO code {@code CC}. - */ - public static final CountryIsoCode COCOS_KEELING_ISLANDS = fromString("CC"); - /** - * Country ISO code {@code CO}. - */ - public static final CountryIsoCode COLOMBIA = fromString("CO"); - /** - * Country ISO code {@code KM}. - */ - public static final CountryIsoCode COMOROS = fromString("KM"); - /** - * Country ISO code {@code CG}. - */ - public static final CountryIsoCode CONGO = fromString("CG"); - /** - * Country ISO code {@code CD}. - */ - public static final CountryIsoCode CONGO_DEMOCRATIC_REPUBLIC = fromString("CD"); - /** - * Country ISO code {@code CK}. - */ - public static final CountryIsoCode COOK_ISLANDS = fromString("CK"); - /** - * Country ISO code {@code CR}. - */ - public static final CountryIsoCode COSTA_RICA = fromString("CR"); - /** - * Country ISO code {@code CI}. - */ - public static final CountryIsoCode IVORY_COAST = fromString("CI"); - /** - * Country ISO code {@code HR}. - */ - public static final CountryIsoCode CROATIA = fromString("HR"); - /** - * Country ISO code {@code CY}. - */ - public static final CountryIsoCode CYPRUS = fromString("CY"); - /** - * Country ISO code {@code CZ}. - */ - public static final CountryIsoCode CZECH_REPUBLIC = fromString("CZ"); - /** - * Country ISO code {@code DK}. - */ - public static final CountryIsoCode DENMARK = fromString("DK"); - /** - * Country ISO code {@code DJ}. - */ - public static final CountryIsoCode DJIBOUTI = fromString("DJ"); - /** - * Country ISO code {@code DM}. - */ - public static final CountryIsoCode DOMINICA = fromString("DM"); - /** - * Country ISO code {@code DO}. - */ - public static final CountryIsoCode DOMINICAN_REPUBLIC = fromString("DO"); - /** - * Country ISO code {@code EC}. - */ - public static final CountryIsoCode ECUADOR = fromString("EC"); - /** - * Country ISO code {@code EG}. - */ - public static final CountryIsoCode EGYPT = fromString("EG"); - /** - * Country ISO code {@code SV}. - */ - public static final CountryIsoCode EL_SALVADOR = fromString("SV"); - /** - * Country ISO code {@code GQ}. - */ - public static final CountryIsoCode EQUATORIAL_GUINEA = fromString("GQ"); - /** - * Country ISO code {@code ER}. - */ - public static final CountryIsoCode ERITREA = fromString("ER"); - /** - * Country ISO code {@code EE}. - */ - public static final CountryIsoCode ESTONIA = fromString("EE"); - /** - * Country ISO code {@code ET}. - */ - public static final CountryIsoCode ETHIOPIA = fromString("ET"); - /** - * Country ISO code {@code FK}. - */ - public static final CountryIsoCode FALKLAND_ISLANDS_MALVINAS = fromString("FK"); - /** - * Country ISO code {@code FO}. - */ - public static final CountryIsoCode FAROE_ISLANDS = fromString("FO"); - /** - * Country ISO code {@code FJ}. - */ - public static final CountryIsoCode FIJI = fromString("FJ"); - /** - * Country ISO code {@code FI}. - */ - public static final CountryIsoCode FINLAND = fromString("FI"); - /** - * Country ISO code {@code FR}. - */ - public static final CountryIsoCode FRANCE = fromString("FR"); - /** - * Country ISO code {@code GF}. - */ - public static final CountryIsoCode FRENCH_GUIANA = fromString("GF"); - /** - * Country ISO code {@code PF}. - */ - public static final CountryIsoCode FRENCH_POLYNESIA = fromString("PF"); - /** - * Country ISO code {@code TF}. - */ - public static final CountryIsoCode FRENCH_SOUTHERN_TERRITORIES = fromString("TF"); - /** - * Country ISO code {@code GA}. - */ - public static final CountryIsoCode GABON = fromString("GA"); - /** - * Country ISO code {@code GM}. - */ - public static final CountryIsoCode GAMBIA = fromString("GM"); - /** - * Country ISO code {@code GE}. - */ - public static final CountryIsoCode GEORGIA = fromString("GE"); - /** - * Country ISO code {@code DE}. - */ - public static final CountryIsoCode GERMANY = fromString("DE"); - /** - * Country ISO code {@code GH}. - */ - public static final CountryIsoCode GHANA = fromString("GH"); - /** - * Country ISO code {@code GI}. - */ - public static final CountryIsoCode GIBRALTAR = fromString("GI"); - /** - * Country ISO code {@code GR}. - */ - public static final CountryIsoCode GREECE = fromString("GR"); - /** - * Country ISO code {@code GL}. - */ - public static final CountryIsoCode GREENLAND = fromString("GL"); - /** - * Country ISO code {@code GD}. - */ - public static final CountryIsoCode GRENADA = fromString("GD"); - /** - * Country ISO code {@code GP}. - */ - public static final CountryIsoCode GUADELOUPE = fromString("GP"); - /** - * Country ISO code {@code GU}. - */ - public static final CountryIsoCode GUAM = fromString("GU"); - /** - * Country ISO code {@code GT}. - */ - public static final CountryIsoCode GUATEMALA = fromString("GT"); - /** - * Country ISO code {@code GG}. - */ - public static final CountryIsoCode GUERNSEY = fromString("GG"); - /** - * Country ISO code {@code GN}. - */ - public static final CountryIsoCode GUINEA = fromString("GN"); - /** - * Country ISO code {@code GW}. - */ - public static final CountryIsoCode GUINEA_BISSAU = fromString("GW"); - /** - * Country ISO code {@code GY}. - */ - public static final CountryIsoCode GUYANA = fromString("GY"); - /** - * Country ISO code {@code HT}. - */ - public static final CountryIsoCode HAITI = fromString("HT"); - /** - * Country ISO code {@code HM}. - */ - public static final CountryIsoCode HEARD_ISLAND_MCDONALD_ISLANDS = fromString("HM"); - /** - * Country ISO code {@code VA}. - */ - public static final CountryIsoCode HOLY_SEE_VATICAN_CITY_STATE = fromString("VA"); - /** - * Country ISO code {@code HN}. - */ - public static final CountryIsoCode HONDURAS = fromString("HN"); - /** - * Country ISO code {@code HK}. - */ - public static final CountryIsoCode HONG_KONG = fromString("HK"); - /** - * Country ISO code {@code HU}. - */ - public static final CountryIsoCode HUNGARY = fromString("HU"); - /** - * Country ISO code {@code IS}. - */ - public static final CountryIsoCode ICELAND = fromString("IS"); - /** - * Country ISO code {@code IN}. - */ - public static final CountryIsoCode INDIA = fromString("IN"); - /** - * Country ISO code {@code ID}. - */ - public static final CountryIsoCode INDONESIA = fromString("ID"); - /** - * Country ISO code {@code IQ}. - */ - public static final CountryIsoCode IRAQ = fromString("IQ"); - /** - * Country ISO code {@code IE}. - */ - public static final CountryIsoCode IRELAND = fromString("IE"); - /** - * Country ISO code {@code IM}. - */ - public static final CountryIsoCode ISLE_OF_MAN = fromString("IM"); - /** - * Country ISO code {@code IL}. - */ - public static final CountryIsoCode ISRAEL = fromString("IL"); - /** - * Country ISO code {@code IT}. - */ - public static final CountryIsoCode ITALY = fromString("IT"); - /** - * Country ISO code {@code JM}. - */ - public static final CountryIsoCode JAMAICA = fromString("JM"); - /** - * Country ISO code {@code JP}. - */ - public static final CountryIsoCode JAPAN = fromString("JP"); - /** - * Country ISO code {@code JE}. - */ - public static final CountryIsoCode JERSEY = fromString("JE"); - /** - * Country ISO code {@code JO}. - */ - public static final CountryIsoCode JORDAN = fromString("JO"); - /** - * Country ISO code {@code KZ}. - */ - public static final CountryIsoCode KAZAKHSTAN = fromString("KZ"); - /** - * Country ISO code {@code KE}. - */ - public static final CountryIsoCode KENYA = fromString("KE"); - /** - * Country ISO code {@code KI}. - */ - public static final CountryIsoCode KIRIBATI = fromString("KI"); - /** - * Country ISO code {@code KR}. - */ - public static final CountryIsoCode KOREA = fromString("KR"); - /** - * Country ISO code {@code KW}. - */ - public static final CountryIsoCode KUWAIT = fromString("KW"); - /** - * Country ISO code {@code KG}. - */ - public static final CountryIsoCode KYRGYZSTAN = fromString("KG"); - /** - * Country ISO code {@code LA}. - */ - public static final CountryIsoCode LAO_PEOPLES_DEMOCRATIC_REPUBLIC = fromString("LA"); - /** - * Country ISO code {@code LV}. - */ - public static final CountryIsoCode LATVIA = fromString("LV"); - /** - * Country ISO code {@code LB}. - */ - public static final CountryIsoCode LEBANON = fromString("LB"); - /** - * Country ISO code {@code LS}. - */ - public static final CountryIsoCode LESOTHO = fromString("LS"); - /** - * Country ISO code {@code LR}. - */ - public static final CountryIsoCode LIBERIA = fromString("LR"); - /** - * Country ISO code {@code LY}. - */ - public static final CountryIsoCode STATE_OF_LIBYA = fromString("LY"); - /** - * Country ISO code {@code LI}. - */ - public static final CountryIsoCode LIECHTENSTEIN = fromString("LI"); - /** - * Country ISO code {@code LT}. - */ - public static final CountryIsoCode LITHUANIA = fromString("LT"); - /** - * Country ISO code {@code LU}. - */ - public static final CountryIsoCode LUXEMBOURG = fromString("LU"); - /** - * Country ISO code {@code MO}. - */ - public static final CountryIsoCode MACAO_SAR = fromString("MO"); - /** - * Country ISO code {@code MG}. - */ - public static final CountryIsoCode MADAGASCAR = fromString("MG"); - /** - * Country ISO code {@code MW}. - */ - public static final CountryIsoCode MALAWI = fromString("MW"); - /** - * Country ISO code {@code MY}. - */ - public static final CountryIsoCode MALAYSIA = fromString("MY"); - /** - * Country ISO code {@code MV}. - */ - public static final CountryIsoCode MALDIVES = fromString("MV"); - /** - * Country ISO code {@code ML}. - */ - public static final CountryIsoCode MALI = fromString("ML"); - /** - * Country ISO code {@code MT}. - */ - public static final CountryIsoCode MALTA = fromString("MT"); - /** - * Country ISO code {@code MH}. - */ - public static final CountryIsoCode MARSHALL_ISLANDS = fromString("MH"); - /** - * Country ISO code {@code MQ}. - */ - public static final CountryIsoCode MARTINIQUE = fromString("MQ"); - /** - * Country ISO code {@code MR}. - */ - public static final CountryIsoCode MAURITANIA = fromString("MR"); - /** - * Country ISO code {@code MU}. - */ - public static final CountryIsoCode MAURITIUS = fromString("MU"); - /** - * Country ISO code {@code YT}. - */ - public static final CountryIsoCode MAYOTTE = fromString("YT"); - /** - * Country ISO code {@code MX}. - */ - public static final CountryIsoCode MEXICO = fromString("MX"); - /** - * Country ISO code {@code FM}. - */ - public static final CountryIsoCode MICRONESIA_FEDERATED_STATES_OF = fromString("FM"); - /** - * Country ISO code {@code MD}. - */ - public static final CountryIsoCode MOLDOVA = fromString("MD"); - /** - * Country ISO code {@code MC}. - */ - public static final CountryIsoCode MONACO = fromString("MC"); - /** - * Country ISO code {@code MN}. - */ - public static final CountryIsoCode MONGOLIA = fromString("MN"); - /** - * Country ISO code {@code ME}. - */ - public static final CountryIsoCode MONTENEGRO = fromString("ME"); - /** - * Country ISO code {@code MS}. - */ - public static final CountryIsoCode MONTSERRAT = fromString("MS"); - /** - * Country ISO code {@code MA}. - */ - public static final CountryIsoCode MOROCCO = fromString("MA"); - /** - * Country ISO code {@code MZ}. - */ - public static final CountryIsoCode MOZAMBIQUE = fromString("MZ"); - /** - * Country ISO code {@code MM}. - */ - public static final CountryIsoCode MYANMAR = fromString("MM"); - /** - * Country ISO code {@code NA}. - */ - public static final CountryIsoCode NAMIBIA = fromString("NA"); - /** - * Country ISO code {@code NR}. - */ - public static final CountryIsoCode NAURU = fromString("NR"); - /** - * Country ISO code {@code NP}. - */ - public static final CountryIsoCode NEPAL = fromString("NP"); - /** - * Country ISO code {@code NL}. - */ - public static final CountryIsoCode NETHERLANDS = fromString("NL"); - /** - * Country ISO code {@code NC}. - */ - public static final CountryIsoCode NEW_CALEDONIA = fromString("NC"); - /** - * Country ISO code {@code NZ}. - */ - public static final CountryIsoCode NEW_ZEALAND = fromString("NZ"); - /** - * Country ISO code {@code NI}. - */ - public static final CountryIsoCode NICARAGUA = fromString("NI"); - /** - * Country ISO code {@code NE}. - */ - public static final CountryIsoCode NIGER = fromString("NE"); - /** - * Country ISO code {@code NG}. - */ - public static final CountryIsoCode NIGERIA = fromString("NG"); - /** - * Country ISO code {@code NU}. - */ - public static final CountryIsoCode NIUE = fromString("NU"); - /** - * Country ISO code {@code NF}. - */ - public static final CountryIsoCode NORFOLK_ISLAND = fromString("NF"); - /** - * Country ISO code {@code MP}. - */ - public static final CountryIsoCode NORTHERN_MARIANA_ISLANDS = fromString("MP"); - /** - * Country ISO code {@code MK}. - */ - public static final CountryIsoCode NORTH_MACEDONIA = fromString("MK"); - /** - * Country ISO code {@code NO}. - */ - public static final CountryIsoCode NORWAY = fromString("NO"); - /** - * Country ISO code {@code OM}. - */ - public static final CountryIsoCode OMAN = fromString("OM"); - /** - * Country ISO code {@code PK}. - */ - public static final CountryIsoCode PAKISTAN = fromString("PK"); - /** - * Country ISO code {@code PW}. - */ - public static final CountryIsoCode PALAU = fromString("PW"); - /** - * Country ISO code {@code PS}. - */ - public static final CountryIsoCode PALESTINIAN_TERRITORY_OCCUPIED = fromString("PS"); - /** - * Country ISO code {@code PA}. - */ - public static final CountryIsoCode PANAMA = fromString("PA"); - /** - * Country ISO code {@code PG}. - */ - public static final CountryIsoCode PAPUA_NEW_GUINEA = fromString("PG"); - /** - * Country ISO code {@code PY}. - */ - public static final CountryIsoCode PARAGUAY = fromString("PY"); - /** - * Country ISO code {@code PE}. - */ - public static final CountryIsoCode PERU = fromString("PE"); - /** - * Country ISO code {@code PH}. - */ - public static final CountryIsoCode PHILIPPINES = fromString("PH"); - /** - * Country ISO code {@code PN}. - */ - public static final CountryIsoCode PITCAIRN = fromString("PN"); - /** - * Country ISO code {@code PL}. - */ - public static final CountryIsoCode POLAND = fromString("PL"); - /** - * Country ISO code {@code PT}. - */ - public static final CountryIsoCode PORTUGAL = fromString("PT"); - /** - * Country ISO code {@code PR}. - */ - public static final CountryIsoCode PUERTO_RICO = fromString("PR"); - /** - * Country ISO code {@code QA}. - */ - public static final CountryIsoCode QATAR = fromString("QA"); - /** - * Country ISO code {@code RE}. - */ - public static final CountryIsoCode REUNION = fromString("RE"); - /** - * Country ISO code {@code RO}. - */ - public static final CountryIsoCode ROMANIA = fromString("RO"); - /** - * Country ISO code {@code RU}. - */ - public static final CountryIsoCode RUSSIAN_FEDERATION = fromString("RU"); - /** - * Country ISO code {@code RW}. - */ - public static final CountryIsoCode RWANDA = fromString("RW"); - /** - * Country ISO code {@code SH}. - */ - public static final CountryIsoCode SAINT_HELENA = fromString("SH"); - /** - * Country ISO code {@code KN}. - */ - public static final CountryIsoCode SAINT_KITTS_AND_NEVIS = fromString("KN"); - /** - * Country ISO code {@code LC}. - */ - public static final CountryIsoCode SAINT_LUCIA = fromString("LC"); - /** - * Country ISO code {@code PM}. - */ - public static final CountryIsoCode SAINT_PIERRE_AND_MIQUELON = fromString("PM"); - /** - * Country ISO code {@code VC}. - */ - public static final CountryIsoCode SAINT_VINCENT_AND_GRENADINES = fromString("VC"); - /** - * Country ISO code {@code WS}. - */ - public static final CountryIsoCode SAMOA = fromString("WS"); - /** - * Country ISO code {@code SM}. - */ - public static final CountryIsoCode SAN_MARINO = fromString("SM"); - /** - * Country ISO code {@code ST}. - */ - public static final CountryIsoCode SAO_TOME_AND_PRINCIPE = fromString("ST"); - /** - * Country ISO code {@code SA}. - */ - public static final CountryIsoCode SAUDI_ARABIA = fromString("SA"); - /** - * Country ISO code {@code SN}. - */ - public static final CountryIsoCode SENEGAL = fromString("SN"); - /** - * Country ISO code {@code RS}. - */ - public static final CountryIsoCode SERBIA = fromString("RS"); - /** - * Country ISO code {@code SC}. - */ - public static final CountryIsoCode SEYCHELLES = fromString("SC"); - /** - * Country ISO code {@code SL}. - */ - public static final CountryIsoCode SIERRA_LEONE = fromString("SL"); - /** - * Country ISO code {@code SG}. - */ - public static final CountryIsoCode SINGAPORE = fromString("SG"); - /** - * Country ISO code {@code SK}. - */ - public static final CountryIsoCode SLOVAKIA = fromString("SK"); - /** - * Country ISO code {@code SI}. - */ - public static final CountryIsoCode SLOVENIA = fromString("SI"); - /** - * Country ISO code {@code SB}. - */ - public static final CountryIsoCode SOLOMON_ISLANDS = fromString("SB"); - /** - * Country ISO code {@code SO}. - */ - public static final CountryIsoCode SOMALIA = fromString("SO"); - /** - * Country ISO code {@code ZA}. - */ - public static final CountryIsoCode SOUTH_AFRICA = fromString("ZA"); - /** - * Country ISO code {@code GS}. - */ - public static final CountryIsoCode SOUTH_GEORGIA_AND_SANDWICH_ISLAND = fromString("GS"); - /** - * Country ISO code {@code ES}. - */ - public static final CountryIsoCode SPAIN = fromString("ES"); - /** - * Country ISO code {@code LK}. - */ - public static final CountryIsoCode SRI_LANKA = fromString("LK"); - /** - * Country ISO code {@code SR}. - */ - public static final CountryIsoCode SURINAME = fromString("SR"); - /** - * Country ISO code {@code SJ}. - */ - public static final CountryIsoCode SVALBARD_AND_JAN_MAYEN = fromString("SJ"); - /** - * Country ISO code {@code SZ}. - */ - public static final CountryIsoCode SWAZILAND = fromString("SZ"); - /** - * Country ISO code {@code SE}. - */ - public static final CountryIsoCode SWEDEN = fromString("SE"); - /** - * Country ISO code {@code CH}. - */ - public static final CountryIsoCode SWITZERLAND = fromString("CH"); - /** - * Country ISO code {@code TW}. - */ - public static final CountryIsoCode TAIWAN = fromString("TW"); - /** - * Country ISO code {@code TJ}. - */ - public static final CountryIsoCode TAJIKISTAN = fromString("TJ"); - /** - * Country ISO code {@code TZ}. - */ - public static final CountryIsoCode TANZANIA = fromString("TZ"); - /** - * Country ISO code {@code TH}. - */ - public static final CountryIsoCode THAILAND = fromString("TH"); - /** - * Country ISO code {@code TL}. - */ - public static final CountryIsoCode TIMOR_LESTE = fromString("TL"); - /** - * Country ISO code {@code TG}. - */ - public static final CountryIsoCode TOGO = fromString("TG"); - /** - * Country ISO code {@code TK}. - */ - public static final CountryIsoCode TOKELAU = fromString("TK"); - /** - * Country ISO code {@code TO}. - */ - public static final CountryIsoCode TONGA = fromString("TO"); - /** - * Country ISO code {@code TT}. - */ - public static final CountryIsoCode TRINIDAD_AND_TOBAGO = fromString("TT"); - /** - * Country ISO code {@code TN}. - */ - public static final CountryIsoCode TUNISIA = fromString("TN"); - /** - * Country ISO code {@code TR}. - */ - public static final CountryIsoCode TURKEY = fromString("TR"); - /** - * Country ISO code {@code TM}. - */ - public static final CountryIsoCode TURKMENISTAN = fromString("TM"); - /** - * Country ISO code {@code TC}. - */ - public static final CountryIsoCode TURKS_AND_CAICOS_ISLANDS = fromString("TC"); - /** - * Country ISO code {@code TV}. - */ - public static final CountryIsoCode TUVALU = fromString("TV"); - /** - * Country ISO code {@code UG}. - */ - public static final CountryIsoCode UGANDA = fromString("UG"); - /** - * Country ISO code {@code UA}. - */ - public static final CountryIsoCode UKRAINE = fromString("UA"); - /** - * Country ISO code {@code AE}. - */ - public static final CountryIsoCode UNITED_ARAB_EMIRATES = fromString("AE"); - /** - * Country ISO code {@code GB}. - */ - public static final CountryIsoCode UNITED_KINGDOM = fromString("GB"); - /** - * Country ISO code {@code US}. - */ - public static final CountryIsoCode UNITED_STATES = fromString("US"); - /** - * Country ISO code {@code UM}. - */ - public static final CountryIsoCode UNITED_STATES_OUTLYING_ISLANDS = fromString("UM"); - /** - * Country ISO code {@code UY}. - */ - public static final CountryIsoCode URUGUAY = fromString("UY"); - /** - * Country ISO code {@code UZ}. - */ - public static final CountryIsoCode UZBEKISTAN = fromString("UZ"); - /** - * Country ISO code {@code VU}. - */ - public static final CountryIsoCode VANUATU = fromString("VU"); - /** - * Country ISO code {@code VE}. - */ - public static final CountryIsoCode VENEZUELA = fromString("VE"); - /** - * Country ISO code {@code VN}. - */ - public static final CountryIsoCode VIETNAM = fromString("VN"); - /** - * Country ISO code {@code VG}. - */ - public static final CountryIsoCode VIRGIN_ISLANDS_BRITISH = fromString("VG"); - /** - * Country ISO code {@code VI}. - */ - public static final CountryIsoCode VIRGIN_ISLANDS_US = fromString("VI"); - /** - * Country ISO code {@code WF}. - */ - public static final CountryIsoCode WALLIS_AND_FUTUNA = fromString("WF"); - /** - * Country ISO code {@code EH}. - */ - public static final CountryIsoCode WESTERN_SAHARA = fromString("EH"); - /** - * Country ISO code {@code YE}. - */ - public static final CountryIsoCode YEMEN = fromString("YE"); - /** - * Country ISO code {@code ZM}. - */ - public static final CountryIsoCode ZAMBIA = fromString("ZM"); - /** - * Country ISO code {@code ZW}. - */ - public static final CountryIsoCode ZIMBABWE = fromString("ZW"); - - /** - * @return known country ISO codes - */ - public static Collection values() { - return values(CountryIsoCode.class); - } - - /** - * Creates or finds a CountryIsoCode based on the specified code. - * - * @param code a country ISO code - * @return a CountryIsoCode - */ - public static CountryIsoCode fromString(String code) { - return fromString(code, CountryIsoCode.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/CountryPhoneCode.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/CountryPhoneCode.java deleted file mode 100644 index 9873e2e687fd..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/CountryPhoneCode.java +++ /dev/null @@ -1,977 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.arm; - -import com.azure.core.util.ExpandableStringEnum; - -import java.util.Collection; - -/** - * Defines values for country codes for phone number prefixes. - * E.g. the country code for +1 123 456 7890 is '+1'. - */ -public final class CountryPhoneCode extends ExpandableStringEnum { - // CHECKSTYLE IGNORE Javadoc FOR NEXT 236 LINES - /** - * Country phone code {@code +355}. - */ - public static final CountryPhoneCode ALBANIA = fromString("+355"); - /** - * Country phone code {@code +213}. - */ - public static final CountryPhoneCode ALGERIA = fromString("+213"); - /** - * Country phone code {@code +376}. - */ - public static final CountryPhoneCode ANDORRA = fromString("+376"); - /** - * Country phone code {@code +244}. - */ - public static final CountryPhoneCode ANGOLA = fromString("+244"); - /** - * Country phone code {@code +672}. - */ - public static final CountryPhoneCode ANTARCTICA = fromString("+672"); - /** - * Country phone code {@code +1}. - */ - public static final CountryPhoneCode ANTIGUA_AND_BARBUDA = fromString("+1"); - /** - * Country phone code {@code +54}. - */ - public static final CountryPhoneCode ARGENTINA = fromString("+54"); - /** - * Country phone code {@code +374}. - */ - public static final CountryPhoneCode ARMENIA = fromString("+374"); - /** - * Country phone code {@code +297}. - */ - public static final CountryPhoneCode ARUBA = fromString("+297"); - /** - * Country phone code {@code +247}. - */ - public static final CountryPhoneCode ASCENSION_ISLAND = fromString("+247"); - /** - * Country phone code {@code +61}. - */ - public static final CountryPhoneCode AUSTRALIA = fromString("+61"); - /** - * Country phone code {@code +43}. - */ - public static final CountryPhoneCode AUSTRIA = fromString("+43"); - /** - * Country phone code {@code +994}. - */ - public static final CountryPhoneCode AZERBAIJAN = fromString("+994"); - /** - * Country phone code {@code +1}. - */ - public static final CountryPhoneCode BAHAMAS = fromString("+1"); - /** - * Country phone code {@code +973}. - */ - public static final CountryPhoneCode BAHRAIN = fromString("+973"); - /** - * Country phone code {@code +880}. - */ - public static final CountryPhoneCode BANGLADESH = fromString("+880"); - /** - * Country phone code {@code +1}. - */ - public static final CountryPhoneCode BARBADOS = fromString("+1"); - /** - * Country phone code {@code +375}. - */ - public static final CountryPhoneCode BELARUS = fromString("+375"); - /** - * Country phone code {@code +32}. - */ - public static final CountryPhoneCode BELGIUM = fromString("+32"); - /** - * Country phone code {@code +501}. - */ - public static final CountryPhoneCode BELIZE = fromString("+501"); - /** - * Country phone code {@code +229}. - */ - public static final CountryPhoneCode BENIN = fromString("+229"); - /** - * Country phone code {@code +1}. - */ - public static final CountryPhoneCode BERMUDA = fromString("+1"); - /** - * Country phone code {@code +975}. - */ - public static final CountryPhoneCode BHUTAN = fromString("+975"); - /** - * Country phone code {@code +591}. - */ - public static final CountryPhoneCode BOLIVIA = fromString("+591"); - /** - * Country phone code {@code +387}. - */ - public static final CountryPhoneCode BOSNIA_AND_HERZEGOVINA = fromString("+387"); - /** - * Country phone code {@code +267}. - */ - public static final CountryPhoneCode BOTSWANA = fromString("+267"); - /** - * Country phone code {@code +47}. - */ - public static final CountryPhoneCode BOUVET_ISLAND = fromString("+47"); - /** - * Country phone code {@code +55}. - */ - public static final CountryPhoneCode BRAZIL = fromString("+55"); - /** - * Country phone code {@code +44}. - */ - public static final CountryPhoneCode BRITISH_INDIAN_OCEAN_TERRITORY = fromString("+44"); - /** - * Country phone code {@code +673}. - */ - public static final CountryPhoneCode BRUNEI = fromString("+673"); - /** - * Country phone code {@code +359}. - */ - public static final CountryPhoneCode BULGARIA = fromString("+359"); - /** - * Country phone code {@code +226}. - */ - public static final CountryPhoneCode BURKINA_FASO = fromString("+226"); - /** - * Country phone code {@code +257}. - */ - public static final CountryPhoneCode BURUNDI = fromString("+257"); - /** - * Country phone code {@code +238}. - */ - public static final CountryPhoneCode CABO_VERDE = fromString("+238"); - /** - * Country phone code {@code +855}. - */ - public static final CountryPhoneCode CAMBODIA = fromString("+855"); - /** - * Country phone code {@code +237}. - */ - public static final CountryPhoneCode CAMEROON = fromString("+237"); - /** - * Country phone code {@code +1}. - */ - public static final CountryPhoneCode CANADA = fromString("+1"); - /** - * Country phone code {@code +1}. - */ - public static final CountryPhoneCode CAYMAN_ISLANDS = fromString("+1"); - /** - * Country phone code {@code +236}. - */ - public static final CountryPhoneCode CENTRAL_AFRICAN_REPUBLIC = fromString("+236"); - /** - * Country phone code {@code +235}. - */ - public static final CountryPhoneCode CHAD = fromString("+235"); - /** - * Country phone code {@code +56}. - */ - public static final CountryPhoneCode CHILE = fromString("+56"); - /** - * Country phone code {@code +86}. - */ - public static final CountryPhoneCode CHINA = fromString("+86"); - /** - * Country phone code {@code +61}. - */ - public static final CountryPhoneCode CHRISTMAS_ISLAND = fromString("+61"); - /** - * Country phone code {@code +61}. - */ - public static final CountryPhoneCode COCOS_KEELING_ISLANDS = fromString("+61"); - /** - * Country phone code {@code +57}. - */ - public static final CountryPhoneCode COLOMBIA = fromString("+57"); - /** - * Country phone code {@code +269}. - */ - public static final CountryPhoneCode COMOROS = fromString("+269"); - /** - * Country phone code {@code +242}. - */ - public static final CountryPhoneCode CONGO = fromString("+242"); - /** - * Country phone code {@code +243}. - */ - public static final CountryPhoneCode CONGO_DRC = fromString("+243"); - /** - * Country phone code {@code +682}. - */ - public static final CountryPhoneCode COOK_ISLANDS = fromString("+682"); - /** - * Country phone code {@code +506}. - */ - public static final CountryPhoneCode COSTA_RICA = fromString("+506"); - /** - * Country phone code {@code +385}. - */ - public static final CountryPhoneCode CROATIA = fromString("+385"); - /** - * Country phone code {@code +53}. - */ - public static final CountryPhoneCode CUBA = fromString("+53"); - /** - * Country phone code {@code +357}. - */ - public static final CountryPhoneCode CYPRUS = fromString("+357"); - /** - * Country phone code {@code +420}. - */ - public static final CountryPhoneCode CZECH_REPUBLIC = fromString("+420"); - /** - * Country phone code {@code +45}. - */ - public static final CountryPhoneCode DENMARK = fromString("+45"); - /** - * Country phone code {@code +253}. - */ - public static final CountryPhoneCode DJIBOUTI = fromString("+253"); - /** - * Country phone code {@code +1}. - */ - public static final CountryPhoneCode DOMINICA = fromString("+1"); - /** - * Country phone code {@code +1}. - */ - public static final CountryPhoneCode DOMINICAN_REPUBLIC = fromString("+1"); - /** - * Country phone code {@code +593}. - */ - public static final CountryPhoneCode ECUADOR = fromString("+593"); - /** - * Country phone code {@code +20}. - */ - public static final CountryPhoneCode EGYPT = fromString("+20"); - /** - * Country phone code {@code +503}. - */ - public static final CountryPhoneCode EL_SALVADOR = fromString("+503"); - /** - * Country phone code {@code +240}. - */ - public static final CountryPhoneCode EQUATORIAL_GUINEA = fromString("+240"); - /** - * Country phone code {@code +291}. - */ - public static final CountryPhoneCode ERITREA = fromString("+291"); - /** - * Country phone code {@code +372}. - */ - public static final CountryPhoneCode ESTONIA = fromString("+372"); - /** - * Country phone code {@code +251}. - */ - public static final CountryPhoneCode ETHIOPIA = fromString("+251"); - /** - * Country phone code {@code +500}. - */ - public static final CountryPhoneCode FALKLAND_ISLANDS = fromString("+500"); - /** - * Country phone code {@code +298}. - */ - public static final CountryPhoneCode FAROE_ISLANDS = fromString("+298"); - /** - * Country phone code {@code +679}. - */ - public static final CountryPhoneCode FIJI_ISLANDS = fromString("+679"); - /** - * Country phone code {@code +358}. - */ - public static final CountryPhoneCode FINLAND = fromString("+358"); - /** - * Country phone code {@code +33}. - */ - public static final CountryPhoneCode FRANCE = fromString("+33"); - /** - * Country phone code {@code +594}. - */ - public static final CountryPhoneCode FRENCH_GUIANA = fromString("+594"); - /** - * Country phone code {@code +689}. - */ - public static final CountryPhoneCode FRENCH_POLYNESIA = fromString("+689"); - /** - * Country phone code {@code +241}. - */ - public static final CountryPhoneCode GABON = fromString("+241"); - /** - * Country phone code {@code +220}. - */ - public static final CountryPhoneCode GAMBIA_THE = fromString("+220"); - /** - * Country phone code {@code +995}. - */ - public static final CountryPhoneCode GEORGIA = fromString("+995"); - /** - * Country phone code {@code +49}. - */ - public static final CountryPhoneCode GERMANY = fromString("+49"); - /** - * Country phone code {@code +233}. - */ - public static final CountryPhoneCode GHANA = fromString("+233"); - /** - * Country phone code {@code +350}. - */ - public static final CountryPhoneCode GIBRALTAR = fromString("+350"); - /** - * Country phone code {@code +30}. - */ - public static final CountryPhoneCode GREECE = fromString("+30"); - /** - * Country phone code {@code +299}. - */ - public static final CountryPhoneCode GREENLAND = fromString("+299"); - /** - * Country phone code {@code +1}. - */ - public static final CountryPhoneCode GRENADA = fromString("+1"); - /** - * Country phone code {@code +590}. - */ - public static final CountryPhoneCode GUADELOUPE = fromString("+590"); - /** - * Country phone code {@code +1}. - */ - public static final CountryPhoneCode GUAM = fromString("+1"); - /** - * Country phone code {@code +502}. - */ - public static final CountryPhoneCode GUATEMALA = fromString("+502"); - /** - * Country phone code {@code +44}. - */ - public static final CountryPhoneCode GUERNSEY = fromString("+44"); - /** - * Country phone code {@code +224}. - */ - public static final CountryPhoneCode GUINEA = fromString("+224"); - /** - * Country phone code {@code +245}. - */ - public static final CountryPhoneCode GUINEA_BISSAU = fromString("+245"); - /** - * Country phone code {@code +592}. - */ - public static final CountryPhoneCode GUYANA = fromString("+592"); - /** - * Country phone code {@code +509}. - */ - public static final CountryPhoneCode HAITI = fromString("+509"); - /** - * Country phone code {@code +379}. - */ - public static final CountryPhoneCode HOLY_SEE_VATICAN_CITY = fromString("+379"); - /** - * Country phone code {@code +504}. - */ - public static final CountryPhoneCode HONDURAS = fromString("+504"); - /** - * Country phone code {@code +852}. - */ - public static final CountryPhoneCode HONG_KONG_SAR = fromString("+852"); - /** - * Country phone code {@code +36}. - */ - public static final CountryPhoneCode HUNGARY = fromString("+36"); - /** - * Country phone code {@code +354}. - */ - public static final CountryPhoneCode ICELAND = fromString("+354"); - /** - * Country phone code {@code +91}. - */ - public static final CountryPhoneCode INDIA = fromString("+91"); - /** - * Country phone code {@code +62}. - */ - public static final CountryPhoneCode INDONESIA = fromString("+62"); - /** - * Country phone code {@code +98}. - */ - public static final CountryPhoneCode IRAN = fromString("+98"); - /** - * Country phone code {@code +964}. - */ - public static final CountryPhoneCode IRAQ = fromString("+964"); - /** - * Country phone code {@code +353}. - */ - public static final CountryPhoneCode IRELAND = fromString("+353"); - /** - * Country phone code {@code +44}. - */ - public static final CountryPhoneCode ISLE_OF_MAN = fromString("+44"); - /** - * Country phone code {@code +972}. - */ - public static final CountryPhoneCode ISRAEL = fromString("+972"); - /** - * Country phone code {@code +39}. - */ - public static final CountryPhoneCode ITALY = fromString("+39"); - /** - * Country phone code {@code +1}. - */ - public static final CountryPhoneCode JAMAICA = fromString("+1"); - /** - * Country phone code {@code +47}. - */ - public static final CountryPhoneCode JAN_MAYEN = fromString("+47"); - /** - * Country phone code {@code +81}. - */ - public static final CountryPhoneCode JAPAN = fromString("+81"); - /** - * Country phone code {@code +44}. - */ - public static final CountryPhoneCode JERSEY = fromString("+44"); - /** - * Country phone code {@code +962}. - */ - public static final CountryPhoneCode JORDAN = fromString("+962"); - /** - * Country phone code {@code +7}. - */ - public static final CountryPhoneCode KAZAKHSTAN = fromString("+7"); - /** - * Country phone code {@code +254}. - */ - public static final CountryPhoneCode KENYA = fromString("+254"); - /** - * Country phone code {@code +686}. - */ - public static final CountryPhoneCode KIRIBATI = fromString("+686"); - /** - * Country phone code {@code +82}. - */ - public static final CountryPhoneCode KOREA = fromString("+82"); - /** - * Country phone code {@code +965}. - */ - public static final CountryPhoneCode KUWAIT = fromString("+965"); - /** - * Country phone code {@code +996}. - */ - public static final CountryPhoneCode KYRGYZSTAN = fromString("+996"); - /** - * Country phone code {@code +856}. - */ - public static final CountryPhoneCode LAOS = fromString("+856"); - /** - * Country phone code {@code +371}. - */ - public static final CountryPhoneCode LATVIA = fromString("+371"); - /** - * Country phone code {@code +961}. - */ - public static final CountryPhoneCode LEBANON = fromString("+961"); - /** - * Country phone code {@code +266}. - */ - public static final CountryPhoneCode LESOTHO = fromString("+266"); - /** - * Country phone code {@code +231}. - */ - public static final CountryPhoneCode LIBERIA = fromString("+231"); - /** - * Country phone code {@code +218}. - */ - public static final CountryPhoneCode LIBYA = fromString("+218"); - /** - * Country phone code {@code +423}. - */ - public static final CountryPhoneCode LIECHTENSTEIN = fromString("+423"); - /** - * Country phone code {@code +370}. - */ - public static final CountryPhoneCode LITHUANIA = fromString("+370"); - /** - * Country phone code {@code +352}. - */ - public static final CountryPhoneCode LUXEMBOURG = fromString("+352"); - /** - * Country phone code {@code +853}. - */ - public static final CountryPhoneCode MACAO_SAR = fromString("+853"); - /** - * Country phone code {@code +389}. - */ - public static final CountryPhoneCode MACEDONIA_FORMER_YUGOSLAV_REPUBLIC_OF = fromString("+389"); - /** - * Country phone code {@code +261}. - */ - public static final CountryPhoneCode MADAGASCAR = fromString("+261"); - /** - * Country phone code {@code +265}. - */ - public static final CountryPhoneCode MALAWI = fromString("+265"); - /** - * Country phone code {@code +60}. - */ - public static final CountryPhoneCode MALAYSIA = fromString("+60"); - /** - * Country phone code {@code +960}. - */ - public static final CountryPhoneCode MALDIVES = fromString("+960"); - /** - * Country phone code {@code +223}. - */ - public static final CountryPhoneCode MALI = fromString("+223"); - /** - * Country phone code {@code +356}. - */ - public static final CountryPhoneCode MALTA = fromString("+356"); - /** - * Country phone code {@code +692}. - */ - public static final CountryPhoneCode MARSHALL_ISLANDS = fromString("+692"); - /** - * Country phone code {@code +596}. - */ - public static final CountryPhoneCode MARTINIQUE = fromString("+596"); - /** - * Country phone code {@code +222}. - */ - public static final CountryPhoneCode MAURITANIA = fromString("+222"); - /** - * Country phone code {@code +230}. - */ - public static final CountryPhoneCode MAURITIUS = fromString("+230"); - /** - * Country phone code {@code +262}. - */ - public static final CountryPhoneCode MAYOTTE = fromString("+262"); - /** - * Country phone code {@code +52}. - */ - public static final CountryPhoneCode MEXICO = fromString("+52"); - /** - * Country phone code {@code +691}. - */ - public static final CountryPhoneCode MICRONESIA = fromString("+691"); - /** - * Country phone code {@code +373}. - */ - public static final CountryPhoneCode MOLDOVA = fromString("+373"); - /** - * Country phone code {@code +377}. - */ - public static final CountryPhoneCode MONACO = fromString("+377"); - /** - * Country phone code {@code +976}. - */ - public static final CountryPhoneCode MONGOLIA = fromString("+976"); - /** - * Country phone code {@code +382}. - */ - public static final CountryPhoneCode MONTENEGRO = fromString("+382"); - /** - * Country phone code {@code +1}. - */ - public static final CountryPhoneCode MONTSERRAT = fromString("+1"); - /** - * Country phone code {@code +212}. - */ - public static final CountryPhoneCode MOROCCO = fromString("+212"); - /** - * Country phone code {@code +258}. - */ - public static final CountryPhoneCode MOZAMBIQUE = fromString("+258"); - /** - * Country phone code {@code +95}. - */ - public static final CountryPhoneCode MYANMAR = fromString("+95"); - /** - * Country phone code {@code +264}. - */ - public static final CountryPhoneCode NAMIBIA = fromString("+264"); - /** - * Country phone code {@code +674}. - */ - public static final CountryPhoneCode NAURU = fromString("+674"); - /** - * Country phone code {@code +977}. - */ - public static final CountryPhoneCode NEPAL = fromString("+977"); - /** - * Country phone code {@code +31}. - */ - public static final CountryPhoneCode NETHERLANDS = fromString("+31"); - /** - * Country phone code {@code +599}. - */ - public static final CountryPhoneCode NETHERLANDS_ANTILLES_FORMER = fromString("+599"); - /** - * Country phone code {@code +687}. - */ - public static final CountryPhoneCode NEW_CALEDONIA = fromString("+687"); - /** - * Country phone code {@code +64}. - */ - public static final CountryPhoneCode NEW_ZEALAND = fromString("+64"); - /** - * Country phone code {@code +505}. - */ - public static final CountryPhoneCode NICARAGUA = fromString("+505"); - /** - * Country phone code {@code +227}. - */ - public static final CountryPhoneCode NIGER = fromString("+227"); - /** - * Country phone code {@code +234}. - */ - public static final CountryPhoneCode NIGERIA = fromString("+234"); - /** - * Country phone code {@code +683}. - */ - public static final CountryPhoneCode NIUE = fromString("+683"); - /** - * Country phone code {@code +850}. - */ - public static final CountryPhoneCode NORTH_KOREA = fromString("+850"); - /** - * Country phone code {@code +1}. - */ - public static final CountryPhoneCode NORTHERN_MARIANA_ISLANDS = fromString("+1"); - /** - * Country phone code {@code +47}. - */ - public static final CountryPhoneCode NORWAY = fromString("+47"); - /** - * Country phone code {@code +968}. - */ - public static final CountryPhoneCode OMAN = fromString("+968"); - /** - * Country phone code {@code +92}. - */ - public static final CountryPhoneCode PAKISTAN = fromString("+92"); - /** - * Country phone code {@code +680}. - */ - public static final CountryPhoneCode PALAU = fromString("+680"); - /** - * Country phone code {@code +970}. - */ - public static final CountryPhoneCode PALESTINIAN_AUTHORITY_970 = fromString("+970"); - /** - * Country phone code {@code +972}. - */ - public static final CountryPhoneCode PALESTINIAN_AUTHORITY_972 = fromString("+972"); - /** - * Country phone code {@code +507}. - */ - public static final CountryPhoneCode PANAMA = fromString("+507"); - /** - * Country phone code {@code +675}. - */ - public static final CountryPhoneCode PAPUA_NEW_GUINEA = fromString("+675"); - /** - * Country phone code {@code +595}. - */ - public static final CountryPhoneCode PARAGUAY = fromString("+595"); - /** - * Country phone code {@code +51}. - */ - public static final CountryPhoneCode PERU = fromString("+51"); - /** - * Country phone code {@code +63}. - */ - public static final CountryPhoneCode PHILIPPINES = fromString("+63"); - /** - * Country phone code {@code +48}. - */ - public static final CountryPhoneCode POLAND = fromString("+48"); - /** - * Country phone code {@code +351}. - */ - public static final CountryPhoneCode PORTUGAL = fromString("+351"); - /** - * Country phone code {@code +974}. - */ - public static final CountryPhoneCode QATAR = fromString("+974"); - /** - * Country phone code {@code +225}. - */ - public static final CountryPhoneCode IVORY_COAST = fromString("+225"); - /** - * Country phone code {@code +262}. - */ - public static final CountryPhoneCode REUNION = fromString("+262"); - /** - * Country phone code {@code +40}. - */ - public static final CountryPhoneCode ROMANIA = fromString("+40"); - /** - * Country phone code {@code +7}. - */ - public static final CountryPhoneCode RUSSIA = fromString("+7"); - /** - * Country phone code {@code +250}. - */ - public static final CountryPhoneCode RWANDA = fromString("+250"); - /** - * Country phone code {@code +290}. - */ - public static final CountryPhoneCode SAINT_HELENA_ASCENSION_AND_TRISTAN_DA_CUNHA = fromString("+290"); - /** - * Country phone code {@code +685}. - */ - public static final CountryPhoneCode SAMOA = fromString("+685"); - /** - * Country phone code {@code +378}. - */ - public static final CountryPhoneCode SAN_MARINO = fromString("+378"); - /** - * Country phone code {@code +239}. - */ - public static final CountryPhoneCode SAO_TOME_AND_PRINCIPE = fromString("+239"); - /** - * Country phone code {@code +966}. - */ - public static final CountryPhoneCode SAUDI_ARABIA = fromString("+966"); - /** - * Country phone code {@code +221}. - */ - public static final CountryPhoneCode SENEGAL = fromString("+221"); - /** - * Country phone code {@code +381}. - */ - public static final CountryPhoneCode SERBIA = fromString("+381"); - /** - * Country phone code {@code +248}. - */ - public static final CountryPhoneCode SEYCHELLES = fromString("+248"); - /** - * Country phone code {@code +232}. - */ - public static final CountryPhoneCode SIERRA_LEONE = fromString("+232"); - /** - * Country phone code {@code +65}. - */ - public static final CountryPhoneCode SINGAPORE = fromString("+65"); - /** - * Country phone code {@code +421}. - */ - public static final CountryPhoneCode SLOVAKIA = fromString("+421"); - /** - * Country phone code {@code +386}. - */ - public static final CountryPhoneCode SLOVENIA = fromString("+386"); - /** - * Country phone code {@code +677}. - */ - public static final CountryPhoneCode SOLOMON_ISLANDS = fromString("+677"); - /** - * Country phone code {@code +252}. - */ - public static final CountryPhoneCode SOMALIA = fromString("+252"); - /** - * Country phone code {@code +27}. - */ - public static final CountryPhoneCode SOUTH_AFRICA = fromString("+27"); - /** - * Country phone code {@code +34}. - */ - public static final CountryPhoneCode SPAIN = fromString("+34"); - /** - * Country phone code {@code +94}. - */ - public static final CountryPhoneCode SRI_LANKA = fromString("+94"); - /** - * Country phone code {@code +1}. - */ - public static final CountryPhoneCode ST_KITTS_AND_NEVIS = fromString("+1"); - /** - * Country phone code {@code +1}. - */ - public static final CountryPhoneCode ST_LUCIA = fromString("+1"); - /** - * Country phone code {@code +508}. - */ - public static final CountryPhoneCode ST_PIERRE_AND_MIQUELON = fromString("+508"); - /** - * Country phone code {@code +1}. - */ - public static final CountryPhoneCode ST_VINCENT_AND_THE_GRENADINES = fromString("+1"); - /** - * Country phone code {@code +249}. - */ - public static final CountryPhoneCode SUDAN = fromString("+249"); - /** - * Country phone code {@code +597}. - */ - public static final CountryPhoneCode SURINAME = fromString("+597"); - /** - * Country phone code {@code +268}. - */ - public static final CountryPhoneCode SWAZILAND = fromString("+268"); - /** - * Country phone code {@code +46}. - */ - public static final CountryPhoneCode SWEDEN = fromString("+46"); - /** - * Country phone code {@code +41}. - */ - public static final CountryPhoneCode SWITZERLAND = fromString("+41"); - /** - * Country phone code {@code +963}. - */ - public static final CountryPhoneCode SYRIA = fromString("+963"); - /** - * Country phone code {@code +886}. - */ - public static final CountryPhoneCode TAIWAN = fromString("+886"); - /** - * Country phone code {@code +992}. - */ - public static final CountryPhoneCode TAJIKISTAN = fromString("+992"); - /** - * Country phone code {@code +255}. - */ - public static final CountryPhoneCode TANZANIA = fromString("+255"); - /** - * Country phone code {@code +66}. - */ - public static final CountryPhoneCode THAILAND = fromString("+66"); - /** - * Country phone code {@code +670}. - */ - public static final CountryPhoneCode TIMOR_LESTE = fromString("+670"); - /** - * Country phone code {@code +228}. - */ - public static final CountryPhoneCode TOGO = fromString("+228"); - /** - * Country phone code {@code +690}. - */ - public static final CountryPhoneCode TOKELAU = fromString("+690"); - /** - * Country phone code {@code +676}. - */ - public static final CountryPhoneCode TONGA = fromString("+676"); - /** - * Country phone code {@code +1}. - */ - public static final CountryPhoneCode TRINIDAD_AND_TOBAGO = fromString("+1"); - /** - * Country phone code {@code +290}. - */ - public static final CountryPhoneCode TRISTAN_DA_CUNHA = fromString("+290"); - /** - * Country phone code {@code +216}. - */ - public static final CountryPhoneCode TUNISIA = fromString("+216"); - /** - * Country phone code {@code +90}. - */ - public static final CountryPhoneCode TURKEY = fromString("+90"); - /** - * Country phone code {@code +993}. - */ - public static final CountryPhoneCode TURKMENISTAN = fromString("+993"); - /** - * Country phone code {@code +1}. - */ - public static final CountryPhoneCode TURKS_AND_CAICOS_ISLANDS = fromString("+1"); - /** - * Country phone code {@code +688}. - */ - public static final CountryPhoneCode TUVALU = fromString("+688"); - /** - * Country phone code {@code +256}. - */ - public static final CountryPhoneCode UGANDA = fromString("+256"); - /** - * Country phone code {@code +380}. - */ - public static final CountryPhoneCode UKRAINE = fromString("+380"); - /** - * Country phone code {@code +971}. - */ - public static final CountryPhoneCode UNITED_ARAB_EMIRATES = fromString("+971"); - /** - * Country phone code {@code +44}. - */ - public static final CountryPhoneCode UNITED_KINGDOM = fromString("+44"); - /** - * Country phone code {@code +1}. - */ - public static final CountryPhoneCode UNITED_STATES = fromString("+1"); - /** - * Country phone code {@code +1}. - */ - public static final CountryPhoneCode UNITED_STATES_MINOR_OUTLYING_ISLANDS = fromString("+1"); - /** - * Country phone code {@code +598}. - */ - public static final CountryPhoneCode URUGUAY = fromString("+598"); - /** - * Country phone code {@code +998}. - */ - public static final CountryPhoneCode UZBEKISTAN = fromString("+998"); - /** - * Country phone code {@code +678}. - */ - public static final CountryPhoneCode VANUATU = fromString("+678"); - /** - * Country phone code {@code +58}. - */ - public static final CountryPhoneCode VENEZUELA = fromString("+58"); - /** - * Country phone code {@code +84}. - */ - public static final CountryPhoneCode VIETNAM = fromString("+84"); - /** - * Country phone code {@code +1}. - */ - public static final CountryPhoneCode VIRGIN_ISLANDS_BRITISH = fromString("+1"); - /** - * Country phone code {@code +1}. - */ - public static final CountryPhoneCode VIRGIN_ISLANDS_US = fromString("+1"); - /** - * Country phone code {@code +681}. - */ - public static final CountryPhoneCode WALLIS_AND_FUTUNA = fromString("+681"); - /** - * Country phone code {@code +967}. - */ - public static final CountryPhoneCode YEMEN = fromString("+967"); - /** - * Country phone code {@code +260}. - */ - public static final CountryPhoneCode ZAMBIA = fromString("+260"); - /** - * Country phone code {@code +263}. - */ - public static final CountryPhoneCode ZIMBABWE = fromString("+263"); - - /** - * Creates or finds a country phone code from its string representation. - * - * @param code a country phone code - * @return the corresponding CountryPhoneCode - */ - public static CountryPhoneCode fromString(String code) { - return fromString(code, CountryPhoneCode.class); - } - - /** - * @return known country phone codes - */ - public static Collection values() { - return values(CountryPhoneCode.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/Manager.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/Manager.java deleted file mode 100644 index ec93531a7ee4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/Manager.java +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.arm; - -import com.azure.core.http.HttpPipeline; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.resources.ResourceManager; -import com.azure.resourcemanager.resources.fluentcore.model.HasServiceClient; - -/** - * Generic base class for Azure resource managers. - * - * @param inner management client implementation type - */ -public abstract class Manager implements HasServiceClient { - private ResourceManager resourceManager; - private final String subscriptionId; - private final AzureEnvironment environment; - private HttpPipeline httpPipeline; - - private final InnerT innerManagementClient; - - /** - * Creates a new instance of {@link Manager}. - * - * @param httpPipeline The HttpPipeline used by the manager. - * @param profile The AzureProfile used by the manager. - * @param innerManagementClient The inner management client. - */ - protected Manager(HttpPipeline httpPipeline, AzureProfile profile, InnerT innerManagementClient) { - this.httpPipeline = httpPipeline; - if (httpPipeline != null) { - this.resourceManager = ResourceManager.authenticate(httpPipeline, profile).withDefaultSubscription(); - } - this.subscriptionId = profile.getSubscriptionId(); - this.environment = profile.getEnvironment(); - this.innerManagementClient = innerManagementClient; - } - - @Override - public InnerT serviceClient() { - return this.innerManagementClient; - } - - /** - * @return the ID of the subscription the manager is working with - */ - public String subscriptionId() { - return this.subscriptionId; - } - - /** - * @return the Azure environment the manager is working with - */ - public AzureEnvironment environment() { - return this.environment; - } - - /** - * Configures the ResourceManager for this manager instance. - * - * @param resourceManager The ResourceManager to associate with this manager. - */ - protected final void withResourceManager(ResourceManager resourceManager) { - this.resourceManager = resourceManager; - if (this.httpPipeline == null) { - // fill httpPipeline from resourceManager - this.httpPipeline = resourceManager.serviceClient().getHttpPipeline(); - } - } - - /** - * @return the {@link ResourceManager} associated with this manager - */ - public ResourceManager resourceManager() { - return this.resourceManager; - } - - /** - * @return the {@link HttpPipeline} associated with this manager - */ - public HttpPipeline httpPipeline() { - return this.httpPipeline; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/ResourceId.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/ResourceId.java deleted file mode 100644 index f9a013112457..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/ResourceId.java +++ /dev/null @@ -1,163 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.arm; - -/** - * Instantiate itself from a resource id, and give easy access to resource information like subscription, resourceGroup, - * resource name. - */ -public final class ResourceId { - - private final String subscriptionId; - private final String resourceGroupName; - private final String name; - private final String providerNamespace; - private final String resourceType; - private final String id; - private final String parentId; - - private static String badIdErrorText(String id) { - return String.format("The specified ID `%s` is not a valid Azure resource ID.", id); - } - - private ResourceId(final String id) { - if (id == null) { - // Protect against NPEs from null IDs, preserving legacy behavior for null IDs - this.subscriptionId = null; - this.resourceGroupName = null; - this.name = null; - this.providerNamespace = null; - this.resourceType = null; - this.id = null; - this.parentId = null; - return; - } else { - // Skip the first '/' if any, and then split using '/' - String[] splits = (id.startsWith("/")) ? id.substring(1).split("/") : id.split("/"); - if (splits.length % 2 == 1) { - throw new IllegalArgumentException(badIdErrorText(id)); - } - - // Save the ID itself - this.id = id; - - // Format of id: - // /subscriptions//resourceGroups//providers - // /(//)*// - - // 0 1 2 3 4 - // 5 N-2 N-1 - - // Extract resource type and name - if (splits.length < 2) { - throw new IllegalArgumentException(badIdErrorText(id)); - } else { - this.name = splits[splits.length - 1]; - this.resourceType = splits[splits.length - 2]; - } - - // Extract parent ID - if (splits.length < 10) { - this.parentId = null; - } else { - String[] parentSplits = new String[splits.length - 2]; - System.arraycopy(splits, 0, parentSplits, 0, splits.length - 2); - this.parentId = "/" + String.join("/", parentSplits); - } - - // Ensure "subscriptions" - if (!splits[0].equalsIgnoreCase("subscriptions")) { - throw new IllegalArgumentException(badIdErrorText(id)); - } - // Extract subscription ID - this.subscriptionId = splits[1]; - // Ensure "resourceGroups" - if (splits.length > 2 && !splits[2].equalsIgnoreCase("resourceGroups")) { - throw new IllegalArgumentException(badIdErrorText(id)); - } - // Extract resource group name - this.resourceGroupName = splits.length > 3 ? splits[3] : null; - // Ensure "providers" - if (splits.length > 4 && !splits[4].equalsIgnoreCase("providers")) { - throw new IllegalArgumentException(badIdErrorText(id)); - } - // Extract provider namespace - this.providerNamespace = splits.length > 5 ? splits[5] : null; - } - } - - /** - * Returns parsed ResourceId object for a given resource id. - * - * @param id of the resource - * @return ResourceId object - */ - public static ResourceId fromString(String id) { - return new ResourceId(id); - } - - /** - * @return subscriptionId of the resource. - */ - public String subscriptionId() { - return this.subscriptionId; - } - - /** - * @return resourceGroupName of the resource. - */ - public String resourceGroupName() { - return this.resourceGroupName; - } - - /** - * @return name of the resource. - */ - public String name() { - return this.name; - } - - /** - * @return parent resource id of the resource if any, otherwise null. - */ - public ResourceId parent() { - if (this.id == null || this.parentId == null) { - return null; - } else { - return fromString(this.parentId); - } - } - - /** - * @return name of the provider. - */ - public String providerNamespace() { - return this.providerNamespace; - } - - /** - * @return type of the resource. - */ - public String resourceType() { - return this.resourceType; - } - - /** - * @return full type of the resource. - */ - public String fullResourceType() { - if (this.parentId == null) { - return this.providerNamespace + "/" + this.resourceType; - } else { - return this.parent().fullResourceType() + "/" + this.resourceType; - } - } - - /** - * @return the id of the resource. - */ - public String id() { - return id; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/ResourceUtils.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/ResourceUtils.java deleted file mode 100644 index ee84f04c0b4d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/ResourceUtils.java +++ /dev/null @@ -1,214 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.arm; - -import com.azure.resourcemanager.resources.models.Provider; -import com.azure.resourcemanager.resources.models.ProviderResourceType; - -import java.util.Locale; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -/** - * Utility methods for Azure resource IDs. - */ -public final class ResourceUtils { - private ResourceUtils() { - } - - /** - * Extract resource group from a resource ID string. - * - * @param id the resource ID string - * @return the resource group name - */ - public static String groupFromResourceId(String id) { - return (id != null) ? ResourceId.fromString(id).resourceGroupName() : null; - } - - /** - * Extract the subscription ID from a resource ID string. - * - * @param id the resource ID string - * @return the subscription ID - */ - public static String subscriptionFromResourceId(String id) { - return (id != null) ? ResourceId.fromString(id).subscriptionId() : null; - } - - /** - * Extract resource provider from a resource ID string. - * - * @param id the resource ID string - * @return the resource group name - */ - public static String resourceProviderFromResourceId(String id) { - return (id != null) ? ResourceId.fromString(id).providerNamespace() : null; - } - - /** - * Extract resource type from a resource ID string. - * - * @param id the resource ID string - * @return the resource type - */ - public static String resourceTypeFromResourceId(String id) { - return (id != null) ? ResourceId.fromString(id).resourceType() : null; - } - - /** - * Extract parent resource ID from a resource ID string. - * E.g. subscriptions/s/resourcegroups/r/foos/foo/bars/bar will return - * subscriptions/s/resourcegroups/r/foos/foo. - * - * @param id the resource ID string - * @return the parent resource ID - */ - public static String parentResourceIdFromResourceId(String id) { - if (id == null) { - return null; - } - ResourceId resourceId = ResourceId.fromString(id); - if (resourceId.parent() != null) { - return ResourceId.fromString(id).parent().id(); - } - - return null; - } - - /** - * Extract parent resource path from a resource ID string. - * E.g. subscriptions/s/resourcegroups/r/foos/foo/bars/bar will return foos/foo. - * - * @param id the resource ID string - * @return the parent resource ID - */ - public static String parentRelativePathFromResourceId(String id) { - if (id == null) { - return null; - } - - ResourceId parent = ResourceId.fromString(id).parent(); - if (parent != null) { - return parent.resourceType() + "/" + parent.name(); - } - - return ""; - } - - /** - * Extract the relative path to the current resource provider. - * E.g. subscriptions/sub1/resourceGroups/rg1/providers/Microsoft.Foo/foos/foo1 will return foos/foo1. - * - * @param id the id of the resource - * @return the relative path - */ - public static String relativePathFromResourceId(String id) { - if (id == null) { - return null; - } - String[] paths = id.split("/providers/" + resourceProviderFromResourceId(id) + "/", 2); - if (paths.length == 1) { - return ""; - } else { - return paths[1]; - } - } - - /** - * Extract information from a resource ID string with the resource type - * as the identifier. - * - * @param id the resource ID - * @param identifier the identifier to match, e.g. "resourceGroups", "storageAccounts" - * @return the information extracted from the identifier - */ - public static String extractFromResourceId(String id, String identifier) { - if (id == null || identifier == null) { - return id; - } - Pattern pattern = Pattern.compile(identifier + "/[-\\w._]+"); - Matcher matcher = pattern.matcher(id); - if (matcher.find()) { - return matcher.group().split("/")[1]; - } else { - return null; - } - } - - /** - * Extract name of the resource from a resource ID. - * - * @param id the resource ID - * @return the name of the resource - */ - public static String nameFromResourceId(String id) { - return (id != null) ? ResourceId.fromString(id).name() : null; - } - - /** - * Find out the default api version to make a REST request with from - * the resource provider. - * - * @param id the resource ID - * @param provider the resource provider - * @return the default api version to use - */ - public static String defaultApiVersion(String id, Provider provider) { - String resourceType = resourceTypeFromResourceId(id).toLowerCase(Locale.ROOT); - // Exact match - for (ProviderResourceType prt : provider.resourceTypes()) { - if (prt.resourceType().equalsIgnoreCase(resourceType)) { - return prt.apiVersions().get(0); - } - } - // child resource, e.g. sites/config - for (ProviderResourceType prt : provider.resourceTypes()) { - if (prt.resourceType().toLowerCase(Locale.ROOT).contains("/" + resourceType)) { - return prt.apiVersions().get(0); - } - } - // look for parent - String parentId = parentResourceIdFromResourceId(id); - if (parentId != null) { - return defaultApiVersion(parentId, provider); - } else { - // Fallback: use a random one, not guaranteed to work - return provider.resourceTypes().get(0).apiVersions().get(0); - } - } - - /** - * Creates a resource ID from information of a generic resource. - * - * @param subscriptionId the subscription UUID - * @param resourceGroupName the resource group name - * @param resourceProviderNamespace the resource provider namespace - * @param resourceType the type of the resource or nested resource - * @param resourceName name of the resource or nested resource - * @param parentResourcePath parent resource's relative path to the provider, - * if the resource is a generic resource - * @return the resource ID string - */ - public static String constructResourceId( - final String subscriptionId, - final String resourceGroupName, - final String resourceProviderNamespace, - final String resourceType, - final String resourceName, - final String parentResourcePath) { - String prefixedParentPath = parentResourcePath; - if (parentResourcePath != null && !parentResourcePath.isEmpty()) { - prefixedParentPath = "/" + parentResourcePath; - } - return String.format( - "/subscriptions/%s/resourcegroups/%s/providers/%s%s/%s/%s", - subscriptionId, - resourceGroupName, - resourceProviderNamespace, - prefixedParentPath, - resourceType, - resourceName); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/collection/SupportsBatchDeletion.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/collection/SupportsBatchDeletion.java deleted file mode 100644 index 29021980ad60..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/collection/SupportsBatchDeletion.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.arm.collection; - -import reactor.core.publisher.Flux; - -import java.util.Collection; - -/** - * Provides access to deleting multiple resources from Azure, identifying them by their IDs. - *

    - * (Note this interface is not intended to be implemented by user code.) - */ -public interface SupportsBatchDeletion { - /** - * Deletes the specified resources from Azure asynchronously and in parallel. - * - * @param ids resource IDs of the resources to be deleted - * @return a representation of the deferred computation of this call - * returning the resource ID of each successfully deleted resource - */ - Flux deleteByIdsAsync(Collection ids); - - /** - * Deletes the specified resources from Azure asynchronously and in parallel. - * - * @param ids resource IDs of the resources to be deleted - * @return a representation of the deferred computation of this call - * returning the resource ID of each successfully deleted resource - */ - Flux deleteByIdsAsync(String... ids); - - /** - * Deletes the specified resources from Azure. - * - * @param ids resource IDs of the resources to be deleted - */ - void deleteByIds(Collection ids); - - /** - * Deletes the specified resources from Azure. - * - * @param ids resource IDs of the resources to be deleted - */ - void deleteByIds(String... ids); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/collection/SupportsDeletingByParent.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/collection/SupportsDeletingByParent.java deleted file mode 100644 index d6c8b96da616..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/collection/SupportsDeletingByParent.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.arm.collection; - -import reactor.core.publisher.Mono; - -/** - * Provides access to getting a specific Azure resource based on its resource group and parent. - *

    - * (Note this interface is not intended to be implemented by user code.) - */ -public interface SupportsDeletingByParent { - /** - * Deletes a resource from Azure, identifying it by its name and its resource group. - * - * @param groupName The group the resource is part of - * @param parentName the name of parent resource. - * @param name The name of the resource - */ - void deleteByParent(String groupName, String parentName, String name); - - /** - * Asynchronously delete a resource from Azure, identifying it by its name and its resource group. - * - * @param groupName The group the resource is part of - * @param parentName the name of parent resource. - * @param name The name of the resource - * @return a representation of the deferred computation of this call - */ - Mono deleteByParentAsync(String groupName, String parentName, String name); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/collection/SupportsDeletingByResourceGroup.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/collection/SupportsDeletingByResourceGroup.java deleted file mode 100644 index 45d0dd5dfa91..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/collection/SupportsDeletingByResourceGroup.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.arm.collection; - -import reactor.core.publisher.Mono; - -/** - * Provides access to deleting a resource from Azure, identifying it by its name and its resource group. - *

    - * (Note this interface is not intended to be implemented by user code.) - */ -public interface SupportsDeletingByResourceGroup { - /** - * Deletes a resource from Azure, identifying it by its name and its resource group. - * - * @param resourceGroupName the resource group the resource is part of - * @param name the name of the resource - */ - void deleteByResourceGroup(String resourceGroupName, String name); - - /** - * Asynchronously delete a resource from Azure, identifying it by its name and its resource group. - * - * @param resourceGroupName the resource group the resource is part of - * @param name the name of the resource - * @return a representation of the deferred computation of this call - */ - Mono deleteByResourceGroupAsync(String resourceGroupName, String name); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/collection/SupportsGettingById.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/collection/SupportsGettingById.java deleted file mode 100644 index a0c3ca3dbc12..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/collection/SupportsGettingById.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.arm.collection; - -import reactor.core.publisher.Mono; - -/** - * Provides access to getting a specific Azure resource based on its resource ID. - *

    - * (Note this interface is not intended to be implemented by user code.) - * - * @param the type of the resource collection - */ -public interface SupportsGettingById { - /** - * Gets the information about a resource from Azure based on the resource id. - * - * @param id the id of the resource. - * @return an immutable representation of the resource - */ - T getById(String id); - - /** - * Gets the information about a resource from Azure based on the resource id. - * - * @param id the id of the resource. - * @return a {@link Mono} that emits the found resource asynchronously - */ - Mono getByIdAsync(String id); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/collection/SupportsGettingByName.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/collection/SupportsGettingByName.java deleted file mode 100644 index cf633a6e3a16..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/collection/SupportsGettingByName.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - - -package com.azure.resourcemanager.resources.fluentcore.arm.collection; - - -import reactor.core.publisher.Mono; - -/** - * Provides access to getting a specific Azure resource based on its name within the current resource group. - *

    - * (Note this interface is not intended to be implemented by user code.) - * - * @param the type of the resource collection - */ -public interface SupportsGettingByName { - /** - * Gets the information about a resource from Azure based on the resource name within the current resource group. - * - * @param name the name of the resource. (Note, this is not the resource ID.) - * @return An immutable representation of the resource - */ - T getByName(String name); - - - /** - * Gets the information about a resource based on the resource name ithin the current resource group. - * - * @param name The name of the resource. (Note, this is not the resource ID.) - * @return A {@link Mono} that emits the found resource asynchronously - */ - Mono getByNameAsync(String name); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/collection/SupportsGettingByParent.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/collection/SupportsGettingByParent.java deleted file mode 100644 index ed9b4ca1f370..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/collection/SupportsGettingByParent.java +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.arm.collection; - -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.models.Resource; -import reactor.core.publisher.Mono; - -/** - * Provides access to getting a specific Azure resource based on its resource group and parent. - *

    - * (Note this interface is not intended to be implemented by user code.) - * - * @param the type of the resource collection - * @param the parent resource type - * @param the client manager type representing the service - */ -public interface SupportsGettingByParent { - /** - * Gets the information about a resource from Azure based on the resource id. - * - * @param resourceGroup the name of resource group - * @param parentName the name of parent resource - * @param name the name of resource - * @return an immutable representation of the resource - */ - T getByParent(String resourceGroup, String parentName, String name); - - /** - * Gets the information about a resource from Azure based on the resource id. - * - * @param parentResource the instance of parent resource - * @param name the name of resource - * @return an immutable representation of the resource - */ - T getByParent(ParentT parentResource, String name); - - /** - * Gets the information about a resource from Azure based on the resource id. - * - * @param resourceGroup the name of resource group - * @param parentName the name of parent resource - * @param name the name of resource - * @return a {@link Mono} that emits the found resource asynchronously. - */ - Mono getByParentAsync(String resourceGroup, String parentName, String name); - - /** - * Gets the information about a resource from Azure based on the resource id. - * - * @param parentResource the instance of parent resource. - * @param name the name of resource. - * @return a {@link Mono} that emits the found resource asynchronously. - */ - Mono getByParentAsync(ParentT parentResource, String name); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/collection/SupportsGettingByResourceGroup.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/collection/SupportsGettingByResourceGroup.java deleted file mode 100644 index 6b0d0d129d41..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/collection/SupportsGettingByResourceGroup.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.arm.collection; - -import reactor.core.publisher.Mono; - -/** - * Provides access to getting a specific Azure resource based on its name and resource group. - *

    - * (Note this interface is not intended to be implemented by user code.) - * - * @param the type of the resource to get. - */ -public interface SupportsGettingByResourceGroup { - /** - * Gets the information about a resource from Azure based on the resource name and the name of its resource group. - * - * @param resourceGroupName the name of the resource group the resource is in - * @param name the name of the resource. (Note, this is not the ID) - * @return an immutable representation of the resource - */ - T getByResourceGroup(String resourceGroupName, String name); - - /** - * Gets the information about a resource from Azure based on the resource name and the name of its resource group. - * - * @param resourceGroupName the name of the resource group the resource is in - * @param name the name of the resource. (Note, this is not the ID) - * @return a {@link Mono} that emits the found resource asynchronously. - */ - Mono getByResourceGroupAsync(String resourceGroupName, String name); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/collection/SupportsListingByParent.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/collection/SupportsListingByParent.java deleted file mode 100644 index d3d997a5fc6c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/collection/SupportsListingByParent.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.arm.collection; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.models.Resource; - -/** - * Provides access to listing Azure resources of a specific type in a specific parent resource. - *

    - * (Note this interface is not intended to be implemented by user code.) - * - * @param the type of the resources listed - * @param the type of the parent resource - * @param the client manager type representing the service - */ -public interface SupportsListingByParent { - /** - * Lists resources of the specified type in the specified parent resource. - * - * @param resourceGroupName the name of the resource group to list the resources from - * @param parentName the name of parent resource. - * @return the list of resources - */ - PagedIterable listByParent(String resourceGroupName, String parentName); - - /** - * Lists resources of the specified type in the specified parent resource. - * - * @param parentResource the instance of parent resource. - * @return the list of resources - */ - PagedIterable listByParent(ParentT parentResource); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/collection/SupportsListingByResourceGroup.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/collection/SupportsListingByResourceGroup.java deleted file mode 100644 index ab3a092bf663..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/collection/SupportsListingByResourceGroup.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.arm.collection; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; - -/** - * Provides access to listing Azure resources of a specific type in a specific resource group. - *

    - * (Note this interface is not intended to be implemented by user code.) - * - * @param the type of the resources listed. - */ -public interface SupportsListingByResourceGroup { - /** - * Lists resources of the specified type in the specified resource group. - * - * @param resourceGroupName the name of the resource group to list the resources from - * @return the list of resources - */ - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Lists resources of the specified type in the specified resource group. - * - * @param resourceGroupName the name of the resource group to list the resources from - * @return the {@link PagedFlux} of the resources - */ - PagedFlux listByResourceGroupAsync(String resourceGroupName); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/collection/SupportsListingInResourceGroupByTag.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/collection/SupportsListingInResourceGroupByTag.java deleted file mode 100644 index 4f408560d57c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/collection/SupportsListingInResourceGroupByTag.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.arm.collection; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; - -/** - * Provides access to listing Azure resources of a specific type based on their tag. - *

    - * (Note: this interface is not intended to be implemented by user code) - * - * @param the fluent type of the resource - */ -public interface SupportsListingInResourceGroupByTag { - /** - * Lists all the resources with the specified tag. - * - * @param resourceGroupName the name of the resource group - * @param tagName tag's name as the key - * @param tagValue tag's value - * @return the list of resources - */ - PagedIterable listByTag(String resourceGroupName, String tagName, String tagValue); - - /** - * Lists all the resources with the specified tag. - * - * @param resourceGroupName the name of the resource group - * @param tagName tag's name as the key - * @param tagValue tag's value - * @return a {@link PagedFlux} of the requested resources - */ - PagedFlux listByTagAsync(String resourceGroupName, String tagName, String tagValue); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/collection/implementation/BatchDeletionImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/collection/implementation/BatchDeletionImpl.java deleted file mode 100644 index 5a2372806236..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/collection/implementation/BatchDeletionImpl.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation; - -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils; -import com.azure.resourcemanager.resources.fluentcore.exception.AggregatedManagementException; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -import java.util.Collection; -import java.util.function.BiFunction; - -/** - * Utility class for batch deletion. - */ -public class BatchDeletionImpl { - - /** - * Batch delete by resource IDs. - * - * @param ids collection of resource IDs. - * @param deleteByGroupAndNameAsync Function to delete by resourceGroupName and name. - * @return Flux of IDs that successfully deleted. - */ - public static Flux deleteByIdsAsync(Collection ids, - BiFunction> deleteByGroupAndNameAsync) { - if (ids == null || ids.isEmpty()) { - return Flux.empty(); - } else { - return Flux.fromIterable(ids) - .flatMapDelayError(id -> { - final String resourceGroupName = ResourceUtils.groupFromResourceId(id); - final String name = ResourceUtils.nameFromResourceId(id); - return deleteByGroupAndNameAsync.apply(resourceGroupName, name).then(Mono.just(id)); - }, 32, 32) - .onErrorMap(AggregatedManagementException::convertToManagementException) - .subscribeOn(ResourceManagerUtils.InternalRuntimeContext.getReactorScheduler()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/collection/implementation/CreatableResourcesImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/collection/implementation/CreatableResourcesImpl.java deleted file mode 100644 index 8b64e8ee02d0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/collection/implementation/CreatableResourcesImpl.java +++ /dev/null @@ -1,253 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation; - -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsBatchCreation; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.CreatedResources; -import com.azure.resourcemanager.resources.fluentcore.model.Indexable; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.CreatableUpdatableImpl; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; - -/** - * Base class for creatable resource collection, - * i.e. those where the member of the collection is of Resource type and are creatable. - * (Internal use only) - * - * @param the individual resource type returned - * @param the individual resource implementation - * @param the wrapper inner type - */ -public abstract class CreatableResourcesImpl - extends CreatableWrappersImpl - implements - SupportsBatchCreation { - - protected CreatableResourcesImpl() { - } - - @Override - @SafeVarargs - public final CreatedResources create(Creatable... creatables) { - return createAsyncNonStream(creatables) - .block(); - } - - @Override - public final CreatedResources create(List> creatables) { - return createAsyncNonStream(creatables) - .block(); - } - - @Override - @SuppressWarnings("unchecked") - public final Flux createAsync(Creatable... creatables) { - return createAsync(Arrays.asList(creatables)); - } - - @Override - public final Flux createAsync(List> creatables) { - if (creatables == null) { - return Flux.empty(); - } - return createWithRootResourceAsync(creatables) - .flatMapMany(rootResource -> Flux.fromIterable(rootResource.createdTopLevelResources())); - } - - private Mono> createAsyncNonStream(List> creatables) { - return createWithRootResourceAsync(creatables) - .map(CreatedResourcesImpl::new); - } - - @SuppressWarnings("unchecked") - private Mono> createAsyncNonStream(Creatable... creatables) { - return createAsyncNonStream(Arrays.asList(creatables)); - } - - private Mono> createWithRootResourceAsync( - List> creatables) { - CreatableUpdatableResourcesRootImpl rootResource = new CreatableUpdatableResourcesRootImpl<>(); - rootResource.addCreatableDependencies(creatables); - return rootResource.createAsync(); - } - - /** - * Implements CreatedResources. - * - * @param the type of the resources in the batch. - */ - private class CreatedResourcesImpl - implements CreatedResources { - private final ClientLogger logger = new ClientLogger(this.getClass()); - private CreatableUpdatableResourcesRoot creatableUpdatableResourcesRoot; - private Map resources = new HashMap<>(); - - CreatedResourcesImpl(CreatableUpdatableResourcesRoot creatableUpdatableResourcesRoot) { - this.creatableUpdatableResourcesRoot = creatableUpdatableResourcesRoot; - for (ResourceT resource : this.creatableUpdatableResourcesRoot.createdTopLevelResources()) { - resources.put(resource.key(), resource); - } - } - - @Override - public Indexable createdRelatedResource(String key) { - return this.creatableUpdatableResourcesRoot.createdRelatedResource(key); - } - - @Override - public void clear() { - throw logger.logExceptionAsError(new UnsupportedOperationException()); - } - - @Override - public Set keySet() { - return resources.keySet(); - } - - @Override - public Collection values() { - return resources.values(); - } - - @Override - public Set> entrySet() { - return resources.entrySet(); - } - - @Override - public int size() { - return resources.size(); - } - - @Override - public boolean isEmpty() { - return resources.isEmpty(); - } - - @Override - public boolean containsKey(Object key) { - return resources.containsKey(key); - } - - @Override - public boolean containsValue(Object value) { - return resources.containsValue(value); - } - - @Override - public ResourceT get(Object key) { - return resources.get(key); - } - - @Override - public ResourceT put(String key, ResourceT value) { - throw logger.logExceptionAsError(new UnsupportedOperationException()); - } - - @Override - public ResourceT remove(Object key) { - throw logger.logExceptionAsError(new UnsupportedOperationException()); - } - - @Override - public void putAll(Map m) { - throw logger.logExceptionAsError(new UnsupportedOperationException()); - } - } - - /** - * The local root resource that is used as dummy parent resource for the batch creatable resources - * added via SupportsBatchCreation.create() or CreatableResourcesImpl#createAsync. - * - * @param the type of the resources in the batch. - */ - interface CreatableUpdatableResourcesRoot extends Indexable { - List createdTopLevelResources(); - - Indexable createdRelatedResource(String key); - } - - /** - * Implementation of CreatableUpdatableResourcesRoot. - * - * @param the type of the resources in the batch. - */ - private class CreatableUpdatableResourcesRootImpl - extends CreatableUpdatableImpl, - Object, - CreatableUpdatableResourcesRootImpl> - implements CreatableUpdatableResourcesRoot { - /** - * Collection of keys of top level resources in this batch. - */ - private List keys; - - CreatableUpdatableResourcesRootImpl() { - super("CreatableUpdatableResourcesRoot", null); - this.keys = new ArrayList<>(); - } - - @SuppressWarnings("unchecked") - @Override - public List createdTopLevelResources() { - List resources = new ArrayList<>(); - for (String resourceKey : keys) { - resources.add(this.taskResult(resourceKey)); - } - return Collections.unmodifiableList(resources); - } - - @Override - public Indexable createdRelatedResource(String key) { - return this.taskResult(key); - } - - @SuppressWarnings("unchecked") - void addCreatableDependencies(Creatable... creatables) { - for (Creatable item : creatables) { - this.keys.add(this.addDependency(item)); - } - } - - void addCreatableDependencies(List> creatables) { - for (Creatable item : creatables) { - this.keys.add(this.addDependency(item)); - } - } - - @Override - public Mono> createResourceAsync() { - return Mono.just((CreatableUpdatableResourcesRoot) this); - } - - @Override - public Mono> updateResourceAsync() { - return createResourceAsync(); - } - - @Override - public boolean isInCreateMode() { - return true; - } - - // Below overrides returns null as this is not a real resource in Azure - // but a dummy resource representing parent of a batch of creatable Azure - // resources. - @Override - protected Mono getInnerAsync() { - return null; - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/collection/implementation/CreatableWrappersImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/collection/implementation/CreatableWrappersImpl.java deleted file mode 100644 index ab2c375d8fb8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/collection/implementation/CreatableWrappersImpl.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation; - -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingById; - -/** - * Base class for creatable wrapper collections, i.e. those where a new member of the collection can be created. - * (Internal use only) - * - * @param the individual resource type returned - * @param the individual resource implementation - * @param the wrapper inner type - */ -public abstract class CreatableWrappersImpl - extends ReadableWrappersImpl - implements - // Assume anything creatable is deletable - SupportsDeletingById { - - protected CreatableWrappersImpl() { - } - - protected abstract ImplT wrapModel(String name); - - @Override - public void deleteById(String id) { - deleteByIdAsync(id).block(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/collection/implementation/ExternalChildResourceCollectionImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/collection/implementation/ExternalChildResourceCollectionImpl.java deleted file mode 100644 index 6c5d3bba8b6a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/collection/implementation/ExternalChildResourceCollectionImpl.java +++ /dev/null @@ -1,244 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation; - -import com.azure.resourcemanager.resources.fluentcore.arm.models.ExternalChildResource; -import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.ExternalChildResourceImpl; -import com.azure.resourcemanager.resources.fluentcore.dag.TaskGroup; -import reactor.core.Exceptions; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; -import reactor.core.publisher.Sinks; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.concurrent.ConcurrentMap; -import java.util.concurrent.ConcurrentSkipListMap; - -/** - * Base class for cached {@link ExternalChildResourcesCachedImpl} - * and non-cached {@link ExternalChildResourcesNonCachedImpl} - * externalized child resource collection. - * (Internal use only) - * - * @param the implementation of {@param FluentModelT} - * @param the fluent model type of the child resource - * @param Azure inner resource class type representing the child resource - * @param the parent Azure resource impl class type that implements {@link ParentT} - * @param the parent interface - */ -public abstract class ExternalChildResourceCollectionImpl< - FluentModelTImpl extends ExternalChildResourceImpl, - FluentModelT extends ExternalChildResource, - InnerModelT, - ParentImplT extends ParentT, - ParentT> { - /** - * The parent resource of this collection of child resources. - */ - private final ParentImplT parent; - /** - * the TaskGroup of parent resource. This is used to schedule the "post run" works - * when post run is enabled via {@link this#enablePostRunMode()} - */ - private final TaskGroup parentTaskGroup; - /** - * The child resource instances that this collection contains. - */ - protected ConcurrentMap childCollection = new ConcurrentSkipListMap<>(); - /** - * Indicates how the pending operations on the child resources are performed, true - * if operations are performed through "post run" task, false if operations are - * performed via explicit call to {@link this#commitAsync()}. - */ - private boolean isPostRunMode; - - /** - * Used to construct error string, this is user friendly name of the child resource (e.g. Subnet, Extension). - */ - protected final String childResourceName; - - /** - * Creates a new ExternalChildResourcesImpl. - * - * @param parent the parent Azure resource - * @param parentTaskGroup the TaskGroup the parent Azure resource belongs to - * @param childResourceName the child resource name - */ - protected ExternalChildResourceCollectionImpl(ParentImplT parent, - TaskGroup parentTaskGroup, String childResourceName) { - this.parent = parent; - this.parentTaskGroup = parentTaskGroup; - this.childResourceName = childResourceName; - this.isPostRunMode = true; - } - - /** - * Indicates that the pending operations on the resources are performed as "post run" tasks. - */ - public void enablePostRunMode() { - this.isPostRunMode = true; - } - - /** - * Indicates that the pending operations on the resources are performed via explicit call to - * {@link this#commitAsync()}. - */ - public void enableCommitMode() { - this.isPostRunMode = false; - } - - /** - * Clear the child collection. - */ - public void clear() { - for (FluentModelTImpl child : childCollection.values()) { - child.clear(); - } - this.childCollection.clear(); - } - - /** - * Mark the given child resource as the post run dependent of the parent of this collection. - * - * @param childResource the child resource - */ - protected FluentModelTImpl prepareForFutureCommitOrPostRun(FluentModelTImpl childResource) { - if (this.isPostRunMode) { - if (!childResource.taskGroup().dependsOn(this.parentTaskGroup)) { - this.parentTaskGroup.addPostRunDependentTaskGroup(childResource.taskGroup()); - } - } - return childResource; - } - - /** - * Commits the changes in the external child resource childCollection. - *

    - * This method returns a Flux stream, its Flux's onNext will be called for each successfully - * committed resource followed by one call to 'onCompleted' or one call to 'onError' with a - * {@link RuntimeException} containing the list of exceptions where each exception describes the reason - * for failure of a resource commit. - * - * @return the Flux stream - */ - public Flux commitAsync() { - if (this.isPostRunMode) { - return Flux.error( - new IllegalStateException("commitAsync() cannot be invoked when 'post run' mode is enabled")); - } - - final ExternalChildResourceCollectionImpl - self = this; - List items = new ArrayList<>(); - for (FluentModelTImpl item : this.childCollection.values()) { - items.add(item); - } - - final List exceptionsList = Collections.synchronizedList(new ArrayList<>()); - final List successfullyRemoved = new ArrayList<>(); - - Sinks.Many aggregatedErrorStream = Sinks.many().replay().all(); - Flux deleteStream = Flux.fromIterable(items) - .filter(childResource -> - childResource.pendingOperation() == ExternalChildResourceImpl.PendingOperation.ToBeRemoved) - .flatMap(childResource -> childResource.deleteResourceAsync() - .map(response -> childResource) - .doOnSuccess(fluentModelT -> { - childResource.setPendingOperation(ExternalChildResourceImpl.PendingOperation.None); - self.childCollection.remove(childResource.name()); - successfullyRemoved.add(childResource); - }) - .onErrorResume(throwable -> { - exceptionsList.add(throwable); - return Mono.empty(); - })); - - Flux createStream = Flux.fromIterable(items) - .filter(childResource -> - childResource.pendingOperation() == ExternalChildResourceImpl.PendingOperation.ToBeCreated) - .flatMap(childResource -> childResource.createResourceAsync() - .map(fluentModelT -> childResource) - .doOnNext(fluentModelT -> - childResource.setPendingOperation(ExternalChildResourceImpl.PendingOperation.None)) - .onErrorResume(throwable -> { - self.childCollection.remove(childResource.name()); - exceptionsList.add(throwable); - return Mono.empty(); - })); - - Flux updateStream = Flux.fromIterable(items) - .filter(childResource -> - childResource.pendingOperation() == ExternalChildResourceImpl.PendingOperation.ToBeUpdated) - .flatMap(childResource -> childResource.updateResourceAsync() - .map(e -> childResource) - .doOnNext(resource -> - resource.setPendingOperation(ExternalChildResourceImpl.PendingOperation.None)) - .onErrorResume(throwable -> { - exceptionsList.add(throwable); - return Mono.empty(); - })); - - Flux operationsStream = Flux.merge(deleteStream, createStream, updateStream) - .doOnTerminate(() -> { - if (clearAfterCommit()) { - self.childCollection.clear(); - } - if (successfullyRemoved.size() > 0) { - for (FluentModelTImpl removed : successfullyRemoved) { - aggregatedErrorStream.tryEmitNext(removed); - } - } - if (!exceptionsList.isEmpty()) { - aggregatedErrorStream.tryEmitError(Exceptions.multiple(exceptionsList)); - } else { - aggregatedErrorStream.tryEmitComplete(); - } - }); - return Flux.concat(operationsStream, aggregatedErrorStream.asFlux()); - } - - /** - * Commits the changes in the external child resource childCollection. - *

    - * This method returns a observable stream, either its observer's onError will be called with - * {@link RuntimeException} if some resources failed to commit or onNext will be called if all resources - * committed successfully. - * - * @return the Mono stream - */ - public Mono> commitAndGetAllAsync() { - return commitAsync().collect(() -> new ArrayList(), - (state, item) -> state.add(item)); - } - - - /** - * Finds a child resource with the given key. - * - * @param key the child resource key - * @return null if no child resource exists with the given name else the child resource - */ - protected FluentModelTImpl find(String key) { - for (Map.Entry entry : this.childCollection.entrySet()) { - if (entry.getKey().equalsIgnoreCase(key)) { - return entry.getValue(); - } - } - return null; - } - - /** - * @return the parent Azure resource of the external child resource - */ - protected ParentImplT getParent() { - return parent; - } - - /** - * @return true if the child resource collection needs to be cleared after the commit. - */ - protected abstract boolean clearAfterCommit(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/collection/implementation/ExternalChildResourcesCachedImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/collection/implementation/ExternalChildResourcesCachedImpl.java deleted file mode 100644 index c677e24a48ae..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/collection/implementation/ExternalChildResourcesCachedImpl.java +++ /dev/null @@ -1,237 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation; - -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.resources.fluentcore.arm.models.ExternalChildResource; -import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.ExternalChildResourceImpl; -import com.azure.resourcemanager.resources.fluentcore.dag.TaskGroup; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -import java.util.List; -import java.util.Map; - -/** - * Externalized cache-able child resource collection abstract implementation. - * (Internal use only) - *

    - * An external child resource collection is considered as cache-able when it is present as an inline - * property of it's parent resource. - * Consider using non-cached version {@link ExternalChildResourcesNonCachedImpl} if the child resources - * are not present in the parent payload, using cached version in this case requires fetching the child resource - * using separate GET call, that can be expensive if the child resources are pagable. - * - * @param the implementation of {@param FluentModelT} - * @param the fluent model type of the child resource - * @param Azure inner resource class type representing the child resource - * @param the parent Azure resource impl class type that implements {@link ParentT} - * @param the parent interface - */ -public abstract class ExternalChildResourcesCachedImpl< - FluentModelTImpl extends ExternalChildResourceImpl, - FluentModelT extends ExternalChildResource, - InnerModelT, - ParentImplT extends ParentT, - ParentT> - extends ExternalChildResourceCollectionImpl { - private final ClientLogger logger = new ClientLogger(this.getClass()); - private static final String ERROR_MESSAGE_FORMAT = "A child resource ('%s') with name (key) '%s (%s)' %s"; - /** - * Creates a new ExternalChildResourcesImpl. - * - * @param parent the parent Azure resource - * @param parentTaskGroup the TaskGroup the parent Azure resource belongs to - * @param childResourceName the child resource name - */ - protected ExternalChildResourcesCachedImpl(ParentImplT parent, - TaskGroup parentTaskGroup, String childResourceName) { - super(parent, parentTaskGroup, childResourceName); - } - - /** - * Refresh the child resource collection. - */ - public Mono refreshAsync() { - return cacheCollectionAsync(); - } - - /** - * Refresh the child resource collection. - */ - public void refresh() { - cacheCollection(); - } - - /** - * @return the childCollection of external child resources. - */ - protected Map collection() { - return this.childCollection; - } - - /** - * Prepare for independent definition of a new external child resource (without the parent context). - * - * @param name the name of the new external child resource - * @return the external child resource prepared for create - */ - protected final FluentModelTImpl prepareIndependentDefine(String name) { - FluentModelTImpl childResource = newChildResource(name); - childResource.setPendingOperation(ExternalChildResourceImpl.PendingOperation.ToBeCreated); - return childResource; - } - - /** - * Prepare for inline definition of a new external child resource - * (along with the definition or update of parent resource). - * - * @param name the name for the new external child resource - * @return the child resource - */ - protected FluentModelTImpl prepareInlineDefine(String name) { - return prepareInlineDefine(name, name); - } - - /** - * Prepare for inline definition of a new external child resource - * (along with the definition or update of parent resource). - * - * @param name the name of the new external child resource - * @param key the key - * @return the child resource - */ - protected final FluentModelTImpl prepareInlineDefine(String name, String key) { - if (find(key) != null) { - String errorMessage = String.format(ERROR_MESSAGE_FORMAT, childResourceName, name, key, "already exists"); - throw logger.logExceptionAsError(new IllegalArgumentException(errorMessage)); - } - FluentModelTImpl childResource = newChildResource(name); - childResource.setPendingOperation(ExternalChildResourceImpl.PendingOperation.ToBeCreated); - return super.prepareForFutureCommitOrPostRun(childResource); - } - - /** - * Prepare for inline update of an external child resource (along with the update of parent resource). - * - * @param name the name of the external child resource - * @return the external child resource to be updated - */ - protected final FluentModelTImpl prepareInlineUpdate(String name) { - return prepareInlineUpdate(name, name); - } - - /** - * Prepare for inline update of an external child resource (along with the update of parent resource). - * - * @param name the name of the external child resource - * @param key the key - * @return the external child resource to be updated - */ - protected final FluentModelTImpl prepareInlineUpdate(String name, String key) { - FluentModelTImpl childResource = find(key); - if (childResource == null - || childResource.pendingOperation() == ExternalChildResourceImpl.PendingOperation.ToBeCreated) { - String errorMessage = String.format(ERROR_MESSAGE_FORMAT, childResourceName, name, key, "not found"); - throw logger.logExceptionAsError(new IllegalArgumentException(errorMessage)); - } - if (childResource.pendingOperation() == ExternalChildResourceImpl.PendingOperation.ToBeRemoved) { - String errorMessage = String.format(ERROR_MESSAGE_FORMAT, - childResourceName, name, key, "is marked for deletion"); - throw logger.logExceptionAsError(new IllegalArgumentException(errorMessage)); - } - childResource.setPendingOperation(ExternalChildResourceImpl.PendingOperation.ToBeUpdated); - return super.prepareForFutureCommitOrPostRun(childResource); - } - - /** - * Prepare for inline removal of an external child resource (along with the update of parent resource). - * - * @param name the name of the external child resource - */ - protected final void prepareInlineRemove(String name) { - prepareInlineRemove(name, name); - } - - /** - * Prepare for inline removal of an external child resource (along with the update of parent resource). - * - * @param name the name of the external child resource - * @param key the key - */ - protected final void prepareInlineRemove(String name, String key) { - FluentModelTImpl childResource = find(key); - if (childResource == null - || childResource.pendingOperation() == ExternalChildResourceImpl.PendingOperation.ToBeCreated) { - String errorMessage = String.format(ERROR_MESSAGE_FORMAT, childResourceName, name, key, "not found"); - throw logger.logExceptionAsError(new IllegalArgumentException(errorMessage)); - } - childResource.setPendingOperation(ExternalChildResourceImpl.PendingOperation.ToBeRemoved); - super.prepareForFutureCommitOrPostRun(childResource); - } - - /** - * Adds an external child resource to the childCollection. - * - * @param childResource the external child resource - */ - protected void addChildResource(FluentModelTImpl childResource) { - this.addChildResource(childResource.name(), childResource); - } - - /** - * Adds an external child resource to the childCollection. - * - * @param key the key - * @param childResource the external child resource - */ - protected void addChildResource(String key, FluentModelTImpl childResource) { - this.childCollection.put(key, childResource); - } - - /** - * Initializes the external child resource collection. - */ - protected void cacheCollection() { - this.clear(); - this.listChildResources() - .forEach(childResource -> this.childCollection.put(childResource.childResourceKey(), childResource)); - } - - /** - * Initializes the external child resource collection. - */ - protected Mono cacheCollectionAsync() { - this.clear(); - return this.listChildResourcesAsync() - .doOnNext(childResource -> this.childCollection.put(childResource.childResourceKey(), childResource)) - .then(); - } - - @Override - protected final boolean clearAfterCommit() { - return false; - } - - /** - * Gets the list of external child resources. - * - * @return the list of external child resources - */ - protected abstract List listChildResources(); - - /** - * Gets the list of external child resources. - * - * @return the list of external child resources - */ - protected abstract Flux listChildResourcesAsync(); - - /** - * Gets a new external child resource model instance. - * - * @param name the name for the new child resource - * @return the new child resource - */ - protected abstract FluentModelTImpl newChildResource(String name); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/collection/implementation/ExternalChildResourcesNonCachedImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/collection/implementation/ExternalChildResourcesNonCachedImpl.java deleted file mode 100644 index f33ea95de61f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/collection/implementation/ExternalChildResourcesNonCachedImpl.java +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation; - -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.resources.fluentcore.arm.models.ExternalChildResource; -import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.ExternalChildResourceImpl; -import com.azure.resourcemanager.resources.fluentcore.dag.TaskGroup; - -/** - * Externalized non cache-able child resource collection abstract implementation. - * (Internal use only) - *

    - * An external child resource collection is considered as non cache-able when it is not present as an inline - * property of its parent resource i.e. a separate call is required to fetch them. - * Consider using the cached version {@link ExternalChildResourcesCachedImpl} if the external child resources - * present in the parent payload, in case of update this can save addition GET operation required before the - * child resource PUT if PATCH is not supported. - * - * @param the implementation of {@param FluentModelT} - * @param the fluent model type of the child resource - * @param Azure inner resource class type representing the child resource - * @param the parent Azure resource impl class type that implements {@link ParentT} - * @param the parent interface - */ -public abstract class ExternalChildResourcesNonCachedImpl< - FluentModelTImpl extends ExternalChildResourceImpl, - FluentModelT extends ExternalChildResource, - InnerModelT, - ParentImplT extends ParentT, - ParentT> - extends ExternalChildResourceCollectionImpl { - private ClientLogger logger = new ClientLogger(this.getClass()); - /** - * Creates a new ExternalNonInlineChildResourcesImpl. - * - * @param parent the parent Azure resource - * @param parentTaskGroup the TaskGroup the parent Azure resource belongs to - * @param childResourceName the child resource name - */ - protected ExternalChildResourcesNonCachedImpl(ParentImplT parent, - TaskGroup parentTaskGroup, String childResourceName) { - super(parent, parentTaskGroup, childResourceName); - } - - /** - * Prepare the given model of an external child resource for independent definition (without the parent context). - * - * @param model the model to prepare for independent create definition - * @return the external child resource prepared for create - */ - protected final FluentModelTImpl prepareIndependentDefine(FluentModelTImpl model) { - model.setPendingOperation(ExternalChildResourceImpl.PendingOperation.ToBeCreated); - return model; - } - - /** - * Prepare the given model of an external child resource for inline create - * (along with the definition or update of parent resource). - * - * @param model the model to track create changes - * @return the external child resource prepared for create - */ - protected final FluentModelTImpl prepareInlineDefine(FluentModelTImpl model) { - FluentModelTImpl childResource = find(model.childResourceKey()); - if (childResource != null) { - pendingOperationException(model.name(), model.childResourceKey()); - } - model.setPendingOperation(ExternalChildResourceImpl.PendingOperation.ToBeCreated); - this.childCollection.put(model.childResourceKey(), model); - return super.prepareForFutureCommitOrPostRun(model); - } - - /** - * Prepare the given model of an external child resource for inline update - * (along with the definition or update of parent resource). - * - * @param model the model to track update changes - * @return the external child resource prepared for update - */ - protected final FluentModelTImpl prepareInlineUpdate(FluentModelTImpl model) { - FluentModelTImpl childResource = find(model.childResourceKey()); - if (childResource != null) { - pendingOperationException(model.name(), model.childResourceKey()); - } - model.setPendingOperation(ExternalChildResourceImpl.PendingOperation.ToBeUpdated); - this.childCollection.put(model.childResourceKey(), model); - return super.prepareForFutureCommitOrPostRun(model); - } - - /** - * Prepare the given model of an external child resource for inline removal - * (along with the definition or update of parent resource). - * - * @param model the model representing child resource to remove - */ - protected final void prepareInlineRemove(FluentModelTImpl model) { - FluentModelTImpl childResource = find(model.childResourceKey()); - if (childResource != null) { - pendingOperationException(model.name(), model.childResourceKey()); - } - model.setPendingOperation(ExternalChildResourceImpl.PendingOperation.ToBeRemoved); - this.childCollection.put(model.childResourceKey(), model); - super.prepareForFutureCommitOrPostRun(model); - } - - @Override - protected final boolean clearAfterCommit() { - return true; - } - - private void pendingOperationException(String name, String key) { - String errorMessage = String.format( - "There is already an operation pending on the child resource ('%s') with name (key) '%s (%s)'", - childResourceName, name, key); - throw logger.logExceptionAsError(new IllegalArgumentException(errorMessage)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/collection/implementation/GroupableResourcesImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/collection/implementation/GroupableResourcesImpl.java deleted file mode 100644 index d57883361dae..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/collection/implementation/GroupableResourcesImpl.java +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation; - -import com.azure.core.management.Resource; -import com.azure.core.util.CoreUtils; -import com.azure.resourcemanager.resources.fluentcore.arm.Manager; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceId; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsDeletingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.models.GroupableResource; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import reactor.core.publisher.Mono; - -/** - * Base class for resource collection classes. - * (Internal use only) - * - * @param the individual resource type returned - * @param the individual resource implementation - * @param the wrapper inner type - * @param the inner type of the collection object - * @param the manager type for this resource provider type - */ -public abstract class GroupableResourcesImpl< - T extends GroupableResource, - ImplT extends T, - InnerT extends Resource, - InnerCollectionT, - ManagerT extends Manager> - extends CreatableResourcesImpl - implements - SupportsGettingById, - SupportsGettingByResourceGroup, - SupportsDeletingByResourceGroup, - HasManager { - - private final InnerCollectionT innerCollection; - private final ManagerT myManager; - - protected GroupableResourcesImpl( - InnerCollectionT innerCollection, - ManagerT manager) { - this.innerCollection = innerCollection; - this.myManager = manager; - } - - public InnerCollectionT inner() { - return this.innerCollection; - } - - @Override - public ManagerT manager() { - return this.myManager; - } - - @Override - public T getById(String id) { - return getByIdAsync(id).block(); - } - - @Override - public Mono getByIdAsync(String id) { - if (CoreUtils.isNullOrEmpty(id)) { - return Mono.error( - new IllegalArgumentException("Parameter 'id' is required and cannot be null.")); - } - ResourceId resourceId = ResourceId.fromString(id); - - return getByResourceGroupAsync(resourceId.resourceGroupName(), resourceId.name()); - } - - @Override - public final void deleteByResourceGroup(String groupName, String name) { - deleteByResourceGroupAsync(groupName, name).block(); - } - - @Override - public Mono deleteByResourceGroupAsync(String resourceGroupName, String name) { - if (CoreUtils.isNullOrEmpty(resourceGroupName)) { - return Mono.error( - new IllegalArgumentException("Parameter 'resourceGroupName' is required and cannot be null.")); - } - if (CoreUtils.isNullOrEmpty(name)) { - return Mono.error( - new IllegalArgumentException("Parameter 'name' is required and cannot be null.")); - } - return this.deleteInnerAsync(resourceGroupName, name) - .subscribeOn(ResourceManagerUtils.InternalRuntimeContext.getReactorScheduler()); - } - - @Override - public Mono deleteByIdAsync(String id) { - if (CoreUtils.isNullOrEmpty(id)) { - return Mono.error( - new IllegalArgumentException("Parameter 'id' is required and cannot be null.")); - } - return deleteByResourceGroupAsync(ResourceUtils.groupFromResourceId(id), ResourceUtils.nameFromResourceId(id)); - } - - @Override - public T getByResourceGroup(String resourceGroupName, String name) { - return getByResourceGroupAsync(resourceGroupName, name).block(); - } - - @Override - public Mono getByResourceGroupAsync(String resourceGroupName, String name) { - if (CoreUtils.isNullOrEmpty(resourceGroupName)) { - return Mono.error( - new IllegalArgumentException("Parameter 'resourceGroupName' is required and cannot be null.")); - } - if (CoreUtils.isNullOrEmpty(name)) { - return Mono.error( - new IllegalArgumentException("Parameter 'name' is required and cannot be null.")); - } - return this.getInnerAsync(resourceGroupName, name) - .map(this::wrapModel); - } - - protected abstract Mono getInnerAsync(String resourceGroupName, String name); - - protected abstract Mono deleteInnerAsync(String resourceGroupName, String name); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/collection/implementation/IndependentChildResourcesImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/collection/implementation/IndependentChildResourcesImpl.java deleted file mode 100644 index 8024b672d288..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/collection/implementation/IndependentChildResourcesImpl.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation; - -import com.azure.resourcemanager.resources.fluentcore.arm.Manager; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.models.IndependentChildResource; -import com.azure.resourcemanager.resources.fluentcore.arm.models.Resource; - -/** - * Base class for independent child resource collection class. - * (Internal use only) - * - * @param the individual resource type returned - * @param the individual resource implementation - * @param the wrapper inner type - * @param the inner type of the collection object - * @param the manager type for this resource provider type - * @param the type of the parent resource - */ -public abstract class IndependentChildResourcesImpl< - T extends IndependentChildResource, - ImplT extends T, - InnerT, - InnerCollectionT, - ManagerT extends Manager, - ParentT extends Resource & HasResourceGroup> - extends IndependentChildrenImpl { - - protected IndependentChildResourcesImpl(InnerCollectionT innerCollection, ManagerT manager) { - super(innerCollection, manager); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/collection/implementation/IndependentChildrenImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/collection/implementation/IndependentChildrenImpl.java deleted file mode 100644 index d2d599937859..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/collection/implementation/IndependentChildrenImpl.java +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.resources.fluentcore.arm.Manager; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceId; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsDeletingByParent; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingByParent; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsListingByParent; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.models.IndependentChild; -import com.azure.resourcemanager.resources.fluentcore.arm.models.Resource; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import reactor.core.publisher.Mono; - -/** - * Base class for independent child collection class. - * (Internal use only) - * - * @param the individual resource type returned - * @param the individual resource implementation - * @param the wrapper inner type - * @param the inner type of the collection object - * @param the manager type for this resource provider type - * @param the type of the parent resource - */ -public abstract class IndependentChildrenImpl< - T extends IndependentChild, - ImplT extends T, - InnerT, - InnerCollectionT, - ManagerT extends Manager, - ParentT extends Resource & HasResourceGroup> - extends CreatableResourcesImpl - implements - SupportsGettingById, - SupportsGettingByParent, - SupportsListingByParent, - SupportsDeletingByParent, - HasManager, - HasInnerModel { - protected final InnerCollectionT innerCollection; - protected final ManagerT manager; - - protected IndependentChildrenImpl(InnerCollectionT innerCollection, ManagerT manager) { - this.innerCollection = innerCollection; - this.manager = manager; - } - - @Override - public InnerCollectionT innerModel() { - return this.innerCollection; - } - - @Override - public T getByParent(String resourceGroup, String parentName, String name) { - return getByParentAsync(resourceGroup, parentName, name).block(); - } - - @Override - public T getByParent(ParentT parentResource, String name) { - return getByParentAsync(parentResource, name).block(); - } - - @Override - public Mono getByParentAsync(ParentT parentResource, String name) { - return getByParentAsync(parentResource.resourceGroupName(), parentResource.name(), name); - } - - @Override - public T getById(String id) { - return getByIdAsync(id).block(); - } - - @Override - public Mono getByIdAsync(String id) { - ResourceId resourceId = ResourceId.fromString(id); - if (resourceId.parent() == null) { - return null; - } - - return getByParentAsync(resourceId.resourceGroupName(), resourceId.parent().name(), resourceId.name()); - } - - @Override - public PagedIterable listByParent(ParentT parentResource) { - return listByParent(parentResource.resourceGroupName(), parentResource.name()); - } - - @Override - public void deleteByParent(String groupName, String parentName, String name) { - deleteByParentAsync(groupName, parentName, name).block(); - } - - @Override - public Mono deleteByIdAsync(String id) { - ResourceId resourceId = ResourceId.fromString(id); - return deleteByParentAsync(resourceId.resourceGroupName(), resourceId.parent().name(), resourceId.name()); - } - - @Override - public ManagerT manager() { - return this.manager; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/collection/implementation/ReadableWrappersImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/collection/implementation/ReadableWrappersImpl.java deleted file mode 100644 index 36330b7df497..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/collection/implementation/ReadableWrappersImpl.java +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.resources.fluentcore.utils.PagedConverter; - -/** - * Base class for readable wrapper collections, i.e. those whose models can only be read, not created. - * (Internal use only) - * - * @param the individual resource type returned - * @param the individual resource implementation - * @param the wrapper inner type - */ -public abstract class ReadableWrappersImpl< - T, - ImplT extends T, - InnerT> { - - protected ReadableWrappersImpl() { - } - - protected abstract ImplT wrapModel(InnerT inner); - - protected PagedIterable wrapList(PagedIterable pagedList) { - return PagedConverter.mapPage(pagedList, innerT -> wrapModel(innerT)); - } - - protected PagedFlux wrapPageAsync(PagedFlux innerPage) { - return PagedConverter.mapPage(innerPage, innerT -> wrapModel(innerT)); - } - -// protected PagedIterable wrapList(List list) { -// return wrapList(ReadableWrappersImpl.convertToPagedList(list)); -// } -// -// /** -// * Converts the List to PagedList. -// * -// * @param list list to be converted in to paged list -// * @param the wrapper inner type -// * @return the Paged list for the inner type. -// */ -// public static PagedIterable convertToPagedList(List list) { -// PageImpl page = new PageImpl<>(); -// page.setItems(list); -// page.setNextPageLink(null); -// return new PagedIterable<>(page) { -// @Override -// public Page nextPage(String nextPageLink) { -// return null; -// } -// }; -// } -// -// -// protected Flux wrapPageAsync(Flux> innerPage) { -// return wrapModelAsync(convertPageToInnerAsync(innerPage)); -// } -// -// protected Flux wrapListAsync(Flux> innerList) { -// return wrapModelAsync(convertListToInnerAsync(innerList)); -// } -// -// /** -// * Converts Flux of list to Flux of Inner. -// * -// * @param innerList list to be converted. -// * @param type of inner. -// * @return Flux for list of inner. -// */ -// public static Flux convertListToInnerAsync(Flux> innerList) { -// return innerList.flatMap(list -> Flux.fromIterable(list)); -// } -// -// /** -// * Converts Flux of page to Flux of Inner. -// * -// * @param type of inner. -// * @param innerPage Page to be converted. -// * @return Flux for list of inner. -// */ -// public static Flux convertPageToInnerAsync(Flux> innerPage) { -// return innerPage.flatMap(page -> Flux.fromIterable(page.getItems())); -// } -// -// private Flux wrapModelAsync(Flux inner) { -// return inner.map(i -> wrapModel(i)); -// } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/collection/implementation/SupportsGettingByIdImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/collection/implementation/SupportsGettingByIdImpl.java deleted file mode 100644 index 2e588eca84ab..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/collection/implementation/SupportsGettingByIdImpl.java +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - - -package com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation; - -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById; - -/** - * Provides access to getting a specific Azure resource based on its resource ID. - * - * @param the type of the resource collection - */ -public abstract class SupportsGettingByIdImpl implements SupportsGettingById { - @Override - public T getById(String id) { - return getByIdAsync(id).block(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/collection/implementation/SupportsGettingByResourceGroupImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/collection/implementation/SupportsGettingByResourceGroupImpl.java deleted file mode 100644 index 593713eb2afe..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/collection/implementation/SupportsGettingByResourceGroupImpl.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation; - -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceId; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingByResourceGroup; -import reactor.core.publisher.Mono; - -/** - * Provides access to getting a specific Azure resource based on its name and resource group. - *

    - * (Note: this interface is not intended to be implemented by user code) - * - * @param the type of the resource to get. - */ -public abstract class SupportsGettingByResourceGroupImpl - extends SupportsGettingByIdImpl - implements - SupportsGettingByResourceGroup { - @Override - public T getByResourceGroup(String resourceGroupName, String name) { - return this.getByResourceGroupAsync(resourceGroupName, name).block(); - } - - - @Override - public Mono getByIdAsync(String id) { - ResourceId resourceId = ResourceId.fromString(id); - - return this.getByResourceGroupAsync(resourceId.resourceGroupName(), resourceId.name()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/collection/implementation/TopLevelModifiableResourcesImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/collection/implementation/TopLevelModifiableResourcesImpl.java deleted file mode 100644 index 865544b6ea9a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/collection/implementation/TopLevelModifiableResourcesImpl.java +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.Resource; -import com.azure.core.util.CoreUtils; -import com.azure.resourcemanager.resources.fluentcore.arm.Manager; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsBatchDeletion; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsListingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.models.GroupableResource; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; - -/** - * Base class for resource collection classes. - * (Internal use only) - * - * @param the individual resource type returned - * @param the individual resource implementation - * @param the wrapper inner type - * @param the inner type of the collection object - * @param the manager type for this resource provider type - */ -public abstract class TopLevelModifiableResourcesImpl< - T extends GroupableResource, - ImplT extends T, - InnerT extends Resource, - InnerCollectionT extends InnerSupportsListing & InnerSupportsGet & InnerSupportsDelete, - ManagerT extends Manager> - extends GroupableResourcesImpl - implements - SupportsListing, - SupportsListingByResourceGroup, - SupportsBatchDeletion { - - protected TopLevelModifiableResourcesImpl(InnerCollectionT innerCollection, ManagerT manager) { - super(innerCollection, manager); - } - - @Override - protected final Mono getInnerAsync(String resourceGroupName, String name) { - return this.inner().getByResourceGroupAsync(resourceGroupName, name); - } - - @Override - protected Mono deleteInnerAsync(String resourceGroupName, String name) { - return inner().deleteAsync(resourceGroupName, name).then(); - } - - @Override - public Flux deleteByIdsAsync(String... ids) { - return this.deleteByIdsAsync(new ArrayList<>(Arrays.asList(ids))); - } - - @Override - public Flux deleteByIdsAsync(Collection ids) { - return BatchDeletionImpl.deleteByIdsAsync(ids, this::deleteInnerAsync); - } - - @Override - public void deleteByIds(String... ids) { - this.deleteByIds(new ArrayList<>(Arrays.asList(ids))); - } - - @Override - public void deleteByIds(Collection ids) { - if (ids != null && !ids.isEmpty()) { - this.deleteByIdsAsync(ids).blockLast(); - } - } - - @Override - public PagedFlux listAsync() { - return wrapPageAsync(inner().listAsync()); - } - - @Override - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - if (CoreUtils.isNullOrEmpty(resourceGroupName)) { - return new PagedFlux<>(() -> Mono.error( - new IllegalArgumentException("Parameter 'resourceGroupName' is required and cannot be null."))); - } - return wrapPageAsync(inner().listByResourceGroupAsync(resourceGroupName)); - } - - @Override - public PagedIterable list() { - return new PagedIterable<>(this.listAsync()); - } - - @Override - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(this.listByResourceGroupAsync(resourceGroupName)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/collection/implementation/package-info.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/collection/implementation/package-info.java deleted file mode 100644 index 07d2e468492c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/collection/implementation/package-info.java +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. - -/** - * This package contains shared implementation classes for resource collections. - */ -package com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation; diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/collection/package-info.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/collection/package-info.java deleted file mode 100644 index c2c83dd7ea30..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/collection/package-info.java +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. - -/** - * This package contains the base class for resource collections. - */ -package com.azure.resourcemanager.resources.fluentcore.arm.collection; diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/implementation/AzureConfigurableImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/implementation/AzureConfigurableImpl.java deleted file mode 100644 index 412244a94dd3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/implementation/AzureConfigurableImpl.java +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.arm.implementation; - -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.policy.HttpLogDetailLevel; -import com.azure.core.http.policy.HttpLogOptions; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.http.policy.RetryOptions; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.util.Configuration; -import com.azure.resourcemanager.resources.fluentcore.arm.AzureConfigurable; -import com.azure.resourcemanager.resources.fluentcore.policy.AuxiliaryAuthenticationPolicy; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.resources.fluentcore.utils.HttpPipelineProvider; - -import java.time.temporal.ChronoUnit; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** - * The implementation for {@link AzureConfigurable} and the base class for - * configurable implementations. - * - * @param the type of the configurable interface - */ -public class AzureConfigurableImpl> - implements AzureConfigurable { - private HttpClient httpClient; - private HttpLogOptions httpLogOptions; - private List policies; - private List scopes; - private RetryPolicy retryPolicy; - private RetryOptions retryOptions; - private Configuration configuration; - private List tokens; - private HttpPipeline httpPipeline; - - protected AzureConfigurableImpl() { - policies = new ArrayList<>(); - scopes = new ArrayList<>(); - tokens = new ArrayList<>(); - retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); - httpLogOptions = new HttpLogOptions().setLogLevel(HttpLogDetailLevel.NONE); - } - - @Override - @SuppressWarnings("unchecked") - public T withLogOptions(HttpLogOptions httpLogOptions) { - Objects.requireNonNull(httpLogOptions); - this.httpLogOptions = httpLogOptions; - return (T) this; - } - - @Override - @SuppressWarnings("unchecked") - public T withLogLevel(HttpLogDetailLevel logLevel) { - Objects.requireNonNull(logLevel); - this.httpLogOptions = httpLogOptions.setLogLevel(logLevel); - return (T) this; - } - - @Override - @SuppressWarnings("unchecked") - public T withPolicy(HttpPipelinePolicy policy) { - Objects.requireNonNull(policy); - policies.add(policy); - return (T) this; - } - - @Override - @SuppressWarnings("unchecked") - public T withAuxiliaryCredential(TokenCredential token) { - Objects.requireNonNull(token); - this.tokens.add(token); - return (T) this; - } - - @Override - @SuppressWarnings("unchecked") - public T withAuxiliaryCredentials(List tokens) { - Objects.requireNonNull(tokens); - this.tokens.addAll(tokens); - return (T) this; - } - - @Override - @SuppressWarnings("unchecked") - public T withRetryPolicy(RetryPolicy retryPolicy) { - Objects.requireNonNull(retryPolicy); - this.retryPolicy = retryPolicy; - return (T) this; - } - - @Override - @SuppressWarnings("unchecked") - public T withScope(String scope) { - Objects.requireNonNull(scope); - this.scopes.add(scope); - return (T) this; - } - - @Override - @SuppressWarnings("unchecked") - public T withScopes(List scopes) { - Objects.requireNonNull(scopes); - this.scopes.addAll(scopes); - return (T) this; - } - - @Override - @SuppressWarnings("unchecked") - public T withHttpClient(HttpClient httpClient) { - Objects.requireNonNull(httpClient); - this.httpClient = httpClient; - return (T) this; - } - - @Override - @SuppressWarnings("unchecked") - public T withConfiguration(Configuration configuration) { - Objects.requireNonNull(configuration); - this.configuration = configuration; - return (T) this; - } - - @Override - @SuppressWarnings("unchecked") - public T withRetryOptions(RetryOptions retryOptions) { - Objects.requireNonNull(retryOptions); - this.retryOptions = retryOptions; - return (T) this; - } - - protected HttpPipeline buildHttpPipeline(TokenCredential credential, AzureProfile profile) { - Objects.requireNonNull(credential); - if (!tokens.isEmpty()) { - policies.add( - new AuxiliaryAuthenticationPolicy(profile.getEnvironment(), tokens.toArray(new TokenCredential[0]))); - } - if (this.retryPolicy == null && this.retryOptions != null) { - this.retryPolicy = new RetryPolicy(this.retryOptions); - } - return HttpPipelineProvider.buildHttpPipeline(credential, profile, scopes(), httpLogOptions, configuration, - retryPolicy, policies, httpClient); - } - - private String[] scopes() { - return scopes.isEmpty() ? null : scopes.toArray(new String[0]); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/implementation/package-info.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/implementation/package-info.java deleted file mode 100644 index 270d0dd1415a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/implementation/package-info.java +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. - -/** - * This package contains the implementations for ARM base classes. - */ -package com.azure.resourcemanager.resources.fluentcore.arm.implementation; diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/ChildResource.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/ChildResource.java deleted file mode 100644 index 13f82e27f11a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/ChildResource.java +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.resources.fluentcore.arm.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.model.Indexable; - -/** - * Base interface used by child resources. - * - * @param parent interface - */ -@Fluent -public interface ChildResource extends - Indexable, - HasName, - HasParent { -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/ExternalChildResource.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/ExternalChildResource.java deleted file mode 100644 index 8727ff95d266..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/ExternalChildResource.java +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.resources.fluentcore.arm.models; - -import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; - -/** - * Represents an external child resource. - * - * @param fluent type of the external child resource - * @param parent interface - */ -public interface ExternalChildResource - extends ChildResource, Refreshable { - /** - * @return the id of the external child resource - */ - String id(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/GroupableResource.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/GroupableResource.java deleted file mode 100644 index 21e7ccabbac9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/GroupableResource.java +++ /dev/null @@ -1,151 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.arm.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.models.ResourceGroup; -import com.azure.core.management.Region; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; - -/** - * Base interface for resources in resource groups. - * - * @param the manager object type representing the service - * @param the wrapped, inner, auto-generated implementation object type - */ -@Fluent() -public interface GroupableResource extends - Resource, - HasResourceGroup, - HasManager, - HasInnerModel { - - /** - * Grouping of all the definition stages. - */ - interface DefinitionStages { - /** - * A resource definition allowing a resource group to be selected. - *

    - * Region of the groupable resource will be used for new resource group - * - * @param the next stage of the definition - */ - interface WithGroup extends - WithExistingResourceGroup, - WithNewResourceGroup { - } - - /** - * A resource definition allowing a resource group to be selected. - *

    - * Region has to be specified explicitly to create a new resource group - * - * @param the next stage of the definition - */ - interface WithGroupAndRegion extends - WithExistingResourceGroup, - WithNewResourceGroupWithRegion { - } - - /** - * A resource definition allowing a new resource group to be created in the same - * region as groupable resource. - * - * @param the next stage of the definition - */ - interface WithNewResourceGroup extends - WithCreatableResourceGroup { - /** - * Creates a new resource group to put the resource in. - *

    - * The group will be created in the same location as the resource. - * - * @param name the name of the new group - * @return the next stage of the definition - */ - T withNewResourceGroup(String name); - - /** - * Creates a new resource group to put the resource in. - *

    - * The group will be created in the same location as the resource. - * The group's name is automatically derived from the resource's name. - * - * @return the next stage of the definition - */ - T withNewResourceGroup(); - } - - /** - * A resource definition allowing a new resource group to be created in a different - * region . - * - * @param the next stage of the definition - */ - interface WithNewResourceGroupWithRegion extends - WithCreatableResourceGroup { - /** - * Creates a new resource group to put the resource in. - *

    - * The group will be created in the same location as the resource. - * - * @param name the name of the new group - * @param region the region where resource group needs to be created - * @return the next stage of the definition - */ - T withNewResourceGroup(String name, Region region); - - /** - * Creates a new resource group to put the resource in. - *

    - * The group will be created in the same location as the resource. - * The group's name is automatically derived from the resource's name. - * - * @param region the region where resource group needs to be created - * @return the next stage of the definition - */ - T withNewResourceGroup(Region region); - } - - /** - * A resource definition allowing a new creatable resource group to be specified. - * - * @param the next stage of the definition - */ - interface WithCreatableResourceGroup { - /** - * Creates a new resource group to put the resource in, based on the definition specified. - * - * @param groupDefinition a creatable definition for a new resource group - * @return the next stage of the definition - */ - T withNewResourceGroup(Creatable groupDefinition); - } - - /** - * A resource definition allowing an existing resource group to be selected. - * - * @param the next stage of the definition - */ - interface WithExistingResourceGroup { - /** - * Associates the resource with an existing resource group. - * - * @param groupName the name of an existing resource group to put this resource in. - * @return the next stage of the definition - */ - T withExistingResourceGroup(String groupName); - - /** - * Associates the resource with an existing resource group. - * - * @param group an existing resource group to put the resource in - * @return the next stage of the definition - */ - T withExistingResourceGroup(ResourceGroup group); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/HasId.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/HasId.java deleted file mode 100644 index 1e2317f05948..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/HasId.java +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.resources.fluentcore.arm.models; - -import com.azure.core.annotation.Fluent; - -/** - * An interface representing a model that has a resource group name. - */ -@Fluent -public interface HasId { - /** - * @return the resource ID string - */ - String id(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/HasManager.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/HasManager.java deleted file mode 100644 index 573c75be288f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/HasManager.java +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.resources.fluentcore.arm.models; - -import com.azure.core.annotation.Fluent; - -/** - * An interface representing a model that exposes a management client. - * - * @param the manager client type - */ -@Fluent -public interface HasManager { - /** - * @return the manager client of this resource type - */ - ManagerT manager(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/HasName.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/HasName.java deleted file mode 100644 index fbd0b0b98b74..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/HasName.java +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.resources.fluentcore.arm.models; - - -import com.azure.core.annotation.Fluent; - -/** - * An interface representing a model that has a name. - */ -@Fluent -public interface HasName { - /** - * @return the name of the resource - */ - String name(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/HasParent.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/HasParent.java deleted file mode 100644 index 4545ae6ed0a5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/HasParent.java +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.resources.fluentcore.arm.models; - -/** - * An interface representing a child that has an immediately available parent. - * - * @param the parent type - */ -public interface HasParent { - /** - * @return the parent of this child object - */ - ParentT parent(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/HasResourceGroup.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/HasResourceGroup.java deleted file mode 100644 index edf9beddb920..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/HasResourceGroup.java +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.resources.fluentcore.arm.models; - -import com.azure.core.annotation.Fluent; - -/** - * An interface representing a model that has a resource group name. - */ -@Fluent -public interface HasResourceGroup { - /** - * @return the name of the resource group - */ - String resourceGroupName(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/HasSubnet.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/HasSubnet.java deleted file mode 100644 index 94f4fffd14f4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/HasSubnet.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.resources.fluentcore.arm.models; - -import com.azure.core.annotation.Fluent; - -/** - * An interface representing a model's ability to reference a subnet by its name and network's ID. - */ -@Fluent -public interface HasSubnet { - /** - * @return the resource ID of the virtual network whose subnet is associated with this resource - */ - String networkId(); - - /** - * @return the name of the subnet associated with this resource - */ - String subnetName(); - - /** - * Grouping of definition stages involving associating an existing subnet with a resource. - */ - interface DefinitionStages { - /** - * The stage of a definition allowing to associate a subnet with a resource. - * - * @param the next stage of the definition - */ - interface WithSubnet { - /** - * Assigns the specified subnet to this resource. - * - * @param parentNetworkResourceId the resource ID of the virtual network the subnet is part of - * @param subnetName the name of the subnet - * @return the next stage of the definition - */ - ReturnT withExistingSubnet(String parentNetworkResourceId, String subnetName); - } - } - - /** - * Grouping of update stages involving associating an existing subnet with a resource. - */ - interface UpdateStages { - /** - * The stage of an update allowing to associate a subnet with a resource. - * - * @param the next stage of the update - */ - interface WithSubnet { - /** - * Assigns the specified subnet to this resource. - * - * @param parentNetworkResourceId the resource ID of the virtual network the subnet is part of - * @param subnetName the name of the subnet - * @return the next stage of the definition - */ - ReturnT withExistingSubnet(String parentNetworkResourceId, String subnetName); - } - } - - /** - * Grouping of definition stages applicable as part of a parent resource update, - * involving associating a subnet with a resource. - */ - interface UpdateDefinitionStages { - /** - * The stage of a definition allowing to associate a subnet with a resource. - * - * @param the next stage of the definition - */ - interface WithSubnet { - /** - * Assigns the specified subnet to this resource. - * - * @param parentNetworkResourceId the resource ID of the virtual network the subnet is part of - * @param subnetName the name of the subnet - * @return the next stage of the definition - */ - ReturnT withExistingSubnet(String parentNetworkResourceId, String subnetName); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/IndependentChild.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/IndependentChild.java deleted file mode 100644 index b97c6304edea..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/IndependentChild.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.arm.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.Indexable; - -/** - * Interface for the child resource which can be CRUDed independently from the parent resource. - * - * @param the client manager type representing the service - */ -@Fluent -public interface IndependentChild extends - HasName, - HasId, - Indexable, - HasResourceGroup, - HasManager { - - /** - * Grouping of all the definition stages. - */ - interface DefinitionStages { - /** - * A resource definition allowing a new resource group to be created. - * - * @param the resource type. - * @param parent resource type. - */ - interface WithParentResource { - /** - * Creates a new child resource under parent resource. - * - * @param groupName the name of the resource group for parent resource. - * @param parentName the name of the parent resource. - * @return the creatable for the child resource - */ - Creatable withExistingParentResource(String groupName, String parentName); - - /** - * Creates a new child resource under parent resource. - * - * @param parentResourceCreatable a creatable definition for the parent resource - * @return the creatable for the child resource - */ - Creatable withNewParentResource(Creatable parentResourceCreatable); - - /** - * Creates a new child resource under parent resource. - * - * @param existingParentResource the parent resource under which this resource to be created. - * @return the creatable for the child resource - */ - Creatable withExistingParentResource(ParentT existingParentResource); - } - } - -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/IndependentChildResource.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/IndependentChildResource.java deleted file mode 100644 index 34d82b75b01c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/IndependentChildResource.java +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.arm.models; - -import com.azure.core.annotation.Fluent; - -/** - * Interface for the child resource which can be CRUDed independently from the parent resource. - * - * @param the client manager type representing the service - * @param the inner, auto-generated implementation logic object type - */ -@Fluent -public interface IndependentChildResource extends - GroupableResource, - IndependentChild { -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/ParentlessChildResource.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/ParentlessChildResource.java deleted file mode 100644 index 9e58df4c0f9c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/ParentlessChildResource.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.resources.fluentcore.arm.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.model.Indexable; - -/** - * Base interface used by child resources that do not immediately have their parent - * attached to them but are instead available directly off other entry points. - * - * @param parent interface - */ -@Fluent -public interface ParentlessChildResource extends - Indexable, - HasName { - - /** - * @return the parent of this child object - */ - ParentT getParent(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/PrivateEndpoint.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/PrivateEndpoint.java deleted file mode 100644 index ef66310f0d0d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/PrivateEndpoint.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.arm.models; - -/** The private endpoint of the private endpoint connection. */ -public final class PrivateEndpoint { - - private final String id; - - /** - * Initializes a new instance of the {@link PrivateEndpoint} class. - * - * @param id the ID of the private endpoint. - */ - public PrivateEndpoint(String id) { - this.id = id; - } - - /** @return the ID of the private endpoint. */ - public String id() { - return this.id; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/PrivateEndpointConnection.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/PrivateEndpointConnection.java deleted file mode 100644 index fc3cb457d2f2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/PrivateEndpointConnection.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.arm.models; - -/** An interface representing a private endpoint connection. */ -public interface PrivateEndpointConnection { - - /** @return the ID of the resource. */ - String id(); - - /** @return the name of the resource. */ - String name(); - - /** @return the type of the resource. */ - String type(); - - /** @return the private endpoint. */ - PrivateEndpoint privateEndpoint(); - - /** @return the state of the private link service connection. */ - PrivateLinkServiceConnectionState privateLinkServiceConnectionState(); - - /** @return the provisioning state. */ - PrivateEndpointConnectionProvisioningState provisioningState(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/PrivateEndpointConnectionProvisioningState.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/PrivateEndpointConnectionProvisioningState.java deleted file mode 100644 index 318759aaa43a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/PrivateEndpointConnectionProvisioningState.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.arm.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; - -import java.util.Collection; - -/** Defines values for PrivateEndpointConnectionProvisioningState. */ -public final class PrivateEndpointConnectionProvisioningState - extends ExpandableStringEnum { - /** Static value Succeeded for PrivateEndpointConnectionProvisioningState. */ - public static final PrivateEndpointConnectionProvisioningState SUCCEEDED = fromString("Succeeded"); - - /** Static value Creating for PrivateEndpointConnectionProvisioningState. */ - public static final PrivateEndpointConnectionProvisioningState CREATING = fromString("Creating"); - - /** Static value Deleting for PrivateEndpointConnectionProvisioningState. */ - public static final PrivateEndpointConnectionProvisioningState DELETING = fromString("Deleting"); - - /** Static value Failed for PrivateEndpointConnectionProvisioningState. */ - public static final PrivateEndpointConnectionProvisioningState FAILED = fromString("Failed"); - - /** - * Creates or finds a PrivateEndpointConnectionProvisioningState from its string representation. - * - * @param name a name to look for. - * @return the corresponding PrivateEndpointConnectionProvisioningState. - */ - @JsonCreator - public static PrivateEndpointConnectionProvisioningState fromString(String name) { - return fromString(name, PrivateEndpointConnectionProvisioningState.class); - } - - /** @return known PrivateEndpointConnectionProvisioningState values. */ - public static Collection values() { - return values(PrivateEndpointConnectionProvisioningState.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/PrivateEndpointServiceConnectionStatus.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/PrivateEndpointServiceConnectionStatus.java deleted file mode 100644 index 4d02ecfca0f4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/PrivateEndpointServiceConnectionStatus.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.arm.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; - -import java.util.Collection; - -/** Defines values for PrivateEndpointServiceConnectionStatus. */ -public final class PrivateEndpointServiceConnectionStatus - extends ExpandableStringEnum { - /** Static value Pending for PrivateEndpointServiceConnectionStatus. */ - public static final PrivateEndpointServiceConnectionStatus PENDING = fromString("Pending"); - - /** Static value Approved for PrivateEndpointServiceConnectionStatus. */ - public static final PrivateEndpointServiceConnectionStatus APPROVED = fromString("Approved"); - - /** Static value Rejected for PrivateEndpointServiceConnectionStatus. */ - public static final PrivateEndpointServiceConnectionStatus REJECTED = fromString("Rejected"); - - /** - * Creates or finds a PrivateEndpointServiceConnectionStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding PrivateEndpointServiceConnectionStatus. - */ - @JsonCreator - public static PrivateEndpointServiceConnectionStatus fromString(String name) { - return fromString(name, PrivateEndpointServiceConnectionStatus.class); - } - - /** @return known PrivateEndpointServiceConnectionStatus values. */ - public static Collection values() { - return values(PrivateEndpointServiceConnectionStatus.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/PrivateLinkResource.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/PrivateLinkResource.java deleted file mode 100644 index 32610ed42f9a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/PrivateLinkResource.java +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.arm.models; - -import java.util.List; - -/** An interface representing a private link resource. */ -public interface PrivateLinkResource { - - /** @return The group ID of Private link resource. */ - String groupId(); - - /** @return The collection of required member names of Private link resource. */ - List requiredMemberNames(); - - /** @return The collection of DNS zone names of Private link resource. */ - List requiredDnsZoneNames(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/PrivateLinkServiceConnectionState.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/PrivateLinkServiceConnectionState.java deleted file mode 100644 index 995f7b81ad22..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/PrivateLinkServiceConnectionState.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.arm.models; - -/** The state of the private link service connection. */ -public final class PrivateLinkServiceConnectionState { - - private final PrivateEndpointServiceConnectionStatus status; - private final String description; - private final String actionsRequired; - - /** - * Initializes a new instance of the {@link PrivateLinkServiceConnectionState} class. - * - * @param status the status of the connection. - * @param description the description of the connection. - * @param actionsRequired the required action for the connection. - */ - public PrivateLinkServiceConnectionState(PrivateEndpointServiceConnectionStatus status, - String description, String actionsRequired) { - this.status = status; - this.description = description; - this.actionsRequired = actionsRequired; - } - - /** @return the status of the connection. */ - public PrivateEndpointServiceConnectionStatus status() { - return this.status; - } - - /** @return the description of the connection. */ - public String description() { - return this.description; - } - - /** @return the required action for the connection. */ - public String actionsRequired() { - return this.actionsRequired; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/Resource.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/Resource.java deleted file mode 100644 index 035937c7b939..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/Resource.java +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.arm.models; - -import com.azure.core.management.Region; -import com.azure.resourcemanager.resources.fluentcore.model.Indexable; - -import java.util.Map; - -/** - * Base interfaces for fluent resources. - */ -public interface Resource extends - Indexable, - HasId, - HasName { - - /** - * A dummy resource that does nothing. - */ - Resource DUMMY = new Resource() { - @Override - public String type() { - return null; - } - - @Override - public String regionName() { - return null; - } - - @Override - public Region region() { - return null; - } - - @Override - public Map tags() { - return null; - } - - @Override - public String id() { - return null; - } - - @Override - public String name() { - return null; - } - - @Override - public String key() { - return null; - } - }; - - /** - * @return the type of the resource - */ - String type(); - - /** - * @return the name of the region the resource is in - */ - String regionName(); - - /** - * @return the region the resource is in - */ - Region region(); - - /** - * @return the tags for the resource - */ - Map tags(); - - /** - * A resource definition allowing a location be selected for the resource. - * - * @param the type of the next stage resource definition - */ - interface DefinitionWithRegion { - /** - * Specifies the region for the resource by name. - * - * @param regionName The name of the region for the resource - * @return the next stage of the definition - */ - T withRegion(String regionName); - - /** - * Specifies the region for the resource. - * - * @param region The location for the resource - * @return the next stage of the definition - */ - T withRegion(Region region); - } - - /** - * A resource definition allowing tags to be modified for the resource. - * - * @param the type of the next stage resource definition - */ - interface DefinitionWithTags { - /** - * Specifies tags for the resource as a {@link Map}. - * - * @param tags a {@link Map} of tags - * @return the next stage of the definition - */ - T withTags(Map tags); - - /** - * Adds a tag to the resource. - * - * @param key the key for the tag - * @param value the value for the tag - * @return the next stage of the definition - */ - T withTag(String key, String value); - } - - /** - * An update allowing tags to be modified for the resource. - * - * @param the type of the next stage resource update - */ - interface UpdateWithTags { - /** - * Specifies tags for the resource as a {@link Map}. - * - * @param tags a {@link Map} of tags - * @return the next stage of the resource update - */ - T withTags(Map tags); - - /** - * Adds a tag to the resource. - * - * @param key the key for the tag - * @param value the value for the tag - * @return the next stage of the resource update - */ - T withTag(String key, String value); - - /** - * Removes a tag from the resource. - * - * @param key the key of the tag to remove - * @return the next stage of the resource update - */ - T withoutTag(String key); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/implementation/ChildResourceImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/implementation/ChildResourceImpl.java deleted file mode 100644 index c89de60be3fb..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/implementation/ChildResourceImpl.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.resources.fluentcore.arm.models.implementation; - -import com.azure.resourcemanager.resources.fluentcore.arm.models.ChildResource; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.IndexableWrapperImpl; - -/** - * Child resource abstract implementation. - * (Internal use only) - * - * @param Azure inner child class type - * @param parent implementation - * @param parent interface - */ -public abstract class ChildResourceImpl - extends IndexableWrapperImpl - implements ChildResource { - - private final ParentImplT parent; - - protected ChildResourceImpl(InnerT innerObject, ParentImplT parent) { - super(innerObject); - this.parent = parent; - } - - /** - * @return parent resource for this child resource - */ - public ParentImplT parent() { - return this.parent; - } - - @Override - public abstract String name(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/implementation/ExternalChildResourceImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/implementation/ExternalChildResourceImpl.java deleted file mode 100644 index 236847454f62..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/implementation/ExternalChildResourceImpl.java +++ /dev/null @@ -1,468 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.arm.models.implementation; - -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.resources.fluentcore.arm.models.ExternalChildResource; -import com.azure.resourcemanager.resources.fluentcore.dag.FunctionalTaskItem; -import com.azure.resourcemanager.resources.fluentcore.dag.IndexableTaskItem; -import com.azure.resourcemanager.resources.fluentcore.dag.TaskGroup; -import com.azure.resourcemanager.resources.fluentcore.exception.AggregatedManagementException; -import com.azure.resourcemanager.resources.fluentcore.model.Appliable; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.Executable; -import com.azure.resourcemanager.resources.fluentcore.model.Indexable; -import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; -import reactor.core.publisher.Mono; - -import java.util.Objects; - -/** - * Externalized child resource abstract implementation. - *

    - * Inorder to be eligible for an external child resource following criteria must be satisfied: - * 1. It's is always associated with a parent resource and has no existence without parent - * i.e. if you delete parent then child resource will be deleted automatically. - * 2. Parent may or may not contain collection of child resources (i.e. as inline collection property). - * 3. It's has an ID and can be created, updated, fetched and deleted independent of the parent - * i.e. CRUD on child resource does not require CRUD on the parent - * (Internal use only) - * - * @param the fluent model type of the child resource - * @param Azure inner resource class type representing the child resource - * @param the parent Azure resource impl class type that implements {@link ParentT} - * @param parent interface - */ -public abstract class ExternalChildResourceImpl - extends - ChildResourceImpl - implements - Appliable, - Creatable, - TaskGroup.HasTaskGroup, - ExternalChildResource, - Refreshable { - /** - * State representing any pending action that needs to be performed on this child resource. - */ - private PendingOperation pendingOperation = PendingOperation.None; - /** - * The child resource name. - */ - private final String name; - /** - * TaskItem in the graph to perform action on this external child resource. - */ - private final ExternalChildActionTaskItem childAction; - - /** - * Creates an instance of external child resource in-memory. - * - * @param name the name of this external child resource - * @param parent reference to the parent of this external child resource - * @param innerObject reference to the inner object representing this external child resource - */ - protected ExternalChildResourceImpl(String name, - ParentImplT parent, - InnerModelT innerObject) { - super(innerObject, parent); - this.childAction = new ExternalChildActionTaskItem(this); - this.name = name; - } - - /** - * Creates an instance of external child resource in-memory. - * - * @param key the task group key for the task item that perform actions on this child - * @param name the name of this external child resource - * @param parent reference to the parent of this external child resource - * @param innerObject reference to the inner object representing this external child resource - */ - protected ExternalChildResourceImpl(String key, - String name, - ParentImplT parent, - InnerModelT innerObject) { - super(innerObject, parent); - this.childAction = new ExternalChildActionTaskItem(key, this); - this.name = name; - } - - @Override - public String name() { - return this.name; - } - - /** - * @return the operation pending on this child resource. - */ - public PendingOperation pendingOperation() { - return this.pendingOperation; - } - - /** - * Update the operation state. - * - * @param pendingOperation the new state of this child resource - */ - public void setPendingOperation(PendingOperation pendingOperation) { - this.pendingOperation = pendingOperation; - } - - /** - * Mark that there is no action pending on this child resource and clear - * any cached result, i.e. the output produced by the invocation of last - * action. - */ - public void clear() { - this.setPendingOperation(PendingOperation.None); - this.childAction.clear(); - } - - /** - * @return the task group associated with this external child resource. - */ - @Override - public TaskGroup taskGroup() { - return this.childAction.taskGroup(); - } - - /** - * Prepare this external child resource for update. - * - * @return this external child resource prepared for update - */ - @SuppressWarnings("unchecked") - protected final FluentModelT prepareUpdate() { - this.setPendingOperation(ExternalChildResourceImpl.PendingOperation.ToBeUpdated); - return (FluentModelT) this; - } - - /** - * Creates this external child resource. - * - * @return the observable to track the create action - */ - public abstract Mono createResourceAsync(); - - /** - * Update this external child resource. - * - * @return the observable to track the update action - */ - public abstract Mono updateResourceAsync(); - - /** - * Delete this external child resource. - * - * @return the observable to track the delete action. - */ - public abstract Mono deleteResourceAsync(); - - /** - * @return the key of this child resource in the collection maintained by ExternalChildResourceCollectionImpl - */ - public String childResourceKey() { - return name(); - } - - @Override - public final FluentModelT refresh() { - return refreshAsync().block(); - } - - @Override - @SuppressWarnings("unchecked") - public Mono refreshAsync() { - final ExternalChildResourceImpl self = this; - return this.getInnerAsync().map(innerModelT -> { - self.setInner(innerModelT); - return (FluentModelT) self; - }); - } - - /** - * Add a dependency task item for this model. - * - * @param dependency the dependency task item. - * @return key to be used as parameter to taskResult(string) method to retrieve result the task item - */ - protected String addDependency(FunctionalTaskItem dependency) { - Objects.requireNonNull(dependency); - return this.taskGroup().addDependency(dependency); - } - - /** - * Add a dependency task group for this model. - * - * @param dependency the dependency. - * @return key to be used as parameter to taskResult(string) method to retrieve result of root - * task in the given dependency task group - */ - protected String addDependency(TaskGroup.HasTaskGroup dependency) { - Objects.requireNonNull(dependency); - this.taskGroup().addDependencyTaskGroup(dependency.taskGroup()); - return dependency.taskGroup().key(); - } - - /** - * Add a creatable dependency for this model. - * - * @param creatable the creatable dependency. - * @return the key to be used as parameter to taskResult(string) method to retrieve created dependency - */ - @SuppressWarnings("unchecked") - protected String addDependency(Creatable creatable) { - TaskGroup.HasTaskGroup dependency = (TaskGroup.HasTaskGroup) creatable; - return this.addDependency(dependency); - } - - /** - * Add an appliable dependency for this model. - * - * @param appliable the appliable dependency. - * @return the key to be used as parameter to taskResult(string) method to retrieve updated dependency - */ - @SuppressWarnings("unchecked") - protected String addDependency(Appliable appliable) { - TaskGroup.HasTaskGroup dependency = (TaskGroup.HasTaskGroup) appliable; - return this.addDependency(dependency); - } - - /** - * Add an executable dependency for this model. - * - * @param executable the executable dependency - * @return the key to be used as parameter to taskResult(string) method to retrieve result of executing - * the executable dependency - */ - @SuppressWarnings("unchecked") - protected String addDependency(Executable executable) { - TaskGroup.HasTaskGroup dependency = (TaskGroup.HasTaskGroup) executable; - return this.addDependency(dependency); - } - - /** - * Add a "post-run" dependent task item for this model. - * - * @param dependent the "post-run" dependent task item. - * @return key to be used as parameter to taskResult(string) method to retrieve result of root - * task in the given dependent task group - */ - public String addPostRunDependent(FunctionalTaskItem dependent) { - Objects.requireNonNull(dependent); - return this.taskGroup().addPostRunDependent(dependent); - } - - /** - * Add a "post-run" dependent for this model. - * - * @param dependent the "post-run" dependent. - * @return key to be used as parameter to taskResult(string) method to retrieve result of root - * task in the given dependent task group - */ - protected String addPostRunDependent(TaskGroup.HasTaskGroup dependent) { - Objects.requireNonNull(dependent); - this.taskGroup().addPostRunDependentTaskGroup(dependent.taskGroup()); - return dependent.taskGroup().key(); - } - - /** - * Add a creatable "post-run" dependent for this model. - * - * @param creatable the creatable "post-run" dependent. - * @return the key to be used as parameter to taskResult(string) method to retrieve created "post-run" dependent - */ - @SuppressWarnings("unchecked") - protected String addPostRunDependent(Creatable creatable) { - TaskGroup.HasTaskGroup dependency = (TaskGroup.HasTaskGroup) creatable; - return this.addPostRunDependent(dependency); - } - - /** - * Add an appliable "post-run" dependent for this model. - * - * @param appliable the appliable "post-run" dependent. - * @return the key to be used as parameter to taskResult(string) method to retrieve updated "post-run" dependent - */ - @SuppressWarnings("unchecked") - protected String addPostRunDependent(Appliable appliable) { - TaskGroup.HasTaskGroup dependency = (TaskGroup.HasTaskGroup) appliable; - return this.addPostRunDependent(dependency); - } - - /** - * Add an executable "post-run" dependent for this model. - * - * @param executable the executable "post-run" dependent - * @return the key to be used as parameter to taskResult(string) method to retrieve result of executing - * the executable "post-run" dependent - */ - @SuppressWarnings("unchecked") - protected void addPostRunDependent(Executable executable) { - TaskGroup.HasTaskGroup dependency = (TaskGroup.HasTaskGroup) executable; - this.addPostRunDependent(dependency); - } - - /** - * Enables adding delayed dependencies and depends. - */ - public void beforeGroupCreateOrUpdate() { - // NOP: Extended types can override this to add additional dependencies - // - } - - @Override - public Mono createAsync() { - return createOrUpdateAsync(); - } - - @Override - public FluentModelT create() { - return createAsync().block(); - } - - @Override - public Mono applyAsync() { - return createOrUpdateAsync(); - } - - @Override - public FluentModelT apply() { - return applyAsync().block(); - } - - @Override - public Mono createAsync(Context context) { - return invokeTaskGroupAsync(context); - } - - @Override - public FluentModelT create(Context context) { - return createAsync(context).block(); - } - - @Override - public Mono applyAsync(Context context) { - return invokeTaskGroupAsync(context); - } - - @Override - public FluentModelT apply(Context context) { - return applyAsync(context).block(); - } - - @SuppressWarnings("unchecked") - private Mono createOrUpdateAsync() { - return taskGroup().invokeAsync() - .map(indexable -> (FluentModelT) indexable) - .onErrorMap(AggregatedManagementException::convertToManagementException); - } - - @SuppressWarnings("unchecked") - private Mono invokeTaskGroupAsync(Context context) { - return taskGroup().invokeAsync() - .contextWrite(c -> c.putAll(FluxUtil.toReactorContext(context).readOnly())) - .map(indexable -> (FluentModelT) indexable) - .onErrorMap(AggregatedManagementException::convertToManagementException); - } - - protected abstract Mono getInnerAsync(); - - protected Mono afterPostRunAsync(boolean isGroupFaulted) { - return Mono.empty(); - } - - /** - * The possible operation pending on a child resource in-memory. - */ - public enum PendingOperation { - /** - * No action needs to be taken on resource. - */ - None, - /** - * Child resource required to be created. - */ - ToBeCreated, - /** - * Child resource required to be updated. - */ - ToBeUpdated, - /** - * Child resource required to be deleted. - */ - ToBeRemoved - } - - /** - * A TaskItem in the graph, when invoked performs actions (create, update or delete) on an - * external child resource it composes. - */ - private class ExternalChildActionTaskItem extends IndexableTaskItem { - /** - * The composed external child resource. - */ - private final ExternalChildResourceImpl externalChild; - - /** - * Creates ExternalChildActionTaskItem. - * - * @param externalChild an external child this TaskItem composes. - */ - ExternalChildActionTaskItem( - final ExternalChildResourceImpl externalChild) { - this.externalChild = externalChild; - } - - /** - * Creates ExternalChildActionTaskItem. - * - * @param key the task group key for this item - * @param externalChild an external child this TaskItem composes. - */ - ExternalChildActionTaskItem(final String key, - final ExternalChildResourceImpl externalChild) { - super(key); - this.externalChild = externalChild; - } - - @Override - public void beforeGroupInvoke() { - this.externalChild.beforeGroupCreateOrUpdate(); - } - - @Override - public Mono invokeTaskAsync(TaskGroup.InvocationContext context) { - switch (this.externalChild.pendingOperation()) { - case ToBeCreated: - return this.externalChild.createResourceAsync() - .doOnNext(createdExternalChild -> externalChild.setPendingOperation(PendingOperation.None)) - .map(createdExternalChild -> createdExternalChild); - case ToBeUpdated: - return this.externalChild.updateResourceAsync() - .doOnNext(createdExternalChild -> externalChild.setPendingOperation(PendingOperation.None)) - .map(updatedExternalChild -> updatedExternalChild); - case ToBeRemoved: - return this.externalChild.deleteResourceAsync() - .doOnSuccess(aVoid -> externalChild.setPendingOperation(PendingOperation.None)) - .map(aVoid -> voidIndexable()); - default: - // PendingOperation.None - // - return Mono.error(new IllegalStateException( - String.format("No action pending on child resource: %s, invokeAsync should not be called ", - externalChild.name))); - } - } - - @Override - public Mono invokeAfterPostRunAsync(boolean isGroupFaulted) { - return this.externalChild.afterPostRunAsync(isGroupFaulted); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/implementation/GroupableParentResourceImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/implementation/GroupableParentResourceImpl.java deleted file mode 100644 index acf38633539a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/implementation/GroupableParentResourceImpl.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.arm.models.implementation; - -import com.azure.resourcemanager.resources.fluentcore.arm.Manager; -import com.azure.resourcemanager.resources.fluentcore.arm.models.Resource; -import reactor.core.publisher.Mono; - -/** - * The implementation for GroupableResource. - * (Internal use only) - * - * @param The fluent model type - * @param Azure inner resource class type - * @param the implementation type of the fluent model type - * @param the service manager type - */ -public abstract class GroupableParentResourceImpl< - FluentModelT extends Resource, - InnerModelT extends com.azure.core.management.Resource, - FluentModelImplT extends GroupableParentResourceImpl, - ManagerT extends Manager> - extends - GroupableResourceImpl { - - protected GroupableParentResourceImpl( - String name, - InnerModelT innerObject, - ManagerT manager) { - super(name, innerObject, manager); - initializeChildrenFromInner(); - } - - protected abstract Mono createInner(); - - protected abstract void initializeChildrenFromInner(); - - protected void beforeCreating() { } - - protected void afterCreating() { } - - @Override - public Mono createResourceAsync() { - @SuppressWarnings("unchecked") final FluentModelT self = (FluentModelT) this; - beforeCreating(); - return createInner() - .flatMap(inner -> { - setInner(inner); - try { - initializeChildrenFromInner(); - afterCreating(); - return Mono.just(self); - } catch (Exception e) { - return Mono.error(e); - } - }); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/implementation/GroupableResourceImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/implementation/GroupableResourceImpl.java deleted file mode 100644 index 66e445866c37..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/implementation/GroupableResourceImpl.java +++ /dev/null @@ -1,167 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.arm.models.implementation; - -import com.azure.core.management.Region; -import com.azure.resourcemanager.resources.fluentcore.arm.Manager; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils; -import com.azure.resourcemanager.resources.fluentcore.arm.models.GroupableResource; -import com.azure.resourcemanager.resources.fluentcore.arm.models.Resource; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.models.ResourceGroup; - -/** - * The implementation for {@link GroupableResource}. - * (Internal use only) - * - * @param The fluent model type - * @param Azure inner resource class type - * @param the implementation type of the fluent model type - * @param the service manager type - */ -public abstract class GroupableResourceImpl< - FluentModelT extends Resource, - InnerModelT extends com.azure.core.management.Resource, - FluentModelImplT extends GroupableResourceImpl, - ManagerT extends Manager> - extends - ResourceImpl - implements - GroupableResource { - - protected final ManagerT myManager; - protected Creatable creatableGroup; - private String groupName; - - protected GroupableResourceImpl( - String name, - InnerModelT innerObject, - ManagerT manager) { - super(name, innerObject); - this.myManager = manager; - } - - // Helpers - - protected String resourceIdBase() { - return new StringBuilder() - .append("/subscriptions/").append(this.myManager.subscriptionId()) - .append("/resourceGroups/").append(this.resourceGroupName()) - .toString(); - } - - /******************************************* - * Getters. - *******************************************/ - - @Override - public ManagerT manager() { - return this.myManager; - } - - @Override - public String resourceGroupName() { - if (this.groupName == null) { - return ResourceUtils.groupFromResourceId(this.id()); - } else { - return this.groupName; - } - } - - protected Creatable creatableGroup() { - return this.creatableGroup; - } - - /**************************************** - * withGroup implementations. - ****************************************/ - - /** - * Creates a new resource group to put the resource in. - *

    - * The group will be created in the same location as the resource. - * - * @param groupName the name of the new group - * @return the next stage of the definition - */ - public final FluentModelImplT withNewResourceGroup(String groupName) { - return this.withNewResourceGroup( - this.myManager.resourceManager().resourceGroups().define(groupName).withRegion(this.regionName())); - } - - /** - * Creates a new resource group to put the resource in. - *

    - * The group will be created in the same location as the resource. - * - * @param groupName the name of the new group - * @param region the region where resource group needs to be created - * @return the next stage of the definition - */ - public final FluentModelImplT withNewResourceGroup(String groupName, Region region) { - return this.withNewResourceGroup( - this.myManager.resourceManager().resourceGroups().define(groupName).withRegion(region)); - } - - /** - * Creates a new resource group to put the resource in. - *

    - * The group will be created in the same location as the resource. - * The group's name is automatically derived from the resource's name. - * - * @return the next stage of the definition - */ - public final FluentModelImplT withNewResourceGroup() { - return this.withNewResourceGroup(this.name() + "group"); - } - - /** - * Creates a new resource group to put the resource in. - *

    - * The group will be created in the same location as the resource. - * The group's name is automatically derived from the resource's name. - * - * @param region the region where resource group needs to be created - * @return the next stage of the definition - */ - public final FluentModelImplT withNewResourceGroup(Region region) { - return this.withNewResourceGroup(this.name() + "group", region); - } - - /** - * Creates a new resource group to put the resource in, based on the definition specified. - * - * @param creatable a creatable definition for a new resource group - * @return the next stage of the definition - */ - @SuppressWarnings("unchecked") - public final FluentModelImplT withNewResourceGroup(Creatable creatable) { - this.groupName = creatable.name(); - this.creatableGroup = creatable; - this.addDependency(creatable); - return (FluentModelImplT) this; - } - - /** - * Associates the resources with an existing resource group. - * - * @param groupName the name of an existing resource group to put this resource in. - * @return the next stage of the definition - */ - @SuppressWarnings("unchecked") - public final FluentModelImplT withExistingResourceGroup(String groupName) { - this.groupName = groupName; - return (FluentModelImplT) this; - } - - /** - * Associates the resources with an existing resource group. - * - * @param group an existing resource group to put the resource in - * @return the next stage of the definition - */ - public final FluentModelImplT withExistingResourceGroup(ResourceGroup group) { - return this.withExistingResourceGroup(group.name()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/implementation/IndependentChildImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/implementation/IndependentChildImpl.java deleted file mode 100644 index 3c6f92fef320..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/implementation/IndependentChildImpl.java +++ /dev/null @@ -1,129 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.arm.models.implementation; - -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.models.IndependentChild; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceId; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils; -import com.azure.resourcemanager.resources.fluentcore.arm.models.Resource; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.CreatableUpdatableImpl; -import reactor.core.publisher.Mono; - -/** - * Implementation for the child resource which can be CRUDed independently from the parent resource. - * (internal use only) - * - * @param The fluent model type - * @param the fluent model for parent resource - * @param Azure inner resource class type - * @param the implementation type of the fluent model type - * @param the client manager type representing the service - */ -public abstract class IndependentChildImpl< - FluentModelT extends IndependentChild, - FluentParentModelT extends Resource & HasResourceGroup, - InnerModelT, - FluentModelImplT extends IndependentChildImpl, - ManagerT> - extends - CreatableUpdatableImpl - implements - IndependentChild, - IndependentChild.DefinitionStages.WithParentResource { - private String groupName; - protected String parentName; - private String creatableParentResourceKey; - private final ManagerT manager; - - /** - * Creates a new instance of IndependentChildResourceImpl. - * - * @param name the name of the resource - * @param innerObject the inner object - */ - protected IndependentChildImpl(String name, InnerModelT innerObject, ManagerT manager) { - super(name, innerObject); - this.manager = manager; - } - - /******************************************* - * Getters. - *******************************************/ - - @Override - public ManagerT manager() { - return this.manager; - } - - @Override - public String resourceGroupName() { - if (this.groupName == null) { - return ResourceUtils.groupFromResourceId(this.id()); - } else { - return this.groupName; - } - } - - protected String parentName() { - return this.parentName; - } - - /** - * @return true if currently in define..create mode - */ - @Override - public boolean isInCreateMode() { - return this.id() == null; - } - - @SuppressWarnings("unchecked") - @Override - public FluentModelImplT withExistingParentResource(String groupName, String parentName) { - this.groupName = groupName; - this.parentName = parentName; - - return (FluentModelImplT) this; - } - - @Override - public FluentModelImplT withExistingParentResource(FluentParentModelT existingParentResource) { - return withExistingParentResource(existingParentResource.resourceGroupName(), existingParentResource.name()); - } - - @SuppressWarnings("unchecked") - @Override - public FluentModelImplT withNewParentResource(Creatable parentResourceCreatable) { - if (this.creatableParentResourceKey == null) { - this.creatableParentResourceKey = this.addDependency(parentResourceCreatable); - } - return (FluentModelImplT) this; - } - - @Override - public void setInner(InnerModelT inner) { - super.setInner(inner); - this.setParentName(inner); - } - - @SuppressWarnings("unchecked") - @Override - public Mono createResourceAsync() { - if (this.creatableParentResourceKey != null) { - FluentParentModelT parentResource = this.taskResult(this.creatableParentResourceKey); - withExistingParentResource(parentResource); - } - return this.createChildResourceAsync(); - } - - protected void setParentName(InnerModelT inner) { - if (this.id() != null) { - this.parentName = ResourceId.fromString(this.id()).parent().name(); - } - } - - protected abstract Mono createChildResourceAsync(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/implementation/IndependentChildResourceImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/implementation/IndependentChildResourceImpl.java deleted file mode 100644 index b42cd4173876..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/implementation/IndependentChildResourceImpl.java +++ /dev/null @@ -1,152 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.arm.models.implementation; - -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.models.IndependentChildResource; -import com.azure.core.management.Region; -import com.azure.resourcemanager.resources.fluentcore.arm.models.Resource; - -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; -import java.util.TreeMap; - -/** - * Implementation for the child resource which can be CRUDed independently from the parent resource. - * (internal use only) - * - * @param The fluent model type - * @param the fluent model for parent resource - * @param Azure inner resource class type - * @param the implementation type of the fluent model type - * @param the client manager type representing the service - */ -public abstract class IndependentChildResourceImpl< - FluentModelT extends IndependentChildResource, - FluentParentModelT extends Resource & HasResourceGroup, - InnerModelT extends com.azure.core.management.Resource, - FluentModelImplT extends IndependentChildResourceImpl, - ManagerT> - extends - IndependentChildImpl - implements - IndependentChildResource { - /** - * Creates a new instance of CreatableUpdatableImpl. - * - * @param name the name of the resource - * @param innerObject the inner object - */ - protected IndependentChildResourceImpl(String name, InnerModelT innerObject, ManagerT manager) { - super(name, innerObject, manager); - } - - /******************************************* - * Getters. - *******************************************/ - - @Override - public String regionName() { - return this.innerModel().location(); - } - - @Override - public Region region() { - return Region.fromName(this.regionName()); - } - - @Override - public Map tags() { - Map tags = this.innerModel().tags(); - if (tags == null) { - tags = new TreeMap<>(); - } - return Collections.unmodifiableMap(tags); - } - - @Override - public String id() { - if (this.innerModel() != null) { - return this.innerModel().id(); - } - - return null; - } - - @Override - public String type() { - return this.innerModel().type(); - } - - @Override - public String name() { - if (this.innerModel().name() == null) { - return super.name(); - } else { - return this.innerModel().name(); - } - } - - /************************************************** - * Tag setters. - **************************************************/ - - /** - * Specifies tags for the resource as a {@link Map}. - * - * @param tags a {@link Map} of tags - * @return the next stage of the definition/update - */ - @SuppressWarnings("unchecked") - public final FluentModelImplT withTags(Map tags) { - this.innerModel().withTags(new HashMap<>(tags)); - return (FluentModelImplT) this; - } - - /** - * Adds a tag to the resource. - * - * @param key the key for the tag - * @param value the value for the tag - * @return the next stage of the definition/update - */ - @SuppressWarnings("unchecked") - public final FluentModelImplT withTag(String key, String value) { - if (this.innerModel().tags() == null) { - this.innerModel().withTags(new HashMap()); - } - this.innerModel().tags().put(key, value); - return (FluentModelImplT) this; - } - - /** - * Removes a tag from the resource. - * - * @param key the key of the tag to remove - * @return the next stage of the definition/update - */ - @SuppressWarnings("unchecked") - public final FluentModelImplT withoutTag(String key) { - if (this.innerModel().tags() != null) { - this.innerModel().tags().remove(key); - } - return (FluentModelImplT) this; - } - - /** - * @return true if currently in define..create mode - */ - @Override - public boolean isInCreateMode() { - return this.innerModel().id() == null; - } - - @Override - public FluentModelImplT withExistingParentResource(FluentParentModelT existingParentResource) { - this.innerModel().withLocation(existingParentResource.regionName()); - return super.withExistingParentResource(existingParentResource); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/implementation/ResourceImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/implementation/ResourceImpl.java deleted file mode 100644 index f61dba8dbd96..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/implementation/ResourceImpl.java +++ /dev/null @@ -1,183 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.arm.models.implementation; - -import com.azure.core.management.Region; -import com.azure.resourcemanager.resources.fluentcore.arm.models.Resource; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.CreatableUpdatableImpl; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.TreeMap; - -/** - * The implementation for {@link Resource} and base class for all resource - * model implementations. - * (Internal use only) - * - * @param The fluent model type - * @param Azure inner resource class type - * @param the implementation type of the fluent model type - */ -public abstract class ResourceImpl< - FluentModelT extends Resource, - InnerModelT extends com.azure.core.management.Resource, - FluentModelImplT extends ResourceImpl> - extends - CreatableUpdatableImpl - implements - Resource { - protected ResourceImpl(String name, InnerModelT innerObject) { - super(name, innerObject); - if (innerObject.tags() == null) { - innerObject.withTags(new TreeMap()); - } - } - - /******************************************* - * Getters. - *******************************************/ - - @Override - public String regionName() { - return this.innerModel().location(); - } - - @Override - public Region region() { - return Region.fromName(this.regionName()); - } - - @Override - public Map tags() { - Map tags = this.innerModel().tags(); - if (tags == null) { - tags = new TreeMap<>(); - } - return Collections.unmodifiableMap(tags); - } - - @Override - public String id() { - return this.innerModel().id(); - } - - @Override - public String type() { - return this.innerModel().type(); - } - - @Override - public String name() { - if (this.innerModel().name() == null) { - return super.name(); - } else { - return this.innerModel().name(); - } - } - - /************************************************** - * Tag setters. - **************************************************/ - - /** - * Specifies tags for the resource as a {@link Map}. - * - * @param tags a {@link Map} of tags - * @return the next stage of the definition/update - */ - @SuppressWarnings("unchecked") - public final FluentModelImplT withTags(Map tags) { - this.innerModel().withTags(new HashMap<>(tags)); - return (FluentModelImplT) this; - } - - /** - * Adds a tag to the resource. - * - * @param key the key for the tag - * @param value the value for the tag - * @return the next stage of the definition/update - */ - @SuppressWarnings("unchecked") - public final FluentModelImplT withTag(String key, String value) { - if (this.innerModel().tags() == null) { - this.innerModel().withTags(new HashMap()); - } - this.innerModel().tags().put(key, value); - return (FluentModelImplT) this; - } - - /** - * Removes a tag from the resource. - * - * @param key the key of the tag to remove - * @return the next stage of the definition/update - */ - @SuppressWarnings("unchecked") - public final FluentModelImplT withoutTag(String key) { - if (this.innerModel().tags() != null) { - this.innerModel().tags().remove(key); - } - return (FluentModelImplT) this; - } - - /********************************************** - * Region setters - **********************************************/ - - /** - * Specifies the region for the resource by name. - * - * @param regionName The name of the region for the resource - * @return the next stage of the definition/update - */ - @SuppressWarnings("unchecked") - public final FluentModelImplT withRegion(String regionName) { - this.innerModel().withLocation(regionName); - return (FluentModelImplT) this; - } - - /** - * Specifies the region for the resource. - * - * @param region The location for the resource - * @return the next stage of the definition - */ - public final FluentModelImplT withRegion(Region region) { - return this.withRegion(region.toString()); - } - - /** - * @return true if currently in define..create mode - */ - @Override - public boolean isInCreateMode() { - return this.innerModel().id() == null; - } - - protected List innersFromWrappers(Collection> wrappers) { - return innersFromWrappers(wrappers, null); - } - - protected List innersFromWrappers(Collection> wrappers, - List inners) { - if (wrappers == null || wrappers.size() == 0) { - return inners; - } else { - if (inners == null) { - inners = new ArrayList<>(); - } - for (HasInnerModel wrapper : wrappers) { - inners.add(wrapper.innerModel()); - } - return inners; - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/implementation/package-info.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/implementation/package-info.java deleted file mode 100644 index a7baa2805187..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/implementation/package-info.java +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. - -/** - * This package contains the classes for ARM fluent core models implementation. - */ -package com.azure.resourcemanager.resources.fluentcore.arm.models.implementation; diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/package-info.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/package-info.java deleted file mode 100644 index d3be3cbdbbb6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/package-info.java +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. - -/** - * This package contains the base classes for resource models. - */ -package com.azure.resourcemanager.resources.fluentcore.arm.models; diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/package-info.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/package-info.java deleted file mode 100644 index 8f9364828aa4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. - -/** - * This package contains the common resource manager utility classes - * that are useful to other management plane libraries. - */ -package com.azure.resourcemanager.resources.fluentcore.arm; diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/collection/InnerSupportsDelete.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/collection/InnerSupportsDelete.java deleted file mode 100644 index 5ed316ccb630..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/collection/InnerSupportsDelete.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.collection; - -import reactor.core.publisher.Mono; - -/** - * Provides access to deleting Azure resources of a specific type in a subscription. - *

    - * (Note: this interface is not intended to be implemented by user code) - * - * @param Response type for delete. - */ -public interface InnerSupportsDelete { - /** - * Deletes a resource asynchronously. - * - * @param resourceGroupName The name of the resource group within the user's subscription. - * @param resourceName The name of the resource within specified resource group. - * @return the {@link Mono} object if successful. - */ - Mono deleteAsync(String resourceGroupName, String resourceName); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/collection/InnerSupportsGet.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/collection/InnerSupportsGet.java deleted file mode 100644 index 6fc527d88717..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/collection/InnerSupportsGet.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.collection; - -import reactor.core.publisher.Mono; - -/** - * Provides access to listing Azure resources of a specific type in a subscription. - *

    - * (Note: this interface is not intended to be implemented by user code) - * - * @param the fluent type of the resource - */ -public interface InnerSupportsGet { - /** - * Returns the specific resource. - * - * @param resourceGroupName The name of the resource group within the user's subscription. - * @param resourceName The name of the resource within specified resource group. - * @return specific resource. - */ - InnerT getByResourceGroup(String resourceGroupName, String resourceName); - - /** - * Returns the specific resource asynchronously. - * - * @param resourceGroupName The name of the resource group within the user's subscription. - * @param resourceName The name of the resource within specified resource group. - * @return a {@link Mono} emits the found resource asynchronously. - */ - Mono getByResourceGroupAsync(String resourceGroupName, String resourceName); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/collection/InnerSupportsListing.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/collection/InnerSupportsListing.java deleted file mode 100644 index 0ac98b6a7b6e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/collection/InnerSupportsListing.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.collection; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; - -/** - * Provides access to listing Azure resources of a specific type in a subscription. - *

    - * (Note: this interface is not intended to be implemented by user code) - * - * @param the fluent type of the resource - */ -public interface InnerSupportsListing { - /** - * Returns the observable for the page list of all resources of specific type in subscription. - * - * @return the {@link PagedFlux} of resources if successful. - */ - PagedFlux listAsync(); - - /** - * Returns the observable for the page list of all resources of specific type in specified resource group. - * - * @param resourceGroup name of the resource group. - * @return the {@link PagedFlux} of resources if successful. - */ - PagedFlux listByResourceGroupAsync(String resourceGroup); - - /** - * Lists the page list of all resources of specific type available in subscription. - * - * @return the {@link PagedIterable} of resources if successful. - */ - PagedIterable list(); - - /** - * Lists the page list of all resources of specific type in specified resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. - * @return the {@link PagedIterable} of resources if successful. - */ - PagedIterable listByResourceGroup(String resourceGroupName); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/collection/SupportsBatchCreation.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/collection/SupportsBatchCreation.java deleted file mode 100644 index 11dc3b769822..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/collection/SupportsBatchCreation.java +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.collection; - -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.CreatedResources; -import com.azure.resourcemanager.resources.fluentcore.model.Indexable; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -import java.util.List; - -/** - * Providing access to creating a batch of Azure top level resources of same type. - *

    - * (Note: this interface is not intended to be implemented by user code) - * - * @param the top level Azure resource type - */ -public interface SupportsBatchCreation { - /** - * Executes the create requests on a collection (batch) of resources. - * - * @param creatables the creatables in the batch - * @return the batch operation result from which created resources in this batch can be accessed. - */ - @SuppressWarnings("unchecked") - CreatedResources create(Creatable... creatables); - - /** - * Executes the create requests on a collection (batch) of resources. - * - * @param creatables the list of creatables in the batch - * @return the batch operation result from which created resources in this batch can be accessed. - */ - CreatedResources create(List> creatables); - - /** - * Puts the requests to create a batch of resources into the queue and allow the HTTP client to execute it when - * system resources are available. - * - * @param creatables the creatables in the batch - * @return a {@link Mono} that emits the found resource asynchronously. - */ - @SuppressWarnings("unchecked") - Flux createAsync(Creatable... creatables); - - /** - * Puts the requests to create a batch of resources into the queue and allow the HTTP client to execute it when - * system resources are available. - * - * @param creatables the list of creatables in the batch - * @return a {@link Mono} that emits the found resource asynchronously. - */ - Flux createAsync(List> creatables); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/collection/SupportsBeginDeletingByName.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/collection/SupportsBeginDeletingByName.java deleted file mode 100644 index f69d47ef9e17..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/collection/SupportsBeginDeletingByName.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.collection; - -import reactor.core.publisher.Mono; - -/** - * Provides access to deleting a resource from Azure, identifying it by its resource ID. - *

    - * (Note: this interface is not intended to be implemented by user code) - */ -public interface SupportsBeginDeletingByName { - /** - * Begins deleting a resource from Azure, identifying it by its resource name. The - * resource will stay until get() returns null. - * - * @param name the name of the resource to delete - */ - void beginDeleteByName(String name); - - - /** - * Asynchronously begins deleting a resource from Azure, identifying it by its resource name. - * The resource will stay until get() returns null. - * - * @param name the name the resource to delete - * @return a representation of the deferred computation of this call - */ - Mono beginDeleteByNameAsync(String name); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/collection/SupportsCreating.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/collection/SupportsCreating.java deleted file mode 100644 index 9931884ec066..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/collection/SupportsCreating.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.collection; - -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; - -/** - * Providing access to creating Azure top level resources. - *

    - * (Note: this interface is not intended to be implemented by user code) - * - * @param the initial blank definition interface - */ -public interface SupportsCreating { - /** - * Begins a definition for a new resource. - *

    - * This is the beginning of the builder pattern used to create top level resources - * in Azure. The final method completing the definition and starting the actual resource creation - * process in Azure is {@link Creatable#create()}. - *

    - * Note that the {@link Creatable#create()} method is - * only available at the stage of the resource definition that has the minimum set of input - * parameters specified. If you do not see {@link Creatable#create()} among the available methods, it - * means you have not yet specified all the required input settings. Input settings generally begin - * with the word "with", for example: .withNewResourceGroup() and return the next stage - * of the resource definition, as an interface in the "fluent interface" style. - * - * @param name the name of the new resource - * @return the first stage of the new resource definition - */ - T define(String name); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/collection/SupportsDeletingById.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/collection/SupportsDeletingById.java deleted file mode 100644 index abae7e70654c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/collection/SupportsDeletingById.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.collection; - -import reactor.core.publisher.Mono; - -/** - * Provides access to deleting a resource from Azure, identifying it by its resource ID. - *

    - * (Note: this interface is not intended to be implemented by user code) - */ -public interface SupportsDeletingById { - /** - * Deletes a resource from Azure, identifying it by its resource ID. - * - * @param id the resource ID of the resource to delete - */ - void deleteById(String id); - - /** - * Asynchronously delete a resource from Azure, identifying it by its resource ID. - * - * @param id the resource ID of the resource to delete - * @return a representation of the deferred computation of this call - */ - Mono deleteByIdAsync(String id); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/collection/SupportsDeletingByName.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/collection/SupportsDeletingByName.java deleted file mode 100644 index bb3bd688b920..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/collection/SupportsDeletingByName.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.collection; - -import reactor.core.publisher.Mono; - -/** - * Provides access to deleting a resource from Azure, identifying it by its resource name. - *

    - * (Note: this interface is not intended to be implemented by user code) - */ -public interface SupportsDeletingByName { - /** - * Deletes a resource from Azure, identifying it by its resource name. - * - * @param name the name of the resource to delete - */ - void deleteByName(String name); - - - /** - * Asynchronously delete a resource from Azure, identifying it by its resource name. - * - * @param name the name of the resource to delete - * @return a representation of the deferred computation of this call - */ - Mono deleteByNameAsync(String name); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/collection/SupportsListing.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/collection/SupportsListing.java deleted file mode 100644 index fb6c3f0ecc5b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/collection/SupportsListing.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.collection; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; - -/** - * Provides access to listing Azure resources of a specific type in a subscription. - *

    - * (Note: this interface is not intended to be implemented by user code) - * - * @param the fluent type of the resource - */ -public interface SupportsListing { - /** - * Lists all the resources of the specified type in the currently selected subscription. - * - * @return A {@link PagedIterable} of resources - */ - PagedIterable list(); - - /** - * Lists all the resources of the specified type in the currently selected subscription. - * - * @return A {@link PagedFlux} of resources - */ - PagedFlux listAsync(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/collection/SupportsListingByFilter.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/collection/SupportsListingByFilter.java deleted file mode 100644 index 4b8921c75c8d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/collection/SupportsListingByFilter.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.collection; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; - -/** - * Provides access to listing Azure resources of a specific type filtered based on OData syntax. - * http://docs.oasis-open.org/odata/odata/v4.0/errata03/os/complete/part2-url-conventions/odata-v4.0-errata03-os-part2-url-conventions-complete.html#_Toc453752358 - *

    - * (Note: this interface is not intended to be implemented by user code) - * - * @param the fluent type of the resource - */ -public interface SupportsListingByFilter { - /** - * Lists all the resources of the specified type with specific filter. - * - * @param filter the filter based on OData syntax - * @return a {@link PagedIterable} of resources - */ - PagedIterable listByFilter(String filter); - - /** - * Lists all the resources of the specified type with specific filter. - * - * @param filter the filter based on OData syntax - * @return a representation of the deferred computation of this call, returning the requested resources - */ - PagedFlux listByFilterAsync(String filter); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/collection/SupportsListingByRegion.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/collection/SupportsListingByRegion.java deleted file mode 100644 index d13e7a64c84e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/collection/SupportsListingByRegion.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.collection; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.Region; - -/** - * Provides access to listing Azure resources of a specific type based on their region. - *

    - * (Note: this interface is not intended to be implemented by user code) - * - * @param the fluent type of the resource - */ -public interface SupportsListingByRegion { - /** - * Lists all the resources of the specified type in the specified region. - * - * @param region the selected Azure region - * @return a {@link PagedIterable} of resources - */ - PagedIterable listByRegion(Region region); - - /** - * List all the resources of the specified type in the specified region. - * - * @param regionName the name of an Azure region - * @return a {@link PagedIterable} list of resources - */ - PagedIterable listByRegion(String regionName); - - /** - * Lists all the resources of the specified type in the specified region. - * - * @param region the selected Azure region - * @return a representation of the deferred computation of this call, returning the requested resources - */ - PagedFlux listByRegionAsync(Region region); - - /** - * List all the resources of the specified type in the specified region. - * - * @param regionName the name of an Azure region - * @return a representation of the deferred computation of this call, returning the requested resources - */ - PagedFlux listByRegionAsync(String regionName); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/collection/SupportsListingByTag.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/collection/SupportsListingByTag.java deleted file mode 100644 index 733e9b7baad0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/collection/SupportsListingByTag.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.collection; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; - -/** - * Provides access to listing Azure resources of a specific type based on their tag. - *

    - * (Note: this interface is not intended to be implemented by user code) - * - * @param the fluent type of the resource - */ -public interface SupportsListingByTag { - /** - * Lists all the resources with the specified tag. - * - * @param tagName tag's name as the key - * @param tagValue tag's value - * @return a {@link PagedIterable} of resources - */ - PagedIterable listByTag(String tagName, String tagValue); - - /** - * Lists all the resources with the specified tag. - * - * @param tagName tag's name as the key - * @param tagValue tag's value - * @return a representation of the deferred computation of this call, returning the requested resources - */ - PagedFlux listByTagAsync(String tagName, String tagValue); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/collection/SupportsListingPrivateEndpointConnection.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/collection/SupportsListingPrivateEndpointConnection.java deleted file mode 100644 index 52e60e55879f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/collection/SupportsListingPrivateEndpointConnection.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.collection; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.resources.fluentcore.arm.models.PrivateEndpointConnection; - -/** - * Provides access to listing Private endpoint connections to an Azure resource. - */ -public interface SupportsListingPrivateEndpointConnection { - - /** - * Gets the collection of Private endpoint connection. - * - * @return the collection of Private endpoint connection. - */ - PagedIterable listPrivateEndpointConnections(); - - /** - * Gets the collection of Private endpoint connection. - * - * @return the collection of Private endpoint connection. - */ - PagedFlux listPrivateEndpointConnectionsAsync(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/collection/SupportsListingPrivateLinkResource.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/collection/SupportsListingPrivateLinkResource.java deleted file mode 100644 index ce80fcf2b06d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/collection/SupportsListingPrivateLinkResource.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.collection; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.resources.fluentcore.arm.models.PrivateLinkResource; - -/** - * Provides access to listing Private link resources for an Azure resource. - */ -public interface SupportsListingPrivateLinkResource { - - /** - * Gets the collection of supported Private link resource. - * - * @return the collection of supported Private link resource. - */ - PagedIterable listPrivateLinkResources(); - - /** - * Gets the collection of supported Private link resource. - * - * @return the collection of supported Private link resource. - */ - PagedFlux listPrivateLinkResourcesAsync(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/collection/SupportsUpdatingPrivateEndpointConnection.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/collection/SupportsUpdatingPrivateEndpointConnection.java deleted file mode 100644 index 4e27f2e533a8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/collection/SupportsUpdatingPrivateEndpointConnection.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.collection; - -import reactor.core.publisher.Mono; - -/** - * Provides access to update a private endpoint connection. - */ -public interface SupportsUpdatingPrivateEndpointConnection { - - /** - * Approves the private endpoint connection. - * - * @param privateEndpointConnectionName the name of the private endpoint connection. - */ - void approvePrivateEndpointConnection(String privateEndpointConnectionName); - - /** - * Approves the private endpoint connection. - * - * @param privateEndpointConnectionName the name of the private endpoint connection. - * @return the completion. - */ - Mono approvePrivateEndpointConnectionAsync(String privateEndpointConnectionName); - - /** - * Rejects the private endpoint connection. - * - * @param privateEndpointConnectionName the name of the private endpoint connection. - */ - void rejectPrivateEndpointConnection(String privateEndpointConnectionName); - - /** - * Rejects the private endpoint connection. - * - * @param privateEndpointConnectionName the name of the private endpoint connection. - * @return the completion. - */ - Mono rejectPrivateEndpointConnectionAsync(String privateEndpointConnectionName); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/collection/package-info.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/collection/package-info.java deleted file mode 100644 index 7b22a70179b2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/collection/package-info.java +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. - -/** - * This package contains the base class for resource collections. - */ -package com.azure.resourcemanager.resources.fluentcore.collection; diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/dag/DAGNode.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/dag/DAGNode.java deleted file mode 100644 index a168920a9c88..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/dag/DAGNode.java +++ /dev/null @@ -1,165 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.dag; - -import com.azure.core.util.logging.ClientLogger; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.concurrent.locks.ReentrantLock; - -/** - * The type representing node in a {@link DAGraph}. - * - * @param the type of the data stored in the node - * @param the type of the node - */ -public class DAGNode> extends Node { - /** - * keys of other nodes those dependents on this node. - */ - private final List dependentKeys; - /** - * to track the dependency resolution count. - */ - private int toBeResolved; - /** - * indicates this node is the preparer or not. - */ - private boolean isPreparer; - /** - * lock used while performing concurrent safe operation on the node. - */ - private final ReentrantLock lock; - - private final ClientLogger logger = new ClientLogger(this.getClass()); - private static final String ERROR_MESSAGE_FORMAT = - "invalid state - %s: The dependency '%s' is already reported or there is no such dependencyKey"; - - /** - * Creates a DAG node. - * - * @param key unique id of the node - * @param data data to be stored in the node - */ - public DAGNode(final String key, final DataT data) { - super(key, data); - dependentKeys = new ArrayList<>(); - lock = new ReentrantLock(); - } - - /** - * @return the lock to be used while performing thread safe operation on this node. - */ - public ReentrantLock lock() { - return this.lock; - } - - /** - * @return a list of keys of nodes in {@link DAGraph} those are dependents on this node - */ - List dependentKeys() { - return Collections.unmodifiableList(this.dependentKeys); - } - - /** - * Mark the node identified by the given key as dependent of this node. - * - * @param key the id of the dependent node - */ - public void addDependent(String key) { - this.dependentKeys.add(key); - } - - /** - * @return a list of keys of nodes in {@link DAGraph} that this node depends on - */ - public List dependencyKeys() { - return this.children(); - } - - /** - * Mark the node identified by the given key as this node's dependency. - * - * @param dependencyKey the id of the dependency node - */ - public void addDependency(String dependencyKey) { - super.addChild(dependencyKey); - } - - /** - * Remove the dependency node identified by the given key from the dependencies. - * - * @param dependencyKey the id of the dependency node - */ - public void removeDependency(String dependencyKey) { - super.removeChild(dependencyKey); - } - - /** - * @return true if this node has any dependency - */ - public boolean hasDependencies() { - return this.hasChildren(); - } - - /** - * Mark or un-mark this node as preparer. - * - * @param isPreparer true if this node needs to be marked as preparer, false otherwise. - */ - public void setPreparer(boolean isPreparer) { - this.isPreparer = isPreparer; - } - - /** - * @return true if this node is marked as preparer - */ - public boolean isPreparer() { - return isPreparer; - } - - /** - * Initialize the node so that traversal can be performed on the parent DAG. - */ - public void initialize() { - this.toBeResolved = this.dependencyKeys().size(); - this.dependentKeys.clear(); - } - - /** - * @return true if all dependencies of this node are resolved - */ - boolean hasAllResolved() { - return toBeResolved == 0; - } - - /** - * Reports a dependency of this node has been successfully resolved. - * - * @param dependencyKey the id of the dependency node - */ - protected void onSuccessfulResolution(String dependencyKey) { - if (toBeResolved == 0) { - throw logger.logExceptionAsError(new RuntimeException( - String.format(ERROR_MESSAGE_FORMAT, key(), dependencyKey))); - } - toBeResolved--; - } - - /** - * Reports a dependency of this node has been faulted. - * - * @param dependencyKey the id of the dependency node - * @param throwable the reason for unsuccessful resolution - */ - protected void onFaultedResolution(String dependencyKey, Throwable throwable) { - if (toBeResolved == 0) { - throw logger.logExceptionAsError(new RuntimeException( - String.format(ERROR_MESSAGE_FORMAT, key(), dependencyKey))); - } - toBeResolved--; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/dag/DAGraph.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/dag/DAGraph.java deleted file mode 100644 index e72d90e60cf7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/dag/DAGraph.java +++ /dev/null @@ -1,282 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.dag; - -import com.azure.core.util.logging.ClientLogger; - -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.ConcurrentLinkedQueue; - -/** - * Type representing a DAG (directed acyclic graph). - *

    - * each node in a DAG is represented by {@link DAGNode} - * - * @param the type of the data stored in the graph nodes - * @param the type of the nodes in the graph - */ -public class DAGraph> extends Graph { - /** - * the root node in the graph. - * {@link this#nodeTable} contains all the nodes in this graph with this as the root. - */ - private final NodeT rootNode; - /** - * the immediate parent graphs of this graph. A parent graph is the one with it's root - * depends on this graph's root. - */ - protected List> parentDAGs; - /** - * to perform topological sort on the graph. During sorting queue contains the nodes which - * are ready to invoke. - */ - protected ConcurrentLinkedQueue queue; - - private final ClientLogger logger = new ClientLogger(this.getClass()); - - /** - * Creates a new DAG. - * - * @param rootNode the root node of this DAG - */ - public DAGraph(NodeT rootNode) { - this.parentDAGs = new ArrayList<>(); - this.rootNode = rootNode; - this.queue = new ConcurrentLinkedQueue<>(); - this.rootNode.setPreparer(true); - this.addNode(rootNode); - } - - /** - * @return true if this DAG is merged with one or more DAG and hence has parents - */ - public boolean hasParents() { - return this.parentDAGs.size() > 0; - } - - /** - * @return the root node of the DAG. - */ - protected NodeT root() { - return this.rootNode; - } - - /** - * Checks whether the given node is root node of this DAG. - * - * @param node the node {@link DAGNode} to be checked - * @return true if the given node is root node - */ - public boolean isRootNode(NodeT node) { - return this.rootNode == node; - } - - /** - * @return true if this dag is the preparer responsible for - * preparing the DAG for traversal. - */ - public boolean isPreparer() { - return this.rootNode.isPreparer(); - } - - /** - * Gets a node from the graph with the given key. - * - * @param key the key of the node - * @return the node - */ - public NodeT getNode(String key) { - return nodeTable.get(key); - } - - /** - * Mark root of this DAG depends on given DAG's root. - * - * @param dependencyGraph the dependency DAG - */ - public void addDependencyGraph(DAGraph dependencyGraph) { - this.rootNode.addDependency(dependencyGraph.rootNode.key()); - Map sourceNodeTable = dependencyGraph.nodeTable; - Map targetNodeTable = this.nodeTable; - this.merge(sourceNodeTable, targetNodeTable); - dependencyGraph.parentDAGs.add(this); - if (this.hasParents()) { - this.bubbleUpNodeTable(this, new LinkedList()); - } - } - - /** - * Mark root of the given DAG depends on this DAG's root. - * - * @param dependentGraph the dependent DAG - */ - public void addDependentGraph(DAGraph dependentGraph) { - dependentGraph.addDependencyGraph(this); - } - - /** - * Prepares this DAG for node enumeration using getNext method, each call to getNext returns next node - * in the DAG with no dependencies. - */ - public void prepareForEnumeration() { - if (isPreparer()) { - for (NodeT node : nodeTable.values()) { - // Prepare each node for traversal - node.initialize(); - if (!this.isRootNode(node)) { - // Mark other sub-DAGs as non-preparer - node.setPreparer(false); - } - } - initializeDependentKeys(); - initializeQueue(); - } - } - - /** - * Gets next node in the DAG which has no dependency or all of it's dependencies are resolved and - * ready to be consumed. - * - * @return next node or null if all the nodes have been explored or no node is available at this moment. - */ - public NodeT getNext() { - String nextItemKey = queue.poll(); - if (nextItemKey == null) { - return null; - } - return nodeTable.get(nextItemKey); - } - - /** - * Reports that a node is resolved hence other nodes depends on it can consume it. - * - * @param completed the node ready to be consumed - */ - public void reportCompletion(NodeT completed) { - completed.setPreparer(true); - String dependency = completed.key(); - for (String dependentKey : nodeTable.get(dependency).dependentKeys()) { - DAGNode dependent = nodeTable.get(dependentKey); - dependent.lock().lock(); - try { - dependent.onSuccessfulResolution(dependency); - if (dependent.hasAllResolved()) { - queue.add(dependent.key()); - } - } finally { - dependent.lock().unlock(); - } - } - } - - /** - * Reports that a node is faulted. - * - * @param faulted the node faulted - * @param throwable the reason for fault - */ - public void reportError(NodeT faulted, Throwable throwable) { - faulted.setPreparer(true); - String dependency = faulted.key(); - for (String dependentKey : nodeTable.get(dependency).dependentKeys()) { - DAGNode dependent = nodeTable.get(dependentKey); - dependent.lock().lock(); - try { - dependent.onFaultedResolution(dependency, throwable); - if (dependent.hasAllResolved()) { - queue.add(dependent.key()); - } - } finally { - dependent.lock().unlock(); - } - } - } - - /** - * Initializes dependents of all nodes. - *

    - * The DAG will be explored in DFS order and all node's dependents will be identified, - * this prepares the DAG for traversal using getNext method, each call to getNext returns next node - * in the DAG with no dependencies. - */ - private void initializeDependentKeys() { - visit(new Visitor>() { - @Override - public void visitNode(Node node) { - if (!(node instanceof DAGNode)) { - throw logger.logExceptionAsError(new IllegalStateException("Unexpected node type")); - } - DAGNode dagNode = (DAGNode) node; - if (dagNode.dependencyKeys().isEmpty()) { - return; - } - - String dependentKey = node.key(); - for (String dependencyKey : dagNode.dependencyKeys()) { - nodeTable.get(dependencyKey) - .addDependent(dependentKey); - } - } - - @Override - public void visitEdge(String fromKey, String toKey, EdgeType edgeType) { - if (edgeType == EdgeType.BACK) { - throw logger.logExceptionAsError( - new IllegalStateException("Detected circular dependency: " + findPath(fromKey, toKey))); - } - } - }); - } - - /** - * Initializes the queue that tracks the next set of nodes with no dependencies or - * whose dependencies are resolved. - */ - private void initializeQueue() { - this.queue.clear(); - for (Map.Entry entry : nodeTable.entrySet()) { - if (!entry.getValue().hasDependencies()) { - this.queue.add(entry.getKey()); - } - } - if (queue.isEmpty()) { - throw logger.logExceptionAsError(new IllegalStateException("Detected circular dependency")); - } - } - - /** - * Copies entries in the source map to target map. - * - * @param source source map - * @param target target map - */ - private void merge(Map source, Map target) { - for (Map.Entry entry : source.entrySet()) { - String key = entry.getKey(); - if (!target.containsKey(key)) { - target.put(key, entry.getValue()); - } - } - } - - /** - * Propagates node table of given DAG to all of it ancestors. - */ - private void bubbleUpNodeTable(DAGraph from, LinkedList path) { - if (path.contains(from.rootNode.key())) { - path.push(from.rootNode.key()); // For better error message - throw logger.logExceptionAsError( - new IllegalStateException("Detected circular dependency: " + String.join(" -> ", path))); - } - path.push(from.rootNode.key()); - for (DAGraph to : from.parentDAGs) { - this.merge(from.nodeTable, to.nodeTable); - this.bubbleUpNodeTable(to, path); - } - path.pop(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/dag/ErroredDependencyTaskException.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/dag/ErroredDependencyTaskException.java deleted file mode 100644 index 635c58c6a93e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/dag/ErroredDependencyTaskException.java +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.dag; - -/** - * An FaultedDependencyException is emitted when a task cannot be executed due to a faulted decedent task. - */ -final class ErroredDependencyTaskException extends Exception { -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/dag/FunctionalTaskItem.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/dag/FunctionalTaskItem.java deleted file mode 100644 index aec21c1111e4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/dag/FunctionalTaskItem.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.dag; - -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.model.Indexable; -import reactor.core.publisher.Mono; - -import java.util.function.Function; - -/** - * Simplified functional interface equivalent to abstract class {@link IndexableTaskItem}. - */ -public interface FunctionalTaskItem - extends Function> { - /** - * Type representing context of an {@link FunctionalTaskItem}. - */ - final class Context implements HasInnerModel, Indexable { - private final IndexableTaskItem wrapperTaskItem; - private TaskGroup.InvocationContext innerContext; - - /** - * Creates Context. - * - * @param taskItem the IndexableTaskItem that wraps this task item. - */ - Context(IndexableTaskItem taskItem) { - this.wrapperTaskItem = taskItem; - } - - /** - * Set the inner context. - * - * @param innerContext the inner context - */ - void setInnerContext(TaskGroup.InvocationContext innerContext) { - this.innerContext = innerContext; - } - - /** - * Get result of one of the task that belongs to this task's task group. - * - * @param key the task key - * @param the actual type of the task result - * @return the task result, null will be returned if task has not produced a result yet - */ - @SuppressWarnings("unchecked") - public T taskResult(String key) { - Indexable result = this.wrapperTaskItem.taskGroup().taskResult(key); - if (result == null) { - return null; - } else { - T castedResult = (T) result; - return castedResult; - } - } - - /** - * @return a {@link Mono} upon subscription emits {@link VoidIndexable} with key same as - * the key of this TaskItem. - */ - public Mono voidMono() { - Indexable voidIndexable = new VoidIndexable(this.wrapperTaskItem.key()); - return Mono.just(voidIndexable); - } - - @Override - public TaskGroup.InvocationContext innerModel() { - return this.innerContext; - } - - @Override - public String key() { - return this.wrapperTaskItem.key(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/dag/Graph.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/dag/Graph.java deleted file mode 100644 index 315574380759..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/dag/Graph.java +++ /dev/null @@ -1,210 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.dag; - -import com.azure.core.util.logging.ClientLogger; - -import java.util.Collection; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; -import java.util.TreeMap; - -/** - * Type representing a directed graph data structure. - *

    - * Each node in a graph is represented by {@link Node} - * - * @param the type of the data stored in the graph's nodes - * @param the type of the nodes in the graph - */ -public class Graph> { - /** - * the nodes in the graph. - */ - protected Map nodeTable; - /** - * to track the already visited node while performing DFS. - */ - private final Set visited; - /** - * to generate node entry and exit time while performing DFS. - */ - private Integer time; - /** - * to track the entry time to each node while performing DFS. - */ - private final Map entryTime; - /** - * to track the exit time from each node while performing DFS. - */ - private final Map exitTime; - /** - * to track the immediate parent node of each node while performing DFS. - */ - private final Map parent; - /** - * to track already processed node while performing DFS. - */ - private final Set processed; - - private final ClientLogger logger = new ClientLogger(this.getClass()); - - /** - * Creates a directed graph. - */ - public Graph() { - this.nodeTable = new TreeMap<>(); - this.visited = new HashSet<>(); - this.time = 0; - this.entryTime = new HashMap<>(); - this.exitTime = new HashMap<>(); - this.parent = new HashMap<>(); - this.processed = new HashSet<>(); - } - - /** - * @return all nodes in the graph. - */ - public Collection getNodes() { - return nodeTable.values(); - } - - /** - * Adds a node to this graph. - * - * @param node the node - */ - public void addNode(NodeT node) { - node.setOwner(this); - nodeTable.put(node.key(), node); - } - - /** - * Perform DFS visit in this graph. - *

    - * The directed graph will be traversed in DFS order and the visitor will be notified as - * search explores each node and edge. - * - * @param visitor the graph visitor - */ - public void visit(Visitor> visitor) { - for (Map.Entry item : nodeTable.entrySet()) { - if (!visited.contains(item.getKey())) { - this.dfs(visitor, item.getValue()); - } - } - visited.clear(); - time = 0; - entryTime.clear(); - exitTime.clear(); - parent.clear(); - processed.clear(); - } - - private void dfs(Visitor> visitor, Node node) { - visitor.visitNode(node); - - String fromKey = node.key(); - visited.add(fromKey); - entryTime.put(fromKey, ++time); - for (String toKey : node.children()) { - if (!visited.contains(toKey)) { - parent.put(toKey, fromKey); - visitor.visitEdge(fromKey, toKey, edgeType(fromKey, toKey)); - this.dfs(visitor, this.nodeTable.get(toKey)); - } else { - visitor.visitEdge(fromKey, toKey, edgeType(fromKey, toKey)); - } - } - exitTime.put(fromKey, ++time); - processed.add(fromKey); - } - - private EdgeType edgeType(String fromKey, String toKey) { - if (parent.containsKey(toKey) && parent.get(toKey).equals(fromKey)) { - return EdgeType.TREE; - } - - if (visited.contains(toKey) && !processed.contains(toKey)) { - return EdgeType.BACK; - } - - if (processed.contains(toKey) && entryTime.containsKey(toKey) && entryTime.containsKey(fromKey)) { - if (entryTime.get(toKey) > entryTime.get(fromKey)) { - return EdgeType.FORWARD; - } - - if (entryTime.get(toKey) < entryTime.get(fromKey)) { - return EdgeType.CROSS; - } - } - - throw logger.logExceptionAsError( - new IllegalStateException("Internal Error: Unable to locate the edge type {" + fromKey + ", " + toKey + "}") - ); - } - - /** - * Find the path. - * - * @param start key of first node in the path - * @param end key of last node in the path - * @return string containing the nodes keys in the path separated by arrow symbol - */ - protected String findPath(String start, String end) { - if (start.equals(end)) { - return start; - } else { - return findPath(start, parent.get(end)) + " -> " + end; - } - } - - /** - * The edge types in a graph. - */ - protected enum EdgeType { - /** - * An edge (u, v) is a tree edge if v is visited the first time. - */ - TREE, - /** - * An edge (u, v) is a forward edge if v is descendant of u. - */ - FORWARD, - /** - * An edge (u, v) is a back edge if v is ancestor of u. - */ - BACK, - /** - * An edge (u, v) is a cross edge if v is neither ancestor or descendant of u. - */ - CROSS - } - - /** - * Represents a visitor to be implemented by the consumer who want to visit the - * graph's nodes in DFS order by calling visit method. - * - * @param the type of the node - */ - protected interface Visitor { - /** - * visit a node. - * - * @param node the node to visited - */ - void visitNode(U node); - - /** - * visit an edge. - * - * @param fromKey key of the from node - * @param toKey key of the to node - * @param edgeType the edge type - */ - void visitEdge(String fromKey, String toKey, EdgeType edgeType); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/dag/IndexableTaskItem.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/dag/IndexableTaskItem.java deleted file mode 100644 index 7797f2b297b4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/dag/IndexableTaskItem.java +++ /dev/null @@ -1,311 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.dag; - -import com.azure.resourcemanager.resources.fluentcore.model.Appliable; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.Executable; -import com.azure.resourcemanager.resources.fluentcore.model.Indexable; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import reactor.core.publisher.Mono; - -import java.util.Objects; -import java.util.UUID; - -/** - * An index-able TaskItem with a TaskGroup. - */ -public abstract class IndexableTaskItem - implements Indexable, TaskItem, TaskGroup.HasTaskGroup { - /** - * The key that is unique to this TaskItem which is used to index this - * TaskItem. - */ - private final String key; - /** - * The TaskGroup with this TaskItem as root task. - */ - private final TaskGroup taskGroup; - /** - * The result of computation performed by this TaskItem. - */ - private Indexable taskResult; - - /** - * Creates a TaskItem which is index-able using provided key. - * - * @param key the unique key to index this TaskItem - */ - public IndexableTaskItem(String key) { - this.key = key; - this.taskGroup = new TaskGroup(this); - this.taskResult = null; - } - - /** - * Creates a TaskItem which is index-able using a random UUID. - */ - public IndexableTaskItem() { - this(UUID.randomUUID().toString()); - } - - /** - * Creates a TaskItem which is index-able using a random UUID. - * - * @param internalContext the internal runtime context - */ - public IndexableTaskItem(ResourceManagerUtils.InternalRuntimeContext internalContext) { - this(internalContext.randomUuid()); - } - - /** - * Creates an IndexableTaskItem from provided FunctionalTaskItem. - * - * @param taskItem functional TaskItem - * @return IndexableTaskItem - */ - public static IndexableTaskItem create(final FunctionalTaskItem taskItem) { - return new IndexableTaskItem() { - @Override - protected Mono invokeTaskAsync(TaskGroup.InvocationContext context) { - FunctionalTaskItem.Context fContext = new FunctionalTaskItem.Context(this); - fContext.setInnerContext(context); - return taskItem.apply(fContext); - } - }; - } - - /** - * Creates an IndexableTaskItem from provided FunctionalTaskItem. - * - * @param taskItem functional TaskItem - * @param internalContext the internal runtime context - * @return IndexableTaskItem - */ - public static IndexableTaskItem create( - final FunctionalTaskItem taskItem, ResourceManagerUtils.InternalRuntimeContext internalContext) { - return new IndexableTaskItem(internalContext) { - @Override - protected Mono invokeTaskAsync(TaskGroup.InvocationContext context) { - FunctionalTaskItem.Context fContext = new FunctionalTaskItem.Context(this); - fContext.setInnerContext(context); - return taskItem.apply(fContext); - } - }; - } - - /** - * @return the TaskGroup this this TaskItem as root. - */ - @Override - public TaskGroup taskGroup() { - return this.taskGroup; - } - - /** - * Clear the result produced by the task. - */ - public void clear() { - this.taskResult = voidIndexable(); - } - - @Override - public String key() { - return this.key; - } - - /** - * Add a dependency task item for this task item. - * - * @param dependency the dependency task item. - * @return key to be used as parameter to taskResult(string) method to retrieve result the task item - */ - protected String addDependency(FunctionalTaskItem dependency) { - Objects.requireNonNull(dependency); - return this.taskGroup.addDependency(dependency); - } - - /** - * Add a dependency for this task item. - * - * @param dependency the dependency. - * @return key to be used as parameter to taskResult(string) method to retrieve result of root - * task in the given dependency task group - */ - protected String addDependency(TaskGroup.HasTaskGroup dependency) { - Objects.requireNonNull(dependency); - this.taskGroup.addDependencyTaskGroup(dependency.taskGroup()); - return dependency.taskGroup().key(); - } - - /** - * Add a creatable dependency for this task item. - * - * @param creatable the creatable dependency. - * @return the key to be used as parameter to taskResult(string) method to retrieve created dependency - */ - @SuppressWarnings("unchecked") - protected String addDependency(Creatable creatable) { - TaskGroup.HasTaskGroup dependency = (TaskGroup.HasTaskGroup) creatable; - return this.addDependency(dependency); - } - - /** - * Add an appliable dependency for this task item. - * - * @param appliable the appliable dependency. - * @return the key to be used as parameter to taskResult(string) method to retrieve updated dependency - */ - @SuppressWarnings("unchecked") - protected String addDependency(Appliable appliable) { - TaskGroup.HasTaskGroup dependency = (TaskGroup.HasTaskGroup) appliable; - return this.addDependency(dependency); - } - - /** - * Add an executable dependency for this task item. - * - * @param executable the executable dependency - * @return the key to be used as parameter to taskResult(string) method to retrieve result of executing - * the executable dependency - */ - @SuppressWarnings("unchecked") - protected String addDependency(Executable executable) { - TaskGroup.HasTaskGroup dependency = (TaskGroup.HasTaskGroup) executable; - return this.addDependency(dependency); - } - - /** - * Add a "post-run" dependent task item for this task item. - * - * @param dependent the "post-run" dependent task item. - * @return key to be used as parameter to taskResult(string) method to retrieve result of root - * task in the given dependent task group - */ - public String addPostRunDependent(FunctionalTaskItem dependent) { - Objects.requireNonNull(dependent); - return this.taskGroup().addPostRunDependent(dependent); - } - - /** - * Add a "post-run" dependent for this task item. - * - * @param dependent the "post-run" dependent. - * @return key to be used as parameter to taskResult(string) method to retrieve result of root - * task in the given dependent task group - */ - public String addPostRunDependent(TaskGroup.HasTaskGroup dependent) { - Objects.requireNonNull(dependent); - this.taskGroup().addPostRunDependentTaskGroup(dependent.taskGroup()); - return dependent.taskGroup().key(); - } - - /** - * Add a creatable "post-run" dependent for this task item. - * - * @param creatable the creatable "post-run" dependent. - * @return the key to be used as parameter to taskResult(string) method to retrieve created "post-run" dependent - */ - @SuppressWarnings("unchecked") - protected String addPostRunDependent(Creatable creatable) { - TaskGroup.HasTaskGroup dependency = (TaskGroup.HasTaskGroup) creatable; - return this.addPostRunDependent(dependency); - } - - /** - * Add an appliable "post-run" dependent for this task item. - * - * @param appliable the appliable "post-run" dependent. - * @return the key to be used as parameter to taskResult(string) method to retrieve updated "post-run" dependent - */ - @SuppressWarnings("unchecked") - protected String addPostRunDependent(Appliable appliable) { - TaskGroup.HasTaskGroup dependency = (TaskGroup.HasTaskGroup) appliable; - return this.addPostRunDependent(dependency); - } - - /** - * Add an executable "post-run" dependent for this task item. - * - * @param executable the executable "post-run" dependent - * @return the key to be used as parameter to taskResult(string) method to retrieve result of executing - * the executable "post-run" dependent - */ - @SuppressWarnings("unchecked") - protected String addPostRunDependent(Executable executable) { - TaskGroup.HasTaskGroup dependency = (TaskGroup.HasTaskGroup) executable; - return this.addPostRunDependent(dependency); - } - - /** - * Get result of one of the task that belongs to this task's task group. - * - * @param key the task key - * @param the actual type of the task result - * @return the task result, null will be returned if task has not produced a result yet - */ - @SuppressWarnings("unchecked") - protected T taskResult(String key) { - Indexable result = this.taskGroup.taskResult(key); - if (result == null) { - return null; - } else { - T castedResult = (T) result; - return castedResult; - } - } - - @Override - public Indexable result() { - return this.taskResult; - } - - @Override - public void beforeGroupInvoke() { - // NOP - } - - @Override - public boolean isHot() { - return false; - } - - @Override - public Mono invokeAsync(TaskGroup.InvocationContext context) { - return this.invokeTaskAsync(context) - .subscribeOn(ResourceManagerUtils.InternalRuntimeContext.getReactorScheduler()) - .map(result -> { - taskResult = result; - return result; - }); - } - - @Override - public Mono invokeAfterPostRunAsync(boolean isGroupFaulted) { - return Mono.empty(); - } - - /** - * Invokes a task asynchronously. - * - * @param context Context of the invocation. - * @return an Observable upon subscription emits {@link Indexable}. - */ - protected abstract Mono invokeTaskAsync(TaskGroup.InvocationContext context); - - /** - * @return an instance of {@link VoidIndexable} with key same as the key of this TaskItem. - */ - protected Indexable voidIndexable() { - return new VoidIndexable(this.key); - } - - /** - * @return an Observable upon subscription emits {@link VoidIndexable} with key same as the key of - * this TaskItem - */ - protected Mono voidPublisher() { - return Mono.just(this.voidIndexable()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/dag/Node.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/dag/Node.java deleted file mode 100644 index cb1d52e69eb6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/dag/Node.java +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.dag; - -import com.azure.core.util.logging.ClientLogger; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -/** - * Type represents a node in a {@link Graph}. - * - * @param the type of the data stored in the node - * @param the type of the node - */ -public class Node> { - /** - * The graph that owns this node. - */ - private Graph ownerGraph; - /** - * A key that uniquely identifies this node in the owner graph {@link this#ownerGraph}. - */ - private final String key; - /** - * reference to the data stored in the node. - */ - private final DataT data; - /** - * the collection of child node keys. - */ - private final List children; - - private final ClientLogger logger = new ClientLogger(this.getClass()); - - /** - * Creates a graph node. - * - * @param key unique id of the node - * @param data data to be stored in the node - */ - public Node(final String key, final DataT data) { - this.key = key; - this.data = data; - this.children = new ArrayList<>(); - } - - /** - * @return this node's unique id - */ - public String key() { - return this.key; - } - - /** - * @return data stored in this node - */ - public DataT data() { - return data; - } - - /** - * @return true if this node has any children - */ - public boolean hasChildren() { - return !this.children.isEmpty(); - } - - /** - * @return children (neighbours) of this node - */ - public List children() { - return Collections.unmodifiableList(this.children); - } - - /** - * @param childKey add a child (neighbour) of this node - */ - public void addChild(String childKey) { - this.children.add(childKey); - } - - /** - * @param childKey remove child (neighbour) of this node - */ - public void removeChild(String childKey) { - this.children.remove(childKey); - } - - /** - * Sets reference to the graph owning this node. - * - * @param ownerGraph the owning graph - */ - public void setOwner(Graph ownerGraph) { - if (this.ownerGraph != null) { - throw logger.logExceptionAsError(new RuntimeException("Changing owner graph is not allowed")); - } - this.ownerGraph = ownerGraph; - } - - /** - * @return the owner (container) graph of this node. - */ - public Graph owner() { - if (this.ownerGraph == null) { - throw logger.logExceptionAsError(new RuntimeException("Required owner graph is not set")); - } - return this.ownerGraph; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/dag/PostRunTaskCollection.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/dag/PostRunTaskCollection.java deleted file mode 100644 index 11a93e34ebe5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/dag/PostRunTaskCollection.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.dag; - -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** - * A collection of "Post Run" tasks. - */ -public final class PostRunTaskCollection { - private final List collection; - private final TaskGroup dependsOnTaskGroup; - - /** - * Creates PostRunTaskCollection. - * - * @param dependsOnTaskGroup the task group in which "Post Run" tasks in the collection depends on - */ - public PostRunTaskCollection(final TaskGroup dependsOnTaskGroup) { - Objects.requireNonNull(dependsOnTaskGroup); - this.collection = new ArrayList<>(); - this.dependsOnTaskGroup = dependsOnTaskGroup; - } - - /** - * Adds a "Post Run" task to the collection. - * - * @param taskItem the "Post Run" task - */ - public void add(final IndexableTaskItem taskItem) { - this.dependsOnTaskGroup.addPostRunDependentTaskGroup(taskItem.taskGroup()); - this.collection.add(taskItem); - } - - /** - * Adds a "Post Run" task to the collection. - * - * @param taskItem the "Post Run" task - */ - public void add(final FunctionalTaskItem taskItem) { - add(IndexableTaskItem.create(taskItem)); - } - - /** - * Clears the result produced by all "Post Run" tasks in the collection. - */ - public void clear() { - for (IndexableTaskItem item : collection) { - item.clear(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/dag/TaskCancelledException.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/dag/TaskCancelledException.java deleted file mode 100644 index 383aa8100274..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/dag/TaskCancelledException.java +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.dag; - -/** - * An TaskCancelledException is emitted when a task cannot be executed because the parent task group is - * marked as cancelled. - */ -final class TaskCancelledException extends Exception { -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/dag/TaskGroup.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/dag/TaskGroup.java deleted file mode 100644 index e8679c142913..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/dag/TaskGroup.java +++ /dev/null @@ -1,837 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.dag; - -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.resources.fluentcore.model.Indexable; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; -import reactor.core.scheduler.Schedulers; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.atomic.AtomicBoolean; - -/** - * Type representing a group of task entries with dependencies between them. Initially a task - * group will have only one task entry known as root task entry, then more entries can be - * added by taking dependency on other task groups or adding "post-run" task group dependents. - *

    - * The method {@link TaskGroup#invokeAsync(InvocationContext)} ()} kick-off invocation of tasks - * in the group, task are invoked in topological sorted order. - *

    - * {@link TaskGroup#addDependencyTaskGroup(TaskGroup)}: A task group "A" can take dependency on - * another task group "B" through this method e.g. `A.addDependencyTaskGroup(B)` indicates that - * completion of tasks in the dependency task group "B" is required before the invocation of root - * task in group "A". A.invokeAsync(cxt) will ensure this order. - *

    - * {@link TaskGroup#addPostRunDependentTaskGroup(TaskGroup)}: there are scenarios where a subset - * of dependent task groups say "H", "I" may required to run after the invocation of a task group - * "K" when K.invokeAsync(cxt) is called. Such special dependents can be added via - * K.addPostRunDependentTaskGroup(H) and K.addPostRunDependentTaskGroup(I). - *

    - * The result produced by the tasks in the group are of type {@link Indexable}. - */ -public class TaskGroup - extends DAGraph> - implements Indexable { - /** - * The root task in this task group. - */ - private final TaskGroupEntry rootTaskEntry; - /** - * Task group termination strategy to be used once any task in the group error-ed. - */ - private TaskGroupTerminateOnErrorStrategy taskGroupTerminateOnErrorStrategy; - /** - * Flag indicating whether this group is marked as cancelled or not. This flag will be used only - * when group's terminate on error strategy is set as - * {@link TaskGroupTerminateOnErrorStrategy#TERMINATE_ON_IN_PROGRESS_TASKS_COMPLETION}. - * Effect of setting this flag can be think as broadcasting a cancellation signal to tasks those - * are yet to invoke. - */ - private final AtomicBoolean isGroupCancelled; - /** - * The shared exception object used to indicate that a task is not invoked since the group - * is marked as cancelled i.e. {@link this#isGroupCancelled} is set. - */ - private final TaskCancelledException taskCancelledException = new TaskCancelledException(); - /** - * The helper to operate on proxy TaskGroup of this TaskGroup for supporting dependents marked - * for post run. - */ - protected ProxyTaskGroupWrapper proxyTaskGroupWrapper; - - private final ClientLogger logger = new ClientLogger(this.getClass()); - - /** - * Creates TaskGroup. - * - * @param rootTaskEntry the entry holding root task - */ - private TaskGroup(TaskGroupEntry rootTaskEntry) { - super(rootTaskEntry); - this.isGroupCancelled = new AtomicBoolean(false); - this.rootTaskEntry = rootTaskEntry; - this.proxyTaskGroupWrapper = new ProxyTaskGroupWrapper(this); - } - - /** - * Creates TaskGroup. - * - * @param rootTaskItemId the id of the root task in the group - * @param rootTaskItem the root task - */ - public TaskGroup(String rootTaskItemId, - TaskItem rootTaskItem) { - this(new TaskGroupEntry(rootTaskItemId, rootTaskItem)); - } - - /** - * Creates TaskGroup. - * - * @param rootTaskItem the root task - */ - public TaskGroup(IndexableTaskItem rootTaskItem) { - this(new TaskGroupEntry(rootTaskItem.key(), rootTaskItem)); - } - - /** - * @return the key of this task group, which is same as key of the root entry in the group - */ - @Override - public String key() { - return this.rootTaskEntry.key(); - } - - /** - * Retrieve the result produced by a task with the given id in the group. - *

    - * This method can be used to retrieve the result of invocation of both dependency - * and "post-run" dependent tasks. If task with the given id does not exists then - * IllegalArgumentException exception will be thrown. - * - * @param taskId the task item id - * @return the task result, null will be returned if task has not yet been invoked - */ - public Indexable taskResult(String taskId) { - TaskGroupEntry taskGroupEntry = super.getNode(taskId); - if (taskGroupEntry != null) { - return taskGroupEntry.taskResult(); - } - if (!this.proxyTaskGroupWrapper.isActive()) { - throw logger.logExceptionAsError( - new IllegalArgumentException("A dependency task with id '" + taskId + "' is not found")); - } - taskGroupEntry = this.proxyTaskGroupWrapper.proxyTaskGroup.getNode(taskId); - if (taskGroupEntry != null) { - return taskGroupEntry.taskResult(); - } - throw logger.logExceptionAsError(new IllegalArgumentException( - "A dependency task or 'post-run' dependent task with with id '" + taskId + "' not found")); - } - - /** - * Checks this TaskGroup depends on the given TaskGroup. - * - * @param taskGroup the TaskGroup to check - * @return true if TaskGroup is depends on the given TaskGroup - */ - public boolean dependsOn(TaskGroup taskGroup) { - return this.nodeTable.containsKey(taskGroup.root().key()); - } - - /** - * @return the root task entry in the group. - */ - protected TaskGroupEntry root() { - return this.rootTaskEntry; - } - - /** - * Mark root of this task task group depends on the given TaskItem. - * This ensure this task group's root get picked for execution only after the completion - * of invocation of provided TaskItem. - * - * @param dependencyTaskItem the task item that this task group depends on - * @return the key of the dependency - */ - public String addDependency(FunctionalTaskItem dependencyTaskItem) { - IndexableTaskItem dependency = IndexableTaskItem.create(dependencyTaskItem); - this.addDependency(dependency); - return dependency.key(); - } - - /** - * Mark root of this task task group depends on the given item's taskGroup. - * This ensure this task group's root get picked for execution only after the completion - * of invocation of provided TaskItem. - * - * @param hasTaskGroup an item with taskGroup that this task group depends on - */ - public void addDependency(TaskGroup.HasTaskGroup hasTaskGroup) { - this.addDependencyTaskGroup(hasTaskGroup.taskGroup()); - } - - /** - * Mark root of this task task group depends on the given task group's root. - * This ensure this task group's root get picked for execution only after the completion - * of all tasks in the given group. - * - * @param dependencyTaskGroup the task group that this task group depends on - */ - public void addDependencyTaskGroup(TaskGroup dependencyTaskGroup) { - if (dependencyTaskGroup.proxyTaskGroupWrapper.isActive()) { - dependencyTaskGroup.proxyTaskGroupWrapper.addDependentTaskGroup(this); - } else { - DAGraph> dependencyGraph = dependencyTaskGroup; - super.addDependencyGraph(dependencyGraph); - } - } - - /** - * Mark the given TaskItem depends on this taskGroup. - * - * @param dependentTaskItem the task item that depends on this task group - * @return key to be used as parameter to taskResult(string) method to retrieve result of - * invocation of given task item. - */ - public String addPostRunDependent(FunctionalTaskItem dependentTaskItem) { - IndexableTaskItem taskItem = IndexableTaskItem.create(dependentTaskItem); - this.addPostRunDependent(taskItem); - return taskItem.key(); - } - - /** - * Mark the given TaskItem depends on this taskGroup. - * - * @param dependentTaskItem the task item that depends on this task group - * @param internalContext the internal runtime context - * @return key to be used as parameter to taskResult(string) method to retrieve result of - * invocation of given task item. - */ - public String addPostRunDependent( - FunctionalTaskItem dependentTaskItem, ResourceManagerUtils.InternalRuntimeContext internalContext) { - IndexableTaskItem taskItem = IndexableTaskItem.create(dependentTaskItem, internalContext); - this.addPostRunDependent(taskItem); - return taskItem.key(); - } - - /** - * Mark the given item with taskGroup depends on this taskGroup. - * - * @param hasTaskGroup an item with as task group that depends on this task group - */ - public void addPostRunDependent(TaskGroup.HasTaskGroup hasTaskGroup) { - this.addPostRunDependentTaskGroup(hasTaskGroup.taskGroup()); - } - - /** - * Mark root of the given task group depends on this task group's root. - * This ensure given task group's root get picked for invocation only after the completion - * of all tasks in this group. Calling invokeAsync(cxt) will run the tasks in the given - * dependent task group as well. - * - * @param dependentTaskGroup the task group depends on this task group - */ - public void addPostRunDependentTaskGroup(TaskGroup dependentTaskGroup) { - this.proxyTaskGroupWrapper.addPostRunTaskGroupForActualTaskGroup(dependentTaskGroup); - } - - /** - * Invokes tasks in the group. - * It is not guaranteed to return indexable in topological order. - * - * @param context group level shared context that need be passed to invokeAsync(cxt) - * method of each task item in the group when it is selected for invocation. - * @return an observable that emits the result of tasks in the order they finishes. - */ - public Flux invokeAsync(final InvocationContext context) { - return Flux.defer(() -> { - if (proxyTaskGroupWrapper.isActive()) { - return proxyTaskGroupWrapper.taskGroup().invokeInternAsync(context, true, null); - } else { - Set processedKeys = runBeforeGroupInvoke(null); - if (proxyTaskGroupWrapper.isActive()) { - // If proxy got activated after 'runBeforeGroupInvoke()' stage due to the addition of direct - // 'postRunDependent's then delegate group invocation to proxy group. - // - return proxyTaskGroupWrapper.taskGroup().invokeInternAsync(context, true, processedKeys); - } else { - return invokeInternAsync(context, false, null); - } - } - }); - } - - /** - * Invokes tasks in the group. - * - * @return the root result of task group. - */ - public Mono invokeAsync() { - return invokeAsync(this.newInvocationContext()) - .then(Mono.defer(() -> { - if (proxyTaskGroupWrapper.isActive()) { - return Mono.just(proxyTaskGroupWrapper.taskGroup().root().taskResult()); - } - return Mono.just(root().taskResult()); - })); - } - - /** - * Invokes dependency tasks in the group, but not. - * - * @param context group level shared context that need be passed to invokeAsync(cxt) - * method of each task item in the group when it is selected for invocation. - * @return an observable that emits the result of tasks in the order they finishes. - */ - public Flux invokeDependencyAsync(final InvocationContext context) { - context.put(TaskGroup.InvocationContext.KEY_SKIP_TASKS, Collections.singleton(this.key())); - return Flux.defer(() -> { - if (proxyTaskGroupWrapper.isActive()) { - return Flux.error(new IllegalStateException("postRunDependent is not supported")); - } else { - Set processedKeys = runBeforeGroupInvoke(null); - if (proxyTaskGroupWrapper.isActive()) { - return Flux.error(new IllegalStateException("postRunDependent is not supported")); - } else { - return invokeInternAsync(context, false, null); - } - } - }); - } - - /** - * Invokes tasks in the group. - * - * @param context group level shared context that need be passed to invokeAsync(cxt) - * method of each task item in the group when it is selected for invocation. - * @param shouldRunBeforeGroupInvoke indicate whether to run the 'beforeGroupInvoke' method - * of each tasks before invoking them - * @param skipBeforeGroupInvoke the tasks keys for which 'beforeGroupInvoke' should not be called - * before invoking them - * @return an observable that emits the result of tasks in the order they finishes. - */ - private Flux invokeInternAsync(final InvocationContext context, - final boolean shouldRunBeforeGroupInvoke, - final Set skipBeforeGroupInvoke) { - if (!isPreparer()) { - return Flux.error(new IllegalStateException( - "invokeInternAsync(cxt) can be called only from root TaskGroup")); - } - this.taskGroupTerminateOnErrorStrategy = context.terminateOnErrorStrategy(); - if (shouldRunBeforeGroupInvoke) { - // Prepare tasks and queue the ready tasks (terminal tasks with no dependencies) - // - this.runBeforeGroupInvoke(skipBeforeGroupInvoke); - } - // Runs the ready tasks concurrently - // - return this.invokeReadyTasksAsync(context); - } - - /** - * Run 'beforeGroupInvoke' method of the tasks in this group. The tasks can use beforeGroupInvoke() - * method to add additional dependencies or dependents. - * - * @param skip the keys of the tasks that are previously processed hence they must be skipped - * @return the keys of all the tasks those are processed (including previously processed items in skip param) - */ - private Set runBeforeGroupInvoke(final Set skip) { - HashSet processedEntryKeys = new HashSet<>(); - if (skip != null) { - processedEntryKeys.addAll(skip); - } - List> entries = this.entriesSnapshot(); - boolean hasMoreToProcess; - // Invokes 'beforeGroupInvoke' on a subset of non-processed tasks in the group. - // Initially processing is pending on all task items. - do { - hasMoreToProcess = false; - for (TaskGroupEntry entry : entries) { - if (!processedEntryKeys.contains(entry.key())) { - entry.data().beforeGroupInvoke(); - processedEntryKeys.add(entry.key()); - } - } - int prevSize = entries.size(); - entries = this.entriesSnapshot(); - if (entries.size() > prevSize) { - // If new task dependencies/dependents added in 'beforeGroupInvoke' then - // set the flag which indicates another pass is required to 'prepare' new - // task items - hasMoreToProcess = true; - } - } while (hasMoreToProcess); // Run another pass if new dependencies/dependents were added in this pass - super.prepareForEnumeration(); - return processedEntryKeys; - } - - /** - * @return list with current task entries in this task group - */ - private List> entriesSnapshot() { - List> entries = new ArrayList<>(); - super.prepareForEnumeration(); - for (TaskGroupEntry current = super.getNext(); current != null; current = super.getNext()) { - entries.add(current); - super.reportCompletion(current); - } - return entries; - } - - /** - * Invokes the ready tasks. - * - * @param context group level shared context that need be passed to - * {@link TaskGroupEntry#invokeTaskAsync(boolean, InvocationContext)} - * method of each entry in the group when it is selected for execution - * @return a {@link Flux} that emits the result of tasks in the order they finishes. - */ - // Due to it takes approximate 3ms in flux for returning, it cannot be guaranteed to return in topological order. - // One simply fix for guaranteeing the last element could be https://github.com/Azure/azure-sdk-for-java/pull/15074 - @SuppressWarnings({"unchecked", "rawtypes"}) - private Flux invokeReadyTasksAsync(final InvocationContext context) { - TaskGroupEntry readyTaskEntry = super.getNext(); - final List> observables = new ArrayList<>(); - // Enumerate the ready tasks (those with dependencies resolved) and kickoff them concurrently - // - while (readyTaskEntry != null) { - final TaskGroupEntry currentEntry = readyTaskEntry; - final TaskItem currentTaskItem = currentEntry.data(); - if (currentTaskItem instanceof ProxyTaskItem) { - observables.add(invokeAfterPostRunAsync(currentEntry, context)); - } else { - observables.add(invokeTaskAsync(currentEntry, context)); - } - readyTaskEntry = super.getNext(); - } - return Flux.mergeDelayError(32, observables.toArray(new Flux[0])); - } - - /** - * Invokes the task stored in the given entry. - *

    - * if the task cannot be invoked because the group marked as cancelled then an observable - * that emit {@link TaskCancelledException} will be returned. - * - * @param entry the entry holding task - * @param context a group level shared context that is passed to {@link TaskItem#invokeAsync(InvocationContext)} - * method of the task item this entry wraps. - * @return an observable that emits result of task in the given entry and result of subset of tasks which gets - * scheduled after this task. - */ - private Flux invokeTaskAsync(final TaskGroupEntry entry, final InvocationContext context) { - return Flux.defer(() -> { - if (isGroupCancelled.get()) { - // One or more tasks are in faulted state, though this task MAYBE invoked if it does not - // have faulted tasks as transitive dependencies, we won't do it since group is cancelled - // due to termination strategy TERMINATE_ON_IN_PROGRESS_TASKS_COMPLETION. - // - return processFaultedTaskAsync(entry, taskCancelledException, context); - } else { - // Any cached result will be ignored for root resource - // - boolean ignoreCachedResult = isRootEntry(entry) - || (entry.proxy() != null && isRootEntry(entry.proxy())); - - Mono taskObservable; - Object skipTasks = context.get(InvocationContext.KEY_SKIP_TASKS); - if (skipTasks instanceof Set && ((Set) skipTasks).contains(entry.key())) { - taskObservable = Mono.just(new VoidIndexable(entry.key())); - } else { - taskObservable = entry.invokeTaskAsync(ignoreCachedResult, context); - } - return taskObservable.flatMapMany((indexable) -> Flux.just(indexable), - (throwable) -> processFaultedTaskAsync(entry, throwable, context), - () -> processCompletedTaskAsync(entry, context)); - } - }); - } - - /** - * Invokes the {@link TaskItem#invokeAfterPostRunAsync(boolean)} method of an actual TaskItem - * if the given entry holds a ProxyTaskItem. - * - * @param entry the entry holding a ProxyTaskItem - * @param context a group level shared context - * @return An Observable that represents asynchronous work started by - * {@link TaskItem#invokeAfterPostRunAsync(boolean)} method of actual TaskItem and result of subset - * of tasks which gets scheduled after proxy task. If group was not in faulted state and - * {@link TaskItem#invokeAfterPostRunAsync(boolean)} emits no error then stream also includes - * result produced by actual TaskItem. - */ - private Flux invokeAfterPostRunAsync(final TaskGroupEntry entry, - final InvocationContext context) { - return Flux.defer(() -> { - final ProxyTaskItem proxyTaskItem = (ProxyTaskItem) entry.data(); - if (proxyTaskItem == null) { - return Flux.empty(); - } - final boolean isFaulted = entry.hasFaultedDescentDependencyTasks() || isGroupCancelled.get(); - - return proxyTaskItem.invokeAfterPostRunAsync(isFaulted) - .flatMapMany(indexable -> Flux.error( - new IllegalStateException("This onNext should never be called")), - (error) -> processFaultedTaskAsync(entry, error, context), - () -> { - if (isFaulted) { - if (entry.hasFaultedDescentDependencyTasks()) { - return processFaultedTaskAsync(entry, - new ErroredDependencyTaskException(), context); - } else { - return processFaultedTaskAsync(entry, taskCancelledException, context); - } - } else { - return Flux.concat(Flux.just(proxyTaskItem.result()), - processCompletedTaskAsync(entry, context)); - } - }); - - }); - } - - /** - * Handles successful completion of a task. - *

    - * If the task is not root (terminal) task then this kickoff execution of next set of ready tasks - * - * @param completedEntry the entry holding completed task - * @param context the context object shared across all the task entries in this group during execution - * @return an observable represents asynchronous operation in the next stage - */ - private Flux processCompletedTaskAsync(final TaskGroupEntry completedEntry, - final InvocationContext context) { - reportCompletion(completedEntry); - if (isRootEntry(completedEntry)) { - return Flux.empty(); - } else { - return invokeReadyTasksAsync(context); - } - } - - /** - * Handles a faulted task. - * - * @param faultedEntry the entry holding faulted task - * @param throwable the reason for fault - * @param context the context object shared across all the task entries in this group during execution - * @return an observable represents asynchronous operation in the next stage - */ - private Flux processFaultedTaskAsync(final TaskGroupEntry faultedEntry, - final Throwable throwable, - final InvocationContext context) { - markGroupAsCancelledIfTerminationStrategyIsIPTC(); - reportError(faultedEntry, throwable); - if (isRootEntry(faultedEntry)) { - if (shouldPropagateException(throwable)) { - return toErrorObservable(throwable); - } - return Flux.empty(); - } else if (shouldPropagateException(throwable)) { - return Flux.concatDelayError(invokeReadyTasksAsync(context), toErrorObservable(throwable)); - } else { - return invokeReadyTasksAsync(context); - } - } - - /** - * Mark this TaskGroup as cancelled if the termination strategy associated with the group - * is {@link TaskGroupTerminateOnErrorStrategy#TERMINATE_ON_IN_PROGRESS_TASKS_COMPLETION}. - */ - private void markGroupAsCancelledIfTerminationStrategyIsIPTC() { - this.isGroupCancelled.set(this.taskGroupTerminateOnErrorStrategy - == TaskGroupTerminateOnErrorStrategy.TERMINATE_ON_IN_PROGRESS_TASKS_COMPLETION); - } - - /** - * Check that given entry is the root entry in this group. - * - * @param taskGroupEntry the entry - * @return true if the entry is root entry in the group, false otherwise. - */ - private boolean isRootEntry(TaskGroupEntry taskGroupEntry) { - return isRootNode(taskGroupEntry); - } - - /** - * Checks the given throwable needs to be propagated to final stream returned by - * {@link this#invokeAsync(InvocationContext)} ()} method. - * - * @param throwable the exception to check - * @return true if the throwable needs to be included in the {@link RuntimeException} - * emitted by the final stream. - */ - private static boolean shouldPropagateException(Throwable throwable) { - return (!(throwable instanceof ErroredDependencyTaskException) - && !(throwable instanceof TaskCancelledException)); - } - - /** - * Gets the given throwable as observable. - * - * @param throwable the throwable to wrap - * @return observable with throwable wrapped - */ - private Flux toErrorObservable(Throwable throwable) { - return Flux.error(throwable); - } - - /** - * @return a new clean context instance. - */ - public InvocationContext newInvocationContext() { - return new InvocationContext(this); - } - - /** - * An interface representing a type composes a TaskGroup. - */ - public interface HasTaskGroup { - /** - * @return Gets the task group. - */ - TaskGroup taskGroup(); - } - - /** - * A mutable type that can be used to pass data around task items during the invocation - * of the TaskGroup. - */ - public static final class InvocationContext { - /** Key of the {@link Set} of tasks to skip. */ - public static final String KEY_SKIP_TASKS = "SKIP_TASKS"; - - private final Map properties; - private final TaskGroup taskGroup; - private TaskGroupTerminateOnErrorStrategy terminateOnErrorStrategy; - private final ClientLogger logger = new ClientLogger(this.getClass()); - - /** - * Creates InvocationContext instance. - * - * @param taskGroup the task group that uses this context instance. - */ - private InvocationContext(final TaskGroup taskGroup) { - this.properties = new ConcurrentHashMap<>(); - this.taskGroup = taskGroup; - } - - /** - * @return the TaskGroup this invocation context associated with. - */ - public TaskGroup taskGroup() { - return this.taskGroup; - } - - /** - * Sets the group termination strategy to use on error. - * - * @param strategy the strategy - * @return the context - */ - public InvocationContext withTerminateOnErrorStrategy(TaskGroupTerminateOnErrorStrategy strategy) { - if (this.terminateOnErrorStrategy != null) { - throw logger.logExceptionAsError(new IllegalStateException( - "Termination strategy is already set, it is immutable for a specific context")); - } - this.terminateOnErrorStrategy = strategy; - return this; - } - - /** - * @return the termination strategy to use upon error during the current invocation of the TaskGroup. - */ - public TaskGroupTerminateOnErrorStrategy terminateOnErrorStrategy() { - if (this.terminateOnErrorStrategy == null) { - return TaskGroupTerminateOnErrorStrategy.TERMINATE_ON_HITTING_LCA_TASK; - } - return this.terminateOnErrorStrategy; - } - - /** - * Put a key-value in the context. - * - * @param key the key - * @param value the value - */ - public void put(String key, Object value) { - this.properties.put(key, value); - } - - /** - * Get a value in the context with the given key. - * - * @param key the key - * @return value with the given key if exists, null otherwise. - */ - public Object get(String key) { - return this.properties.get(key); - } - - /** - * Check existence of a key in the context. - * - * @param key the key - * @return true if the key exists, false otherwise. - */ - public boolean hasKey(String key) { - return this.get(key) != null; - } - } - - /** - * Wrapper type to simplify operations on proxy TaskGroup. - *

    - * A proxy TaskGroup will be activated for a TaskGroup as soon as a "post-run" dependent - * added to the actual TaskGroup via {@link TaskGroup#addPostRunDependentTaskGroup(TaskGroup)}. - * "post run" dependents are those TaskGroup which need to be invoked as part of invocation - * of actual TaskGroup. - */ - protected static final class ProxyTaskGroupWrapper { - // The "proxy TaskGroup" - private TaskGroup proxyTaskGroup; - // The "actual TaskGroup" for which above TaskGroup act as proxy - private final TaskGroup actualTaskGroup; - - private final ClientLogger logger = new ClientLogger(this.getClass()); - - /** - * Creates ProxyTaskGroupWrapper. - * - * @param actualTaskGroup the actual TaskGroup for which proxy TaskGroup will be enabled - */ - ProxyTaskGroupWrapper(TaskGroup actualTaskGroup) { - this.actualTaskGroup = actualTaskGroup; - } - - /** - * @return true if the proxy TaskGroup is enabled for original TaskGroup. - */ - boolean isActive() { - return this.proxyTaskGroup != null; - } - - /** - * @return the wrapped proxy task group. - */ - TaskGroup taskGroup() { - return this.proxyTaskGroup; - } - - /** - * Add "post-run TaskGroup" for the "actual TaskGroup". - * - * @param postRunTaskGroup the dependency TaskGroup. - */ - void addPostRunTaskGroupForActualTaskGroup(TaskGroup postRunTaskGroup) { - if (this.proxyTaskGroup == null) { - this.initProxyTaskGroup(); - } - postRunTaskGroup.addDependencyGraph(this.actualTaskGroup); - if (postRunTaskGroup.proxyTaskGroupWrapper.isActive()) { - this.proxyTaskGroup.addDependencyGraph(postRunTaskGroup.proxyTaskGroupWrapper.proxyTaskGroup); - } else { - this.proxyTaskGroup.addDependencyGraph(postRunTaskGroup); - } - } - - /** - * Add a dependent for the proxy TaskGroup. - * - * @param dependentTaskGroup the dependent TaskGroup - */ - void addDependentTaskGroup(TaskGroup dependentTaskGroup) { - if (this.proxyTaskGroup == null) { - throw logger.logExceptionAsError(new IllegalStateException( - "addDependentTaskGroup() cannot be called in a non-active ProxyTaskGroup")); - } - dependentTaskGroup.addDependencyGraph(this.proxyTaskGroup); - } - - /** - * Initialize the proxy TaskGroup if not initialized yet. - */ - private void initProxyTaskGroup() { - if (this.proxyTaskGroup == null) { - // Creates proxy TaskGroup with an instance of ProxyTaskItem as root TaskItem which delegates actions on - // it to "actual TaskGroup"'s root. - // - ProxyTaskItem proxyTaskItem = new ProxyTaskItem(this.actualTaskGroup.root().data()); - this.proxyTaskGroup = new TaskGroup("proxy-" + this.actualTaskGroup.root().key(), - proxyTaskItem); - - if (this.actualTaskGroup.hasParents()) { - // Once "proxy TaskGroup" is enabled, all existing TaskGroups depends on "actual TaskGroup" should - // take dependency on "proxy TaskGroup". - // - String atgRootKey = this.actualTaskGroup.root().key(); - for (DAGraph> parentDAG : this.actualTaskGroup.parentDAGs) { - parentDAG.root().removeDependency(atgRootKey); - parentDAG.addDependencyGraph(this.proxyTaskGroup); - } - // re-assigned actual's parents as proxy's parents, so clear actual's parent collection. - // - this.actualTaskGroup.parentDAGs.clear(); - } - // "Proxy TaskGroup" takes dependency on "actual TaskGroup" - // - this.proxyTaskGroup.addDependencyGraph(this.actualTaskGroup); - // Add a back reference to "proxy" in actual - // - this.actualTaskGroup.rootTaskEntry.setProxy(this.proxyTaskGroup.rootTaskEntry); - } - } - } - - /** - * A {@link TaskItem} type that act as proxy for another {@link TaskItem}. - */ - private static final class ProxyTaskItem implements TaskItem { - private final TaskItem actualTaskItem; - - private ProxyTaskItem(final TaskItem actualTaskItem) { - this.actualTaskItem = actualTaskItem; - } - - @Override - public Indexable result() { - return actualTaskItem.result(); - } - - - @Override - public void beforeGroupInvoke() { - // NOP - } - - @Override - public boolean isHot() { - return actualTaskItem.isHot(); - } - - @Override - public Mono invokeAsync(InvocationContext context) { - return Mono.just(actualTaskItem.result()); - } - - @Override - public Mono invokeAfterPostRunAsync(final boolean isGroupFaulted) { - if (actualTaskItem.isHot()) { - return Mono.defer(() -> - actualTaskItem.invokeAfterPostRunAsync(isGroupFaulted).subscribeOn(Schedulers.immediate())); - } else { - return this.actualTaskItem.invokeAfterPostRunAsync(isGroupFaulted) - .subscribeOn(Schedulers.immediate()); - } - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/dag/TaskGroupEntry.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/dag/TaskGroupEntry.java deleted file mode 100644 index f52d3165e0a2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/dag/TaskGroupEntry.java +++ /dev/null @@ -1,125 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.dag; - -import com.azure.resourcemanager.resources.fluentcore.model.Indexable; -import reactor.core.publisher.Mono; - -/** - * Type representing an entry in {@link TaskGroup} that holds one {@link TaskItem} and associated - * information which includes: - * 1. references to other {@link TaskGroupEntry} dependencies - * 2. references to the other {@link TaskGroupEntry} dependents - * - * @param the task type that can return a value - */ -public final class TaskGroupEntry - extends DAGNode> { - /** - * The proxy entry for this entry if exists. - */ - private TaskGroupEntry proxy; - - /** - * indicates that one or more decedent dependency tasks are faulted. - */ - private boolean hasFaultedDescentDependencyTasks; - - /** - * Creates TaskGroupEntry. - * - * @param taskId id that uniquely identifies the task from other tasks in the group - * @param taskItem the task this entry holds - */ - TaskGroupEntry(String taskId, TaskT taskItem) { - super(taskId, taskItem); - } - - @Override - public void initialize() { - super.initialize(); - this.hasFaultedDescentDependencyTasks = false; - } - - /** - * Set the proxy entry for this entry. - * - * @param proxy the proxy entry - */ - public void setProxy(TaskGroupEntry proxy) { - this.proxy = proxy; - } - - /** - * @return the proxy entry if it is set, null if not set. - */ - public TaskGroupEntry proxy() { - return this.proxy; - } - - /** - * @return the result produced by the task. - */ - public Indexable taskResult() { - return taskItem().result(); - } - - /** - * @return true if one or more decedent dependency tasks are in faulted - * state, false otherwise. - */ - public boolean hasFaultedDescentDependencyTasks() { - return this.hasFaultedDescentDependencyTasks; - } - - /** - * Invokes the task this entry holds. - * if the task cannot be invoked due to faulted dependencies then an observable that emit - * {@link ErroredDependencyTaskException} will be returned. - * - * @param ignoreCachedResult if the task is already invoked and has result cached then a value false for this - * parameter indicates the cached result can be returned without invoking task again, - * if true then cached result will be ignored and task will be invoked - * @param context the context object shared across all the entries in the group that this entry belongs to, - * this will be passed to {@link TaskItem#invokeAsync(TaskGroup.InvocationContext)} - * method of the task item - * @return a cold Observable upon subscription invokes the task this entry hold, which produces a result of - * type {@link Indexable}. - */ - public Mono invokeTaskAsync(boolean ignoreCachedResult, final TaskGroup.InvocationContext context) { - if (hasFaultedDescentDependencyTasks) { - return Mono.error(new ErroredDependencyTaskException()); - } - final TaskT taskItem = this.taskItem(); - if (!ignoreCachedResult && hasCachedResult()) { - return Mono.just(taskItem.result()); - } - if (taskItem.isHot()) { - // Convert hot task to cold to delay it's execution until subscription. - return Mono.defer(() -> taskItem.invokeAsync(context)); - } else { - return taskItem.invokeAsync(context); - } - } - - @Override - protected void onFaultedResolution(String dependencyKey, Throwable throwable) { - super.onFaultedResolution(dependencyKey, throwable); - this.hasFaultedDescentDependencyTasks = true; - } - - /** - * @return the {@link TaskItem} this entry holds. - */ - private TaskT taskItem() { - return super.data(); - } - - /** - * @return true, if the result of the task is cached. - */ - private boolean hasCachedResult() { - return taskItem().result() != null; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/dag/TaskGroupTerminateOnErrorStrategy.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/dag/TaskGroupTerminateOnErrorStrategy.java deleted file mode 100644 index 01bc82903b93..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/dag/TaskGroupTerminateOnErrorStrategy.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.dag; - -/** - * Defines task group termination strategies to be used once a task error-ed. - */ -public enum TaskGroupTerminateOnErrorStrategy { - /** - * Indicate that on task error, allows for any currently executing tasks to finish and emit - * onError terminal event with {@link RuntimeException}. - * Acronym: IPTC - */ - TERMINATE_ON_IN_PROGRESS_TASKS_COMPLETION, - /** - * Indicate that on task error, allows any other tasks those are not directly or indirectly - * depends on the error-ed task to execute, once a LCA (lowest common ancestor) task is hit - * (at that point any progress cannot be made) emit onError terminal event with - * {@link RuntimeException} . - * Acronym: HLT - */ - TERMINATE_ON_HITTING_LCA_TASK -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/dag/TaskItem.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/dag/TaskItem.java deleted file mode 100644 index d742121d1b3c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/dag/TaskItem.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.dag; - -import com.azure.resourcemanager.resources.fluentcore.model.Indexable; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** - * Type representing a unit of work, upon invocation produces result of {@link Indexable} type. - *

    - * The {@link TaskGroup} holds a group of these TaskItems those depends on each other. - */ -public interface TaskItem { - /** - * @return the result of the task invocation - */ - Indexable result(); - - /** - * The method that gets called before invoking all the tasks in the {@link TaskGroup} - * this task belongs to. - */ - void beforeGroupInvoke(); - - /** - * @return true if the publisher returned by invokeAsync(cxt) is a hot observable, - * false if its a cold publisher. - */ - boolean isHot(); - - /** - * The method that gets called to perform the unit of work asynchronously. - * - * @param context the context shared across the the all task items in the group - * this task item belongs to. - * @return a {@link Mono} upon subscription does the unit of work and produces - * result of type {@link Indexable} - */ - Mono invokeAsync(TaskGroup.InvocationContext context); - - /** - * The method that gets called after invocation of "post run" task items depends on - * this TaskItem. - *

    - * This method will be invoked only if this TaskItem had "post run" dependents. - * - * @param isGroupFaulted true if one or more tasks in the group this TaskItem belongs - * to are in faulted state. - * @return a {@link Flux} representing any asynchronous work initiated - */ - Mono invokeAfterPostRunAsync(boolean isGroupFaulted); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/dag/VoidIndexable.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/dag/VoidIndexable.java deleted file mode 100644 index 5edfeb89550b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/dag/VoidIndexable.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.dag; - -import com.azure.resourcemanager.resources.fluentcore.model.Indexable; - -import java.util.Objects; - -/** - * Represents an index-able model, when used as return type of a method, - * it indicates invocation of the method may cause side-effect but does - * not produce a value. - */ -public final class VoidIndexable implements Indexable { - /** - * The key. - */ - private final String key; - - /** - * Creates VoidIndexable. - * - * @param key the key. - */ - public VoidIndexable(String key) { - Objects.requireNonNull(key); - this.key = key; - } - - @Override - public String key() { - return this.key; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/dag/package-info.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/dag/package-info.java deleted file mode 100644 index d7dbea8ebe36..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/dag/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. - -/** - * This package contains the graph related classes that are useful - * for performing cloud requests in parallel. - */ -package com.azure.resourcemanager.resources.fluentcore.dag; diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/exception/AggregatedManagementException.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/exception/AggregatedManagementException.java deleted file mode 100644 index 0fab205faa15..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/exception/AggregatedManagementException.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.exception; - -import com.azure.core.management.exception.ManagementException; - -import java.util.Arrays; -import java.util.Optional; - -/** - * Exception thrown for an invalid response with custom error information. - */ -public final class AggregatedManagementException extends ManagementException { - - /** - * Creates an instance of AggregatedManagementException. - * - * @param aggregatedException the aggregated exception. - * @param firstManagementException the first ManagementException in suppressed. - */ - private AggregatedManagementException(RuntimeException aggregatedException, - ManagementException firstManagementException) { - super(aggregatedException.getMessage(), - firstManagementException.getResponse(), firstManagementException.getValue()); - for (Throwable exception : aggregatedException.getSuppressed()) { - this.addSuppressed(exception); - } - } - - /** - * Tries to convert the exception to an AggregatedManagementException. - *

    - * Then conversion will happen when the exception suppresses at least one ManagementException. - * - * @param exception the exception. - * @return an AggregatedManagementException if the exception can be converted to AggregatedManagementException, - * the same exception if cannot. - */ - public static Throwable convertToManagementException(Throwable exception) { - if (exception instanceof ManagementException || !(exception instanceof RuntimeException)) { - return exception; - } - - Optional firstManagementException = Arrays.stream(exception.getSuppressed()) - .filter(e -> e instanceof ManagementException) - .map(e -> (ManagementException) e) - .findFirst(); - if (firstManagementException.isPresent()) { - return new AggregatedManagementException((RuntimeException) exception, firstManagementException.get()); - } else { - return exception; - } - } - - @Override - public String toString() { - StringBuilder builder = new StringBuilder(super.toString()); - boolean skipException = true; - // Information on first ManagementException is already contains in supper.toString() - for (Throwable exception : this.getSuppressed()) { - if (exception instanceof ManagementException) { - if (!skipException) { - ManagementException managementException = (ManagementException) exception; - if (managementException.getValue() != null && managementException.getValue().getMessage() != null) { - builder.append("; ").append(managementException.getValue().getMessage()); - } - } - skipException = false; - } - } - - return builder.toString(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/exception/package-info.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/exception/package-info.java deleted file mode 100644 index 9fdaeb224e64..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/exception/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -/** - * This package contains the exception classes for management plane libraries. - */ -package com.azure.resourcemanager.resources.fluentcore.exception; diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/Accepted.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/Accepted.java deleted file mode 100644 index 44fbfed5b345..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/Accepted.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.model; - -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.resources.fluentcore.rest.ActivationResponse; - -/** - * The accepted LRO (long running operation). - * - * @param the type of final result - */ -public interface Accepted { - - /** - * Gets the activation response of LRO. - * - * @return the activation response - */ - ActivationResponse getActivationResponse(); - - /** - * Gets the {@link SyncPoller} of LRO. - * - * @return the sync poller. - */ - SyncPoller getSyncPoller(); - - /** - * Gets the final result of LRO. - * - * @return the final result. - * @throws com.azure.core.management.exception.ManagementException If polling fails. - */ - T getFinalResult(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/Appliable.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/Appliable.java deleted file mode 100644 index 3597e1fb936a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/Appliable.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.model; - -import com.azure.core.util.Context; -import reactor.core.publisher.Mono; - -/** - * The base interface for all template interfaces that support update operations. - * - * @param the type of the resource returned from the update. - */ -public interface Appliable extends Indexable { - /** - * Execute the update request. - * - * @return the updated resource - */ - T apply(); - - /** - * Execute the update request asynchronously. - * - * @return the publisher of the resource update request - */ - Mono applyAsync(); - - /** - * Execute the update request. - * - * @param context the {@link Context} of the request - * @return the updated resource - */ - T apply(Context context); - - /** - * Execute the update request asynchronously. - * - * @param context the {@link Context} of the request - * @return the publisher of the resource update request - */ - Mono applyAsync(Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/Attachable.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/Attachable.java deleted file mode 100644 index 554e346b43aa..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/Attachable.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.model; - -/** - * The final stage of the child object definition, at which it can be attached to the parent. - * - * @param the stage of the parent definition to return to after attaching this definition. - */ -public interface Attachable { - /** - * Attaches this child object's definition to its parent's definition. - * - * @return the next stage of the parent object's definition - */ - ParentT attach(); - - /** - * The final stage of the child object definition, as which it can be attached to the parent. - * - * @param the parent definition - */ - interface InDefinition { - /** - * Attaches the child definition to the parent resource definiton. - * - * @return the next stage of the parent definition - */ - ParentT attach(); - } - - /** - * The final stage of the child object definition, as which it can be attached to the parent. - * - * @param the parent definition - */ - interface InDefinitionAlt { - /** - * Attaches the child definition to the parent resource definition. - * - * @return the next stage of the parent definition - */ - ParentT attach(); - } - - /** - * The final stage of the child object definition, as which it can be attached to the parent. - * - * @param the parent definition - */ - interface InUpdate { - /** - * Attaches the child definition to the parent resource update. - * - * @return the next stage of the parent definition - */ - ParentT attach(); - } - - /** - * The final stage of the child object definition, as which it can be attached to the parent. - * - * @param the parent definition - */ - interface InUpdateAlt { - /** - * Attaches the child definition to the parent resource update. - * - * @return the next stage of the parent definition - */ - ParentT attach(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/Creatable.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/Creatable.java deleted file mode 100644 index e26827abc3b0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/Creatable.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.model; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasName; -import reactor.core.publisher.Mono; - -/** - * The final stage of the resource definition, at which it can be created using create(). - * - * @param the fluent type of the resource to be created - */ -public interface Creatable extends - Indexable, - HasName { - - /** - * Execute the create request. - * - * @return the create resource - */ - T create(); - - /** - * Puts the request into the queue and allow the HTTP client to execute - * it when system resources are available. - * - * @return the publisher of the resource create request - */ - Mono createAsync(); - - /** - * Execute the create request. - * - * @param context the {@link Context} of the request - * @return the created resource - */ - T create(Context context); - - /** - * Puts the request into the queue and allow the HTTP client to execute - * it when system resources are available. - * - * @param context the {@link Context} of the request - * @return the publisher of the resource create request - */ - Mono createAsync(Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/CreatedResources.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/CreatedResources.java deleted file mode 100644 index 12a8a9761af6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/CreatedResources.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.model; - -import java.util.Map; - -/** - * Represents the results of batch of create operations. - *

    - * (Note: this interface is not intended to be implemented by user code) - * @param the type of the resource in this batch - */ -public interface CreatedResources extends Map { - /** - * Gets a created resource with the given key. - * - * @param key the key of the resource - * @return the created resource - */ - Indexable createdRelatedResource(String key); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/Executable.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/Executable.java deleted file mode 100644 index 49c81a12f125..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/Executable.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.model; - -import reactor.core.publisher.Mono; - -/** - * The base interface for all template interfaces that support execute operations. - * - * @param the type of result produced by the execution. - */ -public interface Executable extends Indexable { - /** - * Execute the request. - * - * @return execution result object - */ - T execute(); - - /** - * Execute the request asynchronously. - * - * @return the handle to the REST call - */ - Mono executeAsync(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/HasInnerModel.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/HasInnerModel.java deleted file mode 100644 index c6af860f0a20..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/HasInnerModel.java +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.model; - -/** - * The wrapper around an inner model providing extended functionalities. - * - * @param the type of the inner object. - */ -public interface HasInnerModel { - /** - * @return wrapped inner model providing direct access to the underlying - * auto-generated API implementation, based on Azure REST API - */ - T innerModel(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/HasServiceClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/HasServiceClient.java deleted file mode 100644 index 3e8be4f7e94d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/HasServiceClient.java +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.model; - -/** - * The wrapper around a service client providing extended functionalities. - * - * @param the type of the service client. - */ -public interface HasServiceClient { - /** - * @return wrapped service client providing direct access to the underlying - * auto-generated API implementation, based on Azure REST API - */ - T serviceClient(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/Indexable.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/Indexable.java deleted file mode 100644 index f50534b32815..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/Indexable.java +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.model; - -/** - * Base interface for all models that can be indexed by a key. - */ -public interface Indexable { - /** - * @return the index key. - */ - String key(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/Refreshable.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/Refreshable.java deleted file mode 100644 index 1cfd59b2ef92..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/Refreshable.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.model; - -import reactor.core.publisher.Mono; - -/** - * Base class for resources that can be refreshed to get the latest state. - * - * @param the fluent type of the resource - */ -public interface Refreshable { - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource - */ - T refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @return the Mono to refreshed resource - */ - Mono refreshAsync(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/Settable.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/Settable.java deleted file mode 100644 index d012b25bdeff..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/Settable.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.model; - -/** - * The base interface for all template interfaces for child resources that support - * update operations. - * - * @param the parent definition {@link Settable#parent()} returns to - */ -public interface Settable { - /** - * Begins an update for a child resource. - *

    - * This is the beginning of the builder pattern used to update child resources - * The final method completing the update and continue - * the actual parent resource update process in Azure is {@link Settable#parent()}. - * - * @return the stage of parent resource update - */ - ParentT parent(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/Updatable.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/Updatable.java deleted file mode 100644 index b75ac551c735..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/Updatable.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.model; - -/** - * Base class for resource that can be updated. - * - * @param the fluent type of the resource - */ -public interface Updatable { - /** - * Begins an update for a new resource. - *

    - * This is the beginning of the builder pattern used to update top level resources - * in Azure. The final method completing the definition and starting the actual resource creation - * process in Azure is {@link Appliable#apply()}. - * - * @return the stage of new resource update - */ - T update(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/implementation/AcceptedImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/implementation/AcceptedImpl.java deleted file mode 100644 index 4d50ee700657..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/implementation/AcceptedImpl.java +++ /dev/null @@ -1,437 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.model.implementation; - -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.management.exception.ManagementError; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.management.polling.PollerFactory; -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.Context; -import com.azure.core.util.CoreUtils; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.LongRunningOperationStatus; -import com.azure.core.util.polling.PollResponse; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.core.util.serializer.SerializerAdapter; -import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.resourcemanager.resources.fluentcore.model.Accepted; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.rest.ActivationResponse; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import com.fasterxml.jackson.annotation.JsonProperty; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -import java.io.IOException; -import java.lang.reflect.Type; -import java.nio.ByteBuffer; -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; -import java.time.Duration; -import java.util.Objects; -import java.util.function.Consumer; -import java.util.function.Function; -import java.util.function.Supplier; - -public class AcceptedImpl implements Accepted { - - private final ClientLogger logger = new ClientLogger(getClass()); - - private final Response> activationResponse; - private byte[] responseBytes; - private final SerializerAdapter serializerAdapter; - private final HttpPipeline httpPipeline; - private final Duration defaultPollInterval; - private final Type pollResultType; - private final Type finalResultType; - private final Function wrapOperation; - private final Context context; - - private PollerFlux, InnerT> pollerFlux; - private SyncPoller syncPoller; - - public AcceptedImpl(Response> activationResponse, - SerializerAdapter serializerAdapter, - HttpPipeline httpPipeline, - Duration defaultPollInterval, - Type pollResultType, - Type finalResultType, - Function wrapOperation, - Context context) { - this.activationResponse = Objects.requireNonNull(activationResponse); - this.serializerAdapter = Objects.requireNonNull(serializerAdapter); - this.httpPipeline = Objects.requireNonNull(httpPipeline); - this.defaultPollInterval = Objects.requireNonNull(defaultPollInterval); - this.pollResultType = Objects.requireNonNull(pollResultType); - this.finalResultType = Objects.requireNonNull(finalResultType); - this.wrapOperation = Objects.requireNonNull(wrapOperation); - this.context = context; - } - - @Override - public ActivationResponse getActivationResponse() { - try { - T value = wrapOperation.apply(serializerAdapter.deserialize( - new String(getResponse(), StandardCharsets.UTF_8), - finalResultType, - SerializerEncoding.JSON)); - Duration retryAfter = getRetryAfter(activationResponse.getHeaders()); - return new ActivationResponse<>(activationResponse.getRequest(), activationResponse.getStatusCode(), - activationResponse.getHeaders(), value, - getActivationResponseStatus(), retryAfter); - } catch (IOException e) { - throw logger.logExceptionAsError( - new IllegalStateException("Failed to deserialize activation response body", e)); - } - } - - @Override - public SyncPoller getSyncPoller() { - if (syncPoller == null) { - // refer to AzureServiceClient.getLroFinalResultOrError - Function>, ManagementException> errorOperation = response -> { - String errorMessage; - ManagementError managementError = null; - HttpResponse errorResponse = null; - PollResult.Error lroError = response.getValue().getError(); - if (response.getValue().getError() != null) { - errorResponse = new HttpResponseImpl(lroError.getResponseStatusCode(), - lroError.getResponseHeaders(), lroError.getResponseBody()); - - errorMessage = response.getValue().getError().getMessage(); - String errorBody = response.getValue().getError().getResponseBody(); - if (errorBody != null) { - // try to deserialize error body to ManagementError - try { - managementError = serializerAdapter.deserialize( - errorBody, - ManagementError.class, - SerializerEncoding.JSON); - if (managementError.getCode() == null || managementError.getMessage() == null) { - managementError = null; - } - } catch (IOException | RuntimeException ioe) { - logger.logThrowableAsWarning(ioe); - } - } - } else { - // fallback to default error message - errorMessage = "Long running operation failed."; - } - if (managementError == null) { - // fallback to default ManagementError - managementError = new ManagementError(response.getStatus().toString(), errorMessage); - } - return new ManagementException(errorMessage, errorResponse, managementError); - }; - - syncPoller = new SyncPollerImpl(this.getPollerFlux().getSyncPoller(), - wrapOperation, errorOperation); - } - return syncPoller; - } - - private PollerFlux, InnerT> getPollerFlux() { - if (pollerFlux == null) { - Flux content = Flux.just(ByteBuffer.wrap(getResponse())); - Response> clonedResponse = new SimpleResponse<>(activationResponse, content); - - pollerFlux = PollerFactory.create( - serializerAdapter, - httpPipeline, - pollResultType, - finalResultType, - defaultPollInterval, - Mono.just(clonedResponse), - context - ); - } - return pollerFlux; - } - - @Override - public T getFinalResult() { - return this.getSyncPoller().getFinalResult(); - } - - private LongRunningOperationStatus getActivationResponseStatus() { - String responseBody = new String(getResponse(), StandardCharsets.UTF_8); - String provisioningState = null; - // try get "provisioningState" property. - if (!CoreUtils.isNullOrEmpty(responseBody)) { - try { - ResourceWithProvisioningState resource = serializerAdapter.deserialize(responseBody, - ResourceWithProvisioningState.class, SerializerEncoding.JSON); - provisioningState = resource != null - ? resource.getProvisioningState() - : null; - } catch (IOException ignored) { - - } - } - - // get LRO status, default is IN_PROGRESS - LongRunningOperationStatus status = LongRunningOperationStatus.IN_PROGRESS; - if (!CoreUtils.isNullOrEmpty(provisioningState)) { - // LRO status based on provisioningState. - status = toLongRunningOperationStatus(provisioningState); - } else { - // LRO status based on status code. - int statusCode = activationResponse.getStatusCode(); - if (statusCode == 200 || statusCode == 201 || statusCode == 204) { - status = LongRunningOperationStatus.SUCCESSFULLY_COMPLETED; - } - } - return status; - } - - private static LongRunningOperationStatus toLongRunningOperationStatus(String value) { - if (ProvisioningState.SUCCEEDED.equalsIgnoreCase(value)) { - return LongRunningOperationStatus.SUCCESSFULLY_COMPLETED; - } else if (ProvisioningState.FAILED.equalsIgnoreCase(value)) { - return LongRunningOperationStatus.FAILED; - } else if (ProvisioningState.CANCELED.equalsIgnoreCase(value)) { - return LongRunningOperationStatus.USER_CANCELLED; - } else if (ProvisioningState.IN_PROGRESS.equalsIgnoreCase(value)) { - return LongRunningOperationStatus.IN_PROGRESS; - } - return LongRunningOperationStatus.fromString(value, false); - } - - private static Duration getRetryAfter(HttpHeaders headers) { - if (headers != null) { - final String value = headers.getValue("Retry-After"); - if (value != null) { - return Duration.ofSeconds(Long.parseLong(value)); - } - } - return null; - } - - private byte[] getResponse() { - if (responseBytes == null) { - responseBytes = FluxUtil.collectBytesInByteBufferStream(activationResponse.getValue()).block(); - } - return responseBytes; - } - - private static class SyncPollerImpl - implements SyncPoller { - - private final SyncPoller, InnerT> syncPoller; - private final Function wrapOperation; - private final Function>, ManagementException> errorOperation; - private T finalResult; - private ManagementException exception; - - SyncPollerImpl(SyncPoller, InnerT> syncPoller, Function wrapOperation, - Function>, ManagementException> errorOperation) { - this.syncPoller = syncPoller; - this.wrapOperation = wrapOperation; - this.errorOperation = errorOperation; - } - - @Override - public PollResponse poll() { - return voidResponse(syncPoller.poll()); - } - - @Override - public PollResponse waitForCompletion() { - return voidResponse(syncPoller.waitForCompletion()); - } - - @Override - public PollResponse waitForCompletion(Duration duration) { - return voidResponse(syncPoller.waitForCompletion(duration)); - } - - @Override - public PollResponse waitUntil(LongRunningOperationStatus longRunningOperationStatus) { - return voidResponse(syncPoller.waitUntil(longRunningOperationStatus)); - } - - @Override - public PollResponse waitUntil(Duration duration, LongRunningOperationStatus longRunningOperationStatus) { - return voidResponse(syncPoller.waitUntil(duration, longRunningOperationStatus)); - } - - @Override - public T getFinalResult() { - if (exception != null) { - throw exception; - } - if (finalResult == null) { - final InnerT innerFinalResult = syncPoller.getFinalResult(); - if (innerFinalResult == null) { - // possible failure - PollResponse> response = syncPoller.poll(); - if (response.getStatus() == LongRunningOperationStatus.FAILED - || response.getStatus() == LongRunningOperationStatus.USER_CANCELLED) { - exception = errorOperation.apply(response); - throw exception; - } - } - finalResult = wrapOperation.apply(innerFinalResult); - } - return finalResult; - } - - @Override - public void cancelOperation() { - syncPoller.cancelOperation(); - } - - private PollResponse voidResponse(PollResponse> pollResponse) { - return new PollResponse<>(pollResponse.getStatus(), null, pollResponse.getRetryAfter()); - } - } - - private static class ResourceWithProvisioningState { - @JsonProperty(value = "properties") - private Properties properties; - - private String getProvisioningState() { - if (this.properties != null) { - return this.properties.provisioningState; - } else { - return null; - } - } - - private static class Properties { - @JsonProperty(value = "provisioningState") - private String provisioningState; - } - } - - private static class ProvisioningState { - static final String IN_PROGRESS = "InProgress"; - static final String SUCCEEDED = "Succeeded"; - static final String FAILED = "Failed"; - static final String CANCELED = "Canceled"; - } - - private static class HttpResponseImpl extends HttpResponse { - private final int statusCode; - private final byte[] responseBody; - private final HttpHeaders httpHeaders; - - HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { - super(null); - this.statusCode = statusCode; - this.httpHeaders = httpHeaders; - this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); - } - - @Override - public int getStatusCode() { - return statusCode; - } - - @Override - public String getHeaderValue(String s) { - return httpHeaders.getValue(s); - } - - @Override - public HttpHeaders getHeaders() { - return httpHeaders; - } - - @Override - public Flux getBody() { - return Flux.just(ByteBuffer.wrap(responseBody)); - } - - @Override - public Mono getBodyAsByteArray() { - return Mono.just(responseBody); - } - - @Override - public Mono getBodyAsString() { - return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); - } - - @Override - public Mono getBodyAsString(Charset charset) { - return Mono.just(new String(responseBody, charset)); - } - } - - public static Accepted newAccepted( - ClientLogger logger, - HttpPipeline httpPipeline, - Duration pollInterval, - Supplier>> activationOperation, - Function convertOperation, - Type innerType, - Runnable preActivation, - Context context) { - - if (preActivation != null) { - preActivation.run(); - } - - Response> activationResponse = activationOperation.get(); - if (activationResponse == null) { - throw logger.logExceptionAsError(new NullPointerException()); - } else { - Accepted accepted = new AcceptedImpl( - activationResponse, - SerializerFactory.createDefaultManagementSerializerAdapter(), - httpPipeline, - ResourceManagerUtils.InternalRuntimeContext.getDelayDuration(pollInterval), - innerType, innerType, - convertOperation, - context); - - return accepted; - } - } - - public static , InnerT> Accepted newAccepted( - ClientLogger logger, - HttpPipeline httpPipeline, - Duration pollInterval, - Supplier>> activationOperation, - Function convertOperation, - Type innerType, - Runnable preActivation, Consumer postActivation, - Context context) { - - if (preActivation != null) { - preActivation.run(); - } - - Response> activationResponse = activationOperation.get(); - if (activationResponse == null) { - throw logger.logExceptionAsError(new NullPointerException()); - } else { - Accepted accepted = new AcceptedImpl( - activationResponse, - SerializerFactory.createDefaultManagementSerializerAdapter(), - httpPipeline, - ResourceManagerUtils.InternalRuntimeContext.getDelayDuration(pollInterval), - innerType, innerType, - convertOperation, - context); - - if (postActivation != null) { - postActivation.accept(accepted.getActivationResponse().getValue().innerModel()); - } - - return accepted; - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/implementation/AppliableImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/implementation/AppliableImpl.java deleted file mode 100644 index 6f654f97af3b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/implementation/AppliableImpl.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.model.implementation; - -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.resources.fluentcore.model.Indexable; -import com.azure.resourcemanager.resources.fluentcore.model.Updatable; -import reactor.core.publisher.Mono; - -/** - * The base class for all updatable resource. - * - * @param the fluent model type representing the creatable resource - * @param the model inner type that the fluent model type wraps - * @param the fluent model implementation type - */ -public abstract class AppliableImpl< - FluentModelT extends Indexable, - InnerModelT, - FluentModelImplT extends IndexableRefreshableWrapperImpl> - extends - CreatableUpdatableImpl - implements - Updatable { - private final ClientLogger logger = new ClientLogger(getClass()); - /** - * Creates an AppliableImpl. - * - * @param name the appliable name - * @param innerObject the inner object - */ - protected AppliableImpl(String name, InnerModelT innerObject) { - super(name, innerObject); - } - - @Override - public final Mono createAsync() { - throw logger.logExceptionAsError( - new IllegalStateException("Internal Error: createAsync cannot be called from UpdatableImpl")); - } - - @Override - public final Mono createResourceAsync() { - throw logger.logExceptionAsError( - new IllegalStateException("Internal Error: createResourceAsync cannot be called from UpdatableImpl")); - } - - @Override - public abstract Mono updateResourceAsync(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/implementation/CreatableImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/implementation/CreatableImpl.java deleted file mode 100644 index 51fc9b783951..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/implementation/CreatableImpl.java +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.model.implementation; - -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.resources.fluentcore.model.Indexable; -import reactor.core.publisher.Mono; - -/** - * The base class for all creatable resource. - * - * @param the fluent model type representing the creatable resource - * @param the model inner type that the fluent model type wraps - * @param the fluent model implementation type - */ -public abstract class CreatableImpl< - FluentModelT extends Indexable, - InnerModelT, - FluentModelImplT extends IndexableRefreshableWrapperImpl> - extends - CreatableUpdatableImpl { - private final ClientLogger logger = new ClientLogger(getClass()); - /** - * Creates a CreatableImpl. - * - * @param name the creatable name - * @param innerObject the inner object - */ - protected CreatableImpl(String name, InnerModelT innerObject) { - super(name, innerObject); - } - - @Override - public final Mono applyAsync() { - throw logger.logExceptionAsError( - new IllegalStateException("Internal Error: applyAsync cannot be called from CreatableImpl")); - } - - @Override - public final Mono updateResourceAsync() { - throw logger.logExceptionAsError( - new IllegalStateException("Internal Error: updateResourceAsync cannot be called from CreatableImpl")); - } - - @Override - public abstract Mono createResourceAsync(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/implementation/CreatableUpdatableImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/implementation/CreatableUpdatableImpl.java deleted file mode 100644 index d50d096ca009..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/implementation/CreatableUpdatableImpl.java +++ /dev/null @@ -1,321 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.model.implementation; - -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.resources.fluentcore.dag.FunctionalTaskItem; -import com.azure.resourcemanager.resources.fluentcore.dag.TaskGroup; -import com.azure.resourcemanager.resources.fluentcore.exception.AggregatedManagementException; -import com.azure.resourcemanager.resources.fluentcore.model.Appliable; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.Executable; -import com.azure.resourcemanager.resources.fluentcore.model.Indexable; -import com.azure.resourcemanager.resources.fluentcore.model.Updatable; -import reactor.core.publisher.Mono; - -import java.util.Objects; -import java.util.UUID; -import java.util.function.Function; - -/** - * The base class for all creatable and updatable model. - * - * @param the fluent model type - * @param the inner model type that the fluent model wraps - * @param the implementation type of the fluent model - */ -public abstract class CreatableUpdatableImpl< - FluentModelT extends Indexable, - InnerModelT, - FluentModelImplT extends IndexableRefreshableWrapperImpl> - extends IndexableRefreshableWrapperImpl - implements - Appliable, - Creatable, - TaskGroup.HasTaskGroup, - CreateUpdateTask.ResourceCreatorUpdater { - /** - * The name of the creatable updatable model. - */ - private final String name; - /** - * The group of tasks to create or update this model and it's dependencies. - */ - private final TaskGroup taskGroup; - - /** - * Creates CreatableUpdatableImpl. - * - * @param name the name of the model - * @param innerObject the inner model object - */ - protected CreatableUpdatableImpl(String name, InnerModelT innerObject) { - this(name, UUID.randomUUID().toString(), innerObject); - } - - /** - * Creates CreatableUpdatableImpl. - * - * @param name the name of the model - * @param key task group key for the creator updater of this model - * @param innerObject the inner model object - */ - protected CreatableUpdatableImpl(String name, String key, InnerModelT innerObject) { - super(key, innerObject); - this.name = name; - taskGroup = new TaskGroup(this.key(), - new CreateUpdateTask(this)); - } - - @Override - public String name() { - return this.name; - } - - @Override - public TaskGroup taskGroup() { - return this.taskGroup; - } - - /** - * Add a dependency task item for this model. - * - * @param dependency the dependency task item. - * @return key to be used as parameter to taskResult(string) method to retrieve result the task item - */ - protected String addDependency(FunctionalTaskItem dependency) { - Objects.requireNonNull(dependency); - return this.taskGroup.addDependency(dependency); - } - - /** - * Add a dependency task group for this model. - * - * @param dependency the dependency. - * @return key to be used as parameter to taskResult(string) method to retrieve result of root - * task in the given dependency task group - */ - protected String addDependency(TaskGroup.HasTaskGroup dependency) { - Objects.requireNonNull(dependency); - this.taskGroup.addDependencyTaskGroup(dependency.taskGroup()); - return dependency.taskGroup().key(); - } - - /** - * Add a creatable dependency for this model. - * - * @param creatable the creatable dependency. - * @return the key to be used as parameter to taskResult(string) method to retrieve created dependency - */ - @SuppressWarnings("unchecked") - protected String addDependency(Creatable creatable) { - TaskGroup.HasTaskGroup dependency = (TaskGroup.HasTaskGroup) creatable; - return this.addDependency(dependency); - } - - /** - * Add an appliable dependency for this model. - * - * @param appliable the appliable dependency. - * @return the key to be used as parameter to taskResult(string) method to retrieve updated dependency - */ - @SuppressWarnings("unchecked") - protected String addDependency(Appliable appliable) { - TaskGroup.HasTaskGroup dependency = (TaskGroup.HasTaskGroup) appliable; - return this.addDependency(dependency); - } - - /** - * Add an executable dependency for this model. - * - * @param executable the executable dependency - * @return the key to be used as parameter to taskResult(string) method to retrieve result of executing - * the executable dependency - */ - @SuppressWarnings("unchecked") - protected String addDependency(Executable executable) { - TaskGroup.HasTaskGroup dependency = (TaskGroup.HasTaskGroup) executable; - return this.addDependency(dependency); - } - - /** - * Add a "post-run" dependent task item for this model. - * - * @param dependent the "post-run" dependent task item. - * @return key to be used as parameter to taskResult(string) method to retrieve result of root - * task in the given dependent task group - */ - public String addPostRunDependent(FunctionalTaskItem dependent) { - Objects.requireNonNull(dependent); - return this.taskGroup().addPostRunDependent(dependent); - } - - /** - * Add a "post-run" dependent for this model. - * - * @param dependent the "post-run" dependent. - * @return key to be used as parameter to taskResult(string) method to retrieve result of root - * task in the given dependent task group - */ - protected String addPostRunDependent(TaskGroup.HasTaskGroup dependent) { - Objects.requireNonNull(dependent); - this.taskGroup.addPostRunDependentTaskGroup(dependent.taskGroup()); - return dependent.taskGroup().key(); - } - - /** - * Add a creatable "post-run" dependent for this model. - * - * @param creatable the creatable "post-run" dependent. - * @return the key to be used as parameter to taskResult(string) method to retrieve created "post-run" dependent - */ - @SuppressWarnings("unchecked") - protected String addPostRunDependent(Creatable creatable) { - TaskGroup.HasTaskGroup dependency = (TaskGroup.HasTaskGroup) creatable; - return this.addPostRunDependent(dependency); - } - - /** - * Add an appliable "post-run" dependent for this model. - * - * @param appliable the appliable "post-run" dependent. - * @return the key to be used as parameter to taskResult(string) method to retrieve updated "post-run" dependent - */ - @SuppressWarnings("unchecked") - protected String addPostRunDependent(Appliable appliable) { - TaskGroup.HasTaskGroup dependency = (TaskGroup.HasTaskGroup) appliable; - return this.addPostRunDependent(dependency); - } - - /** - * Add an executable "post-run" dependent for this model. - * - * @param executable the executable "post-run" dependent - * @return the key to be used as parameter to taskResult(string) method to retrieve result of executing - * the executable "post-run" dependent - */ - @SuppressWarnings("unchecked") - protected void addPostRunDependent(Executable executable) { - TaskGroup.HasTaskGroup dependency = (TaskGroup.HasTaskGroup) executable; - this.addPostRunDependent(dependency); - } - - @Override - public void beforeGroupCreateOrUpdate() { - // The types extending from this type, can override this method and add - // delayed dependencies and/or post-run dependents. - } - - @Override - public Mono createAsync() { - return createOrUpdateAsync(); - } - - @Override - public Mono applyAsync() { - return createOrUpdateAsync(); - } - - @Override - public Mono createAsync(Context context) { - return invokeTaskGroupAsync(context); - } - - @Override - public Mono applyAsync(Context context) { - return invokeTaskGroupAsync(context); - } - - @SuppressWarnings("unchecked") - public Mono createOrUpdateAsync() { - return taskGroup.invokeAsync() - .map(indexable -> (FluentModelT) indexable) - .onErrorMap(AggregatedManagementException::convertToManagementException); - } - - @SuppressWarnings("unchecked") - private Mono invokeTaskGroupAsync(Context context) { - return taskGroup().invokeAsync() - .contextWrite(c -> c.putAll(FluxUtil.toReactorContext(context).readOnly())) - .map(indexable -> (FluentModelT) indexable) - .onErrorMap(AggregatedManagementException::convertToManagementException); - } - - @Override - public boolean isHot() { - // createResourceAsync & updateResourceAsync returns cold observable since Retrofit Http - // request APIs (POST, PUT, PATCH ..) returns cold observable - return false; - } - - @Override - public FluentModelT create() { - return createAsync().block(); - } - - @Override - public FluentModelT apply() { - return applyAsync().block(); - } - - @Override - public FluentModelT create(Context context) { - return createAsync(context).block(); - } - - @Override - public FluentModelT apply(Context context) { - return applyAsync(context).block(); - } - - /** - * Default implementation of {@link Updatable#update()}. - * - * @return the first stage of model update - */ - @SuppressWarnings("unchecked") - public FluentModelImplT update() { - return (FluentModelImplT) this; - } - - @Override - public Mono updateResourceAsync() { - return this.createResourceAsync(); - } - - /** - * Get result of one of the task that belongs to this task's task group. - * - * @param key the task key - * @param the actual type of the task result - * @return the task result, null will be returned if task has not produced a result yet - */ - @SuppressWarnings("unchecked") - protected T taskResult(String key) { - Indexable result = this.taskGroup.taskResult(key); - if (result == null) { - return null; - } else { - T castedResult = (T) result; - return castedResult; - } - } - - @SuppressWarnings("unchecked") - protected Function innerToFluentMap(final FluentModelImplT fluentModelImplT) { - return innerModel -> { - fluentModelImplT.setInner(innerModel); - return (FluentModelT) fluentModelImplT; - }; - } - - @Override - public Mono afterPostRunAsync(boolean isGroupFaulted) { - // The types extending from this type can override this method and perform - // any activities that needs to be done after the processing of all - // post-run tasks. - return Mono.empty(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/implementation/CreateUpdateTask.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/implementation/CreateUpdateTask.java deleted file mode 100644 index bfb2c605ccb4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/implementation/CreateUpdateTask.java +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.model.implementation; - -import com.azure.resourcemanager.resources.fluentcore.model.Indexable; -import com.azure.resourcemanager.resources.fluentcore.dag.TaskGroup; -import com.azure.resourcemanager.resources.fluentcore.dag.TaskItem; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import reactor.core.publisher.Mono; - -/** - * A {@link TaskItem} type, when invoked it create or update a resource using - * the {@link ResourceCreatorUpdater} it composes. - * - * @param the type of the resource that this task creates or update - */ -public class CreateUpdateTask implements TaskItem { - /** - * the underlying instance that can create and update the resource. - */ - private ResourceCreatorUpdater resourceCreatorUpdater; - /** - * created or updated resource. - */ - private ResourceT resource; - - /** - * Creates CreateUpdateTask. - * - * @param resourceCreatorUpdater the resource creator and updater used by this TaskItem - * to create or update the resource when invoked. - */ - public CreateUpdateTask(ResourceCreatorUpdater resourceCreatorUpdater) { - this.resourceCreatorUpdater = resourceCreatorUpdater; - } - - @Override - public ResourceT result() { - return resource; - } - - @Override - public void beforeGroupInvoke() { - this.resourceCreatorUpdater.beforeGroupCreateOrUpdate(); - } - - @Override - public Mono invokeAsync(TaskGroup.InvocationContext context) { - if (this.resourceCreatorUpdater.isInCreateMode()) { - return this.resourceCreatorUpdater.createResourceAsync() - .subscribeOn(ResourceManagerUtils.InternalRuntimeContext.getReactorScheduler()) - .doOnNext(resourceT -> resource = resourceT) - .map(resourceT -> resourceT); - } else { - return this.resourceCreatorUpdater.updateResourceAsync() - .subscribeOn(ResourceManagerUtils.InternalRuntimeContext.getReactorScheduler()) - .doOnNext(resourceT -> resource = resourceT) - .map(resourceT -> resourceT); - } - } - - @Override - public Mono invokeAfterPostRunAsync(boolean isGroupFaulted) { - return this.resourceCreatorUpdater.afterPostRunAsync(isGroupFaulted); - } - - @Override - public boolean isHot() { - return this.resourceCreatorUpdater.isHot(); - } - - - /** - * Represents a type that know how to create or update a resource of type {@link T}. - *

    - * An instance of {@link CreateUpdateTask} wraps this type and invokes appropriate - * methods when CreateUpdateTask methods get called during TaskGroup invocation. - * - * @param the resource type - */ - public interface ResourceCreatorUpdater { - /** - * @return true if this creatorUpdater is in create mode. - */ - boolean isInCreateMode(); - - /** - * The method that gets called before invoking all the tasks in the {@link TaskGroup} - * that the parent {@link CreateUpdateTask} belongs to. - */ - void beforeGroupCreateOrUpdate(); - - /** - * Creates the resource asynchronously. - * - * @return a publisher that create the resource when subscribed - */ - Mono createResourceAsync(); - - /** - * Update the resource asynchronously. - * - * @return a publisher that update the resource when subscribed - */ - Mono updateResourceAsync(); - - /** - * @return true if the observable returned by {@link this#createResourceAsync()} and - * {@link this#updateResourceAsync()} are hot observables, false if they are cold - * observables. - */ - boolean isHot(); - - /** - * Perform any action followed by the processing of work scheduled to be invoked - * (i.e. "post run") after {@link this#createResourceAsync()} or - * {@link this#updateResourceAsync()}. - * - * @param isGroupFaulted true if one or more tasks in the group this creatorUpdater - * belongs to are in faulted state. - * @return a completable represents the asynchronous action - */ - Mono afterPostRunAsync(boolean isGroupFaulted); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/implementation/ExecutableImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/implementation/ExecutableImpl.java deleted file mode 100644 index f16b32e9661e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/implementation/ExecutableImpl.java +++ /dev/null @@ -1,221 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.model.implementation; - -import com.azure.resourcemanager.resources.fluentcore.dag.FunctionalTaskItem; -import com.azure.resourcemanager.resources.fluentcore.dag.TaskGroup; -import com.azure.resourcemanager.resources.fluentcore.exception.AggregatedManagementException; -import com.azure.resourcemanager.resources.fluentcore.model.Appliable; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.Executable; -import com.azure.resourcemanager.resources.fluentcore.model.Indexable; -import reactor.core.publisher.Mono; - -import java.util.Objects; -import java.util.UUID; - -/** - * The base class for all executable model. - * - * @param the fluent model type - */ -public abstract class ExecutableImpl - extends - IndexableImpl - implements - TaskGroup.HasTaskGroup, - Executable, - ExecuteTask.Executor { - /** - * The group of tasks to the produces this result and it's dependencies results. - */ - private final TaskGroup taskGroup; - - /** - * Creates ExecutableImpl. - */ - protected ExecutableImpl() { - this(UUID.randomUUID().toString()); - } - - /** - * Creates ExecutableImpl. - * - * @param key the task group key for the executable - */ - protected ExecutableImpl(String key) { - super(key); - taskGroup = new TaskGroup(this.key(), new ExecuteTask(this)); - } - - @Override - public TaskGroup taskGroup() { - return this.taskGroup; - } - - /** - * Add a dependency task item for this executable. - * - * @param dependency the dependency task item. - * @return key to be used as parameter to taskResult(string) method to retrieve result the task item - */ - protected String addDependency(FunctionalTaskItem dependency) { - Objects.requireNonNull(dependency); - return this.taskGroup.addDependency(dependency); - } - - /** - * Add a dependency for this executable. - * - * @param dependency the dependency. - * @return key to be used as parameter to taskResult(string) method to retrieve result of root - * task in the given dependency task group - */ - protected String addDependency(TaskGroup.HasTaskGroup dependency) { - Objects.requireNonNull(dependency); - this.taskGroup.addDependencyTaskGroup(dependency.taskGroup()); - return dependency.taskGroup().key(); - } - - /** - * Add a creatable dependency for this executable. - * - * @param creatable the creatable dependency. - * @return the key to be used as parameter to taskResult(string) method to retrieve created dependency - */ - @SuppressWarnings("unchecked") - protected String addDependency(Creatable creatable) { - TaskGroup.HasTaskGroup dependency = (TaskGroup.HasTaskGroup) creatable; - return this.addDependency(dependency); - } - - /** - * Add an updatable dependency for this executable. - * - * @param appliable the appliable dependency. - * @return the key to be used as parameter to taskResult(string) method to retrieve updated dependency - */ - @SuppressWarnings("unchecked") - protected String addDependency(Appliable appliable) { - TaskGroup.HasTaskGroup dependency = (TaskGroup.HasTaskGroup) appliable; - return this.addDependency(dependency); - } - - /** - * Add an executable dependency for this executable. - * - * @param executable the executable dependency - * @return the key to be used as parameter to taskResult(string) method to retrieve result of executing - * the given executable dependency - */ - @SuppressWarnings("unchecked") - protected String addDependency(Executable executable) { - TaskGroup.HasTaskGroup dependency = (TaskGroup.HasTaskGroup) executable; - return this.addDependency(dependency); - } - - /** - * Add a "post-run" dependent task item for this executable. - * - * @param dependent the "post-run" dependent task item. - * @return key to be used as parameter to taskResult(string) method to retrieve result of root - * task in the given dependent task group - */ - public String addPostRunDependent(FunctionalTaskItem dependent) { - Objects.requireNonNull(dependent); - return this.taskGroup().addPostRunDependent(dependent); - } - - /** - * Add a "post-run" dependent for this executable. - * - * @return key to be used as parameter to taskResult(string) method to retrieve result of root - * task in the dependent task group - */ - protected String addPostRunDependent(TaskGroup.HasTaskGroup dependent) { - Objects.requireNonNull(dependent); - this.taskGroup.addPostRunDependentTaskGroup(dependent.taskGroup()); - return dependent.taskGroup().key(); - } - - /** - * Add a creatable "post-run" dependent for this executable. - * - * @return the key to be used as parameter to taskResult(string) method to retrieve created "post-run" dependent - */ - @SuppressWarnings("unchecked") - protected String addPostRunDependent(Creatable creatable) { - TaskGroup.HasTaskGroup dependency = (TaskGroup.HasTaskGroup) creatable; - return this.addPostRunDependent(dependency); - } - - /** - * Add an appliable "post-run" dependent for this executable. - * - * @return the key to be used as parameter to taskResult(string) method to retrieve updated "post-run" dependent - */ - @SuppressWarnings("unchecked") - protected String addPostRunDependent(Appliable appliable) { - TaskGroup.HasTaskGroup dependency = (TaskGroup.HasTaskGroup) appliable; - return this.addPostRunDependent(dependency); - } - - /** - * Add an executable "post-run" dependent for this executable. - * - * @return the key to be used as parameter to taskResult(string) method to retrieve result of executing - * the executable "post-run" dependent - */ - @SuppressWarnings("unchecked") - protected String addPostRunDependent(Executable executable) { - TaskGroup.HasTaskGroup dependency = (TaskGroup.HasTaskGroup) executable; - return this.addPostRunDependent(dependency); - } - - /** - * Get result of one of the task that belongs to this task's task group. - * - * @param key the task key - * @param the actual type of the task result - * @return the task result, null will be returned if task has not produced a result yet - */ - @SuppressWarnings("unchecked") - protected T taskResult(String key) { - Indexable result = this.taskGroup.taskResult(key); - if (result == null) { - return null; - } else { - T castedResult = (T) result; - return castedResult; - } - } - - @Override - public void beforeGroupExecute() { - } - - @Override - public boolean isHot() { - return false; - } - - @Override - @SuppressWarnings("unchecked") - public Mono executeAsync() { - return taskGroup.invokeAsync() - .map(indexable -> (FluentModelT) indexable) - .onErrorMap(AggregatedManagementException::convertToManagementException); - } - - @Override - public FluentModelT execute() { - return executeAsync().block(); - } - - - @Override - public Mono afterPostRunAsync(boolean isGroupFaulted) { - return Mono.empty(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/implementation/ExecuteTask.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/implementation/ExecuteTask.java deleted file mode 100644 index 11caabe24e91..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/implementation/ExecuteTask.java +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.model.implementation; - -import com.azure.resourcemanager.resources.fluentcore.model.Indexable; -import com.azure.resourcemanager.resources.fluentcore.dag.TaskGroup; -import com.azure.resourcemanager.resources.fluentcore.dag.TaskItem; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** - * A {@link TaskItem} type, when invoked it execute a work using the {@link Executor} - * it composes. - * - * @param the type of the result that this task produces upon execution - */ -public class ExecuteTask implements TaskItem { - /** - * the underlying instance that can execute the task. - */ - private Executor executor; - /** - * result of execution. - */ - private ResultT result; - - /** - * Creates ExecuteTask. - * - * @param executor executor used by this TaskItem to execute the work when invoked. - */ - public ExecuteTask(Executor executor) { - this.executor = executor; - } - - @Override - public ResultT result() { - return this.result; - } - - @Override - public void beforeGroupInvoke() { - executor.beforeGroupExecute(); - } - - @Override - public boolean isHot() { - return executor.isHot(); - } - - @Override - public Mono invokeAsync(TaskGroup.InvocationContext context) { - return this.executor.executeWorkAsync() - .subscribeOn(ResourceManagerUtils.InternalRuntimeContext.getReactorScheduler()) - .doOnNext(resultT -> result = resultT) - .map(resourceT -> resourceT); - } - - @Override - public Mono invokeAfterPostRunAsync(boolean isGroupFaulted) { - return this.executor.afterPostRunAsync(isGroupFaulted); - } - - /** - * Represents a type that know how to execute a work that produces result of type {@link T}. - *

    - * An instance of {@link ExecuteTask} wraps this type and invokes appropriate methods when - * ExecuteTask methods get called during TaskGroup invocation. - * - * @param the type of the produced value. - */ - public interface Executor { - /** - * The method that gets called before invoking all the tasks in the {@link TaskGroup} - * that the parent {@link ExecuteTask} belongs to. - */ - void beforeGroupExecute(); - - /** - * @return true if the observable returned by {@link this#executeWorkAsync()} is hot, false if it is - * cold observable. - */ - boolean isHot(); - - /** - * Execute the work asynchronously. - * - * @return the {@link Mono} reference - */ - Mono executeWorkAsync(); - - /** - * Perform any action followed by the processing of work scheduled to be invoked - * (i.e. "post run") after {@link this#executeWorkAsync()}. - * - * @param isGroupFaulted true if one or more tasks in the group this work belongs - * to are in faulted state. - * @return a {@link Flux} represents the asynchronous action - */ - Mono afterPostRunAsync(boolean isGroupFaulted); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/implementation/IndexableImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/implementation/IndexableImpl.java deleted file mode 100644 index 549d4377f5d3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/implementation/IndexableImpl.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.model.implementation; - -import com.azure.resourcemanager.resources.fluentcore.model.Indexable; - -import java.util.UUID; - -/** - * The base implementation for {@link Indexable}. - */ -abstract class IndexableImpl implements Indexable { - - protected String key; - - protected IndexableImpl() { - this(UUID.randomUUID().toString()); - } - - protected IndexableImpl(String key) { - this.key = key; - } - - @Override - public String key() { - return this.key; - } - - @Override - public String toString() { - return this.key(); - } -} - - diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/implementation/IndexableRefreshableImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/implementation/IndexableRefreshableImpl.java deleted file mode 100644 index e354c3dc21f6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/implementation/IndexableRefreshableImpl.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.model.implementation; - -import com.azure.resourcemanager.resources.fluentcore.model.Indexable; -import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; - -/** - * The implementation for {@link Indexable} and {@link Refreshable}. - * - * @param the fluent type of the resource - */ -public abstract class IndexableRefreshableImpl - extends IndexableImpl - implements Refreshable { - - protected IndexableRefreshableImpl() { - } - - protected IndexableRefreshableImpl(String key) { - super(key); - } - - @Override - public abstract T refresh(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/implementation/IndexableRefreshableWrapperImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/implementation/IndexableRefreshableWrapperImpl.java deleted file mode 100644 index 3dd9f33e08a4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/implementation/IndexableRefreshableWrapperImpl.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.model.implementation; - -import com.azure.resourcemanager.resources.fluentcore.model.Indexable; -import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import reactor.core.publisher.Mono; - -/** - * The implementation for {@link Indexable}, {@link Refreshable}, and {@link HasInnerModel}. - * - * @param The fluent model type - * @param Azure inner resource class type - */ -public abstract class IndexableRefreshableWrapperImpl - extends IndexableRefreshableImpl - implements HasInnerModel { - - private InnerModelT innerObject; - - protected IndexableRefreshableWrapperImpl(InnerModelT innerObject) { - this.setInner(innerObject); - } - - protected IndexableRefreshableWrapperImpl(String key, InnerModelT innerObject) { - super(key); - this.setInner(innerObject); - } - - @Override - public InnerModelT innerModel() { - return this.innerObject; - } - - /** - * Set the wrapped inner model. - * (For internal use only) - * - * @param inner the new inner model - */ - public void setInner(InnerModelT inner) { - this.innerObject = inner; - } - - @Override - public final FluentModelT refresh() { - return refreshAsync().block(); - } - - @Override - @SuppressWarnings("unchecked") - public Mono refreshAsync() { - final IndexableRefreshableWrapperImpl self = this; - return getInnerAsync().map(t -> { - self.setInner(t); - return (FluentModelT) self; - }); - } - - protected abstract Mono getInnerAsync(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/implementation/IndexableWrapperImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/implementation/IndexableWrapperImpl.java deleted file mode 100644 index 6929e1b8d81c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/implementation/IndexableWrapperImpl.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.model.implementation; - -import com.azure.resourcemanager.resources.fluentcore.model.Indexable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; - -/** - * The implementation for {@link Indexable} and {@link HasInnerModel}. - * - * @param wrapped type - */ -public abstract class IndexableWrapperImpl - extends IndexableImpl - implements HasInnerModel { - private InnerT innerObject; - - protected IndexableWrapperImpl(InnerT innerObject) { - super(); - this.innerObject = innerObject; - } - - @Override - public InnerT innerModel() { - return this.innerObject; - } - - /** - * Sets the inner object of the wrapper. - *

    - * (Internal use only) - * - * @param innerObject an inner object - */ - public void setInner(InnerT innerObject) { - this.innerObject = innerObject; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/implementation/RefreshableWrapperImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/implementation/RefreshableWrapperImpl.java deleted file mode 100644 index 0e20a9721b5e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/implementation/RefreshableWrapperImpl.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.model.implementation; - -import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; -import reactor.core.publisher.Mono; - -/** - * Base implementation for Wrapper interface. - * - * @param wrapped type - * @param impl type - */ -public abstract class RefreshableWrapperImpl - extends WrapperImpl - implements Refreshable { - - protected RefreshableWrapperImpl(InnerT innerObject) { - super(innerObject); - } - - @Override - public final Impl refresh() { - return this.refreshAsync().block(); - } - - @Override - @SuppressWarnings("unchecked") - public Mono refreshAsync() { - final RefreshableWrapperImpl self = this; - - return this.getInnerAsync() - .map(innerT -> { - self.setInner(innerT); - return (Impl) self; - }); - } - - protected abstract Mono getInnerAsync(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/implementation/WrapperImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/implementation/WrapperImpl.java deleted file mode 100644 index dd50ccbdb0e6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/implementation/WrapperImpl.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.model.implementation; - -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; - -/** - * Base implementation for Wrapper interface. - * - * @param wrapped type - */ -public abstract class WrapperImpl implements HasInnerModel { - private InnerT innerObject; - - protected WrapperImpl(InnerT innerObject) { - this.innerObject = innerObject; - } - - @Override - public InnerT innerModel() { - return this.innerObject; - } - - /** - * Sets the inner object of the wrapper. - *

    - * (Internal use only) - * - * @param inner an inner object - */ - public void setInner(InnerT inner) { - this.innerObject = inner; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/implementation/package-info.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/implementation/package-info.java deleted file mode 100644 index 448fd49455c8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/implementation/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. - -/** - * This package contains the base implementation classes for resource models, and their - * variants for creating and updating scenarios. - */ -package com.azure.resourcemanager.resources.fluentcore.model.implementation; diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/package-info.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/package-info.java deleted file mode 100644 index 79566934c211..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. - -/** - * This package contains the base classes for resource models, and their - * variants for creating and updating scenarios. - */ -package com.azure.resourcemanager.resources.fluentcore.model; diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/package-info.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/package-info.java deleted file mode 100644 index 14e02d949594..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -/** - * This package contains the base classes for management sdk. - */ -package com.azure.resourcemanager.resources.fluentcore; diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/policy/AuthenticationPolicy.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/policy/AuthenticationPolicy.java deleted file mode 100644 index fade979209d5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/policy/AuthenticationPolicy.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.policy; - -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpPipelineCallContext; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; -import com.azure.core.util.CoreUtils; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; - -/** - * Rewrite the BearerTokenAuthenticationPolicy, it will use default scope when scopes parameter is empty. - */ -public class AuthenticationPolicy extends ArmChallengeAuthenticationPolicy { - - private final AzureEnvironment environment; - - /** - * Creates AuthenticationPolicy. - * - * @param credential the token credential to authenticate the request - * @param environment the environment with endpoints for authentication - * @param scopes the scopes used in credential, using default scopes when empty - */ - public AuthenticationPolicy(TokenCredential credential, AzureEnvironment environment, String... scopes) { - super(credential, scopes); - this.environment = environment; - } - - @Override - public String[] getScopes(HttpPipelineCallContext context, String[] scopes) { - if (CoreUtils.isNullOrEmpty(scopes)) { - scopes = new String[1]; - scopes[0] = ResourceManagerUtils.getDefaultScopeFromRequest(context.getHttpRequest(), environment); - } - return scopes; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/policy/AuxiliaryAuthenticationPolicy.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/policy/AuxiliaryAuthenticationPolicy.java deleted file mode 100644 index 9d47c14855fc..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/policy/AuxiliaryAuthenticationPolicy.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.policy; - -import com.azure.core.credential.TokenCredential; -import com.azure.core.credential.TokenRequestContext; -import com.azure.core.http.HttpPipelineCallContext; -import com.azure.core.http.HttpPipelineNextPolicy; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.management.AzureEnvironment; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -import java.util.Arrays; - -/** - * A Http Pipeline Policy for cross-tenant authorization in Azure. - */ -public class AuxiliaryAuthenticationPolicy implements HttpPipelinePolicy { - - private static final String AUTHORIZATION_AUXILIARY_HEADER = "x-ms-authorization-auxiliary"; - private static final String SCHEMA_FORMAT = "Bearer %s"; - - private final TokenCredential[] tokenCredentials; - private final AzureEnvironment environment; - - /** - * Initialize an auxiliary authentication policy with the list of AzureTokenCredentials. - * - * @param environment the Azure environment - * @param credentials the AzureTokenCredentials list - */ - public AuxiliaryAuthenticationPolicy(AzureEnvironment environment, TokenCredential... credentials) { - this.environment = environment; - this.tokenCredentials = credentials; - } - - @Override - public Mono process(HttpPipelineCallContext context, HttpPipelineNextPolicy next) { - if (tokenCredentials == null || tokenCredentials.length == 0) { - return next.process(); - } - return Flux.fromIterable(Arrays.asList(tokenCredentials)) - .flatMap(credential -> { - String defaultScope = ResourceManagerUtils.getDefaultScopeFromRequest( - context.getHttpRequest(), environment); - return credential.getToken(new TokenRequestContext().addScopes(defaultScope)) - .map(token -> String.format(SCHEMA_FORMAT, token.getToken())); - }) - .collectList() - .flatMap(tokenList -> { - context.getHttpRequest() - .setHeader(AUTHORIZATION_AUXILIARY_HEADER, String.join(",", tokenList)); - return next.process(); - }); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/policy/ProviderRegistrationPolicy.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/policy/ProviderRegistrationPolicy.java deleted file mode 100644 index 160b9946406b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/policy/ProviderRegistrationPolicy.java +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.policy; - -import com.azure.core.http.HttpPipelineCallContext; -import com.azure.core.http.HttpPipelineNextPolicy; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.management.exception.ManagementError; -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.serializer.SerializerAdapter; -import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.resourcemanager.resources.ResourceManager; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import com.azure.resourcemanager.resources.models.Provider; -import com.azure.resourcemanager.resources.models.Providers; -import reactor.core.publisher.Mono; -import reactor.util.retry.Retry; - -import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.time.Duration; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -/** - * A Http Pipeline Policy for automatic provider registration in Azure. - */ -public class ProviderRegistrationPolicy implements HttpPipelinePolicy { - private static final String MISSING_SUBSCRIPTION_REGISTRATION = "MissingSubscriptionRegistration"; - private Providers providers; - - /** - * Initialize a provider registration policy to automatically register the provider. - */ - public ProviderRegistrationPolicy() { - } - - /** - * Initialize a provider registration policy to automatically register the provider. - * @param resourceManager the Resource Manager that provider providers endpoint - */ - public ProviderRegistrationPolicy(ResourceManager resourceManager) { - providers = resourceManager.providers(); - } - - /** - * Initialize a provider registration policy to automatically register the provider. - * @param providers the providers endpoint - */ - public ProviderRegistrationPolicy(Providers providers) { - this.providers = providers; - } - - /** - * Sets the providers endpoint after initialized - * @param providers the providers endpoint - */ - public void setProviders(Providers providers) { - this.providers = providers; - } - - /** - * @return the providers endpoint contained in policy - */ - public Providers getProviders() { - return providers; - } - - private boolean isResponseSuccessful(HttpResponse response) { - return response.getStatusCode() >= 200 && response.getStatusCode() < 300; - } - - @Override - public Mono process(HttpPipelineCallContext context, HttpPipelineNextPolicy next) { - if (providers == null) { - return next.process(); - } - return next.process().flatMap( - response -> { - if (!isResponseSuccessful(response)) { - HttpResponse bufferedResponse = response.buffer(); - return FluxUtil.collectBytesInByteBufferStream(bufferedResponse.getBody()).flatMap( - body -> { - String bodyStr = new String(body, StandardCharsets.UTF_8); - - SerializerAdapter jacksonAdapter = - SerializerFactory.createDefaultManagementSerializerAdapter(); - ManagementError cloudError; - try { - cloudError = jacksonAdapter.deserialize( - bodyStr, ManagementError.class, SerializerEncoding.JSON); - } catch (IOException e) { - return Mono.just(bufferedResponse); - } - - if (cloudError != null && MISSING_SUBSCRIPTION_REGISTRATION.equals(cloudError.getCode())) { - Pattern providerPattern = Pattern.compile(".*'(.*)'"); - Matcher providerMatcher = providerPattern.matcher(cloudError.getMessage()); - if (!providerMatcher.find()) { - return Mono.just(bufferedResponse); - } - - // Retry after registration - return registerProviderUntilSuccess(providerMatcher.group(1)) - .flatMap(afterRegistered -> next.process()); - } - return Mono.just(bufferedResponse); - } - ); - } - return Mono.just(response); - } - ); - } - - private Mono registerProviderUntilSuccess(String namespace) { - return providers.registerAsync(namespace) - .flatMap( - provider -> { - if (isProviderRegistered(provider)) { - return Mono.empty(); - } - return providers.getByNameAsync(namespace) - .flatMap(this::checkProviderRegistered) - .retryWhen(Retry.max(60).filter(ProviderUnregisteredException.class::isInstance)); - } - ); - } - - private Mono checkProviderRegistered(Provider provider) throws ProviderUnregisteredException { - if (isProviderRegistered(provider)) { - return Mono.empty(); - } - ResourceManagerUtils.sleep(Duration.ofSeconds(5)); - return Mono.error(new ProviderUnregisteredException()); - } - - private boolean isProviderRegistered(Provider provider) { - return provider.registrationState().equalsIgnoreCase("Registered"); - } - - private static class ProviderUnregisteredException extends RuntimeException { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/policy/ResourceManagerThrottlingPolicy.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/policy/ResourceManagerThrottlingPolicy.java deleted file mode 100644 index dabfe7530bf4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/policy/ResourceManagerThrottlingPolicy.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.policy; - -import com.azure.core.http.HttpPipelineCallContext; -import com.azure.core.http.HttpPipelineNextPolicy; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerThrottlingInfo; -import reactor.core.publisher.Mono; - -import java.util.function.BiConsumer; - -/** - * A Http Pipeline Policy for automatic send throttling rate limit info to a call back function - */ -public class ResourceManagerThrottlingPolicy implements HttpPipelinePolicy { - private final BiConsumer callback; - - /** - * Creates the resource manager throttling policy - * @param callback consume the ResourceManagerThrottlingInfo for every request, it is not a thread-safe method - */ - public ResourceManagerThrottlingPolicy( - BiConsumer callback) { - this.callback = callback; - } - - @Override - public Mono process(HttpPipelineCallContext context, HttpPipelineNextPolicy next) { - return next.clone().process() - .flatMap(response -> { - HttpResponse bufferedResponse = response.buffer(); - callback.accept(bufferedResponse, ResourceManagerThrottlingInfo.fromHeaders(response.getHeaders())); - return Mono.just(bufferedResponse); - }); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/policy/ReturnRequestIdHeaderPolicy.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/policy/ReturnRequestIdHeaderPolicy.java deleted file mode 100644 index e62631ef01b3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/policy/ReturnRequestIdHeaderPolicy.java +++ /dev/null @@ -1,138 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.policy; - -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpPipelineCallContext; -import com.azure.core.http.HttpPipelineNextPolicy; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.http.policy.RequestIdPolicy; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -import java.nio.ByteBuffer; -import java.nio.charset.Charset; - -/** - * An interceptor for requesting server return client-request-id in response headers. - * Optionally, fill-in the client-request-id, if server does not return it in response headers. - *

    - * ReturnRequestIdHeaderInterceptor should be added after {@link RequestIdPolicy}. - * - * @see RequestIdPolicy - */ -public class ReturnRequestIdHeaderPolicy implements HttpPipelinePolicy { - - private static final String NAME_RETURN_CLIENT_REQUEST_ID = "x-ms-return-client-request-id"; - private static final String NAME_CLIENT_REQUEST_ID = "x-ms-client-request-id"; - - private final Option option; - - /** - * Additional client handling, if server does not return client-request-id in response headers. - */ - public enum Option { - /** - * Default. - */ - NONE, - - /** - * Fill-in the client-request-id from request headers. - */ - COPY_CLIENT_REQUEST_ID - } - - /** - * Creates a new instance of ReturnRequestIdHeaderPolicy. - * Sets "x-ms-return-client-request-id: true" in requests headers. - */ - public ReturnRequestIdHeaderPolicy() { - this(Option.NONE); - } - - /** - * Creates a new instance of ReturnRequestIdHeaderPolicy. - * Sets "x-ms-return-client-request-id: true" in requests headers. - *

    - * Optionally fill-in the client-request-id if server does not return it in response headers. - * - * @param option the option of additional client handling, - * if server does not return client-request-id in response headers. - */ - public ReturnRequestIdHeaderPolicy(Option option) { - this.option = option; - } - - @Override - public Mono process(HttpPipelineCallContext context, HttpPipelineNextPolicy next) { - final HttpRequest request = context.getHttpRequest(); - final String clientRequestId = request.getHeaders().getValue(NAME_CLIENT_REQUEST_ID); - - if (request.getHeaders().getValue(NAME_RETURN_CLIENT_REQUEST_ID) == null) { - request.getHeaders().set(NAME_RETURN_CLIENT_REQUEST_ID, "true"); - } - - Mono responseMono = next.process(); - if (option == Option.COPY_CLIENT_REQUEST_ID && clientRequestId != null) { - responseMono = responseMono.map(response -> { - if (response.getHeaderValue(NAME_CLIENT_REQUEST_ID) == null) { - response = new BufferedHttpHeaderResponse(response); - response.getHeaders().set(NAME_CLIENT_REQUEST_ID, clientRequestId); - } - return response; - }); - } - return responseMono; - } - - private static class BufferedHttpHeaderResponse extends HttpResponse { - - private final HttpResponse innerHttpResponse; - private final HttpHeaders cachedHeaders; - - BufferedHttpHeaderResponse(HttpResponse innerHttpResponse) { - super(innerHttpResponse.getRequest()); - this.innerHttpResponse = innerHttpResponse; - this.cachedHeaders = new HttpHeaders(innerHttpResponse.getHeaders()); - } - - @Override - public int getStatusCode() { - return innerHttpResponse.getStatusCode(); - } - - @Override - public String getHeaderValue(String name) { - return cachedHeaders.getValue(name); - } - - @Override - public HttpHeaders getHeaders() { - return cachedHeaders; - } - - @Override - public Flux getBody() { - return innerHttpResponse.getBody(); - } - - @Override - public Mono getBodyAsByteArray() { - return innerHttpResponse.getBodyAsByteArray(); - } - - @Override - public Mono getBodyAsString() { - return innerHttpResponse.getBodyAsString(); - } - - @Override - public Mono getBodyAsString(Charset charset) { - return innerHttpResponse.getBodyAsString(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/policy/UserAgentPolicy.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/policy/UserAgentPolicy.java deleted file mode 100644 index 440da636b175..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/policy/UserAgentPolicy.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.policy; - -import com.azure.core.http.HttpPipelineCallContext; -import com.azure.core.http.HttpPipelineNextPolicy; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.policy.HttpLogOptions; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.util.Configuration; -import com.azure.core.util.CoreUtils; -import com.azure.core.util.UserAgentUtil; -import reactor.core.publisher.Mono; - -/** - * Rewrite the UserAgentPolicy, it will use Sdk-Name and Sdk-Version to build default user-agent. - */ -public class UserAgentPolicy implements HttpPipelinePolicy { - private static final String USER_AGENT_KEY = "User-Agent"; - private static final String SDK_NAME_KEY = "Sdk-Name"; - private static final String SDK_VERSION_KEY = "Sdk-Version"; - private static final String APPLICATION_ID_KEY = "Application-Id"; - - private final String defaultSdkName = this.getClass().getPackage().getName(); - private final String defaultSdkVersion = this.getClass().getPackage().getSpecificationVersion(); - - private final HttpLogOptions httpLogOptions; - private final Configuration configuration; - - /** - * @param httpLogOptions used for get application id - * @param configuration used for check telemetry enable or not - */ - public UserAgentPolicy(HttpLogOptions httpLogOptions, Configuration configuration) { - if (httpLogOptions == null) { - this.httpLogOptions = new HttpLogOptions(); - } else { - this.httpLogOptions = httpLogOptions; - } - - if (configuration == null) { - this.configuration = Configuration.getGlobalConfiguration(); - } else { - this.configuration = configuration; - } - } - - @Override - public Mono process(HttpPipelineCallContext context, HttpPipelineNextPolicy next) { - String userAgent = context.getHttpRequest().getHeaders().getValue(USER_AGENT_KEY); - if (!CoreUtils.isNullOrEmpty(userAgent)) { - return next.process(); - } - - userAgent = context.getData(USER_AGENT_KEY).orElse("").toString(); - if (!CoreUtils.isNullOrEmpty(userAgent)) { - context.getHttpRequest().setHeader(USER_AGENT_KEY, userAgent); - return next.process(); - } - - String sdkName = context.getData(SDK_NAME_KEY).orElse("").toString(); - if (CoreUtils.isNullOrEmpty(sdkName)) { - sdkName = defaultSdkName; - } - - String sdkVersion = context.getData(SDK_VERSION_KEY).orElse("").toString(); - if (CoreUtils.isNullOrEmpty(sdkVersion)) { - sdkVersion = defaultSdkVersion; - } - - String applicationId = context.getData(APPLICATION_ID_KEY).orElse("").toString(); - if (CoreUtils.isNullOrEmpty(applicationId)) { - applicationId = httpLogOptions.getApplicationId(); - } - - context.getHttpRequest().setHeader(USER_AGENT_KEY, - UserAgentUtil.toUserAgentString(applicationId, sdkName, sdkVersion, configuration)); - return next.process(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/policy/package-info.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/policy/package-info.java deleted file mode 100644 index 37cd3c5b5329..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/policy/package-info.java +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. - -/** - * This package contains the base classes for resources http policy. - */ -package com.azure.resourcemanager.resources.fluentcore.policy; diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/rest/ActivationResponse.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/rest/ActivationResponse.java deleted file mode 100644 index 9abd366f849e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/rest/ActivationResponse.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.rest; - -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.polling.LongRunningOperationStatus; - -import java.time.Duration; - -/** - * REST LRO activation response with a strongly-typed content specified. - * - * @param The deserialized type of the response content. - */ -public class ActivationResponse extends SimpleResponse { - - private final LongRunningOperationStatus status; - private final Duration retryAfter; - - /** - * Creates a {@link ActivationResponse}. - * - * @param request The request which resulted in this response. - * @param statusCode The status code of the HTTP response. - * @param headers The headers of the HTTP response. - * @param value The deserialized value of the HTTP response. - * @param status Mandatory operation status as defined in {@link LongRunningOperationStatus}. - * @param retryAfter Represents the delay the service has requested until the next polling operation is performed. A - * {@code null}, zero or negative value will be taken to mean that the poller should determine on its - * own when the next poll operation is to occur. - */ - public ActivationResponse(HttpRequest request, int statusCode, HttpHeaders headers, T value, - LongRunningOperationStatus status, Duration retryAfter) { - super(request, statusCode, headers, value); - this.status = status; - this.retryAfter = retryAfter; - } - - /** - * Represents the status of the long-running operation at the time the last polling operation finished successfully. - * @return A {@link LongRunningOperationStatus} representing the result of the poll operation. - */ - public LongRunningOperationStatus getStatus() { - return status; - } - - /** - * Returns the delay the service has requested until the next polling operation is performed. A null or negative - * value will be taken to mean that the poller should determine on its own when the next poll operation is - * to occur. - * @return Duration How long to wait before next retry. - */ - public Duration getRetryAfter() { - return retryAfter; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/rest/package-info.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/rest/package-info.java deleted file mode 100644 index 5c2f1c6697f3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/rest/package-info.java +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. - -/** - * This package contains the base classes for resources azure http rest. - */ -package com.azure.resourcemanager.resources.fluentcore.rest; diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/utils/ETagState.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/utils/ETagState.java deleted file mode 100644 index cbaa4db35929..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/utils/ETagState.java +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.utils; - -/** - * Utility class for ETag state handling. - */ -public class ETagState { - private boolean doImplicitETagCheckOnCreate; - private boolean doImplicitETagCheckOnUpdate; - private String eTagOnUpdate; - private String eTagOnDelete; - - /** - * Specifies if it is in create or update with implicit ETag check. - * @param isInCreateMode The boolean flag to indicate if it is in create mode. - * @return the ETag state. - */ - public ETagState withImplicitETagCheckOnCreateOrUpdate(boolean isInCreateMode) { - if (isInCreateMode) { - this.doImplicitETagCheckOnCreate = true; - } else { - this.doImplicitETagCheckOnUpdate = true; - } - return this; - } - - /** - * Specifies the explicit ETag value on update. - * @param eTagValue The explicit ETag value. - * @return the ETag state. - */ - public ETagState withExplicitETagCheckOnUpdate(String eTagValue) { - this.eTagOnUpdate = eTagValue; - return this; - } - - /** - * Specifies the explicit ETag value on delete. - * @param eTagValue The explicit ETag value. - * @return the ETag state. - */ - public ETagState withExplicitETagCheckOnDelete(String eTagValue) { - this.eTagOnDelete = eTagValue; - return this; - } - - - /** - * Clears the stored values in ETag state - * @return the ETag state. - */ - public ETagState clear() { - this.doImplicitETagCheckOnCreate = false; - this.doImplicitETagCheckOnUpdate = false; - this.eTagOnUpdate = null; - this.eTagOnDelete = null; - return this; - } - - /** - * Specifies the ETag value for If-Match header on update. - * @param currentETagValue The current ETag value. - * @return the ETag value. - */ - public String ifMatchValueOnUpdate(String currentETagValue) { - String eTagValue = null; - if (this.doImplicitETagCheckOnUpdate) { - eTagValue = currentETagValue; - } - if (this.eTagOnUpdate != null) { - eTagValue = this.eTagOnUpdate; - } - return eTagValue; - } - - /** - * Specifies the ETag value for If-Match header on delete. - * @return the ETag value. - */ - public String ifMatchValueOnDelete() { - return this.eTagOnDelete; - } - - /** - * Specifies the ETag value for If-None-Match header on create. - * @return the ETag value. - */ - public String ifNonMatchValueOnCreate() { - if (this.doImplicitETagCheckOnCreate) { - return "*"; - } - return null; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/utils/HttpPipelineProvider.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/utils/HttpPipelineProvider.java deleted file mode 100644 index abe4afb623c9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/utils/HttpPipelineProvider.java +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.utils; - -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.AddHeadersFromContextPolicy; -import com.azure.core.http.policy.HttpLogDetailLevel; -import com.azure.core.http.policy.HttpLogOptions; -import com.azure.core.http.policy.HttpLoggingPolicy; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.http.policy.HttpPolicyProviders; -import com.azure.core.http.policy.RequestIdPolicy; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.util.Configuration; -import com.azure.resourcemanager.resources.fluentcore.policy.AuthenticationPolicy; -import com.azure.resourcemanager.resources.fluentcore.policy.ProviderRegistrationPolicy; -import com.azure.resourcemanager.resources.fluentcore.policy.ReturnRequestIdHeaderPolicy; -import com.azure.resourcemanager.resources.fluentcore.policy.UserAgentPolicy; - -import java.time.temporal.ChronoUnit; -import java.util.ArrayList; -import java.util.List; - -/** - * This class provides common patterns on building {@link HttpPipeline}. - */ -public final class HttpPipelineProvider { - - private HttpPipelineProvider() { - } - - /** - * Creates http pipeline with token credential and profile - * - * @param credential the token credential - * @param profile the profile - * @return the http pipeline - */ - public static HttpPipeline buildHttpPipeline(TokenCredential credential, AzureProfile profile) { - return buildHttpPipeline(credential, profile, null, new HttpLogOptions().setLogLevel(HttpLogDetailLevel.NONE), - null, new RetryPolicy("Retry-After", ChronoUnit.SECONDS), null, null); - } - - /** - * Creates http pipeline with token credential and profile - * - * @param credential the token credential - * @param profile the profile - * @param scopes the credential scopes - * @param httpLogOptions the http log options - * @param configuration the configuration value - * @param retryPolicy the retry policy - * @param additionalPolicies the additional policies - * @param httpClient the http client - * @return the http pipeline - */ - public static HttpPipeline buildHttpPipeline( - TokenCredential credential, AzureProfile profile, String[] scopes, HttpLogOptions httpLogOptions, - Configuration configuration, RetryPolicy retryPolicy, List additionalPolicies, - HttpClient httpClient) { - List policies = new ArrayList<>(); - policies.add(new UserAgentPolicy(httpLogOptions, configuration)); - policies.add(new AddHeadersFromContextPolicy()); - policies.add(new RequestIdPolicy()); - policies.add(new ReturnRequestIdHeaderPolicy(ReturnRequestIdHeaderPolicy.Option.COPY_CLIENT_REQUEST_ID)); - HttpPolicyProviders.addBeforeRetryPolicies(policies); - policies.add(retryPolicy); - policies.add(new AddDatePolicy()); - if (credential != null) { - policies.add(new AuthenticationPolicy(credential, profile.getEnvironment(), scopes)); - } - policies.add(new ProviderRegistrationPolicy()); - if (additionalPolicies != null && !additionalPolicies.isEmpty()) { - policies.addAll(additionalPolicies); - } - HttpPolicyProviders.addAfterRetryPolicies(policies); - policies.add(new HttpLoggingPolicy(httpLogOptions)); - return new HttpPipelineBuilder() - .policies(policies.toArray(new HttpPipelinePolicy[0])) - .httpClient(httpClient) - .build(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/utils/PagedConverter.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/utils/PagedConverter.java deleted file mode 100644 index 826a17342247..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/utils/PagedConverter.java +++ /dev/null @@ -1,294 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.utils; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.util.paging.PageRetriever; -import org.reactivestreams.Publisher; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -import java.util.Iterator; -import java.util.List; -import java.util.function.Function; -import java.util.function.Supplier; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -/** - * Utility class for conversion of PagedResponse. - */ -public final class PagedConverter { - - private PagedConverter() { - } - - /** - * Applies map transform to elements of PagedIterable. - * - * @param pageIterable the input of PagedIterable. - * @param mapper the map transform of element T to element S. - * @param input type of PagedFlux. - * @param return type of PagedFlux. - * @return the PagedFlux with elements in PagedResponse transformed. - */ - public static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { - return new PagedIterableImpl(pageIterable, mapper); - } - - /** - * Applies map transform to elements of PagedFlux. - * - * @param pagedFlux the input of PagedFlux. - * @param mapper the map transform of element T to element S. - * @param input type of PagedFlux. - * @param return type of PagedFlux. - * @return the PagedFlux with elements in PagedResponse transformed. - */ - public static PagedFlux mapPage(PagedFlux pagedFlux, Function mapper) { - Supplier>> provider = () -> (continuationToken, pageSize) -> { - Flux> flux = (continuationToken == null) - ? pagedFlux.byPage().take(1) - : pagedFlux.byPage(continuationToken).take(1); - return flux.map(mapPagedResponse(mapper)); - }; - return PagedFlux.create(provider); - } - - /** - * Applies flatMap transform to elements of PagedFlux. - * - * @param pagedFlux the input of PagedFlux. - * @param mapper the flatMap transform of element T to Publisher of S. - * @param input type of PagedFlux. - * @param return type of PagedFlux. - * @return the PagedFlux with elements in PagedResponse transformed. - */ - public static PagedFlux flatMapPage(PagedFlux pagedFlux, - Function> mapper) { - Supplier>> provider = () -> (continuationToken, pageSize) -> { - // retrieve single page - Flux> flux = (continuationToken == null) - ? pagedFlux.byPage().take(1) - : pagedFlux.byPage(continuationToken).take(1); - return flux.concatMap(PagedConverter.flatMapPagedResponse(mapper)); - }; - return PagedFlux.create(provider); - } - - /** - * Merge collection of all PagedFlux transformed from elements of PagedFlux to a single PagedFlux. - * - * @param pagedFlux the input of PagedFlux. - * @param transformer the transform of element T to PagedFlux of S. - * @param input type of PagedFlux. - * @param return type of PagedFlux. - * @return the merged PagedFlux. - */ - public static PagedFlux mergePagedFlux(PagedFlux pagedFlux, - Function> transformer) { - // one possible issue is that when inner PagedFlux ends, that PagedResponse will have continuationToken == null - - Supplier>> provider = () -> (continuationToken, pageSize) -> { - // here retrieve all pages, as the continuationToken in mergePagedFluxPagedResponse would confuse this outer paging - Flux> flux = (continuationToken == null) - ? pagedFlux.byPage() - : pagedFlux.byPage(continuationToken); - return flux.concatMap(PagedConverter.mergePagedFluxPagedResponse(transformer)); - }; - return PagedFlux.create(provider); - } - - private static Function, PagedResponse> mapPagedResponse(Function mapper) { - return pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), - pagedResponse.getStatusCode(), - pagedResponse.getHeaders(), - pagedResponse.getValue().stream().map(mapper).collect(Collectors.toList()), - pagedResponse.getContinuationToken(), - null); - } - - /** - * Applies flatMap transform to elements of PagedResponse. - * - * @param mapper the flatMap transform of element T to Publisher of S. - * @param input type of pagedFlux. - * @param return type of pagedFlux. - * @return the lifted transform on PagedResponse. - */ - private static Function, Mono>> flatMapPagedResponse( - Function> mapper) { - return pagedResponse -> - Flux.fromIterable(pagedResponse.getValue()) - .flatMapSequential(mapper) - .collectList() - .map(values -> new PagedResponseBase(pagedResponse.getRequest(), - pagedResponse.getStatusCode(), - pagedResponse.getHeaders(), - values, - pagedResponse.getContinuationToken(), - null)); - } - - /** - * Applies transform of element to PagedFlux, to elements of PagedResponse. Then merge all these PagedFlux. - * - * @param transformer the transform of element T to PagedFlux of S. - * @param input type of pagedFlux. - * @param return type of pagedFlux. - * @return the the merged PagedFlux. - */ - private static Function, Flux>> mergePagedFluxPagedResponse( - Function> transformer) { - return pagedResponse -> { - List>> fluxList = pagedResponse.getValue().stream() - .map(item -> transformer.apply(item).byPage()).collect(Collectors.toList()); - return Flux.concat(fluxList) - .filter(p -> !p.getValue().isEmpty()); - }; - } - - /** - * Converts Response of List to PagedFlux. - * - * @param type of element. - * @param responseMono the Response of List to convert. - * @return the PagedFlux. - */ - public static PagedFlux convertListToPagedFlux(Mono>> responseMono) { - return new PagedFlux<>(() -> responseMono.map(response -> new PagedResponseBase( - response.getRequest(), - response.getStatusCode(), - response.getHeaders(), - response.getValue(), - null, - null - ))); - } - - private static final class PagedIterableImpl extends PagedIterable { - - private final PagedIterable pagedIterable; - private final Function mapper; - private final Function, PagedResponse> pageMapper; - - private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { - super(PagedFlux.create(() -> (continuationToken, pageSize) - -> Flux.fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); - this.pagedIterable = pagedIterable; - this.mapper = mapper; - this.pageMapper = getPageMapper(mapper); - } - - private static Function, PagedResponse> getPageMapper(Function mapper) { - return page -> new PagedResponseBase( - page.getRequest(), - page.getStatusCode(), - page.getHeaders(), - page.getElements().stream().map(mapper).collect(Collectors.toList()), - page.getContinuationToken(), - null); - } - - @Override - public Stream stream() { - return pagedIterable.stream().map(mapper); - } - - @Override - public Stream> streamByPage() { - return pagedIterable.streamByPage().map(pageMapper); - } - - @Override - public Stream> streamByPage(String continuationToken) { - return pagedIterable.streamByPage(continuationToken).map(pageMapper); - } - - @Override - public Stream> streamByPage(int preferredPageSize) { - return pagedIterable.streamByPage(preferredPageSize).map(pageMapper); - } - - @Override - public Stream> streamByPage(String continuationToken, int preferredPageSize) { - return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); - } - - @Override - public Iterator iterator() { - return new IteratorImpl(pagedIterable.iterator(), mapper); - } - - @Override - public Iterable> iterableByPage() { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(), pageMapper); - } - - @Override - public Iterable> iterableByPage(String continuationToken) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(continuationToken), pageMapper); - } - - @Override - public Iterable> iterableByPage(int preferredPageSize) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(preferredPageSize), pageMapper); - } - - @Override - public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); - } - } - - private static final class IteratorImpl implements Iterator { - - private final Iterator iterator; - private final Function mapper; - - private IteratorImpl(Iterator iterator, Function mapper) { - this.iterator = iterator; - this.mapper = mapper; - } - - @Override - public boolean hasNext() { - return iterator.hasNext(); - } - - @Override - public S next() { - return mapper.apply(iterator.next()); - } - - @Override - public void remove() { - iterator.remove(); - } - } - - private static final class IterableImpl implements Iterable { - - private final Iterable iterable; - private final Function mapper; - - private IterableImpl(Iterable iterable, Function mapper) { - this.iterable = iterable; - this.mapper = mapper; - } - - @Override - public Iterator iterator() { - return new IteratorImpl(iterable.iterator(), mapper); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/utils/ResourceDelayProvider.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/utils/ResourceDelayProvider.java deleted file mode 100644 index 474ab32b07c3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/utils/ResourceDelayProvider.java +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.resources.fluentcore.utils; - -import com.azure.core.management.provider.DelayProvider; - -import java.time.Duration; - -/** - * The ResourceDelayProvider to help thread sleep. - */ -public class ResourceDelayProvider implements DelayProvider { - @Override - public Duration getDelayDuration(Duration delay) { - return delay; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/utils/ResourceManagerThrottlingInfo.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/utils/ResourceManagerThrottlingInfo.java deleted file mode 100644 index 9d00d681ca5c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/utils/ResourceManagerThrottlingInfo.java +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.utils; - -import com.azure.core.http.HttpHeaders; - -import java.util.Arrays; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -/** - * The class to collect all throttling info from response header. - * Some service has different rate limit but not visible in response header, like network/storage. - */ -public class ResourceManagerThrottlingInfo { - // refer https://docs.microsoft.com/azure/azure-resource-manager/management/request-limits-and-throttling - private static final List COMMON_RATE_LIMIT_HEADERS = Arrays.asList( - "x-ms-ratelimit-remaining-subscription-reads", - "x-ms-ratelimit-remaining-subscription-writes", - "x-ms-ratelimit-remaining-tenant-reads", - "x-ms-ratelimit-remaining-tenant-writes", - "x-ms-ratelimit-remaining-subscription-resource-requests", - "x-ms-ratelimit-remaining-subscription-resource-entities-read", - "x-ms-ratelimit-remaining-tenant-resource-requests", - "x-ms-ratelimit-remaining-tenant-resource-entities-read" - ); - - // refer https://docs.microsoft.com/azure/virtual-machines/troubleshooting/troubleshooting-throttling-errors - private static final String RESOURCE_RATE_LIMIT_HEADER = "x-ms-ratelimit-remaining-resource"; - private static final Pattern RESOURCE_RATE_LIMIT_HEADER_PATTERN = Pattern.compile("\\w+\\.\\w+/([^;]+);(\\d+)"); - - private final Map commonRateLimits; - private final String resourceRateLimit; - - /** - * Creates the throttling info class from response headers - * @param headers the response headers - */ - public ResourceManagerThrottlingInfo(HttpHeaders headers) { - commonRateLimits = new HashMap<>(); - for (String header : COMMON_RATE_LIMIT_HEADERS) { - String value = headers.getValue(header); - if (value != null && !value.isEmpty()) { - commonRateLimits.put(header, value); - } - } - resourceRateLimit = headers.getValue(RESOURCE_RATE_LIMIT_HEADER); - if (resourceRateLimit != null) { - Matcher matcher = RESOURCE_RATE_LIMIT_HEADER_PATTERN.matcher(resourceRateLimit); - while (matcher.find()) { - commonRateLimits.put( - String.format("%s-%s", RESOURCE_RATE_LIMIT_HEADER, matcher.group(1)), matcher.group(2)); - } - } - } - - /** - * Creates the throttling info class from response headers - * @param headers the response headers - * @return the ResourceManagerThrottlingInfo class - */ - public static ResourceManagerThrottlingInfo fromHeaders(HttpHeaders headers) { - return new ResourceManagerThrottlingInfo(headers); - } - - /** - * @return the smallest rate limit or empty if none of the headers are valid - */ - public Optional getRateLimit() { - Optional result = Optional.empty(); - for (Map.Entry limits : commonRateLimits.entrySet()) { - try { - int limit = Integer.parseInt(limits.getValue()); - if (!result.isPresent() || result.get() > limit) { - result = Optional.of(limit); - } - } catch (NumberFormatException e) { } - } - return result; - } - - /** - * refer https://docs.microsoft.com/azure/azure-resource-manager/management/request-limits-and-throttling - * @return all headers associated with rate limit - */ - public Map getRateLimits() { - return Collections.unmodifiableMap(commonRateLimits); - } - - /** - * refer https://docs.microsoft.com/azure/virtual-machines/troubleshooting/troubleshooting-throttling-errors - * @return a specific rate limit header value from compute - */ - public String getResourceRateLimit() { - return resourceRateLimit; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/utils/ResourceManagerUtils.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/utils/ResourceManagerUtils.java deleted file mode 100644 index 7b5edf0cc29d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/utils/ResourceManagerUtils.java +++ /dev/null @@ -1,309 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.utils; - -import com.azure.core.http.HttpRequest; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.provider.DelayProvider; -import com.azure.core.management.provider.IdentifierProvider; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.resources.models.Subscription; -import reactor.core.scheduler.Scheduler; -import reactor.core.scheduler.Schedulers; - -import java.time.Duration; -import java.util.ArrayList; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.function.Function; - -/** - * Defines a few utilities. - */ -public final class ResourceManagerUtils { - private ResourceManagerUtils() { - } - - /** - * Converts an object Boolean to a primitive boolean. - * - * @param value the Boolean value - * @return false if the given Boolean value is null or false else true - */ - public static boolean toPrimitiveBoolean(Boolean value) { - if (value == null) { - return false; - } - return value.booleanValue(); - } - - /** - * Converts an object Integer to a primitive int. - * - * @param value the Integer value - * @return 0 if the given Integer value is null else integer value - */ - public static int toPrimitiveInt(Integer value) { - if (value == null) { - return 0; - } - return value.intValue(); - } - - /** - * Converts an object Long to a primitive int. - * - * @param value the Long value - * @return 0 if the given Long value is null else integer value - */ - public static int toPrimitiveInt(Long value) { - if (value == null) { - return 0; - } - return Math.toIntExact(value); - } - - /** - * Converts an object Long to a primitive long. - * - * @param value the Long value - * @return 0 if the given Long value is null else long value - */ - public static long toPrimitiveLong(Long value) { - if (value == null) { - return 0; - } - return value; - } - - /** - * Wrapper for thread sleep. - * - * @param duration the duration value for which thread should put on sleep. - */ - public static void sleep(Duration duration) { - try { - Thread.sleep(InternalRuntimeContext.getDelayDuration(duration).toMillis()); - } catch (InterruptedException e) { - } - } - - /** - * Creates an Odata filter string that can be used for filtering list results by tags. - * - * @param tagName the name of the tag. If not provided, all resources will be returned. - * @param tagValue the value of the tag. If not provided, only tag name will be filtered. - * @return the Odata filter to pass into list methods - */ - public static String createOdataFilterForTags(String tagName, String tagValue) { - if (tagName == null) { - return null; - } else if (tagValue == null) { - return String.format("tagname eq '%s'", tagName); - } else { - return String.format("tagname eq '%s' and tagvalue eq '%s'", tagName, tagValue); - } - } - - /** - * Gets the only subscription as the default one in the tenant if applicable. - * - * @param subscriptions the list of subscriptions - * @throws IllegalStateException when no subscription or more than one subscription found - * @return the only subscription existing in the tenant - */ - public static String getDefaultSubscription(PagedIterable subscriptions) { - List subscriptionList = new ArrayList<>(); - subscriptions.forEach(subscription -> { - subscriptionList.add(subscription); - }); - if (subscriptionList.size() == 0) { - throw new ClientLogger(ResourceManagerUtils.class).logExceptionAsError( - new IllegalStateException("Please create a subscription before you start resource management. " - + "To learn more, see: https://azure.microsoft.com/en-us/free/.")); - } else if (subscriptionList.size() > 1) { - StringBuilder stringBuilder = new StringBuilder(); - stringBuilder.append("More than one subscription found in your tenant. " - + "Please specify which one below is desired for resource management."); - subscriptionList.forEach(subscription -> { - stringBuilder.append("\n" + subscription.displayName() + " : " + subscription.subscriptionId()); - }); - throw new ClientLogger(ResourceManagerUtils.class).logExceptionAsError( - new IllegalStateException(stringBuilder.toString())); - } - return subscriptionList.get(0).subscriptionId(); - } - - /** - * Generates default scope for oauth2 from the specific request - * @param request a http request - * @param environment the azure environment with current request - * @return the default scope - */ - public static String getDefaultScopeFromRequest(HttpRequest request, AzureEnvironment environment) { - return getDefaultScopeFromUrl(request.getUrl().toString().toLowerCase(Locale.ROOT), environment); - } - - /** - * Generates default scope for oauth2 from the specific request - * @param url the url in lower case of a http request - * @param environment the azure environment with current request - * @return the default scope - */ - static String getDefaultScopeFromUrl(String url, AzureEnvironment environment) { - String resource = environment.getManagementEndpoint(); - for (Map.Entry endpoint : environment.getEndpoints().entrySet()) { - if (url.contains(endpoint.getValue())) { - if (endpoint.getKey().equals(AzureEnvironment.Endpoint.KEYVAULT.identifier())) { - resource = String.format("https://%s/", endpoint.getValue().replaceAll("^\\.*", "")); - resource = removeTrailingSlash(resource); - break; - } else if (endpoint.getKey().equals(AzureEnvironment.Endpoint.GRAPH.identifier())) { - resource = environment.getGraphEndpoint(); - resource = removeTrailingSlash(resource); - break; - } else if (endpoint.getKey().equals(AzureEnvironment.Endpoint.MICROSOFT_GRAPH.identifier())) { - resource = environment.getMicrosoftGraphEndpoint(); - resource = removeTrailingSlash(resource); - break; - } else if (endpoint.getKey().equals(AzureEnvironment.Endpoint.LOG_ANALYTICS.identifier())) { - resource = environment.getLogAnalyticsEndpoint(); - resource = removeTrailingSlash(resource); - break; - } else if (endpoint.getKey().equals(AzureEnvironment.Endpoint.APPLICATION_INSIGHTS.identifier())) { - resource = environment.getApplicationInsightsEndpoint(); - resource = removeTrailingSlash(resource); - break; - } else if (endpoint.getKey().equals(AzureEnvironment.Endpoint.DATA_LAKE_STORE.identifier()) - || endpoint.getKey().equals(AzureEnvironment.Endpoint.DATA_LAKE_ANALYTICS.identifier())) { - resource = environment.getDataLakeEndpointResourceId(); - resource = removeTrailingSlash(resource); - break; - } - } - } - return resource + "/.default"; - } - - /** - * Removes the trailing slash of the string. - * @param s the string - * @return the string without trailing slash - */ - private static String removeTrailingSlash(String s) { - if (s == null || s.length() == 0) { - return s; - } - if (s.endsWith("/")) { - return s.substring(0, s.length() - 1); - } - return s; - } - - /** - * Get the Azure storage account connection string. - * @param accountName storage account name - * @param accountKey storage account key - * @param environment the Azure environment - * @return the storage account connection string. - */ - public static String getStorageConnectionString(String accountName, String accountKey, - AzureEnvironment environment) { - if (environment == null || environment.getStorageEndpointSuffix() == null) { - environment = AzureEnvironment.AZURE; - } - String suffix = environment.getStorageEndpointSuffix().replaceAll("^\\.*", ""); - return String.format("DefaultEndpointsProtocol=https;AccountName=%s;AccountKey=%s;EndpointSuffix=%s", - accountName, accountKey, suffix); - } - - /** - * The class provides the common methods required for SDK framework. - * - * RESERVED FOR INTERNAL USE. - */ - public static class InternalRuntimeContext { - private Function identifierFunction = ResourceNamer::new; - private static DelayProvider delayProvider = new ResourceDelayProvider(); - private static Scheduler reactorScheduler = Schedulers.parallel(); - - /** - * Sets the resource namer - * - * @param identifierFunction the function. - */ - public void setIdentifierFunction(Function identifierFunction) { - this.identifierFunction = identifierFunction; - } - - /** - * Creates a resource namer - * - * @param name the name value. - * @return the new resource namer - */ - public IdentifierProvider createIdentifierProvider(String name) { - return identifierFunction.apply(name); - } - - /** - * Gets a random name. - * - * @param prefix the prefix to be used if possible - * @param maxLen the maximum length for the random generated name - * @return the random name - */ - public String randomResourceName(String prefix, int maxLen) { - return identifierFunction.apply("").getRandomName(prefix, maxLen); - } - - /** - * Gets a random UUID. - * - * @return the random UUID. - */ - public String randomUuid() { - return identifierFunction.apply("").getRandomUuid(); - } - - /** - * Function to override the DelayProvider. - * - * @param delayProvider delayProvider to override. - */ - public static void setDelayProvider(DelayProvider delayProvider) { - InternalRuntimeContext.delayProvider = delayProvider; - } - - /** - * Wrapper for the duration for delay, based on delayProvider. - * - * @param delay the duration of proposed delay. - * @return the duration of delay. - */ - public static Duration getDelayDuration(Duration delay) { - return delayProvider.getDelayDuration(delay); - } - - /** - * Gets the current Rx Scheduler for the SDK framework. - * - * @return current rx scheduler. - */ - public static Scheduler getReactorScheduler() { - return reactorScheduler; - } - - /** - * Sets the Rx Scheduler for SDK framework, by default is Scheduler.io(). - * - * @param reactorScheduler current Rx Scheduler to be used in SDK framework. - */ - public static void setReactorScheduler(Scheduler reactorScheduler) { - InternalRuntimeContext.reactorScheduler = reactorScheduler; - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/utils/ResourceNamer.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/utils/ResourceNamer.java deleted file mode 100644 index 489843e60459..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/utils/ResourceNamer.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.resources.fluentcore.utils; - -import com.azure.core.management.provider.IdentifierProvider; - -import java.util.Locale; -import java.util.Random; -import java.util.UUID; - -/** - * The ResourceNamer to generate random name. - */ -public class ResourceNamer implements IdentifierProvider { - - private final String randName; - private static final Random RANDOM = new Random(); - - /** - * Constructs a ResourceNamer - * - * @param name the name - */ - public ResourceNamer(String name) { - this.randName = name.toLowerCase(Locale.ROOT) - + UUID.randomUUID().toString().replace("-", "").substring(0, 3).toLowerCase(Locale.ROOT); - } - - @Override - public String getRandomName(String prefix, int maxLen) { - prefix = prefix.toLowerCase(Locale.ROOT); - int minRandomnessLength = 5; - if (maxLen <= minRandomnessLength) { - return randomString(maxLen); - } - - if (maxLen < prefix.length() + minRandomnessLength) { - return randomString(maxLen); - } - - String minRandomString = String.format("%05d", Math.abs(RANDOM.nextInt() % 100000)); - - if (maxLen <= prefix.length() + randName.length() + minRandomnessLength) { - String str = prefix + minRandomString; - return str + randomString((maxLen - str.length()) / 2); - } - - String str = prefix + randName + minRandomString; - return str + randomString((maxLen - str.length()) / 2); - } - - @Override - public String getRandomUuid() { - return UUID.randomUUID().toString(); - } - - private String randomString(int length) { - StringBuilder str = new StringBuilder(); - while (str.length() < length) { - str.append(UUID.randomUUID() - .toString() - .replace("-", "") - .substring(0, Math.min(32, length)).toLowerCase(Locale.ROOT)); - } - return str.toString(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/utils/package-info.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/utils/package-info.java deleted file mode 100644 index b460861cbfa6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/utils/package-info.java +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. - -/** - * This package contains a few utility classes for working with Azure resources. - */ -package com.azure.resourcemanager.resources.fluentcore.utils; diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/AuthorizationOperationsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/AuthorizationOperationsClientImpl.java deleted file mode 100644 index 1db46207af35..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/AuthorizationOperationsClientImpl.java +++ /dev/null @@ -1,270 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.resources.fluent.AuthorizationOperationsClient; -import com.azure.resourcemanager.resources.fluent.models.OperationInner; -import com.azure.resourcemanager.resources.models.OperationListResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in AuthorizationOperationsClient. */ -public final class AuthorizationOperationsClientImpl implements AuthorizationOperationsClient { - private final ClientLogger logger = new ClientLogger(AuthorizationOperationsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final AuthorizationOperationsService service; - - /** The service client containing this operation class. */ - private final ManagementLockClientImpl client; - - /** - * Initializes an instance of AuthorizationOperationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - AuthorizationOperationsClientImpl(ManagementLockClientImpl client) { - this.service = - RestProxy - .create(AuthorizationOperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for ManagementLockClientAuthorizationOperations to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "ManagementLockClient") - private interface AuthorizationOperationsService { - @Headers({"Content-Type: application/json"}) - @Get("/providers/Microsoft.Authorization/operations") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Lists all of the available Microsoft.Authorization REST API operations. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Microsoft.Authorization operations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all of the available Microsoft.Authorization REST API operations. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Microsoft.Authorization operations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists all of the available Microsoft.Authorization REST API operations. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Microsoft.Authorization operations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists all of the available Microsoft.Authorization REST API operations. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Microsoft.Authorization operations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all of the available Microsoft.Authorization REST API operations. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Microsoft.Authorization operations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Lists all of the available Microsoft.Authorization REST API operations. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Microsoft.Authorization operations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Microsoft.Authorization operations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Microsoft.Authorization operations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/DeploymentExportResultImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/DeploymentExportResultImpl.java deleted file mode 100644 index 7b60685ba5f6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/DeploymentExportResultImpl.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.implementation; - -import com.azure.resourcemanager.resources.models.DeploymentExportResult; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.WrapperImpl; -import com.azure.resourcemanager.resources.fluent.models.DeploymentExportResultInner; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; - -/** - * Implementation for {@link DeploymentExportResult}. - */ -final class DeploymentExportResultImpl extends - WrapperImpl - implements - DeploymentExportResult { - - private ObjectMapper mapper; - - DeploymentExportResultImpl(DeploymentExportResultInner innerModel) { - super(innerModel); - mapper = new ObjectMapper(); - } - - @Override - public Object template() { - return innerModel().template(); - } - - @Override - public String templateAsJson() { - try { - return mapper.writeValueAsString(template()); - } catch (JsonProcessingException e) { - return null; - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/DeploymentImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/DeploymentImpl.java deleted file mode 100644 index 8f2be068d550..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/DeploymentImpl.java +++ /dev/null @@ -1,588 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.implementation; - -import com.azure.core.management.exception.ManagementError; -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.resourcemanager.resources.ResourceManager; -import com.azure.resourcemanager.resources.fluentcore.model.Accepted; -import com.azure.resourcemanager.resources.fluentcore.model.Indexable; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.AcceptedImpl; -import com.azure.resourcemanager.resources.models.DebugSetting; -import com.azure.resourcemanager.resources.models.Dependency; -import com.azure.resourcemanager.resources.models.Deployment; -import com.azure.resourcemanager.resources.models.DeploymentExportResult; -import com.azure.resourcemanager.resources.models.DeploymentMode; -import com.azure.resourcemanager.resources.models.DeploymentOperations; -import com.azure.resourcemanager.resources.models.DeploymentProperties; -import com.azure.resourcemanager.resources.models.DeploymentWhatIf; -import com.azure.resourcemanager.resources.models.DeploymentWhatIfProperties; -import com.azure.resourcemanager.resources.models.DeploymentWhatIfSettings; -import com.azure.resourcemanager.resources.models.OnErrorDeployment; -import com.azure.resourcemanager.resources.models.OnErrorDeploymentType; -import com.azure.resourcemanager.resources.models.ParametersLink; -import com.azure.resourcemanager.resources.models.Provider; -import com.azure.resourcemanager.resources.models.ResourceGroup; -import com.azure.resourcemanager.resources.models.ResourceReference; -import com.azure.resourcemanager.resources.models.TemplateLink; -import com.azure.resourcemanager.resources.models.WhatIfOperationResult; -import com.azure.resourcemanager.resources.models.WhatIfResultFormat; -import com.azure.core.management.Region; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.CreatableUpdatableImpl; -import com.azure.resourcemanager.resources.fluent.models.DeploymentExtendedInner; -import com.azure.resourcemanager.resources.fluent.models.DeploymentInner; -import com.azure.resourcemanager.resources.fluent.models.ProviderInner; -import com.fasterxml.jackson.databind.ObjectMapper; -import reactor.core.publisher.Mono; - -import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.ArrayList; -import java.util.List; - -/** - * The implementation of {@link Deployment} and its nested interfaces. - */ -public final class DeploymentImpl extends - CreatableUpdatableImpl - implements - Deployment, - Deployment.Definition, - Deployment.Update, - Deployment.Execution { - - private final ClientLogger logger = new ClientLogger(DeploymentImpl.class); - - private final ResourceManager resourceManager; - private String resourceGroupName; - private Creatable creatableResourceGroup; - private ObjectMapper objectMapper; - private DeploymentWhatIf deploymentWhatIf; - private DeploymentInner deploymentCreateUpdateParameters; - - DeploymentImpl(DeploymentExtendedInner innerModel, String name, final ResourceManager resourceManager) { - super(name, innerModel); - this.resourceGroupName = ResourceUtils.groupFromResourceId(innerModel.id()); - this.resourceManager = resourceManager; - this.objectMapper = new ObjectMapper(); - this.deploymentWhatIf = new DeploymentWhatIf(); - this.deploymentCreateUpdateParameters = new DeploymentInner(); - } - - @Override - public String resourceGroupName() { - return this.resourceGroupName; - } - - @Override - public String provisioningState() { - if (this.innerModel().properties() == null) { - return null; - } - return this.innerModel().properties().provisioningState(); - } - - @Override - public String correlationId() { - if (this.innerModel().properties() == null) { - return null; - } - return this.innerModel().properties().correlationId(); - } - - @Override - public OffsetDateTime timestamp() { - if (this.innerModel().properties() == null) { - return null; - } - return this.innerModel().properties().timestamp(); - } - - @Override - public Object outputs() { - if (this.innerModel().properties() == null) { - return null; - } - return this.innerModel().properties().outputs(); - } - - @Override - public List providers() { - if (this.innerModel().properties() == null) { - return null; - } - List providers = new ArrayList<>(); - for (ProviderInner providerInner : this.innerModel().properties().providers()) { - providers.add(new ProviderImpl(providerInner)); - } - return providers; - } - - @Override - public List dependencies() { - if (this.innerModel().properties() == null) { - return null; - } - return this.innerModel().properties().dependencies(); - } - - @Override - public String templateHash() { - if (this.innerModel().properties() == null) { - return null; - } - return this.innerModel().properties().templateHash(); - } - - @Override - public TemplateLink templateLink() { - if (this.innerModel().properties() == null) { - return null; - } - return this.innerModel().properties().templateLink(); - } - - @Override - public Object parameters() { - if (this.innerModel().properties() == null) { - return null; - } - return this.innerModel().properties().parameters(); - } - - @Override - public ParametersLink parametersLink() { - if (this.innerModel().properties() == null) { - return null; - } - return this.innerModel().properties().parametersLink(); - } - - @Override - public DeploymentMode mode() { - if (this.innerModel().properties() == null) { - return null; - } - return innerModel().properties().mode(); - } - - @Override - public ManagementError error() { - if (this.innerModel().properties() == null) { - return null; - } - return innerModel().properties().error(); - } - - @Override - public List outputResources() { - if (this.innerModel().properties() == null) { - return null; - } - return innerModel().properties().outputResources(); - } - - @Override - public DeploymentOperations deploymentOperations() { - return new DeploymentOperationsImpl(this.manager().serviceClient().getDeploymentOperations(), this); - } - - @Override - public void cancel() { - this.cancelAsync().block(); - } - - @Override - public Mono cancelAsync() { - return this.manager().serviceClient().getDeployments().cancelAsync(resourceGroupName, name()); - } - - - @Override - public DeploymentExportResult exportTemplate() { - return this.exportTemplateAsync().block(); - } - - @Override - public Mono exportTemplateAsync() { - return this.manager().serviceClient().getDeployments().exportTemplateAsync(resourceGroupName(), name()) - .map(DeploymentExportResultImpl::new); - } - - @Override - public DeploymentImpl prepareWhatIf() { - return this; - } - - // Withers - - @Override - public DeploymentImpl withNewResourceGroup(String resourceGroupName, Region region) { - this.creatableResourceGroup = this.resourceManager.resourceGroups() - .define(resourceGroupName) - .withRegion(region); - this.addDependency(this.creatableResourceGroup); - this.resourceGroupName = resourceGroupName; - return this; - } - - @Override - public DeploymentImpl withNewResourceGroup(Creatable resourceGroupDefinition) { - this.resourceGroupName = resourceGroupDefinition.name(); - this.addDependency(resourceGroupDefinition); - this.creatableResourceGroup = resourceGroupDefinition; - return this; - } - - @Override - public DeploymentImpl withExistingResourceGroup(String resourceGroupName) { - this.resourceGroupName = resourceGroupName; - return this; - } - - @Override - public DeploymentImpl withExistingResourceGroup(ResourceGroup resourceGroup) { - this.resourceGroupName = resourceGroup.name(); - return this; - } - - @Override - public DeploymentImpl withTemplate(Object template) { - if (this.deploymentCreateUpdateParameters.properties() == null) { - this.deploymentCreateUpdateParameters.withProperties(new DeploymentProperties()); - } - this.deploymentCreateUpdateParameters.properties().withTemplate(template); - this.deploymentCreateUpdateParameters.properties().withTemplateLink(null); - return this; - } - - @Override - public DeploymentImpl withTemplate(String templateJson) throws IOException { - return withTemplate(objectMapper.readTree(templateJson)); - } - - @Override - public DeploymentImpl withTemplateLink(String uri, String contentVersion) { - if (this.deploymentCreateUpdateParameters.properties() == null) { - this.deploymentCreateUpdateParameters.withProperties(new DeploymentProperties()); - } - this.deploymentCreateUpdateParameters.properties().withTemplateLink( - new TemplateLink().withUri(uri).withContentVersion(contentVersion)); - this.deploymentCreateUpdateParameters.properties().withTemplate(null); - return this; - } - - @Override - public DeploymentImpl withMode(DeploymentMode mode) { - if (this.deploymentCreateUpdateParameters.properties() == null) { - this.deploymentCreateUpdateParameters.withProperties(new DeploymentProperties()); - } - this.deploymentCreateUpdateParameters.properties().withMode(mode); - return this; - } - - @Override - public DeploymentImpl withParameters(Object parameters) { - if (this.deploymentCreateUpdateParameters.properties() == null) { - this.deploymentCreateUpdateParameters.withProperties(new DeploymentProperties()); - } - this.deploymentCreateUpdateParameters.properties().withParameters(parameters); - this.deploymentCreateUpdateParameters.properties().withParametersLink(null); - return this; - } - - @Override - public DeploymentImpl withParameters(String parametersJson) throws IOException { - return withParameters(objectMapper.readTree(parametersJson)); - } - - @Override - public DeploymentImpl withParametersLink(String uri, String contentVersion) { - if (this.deploymentCreateUpdateParameters.properties() == null) { - this.deploymentCreateUpdateParameters.withProperties(new DeploymentProperties()); - } - this.deploymentCreateUpdateParameters.properties().withParametersLink( - new ParametersLink().withUri(uri).withContentVersion(contentVersion)); - this.deploymentCreateUpdateParameters.properties().withParameters(null); - return this; - } - - @Override - public Accepted beginCreate() { - return beginCreate(Context.NONE); - } - - @Override - public Accepted beginCreate(Context context) { - return AcceptedImpl.newAccepted(logger, - this.manager().serviceClient().getHttpPipeline(), - this.manager().serviceClient().getDefaultPollInterval(), - () -> this.manager().serviceClient().getDeployments() - .createOrUpdateWithResponseAsync(resourceGroupName(), name(), deploymentCreateUpdateParameters) - .contextWrite(c -> c.putAll(FluxUtil.toReactorContext(context).readOnly())) - .block(), - inner -> new DeploymentImpl(inner, inner.name(), resourceManager), - DeploymentExtendedInner.class, - () -> { - if (this.creatableResourceGroup != null) { - this.creatableResourceGroup.create(context); - } - }, - inner -> { - setInner(inner); - prepareForUpdate(inner); - }, - context); - } - - @Override - public Mono beginCreateAsync() { - return Mono.just(creatableResourceGroup) - .flatMap(resourceGroupCreatable -> { - if (resourceGroupCreatable != null) { - return creatableResourceGroup.createAsync(); - } else { - return Mono.just((Indexable) DeploymentImpl.this); - } - }) - .flatMap(indexable -> manager().serviceClient().getDeployments() - .createOrUpdateWithResponseAsync(resourceGroupName(), name(), deploymentCreateUpdateParameters)) - .flatMap(activationResponse -> FluxUtil.collectBytesInByteBufferStream(activationResponse.getValue())) - .map(response -> { - try { - return (DeploymentExtendedInner) SerializerFactory.createDefaultManagementSerializerAdapter() - .deserialize(new String(response, StandardCharsets.UTF_8), - DeploymentExtendedInner.class, SerializerEncoding.JSON); - } catch (IOException ioe) { - throw logger.logExceptionAsError( - new IllegalStateException("Failed to deserialize activation response body", ioe)); - } - }) - .map(deploymentExtendedInner -> { - prepareForUpdate(deploymentExtendedInner); - return deploymentExtendedInner; - }) - .map(innerToFluentMap(this)); - } - - @Override - public Mono createResourceAsync() { - return this.manager().serviceClient().getDeployments() - .createOrUpdateAsync(resourceGroupName(), name(), deploymentCreateUpdateParameters) - .map(deploymentExtendedInner -> { - prepareForUpdate(deploymentExtendedInner); - return deploymentExtendedInner; - }) - .map(innerToFluentMap(this)); - } - - private void prepareForUpdate(DeploymentExtendedInner inner) { - deploymentCreateUpdateParameters = new DeploymentInner(); - deploymentCreateUpdateParameters.withLocation(inner.location()); - deploymentCreateUpdateParameters.withTags(inner.tags()); - if (inner.properties() != null) { - deploymentCreateUpdateParameters.withProperties(new DeploymentProperties()); - deploymentCreateUpdateParameters.properties().withDebugSetting(inner.properties().debugSetting()); - deploymentCreateUpdateParameters.properties().withMode(inner.properties().mode()); - deploymentCreateUpdateParameters.properties().withParameters(inner.properties().parameters()); - deploymentCreateUpdateParameters.properties().withParametersLink(inner.properties().parametersLink()); - deploymentCreateUpdateParameters.properties().withTemplateLink(inner.properties().templateLink()); - if (inner.properties().onErrorDeployment() != null) { - deploymentCreateUpdateParameters.properties().withOnErrorDeployment(new OnErrorDeployment()); - deploymentCreateUpdateParameters.properties().onErrorDeployment().withDeploymentName( - inner.properties().onErrorDeployment().deploymentName()); - deploymentCreateUpdateParameters.properties().onErrorDeployment().withType( - inner.properties().onErrorDeployment().type()); - } - } - } - - @Override - public Mono applyAsync() { - return updateResourceAsync(); - } - - @Override - protected Mono getInnerAsync() { - return this.manager().serviceClient().getDeployments() - .getAtManagementGroupScopeAsync(resourceGroupName(), name()); - } - - @Override - public boolean isInCreateMode() { - return this.innerModel().id() == null; - } - - @Override - public ResourceManager manager() { - return this.resourceManager; - } - - @Override - public String id() { - return innerModel().id(); - } - - @Override - public DeploymentImpl withDetailedLevel(String detailedLevel) { - if (deploymentWhatIf.properties() == null) { - deploymentWhatIf.withProperties(new DeploymentWhatIfProperties()); - } - deploymentWhatIf.properties().withDebugSetting(new DebugSetting().withDetailLevel(detailedLevel)); - return this; - } - - @Override - public DeploymentImpl withDeploymentName(String deploymentName) { - if (deploymentWhatIf.properties() == null) { - deploymentWhatIf.withProperties(new DeploymentWhatIfProperties()); - } - if (deploymentWhatIf.properties().onErrorDeployment() == null) { - deploymentWhatIf.properties().withOnErrorDeployment(new OnErrorDeployment()); - } - deploymentWhatIf.properties().onErrorDeployment().withDeploymentName(deploymentName); - return this; - } - - @Override - public DeploymentImpl withLocation(String location) { - this.deploymentWhatIf.withLocation(location); - return this; - } - - @Override - public DeploymentImpl withIncrementalMode() { - if (deploymentWhatIf.properties() == null) { - deploymentWhatIf.withProperties(new DeploymentWhatIfProperties()); - } - deploymentWhatIf.properties().withMode(DeploymentMode.INCREMENTAL); - return this; - } - - @Override - public DeploymentImpl withCompleteMode() { - if (deploymentWhatIf.properties() == null) { - deploymentWhatIf.withProperties(new DeploymentWhatIfProperties()); - } - deploymentWhatIf.properties().withMode(DeploymentMode.COMPLETE); - return this; - } - - @Override - public DeploymentImpl withFullResourcePayloadsResultFormat() { - if (deploymentWhatIf.properties() == null) { - deploymentWhatIf.withProperties(new DeploymentWhatIfProperties()); - } - if (deploymentWhatIf.properties().whatIfSettings() == null) { - deploymentWhatIf.properties().withWhatIfSettings(new DeploymentWhatIfSettings()); - } - deploymentWhatIf.properties().whatIfSettings().withResultFormat(WhatIfResultFormat.FULL_RESOURCE_PAYLOADS); - return this; - } - - @Override - public DeploymentImpl withResourceIdOnlyResultFormat() { - if (deploymentWhatIf.properties() == null) { - deploymentWhatIf.withProperties(new DeploymentWhatIfProperties()); - } - if (deploymentWhatIf.properties().whatIfSettings() == null) { - deploymentWhatIf.properties().withWhatIfSettings(new DeploymentWhatIfSettings()); - } - deploymentWhatIf.properties().whatIfSettings().withResultFormat(WhatIfResultFormat.RESOURCE_ID_ONLY); - return this; - } - - @Override - public DeploymentImpl withLastSuccessfulOnErrorDeployment() { - if (deploymentWhatIf.properties() == null) { - deploymentWhatIf.withProperties(new DeploymentWhatIfProperties()); - } - if (deploymentWhatIf.properties().onErrorDeployment() == null) { - deploymentWhatIf.properties().withOnErrorDeployment(new OnErrorDeployment()); - } - deploymentWhatIf.properties().onErrorDeployment().withType(OnErrorDeploymentType.LAST_SUCCESSFUL); - return this; - } - - @Override - public DeploymentImpl withSpecialDeploymentOnErrorDeployment() { - if (deploymentWhatIf.properties() == null) { - deploymentWhatIf.withProperties(new DeploymentWhatIfProperties()); - } - if (deploymentWhatIf.properties().onErrorDeployment() == null) { - deploymentWhatIf.properties().withOnErrorDeployment(new OnErrorDeployment()); - } - deploymentWhatIf.properties().onErrorDeployment().withType(OnErrorDeploymentType.SPECIFIC_DEPLOYMENT); - return this; - } - - @Override - public DeploymentImpl withWhatIfTemplate(Object template) { - if (deploymentWhatIf.properties() == null) { - deploymentWhatIf.withProperties(new DeploymentWhatIfProperties()); - } - deploymentWhatIf.properties().withTemplate(template); - return this; - } - - @Override - public DeploymentImpl withWhatIfTemplateLink(String uri, String contentVersion) { - if (deploymentWhatIf.properties() == null) { - deploymentWhatIf.withProperties(new DeploymentWhatIfProperties()); - } - deploymentWhatIf.properties().withTemplateLink( - new TemplateLink().withUri(uri).withContentVersion(contentVersion)); - return this; - } - - @Override - public DeploymentImpl withWhatIfParameters(Object parameters) { - if (deploymentWhatIf.properties() == null) { - deploymentWhatIf.withProperties(new DeploymentWhatIfProperties()); - } - deploymentWhatIf.properties().withParameters(parameters); - return this; - } - - @Override - public DeploymentImpl withWhatIfParametersLink(String uri, String contentVersion) { - if (deploymentWhatIf.properties() == null) { - deploymentWhatIf.withProperties(new DeploymentWhatIfProperties()); - } - deploymentWhatIf.properties().withParametersLink( - new ParametersLink().withUri(uri).withContentVersion(contentVersion)); - return this; - } - - @Override - public WhatIfOperationResult whatIf() { - return this.whatIfAsync().block(); - } - - @Override - public Mono whatIfAsync() { - return this.manager().serviceClient().getDeployments() - .whatIfAsync(resourceGroupName(), name(), deploymentWhatIf) - .map(WhatIfOperationResultImpl::new); - } - - - @Override - public WhatIfOperationResult whatIfAtSubscriptionScope() { - return this.whatIfAtSubscriptionScopeAsync().block(); - } - - @Override - public Mono whatIfAtSubscriptionScopeAsync() { - return this.manager().serviceClient().getDeployments().whatIfAtSubscriptionScopeAsync(name(), deploymentWhatIf) - .map(WhatIfOperationResultImpl::new); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/DeploymentOperationImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/DeploymentOperationImpl.java deleted file mode 100644 index 7d2c944fa544..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/DeploymentOperationImpl.java +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.implementation; - -import com.azure.resourcemanager.resources.models.DeploymentOperation; -import com.azure.resourcemanager.resources.models.ProvisioningOperation; -import com.azure.resourcemanager.resources.models.TargetResource; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.IndexableRefreshableWrapperImpl; -import com.azure.resourcemanager.resources.fluent.models.DeploymentOperationInner; -import com.azure.resourcemanager.resources.fluent.DeploymentOperationsClient; -import reactor.core.publisher.Mono; - -import java.time.OffsetDateTime; - -/** - * The implementation of {@link DeploymentOperation}. - */ -final class DeploymentOperationImpl extends - IndexableRefreshableWrapperImpl - implements - DeploymentOperation { - private String resourceGroupName; - private String deploymentName; - - private final DeploymentOperationsClient client; - - DeploymentOperationImpl(DeploymentOperationInner innerModel, final DeploymentOperationsClient client) { - super(innerModel); - this.client = client; - this.resourceGroupName = ResourceUtils.groupFromResourceId(innerModel.id()); - this.deploymentName = ResourceUtils.extractFromResourceId(innerModel.id(), "deployments"); - } - - @Override - public String operationId() { - return innerModel().operationId(); - } - - @Override - public String provisioningState() { - if (this.innerModel().properties() == null) { - return null; - } - return this.innerModel().properties().provisioningState(); - } - - @Override - public ProvisioningOperation provisioningOperation() { - if (this.innerModel().properties() == null) { - return null; - } - return this.innerModel().properties().provisioningOperation(); - } - - @Override - public OffsetDateTime timestamp() { - if (this.innerModel().properties() == null) { - return null; - } - return this.innerModel().properties().timestamp(); - } - - @Override - public String statusCode() { - if (this.innerModel().properties() == null) { - return null; - } - return this.innerModel().properties().statusCode(); - } - - @Override - public Object statusMessage() { - if (this.innerModel().properties() == null) { - return null; - } - return this.innerModel().properties().statusMessage(); - } - - @Override - public TargetResource targetResource() { - if (this.innerModel().properties() == null) { - return null; - } - return this.innerModel().properties().targetResource(); - } - - @Override - protected Mono getInnerAsync() { - return client.getAsync(resourceGroupName, deploymentName, operationId()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/DeploymentOperationsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/DeploymentOperationsClientImpl.java deleted file mode 100644 index 0577ec13c7f8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/DeploymentOperationsClientImpl.java +++ /dev/null @@ -1,2284 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.resources.fluent.DeploymentOperationsClient; -import com.azure.resourcemanager.resources.fluent.models.DeploymentOperationInner; -import com.azure.resourcemanager.resources.models.DeploymentOperationsListResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in DeploymentOperationsClient. */ -public final class DeploymentOperationsClientImpl implements DeploymentOperationsClient { - private final ClientLogger logger = new ClientLogger(DeploymentOperationsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final DeploymentOperationsService service; - - /** The service client containing this operation class. */ - private final ResourceManagementClientImpl client; - - /** - * Initializes an instance of DeploymentOperationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - DeploymentOperationsClientImpl(ResourceManagementClientImpl client) { - this.service = - RestProxy - .create(DeploymentOperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for ResourceManagementClientDeploymentOperations to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "ResourceManagementCl") - private interface DeploymentOperationsService { - @Headers({"Content-Type: application/json"}) - @Get("/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}/operations/{operationId}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getAtScope( - @HostParam("$host") String endpoint, - @PathParam(value = "scope", encoded = true) String scope, - @PathParam("deploymentName") String deploymentName, - @PathParam("operationId") String operationId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}/operations") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAtScope( - @HostParam("$host") String endpoint, - @PathParam(value = "scope", encoded = true) String scope, - @PathParam("deploymentName") String deploymentName, - @QueryParam("$top") Integer top, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/providers/Microsoft.Resources/deployments/{deploymentName}/operations/{operationId}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getAtTenantScope( - @HostParam("$host") String endpoint, - @PathParam("deploymentName") String deploymentName, - @PathParam("operationId") String operationId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/providers/Microsoft.Resources/deployments/{deploymentName}/operations") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAtTenantScope( - @HostParam("$host") String endpoint, - @PathParam("deploymentName") String deploymentName, - @QueryParam("$top") Integer top, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments" - + "/{deploymentName}/operations/{operationId}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getAtManagementGroupScope( - @HostParam("$host") String endpoint, - @PathParam("groupId") String groupId, - @PathParam("deploymentName") String deploymentName, - @PathParam("operationId") String operationId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments" - + "/{deploymentName}/operations") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAtManagementGroupScope( - @HostParam("$host") String endpoint, - @PathParam("groupId") String groupId, - @PathParam("deploymentName") String deploymentName, - @QueryParam("$top") Integer top, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/operations" - + "/{operationId}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getAtSubscriptionScope( - @HostParam("$host") String endpoint, - @PathParam("deploymentName") String deploymentName, - @PathParam("operationId") String operationId, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/operations") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAtSubscriptionScope( - @HostParam("$host") String endpoint, - @PathParam("deploymentName") String deploymentName, - @QueryParam("$top") Integer top, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/deployments/{deploymentName}/operations" - + "/{operationId}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("deploymentName") String deploymentName, - @PathParam("operationId") String operationId, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/deployments/{deploymentName}" - + "/operations") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("deploymentName") String deploymentName, - @QueryParam("$top") Integer top, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAtScopeNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAtTenantScopeNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAtManagementGroupScopeNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAtSubscriptionScopeNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets a deployments operation. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param operationId The ID of the operation to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployments operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getAtScopeWithResponseAsync( - String scope, String deploymentName, String operationId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - if (operationId == null) { - return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getAtScope( - this.client.getEndpoint(), - scope, - deploymentName, - operationId, - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a deployments operation. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param operationId The ID of the operation to get. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployments operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getAtScopeWithResponseAsync( - String scope, String deploymentName, String operationId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - if (operationId == null) { - return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getAtScope( - this.client.getEndpoint(), - scope, - deploymentName, - operationId, - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets a deployments operation. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param operationId The ID of the operation to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployments operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAtScopeAsync(String scope, String deploymentName, String operationId) { - return getAtScopeWithResponseAsync(scope, deploymentName, operationId) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a deployments operation. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param operationId The ID of the operation to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployments operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentOperationInner getAtScope(String scope, String deploymentName, String operationId) { - return getAtScopeAsync(scope, deploymentName, operationId).block(); - } - - /** - * Gets a deployments operation. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param operationId The ID of the operation to get. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployments operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getAtScopeWithResponse( - String scope, String deploymentName, String operationId, Context context) { - return getAtScopeWithResponseAsync(scope, deploymentName, operationId, context).block(); - } - - /** - * Gets all deployments operations for a deployment. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param top The number of results to return. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments operations for a deployment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAtScopeSinglePageAsync( - String scope, String deploymentName, Integer top) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listAtScope( - this.client.getEndpoint(), - scope, - deploymentName, - top, - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all deployments operations for a deployment. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param top The number of results to return. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments operations for a deployment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAtScopeSinglePageAsync( - String scope, String deploymentName, Integer top, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listAtScope( - this.client.getEndpoint(), scope, deploymentName, top, this.client.getApiVersion(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all deployments operations for a deployment. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param top The number of results to return. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments operations for a deployment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAtScopeAsync(String scope, String deploymentName, Integer top) { - return new PagedFlux<>( - () -> listAtScopeSinglePageAsync(scope, deploymentName, top), - nextLink -> listAtScopeNextSinglePageAsync(nextLink)); - } - - /** - * Gets all deployments operations for a deployment. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments operations for a deployment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAtScopeAsync(String scope, String deploymentName) { - final Integer top = null; - return new PagedFlux<>( - () -> listAtScopeSinglePageAsync(scope, deploymentName, top), - nextLink -> listAtScopeNextSinglePageAsync(nextLink)); - } - - /** - * Gets all deployments operations for a deployment. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param top The number of results to return. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments operations for a deployment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAtScopeAsync( - String scope, String deploymentName, Integer top, Context context) { - return new PagedFlux<>( - () -> listAtScopeSinglePageAsync(scope, deploymentName, top, context), - nextLink -> listAtScopeNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all deployments operations for a deployment. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments operations for a deployment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAtScope(String scope, String deploymentName) { - final Integer top = null; - return new PagedIterable<>(listAtScopeAsync(scope, deploymentName, top)); - } - - /** - * Gets all deployments operations for a deployment. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param top The number of results to return. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments operations for a deployment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAtScope( - String scope, String deploymentName, Integer top, Context context) { - return new PagedIterable<>(listAtScopeAsync(scope, deploymentName, top, context)); - } - - /** - * Gets a deployments operation. - * - * @param deploymentName The name of the deployment. - * @param operationId The ID of the operation to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployments operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getAtTenantScopeWithResponseAsync( - String deploymentName, String operationId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - if (operationId == null) { - return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getAtTenantScope( - this.client.getEndpoint(), - deploymentName, - operationId, - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a deployments operation. - * - * @param deploymentName The name of the deployment. - * @param operationId The ID of the operation to get. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployments operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getAtTenantScopeWithResponseAsync( - String deploymentName, String operationId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - if (operationId == null) { - return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getAtTenantScope( - this.client.getEndpoint(), deploymentName, operationId, this.client.getApiVersion(), accept, context); - } - - /** - * Gets a deployments operation. - * - * @param deploymentName The name of the deployment. - * @param operationId The ID of the operation to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployments operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAtTenantScopeAsync(String deploymentName, String operationId) { - return getAtTenantScopeWithResponseAsync(deploymentName, operationId) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a deployments operation. - * - * @param deploymentName The name of the deployment. - * @param operationId The ID of the operation to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployments operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentOperationInner getAtTenantScope(String deploymentName, String operationId) { - return getAtTenantScopeAsync(deploymentName, operationId).block(); - } - - /** - * Gets a deployments operation. - * - * @param deploymentName The name of the deployment. - * @param operationId The ID of the operation to get. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployments operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getAtTenantScopeWithResponse( - String deploymentName, String operationId, Context context) { - return getAtTenantScopeWithResponseAsync(deploymentName, operationId, context).block(); - } - - /** - * Gets all deployments operations for a deployment. - * - * @param deploymentName The name of the deployment. - * @param top The number of results to return. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments operations for a deployment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAtTenantScopeSinglePageAsync( - String deploymentName, Integer top) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listAtTenantScope( - this.client.getEndpoint(), - deploymentName, - top, - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all deployments operations for a deployment. - * - * @param deploymentName The name of the deployment. - * @param top The number of results to return. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments operations for a deployment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAtTenantScopeSinglePageAsync( - String deploymentName, Integer top, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listAtTenantScope( - this.client.getEndpoint(), deploymentName, top, this.client.getApiVersion(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all deployments operations for a deployment. - * - * @param deploymentName The name of the deployment. - * @param top The number of results to return. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments operations for a deployment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAtTenantScopeAsync(String deploymentName, Integer top) { - return new PagedFlux<>( - () -> listAtTenantScopeSinglePageAsync(deploymentName, top), - nextLink -> listAtTenantScopeNextSinglePageAsync(nextLink)); - } - - /** - * Gets all deployments operations for a deployment. - * - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments operations for a deployment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAtTenantScopeAsync(String deploymentName) { - final Integer top = null; - return new PagedFlux<>( - () -> listAtTenantScopeSinglePageAsync(deploymentName, top), - nextLink -> listAtTenantScopeNextSinglePageAsync(nextLink)); - } - - /** - * Gets all deployments operations for a deployment. - * - * @param deploymentName The name of the deployment. - * @param top The number of results to return. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments operations for a deployment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAtTenantScopeAsync( - String deploymentName, Integer top, Context context) { - return new PagedFlux<>( - () -> listAtTenantScopeSinglePageAsync(deploymentName, top, context), - nextLink -> listAtTenantScopeNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all deployments operations for a deployment. - * - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments operations for a deployment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAtTenantScope(String deploymentName) { - final Integer top = null; - return new PagedIterable<>(listAtTenantScopeAsync(deploymentName, top)); - } - - /** - * Gets all deployments operations for a deployment. - * - * @param deploymentName The name of the deployment. - * @param top The number of results to return. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments operations for a deployment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAtTenantScope( - String deploymentName, Integer top, Context context) { - return new PagedIterable<>(listAtTenantScopeAsync(deploymentName, top, context)); - } - - /** - * Gets a deployments operation. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param operationId The ID of the operation to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployments operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getAtManagementGroupScopeWithResponseAsync( - String groupId, String deploymentName, String operationId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (groupId == null) { - return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - if (operationId == null) { - return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getAtManagementGroupScope( - this.client.getEndpoint(), - groupId, - deploymentName, - operationId, - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a deployments operation. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param operationId The ID of the operation to get. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployments operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getAtManagementGroupScopeWithResponseAsync( - String groupId, String deploymentName, String operationId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (groupId == null) { - return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - if (operationId == null) { - return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getAtManagementGroupScope( - this.client.getEndpoint(), - groupId, - deploymentName, - operationId, - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets a deployments operation. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param operationId The ID of the operation to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployments operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAtManagementGroupScopeAsync( - String groupId, String deploymentName, String operationId) { - return getAtManagementGroupScopeWithResponseAsync(groupId, deploymentName, operationId) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a deployments operation. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param operationId The ID of the operation to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployments operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentOperationInner getAtManagementGroupScope( - String groupId, String deploymentName, String operationId) { - return getAtManagementGroupScopeAsync(groupId, deploymentName, operationId).block(); - } - - /** - * Gets a deployments operation. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param operationId The ID of the operation to get. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployments operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getAtManagementGroupScopeWithResponse( - String groupId, String deploymentName, String operationId, Context context) { - return getAtManagementGroupScopeWithResponseAsync(groupId, deploymentName, operationId, context).block(); - } - - /** - * Gets all deployments operations for a deployment. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param top The number of results to return. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments operations for a deployment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAtManagementGroupScopeSinglePageAsync( - String groupId, String deploymentName, Integer top) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (groupId == null) { - return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listAtManagementGroupScope( - this.client.getEndpoint(), - groupId, - deploymentName, - top, - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all deployments operations for a deployment. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param top The number of results to return. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments operations for a deployment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAtManagementGroupScopeSinglePageAsync( - String groupId, String deploymentName, Integer top, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (groupId == null) { - return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listAtManagementGroupScope( - this.client.getEndpoint(), groupId, deploymentName, top, this.client.getApiVersion(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all deployments operations for a deployment. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param top The number of results to return. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments operations for a deployment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAtManagementGroupScopeAsync( - String groupId, String deploymentName, Integer top) { - return new PagedFlux<>( - () -> listAtManagementGroupScopeSinglePageAsync(groupId, deploymentName, top), - nextLink -> listAtManagementGroupScopeNextSinglePageAsync(nextLink)); - } - - /** - * Gets all deployments operations for a deployment. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments operations for a deployment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAtManagementGroupScopeAsync(String groupId, String deploymentName) { - final Integer top = null; - return new PagedFlux<>( - () -> listAtManagementGroupScopeSinglePageAsync(groupId, deploymentName, top), - nextLink -> listAtManagementGroupScopeNextSinglePageAsync(nextLink)); - } - - /** - * Gets all deployments operations for a deployment. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param top The number of results to return. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments operations for a deployment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAtManagementGroupScopeAsync( - String groupId, String deploymentName, Integer top, Context context) { - return new PagedFlux<>( - () -> listAtManagementGroupScopeSinglePageAsync(groupId, deploymentName, top, context), - nextLink -> listAtManagementGroupScopeNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all deployments operations for a deployment. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments operations for a deployment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAtManagementGroupScope(String groupId, String deploymentName) { - final Integer top = null; - return new PagedIterable<>(listAtManagementGroupScopeAsync(groupId, deploymentName, top)); - } - - /** - * Gets all deployments operations for a deployment. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param top The number of results to return. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments operations for a deployment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAtManagementGroupScope( - String groupId, String deploymentName, Integer top, Context context) { - return new PagedIterable<>(listAtManagementGroupScopeAsync(groupId, deploymentName, top, context)); - } - - /** - * Gets a deployments operation. - * - * @param deploymentName The name of the deployment. - * @param operationId The ID of the operation to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployments operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getAtSubscriptionScopeWithResponseAsync( - String deploymentName, String operationId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - if (operationId == null) { - return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getAtSubscriptionScope( - this.client.getEndpoint(), - deploymentName, - operationId, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a deployments operation. - * - * @param deploymentName The name of the deployment. - * @param operationId The ID of the operation to get. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployments operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getAtSubscriptionScopeWithResponseAsync( - String deploymentName, String operationId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - if (operationId == null) { - return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getAtSubscriptionScope( - this.client.getEndpoint(), - deploymentName, - operationId, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets a deployments operation. - * - * @param deploymentName The name of the deployment. - * @param operationId The ID of the operation to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployments operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAtSubscriptionScopeAsync(String deploymentName, String operationId) { - return getAtSubscriptionScopeWithResponseAsync(deploymentName, operationId) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a deployments operation. - * - * @param deploymentName The name of the deployment. - * @param operationId The ID of the operation to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployments operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentOperationInner getAtSubscriptionScope(String deploymentName, String operationId) { - return getAtSubscriptionScopeAsync(deploymentName, operationId).block(); - } - - /** - * Gets a deployments operation. - * - * @param deploymentName The name of the deployment. - * @param operationId The ID of the operation to get. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployments operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getAtSubscriptionScopeWithResponse( - String deploymentName, String operationId, Context context) { - return getAtSubscriptionScopeWithResponseAsync(deploymentName, operationId, context).block(); - } - - /** - * Gets all deployments operations for a deployment. - * - * @param deploymentName The name of the deployment. - * @param top The number of results to return. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments operations for a deployment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAtSubscriptionScopeSinglePageAsync( - String deploymentName, Integer top) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listAtSubscriptionScope( - this.client.getEndpoint(), - deploymentName, - top, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all deployments operations for a deployment. - * - * @param deploymentName The name of the deployment. - * @param top The number of results to return. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments operations for a deployment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAtSubscriptionScopeSinglePageAsync( - String deploymentName, Integer top, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listAtSubscriptionScope( - this.client.getEndpoint(), - deploymentName, - top, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all deployments operations for a deployment. - * - * @param deploymentName The name of the deployment. - * @param top The number of results to return. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments operations for a deployment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAtSubscriptionScopeAsync(String deploymentName, Integer top) { - return new PagedFlux<>( - () -> listAtSubscriptionScopeSinglePageAsync(deploymentName, top), - nextLink -> listAtSubscriptionScopeNextSinglePageAsync(nextLink)); - } - - /** - * Gets all deployments operations for a deployment. - * - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments operations for a deployment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAtSubscriptionScopeAsync(String deploymentName) { - final Integer top = null; - return new PagedFlux<>( - () -> listAtSubscriptionScopeSinglePageAsync(deploymentName, top), - nextLink -> listAtSubscriptionScopeNextSinglePageAsync(nextLink)); - } - - /** - * Gets all deployments operations for a deployment. - * - * @param deploymentName The name of the deployment. - * @param top The number of results to return. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments operations for a deployment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAtSubscriptionScopeAsync( - String deploymentName, Integer top, Context context) { - return new PagedFlux<>( - () -> listAtSubscriptionScopeSinglePageAsync(deploymentName, top, context), - nextLink -> listAtSubscriptionScopeNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all deployments operations for a deployment. - * - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments operations for a deployment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAtSubscriptionScope(String deploymentName) { - final Integer top = null; - return new PagedIterable<>(listAtSubscriptionScopeAsync(deploymentName, top)); - } - - /** - * Gets all deployments operations for a deployment. - * - * @param deploymentName The name of the deployment. - * @param top The number of results to return. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments operations for a deployment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAtSubscriptionScope( - String deploymentName, Integer top, Context context) { - return new PagedIterable<>(listAtSubscriptionScopeAsync(deploymentName, top, context)); - } - - /** - * Gets a deployments operation. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of the deployment. - * @param operationId The ID of the operation to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployments operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String resourceGroupName, String deploymentName, String operationId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - if (operationId == null) { - return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - resourceGroupName, - deploymentName, - operationId, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a deployments operation. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of the deployment. - * @param operationId The ID of the operation to get. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployments operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String deploymentName, String operationId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - if (operationId == null) { - return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - resourceGroupName, - deploymentName, - operationId, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets a deployments operation. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of the deployment. - * @param operationId The ID of the operation to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployments operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync( - String resourceGroupName, String deploymentName, String operationId) { - return getWithResponseAsync(resourceGroupName, deploymentName, operationId) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a deployments operation. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of the deployment. - * @param operationId The ID of the operation to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployments operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentOperationInner get(String resourceGroupName, String deploymentName, String operationId) { - return getAsync(resourceGroupName, deploymentName, operationId).block(); - } - - /** - * Gets a deployments operation. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of the deployment. - * @param operationId The ID of the operation to get. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployments operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String deploymentName, String operationId, Context context) { - return getWithResponseAsync(resourceGroupName, deploymentName, operationId, context).block(); - } - - /** - * Gets all deployments operations for a deployment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of the deployment. - * @param top The number of results to return. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments operations for a deployment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, String deploymentName, Integer top) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - deploymentName, - top, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all deployments operations for a deployment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of the deployment. - * @param top The number of results to return. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments operations for a deployment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, String deploymentName, Integer top, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - deploymentName, - top, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all deployments operations for a deployment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of the deployment. - * @param top The number of results to return. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments operations for a deployment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync( - String resourceGroupName, String deploymentName, Integer top) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, deploymentName, top), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets all deployments operations for a deployment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments operations for a deployment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync( - String resourceGroupName, String deploymentName) { - final Integer top = null; - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, deploymentName, top), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets all deployments operations for a deployment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of the deployment. - * @param top The number of results to return. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments operations for a deployment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync( - String resourceGroupName, String deploymentName, Integer top, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, deploymentName, top, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all deployments operations for a deployment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments operations for a deployment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup( - String resourceGroupName, String deploymentName) { - final Integer top = null; - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, deploymentName, top)); - } - - /** - * Gets all deployments operations for a deployment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of the deployment. - * @param top The number of results to return. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments operations for a deployment. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup( - String resourceGroupName, String deploymentName, Integer top, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, deploymentName, top, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of deployment operations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAtScopeNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listAtScopeNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of deployment operations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAtScopeNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listAtScopeNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of deployment operations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAtTenantScopeNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listAtTenantScopeNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of deployment operations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAtTenantScopeNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listAtTenantScopeNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of deployment operations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAtManagementGroupScopeNextSinglePageAsync( - String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listAtManagementGroupScopeNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of deployment operations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAtManagementGroupScopeNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listAtManagementGroupScopeNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of deployment operations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAtSubscriptionScopeNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listAtSubscriptionScopeNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of deployment operations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAtSubscriptionScopeNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listAtSubscriptionScopeNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of deployment operations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of deployment operations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/DeploymentOperationsImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/DeploymentOperationsImpl.java deleted file mode 100644 index f038b46c9b32..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/DeploymentOperationsImpl.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.resources.models.Deployment; -import com.azure.resourcemanager.resources.models.DeploymentOperation; -import com.azure.resourcemanager.resources.models.DeploymentOperations; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.ReadableWrappersImpl; -import com.azure.resourcemanager.resources.fluent.models.DeploymentOperationInner; -import com.azure.resourcemanager.resources.fluent.DeploymentOperationsClient; -import reactor.core.publisher.Mono; - -/** - * The implementation of {@link DeploymentOperations}. - */ -final class DeploymentOperationsImpl - extends ReadableWrappersImpl - implements DeploymentOperations { - private final DeploymentOperationsClient client; - private final Deployment deployment; - - DeploymentOperationsImpl(final DeploymentOperationsClient client, - final Deployment deployment) { - this.client = client; - this.deployment = deployment; - } - - @Override - public PagedIterable list() { - return wrapList(client.listByResourceGroup(deployment.resourceGroupName(), deployment.name())); - } - - @Override - public DeploymentOperation getById(String operationId) { - return getByIdAsync(operationId).block(); - } - - @Override - public Mono getByIdAsync(String operationId) { - return client.getAsync(deployment.resourceGroupName(), deployment.name(), operationId) - .map(deploymentOperationInner -> wrapModel(deploymentOperationInner)); - } - - @Override - protected DeploymentOperationImpl wrapModel(DeploymentOperationInner inner) { - if (inner == null) { - return null; - } - return new DeploymentOperationImpl(inner, this.client); - } - - @Override - public PagedFlux listAsync() { - return wrapPageAsync(this.client - .listAtManagementGroupScopeAsync(deployment.resourceGroupName(), deployment.name())); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/DeploymentsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/DeploymentsClientImpl.java deleted file mode 100644 index 83418579c24c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/DeploymentsClientImpl.java +++ /dev/null @@ -1,9659 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.Head; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.resources.fluent.DeploymentsClient; -import com.azure.resourcemanager.resources.fluent.models.DeploymentExportResultInner; -import com.azure.resourcemanager.resources.fluent.models.DeploymentExtendedInner; -import com.azure.resourcemanager.resources.fluent.models.DeploymentInner; -import com.azure.resourcemanager.resources.fluent.models.DeploymentValidateResultInner; -import com.azure.resourcemanager.resources.fluent.models.TemplateHashResultInner; -import com.azure.resourcemanager.resources.fluent.models.WhatIfOperationResultInner; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import com.azure.resourcemanager.resources.models.DeploymentListResult; -import com.azure.resourcemanager.resources.models.DeploymentWhatIf; -import com.azure.resourcemanager.resources.models.ScopedDeployment; -import com.azure.resourcemanager.resources.models.ScopedDeploymentWhatIf; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in DeploymentsClient. */ -public final class DeploymentsClientImpl - implements InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete, - DeploymentsClient { - private final ClientLogger logger = new ClientLogger(DeploymentsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final DeploymentsService service; - - /** The service client containing this operation class. */ - private final ResourceManagementClientImpl client; - - /** - * Initializes an instance of DeploymentsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - DeploymentsClientImpl(ResourceManagementClientImpl client) { - this.service = - RestProxy.create(DeploymentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for ResourceManagementClientDeployments to be used by the proxy service - * to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "ResourceManagementCl") - private interface DeploymentsService { - @Headers({"Content-Type: application/json"}) - @Delete("/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}") - @ExpectedResponses({202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> deleteAtScope( - @HostParam("$host") String endpoint, - @PathParam(value = "scope", encoded = true) String scope, - @PathParam("deploymentName") String deploymentName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Head("/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}") - @ExpectedResponses({204, 404}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> checkExistenceAtScope( - @HostParam("$host") String endpoint, - @PathParam(value = "scope", encoded = true) String scope, - @PathParam("deploymentName") String deploymentName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put("/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdateAtScope( - @HostParam("$host") String endpoint, - @PathParam(value = "scope", encoded = true) String scope, - @PathParam("deploymentName") String deploymentName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") DeploymentInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getAtScope( - @HostParam("$host") String endpoint, - @PathParam(value = "scope", encoded = true) String scope, - @PathParam("deploymentName") String deploymentName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post("/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel") - @ExpectedResponses({204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> cancelAtScope( - @HostParam("$host") String endpoint, - @PathParam(value = "scope", encoded = true) String scope, - @PathParam("deploymentName") String deploymentName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post("/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}/validate") - @ExpectedResponses({200, 202, 400}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> validateAtScope( - @HostParam("$host") String endpoint, - @PathParam(value = "scope", encoded = true) String scope, - @PathParam("deploymentName") String deploymentName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") DeploymentInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post("/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> exportTemplateAtScope( - @HostParam("$host") String endpoint, - @PathParam(value = "scope", encoded = true) String scope, - @PathParam("deploymentName") String deploymentName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/{scope}/providers/Microsoft.Resources/deployments/") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAtScope( - @HostParam("$host") String endpoint, - @PathParam(value = "scope", encoded = true) String scope, - @QueryParam("$filter") String filter, - @QueryParam("$top") Integer top, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete("/providers/Microsoft.Resources/deployments/{deploymentName}") - @ExpectedResponses({202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> deleteAtTenantScope( - @HostParam("$host") String endpoint, - @PathParam("deploymentName") String deploymentName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Head("/providers/Microsoft.Resources/deployments/{deploymentName}") - @ExpectedResponses({204, 404}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> checkExistenceAtTenantScope( - @HostParam("$host") String endpoint, - @PathParam("deploymentName") String deploymentName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put("/providers/Microsoft.Resources/deployments/{deploymentName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdateAtTenantScope( - @HostParam("$host") String endpoint, - @PathParam("deploymentName") String deploymentName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ScopedDeployment parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/providers/Microsoft.Resources/deployments/{deploymentName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getAtTenantScope( - @HostParam("$host") String endpoint, - @PathParam("deploymentName") String deploymentName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post("/providers/Microsoft.Resources/deployments/{deploymentName}/cancel") - @ExpectedResponses({204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> cancelAtTenantScope( - @HostParam("$host") String endpoint, - @PathParam("deploymentName") String deploymentName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post("/providers/Microsoft.Resources/deployments/{deploymentName}/validate") - @ExpectedResponses({200, 202, 400}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> validateAtTenantScope( - @HostParam("$host") String endpoint, - @PathParam("deploymentName") String deploymentName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ScopedDeployment parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post("/providers/Microsoft.Resources/deployments/{deploymentName}/whatIf") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> whatIfAtTenantScope( - @HostParam("$host") String endpoint, - @PathParam("deploymentName") String deploymentName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ScopedDeploymentWhatIf parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post("/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> exportTemplateAtTenantScope( - @HostParam("$host") String endpoint, - @PathParam("deploymentName") String deploymentName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/providers/Microsoft.Resources/deployments/") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAtTenantScope( - @HostParam("$host") String endpoint, - @QueryParam("$filter") String filter, - @QueryParam("$top") Integer top, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments" - + "/{deploymentName}") - @ExpectedResponses({202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> deleteAtManagementGroupScope( - @HostParam("$host") String endpoint, - @PathParam("groupId") String groupId, - @PathParam("deploymentName") String deploymentName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Head( - "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments" - + "/{deploymentName}") - @ExpectedResponses({204, 404}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> checkExistenceAtManagementGroupScope( - @HostParam("$host") String endpoint, - @PathParam("groupId") String groupId, - @PathParam("deploymentName") String deploymentName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments" - + "/{deploymentName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdateAtManagementGroupScope( - @HostParam("$host") String endpoint, - @PathParam("groupId") String groupId, - @PathParam("deploymentName") String deploymentName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ScopedDeployment parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments" - + "/{deploymentName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getAtManagementGroupScope( - @HostParam("$host") String endpoint, - @PathParam("groupId") String groupId, - @PathParam("deploymentName") String deploymentName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments" - + "/{deploymentName}/cancel") - @ExpectedResponses({204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> cancelAtManagementGroupScope( - @HostParam("$host") String endpoint, - @PathParam("groupId") String groupId, - @PathParam("deploymentName") String deploymentName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments" - + "/{deploymentName}/validate") - @ExpectedResponses({200, 202, 400}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> validateAtManagementGroupScope( - @HostParam("$host") String endpoint, - @PathParam("groupId") String groupId, - @PathParam("deploymentName") String deploymentName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ScopedDeployment parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments" - + "/{deploymentName}/whatIf") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> whatIfAtManagementGroupScope( - @HostParam("$host") String endpoint, - @PathParam("groupId") String groupId, - @PathParam("deploymentName") String deploymentName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ScopedDeploymentWhatIf parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments" - + "/{deploymentName}/exportTemplate") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> exportTemplateAtManagementGroupScope( - @HostParam("$host") String endpoint, - @PathParam("groupId") String groupId, - @PathParam("deploymentName") String deploymentName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAtManagementGroupScope( - @HostParam("$host") String endpoint, - @PathParam("groupId") String groupId, - @QueryParam("$filter") String filter, - @QueryParam("$top") Integer top, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete("/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}") - @ExpectedResponses({202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> deleteAtSubscriptionScope( - @HostParam("$host") String endpoint, - @PathParam("deploymentName") String deploymentName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Head("/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}") - @ExpectedResponses({204, 404}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> checkExistenceAtSubscriptionScope( - @HostParam("$host") String endpoint, - @PathParam("deploymentName") String deploymentName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put("/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdateAtSubscriptionScope( - @HostParam("$host") String endpoint, - @PathParam("deploymentName") String deploymentName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") DeploymentInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getAtSubscriptionScope( - @HostParam("$host") String endpoint, - @PathParam("deploymentName") String deploymentName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel") - @ExpectedResponses({204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> cancelAtSubscriptionScope( - @HostParam("$host") String endpoint, - @PathParam("deploymentName") String deploymentName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/validate") - @ExpectedResponses({200, 202, 400}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> validateAtSubscriptionScope( - @HostParam("$host") String endpoint, - @PathParam("deploymentName") String deploymentName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") DeploymentInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/whatIf") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> whatIfAtSubscriptionScope( - @HostParam("$host") String endpoint, - @PathParam("deploymentName") String deploymentName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") DeploymentWhatIf parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> exportTemplateAtSubscriptionScope( - @HostParam("$host") String endpoint, - @PathParam("deploymentName") String deploymentName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("$filter") String filter, - @QueryParam("$top") Integer top, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources" - + "/deployments/{deploymentName}") - @ExpectedResponses({202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("deploymentName") String deploymentName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Head( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources" - + "/deployments/{deploymentName}") - @ExpectedResponses({204, 404}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> checkExistence( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("deploymentName") String deploymentName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources" - + "/deployments/{deploymentName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("deploymentName") String deploymentName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") DeploymentInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources" - + "/deployments/{deploymentName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("deploymentName") String deploymentName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources" - + "/deployments/{deploymentName}/cancel") - @ExpectedResponses({204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> cancel( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("deploymentName") String deploymentName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources" - + "/deployments/{deploymentName}/validate") - @ExpectedResponses({200, 202, 400}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> validate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("deploymentName") String deploymentName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") DeploymentInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources" - + "/deployments/{deploymentName}/whatIf") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> whatIf( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("deploymentName") String deploymentName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") DeploymentWhatIf parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources" - + "/deployments/{deploymentName}/exportTemplate") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> exportTemplate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("deploymentName") String deploymentName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources" - + "/deployments/") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("$filter") String filter, - @QueryParam("$top") Integer top, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post("/providers/Microsoft.Resources/calculateTemplateHash") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> calculateTemplateHash( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") Object template, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAtScopeNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAtTenantScopeNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAtManagementGroupScopeNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAtSubscriptionScopeNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteAtScopeWithResponseAsync(String scope, String deploymentName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .deleteAtScope( - this.client.getEndpoint(), - scope, - deploymentName, - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteAtScopeWithResponseAsync( - String scope, String deploymentName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .deleteAtScope( - this.client.getEndpoint(), scope, deploymentName, this.client.getApiVersion(), accept, context); - } - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAtScopeAsync(String scope, String deploymentName) { - Mono>> mono = deleteAtScopeWithResponseAsync(scope, deploymentName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAtScopeAsync( - String scope, String deploymentName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteAtScopeWithResponseAsync(scope, deploymentName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDeleteAtScope(String scope, String deploymentName) { - return beginDeleteAtScopeAsync(scope, deploymentName).getSyncPoller(); - } - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDeleteAtScope(String scope, String deploymentName, Context context) { - return beginDeleteAtScopeAsync(scope, deploymentName, context).getSyncPoller(); - } - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAtScopeAsync(String scope, String deploymentName) { - return beginDeleteAtScopeAsync(scope, deploymentName).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAtScopeAsync(String scope, String deploymentName, Context context) { - return beginDeleteAtScopeAsync(scope, deploymentName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteAtScope(String scope, String deploymentName) { - deleteAtScopeAsync(scope, deploymentName).block(); - } - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteAtScope(String scope, String deploymentName, Context context) { - deleteAtScopeAsync(scope, deploymentName, context).block(); - } - - /** - * Checks whether the deployment exists. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> checkExistenceAtScopeWithResponseAsync(String scope, String deploymentName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .checkExistenceAtScope( - this.client.getEndpoint(), - scope, - deploymentName, - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Checks whether the deployment exists. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> checkExistenceAtScopeWithResponseAsync( - String scope, String deploymentName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .checkExistenceAtScope( - this.client.getEndpoint(), scope, deploymentName, this.client.getApiVersion(), accept, context); - } - - /** - * Checks whether the deployment exists. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono checkExistenceAtScopeAsync(String scope, String deploymentName) { - return checkExistenceAtScopeWithResponseAsync(scope, deploymentName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Checks whether the deployment exists. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public boolean checkExistenceAtScope(String scope, String deploymentName) { - Boolean value = checkExistenceAtScopeAsync(scope, deploymentName).block(); - if (value != null) { - return value; - } else { - throw logger.logExceptionAsError(new NullPointerException()); - } - } - - /** - * Checks whether the deployment exists. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response checkExistenceAtScopeWithResponse(String scope, String deploymentName, Context context) { - return checkExistenceAtScopeWithResponseAsync(scope, deploymentName, context).block(); - } - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateAtScopeWithResponseAsync( - String scope, String deploymentName, DeploymentInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdateAtScope( - this.client.getEndpoint(), - scope, - deploymentName, - this.client.getApiVersion(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateAtScopeWithResponseAsync( - String scope, String deploymentName, DeploymentInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdateAtScope( - this.client.getEndpoint(), - scope, - deploymentName, - this.client.getApiVersion(), - parameters, - accept, - context); - } - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, DeploymentExtendedInner> beginCreateOrUpdateAtScopeAsync( - String scope, String deploymentName, DeploymentInner parameters) { - Mono>> mono = - createOrUpdateAtScopeWithResponseAsync(scope, deploymentName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - DeploymentExtendedInner.class, - DeploymentExtendedInner.class, - Context.NONE); - } - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, DeploymentExtendedInner> beginCreateOrUpdateAtScopeAsync( - String scope, String deploymentName, DeploymentInner parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateAtScopeWithResponseAsync(scope, deploymentName, parameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - DeploymentExtendedInner.class, - DeploymentExtendedInner.class, - context); - } - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, DeploymentExtendedInner> beginCreateOrUpdateAtScope( - String scope, String deploymentName, DeploymentInner parameters) { - return beginCreateOrUpdateAtScopeAsync(scope, deploymentName, parameters).getSyncPoller(); - } - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, DeploymentExtendedInner> beginCreateOrUpdateAtScope( - String scope, String deploymentName, DeploymentInner parameters, Context context) { - return beginCreateOrUpdateAtScopeAsync(scope, deploymentName, parameters, context).getSyncPoller(); - } - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAtScopeAsync( - String scope, String deploymentName, DeploymentInner parameters) { - return beginCreateOrUpdateAtScopeAsync(scope, deploymentName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAtScopeAsync( - String scope, String deploymentName, DeploymentInner parameters, Context context) { - return beginCreateOrUpdateAtScopeAsync(scope, deploymentName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentExtendedInner createOrUpdateAtScope( - String scope, String deploymentName, DeploymentInner parameters) { - return createOrUpdateAtScopeAsync(scope, deploymentName, parameters).block(); - } - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentExtendedInner createOrUpdateAtScope( - String scope, String deploymentName, DeploymentInner parameters, Context context) { - return createOrUpdateAtScopeAsync(scope, deploymentName, parameters, context).block(); - } - - /** - * Gets a deployment. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getAtScopeWithResponseAsync(String scope, String deploymentName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getAtScope( - this.client.getEndpoint(), - scope, - deploymentName, - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a deployment. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getAtScopeWithResponseAsync( - String scope, String deploymentName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getAtScope(this.client.getEndpoint(), scope, deploymentName, this.client.getApiVersion(), accept, context); - } - - /** - * Gets a deployment. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAtScopeAsync(String scope, String deploymentName) { - return getAtScopeWithResponseAsync(scope, deploymentName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a deployment. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentExtendedInner getAtScope(String scope, String deploymentName) { - return getAtScopeAsync(scope, deploymentName).block(); - } - - /** - * Gets a deployment. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getAtScopeWithResponse( - String scope, String deploymentName, Context context) { - return getAtScopeWithResponseAsync(scope, deploymentName, context).block(); - } - - /** - * You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is - * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running - * template deployment and leaves the resources partially deployed. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> cancelAtScopeWithResponseAsync(String scope, String deploymentName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .cancelAtScope( - this.client.getEndpoint(), - scope, - deploymentName, - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is - * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running - * template deployment and leaves the resources partially deployed. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> cancelAtScopeWithResponseAsync(String scope, String deploymentName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .cancelAtScope( - this.client.getEndpoint(), scope, deploymentName, this.client.getApiVersion(), accept, context); - } - - /** - * You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is - * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running - * template deployment and leaves the resources partially deployed. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono cancelAtScopeAsync(String scope, String deploymentName) { - return cancelAtScopeWithResponseAsync(scope, deploymentName).flatMap((Response res) -> Mono.empty()); - } - - /** - * You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is - * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running - * template deployment and leaves the resources partially deployed. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void cancelAtScope(String scope, String deploymentName) { - cancelAtScopeAsync(scope, deploymentName).block(); - } - - /** - * You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is - * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running - * template deployment and leaves the resources partially deployed. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response cancelAtScopeWithResponse(String scope, String deploymentName, Context context) { - return cancelAtScopeWithResponseAsync(scope, deploymentName, context).block(); - } - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> validateAtScopeWithResponseAsync( - String scope, String deploymentName, DeploymentInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .validateAtScope( - this.client.getEndpoint(), - scope, - deploymentName, - this.client.getApiVersion(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> validateAtScopeWithResponseAsync( - String scope, String deploymentName, DeploymentInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .validateAtScope( - this.client.getEndpoint(), - scope, - deploymentName, - this.client.getApiVersion(), - parameters, - accept, - context); - } - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, DeploymentValidateResultInner> - beginValidateAtScopeAsync(String scope, String deploymentName, DeploymentInner parameters) { - Mono>> mono = validateAtScopeWithResponseAsync(scope, deploymentName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - DeploymentValidateResultInner.class, - DeploymentValidateResultInner.class, - Context.NONE); - } - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, DeploymentValidateResultInner> - beginValidateAtScopeAsync(String scope, String deploymentName, DeploymentInner parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - validateAtScopeWithResponseAsync(scope, deploymentName, parameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - DeploymentValidateResultInner.class, - DeploymentValidateResultInner.class, - context); - } - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, DeploymentValidateResultInner> beginValidateAtScope( - String scope, String deploymentName, DeploymentInner parameters) { - return beginValidateAtScopeAsync(scope, deploymentName, parameters).getSyncPoller(); - } - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, DeploymentValidateResultInner> beginValidateAtScope( - String scope, String deploymentName, DeploymentInner parameters, Context context) { - return beginValidateAtScopeAsync(scope, deploymentName, parameters, context).getSyncPoller(); - } - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono validateAtScopeAsync( - String scope, String deploymentName, DeploymentInner parameters) { - return beginValidateAtScopeAsync(scope, deploymentName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono validateAtScopeAsync( - String scope, String deploymentName, DeploymentInner parameters, Context context) { - return beginValidateAtScopeAsync(scope, deploymentName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentValidateResultInner validateAtScope( - String scope, String deploymentName, DeploymentInner parameters) { - return validateAtScopeAsync(scope, deploymentName, parameters).block(); - } - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentValidateResultInner validateAtScope( - String scope, String deploymentName, DeploymentInner parameters, Context context) { - return validateAtScopeAsync(scope, deploymentName, parameters, context).block(); - } - - /** - * Exports the template used for specified deployment. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deployment export result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> exportTemplateAtScopeWithResponseAsync( - String scope, String deploymentName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .exportTemplateAtScope( - this.client.getEndpoint(), - scope, - deploymentName, - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Exports the template used for specified deployment. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deployment export result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> exportTemplateAtScopeWithResponseAsync( - String scope, String deploymentName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .exportTemplateAtScope( - this.client.getEndpoint(), scope, deploymentName, this.client.getApiVersion(), accept, context); - } - - /** - * Exports the template used for specified deployment. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deployment export result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono exportTemplateAtScopeAsync(String scope, String deploymentName) { - return exportTemplateAtScopeWithResponseAsync(scope, deploymentName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Exports the template used for specified deployment. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deployment export result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentExportResultInner exportTemplateAtScope(String scope, String deploymentName) { - return exportTemplateAtScopeAsync(scope, deploymentName).block(); - } - - /** - * Exports the template used for specified deployment. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deployment export result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response exportTemplateAtScopeWithResponse( - String scope, String deploymentName, Context context) { - return exportTemplateAtScopeWithResponseAsync(scope, deploymentName, context).block(); - } - - /** - * Get all the deployments at the given scope. - * - * @param scope The resource scope. - * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq - * '{state}'. - * @param top The number of results to get. If null is passed, returns all deployments. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the deployments at the given scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAtScopeSinglePageAsync( - String scope, String filter, Integer top) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listAtScope( - this.client.getEndpoint(), - scope, - filter, - top, - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get all the deployments at the given scope. - * - * @param scope The resource scope. - * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq - * '{state}'. - * @param top The number of results to get. If null is passed, returns all deployments. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the deployments at the given scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAtScopeSinglePageAsync( - String scope, String filter, Integer top, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listAtScope(this.client.getEndpoint(), scope, filter, top, this.client.getApiVersion(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get all the deployments at the given scope. - * - * @param scope The resource scope. - * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq - * '{state}'. - * @param top The number of results to get. If null is passed, returns all deployments. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the deployments at the given scope. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAtScopeAsync(String scope, String filter, Integer top) { - return new PagedFlux<>( - () -> listAtScopeSinglePageAsync(scope, filter, top), nextLink -> listAtScopeNextSinglePageAsync(nextLink)); - } - - /** - * Get all the deployments at the given scope. - * - * @param scope The resource scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the deployments at the given scope. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAtScopeAsync(String scope) { - final String filter = null; - final Integer top = null; - return new PagedFlux<>( - () -> listAtScopeSinglePageAsync(scope, filter, top), nextLink -> listAtScopeNextSinglePageAsync(nextLink)); - } - - /** - * Get all the deployments at the given scope. - * - * @param scope The resource scope. - * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq - * '{state}'. - * @param top The number of results to get. If null is passed, returns all deployments. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the deployments at the given scope. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAtScopeAsync( - String scope, String filter, Integer top, Context context) { - return new PagedFlux<>( - () -> listAtScopeSinglePageAsync(scope, filter, top, context), - nextLink -> listAtScopeNextSinglePageAsync(nextLink, context)); - } - - /** - * Get all the deployments at the given scope. - * - * @param scope The resource scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the deployments at the given scope. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAtScope(String scope) { - final String filter = null; - final Integer top = null; - return new PagedIterable<>(listAtScopeAsync(scope, filter, top)); - } - - /** - * Get all the deployments at the given scope. - * - * @param scope The resource scope. - * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq - * '{state}'. - * @param top The number of results to get. If null is passed, returns all deployments. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the deployments at the given scope. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAtScope( - String scope, String filter, Integer top, Context context) { - return new PagedIterable<>(listAtScopeAsync(scope, filter, top, context)); - } - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. - * - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteAtTenantScopeWithResponseAsync(String deploymentName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .deleteAtTenantScope( - this.client.getEndpoint(), deploymentName, this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. - * - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteAtTenantScopeWithResponseAsync( - String deploymentName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .deleteAtTenantScope( - this.client.getEndpoint(), deploymentName, this.client.getApiVersion(), accept, context); - } - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. - * - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAtTenantScopeAsync(String deploymentName) { - Mono>> mono = deleteAtTenantScopeWithResponseAsync(deploymentName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. - * - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAtTenantScopeAsync(String deploymentName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteAtTenantScopeWithResponseAsync(deploymentName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. - * - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDeleteAtTenantScope(String deploymentName) { - return beginDeleteAtTenantScopeAsync(deploymentName).getSyncPoller(); - } - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. - * - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDeleteAtTenantScope(String deploymentName, Context context) { - return beginDeleteAtTenantScopeAsync(deploymentName, context).getSyncPoller(); - } - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. - * - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAtTenantScopeAsync(String deploymentName) { - return beginDeleteAtTenantScopeAsync(deploymentName).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. - * - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAtTenantScopeAsync(String deploymentName, Context context) { - return beginDeleteAtTenantScopeAsync(deploymentName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. - * - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteAtTenantScope(String deploymentName) { - deleteAtTenantScopeAsync(deploymentName).block(); - } - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. - * - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteAtTenantScope(String deploymentName, Context context) { - deleteAtTenantScopeAsync(deploymentName, context).block(); - } - - /** - * Checks whether the deployment exists. - * - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> checkExistenceAtTenantScopeWithResponseAsync(String deploymentName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .checkExistenceAtTenantScope( - this.client.getEndpoint(), deploymentName, this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Checks whether the deployment exists. - * - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> checkExistenceAtTenantScopeWithResponseAsync( - String deploymentName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .checkExistenceAtTenantScope( - this.client.getEndpoint(), deploymentName, this.client.getApiVersion(), accept, context); - } - - /** - * Checks whether the deployment exists. - * - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono checkExistenceAtTenantScopeAsync(String deploymentName) { - return checkExistenceAtTenantScopeWithResponseAsync(deploymentName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Checks whether the deployment exists. - * - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public boolean checkExistenceAtTenantScope(String deploymentName) { - Boolean value = checkExistenceAtTenantScopeAsync(deploymentName).block(); - if (value != null) { - return value; - } else { - throw logger.logExceptionAsError(new NullPointerException()); - } - } - - /** - * Checks whether the deployment exists. - * - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response checkExistenceAtTenantScopeWithResponse(String deploymentName, Context context) { - return checkExistenceAtTenantScopeWithResponseAsync(deploymentName, context).block(); - } - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateAtTenantScopeWithResponseAsync( - String deploymentName, ScopedDeployment parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdateAtTenantScope( - this.client.getEndpoint(), - deploymentName, - this.client.getApiVersion(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateAtTenantScopeWithResponseAsync( - String deploymentName, ScopedDeployment parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdateAtTenantScope( - this.client.getEndpoint(), deploymentName, this.client.getApiVersion(), parameters, accept, context); - } - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, DeploymentExtendedInner> - beginCreateOrUpdateAtTenantScopeAsync(String deploymentName, ScopedDeployment parameters) { - Mono>> mono = - createOrUpdateAtTenantScopeWithResponseAsync(deploymentName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - DeploymentExtendedInner.class, - DeploymentExtendedInner.class, - Context.NONE); - } - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, DeploymentExtendedInner> - beginCreateOrUpdateAtTenantScopeAsync(String deploymentName, ScopedDeployment parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateAtTenantScopeWithResponseAsync(deploymentName, parameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - DeploymentExtendedInner.class, - DeploymentExtendedInner.class, - context); - } - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, DeploymentExtendedInner> beginCreateOrUpdateAtTenantScope( - String deploymentName, ScopedDeployment parameters) { - return beginCreateOrUpdateAtTenantScopeAsync(deploymentName, parameters).getSyncPoller(); - } - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, DeploymentExtendedInner> beginCreateOrUpdateAtTenantScope( - String deploymentName, ScopedDeployment parameters, Context context) { - return beginCreateOrUpdateAtTenantScopeAsync(deploymentName, parameters, context).getSyncPoller(); - } - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAtTenantScopeAsync( - String deploymentName, ScopedDeployment parameters) { - return beginCreateOrUpdateAtTenantScopeAsync(deploymentName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAtTenantScopeAsync( - String deploymentName, ScopedDeployment parameters, Context context) { - return beginCreateOrUpdateAtTenantScopeAsync(deploymentName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentExtendedInner createOrUpdateAtTenantScope(String deploymentName, ScopedDeployment parameters) { - return createOrUpdateAtTenantScopeAsync(deploymentName, parameters).block(); - } - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentExtendedInner createOrUpdateAtTenantScope( - String deploymentName, ScopedDeployment parameters, Context context) { - return createOrUpdateAtTenantScopeAsync(deploymentName, parameters, context).block(); - } - - /** - * Gets a deployment. - * - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getAtTenantScopeWithResponseAsync(String deploymentName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getAtTenantScope( - this.client.getEndpoint(), deploymentName, this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a deployment. - * - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getAtTenantScopeWithResponseAsync( - String deploymentName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getAtTenantScope(this.client.getEndpoint(), deploymentName, this.client.getApiVersion(), accept, context); - } - - /** - * Gets a deployment. - * - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAtTenantScopeAsync(String deploymentName) { - return getAtTenantScopeWithResponseAsync(deploymentName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a deployment. - * - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentExtendedInner getAtTenantScope(String deploymentName) { - return getAtTenantScopeAsync(deploymentName).block(); - } - - /** - * Gets a deployment. - * - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getAtTenantScopeWithResponse(String deploymentName, Context context) { - return getAtTenantScopeWithResponseAsync(deploymentName, context).block(); - } - - /** - * You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is - * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running - * template deployment and leaves the resources partially deployed. - * - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> cancelAtTenantScopeWithResponseAsync(String deploymentName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .cancelAtTenantScope( - this.client.getEndpoint(), deploymentName, this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is - * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running - * template deployment and leaves the resources partially deployed. - * - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> cancelAtTenantScopeWithResponseAsync(String deploymentName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .cancelAtTenantScope( - this.client.getEndpoint(), deploymentName, this.client.getApiVersion(), accept, context); - } - - /** - * You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is - * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running - * template deployment and leaves the resources partially deployed. - * - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono cancelAtTenantScopeAsync(String deploymentName) { - return cancelAtTenantScopeWithResponseAsync(deploymentName).flatMap((Response res) -> Mono.empty()); - } - - /** - * You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is - * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running - * template deployment and leaves the resources partially deployed. - * - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void cancelAtTenantScope(String deploymentName) { - cancelAtTenantScopeAsync(deploymentName).block(); - } - - /** - * You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is - * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running - * template deployment and leaves the resources partially deployed. - * - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response cancelAtTenantScopeWithResponse(String deploymentName, Context context) { - return cancelAtTenantScopeWithResponseAsync(deploymentName, context).block(); - } - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> validateAtTenantScopeWithResponseAsync( - String deploymentName, ScopedDeployment parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .validateAtTenantScope( - this.client.getEndpoint(), - deploymentName, - this.client.getApiVersion(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> validateAtTenantScopeWithResponseAsync( - String deploymentName, ScopedDeployment parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .validateAtTenantScope( - this.client.getEndpoint(), deploymentName, this.client.getApiVersion(), parameters, accept, context); - } - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, DeploymentValidateResultInner> - beginValidateAtTenantScopeAsync(String deploymentName, ScopedDeployment parameters) { - Mono>> mono = validateAtTenantScopeWithResponseAsync(deploymentName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - DeploymentValidateResultInner.class, - DeploymentValidateResultInner.class, - Context.NONE); - } - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, DeploymentValidateResultInner> - beginValidateAtTenantScopeAsync(String deploymentName, ScopedDeployment parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - validateAtTenantScopeWithResponseAsync(deploymentName, parameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - DeploymentValidateResultInner.class, - DeploymentValidateResultInner.class, - context); - } - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, DeploymentValidateResultInner> - beginValidateAtTenantScope(String deploymentName, ScopedDeployment parameters) { - return beginValidateAtTenantScopeAsync(deploymentName, parameters).getSyncPoller(); - } - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, DeploymentValidateResultInner> - beginValidateAtTenantScope(String deploymentName, ScopedDeployment parameters, Context context) { - return beginValidateAtTenantScopeAsync(deploymentName, parameters, context).getSyncPoller(); - } - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono validateAtTenantScopeAsync( - String deploymentName, ScopedDeployment parameters) { - return beginValidateAtTenantScopeAsync(deploymentName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono validateAtTenantScopeAsync( - String deploymentName, ScopedDeployment parameters, Context context) { - return beginValidateAtTenantScopeAsync(deploymentName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentValidateResultInner validateAtTenantScope(String deploymentName, ScopedDeployment parameters) { - return validateAtTenantScopeAsync(deploymentName, parameters).block(); - } - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentValidateResultInner validateAtTenantScope( - String deploymentName, ScopedDeployment parameters, Context context) { - return validateAtTenantScopeAsync(deploymentName, parameters, context).block(); - } - - /** - * Returns changes that will be made by the deployment if executed at the scope of the tenant group. - * - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the What-If operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> whatIfAtTenantScopeWithResponseAsync( - String deploymentName, ScopedDeploymentWhatIf parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .whatIfAtTenantScope( - this.client.getEndpoint(), - deploymentName, - this.client.getApiVersion(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns changes that will be made by the deployment if executed at the scope of the tenant group. - * - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the What-If operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> whatIfAtTenantScopeWithResponseAsync( - String deploymentName, ScopedDeploymentWhatIf parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .whatIfAtTenantScope( - this.client.getEndpoint(), deploymentName, this.client.getApiVersion(), parameters, accept, context); - } - - /** - * Returns changes that will be made by the deployment if executed at the scope of the tenant group. - * - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the What-If operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, WhatIfOperationResultInner> beginWhatIfAtTenantScopeAsync( - String deploymentName, ScopedDeploymentWhatIf parameters) { - Mono>> mono = whatIfAtTenantScopeWithResponseAsync(deploymentName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - WhatIfOperationResultInner.class, - WhatIfOperationResultInner.class, - Context.NONE); - } - - /** - * Returns changes that will be made by the deployment if executed at the scope of the tenant group. - * - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the What-If operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, WhatIfOperationResultInner> - beginWhatIfAtTenantScopeAsync(String deploymentName, ScopedDeploymentWhatIf parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - whatIfAtTenantScopeWithResponseAsync(deploymentName, parameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - WhatIfOperationResultInner.class, - WhatIfOperationResultInner.class, - context); - } - - /** - * Returns changes that will be made by the deployment if executed at the scope of the tenant group. - * - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the What-If operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, WhatIfOperationResultInner> beginWhatIfAtTenantScope( - String deploymentName, ScopedDeploymentWhatIf parameters) { - return beginWhatIfAtTenantScopeAsync(deploymentName, parameters).getSyncPoller(); - } - - /** - * Returns changes that will be made by the deployment if executed at the scope of the tenant group. - * - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the What-If operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, WhatIfOperationResultInner> beginWhatIfAtTenantScope( - String deploymentName, ScopedDeploymentWhatIf parameters, Context context) { - return beginWhatIfAtTenantScopeAsync(deploymentName, parameters, context).getSyncPoller(); - } - - /** - * Returns changes that will be made by the deployment if executed at the scope of the tenant group. - * - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the What-If operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono whatIfAtTenantScopeAsync( - String deploymentName, ScopedDeploymentWhatIf parameters) { - return beginWhatIfAtTenantScopeAsync(deploymentName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Returns changes that will be made by the deployment if executed at the scope of the tenant group. - * - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the What-If operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono whatIfAtTenantScopeAsync( - String deploymentName, ScopedDeploymentWhatIf parameters, Context context) { - return beginWhatIfAtTenantScopeAsync(deploymentName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Returns changes that will be made by the deployment if executed at the scope of the tenant group. - * - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the What-If operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public WhatIfOperationResultInner whatIfAtTenantScope(String deploymentName, ScopedDeploymentWhatIf parameters) { - return whatIfAtTenantScopeAsync(deploymentName, parameters).block(); - } - - /** - * Returns changes that will be made by the deployment if executed at the scope of the tenant group. - * - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the What-If operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public WhatIfOperationResultInner whatIfAtTenantScope( - String deploymentName, ScopedDeploymentWhatIf parameters, Context context) { - return whatIfAtTenantScopeAsync(deploymentName, parameters, context).block(); - } - - /** - * Exports the template used for specified deployment. - * - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deployment export result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> exportTemplateAtTenantScopeWithResponseAsync( - String deploymentName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .exportTemplateAtTenantScope( - this.client.getEndpoint(), deploymentName, this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Exports the template used for specified deployment. - * - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deployment export result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> exportTemplateAtTenantScopeWithResponseAsync( - String deploymentName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .exportTemplateAtTenantScope( - this.client.getEndpoint(), deploymentName, this.client.getApiVersion(), accept, context); - } - - /** - * Exports the template used for specified deployment. - * - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deployment export result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono exportTemplateAtTenantScopeAsync(String deploymentName) { - return exportTemplateAtTenantScopeWithResponseAsync(deploymentName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Exports the template used for specified deployment. - * - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deployment export result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentExportResultInner exportTemplateAtTenantScope(String deploymentName) { - return exportTemplateAtTenantScopeAsync(deploymentName).block(); - } - - /** - * Exports the template used for specified deployment. - * - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deployment export result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response exportTemplateAtTenantScopeWithResponse( - String deploymentName, Context context) { - return exportTemplateAtTenantScopeWithResponseAsync(deploymentName, context).block(); - } - - /** - * Get all the deployments at the tenant scope. - * - * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq - * '{state}'. - * @param top The number of results to get. If null is passed, returns all deployments. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the deployments at the tenant scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAtTenantScopeSinglePageAsync(String filter, Integer top) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listAtTenantScope( - this.client.getEndpoint(), filter, top, this.client.getApiVersion(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get all the deployments at the tenant scope. - * - * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq - * '{state}'. - * @param top The number of results to get. If null is passed, returns all deployments. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the deployments at the tenant scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAtTenantScopeSinglePageAsync( - String filter, Integer top, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listAtTenantScope(this.client.getEndpoint(), filter, top, this.client.getApiVersion(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get all the deployments at the tenant scope. - * - * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq - * '{state}'. - * @param top The number of results to get. If null is passed, returns all deployments. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the deployments at the tenant scope. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAtTenantScopeAsync(String filter, Integer top) { - return new PagedFlux<>( - () -> listAtTenantScopeSinglePageAsync(filter, top), - nextLink -> listAtTenantScopeNextSinglePageAsync(nextLink)); - } - - /** - * Get all the deployments at the tenant scope. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the deployments at the tenant scope. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAtTenantScopeAsync() { - final String filter = null; - final Integer top = null; - return new PagedFlux<>( - () -> listAtTenantScopeSinglePageAsync(filter, top), - nextLink -> listAtTenantScopeNextSinglePageAsync(nextLink)); - } - - /** - * Get all the deployments at the tenant scope. - * - * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq - * '{state}'. - * @param top The number of results to get. If null is passed, returns all deployments. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the deployments at the tenant scope. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAtTenantScopeAsync(String filter, Integer top, Context context) { - return new PagedFlux<>( - () -> listAtTenantScopeSinglePageAsync(filter, top, context), - nextLink -> listAtTenantScopeNextSinglePageAsync(nextLink, context)); - } - - /** - * Get all the deployments at the tenant scope. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the deployments at the tenant scope. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAtTenantScope() { - final String filter = null; - final Integer top = null; - return new PagedIterable<>(listAtTenantScopeAsync(filter, top)); - } - - /** - * Get all the deployments at the tenant scope. - * - * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq - * '{state}'. - * @param top The number of results to get. If null is passed, returns all deployments. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the deployments at the tenant scope. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAtTenantScope(String filter, Integer top, Context context) { - return new PagedIterable<>(listAtTenantScopeAsync(filter, top, context)); - } - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteAtManagementGroupScopeWithResponseAsync( - String groupId, String deploymentName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (groupId == null) { - return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .deleteAtManagementGroupScope( - this.client.getEndpoint(), - groupId, - deploymentName, - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteAtManagementGroupScopeWithResponseAsync( - String groupId, String deploymentName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (groupId == null) { - return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .deleteAtManagementGroupScope( - this.client.getEndpoint(), groupId, deploymentName, this.client.getApiVersion(), accept, context); - } - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAtManagementGroupScopeAsync( - String groupId, String deploymentName) { - Mono>> mono = deleteAtManagementGroupScopeWithResponseAsync(groupId, deploymentName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAtManagementGroupScopeAsync( - String groupId, String deploymentName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - deleteAtManagementGroupScopeWithResponseAsync(groupId, deploymentName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDeleteAtManagementGroupScope(String groupId, String deploymentName) { - return beginDeleteAtManagementGroupScopeAsync(groupId, deploymentName).getSyncPoller(); - } - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDeleteAtManagementGroupScope( - String groupId, String deploymentName, Context context) { - return beginDeleteAtManagementGroupScopeAsync(groupId, deploymentName, context).getSyncPoller(); - } - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAtManagementGroupScopeAsync(String groupId, String deploymentName) { - return beginDeleteAtManagementGroupScopeAsync(groupId, deploymentName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAtManagementGroupScopeAsync(String groupId, String deploymentName, Context context) { - return beginDeleteAtManagementGroupScopeAsync(groupId, deploymentName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteAtManagementGroupScope(String groupId, String deploymentName) { - deleteAtManagementGroupScopeAsync(groupId, deploymentName).block(); - } - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteAtManagementGroupScope(String groupId, String deploymentName, Context context) { - deleteAtManagementGroupScopeAsync(groupId, deploymentName, context).block(); - } - - /** - * Checks whether the deployment exists. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> checkExistenceAtManagementGroupScopeWithResponseAsync( - String groupId, String deploymentName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (groupId == null) { - return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .checkExistenceAtManagementGroupScope( - this.client.getEndpoint(), - groupId, - deploymentName, - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Checks whether the deployment exists. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> checkExistenceAtManagementGroupScopeWithResponseAsync( - String groupId, String deploymentName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (groupId == null) { - return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .checkExistenceAtManagementGroupScope( - this.client.getEndpoint(), groupId, deploymentName, this.client.getApiVersion(), accept, context); - } - - /** - * Checks whether the deployment exists. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono checkExistenceAtManagementGroupScopeAsync(String groupId, String deploymentName) { - return checkExistenceAtManagementGroupScopeWithResponseAsync(groupId, deploymentName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Checks whether the deployment exists. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public boolean checkExistenceAtManagementGroupScope(String groupId, String deploymentName) { - Boolean value = checkExistenceAtManagementGroupScopeAsync(groupId, deploymentName).block(); - if (value != null) { - return value; - } else { - throw logger.logExceptionAsError(new NullPointerException()); - } - } - - /** - * Checks whether the deployment exists. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response checkExistenceAtManagementGroupScopeWithResponse( - String groupId, String deploymentName, Context context) { - return checkExistenceAtManagementGroupScopeWithResponseAsync(groupId, deploymentName, context).block(); - } - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateAtManagementGroupScopeWithResponseAsync( - String groupId, String deploymentName, ScopedDeployment parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (groupId == null) { - return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdateAtManagementGroupScope( - this.client.getEndpoint(), - groupId, - deploymentName, - this.client.getApiVersion(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateAtManagementGroupScopeWithResponseAsync( - String groupId, String deploymentName, ScopedDeployment parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (groupId == null) { - return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdateAtManagementGroupScope( - this.client.getEndpoint(), - groupId, - deploymentName, - this.client.getApiVersion(), - parameters, - accept, - context); - } - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, DeploymentExtendedInner> - beginCreateOrUpdateAtManagementGroupScopeAsync( - String groupId, String deploymentName, ScopedDeployment parameters) { - Mono>> mono = - createOrUpdateAtManagementGroupScopeWithResponseAsync(groupId, deploymentName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - DeploymentExtendedInner.class, - DeploymentExtendedInner.class, - Context.NONE); - } - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, DeploymentExtendedInner> - beginCreateOrUpdateAtManagementGroupScopeAsync( - String groupId, String deploymentName, ScopedDeployment parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateAtManagementGroupScopeWithResponseAsync(groupId, deploymentName, parameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - DeploymentExtendedInner.class, - DeploymentExtendedInner.class, - context); - } - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, DeploymentExtendedInner> - beginCreateOrUpdateAtManagementGroupScope(String groupId, String deploymentName, ScopedDeployment parameters) { - return beginCreateOrUpdateAtManagementGroupScopeAsync(groupId, deploymentName, parameters).getSyncPoller(); - } - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, DeploymentExtendedInner> - beginCreateOrUpdateAtManagementGroupScope( - String groupId, String deploymentName, ScopedDeployment parameters, Context context) { - return beginCreateOrUpdateAtManagementGroupScopeAsync(groupId, deploymentName, parameters, context) - .getSyncPoller(); - } - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAtManagementGroupScopeAsync( - String groupId, String deploymentName, ScopedDeployment parameters) { - return beginCreateOrUpdateAtManagementGroupScopeAsync(groupId, deploymentName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAtManagementGroupScopeAsync( - String groupId, String deploymentName, ScopedDeployment parameters, Context context) { - return beginCreateOrUpdateAtManagementGroupScopeAsync(groupId, deploymentName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentExtendedInner createOrUpdateAtManagementGroupScope( - String groupId, String deploymentName, ScopedDeployment parameters) { - return createOrUpdateAtManagementGroupScopeAsync(groupId, deploymentName, parameters).block(); - } - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentExtendedInner createOrUpdateAtManagementGroupScope( - String groupId, String deploymentName, ScopedDeployment parameters, Context context) { - return createOrUpdateAtManagementGroupScopeAsync(groupId, deploymentName, parameters, context).block(); - } - - /** - * Gets a deployment. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getAtManagementGroupScopeWithResponseAsync( - String groupId, String deploymentName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (groupId == null) { - return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getAtManagementGroupScope( - this.client.getEndpoint(), - groupId, - deploymentName, - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a deployment. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getAtManagementGroupScopeWithResponseAsync( - String groupId, String deploymentName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (groupId == null) { - return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getAtManagementGroupScope( - this.client.getEndpoint(), groupId, deploymentName, this.client.getApiVersion(), accept, context); - } - - /** - * Gets a deployment. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAtManagementGroupScopeAsync(String groupId, String deploymentName) { - return getAtManagementGroupScopeWithResponseAsync(groupId, deploymentName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a deployment. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentExtendedInner getAtManagementGroupScope(String groupId, String deploymentName) { - return getAtManagementGroupScopeAsync(groupId, deploymentName).block(); - } - - /** - * Gets a deployment. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getAtManagementGroupScopeWithResponse( - String groupId, String deploymentName, Context context) { - return getAtManagementGroupScopeWithResponseAsync(groupId, deploymentName, context).block(); - } - - /** - * You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is - * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running - * template deployment and leaves the resources partially deployed. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> cancelAtManagementGroupScopeWithResponseAsync(String groupId, String deploymentName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (groupId == null) { - return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .cancelAtManagementGroupScope( - this.client.getEndpoint(), - groupId, - deploymentName, - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is - * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running - * template deployment and leaves the resources partially deployed. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> cancelAtManagementGroupScopeWithResponseAsync( - String groupId, String deploymentName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (groupId == null) { - return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .cancelAtManagementGroupScope( - this.client.getEndpoint(), groupId, deploymentName, this.client.getApiVersion(), accept, context); - } - - /** - * You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is - * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running - * template deployment and leaves the resources partially deployed. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono cancelAtManagementGroupScopeAsync(String groupId, String deploymentName) { - return cancelAtManagementGroupScopeWithResponseAsync(groupId, deploymentName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is - * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running - * template deployment and leaves the resources partially deployed. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void cancelAtManagementGroupScope(String groupId, String deploymentName) { - cancelAtManagementGroupScopeAsync(groupId, deploymentName).block(); - } - - /** - * You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is - * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running - * template deployment and leaves the resources partially deployed. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response cancelAtManagementGroupScopeWithResponse( - String groupId, String deploymentName, Context context) { - return cancelAtManagementGroupScopeWithResponseAsync(groupId, deploymentName, context).block(); - } - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> validateAtManagementGroupScopeWithResponseAsync( - String groupId, String deploymentName, ScopedDeployment parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (groupId == null) { - return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .validateAtManagementGroupScope( - this.client.getEndpoint(), - groupId, - deploymentName, - this.client.getApiVersion(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> validateAtManagementGroupScopeWithResponseAsync( - String groupId, String deploymentName, ScopedDeployment parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (groupId == null) { - return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .validateAtManagementGroupScope( - this.client.getEndpoint(), - groupId, - deploymentName, - this.client.getApiVersion(), - parameters, - accept, - context); - } - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, DeploymentValidateResultInner> - beginValidateAtManagementGroupScopeAsync(String groupId, String deploymentName, ScopedDeployment parameters) { - Mono>> mono = - validateAtManagementGroupScopeWithResponseAsync(groupId, deploymentName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - DeploymentValidateResultInner.class, - DeploymentValidateResultInner.class, - Context.NONE); - } - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, DeploymentValidateResultInner> - beginValidateAtManagementGroupScopeAsync( - String groupId, String deploymentName, ScopedDeployment parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - validateAtManagementGroupScopeWithResponseAsync(groupId, deploymentName, parameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - DeploymentValidateResultInner.class, - DeploymentValidateResultInner.class, - context); - } - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, DeploymentValidateResultInner> - beginValidateAtManagementGroupScope(String groupId, String deploymentName, ScopedDeployment parameters) { - return beginValidateAtManagementGroupScopeAsync(groupId, deploymentName, parameters).getSyncPoller(); - } - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, DeploymentValidateResultInner> - beginValidateAtManagementGroupScope( - String groupId, String deploymentName, ScopedDeployment parameters, Context context) { - return beginValidateAtManagementGroupScopeAsync(groupId, deploymentName, parameters, context).getSyncPoller(); - } - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono validateAtManagementGroupScopeAsync( - String groupId, String deploymentName, ScopedDeployment parameters) { - return beginValidateAtManagementGroupScopeAsync(groupId, deploymentName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono validateAtManagementGroupScopeAsync( - String groupId, String deploymentName, ScopedDeployment parameters, Context context) { - return beginValidateAtManagementGroupScopeAsync(groupId, deploymentName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentValidateResultInner validateAtManagementGroupScope( - String groupId, String deploymentName, ScopedDeployment parameters) { - return validateAtManagementGroupScopeAsync(groupId, deploymentName, parameters).block(); - } - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentValidateResultInner validateAtManagementGroupScope( - String groupId, String deploymentName, ScopedDeployment parameters, Context context) { - return validateAtManagementGroupScopeAsync(groupId, deploymentName, parameters, context).block(); - } - - /** - * Returns changes that will be made by the deployment if executed at the scope of the management group. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the What-If operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> whatIfAtManagementGroupScopeWithResponseAsync( - String groupId, String deploymentName, ScopedDeploymentWhatIf parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (groupId == null) { - return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .whatIfAtManagementGroupScope( - this.client.getEndpoint(), - groupId, - deploymentName, - this.client.getApiVersion(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns changes that will be made by the deployment if executed at the scope of the management group. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the What-If operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> whatIfAtManagementGroupScopeWithResponseAsync( - String groupId, String deploymentName, ScopedDeploymentWhatIf parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (groupId == null) { - return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .whatIfAtManagementGroupScope( - this.client.getEndpoint(), - groupId, - deploymentName, - this.client.getApiVersion(), - parameters, - accept, - context); - } - - /** - * Returns changes that will be made by the deployment if executed at the scope of the management group. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the What-If operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, WhatIfOperationResultInner> - beginWhatIfAtManagementGroupScopeAsync( - String groupId, String deploymentName, ScopedDeploymentWhatIf parameters) { - Mono>> mono = - whatIfAtManagementGroupScopeWithResponseAsync(groupId, deploymentName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - WhatIfOperationResultInner.class, - WhatIfOperationResultInner.class, - Context.NONE); - } - - /** - * Returns changes that will be made by the deployment if executed at the scope of the management group. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the What-If operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, WhatIfOperationResultInner> - beginWhatIfAtManagementGroupScopeAsync( - String groupId, String deploymentName, ScopedDeploymentWhatIf parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - whatIfAtManagementGroupScopeWithResponseAsync(groupId, deploymentName, parameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - WhatIfOperationResultInner.class, - WhatIfOperationResultInner.class, - context); - } - - /** - * Returns changes that will be made by the deployment if executed at the scope of the management group. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the What-If operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, WhatIfOperationResultInner> - beginWhatIfAtManagementGroupScope(String groupId, String deploymentName, ScopedDeploymentWhatIf parameters) { - return beginWhatIfAtManagementGroupScopeAsync(groupId, deploymentName, parameters).getSyncPoller(); - } - - /** - * Returns changes that will be made by the deployment if executed at the scope of the management group. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the What-If operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, WhatIfOperationResultInner> - beginWhatIfAtManagementGroupScope( - String groupId, String deploymentName, ScopedDeploymentWhatIf parameters, Context context) { - return beginWhatIfAtManagementGroupScopeAsync(groupId, deploymentName, parameters, context).getSyncPoller(); - } - - /** - * Returns changes that will be made by the deployment if executed at the scope of the management group. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the What-If operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono whatIfAtManagementGroupScopeAsync( - String groupId, String deploymentName, ScopedDeploymentWhatIf parameters) { - return beginWhatIfAtManagementGroupScopeAsync(groupId, deploymentName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Returns changes that will be made by the deployment if executed at the scope of the management group. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the What-If operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono whatIfAtManagementGroupScopeAsync( - String groupId, String deploymentName, ScopedDeploymentWhatIf parameters, Context context) { - return beginWhatIfAtManagementGroupScopeAsync(groupId, deploymentName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Returns changes that will be made by the deployment if executed at the scope of the management group. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the What-If operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public WhatIfOperationResultInner whatIfAtManagementGroupScope( - String groupId, String deploymentName, ScopedDeploymentWhatIf parameters) { - return whatIfAtManagementGroupScopeAsync(groupId, deploymentName, parameters).block(); - } - - /** - * Returns changes that will be made by the deployment if executed at the scope of the management group. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the What-If operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public WhatIfOperationResultInner whatIfAtManagementGroupScope( - String groupId, String deploymentName, ScopedDeploymentWhatIf parameters, Context context) { - return whatIfAtManagementGroupScopeAsync(groupId, deploymentName, parameters, context).block(); - } - - /** - * Exports the template used for specified deployment. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deployment export result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> exportTemplateAtManagementGroupScopeWithResponseAsync( - String groupId, String deploymentName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (groupId == null) { - return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .exportTemplateAtManagementGroupScope( - this.client.getEndpoint(), - groupId, - deploymentName, - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Exports the template used for specified deployment. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deployment export result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> exportTemplateAtManagementGroupScopeWithResponseAsync( - String groupId, String deploymentName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (groupId == null) { - return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .exportTemplateAtManagementGroupScope( - this.client.getEndpoint(), groupId, deploymentName, this.client.getApiVersion(), accept, context); - } - - /** - * Exports the template used for specified deployment. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deployment export result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono exportTemplateAtManagementGroupScopeAsync( - String groupId, String deploymentName) { - return exportTemplateAtManagementGroupScopeWithResponseAsync(groupId, deploymentName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Exports the template used for specified deployment. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deployment export result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentExportResultInner exportTemplateAtManagementGroupScope(String groupId, String deploymentName) { - return exportTemplateAtManagementGroupScopeAsync(groupId, deploymentName).block(); - } - - /** - * Exports the template used for specified deployment. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deployment export result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response exportTemplateAtManagementGroupScopeWithResponse( - String groupId, String deploymentName, Context context) { - return exportTemplateAtManagementGroupScopeWithResponseAsync(groupId, deploymentName, context).block(); - } - - /** - * Get all the deployments for a management group. - * - * @param groupId The management group ID. - * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq - * '{state}'. - * @param top The number of results to get. If null is passed, returns all deployments. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the deployments for a management group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAtManagementGroupScopeSinglePageAsync( - String groupId, String filter, Integer top) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (groupId == null) { - return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listAtManagementGroupScope( - this.client.getEndpoint(), - groupId, - filter, - top, - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get all the deployments for a management group. - * - * @param groupId The management group ID. - * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq - * '{state}'. - * @param top The number of results to get. If null is passed, returns all deployments. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the deployments for a management group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAtManagementGroupScopeSinglePageAsync( - String groupId, String filter, Integer top, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (groupId == null) { - return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listAtManagementGroupScope( - this.client.getEndpoint(), groupId, filter, top, this.client.getApiVersion(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get all the deployments for a management group. - * - * @param groupId The management group ID. - * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq - * '{state}'. - * @param top The number of results to get. If null is passed, returns all deployments. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the deployments for a management group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAtManagementGroupScopeAsync( - String groupId, String filter, Integer top) { - return new PagedFlux<>( - () -> listAtManagementGroupScopeSinglePageAsync(groupId, filter, top), - nextLink -> listAtManagementGroupScopeNextSinglePageAsync(nextLink)); - } - - /** - * Get all the deployments for a management group. - * - * @param groupId The management group ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the deployments for a management group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAtManagementGroupScopeAsync(String groupId) { - final String filter = null; - final Integer top = null; - return new PagedFlux<>( - () -> listAtManagementGroupScopeSinglePageAsync(groupId, filter, top), - nextLink -> listAtManagementGroupScopeNextSinglePageAsync(nextLink)); - } - - /** - * Get all the deployments for a management group. - * - * @param groupId The management group ID. - * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq - * '{state}'. - * @param top The number of results to get. If null is passed, returns all deployments. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the deployments for a management group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAtManagementGroupScopeAsync( - String groupId, String filter, Integer top, Context context) { - return new PagedFlux<>( - () -> listAtManagementGroupScopeSinglePageAsync(groupId, filter, top, context), - nextLink -> listAtManagementGroupScopeNextSinglePageAsync(nextLink, context)); - } - - /** - * Get all the deployments for a management group. - * - * @param groupId The management group ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the deployments for a management group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAtManagementGroupScope(String groupId) { - final String filter = null; - final Integer top = null; - return new PagedIterable<>(listAtManagementGroupScopeAsync(groupId, filter, top)); - } - - /** - * Get all the deployments for a management group. - * - * @param groupId The management group ID. - * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq - * '{state}'. - * @param top The number of results to get. If null is passed, returns all deployments. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the deployments for a management group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAtManagementGroupScope( - String groupId, String filter, Integer top, Context context) { - return new PagedIterable<>(listAtManagementGroupScopeAsync(groupId, filter, top, context)); - } - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. - * - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteAtSubscriptionScopeWithResponseAsync(String deploymentName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .deleteAtSubscriptionScope( - this.client.getEndpoint(), - deploymentName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. - * - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteAtSubscriptionScopeWithResponseAsync( - String deploymentName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .deleteAtSubscriptionScope( - this.client.getEndpoint(), - deploymentName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. - * - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAtSubscriptionScopeAsync(String deploymentName) { - Mono>> mono = deleteAtSubscriptionScopeWithResponseAsync(deploymentName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. - * - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAtSubscriptionScopeAsync( - String deploymentName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteAtSubscriptionScopeWithResponseAsync(deploymentName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. - * - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDeleteAtSubscriptionScope(String deploymentName) { - return beginDeleteAtSubscriptionScopeAsync(deploymentName).getSyncPoller(); - } - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. - * - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDeleteAtSubscriptionScope(String deploymentName, Context context) { - return beginDeleteAtSubscriptionScopeAsync(deploymentName, context).getSyncPoller(); - } - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. - * - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAtSubscriptionScopeAsync(String deploymentName) { - return beginDeleteAtSubscriptionScopeAsync(deploymentName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. - * - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAtSubscriptionScopeAsync(String deploymentName, Context context) { - return beginDeleteAtSubscriptionScopeAsync(deploymentName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. - * - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteAtSubscriptionScope(String deploymentName) { - deleteAtSubscriptionScopeAsync(deploymentName).block(); - } - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. - * - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteAtSubscriptionScope(String deploymentName, Context context) { - deleteAtSubscriptionScopeAsync(deploymentName, context).block(); - } - - /** - * Checks whether the deployment exists. - * - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> checkExistenceAtSubscriptionScopeWithResponseAsync(String deploymentName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .checkExistenceAtSubscriptionScope( - this.client.getEndpoint(), - deploymentName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Checks whether the deployment exists. - * - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> checkExistenceAtSubscriptionScopeWithResponseAsync( - String deploymentName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .checkExistenceAtSubscriptionScope( - this.client.getEndpoint(), - deploymentName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Checks whether the deployment exists. - * - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono checkExistenceAtSubscriptionScopeAsync(String deploymentName) { - return checkExistenceAtSubscriptionScopeWithResponseAsync(deploymentName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Checks whether the deployment exists. - * - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public boolean checkExistenceAtSubscriptionScope(String deploymentName) { - Boolean value = checkExistenceAtSubscriptionScopeAsync(deploymentName).block(); - if (value != null) { - return value; - } else { - throw logger.logExceptionAsError(new NullPointerException()); - } - } - - /** - * Checks whether the deployment exists. - * - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response checkExistenceAtSubscriptionScopeWithResponse(String deploymentName, Context context) { - return checkExistenceAtSubscriptionScopeWithResponseAsync(deploymentName, context).block(); - } - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateAtSubscriptionScopeWithResponseAsync( - String deploymentName, DeploymentInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdateAtSubscriptionScope( - this.client.getEndpoint(), - deploymentName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateAtSubscriptionScopeWithResponseAsync( - String deploymentName, DeploymentInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdateAtSubscriptionScope( - this.client.getEndpoint(), - deploymentName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, DeploymentExtendedInner> - beginCreateOrUpdateAtSubscriptionScopeAsync(String deploymentName, DeploymentInner parameters) { - Mono>> mono = - createOrUpdateAtSubscriptionScopeWithResponseAsync(deploymentName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - DeploymentExtendedInner.class, - DeploymentExtendedInner.class, - Context.NONE); - } - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, DeploymentExtendedInner> - beginCreateOrUpdateAtSubscriptionScopeAsync( - String deploymentName, DeploymentInner parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateAtSubscriptionScopeWithResponseAsync(deploymentName, parameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - DeploymentExtendedInner.class, - DeploymentExtendedInner.class, - context); - } - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, DeploymentExtendedInner> - beginCreateOrUpdateAtSubscriptionScope(String deploymentName, DeploymentInner parameters) { - return beginCreateOrUpdateAtSubscriptionScopeAsync(deploymentName, parameters).getSyncPoller(); - } - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, DeploymentExtendedInner> - beginCreateOrUpdateAtSubscriptionScope(String deploymentName, DeploymentInner parameters, Context context) { - return beginCreateOrUpdateAtSubscriptionScopeAsync(deploymentName, parameters, context).getSyncPoller(); - } - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAtSubscriptionScopeAsync( - String deploymentName, DeploymentInner parameters) { - return beginCreateOrUpdateAtSubscriptionScopeAsync(deploymentName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAtSubscriptionScopeAsync( - String deploymentName, DeploymentInner parameters, Context context) { - return beginCreateOrUpdateAtSubscriptionScopeAsync(deploymentName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentExtendedInner createOrUpdateAtSubscriptionScope( - String deploymentName, DeploymentInner parameters) { - return createOrUpdateAtSubscriptionScopeAsync(deploymentName, parameters).block(); - } - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentExtendedInner createOrUpdateAtSubscriptionScope( - String deploymentName, DeploymentInner parameters, Context context) { - return createOrUpdateAtSubscriptionScopeAsync(deploymentName, parameters, context).block(); - } - - /** - * Gets a deployment. - * - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getAtSubscriptionScopeWithResponseAsync(String deploymentName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getAtSubscriptionScope( - this.client.getEndpoint(), - deploymentName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a deployment. - * - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getAtSubscriptionScopeWithResponseAsync( - String deploymentName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getAtSubscriptionScope( - this.client.getEndpoint(), - deploymentName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets a deployment. - * - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAtSubscriptionScopeAsync(String deploymentName) { - return getAtSubscriptionScopeWithResponseAsync(deploymentName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a deployment. - * - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentExtendedInner getAtSubscriptionScope(String deploymentName) { - return getAtSubscriptionScopeAsync(deploymentName).block(); - } - - /** - * Gets a deployment. - * - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getAtSubscriptionScopeWithResponse( - String deploymentName, Context context) { - return getAtSubscriptionScopeWithResponseAsync(deploymentName, context).block(); - } - - /** - * You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is - * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running - * template deployment and leaves the resources partially deployed. - * - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> cancelAtSubscriptionScopeWithResponseAsync(String deploymentName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .cancelAtSubscriptionScope( - this.client.getEndpoint(), - deploymentName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is - * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running - * template deployment and leaves the resources partially deployed. - * - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> cancelAtSubscriptionScopeWithResponseAsync(String deploymentName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .cancelAtSubscriptionScope( - this.client.getEndpoint(), - deploymentName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is - * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running - * template deployment and leaves the resources partially deployed. - * - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono cancelAtSubscriptionScopeAsync(String deploymentName) { - return cancelAtSubscriptionScopeWithResponseAsync(deploymentName).flatMap((Response res) -> Mono.empty()); - } - - /** - * You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is - * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running - * template deployment and leaves the resources partially deployed. - * - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void cancelAtSubscriptionScope(String deploymentName) { - cancelAtSubscriptionScopeAsync(deploymentName).block(); - } - - /** - * You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is - * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running - * template deployment and leaves the resources partially deployed. - * - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response cancelAtSubscriptionScopeWithResponse(String deploymentName, Context context) { - return cancelAtSubscriptionScopeWithResponseAsync(deploymentName, context).block(); - } - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> validateAtSubscriptionScopeWithResponseAsync( - String deploymentName, DeploymentInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .validateAtSubscriptionScope( - this.client.getEndpoint(), - deploymentName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> validateAtSubscriptionScopeWithResponseAsync( - String deploymentName, DeploymentInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .validateAtSubscriptionScope( - this.client.getEndpoint(), - deploymentName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, DeploymentValidateResultInner> - beginValidateAtSubscriptionScopeAsync(String deploymentName, DeploymentInner parameters) { - Mono>> mono = - validateAtSubscriptionScopeWithResponseAsync(deploymentName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - DeploymentValidateResultInner.class, - DeploymentValidateResultInner.class, - Context.NONE); - } - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, DeploymentValidateResultInner> - beginValidateAtSubscriptionScopeAsync(String deploymentName, DeploymentInner parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - validateAtSubscriptionScopeWithResponseAsync(deploymentName, parameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - DeploymentValidateResultInner.class, - DeploymentValidateResultInner.class, - context); - } - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, DeploymentValidateResultInner> - beginValidateAtSubscriptionScope(String deploymentName, DeploymentInner parameters) { - return beginValidateAtSubscriptionScopeAsync(deploymentName, parameters).getSyncPoller(); - } - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, DeploymentValidateResultInner> - beginValidateAtSubscriptionScope(String deploymentName, DeploymentInner parameters, Context context) { - return beginValidateAtSubscriptionScopeAsync(deploymentName, parameters, context).getSyncPoller(); - } - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono validateAtSubscriptionScopeAsync( - String deploymentName, DeploymentInner parameters) { - return beginValidateAtSubscriptionScopeAsync(deploymentName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono validateAtSubscriptionScopeAsync( - String deploymentName, DeploymentInner parameters, Context context) { - return beginValidateAtSubscriptionScopeAsync(deploymentName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentValidateResultInner validateAtSubscriptionScope( - String deploymentName, DeploymentInner parameters) { - return validateAtSubscriptionScopeAsync(deploymentName, parameters).block(); - } - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentValidateResultInner validateAtSubscriptionScope( - String deploymentName, DeploymentInner parameters, Context context) { - return validateAtSubscriptionScopeAsync(deploymentName, parameters, context).block(); - } - - /** - * Returns changes that will be made by the deployment if executed at the scope of the subscription. - * - * @param deploymentName The name of the deployment. - * @param parameters Parameters to What If. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the What-If operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> whatIfAtSubscriptionScopeWithResponseAsync( - String deploymentName, DeploymentWhatIf parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .whatIfAtSubscriptionScope( - this.client.getEndpoint(), - deploymentName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns changes that will be made by the deployment if executed at the scope of the subscription. - * - * @param deploymentName The name of the deployment. - * @param parameters Parameters to What If. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the What-If operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> whatIfAtSubscriptionScopeWithResponseAsync( - String deploymentName, DeploymentWhatIf parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .whatIfAtSubscriptionScope( - this.client.getEndpoint(), - deploymentName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Returns changes that will be made by the deployment if executed at the scope of the subscription. - * - * @param deploymentName The name of the deployment. - * @param parameters Parameters to What If. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the What-If operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, WhatIfOperationResultInner> - beginWhatIfAtSubscriptionScopeAsync(String deploymentName, DeploymentWhatIf parameters) { - Mono>> mono = whatIfAtSubscriptionScopeWithResponseAsync(deploymentName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - WhatIfOperationResultInner.class, - WhatIfOperationResultInner.class, - Context.NONE); - } - - /** - * Returns changes that will be made by the deployment if executed at the scope of the subscription. - * - * @param deploymentName The name of the deployment. - * @param parameters Parameters to What If. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the What-If operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, WhatIfOperationResultInner> - beginWhatIfAtSubscriptionScopeAsync(String deploymentName, DeploymentWhatIf parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - whatIfAtSubscriptionScopeWithResponseAsync(deploymentName, parameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - WhatIfOperationResultInner.class, - WhatIfOperationResultInner.class, - context); - } - - /** - * Returns changes that will be made by the deployment if executed at the scope of the subscription. - * - * @param deploymentName The name of the deployment. - * @param parameters Parameters to What If. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the What-If operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, WhatIfOperationResultInner> - beginWhatIfAtSubscriptionScope(String deploymentName, DeploymentWhatIf parameters) { - return beginWhatIfAtSubscriptionScopeAsync(deploymentName, parameters).getSyncPoller(); - } - - /** - * Returns changes that will be made by the deployment if executed at the scope of the subscription. - * - * @param deploymentName The name of the deployment. - * @param parameters Parameters to What If. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the What-If operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, WhatIfOperationResultInner> - beginWhatIfAtSubscriptionScope(String deploymentName, DeploymentWhatIf parameters, Context context) { - return beginWhatIfAtSubscriptionScopeAsync(deploymentName, parameters, context).getSyncPoller(); - } - - /** - * Returns changes that will be made by the deployment if executed at the scope of the subscription. - * - * @param deploymentName The name of the deployment. - * @param parameters Parameters to What If. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the What-If operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono whatIfAtSubscriptionScopeAsync( - String deploymentName, DeploymentWhatIf parameters) { - return beginWhatIfAtSubscriptionScopeAsync(deploymentName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Returns changes that will be made by the deployment if executed at the scope of the subscription. - * - * @param deploymentName The name of the deployment. - * @param parameters Parameters to What If. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the What-If operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono whatIfAtSubscriptionScopeAsync( - String deploymentName, DeploymentWhatIf parameters, Context context) { - return beginWhatIfAtSubscriptionScopeAsync(deploymentName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Returns changes that will be made by the deployment if executed at the scope of the subscription. - * - * @param deploymentName The name of the deployment. - * @param parameters Parameters to What If. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the What-If operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public WhatIfOperationResultInner whatIfAtSubscriptionScope(String deploymentName, DeploymentWhatIf parameters) { - return whatIfAtSubscriptionScopeAsync(deploymentName, parameters).block(); - } - - /** - * Returns changes that will be made by the deployment if executed at the scope of the subscription. - * - * @param deploymentName The name of the deployment. - * @param parameters Parameters to What If. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the What-If operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public WhatIfOperationResultInner whatIfAtSubscriptionScope( - String deploymentName, DeploymentWhatIf parameters, Context context) { - return whatIfAtSubscriptionScopeAsync(deploymentName, parameters, context).block(); - } - - /** - * Exports the template used for specified deployment. - * - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deployment export result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> exportTemplateAtSubscriptionScopeWithResponseAsync( - String deploymentName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .exportTemplateAtSubscriptionScope( - this.client.getEndpoint(), - deploymentName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Exports the template used for specified deployment. - * - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deployment export result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> exportTemplateAtSubscriptionScopeWithResponseAsync( - String deploymentName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .exportTemplateAtSubscriptionScope( - this.client.getEndpoint(), - deploymentName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Exports the template used for specified deployment. - * - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deployment export result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono exportTemplateAtSubscriptionScopeAsync(String deploymentName) { - return exportTemplateAtSubscriptionScopeWithResponseAsync(deploymentName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Exports the template used for specified deployment. - * - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deployment export result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentExportResultInner exportTemplateAtSubscriptionScope(String deploymentName) { - return exportTemplateAtSubscriptionScopeAsync(deploymentName).block(); - } - - /** - * Exports the template used for specified deployment. - * - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deployment export result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response exportTemplateAtSubscriptionScopeWithResponse( - String deploymentName, Context context) { - return exportTemplateAtSubscriptionScopeWithResponseAsync(deploymentName, context).block(); - } - - /** - * Get all the deployments for a subscription. - * - * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq - * '{state}'. - * @param top The number of results to get. If null is passed, returns all deployments. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the deployments for a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String filter, Integer top) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - filter, - top, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get all the deployments for a subscription. - * - * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq - * '{state}'. - * @param top The number of results to get. If null is passed, returns all deployments. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the deployments for a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String filter, Integer top, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - filter, - top, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get all the deployments for a subscription. - * - * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq - * '{state}'. - * @param top The number of results to get. If null is passed, returns all deployments. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the deployments for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String filter, Integer top) { - return new PagedFlux<>( - () -> listSinglePageAsync(filter, top), nextLink -> listAtSubscriptionScopeNextSinglePageAsync(nextLink)); - } - - /** - * Get all the deployments for a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the deployments for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - final String filter = null; - final Integer top = null; - return new PagedFlux<>( - () -> listSinglePageAsync(filter, top), nextLink -> listAtSubscriptionScopeNextSinglePageAsync(nextLink)); - } - - /** - * Get all the deployments for a subscription. - * - * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq - * '{state}'. - * @param top The number of results to get. If null is passed, returns all deployments. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the deployments for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String filter, Integer top, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(filter, top, context), - nextLink -> listAtSubscriptionScopeNextSinglePageAsync(nextLink, context)); - } - - /** - * Get all the deployments for a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the deployments for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - final String filter = null; - final Integer top = null; - return new PagedIterable<>(listAsync(filter, top)); - } - - /** - * Get all the deployments for a subscription. - * - * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq - * '{state}'. - * @param top The number of results to get. If null is passed, returns all deployments. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the deployments for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String filter, Integer top, Context context) { - return new PagedIterable<>(listAsync(filter, top, context)); - } - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. Deleting a template deployment does not affect the state of the resource group. - * This is an asynchronous operation that returns a status of 202 until the template deployment is successfully - * deleted. The Location response header contains the URI that is used to obtain the status of the process. While - * the process is running, a call to the URI in the Location header returns a status of 202. When the process - * finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, - * the URI in the Location header returns an error-level status code. - * - * @param resourceGroupName The name of the resource group with the deployment to delete. The name is case - * insensitive. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync(String resourceGroupName, String deploymentName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - deploymentName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. Deleting a template deployment does not affect the state of the resource group. - * This is an asynchronous operation that returns a status of 202 until the template deployment is successfully - * deleted. The Location response header contains the URI that is used to obtain the status of the process. While - * the process is running, a call to the URI in the Location header returns a status of 202. When the process - * finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, - * the URI in the Location header returns an error-level status code. - * - * @param resourceGroupName The name of the resource group with the deployment to delete. The name is case - * insensitive. - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String deploymentName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - deploymentName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. Deleting a template deployment does not affect the state of the resource group. - * This is an asynchronous operation that returns a status of 202 until the template deployment is successfully - * deleted. The Location response header contains the URI that is used to obtain the status of the process. While - * the process is running, a call to the URI in the Location header returns a status of 202. When the process - * finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, - * the URI in the Location header returns an error-level status code. - * - * @param resourceGroupName The name of the resource group with the deployment to delete. The name is case - * insensitive. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String deploymentName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, deploymentName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. Deleting a template deployment does not affect the state of the resource group. - * This is an asynchronous operation that returns a status of 202 until the template deployment is successfully - * deleted. The Location response header contains the URI that is used to obtain the status of the process. While - * the process is running, a call to the URI in the Location header returns a status of 202. When the process - * finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, - * the URI in the Location header returns an error-level status code. - * - * @param resourceGroupName The name of the resource group with the deployment to delete. The name is case - * insensitive. - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String deploymentName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(resourceGroupName, deploymentName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. Deleting a template deployment does not affect the state of the resource group. - * This is an asynchronous operation that returns a status of 202 until the template deployment is successfully - * deleted. The Location response header contains the URI that is used to obtain the status of the process. While - * the process is running, a call to the URI in the Location header returns a status of 202. When the process - * finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, - * the URI in the Location header returns an error-level status code. - * - * @param resourceGroupName The name of the resource group with the deployment to delete. The name is case - * insensitive. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete(String resourceGroupName, String deploymentName) { - return beginDeleteAsync(resourceGroupName, deploymentName).getSyncPoller(); - } - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. Deleting a template deployment does not affect the state of the resource group. - * This is an asynchronous operation that returns a status of 202 until the template deployment is successfully - * deleted. The Location response header contains the URI that is used to obtain the status of the process. While - * the process is running, a call to the URI in the Location header returns a status of 202. When the process - * finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, - * the URI in the Location header returns an error-level status code. - * - * @param resourceGroupName The name of the resource group with the deployment to delete. The name is case - * insensitive. - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String deploymentName, Context context) { - return beginDeleteAsync(resourceGroupName, deploymentName, context).getSyncPoller(); - } - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. Deleting a template deployment does not affect the state of the resource group. - * This is an asynchronous operation that returns a status of 202 until the template deployment is successfully - * deleted. The Location response header contains the URI that is used to obtain the status of the process. While - * the process is running, a call to the URI in the Location header returns a status of 202. When the process - * finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, - * the URI in the Location header returns an error-level status code. - * - * @param resourceGroupName The name of the resource group with the deployment to delete. The name is case - * insensitive. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String deploymentName) { - return beginDeleteAsync(resourceGroupName, deploymentName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. Deleting a template deployment does not affect the state of the resource group. - * This is an asynchronous operation that returns a status of 202 until the template deployment is successfully - * deleted. The Location response header contains the URI that is used to obtain the status of the process. While - * the process is running, a call to the URI in the Location header returns a status of 202. When the process - * finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, - * the URI in the Location header returns an error-level status code. - * - * @param resourceGroupName The name of the resource group with the deployment to delete. The name is case - * insensitive. - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String deploymentName, Context context) { - return beginDeleteAsync(resourceGroupName, deploymentName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. Deleting a template deployment does not affect the state of the resource group. - * This is an asynchronous operation that returns a status of 202 until the template deployment is successfully - * deleted. The Location response header contains the URI that is used to obtain the status of the process. While - * the process is running, a call to the URI in the Location header returns a status of 202. When the process - * finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, - * the URI in the Location header returns an error-level status code. - * - * @param resourceGroupName The name of the resource group with the deployment to delete. The name is case - * insensitive. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String deploymentName) { - deleteAsync(resourceGroupName, deploymentName).block(); - } - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. Deleting a template deployment does not affect the state of the resource group. - * This is an asynchronous operation that returns a status of 202 until the template deployment is successfully - * deleted. The Location response header contains the URI that is used to obtain the status of the process. While - * the process is running, a call to the URI in the Location header returns a status of 202. When the process - * finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, - * the URI in the Location header returns an error-level status code. - * - * @param resourceGroupName The name of the resource group with the deployment to delete. The name is case - * insensitive. - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String deploymentName, Context context) { - deleteAsync(resourceGroupName, deploymentName, context).block(); - } - - /** - * Checks whether the deployment exists. - * - * @param resourceGroupName The name of the resource group with the deployment to check. The name is case - * insensitive. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> checkExistenceWithResponseAsync(String resourceGroupName, String deploymentName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .checkExistence( - this.client.getEndpoint(), - resourceGroupName, - deploymentName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Checks whether the deployment exists. - * - * @param resourceGroupName The name of the resource group with the deployment to check. The name is case - * insensitive. - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> checkExistenceWithResponseAsync( - String resourceGroupName, String deploymentName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .checkExistence( - this.client.getEndpoint(), - resourceGroupName, - deploymentName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Checks whether the deployment exists. - * - * @param resourceGroupName The name of the resource group with the deployment to check. The name is case - * insensitive. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono checkExistenceAsync(String resourceGroupName, String deploymentName) { - return checkExistenceWithResponseAsync(resourceGroupName, deploymentName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Checks whether the deployment exists. - * - * @param resourceGroupName The name of the resource group with the deployment to check. The name is case - * insensitive. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public boolean checkExistence(String resourceGroupName, String deploymentName) { - Boolean value = checkExistenceAsync(resourceGroupName, deploymentName).block(); - if (value != null) { - return value; - } else { - throw logger.logExceptionAsError(new NullPointerException()); - } - } - - /** - * Checks whether the deployment exists. - * - * @param resourceGroupName The name of the resource group with the deployment to check. The name is case - * insensitive. - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response checkExistenceWithResponse( - String resourceGroupName, String deploymentName, Context context) { - return checkExistenceWithResponseAsync(resourceGroupName, deploymentName, context).block(); - } - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param resourceGroupName The name of the resource group to deploy the resources to. The name is case insensitive. - * The resource group must already exist. - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String deploymentName, DeploymentInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - deploymentName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param resourceGroupName The name of the resource group to deploy the resources to. The name is case insensitive. - * The resource group must already exist. - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String deploymentName, DeploymentInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - deploymentName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param resourceGroupName The name of the resource group to deploy the resources to. The name is case insensitive. - * The resource group must already exist. - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, DeploymentExtendedInner> beginCreateOrUpdateAsync( - String resourceGroupName, String deploymentName, DeploymentInner parameters) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, deploymentName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - DeploymentExtendedInner.class, - DeploymentExtendedInner.class, - Context.NONE); - } - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param resourceGroupName The name of the resource group to deploy the resources to. The name is case insensitive. - * The resource group must already exist. - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, DeploymentExtendedInner> beginCreateOrUpdateAsync( - String resourceGroupName, String deploymentName, DeploymentInner parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, deploymentName, parameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - DeploymentExtendedInner.class, - DeploymentExtendedInner.class, - context); - } - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param resourceGroupName The name of the resource group to deploy the resources to. The name is case insensitive. - * The resource group must already exist. - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, DeploymentExtendedInner> beginCreateOrUpdate( - String resourceGroupName, String deploymentName, DeploymentInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, deploymentName, parameters).getSyncPoller(); - } - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param resourceGroupName The name of the resource group to deploy the resources to. The name is case insensitive. - * The resource group must already exist. - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, DeploymentExtendedInner> beginCreateOrUpdate( - String resourceGroupName, String deploymentName, DeploymentInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, deploymentName, parameters, context).getSyncPoller(); - } - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param resourceGroupName The name of the resource group to deploy the resources to. The name is case insensitive. - * The resource group must already exist. - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, String deploymentName, DeploymentInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, deploymentName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param resourceGroupName The name of the resource group to deploy the resources to. The name is case insensitive. - * The resource group must already exist. - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String deploymentName, DeploymentInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, deploymentName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param resourceGroupName The name of the resource group to deploy the resources to. The name is case insensitive. - * The resource group must already exist. - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentExtendedInner createOrUpdate( - String resourceGroupName, String deploymentName, DeploymentInner parameters) { - return createOrUpdateAsync(resourceGroupName, deploymentName, parameters).block(); - } - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * - * @param resourceGroupName The name of the resource group to deploy the resources to. The name is case insensitive. - * The resource group must already exist. - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentExtendedInner createOrUpdate( - String resourceGroupName, String deploymentName, DeploymentInner parameters, Context context) { - return createOrUpdateAsync(resourceGroupName, deploymentName, parameters, context).block(); - } - - /** - * Gets a deployment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String deploymentName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - deploymentName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a deployment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String deploymentName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - deploymentName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets a deployment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync(String resourceGroupName, String deploymentName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, deploymentName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a deployment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentExtendedInner getByResourceGroup(String resourceGroupName, String deploymentName) { - return getByResourceGroupAsync(resourceGroupName, deploymentName).block(); - } - - /** - * Gets a deployment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String deploymentName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, deploymentName, context).block(); - } - - /** - * You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is - * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running - * template deployment and leaves the resource group partially deployed. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> cancelWithResponseAsync(String resourceGroupName, String deploymentName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .cancel( - this.client.getEndpoint(), - resourceGroupName, - deploymentName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is - * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running - * template deployment and leaves the resource group partially deployed. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> cancelWithResponseAsync( - String resourceGroupName, String deploymentName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .cancel( - this.client.getEndpoint(), - resourceGroupName, - deploymentName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is - * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running - * template deployment and leaves the resource group partially deployed. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono cancelAsync(String resourceGroupName, String deploymentName) { - return cancelWithResponseAsync(resourceGroupName, deploymentName).flatMap((Response res) -> Mono.empty()); - } - - /** - * You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is - * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running - * template deployment and leaves the resource group partially deployed. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void cancel(String resourceGroupName, String deploymentName) { - cancelAsync(resourceGroupName, deploymentName).block(); - } - - /** - * You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is - * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running - * template deployment and leaves the resource group partially deployed. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response cancelWithResponse(String resourceGroupName, String deploymentName, Context context) { - return cancelWithResponseAsync(resourceGroupName, deploymentName, context).block(); - } - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case - * insensitive. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> validateWithResponseAsync( - String resourceGroupName, String deploymentName, DeploymentInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .validate( - this.client.getEndpoint(), - resourceGroupName, - deploymentName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case - * insensitive. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> validateWithResponseAsync( - String resourceGroupName, String deploymentName, DeploymentInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .validate( - this.client.getEndpoint(), - resourceGroupName, - deploymentName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case - * insensitive. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, DeploymentValidateResultInner> beginValidateAsync( - String resourceGroupName, String deploymentName, DeploymentInner parameters) { - Mono>> mono = - validateWithResponseAsync(resourceGroupName, deploymentName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - DeploymentValidateResultInner.class, - DeploymentValidateResultInner.class, - Context.NONE); - } - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case - * insensitive. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, DeploymentValidateResultInner> beginValidateAsync( - String resourceGroupName, String deploymentName, DeploymentInner parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - validateWithResponseAsync(resourceGroupName, deploymentName, parameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - DeploymentValidateResultInner.class, - DeploymentValidateResultInner.class, - context); - } - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case - * insensitive. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, DeploymentValidateResultInner> beginValidate( - String resourceGroupName, String deploymentName, DeploymentInner parameters) { - return beginValidateAsync(resourceGroupName, deploymentName, parameters).getSyncPoller(); - } - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case - * insensitive. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, DeploymentValidateResultInner> beginValidate( - String resourceGroupName, String deploymentName, DeploymentInner parameters, Context context) { - return beginValidateAsync(resourceGroupName, deploymentName, parameters, context).getSyncPoller(); - } - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case - * insensitive. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono validateAsync( - String resourceGroupName, String deploymentName, DeploymentInner parameters) { - return beginValidateAsync(resourceGroupName, deploymentName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case - * insensitive. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono validateAsync( - String resourceGroupName, String deploymentName, DeploymentInner parameters, Context context) { - return beginValidateAsync(resourceGroupName, deploymentName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case - * insensitive. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentValidateResultInner validate( - String resourceGroupName, String deploymentName, DeploymentInner parameters) { - return validateAsync(resourceGroupName, deploymentName, parameters).block(); - } - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case - * insensitive. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentValidateResultInner validate( - String resourceGroupName, String deploymentName, DeploymentInner parameters, Context context) { - return validateAsync(resourceGroupName, deploymentName, parameters, context).block(); - } - - /** - * Returns changes that will be made by the deployment if executed at the scope of the resource group. - * - * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case - * insensitive. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the What-If operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> whatIfWithResponseAsync( - String resourceGroupName, String deploymentName, DeploymentWhatIf parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .whatIf( - this.client.getEndpoint(), - resourceGroupName, - deploymentName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns changes that will be made by the deployment if executed at the scope of the resource group. - * - * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case - * insensitive. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the What-If operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> whatIfWithResponseAsync( - String resourceGroupName, String deploymentName, DeploymentWhatIf parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .whatIf( - this.client.getEndpoint(), - resourceGroupName, - deploymentName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Returns changes that will be made by the deployment if executed at the scope of the resource group. - * - * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case - * insensitive. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the What-If operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, WhatIfOperationResultInner> beginWhatIfAsync( - String resourceGroupName, String deploymentName, DeploymentWhatIf parameters) { - Mono>> mono = whatIfWithResponseAsync(resourceGroupName, deploymentName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - WhatIfOperationResultInner.class, - WhatIfOperationResultInner.class, - Context.NONE); - } - - /** - * Returns changes that will be made by the deployment if executed at the scope of the resource group. - * - * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case - * insensitive. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the What-If operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, WhatIfOperationResultInner> beginWhatIfAsync( - String resourceGroupName, String deploymentName, DeploymentWhatIf parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - whatIfWithResponseAsync(resourceGroupName, deploymentName, parameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - WhatIfOperationResultInner.class, - WhatIfOperationResultInner.class, - context); - } - - /** - * Returns changes that will be made by the deployment if executed at the scope of the resource group. - * - * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case - * insensitive. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the What-If operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, WhatIfOperationResultInner> beginWhatIf( - String resourceGroupName, String deploymentName, DeploymentWhatIf parameters) { - return beginWhatIfAsync(resourceGroupName, deploymentName, parameters).getSyncPoller(); - } - - /** - * Returns changes that will be made by the deployment if executed at the scope of the resource group. - * - * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case - * insensitive. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the What-If operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, WhatIfOperationResultInner> beginWhatIf( - String resourceGroupName, String deploymentName, DeploymentWhatIf parameters, Context context) { - return beginWhatIfAsync(resourceGroupName, deploymentName, parameters, context).getSyncPoller(); - } - - /** - * Returns changes that will be made by the deployment if executed at the scope of the resource group. - * - * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case - * insensitive. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the What-If operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono whatIfAsync( - String resourceGroupName, String deploymentName, DeploymentWhatIf parameters) { - return beginWhatIfAsync(resourceGroupName, deploymentName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Returns changes that will be made by the deployment if executed at the scope of the resource group. - * - * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case - * insensitive. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the What-If operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono whatIfAsync( - String resourceGroupName, String deploymentName, DeploymentWhatIf parameters, Context context) { - return beginWhatIfAsync(resourceGroupName, deploymentName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Returns changes that will be made by the deployment if executed at the scope of the resource group. - * - * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case - * insensitive. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the What-If operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public WhatIfOperationResultInner whatIf( - String resourceGroupName, String deploymentName, DeploymentWhatIf parameters) { - return whatIfAsync(resourceGroupName, deploymentName, parameters).block(); - } - - /** - * Returns changes that will be made by the deployment if executed at the scope of the resource group. - * - * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case - * insensitive. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the What-If operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public WhatIfOperationResultInner whatIf( - String resourceGroupName, String deploymentName, DeploymentWhatIf parameters, Context context) { - return whatIfAsync(resourceGroupName, deploymentName, parameters, context).block(); - } - - /** - * Exports the template used for specified deployment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deployment export result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> exportTemplateWithResponseAsync( - String resourceGroupName, String deploymentName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .exportTemplate( - this.client.getEndpoint(), - resourceGroupName, - deploymentName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Exports the template used for specified deployment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deployment export result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> exportTemplateWithResponseAsync( - String resourceGroupName, String deploymentName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .exportTemplate( - this.client.getEndpoint(), - resourceGroupName, - deploymentName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Exports the template used for specified deployment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deployment export result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono exportTemplateAsync(String resourceGroupName, String deploymentName) { - return exportTemplateWithResponseAsync(resourceGroupName, deploymentName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Exports the template used for specified deployment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deployment export result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentExportResultInner exportTemplate(String resourceGroupName, String deploymentName) { - return exportTemplateAsync(resourceGroupName, deploymentName).block(); - } - - /** - * Exports the template used for specified deployment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deployment export result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response exportTemplateWithResponse( - String resourceGroupName, String deploymentName, Context context) { - return exportTemplateWithResponseAsync(resourceGroupName, deploymentName, context).block(); - } - - /** - * Get all the deployments for a resource group. - * - * @param resourceGroupName The name of the resource group with the deployments to get. The name is case - * insensitive. - * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq - * '{state}'. - * @param top The number of results to get. If null is passed, returns all deployments. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the deployments for a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, String filter, Integer top) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - filter, - top, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get all the deployments for a resource group. - * - * @param resourceGroupName The name of the resource group with the deployments to get. The name is case - * insensitive. - * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq - * '{state}'. - * @param top The number of results to get. If null is passed, returns all deployments. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the deployments for a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, String filter, Integer top, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - filter, - top, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get all the deployments for a resource group. - * - * @param resourceGroupName The name of the resource group with the deployments to get. The name is case - * insensitive. - * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq - * '{state}'. - * @param top The number of results to get. If null is passed, returns all deployments. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the deployments for a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync( - String resourceGroupName, String filter, Integer top) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, top), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * Get all the deployments for a resource group. - * - * @param resourceGroupName The name of the resource group with the deployments to get. The name is case - * insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the deployments for a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - final String filter = null; - final Integer top = null; - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, top), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * Get all the deployments for a resource group. - * - * @param resourceGroupName The name of the resource group with the deployments to get. The name is case - * insensitive. - * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq - * '{state}'. - * @param top The number of results to get. If null is passed, returns all deployments. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the deployments for a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync( - String resourceGroupName, String filter, Integer top, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, top, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * Get all the deployments for a resource group. - * - * @param resourceGroupName The name of the resource group with the deployments to get. The name is case - * insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the deployments for a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - final String filter = null; - final Integer top = null; - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, filter, top)); - } - - /** - * Get all the deployments for a resource group. - * - * @param resourceGroupName The name of the resource group with the deployments to get. The name is case - * insensitive. - * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq - * '{state}'. - * @param top The number of results to get. If null is passed, returns all deployments. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the deployments for a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup( - String resourceGroupName, String filter, Integer top, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, filter, top, context)); - } - - /** - * Calculate the hash of the given template. - * - * @param template The template provided to calculate hash. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to calculate template hash. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> calculateTemplateHashWithResponseAsync(Object template) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (template == null) { - return Mono.error(new IllegalArgumentException("Parameter template is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .calculateTemplateHash( - this.client.getEndpoint(), this.client.getApiVersion(), template, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Calculate the hash of the given template. - * - * @param template The template provided to calculate hash. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to calculate template hash. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> calculateTemplateHashWithResponseAsync( - Object template, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (template == null) { - return Mono.error(new IllegalArgumentException("Parameter template is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .calculateTemplateHash(this.client.getEndpoint(), this.client.getApiVersion(), template, accept, context); - } - - /** - * Calculate the hash of the given template. - * - * @param template The template provided to calculate hash. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to calculate template hash. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono calculateTemplateHashAsync(Object template) { - return calculateTemplateHashWithResponseAsync(template) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Calculate the hash of the given template. - * - * @param template The template provided to calculate hash. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to calculate template hash. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public TemplateHashResultInner calculateTemplateHash(Object template) { - return calculateTemplateHashAsync(template).block(); - } - - /** - * Calculate the hash of the given template. - * - * @param template The template provided to calculate hash. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to calculate template hash. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response calculateTemplateHashWithResponse(Object template, Context context) { - return calculateTemplateHashWithResponseAsync(template, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of deployments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAtScopeNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listAtScopeNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of deployments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAtScopeNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listAtScopeNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of deployments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAtTenantScopeNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listAtTenantScopeNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of deployments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAtTenantScopeNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listAtTenantScopeNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of deployments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAtManagementGroupScopeNextSinglePageAsync( - String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listAtManagementGroupScopeNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of deployments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAtManagementGroupScopeNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listAtManagementGroupScopeNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of deployments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAtSubscriptionScopeNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listAtSubscriptionScopeNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of deployments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAtSubscriptionScopeNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listAtSubscriptionScopeNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of deployments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of deployments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/DeploymentsImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/DeploymentsImpl.java deleted file mode 100644 index 8d6eea3a79ed..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/DeploymentsImpl.java +++ /dev/null @@ -1,152 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.CoreUtils; -import com.azure.resourcemanager.resources.ResourceManager; -import com.azure.resourcemanager.resources.models.Deployment; -import com.azure.resourcemanager.resources.models.Deployments; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.SupportsGettingByResourceGroupImpl; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.utils.PagedConverter; -import com.azure.resourcemanager.resources.fluent.models.DeploymentExtendedInner; -import com.azure.resourcemanager.resources.fluent.DeploymentsClient; -import reactor.core.publisher.Mono; - -/** - * The implementation for {@link Deployments}. - */ -public final class DeploymentsImpl - extends SupportsGettingByResourceGroupImpl - implements Deployments, - HasManager { - - private final ResourceManager resourceManager; - - public DeploymentsImpl(final ResourceManager resourceManager) { - this.resourceManager = resourceManager; - } - - @Override - public PagedIterable list() { - return new PagedIterable<>(this.listAsync()); - } - - @Override - public PagedIterable listByResourceGroup(String groupName) { - return PagedConverter.mapPage(this.manager().serviceClient().getDeployments() - .listByResourceGroup(groupName), inner -> createFluentModel(inner)); - } - - @Override - public Deployment getByName(String name) { - return getByNameAsync(name).block(); - } - - @Override - public Mono getByNameAsync(String name) { - return this.manager().serviceClient().getDeployments().getAtTenantScopeAsync(name) - .map(inner -> new DeploymentImpl(inner, inner.name(), this.resourceManager)); - } - - @Override - public Mono getByResourceGroupAsync(String resourceGroupName, String name) { - if (CoreUtils.isNullOrEmpty(resourceGroupName)) { - return Mono.error( - new IllegalArgumentException("Parameter 'resourceGroupName' is required and cannot be null.")); - } - if (CoreUtils.isNullOrEmpty(name)) { - return Mono.error( - new IllegalArgumentException("Parameter 'name' is required and cannot be null.")); - } - return this.manager().serviceClient().getDeployments() - .getByResourceGroupAsync(resourceGroupName, name).map(deploymentExtendedInner -> { - if (deploymentExtendedInner != null) { - return createFluentModel(deploymentExtendedInner); - } else { - return null; - } - }); - } - - @Override - public void deleteByResourceGroup(String groupName, String name) { - deleteByResourceGroupAsync(groupName, name).block(); - } - - - @Override - public Mono deleteByResourceGroupAsync(String resourceGroupName, String name) { - if (CoreUtils.isNullOrEmpty(resourceGroupName)) { - return Mono.error( - new IllegalArgumentException("Parameter 'resourceGroupName' is required and cannot be null.")); - } - if (CoreUtils.isNullOrEmpty(name)) { - return Mono.error( - new IllegalArgumentException("Parameter 'name' is required and cannot be null.")); - } - return this.manager().serviceClient().getDeployments().deleteAsync(resourceGroupName, name); - } - - @Override - public DeploymentImpl define(String name) { - return createFluentModel(name); - } - - @Override - public boolean checkExistence(String resourceGroupName, String deploymentName) { - return this.manager().serviceClient().getDeployments().checkExistence(resourceGroupName, deploymentName); - } - - protected DeploymentImpl createFluentModel(String name) { - return new DeploymentImpl(new DeploymentExtendedInner(), name, this.resourceManager); - } - - protected DeploymentImpl createFluentModel(DeploymentExtendedInner deploymentExtendedInner) { - return new DeploymentImpl(deploymentExtendedInner, deploymentExtendedInner.name(), this.resourceManager); - } - - @Override - public Deployment getById(String id) { - return this.getByResourceGroup( - ResourceUtils.groupFromResourceId(id), - ResourceUtils.nameFromResourceId(id)); - } - - @Override - public void deleteById(String id) { - deleteByIdAsync(id).block(); - } - - @Override - public Mono deleteByIdAsync(String id) { - return deleteByResourceGroupAsync(ResourceUtils.groupFromResourceId(id), ResourceUtils.nameFromResourceId(id)); - } - - @Override - public ResourceManager manager() { - return this.resourceManager; - } - - @Override - public PagedFlux listAsync() { - return PagedConverter.mergePagedFlux(this.manager().resourceGroups().listAsync(), - resourceGroup -> listByResourceGroupAsync(resourceGroup.name())); - } - - - @Override - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - if (CoreUtils.isNullOrEmpty(resourceGroupName)) { - return new PagedFlux<>(() -> Mono.error( - new IllegalArgumentException("Parameter 'resourceGroupName' is required and cannot be null."))); - } - final DeploymentsClient client = this.manager().serviceClient().getDeployments(); - return PagedConverter.mapPage(client.listByResourceGroupAsync(resourceGroupName), - deploymentExtendedInner -> createFluentModel(deploymentExtendedInner)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/FeatureClientBuilder.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/FeatureClientBuilder.java deleted file mode 100644 index 64a7e7841f0a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/FeatureClientBuilder.java +++ /dev/null @@ -1,146 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.implementation; - -import com.azure.core.annotation.ServiceClientBuilder; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.policy.CookiePolicy; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerAdapter; -import java.time.Duration; - -/** A builder for creating a new instance of the FeatureClientImpl type. */ -@ServiceClientBuilder(serviceClients = {FeatureClientImpl.class}) -public final class FeatureClientBuilder { - /* - * The ID of the target subscription. - */ - private String subscriptionId; - - /** - * Sets The ID of the target subscription. - * - * @param subscriptionId the subscriptionId value. - * @return the FeatureClientBuilder. - */ - public FeatureClientBuilder subscriptionId(String subscriptionId) { - this.subscriptionId = subscriptionId; - return this; - } - - /* - * server parameter - */ - private String endpoint; - - /** - * Sets server parameter. - * - * @param endpoint the endpoint value. - * @return the FeatureClientBuilder. - */ - public FeatureClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * The environment to connect to - */ - private AzureEnvironment environment; - - /** - * Sets The environment to connect to. - * - * @param environment the environment value. - * @return the FeatureClientBuilder. - */ - public FeatureClientBuilder environment(AzureEnvironment environment) { - this.environment = environment; - return this; - } - - /* - * The default poll interval for long-running operation - */ - private Duration defaultPollInterval; - - /** - * Sets The default poll interval for long-running operation. - * - * @param defaultPollInterval the defaultPollInterval value. - * @return the FeatureClientBuilder. - */ - public FeatureClientBuilder defaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = defaultPollInterval; - return this; - } - - /* - * The HTTP pipeline to send requests through - */ - private HttpPipeline pipeline; - - /** - * Sets The HTTP pipeline to send requests through. - * - * @param pipeline the pipeline value. - * @return the FeatureClientBuilder. - */ - public FeatureClientBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; - return this; - } - - /* - * The serializer to serialize an object into a string - */ - private SerializerAdapter serializerAdapter; - - /** - * Sets The serializer to serialize an object into a string. - * - * @param serializerAdapter the serializerAdapter value. - * @return the FeatureClientBuilder. - */ - public FeatureClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { - this.serializerAdapter = serializerAdapter; - return this; - } - - /** - * Builds an instance of FeatureClientImpl with the provided parameters. - * - * @return an instance of FeatureClientImpl. - */ - public FeatureClientImpl buildClient() { - if (endpoint == null) { - this.endpoint = "https://management.azure.com"; - } - if (environment == null) { - this.environment = AzureEnvironment.AZURE; - } - if (defaultPollInterval == null) { - this.defaultPollInterval = Duration.ofSeconds(30); - } - if (pipeline == null) { - this.pipeline = - new HttpPipelineBuilder() - .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) - .build(); - } - if (serializerAdapter == null) { - this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); - } - FeatureClientImpl client = - new FeatureClientImpl( - pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); - return client; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/FeatureClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/FeatureClientImpl.java deleted file mode 100644 index 8aff9d8ac143..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/FeatureClientImpl.java +++ /dev/null @@ -1,367 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.serializer.SerializerAdapter; -import com.azure.resourcemanager.resources.fluent.FeatureClient; -import com.azure.resourcemanager.resources.fluent.FeaturesClient; -import com.azure.resourcemanager.resources.fluent.models.OperationInner; -import com.azure.resourcemanager.resources.fluentcore.AzureServiceClient; -import com.azure.resourcemanager.resources.models.OperationListResult; -import java.time.Duration; -import reactor.core.publisher.Mono; - -/** Initializes a new instance of the FeatureClientImpl type. */ -@ServiceClient(builder = FeatureClientBuilder.class) -public final class FeatureClientImpl extends AzureServiceClient implements FeatureClient { - private final ClientLogger logger = new ClientLogger(FeatureClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final FeatureClientService service; - - /** The ID of the target subscription. */ - private final String subscriptionId; - - /** - * Gets The ID of the target subscription. - * - * @return the subscriptionId value. - */ - public String getSubscriptionId() { - return this.subscriptionId; - } - - /** server parameter. */ - private final String endpoint; - - /** - * Gets server parameter. - * - * @return the endpoint value. - */ - public String getEndpoint() { - return this.endpoint; - } - - /** Api Version. */ - private final String apiVersion; - - /** - * Gets Api Version. - * - * @return the apiVersion value. - */ - public String getApiVersion() { - return this.apiVersion; - } - - /** The HTTP pipeline to send requests through. */ - private final HttpPipeline httpPipeline; - - /** - * Gets The HTTP pipeline to send requests through. - * - * @return the httpPipeline value. - */ - public HttpPipeline getHttpPipeline() { - return this.httpPipeline; - } - - /** The serializer to serialize an object into a string. */ - private final SerializerAdapter serializerAdapter; - - /** - * Gets The serializer to serialize an object into a string. - * - * @return the serializerAdapter value. - */ - SerializerAdapter getSerializerAdapter() { - return this.serializerAdapter; - } - - /** The default poll interval for long-running operation. */ - private final Duration defaultPollInterval; - - /** - * Gets The default poll interval for long-running operation. - * - * @return the defaultPollInterval value. - */ - public Duration getDefaultPollInterval() { - return this.defaultPollInterval; - } - - /** The FeaturesClient object to access its operations. */ - private final FeaturesClient features; - - /** - * Gets the FeaturesClient object to access its operations. - * - * @return the FeaturesClient object. - */ - public FeaturesClient getFeatures() { - return this.features; - } - - /** - * Initializes an instance of FeatureClient client. - * - * @param httpPipeline The HTTP pipeline to send requests through. - * @param serializerAdapter The serializer to serialize an object into a string. - * @param defaultPollInterval The default poll interval for long-running operation. - * @param environment The Azure environment. - * @param subscriptionId The ID of the target subscription. - * @param endpoint server parameter. - */ - FeatureClientImpl( - HttpPipeline httpPipeline, - SerializerAdapter serializerAdapter, - Duration defaultPollInterval, - AzureEnvironment environment, - String subscriptionId, - String endpoint) { - super(httpPipeline, serializerAdapter, environment); - this.httpPipeline = httpPipeline; - this.serializerAdapter = serializerAdapter; - this.defaultPollInterval = defaultPollInterval; - this.subscriptionId = subscriptionId; - this.endpoint = endpoint; - this.apiVersion = "2015-12-01"; - this.features = new FeaturesClientImpl(this); - this.service = RestProxy.create(FeatureClientService.class, this.httpPipeline, this.getSerializerAdapter()); - } - - /** - * The interface defining all the services for FeatureClient to be used by the proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "FeatureClient") - private interface FeatureClientService { - @Headers({"Content-Type: application/json"}) - @Get("/providers/Microsoft.Features/operations") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listOperations( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listOperationsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Lists all of the available Microsoft.Features REST API operations. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Microsoft.Features operations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listOperationsSinglePageAsync() { - if (this.getEndpoint() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext(context -> service.listOperations(this.getEndpoint(), this.getApiVersion(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.getContext()).readOnly())); - } - - /** - * Lists all of the available Microsoft.Features REST API operations. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Microsoft.Features operations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listOperationsSinglePageAsync(Context context) { - if (this.getEndpoint() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - context = this.mergeContext(context); - return service - .listOperations(this.getEndpoint(), this.getApiVersion(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists all of the available Microsoft.Features REST API operations. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Microsoft.Features operations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listOperationsAsync() { - return new PagedFlux<>( - () -> listOperationsSinglePageAsync(), nextLink -> listOperationsNextSinglePageAsync(nextLink)); - } - - /** - * Lists all of the available Microsoft.Features REST API operations. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Microsoft.Features operations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listOperationsAsync(Context context) { - return new PagedFlux<>( - () -> listOperationsSinglePageAsync(context), - nextLink -> listOperationsNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all of the available Microsoft.Features REST API operations. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Microsoft.Features operations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listOperations() { - return new PagedIterable<>(listOperationsAsync()); - } - - /** - * Lists all of the available Microsoft.Features REST API operations. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Microsoft.Features operations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listOperations(Context context) { - return new PagedIterable<>(listOperationsAsync(context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Microsoft.Features operations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listOperationsNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.getEndpoint() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext(context -> service.listOperationsNext(nextLink, this.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Microsoft.Features operations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listOperationsNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.getEndpoint() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - context = this.mergeContext(context); - return service - .listOperationsNext(nextLink, this.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/FeatureImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/FeatureImpl.java deleted file mode 100644 index 8c1a535e342c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/FeatureImpl.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.implementation; - -import com.azure.resourcemanager.resources.fluentcore.model.implementation.IndexableWrapperImpl; -import com.azure.resourcemanager.resources.models.Feature; -import com.azure.resourcemanager.resources.fluent.models.FeatureResultInner; - -import java.util.regex.Pattern; - -/** - * The implementation of {@link Feature}. - */ -final class FeatureImpl extends - IndexableWrapperImpl - implements - Feature { - - FeatureImpl(FeatureResultInner innerModel) { - super(innerModel); - } - - @Override - public String name() { - return innerModel().name(); - } - - @Override - public String type() { - return innerModel().type(); - } - - @Override - public String state() { - if (innerModel().properties() == null) { - return null; - } - return innerModel().properties().state(); - } - - @Override - public String resourceProviderName() { - if (this.name() == null) { - return null; - } - - String[] segments = this.name().split(Pattern.quote("/")); - return segments.length > 0 ? segments[0] : null; - } - - @Override - public String featureName() { - if (this.name() == null) { - return null; - } - - String[] segments = this.name().split(Pattern.quote("/")); - return segments.length > 1 ? segments[1] : null; - } - - @Override - public String id() { - return innerModel().id(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/FeaturesClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/FeaturesClientImpl.java deleted file mode 100644 index 06cb95e36c6c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/FeaturesClientImpl.java +++ /dev/null @@ -1,1059 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.resources.fluent.FeaturesClient; -import com.azure.resourcemanager.resources.fluent.models.FeatureResultInner; -import com.azure.resourcemanager.resources.models.FeatureOperationsListResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in FeaturesClient. */ -public final class FeaturesClientImpl implements FeaturesClient { - private final ClientLogger logger = new ClientLogger(FeaturesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final FeaturesService service; - - /** The service client containing this operation class. */ - private final FeatureClientImpl client; - - /** - * Initializes an instance of FeaturesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - FeaturesClientImpl(FeatureClientImpl client) { - this.service = RestProxy.create(FeaturesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for FeatureClientFeatures to be used by the proxy service to perform REST - * calls. - */ - @Host("{$host}") - @ServiceInterface(name = "FeatureClientFeature") - private interface FeaturesService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Features/features") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAll( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/providers/Microsoft.Features/providers/{resourceProviderNamespace}" - + "/features") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("resourceProviderNamespace") String resourceProviderNamespace, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/providers/Microsoft.Features/providers/{resourceProviderNamespace}" - + "/features/{featureName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("resourceProviderNamespace") String resourceProviderNamespace, - @PathParam("featureName") String featureName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/providers/Microsoft.Features/providers/{resourceProviderNamespace}" - + "/features/{featureName}/register") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> register( - @HostParam("$host") String endpoint, - @PathParam("resourceProviderNamespace") String resourceProviderNamespace, - @PathParam("featureName") String featureName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/providers/Microsoft.Features/providers/{resourceProviderNamespace}" - + "/features/{featureName}/unregister") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> unregister( - @HostParam("$host") String endpoint, - @PathParam("resourceProviderNamespace") String resourceProviderNamespace, - @PathParam("featureName") String featureName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAllNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets all the preview features that are available through AFEC for the subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the preview features that are available through AFEC for the subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAllSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .listAll( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all the preview features that are available through AFEC for the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the preview features that are available through AFEC for the subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAllSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .listAll( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all the preview features that are available through AFEC for the subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the preview features that are available through AFEC for the subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAllAsync() { - return new PagedFlux<>(() -> listAllSinglePageAsync(), nextLink -> listAllNextSinglePageAsync(nextLink)); - } - - /** - * Gets all the preview features that are available through AFEC for the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the preview features that are available through AFEC for the subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAllAsync(Context context) { - return new PagedFlux<>( - () -> listAllSinglePageAsync(context), nextLink -> listAllNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all the preview features that are available through AFEC for the subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the preview features that are available through AFEC for the subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAll() { - return new PagedIterable<>(listAllAsync()); - } - - /** - * Gets all the preview features that are available through AFEC for the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the preview features that are available through AFEC for the subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAll(Context context) { - return new PagedIterable<>(listAllAsync(context)); - } - - /** - * Gets all the preview features in a provider namespace that are available through AFEC for the subscription. - * - * @param resourceProviderNamespace The namespace of the resource provider for getting features. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the preview features in a provider namespace that are available through AFEC for the subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceProviderNamespace) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceProviderNamespace == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter resourceProviderNamespace is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - resourceProviderNamespace, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all the preview features in a provider namespace that are available through AFEC for the subscription. - * - * @param resourceProviderNamespace The namespace of the resource provider for getting features. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the preview features in a provider namespace that are available through AFEC for the subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceProviderNamespace, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceProviderNamespace == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter resourceProviderNamespace is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - resourceProviderNamespace, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all the preview features in a provider namespace that are available through AFEC for the subscription. - * - * @param resourceProviderNamespace The namespace of the resource provider for getting features. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the preview features in a provider namespace that are available through AFEC for the subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String resourceProviderNamespace) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceProviderNamespace), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets all the preview features in a provider namespace that are available through AFEC for the subscription. - * - * @param resourceProviderNamespace The namespace of the resource provider for getting features. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the preview features in a provider namespace that are available through AFEC for the subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceProviderNamespace, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceProviderNamespace, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all the preview features in a provider namespace that are available through AFEC for the subscription. - * - * @param resourceProviderNamespace The namespace of the resource provider for getting features. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the preview features in a provider namespace that are available through AFEC for the subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceProviderNamespace) { - return new PagedIterable<>(listAsync(resourceProviderNamespace)); - } - - /** - * Gets all the preview features in a provider namespace that are available through AFEC for the subscription. - * - * @param resourceProviderNamespace The namespace of the resource provider for getting features. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the preview features in a provider namespace that are available through AFEC for the subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceProviderNamespace, Context context) { - return new PagedIterable<>(listAsync(resourceProviderNamespace, context)); - } - - /** - * Gets the preview feature with the specified name. - * - * @param resourceProviderNamespace The resource provider namespace for the feature. - * @param featureName The name of the feature to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the preview feature with the specified name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String resourceProviderNamespace, String featureName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceProviderNamespace == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter resourceProviderNamespace is required and cannot be null.")); - } - if (featureName == null) { - return Mono.error(new IllegalArgumentException("Parameter featureName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - resourceProviderNamespace, - featureName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the preview feature with the specified name. - * - * @param resourceProviderNamespace The resource provider namespace for the feature. - * @param featureName The name of the feature to get. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the preview feature with the specified name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceProviderNamespace, String featureName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceProviderNamespace == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter resourceProviderNamespace is required and cannot be null.")); - } - if (featureName == null) { - return Mono.error(new IllegalArgumentException("Parameter featureName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - resourceProviderNamespace, - featureName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets the preview feature with the specified name. - * - * @param resourceProviderNamespace The resource provider namespace for the feature. - * @param featureName The name of the feature to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the preview feature with the specified name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync(String resourceProviderNamespace, String featureName) { - return getWithResponseAsync(resourceProviderNamespace, featureName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the preview feature with the specified name. - * - * @param resourceProviderNamespace The resource provider namespace for the feature. - * @param featureName The name of the feature to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the preview feature with the specified name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public FeatureResultInner get(String resourceProviderNamespace, String featureName) { - return getAsync(resourceProviderNamespace, featureName).block(); - } - - /** - * Gets the preview feature with the specified name. - * - * @param resourceProviderNamespace The resource provider namespace for the feature. - * @param featureName The name of the feature to get. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the preview feature with the specified name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceProviderNamespace, String featureName, Context context) { - return getWithResponseAsync(resourceProviderNamespace, featureName, context).block(); - } - - /** - * Registers the preview feature for the subscription. - * - * @param resourceProviderNamespace The namespace of the resource provider. - * @param featureName The name of the feature to register. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return previewed feature information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> registerWithResponseAsync( - String resourceProviderNamespace, String featureName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceProviderNamespace == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter resourceProviderNamespace is required and cannot be null.")); - } - if (featureName == null) { - return Mono.error(new IllegalArgumentException("Parameter featureName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .register( - this.client.getEndpoint(), - resourceProviderNamespace, - featureName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Registers the preview feature for the subscription. - * - * @param resourceProviderNamespace The namespace of the resource provider. - * @param featureName The name of the feature to register. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return previewed feature information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> registerWithResponseAsync( - String resourceProviderNamespace, String featureName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceProviderNamespace == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter resourceProviderNamespace is required and cannot be null.")); - } - if (featureName == null) { - return Mono.error(new IllegalArgumentException("Parameter featureName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .register( - this.client.getEndpoint(), - resourceProviderNamespace, - featureName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Registers the preview feature for the subscription. - * - * @param resourceProviderNamespace The namespace of the resource provider. - * @param featureName The name of the feature to register. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return previewed feature information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono registerAsync(String resourceProviderNamespace, String featureName) { - return registerWithResponseAsync(resourceProviderNamespace, featureName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Registers the preview feature for the subscription. - * - * @param resourceProviderNamespace The namespace of the resource provider. - * @param featureName The name of the feature to register. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return previewed feature information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public FeatureResultInner register(String resourceProviderNamespace, String featureName) { - return registerAsync(resourceProviderNamespace, featureName).block(); - } - - /** - * Registers the preview feature for the subscription. - * - * @param resourceProviderNamespace The namespace of the resource provider. - * @param featureName The name of the feature to register. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return previewed feature information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response registerWithResponse( - String resourceProviderNamespace, String featureName, Context context) { - return registerWithResponseAsync(resourceProviderNamespace, featureName, context).block(); - } - - /** - * Unregisters the preview feature for the subscription. - * - * @param resourceProviderNamespace The namespace of the resource provider. - * @param featureName The name of the feature to unregister. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return previewed feature information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> unregisterWithResponseAsync( - String resourceProviderNamespace, String featureName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceProviderNamespace == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter resourceProviderNamespace is required and cannot be null.")); - } - if (featureName == null) { - return Mono.error(new IllegalArgumentException("Parameter featureName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .unregister( - this.client.getEndpoint(), - resourceProviderNamespace, - featureName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Unregisters the preview feature for the subscription. - * - * @param resourceProviderNamespace The namespace of the resource provider. - * @param featureName The name of the feature to unregister. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return previewed feature information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> unregisterWithResponseAsync( - String resourceProviderNamespace, String featureName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceProviderNamespace == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter resourceProviderNamespace is required and cannot be null.")); - } - if (featureName == null) { - return Mono.error(new IllegalArgumentException("Parameter featureName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .unregister( - this.client.getEndpoint(), - resourceProviderNamespace, - featureName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Unregisters the preview feature for the subscription. - * - * @param resourceProviderNamespace The namespace of the resource provider. - * @param featureName The name of the feature to unregister. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return previewed feature information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono unregisterAsync(String resourceProviderNamespace, String featureName) { - return unregisterWithResponseAsync(resourceProviderNamespace, featureName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Unregisters the preview feature for the subscription. - * - * @param resourceProviderNamespace The namespace of the resource provider. - * @param featureName The name of the feature to unregister. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return previewed feature information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public FeatureResultInner unregister(String resourceProviderNamespace, String featureName) { - return unregisterAsync(resourceProviderNamespace, featureName).block(); - } - - /** - * Unregisters the preview feature for the subscription. - * - * @param resourceProviderNamespace The namespace of the resource provider. - * @param featureName The name of the feature to unregister. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return previewed feature information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response unregisterWithResponse( - String resourceProviderNamespace, String featureName, Context context) { - return unregisterWithResponseAsync(resourceProviderNamespace, featureName, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of previewed features. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAllNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext(context -> service.listAllNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of previewed features. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAllNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .listAllNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of previewed features. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of previewed features. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/FeaturesImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/FeaturesImpl.java deleted file mode 100644 index a28e544a8bab..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/FeaturesImpl.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.resources.models.Feature; -import com.azure.resourcemanager.resources.models.Features; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.ReadableWrappersImpl; -import com.azure.resourcemanager.resources.fluent.models.FeatureResultInner; -import com.azure.resourcemanager.resources.fluent.FeaturesClient; -import reactor.core.publisher.Mono; - -/** - * The implementation of {@link Features}. - */ -public final class FeaturesImpl - extends ReadableWrappersImpl - implements Features { - private final FeaturesClient client; - - public FeaturesImpl(final FeaturesClient client) { - this.client = client; - } - - @Override - public PagedIterable list() { - return wrapList(client.listAll()); - } - - @Override - public Feature register(String resourceProviderName, String featureName) { - return this.registerAsync(resourceProviderName, featureName).block(); - } - - @Override - public Mono registerAsync(String resourceProviderName, String featureName) { - return client.registerAsync(resourceProviderName, featureName) - .map(featureResultInner -> wrapModel(featureResultInner)); - } - - @Override - protected FeatureImpl wrapModel(FeatureResultInner inner) { - if (inner == null) { - return null; - } - return new FeatureImpl(inner); - } - - @Override - public PagedFlux listAsync() { - return wrapPageAsync(client.listAllAsync()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/GenericResourceImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/GenericResourceImpl.java deleted file mode 100644 index c2c61a5ecc9a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/GenericResourceImpl.java +++ /dev/null @@ -1,304 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.implementation; - -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.resources.ResourceManager; -import com.azure.resourcemanager.resources.fluentcore.model.Accepted; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.AcceptedImpl; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import com.azure.resourcemanager.resources.models.GenericResource; -import com.azure.resourcemanager.resources.models.Identity; -import com.azure.resourcemanager.resources.models.Plan; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils; -import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.GroupableResourceImpl; -import com.azure.resourcemanager.resources.fluent.models.GenericResourceInner; -import com.azure.resourcemanager.resources.fluent.ResourcesClient; -import com.azure.resourcemanager.resources.models.ResourceIdentityType; -import com.azure.resourcemanager.resources.models.Sku; -import reactor.core.publisher.Mono; - -/** - * The implementation for GenericResource and its nested interfaces. - */ -final class GenericResourceImpl - extends GroupableResourceImpl< - GenericResource, - GenericResourceInner, - GenericResourceImpl, - ResourceManager> - implements - GenericResource, - GenericResource.Definition, - GenericResource.UpdateStages.WithApiVersion, - GenericResource.Update { - - private final ClientLogger logger = new ClientLogger(GenericResourceImpl.class); - - private String resourceProviderNamespace; - private String parentResourcePath; - private String resourceType; - private String apiVersion; - - private GenericResourceInner createUpdateParameter = new GenericResourceInner(); - - GenericResourceImpl(String key, - GenericResourceInner innerModel, - final ResourceManager resourceManager) { - super(key, innerModel, resourceManager); - resourceProviderNamespace = ResourceUtils.resourceProviderFromResourceId(innerModel.id()); - resourceType = ResourceUtils.resourceTypeFromResourceId(innerModel.id()); - parentResourcePath = ResourceUtils.parentRelativePathFromResourceId(innerModel.id()); - } - - @Override - public String resourceProviderNamespace() { - return resourceProviderNamespace; - } - - @Override - public String parentResourcePath() { - if (parentResourcePath == null) { - return ""; - } - return parentResourcePath; - } - - @Override - public String resourceType() { - return resourceType; - } - - @Override - public String apiVersion() { - if (apiVersion == null) { - apiVersion = ResourceUtils.defaultApiVersion( - id(), manager().providers().getByName(ResourceUtils.resourceProviderFromResourceId(id()))); - } - return apiVersion; - } - - @Override - public Plan plan() { - return innerModel().plan(); - } - - @Override - public Object properties() { - return innerModel().properties(); - } - - @Override - public String kind() { - return innerModel().kind(); - } - - @Override - public Sku sku() { - return innerModel().sku(); - } - - @Override - public Identity identity() { - return innerModel().identity(); - } - - @Override - public String managedBy() { - return innerModel().managedBy(); - } - - @Override - protected Mono getInnerAsync() { - return this.manager().serviceClient().getResources().getAsync( - resourceGroupName(), - resourceProviderNamespace(), - parentResourcePath(), - resourceType(), - this.name(), - this.apiVersion()); - } - - @Override - public GenericResourceImpl update() { - this.createUpdateParameter = new GenericResourceInner(); - return super.update(); - } - - public GenericResourceImpl withProperties(Object properties) { - createUpdateParameter.withProperties(properties); - return this; - } - - @Override - public GenericResourceImpl withKind(String kind) { - createUpdateParameter.withKind(kind); - return this; - } - - @Override - public GenericResourceImpl withSku(Sku sku) { - createUpdateParameter.withSku(sku); - return this; - } - - @Override - public GenericResourceImpl withIdentity(Identity identity) { - createUpdateParameter.withIdentity(identity); - return this; - } - - @Override - public GenericResourceImpl withoutIdentity() { - this.withIdentity(new Identity().withType(ResourceIdentityType.NONE)); - return this; - } - - @Override - public GenericResourceImpl withParentResourceId(String parentResourceId) { - return withParentResourcePath(ResourceUtils.relativePathFromResourceId(parentResourceId)); - } - - @Override - public GenericResourceImpl withParentResourcePath(String parentResourcePath) { - this.parentResourcePath = parentResourcePath; - return this; - } - - public GenericResourceImpl withPlan(String name, String publisher, String product, String promotionCode) { - this.withPlan( - new Plan() - .withName(name) - .withPublisher(publisher) - .withProduct(product) - .withPromotionCode(promotionCode)); - return this; - } - - public GenericResourceImpl withPlan(Plan plan) { - createUpdateParameter.withPlan(plan); - return this; - } - - @Override - public GenericResourceImpl withoutPlan() { - createUpdateParameter.withPlan(null); - return this; - } - - @Override - public GenericResourceImpl withProviderNamespace(String resourceProviderNamespace) { - this.resourceProviderNamespace = resourceProviderNamespace; - return this; - } - - @Override - public GenericResourceImpl withResourceType(String resourceType) { - this.resourceType = resourceType; - return this; - } - - @Override - public GenericResourceImpl withApiVersion(String apiVersion) { - this.apiVersion = apiVersion; - return this; - } - - @Override - public Accepted beginCreate() { - String apiVersion = this.getApiVersionAsync().block(); - String name = isInCreateMode() ? this.name() : ResourceUtils.nameFromResourceId(innerModel().id()); - createUpdateParameter.withLocation(innerModel().location()); - createUpdateParameter.withTags(innerModel().tags()); - - return AcceptedImpl.newAccepted(logger, - this.manager().serviceClient().getHttpPipeline(), - this.manager().serviceClient().getDefaultPollInterval(), - () -> this.manager().serviceClient().getResources() - .createOrUpdateWithResponseAsync( - resourceGroupName(), - resourceProviderNamespace, - parentResourcePath(), - resourceType, - name, - apiVersion, - createUpdateParameter).block(), - inner -> new GenericResourceImpl(inner.id(), inner, this.manager()), - GenericResourceInner.class, - null, - this::setInner, - Context.NONE); - } - - // CreateUpdateTaskGroup.ResourceCreator implementation - @Override - public Mono createResourceAsync() { - Mono observable = this.getApiVersionAsync(); - final ResourcesClient resourceClient = this.manager().serviceClient().getResources(); - return observable - .flatMap(api -> { - String name = this.name(); - createUpdateParameter.withLocation(innerModel().location()); - createUpdateParameter.withTags(innerModel().tags()); - return resourceClient.createOrUpdateAsync( - resourceGroupName(), - resourceProviderNamespace, - parentResourcePath(), - resourceType, - name, - api, - createUpdateParameter) - .subscribeOn(ResourceManagerUtils.InternalRuntimeContext.getReactorScheduler()) - .map(innerToFluentMap(this)); - }); - } - - @Override - public Mono updateResourceAsync() { - Mono observable = this.getApiVersionAsync(); - final ResourcesClient resourceClient = this.manager().serviceClient().getResources(); - return observable - .flatMap(api -> { - String name = ResourceUtils.nameFromResourceId(innerModel().id()); - createUpdateParameter.withTags(innerModel().tags()); - return resourceClient.updateAsync( - resourceGroupName(), - resourceProviderNamespace, - parentResourcePath(), - resourceType, - name, - api, - createUpdateParameter) - .subscribeOn(ResourceManagerUtils.InternalRuntimeContext.getReactorScheduler()) - .map(innerToFluentMap(this)); - }); - } - - private Mono getApiVersionAsync() { - Mono apiVersion; - if (this.apiVersion != null) { - apiVersion = Mono.just(this.apiVersion); - } else { - apiVersion = this.manager().providers().getByNameAsync(resourceProviderNamespace) - .flatMap(provider -> { - String id; - if (!isInCreateMode()) { - id = innerModel().id(); - } else { - id = ResourceUtils.constructResourceId( - this.manager().subscriptionId(), - resourceGroupName(), - resourceProviderNamespace(), - resourceType(), - this.name(), - parentResourcePath()); - } - this.apiVersion = ResourceUtils.defaultApiVersion(id, provider); - return Mono.just(this.apiVersion); - }); - } - return apiVersion; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/GenericResourcesImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/GenericResourcesImpl.java deleted file mode 100644 index 40c2f7c83028..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/GenericResourcesImpl.java +++ /dev/null @@ -1,337 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.core.util.CoreUtils; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.resources.ResourceManager; -import com.azure.resourcemanager.resources.fluentcore.model.Accepted; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.AcceptedImpl; -import com.azure.resourcemanager.resources.models.GenericResource; -import com.azure.resourcemanager.resources.models.GenericResources; -import com.azure.resourcemanager.resources.models.ResourceGroup; -import com.azure.resourcemanager.resources.models.ResourcesMoveInfo; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.GroupableResourcesImpl; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import com.azure.resourcemanager.resources.fluent.models.GenericResourceInner; -import com.azure.resourcemanager.resources.fluent.ResourcesClient; -import reactor.core.publisher.Mono; - -import java.util.List; -import java.util.function.Function; -import com.azure.resourcemanager.resources.fluentcore.utils.PagedConverter; - -/** - * Implementation of the {@link GenericResources}. - */ -public final class GenericResourcesImpl - extends GroupableResourcesImpl< - GenericResource, - GenericResourceImpl, - GenericResourceInner, - ResourcesClient, - ResourceManager> - implements GenericResources { - private final ClientLogger logger = new ClientLogger(getClass()); - - public GenericResourcesImpl(ResourceManager resourceManager) { - super(resourceManager.serviceClient().getResources(), resourceManager); - } - - @Override - public PagedIterable list() { - return new PagedIterable<>(this.listAsync()); - } - - @Override - public PagedIterable listByResourceGroup(String groupName) { - return new PagedIterable<>(this.listByResourceGroupAsync(groupName)); - } - - @Override - public PagedIterable listByTag(String resourceGroupName, String tagName, String tagValue) { - return new PagedIterable<>(this.listByTagAsync(resourceGroupName, tagName, tagValue)); - } - - @Override - public PagedFlux listByTagAsync(String resourceGroupName, String tagName, String tagValue) { - return wrapPageAsync(PagedConverter.mapPage(this.manager().serviceClient().getResources() - .listByResourceGroupAsync(resourceGroupName, - ResourceManagerUtils.createOdataFilterForTags(tagName, tagValue), null, null), - res -> (GenericResourceInner) res)); - } - - @Override - public GenericResource.DefinitionStages.Blank define(String name) { - return new GenericResourceImpl( - name, - new GenericResourceInner(), - this.manager()); - } - - @Override - public boolean checkExistence(String resourceGroupName, String resourceProviderNamespace, - String parentResourcePath, String resourceType, String resourceName, String apiVersion) { - return this.inner().checkExistence( - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - apiVersion); - } - - @Override - public boolean checkExistenceById(String id) { - if (CoreUtils.isNullOrEmpty(id)) { - throw logger.logExceptionAsError( - new IllegalArgumentException("Parameter 'id' is required and cannot be null.")); - } - String apiVersion = getApiVersionFromIdAsync(id).block(); - return this.checkExistenceById(id, apiVersion); - } - - @Override - public boolean checkExistenceById(String id, String apiVersion) { - if (CoreUtils.isNullOrEmpty(id)) { - throw logger.logExceptionAsError( - new IllegalArgumentException("Parameter 'id' is required and cannot be null.")); - } - if (CoreUtils.isNullOrEmpty(apiVersion)) { - throw logger.logExceptionAsError( - new IllegalArgumentException("Parameter 'apiVersion' is required and cannot be null.")); - } - return this.inner().checkExistenceById(id, apiVersion); - } - - @Override - public Mono getByIdAsync(String id) { - if (CoreUtils.isNullOrEmpty(id)) { - return Mono.error( - new IllegalArgumentException("Parameter 'id' is required and cannot be null.")); - } - return this.getApiVersionFromIdAsync(id) - .flatMap(apiVersion -> this.getByIdAsync(id, apiVersion)); - } - - @Override - public GenericResource getById(String id, String apiVersion) { - return this.getByIdAsync(id, apiVersion).block(); - } - - @Override - public Mono getByIdAsync(String id, String apiVersion) { - if (CoreUtils.isNullOrEmpty(id)) { - return Mono.error( - new IllegalArgumentException("Parameter 'id' is required and cannot be null.")); - } - if (CoreUtils.isNullOrEmpty(apiVersion)) { - return Mono.error( - new IllegalArgumentException("Parameter 'apiVersion' is required and cannot be null.")); - } - return this.inner().getByIdAsync(id, apiVersion) - .map(this::wrapModel) - .map(r -> r.withApiVersion(apiVersion)); - } - - @Override - public Mono deleteByIdAsync(final String id) { - if (CoreUtils.isNullOrEmpty(id)) { - return Mono.error( - new IllegalArgumentException("Parameter 'id' is required and cannot be null.")); - } - return getApiVersionFromIdAsync(id) - .flatMap(apiVersion -> this.deleteByIdAsync(id, apiVersion)); - } - - @Override - public void deleteById(String id, String apiVersion) { - this.deleteByIdAsync(id, apiVersion).block(); - } - - @Override - public Mono deleteByIdAsync(String id, String apiVersion) { - if (CoreUtils.isNullOrEmpty(id)) { - return Mono.error( - new IllegalArgumentException("Parameter 'id' is required and cannot be null.")); - } - if (CoreUtils.isNullOrEmpty(apiVersion)) { - return Mono.error( - new IllegalArgumentException("Parameter 'apiVersion' is required and cannot be null.")); - } - return this.inner().deleteByIdAsync(id, apiVersion); - } - - @Override - public GenericResource get( - String resourceGroupName, - String providerNamespace, - String resourceType, - String name) { - - PagedIterable genericResources = this.listByResourceGroup(resourceGroupName); - for (GenericResource resource : genericResources) { - if (resource.name().equalsIgnoreCase(name) - && resource.resourceProviderNamespace().equalsIgnoreCase(providerNamespace) - && resource.resourceType().equalsIgnoreCase(resourceType)) { - return resource; - } - } - return null; - } - - @Override - public GenericResource get( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String apiVersion) { - - // Correct for auto-gen'd API's treatment parent path as required - // even though it makes sense only for child resources - if (parentResourcePath == null) { - parentResourcePath = ""; - } - - GenericResourceInner inner = this.inner().get( - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - apiVersion); - - GenericResourceImpl resource = new GenericResourceImpl( - resourceName, - inner, - this.manager()); - - return resource.withExistingResourceGroup(resourceGroupName) - .withProviderNamespace(resourceProviderNamespace) - .withParentResourcePath(parentResourcePath) - .withResourceType(resourceType) - .withApiVersion(apiVersion); - } - - @Override - public void moveResources(String sourceResourceGroupName, - ResourceGroup targetResourceGroup, List resources) { - this.moveResourcesAsync(sourceResourceGroupName, targetResourceGroup, resources).block(); - } - - @Override - public Mono moveResourcesAsync(String sourceResourceGroupName, - ResourceGroup targetResourceGroup, List resources) { - ResourcesMoveInfo moveInfo = new ResourcesMoveInfo(); - moveInfo.withTargetResourceGroup(targetResourceGroup.id()); - moveInfo.withResources(resources); - return this.inner().moveResourcesAsync(sourceResourceGroupName, moveInfo); - } - - public void delete(String resourceGroupName, String resourceProviderNamespace, - String parentResourcePath, String resourceType, String resourceName, String apiVersion) { - deleteAsync(resourceGroupName, resourceProviderNamespace, - parentResourcePath, resourceType, resourceName, apiVersion).block(); - } - - @Override - public Mono deleteAsync(String resourceGroupName, String resourceProviderNamespace, - String parentResourcePath, String resourceType, String resourceName, String apiVersion) { - return this.inner().deleteAsync(resourceGroupName, resourceProviderNamespace, - parentResourcePath, resourceType, resourceName, apiVersion); - } - - @Override - protected GenericResourceImpl wrapModel(String id) { - return new GenericResourceImpl(id, new GenericResourceInner(), this.manager()) - .withExistingResourceGroup(ResourceUtils.groupFromResourceId(id)) - .withProviderNamespace(ResourceUtils.resourceProviderFromResourceId(id)) - .withResourceType(ResourceUtils.resourceTypeFromResourceId(id)) - .withParentResourceId(ResourceUtils.parentResourceIdFromResourceId(id)); - } - - @Override - protected GenericResourceImpl wrapModel(GenericResourceInner inner) { - if (inner == null) { - return null; - } - return new GenericResourceImpl(inner.id(), inner, this.manager()) - .withExistingResourceGroup(ResourceUtils.groupFromResourceId(inner.id())) - .withProviderNamespace(ResourceUtils.resourceProviderFromResourceId(inner.id())) - .withResourceType(ResourceUtils.resourceTypeFromResourceId(inner.id())) - .withParentResourceId(ResourceUtils.parentResourceIdFromResourceId(inner.id())); - } - - @Override - public Mono getInnerAsync(String groupName, String name) { - // Not needed, can't be supported, provided only to satisfy GroupableResourceImpl's requirements - throw logger.logExceptionAsError(new UnsupportedOperationException( - "Get just by resource group and name is not supported. Please use other overloads.")); - } - - @Override - protected Mono deleteInnerAsync(String resourceGroupName, String name) { - // Not needed, can't be supported, provided only to satisfy GroupableResourceImpl's requirements - throw logger.logExceptionAsError(new UnsupportedOperationException( - "Delete just by resource group and name is not supported. Please use other overloads.")); - } - - @Override - public Accepted beginDeleteById(String id) { - if (CoreUtils.isNullOrEmpty(id)) { - throw logger.logExceptionAsError( - new IllegalArgumentException("Parameter 'id' is required and cannot be null.")); - } - String apiVersion = getApiVersionFromIdAsync(id).block(); - return this.beginDeleteById(id, apiVersion); - } - - @Override - public Accepted beginDeleteById(String id, String apiVersion) { - if (CoreUtils.isNullOrEmpty(id)) { - throw logger.logExceptionAsError( - new IllegalArgumentException("Parameter 'id' is required and cannot be null.")); - } - if (CoreUtils.isNullOrEmpty(apiVersion)) { - throw logger.logExceptionAsError( - new IllegalArgumentException("Parameter 'apiVersion' is required and cannot be null.")); - } - return AcceptedImpl.newAccepted(logger, - this.manager().serviceClient().getHttpPipeline(), - this.manager().serviceClient().getDefaultPollInterval(), - () -> this.inner().deleteByIdWithResponseAsync(id, apiVersion).block(), - Function.identity(), - Void.class, - null, - Context.NONE); - } - - private Mono getApiVersionFromIdAsync(final String id) { - return this.manager().providers().getByNameAsync(ResourceUtils.resourceProviderFromResourceId(id)) - .map(provider -> ResourceUtils.defaultApiVersion(id, provider)); - } - - @Override - public PagedFlux listAsync() { - return wrapPageAsync(PagedConverter.mapPage(this.inner().listAsync(), - res -> (GenericResourceInner) res)); - } - - @Override - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - if (CoreUtils.isNullOrEmpty(resourceGroupName)) { - return new PagedFlux<>(() -> Mono.error( - new IllegalArgumentException("Parameter 'resourceGroupName' is required and cannot be null."))); - } - return wrapPageAsync(PagedConverter.mapPage(this.manager().serviceClient().getResources() - .listByResourceGroupAsync(resourceGroupName), - res -> (GenericResourceInner) res)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/LocationImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/LocationImpl.java deleted file mode 100644 index db2fa5ee4400..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/LocationImpl.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.implementation; - -import com.azure.resourcemanager.resources.models.Location; -import com.azure.core.management.Region; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.IndexableWrapperImpl; -import com.azure.resourcemanager.resources.fluent.models.LocationInner; - -/** - * The implementation of {@link Location}. - */ -final class LocationImpl extends - IndexableWrapperImpl - implements - Location { - LocationImpl(LocationInner innerModel) { - super(innerModel); - } - - @Override - public String subscriptionId() { - return this.innerModel().subscriptionId(); - } - - @Override - public String name() { - return this.innerModel().name(); - } - - @Override - public String displayName() { - return this.innerModel().displayName(); - } - - @Override - public String latitude() { - return this.innerModel().latitude(); - } - - @Override - public String longitude() { - return this.innerModel().longitude(); - } - - @Override - public Region region() { - return Region.fromName(this.name()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ManagementLockClientBuilder.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ManagementLockClientBuilder.java deleted file mode 100644 index 85888277b31f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ManagementLockClientBuilder.java +++ /dev/null @@ -1,146 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.implementation; - -import com.azure.core.annotation.ServiceClientBuilder; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.policy.CookiePolicy; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerAdapter; -import java.time.Duration; - -/** A builder for creating a new instance of the ManagementLockClientImpl type. */ -@ServiceClientBuilder(serviceClients = {ManagementLockClientImpl.class}) -public final class ManagementLockClientBuilder { - /* - * The ID of the target subscription. - */ - private String subscriptionId; - - /** - * Sets The ID of the target subscription. - * - * @param subscriptionId the subscriptionId value. - * @return the ManagementLockClientBuilder. - */ - public ManagementLockClientBuilder subscriptionId(String subscriptionId) { - this.subscriptionId = subscriptionId; - return this; - } - - /* - * server parameter - */ - private String endpoint; - - /** - * Sets server parameter. - * - * @param endpoint the endpoint value. - * @return the ManagementLockClientBuilder. - */ - public ManagementLockClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * The environment to connect to - */ - private AzureEnvironment environment; - - /** - * Sets The environment to connect to. - * - * @param environment the environment value. - * @return the ManagementLockClientBuilder. - */ - public ManagementLockClientBuilder environment(AzureEnvironment environment) { - this.environment = environment; - return this; - } - - /* - * The default poll interval for long-running operation - */ - private Duration defaultPollInterval; - - /** - * Sets The default poll interval for long-running operation. - * - * @param defaultPollInterval the defaultPollInterval value. - * @return the ManagementLockClientBuilder. - */ - public ManagementLockClientBuilder defaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = defaultPollInterval; - return this; - } - - /* - * The HTTP pipeline to send requests through - */ - private HttpPipeline pipeline; - - /** - * Sets The HTTP pipeline to send requests through. - * - * @param pipeline the pipeline value. - * @return the ManagementLockClientBuilder. - */ - public ManagementLockClientBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; - return this; - } - - /* - * The serializer to serialize an object into a string - */ - private SerializerAdapter serializerAdapter; - - /** - * Sets The serializer to serialize an object into a string. - * - * @param serializerAdapter the serializerAdapter value. - * @return the ManagementLockClientBuilder. - */ - public ManagementLockClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { - this.serializerAdapter = serializerAdapter; - return this; - } - - /** - * Builds an instance of ManagementLockClientImpl with the provided parameters. - * - * @return an instance of ManagementLockClientImpl. - */ - public ManagementLockClientImpl buildClient() { - if (endpoint == null) { - this.endpoint = "https://management.azure.com"; - } - if (environment == null) { - this.environment = AzureEnvironment.AZURE; - } - if (defaultPollInterval == null) { - this.defaultPollInterval = Duration.ofSeconds(30); - } - if (pipeline == null) { - this.pipeline = - new HttpPipelineBuilder() - .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) - .build(); - } - if (serializerAdapter == null) { - this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); - } - ManagementLockClientImpl client = - new ManagementLockClientImpl( - pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); - return client; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ManagementLockClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ManagementLockClientImpl.java deleted file mode 100644 index 8c07e4222c7b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ManagementLockClientImpl.java +++ /dev/null @@ -1,146 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.implementation; - -import com.azure.core.annotation.ServiceClient; -import com.azure.core.http.HttpPipeline; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.serializer.SerializerAdapter; -import com.azure.resourcemanager.resources.fluent.AuthorizationOperationsClient; -import com.azure.resourcemanager.resources.fluent.ManagementLockClient; -import com.azure.resourcemanager.resources.fluent.ManagementLocksClient; -import com.azure.resourcemanager.resources.fluentcore.AzureServiceClient; -import java.time.Duration; - -/** Initializes a new instance of the ManagementLockClientImpl type. */ -@ServiceClient(builder = ManagementLockClientBuilder.class) -public final class ManagementLockClientImpl extends AzureServiceClient implements ManagementLockClient { - private final ClientLogger logger = new ClientLogger(ManagementLockClientImpl.class); - - /** The ID of the target subscription. */ - private final String subscriptionId; - - /** - * Gets The ID of the target subscription. - * - * @return the subscriptionId value. - */ - public String getSubscriptionId() { - return this.subscriptionId; - } - - /** server parameter. */ - private final String endpoint; - - /** - * Gets server parameter. - * - * @return the endpoint value. - */ - public String getEndpoint() { - return this.endpoint; - } - - /** Api Version. */ - private final String apiVersion; - - /** - * Gets Api Version. - * - * @return the apiVersion value. - */ - public String getApiVersion() { - return this.apiVersion; - } - - /** The HTTP pipeline to send requests through. */ - private final HttpPipeline httpPipeline; - - /** - * Gets The HTTP pipeline to send requests through. - * - * @return the httpPipeline value. - */ - public HttpPipeline getHttpPipeline() { - return this.httpPipeline; - } - - /** The serializer to serialize an object into a string. */ - private final SerializerAdapter serializerAdapter; - - /** - * Gets The serializer to serialize an object into a string. - * - * @return the serializerAdapter value. - */ - SerializerAdapter getSerializerAdapter() { - return this.serializerAdapter; - } - - /** The default poll interval for long-running operation. */ - private final Duration defaultPollInterval; - - /** - * Gets The default poll interval for long-running operation. - * - * @return the defaultPollInterval value. - */ - public Duration getDefaultPollInterval() { - return this.defaultPollInterval; - } - - /** The AuthorizationOperationsClient object to access its operations. */ - private final AuthorizationOperationsClient authorizationOperations; - - /** - * Gets the AuthorizationOperationsClient object to access its operations. - * - * @return the AuthorizationOperationsClient object. - */ - public AuthorizationOperationsClient getAuthorizationOperations() { - return this.authorizationOperations; - } - - /** The ManagementLocksClient object to access its operations. */ - private final ManagementLocksClient managementLocks; - - /** - * Gets the ManagementLocksClient object to access its operations. - * - * @return the ManagementLocksClient object. - */ - public ManagementLocksClient getManagementLocks() { - return this.managementLocks; - } - - /** - * Initializes an instance of ManagementLockClient client. - * - * @param httpPipeline The HTTP pipeline to send requests through. - * @param serializerAdapter The serializer to serialize an object into a string. - * @param defaultPollInterval The default poll interval for long-running operation. - * @param environment The Azure environment. - * @param subscriptionId The ID of the target subscription. - * @param endpoint server parameter. - */ - ManagementLockClientImpl( - HttpPipeline httpPipeline, - SerializerAdapter serializerAdapter, - Duration defaultPollInterval, - AzureEnvironment environment, - String subscriptionId, - String endpoint) { - super(httpPipeline, serializerAdapter, environment); - this.httpPipeline = httpPipeline; - this.serializerAdapter = serializerAdapter; - this.defaultPollInterval = defaultPollInterval; - this.subscriptionId = subscriptionId; - this.endpoint = endpoint; - this.apiVersion = "2016-09-01"; - this.authorizationOperations = new AuthorizationOperationsClientImpl(this); - this.managementLocks = new ManagementLocksClientImpl(this); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ManagementLockImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ManagementLockImpl.java deleted file mode 100644 index 524ce32e865a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ManagementLockImpl.java +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.implementation; - -import com.azure.core.util.CoreUtils; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.resources.ResourceManager; -import com.azure.resourcemanager.resources.fluent.models.ManagementLockObjectInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.Resource; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.CreatableUpdatableImpl; -import com.azure.resourcemanager.resources.models.LockLevel; -import com.azure.resourcemanager.resources.models.ManagementLock; -import com.azure.resourcemanager.resources.models.ManagementLockOwner; -import com.azure.resourcemanager.resources.models.ResourceGroup; -import reactor.core.publisher.Mono; - -import java.util.Collections; -import java.util.List; - -/** - * Implementation for ManagementLock and its create and update interfaces. - */ -final class ManagementLockImpl - extends CreatableUpdatableImpl - implements - ManagementLock, - ManagementLock.Definition, - ManagementLock.Update { - - private final ResourceManager manager; - private String lockedResourceId = null; - private final ClientLogger logger = new ClientLogger(ManagementLockImpl.class); - - ManagementLockImpl( - String name, - ManagementLockObjectInner innerModel, - final ResourceManager manager) { - super(name, innerModel); - this.manager = manager; - } - - @Override - protected Mono getInnerAsync() { - return this.manager().managementLockClient().getManagementLocks() - .getByScopeAsync(this.lockedResourceId(), this.name()); - } - - @Override - public ManagementLockImpl withNotes(String notes) { - this.innerModel().withNotes(notes); - return this; - } - - @Override - public ManagementLockImpl withLevel(LockLevel level) { - this.innerModel().withLevel(level); - return this; - } - - @Override - public ManagementLockImpl withLockedResource(String resourceId) { - if (!CoreUtils.isNullOrEmpty(resourceId)) { - this.lockedResourceId = resourceId; - } else { - throw logger.logExceptionAsError(new IllegalArgumentException("Missing resource ID.")); - } - return this; - } - - @Override - public ManagementLockImpl withLockedResource(Resource resource) { - if (resource != null) { - this.lockedResourceId = resource.id(); - } else { - throw logger.logExceptionAsError(new IllegalArgumentException("Missing resource ID.")); - } - return this; - } - - @Override - public ManagementLockImpl withLockedResourceGroup(String resourceGroupName) { - return withLockedResource( - "/subscriptions/" + this.manager().subscriptionId() + "/resourceGroups/" + resourceGroupName); - } - - @Override - public ManagementLockImpl withLockedResourceGroup(ResourceGroup resourceGroup) { - if (resourceGroup != null) { - this.lockedResourceId = resourceGroup.id(); - } else { - throw logger.logExceptionAsError(new IllegalArgumentException("Missing resource group ID.")); - } - return this; - } - - @Override - public ResourceManager manager() { - return this.manager; - } - - @Override - public Mono createResourceAsync() { - return this.manager().managementLockClient() - .getManagementLocks() - .createOrUpdateByScopeAsync(this.lockedResourceId(), this.name(), this.innerModel()) - .map(innerToFluentMap(this)); - } - - @Override - public boolean isInCreateMode() { - return this.innerModel().id() == null; - } - - @Override - public LockLevel level() { - return this.innerModel().level(); - } - - @Override - public String lockedResourceId() { - if (this.lockedResourceId == null) { - this.lockedResourceId = ManagementLocksImpl.resourceIdFromLockId(this.innerModel().id()); - } - return this.lockedResourceId; - } - - @Override - public String notes() { - return this.innerModel().notes(); - } - - @Override - public List owners() { - if (this.innerModel().owners() == null) { - return null; - } - return Collections.unmodifiableList(this.innerModel().owners()); - } - - @Override - public String id() { - return this.innerModel().id(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ManagementLocksClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ManagementLocksClientImpl.java deleted file mode 100644 index 9c6b8b2f9a93..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ManagementLocksClientImpl.java +++ /dev/null @@ -1,3597 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.resources.fluent.ManagementLocksClient; -import com.azure.resourcemanager.resources.fluent.models.ManagementLockObjectInner; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import com.azure.resourcemanager.resources.models.ManagementLockListResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ManagementLocksClient. */ -public final class ManagementLocksClientImpl - implements InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete, - ManagementLocksClient { - private final ClientLogger logger = new ClientLogger(ManagementLocksClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final ManagementLocksService service; - - /** The service client containing this operation class. */ - private final ManagementLockClientImpl client; - - /** - * Initializes an instance of ManagementLocksClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ManagementLocksClientImpl(ManagementLockClientImpl client) { - this.service = - RestProxy.create(ManagementLocksService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for ManagementLockClientManagementLocks to be used by the proxy service - * to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "ManagementLockClient") - private interface ManagementLocksService { - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/locks" - + "/{lockName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdateAtResourceGroupLevel( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("lockName") String lockName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") ManagementLockObjectInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/locks" - + "/{lockName}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("lockName") String lockName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/locks" - + "/{lockName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("lockName") String lockName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put("/{scope}/providers/Microsoft.Authorization/locks/{lockName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdateByScope( - @HostParam("$host") String endpoint, - @PathParam("scope") String scope, - @PathParam("lockName") String lockName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ManagementLockObjectInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete("/{scope}/providers/Microsoft.Authorization/locks/{lockName}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteByScope( - @HostParam("$host") String endpoint, - @PathParam("scope") String scope, - @PathParam("lockName") String lockName, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/{scope}/providers/Microsoft.Authorization/locks/{lockName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByScope( - @HostParam("$host") String endpoint, - @PathParam("scope") String scope, - @PathParam("lockName") String lockName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}" - + "/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/locks" - + "/{lockName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdateAtResourceLevel( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("resourceProviderNamespace") String resourceProviderNamespace, - @PathParam(value = "parentResourcePath", encoded = true) String parentResourcePath, - @PathParam(value = "resourceType", encoded = true) String resourceType, - @PathParam("resourceName") String resourceName, - @PathParam("lockName") String lockName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") ManagementLockObjectInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}" - + "/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/locks" - + "/{lockName}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteAtResourceLevel( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("resourceProviderNamespace") String resourceProviderNamespace, - @PathParam(value = "parentResourcePath", encoded = true) String parentResourcePath, - @PathParam(value = "resourceType", encoded = true) String resourceType, - @PathParam("resourceName") String resourceName, - @PathParam("lockName") String lockName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}" - + "/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/locks" - + "/{lockName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getAtResourceLevel( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("resourceProviderNamespace") String resourceProviderNamespace, - @PathParam(value = "parentResourcePath", encoded = true) String parentResourcePath, - @PathParam(value = "resourceType", encoded = true) String resourceType, - @PathParam("resourceName") String resourceName, - @PathParam("lockName") String lockName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/locks/{lockName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdateAtSubscriptionLevel( - @HostParam("$host") String endpoint, - @PathParam("lockName") String lockName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") ManagementLockObjectInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/locks/{lockName}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteAtSubscriptionLevel( - @HostParam("$host") String endpoint, - @PathParam("lockName") String lockName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/locks/{lockName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getAtSubscriptionLevel( - @HostParam("$host") String endpoint, - @PathParam("lockName") String lockName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization" - + "/locks") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("$filter") String filter, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}" - + "/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/locks") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAtResourceLevel( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("resourceProviderNamespace") String resourceProviderNamespace, - @PathParam(value = "parentResourcePath", encoded = true) String parentResourcePath, - @PathParam(value = "resourceType", encoded = true) String resourceType, - @PathParam("resourceName") String resourceName, - @QueryParam("$filter") String filter, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/locks") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("$filter") String filter, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/{scope}/providers/Microsoft.Authorization/locks") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByScope( - @HostParam("$host") String endpoint, - @PathParam("scope") String scope, - @QueryParam("$filter") String filter, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAtResourceGroupLevelNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAtResourceLevelNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAtSubscriptionLevelNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByScopeNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * When you apply a lock at a parent scope, all child resources inherit the same lock. To create management locks, - * you must have access to Microsoft.Authorization/* or Microsoft.Authorization/locks/* actions. Of the built-in - * roles, only Owner and User Access Administrator are granted those actions. - * - * @param resourceGroupName The name of the resource group to lock. - * @param lockName The lock name. The lock name can be a maximum of 260 characters. It cannot contain <, > %, - * &, :, \, ?, /, or any control characters. - * @param parameters The management lock parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the lock information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateAtResourceGroupLevelWithResponseAsync( - String resourceGroupName, String lockName, ManagementLockObjectInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (lockName == null) { - return Mono.error(new IllegalArgumentException("Parameter lockName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdateAtResourceGroupLevel( - this.client.getEndpoint(), - resourceGroupName, - lockName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * When you apply a lock at a parent scope, all child resources inherit the same lock. To create management locks, - * you must have access to Microsoft.Authorization/* or Microsoft.Authorization/locks/* actions. Of the built-in - * roles, only Owner and User Access Administrator are granted those actions. - * - * @param resourceGroupName The name of the resource group to lock. - * @param lockName The lock name. The lock name can be a maximum of 260 characters. It cannot contain <, > %, - * &, :, \, ?, /, or any control characters. - * @param parameters The management lock parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the lock information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateAtResourceGroupLevelWithResponseAsync( - String resourceGroupName, String lockName, ManagementLockObjectInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (lockName == null) { - return Mono.error(new IllegalArgumentException("Parameter lockName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdateAtResourceGroupLevel( - this.client.getEndpoint(), - resourceGroupName, - lockName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * When you apply a lock at a parent scope, all child resources inherit the same lock. To create management locks, - * you must have access to Microsoft.Authorization/* or Microsoft.Authorization/locks/* actions. Of the built-in - * roles, only Owner and User Access Administrator are granted those actions. - * - * @param resourceGroupName The name of the resource group to lock. - * @param lockName The lock name. The lock name can be a maximum of 260 characters. It cannot contain <, > %, - * &, :, \, ?, /, or any control characters. - * @param parameters The management lock parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the lock information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAtResourceGroupLevelAsync( - String resourceGroupName, String lockName, ManagementLockObjectInner parameters) { - return createOrUpdateAtResourceGroupLevelWithResponseAsync(resourceGroupName, lockName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * When you apply a lock at a parent scope, all child resources inherit the same lock. To create management locks, - * you must have access to Microsoft.Authorization/* or Microsoft.Authorization/locks/* actions. Of the built-in - * roles, only Owner and User Access Administrator are granted those actions. - * - * @param resourceGroupName The name of the resource group to lock. - * @param lockName The lock name. The lock name can be a maximum of 260 characters. It cannot contain <, > %, - * &, :, \, ?, /, or any control characters. - * @param parameters The management lock parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the lock information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ManagementLockObjectInner createOrUpdateAtResourceGroupLevel( - String resourceGroupName, String lockName, ManagementLockObjectInner parameters) { - return createOrUpdateAtResourceGroupLevelAsync(resourceGroupName, lockName, parameters).block(); - } - - /** - * When you apply a lock at a parent scope, all child resources inherit the same lock. To create management locks, - * you must have access to Microsoft.Authorization/* or Microsoft.Authorization/locks/* actions. Of the built-in - * roles, only Owner and User Access Administrator are granted those actions. - * - * @param resourceGroupName The name of the resource group to lock. - * @param lockName The lock name. The lock name can be a maximum of 260 characters. It cannot contain <, > %, - * &, :, \, ?, /, or any control characters. - * @param parameters The management lock parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the lock information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateAtResourceGroupLevelWithResponse( - String resourceGroupName, String lockName, ManagementLockObjectInner parameters, Context context) { - return createOrUpdateAtResourceGroupLevelWithResponseAsync(resourceGroupName, lockName, parameters, context) - .block(); - } - - /** - * To delete management locks, you must have access to Microsoft.Authorization/* or Microsoft.Authorization/locks/* - * actions. Of the built-in roles, only Owner and User Access Administrator are granted those actions. - * - * @param resourceGroupName The name of the resource group containing the lock. - * @param lockName The name of lock to delete. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String resourceGroupName, String lockName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (lockName == null) { - return Mono.error(new IllegalArgumentException("Parameter lockName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - lockName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * To delete management locks, you must have access to Microsoft.Authorization/* or Microsoft.Authorization/locks/* - * actions. Of the built-in roles, only Owner and User Access Administrator are granted those actions. - * - * @param resourceGroupName The name of the resource group containing the lock. - * @param lockName The name of lock to delete. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String lockName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (lockName == null) { - return Mono.error(new IllegalArgumentException("Parameter lockName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - lockName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - context); - } - - /** - * To delete management locks, you must have access to Microsoft.Authorization/* or Microsoft.Authorization/locks/* - * actions. Of the built-in roles, only Owner and User Access Administrator are granted those actions. - * - * @param resourceGroupName The name of the resource group containing the lock. - * @param lockName The name of lock to delete. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String lockName) { - return deleteWithResponseAsync(resourceGroupName, lockName).flatMap((Response res) -> Mono.empty()); - } - - /** - * To delete management locks, you must have access to Microsoft.Authorization/* or Microsoft.Authorization/locks/* - * actions. Of the built-in roles, only Owner and User Access Administrator are granted those actions. - * - * @param resourceGroupName The name of the resource group containing the lock. - * @param lockName The name of lock to delete. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String lockName) { - deleteAsync(resourceGroupName, lockName).block(); - } - - /** - * To delete management locks, you must have access to Microsoft.Authorization/* or Microsoft.Authorization/locks/* - * actions. Of the built-in roles, only Owner and User Access Administrator are granted those actions. - * - * @param resourceGroupName The name of the resource group containing the lock. - * @param lockName The name of lock to delete. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String lockName, Context context) { - return deleteWithResponseAsync(resourceGroupName, lockName, context).block(); - } - - /** - * Gets a management lock at the resource group level. - * - * @param resourceGroupName The name of the locked resource group. - * @param lockName The name of the lock to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a management lock at the resource group level. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String lockName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (lockName == null) { - return Mono.error(new IllegalArgumentException("Parameter lockName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - lockName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a management lock at the resource group level. - * - * @param resourceGroupName The name of the locked resource group. - * @param lockName The name of the lock to get. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a management lock at the resource group level. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String lockName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (lockName == null) { - return Mono.error(new IllegalArgumentException("Parameter lockName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - lockName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets a management lock at the resource group level. - * - * @param resourceGroupName The name of the locked resource group. - * @param lockName The name of the lock to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a management lock at the resource group level. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync(String resourceGroupName, String lockName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, lockName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a management lock at the resource group level. - * - * @param resourceGroupName The name of the locked resource group. - * @param lockName The name of the lock to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a management lock at the resource group level. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ManagementLockObjectInner getByResourceGroup(String resourceGroupName, String lockName) { - return getByResourceGroupAsync(resourceGroupName, lockName).block(); - } - - /** - * Gets a management lock at the resource group level. - * - * @param resourceGroupName The name of the locked resource group. - * @param lockName The name of the lock to get. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a management lock at the resource group level. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String lockName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, lockName, context).block(); - } - - /** - * Create or update a management lock by scope. - * - * @param scope The scope for the lock. When providing a scope for the assignment, use - * '/subscriptions/{subscriptionId}' for subscriptions, - * '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}' for resource groups, and - * '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePathIfPresent}/{resourceType}/{resourceName}' - * for resources. - * @param lockName The name of lock. - * @param parameters Create or update management lock parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the lock information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateByScopeWithResponseAsync( - String scope, String lockName, ManagementLockObjectInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (lockName == null) { - return Mono.error(new IllegalArgumentException("Parameter lockName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdateByScope( - this.client.getEndpoint(), - scope, - lockName, - this.client.getApiVersion(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create or update a management lock by scope. - * - * @param scope The scope for the lock. When providing a scope for the assignment, use - * '/subscriptions/{subscriptionId}' for subscriptions, - * '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}' for resource groups, and - * '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePathIfPresent}/{resourceType}/{resourceName}' - * for resources. - * @param lockName The name of lock. - * @param parameters Create or update management lock parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the lock information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateByScopeWithResponseAsync( - String scope, String lockName, ManagementLockObjectInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (lockName == null) { - return Mono.error(new IllegalArgumentException("Parameter lockName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdateByScope( - this.client.getEndpoint(), scope, lockName, this.client.getApiVersion(), parameters, accept, context); - } - - /** - * Create or update a management lock by scope. - * - * @param scope The scope for the lock. When providing a scope for the assignment, use - * '/subscriptions/{subscriptionId}' for subscriptions, - * '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}' for resource groups, and - * '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePathIfPresent}/{resourceType}/{resourceName}' - * for resources. - * @param lockName The name of lock. - * @param parameters Create or update management lock parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the lock information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateByScopeAsync( - String scope, String lockName, ManagementLockObjectInner parameters) { - return createOrUpdateByScopeWithResponseAsync(scope, lockName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Create or update a management lock by scope. - * - * @param scope The scope for the lock. When providing a scope for the assignment, use - * '/subscriptions/{subscriptionId}' for subscriptions, - * '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}' for resource groups, and - * '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePathIfPresent}/{resourceType}/{resourceName}' - * for resources. - * @param lockName The name of lock. - * @param parameters Create or update management lock parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the lock information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ManagementLockObjectInner createOrUpdateByScope( - String scope, String lockName, ManagementLockObjectInner parameters) { - return createOrUpdateByScopeAsync(scope, lockName, parameters).block(); - } - - /** - * Create or update a management lock by scope. - * - * @param scope The scope for the lock. When providing a scope for the assignment, use - * '/subscriptions/{subscriptionId}' for subscriptions, - * '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}' for resource groups, and - * '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePathIfPresent}/{resourceType}/{resourceName}' - * for resources. - * @param lockName The name of lock. - * @param parameters Create or update management lock parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the lock information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateByScopeWithResponse( - String scope, String lockName, ManagementLockObjectInner parameters, Context context) { - return createOrUpdateByScopeWithResponseAsync(scope, lockName, parameters, context).block(); - } - - /** - * Delete a management lock by scope. - * - * @param scope The scope for the lock. - * @param lockName The name of lock. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteByScopeWithResponseAsync(String scope, String lockName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (lockName == null) { - return Mono.error(new IllegalArgumentException("Parameter lockName is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .deleteByScope( - this.client.getEndpoint(), scope, lockName, this.client.getApiVersion(), context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete a management lock by scope. - * - * @param scope The scope for the lock. - * @param lockName The name of lock. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteByScopeWithResponseAsync(String scope, String lockName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (lockName == null) { - return Mono.error(new IllegalArgumentException("Parameter lockName is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service.deleteByScope(this.client.getEndpoint(), scope, lockName, this.client.getApiVersion(), context); - } - - /** - * Delete a management lock by scope. - * - * @param scope The scope for the lock. - * @param lockName The name of lock. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteByScopeAsync(String scope, String lockName) { - return deleteByScopeWithResponseAsync(scope, lockName).flatMap((Response res) -> Mono.empty()); - } - - /** - * Delete a management lock by scope. - * - * @param scope The scope for the lock. - * @param lockName The name of lock. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteByScope(String scope, String lockName) { - deleteByScopeAsync(scope, lockName).block(); - } - - /** - * Delete a management lock by scope. - * - * @param scope The scope for the lock. - * @param lockName The name of lock. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteByScopeWithResponse(String scope, String lockName, Context context) { - return deleteByScopeWithResponseAsync(scope, lockName, context).block(); - } - - /** - * Get a management lock by scope. - * - * @param scope The scope for the lock. - * @param lockName The name of lock. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a management lock by scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByScopeWithResponseAsync(String scope, String lockName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (lockName == null) { - return Mono.error(new IllegalArgumentException("Parameter lockName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByScope( - this.client.getEndpoint(), scope, lockName, this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a management lock by scope. - * - * @param scope The scope for the lock. - * @param lockName The name of lock. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a management lock by scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByScopeWithResponseAsync( - String scope, String lockName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (lockName == null) { - return Mono.error(new IllegalArgumentException("Parameter lockName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByScope(this.client.getEndpoint(), scope, lockName, this.client.getApiVersion(), accept, context); - } - - /** - * Get a management lock by scope. - * - * @param scope The scope for the lock. - * @param lockName The name of lock. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a management lock by scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByScopeAsync(String scope, String lockName) { - return getByScopeWithResponseAsync(scope, lockName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get a management lock by scope. - * - * @param scope The scope for the lock. - * @param lockName The name of lock. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a management lock by scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ManagementLockObjectInner getByScope(String scope, String lockName) { - return getByScopeAsync(scope, lockName).block(); - } - - /** - * Get a management lock by scope. - * - * @param scope The scope for the lock. - * @param lockName The name of lock. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a management lock by scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByScopeWithResponse(String scope, String lockName, Context context) { - return getByScopeWithResponseAsync(scope, lockName, context).block(); - } - - /** - * When you apply a lock at a parent scope, all child resources inherit the same lock. To create management locks, - * you must have access to Microsoft.Authorization/* or Microsoft.Authorization/locks/* actions. Of the built-in - * roles, only Owner and User Access Administrator are granted those actions. - * - * @param resourceGroupName The name of the resource group containing the resource to lock. - * @param resourceProviderNamespace The resource provider namespace of the resource to lock. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource to lock. - * @param resourceName The name of the resource to lock. - * @param lockName The name of lock. The lock name can be a maximum of 260 characters. It cannot contain <, > - * %, &, :, \, ?, /, or any control characters. - * @param parameters Parameters for creating or updating a management lock. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the lock information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateAtResourceLevelWithResponseAsync( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String lockName, - ManagementLockObjectInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceProviderNamespace == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter resourceProviderNamespace is required and cannot be null.")); - } - if (parentResourcePath == null) { - return Mono - .error(new IllegalArgumentException("Parameter parentResourcePath is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (lockName == null) { - return Mono.error(new IllegalArgumentException("Parameter lockName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdateAtResourceLevel( - this.client.getEndpoint(), - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - lockName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * When you apply a lock at a parent scope, all child resources inherit the same lock. To create management locks, - * you must have access to Microsoft.Authorization/* or Microsoft.Authorization/locks/* actions. Of the built-in - * roles, only Owner and User Access Administrator are granted those actions. - * - * @param resourceGroupName The name of the resource group containing the resource to lock. - * @param resourceProviderNamespace The resource provider namespace of the resource to lock. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource to lock. - * @param resourceName The name of the resource to lock. - * @param lockName The name of lock. The lock name can be a maximum of 260 characters. It cannot contain <, > - * %, &, :, \, ?, /, or any control characters. - * @param parameters Parameters for creating or updating a management lock. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the lock information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateAtResourceLevelWithResponseAsync( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String lockName, - ManagementLockObjectInner parameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceProviderNamespace == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter resourceProviderNamespace is required and cannot be null.")); - } - if (parentResourcePath == null) { - return Mono - .error(new IllegalArgumentException("Parameter parentResourcePath is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (lockName == null) { - return Mono.error(new IllegalArgumentException("Parameter lockName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdateAtResourceLevel( - this.client.getEndpoint(), - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - lockName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * When you apply a lock at a parent scope, all child resources inherit the same lock. To create management locks, - * you must have access to Microsoft.Authorization/* or Microsoft.Authorization/locks/* actions. Of the built-in - * roles, only Owner and User Access Administrator are granted those actions. - * - * @param resourceGroupName The name of the resource group containing the resource to lock. - * @param resourceProviderNamespace The resource provider namespace of the resource to lock. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource to lock. - * @param resourceName The name of the resource to lock. - * @param lockName The name of lock. The lock name can be a maximum of 260 characters. It cannot contain <, > - * %, &, :, \, ?, /, or any control characters. - * @param parameters Parameters for creating or updating a management lock. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the lock information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAtResourceLevelAsync( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String lockName, - ManagementLockObjectInner parameters) { - return createOrUpdateAtResourceLevelWithResponseAsync( - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - lockName, - parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * When you apply a lock at a parent scope, all child resources inherit the same lock. To create management locks, - * you must have access to Microsoft.Authorization/* or Microsoft.Authorization/locks/* actions. Of the built-in - * roles, only Owner and User Access Administrator are granted those actions. - * - * @param resourceGroupName The name of the resource group containing the resource to lock. - * @param resourceProviderNamespace The resource provider namespace of the resource to lock. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource to lock. - * @param resourceName The name of the resource to lock. - * @param lockName The name of lock. The lock name can be a maximum of 260 characters. It cannot contain <, > - * %, &, :, \, ?, /, or any control characters. - * @param parameters Parameters for creating or updating a management lock. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the lock information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ManagementLockObjectInner createOrUpdateAtResourceLevel( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String lockName, - ManagementLockObjectInner parameters) { - return createOrUpdateAtResourceLevelAsync( - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - lockName, - parameters) - .block(); - } - - /** - * When you apply a lock at a parent scope, all child resources inherit the same lock. To create management locks, - * you must have access to Microsoft.Authorization/* or Microsoft.Authorization/locks/* actions. Of the built-in - * roles, only Owner and User Access Administrator are granted those actions. - * - * @param resourceGroupName The name of the resource group containing the resource to lock. - * @param resourceProviderNamespace The resource provider namespace of the resource to lock. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource to lock. - * @param resourceName The name of the resource to lock. - * @param lockName The name of lock. The lock name can be a maximum of 260 characters. It cannot contain <, > - * %, &, :, \, ?, /, or any control characters. - * @param parameters Parameters for creating or updating a management lock. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the lock information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateAtResourceLevelWithResponse( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String lockName, - ManagementLockObjectInner parameters, - Context context) { - return createOrUpdateAtResourceLevelWithResponseAsync( - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - lockName, - parameters, - context) - .block(); - } - - /** - * To delete management locks, you must have access to Microsoft.Authorization/* or Microsoft.Authorization/locks/* - * actions. Of the built-in roles, only Owner and User Access Administrator are granted those actions. - * - * @param resourceGroupName The name of the resource group containing the resource with the lock to delete. - * @param resourceProviderNamespace The resource provider namespace of the resource with the lock to delete. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource with the lock to delete. - * @param resourceName The name of the resource with the lock to delete. - * @param lockName The name of the lock to delete. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteAtResourceLevelWithResponseAsync( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String lockName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceProviderNamespace == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter resourceProviderNamespace is required and cannot be null.")); - } - if (parentResourcePath == null) { - return Mono - .error(new IllegalArgumentException("Parameter parentResourcePath is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (lockName == null) { - return Mono.error(new IllegalArgumentException("Parameter lockName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .deleteAtResourceLevel( - this.client.getEndpoint(), - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - lockName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * To delete management locks, you must have access to Microsoft.Authorization/* or Microsoft.Authorization/locks/* - * actions. Of the built-in roles, only Owner and User Access Administrator are granted those actions. - * - * @param resourceGroupName The name of the resource group containing the resource with the lock to delete. - * @param resourceProviderNamespace The resource provider namespace of the resource with the lock to delete. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource with the lock to delete. - * @param resourceName The name of the resource with the lock to delete. - * @param lockName The name of the lock to delete. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteAtResourceLevelWithResponseAsync( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String lockName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceProviderNamespace == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter resourceProviderNamespace is required and cannot be null.")); - } - if (parentResourcePath == null) { - return Mono - .error(new IllegalArgumentException("Parameter parentResourcePath is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (lockName == null) { - return Mono.error(new IllegalArgumentException("Parameter lockName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .deleteAtResourceLevel( - this.client.getEndpoint(), - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - lockName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - context); - } - - /** - * To delete management locks, you must have access to Microsoft.Authorization/* or Microsoft.Authorization/locks/* - * actions. Of the built-in roles, only Owner and User Access Administrator are granted those actions. - * - * @param resourceGroupName The name of the resource group containing the resource with the lock to delete. - * @param resourceProviderNamespace The resource provider namespace of the resource with the lock to delete. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource with the lock to delete. - * @param resourceName The name of the resource with the lock to delete. - * @param lockName The name of the lock to delete. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAtResourceLevelAsync( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String lockName) { - return deleteAtResourceLevelWithResponseAsync( - resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, lockName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * To delete management locks, you must have access to Microsoft.Authorization/* or Microsoft.Authorization/locks/* - * actions. Of the built-in roles, only Owner and User Access Administrator are granted those actions. - * - * @param resourceGroupName The name of the resource group containing the resource with the lock to delete. - * @param resourceProviderNamespace The resource provider namespace of the resource with the lock to delete. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource with the lock to delete. - * @param resourceName The name of the resource with the lock to delete. - * @param lockName The name of the lock to delete. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteAtResourceLevel( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String lockName) { - deleteAtResourceLevelAsync( - resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, lockName) - .block(); - } - - /** - * To delete management locks, you must have access to Microsoft.Authorization/* or Microsoft.Authorization/locks/* - * actions. Of the built-in roles, only Owner and User Access Administrator are granted those actions. - * - * @param resourceGroupName The name of the resource group containing the resource with the lock to delete. - * @param resourceProviderNamespace The resource provider namespace of the resource with the lock to delete. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource with the lock to delete. - * @param resourceName The name of the resource with the lock to delete. - * @param lockName The name of the lock to delete. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteAtResourceLevelWithResponse( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String lockName, - Context context) { - return deleteAtResourceLevelWithResponseAsync( - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - lockName, - context) - .block(); - } - - /** - * Get the management lock of a resource or any level below resource. - * - * @param resourceGroupName The name of the resource group. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath An extra path parameter needed in some services, like SQL Databases. - * @param resourceType The type of the resource. - * @param resourceName The name of the resource. - * @param lockName The name of lock. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the management lock of a resource or any level below resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getAtResourceLevelWithResponseAsync( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String lockName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceProviderNamespace == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter resourceProviderNamespace is required and cannot be null.")); - } - if (parentResourcePath == null) { - return Mono - .error(new IllegalArgumentException("Parameter parentResourcePath is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (lockName == null) { - return Mono.error(new IllegalArgumentException("Parameter lockName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getAtResourceLevel( - this.client.getEndpoint(), - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - lockName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the management lock of a resource or any level below resource. - * - * @param resourceGroupName The name of the resource group. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath An extra path parameter needed in some services, like SQL Databases. - * @param resourceType The type of the resource. - * @param resourceName The name of the resource. - * @param lockName The name of lock. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the management lock of a resource or any level below resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getAtResourceLevelWithResponseAsync( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String lockName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceProviderNamespace == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter resourceProviderNamespace is required and cannot be null.")); - } - if (parentResourcePath == null) { - return Mono - .error(new IllegalArgumentException("Parameter parentResourcePath is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (lockName == null) { - return Mono.error(new IllegalArgumentException("Parameter lockName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getAtResourceLevel( - this.client.getEndpoint(), - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - lockName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Get the management lock of a resource or any level below resource. - * - * @param resourceGroupName The name of the resource group. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath An extra path parameter needed in some services, like SQL Databases. - * @param resourceType The type of the resource. - * @param resourceName The name of the resource. - * @param lockName The name of lock. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the management lock of a resource or any level below resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAtResourceLevelAsync( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String lockName) { - return getAtResourceLevelWithResponseAsync( - resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, lockName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get the management lock of a resource or any level below resource. - * - * @param resourceGroupName The name of the resource group. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath An extra path parameter needed in some services, like SQL Databases. - * @param resourceType The type of the resource. - * @param resourceName The name of the resource. - * @param lockName The name of lock. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the management lock of a resource or any level below resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ManagementLockObjectInner getAtResourceLevel( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String lockName) { - return getAtResourceLevelAsync( - resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, lockName) - .block(); - } - - /** - * Get the management lock of a resource or any level below resource. - * - * @param resourceGroupName The name of the resource group. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath An extra path parameter needed in some services, like SQL Databases. - * @param resourceType The type of the resource. - * @param resourceName The name of the resource. - * @param lockName The name of lock. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the management lock of a resource or any level below resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getAtResourceLevelWithResponse( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String lockName, - Context context) { - return getAtResourceLevelWithResponseAsync( - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - lockName, - context) - .block(); - } - - /** - * When you apply a lock at a parent scope, all child resources inherit the same lock. To create management locks, - * you must have access to Microsoft.Authorization/* or Microsoft.Authorization/locks/* actions. Of the built-in - * roles, only Owner and User Access Administrator are granted those actions. - * - * @param lockName The name of lock. The lock name can be a maximum of 260 characters. It cannot contain <, > - * %, &, :, \, ?, /, or any control characters. - * @param parameters The management lock parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the lock information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateAtSubscriptionLevelWithResponseAsync( - String lockName, ManagementLockObjectInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (lockName == null) { - return Mono.error(new IllegalArgumentException("Parameter lockName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdateAtSubscriptionLevel( - this.client.getEndpoint(), - lockName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * When you apply a lock at a parent scope, all child resources inherit the same lock. To create management locks, - * you must have access to Microsoft.Authorization/* or Microsoft.Authorization/locks/* actions. Of the built-in - * roles, only Owner and User Access Administrator are granted those actions. - * - * @param lockName The name of lock. The lock name can be a maximum of 260 characters. It cannot contain <, > - * %, &, :, \, ?, /, or any control characters. - * @param parameters The management lock parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the lock information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateAtSubscriptionLevelWithResponseAsync( - String lockName, ManagementLockObjectInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (lockName == null) { - return Mono.error(new IllegalArgumentException("Parameter lockName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdateAtSubscriptionLevel( - this.client.getEndpoint(), - lockName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * When you apply a lock at a parent scope, all child resources inherit the same lock. To create management locks, - * you must have access to Microsoft.Authorization/* or Microsoft.Authorization/locks/* actions. Of the built-in - * roles, only Owner and User Access Administrator are granted those actions. - * - * @param lockName The name of lock. The lock name can be a maximum of 260 characters. It cannot contain <, > - * %, &, :, \, ?, /, or any control characters. - * @param parameters The management lock parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the lock information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAtSubscriptionLevelAsync( - String lockName, ManagementLockObjectInner parameters) { - return createOrUpdateAtSubscriptionLevelWithResponseAsync(lockName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * When you apply a lock at a parent scope, all child resources inherit the same lock. To create management locks, - * you must have access to Microsoft.Authorization/* or Microsoft.Authorization/locks/* actions. Of the built-in - * roles, only Owner and User Access Administrator are granted those actions. - * - * @param lockName The name of lock. The lock name can be a maximum of 260 characters. It cannot contain <, > - * %, &, :, \, ?, /, or any control characters. - * @param parameters The management lock parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the lock information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ManagementLockObjectInner createOrUpdateAtSubscriptionLevel( - String lockName, ManagementLockObjectInner parameters) { - return createOrUpdateAtSubscriptionLevelAsync(lockName, parameters).block(); - } - - /** - * When you apply a lock at a parent scope, all child resources inherit the same lock. To create management locks, - * you must have access to Microsoft.Authorization/* or Microsoft.Authorization/locks/* actions. Of the built-in - * roles, only Owner and User Access Administrator are granted those actions. - * - * @param lockName The name of lock. The lock name can be a maximum of 260 characters. It cannot contain <, > - * %, &, :, \, ?, /, or any control characters. - * @param parameters The management lock parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the lock information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateAtSubscriptionLevelWithResponse( - String lockName, ManagementLockObjectInner parameters, Context context) { - return createOrUpdateAtSubscriptionLevelWithResponseAsync(lockName, parameters, context).block(); - } - - /** - * To delete management locks, you must have access to Microsoft.Authorization/* or Microsoft.Authorization/locks/* - * actions. Of the built-in roles, only Owner and User Access Administrator are granted those actions. - * - * @param lockName The name of lock to delete. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteAtSubscriptionLevelWithResponseAsync(String lockName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (lockName == null) { - return Mono.error(new IllegalArgumentException("Parameter lockName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .deleteAtSubscriptionLevel( - this.client.getEndpoint(), - lockName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * To delete management locks, you must have access to Microsoft.Authorization/* or Microsoft.Authorization/locks/* - * actions. Of the built-in roles, only Owner and User Access Administrator are granted those actions. - * - * @param lockName The name of lock to delete. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteAtSubscriptionLevelWithResponseAsync(String lockName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (lockName == null) { - return Mono.error(new IllegalArgumentException("Parameter lockName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .deleteAtSubscriptionLevel( - this.client.getEndpoint(), - lockName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - context); - } - - /** - * To delete management locks, you must have access to Microsoft.Authorization/* or Microsoft.Authorization/locks/* - * actions. Of the built-in roles, only Owner and User Access Administrator are granted those actions. - * - * @param lockName The name of lock to delete. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAtSubscriptionLevelAsync(String lockName) { - return deleteAtSubscriptionLevelWithResponseAsync(lockName).flatMap((Response res) -> Mono.empty()); - } - - /** - * To delete management locks, you must have access to Microsoft.Authorization/* or Microsoft.Authorization/locks/* - * actions. Of the built-in roles, only Owner and User Access Administrator are granted those actions. - * - * @param lockName The name of lock to delete. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteAtSubscriptionLevel(String lockName) { - deleteAtSubscriptionLevelAsync(lockName).block(); - } - - /** - * To delete management locks, you must have access to Microsoft.Authorization/* or Microsoft.Authorization/locks/* - * actions. Of the built-in roles, only Owner and User Access Administrator are granted those actions. - * - * @param lockName The name of lock to delete. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteAtSubscriptionLevelWithResponse(String lockName, Context context) { - return deleteAtSubscriptionLevelWithResponseAsync(lockName, context).block(); - } - - /** - * Gets a management lock at the subscription level. - * - * @param lockName The name of the lock to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a management lock at the subscription level. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getAtSubscriptionLevelWithResponseAsync(String lockName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (lockName == null) { - return Mono.error(new IllegalArgumentException("Parameter lockName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getAtSubscriptionLevel( - this.client.getEndpoint(), - lockName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a management lock at the subscription level. - * - * @param lockName The name of the lock to get. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a management lock at the subscription level. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getAtSubscriptionLevelWithResponseAsync( - String lockName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (lockName == null) { - return Mono.error(new IllegalArgumentException("Parameter lockName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getAtSubscriptionLevel( - this.client.getEndpoint(), - lockName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets a management lock at the subscription level. - * - * @param lockName The name of the lock to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a management lock at the subscription level. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAtSubscriptionLevelAsync(String lockName) { - return getAtSubscriptionLevelWithResponseAsync(lockName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a management lock at the subscription level. - * - * @param lockName The name of the lock to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a management lock at the subscription level. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ManagementLockObjectInner getAtSubscriptionLevel(String lockName) { - return getAtSubscriptionLevelAsync(lockName).block(); - } - - /** - * Gets a management lock at the subscription level. - * - * @param lockName The name of the lock to get. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a management lock at the subscription level. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getAtSubscriptionLevelWithResponse(String lockName, Context context) { - return getAtSubscriptionLevelWithResponseAsync(lockName, context).block(); - } - - /** - * Gets all the management locks for a resource group. - * - * @param resourceGroupName The name of the resource group containing the locks to get. - * @param filter The filter to apply on the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the management locks for a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, String filter) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - filter, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all the management locks for a resource group. - * - * @param resourceGroupName The name of the resource group containing the locks to get. - * @param filter The filter to apply on the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the management locks for a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, String filter, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - filter, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all the management locks for a resource group. - * - * @param resourceGroupName The name of the resource group containing the locks to get. - * @param filter The filter to apply on the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the management locks for a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName, String filter) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, filter), - nextLink -> listAtResourceGroupLevelNextSinglePageAsync(nextLink)); - } - - /** - * Gets all the management locks for a resource group. - * - * @param resourceGroupName The name of the resource group containing the locks to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the management locks for a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - final String filter = null; - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, filter), - nextLink -> listAtResourceGroupLevelNextSinglePageAsync(nextLink)); - } - - /** - * Gets all the management locks for a resource group. - * - * @param resourceGroupName The name of the resource group containing the locks to get. - * @param filter The filter to apply on the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the management locks for a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync( - String resourceGroupName, String filter, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, context), - nextLink -> listAtResourceGroupLevelNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all the management locks for a resource group. - * - * @param resourceGroupName The name of the resource group containing the locks to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the management locks for a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - final String filter = null; - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, filter)); - } - - /** - * Gets all the management locks for a resource group. - * - * @param resourceGroupName The name of the resource group containing the locks to get. - * @param filter The filter to apply on the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the management locks for a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup( - String resourceGroupName, String filter, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, filter, context)); - } - - /** - * Gets all the management locks for a resource or any level below resource. - * - * @param resourceGroupName The name of the resource group containing the locked resource. The name is case - * insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the locked resource. - * @param resourceName The name of the locked resource. - * @param filter The filter to apply on the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the management locks for a resource or any level below resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAtResourceLevelSinglePageAsync( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String filter) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceProviderNamespace == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter resourceProviderNamespace is required and cannot be null.")); - } - if (parentResourcePath == null) { - return Mono - .error(new IllegalArgumentException("Parameter parentResourcePath is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listAtResourceLevel( - this.client.getEndpoint(), - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - filter, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all the management locks for a resource or any level below resource. - * - * @param resourceGroupName The name of the resource group containing the locked resource. The name is case - * insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the locked resource. - * @param resourceName The name of the locked resource. - * @param filter The filter to apply on the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the management locks for a resource or any level below resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAtResourceLevelSinglePageAsync( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String filter, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceProviderNamespace == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter resourceProviderNamespace is required and cannot be null.")); - } - if (parentResourcePath == null) { - return Mono - .error(new IllegalArgumentException("Parameter parentResourcePath is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listAtResourceLevel( - this.client.getEndpoint(), - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - filter, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all the management locks for a resource or any level below resource. - * - * @param resourceGroupName The name of the resource group containing the locked resource. The name is case - * insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the locked resource. - * @param resourceName The name of the locked resource. - * @param filter The filter to apply on the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the management locks for a resource or any level below resource. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAtResourceLevelAsync( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String filter) { - return new PagedFlux<>( - () -> - listAtResourceLevelSinglePageAsync( - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - filter), - nextLink -> listAtResourceLevelNextSinglePageAsync(nextLink)); - } - - /** - * Gets all the management locks for a resource or any level below resource. - * - * @param resourceGroupName The name of the resource group containing the locked resource. The name is case - * insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the locked resource. - * @param resourceName The name of the locked resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the management locks for a resource or any level below resource. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAtResourceLevelAsync( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName) { - final String filter = null; - return new PagedFlux<>( - () -> - listAtResourceLevelSinglePageAsync( - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - filter), - nextLink -> listAtResourceLevelNextSinglePageAsync(nextLink)); - } - - /** - * Gets all the management locks for a resource or any level below resource. - * - * @param resourceGroupName The name of the resource group containing the locked resource. The name is case - * insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the locked resource. - * @param resourceName The name of the locked resource. - * @param filter The filter to apply on the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the management locks for a resource or any level below resource. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAtResourceLevelAsync( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String filter, - Context context) { - return new PagedFlux<>( - () -> - listAtResourceLevelSinglePageAsync( - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - filter, - context), - nextLink -> listAtResourceLevelNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all the management locks for a resource or any level below resource. - * - * @param resourceGroupName The name of the resource group containing the locked resource. The name is case - * insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the locked resource. - * @param resourceName The name of the locked resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the management locks for a resource or any level below resource. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAtResourceLevel( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName) { - final String filter = null; - return new PagedIterable<>( - listAtResourceLevelAsync( - resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, filter)); - } - - /** - * Gets all the management locks for a resource or any level below resource. - * - * @param resourceGroupName The name of the resource group containing the locked resource. The name is case - * insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the locked resource. - * @param resourceName The name of the locked resource. - * @param filter The filter to apply on the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the management locks for a resource or any level below resource. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAtResourceLevel( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String filter, - Context context) { - return new PagedIterable<>( - listAtResourceLevelAsync( - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - filter, - context)); - } - - /** - * Gets all the management locks for a subscription. - * - * @param filter The filter to apply on the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the management locks for a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String filter) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - filter, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all the management locks for a subscription. - * - * @param filter The filter to apply on the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the management locks for a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String filter, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - filter, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all the management locks for a subscription. - * - * @param filter The filter to apply on the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the management locks for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String filter) { - return new PagedFlux<>( - () -> listSinglePageAsync(filter), nextLink -> listAtSubscriptionLevelNextSinglePageAsync(nextLink)); - } - - /** - * Gets all the management locks for a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the management locks for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - final String filter = null; - return new PagedFlux<>( - () -> listSinglePageAsync(filter), nextLink -> listAtSubscriptionLevelNextSinglePageAsync(nextLink)); - } - - /** - * Gets all the management locks for a subscription. - * - * @param filter The filter to apply on the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the management locks for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String filter, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(filter, context), - nextLink -> listAtSubscriptionLevelNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all the management locks for a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the management locks for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - final String filter = null; - return new PagedIterable<>(listAsync(filter)); - } - - /** - * Gets all the management locks for a subscription. - * - * @param filter The filter to apply on the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the management locks for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String filter, Context context) { - return new PagedIterable<>(listAsync(filter, context)); - } - - /** - * Gets all the management locks for a scope. - * - * @param scope The scope for the lock. When providing a scope for the assignment, use - * '/subscriptions/{subscriptionId}' for subscriptions, - * '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}' for resource groups, and - * '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePathIfPresent}/{resourceType}/{resourceName}' - * for resources. - * @param filter The filter to apply on the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the management locks for a scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByScopeSinglePageAsync(String scope, String filter) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByScope( - this.client.getEndpoint(), scope, filter, this.client.getApiVersion(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all the management locks for a scope. - * - * @param scope The scope for the lock. When providing a scope for the assignment, use - * '/subscriptions/{subscriptionId}' for subscriptions, - * '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}' for resource groups, and - * '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePathIfPresent}/{resourceType}/{resourceName}' - * for resources. - * @param filter The filter to apply on the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the management locks for a scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByScopeSinglePageAsync( - String scope, String filter, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByScope(this.client.getEndpoint(), scope, filter, this.client.getApiVersion(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all the management locks for a scope. - * - * @param scope The scope for the lock. When providing a scope for the assignment, use - * '/subscriptions/{subscriptionId}' for subscriptions, - * '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}' for resource groups, and - * '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePathIfPresent}/{resourceType}/{resourceName}' - * for resources. - * @param filter The filter to apply on the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the management locks for a scope. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByScopeAsync(String scope, String filter) { - return new PagedFlux<>( - () -> listByScopeSinglePageAsync(scope, filter), nextLink -> listByScopeNextSinglePageAsync(nextLink)); - } - - /** - * Gets all the management locks for a scope. - * - * @param scope The scope for the lock. When providing a scope for the assignment, use - * '/subscriptions/{subscriptionId}' for subscriptions, - * '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}' for resource groups, and - * '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePathIfPresent}/{resourceType}/{resourceName}' - * for resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the management locks for a scope. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByScopeAsync(String scope) { - final String filter = null; - return new PagedFlux<>( - () -> listByScopeSinglePageAsync(scope, filter), nextLink -> listByScopeNextSinglePageAsync(nextLink)); - } - - /** - * Gets all the management locks for a scope. - * - * @param scope The scope for the lock. When providing a scope for the assignment, use - * '/subscriptions/{subscriptionId}' for subscriptions, - * '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}' for resource groups, and - * '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePathIfPresent}/{resourceType}/{resourceName}' - * for resources. - * @param filter The filter to apply on the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the management locks for a scope. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByScopeAsync(String scope, String filter, Context context) { - return new PagedFlux<>( - () -> listByScopeSinglePageAsync(scope, filter, context), - nextLink -> listByScopeNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all the management locks for a scope. - * - * @param scope The scope for the lock. When providing a scope for the assignment, use - * '/subscriptions/{subscriptionId}' for subscriptions, - * '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}' for resource groups, and - * '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePathIfPresent}/{resourceType}/{resourceName}' - * for resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the management locks for a scope. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByScope(String scope) { - final String filter = null; - return new PagedIterable<>(listByScopeAsync(scope, filter)); - } - - /** - * Gets all the management locks for a scope. - * - * @param scope The scope for the lock. When providing a scope for the assignment, use - * '/subscriptions/{subscriptionId}' for subscriptions, - * '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}' for resource groups, and - * '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePathIfPresent}/{resourceType}/{resourceName}' - * for resources. - * @param filter The filter to apply on the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the management locks for a scope. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByScope(String scope, String filter, Context context) { - return new PagedIterable<>(listByScopeAsync(scope, filter, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of locks. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAtResourceGroupLevelNextSinglePageAsync( - String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listAtResourceGroupLevelNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of locks. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAtResourceGroupLevelNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listAtResourceGroupLevelNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of locks. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAtResourceLevelNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listAtResourceLevelNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of locks. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAtResourceLevelNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listAtResourceLevelNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of locks. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAtSubscriptionLevelNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listAtSubscriptionLevelNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of locks. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAtSubscriptionLevelNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listAtSubscriptionLevelNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of locks. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByScopeNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByScopeNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of locks. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByScopeNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByScopeNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ManagementLocksImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ManagementLocksImpl.java deleted file mode 100644 index fb7b68f508d2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ManagementLocksImpl.java +++ /dev/null @@ -1,232 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.CoreUtils; -import com.azure.resourcemanager.resources.ResourceManager; -import com.azure.resourcemanager.resources.fluent.models.ManagementLockObjectInner; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.CreatableResourcesImpl; -import com.azure.resourcemanager.resources.models.ManagementLock; -import com.azure.resourcemanager.resources.models.ManagementLocks; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; - -/** - * Implementation for ManagementLocks. - */ -public final class ManagementLocksImpl - extends CreatableResourcesImpl - implements ManagementLocks { - - private final ResourceManager manager; - - public ManagementLocksImpl(final ResourceManager manager) { - this.manager = manager; - } - - /** - * Returns the part of the specified management lock resource ID - * representing the resource the lock is associated with. - * @param lockId a lock resource ID - * @return a resource ID - */ - static String resourceIdFromLockId(String lockId) { - String[] lockIdParts = lockIdParts(lockId); - if (CoreUtils.isNullOrEmpty(lockIdParts)) { - return null; - } - - StringBuilder resourceId = new StringBuilder(); - for (int i = 0; i < lockIdParts.length - 4; i++) { - if (!lockIdParts[i].isEmpty()) { - resourceId.append("/").append(lockIdParts[i]); - } - } - - return resourceId.toString(); - } - - private static String[] lockIdParts(String lockId) { - if (CoreUtils.isNullOrEmpty(lockId)) { - return new String[0]; - } - - String[] parts = lockId.split("/"); - if (parts.length < 4) { - // ID too short to be possibly a lock ID - return new String[0]; - } - - if (!parts[parts.length - 2].equalsIgnoreCase("locks") - || !parts[parts.length - 3].equalsIgnoreCase("Microsoft.Authorization") - || !parts[parts.length - 4].equalsIgnoreCase("providers")) { - // Not a lock ID - return new String[0]; - } - - return parts; - } - - @Override - public ManagementLockImpl define(String name) { - return wrapModel(name); - } - - @Override - protected ManagementLockImpl wrapModel(String name) { - ManagementLockObjectInner inner = new ManagementLockObjectInner(); - - return new ManagementLockImpl(name, inner, this.manager()); - } - - @Override - protected ManagementLockImpl wrapModel(ManagementLockObjectInner inner) { - if (inner == null) { - return null; - } - return new ManagementLockImpl(inner.name(), inner, this.manager()); - } - - @Override - public PagedIterable list() { - return wrapList(this.manager().managementLockClient().getManagementLocks().list()); - } - - @Override - public PagedFlux listAsync() { - return wrapPageAsync(this.manager().managementLockClient().getManagementLocks().listAsync()); - } - - @Override - public Mono deleteByIdAsync(String id) { - String scope = resourceIdFromLockId(id); - String lockName = ResourceUtils.nameFromResourceId(id); - if (scope != null && lockName != null) { - return this.manager().managementLockClient().getManagementLocks().deleteByScopeAsync(scope, lockName); - } else { - return Mono.empty(); - } - } - - @Override - public PagedIterable listByResourceGroup(String resourceGroupName) { - return wrapList(this.manager().managementLockClient().getManagementLocks() - .listByResourceGroup(resourceGroupName)); - } - - @Override - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - if (CoreUtils.isNullOrEmpty(resourceGroupName)) { - return new PagedFlux<>(() -> Mono.error( - new IllegalArgumentException("Parameter 'resourceGroupName' is required and cannot be null."))); - } - return wrapPageAsync(this.manager().managementLockClient().getManagementLocks() - .listByResourceGroupAsync(resourceGroupName)); - } - - @Override - public ManagementLock getByResourceGroup(String resourceGroupName, String name) { - return this.getByResourceGroupAsync(resourceGroupName, name).block(); - } - - @Override - public Mono getByResourceGroupAsync(String resourceGroupName, String name) { - if (CoreUtils.isNullOrEmpty(resourceGroupName)) { - return Mono.error( - new IllegalArgumentException("Parameter 'resourceGroupName' is required and cannot be null.")); - } - if (CoreUtils.isNullOrEmpty(name)) { - return Mono.error( - new IllegalArgumentException("Parameter 'name' is required and cannot be null.")); - } - return this.manager().managementLockClient().getManagementLocks() - .getByResourceGroupAsync(resourceGroupName, name) - .map(this::wrapModel); - } - - @Override - public ManagementLock getById(String id) { - return this.getByIdAsync(id).block(); - } - - @Override - public Mono getByIdAsync(String id) { - String resourceId = resourceIdFromLockId(id); - String lockName = ResourceUtils.nameFromResourceId(id); - return this.manager().managementLockClient().getManagementLocks().getByScopeAsync(resourceId, lockName) - .map(this::wrapModel); - } - - @Override - public void deleteByResourceGroup(String resourceGroupName, String name) { - this.deleteByResourceGroupAsync(resourceGroupName, name).block(); - } - - @Override - public Mono deleteByResourceGroupAsync(String resourceGroupName, String name) { - if (CoreUtils.isNullOrEmpty(resourceGroupName)) { - return Mono.error( - new IllegalArgumentException("Parameter 'resourceGroupName' is required and cannot be null.")); - } - if (CoreUtils.isNullOrEmpty(name)) { - return Mono.error( - new IllegalArgumentException("Parameter 'name' is required and cannot be null.")); - } - return this.manager().managementLockClient().getManagementLocks() - .deleteAsync(resourceGroupName, name); - } - - @Override - public Flux deleteByIdsAsync(Collection ids) { - if (ids == null || ids.isEmpty()) { - return Flux.empty(); - } - - return Flux.fromIterable(ids) - .flatMapDelayError(id -> { - String lockName = ResourceUtils.nameFromResourceId(id); - String scopeName = ManagementLocksImpl.resourceIdFromLockId(id); - return this.manager().managementLockClient().getManagementLocks() - .deleteByScopeAsync(scopeName, lockName) - .then(Mono.just(id)); - }, 32, 32); - } - - @Override - public Flux deleteByIdsAsync(String... ids) { - return this.deleteByIdsAsync(new ArrayList<>(Arrays.asList(ids))); - } - - @Override - public void deleteByIds(Collection ids) { - this.deleteByIdsAsync(ids).blockLast(); - } - - @Override - public void deleteByIds(String... ids) { - this.deleteByIdsAsync(ids).blockLast(); - } - - @Override - public ResourceManager manager() { - return this.manager; - } - - @Override - public PagedIterable listForResource(String resourceId) { - return wrapList(this.manager().managementLockClient().getManagementLocks().listByScope(resourceId)); - } - - @Override - public PagedFlux listForResourceAsync(String resourceId) { - return wrapPageAsync(this.manager().managementLockClient().getManagementLocks().listByScopeAsync(resourceId)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/OperationsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/OperationsClientImpl.java deleted file mode 100644 index ad2d1d5cc418..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/OperationsClientImpl.java +++ /dev/null @@ -1,269 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.resources.fluent.OperationsClient; -import com.azure.resourcemanager.resources.fluent.models.OperationInner; -import com.azure.resourcemanager.resources.models.OperationListResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in OperationsClient. */ -public final class OperationsClientImpl implements OperationsClient { - private final ClientLogger logger = new ClientLogger(OperationsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final OperationsService service; - - /** The service client containing this operation class. */ - private final ResourceManagementClientImpl client; - - /** - * Initializes an instance of OperationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - OperationsClientImpl(ResourceManagementClientImpl client) { - this.service = - RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for ResourceManagementClientOperations to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "ResourceManagementCl") - private interface OperationsService { - @Headers({"Content-Type: application/json"}) - @Get("/providers/Microsoft.Resources/operations") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Lists all of the available Microsoft.Resources REST API operations. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Microsoft.Resources operations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all of the available Microsoft.Resources REST API operations. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Microsoft.Resources operations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists all of the available Microsoft.Resources REST API operations. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Microsoft.Resources operations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists all of the available Microsoft.Resources REST API operations. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Microsoft.Resources operations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all of the available Microsoft.Resources REST API operations. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Microsoft.Resources operations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Lists all of the available Microsoft.Resources REST API operations. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Microsoft.Resources operations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Microsoft.Resources operations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Microsoft.Resources operations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/PolicyAssignmentImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/PolicyAssignmentImpl.java deleted file mode 100644 index 1721cb5363f1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/PolicyAssignmentImpl.java +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.implementation; - -import com.azure.resourcemanager.resources.models.GenericResource; -import com.azure.resourcemanager.resources.models.PolicyAssignment; -import com.azure.resourcemanager.resources.models.PolicyDefinition; -import com.azure.resourcemanager.resources.models.ResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.CreatableImpl; -import com.azure.resourcemanager.resources.fluent.models.PolicyAssignmentInner; -import com.azure.resourcemanager.resources.fluent.PolicyAssignmentsClient; -import reactor.core.publisher.Mono; - -/** - * Implementation for {@link PolicyAssignment}. - */ -final class PolicyAssignmentImpl extends - CreatableImpl - implements - PolicyAssignment, - PolicyAssignment.Definition { - private final PolicyAssignmentsClient innerCollection; - - private String scope; - - PolicyAssignmentImpl(String name, PolicyAssignmentInner innerModel, PolicyAssignmentsClient innerCollection) { - super(name, innerModel); - this.innerCollection = innerCollection; - this.scope = innerModel.scope(); - } - - @Override - public String displayName() { - return innerModel().displayName(); - } - - @Override - public String policyDefinitionId() { - return innerModel().policyDefinitionId(); - } - - @Override - public String scope() { - return innerModel().scope(); - } - - @Override - public String id() { - return innerModel().id(); - } - - @Override - public String type() { - return innerModel().type(); - } - - @Override - public Object parameters() { return innerModel().parameters(); } - - @Override - public PolicyAssignmentImpl withDisplayName(String displayName) { - innerModel().withDisplayName(displayName); - return this; - } - - @Override - public PolicyAssignmentImpl forScope(String scope) { - this.scope = scope; - return this; - } - - @Override - public PolicyAssignmentImpl forResourceGroup(ResourceGroup resourceGroup) { - this.scope = resourceGroup.id(); - return this; - } - - public PolicyAssignmentImpl forResource(GenericResource genericResource) { - this.scope = genericResource.id(); - return this; - } - - @Override - public PolicyAssignmentImpl withPolicyDefinitionId(String policyDefinitionId) { - innerModel().withPolicyDefinitionId(policyDefinitionId); - return this; - } - - @Override - public PolicyAssignmentImpl withPolicyDefinition(PolicyDefinition policyDefinition) { - innerModel().withPolicyDefinitionId(policyDefinition.id()); - return this; - } - - @Override - public Mono createResourceAsync() { - return innerCollection.createAsync(this.scope, name(), innerModel()) - .map(innerToFluentMap(this)); - } - - @Override - public boolean isInCreateMode() { - return id() == null; - } - - @Override - protected Mono getInnerAsync() { - return innerCollection.getAsync(innerModel().scope(), name()); - } - - @Override - public PolicyAssignmentImpl withParameters(Object parameters) { - innerModel().withParameters(parameters); - return this; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/PolicyAssignmentsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/PolicyAssignmentsClientImpl.java deleted file mode 100644 index b289978a45e3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/PolicyAssignmentsClientImpl.java +++ /dev/null @@ -1,1970 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.resources.fluent.PolicyAssignmentsClient; -import com.azure.resourcemanager.resources.fluent.models.PolicyAssignmentInner; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import com.azure.resourcemanager.resources.models.PolicyAssignmentListResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in PolicyAssignmentsClient. */ -public final class PolicyAssignmentsClientImpl - implements InnerSupportsListing, - InnerSupportsDelete, - PolicyAssignmentsClient { - private final ClientLogger logger = new ClientLogger(PolicyAssignmentsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final PolicyAssignmentsService service; - - /** The service client containing this operation class. */ - private final PolicyClientImpl client; - - /** - * Initializes an instance of PolicyAssignmentsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - PolicyAssignmentsClientImpl(PolicyClientImpl client) { - this.service = - RestProxy.create(PolicyAssignmentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for PolicyClientPolicyAssignments to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "PolicyClientPolicyAs") - private interface PolicyAssignmentsService { - @Headers({"Content-Type: application/json"}) - @Delete("/{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @PathParam(value = "scope", encoded = true) String scope, - @PathParam("policyAssignmentName") String policyAssignmentName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put("/{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}") - @ExpectedResponses({201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> create( - @HostParam("$host") String endpoint, - @PathParam(value = "scope", encoded = true) String scope, - @PathParam("policyAssignmentName") String policyAssignmentName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") PolicyAssignmentInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam(value = "scope", encoded = true) String scope, - @PathParam("policyAssignmentName") String policyAssignmentName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization" - + "/policyAssignments") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam(value = "$filter", encoded = true) String filter, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}" - + "/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization" - + "/policyAssignments") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listForResource( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("resourceProviderNamespace") String resourceProviderNamespace, - @PathParam(value = "parentResourcePath", encoded = true) String parentResourcePath, - @PathParam(value = "resourceType", encoded = true) String resourceType, - @PathParam("resourceName") String resourceName, - @QueryParam("$filter") String filter, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyAssignments") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("$filter") String filter, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete("/{policyAssignmentId}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteById( - @HostParam("$host") String endpoint, - @PathParam(value = "policyAssignmentId", encoded = true) String policyAssignmentId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put("/{policyAssignmentId}") - @ExpectedResponses({201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createById( - @HostParam("$host") String endpoint, - @PathParam(value = "policyAssignmentId", encoded = true) String policyAssignmentId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") PolicyAssignmentInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/{policyAssignmentId}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getById( - @HostParam("$host") String endpoint, - @PathParam(value = "policyAssignmentId", encoded = true) String policyAssignmentId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listForResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listForResourceNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Deletes a policy assignment. - * - * @param scope The scope of the policy assignment. - * @param policyAssignmentName The name of the policy assignment to delete. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String scope, String policyAssignmentName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (policyAssignmentName == null) { - return Mono - .error(new IllegalArgumentException("Parameter policyAssignmentName is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - scope, - policyAssignmentName, - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a policy assignment. - * - * @param scope The scope of the policy assignment. - * @param policyAssignmentName The name of the policy assignment to delete. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String scope, String policyAssignmentName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (policyAssignmentName == null) { - return Mono - .error(new IllegalArgumentException("Parameter policyAssignmentName is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), scope, policyAssignmentName, this.client.getApiVersion(), accept, context); - } - - /** - * Deletes a policy assignment. - * - * @param scope The scope of the policy assignment. - * @param policyAssignmentName The name of the policy assignment to delete. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String scope, String policyAssignmentName) { - return deleteWithResponseAsync(scope, policyAssignmentName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Deletes a policy assignment. - * - * @param scope The scope of the policy assignment. - * @param policyAssignmentName The name of the policy assignment to delete. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PolicyAssignmentInner delete(String scope, String policyAssignmentName) { - return deleteAsync(scope, policyAssignmentName).block(); - } - - /** - * Deletes a policy assignment. - * - * @param scope The scope of the policy assignment. - * @param policyAssignmentName The name of the policy assignment to delete. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse( - String scope, String policyAssignmentName, Context context) { - return deleteWithResponseAsync(scope, policyAssignmentName, context).block(); - } - - /** - * Policy assignments are inherited by child resources. For example, when you apply a policy to a resource group - * that policy is assigned to all resources in the group. - * - * @param scope The scope of the policy assignment. - * @param policyAssignmentName The name of the policy assignment. - * @param parameters Parameters for the policy assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createWithResponseAsync( - String scope, String policyAssignmentName, PolicyAssignmentInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (policyAssignmentName == null) { - return Mono - .error(new IllegalArgumentException("Parameter policyAssignmentName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .create( - this.client.getEndpoint(), - scope, - policyAssignmentName, - this.client.getApiVersion(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Policy assignments are inherited by child resources. For example, when you apply a policy to a resource group - * that policy is assigned to all resources in the group. - * - * @param scope The scope of the policy assignment. - * @param policyAssignmentName The name of the policy assignment. - * @param parameters Parameters for the policy assignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync( - String scope, String policyAssignmentName, PolicyAssignmentInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (policyAssignmentName == null) { - return Mono - .error(new IllegalArgumentException("Parameter policyAssignmentName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .create( - this.client.getEndpoint(), - scope, - policyAssignmentName, - this.client.getApiVersion(), - parameters, - accept, - context); - } - - /** - * Policy assignments are inherited by child resources. For example, when you apply a policy to a resource group - * that policy is assigned to all resources in the group. - * - * @param scope The scope of the policy assignment. - * @param policyAssignmentName The name of the policy assignment. - * @param parameters Parameters for the policy assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createAsync( - String scope, String policyAssignmentName, PolicyAssignmentInner parameters) { - return createWithResponseAsync(scope, policyAssignmentName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Policy assignments are inherited by child resources. For example, when you apply a policy to a resource group - * that policy is assigned to all resources in the group. - * - * @param scope The scope of the policy assignment. - * @param policyAssignmentName The name of the policy assignment. - * @param parameters Parameters for the policy assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PolicyAssignmentInner create(String scope, String policyAssignmentName, PolicyAssignmentInner parameters) { - return createAsync(scope, policyAssignmentName, parameters).block(); - } - - /** - * Policy assignments are inherited by child resources. For example, when you apply a policy to a resource group - * that policy is assigned to all resources in the group. - * - * @param scope The scope of the policy assignment. - * @param policyAssignmentName The name of the policy assignment. - * @param parameters Parameters for the policy assignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse( - String scope, String policyAssignmentName, PolicyAssignmentInner parameters, Context context) { - return createWithResponseAsync(scope, policyAssignmentName, parameters, context).block(); - } - - /** - * Gets a policy assignment. - * - * @param scope The scope of the policy assignment. - * @param policyAssignmentName The name of the policy assignment to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a policy assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync(String scope, String policyAssignmentName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (policyAssignmentName == null) { - return Mono - .error(new IllegalArgumentException("Parameter policyAssignmentName is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - scope, - policyAssignmentName, - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a policy assignment. - * - * @param scope The scope of the policy assignment. - * @param policyAssignmentName The name of the policy assignment to get. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a policy assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String scope, String policyAssignmentName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (policyAssignmentName == null) { - return Mono - .error(new IllegalArgumentException("Parameter policyAssignmentName is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .get(this.client.getEndpoint(), scope, policyAssignmentName, this.client.getApiVersion(), accept, context); - } - - /** - * Gets a policy assignment. - * - * @param scope The scope of the policy assignment. - * @param policyAssignmentName The name of the policy assignment to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a policy assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync(String scope, String policyAssignmentName) { - return getWithResponseAsync(scope, policyAssignmentName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a policy assignment. - * - * @param scope The scope of the policy assignment. - * @param policyAssignmentName The name of the policy assignment to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a policy assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PolicyAssignmentInner get(String scope, String policyAssignmentName) { - return getAsync(scope, policyAssignmentName).block(); - } - - /** - * Gets a policy assignment. - * - * @param scope The scope of the policy assignment. - * @param policyAssignmentName The name of the policy assignment to get. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a policy assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String scope, String policyAssignmentName, Context context) { - return getWithResponseAsync(scope, policyAssignmentName, context).block(); - } - - /** - * Gets policy assignments for the resource group. - * - * @param resourceGroupName The name of the resource group that contains policy assignments. - * @param filter The filter to apply on the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return policy assignments for the resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, String filter) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - filter, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets policy assignments for the resource group. - * - * @param resourceGroupName The name of the resource group that contains policy assignments. - * @param filter The filter to apply on the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return policy assignments for the resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, String filter, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - filter, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets policy assignments for the resource group. - * - * @param resourceGroupName The name of the resource group that contains policy assignments. - * @param filter The filter to apply on the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return policy assignments for the resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName, String filter) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, filter), - nextLink -> listForResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * Gets policy assignments for the resource group. - * - * @param resourceGroupName The name of the resource group that contains policy assignments. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return policy assignments for the resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - final String filter = null; - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, filter), - nextLink -> listForResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * Gets policy assignments for the resource group. - * - * @param resourceGroupName The name of the resource group that contains policy assignments. - * @param filter The filter to apply on the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return policy assignments for the resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync( - String resourceGroupName, String filter, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, context), - nextLink -> listForResourceGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets policy assignments for the resource group. - * - * @param resourceGroupName The name of the resource group that contains policy assignments. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return policy assignments for the resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - final String filter = null; - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, filter)); - } - - /** - * Gets policy assignments for the resource group. - * - * @param resourceGroupName The name of the resource group that contains policy assignments. - * @param filter The filter to apply on the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return policy assignments for the resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup( - String resourceGroupName, String filter, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, filter, context)); - } - - /** - * Gets policy assignments for a resource. - * - * @param resourceGroupName The name of the resource group containing the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource path. - * @param resourceType The resource type. - * @param resourceName The name of the resource with policy assignments. - * @param filter The filter to apply on the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return policy assignments for a resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listForResourceSinglePageAsync( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String filter) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceProviderNamespace == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter resourceProviderNamespace is required and cannot be null.")); - } - if (parentResourcePath == null) { - return Mono - .error(new IllegalArgumentException("Parameter parentResourcePath is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .listForResource( - this.client.getEndpoint(), - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - filter, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets policy assignments for a resource. - * - * @param resourceGroupName The name of the resource group containing the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource path. - * @param resourceType The resource type. - * @param resourceName The name of the resource with policy assignments. - * @param filter The filter to apply on the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return policy assignments for a resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listForResourceSinglePageAsync( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String filter, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceProviderNamespace == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter resourceProviderNamespace is required and cannot be null.")); - } - if (parentResourcePath == null) { - return Mono - .error(new IllegalArgumentException("Parameter parentResourcePath is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .listForResource( - this.client.getEndpoint(), - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - filter, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets policy assignments for a resource. - * - * @param resourceGroupName The name of the resource group containing the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource path. - * @param resourceType The resource type. - * @param resourceName The name of the resource with policy assignments. - * @param filter The filter to apply on the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return policy assignments for a resource. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listForResourceAsync( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String filter) { - return new PagedFlux<>( - () -> - listForResourceSinglePageAsync( - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - filter), - nextLink -> listForResourceNextSinglePageAsync(nextLink)); - } - - /** - * Gets policy assignments for a resource. - * - * @param resourceGroupName The name of the resource group containing the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource path. - * @param resourceType The resource type. - * @param resourceName The name of the resource with policy assignments. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return policy assignments for a resource. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listForResourceAsync( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName) { - final String filter = null; - return new PagedFlux<>( - () -> - listForResourceSinglePageAsync( - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - filter), - nextLink -> listForResourceNextSinglePageAsync(nextLink)); - } - - /** - * Gets policy assignments for a resource. - * - * @param resourceGroupName The name of the resource group containing the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource path. - * @param resourceType The resource type. - * @param resourceName The name of the resource with policy assignments. - * @param filter The filter to apply on the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return policy assignments for a resource. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listForResourceAsync( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String filter, - Context context) { - return new PagedFlux<>( - () -> - listForResourceSinglePageAsync( - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - filter, - context), - nextLink -> listForResourceNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets policy assignments for a resource. - * - * @param resourceGroupName The name of the resource group containing the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource path. - * @param resourceType The resource type. - * @param resourceName The name of the resource with policy assignments. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return policy assignments for a resource. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listForResource( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName) { - final String filter = null; - return new PagedIterable<>( - listForResourceAsync( - resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, filter)); - } - - /** - * Gets policy assignments for a resource. - * - * @param resourceGroupName The name of the resource group containing the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource path. - * @param resourceType The resource type. - * @param resourceName The name of the resource with policy assignments. - * @param filter The filter to apply on the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return policy assignments for a resource. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listForResource( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String filter, - Context context) { - return new PagedIterable<>( - listForResourceAsync( - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - filter, - context)); - } - - /** - * Gets all the policy assignments for a subscription. - * - * @param filter The filter to apply on the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the policy assignments for a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String filter) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - filter, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all the policy assignments for a subscription. - * - * @param filter The filter to apply on the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the policy assignments for a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String filter, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - filter, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all the policy assignments for a subscription. - * - * @param filter The filter to apply on the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the policy assignments for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String filter) { - return new PagedFlux<>(() -> listSinglePageAsync(filter), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets all the policy assignments for a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the policy assignments for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - final String filter = null; - return new PagedFlux<>(() -> listSinglePageAsync(filter), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets all the policy assignments for a subscription. - * - * @param filter The filter to apply on the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the policy assignments for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String filter, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(filter, context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all the policy assignments for a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the policy assignments for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - final String filter = null; - return new PagedIterable<>(listAsync(filter)); - } - - /** - * Gets all the policy assignments for a subscription. - * - * @param filter The filter to apply on the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the policy assignments for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String filter, Context context) { - return new PagedIterable<>(listAsync(filter, context)); - } - - /** - * When providing a scope for the assignment, use '/subscriptions/{subscription-id}/' for subscriptions, - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' - * for resources. - * - * @param policyAssignmentId The ID of the policy assignment to delete. Use the format - * '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteByIdWithResponseAsync(String policyAssignmentId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (policyAssignmentId == null) { - return Mono - .error(new IllegalArgumentException("Parameter policyAssignmentId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .deleteById( - this.client.getEndpoint(), - policyAssignmentId, - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * When providing a scope for the assignment, use '/subscriptions/{subscription-id}/' for subscriptions, - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' - * for resources. - * - * @param policyAssignmentId The ID of the policy assignment to delete. Use the format - * '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteByIdWithResponseAsync( - String policyAssignmentId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (policyAssignmentId == null) { - return Mono - .error(new IllegalArgumentException("Parameter policyAssignmentId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .deleteById(this.client.getEndpoint(), policyAssignmentId, this.client.getApiVersion(), accept, context); - } - - /** - * When providing a scope for the assignment, use '/subscriptions/{subscription-id}/' for subscriptions, - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' - * for resources. - * - * @param policyAssignmentId The ID of the policy assignment to delete. Use the format - * '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteByIdAsync(String policyAssignmentId) { - return deleteByIdWithResponseAsync(policyAssignmentId) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * When providing a scope for the assignment, use '/subscriptions/{subscription-id}/' for subscriptions, - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' - * for resources. - * - * @param policyAssignmentId The ID of the policy assignment to delete. Use the format - * '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PolicyAssignmentInner deleteById(String policyAssignmentId) { - return deleteByIdAsync(policyAssignmentId).block(); - } - - /** - * When providing a scope for the assignment, use '/subscriptions/{subscription-id}/' for subscriptions, - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' - * for resources. - * - * @param policyAssignmentId The ID of the policy assignment to delete. Use the format - * '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteByIdWithResponse(String policyAssignmentId, Context context) { - return deleteByIdWithResponseAsync(policyAssignmentId, context).block(); - } - - /** - * Policy assignments are inherited by child resources. For example, when you apply a policy to a resource group - * that policy is assigned to all resources in the group. When providing a scope for the assignment, use - * '/subscriptions/{subscription-id}/' for subscriptions, - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' - * for resources. - * - * @param policyAssignmentId The ID of the policy assignment to create. Use the format - * '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'. - * @param parameters Parameters for policy assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createByIdWithResponseAsync( - String policyAssignmentId, PolicyAssignmentInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (policyAssignmentId == null) { - return Mono - .error(new IllegalArgumentException("Parameter policyAssignmentId is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .createById( - this.client.getEndpoint(), - policyAssignmentId, - this.client.getApiVersion(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Policy assignments are inherited by child resources. For example, when you apply a policy to a resource group - * that policy is assigned to all resources in the group. When providing a scope for the assignment, use - * '/subscriptions/{subscription-id}/' for subscriptions, - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' - * for resources. - * - * @param policyAssignmentId The ID of the policy assignment to create. Use the format - * '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'. - * @param parameters Parameters for policy assignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createByIdWithResponseAsync( - String policyAssignmentId, PolicyAssignmentInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (policyAssignmentId == null) { - return Mono - .error(new IllegalArgumentException("Parameter policyAssignmentId is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .createById( - this.client.getEndpoint(), - policyAssignmentId, - this.client.getApiVersion(), - parameters, - accept, - context); - } - - /** - * Policy assignments are inherited by child resources. For example, when you apply a policy to a resource group - * that policy is assigned to all resources in the group. When providing a scope for the assignment, use - * '/subscriptions/{subscription-id}/' for subscriptions, - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' - * for resources. - * - * @param policyAssignmentId The ID of the policy assignment to create. Use the format - * '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'. - * @param parameters Parameters for policy assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createByIdAsync(String policyAssignmentId, PolicyAssignmentInner parameters) { - return createByIdWithResponseAsync(policyAssignmentId, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Policy assignments are inherited by child resources. For example, when you apply a policy to a resource group - * that policy is assigned to all resources in the group. When providing a scope for the assignment, use - * '/subscriptions/{subscription-id}/' for subscriptions, - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' - * for resources. - * - * @param policyAssignmentId The ID of the policy assignment to create. Use the format - * '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'. - * @param parameters Parameters for policy assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PolicyAssignmentInner createById(String policyAssignmentId, PolicyAssignmentInner parameters) { - return createByIdAsync(policyAssignmentId, parameters).block(); - } - - /** - * Policy assignments are inherited by child resources. For example, when you apply a policy to a resource group - * that policy is assigned to all resources in the group. When providing a scope for the assignment, use - * '/subscriptions/{subscription-id}/' for subscriptions, - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' - * for resources. - * - * @param policyAssignmentId The ID of the policy assignment to create. Use the format - * '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'. - * @param parameters Parameters for policy assignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createByIdWithResponse( - String policyAssignmentId, PolicyAssignmentInner parameters, Context context) { - return createByIdWithResponseAsync(policyAssignmentId, parameters, context).block(); - } - - /** - * When providing a scope for the assignment, use '/subscriptions/{subscription-id}/' for subscriptions, - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' - * for resources. - * - * @param policyAssignmentId The ID of the policy assignment to get. Use the format - * '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByIdWithResponseAsync(String policyAssignmentId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (policyAssignmentId == null) { - return Mono - .error(new IllegalArgumentException("Parameter policyAssignmentId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .getById( - this.client.getEndpoint(), - policyAssignmentId, - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * When providing a scope for the assignment, use '/subscriptions/{subscription-id}/' for subscriptions, - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' - * for resources. - * - * @param policyAssignmentId The ID of the policy assignment to get. Use the format - * '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByIdWithResponseAsync(String policyAssignmentId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (policyAssignmentId == null) { - return Mono - .error(new IllegalArgumentException("Parameter policyAssignmentId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .getById(this.client.getEndpoint(), policyAssignmentId, this.client.getApiVersion(), accept, context); - } - - /** - * When providing a scope for the assignment, use '/subscriptions/{subscription-id}/' for subscriptions, - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' - * for resources. - * - * @param policyAssignmentId The ID of the policy assignment to get. Use the format - * '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByIdAsync(String policyAssignmentId) { - return getByIdWithResponseAsync(policyAssignmentId) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * When providing a scope for the assignment, use '/subscriptions/{subscription-id}/' for subscriptions, - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' - * for resources. - * - * @param policyAssignmentId The ID of the policy assignment to get. Use the format - * '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PolicyAssignmentInner getById(String policyAssignmentId) { - return getByIdAsync(policyAssignmentId).block(); - } - - /** - * When providing a scope for the assignment, use '/subscriptions/{subscription-id}/' for subscriptions, - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' - * for resources. - * - * @param policyAssignmentId The ID of the policy assignment to get. Use the format - * '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByIdWithResponse(String policyAssignmentId, Context context) { - return getByIdWithResponseAsync(policyAssignmentId, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of policy assignments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listForResourceGroupNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> service.listForResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of policy assignments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listForResourceGroupNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .listForResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of policy assignments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listForResourceNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext(context -> service.listForResourceNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of policy assignments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listForResourceNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .listForResourceNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of policy assignments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of policy assignments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/PolicyAssignmentsImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/PolicyAssignmentsImpl.java deleted file mode 100644 index cdb312d0b5ec..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/PolicyAssignmentsImpl.java +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.CoreUtils; -import com.azure.resourcemanager.resources.models.PolicyAssignment; -import com.azure.resourcemanager.resources.models.PolicyAssignments; -import com.azure.resourcemanager.resources.models.ResourceGroups; -import com.azure.resourcemanager.resources.fluent.models.PolicyAssignmentInner; -import com.azure.resourcemanager.resources.fluent.PolicyAssignmentsClient; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.CreatableWrappersImpl; -import reactor.core.publisher.Mono; - -/** - * The implementation for {@link ResourceGroups} and its parent interfaces. - */ -public final class PolicyAssignmentsImpl - extends CreatableWrappersImpl - implements PolicyAssignments { - private final PolicyAssignmentsClient client; - - /** - * Creates an instance of the implementation. - * - * @param innerClient the inner policies client - */ - public PolicyAssignmentsImpl(final PolicyAssignmentsClient innerClient) { - this.client = innerClient; - } - - @Override - public PagedIterable list() { - return new PagedIterable<>(this.listAsync()); - } - - @Override - public Mono deleteByIdAsync(String id) { - return client.deleteByIdAsync(id).then(); - } - - @Override - public PolicyAssignmentImpl define(String name) { - return wrapModel(name); - } - - @Override - protected PolicyAssignmentImpl wrapModel(String name) { - return new PolicyAssignmentImpl(name, - new PolicyAssignmentInner().withDisplayName(name), - client); - } - - @Override - protected PolicyAssignmentImpl wrapModel(PolicyAssignmentInner inner) { - if (inner == null) { - return null; - } - return new PolicyAssignmentImpl(inner.name(), inner, client); - } - - @Override - public PagedIterable listByResource(String resourceId) { - return wrapList(client.listForResource( - ResourceUtils.groupFromResourceId(resourceId), - ResourceUtils.resourceProviderFromResourceId(resourceId), - ResourceUtils.relativePathFromResourceId(ResourceUtils.parentResourceIdFromResourceId(resourceId)), - ResourceUtils.resourceTypeFromResourceId(resourceId), - ResourceUtils.nameFromResourceId(resourceId) - )); - } - - @Override - public PolicyAssignment getById(String id) { - return getByIdAsync(id).block(); - } - - @Override - public Mono getByIdAsync(String id) { - return client.getByIdAsync(id) - .map(this::wrapModel); - } - - @Override - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(this.listByResourceGroupAsync(resourceGroupName)); - } - - @Override - public PagedFlux listAsync() { - return wrapPageAsync(this.client.listAsync()); - } - - @Override - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - if (CoreUtils.isNullOrEmpty(resourceGroupName)) { - return new PagedFlux<>(() -> Mono.error( - new IllegalArgumentException("Parameter 'resourceGroupName' is required and cannot be null."))); - } - return wrapPageAsync(this.client.listByResourceGroupAsync(resourceGroupName)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/PolicyClientBuilder.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/PolicyClientBuilder.java deleted file mode 100644 index a7d3628e1e37..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/PolicyClientBuilder.java +++ /dev/null @@ -1,146 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.implementation; - -import com.azure.core.annotation.ServiceClientBuilder; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.policy.CookiePolicy; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerAdapter; -import java.time.Duration; - -/** A builder for creating a new instance of the PolicyClientImpl type. */ -@ServiceClientBuilder(serviceClients = {PolicyClientImpl.class}) -public final class PolicyClientBuilder { - /* - * The ID of the target subscription. - */ - private String subscriptionId; - - /** - * Sets The ID of the target subscription. - * - * @param subscriptionId the subscriptionId value. - * @return the PolicyClientBuilder. - */ - public PolicyClientBuilder subscriptionId(String subscriptionId) { - this.subscriptionId = subscriptionId; - return this; - } - - /* - * server parameter - */ - private String endpoint; - - /** - * Sets server parameter. - * - * @param endpoint the endpoint value. - * @return the PolicyClientBuilder. - */ - public PolicyClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * The environment to connect to - */ - private AzureEnvironment environment; - - /** - * Sets The environment to connect to. - * - * @param environment the environment value. - * @return the PolicyClientBuilder. - */ - public PolicyClientBuilder environment(AzureEnvironment environment) { - this.environment = environment; - return this; - } - - /* - * The default poll interval for long-running operation - */ - private Duration defaultPollInterval; - - /** - * Sets The default poll interval for long-running operation. - * - * @param defaultPollInterval the defaultPollInterval value. - * @return the PolicyClientBuilder. - */ - public PolicyClientBuilder defaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = defaultPollInterval; - return this; - } - - /* - * The HTTP pipeline to send requests through - */ - private HttpPipeline pipeline; - - /** - * Sets The HTTP pipeline to send requests through. - * - * @param pipeline the pipeline value. - * @return the PolicyClientBuilder. - */ - public PolicyClientBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; - return this; - } - - /* - * The serializer to serialize an object into a string - */ - private SerializerAdapter serializerAdapter; - - /** - * Sets The serializer to serialize an object into a string. - * - * @param serializerAdapter the serializerAdapter value. - * @return the PolicyClientBuilder. - */ - public PolicyClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { - this.serializerAdapter = serializerAdapter; - return this; - } - - /** - * Builds an instance of PolicyClientImpl with the provided parameters. - * - * @return an instance of PolicyClientImpl. - */ - public PolicyClientImpl buildClient() { - if (endpoint == null) { - this.endpoint = "https://management.azure.com"; - } - if (environment == null) { - this.environment = AzureEnvironment.AZURE; - } - if (defaultPollInterval == null) { - this.defaultPollInterval = Duration.ofSeconds(30); - } - if (pipeline == null) { - this.pipeline = - new HttpPipelineBuilder() - .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) - .build(); - } - if (serializerAdapter == null) { - this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); - } - PolicyClientImpl client = - new PolicyClientImpl( - pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); - return client; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/PolicyClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/PolicyClientImpl.java deleted file mode 100644 index 5693c78a9a1b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/PolicyClientImpl.java +++ /dev/null @@ -1,146 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.implementation; - -import com.azure.core.annotation.ServiceClient; -import com.azure.core.http.HttpPipeline; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.serializer.SerializerAdapter; -import com.azure.resourcemanager.resources.fluent.PolicyAssignmentsClient; -import com.azure.resourcemanager.resources.fluent.PolicyClient; -import com.azure.resourcemanager.resources.fluent.PolicyDefinitionsClient; -import com.azure.resourcemanager.resources.fluentcore.AzureServiceClient; -import java.time.Duration; - -/** Initializes a new instance of the PolicyClientImpl type. */ -@ServiceClient(builder = PolicyClientBuilder.class) -public final class PolicyClientImpl extends AzureServiceClient implements PolicyClient { - private final ClientLogger logger = new ClientLogger(PolicyClientImpl.class); - - /** The ID of the target subscription. */ - private final String subscriptionId; - - /** - * Gets The ID of the target subscription. - * - * @return the subscriptionId value. - */ - public String getSubscriptionId() { - return this.subscriptionId; - } - - /** server parameter. */ - private final String endpoint; - - /** - * Gets server parameter. - * - * @return the endpoint value. - */ - public String getEndpoint() { - return this.endpoint; - } - - /** Api Version. */ - private final String apiVersion; - - /** - * Gets Api Version. - * - * @return the apiVersion value. - */ - public String getApiVersion() { - return this.apiVersion; - } - - /** The HTTP pipeline to send requests through. */ - private final HttpPipeline httpPipeline; - - /** - * Gets The HTTP pipeline to send requests through. - * - * @return the httpPipeline value. - */ - public HttpPipeline getHttpPipeline() { - return this.httpPipeline; - } - - /** The serializer to serialize an object into a string. */ - private final SerializerAdapter serializerAdapter; - - /** - * Gets The serializer to serialize an object into a string. - * - * @return the serializerAdapter value. - */ - SerializerAdapter getSerializerAdapter() { - return this.serializerAdapter; - } - - /** The default poll interval for long-running operation. */ - private final Duration defaultPollInterval; - - /** - * Gets The default poll interval for long-running operation. - * - * @return the defaultPollInterval value. - */ - public Duration getDefaultPollInterval() { - return this.defaultPollInterval; - } - - /** The PolicyDefinitionsClient object to access its operations. */ - private final PolicyDefinitionsClient policyDefinitions; - - /** - * Gets the PolicyDefinitionsClient object to access its operations. - * - * @return the PolicyDefinitionsClient object. - */ - public PolicyDefinitionsClient getPolicyDefinitions() { - return this.policyDefinitions; - } - - /** The PolicyAssignmentsClient object to access its operations. */ - private final PolicyAssignmentsClient policyAssignments; - - /** - * Gets the PolicyAssignmentsClient object to access its operations. - * - * @return the PolicyAssignmentsClient object. - */ - public PolicyAssignmentsClient getPolicyAssignments() { - return this.policyAssignments; - } - - /** - * Initializes an instance of PolicyClient client. - * - * @param httpPipeline The HTTP pipeline to send requests through. - * @param serializerAdapter The serializer to serialize an object into a string. - * @param defaultPollInterval The default poll interval for long-running operation. - * @param environment The Azure environment. - * @param subscriptionId The ID of the target subscription. - * @param endpoint server parameter. - */ - PolicyClientImpl( - HttpPipeline httpPipeline, - SerializerAdapter serializerAdapter, - Duration defaultPollInterval, - AzureEnvironment environment, - String subscriptionId, - String endpoint) { - super(httpPipeline, serializerAdapter, environment); - this.httpPipeline = httpPipeline; - this.serializerAdapter = serializerAdapter; - this.defaultPollInterval = defaultPollInterval; - this.subscriptionId = subscriptionId; - this.endpoint = endpoint; - this.apiVersion = "2016-12-01"; - this.policyDefinitions = new PolicyDefinitionsClientImpl(this); - this.policyAssignments = new PolicyAssignmentsClientImpl(this); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/PolicyDefinitionImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/PolicyDefinitionImpl.java deleted file mode 100644 index bbc5a0bf9200..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/PolicyDefinitionImpl.java +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.implementation; - -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.resources.models.PolicyDefinition; -import com.azure.resourcemanager.resources.models.PolicyType; -import com.azure.resourcemanager.resources.fluent.models.PolicyDefinitionInner; -import com.azure.resourcemanager.resources.fluent.PolicyDefinitionsClient; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.CreatableUpdatableImpl; -import reactor.core.publisher.Mono; - -import java.io.IOException; -/** - * Implementation for {@link PolicyDefinition}. - */ -final class PolicyDefinitionImpl extends - CreatableUpdatableImpl - implements - PolicyDefinition, - PolicyDefinition.Definition, - PolicyDefinition.Update { - private final PolicyDefinitionsClient innerCollection; - private final ClientLogger logger = new ClientLogger(getClass()); - - PolicyDefinitionImpl(String name, PolicyDefinitionInner innerModel, PolicyDefinitionsClient innerCollection) { - super(name, innerModel); - this.innerCollection = innerCollection; - } - - @Override - public PolicyType policyType() { - return innerModel().policyType(); - } - - @Override - public String displayName() { - return innerModel().displayName(); - } - - @Override - public String description() { - return innerModel().description(); - } - - @Override - public Object policyRule() { - return innerModel().policyRule(); - } - - @Override - public Object parameters() { return innerModel().parameters(); } - - @Override - public String id() { - return innerModel().id(); - } - - @Override - protected Mono getInnerAsync() { - return innerCollection.getAsync(name()); - } - - @Override - public PolicyDefinitionImpl withDescription(String description) { - innerModel().withDescription(description); - return this; - } - - @Override - public PolicyDefinitionImpl withDisplayName(String displayName) { - innerModel().withDisplayName(displayName); - return this; - } - - @Override - public PolicyDefinitionImpl withPolicyRule(Object policyRule) { - innerModel().withPolicyRule(policyRule); - return this; - } - - @Override - public PolicyDefinitionImpl withPolicyRuleJson(String policyRuleJson) { - try { - innerModel().withPolicyRule(new ObjectMapper().readTree(policyRuleJson)); - } catch (IOException e) { - throw logger.logExceptionAsError(new RuntimeException(e)); - } - return this; - } - - @Override - public PolicyDefinitionImpl withPolicyType(PolicyType policyType) { - innerModel().withPolicyType(policyType); - return this; - } - - @Override - public Mono createResourceAsync() { - return innerCollection.createOrUpdateAsync(name(), innerModel()) - .map(innerToFluentMap(this)); - } - - @Override - public boolean isInCreateMode() { - return id() == null; - } - - @Override - public PolicyDefinitionImpl withParameters(Object parameters) { - innerModel().withParameters(parameters); - return this; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/PolicyDefinitionsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/PolicyDefinitionsClientImpl.java deleted file mode 100644 index 29d59018d85a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/PolicyDefinitionsClientImpl.java +++ /dev/null @@ -1,1781 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.resources.fluent.PolicyDefinitionsClient; -import com.azure.resourcemanager.resources.fluent.models.PolicyDefinitionInner; -import com.azure.resourcemanager.resources.models.PolicyDefinitionListResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in PolicyDefinitionsClient. */ -public final class PolicyDefinitionsClientImpl implements PolicyDefinitionsClient { - private final ClientLogger logger = new ClientLogger(PolicyDefinitionsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final PolicyDefinitionsService service; - - /** The service client containing this operation class. */ - private final PolicyClientImpl client; - - /** - * Initializes an instance of PolicyDefinitionsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - PolicyDefinitionsClientImpl(PolicyClientImpl client) { - this.service = - RestProxy.create(PolicyDefinitionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for PolicyClientPolicyDefinitions to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "PolicyClientPolicyDe") - private interface PolicyDefinitionsService { - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions" - + "/{policyDefinitionName}") - @ExpectedResponses({201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("policyDefinitionName") String policyDefinitionName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") PolicyDefinitionInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions" - + "/{policyDefinitionName}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @PathParam("policyDefinitionName") String policyDefinitionName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions" - + "/{policyDefinitionName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("policyDefinitionName") String policyDefinitionName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getBuiltIn( - @HostParam("$host") String endpoint, - @PathParam("policyDefinitionName") String policyDefinitionName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/providers/Microsoft.Management/managementgroups/{managementGroupId}/providers/Microsoft.Authorization" - + "/policyDefinitions/{policyDefinitionName}") - @ExpectedResponses({201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdateAtManagementGroup( - @HostParam("$host") String endpoint, - @PathParam("policyDefinitionName") String policyDefinitionName, - @QueryParam("api-version") String apiVersion, - @PathParam("managementGroupId") String managementGroupId, - @BodyParam("application/json") PolicyDefinitionInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/providers/Microsoft.Management/managementgroups/{managementGroupId}/providers/Microsoft.Authorization" - + "/policyDefinitions/{policyDefinitionName}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteAtManagementGroup( - @HostParam("$host") String endpoint, - @PathParam("policyDefinitionName") String policyDefinitionName, - @QueryParam("api-version") String apiVersion, - @PathParam("managementGroupId") String managementGroupId, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/providers/Microsoft.Management/managementgroups/{managementGroupId}/providers/Microsoft.Authorization" - + "/policyDefinitions/{policyDefinitionName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getAtManagementGroup( - @HostParam("$host") String endpoint, - @PathParam("policyDefinitionName") String policyDefinitionName, - @QueryParam("api-version") String apiVersion, - @PathParam("managementGroupId") String managementGroupId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/providers/Microsoft.Authorization/policyDefinitions") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBuiltIn( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/providers/Microsoft.Management/managementgroups/{managementGroupId}/providers/Microsoft.Authorization" - + "/policyDefinitions") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByManagementGroup( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("managementGroupId") String managementGroupId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBuiltInNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByManagementGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Creates or updates a policy definition. - * - * @param policyDefinitionName The name of the policy definition to create. - * @param parameters The policy definition properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponseAsync( - String policyDefinitionName, PolicyDefinitionInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (policyDefinitionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter policyDefinitionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - policyDefinitionName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a policy definition. - * - * @param policyDefinitionName The name of the policy definition to create. - * @param parameters The policy definition properties. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String policyDefinitionName, PolicyDefinitionInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (policyDefinitionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter policyDefinitionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - policyDefinitionName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Creates or updates a policy definition. - * - * @param policyDefinitionName The name of the policy definition to create. - * @param parameters The policy definition properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String policyDefinitionName, PolicyDefinitionInner parameters) { - return createOrUpdateWithResponseAsync(policyDefinitionName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates or updates a policy definition. - * - * @param policyDefinitionName The name of the policy definition to create. - * @param parameters The policy definition properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PolicyDefinitionInner createOrUpdate(String policyDefinitionName, PolicyDefinitionInner parameters) { - return createOrUpdateAsync(policyDefinitionName, parameters).block(); - } - - /** - * Creates or updates a policy definition. - * - * @param policyDefinitionName The name of the policy definition to create. - * @param parameters The policy definition properties. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String policyDefinitionName, PolicyDefinitionInner parameters, Context context) { - return createOrUpdateWithResponseAsync(policyDefinitionName, parameters, context).block(); - } - - /** - * Deletes a policy definition. - * - * @param policyDefinitionName The name of the policy definition to delete. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String policyDefinitionName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (policyDefinitionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter policyDefinitionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - policyDefinitionName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a policy definition. - * - * @param policyDefinitionName The name of the policy definition to delete. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String policyDefinitionName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (policyDefinitionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter policyDefinitionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - policyDefinitionName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - context); - } - - /** - * Deletes a policy definition. - * - * @param policyDefinitionName The name of the policy definition to delete. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String policyDefinitionName) { - return deleteWithResponseAsync(policyDefinitionName).flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes a policy definition. - * - * @param policyDefinitionName The name of the policy definition to delete. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String policyDefinitionName) { - deleteAsync(policyDefinitionName).block(); - } - - /** - * Deletes a policy definition. - * - * @param policyDefinitionName The name of the policy definition to delete. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String policyDefinitionName, Context context) { - return deleteWithResponseAsync(policyDefinitionName, context).block(); - } - - /** - * Gets the policy definition. - * - * @param policyDefinitionName The name of the policy definition to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync(String policyDefinitionName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (policyDefinitionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter policyDefinitionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - policyDefinitionName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the policy definition. - * - * @param policyDefinitionName The name of the policy definition to get. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String policyDefinitionName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (policyDefinitionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter policyDefinitionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - policyDefinitionName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets the policy definition. - * - * @param policyDefinitionName The name of the policy definition to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync(String policyDefinitionName) { - return getWithResponseAsync(policyDefinitionName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the policy definition. - * - * @param policyDefinitionName The name of the policy definition to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PolicyDefinitionInner get(String policyDefinitionName) { - return getAsync(policyDefinitionName).block(); - } - - /** - * Gets the policy definition. - * - * @param policyDefinitionName The name of the policy definition to get. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String policyDefinitionName, Context context) { - return getWithResponseAsync(policyDefinitionName, context).block(); - } - - /** - * Gets the built in policy definition. - * - * @param policyDefinitionName The name of the built in policy definition to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the built in policy definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getBuiltInWithResponseAsync(String policyDefinitionName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (policyDefinitionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter policyDefinitionName is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .getBuiltIn( - this.client.getEndpoint(), - policyDefinitionName, - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the built in policy definition. - * - * @param policyDefinitionName The name of the built in policy definition to get. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the built in policy definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getBuiltInWithResponseAsync( - String policyDefinitionName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (policyDefinitionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter policyDefinitionName is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .getBuiltIn(this.client.getEndpoint(), policyDefinitionName, this.client.getApiVersion(), accept, context); - } - - /** - * Gets the built in policy definition. - * - * @param policyDefinitionName The name of the built in policy definition to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the built in policy definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getBuiltInAsync(String policyDefinitionName) { - return getBuiltInWithResponseAsync(policyDefinitionName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the built in policy definition. - * - * @param policyDefinitionName The name of the built in policy definition to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the built in policy definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PolicyDefinitionInner getBuiltIn(String policyDefinitionName) { - return getBuiltInAsync(policyDefinitionName).block(); - } - - /** - * Gets the built in policy definition. - * - * @param policyDefinitionName The name of the built in policy definition to get. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the built in policy definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getBuiltInWithResponse(String policyDefinitionName, Context context) { - return getBuiltInWithResponseAsync(policyDefinitionName, context).block(); - } - - /** - * Creates or updates a policy definition at management group level. - * - * @param policyDefinitionName The name of the policy definition to create. - * @param managementGroupId The ID of the management group. - * @param parameters The policy definition properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateAtManagementGroupWithResponseAsync( - String policyDefinitionName, String managementGroupId, PolicyDefinitionInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (policyDefinitionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter policyDefinitionName is required and cannot be null.")); - } - if (managementGroupId == null) { - return Mono - .error(new IllegalArgumentException("Parameter managementGroupId is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdateAtManagementGroup( - this.client.getEndpoint(), - policyDefinitionName, - this.client.getApiVersion(), - managementGroupId, - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a policy definition at management group level. - * - * @param policyDefinitionName The name of the policy definition to create. - * @param managementGroupId The ID of the management group. - * @param parameters The policy definition properties. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateAtManagementGroupWithResponseAsync( - String policyDefinitionName, String managementGroupId, PolicyDefinitionInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (policyDefinitionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter policyDefinitionName is required and cannot be null.")); - } - if (managementGroupId == null) { - return Mono - .error(new IllegalArgumentException("Parameter managementGroupId is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdateAtManagementGroup( - this.client.getEndpoint(), - policyDefinitionName, - this.client.getApiVersion(), - managementGroupId, - parameters, - accept, - context); - } - - /** - * Creates or updates a policy definition at management group level. - * - * @param policyDefinitionName The name of the policy definition to create. - * @param managementGroupId The ID of the management group. - * @param parameters The policy definition properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAtManagementGroupAsync( - String policyDefinitionName, String managementGroupId, PolicyDefinitionInner parameters) { - return createOrUpdateAtManagementGroupWithResponseAsync(policyDefinitionName, managementGroupId, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates or updates a policy definition at management group level. - * - * @param policyDefinitionName The name of the policy definition to create. - * @param managementGroupId The ID of the management group. - * @param parameters The policy definition properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PolicyDefinitionInner createOrUpdateAtManagementGroup( - String policyDefinitionName, String managementGroupId, PolicyDefinitionInner parameters) { - return createOrUpdateAtManagementGroupAsync(policyDefinitionName, managementGroupId, parameters).block(); - } - - /** - * Creates or updates a policy definition at management group level. - * - * @param policyDefinitionName The name of the policy definition to create. - * @param managementGroupId The ID of the management group. - * @param parameters The policy definition properties. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateAtManagementGroupWithResponse( - String policyDefinitionName, String managementGroupId, PolicyDefinitionInner parameters, Context context) { - return createOrUpdateAtManagementGroupWithResponseAsync( - policyDefinitionName, managementGroupId, parameters, context) - .block(); - } - - /** - * Deletes a policy definition at management group level. - * - * @param policyDefinitionName The name of the policy definition to delete. - * @param managementGroupId The ID of the management group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteAtManagementGroupWithResponseAsync( - String policyDefinitionName, String managementGroupId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (policyDefinitionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter policyDefinitionName is required and cannot be null.")); - } - if (managementGroupId == null) { - return Mono - .error(new IllegalArgumentException("Parameter managementGroupId is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .deleteAtManagementGroup( - this.client.getEndpoint(), - policyDefinitionName, - this.client.getApiVersion(), - managementGroupId, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a policy definition at management group level. - * - * @param policyDefinitionName The name of the policy definition to delete. - * @param managementGroupId The ID of the management group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteAtManagementGroupWithResponseAsync( - String policyDefinitionName, String managementGroupId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (policyDefinitionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter policyDefinitionName is required and cannot be null.")); - } - if (managementGroupId == null) { - return Mono - .error(new IllegalArgumentException("Parameter managementGroupId is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .deleteAtManagementGroup( - this.client.getEndpoint(), - policyDefinitionName, - this.client.getApiVersion(), - managementGroupId, - context); - } - - /** - * Deletes a policy definition at management group level. - * - * @param policyDefinitionName The name of the policy definition to delete. - * @param managementGroupId The ID of the management group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAtManagementGroupAsync(String policyDefinitionName, String managementGroupId) { - return deleteAtManagementGroupWithResponseAsync(policyDefinitionName, managementGroupId) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes a policy definition at management group level. - * - * @param policyDefinitionName The name of the policy definition to delete. - * @param managementGroupId The ID of the management group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteAtManagementGroup(String policyDefinitionName, String managementGroupId) { - deleteAtManagementGroupAsync(policyDefinitionName, managementGroupId).block(); - } - - /** - * Deletes a policy definition at management group level. - * - * @param policyDefinitionName The name of the policy definition to delete. - * @param managementGroupId The ID of the management group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteAtManagementGroupWithResponse( - String policyDefinitionName, String managementGroupId, Context context) { - return deleteAtManagementGroupWithResponseAsync(policyDefinitionName, managementGroupId, context).block(); - } - - /** - * Gets the policy definition at management group level. - * - * @param policyDefinitionName The name of the policy definition to get. - * @param managementGroupId The ID of the management group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy definition at management group level. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getAtManagementGroupWithResponseAsync( - String policyDefinitionName, String managementGroupId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (policyDefinitionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter policyDefinitionName is required and cannot be null.")); - } - if (managementGroupId == null) { - return Mono - .error(new IllegalArgumentException("Parameter managementGroupId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .getAtManagementGroup( - this.client.getEndpoint(), - policyDefinitionName, - this.client.getApiVersion(), - managementGroupId, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the policy definition at management group level. - * - * @param policyDefinitionName The name of the policy definition to get. - * @param managementGroupId The ID of the management group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy definition at management group level. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getAtManagementGroupWithResponseAsync( - String policyDefinitionName, String managementGroupId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (policyDefinitionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter policyDefinitionName is required and cannot be null.")); - } - if (managementGroupId == null) { - return Mono - .error(new IllegalArgumentException("Parameter managementGroupId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .getAtManagementGroup( - this.client.getEndpoint(), - policyDefinitionName, - this.client.getApiVersion(), - managementGroupId, - accept, - context); - } - - /** - * Gets the policy definition at management group level. - * - * @param policyDefinitionName The name of the policy definition to get. - * @param managementGroupId The ID of the management group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy definition at management group level. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAtManagementGroupAsync( - String policyDefinitionName, String managementGroupId) { - return getAtManagementGroupWithResponseAsync(policyDefinitionName, managementGroupId) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the policy definition at management group level. - * - * @param policyDefinitionName The name of the policy definition to get. - * @param managementGroupId The ID of the management group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy definition at management group level. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PolicyDefinitionInner getAtManagementGroup(String policyDefinitionName, String managementGroupId) { - return getAtManagementGroupAsync(policyDefinitionName, managementGroupId).block(); - } - - /** - * Gets the policy definition at management group level. - * - * @param policyDefinitionName The name of the policy definition to get. - * @param managementGroupId The ID of the management group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy definition at management group level. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getAtManagementGroupWithResponse( - String policyDefinitionName, String managementGroupId, Context context) { - return getAtManagementGroupWithResponseAsync(policyDefinitionName, managementGroupId, context).block(); - } - - /** - * Gets all the policy definitions for a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the policy definitions for a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all the policy definitions for a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the policy definitions for a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all the policy definitions for a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the policy definitions for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets all the policy definitions for a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the policy definitions for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all the policy definitions for a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the policy definitions for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Gets all the policy definitions for a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the policy definitions for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Gets all the built in policy definitions. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the built in policy definitions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBuiltInSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> service.listBuiltIn(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all the built in policy definitions. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the built in policy definitions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBuiltInSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .listBuiltIn(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all the built in policy definitions. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the built in policy definitions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listBuiltInAsync() { - return new PagedFlux<>( - () -> listBuiltInSinglePageAsync(), nextLink -> listBuiltInNextSinglePageAsync(nextLink)); - } - - /** - * Gets all the built in policy definitions. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the built in policy definitions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listBuiltInAsync(Context context) { - return new PagedFlux<>( - () -> listBuiltInSinglePageAsync(context), nextLink -> listBuiltInNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all the built in policy definitions. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the built in policy definitions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listBuiltIn() { - return new PagedIterable<>(listBuiltInAsync()); - } - - /** - * Gets all the built in policy definitions. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the built in policy definitions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listBuiltIn(Context context) { - return new PagedIterable<>(listBuiltInAsync(context)); - } - - /** - * Gets all the policy definitions for a subscription at management group level. - * - * @param managementGroupId The ID of the management group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the policy definitions for a subscription at management group level. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByManagementGroupSinglePageAsync(String managementGroupId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (managementGroupId == null) { - return Mono - .error(new IllegalArgumentException("Parameter managementGroupId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> - service - .listByManagementGroup( - this.client.getEndpoint(), this.client.getApiVersion(), managementGroupId, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all the policy definitions for a subscription at management group level. - * - * @param managementGroupId The ID of the management group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the policy definitions for a subscription at management group level. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByManagementGroupSinglePageAsync( - String managementGroupId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (managementGroupId == null) { - return Mono - .error(new IllegalArgumentException("Parameter managementGroupId is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .listByManagementGroup( - this.client.getEndpoint(), this.client.getApiVersion(), managementGroupId, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all the policy definitions for a subscription at management group level. - * - * @param managementGroupId The ID of the management group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the policy definitions for a subscription at management group level. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByManagementGroupAsync(String managementGroupId) { - return new PagedFlux<>( - () -> listByManagementGroupSinglePageAsync(managementGroupId), - nextLink -> listByManagementGroupNextSinglePageAsync(nextLink)); - } - - /** - * Gets all the policy definitions for a subscription at management group level. - * - * @param managementGroupId The ID of the management group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the policy definitions for a subscription at management group level. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByManagementGroupAsync(String managementGroupId, Context context) { - return new PagedFlux<>( - () -> listByManagementGroupSinglePageAsync(managementGroupId, context), - nextLink -> listByManagementGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all the policy definitions for a subscription at management group level. - * - * @param managementGroupId The ID of the management group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the policy definitions for a subscription at management group level. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByManagementGroup(String managementGroupId) { - return new PagedIterable<>(listByManagementGroupAsync(managementGroupId)); - } - - /** - * Gets all the policy definitions for a subscription at management group level. - * - * @param managementGroupId The ID of the management group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the policy definitions for a subscription at management group level. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByManagementGroup(String managementGroupId, Context context) { - return new PagedIterable<>(listByManagementGroupAsync(managementGroupId, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of policy definitions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of policy definitions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of policy definitions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBuiltInNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext(context -> service.listBuiltInNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of policy definitions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBuiltInNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .listBuiltInNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of policy definitions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByManagementGroupNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - return FluxUtil - .withContext( - context -> service.listByManagementGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of policy definitions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByManagementGroupNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json, text/json"; - context = this.client.mergeContext(context); - return service - .listByManagementGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/PolicyDefinitionsImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/PolicyDefinitionsImpl.java deleted file mode 100644 index 1d2f468970af..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/PolicyDefinitionsImpl.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.resources.models.PolicyDefinition; -import com.azure.resourcemanager.resources.models.PolicyDefinitions; -import com.azure.resourcemanager.resources.models.PolicyType; -import com.azure.resourcemanager.resources.models.ResourceGroups; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.ReadableWrappersImpl; -import com.azure.resourcemanager.resources.fluent.models.PolicyDefinitionInner; -import com.azure.resourcemanager.resources.fluent.PolicyDefinitionsClient; -import reactor.core.publisher.Mono; - -/** - * The implementation for {@link ResourceGroups} and its parent interfaces. - */ -public final class PolicyDefinitionsImpl - extends ReadableWrappersImpl - implements PolicyDefinitions { - private final PolicyDefinitionsClient client; - - /** - * Creates an instance of the implementation. - * - * @param innerClient the inner policies client - */ - public PolicyDefinitionsImpl(final PolicyDefinitionsClient innerClient) { - this.client = innerClient; - } - - @Override - public PagedIterable list() { - return wrapList(client.list()); - } - - @Override - public PolicyDefinition getByName(String name) { - return getByNameAsync(name).block(); - } - - @Override - public Mono getByNameAsync(String name) { - return client.getAsync(name) - .map(this::wrapModel); - } - - @Override - public void deleteByName(String name) { - deleteByNameAsync(name).block(); - } - - @Override - public Mono deleteByNameAsync(String name) { - return client.deleteAsync(name); - } - - @Override - public PolicyDefinitionImpl define(String name) { - return wrapModel(name); - } - - protected PolicyDefinitionImpl wrapModel(String name) { - return new PolicyDefinitionImpl( - name, - new PolicyDefinitionInner().withPolicyType(PolicyType.NOT_SPECIFIED).withDisplayName(name), - client); - } - - @Override - protected PolicyDefinitionImpl wrapModel(PolicyDefinitionInner inner) { - if (inner == null) { - return null; - } - return new PolicyDefinitionImpl(inner.name(), inner, client); - } - - @Override - public PagedFlux listAsync() { - return wrapPageAsync(client.listAsync()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ProviderImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ProviderImpl.java deleted file mode 100644 index 622c7df1ca84..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ProviderImpl.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.implementation; - -import com.azure.resourcemanager.resources.models.Provider; -import com.azure.resourcemanager.resources.models.ProviderResourceType; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.IndexableWrapperImpl; -import com.azure.resourcemanager.resources.fluent.models.ProviderInner; - -import java.util.List; - -/** - * The implementation of {@link Provider}. - */ -final class ProviderImpl extends - IndexableWrapperImpl - implements - Provider { - - ProviderImpl(ProviderInner provider) { - super(provider); - } - - @Override - public String namespace() { - return innerModel().namespace(); - } - - @Override - public String registrationState() { - return innerModel().registrationState(); - } - - @Override - public List resourceTypes() { - return innerModel().resourceTypes(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ProvidersClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ProvidersClientImpl.java deleted file mode 100644 index 37c0aabb39ae..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ProvidersClientImpl.java +++ /dev/null @@ -1,1251 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.resources.fluent.ProvidersClient; -import com.azure.resourcemanager.resources.fluent.models.ProviderInner; -import com.azure.resourcemanager.resources.models.ProviderListResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ProvidersClient. */ -public final class ProvidersClientImpl implements ProvidersClient { - private final ClientLogger logger = new ClientLogger(ProvidersClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final ProvidersService service; - - /** The service client containing this operation class. */ - private final ResourceManagementClientImpl client; - - /** - * Initializes an instance of ProvidersClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ProvidersClientImpl(ResourceManagementClientImpl client) { - this.service = - RestProxy.create(ProvidersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for ResourceManagementClientProviders to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "ResourceManagementCl") - private interface ProvidersService { - @Headers({"Content-Type: application/json"}) - @Post("/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}/unregister") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> unregister( - @HostParam("$host") String endpoint, - @PathParam("resourceProviderNamespace") String resourceProviderNamespace, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post("/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}/register") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> register( - @HostParam("$host") String endpoint, - @PathParam("resourceProviderNamespace") String resourceProviderNamespace, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("$top") Integer top, - @QueryParam("$expand") String expand, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/providers") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAtTenantScope( - @HostParam("$host") String endpoint, - @QueryParam("$top") Integer top, - @QueryParam("$expand") String expand, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("$expand") String expand, - @PathParam("resourceProviderNamespace") String resourceProviderNamespace, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/providers/{resourceProviderNamespace}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getAtTenantScope( - @HostParam("$host") String endpoint, - @QueryParam("$expand") String expand, - @PathParam("resourceProviderNamespace") String resourceProviderNamespace, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAtTenantScopeNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Unregisters a subscription from a resource provider. - * - * @param resourceProviderNamespace The namespace of the resource provider to unregister. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource provider information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> unregisterWithResponseAsync(String resourceProviderNamespace) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceProviderNamespace == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter resourceProviderNamespace is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .unregister( - this.client.getEndpoint(), - resourceProviderNamespace, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Unregisters a subscription from a resource provider. - * - * @param resourceProviderNamespace The namespace of the resource provider to unregister. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource provider information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> unregisterWithResponseAsync( - String resourceProviderNamespace, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceProviderNamespace == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter resourceProviderNamespace is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .unregister( - this.client.getEndpoint(), - resourceProviderNamespace, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Unregisters a subscription from a resource provider. - * - * @param resourceProviderNamespace The namespace of the resource provider to unregister. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource provider information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono unregisterAsync(String resourceProviderNamespace) { - return unregisterWithResponseAsync(resourceProviderNamespace) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Unregisters a subscription from a resource provider. - * - * @param resourceProviderNamespace The namespace of the resource provider to unregister. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource provider information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ProviderInner unregister(String resourceProviderNamespace) { - return unregisterAsync(resourceProviderNamespace).block(); - } - - /** - * Unregisters a subscription from a resource provider. - * - * @param resourceProviderNamespace The namespace of the resource provider to unregister. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource provider information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response unregisterWithResponse(String resourceProviderNamespace, Context context) { - return unregisterWithResponseAsync(resourceProviderNamespace, context).block(); - } - - /** - * Registers a subscription with a resource provider. - * - * @param resourceProviderNamespace The namespace of the resource provider to register. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource provider information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> registerWithResponseAsync(String resourceProviderNamespace) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceProviderNamespace == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter resourceProviderNamespace is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .register( - this.client.getEndpoint(), - resourceProviderNamespace, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Registers a subscription with a resource provider. - * - * @param resourceProviderNamespace The namespace of the resource provider to register. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource provider information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> registerWithResponseAsync(String resourceProviderNamespace, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceProviderNamespace == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter resourceProviderNamespace is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .register( - this.client.getEndpoint(), - resourceProviderNamespace, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Registers a subscription with a resource provider. - * - * @param resourceProviderNamespace The namespace of the resource provider to register. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource provider information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono registerAsync(String resourceProviderNamespace) { - return registerWithResponseAsync(resourceProviderNamespace) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Registers a subscription with a resource provider. - * - * @param resourceProviderNamespace The namespace of the resource provider to register. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource provider information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ProviderInner register(String resourceProviderNamespace) { - return registerAsync(resourceProviderNamespace).block(); - } - - /** - * Registers a subscription with a resource provider. - * - * @param resourceProviderNamespace The namespace of the resource provider to register. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource provider information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response registerWithResponse(String resourceProviderNamespace, Context context) { - return registerWithResponseAsync(resourceProviderNamespace, context).block(); - } - - /** - * Gets all resource providers for a subscription. - * - * @param top The number of results to return. If null is passed returns all deployments. - * @param expand The properties to include in the results. For example, use &$expand=metadata in the query - * string to retrieve resource provider metadata. To include property aliases in response, use - * $expand=resourceTypes/aliases. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all resource providers for a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Integer top, String expand) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - top, - expand, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all resource providers for a subscription. - * - * @param top The number of results to return. If null is passed returns all deployments. - * @param expand The properties to include in the results. For example, use &$expand=metadata in the query - * string to retrieve resource provider metadata. To include property aliases in response, use - * $expand=resourceTypes/aliases. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all resource providers for a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Integer top, String expand, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - top, - expand, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all resource providers for a subscription. - * - * @param top The number of results to return. If null is passed returns all deployments. - * @param expand The properties to include in the results. For example, use &$expand=metadata in the query - * string to retrieve resource provider metadata. To include property aliases in response, use - * $expand=resourceTypes/aliases. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all resource providers for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(Integer top, String expand) { - return new PagedFlux<>(() -> listSinglePageAsync(top, expand), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets all resource providers for a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all resource providers for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - final Integer top = null; - final String expand = null; - return new PagedFlux<>(() -> listSinglePageAsync(top, expand), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets all resource providers for a subscription. - * - * @param top The number of results to return. If null is passed returns all deployments. - * @param expand The properties to include in the results. For example, use &$expand=metadata in the query - * string to retrieve resource provider metadata. To include property aliases in response, use - * $expand=resourceTypes/aliases. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all resource providers for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Integer top, String expand, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(top, expand, context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all resource providers for a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all resource providers for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - final Integer top = null; - final String expand = null; - return new PagedIterable<>(listAsync(top, expand)); - } - - /** - * Gets all resource providers for a subscription. - * - * @param top The number of results to return. If null is passed returns all deployments. - * @param expand The properties to include in the results. For example, use &$expand=metadata in the query - * string to retrieve resource provider metadata. To include property aliases in response, use - * $expand=resourceTypes/aliases. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all resource providers for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Integer top, String expand, Context context) { - return new PagedIterable<>(listAsync(top, expand, context)); - } - - /** - * Gets all resource providers for the tenant. - * - * @param top The number of results to return. If null is passed returns all providers. - * @param expand The properties to include in the results. For example, use &$expand=metadata in the query - * string to retrieve resource provider metadata. To include property aliases in response, use - * $expand=resourceTypes/aliases. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all resource providers for the tenant. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAtTenantScopeSinglePageAsync(Integer top, String expand) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listAtTenantScope( - this.client.getEndpoint(), top, expand, this.client.getApiVersion(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all resource providers for the tenant. - * - * @param top The number of results to return. If null is passed returns all providers. - * @param expand The properties to include in the results. For example, use &$expand=metadata in the query - * string to retrieve resource provider metadata. To include property aliases in response, use - * $expand=resourceTypes/aliases. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all resource providers for the tenant. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAtTenantScopeSinglePageAsync( - Integer top, String expand, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listAtTenantScope(this.client.getEndpoint(), top, expand, this.client.getApiVersion(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all resource providers for the tenant. - * - * @param top The number of results to return. If null is passed returns all providers. - * @param expand The properties to include in the results. For example, use &$expand=metadata in the query - * string to retrieve resource provider metadata. To include property aliases in response, use - * $expand=resourceTypes/aliases. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all resource providers for the tenant. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAtTenantScopeAsync(Integer top, String expand) { - return new PagedFlux<>( - () -> listAtTenantScopeSinglePageAsync(top, expand), - nextLink -> listAtTenantScopeNextSinglePageAsync(nextLink)); - } - - /** - * Gets all resource providers for the tenant. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all resource providers for the tenant. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAtTenantScopeAsync() { - final Integer top = null; - final String expand = null; - return new PagedFlux<>( - () -> listAtTenantScopeSinglePageAsync(top, expand), - nextLink -> listAtTenantScopeNextSinglePageAsync(nextLink)); - } - - /** - * Gets all resource providers for the tenant. - * - * @param top The number of results to return. If null is passed returns all providers. - * @param expand The properties to include in the results. For example, use &$expand=metadata in the query - * string to retrieve resource provider metadata. To include property aliases in response, use - * $expand=resourceTypes/aliases. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all resource providers for the tenant. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAtTenantScopeAsync(Integer top, String expand, Context context) { - return new PagedFlux<>( - () -> listAtTenantScopeSinglePageAsync(top, expand, context), - nextLink -> listAtTenantScopeNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all resource providers for the tenant. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all resource providers for the tenant. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAtTenantScope() { - final Integer top = null; - final String expand = null; - return new PagedIterable<>(listAtTenantScopeAsync(top, expand)); - } - - /** - * Gets all resource providers for the tenant. - * - * @param top The number of results to return. If null is passed returns all providers. - * @param expand The properties to include in the results. For example, use &$expand=metadata in the query - * string to retrieve resource provider metadata. To include property aliases in response, use - * $expand=resourceTypes/aliases. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all resource providers for the tenant. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAtTenantScope(Integer top, String expand, Context context) { - return new PagedIterable<>(listAtTenantScopeAsync(top, expand, context)); - } - - /** - * Gets the specified resource provider. - * - * @param resourceProviderNamespace The namespace of the resource provider. - * @param expand The $expand query parameter. For example, to include property aliases in response, use - * $expand=resourceTypes/aliases. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified resource provider. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync(String resourceProviderNamespace, String expand) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceProviderNamespace == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter resourceProviderNamespace is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - expand, - resourceProviderNamespace, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the specified resource provider. - * - * @param resourceProviderNamespace The namespace of the resource provider. - * @param expand The $expand query parameter. For example, to include property aliases in response, use - * $expand=resourceTypes/aliases. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified resource provider. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceProviderNamespace, String expand, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceProviderNamespace == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter resourceProviderNamespace is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - expand, - resourceProviderNamespace, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets the specified resource provider. - * - * @param resourceProviderNamespace The namespace of the resource provider. - * @param expand The $expand query parameter. For example, to include property aliases in response, use - * $expand=resourceTypes/aliases. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified resource provider. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync(String resourceProviderNamespace, String expand) { - return getWithResponseAsync(resourceProviderNamespace, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the specified resource provider. - * - * @param resourceProviderNamespace The namespace of the resource provider. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified resource provider. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync(String resourceProviderNamespace) { - final String expand = null; - return getWithResponseAsync(resourceProviderNamespace, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the specified resource provider. - * - * @param resourceProviderNamespace The namespace of the resource provider. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified resource provider. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ProviderInner get(String resourceProviderNamespace) { - final String expand = null; - return getAsync(resourceProviderNamespace, expand).block(); - } - - /** - * Gets the specified resource provider. - * - * @param resourceProviderNamespace The namespace of the resource provider. - * @param expand The $expand query parameter. For example, to include property aliases in response, use - * $expand=resourceTypes/aliases. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified resource provider. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceProviderNamespace, String expand, Context context) { - return getWithResponseAsync(resourceProviderNamespace, expand, context).block(); - } - - /** - * Gets the specified resource provider at the tenant level. - * - * @param resourceProviderNamespace The namespace of the resource provider. - * @param expand The $expand query parameter. For example, to include property aliases in response, use - * $expand=resourceTypes/aliases. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified resource provider at the tenant level. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getAtTenantScopeWithResponseAsync( - String resourceProviderNamespace, String expand) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceProviderNamespace == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter resourceProviderNamespace is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getAtTenantScope( - this.client.getEndpoint(), - expand, - resourceProviderNamespace, - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the specified resource provider at the tenant level. - * - * @param resourceProviderNamespace The namespace of the resource provider. - * @param expand The $expand query parameter. For example, to include property aliases in response, use - * $expand=resourceTypes/aliases. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified resource provider at the tenant level. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getAtTenantScopeWithResponseAsync( - String resourceProviderNamespace, String expand, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceProviderNamespace == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter resourceProviderNamespace is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getAtTenantScope( - this.client.getEndpoint(), - expand, - resourceProviderNamespace, - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets the specified resource provider at the tenant level. - * - * @param resourceProviderNamespace The namespace of the resource provider. - * @param expand The $expand query parameter. For example, to include property aliases in response, use - * $expand=resourceTypes/aliases. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified resource provider at the tenant level. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAtTenantScopeAsync(String resourceProviderNamespace, String expand) { - return getAtTenantScopeWithResponseAsync(resourceProviderNamespace, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the specified resource provider at the tenant level. - * - * @param resourceProviderNamespace The namespace of the resource provider. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified resource provider at the tenant level. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAtTenantScopeAsync(String resourceProviderNamespace) { - final String expand = null; - return getAtTenantScopeWithResponseAsync(resourceProviderNamespace, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the specified resource provider at the tenant level. - * - * @param resourceProviderNamespace The namespace of the resource provider. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified resource provider at the tenant level. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ProviderInner getAtTenantScope(String resourceProviderNamespace) { - final String expand = null; - return getAtTenantScopeAsync(resourceProviderNamespace, expand).block(); - } - - /** - * Gets the specified resource provider at the tenant level. - * - * @param resourceProviderNamespace The namespace of the resource provider. - * @param expand The $expand query parameter. For example, to include property aliases in response, use - * $expand=resourceTypes/aliases. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified resource provider at the tenant level. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getAtTenantScopeWithResponse( - String resourceProviderNamespace, String expand, Context context) { - return getAtTenantScopeWithResponseAsync(resourceProviderNamespace, expand, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of resource providers. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of resource providers. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of resource providers. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAtTenantScopeNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listAtTenantScopeNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of resource providers. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAtTenantScopeNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listAtTenantScopeNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ProvidersImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ProvidersImpl.java deleted file mode 100644 index 20e9d74a393e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ProvidersImpl.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.resources.models.Provider; -import com.azure.resourcemanager.resources.models.Providers; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.ReadableWrappersImpl; -import com.azure.resourcemanager.resources.fluent.models.ProviderInner; -import com.azure.resourcemanager.resources.fluent.ProvidersClient; -import reactor.core.publisher.Mono; -import com.azure.resourcemanager.resources.fluentcore.utils.PagedConverter; - -/** - * The implementation for {@link Providers}. - */ -public final class ProvidersImpl - extends ReadableWrappersImpl - implements Providers { - private final ProvidersClient client; - - public ProvidersImpl(final ProvidersClient client) { - this.client = client; - } - - @Override - public PagedIterable list() { - return wrapList(client.list()); - } - - @Override - public Provider unregister(String resourceProviderNamespace) { - return this.unregisterAsync(resourceProviderNamespace).block(); - } - - @Override - public Mono unregisterAsync(String resourceProviderNamespace) { - return client.unregisterAsync(resourceProviderNamespace).map(providerInner -> wrapModel(providerInner)); - } - - @Override - public Provider register(String resourceProviderNamespace) { - return this.registerAsync(resourceProviderNamespace).block(); - } - - @Override - public Mono registerAsync(String resourceProviderNamespace) { - return client.registerAsync(resourceProviderNamespace).map(providerInner -> wrapModel(providerInner)); - } - - @Override - public Mono getByNameAsync(String name) { - return client.getAsync(name).map(providerInner -> wrapModel(providerInner)); - } - - @Override - public Provider getByName(String resourceProviderNamespace) { - return wrapModel(client.get(resourceProviderNamespace)); - } - - @Override - public PagedFlux listAsync() { - return PagedConverter.mapPage(this.client.listAsync(), inner -> wrapModel(inner)); - } - - @Override - protected ProviderImpl wrapModel(ProviderInner inner) { - if (inner == null) { - return null; - } - return new ProviderImpl(inner); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ResourceGroupExportResultImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ResourceGroupExportResultImpl.java deleted file mode 100644 index 2b13476ddd98..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ResourceGroupExportResultImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.implementation; - -import com.azure.core.management.exception.ManagementError; -import com.azure.resourcemanager.resources.models.DeploymentExportResult; -import com.azure.resourcemanager.resources.models.ResourceGroupExportResult; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.WrapperImpl; -import com.azure.resourcemanager.resources.fluent.models.ResourceGroupExportResultInner; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; - -/** - * Implementation for {@link DeploymentExportResult}. - */ -final class ResourceGroupExportResultImpl extends - WrapperImpl - implements - ResourceGroupExportResult { - - private ObjectMapper mapper; - - ResourceGroupExportResultImpl(ResourceGroupExportResultInner innerModel) { - super(innerModel); - mapper = new ObjectMapper(); - } - - @Override - public Object template() { - return innerModel().template(); - } - - @Override - public String templateJson() { - try { - return mapper.writeValueAsString(template()); - } catch (JsonProcessingException e) { - return null; - } - } - - @Override - public ManagementError error() { - return innerModel().error(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ResourceGroupImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ResourceGroupImpl.java deleted file mode 100644 index 6d03cd6dddea..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ResourceGroupImpl.java +++ /dev/null @@ -1,143 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.implementation; - -import com.azure.resourcemanager.resources.models.ExportTemplateRequest; -import com.azure.resourcemanager.resources.models.ResourceGroup; -import com.azure.resourcemanager.resources.models.ResourceGroupExportResult; -import com.azure.resourcemanager.resources.models.ResourceGroupExportTemplateOptions; -import com.azure.core.management.Region; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.CreatableUpdatableImpl; -import com.azure.resourcemanager.resources.fluent.models.ResourceGroupInner; -import com.azure.resourcemanager.resources.fluent.ResourceGroupsClient; -import com.azure.resourcemanager.resources.fluent.ResourceManagementClient; -import reactor.core.publisher.Mono; - -import java.util.Arrays; -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; - -/** - * The implementation for {@link ResourceGroup} and its create and update interfaces. - */ -class ResourceGroupImpl extends - CreatableUpdatableImpl - implements - ResourceGroup, - ResourceGroup.Definition, - ResourceGroup.Update { - - private final ResourceGroupsClient client; - - protected ResourceGroupImpl(final ResourceGroupInner innerModel, String name, - final ResourceManagementClient serviceClient) { - super(name, innerModel); - this.client = serviceClient.getResourceGroups(); - } - - @Override - public String provisioningState() { - return this.innerModel().properties().provisioningState(); - } - - @Override - public String regionName() { - return this.innerModel().location(); - } - - @Override - public Region region() { - return Region.fromName(this.regionName()); - } - - @Override - public String id() { - return this.innerModel().id(); - } - - @Override - public String type() { - return null; - } - - @Override - public Map tags() { - Map tags = this.innerModel().tags(); - if (tags == null) { - tags = new HashMap<>(); - } - return Collections.unmodifiableMap(tags); - } - - @Override - public ResourceGroupExportResult exportTemplate(ResourceGroupExportTemplateOptions options) { - return this.exportTemplateAsync(options).block(); - } - - @Override - public Mono exportTemplateAsync(ResourceGroupExportTemplateOptions options) { - ExportTemplateRequest inner = new ExportTemplateRequest() - .withResources(Arrays.asList("*")) - .withOptions(options.toString()); - return client.exportTemplateAsync(name(), inner).map(resourceGroupExportResultInner -> - new ResourceGroupExportResultImpl(resourceGroupExportResultInner)); - } - - @Override - public ResourceGroupImpl withRegion(String regionName) { - this.innerModel().withLocation(regionName); - return this; - } - - @Override - public ResourceGroupImpl withRegion(Region region) { - return this.withRegion(region.toString()); - } - - @Override - public ResourceGroupImpl withTags(Map tags) { - this.innerModel().withTags(new HashMap<>(tags)); - return this; - } - - @Override - public ResourceGroupImpl withTag(String key, String value) { - if (this.innerModel().tags() == null) { - this.innerModel().withTags(new HashMap()); - } - this.innerModel().tags().put(key, value); - return this; - } - - @Override - public ResourceGroupImpl withoutTag(String key) { - this.innerModel().tags().remove(key); - return this; - } - - @Override - public Mono createResourceAsync() { - ResourceGroupInner params = new ResourceGroupInner(); - params.withLocation(this.innerModel().location()); - params.withTags(this.innerModel().tags()); - return client.createOrUpdateAsync(this.name(), params) - .map(innerToFluentMap(this)); - } - - @Override - public Mono updateResourceAsync() { - return createResourceAsync(); - } - - @Override - public boolean isInCreateMode() { - return this.innerModel().id() == null; - } - - @Override - protected Mono getInnerAsync() { - return client.getAsync(this.key); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ResourceGroupsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ResourceGroupsClientImpl.java deleted file mode 100644 index 31f8b1129caf..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ResourceGroupsClientImpl.java +++ /dev/null @@ -1,1478 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.Head; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.resources.fluent.ResourceGroupsClient; -import com.azure.resourcemanager.resources.fluent.models.ResourceGroupExportResultInner; -import com.azure.resourcemanager.resources.fluent.models.ResourceGroupInner; -import com.azure.resourcemanager.resources.models.ExportTemplateRequest; -import com.azure.resourcemanager.resources.models.ResourceGroupListResult; -import com.azure.resourcemanager.resources.models.ResourceGroupPatchable; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ResourceGroupsClient. */ -public final class ResourceGroupsClientImpl implements ResourceGroupsClient { - private final ClientLogger logger = new ClientLogger(ResourceGroupsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final ResourceGroupsService service; - - /** The service client containing this operation class. */ - private final ResourceManagementClientImpl client; - - /** - * Initializes an instance of ResourceGroupsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ResourceGroupsClientImpl(ResourceManagementClientImpl client) { - this.service = - RestProxy.create(ResourceGroupsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for ResourceManagementClientResourceGroups to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "ResourceManagementCl") - private interface ResourceGroupsService { - @Headers({"Content-Type: application/json"}) - @Head("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}") - @ExpectedResponses({204, 404}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> checkExistence( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") ResourceGroupInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") ResourceGroupPatchable parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/exportTemplate") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> exportTemplate( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ExportTemplateRequest parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/resourcegroups") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("$filter") String filter, - @QueryParam("$top") Integer top, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Checks whether a resource group exists. - * - * @param resourceGroupName The name of the resource group to check. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> checkExistenceWithResponseAsync(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .checkExistence( - this.client.getEndpoint(), - resourceGroupName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Checks whether a resource group exists. - * - * @param resourceGroupName The name of the resource group to check. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> checkExistenceWithResponseAsync(String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .checkExistence( - this.client.getEndpoint(), - resourceGroupName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Checks whether a resource group exists. - * - * @param resourceGroupName The name of the resource group to check. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono checkExistenceAsync(String resourceGroupName) { - return checkExistenceWithResponseAsync(resourceGroupName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Checks whether a resource group exists. - * - * @param resourceGroupName The name of the resource group to check. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public boolean checkExistence(String resourceGroupName) { - Boolean value = checkExistenceAsync(resourceGroupName).block(); - if (value != null) { - return value; - } else { - throw logger.logExceptionAsError(new NullPointerException()); - } - } - - /** - * Checks whether a resource group exists. - * - * @param resourceGroupName The name of the resource group to check. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response checkExistenceWithResponse(String resourceGroupName, Context context) { - return checkExistenceWithResponseAsync(resourceGroupName, context).block(); - } - - /** - * Creates or updates a resource group. - * - * @param resourceGroupName The name of the resource group to create or update. Can include alphanumeric, - * underscore, parentheses, hyphen, period (except at end), and Unicode characters that match the allowed - * characters. - * @param parameters Parameters supplied to the create or update a resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource group information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, ResourceGroupInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a resource group. - * - * @param resourceGroupName The name of the resource group to create or update. Can include alphanumeric, - * underscore, parentheses, hyphen, period (except at end), and Unicode characters that match the allowed - * characters. - * @param parameters Parameters supplied to the create or update a resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource group information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, ResourceGroupInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Creates or updates a resource group. - * - * @param resourceGroupName The name of the resource group to create or update. Can include alphanumeric, - * underscore, parentheses, hyphen, period (except at end), and Unicode characters that match the allowed - * characters. - * @param parameters Parameters supplied to the create or update a resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource group information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync(String resourceGroupName, ResourceGroupInner parameters) { - return createOrUpdateWithResponseAsync(resourceGroupName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates or updates a resource group. - * - * @param resourceGroupName The name of the resource group to create or update. Can include alphanumeric, - * underscore, parentheses, hyphen, period (except at end), and Unicode characters that match the allowed - * characters. - * @param parameters Parameters supplied to the create or update a resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource group information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResourceGroupInner createOrUpdate(String resourceGroupName, ResourceGroupInner parameters) { - return createOrUpdateAsync(resourceGroupName, parameters).block(); - } - - /** - * Creates or updates a resource group. - * - * @param resourceGroupName The name of the resource group to create or update. Can include alphanumeric, - * underscore, parentheses, hyphen, period (except at end), and Unicode characters that match the allowed - * characters. - * @param parameters Parameters supplied to the create or update a resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource group information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceGroupName, ResourceGroupInner parameters, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, parameters, context).block(); - } - - /** - * When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of - * its template deployments and currently stored operations. - * - * @param resourceGroupName The name of the resource group to delete. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of - * its template deployments and currently stored operations. - * - * @param resourceGroupName The name of the resource group to delete. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of - * its template deployments and currently stored operations. - * - * @param resourceGroupName The name of the resource group to delete. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAsync(String resourceGroupName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of - * its template deployments and currently stored operations. - * - * @param resourceGroupName The name of the resource group to delete. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(resourceGroupName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of - * its template deployments and currently stored operations. - * - * @param resourceGroupName The name of the resource group to delete. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete(String resourceGroupName) { - return beginDeleteAsync(resourceGroupName).getSyncPoller(); - } - - /** - * When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of - * its template deployments and currently stored operations. - * - * @param resourceGroupName The name of the resource group to delete. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete(String resourceGroupName, Context context) { - return beginDeleteAsync(resourceGroupName, context).getSyncPoller(); - } - - /** - * When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of - * its template deployments and currently stored operations. - * - * @param resourceGroupName The name of the resource group to delete. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName) { - return beginDeleteAsync(resourceGroupName).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of - * its template deployments and currently stored operations. - * - * @param resourceGroupName The name of the resource group to delete. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, Context context) { - return beginDeleteAsync(resourceGroupName, context).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of - * its template deployments and currently stored operations. - * - * @param resourceGroupName The name of the resource group to delete. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName) { - deleteAsync(resourceGroupName).block(); - } - - /** - * When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of - * its template deployments and currently stored operations. - * - * @param resourceGroupName The name of the resource group to delete. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, Context context) { - deleteAsync(resourceGroupName, context).block(); - } - - /** - * Gets a resource group. - * - * @param resourceGroupName The name of the resource group to get. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - resourceGroupName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a resource group. - * - * @param resourceGroupName The name of the resource group to get. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - resourceGroupName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets a resource group. - * - * @param resourceGroupName The name of the resource group to get. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync(String resourceGroupName) { - return getWithResponseAsync(resourceGroupName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a resource group. - * - * @param resourceGroupName The name of the resource group to get. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResourceGroupInner get(String resourceGroupName) { - return getAsync(resourceGroupName).block(); - } - - /** - * Gets a resource group. - * - * @param resourceGroupName The name of the resource group to get. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, Context context) { - return getWithResponseAsync(resourceGroupName, context).block(); - } - - /** - * Resource groups can be updated through a simple PATCH operation to a group address. The format of the request is - * the same as that for creating a resource group. If a field is unspecified, the current value is retained. - * - * @param resourceGroupName The name of the resource group to update. The name is case insensitive. - * @param parameters Parameters supplied to update a resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource group information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateWithResponseAsync( - String resourceGroupName, ResourceGroupPatchable parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - resourceGroupName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Resource groups can be updated through a simple PATCH operation to a group address. The format of the request is - * the same as that for creating a resource group. If a field is unspecified, the current value is retained. - * - * @param resourceGroupName The name of the resource group to update. The name is case insensitive. - * @param parameters Parameters supplied to update a resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource group information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, ResourceGroupPatchable parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - resourceGroupName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Resource groups can be updated through a simple PATCH operation to a group address. The format of the request is - * the same as that for creating a resource group. If a field is unspecified, the current value is retained. - * - * @param resourceGroupName The name of the resource group to update. The name is case insensitive. - * @param parameters Parameters supplied to update a resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource group information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync(String resourceGroupName, ResourceGroupPatchable parameters) { - return updateWithResponseAsync(resourceGroupName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Resource groups can be updated through a simple PATCH operation to a group address. The format of the request is - * the same as that for creating a resource group. If a field is unspecified, the current value is retained. - * - * @param resourceGroupName The name of the resource group to update. The name is case insensitive. - * @param parameters Parameters supplied to update a resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource group information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResourceGroupInner update(String resourceGroupName, ResourceGroupPatchable parameters) { - return updateAsync(resourceGroupName, parameters).block(); - } - - /** - * Resource groups can be updated through a simple PATCH operation to a group address. The format of the request is - * the same as that for creating a resource group. If a field is unspecified, the current value is retained. - * - * @param resourceGroupName The name of the resource group to update. The name is case insensitive. - * @param parameters Parameters supplied to update a resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource group information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, ResourceGroupPatchable parameters, Context context) { - return updateWithResponseAsync(resourceGroupName, parameters, context).block(); - } - - /** - * Captures the specified resource group as a template. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters Parameters for exporting the template. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource group export result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> exportTemplateWithResponseAsync( - String resourceGroupName, ExportTemplateRequest parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .exportTemplate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - this.client.getApiVersion(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Captures the specified resource group as a template. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters Parameters for exporting the template. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource group export result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> exportTemplateWithResponseAsync( - String resourceGroupName, ExportTemplateRequest parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .exportTemplate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - this.client.getApiVersion(), - parameters, - accept, - context); - } - - /** - * Captures the specified resource group as a template. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters Parameters for exporting the template. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource group export result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, ResourceGroupExportResultInner> - beginExportTemplateAsync(String resourceGroupName, ExportTemplateRequest parameters) { - Mono>> mono = exportTemplateWithResponseAsync(resourceGroupName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ResourceGroupExportResultInner.class, - ResourceGroupExportResultInner.class, - Context.NONE); - } - - /** - * Captures the specified resource group as a template. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters Parameters for exporting the template. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource group export result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, ResourceGroupExportResultInner> - beginExportTemplateAsync(String resourceGroupName, ExportTemplateRequest parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = exportTemplateWithResponseAsync(resourceGroupName, parameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ResourceGroupExportResultInner.class, - ResourceGroupExportResultInner.class, - context); - } - - /** - * Captures the specified resource group as a template. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters Parameters for exporting the template. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource group export result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, ResourceGroupExportResultInner> beginExportTemplate( - String resourceGroupName, ExportTemplateRequest parameters) { - return beginExportTemplateAsync(resourceGroupName, parameters).getSyncPoller(); - } - - /** - * Captures the specified resource group as a template. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters Parameters for exporting the template. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource group export result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, ResourceGroupExportResultInner> beginExportTemplate( - String resourceGroupName, ExportTemplateRequest parameters, Context context) { - return beginExportTemplateAsync(resourceGroupName, parameters, context).getSyncPoller(); - } - - /** - * Captures the specified resource group as a template. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters Parameters for exporting the template. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource group export result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono exportTemplateAsync( - String resourceGroupName, ExportTemplateRequest parameters) { - return beginExportTemplateAsync(resourceGroupName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Captures the specified resource group as a template. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters Parameters for exporting the template. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource group export result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono exportTemplateAsync( - String resourceGroupName, ExportTemplateRequest parameters, Context context) { - return beginExportTemplateAsync(resourceGroupName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Captures the specified resource group as a template. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters Parameters for exporting the template. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource group export result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResourceGroupExportResultInner exportTemplate(String resourceGroupName, ExportTemplateRequest parameters) { - return exportTemplateAsync(resourceGroupName, parameters).block(); - } - - /** - * Captures the specified resource group as a template. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters Parameters for exporting the template. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource group export result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResourceGroupExportResultInner exportTemplate( - String resourceGroupName, ExportTemplateRequest parameters, Context context) { - return exportTemplateAsync(resourceGroupName, parameters, context).block(); - } - - /** - * Gets all the resource groups for a subscription. - * - * @param filter The filter to apply on the operation.<br><br>You can filter by tag names and values. - * For example, to filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'. - * @param top The number of results to return. If null is passed, returns all resource groups. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the resource groups for a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String filter, Integer top) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - filter, - top, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all the resource groups for a subscription. - * - * @param filter The filter to apply on the operation.<br><br>You can filter by tag names and values. - * For example, to filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'. - * @param top The number of results to return. If null is passed, returns all resource groups. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the resource groups for a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String filter, Integer top, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - filter, - top, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all the resource groups for a subscription. - * - * @param filter The filter to apply on the operation.<br><br>You can filter by tag names and values. - * For example, to filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'. - * @param top The number of results to return. If null is passed, returns all resource groups. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the resource groups for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String filter, Integer top) { - return new PagedFlux<>(() -> listSinglePageAsync(filter, top), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets all the resource groups for a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the resource groups for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - final String filter = null; - final Integer top = null; - return new PagedFlux<>(() -> listSinglePageAsync(filter, top), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets all the resource groups for a subscription. - * - * @param filter The filter to apply on the operation.<br><br>You can filter by tag names and values. - * For example, to filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'. - * @param top The number of results to return. If null is passed, returns all resource groups. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the resource groups for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String filter, Integer top, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(filter, top, context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all the resource groups for a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the resource groups for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - final String filter = null; - final Integer top = null; - return new PagedIterable<>(listAsync(filter, top)); - } - - /** - * Gets all the resource groups for a subscription. - * - * @param filter The filter to apply on the operation.<br><br>You can filter by tag names and values. - * For example, to filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'. - * @param top The number of results to return. If null is passed, returns all resource groups. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the resource groups for a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String filter, Integer top, Context context) { - return new PagedIterable<>(listAsync(filter, top, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of resource groups. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of resource groups. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ResourceGroupsImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ResourceGroupsImpl.java deleted file mode 100644 index bda33c3e05f7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ResourceGroupsImpl.java +++ /dev/null @@ -1,131 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.resources.fluentcore.model.Accepted; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.AcceptedImpl; -import com.azure.resourcemanager.resources.ResourceManager; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import com.azure.resourcemanager.resources.models.ResourceGroup; -import com.azure.resourcemanager.resources.models.ResourceGroups; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.CreatableResourcesImpl; -import com.azure.resourcemanager.resources.fluent.models.ResourceGroupInner; -import reactor.core.publisher.Mono; - -import java.util.function.Function; -import com.azure.resourcemanager.resources.fluentcore.utils.PagedConverter; - -/** - * The implementation for ResourceGroups. - */ -public final class ResourceGroupsImpl - extends CreatableResourcesImpl - implements ResourceGroups { - - private final ClientLogger logger = new ClientLogger(ResourceGroupsImpl.class); - - private final ResourceManager resourceManager; - - public ResourceGroupsImpl(final ResourceManager resourceManager) { - this.resourceManager = resourceManager; - } - - @Override - public PagedIterable list() { - return wrapList(manager().serviceClient().getResourceGroups().list()); - } - - @Override - public PagedIterable listByTag(String tagName, String tagValue) { - return new PagedIterable<>(this.listByTagAsync(tagName, tagValue)); - } - - @Override - public PagedFlux listByTagAsync(String tagName, String tagValue) { - return wrapPageAsync(manager().serviceClient().getResourceGroups() - .listAsync(ResourceManagerUtils.createOdataFilterForTags(tagName, tagValue), null)); - } - - @Override - public ResourceGroupImpl getByName(String name) { - return wrapModel(manager().serviceClient().getResourceGroups().get(name)); - } - - @Override - public Mono getByNameAsync(String name) { - return manager().serviceClient().getResourceGroups().getAsync(name).map(this::wrapModel); - } - - @Override - public void deleteByName(String name) { - deleteByNameAsync(name).block(); - } - - @Override - public Mono deleteByNameAsync(String name) { - return manager().serviceClient().getResourceGroups().deleteAsync(name); - } - - @Override - public ResourceGroupImpl define(String name) { - return wrapModel(name); - } - - @Override - public boolean contain(String name) { - return manager().serviceClient().getResourceGroups().checkExistence(name); - } - - @Override - protected ResourceGroupImpl wrapModel(String name) { - return new ResourceGroupImpl(new ResourceGroupInner(), name, manager().serviceClient()); - } - - @Override - protected ResourceGroupImpl wrapModel(ResourceGroupInner inner) { - if (inner == null) { - return null; - } - return new ResourceGroupImpl(inner, inner.name(), manager().serviceClient()); - } - - @Override - public Accepted beginDeleteByName(String name) { - return AcceptedImpl.newAccepted(logger, - this.manager().serviceClient().getHttpPipeline(), - this.manager().serviceClient().getDefaultPollInterval(), - () -> this.manager().serviceClient().getResourceGroups() - .deleteWithResponseAsync(name).block(), - Function.identity(), - Void.class, - null, - Context.NONE); - } - -// @Override -// public Mono beginDeleteByNameAsync(String name) { -// // DELETE -// return client.beginDeleteWithoutPollingAsync(name); -// } - - @Override - public Mono deleteByIdAsync(String id) { - return deleteByNameAsync(ResourceUtils.nameFromResourceId(id)); - } - - @Override - public PagedFlux listAsync() { - return PagedConverter.mapPage(this.manager().serviceClient().getResourceGroups().listAsync(), inner -> wrapModel(inner)); - } - - @Override - public ResourceManager manager() { - return resourceManager; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ResourceManagementClientBuilder.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ResourceManagementClientBuilder.java deleted file mode 100644 index 69b84618c1cf..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ResourceManagementClientBuilder.java +++ /dev/null @@ -1,146 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.implementation; - -import com.azure.core.annotation.ServiceClientBuilder; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.policy.CookiePolicy; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerAdapter; -import java.time.Duration; - -/** A builder for creating a new instance of the ResourceManagementClientImpl type. */ -@ServiceClientBuilder(serviceClients = {ResourceManagementClientImpl.class}) -public final class ResourceManagementClientBuilder { - /* - * The ID of the target subscription. - */ - private String subscriptionId; - - /** - * Sets The ID of the target subscription. - * - * @param subscriptionId the subscriptionId value. - * @return the ResourceManagementClientBuilder. - */ - public ResourceManagementClientBuilder subscriptionId(String subscriptionId) { - this.subscriptionId = subscriptionId; - return this; - } - - /* - * server parameter - */ - private String endpoint; - - /** - * Sets server parameter. - * - * @param endpoint the endpoint value. - * @return the ResourceManagementClientBuilder. - */ - public ResourceManagementClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * The environment to connect to - */ - private AzureEnvironment environment; - - /** - * Sets The environment to connect to. - * - * @param environment the environment value. - * @return the ResourceManagementClientBuilder. - */ - public ResourceManagementClientBuilder environment(AzureEnvironment environment) { - this.environment = environment; - return this; - } - - /* - * The default poll interval for long-running operation - */ - private Duration defaultPollInterval; - - /** - * Sets The default poll interval for long-running operation. - * - * @param defaultPollInterval the defaultPollInterval value. - * @return the ResourceManagementClientBuilder. - */ - public ResourceManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = defaultPollInterval; - return this; - } - - /* - * The HTTP pipeline to send requests through - */ - private HttpPipeline pipeline; - - /** - * Sets The HTTP pipeline to send requests through. - * - * @param pipeline the pipeline value. - * @return the ResourceManagementClientBuilder. - */ - public ResourceManagementClientBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; - return this; - } - - /* - * The serializer to serialize an object into a string - */ - private SerializerAdapter serializerAdapter; - - /** - * Sets The serializer to serialize an object into a string. - * - * @param serializerAdapter the serializerAdapter value. - * @return the ResourceManagementClientBuilder. - */ - public ResourceManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { - this.serializerAdapter = serializerAdapter; - return this; - } - - /** - * Builds an instance of ResourceManagementClientImpl with the provided parameters. - * - * @return an instance of ResourceManagementClientImpl. - */ - public ResourceManagementClientImpl buildClient() { - if (endpoint == null) { - this.endpoint = "https://management.azure.com"; - } - if (environment == null) { - this.environment = AzureEnvironment.AZURE; - } - if (defaultPollInterval == null) { - this.defaultPollInterval = Duration.ofSeconds(30); - } - if (pipeline == null) { - this.pipeline = - new HttpPipelineBuilder() - .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) - .build(); - } - if (serializerAdapter == null) { - this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); - } - ResourceManagementClientImpl client = - new ResourceManagementClientImpl( - pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); - return client; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ResourceManagementClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ResourceManagementClientImpl.java deleted file mode 100644 index 7af0106e671a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ResourceManagementClientImpl.java +++ /dev/null @@ -1,216 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.implementation; - -import com.azure.core.annotation.ServiceClient; -import com.azure.core.http.HttpPipeline; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.serializer.SerializerAdapter; -import com.azure.resourcemanager.resources.fluent.DeploymentOperationsClient; -import com.azure.resourcemanager.resources.fluent.DeploymentsClient; -import com.azure.resourcemanager.resources.fluent.OperationsClient; -import com.azure.resourcemanager.resources.fluent.ProvidersClient; -import com.azure.resourcemanager.resources.fluent.ResourceGroupsClient; -import com.azure.resourcemanager.resources.fluent.ResourceManagementClient; -import com.azure.resourcemanager.resources.fluent.ResourcesClient; -import com.azure.resourcemanager.resources.fluent.TagOperationsClient; -import com.azure.resourcemanager.resources.fluentcore.AzureServiceClient; -import java.time.Duration; - -/** Initializes a new instance of the ResourceManagementClientImpl type. */ -@ServiceClient(builder = ResourceManagementClientBuilder.class) -public final class ResourceManagementClientImpl extends AzureServiceClient implements ResourceManagementClient { - private final ClientLogger logger = new ClientLogger(ResourceManagementClientImpl.class); - - /** The ID of the target subscription. */ - private final String subscriptionId; - - /** - * Gets The ID of the target subscription. - * - * @return the subscriptionId value. - */ - public String getSubscriptionId() { - return this.subscriptionId; - } - - /** server parameter. */ - private final String endpoint; - - /** - * Gets server parameter. - * - * @return the endpoint value. - */ - public String getEndpoint() { - return this.endpoint; - } - - /** Api Version. */ - private final String apiVersion; - - /** - * Gets Api Version. - * - * @return the apiVersion value. - */ - public String getApiVersion() { - return this.apiVersion; - } - - /** The HTTP pipeline to send requests through. */ - private final HttpPipeline httpPipeline; - - /** - * Gets The HTTP pipeline to send requests through. - * - * @return the httpPipeline value. - */ - public HttpPipeline getHttpPipeline() { - return this.httpPipeline; - } - - /** The serializer to serialize an object into a string. */ - private final SerializerAdapter serializerAdapter; - - /** - * Gets The serializer to serialize an object into a string. - * - * @return the serializerAdapter value. - */ - SerializerAdapter getSerializerAdapter() { - return this.serializerAdapter; - } - - /** The default poll interval for long-running operation. */ - private final Duration defaultPollInterval; - - /** - * Gets The default poll interval for long-running operation. - * - * @return the defaultPollInterval value. - */ - public Duration getDefaultPollInterval() { - return this.defaultPollInterval; - } - - /** The OperationsClient object to access its operations. */ - private final OperationsClient operations; - - /** - * Gets the OperationsClient object to access its operations. - * - * @return the OperationsClient object. - */ - public OperationsClient getOperations() { - return this.operations; - } - - /** The DeploymentsClient object to access its operations. */ - private final DeploymentsClient deployments; - - /** - * Gets the DeploymentsClient object to access its operations. - * - * @return the DeploymentsClient object. - */ - public DeploymentsClient getDeployments() { - return this.deployments; - } - - /** The ProvidersClient object to access its operations. */ - private final ProvidersClient providers; - - /** - * Gets the ProvidersClient object to access its operations. - * - * @return the ProvidersClient object. - */ - public ProvidersClient getProviders() { - return this.providers; - } - - /** The ResourcesClient object to access its operations. */ - private final ResourcesClient resources; - - /** - * Gets the ResourcesClient object to access its operations. - * - * @return the ResourcesClient object. - */ - public ResourcesClient getResources() { - return this.resources; - } - - /** The ResourceGroupsClient object to access its operations. */ - private final ResourceGroupsClient resourceGroups; - - /** - * Gets the ResourceGroupsClient object to access its operations. - * - * @return the ResourceGroupsClient object. - */ - public ResourceGroupsClient getResourceGroups() { - return this.resourceGroups; - } - - /** The TagOperationsClient object to access its operations. */ - private final TagOperationsClient tagOperations; - - /** - * Gets the TagOperationsClient object to access its operations. - * - * @return the TagOperationsClient object. - */ - public TagOperationsClient getTagOperations() { - return this.tagOperations; - } - - /** The DeploymentOperationsClient object to access its operations. */ - private final DeploymentOperationsClient deploymentOperations; - - /** - * Gets the DeploymentOperationsClient object to access its operations. - * - * @return the DeploymentOperationsClient object. - */ - public DeploymentOperationsClient getDeploymentOperations() { - return this.deploymentOperations; - } - - /** - * Initializes an instance of ResourceManagementClient client. - * - * @param httpPipeline The HTTP pipeline to send requests through. - * @param serializerAdapter The serializer to serialize an object into a string. - * @param defaultPollInterval The default poll interval for long-running operation. - * @param environment The Azure environment. - * @param subscriptionId The ID of the target subscription. - * @param endpoint server parameter. - */ - ResourceManagementClientImpl( - HttpPipeline httpPipeline, - SerializerAdapter serializerAdapter, - Duration defaultPollInterval, - AzureEnvironment environment, - String subscriptionId, - String endpoint) { - super(httpPipeline, serializerAdapter, environment); - this.httpPipeline = httpPipeline; - this.serializerAdapter = serializerAdapter; - this.defaultPollInterval = defaultPollInterval; - this.subscriptionId = subscriptionId; - this.endpoint = endpoint; - this.apiVersion = "2019-10-01"; - this.operations = new OperationsClientImpl(this); - this.deployments = new DeploymentsClientImpl(this); - this.providers = new ProvidersClientImpl(this); - this.resources = new ResourcesClientImpl(this); - this.resourceGroups = new ResourceGroupsClientImpl(this); - this.tagOperations = new TagOperationsClientImpl(this); - this.deploymentOperations = new DeploymentOperationsClientImpl(this); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ResourceNamesClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ResourceNamesClientImpl.java deleted file mode 100644 index a8fb2c327e42..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ResourceNamesClientImpl.java +++ /dev/null @@ -1,217 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.resources.fluent.ResourceNamesClient; -import com.azure.resourcemanager.resources.fluent.models.CheckResourceNameResultInner; -import com.azure.resourcemanager.resources.models.ResourceName; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ResourceNamesClient. */ -public final class ResourceNamesClientImpl implements ResourceNamesClient { - private final ClientLogger logger = new ClientLogger(ResourceNamesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final ResourceNamesService service; - - /** The service client containing this operation class. */ - private final SubscriptionClientImpl client; - - /** - * Initializes an instance of ResourceNamesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ResourceNamesClientImpl(SubscriptionClientImpl client) { - this.service = - RestProxy.create(ResourceNamesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SubscriptionClientResourceNames to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SubscriptionClientRe") - private interface ResourceNamesService { - @Headers({"Content-Type: application/json"}) - @Post("/providers/Microsoft.Resources/checkResourceName") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> checkResourceName( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ResourceName resourceNameDefinition, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * A resource name is valid if it is not a reserved word, does not contains a reserved word and does not start with - * a reserved word. - * - * @param resourceNameDefinition Resource object with values for resource name and resource type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource Name valid if not a reserved word, does not contain a reserved word and does not start with a - * reserved word. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> checkResourceNameWithResponseAsync( - ResourceName resourceNameDefinition) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceNameDefinition != null) { - resourceNameDefinition.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .checkResourceName( - this.client.getEndpoint(), - this.client.getApiVersion(), - resourceNameDefinition, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * A resource name is valid if it is not a reserved word, does not contains a reserved word and does not start with - * a reserved word. - * - * @param resourceNameDefinition Resource object with values for resource name and resource type. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource Name valid if not a reserved word, does not contain a reserved word and does not start with a - * reserved word. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> checkResourceNameWithResponseAsync( - ResourceName resourceNameDefinition, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceNameDefinition != null) { - resourceNameDefinition.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .checkResourceName( - this.client.getEndpoint(), this.client.getApiVersion(), resourceNameDefinition, accept, context); - } - - /** - * A resource name is valid if it is not a reserved word, does not contains a reserved word and does not start with - * a reserved word. - * - * @param resourceNameDefinition Resource object with values for resource name and resource type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource Name valid if not a reserved word, does not contain a reserved word and does not start with a - * reserved word. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono checkResourceNameAsync(ResourceName resourceNameDefinition) { - return checkResourceNameWithResponseAsync(resourceNameDefinition) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * A resource name is valid if it is not a reserved word, does not contains a reserved word and does not start with - * a reserved word. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource Name valid if not a reserved word, does not contain a reserved word and does not start with a - * reserved word. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono checkResourceNameAsync() { - final ResourceName resourceNameDefinition = null; - return checkResourceNameWithResponseAsync(resourceNameDefinition) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * A resource name is valid if it is not a reserved word, does not contains a reserved word and does not start with - * a reserved word. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource Name valid if not a reserved word, does not contain a reserved word and does not start with a - * reserved word. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CheckResourceNameResultInner checkResourceName() { - final ResourceName resourceNameDefinition = null; - return checkResourceNameAsync(resourceNameDefinition).block(); - } - - /** - * A resource name is valid if it is not a reserved word, does not contains a reserved word and does not start with - * a reserved word. - * - * @param resourceNameDefinition Resource object with values for resource name and resource type. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource Name valid if not a reserved word, does not contain a reserved word and does not start with a - * reserved word. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response checkResourceNameWithResponse( - ResourceName resourceNameDefinition, Context context) { - return checkResourceNameWithResponseAsync(resourceNameDefinition, context).block(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ResourcesClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ResourcesClientImpl.java deleted file mode 100644 index 81507fcd55a6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ResourcesClientImpl.java +++ /dev/null @@ -1,4411 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.Head; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.resources.fluent.ResourcesClient; -import com.azure.resourcemanager.resources.fluent.models.GenericResourceExpandedInner; -import com.azure.resourcemanager.resources.fluent.models.GenericResourceInner; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import com.azure.resourcemanager.resources.models.ResourceListResult; -import com.azure.resourcemanager.resources.models.ResourcesMoveInfo; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ResourcesClient. */ -public final class ResourcesClientImpl implements InnerSupportsListing, ResourcesClient { - private final ClientLogger logger = new ClientLogger(ResourcesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final ResourcesService service; - - /** The service client containing this operation class. */ - private final ResourceManagementClientImpl client; - - /** - * Initializes an instance of ResourcesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ResourcesClientImpl(ResourceManagementClientImpl client) { - this.service = - RestProxy.create(ResourcesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for ResourceManagementClientResources to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "ResourceManagementCl") - private interface ResourcesService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/resources") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("$filter") String filter, - @QueryParam("$expand") String expand, - @QueryParam("$top") Integer top, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{sourceResourceGroupName}/moveResources") - @ExpectedResponses({202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> moveResources( - @HostParam("$host") String endpoint, - @PathParam("sourceResourceGroupName") String sourceResourceGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") ResourcesMoveInfo parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{sourceResourceGroupName}/validateMoveResources") - @ExpectedResponses({202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> validateMoveResources( - @HostParam("$host") String endpoint, - @PathParam("sourceResourceGroupName") String sourceResourceGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") ResourcesMoveInfo parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/resources") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("$filter") String filter, - @QueryParam("$expand") String expand, - @QueryParam("$top") Integer top, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Head( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}" - + "/{parentResourcePath}/{resourceType}/{resourceName}") - @ExpectedResponses({204, 404}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> checkExistence( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("resourceProviderNamespace") String resourceProviderNamespace, - @PathParam(value = "parentResourcePath", encoded = true) String parentResourcePath, - @PathParam(value = "resourceType", encoded = true) String resourceType, - @PathParam("resourceName") String resourceName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}" - + "/{parentResourcePath}/{resourceType}/{resourceName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("resourceProviderNamespace") String resourceProviderNamespace, - @PathParam(value = "parentResourcePath", encoded = true) String parentResourcePath, - @PathParam(value = "resourceType", encoded = true) String resourceType, - @PathParam("resourceName") String resourceName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}" - + "/{parentResourcePath}/{resourceType}/{resourceName}") - @ExpectedResponses({200, 201, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("resourceProviderNamespace") String resourceProviderNamespace, - @PathParam(value = "parentResourcePath", encoded = true) String parentResourcePath, - @PathParam(value = "resourceType", encoded = true) String resourceType, - @PathParam("resourceName") String resourceName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") GenericResourceInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}" - + "/{parentResourcePath}/{resourceType}/{resourceName}") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("resourceProviderNamespace") String resourceProviderNamespace, - @PathParam(value = "parentResourcePath", encoded = true) String parentResourcePath, - @PathParam(value = "resourceType", encoded = true) String resourceType, - @PathParam("resourceName") String resourceName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") GenericResourceInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}" - + "/{parentResourcePath}/{resourceType}/{resourceName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("resourceProviderNamespace") String resourceProviderNamespace, - @PathParam(value = "parentResourcePath", encoded = true) String parentResourcePath, - @PathParam(value = "resourceType", encoded = true) String resourceType, - @PathParam("resourceName") String resourceName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Head("/{resourceId}") - @ExpectedResponses({204, 404}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> checkExistenceById( - @HostParam("$host") String endpoint, - @PathParam(value = "resourceId", encoded = true) String resourceId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete("/{resourceId}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> deleteById( - @HostParam("$host") String endpoint, - @PathParam(value = "resourceId", encoded = true) String resourceId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put("/{resourceId}") - @ExpectedResponses({200, 201, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdateById( - @HostParam("$host") String endpoint, - @PathParam(value = "resourceId", encoded = true) String resourceId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") GenericResourceInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch("/{resourceId}") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> updateById( - @HostParam("$host") String endpoint, - @PathParam(value = "resourceId", encoded = true) String resourceId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") GenericResourceInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/{resourceId}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getById( - @HostParam("$host") String endpoint, - @PathParam(value = "resourceId", encoded = true) String resourceId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Get all the resources for a resource group. - * - * @param resourceGroupName The resource group with the resources to get. - * @param filter The filter to apply on the operation.<br><br>The properties you can use for eq (equals) - * or ne (not equals) are: location, resourceType, name, resourceGroup, identity, identity/principalId, plan, - * plan/publisher, plan/product, plan/name, plan/version, and plan/promotionCode.<br><br>For - * example, to filter by a resource type, use: $filter=resourceType eq - * 'Microsoft.Network/virtualNetworks'<br><br>You can use substringof(value, property) in the - * filter. The properties you can use for substring are: name and resourceGroup.<br><br>For example, - * to get all resources with 'demo' anywhere in the name, use: $filter=substringof('demo', - * name)<br><br>You can link more than one substringof together by adding and/or - * operators.<br><br>You can filter by tag names and values. For example, to filter for a tag name - * and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'. When you filter by a tag name and value, - * the tags for each resource are not returned in the results.<br><br>You can use some properties - * together when filtering. The combinations you can use are: substringof and/or resourceType, plan and - * plan/publisher and plan/name, identity and identity/principalId. - * @param expand Comma-separated list of additional properties to be included in the response. Valid values include - * `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`. - * @param top The maximum number of results to return. If null is passed, returns all resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the resources for a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, String filter, String expand, Integer top) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - filter, - expand, - top, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get all the resources for a resource group. - * - * @param resourceGroupName The resource group with the resources to get. - * @param filter The filter to apply on the operation.<br><br>The properties you can use for eq (equals) - * or ne (not equals) are: location, resourceType, name, resourceGroup, identity, identity/principalId, plan, - * plan/publisher, plan/product, plan/name, plan/version, and plan/promotionCode.<br><br>For - * example, to filter by a resource type, use: $filter=resourceType eq - * 'Microsoft.Network/virtualNetworks'<br><br>You can use substringof(value, property) in the - * filter. The properties you can use for substring are: name and resourceGroup.<br><br>For example, - * to get all resources with 'demo' anywhere in the name, use: $filter=substringof('demo', - * name)<br><br>You can link more than one substringof together by adding and/or - * operators.<br><br>You can filter by tag names and values. For example, to filter for a tag name - * and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'. When you filter by a tag name and value, - * the tags for each resource are not returned in the results.<br><br>You can use some properties - * together when filtering. The combinations you can use are: substringof and/or resourceType, plan and - * plan/publisher and plan/name, identity and identity/principalId. - * @param expand Comma-separated list of additional properties to be included in the response. Valid values include - * `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`. - * @param top The maximum number of results to return. If null is passed, returns all resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the resources for a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, String filter, String expand, Integer top, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - filter, - expand, - top, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get all the resources for a resource group. - * - * @param resourceGroupName The resource group with the resources to get. - * @param filter The filter to apply on the operation.<br><br>The properties you can use for eq (equals) - * or ne (not equals) are: location, resourceType, name, resourceGroup, identity, identity/principalId, plan, - * plan/publisher, plan/product, plan/name, plan/version, and plan/promotionCode.<br><br>For - * example, to filter by a resource type, use: $filter=resourceType eq - * 'Microsoft.Network/virtualNetworks'<br><br>You can use substringof(value, property) in the - * filter. The properties you can use for substring are: name and resourceGroup.<br><br>For example, - * to get all resources with 'demo' anywhere in the name, use: $filter=substringof('demo', - * name)<br><br>You can link more than one substringof together by adding and/or - * operators.<br><br>You can filter by tag names and values. For example, to filter for a tag name - * and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'. When you filter by a tag name and value, - * the tags for each resource are not returned in the results.<br><br>You can use some properties - * together when filtering. The combinations you can use are: substringof and/or resourceType, plan and - * plan/publisher and plan/name, identity and identity/principalId. - * @param expand Comma-separated list of additional properties to be included in the response. Valid values include - * `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`. - * @param top The maximum number of results to return. If null is passed, returns all resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the resources for a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync( - String resourceGroupName, String filter, String expand, Integer top) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, expand, top), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * Get all the resources for a resource group. - * - * @param resourceGroupName The resource group with the resources to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the resources for a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - final String filter = null; - final String expand = null; - final Integer top = null; - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, expand, top), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * Get all the resources for a resource group. - * - * @param resourceGroupName The resource group with the resources to get. - * @param filter The filter to apply on the operation.<br><br>The properties you can use for eq (equals) - * or ne (not equals) are: location, resourceType, name, resourceGroup, identity, identity/principalId, plan, - * plan/publisher, plan/product, plan/name, plan/version, and plan/promotionCode.<br><br>For - * example, to filter by a resource type, use: $filter=resourceType eq - * 'Microsoft.Network/virtualNetworks'<br><br>You can use substringof(value, property) in the - * filter. The properties you can use for substring are: name and resourceGroup.<br><br>For example, - * to get all resources with 'demo' anywhere in the name, use: $filter=substringof('demo', - * name)<br><br>You can link more than one substringof together by adding and/or - * operators.<br><br>You can filter by tag names and values. For example, to filter for a tag name - * and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'. When you filter by a tag name and value, - * the tags for each resource are not returned in the results.<br><br>You can use some properties - * together when filtering. The combinations you can use are: substringof and/or resourceType, plan and - * plan/publisher and plan/name, identity and identity/principalId. - * @param expand Comma-separated list of additional properties to be included in the response. Valid values include - * `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`. - * @param top The maximum number of results to return. If null is passed, returns all resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the resources for a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync( - String resourceGroupName, String filter, String expand, Integer top, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, expand, top, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * Get all the resources for a resource group. - * - * @param resourceGroupName The resource group with the resources to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the resources for a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - final String filter = null; - final String expand = null; - final Integer top = null; - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, filter, expand, top)); - } - - /** - * Get all the resources for a resource group. - * - * @param resourceGroupName The resource group with the resources to get. - * @param filter The filter to apply on the operation.<br><br>The properties you can use for eq (equals) - * or ne (not equals) are: location, resourceType, name, resourceGroup, identity, identity/principalId, plan, - * plan/publisher, plan/product, plan/name, plan/version, and plan/promotionCode.<br><br>For - * example, to filter by a resource type, use: $filter=resourceType eq - * 'Microsoft.Network/virtualNetworks'<br><br>You can use substringof(value, property) in the - * filter. The properties you can use for substring are: name and resourceGroup.<br><br>For example, - * to get all resources with 'demo' anywhere in the name, use: $filter=substringof('demo', - * name)<br><br>You can link more than one substringof together by adding and/or - * operators.<br><br>You can filter by tag names and values. For example, to filter for a tag name - * and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'. When you filter by a tag name and value, - * the tags for each resource are not returned in the results.<br><br>You can use some properties - * together when filtering. The combinations you can use are: substringof and/or resourceType, plan and - * plan/publisher and plan/name, identity and identity/principalId. - * @param expand Comma-separated list of additional properties to be included in the response. Valid values include - * `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`. - * @param top The maximum number of results to return. If null is passed, returns all resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the resources for a resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup( - String resourceGroupName, String filter, String expand, Integer top, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, filter, expand, top, context)); - } - - /** - * The resources to move must be in the same source resource group. The target resource group may be in a different - * subscription. When moving resources, both the source group and the target group are locked for the duration of - * the operation. Write and delete operations are blocked on the groups until the move completes. - * - * @param sourceResourceGroupName The name of the resource group containing the resources to move. - * @param parameters Parameters for moving resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> moveResourcesWithResponseAsync( - String sourceResourceGroupName, ResourcesMoveInfo parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (sourceResourceGroupName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter sourceResourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .moveResources( - this.client.getEndpoint(), - sourceResourceGroupName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * The resources to move must be in the same source resource group. The target resource group may be in a different - * subscription. When moving resources, both the source group and the target group are locked for the duration of - * the operation. Write and delete operations are blocked on the groups until the move completes. - * - * @param sourceResourceGroupName The name of the resource group containing the resources to move. - * @param parameters Parameters for moving resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> moveResourcesWithResponseAsync( - String sourceResourceGroupName, ResourcesMoveInfo parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (sourceResourceGroupName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter sourceResourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .moveResources( - this.client.getEndpoint(), - sourceResourceGroupName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * The resources to move must be in the same source resource group. The target resource group may be in a different - * subscription. When moving resources, both the source group and the target group are locked for the duration of - * the operation. Write and delete operations are blocked on the groups until the move completes. - * - * @param sourceResourceGroupName The name of the resource group containing the resources to move. - * @param parameters Parameters for moving resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginMoveResourcesAsync( - String sourceResourceGroupName, ResourcesMoveInfo parameters) { - Mono>> mono = moveResourcesWithResponseAsync(sourceResourceGroupName, parameters); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * The resources to move must be in the same source resource group. The target resource group may be in a different - * subscription. When moving resources, both the source group and the target group are locked for the duration of - * the operation. Write and delete operations are blocked on the groups until the move completes. - * - * @param sourceResourceGroupName The name of the resource group containing the resources to move. - * @param parameters Parameters for moving resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginMoveResourcesAsync( - String sourceResourceGroupName, ResourcesMoveInfo parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - moveResourcesWithResponseAsync(sourceResourceGroupName, parameters, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * The resources to move must be in the same source resource group. The target resource group may be in a different - * subscription. When moving resources, both the source group and the target group are locked for the duration of - * the operation. Write and delete operations are blocked on the groups until the move completes. - * - * @param sourceResourceGroupName The name of the resource group containing the resources to move. - * @param parameters Parameters for moving resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginMoveResources( - String sourceResourceGroupName, ResourcesMoveInfo parameters) { - return beginMoveResourcesAsync(sourceResourceGroupName, parameters).getSyncPoller(); - } - - /** - * The resources to move must be in the same source resource group. The target resource group may be in a different - * subscription. When moving resources, both the source group and the target group are locked for the duration of - * the operation. Write and delete operations are blocked on the groups until the move completes. - * - * @param sourceResourceGroupName The name of the resource group containing the resources to move. - * @param parameters Parameters for moving resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginMoveResources( - String sourceResourceGroupName, ResourcesMoveInfo parameters, Context context) { - return beginMoveResourcesAsync(sourceResourceGroupName, parameters, context).getSyncPoller(); - } - - /** - * The resources to move must be in the same source resource group. The target resource group may be in a different - * subscription. When moving resources, both the source group and the target group are locked for the duration of - * the operation. Write and delete operations are blocked on the groups until the move completes. - * - * @param sourceResourceGroupName The name of the resource group containing the resources to move. - * @param parameters Parameters for moving resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono moveResourcesAsync(String sourceResourceGroupName, ResourcesMoveInfo parameters) { - return beginMoveResourcesAsync(sourceResourceGroupName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * The resources to move must be in the same source resource group. The target resource group may be in a different - * subscription. When moving resources, both the source group and the target group are locked for the duration of - * the operation. Write and delete operations are blocked on the groups until the move completes. - * - * @param sourceResourceGroupName The name of the resource group containing the resources to move. - * @param parameters Parameters for moving resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono moveResourcesAsync( - String sourceResourceGroupName, ResourcesMoveInfo parameters, Context context) { - return beginMoveResourcesAsync(sourceResourceGroupName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * The resources to move must be in the same source resource group. The target resource group may be in a different - * subscription. When moving resources, both the source group and the target group are locked for the duration of - * the operation. Write and delete operations are blocked on the groups until the move completes. - * - * @param sourceResourceGroupName The name of the resource group containing the resources to move. - * @param parameters Parameters for moving resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void moveResources(String sourceResourceGroupName, ResourcesMoveInfo parameters) { - moveResourcesAsync(sourceResourceGroupName, parameters).block(); - } - - /** - * The resources to move must be in the same source resource group. The target resource group may be in a different - * subscription. When moving resources, both the source group and the target group are locked for the duration of - * the operation. Write and delete operations are blocked on the groups until the move completes. - * - * @param sourceResourceGroupName The name of the resource group containing the resources to move. - * @param parameters Parameters for moving resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void moveResources(String sourceResourceGroupName, ResourcesMoveInfo parameters, Context context) { - moveResourcesAsync(sourceResourceGroupName, parameters, context).block(); - } - - /** - * This operation checks whether the specified resources can be moved to the target. The resources to move must be - * in the same source resource group. The target resource group may be in a different subscription. If validation - * succeeds, it returns HTTP response code 204 (no content). If validation fails, it returns HTTP response code 409 - * (Conflict) with an error message. Retrieve the URL in the Location header value to check the result of the - * long-running operation. - * - * @param sourceResourceGroupName The name of the resource group containing the resources to validate for move. - * @param parameters Parameters for moving resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> validateMoveResourcesWithResponseAsync( - String sourceResourceGroupName, ResourcesMoveInfo parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (sourceResourceGroupName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter sourceResourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .validateMoveResources( - this.client.getEndpoint(), - sourceResourceGroupName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * This operation checks whether the specified resources can be moved to the target. The resources to move must be - * in the same source resource group. The target resource group may be in a different subscription. If validation - * succeeds, it returns HTTP response code 204 (no content). If validation fails, it returns HTTP response code 409 - * (Conflict) with an error message. Retrieve the URL in the Location header value to check the result of the - * long-running operation. - * - * @param sourceResourceGroupName The name of the resource group containing the resources to validate for move. - * @param parameters Parameters for moving resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> validateMoveResourcesWithResponseAsync( - String sourceResourceGroupName, ResourcesMoveInfo parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (sourceResourceGroupName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter sourceResourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .validateMoveResources( - this.client.getEndpoint(), - sourceResourceGroupName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * This operation checks whether the specified resources can be moved to the target. The resources to move must be - * in the same source resource group. The target resource group may be in a different subscription. If validation - * succeeds, it returns HTTP response code 204 (no content). If validation fails, it returns HTTP response code 409 - * (Conflict) with an error message. Retrieve the URL in the Location header value to check the result of the - * long-running operation. - * - * @param sourceResourceGroupName The name of the resource group containing the resources to validate for move. - * @param parameters Parameters for moving resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginValidateMoveResourcesAsync( - String sourceResourceGroupName, ResourcesMoveInfo parameters) { - Mono>> mono = - validateMoveResourcesWithResponseAsync(sourceResourceGroupName, parameters); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * This operation checks whether the specified resources can be moved to the target. The resources to move must be - * in the same source resource group. The target resource group may be in a different subscription. If validation - * succeeds, it returns HTTP response code 204 (no content). If validation fails, it returns HTTP response code 409 - * (Conflict) with an error message. Retrieve the URL in the Location header value to check the result of the - * long-running operation. - * - * @param sourceResourceGroupName The name of the resource group containing the resources to validate for move. - * @param parameters Parameters for moving resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginValidateMoveResourcesAsync( - String sourceResourceGroupName, ResourcesMoveInfo parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - validateMoveResourcesWithResponseAsync(sourceResourceGroupName, parameters, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * This operation checks whether the specified resources can be moved to the target. The resources to move must be - * in the same source resource group. The target resource group may be in a different subscription. If validation - * succeeds, it returns HTTP response code 204 (no content). If validation fails, it returns HTTP response code 409 - * (Conflict) with an error message. Retrieve the URL in the Location header value to check the result of the - * long-running operation. - * - * @param sourceResourceGroupName The name of the resource group containing the resources to validate for move. - * @param parameters Parameters for moving resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginValidateMoveResources( - String sourceResourceGroupName, ResourcesMoveInfo parameters) { - return beginValidateMoveResourcesAsync(sourceResourceGroupName, parameters).getSyncPoller(); - } - - /** - * This operation checks whether the specified resources can be moved to the target. The resources to move must be - * in the same source resource group. The target resource group may be in a different subscription. If validation - * succeeds, it returns HTTP response code 204 (no content). If validation fails, it returns HTTP response code 409 - * (Conflict) with an error message. Retrieve the URL in the Location header value to check the result of the - * long-running operation. - * - * @param sourceResourceGroupName The name of the resource group containing the resources to validate for move. - * @param parameters Parameters for moving resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginValidateMoveResources( - String sourceResourceGroupName, ResourcesMoveInfo parameters, Context context) { - return beginValidateMoveResourcesAsync(sourceResourceGroupName, parameters, context).getSyncPoller(); - } - - /** - * This operation checks whether the specified resources can be moved to the target. The resources to move must be - * in the same source resource group. The target resource group may be in a different subscription. If validation - * succeeds, it returns HTTP response code 204 (no content). If validation fails, it returns HTTP response code 409 - * (Conflict) with an error message. Retrieve the URL in the Location header value to check the result of the - * long-running operation. - * - * @param sourceResourceGroupName The name of the resource group containing the resources to validate for move. - * @param parameters Parameters for moving resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono validateMoveResourcesAsync(String sourceResourceGroupName, ResourcesMoveInfo parameters) { - return beginValidateMoveResourcesAsync(sourceResourceGroupName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * This operation checks whether the specified resources can be moved to the target. The resources to move must be - * in the same source resource group. The target resource group may be in a different subscription. If validation - * succeeds, it returns HTTP response code 204 (no content). If validation fails, it returns HTTP response code 409 - * (Conflict) with an error message. Retrieve the URL in the Location header value to check the result of the - * long-running operation. - * - * @param sourceResourceGroupName The name of the resource group containing the resources to validate for move. - * @param parameters Parameters for moving resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono validateMoveResourcesAsync( - String sourceResourceGroupName, ResourcesMoveInfo parameters, Context context) { - return beginValidateMoveResourcesAsync(sourceResourceGroupName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * This operation checks whether the specified resources can be moved to the target. The resources to move must be - * in the same source resource group. The target resource group may be in a different subscription. If validation - * succeeds, it returns HTTP response code 204 (no content). If validation fails, it returns HTTP response code 409 - * (Conflict) with an error message. Retrieve the URL in the Location header value to check the result of the - * long-running operation. - * - * @param sourceResourceGroupName The name of the resource group containing the resources to validate for move. - * @param parameters Parameters for moving resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void validateMoveResources(String sourceResourceGroupName, ResourcesMoveInfo parameters) { - validateMoveResourcesAsync(sourceResourceGroupName, parameters).block(); - } - - /** - * This operation checks whether the specified resources can be moved to the target. The resources to move must be - * in the same source resource group. The target resource group may be in a different subscription. If validation - * succeeds, it returns HTTP response code 204 (no content). If validation fails, it returns HTTP response code 409 - * (Conflict) with an error message. Retrieve the URL in the Location header value to check the result of the - * long-running operation. - * - * @param sourceResourceGroupName The name of the resource group containing the resources to validate for move. - * @param parameters Parameters for moving resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void validateMoveResources(String sourceResourceGroupName, ResourcesMoveInfo parameters, Context context) { - validateMoveResourcesAsync(sourceResourceGroupName, parameters, context).block(); - } - - /** - * Get all the resources in a subscription. - * - * @param filter The filter to apply on the operation.<br><br>The properties you can use for eq (equals) - * or ne (not equals) are: location, resourceType, name, resourceGroup, identity, identity/principalId, plan, - * plan/publisher, plan/product, plan/name, plan/version, and plan/promotionCode.<br><br>For - * example, to filter by a resource type, use: $filter=resourceType eq - * 'Microsoft.Network/virtualNetworks'<br><br>You can use substringof(value, property) in the - * filter. The properties you can use for substring are: name and resourceGroup.<br><br>For example, - * to get all resources with 'demo' anywhere in the name, use: $filter=substringof('demo', - * name)<br><br>You can link more than one substringof together by adding and/or - * operators.<br><br>You can filter by tag names and values. For example, to filter for a tag name - * and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'. When you filter by a tag name and value, - * the tags for each resource are not returned in the results.<br><br>You can use some properties - * together when filtering. The combinations you can use are: substringof and/or resourceType, plan and - * plan/publisher and plan/name, identity and identity/principalId. - * @param expand Comma-separated list of additional properties to be included in the response. Valid values include - * `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`. - * @param top The maximum number of results to return. If null is passed, returns all resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the resources in a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String filter, String expand, Integer top) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - filter, - expand, - top, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get all the resources in a subscription. - * - * @param filter The filter to apply on the operation.<br><br>The properties you can use for eq (equals) - * or ne (not equals) are: location, resourceType, name, resourceGroup, identity, identity/principalId, plan, - * plan/publisher, plan/product, plan/name, plan/version, and plan/promotionCode.<br><br>For - * example, to filter by a resource type, use: $filter=resourceType eq - * 'Microsoft.Network/virtualNetworks'<br><br>You can use substringof(value, property) in the - * filter. The properties you can use for substring are: name and resourceGroup.<br><br>For example, - * to get all resources with 'demo' anywhere in the name, use: $filter=substringof('demo', - * name)<br><br>You can link more than one substringof together by adding and/or - * operators.<br><br>You can filter by tag names and values. For example, to filter for a tag name - * and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'. When you filter by a tag name and value, - * the tags for each resource are not returned in the results.<br><br>You can use some properties - * together when filtering. The combinations you can use are: substringof and/or resourceType, plan and - * plan/publisher and plan/name, identity and identity/principalId. - * @param expand Comma-separated list of additional properties to be included in the response. Valid values include - * `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`. - * @param top The maximum number of results to return. If null is passed, returns all resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the resources in a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String filter, String expand, Integer top, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - filter, - expand, - top, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get all the resources in a subscription. - * - * @param filter The filter to apply on the operation.<br><br>The properties you can use for eq (equals) - * or ne (not equals) are: location, resourceType, name, resourceGroup, identity, identity/principalId, plan, - * plan/publisher, plan/product, plan/name, plan/version, and plan/promotionCode.<br><br>For - * example, to filter by a resource type, use: $filter=resourceType eq - * 'Microsoft.Network/virtualNetworks'<br><br>You can use substringof(value, property) in the - * filter. The properties you can use for substring are: name and resourceGroup.<br><br>For example, - * to get all resources with 'demo' anywhere in the name, use: $filter=substringof('demo', - * name)<br><br>You can link more than one substringof together by adding and/or - * operators.<br><br>You can filter by tag names and values. For example, to filter for a tag name - * and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'. When you filter by a tag name and value, - * the tags for each resource are not returned in the results.<br><br>You can use some properties - * together when filtering. The combinations you can use are: substringof and/or resourceType, plan and - * plan/publisher and plan/name, identity and identity/principalId. - * @param expand Comma-separated list of additional properties to be included in the response. Valid values include - * `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`. - * @param top The maximum number of results to return. If null is passed, returns all resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the resources in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String filter, String expand, Integer top) { - return new PagedFlux<>( - () -> listSinglePageAsync(filter, expand, top), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Get all the resources in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the resources in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - final String filter = null; - final String expand = null; - final Integer top = null; - return new PagedFlux<>( - () -> listSinglePageAsync(filter, expand, top), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Get all the resources in a subscription. - * - * @param filter The filter to apply on the operation.<br><br>The properties you can use for eq (equals) - * or ne (not equals) are: location, resourceType, name, resourceGroup, identity, identity/principalId, plan, - * plan/publisher, plan/product, plan/name, plan/version, and plan/promotionCode.<br><br>For - * example, to filter by a resource type, use: $filter=resourceType eq - * 'Microsoft.Network/virtualNetworks'<br><br>You can use substringof(value, property) in the - * filter. The properties you can use for substring are: name and resourceGroup.<br><br>For example, - * to get all resources with 'demo' anywhere in the name, use: $filter=substringof('demo', - * name)<br><br>You can link more than one substringof together by adding and/or - * operators.<br><br>You can filter by tag names and values. For example, to filter for a tag name - * and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'. When you filter by a tag name and value, - * the tags for each resource are not returned in the results.<br><br>You can use some properties - * together when filtering. The combinations you can use are: substringof and/or resourceType, plan and - * plan/publisher and plan/name, identity and identity/principalId. - * @param expand Comma-separated list of additional properties to be included in the response. Valid values include - * `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`. - * @param top The maximum number of results to return. If null is passed, returns all resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the resources in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String filter, String expand, Integer top, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(filter, expand, top, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Get all the resources in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the resources in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - final String filter = null; - final String expand = null; - final Integer top = null; - return new PagedIterable<>(listAsync(filter, expand, top)); - } - - /** - * Get all the resources in a subscription. - * - * @param filter The filter to apply on the operation.<br><br>The properties you can use for eq (equals) - * or ne (not equals) are: location, resourceType, name, resourceGroup, identity, identity/principalId, plan, - * plan/publisher, plan/product, plan/name, plan/version, and plan/promotionCode.<br><br>For - * example, to filter by a resource type, use: $filter=resourceType eq - * 'Microsoft.Network/virtualNetworks'<br><br>You can use substringof(value, property) in the - * filter. The properties you can use for substring are: name and resourceGroup.<br><br>For example, - * to get all resources with 'demo' anywhere in the name, use: $filter=substringof('demo', - * name)<br><br>You can link more than one substringof together by adding and/or - * operators.<br><br>You can filter by tag names and values. For example, to filter for a tag name - * and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'. When you filter by a tag name and value, - * the tags for each resource are not returned in the results.<br><br>You can use some properties - * together when filtering. The combinations you can use are: substringof and/or resourceType, plan and - * plan/publisher and plan/name, identity and identity/principalId. - * @param expand Comma-separated list of additional properties to be included in the response. Valid values include - * `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`. - * @param top The maximum number of results to return. If null is passed, returns all resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the resources in a subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String filter, String expand, Integer top, Context context) { - return new PagedIterable<>(listAsync(filter, expand, top, context)); - } - - /** - * Checks whether a resource exists. - * - * @param resourceGroupName The name of the resource group containing the resource to check. The name is case - * insensitive. - * @param resourceProviderNamespace The resource provider of the resource to check. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type. - * @param resourceName The name of the resource to check whether it exists. - * @param apiVersion The API version to use for the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> checkExistenceWithResponseAsync( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String apiVersion) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceProviderNamespace == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter resourceProviderNamespace is required and cannot be null.")); - } - if (parentResourcePath == null) { - return Mono - .error(new IllegalArgumentException("Parameter parentResourcePath is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (apiVersion == null) { - return Mono.error(new IllegalArgumentException("Parameter apiVersion is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .checkExistence( - this.client.getEndpoint(), - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Checks whether a resource exists. - * - * @param resourceGroupName The name of the resource group containing the resource to check. The name is case - * insensitive. - * @param resourceProviderNamespace The resource provider of the resource to check. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type. - * @param resourceName The name of the resource to check whether it exists. - * @param apiVersion The API version to use for the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> checkExistenceWithResponseAsync( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String apiVersion, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceProviderNamespace == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter resourceProviderNamespace is required and cannot be null.")); - } - if (parentResourcePath == null) { - return Mono - .error(new IllegalArgumentException("Parameter parentResourcePath is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (apiVersion == null) { - return Mono.error(new IllegalArgumentException("Parameter apiVersion is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .checkExistence( - this.client.getEndpoint(), - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Checks whether a resource exists. - * - * @param resourceGroupName The name of the resource group containing the resource to check. The name is case - * insensitive. - * @param resourceProviderNamespace The resource provider of the resource to check. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type. - * @param resourceName The name of the resource to check whether it exists. - * @param apiVersion The API version to use for the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono checkExistenceAsync( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String apiVersion) { - return checkExistenceWithResponseAsync( - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - apiVersion) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Checks whether a resource exists. - * - * @param resourceGroupName The name of the resource group containing the resource to check. The name is case - * insensitive. - * @param resourceProviderNamespace The resource provider of the resource to check. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type. - * @param resourceName The name of the resource to check whether it exists. - * @param apiVersion The API version to use for the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public boolean checkExistence( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String apiVersion) { - Boolean value = - checkExistenceAsync( - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - apiVersion) - .block(); - if (value != null) { - return value; - } else { - throw logger.logExceptionAsError(new NullPointerException()); - } - } - - /** - * Checks whether a resource exists. - * - * @param resourceGroupName The name of the resource group containing the resource to check. The name is case - * insensitive. - * @param resourceProviderNamespace The resource provider of the resource to check. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type. - * @param resourceName The name of the resource to check whether it exists. - * @param apiVersion The API version to use for the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response checkExistenceWithResponse( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String apiVersion, - Context context) { - return checkExistenceWithResponseAsync( - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - apiVersion, - context) - .block(); - } - - /** - * Deletes a resource. - * - * @param resourceGroupName The name of the resource group that contains the resource to delete. The name is case - * insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type. - * @param resourceName The name of the resource to delete. - * @param apiVersion The API version to use for the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String apiVersion) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceProviderNamespace == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter resourceProviderNamespace is required and cannot be null.")); - } - if (parentResourcePath == null) { - return Mono - .error(new IllegalArgumentException("Parameter parentResourcePath is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (apiVersion == null) { - return Mono.error(new IllegalArgumentException("Parameter apiVersion is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a resource. - * - * @param resourceGroupName The name of the resource group that contains the resource to delete. The name is case - * insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type. - * @param resourceName The name of the resource to delete. - * @param apiVersion The API version to use for the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String apiVersion, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceProviderNamespace == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter resourceProviderNamespace is required and cannot be null.")); - } - if (parentResourcePath == null) { - return Mono - .error(new IllegalArgumentException("Parameter parentResourcePath is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (apiVersion == null) { - return Mono.error(new IllegalArgumentException("Parameter apiVersion is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Deletes a resource. - * - * @param resourceGroupName The name of the resource group that contains the resource to delete. The name is case - * insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type. - * @param resourceName The name of the resource to delete. - * @param apiVersion The API version to use for the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String apiVersion) { - Mono>> mono = - deleteWithResponseAsync( - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - apiVersion); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deletes a resource. - * - * @param resourceGroupName The name of the resource group that contains the resource to delete. The name is case - * insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type. - * @param resourceName The name of the resource to delete. - * @param apiVersion The API version to use for the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String apiVersion, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync( - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - apiVersion, - context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes a resource. - * - * @param resourceGroupName The name of the resource group that contains the resource to delete. The name is case - * insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type. - * @param resourceName The name of the resource to delete. - * @param apiVersion The API version to use for the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String apiVersion) { - return beginDeleteAsync( - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - apiVersion) - .getSyncPoller(); - } - - /** - * Deletes a resource. - * - * @param resourceGroupName The name of the resource group that contains the resource to delete. The name is case - * insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type. - * @param resourceName The name of the resource to delete. - * @param apiVersion The API version to use for the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String apiVersion, - Context context) { - return beginDeleteAsync( - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - apiVersion, - context) - .getSyncPoller(); - } - - /** - * Deletes a resource. - * - * @param resourceGroupName The name of the resource group that contains the resource to delete. The name is case - * insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type. - * @param resourceName The name of the resource to delete. - * @param apiVersion The API version to use for the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String apiVersion) { - return beginDeleteAsync( - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - apiVersion) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a resource. - * - * @param resourceGroupName The name of the resource group that contains the resource to delete. The name is case - * insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type. - * @param resourceName The name of the resource to delete. - * @param apiVersion The API version to use for the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String apiVersion, - Context context) { - return beginDeleteAsync( - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - apiVersion, - context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a resource. - * - * @param resourceGroupName The name of the resource group that contains the resource to delete. The name is case - * insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type. - * @param resourceName The name of the resource to delete. - * @param apiVersion The API version to use for the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String apiVersion) { - deleteAsync( - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - apiVersion) - .block(); - } - - /** - * Deletes a resource. - * - * @param resourceGroupName The name of the resource group that contains the resource to delete. The name is case - * insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type. - * @param resourceName The name of the resource to delete. - * @param apiVersion The API version to use for the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String apiVersion, - Context context) { - deleteAsync( - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - apiVersion, - context) - .block(); - } - - /** - * Creates a resource. - * - * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource to create. - * @param resourceName The name of the resource to create. - * @param apiVersion The API version to use for the operation. - * @param parameters Parameters for creating or updating the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String apiVersion, - GenericResourceInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceProviderNamespace == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter resourceProviderNamespace is required and cannot be null.")); - } - if (parentResourcePath == null) { - return Mono - .error(new IllegalArgumentException("Parameter parentResourcePath is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (apiVersion == null) { - return Mono.error(new IllegalArgumentException("Parameter apiVersion is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates a resource. - * - * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource to create. - * @param resourceName The name of the resource to create. - * @param apiVersion The API version to use for the operation. - * @param parameters Parameters for creating or updating the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String apiVersion, - GenericResourceInner parameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceProviderNamespace == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter resourceProviderNamespace is required and cannot be null.")); - } - if (parentResourcePath == null) { - return Mono - .error(new IllegalArgumentException("Parameter parentResourcePath is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (apiVersion == null) { - return Mono.error(new IllegalArgumentException("Parameter apiVersion is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Creates a resource. - * - * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource to create. - * @param resourceName The name of the resource to create. - * @param apiVersion The API version to use for the operation. - * @param parameters Parameters for creating or updating the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, GenericResourceInner> beginCreateOrUpdateAsync( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String apiVersion, - GenericResourceInner parameters) { - Mono>> mono = - createOrUpdateWithResponseAsync( - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - apiVersion, - parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - GenericResourceInner.class, - GenericResourceInner.class, - Context.NONE); - } - - /** - * Creates a resource. - * - * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource to create. - * @param resourceName The name of the resource to create. - * @param apiVersion The API version to use for the operation. - * @param parameters Parameters for creating or updating the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, GenericResourceInner> beginCreateOrUpdateAsync( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String apiVersion, - GenericResourceInner parameters, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync( - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - apiVersion, - parameters, - context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), GenericResourceInner.class, GenericResourceInner.class, context); - } - - /** - * Creates a resource. - * - * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource to create. - * @param resourceName The name of the resource to create. - * @param apiVersion The API version to use for the operation. - * @param parameters Parameters for creating or updating the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, GenericResourceInner> beginCreateOrUpdate( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String apiVersion, - GenericResourceInner parameters) { - return beginCreateOrUpdateAsync( - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - apiVersion, - parameters) - .getSyncPoller(); - } - - /** - * Creates a resource. - * - * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource to create. - * @param resourceName The name of the resource to create. - * @param apiVersion The API version to use for the operation. - * @param parameters Parameters for creating or updating the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, GenericResourceInner> beginCreateOrUpdate( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String apiVersion, - GenericResourceInner parameters, - Context context) { - return beginCreateOrUpdateAsync( - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - apiVersion, - parameters, - context) - .getSyncPoller(); - } - - /** - * Creates a resource. - * - * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource to create. - * @param resourceName The name of the resource to create. - * @param apiVersion The API version to use for the operation. - * @param parameters Parameters for creating or updating the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String apiVersion, - GenericResourceInner parameters) { - return beginCreateOrUpdateAsync( - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - apiVersion, - parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates a resource. - * - * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource to create. - * @param resourceName The name of the resource to create. - * @param apiVersion The API version to use for the operation. - * @param parameters Parameters for creating or updating the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String apiVersion, - GenericResourceInner parameters, - Context context) { - return beginCreateOrUpdateAsync( - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - apiVersion, - parameters, - context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates a resource. - * - * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource to create. - * @param resourceName The name of the resource to create. - * @param apiVersion The API version to use for the operation. - * @param parameters Parameters for creating or updating the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GenericResourceInner createOrUpdate( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String apiVersion, - GenericResourceInner parameters) { - return createOrUpdateAsync( - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - apiVersion, - parameters) - .block(); - } - - /** - * Creates a resource. - * - * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource to create. - * @param resourceName The name of the resource to create. - * @param apiVersion The API version to use for the operation. - * @param parameters Parameters for creating or updating the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GenericResourceInner createOrUpdate( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String apiVersion, - GenericResourceInner parameters, - Context context) { - return createOrUpdateAsync( - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - apiVersion, - parameters, - context) - .block(); - } - - /** - * Updates a resource. - * - * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource to update. - * @param resourceName The name of the resource to update. - * @param apiVersion The API version to use for the operation. - * @param parameters Parameters for updating the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateWithResponseAsync( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String apiVersion, - GenericResourceInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceProviderNamespace == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter resourceProviderNamespace is required and cannot be null.")); - } - if (parentResourcePath == null) { - return Mono - .error(new IllegalArgumentException("Parameter parentResourcePath is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (apiVersion == null) { - return Mono.error(new IllegalArgumentException("Parameter apiVersion is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates a resource. - * - * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource to update. - * @param resourceName The name of the resource to update. - * @param apiVersion The API version to use for the operation. - * @param parameters Parameters for updating the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String apiVersion, - GenericResourceInner parameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceProviderNamespace == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter resourceProviderNamespace is required and cannot be null.")); - } - if (parentResourcePath == null) { - return Mono - .error(new IllegalArgumentException("Parameter parentResourcePath is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (apiVersion == null) { - return Mono.error(new IllegalArgumentException("Parameter apiVersion is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Updates a resource. - * - * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource to update. - * @param resourceName The name of the resource to update. - * @param apiVersion The API version to use for the operation. - * @param parameters Parameters for updating the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, GenericResourceInner> beginUpdateAsync( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String apiVersion, - GenericResourceInner parameters) { - Mono>> mono = - updateWithResponseAsync( - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - apiVersion, - parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - GenericResourceInner.class, - GenericResourceInner.class, - Context.NONE); - } - - /** - * Updates a resource. - * - * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource to update. - * @param resourceName The name of the resource to update. - * @param apiVersion The API version to use for the operation. - * @param parameters Parameters for updating the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, GenericResourceInner> beginUpdateAsync( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String apiVersion, - GenericResourceInner parameters, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - updateWithResponseAsync( - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - apiVersion, - parameters, - context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), GenericResourceInner.class, GenericResourceInner.class, context); - } - - /** - * Updates a resource. - * - * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource to update. - * @param resourceName The name of the resource to update. - * @param apiVersion The API version to use for the operation. - * @param parameters Parameters for updating the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, GenericResourceInner> beginUpdate( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String apiVersion, - GenericResourceInner parameters) { - return beginUpdateAsync( - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - apiVersion, - parameters) - .getSyncPoller(); - } - - /** - * Updates a resource. - * - * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource to update. - * @param resourceName The name of the resource to update. - * @param apiVersion The API version to use for the operation. - * @param parameters Parameters for updating the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, GenericResourceInner> beginUpdate( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String apiVersion, - GenericResourceInner parameters, - Context context) { - return beginUpdateAsync( - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - apiVersion, - parameters, - context) - .getSyncPoller(); - } - - /** - * Updates a resource. - * - * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource to update. - * @param resourceName The name of the resource to update. - * @param apiVersion The API version to use for the operation. - * @param parameters Parameters for updating the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String apiVersion, - GenericResourceInner parameters) { - return beginUpdateAsync( - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - apiVersion, - parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates a resource. - * - * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource to update. - * @param resourceName The name of the resource to update. - * @param apiVersion The API version to use for the operation. - * @param parameters Parameters for updating the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String apiVersion, - GenericResourceInner parameters, - Context context) { - return beginUpdateAsync( - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - apiVersion, - parameters, - context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates a resource. - * - * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource to update. - * @param resourceName The name of the resource to update. - * @param apiVersion The API version to use for the operation. - * @param parameters Parameters for updating the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GenericResourceInner update( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String apiVersion, - GenericResourceInner parameters) { - return updateAsync( - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - apiVersion, - parameters) - .block(); - } - - /** - * Updates a resource. - * - * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource to update. - * @param resourceName The name of the resource to update. - * @param apiVersion The API version to use for the operation. - * @param parameters Parameters for updating the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GenericResourceInner update( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String apiVersion, - GenericResourceInner parameters, - Context context) { - return updateAsync( - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - apiVersion, - parameters, - context) - .block(); - } - - /** - * Gets a resource. - * - * @param resourceGroupName The name of the resource group containing the resource to get. The name is case - * insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource. - * @param resourceName The name of the resource to get. - * @param apiVersion The API version to use for the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String apiVersion) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceProviderNamespace == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter resourceProviderNamespace is required and cannot be null.")); - } - if (parentResourcePath == null) { - return Mono - .error(new IllegalArgumentException("Parameter parentResourcePath is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (apiVersion == null) { - return Mono.error(new IllegalArgumentException("Parameter apiVersion is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a resource. - * - * @param resourceGroupName The name of the resource group containing the resource to get. The name is case - * insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource. - * @param resourceName The name of the resource to get. - * @param apiVersion The API version to use for the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String apiVersion, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceProviderNamespace == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter resourceProviderNamespace is required and cannot be null.")); - } - if (parentResourcePath == null) { - return Mono - .error(new IllegalArgumentException("Parameter parentResourcePath is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (apiVersion == null) { - return Mono.error(new IllegalArgumentException("Parameter apiVersion is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets a resource. - * - * @param resourceGroupName The name of the resource group containing the resource to get. The name is case - * insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource. - * @param resourceName The name of the resource to get. - * @param apiVersion The API version to use for the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String apiVersion) { - return getWithResponseAsync( - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - apiVersion) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a resource. - * - * @param resourceGroupName The name of the resource group containing the resource to get. The name is case - * insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource. - * @param resourceName The name of the resource to get. - * @param apiVersion The API version to use for the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GenericResourceInner get( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String apiVersion) { - return getAsync( - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - apiVersion) - .block(); - } - - /** - * Gets a resource. - * - * @param resourceGroupName The name of the resource group containing the resource to get. The name is case - * insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource. - * @param resourceName The name of the resource to get. - * @param apiVersion The API version to use for the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String apiVersion, - Context context) { - return getWithResponseAsync( - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - apiVersion, - context) - .block(); - } - - /** - * Checks by ID whether a resource exists. - * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> checkExistenceByIdWithResponseAsync(String resourceId, String apiVersion) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (apiVersion == null) { - return Mono.error(new IllegalArgumentException("Parameter apiVersion is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service.checkExistenceById(this.client.getEndpoint(), resourceId, apiVersion, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Checks by ID whether a resource exists. - * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> checkExistenceByIdWithResponseAsync( - String resourceId, String apiVersion, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (apiVersion == null) { - return Mono.error(new IllegalArgumentException("Parameter apiVersion is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.checkExistenceById(this.client.getEndpoint(), resourceId, apiVersion, accept, context); - } - - /** - * Checks by ID whether a resource exists. - * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono checkExistenceByIdAsync(String resourceId, String apiVersion) { - return checkExistenceByIdWithResponseAsync(resourceId, apiVersion) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Checks by ID whether a resource exists. - * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public boolean checkExistenceById(String resourceId, String apiVersion) { - Boolean value = checkExistenceByIdAsync(resourceId, apiVersion).block(); - if (value != null) { - return value; - } else { - throw logger.logExceptionAsError(new NullPointerException()); - } - } - - /** - * Checks by ID whether a resource exists. - * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response checkExistenceByIdWithResponse(String resourceId, String apiVersion, Context context) { - return checkExistenceByIdWithResponseAsync(resourceId, apiVersion, context).block(); - } - - /** - * Deletes a resource by ID. - * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteByIdWithResponseAsync(String resourceId, String apiVersion) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (apiVersion == null) { - return Mono.error(new IllegalArgumentException("Parameter apiVersion is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.deleteById(this.client.getEndpoint(), resourceId, apiVersion, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a resource by ID. - * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteByIdWithResponseAsync( - String resourceId, String apiVersion, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (apiVersion == null) { - return Mono.error(new IllegalArgumentException("Parameter apiVersion is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.deleteById(this.client.getEndpoint(), resourceId, apiVersion, accept, context); - } - - /** - * Deletes a resource by ID. - * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDeleteByIdAsync(String resourceId, String apiVersion) { - Mono>> mono = deleteByIdWithResponseAsync(resourceId, apiVersion); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deletes a resource by ID. - * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteByIdAsync( - String resourceId, String apiVersion, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteByIdWithResponseAsync(resourceId, apiVersion, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes a resource by ID. - * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDeleteById(String resourceId, String apiVersion) { - return beginDeleteByIdAsync(resourceId, apiVersion).getSyncPoller(); - } - - /** - * Deletes a resource by ID. - * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDeleteById(String resourceId, String apiVersion, Context context) { - return beginDeleteByIdAsync(resourceId, apiVersion, context).getSyncPoller(); - } - - /** - * Deletes a resource by ID. - * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteByIdAsync(String resourceId, String apiVersion) { - return beginDeleteByIdAsync(resourceId, apiVersion).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a resource by ID. - * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteByIdAsync(String resourceId, String apiVersion, Context context) { - return beginDeleteByIdAsync(resourceId, apiVersion, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a resource by ID. - * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteById(String resourceId, String apiVersion) { - deleteByIdAsync(resourceId, apiVersion).block(); - } - - /** - * Deletes a resource by ID. - * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteById(String resourceId, String apiVersion, Context context) { - deleteByIdAsync(resourceId, apiVersion, context).block(); - } - - /** - * Create a resource by ID. - * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param parameters Create or update resource parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateByIdWithResponseAsync( - String resourceId, String apiVersion, GenericResourceInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (apiVersion == null) { - return Mono.error(new IllegalArgumentException("Parameter apiVersion is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdateById( - this.client.getEndpoint(), resourceId, apiVersion, parameters, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create a resource by ID. - * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param parameters Create or update resource parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateByIdWithResponseAsync( - String resourceId, String apiVersion, GenericResourceInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (apiVersion == null) { - return Mono.error(new IllegalArgumentException("Parameter apiVersion is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdateById(this.client.getEndpoint(), resourceId, apiVersion, parameters, accept, context); - } - - /** - * Create a resource by ID. - * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param parameters Create or update resource parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, GenericResourceInner> beginCreateOrUpdateByIdAsync( - String resourceId, String apiVersion, GenericResourceInner parameters) { - Mono>> mono = createOrUpdateByIdWithResponseAsync(resourceId, apiVersion, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - GenericResourceInner.class, - GenericResourceInner.class, - Context.NONE); - } - - /** - * Create a resource by ID. - * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param parameters Create or update resource parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, GenericResourceInner> beginCreateOrUpdateByIdAsync( - String resourceId, String apiVersion, GenericResourceInner parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateByIdWithResponseAsync(resourceId, apiVersion, parameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), GenericResourceInner.class, GenericResourceInner.class, context); - } - - /** - * Create a resource by ID. - * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param parameters Create or update resource parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, GenericResourceInner> beginCreateOrUpdateById( - String resourceId, String apiVersion, GenericResourceInner parameters) { - return beginCreateOrUpdateByIdAsync(resourceId, apiVersion, parameters).getSyncPoller(); - } - - /** - * Create a resource by ID. - * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param parameters Create or update resource parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, GenericResourceInner> beginCreateOrUpdateById( - String resourceId, String apiVersion, GenericResourceInner parameters, Context context) { - return beginCreateOrUpdateByIdAsync(resourceId, apiVersion, parameters, context).getSyncPoller(); - } - - /** - * Create a resource by ID. - * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param parameters Create or update resource parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateByIdAsync( - String resourceId, String apiVersion, GenericResourceInner parameters) { - return beginCreateOrUpdateByIdAsync(resourceId, apiVersion, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create a resource by ID. - * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param parameters Create or update resource parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateByIdAsync( - String resourceId, String apiVersion, GenericResourceInner parameters, Context context) { - return beginCreateOrUpdateByIdAsync(resourceId, apiVersion, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create a resource by ID. - * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param parameters Create or update resource parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GenericResourceInner createOrUpdateById( - String resourceId, String apiVersion, GenericResourceInner parameters) { - return createOrUpdateByIdAsync(resourceId, apiVersion, parameters).block(); - } - - /** - * Create a resource by ID. - * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param parameters Create or update resource parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GenericResourceInner createOrUpdateById( - String resourceId, String apiVersion, GenericResourceInner parameters, Context context) { - return createOrUpdateByIdAsync(resourceId, apiVersion, parameters, context).block(); - } - - /** - * Updates a resource by ID. - * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param parameters Update resource parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateByIdWithResponseAsync( - String resourceId, String apiVersion, GenericResourceInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (apiVersion == null) { - return Mono.error(new IllegalArgumentException("Parameter apiVersion is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service.updateById(this.client.getEndpoint(), resourceId, apiVersion, parameters, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates a resource by ID. - * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param parameters Update resource parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateByIdWithResponseAsync( - String resourceId, String apiVersion, GenericResourceInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (apiVersion == null) { - return Mono.error(new IllegalArgumentException("Parameter apiVersion is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.updateById(this.client.getEndpoint(), resourceId, apiVersion, parameters, accept, context); - } - - /** - * Updates a resource by ID. - * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param parameters Update resource parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, GenericResourceInner> beginUpdateByIdAsync( - String resourceId, String apiVersion, GenericResourceInner parameters) { - Mono>> mono = updateByIdWithResponseAsync(resourceId, apiVersion, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - GenericResourceInner.class, - GenericResourceInner.class, - Context.NONE); - } - - /** - * Updates a resource by ID. - * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param parameters Update resource parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, GenericResourceInner> beginUpdateByIdAsync( - String resourceId, String apiVersion, GenericResourceInner parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - updateByIdWithResponseAsync(resourceId, apiVersion, parameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), GenericResourceInner.class, GenericResourceInner.class, context); - } - - /** - * Updates a resource by ID. - * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param parameters Update resource parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, GenericResourceInner> beginUpdateById( - String resourceId, String apiVersion, GenericResourceInner parameters) { - return beginUpdateByIdAsync(resourceId, apiVersion, parameters).getSyncPoller(); - } - - /** - * Updates a resource by ID. - * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param parameters Update resource parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, GenericResourceInner> beginUpdateById( - String resourceId, String apiVersion, GenericResourceInner parameters, Context context) { - return beginUpdateByIdAsync(resourceId, apiVersion, parameters, context).getSyncPoller(); - } - - /** - * Updates a resource by ID. - * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param parameters Update resource parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateByIdAsync( - String resourceId, String apiVersion, GenericResourceInner parameters) { - return beginUpdateByIdAsync(resourceId, apiVersion, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates a resource by ID. - * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param parameters Update resource parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateByIdAsync( - String resourceId, String apiVersion, GenericResourceInner parameters, Context context) { - return beginUpdateByIdAsync(resourceId, apiVersion, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates a resource by ID. - * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param parameters Update resource parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GenericResourceInner updateById(String resourceId, String apiVersion, GenericResourceInner parameters) { - return updateByIdAsync(resourceId, apiVersion, parameters).block(); - } - - /** - * Updates a resource by ID. - * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param parameters Update resource parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GenericResourceInner updateById( - String resourceId, String apiVersion, GenericResourceInner parameters, Context context) { - return updateByIdAsync(resourceId, apiVersion, parameters, context).block(); - } - - /** - * Gets a resource by ID. - * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a resource by ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByIdWithResponseAsync(String resourceId, String apiVersion) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (apiVersion == null) { - return Mono.error(new IllegalArgumentException("Parameter apiVersion is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getById(this.client.getEndpoint(), resourceId, apiVersion, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a resource by ID. - * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a resource by ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByIdWithResponseAsync( - String resourceId, String apiVersion, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (apiVersion == null) { - return Mono.error(new IllegalArgumentException("Parameter apiVersion is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getById(this.client.getEndpoint(), resourceId, apiVersion, accept, context); - } - - /** - * Gets a resource by ID. - * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a resource by ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByIdAsync(String resourceId, String apiVersion) { - return getByIdWithResponseAsync(resourceId, apiVersion) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a resource by ID. - * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a resource by ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GenericResourceInner getById(String resourceId, String apiVersion) { - return getByIdAsync(resourceId, apiVersion).block(); - } - - /** - * Gets a resource by ID. - * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a resource by ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByIdWithResponse(String resourceId, String apiVersion, Context context) { - return getByIdWithResponseAsync(resourceId, apiVersion, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of resource groups. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of resource groups. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of resource groups. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of resource groups. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/SubscriptionClientBuilder.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/SubscriptionClientBuilder.java deleted file mode 100644 index ad82a7140877..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/SubscriptionClientBuilder.java +++ /dev/null @@ -1,129 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.implementation; - -import com.azure.core.annotation.ServiceClientBuilder; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.policy.CookiePolicy; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerAdapter; -import java.time.Duration; - -/** A builder for creating a new instance of the SubscriptionClientImpl type. */ -@ServiceClientBuilder(serviceClients = {SubscriptionClientImpl.class}) -public final class SubscriptionClientBuilder { - /* - * server parameter - */ - private String endpoint; - - /** - * Sets server parameter. - * - * @param endpoint the endpoint value. - * @return the SubscriptionClientBuilder. - */ - public SubscriptionClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * The environment to connect to - */ - private AzureEnvironment environment; - - /** - * Sets The environment to connect to. - * - * @param environment the environment value. - * @return the SubscriptionClientBuilder. - */ - public SubscriptionClientBuilder environment(AzureEnvironment environment) { - this.environment = environment; - return this; - } - - /* - * The default poll interval for long-running operation - */ - private Duration defaultPollInterval; - - /** - * Sets The default poll interval for long-running operation. - * - * @param defaultPollInterval the defaultPollInterval value. - * @return the SubscriptionClientBuilder. - */ - public SubscriptionClientBuilder defaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = defaultPollInterval; - return this; - } - - /* - * The HTTP pipeline to send requests through - */ - private HttpPipeline pipeline; - - /** - * Sets The HTTP pipeline to send requests through. - * - * @param pipeline the pipeline value. - * @return the SubscriptionClientBuilder. - */ - public SubscriptionClientBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; - return this; - } - - /* - * The serializer to serialize an object into a string - */ - private SerializerAdapter serializerAdapter; - - /** - * Sets The serializer to serialize an object into a string. - * - * @param serializerAdapter the serializerAdapter value. - * @return the SubscriptionClientBuilder. - */ - public SubscriptionClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { - this.serializerAdapter = serializerAdapter; - return this; - } - - /** - * Builds an instance of SubscriptionClientImpl with the provided parameters. - * - * @return an instance of SubscriptionClientImpl. - */ - public SubscriptionClientImpl buildClient() { - if (endpoint == null) { - this.endpoint = "https://management.azure.com"; - } - if (environment == null) { - this.environment = AzureEnvironment.AZURE; - } - if (defaultPollInterval == null) { - this.defaultPollInterval = Duration.ofSeconds(30); - } - if (pipeline == null) { - this.pipeline = - new HttpPipelineBuilder() - .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) - .build(); - } - if (serializerAdapter == null) { - this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); - } - SubscriptionClientImpl client = - new SubscriptionClientImpl(pipeline, serializerAdapter, defaultPollInterval, environment, endpoint); - return client; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/SubscriptionClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/SubscriptionClientImpl.java deleted file mode 100644 index 8888319d7eee..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/SubscriptionClientImpl.java +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.implementation; - -import com.azure.core.annotation.ServiceClient; -import com.azure.core.http.HttpPipeline; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.serializer.SerializerAdapter; -import com.azure.resourcemanager.resources.fluent.ResourceNamesClient; -import com.azure.resourcemanager.resources.fluent.SubscriptionClient; -import com.azure.resourcemanager.resources.fluent.SubscriptionsClient; -import com.azure.resourcemanager.resources.fluent.TenantsClient; -import com.azure.resourcemanager.resources.fluentcore.AzureServiceClient; -import java.time.Duration; - -/** Initializes a new instance of the SubscriptionClientImpl type. */ -@ServiceClient(builder = SubscriptionClientBuilder.class) -public final class SubscriptionClientImpl extends AzureServiceClient implements SubscriptionClient { - private final ClientLogger logger = new ClientLogger(SubscriptionClientImpl.class); - - /** server parameter. */ - private final String endpoint; - - /** - * Gets server parameter. - * - * @return the endpoint value. - */ - public String getEndpoint() { - return this.endpoint; - } - - /** Api Version. */ - private final String apiVersion; - - /** - * Gets Api Version. - * - * @return the apiVersion value. - */ - public String getApiVersion() { - return this.apiVersion; - } - - /** The HTTP pipeline to send requests through. */ - private final HttpPipeline httpPipeline; - - /** - * Gets The HTTP pipeline to send requests through. - * - * @return the httpPipeline value. - */ - public HttpPipeline getHttpPipeline() { - return this.httpPipeline; - } - - /** The serializer to serialize an object into a string. */ - private final SerializerAdapter serializerAdapter; - - /** - * Gets The serializer to serialize an object into a string. - * - * @return the serializerAdapter value. - */ - SerializerAdapter getSerializerAdapter() { - return this.serializerAdapter; - } - - /** The default poll interval for long-running operation. */ - private final Duration defaultPollInterval; - - /** - * Gets The default poll interval for long-running operation. - * - * @return the defaultPollInterval value. - */ - public Duration getDefaultPollInterval() { - return this.defaultPollInterval; - } - - /** The SubscriptionsClient object to access its operations. */ - private final SubscriptionsClient subscriptions; - - /** - * Gets the SubscriptionsClient object to access its operations. - * - * @return the SubscriptionsClient object. - */ - public SubscriptionsClient getSubscriptions() { - return this.subscriptions; - } - - /** The TenantsClient object to access its operations. */ - private final TenantsClient tenants; - - /** - * Gets the TenantsClient object to access its operations. - * - * @return the TenantsClient object. - */ - public TenantsClient getTenants() { - return this.tenants; - } - - /** The ResourceNamesClient object to access its operations. */ - private final ResourceNamesClient resourceNames; - - /** - * Gets the ResourceNamesClient object to access its operations. - * - * @return the ResourceNamesClient object. - */ - public ResourceNamesClient getResourceNames() { - return this.resourceNames; - } - - /** - * Initializes an instance of SubscriptionClient client. - * - * @param httpPipeline The HTTP pipeline to send requests through. - * @param serializerAdapter The serializer to serialize an object into a string. - * @param defaultPollInterval The default poll interval for long-running operation. - * @param environment The Azure environment. - * @param endpoint server parameter. - */ - SubscriptionClientImpl( - HttpPipeline httpPipeline, - SerializerAdapter serializerAdapter, - Duration defaultPollInterval, - AzureEnvironment environment, - String endpoint) { - super(httpPipeline, serializerAdapter, environment); - this.httpPipeline = httpPipeline; - this.serializerAdapter = serializerAdapter; - this.defaultPollInterval = defaultPollInterval; - this.endpoint = endpoint; - this.apiVersion = "2016-06-01"; - this.subscriptions = new SubscriptionsClientImpl(this); - this.tenants = new TenantsClientImpl(this); - this.resourceNames = new ResourceNamesClientImpl(this); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/SubscriptionImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/SubscriptionImpl.java deleted file mode 100644 index ed19dbe7f941..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/SubscriptionImpl.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.resources.models.Location; -import com.azure.resourcemanager.resources.models.Subscription; -import com.azure.resourcemanager.resources.models.SubscriptionPolicies; -import com.azure.resourcemanager.resources.models.SubscriptionState; -import com.azure.core.management.Region; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.IndexableWrapperImpl; -import com.azure.resourcemanager.resources.fluent.models.SubscriptionInner; -import com.azure.resourcemanager.resources.fluent.SubscriptionsClient; -import com.azure.resourcemanager.resources.fluentcore.utils.PagedConverter; - -/** - * The implementation of {@link Subscription}. - */ -final class SubscriptionImpl extends - IndexableWrapperImpl - implements - Subscription { - - private final SubscriptionsClient client; - - SubscriptionImpl(SubscriptionInner innerModel, final SubscriptionsClient client) { - super(innerModel); - this.client = client; - } - - @Override - public String subscriptionId() { - return this.innerModel().subscriptionId(); - } - - @Override - public String displayName() { - return this.innerModel().displayName(); - } - - @Override - public SubscriptionState state() { - return this.innerModel().state(); - } - - @Override - public SubscriptionPolicies subscriptionPolicies() { - return this.innerModel().subscriptionPolicies(); - } - - @Override - public PagedIterable listLocations() { - return PagedConverter.mapPage(client.listLocations(this.subscriptionId()), LocationImpl::new); - } - - @Override - public Location getLocationByRegion(Region region) { - if (region != null) { - PagedIterable locations = listLocations(); - for (Location location : locations) { - if (region.equals(location.region())) { - return location; - } - } - } - return null; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/SubscriptionsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/SubscriptionsClientImpl.java deleted file mode 100644 index dccfbed3904d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/SubscriptionsClientImpl.java +++ /dev/null @@ -1,528 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.resources.fluent.SubscriptionsClient; -import com.azure.resourcemanager.resources.fluent.models.LocationInner; -import com.azure.resourcemanager.resources.fluent.models.SubscriptionInner; -import com.azure.resourcemanager.resources.models.LocationListResult; -import com.azure.resourcemanager.resources.models.SubscriptionListResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in SubscriptionsClient. */ -public final class SubscriptionsClientImpl implements SubscriptionsClient { - private final ClientLogger logger = new ClientLogger(SubscriptionsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final SubscriptionsService service; - - /** The service client containing this operation class. */ - private final SubscriptionClientImpl client; - - /** - * Initializes an instance of SubscriptionsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - SubscriptionsClientImpl(SubscriptionClientImpl client) { - this.service = - RestProxy.create(SubscriptionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SubscriptionClientSubscriptions to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SubscriptionClientSu") - private interface SubscriptionsService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/locations") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listLocations( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * This operation provides all the locations that are available for resource providers; however, each resource - * provider may support a subset of this list. - * - * @param subscriptionId The ID of the target subscription. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return location list operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listLocationsSinglePageAsync(String subscriptionId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (subscriptionId == null) { - return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listLocations( - this.client.getEndpoint(), subscriptionId, this.client.getApiVersion(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * This operation provides all the locations that are available for resource providers; however, each resource - * provider may support a subset of this list. - * - * @param subscriptionId The ID of the target subscription. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return location list operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listLocationsSinglePageAsync(String subscriptionId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (subscriptionId == null) { - return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listLocations(this.client.getEndpoint(), subscriptionId, this.client.getApiVersion(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); - } - - /** - * This operation provides all the locations that are available for resource providers; however, each resource - * provider may support a subset of this list. - * - * @param subscriptionId The ID of the target subscription. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return location list operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listLocationsAsync(String subscriptionId) { - return new PagedFlux<>(() -> listLocationsSinglePageAsync(subscriptionId)); - } - - /** - * This operation provides all the locations that are available for resource providers; however, each resource - * provider may support a subset of this list. - * - * @param subscriptionId The ID of the target subscription. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return location list operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listLocationsAsync(String subscriptionId, Context context) { - return new PagedFlux<>(() -> listLocationsSinglePageAsync(subscriptionId, context)); - } - - /** - * This operation provides all the locations that are available for resource providers; however, each resource - * provider may support a subset of this list. - * - * @param subscriptionId The ID of the target subscription. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return location list operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listLocations(String subscriptionId) { - return new PagedIterable<>(listLocationsAsync(subscriptionId)); - } - - /** - * This operation provides all the locations that are available for resource providers; however, each resource - * provider may support a subset of this list. - * - * @param subscriptionId The ID of the target subscription. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return location list operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listLocations(String subscriptionId, Context context) { - return new PagedIterable<>(listLocationsAsync(subscriptionId, context)); - } - - /** - * Gets details about a specified subscription. - * - * @param subscriptionId The ID of the target subscription. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return details about a specified subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync(String subscriptionId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (subscriptionId == null) { - return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get(this.client.getEndpoint(), subscriptionId, this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets details about a specified subscription. - * - * @param subscriptionId The ID of the target subscription. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return details about a specified subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String subscriptionId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (subscriptionId == null) { - return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), subscriptionId, this.client.getApiVersion(), accept, context); - } - - /** - * Gets details about a specified subscription. - * - * @param subscriptionId The ID of the target subscription. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return details about a specified subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync(String subscriptionId) { - return getWithResponseAsync(subscriptionId) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets details about a specified subscription. - * - * @param subscriptionId The ID of the target subscription. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return details about a specified subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SubscriptionInner get(String subscriptionId) { - return getAsync(subscriptionId).block(); - } - - /** - * Gets details about a specified subscription. - * - * @param subscriptionId The ID of the target subscription. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return details about a specified subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String subscriptionId, Context context) { - return getWithResponseAsync(subscriptionId, context).block(); - } - - /** - * Gets all subscriptions for a tenant. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all subscriptions for a tenant. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all subscriptions for a tenant. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all subscriptions for a tenant. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all subscriptions for a tenant. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all subscriptions for a tenant. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets all subscriptions for a tenant. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all subscriptions for a tenant. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all subscriptions for a tenant. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all subscriptions for a tenant. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Gets all subscriptions for a tenant. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all subscriptions for a tenant. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return subscription list operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return subscription list operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/SubscriptionsImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/SubscriptionsImpl.java deleted file mode 100644 index e21ef9a91cd7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/SubscriptionsImpl.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.resources.models.Subscription; -import com.azure.resourcemanager.resources.models.Subscriptions; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.SupportsGettingByIdImpl; -import com.azure.resourcemanager.resources.fluent.models.SubscriptionInner; -import com.azure.resourcemanager.resources.fluent.SubscriptionsClient; -import reactor.core.publisher.Mono; -import com.azure.resourcemanager.resources.fluentcore.utils.PagedConverter; - -/** - * The implementation of Subscriptions. - */ -public final class SubscriptionsImpl - extends SupportsGettingByIdImpl - implements Subscriptions { - private final SubscriptionsClient client; - - public SubscriptionsImpl(final SubscriptionsClient client) { - this.client = client; - } - - @Override - public PagedIterable list() { - return PagedConverter.mapPage(client.list(), inner -> wrapModel(inner)); - } - - - @Override - public Mono getByIdAsync(String id) { - return client.getAsync(id) - .map(inner -> wrapModel(inner)); - } - - @Override - public PagedFlux listAsync() { - return PagedConverter.mapPage(client.listAsync(), inner -> wrapModel(inner)); - } - - private SubscriptionImpl wrapModel(SubscriptionInner subscriptionInner) { - if (subscriptionInner == null) { - return null; - } - return new SubscriptionImpl(subscriptionInner, client); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/TagOperationsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/TagOperationsClientImpl.java deleted file mode 100644 index 88bb182ef9ad..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/TagOperationsClientImpl.java +++ /dev/null @@ -1,1452 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.resources.fluent.TagOperationsClient; -import com.azure.resourcemanager.resources.fluent.models.TagDetailsInner; -import com.azure.resourcemanager.resources.fluent.models.TagValueInner; -import com.azure.resourcemanager.resources.fluent.models.TagsResourceInner; -import com.azure.resourcemanager.resources.models.TagsListResult; -import com.azure.resourcemanager.resources.models.TagsPatchResource; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in TagOperationsClient. */ -public final class TagOperationsClientImpl implements TagOperationsClient { - private final ClientLogger logger = new ClientLogger(TagOperationsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final TagOperationsService service; - - /** The service client containing this operation class. */ - private final ResourceManagementClientImpl client; - - /** - * Initializes an instance of TagOperationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - TagOperationsClientImpl(ResourceManagementClientImpl client) { - this.service = - RestProxy.create(TagOperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for ResourceManagementClientTagOperations to be used by the proxy service - * to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "ResourceManagementCl") - private interface TagOperationsService { - @Headers({"Content-Type: application/json"}) - @Delete("/subscriptions/{subscriptionId}/tagNames/{tagName}/tagValues/{tagValue}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteValue( - @HostParam("$host") String endpoint, - @PathParam("tagName") String tagName, - @PathParam("tagValue") String tagValue, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put("/subscriptions/{subscriptionId}/tagNames/{tagName}/tagValues/{tagValue}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdateValue( - @HostParam("$host") String endpoint, - @PathParam("tagName") String tagName, - @PathParam("tagValue") String tagValue, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put("/subscriptions/{subscriptionId}/tagNames/{tagName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("tagName") String tagName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete("/subscriptions/{subscriptionId}/tagNames/{tagName}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @PathParam("tagName") String tagName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/tagNames") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put("/{scope}/providers/Microsoft.Resources/tags/default") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdateAtScope( - @HostParam("$host") String endpoint, - @PathParam(value = "scope", encoded = true) String scope, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") TagsResourceInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch("/{scope}/providers/Microsoft.Resources/tags/default") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> updateAtScope( - @HostParam("$host") String endpoint, - @PathParam(value = "scope", encoded = true) String scope, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") TagsPatchResource parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/{scope}/providers/Microsoft.Resources/tags/default") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getAtScope( - @HostParam("$host") String endpoint, - @PathParam(value = "scope", encoded = true) String scope, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete("/{scope}/providers/Microsoft.Resources/tags/default") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteAtScope( - @HostParam("$host") String endpoint, - @PathParam(value = "scope", encoded = true) String scope, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * This operation allows deleting a value from the list of predefined values for an existing predefined tag name. - * The value being deleted must not be in use as a tag value for the given tag name for any resource. - * - * @param tagName The name of the tag. - * @param tagValue The value of the tag to delete. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteValueWithResponseAsync(String tagName, String tagValue) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (tagName == null) { - return Mono.error(new IllegalArgumentException("Parameter tagName is required and cannot be null.")); - } - if (tagValue == null) { - return Mono.error(new IllegalArgumentException("Parameter tagValue is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .deleteValue( - this.client.getEndpoint(), - tagName, - tagValue, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * This operation allows deleting a value from the list of predefined values for an existing predefined tag name. - * The value being deleted must not be in use as a tag value for the given tag name for any resource. - * - * @param tagName The name of the tag. - * @param tagValue The value of the tag to delete. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteValueWithResponseAsync(String tagName, String tagValue, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (tagName == null) { - return Mono.error(new IllegalArgumentException("Parameter tagName is required and cannot be null.")); - } - if (tagValue == null) { - return Mono.error(new IllegalArgumentException("Parameter tagValue is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .deleteValue( - this.client.getEndpoint(), - tagName, - tagValue, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * This operation allows deleting a value from the list of predefined values for an existing predefined tag name. - * The value being deleted must not be in use as a tag value for the given tag name for any resource. - * - * @param tagName The name of the tag. - * @param tagValue The value of the tag to delete. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteValueAsync(String tagName, String tagValue) { - return deleteValueWithResponseAsync(tagName, tagValue).flatMap((Response res) -> Mono.empty()); - } - - /** - * This operation allows deleting a value from the list of predefined values for an existing predefined tag name. - * The value being deleted must not be in use as a tag value for the given tag name for any resource. - * - * @param tagName The name of the tag. - * @param tagValue The value of the tag to delete. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteValue(String tagName, String tagValue) { - deleteValueAsync(tagName, tagValue).block(); - } - - /** - * This operation allows deleting a value from the list of predefined values for an existing predefined tag name. - * The value being deleted must not be in use as a tag value for the given tag name for any resource. - * - * @param tagName The name of the tag. - * @param tagValue The value of the tag to delete. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteValueWithResponse(String tagName, String tagValue, Context context) { - return deleteValueWithResponseAsync(tagName, tagValue, context).block(); - } - - /** - * This operation allows adding a value to the list of predefined values for an existing predefined tag name. A tag - * value can have a maximum of 256 characters. - * - * @param tagName The name of the tag. - * @param tagValue The value of the tag to create. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return tag information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateValueWithResponseAsync(String tagName, String tagValue) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (tagName == null) { - return Mono.error(new IllegalArgumentException("Parameter tagName is required and cannot be null.")); - } - if (tagValue == null) { - return Mono.error(new IllegalArgumentException("Parameter tagValue is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdateValue( - this.client.getEndpoint(), - tagName, - tagValue, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * This operation allows adding a value to the list of predefined values for an existing predefined tag name. A tag - * value can have a maximum of 256 characters. - * - * @param tagName The name of the tag. - * @param tagValue The value of the tag to create. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return tag information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateValueWithResponseAsync( - String tagName, String tagValue, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (tagName == null) { - return Mono.error(new IllegalArgumentException("Parameter tagName is required and cannot be null.")); - } - if (tagValue == null) { - return Mono.error(new IllegalArgumentException("Parameter tagValue is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdateValue( - this.client.getEndpoint(), - tagName, - tagValue, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * This operation allows adding a value to the list of predefined values for an existing predefined tag name. A tag - * value can have a maximum of 256 characters. - * - * @param tagName The name of the tag. - * @param tagValue The value of the tag to create. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return tag information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateValueAsync(String tagName, String tagValue) { - return createOrUpdateValueWithResponseAsync(tagName, tagValue) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * This operation allows adding a value to the list of predefined values for an existing predefined tag name. A tag - * value can have a maximum of 256 characters. - * - * @param tagName The name of the tag. - * @param tagValue The value of the tag to create. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return tag information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public TagValueInner createOrUpdateValue(String tagName, String tagValue) { - return createOrUpdateValueAsync(tagName, tagValue).block(); - } - - /** - * This operation allows adding a value to the list of predefined values for an existing predefined tag name. A tag - * value can have a maximum of 256 characters. - * - * @param tagName The name of the tag. - * @param tagValue The value of the tag to create. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return tag information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateValueWithResponse(String tagName, String tagValue, Context context) { - return createOrUpdateValueWithResponseAsync(tagName, tagValue, context).block(); - } - - /** - * This operation allows adding a name to the list of predefined tag names for the given subscription. A tag name - * can have a maximum of 512 characters and is case-insensitive. Tag names cannot have the following prefixes which - * are reserved for Azure use: 'microsoft', 'azure', 'windows'. - * - * @param tagName The name of the tag to create. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return tag details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponseAsync(String tagName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (tagName == null) { - return Mono.error(new IllegalArgumentException("Parameter tagName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - tagName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * This operation allows adding a name to the list of predefined tag names for the given subscription. A tag name - * can have a maximum of 512 characters and is case-insensitive. Tag names cannot have the following prefixes which - * are reserved for Azure use: 'microsoft', 'azure', 'windows'. - * - * @param tagName The name of the tag to create. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return tag details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String tagName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (tagName == null) { - return Mono.error(new IllegalArgumentException("Parameter tagName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - tagName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * This operation allows adding a name to the list of predefined tag names for the given subscription. A tag name - * can have a maximum of 512 characters and is case-insensitive. Tag names cannot have the following prefixes which - * are reserved for Azure use: 'microsoft', 'azure', 'windows'. - * - * @param tagName The name of the tag to create. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return tag details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync(String tagName) { - return createOrUpdateWithResponseAsync(tagName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * This operation allows adding a name to the list of predefined tag names for the given subscription. A tag name - * can have a maximum of 512 characters and is case-insensitive. Tag names cannot have the following prefixes which - * are reserved for Azure use: 'microsoft', 'azure', 'windows'. - * - * @param tagName The name of the tag to create. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return tag details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public TagDetailsInner createOrUpdate(String tagName) { - return createOrUpdateAsync(tagName).block(); - } - - /** - * This operation allows adding a name to the list of predefined tag names for the given subscription. A tag name - * can have a maximum of 512 characters and is case-insensitive. Tag names cannot have the following prefixes which - * are reserved for Azure use: 'microsoft', 'azure', 'windows'. - * - * @param tagName The name of the tag to create. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return tag details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String tagName, Context context) { - return createOrUpdateWithResponseAsync(tagName, context).block(); - } - - /** - * This operation allows deleting a name from the list of predefined tag names for the given subscription. The name - * being deleted must not be in use as a tag name for any resource. All predefined values for the given name must - * have already been deleted. - * - * @param tagName The name of the tag. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String tagName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (tagName == null) { - return Mono.error(new IllegalArgumentException("Parameter tagName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - tagName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * This operation allows deleting a name from the list of predefined tag names for the given subscription. The name - * being deleted must not be in use as a tag name for any resource. All predefined values for the given name must - * have already been deleted. - * - * @param tagName The name of the tag. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String tagName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (tagName == null) { - return Mono.error(new IllegalArgumentException("Parameter tagName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - tagName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * This operation allows deleting a name from the list of predefined tag names for the given subscription. The name - * being deleted must not be in use as a tag name for any resource. All predefined values for the given name must - * have already been deleted. - * - * @param tagName The name of the tag. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String tagName) { - return deleteWithResponseAsync(tagName).flatMap((Response res) -> Mono.empty()); - } - - /** - * This operation allows deleting a name from the list of predefined tag names for the given subscription. The name - * being deleted must not be in use as a tag name for any resource. All predefined values for the given name must - * have already been deleted. - * - * @param tagName The name of the tag. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String tagName) { - deleteAsync(tagName).block(); - } - - /** - * This operation allows deleting a name from the list of predefined tag names for the given subscription. The name - * being deleted must not be in use as a tag name for any resource. All predefined values for the given name must - * have already been deleted. - * - * @param tagName The name of the tag. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String tagName, Context context) { - return deleteWithResponseAsync(tagName, context).block(); - } - - /** - * This operation performs a union of predefined tags, resource tags, resource group tags and subscription tags, and - * returns a summary of usage for each tag name and value under the given subscription. In case of a large number of - * tags, this operation may return a previously cached result. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of subscription tags. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * This operation performs a union of predefined tags, resource tags, resource group tags and subscription tags, and - * returns a summary of usage for each tag name and value under the given subscription. In case of a large number of - * tags, this operation may return a previously cached result. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of subscription tags. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * This operation performs a union of predefined tags, resource tags, resource group tags and subscription tags, and - * returns a summary of usage for each tag name and value under the given subscription. In case of a large number of - * tags, this operation may return a previously cached result. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of subscription tags. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * This operation performs a union of predefined tags, resource tags, resource group tags and subscription tags, and - * returns a summary of usage for each tag name and value under the given subscription. In case of a large number of - * tags, this operation may return a previously cached result. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of subscription tags. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * This operation performs a union of predefined tags, resource tags, resource group tags and subscription tags, and - * returns a summary of usage for each tag name and value under the given subscription. In case of a large number of - * tags, this operation may return a previously cached result. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of subscription tags. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * This operation performs a union of predefined tags, resource tags, resource group tags and subscription tags, and - * returns a summary of usage for each tag name and value under the given subscription. In case of a large number of - * tags, this operation may return a previously cached result. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of subscription tags. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The - * specified entity can have a maximum of 50 tags. - * - * @param scope The resource scope. - * @param parameters Wrapper resource for tags API requests and responses. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return wrapper resource for tags API requests and responses. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateAtScopeWithResponseAsync( - String scope, TagsResourceInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdateAtScope( - this.client.getEndpoint(), scope, this.client.getApiVersion(), parameters, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The - * specified entity can have a maximum of 50 tags. - * - * @param scope The resource scope. - * @param parameters Wrapper resource for tags API requests and responses. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return wrapper resource for tags API requests and responses. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateAtScopeWithResponseAsync( - String scope, TagsResourceInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdateAtScope( - this.client.getEndpoint(), scope, this.client.getApiVersion(), parameters, accept, context); - } - - /** - * This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The - * specified entity can have a maximum of 50 tags. - * - * @param scope The resource scope. - * @param parameters Wrapper resource for tags API requests and responses. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return wrapper resource for tags API requests and responses. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAtScopeAsync(String scope, TagsResourceInner parameters) { - return createOrUpdateAtScopeWithResponseAsync(scope, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The - * specified entity can have a maximum of 50 tags. - * - * @param scope The resource scope. - * @param parameters Wrapper resource for tags API requests and responses. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return wrapper resource for tags API requests and responses. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public TagsResourceInner createOrUpdateAtScope(String scope, TagsResourceInner parameters) { - return createOrUpdateAtScopeAsync(scope, parameters).block(); - } - - /** - * This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The - * specified entity can have a maximum of 50 tags. - * - * @param scope The resource scope. - * @param parameters Wrapper resource for tags API requests and responses. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return wrapper resource for tags API requests and responses. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateAtScopeWithResponse( - String scope, TagsResourceInner parameters, Context context) { - return createOrUpdateAtScopeWithResponseAsync(scope, parameters, context).block(); - } - - /** - * This operation allows replacing, merging or selectively deleting tags on the specified resource or subscription. - * The specified entity can have a maximum of 50 tags at the end of the operation. The 'replace' option replaces the - * entire set of existing tags with a new set. The 'merge' option allows adding tags with new names and updating the - * values of tags with existing names. The 'delete' option allows selectively deleting tags based on given names or - * name/value pairs. - * - * @param scope The resource scope. - * @param parameters Wrapper resource for tags patch API request only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return wrapper resource for tags API requests and responses. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateAtScopeWithResponseAsync( - String scope, TagsPatchResource parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updateAtScope( - this.client.getEndpoint(), scope, this.client.getApiVersion(), parameters, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * This operation allows replacing, merging or selectively deleting tags on the specified resource or subscription. - * The specified entity can have a maximum of 50 tags at the end of the operation. The 'replace' option replaces the - * entire set of existing tags with a new set. The 'merge' option allows adding tags with new names and updating the - * values of tags with existing names. The 'delete' option allows selectively deleting tags based on given names or - * name/value pairs. - * - * @param scope The resource scope. - * @param parameters Wrapper resource for tags patch API request only. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return wrapper resource for tags API requests and responses. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateAtScopeWithResponseAsync( - String scope, TagsPatchResource parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updateAtScope(this.client.getEndpoint(), scope, this.client.getApiVersion(), parameters, accept, context); - } - - /** - * This operation allows replacing, merging or selectively deleting tags on the specified resource or subscription. - * The specified entity can have a maximum of 50 tags at the end of the operation. The 'replace' option replaces the - * entire set of existing tags with a new set. The 'merge' option allows adding tags with new names and updating the - * values of tags with existing names. The 'delete' option allows selectively deleting tags based on given names or - * name/value pairs. - * - * @param scope The resource scope. - * @param parameters Wrapper resource for tags patch API request only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return wrapper resource for tags API requests and responses. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAtScopeAsync(String scope, TagsPatchResource parameters) { - return updateAtScopeWithResponseAsync(scope, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * This operation allows replacing, merging or selectively deleting tags on the specified resource or subscription. - * The specified entity can have a maximum of 50 tags at the end of the operation. The 'replace' option replaces the - * entire set of existing tags with a new set. The 'merge' option allows adding tags with new names and updating the - * values of tags with existing names. The 'delete' option allows selectively deleting tags based on given names or - * name/value pairs. - * - * @param scope The resource scope. - * @param parameters Wrapper resource for tags patch API request only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return wrapper resource for tags API requests and responses. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public TagsResourceInner updateAtScope(String scope, TagsPatchResource parameters) { - return updateAtScopeAsync(scope, parameters).block(); - } - - /** - * This operation allows replacing, merging or selectively deleting tags on the specified resource or subscription. - * The specified entity can have a maximum of 50 tags at the end of the operation. The 'replace' option replaces the - * entire set of existing tags with a new set. The 'merge' option allows adding tags with new names and updating the - * values of tags with existing names. The 'delete' option allows selectively deleting tags based on given names or - * name/value pairs. - * - * @param scope The resource scope. - * @param parameters Wrapper resource for tags patch API request only. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return wrapper resource for tags API requests and responses. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateAtScopeWithResponse( - String scope, TagsPatchResource parameters, Context context) { - return updateAtScopeWithResponseAsync(scope, parameters, context).block(); - } - - /** - * Gets the entire set of tags on a resource or subscription. - * - * @param scope The resource scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the entire set of tags on a resource or subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getAtScopeWithResponseAsync(String scope) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service.getAtScope(this.client.getEndpoint(), scope, this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the entire set of tags on a resource or subscription. - * - * @param scope The resource scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the entire set of tags on a resource or subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getAtScopeWithResponseAsync(String scope, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getAtScope(this.client.getEndpoint(), scope, this.client.getApiVersion(), accept, context); - } - - /** - * Gets the entire set of tags on a resource or subscription. - * - * @param scope The resource scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the entire set of tags on a resource or subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAtScopeAsync(String scope) { - return getAtScopeWithResponseAsync(scope) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the entire set of tags on a resource or subscription. - * - * @param scope The resource scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the entire set of tags on a resource or subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public TagsResourceInner getAtScope(String scope) { - return getAtScopeAsync(scope).block(); - } - - /** - * Gets the entire set of tags on a resource or subscription. - * - * @param scope The resource scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the entire set of tags on a resource or subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getAtScopeWithResponse(String scope, Context context) { - return getAtScopeWithResponseAsync(scope, context).block(); - } - - /** - * Deletes the entire set of tags on a resource or subscription. - * - * @param scope The resource scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteAtScopeWithResponseAsync(String scope) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .deleteAtScope(this.client.getEndpoint(), scope, this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the entire set of tags on a resource or subscription. - * - * @param scope The resource scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteAtScopeWithResponseAsync(String scope, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.deleteAtScope(this.client.getEndpoint(), scope, this.client.getApiVersion(), accept, context); - } - - /** - * Deletes the entire set of tags on a resource or subscription. - * - * @param scope The resource scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAtScopeAsync(String scope) { - return deleteAtScopeWithResponseAsync(scope).flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes the entire set of tags on a resource or subscription. - * - * @param scope The resource scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteAtScope(String scope) { - deleteAtScopeAsync(scope).block(); - } - - /** - * Deletes the entire set of tags on a resource or subscription. - * - * @param scope The resource scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteAtScopeWithResponse(String scope, Context context) { - return deleteAtScopeWithResponseAsync(scope, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of subscription tags. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of subscription tags. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/TagOperationsImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/TagOperationsImpl.java deleted file mode 100644 index 407861e24f78..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/TagOperationsImpl.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.implementation; - -import com.azure.resourcemanager.resources.ResourceManager; -import com.azure.resourcemanager.resources.fluentcore.arm.models.Resource; -import com.azure.resourcemanager.resources.models.TagOperations; -import com.azure.resourcemanager.resources.models.TagResource; -import com.azure.resourcemanager.resources.models.Tags; -import com.azure.resourcemanager.resources.models.TagsPatchOperation; -import com.azure.resourcemanager.resources.models.TagsPatchResource; -import reactor.core.publisher.Mono; - -import java.util.Map; -import java.util.Objects; -import java.util.TreeMap; - -public class TagOperationsImpl implements TagOperations { - - private final ResourceManager myManager; - - public TagOperationsImpl(ResourceManager resourceManager) { - this.myManager = resourceManager; - } - - @Override - public TagResource updateTags(Resource resource, Map tags) { - return this.updateTagsAsync(resource, tags).block(); - } - - @Override - public TagResource updateTags(String resourceId, Map tags) { - return this.updateTagsAsync(resourceId, tags).block(); - } - - @Override - public Mono updateTagsAsync(Resource resource, Map tags) { - return this.updateTagsAsync(Objects.requireNonNull(resource).id(), tags); - } - - @Override - public Mono updateTagsAsync(String resourceId, Map tags) { - TagsPatchResource parameters = new TagsPatchResource() - .withOperation(TagsPatchOperation.REPLACE) - .withProperties(new Tags().withTags(new TreeMap<>(tags))); - return this.manager().serviceClient().getTagOperations() - .updateAtScopeAsync(resourceId, parameters) - .map(TagResourceImpl::new); - } - - @Override - public ResourceManager manager() { - return this.myManager; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/TagResourceImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/TagResourceImpl.java deleted file mode 100644 index fde6bc927896..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/TagResourceImpl.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.implementation; - -import com.azure.resourcemanager.resources.fluent.models.TagsResourceInner; -import com.azure.resourcemanager.resources.models.TagResource; - -import java.util.Collections; -import java.util.Map; - -final class TagResourceImpl implements TagResource { - - private final TagsResourceInner innerObject; - - TagResourceImpl(TagsResourceInner inner) { - this.innerObject = inner; - } - - @Override - public TagsResourceInner innerModel() { - return this.innerObject; - } - - @Override - public String id() { - return this.innerModel().id(); - } - - @Override - public String name() { - return this.innerModel().name(); - } - - @Override - public String type() { - return this.innerModel().type(); - } - - @Override - public Map tags() { - return this.innerModel().properties() == null - ? Collections.emptyMap() - : Collections.unmodifiableMap(this.innerModel().properties().tags()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/TenantImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/TenantImpl.java deleted file mode 100644 index 0bc25695de27..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/TenantImpl.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.implementation; - -import com.azure.resourcemanager.resources.fluent.models.TenantIdDescriptionInner; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.IndexableWrapperImpl; -import com.azure.resourcemanager.resources.models.Tenant; - -/** - * The implementation of {@link Tenant}. - */ -final class TenantImpl extends IndexableWrapperImpl implements Tenant { - TenantImpl(TenantIdDescriptionInner innerModel) { - super(innerModel); - } - - @Override - public String tenantId() { - return innerModel().tenantId(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/TenantsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/TenantsClientImpl.java deleted file mode 100644 index 0a3f5e41b623..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/TenantsClientImpl.java +++ /dev/null @@ -1,268 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.resources.fluent.TenantsClient; -import com.azure.resourcemanager.resources.fluent.models.TenantIdDescriptionInner; -import com.azure.resourcemanager.resources.models.TenantListResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in TenantsClient. */ -public final class TenantsClientImpl implements TenantsClient { - private final ClientLogger logger = new ClientLogger(TenantsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final TenantsService service; - - /** The service client containing this operation class. */ - private final SubscriptionClientImpl client; - - /** - * Initializes an instance of TenantsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - TenantsClientImpl(SubscriptionClientImpl client) { - this.service = RestProxy.create(TenantsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SubscriptionClientTenants to be used by the proxy service to perform - * REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SubscriptionClientTe") - private interface TenantsService { - @Headers({"Content-Type: application/json"}) - @Get("/tenants") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets the tenants for your account. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the tenants for your account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the tenants for your account. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the tenants for your account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets the tenants for your account. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the tenants for your account. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets the tenants for your account. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the tenants for your account. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets the tenants for your account. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the tenants for your account. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Gets the tenants for your account. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the tenants for your account. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return tenant Ids information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return tenant Ids information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/TenantsImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/TenantsImpl.java deleted file mode 100644 index 32e19540a958..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/TenantsImpl.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.resources.models.Tenant; -import com.azure.resourcemanager.resources.models.Tenants; -import com.azure.resourcemanager.resources.fluent.models.TenantIdDescriptionInner; -import com.azure.resourcemanager.resources.fluent.TenantsClient; -import com.azure.resourcemanager.resources.fluentcore.utils.PagedConverter; - -/** - * Implementation for {@link Tenants}. - */ -public final class TenantsImpl - implements Tenants { - private final TenantsClient client; - - public TenantsImpl(final TenantsClient client) { - this.client = client; - } - - @Override - public PagedIterable list() { - return PagedConverter.mapPage(client.list(), this::wrapModel); - } - - @Override - public PagedFlux listAsync() { - return PagedConverter.mapPage(client.listAsync(), this::wrapModel); - } - - private TenantImpl wrapModel(TenantIdDescriptionInner tenantIdDescriptionInner) { - if (tenantIdDescriptionInner == null) { - return null; - } - return new TenantImpl(tenantIdDescriptionInner); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/WhatIfOperationResultImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/WhatIfOperationResultImpl.java deleted file mode 100644 index 7ab0303caca5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/WhatIfOperationResultImpl.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.implementation; - -import com.azure.core.management.exception.ManagementError; -import com.azure.resourcemanager.resources.models.WhatIfChange; -import com.azure.resourcemanager.resources.models.WhatIfOperationResult; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.WrapperImpl; -import com.azure.resourcemanager.resources.fluent.models.WhatIfOperationResultInner; - -import java.util.List; - -/** - * Implementation for {@link WhatIfOperationResult}. - */ -public class WhatIfOperationResultImpl extends - WrapperImpl - implements - WhatIfOperationResult { - - WhatIfOperationResultImpl(WhatIfOperationResultInner inner) { - super(inner); - } - - @Override - public String status() { - return this.innerModel().status(); - } - - @Override - public List changes() { - return this.innerModel().changes(); - } - - @Override - public ManagementError error() { - return this.innerModel().error(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Alias.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Alias.java deleted file mode 100644 index c4dfb395331f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Alias.java +++ /dev/null @@ -1,161 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The alias type. */ -@Fluent -public final class Alias { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Alias.class); - - /* - * The alias name. - */ - @JsonProperty(value = "name") - private String name; - - /* - * The paths for an alias. - */ - @JsonProperty(value = "paths") - private List paths; - - /* - * The type of the alias. - */ - @JsonProperty(value = "type") - private AliasType type; - - /* - * The default path for an alias. - */ - @JsonProperty(value = "defaultPath") - private String defaultPath; - - /* - * The default pattern for an alias. - */ - @JsonProperty(value = "defaultPattern") - private AliasPattern defaultPattern; - - /** - * Get the name property: The alias name. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The alias name. - * - * @param name the name value to set. - * @return the Alias object itself. - */ - public Alias withName(String name) { - this.name = name; - return this; - } - - /** - * Get the paths property: The paths for an alias. - * - * @return the paths value. - */ - public List paths() { - return this.paths; - } - - /** - * Set the paths property: The paths for an alias. - * - * @param paths the paths value to set. - * @return the Alias object itself. - */ - public Alias withPaths(List paths) { - this.paths = paths; - return this; - } - - /** - * Get the type property: The type of the alias. - * - * @return the type value. - */ - public AliasType type() { - return this.type; - } - - /** - * Set the type property: The type of the alias. - * - * @param type the type value to set. - * @return the Alias object itself. - */ - public Alias withType(AliasType type) { - this.type = type; - return this; - } - - /** - * Get the defaultPath property: The default path for an alias. - * - * @return the defaultPath value. - */ - public String defaultPath() { - return this.defaultPath; - } - - /** - * Set the defaultPath property: The default path for an alias. - * - * @param defaultPath the defaultPath value to set. - * @return the Alias object itself. - */ - public Alias withDefaultPath(String defaultPath) { - this.defaultPath = defaultPath; - return this; - } - - /** - * Get the defaultPattern property: The default pattern for an alias. - * - * @return the defaultPattern value. - */ - public AliasPattern defaultPattern() { - return this.defaultPattern; - } - - /** - * Set the defaultPattern property: The default pattern for an alias. - * - * @param defaultPattern the defaultPattern value to set. - * @return the Alias object itself. - */ - public Alias withDefaultPattern(AliasPattern defaultPattern) { - this.defaultPattern = defaultPattern; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (paths() != null) { - paths().forEach(e -> e.validate()); - } - if (defaultPattern() != null) { - defaultPattern().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/AliasPath.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/AliasPath.java deleted file mode 100644 index 3344ca7345b4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/AliasPath.java +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The type of the paths for alias. */ -@Fluent -public final class AliasPath { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AliasPath.class); - - /* - * The path of an alias. - */ - @JsonProperty(value = "path") - private String path; - - /* - * The API versions. - */ - @JsonProperty(value = "apiVersions") - private List apiVersions; - - /* - * The pattern for an alias path. - */ - @JsonProperty(value = "pattern") - private AliasPattern pattern; - - /** - * Get the path property: The path of an alias. - * - * @return the path value. - */ - public String path() { - return this.path; - } - - /** - * Set the path property: The path of an alias. - * - * @param path the path value to set. - * @return the AliasPath object itself. - */ - public AliasPath withPath(String path) { - this.path = path; - return this; - } - - /** - * Get the apiVersions property: The API versions. - * - * @return the apiVersions value. - */ - public List apiVersions() { - return this.apiVersions; - } - - /** - * Set the apiVersions property: The API versions. - * - * @param apiVersions the apiVersions value to set. - * @return the AliasPath object itself. - */ - public AliasPath withApiVersions(List apiVersions) { - this.apiVersions = apiVersions; - return this; - } - - /** - * Get the pattern property: The pattern for an alias path. - * - * @return the pattern value. - */ - public AliasPattern pattern() { - return this.pattern; - } - - /** - * Set the pattern property: The pattern for an alias path. - * - * @param pattern the pattern value to set. - * @return the AliasPath object itself. - */ - public AliasPath withPattern(AliasPattern pattern) { - this.pattern = pattern; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (pattern() != null) { - pattern().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/AliasPattern.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/AliasPattern.java deleted file mode 100644 index 420ccc2a20b4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/AliasPattern.java +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The type of the pattern for an alias path. */ -@Fluent -public final class AliasPattern { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AliasPattern.class); - - /* - * The alias pattern phrase. - */ - @JsonProperty(value = "phrase") - private String phrase; - - /* - * The alias pattern variable. - */ - @JsonProperty(value = "variable") - private String variable; - - /* - * The type of alias pattern - */ - @JsonProperty(value = "type") - private AliasPatternType type; - - /** - * Get the phrase property: The alias pattern phrase. - * - * @return the phrase value. - */ - public String phrase() { - return this.phrase; - } - - /** - * Set the phrase property: The alias pattern phrase. - * - * @param phrase the phrase value to set. - * @return the AliasPattern object itself. - */ - public AliasPattern withPhrase(String phrase) { - this.phrase = phrase; - return this; - } - - /** - * Get the variable property: The alias pattern variable. - * - * @return the variable value. - */ - public String variable() { - return this.variable; - } - - /** - * Set the variable property: The alias pattern variable. - * - * @param variable the variable value to set. - * @return the AliasPattern object itself. - */ - public AliasPattern withVariable(String variable) { - this.variable = variable; - return this; - } - - /** - * Get the type property: The type of alias pattern. - * - * @return the type value. - */ - public AliasPatternType type() { - return this.type; - } - - /** - * Set the type property: The type of alias pattern. - * - * @param type the type value to set. - * @return the AliasPattern object itself. - */ - public AliasPattern withType(AliasPatternType type) { - this.type = type; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/AliasPatternType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/AliasPatternType.java deleted file mode 100644 index 09b9063dce86..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/AliasPatternType.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for AliasPatternType. */ -public enum AliasPatternType { - /** Enum value NotSpecified. */ - NOT_SPECIFIED("NotSpecified"), - - /** Enum value Extract. */ - EXTRACT("Extract"); - - /** The actual serialized value for a AliasPatternType instance. */ - private final String value; - - AliasPatternType(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a AliasPatternType instance. - * - * @param value the serialized value to parse. - * @return the parsed AliasPatternType object, or null if unable to parse. - */ - @JsonCreator - public static AliasPatternType fromString(String value) { - AliasPatternType[] items = AliasPatternType.values(); - for (AliasPatternType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/AliasType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/AliasType.java deleted file mode 100644 index be9c852e93e0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/AliasType.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for AliasType. */ -public enum AliasType { - /** Enum value NotSpecified. */ - NOT_SPECIFIED("NotSpecified"), - - /** Enum value PlainText. */ - PLAIN_TEXT("PlainText"), - - /** Enum value Mask. */ - MASK("Mask"); - - /** The actual serialized value for a AliasType instance. */ - private final String value; - - AliasType(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a AliasType instance. - * - * @param value the serialized value to parse. - * @return the parsed AliasType object, or null if unable to parse. - */ - @JsonCreator - public static AliasType fromString(String value) { - AliasType[] items = AliasType.values(); - for (AliasType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/BasicDependency.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/BasicDependency.java deleted file mode 100644 index f0dcc3cf2050..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/BasicDependency.java +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Deployment dependency information. */ -@Fluent -public final class BasicDependency { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BasicDependency.class); - - /* - * The ID of the dependency. - */ - @JsonProperty(value = "id") - private String id; - - /* - * The dependency resource type. - */ - @JsonProperty(value = "resourceType") - private String resourceType; - - /* - * The dependency resource name. - */ - @JsonProperty(value = "resourceName") - private String resourceName; - - /** - * Get the id property: The ID of the dependency. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: The ID of the dependency. - * - * @param id the id value to set. - * @return the BasicDependency object itself. - */ - public BasicDependency withId(String id) { - this.id = id; - return this; - } - - /** - * Get the resourceType property: The dependency resource type. - * - * @return the resourceType value. - */ - public String resourceType() { - return this.resourceType; - } - - /** - * Set the resourceType property: The dependency resource type. - * - * @param resourceType the resourceType value to set. - * @return the BasicDependency object itself. - */ - public BasicDependency withResourceType(String resourceType) { - this.resourceType = resourceType; - return this; - } - - /** - * Get the resourceName property: The dependency resource name. - * - * @return the resourceName value. - */ - public String resourceName() { - return this.resourceName; - } - - /** - * Set the resourceName property: The dependency resource name. - * - * @param resourceName the resourceName value to set. - * @return the BasicDependency object itself. - */ - public BasicDependency withResourceName(String resourceName) { - this.resourceName = resourceName; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ChangeType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ChangeType.java deleted file mode 100644 index f6a3bd4ff403..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ChangeType.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for ChangeType. */ -public enum ChangeType { - /** Enum value Create. */ - CREATE("Create"), - - /** Enum value Delete. */ - DELETE("Delete"), - - /** Enum value Ignore. */ - IGNORE("Ignore"), - - /** Enum value Deploy. */ - DEPLOY("Deploy"), - - /** Enum value NoChange. */ - NO_CHANGE("NoChange"), - - /** Enum value Modify. */ - MODIFY("Modify"); - - /** The actual serialized value for a ChangeType instance. */ - private final String value; - - ChangeType(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a ChangeType instance. - * - * @param value the serialized value to parse. - * @return the parsed ChangeType object, or null if unable to parse. - */ - @JsonCreator - public static ChangeType fromString(String value) { - ChangeType[] items = ChangeType.values(); - for (ChangeType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DebugSetting.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DebugSetting.java deleted file mode 100644 index 673111429301..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DebugSetting.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The debug setting. */ -@Fluent -public final class DebugSetting { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DebugSetting.class); - - /* - * Specifies the type of information to log for debugging. The permitted - * values are none, requestContent, responseContent, or both requestContent - * and responseContent separated by a comma. The default is none. When - * setting this value, carefully consider the type of information you are - * passing in during deployment. By logging information about the request - * or response, you could potentially expose sensitive data that is - * retrieved through the deployment operations. - */ - @JsonProperty(value = "detailLevel") - private String detailLevel; - - /** - * Get the detailLevel property: Specifies the type of information to log for debugging. The permitted values are - * none, requestContent, responseContent, or both requestContent and responseContent separated by a comma. The - * default is none. When setting this value, carefully consider the type of information you are passing in during - * deployment. By logging information about the request or response, you could potentially expose sensitive data - * that is retrieved through the deployment operations. - * - * @return the detailLevel value. - */ - public String detailLevel() { - return this.detailLevel; - } - - /** - * Set the detailLevel property: Specifies the type of information to log for debugging. The permitted values are - * none, requestContent, responseContent, or both requestContent and responseContent separated by a comma. The - * default is none. When setting this value, carefully consider the type of information you are passing in during - * deployment. By logging information about the request or response, you could potentially expose sensitive data - * that is retrieved through the deployment operations. - * - * @param detailLevel the detailLevel value to set. - * @return the DebugSetting object itself. - */ - public DebugSetting withDetailLevel(String detailLevel) { - this.detailLevel = detailLevel; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Dependency.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Dependency.java deleted file mode 100644 index c41c7c6ff376..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Dependency.java +++ /dev/null @@ -1,132 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Deployment dependency information. */ -@Fluent -public final class Dependency { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Dependency.class); - - /* - * The list of dependencies. - */ - @JsonProperty(value = "dependsOn") - private List dependsOn; - - /* - * The ID of the dependency. - */ - @JsonProperty(value = "id") - private String id; - - /* - * The dependency resource type. - */ - @JsonProperty(value = "resourceType") - private String resourceType; - - /* - * The dependency resource name. - */ - @JsonProperty(value = "resourceName") - private String resourceName; - - /** - * Get the dependsOn property: The list of dependencies. - * - * @return the dependsOn value. - */ - public List dependsOn() { - return this.dependsOn; - } - - /** - * Set the dependsOn property: The list of dependencies. - * - * @param dependsOn the dependsOn value to set. - * @return the Dependency object itself. - */ - public Dependency withDependsOn(List dependsOn) { - this.dependsOn = dependsOn; - return this; - } - - /** - * Get the id property: The ID of the dependency. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: The ID of the dependency. - * - * @param id the id value to set. - * @return the Dependency object itself. - */ - public Dependency withId(String id) { - this.id = id; - return this; - } - - /** - * Get the resourceType property: The dependency resource type. - * - * @return the resourceType value. - */ - public String resourceType() { - return this.resourceType; - } - - /** - * Set the resourceType property: The dependency resource type. - * - * @param resourceType the resourceType value to set. - * @return the Dependency object itself. - */ - public Dependency withResourceType(String resourceType) { - this.resourceType = resourceType; - return this; - } - - /** - * Get the resourceName property: The dependency resource name. - * - * @return the resourceName value. - */ - public String resourceName() { - return this.resourceName; - } - - /** - * Set the resourceName property: The dependency resource name. - * - * @param resourceName the resourceName value to set. - * @return the Dependency object itself. - */ - public Dependency withResourceName(String resourceName) { - this.resourceName = resourceName; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (dependsOn() != null) { - dependsOn().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Deployment.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Deployment.java deleted file mode 100644 index 32088f71222b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Deployment.java +++ /dev/null @@ -1,599 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Region; -import com.azure.core.management.exception.ManagementError; -import com.azure.core.util.Context; -import com.azure.resourcemanager.resources.fluentcore.arm.models.GroupableResource; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasId; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasName; -import com.azure.resourcemanager.resources.fluentcore.model.Accepted; -import com.azure.resourcemanager.resources.fluentcore.model.Appliable; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.model.Indexable; -import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; -import com.azure.resourcemanager.resources.fluentcore.model.Updatable; -import com.azure.resourcemanager.resources.ResourceManager; -import com.azure.resourcemanager.resources.fluent.models.DeploymentExtendedInner; -import reactor.core.publisher.Mono; - -import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.List; - -/** - * An immutable client-side representation of an Azure deployment. - */ -@Fluent -public interface Deployment extends - Indexable, - Refreshable, - Updatable, - HasInnerModel, - HasManager, - HasName, - HasId { - - /** - * @return the name of this deployment's resource group - */ - String resourceGroupName(); - - /** - * @return the state of the provisioning process of the resources being deployed - */ - String provisioningState(); - - /** - * @return the correlation ID of the deployment - */ - String correlationId(); - - /** - * @return the timestamp of the template deployment - */ - OffsetDateTime timestamp(); - - /** - * @return key/value pairs that represent deployment output - */ - Object outputs(); - - /** - * @return the list of resource providers needed for the deployment - */ - List providers(); - - /** - * @return the list of deployment dependencies - */ - List dependencies(); - - /** - * @return the hash produced for the template - */ - String templateHash(); - - /** - * @return the URI referencing the template - */ - TemplateLink templateLink(); - - /** - * @return the deployment parameters - */ - Object parameters(); - - /** - * @return the URI referencing the parameters - */ - ParametersLink parametersLink(); - - /** - * @return the deployment mode. Possible values include: - * 'Incremental', 'Complete'. - */ - DeploymentMode mode(); - - /** - * @return the {@link ManagementError}, if deployment fails. - */ - ManagementError error(); - - /** - * Get array of provisioned resources. - * - * @return the outputResources value - */ - List outputResources(); - - /** - * @return the operations related to this deployment - */ - DeploymentOperations deploymentOperations(); - - /** - * Cancel a currently running template deployment. - */ - void cancel(); - - /** - * Cancel a currently running template deployment asynchronously. - * - * @return a representation of the deferred computation of this call - */ - Mono cancelAsync(); - - /** - * Exports a deployment template. - * - * @return the export result - */ - DeploymentExportResult exportTemplate(); - - /** - * Exports a deployment template asynchronously. - * - * @return a representation of the deferred computation of this call returning the export result - */ - Mono exportTemplateAsync(); - - /** - * Prepares a What-if operation. - * - * @return the What-if execution. - */ - Execution prepareWhatIf(); - - /** - * Container interface for all the deployment definitions. - */ - interface Definition extends - DefinitionStages.Blank, - DefinitionStages.WithGroup, - DefinitionStages.WithTemplate, - DefinitionStages.WithParameters, - DefinitionStages.WithMode, - DefinitionStages.WithCreate { - } - - /** - * Grouping of all the deployment definition stages. - */ - interface DefinitionStages { - /** - * The first stage of deployment definition. - */ - interface Blank extends DefinitionStages.WithGroup { - } - - /** - * A deployment definition allowing resource group to be specified. - */ - interface WithGroup extends GroupableResource.DefinitionStages.WithExistingResourceGroup { - /** - * Creates a new resource group to put the deployment in. - * - * @param name the name of the new group - * @param region the region to create the resource group in - * @return the next stage of the definition - */ - WithTemplate withNewResourceGroup(String name, Region region); - - /** - * Creates a new resource group to put the resource in, based on the definition specified. - * - * @param groupDefinition a creatable definition for a new resource group - * @return the next stage of the definition - */ - WithTemplate withNewResourceGroup(Creatable groupDefinition); - } - - /** - * A deployment definition allowing the template to be specified. - */ - interface WithTemplate { - /** - * Specifies the template as a Java object. - * - * @param template the Java object - * @return the next stage of the definition - */ - WithParameters withTemplate(Object template); - - /** - * Specifies the template as a JSON string. - * - * @param templateJson the JSON string - * @return the next stage of the definition - * @throws IOException exception thrown from serialization/deserialization - */ - WithParameters withTemplate(String templateJson) throws IOException; - - /** - * Specifies the template as a URL. - * - * @param uri the location of the remote template file - * @param contentVersion the version of the template file - * @return the next stage of the definition - */ - WithParameters withTemplateLink(String uri, String contentVersion); - } - - /** - * A deployment definition allowing the parameters to be specified. - */ - interface WithParameters { - /** - * Specifies the parameters as a Java object. - * - * @param parameters the Java object - * @return the next stage of the definition - */ - WithMode withParameters(Object parameters); - - /** - * Specifies the parameters as a JSON string. - * - * @param parametersJson the JSON string - * @return the next stage of the definition - * @throws IOException exception thrown from serialization/deserialization - */ - WithMode withParameters(String parametersJson) throws IOException; - - /** - * Specifies the parameters as a URL. - * - * @param uri the location of the remote parameters file - * @param contentVersion the version of the parameters file - * @return the next stage of the definition - */ - WithMode withParametersLink(String uri, String contentVersion); - } - - /** - * A deployment definition allowing the deployment mode to be specified. - */ - interface WithMode { - /** - * Specifies the deployment mode. - * - * @param mode the mode of the deployment - * @return the next stage of the definition - */ - WithCreate withMode(DeploymentMode mode); - } - - /** - * A deployment definition with sufficient inputs to create a new - * deployment in the cloud, but exposing additional optional inputs to specify. - */ - interface WithCreate extends Creatable { - /** - * Begins creating the deployment resource. - * - * @return the accepted create operation - */ - Accepted beginCreate(); - - /** - * Begins creating the deployment resource. - * - * @param context the {@link Context} of the request - * @return the accepted create operation - */ - Accepted beginCreate(Context context); - - /** - * Begins creating the deployment resource. - * - * @return the publisher of the accepted create operation - */ - Mono beginCreateAsync(); - } - } - - /** - * Grouping of all the deployment updates stages. - */ - interface UpdateStages { - /** - * A deployment update allowing to change the deployment mode. - */ - interface WithMode { - /** - * Specifies the deployment mode. - * - * @param mode the mode of the deployment - * @return the next stage of the deployment update - */ - Update withMode(DeploymentMode mode); - } - - /** - * A deployment update allowing to change the template. - */ - interface WithTemplate { - /** - * Specifies the template as a Java object. - * - * @param template the Java object - * @return the next stage of the deployment update - */ - Update withTemplate(Object template); - - /** - * Specifies the template as a JSON string. - * - * @param templateJson the JSON string - * @return the next stage of the deployment update - * @throws IOException exception thrown from serialization/deserialization - */ - Update withTemplate(String templateJson) throws IOException; - - /** - * Specifies the template as a URL. - * - * @param uri the location of the remote template file - * @param contentVersion the version of the template file - * @return the next stage of the deployment update - */ - Update withTemplateLink(String uri, String contentVersion); - } - - /** - * A deployment update allowing to change the parameters. - */ - interface WithParameters { - /** - * Specifies the parameters as a Java object. - * - * @param parameters the Java object - * @return the next stage of the deployment update - */ - Update withParameters(Object parameters); - - /** - * Specifies the parameters as a JSON string. - * - * @param parametersJson the JSON string - * @return the next stage of the deployment update - * @throws IOException exception thrown from serialization/deserialization - */ - Update withParameters(String parametersJson) throws IOException; - - /** - * Specifies the parameters as a URL. - * - * @param uri the location of the remote parameters file - * @param contentVersion the version of the parameters file - * @return the next stage of the deployment update - */ - Update withParametersLink(String uri, String contentVersion); - } - } - - /** - * The template for a deployment update operation, containing all the settings that - * can be modified. - *

    - * Call {@link Update#apply()} to apply the changes to the deployment in Azure. - */ - interface Update extends - Appliable, - UpdateStages.WithTemplate, - UpdateStages.WithParameters, - UpdateStages.WithMode { - } - - /** - * Container interface for all the deployment execution. - */ - interface Execution extends - ExecutionStages.Blank, - ExecutionStages.WithExecute, - ExecutionStages.WithWhatIf, - ExecutionStages.WithWhatIfDeploymentMode, - ExecutionStages.WithWhatIfLocation, - ExecutionStages.WithWhatIfOnErrorDeploymentType, - ExecutionStages.WithWhatIfParameter, - ExecutionStages.WithWhatIfResultFormat, - ExecutionStages.WithWhatIfTemplate { - } - - /** - * Grouping of all the deployment execution stages. - */ - interface ExecutionStages { - /** - * The first stage of deployment execution. - */ - interface Blank { - } - - /** - * A deployment execution allowing What-if parameters to be specified. - */ - interface WithWhatIf extends - WithExecute, - WithWhatIfDeploymentMode, - WithWhatIfLocation, - WithWhatIfOnErrorDeploymentType, - WithWhatIfParameter, - WithWhatIfResultFormat, - WithWhatIfTemplate { - /** - * Specifies the type of information to log for debugging. - * - * @param detailedLevel the detailed value to set. - * @return the next stage of the execution. - */ - WithWhatIf withDetailedLevel(String detailedLevel); - - /** - * Specifies the deployment name to be used on error cases. - * - * @param deploymentName the deployment name to set. - * @return the next stage of the execution. - */ - WithWhatIf withDeploymentName(String deploymentName); - } - - /** - * A deployment execution allowing data storage location to be specified. - */ - interface WithWhatIfLocation { - /** - * Specifies the location to store the deployment data. - * - * @param location the location value to set. - * @return the next stage of the execution. - */ - WithWhatIf withLocation(String location); - } - - /** - * A deployment execution allowing deployment mode to be specified. - */ - interface WithWhatIfDeploymentMode { - /** - * Specifies the mode with value of 'INCREMENTAL' in deployment properties. - * - * @return the next stage of the execution. - */ - WithWhatIf withIncrementalMode(); - - /** - * Specifies the mode with value of 'COMPLETE' in deployment properties. - * - * @return the next stage of the execution. - */ - WithWhatIf withCompleteMode(); - } - - /** - * A deployment execution allowing result format to be specified. - */ - interface WithWhatIfResultFormat { - /** - * Specifies the result format with value of 'FULL_RESOURCE_PAYLOADS' - * in What-if settings of deployment properties. - * - * @return the next stage of the execution. - */ - WithWhatIf withFullResourcePayloadsResultFormat(); - - /** - * Specifies the result format with value of 'RESOURCE_ID_ONLY' - * in What-if settings of deployment properties. - * - * @return the next stage of the execution. - */ - WithWhatIf withResourceIdOnlyResultFormat(); - } - - /** - * A deployment execution allowing template to be specified. - */ - interface WithWhatIfTemplate { - /** - * Specifies the template content. - * - * @param template the template value to set. - * @return the next stage of the execution. - */ - WithWhatIf withWhatIfTemplate(Object template); - - /** - * Specifies the uri and content version of template. - * - * @param uri the uri value to set. - * @param contentVersion the content version value to set. - * @return the next stage of the execution. - */ - WithWhatIf withWhatIfTemplateLink(String uri, String contentVersion); - } - - /** - * A deployment execution allowing parameter to be specified. - */ - interface WithWhatIfParameter { - /** - * Specifies the name and value pairs that define the deployment parameters for the template. - * - * @param parameters the parameters value to set. - * @return the next stage of the execution. - */ - WithWhatIf withWhatIfParameters(Object parameters); - - /** - * Specifies the uri and content version of parameters file. - * - * @param uri the uri value to set. - * @param contentVersion the content version value to set. - * @return the next stage of the execution. - */ - WithWhatIf withWhatIfParametersLink(String uri, String contentVersion); - } - - /** - * A deployment execution allowing on error deployment type to be specified. - */ - interface WithWhatIfOnErrorDeploymentType { - /** - * Specifies the What-if deployment on error behavior type with value of 'LAST_SUCCESSFUL'. - * - * @return the next stage of the execution. - */ - WithWhatIf withLastSuccessfulOnErrorDeployment(); - - /** - * Specifies the What-if deployment on error behavior type with value of 'SPECIFIC_DEPLOYMENT'. - * - * @return the next stage of the execution. - */ - WithWhatIf withSpecialDeploymentOnErrorDeployment(); - } - - /** - * A deployment definition allowing the execution to be specified. - */ - interface WithExecute { - /** - * Gets changes that will be made by the deployment if executed at the scope of the resource group. - * - * @return the next stage of the execution. - */ - WhatIfOperationResult whatIf(); - - /** - * Gets changes that will be made by the deployment - * if executed at the scope of the resource group asynchronously. - * - * @return the next stage of the execution. - */ - Mono whatIfAsync(); - - - /** - * Gets changes that will be made by the deployment if executed at the scope of the subscription. - * - * @return the next stage of the execution. - */ - WhatIfOperationResult whatIfAtSubscriptionScope(); - - /** - * Gets changes that will be made by the deployment - * if executed at the scope of the subscription asynchronously. - * - * @return the next stage of the execution. - */ - Mono whatIfAtSubscriptionScopeAsync(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentExportResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentExportResult.java deleted file mode 100644 index 32d8a54af102..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentExportResult.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluent.models.DeploymentExportResultInner; - -/** - * An immutable client-side representation of an Azure deployment template export result. - */ -@Fluent -public interface DeploymentExportResult extends - HasInnerModel { - - /** - * @return the template content - */ - Object template(); - - /** - * @return the template content as a JSON string - */ - String templateAsJson(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentListResult.java deleted file mode 100644 index 5d5d36915e63..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentListResult.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.resources.fluent.models.DeploymentExtendedInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** List of deployments. */ -@Fluent -public final class DeploymentListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DeploymentListResult.class); - - /* - * An array of deployments. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to use for getting the next set of results. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: An array of deployments. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: An array of deployments. - * - * @param value the value value to set. - * @return the DeploymentListResult object itself. - */ - public DeploymentListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to use for getting the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentMode.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentMode.java deleted file mode 100644 index ad4051d57c15..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentMode.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for DeploymentMode. */ -public enum DeploymentMode { - /** Enum value Incremental. */ - INCREMENTAL("Incremental"), - - /** Enum value Complete. */ - COMPLETE("Complete"); - - /** The actual serialized value for a DeploymentMode instance. */ - private final String value; - - DeploymentMode(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a DeploymentMode instance. - * - * @param value the serialized value to parse. - * @return the parsed DeploymentMode object, or null if unable to parse. - */ - @JsonCreator - public static DeploymentMode fromString(String value) { - DeploymentMode[] items = DeploymentMode.values(); - for (DeploymentMode item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentOperation.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentOperation.java deleted file mode 100644 index 9c8a5721d6cd..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentOperation.java +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.model.Indexable; -import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; -import com.azure.resourcemanager.resources.fluent.models.DeploymentOperationInner; - -import java.time.OffsetDateTime; - -/** - * An immutable client-side representation of a deployment operation. - */ -@Fluent -public interface DeploymentOperation extends - Indexable, - Refreshable, - HasInnerModel { - - /** - * @return the deployment operation id - */ - String operationId(); - - /** - * @return the state of the provisioning resource being deployed - */ - String provisioningState(); - - /** - * - * @return the name of the current provisioning operation - */ - ProvisioningOperation provisioningOperation(); - - /** - * @return the date and time of the operation - */ - OffsetDateTime timestamp(); - - /** - * @return the operation status code.= - */ - String statusCode(); - - /** - * @return the operation status message - */ - Object statusMessage(); - - /** - * @return the target resource - */ - TargetResource targetResource(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentOperationProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentOperationProperties.java deleted file mode 100644 index 23e54966bd2c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentOperationProperties.java +++ /dev/null @@ -1,184 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** Deployment operation properties. */ -@Immutable -public final class DeploymentOperationProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DeploymentOperationProperties.class); - - /* - * The name of the current provisioning operation. - */ - @JsonProperty(value = "provisioningOperation", access = JsonProperty.Access.WRITE_ONLY) - private ProvisioningOperation provisioningOperation; - - /* - * The state of the provisioning. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; - - /* - * The date and time of the operation. - */ - @JsonProperty(value = "timestamp", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime timestamp; - - /* - * The duration of the operation. - */ - @JsonProperty(value = "duration", access = JsonProperty.Access.WRITE_ONLY) - private String duration; - - /* - * Deployment operation service request id. - */ - @JsonProperty(value = "serviceRequestId", access = JsonProperty.Access.WRITE_ONLY) - private String serviceRequestId; - - /* - * Operation status code. - */ - @JsonProperty(value = "statusCode", access = JsonProperty.Access.WRITE_ONLY) - private String statusCode; - - /* - * Operation status message. - */ - @JsonProperty(value = "statusMessage", access = JsonProperty.Access.WRITE_ONLY) - private Object statusMessage; - - /* - * The target resource. - */ - @JsonProperty(value = "targetResource", access = JsonProperty.Access.WRITE_ONLY) - private TargetResource targetResource; - - /* - * The HTTP request message. - */ - @JsonProperty(value = "request", access = JsonProperty.Access.WRITE_ONLY) - private HttpMessage request; - - /* - * The HTTP response message. - */ - @JsonProperty(value = "response", access = JsonProperty.Access.WRITE_ONLY) - private HttpMessage response; - - /** - * Get the provisioningOperation property: The name of the current provisioning operation. - * - * @return the provisioningOperation value. - */ - public ProvisioningOperation provisioningOperation() { - return this.provisioningOperation; - } - - /** - * Get the provisioningState property: The state of the provisioning. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Get the timestamp property: The date and time of the operation. - * - * @return the timestamp value. - */ - public OffsetDateTime timestamp() { - return this.timestamp; - } - - /** - * Get the duration property: The duration of the operation. - * - * @return the duration value. - */ - public String duration() { - return this.duration; - } - - /** - * Get the serviceRequestId property: Deployment operation service request id. - * - * @return the serviceRequestId value. - */ - public String serviceRequestId() { - return this.serviceRequestId; - } - - /** - * Get the statusCode property: Operation status code. - * - * @return the statusCode value. - */ - public String statusCode() { - return this.statusCode; - } - - /** - * Get the statusMessage property: Operation status message. - * - * @return the statusMessage value. - */ - public Object statusMessage() { - return this.statusMessage; - } - - /** - * Get the targetResource property: The target resource. - * - * @return the targetResource value. - */ - public TargetResource targetResource() { - return this.targetResource; - } - - /** - * Get the request property: The HTTP request message. - * - * @return the request value. - */ - public HttpMessage request() { - return this.request; - } - - /** - * Get the response property: The HTTP response message. - * - * @return the response value. - */ - public HttpMessage response() { - return this.response; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (targetResource() != null) { - targetResource().validate(); - } - if (request() != null) { - request().validate(); - } - if (response() != null) { - response().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentOperations.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentOperations.java deleted file mode 100644 index 6a8fa0ca6e91..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentOperations.java +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; - -/** - * Entry point to deployment operation management API. - */ -@Fluent -public interface DeploymentOperations extends - SupportsListing, - SupportsGettingById { -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentOperationsListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentOperationsListResult.java deleted file mode 100644 index ef2381822c62..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentOperationsListResult.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.resources.fluent.models.DeploymentOperationInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** List of deployment operations. */ -@Fluent -public final class DeploymentOperationsListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DeploymentOperationsListResult.class); - - /* - * An array of deployment operations. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to use for getting the next set of results. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: An array of deployment operations. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: An array of deployment operations. - * - * @param value the value value to set. - * @return the DeploymentOperationsListResult object itself. - */ - public DeploymentOperationsListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to use for getting the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentProperties.java deleted file mode 100644 index d72b6ed9ee2a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentProperties.java +++ /dev/null @@ -1,261 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Deployment properties. */ -@Fluent -public class DeploymentProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DeploymentProperties.class); - - /* - * The template content. You use this element when you want to pass the - * template syntax directly in the request rather than link to an existing - * template. It can be a JObject or well-formed JSON string. Use either the - * templateLink property or the template property, but not both. - */ - @JsonProperty(value = "template") - private Object template; - - /* - * The URI of the template. Use either the templateLink property or the - * template property, but not both. - */ - @JsonProperty(value = "templateLink") - private TemplateLink templateLink; - - /* - * Name and value pairs that define the deployment parameters for the - * template. You use this element when you want to provide the parameter - * values directly in the request rather than link to an existing parameter - * file. Use either the parametersLink property or the parameters property, - * but not both. It can be a JObject or a well formed JSON string. - */ - @JsonProperty(value = "parameters") - private Object parameters; - - /* - * The URI of parameters file. You use this element to link to an existing - * parameters file. Use either the parametersLink property or the - * parameters property, but not both. - */ - @JsonProperty(value = "parametersLink") - private ParametersLink parametersLink; - - /* - * The mode that is used to deploy resources. This value can be either - * Incremental or Complete. In Incremental mode, resources are deployed - * without deleting existing resources that are not included in the - * template. In Complete mode, resources are deployed and existing - * resources in the resource group that are not included in the template - * are deleted. Be careful when using Complete mode as you may - * unintentionally delete resources. - */ - @JsonProperty(value = "mode", required = true) - private DeploymentMode mode; - - /* - * The debug setting of the deployment. - */ - @JsonProperty(value = "debugSetting") - private DebugSetting debugSetting; - - /* - * The deployment on error behavior. - */ - @JsonProperty(value = "onErrorDeployment") - private OnErrorDeployment onErrorDeployment; - - /** - * Get the template property: The template content. You use this element when you want to pass the template syntax - * directly in the request rather than link to an existing template. It can be a JObject or well-formed JSON string. - * Use either the templateLink property or the template property, but not both. - * - * @return the template value. - */ - public Object template() { - return this.template; - } - - /** - * Set the template property: The template content. You use this element when you want to pass the template syntax - * directly in the request rather than link to an existing template. It can be a JObject or well-formed JSON string. - * Use either the templateLink property or the template property, but not both. - * - * @param template the template value to set. - * @return the DeploymentProperties object itself. - */ - public DeploymentProperties withTemplate(Object template) { - this.template = template; - return this; - } - - /** - * Get the templateLink property: The URI of the template. Use either the templateLink property or the template - * property, but not both. - * - * @return the templateLink value. - */ - public TemplateLink templateLink() { - return this.templateLink; - } - - /** - * Set the templateLink property: The URI of the template. Use either the templateLink property or the template - * property, but not both. - * - * @param templateLink the templateLink value to set. - * @return the DeploymentProperties object itself. - */ - public DeploymentProperties withTemplateLink(TemplateLink templateLink) { - this.templateLink = templateLink; - return this; - } - - /** - * Get the parameters property: Name and value pairs that define the deployment parameters for the template. You use - * this element when you want to provide the parameter values directly in the request rather than link to an - * existing parameter file. Use either the parametersLink property or the parameters property, but not both. It can - * be a JObject or a well formed JSON string. - * - * @return the parameters value. - */ - public Object parameters() { - return this.parameters; - } - - /** - * Set the parameters property: Name and value pairs that define the deployment parameters for the template. You use - * this element when you want to provide the parameter values directly in the request rather than link to an - * existing parameter file. Use either the parametersLink property or the parameters property, but not both. It can - * be a JObject or a well formed JSON string. - * - * @param parameters the parameters value to set. - * @return the DeploymentProperties object itself. - */ - public DeploymentProperties withParameters(Object parameters) { - this.parameters = parameters; - return this; - } - - /** - * Get the parametersLink property: The URI of parameters file. You use this element to link to an existing - * parameters file. Use either the parametersLink property or the parameters property, but not both. - * - * @return the parametersLink value. - */ - public ParametersLink parametersLink() { - return this.parametersLink; - } - - /** - * Set the parametersLink property: The URI of parameters file. You use this element to link to an existing - * parameters file. Use either the parametersLink property or the parameters property, but not both. - * - * @param parametersLink the parametersLink value to set. - * @return the DeploymentProperties object itself. - */ - public DeploymentProperties withParametersLink(ParametersLink parametersLink) { - this.parametersLink = parametersLink; - return this; - } - - /** - * Get the mode property: The mode that is used to deploy resources. This value can be either Incremental or - * Complete. In Incremental mode, resources are deployed without deleting existing resources that are not included - * in the template. In Complete mode, resources are deployed and existing resources in the resource group that are - * not included in the template are deleted. Be careful when using Complete mode as you may unintentionally delete - * resources. - * - * @return the mode value. - */ - public DeploymentMode mode() { - return this.mode; - } - - /** - * Set the mode property: The mode that is used to deploy resources. This value can be either Incremental or - * Complete. In Incremental mode, resources are deployed without deleting existing resources that are not included - * in the template. In Complete mode, resources are deployed and existing resources in the resource group that are - * not included in the template are deleted. Be careful when using Complete mode as you may unintentionally delete - * resources. - * - * @param mode the mode value to set. - * @return the DeploymentProperties object itself. - */ - public DeploymentProperties withMode(DeploymentMode mode) { - this.mode = mode; - return this; - } - - /** - * Get the debugSetting property: The debug setting of the deployment. - * - * @return the debugSetting value. - */ - public DebugSetting debugSetting() { - return this.debugSetting; - } - - /** - * Set the debugSetting property: The debug setting of the deployment. - * - * @param debugSetting the debugSetting value to set. - * @return the DeploymentProperties object itself. - */ - public DeploymentProperties withDebugSetting(DebugSetting debugSetting) { - this.debugSetting = debugSetting; - return this; - } - - /** - * Get the onErrorDeployment property: The deployment on error behavior. - * - * @return the onErrorDeployment value. - */ - public OnErrorDeployment onErrorDeployment() { - return this.onErrorDeployment; - } - - /** - * Set the onErrorDeployment property: The deployment on error behavior. - * - * @param onErrorDeployment the onErrorDeployment value to set. - * @return the DeploymentProperties object itself. - */ - public DeploymentProperties withOnErrorDeployment(OnErrorDeployment onErrorDeployment) { - this.onErrorDeployment = onErrorDeployment; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (templateLink() != null) { - templateLink().validate(); - } - if (parametersLink() != null) { - parametersLink().validate(); - } - if (mode() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property mode in model DeploymentProperties")); - } - if (debugSetting() != null) { - debugSetting().validate(); - } - if (onErrorDeployment() != null) { - onErrorDeployment().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentPropertiesExtended.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentPropertiesExtended.java deleted file mode 100644 index b29bf26b3962..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentPropertiesExtended.java +++ /dev/null @@ -1,307 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.exception.ManagementError; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.resources.fluent.models.ProviderInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; - -/** Deployment properties with additional details. */ -@Immutable -public final class DeploymentPropertiesExtended { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DeploymentPropertiesExtended.class); - - /* - * The state of the provisioning. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; - - /* - * The correlation ID of the deployment. - */ - @JsonProperty(value = "correlationId", access = JsonProperty.Access.WRITE_ONLY) - private String correlationId; - - /* - * The timestamp of the template deployment. - */ - @JsonProperty(value = "timestamp", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime timestamp; - - /* - * The duration of the template deployment. - */ - @JsonProperty(value = "duration", access = JsonProperty.Access.WRITE_ONLY) - private String duration; - - /* - * Key/value pairs that represent deployment output. - */ - @JsonProperty(value = "outputs", access = JsonProperty.Access.WRITE_ONLY) - private Object outputs; - - /* - * The list of resource providers needed for the deployment. - */ - @JsonProperty(value = "providers", access = JsonProperty.Access.WRITE_ONLY) - private List providers; - - /* - * The list of deployment dependencies. - */ - @JsonProperty(value = "dependencies", access = JsonProperty.Access.WRITE_ONLY) - private List dependencies; - - /* - * The URI referencing the template. - */ - @JsonProperty(value = "templateLink", access = JsonProperty.Access.WRITE_ONLY) - private TemplateLink templateLink; - - /* - * Deployment parameters. - */ - @JsonProperty(value = "parameters", access = JsonProperty.Access.WRITE_ONLY) - private Object parameters; - - /* - * The URI referencing the parameters. - */ - @JsonProperty(value = "parametersLink", access = JsonProperty.Access.WRITE_ONLY) - private ParametersLink parametersLink; - - /* - * The deployment mode. Possible values are Incremental and Complete. - */ - @JsonProperty(value = "mode", access = JsonProperty.Access.WRITE_ONLY) - private DeploymentMode mode; - - /* - * The debug setting of the deployment. - */ - @JsonProperty(value = "debugSetting", access = JsonProperty.Access.WRITE_ONLY) - private DebugSetting debugSetting; - - /* - * The deployment on error behavior. - */ - @JsonProperty(value = "onErrorDeployment", access = JsonProperty.Access.WRITE_ONLY) - private OnErrorDeploymentExtended onErrorDeployment; - - /* - * The hash produced for the template. - */ - @JsonProperty(value = "templateHash", access = JsonProperty.Access.WRITE_ONLY) - private String templateHash; - - /* - * Array of provisioned resources. - */ - @JsonProperty(value = "outputResources", access = JsonProperty.Access.WRITE_ONLY) - private List outputResources; - - /* - * Array of validated resources. - */ - @JsonProperty(value = "validatedResources", access = JsonProperty.Access.WRITE_ONLY) - private List validatedResources; - - /* - * Error Response The deployment error. - */ - @JsonProperty(value = "error", access = JsonProperty.Access.WRITE_ONLY) - private ManagementError error; - - /** - * Get the provisioningState property: The state of the provisioning. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Get the correlationId property: The correlation ID of the deployment. - * - * @return the correlationId value. - */ - public String correlationId() { - return this.correlationId; - } - - /** - * Get the timestamp property: The timestamp of the template deployment. - * - * @return the timestamp value. - */ - public OffsetDateTime timestamp() { - return this.timestamp; - } - - /** - * Get the duration property: The duration of the template deployment. - * - * @return the duration value. - */ - public String duration() { - return this.duration; - } - - /** - * Get the outputs property: Key/value pairs that represent deployment output. - * - * @return the outputs value. - */ - public Object outputs() { - return this.outputs; - } - - /** - * Get the providers property: The list of resource providers needed for the deployment. - * - * @return the providers value. - */ - public List providers() { - return this.providers; - } - - /** - * Get the dependencies property: The list of deployment dependencies. - * - * @return the dependencies value. - */ - public List dependencies() { - return this.dependencies; - } - - /** - * Get the templateLink property: The URI referencing the template. - * - * @return the templateLink value. - */ - public TemplateLink templateLink() { - return this.templateLink; - } - - /** - * Get the parameters property: Deployment parameters. - * - * @return the parameters value. - */ - public Object parameters() { - return this.parameters; - } - - /** - * Get the parametersLink property: The URI referencing the parameters. - * - * @return the parametersLink value. - */ - public ParametersLink parametersLink() { - return this.parametersLink; - } - - /** - * Get the mode property: The deployment mode. Possible values are Incremental and Complete. - * - * @return the mode value. - */ - public DeploymentMode mode() { - return this.mode; - } - - /** - * Get the debugSetting property: The debug setting of the deployment. - * - * @return the debugSetting value. - */ - public DebugSetting debugSetting() { - return this.debugSetting; - } - - /** - * Get the onErrorDeployment property: The deployment on error behavior. - * - * @return the onErrorDeployment value. - */ - public OnErrorDeploymentExtended onErrorDeployment() { - return this.onErrorDeployment; - } - - /** - * Get the templateHash property: The hash produced for the template. - * - * @return the templateHash value. - */ - public String templateHash() { - return this.templateHash; - } - - /** - * Get the outputResources property: Array of provisioned resources. - * - * @return the outputResources value. - */ - public List outputResources() { - return this.outputResources; - } - - /** - * Get the validatedResources property: Array of validated resources. - * - * @return the validatedResources value. - */ - public List validatedResources() { - return this.validatedResources; - } - - /** - * Get the error property: Error Response The deployment error. - * - * @return the error value. - */ - public ManagementError error() { - return this.error; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (providers() != null) { - providers().forEach(e -> e.validate()); - } - if (dependencies() != null) { - dependencies().forEach(e -> e.validate()); - } - if (templateLink() != null) { - templateLink().validate(); - } - if (parametersLink() != null) { - parametersLink().validate(); - } - if (debugSetting() != null) { - debugSetting().validate(); - } - if (onErrorDeployment() != null) { - onErrorDeployment().validate(); - } - if (outputResources() != null) { - outputResources().forEach(e -> e.validate()); - } - if (validatedResources() != null) { - validatedResources().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentWhatIf.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentWhatIf.java deleted file mode 100644 index ac9b87587415..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentWhatIf.java +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Deployment What-if operation parameters. */ -@Fluent -public final class DeploymentWhatIf { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DeploymentWhatIf.class); - - /* - * The location to store the deployment data. - */ - @JsonProperty(value = "location") - private String location; - - /* - * The deployment properties. - */ - @JsonProperty(value = "properties", required = true) - private DeploymentWhatIfProperties properties; - - /** - * Get the location property: The location to store the deployment data. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Set the location property: The location to store the deployment data. - * - * @param location the location value to set. - * @return the DeploymentWhatIf object itself. - */ - public DeploymentWhatIf withLocation(String location) { - this.location = location; - return this; - } - - /** - * Get the properties property: The deployment properties. - * - * @return the properties value. - */ - public DeploymentWhatIfProperties properties() { - return this.properties; - } - - /** - * Set the properties property: The deployment properties. - * - * @param properties the properties value to set. - * @return the DeploymentWhatIf object itself. - */ - public DeploymentWhatIf withProperties(DeploymentWhatIfProperties properties) { - this.properties = properties; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property properties in model DeploymentWhatIf")); - } else { - properties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentWhatIfProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentWhatIfProperties.java deleted file mode 100644 index 525c2663432a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentWhatIfProperties.java +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Deployment What-if properties. */ -@Fluent -public final class DeploymentWhatIfProperties extends DeploymentProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DeploymentWhatIfProperties.class); - - /* - * Optional What-If operation settings. - */ - @JsonProperty(value = "whatIfSettings") - private DeploymentWhatIfSettings whatIfSettings; - - /** - * Get the whatIfSettings property: Optional What-If operation settings. - * - * @return the whatIfSettings value. - */ - public DeploymentWhatIfSettings whatIfSettings() { - return this.whatIfSettings; - } - - /** - * Set the whatIfSettings property: Optional What-If operation settings. - * - * @param whatIfSettings the whatIfSettings value to set. - * @return the DeploymentWhatIfProperties object itself. - */ - public DeploymentWhatIfProperties withWhatIfSettings(DeploymentWhatIfSettings whatIfSettings) { - this.whatIfSettings = whatIfSettings; - return this; - } - - /** {@inheritDoc} */ - @Override - public DeploymentWhatIfProperties withTemplate(Object template) { - super.withTemplate(template); - return this; - } - - /** {@inheritDoc} */ - @Override - public DeploymentWhatIfProperties withTemplateLink(TemplateLink templateLink) { - super.withTemplateLink(templateLink); - return this; - } - - /** {@inheritDoc} */ - @Override - public DeploymentWhatIfProperties withParameters(Object parameters) { - super.withParameters(parameters); - return this; - } - - /** {@inheritDoc} */ - @Override - public DeploymentWhatIfProperties withParametersLink(ParametersLink parametersLink) { - super.withParametersLink(parametersLink); - return this; - } - - /** {@inheritDoc} */ - @Override - public DeploymentWhatIfProperties withMode(DeploymentMode mode) { - super.withMode(mode); - return this; - } - - /** {@inheritDoc} */ - @Override - public DeploymentWhatIfProperties withDebugSetting(DebugSetting debugSetting) { - super.withDebugSetting(debugSetting); - return this; - } - - /** {@inheritDoc} */ - @Override - public DeploymentWhatIfProperties withOnErrorDeployment(OnErrorDeployment onErrorDeployment) { - super.withOnErrorDeployment(onErrorDeployment); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (whatIfSettings() != null) { - whatIfSettings().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentWhatIfSettings.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentWhatIfSettings.java deleted file mode 100644 index fce651c6efb2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentWhatIfSettings.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Deployment What-If operation settings. */ -@Fluent -public final class DeploymentWhatIfSettings { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DeploymentWhatIfSettings.class); - - /* - * The format of the What-If results - */ - @JsonProperty(value = "resultFormat") - private WhatIfResultFormat resultFormat; - - /** - * Get the resultFormat property: The format of the What-If results. - * - * @return the resultFormat value. - */ - public WhatIfResultFormat resultFormat() { - return this.resultFormat; - } - - /** - * Set the resultFormat property: The format of the What-If results. - * - * @param resultFormat the resultFormat value to set. - * @return the DeploymentWhatIfSettings object itself. - */ - public DeploymentWhatIfSettings withResultFormat(WhatIfResultFormat resultFormat) { - this.resultFormat = resultFormat; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Deployments.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Deployments.java deleted file mode 100644 index 4a608c841ce4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Deployments.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsDeletingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingByName; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsListingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsCreating; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingById; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; -import com.azure.resourcemanager.resources.ResourceManager; - -/** - * Entry point to template deployment in Azure. - */ -@Fluent -public interface Deployments extends - SupportsCreating, - SupportsListing, - SupportsListingByResourceGroup, - SupportsGettingByName, - SupportsGettingByResourceGroup, - SupportsGettingById, - SupportsDeletingById, - SupportsDeletingByResourceGroup, - HasManager { - /** - * Checks if a deployment exists in a resource group. - * - * @param resourceGroupName the resource group's name - * @param deploymentName the deployment's name - * @return true if the deployment exists; false otherwise - */ - boolean checkExistence(String resourceGroupName, String deploymentName); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentsWhatIfAtManagementGroupScopeHeaders.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentsWhatIfAtManagementGroupScopeHeaders.java deleted file mode 100644 index a1a9fce40568..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentsWhatIfAtManagementGroupScopeHeaders.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The DeploymentsWhatIfAtManagementGroupScopeHeaders model. */ -@Fluent -public final class DeploymentsWhatIfAtManagementGroupScopeHeaders { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(DeploymentsWhatIfAtManagementGroupScopeHeaders.class); - - /* - * The Retry-After property. - */ - @JsonProperty(value = "Retry-After") - private String retryAfter; - - /* - * The Location property. - */ - @JsonProperty(value = "Location") - private String location; - - /** - * Get the retryAfter property: The Retry-After property. - * - * @return the retryAfter value. - */ - public String retryAfter() { - return this.retryAfter; - } - - /** - * Set the retryAfter property: The Retry-After property. - * - * @param retryAfter the retryAfter value to set. - * @return the DeploymentsWhatIfAtManagementGroupScopeHeaders object itself. - */ - public DeploymentsWhatIfAtManagementGroupScopeHeaders withRetryAfter(String retryAfter) { - this.retryAfter = retryAfter; - return this; - } - - /** - * Get the location property: The Location property. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Set the location property: The Location property. - * - * @param location the location value to set. - * @return the DeploymentsWhatIfAtManagementGroupScopeHeaders object itself. - */ - public DeploymentsWhatIfAtManagementGroupScopeHeaders withLocation(String location) { - this.location = location; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentsWhatIfAtManagementGroupScopeResponse.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentsWhatIfAtManagementGroupScopeResponse.java deleted file mode 100644 index 4a815ef851c7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentsWhatIfAtManagementGroupScopeResponse.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.rest.ResponseBase; -import com.azure.resourcemanager.resources.fluent.models.WhatIfOperationResultInner; - -/** Contains all response data for the whatIfAtManagementGroupScope operation. */ -public final class DeploymentsWhatIfAtManagementGroupScopeResponse - extends ResponseBase { - /** - * Creates an instance of DeploymentsWhatIfAtManagementGroupScopeResponse. - * - * @param request the request which resulted in this DeploymentsWhatIfAtManagementGroupScopeResponse. - * @param statusCode the status code of the HTTP response. - * @param rawHeaders the raw headers of the HTTP response. - * @param value the deserialized value of the HTTP response. - * @param headers the deserialized headers of the HTTP response. - */ - public DeploymentsWhatIfAtManagementGroupScopeResponse( - HttpRequest request, - int statusCode, - HttpHeaders rawHeaders, - WhatIfOperationResultInner value, - DeploymentsWhatIfAtManagementGroupScopeHeaders headers) { - super(request, statusCode, rawHeaders, value, headers); - } - - /** @return the deserialized response body. */ - @Override - public WhatIfOperationResultInner getValue() { - return super.getValue(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentsWhatIfAtSubscriptionScopeHeaders.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentsWhatIfAtSubscriptionScopeHeaders.java deleted file mode 100644 index 6bdf55aba49b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentsWhatIfAtSubscriptionScopeHeaders.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The DeploymentsWhatIfAtSubscriptionScopeHeaders model. */ -@Fluent -public final class DeploymentsWhatIfAtSubscriptionScopeHeaders { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DeploymentsWhatIfAtSubscriptionScopeHeaders.class); - - /* - * The Retry-After property. - */ - @JsonProperty(value = "Retry-After") - private String retryAfter; - - /* - * The Location property. - */ - @JsonProperty(value = "Location") - private String location; - - /** - * Get the retryAfter property: The Retry-After property. - * - * @return the retryAfter value. - */ - public String retryAfter() { - return this.retryAfter; - } - - /** - * Set the retryAfter property: The Retry-After property. - * - * @param retryAfter the retryAfter value to set. - * @return the DeploymentsWhatIfAtSubscriptionScopeHeaders object itself. - */ - public DeploymentsWhatIfAtSubscriptionScopeHeaders withRetryAfter(String retryAfter) { - this.retryAfter = retryAfter; - return this; - } - - /** - * Get the location property: The Location property. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Set the location property: The Location property. - * - * @param location the location value to set. - * @return the DeploymentsWhatIfAtSubscriptionScopeHeaders object itself. - */ - public DeploymentsWhatIfAtSubscriptionScopeHeaders withLocation(String location) { - this.location = location; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentsWhatIfAtSubscriptionScopeResponse.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentsWhatIfAtSubscriptionScopeResponse.java deleted file mode 100644 index 69622a1be5d8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentsWhatIfAtSubscriptionScopeResponse.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.rest.ResponseBase; -import com.azure.resourcemanager.resources.fluent.models.WhatIfOperationResultInner; - -/** Contains all response data for the whatIfAtSubscriptionScope operation. */ -public final class DeploymentsWhatIfAtSubscriptionScopeResponse - extends ResponseBase { - /** - * Creates an instance of DeploymentsWhatIfAtSubscriptionScopeResponse. - * - * @param request the request which resulted in this DeploymentsWhatIfAtSubscriptionScopeResponse. - * @param statusCode the status code of the HTTP response. - * @param rawHeaders the raw headers of the HTTP response. - * @param value the deserialized value of the HTTP response. - * @param headers the deserialized headers of the HTTP response. - */ - public DeploymentsWhatIfAtSubscriptionScopeResponse( - HttpRequest request, - int statusCode, - HttpHeaders rawHeaders, - WhatIfOperationResultInner value, - DeploymentsWhatIfAtSubscriptionScopeHeaders headers) { - super(request, statusCode, rawHeaders, value, headers); - } - - /** @return the deserialized response body. */ - @Override - public WhatIfOperationResultInner getValue() { - return super.getValue(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentsWhatIfAtTenantScopeHeaders.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentsWhatIfAtTenantScopeHeaders.java deleted file mode 100644 index c799001a372b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentsWhatIfAtTenantScopeHeaders.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The DeploymentsWhatIfAtTenantScopeHeaders model. */ -@Fluent -public final class DeploymentsWhatIfAtTenantScopeHeaders { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DeploymentsWhatIfAtTenantScopeHeaders.class); - - /* - * The Retry-After property. - */ - @JsonProperty(value = "Retry-After") - private String retryAfter; - - /* - * The Location property. - */ - @JsonProperty(value = "Location") - private String location; - - /** - * Get the retryAfter property: The Retry-After property. - * - * @return the retryAfter value. - */ - public String retryAfter() { - return this.retryAfter; - } - - /** - * Set the retryAfter property: The Retry-After property. - * - * @param retryAfter the retryAfter value to set. - * @return the DeploymentsWhatIfAtTenantScopeHeaders object itself. - */ - public DeploymentsWhatIfAtTenantScopeHeaders withRetryAfter(String retryAfter) { - this.retryAfter = retryAfter; - return this; - } - - /** - * Get the location property: The Location property. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Set the location property: The Location property. - * - * @param location the location value to set. - * @return the DeploymentsWhatIfAtTenantScopeHeaders object itself. - */ - public DeploymentsWhatIfAtTenantScopeHeaders withLocation(String location) { - this.location = location; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentsWhatIfAtTenantScopeResponse.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentsWhatIfAtTenantScopeResponse.java deleted file mode 100644 index 2781f90c82fe..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentsWhatIfAtTenantScopeResponse.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.rest.ResponseBase; -import com.azure.resourcemanager.resources.fluent.models.WhatIfOperationResultInner; - -/** Contains all response data for the whatIfAtTenantScope operation. */ -public final class DeploymentsWhatIfAtTenantScopeResponse - extends ResponseBase { - /** - * Creates an instance of DeploymentsWhatIfAtTenantScopeResponse. - * - * @param request the request which resulted in this DeploymentsWhatIfAtTenantScopeResponse. - * @param statusCode the status code of the HTTP response. - * @param rawHeaders the raw headers of the HTTP response. - * @param value the deserialized value of the HTTP response. - * @param headers the deserialized headers of the HTTP response. - */ - public DeploymentsWhatIfAtTenantScopeResponse( - HttpRequest request, - int statusCode, - HttpHeaders rawHeaders, - WhatIfOperationResultInner value, - DeploymentsWhatIfAtTenantScopeHeaders headers) { - super(request, statusCode, rawHeaders, value, headers); - } - - /** @return the deserialized response body. */ - @Override - public WhatIfOperationResultInner getValue() { - return super.getValue(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentsWhatIfHeaders.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentsWhatIfHeaders.java deleted file mode 100644 index 1f9a5b189359..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentsWhatIfHeaders.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The DeploymentsWhatIfHeaders model. */ -@Fluent -public final class DeploymentsWhatIfHeaders { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DeploymentsWhatIfHeaders.class); - - /* - * The Retry-After property. - */ - @JsonProperty(value = "Retry-After") - private String retryAfter; - - /* - * The Location property. - */ - @JsonProperty(value = "Location") - private String location; - - /** - * Get the retryAfter property: The Retry-After property. - * - * @return the retryAfter value. - */ - public String retryAfter() { - return this.retryAfter; - } - - /** - * Set the retryAfter property: The Retry-After property. - * - * @param retryAfter the retryAfter value to set. - * @return the DeploymentsWhatIfHeaders object itself. - */ - public DeploymentsWhatIfHeaders withRetryAfter(String retryAfter) { - this.retryAfter = retryAfter; - return this; - } - - /** - * Get the location property: The Location property. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Set the location property: The Location property. - * - * @param location the location value to set. - * @return the DeploymentsWhatIfHeaders object itself. - */ - public DeploymentsWhatIfHeaders withLocation(String location) { - this.location = location; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentsWhatIfResponse.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentsWhatIfResponse.java deleted file mode 100644 index 843011e888b1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentsWhatIfResponse.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.rest.ResponseBase; -import com.azure.resourcemanager.resources.fluent.models.WhatIfOperationResultInner; - -/** Contains all response data for the whatIf operation. */ -public final class DeploymentsWhatIfResponse - extends ResponseBase { - /** - * Creates an instance of DeploymentsWhatIfResponse. - * - * @param request the request which resulted in this DeploymentsWhatIfResponse. - * @param statusCode the status code of the HTTP response. - * @param rawHeaders the raw headers of the HTTP response. - * @param value the deserialized value of the HTTP response. - * @param headers the deserialized headers of the HTTP response. - */ - public DeploymentsWhatIfResponse( - HttpRequest request, - int statusCode, - HttpHeaders rawHeaders, - WhatIfOperationResultInner value, - DeploymentsWhatIfHeaders headers) { - super(request, statusCode, rawHeaders, value, headers); - } - - /** @return the deserialized response body. */ - @Override - public WhatIfOperationResultInner getValue() { - return super.getValue(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ExportTemplateRequest.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ExportTemplateRequest.java deleted file mode 100644 index 867b0b2736f2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ExportTemplateRequest.java +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Export resource group template request parameters. */ -@Fluent -public final class ExportTemplateRequest { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ExportTemplateRequest.class); - - /* - * The IDs of the resources to filter the export by. To export all - * resources, supply an array with single entry '*'. - */ - @JsonProperty(value = "resources") - private List resources; - - /* - * The export template options. A CSV-formatted list containing zero or - * more of the following: 'IncludeParameterDefaultValue', - * 'IncludeComments', 'SkipResourceNameParameterization', - * 'SkipAllParameterization' - */ - @JsonProperty(value = "options") - private String options; - - /** - * Get the resources property: The IDs of the resources to filter the export by. To export all resources, supply an - * array with single entry '*'. - * - * @return the resources value. - */ - public List resources() { - return this.resources; - } - - /** - * Set the resources property: The IDs of the resources to filter the export by. To export all resources, supply an - * array with single entry '*'. - * - * @param resources the resources value to set. - * @return the ExportTemplateRequest object itself. - */ - public ExportTemplateRequest withResources(List resources) { - this.resources = resources; - return this; - } - - /** - * Get the options property: The export template options. A CSV-formatted list containing zero or more of the - * following: 'IncludeParameterDefaultValue', 'IncludeComments', 'SkipResourceNameParameterization', - * 'SkipAllParameterization'. - * - * @return the options value. - */ - public String options() { - return this.options; - } - - /** - * Set the options property: The export template options. A CSV-formatted list containing zero or more of the - * following: 'IncludeParameterDefaultValue', 'IncludeComments', 'SkipResourceNameParameterization', - * 'SkipAllParameterization'. - * - * @param options the options value to set. - * @return the ExportTemplateRequest object itself. - */ - public ExportTemplateRequest withOptions(String options) { - this.options = options; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Feature.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Feature.java deleted file mode 100644 index 3a4951f7b38f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Feature.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasId; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasName; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.model.Indexable; -import com.azure.resourcemanager.resources.fluent.models.FeatureResultInner; - -/** - * An immutable client-side representation of an Azure feature. - */ -@Fluent -public interface Feature extends - Indexable, - HasId, - HasInnerModel, - HasName { - - /** - * @return the type of the feature - */ - String type(); - - /** - * @return the state of the previewed feature - */ - String state(); - - /** - * @return the resource provider namespace of the feature - */ - String resourceProviderName(); - - /** - * @return the name of the feature - */ - String featureName(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/FeatureOperationsListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/FeatureOperationsListResult.java deleted file mode 100644 index d36a35273a03..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/FeatureOperationsListResult.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.resources.fluent.models.FeatureResultInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** List of previewed features. */ -@Fluent -public final class FeatureOperationsListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(FeatureOperationsListResult.class); - - /* - * The array of features. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to use for getting the next set of results. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: The array of features. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The array of features. - * - * @param value the value value to set. - * @return the FeatureOperationsListResult object itself. - */ - public FeatureOperationsListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to use for getting the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The URL to use for getting the next set of results. - * - * @param nextLink the nextLink value to set. - * @return the FeatureOperationsListResult object itself. - */ - public FeatureOperationsListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/FeatureProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/FeatureProperties.java deleted file mode 100644 index 828638622c6a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/FeatureProperties.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Information about feature. */ -@Fluent -public final class FeatureProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(FeatureProperties.class); - - /* - * The registration state of the feature for the subscription. - */ - @JsonProperty(value = "state") - private String state; - - /** - * Get the state property: The registration state of the feature for the subscription. - * - * @return the state value. - */ - public String state() { - return this.state; - } - - /** - * Set the state property: The registration state of the feature for the subscription. - * - * @param state the state value to set. - * @return the FeatureProperties object itself. - */ - public FeatureProperties withState(String state) { - this.state = state; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Features.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Features.java deleted file mode 100644 index 6c2261c7e753..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Features.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; -import reactor.core.publisher.Mono; - -/** - * Entry point to features management API. - */ -@Fluent -public interface Features extends - SupportsListing { - /** - * Registers a feature in a resource provider. - * - * @param resourceProviderName the name of the resource provider - * @param featureName the name of the feature - * @return the registered feature - */ - Feature register(String resourceProviderName, String featureName); - - /** - * Registers a feature in a resource provider asynchronously. - * - * @param resourceProviderName the name of the resource provider - * @param featureName the name of the feature - * @return a representation of the deferred computation of this call returning the registered feature - */ - Mono registerAsync(String resourceProviderName, String featureName); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ForceDeletionResourceType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ForceDeletionResourceType.java deleted file mode 100644 index b4b2dd58fb15..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ForceDeletionResourceType.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; - -import java.util.Collection; - -/** - * Resource type for force deletion. - */ -public final class ForceDeletionResourceType extends ExpandableStringEnum { - - /** Static value Microsoft.Compute/virtualMachines for ForceDeletionResourceType. */ - public static final ForceDeletionResourceType VIRTUAL_MACHINES = - fromString("Microsoft.Compute/virtualMachines"); - - /** Static value Microsoft.Compute/virtualMachineScaleSets for ForceDeletionResourceType. */ - public static final ForceDeletionResourceType VIRTUAL_MACHINE_SCALE_SETS = - fromString("Microsoft.Compute/virtualMachineScaleSets"); - - /** - * Creates or finds a ForceDeletionResourceType from its string representation. - * @param name a name to look for - * @return the corresponding ForceDeletionResourceType - */ - @JsonCreator - public static ForceDeletionResourceType fromString(String name) { - return fromString(name, ForceDeletionResourceType.class); - } - - /** - * @return known ForceDeletionResourceType values - */ - public static Collection values() { - return values(ForceDeletionResourceType.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/GenericResource.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/GenericResource.java deleted file mode 100644 index dfe47d2d1ec8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/GenericResource.java +++ /dev/null @@ -1,390 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.arm.models.GroupableResource; -import com.azure.resourcemanager.resources.fluentcore.arm.models.Resource; -import com.azure.resourcemanager.resources.fluentcore.model.Accepted; -import com.azure.resourcemanager.resources.fluentcore.model.Appliable; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; -import com.azure.resourcemanager.resources.fluentcore.model.Updatable; -import com.azure.resourcemanager.resources.ResourceManager; -import com.azure.resourcemanager.resources.fluent.models.GenericResourceInner; - -/** - * An immutable client-side representation of an Azure generic resource. - */ -@Fluent -public interface GenericResource extends - GroupableResource, - Refreshable, - Updatable { - /** - * @return the namespace of the resource provider - */ - String resourceProviderNamespace(); - - /** - * @return the id of the parent resource if this is a child resource - */ - String parentResourcePath(); - - /** - * @return the type of the resource - */ - String resourceType(); - - /** - * @return the api version of the resource - */ - String apiVersion(); - - /** - * @return the plan of the resource - */ - Plan plan(); - - /** - * @return other properties of the resource - */ - Object properties(); - - /** - * @return the kind of the resource - */ - String kind(); - - /** - * @return the SKU of the resource - */ - Sku sku(); - - /** - * @return the managed identity of the resource - */ - Identity identity(); - - /** - * @return the ID of the resource that manages this resource - */ - String managedBy(); - - /** - * The entirety of the generic resource definition. - */ - interface Definition extends - DefinitionStages.Blank, - DefinitionStages.WithGroup, - DefinitionStages.WithResourceType, - DefinitionStages.WithProviderNamespace, - DefinitionStages.WithParentResource, - DefinitionStages.WithPlan, - DefinitionStages.WithApiVersion, - DefinitionStages.WithCreate { - } - - /** - * Grouping of generic resource definition stages. - */ - interface DefinitionStages { - /** - * A generic resource definition allowing region to be specified. - */ - interface Blank extends GroupableResource.DefinitionWithRegion { - } - - /** - * A generic resource definition allowing resource group to be specified. - */ - interface WithGroup extends GroupableResource.DefinitionStages.WithGroup { - } - - /** - * A generic resource definition allowing resource type to be specified. - */ - interface WithResourceType { - /** - * Specifies the resource's type. - * - * @param resourceType the type of the resources - * @return the next stage of generic resource definition - */ - WithProviderNamespace withResourceType(String resourceType); - } - - /** - * A generic resource definition allowing provider namespace to be specified. - */ - interface WithProviderNamespace { - /** - * Specifies the resource provider's namespace. - * - * @param resourceProviderNamespace the namespace of the resource provider - * @return the next stage of the definition - */ - WithPlan withProviderNamespace(String resourceProviderNamespace); - } - - /** - * A generic resource definition allowing plan to be specified. - */ - interface WithPlan { - /** - * Specifies the plan of the resource. The plan can only be set for 3rd party resources. - * - * @param name the name of the plan - * @param publisher the publisher of the plan - * @param product the name of the product - * @param promotionCode the promotion code, if any - * @return the next stage of the definition - */ - WithCreate withPlan(String name, String publisher, String product, String promotionCode); - - /** - * Specifies the plan of the resource. The plan can only be set for 3rd party resources. - * - * @param plan the plan - * @return the next stage of the definition. - */ - WithCreate withPlan(Plan plan); - - /** - * Specifies the plan of the resource. - * - * @return the next stage of the definition - */ - WithCreate withoutPlan(); - } - - /** - * A generic resource definition allowing api version to be specified. - */ - interface WithApiVersion { - /** - * Specifies the api version. - * - * @param apiVersion the API version of the resource - * @return the next stage of the definition - */ - WithCreate withApiVersion(String apiVersion); - } - - /** - * A generic resource definition allowing parent resource to be specified. - */ - interface WithParentResource { - /** - * Specifies the parent resource. - * - * @param parentResourceId the parent resource id - * @return the next stage of the definition - */ - WithCreate withParentResourceId(String parentResourceId); - - /** - * Specifies the parent resource relative path. - * - * @param parentResourcePath the relative path of parent resource - * @return the next stage of the definition - */ - WithCreate withParentResourcePath(String parentResourcePath); - } - - /** - * A deployment definition with sufficient inputs to create a new - * resource in the cloud, but exposing additional optional inputs to - * specify. - */ - interface WithCreate extends - WithParentResource, - WithApiVersion, - Creatable, - Resource.DefinitionWithTags { - /** - * Specifies other properties. - * - * @param properties the properties object - * @return the next stage of generic resource definition - */ - WithCreate withProperties(Object properties); - - /** - * Specifies resource kind. - * - * @param kind the kind of the resource - * @return the next stage of generic resource definition - */ - WithCreate withKind(String kind); - - /** - * Specifies resource SKU. - * - * @param sku the SKU of the resource - * @return the next stage of generic resource definition - */ - WithCreate withSku(Sku sku); - - /** - * Specifies managed identity. - * - * @param identity the managed identity - * @return the next stage of generic resource definition - */ - WithCreate withIdentity(Identity identity); - - /** - * Begins creating the Azure resource. - * - * @return the accepted create operation - */ - Accepted beginCreate(); - } - } - - /** - * Grouping of generic resource update stages. - */ - interface UpdateStages { - /** - * A generic resource update allowing to change the resource properties. - */ - interface WithProperties { - /** - * Specifies other properties of the resource. - * - * @param properties the properties object - * @return the next stage of generic resource update - */ - Update withProperties(Object properties); - } - - /** - * A generic resource update allowing to change the parent resource. - */ - interface WithParentResource { - /** - * Specifies the parent resource. - * - * @param parentResourceId the parent resource id - * @return the next stage of the generic resource update - */ - Update withParentResourceId(String parentResourceId); - - /** - * Specifies the parent resource relative path. - * - * @param parentResourcePath the relative path of parent resource - * @return the next stage of the generic resource update - */ - Update withParentResourcePath(String parentResourcePath); - } - - /** - * A generic resource update allowing to change the resource plan. - */ - interface WithPlan { - /** - * Specifies the plan of the resource. - * - * @param name the name of the plan - * @param publisher the publisher of the plan - * @param product the name of the product - * @param promotionCode the promotion code, if any - * @return the next stage of the generic resource update - */ - Update withPlan(String name, String publisher, String product, String promotionCode); - - /** - * Specifies the plan of the resource. - * - * @param plan the plan - * @return the next stage of the generic resource update - */ - Update withPlan(Plan plan); - - /** - * Specifies the plan of the resource. - * - * @return the next stage of the generic resource update - */ - Update withoutPlan(); - } - - /** - * The template for a generic resource update operation for specifying the resource provider API version. - */ - interface WithApiVersion { - /** - * Specifies the API version of the resource provider. - * - * @param apiVersion the API version - * @return the next stage of the generic resource update - */ - Update withApiVersion(String apiVersion); - } - - /** - * The template for a generic resource update operation for specifying the resource kind. - */ - interface WithKind { - /** - * Specifies resource kind. - * - * @param kind the kind of the resource - * @return the next stage of generic resource update - */ - Update withKind(String kind); - } - - /** - * The template for a generic resource update operation for specifying the resource SKU. - */ - interface WithSku { - /** - * Specifies resource SKU. - * - * @param sku the SKU of the resource - * @return the next stage of generic resource update - */ - Update withSku(Sku sku); - } - - /** - * The template for a generic resource update operation for specifying the managed identity. - */ - interface WithIdentity { - /** - * Specifies managed identity. - * - * @param identity the managed identity - * @return the next stage of generic resource update - */ - Update withIdentity(Identity identity); - - /** - * Specifies managed identity. - * - * @return the next stage of generic resource update - */ - Update withoutIdentity(); - } - } - - /** - * The template for a generic resource update operation, containing all the settings that can be modified. - */ - interface Update extends - Appliable, - UpdateStages.WithApiVersion, - UpdateStages.WithPlan, - UpdateStages.WithParentResource, - UpdateStages.WithProperties, - UpdateStages.WithKind, - UpdateStages.WithSku, - UpdateStages.WithIdentity, - Resource.UpdateWithTags { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/GenericResources.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/GenericResources.java deleted file mode 100644 index 41f9eed8b7e9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/GenericResources.java +++ /dev/null @@ -1,244 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsListingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsListingInResourceGroupByTag; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsCreating; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingById; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; -import com.azure.resourcemanager.resources.ResourceManager; -import com.azure.resourcemanager.resources.fluentcore.model.Accepted; -import reactor.core.publisher.Mono; - -import java.util.List; - -/** - * Entry point to generic resources management API. - */ -@Fluent -public interface GenericResources extends - SupportsListing, - SupportsListingByResourceGroup, - SupportsListingInResourceGroupByTag, - SupportsGettingById, - SupportsCreating, - SupportsDeletingById, - HasManager { - /** - * Deletes a resource from Azure, identifying it by its resource ID. - * - * For consistency across service versions, please use {@link #deleteById(String, String)} instead. - * - * @param id the resource ID of the resource to delete - */ - void deleteById(String id); - - /** - * Asynchronously delete a resource from Azure, identifying it by its resource ID. - * - * For consistency across service versions, please use {@link #deleteByIdAsync(String, String)} instead. - * - * @param id the resource ID of the resource to delete - * @return a representation of the deferred computation of this call - */ - Mono deleteByIdAsync(String id); - - /** - * Gets the information about a resource from Azure based on the resource id. - * - * For consistency across service versions, please use {@link #getById(String, String)} instead. - * - * @param id the id of the resource. - * @return an immutable representation of the resource - */ - GenericResource getById(String id); - - /** - * Gets the information about a resource from Azure based on the resource id. - * - * For consistency across service versions, please use {@link #getByIdAsync(String, String)} instead. - * - * @param id the id of the resource. - * @return a {@link Mono} that emits the found resource asynchronously - */ - Mono getByIdAsync(String id); - - /** - * Deletes a resource from Azure, identifying it by its resource ID. - * - * @param id the resource ID of the resource to delete - * @param apiVersion the API version - */ - void deleteById(String id, String apiVersion); - - /** - * Asynchronously delete a resource from Azure, identifying it by its resource ID. - * - * @param id the resource ID of the resource to delete - * @param apiVersion the API version - * @return a representation of the deferred computation of this call - */ - Mono deleteByIdAsync(String id, String apiVersion); - - /** - * Gets the information about a resource from Azure based on the resource id. - * - * @param id the id of the resource. - * @param apiVersion the API version - * @return an immutable representation of the resource - */ - GenericResource getById(String id, String apiVersion); - - /** - * Gets the information about a resource from Azure based on the resource id. - * - * @param id the id of the resource. - * @param apiVersion the API version - * @return a {@link Mono} that emits the found resource asynchronously - */ - Mono getByIdAsync(String id, String apiVersion); - - /** - * Checks if a resource exists in a resource group. - * - * @param resourceGroupName the resource group's name - * @param resourceProviderNamespace the resource provider's namespace - * @param parentResourcePath the parent's resource path - * @param resourceType the type of the resource - * @param resourceName the name of the resource - * @param apiVersion the API version - * @return true if the resource exists; false otherwise - */ - boolean checkExistence( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String apiVersion); - - /** - * Checks if a resource exists. - * - * For consistency across service versions, please use {@link #checkExistenceById(String, String)} instead. - * - * @param id the ID of the resource. - * @return true if the resource exists; false otherwise - */ - boolean checkExistenceById(String id); - - /** - * Checks if a resource exists. - * - * @param id the ID of the resource. - * @param apiVersion the API version - * @return true if the resource exists; false otherwise - */ - boolean checkExistenceById(String id, String apiVersion); - - /** - * Returns a resource belonging to a resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceProviderNamespace Resource identity. - * @param parentResourcePath Resource identity. - * @param resourceType Resource identity. - * @param resourceName Resource identity. - * @param apiVersion the API version - * @return the generic resource - */ - GenericResource get( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String apiVersion); - - /** - * Returns a resource belonging to a resource group. - * - * @param resourceGroupName the resource group name - * @param providerNamespace the provider namespace - * @param resourceType the resource type - * @param resourceName the name of the resource - * @return the generic resource - */ - GenericResource get( - String resourceGroupName, - String providerNamespace, - String resourceType, - String resourceName); - - /** - * Move resources from one resource group to another. - * - * @param sourceResourceGroupName Source resource group name - * @param targetResourceGroup target resource group, can be in a different subscription - * @param resources the list of IDs of the resources to move - */ - void moveResources(String sourceResourceGroupName, ResourceGroup targetResourceGroup, List resources); - - /** - * Move resources from one resource group to another asynchronously. - * - * @param sourceResourceGroupName Source resource group name - * @param targetResourceGroup target resource group, can be in a different subscription - * @param resources the list of IDs of the resources to move - * @return a representation of the deferred computation of this call - */ - Mono moveResourcesAsync(String sourceResourceGroupName, - ResourceGroup targetResourceGroup, List resources); - - /** - * Delete resource and all of its child resources. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceProviderNamespace Resource identity. - * @param parentResourcePath Resource identity. - * @param resourceType Resource identity. - * @param resourceName Resource identity. - * @param apiVersion the API version - */ - void delete(String resourceGroupName, String resourceProviderNamespace, - String parentResourcePath, String resourceType, String resourceName, String apiVersion); - - - /** - * Delete resource and all of its child resources asynchronously. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceProviderNamespace Resource identity. - * @param parentResourcePath Resource identity. - * @param resourceType Resource identity. - * @param resourceName Resource identity. - * @param apiVersion the API version - * @return a representation of the deferred computation of this call - */ - Mono deleteAsync(String resourceGroupName, String resourceProviderNamespace, - String parentResourcePath, String resourceType, String resourceName, String apiVersion); - - /** - * Begins deleting a resource from Azure, identifying it by its resource ID. - * - * For consistency across service versions, please use {@link #beginDeleteById(String, String)} instead. - * - * @param id the resource ID of the resource to delete - * @return the accepted deleting operation - */ - Accepted beginDeleteById(String id); - - /** - * Begins deleting a resource from Azure, identifying it by its resource ID. - * - * @param id the resource ID of the resource to delete - * @param apiVersion the API version - * @return the accepted deleting operation - */ - Accepted beginDeleteById(String id, String apiVersion); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/HttpMessage.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/HttpMessage.java deleted file mode 100644 index 78d570dfa8b8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/HttpMessage.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** HTTP message. */ -@Fluent -public final class HttpMessage { - @JsonIgnore private final ClientLogger logger = new ClientLogger(HttpMessage.class); - - /* - * HTTP message content. - */ - @JsonProperty(value = "content") - private Object content; - - /** - * Get the content property: HTTP message content. - * - * @return the content value. - */ - public Object content() { - return this.content; - } - - /** - * Set the content property: HTTP message content. - * - * @param content the content value to set. - * @return the HttpMessage object itself. - */ - public HttpMessage withContent(Object content) { - this.content = content; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Identity.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Identity.java deleted file mode 100644 index d4b7e098e54f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Identity.java +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** Identity for the resource. */ -@Fluent -public class Identity { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Identity.class); - - /* - * The principal ID of resource identity. - */ - @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) - private String principalId; - - /* - * The tenant ID of resource. - */ - @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) - private String tenantId; - - /* - * The identity type. - */ - @JsonProperty(value = "type") - private ResourceIdentityType type; - - /* - * The list of user identities associated with the resource. The user - * identity dictionary key references will be ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - */ - @JsonProperty(value = "userAssignedIdentities") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map userAssignedIdentities; - - /** - * Get the principalId property: The principal ID of resource identity. - * - * @return the principalId value. - */ - public String principalId() { - return this.principalId; - } - - /** - * Get the tenantId property: The tenant ID of resource. - * - * @return the tenantId value. - */ - public String tenantId() { - return this.tenantId; - } - - /** - * Get the type property: The identity type. - * - * @return the type value. - */ - public ResourceIdentityType type() { - return this.type; - } - - /** - * Set the type property: The identity type. - * - * @param type the type value to set. - * @return the Identity object itself. - */ - public Identity withType(ResourceIdentityType type) { - this.type = type; - return this; - } - - /** - * Get the userAssignedIdentities property: The list of user identities associated with the resource. The user - * identity dictionary key references will be ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - * - * @return the userAssignedIdentities value. - */ - public Map userAssignedIdentities() { - return this.userAssignedIdentities; - } - - /** - * Set the userAssignedIdentities property: The list of user identities associated with the resource. The user - * identity dictionary key references will be ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - * - * @param userAssignedIdentities the userAssignedIdentities value to set. - * @return the Identity object itself. - */ - public Identity withUserAssignedIdentities( - Map userAssignedIdentities) { - this.userAssignedIdentities = userAssignedIdentities; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (userAssignedIdentities() != null) { - userAssignedIdentities() - .values() - .forEach( - e -> { - if (e != null) { - e.validate(); - } - }); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/IdentityUserAssignedIdentitiesValue.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/IdentityUserAssignedIdentitiesValue.java deleted file mode 100644 index 289029673ab2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/IdentityUserAssignedIdentitiesValue.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The IdentityUserAssignedIdentitiesValue model. */ -@Immutable -public final class IdentityUserAssignedIdentitiesValue { - @JsonIgnore private final ClientLogger logger = new ClientLogger(IdentityUserAssignedIdentitiesValue.class); - - /* - * The principal id of user assigned identity. - */ - @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) - private String principalId; - - /* - * The client id of user assigned identity. - */ - @JsonProperty(value = "clientId", access = JsonProperty.Access.WRITE_ONLY) - private String clientId; - - /** - * Get the principalId property: The principal id of user assigned identity. - * - * @return the principalId value. - */ - public String principalId() { - return this.principalId; - } - - /** - * Get the clientId property: The client id of user assigned identity. - * - * @return the clientId value. - */ - public String clientId() { - return this.clientId; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Location.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Location.java deleted file mode 100644 index 3476956f2bb6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Location.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Region; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasName; -import com.azure.resourcemanager.resources.fluentcore.model.Indexable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluent.models.LocationInner; - -/** - * An immutable client-side representation of an Azure location. - */ -@Fluent -public interface Location extends - Indexable, - HasInnerModel, - HasName { - /** - * @return the subscription UUID - */ - String subscriptionId(); - - /** - * @return the display name of the location readable by humans - */ - String displayName(); - - /** - * @return the region of the data center location - */ - Region region(); - - /** - * @return the latitude of the location - */ - String latitude(); - - /** - * @return the longitude of the location - */ - String longitude(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/LocationListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/LocationListResult.java deleted file mode 100644 index 2edfbdae41dc..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/LocationListResult.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.resources.fluent.models.LocationInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Location list operation response. */ -@Fluent -public final class LocationListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LocationListResult.class); - - /* - * An array of locations. - */ - @JsonProperty(value = "value") - private List value; - - /** - * Get the value property: An array of locations. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: An array of locations. - * - * @param value the value value to set. - * @return the LocationListResult object itself. - */ - public LocationListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/LockLevel.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/LockLevel.java deleted file mode 100644 index 59a477159ed2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/LockLevel.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for LockLevel. */ -public final class LockLevel extends ExpandableStringEnum { - /** Static value NotSpecified for LockLevel. */ - public static final LockLevel NOT_SPECIFIED = fromString("NotSpecified"); - - /** Static value CanNotDelete for LockLevel. */ - public static final LockLevel CAN_NOT_DELETE = fromString("CanNotDelete"); - - /** Static value ReadOnly for LockLevel. */ - public static final LockLevel READ_ONLY = fromString("ReadOnly"); - - /** - * Creates or finds a LockLevel from its string representation. - * - * @param name a name to look for. - * @return the corresponding LockLevel. - */ - @JsonCreator - public static LockLevel fromString(String name) { - return fromString(name, LockLevel.class); - } - - /** @return known LockLevel values. */ - public static Collection values() { - return values(LockLevel.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ManagementLock.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ManagementLock.java deleted file mode 100644 index f42702cf109d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ManagementLock.java +++ /dev/null @@ -1,217 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.ResourceManager; -import com.azure.resourcemanager.resources.fluent.models.ManagementLockObjectInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasId; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasName; -import com.azure.resourcemanager.resources.fluentcore.arm.models.Resource; -import com.azure.resourcemanager.resources.fluentcore.model.Appliable; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.model.Indexable; -import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; -import com.azure.resourcemanager.resources.fluentcore.model.Updatable; - -import java.util.List; - -/** - * Management lock. - */ -@Fluent -public interface ManagementLock extends - Indexable, - Refreshable, - Updatable, - HasInnerModel, - HasManager, - HasId, - HasName { - - /** - * @return the lock level - */ - LockLevel level(); - - /** - * @return the resource ID of the locked resource - */ - String lockedResourceId(); - - /** - * @return any notes associated with the lock - */ - String notes(); - - /** - * @return the owners of the lock - */ - List owners(); - - /** - * Container interface for all the definitions. - */ - interface Definition extends - DefinitionStages.Blank, - DefinitionStages.WithLockedResource, - DefinitionStages.WithLevel, - DefinitionStages.WithCreate { - } - - /** - * Grouping of management lock definition stages. - */ - interface DefinitionStages { - /** - * The first stage of a management lock definition. - */ - interface Blank - extends WithLockedResource { - } - - /** - * The stage of a management lock definition allowing to specify notes for the lock. - */ - interface WithLevel { - /** - * Specifies the lock level. - * @param level the level of the lock - * @return the next stage of the definition - */ - WithCreate withLevel(LockLevel level); - } - - /** - * The stage of a management lock definition allowing to specify the level of the lock. - */ - interface WithNotes { - /** - * Specifies the notes for the lock. - * - * @param notes the notes - * @return the next stage of the definition - */ - WithCreate withNotes(String notes); - } - - /** - * The stage of a management lock definition allowing to specify the resource to lock. - */ - interface WithLockedResource { - /** - * Specifies the resource to lock. - * @param resourceId the resource ID of the resource to lock - * @return the next stage of the definition - */ - WithLevel withLockedResource(String resourceId); - - /** - * Specifies the resource to lock. - * @param resource the resource to lock - * @return the next stage of the definition - */ - WithLevel withLockedResource(Resource resource); - - /** - * Specifies the resource group to lock. - * @param resourceGroupName the name of a resource group - * @return the next stage of the definition - */ - WithLevel withLockedResourceGroup(String resourceGroupName); - - /** - * Specifies the resource group to lock. - * @param resourceGroup a resource group - * @return then next stage of the definition - */ - WithLevel withLockedResourceGroup(ResourceGroup resourceGroup); - } - - /** - * The stage of the management lock definition which contains all the minimum required inputs for - * the resource to be created but also allows - * for any other optional settings to be specified. - */ - interface WithCreate extends - Creatable, - DefinitionStages.WithNotes { - } - } - - /** - * Container interface for all the updates. - */ - interface Update extends - Appliable, - UpdateStages.WithLevel, - UpdateStages.WithLockedResource { - } - - /** - * Grouping of management lock update stages. - */ - interface UpdateStages { - - /** - * The stage of a management lock definition allowing to specify the level of the lock. - */ - interface WithNotes { - /** - * Specifies the notes for the lock. - * - * @param notes the notes - * @return the next stage of the definition - */ - Update withNotes(String notes); - } - - /** - * The stage of a management lock update allowing to specify the resource to lock. - */ - interface WithLockedResource { - /** - * Specifies the resource to lock. - * @param resourceId the resource ID of the resource to lock - * @return the next stage of the update - */ - Update withLockedResource(String resourceId); - - /** - * Specifies the resource to lock. - * @param resource the resource to lock - * @return the next stage of the update - */ - Update withLockedResource(Resource resource); - - /** - * Specifies the resource group to lock. - * @param resourceGroupName the name of a resource group - * @return the next stage of the update - */ - Update withLockedResourceGroup(String resourceGroupName); - - /** - * Specifies the resource group to lock. - * @param resourceGroup a resource group - * @return then next stage of the update - */ - Update withLockedResourceGroup(ResourceGroup resourceGroup); - } - - /** - * The stage of a management lock update allowing to modify the level of the lock. - */ - interface WithLevel { - /** - * Specifies the lock level. - * @param level the level of the lock - * @return the next stage of the definition - */ - Update withLevel(LockLevel level); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ManagementLockListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ManagementLockListResult.java deleted file mode 100644 index 2a8fed60e62e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ManagementLockListResult.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.resources.fluent.models.ManagementLockObjectInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The list of locks. */ -@Fluent -public final class ManagementLockListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagementLockListResult.class); - - /* - * The list of locks. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to use for getting the next set of results. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: The list of locks. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The list of locks. - * - * @param value the value value to set. - * @return the ManagementLockListResult object itself. - */ - public ManagementLockListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to use for getting the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The URL to use for getting the next set of results. - * - * @param nextLink the nextLink value to set. - * @return the ManagementLockListResult object itself. - */ - public ManagementLockListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ManagementLockOwner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ManagementLockOwner.java deleted file mode 100644 index e54a6b945a59..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ManagementLockOwner.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Lock owner properties. */ -@Fluent -public final class ManagementLockOwner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagementLockOwner.class); - - /* - * The application ID of the lock owner. - */ - @JsonProperty(value = "applicationId") - private String applicationId; - - /** - * Get the applicationId property: The application ID of the lock owner. - * - * @return the applicationId value. - */ - public String applicationId() { - return this.applicationId; - } - - /** - * Set the applicationId property: The application ID of the lock owner. - * - * @param applicationId the applicationId value to set. - * @return the ManagementLockOwner object itself. - */ - public ManagementLockOwner withApplicationId(String applicationId) { - this.applicationId = applicationId; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ManagementLocks.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ManagementLocks.java deleted file mode 100644 index a2a7d884d1e1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ManagementLocks.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.resources.ResourceManager; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsBatchDeletion; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsDeletingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsListingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsBatchCreation; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsCreating; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingById; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; - -/** - * Entry point to management lock management. - */ -@Fluent -public interface ManagementLocks extends - SupportsListing, - SupportsCreating, - SupportsDeletingById, - SupportsListingByResourceGroup, - SupportsGettingByResourceGroup, - SupportsGettingById, - SupportsDeletingByResourceGroup, - SupportsBatchCreation, - SupportsBatchDeletion, - HasManager { - - /** - * Lists management locks associated with the specified resource, its resource group - * and any resources below the resource. - * - * @param resourceId the resource ID of the resource - * @return management locks - */ - PagedIterable listForResource(String resourceId); - - /** - * Lists management locks associated with the specified resource, its resource group, and - * any level below the resource. - * - * @param resourceId the resource Id of the resource - * @return management locks - */ - PagedFlux listForResourceAsync(String resourceId); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/OnErrorDeployment.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/OnErrorDeployment.java deleted file mode 100644 index 59aa095c8d91..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/OnErrorDeployment.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Deployment on error behavior. */ -@Fluent -public final class OnErrorDeployment { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OnErrorDeployment.class); - - /* - * The deployment on error behavior type. Possible values are - * LastSuccessful and SpecificDeployment. - */ - @JsonProperty(value = "type") - private OnErrorDeploymentType type; - - /* - * The deployment to be used on error case. - */ - @JsonProperty(value = "deploymentName") - private String deploymentName; - - /** - * Get the type property: The deployment on error behavior type. Possible values are LastSuccessful and - * SpecificDeployment. - * - * @return the type value. - */ - public OnErrorDeploymentType type() { - return this.type; - } - - /** - * Set the type property: The deployment on error behavior type. Possible values are LastSuccessful and - * SpecificDeployment. - * - * @param type the type value to set. - * @return the OnErrorDeployment object itself. - */ - public OnErrorDeployment withType(OnErrorDeploymentType type) { - this.type = type; - return this; - } - - /** - * Get the deploymentName property: The deployment to be used on error case. - * - * @return the deploymentName value. - */ - public String deploymentName() { - return this.deploymentName; - } - - /** - * Set the deploymentName property: The deployment to be used on error case. - * - * @param deploymentName the deploymentName value to set. - * @return the OnErrorDeployment object itself. - */ - public OnErrorDeployment withDeploymentName(String deploymentName) { - this.deploymentName = deploymentName; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/OnErrorDeploymentExtended.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/OnErrorDeploymentExtended.java deleted file mode 100644 index 77914eb7c57f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/OnErrorDeploymentExtended.java +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Deployment on error behavior with additional details. */ -@Fluent -public final class OnErrorDeploymentExtended { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OnErrorDeploymentExtended.class); - - /* - * The state of the provisioning for the on error deployment. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; - - /* - * The deployment on error behavior type. Possible values are - * LastSuccessful and SpecificDeployment. - */ - @JsonProperty(value = "type") - private OnErrorDeploymentType type; - - /* - * The deployment to be used on error case. - */ - @JsonProperty(value = "deploymentName") - private String deploymentName; - - /** - * Get the provisioningState property: The state of the provisioning for the on error deployment. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Get the type property: The deployment on error behavior type. Possible values are LastSuccessful and - * SpecificDeployment. - * - * @return the type value. - */ - public OnErrorDeploymentType type() { - return this.type; - } - - /** - * Set the type property: The deployment on error behavior type. Possible values are LastSuccessful and - * SpecificDeployment. - * - * @param type the type value to set. - * @return the OnErrorDeploymentExtended object itself. - */ - public OnErrorDeploymentExtended withType(OnErrorDeploymentType type) { - this.type = type; - return this; - } - - /** - * Get the deploymentName property: The deployment to be used on error case. - * - * @return the deploymentName value. - */ - public String deploymentName() { - return this.deploymentName; - } - - /** - * Set the deploymentName property: The deployment to be used on error case. - * - * @param deploymentName the deploymentName value to set. - * @return the OnErrorDeploymentExtended object itself. - */ - public OnErrorDeploymentExtended withDeploymentName(String deploymentName) { - this.deploymentName = deploymentName; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/OnErrorDeploymentType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/OnErrorDeploymentType.java deleted file mode 100644 index 0980db022b5d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/OnErrorDeploymentType.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for OnErrorDeploymentType. */ -public enum OnErrorDeploymentType { - /** Enum value LastSuccessful. */ - LAST_SUCCESSFUL("LastSuccessful"), - - /** Enum value SpecificDeployment. */ - SPECIFIC_DEPLOYMENT("SpecificDeployment"); - - /** The actual serialized value for a OnErrorDeploymentType instance. */ - private final String value; - - OnErrorDeploymentType(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a OnErrorDeploymentType instance. - * - * @param value the serialized value to parse. - * @return the parsed OnErrorDeploymentType object, or null if unable to parse. - */ - @JsonCreator - public static OnErrorDeploymentType fromString(String value) { - OnErrorDeploymentType[] items = OnErrorDeploymentType.values(); - for (OnErrorDeploymentType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/OperationDisplay.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/OperationDisplay.java deleted file mode 100644 index 3a219bd9728a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/OperationDisplay.java +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The object that represents the operation. */ -@Fluent -public final class OperationDisplay { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationDisplay.class); - - /* - * Service provider: Microsoft.Resources - */ - @JsonProperty(value = "provider") - private String provider; - - /* - * Resource on which the operation is performed: Profile, endpoint, etc. - */ - @JsonProperty(value = "resource") - private String resource; - - /* - * Operation type: Read, write, delete, etc. - */ - @JsonProperty(value = "operation") - private String operation; - - /* - * Description of the operation. - */ - @JsonProperty(value = "description") - private String description; - - /** - * Get the provider property: Service provider: Microsoft.Resources. - * - * @return the provider value. - */ - public String provider() { - return this.provider; - } - - /** - * Set the provider property: Service provider: Microsoft.Resources. - * - * @param provider the provider value to set. - * @return the OperationDisplay object itself. - */ - public OperationDisplay withProvider(String provider) { - this.provider = provider; - return this; - } - - /** - * Get the resource property: Resource on which the operation is performed: Profile, endpoint, etc. - * - * @return the resource value. - */ - public String resource() { - return this.resource; - } - - /** - * Set the resource property: Resource on which the operation is performed: Profile, endpoint, etc. - * - * @param resource the resource value to set. - * @return the OperationDisplay object itself. - */ - public OperationDisplay withResource(String resource) { - this.resource = resource; - return this; - } - - /** - * Get the operation property: Operation type: Read, write, delete, etc. - * - * @return the operation value. - */ - public String operation() { - return this.operation; - } - - /** - * Set the operation property: Operation type: Read, write, delete, etc. - * - * @param operation the operation value to set. - * @return the OperationDisplay object itself. - */ - public OperationDisplay withOperation(String operation) { - this.operation = operation; - return this; - } - - /** - * Get the description property: Description of the operation. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: Description of the operation. - * - * @param description the description value to set. - * @return the OperationDisplay object itself. - */ - public OperationDisplay withDescription(String description) { - this.description = description; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/OperationListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/OperationListResult.java deleted file mode 100644 index f007ad913704..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/OperationListResult.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.resources.fluent.models.OperationInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** - * Result of the request to list Microsoft.Resources operations. It contains a list of operations and a URL link to get - * the next set of results. - */ -@Fluent -public final class OperationListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationListResult.class); - - /* - * List of Microsoft.Resources operations. - */ - @JsonProperty(value = "value") - private List value; - - /* - * URL to get the next set of operation list results if there are any. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: List of Microsoft.Resources operations. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: List of Microsoft.Resources operations. - * - * @param value the value value to set. - * @return the OperationListResult object itself. - */ - public OperationListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: URL to get the next set of operation list results if there are any. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: URL to get the next set of operation list results if there are any. - * - * @param nextLink the nextLink value to set. - * @return the OperationListResult object itself. - */ - public OperationListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ParametersLink.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ParametersLink.java deleted file mode 100644 index 255e2fa2cc89..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ParametersLink.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Entity representing the reference to the deployment parameters. */ -@Fluent -public final class ParametersLink { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ParametersLink.class); - - /* - * The URI of the parameters file. - */ - @JsonProperty(value = "uri", required = true) - private String uri; - - /* - * If included, must match the ContentVersion in the template. - */ - @JsonProperty(value = "contentVersion") - private String contentVersion; - - /** - * Get the uri property: The URI of the parameters file. - * - * @return the uri value. - */ - public String uri() { - return this.uri; - } - - /** - * Set the uri property: The URI of the parameters file. - * - * @param uri the uri value to set. - * @return the ParametersLink object itself. - */ - public ParametersLink withUri(String uri) { - this.uri = uri; - return this; - } - - /** - * Get the contentVersion property: If included, must match the ContentVersion in the template. - * - * @return the contentVersion value. - */ - public String contentVersion() { - return this.contentVersion; - } - - /** - * Set the contentVersion property: If included, must match the ContentVersion in the template. - * - * @param contentVersion the contentVersion value to set. - * @return the ParametersLink object itself. - */ - public ParametersLink withContentVersion(String contentVersion) { - this.contentVersion = contentVersion; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (uri() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property uri in model ParametersLink")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Plan.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Plan.java deleted file mode 100644 index d9d7e5ca960e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Plan.java +++ /dev/null @@ -1,154 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Plan for the resource. */ -@Fluent -public final class Plan { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Plan.class); - - /* - * The plan ID. - */ - @JsonProperty(value = "name") - private String name; - - /* - * The publisher ID. - */ - @JsonProperty(value = "publisher") - private String publisher; - - /* - * The offer ID. - */ - @JsonProperty(value = "product") - private String product; - - /* - * The promotion code. - */ - @JsonProperty(value = "promotionCode") - private String promotionCode; - - /* - * The plan's version. - */ - @JsonProperty(value = "version") - private String version; - - /** - * Get the name property: The plan ID. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The plan ID. - * - * @param name the name value to set. - * @return the Plan object itself. - */ - public Plan withName(String name) { - this.name = name; - return this; - } - - /** - * Get the publisher property: The publisher ID. - * - * @return the publisher value. - */ - public String publisher() { - return this.publisher; - } - - /** - * Set the publisher property: The publisher ID. - * - * @param publisher the publisher value to set. - * @return the Plan object itself. - */ - public Plan withPublisher(String publisher) { - this.publisher = publisher; - return this; - } - - /** - * Get the product property: The offer ID. - * - * @return the product value. - */ - public String product() { - return this.product; - } - - /** - * Set the product property: The offer ID. - * - * @param product the product value to set. - * @return the Plan object itself. - */ - public Plan withProduct(String product) { - this.product = product; - return this; - } - - /** - * Get the promotionCode property: The promotion code. - * - * @return the promotionCode value. - */ - public String promotionCode() { - return this.promotionCode; - } - - /** - * Set the promotionCode property: The promotion code. - * - * @param promotionCode the promotionCode value to set. - * @return the Plan object itself. - */ - public Plan withPromotionCode(String promotionCode) { - this.promotionCode = promotionCode; - return this; - } - - /** - * Get the version property: The plan's version. - * - * @return the version value. - */ - public String version() { - return this.version; - } - - /** - * Set the version property: The plan's version. - * - * @param version the version value to set. - * @return the Plan object itself. - */ - public Plan withVersion(String version) { - this.version = version; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PolicyAssignment.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PolicyAssignment.java deleted file mode 100644 index 434ef93e2333..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PolicyAssignment.java +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasId; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasName; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.model.Indexable; -import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; -import com.azure.resourcemanager.resources.fluent.models.PolicyAssignmentInner; - -/** - * An immutable client-side representation of an Azure policy assignment. - */ -@Fluent -public interface PolicyAssignment extends - HasName, - HasId, - Indexable, - Refreshable, - HasInnerModel { - - /** - * @return the policy assignment display name - */ - String displayName(); - - /** - * @return the policy definition Id - */ - String policyDefinitionId(); - - /** - * @return the scope at which the policy assignment exists - */ - String scope(); - - /** - * @return the type of the policy assignment - */ - String type(); - - /** - * @return the parameters of the policy assignment - */ - Object parameters(); - - /** - * Container interface for all the definitions that need to be implemented. - */ - interface Definition extends - PolicyAssignment.DefinitionStages.Blank, - PolicyAssignment.DefinitionStages.WithPolicyDefinition, - PolicyAssignment.DefinitionStages.WithCreate { - } - - /** - * Grouping of all the policy assignment definition stages. - */ - interface DefinitionStages { - /** - * The first stage of the policy assignment. - */ - interface Blank extends PolicyAssignment.DefinitionStages.WithScope { - } - - /** - * A policy assignment specifying the scope of the policy. - */ - interface WithScope { - /** - * Specifies the scope of the policy assignment. - * - * @param scope the scope of the policy assignment - * @return the next stage of policy assignment - */ - WithPolicyDefinition forScope(String scope); - - /** - * Specifies the scope of the policy assignment to be a resource group. - * - * @param resourceGroup the resource group to assign the policy - * @return the next stage of policy assignment - */ - WithPolicyDefinition forResourceGroup(ResourceGroup resourceGroup); - - /** - * Specifies the scope of the policy assignment to be a resource. - * - * @param genericResource the resource to assign the policy - * @return the next stage of policy assignment - */ - WithPolicyDefinition forResource(GenericResource genericResource); - } - - /** - * A policy assignment allowing the policy definition to be set. - */ - interface WithPolicyDefinition { - /** - * Specifies the policy assignment. - * - * @param policyDefinitionId the ID of the policy assignment - * @return the next stage of policy assignment - */ - WithCreate withPolicyDefinitionId(String policyDefinitionId); - - /** - * Specifies the policy definition. - * - * @param policyDefinition the policy definition - * @return the next stage of policy assignment - */ - WithCreate withPolicyDefinition(PolicyDefinition policyDefinition); - } - - /** - * A policy assignment allowing the display name to be set. - */ - interface WithDisplayName { - /** - * Specifies the display name of the policy assignment. - * - * @param displayName the display name of the policy assignment - * @return the next stage of policy assignment - */ - WithCreate withDisplayName(String displayName); - } - - /** - * A policy assignment allowing the parameters to be set. - */ - interface WithParameters { - /** - * Specifies the parameters of the policy assignment. - * - * @param parameters the parameters of the policy assignment - * @return the next stage of policy assignment - */ - WithCreate withParameters(Object parameters); - } - - /** - * A policy assignment with sufficient inputs to create a new policy - * assignment in the cloud, but exposing additional optional inputs to - * specify. - */ - interface WithCreate extends - Creatable, - DefinitionStages.WithDisplayName, - DefinitionStages.WithParameters { - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PolicyAssignmentListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PolicyAssignmentListResult.java deleted file mode 100644 index c6b1e820409b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PolicyAssignmentListResult.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.resources.fluent.models.PolicyAssignmentInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** List of policy assignments. */ -@Fluent -public final class PolicyAssignmentListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PolicyAssignmentListResult.class); - - /* - * An array of policy assignments. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to use for getting the next set of results. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: An array of policy assignments. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: An array of policy assignments. - * - * @param value the value value to set. - * @return the PolicyAssignmentListResult object itself. - */ - public PolicyAssignmentListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to use for getting the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The URL to use for getting the next set of results. - * - * @param nextLink the nextLink value to set. - * @return the PolicyAssignmentListResult object itself. - */ - public PolicyAssignmentListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PolicyAssignments.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PolicyAssignments.java deleted file mode 100644 index 9908724a22c7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PolicyAssignments.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsListingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsCreating; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingById; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; - -/** - * Entry point to policy assignment management API. - */ -@Fluent -public interface PolicyAssignments extends - SupportsListing, - SupportsListingByResourceGroup, - SupportsGettingById, - SupportsCreating, - SupportsDeletingById { - /** - * List policy assignments of the resource. - * - * @param resourceId the ID of the resource - * @return the list of policy assignments - */ - PagedIterable listByResource(String resourceId); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PolicyDefinition.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PolicyDefinition.java deleted file mode 100644 index 1ad892314607..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PolicyDefinition.java +++ /dev/null @@ -1,226 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluent.models.PolicyDefinitionInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasId; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasName; -import com.azure.resourcemanager.resources.fluentcore.model.Appliable; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.Indexable; -import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; -import com.azure.resourcemanager.resources.fluentcore.model.Updatable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; - -/** - * An immutable client-side representation of an Azure policy. - */ -@Fluent -public interface PolicyDefinition extends - HasName, - HasId, - Indexable, - Refreshable, - Updatable, - HasInnerModel { - - /** - * @return the type of the policy definition - */ - PolicyType policyType(); - - /** - * @return the policy definition display name - */ - String displayName(); - - /** - * @return the policy definition description - */ - String description(); - - /** - * @return the policy rule - */ - Object policyRule(); - - /** - * @return the parameters of the policy definition - */ - Object parameters(); - - /** - * Container interface for all the definitions that need to be implemented. - */ - interface Definition extends - DefinitionStages.Blank, - DefinitionStages.WithCreate { - } - - /** - * Grouping of all the policy definition stages. - */ - interface DefinitionStages { - /** - * The first stage of the policy definition. - */ - interface Blank extends WithPolicyRule { - } - - /** - * A policy definition allowing the policy rule to be set. - */ - interface WithPolicyRule { - /** - * Specifies the rule of the policy. - * - * @param policyRule the rule object - * @return the next stage of policy definition - */ - WithCreate withPolicyRule(Object policyRule); - - /** - * Specifies the rule of the policy in JSON format. - * - * @param policyRuleJson the rule object - * @return the next stage of policy definition - */ - WithCreate withPolicyRuleJson(String policyRuleJson); - } - - /** - * A policy definition specifying the policy type to be blob. - */ - interface WithPolicyType { - /** - * Specifies the type of the policy. The default value is 'NotSpecified'. - * - * @param policyType the policy type enum - * @return the next stage of policy definition - */ - WithCreate withPolicyType(PolicyType policyType); - } - - /** - * A policy definition allowing the display name to be set. - */ - interface WithDisplayName { - /** - * Specifies the display name of the policy. - * - * @param displayName the display name of the policy - * @return the next stage of policy definition - */ - WithCreate withDisplayName(String displayName); - } - - /** - * A policy definition allowing policy description to be set. - */ - interface WithDescription { - /** - * Specifies the description of the policy. - * - * @param description the description of the policy - * @return the next stage of policy definition - */ - WithCreate withDescription(String description); - } - - /** - * A policy definition allowing parameters to be set. - */ - interface WithParameters { - /** - * Specifies the parameters of the policy. - * - * @param parameters the parameters of the policy - * @return the next stage of policy definition - */ - WithCreate withParameters(Object parameters); - } - - /** - * A policy definition with sufficient inputs to create a new - * policy in the cloud, but exposing additional optional inputs to - * specify. - */ - interface WithCreate extends - Creatable, - DefinitionStages.WithDescription, - DefinitionStages.WithDisplayName, - DefinitionStages.WithPolicyType, - DefinitionStages.WithParameters { - } - } - - /** - * Grouping of all the policy update stages. - */ - interface UpdateStages { - /** - * A policy definition allowing the policy rule to be set. - */ - interface WithPolicyRule { - /** - * Specifies the rule of the policy. - * - * @param policyRule the rule object - * @return the next stage of policy update - */ - Update withPolicyRule(Object policyRule); - } - - /** - * A policy definition allowing the policy type to be set. - */ - interface WithPolicyType { - /** - * Specifies the type of the policy. The default value is 'NotSpecified'. - * - * @param policyType the policy type enum - * @return the next stage of policy update - */ - Update withPolicyType(PolicyType policyType); - } - - /** - * A policy definition allowing the display name to be set. - */ - interface WithDisplayName { - /** - * Specifies the display name of the policy. - * - * @param displayName the display name of the policy - * @return the next stage of policy update - */ - Update withDisplayName(String displayName); - } - - /** - * A policy definition allowing the policy description to be set. - */ - interface WithDescription { - /** - * Specifies the description of the policy. - * - * @param description the description of the policy - * @return the next stage of policy update - */ - Update withDescription(String description); - } - } - - /** - * The template for a policy update operation, containing all the settings that can be modified. - */ - interface Update extends - Appliable, - UpdateStages.WithDescription, - UpdateStages.WithDisplayName, - UpdateStages.WithPolicyRule, - UpdateStages.WithPolicyType { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PolicyDefinitionListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PolicyDefinitionListResult.java deleted file mode 100644 index f5e3138930b9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PolicyDefinitionListResult.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.resources.fluent.models.PolicyDefinitionInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** List of policy definitions. */ -@Fluent -public final class PolicyDefinitionListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PolicyDefinitionListResult.class); - - /* - * An array of policy definitions. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to use for getting the next set of results. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: An array of policy definitions. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: An array of policy definitions. - * - * @param value the value value to set. - * @return the PolicyDefinitionListResult object itself. - */ - public PolicyDefinitionListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to use for getting the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The URL to use for getting the next set of results. - * - * @param nextLink the nextLink value to set. - * @return the PolicyDefinitionListResult object itself. - */ - public PolicyDefinitionListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PolicyDefinitions.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PolicyDefinitions.java deleted file mode 100644 index 9fc5c10aea34..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PolicyDefinitions.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingByName; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsCreating; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingByName; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; - -/** - * Entry point to tenant management API. - */ -@Fluent -public interface PolicyDefinitions extends - SupportsListing, - SupportsGettingByName, - SupportsCreating, - SupportsDeletingByName { -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PolicyMode.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PolicyMode.java deleted file mode 100644 index b14782b185df..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PolicyMode.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for PolicyMode. */ -public final class PolicyMode extends ExpandableStringEnum { - /** Static value NotSpecified for PolicyMode. */ - public static final PolicyMode NOT_SPECIFIED = fromString("NotSpecified"); - - /** Static value Indexed for PolicyMode. */ - public static final PolicyMode INDEXED = fromString("Indexed"); - - /** Static value All for PolicyMode. */ - public static final PolicyMode ALL = fromString("All"); - - /** - * Creates or finds a PolicyMode from its string representation. - * - * @param name a name to look for. - * @return the corresponding PolicyMode. - */ - @JsonCreator - public static PolicyMode fromString(String name) { - return fromString(name, PolicyMode.class); - } - - /** @return known PolicyMode values. */ - public static Collection values() { - return values(PolicyMode.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PolicyType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PolicyType.java deleted file mode 100644 index 3888dc55091e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PolicyType.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for PolicyType. */ -public final class PolicyType extends ExpandableStringEnum { - /** Static value NotSpecified for PolicyType. */ - public static final PolicyType NOT_SPECIFIED = fromString("NotSpecified"); - - /** Static value BuiltIn for PolicyType. */ - public static final PolicyType BUILT_IN = fromString("BuiltIn"); - - /** Static value Custom for PolicyType. */ - public static final PolicyType CUSTOM = fromString("Custom"); - - /** - * Creates or finds a PolicyType from its string representation. - * - * @param name a name to look for. - * @return the corresponding PolicyType. - */ - @JsonCreator - public static PolicyType fromString(String name) { - return fromString(name, PolicyType.class); - } - - /** @return known PolicyType values. */ - public static Collection values() { - return values(PolicyType.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PropertyChangeType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PropertyChangeType.java deleted file mode 100644 index d477aa5c01ba..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PropertyChangeType.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for PropertyChangeType. */ -public enum PropertyChangeType { - /** Enum value Create. */ - CREATE("Create"), - - /** Enum value Delete. */ - DELETE("Delete"), - - /** Enum value Modify. */ - MODIFY("Modify"), - - /** Enum value Array. */ - ARRAY("Array"); - - /** The actual serialized value for a PropertyChangeType instance. */ - private final String value; - - PropertyChangeType(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a PropertyChangeType instance. - * - * @param value the serialized value to parse. - * @return the parsed PropertyChangeType object, or null if unable to parse. - */ - @JsonCreator - public static PropertyChangeType fromString(String value) { - PropertyChangeType[] items = PropertyChangeType.values(); - for (PropertyChangeType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Provider.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Provider.java deleted file mode 100644 index e7d395593231..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Provider.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.model.Indexable; -import com.azure.resourcemanager.resources.fluent.models.ProviderInner; - -import java.util.List; - -/** - * An immutable client-side representation of an Azure resource provider. - */ -@Fluent -public interface Provider extends - Indexable, - HasInnerModel { - - /** - * @return the namespace of the provider - */ - String namespace(); - - /** - * @return the registration state of the provider, indicating whether this - * resource provider is registered in the current subscription - */ - String registrationState(); - - /** - * @return the list of provider resource types - */ - List resourceTypes(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ProviderListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ProviderListResult.java deleted file mode 100644 index 8ee65e879b89..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ProviderListResult.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.resources.fluent.models.ProviderInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** List of resource providers. */ -@Fluent -public final class ProviderListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ProviderListResult.class); - - /* - * An array of resource providers. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to use for getting the next set of results. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: An array of resource providers. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: An array of resource providers. - * - * @param value the value value to set. - * @return the ProviderListResult object itself. - */ - public ProviderListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to use for getting the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ProviderResourceType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ProviderResourceType.java deleted file mode 100644 index e8f18c03b9f7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ProviderResourceType.java +++ /dev/null @@ -1,216 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** Resource type managed by the resource provider. */ -@Fluent -public final class ProviderResourceType { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ProviderResourceType.class); - - /* - * The resource type. - */ - @JsonProperty(value = "resourceType") - private String resourceType; - - /* - * The collection of locations where this resource type can be created. - */ - @JsonProperty(value = "locations") - private List locations; - - /* - * The aliases that are supported by this resource type. - */ - @JsonProperty(value = "aliases") - private List aliases; - - /* - * The API version. - */ - @JsonProperty(value = "apiVersions") - private List apiVersions; - - /* - * The zoneMappings property. - */ - @JsonProperty(value = "zoneMappings") - private List zoneMappings; - - /* - * The additional capabilities offered by this resource type. - */ - @JsonProperty(value = "capabilities") - private String capabilities; - - /* - * The properties. - */ - @JsonProperty(value = "properties") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map properties; - - /** - * Get the resourceType property: The resource type. - * - * @return the resourceType value. - */ - public String resourceType() { - return this.resourceType; - } - - /** - * Set the resourceType property: The resource type. - * - * @param resourceType the resourceType value to set. - * @return the ProviderResourceType object itself. - */ - public ProviderResourceType withResourceType(String resourceType) { - this.resourceType = resourceType; - return this; - } - - /** - * Get the locations property: The collection of locations where this resource type can be created. - * - * @return the locations value. - */ - public List locations() { - return this.locations; - } - - /** - * Set the locations property: The collection of locations where this resource type can be created. - * - * @param locations the locations value to set. - * @return the ProviderResourceType object itself. - */ - public ProviderResourceType withLocations(List locations) { - this.locations = locations; - return this; - } - - /** - * Get the aliases property: The aliases that are supported by this resource type. - * - * @return the aliases value. - */ - public List aliases() { - return this.aliases; - } - - /** - * Set the aliases property: The aliases that are supported by this resource type. - * - * @param aliases the aliases value to set. - * @return the ProviderResourceType object itself. - */ - public ProviderResourceType withAliases(List aliases) { - this.aliases = aliases; - return this; - } - - /** - * Get the apiVersions property: The API version. - * - * @return the apiVersions value. - */ - public List apiVersions() { - return this.apiVersions; - } - - /** - * Set the apiVersions property: The API version. - * - * @param apiVersions the apiVersions value to set. - * @return the ProviderResourceType object itself. - */ - public ProviderResourceType withApiVersions(List apiVersions) { - this.apiVersions = apiVersions; - return this; - } - - /** - * Get the zoneMappings property: The zoneMappings property. - * - * @return the zoneMappings value. - */ - public List zoneMappings() { - return this.zoneMappings; - } - - /** - * Set the zoneMappings property: The zoneMappings property. - * - * @param zoneMappings the zoneMappings value to set. - * @return the ProviderResourceType object itself. - */ - public ProviderResourceType withZoneMappings(List zoneMappings) { - this.zoneMappings = zoneMappings; - return this; - } - - /** - * Get the capabilities property: The additional capabilities offered by this resource type. - * - * @return the capabilities value. - */ - public String capabilities() { - return this.capabilities; - } - - /** - * Set the capabilities property: The additional capabilities offered by this resource type. - * - * @param capabilities the capabilities value to set. - * @return the ProviderResourceType object itself. - */ - public ProviderResourceType withCapabilities(String capabilities) { - this.capabilities = capabilities; - return this; - } - - /** - * Get the properties property: The properties. - * - * @return the properties value. - */ - public Map properties() { - return this.properties; - } - - /** - * Set the properties property: The properties. - * - * @param properties the properties value to set. - * @return the ProviderResourceType object itself. - */ - public ProviderResourceType withProperties(Map properties) { - this.properties = properties; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (aliases() != null) { - aliases().forEach(e -> e.validate()); - } - if (zoneMappings() != null) { - zoneMappings().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Providers.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Providers.java deleted file mode 100644 index 9c54e866e929..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Providers.java +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingByName; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; -import reactor.core.publisher.Mono; - -/** - * Entry point to providers management API. - */ -@Fluent -public interface Providers extends - SupportsListing, - SupportsGettingByName { - /** - * Unregisters provider from a subscription. - * - * @param resourceProviderNamespace Namespace of the resource provider - * @return the Provider if successful - */ - Provider unregister(String resourceProviderNamespace); - - /** - * Unregisters provider from a subscription asynchronously. - * - * @param resourceProviderNamespace Namespace of the resource provider - * @return a representation of the deferred computation of this call - * returning the unregistered Provider if successful - */ - Mono unregisterAsync(String resourceProviderNamespace); - - /** - * Registers provider to be used with a subscription. - * - * @param resourceProviderNamespace namespace of the resource provider - * @return the registered provider - */ - Provider register(String resourceProviderNamespace); - - /** - * Registers provider to be used with a subscription asynchronously. - * - * @param resourceProviderNamespace Namespace of the resource provider - * @return a representation of the deferred computation of this call returning the registered provider if successful - */ - Mono registerAsync(String resourceProviderNamespace); - - /** - * Gets the information about a provider from Azure based on the provider name. - * - * @param name the name of the provider - * @return a representation of the deferred computation of this call returning the found provider, if any - */ - Mono getByNameAsync(String name); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ProvisioningOperation.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ProvisioningOperation.java deleted file mode 100644 index 411b215b5c0c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ProvisioningOperation.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for ProvisioningOperation. */ -public enum ProvisioningOperation { - /** Enum value NotSpecified. */ - NOT_SPECIFIED("NotSpecified"), - - /** Enum value Create. */ - CREATE("Create"), - - /** Enum value Delete. */ - DELETE("Delete"), - - /** Enum value Waiting. */ - WAITING("Waiting"), - - /** Enum value AzureAsyncOperationWaiting. */ - AZURE_ASYNC_OPERATION_WAITING("AzureAsyncOperationWaiting"), - - /** Enum value ResourceCacheWaiting. */ - RESOURCE_CACHE_WAITING("ResourceCacheWaiting"), - - /** Enum value Action. */ - ACTION("Action"), - - /** Enum value Read. */ - READ("Read"), - - /** Enum value EvaluateDeploymentOutput. */ - EVALUATE_DEPLOYMENT_OUTPUT("EvaluateDeploymentOutput"), - - /** Enum value DeploymentCleanup. */ - DEPLOYMENT_CLEANUP("DeploymentCleanup"); - - /** The actual serialized value for a ProvisioningOperation instance. */ - private final String value; - - ProvisioningOperation(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a ProvisioningOperation instance. - * - * @param value the serialized value to parse. - * @return the parsed ProvisioningOperation object, or null if unable to parse. - */ - @JsonCreator - public static ProvisioningOperation fromString(String value) { - ProvisioningOperation[] items = ProvisioningOperation.values(); - for (ProvisioningOperation item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceConnector.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceConnector.java deleted file mode 100644 index cd3574089c26..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceConnector.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -///** -// * Copyright (c) Microsoft Corporation. All rights reserved. -// * Licensed under the MIT License. See License.txt in the project root for -// * license information. -// */ -// -//package com.azure.management.resources; -// -//import com.microsoft.rest.RestClient; -//import com.microsoft.azure.management.apigeneration.Fluent; -// -///** -// * Defines a connector that connects other resources to a resource group. -// * Implementations of this class can let users browse resources inside a -// * specific resource group. -// */ -//@Fluent -//public interface ResourceConnector { -// /** -// * Implementations of this interface defines how to create a connector. -// * -// * @param the type of the connector to create. -// */ -// interface Builder { -// T create(RestClient restClient, String subscriptionId, ResourceGroup resourceGroup); -// } -//} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceGroup.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceGroup.java deleted file mode 100644 index 8df97d114e00..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceGroup.java +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.arm.models.GroupableResource; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasName; -import com.azure.resourcemanager.resources.fluentcore.arm.models.Resource; -import com.azure.resourcemanager.resources.fluentcore.model.Appliable; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.model.Indexable; -import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; -import com.azure.resourcemanager.resources.fluentcore.model.Updatable; -import com.azure.resourcemanager.resources.fluent.models.ResourceGroupInner; -import reactor.core.publisher.Mono; - -/** - * An immutable client-side representation of an Azure resource group. - */ -@Fluent -public interface ResourceGroup extends - Indexable, - Resource, - Refreshable, - HasInnerModel, - Updatable, - HasName { - - /** - * @return the provisioning state of the resource group - */ - String provisioningState(); - - /** - * Captures the specified resource group as a template. - * - * @param options the export options - * @return the exported template result - */ - ResourceGroupExportResult exportTemplate(ResourceGroupExportTemplateOptions options); - - /** - * Captures the specified resource group as a template asynchronously. - * - * @param options the export options - * @return a representation of the deferred computation of this call returning the result of the template export - */ - Mono exportTemplateAsync(ResourceGroupExportTemplateOptions options); - - - /** - * Container interface for all the definitions that need to be implemented. - */ - interface Definition extends - DefinitionStages.Blank, - DefinitionStages.WithCreate { - } - - /** - * Grouping of all the resource group definition stages. - */ - interface DefinitionStages { - /** - * A resource group definition allowing location to be set. - */ - interface Blank extends GroupableResource.DefinitionWithRegion { - } - - /** - * A resource group definition with sufficient inputs to create a new - * resource group in the cloud, but exposing additional optional inputs to - * specify. - */ - interface WithCreate extends - Creatable, - Resource.DefinitionWithTags { - } - } - - /** - * Grouping of all the resource group update stages. - */ - interface UpdateStages { - } - - /** - * The template for a resource group update operation, containing all the settings that can be modified. - *

    - * Call {@link Update#apply()} to apply the changes to the resource group in Azure. - */ - interface Update extends - Appliable, - Resource.UpdateWithTags { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceGroupExportResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceGroupExportResult.java deleted file mode 100644 index 57386219258d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceGroupExportResult.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.exception.ManagementError; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluent.models.ResourceGroupExportResultInner; - -/** - * An immutable client-side representation of an Azure deployment template export result. - */ -@Fluent -public interface ResourceGroupExportResult extends - HasInnerModel { - - /** - * @return the template content - */ - Object template(); - - /** - * @return the template content as a JSON string - */ - String templateJson(); - - /** - * @return the error, if any. - */ - ManagementError error(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceGroupExportTemplateOptions.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceGroupExportTemplateOptions.java deleted file mode 100644 index f6f72e1efff2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceGroupExportTemplateOptions.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.models; - -/** - * The export template options. - */ -public enum ResourceGroupExportTemplateOptions { - /** - * Includes default parameter values. - */ - INCLUDE_PARAMETER_DEFAULT_VALUE("IncludeParameterDefaultValue"), - - /** - * Includes comments. - */ - INCLUDE_COMMENTS("IncludeComments"), - - /** - * Includes default parameter values and comments. - */ - INCLUDE_BOTH("IncludeParameterDefaultValue, IncludeComments"); - - private String value; - - ResourceGroupExportTemplateOptions(String value) { - this.value = value; - } - - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceGroupListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceGroupListResult.java deleted file mode 100644 index 7ae0ae3fc85e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceGroupListResult.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.resources.fluent.models.ResourceGroupInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** List of resource groups. */ -@Fluent -public final class ResourceGroupListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceGroupListResult.class); - - /* - * An array of resource groups. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to use for getting the next set of results. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: An array of resource groups. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: An array of resource groups. - * - * @param value the value value to set. - * @return the ResourceGroupListResult object itself. - */ - public ResourceGroupListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to use for getting the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceGroupPatchable.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceGroupPatchable.java deleted file mode 100644 index e5562219f771..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceGroupPatchable.java +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** Resource group information. */ -@Fluent -public final class ResourceGroupPatchable { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceGroupPatchable.class); - - /* - * The name of the resource group. - */ - @JsonProperty(value = "name") - private String name; - - /* - * The resource group properties. - */ - @JsonProperty(value = "properties") - private ResourceGroupProperties properties; - - /* - * The ID of the resource that manages this resource group. - */ - @JsonProperty(value = "managedBy") - private String managedBy; - - /* - * The tags attached to the resource group. - */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map tags; - - /** - * Get the name property: The name of the resource group. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the resource group. - * - * @param name the name value to set. - * @return the ResourceGroupPatchable object itself. - */ - public ResourceGroupPatchable withName(String name) { - this.name = name; - return this; - } - - /** - * Get the properties property: The resource group properties. - * - * @return the properties value. - */ - public ResourceGroupProperties properties() { - return this.properties; - } - - /** - * Set the properties property: The resource group properties. - * - * @param properties the properties value to set. - * @return the ResourceGroupPatchable object itself. - */ - public ResourceGroupPatchable withProperties(ResourceGroupProperties properties) { - this.properties = properties; - return this; - } - - /** - * Get the managedBy property: The ID of the resource that manages this resource group. - * - * @return the managedBy value. - */ - public String managedBy() { - return this.managedBy; - } - - /** - * Set the managedBy property: The ID of the resource that manages this resource group. - * - * @param managedBy the managedBy value to set. - * @return the ResourceGroupPatchable object itself. - */ - public ResourceGroupPatchable withManagedBy(String managedBy) { - this.managedBy = managedBy; - return this; - } - - /** - * Get the tags property: The tags attached to the resource group. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: The tags attached to the resource group. - * - * @param tags the tags value to set. - * @return the ResourceGroupPatchable object itself. - */ - public ResourceGroupPatchable withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceGroupProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceGroupProperties.java deleted file mode 100644 index 434ba9a9ae68..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceGroupProperties.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The resource group properties. */ -@Immutable -public final class ResourceGroupProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceGroupProperties.class); - - /* - * The provisioning state. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; - - /** - * Get the provisioningState property: The provisioning state. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceGroups.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceGroups.java deleted file mode 100644 index da31f7340445..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceGroups.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.ResourceManager; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingByName; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsBatchCreation; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsCreating; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingByName; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListingByTag; -import com.azure.resourcemanager.resources.fluentcore.model.Accepted; - -/** - * Entry point to resource group management API. - */ -@Fluent -public interface ResourceGroups extends - SupportsListing, - SupportsListingByTag, - SupportsGettingByName, - SupportsCreating, - SupportsDeletingByName, - //SupportsBeginDeletingByName, - SupportsBatchCreation, - HasManager { - - /** - * Checks whether resource group exists. - * - * @param name the name (case insensitive) of the resource group to check for - * @return true of exists, otherwise false - */ - boolean contain(String name); - - /** - * Begins deleting a resource group from Azure, identifying it by its name. - * - * @param name the resource group name - * @return the accepted deleting operation - */ - Accepted beginDeleteByName(String name); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceIdentityType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceIdentityType.java deleted file mode 100644 index 0e4c58cfb21f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceIdentityType.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for ResourceIdentityType. */ -public enum ResourceIdentityType { - /** Enum value SystemAssigned. */ - SYSTEM_ASSIGNED("SystemAssigned"), - - /** Enum value UserAssigned. */ - USER_ASSIGNED("UserAssigned"), - - /** Enum value SystemAssigned, UserAssigned. */ - SYSTEM_ASSIGNED_USER_ASSIGNED("SystemAssigned, UserAssigned"), - - /** Enum value None. */ - NONE("None"); - - /** The actual serialized value for a ResourceIdentityType instance. */ - private final String value; - - ResourceIdentityType(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a ResourceIdentityType instance. - * - * @param value the serialized value to parse. - * @return the parsed ResourceIdentityType object, or null if unable to parse. - */ - @JsonCreator - public static ResourceIdentityType fromString(String value) { - ResourceIdentityType[] items = ResourceIdentityType.values(); - for (ResourceIdentityType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceListResult.java deleted file mode 100644 index 7a7f77a3fd90..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceListResult.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.resources.fluent.models.GenericResourceExpandedInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** List of resource groups. */ -@Fluent -public final class ResourceListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceListResult.class); - - /* - * An array of resources. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to use for getting the next set of results. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: An array of resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: An array of resources. - * - * @param value the value value to set. - * @return the ResourceListResult object itself. - */ - public ResourceListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to use for getting the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceName.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceName.java deleted file mode 100644 index ccd6783d9de3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceName.java +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Name and Type of the Resource. */ -@Fluent -public final class ResourceName { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceName.class); - - /* - * Name of the resource - */ - @JsonProperty(value = "name", required = true) - private String name; - - /* - * The type of the resource - */ - @JsonProperty(value = "type", required = true) - private String type; - - /** - * Get the name property: Name of the resource. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Name of the resource. - * - * @param name the name value to set. - * @return the ResourceName object itself. - */ - public ResourceName withName(String name) { - this.name = name; - return this; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Set the type property: The type of the resource. - * - * @param type the type value to set. - * @return the ResourceName object itself. - */ - public ResourceName withType(String type) { - this.type = type; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property name in model ResourceName")); - } - if (type() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property type in model ResourceName")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceNameStatus.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceNameStatus.java deleted file mode 100644 index ee6e544dfb21..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceNameStatus.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ResourceNameStatus. */ -public final class ResourceNameStatus extends ExpandableStringEnum { - /** Static value Allowed for ResourceNameStatus. */ - public static final ResourceNameStatus ALLOWED = fromString("Allowed"); - - /** Static value Reserved for ResourceNameStatus. */ - public static final ResourceNameStatus RESERVED = fromString("Reserved"); - - /** - * Creates or finds a ResourceNameStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding ResourceNameStatus. - */ - @JsonCreator - public static ResourceNameStatus fromString(String name) { - return fromString(name, ResourceNameStatus.class); - } - - /** @return known ResourceNameStatus values. */ - public static Collection values() { - return values(ResourceNameStatus.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceReference.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceReference.java deleted file mode 100644 index 4093c5f96647..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceReference.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The resource Id model. */ -@Immutable -public final class ResourceReference { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceReference.class); - - /* - * The fully qualified resource Id. - */ - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) - private String id; - - /** - * Get the id property: The fully qualified resource Id. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourcesMoveInfo.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourcesMoveInfo.java deleted file mode 100644 index ca2d11ed564c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourcesMoveInfo.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Parameters of move resources. */ -@Fluent -public final class ResourcesMoveInfo { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourcesMoveInfo.class); - - /* - * The IDs of the resources. - */ - @JsonProperty(value = "resources") - private List resources; - - /* - * The target resource group. - */ - @JsonProperty(value = "targetResourceGroup") - private String targetResourceGroup; - - /** - * Get the resources property: The IDs of the resources. - * - * @return the resources value. - */ - public List resources() { - return this.resources; - } - - /** - * Set the resources property: The IDs of the resources. - * - * @param resources the resources value to set. - * @return the ResourcesMoveInfo object itself. - */ - public ResourcesMoveInfo withResources(List resources) { - this.resources = resources; - return this; - } - - /** - * Get the targetResourceGroup property: The target resource group. - * - * @return the targetResourceGroup value. - */ - public String targetResourceGroup() { - return this.targetResourceGroup; - } - - /** - * Set the targetResourceGroup property: The target resource group. - * - * @param targetResourceGroup the targetResourceGroup value to set. - * @return the ResourcesMoveInfo object itself. - */ - public ResourcesMoveInfo withTargetResourceGroup(String targetResourceGroup) { - this.targetResourceGroup = targetResourceGroup; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ScopedDeployment.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ScopedDeployment.java deleted file mode 100644 index e4ee85859c71..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ScopedDeployment.java +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** Deployment operation parameters. */ -@Fluent -public final class ScopedDeployment { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ScopedDeployment.class); - - /* - * The location to store the deployment data. - */ - @JsonProperty(value = "location", required = true) - private String location; - - /* - * The deployment properties. - */ - @JsonProperty(value = "properties", required = true) - private DeploymentProperties properties; - - /* - * Deployment tags - */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map tags; - - /** - * Get the location property: The location to store the deployment data. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Set the location property: The location to store the deployment data. - * - * @param location the location value to set. - * @return the ScopedDeployment object itself. - */ - public ScopedDeployment withLocation(String location) { - this.location = location; - return this; - } - - /** - * Get the properties property: The deployment properties. - * - * @return the properties value. - */ - public DeploymentProperties properties() { - return this.properties; - } - - /** - * Set the properties property: The deployment properties. - * - * @param properties the properties value to set. - * @return the ScopedDeployment object itself. - */ - public ScopedDeployment withProperties(DeploymentProperties properties) { - this.properties = properties; - return this; - } - - /** - * Get the tags property: Deployment tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Deployment tags. - * - * @param tags the tags value to set. - * @return the ScopedDeployment object itself. - */ - public ScopedDeployment withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (location() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property location in model ScopedDeployment")); - } - if (properties() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property properties in model ScopedDeployment")); - } else { - properties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ScopedDeploymentWhatIf.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ScopedDeploymentWhatIf.java deleted file mode 100644 index 1b1ac3f91e6a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ScopedDeploymentWhatIf.java +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Deployment What-if operation parameters. */ -@Fluent -public final class ScopedDeploymentWhatIf { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ScopedDeploymentWhatIf.class); - - /* - * The location to store the deployment data. - */ - @JsonProperty(value = "location", required = true) - private String location; - - /* - * The deployment properties. - */ - @JsonProperty(value = "properties", required = true) - private DeploymentWhatIfProperties properties; - - /** - * Get the location property: The location to store the deployment data. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Set the location property: The location to store the deployment data. - * - * @param location the location value to set. - * @return the ScopedDeploymentWhatIf object itself. - */ - public ScopedDeploymentWhatIf withLocation(String location) { - this.location = location; - return this; - } - - /** - * Get the properties property: The deployment properties. - * - * @return the properties value. - */ - public DeploymentWhatIfProperties properties() { - return this.properties; - } - - /** - * Set the properties property: The deployment properties. - * - * @param properties the properties value to set. - * @return the ScopedDeploymentWhatIf object itself. - */ - public ScopedDeploymentWhatIf withProperties(DeploymentWhatIfProperties properties) { - this.properties = properties; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (location() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property location in model ScopedDeploymentWhatIf")); - } - if (properties() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property properties in model ScopedDeploymentWhatIf")); - } else { - properties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Sku.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Sku.java deleted file mode 100644 index 8e7fe6280ecc..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Sku.java +++ /dev/null @@ -1,180 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** SKU for the resource. */ -@Fluent -public final class Sku { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Sku.class); - - /* - * The SKU name. - */ - @JsonProperty(value = "name") - private String name; - - /* - * The SKU tier. - */ - @JsonProperty(value = "tier") - private String tier; - - /* - * The SKU size. - */ - @JsonProperty(value = "size") - private String size; - - /* - * The SKU family. - */ - @JsonProperty(value = "family") - private String family; - - /* - * The SKU model. - */ - @JsonProperty(value = "model") - private String model; - - /* - * The SKU capacity. - */ - @JsonProperty(value = "capacity") - private Integer capacity; - - /** - * Get the name property: The SKU name. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The SKU name. - * - * @param name the name value to set. - * @return the Sku object itself. - */ - public Sku withName(String name) { - this.name = name; - return this; - } - - /** - * Get the tier property: The SKU tier. - * - * @return the tier value. - */ - public String tier() { - return this.tier; - } - - /** - * Set the tier property: The SKU tier. - * - * @param tier the tier value to set. - * @return the Sku object itself. - */ - public Sku withTier(String tier) { - this.tier = tier; - return this; - } - - /** - * Get the size property: The SKU size. - * - * @return the size value. - */ - public String size() { - return this.size; - } - - /** - * Set the size property: The SKU size. - * - * @param size the size value to set. - * @return the Sku object itself. - */ - public Sku withSize(String size) { - this.size = size; - return this; - } - - /** - * Get the family property: The SKU family. - * - * @return the family value. - */ - public String family() { - return this.family; - } - - /** - * Set the family property: The SKU family. - * - * @param family the family value to set. - * @return the Sku object itself. - */ - public Sku withFamily(String family) { - this.family = family; - return this; - } - - /** - * Get the model property: The SKU model. - * - * @return the model value. - */ - public String model() { - return this.model; - } - - /** - * Set the model property: The SKU model. - * - * @param model the model value to set. - * @return the Sku object itself. - */ - public Sku withModel(String model) { - this.model = model; - return this; - } - - /** - * Get the capacity property: The SKU capacity. - * - * @return the capacity value. - */ - public Integer capacity() { - return this.capacity; - } - - /** - * Set the capacity property: The SKU capacity. - * - * @param capacity the capacity value to set. - * @return the Sku object itself. - */ - public Sku withCapacity(Integer capacity) { - this.capacity = capacity; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/SpendingLimit.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/SpendingLimit.java deleted file mode 100644 index d28619e5fa1f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/SpendingLimit.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for SpendingLimit. */ -public enum SpendingLimit { - /** Enum value On. */ - ON("On"), - - /** Enum value Off. */ - OFF("Off"), - - /** Enum value CurrentPeriodOff. */ - CURRENT_PERIOD_OFF("CurrentPeriodOff"); - - /** The actual serialized value for a SpendingLimit instance. */ - private final String value; - - SpendingLimit(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a SpendingLimit instance. - * - * @param value the serialized value to parse. - * @return the parsed SpendingLimit object, or null if unable to parse. - */ - @JsonCreator - public static SpendingLimit fromString(String value) { - SpendingLimit[] items = SpendingLimit.values(); - for (SpendingLimit item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Subscription.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Subscription.java deleted file mode 100644 index ef055b766297..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Subscription.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.Region; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.model.Indexable; -import com.azure.resourcemanager.resources.fluent.models.SubscriptionInner; - -/** - * An immutable client-side representation of an Azure subscription. - */ -@Fluent -public interface Subscription extends - Indexable, - HasInnerModel { - - /** - * @return the UUID of the subscription - */ - String subscriptionId(); - - /** - * @return the name of the subscription for humans to read - */ - String displayName(); - - /** - * @return the state of the subscription. - */ - SubscriptionState state(); - - /** - * @return the policies defined in the subscription - */ - SubscriptionPolicies subscriptionPolicies(); - - /** - * List the locations the subscription has access to. - * - * @return the lazy list of locations - */ - - PagedIterable listLocations(); - - /** - * Gets the data center location for the specified region, if the selected subscription has access to it. - * - * @param region an Azure region - * @return an Azure data center location, or null if the location is not accessible to this subscription - */ - Location getLocationByRegion(Region region); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/SubscriptionListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/SubscriptionListResult.java deleted file mode 100644 index 5a99469d2f6e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/SubscriptionListResult.java +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.resources.fluent.models.SubscriptionInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Subscription list operation response. */ -@Fluent -public final class SubscriptionListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SubscriptionListResult.class); - - /* - * An array of subscriptions. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to get the next set of results. - */ - @JsonProperty(value = "nextLink", required = true) - private String nextLink; - - /** - * Get the value property: An array of subscriptions. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: An array of subscriptions. - * - * @param value the value value to set. - * @return the SubscriptionListResult object itself. - */ - public SubscriptionListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to get the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The URL to get the next set of results. - * - * @param nextLink the nextLink value to set. - * @return the SubscriptionListResult object itself. - */ - public SubscriptionListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - if (nextLink() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property nextLink in model SubscriptionListResult")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/SubscriptionPolicies.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/SubscriptionPolicies.java deleted file mode 100644 index 420968815b2e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/SubscriptionPolicies.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Subscription policies. */ -@Immutable -public final class SubscriptionPolicies { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SubscriptionPolicies.class); - - /* - * The subscription location placement ID. The ID indicates which regions - * are visible for a subscription. For example, a subscription with a - * location placement Id of Public_2014-09-01 has access to Azure public - * regions. - */ - @JsonProperty(value = "locationPlacementId", access = JsonProperty.Access.WRITE_ONLY) - private String locationPlacementId; - - /* - * The subscription quota ID. - */ - @JsonProperty(value = "quotaId", access = JsonProperty.Access.WRITE_ONLY) - private String quotaId; - - /* - * The subscription spending limit. - */ - @JsonProperty(value = "spendingLimit", access = JsonProperty.Access.WRITE_ONLY) - private SpendingLimit spendingLimit; - - /** - * Get the locationPlacementId property: The subscription location placement ID. The ID indicates which regions are - * visible for a subscription. For example, a subscription with a location placement Id of Public_2014-09-01 has - * access to Azure public regions. - * - * @return the locationPlacementId value. - */ - public String locationPlacementId() { - return this.locationPlacementId; - } - - /** - * Get the quotaId property: The subscription quota ID. - * - * @return the quotaId value. - */ - public String quotaId() { - return this.quotaId; - } - - /** - * Get the spendingLimit property: The subscription spending limit. - * - * @return the spendingLimit value. - */ - public SpendingLimit spendingLimit() { - return this.spendingLimit; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/SubscriptionState.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/SubscriptionState.java deleted file mode 100644 index 7dc2ddc64dd9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/SubscriptionState.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for SubscriptionState. */ -public enum SubscriptionState { - /** Enum value Enabled. */ - ENABLED("Enabled"), - - /** Enum value Warned. */ - WARNED("Warned"), - - /** Enum value PastDue. */ - PAST_DUE("PastDue"), - - /** Enum value Disabled. */ - DISABLED("Disabled"), - - /** Enum value Deleted. */ - DELETED("Deleted"); - - /** The actual serialized value for a SubscriptionState instance. */ - private final String value; - - SubscriptionState(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a SubscriptionState instance. - * - * @param value the serialized value to parse. - * @return the parsed SubscriptionState object, or null if unable to parse. - */ - @JsonCreator - public static SubscriptionState fromString(String value) { - SubscriptionState[] items = SubscriptionState.values(); - for (SubscriptionState item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Subscriptions.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Subscriptions.java deleted file mode 100644 index a8ad44227e64..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Subscriptions.java +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; - -/** - * Entry point to subscription management API. - */ -@Fluent -public interface Subscriptions extends - SupportsListing, - SupportsGettingById { -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/TagCount.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/TagCount.java deleted file mode 100644 index 68032d97d6ad..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/TagCount.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Tag count. */ -@Fluent -public final class TagCount { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TagCount.class); - - /* - * Type of count. - */ - @JsonProperty(value = "type") - private String type; - - /* - * Value of count. - */ - @JsonProperty(value = "value") - private Integer value; - - /** - * Get the type property: Type of count. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Set the type property: Type of count. - * - * @param type the type value to set. - * @return the TagCount object itself. - */ - public TagCount withType(String type) { - this.type = type; - return this; - } - - /** - * Get the value property: Value of count. - * - * @return the value value. - */ - public Integer value() { - return this.value; - } - - /** - * Set the value property: Value of count. - * - * @param value the value value to set. - * @return the TagCount object itself. - */ - public TagCount withValue(Integer value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/TagOperations.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/TagOperations.java deleted file mode 100644 index 80406574c64c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/TagOperations.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.models; - -import com.azure.resourcemanager.resources.ResourceManager; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.arm.models.Resource; -import reactor.core.publisher.Mono; - -import java.util.Map; - -/** - * Entry point to tag management API. - */ -public interface TagOperations extends HasManager { - - /** - * Updates the tags of the Azure resource. - * - * @param resource the Azure resource to have its tags updated - * @param tags the tags - * @return the resource with updated tags - */ - TagResource updateTags(Resource resource, Map tags); - - /** - * Updates the tags of the Azure resource. - * - * @param resourceId the ID of the Azure resource to have its tags updated - * @param tags the tags - * @return the resource with updated tags - */ - TagResource updateTags(String resourceId, Map tags); - - /** - * Updates the tags of the Azure resource. - * - * @param resource the Azure resource to have its tags updated - * @param tags the tags - * @return the resource with updated tags - */ - Mono updateTagsAsync(Resource resource, Map tags); - - /** - * Updates the tags of the Azure resource. - * - * @param resourceId the ID of the Azure resource to have its tags updated - * @param tags the tags - * @return the resource with updated tags - */ - Mono updateTagsAsync(String resourceId, Map tags); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/TagResource.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/TagResource.java deleted file mode 100644 index ede5a32ef4d4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/TagResource.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.models; - -import com.azure.resourcemanager.resources.fluent.models.TagsResourceInner; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasId; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasName; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; - -import java.util.Map; - -/** - * An immutable client-side representation of an Azure resource with tags. - */ -public interface TagResource extends - HasId, HasName, HasInnerModel { - - /** - * @return the type of the resource - */ - String type(); - - /** - * @return the tags for the resource - */ - Map tags(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Tags.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Tags.java deleted file mode 100644 index d10aa32983fd..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Tags.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** A dictionary of name and value pairs. */ -@Fluent -public final class Tags { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Tags.class); - - /* - * Dictionary of - */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map tags; - - /** - * Get the tags property: Dictionary of <string>. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Dictionary of <string>. - * - * @param tags the tags value to set. - * @return the Tags object itself. - */ - public Tags withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/TagsListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/TagsListResult.java deleted file mode 100644 index 0886e5977f74..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/TagsListResult.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.resources.fluent.models.TagDetailsInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** List of subscription tags. */ -@Fluent -public final class TagsListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TagsListResult.class); - - /* - * An array of tags. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to use for getting the next set of results. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: An array of tags. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: An array of tags. - * - * @param value the value value to set. - * @return the TagsListResult object itself. - */ - public TagsListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to use for getting the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/TagsPatchOperation.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/TagsPatchOperation.java deleted file mode 100644 index 90c47cc2874d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/TagsPatchOperation.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for TagsPatchOperation. */ -public final class TagsPatchOperation extends ExpandableStringEnum { - /** Static value Replace for TagsPatchOperation. */ - public static final TagsPatchOperation REPLACE = fromString("Replace"); - - /** Static value Merge for TagsPatchOperation. */ - public static final TagsPatchOperation MERGE = fromString("Merge"); - - /** Static value Delete for TagsPatchOperation. */ - public static final TagsPatchOperation DELETE = fromString("Delete"); - - /** - * Creates or finds a TagsPatchOperation from its string representation. - * - * @param name a name to look for. - * @return the corresponding TagsPatchOperation. - */ - @JsonCreator - public static TagsPatchOperation fromString(String name) { - return fromString(name, TagsPatchOperation.class); - } - - /** @return known TagsPatchOperation values. */ - public static Collection values() { - return values(TagsPatchOperation.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/TagsPatchResource.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/TagsPatchResource.java deleted file mode 100644 index 5cd1ae269e8e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/TagsPatchResource.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Wrapper resource for tags patch API request only. */ -@Fluent -public final class TagsPatchResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TagsPatchResource.class); - - /* - * The operation type for the patch API. - */ - @JsonProperty(value = "operation") - private TagsPatchOperation operation; - - /* - * The set of tags. - */ - @JsonProperty(value = "properties") - private Tags properties; - - /** - * Get the operation property: The operation type for the patch API. - * - * @return the operation value. - */ - public TagsPatchOperation operation() { - return this.operation; - } - - /** - * Set the operation property: The operation type for the patch API. - * - * @param operation the operation value to set. - * @return the TagsPatchResource object itself. - */ - public TagsPatchResource withOperation(TagsPatchOperation operation) { - this.operation = operation; - return this; - } - - /** - * Get the properties property: The set of tags. - * - * @return the properties value. - */ - public Tags properties() { - return this.properties; - } - - /** - * Set the properties property: The set of tags. - * - * @param properties the properties value to set. - * @return the TagsPatchResource object itself. - */ - public TagsPatchResource withProperties(Tags properties) { - this.properties = properties; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/TargetResource.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/TargetResource.java deleted file mode 100644 index b3c91e58a594..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/TargetResource.java +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Target resource. */ -@Fluent -public final class TargetResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TargetResource.class); - - /* - * The ID of the resource. - */ - @JsonProperty(value = "id") - private String id; - - /* - * The name of the resource. - */ - @JsonProperty(value = "resourceName") - private String resourceName; - - /* - * The type of the resource. - */ - @JsonProperty(value = "resourceType") - private String resourceType; - - /** - * Get the id property: The ID of the resource. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: The ID of the resource. - * - * @param id the id value to set. - * @return the TargetResource object itself. - */ - public TargetResource withId(String id) { - this.id = id; - return this; - } - - /** - * Get the resourceName property: The name of the resource. - * - * @return the resourceName value. - */ - public String resourceName() { - return this.resourceName; - } - - /** - * Set the resourceName property: The name of the resource. - * - * @param resourceName the resourceName value to set. - * @return the TargetResource object itself. - */ - public TargetResource withResourceName(String resourceName) { - this.resourceName = resourceName; - return this; - } - - /** - * Get the resourceType property: The type of the resource. - * - * @return the resourceType value. - */ - public String resourceType() { - return this.resourceType; - } - - /** - * Set the resourceType property: The type of the resource. - * - * @param resourceType the resourceType value to set. - * @return the TargetResource object itself. - */ - public TargetResource withResourceType(String resourceType) { - this.resourceType = resourceType; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/TemplateLink.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/TemplateLink.java deleted file mode 100644 index b0ca8f9bebdc..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/TemplateLink.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Entity representing the reference to the template. */ -@Fluent -public final class TemplateLink { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TemplateLink.class); - - /* - * The URI of the template to deploy. - */ - @JsonProperty(value = "uri", required = true) - private String uri; - - /* - * If included, must match the ContentVersion in the template. - */ - @JsonProperty(value = "contentVersion") - private String contentVersion; - - /** - * Get the uri property: The URI of the template to deploy. - * - * @return the uri value. - */ - public String uri() { - return this.uri; - } - - /** - * Set the uri property: The URI of the template to deploy. - * - * @param uri the uri value to set. - * @return the TemplateLink object itself. - */ - public TemplateLink withUri(String uri) { - this.uri = uri; - return this; - } - - /** - * Get the contentVersion property: If included, must match the ContentVersion in the template. - * - * @return the contentVersion value. - */ - public String contentVersion() { - return this.contentVersion; - } - - /** - * Set the contentVersion property: If included, must match the ContentVersion in the template. - * - * @param contentVersion the contentVersion value to set. - * @return the TemplateLink object itself. - */ - public TemplateLink withContentVersion(String contentVersion) { - this.contentVersion = contentVersion; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (uri() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property uri in model TemplateLink")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Tenant.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Tenant.java deleted file mode 100644 index 352c695ae382..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Tenant.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluent.models.TenantIdDescriptionInner; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.model.Indexable; - -/** - * An immutable client-side representation of an Azure tenant. - */ -@Fluent -public interface Tenant extends Indexable, HasInnerModel { - /** - * @return the UUID of the tenant - */ - String tenantId(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/TenantListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/TenantListResult.java deleted file mode 100644 index 11f533046b29..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/TenantListResult.java +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.resources.fluent.models.TenantIdDescriptionInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Tenant Ids information. */ -@Fluent -public final class TenantListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TenantListResult.class); - - /* - * An array of tenants. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to use for getting the next set of results. - */ - @JsonProperty(value = "nextLink", required = true) - private String nextLink; - - /** - * Get the value property: An array of tenants. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: An array of tenants. - * - * @param value the value value to set. - * @return the TenantListResult object itself. - */ - public TenantListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to use for getting the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The URL to use for getting the next set of results. - * - * @param nextLink the nextLink value to set. - * @return the TenantListResult object itself. - */ - public TenantListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - if (nextLink() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property nextLink in model TenantListResult")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Tenants.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Tenants.java deleted file mode 100644 index 36bfb7500ccc..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Tenants.java +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; - -/** - * Entry point to tenant management API. - */ -@Fluent -public interface Tenants extends - SupportsListing { -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/WhatIfChange.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/WhatIfChange.java deleted file mode 100644 index 250eb5a794c5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/WhatIfChange.java +++ /dev/null @@ -1,169 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Information about a single resource change predicted by What-If operation. */ -@Fluent -public final class WhatIfChange { - @JsonIgnore private final ClientLogger logger = new ClientLogger(WhatIfChange.class); - - /* - * Resource ID - */ - @JsonProperty(value = "resourceId", required = true) - private String resourceId; - - /* - * Type of change that will be made to the resource when the deployment is - * executed. - */ - @JsonProperty(value = "changeType", required = true) - private ChangeType changeType; - - /* - * The snapshot of the resource before the deployment is executed. - */ - @JsonProperty(value = "before") - private Object before; - - /* - * The predicted snapshot of the resource after the deployment is executed. - */ - @JsonProperty(value = "after") - private Object after; - - /* - * The predicted changes to resource properties. - */ - @JsonProperty(value = "delta") - private List delta; - - /** - * Get the resourceId property: Resource ID. - * - * @return the resourceId value. - */ - public String resourceId() { - return this.resourceId; - } - - /** - * Set the resourceId property: Resource ID. - * - * @param resourceId the resourceId value to set. - * @return the WhatIfChange object itself. - */ - public WhatIfChange withResourceId(String resourceId) { - this.resourceId = resourceId; - return this; - } - - /** - * Get the changeType property: Type of change that will be made to the resource when the deployment is executed. - * - * @return the changeType value. - */ - public ChangeType changeType() { - return this.changeType; - } - - /** - * Set the changeType property: Type of change that will be made to the resource when the deployment is executed. - * - * @param changeType the changeType value to set. - * @return the WhatIfChange object itself. - */ - public WhatIfChange withChangeType(ChangeType changeType) { - this.changeType = changeType; - return this; - } - - /** - * Get the before property: The snapshot of the resource before the deployment is executed. - * - * @return the before value. - */ - public Object before() { - return this.before; - } - - /** - * Set the before property: The snapshot of the resource before the deployment is executed. - * - * @param before the before value to set. - * @return the WhatIfChange object itself. - */ - public WhatIfChange withBefore(Object before) { - this.before = before; - return this; - } - - /** - * Get the after property: The predicted snapshot of the resource after the deployment is executed. - * - * @return the after value. - */ - public Object after() { - return this.after; - } - - /** - * Set the after property: The predicted snapshot of the resource after the deployment is executed. - * - * @param after the after value to set. - * @return the WhatIfChange object itself. - */ - public WhatIfChange withAfter(Object after) { - this.after = after; - return this; - } - - /** - * Get the delta property: The predicted changes to resource properties. - * - * @return the delta value. - */ - public List delta() { - return this.delta; - } - - /** - * Set the delta property: The predicted changes to resource properties. - * - * @param delta the delta value to set. - * @return the WhatIfChange object itself. - */ - public WhatIfChange withDelta(List delta) { - this.delta = delta; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (resourceId() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property resourceId in model WhatIfChange")); - } - if (changeType() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property changeType in model WhatIfChange")); - } - if (delta() != null) { - delta().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/WhatIfOperationResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/WhatIfOperationResult.java deleted file mode 100644 index b5b9fc16e6fe..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/WhatIfOperationResult.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.exception.ManagementError; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluent.models.WhatIfOperationResultInner; - -import java.util.List; - -/** - * An immutable client-side representation of an Azure deployment What-if operation result. - */ -@Fluent -public interface WhatIfOperationResult extends - HasInnerModel { - - /** - * @return status of the What-If operation. - */ - String status(); - - /** - * @return list of resource changes predicted by What-If operation. - */ - List changes(); - - /** - * @return error when What-If operation fails. - */ - ManagementError error(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/WhatIfPropertyChange.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/WhatIfPropertyChange.java deleted file mode 100644 index eaf21f9abecf..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/WhatIfPropertyChange.java +++ /dev/null @@ -1,169 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The predicted change to the resource property. */ -@Fluent -public final class WhatIfPropertyChange { - @JsonIgnore private final ClientLogger logger = new ClientLogger(WhatIfPropertyChange.class); - - /* - * The path of the property. - */ - @JsonProperty(value = "path", required = true) - private String path; - - /* - * The type of property change. - */ - @JsonProperty(value = "propertyChangeType", required = true) - private PropertyChangeType propertyChangeType; - - /* - * The value of the property before the deployment is executed. - */ - @JsonProperty(value = "before") - private Object before; - - /* - * The value of the property after the deployment is executed. - */ - @JsonProperty(value = "after") - private Object after; - - /* - * Nested property changes. - */ - @JsonProperty(value = "children") - private List children; - - /** - * Get the path property: The path of the property. - * - * @return the path value. - */ - public String path() { - return this.path; - } - - /** - * Set the path property: The path of the property. - * - * @param path the path value to set. - * @return the WhatIfPropertyChange object itself. - */ - public WhatIfPropertyChange withPath(String path) { - this.path = path; - return this; - } - - /** - * Get the propertyChangeType property: The type of property change. - * - * @return the propertyChangeType value. - */ - public PropertyChangeType propertyChangeType() { - return this.propertyChangeType; - } - - /** - * Set the propertyChangeType property: The type of property change. - * - * @param propertyChangeType the propertyChangeType value to set. - * @return the WhatIfPropertyChange object itself. - */ - public WhatIfPropertyChange withPropertyChangeType(PropertyChangeType propertyChangeType) { - this.propertyChangeType = propertyChangeType; - return this; - } - - /** - * Get the before property: The value of the property before the deployment is executed. - * - * @return the before value. - */ - public Object before() { - return this.before; - } - - /** - * Set the before property: The value of the property before the deployment is executed. - * - * @param before the before value to set. - * @return the WhatIfPropertyChange object itself. - */ - public WhatIfPropertyChange withBefore(Object before) { - this.before = before; - return this; - } - - /** - * Get the after property: The value of the property after the deployment is executed. - * - * @return the after value. - */ - public Object after() { - return this.after; - } - - /** - * Set the after property: The value of the property after the deployment is executed. - * - * @param after the after value to set. - * @return the WhatIfPropertyChange object itself. - */ - public WhatIfPropertyChange withAfter(Object after) { - this.after = after; - return this; - } - - /** - * Get the children property: Nested property changes. - * - * @return the children value. - */ - public List children() { - return this.children; - } - - /** - * Set the children property: Nested property changes. - * - * @param children the children value to set. - * @return the WhatIfPropertyChange object itself. - */ - public WhatIfPropertyChange withChildren(List children) { - this.children = children; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (path() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property path in model WhatIfPropertyChange")); - } - if (propertyChangeType() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property propertyChangeType in model WhatIfPropertyChange")); - } - if (children() != null) { - children().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/WhatIfResultFormat.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/WhatIfResultFormat.java deleted file mode 100644 index e2f45a75e396..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/WhatIfResultFormat.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for WhatIfResultFormat. */ -public enum WhatIfResultFormat { - /** Enum value ResourceIdOnly. */ - RESOURCE_ID_ONLY("ResourceIdOnly"), - - /** Enum value FullResourcePayloads. */ - FULL_RESOURCE_PAYLOADS("FullResourcePayloads"); - - /** The actual serialized value for a WhatIfResultFormat instance. */ - private final String value; - - WhatIfResultFormat(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a WhatIfResultFormat instance. - * - * @param value the serialized value to parse. - * @return the parsed WhatIfResultFormat object, or null if unable to parse. - */ - @JsonCreator - public static WhatIfResultFormat fromString(String value) { - WhatIfResultFormat[] items = WhatIfResultFormat.values(); - for (WhatIfResultFormat item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ZoneMapping.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ZoneMapping.java deleted file mode 100644 index d285bc35db93..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ZoneMapping.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The ZoneMapping model. */ -@Fluent -public final class ZoneMapping { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ZoneMapping.class); - - /* - * The location of the zone mapping. - */ - @JsonProperty(value = "location") - private String location; - - /* - * The zones property. - */ - @JsonProperty(value = "zones") - private List zones; - - /** - * Get the location property: The location of the zone mapping. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Set the location property: The location of the zone mapping. - * - * @param location the location value to set. - * @return the ZoneMapping object itself. - */ - public ZoneMapping withLocation(String location) { - this.location = location; - return this; - } - - /** - * Get the zones property: The zones property. - * - * @return the zones value. - */ - public List zones() { - return this.zones; - } - - /** - * Set the zones property: The zones property. - * - * @param zones the zones value to set. - * @return the ZoneMapping object itself. - */ - public ZoneMapping withZones(List zones) { - this.zones = zones; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/package-info.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/package-info.java deleted file mode 100644 index a24735202a7c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** - * Package containing the data models for ResourceManagementClient. Provides operations for working with resources and - * resource groups. - */ -package com.azure.resourcemanager.resources.models; diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/package-info.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/package-info.java deleted file mode 100644 index e829ccc2c3ed..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** - * Package containing the classes for ResourceManagementClient. Provides operations for working with resources and - * resource groups. - */ -package com.azure.resourcemanager.resources; diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/module-info.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/module-info.java deleted file mode 100644 index 0fee0a1883a7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/module-info.java +++ /dev/null @@ -1,131 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -module com.azure.resourcemanager.resources { - requires transitive com.azure.core.management; - - // export public APIs of resources - exports com.azure.resourcemanager.resources; - exports com.azure.resourcemanager.resources.fluent; - exports com.azure.resourcemanager.resources.fluent.models; - exports com.azure.resourcemanager.resources.models; - - // export public APIs used commonly across multiple services - exports com.azure.resourcemanager.resources.fluentcore; - exports com.azure.resourcemanager.resources.fluentcore.arm; - exports com.azure.resourcemanager.resources.fluentcore.arm.collection; - exports com.azure.resourcemanager.resources.fluentcore.arm.models; - exports com.azure.resourcemanager.resources.fluentcore.collection; - exports com.azure.resourcemanager.resources.fluentcore.dag; - exports com.azure.resourcemanager.resources.fluentcore.exception; - exports com.azure.resourcemanager.resources.fluentcore.model; - exports com.azure.resourcemanager.resources.fluentcore.policy; - exports com.azure.resourcemanager.resources.fluentcore.rest; - exports com.azure.resourcemanager.resources.fluentcore.utils; - - // export internal APIs only required for service implementation - exports com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation to - com.azure.resourcemanager.appplatform, - com.azure.resourcemanager.appservice, - com.azure.resourcemanager.authorization, - com.azure.resourcemanager.cdn, - com.azure.resourcemanager.compute, - com.azure.resourcemanager.containerinstance, - com.azure.resourcemanager.containerregistry, - com.azure.resourcemanager.containerservice, - com.azure.resourcemanager.cosmos, - com.azure.resourcemanager.dns, - com.azure.resourcemanager.eventhubs, - com.azure.resourcemanager.keyvault, - com.azure.resourcemanager.monitor, - com.azure.resourcemanager.msi, - com.azure.resourcemanager.network, - com.azure.resourcemanager.privatedns, - com.azure.resourcemanager.redis, - com.azure.resourcemanager.search, - com.azure.resourcemanager.servicebus, - com.azure.resourcemanager.sql, - com.azure.resourcemanager.storage, - com.azure.resourcemanager.trafficmanager; - exports com.azure.resourcemanager.resources.fluentcore.arm.implementation to - com.azure.resourcemanager.appplatform, - com.azure.resourcemanager.appservice, - com.azure.resourcemanager.authorization, - com.azure.resourcemanager.cdn, - com.azure.resourcemanager.compute, - com.azure.resourcemanager.containerinstance, - com.azure.resourcemanager.containerregistry, - com.azure.resourcemanager.containerservice, - com.azure.resourcemanager.cosmos, - com.azure.resourcemanager.dns, - com.azure.resourcemanager.eventhubs, - com.azure.resourcemanager.keyvault, - com.azure.resourcemanager.monitor, - com.azure.resourcemanager.msi, - com.azure.resourcemanager.network, - com.azure.resourcemanager.privatedns, - com.azure.resourcemanager.redis, - com.azure.resourcemanager.search, - com.azure.resourcemanager.servicebus, - com.azure.resourcemanager.sql, - com.azure.resourcemanager.storage, - com.azure.resourcemanager.trafficmanager, - com.azure.resourcemanager; - exports com.azure.resourcemanager.resources.fluentcore.arm.models.implementation to - com.azure.resourcemanager.appplatform, - com.azure.resourcemanager.appservice, - com.azure.resourcemanager.authorization, - com.azure.resourcemanager.cdn, - com.azure.resourcemanager.compute, - com.azure.resourcemanager.containerinstance, - com.azure.resourcemanager.containerregistry, - com.azure.resourcemanager.containerservice, - com.azure.resourcemanager.cosmos, - com.azure.resourcemanager.dns, - com.azure.resourcemanager.eventhubs, - com.azure.resourcemanager.keyvault, - com.azure.resourcemanager.monitor, - com.azure.resourcemanager.msi, - com.azure.resourcemanager.network, - com.azure.resourcemanager.privatedns, - com.azure.resourcemanager.redis, - com.azure.resourcemanager.search, - com.azure.resourcemanager.servicebus, - com.azure.resourcemanager.sql, - com.azure.resourcemanager.storage, - com.azure.resourcemanager.trafficmanager; - exports com.azure.resourcemanager.resources.fluentcore.model.implementation to - com.azure.resourcemanager.appplatform, - com.azure.resourcemanager.appservice, - com.azure.resourcemanager.authorization, - com.azure.resourcemanager.cdn, - com.azure.resourcemanager.compute, - com.azure.resourcemanager.containerinstance, - com.azure.resourcemanager.containerregistry, - com.azure.resourcemanager.containerservice, - com.azure.resourcemanager.cosmos, - com.azure.resourcemanager.dns, - com.azure.resourcemanager.eventhubs, - com.azure.resourcemanager.keyvault, - com.azure.resourcemanager.monitor, - com.azure.resourcemanager.msi, - com.azure.resourcemanager.network, - com.azure.resourcemanager.privatedns, - com.azure.resourcemanager.redis, - com.azure.resourcemanager.search, - com.azure.resourcemanager.servicebus, - com.azure.resourcemanager.sql, - com.azure.resourcemanager.storage, - com.azure.resourcemanager.trafficmanager; - - // open packages specifically for azure core and jackson - opens com.azure.resourcemanager.resources.fluent.models to - com.azure.core, - com.fasterxml.jackson.databind; - opens com.azure.resourcemanager.resources.models to - com.azure.core, - com.fasterxml.jackson.databind; - opens com.azure.resourcemanager.resources.fluentcore.model.implementation to - com.azure.core, - com.fasterxml.jackson.databind; -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/resources/azure.properties b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/resources/azure.properties deleted file mode 100644 index defbd48204e4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/resources/azure.properties +++ /dev/null @@ -1 +0,0 @@ -version=${project.version} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/ReadmeSamples.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/ReadmeSamples.java deleted file mode 100644 index b1fd40126822..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/ReadmeSamples.java +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources; - -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpMethod; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.util.serializer.JacksonAdapter; -import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.identity.DefaultAzureCredentialBuilder; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.ArrayNode; - -import java.io.IOException; -import java.util.HashMap; - -public class ReadmeSamples { - - public void authenticate() { - // BEGIN: com.azure.resourcemanager.resources.authenticate - String armEndpoint = "https://management.."; - AzureProfile profile = new AzureProfile(getAzureEnvironmentFromArmEndpoint(armEndpoint)); - TokenCredential credential = new DefaultAzureCredentialBuilder() - .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) - .build(); - ResourceManager manager = ResourceManager - .authenticate(credential, profile) - .withDefaultSubscription(); - // END: com.azure.resourcemanager.resources.authenticate - } - - // BEGIN: com.azure.resourcemanager.resources.getazureenvironment - private static AzureEnvironment getAzureEnvironmentFromArmEndpoint(String armEndpoint) { - // Create HTTP client and request - HttpClient httpClient = HttpClient.createDefault(); - - HttpRequest request = new HttpRequest(HttpMethod.GET, - String.format("%s/metadata/endpoints?api-version=2019-10-01", armEndpoint)) - .setHeader("accept", "application/json"); - - // Execute the request and read the response - HttpResponse response = httpClient.send(request).block(); - if (response.getStatusCode() != 200) { - throw new RuntimeException("Failed : HTTP error code : " + response.getStatusCode()); - } - String body = response.getBodyAsString().block(); - try { - ArrayNode metadataArray = JacksonAdapter.createDefaultSerializerAdapter() - .deserialize(body, ArrayNode.class, SerializerEncoding.JSON); - - if (metadataArray == null || metadataArray.isEmpty()) { - throw new RuntimeException("Failed to find metadata : " + body); - } - - JsonNode metadata = metadataArray.iterator().next(); - AzureEnvironment azureEnvironment = new AzureEnvironment(new HashMap() { - { - put("managementEndpointUrl", metadata.at("/authentication/audiences/0").asText()); - put("resourceManagerEndpointUrl", armEndpoint); - put("galleryEndpointUrl", metadata.at("/gallery").asText()); - put("activeDirectoryEndpointUrl", metadata.at("/authentication/loginEndpoint").asText()); - put("activeDirectoryResourceId", metadata.at("/authentication/audiences/0").asText()); - put("activeDirectoryGraphResourceId", metadata.at("/graph").asText()); - put("storageEndpointSuffix", "." + metadata.at("/suffixes/storage").asText()); - put("keyVaultDnsSuffix", "." + metadata.at("/suffixes/keyVaultDns").asText()); - } - }); - return azureEnvironment; - } catch (IOException ioe) { - ioe.printStackTrace(); - throw new RuntimeException(ioe); - } - } - // END: com.azure.resourcemanager.resources.getazureenvironment -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/DeploymentsTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/DeploymentsTests.java deleted file mode 100644 index 75c4d9c84a6d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/DeploymentsTests.java +++ /dev/null @@ -1,479 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources; - -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.policy.AddHeadersFromContextPolicy; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.exception.ManagementError; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.polling.LongRunningOperationStatus; -import com.azure.core.util.polling.PollResponse; -import com.azure.resourcemanager.test.utils.TestUtilities; -import com.azure.core.management.Region; -import com.azure.resourcemanager.resources.fluentcore.model.Accepted; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import com.azure.resourcemanager.resources.models.Deployment; -import com.azure.resourcemanager.resources.models.DeploymentMode; -import com.azure.resourcemanager.resources.models.DeploymentOperation; -import com.azure.resourcemanager.resources.models.GenericResource; -import com.azure.resourcemanager.resources.models.ResourceGroup; -import com.azure.resourcemanager.resources.models.ResourceGroupExportTemplateOptions; -import com.azure.resourcemanager.resources.models.ResourceGroups; -import com.azure.resourcemanager.resources.models.WhatIfOperationResult; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -import java.io.BufferedReader; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.nio.charset.StandardCharsets; -import java.time.Duration; -import java.util.Optional; -import java.util.stream.Collectors; - -public class DeploymentsTests extends ResourceManagementTest { - private ResourceGroups resourceGroups; - private ResourceGroup resourceGroup; - - private String testId; - private String rgName; - private static final String TEMPLATE_URI = "https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/quickstarts/microsoft.network/vnet-two-subnets/azuredeploy.json"; - private static final String BLANK_TEMPLATE_URI = "https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/100-blank-template/azuredeploy.json"; - private static final String PARAMETERS_URI = "https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/quickstarts/microsoft.network/vnet-two-subnets/azuredeploy.parameters.json"; - private static final String UPDATE_TEMPLATE = "{\"$schema\":\"https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#\",\"contentVersion\":\"1.0.0.0\",\"parameters\":{\"vnetName\":{\"type\":\"string\",\"defaultValue\":\"VNet2\",\"metadata\":{\"description\":\"VNet name\"}},\"vnetAddressPrefix\":{\"type\":\"string\",\"defaultValue\":\"10.0.0.0/16\",\"metadata\":{\"description\":\"Address prefix\"}},\"subnet1Prefix\":{\"type\":\"string\",\"defaultValue\":\"10.0.0.0/24\",\"metadata\":{\"description\":\"Subnet 1 Prefix\"}},\"subnet1Name\":{\"type\":\"string\",\"defaultValue\":\"Subnet1\",\"metadata\":{\"description\":\"Subnet 1 Name\"}},\"subnet2Prefix\":{\"type\":\"string\",\"defaultValue\":\"10.0.1.0/24\",\"metadata\":{\"description\":\"Subnet 2 Prefix\"}},\"subnet2Name\":{\"type\":\"string\",\"defaultValue\":\"Subnet222\",\"metadata\":{\"description\":\"Subnet 2 Name\"}}},\"variables\":{\"apiVersion\":\"2015-06-15\"},\"resources\":[{\"apiVersion\":\"[variables('apiVersion')]\",\"type\":\"Microsoft.Network/virtualNetworks\",\"name\":\"[parameters('vnetName')]\",\"location\":\"[resourceGroup().location]\",\"properties\":{\"addressSpace\":{\"addressPrefixes\":[\"[parameters('vnetAddressPrefix')]\"]},\"subnets\":[{\"name\":\"[parameters('subnet1Name')]\",\"properties\":{\"addressPrefix\":\"[parameters('subnet1Prefix')]\"}},{\"name\":\"[parameters('subnet2Name')]\",\"properties\":{\"addressPrefix\":\"[parameters('subnet2Prefix')]\"}}]}}]}"; - private static final String UPDATE_PARAMETERS = "{\"vnetAddressPrefix\":{\"value\":\"10.0.0.0/16\"},\"subnet1Name\":{\"value\":\"Subnet1\"},\"subnet1Prefix\":{\"value\":\"10.0.0.0/24\"}}"; - private static final String CONTENT_VERSION = "1.0.0.0"; - private static final String NETWORK_API_VERSION = "2020-11-01"; - - @Override - protected void initializeClients(HttpPipeline httpPipeline, AzureProfile profile) { - super.initializeClients(httpPipeline, profile); - testId = generateRandomResourceName("", 9); - resourceGroups = resourceClient.resourceGroups(); - rgName = "rg" + testId; - resourceGroup = resourceGroups.define(rgName) - .withRegion(locationOrDefault(Region.US_SOUTH_CENTRAL)) - .create(); - } - - @Override - protected void cleanUpResources() { - resourceGroups.beginDeleteByName(rgName); - } - - @Test - public void canDeployVirtualNetwork() throws Exception { - final String dpName = "dpA" + testId; - - // Create - resourceClient.deployments() - .define(dpName) - .withExistingResourceGroup(rgName) - .withTemplateLink(TEMPLATE_URI, CONTENT_VERSION) - .withParametersLink(PARAMETERS_URI, CONTENT_VERSION) - .withMode(DeploymentMode.COMPLETE) - .create(); - // List - PagedIterable deployments = resourceClient.deployments().listByResourceGroup(rgName); - boolean found = false; - for (Deployment deployment : deployments) { - if (deployment.name().equals(dpName)) { - found = true; - } - } - Assertions.assertTrue(found); - // Check existence - Assertions.assertTrue(resourceClient.deployments().checkExistence(rgName, dpName)); - - // Get - Deployment deployment = resourceClient.deployments().getByResourceGroup(rgName, dpName); - Assertions.assertNotNull(deployment); - Assertions.assertEquals("Succeeded", deployment.provisioningState()); - GenericResource generic = resourceClient.genericResources().get(rgName, "Microsoft.Network", "", "virtualnetworks", "VNet1", NETWORK_API_VERSION); - Assertions.assertNotNull(generic); - // Export - Assertions.assertNotNull(deployment.exportTemplate().templateAsJson()); - // Export from resource group - Assertions.assertNotNull(resourceGroup.exportTemplate(ResourceGroupExportTemplateOptions.INCLUDE_BOTH)); - // Deployment operations - PagedIterable operations = deployment.deploymentOperations().list(); - Assertions.assertEquals(4, TestUtilities.getSize(operations)); - DeploymentOperation op = deployment.deploymentOperations().getById(operations.iterator().next().operationId()); - Assertions.assertNotNull(op); - resourceClient.genericResources().delete(rgName, "Microsoft.Network", "", "virtualnetworks", "VNet1", NETWORK_API_VERSION); - } - - @Test - public void canPostDeploymentWhatIfOnResourceGroup() throws Exception { - final String dpName = "dpA" + testId; - - // Create - resourceClient.deployments() - .define(dpName) - .withExistingResourceGroup(rgName) - .withTemplateLink(TEMPLATE_URI, CONTENT_VERSION) - .withParametersLink(PARAMETERS_URI, CONTENT_VERSION) - .withMode(DeploymentMode.COMPLETE) - .create(); - // List - PagedIterable deployments = resourceClient.deployments().listByResourceGroup(rgName); - boolean found = false; - for (Deployment deployment : deployments) { - if (deployment.name().equals(dpName)) { - found = true; - } - } - Assertions.assertTrue(found); - - // Get - Deployment deployment = resourceClient.deployments().getByResourceGroup(rgName, dpName); - Assertions.assertNotNull(deployment); - Assertions.assertEquals("Succeeded", deployment.provisioningState()); - - //What if - WhatIfOperationResult result = deployment.prepareWhatIf() - .withIncrementalMode() - .withWhatIfTemplateLink(TEMPLATE_URI, CONTENT_VERSION) - .whatIf(); - - Assertions.assertEquals("Succeeded", result.status()); - Assertions.assertEquals(3, result.changes().size()); - - resourceClient.genericResources().delete(rgName, "Microsoft.Network", "", "virtualnetworks", "VNet1", NETWORK_API_VERSION); - } - - @Test - public void canPostDeploymentWhatIfOnSubscription() throws Exception { - final String dpName = "dpA" + testId; - - // Create - resourceClient.deployments() - .define(dpName) - .withExistingResourceGroup(rgName) - .withTemplateLink(TEMPLATE_URI, CONTENT_VERSION) - .withParametersLink(PARAMETERS_URI, CONTENT_VERSION) - .withMode(DeploymentMode.COMPLETE) - .create(); - // List - PagedIterable deployments = resourceClient.deployments().listByResourceGroup(rgName); - boolean found = false; - for (Deployment deployment : deployments) { - if (deployment.name().equals(dpName)) { - found = true; - } - } - Assertions.assertTrue(found); - - // Get - Deployment deployment = resourceClient.deployments().getByResourceGroup(rgName, dpName); - Assertions.assertNotNull(deployment); - Assertions.assertEquals("Succeeded", deployment.provisioningState()); - - //What if - WhatIfOperationResult result = deployment.prepareWhatIf() - .withLocation(locationOrDefault("westus")) - .withIncrementalMode() - .withWhatIfTemplateLink(BLANK_TEMPLATE_URI, CONTENT_VERSION) - .whatIfAtSubscriptionScope(); - - Assertions.assertEquals("Succeeded", result.status()); - Assertions.assertEquals(0, result.changes().size()); - - resourceClient.genericResources().delete(rgName, "Microsoft.Network", "", "virtualnetworks", "VNet1", NETWORK_API_VERSION); - } - - @Test - @Disabled("deployment.cancel() doesn't throw but provisining state says Running not Cancelled...") - public void canCancelVirtualNetworkDeployment() throws Exception { - final String dp = "dpB" + testId; - - // Begin create - resourceClient.deployments() - .define(dp) - .withExistingResourceGroup(rgName) - .withTemplateLink(TEMPLATE_URI, CONTENT_VERSION) - .withParametersLink(PARAMETERS_URI, CONTENT_VERSION) - .withMode(DeploymentMode.COMPLETE) - .beginCreate(); - Deployment deployment = resourceClient.deployments().getByResourceGroup(rgName, dp); - Assertions.assertEquals(dp, deployment.name()); - // Cancel - deployment.cancel(); - deployment = resourceClient.deployments().getByResourceGroup(rgName, dp); - Assertions.assertEquals("Canceled", deployment.provisioningState()); - Assertions.assertFalse(resourceClient.genericResources().checkExistence(rgName, "Microsoft.Network", "", "virtualnetworks", "VNet1", NETWORK_API_VERSION)); - } - - @Test - public void canUpdateVirtualNetworkDeployment() throws Exception { - final String dp = "dpC" + testId; - - // Begin create - Accepted acceptedDeployment = resourceClient.deployments() - .define(dp) - .withExistingResourceGroup(rgName) - .withTemplateLink(TEMPLATE_URI, CONTENT_VERSION) - .withParametersLink(PARAMETERS_URI, CONTENT_VERSION) - .withMode(DeploymentMode.COMPLETE) - .beginCreate(); - Deployment createdDeployment = acceptedDeployment.getActivationResponse().getValue(); - Deployment deployment = resourceClient.deployments().getByResourceGroup(rgName, dp); - Assertions.assertEquals(createdDeployment.correlationId(), deployment.correlationId()); - Assertions.assertEquals(dp, deployment.name()); - // Cancel - deployment.cancel(); - deployment = resourceClient.deployments().getByResourceGroup(rgName, dp); - Assertions.assertEquals("Canceled", deployment.provisioningState()); - // Update - deployment.update() - .withTemplate(UPDATE_TEMPLATE) - .withParameters(UPDATE_PARAMETERS) - .withMode(DeploymentMode.INCREMENTAL) - .apply(); - deployment = resourceClient.deployments().getByResourceGroup(rgName, dp); - Assertions.assertEquals(DeploymentMode.INCREMENTAL, deployment.mode()); - Assertions.assertEquals("Succeeded", deployment.provisioningState()); - GenericResource genericVnet = resourceClient.genericResources().get(rgName, "Microsoft.Network", "", "virtualnetworks", "VNet2", NETWORK_API_VERSION); - Assertions.assertNotNull(genericVnet); - resourceClient.genericResources().delete(rgName, "Microsoft.Network", "", "virtualnetworks", "VNet2", NETWORK_API_VERSION); - } - - @Test - public void canDeployVirtualNetworkSyncPoll() throws Exception { - final long defaultDelayInMillis = 10 * 1000; - - final String dp = "dpD" + testId; - - // Begin create - Accepted acceptedDeployment = resourceClient.deployments() - .define(dp) - .withExistingResourceGroup(rgName) - .withTemplateLink(TEMPLATE_URI, CONTENT_VERSION) - .withParametersLink(PARAMETERS_URI, CONTENT_VERSION) - .withMode(DeploymentMode.COMPLETE) - .beginCreate(); - Deployment createdDeployment = acceptedDeployment.getActivationResponse().getValue(); - Assertions.assertNotEquals("Succeeded", createdDeployment.provisioningState()); - - LongRunningOperationStatus pollStatus = acceptedDeployment.getActivationResponse().getStatus(); - long delayInMills = acceptedDeployment.getActivationResponse().getRetryAfter() == null - ? defaultDelayInMillis - : acceptedDeployment.getActivationResponse().getRetryAfter().toMillis(); - while (!pollStatus.isComplete()) { - ResourceManagerUtils.sleep(Duration.ofMillis(delayInMills)); - - PollResponse pollResponse = acceptedDeployment.getSyncPoller().poll(); - pollStatus = pollResponse.getStatus(); - delayInMills = pollResponse.getRetryAfter() == null - ? defaultDelayInMillis - : pollResponse.getRetryAfter().toMillis(); - } - Assertions.assertEquals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, pollStatus); - Deployment deployment = acceptedDeployment.getFinalResult(); - Assertions.assertEquals("Succeeded", deployment.provisioningState()); - } - - @Test - public void canDeployVirtualNetworkSyncPollWithFailure() throws Exception { - final long defaultDelayInMillis = 10 * 1000; - - final String templateJson = "{ \"$schema\": \"https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#\", \"contentVersion\": \"1.0.0.0\", \"resources\": [ { \"type\": \"Microsoft.Storage/storageAccounts\", \"apiVersion\": \"2019-04-01\", \"name\": \"satestnameconflict\", \"location\": \"eastus\", \"sku\": { \"name\": \"Standard_LRS\" }, \"kind\": \"StorageV2\", \"properties\": { \"supportsHttpsTrafficOnly\": true } } ] }"; - - final String dp = "dpE" + testId; - // Begin create - Accepted acceptedDeployment = resourceClient.deployments() - .define(dp) - .withExistingResourceGroup(rgName) - .withTemplate(templateJson) - .withParameters("{}") - .withMode(DeploymentMode.COMPLETE) - .beginCreate(); - Deployment createdDeployment = acceptedDeployment.getActivationResponse().getValue(); - Assertions.assertNotEquals("Succeeded", createdDeployment.provisioningState()); - - LongRunningOperationStatus pollStatus = acceptedDeployment.getActivationResponse().getStatus(); - long delayInMills = acceptedDeployment.getActivationResponse().getRetryAfter() == null - ? defaultDelayInMillis - : acceptedDeployment.getActivationResponse().getRetryAfter().toMillis(); - while (!pollStatus.isComplete()) { - ResourceManagerUtils.sleep(Duration.ofMillis(delayInMills)); - - PollResponse pollResponse = acceptedDeployment.getSyncPoller().poll(); - pollStatus = pollResponse.getStatus(); - delayInMills = pollResponse.getRetryAfter() == null - ? defaultDelayInMillis - : pollResponse.getRetryAfter().toMillis(); - } - Assertions.assertEquals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, pollStatus); - Deployment deployment = acceptedDeployment.getFinalResult(); - Assertions.assertEquals("Succeeded", deployment.provisioningState()); - - final String newRgName = generateRandomResourceName("rg", 10); - try { - final String dp2 = "dpF" + testId; - - // storage name conflict - acceptedDeployment = resourceClient.deployments() - .define(dp2) - .withNewResourceGroup(newRgName, locationOrDefault(Region.US_EAST2)) - .withTemplate(templateJson) - .withParameters("{}") - .withMode(DeploymentMode.COMPLETE) - .beginCreate(); - createdDeployment = acceptedDeployment.getActivationResponse().getValue(); - Assertions.assertNotEquals("Succeeded", createdDeployment.provisioningState()); - - pollStatus = acceptedDeployment.getActivationResponse().getStatus(); - delayInMills = acceptedDeployment.getActivationResponse().getRetryAfter() == null - ? defaultDelayInMillis - : (int) acceptedDeployment.getActivationResponse().getRetryAfter().toMillis(); - while (!pollStatus.isComplete()) { - ResourceManagerUtils.sleep(Duration.ofMillis(delayInMills)); - - PollResponse pollResponse = acceptedDeployment.getSyncPoller().poll(); - pollStatus = pollResponse.getStatus(); - delayInMills = pollResponse.getRetryAfter() == null - ? defaultDelayInMillis - : (int) pollResponse.getRetryAfter().toMillis(); - } - Assertions.assertEquals(LongRunningOperationStatus.FAILED, pollStatus); - - // check exception - boolean exceptionOnFinalResult = false; - try { - deployment = acceptedDeployment.getFinalResult(); - } catch (ManagementException exception) { - exceptionOnFinalResult = true; - - ManagementError managementError = exception.getValue(); - Assertions.assertEquals("DeploymentFailed", managementError.getCode()); - Assertions.assertNotNull(managementError.getMessage()); - } - Assertions.assertTrue(exceptionOnFinalResult); - - // check operations - deployment = resourceClient.deployments().getByResourceGroup(newRgName, dp2); - Assertions.assertEquals("Failed", deployment.provisioningState()); - PagedIterable operations = deployment.deploymentOperations().list(); - Optional failedOperation = operations.stream() - .filter(o -> "Failed".equalsIgnoreCase(o.provisioningState())).findFirst(); - Assertions.assertTrue(failedOperation.isPresent()); - Assertions.assertEquals("Conflict", failedOperation.get().statusCode()); - - // check poll result again, should stay failed - Assertions.assertEquals(LongRunningOperationStatus.FAILED, acceptedDeployment.getSyncPoller().poll().getStatus()); - exceptionOnFinalResult = false; - try { - deployment = acceptedDeployment.getFinalResult(); - } catch (ManagementException exception) { - exceptionOnFinalResult = true; - } - Assertions.assertTrue(exceptionOnFinalResult); - } finally { - resourceClient.resourceGroups().beginDeleteByName(newRgName); - } - } - - @Test - public void canGetErrorWhenDeploymentFail() throws Exception { - final String dpName = "dpG" + testId; - - String templateJson; // template fails at Subnet2 - try (InputStream templateStream = this.getClass().getResourceAsStream("/deployTemplateWithError.json")) { - templateJson = new BufferedReader(new InputStreamReader(templateStream, StandardCharsets.UTF_8)).lines() - .collect(Collectors.joining("\n")); - } - - ManagementError deploymentError = null; - try { - resourceClient.deployments() - .define(dpName) - .withExistingResourceGroup(rgName) - .withTemplate(templateJson) - .withParametersLink(PARAMETERS_URI, CONTENT_VERSION) - .withMode(DeploymentMode.COMPLETE) - .create(); - } catch (ManagementException deploymentException) { - // verify ManagementException - Assertions.assertTrue(deploymentException.getValue().getDetails().stream() - .anyMatch(detail -> detail.getMessage().contains("Subnet2"))); - - Deployment failedDeployment = resourceClient.deployments() - .getByResourceGroup(rgName, dpName); - deploymentError = failedDeployment.error(); - - // verify deployment operations - PagedIterable operations = failedDeployment.deploymentOperations().list(); - Assertions.assertTrue(operations.stream() - .anyMatch(operation -> "BadRequest".equals(operation.statusCode()) - && operation.targetResource().resourceName().contains("Subnet2"))); - } - // verify Deployment.error() - Assertions.assertNotNull(deploymentError); - Assertions.assertTrue(deploymentError.getDetails().stream() - .anyMatch(detail -> detail.getMessage().contains("Subnet2"))); - } - - @Test - public void canDeployVirtualNetworkWithContext() { - final String dpName = "dpA" + testId; - final String rgName1 = generateRandomResourceName("rg", 9); - final String rgName2 = generateRandomResourceName("rg", 9); - - try { - String correlationRequestId = generateRandomUuid(); - System.out.println("x-ms-correlation-request-id: " + correlationRequestId); - Context context = new Context( - AddHeadersFromContextPolicy.AZURE_REQUEST_HTTP_HEADERS_KEY, - new HttpHeaders().set("x-ms-correlation-request-id", correlationRequestId)); - - // with context - Accepted deployment1 = resourceClient.deployments() - .define(dpName) - .withNewResourceGroup(rgName1, locationOrDefault(Region.US_SOUTH_CENTRAL)) - .withTemplateLink(TEMPLATE_URI, CONTENT_VERSION) - .withParametersLink(PARAMETERS_URI, CONTENT_VERSION) - .withMode(DeploymentMode.COMPLETE) - .beginCreate(context); - - // with context - Deployment deployment2 = resourceClient.deployments() - .define(dpName) - .withNewResourceGroup(rgName2, locationOrDefault(Region.US_SOUTH_CENTRAL)) - .withTemplateLink(TEMPLATE_URI, CONTENT_VERSION) - .withParametersLink(PARAMETERS_URI, CONTENT_VERSION) - .withMode(DeploymentMode.COMPLETE) - .create(context); - - // without context - Deployment deployment3 = resourceClient.deployments() - .define(dpName) - .withExistingResourceGroup(rgName) - .withTemplateLink(TEMPLATE_URI, CONTENT_VERSION) - .withParametersLink(PARAMETERS_URI, CONTENT_VERSION) - .withMode(DeploymentMode.COMPLETE) - .create(); - - Assertions.assertEquals(correlationRequestId, deployment1.getActivationResponse().getValue().innerModel().properties().correlationId()); - Assertions.assertEquals(correlationRequestId, deployment2.innerModel().properties().correlationId()); - Assertions.assertNotEquals(correlationRequestId, deployment3.innerModel().properties().correlationId()); - } finally { - try { - resourceGroups.beginDeleteByName(rgName1); - } catch (Exception e) { - // ignored - } - try { - resourceGroups.beginDeleteByName(rgName2); - } catch (Exception e) { - // ignored - } - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/FeaturesTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/FeaturesTests.java deleted file mode 100644 index 7688d8d73639..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/FeaturesTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources; - -import com.azure.resourcemanager.resources.models.Feature; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -import java.util.List; -import java.util.stream.Collectors; - -public class FeaturesTests extends ResourceManagementTest { - - @Test - public void canListAndRegisterFeature() { - List features = resourceClient.features().list().stream().collect(Collectors.toList()); - Assertions.assertNotNull(features); - - features.stream() - .filter(f -> "NotRegistered".equals(f.state())) - .findFirst() - .ifPresent(feature -> resourceClient.features() - .register(feature.resourceProviderName(), feature.featureName())); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/GenericResourcesTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/GenericResourcesTests.java deleted file mode 100644 index 40280bd949cf..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/GenericResourcesTests.java +++ /dev/null @@ -1,190 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources; - -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.core.util.polling.LongRunningOperationStatus; -import com.azure.core.util.polling.PollResponse; -import com.azure.resourcemanager.resources.fluent.models.GenericResourceExpandedInner; -import com.azure.core.management.Region; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils; -import com.azure.resourcemanager.resources.fluentcore.model.Accepted; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import com.azure.resourcemanager.resources.models.GenericResource; -import com.azure.resourcemanager.resources.models.GenericResources; -import com.azure.resourcemanager.resources.models.Identity; -import com.azure.resourcemanager.resources.models.ResourceGroups; -import com.azure.resourcemanager.resources.models.ResourceIdentityType; -import com.azure.resourcemanager.resources.models.Sku; -import com.fasterxml.jackson.databind.ObjectMapper; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -import java.time.Duration; -import java.util.Arrays; -import java.util.Optional; - -public class GenericResourcesTests extends ResourceManagementTest { - private ResourceGroups resourceGroups; - private GenericResources genericResources; - - private String testId; - private String rgName; - private String newRgName; - - @Override - protected void initializeClients(HttpPipeline httpPipeline, AzureProfile profile) { - testId = generateRandomResourceName("", 9); - rgName = "rg" + testId; - newRgName = "rgB" + testId; - - super.initializeClients(httpPipeline, profile); - resourceGroups = resourceClient.resourceGroups(); - genericResources = resourceClient.genericResources(); - resourceGroups.define(rgName) - .withRegion(locationOrDefault(Region.US_EAST)) - .create(); - resourceGroups.define(newRgName) - .withRegion(locationOrDefault(Region.US_SOUTH_CENTRAL)) - .create(); - } - - @Override - protected void cleanUpResources() { - resourceGroups.beginDeleteByName(newRgName); - resourceGroups.beginDeleteByName(rgName); - } - - @Test - public void canCreateUpdateMoveResource() throws Exception { - final String resourceName = "rs" + testId; - // Create - GenericResource resource = genericResources.define(resourceName) - .withRegion(locationOrDefault(Region.US_SOUTH_CENTRAL)) - .withExistingResourceGroup(rgName) - .withResourceType("sites") - .withProviderNamespace("Microsoft.Web") - .withoutPlan() - .withParentResourcePath("") - .withProperties(new ObjectMapper().readTree("{\"SiteMode\":\"Limited\",\"ComputeMode\":\"Shared\"}")) - .create(); - //List - PagedIterable resourceList = genericResources.listByResourceGroup(rgName); - boolean found = false; - for (GenericResource gr : resourceList) { - if (gr.name().equals(resource.name())) { - Assertions.assertNotNull(gr.apiVersion()); - found = true; - break; - } - } - Assertions.assertTrue(found); - // Get - Assertions.assertNotNull(genericResources.get(rgName, resource.resourceProviderNamespace(), resource.parentResourcePath(), resource.resourceType(), resource.name(), resource.apiVersion())); - // Move - genericResources.moveResources(rgName, resourceGroups.getByName(newRgName), Arrays.asList(resource.id())); - Assertions.assertFalse(genericResources.checkExistence(rgName, resource.resourceProviderNamespace(), resource.parentResourcePath(), resource.resourceType(), resource.name(), resource.apiVersion())); - resource = genericResources.get(newRgName, resource.resourceProviderNamespace(), resource.parentResourcePath(), resource.resourceType(), resource.name(), resource.apiVersion()); - Assertions.assertNotNull(resource); - // Update - resource.update() - .withProperties(new ObjectMapper().readTree("{\"SiteMode\":\"Limited\",\"ComputeMode\":\"Dynamic\"}")) - .apply(); - // Delete - genericResources.deleteById(resource.id()); - Assertions.assertFalse(genericResources.checkExistence(newRgName, resource.resourceProviderNamespace(), resource.parentResourcePath(), resource.resourceType(), resource.name(), resource.apiVersion())); - Assertions.assertFalse(genericResources.checkExistenceById(resource.id())); - } - - @Test - public void canCreateDeleteResourceSyncPoll() throws Exception { - final long defaultDelayInMillis = 10 * 1000; - - final String resourceName = "rs" + testId; - // Create - Accepted acceptedResource = genericResources.define(resourceName) - .withRegion(locationOrDefault(Region.US_SOUTH_CENTRAL)) - .withExistingResourceGroup(rgName) - .withResourceType("sites") - .withProviderNamespace("Microsoft.Web") - .withoutPlan() - .withParentResourcePath("") - .withProperties(new ObjectMapper().readTree("{\"SiteMode\":\"Limited\",\"ComputeMode\":\"Shared\"}")) - .beginCreate(); - - LongRunningOperationStatus pollStatus = acceptedResource.getActivationResponse().getStatus(); - long delayInMills = acceptedResource.getActivationResponse().getRetryAfter() == null - ? defaultDelayInMillis - : acceptedResource.getActivationResponse().getRetryAfter().toMillis(); - while (!pollStatus.isComplete()) { - ResourceManagerUtils.sleep(Duration.ofMillis(delayInMills)); - - PollResponse pollResponse = acceptedResource.getSyncPoller().poll(); - pollStatus = pollResponse.getStatus(); - delayInMills = pollResponse.getRetryAfter() == null - ? defaultDelayInMillis - : pollResponse.getRetryAfter().toMillis(); - } - Assertions.assertEquals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, pollStatus); - GenericResource resource = acceptedResource.getFinalResult(); - Assertions.assertNotNull(resource.id()); - Assertions.assertEquals(resourceName, ResourceUtils.nameFromResourceId(resource.id())); - - PagedIterable resources = - genericResources.manager().serviceClient().getResources() - .listByResourceGroup(rgName, null, "provisioningState", null, Context.NONE); - Optional resourceOpt - = resources.stream().filter(r -> resourceName.equals(r.name())).findFirst(); - Assertions.assertTrue(resourceOpt.isPresent()); - Assertions.assertEquals("Succeeded", resourceOpt.get().provisioningState()); - - Accepted acceptedDelete = genericResources.beginDeleteById(resource.id()); - acceptedDelete.getFinalResult(); - PagedIterable resourcesAfterDelete = genericResources.listByResourceGroup(rgName); - boolean deleted = resourcesAfterDelete.stream().noneMatch(r -> resourceName.equals(r.name())); - Assertions.assertTrue(deleted); - } - - @Test - public void canCreateUpdateKindSkuIdentity() throws Exception { - final String resourceName = "rs" + testId; - final String apiVersion = "2021-01-01"; - - GenericResource storageResource = resourceClient.genericResources().define(resourceName) - .withRegion(locationOrDefault(Region.US_WEST)) - .withExistingResourceGroup(rgName) - .withResourceType("storageAccounts") - .withProviderNamespace("Microsoft.Storage") - .withoutPlan() - .withKind("Storage") - .withSku(new Sku().withName("Standard_LRS")) - .withIdentity(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) - .withProperties(new ObjectMapper().readTree("{\"minimumTlsVersion\": \"TLS1_2\", \"supportsHttpsTrafficOnly\": true}")) - .withApiVersion(apiVersion) - .create(); - Assertions.assertEquals("Storage", storageResource.kind()); - Assertions.assertEquals("Standard_LRS", storageResource.sku().name()); - Assertions.assertNotNull(storageResource.identity()); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, storageResource.identity().type()); - Assertions.assertNotNull(storageResource.identity().principalId()); - Assertions.assertNotNull(storageResource.identity().tenantId()); - - storageResource.update() - .withKind("StorageV2") - .withoutIdentity() - .withApiVersion(apiVersion) - .apply(); - Assertions.assertEquals("StorageV2", storageResource.kind()); - Assertions.assertEquals(ResourceIdentityType.NONE, storageResource.identity().type()); - - storageResource.update() - .withSku(new Sku().withName("Standard_RAGRS")) - .withApiVersion(apiVersion) - .apply(); - Assertions.assertEquals("Standard_RAGRS", storageResource.sku().name()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/GroupPagedListTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/GroupPagedListTests.java deleted file mode 100644 index eb947710b72a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/GroupPagedListTests.java +++ /dev/null @@ -1,196 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -///** -// * Copyright (c) Microsoft Corporation. All rights reserved. -// * Licensed under the MIT License. See License.txt in the project root for -// * license information. -// */ -// -//package com.azure.management.resources; -// -//import com.microsoft.azure.Page; -//import com.microsoft.azure.PagedList; -//import com.azure.core.management.Region; -//import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.GroupPagedList; -//import com.azure.resourcemanager.resources.implementation.PageImpl; -//import com.azure.resourcemanager.resources.implementation.ResourceGroupInner; -//import com.microsoft.rest.ServiceCallback; -//import com.microsoft.rest.ServiceFuture; -//import org.junit.jupiter.api.Assertions; -//import org.junit.jupiter.api.Test; -//import rx.Observable; -// -//import java.util.ArrayList; -//import java.util.Arrays; -//import java.util.Iterator; -//import java.util.List; -//import java.util.Map; -// -//public class GroupPagedListTests { -// @Test -// public void isResourceLoadedLazily() { -// final List> pages = Arrays.asList( -// new PageImpl(), -// new PageImpl(), -// new PageImpl(), -// new PageImpl() -// ); -// -// pages.get(0).setItems(Arrays.asList(resourceGroup("RG1"), -// resourceGroup("RG2"), -// resourceGroup("RG3"), -// resourceGroup("RG4"), -// resourceGroup("RG5"))); -// pages.get(0).setNextPageLink("1"); -// -// pages.get(1).setItems(Arrays.asList(resourceGroup("RG6"), -// resourceGroup("RG7"), -// resourceGroup("RG8"), -// resourceGroup("RG9"), -// resourceGroup("RG10"))); -// pages.get(1).setNextPageLink("2"); -// -// pages.get(2).setItems(Arrays.asList(resourceGroup("RG11"), -// resourceGroup("RG12"), -// resourceGroup("RG13"), -// resourceGroup("RG14"), -// resourceGroup("RG15"))); -// pages.get(2).setNextPageLink("3"); -// -// pages.get(3).setItems(Arrays.asList(resourceGroup("RG16"), -// resourceGroup("RG17"), -// resourceGroup("RG18"), -// resourceGroup("RG19"), -// resourceGroup("RG20"))); -// pages.get(3).setNextPageLink(null); -// -// List expected = Arrays.asList( -// "1", -// "RG1Vm1", "RG1Vm2", -// "RG2Vm1", "RG2Vm2", -// "RG3Vm1", "RG3Vm2", -// "RG4Vm1", "RG4Vm2", -// "RG5Vm1", "RG5Vm2", -// "2", -// "RG6Vm1", "RG6Vm2", -// "RG7AVm1", "RG7Vm2", -// "RG8AVm1", "RG8Vm2", -// "RG9AVm1", "RG9Vm2", -// "RG10AVm1", "RG10Vm2", -// "3", -// "RG11Vm1", "RG11Vm2", -// "RG12Vm1", "RG12Vm2", -// "RG13Vm1", "RG13Vm2", -// "RG14Vm1", "RG14Vm2", -// "RG15Vm1", "RG15Vm2", -// "RG16Vm1", "RG16Vm2", -// "RG17Vm1", "RG17Vm2", -// "RG18Vm1", "RG18Vm2", -// "RG19Vm1", "RG19Vm2", -// "RG20Vm1", "RG20Vm2" -// ); -// final Iterator itr = expected.iterator(); -// -// PagedList pagedResourceList = new PagedList(pages.get(0)) { -// @Override -// public Page nextPage(String nextLink) { -// Assertions.assertSame(itr.next(), nextLink); -// int index = Integer.parseInt(nextLink); -// return pages.get(index); -// } -// }; -// -// GroupPagedList groupedResourceList = new GroupPagedList(pagedResourceList) { -// @Override -// public List listNextGroup(String s) { -// List groupItems = new ArrayList<>(); -// groupItems.add(s + "Vm1"); -// groupItems.add(s + "Vm2"); -// itr.next(); -// itr.next(); -// -// return groupItems; -// } -// }; -// } -// -// private static ResourceGroup resourceGroup(final String name) { -// return new ResourceGroup() { -// @Override -// public Update update() { -// return null; -// } -// -// @Override -// public String name() { -// return name; -// } -// -// @Override -// public String provisioningState() { -// return null; -// } -// -// @Override -// public String regionName() { -// return null; -// } -// -// @Override -// public Region region() { -// return null; -// } -// -// @Override -// public String id() { -// return null; -// } -// -// @Override -// public String type() { -// return null; -// } -// -// @Override -// public Map tags() { -// return null; -// } -// -// @Override -// public ResourceGroupExportResult exportTemplate(ResourceGroupExportTemplateOptions options) { -// return null; -// } -// -// @Override -// public Observable exportTemplateAsync(ResourceGroupExportTemplateOptions options) { -// return null; -// } -// -// @Override -// public ServiceFuture exportTemplateAsync(ResourceGroupExportTemplateOptions options, ServiceCallback callback) { -// return null; -// } -// -// @Override -// public String key() { -// return null; -// } -// -// @Override -// public ResourceGroup refresh() { -// return refreshAsync().toBlocking().last(); -// } -// -// @Override -// public Observable refreshAsync() { -// return Observable.just(null); -// } -// -// @Override -// public ResourceGroupInner inner() { -// return null; -// } -// }; -// } -//} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/LocksTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/LocksTests.java deleted file mode 100644 index 0755d6a0e84d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/LocksTests.java +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.Region; -import com.azure.core.management.exception.ManagementException; -import com.azure.resourcemanager.resources.models.LockLevel; -import com.azure.resourcemanager.resources.models.ManagementLock; -import com.azure.resourcemanager.resources.models.ResourceGroup; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public class LocksTests extends ResourceManagementTest { - - @Test - public void canCreateLock() { - String rgName = generateRandomResourceName("rgloc", 15); - String lockName = generateRandomResourceName("lock", 15); - - ResourceGroup resourceGroup = resourceClient.resourceGroups().define(rgName) - .withRegion(locationOrDefault(Region.US_WEST)) - .create(); - - ManagementLock lock = resourceClient.managementLocks().define(lockName) - .withLockedResourceGroup(resourceGroup) - .withLevel(LockLevel.CAN_NOT_DELETE) - .create(); - - Assertions.assertNotNull(lock); - Assertions.assertEquals(resourceGroup.id(), lock.lockedResourceId()); - - boolean failed = false; - try { - resourceClient.resourceGroups().deleteByName(rgName); - } catch (ManagementException ex) { - failed = true; - Assertions.assertEquals("ScopeLocked", ex.getValue().getCode()); - } - Assertions.assertTrue(failed); - - resourceClient.managementLocks().deleteById(lock.id()); - resourceClient.resourceGroups().deleteByName(rgName); - } - - @Test - public void canCreateUpdateLock() { - String rgName = generateRandomResourceName("rgloc", 15); - String lockName = generateRandomResourceName("lock", 15); - - ResourceGroup resourceGroup = resourceClient.resourceGroups().define(rgName) - .withRegion(locationOrDefault(Region.US_WEST)) - .create(); - - ManagementLock lock = resourceClient.managementLocks().define(lockName) - .withLockedResourceGroup(resourceGroup) - .withLevel(LockLevel.CAN_NOT_DELETE) - .create(); - - Assertions.assertNotNull(lock); - Assertions.assertEquals(resourceGroup.id(), lock.lockedResourceId()); - Assertions.assertEquals(LockLevel.CAN_NOT_DELETE, lock.level()); - - PagedIterable locks = resourceClient.managementLocks().listForResource(resourceGroup.id()); - ManagementLock foundLock = null; - for (ManagementLock lock1 : locks) { - if (lockName.equals(lock1.name())) { - foundLock = lock1; - break; - } - } - Assertions.assertNotNull(foundLock); - - foundLock.update() - .withLockedResourceGroup(rgName) - .withLevel(LockLevel.READ_ONLY) - .apply(); - - ManagementLock updatedLock = resourceClient.managementLocks().getByResourceGroup(rgName, lockName); - Assertions.assertNotNull(updatedLock); - Assertions.assertEquals(LockLevel.READ_ONLY, updatedLock.level()); - - resourceClient.managementLocks().deleteById(updatedLock.id()); - resourceClient.resourceGroups().deleteByName(rgName); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/PolicyTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/PolicyTests.java deleted file mode 100644 index 1f1574b90a2c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/PolicyTests.java +++ /dev/null @@ -1,169 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.test.annotation.DoNotRecord; -import com.azure.resourcemanager.test.utils.TestUtilities; -import com.azure.resourcemanager.resources.models.GenericResource; -import com.azure.resourcemanager.resources.models.PolicyAssignment; -import com.azure.resourcemanager.resources.models.PolicyDefinition; -import com.azure.resourcemanager.resources.models.PolicyType; -import com.azure.resourcemanager.resources.models.ResourceGroup; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.azure.core.management.Region; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -import java.util.Map; - -public class PolicyTests extends ResourceManagementTest { - private String policyRule = "{\"if\":{\"not\":{\"field\":\"location\",\"in\":[\"southcentralus\",\"westeurope\"]}},\"then\":{\"effect\":\"deny\"}}"; - private String policyRule2 = "{\"if\":{\"not\":{\"field\":\"name\",\"like\":\"[concat(parameters('prefix'),'*',parameters('suffix'))]\"}},\"then\":{\"effect\":\"deny\"}}"; - - @Override - protected void cleanUpResources() { - - } - - @Test - @DoNotRecord(skipInPlayback = true) - public void canCRUDPolicyDefinition() throws Exception { - String policyName = generateRandomResourceName("policy", 15); - String displayName = generateRandomResourceName("mypolicy", 15); - try { - // Create - PolicyDefinition definition = resourceClient.policyDefinitions().define(policyName) - .withPolicyRuleJson(policyRule) - .withPolicyType(PolicyType.CUSTOM) - .withDisplayName(displayName) - .withDescription("This is my policy") - .create(); - Assertions.assertEquals(policyName, definition.name()); - Assertions.assertEquals(PolicyType.CUSTOM, definition.policyType()); - Assertions.assertEquals(displayName, definition.displayName()); - Assertions.assertEquals("This is my policy", definition.description()); - // List - PagedIterable definitions = resourceClient.policyDefinitions().list(); - boolean found = false; - for (PolicyDefinition def : definitions) { - if (definition.id().equalsIgnoreCase(def.id())) { - found = true; - } - } - Assertions.assertTrue(found); - // Get - definition = resourceClient.policyDefinitions().getByName(policyName); - Assertions.assertNotNull(definition); - Assertions.assertEquals(displayName, definition.displayName()); - } finally { - // Delete - resourceClient.policyDefinitions().deleteByName(policyName); - } - } - - @Test - @Disabled("default values won't work with policy definition parameters in 2016-12-01 in AzureCloud") - @DoNotRecord(skipInPlayback = true) - public void canCRUDPolicyAssignment() throws Exception { - String policyName = generateRandomResourceName("policy", 15); - String policyName2 = generateRandomResourceName("policy2", 15); - String displayName = generateRandomResourceName("mypolicy", 15); - String rgName = generateRandomResourceName("javarg", 15); - String assignmentName1 = generateRandomResourceName("assignment1", 15); - String assignmentName2 = generateRandomResourceName("assignment2", 15); - String assignmentName3 = generateRandomResourceName("assignment3", 15); - String resourceName = generateRandomResourceName("webassignment", 15); - try { - // Create definition - PolicyDefinition definition = resourceClient.policyDefinitions().define(policyName) - .withPolicyRuleJson(policyRule) - .withPolicyType(PolicyType.CUSTOM) - .withDisplayName(displayName) - .withDescription("This is my policy") - .create(); - // Create assignment - ResourceGroup group = resourceClient.resourceGroups().define(rgName) - .withRegion(locationOrDefault(Region.UK_WEST)) - .create(); - PolicyAssignment assignment1 = resourceClient.policyAssignments().define(assignmentName1) - .forResourceGroup(group) - .withPolicyDefinition(definition) - .withDisplayName("My Assignment") - .create(); - - Assertions.assertNotNull(assignment1); - Assertions.assertEquals("My Assignment", assignment1.displayName()); - - Assertions.assertEquals(group.id(), assignment1.scope()); - Assertions.assertNull(assignment1.parameters()); - - GenericResource resource = resourceClient.genericResources().define(resourceName) - .withRegion(locationOrDefault(Region.US_SOUTH_CENTRAL)) - .withExistingResourceGroup(group) - .withResourceType("sites") - .withProviderNamespace("Microsoft.Web") - .withoutPlan() - .withApiVersion("2020-12-01") - .withParentResourcePath("") - .withProperties(new ObjectMapper().readTree("{\"SiteMode\":\"Limited\",\"ComputeMode\":\"Shared\"}")) - .create(); - - PolicyAssignment assignment2 = resourceClient.policyAssignments().define(assignmentName2) - .forResource(resource) - .withPolicyDefinition(definition) - .withDisplayName("My Assignment 2") - .create(); - - Assertions.assertNotNull(assignment2); - Assertions.assertEquals("My Assignment 2", assignment2.displayName()); - - PagedIterable assignments = resourceClient.policyAssignments().listByResourceGroup(rgName); - Assertions.assertTrue(TestUtilities.getSize(assignments) >= 2); - - boolean foundAssignment1 = false; - boolean foundAssignment2 = false; - for (PolicyAssignment policyAssignment : assignments) { - if (policyAssignment.id().equalsIgnoreCase(assignment1.id())) { - foundAssignment1 = true; - } else if (policyAssignment.id().equalsIgnoreCase(assignment2.id())) { - foundAssignment2 = true; - } - } - Assertions.assertTrue(foundAssignment1); - Assertions.assertTrue(foundAssignment2); - - // definition and assignment with parameters - PolicyDefinition definition2 = resourceClient.policyDefinitions().define(policyName) - .withPolicyRuleJson(policyRule2) - .withPolicyType(PolicyType.CUSTOM) - .withParameters(new ObjectMapper().readTree( - "{\"prefix\":{\"type\":\"string\"},\"suffix\":{\"type\":\"string\"}}")) - .withDisplayName(displayName) - .withDescription("Test policy") - .create(); - PolicyAssignment assignment3 = resourceClient.policyAssignments().define(assignmentName3) - .forResourceGroup(group) - .withPolicyDefinition(definition2) - .withParameters(new ObjectMapper().readTree( - "{\"prefix\":\"DeptA\",\"suffix\":\"-LC\"}")) - .withDisplayName("Test Assignment") - .create(); - - assignment3 = resourceClient.policyAssignments().getById(assignment3.id()); - Assertions.assertEquals(group.id(), assignment3.scope()); - Assertions.assertEquals(2, new ObjectMapper().convertValue(assignment3.parameters(), Map.class).size()); - - // Delete - resourceClient.policyAssignments().deleteById(assignment1.id()); - resourceClient.policyAssignments().deleteById(assignment2.id()); - resourceClient.policyAssignments().deleteById(assignment3.id()); - resourceClient.policyDefinitions().deleteByName(policyName); - resourceClient.policyDefinitions().deleteByName(policyName2); - } finally { - resourceClient.resourceGroups().deleteByName(rgName); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/ProvidersTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/ProvidersTests.java deleted file mode 100644 index 66c09a217de0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/ProvidersTests.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.test.utils.TestUtilities; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import com.azure.resourcemanager.resources.models.Provider; -import com.azure.resourcemanager.resources.models.ProviderResourceType; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -import java.time.Duration; -import java.util.List; - -public class ProvidersTests extends ResourceManagementTest { - - @Override - protected void cleanUpResources() { - } - - @Test - public void canUnregisterAndRegisterProvider() throws Exception { - PagedIterable providers = resourceClient.providers().list(); - int size = TestUtilities.getSize(providers); - Assertions.assertTrue(size > 0); - Provider provider = providers.iterator().next(); - resourceClient.providers().unregister(provider.namespace()); - provider = resourceClient.providers().getByName(provider.namespace()); - while (provider.registrationState().equals("Unregistering")) { - ResourceManagerUtils.sleep(Duration.ofSeconds(5)); - provider = resourceClient.providers().getByName(provider.namespace()); - } - resourceClient.providers().register(provider.namespace()); - while (provider.registrationState().equals("Unregistered") - || provider.registrationState().equalsIgnoreCase("Registering")) { - ResourceManagerUtils.sleep(Duration.ofSeconds(5)); - provider = resourceClient.providers().getByName(provider.namespace()); - } - Assertions.assertEquals("Registered", provider.registrationState()); - List resourceTypes = provider.resourceTypes(); - Assertions.assertTrue(resourceTypes.size() > 0); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/ResourceGroupsTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/ResourceGroupsTests.java deleted file mode 100644 index d83ac907e634..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/ResourceGroupsTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources; - -import com.azure.core.http.HttpPipeline; -import com.azure.core.management.Region; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.resources.models.ResourceGroup; -import com.azure.resourcemanager.resources.models.ResourceGroups; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public class ResourceGroupsTests extends ResourceManagementTest { - private ResourceGroups resourceGroups; - - @Override - protected void initializeClients(HttpPipeline httpPipeline, AzureProfile profile) { - super.initializeClients(httpPipeline, profile); - resourceGroups = resourceClient.resourceGroups(); - } - - @Test - public void canCreateResourceGroup() throws Exception { - final String rgName = generateRandomResourceName("rg", 9); - Region region = locationOrDefault(Region.US_SOUTH_CENTRAL); - // Create - resourceGroups.define(rgName) - .withRegion(locationOrDefault(Region.US_SOUTH_CENTRAL)) - .withTag("department", "finance") - .withTag("tagname", "tagvalue") - .create(); - // List - ResourceGroup groupResult = null; - for (ResourceGroup rg : resourceGroups.listByTag("department", "finance")) { - if (rg.name().equals(rgName)) { - groupResult = rg; - break; - } - } - Assertions.assertNotNull(groupResult); - Assertions.assertEquals("finance", groupResult.tags().get("department")); - Assertions.assertEquals("tagvalue", groupResult.tags().get("tagname")); - Assertions.assertTrue(region.name().equalsIgnoreCase(groupResult.regionName())); - - // Check existence - Assertions.assertTrue(resourceGroups.contain(rgName)); - - // Get - ResourceGroup getGroup = resourceGroups.getByName(rgName); - Assertions.assertNotNull(getGroup); - Assertions.assertEquals(rgName, getGroup.name()); - // Update - ResourceGroup updatedGroup = getGroup.update() - .withTag("tag1", "value1") - .apply(); - Assertions.assertEquals("value1", updatedGroup.tags().get("tag1")); - Assertions.assertTrue(region.name().equalsIgnoreCase(getGroup.regionName())); - // Delete - resourceGroups.beginDeleteByName(rgName); - // Assertions.assertFalse(resourceGroups.checkExistence(rgName)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/ResourceIdTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/ResourceIdTests.java deleted file mode 100644 index f64f83cbd436..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/ResourceIdTests.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources; - -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceId; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -/** - * Test class to test ResourceId class. - */ -public class ResourceIdTests { - - - @Test - public void resourceIdForTopLevelResourceWorksFine() { - ResourceId resourceId = ResourceId.fromString("/subscriptions/9657ab5d-4a4a-4fd2-ae7a-4cd9fbd030ef/resourceGroups/resourceGroupName/providers/Microsoft.Network/applicationGateways/something"); - - Assertions.assertEquals(resourceId.name(), "something"); - Assertions.assertEquals(resourceId.subscriptionId(), "9657ab5d-4a4a-4fd2-ae7a-4cd9fbd030ef"); - Assertions.assertEquals(resourceId.resourceGroupName(), "resourceGroupName"); - Assertions.assertEquals(resourceId.providerNamespace(), "Microsoft.Network"); - Assertions.assertEquals(resourceId.resourceType(), "applicationGateways"); - Assertions.assertEquals(resourceId.fullResourceType(), "Microsoft.Network/applicationGateways"); - Assertions.assertNull(resourceId.parent()); - } - - @Test - public void resourceIdForChildLevelResourceWorksFine() { - ResourceId resourceId = ResourceId.fromString("/subscriptions/9657ab5d-4a4a-4fd2-ae7a-4cd9fbd030ef/resourceGroups/resourceGroupName/providers/Microsoft.Network/applicationGateways/something/someChildType/childName"); - - Assertions.assertEquals(resourceId.name(), "childName"); - Assertions.assertEquals(resourceId.subscriptionId(), "9657ab5d-4a4a-4fd2-ae7a-4cd9fbd030ef"); - Assertions.assertEquals(resourceId.resourceGroupName(), "resourceGroupName"); - Assertions.assertEquals(resourceId.providerNamespace(), "Microsoft.Network"); - Assertions.assertEquals(resourceId.resourceType(), "someChildType"); - Assertions.assertEquals(resourceId.fullResourceType(), "Microsoft.Network/applicationGateways/someChildType"); - Assertions.assertNotNull(resourceId.parent()); - Assertions.assertEquals(resourceId.parent().name(), "something"); - Assertions.assertEquals(resourceId.parent().subscriptionId(), "9657ab5d-4a4a-4fd2-ae7a-4cd9fbd030ef"); - Assertions.assertEquals(resourceId.parent().resourceGroupName(), "resourceGroupName"); - Assertions.assertEquals(resourceId.parent().name(), "something"); - Assertions.assertEquals(resourceId.parent().providerNamespace(), "Microsoft.Network"); - Assertions.assertEquals(resourceId.parent().resourceType(), "applicationGateways"); - Assertions.assertEquals(resourceId.parent().fullResourceType(), "Microsoft.Network/applicationGateways"); - } - - @Test - public void resourceIdForGrandChildLevelResourceWorksFine() { - ResourceId resourceId = ResourceId.fromString("/subscriptions/9657ab5d-4a4a-4fd2-ae7a-4cd9fbd030ef/resourceGroups/resourceGroupName/providers/Microsoft.Network/applicationGateways/something/someChildType/childName/grandChildType/grandChild"); - - Assertions.assertEquals(resourceId.name(), "grandChild"); - Assertions.assertEquals(resourceId.subscriptionId(), "9657ab5d-4a4a-4fd2-ae7a-4cd9fbd030ef"); - Assertions.assertEquals(resourceId.resourceGroupName(), "resourceGroupName"); - Assertions.assertEquals(resourceId.providerNamespace(), "Microsoft.Network"); - Assertions.assertEquals(resourceId.resourceType(), "grandChildType"); - Assertions.assertEquals(resourceId.fullResourceType(), "Microsoft.Network/applicationGateways/someChildType/grandChildType"); - Assertions.assertNotNull(resourceId.parent()); - Assertions.assertEquals(resourceId.parent().name(), "childName"); - Assertions.assertEquals(resourceId.parent().subscriptionId(), "9657ab5d-4a4a-4fd2-ae7a-4cd9fbd030ef"); - Assertions.assertEquals(resourceId.parent().resourceGroupName(), "resourceGroupName"); - Assertions.assertEquals(resourceId.parent().providerNamespace(), "Microsoft.Network"); - Assertions.assertEquals(resourceId.parent().resourceType(), "someChildType"); - Assertions.assertEquals(resourceId.parent().fullResourceType(), "Microsoft.Network/applicationGateways/someChildType"); - Assertions.assertNotNull(resourceId.parent().parent()); - Assertions.assertEquals(resourceId.parent().parent().name(), "something"); - Assertions.assertEquals(resourceId.parent().parent().subscriptionId(), "9657ab5d-4a4a-4fd2-ae7a-4cd9fbd030ef"); - Assertions.assertEquals(resourceId.parent().parent().resourceGroupName(), "resourceGroupName"); - Assertions.assertEquals(resourceId.parent().parent().name(), "something"); - Assertions.assertEquals(resourceId.parent().parent().providerNamespace(), "Microsoft.Network"); - Assertions.assertEquals(resourceId.parent().parent().resourceType(), "applicationGateways"); - Assertions.assertEquals(resourceId.parent().parent().fullResourceType(), "Microsoft.Network/applicationGateways"); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/ResourceManagementTest.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/ResourceManagementTest.java deleted file mode 100644 index 4bb52b7e00f4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/ResourceManagementTest.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources; - -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.policy.HttpLogOptions; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.resources.fluentcore.utils.HttpPipelineProvider; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import com.azure.resourcemanager.test.ResourceManagerTestBase; -import com.azure.resourcemanager.test.utils.TestDelayProvider; - -import java.time.temporal.ChronoUnit; -import java.util.List; - -/** - * The base for resource manager tests. - */ -class ResourceManagementTest extends ResourceManagerTestBase { - protected ResourceManager resourceClient; - - @Override - protected HttpPipeline buildHttpPipeline( - TokenCredential credential, - AzureProfile profile, - HttpLogOptions httpLogOptions, - List policies, - HttpClient httpClient) { - return HttpPipelineProvider.buildHttpPipeline( - credential, - profile, - null, - httpLogOptions, - null, - new RetryPolicy("Retry-After", ChronoUnit.SECONDS), - policies, - httpClient); - } - - @Override - protected void initializeClients(HttpPipeline httpPipeline, AzureProfile profile) { - ResourceManagerUtils.InternalRuntimeContext.setDelayProvider(new TestDelayProvider(!isPlaybackMode())); - resourceClient = buildManager(ResourceManager.class, httpPipeline, profile); - } - - @Override - protected void cleanUpResources() { - - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/SubscriptionsTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/SubscriptionsTests.java deleted file mode 100644 index 9d35f872a442..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/SubscriptionsTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.resources.models.Location; -import com.azure.resourcemanager.resources.models.Subscription; -import com.azure.resourcemanager.test.utils.TestUtilities; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public class SubscriptionsTests extends ResourceManagementTest { - @Test - public void canListSubscriptions() { - PagedIterable subscriptions = resourceClient.subscriptions().list(); - Assertions.assertTrue(TestUtilities.getSize(subscriptions) > 0); - } - - @Test - public void canListLocations() { - PagedIterable locations = resourceClient.subscriptions().list().iterator().next().listLocations(); - Assertions.assertTrue(TestUtilities.getSize(locations) > 0); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/TagsTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/TagsTests.java deleted file mode 100644 index 69464250c3a3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/TagsTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources; - -import com.azure.resourcemanager.resources.implementation.TypeSerializationTests; -import com.azure.resourcemanager.resources.models.GenericResource; -import com.azure.resourcemanager.resources.models.TagResource; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -import java.util.HashMap; -import java.util.Map; - -public class TagsTests extends ResourceManagementTest { - - @Test - public void canUpdateTag() throws Exception { - // assume there is a resource - GenericResource resource = resourceClient.genericResources().list().iterator().next(); - - Map originalTags = resource.tags(); - if (originalTags == null) { - originalTags = new HashMap<>(); - } - - TagResource updatedTags = resourceClient.tagOperations().updateTags(resource, new TypeSerializationTests.Map1<>("tag.1", "value.1")); - Assertions.assertNotNull(updatedTags.tags()); - Assertions.assertEquals(1, updatedTags.tags().size()); - Assertions.assertTrue(updatedTags.tags().containsKey("tag.1")); - Assertions.assertEquals("value.1", updatedTags.tags().get("tag.1")); - - updatedTags = resourceClient.tagOperations().updateTags(resource, new HashMap<>()); - Assertions.assertEquals(0, updatedTags.tags().size()); - - updatedTags = resourceClient.tagOperations().updateTags(resource, originalTags); - Assertions.assertEquals(originalTags, updatedTags.tags()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/TenantsTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/TenantsTests.java deleted file mode 100644 index d123a635cbd9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/TenantsTests.java +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.resources.models.Tenant; -import com.azure.resourcemanager.test.utils.TestUtilities; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public class TenantsTests extends ResourceManagementTest { - @Test - public void canListTenants() throws Exception { - PagedIterable tenants = resourceClient.tenants().list(); - Assertions.assertTrue(TestUtilities.getSize(tenants) > 0); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/TooManyRequestsRetryInterceptorTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/TooManyRequestsRetryInterceptorTests.java deleted file mode 100644 index 4d8dfb2ef8dd..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/TooManyRequestsRetryInterceptorTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -///** -// * Copyright (c) Microsoft Corporation. All rights reserved. -// * Licensed under the MIT License. See License.txt in the project root for -// * license information. -// */ -//package com.azure.management.resources; -// -//import com.azure.core.management.Region; -//import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -//import com.microsoft.rest.RestClient; -//import org.junit.jupiter.api.Disabled; -//import org.junit.jupiter.api.Test; -//import rx.Observable; -//import rx.Subscriber; -//import rx.functions.Func1; -//import rx.schedulers.Schedulers; -// -//public class TooManyRequestsRetryInterceptorTests extends ResourceManagementTest { -// private static ResourceGroups resourceGroups; -// -// private String rgName; -// private String testId; -// private ResourceGroup rg; -// -// @Override -// protected void initializeClients(RestClient restClient, String defaultSubscription, String domain) { -// testId = ResourceManagerUtils.InternalRuntimeContext.randomResourceName("", 9); -// rgName = "rg429" + testId; -// -// super.initializeClients(restClient, defaultSubscription, domain); -// resourceGroups = resourceClient.getResourceGroups(); -// -// rg = resourceGroups.define(rgName) -// .withRegion(Region.US_EAST) -// .create(); -// } -// -// @Override -// protected void cleanUpResources() { -// resourceGroups.beginDeleteByName(rgName); -// } -// -// @Disabled("Not for every testing") -// public void canGenerate429() throws Exception { -// Observable.range(1, 1250).flatMap(new Func1>() { -// @Override -// public Observable call(final Integer iteration) { -// return Observable.create(new Observable.OnSubscribe() { -// @Override -// public void call(Subscriber subscriber) { -// System.out.format("Current time for %d is: %d\n", iteration, System.currentTimeMillis()); -// rg.update().apply(); -// subscriber.onCompleted(); -// } -// }); -// } -// }, 10) -// .subscribeOn(Schedulers.io()).toBlocking().subscribe(); -// } -//} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/childresource/ChickenImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/childresource/ChickenImpl.java deleted file mode 100644 index 51329580a602..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/childresource/ChickenImpl.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.childresource; - - -import reactor.core.publisher.Flux; - -class ChickenImpl { - private PulletsImpl pullets; - - ChickenImpl() { - this.pullets = new PulletsImpl(this); - this.pullets.enableCommitMode(); - } - - PulletsImpl pullets() { - return this.pullets; - } - - ChickenImpl withPullet(PulletImpl pullet) { - this.pullets.addPullet(pullet); - return this; - } - - PulletImpl defineNewPullet(String name) { - return this.pullets.define(name); - } - - PulletImpl updatePullet(String name) { - return this.pullets.update(name); - } - - ChickenImpl withoutPullet(String name) { - this.pullets.remove(name); - return this; - } - - Flux applyAsync() { - final ChickenImpl self = this; - return this.pullets.commitAsync() - .flatMap(p -> Flux.just(self)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/childresource/ExternalChildResourceTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/childresource/ExternalChildResourceTests.java deleted file mode 100644 index 0cff565d0167..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/childresource/ExternalChildResourceTests.java +++ /dev/null @@ -1,223 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.childresource; - -import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.ExternalChildResourceImpl; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.Indexable; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Flux; - -import java.util.ArrayList; -import java.util.List; -import java.util.concurrent.CountDownLatch; - -public class ExternalChildResourceTests { - @Test - public void noCommitIfNoChange() throws InterruptedException { - ChickenImpl chicken = new ChickenImpl(); // Parent resource - PulletsImpl pullets = chicken.pullets(); // Child resource collection - final CountDownLatch monitor = new CountDownLatch(1); - // Note that commitAsync() won't be exposed to the end-user as it's a part of child resource impl - // pullets.commitAsync will be called from (Applicable)chicken.applyAsync() or (Creatable)chicken.createAsyncStreaming(). - // - // Observable Chicken::ApplyAsync() { - // [1] update chicken - // [2] update pullets by calling pullets.commitAsync() - // } - // - // In the unit test cases we call it directly as we testing external child resource here. - // - pullets.commitAsync() - .subscribe( - pullet -> Assertions.assertTrue(false, "nothing to commit onNext should not be invoked"), - - throwable -> { - monitor.countDown(); - Assertions.assertTrue(false, "nothing to commit onError should not be invoked"); - }, - () -> monitor.countDown() - ); - monitor.await(); - } - - @Test - public void shouldCommitCreateUpdateAndDelete() throws InterruptedException { - ChickenImpl chicken = new ChickenImpl(); // Parent resource - chicken - .defineNewPullet("alice") - .withAge(1) - .attach() - .updatePullet("Clover") - .withAge(2) - .parent() - .withoutPullet("Pinky"); - - final List changedPuppets = new ArrayList<>(); - final CountDownLatch monitor = new CountDownLatch(1); - - PulletsImpl pullets = chicken.pullets(); - pullets.commitAsync().subscribe( - pullet -> changedPuppets.add(pullet), - throwable -> { - monitor.countDown(); - Assertions.assertTrue(false, "onError should not be invoked"); - }, - () -> monitor.countDown() - ); - - monitor.await(); - Assertions.assertTrue(changedPuppets.size() == 3); - for (PulletImpl pullet : changedPuppets) { - Assertions.assertTrue(pullet.pendingOperation() == ExternalChildResourceImpl.PendingOperation.None); - } - } - - @Test - public void shouldEmitErrorAfterAllSuccessfulCommit() throws InterruptedException { - ChickenImpl chicken = new ChickenImpl(); // Parent resource - chicken - .defineNewPullet("alice") - .withAge(1) - .withFailFlag(PulletImpl.FailFlag.OnCreate) - .attach() - .updatePullet("Clover") - .withAge(2) - .parent() - .updatePullet("Goldilocks") - .withAge(2) - .withFailFlag(PulletImpl.FailFlag.OnUpdate) - .parent() - .withoutPullet("Pinky"); - - final List changedPuppets = new ArrayList<>(); - final List throwables = new ArrayList<>(); - final CountDownLatch monitor = new CountDownLatch(1); - PulletsImpl pullets = chicken.pullets(); - pullets.commitAsync() - .subscribe( - pullet -> changedPuppets.add(pullet), - throwable -> { - try { - Throwable[] exception = throwable.getSuppressed(); - Assertions.assertNotNull(exception); - for (Throwable innerThrowable : exception) { - throwables.add(innerThrowable); - } - } finally { - monitor.countDown(); - } - }, - () -> { - monitor.countDown(); - Assertions.assertTrue(false, "onCompleted should not be invoked"); - } - ); - - monitor.await(); - Assertions.assertTrue(throwables.size() == 2); - Assertions.assertTrue(changedPuppets.size() == 2); - } - - @Test - public void canStreamAccumulatedResult() throws InterruptedException { - ChickenImpl chicken = new ChickenImpl(); - chicken - .defineNewPullet("alice") - .withAge(1) - .attach() - .updatePullet("Clover") - .withAge(2) - .attach() - .withoutPullet("Pinky"); - - PulletsImpl pullets = chicken.pullets(); - final CountDownLatch monitor = new CountDownLatch(1); - pullets.commitAndGetAllAsync() - .subscribe(lets -> Assertions.assertTrue(lets.size() == 3), - throwable -> { - monitor.countDown(); - Assertions.assertTrue(false, "onError should not be invoked"); - }, - () -> monitor.countDown() - ); - - - monitor.await(); - } - - @Test - public void canCrossReferenceChildren() throws Exception { - SchoolsImpl schools = new SchoolsImpl(); - - Flux items = schools.define("redmondSchool") - .withAddress("sc-address") - .defineTeacher("maria") - .withSubject("Maths") - .attach() - .defineStudent("bob") - .withAge(10) - .withTeacher("maria") // Refer another creatable external child resource with key 'maria' in the parent - .attach() - .createAsync(); - - final SchoolsImpl.SchoolImpl[] foundSchool = new SchoolsImpl.SchoolImpl[1]; - final SchoolsImpl.TeacherImpl[] foundTeacher = new SchoolsImpl.TeacherImpl[1]; - final SchoolsImpl.StudentImpl[] foundStudent = new SchoolsImpl.StudentImpl[1]; - - items.doOnNext(indexable -> { - if (indexable instanceof SchoolsImpl.SchoolImpl) { - foundSchool[0] = (SchoolsImpl.SchoolImpl) indexable; - } - if (indexable instanceof SchoolsImpl.TeacherImpl) { - foundTeacher[0] = (SchoolsImpl.TeacherImpl) indexable; - } - if (indexable instanceof SchoolsImpl.StudentImpl) { - foundStudent[0] = (SchoolsImpl.StudentImpl) indexable; - } - }).blockLast(); - - Assertions.assertNotNull(foundSchool[0]); - Assertions.assertNotNull(foundTeacher[0]); - Assertions.assertNotNull(foundStudent[0]); - - Assertions.assertTrue(foundSchool[0].isInvoked()); - Assertions.assertTrue(foundTeacher[0].isInvoked()); - Assertions.assertTrue(foundStudent[0].isInvoked()); - } - - @Test - public void canCreateChildrenIndependently() throws Exception { - SchoolsImpl schools = new SchoolsImpl(); - - Creatable creatableTeacher = schools.independentTeachers() - .define("john") - .withSubject("physics"); - - SchoolsImpl.StudentImpl creatableStudent = schools.independentStudents() - .define("nit") - .withAge(15) - .withTeacher(creatableTeacher); - - final SchoolsImpl.TeacherImpl[] foundTeacher = new SchoolsImpl.TeacherImpl[1]; - final SchoolsImpl.StudentImpl[] foundStudent = new SchoolsImpl.StudentImpl[1]; - - creatableStudent.taskGroup().invokeAsync(creatableStudent.taskGroup().newInvocationContext()) - .doOnNext(indexable -> { - if (indexable instanceof SchoolsImpl.TeacherImpl) { - foundTeacher[0] = (SchoolsImpl.TeacherImpl) indexable; - } - if (indexable instanceof SchoolsImpl.StudentImpl) { - foundStudent[0] = (SchoolsImpl.StudentImpl) indexable; - } - }).blockLast(); - - Assertions.assertNotNull(foundTeacher[0]); - Assertions.assertNotNull(foundStudent[0]); - - Assertions.assertTrue(foundTeacher[0].isInvoked()); - Assertions.assertTrue(foundStudent[0].isInvoked()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/childresource/Pullet.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/childresource/Pullet.java deleted file mode 100644 index 0e06f3831c2c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/childresource/Pullet.java +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.childresource; - -import com.azure.resourcemanager.resources.fluentcore.arm.models.ExternalChildResource; - -interface Pullet extends ExternalChildResource { -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/childresource/PulletImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/childresource/PulletImpl.java deleted file mode 100644 index c7be7bbfb4b1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/childresource/PulletImpl.java +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.childresource; - -import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.ExternalChildResourceImpl; -import reactor.core.publisher.Mono; -import reactor.core.scheduler.Schedulers; - -class PulletImpl extends ExternalChildResourceImpl - implements Pullet { - Integer age; - private FailFlag failFlag = FailFlag.None; - - PulletImpl(String name, ChickenImpl parent) { - super(name, name, parent, new Object()); - } - - public PulletImpl withAge(Integer age) { - this.age = age; - return this; - } - - public PulletImpl withFailFlag(FailFlag failFlag) { - this.failFlag = failFlag; - return this; - } - - public ChickenImpl attach() { - return this.parent().withPullet(this); - } - - @Override - public Mono createResourceAsync() { - try { - Thread.sleep(2000); - } catch (InterruptedException ex) { - } - - if (this.failFlag == FailFlag.OnCreate) { - return Mono.error(new Exception("Creation of " + this.name() + " failed")); - } - - Pullet self = this; - return Mono - .just(self) - .subscribeOn(Schedulers.boundedElastic()); - } - - @Override - public Mono updateResourceAsync() { - try { - Thread.sleep(2000); - } catch (InterruptedException ex) { - } - - if (this.failFlag == FailFlag.OnUpdate) { - return Mono.error(new Exception("Update of " + this.name() + " failed")); - } - - Pullet self = this; - return Mono - .just(self) - .subscribeOn(Schedulers.boundedElastic()); - } - - @Override - public Mono deleteResourceAsync() { - try { - Thread.sleep(2000); - } catch (InterruptedException ex) { - } - - if (this.failFlag == FailFlag.OnDelete) { - return Mono.error(new Exception("Deletion of " + this.name() + " failed")); - } - - return Mono.empty(); - } - - @Override - protected Mono getInnerAsync() { - return Mono.empty(); - } - - @Override - public String id() { - return null; - } - - enum FailFlag { - None, - OnCreate, - OnUpdate, - OnDelete - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/childresource/PulletsImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/childresource/PulletsImpl.java deleted file mode 100644 index b3bb49fc03d5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/childresource/PulletsImpl.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.childresource; - -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.ExternalChildResourcesCachedImpl; -import reactor.core.publisher.Flux; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -class PulletsImpl extends ExternalChildResourcesCachedImpl { - PulletsImpl(ChickenImpl parent) { - super(parent, null, "Pullet"); - cacheCollection(); - } - - public PulletImpl define(String name) { - return super.prepareInlineDefine(name); - } - - public PulletImpl update(String name) { - return super.prepareInlineUpdate(name); - } - - public void remove(String name) { - super.prepareInlineRemove(name); - } - - public void addPullet(PulletImpl pullet) { - this.addChildResource(pullet); - } - - @Override - protected List listChildResources() { - List resources = new ArrayList<>(); - resources.add(new PulletImpl("Tilly", this.getParent())); - resources.add(new PulletImpl("Clover", this.getParent())); - resources.add(new PulletImpl("Savvy", this.getParent())); - resources.add(new PulletImpl("Pinky", this.getParent())); - resources.add(new PulletImpl("Goldilocks", this.getParent())); - return Collections.unmodifiableList(resources); - } - - @Override - protected Flux listChildResourcesAsync() { - return Flux.fromIterable(listChildResources()); - } - - @Override - protected PulletImpl newChildResource(String name) { - return new PulletImpl(name, this.getParent()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/childresource/SchoolsImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/childresource/SchoolsImpl.java deleted file mode 100644 index 8fc562062035..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/childresource/SchoolsImpl.java +++ /dev/null @@ -1,385 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.childresource; - -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.ExternalChildResourcesCachedImpl; -import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.ExternalChildResourceImpl; -import com.azure.resourcemanager.resources.fluentcore.dag.TaskGroup; -import com.azure.resourcemanager.resources.fluentcore.dag.TaskItem; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.Indexable; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -import java.util.ArrayList; -import java.util.List; - -/** - * Type representing top level school collection using which - * 1. new schools can be created with associated teachers and students - * 2. new teachers and students can be created independently. - */ -class SchoolsImpl { - private IndependentTeachersImpl independentTeachers; - private IndependentStudentsImpl independentStudents; - - SchoolsImpl() { - this.independentTeachers = new IndependentTeachersImpl(); - this.independentStudents = new IndependentStudentsImpl(); - } - - public SchoolImpl define(String name) { - return new SchoolImpl(name); - } - - // Accessor to teachers collection from schools that can be created independently - // - public IndependentTeachersImpl independentTeachers() { - return this.independentTeachers; - } - - // Accessor to students collection from schools that can be created independently - // - public IndependentStudentsImpl independentStudents() { - return this.independentStudents; - } - - /** - * Type representing an instance of School. - */ - class SchoolImpl implements TaskItem, Indexable { - private final TaskGroup taskGroup; - private final String name; - private final String key; - private boolean isInvoked; - private InlineTeachersImpl inlineTeachers; - private IndependentTeachersImpl independentTeachers; - private InlineStudentsImpl inlineStudents; - private IndependentStudentsImpl independentStudents; - - SchoolImpl(String name) { - this.name = name; - this.key = name; - this.taskGroup = new TaskGroup(this.key, this); - this.inlineTeachers = new InlineTeachersImpl(this, this.taskGroup, "InlineTeacher"); - this.independentTeachers = new IndependentTeachersImpl(); - - this.inlineStudents = new InlineStudentsImpl(this, this.taskGroup, "InlineStudent"); - this.independentStudents = new IndependentStudentsImpl(); - } - - public boolean isInvoked() { - return this.isInvoked; - } - - @Override - public String key() { - return this.key; - } - - public SchoolImpl withAddress(String address) { - return this; - } - - // Define an inline teacher that can be associated to school by invoking attach() - // - public TeacherImpl defineTeacher(String name) { - return this.inlineTeachers.define(name); - } - - // Teachers in the school that can be created and updated independently - // - public IndependentTeachersImpl independentTeachers() { - return this.independentTeachers; - } - - // Define an inline student that can be associated to school by invoking attach() - // - public StudentImpl defineStudent(String name) { - return this.inlineStudents.define(name); - } - - // Students in the school that can be created and updated independently - // - public IndependentStudentsImpl independentStudents() { - return this.independentStudents; - } - - public Flux createAsync() { - return taskGroup.invokeAsync(this.taskGroup.newInvocationContext()); - } - - @Override - public Indexable result() { - return this; - } - - @Override - public void beforeGroupInvoke() { - // NOP - } - - @Override - public boolean isHot() { - return true; - } - - @Override - public Mono invokeAsync(TaskGroup.InvocationContext context) { - return Mono.just(this) - .map(indexable -> { - isInvoked = true; - return indexable; - }); - } - - @Override - public Mono invokeAfterPostRunAsync(boolean isGroupFaulted) { - return Mono.empty(); - } - - public SchoolImpl withTeacher(TeacherImpl teacher) { - this.inlineTeachers.withTeacher(teacher); - return this; - } - - public SchoolImpl withStudent(StudentImpl student) { - this.inlineStudents.withStudent(student); - return this; - } - } - - /** - * Type representing an instance of Teacher. - */ - class TeacherImpl - extends ExternalChildResourceImpl - implements TaskGroup.HasTaskGroup, Creatable { - - private boolean isInvoked; - - protected TeacherImpl(String name, SchoolImpl parent, Object inner) { - super(name, name, parent, inner); - } - - TeacherImpl withSubject(String subjectName) { - return this; - } - - @Override - public String id() { - return name(); - } - - public boolean isInvoked() { - return this.isInvoked; - } - - @Override - public Mono createResourceAsync() { - return Mono.just(this) - .map(teacher -> { - isInvoked = true; - return teacher; - }); - } - - @Override - public Mono updateResourceAsync() { - throw new UnsupportedOperationException(); - } - - @Override - public Mono deleteResourceAsync() { - throw new UnsupportedOperationException(); - } - - @Override - protected Mono getInnerAsync() { - throw new UnsupportedOperationException(); - } - - public SchoolImpl attach() { - return this.parent().withTeacher(this); - } - } - - /** - * Type representing Teacher collection where a teacher entries can be created as part of parent School. - */ - class InlineTeachersImpl extends ExternalChildResourcesCachedImpl { - - protected InlineTeachersImpl(SchoolImpl parent, TaskGroup parentTaskGroup, String childResourceName) { - super(parent, parentTaskGroup, childResourceName); - } - - public TeacherImpl define(String name) { - return super.prepareInlineDefine(name); - } - - TeacherImpl findTeacher(String teacherName) { - return this.find(teacherName); - } - - @Override - protected Flux listChildResourcesAsync() { - return Flux.empty(); - } - - @Override - protected List listChildResources() { - return new ArrayList<>(); - } - - @Override - protected TeacherImpl newChildResource(String name) { - return new TeacherImpl(name, this.getParent(), null); - } - - public void withTeacher(TeacherImpl teacher) { - this.addChildResource(teacher); - } - } - - /** - * Type representing Teacher collection where a teacher entries can be created independently. - */ - class IndependentTeachersImpl { - public TeacherImpl define(String name) { - TeacherImpl newTeacher = new TeacherImpl(name, null, null); - newTeacher.setPendingOperation(ExternalChildResourceImpl.PendingOperation.ToBeCreated); - return newTeacher; - } - } - - /** - * Type representing an instance of Student. - */ - class StudentImpl - extends ExternalChildResourceImpl - implements TaskGroup.HasTaskGroup, Creatable { - private String teacherName; - private boolean isInvoked; - - protected StudentImpl(String name, SchoolImpl parent, Object inner) { - super(name, name, parent, inner); - } - - StudentImpl withAge(int age) { - return this; - } - - StudentImpl withTeacher(String teacherRefName) { - this.teacherName = teacherRefName; - TaskGroup.HasTaskGroup teacher = this.parent().inlineTeachers.findTeacher(teacherRefName); - if (teacher == null) { - throw new IllegalStateException("Expected teacher not found in the inline collection"); - } - this.addDependency(teacher); - return this; - } - - StudentImpl withTeacher(Creatable newTeacher) { - this.teacherName = newTeacher.name(); - this.addDependency(newTeacher); - return this; - } - - @Override - public String id() { - return name(); - } - - public boolean isInvoked() { - return this.isInvoked; - } - - @Override - public Mono createResourceAsync() { - Indexable teacher = this.taskGroup().taskResult(teacherName); - if (teacher == null) { - throw new IllegalStateException("Expected dependency teacher not found"); - } - TeacherImpl teacherImpl = (TeacherImpl) teacher; - if (teacherImpl == null) { - throw new IllegalStateException("Casting Indexable to teacherImpl failed"); - } - if (!teacherImpl.isInvoked()) { - throw new IllegalStateException("teacherImpl.isInvoked() should be true"); - } - - return Mono.just(this).map(student -> { - isInvoked = true; - return student; - }); - } - - @Override - public Mono updateResourceAsync() { - throw new UnsupportedOperationException(); - } - - @Override - public Mono deleteResourceAsync() { - throw new UnsupportedOperationException(); - } - - @Override - protected Mono getInnerAsync() { - throw new UnsupportedOperationException(); - } - - public SchoolImpl attach() { - return this.parent().withStudent(this); - } - } - - /** - * Type representing Student collection where a student entries can be created as part of parent School. - */ - class InlineStudentsImpl extends ExternalChildResourcesCachedImpl { - - protected InlineStudentsImpl(SchoolImpl parent, TaskGroup parentTaskGroup, String childResourceName) { - super(parent, parentTaskGroup, childResourceName); - } - - public StudentImpl define(String name) { - return super.prepareInlineDefine(name); - } - - StudentImpl findStudent(String studentName) { - return this.find(studentName); - } - - @Override - protected Flux listChildResourcesAsync() { - return Flux.empty(); - } - - @Override - protected List listChildResources() { - return new ArrayList<>(); - } - - @Override - protected StudentImpl newChildResource(String name) { - return new StudentImpl(name, this.getParent(), null); - } - - public void withStudent(StudentImpl student) { - this.addChildResource(student); - } - } - - /** - * Type representing Student collection where a student entries can be created independently. - */ - class IndependentStudentsImpl { - public StudentImpl define(String name) { - StudentImpl newStudent = new StudentImpl(name, null, null); - newStudent.setPendingOperation(ExternalChildResourceImpl.PendingOperation.ToBeCreated); - return newStudent; - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/core/TestResourceProviderRegistration.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/core/TestResourceProviderRegistration.java deleted file mode 100644 index 31b984000118..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/core/TestResourceProviderRegistration.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.core; - -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -public class TestResourceProviderRegistration { - @Test - public void testManuallyUnregisteredRp() { - String error = "{\"error\":{\"code\":\"MissingSubscriptionRegistration\",\"message\":\"The subscription is not registered to use namespace 'Microsoft.Devices'. See https://aka.ms/rps-not-found for how to register subscriptions.\"}}"; - Matcher matcher = Pattern.compile(".*'(.*)'").matcher(error); - matcher.find(); - Assertions.assertEquals("Microsoft.Devices", matcher.group(1)); - } - - @Test - public void testRpInNewSubscription() { - String error = "{\"error\":{\"code\":\"MissingSubscriptionRegistration\",\"message\":\"The subscription registration is in 'Unregistered' state. The subscription must be registered to use namespace 'Microsoft.Devices'. See https://aka.ms/rps-not-found for how to register subscriptions.\"}}"; - Matcher matcher = Pattern.compile(".*'(.*)'").matcher(error); - matcher.find(); - Assertions.assertEquals("Microsoft.Devices", matcher.group(1)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/BreadSliceImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/BreadSliceImpl.java deleted file mode 100644 index 4ce5407d2550..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/BreadSliceImpl.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.dag; - -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.Executable; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.ExecutableImpl; -import reactor.core.publisher.Mono; - -import java.time.Duration; - -/** - * Implementation for IBreadSlice. - */ -public class BreadSliceImpl extends ExecutableImpl implements IBreadSlice { - private final String name; - - public BreadSliceImpl(String name) { - super(name); - this.name = name; - } - - @Override - public Mono executeWorkAsync() { - System.out.println("Bread(" + this.name + ")::executeWorkAsync() [Getting slice from store]"); - return Mono.just(this) - .delayElement(Duration.ofMillis(250)) - .map(breadSlice -> breadSlice); - } - - @Override - public IBreadSlice withAnotherSliceFromStore(Executable breadFetcher) { - this.addDependency(breadFetcher); - return this; - } - - @Override - public IBreadSlice withNewOrder(Creatable order) { - this.addDependency(order); - return this; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/DAGErrorTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/DAGErrorTests.java deleted file mode 100644 index 6d8b11398cb9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/DAGErrorTests.java +++ /dev/null @@ -1,480 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.dag; - -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Set; -import java.util.TreeSet; - -public class DAGErrorTests { - @Test - public void testTerminateOnInProgressTaskCompletion() { - // Terminate on error strategy used in this task group is - // TaskGroupTerminateOnErrorStrategy::TERMINATE_ON_IN_PROGRESS_TASKS_COMPLETION - - // The task B start and asynchronously wait for 4000 ms then emit an error. - // The tasks Q and I start and asynchronous wait for 8000 ms and then report - // completion. The more delay in Q and I ensure that B emits error before Q and - // I finishes. - // - // In this setup, - // D and E cannot be executed since their dependency B is faulted. - // P, H, L and G cannot be executed since fault in B cause group cancellation - // - /** - * |--------->[M](0) - * | - * |==============>[J](1)----->[N](0) - * X | - * |------------------>[D](4)-->[B](3)--------------->[A](2)======================>[K](0) - * | ^ ^ - * | | | - * [F](6)---->[E](5)--------------| | - * | | | - * | |------->[G](4)-->[C](3)------------------ - * | | - * | |============================>[L](2)---------->[P](1)=====>[Q](0) - * | - * |------------------------------------------------------------------>[H](1)----->[I](0) - */ - PancakeImpl pancakeM = new PancakeImpl("M", 250); - PancakeImpl pancakeN = new PancakeImpl("N", 250); - PancakeImpl pancakeK = new PancakeImpl("K", 250); - PancakeImpl pancakeQ = new PancakeImpl("Q", 8000); - PancakeImpl pancakeI = new PancakeImpl("I", 8000); - - PancakeImpl pancakeJ = new PancakeImpl("J", 250); - pancakeJ.withInstantPancake(pancakeM); - pancakeJ.withInstantPancake(pancakeN); - PancakeImpl pancakeP = new PancakeImpl("P", 250); - pancakeP.withDelayedPancake(pancakeQ); - PancakeImpl pancakeH = new PancakeImpl("H", 250); - pancakeH.withInstantPancake(pancakeI); - - PancakeImpl pancakeA = new PancakeImpl("A", 250); - PancakeImpl pancakeL = new PancakeImpl("L", 250); - pancakeL.withInstantPancake(pancakeP); - - - PancakeImpl pancakeB = new PancakeImpl("B", 4000, true); // Task B wait for 4000 ms then emit error - pancakeB.withInstantPancake(pancakeA); - PancakeImpl pancakeC = new PancakeImpl("C", 250); - pancakeC.withInstantPancake(pancakeA); - - PancakeImpl pancakeD = new PancakeImpl("D", 250); - pancakeD.withInstantPancake(pancakeB); - PancakeImpl pancakeG = new PancakeImpl("G", 250); - pancakeG.withInstantPancake(pancakeC); - pancakeG.withDelayedPancake(pancakeL); - - PancakeImpl pancakeE = new PancakeImpl("E", 250); - pancakeE.withInstantPancake(pancakeB); - pancakeE.withInstantPancake(pancakeG); - - PancakeImpl pancakeF = new PancakeImpl("F", 250); - pancakeF.withInstantPancake(pancakeD); - pancakeF.withInstantPancake(pancakeE); - pancakeF.withInstantPancake(pancakeH); - - pancakeA.withDelayedPancake(pancakeJ); - pancakeA.withDelayedPancake(pancakeK); - - final Set expectedToSee = new HashSet<>(); - expectedToSee.add("M"); - expectedToSee.add("N"); - expectedToSee.add("K"); - expectedToSee.add("Q"); - expectedToSee.add("I"); - - expectedToSee.add("J"); - - expectedToSee.add("A"); - - expectedToSee.add("C"); - - final Set seen = new HashSet<>(); - final List exceptions = new ArrayList<>(); - - TaskGroup pancakeFtg = pancakeF.taskGroup(); - TaskGroup.InvocationContext context = pancakeFtg.newInvocationContext() - .withTerminateOnErrorStrategy(TaskGroupTerminateOnErrorStrategy.TERMINATE_ON_IN_PROGRESS_TASKS_COMPLETION); - IPancake rootPancake = pancakeFtg.invokeAsync(context).map(indexable -> { - IPancake pancake = (IPancake) indexable; - System.out.println("map.onNext: " + pancake.name()); - seen.add(pancake.name()); - return pancake; - }) - .onErrorResume(throwable -> { - System.out.println("map.onErrorResumeNext: " + throwable); - exceptions.add(throwable); - return Mono.empty(); - }).blockLast(); - - expectedToSee.removeAll(seen); - Assertions.assertTrue(expectedToSee.isEmpty()); - Assertions.assertEquals(exceptions.size(), 1); - Assertions.assertTrue(exceptions.get(0) instanceof RuntimeException); - RuntimeException runtimeException = (RuntimeException) exceptions.get(0); - Assertions.assertTrue(runtimeException.getMessage().equalsIgnoreCase("B")); - } - - @Test - public void testTerminateOnHittingLcaTask() { - // Terminate on error strategy used in this task group is - // TaskGroupTerminateOnErrorStrategy::TERMINATE_ON_HITTING_LCA_TASK - - // The task B start and asynchronously wait for 4000 ms then emit an error. - // The tasks Q and I start and asynchronous wait for 8000 ms and then report - // completion. The more delay in Q and I ensure that B emits error before Q and - // I finishes. - // - // In this setup, - // D and E cannot be executed since their dependency B is faulted. - // Q, I, P, H, L and G will be executed since they are not directly or indirectly depends on B - // - // Here the LCA task is E, because there is no way we can make a progress beyond that - // - - /** - * |--------->[M](0) - * | - * |==============>[J](1)----->[N](0) - * X | - * |------------------>[D](4)-->[B](3)--------------->[A](2)======================>[K](0) - * | ^ ^ - * | | | - * [F](6)---->[E](5)--------------| | - * | | | - * | |------->[G](4)-->[C](3)------------------ - * | | - * | |============================>[L](2)---------->[P](1)=====>[Q](0) - * | - * |------------------------------------------------------------------>[H](1)----->[I](0) - */ - PastaImpl pastaM = new PastaImpl("M", 250); - PastaImpl pastaN = new PastaImpl("N", 250); - PastaImpl pastaK = new PastaImpl("K", 250); - PastaImpl pastaQ = new PastaImpl("Q", 8000); - PastaImpl pastaI = new PastaImpl("I", 8000); - - PastaImpl pastaJ = new PastaImpl("J", 250); - pastaJ.withInstantPasta(pastaM); - pastaJ.withInstantPasta(pastaN); - PastaImpl pastaP = new PastaImpl("P", 250); - pastaP.withDelayedPasta(pastaQ); - PastaImpl pastaH = new PastaImpl("H", 250); - pastaH.withInstantPasta(pastaI); - - PastaImpl pastaA = new PastaImpl("A", 250); - PastaImpl pastaL = new PastaImpl("L", 250); - pastaL.withInstantPasta(pastaP); - - - PastaImpl pastaB = new PastaImpl("B", 4000, true); // Task B wait for 4000 ms then emit error - pastaB.withInstantPasta(pastaA); - PastaImpl pastaC = new PastaImpl("C", 250); - pastaC.withInstantPasta(pastaA); - - PastaImpl pastaD = new PastaImpl("D", 250); - pastaD.withInstantPasta(pastaB); - PastaImpl pastaG = new PastaImpl("G", 250); - pastaG.withInstantPasta(pastaC); - pastaG.withDelayedPasta(pastaL); - - PastaImpl pastaE = new PastaImpl("E", 250); - pastaE.withInstantPasta(pastaB); - pastaE.withInstantPasta(pastaG); - - PastaImpl pastaF = new PastaImpl("F", 250); - pastaF.withInstantPasta(pastaD); - pastaF.withInstantPasta(pastaE); - pastaF.withInstantPasta(pastaH); - - pastaA.withDelayedPasta(pastaJ); - pastaA.withDelayedPasta(pastaK); - - final Set expectedToSee = new HashSet<>(); - expectedToSee.add("M"); - expectedToSee.add("N"); - expectedToSee.add("K"); - expectedToSee.add("Q"); - expectedToSee.add("I"); - - expectedToSee.add("J"); - expectedToSee.add("P"); - expectedToSee.add("H"); - - expectedToSee.add("A"); - expectedToSee.add("L"); - - expectedToSee.add("C"); - - expectedToSee.add("G"); - - final Set seen = new HashSet<>(); - final List exceptions = new ArrayList<>(); - - TaskGroup pastaFtg = pastaF.taskGroup(); - TaskGroup.InvocationContext context = pastaFtg.newInvocationContext() - .withTerminateOnErrorStrategy(TaskGroupTerminateOnErrorStrategy.TERMINATE_ON_HITTING_LCA_TASK); - - IPasta rootPasta = pastaFtg.invokeAsync(context).map(indexable -> { - IPasta pasta = (IPasta) indexable; - System.out.println("map.onNext: " + pasta.name()); - seen.add(pasta.name()); - return pasta; - }) - .onErrorResume(throwable -> { - System.out.println("map.onErrorResumeNext: " + throwable); - exceptions.add(throwable); - return Mono.empty(); - }).blockLast(); - - expectedToSee.removeAll(seen); - Assertions.assertTrue(expectedToSee.isEmpty()); - Assertions.assertEquals(exceptions.size(), 1); - Assertions.assertTrue(exceptions.get(0) instanceof RuntimeException); - RuntimeException runtimeException = (RuntimeException) exceptions.get(0); - Assertions.assertTrue(runtimeException.getMessage().equalsIgnoreCase("B")); - } - - @Test - public void testCompositeError() { - // Terminate on error strategy used in this task group is - // TaskGroupTerminateOnErrorStrategy::TERMINATE_ON_IN_PROGRESS_TASKS_COMPLETION - - // Tasks marked X (B & G) will fault. B and G are not depends on each other. - // If B start at time 't0'th ms then G starts ~'t1 = (t0 + 250)'th ms. - // After B start, it asynchronously wait and emit an error at time '(t0 + 3500)' ms. - // In this setup, G gets ~3250 ms to start before B emits error. Eventually G also - // emit error. - // The final stream, emits result of all tasks that B and G directly or indirectly - // depends on and terminate with composite exception (that composes exception from - // B and G). - /** - * |--------->[M](0) - * | - * |==============>[J](1)----->[N](0) - * X | - * |------------------>[D](4)-->[B](3)--------------->[A](2)======================>[K](0) - * | ^ ^ - * | | | - * [F](6)---->[E](5)--------------| | - * | | X | - * | |------->[G](4)-->[C](3)------------------ - * | | - * | |============================>[L](2)---------->[P](1)=====>[Q](0) - * | - * |------------------------------------------------------------------>[H](1)----->[I](0) - */ - - PancakeImpl pancakeM = new PancakeImpl("M", 250); - PancakeImpl pancakeN = new PancakeImpl("N", 250); - PancakeImpl pancakeK = new PancakeImpl("K", 250); - PancakeImpl pancakeQ = new PancakeImpl("Q", 250); - PancakeImpl pancakeI = new PancakeImpl("I", 250); - - PancakeImpl pancakeJ = new PancakeImpl("J", 250); - pancakeJ.withInstantPancake(pancakeM); - pancakeJ.withInstantPancake(pancakeN); - PancakeImpl pancakeP = new PancakeImpl("P", 250); - pancakeP.withDelayedPancake(pancakeQ); - PancakeImpl pancakeH = new PancakeImpl("H", 250); - pancakeH.withInstantPancake(pancakeI); - - PancakeImpl pancakeA = new PancakeImpl("A", 250); - PancakeImpl pancakeL = new PancakeImpl("L", 250); - pancakeL.withInstantPancake(pancakeP); - - - PancakeImpl pancakeB = new PancakeImpl("B", 3500, true); // Task B wait for 3500 ms then emit error - pancakeB.withInstantPancake(pancakeA); - PancakeImpl pancakeC = new PancakeImpl("C", 250); - pancakeC.withInstantPancake(pancakeA); - - PancakeImpl pancakeD = new PancakeImpl("D", 250); - pancakeD.withInstantPancake(pancakeB); - PancakeImpl pancakeG = new PancakeImpl("G", 250, true); // Task G wait for 250 ms then emit error - pancakeG.withInstantPancake(pancakeC); - pancakeG.withDelayedPancake(pancakeL); - - PancakeImpl pancakeE = new PancakeImpl("E", 250); - pancakeE.withInstantPancake(pancakeB); - pancakeE.withInstantPancake(pancakeG); - - PancakeImpl pancakeF = new PancakeImpl("F", 250); - pancakeF.withInstantPancake(pancakeD); - pancakeF.withInstantPancake(pancakeE); - pancakeF.withInstantPancake(pancakeH); - - - pancakeA.withDelayedPancake(pancakeJ); - pancakeA.withDelayedPancake(pancakeK); - - final Set expectedToSee = new TreeSet<>(); - expectedToSee.add("M"); - expectedToSee.add("N"); - expectedToSee.add("K"); - expectedToSee.add("Q"); - expectedToSee.add("I"); - - expectedToSee.add("J"); - expectedToSee.add("P"); - expectedToSee.add("H"); - - expectedToSee.add("A"); - expectedToSee.add("L"); - - expectedToSee.add("C"); - - final Set seen = new TreeSet<>(); - final List exceptions = new ArrayList<>(); - - TaskGroup pancakeFtg = pancakeF.taskGroup(); - TaskGroup.InvocationContext context = pancakeFtg.newInvocationContext() - .withTerminateOnErrorStrategy(TaskGroupTerminateOnErrorStrategy.TERMINATE_ON_IN_PROGRESS_TASKS_COMPLETION); - - IPancake rootPancake = pancakeFtg.invokeAsync(context).map(indexable -> { - IPancake pancake = (IPancake) indexable; - String name = pancake.name(); - System.out.println("map.onNext:" + name); - seen.add(name); - return pancake; - }).onErrorResume(throwable -> { - System.out.println("map.onErrorResumeNext:" + throwable); - exceptions.add(throwable); - return Mono.empty(); - }).blockLast(); - - expectedToSee.removeAll(seen); - Assertions.assertTrue(expectedToSee.isEmpty()); - Assertions.assertEquals(exceptions.size(), 1); - Assertions.assertTrue(exceptions.get(0) instanceof RuntimeException); - RuntimeException compositeException = (RuntimeException) exceptions.get(0); - Assertions.assertEquals(compositeException.getSuppressed().length, 2); - for (Throwable throwable : compositeException.getSuppressed()) { - String message = throwable.getMessage(); - Assertions.assertTrue("B".equalsIgnoreCase(message) || "G".equalsIgnoreCase(message)); - } - } - - @Test - public void testErrorOnRoot() { - // Terminate on error strategy used in this task group is - // TaskGroupTerminateOnErrorStrategy::TERMINATE_ON_IN_PROGRESS_TASKS_COMPLETION - - // In this setup only the root task F fault. The final stream will emit result from - // all tasks expect F and terminate with exception from F. - // - /** - * |---------->[M](0) - * | - * |==============>[J](1)------>[N](0) - * | - * |------------------>[D](4)-->[B](3)--------------->[A](2)======================>[K](0) - * | ^ ^ - * | | | - * X[F](6)---->[E](5)--------------| | - * | | | - * | |------->[G](4)-->[C](3)------------------ - * | | - * | |============================>[L](2)--------->[P](1)======>[Q](0) - * | - * |----------------------------------------------------------------->[H](1)------>[I](0) - */ - - PancakeImpl pancakeM = new PancakeImpl("M", 250); - PancakeImpl pancakeN = new PancakeImpl("N", 250); - PancakeImpl pancakeK = new PancakeImpl("K", 250); - PancakeImpl pancakeQ = new PancakeImpl("Q", 250); - PancakeImpl pancakeI = new PancakeImpl("I", 250); - - PancakeImpl pancakeJ = new PancakeImpl("J", 250); - pancakeJ.withInstantPancake(pancakeM); - pancakeJ.withInstantPancake(pancakeN); - PancakeImpl pancakeP = new PancakeImpl("P", 250); - pancakeP.withDelayedPancake(pancakeQ); - PancakeImpl pancakeH = new PancakeImpl("H", 250); - pancakeH.withInstantPancake(pancakeI); - - PancakeImpl pancakeA = new PancakeImpl("A", 250); - PancakeImpl pancakeL = new PancakeImpl("L", 250); - pancakeL.withInstantPancake(pancakeP); - - - PancakeImpl pancakeB = new PancakeImpl("B", 250); - pancakeB.withInstantPancake(pancakeA); - PancakeImpl pancakeC = new PancakeImpl("C", 250); - pancakeC.withInstantPancake(pancakeA); - - PancakeImpl pancakeD = new PancakeImpl("D", 250); - pancakeD.withInstantPancake(pancakeB); - PancakeImpl pancakeG = new PancakeImpl("G", 250); - pancakeG.withInstantPancake(pancakeC); - pancakeG.withDelayedPancake(pancakeL); - - PancakeImpl pancakeE = new PancakeImpl("E", 250); - pancakeE.withInstantPancake(pancakeB); - pancakeE.withInstantPancake(pancakeG); - - PancakeImpl pancakeF = new PancakeImpl("F", 250, true); // Emit error on root - pancakeF.withInstantPancake(pancakeD); - pancakeF.withInstantPancake(pancakeE); - pancakeF.withInstantPancake(pancakeH); - - pancakeA.withDelayedPancake(pancakeJ); - pancakeA.withDelayedPancake(pancakeK); - - final Set expectedToSee = new HashSet<>(); - expectedToSee.add("M"); - expectedToSee.add("N"); - expectedToSee.add("K"); - expectedToSee.add("Q"); - expectedToSee.add("I"); - - expectedToSee.add("J"); - expectedToSee.add("P"); - expectedToSee.add("H"); - - expectedToSee.add("A"); - expectedToSee.add("L"); - - expectedToSee.add("B"); - expectedToSee.add("C"); - - expectedToSee.add("D"); - expectedToSee.add("G"); - - expectedToSee.add("E"); - final Set seen = new HashSet<>(); - final List exceptions = new ArrayList<>(); - - TaskGroup pancakeFtg = pancakeF.taskGroup(); - TaskGroup.InvocationContext context = pancakeFtg.newInvocationContext() - .withTerminateOnErrorStrategy(TaskGroupTerminateOnErrorStrategy.TERMINATE_ON_IN_PROGRESS_TASKS_COMPLETION); - IPancake rootPancake = pancakeFtg.invokeAsync(context).map(indexable -> { - IPancake pancake = (IPancake) indexable; - seen.add(pancake.name()); - System.out.println("map.onNext:" + pancake.name()); - return pancake; - }).onErrorResume(throwable -> { - System.out.println("map.onErrorResumeNext:" + throwable); - exceptions.add(throwable); - return Mono.empty(); - }).blockLast(); - - expectedToSee.removeAll(seen); - Assertions.assertTrue(expectedToSee.isEmpty()); - Assertions.assertEquals(exceptions.size(), 1); - Assertions.assertTrue(exceptions.get(0) instanceof RuntimeException); - RuntimeException runtimeException = (RuntimeException) exceptions.get(0); - Assertions.assertTrue(runtimeException.getMessage().equalsIgnoreCase("F")); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/DAGFinalizeTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/DAGFinalizeTests.java deleted file mode 100644 index df5f7ee20c01..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/DAGFinalizeTests.java +++ /dev/null @@ -1,548 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.dag; - -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -/** - * The tests for prepare stage of the graph (i.e. adding sub-graph in prepare stage). - */ -public class DAGFinalizeTests { - @Test - public void testWithoutFinalize() { - /** - * |------------------>[D](2)----------->[B](1)-------------->[A](0) - * | ^ ^ - * | | | - * [F](4)---->[E](3)-------------------------| | - * | | | - * | |------->[G](2)----------->[C](1)------------------ - * | - * |------------------------------------>[H](1)-------------->[I](0) - */ - - // Define pizzas with instant pizzas - // - // Level 0 pizzas - PizzaImpl pizzaA = new PizzaImpl("A"); - PizzaImpl pizzaI = new PizzaImpl("I"); - // Level 1 pizzas - PizzaImpl pizzaB = new PizzaImpl("B"); - pizzaB.withInstantPizza(pizzaA); - PizzaImpl pizzaC = new PizzaImpl("C"); - pizzaC.withInstantPizza(pizzaA); - PizzaImpl pizzaH = new PizzaImpl("H"); - pizzaH.withInstantPizza(pizzaI); - // Level 2 pizzas - PizzaImpl pizzaD = new PizzaImpl("D"); - pizzaD.withInstantPizza(pizzaB); - PizzaImpl pizzaG = new PizzaImpl("G"); - pizzaG.withInstantPizza(pizzaC); - // Level 3 pizzas - PizzaImpl pizzaE = new PizzaImpl("E"); - pizzaE.withInstantPizza(pizzaB); - pizzaE.withInstantPizza(pizzaG); - // Level 4 pizzas - PizzaImpl pizzaF = new PizzaImpl("F"); - pizzaF.withInstantPizza(pizzaD); - pizzaF.withInstantPizza(pizzaE); - pizzaF.withInstantPizza(pizzaH); - - // Run create to set up the underlying graph nodes with dependent details - IPizza rootPizza = pizzaF.create(); - Assertions.assertNotNull(rootPizza); - - // Check dependencies and dependents - // - // ---------------------------------------------------------------------------------- - // LEVEL - 0 - // ---------------------------------------------------------------------------------- - // - // Level 0 - "A" - Assertions.assertEquals(pizzaA.taskGroup().getNodes().size(), 1); - TaskGroupEntry nodeA = pizzaA.taskGroup().getNode(pizzaA.key()); - Assertions.assertNotNull(nodeA); - Assertions.assertEquals(nodeA.dependencyKeys().size(), 0); - Assertions.assertEquals(nodeA.dependentKeys().size(), 2); - for (String dependentKey : nodeA.dependentKeys()) { - Assertions.assertTrue(dependentKey.equalsIgnoreCase(pizzaB.key()) - || dependentKey.equalsIgnoreCase(pizzaC.key())); - } - // Level 0 - "I" - Assertions.assertEquals(pizzaI.taskGroup().getNodes().size(), 1); - TaskGroupEntry nodeI = pizzaI.taskGroup().getNode(pizzaI.key()); - Assertions.assertNotNull(nodeI); - Assertions.assertEquals(nodeI.dependencyKeys().size(), 0); - Assertions.assertEquals(nodeI.dependentKeys().size(), 1); - for (String dependentKey : nodeI.dependentKeys()) { - Assertions.assertTrue(dependentKey.equalsIgnoreCase(pizzaH.key())); - } - - // ---------------------------------------------------------------------------------- - // LEVEL - 1 - // ---------------------------------------------------------------------------------- - // - // Level 1 - "B" - Assertions.assertEquals(pizzaB.taskGroup().getNodes().size(), 2); - Assertions.assertNotNull(pizzaB.taskGroup().getNode(pizzaA.key())); - TaskGroupEntry nodeB = pizzaB.taskGroup().getNode(pizzaB.key()); - Assertions.assertNotNull(nodeB); - Assertions.assertEquals(nodeB.dependencyKeys().size(), 1); - for (String dependentKey : nodeB.dependencyKeys()) { - Assertions.assertTrue(dependentKey.equalsIgnoreCase(pizzaA.key())); - } - Assertions.assertEquals(nodeB.dependentKeys().size(), 2); - for (String dependentKey : nodeB.dependentKeys()) { - Assertions.assertTrue(dependentKey.equalsIgnoreCase(pizzaD.key()) - || dependentKey.equalsIgnoreCase(pizzaE.key())); - } - // Level 1 - "C" - Assertions.assertEquals(pizzaC.taskGroup().getNodes().size(), 2); - Assertions.assertNotNull(pizzaC.taskGroup().getNode(pizzaA.key())); - TaskGroupEntry nodeC = pizzaC.taskGroup().getNode(pizzaC.key()); - Assertions.assertNotNull(nodeC); - Assertions.assertEquals(nodeC.dependencyKeys().size(), 1); - for (String dependentKey : nodeC.dependencyKeys()) { - Assertions.assertTrue(dependentKey.equalsIgnoreCase(pizzaA.key())); - } - Assertions.assertEquals(nodeC.dependentKeys().size(), 1); - for (String dependentKey : nodeC.dependentKeys()) { - Assertions.assertTrue(dependentKey.equalsIgnoreCase(pizzaG.key())); - } - // Level 1 - "H" - Assertions.assertEquals(pizzaH.taskGroup().getNodes().size(), 2); - Assertions.assertNotNull(pizzaH.taskGroup().getNode(pizzaI.key())); - TaskGroupEntry nodeH = pizzaH.taskGroup().getNode(pizzaH.key()); - Assertions.assertNotNull(nodeH); - Assertions.assertEquals(nodeH.dependencyKeys().size(), 1); - for (String dependentKey : nodeH.dependencyKeys()) { - Assertions.assertTrue(dependentKey.equalsIgnoreCase(pizzaI.key())); - } - Assertions.assertEquals(nodeH.dependentKeys().size(), 1); - for (String dependentKey : nodeH.dependentKeys()) { - Assertions.assertTrue(dependentKey.equalsIgnoreCase(pizzaF.key())); - } - - // ---------------------------------------------------------------------------------- - // LEVEL - 2 - // ---------------------------------------------------------------------------------- - // - // Level 2 - "D" - Assertions.assertEquals(pizzaD.taskGroup().getNodes().size(), 3); - Assertions.assertNotNull(pizzaD.taskGroup().getNode(pizzaA.key())); - Assertions.assertNotNull(pizzaD.taskGroup().getNode(pizzaB.key())); - TaskGroupEntry nodeD = pizzaD.taskGroup().getNode(pizzaD.key()); - Assertions.assertNotNull(nodeD); - Assertions.assertEquals(nodeD.dependencyKeys().size(), 1); - for (String dependentKey : nodeD.dependencyKeys()) { - Assertions.assertTrue(dependentKey.equalsIgnoreCase(pizzaB.key())); - } - Assertions.assertEquals(nodeD.dependentKeys().size(), 1); - for (String dependentKey : nodeD.dependentKeys()) { - Assertions.assertTrue(dependentKey.equalsIgnoreCase(pizzaF.key())); - } - // Level 2 - "G" - Assertions.assertEquals(pizzaG.taskGroup().getNodes().size(), 3); - Assertions.assertNotNull(pizzaG.taskGroup().getNode(pizzaA.key())); - Assertions.assertNotNull(pizzaG.taskGroup().getNode(pizzaC.key())); - TaskGroupEntry nodeG = pizzaG.taskGroup().getNode(pizzaG.key()); - Assertions.assertNotNull(nodeG); - Assertions.assertEquals(nodeG.dependencyKeys().size(), 1); - for (String dependentKey : nodeG.dependencyKeys()) { - Assertions.assertTrue(dependentKey.equalsIgnoreCase(pizzaC.key())); - } - Assertions.assertEquals(nodeG.dependentKeys().size(), 1); - for (String dependentKey : nodeG.dependentKeys()) { - Assertions.assertTrue(dependentKey.equalsIgnoreCase(pizzaE.key())); - } - - // ---------------------------------------------------------------------------------- - // LEVEL - 3 - // ---------------------------------------------------------------------------------- - // - // Level 3 - "E" - Assertions.assertEquals(pizzaE.taskGroup().getNodes().size(), 5); - Assertions.assertNotNull(pizzaE.taskGroup().getNode(pizzaA.key())); - Assertions.assertNotNull(pizzaE.taskGroup().getNode(pizzaB.key())); - Assertions.assertNotNull(pizzaE.taskGroup().getNode(pizzaC.key())); - Assertions.assertNotNull(pizzaE.taskGroup().getNode(pizzaG.key())); - TaskGroupEntry nodeE = pizzaE.taskGroup().getNode(pizzaE.key()); - Assertions.assertNotNull(nodeE); - Assertions.assertEquals(nodeE.dependencyKeys().size(), 2); - for (String dependentKey : nodeE.dependencyKeys()) { - Assertions.assertTrue(dependentKey.equalsIgnoreCase(pizzaB.key()) - || dependentKey.equalsIgnoreCase(pizzaG.key())); - } - Assertions.assertEquals(nodeE.dependentKeys().size(), 1); - for (String dependentKey : nodeE.dependentKeys()) { - Assertions.assertTrue(dependentKey.equalsIgnoreCase(pizzaF.key())); - } - - // ---------------------------------------------------------------------------------- - // LEVEL - 4 - // ---------------------------------------------------------------------------------- - // - // Level 4 - "F" - Assertions.assertEquals(pizzaF.taskGroup().getNodes().size(), 9); - Assertions.assertNotNull(pizzaF.taskGroup().getNode(pizzaA.key())); - Assertions.assertNotNull(pizzaF.taskGroup().getNode(pizzaB.key())); - Assertions.assertNotNull(pizzaF.taskGroup().getNode(pizzaC.key())); - Assertions.assertNotNull(pizzaF.taskGroup().getNode(pizzaG.key())); - Assertions.assertNotNull(pizzaF.taskGroup().getNode(pizzaI.key())); - Assertions.assertNotNull(pizzaF.taskGroup().getNode(pizzaH.key())); - Assertions.assertNotNull(pizzaF.taskGroup().getNode(pizzaE.key())); - Assertions.assertNotNull(pizzaF.taskGroup().getNode(pizzaD.key())); - TaskGroupEntry nodeF = pizzaF.taskGroup().getNode(pizzaF.key()); - Assertions.assertNotNull(nodeF); - Assertions.assertEquals(nodeF.dependencyKeys().size(), 3); - for (String dependentKey : nodeF.dependencyKeys()) { - Assertions.assertTrue(dependentKey.equalsIgnoreCase(pizzaD.key()) - || dependentKey.equalsIgnoreCase(pizzaE.key()) - || dependentKey.equalsIgnoreCase(pizzaH.key())); - } - Assertions.assertEquals(nodeF.dependentKeys().size(), 0); - } - - @Test - public void testFinalize() { - // Initial dependency graph - // - /** - * |------------------>[D](2)----------->[B](1)------------->[A](0) - * | ^ ^ - * | | | - * [F](4)---->[E](3)-------------------------| | - * | | | - * | |------->[G](2)----------->[C](1)------------------ - * | - * |------------------------------------>[H](1)-------------->[I](0) - */ - - // Level 0 pizzas - PizzaImpl pizzaA = new PizzaImpl("A"); - PizzaImpl pizzaI = new PizzaImpl("I"); - // Level 1 pizzas - PizzaImpl pizzaB = new PizzaImpl("B"); - pizzaB.withInstantPizza(pizzaA); - PizzaImpl pizzaC = new PizzaImpl("C"); - pizzaC.withInstantPizza(pizzaA); - PizzaImpl pizzaH = new PizzaImpl("H"); - pizzaH.withInstantPizza(pizzaI); - // Level 2 pizzas - PizzaImpl pizzaD = new PizzaImpl("D"); - pizzaD.withInstantPizza(pizzaB); - PizzaImpl pizzaG = new PizzaImpl("G"); - pizzaG.withInstantPizza(pizzaC); - // Level 3 pizzas - PizzaImpl pizzaE = new PizzaImpl("E"); - pizzaE.withInstantPizza(pizzaB); - pizzaE.withInstantPizza(pizzaG); - // Level 4 pizzas - PizzaImpl pizzaF = new PizzaImpl("F"); - pizzaF.withInstantPizza(pizzaD); - pizzaF.withInstantPizza(pizzaE); - pizzaF.withInstantPizza(pizzaH); - - // Update the above setup by adding delayed pizzas in finalize (prepare). - // Define 3 (J, K, L) delayed pizzas (edges with '==' symbol), two of them (J, L) - // with instant pizzas. - // - The delayed pizza J has an instance pizza N - // - The delayed pizza L has an instance pizza P - // - The instance pizza P has a delayed pizza Q - /** - * |------------>[M](0) - * | - * |=========>[J](1)------>[N](0) - * | - * |------------------>[D](4)-->[B](3)----->[A](2)==================>[K](0) - * | ^ ^ - * | | | - * [F](6)---->[E](5)--------------| | - * | | | - * | |------->[G](4)-->[C](3)-------- - * | | - * | |==================>[L](2)----->[P](1)======>[Q](0) - * | - * |--------------------------------------------------->[H](1)------>[I](0) - */ - - PizzaImpl pizzaJ = new PizzaImpl("J"); - PizzaImpl pizzaM = new PizzaImpl("M"); - PizzaImpl pizzaN = new PizzaImpl("N"); - pizzaJ.withInstantPizza(pizzaM); - pizzaJ.withInstantPizza(pizzaN); - PizzaImpl pizzaK = new PizzaImpl("K"); - pizzaA.withDelayedPizza(pizzaJ); - pizzaA.withDelayedPizza(pizzaK); - PizzaImpl pizzaL = new PizzaImpl("L"); - PizzaImpl pizzaP = new PizzaImpl("P"); - PizzaImpl pizzaQ = new PizzaImpl("Q"); - pizzaP.withDelayedPizza(pizzaQ); - pizzaL.withInstantPizza(pizzaP); - pizzaG.withDelayedPizza(pizzaL); - - // Run create to set up the underlying graph nodes with dependent details - IPizza rootPizza = pizzaF.create(); - Assertions.assertNotNull(rootPizza); - // Check dependencies and dependents - // - // ---------------------------------------------------------------------------------- - // LEVEL - 0 - // ---------------------------------------------------------------------------------- - // - // Level 0 - "M" - Assertions.assertEquals(pizzaM.taskGroup().getNodes().size(), 1); - TaskGroupEntry nodeM = pizzaM.taskGroup().getNode(pizzaM.key()); - Assertions.assertNotNull(nodeM); - Assertions.assertEquals(nodeM.dependencyKeys().size(), 0); - Assertions.assertEquals(nodeM.dependentKeys().size(), 1); - for (String dependentKey : nodeM.dependentKeys()) { - Assertions.assertTrue(dependentKey.equalsIgnoreCase(pizzaJ.key())); - } - // Level 0 - "N" - Assertions.assertEquals(pizzaN.taskGroup().getNodes().size(), 1); - TaskGroupEntry nodeN = pizzaN.taskGroup().getNode(pizzaN.key()); - Assertions.assertNotNull(nodeN); - Assertions.assertEquals(nodeN.dependencyKeys().size(), 0); - Assertions.assertEquals(nodeN.dependentKeys().size(), 1); - for (String dependentKey : nodeN.dependentKeys()) { - Assertions.assertTrue(dependentKey.equalsIgnoreCase(pizzaJ.key())); - } - // Level 0 - "K" - Assertions.assertEquals(pizzaK.taskGroup().getNodes().size(), 1); - TaskGroupEntry nodeK = pizzaK.taskGroup().getNode(pizzaK.key()); - Assertions.assertNotNull(nodeK); - Assertions.assertEquals(nodeK.dependencyKeys().size(), 0); - Assertions.assertEquals(nodeK.dependentKeys().size(), 1); - for (String dependentKey : nodeK.dependentKeys()) { - Assertions.assertTrue(dependentKey.equalsIgnoreCase(pizzaA.key())); - } - // Level 0 - "I" - Assertions.assertEquals(pizzaI.taskGroup().getNodes().size(), 1); - TaskGroupEntry nodeI = pizzaI.taskGroup().getNode(pizzaI.key()); - Assertions.assertNotNull(nodeI); - Assertions.assertEquals(nodeI.dependencyKeys().size(), 0); - Assertions.assertEquals(nodeI.dependentKeys().size(), 1); - for (String dependentKey : nodeI.dependentKeys()) { - Assertions.assertTrue(dependentKey.equalsIgnoreCase(pizzaH.key())); - } - // Level 0 - "Q" - Assertions.assertEquals(pizzaQ.taskGroup().getNodes().size(), 1); - TaskGroupEntry nodeQ = pizzaQ.taskGroup().getNode(pizzaQ.key()); - Assertions.assertNotNull(nodeQ); - Assertions.assertEquals(nodeQ.dependencyKeys().size(), 0); - Assertions.assertEquals(nodeQ.dependentKeys().size(), 1); - for (String dependentKey : nodeQ.dependentKeys()) { - Assertions.assertTrue(dependentKey.equalsIgnoreCase(pizzaP.key())); - } - // - // ---------------------------------------------------------------------------------- - // LEVEL - 1 - // ---------------------------------------------------------------------------------- - // - // Level 1 - "H" - Assertions.assertEquals(pizzaH.taskGroup().getNodes().size(), 2); - Assertions.assertNotNull(pizzaH.taskGroup().getNode(pizzaI.key())); - TaskGroupEntry nodeH = pizzaH.taskGroup().getNode(pizzaH.key()); - Assertions.assertNotNull(nodeH); - Assertions.assertEquals(nodeH.dependencyKeys().size(), 1); - for (String dependentKey : nodeH.dependencyKeys()) { - Assertions.assertTrue(dependentKey.equalsIgnoreCase(pizzaI.key())); - } - Assertions.assertEquals(nodeH.dependentKeys().size(), 1); - for (String dependentKey : nodeH.dependentKeys()) { - Assertions.assertTrue(dependentKey.equalsIgnoreCase(pizzaF.key())); - } - // Level 1 - "J" - Assertions.assertEquals(pizzaJ.taskGroup().getNodes().size(), 3); - Assertions.assertNotNull(pizzaJ.taskGroup().getNode(pizzaM.key())); - Assertions.assertNotNull(pizzaJ.taskGroup().getNode(pizzaN.key())); - TaskGroupEntry nodeJ = pizzaJ.taskGroup().getNode(pizzaJ.key()); - Assertions.assertNotNull(nodeJ); - Assertions.assertEquals(nodeJ.dependencyKeys().size(), 2); - for (String dependentKey : nodeJ.dependencyKeys()) { - Assertions.assertTrue(dependentKey.equalsIgnoreCase(pizzaM.key()) - || dependentKey.equalsIgnoreCase(pizzaN.key())); - } - Assertions.assertEquals(nodeJ.dependentKeys().size(), 1); - for (String dependentKey : nodeJ.dependentKeys()) { - Assertions.assertTrue(dependentKey.equalsIgnoreCase(pizzaA.key())); - } - // Level 1 - "P" - Assertions.assertEquals(pizzaP.taskGroup().getNodes().size(), 2); - Assertions.assertNotNull(pizzaP.taskGroup().getNode(pizzaQ.key())); - TaskGroupEntry nodeP = pizzaP.taskGroup().getNode(pizzaP.key()); - Assertions.assertNotNull(nodeP); - Assertions.assertEquals(nodeP.dependencyKeys().size(), 1); - for (String dependentKey : nodeP.dependencyKeys()) { - Assertions.assertTrue(dependentKey.equalsIgnoreCase(pizzaQ.key())); - } - Assertions.assertEquals(nodeP.dependentKeys().size(), 1); - for (String dependentKey : nodeP.dependentKeys()) { - Assertions.assertTrue(dependentKey.equalsIgnoreCase(pizzaL.key())); - } - // ---------------------------------------------------------------------------------- - // LEVEL - 2 - // ---------------------------------------------------------------------------------- - // - // Level 1 - "L" - Assertions.assertEquals(pizzaL.taskGroup().getNodes().size(), 3); - Assertions.assertNotNull(pizzaL.taskGroup().getNode(pizzaQ.key())); - Assertions.assertNotNull(pizzaL.taskGroup().getNode(pizzaP.key())); - TaskGroupEntry nodeL = pizzaL.taskGroup().getNode(pizzaL.key()); - Assertions.assertNotNull(nodeL); - Assertions.assertEquals(nodeL.dependencyKeys().size(), 1); - for (String dependentKey : nodeL.dependencyKeys()) { - Assertions.assertTrue(dependentKey.equalsIgnoreCase(pizzaP.key())); - } - Assertions.assertEquals(nodeL.dependentKeys().size(), 1); - for (String dependentKey : nodeL.dependentKeys()) { - Assertions.assertTrue(dependentKey.equalsIgnoreCase(pizzaG.key())); - } - // Level 2 - "A" - Assertions.assertEquals(pizzaA.taskGroup().getNodes().size(), 5); - Assertions.assertNotNull(pizzaA.taskGroup().getNode(pizzaM.key())); - Assertions.assertNotNull(pizzaA.taskGroup().getNode(pizzaN.key())); - Assertions.assertNotNull(pizzaA.taskGroup().getNode(pizzaJ.key())); - Assertions.assertNotNull(pizzaA.taskGroup().getNode(pizzaK.key())); - TaskGroupEntry nodeA = pizzaA.taskGroup().getNode(pizzaA.key()); - Assertions.assertNotNull(nodeA); - Assertions.assertEquals(nodeA.dependencyKeys().size(), 2); - for (String dependentKey : nodeA.dependencyKeys()) { - Assertions.assertTrue(dependentKey.equalsIgnoreCase(pizzaJ.key()) - || dependentKey.equalsIgnoreCase(pizzaK.key())); - } - Assertions.assertEquals(nodeA.dependentKeys().size(), 2); - for (String dependentKey : nodeA.dependentKeys()) { - Assertions.assertTrue(dependentKey.equalsIgnoreCase(pizzaB.key()) - || dependentKey.equalsIgnoreCase(pizzaC.key())); - } - // ---------------------------------------------------------------------------------- - // LEVEL - 3 - // ---------------------------------------------------------------------------------- - // - // Level 3 - "B" - Assertions.assertEquals(pizzaB.taskGroup().getNodes().size(), 6); - Assertions.assertNotNull(pizzaB.taskGroup().getNode(pizzaM.key())); - Assertions.assertNotNull(pizzaB.taskGroup().getNode(pizzaN.key())); - Assertions.assertNotNull(pizzaB.taskGroup().getNode(pizzaA.key())); - Assertions.assertNotNull(pizzaB.taskGroup().getNode(pizzaK.key())); - Assertions.assertNotNull(pizzaB.taskGroup().getNode(pizzaJ.key())); - TaskGroupEntry nodeB = pizzaB.taskGroup().getNode(pizzaB.key()); - Assertions.assertNotNull(nodeB); - Assertions.assertEquals(nodeB.dependencyKeys().size(), 1); - for (String dependentKey : nodeB.dependencyKeys()) { - Assertions.assertTrue(dependentKey.equalsIgnoreCase(pizzaA.key())); - } - Assertions.assertEquals(nodeB.dependentKeys().size(), 2); - for (String dependentKey : nodeB.dependentKeys()) { - Assertions.assertTrue(dependentKey.equalsIgnoreCase(pizzaD.key()) - || dependentKey.equalsIgnoreCase(pizzaE.key())); - } - // ---------------------------------------------------------------------------------- - // LEVEL - 4 - // ---------------------------------------------------------------------------------- - // - // Level 4 - "D" - Assertions.assertEquals(pizzaD.taskGroup().getNodes().size(), 7); - Assertions.assertNotNull(pizzaD.taskGroup().getNode(pizzaA.key())); - Assertions.assertNotNull(pizzaD.taskGroup().getNode(pizzaB.key())); - Assertions.assertNotNull(pizzaD.taskGroup().getNode(pizzaJ.key())); - Assertions.assertNotNull(pizzaD.taskGroup().getNode(pizzaM.key())); - Assertions.assertNotNull(pizzaD.taskGroup().getNode(pizzaN.key())); - Assertions.assertNotNull(pizzaD.taskGroup().getNode(pizzaK.key())); - TaskGroupEntry nodeD = pizzaD.taskGroup().getNode(pizzaD.key()); - Assertions.assertNotNull(nodeD); - Assertions.assertEquals(nodeD.dependencyKeys().size(), 1); - for (String dependentKey : nodeD.dependencyKeys()) { - Assertions.assertTrue(dependentKey.equalsIgnoreCase(pizzaB.key())); - } - Assertions.assertEquals(nodeD.dependentKeys().size(), 1); - for (String dependentKey : nodeD.dependentKeys()) { - Assertions.assertTrue(dependentKey.equalsIgnoreCase(pizzaF.key())); - } - - // Level 4 - "G" - Assertions.assertEquals(pizzaG.taskGroup().getNodes().size(), 10); - Assertions.assertNotNull(pizzaG.taskGroup().getNode(pizzaC.key())); - Assertions.assertNotNull(pizzaG.taskGroup().getNode(pizzaQ.key())); - Assertions.assertNotNull(pizzaG.taskGroup().getNode(pizzaL.key())); - Assertions.assertNotNull(pizzaG.taskGroup().getNode(pizzaP.key())); - Assertions.assertNotNull(pizzaG.taskGroup().getNode(pizzaA.key())); - Assertions.assertNotNull(pizzaG.taskGroup().getNode(pizzaJ.key())); - Assertions.assertNotNull(pizzaG.taskGroup().getNode(pizzaM.key())); - Assertions.assertNotNull(pizzaG.taskGroup().getNode(pizzaN.key())); - Assertions.assertNotNull(pizzaG.taskGroup().getNode(pizzaK.key())); - TaskGroupEntry nodeG = pizzaG.taskGroup().getNode(pizzaG.key()); - Assertions.assertNotNull(nodeG); - Assertions.assertEquals(nodeG.dependencyKeys().size(), 2); - for (String dependentKey : nodeG.dependencyKeys()) { - Assertions.assertTrue(dependentKey.equalsIgnoreCase(pizzaC.key()) - || dependentKey.equalsIgnoreCase(pizzaL.key())); - } - Assertions.assertEquals(nodeG.dependentKeys().size(), 1); - for (String dependentKey : nodeG.dependentKeys()) { - Assertions.assertTrue(dependentKey.equalsIgnoreCase(pizzaE.key())); - } - // ---------------------------------------------------------------------------------- - // LEVEL - 5 - // ---------------------------------------------------------------------------------- - // - // Level 5 - "E" - Assertions.assertEquals(pizzaE.taskGroup().getNodes().size(), 12); - Assertions.assertNotNull(pizzaE.taskGroup().getNode(pizzaG.key())); - Assertions.assertNotNull(pizzaE.taskGroup().getNode(pizzaQ.key())); - Assertions.assertNotNull(pizzaE.taskGroup().getNode(pizzaB.key())); - Assertions.assertNotNull(pizzaE.taskGroup().getNode(pizzaC.key())); - Assertions.assertNotNull(pizzaE.taskGroup().getNode(pizzaA.key())); - Assertions.assertNotNull(pizzaE.taskGroup().getNode(pizzaJ.key())); - Assertions.assertNotNull(pizzaE.taskGroup().getNode(pizzaL.key())); - Assertions.assertNotNull(pizzaE.taskGroup().getNode(pizzaM.key())); - Assertions.assertNotNull(pizzaE.taskGroup().getNode(pizzaN.key())); - Assertions.assertNotNull(pizzaE.taskGroup().getNode(pizzaK.key())); - Assertions.assertNotNull(pizzaE.taskGroup().getNode(pizzaP.key())); - TaskGroupEntry nodeE = pizzaE.taskGroup().getNode(pizzaE.key()); - Assertions.assertNotNull(nodeE); - Assertions.assertEquals(nodeE.dependencyKeys().size(), 2); - for (String dependentKey : nodeE.dependencyKeys()) { - Assertions.assertTrue(dependentKey.equalsIgnoreCase(pizzaB.key()) - || dependentKey.equalsIgnoreCase(pizzaG.key())); - } - Assertions.assertEquals(nodeE.dependentKeys().size(), 1); - for (String dependentKey : nodeE.dependentKeys()) { - Assertions.assertTrue(dependentKey.equalsIgnoreCase(pizzaF.key())); - } - // ---------------------------------------------------------------------------------- - // LEVEL - 6 - // ---------------------------------------------------------------------------------- - // - // Level 6 - "F" - Assertions.assertEquals(pizzaF.taskGroup().getNodes().size(), 16); - Assertions.assertNotNull(pizzaF.taskGroup().getNode(pizzaA.key())); - Assertions.assertNotNull(pizzaF.taskGroup().getNode(pizzaB.key())); - Assertions.assertNotNull(pizzaF.taskGroup().getNode(pizzaC.key())); - Assertions.assertNotNull(pizzaF.taskGroup().getNode(pizzaD.key())); - Assertions.assertNotNull(pizzaF.taskGroup().getNode(pizzaE.key())); - Assertions.assertNotNull(pizzaF.taskGroup().getNode(pizzaG.key())); - Assertions.assertNotNull(pizzaF.taskGroup().getNode(pizzaH.key())); - Assertions.assertNotNull(pizzaF.taskGroup().getNode(pizzaI.key())); - Assertions.assertNotNull(pizzaF.taskGroup().getNode(pizzaJ.key())); - Assertions.assertNotNull(pizzaF.taskGroup().getNode(pizzaK.key())); - Assertions.assertNotNull(pizzaF.taskGroup().getNode(pizzaL.key())); - Assertions.assertNotNull(pizzaF.taskGroup().getNode(pizzaM.key())); - Assertions.assertNotNull(pizzaF.taskGroup().getNode(pizzaN.key())); - Assertions.assertNotNull(pizzaF.taskGroup().getNode(pizzaP.key())); - Assertions.assertNotNull(pizzaF.taskGroup().getNode(pizzaQ.key())); - TaskGroupEntry nodeF = pizzaF.taskGroup().getNode(pizzaF.key()); - Assertions.assertNotNull(nodeF); - Assertions.assertEquals(nodeF.dependencyKeys().size(), 3); - for (String dependentKey : nodeF.dependencyKeys()) { - Assertions.assertTrue(dependentKey.equalsIgnoreCase(pizzaD.key()) - || dependentKey.equalsIgnoreCase(pizzaE.key()) - || dependentKey.equalsIgnoreCase(pizzaH.key())); - } - Assertions.assertEquals(nodeF.dependentKeys().size(), 0); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/DAGraphTest.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/DAGraphTest.java deleted file mode 100644 index fb7e10915e02..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/DAGraphTest.java +++ /dev/null @@ -1,148 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.dag; - -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -import java.util.ArrayList; -import java.util.List; - -public class DAGraphTest { - @Test - public void testDAGraphGetNext() { - /** - * |-------->[D]------>[B]-----------[A] - * | ^ ^ - * | | | - * [F]------->[E]-------| | - * | | | - * | |------->[G]----->[C]---- - * | - * |-------->[H]-------------------->[I] - */ - List expectedOrder = new ArrayList<>(); - expectedOrder.add("A"); expectedOrder.add("I"); - expectedOrder.add("B"); expectedOrder.add("C"); expectedOrder.add("H"); - expectedOrder.add("D"); expectedOrder.add("G"); - expectedOrder.add("E"); - expectedOrder.add("F"); - - ItemHolder nodeA = new ItemHolder("A", "dataA"); - ItemHolder nodeI = new ItemHolder("I", "dataI"); - - ItemHolder nodeB = new ItemHolder("B", "dataB"); - nodeB.addDependency(nodeA.key()); - - ItemHolder nodeC = new ItemHolder("C", "dataC"); - nodeC.addDependency(nodeA.key()); - - ItemHolder nodeH = new ItemHolder("H", "dataH"); - nodeH.addDependency(nodeI.key()); - - ItemHolder nodeG = new ItemHolder("G", "dataG"); - nodeG.addDependency(nodeC.key()); - - ItemHolder nodeE = new ItemHolder("E", "dataE"); - nodeE.addDependency(nodeB.key()); - nodeE.addDependency(nodeG.key()); - - ItemHolder nodeD = new ItemHolder("D", "dataD"); - nodeD.addDependency(nodeB.key()); - - - ItemHolder nodeF = new ItemHolder("F", "dataF"); - nodeF.addDependency(nodeD.key()); - nodeF.addDependency(nodeE.key()); - nodeF.addDependency(nodeH.key()); - - DAGraph dag = new DAGraph<>(nodeF); - dag.addNode(nodeA); - dag.addNode(nodeB); - dag.addNode(nodeC); - dag.addNode(nodeD); - dag.addNode(nodeE); - dag.addNode(nodeG); - dag.addNode(nodeH); - dag.addNode(nodeI); - - dag.prepareForEnumeration(); - ItemHolder nextNode = dag.getNext(); - int i = 0; - while (nextNode != null) { - Assertions.assertEquals(nextNode.key(), expectedOrder.get(i)); - dag.reportCompletion(nextNode); - nextNode = dag.getNext(); - i++; - } - - System.out.println("done"); - } - - @Test - public void testGraphMerge() { - /** - * |-------->[D]------>[B]---------->[A] - * | ^ ^ - * | | | - * [F]------->[E]-------| | - * | | | - * | |------->[G]----->[C]---- - * | - * |-------->[H]-------------------->[I] - */ - List expectedOrder = new ArrayList<>(); - expectedOrder.add("A"); expectedOrder.add("I"); - expectedOrder.add("B"); expectedOrder.add("C"); expectedOrder.add("H"); - expectedOrder.add("D"); expectedOrder.add("G"); - expectedOrder.add("E"); - expectedOrder.add("F"); - - DAGraph graphA = createGraph("A"); - DAGraph graphI = createGraph("I"); - - DAGraph graphB = createGraph("B"); - graphA.addDependentGraph(graphB); - - DAGraph graphC = createGraph("C"); - graphA.addDependentGraph(graphC); - - DAGraph graphH = createGraph("H"); - graphI.addDependentGraph(graphH); - - DAGraph graphG = createGraph("G"); - graphC.addDependentGraph(graphG); - - DAGraph graphE = createGraph("E"); - graphB.addDependentGraph(graphE); - graphG.addDependentGraph(graphE); - - DAGraph graphD = createGraph("D"); - graphB.addDependentGraph(graphD); - - DAGraph graphF = createGraph("F"); - graphD.addDependentGraph(graphF); - graphE.addDependentGraph(graphF); - graphH.addDependentGraph(graphF); - - DAGraph dag = graphF; - dag.prepareForEnumeration(); - - ItemHolder nextNode = dag.getNext(); - int i = 0; - while (nextNode != null) { - Assertions.assertEquals(expectedOrder.get(i), nextNode.key()); - // Process the node - dag.reportCompletion(nextNode); - nextNode = dag.getNext(); - i++; - } - } - - private DAGraph createGraph(String resourceName) { - ItemHolder node = new ItemHolder(resourceName, "data" + resourceName); - DAGraph graph = new DAGraph<>(node); - return graph; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/DAGraphTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/DAGraphTests.java deleted file mode 100644 index f2a9814a8c92..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/DAGraphTests.java +++ /dev/null @@ -1,478 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.dag; - -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -public class DAGraphTests { - @Test - public void testDAGraphGetNext() { - /** - * |-------->[D]------>[B]-----------[A] - * | ^ ^ - * | | | - * [F]------->[E]-------| | - * | | | - * | |------->[G]----->[C]---- - * | - * |-------->[H]-------------------->[I] - */ - List expectedOrder = new ArrayList<>(); - expectedOrder.add("A"); expectedOrder.add("I"); // Level 0 - expectedOrder.add("B"); expectedOrder.add("C"); expectedOrder.add("H"); // Level 1 - expectedOrder.add("D"); expectedOrder.add("G"); // Level 2 - expectedOrder.add("E"); // Level 3 - expectedOrder.add("F"); // Level 4 - - ItemHolder nodeA = new ItemHolder("A", "dataA"); - ItemHolder nodeI = new ItemHolder("I", "dataI"); - - ItemHolder nodeB = new ItemHolder("B", "dataB"); - nodeB.addDependency(nodeA.key()); - - ItemHolder nodeC = new ItemHolder("C", "dataC"); - nodeC.addDependency(nodeA.key()); - - ItemHolder nodeH = new ItemHolder("H", "dataH"); - nodeH.addDependency(nodeI.key()); - - ItemHolder nodeG = new ItemHolder("G", "dataG"); - nodeG.addDependency(nodeC.key()); - - ItemHolder nodeE = new ItemHolder("E", "dataE"); - nodeE.addDependency(nodeB.key()); - nodeE.addDependency(nodeG.key()); - - ItemHolder nodeD = new ItemHolder("D", "dataD"); - nodeD.addDependency(nodeB.key()); - - - ItemHolder nodeF = new ItemHolder("F", "dataF"); - nodeF.addDependency(nodeD.key()); - nodeF.addDependency(nodeE.key()); - nodeF.addDependency(nodeH.key()); - - DAGraph dag = new DAGraph<>(nodeF); - dag.addNode(nodeA); - dag.addNode(nodeB); - dag.addNode(nodeC); - dag.addNode(nodeD); - dag.addNode(nodeE); - dag.addNode(nodeG); - dag.addNode(nodeH); - dag.addNode(nodeI); - - dag.prepareForEnumeration(); - ItemHolder nextNode = dag.getNext(); - int i = 0; - while (nextNode != null) { - Assertions.assertEquals(nextNode.key(), expectedOrder.get(i)); - dag.reportCompletion(nextNode); - nextNode = dag.getNext(); - i++; - } - - System.out.println("done"); - } - - @Test - public void testGraphDependency() { - /** - * |-------->[D]------>[B]---------->[A] - * | ^ ^ - * | | | - * [F]------->[E]-------| | - * | | | - * | |------->[G]----->[C]---- - * | - * |-------->[H]-------------------->[I] - */ - List expectedOrder = new ArrayList<>(); - expectedOrder.add("A"); expectedOrder.add("I"); // Level 0 - expectedOrder.add("B"); expectedOrder.add("C"); expectedOrder.add("H"); // Level 1 - expectedOrder.add("D"); expectedOrder.add("G"); // Level 2 - expectedOrder.add("E"); // Level 3 - expectedOrder.add("F"); // Level 4 - - DAGraph graphA = createGraph("A"); - DAGraph graphI = createGraph("I"); - - DAGraph graphB = createGraph("B"); - graphB.addDependencyGraph(graphA); - - DAGraph graphC = createGraph("C"); - graphC.addDependencyGraph(graphA); - - DAGraph graphH = createGraph("H"); - graphH.addDependencyGraph(graphI); - - DAGraph graphG = createGraph("G"); - graphG.addDependencyGraph(graphC); - - DAGraph graphE = createGraph("E"); - graphE.addDependencyGraph(graphB); - graphE.addDependencyGraph(graphG); - - DAGraph graphD = createGraph("D"); - graphD.addDependencyGraph(graphB); - - DAGraph graphF = createGraph("F"); - graphF.addDependencyGraph(graphD); - graphF.addDependencyGraph(graphE); - graphF.addDependencyGraph(graphH); - - DAGraph dag = graphF; - dag.prepareForEnumeration(); - - ItemHolder nextNode = dag.getNext(); - int i = 0; - while (nextNode != null) { - Assertions.assertEquals(expectedOrder.get(i), nextNode.key()); - // Process the node - dag.reportCompletion(nextNode); - nextNode = dag.getNext(); - i++; - } - } - - @Test - public void testGraphDeadLockDetection() { - boolean dlDetected; - - // ---------------------------------------------------- - /** - * [A] <-----------> [A] - */ - dlDetected = false; - DAGraph graphX = createGraph("X"); - try { - graphX.addDependencyGraph(graphX); - } catch (IllegalStateException exception) { - dlDetected = exception.getMessage().contains("X -> ") && exception.getMessage().contains(" -> X"); - } - Assertions.assertTrue(dlDetected, "Expected exception is not thrown"); - - // ---------------------------------------------------- - /** - * [A] -----------> [B] - * ^ ^ - * | | - * | | - * | - * [C]<-------------- - */ - dlDetected = false; - DAGraph graphA = createGraph("A"); - DAGraph graphB = createGraph("B"); - DAGraph graphC = createGraph("C"); - - graphA.addDependencyGraph(graphB); - graphC.addDependencyGraph(graphA); - try { - graphB.addDependencyGraph(graphC); - } catch (IllegalStateException exception) { - dlDetected = exception.getMessage().contains("B -> ") && exception.getMessage().contains(" -> B"); - } - Assertions.assertTrue(dlDetected, "Expected exception is not thrown"); - - // ---------------------------------------------------- - /** - * [2] ------------> [1] - * ^ | - * ----------------| | - * | | - * [3]<---------------- - */ - dlDetected = false; - DAGraph graph1 = createGraph("1"); - DAGraph graph2 = createGraph("2"); - DAGraph graph3 = createGraph("3"); - - graph2.addDependencyGraph(graph1); - graph1.addDependencyGraph(graph3); - try { - graph3.addDependencyGraph(graph1); - } catch (IllegalStateException exception) { - dlDetected = exception.getMessage().contains("3 -> ") && exception.getMessage().contains(" -> 3"); - } - Assertions.assertTrue(dlDetected, "Expected exception is not thrown"); - } - - @Test - public void testGraphNodeTableBubblingUp() { - // ---------------------------------------------------- - // Graph-1 - - /** - * [B] -----------> [A] - * ^ ^ - * | | - * | | - * | - * [C]---------------- - */ - DAGraph graphA = createGraph("A"); - DAGraph graphB = createGraph("B"); - DAGraph graphC = createGraph("C"); - - graphB.addDependencyGraph(graphA); - graphC.addDependencyGraph(graphA); - graphC.addDependencyGraph(graphB); - - DAGraph graph1Root = graphC; - - // ---------------------------------------------------- - // Graph-2 - - /** - * [E] ---> [D] ---> G - * ^ - * | - * | - * [F] - */ - DAGraph graphD = createGraph("D"); - DAGraph graphE = createGraph("E"); - DAGraph graphF = createGraph("F"); - DAGraph graphG = createGraph("G"); - - graphE.addDependencyGraph(graphD); - graphD.addDependencyGraph(graphG); - graphF.addDependencyGraph(graphE); - - DAGraph graph2Root = graphF; - - // ---------------------------------------------------- - // Graph-3 - /** - * [J] ---> [H] ---> I - */ - - DAGraph graphJ = createGraph("J"); - DAGraph graphH = createGraph("H"); - DAGraph graphI = createGraph("I"); - - graphJ.addDependencyGraph(graphH); - graphH.addDependencyGraph(graphI); - - DAGraph graph3Root = graphJ; - - // ---------------------------------------------------- - // Graph-4 - - // Combine 3 graphs using their roots - // graph1Root == graphC - graph1Root.addDependentGraph(graph3Root); // graph3Root == graphJ - graph1Root.addDependentGraph(graph2Root); // graph2Root == graphF - - DAGraph graph4Root1 = graph2Root; // graphF - DAGraph graph4Root2 = graph3Root; // graphJ - - /** - * [B] -----------> [A] - * ^ ^ - * | | - * | | - * | - * [C]---------------- - * ^ ^ (graph4Root2) - * | | - * | ---------------[J] ---> [H] ---> I - * | - * | [E] ---> [D] ---> G - * | ^ - * | | - * | | - * |-----------------[F] (graph4Root1) - */ - - - //====================================================== - // Validate nodeTables (graph1Root) - - ItemHolder nodeAWithG1 = graph1Root.getNode("A"); - Assertions.assertEquals(1, nodeAWithG1.owner().nodeTable.size()); - assertExactMatch(nodeAWithG1.owner().nodeTable.keySet(), new String[] {"A"}); - - ItemHolder nodeBWithG1 = graph1Root.getNode("B"); - Assertions.assertEquals(2, nodeBWithG1.owner().nodeTable.size()); - assertExactMatch(nodeBWithG1.owner().nodeTable.keySet(), new String[] {"A", "B"}); - - ItemHolder nodeCWithG1 = graph1Root.getNode("C"); - Assertions.assertEquals(3, nodeCWithG1.owner().nodeTable.size()); - assertExactMatch(nodeCWithG1.owner().nodeTable.keySet(), new String[] {"A", "B", "C"}); - - //====================================================== - // Validate nodeTables (graph4Root1) - - ItemHolder nodeAWithG41 = graph4Root1.getNode("A"); - Assertions.assertEquals(1, nodeAWithG41.owner().nodeTable.size()); - assertExactMatch(nodeAWithG41.owner().nodeTable.keySet(), new String[] {"A"}); - - ItemHolder nodeBWithG41 = graph4Root1.getNode("B"); - Assertions.assertEquals(2, nodeBWithG41.owner().nodeTable.size()); - assertExactMatch(nodeBWithG41.owner().nodeTable.keySet(), new String[] {"A", "B"}); - - ItemHolder nodeCWithG41 = graph4Root1.getNode("C"); - Assertions.assertEquals(3, nodeCWithG41.owner().nodeTable.size()); - assertExactMatch(nodeCWithG41.owner().nodeTable.keySet(), new String[] {"A", "B", "C"}); - - ItemHolder nodeGWithG41 = graph4Root1.getNode("G"); - Assertions.assertEquals(1, nodeGWithG41.owner().nodeTable.size()); - assertExactMatch(nodeGWithG41.owner().nodeTable.keySet(), new String[] {"G"}); - - ItemHolder nodeDWithG41 = graph4Root1.getNode("D"); - Assertions.assertEquals(2, nodeDWithG41.owner().nodeTable.size()); - assertExactMatch(nodeDWithG41.owner().nodeTable.keySet(), new String[] {"D", "G"}); - - ItemHolder nodeEWithG41 = graph4Root1.getNode("E"); - Assertions.assertEquals(3, nodeEWithG41.owner().nodeTable.size()); - assertExactMatch(nodeEWithG41.owner().nodeTable.keySet(), new String[] {"E", "D", "G"}); - - ItemHolder nodeFWithG41 = graph4Root1.getNode("F"); - Assertions.assertEquals(7, nodeFWithG41.owner().nodeTable.size()); - assertExactMatch(nodeFWithG41.owner().nodeTable.keySet(), new String[] {"E", "F", "D", "G", "A", "B", "C"}); - - //====================================================== - // Validate nodeTables (graph4Root2) - - ItemHolder nodeAWithG42 = graph4Root2.getNode("A"); - Assertions.assertEquals(1, nodeAWithG42.owner().nodeTable.size()); - assertExactMatch(nodeAWithG42.owner().nodeTable.keySet(), new String[] {"A"}); - - ItemHolder nodeBWithG42 = graph4Root2.getNode("B"); - Assertions.assertEquals(2, nodeBWithG42.owner().nodeTable.size()); - assertExactMatch(nodeBWithG42.owner().nodeTable.keySet(), new String[] {"A", "B"}); - - ItemHolder nodeCWithG42 = graph4Root2.getNode("C"); - Assertions.assertEquals(3, nodeCWithG42.owner().nodeTable.size()); - assertExactMatch(nodeCWithG42.owner().nodeTable.keySet(), new String[] {"A", "B", "C"}); - - ItemHolder nodeIWithG42 = graph4Root2.getNode("I"); - Assertions.assertEquals(1, nodeIWithG42.owner().nodeTable.size()); - assertExactMatch(nodeIWithG42.owner().nodeTable.keySet(), new String[] {"I"}); - - ItemHolder nodeHWithG42 = graph4Root2.getNode("H"); - Assertions.assertEquals(2, nodeHWithG42.owner().nodeTable.size()); - assertExactMatch(nodeHWithG42.owner().nodeTable.keySet(), new String[] {"I", "H"}); - - ItemHolder nodeJWithG42 = graph4Root2.getNode("J"); - Assertions.assertEquals(6, nodeJWithG42.owner().nodeTable.size()); - assertExactMatch(nodeJWithG42.owner().nodeTable.keySet(), new String[] {"I", "H", "J", "A", "B", "C"}); - - // System.out.println(combinedGraphRoot.nodeTable.keySet()); - - // ---------------------------------------------------- - // Graph-1 - - /** - * [L] -----------> [K] - * ^ ^ - * | | - * | | - * | - * [M]---------------- - */ - DAGraph graphK = createGraph("K"); - DAGraph graphL = createGraph("L"); - DAGraph graphM = createGraph("M"); - - - graphL.addDependencyGraph(graphK); - graphM.addDependencyGraph(graphL); - graphM.addDependencyGraph(graphK); - - - // Add a non-root node in this graph as dependency of a non-root node in the first graph. - // - graphA.addDependencyGraph(graphL); - - /** - * |---------> [L] -----------> [K] - * | ^ ^ - * | | | - * | | | - * | | - * | [M]---------------- - * | - * [B] -----------> [A] - * ^ ^ - * | | - * | | - * | - * [C]---------------- - * ^ ^ - * | | - * | ---------------[J] ---> [H] ---> I - * | - * | [E] ---> [D] ---> G - * | ^ - * | | - * | | - * |-----------------[F] (graph4Root1) - */ - - //====================================================== - // Validate nodeTables (graph4Root1) - - ItemHolder nodeKWithG41 = graph4Root1.getNode("K"); - Assertions.assertEquals(1, nodeKWithG41.owner().nodeTable.size()); - assertExactMatch(nodeKWithG41.owner().nodeTable.keySet(), new String[] {"K"}); - - ItemHolder nodeLWithG41 = graph4Root1.getNode("L"); - Assertions.assertEquals(2, nodeLWithG41.owner().nodeTable.size()); - assertExactMatch(nodeLWithG41.owner().nodeTable.keySet(), new String[] {"K", "L"}); - - ItemHolder nodeAWithG41Updated = graph4Root1.getNode("A"); - Assertions.assertEquals(3, nodeAWithG41Updated.owner().nodeTable.size()); - assertExactMatch(nodeAWithG41Updated.owner().nodeTable.keySet(), new String[] {"K", "L", "A"}); - - ItemHolder nodeBWithG41Updated = graph4Root1.getNode("B"); - Assertions.assertEquals(4, nodeBWithG41Updated.owner().nodeTable.size()); - assertExactMatch(nodeBWithG41Updated.owner().nodeTable.keySet(), new String[] {"K", "L", "A", "B"}); - - ItemHolder nodeCWithG41Updated = graph4Root1.getNode("C"); - Assertions.assertEquals(5, nodeCWithG41Updated.owner().nodeTable.size()); - assertExactMatch(nodeCWithG41Updated.owner().nodeTable.keySet(), new String[] {"K", "L", "A", "B", "C"}); - - ItemHolder nodeFWithG41Updated = graph4Root1.getNode("F"); - Assertions.assertEquals(9, nodeFWithG41Updated.owner().nodeTable.size()); - assertExactMatch(nodeFWithG41Updated.owner().nodeTable.keySet(), new String[] {"K", "L", "A", "B", "C", "F", "E", "D", "G"}); - - ItemHolder nodeGWithG41NoUpdate = graph4Root1.getNode("G"); - Assertions.assertEquals(1, nodeGWithG41NoUpdate.owner().nodeTable.size()); - assertExactMatch(nodeGWithG41NoUpdate.owner().nodeTable.keySet(), new String[] {"G"}); - - ItemHolder nodeDWithG41NoUpdate = graph4Root1.getNode("D"); - Assertions.assertEquals(2, nodeDWithG41NoUpdate.owner().nodeTable.size()); - assertExactMatch(nodeDWithG41NoUpdate.owner().nodeTable.keySet(), new String[] {"D", "G"}); - - ItemHolder nodeEWithG41NoUpdate = graph4Root1.getNode("E"); - Assertions.assertEquals(3, nodeEWithG41NoUpdate.owner().nodeTable.size()); - assertExactMatch(nodeEWithG41NoUpdate.owner().nodeTable.keySet(), new String[] {"E", "D", "G"}); - } - - private DAGraph createGraph(String resourceName) { - ItemHolder node = new ItemHolder(resourceName, "data" + resourceName); - DAGraph graph = new DAGraph<>(node); - return graph; - } - - private void assertExactMatch(Set set, String[] values) { - HashSet s = new HashSet<>(); - s.addAll(set); - - s.removeAll(Arrays.asList(values)); - if (s.size() != 0) { - Assertions.assertTrue(false, "Content of set " + set + " does not match with provided array " + Arrays.asList(values)); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/ExecutableWithCreatableTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/ExecutableWithCreatableTests.java deleted file mode 100644 index 3dc3fbfce5da..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/ExecutableWithCreatableTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.dag; - -import org.junit.jupiter.api.Test; - -public class ExecutableWithCreatableTests { - @Test - public void testExecutableWithExecutableDependency() { - BreadSliceImpl breadFetcher1 = new BreadSliceImpl("BreadSlice1"); - BreadSliceImpl breadFetcher2 = new BreadSliceImpl("BreadSlice2"); - breadFetcher1.withAnotherSliceFromStore(breadFetcher2) - .execute(); - } - - @Test - public void testExecutableWithCreatableDependency() { - BreadSliceImpl breadFetcher = new BreadSliceImpl("BreadSlice"); - OrderImpl order = new OrderImpl("OrderForSlice", new OrderInner()); - breadFetcher.withNewOrder(order) - .execute(); - } - - @Test - public void testCreatableWithExecutableDependency() { - SandwichImpl sandwich = new SandwichImpl("Sandwich", new SandwichInner()); - BreadSliceImpl breadFetcher = new BreadSliceImpl("SliceForSandwich"); - OrderImpl order = new OrderImpl("OrderForSlice", new OrderInner()); - breadFetcher.withNewOrder(order); - sandwich.withBreadSliceFromStore(breadFetcher) - .create(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/IBreadSlice.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/IBreadSlice.java deleted file mode 100644 index d2ba48f10fbb..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/IBreadSlice.java +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.dag; - -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.Executable; -import com.azure.resourcemanager.resources.fluentcore.model.Indexable; - -/** - * Represents a type when executed returns a bread from the store. - */ -public interface IBreadSlice extends Indexable, Executable { - IBreadSlice withAnotherSliceFromStore(Executable breadFetcher); - IBreadSlice withNewOrder(Creatable order); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/IOrder.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/IOrder.java deleted file mode 100644 index f66299056c11..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/IOrder.java +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.dag; - -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.Indexable; - -/** - * Type represents a order that is to be created prior to fetching a bread slice from store. - */ -public interface IOrder extends Indexable, Creatable { -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/IPanCake.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/IPanCake.java deleted file mode 100644 index 05b5c3b2c41e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/IPanCake.java +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.dag; - -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.Indexable; - -/** - * Creatable and Indexable pancake. - */ -interface IPancake extends Indexable, Creatable { - IPancake withInstantPancake(Creatable anotherPancake); - IPancake withDelayedPancake(Creatable anotherPancake); -} - diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/IPasta.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/IPasta.java deleted file mode 100644 index b4063b7b4182..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/IPasta.java +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.dag; - -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.Indexable; - -/** - * Creatable and Indexable pasta. - */ -interface IPasta extends Indexable, Creatable { - IPasta withInstantPasta(Creatable anotherPasta); - IPasta withDelayedPasta(Creatable anotherPasta); -} - diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/IPizza.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/IPizza.java deleted file mode 100644 index f69f626bfc6c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/IPizza.java +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.dag; - -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.Indexable; - -/** - * Creatable and Indexable pizza. - */ -interface IPizza extends Indexable, Creatable { - IPizza withInstantPizza(Creatable anotherPizza); - IPizza withDelayedPizza(Creatable anotherPizza); -} - diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/ISandwich.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/ISandwich.java deleted file mode 100644 index d63a9107bbce..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/ISandwich.java +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.dag; - -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.Executable; -import com.azure.resourcemanager.resources.fluentcore.model.Indexable; - -/** - * Creatable and Indexable sandwich. - */ -public interface ISandwich extends Indexable, Creatable { - ISandwich withBreadSliceFromStore(Executable breadFetcher); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/InvokeRootTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/InvokeRootTests.java deleted file mode 100644 index 98d1dc86bd6a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/InvokeRootTests.java +++ /dev/null @@ -1,251 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.dag; - -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasName; -import com.azure.resourcemanager.resources.fluentcore.model.Indexable; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -import java.util.HashMap; - -public class InvokeRootTests { - @Test - public void testIgnoreCachedResultOnRootWithNoProxy() { - TestTaskItem taskItem1 = new TestTaskItem("A"); - TestTaskItem taskItem2 = new TestTaskItem("B"); - - taskItem1.addDependency(taskItem2); - - final HashMap seen = new HashMap<>(); - - taskItem1.taskGroup().invokeAsync(taskItem1.taskGroup().newInvocationContext()) - .map(item -> { - SupportCountingAndHasName c = (SupportCountingAndHasName) item; - if (seen.containsKey(c.name())) { - Integer a = seen.get(c.name()) + 1; - seen.put(c.name(), a); - } else { - seen.put(c.name(), 1); - } - return item; - }).blockLast(); - - Assertions.assertEquals(2, seen.size()); - Assertions.assertTrue(seen.containsKey("A")); - Assertions.assertTrue(seen.containsKey("B")); - Assertions.assertEquals(1, (long) seen.get("A")); - Assertions.assertEquals(1, (long) seen.get("B")); - - - Assertions.assertEquals(1, taskItem1.getCallCount()); - Assertions.assertEquals(1, taskItem2.getCallCount()); - - seen.clear(); - - taskItem1.taskGroup().invokeAsync(taskItem1.taskGroup().newInvocationContext()) - .map(item -> { - SupportCountingAndHasName c = (SupportCountingAndHasName) item; - if (seen.containsKey(c.name())) { - Integer a = seen.get(c.name()) + 1; - seen.put(c.name(), a); - } else { - seen.put(c.name(), 1); - } - return item; - }).blockLast(); - - Assertions.assertEquals(2, seen.size()); - Assertions.assertTrue(seen.containsKey("A")); - Assertions.assertTrue(seen.containsKey("B")); - Assertions.assertEquals(1, (long) seen.get("A")); - Assertions.assertEquals(1, (long) seen.get("B")); - - - Assertions.assertEquals(2, taskItem1.getCallCount()); - Assertions.assertEquals(1, taskItem2.getCallCount()); - } - - @Test - public void testIgnoreCachedResultOnRootWithProxy() { - TestTaskItem taskItem1 = new TestTaskItem("X"); - TestTaskItem taskItem2 = new TestTaskItem("Y"); - TestTaskItem taskItem3 = new TestTaskItem("Z"); - - taskItem1.addDependency(taskItem2); - taskItem1.addPostRunDependent(taskItem3); - - final HashMap seen = new HashMap<>(); - - taskItem1.taskGroup().invokeAsync(taskItem1.taskGroup().newInvocationContext()) - .map(item -> { - SupportCountingAndHasName c = (SupportCountingAndHasName) item; - if (seen.containsKey(c.name())) { - Integer a = seen.get(c.name()) + 1; - seen.put(c.name(), a); - } else { - seen.put(c.name(), 1); - } - return item; - }).blockLast(); - - Assertions.assertEquals(3, seen.size()); // X, Y, Z - - Assertions.assertTrue(seen.containsKey("X")); - Assertions.assertTrue(seen.containsKey("Y")); - Assertions.assertTrue(seen.containsKey("Z")); - Assertions.assertEquals(2, (long) seen.get("X")); // Due to proxy two Xs - Assertions.assertEquals(1, (long) seen.get("Y")); - Assertions.assertEquals(1, (long) seen.get("Z")); - - Assertions.assertEquals(1, taskItem1.getCallCount()); - Assertions.assertEquals(1, taskItem2.getCallCount()); - Assertions.assertEquals(1, taskItem3.getCallCount()); - - seen.clear(); - - taskItem1.taskGroup().invokeAsync(taskItem1.taskGroup().newInvocationContext()) - .map(item -> { - SupportCountingAndHasName c = (SupportCountingAndHasName) item; - if (seen.containsKey(c.name())) { - Integer a = seen.get(c.name()) + 1; - seen.put(c.name(), a); - } else { - seen.put(c.name(), 1); - } - return item; - }).blockLast(); - - Assertions.assertEquals(3, seen.size()); - - Assertions.assertTrue(seen.containsKey("X")); - Assertions.assertTrue(seen.containsKey("Y")); - Assertions.assertTrue(seen.containsKey("Z")); - Assertions.assertEquals(2, (long) seen.get("X")); // Due to proxy two Xs - Assertions.assertEquals(1, (long) seen.get("Y")); - Assertions.assertEquals(1, (long) seen.get("Z")); - - // Though proxy is the root still actual must be called twice - // - Assertions.assertEquals(2, taskItem1.getCallCount()); - Assertions.assertEquals(1, taskItem2.getCallCount()); - Assertions.assertEquals(1, taskItem3.getCallCount()); - } - - @Test - public void testIgnoreCachedResultOnRootWithProxyWithDescendantProxy() { - TestTaskItem taskItem1 = new TestTaskItem("1"); - TestTaskItem taskItem2 = new TestTaskItem("2"); - TestTaskItem taskItem3 = new TestTaskItem("3"); - TestTaskItem taskItem4 = new TestTaskItem("4"); - TestTaskItem taskItem5 = new TestTaskItem("5"); - - taskItem1.addDependency(taskItem2); - taskItem1.addPostRunDependent(taskItem3); - taskItem4.addDependency(taskItem1); - taskItem4.addPostRunDependent(taskItem5); - - final HashMap seen = new HashMap<>(); - - taskItem4.taskGroup().invokeAsync(taskItem1.taskGroup().newInvocationContext()) - .map(item -> { - SupportCountingAndHasName c = (SupportCountingAndHasName) item; - if (seen.containsKey(c.name())) { - Integer a = seen.get(c.name()) + 1; - seen.put(c.name(), a); - } else { - seen.put(c.name(), 1); - } - return item; - }).blockLast(); - - Assertions.assertEquals(5, seen.size()); - - Assertions.assertTrue(seen.containsKey("1")); - Assertions.assertTrue(seen.containsKey("2")); - Assertions.assertTrue(seen.containsKey("3")); - Assertions.assertTrue(seen.containsKey("4")); - Assertions.assertTrue(seen.containsKey("5")); - - Assertions.assertEquals(2, (long) seen.get("1")); // Due to proxy two 1s - Assertions.assertEquals(1, (long) seen.get("2")); - Assertions.assertEquals(1, (long) seen.get("3")); - Assertions.assertEquals(2, (long) seen.get("4")); // Due to proxy two 1s - Assertions.assertEquals(1, (long) seen.get("5")); - - Assertions.assertEquals(1, taskItem1.getCallCount()); - Assertions.assertEquals(1, taskItem2.getCallCount()); - Assertions.assertEquals(1, taskItem3.getCallCount()); - Assertions.assertEquals(1, taskItem4.getCallCount()); - Assertions.assertEquals(1, taskItem5.getCallCount()); - - seen.clear(); - - taskItem4.taskGroup().invokeAsync(taskItem1.taskGroup().newInvocationContext()) - .map(item -> { - SupportCountingAndHasName c = (SupportCountingAndHasName) item; - if (seen.containsKey(c.name())) { - Integer a = seen.get(c.name()) + 1; - seen.put(c.name(), a); - } else { - seen.put(c.name(), 1); - } - return item; - }).blockLast(); - - Assertions.assertEquals(5, seen.size()); - - Assertions.assertTrue(seen.containsKey("1")); - Assertions.assertTrue(seen.containsKey("2")); - Assertions.assertTrue(seen.containsKey("3")); - Assertions.assertTrue(seen.containsKey("4")); - Assertions.assertTrue(seen.containsKey("5")); - - Assertions.assertEquals(2, (long) seen.get("1")); // Due to proxy two 1s - Assertions.assertEquals(1, (long) seen.get("2")); - Assertions.assertEquals(1, (long) seen.get("3")); - Assertions.assertEquals(2, (long) seen.get("4")); // Due to proxy two 1s - Assertions.assertEquals(1, (long) seen.get("5")); - - Assertions.assertEquals(1, taskItem1.getCallCount()); - Assertions.assertEquals(1, taskItem2.getCallCount()); - Assertions.assertEquals(1, taskItem3.getCallCount()); - Assertions.assertEquals(2, taskItem4.getCallCount()); // Only Root must be called twice - Assertions.assertEquals(1, taskItem5.getCallCount()); - } - - class TestTaskItem extends IndexableTaskItem implements SupportCountingAndHasName { - private final String name; - private int callCount = 0; - - TestTaskItem(String name) { - super(name); - this.name = name; - } - - @Override - public String name() { - return this.name; - } - - @Override - public int getCallCount() { - return this.callCount; - } - - @Override - protected Mono invokeTaskAsync(TaskGroup.InvocationContext context) { - return Mono.just(this) - .map(r -> { - callCount++; - return r; - }); - } - } - - interface SupportCountingAndHasName extends HasName { - int getCallCount(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/ItemHolder.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/ItemHolder.java deleted file mode 100644 index 4c022b7a5d25..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/ItemHolder.java +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.dag; - -class ItemHolder extends DAGNode { - ItemHolder(String taskId, String taskItem) { - super(taskId, taskItem); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/OrderImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/OrderImpl.java deleted file mode 100644 index 81f498b22ec2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/OrderImpl.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.dag; - -import com.azure.resourcemanager.resources.fluentcore.model.implementation.CreatableUpdatableImpl; -import reactor.core.publisher.Mono; - -import java.time.Duration; - -/** - * Implementation of {@link IOrder} - */ -public class OrderImpl - extends CreatableUpdatableImpl - implements IOrder { - /** - * Creates SandwichImpl. - * - * @param name the name of the model - * @param innerObject the inner model object - */ - protected OrderImpl(String name, OrderInner innerObject) { - super(name, name, innerObject); - } - - @Override - public Mono createResourceAsync() { - System.out.println("Order(" + this.name() + ")::createResourceAsync() [Creating order]"); - return Mono.just(this) - .delayElement(Duration.ofMillis(250)) - .map(sandwich -> sandwich); - } - - @Override - public boolean isInCreateMode() { - return true; - } - - @Override - protected Mono getInnerAsync() { - return Mono.just(this.innerModel()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/OrderInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/OrderInner.java deleted file mode 100644 index af2ba9a0b927..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/OrderInner.java +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.dag; - -/** - * The inner bill type. - */ -public class OrderInner { -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/PanCakeImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/PanCakeImpl.java deleted file mode 100644 index c1c13ddb0f92..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/PanCakeImpl.java +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.dag; - -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.CreatableUpdatableImpl; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.CreateUpdateTask; -import org.junit.jupiter.api.Assertions; -import reactor.core.publisher.Mono; - -import java.time.Duration; -import java.util.ArrayList; -import java.util.List; - -/** - * Implementation of {@link IPancake} - */ -class PancakeImpl - extends CreatableUpdatableImpl - implements IPancake { - final List> delayedPancakes; - final long eventDelayInMilliseconds; - final Throwable errorToThrow; - boolean prepareCalled = false; - - PancakeImpl(String name, long eventDelayInMilliseconds) { - this(name, eventDelayInMilliseconds, false); - } - - PancakeImpl(String name, long eventDelayInMilliseconds, boolean fault) { - super(name, name, new PancakeInner()); - this.eventDelayInMilliseconds = eventDelayInMilliseconds; - if (fault) { - this.errorToThrow = new RuntimeException(name); - } else { - this.errorToThrow = null; - } - delayedPancakes = new ArrayList<>(); - } - - /** - * a pancake specified via this wither will be added immediately as dependency. - * - * @param pancake the pancake - * @return the next stage of pancake - */ - @Override - public PancakeImpl withInstantPancake(Creatable pancake) { - this.addDependency(pancake); - return this; - } - - /** - * a pancake specified via this wither will not be added immediately as a dependency, will be added only - * inside beforeGroupCreateOrUpdate {@link CreateUpdateTask.ResourceCreatorUpdater#beforeGroupCreateOrUpdate()} - * - * @param pancake the pancake - * @return the next stage of pancake - */ - @Override - public PancakeImpl withDelayedPancake(Creatable pancake) { - this.delayedPancakes.add(pancake); - return this; - } - - @Override - public void beforeGroupCreateOrUpdate() { - Assertions.assertFalse(this.prepareCalled, "PancakeImpl::beforeGroupCreateOrUpdate() should not be called multiple times"); - prepareCalled = true; - int oldCount = this.taskGroup().getNode(this.key()).dependencyKeys().size(); - for (Creatable pancake : this.delayedPancakes) { - this.addDependency(pancake); - } - int newCount = this.taskGroup().getNode(this.key()).dependencyKeys().size(); - System.out.println("Pancake(" + this.name() + ")::beforeGroupCreateOrUpdate() 'delayedSize':" + this.delayedPancakes.size() - + " 'dependency count [old, new]': [" + oldCount + "," + newCount + "]"); - } - - @Override - public Mono createResourceAsync() { - if (this.errorToThrow == null) { - System.out.println("Pancake(" + this.name() + ")::createResourceAsync() 'onNext()'"); - return Mono.just(this) - .delayElement(Duration.ofMillis(this.eventDelayInMilliseconds)) - .map(pancake -> pancake); - } else { - System.out.println("Pancake(" + this.name() + ")::createResourceAsync() 'onError()'"); - return Mono.just(this) - .delayElement(Duration.ofMillis(this.eventDelayInMilliseconds)) - .flatMap(pancake -> toErrorMono(errorToThrow)); - } - } - - @Override - public boolean isInCreateMode() { - return true; - } - - @Override - protected Mono getInnerAsync() { - return null; - } - - private Mono toErrorMono(Throwable throwable) { - return Mono.error(throwable); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/PanCakeInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/PanCakeInner.java deleted file mode 100644 index fad56f54f43f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/PanCakeInner.java +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.dag; - -/** - * The inner pancake type. - */ -final class PancakeInner { -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/PastaImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/PastaImpl.java deleted file mode 100644 index 92c73ad79bd6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/PastaImpl.java +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.dag; - -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.CreatableUpdatableImpl; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.CreateUpdateTask; -import org.junit.jupiter.api.Assertions; -import reactor.core.publisher.Mono; - -import java.time.Duration; -import java.util.ArrayList; -import java.util.List; - -/** - * Implementation of {@link IPasta} - */ -class PastaImpl - extends CreatableUpdatableImpl - implements IPasta { - final List> delayedPastas; - final long eventDelayInMilliseconds; - final Throwable errorToThrow; - boolean prepareCalled = false; - - PastaImpl(String name, long eventDelayInMilliseconds) { - this(name, eventDelayInMilliseconds, false); - } - - PastaImpl(String name, long eventDelayInMilliseconds, boolean fault) { - super(name, name, new PastaInner()); - this.eventDelayInMilliseconds = eventDelayInMilliseconds; - if (fault) { - this.errorToThrow = new RuntimeException(name); - } else { - this.errorToThrow = null; - } - delayedPastas = new ArrayList<>(); - } - - /** - * a pasta specified via this wither will be added immediately as dependency. - * - * @param pasta the pasta - * @return the next stage of pasta - */ - @Override - public PastaImpl withInstantPasta(Creatable pasta) { - this.addDependency(pasta); - return this; - } - - /** - * a pancake specified via this wither will not be added immediately as a dependency, will be added only - * inside beforeGroupCreateOrUpdate {@link CreateUpdateTask.ResourceCreatorUpdater#beforeGroupCreateOrUpdate()} - * - * @param pasta the pasta - * @return the next stage of pasta - */ - @Override - public PastaImpl withDelayedPasta(Creatable pasta) { - this.delayedPastas.add(pasta); - return this; - } - - - @Override - public void beforeGroupCreateOrUpdate() { - Assertions.assertFalse(this.prepareCalled, "PastaImpl::beforeGroupCreateOrUpdate() should not be called multiple times"); - prepareCalled = true; - int oldCount = this.taskGroup().getNode(this.key()).dependencyKeys().size(); - for (Creatable pancake : this.delayedPastas) { - this.addDependency(pancake); - } - int newCount = this.taskGroup().getNode(this.key()).dependencyKeys().size(); - System.out.println("Pasta(" + this.name() + ")::beforeGroupCreateOrUpdate() 'delayedSize':" + this.delayedPastas.size() - + " 'dependency count [old, new]': [" + oldCount + "," + newCount + "]"); - } - - @Override - public Mono createResourceAsync() { - if (this.errorToThrow == null) { - System.out.println("Pasta(" + this.name() + ")::createResourceAsync() 'onNext()'"); - return Mono.just(this) - .delayElement(Duration.ofMillis(this.eventDelayInMilliseconds)) - .map(pasta -> pasta); - } else { - System.out.println("Pasta(" + this.name() + ")::createResourceAsync() 'onError()'"); - return Mono.just(this) - .delayElement(Duration.ofMillis(this.eventDelayInMilliseconds)) - .flatMap(pasta -> toErrorObservable(errorToThrow)); - } - } - - @Override - public boolean isInCreateMode() { - return true; - } - - @Override - protected Mono getInnerAsync() { - return Mono.just(this.innerModel()); - } - - private Mono toErrorObservable(Throwable throwable) { - return Mono.error(throwable); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/PastaInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/PastaInner.java deleted file mode 100644 index b144ffce6345..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/PastaInner.java +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.dag; - -/** - * The inner pasta type. - */ -final class PastaInner { -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/PizzaImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/PizzaImpl.java deleted file mode 100644 index 761d0b600040..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/PizzaImpl.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.dag; - -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.CreatableUpdatableImpl; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.CreateUpdateTask; -import org.junit.jupiter.api.Assertions; -import reactor.core.publisher.Mono; - -import java.time.Duration; -import java.util.ArrayList; -import java.util.List; - -/** - * Implementation of {@link IPizza} - */ -class PizzaImpl - extends CreatableUpdatableImpl - implements IPizza { - final List> delayedPizzas; - boolean prepareCalled = false; - - PizzaImpl(String name) { - super(name, name, new PizzaInner()); - delayedPizzas = new ArrayList<>(); - } - - /** - * a pizza specified via this wither will be added immediately as dependency. - * - * @param pizza the pizza - * @return the next stage of pizza - */ - @Override - public PizzaImpl withInstantPizza(Creatable pizza) { - this.addDependency(pizza); - return this; - } - - /** - * a pizza specified via this wither will not be added immediately as a dependency, will be added only - * inside beforeGroupCreateOrUpdate {@link CreateUpdateTask.ResourceCreatorUpdater#beforeGroupCreateOrUpdate()} - * - * @param pizza the pizza - * @return the next stage of pizza - */ - @Override - public PizzaImpl withDelayedPizza(Creatable pizza) { - this.delayedPizzas.add(pizza); - return this; - } - - @Override - public void beforeGroupCreateOrUpdate() { - Assertions.assertFalse(this.prepareCalled, "PizzaImpl::beforeGroupCreateOrUpdate() should not be called multiple times"); - prepareCalled = true; - int oldCount = this.taskGroup().getNode(this.key()).dependencyKeys().size(); - for (Creatable pizza : this.delayedPizzas) { - this.addDependency(pizza); - } - int newCount = this.taskGroup().getNode(this.key()).dependencyKeys().size(); - System.out.println("Pizza(" + this.name() + ")::beforeGroupCreateOrUpdate() 'delayedSize':" + this.delayedPizzas.size() - + " 'dependency count [old, new]': [" + oldCount + "," + newCount + "]"); - } - - @Override - public Mono createResourceAsync() { - System.out.println("Pizza(" + this.name() + ")::createResourceAsync()"); - return Mono.just(this) - .delayElement(Duration.ofMillis(250)) - .map(pizza -> pizza); - } - - @Override - public boolean isInCreateMode() { - return true; - } - - @Override - protected Mono getInnerAsync() { - return Mono.just(this.innerModel()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/PizzaInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/PizzaInner.java deleted file mode 100644 index 984ba70eb9a8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/PizzaInner.java +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.dag; - -/** - * The inner pizza type. - */ -final class PizzaInner { -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/ProxyTaskGroupTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/ProxyTaskGroupTests.java deleted file mode 100644 index c55b04569380..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/ProxyTaskGroupTests.java +++ /dev/null @@ -1,1666 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.dag; - -import com.azure.resourcemanager.resources.fluentcore.model.Indexable; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.concurrent.CountDownLatch; - -public class ProxyTaskGroupTests { - - @Test - public void testSampleTaskGroupSanity() { - // Prepare sample group - // - /** - * - * |------------------->B------------| - * | | - * | ↓ - * F ------->C----------->A - * | | ^ - * | | | - * |------------>E | - * | | - * | | - * ------->D------------- - */ - final List groupItems = new ArrayList<>(); - TaskGroup group = createSampleTaskGroup("A", "B", - "C", "D", - "E", "F", - groupItems); - - // Invocation of group should invoke all the tasks - // - group.invokeAsync(group.newInvocationContext()) - .subscribe(value -> { - StringIndexable stringIndexable = toStringIndexable(value); - Assertions.assertTrue(groupItems.contains(stringIndexable.str())); - groupItems.remove(stringIndexable.str()); - }); - - Assertions.assertEquals(0, groupItems.size()); - - Map> shouldNotSee = new HashMap<>(); - - // NotSeen entries for group-1 - shouldNotSee.put("A", new HashSet()); - shouldNotSee.get("A").addAll(Arrays.asList(new String[]{"B", "C", "D", "E", "F"})); - - shouldNotSee.put("B", new HashSet()); - shouldNotSee.get("B").addAll(Arrays.asList(new String[]{"F"})); - - shouldNotSee.put("C", new HashSet()); - shouldNotSee.get("C").addAll(Arrays.asList(new String[]{"E", "F"})); - - shouldNotSee.put("D", new HashSet()); - shouldNotSee.get("D").addAll(Arrays.asList(new String[]{"E", "F"})); - - shouldNotSee.put("E", new HashSet()); - shouldNotSee.get("E").addAll(Arrays.asList(new String[]{"F"})); - - shouldNotSee.put("F", new HashSet()); - shouldNotSee.get("F").addAll(Arrays.asList(new String[]{})); - - Set seen = new HashSet<>(); - // Test invocation order for group - // - group.prepareForEnumeration(); - for (TaskGroupEntry entry = group.getNext(); entry != null; entry = group.getNext()) { -// Sets.SetView common = Sets.intersection(shouldNotSee.get(entry.key()), seen); - Set common = shouldNotSee.get(entry.key()); - common.retainAll(seen); - if (common.size() > 0) { - Assertions.assertTrue(false, "The entries " + common + " must be emitted before " + entry.key()); - } - seen.add(entry.key()); - group.reportCompletion(entry); - } - - Assertions.assertEquals(6, seen.size()); // 1 groups with 6 nodes - Set expectedToSee = new HashSet<>(); - expectedToSee.addAll(Arrays.asList(new String[]{"A", "B", "C", "D", "E", "F"})); -// Sets.SetView diff = Sets.difference(seen, expectedToSee); - seen.removeAll(expectedToSee); - Assertions.assertEquals(0, seen.size()); - } - - @Test - public void testTaskGroupInvocationShouldNotInvokeDependentTaskGroup() { - // Prepare group-1 - // - /** - * - * |------------------->B------------| - * | | - * | ↓ - * F ------->C----------->A - * | | ^ - * | | | [group-1] - * |------------>E | - * | | - * | | - * ------->D------------- - */ - final List group1Items = new ArrayList<>(); - final TaskGroup group1 = createSampleTaskGroup("A", "B", - "C", "D", - "E", "F", - group1Items); - - // Prepare group-2 - // - /** - * - * |------------------->H------------| - * | | - * | ↓ - * L ------->I----------->G - * | | ^ [group-2] - * | | | - * |------------>K | - * | | - * | | - * ------->J------------- - */ - final List group2Items = new ArrayList<>(); - final TaskGroup group2 = createSampleTaskGroup("G", "H", - "I", "J", - "K", "L", - group2Items); - - // Expand group-2 by adding group-1 as it's dependency - // - /** - * - * |------------------->H------------| - * | | - * | ↓ - * |---L ------->I---------->G - * | | | ^ [group-2] - * | | | | - * | |------------>K | - * | | | - * | | | - * | ------->J------------- - * | - * | |------------------->B------------| - * | | | - * | | ↓ - * |------->F ------->C----------->A - * | | ^ [group-1] - * | | | - * |------------>E | - * | | - * | | - * ------->D------------ - */ - group2.addDependencyTaskGroup(group1); - - // Invocation of group-1 should not invoke group-2 - // - group1.invokeAsync(group1.newInvocationContext()) - .subscribe(value -> { - StringIndexable stringIndexable = toStringIndexable(value); - Assertions.assertTrue(group1Items.contains(stringIndexable.str())); - group1Items.remove(stringIndexable.str()); - }); - - Assertions.assertEquals(0, group1Items.size()); - - Map> shouldNotSee = new HashMap<>(); - - // NotSeen entries for group-1 - shouldNotSee.put("A", new HashSet()); - shouldNotSee.get("A").addAll(Arrays.asList(new String[]{"B", "C", "D", "E", "F"})); - - shouldNotSee.put("B", new HashSet()); - shouldNotSee.get("B").addAll(Arrays.asList(new String[]{"F"})); - - shouldNotSee.put("C", new HashSet()); - shouldNotSee.get("C").addAll(Arrays.asList(new String[]{"E", "F"})); - - shouldNotSee.put("D", new HashSet()); - shouldNotSee.get("D").addAll(Arrays.asList(new String[]{"E", "F"})); - - shouldNotSee.put("E", new HashSet()); - shouldNotSee.get("E").addAll(Arrays.asList(new String[]{"F"})); - - shouldNotSee.put("F", new HashSet()); - shouldNotSee.get("F").addAll(Arrays.asList(new String[]{})); - - Set seen = new HashSet<>(); - // Test invocation order for group-1 - // - group1.prepareForEnumeration(); - for (TaskGroupEntry entry = group1.getNext(); entry != null; entry = group1.getNext()) { -// Sets.SetView common = Sets.intersection(shouldNotSee.get(entry.key()), seen); - Set common = shouldNotSee.get(entry.key()); - common.retainAll(seen); - if (common.size() > 0) { - Assertions.assertTrue(false, "The entries " + common + " must be emitted before " + entry.key()); - } - seen.add(entry.key()); - group1.reportCompletion(entry); - } - - Assertions.assertEquals(6, seen.size()); // 1 groups with 6 nodes - Set expectedToSee = new HashSet<>(); - expectedToSee.addAll(Arrays.asList(new String[]{"A", "B", "C", "D", "E", "F"})); -// Sets.SetView diff = Sets.difference(seen, expectedToSee); - seen.removeAll(expectedToSee); - Assertions.assertEquals(0, seen.size()); - } - - @Test - public void testTaskGroupInvocationShouldInvokeDependencyTaskGroup() { - // Prepare group-1 - // - /** - * - * |------------------->B------------| - * | | - * | ↓ - * F ------->C----------->A - * | | ^ [group-1] - * | | | - * |------------>E | - * | | - * | | - * ------->D------------- - */ - final List group1Items = new ArrayList<>(); - final TaskGroup group1 = createSampleTaskGroup("A", "B", - "C", "D", - "E", "F", - group1Items); - - // Prepare group-2 - // - /** - * - * |------------------->H------------| - * | | - * | ↓ - * L ------->I----------->G - * | | ^ [group-2] - * | | | - * |------------>K | - * | | - * | | - * ------->J------------- - */ - final List group2Items = new ArrayList<>(); - final TaskGroup group2 = createSampleTaskGroup("G", "H", - "I", "J", - "K", "L", - group2Items); - - // Expand group-2 by adding it as group-1's dependent - // - /** - * - * |------------------->H------------| - * | | - * | ↓ - * |---L ------->I----------->G - * | | | ^ [group-2] - * | | | | - * | |------------>K | - * | | | - * | | | - * | ------->J------------- - * | - * | |------------------->B------------| - * | | | - * | | ↓ - * |------->F ------->C---------->A - * | | ^ - * | | | [group-1] - * |------------>E | - * | | - * | | - * ------->D------------ - */ - group2.addDependencyTaskGroup(group1); - - group2Items.addAll(group1Items); - - // Invocation of group-2 should invoke group-2 and group-1 - // - group2.invokeAsync(group2.newInvocationContext()) - .subscribe(value -> { - StringIndexable stringIndexable = toStringIndexable(value); - Assertions.assertTrue(group2Items.contains(stringIndexable.str())); - group2Items.remove(stringIndexable.str()); - }); - - Assertions.assertEquals(0, group2Items.size()); - - - Map> shouldNotSee = new HashMap<>(); - // NotSeen entries for group-1 - shouldNotSee.put("A", new HashSet()); - shouldNotSee.get("A").addAll(Arrays.asList(new String[]{"B", "C", "D", "E", "F"})); - - shouldNotSee.put("B", new HashSet()); - shouldNotSee.get("B").addAll(Arrays.asList(new String[]{"F"})); - - shouldNotSee.put("C", new HashSet()); - shouldNotSee.get("C").addAll(Arrays.asList(new String[]{"E", "F"})); - - shouldNotSee.put("D", new HashSet()); - shouldNotSee.get("D").addAll(Arrays.asList(new String[]{"E", "F"})); - - shouldNotSee.put("E", new HashSet()); - shouldNotSee.get("E").addAll(Arrays.asList(new String[]{"F"})); - - shouldNotSee.put("F", new HashSet()); - shouldNotSee.get("F").addAll(Arrays.asList(new String[]{})); - // NotSeen entries for nodes in Group-2 - // - shouldNotSee.put("G", new HashSet()); - shouldNotSee.get("G").addAll(Arrays.asList(new String[]{"H", "I", "J", "K", "L"})); - - shouldNotSee.put("H", new HashSet()); - shouldNotSee.get("H").addAll(Arrays.asList(new String[]{"L"})); - - shouldNotSee.put("I", new HashSet()); - shouldNotSee.get("I").addAll(Arrays.asList(new String[]{"K", "L"})); - - shouldNotSee.put("J", new HashSet()); - shouldNotSee.get("J").addAll(Arrays.asList(new String[]{"K", "L"})); - - shouldNotSee.put("K", new HashSet()); - shouldNotSee.get("K").addAll(Arrays.asList(new String[]{"L"})); - - shouldNotSee.put("L", new HashSet()); - shouldNotSee.get("L").addAll(Arrays.asList(new String[]{})); - - Set seen = new HashSet<>(); - // Test invocation order for group-2 - // - group2.prepareForEnumeration(); - for (TaskGroupEntry entry = group2.getNext(); entry != null; entry = group2.getNext()) { - Assertions.assertTrue(shouldNotSee.containsKey(entry.key())); - Assertions.assertFalse(seen.contains(entry.key())); -// Sets.SetView common = Sets.intersection(shouldNotSee.get(entry.key()), seen); - Set common = shouldNotSee.get(entry.key()); - common.retainAll(seen); - if (common.size() > 0) { - Assertions.assertTrue(false, "The entries " + common + " must be emitted before " + entry.key()); - } - seen.add(entry.key()); - group2.reportCompletion(entry); - } - - Assertions.assertEquals(12, seen.size()); // 2 groups each with 6 nodes - Set expectedToSee = new HashSet<>(); - expectedToSee.addAll(Arrays.asList(new String[]{"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L"})); -// Sets.SetView diff = Sets.difference(seen, expectedToSee); - seen.removeAll(expectedToSee); - Assertions.assertEquals(0, seen.size()); - } - - @Test - public void testTaskGroupInvocationShouldInvokePostRunDependentTaskGroup() { - // Prepare group-1 - // - /** - * - * |------------------->B------------| - * | | - * | ↓ - * F ------->C----------->A - * | | ^ [group-1] - * | | | - * |------------>E | - * | | - * | | - * ------->D------------- - */ - final LinkedList group1Items = new LinkedList<>(); - final TaskGroup group1 = createSampleTaskGroup("A", "B", - "C", "D", - "E", "F", - group1Items); - - // Prepare group-2 - // - /** - * - * |------------------->H------------| - * | | - * | ↓ - * L ------->I----------->G - * | | ^ [group-2] - * | | | - * |------------>K | - * | | - * | | - * ------->J------------- - */ - final LinkedList group2Items = new LinkedList<>(); - final TaskGroup group2 = createSampleTaskGroup("G", "H", - "I", "J", - "K", "L", - group2Items); - - // Add group-2 as group-1's "post run" dependent - // - /** - * - * |------------------->H------------| - * | | - * --------------->L | - * | | ↓ - * | |---L |------->I---------->G - * | | | | ^ - * | | | | | [group-2] - * | | |------------>K | - * | | | | - * | | | | - * Proxy F" | ------->J------------- - * | | - * | | |------------------->B------------| - * | | | | - * | | | | - * | |------->F ↓ - * | | ------->C--------->A - * |------------------->F | ^ - * | | | [group-1] - * |------------>E | - * | | - * | | - * ------->D------------ - */ - - group1.addPostRunDependentTaskGroup(group2); - - group1Items.addAll(group2Items); - - // Invocation of group-1 should run group-1 and it's "post run" dependent group-2 - // - group1.invokeAsync(group1.newInvocationContext()) - .subscribe( - value -> { - StringIndexable stringIndexable = toStringIndexable(value); - Assertions.assertTrue(group1Items.contains(stringIndexable.str())); - group1Items.remove(stringIndexable.str()); - }, throwable -> { - } - ); - - Assertions.assertEquals(0, group1Items.size()); - - Map> shouldNotSee = new HashMap<>(); - // NotSeen entries for group-1 - shouldNotSee.put("A", new HashSet()); - shouldNotSee.get("A").addAll(Arrays.asList(new String[]{"B", "C", "D", "E", "F", "proxy-F"})); - - shouldNotSee.put("B", new HashSet()); - shouldNotSee.get("B").addAll(Arrays.asList(new String[]{"F", "proxy-F"})); - - shouldNotSee.put("C", new HashSet()); - shouldNotSee.get("C").addAll(Arrays.asList(new String[]{"E", "F", "proxy-F"})); - - shouldNotSee.put("D", new HashSet()); - shouldNotSee.get("D").addAll(Arrays.asList(new String[]{"E", "F", "proxy-F"})); - - shouldNotSee.put("E", new HashSet()); - shouldNotSee.get("E").addAll(Arrays.asList(new String[]{"F", "proxy-F"})); - - shouldNotSee.put("F", new HashSet()); - shouldNotSee.get("F").addAll(Arrays.asList(new String[]{"proxy-F"})); - // NotSeen entries for nodes in Group-2 - // - shouldNotSee.put("G", new HashSet()); - shouldNotSee.get("G").addAll(Arrays.asList(new String[]{"H", "I", "J", "K", "L", "proxy-F"})); - - shouldNotSee.put("H", new HashSet()); - shouldNotSee.get("H").addAll(Arrays.asList(new String[]{"L", "proxy-F"})); - - shouldNotSee.put("I", new HashSet()); - shouldNotSee.get("I").addAll(Arrays.asList(new String[]{"K", "L", "proxy-F"})); - - shouldNotSee.put("J", new HashSet()); - shouldNotSee.get("J").addAll(Arrays.asList(new String[]{"K", "L", "proxy-F"})); - - shouldNotSee.put("K", new HashSet()); - shouldNotSee.get("K").addAll(Arrays.asList(new String[]{"L", "proxy-F"})); - - shouldNotSee.put("L", new HashSet()); - shouldNotSee.get("L").addAll(Arrays.asList(new String[]{"proxy-F"})); - // NotSeen entries for proxies - shouldNotSee.put("proxy-F", new HashSet()); - shouldNotSee.get("proxy-F").addAll(Arrays.asList(new String[]{})); - - Set seen = new HashSet<>(); - // Test invocation order for "group-1 proxy" - // - group1.proxyTaskGroupWrapper.taskGroup().prepareForEnumeration(); - for (TaskGroupEntry entry = group1.proxyTaskGroupWrapper.taskGroup().getNext(); - entry != null; - entry = group1.proxyTaskGroupWrapper.taskGroup().getNext()) { - Assertions.assertTrue(shouldNotSee.containsKey(entry.key())); - Assertions.assertFalse(seen.contains(entry.key())); -// Sets.SetView common = Sets.intersection(shouldNotSee.get(entry.key()), seen); - Set common = shouldNotSee.get(entry.key()); - common.retainAll(seen); - if (common.size() > 0) { - Assertions.assertTrue(false, "The entries " + common + " must be emitted before " + entry.key()); - } - seen.add(entry.key()); - group1.proxyTaskGroupWrapper.taskGroup().reportCompletion(entry); - } - - Assertions.assertEquals(13, seen.size()); // 2 groups each with 6 nodes + 1 proxy (proxy-F) - Set expectedToSee = new HashSet<>(); - expectedToSee.addAll(Arrays.asList(new String[]{"A", "B", "C", "D", - "E", "F", "G", "H", - "I", "J", "K", "L", - "proxy-F"})); -// Sets.SetView diff = Sets.difference(seen, expectedToSee); - seen.removeAll(expectedToSee); - Assertions.assertEquals(0, seen.size()); - - - group1.invokeAsync(group1.newInvocationContext()) - .subscribe(indexable -> System.out.println(indexable.key())); - } - - @Test - public void testPostRunTaskGroupInvocationShouldInvokeDependencyTaskGroup() { - // Prepare group-1 - // - /** - * - * |------------------->B------------| - * | | - * | ↓ - * F ------->C----------->A - * | | ^ [group-1] - * | | | - * |------------>E | - * | | - * | | - * ------->D------------- - */ - final LinkedList group1Items = new LinkedList<>(); - final TaskGroup group1 = createSampleTaskGroup("A", "B", - "C", "D", - "E", "F", - group1Items); - - // Prepare group-2 - // - /** - * - * |------------------->H------------| - * | | - * | ↓ - * L ------->I----------->G - * | | ^ [group-2] - * | | | - * |------------>K | - * | | - * | | - * ------->J------------- - */ - final List group2Items = new ArrayList<>(); - final TaskGroup group2 = createSampleTaskGroup("G", "H", - "I", "J", - "K", "L", - group2Items); - - // Add group-2 as group-1's "post run" dependent - // - /** - * - * |------------------->H------------| - * | | - * --------------->L | - * | | ↓ - * | |---L |------->I---------->G - * | | | | ^ - * | | | | | [group-2] - * | | |------------>K | - * | | | | - * | | | | - * Proxy F" | ------->J------------- - * | | - * | | |------------------->B------------| - * | | | | - * | | | | - * | |------->F ↓ - * | | ------->C--------->A - * |------------------->F | ^ - * | | | [group-1] - * |------------>E | - * | | - * | | - * ------->D------------ - */ - - group1.addPostRunDependentTaskGroup(group2); - - group2Items.addAll(group1Items); - - // Invocation of group-2 should run group-2 and group-1 - // - group2.invokeAsync(group2.newInvocationContext()) - .subscribe(value -> { - StringIndexable stringIndexable = toStringIndexable(value); - Assertions.assertTrue(group2Items.contains(stringIndexable.str())); - group2Items.remove(stringIndexable.str()); - }); - - Assertions.assertEquals(0, group2Items.size()); - - Map> shouldNotSee = new HashMap<>(); - // NotSeen entries for group-1 - shouldNotSee.put("A", new HashSet()); - shouldNotSee.get("A").addAll(Arrays.asList(new String[]{"B", "C", "D", "E", "F", "proxy-F"})); - - shouldNotSee.put("B", new HashSet()); - shouldNotSee.get("B").addAll(Arrays.asList(new String[]{"F", "proxy-F"})); - - shouldNotSee.put("C", new HashSet()); - shouldNotSee.get("C").addAll(Arrays.asList(new String[]{"E", "F", "proxy-F"})); - - shouldNotSee.put("D", new HashSet()); - shouldNotSee.get("D").addAll(Arrays.asList(new String[]{"E", "F", "proxy-F"})); - - shouldNotSee.put("E", new HashSet()); - shouldNotSee.get("E").addAll(Arrays.asList(new String[]{"F", "proxy-F"})); - - shouldNotSee.put("F", new HashSet()); - shouldNotSee.get("F").addAll(Arrays.asList(new String[]{"proxy-F"})); - // NotSeen entries for nodes in Group-2 - // - shouldNotSee.put("G", new HashSet()); - shouldNotSee.get("G").addAll(Arrays.asList(new String[]{"H", "I", "J", "K", "L", "proxy-F"})); - - shouldNotSee.put("H", new HashSet()); - shouldNotSee.get("H").addAll(Arrays.asList(new String[]{"L", "proxy-F"})); - - shouldNotSee.put("I", new HashSet()); - shouldNotSee.get("I").addAll(Arrays.asList(new String[]{"K", "L", "proxy-F"})); - - shouldNotSee.put("J", new HashSet()); - shouldNotSee.get("J").addAll(Arrays.asList(new String[]{"K", "L", "proxy-F"})); - - shouldNotSee.put("K", new HashSet()); - shouldNotSee.get("K").addAll(Arrays.asList(new String[]{"L", "proxy-F"})); - - shouldNotSee.put("L", new HashSet()); - shouldNotSee.get("L").addAll(Arrays.asList(new String[]{"proxy-F"})); - // NotSeen entries for proxies - shouldNotSee.put("proxy-F", new HashSet()); - shouldNotSee.get("proxy-F").addAll(Arrays.asList(new String[]{})); - - Set seen = new HashSet<>(); - // Test invocation order for "group-2 proxy" - // - group2.prepareForEnumeration(); - for (TaskGroupEntry entry = group2.getNext(); entry != null; entry = group2.getNext()) { - Assertions.assertTrue(shouldNotSee.containsKey(entry.key())); - Assertions.assertFalse(seen.contains(entry.key())); -// Sets.SetView common = Sets.intersection(shouldNotSee.get(entry.key()), seen); - Set common = shouldNotSee.get(entry.key()); - common.retainAll(seen); - if (common.size() > 0) { - Assertions.assertTrue(false, "The entries " + common + " must be emitted before " + entry.key()); - } - seen.add(entry.key()); - group2.reportCompletion(entry); - } - - Assertions.assertEquals(12, seen.size()); // 2 groups each with 6 nodes no proxy - Set expectedToSee = new HashSet<>(); - expectedToSee.addAll(Arrays.asList(new String[]{"A", "B", "C", "D", - "E", "F", "G", "H", - "I", "J", "K", "L"})); -// Sets.SetView diff = Sets.difference(seen, expectedToSee); - seen.removeAll(expectedToSee); - Assertions.assertEquals(0, seen.size()); - } - - @Test - public void testParentReassignmentUponProxyTaskGroupActivation() { - // Prepare group-1 - // - /** - * - * |------------------->B------------| - * | | - * | ↓ - * F ------->C----------->A - * | | ^ [group-1] - * | | | - * |------------>E | - * | | - * | | - * ------->D------------- - */ - final LinkedList group1Items = new LinkedList<>(); - final TaskGroup group1 = createSampleTaskGroup("A", "B", - "C", "D", - "E", "F", - group1Items); - - // Prepare group-2 - // - /** - * - * |------------------->H------------| - * | | - * | ↓ - * L ------->I----------->G - * | | ^ [group-2] - * | | | - * |------------>K | - * | | - * | | - * ------->J------------- - */ - final List group2Items = new ArrayList<>(); - final TaskGroup group2 = createSampleTaskGroup("G", "H", - "I", "J", - "K", "L", - group2Items); - - // Make group-2 as group-1's parent by adding group-1 as group-2's dependency. - // - /** - * - * |------------------->H------------| - * | | - * | ↓ - * |---L ------->I----------->G - * | | | ^ [group-2] - * | | | | - * | |------------>K | - * | | | - * | | | - * | ------->J------------- - * | - * | |------------------->B------------| - * | | | - * | | ↓ - * |------->F ------->C---------->A - * | | ^ - * | | | [group-1] - * |------------>E | - * | | - * | | - * ------->D------------ - */ - - group2.addDependencyTaskGroup(group1); - - // Check parent - Assertions.assertEquals(1, group1.parentDAGs.size()); - Assertions.assertTrue(group1.parentDAGs.contains(group2)); - - // Prepare group-3 - // - /** - * - * |------------------->N------------| - * | | - * | ↓ - * R ------->O----------->M - * | | ^ [group-3] - * | | | - * |----------->Q | - * | | - * | | - * ------->P------------- - */ - - final LinkedList group3Items = new LinkedList<>(); - final TaskGroup group3 = createSampleTaskGroup("M", "N", - "O", "P", - "Q", "R", - group3Items); - - // Make group-3 as group-1's 'post-run" dependent. This activate proxy group, should do parent re-assignment - // i.e. the parent "group-2" of "group-1" will become parent of "group-1's proxy". - // - /** - * [group-2] - * - * |------------------->H------------| - * | | - * ------L |------->I---------->G |------------------->B-----------| - * | | | ^ | | - * | | | | | ↓ - * | |------------>K | | ------>C---------->A - * | | | |------------------->F | ^ [group-1] - * | | | | ------->F | | - * | ------->J------------- | | |------------>E | - * | | | | | - * | | | | | - * | | | ------->D----------- - * |-------------------------------------------->Proxy F" | - * | | |------------------->N------------| - * | | | | - * | | | ↓ - * | --------R ------->O----------->M - * |------------------>R | ^ [group-3] - * | | | - * |----------->Q | - * | | - * | | - * ------->P----------- - * - */ - - group1.addPostRunDependentTaskGroup(group3); - - // Check parent reassignment - // - Assertions.assertEquals(2, group1.parentDAGs.size()); - Assertions.assertTrue(group1.parentDAGs.contains(group3)); - Assertions.assertTrue(group1.parentDAGs.contains(group1.proxyTaskGroupWrapper.taskGroup())); - Assertions.assertEquals(1, group1.proxyTaskGroupWrapper.taskGroup().parentDAGs.size()); - Assertions.assertTrue(group1.proxyTaskGroupWrapper.taskGroup().parentDAGs.contains(group2)); - - Map> shouldNotSee = new HashMap<>(); - // NotSeen entries for group-1 - shouldNotSee.put("A", new HashSet()); - shouldNotSee.get("A").addAll(Arrays.asList(new String[]{"B", "C", "D", "E", "F", "proxy-F", "L"})); - - shouldNotSee.put("B", new HashSet()); - shouldNotSee.get("B").addAll(Arrays.asList(new String[]{"F", "proxy-F", "L"})); - - shouldNotSee.put("C", new HashSet()); - shouldNotSee.get("C").addAll(Arrays.asList(new String[]{"E", "F", "proxy-F", "L"})); - - shouldNotSee.put("D", new HashSet()); - shouldNotSee.get("D").addAll(Arrays.asList(new String[]{"E", "F", "proxy-F", "L"})); - - shouldNotSee.put("E", new HashSet()); - shouldNotSee.get("E").addAll(Arrays.asList(new String[]{"F", "proxy-F", "L"})); - - shouldNotSee.put("F", new HashSet()); - shouldNotSee.get("F").addAll(Arrays.asList(new String[]{"proxy-F", "L"})); - // NotSeen entries for nodes in Group-3 - // - shouldNotSee.put("M", new HashSet()); - shouldNotSee.get("M").addAll(Arrays.asList(new String[]{"N", "O", "P", "Q", "R", "proxy-F", "L"})); - - shouldNotSee.put("N", new HashSet()); - shouldNotSee.get("N").addAll(Arrays.asList(new String[]{"R", "proxy-F", "L"})); - - shouldNotSee.put("O", new HashSet()); - shouldNotSee.get("O").addAll(Arrays.asList(new String[]{"Q", "R", "L"})); - - shouldNotSee.put("P", new HashSet()); - shouldNotSee.get("P").addAll(Arrays.asList(new String[]{"Q", "R", "proxy-F", "L"})); - - shouldNotSee.put("Q", new HashSet()); - shouldNotSee.get("Q").addAll(Arrays.asList(new String[]{"R", "proxy-F", "L"})); - - shouldNotSee.put("R", new HashSet()); - shouldNotSee.get("R").addAll(Arrays.asList(new String[]{"proxy-F", "L"})); - // NotSeen entries for nodes in Group-2 - // - shouldNotSee.put("G", new HashSet()); - shouldNotSee.get("G").addAll(Arrays.asList(new String[]{"H", "I", "J", "K", "L"})); - - shouldNotSee.put("H", new HashSet()); - shouldNotSee.get("H").addAll(Arrays.asList(new String[]{"L"})); - - shouldNotSee.put("I", new HashSet()); - shouldNotSee.get("I").addAll(Arrays.asList(new String[]{"K", "L"})); - - shouldNotSee.put("J", new HashSet()); - shouldNotSee.get("J").addAll(Arrays.asList(new String[]{"K", "L"})); - - shouldNotSee.put("K", new HashSet()); - shouldNotSee.get("K").addAll(Arrays.asList(new String[]{"L"})); - - shouldNotSee.put("L", new HashSet()); - shouldNotSee.get("L").addAll(Arrays.asList(new String[]{})); - // NotSeen entries for proxies - shouldNotSee.put("proxy-F", new HashSet()); - shouldNotSee.get("proxy-F").addAll(Arrays.asList(new String[]{"L"})); - - Set seen = new HashSet<>(); - // Test invocation order for "group-2" - // - group2.prepareForEnumeration(); - for (TaskGroupEntry entry = group2.getNext(); entry != null; entry = group2.getNext()) { - Assertions.assertTrue(shouldNotSee.containsKey(entry.key())); - Assertions.assertFalse(seen.contains(entry.key())); -// Sets.SetView common = Sets.intersection(shouldNotSee.get(entry.key()), seen); - Set common = shouldNotSee.get(entry.key()); - common.retainAll(seen); - if (common.size() > 0) { - Assertions.assertTrue(false, "The entries " + common + " must be emitted before " + entry.key()); - } - seen.add(entry.key()); - group2.reportCompletion(entry); - } - - Assertions.assertEquals(19, seen.size()); // 3 groups each with 6 nodes + one proxy (proxy-F) - Set expectedToSee = new HashSet<>(); - expectedToSee.addAll(Arrays.asList(new String[]{"A", "B", "C", "D", - "E", "F", "G", "H", - "I", "J", "K", "L", - "M", "N", "O", "P", - "Q", "proxy-F", "R"})); -// Sets.SetView diff = Sets.difference(seen, expectedToSee); - seen.removeAll(expectedToSee); - Assertions.assertEquals(0, seen.size()); - - // Test invocation order for "group-1 proxy" - // - seen.clear(); - TaskGroup group1Proxy = group1.proxyTaskGroupWrapper.taskGroup(); - group1Proxy.prepareForEnumeration(); - for (TaskGroupEntry entry = group1Proxy.getNext(); entry != null; entry = group1Proxy.getNext()) { - Assertions.assertTrue(shouldNotSee.containsKey(entry.key())); - Assertions.assertFalse(seen.contains(entry.key())); -// Sets.SetView common = Sets.intersection(shouldNotSee.get(entry.key()), seen); - Set common = shouldNotSee.get(entry.key()); - common.retainAll(seen); - if (common.size() > 0) { - Assertions.assertTrue(false, "The entries " + common + " must be emitted before " + entry.key()); - } - seen.add(entry.key()); - group1Proxy.reportCompletion(entry); - } - - Assertions.assertEquals(13, seen.size()); // 2 groups each with 6 nodes + one proxy (proxy-F) - expectedToSee.clear(); - expectedToSee.addAll(Arrays.asList(new String[]{"A", "B", "C", "D", - "E", "F", "M", "N", - "O", "P", "Q", "proxy-F", - "R"})); - } - - @Test - public void testParentProxyReassignmentUponProxyTaskGroupActivation() { - // Prepare group-1 - // - /** - * - * |------------------->B------------| - * | | - * | ↓ - * F ------->C----------->A - * | | ^ [group-1] - * | | | - * |------------>E | - * | | - * | | - * ------->D------------- - */ - final LinkedList group1Items = new LinkedList<>(); - final TaskGroup group1 = createSampleTaskGroup("A", "B", - "C", "D", - "E", "F", - group1Items); - - // Prepare group-2 - // - /** - * - * |------------------->H------------| - * | | - * | ↓ - * L ------->I----------->G - * | | ^ [group-2] - * | | | - * |------------>K | - * | | - * | | - * ------->J------------- - */ - final List group2Items = new ArrayList<>(); - final TaskGroup group2 = createSampleTaskGroup("G", "H", - "I", "J", - "K", "L", - group2Items); - - // Make group-2 as group-1's parent by adding group-1 as group-2's dependency. - // - /** - * - * |------------------->H------------| - * | | - * | ↓ - * |---L ------->I----------->G - * | | | ^ [group-2] - * | | | | - * | |------------>K | - * | | | - * | | | - * | ------->J------------- - * | - * | |------------------->B------------| - * | | | - * | | ↓ - * |------->F ------->C---------->A - * | | ^ - * | | | [group-1] - * |------------>E | - * | | - * | | - * ------->D------------ - */ - - group2.addDependencyTaskGroup(group1); - - // Check parent - Assertions.assertEquals(1, group1.parentDAGs.size()); - Assertions.assertTrue(group1.parentDAGs.contains(group2)); - - // Prepare group-3 - // - /** - * - * |------------------->N------------| - * | | - * | ↓ - * R ------->O----------->M - * | | ^ [group-3] - * | | | - * |----------->Q | - * | | - * | | - * ------->P------------- - */ - - final LinkedList group3Items = new LinkedList<>(); - final TaskGroup group3 = createSampleTaskGroup("M", "N", - "O", "P", - "Q", "R", - group3Items); - - // Make group-3 (Root-R) as group-1's (Root-F) 'post-run" dependent. This activate "group-1 proxy group", - // should do parent re-assignment i.e. the parent "group-2" of "group-1" will become parent of "group-1's proxy". - // - /** - * [group-2] - * - * |------------------->H------------| - * | | - * ------L |------->I---------->G |------------------->B-----------| - * | | | ^ | | - * | | | | | ↓ - * | |------------>K | | ------>C---------->A - * | | | |------------------->F | ^ [group-1] - * | | | | ------->F | | - * | ------->J------------- | | |------------>E | - * | | | | | - * | | | | | - * | | | ------->D----------- - * |-------------------------------------------->Proxy F" | - * | | |------------------->N------------| - * | | | | - * | | | ↓ - * | --------R ------->O----------->M - * |------------------>R | ^ [group-3] - * | | | - * |----------->Q | - * | | - * | | - * ------->P----------- - * - */ - - group1.addPostRunDependentTaskGroup(group3); - - // Check parent reassignment - // - Assertions.assertEquals(2, group1.parentDAGs.size()); - Assertions.assertTrue(group1.parentDAGs.contains(group3)); - Assertions.assertTrue(group1.parentDAGs.contains(group1.proxyTaskGroupWrapper.taskGroup())); - Assertions.assertEquals(1, group1.proxyTaskGroupWrapper.taskGroup().parentDAGs.size()); - Assertions.assertTrue(group1.proxyTaskGroupWrapper.taskGroup().parentDAGs.contains(group2)); - - - // Prepare group-4 - // - /** - * - * |------------------->T------------| - * | | - * | ↓ - * X ------->U----------->S - * | | ^ [group-4] - * | | | - * |----------->W | - * | | - * | | - * ------->V------------- - */ - - final LinkedList group4Items = new LinkedList<>(); - final TaskGroup group4 = createSampleTaskGroup("S", "T", - "U", "V", - "W", "X", - group4Items); - - // Prepare group-5 - // - /** - * - * |------------------->2------------| - * | | - * | ↓ - * 6 ------->3----------->1 - * | | ^ [group-5] - * | | | - * |----------->5 | - * | | - * | | - * ------->4------------- - */ - - final LinkedList group5Items = new LinkedList<>(); - final TaskGroup group5 = createSampleTaskGroup("1", "2", - "3", "4", - "5", "6", - group5Items); - - // Make group-5 as group-4's 'post-run" dependent. This activates "group-4 proxy group". - - /** - * - * |------------------->2------------| - * | | - * --------------->6 ↓ - * | |---6 |------>3----------->1 - * | | | | ^ [group-5] - * | | | | | - * | | |------------>5 | - * | | | | - * | | | | - * Proxy X" | ------->4------------- - * | | - * | | |------------------->T------------| - * | | | | - * | | | ↓ - * | |------->X ------->U----------->S - * |------------------->X | ^ [group-4] - * | | | - * |------------>W | - * | | - * | | - * ------->V------------ - */ - - group4.addPostRunDependentTaskGroup(group5); - - // Make group-4 (Root-x) as group-1's (Root-F) 'post-run" dependent. - // - /** - * - * - * |------------------->2------------| - * | | - * --------------->6 ↓ - * | |---6 |------>3----------->1 - * | | | | ^ [group-5] - * | | | | | - * | | |------------>5 | - * | | | | - * | | | | - * ------------->Proxy X" | ------->4------------- - * | | | - * | | | |------------------->T------------| - * | | | | | - * | | | | ↓ - * | | |------->X ------->U----------->S - * | ------------------->X | ^ [group-4] - * | -----------------------------X | | - * | | |------------>W | - * | | | | - * | | | | - * | | ------->V------------- - * | | - * | | - * | | - * | | - * | | - * | | - * [group-2] | | - * | | - * |------------------->H------------| | | - * | ↓ | | - * ------L |------->I---------->G | | |-------------------->B----------| - * | | | ^ | | | | - * | | | | | | | ↓ - * | |------------>K | | -------->F ------->C--------->A - * | | | |------------------->F | ^ [group-1] - * | | | | ------->F | | - * | ------->J------------- | | |------------>E | - * | | | | | - * | | | | | - * | | | ------->D----------- - * |-------------------------------------------->Proxy F" | - * | | |--------------------->N----------| - * | | | | - * | | | ↓ - * | --------R --------->O--------->M - * |------------------>R | ^ [group-3] - * | | | - * |----------->Q | - * | | - * | | - * -------->P---------- - * - */ - - group1.addPostRunDependentTaskGroup(group4); - - Map> shouldNotSee = new HashMap<>(); - // NotSeen entries for nodes in Group-1 - // - shouldNotSee.put("A", new HashSet()); - shouldNotSee.get("A").addAll(Arrays.asList(new String[]{"B", "C", "D", "E", "F", "proxy-F", "L"})); - - shouldNotSee.put("B", new HashSet()); - shouldNotSee.get("B").addAll(Arrays.asList(new String[]{"F", "proxy-F", "L"})); - - shouldNotSee.put("C", new HashSet()); - shouldNotSee.get("C").addAll(Arrays.asList(new String[]{"E", "F", "proxy-F", "L"})); - - shouldNotSee.put("D", new HashSet()); - shouldNotSee.get("D").addAll(Arrays.asList(new String[]{"E", "F", "proxy-F", "L"})); - - shouldNotSee.put("E", new HashSet()); - shouldNotSee.get("E").addAll(Arrays.asList(new String[]{"F", "proxy-F", "L"})); - - shouldNotSee.put("F", new HashSet()); - shouldNotSee.get("F").addAll(Arrays.asList(new String[]{"proxy-F", "L"})); - // NotSeen entries for nodes in Group-3 - // - shouldNotSee.put("M", new HashSet()); - shouldNotSee.get("M").addAll(Arrays.asList(new String[]{"N", "O", "P", "Q", "R", "proxy-F", "L"})); - - shouldNotSee.put("N", new HashSet()); - shouldNotSee.get("N").addAll(Arrays.asList(new String[]{"R", "proxy-F", "L"})); - - shouldNotSee.put("O", new HashSet()); - shouldNotSee.get("O").addAll(Arrays.asList(new String[]{"Q", "R", "L"})); - - shouldNotSee.put("P", new HashSet()); - shouldNotSee.get("P").addAll(Arrays.asList(new String[]{"Q", "R", "proxy-F", "L"})); - - shouldNotSee.put("Q", new HashSet()); - shouldNotSee.get("Q").addAll(Arrays.asList(new String[]{"R", "proxy-F", "L"})); - - shouldNotSee.put("R", new HashSet()); - shouldNotSee.get("R").addAll(Arrays.asList(new String[]{"proxy-F", "L"})); - // NotSeen entries for nodes in Group-4 - // - shouldNotSee.put("S", new HashSet()); - shouldNotSee.get("S").addAll(Arrays.asList(new String[]{"T", "U", "V", "W", "X", "proxy-X", "proxy-F", "L"})); - - shouldNotSee.put("T", new HashSet()); - shouldNotSee.get("T").addAll(Arrays.asList(new String[]{"X", "proxy-X", "proxy-F", "L"})); - - shouldNotSee.put("U", new HashSet()); - shouldNotSee.get("U").addAll(Arrays.asList(new String[]{"W", "X", "proxy-X", "proxy-F", "L"})); - - shouldNotSee.put("V", new HashSet()); - shouldNotSee.get("V").addAll(Arrays.asList(new String[]{"W", "X", "proxy-X", "proxy-F", "L"})); - - shouldNotSee.put("W", new HashSet()); - shouldNotSee.get("W").addAll(Arrays.asList(new String[]{"X", "proxy-X", "proxy-F", "L"})); - - shouldNotSee.put("X", new HashSet()); - shouldNotSee.get("X").addAll(Arrays.asList(new String[]{"proxy-X", "proxy-F", "L"})); - // NotSeen entries for nodes in Group-5 - // - shouldNotSee.put("1", new HashSet()); - shouldNotSee.get("1").addAll(Arrays.asList(new String[]{"2", "3", "4", "5", "6", "proxy-X", "proxy-F", "L"})); - - shouldNotSee.put("2", new HashSet()); - shouldNotSee.get("2").addAll(Arrays.asList(new String[]{"6", "proxy-X", "proxy-F", "L"})); - - shouldNotSee.put("3", new HashSet()); - shouldNotSee.get("3").addAll(Arrays.asList(new String[]{"5", "6", "proxy-X", "proxy-F", "L"})); - - shouldNotSee.put("4", new HashSet()); - shouldNotSee.get("4").addAll(Arrays.asList(new String[]{"5", "6", "proxy-X", "proxy-F", "L"})); - - shouldNotSee.put("5", new HashSet()); - shouldNotSee.get("5").addAll(Arrays.asList(new String[]{"6", "proxy-X", "proxy-F", "L"})); - - shouldNotSee.put("6", new HashSet()); - shouldNotSee.get("6").addAll(Arrays.asList(new String[]{"proxy-X", "proxy-F", "L"})); - // NotSeen entries for nodes in Group-2 - // - shouldNotSee.put("G", new HashSet()); - shouldNotSee.get("G").addAll(Arrays.asList(new String[]{"H", "I", "J", "K", "L"})); - - shouldNotSee.put("H", new HashSet()); - shouldNotSee.get("H").addAll(Arrays.asList(new String[]{"L"})); - - shouldNotSee.put("I", new HashSet()); - shouldNotSee.get("I").addAll(Arrays.asList(new String[]{"K", "L"})); - - shouldNotSee.put("J", new HashSet()); - shouldNotSee.get("J").addAll(Arrays.asList(new String[]{"K", "L"})); - - shouldNotSee.put("K", new HashSet()); - shouldNotSee.get("K").addAll(Arrays.asList(new String[]{"L"})); - - shouldNotSee.put("L", new HashSet()); - shouldNotSee.get("L").addAll(Arrays.asList(new String[]{})); - - // NotSeen entries for proxies - shouldNotSee.put("proxy-F", new HashSet()); - shouldNotSee.get("proxy-F").addAll(Arrays.asList(new String[]{"L"})); - - shouldNotSee.put("proxy-X", new HashSet()); - shouldNotSee.get("proxy-X").addAll(Arrays.asList(new String[]{"proxy-F", "L"})); - - // Test invocation order for group-1 (which gets delegated to group-1's proxy) - // - // - Set seen = new HashSet<>(); - TaskGroup group1Proxy = group1.proxyTaskGroupWrapper.taskGroup(); - group1Proxy.prepareForEnumeration(); - for (TaskGroupEntry entry = group1Proxy.getNext(); entry != null; entry = group1Proxy.getNext()) { - Assertions.assertTrue(shouldNotSee.containsKey(entry.key())); - Assertions.assertFalse(seen.contains(entry.key())); -// Sets.SetView common = Sets.intersection(shouldNotSee.get(entry.key()), seen); - Set common = shouldNotSee.get(entry.key()); - common.retainAll(seen); - if (common.size() > 0) { - Assertions.assertTrue(false, "The entries " + common + " must be emitted before " + entry.key()); - } - seen.add(entry.key()); - group1Proxy.reportCompletion(entry); - } - - Assertions.assertEquals(26, seen.size()); // 4 groups each with 6 nodes + two proxy (proxy-F and proxy-X) - Set expectedToSee = new HashSet<>(); - expectedToSee.addAll(Arrays.asList(new String[]{"A", "B", "C", "D", - "E", "F", "M", "N", - "O", "P", "Q", "R", - "S", "T", "U", "V", - "W", "X", "proxy-X", - "1", "proxy-F", "2", - "3", "4", "5", "6"})); -// Sets.SetView diff = Sets.difference(seen, expectedToSee); - seen.removeAll(expectedToSee); - Assertions.assertEquals(0, seen.size()); - - // Test invocation order for group-1 (which gets delegated to group-1's proxy). - // This cause -> group-1, group-4 and group-5 to invoked - // - seen.clear(); - TaskGroup group4Proxy = group4.proxyTaskGroupWrapper.taskGroup(); - group4Proxy.prepareForEnumeration(); - for (TaskGroupEntry entry = group4Proxy.getNext(); entry != null; entry = group4Proxy.getNext()) { - Assertions.assertTrue(shouldNotSee.containsKey(entry.key())); - Assertions.assertFalse(seen.contains(entry.key())); -// Sets.SetView common = Sets.intersection(shouldNotSee.get(entry.key()), seen); - Set common = shouldNotSee.get(entry.key()); - common.retainAll(seen); - if (common.size() > 0) { - Assertions.assertTrue(false, "The entries " + common + " must be emitted before " + entry.key()); - } - seen.add(entry.key()); - group4Proxy.reportCompletion(entry); - } - Assertions.assertEquals(19, seen.size()); // 3 groups each with 6 nodes + one proxy - - expectedToSee.clear(); - expectedToSee.addAll(Arrays.asList(new String[]{"A", "B", "C", "D", - "E", "F", "S", "T", - "U", "V", "W", "X", - "proxy-X", "1", "2", - "3", "4", "5", "6"})); - -// diff = Sets.difference(seen, expectedToSee); - seen.removeAll(expectedToSee); - Assertions.assertEquals(0, seen.size()); - - // Test invocation order for group-2. - // This cause -> all groups to be invoked, group-1, group-3, group-4 and group-5 to invoked - // - seen.clear(); - group2.prepareForEnumeration(); - for (TaskGroupEntry entry = group2.getNext(); entry != null; entry = group2.getNext()) { - Assertions.assertTrue(shouldNotSee.containsKey(entry.key())); - Assertions.assertFalse(seen.contains(entry.key())); -// Sets.SetView common = Sets.intersection(shouldNotSee.get(entry.key()), seen); - Set common = shouldNotSee.get(entry.key()); - common.retainAll(seen); - if (common.size() > 0) { - Assertions.assertTrue(false, "The entries " + common + " must be emitted before " + entry.key()); - } - seen.add(entry.key()); - group2.reportCompletion(entry); - } - - expectedToSee.clear(); - expectedToSee.addAll(Arrays.asList(new String[]{"A", "B", "C", "D", - "E", "F", "G", "H", - "I", "J", "K", "L", - "M", "N", "O", "P", - "Q", "R", "S", "T", - "U", "V", "W", "X", - "proxy-X", "1", "proxy-F", "2", "3", - "4", "5", "6"})); - -// diff = Sets.difference(seen, expectedToSee); - seen.removeAll(expectedToSee); - Assertions.assertEquals(0, seen.size()); - } - - @Test - public void canHandleDependenciesAndPostRunDependentsInBeforeGroupInvoke() throws InterruptedException { - final IndexableTaskItem itiA = new IndexableTaskItem("A") { - @Override - protected Mono invokeTaskAsync(TaskGroup.InvocationContext context) { - return this.voidPublisher(); - } - }; - - final int[] beforeGroupInvokeCntB = new int[1]; - final IndexableTaskItem itiB = new IndexableTaskItem("B") { - @Override - public void beforeGroupInvoke() { - beforeGroupInvokeCntB[0]++; - this.addDependency(itiA); - } - - @Override - protected Mono invokeTaskAsync(TaskGroup.InvocationContext context) { - return this.voidPublisher(); - } - }; - - final int[] beforeGroupInvokeCntC = new int[1]; - final IndexableTaskItem itiC = new IndexableTaskItem("C") { - @Override - public void beforeGroupInvoke() { - beforeGroupInvokeCntC[0]++; - this.addPostRunDependent(itiB); - } - - @Override - protected Mono invokeTaskAsync(TaskGroup.InvocationContext context) { - return this.voidPublisher(); - } - }; - - /** - * C" ---------> C - * | ^ - * | | - * | | - * |-----------> B ----> A - */ - - final ArrayList seen = new ArrayList<>(); - CountDownLatch down = new CountDownLatch(1); - itiC.taskGroup() - .invokeAsync(itiC.taskGroup().newInvocationContext()) - .subscribe( - indexable -> seen.add(indexable.key()), - throwable -> down.countDown(), - () -> down.countDown()); - down.await(); - - boolean b1 = seen.equals(new ArrayList<>(Arrays.asList(new String[]{"A", "C", "B", "C"}))); - boolean b2 = seen.equals(new ArrayList<>(Arrays.asList(new String[]{"C", "A", "B", "C"}))); - - if (!b1 && !b2) { - Assertions.assertTrue(false, "Emission order should be either [A, C, B, C] or [C, A, B, C] but got " + seen); - } - - Assertions.assertEquals(beforeGroupInvokeCntB[0], 1); - Assertions.assertEquals(beforeGroupInvokeCntC[0], 1); - - // ------ // - - final IndexableTaskItem itiD = new IndexableTaskItem("D") { - @Override - protected Mono invokeTaskAsync(TaskGroup.InvocationContext context) { - return this.voidPublisher(); - } - }; - - final int[] beforeGroupInvokeCntE = new int[1]; - final IndexableTaskItem itiE = new IndexableTaskItem("E") { - @Override - public void beforeGroupInvoke() { - beforeGroupInvokeCntE[0]++; - this.addPostRunDependent(itiD); - } - - @Override - protected Mono invokeTaskAsync(TaskGroup.InvocationContext context) { - return this.voidPublisher(); - } - }; - - final int[] beforeGroupInvokeCntF = new int[1]; - final IndexableTaskItem itiF = new IndexableTaskItem("F") { - @Override - public void beforeGroupInvoke() { - beforeGroupInvokeCntF[0]++; - this.addDependency(itiE); - } - - @Override - protected Mono invokeTaskAsync(TaskGroup.InvocationContext context) { - return this.voidPublisher(); - } - }; - - /** - * F-------->E" ---------> E - * | ^ - * | | - * | | - * |-----------> D - */ - - final CountDownLatch monitor = new CountDownLatch(1); - seen.clear(); - itiF.taskGroup() - .invokeAsync(itiC.taskGroup().newInvocationContext()) - .subscribe(indexable -> seen.add(indexable.key()), - throwable -> monitor.countDown(), - () -> monitor.countDown()); - - monitor.await(); - - b1 = seen.equals(new ArrayList<>(Arrays.asList(new String[]{"E", "D", "E", "F"}))); - Assertions.assertTrue(b1, "Emission order should be [E, D, E, F] but got " + seen); - - Assertions.assertEquals(beforeGroupInvokeCntE[0], 1); - Assertions.assertEquals(beforeGroupInvokeCntF[0], 1); - } - - private TaskGroup createSampleTaskGroup(String vertex1, - String vertex2, - String vertex3, - String vertex4, - String vertex5, - String vertex6, - List verticesNames) { - verticesNames.add(vertex6); - verticesNames.add(vertex5); - verticesNames.add(vertex4); - verticesNames.add(vertex3); - verticesNames.add(vertex2); - verticesNames.add(vertex1); - - /** - * Creates a task group with following shape. - * - * |------------------->group2------------| - * | | - * | ↓ - * group6 ------->group3--------->group1 - * | | ^ - * | | | - * |-------->group5 | - * | | - * | | - * ------->group4------------- - */ - - TaskGroup group1 = new TaskGroup(vertex1, new StringTaskItem(vertex1)); - TaskGroup group2 = new TaskGroup(vertex2, new StringTaskItem(vertex2)); - TaskGroup group3 = new TaskGroup(vertex3, new StringTaskItem(vertex3)); - TaskGroup group4 = new TaskGroup(vertex4, new StringTaskItem(vertex4)); - TaskGroup group5 = new TaskGroup(vertex5, new StringTaskItem(vertex5)); - TaskGroup group6 = new TaskGroup(vertex6, new StringTaskItem(vertex6)); - - group2.addDependencyTaskGroup(group1); - group3.addDependencyTaskGroup(group1); - group4.addDependencyTaskGroup(group1); - - group5.addDependencyTaskGroup(group3); - group5.addDependencyTaskGroup(group4); - - group6.addDependencyTaskGroup(group2); - group6.addDependencyTaskGroup(group5); - - return group6; - } - - private StringIndexable toStringIndexable(Indexable indexable) { - return (StringIndexable) indexable; - } - - private static class StringTaskItem implements TaskItem { - private final String name; - private StringIndexable producedValue = null; - - StringTaskItem(String name) { - this.name = name; - } - - @Override - public Indexable result() { - return this.producedValue; - } - - @Override - public void beforeGroupInvoke() { - // NOP - } - - @Override - public boolean isHot() { - return false; - } - - @Override - public Mono invokeAsync(final TaskGroup.InvocationContext context) { - this.producedValue = new StringIndexable(this.name); - return Mono.just(this.producedValue).map(stringIndexable -> stringIndexable); - } - - @Override - public Mono invokeAfterPostRunAsync(boolean isGroupFaulted) { - return Mono.empty(); - } - } - - private static class StringIndexable implements Indexable { - private final String str; - - StringIndexable(String str) { - this.str = str; - } - - public String str() { - return this.str; - } - - @Override - public String key() { - return this.str; - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/SandwichImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/SandwichImpl.java deleted file mode 100644 index 3b6a26bf6a3a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/SandwichImpl.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.dag; - -import com.azure.resourcemanager.resources.fluentcore.model.Executable; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.CreatableUpdatableImpl; -import reactor.core.publisher.Mono; - -import java.time.Duration; - -/** - * Implementation of {@link ISandwich} - */ -public class SandwichImpl - extends CreatableUpdatableImpl - implements ISandwich { - /** - * Creates SandwichImpl. - * - * @param name the name of the model - * @param innerObject the inner model object - */ - protected SandwichImpl(String name, SandwichInner innerObject) { - super(name, name, innerObject); - } - - - @Override - public ISandwich withBreadSliceFromStore(Executable breadFetcher) { - this.addDependency(breadFetcher); - return this; - } - - @Override - public Mono createResourceAsync() { - System.out.println("Sandwich(" + this.name() + ")::createResourceAsync() [Creating sandwich]"); - return Mono.just(this) - .delayElement(Duration.ofMillis(250)) - .map(sandwich -> sandwich); - } - - @Override - public boolean isInCreateMode() { - return true; - } - - @Override - protected Mono getInnerAsync() { - return Mono.just(this.innerModel()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/SandwichInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/SandwichInner.java deleted file mode 100644 index ec42771b5b6a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/SandwichInner.java +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.dag; - -/** - * The inner sandwich type. - */ -public final class SandwichInner { -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/utils/AuxiliaryAuthenticationPolicyTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/utils/AuxiliaryAuthenticationPolicyTests.java deleted file mode 100644 index 096616a8aaba..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/utils/AuxiliaryAuthenticationPolicyTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.utils; - -import com.azure.core.credential.AccessToken; -import com.azure.core.credential.TokenCredential; -import com.azure.core.credential.TokenRequestContext; -import com.azure.core.http.HttpMethod; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.HttpPipelineCallContext; -import com.azure.core.http.HttpPipelineNextPolicy; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.management.AzureEnvironment; -import com.azure.resourcemanager.resources.fluentcore.policy.AuxiliaryAuthenticationPolicy; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -import java.time.OffsetDateTime; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -public class AuxiliaryAuthenticationPolicyTests { - static class MockTokenCredential implements TokenCredential { - final AccessToken token; - - MockTokenCredential(String token) { - this.token = new AccessToken(token, OffsetDateTime.MAX); - } - - @Override - public Mono getToken(TokenRequestContext tokenRequestContext) { - return Mono.just(token); - } - } - - static class CheckAuxiliaryAuthenticationHeaderPolicy implements HttpPipelinePolicy { - private static final String AUTHORIZATION_AUXILIARY_HEADER = "x-ms-authorization-auxiliary"; - private static final Pattern SCHEMA_FORMAT = Pattern.compile("Bearer \\S+"); - - @Override - public Mono process(HttpPipelineCallContext context, HttpPipelineNextPolicy next) { - String auxiliaryHeader = context.getHttpRequest().getHeaders().getValue(AUTHORIZATION_AUXILIARY_HEADER); - Assertions.assertTrue(auxiliaryHeader != null && !auxiliaryHeader.isEmpty()); - for (String authentication : auxiliaryHeader.split(",")) { - Matcher m = SCHEMA_FORMAT.matcher(authentication); - Assertions.assertTrue(m.find()); - Assertions.assertEquals(authentication, m.group()); - } - return Mono.empty(); - } - } - - @Test - public void canSetAuxiliaryAuthenticationHeader() { - TokenCredential first = new MockTokenCredential("abc"); - TokenCredential second = new MockTokenCredential("def"); - new HttpPipelineBuilder() - .policies(new AuxiliaryAuthenticationPolicy(AzureEnvironment.AZURE, first, second), new CheckAuxiliaryAuthenticationHeaderPolicy()) - .build() - .send(new HttpRequest(HttpMethod.GET, "https://httpbin.org")) - .block(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/utils/BatchDeletionImplTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/utils/BatchDeletionImplTests.java deleted file mode 100644 index 0041ddad7374..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/utils/BatchDeletionImplTests.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.utils; - -import com.azure.core.management.exception.ManagementException; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.BatchDeletionImpl; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -import java.util.Arrays; -import java.util.List; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; -import java.util.function.BiFunction; -import java.util.stream.Collectors; - -public class BatchDeletionImplTests { - - @Test - public void testBatchDeletion() { - BiFunction> mockDeleteByGroupAndNameAsync = - (rgName, name) -> name.startsWith("invalid") ? Mono.error(new ManagementException("fail on " + name, null)) : Mono.empty(); - - // 1 error - List names = Arrays.asList("valid1", "invalid2", "valid3", "valid4", "valid5"); - List ids = names.stream() - .map(name -> "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/disks/" + name) - .collect(Collectors.toList()); - - Map resultIds = new ConcurrentHashMap<>(); - Flux fluxIds = BatchDeletionImpl.deleteByIdsAsync(ids, mockDeleteByGroupAndNameAsync); - - Assertions.assertThrows(ManagementException.class, () -> { - fluxIds.doOnNext(id -> resultIds.put(id, id)) - .onErrorMap(e -> e) - .blockLast(); - }); - Assertions.assertEquals(4, resultIds.size()); - } - - @Test - public void testBatchDeletionMultipleException() { - BiFunction> mockDeleteByGroupAndNameAsync = - (rgName, name) -> name.startsWith("invalid") ? Mono.error(new ManagementException("fail on " + name, null)) : Mono.empty(); - - // more than 1 errors - List names = Arrays.asList("valid1", "invalid2", "valid3", "invalid4", "valid5"); - List ids = names.stream() - .map(name -> "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/disks/" + name) - .collect(Collectors.toList()); - - Map resultIds = new ConcurrentHashMap<>(); - Flux fluxIds = BatchDeletionImpl.deleteByIdsAsync(ids, mockDeleteByGroupAndNameAsync); - - // reactor.core.Exceptions.CompositeException - Assertions.assertThrows(ManagementException.class, () -> { - fluxIds.doOnNext(id -> resultIds.put(id, id)) - .onErrorMap(e -> e) - .blockLast(); - }); - Assertions.assertEquals(3, resultIds.size()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/utils/PagedConverterTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/utils/PagedConverterTests.java deleted file mode 100644 index 7eda2b26605c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/utils/PagedConverterTests.java +++ /dev/null @@ -1,255 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.utils; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.util.logging.ClientLogger; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; -import reactor.test.StepVerifier; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.concurrent.atomic.AtomicInteger; -import java.util.function.Function; -import java.util.stream.IntStream; - -public class PagedConverterTests { - - private final ClientLogger logger = new ClientLogger(this.getClass()); - - @Test - public void testMapPage() { - PagedFlux pagedFlux = mockPagedFlux("base", 0, 10, 4); - PagedIterable pagedIterable = new PagedIterable<>(pagedFlux); - - PagedIterable convertedPagedIterable = PagedConverter.mapPage(pagedIterable, item -> item + "#"); - - Iterator> iteratorByPage = convertedPagedIterable.iterableByPage().iterator(); - Assertions.assertTrue(iteratorByPage.hasNext()); - PagedResponse page1 = iteratorByPage.next(); - Assertions.assertEquals(4, page1.getValue().size()); - Assertions.assertEquals("base0#", page1.getValue().get(0)); - Assertions.assertEquals("base3#", page1.getValue().get(3)); - Assertions.assertTrue(iteratorByPage.hasNext()); - Assertions.assertEquals(4, iteratorByPage.next().getValue().size()); - Assertions.assertTrue(iteratorByPage.hasNext()); - Assertions.assertEquals(2, iteratorByPage.next().getValue().size()); - Assertions.assertFalse(iteratorByPage.hasNext()); - - Iterator iterator = convertedPagedIterable.iterator(); - Assertions.assertTrue(iterator.hasNext()); - Assertions.assertEquals("base0#", iterator.next()); - for (int i = 1; i < 10; ++i) { - Assertions.assertTrue(iterator.hasNext()); - Assertions.assertEquals("base" + i + "#", iterator.next()); - } - Assertions.assertFalse(iterator.hasNext()); - } - - @Test - public void testMapPageWithPagedIterable() { - PagedFlux pagedFlux = mockPagedFlux("base", 0, 10, 4); - PagedIterable pagedIterable = new PagedIterable<>(pagedFlux); - - PagedIterable convertedPagedIterable = PagedConverter.mapPage(pagedIterable, item -> item + "#"); - - PagedIterable afterMapPage = convertedPagedIterable.mapPage(item -> item + "#"); - Assertions.assertEquals(10, afterMapPage.stream().count()); - } - - @Test - public void testMapPageIterator() { - PagedFlux pagedFlux = mockPagedFlux("base", 0, 10, 4); - PagedFlux convertedPagedFlux = PagedConverter.mapPage(pagedFlux, item -> item + "#"); - - StepVerifier.create(convertedPagedFlux.byPage()) - .expectSubscription() - .expectNextMatches(p -> p.getValue().size() == 4 - && p.getValue().get(0).equals("base0#") - && p.getValue().get(p.getValue().size() - 1).equals("base3#")) - .expectNextMatches(p -> p.getValue().size() == 4) - .expectNextMatches(p -> p.getValue().size() == 2) - .expectComplete() - .verify(); - } - - @Test - public void testFlatMapPage() { - PagedFlux pagedFlux = mockPagedFlux("base", 0, 10, 4); - PagedFlux convertedPagedFlux = PagedConverter.flatMapPage(pagedFlux, item -> Flux.just(item, item + "#")); - StepVerifier.create(convertedPagedFlux.byPage()) - .expectSubscription() - .expectNextMatches(p -> p.getValue().size() == 8 - && p.getValue().get(0).equals("base0") - && p.getValue().get(p.getValue().size() - 1).equals("base3#")) - .expectNextMatches(p -> p.getValue().size() == 8) - .expectNextMatches(p -> p.getValue().size() == 4) - .expectComplete() - .verify(); - - Assertions.assertEquals(10 * 2, new PagedIterable<>(convertedPagedFlux).stream().count()); - } - - @Test - public void testMergePagedFlux() { - PagedFlux pagedFlux = mockPagedFlux("base", 0, 3, 2); - PagedFlux mergedPagedFlux = PagedConverter.mergePagedFlux(pagedFlux, item -> mockPagedFlux(item + "sub", 0, 10, 4)); - StepVerifier.create(mergedPagedFlux.byPage()) - .expectSubscription() - .expectNextMatches(p -> p.getValue().size() == 4 - && p.getValue().get(0).equals("base0sub0") - && p.getValue().get(p.getValue().size() - 1).equals("base0sub3")) - .expectNextMatches(p -> p.getValue().size() == 4) - .expectNextMatches(p -> p.getValue().size() == 2) - .expectNextCount(3 * 2) - .expectComplete() - .verify(); - - Assertions.assertEquals(3 * 10, new PagedIterable<>(mergedPagedFlux).stream().count()); - } - - @Test - public void testMergePagedFluxContainsEmptyPage() { - PagedFlux pagedFlux = mockPagedFlux("base", 0, 3, 2); - PagedFlux mergedPagedFlux = PagedConverter.mergePagedFlux(pagedFlux, item -> { - if (item.equals("base1")) { - return mockEmptyPagedFlux(); - } else { - return mockPagedFlux(item + "sub", 0, 10, 4); - } - }); - StepVerifier.create(mergedPagedFlux.byPage()) - .expectSubscription() - .expectNextMatches(p -> p.getValue().size() == 4 - && p.getValue().get(0).equals("base0sub0") - && p.getValue().get(p.getValue().size() - 1).equals("base0sub3")) - .expectNextMatches(p -> p.getValue().size() == 4) - .expectNextMatches(p -> p.getValue().size() == 2) - .expectNextCount(3) - .expectComplete() - .verify(); - - Assertions.assertEquals(2 * 10, new PagedIterable<>(mergedPagedFlux).stream().count()); - } - - @Test - public void testMergePagedFluxContainsEmptyPage2() { - PagedFlux pagedFlux = mockPagedFlux("base", 0, 3, 2); - PagedFlux mergedPagedFlux = PagedConverter.mergePagedFlux(pagedFlux, item -> { - if (item.equals("base0") || item.equals("base1")) { - return mockEmptyPagedFlux(); - } else { - return mockPagedFlux(item + "sub", 0, 10, 4); - } - }); - StepVerifier.create(mergedPagedFlux.byPage()) - .expectSubscription() - .expectNextMatches(p -> p.getValue().size() == 4 - && p.getValue().get(0).equals("base2sub0") - && p.getValue().get(p.getValue().size() - 1).equals("base2sub3")) - .expectNextMatches(p -> p.getValue().size() == 4) - .expectNextMatches(p -> p.getValue().size() == 2) - .expectComplete() - .verify(); - - Assertions.assertEquals(10, new PagedIterable<>(mergedPagedFlux).stream().count()); - } - - @Test - public void testMapPageOnePage() { - AtomicInteger pageCount = new AtomicInteger(0); - PagedFlux pagedFlux = mockPagedFlux("base", 0, 10, 4, pageCount); - PagedFlux convertedPagedFlux = PagedConverter.mapPage(pagedFlux, item -> item + "#"); - PagedIterable pagedIterable = new PagedIterable<>(convertedPagedFlux); - - pagedIterable.stream().findFirst().get(); - - Assertions.assertEquals(1, pageCount.get()); - } - - @Test - public void testFlatMapPageOnePage() { - AtomicInteger pageCount = new AtomicInteger(0); - PagedFlux pagedFlux = mockPagedFlux("base", 0, 10, 4, pageCount); - PagedFlux convertedPagedFlux = PagedConverter.flatMapPage(pagedFlux, item -> Flux.just(item, item + "#")); - PagedIterable pagedIterable = new PagedIterable<>(convertedPagedFlux); - - pagedIterable.stream().findFirst().get(); - - Assertions.assertEquals(1, pageCount.get()); - } - - @Test - @Disabled("not working as expected") - public void testMergePagedFluxOnePage() { - AtomicInteger pageCountRoot = new AtomicInteger(0); - AtomicInteger pageCount = new AtomicInteger(0); - PagedFlux pagedFlux = mockPagedFlux("base", 0, 3, 2, pageCountRoot); - PagedFlux mergedPagedFlux = PagedConverter.mergePagedFlux(pagedFlux, item -> mockPagedFlux(item + "sub", 0, 10, 4, pageCount)); - PagedIterable pagedIterable = new PagedIterable<>(mergedPagedFlux); - - pagedIterable.stream().findFirst().get(); - - Assertions.assertEquals(1, pageCountRoot.get()); - Assertions.assertEquals(1, pageCount.get()); - } - - private static PagedFlux mockEmptyPagedFlux() { - PagedResponseBase emptyPage = new PagedResponseBase<>(null, 200, null, - Collections.emptyList(), null, null); - return new PagedFlux<>(() -> Mono.just(emptyPage), - continuationToken -> Mono.empty()); - } - - private static PagedFlux mockPagedFlux(String prefix, int startInclusive, int stopExclusive, int pageSize) { - return mockPagedFlux(prefix, startInclusive, stopExclusive, pageSize, new AtomicInteger(0)); - } - - private static PagedFlux mockPagedFlux(String prefix, int startInclusive, int stopExclusive, int pageSize, AtomicInteger pageCount) { - Iterator iterator = IntStream.range(startInclusive, stopExclusive).iterator(); - Map> pages = new HashMap<>(); - String currentContinuationToken = prefix; - while (iterator.hasNext()) { - List items = new ArrayList<>(); - Integer possibleNext = null; - for (int i = 0; i < pageSize; ++i) { - if (!iterator.hasNext()) { - break; - } - int item = iterator.next(); - items.add(prefix + item); - possibleNext = item + 1; - } - - String newContinuationToken = iterator.hasNext() ? prefix + possibleNext : null; - PagedResponse page = new PagedResponseBase<>(null, 200, null, - items, newContinuationToken, null); - pages.put(currentContinuationToken, page); - currentContinuationToken = newContinuationToken; - } - - Function> nextPage = continuationToken -> { - if (continuationToken == null) { - throw new IllegalArgumentException(); - } - - pageCount.getAndIncrement(); - - return pages.get(continuationToken); - }; - return new PagedFlux<>(() -> Mono.just(nextPage.apply(prefix)), - continuationToken -> Mono.just(nextPage.apply(continuationToken))); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/utils/ResourceManagerThrottlingInfoTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/utils/ResourceManagerThrottlingInfoTests.java deleted file mode 100644 index 2e10f96a4623..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/utils/ResourceManagerThrottlingInfoTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.utils; - -import com.azure.core.http.HttpHeaders; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -import java.util.Map; - -public class ResourceManagerThrottlingInfoTests { - - @Test - public void canCalculateThrottlingInfo() { - String resourceHeaderValue = "Microsoft.Compute/PutVM3Min;237,Microsoft.Compute/PutVM30Min;1197"; - HttpHeaders headers = new HttpHeaders() - .set("x-ms-ratelimit-remaining-subscription-writes", "1193") - .set("x-ms-ratelimit-remaining-resource", resourceHeaderValue); - - ResourceManagerThrottlingInfo info = ResourceManagerThrottlingInfo.fromHeaders(headers); - Assertions.assertEquals(resourceHeaderValue, info.getResourceRateLimit()); - Assertions.assertEquals(237, info.getRateLimit().orElse(0)); - - Map rateLimits = info.getRateLimits(); - Assertions.assertEquals("1193", rateLimits.get("x-ms-ratelimit-remaining-subscription-writes")); - Assertions.assertEquals("237", rateLimits.get("x-ms-ratelimit-remaining-resource-PutVM3Min")); - Assertions.assertEquals("1197", rateLimits.get("x-ms-ratelimit-remaining-resource-PutVM30Min")); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/utils/ResourceUtilsTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/utils/ResourceUtilsTests.java deleted file mode 100644 index 2941b2520107..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/utils/ResourceUtilsTests.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.fluentcore.utils; - -import com.azure.core.management.AzureEnvironment; -import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public class ResourceUtilsTests { - @Test - public void canExtractGroupFromId() throws Exception { - Assertions.assertEquals("foo", ResourceUtils.groupFromResourceId("subscriptions/123/resourceGroups/foo/providers/Microsoft.Bar/bars/bar1")); - Assertions.assertEquals("foo", ResourceUtils.groupFromResourceId("subscriptions/123/resourcegroups/foo/providers/Microsoft.Bar/bars/bar1")); - Assertions.assertNull(ResourceUtils.groupFromResourceId(null)); - } - - @Test - public void canExtractResourceProviderFromResourceId() { - Assertions.assertEquals("Microsoft.Bar", ResourceUtils.resourceProviderFromResourceId("subscriptions/123/resourceGroups/foo/providers/Microsoft.Bar/bars/bar1")); - Assertions.assertNull(ResourceUtils.resourceProviderFromResourceId(null)); - } - - @Test - public void canExtractParentPathFromId() throws Exception { - Assertions.assertEquals("/subscriptions/123/resourceGroups/foo/providers/Microsoft.Bar/bars/bar1", ResourceUtils.parentResourceIdFromResourceId("subscriptions/123/resourceGroups/foo/providers/Microsoft.Bar/bars/bar1/bazs/baz1")); - Assertions.assertNull(ResourceUtils.parentResourceIdFromResourceId("subscriptions/123/resourceGroups/foo/providers/Microsoft.Bar/bars/bar1")); - } - - @Test - public void canExtractRelativePathFromId() throws Exception { - Assertions.assertEquals("bars/bar1", ResourceUtils.relativePathFromResourceId("subscriptions/123/resourceGroups/foo/providers/Microsoft.Bar/bars/bar1")); - Assertions.assertEquals("", ResourceUtils.parentRelativePathFromResourceId("subscriptions/123/resourceGroups/foo/providers/Microsoft.Bar/bars/bar1")); - Assertions.assertEquals("bars/bar1/providers/provider1", ResourceUtils.relativePathFromResourceId("subscriptions/123/resourceGroups/foo/providers/Microsoft.Bar/bars/bar1/providers/provider1")); - Assertions.assertEquals("providers/provider1/bars/bar1", ResourceUtils.relativePathFromResourceId("subscriptions/123/resourceGroups/foo/providers/Microsoft.Bar/providers/provider1/bars/bar1")); - } - - @Test - public void canGetDefaultScopeFromUrl() throws Exception { - Assertions.assertEquals("https://graph.windows.net/.default", ResourceManagerUtils.getDefaultScopeFromUrl("https://graph.windows.net/random", AzureEnvironment.AZURE)); - Assertions.assertEquals("https://vault.azure.net/.default", ResourceManagerUtils.getDefaultScopeFromUrl("https://random.vault.azure.net/random", AzureEnvironment.AZURE)); - Assertions.assertEquals("https://api.applicationinsights.io/.default", ResourceManagerUtils.getDefaultScopeFromUrl("https://api.applicationinsights.io/random", AzureEnvironment.AZURE)); - Assertions.assertEquals("https://api.loganalytics.io/.default", ResourceManagerUtils.getDefaultScopeFromUrl("https://api.loganalytics.io/random", AzureEnvironment.AZURE)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/implementation/TypeSerializationTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/implementation/TypeSerializationTests.java deleted file mode 100644 index 98dc4cc7668b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/implementation/TypeSerializationTests.java +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.resources.implementation; - -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerAdapter; -import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.resourcemanager.resources.models.DeploymentProperties; -import com.azure.resourcemanager.resources.fluent.models.DeploymentExtendedInner; -import com.azure.resourcemanager.resources.fluent.models.DeploymentInner; -import com.azure.resourcemanager.resources.models.Tags; -import com.azure.resourcemanager.resources.models.TagsPatchOperation; -import com.azure.resourcemanager.resources.models.TagsPatchResource; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -import java.lang.reflect.Field; -import java.util.AbstractMap; -import java.util.Collections; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -public class TypeSerializationTests { - - public static final class Map1 extends AbstractMap { - private final K k0; - private final V v0; - - public Map1(K k0, V v0) { - this.k0 = Objects.requireNonNull(k0); - this.v0 = Objects.requireNonNull(v0); - } - - @Override - public Set> entrySet() { - Entry entry = new AbstractMap.SimpleEntry<>(k0, v0); - return new HashSet<>(Collections.singletonList(entry)); - } - - @Override - public V get(Object o) { - return o.equals(k0) ? v0 : null; - } - - @Override - public boolean containsKey(Object o) { - return o.equals(k0); - } - - @Override - public boolean containsValue(Object o) { - return o.equals(v0); // implicit nullcheck of o - } - - @Override - public int size() { - return 1; - } - - @Override - public boolean isEmpty() { - return false; - } - - @Override - public int hashCode() { - return k0.hashCode() ^ v0.hashCode(); - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - if (!super.equals(o)) { - return false; - } - Map1 map1 = (Map1) o; - return k0.equals(map1.k0) && v0.equals(map1.v0); - } - } - - @Test - public void testTagsPatchResourceSerialization() throws Exception { - Map tags = new Map1<>("tag.1", "value.1"); - - TagsPatchResource tagsPatchResource = new TagsPatchResource() - .withOperation(TagsPatchOperation.REPLACE) - .withProperties(new Tags().withTags(tags)); - - SerializerAdapter serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); - String tagsPatchResourceJson = serializerAdapter.serialize(tagsPatchResource, SerializerEncoding.JSON); - Assertions.assertTrue(tagsPatchResourceJson.contains("tag.1")); - } - - @Test - public void testDeploymentSerialization() throws Exception { - final String templateJson = "{ \"/subscriptions//resourceGroups//providers/Microsoft.ManagedIdentity/userAssignedIdentities/\": {} }"; - - DeploymentImpl deployment = new DeploymentImpl(new DeploymentExtendedInner(), "", null); - deployment.withTemplate(templateJson); - - SerializerAdapter serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); - String deploymentJson = serializerAdapter.serialize(createRequestFromInner(deployment), SerializerEncoding.JSON); - Assertions.assertTrue(deploymentJson.contains("Microsoft.ManagedIdentity")); - } - - private static DeploymentInner createRequestFromInner(DeploymentImpl deployment) throws NoSuchFieldException, IllegalAccessException { - Field field = DeploymentImpl.class.getDeclaredField("deploymentCreateUpdateParameters"); - field.setAccessible(true); - DeploymentInner implInner = (DeploymentInner) field.get(deployment); - - DeploymentInner inner = new DeploymentInner() - .withProperties(new DeploymentProperties()); - inner.properties().withMode(deployment.mode()); - inner.properties().withTemplate(implInner.properties().template()); - inner.properties().withTemplateLink(deployment.templateLink()); - inner.properties().withParameters(deployment.parameters()); - inner.properties().withParametersLink(deployment.parametersLink()); - return inner; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/resources/deployTemplateWithError.json b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/resources/deployTemplateWithError.json deleted file mode 100644 index e93ae73cf1db..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/resources/deployTemplateWithError.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "vnetName": { - "type": "string", - "defaultValue": "VNet1", - "metadata": { - "description": "VNet name" - } - }, - "vnetAddressPrefix": { - "type": "string", - "defaultValue": "10.0.0.0/16", - "metadata": { - "description": "Address prefix" - } - }, - "subnet1Prefix": { - "type": "string", - "defaultValue": "10.0.0.0/24", - "metadata": { - "description": "Subnet 1 Prefix" - } - }, - "subnet1Name": { - "type": "string", - "defaultValue": "Subnet1", - "metadata": { - "description": "Subnet 1 Name" - } - }, - "subnet2Prefix": { - "type": "string", - "defaultValue": "10.1.0.0/24", - "metadata": { - "description": "Subnet 2 Prefix" - } - }, - "subnet2Name": { - "type": "string", - "defaultValue": "Subnet2", - "metadata": { - "description": "Subnet 2 Name" - } - }, - "location": { - "type": "string", - "defaultValue": "[resourceGroup().location]", - "metadata": { - "description": "Location for all resources." - } - } - }, - "variables": {}, - "resources": [ - { - "type": "Microsoft.Network/virtualNetworks", - "apiVersion": "2020-05-01", - "name": "[parameters('vnetName')]", - "location": "[parameters('location')]", - "properties": { - "addressSpace": { - "addressPrefixes": [ - "[parameters('vnetAddressPrefix')]" - ] - } - }, - "resources": [ - { - "type": "subnets", - "apiVersion": "2020-05-01", - "location": "[parameters('location')]", - "name": "[parameters('subnet1Name')]", - "dependsOn": [ - "[parameters('vnetName')]" - ], - "properties": { - "addressPrefix": "[parameters('subnet1Prefix')]" - } - }, - { - "type": "subnets", - "apiVersion": "2020-05-01", - "location": "[parameters('location')]", - "name": "[parameters('subnet2Name')]", - "dependsOn": [ - "[parameters('vnetName')]", - "[parameters('subnet1Name')]" - ], - "properties": { - "addressPrefix": "[parameters('subnet2Prefix')]" - } - } - ] - } - ] -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/resources/junit-platform.properties b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/resources/junit-platform.properties deleted file mode 100644 index 202d099b3ee8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/test/resources/junit-platform.properties +++ /dev/null @@ -1,4 +0,0 @@ -junit.jupiter.execution.parallel.enabled=true -junit.jupiter.execution.parallel.mode.default=concurrent -junit.jupiter.execution.parallel.config.strategy=fixed -junit.jupiter.execution.parallel.config.fixed.parallelism=32 diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/CHANGELOG.md b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/CHANGELOG.md deleted file mode 100644 index 841be44954ad..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/CHANGELOG.md +++ /dev/null @@ -1,8 +0,0 @@ -# Release History - -## 1.0.0-hybrid (2022-01-12) - -- Azure Resource Manager storage client library for Java (Hybrid) using API Profiles to allow building hybrid cloud solutions -that target both Azure and Azure Stack Hub. -- Supports api versions in the 2020-09-01-hybrid api profile -- Requires Azure Stack Update 2102+ diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/README.md b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/README.md deleted file mode 100644 index acc4e4167254..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/README.md +++ /dev/null @@ -1,135 +0,0 @@ -# Azure Resource Manager storage client library for Java (Hybrid) - -Azure Resource Manager storage client library for Java (Hybrid) using [API Profiles][api_profile] to allow building hybrid cloud solutions -that target both Azure and Azure Stack Hub. - -For documentation on how to use this package, please see [Azure Management Libraries for Java (Hybrid)][resourcemanagerhybrid_lib]. - -## Getting started - -### Prerequisites - -- [Java Development Kit (JDK)][jdk] with version 8 or above -- [Azure Subscription][azure_subscription] - -### Adding the package to your product - -```xml - - com.azure.resourcemanager - azure-resourcemanager-storage - 1.0.0-hybrid - -``` - -### Include the recommended packages - -Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. - -[Azure Identity][azure_identity] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation. - -### Authentication - -By default, Azure Active Directory token authentication depends on correct configure of following environment variables. - -- `AZURE_CLIENT_ID` for Azure client ID. -- `AZURE_TENANT_ID` for Azure tenant ID. -- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. - -In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`. - -With above configuration, `azure` client can be authenticated by following code: - -```java com.azure.resourcemanager.storage.authenticate -String armEndpoint = "https://management.."; -AzureProfile profile = new AzureProfile(getAzureEnvironmentFromArmEndpoint(armEndpoint)); -TokenCredential credential = new DefaultAzureCredentialBuilder() - .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) - .build(); -StorageManager manager = StorageManager - .authenticate(credential, profile); -``` - -Change `armEndpoint` to point to the Azure Resource Manager endpoint of your Azure Stack Hub. The azure environment's -properties above can be populated with the following example: - -```java com.azure.resourcemanager.storage.getazureenvironment -private static AzureEnvironment getAzureEnvironmentFromArmEndpoint(String armEndpoint) { - // Create HTTP client and request - HttpClient httpClient = HttpClient.createDefault(); - - HttpRequest request = new HttpRequest(HttpMethod.GET, - String.format("%s/metadata/endpoints?api-version=2019-10-01", armEndpoint)) - .setHeader("accept", "application/json"); - - // Execute the request and read the response - HttpResponse response = httpClient.send(request).block(); - if (response.getStatusCode() != 200) { - throw new RuntimeException("Failed : HTTP error code : " + response.getStatusCode()); - } - String body = response.getBodyAsString().block(); - try { - ArrayNode metadataArray = JacksonAdapter.createDefaultSerializerAdapter() - .deserialize(body, ArrayNode.class, SerializerEncoding.JSON); - - if (metadataArray == null || metadataArray.isEmpty()) { - throw new RuntimeException("Failed to find metadata : " + body); - } - - JsonNode metadata = metadataArray.iterator().next(); - AzureEnvironment azureEnvironment = new AzureEnvironment(new HashMap() { - { - put("managementEndpointUrl", metadata.at("/authentication/audiences/0").asText()); - put("resourceManagerEndpointUrl", armEndpoint); - put("galleryEndpointUrl", metadata.at("/gallery").asText()); - put("activeDirectoryEndpointUrl", metadata.at("/authentication/loginEndpoint").asText()); - put("activeDirectoryResourceId", metadata.at("/authentication/audiences/0").asText()); - put("activeDirectoryGraphResourceId", metadata.at("/graph").asText()); - put("storageEndpointSuffix", "." + metadata.at("/suffixes/storage").asText()); - put("keyVaultDnsSuffix", "." + metadata.at("/suffixes/keyVaultDns").asText()); - } - }); - return azureEnvironment; - } catch (IOException ioe) { - ioe.printStackTrace(); - throw new RuntimeException(ioe); - } -} -``` - -When targeting a hybrid solution to global Azure instead of your Azure Stack Hub, `AzureEnvironment.AZURE` can be used instead. - -See [Authentication][authenticate] for more options. - -## Key concepts - -See [API design][design] for general introduction on design and key concepts on Azure Management Libraries. - -## Examples - -See [Samples][sample] for code snippets and samples. - -## Troubleshooting - -## Next steps - -## Contributing - -For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). - -1. Fork it -1. Create your feature branch (`git checkout -b my-new-feature`) -1. Commit your changes (`git commit -am 'Add some feature'`) -1. Push to the branch (`git push origin my-new-feature`) -1. Create new Pull Request - - -[jdk]: https://learn.microsoft.com/java/azure/jdk/ -[azure_subscription]: https://azure.microsoft.com/free/ -[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity -[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty -[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md -[sample]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/SAMPLE.md -[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md -[api_profile]: https://learn.microsoft.com/azure-stack/user/azure-stack-version-profiles -[resourcemanagerhybrid_lib]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanagerhybrid diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/pom.xml b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/pom.xml deleted file mode 100644 index 9e193479f9ba..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/pom.xml +++ /dev/null @@ -1,129 +0,0 @@ - - - 4.0.0 - - com.azure - azure-client-sdk-parent - 1.7.0 - ../../parents/azure-client-sdk-parent - - - com.azure.resourcemanager - azure-resourcemanager-storage - 1.0.0-hybrid - jar - - Microsoft Azure SDK for Storage Management (Hybrid) - This package contains Microsoft Azure Storage Management Hybrid SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt - https://github.com/Azure/azure-sdk-for-java - - - - The MIT License (MIT) - http://opensource.org/licenses/MIT - repo - - - - - https://github.com/Azure/azure-sdk-for-java - scm:git:git@github.com:Azure/azure-sdk-for-java.git - HEAD - - - - - 0.10 - 0.10 - - - --add-opens com.azure.resourcemanager.storage/com.azure.resourcemanager.storage=ALL-UNNAMED - --add-opens com.azure.core/com.azure.core.implementation.jackson=ALL-UNNAMED - - - - - - microsoft - Microsoft - - - - - - com.azure.resourcemanager - azure-resourcemanager-resources - 1.0.0-hybrid - - - org.slf4j - slf4j-simple - 1.7.36 - test - - - org.junit.jupiter - junit-jupiter-engine - 5.13.4 - test - - - com.azure - azure-core-http-netty - 1.16.2 - test - - - - - azure-mgmt-sdk-test-jar - - - !maven.test.skip - - - - - com.azure.resourcemanager - azure-resourcemanager-test - 1.0.0-hybrid - test - - - - - - - - org.apache.maven.plugins - maven-jar-plugin - 3.4.2 - - - - true - true - - - - - - org.jacoco - jacoco-maven-plugin - 0.8.13 - - - com/azure/resourcemanager/**/fluent/**/* - com/azure/resourcemanager/**/models/**/* - com/azure/resourcemanager/**/implementation/*ClientImpl* - com/azure/resourcemanager/**/implementation/*ClientBuilder* - - - - - - diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/StorageManager.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/StorageManager.java deleted file mode 100644 index cd9797fb8bb2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/StorageManager.java +++ /dev/null @@ -1,152 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.storage; - -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpPipeline; -import com.azure.resourcemanager.resources.fluentcore.arm.AzureConfigurable; -import com.azure.resourcemanager.resources.fluentcore.arm.implementation.AzureConfigurableImpl; -import com.azure.resourcemanager.resources.fluentcore.arm.Manager; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.resources.fluentcore.utils.HttpPipelineProvider; -import com.azure.resourcemanager.storage.fluent.StorageManagementClient; -import com.azure.resourcemanager.storage.implementation.StorageManagementClientBuilder; -import com.azure.resourcemanager.storage.implementation.BlobContainersImpl; -import com.azure.resourcemanager.storage.implementation.BlobServicesImpl; -import com.azure.resourcemanager.storage.implementation.ManagementPoliciesImpl; -import com.azure.resourcemanager.storage.implementation.StorageAccountsImpl; -import com.azure.resourcemanager.storage.implementation.StorageSkusImpl; -import com.azure.resourcemanager.storage.implementation.UsagesImpl; -import com.azure.resourcemanager.storage.models.BlobContainers; -import com.azure.resourcemanager.storage.models.BlobServices; -import com.azure.resourcemanager.storage.models.ManagementPolicies; -import com.azure.resourcemanager.storage.models.StorageAccounts; -import com.azure.resourcemanager.storage.models.StorageSkus; -import com.azure.resourcemanager.storage.models.Usages; - -import java.util.Objects; - -/** Entry point to Azure storage resource management. */ -public final class StorageManager extends Manager { - // Collections - private StorageAccounts storageAccounts; - private Usages storageUsages; - private StorageSkus storageSkus; - private BlobContainers blobContainers; - private BlobServices blobServices; - private ManagementPolicies managementPolicies; - - /** - * Get a Configurable instance that can be used to create StorageManager with optional configuration. - * - * @return the instance allowing configurations - */ - public static Configurable configure() { - return new StorageManager.ConfigurableImpl(); - } - - /** - * Creates an instance of StorageManager that exposes storage resource management API entry points. - * - * @param credential the credential to use - * @param profile the profile to use - * @return the StorageManager - */ - public static StorageManager authenticate(TokenCredential credential, AzureProfile profile) { - Objects.requireNonNull(credential, "'credential' cannot be null."); - Objects.requireNonNull(profile, "'profile' cannot be null."); - return authenticate(HttpPipelineProvider.buildHttpPipeline(credential, profile), profile); - } - - /** - * Creates an instance of StorageManager that exposes storage resource management API entry points. - * - * @param httpPipeline the RestClient to be used for API calls. - * @param profile the profile to use - * @return the StorageManager - */ - public static StorageManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { - Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); - Objects.requireNonNull(profile, "'profile' cannot be null."); - return new StorageManager(httpPipeline, profile); - } - - /** The interface allowing configurations to be set. */ - public interface Configurable extends AzureConfigurable { - /** - * Creates an instance of StorageManager that exposes storage management API entry points. - * - * @param credential the credential to use - * @param profile the profile to use - * @return the interface exposing storage management API entry points that work across subscriptions - */ - StorageManager authenticate(TokenCredential credential, AzureProfile profile); - } - - /** The implementation for Configurable interface. */ - private static final class ConfigurableImpl extends AzureConfigurableImpl implements Configurable { - public StorageManager authenticate(TokenCredential credential, AzureProfile profile) { - return StorageManager.authenticate(buildHttpPipeline(credential, profile), profile); - } - } - - private StorageManager(HttpPipeline httpPipeline, AzureProfile profile) { - super( - httpPipeline, - profile, - new StorageManagementClientBuilder() - .pipeline(httpPipeline) - .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) - .subscriptionId(profile.getSubscriptionId()) - .buildClient()); - } - - /** @return the storage account management API entry point */ - public StorageAccounts storageAccounts() { - if (storageAccounts == null) { - storageAccounts = new StorageAccountsImpl(this); - } - return storageAccounts; - } - - /** @return the storage service usage management API entry point */ - public Usages usages() { - if (storageUsages == null) { - storageUsages = new UsagesImpl(this); - } - return storageUsages; - } - - /** @return the storage service SKU management API entry point */ - public StorageSkus storageSkus() { - if (storageSkus == null) { - storageSkus = new StorageSkusImpl(this); - } - return storageSkus; - } - - /** @return the blob container management API entry point */ - public BlobContainers blobContainers() { - if (blobContainers == null) { - blobContainers = new BlobContainersImpl(this); - } - return blobContainers; - } - - /** @return the blob service management API entry point */ - public BlobServices blobServices() { - if (blobServices == null) { - blobServices = new BlobServicesImpl(this); - } - return blobServices; - } - - /** @return the management policy management API entry point */ - public ManagementPolicies managementPolicies() { - if (managementPolicies == null) { - managementPolicies = new ManagementPoliciesImpl(this); - } - return managementPolicies; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/BlobContainersClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/BlobContainersClient.java deleted file mode 100644 index 553de41cdfdb..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/BlobContainersClient.java +++ /dev/null @@ -1,1260 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.storage.fluent.models.BlobContainerInner; -import com.azure.resourcemanager.storage.fluent.models.ImmutabilityPolicyInner; -import com.azure.resourcemanager.storage.fluent.models.LeaseContainerResponseInner; -import com.azure.resourcemanager.storage.fluent.models.LegalHoldInner; -import com.azure.resourcemanager.storage.fluent.models.ListContainerItemInner; -import com.azure.resourcemanager.storage.models.BlobContainersCreateOrUpdateImmutabilityPolicyResponse; -import com.azure.resourcemanager.storage.models.BlobContainersDeleteImmutabilityPolicyResponse; -import com.azure.resourcemanager.storage.models.BlobContainersExtendImmutabilityPolicyResponse; -import com.azure.resourcemanager.storage.models.BlobContainersGetImmutabilityPolicyResponse; -import com.azure.resourcemanager.storage.models.BlobContainersLockImmutabilityPolicyResponse; -import com.azure.resourcemanager.storage.models.LeaseContainerRequest; -import com.azure.resourcemanager.storage.models.ListContainersInclude; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in BlobContainersClient. */ -public interface BlobContainersClient { - /** - * Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation - * token. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param maxpagesize Optional. Specified maximum number of containers that can be included in the list. - * @param filter Optional. When specified, only container names starting with the filter will be listed. - * @param include Optional, used to include the properties for soft deleted blob containers. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response schema. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync( - String resourceGroupName, String accountName, String maxpagesize, String filter, ListContainersInclude include); - - /** - * Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation - * token. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response schema. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String resourceGroupName, String accountName); - - /** - * Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation - * token. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response schema. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String accountName); - - /** - * Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation - * token. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param maxpagesize Optional. Specified maximum number of containers that can be included in the list. - * @param filter Optional. When specified, only container names starting with the filter will be listed. - * @param include Optional, used to include the properties for soft deleted blob containers. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response schema. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String resourceGroupName, - String accountName, - String maxpagesize, - String filter, - ListContainersInclude include, - Context context); - - /** - * Creates a new container under the specified account as described by request body. The container resource includes - * metadata and properties for that container. It does not include a list of the blobs contained by the container. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param blobContainer Properties of the blob container to create. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of the blob container, including Id, resource name, resource type, Etag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createWithResponseAsync( - String resourceGroupName, String accountName, String containerName, BlobContainerInner blobContainer); - - /** - * Creates a new container under the specified account as described by request body. The container resource includes - * metadata and properties for that container. It does not include a list of the blobs contained by the container. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param blobContainer Properties of the blob container to create. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of the blob container, including Id, resource name, resource type, Etag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createAsync( - String resourceGroupName, String accountName, String containerName, BlobContainerInner blobContainer); - - /** - * Creates a new container under the specified account as described by request body. The container resource includes - * metadata and properties for that container. It does not include a list of the blobs contained by the container. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param blobContainer Properties of the blob container to create. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of the blob container, including Id, resource name, resource type, Etag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - BlobContainerInner create( - String resourceGroupName, String accountName, String containerName, BlobContainerInner blobContainer); - - /** - * Creates a new container under the specified account as described by request body. The container resource includes - * metadata and properties for that container. It does not include a list of the blobs contained by the container. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param blobContainer Properties of the blob container to create. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of the blob container, including Id, resource name, resource type, Etag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createWithResponse( - String resourceGroupName, - String accountName, - String containerName, - BlobContainerInner blobContainer, - Context context); - - /** - * Updates container properties as specified in request body. Properties not mentioned in the request will be - * unchanged. Update fails if the specified container doesn't already exist. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param blobContainer Properties to update for the blob container. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of the blob container, including Id, resource name, resource type, Etag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateWithResponseAsync( - String resourceGroupName, String accountName, String containerName, BlobContainerInner blobContainer); - - /** - * Updates container properties as specified in request body. Properties not mentioned in the request will be - * unchanged. Update fails if the specified container doesn't already exist. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param blobContainer Properties to update for the blob container. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of the blob container, including Id, resource name, resource type, Etag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAsync( - String resourceGroupName, String accountName, String containerName, BlobContainerInner blobContainer); - - /** - * Updates container properties as specified in request body. Properties not mentioned in the request will be - * unchanged. Update fails if the specified container doesn't already exist. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param blobContainer Properties to update for the blob container. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of the blob container, including Id, resource name, resource type, Etag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - BlobContainerInner update( - String resourceGroupName, String accountName, String containerName, BlobContainerInner blobContainer); - - /** - * Updates container properties as specified in request body. Properties not mentioned in the request will be - * unchanged. Update fails if the specified container doesn't already exist. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param blobContainer Properties to update for the blob container. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of the blob container, including Id, resource name, resource type, Etag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String resourceGroupName, - String accountName, - String containerName, - BlobContainerInner blobContainer, - Context context); - - /** - * Gets properties of a specified container. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of a specified container. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync( - String resourceGroupName, String accountName, String containerName); - - /** - * Gets properties of a specified container. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of a specified container. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync(String resourceGroupName, String accountName, String containerName); - - /** - * Gets properties of a specified container. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of a specified container. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - BlobContainerInner get(String resourceGroupName, String accountName, String containerName); - - /** - * Gets properties of a specified container. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of a specified container. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String accountName, String containerName, Context context); - - /** - * Deletes specified container under its account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteWithResponseAsync(String resourceGroupName, String accountName, String containerName); - - /** - * Deletes specified container under its account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String accountName, String containerName); - - /** - * Deletes specified container under its account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String accountName, String containerName); - - /** - * Deletes specified container under its account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse( - String resourceGroupName, String accountName, String containerName, Context context); - - /** - * Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold follows an append - * pattern and does not clear out the existing tags that are not specified in the request. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param legalHold The LegalHold property that will be set to a blob container. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the LegalHold property of a blob container. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> setLegalHoldWithResponseAsync( - String resourceGroupName, String accountName, String containerName, LegalHoldInner legalHold); - - /** - * Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold follows an append - * pattern and does not clear out the existing tags that are not specified in the request. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param legalHold The LegalHold property that will be set to a blob container. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the LegalHold property of a blob container. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono setLegalHoldAsync( - String resourceGroupName, String accountName, String containerName, LegalHoldInner legalHold); - - /** - * Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold follows an append - * pattern and does not clear out the existing tags that are not specified in the request. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param legalHold The LegalHold property that will be set to a blob container. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the LegalHold property of a blob container. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - LegalHoldInner setLegalHold( - String resourceGroupName, String accountName, String containerName, LegalHoldInner legalHold); - - /** - * Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold follows an append - * pattern and does not clear out the existing tags that are not specified in the request. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param legalHold The LegalHold property that will be set to a blob container. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the LegalHold property of a blob container. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response setLegalHoldWithResponse( - String resourceGroupName, String accountName, String containerName, LegalHoldInner legalHold, Context context); - - /** - * Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation. ClearLegalHold - * clears out only the specified tags in the request. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param legalHold The LegalHold property that will be clear from a blob container. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the LegalHold property of a blob container. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> clearLegalHoldWithResponseAsync( - String resourceGroupName, String accountName, String containerName, LegalHoldInner legalHold); - - /** - * Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation. ClearLegalHold - * clears out only the specified tags in the request. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param legalHold The LegalHold property that will be clear from a blob container. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the LegalHold property of a blob container. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono clearLegalHoldAsync( - String resourceGroupName, String accountName, String containerName, LegalHoldInner legalHold); - - /** - * Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation. ClearLegalHold - * clears out only the specified tags in the request. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param legalHold The LegalHold property that will be clear from a blob container. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the LegalHold property of a blob container. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - LegalHoldInner clearLegalHold( - String resourceGroupName, String accountName, String containerName, LegalHoldInner legalHold); - - /** - * Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation. ClearLegalHold - * clears out only the specified tags in the request. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param legalHold The LegalHold property that will be clear from a blob container. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the LegalHold property of a blob container. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response clearLegalHoldWithResponse( - String resourceGroupName, String accountName, String containerName, LegalHoldInner legalHold, Context context); - - /** - * Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not required for - * this operation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always - * be applied. - * @param parameters The ImmutabilityPolicy Properties that will be created or updated to a blob container. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateImmutabilityPolicyWithResponseAsync( - String resourceGroupName, - String accountName, - String containerName, - String ifMatch, - ImmutabilityPolicyInner parameters); - - /** - * Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not required for - * this operation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always - * be applied. - * @param parameters The ImmutabilityPolicy Properties that will be created or updated to a blob container. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateImmutabilityPolicyAsync( - String resourceGroupName, - String accountName, - String containerName, - String ifMatch, - ImmutabilityPolicyInner parameters); - - /** - * Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not required for - * this operation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateImmutabilityPolicyAsync( - String resourceGroupName, String accountName, String containerName); - - /** - * Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not required for - * this operation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ImmutabilityPolicyInner createOrUpdateImmutabilityPolicy( - String resourceGroupName, String accountName, String containerName); - - /** - * Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not required for - * this operation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always - * be applied. - * @param parameters The ImmutabilityPolicy Properties that will be created or updated to a blob container. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - BlobContainersCreateOrUpdateImmutabilityPolicyResponse createOrUpdateImmutabilityPolicyWithResponse( - String resourceGroupName, - String accountName, - String containerName, - String ifMatch, - ImmutabilityPolicyInner parameters, - Context context); - - /** - * Gets the existing immutability policy along with the corresponding ETag in response headers and body. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always - * be applied. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the existing immutability policy along with the corresponding ETag in response headers and body. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getImmutabilityPolicyWithResponseAsync( - String resourceGroupName, String accountName, String containerName, String ifMatch); - - /** - * Gets the existing immutability policy along with the corresponding ETag in response headers and body. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always - * be applied. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the existing immutability policy along with the corresponding ETag in response headers and body. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getImmutabilityPolicyAsync( - String resourceGroupName, String accountName, String containerName, String ifMatch); - - /** - * Gets the existing immutability policy along with the corresponding ETag in response headers and body. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the existing immutability policy along with the corresponding ETag in response headers and body. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getImmutabilityPolicyAsync( - String resourceGroupName, String accountName, String containerName); - - /** - * Gets the existing immutability policy along with the corresponding ETag in response headers and body. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the existing immutability policy along with the corresponding ETag in response headers and body. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ImmutabilityPolicyInner getImmutabilityPolicy(String resourceGroupName, String accountName, String containerName); - - /** - * Gets the existing immutability policy along with the corresponding ETag in response headers and body. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always - * be applied. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the existing immutability policy along with the corresponding ETag in response headers and body. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - BlobContainersGetImmutabilityPolicyResponse getImmutabilityPolicyWithResponse( - String resourceGroupName, String accountName, String containerName, String ifMatch, Context context); - - /** - * Aborts an unlocked immutability policy. The response of delete has immutabilityPeriodSinceCreationInDays set to - * 0. ETag in If-Match is required for this operation. Deleting a locked immutability policy is not allowed, the - * only way is to delete the container after deleting all expired blobs inside the policy locked container. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always - * be applied. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteImmutabilityPolicyWithResponseAsync( - String resourceGroupName, String accountName, String containerName, String ifMatch); - - /** - * Aborts an unlocked immutability policy. The response of delete has immutabilityPeriodSinceCreationInDays set to - * 0. ETag in If-Match is required for this operation. Deleting a locked immutability policy is not allowed, the - * only way is to delete the container after deleting all expired blobs inside the policy locked container. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always - * be applied. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteImmutabilityPolicyAsync( - String resourceGroupName, String accountName, String containerName, String ifMatch); - - /** - * Aborts an unlocked immutability policy. The response of delete has immutabilityPeriodSinceCreationInDays set to - * 0. ETag in If-Match is required for this operation. Deleting a locked immutability policy is not allowed, the - * only way is to delete the container after deleting all expired blobs inside the policy locked container. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always - * be applied. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ImmutabilityPolicyInner deleteImmutabilityPolicy( - String resourceGroupName, String accountName, String containerName, String ifMatch); - - /** - * Aborts an unlocked immutability policy. The response of delete has immutabilityPeriodSinceCreationInDays set to - * 0. ETag in If-Match is required for this operation. Deleting a locked immutability policy is not allowed, the - * only way is to delete the container after deleting all expired blobs inside the policy locked container. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always - * be applied. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - BlobContainersDeleteImmutabilityPolicyResponse deleteImmutabilityPolicyWithResponse( - String resourceGroupName, String accountName, String containerName, String ifMatch, Context context); - - /** - * Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is - * ExtendImmutabilityPolicy action. ETag in If-Match is required for this operation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always - * be applied. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono lockImmutabilityPolicyWithResponseAsync( - String resourceGroupName, String accountName, String containerName, String ifMatch); - - /** - * Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is - * ExtendImmutabilityPolicy action. ETag in If-Match is required for this operation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always - * be applied. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono lockImmutabilityPolicyAsync( - String resourceGroupName, String accountName, String containerName, String ifMatch); - - /** - * Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is - * ExtendImmutabilityPolicy action. ETag in If-Match is required for this operation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always - * be applied. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ImmutabilityPolicyInner lockImmutabilityPolicy( - String resourceGroupName, String accountName, String containerName, String ifMatch); - - /** - * Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is - * ExtendImmutabilityPolicy action. ETag in If-Match is required for this operation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always - * be applied. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - BlobContainersLockImmutabilityPolicyResponse lockImmutabilityPolicyWithResponse( - String resourceGroupName, String accountName, String containerName, String ifMatch, Context context); - - /** - * Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action allowed on a - * Locked policy will be this action. ETag in If-Match is required for this operation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always - * be applied. - * @param parameters The ImmutabilityPolicy Properties that will be extended for a blob container. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono extendImmutabilityPolicyWithResponseAsync( - String resourceGroupName, - String accountName, - String containerName, - String ifMatch, - ImmutabilityPolicyInner parameters); - - /** - * Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action allowed on a - * Locked policy will be this action. ETag in If-Match is required for this operation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always - * be applied. - * @param parameters The ImmutabilityPolicy Properties that will be extended for a blob container. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono extendImmutabilityPolicyAsync( - String resourceGroupName, - String accountName, - String containerName, - String ifMatch, - ImmutabilityPolicyInner parameters); - - /** - * Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action allowed on a - * Locked policy will be this action. ETag in If-Match is required for this operation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always - * be applied. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono extendImmutabilityPolicyAsync( - String resourceGroupName, String accountName, String containerName, String ifMatch); - - /** - * Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action allowed on a - * Locked policy will be this action. ETag in If-Match is required for this operation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always - * be applied. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ImmutabilityPolicyInner extendImmutabilityPolicy( - String resourceGroupName, String accountName, String containerName, String ifMatch); - - /** - * Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action allowed on a - * Locked policy will be this action. ETag in If-Match is required for this operation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always - * be applied. - * @param parameters The ImmutabilityPolicy Properties that will be extended for a blob container. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - BlobContainersExtendImmutabilityPolicyResponse extendImmutabilityPolicyWithResponse( - String resourceGroupName, - String accountName, - String containerName, - String ifMatch, - ImmutabilityPolicyInner parameters, - Context context); - - /** - * The Lease Container operation establishes and manages a lock on a container for delete operations. The lock - * duration can be 15 to 60 seconds, or can be infinite. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param parameters Lease Container request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lease Container response schema. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> leaseWithResponseAsync( - String resourceGroupName, String accountName, String containerName, LeaseContainerRequest parameters); - - /** - * The Lease Container operation establishes and manages a lock on a container for delete operations. The lock - * duration can be 15 to 60 seconds, or can be infinite. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param parameters Lease Container request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lease Container response schema. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono leaseAsync( - String resourceGroupName, String accountName, String containerName, LeaseContainerRequest parameters); - - /** - * The Lease Container operation establishes and manages a lock on a container for delete operations. The lock - * duration can be 15 to 60 seconds, or can be infinite. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lease Container response schema. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono leaseAsync(String resourceGroupName, String accountName, String containerName); - - /** - * The Lease Container operation establishes and manages a lock on a container for delete operations. The lock - * duration can be 15 to 60 seconds, or can be infinite. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lease Container response schema. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - LeaseContainerResponseInner lease(String resourceGroupName, String accountName, String containerName); - - /** - * The Lease Container operation establishes and manages a lock on a container for delete operations. The lock - * duration can be 15 to 60 seconds, or can be infinite. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param parameters Lease Container request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lease Container response schema. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response leaseWithResponse( - String resourceGroupName, - String accountName, - String containerName, - LeaseContainerRequest parameters, - Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/BlobInventoryPoliciesClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/BlobInventoryPoliciesClient.java deleted file mode 100644 index cb776f666043..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/BlobInventoryPoliciesClient.java +++ /dev/null @@ -1,298 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.storage.fluent.models.BlobInventoryPolicyInner; -import com.azure.resourcemanager.storage.models.BlobInventoryPolicyName; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in BlobInventoryPoliciesClient. */ -public interface BlobInventoryPoliciesClient { - /** - * Gets the blob inventory policy associated with the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should always be - * 'default'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the blob inventory policy associated with the specified storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync( - String resourceGroupName, String accountName, BlobInventoryPolicyName blobInventoryPolicyName); - - /** - * Gets the blob inventory policy associated with the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should always be - * 'default'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the blob inventory policy associated with the specified storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync( - String resourceGroupName, String accountName, BlobInventoryPolicyName blobInventoryPolicyName); - - /** - * Gets the blob inventory policy associated with the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should always be - * 'default'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the blob inventory policy associated with the specified storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - BlobInventoryPolicyInner get( - String resourceGroupName, String accountName, BlobInventoryPolicyName blobInventoryPolicyName); - - /** - * Gets the blob inventory policy associated with the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should always be - * 'default'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the blob inventory policy associated with the specified storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String accountName, BlobInventoryPolicyName blobInventoryPolicyName, Context context); - - /** - * Sets the blob inventory policy to the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should always be - * 'default'. - * @param properties The blob inventory policy set to a storage account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the storage account blob inventory policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, - String accountName, - BlobInventoryPolicyName blobInventoryPolicyName, - BlobInventoryPolicyInner properties); - - /** - * Sets the blob inventory policy to the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should always be - * 'default'. - * @param properties The blob inventory policy set to a storage account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the storage account blob inventory policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, - String accountName, - BlobInventoryPolicyName blobInventoryPolicyName, - BlobInventoryPolicyInner properties); - - /** - * Sets the blob inventory policy to the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should always be - * 'default'. - * @param properties The blob inventory policy set to a storage account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the storage account blob inventory policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - BlobInventoryPolicyInner createOrUpdate( - String resourceGroupName, - String accountName, - BlobInventoryPolicyName blobInventoryPolicyName, - BlobInventoryPolicyInner properties); - - /** - * Sets the blob inventory policy to the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should always be - * 'default'. - * @param properties The blob inventory policy set to a storage account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the storage account blob inventory policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, - String accountName, - BlobInventoryPolicyName blobInventoryPolicyName, - BlobInventoryPolicyInner properties, - Context context); - - /** - * Deletes the blob inventory policy associated with the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should always be - * 'default'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteWithResponseAsync( - String resourceGroupName, String accountName, BlobInventoryPolicyName blobInventoryPolicyName); - - /** - * Deletes the blob inventory policy associated with the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should always be - * 'default'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync( - String resourceGroupName, String accountName, BlobInventoryPolicyName blobInventoryPolicyName); - - /** - * Deletes the blob inventory policy associated with the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should always be - * 'default'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String accountName, BlobInventoryPolicyName blobInventoryPolicyName); - - /** - * Deletes the blob inventory policy associated with the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should always be - * 'default'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse( - String resourceGroupName, String accountName, BlobInventoryPolicyName blobInventoryPolicyName, Context context); - - /** - * Gets the blob inventory policy associated with the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the blob inventory policy associated with the specified storage account. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String resourceGroupName, String accountName); - - /** - * Gets the blob inventory policy associated with the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the blob inventory policy associated with the specified storage account. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String accountName); - - /** - * Gets the blob inventory policy associated with the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the blob inventory policy associated with the specified storage account. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String accountName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/BlobServicesClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/BlobServicesClient.java deleted file mode 100644 index 77527637bbb4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/BlobServicesClient.java +++ /dev/null @@ -1,211 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.storage.fluent.models.BlobServicePropertiesInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in BlobServicesClient. */ -public interface BlobServicesClient { - /** - * List blob services of storage account. It returns a collection of one object named default. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String resourceGroupName, String accountName); - - /** - * List blob services of storage account. It returns a collection of one object named default. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String accountName); - - /** - * List blob services of storage account. It returns a collection of one object named default. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String accountName, Context context); - - /** - * Sets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The properties of a storage account’s Blob service, including properties for Storage Analytics - * and CORS (Cross-Origin Resource Sharing) rules. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a storage account’s Blob service. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> setServicePropertiesWithResponseAsync( - String resourceGroupName, String accountName, BlobServicePropertiesInner parameters); - - /** - * Sets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The properties of a storage account’s Blob service, including properties for Storage Analytics - * and CORS (Cross-Origin Resource Sharing) rules. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a storage account’s Blob service. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono setServicePropertiesAsync( - String resourceGroupName, String accountName, BlobServicePropertiesInner parameters); - - /** - * Sets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The properties of a storage account’s Blob service, including properties for Storage Analytics - * and CORS (Cross-Origin Resource Sharing) rules. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a storage account’s Blob service. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - BlobServicePropertiesInner setServiceProperties( - String resourceGroupName, String accountName, BlobServicePropertiesInner parameters); - - /** - * Sets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The properties of a storage account’s Blob service, including properties for Storage Analytics - * and CORS (Cross-Origin Resource Sharing) rules. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a storage account’s Blob service. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response setServicePropertiesWithResponse( - String resourceGroupName, String accountName, BlobServicePropertiesInner parameters, Context context); - - /** - * Gets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getServicePropertiesWithResponseAsync( - String resourceGroupName, String accountName); - - /** - * Gets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getServicePropertiesAsync(String resourceGroupName, String accountName); - - /** - * Gets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - BlobServicePropertiesInner getServiceProperties(String resourceGroupName, String accountName); - - /** - * Gets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getServicePropertiesWithResponse( - String resourceGroupName, String accountName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/EncryptionScopesClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/EncryptionScopesClient.java deleted file mode 100644 index 1b89c8eb66d9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/EncryptionScopesClient.java +++ /dev/null @@ -1,323 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.storage.fluent.models.EncryptionScopeInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in EncryptionScopesClient. */ -public interface EncryptionScopesClient { - /** - * Synchronously creates or updates an encryption scope under the specified storage account. If an encryption scope - * is already created and a subsequent request is issued with different properties, the encryption scope properties - * will be updated per the specified request. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param encryptionScopeName The name of the encryption scope within the specified storage account. Encryption - * scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) - * only. Every dash (-) character must be immediately preceded and followed by a letter or number. - * @param encryptionScope Encryption scope properties to be used for the create or update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Encryption Scope resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> putWithResponseAsync( - String resourceGroupName, String accountName, String encryptionScopeName, EncryptionScopeInner encryptionScope); - - /** - * Synchronously creates or updates an encryption scope under the specified storage account. If an encryption scope - * is already created and a subsequent request is issued with different properties, the encryption scope properties - * will be updated per the specified request. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param encryptionScopeName The name of the encryption scope within the specified storage account. Encryption - * scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) - * only. Every dash (-) character must be immediately preceded and followed by a letter or number. - * @param encryptionScope Encryption scope properties to be used for the create or update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Encryption Scope resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono putAsync( - String resourceGroupName, String accountName, String encryptionScopeName, EncryptionScopeInner encryptionScope); - - /** - * Synchronously creates or updates an encryption scope under the specified storage account. If an encryption scope - * is already created and a subsequent request is issued with different properties, the encryption scope properties - * will be updated per the specified request. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param encryptionScopeName The name of the encryption scope within the specified storage account. Encryption - * scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) - * only. Every dash (-) character must be immediately preceded and followed by a letter or number. - * @param encryptionScope Encryption scope properties to be used for the create or update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Encryption Scope resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - EncryptionScopeInner put( - String resourceGroupName, String accountName, String encryptionScopeName, EncryptionScopeInner encryptionScope); - - /** - * Synchronously creates or updates an encryption scope under the specified storage account. If an encryption scope - * is already created and a subsequent request is issued with different properties, the encryption scope properties - * will be updated per the specified request. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param encryptionScopeName The name of the encryption scope within the specified storage account. Encryption - * scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) - * only. Every dash (-) character must be immediately preceded and followed by a letter or number. - * @param encryptionScope Encryption scope properties to be used for the create or update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Encryption Scope resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response putWithResponse( - String resourceGroupName, - String accountName, - String encryptionScopeName, - EncryptionScopeInner encryptionScope, - Context context); - - /** - * Update encryption scope properties as specified in the request body. Update fails if the specified encryption - * scope does not already exist. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param encryptionScopeName The name of the encryption scope within the specified storage account. Encryption - * scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) - * only. Every dash (-) character must be immediately preceded and followed by a letter or number. - * @param encryptionScope Encryption scope properties to be used for the update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Encryption Scope resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> patchWithResponseAsync( - String resourceGroupName, String accountName, String encryptionScopeName, EncryptionScopeInner encryptionScope); - - /** - * Update encryption scope properties as specified in the request body. Update fails if the specified encryption - * scope does not already exist. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param encryptionScopeName The name of the encryption scope within the specified storage account. Encryption - * scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) - * only. Every dash (-) character must be immediately preceded and followed by a letter or number. - * @param encryptionScope Encryption scope properties to be used for the update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Encryption Scope resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono patchAsync( - String resourceGroupName, String accountName, String encryptionScopeName, EncryptionScopeInner encryptionScope); - - /** - * Update encryption scope properties as specified in the request body. Update fails if the specified encryption - * scope does not already exist. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param encryptionScopeName The name of the encryption scope within the specified storage account. Encryption - * scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) - * only. Every dash (-) character must be immediately preceded and followed by a letter or number. - * @param encryptionScope Encryption scope properties to be used for the update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Encryption Scope resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - EncryptionScopeInner patch( - String resourceGroupName, String accountName, String encryptionScopeName, EncryptionScopeInner encryptionScope); - - /** - * Update encryption scope properties as specified in the request body. Update fails if the specified encryption - * scope does not already exist. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param encryptionScopeName The name of the encryption scope within the specified storage account. Encryption - * scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) - * only. Every dash (-) character must be immediately preceded and followed by a letter or number. - * @param encryptionScope Encryption scope properties to be used for the update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Encryption Scope resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response patchWithResponse( - String resourceGroupName, - String accountName, - String encryptionScopeName, - EncryptionScopeInner encryptionScope, - Context context); - - /** - * Returns the properties for the specified encryption scope. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param encryptionScopeName The name of the encryption scope within the specified storage account. Encryption - * scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) - * only. Every dash (-) character must be immediately preceded and followed by a letter or number. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Encryption Scope resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync( - String resourceGroupName, String accountName, String encryptionScopeName); - - /** - * Returns the properties for the specified encryption scope. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param encryptionScopeName The name of the encryption scope within the specified storage account. Encryption - * scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) - * only. Every dash (-) character must be immediately preceded and followed by a letter or number. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Encryption Scope resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync(String resourceGroupName, String accountName, String encryptionScopeName); - - /** - * Returns the properties for the specified encryption scope. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param encryptionScopeName The name of the encryption scope within the specified storage account. Encryption - * scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) - * only. Every dash (-) character must be immediately preceded and followed by a letter or number. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Encryption Scope resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - EncryptionScopeInner get(String resourceGroupName, String accountName, String encryptionScopeName); - - /** - * Returns the properties for the specified encryption scope. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param encryptionScopeName The name of the encryption scope within the specified storage account. Encryption - * scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) - * only. Every dash (-) character must be immediately preceded and followed by a letter or number. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Encryption Scope resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String accountName, String encryptionScopeName, Context context); - - /** - * Lists all the encryption scopes available under the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of encryption scopes requested, and if paging is required, a URL to the next page of encryption - * scopes. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String resourceGroupName, String accountName); - - /** - * Lists all the encryption scopes available under the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of encryption scopes requested, and if paging is required, a URL to the next page of encryption - * scopes. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String accountName); - - /** - * Lists all the encryption scopes available under the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of encryption scopes requested, and if paging is required, a URL to the next page of encryption - * scopes. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String accountName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/FileServicesClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/FileServicesClient.java deleted file mode 100644 index b5c708693c30..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/FileServicesClient.java +++ /dev/null @@ -1,217 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.storage.fluent.models.FileServiceItemsInner; -import com.azure.resourcemanager.storage.fluent.models.FileServicePropertiesInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in FileServicesClient. */ -public interface FileServicesClient { - /** - * List all file services in storage accounts. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listWithResponseAsync(String resourceGroupName, String accountName); - - /** - * List all file services in storage accounts. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listAsync(String resourceGroupName, String accountName); - - /** - * List all file services in storage accounts. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - FileServiceItemsInner list(String resourceGroupName, String accountName); - - /** - * List all file services in storage accounts. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listWithResponse(String resourceGroupName, String accountName, Context context); - - /** - * Sets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The properties of file services in storage accounts, including CORS (Cross-Origin Resource - * Sharing) rules. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of File services in storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> setServicePropertiesWithResponseAsync( - String resourceGroupName, String accountName, FileServicePropertiesInner parameters); - - /** - * Sets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The properties of file services in storage accounts, including CORS (Cross-Origin Resource - * Sharing) rules. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of File services in storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono setServicePropertiesAsync( - String resourceGroupName, String accountName, FileServicePropertiesInner parameters); - - /** - * Sets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The properties of file services in storage accounts, including CORS (Cross-Origin Resource - * Sharing) rules. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of File services in storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - FileServicePropertiesInner setServiceProperties( - String resourceGroupName, String accountName, FileServicePropertiesInner parameters); - - /** - * Sets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The properties of file services in storage accounts, including CORS (Cross-Origin Resource - * Sharing) rules. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of File services in storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response setServicePropertiesWithResponse( - String resourceGroupName, String accountName, FileServicePropertiesInner parameters, Context context); - - /** - * Gets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) - * rules. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getServicePropertiesWithResponseAsync( - String resourceGroupName, String accountName); - - /** - * Gets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) - * rules. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getServicePropertiesAsync(String resourceGroupName, String accountName); - - /** - * Gets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) - * rules. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - FileServicePropertiesInner getServiceProperties(String resourceGroupName, String accountName); - - /** - * Gets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) - * rules. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getServicePropertiesWithResponse( - String resourceGroupName, String accountName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/FileSharesClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/FileSharesClient.java deleted file mode 100644 index 53f2ca757521..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/FileSharesClient.java +++ /dev/null @@ -1,510 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.storage.fluent.models.FileShareInner; -import com.azure.resourcemanager.storage.fluent.models.FileShareItemInner; -import com.azure.resourcemanager.storage.models.DeletedShare; -import com.azure.resourcemanager.storage.models.GetShareExpand; -import com.azure.resourcemanager.storage.models.ListSharesExpand; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in FileSharesClient. */ -public interface FileSharesClient { - /** - * Lists all shares. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param maxpagesize Optional. Specified maximum number of shares that can be included in the list. - * @param filter Optional. When specified, only share names starting with the filter will be listed. - * @param expand Optional, used to expand the properties within share's properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response schema. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync( - String resourceGroupName, String accountName, String maxpagesize, String filter, ListSharesExpand expand); - - /** - * Lists all shares. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response schema. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String resourceGroupName, String accountName); - - /** - * Lists all shares. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response schema. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String accountName); - - /** - * Lists all shares. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param maxpagesize Optional. Specified maximum number of shares that can be included in the list. - * @param filter Optional. When specified, only share names starting with the filter will be listed. - * @param expand Optional, used to expand the properties within share's properties. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response schema. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String resourceGroupName, - String accountName, - String maxpagesize, - String filter, - ListSharesExpand expand, - Context context); - - /** - * Creates a new share under the specified account as described by request body. The share resource includes - * metadata and properties for that share. It does not include a list of the files contained by the share. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param shareName The name of the file share within the specified storage account. File share names must be - * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) - * character must be immediately preceded and followed by a letter or number. - * @param fileShare Properties of the file share to create. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of the file share, including Id, resource name, resource type, Etag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createWithResponseAsync( - String resourceGroupName, String accountName, String shareName, FileShareInner fileShare); - - /** - * Creates a new share under the specified account as described by request body. The share resource includes - * metadata and properties for that share. It does not include a list of the files contained by the share. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param shareName The name of the file share within the specified storage account. File share names must be - * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) - * character must be immediately preceded and followed by a letter or number. - * @param fileShare Properties of the file share to create. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of the file share, including Id, resource name, resource type, Etag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createAsync( - String resourceGroupName, String accountName, String shareName, FileShareInner fileShare); - - /** - * Creates a new share under the specified account as described by request body. The share resource includes - * metadata and properties for that share. It does not include a list of the files contained by the share. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param shareName The name of the file share within the specified storage account. File share names must be - * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) - * character must be immediately preceded and followed by a letter or number. - * @param fileShare Properties of the file share to create. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of the file share, including Id, resource name, resource type, Etag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - FileShareInner create(String resourceGroupName, String accountName, String shareName, FileShareInner fileShare); - - /** - * Creates a new share under the specified account as described by request body. The share resource includes - * metadata and properties for that share. It does not include a list of the files contained by the share. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param shareName The name of the file share within the specified storage account. File share names must be - * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) - * character must be immediately preceded and followed by a letter or number. - * @param fileShare Properties of the file share to create. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of the file share, including Id, resource name, resource type, Etag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createWithResponse( - String resourceGroupName, String accountName, String shareName, FileShareInner fileShare, Context context); - - /** - * Updates share properties as specified in request body. Properties not mentioned in the request will not be - * changed. Update fails if the specified share does not already exist. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param shareName The name of the file share within the specified storage account. File share names must be - * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) - * character must be immediately preceded and followed by a letter or number. - * @param fileShare Properties to update for the file share. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of the file share, including Id, resource name, resource type, Etag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateWithResponseAsync( - String resourceGroupName, String accountName, String shareName, FileShareInner fileShare); - - /** - * Updates share properties as specified in request body. Properties not mentioned in the request will not be - * changed. Update fails if the specified share does not already exist. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param shareName The name of the file share within the specified storage account. File share names must be - * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) - * character must be immediately preceded and followed by a letter or number. - * @param fileShare Properties to update for the file share. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of the file share, including Id, resource name, resource type, Etag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAsync( - String resourceGroupName, String accountName, String shareName, FileShareInner fileShare); - - /** - * Updates share properties as specified in request body. Properties not mentioned in the request will not be - * changed. Update fails if the specified share does not already exist. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param shareName The name of the file share within the specified storage account. File share names must be - * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) - * character must be immediately preceded and followed by a letter or number. - * @param fileShare Properties to update for the file share. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of the file share, including Id, resource name, resource type, Etag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - FileShareInner update(String resourceGroupName, String accountName, String shareName, FileShareInner fileShare); - - /** - * Updates share properties as specified in request body. Properties not mentioned in the request will not be - * changed. Update fails if the specified share does not already exist. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param shareName The name of the file share within the specified storage account. File share names must be - * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) - * character must be immediately preceded and followed by a letter or number. - * @param fileShare Properties to update for the file share. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of the file share, including Id, resource name, resource type, Etag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String resourceGroupName, String accountName, String shareName, FileShareInner fileShare, Context context); - - /** - * Gets properties of a specified share. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param shareName The name of the file share within the specified storage account. File share names must be - * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) - * character must be immediately preceded and followed by a letter or number. - * @param expand Optional, used to expand the properties within share's properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of a specified share. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync( - String resourceGroupName, String accountName, String shareName, GetShareExpand expand); - - /** - * Gets properties of a specified share. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param shareName The name of the file share within the specified storage account. File share names must be - * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) - * character must be immediately preceded and followed by a letter or number. - * @param expand Optional, used to expand the properties within share's properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of a specified share. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync( - String resourceGroupName, String accountName, String shareName, GetShareExpand expand); - - /** - * Gets properties of a specified share. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param shareName The name of the file share within the specified storage account. File share names must be - * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) - * character must be immediately preceded and followed by a letter or number. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of a specified share. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync(String resourceGroupName, String accountName, String shareName); - - /** - * Gets properties of a specified share. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param shareName The name of the file share within the specified storage account. File share names must be - * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) - * character must be immediately preceded and followed by a letter or number. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of a specified share. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - FileShareInner get(String resourceGroupName, String accountName, String shareName); - - /** - * Gets properties of a specified share. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param shareName The name of the file share within the specified storage account. File share names must be - * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) - * character must be immediately preceded and followed by a letter or number. - * @param expand Optional, used to expand the properties within share's properties. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of a specified share. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String accountName, String shareName, GetShareExpand expand, Context context); - - /** - * Deletes specified share under its account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param shareName The name of the file share within the specified storage account. File share names must be - * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) - * character must be immediately preceded and followed by a letter or number. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteWithResponseAsync(String resourceGroupName, String accountName, String shareName); - - /** - * Deletes specified share under its account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param shareName The name of the file share within the specified storage account. File share names must be - * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) - * character must be immediately preceded and followed by a letter or number. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String accountName, String shareName); - - /** - * Deletes specified share under its account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param shareName The name of the file share within the specified storage account. File share names must be - * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) - * character must be immediately preceded and followed by a letter or number. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String accountName, String shareName); - - /** - * Deletes specified share under its account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param shareName The name of the file share within the specified storage account. File share names must be - * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) - * character must be immediately preceded and followed by a letter or number. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String accountName, String shareName, Context context); - - /** - * Restore a file share within a valid retention days if share soft delete is enabled. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param shareName The name of the file share within the specified storage account. File share names must be - * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) - * character must be immediately preceded and followed by a letter or number. - * @param deletedShare The deleted share to be restored. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> restoreWithResponseAsync( - String resourceGroupName, String accountName, String shareName, DeletedShare deletedShare); - - /** - * Restore a file share within a valid retention days if share soft delete is enabled. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param shareName The name of the file share within the specified storage account. File share names must be - * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) - * character must be immediately preceded and followed by a letter or number. - * @param deletedShare The deleted share to be restored. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono restoreAsync(String resourceGroupName, String accountName, String shareName, DeletedShare deletedShare); - - /** - * Restore a file share within a valid retention days if share soft delete is enabled. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param shareName The name of the file share within the specified storage account. File share names must be - * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) - * character must be immediately preceded and followed by a letter or number. - * @param deletedShare The deleted share to be restored. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void restore(String resourceGroupName, String accountName, String shareName, DeletedShare deletedShare); - - /** - * Restore a file share within a valid retention days if share soft delete is enabled. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param shareName The name of the file share within the specified storage account. File share names must be - * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) - * character must be immediately preceded and followed by a letter or number. - * @param deletedShare The deleted share to be restored. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response restoreWithResponse( - String resourceGroupName, String accountName, String shareName, DeletedShare deletedShare, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/ManagementPoliciesClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/ManagementPoliciesClient.java deleted file mode 100644 index 9e6efdd5b9ac..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/ManagementPoliciesClient.java +++ /dev/null @@ -1,236 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.storage.fluent.models.ManagementPolicyInner; -import com.azure.resourcemanager.storage.models.ManagementPolicyName; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ManagementPoliciesClient. */ -public interface ManagementPoliciesClient { - /** - * Gets the managementpolicy associated with the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the managementpolicy associated with the specified storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync( - String resourceGroupName, String accountName, ManagementPolicyName managementPolicyName); - - /** - * Gets the managementpolicy associated with the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the managementpolicy associated with the specified storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync( - String resourceGroupName, String accountName, ManagementPolicyName managementPolicyName); - - /** - * Gets the managementpolicy associated with the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the managementpolicy associated with the specified storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ManagementPolicyInner get(String resourceGroupName, String accountName, ManagementPolicyName managementPolicyName); - - /** - * Gets the managementpolicy associated with the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the managementpolicy associated with the specified storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String accountName, ManagementPolicyName managementPolicyName, Context context); - - /** - * Sets the managementpolicy to the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. - * @param properties The ManagementPolicy set to a storage account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Get Storage Account ManagementPolicies operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, - String accountName, - ManagementPolicyName managementPolicyName, - ManagementPolicyInner properties); - - /** - * Sets the managementpolicy to the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. - * @param properties The ManagementPolicy set to a storage account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Get Storage Account ManagementPolicies operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, - String accountName, - ManagementPolicyName managementPolicyName, - ManagementPolicyInner properties); - - /** - * Sets the managementpolicy to the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. - * @param properties The ManagementPolicy set to a storage account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Get Storage Account ManagementPolicies operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ManagementPolicyInner createOrUpdate( - String resourceGroupName, - String accountName, - ManagementPolicyName managementPolicyName, - ManagementPolicyInner properties); - - /** - * Sets the managementpolicy to the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. - * @param properties The ManagementPolicy set to a storage account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Get Storage Account ManagementPolicies operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, - String accountName, - ManagementPolicyName managementPolicyName, - ManagementPolicyInner properties, - Context context); - - /** - * Deletes the managementpolicy associated with the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteWithResponseAsync( - String resourceGroupName, String accountName, ManagementPolicyName managementPolicyName); - - /** - * Deletes the managementpolicy associated with the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String accountName, ManagementPolicyName managementPolicyName); - - /** - * Deletes the managementpolicy associated with the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String accountName, ManagementPolicyName managementPolicyName); - - /** - * Deletes the managementpolicy associated with the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse( - String resourceGroupName, String accountName, ManagementPolicyName managementPolicyName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/ObjectReplicationPoliciesOperationsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/ObjectReplicationPoliciesOperationsClient.java deleted file mode 100644 index 7aa585ef3600..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/ObjectReplicationPoliciesOperationsClient.java +++ /dev/null @@ -1,289 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.storage.fluent.models.ObjectReplicationPolicyInner; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in ObjectReplicationPoliciesOperationsClient. - */ -public interface ObjectReplicationPoliciesOperationsClient { - /** - * List the object replication policies associated with the storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list storage account object replication policies. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String resourceGroupName, String accountName); - - /** - * List the object replication policies associated with the storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list storage account object replication policies. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String accountName); - - /** - * List the object replication policies associated with the storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list storage account object replication policies. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String accountName, Context context); - - /** - * Get the object replication policy of the storage account by policy ID. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param objectReplicationPolicyId The ID of object replication policy or 'default' if the policy ID is unknown. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the object replication policy of the storage account by policy ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync( - String resourceGroupName, String accountName, String objectReplicationPolicyId); - - /** - * Get the object replication policy of the storage account by policy ID. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param objectReplicationPolicyId The ID of object replication policy or 'default' if the policy ID is unknown. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the object replication policy of the storage account by policy ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync( - String resourceGroupName, String accountName, String objectReplicationPolicyId); - - /** - * Get the object replication policy of the storage account by policy ID. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param objectReplicationPolicyId The ID of object replication policy or 'default' if the policy ID is unknown. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the object replication policy of the storage account by policy ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ObjectReplicationPolicyInner get(String resourceGroupName, String accountName, String objectReplicationPolicyId); - - /** - * Get the object replication policy of the storage account by policy ID. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param objectReplicationPolicyId The ID of object replication policy or 'default' if the policy ID is unknown. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the object replication policy of the storage account by policy ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String accountName, String objectReplicationPolicyId, Context context); - - /** - * Create or update the object replication policy of the storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param objectReplicationPolicyId The ID of object replication policy or 'default' if the policy ID is unknown. - * @param properties The object replication policy set to a storage account. A unique policy ID will be created if - * absent. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the replication policy between two storage accounts. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, - String accountName, - String objectReplicationPolicyId, - ObjectReplicationPolicyInner properties); - - /** - * Create or update the object replication policy of the storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param objectReplicationPolicyId The ID of object replication policy or 'default' if the policy ID is unknown. - * @param properties The object replication policy set to a storage account. A unique policy ID will be created if - * absent. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the replication policy between two storage accounts. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, - String accountName, - String objectReplicationPolicyId, - ObjectReplicationPolicyInner properties); - - /** - * Create or update the object replication policy of the storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param objectReplicationPolicyId The ID of object replication policy or 'default' if the policy ID is unknown. - * @param properties The object replication policy set to a storage account. A unique policy ID will be created if - * absent. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the replication policy between two storage accounts. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ObjectReplicationPolicyInner createOrUpdate( - String resourceGroupName, - String accountName, - String objectReplicationPolicyId, - ObjectReplicationPolicyInner properties); - - /** - * Create or update the object replication policy of the storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param objectReplicationPolicyId The ID of object replication policy or 'default' if the policy ID is unknown. - * @param properties The object replication policy set to a storage account. A unique policy ID will be created if - * absent. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the replication policy between two storage accounts. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, - String accountName, - String objectReplicationPolicyId, - ObjectReplicationPolicyInner properties, - Context context); - - /** - * Deletes the object replication policy associated with the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param objectReplicationPolicyId The ID of object replication policy or 'default' if the policy ID is unknown. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteWithResponseAsync( - String resourceGroupName, String accountName, String objectReplicationPolicyId); - - /** - * Deletes the object replication policy associated with the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param objectReplicationPolicyId The ID of object replication policy or 'default' if the policy ID is unknown. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String accountName, String objectReplicationPolicyId); - - /** - * Deletes the object replication policy associated with the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param objectReplicationPolicyId The ID of object replication policy or 'default' if the policy ID is unknown. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String accountName, String objectReplicationPolicyId); - - /** - * Deletes the object replication policy associated with the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param objectReplicationPolicyId The ID of object replication policy or 'default' if the policy ID is unknown. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse( - String resourceGroupName, String accountName, String objectReplicationPolicyId, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/OperationsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/OperationsClient.java deleted file mode 100644 index a39e134f065e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/OperationsClient.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.storage.fluent.models.OperationInner; - -/** An instance of this class provides access to all the operations defined in OperationsClient. */ -public interface OperationsClient { - /** - * Lists all of the available Storage Rest API operations. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Storage operations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Lists all of the available Storage Rest API operations. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Storage operations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Lists all of the available Storage Rest API operations. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Storage operations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/PrivateEndpointConnectionsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/PrivateEndpointConnectionsClient.java deleted file mode 100644 index 101b38d93c09..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/PrivateEndpointConnectionsClient.java +++ /dev/null @@ -1,296 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.storage.fluent.models.PrivateEndpointConnectionInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. */ -public interface PrivateEndpointConnectionsClient { - /** - * List all the private endpoint connections associated with the storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connection associated with the specified storage account. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String resourceGroupName, String accountName); - - /** - * List all the private endpoint connections associated with the storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connection associated with the specified storage account. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String accountName); - - /** - * List all the private endpoint connections associated with the storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connection associated with the specified storage account. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String accountName, Context context); - - /** - * Gets the specified private endpoint connection associated with the storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private endpoint connection associated with the storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync( - String resourceGroupName, String accountName, String privateEndpointConnectionName); - - /** - * Gets the specified private endpoint connection associated with the storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private endpoint connection associated with the storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync( - String resourceGroupName, String accountName, String privateEndpointConnectionName); - - /** - * Gets the specified private endpoint connection associated with the storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private endpoint connection associated with the storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PrivateEndpointConnectionInner get( - String resourceGroupName, String accountName, String privateEndpointConnectionName); - - /** - * Gets the specified private endpoint connection associated with the storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private endpoint connection associated with the storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String accountName, String privateEndpointConnectionName, Context context); - - /** - * Update the state of specified private endpoint connection associated with the storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. - * @param properties The private endpoint connection properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Private Endpoint Connection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> putWithResponseAsync( - String resourceGroupName, - String accountName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner properties); - - /** - * Update the state of specified private endpoint connection associated with the storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. - * @param properties The private endpoint connection properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Private Endpoint Connection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono putAsync( - String resourceGroupName, - String accountName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner properties); - - /** - * Update the state of specified private endpoint connection associated with the storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. - * @param properties The private endpoint connection properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Private Endpoint Connection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PrivateEndpointConnectionInner put( - String resourceGroupName, - String accountName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner properties); - - /** - * Update the state of specified private endpoint connection associated with the storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. - * @param properties The private endpoint connection properties. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Private Endpoint Connection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response putWithResponse( - String resourceGroupName, - String accountName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner properties, - Context context); - - /** - * Deletes the specified private endpoint connection associated with the storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteWithResponseAsync( - String resourceGroupName, String accountName, String privateEndpointConnectionName); - - /** - * Deletes the specified private endpoint connection associated with the storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String accountName, String privateEndpointConnectionName); - - /** - * Deletes the specified private endpoint connection associated with the storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String accountName, String privateEndpointConnectionName); - - /** - * Deletes the specified private endpoint connection associated with the storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse( - String resourceGroupName, String accountName, String privateEndpointConnectionName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/PrivateLinkResourcesClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/PrivateLinkResourcesClient.java deleted file mode 100644 index eb49e1c95989..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/PrivateLinkResourcesClient.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.storage.fluent.models.PrivateLinkResourceListResultInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. */ -public interface PrivateLinkResourcesClient { - /** - * Gets the private link resources that need to be created for a storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources that need to be created for a storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listByStorageAccountWithResponseAsync( - String resourceGroupName, String accountName); - - /** - * Gets the private link resources that need to be created for a storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources that need to be created for a storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listByStorageAccountAsync(String resourceGroupName, String accountName); - - /** - * Gets the private link resources that need to be created for a storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources that need to be created for a storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PrivateLinkResourceListResultInner listByStorageAccount(String resourceGroupName, String accountName); - - /** - * Gets the private link resources that need to be created for a storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources that need to be created for a storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listByStorageAccountWithResponse( - String resourceGroupName, String accountName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/QueueServicesClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/QueueServicesClient.java deleted file mode 100644 index 39f1f3432179..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/QueueServicesClient.java +++ /dev/null @@ -1,225 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.storage.fluent.models.ListQueueServicesInner; -import com.azure.resourcemanager.storage.fluent.models.QueueServicePropertiesInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in QueueServicesClient. */ -public interface QueueServicesClient { - /** - * List all queue services for the storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listWithResponseAsync(String resourceGroupName, String accountName); - - /** - * List all queue services for the storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listAsync(String resourceGroupName, String accountName); - - /** - * List all queue services for the storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ListQueueServicesInner list(String resourceGroupName, String accountName); - - /** - * List all queue services for the storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listWithResponse(String resourceGroupName, String accountName, Context context); - - /** - * Sets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The properties of a storage account’s Queue service, only properties for Storage Analytics and - * CORS (Cross-Origin Resource Sharing) rules can be specified. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a storage account’s Queue service. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> setServicePropertiesWithResponseAsync( - String resourceGroupName, String accountName, QueueServicePropertiesInner parameters); - - /** - * Sets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The properties of a storage account’s Queue service, only properties for Storage Analytics and - * CORS (Cross-Origin Resource Sharing) rules can be specified. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a storage account’s Queue service. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono setServicePropertiesAsync( - String resourceGroupName, String accountName, QueueServicePropertiesInner parameters); - - /** - * Sets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The properties of a storage account’s Queue service, only properties for Storage Analytics and - * CORS (Cross-Origin Resource Sharing) rules can be specified. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a storage account’s Queue service. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - QueueServicePropertiesInner setServiceProperties( - String resourceGroupName, String accountName, QueueServicePropertiesInner parameters); - - /** - * Sets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The properties of a storage account’s Queue service, only properties for Storage Analytics and - * CORS (Cross-Origin Resource Sharing) rules can be specified. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a storage account’s Queue service. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response setServicePropertiesWithResponse( - String resourceGroupName, String accountName, QueueServicePropertiesInner parameters, Context context); - - /** - * Gets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getServicePropertiesWithResponseAsync( - String resourceGroupName, String accountName); - - /** - * Gets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getServicePropertiesAsync(String resourceGroupName, String accountName); - - /** - * Gets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - QueueServicePropertiesInner getServiceProperties(String resourceGroupName, String accountName); - - /** - * Gets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getServicePropertiesWithResponse( - String resourceGroupName, String accountName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/QueuesClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/QueuesClient.java deleted file mode 100644 index 72473bd9baaa..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/QueuesClient.java +++ /dev/null @@ -1,394 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.storage.fluent.models.ListQueueInner; -import com.azure.resourcemanager.storage.fluent.models.StorageQueueInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in QueuesClient. */ -public interface QueuesClient { - /** - * Creates a new queue with the specified queue name, under the specified account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The - * name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an - * alphanumeric character and it cannot have two consecutive dash(-) characters. - * @param queue Queue properties and metadata to be created with. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createWithResponseAsync( - String resourceGroupName, String accountName, String queueName, StorageQueueInner queue); - - /** - * Creates a new queue with the specified queue name, under the specified account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The - * name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an - * alphanumeric character and it cannot have two consecutive dash(-) characters. - * @param queue Queue properties and metadata to be created with. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createAsync( - String resourceGroupName, String accountName, String queueName, StorageQueueInner queue); - - /** - * Creates a new queue with the specified queue name, under the specified account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The - * name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an - * alphanumeric character and it cannot have two consecutive dash(-) characters. - * @param queue Queue properties and metadata to be created with. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - StorageQueueInner create(String resourceGroupName, String accountName, String queueName, StorageQueueInner queue); - - /** - * Creates a new queue with the specified queue name, under the specified account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The - * name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an - * alphanumeric character and it cannot have two consecutive dash(-) characters. - * @param queue Queue properties and metadata to be created with. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createWithResponse( - String resourceGroupName, String accountName, String queueName, StorageQueueInner queue, Context context); - - /** - * Creates a new queue with the specified queue name, under the specified account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The - * name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an - * alphanumeric character and it cannot have two consecutive dash(-) characters. - * @param queue Queue properties and metadata to be created with. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateWithResponseAsync( - String resourceGroupName, String accountName, String queueName, StorageQueueInner queue); - - /** - * Creates a new queue with the specified queue name, under the specified account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The - * name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an - * alphanumeric character and it cannot have two consecutive dash(-) characters. - * @param queue Queue properties and metadata to be created with. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAsync( - String resourceGroupName, String accountName, String queueName, StorageQueueInner queue); - - /** - * Creates a new queue with the specified queue name, under the specified account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The - * name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an - * alphanumeric character and it cannot have two consecutive dash(-) characters. - * @param queue Queue properties and metadata to be created with. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - StorageQueueInner update(String resourceGroupName, String accountName, String queueName, StorageQueueInner queue); - - /** - * Creates a new queue with the specified queue name, under the specified account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The - * name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an - * alphanumeric character and it cannot have two consecutive dash(-) characters. - * @param queue Queue properties and metadata to be created with. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String resourceGroupName, String accountName, String queueName, StorageQueueInner queue, Context context); - - /** - * Gets the queue with the specified queue name, under the specified account if it exists. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The - * name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an - * alphanumeric character and it cannot have two consecutive dash(-) characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the queue with the specified queue name, under the specified account if it exists. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync( - String resourceGroupName, String accountName, String queueName); - - /** - * Gets the queue with the specified queue name, under the specified account if it exists. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The - * name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an - * alphanumeric character and it cannot have two consecutive dash(-) characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the queue with the specified queue name, under the specified account if it exists. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync(String resourceGroupName, String accountName, String queueName); - - /** - * Gets the queue with the specified queue name, under the specified account if it exists. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The - * name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an - * alphanumeric character and it cannot have two consecutive dash(-) characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the queue with the specified queue name, under the specified account if it exists. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - StorageQueueInner get(String resourceGroupName, String accountName, String queueName); - - /** - * Gets the queue with the specified queue name, under the specified account if it exists. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The - * name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an - * alphanumeric character and it cannot have two consecutive dash(-) characters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the queue with the specified queue name, under the specified account if it exists. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String accountName, String queueName, Context context); - - /** - * Deletes the queue with the specified queue name, under the specified account if it exists. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The - * name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an - * alphanumeric character and it cannot have two consecutive dash(-) characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteWithResponseAsync(String resourceGroupName, String accountName, String queueName); - - /** - * Deletes the queue with the specified queue name, under the specified account if it exists. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The - * name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an - * alphanumeric character and it cannot have two consecutive dash(-) characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String accountName, String queueName); - - /** - * Deletes the queue with the specified queue name, under the specified account if it exists. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The - * name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an - * alphanumeric character and it cannot have two consecutive dash(-) characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String accountName, String queueName); - - /** - * Deletes the queue with the specified queue name, under the specified account if it exists. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The - * name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an - * alphanumeric character and it cannot have two consecutive dash(-) characters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String accountName, String queueName, Context context); - - /** - * Gets a list of all the queues under the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param maxpagesize Optional, a maximum number of queues that should be included in a list queue response. - * @param filter Optional, When specified, only the queues with a name starting with the given filter will be - * listed. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all the queues under the specified storage account. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync( - String resourceGroupName, String accountName, String maxpagesize, String filter); - - /** - * Gets a list of all the queues under the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all the queues under the specified storage account. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String resourceGroupName, String accountName); - - /** - * Gets a list of all the queues under the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all the queues under the specified storage account. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String accountName); - - /** - * Gets a list of all the queues under the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param maxpagesize Optional, a maximum number of queues that should be included in a list queue response. - * @param filter Optional, When specified, only the queues with a name starting with the given filter will be - * listed. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all the queues under the specified storage account. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String resourceGroupName, String accountName, String maxpagesize, String filter, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/SkusClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/SkusClient.java deleted file mode 100644 index e528c4bc3490..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/SkusClient.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.storage.fluent.models.SkuInformationInner; - -/** An instance of this class provides access to all the operations defined in SkusClient. */ -public interface SkusClient { - /** - * Lists the available SKUs supported by Microsoft.Storage for given subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the List Storage SKUs operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Lists the available SKUs supported by Microsoft.Storage for given subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the List Storage SKUs operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Lists the available SKUs supported by Microsoft.Storage for given subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the List Storage SKUs operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/StorageAccountsClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/StorageAccountsClient.java deleted file mode 100644 index 56c7a8ad32e5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/StorageAccountsClient.java +++ /dev/null @@ -1,1147 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import com.azure.resourcemanager.storage.fluent.models.BlobRestoreStatusInner; -import com.azure.resourcemanager.storage.fluent.models.CheckNameAvailabilityResultInner; -import com.azure.resourcemanager.storage.fluent.models.ListAccountSasResponseInner; -import com.azure.resourcemanager.storage.fluent.models.ListServiceSasResponseInner; -import com.azure.resourcemanager.storage.fluent.models.StorageAccountInner; -import com.azure.resourcemanager.storage.fluent.models.StorageAccountListKeysResultInner; -import com.azure.resourcemanager.storage.models.AccountSasParameters; -import com.azure.resourcemanager.storage.models.BlobRestoreParameters; -import com.azure.resourcemanager.storage.models.ListKeyExpand; -import com.azure.resourcemanager.storage.models.ServiceSasParameters; -import com.azure.resourcemanager.storage.models.StorageAccountCheckNameAvailabilityParameters; -import com.azure.resourcemanager.storage.models.StorageAccountCreateParameters; -import com.azure.resourcemanager.storage.models.StorageAccountExpand; -import com.azure.resourcemanager.storage.models.StorageAccountRegenerateKeyParameters; -import com.azure.resourcemanager.storage.models.StorageAccountUpdateParameters; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in StorageAccountsClient. */ -public interface StorageAccountsClient - extends InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete { - /** - * Checks that the storage account name is valid and is not already in use. - * - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the CheckNameAvailability operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> checkNameAvailabilityWithResponseAsync( - StorageAccountCheckNameAvailabilityParameters accountName); - - /** - * Checks that the storage account name is valid and is not already in use. - * - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the CheckNameAvailability operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono checkNameAvailabilityAsync( - StorageAccountCheckNameAvailabilityParameters accountName); - - /** - * Checks that the storage account name is valid and is not already in use. - * - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the CheckNameAvailability operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - CheckNameAvailabilityResultInner checkNameAvailability(StorageAccountCheckNameAvailabilityParameters accountName); - - /** - * Checks that the storage account name is valid and is not already in use. - * - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the CheckNameAvailability operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response checkNameAvailabilityWithResponse( - StorageAccountCheckNameAvailabilityParameters accountName, Context context); - - /** - * Asynchronously creates a new storage account with the specified parameters. If an account is already created and - * a subsequent create request is issued with different properties, the account properties will be updated. If an - * account is already created and a subsequent create or update request is issued with the exact same set of - * properties, the request will succeed. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The parameters to provide for the created account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createWithResponseAsync( - String resourceGroupName, String accountName, StorageAccountCreateParameters parameters); - - /** - * Asynchronously creates a new storage account with the specified parameters. If an account is already created and - * a subsequent create request is issued with different properties, the account properties will be updated. If an - * account is already created and a subsequent create or update request is issued with the exact same set of - * properties, the request will succeed. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The parameters to provide for the created account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, StorageAccountInner> beginCreateAsync( - String resourceGroupName, String accountName, StorageAccountCreateParameters parameters); - - /** - * Asynchronously creates a new storage account with the specified parameters. If an account is already created and - * a subsequent create request is issued with different properties, the account properties will be updated. If an - * account is already created and a subsequent create or update request is issued with the exact same set of - * properties, the request will succeed. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The parameters to provide for the created account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, StorageAccountInner> beginCreate( - String resourceGroupName, String accountName, StorageAccountCreateParameters parameters); - - /** - * Asynchronously creates a new storage account with the specified parameters. If an account is already created and - * a subsequent create request is issued with different properties, the account properties will be updated. If an - * account is already created and a subsequent create or update request is issued with the exact same set of - * properties, the request will succeed. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The parameters to provide for the created account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, StorageAccountInner> beginCreate( - String resourceGroupName, String accountName, StorageAccountCreateParameters parameters, Context context); - - /** - * Asynchronously creates a new storage account with the specified parameters. If an account is already created and - * a subsequent create request is issued with different properties, the account properties will be updated. If an - * account is already created and a subsequent create or update request is issued with the exact same set of - * properties, the request will succeed. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The parameters to provide for the created account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createAsync( - String resourceGroupName, String accountName, StorageAccountCreateParameters parameters); - - /** - * Asynchronously creates a new storage account with the specified parameters. If an account is already created and - * a subsequent create request is issued with different properties, the account properties will be updated. If an - * account is already created and a subsequent create or update request is issued with the exact same set of - * properties, the request will succeed. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The parameters to provide for the created account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - StorageAccountInner create(String resourceGroupName, String accountName, StorageAccountCreateParameters parameters); - - /** - * Asynchronously creates a new storage account with the specified parameters. If an account is already created and - * a subsequent create request is issued with different properties, the account properties will be updated. If an - * account is already created and a subsequent create or update request is issued with the exact same set of - * properties, the request will succeed. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The parameters to provide for the created account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - StorageAccountInner create( - String resourceGroupName, String accountName, StorageAccountCreateParameters parameters, Context context); - - /** - * Deletes a storage account in Microsoft Azure. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteWithResponseAsync(String resourceGroupName, String accountName); - - /** - * Deletes a storage account in Microsoft Azure. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String accountName); - - /** - * Deletes a storage account in Microsoft Azure. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String accountName); - - /** - * Deletes a storage account in Microsoft Azure. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String accountName, Context context); - - /** - * Returns the properties for the specified storage account including but not limited to name, SKU name, location, - * and account status. The ListKeys operation should be used to retrieve storage keys. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param expand May be used to expand the properties within account's properties. By default, data is not included - * when fetching properties. Currently we only support geoReplicationStats and blobRestoreStatus. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String accountName, StorageAccountExpand expand); - - /** - * Returns the properties for the specified storage account including but not limited to name, SKU name, location, - * and account status. The ListKeys operation should be used to retrieve storage keys. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param expand May be used to expand the properties within account's properties. By default, data is not included - * when fetching properties. Currently we only support geoReplicationStats and blobRestoreStatus. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync( - String resourceGroupName, String accountName, StorageAccountExpand expand); - - /** - * Returns the properties for the specified storage account including but not limited to name, SKU name, location, - * and account status. The ListKeys operation should be used to retrieve storage keys. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync(String resourceGroupName, String accountName); - - /** - * Returns the properties for the specified storage account including but not limited to name, SKU name, location, - * and account status. The ListKeys operation should be used to retrieve storage keys. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - StorageAccountInner getByResourceGroup(String resourceGroupName, String accountName); - - /** - * Returns the properties for the specified storage account including but not limited to name, SKU name, location, - * and account status. The ListKeys operation should be used to retrieve storage keys. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param expand May be used to expand the properties within account's properties. By default, data is not included - * when fetching properties. Currently we only support geoReplicationStats and blobRestoreStatus. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String accountName, StorageAccountExpand expand, Context context); - - /** - * The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. It - * can also be used to map the account to a custom domain. Only one custom domain is supported per storage account; - * the replacement/change of custom domain is not supported. In order to replace an old custom domain, the old value - * must be cleared/unregistered before a new value can be set. The update of multiple properties is supported. This - * call does not change the storage keys for the account. If you want to change the storage account keys, use the - * regenerate keys operation. The location and name of the storage account cannot be changed after creation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The parameters to provide for the updated account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateWithResponseAsync( - String resourceGroupName, String accountName, StorageAccountUpdateParameters parameters); - - /** - * The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. It - * can also be used to map the account to a custom domain. Only one custom domain is supported per storage account; - * the replacement/change of custom domain is not supported. In order to replace an old custom domain, the old value - * must be cleared/unregistered before a new value can be set. The update of multiple properties is supported. This - * call does not change the storage keys for the account. If you want to change the storage account keys, use the - * regenerate keys operation. The location and name of the storage account cannot be changed after creation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The parameters to provide for the updated account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAsync( - String resourceGroupName, String accountName, StorageAccountUpdateParameters parameters); - - /** - * The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. It - * can also be used to map the account to a custom domain. Only one custom domain is supported per storage account; - * the replacement/change of custom domain is not supported. In order to replace an old custom domain, the old value - * must be cleared/unregistered before a new value can be set. The update of multiple properties is supported. This - * call does not change the storage keys for the account. If you want to change the storage account keys, use the - * regenerate keys operation. The location and name of the storage account cannot be changed after creation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The parameters to provide for the updated account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - StorageAccountInner update(String resourceGroupName, String accountName, StorageAccountUpdateParameters parameters); - - /** - * The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. It - * can also be used to map the account to a custom domain. Only one custom domain is supported per storage account; - * the replacement/change of custom domain is not supported. In order to replace an old custom domain, the old value - * must be cleared/unregistered before a new value can be set. The update of multiple properties is supported. This - * call does not change the storage keys for the account. If you want to change the storage account keys, use the - * regenerate keys operation. The location and name of the storage account cannot be changed after creation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The parameters to provide for the updated account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String resourceGroupName, String accountName, StorageAccountUpdateParameters parameters, Context context); - - /** - * Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the - * ListKeys operation for this. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the List Storage Accounts operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the - * ListKeys operation for this. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the List Storage Accounts operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the - * ListKeys operation for this. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the List Storage Accounts operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; - * use the ListKeys operation for this. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the List Storage Accounts operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName); - - /** - * Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; - * use the ListKeys operation for this. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the List Storage Accounts operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; - * use the ListKeys operation for this. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the List Storage Accounts operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param expand Specifies type of the key to be listed. Possible value is kerb. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the ListKeys operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listKeysWithResponseAsync( - String resourceGroupName, String accountName, ListKeyExpand expand); - - /** - * Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param expand Specifies type of the key to be listed. Possible value is kerb. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the ListKeys operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listKeysAsync( - String resourceGroupName, String accountName, ListKeyExpand expand); - - /** - * Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the ListKeys operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listKeysAsync(String resourceGroupName, String accountName); - - /** - * Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the ListKeys operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - StorageAccountListKeysResultInner listKeys(String resourceGroupName, String accountName); - - /** - * Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param expand Specifies type of the key to be listed. Possible value is kerb. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the ListKeys operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listKeysWithResponse( - String resourceGroupName, String accountName, ListKeyExpand expand, Context context); - - /** - * Regenerates one of the access keys or Kerberos keys for the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param regenerateKey Specifies name of the key which should be regenerated -- key1, key2, kerb1, kerb2. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the ListKeys operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> regenerateKeyWithResponseAsync( - String resourceGroupName, String accountName, StorageAccountRegenerateKeyParameters regenerateKey); - - /** - * Regenerates one of the access keys or Kerberos keys for the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param regenerateKey Specifies name of the key which should be regenerated -- key1, key2, kerb1, kerb2. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the ListKeys operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono regenerateKeyAsync( - String resourceGroupName, String accountName, StorageAccountRegenerateKeyParameters regenerateKey); - - /** - * Regenerates one of the access keys or Kerberos keys for the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param regenerateKey Specifies name of the key which should be regenerated -- key1, key2, kerb1, kerb2. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the ListKeys operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - StorageAccountListKeysResultInner regenerateKey( - String resourceGroupName, String accountName, StorageAccountRegenerateKeyParameters regenerateKey); - - /** - * Regenerates one of the access keys or Kerberos keys for the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param regenerateKey Specifies name of the key which should be regenerated -- key1, key2, kerb1, kerb2. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the ListKeys operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response regenerateKeyWithResponse( - String resourceGroupName, - String accountName, - StorageAccountRegenerateKeyParameters regenerateKey, - Context context); - - /** - * List SAS credentials of a storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The parameters to provide to list SAS credentials for the storage account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List SAS credentials operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listAccountSasWithResponseAsync( - String resourceGroupName, String accountName, AccountSasParameters parameters); - - /** - * List SAS credentials of a storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The parameters to provide to list SAS credentials for the storage account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List SAS credentials operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listAccountSasAsync( - String resourceGroupName, String accountName, AccountSasParameters parameters); - - /** - * List SAS credentials of a storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The parameters to provide to list SAS credentials for the storage account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List SAS credentials operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ListAccountSasResponseInner listAccountSas( - String resourceGroupName, String accountName, AccountSasParameters parameters); - - /** - * List SAS credentials of a storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The parameters to provide to list SAS credentials for the storage account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List SAS credentials operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listAccountSasWithResponse( - String resourceGroupName, String accountName, AccountSasParameters parameters, Context context); - - /** - * List service SAS credentials of a specific resource. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The parameters to provide to list service SAS credentials. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List service SAS credentials operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listServiceSasWithResponseAsync( - String resourceGroupName, String accountName, ServiceSasParameters parameters); - - /** - * List service SAS credentials of a specific resource. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The parameters to provide to list service SAS credentials. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List service SAS credentials operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listServiceSasAsync( - String resourceGroupName, String accountName, ServiceSasParameters parameters); - - /** - * List service SAS credentials of a specific resource. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The parameters to provide to list service SAS credentials. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List service SAS credentials operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ListServiceSasResponseInner listServiceSas( - String resourceGroupName, String accountName, ServiceSasParameters parameters); - - /** - * List service SAS credentials of a specific resource. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The parameters to provide to list service SAS credentials. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List service SAS credentials operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listServiceSasWithResponse( - String resourceGroupName, String accountName, ServiceSasParameters parameters, Context context); - - /** - * Failover request can be triggered for a storage account in case of availability issues. The failover occurs from - * the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become - * primary after failover. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> failoverWithResponseAsync(String resourceGroupName, String accountName); - - /** - * Failover request can be triggered for a storage account in case of availability issues. The failover occurs from - * the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become - * primary after failover. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, Void> beginFailoverAsync(String resourceGroupName, String accountName); - - /** - * Failover request can be triggered for a storage account in case of availability issues. The failover occurs from - * the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become - * primary after failover. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginFailover(String resourceGroupName, String accountName); - - /** - * Failover request can be triggered for a storage account in case of availability issues. The failover occurs from - * the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become - * primary after failover. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginFailover(String resourceGroupName, String accountName, Context context); - - /** - * Failover request can be triggered for a storage account in case of availability issues. The failover occurs from - * the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become - * primary after failover. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono failoverAsync(String resourceGroupName, String accountName); - - /** - * Failover request can be triggered for a storage account in case of availability issues. The failover occurs from - * the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become - * primary after failover. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void failover(String resourceGroupName, String accountName); - - /** - * Failover request can be triggered for a storage account in case of availability issues. The failover occurs from - * the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become - * primary after failover. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void failover(String resourceGroupName, String accountName, Context context); - - /** - * Restore blobs in the specified blob ranges. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The parameters to provide for restore blob ranges. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return blob restore status. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> restoreBlobRangesWithResponseAsync( - String resourceGroupName, String accountName, BlobRestoreParameters parameters); - - /** - * Restore blobs in the specified blob ranges. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The parameters to provide for restore blob ranges. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return blob restore status. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PollerFlux, BlobRestoreStatusInner> beginRestoreBlobRangesAsync( - String resourceGroupName, String accountName, BlobRestoreParameters parameters); - - /** - * Restore blobs in the specified blob ranges. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The parameters to provide for restore blob ranges. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return blob restore status. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, BlobRestoreStatusInner> beginRestoreBlobRanges( - String resourceGroupName, String accountName, BlobRestoreParameters parameters); - - /** - * Restore blobs in the specified blob ranges. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The parameters to provide for restore blob ranges. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return blob restore status. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, BlobRestoreStatusInner> beginRestoreBlobRanges( - String resourceGroupName, String accountName, BlobRestoreParameters parameters, Context context); - - /** - * Restore blobs in the specified blob ranges. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The parameters to provide for restore blob ranges. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return blob restore status. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono restoreBlobRangesAsync( - String resourceGroupName, String accountName, BlobRestoreParameters parameters); - - /** - * Restore blobs in the specified blob ranges. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The parameters to provide for restore blob ranges. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return blob restore status. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - BlobRestoreStatusInner restoreBlobRanges( - String resourceGroupName, String accountName, BlobRestoreParameters parameters); - - /** - * Restore blobs in the specified blob ranges. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The parameters to provide for restore blob ranges. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return blob restore status. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - BlobRestoreStatusInner restoreBlobRanges( - String resourceGroupName, String accountName, BlobRestoreParameters parameters, Context context); - - /** - * Revoke user delegation keys. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> revokeUserDelegationKeysWithResponseAsync(String resourceGroupName, String accountName); - - /** - * Revoke user delegation keys. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono revokeUserDelegationKeysAsync(String resourceGroupName, String accountName); - - /** - * Revoke user delegation keys. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void revokeUserDelegationKeys(String resourceGroupName, String accountName); - - /** - * Revoke user delegation keys. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response revokeUserDelegationKeysWithResponse(String resourceGroupName, String accountName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/StorageManagementClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/StorageManagementClient.java deleted file mode 100644 index 90243e1fe2b3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/StorageManagementClient.java +++ /dev/null @@ -1,172 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.fluent; - -import com.azure.core.http.HttpPipeline; -import java.time.Duration; - -/** The interface for StorageManagementClient class. */ -public interface StorageManagementClient { - /** - * Gets The ID of the target subscription. - * - * @return the subscriptionId value. - */ - String getSubscriptionId(); - - /** - * Gets server parameter. - * - * @return the endpoint value. - */ - String getEndpoint(); - - /** - * Gets Api Version. - * - * @return the apiVersion value. - */ - String getApiVersion(); - - /** - * Gets The HTTP pipeline to send requests through. - * - * @return the httpPipeline value. - */ - HttpPipeline getHttpPipeline(); - - /** - * Gets The default poll interval for long-running operation. - * - * @return the defaultPollInterval value. - */ - Duration getDefaultPollInterval(); - - /** - * Gets the OperationsClient object to access its operations. - * - * @return the OperationsClient object. - */ - OperationsClient getOperations(); - - /** - * Gets the SkusClient object to access its operations. - * - * @return the SkusClient object. - */ - SkusClient getSkus(); - - /** - * Gets the StorageAccountsClient object to access its operations. - * - * @return the StorageAccountsClient object. - */ - StorageAccountsClient getStorageAccounts(); - - /** - * Gets the UsagesClient object to access its operations. - * - * @return the UsagesClient object. - */ - UsagesClient getUsages(); - - /** - * Gets the ManagementPoliciesClient object to access its operations. - * - * @return the ManagementPoliciesClient object. - */ - ManagementPoliciesClient getManagementPolicies(); - - /** - * Gets the BlobInventoryPoliciesClient object to access its operations. - * - * @return the BlobInventoryPoliciesClient object. - */ - BlobInventoryPoliciesClient getBlobInventoryPolicies(); - - /** - * Gets the PrivateEndpointConnectionsClient object to access its operations. - * - * @return the PrivateEndpointConnectionsClient object. - */ - PrivateEndpointConnectionsClient getPrivateEndpointConnections(); - - /** - * Gets the PrivateLinkResourcesClient object to access its operations. - * - * @return the PrivateLinkResourcesClient object. - */ - PrivateLinkResourcesClient getPrivateLinkResources(); - - /** - * Gets the ObjectReplicationPoliciesOperationsClient object to access its operations. - * - * @return the ObjectReplicationPoliciesOperationsClient object. - */ - ObjectReplicationPoliciesOperationsClient getObjectReplicationPoliciesOperations(); - - /** - * Gets the EncryptionScopesClient object to access its operations. - * - * @return the EncryptionScopesClient object. - */ - EncryptionScopesClient getEncryptionScopes(); - - /** - * Gets the BlobServicesClient object to access its operations. - * - * @return the BlobServicesClient object. - */ - BlobServicesClient getBlobServices(); - - /** - * Gets the BlobContainersClient object to access its operations. - * - * @return the BlobContainersClient object. - */ - BlobContainersClient getBlobContainers(); - - /** - * Gets the FileServicesClient object to access its operations. - * - * @return the FileServicesClient object. - */ - FileServicesClient getFileServices(); - - /** - * Gets the FileSharesClient object to access its operations. - * - * @return the FileSharesClient object. - */ - FileSharesClient getFileShares(); - - /** - * Gets the QueueServicesClient object to access its operations. - * - * @return the QueueServicesClient object. - */ - QueueServicesClient getQueueServices(); - - /** - * Gets the QueuesClient object to access its operations. - * - * @return the QueuesClient object. - */ - QueuesClient getQueues(); - - /** - * Gets the TableServicesClient object to access its operations. - * - * @return the TableServicesClient object. - */ - TableServicesClient getTableServices(); - - /** - * Gets the TablesClient object to access its operations. - * - * @return the TablesClient object. - */ - TablesClient getTables(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/TableServicesClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/TableServicesClient.java deleted file mode 100644 index 845b62314392..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/TableServicesClient.java +++ /dev/null @@ -1,225 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.storage.fluent.models.ListTableServicesInner; -import com.azure.resourcemanager.storage.fluent.models.TableServicePropertiesInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in TableServicesClient. */ -public interface TableServicesClient { - /** - * List all table services for the storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listWithResponseAsync(String resourceGroupName, String accountName); - - /** - * List all table services for the storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listAsync(String resourceGroupName, String accountName); - - /** - * List all table services for the storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ListTableServicesInner list(String resourceGroupName, String accountName); - - /** - * List all table services for the storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listWithResponse(String resourceGroupName, String accountName, Context context); - - /** - * Sets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The properties of a storage account’s Table service, only properties for Storage Analytics and - * CORS (Cross-Origin Resource Sharing) rules can be specified. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a storage account’s Table service. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> setServicePropertiesWithResponseAsync( - String resourceGroupName, String accountName, TableServicePropertiesInner parameters); - - /** - * Sets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The properties of a storage account’s Table service, only properties for Storage Analytics and - * CORS (Cross-Origin Resource Sharing) rules can be specified. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a storage account’s Table service. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono setServicePropertiesAsync( - String resourceGroupName, String accountName, TableServicePropertiesInner parameters); - - /** - * Sets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The properties of a storage account’s Table service, only properties for Storage Analytics and - * CORS (Cross-Origin Resource Sharing) rules can be specified. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a storage account’s Table service. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - TableServicePropertiesInner setServiceProperties( - String resourceGroupName, String accountName, TableServicePropertiesInner parameters); - - /** - * Sets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The properties of a storage account’s Table service, only properties for Storage Analytics and - * CORS (Cross-Origin Resource Sharing) rules can be specified. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a storage account’s Table service. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response setServicePropertiesWithResponse( - String resourceGroupName, String accountName, TableServicePropertiesInner parameters, Context context); - - /** - * Gets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a storage account’s Table service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getServicePropertiesWithResponseAsync( - String resourceGroupName, String accountName); - - /** - * Gets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a storage account’s Table service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getServicePropertiesAsync(String resourceGroupName, String accountName); - - /** - * Gets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a storage account’s Table service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - TableServicePropertiesInner getServiceProperties(String resourceGroupName, String accountName); - - /** - * Gets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a storage account’s Table service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getServicePropertiesWithResponse( - String resourceGroupName, String accountName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/TablesClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/TablesClient.java deleted file mode 100644 index f4b055ce73e4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/TablesClient.java +++ /dev/null @@ -1,341 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.storage.fluent.models.TableInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in TablesClient. */ -public interface TablesClient { - /** - * Creates a new table with the specified table name, under the specified account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The - * name must comprise of only alphanumeric characters and it cannot begin with a numeric character. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of the table, including Id, resource name, resource type. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createWithResponseAsync(String resourceGroupName, String accountName, String tableName); - - /** - * Creates a new table with the specified table name, under the specified account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The - * name must comprise of only alphanumeric characters and it cannot begin with a numeric character. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of the table, including Id, resource name, resource type. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createAsync(String resourceGroupName, String accountName, String tableName); - - /** - * Creates a new table with the specified table name, under the specified account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The - * name must comprise of only alphanumeric characters and it cannot begin with a numeric character. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of the table, including Id, resource name, resource type. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - TableInner create(String resourceGroupName, String accountName, String tableName); - - /** - * Creates a new table with the specified table name, under the specified account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The - * name must comprise of only alphanumeric characters and it cannot begin with a numeric character. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of the table, including Id, resource name, resource type. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createWithResponse( - String resourceGroupName, String accountName, String tableName, Context context); - - /** - * Creates a new table with the specified table name, under the specified account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The - * name must comprise of only alphanumeric characters and it cannot begin with a numeric character. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of the table, including Id, resource name, resource type. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateWithResponseAsync(String resourceGroupName, String accountName, String tableName); - - /** - * Creates a new table with the specified table name, under the specified account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The - * name must comprise of only alphanumeric characters and it cannot begin with a numeric character. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of the table, including Id, resource name, resource type. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAsync(String resourceGroupName, String accountName, String tableName); - - /** - * Creates a new table with the specified table name, under the specified account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The - * name must comprise of only alphanumeric characters and it cannot begin with a numeric character. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of the table, including Id, resource name, resource type. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - TableInner update(String resourceGroupName, String accountName, String tableName); - - /** - * Creates a new table with the specified table name, under the specified account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The - * name must comprise of only alphanumeric characters and it cannot begin with a numeric character. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of the table, including Id, resource name, resource type. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String resourceGroupName, String accountName, String tableName, Context context); - - /** - * Gets the table with the specified table name, under the specified account if it exists. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The - * name must comprise of only alphanumeric characters and it cannot begin with a numeric character. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the table with the specified table name, under the specified account if it exists. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync(String resourceGroupName, String accountName, String tableName); - - /** - * Gets the table with the specified table name, under the specified account if it exists. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The - * name must comprise of only alphanumeric characters and it cannot begin with a numeric character. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the table with the specified table name, under the specified account if it exists. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync(String resourceGroupName, String accountName, String tableName); - - /** - * Gets the table with the specified table name, under the specified account if it exists. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The - * name must comprise of only alphanumeric characters and it cannot begin with a numeric character. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the table with the specified table name, under the specified account if it exists. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - TableInner get(String resourceGroupName, String accountName, String tableName); - - /** - * Gets the table with the specified table name, under the specified account if it exists. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The - * name must comprise of only alphanumeric characters and it cannot begin with a numeric character. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the table with the specified table name, under the specified account if it exists. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String accountName, String tableName, Context context); - - /** - * Deletes the table with the specified table name, under the specified account if it exists. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The - * name must comprise of only alphanumeric characters and it cannot begin with a numeric character. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteWithResponseAsync(String resourceGroupName, String accountName, String tableName); - - /** - * Deletes the table with the specified table name, under the specified account if it exists. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The - * name must comprise of only alphanumeric characters and it cannot begin with a numeric character. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String accountName, String tableName); - - /** - * Deletes the table with the specified table name, under the specified account if it exists. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The - * name must comprise of only alphanumeric characters and it cannot begin with a numeric character. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String accountName, String tableName); - - /** - * Deletes the table with the specified table name, under the specified account if it exists. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The - * name must comprise of only alphanumeric characters and it cannot begin with a numeric character. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String accountName, String tableName, Context context); - - /** - * Gets a list of all the tables under the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all the tables under the specified storage account. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String resourceGroupName, String accountName); - - /** - * Gets a list of all the tables under the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all the tables under the specified storage account. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String accountName); - - /** - * Gets a list of all the tables under the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all the tables under the specified storage account. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String accountName, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/UsagesClient.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/UsagesClient.java deleted file mode 100644 index c37654b4b434..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/UsagesClient.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.storage.fluent.models.UsageInner; - -/** An instance of this class provides access to all the operations defined in UsagesClient. */ -public interface UsagesClient { - /** - * Gets the current usage count and the limit for the resources of the location under the subscription. - * - * @param location The location of the Azure Storage resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the current usage count and the limit for the resources of the location under the subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByLocationAsync(String location); - - /** - * Gets the current usage count and the limit for the resources of the location under the subscription. - * - * @param location The location of the Azure Storage resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the current usage count and the limit for the resources of the location under the subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByLocation(String location); - - /** - * Gets the current usage count and the limit for the resources of the location under the subscription. - * - * @param location The location of the Azure Storage resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the current usage count and the limit for the resources of the location under the subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByLocation(String location, Context context); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/BlobContainerInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/BlobContainerInner.java deleted file mode 100644 index f4b0a8c4ba7e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/BlobContainerInner.java +++ /dev/null @@ -1,266 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.storage.models.AzureEntityResource; -import com.azure.resourcemanager.storage.models.ImmutabilityPolicyProperties; -import com.azure.resourcemanager.storage.models.LeaseDuration; -import com.azure.resourcemanager.storage.models.LeaseState; -import com.azure.resourcemanager.storage.models.LeaseStatus; -import com.azure.resourcemanager.storage.models.LegalHoldProperties; -import com.azure.resourcemanager.storage.models.PublicAccess; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.Map; - -/** Properties of the blob container, including Id, resource name, resource type, Etag. */ -@Fluent -public final class BlobContainerInner extends AzureEntityResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BlobContainerInner.class); - - /* - * Properties of the blob container. - */ - @JsonProperty(value = "properties") - private ContainerProperties innerContainerProperties; - - /** - * Get the innerContainerProperties property: Properties of the blob container. - * - * @return the innerContainerProperties value. - */ - private ContainerProperties innerContainerProperties() { - return this.innerContainerProperties; - } - - /** - * Get the version property: The version of the deleted blob container. - * - * @return the version value. - */ - public String version() { - return this.innerContainerProperties() == null ? null : this.innerContainerProperties().version(); - } - - /** - * Get the deleted property: Indicates whether the blob container was deleted. - * - * @return the deleted value. - */ - public Boolean deleted() { - return this.innerContainerProperties() == null ? null : this.innerContainerProperties().deleted(); - } - - /** - * Get the deletedTime property: Blob container deletion time. - * - * @return the deletedTime value. - */ - public OffsetDateTime deletedTime() { - return this.innerContainerProperties() == null ? null : this.innerContainerProperties().deletedTime(); - } - - /** - * Get the remainingRetentionDays property: Remaining retention days for soft deleted blob container. - * - * @return the remainingRetentionDays value. - */ - public Integer remainingRetentionDays() { - return this.innerContainerProperties() == null - ? null - : this.innerContainerProperties().remainingRetentionDays(); - } - - /** - * Get the defaultEncryptionScope property: Default the container to use specified encryption scope for all writes. - * - * @return the defaultEncryptionScope value. - */ - public String defaultEncryptionScope() { - return this.innerContainerProperties() == null - ? null - : this.innerContainerProperties().defaultEncryptionScope(); - } - - /** - * Set the defaultEncryptionScope property: Default the container to use specified encryption scope for all writes. - * - * @param defaultEncryptionScope the defaultEncryptionScope value to set. - * @return the BlobContainerInner object itself. - */ - public BlobContainerInner withDefaultEncryptionScope(String defaultEncryptionScope) { - if (this.innerContainerProperties() == null) { - this.innerContainerProperties = new ContainerProperties(); - } - this.innerContainerProperties().withDefaultEncryptionScope(defaultEncryptionScope); - return this; - } - - /** - * Get the denyEncryptionScopeOverride property: Block override of encryption scope from the container default. - * - * @return the denyEncryptionScopeOverride value. - */ - public Boolean denyEncryptionScopeOverride() { - return this.innerContainerProperties() == null - ? null - : this.innerContainerProperties().denyEncryptionScopeOverride(); - } - - /** - * Set the denyEncryptionScopeOverride property: Block override of encryption scope from the container default. - * - * @param denyEncryptionScopeOverride the denyEncryptionScopeOverride value to set. - * @return the BlobContainerInner object itself. - */ - public BlobContainerInner withDenyEncryptionScopeOverride(Boolean denyEncryptionScopeOverride) { - if (this.innerContainerProperties() == null) { - this.innerContainerProperties = new ContainerProperties(); - } - this.innerContainerProperties().withDenyEncryptionScopeOverride(denyEncryptionScopeOverride); - return this; - } - - /** - * Get the publicAccess property: Specifies whether data in the container may be accessed publicly and the level of - * access. - * - * @return the publicAccess value. - */ - public PublicAccess publicAccess() { - return this.innerContainerProperties() == null ? null : this.innerContainerProperties().publicAccess(); - } - - /** - * Set the publicAccess property: Specifies whether data in the container may be accessed publicly and the level of - * access. - * - * @param publicAccess the publicAccess value to set. - * @return the BlobContainerInner object itself. - */ - public BlobContainerInner withPublicAccess(PublicAccess publicAccess) { - if (this.innerContainerProperties() == null) { - this.innerContainerProperties = new ContainerProperties(); - } - this.innerContainerProperties().withPublicAccess(publicAccess); - return this; - } - - /** - * Get the lastModifiedTime property: Returns the date and time the container was last modified. - * - * @return the lastModifiedTime value. - */ - public OffsetDateTime lastModifiedTime() { - return this.innerContainerProperties() == null ? null : this.innerContainerProperties().lastModifiedTime(); - } - - /** - * Get the leaseStatus property: The lease status of the container. - * - * @return the leaseStatus value. - */ - public LeaseStatus leaseStatus() { - return this.innerContainerProperties() == null ? null : this.innerContainerProperties().leaseStatus(); - } - - /** - * Get the leaseState property: Lease state of the container. - * - * @return the leaseState value. - */ - public LeaseState leaseState() { - return this.innerContainerProperties() == null ? null : this.innerContainerProperties().leaseState(); - } - - /** - * Get the leaseDuration property: Specifies whether the lease on a container is of infinite or fixed duration, only - * when the container is leased. - * - * @return the leaseDuration value. - */ - public LeaseDuration leaseDuration() { - return this.innerContainerProperties() == null ? null : this.innerContainerProperties().leaseDuration(); - } - - /** - * Get the metadata property: A name-value pair to associate with the container as metadata. - * - * @return the metadata value. - */ - public Map metadata() { - return this.innerContainerProperties() == null ? null : this.innerContainerProperties().metadata(); - } - - /** - * Set the metadata property: A name-value pair to associate with the container as metadata. - * - * @param metadata the metadata value to set. - * @return the BlobContainerInner object itself. - */ - public BlobContainerInner withMetadata(Map metadata) { - if (this.innerContainerProperties() == null) { - this.innerContainerProperties = new ContainerProperties(); - } - this.innerContainerProperties().withMetadata(metadata); - return this; - } - - /** - * Get the immutabilityPolicy property: The ImmutabilityPolicy property of the container. - * - * @return the immutabilityPolicy value. - */ - public ImmutabilityPolicyProperties immutabilityPolicy() { - return this.innerContainerProperties() == null ? null : this.innerContainerProperties().immutabilityPolicy(); - } - - /** - * Get the legalHold property: The LegalHold property of the container. - * - * @return the legalHold value. - */ - public LegalHoldProperties legalHold() { - return this.innerContainerProperties() == null ? null : this.innerContainerProperties().legalHold(); - } - - /** - * Get the hasLegalHold property: The hasLegalHold public property is set to true by SRP if there are at least one - * existing tag. The hasLegalHold public property is set to false by SRP if all existing legal hold tags are cleared - * out. There can be a maximum of 1000 blob containers with hasLegalHold=true for a given account. - * - * @return the hasLegalHold value. - */ - public Boolean hasLegalHold() { - return this.innerContainerProperties() == null ? null : this.innerContainerProperties().hasLegalHold(); - } - - /** - * Get the hasImmutabilityPolicy property: The hasImmutabilityPolicy public property is set to true by SRP if - * ImmutabilityPolicy has been created for this container. The hasImmutabilityPolicy public property is set to false - * by SRP if ImmutabilityPolicy has not been created for this container. - * - * @return the hasImmutabilityPolicy value. - */ - public Boolean hasImmutabilityPolicy() { - return this.innerContainerProperties() == null ? null : this.innerContainerProperties().hasImmutabilityPolicy(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerContainerProperties() != null) { - innerContainerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/BlobInventoryPolicyInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/BlobInventoryPolicyInner.java deleted file mode 100644 index 3a88860d2a0f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/BlobInventoryPolicyInner.java +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.storage.models.BlobInventoryPolicySchema; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** The storage account blob inventory policy. */ -@Fluent -public final class BlobInventoryPolicyInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BlobInventoryPolicyInner.class); - - /* - * Returns the storage account blob inventory policy rules. - */ - @JsonProperty(value = "properties") - private BlobInventoryPolicyProperties innerProperties; - - /* - * Metadata pertaining to creation and last modification of the resource. - */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) - private SystemData systemData; - - /** - * Get the innerProperties property: Returns the storage account blob inventory policy rules. - * - * @return the innerProperties value. - */ - private BlobInventoryPolicyProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the systemData property: Metadata pertaining to creation and last modification of the resource. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the lastModifiedTime property: Returns the last modified date and time of the blob inventory policy. - * - * @return the lastModifiedTime value. - */ - public OffsetDateTime lastModifiedTime() { - return this.innerProperties() == null ? null : this.innerProperties().lastModifiedTime(); - } - - /** - * Get the policy property: The storage account blob inventory policy object. It is composed of policy rules. - * - * @return the policy value. - */ - public BlobInventoryPolicySchema policy() { - return this.innerProperties() == null ? null : this.innerProperties().policy(); - } - - /** - * Set the policy property: The storage account blob inventory policy object. It is composed of policy rules. - * - * @param policy the policy value to set. - * @return the BlobInventoryPolicyInner object itself. - */ - public BlobInventoryPolicyInner withPolicy(BlobInventoryPolicySchema policy) { - if (this.innerProperties() == null) { - this.innerProperties = new BlobInventoryPolicyProperties(); - } - this.innerProperties().withPolicy(policy); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/BlobInventoryPolicyProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/BlobInventoryPolicyProperties.java deleted file mode 100644 index 28b1bfc45029..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/BlobInventoryPolicyProperties.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.storage.models.BlobInventoryPolicySchema; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** The storage account blob inventory policy properties. */ -@Fluent -public final class BlobInventoryPolicyProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BlobInventoryPolicyProperties.class); - - /* - * Returns the last modified date and time of the blob inventory policy. - */ - @JsonProperty(value = "lastModifiedTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime lastModifiedTime; - - /* - * The storage account blob inventory policy object. It is composed of - * policy rules. - */ - @JsonProperty(value = "policy", required = true) - private BlobInventoryPolicySchema policy; - - /** - * Get the lastModifiedTime property: Returns the last modified date and time of the blob inventory policy. - * - * @return the lastModifiedTime value. - */ - public OffsetDateTime lastModifiedTime() { - return this.lastModifiedTime; - } - - /** - * Get the policy property: The storage account blob inventory policy object. It is composed of policy rules. - * - * @return the policy value. - */ - public BlobInventoryPolicySchema policy() { - return this.policy; - } - - /** - * Set the policy property: The storage account blob inventory policy object. It is composed of policy rules. - * - * @param policy the policy value to set. - * @return the BlobInventoryPolicyProperties object itself. - */ - public BlobInventoryPolicyProperties withPolicy(BlobInventoryPolicySchema policy) { - this.policy = policy; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (policy() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property policy in model BlobInventoryPolicyProperties")); - } else { - policy().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/BlobRestoreStatusInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/BlobRestoreStatusInner.java deleted file mode 100644 index de1d20c3e76d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/BlobRestoreStatusInner.java +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.storage.models.BlobRestoreParameters; -import com.azure.resourcemanager.storage.models.BlobRestoreProgressStatus; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Blob restore status. */ -@Immutable -public final class BlobRestoreStatusInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BlobRestoreStatusInner.class); - - /* - * The status of blob restore progress. Possible values are: - InProgress: - * Indicates that blob restore is ongoing. - Complete: Indicates that blob - * restore has been completed successfully. - Failed: Indicates that blob - * restore is failed. - */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) - private BlobRestoreProgressStatus status; - - /* - * Failure reason when blob restore is failed. - */ - @JsonProperty(value = "failureReason", access = JsonProperty.Access.WRITE_ONLY) - private String failureReason; - - /* - * Id for tracking blob restore request. - */ - @JsonProperty(value = "restoreId", access = JsonProperty.Access.WRITE_ONLY) - private String restoreId; - - /* - * Blob restore request parameters. - */ - @JsonProperty(value = "parameters", access = JsonProperty.Access.WRITE_ONLY) - private BlobRestoreParameters parameters; - - /** - * Get the status property: The status of blob restore progress. Possible values are: - InProgress: Indicates that - * blob restore is ongoing. - Complete: Indicates that blob restore has been completed successfully. - Failed: - * Indicates that blob restore is failed. - * - * @return the status value. - */ - public BlobRestoreProgressStatus status() { - return this.status; - } - - /** - * Get the failureReason property: Failure reason when blob restore is failed. - * - * @return the failureReason value. - */ - public String failureReason() { - return this.failureReason; - } - - /** - * Get the restoreId property: Id for tracking blob restore request. - * - * @return the restoreId value. - */ - public String restoreId() { - return this.restoreId; - } - - /** - * Get the parameters property: Blob restore request parameters. - * - * @return the parameters value. - */ - public BlobRestoreParameters parameters() { - return this.parameters; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (parameters() != null) { - parameters().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/BlobServicePropertiesInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/BlobServicePropertiesInner.java deleted file mode 100644 index 911b9535af09..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/BlobServicePropertiesInner.java +++ /dev/null @@ -1,298 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.storage.models.ChangeFeed; -import com.azure.resourcemanager.storage.models.CorsRules; -import com.azure.resourcemanager.storage.models.DeleteRetentionPolicy; -import com.azure.resourcemanager.storage.models.LastAccessTimeTrackingPolicy; -import com.azure.resourcemanager.storage.models.RestorePolicyProperties; -import com.azure.resourcemanager.storage.models.Sku; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The properties of a storage account’s Blob service. */ -@Fluent -public final class BlobServicePropertiesInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BlobServicePropertiesInner.class); - - /* - * The properties of a storage account’s Blob service. - */ - @JsonProperty(value = "properties") - private BlobServicePropertiesProperties innerBlobServiceProperties; - - /* - * Sku name and tier. - */ - @JsonProperty(value = "sku", access = JsonProperty.Access.WRITE_ONLY) - private Sku sku; - - /** - * Get the innerBlobServiceProperties property: The properties of a storage account’s Blob service. - * - * @return the innerBlobServiceProperties value. - */ - private BlobServicePropertiesProperties innerBlobServiceProperties() { - return this.innerBlobServiceProperties; - } - - /** - * Get the sku property: Sku name and tier. - * - * @return the sku value. - */ - public Sku sku() { - return this.sku; - } - - /** - * Get the cors property: Specifies CORS rules for the Blob service. You can include up to five CorsRule elements in - * the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS - * will be disabled for the Blob service. - * - * @return the cors value. - */ - public CorsRules cors() { - return this.innerBlobServiceProperties() == null ? null : this.innerBlobServiceProperties().cors(); - } - - /** - * Set the cors property: Specifies CORS rules for the Blob service. You can include up to five CorsRule elements in - * the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS - * will be disabled for the Blob service. - * - * @param cors the cors value to set. - * @return the BlobServicePropertiesInner object itself. - */ - public BlobServicePropertiesInner withCors(CorsRules cors) { - if (this.innerBlobServiceProperties() == null) { - this.innerBlobServiceProperties = new BlobServicePropertiesProperties(); - } - this.innerBlobServiceProperties().withCors(cors); - return this; - } - - /** - * Get the defaultServiceVersion property: DefaultServiceVersion indicates the default version to use for requests - * to the Blob service if an incoming request’s version is not specified. Possible values include version 2008-10-27 - * and all more recent versions. - * - * @return the defaultServiceVersion value. - */ - public String defaultServiceVersion() { - return this.innerBlobServiceProperties() == null - ? null - : this.innerBlobServiceProperties().defaultServiceVersion(); - } - - /** - * Set the defaultServiceVersion property: DefaultServiceVersion indicates the default version to use for requests - * to the Blob service if an incoming request’s version is not specified. Possible values include version 2008-10-27 - * and all more recent versions. - * - * @param defaultServiceVersion the defaultServiceVersion value to set. - * @return the BlobServicePropertiesInner object itself. - */ - public BlobServicePropertiesInner withDefaultServiceVersion(String defaultServiceVersion) { - if (this.innerBlobServiceProperties() == null) { - this.innerBlobServiceProperties = new BlobServicePropertiesProperties(); - } - this.innerBlobServiceProperties().withDefaultServiceVersion(defaultServiceVersion); - return this; - } - - /** - * Get the deleteRetentionPolicy property: The blob service properties for blob soft delete. - * - * @return the deleteRetentionPolicy value. - */ - public DeleteRetentionPolicy deleteRetentionPolicy() { - return this.innerBlobServiceProperties() == null - ? null - : this.innerBlobServiceProperties().deleteRetentionPolicy(); - } - - /** - * Set the deleteRetentionPolicy property: The blob service properties for blob soft delete. - * - * @param deleteRetentionPolicy the deleteRetentionPolicy value to set. - * @return the BlobServicePropertiesInner object itself. - */ - public BlobServicePropertiesInner withDeleteRetentionPolicy(DeleteRetentionPolicy deleteRetentionPolicy) { - if (this.innerBlobServiceProperties() == null) { - this.innerBlobServiceProperties = new BlobServicePropertiesProperties(); - } - this.innerBlobServiceProperties().withDeleteRetentionPolicy(deleteRetentionPolicy); - return this; - } - - /** - * Get the isVersioningEnabled property: Versioning is enabled if set to true. - * - * @return the isVersioningEnabled value. - */ - public Boolean isVersioningEnabled() { - return this.innerBlobServiceProperties() == null - ? null - : this.innerBlobServiceProperties().isVersioningEnabled(); - } - - /** - * Set the isVersioningEnabled property: Versioning is enabled if set to true. - * - * @param isVersioningEnabled the isVersioningEnabled value to set. - * @return the BlobServicePropertiesInner object itself. - */ - public BlobServicePropertiesInner withIsVersioningEnabled(Boolean isVersioningEnabled) { - if (this.innerBlobServiceProperties() == null) { - this.innerBlobServiceProperties = new BlobServicePropertiesProperties(); - } - this.innerBlobServiceProperties().withIsVersioningEnabled(isVersioningEnabled); - return this; - } - - /** - * Get the automaticSnapshotPolicyEnabled property: Deprecated in favor of isVersioningEnabled property. - * - * @return the automaticSnapshotPolicyEnabled value. - */ - public Boolean automaticSnapshotPolicyEnabled() { - return this.innerBlobServiceProperties() == null - ? null - : this.innerBlobServiceProperties().automaticSnapshotPolicyEnabled(); - } - - /** - * Set the automaticSnapshotPolicyEnabled property: Deprecated in favor of isVersioningEnabled property. - * - * @param automaticSnapshotPolicyEnabled the automaticSnapshotPolicyEnabled value to set. - * @return the BlobServicePropertiesInner object itself. - */ - public BlobServicePropertiesInner withAutomaticSnapshotPolicyEnabled(Boolean automaticSnapshotPolicyEnabled) { - if (this.innerBlobServiceProperties() == null) { - this.innerBlobServiceProperties = new BlobServicePropertiesProperties(); - } - this.innerBlobServiceProperties().withAutomaticSnapshotPolicyEnabled(automaticSnapshotPolicyEnabled); - return this; - } - - /** - * Get the changeFeed property: The blob service properties for change feed events. - * - * @return the changeFeed value. - */ - public ChangeFeed changeFeed() { - return this.innerBlobServiceProperties() == null ? null : this.innerBlobServiceProperties().changeFeed(); - } - - /** - * Set the changeFeed property: The blob service properties for change feed events. - * - * @param changeFeed the changeFeed value to set. - * @return the BlobServicePropertiesInner object itself. - */ - public BlobServicePropertiesInner withChangeFeed(ChangeFeed changeFeed) { - if (this.innerBlobServiceProperties() == null) { - this.innerBlobServiceProperties = new BlobServicePropertiesProperties(); - } - this.innerBlobServiceProperties().withChangeFeed(changeFeed); - return this; - } - - /** - * Get the restorePolicy property: The blob service properties for blob restore policy. - * - * @return the restorePolicy value. - */ - public RestorePolicyProperties restorePolicy() { - return this.innerBlobServiceProperties() == null ? null : this.innerBlobServiceProperties().restorePolicy(); - } - - /** - * Set the restorePolicy property: The blob service properties for blob restore policy. - * - * @param restorePolicy the restorePolicy value to set. - * @return the BlobServicePropertiesInner object itself. - */ - public BlobServicePropertiesInner withRestorePolicy(RestorePolicyProperties restorePolicy) { - if (this.innerBlobServiceProperties() == null) { - this.innerBlobServiceProperties = new BlobServicePropertiesProperties(); - } - this.innerBlobServiceProperties().withRestorePolicy(restorePolicy); - return this; - } - - /** - * Get the containerDeleteRetentionPolicy property: The blob service properties for container soft delete. - * - * @return the containerDeleteRetentionPolicy value. - */ - public DeleteRetentionPolicy containerDeleteRetentionPolicy() { - return this.innerBlobServiceProperties() == null - ? null - : this.innerBlobServiceProperties().containerDeleteRetentionPolicy(); - } - - /** - * Set the containerDeleteRetentionPolicy property: The blob service properties for container soft delete. - * - * @param containerDeleteRetentionPolicy the containerDeleteRetentionPolicy value to set. - * @return the BlobServicePropertiesInner object itself. - */ - public BlobServicePropertiesInner withContainerDeleteRetentionPolicy( - DeleteRetentionPolicy containerDeleteRetentionPolicy) { - if (this.innerBlobServiceProperties() == null) { - this.innerBlobServiceProperties = new BlobServicePropertiesProperties(); - } - this.innerBlobServiceProperties().withContainerDeleteRetentionPolicy(containerDeleteRetentionPolicy); - return this; - } - - /** - * Get the lastAccessTimeTrackingPolicy property: The blob service property to configure last access time based - * tracking policy. - * - * @return the lastAccessTimeTrackingPolicy value. - */ - public LastAccessTimeTrackingPolicy lastAccessTimeTrackingPolicy() { - return this.innerBlobServiceProperties() == null - ? null - : this.innerBlobServiceProperties().lastAccessTimeTrackingPolicy(); - } - - /** - * Set the lastAccessTimeTrackingPolicy property: The blob service property to configure last access time based - * tracking policy. - * - * @param lastAccessTimeTrackingPolicy the lastAccessTimeTrackingPolicy value to set. - * @return the BlobServicePropertiesInner object itself. - */ - public BlobServicePropertiesInner withLastAccessTimeTrackingPolicy( - LastAccessTimeTrackingPolicy lastAccessTimeTrackingPolicy) { - if (this.innerBlobServiceProperties() == null) { - this.innerBlobServiceProperties = new BlobServicePropertiesProperties(); - } - this.innerBlobServiceProperties().withLastAccessTimeTrackingPolicy(lastAccessTimeTrackingPolicy); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerBlobServiceProperties() != null) { - innerBlobServiceProperties().validate(); - } - if (sku() != null) { - sku().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/BlobServicePropertiesProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/BlobServicePropertiesProperties.java deleted file mode 100644 index c92995d02032..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/BlobServicePropertiesProperties.java +++ /dev/null @@ -1,299 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.storage.models.ChangeFeed; -import com.azure.resourcemanager.storage.models.CorsRules; -import com.azure.resourcemanager.storage.models.DeleteRetentionPolicy; -import com.azure.resourcemanager.storage.models.LastAccessTimeTrackingPolicy; -import com.azure.resourcemanager.storage.models.RestorePolicyProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The properties of a storage account’s Blob service. */ -@Fluent -public final class BlobServicePropertiesProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BlobServicePropertiesProperties.class); - - /* - * Specifies CORS rules for the Blob service. You can include up to five - * CorsRule elements in the request. If no CorsRule elements are included - * in the request body, all CORS rules will be deleted, and CORS will be - * disabled for the Blob service. - */ - @JsonProperty(value = "cors") - private CorsRules cors; - - /* - * DefaultServiceVersion indicates the default version to use for requests - * to the Blob service if an incoming request’s version is not specified. - * Possible values include version 2008-10-27 and all more recent versions. - */ - @JsonProperty(value = "defaultServiceVersion") - private String defaultServiceVersion; - - /* - * The blob service properties for blob soft delete. - */ - @JsonProperty(value = "deleteRetentionPolicy") - private DeleteRetentionPolicy deleteRetentionPolicy; - - /* - * Versioning is enabled if set to true. - */ - @JsonProperty(value = "isVersioningEnabled") - private Boolean isVersioningEnabled; - - /* - * Deprecated in favor of isVersioningEnabled property. - */ - @JsonProperty(value = "automaticSnapshotPolicyEnabled") - private Boolean automaticSnapshotPolicyEnabled; - - /* - * The blob service properties for change feed events. - */ - @JsonProperty(value = "changeFeed") - private ChangeFeed changeFeed; - - /* - * The blob service properties for blob restore policy. - */ - @JsonProperty(value = "restorePolicy") - private RestorePolicyProperties restorePolicy; - - /* - * The blob service properties for container soft delete. - */ - @JsonProperty(value = "containerDeleteRetentionPolicy") - private DeleteRetentionPolicy containerDeleteRetentionPolicy; - - /* - * The blob service property to configure last access time based tracking - * policy. - */ - @JsonProperty(value = "lastAccessTimeTrackingPolicy") - private LastAccessTimeTrackingPolicy lastAccessTimeTrackingPolicy; - - /** - * Get the cors property: Specifies CORS rules for the Blob service. You can include up to five CorsRule elements in - * the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS - * will be disabled for the Blob service. - * - * @return the cors value. - */ - public CorsRules cors() { - return this.cors; - } - - /** - * Set the cors property: Specifies CORS rules for the Blob service. You can include up to five CorsRule elements in - * the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS - * will be disabled for the Blob service. - * - * @param cors the cors value to set. - * @return the BlobServicePropertiesProperties object itself. - */ - public BlobServicePropertiesProperties withCors(CorsRules cors) { - this.cors = cors; - return this; - } - - /** - * Get the defaultServiceVersion property: DefaultServiceVersion indicates the default version to use for requests - * to the Blob service if an incoming request’s version is not specified. Possible values include version 2008-10-27 - * and all more recent versions. - * - * @return the defaultServiceVersion value. - */ - public String defaultServiceVersion() { - return this.defaultServiceVersion; - } - - /** - * Set the defaultServiceVersion property: DefaultServiceVersion indicates the default version to use for requests - * to the Blob service if an incoming request’s version is not specified. Possible values include version 2008-10-27 - * and all more recent versions. - * - * @param defaultServiceVersion the defaultServiceVersion value to set. - * @return the BlobServicePropertiesProperties object itself. - */ - public BlobServicePropertiesProperties withDefaultServiceVersion(String defaultServiceVersion) { - this.defaultServiceVersion = defaultServiceVersion; - return this; - } - - /** - * Get the deleteRetentionPolicy property: The blob service properties for blob soft delete. - * - * @return the deleteRetentionPolicy value. - */ - public DeleteRetentionPolicy deleteRetentionPolicy() { - return this.deleteRetentionPolicy; - } - - /** - * Set the deleteRetentionPolicy property: The blob service properties for blob soft delete. - * - * @param deleteRetentionPolicy the deleteRetentionPolicy value to set. - * @return the BlobServicePropertiesProperties object itself. - */ - public BlobServicePropertiesProperties withDeleteRetentionPolicy(DeleteRetentionPolicy deleteRetentionPolicy) { - this.deleteRetentionPolicy = deleteRetentionPolicy; - return this; - } - - /** - * Get the isVersioningEnabled property: Versioning is enabled if set to true. - * - * @return the isVersioningEnabled value. - */ - public Boolean isVersioningEnabled() { - return this.isVersioningEnabled; - } - - /** - * Set the isVersioningEnabled property: Versioning is enabled if set to true. - * - * @param isVersioningEnabled the isVersioningEnabled value to set. - * @return the BlobServicePropertiesProperties object itself. - */ - public BlobServicePropertiesProperties withIsVersioningEnabled(Boolean isVersioningEnabled) { - this.isVersioningEnabled = isVersioningEnabled; - return this; - } - - /** - * Get the automaticSnapshotPolicyEnabled property: Deprecated in favor of isVersioningEnabled property. - * - * @return the automaticSnapshotPolicyEnabled value. - */ - public Boolean automaticSnapshotPolicyEnabled() { - return this.automaticSnapshotPolicyEnabled; - } - - /** - * Set the automaticSnapshotPolicyEnabled property: Deprecated in favor of isVersioningEnabled property. - * - * @param automaticSnapshotPolicyEnabled the automaticSnapshotPolicyEnabled value to set. - * @return the BlobServicePropertiesProperties object itself. - */ - public BlobServicePropertiesProperties withAutomaticSnapshotPolicyEnabled(Boolean automaticSnapshotPolicyEnabled) { - this.automaticSnapshotPolicyEnabled = automaticSnapshotPolicyEnabled; - return this; - } - - /** - * Get the changeFeed property: The blob service properties for change feed events. - * - * @return the changeFeed value. - */ - public ChangeFeed changeFeed() { - return this.changeFeed; - } - - /** - * Set the changeFeed property: The blob service properties for change feed events. - * - * @param changeFeed the changeFeed value to set. - * @return the BlobServicePropertiesProperties object itself. - */ - public BlobServicePropertiesProperties withChangeFeed(ChangeFeed changeFeed) { - this.changeFeed = changeFeed; - return this; - } - - /** - * Get the restorePolicy property: The blob service properties for blob restore policy. - * - * @return the restorePolicy value. - */ - public RestorePolicyProperties restorePolicy() { - return this.restorePolicy; - } - - /** - * Set the restorePolicy property: The blob service properties for blob restore policy. - * - * @param restorePolicy the restorePolicy value to set. - * @return the BlobServicePropertiesProperties object itself. - */ - public BlobServicePropertiesProperties withRestorePolicy(RestorePolicyProperties restorePolicy) { - this.restorePolicy = restorePolicy; - return this; - } - - /** - * Get the containerDeleteRetentionPolicy property: The blob service properties for container soft delete. - * - * @return the containerDeleteRetentionPolicy value. - */ - public DeleteRetentionPolicy containerDeleteRetentionPolicy() { - return this.containerDeleteRetentionPolicy; - } - - /** - * Set the containerDeleteRetentionPolicy property: The blob service properties for container soft delete. - * - * @param containerDeleteRetentionPolicy the containerDeleteRetentionPolicy value to set. - * @return the BlobServicePropertiesProperties object itself. - */ - public BlobServicePropertiesProperties withContainerDeleteRetentionPolicy( - DeleteRetentionPolicy containerDeleteRetentionPolicy) { - this.containerDeleteRetentionPolicy = containerDeleteRetentionPolicy; - return this; - } - - /** - * Get the lastAccessTimeTrackingPolicy property: The blob service property to configure last access time based - * tracking policy. - * - * @return the lastAccessTimeTrackingPolicy value. - */ - public LastAccessTimeTrackingPolicy lastAccessTimeTrackingPolicy() { - return this.lastAccessTimeTrackingPolicy; - } - - /** - * Set the lastAccessTimeTrackingPolicy property: The blob service property to configure last access time based - * tracking policy. - * - * @param lastAccessTimeTrackingPolicy the lastAccessTimeTrackingPolicy value to set. - * @return the BlobServicePropertiesProperties object itself. - */ - public BlobServicePropertiesProperties withLastAccessTimeTrackingPolicy( - LastAccessTimeTrackingPolicy lastAccessTimeTrackingPolicy) { - this.lastAccessTimeTrackingPolicy = lastAccessTimeTrackingPolicy; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (cors() != null) { - cors().validate(); - } - if (deleteRetentionPolicy() != null) { - deleteRetentionPolicy().validate(); - } - if (changeFeed() != null) { - changeFeed().validate(); - } - if (restorePolicy() != null) { - restorePolicy().validate(); - } - if (containerDeleteRetentionPolicy() != null) { - containerDeleteRetentionPolicy().validate(); - } - if (lastAccessTimeTrackingPolicy() != null) { - lastAccessTimeTrackingPolicy().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/CheckNameAvailabilityResultInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/CheckNameAvailabilityResultInner.java deleted file mode 100644 index ccdf7da6052d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/CheckNameAvailabilityResultInner.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.storage.models.Reason; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The CheckNameAvailability operation response. */ -@Immutable -public final class CheckNameAvailabilityResultInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CheckNameAvailabilityResultInner.class); - - /* - * Gets a boolean value that indicates whether the name is available for - * you to use. If true, the name is available. If false, the name has - * already been taken or is invalid and cannot be used. - */ - @JsonProperty(value = "nameAvailable", access = JsonProperty.Access.WRITE_ONLY) - private Boolean nameAvailable; - - /* - * Gets the reason that a storage account name could not be used. The - * Reason element is only returned if NameAvailable is false. - */ - @JsonProperty(value = "reason", access = JsonProperty.Access.WRITE_ONLY) - private Reason reason; - - /* - * Gets an error message explaining the Reason value in more detail. - */ - @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) - private String message; - - /** - * Get the nameAvailable property: Gets a boolean value that indicates whether the name is available for you to use. - * If true, the name is available. If false, the name has already been taken or is invalid and cannot be used. - * - * @return the nameAvailable value. - */ - public Boolean nameAvailable() { - return this.nameAvailable; - } - - /** - * Get the reason property: Gets the reason that a storage account name could not be used. The Reason element is - * only returned if NameAvailable is false. - * - * @return the reason value. - */ - public Reason reason() { - return this.reason; - } - - /** - * Get the message property: Gets an error message explaining the Reason value in more detail. - * - * @return the message value. - */ - public String message() { - return this.message; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ContainerProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ContainerProperties.java deleted file mode 100644 index 8c269972c149..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ContainerProperties.java +++ /dev/null @@ -1,340 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.storage.models.ImmutabilityPolicyProperties; -import com.azure.resourcemanager.storage.models.LeaseDuration; -import com.azure.resourcemanager.storage.models.LeaseState; -import com.azure.resourcemanager.storage.models.LeaseStatus; -import com.azure.resourcemanager.storage.models.LegalHoldProperties; -import com.azure.resourcemanager.storage.models.PublicAccess; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.Map; - -/** The properties of a container. */ -@Fluent -public final class ContainerProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ContainerProperties.class); - - /* - * The version of the deleted blob container. - */ - @JsonProperty(value = "version", access = JsonProperty.Access.WRITE_ONLY) - private String version; - - /* - * Indicates whether the blob container was deleted. - */ - @JsonProperty(value = "deleted", access = JsonProperty.Access.WRITE_ONLY) - private Boolean deleted; - - /* - * Blob container deletion time. - */ - @JsonProperty(value = "deletedTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime deletedTime; - - /* - * Remaining retention days for soft deleted blob container. - */ - @JsonProperty(value = "remainingRetentionDays", access = JsonProperty.Access.WRITE_ONLY) - private Integer remainingRetentionDays; - - /* - * Default the container to use specified encryption scope for all writes. - */ - @JsonProperty(value = "defaultEncryptionScope") - private String defaultEncryptionScope; - - /* - * Block override of encryption scope from the container default. - */ - @JsonProperty(value = "denyEncryptionScopeOverride") - private Boolean denyEncryptionScopeOverride; - - /* - * Specifies whether data in the container may be accessed publicly and the - * level of access. - */ - @JsonProperty(value = "publicAccess") - private PublicAccess publicAccess; - - /* - * Returns the date and time the container was last modified. - */ - @JsonProperty(value = "lastModifiedTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime lastModifiedTime; - - /* - * The lease status of the container. - */ - @JsonProperty(value = "leaseStatus", access = JsonProperty.Access.WRITE_ONLY) - private LeaseStatus leaseStatus; - - /* - * Lease state of the container. - */ - @JsonProperty(value = "leaseState", access = JsonProperty.Access.WRITE_ONLY) - private LeaseState leaseState; - - /* - * Specifies whether the lease on a container is of infinite or fixed - * duration, only when the container is leased. - */ - @JsonProperty(value = "leaseDuration", access = JsonProperty.Access.WRITE_ONLY) - private LeaseDuration leaseDuration; - - /* - * A name-value pair to associate with the container as metadata. - */ - @JsonProperty(value = "metadata") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map metadata; - - /* - * The ImmutabilityPolicy property of the container. - */ - @JsonProperty(value = "immutabilityPolicy", access = JsonProperty.Access.WRITE_ONLY) - private ImmutabilityPolicyProperties immutabilityPolicy; - - /* - * The LegalHold property of the container. - */ - @JsonProperty(value = "legalHold", access = JsonProperty.Access.WRITE_ONLY) - private LegalHoldProperties legalHold; - - /* - * The hasLegalHold public property is set to true by SRP if there are at - * least one existing tag. The hasLegalHold public property is set to false - * by SRP if all existing legal hold tags are cleared out. There can be a - * maximum of 1000 blob containers with hasLegalHold=true for a given - * account. - */ - @JsonProperty(value = "hasLegalHold", access = JsonProperty.Access.WRITE_ONLY) - private Boolean hasLegalHold; - - /* - * The hasImmutabilityPolicy public property is set to true by SRP if - * ImmutabilityPolicy has been created for this container. The - * hasImmutabilityPolicy public property is set to false by SRP if - * ImmutabilityPolicy has not been created for this container. - */ - @JsonProperty(value = "hasImmutabilityPolicy", access = JsonProperty.Access.WRITE_ONLY) - private Boolean hasImmutabilityPolicy; - - /** - * Get the version property: The version of the deleted blob container. - * - * @return the version value. - */ - public String version() { - return this.version; - } - - /** - * Get the deleted property: Indicates whether the blob container was deleted. - * - * @return the deleted value. - */ - public Boolean deleted() { - return this.deleted; - } - - /** - * Get the deletedTime property: Blob container deletion time. - * - * @return the deletedTime value. - */ - public OffsetDateTime deletedTime() { - return this.deletedTime; - } - - /** - * Get the remainingRetentionDays property: Remaining retention days for soft deleted blob container. - * - * @return the remainingRetentionDays value. - */ - public Integer remainingRetentionDays() { - return this.remainingRetentionDays; - } - - /** - * Get the defaultEncryptionScope property: Default the container to use specified encryption scope for all writes. - * - * @return the defaultEncryptionScope value. - */ - public String defaultEncryptionScope() { - return this.defaultEncryptionScope; - } - - /** - * Set the defaultEncryptionScope property: Default the container to use specified encryption scope for all writes. - * - * @param defaultEncryptionScope the defaultEncryptionScope value to set. - * @return the ContainerProperties object itself. - */ - public ContainerProperties withDefaultEncryptionScope(String defaultEncryptionScope) { - this.defaultEncryptionScope = defaultEncryptionScope; - return this; - } - - /** - * Get the denyEncryptionScopeOverride property: Block override of encryption scope from the container default. - * - * @return the denyEncryptionScopeOverride value. - */ - public Boolean denyEncryptionScopeOverride() { - return this.denyEncryptionScopeOverride; - } - - /** - * Set the denyEncryptionScopeOverride property: Block override of encryption scope from the container default. - * - * @param denyEncryptionScopeOverride the denyEncryptionScopeOverride value to set. - * @return the ContainerProperties object itself. - */ - public ContainerProperties withDenyEncryptionScopeOverride(Boolean denyEncryptionScopeOverride) { - this.denyEncryptionScopeOverride = denyEncryptionScopeOverride; - return this; - } - - /** - * Get the publicAccess property: Specifies whether data in the container may be accessed publicly and the level of - * access. - * - * @return the publicAccess value. - */ - public PublicAccess publicAccess() { - return this.publicAccess; - } - - /** - * Set the publicAccess property: Specifies whether data in the container may be accessed publicly and the level of - * access. - * - * @param publicAccess the publicAccess value to set. - * @return the ContainerProperties object itself. - */ - public ContainerProperties withPublicAccess(PublicAccess publicAccess) { - this.publicAccess = publicAccess; - return this; - } - - /** - * Get the lastModifiedTime property: Returns the date and time the container was last modified. - * - * @return the lastModifiedTime value. - */ - public OffsetDateTime lastModifiedTime() { - return this.lastModifiedTime; - } - - /** - * Get the leaseStatus property: The lease status of the container. - * - * @return the leaseStatus value. - */ - public LeaseStatus leaseStatus() { - return this.leaseStatus; - } - - /** - * Get the leaseState property: Lease state of the container. - * - * @return the leaseState value. - */ - public LeaseState leaseState() { - return this.leaseState; - } - - /** - * Get the leaseDuration property: Specifies whether the lease on a container is of infinite or fixed duration, only - * when the container is leased. - * - * @return the leaseDuration value. - */ - public LeaseDuration leaseDuration() { - return this.leaseDuration; - } - - /** - * Get the metadata property: A name-value pair to associate with the container as metadata. - * - * @return the metadata value. - */ - public Map metadata() { - return this.metadata; - } - - /** - * Set the metadata property: A name-value pair to associate with the container as metadata. - * - * @param metadata the metadata value to set. - * @return the ContainerProperties object itself. - */ - public ContainerProperties withMetadata(Map metadata) { - this.metadata = metadata; - return this; - } - - /** - * Get the immutabilityPolicy property: The ImmutabilityPolicy property of the container. - * - * @return the immutabilityPolicy value. - */ - public ImmutabilityPolicyProperties immutabilityPolicy() { - return this.immutabilityPolicy; - } - - /** - * Get the legalHold property: The LegalHold property of the container. - * - * @return the legalHold value. - */ - public LegalHoldProperties legalHold() { - return this.legalHold; - } - - /** - * Get the hasLegalHold property: The hasLegalHold public property is set to true by SRP if there are at least one - * existing tag. The hasLegalHold public property is set to false by SRP if all existing legal hold tags are cleared - * out. There can be a maximum of 1000 blob containers with hasLegalHold=true for a given account. - * - * @return the hasLegalHold value. - */ - public Boolean hasLegalHold() { - return this.hasLegalHold; - } - - /** - * Get the hasImmutabilityPolicy property: The hasImmutabilityPolicy public property is set to true by SRP if - * ImmutabilityPolicy has been created for this container. The hasImmutabilityPolicy public property is set to false - * by SRP if ImmutabilityPolicy has not been created for this container. - * - * @return the hasImmutabilityPolicy value. - */ - public Boolean hasImmutabilityPolicy() { - return this.hasImmutabilityPolicy; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (immutabilityPolicy() != null) { - immutabilityPolicy().validate(); - } - if (legalHold() != null) { - legalHold().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/EncryptionScopeInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/EncryptionScopeInner.java deleted file mode 100644 index 626c3a262861..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/EncryptionScopeInner.java +++ /dev/null @@ -1,144 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.storage.models.EncryptionScopeKeyVaultProperties; -import com.azure.resourcemanager.storage.models.EncryptionScopeSource; -import com.azure.resourcemanager.storage.models.EncryptionScopeState; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** The Encryption Scope resource. */ -@Fluent -public final class EncryptionScopeInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(EncryptionScopeInner.class); - - /* - * Properties of the encryption scope. - */ - @JsonProperty(value = "properties") - private EncryptionScopeProperties innerEncryptionScopeProperties; - - /** - * Get the innerEncryptionScopeProperties property: Properties of the encryption scope. - * - * @return the innerEncryptionScopeProperties value. - */ - private EncryptionScopeProperties innerEncryptionScopeProperties() { - return this.innerEncryptionScopeProperties; - } - - /** - * Get the source property: The provider for the encryption scope. Possible values (case-insensitive): - * Microsoft.Storage, Microsoft.KeyVault. - * - * @return the source value. - */ - public EncryptionScopeSource source() { - return this.innerEncryptionScopeProperties() == null ? null : this.innerEncryptionScopeProperties().source(); - } - - /** - * Set the source property: The provider for the encryption scope. Possible values (case-insensitive): - * Microsoft.Storage, Microsoft.KeyVault. - * - * @param source the source value to set. - * @return the EncryptionScopeInner object itself. - */ - public EncryptionScopeInner withSource(EncryptionScopeSource source) { - if (this.innerEncryptionScopeProperties() == null) { - this.innerEncryptionScopeProperties = new EncryptionScopeProperties(); - } - this.innerEncryptionScopeProperties().withSource(source); - return this; - } - - /** - * Get the state property: The state of the encryption scope. Possible values (case-insensitive): Enabled, Disabled. - * - * @return the state value. - */ - public EncryptionScopeState state() { - return this.innerEncryptionScopeProperties() == null ? null : this.innerEncryptionScopeProperties().state(); - } - - /** - * Set the state property: The state of the encryption scope. Possible values (case-insensitive): Enabled, Disabled. - * - * @param state the state value to set. - * @return the EncryptionScopeInner object itself. - */ - public EncryptionScopeInner withState(EncryptionScopeState state) { - if (this.innerEncryptionScopeProperties() == null) { - this.innerEncryptionScopeProperties = new EncryptionScopeProperties(); - } - this.innerEncryptionScopeProperties().withState(state); - return this; - } - - /** - * Get the creationTime property: Gets the creation date and time of the encryption scope in UTC. - * - * @return the creationTime value. - */ - public OffsetDateTime creationTime() { - return this.innerEncryptionScopeProperties() == null - ? null - : this.innerEncryptionScopeProperties().creationTime(); - } - - /** - * Get the lastModifiedTime property: Gets the last modification date and time of the encryption scope in UTC. - * - * @return the lastModifiedTime value. - */ - public OffsetDateTime lastModifiedTime() { - return this.innerEncryptionScopeProperties() == null - ? null - : this.innerEncryptionScopeProperties().lastModifiedTime(); - } - - /** - * Get the keyVaultProperties property: The key vault properties for the encryption scope. This is a required field - * if encryption scope 'source' attribute is set to 'Microsoft.KeyVault'. - * - * @return the keyVaultProperties value. - */ - public EncryptionScopeKeyVaultProperties keyVaultProperties() { - return this.innerEncryptionScopeProperties() == null - ? null - : this.innerEncryptionScopeProperties().keyVaultProperties(); - } - - /** - * Set the keyVaultProperties property: The key vault properties for the encryption scope. This is a required field - * if encryption scope 'source' attribute is set to 'Microsoft.KeyVault'. - * - * @param keyVaultProperties the keyVaultProperties value to set. - * @return the EncryptionScopeInner object itself. - */ - public EncryptionScopeInner withKeyVaultProperties(EncryptionScopeKeyVaultProperties keyVaultProperties) { - if (this.innerEncryptionScopeProperties() == null) { - this.innerEncryptionScopeProperties = new EncryptionScopeProperties(); - } - this.innerEncryptionScopeProperties().withKeyVaultProperties(keyVaultProperties); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerEncryptionScopeProperties() != null) { - innerEncryptionScopeProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/EncryptionScopeProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/EncryptionScopeProperties.java deleted file mode 100644 index 3f9e29ffbc29..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/EncryptionScopeProperties.java +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.storage.models.EncryptionScopeKeyVaultProperties; -import com.azure.resourcemanager.storage.models.EncryptionScopeSource; -import com.azure.resourcemanager.storage.models.EncryptionScopeState; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** Properties of the encryption scope. */ -@Fluent -public final class EncryptionScopeProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(EncryptionScopeProperties.class); - - /* - * The provider for the encryption scope. Possible values - * (case-insensitive): Microsoft.Storage, Microsoft.KeyVault. - */ - @JsonProperty(value = "source") - private EncryptionScopeSource source; - - /* - * The state of the encryption scope. Possible values (case-insensitive): - * Enabled, Disabled. - */ - @JsonProperty(value = "state") - private EncryptionScopeState state; - - /* - * Gets the creation date and time of the encryption scope in UTC. - */ - @JsonProperty(value = "creationTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime creationTime; - - /* - * Gets the last modification date and time of the encryption scope in UTC. - */ - @JsonProperty(value = "lastModifiedTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime lastModifiedTime; - - /* - * The key vault properties for the encryption scope. This is a required - * field if encryption scope 'source' attribute is set to - * 'Microsoft.KeyVault'. - */ - @JsonProperty(value = "keyVaultProperties") - private EncryptionScopeKeyVaultProperties keyVaultProperties; - - /** - * Get the source property: The provider for the encryption scope. Possible values (case-insensitive): - * Microsoft.Storage, Microsoft.KeyVault. - * - * @return the source value. - */ - public EncryptionScopeSource source() { - return this.source; - } - - /** - * Set the source property: The provider for the encryption scope. Possible values (case-insensitive): - * Microsoft.Storage, Microsoft.KeyVault. - * - * @param source the source value to set. - * @return the EncryptionScopeProperties object itself. - */ - public EncryptionScopeProperties withSource(EncryptionScopeSource source) { - this.source = source; - return this; - } - - /** - * Get the state property: The state of the encryption scope. Possible values (case-insensitive): Enabled, Disabled. - * - * @return the state value. - */ - public EncryptionScopeState state() { - return this.state; - } - - /** - * Set the state property: The state of the encryption scope. Possible values (case-insensitive): Enabled, Disabled. - * - * @param state the state value to set. - * @return the EncryptionScopeProperties object itself. - */ - public EncryptionScopeProperties withState(EncryptionScopeState state) { - this.state = state; - return this; - } - - /** - * Get the creationTime property: Gets the creation date and time of the encryption scope in UTC. - * - * @return the creationTime value. - */ - public OffsetDateTime creationTime() { - return this.creationTime; - } - - /** - * Get the lastModifiedTime property: Gets the last modification date and time of the encryption scope in UTC. - * - * @return the lastModifiedTime value. - */ - public OffsetDateTime lastModifiedTime() { - return this.lastModifiedTime; - } - - /** - * Get the keyVaultProperties property: The key vault properties for the encryption scope. This is a required field - * if encryption scope 'source' attribute is set to 'Microsoft.KeyVault'. - * - * @return the keyVaultProperties value. - */ - public EncryptionScopeKeyVaultProperties keyVaultProperties() { - return this.keyVaultProperties; - } - - /** - * Set the keyVaultProperties property: The key vault properties for the encryption scope. This is a required field - * if encryption scope 'source' attribute is set to 'Microsoft.KeyVault'. - * - * @param keyVaultProperties the keyVaultProperties value to set. - * @return the EncryptionScopeProperties object itself. - */ - public EncryptionScopeProperties withKeyVaultProperties(EncryptionScopeKeyVaultProperties keyVaultProperties) { - this.keyVaultProperties = keyVaultProperties; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (keyVaultProperties() != null) { - keyVaultProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/FileServiceItemsInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/FileServiceItemsInner.java deleted file mode 100644 index c53ab2d36957..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/FileServiceItemsInner.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The FileServiceItems model. */ -@Immutable -public final class FileServiceItemsInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(FileServiceItemsInner.class); - - /* - * List of file services returned. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /** - * Get the value property: List of file services returned. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/FileServicePropertiesInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/FileServicePropertiesInner.java deleted file mode 100644 index 409de35c97d7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/FileServicePropertiesInner.java +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.storage.models.CorsRules; -import com.azure.resourcemanager.storage.models.DeleteRetentionPolicy; -import com.azure.resourcemanager.storage.models.Sku; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The properties of File services in storage account. */ -@Fluent -public final class FileServicePropertiesInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(FileServicePropertiesInner.class); - - /* - * The properties of File services in storage account. - */ - @JsonProperty(value = "properties") - private FileServicePropertiesProperties innerFileServiceProperties; - - /* - * Sku name and tier. - */ - @JsonProperty(value = "sku", access = JsonProperty.Access.WRITE_ONLY) - private Sku sku; - - /** - * Get the innerFileServiceProperties property: The properties of File services in storage account. - * - * @return the innerFileServiceProperties value. - */ - private FileServicePropertiesProperties innerFileServiceProperties() { - return this.innerFileServiceProperties; - } - - /** - * Get the sku property: Sku name and tier. - * - * @return the sku value. - */ - public Sku sku() { - return this.sku; - } - - /** - * Get the cors property: Specifies CORS rules for the File service. You can include up to five CorsRule elements in - * the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS - * will be disabled for the File service. - * - * @return the cors value. - */ - public CorsRules cors() { - return this.innerFileServiceProperties() == null ? null : this.innerFileServiceProperties().cors(); - } - - /** - * Set the cors property: Specifies CORS rules for the File service. You can include up to five CorsRule elements in - * the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS - * will be disabled for the File service. - * - * @param cors the cors value to set. - * @return the FileServicePropertiesInner object itself. - */ - public FileServicePropertiesInner withCors(CorsRules cors) { - if (this.innerFileServiceProperties() == null) { - this.innerFileServiceProperties = new FileServicePropertiesProperties(); - } - this.innerFileServiceProperties().withCors(cors); - return this; - } - - /** - * Get the shareDeleteRetentionPolicy property: The file service properties for share soft delete. - * - * @return the shareDeleteRetentionPolicy value. - */ - public DeleteRetentionPolicy shareDeleteRetentionPolicy() { - return this.innerFileServiceProperties() == null - ? null - : this.innerFileServiceProperties().shareDeleteRetentionPolicy(); - } - - /** - * Set the shareDeleteRetentionPolicy property: The file service properties for share soft delete. - * - * @param shareDeleteRetentionPolicy the shareDeleteRetentionPolicy value to set. - * @return the FileServicePropertiesInner object itself. - */ - public FileServicePropertiesInner withShareDeleteRetentionPolicy(DeleteRetentionPolicy shareDeleteRetentionPolicy) { - if (this.innerFileServiceProperties() == null) { - this.innerFileServiceProperties = new FileServicePropertiesProperties(); - } - this.innerFileServiceProperties().withShareDeleteRetentionPolicy(shareDeleteRetentionPolicy); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerFileServiceProperties() != null) { - innerFileServiceProperties().validate(); - } - if (sku() != null) { - sku().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/FileServicePropertiesProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/FileServicePropertiesProperties.java deleted file mode 100644 index 3b1d5113c740..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/FileServicePropertiesProperties.java +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.storage.models.CorsRules; -import com.azure.resourcemanager.storage.models.DeleteRetentionPolicy; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The properties of File services in storage account. */ -@Fluent -public final class FileServicePropertiesProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(FileServicePropertiesProperties.class); - - /* - * Specifies CORS rules for the File service. You can include up to five - * CorsRule elements in the request. If no CorsRule elements are included - * in the request body, all CORS rules will be deleted, and CORS will be - * disabled for the File service. - */ - @JsonProperty(value = "cors") - private CorsRules cors; - - /* - * The file service properties for share soft delete. - */ - @JsonProperty(value = "shareDeleteRetentionPolicy") - private DeleteRetentionPolicy shareDeleteRetentionPolicy; - - /** - * Get the cors property: Specifies CORS rules for the File service. You can include up to five CorsRule elements in - * the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS - * will be disabled for the File service. - * - * @return the cors value. - */ - public CorsRules cors() { - return this.cors; - } - - /** - * Set the cors property: Specifies CORS rules for the File service. You can include up to five CorsRule elements in - * the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS - * will be disabled for the File service. - * - * @param cors the cors value to set. - * @return the FileServicePropertiesProperties object itself. - */ - public FileServicePropertiesProperties withCors(CorsRules cors) { - this.cors = cors; - return this; - } - - /** - * Get the shareDeleteRetentionPolicy property: The file service properties for share soft delete. - * - * @return the shareDeleteRetentionPolicy value. - */ - public DeleteRetentionPolicy shareDeleteRetentionPolicy() { - return this.shareDeleteRetentionPolicy; - } - - /** - * Set the shareDeleteRetentionPolicy property: The file service properties for share soft delete. - * - * @param shareDeleteRetentionPolicy the shareDeleteRetentionPolicy value to set. - * @return the FileServicePropertiesProperties object itself. - */ - public FileServicePropertiesProperties withShareDeleteRetentionPolicy( - DeleteRetentionPolicy shareDeleteRetentionPolicy) { - this.shareDeleteRetentionPolicy = shareDeleteRetentionPolicy; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (cors() != null) { - cors().validate(); - } - if (shareDeleteRetentionPolicy() != null) { - shareDeleteRetentionPolicy().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/FileShareInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/FileShareInner.java deleted file mode 100644 index 1565a2815106..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/FileShareInner.java +++ /dev/null @@ -1,246 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.storage.models.AzureEntityResource; -import com.azure.resourcemanager.storage.models.EnabledProtocols; -import com.azure.resourcemanager.storage.models.RootSquashType; -import com.azure.resourcemanager.storage.models.ShareAccessTier; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.Map; - -/** Properties of the file share, including Id, resource name, resource type, Etag. */ -@Fluent -public final class FileShareInner extends AzureEntityResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(FileShareInner.class); - - /* - * Properties of the file share. - */ - @JsonProperty(value = "properties") - private FileShareProperties innerFileShareProperties; - - /** - * Get the innerFileShareProperties property: Properties of the file share. - * - * @return the innerFileShareProperties value. - */ - private FileShareProperties innerFileShareProperties() { - return this.innerFileShareProperties; - } - - /** - * Get the lastModifiedTime property: Returns the date and time the share was last modified. - * - * @return the lastModifiedTime value. - */ - public OffsetDateTime lastModifiedTime() { - return this.innerFileShareProperties() == null ? null : this.innerFileShareProperties().lastModifiedTime(); - } - - /** - * Get the metadata property: A name-value pair to associate with the share as metadata. - * - * @return the metadata value. - */ - public Map metadata() { - return this.innerFileShareProperties() == null ? null : this.innerFileShareProperties().metadata(); - } - - /** - * Set the metadata property: A name-value pair to associate with the share as metadata. - * - * @param metadata the metadata value to set. - * @return the FileShareInner object itself. - */ - public FileShareInner withMetadata(Map metadata) { - if (this.innerFileShareProperties() == null) { - this.innerFileShareProperties = new FileShareProperties(); - } - this.innerFileShareProperties().withMetadata(metadata); - return this; - } - - /** - * Get the shareQuota property: The maximum size of the share, in gigabytes. Must be greater than 0, and less than - * or equal to 5TB (5120). For Large File Shares, the maximum size is 102400. - * - * @return the shareQuota value. - */ - public Integer shareQuota() { - return this.innerFileShareProperties() == null ? null : this.innerFileShareProperties().shareQuota(); - } - - /** - * Set the shareQuota property: The maximum size of the share, in gigabytes. Must be greater than 0, and less than - * or equal to 5TB (5120). For Large File Shares, the maximum size is 102400. - * - * @param shareQuota the shareQuota value to set. - * @return the FileShareInner object itself. - */ - public FileShareInner withShareQuota(Integer shareQuota) { - if (this.innerFileShareProperties() == null) { - this.innerFileShareProperties = new FileShareProperties(); - } - this.innerFileShareProperties().withShareQuota(shareQuota); - return this; - } - - /** - * Get the enabledProtocols property: The authentication protocol that is used for the file share. Can only be - * specified when creating a share. - * - * @return the enabledProtocols value. - */ - public EnabledProtocols enabledProtocols() { - return this.innerFileShareProperties() == null ? null : this.innerFileShareProperties().enabledProtocols(); - } - - /** - * Set the enabledProtocols property: The authentication protocol that is used for the file share. Can only be - * specified when creating a share. - * - * @param enabledProtocols the enabledProtocols value to set. - * @return the FileShareInner object itself. - */ - public FileShareInner withEnabledProtocols(EnabledProtocols enabledProtocols) { - if (this.innerFileShareProperties() == null) { - this.innerFileShareProperties = new FileShareProperties(); - } - this.innerFileShareProperties().withEnabledProtocols(enabledProtocols); - return this; - } - - /** - * Get the rootSquash property: The property is for NFS share only. The default is NoRootSquash. - * - * @return the rootSquash value. - */ - public RootSquashType rootSquash() { - return this.innerFileShareProperties() == null ? null : this.innerFileShareProperties().rootSquash(); - } - - /** - * Set the rootSquash property: The property is for NFS share only. The default is NoRootSquash. - * - * @param rootSquash the rootSquash value to set. - * @return the FileShareInner object itself. - */ - public FileShareInner withRootSquash(RootSquashType rootSquash) { - if (this.innerFileShareProperties() == null) { - this.innerFileShareProperties = new FileShareProperties(); - } - this.innerFileShareProperties().withRootSquash(rootSquash); - return this; - } - - /** - * Get the version property: The version of the share. - * - * @return the version value. - */ - public String version() { - return this.innerFileShareProperties() == null ? null : this.innerFileShareProperties().version(); - } - - /** - * Get the deleted property: Indicates whether the share was deleted. - * - * @return the deleted value. - */ - public Boolean deleted() { - return this.innerFileShareProperties() == null ? null : this.innerFileShareProperties().deleted(); - } - - /** - * Get the deletedTime property: The deleted time if the share was deleted. - * - * @return the deletedTime value. - */ - public OffsetDateTime deletedTime() { - return this.innerFileShareProperties() == null ? null : this.innerFileShareProperties().deletedTime(); - } - - /** - * Get the remainingRetentionDays property: Remaining retention days for share that was soft deleted. - * - * @return the remainingRetentionDays value. - */ - public Integer remainingRetentionDays() { - return this.innerFileShareProperties() == null - ? null - : this.innerFileShareProperties().remainingRetentionDays(); - } - - /** - * Get the accessTier property: Access tier for specific share. GpV2 account can choose between TransactionOptimized - * (default), Hot, and Cool. FileStorage account can choose Premium. - * - * @return the accessTier value. - */ - public ShareAccessTier accessTier() { - return this.innerFileShareProperties() == null ? null : this.innerFileShareProperties().accessTier(); - } - - /** - * Set the accessTier property: Access tier for specific share. GpV2 account can choose between TransactionOptimized - * (default), Hot, and Cool. FileStorage account can choose Premium. - * - * @param accessTier the accessTier value to set. - * @return the FileShareInner object itself. - */ - public FileShareInner withAccessTier(ShareAccessTier accessTier) { - if (this.innerFileShareProperties() == null) { - this.innerFileShareProperties = new FileShareProperties(); - } - this.innerFileShareProperties().withAccessTier(accessTier); - return this; - } - - /** - * Get the accessTierChangeTime property: Indicates the last modification time for share access tier. - * - * @return the accessTierChangeTime value. - */ - public OffsetDateTime accessTierChangeTime() { - return this.innerFileShareProperties() == null ? null : this.innerFileShareProperties().accessTierChangeTime(); - } - - /** - * Get the accessTierStatus property: Indicates if there is a pending transition for access tier. - * - * @return the accessTierStatus value. - */ - public String accessTierStatus() { - return this.innerFileShareProperties() == null ? null : this.innerFileShareProperties().accessTierStatus(); - } - - /** - * Get the shareUsageBytes property: The approximate size of the data stored on the share. Note that this value may - * not include all recently created or recently resized files. - * - * @return the shareUsageBytes value. - */ - public Long shareUsageBytes() { - return this.innerFileShareProperties() == null ? null : this.innerFileShareProperties().shareUsageBytes(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerFileShareProperties() != null) { - innerFileShareProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/FileShareItemInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/FileShareItemInner.java deleted file mode 100644 index ef940886451f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/FileShareItemInner.java +++ /dev/null @@ -1,244 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.storage.models.AzureEntityResource; -import com.azure.resourcemanager.storage.models.EnabledProtocols; -import com.azure.resourcemanager.storage.models.RootSquashType; -import com.azure.resourcemanager.storage.models.ShareAccessTier; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.Map; - -/** The file share properties be listed out. */ -@Fluent -public final class FileShareItemInner extends AzureEntityResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(FileShareItemInner.class); - - /* - * The file share properties be listed out. - */ - @JsonProperty(value = "properties") - private FileShareProperties innerProperties; - - /** - * Get the innerProperties property: The file share properties be listed out. - * - * @return the innerProperties value. - */ - private FileShareProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the lastModifiedTime property: Returns the date and time the share was last modified. - * - * @return the lastModifiedTime value. - */ - public OffsetDateTime lastModifiedTime() { - return this.innerProperties() == null ? null : this.innerProperties().lastModifiedTime(); - } - - /** - * Get the metadata property: A name-value pair to associate with the share as metadata. - * - * @return the metadata value. - */ - public Map metadata() { - return this.innerProperties() == null ? null : this.innerProperties().metadata(); - } - - /** - * Set the metadata property: A name-value pair to associate with the share as metadata. - * - * @param metadata the metadata value to set. - * @return the FileShareItemInner object itself. - */ - public FileShareItemInner withMetadata(Map metadata) { - if (this.innerProperties() == null) { - this.innerProperties = new FileShareProperties(); - } - this.innerProperties().withMetadata(metadata); - return this; - } - - /** - * Get the shareQuota property: The maximum size of the share, in gigabytes. Must be greater than 0, and less than - * or equal to 5TB (5120). For Large File Shares, the maximum size is 102400. - * - * @return the shareQuota value. - */ - public Integer shareQuota() { - return this.innerProperties() == null ? null : this.innerProperties().shareQuota(); - } - - /** - * Set the shareQuota property: The maximum size of the share, in gigabytes. Must be greater than 0, and less than - * or equal to 5TB (5120). For Large File Shares, the maximum size is 102400. - * - * @param shareQuota the shareQuota value to set. - * @return the FileShareItemInner object itself. - */ - public FileShareItemInner withShareQuota(Integer shareQuota) { - if (this.innerProperties() == null) { - this.innerProperties = new FileShareProperties(); - } - this.innerProperties().withShareQuota(shareQuota); - return this; - } - - /** - * Get the enabledProtocols property: The authentication protocol that is used for the file share. Can only be - * specified when creating a share. - * - * @return the enabledProtocols value. - */ - public EnabledProtocols enabledProtocols() { - return this.innerProperties() == null ? null : this.innerProperties().enabledProtocols(); - } - - /** - * Set the enabledProtocols property: The authentication protocol that is used for the file share. Can only be - * specified when creating a share. - * - * @param enabledProtocols the enabledProtocols value to set. - * @return the FileShareItemInner object itself. - */ - public FileShareItemInner withEnabledProtocols(EnabledProtocols enabledProtocols) { - if (this.innerProperties() == null) { - this.innerProperties = new FileShareProperties(); - } - this.innerProperties().withEnabledProtocols(enabledProtocols); - return this; - } - - /** - * Get the rootSquash property: The property is for NFS share only. The default is NoRootSquash. - * - * @return the rootSquash value. - */ - public RootSquashType rootSquash() { - return this.innerProperties() == null ? null : this.innerProperties().rootSquash(); - } - - /** - * Set the rootSquash property: The property is for NFS share only. The default is NoRootSquash. - * - * @param rootSquash the rootSquash value to set. - * @return the FileShareItemInner object itself. - */ - public FileShareItemInner withRootSquash(RootSquashType rootSquash) { - if (this.innerProperties() == null) { - this.innerProperties = new FileShareProperties(); - } - this.innerProperties().withRootSquash(rootSquash); - return this; - } - - /** - * Get the version property: The version of the share. - * - * @return the version value. - */ - public String version() { - return this.innerProperties() == null ? null : this.innerProperties().version(); - } - - /** - * Get the deleted property: Indicates whether the share was deleted. - * - * @return the deleted value. - */ - public Boolean deleted() { - return this.innerProperties() == null ? null : this.innerProperties().deleted(); - } - - /** - * Get the deletedTime property: The deleted time if the share was deleted. - * - * @return the deletedTime value. - */ - public OffsetDateTime deletedTime() { - return this.innerProperties() == null ? null : this.innerProperties().deletedTime(); - } - - /** - * Get the remainingRetentionDays property: Remaining retention days for share that was soft deleted. - * - * @return the remainingRetentionDays value. - */ - public Integer remainingRetentionDays() { - return this.innerProperties() == null ? null : this.innerProperties().remainingRetentionDays(); - } - - /** - * Get the accessTier property: Access tier for specific share. GpV2 account can choose between TransactionOptimized - * (default), Hot, and Cool. FileStorage account can choose Premium. - * - * @return the accessTier value. - */ - public ShareAccessTier accessTier() { - return this.innerProperties() == null ? null : this.innerProperties().accessTier(); - } - - /** - * Set the accessTier property: Access tier for specific share. GpV2 account can choose between TransactionOptimized - * (default), Hot, and Cool. FileStorage account can choose Premium. - * - * @param accessTier the accessTier value to set. - * @return the FileShareItemInner object itself. - */ - public FileShareItemInner withAccessTier(ShareAccessTier accessTier) { - if (this.innerProperties() == null) { - this.innerProperties = new FileShareProperties(); - } - this.innerProperties().withAccessTier(accessTier); - return this; - } - - /** - * Get the accessTierChangeTime property: Indicates the last modification time for share access tier. - * - * @return the accessTierChangeTime value. - */ - public OffsetDateTime accessTierChangeTime() { - return this.innerProperties() == null ? null : this.innerProperties().accessTierChangeTime(); - } - - /** - * Get the accessTierStatus property: Indicates if there is a pending transition for access tier. - * - * @return the accessTierStatus value. - */ - public String accessTierStatus() { - return this.innerProperties() == null ? null : this.innerProperties().accessTierStatus(); - } - - /** - * Get the shareUsageBytes property: The approximate size of the data stored on the share. Note that this value may - * not include all recently created or recently resized files. - * - * @return the shareUsageBytes value. - */ - public Long shareUsageBytes() { - return this.innerProperties() == null ? null : this.innerProperties().shareUsageBytes(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/FileShareProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/FileShareProperties.java deleted file mode 100644 index f9fce9d185d9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/FileShareProperties.java +++ /dev/null @@ -1,294 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.storage.models.EnabledProtocols; -import com.azure.resourcemanager.storage.models.RootSquashType; -import com.azure.resourcemanager.storage.models.ShareAccessTier; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.Map; - -/** The properties of the file share. */ -@Fluent -public final class FileShareProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(FileShareProperties.class); - - /* - * Returns the date and time the share was last modified. - */ - @JsonProperty(value = "lastModifiedTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime lastModifiedTime; - - /* - * A name-value pair to associate with the share as metadata. - */ - @JsonProperty(value = "metadata") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map metadata; - - /* - * The maximum size of the share, in gigabytes. Must be greater than 0, and - * less than or equal to 5TB (5120). For Large File Shares, the maximum - * size is 102400. - */ - @JsonProperty(value = "shareQuota") - private Integer shareQuota; - - /* - * The authentication protocol that is used for the file share. Can only be - * specified when creating a share. - */ - @JsonProperty(value = "enabledProtocols") - private EnabledProtocols enabledProtocols; - - /* - * The property is for NFS share only. The default is NoRootSquash. - */ - @JsonProperty(value = "rootSquash") - private RootSquashType rootSquash; - - /* - * The version of the share. - */ - @JsonProperty(value = "version", access = JsonProperty.Access.WRITE_ONLY) - private String version; - - /* - * Indicates whether the share was deleted. - */ - @JsonProperty(value = "deleted", access = JsonProperty.Access.WRITE_ONLY) - private Boolean deleted; - - /* - * The deleted time if the share was deleted. - */ - @JsonProperty(value = "deletedTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime deletedTime; - - /* - * Remaining retention days for share that was soft deleted. - */ - @JsonProperty(value = "remainingRetentionDays", access = JsonProperty.Access.WRITE_ONLY) - private Integer remainingRetentionDays; - - /* - * Access tier for specific share. GpV2 account can choose between - * TransactionOptimized (default), Hot, and Cool. FileStorage account can - * choose Premium. - */ - @JsonProperty(value = "accessTier") - private ShareAccessTier accessTier; - - /* - * Indicates the last modification time for share access tier. - */ - @JsonProperty(value = "accessTierChangeTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime accessTierChangeTime; - - /* - * Indicates if there is a pending transition for access tier. - */ - @JsonProperty(value = "accessTierStatus", access = JsonProperty.Access.WRITE_ONLY) - private String accessTierStatus; - - /* - * The approximate size of the data stored on the share. Note that this - * value may not include all recently created or recently resized files. - */ - @JsonProperty(value = "shareUsageBytes", access = JsonProperty.Access.WRITE_ONLY) - private Long shareUsageBytes; - - /** - * Get the lastModifiedTime property: Returns the date and time the share was last modified. - * - * @return the lastModifiedTime value. - */ - public OffsetDateTime lastModifiedTime() { - return this.lastModifiedTime; - } - - /** - * Get the metadata property: A name-value pair to associate with the share as metadata. - * - * @return the metadata value. - */ - public Map metadata() { - return this.metadata; - } - - /** - * Set the metadata property: A name-value pair to associate with the share as metadata. - * - * @param metadata the metadata value to set. - * @return the FileShareProperties object itself. - */ - public FileShareProperties withMetadata(Map metadata) { - this.metadata = metadata; - return this; - } - - /** - * Get the shareQuota property: The maximum size of the share, in gigabytes. Must be greater than 0, and less than - * or equal to 5TB (5120). For Large File Shares, the maximum size is 102400. - * - * @return the shareQuota value. - */ - public Integer shareQuota() { - return this.shareQuota; - } - - /** - * Set the shareQuota property: The maximum size of the share, in gigabytes. Must be greater than 0, and less than - * or equal to 5TB (5120). For Large File Shares, the maximum size is 102400. - * - * @param shareQuota the shareQuota value to set. - * @return the FileShareProperties object itself. - */ - public FileShareProperties withShareQuota(Integer shareQuota) { - this.shareQuota = shareQuota; - return this; - } - - /** - * Get the enabledProtocols property: The authentication protocol that is used for the file share. Can only be - * specified when creating a share. - * - * @return the enabledProtocols value. - */ - public EnabledProtocols enabledProtocols() { - return this.enabledProtocols; - } - - /** - * Set the enabledProtocols property: The authentication protocol that is used for the file share. Can only be - * specified when creating a share. - * - * @param enabledProtocols the enabledProtocols value to set. - * @return the FileShareProperties object itself. - */ - public FileShareProperties withEnabledProtocols(EnabledProtocols enabledProtocols) { - this.enabledProtocols = enabledProtocols; - return this; - } - - /** - * Get the rootSquash property: The property is for NFS share only. The default is NoRootSquash. - * - * @return the rootSquash value. - */ - public RootSquashType rootSquash() { - return this.rootSquash; - } - - /** - * Set the rootSquash property: The property is for NFS share only. The default is NoRootSquash. - * - * @param rootSquash the rootSquash value to set. - * @return the FileShareProperties object itself. - */ - public FileShareProperties withRootSquash(RootSquashType rootSquash) { - this.rootSquash = rootSquash; - return this; - } - - /** - * Get the version property: The version of the share. - * - * @return the version value. - */ - public String version() { - return this.version; - } - - /** - * Get the deleted property: Indicates whether the share was deleted. - * - * @return the deleted value. - */ - public Boolean deleted() { - return this.deleted; - } - - /** - * Get the deletedTime property: The deleted time if the share was deleted. - * - * @return the deletedTime value. - */ - public OffsetDateTime deletedTime() { - return this.deletedTime; - } - - /** - * Get the remainingRetentionDays property: Remaining retention days for share that was soft deleted. - * - * @return the remainingRetentionDays value. - */ - public Integer remainingRetentionDays() { - return this.remainingRetentionDays; - } - - /** - * Get the accessTier property: Access tier for specific share. GpV2 account can choose between TransactionOptimized - * (default), Hot, and Cool. FileStorage account can choose Premium. - * - * @return the accessTier value. - */ - public ShareAccessTier accessTier() { - return this.accessTier; - } - - /** - * Set the accessTier property: Access tier for specific share. GpV2 account can choose between TransactionOptimized - * (default), Hot, and Cool. FileStorage account can choose Premium. - * - * @param accessTier the accessTier value to set. - * @return the FileShareProperties object itself. - */ - public FileShareProperties withAccessTier(ShareAccessTier accessTier) { - this.accessTier = accessTier; - return this; - } - - /** - * Get the accessTierChangeTime property: Indicates the last modification time for share access tier. - * - * @return the accessTierChangeTime value. - */ - public OffsetDateTime accessTierChangeTime() { - return this.accessTierChangeTime; - } - - /** - * Get the accessTierStatus property: Indicates if there is a pending transition for access tier. - * - * @return the accessTierStatus value. - */ - public String accessTierStatus() { - return this.accessTierStatus; - } - - /** - * Get the shareUsageBytes property: The approximate size of the data stored on the share. Note that this value may - * not include all recently created or recently resized files. - * - * @return the shareUsageBytes value. - */ - public Long shareUsageBytes() { - return this.shareUsageBytes; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ImmutabilityPolicyInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ImmutabilityPolicyInner.java deleted file mode 100644 index 908567a38574..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ImmutabilityPolicyInner.java +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.storage.models.AzureEntityResource; -import com.azure.resourcemanager.storage.models.ImmutabilityPolicyState; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. */ -@Fluent -public final class ImmutabilityPolicyInner extends AzureEntityResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ImmutabilityPolicyInner.class); - - /* - * The properties of an ImmutabilityPolicy of a blob container. - */ - @JsonProperty(value = "properties", required = true) - private ImmutabilityPolicyProperty innerProperties = new ImmutabilityPolicyProperty(); - - /** - * Get the innerProperties property: The properties of an ImmutabilityPolicy of a blob container. - * - * @return the innerProperties value. - */ - private ImmutabilityPolicyProperty innerProperties() { - return this.innerProperties; - } - - /** - * Get the immutabilityPeriodSinceCreationInDays property: The immutability period for the blobs in the container - * since the policy creation, in days. - * - * @return the immutabilityPeriodSinceCreationInDays value. - */ - public Integer immutabilityPeriodSinceCreationInDays() { - return this.innerProperties() == null ? null : this.innerProperties().immutabilityPeriodSinceCreationInDays(); - } - - /** - * Set the immutabilityPeriodSinceCreationInDays property: The immutability period for the blobs in the container - * since the policy creation, in days. - * - * @param immutabilityPeriodSinceCreationInDays the immutabilityPeriodSinceCreationInDays value to set. - * @return the ImmutabilityPolicyInner object itself. - */ - public ImmutabilityPolicyInner withImmutabilityPeriodSinceCreationInDays( - Integer immutabilityPeriodSinceCreationInDays) { - if (this.innerProperties() == null) { - this.innerProperties = new ImmutabilityPolicyProperty(); - } - this.innerProperties().withImmutabilityPeriodSinceCreationInDays(immutabilityPeriodSinceCreationInDays); - return this; - } - - /** - * Get the state property: The ImmutabilityPolicy state of a blob container, possible values include: Locked and - * Unlocked. - * - * @return the state value. - */ - public ImmutabilityPolicyState state() { - return this.innerProperties() == null ? null : this.innerProperties().state(); - } - - /** - * Get the allowProtectedAppendWrites property: This property can only be changed for unlocked time-based retention - * policies. When enabled, new blocks can be written to an append blob while maintaining immutability protection and - * compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property - * cannot be changed with ExtendImmutabilityPolicy API. - * - * @return the allowProtectedAppendWrites value. - */ - public Boolean allowProtectedAppendWrites() { - return this.innerProperties() == null ? null : this.innerProperties().allowProtectedAppendWrites(); - } - - /** - * Set the allowProtectedAppendWrites property: This property can only be changed for unlocked time-based retention - * policies. When enabled, new blocks can be written to an append blob while maintaining immutability protection and - * compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property - * cannot be changed with ExtendImmutabilityPolicy API. - * - * @param allowProtectedAppendWrites the allowProtectedAppendWrites value to set. - * @return the ImmutabilityPolicyInner object itself. - */ - public ImmutabilityPolicyInner withAllowProtectedAppendWrites(Boolean allowProtectedAppendWrites) { - if (this.innerProperties() == null) { - this.innerProperties = new ImmutabilityPolicyProperty(); - } - this.innerProperties().withAllowProtectedAppendWrites(allowProtectedAppendWrites); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property innerProperties in model ImmutabilityPolicyInner")); - } else { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ImmutabilityPolicyProperty.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ImmutabilityPolicyProperty.java deleted file mode 100644 index a41c0247f316..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ImmutabilityPolicyProperty.java +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.storage.models.ImmutabilityPolicyState; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The properties of an ImmutabilityPolicy of a blob container. */ -@Fluent -public final class ImmutabilityPolicyProperty { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ImmutabilityPolicyProperty.class); - - /* - * The immutability period for the blobs in the container since the policy - * creation, in days. - */ - @JsonProperty(value = "immutabilityPeriodSinceCreationInDays") - private Integer immutabilityPeriodSinceCreationInDays; - - /* - * The ImmutabilityPolicy state of a blob container, possible values - * include: Locked and Unlocked. - */ - @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) - private ImmutabilityPolicyState state; - - /* - * This property can only be changed for unlocked time-based retention - * policies. When enabled, new blocks can be written to an append blob - * while maintaining immutability protection and compliance. Only new - * blocks can be added and any existing blocks cannot be modified or - * deleted. This property cannot be changed with ExtendImmutabilityPolicy - * API - */ - @JsonProperty(value = "allowProtectedAppendWrites") - private Boolean allowProtectedAppendWrites; - - /** - * Get the immutabilityPeriodSinceCreationInDays property: The immutability period for the blobs in the container - * since the policy creation, in days. - * - * @return the immutabilityPeriodSinceCreationInDays value. - */ - public Integer immutabilityPeriodSinceCreationInDays() { - return this.immutabilityPeriodSinceCreationInDays; - } - - /** - * Set the immutabilityPeriodSinceCreationInDays property: The immutability period for the blobs in the container - * since the policy creation, in days. - * - * @param immutabilityPeriodSinceCreationInDays the immutabilityPeriodSinceCreationInDays value to set. - * @return the ImmutabilityPolicyProperty object itself. - */ - public ImmutabilityPolicyProperty withImmutabilityPeriodSinceCreationInDays( - Integer immutabilityPeriodSinceCreationInDays) { - this.immutabilityPeriodSinceCreationInDays = immutabilityPeriodSinceCreationInDays; - return this; - } - - /** - * Get the state property: The ImmutabilityPolicy state of a blob container, possible values include: Locked and - * Unlocked. - * - * @return the state value. - */ - public ImmutabilityPolicyState state() { - return this.state; - } - - /** - * Get the allowProtectedAppendWrites property: This property can only be changed for unlocked time-based retention - * policies. When enabled, new blocks can be written to an append blob while maintaining immutability protection and - * compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property - * cannot be changed with ExtendImmutabilityPolicy API. - * - * @return the allowProtectedAppendWrites value. - */ - public Boolean allowProtectedAppendWrites() { - return this.allowProtectedAppendWrites; - } - - /** - * Set the allowProtectedAppendWrites property: This property can only be changed for unlocked time-based retention - * policies. When enabled, new blocks can be written to an append blob while maintaining immutability protection and - * compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property - * cannot be changed with ExtendImmutabilityPolicy API. - * - * @param allowProtectedAppendWrites the allowProtectedAppendWrites value to set. - * @return the ImmutabilityPolicyProperty object itself. - */ - public ImmutabilityPolicyProperty withAllowProtectedAppendWrites(Boolean allowProtectedAppendWrites) { - this.allowProtectedAppendWrites = allowProtectedAppendWrites; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/LeaseContainerResponseInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/LeaseContainerResponseInner.java deleted file mode 100644 index b1dc67242f6d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/LeaseContainerResponseInner.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Lease Container response schema. */ -@Fluent -public final class LeaseContainerResponseInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LeaseContainerResponseInner.class); - - /* - * Returned unique lease ID that must be included with any request to - * delete the container, or to renew, change, or release the lease. - */ - @JsonProperty(value = "leaseId") - private String leaseId; - - /* - * Approximate time remaining in the lease period, in seconds. - */ - @JsonProperty(value = "leaseTimeSeconds") - private String leaseTimeSeconds; - - /** - * Get the leaseId property: Returned unique lease ID that must be included with any request to delete the - * container, or to renew, change, or release the lease. - * - * @return the leaseId value. - */ - public String leaseId() { - return this.leaseId; - } - - /** - * Set the leaseId property: Returned unique lease ID that must be included with any request to delete the - * container, or to renew, change, or release the lease. - * - * @param leaseId the leaseId value to set. - * @return the LeaseContainerResponseInner object itself. - */ - public LeaseContainerResponseInner withLeaseId(String leaseId) { - this.leaseId = leaseId; - return this; - } - - /** - * Get the leaseTimeSeconds property: Approximate time remaining in the lease period, in seconds. - * - * @return the leaseTimeSeconds value. - */ - public String leaseTimeSeconds() { - return this.leaseTimeSeconds; - } - - /** - * Set the leaseTimeSeconds property: Approximate time remaining in the lease period, in seconds. - * - * @param leaseTimeSeconds the leaseTimeSeconds value to set. - * @return the LeaseContainerResponseInner object itself. - */ - public LeaseContainerResponseInner withLeaseTimeSeconds(String leaseTimeSeconds) { - this.leaseTimeSeconds = leaseTimeSeconds; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/LegalHoldInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/LegalHoldInner.java deleted file mode 100644 index 3a81f9f1c73b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/LegalHoldInner.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The LegalHold property of a blob container. */ -@Fluent -public final class LegalHoldInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LegalHoldInner.class); - - /* - * The hasLegalHold public property is set to true by SRP if there are at - * least one existing tag. The hasLegalHold public property is set to false - * by SRP if all existing legal hold tags are cleared out. There can be a - * maximum of 1000 blob containers with hasLegalHold=true for a given - * account. - */ - @JsonProperty(value = "hasLegalHold", access = JsonProperty.Access.WRITE_ONLY) - private Boolean hasLegalHold; - - /* - * Each tag should be 3 to 23 alphanumeric characters and is normalized to - * lower case at SRP. - */ - @JsonProperty(value = "tags", required = true) - private List tags; - - /** - * Get the hasLegalHold property: The hasLegalHold public property is set to true by SRP if there are at least one - * existing tag. The hasLegalHold public property is set to false by SRP if all existing legal hold tags are cleared - * out. There can be a maximum of 1000 blob containers with hasLegalHold=true for a given account. - * - * @return the hasLegalHold value. - */ - public Boolean hasLegalHold() { - return this.hasLegalHold; - } - - /** - * Get the tags property: Each tag should be 3 to 23 alphanumeric characters and is normalized to lower case at SRP. - * - * @return the tags value. - */ - public List tags() { - return this.tags; - } - - /** - * Set the tags property: Each tag should be 3 to 23 alphanumeric characters and is normalized to lower case at SRP. - * - * @param tags the tags value to set. - * @return the LegalHoldInner object itself. - */ - public LegalHoldInner withTags(List tags) { - this.tags = tags; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (tags() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property tags in model LegalHoldInner")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ListAccountSasResponseInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ListAccountSasResponseInner.java deleted file mode 100644 index e7531c02cce0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ListAccountSasResponseInner.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The List SAS credentials operation response. */ -@Immutable -public final class ListAccountSasResponseInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ListAccountSasResponseInner.class); - - /* - * List SAS credentials of storage account. - */ - @JsonProperty(value = "accountSasToken", access = JsonProperty.Access.WRITE_ONLY) - private String accountSasToken; - - /** - * Get the accountSasToken property: List SAS credentials of storage account. - * - * @return the accountSasToken value. - */ - public String accountSasToken() { - return this.accountSasToken; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ListContainerItemInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ListContainerItemInner.java deleted file mode 100644 index 4400625ce609..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ListContainerItemInner.java +++ /dev/null @@ -1,260 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.storage.models.AzureEntityResource; -import com.azure.resourcemanager.storage.models.ImmutabilityPolicyProperties; -import com.azure.resourcemanager.storage.models.LeaseDuration; -import com.azure.resourcemanager.storage.models.LeaseState; -import com.azure.resourcemanager.storage.models.LeaseStatus; -import com.azure.resourcemanager.storage.models.LegalHoldProperties; -import com.azure.resourcemanager.storage.models.PublicAccess; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.Map; - -/** The blob container properties be listed out. */ -@Fluent -public final class ListContainerItemInner extends AzureEntityResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ListContainerItemInner.class); - - /* - * The blob container properties be listed out. - */ - @JsonProperty(value = "properties") - private ContainerProperties innerProperties; - - /** - * Get the innerProperties property: The blob container properties be listed out. - * - * @return the innerProperties value. - */ - private ContainerProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the version property: The version of the deleted blob container. - * - * @return the version value. - */ - public String version() { - return this.innerProperties() == null ? null : this.innerProperties().version(); - } - - /** - * Get the deleted property: Indicates whether the blob container was deleted. - * - * @return the deleted value. - */ - public Boolean deleted() { - return this.innerProperties() == null ? null : this.innerProperties().deleted(); - } - - /** - * Get the deletedTime property: Blob container deletion time. - * - * @return the deletedTime value. - */ - public OffsetDateTime deletedTime() { - return this.innerProperties() == null ? null : this.innerProperties().deletedTime(); - } - - /** - * Get the remainingRetentionDays property: Remaining retention days for soft deleted blob container. - * - * @return the remainingRetentionDays value. - */ - public Integer remainingRetentionDays() { - return this.innerProperties() == null ? null : this.innerProperties().remainingRetentionDays(); - } - - /** - * Get the defaultEncryptionScope property: Default the container to use specified encryption scope for all writes. - * - * @return the defaultEncryptionScope value. - */ - public String defaultEncryptionScope() { - return this.innerProperties() == null ? null : this.innerProperties().defaultEncryptionScope(); - } - - /** - * Set the defaultEncryptionScope property: Default the container to use specified encryption scope for all writes. - * - * @param defaultEncryptionScope the defaultEncryptionScope value to set. - * @return the ListContainerItemInner object itself. - */ - public ListContainerItemInner withDefaultEncryptionScope(String defaultEncryptionScope) { - if (this.innerProperties() == null) { - this.innerProperties = new ContainerProperties(); - } - this.innerProperties().withDefaultEncryptionScope(defaultEncryptionScope); - return this; - } - - /** - * Get the denyEncryptionScopeOverride property: Block override of encryption scope from the container default. - * - * @return the denyEncryptionScopeOverride value. - */ - public Boolean denyEncryptionScopeOverride() { - return this.innerProperties() == null ? null : this.innerProperties().denyEncryptionScopeOverride(); - } - - /** - * Set the denyEncryptionScopeOverride property: Block override of encryption scope from the container default. - * - * @param denyEncryptionScopeOverride the denyEncryptionScopeOverride value to set. - * @return the ListContainerItemInner object itself. - */ - public ListContainerItemInner withDenyEncryptionScopeOverride(Boolean denyEncryptionScopeOverride) { - if (this.innerProperties() == null) { - this.innerProperties = new ContainerProperties(); - } - this.innerProperties().withDenyEncryptionScopeOverride(denyEncryptionScopeOverride); - return this; - } - - /** - * Get the publicAccess property: Specifies whether data in the container may be accessed publicly and the level of - * access. - * - * @return the publicAccess value. - */ - public PublicAccess publicAccess() { - return this.innerProperties() == null ? null : this.innerProperties().publicAccess(); - } - - /** - * Set the publicAccess property: Specifies whether data in the container may be accessed publicly and the level of - * access. - * - * @param publicAccess the publicAccess value to set. - * @return the ListContainerItemInner object itself. - */ - public ListContainerItemInner withPublicAccess(PublicAccess publicAccess) { - if (this.innerProperties() == null) { - this.innerProperties = new ContainerProperties(); - } - this.innerProperties().withPublicAccess(publicAccess); - return this; - } - - /** - * Get the lastModifiedTime property: Returns the date and time the container was last modified. - * - * @return the lastModifiedTime value. - */ - public OffsetDateTime lastModifiedTime() { - return this.innerProperties() == null ? null : this.innerProperties().lastModifiedTime(); - } - - /** - * Get the leaseStatus property: The lease status of the container. - * - * @return the leaseStatus value. - */ - public LeaseStatus leaseStatus() { - return this.innerProperties() == null ? null : this.innerProperties().leaseStatus(); - } - - /** - * Get the leaseState property: Lease state of the container. - * - * @return the leaseState value. - */ - public LeaseState leaseState() { - return this.innerProperties() == null ? null : this.innerProperties().leaseState(); - } - - /** - * Get the leaseDuration property: Specifies whether the lease on a container is of infinite or fixed duration, only - * when the container is leased. - * - * @return the leaseDuration value. - */ - public LeaseDuration leaseDuration() { - return this.innerProperties() == null ? null : this.innerProperties().leaseDuration(); - } - - /** - * Get the metadata property: A name-value pair to associate with the container as metadata. - * - * @return the metadata value. - */ - public Map metadata() { - return this.innerProperties() == null ? null : this.innerProperties().metadata(); - } - - /** - * Set the metadata property: A name-value pair to associate with the container as metadata. - * - * @param metadata the metadata value to set. - * @return the ListContainerItemInner object itself. - */ - public ListContainerItemInner withMetadata(Map metadata) { - if (this.innerProperties() == null) { - this.innerProperties = new ContainerProperties(); - } - this.innerProperties().withMetadata(metadata); - return this; - } - - /** - * Get the immutabilityPolicy property: The ImmutabilityPolicy property of the container. - * - * @return the immutabilityPolicy value. - */ - public ImmutabilityPolicyProperties immutabilityPolicy() { - return this.innerProperties() == null ? null : this.innerProperties().immutabilityPolicy(); - } - - /** - * Get the legalHold property: The LegalHold property of the container. - * - * @return the legalHold value. - */ - public LegalHoldProperties legalHold() { - return this.innerProperties() == null ? null : this.innerProperties().legalHold(); - } - - /** - * Get the hasLegalHold property: The hasLegalHold public property is set to true by SRP if there are at least one - * existing tag. The hasLegalHold public property is set to false by SRP if all existing legal hold tags are cleared - * out. There can be a maximum of 1000 blob containers with hasLegalHold=true for a given account. - * - * @return the hasLegalHold value. - */ - public Boolean hasLegalHold() { - return this.innerProperties() == null ? null : this.innerProperties().hasLegalHold(); - } - - /** - * Get the hasImmutabilityPolicy property: The hasImmutabilityPolicy public property is set to true by SRP if - * ImmutabilityPolicy has been created for this container. The hasImmutabilityPolicy public property is set to false - * by SRP if ImmutabilityPolicy has not been created for this container. - * - * @return the hasImmutabilityPolicy value. - */ - public Boolean hasImmutabilityPolicy() { - return this.innerProperties() == null ? null : this.innerProperties().hasImmutabilityPolicy(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ListQueueInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ListQueueInner.java deleted file mode 100644 index b1f41b6a80ff..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ListQueueInner.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** The ListQueue model. */ -@Fluent -public final class ListQueueInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ListQueueInner.class); - - /* - * List Queue resource properties. - */ - @JsonProperty(value = "properties") - private ListQueueProperties innerQueueProperties; - - /** - * Get the innerQueueProperties property: List Queue resource properties. - * - * @return the innerQueueProperties value. - */ - private ListQueueProperties innerQueueProperties() { - return this.innerQueueProperties; - } - - /** - * Get the metadata property: A name-value pair that represents queue metadata. - * - * @return the metadata value. - */ - public Map metadata() { - return this.innerQueueProperties() == null ? null : this.innerQueueProperties().metadata(); - } - - /** - * Set the metadata property: A name-value pair that represents queue metadata. - * - * @param metadata the metadata value to set. - * @return the ListQueueInner object itself. - */ - public ListQueueInner withMetadata(Map metadata) { - if (this.innerQueueProperties() == null) { - this.innerQueueProperties = new ListQueueProperties(); - } - this.innerQueueProperties().withMetadata(metadata); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerQueueProperties() != null) { - innerQueueProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ListQueueProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ListQueueProperties.java deleted file mode 100644 index 51b244e4f578..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ListQueueProperties.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** The ListQueueProperties model. */ -@Fluent -public final class ListQueueProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ListQueueProperties.class); - - /* - * A name-value pair that represents queue metadata. - */ - @JsonProperty(value = "metadata") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map metadata; - - /** - * Get the metadata property: A name-value pair that represents queue metadata. - * - * @return the metadata value. - */ - public Map metadata() { - return this.metadata; - } - - /** - * Set the metadata property: A name-value pair that represents queue metadata. - * - * @param metadata the metadata value to set. - * @return the ListQueueProperties object itself. - */ - public ListQueueProperties withMetadata(Map metadata) { - this.metadata = metadata; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ListQueueServicesInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ListQueueServicesInner.java deleted file mode 100644 index 4e35eed27f75..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ListQueueServicesInner.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The ListQueueServices model. */ -@Immutable -public final class ListQueueServicesInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ListQueueServicesInner.class); - - /* - * List of queue services returned. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /** - * Get the value property: List of queue services returned. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ListServiceSasResponseInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ListServiceSasResponseInner.java deleted file mode 100644 index 7d7f58681206..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ListServiceSasResponseInner.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The List service SAS credentials operation response. */ -@Immutable -public final class ListServiceSasResponseInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ListServiceSasResponseInner.class); - - /* - * List service SAS credentials of specific resource. - */ - @JsonProperty(value = "serviceSasToken", access = JsonProperty.Access.WRITE_ONLY) - private String serviceSasToken; - - /** - * Get the serviceSasToken property: List service SAS credentials of specific resource. - * - * @return the serviceSasToken value. - */ - public String serviceSasToken() { - return this.serviceSasToken; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ListTableServicesInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ListTableServicesInner.java deleted file mode 100644 index 2216a1b1af5e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ListTableServicesInner.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The ListTableServices model. */ -@Immutable -public final class ListTableServicesInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ListTableServicesInner.class); - - /* - * List of table services returned. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /** - * Get the value property: List of table services returned. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ManagementPolicyInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ManagementPolicyInner.java deleted file mode 100644 index 445fdf9e7c15..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ManagementPolicyInner.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.storage.models.ManagementPolicySchema; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** The Get Storage Account ManagementPolicies operation response. */ -@Fluent -public final class ManagementPolicyInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagementPolicyInner.class); - - /* - * Returns the Storage Account Data Policies Rules. - */ - @JsonProperty(value = "properties") - private ManagementPolicyProperties innerProperties; - - /** - * Get the innerProperties property: Returns the Storage Account Data Policies Rules. - * - * @return the innerProperties value. - */ - private ManagementPolicyProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the lastModifiedTime property: Returns the date and time the ManagementPolicies was last modified. - * - * @return the lastModifiedTime value. - */ - public OffsetDateTime lastModifiedTime() { - return this.innerProperties() == null ? null : this.innerProperties().lastModifiedTime(); - } - - /** - * Get the policy property: The Storage Account ManagementPolicy, in JSON format. See more details in: - * https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. - * - * @return the policy value. - */ - public ManagementPolicySchema policy() { - return this.innerProperties() == null ? null : this.innerProperties().policy(); - } - - /** - * Set the policy property: The Storage Account ManagementPolicy, in JSON format. See more details in: - * https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. - * - * @param policy the policy value to set. - * @return the ManagementPolicyInner object itself. - */ - public ManagementPolicyInner withPolicy(ManagementPolicySchema policy) { - if (this.innerProperties() == null) { - this.innerProperties = new ManagementPolicyProperties(); - } - this.innerProperties().withPolicy(policy); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ManagementPolicyProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ManagementPolicyProperties.java deleted file mode 100644 index d38704942eb3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ManagementPolicyProperties.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.storage.models.ManagementPolicySchema; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** The Storage Account ManagementPolicy properties. */ -@Fluent -public final class ManagementPolicyProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagementPolicyProperties.class); - - /* - * Returns the date and time the ManagementPolicies was last modified. - */ - @JsonProperty(value = "lastModifiedTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime lastModifiedTime; - - /* - * The Storage Account ManagementPolicy, in JSON format. See more details - * in: - * https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. - */ - @JsonProperty(value = "policy", required = true) - private ManagementPolicySchema policy; - - /** - * Get the lastModifiedTime property: Returns the date and time the ManagementPolicies was last modified. - * - * @return the lastModifiedTime value. - */ - public OffsetDateTime lastModifiedTime() { - return this.lastModifiedTime; - } - - /** - * Get the policy property: The Storage Account ManagementPolicy, in JSON format. See more details in: - * https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. - * - * @return the policy value. - */ - public ManagementPolicySchema policy() { - return this.policy; - } - - /** - * Set the policy property: The Storage Account ManagementPolicy, in JSON format. See more details in: - * https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. - * - * @param policy the policy value to set. - * @return the ManagementPolicyProperties object itself. - */ - public ManagementPolicyProperties withPolicy(ManagementPolicySchema policy) { - this.policy = policy; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (policy() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property policy in model ManagementPolicyProperties")); - } else { - policy().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ObjectReplicationPolicyInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ObjectReplicationPolicyInner.java deleted file mode 100644 index 001b3e114f52..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ObjectReplicationPolicyInner.java +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.storage.models.ObjectReplicationPolicyRule; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; - -/** The replication policy between two storage accounts. Multiple rules can be defined in one policy. */ -@Fluent -public final class ObjectReplicationPolicyInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ObjectReplicationPolicyInner.class); - - /* - * Returns the Storage Account Object Replication Policy. - */ - @JsonProperty(value = "properties") - private ObjectReplicationPolicyProperties innerProperties; - - /** - * Get the innerProperties property: Returns the Storage Account Object Replication Policy. - * - * @return the innerProperties value. - */ - private ObjectReplicationPolicyProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the policyId property: A unique id for object replication policy. - * - * @return the policyId value. - */ - public String policyId() { - return this.innerProperties() == null ? null : this.innerProperties().policyId(); - } - - /** - * Get the enabledTime property: Indicates when the policy is enabled on the source account. - * - * @return the enabledTime value. - */ - public OffsetDateTime enabledTime() { - return this.innerProperties() == null ? null : this.innerProperties().enabledTime(); - } - - /** - * Get the sourceAccount property: Required. Source account name. - * - * @return the sourceAccount value. - */ - public String sourceAccount() { - return this.innerProperties() == null ? null : this.innerProperties().sourceAccount(); - } - - /** - * Set the sourceAccount property: Required. Source account name. - * - * @param sourceAccount the sourceAccount value to set. - * @return the ObjectReplicationPolicyInner object itself. - */ - public ObjectReplicationPolicyInner withSourceAccount(String sourceAccount) { - if (this.innerProperties() == null) { - this.innerProperties = new ObjectReplicationPolicyProperties(); - } - this.innerProperties().withSourceAccount(sourceAccount); - return this; - } - - /** - * Get the destinationAccount property: Required. Destination account name. - * - * @return the destinationAccount value. - */ - public String destinationAccount() { - return this.innerProperties() == null ? null : this.innerProperties().destinationAccount(); - } - - /** - * Set the destinationAccount property: Required. Destination account name. - * - * @param destinationAccount the destinationAccount value to set. - * @return the ObjectReplicationPolicyInner object itself. - */ - public ObjectReplicationPolicyInner withDestinationAccount(String destinationAccount) { - if (this.innerProperties() == null) { - this.innerProperties = new ObjectReplicationPolicyProperties(); - } - this.innerProperties().withDestinationAccount(destinationAccount); - return this; - } - - /** - * Get the rules property: The storage account object replication rules. - * - * @return the rules value. - */ - public List rules() { - return this.innerProperties() == null ? null : this.innerProperties().rules(); - } - - /** - * Set the rules property: The storage account object replication rules. - * - * @param rules the rules value to set. - * @return the ObjectReplicationPolicyInner object itself. - */ - public ObjectReplicationPolicyInner withRules(List rules) { - if (this.innerProperties() == null) { - this.innerProperties = new ObjectReplicationPolicyProperties(); - } - this.innerProperties().withRules(rules); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ObjectReplicationPolicyProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ObjectReplicationPolicyProperties.java deleted file mode 100644 index 7bbafa0f04e2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ObjectReplicationPolicyProperties.java +++ /dev/null @@ -1,150 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.storage.models.ObjectReplicationPolicyRule; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; - -/** The Storage Account ObjectReplicationPolicy properties. */ -@Fluent -public final class ObjectReplicationPolicyProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ObjectReplicationPolicyProperties.class); - - /* - * A unique id for object replication policy. - */ - @JsonProperty(value = "policyId", access = JsonProperty.Access.WRITE_ONLY) - private String policyId; - - /* - * Indicates when the policy is enabled on the source account. - */ - @JsonProperty(value = "enabledTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime enabledTime; - - /* - * Required. Source account name. - */ - @JsonProperty(value = "sourceAccount", required = true) - private String sourceAccount; - - /* - * Required. Destination account name. - */ - @JsonProperty(value = "destinationAccount", required = true) - private String destinationAccount; - - /* - * The storage account object replication rules. - */ - @JsonProperty(value = "rules") - private List rules; - - /** - * Get the policyId property: A unique id for object replication policy. - * - * @return the policyId value. - */ - public String policyId() { - return this.policyId; - } - - /** - * Get the enabledTime property: Indicates when the policy is enabled on the source account. - * - * @return the enabledTime value. - */ - public OffsetDateTime enabledTime() { - return this.enabledTime; - } - - /** - * Get the sourceAccount property: Required. Source account name. - * - * @return the sourceAccount value. - */ - public String sourceAccount() { - return this.sourceAccount; - } - - /** - * Set the sourceAccount property: Required. Source account name. - * - * @param sourceAccount the sourceAccount value to set. - * @return the ObjectReplicationPolicyProperties object itself. - */ - public ObjectReplicationPolicyProperties withSourceAccount(String sourceAccount) { - this.sourceAccount = sourceAccount; - return this; - } - - /** - * Get the destinationAccount property: Required. Destination account name. - * - * @return the destinationAccount value. - */ - public String destinationAccount() { - return this.destinationAccount; - } - - /** - * Set the destinationAccount property: Required. Destination account name. - * - * @param destinationAccount the destinationAccount value to set. - * @return the ObjectReplicationPolicyProperties object itself. - */ - public ObjectReplicationPolicyProperties withDestinationAccount(String destinationAccount) { - this.destinationAccount = destinationAccount; - return this; - } - - /** - * Get the rules property: The storage account object replication rules. - * - * @return the rules value. - */ - public List rules() { - return this.rules; - } - - /** - * Set the rules property: The storage account object replication rules. - * - * @param rules the rules value to set. - * @return the ObjectReplicationPolicyProperties object itself. - */ - public ObjectReplicationPolicyProperties withRules(List rules) { - this.rules = rules; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (sourceAccount() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property sourceAccount in model ObjectReplicationPolicyProperties")); - } - if (destinationAccount() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property destinationAccount in model ObjectReplicationPolicyProperties")); - } - if (rules() != null) { - rules().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/OperationInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/OperationInner.java deleted file mode 100644 index 564c3aef5ea8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/OperationInner.java +++ /dev/null @@ -1,148 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.storage.models.OperationDisplay; -import com.azure.resourcemanager.storage.models.ServiceSpecification; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Storage REST API operation definition. */ -@Fluent -public final class OperationInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationInner.class); - - /* - * Operation name: {provider}/{resource}/{operation} - */ - @JsonProperty(value = "name") - private String name; - - /* - * Display metadata associated with the operation. - */ - @JsonProperty(value = "display") - private OperationDisplay display; - - /* - * The origin of operations. - */ - @JsonProperty(value = "origin") - private String origin; - - /* - * Properties of operation, include metric specifications. - */ - @JsonProperty(value = "properties") - private OperationProperties innerOperationProperties; - - /** - * Get the name property: Operation name: {provider}/{resource}/{operation}. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Operation name: {provider}/{resource}/{operation}. - * - * @param name the name value to set. - * @return the OperationInner object itself. - */ - public OperationInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the display property: Display metadata associated with the operation. - * - * @return the display value. - */ - public OperationDisplay display() { - return this.display; - } - - /** - * Set the display property: Display metadata associated with the operation. - * - * @param display the display value to set. - * @return the OperationInner object itself. - */ - public OperationInner withDisplay(OperationDisplay display) { - this.display = display; - return this; - } - - /** - * Get the origin property: The origin of operations. - * - * @return the origin value. - */ - public String origin() { - return this.origin; - } - - /** - * Set the origin property: The origin of operations. - * - * @param origin the origin value to set. - * @return the OperationInner object itself. - */ - public OperationInner withOrigin(String origin) { - this.origin = origin; - return this; - } - - /** - * Get the innerOperationProperties property: Properties of operation, include metric specifications. - * - * @return the innerOperationProperties value. - */ - private OperationProperties innerOperationProperties() { - return this.innerOperationProperties; - } - - /** - * Get the serviceSpecification property: One property of operation, include metric specifications. - * - * @return the serviceSpecification value. - */ - public ServiceSpecification serviceSpecification() { - return this.innerOperationProperties() == null ? null : this.innerOperationProperties().serviceSpecification(); - } - - /** - * Set the serviceSpecification property: One property of operation, include metric specifications. - * - * @param serviceSpecification the serviceSpecification value to set. - * @return the OperationInner object itself. - */ - public OperationInner withServiceSpecification(ServiceSpecification serviceSpecification) { - if (this.innerOperationProperties() == null) { - this.innerOperationProperties = new OperationProperties(); - } - this.innerOperationProperties().withServiceSpecification(serviceSpecification); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (display() != null) { - display().validate(); - } - if (innerOperationProperties() != null) { - innerOperationProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/OperationProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/OperationProperties.java deleted file mode 100644 index 06cc712230d9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/OperationProperties.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.storage.models.ServiceSpecification; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Properties of operation, include metric specifications. */ -@Fluent -public final class OperationProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationProperties.class); - - /* - * One property of operation, include metric specifications. - */ - @JsonProperty(value = "serviceSpecification") - private ServiceSpecification serviceSpecification; - - /** - * Get the serviceSpecification property: One property of operation, include metric specifications. - * - * @return the serviceSpecification value. - */ - public ServiceSpecification serviceSpecification() { - return this.serviceSpecification; - } - - /** - * Set the serviceSpecification property: One property of operation, include metric specifications. - * - * @param serviceSpecification the serviceSpecification value to set. - * @return the OperationProperties object itself. - */ - public OperationProperties withServiceSpecification(ServiceSpecification serviceSpecification) { - this.serviceSpecification = serviceSpecification; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (serviceSpecification() != null) { - serviceSpecification().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/PrivateEndpointConnectionInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/PrivateEndpointConnectionInner.java deleted file mode 100644 index d69c249e756a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/PrivateEndpointConnectionInner.java +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.storage.models.PrivateEndpoint; -import com.azure.resourcemanager.storage.models.PrivateEndpointConnectionProvisioningState; -import com.azure.resourcemanager.storage.models.PrivateLinkServiceConnectionState; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The Private Endpoint Connection resource. */ -@Fluent -public final class PrivateEndpointConnectionInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionInner.class); - - /* - * Resource properties. - */ - @JsonProperty(value = "properties") - private PrivateEndpointConnectionProperties innerProperties; - - /** - * Get the innerProperties property: Resource properties. - * - * @return the innerProperties value. - */ - private PrivateEndpointConnectionProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the privateEndpoint property: The resource of private end point. - * - * @return the privateEndpoint value. - */ - public PrivateEndpoint privateEndpoint() { - return this.innerProperties() == null ? null : this.innerProperties().privateEndpoint(); - } - - /** - * Set the privateEndpoint property: The resource of private end point. - * - * @param privateEndpoint the privateEndpoint value to set. - * @return the PrivateEndpointConnectionInner object itself. - */ - public PrivateEndpointConnectionInner withPrivateEndpoint(PrivateEndpoint privateEndpoint) { - if (this.innerProperties() == null) { - this.innerProperties = new PrivateEndpointConnectionProperties(); - } - this.innerProperties().withPrivateEndpoint(privateEndpoint); - return this; - } - - /** - * Get the privateLinkServiceConnectionState property: A collection of information about the state of the connection - * between service consumer and provider. - * - * @return the privateLinkServiceConnectionState value. - */ - public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { - return this.innerProperties() == null ? null : this.innerProperties().privateLinkServiceConnectionState(); - } - - /** - * Set the privateLinkServiceConnectionState property: A collection of information about the state of the connection - * between service consumer and provider. - * - * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. - * @return the PrivateEndpointConnectionInner object itself. - */ - public PrivateEndpointConnectionInner withPrivateLinkServiceConnectionState( - PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { - if (this.innerProperties() == null) { - this.innerProperties = new PrivateEndpointConnectionProperties(); - } - this.innerProperties().withPrivateLinkServiceConnectionState(privateLinkServiceConnectionState); - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the private endpoint connection resource. - * - * @return the provisioningState value. - */ - public PrivateEndpointConnectionProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/PrivateEndpointConnectionProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/PrivateEndpointConnectionProperties.java deleted file mode 100644 index 768915bd8793..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/PrivateEndpointConnectionProperties.java +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.storage.models.PrivateEndpoint; -import com.azure.resourcemanager.storage.models.PrivateEndpointConnectionProvisioningState; -import com.azure.resourcemanager.storage.models.PrivateLinkServiceConnectionState; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Properties of the PrivateEndpointConnectProperties. */ -@Fluent -public final class PrivateEndpointConnectionProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionProperties.class); - - /* - * The resource of private end point. - */ - @JsonProperty(value = "privateEndpoint") - private PrivateEndpoint privateEndpoint; - - /* - * A collection of information about the state of the connection between - * service consumer and provider. - */ - @JsonProperty(value = "privateLinkServiceConnectionState", required = true) - private PrivateLinkServiceConnectionState privateLinkServiceConnectionState; - - /* - * The provisioning state of the private endpoint connection resource. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private PrivateEndpointConnectionProvisioningState provisioningState; - - /** - * Get the privateEndpoint property: The resource of private end point. - * - * @return the privateEndpoint value. - */ - public PrivateEndpoint privateEndpoint() { - return this.privateEndpoint; - } - - /** - * Set the privateEndpoint property: The resource of private end point. - * - * @param privateEndpoint the privateEndpoint value to set. - * @return the PrivateEndpointConnectionProperties object itself. - */ - public PrivateEndpointConnectionProperties withPrivateEndpoint(PrivateEndpoint privateEndpoint) { - this.privateEndpoint = privateEndpoint; - return this; - } - - /** - * Get the privateLinkServiceConnectionState property: A collection of information about the state of the connection - * between service consumer and provider. - * - * @return the privateLinkServiceConnectionState value. - */ - public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { - return this.privateLinkServiceConnectionState; - } - - /** - * Set the privateLinkServiceConnectionState property: A collection of information about the state of the connection - * between service consumer and provider. - * - * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. - * @return the PrivateEndpointConnectionProperties object itself. - */ - public PrivateEndpointConnectionProperties withPrivateLinkServiceConnectionState( - PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { - this.privateLinkServiceConnectionState = privateLinkServiceConnectionState; - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the private endpoint connection resource. - * - * @return the provisioningState value. - */ - public PrivateEndpointConnectionProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (privateEndpoint() != null) { - privateEndpoint().validate(); - } - if (privateLinkServiceConnectionState() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property privateLinkServiceConnectionState in model" - + " PrivateEndpointConnectionProperties")); - } else { - privateLinkServiceConnectionState().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/PrivateLinkResourceListResultInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/PrivateLinkResourceListResultInner.java deleted file mode 100644 index 2119e780c607..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/PrivateLinkResourceListResultInner.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.storage.models.PrivateLinkResource; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** A list of private link resources. */ -@Fluent -public final class PrivateLinkResourceListResultInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkResourceListResultInner.class); - - /* - * Array of private link resources - */ - @JsonProperty(value = "value") - private List value; - - /** - * Get the value property: Array of private link resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Array of private link resources. - * - * @param value the value value to set. - * @return the PrivateLinkResourceListResultInner object itself. - */ - public PrivateLinkResourceListResultInner withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/PrivateLinkResourceProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/PrivateLinkResourceProperties.java deleted file mode 100644 index bd543bb24ed2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/PrivateLinkResourceProperties.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Properties of a private link resource. */ -@Fluent -public final class PrivateLinkResourceProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkResourceProperties.class); - - /* - * The private link resource group id. - */ - @JsonProperty(value = "groupId", access = JsonProperty.Access.WRITE_ONLY) - private String groupId; - - /* - * The private link resource required member names. - */ - @JsonProperty(value = "requiredMembers", access = JsonProperty.Access.WRITE_ONLY) - private List requiredMembers; - - /* - * The private link resource Private link DNS zone name. - */ - @JsonProperty(value = "requiredZoneNames") - private List requiredZoneNames; - - /** - * Get the groupId property: The private link resource group id. - * - * @return the groupId value. - */ - public String groupId() { - return this.groupId; - } - - /** - * Get the requiredMembers property: The private link resource required member names. - * - * @return the requiredMembers value. - */ - public List requiredMembers() { - return this.requiredMembers; - } - - /** - * Get the requiredZoneNames property: The private link resource Private link DNS zone name. - * - * @return the requiredZoneNames value. - */ - public List requiredZoneNames() { - return this.requiredZoneNames; - } - - /** - * Set the requiredZoneNames property: The private link resource Private link DNS zone name. - * - * @param requiredZoneNames the requiredZoneNames value to set. - * @return the PrivateLinkResourceProperties object itself. - */ - public PrivateLinkResourceProperties withRequiredZoneNames(List requiredZoneNames) { - this.requiredZoneNames = requiredZoneNames; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/QueueProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/QueueProperties.java deleted file mode 100644 index 237ad78a1a0b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/QueueProperties.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** The QueueProperties model. */ -@Fluent -public final class QueueProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(QueueProperties.class); - - /* - * A name-value pair that represents queue metadata. - */ - @JsonProperty(value = "metadata") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map metadata; - - /* - * Integer indicating an approximate number of messages in the queue. This - * number is not lower than the actual number of messages in the queue, but - * could be higher. - */ - @JsonProperty(value = "approximateMessageCount", access = JsonProperty.Access.WRITE_ONLY) - private Integer approximateMessageCount; - - /** - * Get the metadata property: A name-value pair that represents queue metadata. - * - * @return the metadata value. - */ - public Map metadata() { - return this.metadata; - } - - /** - * Set the metadata property: A name-value pair that represents queue metadata. - * - * @param metadata the metadata value to set. - * @return the QueueProperties object itself. - */ - public QueueProperties withMetadata(Map metadata) { - this.metadata = metadata; - return this; - } - - /** - * Get the approximateMessageCount property: Integer indicating an approximate number of messages in the queue. This - * number is not lower than the actual number of messages in the queue, but could be higher. - * - * @return the approximateMessageCount value. - */ - public Integer approximateMessageCount() { - return this.approximateMessageCount; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/QueueServicePropertiesInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/QueueServicePropertiesInner.java deleted file mode 100644 index 4925c640815b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/QueueServicePropertiesInner.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.storage.models.CorsRules; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The properties of a storage account’s Queue service. */ -@Fluent -public final class QueueServicePropertiesInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(QueueServicePropertiesInner.class); - - /* - * The properties of a storage account’s Queue service. - */ - @JsonProperty(value = "properties") - private QueueServicePropertiesProperties innerQueueServiceProperties; - - /** - * Get the innerQueueServiceProperties property: The properties of a storage account’s Queue service. - * - * @return the innerQueueServiceProperties value. - */ - private QueueServicePropertiesProperties innerQueueServiceProperties() { - return this.innerQueueServiceProperties; - } - - /** - * Get the cors property: Specifies CORS rules for the Queue service. You can include up to five CorsRule elements - * in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and - * CORS will be disabled for the Queue service. - * - * @return the cors value. - */ - public CorsRules cors() { - return this.innerQueueServiceProperties() == null ? null : this.innerQueueServiceProperties().cors(); - } - - /** - * Set the cors property: Specifies CORS rules for the Queue service. You can include up to five CorsRule elements - * in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and - * CORS will be disabled for the Queue service. - * - * @param cors the cors value to set. - * @return the QueueServicePropertiesInner object itself. - */ - public QueueServicePropertiesInner withCors(CorsRules cors) { - if (this.innerQueueServiceProperties() == null) { - this.innerQueueServiceProperties = new QueueServicePropertiesProperties(); - } - this.innerQueueServiceProperties().withCors(cors); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerQueueServiceProperties() != null) { - innerQueueServiceProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/QueueServicePropertiesProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/QueueServicePropertiesProperties.java deleted file mode 100644 index 587fe0831d1d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/QueueServicePropertiesProperties.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.storage.models.CorsRules; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The properties of a storage account’s Queue service. */ -@Fluent -public final class QueueServicePropertiesProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(QueueServicePropertiesProperties.class); - - /* - * Specifies CORS rules for the Queue service. You can include up to five - * CorsRule elements in the request. If no CorsRule elements are included - * in the request body, all CORS rules will be deleted, and CORS will be - * disabled for the Queue service. - */ - @JsonProperty(value = "cors") - private CorsRules cors; - - /** - * Get the cors property: Specifies CORS rules for the Queue service. You can include up to five CorsRule elements - * in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and - * CORS will be disabled for the Queue service. - * - * @return the cors value. - */ - public CorsRules cors() { - return this.cors; - } - - /** - * Set the cors property: Specifies CORS rules for the Queue service. You can include up to five CorsRule elements - * in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and - * CORS will be disabled for the Queue service. - * - * @param cors the cors value to set. - * @return the QueueServicePropertiesProperties object itself. - */ - public QueueServicePropertiesProperties withCors(CorsRules cors) { - this.cors = cors; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (cors() != null) { - cors().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/SkuInformationInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/SkuInformationInner.java deleted file mode 100644 index 585a531c1f5c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/SkuInformationInner.java +++ /dev/null @@ -1,179 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.storage.models.Kind; -import com.azure.resourcemanager.storage.models.Restriction; -import com.azure.resourcemanager.storage.models.SkuCapability; -import com.azure.resourcemanager.storage.models.SkuName; -import com.azure.resourcemanager.storage.models.SkuTier; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Storage SKU and its properties. */ -@Fluent -public final class SkuInformationInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SkuInformationInner.class); - - /* - * The SKU name. Required for account creation; optional for update. Note - * that in older versions, SKU name was called accountType. - */ - @JsonProperty(value = "name", required = true) - private SkuName name; - - /* - * The SKU tier. This is based on the SKU name. - */ - @JsonProperty(value = "tier", access = JsonProperty.Access.WRITE_ONLY) - private SkuTier tier; - - /* - * The type of the resource, usually it is 'storageAccounts'. - */ - @JsonProperty(value = "resourceType", access = JsonProperty.Access.WRITE_ONLY) - private String resourceType; - - /* - * Indicates the type of storage account. - */ - @JsonProperty(value = "kind", access = JsonProperty.Access.WRITE_ONLY) - private Kind kind; - - /* - * The set of locations that the SKU is available. This will be supported - * and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, - * etc.). - */ - @JsonProperty(value = "locations", access = JsonProperty.Access.WRITE_ONLY) - private List locations; - - /* - * The capability information in the specified SKU, including file - * encryption, network ACLs, change notification, etc. - */ - @JsonProperty(value = "capabilities", access = JsonProperty.Access.WRITE_ONLY) - private List capabilities; - - /* - * The restrictions because of which SKU cannot be used. This is empty if - * there are no restrictions. - */ - @JsonProperty(value = "restrictions") - private List restrictions; - - /** - * Get the name property: The SKU name. Required for account creation; optional for update. Note that in older - * versions, SKU name was called accountType. - * - * @return the name value. - */ - public SkuName name() { - return this.name; - } - - /** - * Set the name property: The SKU name. Required for account creation; optional for update. Note that in older - * versions, SKU name was called accountType. - * - * @param name the name value to set. - * @return the SkuInformationInner object itself. - */ - public SkuInformationInner withName(SkuName name) { - this.name = name; - return this; - } - - /** - * Get the tier property: The SKU tier. This is based on the SKU name. - * - * @return the tier value. - */ - public SkuTier tier() { - return this.tier; - } - - /** - * Get the resourceType property: The type of the resource, usually it is 'storageAccounts'. - * - * @return the resourceType value. - */ - public String resourceType() { - return this.resourceType; - } - - /** - * Get the kind property: Indicates the type of storage account. - * - * @return the kind value. - */ - public Kind kind() { - return this.kind; - } - - /** - * Get the locations property: The set of locations that the SKU is available. This will be supported and registered - * Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). - * - * @return the locations value. - */ - public List locations() { - return this.locations; - } - - /** - * Get the capabilities property: The capability information in the specified SKU, including file encryption, - * network ACLs, change notification, etc. - * - * @return the capabilities value. - */ - public List capabilities() { - return this.capabilities; - } - - /** - * Get the restrictions property: The restrictions because of which SKU cannot be used. This is empty if there are - * no restrictions. - * - * @return the restrictions value. - */ - public List restrictions() { - return this.restrictions; - } - - /** - * Set the restrictions property: The restrictions because of which SKU cannot be used. This is empty if there are - * no restrictions. - * - * @param restrictions the restrictions value to set. - * @return the SkuInformationInner object itself. - */ - public SkuInformationInner withRestrictions(List restrictions) { - this.restrictions = restrictions; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property name in model SkuInformationInner")); - } - if (capabilities() != null) { - capabilities().forEach(e -> e.validate()); - } - if (restrictions() != null) { - restrictions().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/StorageAccountInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/StorageAccountInner.java deleted file mode 100644 index 989a4330ffd2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/StorageAccountInner.java +++ /dev/null @@ -1,501 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.storage.models.AccessTier; -import com.azure.resourcemanager.storage.models.AccountStatus; -import com.azure.resourcemanager.storage.models.AzureFilesIdentityBasedAuthentication; -import com.azure.resourcemanager.storage.models.CustomDomain; -import com.azure.resourcemanager.storage.models.Encryption; -import com.azure.resourcemanager.storage.models.Endpoints; -import com.azure.resourcemanager.storage.models.GeoReplicationStats; -import com.azure.resourcemanager.storage.models.Identity; -import com.azure.resourcemanager.storage.models.Kind; -import com.azure.resourcemanager.storage.models.LargeFileSharesState; -import com.azure.resourcemanager.storage.models.MinimumTlsVersion; -import com.azure.resourcemanager.storage.models.NetworkRuleSet; -import com.azure.resourcemanager.storage.models.ProvisioningState; -import com.azure.resourcemanager.storage.models.RoutingPreference; -import com.azure.resourcemanager.storage.models.Sku; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; -import java.util.Map; - -/** The storage account. */ -@Fluent -public final class StorageAccountInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageAccountInner.class); - - /* - * Gets the SKU. - */ - @JsonProperty(value = "sku", access = JsonProperty.Access.WRITE_ONLY) - private Sku sku; - - /* - * Gets the Kind. - */ - @JsonProperty(value = "kind", access = JsonProperty.Access.WRITE_ONLY) - private Kind kind; - - /* - * The identity of the resource. - */ - @JsonProperty(value = "identity") - private Identity identity; - - /* - * Properties of the storage account. - */ - @JsonProperty(value = "properties") - private StorageAccountPropertiesInner innerProperties; - - /** - * Get the sku property: Gets the SKU. - * - * @return the sku value. - */ - public Sku sku() { - return this.sku; - } - - /** - * Get the kind property: Gets the Kind. - * - * @return the kind value. - */ - public Kind kind() { - return this.kind; - } - - /** - * Get the identity property: The identity of the resource. - * - * @return the identity value. - */ - public Identity identity() { - return this.identity; - } - - /** - * Set the identity property: The identity of the resource. - * - * @param identity the identity value to set. - * @return the StorageAccountInner object itself. - */ - public StorageAccountInner withIdentity(Identity identity) { - this.identity = identity; - return this; - } - - /** - * Get the innerProperties property: Properties of the storage account. - * - * @return the innerProperties value. - */ - private StorageAccountPropertiesInner innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public StorageAccountInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public StorageAccountInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the provisioningState property: Gets the status of the storage account at the time the operation was called. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the primaryEndpoints property: Gets the URLs that are used to perform a retrieval of a public blob, queue, or - * table object. Note that Standard_ZRS and Premium_LRS accounts only return the blob endpoint. - * - * @return the primaryEndpoints value. - */ - public Endpoints primaryEndpoints() { - return this.innerProperties() == null ? null : this.innerProperties().primaryEndpoints(); - } - - /** - * Get the primaryLocation property: Gets the location of the primary data center for the storage account. - * - * @return the primaryLocation value. - */ - public String primaryLocation() { - return this.innerProperties() == null ? null : this.innerProperties().primaryLocation(); - } - - /** - * Get the statusOfPrimary property: Gets the status indicating whether the primary location of the storage account - * is available or unavailable. - * - * @return the statusOfPrimary value. - */ - public AccountStatus statusOfPrimary() { - return this.innerProperties() == null ? null : this.innerProperties().statusOfPrimary(); - } - - /** - * Get the lastGeoFailoverTime property: Gets the timestamp of the most recent instance of a failover to the - * secondary location. Only the most recent timestamp is retained. This element is not returned if there has never - * been a failover instance. Only available if the accountType is Standard_GRS or Standard_RAGRS. - * - * @return the lastGeoFailoverTime value. - */ - public OffsetDateTime lastGeoFailoverTime() { - return this.innerProperties() == null ? null : this.innerProperties().lastGeoFailoverTime(); - } - - /** - * Get the secondaryLocation property: Gets the location of the geo-replicated secondary for the storage account. - * Only available if the accountType is Standard_GRS or Standard_RAGRS. - * - * @return the secondaryLocation value. - */ - public String secondaryLocation() { - return this.innerProperties() == null ? null : this.innerProperties().secondaryLocation(); - } - - /** - * Get the statusOfSecondary property: Gets the status indicating whether the secondary location of the storage - * account is available or unavailable. Only available if the SKU name is Standard_GRS or Standard_RAGRS. - * - * @return the statusOfSecondary value. - */ - public AccountStatus statusOfSecondary() { - return this.innerProperties() == null ? null : this.innerProperties().statusOfSecondary(); - } - - /** - * Get the creationTime property: Gets the creation date and time of the storage account in UTC. - * - * @return the creationTime value. - */ - public OffsetDateTime creationTime() { - return this.innerProperties() == null ? null : this.innerProperties().creationTime(); - } - - /** - * Get the customDomain property: Gets the custom domain the user assigned to this storage account. - * - * @return the customDomain value. - */ - public CustomDomain customDomain() { - return this.innerProperties() == null ? null : this.innerProperties().customDomain(); - } - - /** - * Get the secondaryEndpoints property: Gets the URLs that are used to perform a retrieval of a public blob, queue, - * or table object from the secondary location of the storage account. Only available if the SKU name is - * Standard_RAGRS. - * - * @return the secondaryEndpoints value. - */ - public Endpoints secondaryEndpoints() { - return this.innerProperties() == null ? null : this.innerProperties().secondaryEndpoints(); - } - - /** - * Get the encryption property: Gets the encryption settings on the account. If unspecified, the account is - * unencrypted. - * - * @return the encryption value. - */ - public Encryption encryption() { - return this.innerProperties() == null ? null : this.innerProperties().encryption(); - } - - /** - * Get the accessTier property: Required for storage accounts where kind = BlobStorage. The access tier used for - * billing. - * - * @return the accessTier value. - */ - public AccessTier accessTier() { - return this.innerProperties() == null ? null : this.innerProperties().accessTier(); - } - - /** - * Get the azureFilesIdentityBasedAuthentication property: Provides the identity based authentication settings for - * Azure Files. - * - * @return the azureFilesIdentityBasedAuthentication value. - */ - public AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication() { - return this.innerProperties() == null ? null : this.innerProperties().azureFilesIdentityBasedAuthentication(); - } - - /** - * Set the azureFilesIdentityBasedAuthentication property: Provides the identity based authentication settings for - * Azure Files. - * - * @param azureFilesIdentityBasedAuthentication the azureFilesIdentityBasedAuthentication value to set. - * @return the StorageAccountInner object itself. - */ - public StorageAccountInner withAzureFilesIdentityBasedAuthentication( - AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication) { - if (this.innerProperties() == null) { - this.innerProperties = new StorageAccountPropertiesInner(); - } - this.innerProperties().withAzureFilesIdentityBasedAuthentication(azureFilesIdentityBasedAuthentication); - return this; - } - - /** - * Get the enableHttpsTrafficOnly property: Allows https traffic only to storage service if sets to true. - * - * @return the enableHttpsTrafficOnly value. - */ - public Boolean enableHttpsTrafficOnly() { - return this.innerProperties() == null ? null : this.innerProperties().enableHttpsTrafficOnly(); - } - - /** - * Set the enableHttpsTrafficOnly property: Allows https traffic only to storage service if sets to true. - * - * @param enableHttpsTrafficOnly the enableHttpsTrafficOnly value to set. - * @return the StorageAccountInner object itself. - */ - public StorageAccountInner withEnableHttpsTrafficOnly(Boolean enableHttpsTrafficOnly) { - if (this.innerProperties() == null) { - this.innerProperties = new StorageAccountPropertiesInner(); - } - this.innerProperties().withEnableHttpsTrafficOnly(enableHttpsTrafficOnly); - return this; - } - - /** - * Get the networkRuleSet property: Network rule set. - * - * @return the networkRuleSet value. - */ - public NetworkRuleSet networkRuleSet() { - return this.innerProperties() == null ? null : this.innerProperties().networkRuleSet(); - } - - /** - * Get the isHnsEnabled property: Account HierarchicalNamespace enabled if sets to true. - * - * @return the isHnsEnabled value. - */ - public Boolean isHnsEnabled() { - return this.innerProperties() == null ? null : this.innerProperties().isHnsEnabled(); - } - - /** - * Set the isHnsEnabled property: Account HierarchicalNamespace enabled if sets to true. - * - * @param isHnsEnabled the isHnsEnabled value to set. - * @return the StorageAccountInner object itself. - */ - public StorageAccountInner withIsHnsEnabled(Boolean isHnsEnabled) { - if (this.innerProperties() == null) { - this.innerProperties = new StorageAccountPropertiesInner(); - } - this.innerProperties().withIsHnsEnabled(isHnsEnabled); - return this; - } - - /** - * Get the geoReplicationStats property: Geo Replication Stats. - * - * @return the geoReplicationStats value. - */ - public GeoReplicationStats geoReplicationStats() { - return this.innerProperties() == null ? null : this.innerProperties().geoReplicationStats(); - } - - /** - * Get the failoverInProgress property: If the failover is in progress, the value will be true, otherwise, it will - * be null. - * - * @return the failoverInProgress value. - */ - public Boolean failoverInProgress() { - return this.innerProperties() == null ? null : this.innerProperties().failoverInProgress(); - } - - /** - * Get the largeFileSharesState property: Allow large file shares if sets to Enabled. It cannot be disabled once it - * is enabled. - * - * @return the largeFileSharesState value. - */ - public LargeFileSharesState largeFileSharesState() { - return this.innerProperties() == null ? null : this.innerProperties().largeFileSharesState(); - } - - /** - * Set the largeFileSharesState property: Allow large file shares if sets to Enabled. It cannot be disabled once it - * is enabled. - * - * @param largeFileSharesState the largeFileSharesState value to set. - * @return the StorageAccountInner object itself. - */ - public StorageAccountInner withLargeFileSharesState(LargeFileSharesState largeFileSharesState) { - if (this.innerProperties() == null) { - this.innerProperties = new StorageAccountPropertiesInner(); - } - this.innerProperties().withLargeFileSharesState(largeFileSharesState); - return this; - } - - /** - * Get the privateEndpointConnections property: List of private endpoint connection associated with the specified - * storage account. - * - * @return the privateEndpointConnections value. - */ - public List privateEndpointConnections() { - return this.innerProperties() == null ? null : this.innerProperties().privateEndpointConnections(); - } - - /** - * Get the routingPreference property: Maintains information about the network routing choice opted by the user for - * data transfer. - * - * @return the routingPreference value. - */ - public RoutingPreference routingPreference() { - return this.innerProperties() == null ? null : this.innerProperties().routingPreference(); - } - - /** - * Set the routingPreference property: Maintains information about the network routing choice opted by the user for - * data transfer. - * - * @param routingPreference the routingPreference value to set. - * @return the StorageAccountInner object itself. - */ - public StorageAccountInner withRoutingPreference(RoutingPreference routingPreference) { - if (this.innerProperties() == null) { - this.innerProperties = new StorageAccountPropertiesInner(); - } - this.innerProperties().withRoutingPreference(routingPreference); - return this; - } - - /** - * Get the blobRestoreStatus property: Blob restore status. - * - * @return the blobRestoreStatus value. - */ - public BlobRestoreStatusInner blobRestoreStatus() { - return this.innerProperties() == null ? null : this.innerProperties().blobRestoreStatus(); - } - - /** - * Get the allowBlobPublicAccess property: Allow or disallow public access to all blobs or containers in the storage - * account. The default interpretation is true for this property. - * - * @return the allowBlobPublicAccess value. - */ - public Boolean allowBlobPublicAccess() { - return this.innerProperties() == null ? null : this.innerProperties().allowBlobPublicAccess(); - } - - /** - * Set the allowBlobPublicAccess property: Allow or disallow public access to all blobs or containers in the storage - * account. The default interpretation is true for this property. - * - * @param allowBlobPublicAccess the allowBlobPublicAccess value to set. - * @return the StorageAccountInner object itself. - */ - public StorageAccountInner withAllowBlobPublicAccess(Boolean allowBlobPublicAccess) { - if (this.innerProperties() == null) { - this.innerProperties = new StorageAccountPropertiesInner(); - } - this.innerProperties().withAllowBlobPublicAccess(allowBlobPublicAccess); - return this; - } - - /** - * Get the minimumTlsVersion property: Set the minimum TLS version to be permitted on requests to storage. The - * default interpretation is TLS 1.0 for this property. - * - * @return the minimumTlsVersion value. - */ - public MinimumTlsVersion minimumTlsVersion() { - return this.innerProperties() == null ? null : this.innerProperties().minimumTlsVersion(); - } - - /** - * Set the minimumTlsVersion property: Set the minimum TLS version to be permitted on requests to storage. The - * default interpretation is TLS 1.0 for this property. - * - * @param minimumTlsVersion the minimumTlsVersion value to set. - * @return the StorageAccountInner object itself. - */ - public StorageAccountInner withMinimumTlsVersion(MinimumTlsVersion minimumTlsVersion) { - if (this.innerProperties() == null) { - this.innerProperties = new StorageAccountPropertiesInner(); - } - this.innerProperties().withMinimumTlsVersion(minimumTlsVersion); - return this; - } - - /** - * Get the allowSharedKeyAccess property: Indicates whether the storage account permits requests to be authorized - * with the account access key via Shared Key. If false, then all requests, including shared access signatures, must - * be authorized with Azure Active Directory (Azure AD). The default value is null, which is equivalent to true. - * - * @return the allowSharedKeyAccess value. - */ - public Boolean allowSharedKeyAccess() { - return this.innerProperties() == null ? null : this.innerProperties().allowSharedKeyAccess(); - } - - /** - * Set the allowSharedKeyAccess property: Indicates whether the storage account permits requests to be authorized - * with the account access key via Shared Key. If false, then all requests, including shared access signatures, must - * be authorized with Azure Active Directory (Azure AD). The default value is null, which is equivalent to true. - * - * @param allowSharedKeyAccess the allowSharedKeyAccess value to set. - * @return the StorageAccountInner object itself. - */ - public StorageAccountInner withAllowSharedKeyAccess(Boolean allowSharedKeyAccess) { - if (this.innerProperties() == null) { - this.innerProperties = new StorageAccountPropertiesInner(); - } - this.innerProperties().withAllowSharedKeyAccess(allowSharedKeyAccess); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (sku() != null) { - sku().validate(); - } - if (identity() != null) { - identity().validate(); - } - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/StorageAccountListKeysResultInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/StorageAccountListKeysResultInner.java deleted file mode 100644 index f4a9c8436b35..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/StorageAccountListKeysResultInner.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.storage.models.StorageAccountKey; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The response from the ListKeys operation. */ -@Immutable -public final class StorageAccountListKeysResultInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageAccountListKeysResultInner.class); - - /* - * Gets the list of storage account keys and their properties for the - * specified storage account. - */ - @JsonProperty(value = "keys", access = JsonProperty.Access.WRITE_ONLY) - private List keys; - - /** - * Get the keys property: Gets the list of storage account keys and their properties for the specified storage - * account. - * - * @return the keys value. - */ - public List keys() { - return this.keys; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (keys() != null) { - keys().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/StorageAccountPropertiesCreateParameters.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/StorageAccountPropertiesCreateParameters.java deleted file mode 100644 index 42dab52048ae..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/StorageAccountPropertiesCreateParameters.java +++ /dev/null @@ -1,399 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.storage.models.AccessTier; -import com.azure.resourcemanager.storage.models.AzureFilesIdentityBasedAuthentication; -import com.azure.resourcemanager.storage.models.CustomDomain; -import com.azure.resourcemanager.storage.models.Encryption; -import com.azure.resourcemanager.storage.models.LargeFileSharesState; -import com.azure.resourcemanager.storage.models.MinimumTlsVersion; -import com.azure.resourcemanager.storage.models.NetworkRuleSet; -import com.azure.resourcemanager.storage.models.RoutingPreference; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The parameters used to create the storage account. */ -@Fluent -public final class StorageAccountPropertiesCreateParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageAccountPropertiesCreateParameters.class); - - /* - * User domain assigned to the storage account. Name is the CNAME source. - * Only one custom domain is supported per storage account at this time. To - * clear the existing custom domain, use an empty string for the custom - * domain name property. - */ - @JsonProperty(value = "customDomain") - private CustomDomain customDomain; - - /* - * Not applicable. Azure Storage encryption is enabled for all storage - * accounts and cannot be disabled. - */ - @JsonProperty(value = "encryption") - private Encryption encryption; - - /* - * Network rule set - */ - @JsonProperty(value = "networkAcls") - private NetworkRuleSet networkRuleSet; - - /* - * Required for storage accounts where kind = BlobStorage. The access tier - * used for billing. - */ - @JsonProperty(value = "accessTier") - private AccessTier accessTier; - - /* - * Provides the identity based authentication settings for Azure Files. - */ - @JsonProperty(value = "azureFilesIdentityBasedAuthentication") - private AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication; - - /* - * Allows https traffic only to storage service if sets to true. The - * default value is true since API version 2019-04-01. - */ - @JsonProperty(value = "supportsHttpsTrafficOnly") - private Boolean enableHttpsTrafficOnly; - - /* - * Account HierarchicalNamespace enabled if sets to true. - */ - @JsonProperty(value = "isHnsEnabled") - private Boolean isHnsEnabled; - - /* - * Allow large file shares if sets to Enabled. It cannot be disabled once - * it is enabled. - */ - @JsonProperty(value = "largeFileSharesState") - private LargeFileSharesState largeFileSharesState; - - /* - * Maintains information about the network routing choice opted by the user - * for data transfer - */ - @JsonProperty(value = "routingPreference") - private RoutingPreference routingPreference; - - /* - * Allow or disallow public access to all blobs or containers in the - * storage account. The default interpretation is true for this property. - */ - @JsonProperty(value = "allowBlobPublicAccess") - private Boolean allowBlobPublicAccess; - - /* - * Set the minimum TLS version to be permitted on requests to storage. The - * default interpretation is TLS 1.0 for this property. - */ - @JsonProperty(value = "minimumTlsVersion") - private MinimumTlsVersion minimumTlsVersion; - - /* - * Indicates whether the storage account permits requests to be authorized - * with the account access key via Shared Key. If false, then all requests, - * including shared access signatures, must be authorized with Azure Active - * Directory (Azure AD). The default value is null, which is equivalent to - * true. - */ - @JsonProperty(value = "allowSharedKeyAccess") - private Boolean allowSharedKeyAccess; - - /** - * Get the customDomain property: User domain assigned to the storage account. Name is the CNAME source. Only one - * custom domain is supported per storage account at this time. To clear the existing custom domain, use an empty - * string for the custom domain name property. - * - * @return the customDomain value. - */ - public CustomDomain customDomain() { - return this.customDomain; - } - - /** - * Set the customDomain property: User domain assigned to the storage account. Name is the CNAME source. Only one - * custom domain is supported per storage account at this time. To clear the existing custom domain, use an empty - * string for the custom domain name property. - * - * @param customDomain the customDomain value to set. - * @return the StorageAccountPropertiesCreateParameters object itself. - */ - public StorageAccountPropertiesCreateParameters withCustomDomain(CustomDomain customDomain) { - this.customDomain = customDomain; - return this; - } - - /** - * Get the encryption property: Not applicable. Azure Storage encryption is enabled for all storage accounts and - * cannot be disabled. - * - * @return the encryption value. - */ - public Encryption encryption() { - return this.encryption; - } - - /** - * Set the encryption property: Not applicable. Azure Storage encryption is enabled for all storage accounts and - * cannot be disabled. - * - * @param encryption the encryption value to set. - * @return the StorageAccountPropertiesCreateParameters object itself. - */ - public StorageAccountPropertiesCreateParameters withEncryption(Encryption encryption) { - this.encryption = encryption; - return this; - } - - /** - * Get the networkRuleSet property: Network rule set. - * - * @return the networkRuleSet value. - */ - public NetworkRuleSet networkRuleSet() { - return this.networkRuleSet; - } - - /** - * Set the networkRuleSet property: Network rule set. - * - * @param networkRuleSet the networkRuleSet value to set. - * @return the StorageAccountPropertiesCreateParameters object itself. - */ - public StorageAccountPropertiesCreateParameters withNetworkRuleSet(NetworkRuleSet networkRuleSet) { - this.networkRuleSet = networkRuleSet; - return this; - } - - /** - * Get the accessTier property: Required for storage accounts where kind = BlobStorage. The access tier used for - * billing. - * - * @return the accessTier value. - */ - public AccessTier accessTier() { - return this.accessTier; - } - - /** - * Set the accessTier property: Required for storage accounts where kind = BlobStorage. The access tier used for - * billing. - * - * @param accessTier the accessTier value to set. - * @return the StorageAccountPropertiesCreateParameters object itself. - */ - public StorageAccountPropertiesCreateParameters withAccessTier(AccessTier accessTier) { - this.accessTier = accessTier; - return this; - } - - /** - * Get the azureFilesIdentityBasedAuthentication property: Provides the identity based authentication settings for - * Azure Files. - * - * @return the azureFilesIdentityBasedAuthentication value. - */ - public AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication() { - return this.azureFilesIdentityBasedAuthentication; - } - - /** - * Set the azureFilesIdentityBasedAuthentication property: Provides the identity based authentication settings for - * Azure Files. - * - * @param azureFilesIdentityBasedAuthentication the azureFilesIdentityBasedAuthentication value to set. - * @return the StorageAccountPropertiesCreateParameters object itself. - */ - public StorageAccountPropertiesCreateParameters withAzureFilesIdentityBasedAuthentication( - AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication) { - this.azureFilesIdentityBasedAuthentication = azureFilesIdentityBasedAuthentication; - return this; - } - - /** - * Get the enableHttpsTrafficOnly property: Allows https traffic only to storage service if sets to true. The - * default value is true since API version 2019-04-01. - * - * @return the enableHttpsTrafficOnly value. - */ - public Boolean enableHttpsTrafficOnly() { - return this.enableHttpsTrafficOnly; - } - - /** - * Set the enableHttpsTrafficOnly property: Allows https traffic only to storage service if sets to true. The - * default value is true since API version 2019-04-01. - * - * @param enableHttpsTrafficOnly the enableHttpsTrafficOnly value to set. - * @return the StorageAccountPropertiesCreateParameters object itself. - */ - public StorageAccountPropertiesCreateParameters withEnableHttpsTrafficOnly(Boolean enableHttpsTrafficOnly) { - this.enableHttpsTrafficOnly = enableHttpsTrafficOnly; - return this; - } - - /** - * Get the isHnsEnabled property: Account HierarchicalNamespace enabled if sets to true. - * - * @return the isHnsEnabled value. - */ - public Boolean isHnsEnabled() { - return this.isHnsEnabled; - } - - /** - * Set the isHnsEnabled property: Account HierarchicalNamespace enabled if sets to true. - * - * @param isHnsEnabled the isHnsEnabled value to set. - * @return the StorageAccountPropertiesCreateParameters object itself. - */ - public StorageAccountPropertiesCreateParameters withIsHnsEnabled(Boolean isHnsEnabled) { - this.isHnsEnabled = isHnsEnabled; - return this; - } - - /** - * Get the largeFileSharesState property: Allow large file shares if sets to Enabled. It cannot be disabled once it - * is enabled. - * - * @return the largeFileSharesState value. - */ - public LargeFileSharesState largeFileSharesState() { - return this.largeFileSharesState; - } - - /** - * Set the largeFileSharesState property: Allow large file shares if sets to Enabled. It cannot be disabled once it - * is enabled. - * - * @param largeFileSharesState the largeFileSharesState value to set. - * @return the StorageAccountPropertiesCreateParameters object itself. - */ - public StorageAccountPropertiesCreateParameters withLargeFileSharesState( - LargeFileSharesState largeFileSharesState) { - this.largeFileSharesState = largeFileSharesState; - return this; - } - - /** - * Get the routingPreference property: Maintains information about the network routing choice opted by the user for - * data transfer. - * - * @return the routingPreference value. - */ - public RoutingPreference routingPreference() { - return this.routingPreference; - } - - /** - * Set the routingPreference property: Maintains information about the network routing choice opted by the user for - * data transfer. - * - * @param routingPreference the routingPreference value to set. - * @return the StorageAccountPropertiesCreateParameters object itself. - */ - public StorageAccountPropertiesCreateParameters withRoutingPreference(RoutingPreference routingPreference) { - this.routingPreference = routingPreference; - return this; - } - - /** - * Get the allowBlobPublicAccess property: Allow or disallow public access to all blobs or containers in the storage - * account. The default interpretation is true for this property. - * - * @return the allowBlobPublicAccess value. - */ - public Boolean allowBlobPublicAccess() { - return this.allowBlobPublicAccess; - } - - /** - * Set the allowBlobPublicAccess property: Allow or disallow public access to all blobs or containers in the storage - * account. The default interpretation is true for this property. - * - * @param allowBlobPublicAccess the allowBlobPublicAccess value to set. - * @return the StorageAccountPropertiesCreateParameters object itself. - */ - public StorageAccountPropertiesCreateParameters withAllowBlobPublicAccess(Boolean allowBlobPublicAccess) { - this.allowBlobPublicAccess = allowBlobPublicAccess; - return this; - } - - /** - * Get the minimumTlsVersion property: Set the minimum TLS version to be permitted on requests to storage. The - * default interpretation is TLS 1.0 for this property. - * - * @return the minimumTlsVersion value. - */ - public MinimumTlsVersion minimumTlsVersion() { - return this.minimumTlsVersion; - } - - /** - * Set the minimumTlsVersion property: Set the minimum TLS version to be permitted on requests to storage. The - * default interpretation is TLS 1.0 for this property. - * - * @param minimumTlsVersion the minimumTlsVersion value to set. - * @return the StorageAccountPropertiesCreateParameters object itself. - */ - public StorageAccountPropertiesCreateParameters withMinimumTlsVersion(MinimumTlsVersion minimumTlsVersion) { - this.minimumTlsVersion = minimumTlsVersion; - return this; - } - - /** - * Get the allowSharedKeyAccess property: Indicates whether the storage account permits requests to be authorized - * with the account access key via Shared Key. If false, then all requests, including shared access signatures, must - * be authorized with Azure Active Directory (Azure AD). The default value is null, which is equivalent to true. - * - * @return the allowSharedKeyAccess value. - */ - public Boolean allowSharedKeyAccess() { - return this.allowSharedKeyAccess; - } - - /** - * Set the allowSharedKeyAccess property: Indicates whether the storage account permits requests to be authorized - * with the account access key via Shared Key. If false, then all requests, including shared access signatures, must - * be authorized with Azure Active Directory (Azure AD). The default value is null, which is equivalent to true. - * - * @param allowSharedKeyAccess the allowSharedKeyAccess value to set. - * @return the StorageAccountPropertiesCreateParameters object itself. - */ - public StorageAccountPropertiesCreateParameters withAllowSharedKeyAccess(Boolean allowSharedKeyAccess) { - this.allowSharedKeyAccess = allowSharedKeyAccess; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (customDomain() != null) { - customDomain().validate(); - } - if (encryption() != null) { - encryption().validate(); - } - if (networkRuleSet() != null) { - networkRuleSet().validate(); - } - if (azureFilesIdentityBasedAuthentication() != null) { - azureFilesIdentityBasedAuthentication().validate(); - } - if (routingPreference() != null) { - routingPreference().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/StorageAccountPropertiesInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/StorageAccountPropertiesInner.java deleted file mode 100644 index 8723abacaebf..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/StorageAccountPropertiesInner.java +++ /dev/null @@ -1,583 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.storage.models.AccessTier; -import com.azure.resourcemanager.storage.models.AccountStatus; -import com.azure.resourcemanager.storage.models.AzureFilesIdentityBasedAuthentication; -import com.azure.resourcemanager.storage.models.CustomDomain; -import com.azure.resourcemanager.storage.models.Encryption; -import com.azure.resourcemanager.storage.models.Endpoints; -import com.azure.resourcemanager.storage.models.GeoReplicationStats; -import com.azure.resourcemanager.storage.models.LargeFileSharesState; -import com.azure.resourcemanager.storage.models.MinimumTlsVersion; -import com.azure.resourcemanager.storage.models.NetworkRuleSet; -import com.azure.resourcemanager.storage.models.ProvisioningState; -import com.azure.resourcemanager.storage.models.RoutingPreference; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; - -/** Properties of the storage account. */ -@Fluent -public final class StorageAccountPropertiesInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageAccountPropertiesInner.class); - - /* - * Gets the status of the storage account at the time the operation was - * called. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private ProvisioningState provisioningState; - - /* - * Gets the URLs that are used to perform a retrieval of a public blob, - * queue, or table object. Note that Standard_ZRS and Premium_LRS accounts - * only return the blob endpoint. - */ - @JsonProperty(value = "primaryEndpoints", access = JsonProperty.Access.WRITE_ONLY) - private Endpoints primaryEndpoints; - - /* - * Gets the location of the primary data center for the storage account. - */ - @JsonProperty(value = "primaryLocation", access = JsonProperty.Access.WRITE_ONLY) - private String primaryLocation; - - /* - * Gets the status indicating whether the primary location of the storage - * account is available or unavailable. - */ - @JsonProperty(value = "statusOfPrimary", access = JsonProperty.Access.WRITE_ONLY) - private AccountStatus statusOfPrimary; - - /* - * Gets the timestamp of the most recent instance of a failover to the - * secondary location. Only the most recent timestamp is retained. This - * element is not returned if there has never been a failover instance. - * Only available if the accountType is Standard_GRS or Standard_RAGRS. - */ - @JsonProperty(value = "lastGeoFailoverTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime lastGeoFailoverTime; - - /* - * Gets the location of the geo-replicated secondary for the storage - * account. Only available if the accountType is Standard_GRS or - * Standard_RAGRS. - */ - @JsonProperty(value = "secondaryLocation", access = JsonProperty.Access.WRITE_ONLY) - private String secondaryLocation; - - /* - * Gets the status indicating whether the secondary location of the storage - * account is available or unavailable. Only available if the SKU name is - * Standard_GRS or Standard_RAGRS. - */ - @JsonProperty(value = "statusOfSecondary", access = JsonProperty.Access.WRITE_ONLY) - private AccountStatus statusOfSecondary; - - /* - * Gets the creation date and time of the storage account in UTC. - */ - @JsonProperty(value = "creationTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime creationTime; - - /* - * Gets the custom domain the user assigned to this storage account. - */ - @JsonProperty(value = "customDomain", access = JsonProperty.Access.WRITE_ONLY) - private CustomDomain customDomain; - - /* - * Gets the URLs that are used to perform a retrieval of a public blob, - * queue, or table object from the secondary location of the storage - * account. Only available if the SKU name is Standard_RAGRS. - */ - @JsonProperty(value = "secondaryEndpoints", access = JsonProperty.Access.WRITE_ONLY) - private Endpoints secondaryEndpoints; - - /* - * Gets the encryption settings on the account. If unspecified, the account - * is unencrypted. - */ - @JsonProperty(value = "encryption", access = JsonProperty.Access.WRITE_ONLY) - private Encryption encryption; - - /* - * Required for storage accounts where kind = BlobStorage. The access tier - * used for billing. - */ - @JsonProperty(value = "accessTier", access = JsonProperty.Access.WRITE_ONLY) - private AccessTier accessTier; - - /* - * Provides the identity based authentication settings for Azure Files. - */ - @JsonProperty(value = "azureFilesIdentityBasedAuthentication") - private AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication; - - /* - * Allows https traffic only to storage service if sets to true. - */ - @JsonProperty(value = "supportsHttpsTrafficOnly") - private Boolean enableHttpsTrafficOnly; - - /* - * Network rule set - */ - @JsonProperty(value = "networkAcls", access = JsonProperty.Access.WRITE_ONLY) - private NetworkRuleSet networkRuleSet; - - /* - * Account HierarchicalNamespace enabled if sets to true. - */ - @JsonProperty(value = "isHnsEnabled") - private Boolean isHnsEnabled; - - /* - * Geo Replication Stats - */ - @JsonProperty(value = "geoReplicationStats", access = JsonProperty.Access.WRITE_ONLY) - private GeoReplicationStats geoReplicationStats; - - /* - * If the failover is in progress, the value will be true, otherwise, it - * will be null. - */ - @JsonProperty(value = "failoverInProgress", access = JsonProperty.Access.WRITE_ONLY) - private Boolean failoverInProgress; - - /* - * Allow large file shares if sets to Enabled. It cannot be disabled once - * it is enabled. - */ - @JsonProperty(value = "largeFileSharesState") - private LargeFileSharesState largeFileSharesState; - - /* - * List of private endpoint connection associated with the specified - * storage account - */ - @JsonProperty(value = "privateEndpointConnections", access = JsonProperty.Access.WRITE_ONLY) - private List privateEndpointConnections; - - /* - * Maintains information about the network routing choice opted by the user - * for data transfer - */ - @JsonProperty(value = "routingPreference") - private RoutingPreference routingPreference; - - /* - * Blob restore status - */ - @JsonProperty(value = "blobRestoreStatus", access = JsonProperty.Access.WRITE_ONLY) - private BlobRestoreStatusInner blobRestoreStatus; - - /* - * Allow or disallow public access to all blobs or containers in the - * storage account. The default interpretation is true for this property. - */ - @JsonProperty(value = "allowBlobPublicAccess") - private Boolean allowBlobPublicAccess; - - /* - * Set the minimum TLS version to be permitted on requests to storage. The - * default interpretation is TLS 1.0 for this property. - */ - @JsonProperty(value = "minimumTlsVersion") - private MinimumTlsVersion minimumTlsVersion; - - /* - * Indicates whether the storage account permits requests to be authorized - * with the account access key via Shared Key. If false, then all requests, - * including shared access signatures, must be authorized with Azure Active - * Directory (Azure AD). The default value is null, which is equivalent to - * true. - */ - @JsonProperty(value = "allowSharedKeyAccess") - private Boolean allowSharedKeyAccess; - - /** - * Get the provisioningState property: Gets the status of the storage account at the time the operation was called. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Get the primaryEndpoints property: Gets the URLs that are used to perform a retrieval of a public blob, queue, or - * table object. Note that Standard_ZRS and Premium_LRS accounts only return the blob endpoint. - * - * @return the primaryEndpoints value. - */ - public Endpoints primaryEndpoints() { - return this.primaryEndpoints; - } - - /** - * Get the primaryLocation property: Gets the location of the primary data center for the storage account. - * - * @return the primaryLocation value. - */ - public String primaryLocation() { - return this.primaryLocation; - } - - /** - * Get the statusOfPrimary property: Gets the status indicating whether the primary location of the storage account - * is available or unavailable. - * - * @return the statusOfPrimary value. - */ - public AccountStatus statusOfPrimary() { - return this.statusOfPrimary; - } - - /** - * Get the lastGeoFailoverTime property: Gets the timestamp of the most recent instance of a failover to the - * secondary location. Only the most recent timestamp is retained. This element is not returned if there has never - * been a failover instance. Only available if the accountType is Standard_GRS or Standard_RAGRS. - * - * @return the lastGeoFailoverTime value. - */ - public OffsetDateTime lastGeoFailoverTime() { - return this.lastGeoFailoverTime; - } - - /** - * Get the secondaryLocation property: Gets the location of the geo-replicated secondary for the storage account. - * Only available if the accountType is Standard_GRS or Standard_RAGRS. - * - * @return the secondaryLocation value. - */ - public String secondaryLocation() { - return this.secondaryLocation; - } - - /** - * Get the statusOfSecondary property: Gets the status indicating whether the secondary location of the storage - * account is available or unavailable. Only available if the SKU name is Standard_GRS or Standard_RAGRS. - * - * @return the statusOfSecondary value. - */ - public AccountStatus statusOfSecondary() { - return this.statusOfSecondary; - } - - /** - * Get the creationTime property: Gets the creation date and time of the storage account in UTC. - * - * @return the creationTime value. - */ - public OffsetDateTime creationTime() { - return this.creationTime; - } - - /** - * Get the customDomain property: Gets the custom domain the user assigned to this storage account. - * - * @return the customDomain value. - */ - public CustomDomain customDomain() { - return this.customDomain; - } - - /** - * Get the secondaryEndpoints property: Gets the URLs that are used to perform a retrieval of a public blob, queue, - * or table object from the secondary location of the storage account. Only available if the SKU name is - * Standard_RAGRS. - * - * @return the secondaryEndpoints value. - */ - public Endpoints secondaryEndpoints() { - return this.secondaryEndpoints; - } - - /** - * Get the encryption property: Gets the encryption settings on the account. If unspecified, the account is - * unencrypted. - * - * @return the encryption value. - */ - public Encryption encryption() { - return this.encryption; - } - - /** - * Get the accessTier property: Required for storage accounts where kind = BlobStorage. The access tier used for - * billing. - * - * @return the accessTier value. - */ - public AccessTier accessTier() { - return this.accessTier; - } - - /** - * Get the azureFilesIdentityBasedAuthentication property: Provides the identity based authentication settings for - * Azure Files. - * - * @return the azureFilesIdentityBasedAuthentication value. - */ - public AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication() { - return this.azureFilesIdentityBasedAuthentication; - } - - /** - * Set the azureFilesIdentityBasedAuthentication property: Provides the identity based authentication settings for - * Azure Files. - * - * @param azureFilesIdentityBasedAuthentication the azureFilesIdentityBasedAuthentication value to set. - * @return the StorageAccountPropertiesInner object itself. - */ - public StorageAccountPropertiesInner withAzureFilesIdentityBasedAuthentication( - AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication) { - this.azureFilesIdentityBasedAuthentication = azureFilesIdentityBasedAuthentication; - return this; - } - - /** - * Get the enableHttpsTrafficOnly property: Allows https traffic only to storage service if sets to true. - * - * @return the enableHttpsTrafficOnly value. - */ - public Boolean enableHttpsTrafficOnly() { - return this.enableHttpsTrafficOnly; - } - - /** - * Set the enableHttpsTrafficOnly property: Allows https traffic only to storage service if sets to true. - * - * @param enableHttpsTrafficOnly the enableHttpsTrafficOnly value to set. - * @return the StorageAccountPropertiesInner object itself. - */ - public StorageAccountPropertiesInner withEnableHttpsTrafficOnly(Boolean enableHttpsTrafficOnly) { - this.enableHttpsTrafficOnly = enableHttpsTrafficOnly; - return this; - } - - /** - * Get the networkRuleSet property: Network rule set. - * - * @return the networkRuleSet value. - */ - public NetworkRuleSet networkRuleSet() { - return this.networkRuleSet; - } - - /** - * Get the isHnsEnabled property: Account HierarchicalNamespace enabled if sets to true. - * - * @return the isHnsEnabled value. - */ - public Boolean isHnsEnabled() { - return this.isHnsEnabled; - } - - /** - * Set the isHnsEnabled property: Account HierarchicalNamespace enabled if sets to true. - * - * @param isHnsEnabled the isHnsEnabled value to set. - * @return the StorageAccountPropertiesInner object itself. - */ - public StorageAccountPropertiesInner withIsHnsEnabled(Boolean isHnsEnabled) { - this.isHnsEnabled = isHnsEnabled; - return this; - } - - /** - * Get the geoReplicationStats property: Geo Replication Stats. - * - * @return the geoReplicationStats value. - */ - public GeoReplicationStats geoReplicationStats() { - return this.geoReplicationStats; - } - - /** - * Get the failoverInProgress property: If the failover is in progress, the value will be true, otherwise, it will - * be null. - * - * @return the failoverInProgress value. - */ - public Boolean failoverInProgress() { - return this.failoverInProgress; - } - - /** - * Get the largeFileSharesState property: Allow large file shares if sets to Enabled. It cannot be disabled once it - * is enabled. - * - * @return the largeFileSharesState value. - */ - public LargeFileSharesState largeFileSharesState() { - return this.largeFileSharesState; - } - - /** - * Set the largeFileSharesState property: Allow large file shares if sets to Enabled. It cannot be disabled once it - * is enabled. - * - * @param largeFileSharesState the largeFileSharesState value to set. - * @return the StorageAccountPropertiesInner object itself. - */ - public StorageAccountPropertiesInner withLargeFileSharesState(LargeFileSharesState largeFileSharesState) { - this.largeFileSharesState = largeFileSharesState; - return this; - } - - /** - * Get the privateEndpointConnections property: List of private endpoint connection associated with the specified - * storage account. - * - * @return the privateEndpointConnections value. - */ - public List privateEndpointConnections() { - return this.privateEndpointConnections; - } - - /** - * Get the routingPreference property: Maintains information about the network routing choice opted by the user for - * data transfer. - * - * @return the routingPreference value. - */ - public RoutingPreference routingPreference() { - return this.routingPreference; - } - - /** - * Set the routingPreference property: Maintains information about the network routing choice opted by the user for - * data transfer. - * - * @param routingPreference the routingPreference value to set. - * @return the StorageAccountPropertiesInner object itself. - */ - public StorageAccountPropertiesInner withRoutingPreference(RoutingPreference routingPreference) { - this.routingPreference = routingPreference; - return this; - } - - /** - * Get the blobRestoreStatus property: Blob restore status. - * - * @return the blobRestoreStatus value. - */ - public BlobRestoreStatusInner blobRestoreStatus() { - return this.blobRestoreStatus; - } - - /** - * Get the allowBlobPublicAccess property: Allow or disallow public access to all blobs or containers in the storage - * account. The default interpretation is true for this property. - * - * @return the allowBlobPublicAccess value. - */ - public Boolean allowBlobPublicAccess() { - return this.allowBlobPublicAccess; - } - - /** - * Set the allowBlobPublicAccess property: Allow or disallow public access to all blobs or containers in the storage - * account. The default interpretation is true for this property. - * - * @param allowBlobPublicAccess the allowBlobPublicAccess value to set. - * @return the StorageAccountPropertiesInner object itself. - */ - public StorageAccountPropertiesInner withAllowBlobPublicAccess(Boolean allowBlobPublicAccess) { - this.allowBlobPublicAccess = allowBlobPublicAccess; - return this; - } - - /** - * Get the minimumTlsVersion property: Set the minimum TLS version to be permitted on requests to storage. The - * default interpretation is TLS 1.0 for this property. - * - * @return the minimumTlsVersion value. - */ - public MinimumTlsVersion minimumTlsVersion() { - return this.minimumTlsVersion; - } - - /** - * Set the minimumTlsVersion property: Set the minimum TLS version to be permitted on requests to storage. The - * default interpretation is TLS 1.0 for this property. - * - * @param minimumTlsVersion the minimumTlsVersion value to set. - * @return the StorageAccountPropertiesInner object itself. - */ - public StorageAccountPropertiesInner withMinimumTlsVersion(MinimumTlsVersion minimumTlsVersion) { - this.minimumTlsVersion = minimumTlsVersion; - return this; - } - - /** - * Get the allowSharedKeyAccess property: Indicates whether the storage account permits requests to be authorized - * with the account access key via Shared Key. If false, then all requests, including shared access signatures, must - * be authorized with Azure Active Directory (Azure AD). The default value is null, which is equivalent to true. - * - * @return the allowSharedKeyAccess value. - */ - public Boolean allowSharedKeyAccess() { - return this.allowSharedKeyAccess; - } - - /** - * Set the allowSharedKeyAccess property: Indicates whether the storage account permits requests to be authorized - * with the account access key via Shared Key. If false, then all requests, including shared access signatures, must - * be authorized with Azure Active Directory (Azure AD). The default value is null, which is equivalent to true. - * - * @param allowSharedKeyAccess the allowSharedKeyAccess value to set. - * @return the StorageAccountPropertiesInner object itself. - */ - public StorageAccountPropertiesInner withAllowSharedKeyAccess(Boolean allowSharedKeyAccess) { - this.allowSharedKeyAccess = allowSharedKeyAccess; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (primaryEndpoints() != null) { - primaryEndpoints().validate(); - } - if (customDomain() != null) { - customDomain().validate(); - } - if (secondaryEndpoints() != null) { - secondaryEndpoints().validate(); - } - if (encryption() != null) { - encryption().validate(); - } - if (azureFilesIdentityBasedAuthentication() != null) { - azureFilesIdentityBasedAuthentication().validate(); - } - if (networkRuleSet() != null) { - networkRuleSet().validate(); - } - if (geoReplicationStats() != null) { - geoReplicationStats().validate(); - } - if (privateEndpointConnections() != null) { - privateEndpointConnections().forEach(e -> e.validate()); - } - if (routingPreference() != null) { - routingPreference().validate(); - } - if (blobRestoreStatus() != null) { - blobRestoreStatus().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/StorageAccountPropertiesUpdateParameters.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/StorageAccountPropertiesUpdateParameters.java deleted file mode 100644 index aff721a018d9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/StorageAccountPropertiesUpdateParameters.java +++ /dev/null @@ -1,368 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.storage.models.AccessTier; -import com.azure.resourcemanager.storage.models.AzureFilesIdentityBasedAuthentication; -import com.azure.resourcemanager.storage.models.CustomDomain; -import com.azure.resourcemanager.storage.models.Encryption; -import com.azure.resourcemanager.storage.models.LargeFileSharesState; -import com.azure.resourcemanager.storage.models.MinimumTlsVersion; -import com.azure.resourcemanager.storage.models.NetworkRuleSet; -import com.azure.resourcemanager.storage.models.RoutingPreference; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The parameters used when updating a storage account. */ -@Fluent -public final class StorageAccountPropertiesUpdateParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageAccountPropertiesUpdateParameters.class); - - /* - * Custom domain assigned to the storage account by the user. Name is the - * CNAME source. Only one custom domain is supported per storage account at - * this time. To clear the existing custom domain, use an empty string for - * the custom domain name property. - */ - @JsonProperty(value = "customDomain") - private CustomDomain customDomain; - - /* - * Provides the encryption settings on the account. The default setting is - * unencrypted. - */ - @JsonProperty(value = "encryption") - private Encryption encryption; - - /* - * Required for storage accounts where kind = BlobStorage. The access tier - * used for billing. - */ - @JsonProperty(value = "accessTier") - private AccessTier accessTier; - - /* - * Provides the identity based authentication settings for Azure Files. - */ - @JsonProperty(value = "azureFilesIdentityBasedAuthentication") - private AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication; - - /* - * Allows https traffic only to storage service if sets to true. - */ - @JsonProperty(value = "supportsHttpsTrafficOnly") - private Boolean enableHttpsTrafficOnly; - - /* - * Network rule set - */ - @JsonProperty(value = "networkAcls") - private NetworkRuleSet networkRuleSet; - - /* - * Allow large file shares if sets to Enabled. It cannot be disabled once - * it is enabled. - */ - @JsonProperty(value = "largeFileSharesState") - private LargeFileSharesState largeFileSharesState; - - /* - * Maintains information about the network routing choice opted by the user - * for data transfer - */ - @JsonProperty(value = "routingPreference") - private RoutingPreference routingPreference; - - /* - * Allow or disallow public access to all blobs or containers in the - * storage account. The default interpretation is true for this property. - */ - @JsonProperty(value = "allowBlobPublicAccess") - private Boolean allowBlobPublicAccess; - - /* - * Set the minimum TLS version to be permitted on requests to storage. The - * default interpretation is TLS 1.0 for this property. - */ - @JsonProperty(value = "minimumTlsVersion") - private MinimumTlsVersion minimumTlsVersion; - - /* - * Indicates whether the storage account permits requests to be authorized - * with the account access key via Shared Key. If false, then all requests, - * including shared access signatures, must be authorized with Azure Active - * Directory (Azure AD). The default value is null, which is equivalent to - * true. - */ - @JsonProperty(value = "allowSharedKeyAccess") - private Boolean allowSharedKeyAccess; - - /** - * Get the customDomain property: Custom domain assigned to the storage account by the user. Name is the CNAME - * source. Only one custom domain is supported per storage account at this time. To clear the existing custom - * domain, use an empty string for the custom domain name property. - * - * @return the customDomain value. - */ - public CustomDomain customDomain() { - return this.customDomain; - } - - /** - * Set the customDomain property: Custom domain assigned to the storage account by the user. Name is the CNAME - * source. Only one custom domain is supported per storage account at this time. To clear the existing custom - * domain, use an empty string for the custom domain name property. - * - * @param customDomain the customDomain value to set. - * @return the StorageAccountPropertiesUpdateParameters object itself. - */ - public StorageAccountPropertiesUpdateParameters withCustomDomain(CustomDomain customDomain) { - this.customDomain = customDomain; - return this; - } - - /** - * Get the encryption property: Provides the encryption settings on the account. The default setting is unencrypted. - * - * @return the encryption value. - */ - public Encryption encryption() { - return this.encryption; - } - - /** - * Set the encryption property: Provides the encryption settings on the account. The default setting is unencrypted. - * - * @param encryption the encryption value to set. - * @return the StorageAccountPropertiesUpdateParameters object itself. - */ - public StorageAccountPropertiesUpdateParameters withEncryption(Encryption encryption) { - this.encryption = encryption; - return this; - } - - /** - * Get the accessTier property: Required for storage accounts where kind = BlobStorage. The access tier used for - * billing. - * - * @return the accessTier value. - */ - public AccessTier accessTier() { - return this.accessTier; - } - - /** - * Set the accessTier property: Required for storage accounts where kind = BlobStorage. The access tier used for - * billing. - * - * @param accessTier the accessTier value to set. - * @return the StorageAccountPropertiesUpdateParameters object itself. - */ - public StorageAccountPropertiesUpdateParameters withAccessTier(AccessTier accessTier) { - this.accessTier = accessTier; - return this; - } - - /** - * Get the azureFilesIdentityBasedAuthentication property: Provides the identity based authentication settings for - * Azure Files. - * - * @return the azureFilesIdentityBasedAuthentication value. - */ - public AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication() { - return this.azureFilesIdentityBasedAuthentication; - } - - /** - * Set the azureFilesIdentityBasedAuthentication property: Provides the identity based authentication settings for - * Azure Files. - * - * @param azureFilesIdentityBasedAuthentication the azureFilesIdentityBasedAuthentication value to set. - * @return the StorageAccountPropertiesUpdateParameters object itself. - */ - public StorageAccountPropertiesUpdateParameters withAzureFilesIdentityBasedAuthentication( - AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication) { - this.azureFilesIdentityBasedAuthentication = azureFilesIdentityBasedAuthentication; - return this; - } - - /** - * Get the enableHttpsTrafficOnly property: Allows https traffic only to storage service if sets to true. - * - * @return the enableHttpsTrafficOnly value. - */ - public Boolean enableHttpsTrafficOnly() { - return this.enableHttpsTrafficOnly; - } - - /** - * Set the enableHttpsTrafficOnly property: Allows https traffic only to storage service if sets to true. - * - * @param enableHttpsTrafficOnly the enableHttpsTrafficOnly value to set. - * @return the StorageAccountPropertiesUpdateParameters object itself. - */ - public StorageAccountPropertiesUpdateParameters withEnableHttpsTrafficOnly(Boolean enableHttpsTrafficOnly) { - this.enableHttpsTrafficOnly = enableHttpsTrafficOnly; - return this; - } - - /** - * Get the networkRuleSet property: Network rule set. - * - * @return the networkRuleSet value. - */ - public NetworkRuleSet networkRuleSet() { - return this.networkRuleSet; - } - - /** - * Set the networkRuleSet property: Network rule set. - * - * @param networkRuleSet the networkRuleSet value to set. - * @return the StorageAccountPropertiesUpdateParameters object itself. - */ - public StorageAccountPropertiesUpdateParameters withNetworkRuleSet(NetworkRuleSet networkRuleSet) { - this.networkRuleSet = networkRuleSet; - return this; - } - - /** - * Get the largeFileSharesState property: Allow large file shares if sets to Enabled. It cannot be disabled once it - * is enabled. - * - * @return the largeFileSharesState value. - */ - public LargeFileSharesState largeFileSharesState() { - return this.largeFileSharesState; - } - - /** - * Set the largeFileSharesState property: Allow large file shares if sets to Enabled. It cannot be disabled once it - * is enabled. - * - * @param largeFileSharesState the largeFileSharesState value to set. - * @return the StorageAccountPropertiesUpdateParameters object itself. - */ - public StorageAccountPropertiesUpdateParameters withLargeFileSharesState( - LargeFileSharesState largeFileSharesState) { - this.largeFileSharesState = largeFileSharesState; - return this; - } - - /** - * Get the routingPreference property: Maintains information about the network routing choice opted by the user for - * data transfer. - * - * @return the routingPreference value. - */ - public RoutingPreference routingPreference() { - return this.routingPreference; - } - - /** - * Set the routingPreference property: Maintains information about the network routing choice opted by the user for - * data transfer. - * - * @param routingPreference the routingPreference value to set. - * @return the StorageAccountPropertiesUpdateParameters object itself. - */ - public StorageAccountPropertiesUpdateParameters withRoutingPreference(RoutingPreference routingPreference) { - this.routingPreference = routingPreference; - return this; - } - - /** - * Get the allowBlobPublicAccess property: Allow or disallow public access to all blobs or containers in the storage - * account. The default interpretation is true for this property. - * - * @return the allowBlobPublicAccess value. - */ - public Boolean allowBlobPublicAccess() { - return this.allowBlobPublicAccess; - } - - /** - * Set the allowBlobPublicAccess property: Allow or disallow public access to all blobs or containers in the storage - * account. The default interpretation is true for this property. - * - * @param allowBlobPublicAccess the allowBlobPublicAccess value to set. - * @return the StorageAccountPropertiesUpdateParameters object itself. - */ - public StorageAccountPropertiesUpdateParameters withAllowBlobPublicAccess(Boolean allowBlobPublicAccess) { - this.allowBlobPublicAccess = allowBlobPublicAccess; - return this; - } - - /** - * Get the minimumTlsVersion property: Set the minimum TLS version to be permitted on requests to storage. The - * default interpretation is TLS 1.0 for this property. - * - * @return the minimumTlsVersion value. - */ - public MinimumTlsVersion minimumTlsVersion() { - return this.minimumTlsVersion; - } - - /** - * Set the minimumTlsVersion property: Set the minimum TLS version to be permitted on requests to storage. The - * default interpretation is TLS 1.0 for this property. - * - * @param minimumTlsVersion the minimumTlsVersion value to set. - * @return the StorageAccountPropertiesUpdateParameters object itself. - */ - public StorageAccountPropertiesUpdateParameters withMinimumTlsVersion(MinimumTlsVersion minimumTlsVersion) { - this.minimumTlsVersion = minimumTlsVersion; - return this; - } - - /** - * Get the allowSharedKeyAccess property: Indicates whether the storage account permits requests to be authorized - * with the account access key via Shared Key. If false, then all requests, including shared access signatures, must - * be authorized with Azure Active Directory (Azure AD). The default value is null, which is equivalent to true. - * - * @return the allowSharedKeyAccess value. - */ - public Boolean allowSharedKeyAccess() { - return this.allowSharedKeyAccess; - } - - /** - * Set the allowSharedKeyAccess property: Indicates whether the storage account permits requests to be authorized - * with the account access key via Shared Key. If false, then all requests, including shared access signatures, must - * be authorized with Azure Active Directory (Azure AD). The default value is null, which is equivalent to true. - * - * @param allowSharedKeyAccess the allowSharedKeyAccess value to set. - * @return the StorageAccountPropertiesUpdateParameters object itself. - */ - public StorageAccountPropertiesUpdateParameters withAllowSharedKeyAccess(Boolean allowSharedKeyAccess) { - this.allowSharedKeyAccess = allowSharedKeyAccess; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (customDomain() != null) { - customDomain().validate(); - } - if (encryption() != null) { - encryption().validate(); - } - if (azureFilesIdentityBasedAuthentication() != null) { - azureFilesIdentityBasedAuthentication().validate(); - } - if (networkRuleSet() != null) { - networkRuleSet().validate(); - } - if (routingPreference() != null) { - routingPreference().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/StorageQueueInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/StorageQueueInner.java deleted file mode 100644 index fafea1e2074e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/StorageQueueInner.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** The StorageQueue model. */ -@Fluent -public final class StorageQueueInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageQueueInner.class); - - /* - * Queue resource properties. - */ - @JsonProperty(value = "properties") - private QueueProperties innerQueueProperties; - - /** - * Get the innerQueueProperties property: Queue resource properties. - * - * @return the innerQueueProperties value. - */ - private QueueProperties innerQueueProperties() { - return this.innerQueueProperties; - } - - /** - * Get the metadata property: A name-value pair that represents queue metadata. - * - * @return the metadata value. - */ - public Map metadata() { - return this.innerQueueProperties() == null ? null : this.innerQueueProperties().metadata(); - } - - /** - * Set the metadata property: A name-value pair that represents queue metadata. - * - * @param metadata the metadata value to set. - * @return the StorageQueueInner object itself. - */ - public StorageQueueInner withMetadata(Map metadata) { - if (this.innerQueueProperties() == null) { - this.innerQueueProperties = new QueueProperties(); - } - this.innerQueueProperties().withMetadata(metadata); - return this; - } - - /** - * Get the approximateMessageCount property: Integer indicating an approximate number of messages in the queue. This - * number is not lower than the actual number of messages in the queue, but could be higher. - * - * @return the approximateMessageCount value. - */ - public Integer approximateMessageCount() { - return this.innerQueueProperties() == null ? null : this.innerQueueProperties().approximateMessageCount(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerQueueProperties() != null) { - innerQueueProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/TableInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/TableInner.java deleted file mode 100644 index a12dae9ed8f9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/TableInner.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Properties of the table, including Id, resource name, resource type. */ -@Fluent -public final class TableInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TableInner.class); - - /* - * Table resource properties. - */ - @JsonProperty(value = "properties") - private TableProperties innerTableProperties; - - /** - * Get the innerTableProperties property: Table resource properties. - * - * @return the innerTableProperties value. - */ - private TableProperties innerTableProperties() { - return this.innerTableProperties; - } - - /** - * Get the tableName property: Table name under the specified account. - * - * @return the tableName value. - */ - public String tableName() { - return this.innerTableProperties() == null ? null : this.innerTableProperties().tableName(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerTableProperties() != null) { - innerTableProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/TableProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/TableProperties.java deleted file mode 100644 index 801be1cd4940..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/TableProperties.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The TableProperties model. */ -@Immutable -public final class TableProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TableProperties.class); - - /* - * Table name under the specified account - */ - @JsonProperty(value = "tableName", access = JsonProperty.Access.WRITE_ONLY) - private String tableName; - - /** - * Get the tableName property: Table name under the specified account. - * - * @return the tableName value. - */ - public String tableName() { - return this.tableName; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/TableServicePropertiesInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/TableServicePropertiesInner.java deleted file mode 100644 index d236507799e6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/TableServicePropertiesInner.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.storage.models.CorsRules; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The properties of a storage account’s Table service. */ -@Fluent -public final class TableServicePropertiesInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TableServicePropertiesInner.class); - - /* - * The properties of a storage account’s Table service. - */ - @JsonProperty(value = "properties") - private TableServicePropertiesProperties innerTableServiceProperties; - - /** - * Get the innerTableServiceProperties property: The properties of a storage account’s Table service. - * - * @return the innerTableServiceProperties value. - */ - private TableServicePropertiesProperties innerTableServiceProperties() { - return this.innerTableServiceProperties; - } - - /** - * Get the cors property: Specifies CORS rules for the Table service. You can include up to five CorsRule elements - * in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and - * CORS will be disabled for the Table service. - * - * @return the cors value. - */ - public CorsRules cors() { - return this.innerTableServiceProperties() == null ? null : this.innerTableServiceProperties().cors(); - } - - /** - * Set the cors property: Specifies CORS rules for the Table service. You can include up to five CorsRule elements - * in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and - * CORS will be disabled for the Table service. - * - * @param cors the cors value to set. - * @return the TableServicePropertiesInner object itself. - */ - public TableServicePropertiesInner withCors(CorsRules cors) { - if (this.innerTableServiceProperties() == null) { - this.innerTableServiceProperties = new TableServicePropertiesProperties(); - } - this.innerTableServiceProperties().withCors(cors); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerTableServiceProperties() != null) { - innerTableServiceProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/TableServicePropertiesProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/TableServicePropertiesProperties.java deleted file mode 100644 index 72c650f676a0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/TableServicePropertiesProperties.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.storage.models.CorsRules; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The properties of a storage account’s Table service. */ -@Fluent -public final class TableServicePropertiesProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TableServicePropertiesProperties.class); - - /* - * Specifies CORS rules for the Table service. You can include up to five - * CorsRule elements in the request. If no CorsRule elements are included - * in the request body, all CORS rules will be deleted, and CORS will be - * disabled for the Table service. - */ - @JsonProperty(value = "cors") - private CorsRules cors; - - /** - * Get the cors property: Specifies CORS rules for the Table service. You can include up to five CorsRule elements - * in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and - * CORS will be disabled for the Table service. - * - * @return the cors value. - */ - public CorsRules cors() { - return this.cors; - } - - /** - * Set the cors property: Specifies CORS rules for the Table service. You can include up to five CorsRule elements - * in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and - * CORS will be disabled for the Table service. - * - * @param cors the cors value to set. - * @return the TableServicePropertiesProperties object itself. - */ - public TableServicePropertiesProperties withCors(CorsRules cors) { - this.cors = cors; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (cors() != null) { - cors().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/UsageInner.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/UsageInner.java deleted file mode 100644 index f5ee2dbfe694..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/UsageInner.java +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.storage.models.UsageName; -import com.azure.resourcemanager.storage.models.UsageUnit; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describes Storage Resource Usage. */ -@Immutable -public final class UsageInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(UsageInner.class); - - /* - * Gets the unit of measurement. - */ - @JsonProperty(value = "unit", access = JsonProperty.Access.WRITE_ONLY) - private UsageUnit unit; - - /* - * Gets the current count of the allocated resources in the subscription. - */ - @JsonProperty(value = "currentValue", access = JsonProperty.Access.WRITE_ONLY) - private Integer currentValue; - - /* - * Gets the maximum count of the resources that can be allocated in the - * subscription. - */ - @JsonProperty(value = "limit", access = JsonProperty.Access.WRITE_ONLY) - private Integer limit; - - /* - * Gets the name of the type of usage. - */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) - private UsageName name; - - /** - * Get the unit property: Gets the unit of measurement. - * - * @return the unit value. - */ - public UsageUnit unit() { - return this.unit; - } - - /** - * Get the currentValue property: Gets the current count of the allocated resources in the subscription. - * - * @return the currentValue value. - */ - public Integer currentValue() { - return this.currentValue; - } - - /** - * Get the limit property: Gets the maximum count of the resources that can be allocated in the subscription. - * - * @return the limit value. - */ - public Integer limit() { - return this.limit; - } - - /** - * Get the name property: Gets the name of the type of usage. - * - * @return the name value. - */ - public UsageName name() { - return this.name; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() != null) { - name().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/package-info.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/package-info.java deleted file mode 100644 index ecf671fa190f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** Package containing the inner data models for StorageManagementClient. The Azure Storage Management API. */ -package com.azure.resourcemanager.storage.fluent.models; diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/package-info.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/package-info.java deleted file mode 100644 index b6c644b75609..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** Package containing the service clients for StorageManagementClient. The Azure Storage Management API. */ -package com.azure.resourcemanager.storage.fluent; diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/BlobContainerImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/BlobContainerImpl.java deleted file mode 100644 index 9d26bb8f4c9a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/BlobContainerImpl.java +++ /dev/null @@ -1,213 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.storage.implementation; - -import com.azure.resourcemanager.resources.fluentcore.model.implementation.CreatableUpdatableImpl; -import com.azure.resourcemanager.storage.StorageManager; -import com.azure.resourcemanager.storage.fluent.BlobContainersClient; -import com.azure.resourcemanager.storage.models.BlobContainer; -import com.azure.resourcemanager.storage.models.ImmutabilityPolicyProperties; -import com.azure.resourcemanager.storage.models.LeaseDuration; -import com.azure.resourcemanager.storage.models.LeaseState; -import com.azure.resourcemanager.storage.models.LeaseStatus; -import com.azure.resourcemanager.storage.models.LegalHoldProperties; -import com.azure.resourcemanager.storage.models.PublicAccess; -import com.azure.resourcemanager.storage.fluent.models.BlobContainerInner; - -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; - -import com.azure.resourcemanager.storage.models.StorageAccount; -import reactor.core.publisher.Mono; - -class BlobContainerImpl extends CreatableUpdatableImpl - implements BlobContainer, BlobContainer.Definition, BlobContainer.Update { - private final StorageManager manager; - private String resourceGroupName; - private String accountName; - private String containerName; - private PublicAccess cpublicAccess; - private Map cmetadata; - private PublicAccess upublicAccess; - private Map umetadata; - - BlobContainerImpl(String name, StorageManager manager) { - super(name, new BlobContainerInner()); - this.manager = manager; - // Set resource name - this.containerName = name; - // - } - - BlobContainerImpl(BlobContainerInner inner, StorageManager manager) { - super(inner.name(), inner); - this.manager = manager; - // Set resource name - this.containerName = inner.name(); - // set resource ancestor and positional variables - this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); - this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "storageAccounts"); - this.containerName = IdParsingUtils.getValueFromIdByName(inner.id(), "containers"); - // - } - - @Override - public StorageManager manager() { - return this.manager; - } - - @Override - public Mono createResourceAsync() { - BlobContainersClient client = this.manager().serviceClient().getBlobContainers(); - return client - .createAsync(this.resourceGroupName, this.accountName, this.containerName, - this.innerModel().withPublicAccess(cpublicAccess).withMetadata(cmetadata)) - .map(innerToFluentMap(this)); - } - - @Override - public Mono updateResourceAsync() { - BlobContainersClient client = this.manager().serviceClient().getBlobContainers(); - return client - .updateAsync(this.resourceGroupName, this.accountName, this.containerName, - this.innerModel().withPublicAccess(upublicAccess).withMetadata(umetadata)) - .map(innerToFluentMap(this)); - } - - @Override - protected Mono getInnerAsync() { - return this.manager().serviceClient().getBlobContainers().getAsync(resourceGroupName, accountName, containerName); - } - - @Override - public boolean isInCreateMode() { - return this.innerModel().id() == null; - } - - @Override - public String etag() { - return this.innerModel().etag(); - } - - @Override - public Boolean hasImmutabilityPolicy() { - return this.innerModel().hasImmutabilityPolicy(); - } - - @Override - public Boolean hasLegalHold() { - return this.innerModel().hasLegalHold(); - } - - @Override - public String id() { - return this.innerModel().id(); - } - - @Override - public ImmutabilityPolicyProperties immutabilityPolicy() { - return this.innerModel().immutabilityPolicy(); - } - - @Override - public OffsetDateTime lastModifiedTime() { - return this.innerModel().lastModifiedTime(); - } - - @Override - public LeaseDuration leaseDuration() { - return this.innerModel().leaseDuration(); - } - - @Override - public LeaseState leaseState() { - return this.innerModel().leaseState(); - } - - @Override - public LeaseStatus leaseStatus() { - return this.innerModel().leaseStatus(); - } - - @Override - public LegalHoldProperties legalHold() { - return this.innerModel().legalHold(); - } - - @Override - public Map metadata() { - return this.innerModel().metadata(); - } - - @Override - public String name() { - return this.innerModel().name(); - } - - @Override - public PublicAccess publicAccess() { - return this.innerModel().publicAccess(); - } - - @Override - public String type() { - return this.innerModel().type(); - } - - @Override - public BlobContainerImpl withExistingBlobService(String resourceGroupName, String accountName) { - this.withExistingStorageAccount(resourceGroupName, accountName); - return this; - } - - @Override - public DefinitionStages.WithPublicAccess withExistingStorageAccount(String resourceGroupName, String accountName) { - this.resourceGroupName = resourceGroupName; - this.accountName = accountName; - return this; - } - - @Override - public DefinitionStages.WithPublicAccess withExistingStorageAccount(StorageAccount storageAccount) { - this.withExistingStorageAccount(storageAccount.resourceGroupName(), storageAccount.name()); - return this; - } - - @Override - public BlobContainerImpl withPublicAccess(PublicAccess publicAccess) { - if (isInCreateMode()) { - this.cpublicAccess = publicAccess; - } else { - this.upublicAccess = publicAccess; - } - return this; - } - - @Override - public BlobContainerImpl withMetadata(Map metadata) { - if (isInCreateMode()) { - this.cmetadata = metadata; - } else { - this.umetadata = metadata; - } - return this; - } - - @Override - public BlobContainerImpl withMetadata(String name, String value) { - if (isInCreateMode()) { - if (this.cmetadata == null) { - this.cmetadata = new HashMap<>(); - } - this.cmetadata.put(name, value); - } else { - if (this.umetadata == null) { - this.umetadata = new HashMap<>(); - } - this.umetadata.put(name, value); - } - return this; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/BlobContainersClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/BlobContainersClientImpl.java deleted file mode 100644 index 897ed6c93eef..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/BlobContainersClientImpl.java +++ /dev/null @@ -1,3320 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.storage.fluent.BlobContainersClient; -import com.azure.resourcemanager.storage.fluent.models.BlobContainerInner; -import com.azure.resourcemanager.storage.fluent.models.ImmutabilityPolicyInner; -import com.azure.resourcemanager.storage.fluent.models.LeaseContainerResponseInner; -import com.azure.resourcemanager.storage.fluent.models.LegalHoldInner; -import com.azure.resourcemanager.storage.fluent.models.ListContainerItemInner; -import com.azure.resourcemanager.storage.models.BlobContainersCreateOrUpdateImmutabilityPolicyResponse; -import com.azure.resourcemanager.storage.models.BlobContainersDeleteImmutabilityPolicyResponse; -import com.azure.resourcemanager.storage.models.BlobContainersExtendImmutabilityPolicyResponse; -import com.azure.resourcemanager.storage.models.BlobContainersGetImmutabilityPolicyResponse; -import com.azure.resourcemanager.storage.models.BlobContainersLockImmutabilityPolicyResponse; -import com.azure.resourcemanager.storage.models.LeaseContainerRequest; -import com.azure.resourcemanager.storage.models.ListContainerItems; -import com.azure.resourcemanager.storage.models.ListContainersInclude; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in BlobContainersClient. */ -public final class BlobContainersClientImpl implements BlobContainersClient { - private final ClientLogger logger = new ClientLogger(BlobContainersClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final BlobContainersService service; - - /** The service client containing this operation class. */ - private final StorageManagementClientImpl client; - - /** - * Initializes an instance of BlobContainersClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - BlobContainersClientImpl(StorageManagementClientImpl client) { - this.service = - RestProxy.create(BlobContainersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for StorageManagementClientBlobContainers to be used by the proxy service - * to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "StorageManagementCli") - private interface BlobContainersService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" - + "/storageAccounts/{accountName}/blobServices/default/containers") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("$maxpagesize") String maxpagesize, - @QueryParam("$filter") String filter, - @QueryParam("$include") ListContainersInclude include, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" - + "/storageAccounts/{accountName}/blobServices/default/containers/{containerName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> create( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("accountName") String accountName, - @PathParam("containerName") String containerName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") BlobContainerInner blobContainer, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" - + "/storageAccounts/{accountName}/blobServices/default/containers/{containerName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("accountName") String accountName, - @PathParam("containerName") String containerName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") BlobContainerInner blobContainer, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" - + "/storageAccounts/{accountName}/blobServices/default/containers/{containerName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("accountName") String accountName, - @PathParam("containerName") String containerName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" - + "/storageAccounts/{accountName}/blobServices/default/containers/{containerName}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("accountName") String accountName, - @PathParam("containerName") String containerName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" - + "/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/setLegalHold") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> setLegalHold( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("accountName") String accountName, - @PathParam("containerName") String containerName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") LegalHoldInner legalHold, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" - + "/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/clearLegalHold") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> clearLegalHold( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("accountName") String accountName, - @PathParam("containerName") String containerName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") LegalHoldInner legalHold, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" - + "/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies" - + "/{immutabilityPolicyName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono createOrUpdateImmutabilityPolicy( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("accountName") String accountName, - @PathParam("containerName") String containerName, - @PathParam("immutabilityPolicyName") String immutabilityPolicyName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("If-Match") String ifMatch, - @BodyParam("application/json") ImmutabilityPolicyInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" - + "/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies" - + "/{immutabilityPolicyName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono getImmutabilityPolicy( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("accountName") String accountName, - @PathParam("containerName") String containerName, - @PathParam("immutabilityPolicyName") String immutabilityPolicyName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("If-Match") String ifMatch, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" - + "/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies" - + "/{immutabilityPolicyName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono deleteImmutabilityPolicy( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("accountName") String accountName, - @PathParam("containerName") String containerName, - @PathParam("immutabilityPolicyName") String immutabilityPolicyName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("If-Match") String ifMatch, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" - + "/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies" - + "/default/lock") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono lockImmutabilityPolicy( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("accountName") String accountName, - @PathParam("containerName") String containerName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("If-Match") String ifMatch, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" - + "/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies" - + "/default/extend") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono extendImmutabilityPolicy( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("accountName") String accountName, - @PathParam("containerName") String containerName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("If-Match") String ifMatch, - @BodyParam("application/json") ImmutabilityPolicyInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" - + "/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/lease") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> lease( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("accountName") String accountName, - @PathParam("containerName") String containerName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") LeaseContainerRequest parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation - * token. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param maxpagesize Optional. Specified maximum number of containers that can be included in the list. - * @param filter Optional. When specified, only container names starting with the filter will be listed. - * @param include Optional, used to include the properties for soft deleted blob containers. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response schema. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, - String accountName, - String maxpagesize, - String filter, - ListContainersInclude include) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - maxpagesize, - filter, - include, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation - * token. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param maxpagesize Optional. Specified maximum number of containers that can be included in the list. - * @param filter Optional. When specified, only container names starting with the filter will be listed. - * @param include Optional, used to include the properties for soft deleted blob containers. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response schema. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, - String accountName, - String maxpagesize, - String filter, - ListContainersInclude include, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - maxpagesize, - filter, - include, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation - * token. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param maxpagesize Optional. Specified maximum number of containers that can be included in the list. - * @param filter Optional. When specified, only container names starting with the filter will be listed. - * @param include Optional, used to include the properties for soft deleted blob containers. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response schema. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync( - String resourceGroupName, - String accountName, - String maxpagesize, - String filter, - ListContainersInclude include) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, accountName, maxpagesize, filter, include), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation - * token. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response schema. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String resourceGroupName, String accountName) { - final String maxpagesize = null; - final String filter = null; - final ListContainersInclude include = null; - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, accountName, maxpagesize, filter, include), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation - * token. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param maxpagesize Optional. Specified maximum number of containers that can be included in the list. - * @param filter Optional. When specified, only container names starting with the filter will be listed. - * @param include Optional, used to include the properties for soft deleted blob containers. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response schema. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, - String accountName, - String maxpagesize, - String filter, - ListContainersInclude include, - Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, accountName, maxpagesize, filter, include, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation - * token. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response schema. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String accountName) { - final String maxpagesize = null; - final String filter = null; - final ListContainersInclude include = null; - return new PagedIterable<>(listAsync(resourceGroupName, accountName, maxpagesize, filter, include)); - } - - /** - * Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation - * token. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param maxpagesize Optional. Specified maximum number of containers that can be included in the list. - * @param filter Optional. When specified, only container names starting with the filter will be listed. - * @param include Optional, used to include the properties for soft deleted blob containers. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response schema. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, - String accountName, - String maxpagesize, - String filter, - ListContainersInclude include, - Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, accountName, maxpagesize, filter, include, context)); - } - - /** - * Creates a new container under the specified account as described by request body. The container resource includes - * metadata and properties for that container. It does not include a list of the blobs contained by the container. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param blobContainer Properties of the blob container to create. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of the blob container, including Id, resource name, resource type, Etag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createWithResponseAsync( - String resourceGroupName, String accountName, String containerName, BlobContainerInner blobContainer) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (containerName == null) { - return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (blobContainer == null) { - return Mono.error(new IllegalArgumentException("Parameter blobContainer is required and cannot be null.")); - } else { - blobContainer.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .create( - this.client.getEndpoint(), - resourceGroupName, - accountName, - containerName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - blobContainer, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates a new container under the specified account as described by request body. The container resource includes - * metadata and properties for that container. It does not include a list of the blobs contained by the container. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param blobContainer Properties of the blob container to create. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of the blob container, including Id, resource name, resource type, Etag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync( - String resourceGroupName, - String accountName, - String containerName, - BlobContainerInner blobContainer, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (containerName == null) { - return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (blobContainer == null) { - return Mono.error(new IllegalArgumentException("Parameter blobContainer is required and cannot be null.")); - } else { - blobContainer.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .create( - this.client.getEndpoint(), - resourceGroupName, - accountName, - containerName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - blobContainer, - accept, - context); - } - - /** - * Creates a new container under the specified account as described by request body. The container resource includes - * metadata and properties for that container. It does not include a list of the blobs contained by the container. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param blobContainer Properties of the blob container to create. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of the blob container, including Id, resource name, resource type, Etag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createAsync( - String resourceGroupName, String accountName, String containerName, BlobContainerInner blobContainer) { - return createWithResponseAsync(resourceGroupName, accountName, containerName, blobContainer) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates a new container under the specified account as described by request body. The container resource includes - * metadata and properties for that container. It does not include a list of the blobs contained by the container. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param blobContainer Properties of the blob container to create. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of the blob container, including Id, resource name, resource type, Etag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BlobContainerInner create( - String resourceGroupName, String accountName, String containerName, BlobContainerInner blobContainer) { - return createAsync(resourceGroupName, accountName, containerName, blobContainer).block(); - } - - /** - * Creates a new container under the specified account as described by request body. The container resource includes - * metadata and properties for that container. It does not include a list of the blobs contained by the container. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param blobContainer Properties of the blob container to create. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of the blob container, including Id, resource name, resource type, Etag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse( - String resourceGroupName, - String accountName, - String containerName, - BlobContainerInner blobContainer, - Context context) { - return createWithResponseAsync(resourceGroupName, accountName, containerName, blobContainer, context).block(); - } - - /** - * Updates container properties as specified in request body. Properties not mentioned in the request will be - * unchanged. Update fails if the specified container doesn't already exist. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param blobContainer Properties to update for the blob container. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of the blob container, including Id, resource name, resource type, Etag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateWithResponseAsync( - String resourceGroupName, String accountName, String containerName, BlobContainerInner blobContainer) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (containerName == null) { - return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (blobContainer == null) { - return Mono.error(new IllegalArgumentException("Parameter blobContainer is required and cannot be null.")); - } else { - blobContainer.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - resourceGroupName, - accountName, - containerName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - blobContainer, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates container properties as specified in request body. Properties not mentioned in the request will be - * unchanged. Update fails if the specified container doesn't already exist. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param blobContainer Properties to update for the blob container. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of the blob container, including Id, resource name, resource type, Etag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, - String accountName, - String containerName, - BlobContainerInner blobContainer, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (containerName == null) { - return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (blobContainer == null) { - return Mono.error(new IllegalArgumentException("Parameter blobContainer is required and cannot be null.")); - } else { - blobContainer.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - resourceGroupName, - accountName, - containerName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - blobContainer, - accept, - context); - } - - /** - * Updates container properties as specified in request body. Properties not mentioned in the request will be - * unchanged. Update fails if the specified container doesn't already exist. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param blobContainer Properties to update for the blob container. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of the blob container, including Id, resource name, resource type, Etag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync( - String resourceGroupName, String accountName, String containerName, BlobContainerInner blobContainer) { - return updateWithResponseAsync(resourceGroupName, accountName, containerName, blobContainer) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Updates container properties as specified in request body. Properties not mentioned in the request will be - * unchanged. Update fails if the specified container doesn't already exist. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param blobContainer Properties to update for the blob container. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of the blob container, including Id, resource name, resource type, Etag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BlobContainerInner update( - String resourceGroupName, String accountName, String containerName, BlobContainerInner blobContainer) { - return updateAsync(resourceGroupName, accountName, containerName, blobContainer).block(); - } - - /** - * Updates container properties as specified in request body. Properties not mentioned in the request will be - * unchanged. Update fails if the specified container doesn't already exist. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param blobContainer Properties to update for the blob container. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of the blob container, including Id, resource name, resource type, Etag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, - String accountName, - String containerName, - BlobContainerInner blobContainer, - Context context) { - return updateWithResponseAsync(resourceGroupName, accountName, containerName, blobContainer, context).block(); - } - - /** - * Gets properties of a specified container. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of a specified container. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String resourceGroupName, String accountName, String containerName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (containerName == null) { - return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - resourceGroupName, - accountName, - containerName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets properties of a specified container. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of a specified container. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String accountName, String containerName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (containerName == null) { - return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - resourceGroupName, - accountName, - containerName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets properties of a specified container. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of a specified container. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync(String resourceGroupName, String accountName, String containerName) { - return getWithResponseAsync(resourceGroupName, accountName, containerName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets properties of a specified container. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of a specified container. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BlobContainerInner get(String resourceGroupName, String accountName, String containerName) { - return getAsync(resourceGroupName, accountName, containerName).block(); - } - - /** - * Gets properties of a specified container. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of a specified container. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String accountName, String containerName, Context context) { - return getWithResponseAsync(resourceGroupName, accountName, containerName, context).block(); - } - - /** - * Deletes specified container under its account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync( - String resourceGroupName, String accountName, String containerName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (containerName == null) { - return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - accountName, - containerName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes specified container under its account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String accountName, String containerName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (containerName == null) { - return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - accountName, - containerName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - context); - } - - /** - * Deletes specified container under its account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String accountName, String containerName) { - return deleteWithResponseAsync(resourceGroupName, accountName, containerName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes specified container under its account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String accountName, String containerName) { - deleteAsync(resourceGroupName, accountName, containerName).block(); - } - - /** - * Deletes specified container under its account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse( - String resourceGroupName, String accountName, String containerName, Context context) { - return deleteWithResponseAsync(resourceGroupName, accountName, containerName, context).block(); - } - - /** - * Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold follows an append - * pattern and does not clear out the existing tags that are not specified in the request. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param legalHold The LegalHold property that will be set to a blob container. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the LegalHold property of a blob container. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> setLegalHoldWithResponseAsync( - String resourceGroupName, String accountName, String containerName, LegalHoldInner legalHold) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (containerName == null) { - return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (legalHold == null) { - return Mono.error(new IllegalArgumentException("Parameter legalHold is required and cannot be null.")); - } else { - legalHold.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .setLegalHold( - this.client.getEndpoint(), - resourceGroupName, - accountName, - containerName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - legalHold, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold follows an append - * pattern and does not clear out the existing tags that are not specified in the request. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param legalHold The LegalHold property that will be set to a blob container. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the LegalHold property of a blob container. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> setLegalHoldWithResponseAsync( - String resourceGroupName, String accountName, String containerName, LegalHoldInner legalHold, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (containerName == null) { - return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (legalHold == null) { - return Mono.error(new IllegalArgumentException("Parameter legalHold is required and cannot be null.")); - } else { - legalHold.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .setLegalHold( - this.client.getEndpoint(), - resourceGroupName, - accountName, - containerName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - legalHold, - accept, - context); - } - - /** - * Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold follows an append - * pattern and does not clear out the existing tags that are not specified in the request. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param legalHold The LegalHold property that will be set to a blob container. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the LegalHold property of a blob container. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono setLegalHoldAsync( - String resourceGroupName, String accountName, String containerName, LegalHoldInner legalHold) { - return setLegalHoldWithResponseAsync(resourceGroupName, accountName, containerName, legalHold) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold follows an append - * pattern and does not clear out the existing tags that are not specified in the request. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param legalHold The LegalHold property that will be set to a blob container. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the LegalHold property of a blob container. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public LegalHoldInner setLegalHold( - String resourceGroupName, String accountName, String containerName, LegalHoldInner legalHold) { - return setLegalHoldAsync(resourceGroupName, accountName, containerName, legalHold).block(); - } - - /** - * Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold follows an append - * pattern and does not clear out the existing tags that are not specified in the request. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param legalHold The LegalHold property that will be set to a blob container. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the LegalHold property of a blob container. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response setLegalHoldWithResponse( - String resourceGroupName, String accountName, String containerName, LegalHoldInner legalHold, Context context) { - return setLegalHoldWithResponseAsync(resourceGroupName, accountName, containerName, legalHold, context).block(); - } - - /** - * Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation. ClearLegalHold - * clears out only the specified tags in the request. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param legalHold The LegalHold property that will be clear from a blob container. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the LegalHold property of a blob container. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> clearLegalHoldWithResponseAsync( - String resourceGroupName, String accountName, String containerName, LegalHoldInner legalHold) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (containerName == null) { - return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (legalHold == null) { - return Mono.error(new IllegalArgumentException("Parameter legalHold is required and cannot be null.")); - } else { - legalHold.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .clearLegalHold( - this.client.getEndpoint(), - resourceGroupName, - accountName, - containerName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - legalHold, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation. ClearLegalHold - * clears out only the specified tags in the request. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param legalHold The LegalHold property that will be clear from a blob container. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the LegalHold property of a blob container. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> clearLegalHoldWithResponseAsync( - String resourceGroupName, String accountName, String containerName, LegalHoldInner legalHold, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (containerName == null) { - return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (legalHold == null) { - return Mono.error(new IllegalArgumentException("Parameter legalHold is required and cannot be null.")); - } else { - legalHold.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .clearLegalHold( - this.client.getEndpoint(), - resourceGroupName, - accountName, - containerName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - legalHold, - accept, - context); - } - - /** - * Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation. ClearLegalHold - * clears out only the specified tags in the request. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param legalHold The LegalHold property that will be clear from a blob container. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the LegalHold property of a blob container. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono clearLegalHoldAsync( - String resourceGroupName, String accountName, String containerName, LegalHoldInner legalHold) { - return clearLegalHoldWithResponseAsync(resourceGroupName, accountName, containerName, legalHold) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation. ClearLegalHold - * clears out only the specified tags in the request. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param legalHold The LegalHold property that will be clear from a blob container. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the LegalHold property of a blob container. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public LegalHoldInner clearLegalHold( - String resourceGroupName, String accountName, String containerName, LegalHoldInner legalHold) { - return clearLegalHoldAsync(resourceGroupName, accountName, containerName, legalHold).block(); - } - - /** - * Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation. ClearLegalHold - * clears out only the specified tags in the request. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param legalHold The LegalHold property that will be clear from a blob container. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the LegalHold property of a blob container. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response clearLegalHoldWithResponse( - String resourceGroupName, String accountName, String containerName, LegalHoldInner legalHold, Context context) { - return clearLegalHoldWithResponseAsync(resourceGroupName, accountName, containerName, legalHold, context) - .block(); - } - - /** - * Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not required for - * this operation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always - * be applied. - * @param parameters The ImmutabilityPolicy Properties that will be created or updated to a blob container. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono - createOrUpdateImmutabilityPolicyWithResponseAsync( - String resourceGroupName, - String accountName, - String containerName, - String ifMatch, - ImmutabilityPolicyInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (containerName == null) { - return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters != null) { - parameters.validate(); - } - final String immutabilityPolicyName = "default"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdateImmutabilityPolicy( - this.client.getEndpoint(), - resourceGroupName, - accountName, - containerName, - immutabilityPolicyName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - ifMatch, - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not required for - * this operation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always - * be applied. - * @param parameters The ImmutabilityPolicy Properties that will be created or updated to a blob container. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono - createOrUpdateImmutabilityPolicyWithResponseAsync( - String resourceGroupName, - String accountName, - String containerName, - String ifMatch, - ImmutabilityPolicyInner parameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (containerName == null) { - return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters != null) { - parameters.validate(); - } - final String immutabilityPolicyName = "default"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdateImmutabilityPolicy( - this.client.getEndpoint(), - resourceGroupName, - accountName, - containerName, - immutabilityPolicyName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - ifMatch, - parameters, - accept, - context); - } - - /** - * Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not required for - * this operation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always - * be applied. - * @param parameters The ImmutabilityPolicy Properties that will be created or updated to a blob container. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateImmutabilityPolicyAsync( - String resourceGroupName, - String accountName, - String containerName, - String ifMatch, - ImmutabilityPolicyInner parameters) { - return createOrUpdateImmutabilityPolicyWithResponseAsync( - resourceGroupName, accountName, containerName, ifMatch, parameters) - .flatMap( - (BlobContainersCreateOrUpdateImmutabilityPolicyResponse res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not required for - * this operation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateImmutabilityPolicyAsync( - String resourceGroupName, String accountName, String containerName) { - final String ifMatch = null; - final ImmutabilityPolicyInner parameters = null; - return createOrUpdateImmutabilityPolicyWithResponseAsync( - resourceGroupName, accountName, containerName, ifMatch, parameters) - .flatMap( - (BlobContainersCreateOrUpdateImmutabilityPolicyResponse res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not required for - * this operation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ImmutabilityPolicyInner createOrUpdateImmutabilityPolicy( - String resourceGroupName, String accountName, String containerName) { - final String ifMatch = null; - final ImmutabilityPolicyInner parameters = null; - return createOrUpdateImmutabilityPolicyAsync(resourceGroupName, accountName, containerName, ifMatch, parameters) - .block(); - } - - /** - * Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not required for - * this operation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always - * be applied. - * @param parameters The ImmutabilityPolicy Properties that will be created or updated to a blob container. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BlobContainersCreateOrUpdateImmutabilityPolicyResponse createOrUpdateImmutabilityPolicyWithResponse( - String resourceGroupName, - String accountName, - String containerName, - String ifMatch, - ImmutabilityPolicyInner parameters, - Context context) { - return createOrUpdateImmutabilityPolicyWithResponseAsync( - resourceGroupName, accountName, containerName, ifMatch, parameters, context) - .block(); - } - - /** - * Gets the existing immutability policy along with the corresponding ETag in response headers and body. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always - * be applied. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the existing immutability policy along with the corresponding ETag in response headers and body. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getImmutabilityPolicyWithResponseAsync( - String resourceGroupName, String accountName, String containerName, String ifMatch) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (containerName == null) { - return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String immutabilityPolicyName = "default"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getImmutabilityPolicy( - this.client.getEndpoint(), - resourceGroupName, - accountName, - containerName, - immutabilityPolicyName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - ifMatch, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the existing immutability policy along with the corresponding ETag in response headers and body. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always - * be applied. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the existing immutability policy along with the corresponding ETag in response headers and body. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getImmutabilityPolicyWithResponseAsync( - String resourceGroupName, String accountName, String containerName, String ifMatch, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (containerName == null) { - return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String immutabilityPolicyName = "default"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getImmutabilityPolicy( - this.client.getEndpoint(), - resourceGroupName, - accountName, - containerName, - immutabilityPolicyName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - ifMatch, - accept, - context); - } - - /** - * Gets the existing immutability policy along with the corresponding ETag in response headers and body. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always - * be applied. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the existing immutability policy along with the corresponding ETag in response headers and body. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getImmutabilityPolicyAsync( - String resourceGroupName, String accountName, String containerName, String ifMatch) { - return getImmutabilityPolicyWithResponseAsync(resourceGroupName, accountName, containerName, ifMatch) - .flatMap( - (BlobContainersGetImmutabilityPolicyResponse res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the existing immutability policy along with the corresponding ETag in response headers and body. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the existing immutability policy along with the corresponding ETag in response headers and body. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getImmutabilityPolicyAsync( - String resourceGroupName, String accountName, String containerName) { - final String ifMatch = null; - return getImmutabilityPolicyWithResponseAsync(resourceGroupName, accountName, containerName, ifMatch) - .flatMap( - (BlobContainersGetImmutabilityPolicyResponse res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the existing immutability policy along with the corresponding ETag in response headers and body. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the existing immutability policy along with the corresponding ETag in response headers and body. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ImmutabilityPolicyInner getImmutabilityPolicy( - String resourceGroupName, String accountName, String containerName) { - final String ifMatch = null; - return getImmutabilityPolicyAsync(resourceGroupName, accountName, containerName, ifMatch).block(); - } - - /** - * Gets the existing immutability policy along with the corresponding ETag in response headers and body. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always - * be applied. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the existing immutability policy along with the corresponding ETag in response headers and body. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BlobContainersGetImmutabilityPolicyResponse getImmutabilityPolicyWithResponse( - String resourceGroupName, String accountName, String containerName, String ifMatch, Context context) { - return getImmutabilityPolicyWithResponseAsync(resourceGroupName, accountName, containerName, ifMatch, context) - .block(); - } - - /** - * Aborts an unlocked immutability policy. The response of delete has immutabilityPeriodSinceCreationInDays set to - * 0. ETag in If-Match is required for this operation. Deleting a locked immutability policy is not allowed, the - * only way is to delete the container after deleting all expired blobs inside the policy locked container. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always - * be applied. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteImmutabilityPolicyWithResponseAsync( - String resourceGroupName, String accountName, String containerName, String ifMatch) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (containerName == null) { - return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ifMatch == null) { - return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); - } - final String immutabilityPolicyName = "default"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .deleteImmutabilityPolicy( - this.client.getEndpoint(), - resourceGroupName, - accountName, - containerName, - immutabilityPolicyName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - ifMatch, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Aborts an unlocked immutability policy. The response of delete has immutabilityPeriodSinceCreationInDays set to - * 0. ETag in If-Match is required for this operation. Deleting a locked immutability policy is not allowed, the - * only way is to delete the container after deleting all expired blobs inside the policy locked container. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always - * be applied. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteImmutabilityPolicyWithResponseAsync( - String resourceGroupName, String accountName, String containerName, String ifMatch, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (containerName == null) { - return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ifMatch == null) { - return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); - } - final String immutabilityPolicyName = "default"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .deleteImmutabilityPolicy( - this.client.getEndpoint(), - resourceGroupName, - accountName, - containerName, - immutabilityPolicyName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - ifMatch, - accept, - context); - } - - /** - * Aborts an unlocked immutability policy. The response of delete has immutabilityPeriodSinceCreationInDays set to - * 0. ETag in If-Match is required for this operation. Deleting a locked immutability policy is not allowed, the - * only way is to delete the container after deleting all expired blobs inside the policy locked container. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always - * be applied. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteImmutabilityPolicyAsync( - String resourceGroupName, String accountName, String containerName, String ifMatch) { - return deleteImmutabilityPolicyWithResponseAsync(resourceGroupName, accountName, containerName, ifMatch) - .flatMap( - (BlobContainersDeleteImmutabilityPolicyResponse res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Aborts an unlocked immutability policy. The response of delete has immutabilityPeriodSinceCreationInDays set to - * 0. ETag in If-Match is required for this operation. Deleting a locked immutability policy is not allowed, the - * only way is to delete the container after deleting all expired blobs inside the policy locked container. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always - * be applied. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ImmutabilityPolicyInner deleteImmutabilityPolicy( - String resourceGroupName, String accountName, String containerName, String ifMatch) { - return deleteImmutabilityPolicyAsync(resourceGroupName, accountName, containerName, ifMatch).block(); - } - - /** - * Aborts an unlocked immutability policy. The response of delete has immutabilityPeriodSinceCreationInDays set to - * 0. ETag in If-Match is required for this operation. Deleting a locked immutability policy is not allowed, the - * only way is to delete the container after deleting all expired blobs inside the policy locked container. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always - * be applied. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BlobContainersDeleteImmutabilityPolicyResponse deleteImmutabilityPolicyWithResponse( - String resourceGroupName, String accountName, String containerName, String ifMatch, Context context) { - return deleteImmutabilityPolicyWithResponseAsync( - resourceGroupName, accountName, containerName, ifMatch, context) - .block(); - } - - /** - * Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is - * ExtendImmutabilityPolicy action. ETag in If-Match is required for this operation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always - * be applied. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono lockImmutabilityPolicyWithResponseAsync( - String resourceGroupName, String accountName, String containerName, String ifMatch) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (containerName == null) { - return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ifMatch == null) { - return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .lockImmutabilityPolicy( - this.client.getEndpoint(), - resourceGroupName, - accountName, - containerName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - ifMatch, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is - * ExtendImmutabilityPolicy action. ETag in If-Match is required for this operation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always - * be applied. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono lockImmutabilityPolicyWithResponseAsync( - String resourceGroupName, String accountName, String containerName, String ifMatch, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (containerName == null) { - return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ifMatch == null) { - return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .lockImmutabilityPolicy( - this.client.getEndpoint(), - resourceGroupName, - accountName, - containerName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - ifMatch, - accept, - context); - } - - /** - * Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is - * ExtendImmutabilityPolicy action. ETag in If-Match is required for this operation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always - * be applied. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono lockImmutabilityPolicyAsync( - String resourceGroupName, String accountName, String containerName, String ifMatch) { - return lockImmutabilityPolicyWithResponseAsync(resourceGroupName, accountName, containerName, ifMatch) - .flatMap( - (BlobContainersLockImmutabilityPolicyResponse res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is - * ExtendImmutabilityPolicy action. ETag in If-Match is required for this operation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always - * be applied. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ImmutabilityPolicyInner lockImmutabilityPolicy( - String resourceGroupName, String accountName, String containerName, String ifMatch) { - return lockImmutabilityPolicyAsync(resourceGroupName, accountName, containerName, ifMatch).block(); - } - - /** - * Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is - * ExtendImmutabilityPolicy action. ETag in If-Match is required for this operation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always - * be applied. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BlobContainersLockImmutabilityPolicyResponse lockImmutabilityPolicyWithResponse( - String resourceGroupName, String accountName, String containerName, String ifMatch, Context context) { - return lockImmutabilityPolicyWithResponseAsync(resourceGroupName, accountName, containerName, ifMatch, context) - .block(); - } - - /** - * Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action allowed on a - * Locked policy will be this action. ETag in If-Match is required for this operation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always - * be applied. - * @param parameters The ImmutabilityPolicy Properties that will be extended for a blob container. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono extendImmutabilityPolicyWithResponseAsync( - String resourceGroupName, - String accountName, - String containerName, - String ifMatch, - ImmutabilityPolicyInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (containerName == null) { - return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ifMatch == null) { - return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); - } - if (parameters != null) { - parameters.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .extendImmutabilityPolicy( - this.client.getEndpoint(), - resourceGroupName, - accountName, - containerName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - ifMatch, - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action allowed on a - * Locked policy will be this action. ETag in If-Match is required for this operation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always - * be applied. - * @param parameters The ImmutabilityPolicy Properties that will be extended for a blob container. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono extendImmutabilityPolicyWithResponseAsync( - String resourceGroupName, - String accountName, - String containerName, - String ifMatch, - ImmutabilityPolicyInner parameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (containerName == null) { - return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ifMatch == null) { - return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); - } - if (parameters != null) { - parameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .extendImmutabilityPolicy( - this.client.getEndpoint(), - resourceGroupName, - accountName, - containerName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - ifMatch, - parameters, - accept, - context); - } - - /** - * Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action allowed on a - * Locked policy will be this action. ETag in If-Match is required for this operation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always - * be applied. - * @param parameters The ImmutabilityPolicy Properties that will be extended for a blob container. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono extendImmutabilityPolicyAsync( - String resourceGroupName, - String accountName, - String containerName, - String ifMatch, - ImmutabilityPolicyInner parameters) { - return extendImmutabilityPolicyWithResponseAsync( - resourceGroupName, accountName, containerName, ifMatch, parameters) - .flatMap( - (BlobContainersExtendImmutabilityPolicyResponse res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action allowed on a - * Locked policy will be this action. ETag in If-Match is required for this operation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always - * be applied. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono extendImmutabilityPolicyAsync( - String resourceGroupName, String accountName, String containerName, String ifMatch) { - final ImmutabilityPolicyInner parameters = null; - return extendImmutabilityPolicyWithResponseAsync( - resourceGroupName, accountName, containerName, ifMatch, parameters) - .flatMap( - (BlobContainersExtendImmutabilityPolicyResponse res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action allowed on a - * Locked policy will be this action. ETag in If-Match is required for this operation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always - * be applied. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ImmutabilityPolicyInner extendImmutabilityPolicy( - String resourceGroupName, String accountName, String containerName, String ifMatch) { - final ImmutabilityPolicyInner parameters = null; - return extendImmutabilityPolicyAsync(resourceGroupName, accountName, containerName, ifMatch, parameters) - .block(); - } - - /** - * Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action allowed on a - * Locked policy will be this action. ETag in If-Match is required for this operation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always - * be applied. - * @param parameters The ImmutabilityPolicy Properties that will be extended for a blob container. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BlobContainersExtendImmutabilityPolicyResponse extendImmutabilityPolicyWithResponse( - String resourceGroupName, - String accountName, - String containerName, - String ifMatch, - ImmutabilityPolicyInner parameters, - Context context) { - return extendImmutabilityPolicyWithResponseAsync( - resourceGroupName, accountName, containerName, ifMatch, parameters, context) - .block(); - } - - /** - * The Lease Container operation establishes and manages a lock on a container for delete operations. The lock - * duration can be 15 to 60 seconds, or can be infinite. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param parameters Lease Container request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lease Container response schema. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> leaseWithResponseAsync( - String resourceGroupName, String accountName, String containerName, LeaseContainerRequest parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (containerName == null) { - return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters != null) { - parameters.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .lease( - this.client.getEndpoint(), - resourceGroupName, - accountName, - containerName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * The Lease Container operation establishes and manages a lock on a container for delete operations. The lock - * duration can be 15 to 60 seconds, or can be infinite. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param parameters Lease Container request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lease Container response schema. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> leaseWithResponseAsync( - String resourceGroupName, - String accountName, - String containerName, - LeaseContainerRequest parameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (containerName == null) { - return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters != null) { - parameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .lease( - this.client.getEndpoint(), - resourceGroupName, - accountName, - containerName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * The Lease Container operation establishes and manages a lock on a container for delete operations. The lock - * duration can be 15 to 60 seconds, or can be infinite. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param parameters Lease Container request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lease Container response schema. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono leaseAsync( - String resourceGroupName, String accountName, String containerName, LeaseContainerRequest parameters) { - return leaseWithResponseAsync(resourceGroupName, accountName, containerName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * The Lease Container operation establishes and manages a lock on a container for delete operations. The lock - * duration can be 15 to 60 seconds, or can be infinite. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lease Container response schema. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono leaseAsync( - String resourceGroupName, String accountName, String containerName) { - final LeaseContainerRequest parameters = null; - return leaseWithResponseAsync(resourceGroupName, accountName, containerName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * The Lease Container operation establishes and manages a lock on a container for delete operations. The lock - * duration can be 15 to 60 seconds, or can be infinite. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lease Container response schema. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public LeaseContainerResponseInner lease(String resourceGroupName, String accountName, String containerName) { - final LeaseContainerRequest parameters = null; - return leaseAsync(resourceGroupName, accountName, containerName, parameters).block(); - } - - /** - * The Lease Container operation establishes and manages a lock on a container for delete operations. The lock - * duration can be 15 to 60 seconds, or can be infinite. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param parameters Lease Container request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lease Container response schema. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response leaseWithResponse( - String resourceGroupName, - String accountName, - String containerName, - LeaseContainerRequest parameters, - Context context) { - return leaseWithResponseAsync(resourceGroupName, accountName, containerName, parameters, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response schema. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response schema. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/BlobContainersImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/BlobContainersImpl.java deleted file mode 100644 index 421b19d0bbb5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/BlobContainersImpl.java +++ /dev/null @@ -1,255 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.storage.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.WrapperImpl; -import com.azure.resourcemanager.storage.StorageManager; -import com.azure.resourcemanager.storage.fluent.BlobContainersClient; -import com.azure.resourcemanager.storage.fluent.models.LegalHoldInner; -import com.azure.resourcemanager.storage.models.BlobContainer; -import com.azure.resourcemanager.storage.models.BlobContainers; -import com.azure.resourcemanager.storage.models.ImmutabilityPolicy; -import com.azure.resourcemanager.storage.models.LegalHold; -import com.azure.resourcemanager.storage.fluent.models.BlobContainerInner; -import com.azure.resourcemanager.storage.fluent.models.ImmutabilityPolicyInner; -import com.azure.resourcemanager.storage.fluent.models.ListContainerItemInner; -import java.util.List; -import reactor.core.publisher.Mono; - -public class BlobContainersImpl extends WrapperImpl implements BlobContainers { - private final StorageManager manager; - - public BlobContainersImpl(StorageManager manager) { - super(manager.serviceClient().getBlobContainers()); - this.manager = manager; - } - - public StorageManager manager() { - return this.manager; - } - - @Override - public BlobContainerImpl defineContainer(String name) { - return wrapContainerModel(name); - } - - @Override - public ImmutabilityPolicyImpl defineImmutabilityPolicy(String name) { - return defineImmutabilityPolicy(); - } - - @Override - public ImmutabilityPolicyImpl defineImmutabilityPolicy() { - return wrapImmutabilityPolicyModel(); - } - - private BlobContainerImpl wrapContainerModel(String name) { - return new BlobContainerImpl(name, this.manager()); - } - - private ImmutabilityPolicyImpl wrapImmutabilityPolicyModel() { - return new ImmutabilityPolicyImpl(this.manager()); - } - - private BlobContainerImpl wrapBlobContainerModel(BlobContainerInner inner) { - return new BlobContainerImpl(inner, manager()); - } - - private ImmutabilityPolicyImpl wrapImmutabilityPolicyModel(ImmutabilityPolicyInner inner) { - return new ImmutabilityPolicyImpl(inner, manager()); - } - - @Override - public PagedFlux listAsync(String resourceGroupName, String accountName) { - BlobContainersClient client = this.innerModel(); - return client.listAsync(resourceGroupName, accountName); - } - - @Override - public Mono getAsync(String resourceGroupName, String accountName, String containerName) { - BlobContainersClient client = this.innerModel(); - return client - .getAsync(resourceGroupName, accountName, containerName) - .map(this::wrapBlobContainerModel); - } - - @Override - public Mono deleteAsync(String resourceGroupName, String accountName, String containerName) { - BlobContainersClient client = this.innerModel(); - return client.deleteAsync(resourceGroupName, accountName, containerName); - } - - @Override - public Mono setLegalHoldAsync( - String resourceGroupName, String accountName, String containerName, List tags) { - BlobContainersClient client = this.innerModel(); - return client - .setLegalHoldAsync(resourceGroupName, accountName, containerName, new LegalHoldInner().withTags(tags)) - .map(legalHoldInner -> new LegalHoldImpl(legalHoldInner, manager())); - } - - @Override - public Mono clearLegalHoldAsync( - String resourceGroupName, String accountName, String containerName, List tags) { - BlobContainersClient client = this.innerModel(); - return client - .clearLegalHoldAsync(resourceGroupName, accountName, containerName, new LegalHoldInner().withTags(tags)) - .map(legalHoldInner -> new LegalHoldImpl(legalHoldInner, manager())); - } - - @Override - public Mono getImmutabilityPolicyAsync( - String resourceGroupName, String accountName, String containerName) { - return getImmutabilityPolicyAsync(resourceGroupName, accountName, containerName, null); - } - - @Override - public Mono getImmutabilityPolicyAsync( - String resourceGroupName, String accountName, String containerName, String eTagValue) { - BlobContainersClient client = this.innerModel(); - return client - .getImmutabilityPolicyAsync(resourceGroupName, accountName, containerName, eTagValue) - .map(this::wrapImmutabilityPolicyModel); - } - - @Override - public Mono deleteImmutabilityPolicyAsync( - String resourceGroupName, String accountName, String containerName) { - return deleteImmutabilityPolicyAsync(resourceGroupName, accountName, containerName, null); - } - - @Override - public Mono deleteImmutabilityPolicyAsync( - String resourceGroupName, String accountName, String containerName, String eTagValue) { - return innerModel().deleteImmutabilityPolicyAsync(resourceGroupName, accountName, containerName, eTagValue) - .then(); - } - - @Override - public Mono lockImmutabilityPolicyAsync( - String resourceGroupName, String accountName, String containerName) { - return lockImmutabilityPolicyAsync(resourceGroupName, accountName, containerName, null); - } - - @Override - public Mono lockImmutabilityPolicyAsync( - String resourceGroupName, String accountName, String containerName, String eTagValue) { - BlobContainersClient client = this.innerModel(); - return client - .lockImmutabilityPolicyAsync(resourceGroupName, accountName, containerName, eTagValue) - .map(inner -> new ImmutabilityPolicyImpl(inner, manager())); - } - - @Override - public Mono extendImmutabilityPolicyAsync( - String resourceGroupName, - String accountName, - String containerName, - int immutabilityPeriodSinceCreationInDays, - Boolean allowProtectedAppendWrites) { - return extendImmutabilityPolicyAsync( - resourceGroupName, - accountName, - containerName, - immutabilityPeriodSinceCreationInDays, - allowProtectedAppendWrites, - null); - } - - @Override - public Mono extendImmutabilityPolicyAsync( - String resourceGroupName, - String accountName, - String containerName, - int immutabilityPeriodSinceCreationInDays, - Boolean allowProtectedAppendWrites, - String eTagValue) { - BlobContainersClient client = this.innerModel(); - return client - .extendImmutabilityPolicyAsync( - resourceGroupName, - accountName, - containerName, - eTagValue, - new ImmutabilityPolicyInner() - .withImmutabilityPeriodSinceCreationInDays(immutabilityPeriodSinceCreationInDays) - .withAllowProtectedAppendWrites(allowProtectedAppendWrites)) - .map(policyInner -> new ImmutabilityPolicyImpl(policyInner, this.manager)); - } - - @Override - public PagedIterable list(String resourceGroupName, String accountName) { - return new PagedIterable<>(this.listAsync(resourceGroupName, accountName)); - } - - @Override - public BlobContainer get(String resourceGroupName, String accountName, String containerName) { - return this.getAsync(resourceGroupName, accountName, containerName).block(); - } - - @Override - public void delete(String resourceGroupName, String accountName, String containerName) { - this.deleteAsync(resourceGroupName, accountName, containerName).block(); - } - - @Override - public LegalHold setLegalHold(String resourceGroupName, String accountName, String containerName, - List tags) { - return this.setLegalHoldAsync(resourceGroupName, accountName, containerName, tags).block(); - } - - @Override - public LegalHold clearLegalHold(String resourceGroupName, String accountName, String containerName, - List tags) { - return this.clearLegalHoldAsync(resourceGroupName, accountName, containerName, tags).block(); - } - - @Override - public ImmutabilityPolicy getImmutabilityPolicy(String resourceGroupName, String accountName, - String containerName) { - return this.getImmutabilityPolicyAsync(resourceGroupName, accountName, containerName).block(); - } - - @Override - public void deleteImmutabilityPolicy(String resourceGroupName, String accountName, - String containerName) { - this.deleteImmutabilityPolicyAsync(resourceGroupName, accountName, containerName).block(); - } - - @Override - public ImmutabilityPolicy lockImmutabilityPolicy(String resourceGroupName, String accountName, - String containerName) { - return this.lockImmutabilityPolicyAsync(resourceGroupName, accountName, containerName).block(); - } - - @Override - public ImmutabilityPolicy extendImmutabilityPolicy(String resourceGroupName, String accountName, - String containerName, int immutabilityPeriodSinceCreationInDays, - Boolean allowProtectedAppendWrites) { - return this.extendImmutabilityPolicyAsync(resourceGroupName, accountName, containerName, - immutabilityPeriodSinceCreationInDays, allowProtectedAppendWrites).block(); - } - - @Override - public void deleteImmutabilityPolicy(String resourceGroupName, String accountName, String containerName, - String eTagValue) { - this.deleteImmutabilityPolicyAsync(resourceGroupName, accountName, containerName, eTagValue).block(); - } - - @Override - public ImmutabilityPolicy lockImmutabilityPolicy(String resourceGroupName, String accountName, String containerName, - String eTagValue) { - return this.lockImmutabilityPolicyAsync(resourceGroupName, accountName, containerName, eTagValue).block(); - } - - @Override - public ImmutabilityPolicy extendImmutabilityPolicy(String resourceGroupName, String accountName, - String containerName, int immutabilityPeriodSinceCreationInDays, - Boolean allowProtectedAppendWrites, String eTagValue) { - return this.extendImmutabilityPolicyAsync(resourceGroupName, accountName, containerName, - immutabilityPeriodSinceCreationInDays, allowProtectedAppendWrites, eTagValue).block(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/BlobInventoryPoliciesClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/BlobInventoryPoliciesClientImpl.java deleted file mode 100644 index bfdc7c5e1b2d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/BlobInventoryPoliciesClientImpl.java +++ /dev/null @@ -1,896 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.storage.fluent.BlobInventoryPoliciesClient; -import com.azure.resourcemanager.storage.fluent.models.BlobInventoryPolicyInner; -import com.azure.resourcemanager.storage.models.BlobInventoryPolicyName; -import com.azure.resourcemanager.storage.models.ListBlobInventoryPolicy; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in BlobInventoryPoliciesClient. */ -public final class BlobInventoryPoliciesClientImpl implements BlobInventoryPoliciesClient { - private final ClientLogger logger = new ClientLogger(BlobInventoryPoliciesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final BlobInventoryPoliciesService service; - - /** The service client containing this operation class. */ - private final StorageManagementClientImpl client; - - /** - * Initializes an instance of BlobInventoryPoliciesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - BlobInventoryPoliciesClientImpl(StorageManagementClientImpl client) { - this.service = - RestProxy - .create(BlobInventoryPoliciesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for StorageManagementClientBlobInventoryPolicies to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "StorageManagementCli") - private interface BlobInventoryPoliciesService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" - + "/storageAccounts/{accountName}/inventoryPolicies/{blobInventoryPolicyName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("blobInventoryPolicyName") BlobInventoryPolicyName blobInventoryPolicyName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" - + "/storageAccounts/{accountName}/inventoryPolicies/{blobInventoryPolicyName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("blobInventoryPolicyName") BlobInventoryPolicyName blobInventoryPolicyName, - @BodyParam("application/json") BlobInventoryPolicyInner properties, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" - + "/storageAccounts/{accountName}/inventoryPolicies/{blobInventoryPolicyName}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("blobInventoryPolicyName") BlobInventoryPolicyName blobInventoryPolicyName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" - + "/storageAccounts/{accountName}/inventoryPolicies") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets the blob inventory policy associated with the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should always be - * 'default'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the blob inventory policy associated with the specified storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String resourceGroupName, String accountName, BlobInventoryPolicyName blobInventoryPolicyName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (blobInventoryPolicyName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter blobInventoryPolicyName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - blobInventoryPolicyName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the blob inventory policy associated with the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should always be - * 'default'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the blob inventory policy associated with the specified storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, - String accountName, - BlobInventoryPolicyName blobInventoryPolicyName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (blobInventoryPolicyName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter blobInventoryPolicyName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - blobInventoryPolicyName, - accept, - context); - } - - /** - * Gets the blob inventory policy associated with the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should always be - * 'default'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the blob inventory policy associated with the specified storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync( - String resourceGroupName, String accountName, BlobInventoryPolicyName blobInventoryPolicyName) { - return getWithResponseAsync(resourceGroupName, accountName, blobInventoryPolicyName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the blob inventory policy associated with the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should always be - * 'default'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the blob inventory policy associated with the specified storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BlobInventoryPolicyInner get( - String resourceGroupName, String accountName, BlobInventoryPolicyName blobInventoryPolicyName) { - return getAsync(resourceGroupName, accountName, blobInventoryPolicyName).block(); - } - - /** - * Gets the blob inventory policy associated with the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should always be - * 'default'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the blob inventory policy associated with the specified storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, - String accountName, - BlobInventoryPolicyName blobInventoryPolicyName, - Context context) { - return getWithResponseAsync(resourceGroupName, accountName, blobInventoryPolicyName, context).block(); - } - - /** - * Sets the blob inventory policy to the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should always be - * 'default'. - * @param properties The blob inventory policy set to a storage account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the storage account blob inventory policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, - String accountName, - BlobInventoryPolicyName blobInventoryPolicyName, - BlobInventoryPolicyInner properties) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (blobInventoryPolicyName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter blobInventoryPolicyName is required and cannot be null.")); - } - if (properties == null) { - return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); - } else { - properties.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - blobInventoryPolicyName, - properties, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Sets the blob inventory policy to the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should always be - * 'default'. - * @param properties The blob inventory policy set to a storage account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the storage account blob inventory policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, - String accountName, - BlobInventoryPolicyName blobInventoryPolicyName, - BlobInventoryPolicyInner properties, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (blobInventoryPolicyName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter blobInventoryPolicyName is required and cannot be null.")); - } - if (properties == null) { - return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); - } else { - properties.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - blobInventoryPolicyName, - properties, - accept, - context); - } - - /** - * Sets the blob inventory policy to the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should always be - * 'default'. - * @param properties The blob inventory policy set to a storage account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the storage account blob inventory policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, - String accountName, - BlobInventoryPolicyName blobInventoryPolicyName, - BlobInventoryPolicyInner properties) { - return createOrUpdateWithResponseAsync(resourceGroupName, accountName, blobInventoryPolicyName, properties) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Sets the blob inventory policy to the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should always be - * 'default'. - * @param properties The blob inventory policy set to a storage account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the storage account blob inventory policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BlobInventoryPolicyInner createOrUpdate( - String resourceGroupName, - String accountName, - BlobInventoryPolicyName blobInventoryPolicyName, - BlobInventoryPolicyInner properties) { - return createOrUpdateAsync(resourceGroupName, accountName, blobInventoryPolicyName, properties).block(); - } - - /** - * Sets the blob inventory policy to the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should always be - * 'default'. - * @param properties The blob inventory policy set to a storage account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the storage account blob inventory policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceGroupName, - String accountName, - BlobInventoryPolicyName blobInventoryPolicyName, - BlobInventoryPolicyInner properties, - Context context) { - return createOrUpdateWithResponseAsync( - resourceGroupName, accountName, blobInventoryPolicyName, properties, context) - .block(); - } - - /** - * Deletes the blob inventory policy associated with the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should always be - * 'default'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync( - String resourceGroupName, String accountName, BlobInventoryPolicyName blobInventoryPolicyName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (blobInventoryPolicyName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter blobInventoryPolicyName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - blobInventoryPolicyName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the blob inventory policy associated with the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should always be - * 'default'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, - String accountName, - BlobInventoryPolicyName blobInventoryPolicyName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (blobInventoryPolicyName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter blobInventoryPolicyName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - blobInventoryPolicyName, - accept, - context); - } - - /** - * Deletes the blob inventory policy associated with the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should always be - * 'default'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync( - String resourceGroupName, String accountName, BlobInventoryPolicyName blobInventoryPolicyName) { - return deleteWithResponseAsync(resourceGroupName, accountName, blobInventoryPolicyName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes the blob inventory policy associated with the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should always be - * 'default'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String accountName, BlobInventoryPolicyName blobInventoryPolicyName) { - deleteAsync(resourceGroupName, accountName, blobInventoryPolicyName).block(); - } - - /** - * Deletes the blob inventory policy associated with the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should always be - * 'default'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse( - String resourceGroupName, - String accountName, - BlobInventoryPolicyName blobInventoryPolicyName, - Context context) { - return deleteWithResponseAsync(resourceGroupName, accountName, blobInventoryPolicyName, context).block(); - } - - /** - * Gets the blob inventory policy associated with the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the blob inventory policy associated with the specified storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String accountName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the blob inventory policy associated with the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the blob inventory policy associated with the specified storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String accountName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); - } - - /** - * Gets the blob inventory policy associated with the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the blob inventory policy associated with the specified storage account. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String resourceGroupName, String accountName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName)); - } - - /** - * Gets the blob inventory policy associated with the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the blob inventory policy associated with the specified storage account. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String accountName, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName, context)); - } - - /** - * Gets the blob inventory policy associated with the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the blob inventory policy associated with the specified storage account. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String accountName) { - return new PagedIterable<>(listAsync(resourceGroupName, accountName)); - } - - /** - * Gets the blob inventory policy associated with the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the blob inventory policy associated with the specified storage account. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String accountName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, accountName, context)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/BlobServiceEncryptionStatusImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/BlobServiceEncryptionStatusImpl.java deleted file mode 100644 index 4a0c3a4fa661..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/BlobServiceEncryptionStatusImpl.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.storage.implementation; - -import com.azure.resourcemanager.storage.models.EncryptionService; -import com.azure.resourcemanager.storage.models.EncryptionServices; -import com.azure.resourcemanager.storage.models.StorageService; - -/** Implementation of StorageAccountEncryptionStatus for Blob service. */ -class BlobServiceEncryptionStatusImpl extends StorageAccountEncryptionStatusImpl { - BlobServiceEncryptionStatusImpl(EncryptionServices encryptionServices) { - super(encryptionServices); - } - - @Override - public StorageService storageService() { - return StorageService.BLOB; - } - - @Override - protected EncryptionService encryptionService() { - if (super.encryptionServices == null) { - return null; - } else { - return super.encryptionServices.blob(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/BlobServicePropertiesImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/BlobServicePropertiesImpl.java deleted file mode 100644 index dd9103a1b2af..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/BlobServicePropertiesImpl.java +++ /dev/null @@ -1,158 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.storage.implementation; - -import com.azure.resourcemanager.resources.fluentcore.model.implementation.CreatableUpdatableImpl; -import com.azure.resourcemanager.storage.StorageManager; -import com.azure.resourcemanager.storage.fluent.BlobServicesClient; -import com.azure.resourcemanager.storage.models.BlobServiceProperties; -import com.azure.resourcemanager.storage.models.CorsRule; -import com.azure.resourcemanager.storage.models.CorsRules; -import com.azure.resourcemanager.storage.models.DeleteRetentionPolicy; -import com.azure.resourcemanager.storage.fluent.models.BlobServicePropertiesInner; - -import java.util.ArrayList; -import java.util.List; -import reactor.core.publisher.Mono; - -class BlobServicePropertiesImpl - extends CreatableUpdatableImpl - implements BlobServiceProperties, BlobServiceProperties.Definition, BlobServiceProperties.Update { - private final StorageManager manager; - private String resourceGroupName; - private String accountName; - - BlobServicePropertiesImpl(String name, StorageManager manager) { - super(name, new BlobServicePropertiesInner()); - this.manager = manager; - // Set resource name - this.accountName = name; - // - } - - BlobServicePropertiesImpl(BlobServicePropertiesInner inner, StorageManager manager) { - super(inner.name(), inner); - this.manager = manager; - // Set resource name - this.accountName = inner.name(); - // set resource ancestor and positional variables - this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); - this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "storageAccounts"); - // - } - - @Override - public StorageManager manager() { - return this.manager; - } - - @Override - public Mono createResourceAsync() { - BlobServicesClient client = this.manager().serviceClient().getBlobServices(); - return client - .setServicePropertiesAsync(this.resourceGroupName, this.accountName, this.innerModel()) - .map(innerToFluentMap(this)); - } - - @Override - public Mono updateResourceAsync() { - BlobServicesClient client = this.manager().serviceClient().getBlobServices(); - return client - .setServicePropertiesAsync(this.resourceGroupName, this.accountName, this.innerModel()) - .map(innerToFluentMap(this)); - } - - @Override - protected Mono getInnerAsync() { - BlobServicesClient client = this.manager().serviceClient().getBlobServices(); - return client.getServicePropertiesAsync(this.resourceGroupName, this.accountName); - } - - @Override - public boolean isInCreateMode() { - return this.innerModel().id() == null; - } - - @Override - public CorsRules cors() { - return this.innerModel().cors(); - } - - @Override - public String defaultServiceVersion() { - return this.innerModel().defaultServiceVersion(); - } - - @Override - public DeleteRetentionPolicy deleteRetentionPolicy() { - return this.innerModel().deleteRetentionPolicy(); - } - - @Override - public String id() { - return this.innerModel().id(); - } - - @Override - public String name() { - return this.innerModel().name(); - } - - @Override - public String type() { - return this.innerModel().type(); - } - - @Override - public BlobServicePropertiesImpl withExistingStorageAccount(String resourceGroupName, String accountName) { - this.resourceGroupName = resourceGroupName; - this.accountName = accountName; - return this; - } - - @Override - public BlobServicePropertiesImpl withCORSRules(List corsRules) { - this.innerModel().withCors(new CorsRules().withCorsRules(corsRules)); - return this; - } - - @Override - public BlobServicePropertiesImpl withCORSRule(CorsRule corsRule) { - CorsRules corsRules = this.innerModel().cors(); - if (corsRules == null) { - List firstCorsRule = new ArrayList<>(); - firstCorsRule.add(corsRule); - this.innerModel().withCors(new CorsRules().withCorsRules(firstCorsRule)); - } else { - List currentCorsRules = corsRules.corsRules(); - currentCorsRules.add(corsRule); - this.innerModel().withCors(corsRules.withCorsRules(currentCorsRules)); - } - return this; - } - - @Override - public BlobServicePropertiesImpl withDefaultServiceVersion(String defaultServiceVersion) { - this.innerModel().withDefaultServiceVersion(defaultServiceVersion); - return this; - } - - @Override - public BlobServicePropertiesImpl withDeleteRetentionPolicy(DeleteRetentionPolicy deleteRetentionPolicy) { - this.innerModel().withDeleteRetentionPolicy(deleteRetentionPolicy); - return this; - } - - @Override - public BlobServicePropertiesImpl withDeleteRetentionPolicyEnabled(int numDaysEnabled) { - this.innerModel().withDeleteRetentionPolicy(new DeleteRetentionPolicy().withEnabled(true).withDays(numDaysEnabled)); - return this; - } - - @Override - public BlobServicePropertiesImpl withDeleteRetentionPolicyDisabled() { - this.innerModel().withDeleteRetentionPolicy(new DeleteRetentionPolicy().withEnabled(false)); - return this; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/BlobServicesClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/BlobServicesClientImpl.java deleted file mode 100644 index 7ac1c48e4f3f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/BlobServicesClientImpl.java +++ /dev/null @@ -1,655 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.storage.fluent.BlobServicesClient; -import com.azure.resourcemanager.storage.fluent.models.BlobServicePropertiesInner; -import com.azure.resourcemanager.storage.models.BlobServiceItems; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in BlobServicesClient. */ -public final class BlobServicesClientImpl implements BlobServicesClient { - private final ClientLogger logger = new ClientLogger(BlobServicesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final BlobServicesService service; - - /** The service client containing this operation class. */ - private final StorageManagementClientImpl client; - - /** - * Initializes an instance of BlobServicesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - BlobServicesClientImpl(StorageManagementClientImpl client) { - this.service = - RestProxy.create(BlobServicesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for StorageManagementClientBlobServices to be used by the proxy service - * to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "StorageManagementCli") - private interface BlobServicesService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" - + "/storageAccounts/{accountName}/blobServices") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" - + "/storageAccounts/{accountName}/blobServices/{BlobServicesName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> setServiceProperties( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("BlobServicesName") String blobServicesName, - @BodyParam("application/json") BlobServicePropertiesInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" - + "/storageAccounts/{accountName}/blobServices/{BlobServicesName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getServiceProperties( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("BlobServicesName") String blobServicesName, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * List blob services of storage account. It returns a collection of one object named default. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String accountName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List blob services of storage account. It returns a collection of one object named default. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String accountName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); - } - - /** - * List blob services of storage account. It returns a collection of one object named default. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String resourceGroupName, String accountName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName)); - } - - /** - * List blob services of storage account. It returns a collection of one object named default. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String accountName, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName, context)); - } - - /** - * List blob services of storage account. It returns a collection of one object named default. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String accountName) { - return new PagedIterable<>(listAsync(resourceGroupName, accountName)); - } - - /** - * List blob services of storage account. It returns a collection of one object named default. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, String accountName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, accountName, context)); - } - - /** - * Sets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The properties of a storage account’s Blob service, including properties for Storage Analytics - * and CORS (Cross-Origin Resource Sharing) rules. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a storage account’s Blob service. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> setServicePropertiesWithResponseAsync( - String resourceGroupName, String accountName, BlobServicePropertiesInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String blobServicesName = "default"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .setServiceProperties( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - blobServicesName, - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Sets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The properties of a storage account’s Blob service, including properties for Storage Analytics - * and CORS (Cross-Origin Resource Sharing) rules. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a storage account’s Blob service. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> setServicePropertiesWithResponseAsync( - String resourceGroupName, String accountName, BlobServicePropertiesInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String blobServicesName = "default"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .setServiceProperties( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - blobServicesName, - parameters, - accept, - context); - } - - /** - * Sets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The properties of a storage account’s Blob service, including properties for Storage Analytics - * and CORS (Cross-Origin Resource Sharing) rules. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a storage account’s Blob service. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono setServicePropertiesAsync( - String resourceGroupName, String accountName, BlobServicePropertiesInner parameters) { - return setServicePropertiesWithResponseAsync(resourceGroupName, accountName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Sets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The properties of a storage account’s Blob service, including properties for Storage Analytics - * and CORS (Cross-Origin Resource Sharing) rules. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a storage account’s Blob service. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BlobServicePropertiesInner setServiceProperties( - String resourceGroupName, String accountName, BlobServicePropertiesInner parameters) { - return setServicePropertiesAsync(resourceGroupName, accountName, parameters).block(); - } - - /** - * Sets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The properties of a storage account’s Blob service, including properties for Storage Analytics - * and CORS (Cross-Origin Resource Sharing) rules. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a storage account’s Blob service. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response setServicePropertiesWithResponse( - String resourceGroupName, String accountName, BlobServicePropertiesInner parameters, Context context) { - return setServicePropertiesWithResponseAsync(resourceGroupName, accountName, parameters, context).block(); - } - - /** - * Gets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getServicePropertiesWithResponseAsync( - String resourceGroupName, String accountName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String blobServicesName = "default"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getServiceProperties( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - blobServicesName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getServicePropertiesWithResponseAsync( - String resourceGroupName, String accountName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String blobServicesName = "default"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getServiceProperties( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - blobServicesName, - accept, - context); - } - - /** - * Gets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getServicePropertiesAsync(String resourceGroupName, String accountName) { - return getServicePropertiesWithResponseAsync(resourceGroupName, accountName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BlobServicePropertiesInner getServiceProperties(String resourceGroupName, String accountName) { - return getServicePropertiesAsync(resourceGroupName, accountName).block(); - } - - /** - * Gets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getServicePropertiesWithResponse( - String resourceGroupName, String accountName, Context context) { - return getServicePropertiesWithResponseAsync(resourceGroupName, accountName, context).block(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/BlobServicesImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/BlobServicesImpl.java deleted file mode 100644 index 907f5df4640f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/BlobServicesImpl.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.storage.implementation; - -import com.azure.resourcemanager.resources.fluentcore.model.implementation.WrapperImpl; -import com.azure.resourcemanager.storage.StorageManager; -import com.azure.resourcemanager.storage.fluent.BlobServicesClient; -import com.azure.resourcemanager.storage.models.BlobServiceProperties; -import com.azure.resourcemanager.storage.models.BlobServices; -import com.azure.resourcemanager.storage.fluent.models.BlobServicePropertiesInner; -import reactor.core.publisher.Mono; - -public class BlobServicesImpl extends WrapperImpl implements BlobServices { - private final StorageManager manager; - - public BlobServicesImpl(StorageManager manager) { - super(manager.serviceClient().getBlobServices()); - this.manager = manager; - } - - public StorageManager getManager() { - return this.manager; - } - - @Override - public BlobServicePropertiesImpl define(String name) { - return wrapModel(name); - } - - private BlobServicePropertiesImpl wrapModel(BlobServicePropertiesInner inner) { - return new BlobServicePropertiesImpl(inner, getManager()); - } - - private BlobServicePropertiesImpl wrapModel(String name) { - return new BlobServicePropertiesImpl(name, this.getManager()); - } - - @Override - public Mono getServicePropertiesAsync(String resourceGroupName, String accountName) { - return innerModel().getServicePropertiesAsync(resourceGroupName, accountName).map(inner -> wrapModel(inner)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/EncryptionScopesClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/EncryptionScopesClientImpl.java deleted file mode 100644 index d350ae496e26..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/EncryptionScopesClientImpl.java +++ /dev/null @@ -1,1054 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.storage.fluent.EncryptionScopesClient; -import com.azure.resourcemanager.storage.fluent.models.EncryptionScopeInner; -import com.azure.resourcemanager.storage.models.EncryptionScopeListResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in EncryptionScopesClient. */ -public final class EncryptionScopesClientImpl implements EncryptionScopesClient { - private final ClientLogger logger = new ClientLogger(EncryptionScopesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final EncryptionScopesService service; - - /** The service client containing this operation class. */ - private final StorageManagementClientImpl client; - - /** - * Initializes an instance of EncryptionScopesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - EncryptionScopesClientImpl(StorageManagementClientImpl client) { - this.service = - RestProxy.create(EncryptionScopesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for StorageManagementClientEncryptionScopes to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "StorageManagementCli") - private interface EncryptionScopesService { - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" - + "/storageAccounts/{accountName}/encryptionScopes/{encryptionScopeName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> put( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("encryptionScopeName") String encryptionScopeName, - @BodyParam("application/json") EncryptionScopeInner encryptionScope, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" - + "/storageAccounts/{accountName}/encryptionScopes/{encryptionScopeName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> patch( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("encryptionScopeName") String encryptionScopeName, - @BodyParam("application/json") EncryptionScopeInner encryptionScope, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" - + "/storageAccounts/{accountName}/encryptionScopes/{encryptionScopeName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("encryptionScopeName") String encryptionScopeName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" - + "/storageAccounts/{accountName}/encryptionScopes") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Synchronously creates or updates an encryption scope under the specified storage account. If an encryption scope - * is already created and a subsequent request is issued with different properties, the encryption scope properties - * will be updated per the specified request. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param encryptionScopeName The name of the encryption scope within the specified storage account. Encryption - * scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) - * only. Every dash (-) character must be immediately preceded and followed by a letter or number. - * @param encryptionScope Encryption scope properties to be used for the create or update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Encryption Scope resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> putWithResponseAsync( - String resourceGroupName, - String accountName, - String encryptionScopeName, - EncryptionScopeInner encryptionScope) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (encryptionScopeName == null) { - return Mono - .error(new IllegalArgumentException("Parameter encryptionScopeName is required and cannot be null.")); - } - if (encryptionScope == null) { - return Mono - .error(new IllegalArgumentException("Parameter encryptionScope is required and cannot be null.")); - } else { - encryptionScope.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .put( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - encryptionScopeName, - encryptionScope, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Synchronously creates or updates an encryption scope under the specified storage account. If an encryption scope - * is already created and a subsequent request is issued with different properties, the encryption scope properties - * will be updated per the specified request. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param encryptionScopeName The name of the encryption scope within the specified storage account. Encryption - * scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) - * only. Every dash (-) character must be immediately preceded and followed by a letter or number. - * @param encryptionScope Encryption scope properties to be used for the create or update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Encryption Scope resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> putWithResponseAsync( - String resourceGroupName, - String accountName, - String encryptionScopeName, - EncryptionScopeInner encryptionScope, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (encryptionScopeName == null) { - return Mono - .error(new IllegalArgumentException("Parameter encryptionScopeName is required and cannot be null.")); - } - if (encryptionScope == null) { - return Mono - .error(new IllegalArgumentException("Parameter encryptionScope is required and cannot be null.")); - } else { - encryptionScope.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .put( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - encryptionScopeName, - encryptionScope, - accept, - context); - } - - /** - * Synchronously creates or updates an encryption scope under the specified storage account. If an encryption scope - * is already created and a subsequent request is issued with different properties, the encryption scope properties - * will be updated per the specified request. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param encryptionScopeName The name of the encryption scope within the specified storage account. Encryption - * scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) - * only. Every dash (-) character must be immediately preceded and followed by a letter or number. - * @param encryptionScope Encryption scope properties to be used for the create or update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Encryption Scope resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono putAsync( - String resourceGroupName, - String accountName, - String encryptionScopeName, - EncryptionScopeInner encryptionScope) { - return putWithResponseAsync(resourceGroupName, accountName, encryptionScopeName, encryptionScope) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Synchronously creates or updates an encryption scope under the specified storage account. If an encryption scope - * is already created and a subsequent request is issued with different properties, the encryption scope properties - * will be updated per the specified request. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param encryptionScopeName The name of the encryption scope within the specified storage account. Encryption - * scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) - * only. Every dash (-) character must be immediately preceded and followed by a letter or number. - * @param encryptionScope Encryption scope properties to be used for the create or update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Encryption Scope resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public EncryptionScopeInner put( - String resourceGroupName, - String accountName, - String encryptionScopeName, - EncryptionScopeInner encryptionScope) { - return putAsync(resourceGroupName, accountName, encryptionScopeName, encryptionScope).block(); - } - - /** - * Synchronously creates or updates an encryption scope under the specified storage account. If an encryption scope - * is already created and a subsequent request is issued with different properties, the encryption scope properties - * will be updated per the specified request. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param encryptionScopeName The name of the encryption scope within the specified storage account. Encryption - * scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) - * only. Every dash (-) character must be immediately preceded and followed by a letter or number. - * @param encryptionScope Encryption scope properties to be used for the create or update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Encryption Scope resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response putWithResponse( - String resourceGroupName, - String accountName, - String encryptionScopeName, - EncryptionScopeInner encryptionScope, - Context context) { - return putWithResponseAsync(resourceGroupName, accountName, encryptionScopeName, encryptionScope, context) - .block(); - } - - /** - * Update encryption scope properties as specified in the request body. Update fails if the specified encryption - * scope does not already exist. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param encryptionScopeName The name of the encryption scope within the specified storage account. Encryption - * scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) - * only. Every dash (-) character must be immediately preceded and followed by a letter or number. - * @param encryptionScope Encryption scope properties to be used for the update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Encryption Scope resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> patchWithResponseAsync( - String resourceGroupName, - String accountName, - String encryptionScopeName, - EncryptionScopeInner encryptionScope) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (encryptionScopeName == null) { - return Mono - .error(new IllegalArgumentException("Parameter encryptionScopeName is required and cannot be null.")); - } - if (encryptionScope == null) { - return Mono - .error(new IllegalArgumentException("Parameter encryptionScope is required and cannot be null.")); - } else { - encryptionScope.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .patch( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - encryptionScopeName, - encryptionScope, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Update encryption scope properties as specified in the request body. Update fails if the specified encryption - * scope does not already exist. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param encryptionScopeName The name of the encryption scope within the specified storage account. Encryption - * scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) - * only. Every dash (-) character must be immediately preceded and followed by a letter or number. - * @param encryptionScope Encryption scope properties to be used for the update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Encryption Scope resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> patchWithResponseAsync( - String resourceGroupName, - String accountName, - String encryptionScopeName, - EncryptionScopeInner encryptionScope, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (encryptionScopeName == null) { - return Mono - .error(new IllegalArgumentException("Parameter encryptionScopeName is required and cannot be null.")); - } - if (encryptionScope == null) { - return Mono - .error(new IllegalArgumentException("Parameter encryptionScope is required and cannot be null.")); - } else { - encryptionScope.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .patch( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - encryptionScopeName, - encryptionScope, - accept, - context); - } - - /** - * Update encryption scope properties as specified in the request body. Update fails if the specified encryption - * scope does not already exist. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param encryptionScopeName The name of the encryption scope within the specified storage account. Encryption - * scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) - * only. Every dash (-) character must be immediately preceded and followed by a letter or number. - * @param encryptionScope Encryption scope properties to be used for the update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Encryption Scope resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono patchAsync( - String resourceGroupName, - String accountName, - String encryptionScopeName, - EncryptionScopeInner encryptionScope) { - return patchWithResponseAsync(resourceGroupName, accountName, encryptionScopeName, encryptionScope) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Update encryption scope properties as specified in the request body. Update fails if the specified encryption - * scope does not already exist. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param encryptionScopeName The name of the encryption scope within the specified storage account. Encryption - * scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) - * only. Every dash (-) character must be immediately preceded and followed by a letter or number. - * @param encryptionScope Encryption scope properties to be used for the update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Encryption Scope resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public EncryptionScopeInner patch( - String resourceGroupName, - String accountName, - String encryptionScopeName, - EncryptionScopeInner encryptionScope) { - return patchAsync(resourceGroupName, accountName, encryptionScopeName, encryptionScope).block(); - } - - /** - * Update encryption scope properties as specified in the request body. Update fails if the specified encryption - * scope does not already exist. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param encryptionScopeName The name of the encryption scope within the specified storage account. Encryption - * scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) - * only. Every dash (-) character must be immediately preceded and followed by a letter or number. - * @param encryptionScope Encryption scope properties to be used for the update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Encryption Scope resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response patchWithResponse( - String resourceGroupName, - String accountName, - String encryptionScopeName, - EncryptionScopeInner encryptionScope, - Context context) { - return patchWithResponseAsync(resourceGroupName, accountName, encryptionScopeName, encryptionScope, context) - .block(); - } - - /** - * Returns the properties for the specified encryption scope. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param encryptionScopeName The name of the encryption scope within the specified storage account. Encryption - * scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) - * only. Every dash (-) character must be immediately preceded and followed by a letter or number. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Encryption Scope resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String resourceGroupName, String accountName, String encryptionScopeName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (encryptionScopeName == null) { - return Mono - .error(new IllegalArgumentException("Parameter encryptionScopeName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - encryptionScopeName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns the properties for the specified encryption scope. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param encryptionScopeName The name of the encryption scope within the specified storage account. Encryption - * scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) - * only. Every dash (-) character must be immediately preceded and followed by a letter or number. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Encryption Scope resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String accountName, String encryptionScopeName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (encryptionScopeName == null) { - return Mono - .error(new IllegalArgumentException("Parameter encryptionScopeName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - encryptionScopeName, - accept, - context); - } - - /** - * Returns the properties for the specified encryption scope. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param encryptionScopeName The name of the encryption scope within the specified storage account. Encryption - * scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) - * only. Every dash (-) character must be immediately preceded and followed by a letter or number. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Encryption Scope resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync( - String resourceGroupName, String accountName, String encryptionScopeName) { - return getWithResponseAsync(resourceGroupName, accountName, encryptionScopeName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Returns the properties for the specified encryption scope. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param encryptionScopeName The name of the encryption scope within the specified storage account. Encryption - * scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) - * only. Every dash (-) character must be immediately preceded and followed by a letter or number. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Encryption Scope resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public EncryptionScopeInner get(String resourceGroupName, String accountName, String encryptionScopeName) { - return getAsync(resourceGroupName, accountName, encryptionScopeName).block(); - } - - /** - * Returns the properties for the specified encryption scope. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param encryptionScopeName The name of the encryption scope within the specified storage account. Encryption - * scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) - * only. Every dash (-) character must be immediately preceded and followed by a letter or number. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Encryption Scope resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String accountName, String encryptionScopeName, Context context) { - return getWithResponseAsync(resourceGroupName, accountName, encryptionScopeName, context).block(); - } - - /** - * Lists all the encryption scopes available under the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of encryption scopes requested, and if paging is required, a URL to the next page of encryption - * scopes. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String accountName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all the encryption scopes available under the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of encryption scopes requested, and if paging is required, a URL to the next page of encryption - * scopes. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String accountName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists all the encryption scopes available under the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of encryption scopes requested, and if paging is required, a URL to the next page of encryption - * scopes. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String resourceGroupName, String accountName) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, accountName), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists all the encryption scopes available under the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of encryption scopes requested, and if paging is required, a URL to the next page of encryption - * scopes. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String accountName, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, accountName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all the encryption scopes available under the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of encryption scopes requested, and if paging is required, a URL to the next page of encryption - * scopes. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String accountName) { - return new PagedIterable<>(listAsync(resourceGroupName, accountName)); - } - - /** - * Lists all the encryption scopes available under the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of encryption scopes requested, and if paging is required, a URL to the next page of encryption - * scopes. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String accountName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, accountName, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of encryption scopes requested, and if paging is required, a URL to the next page of encryption - * scopes. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of encryption scopes requested, and if paging is required, a URL to the next page of encryption - * scopes. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/FileServiceEncryptionStatusImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/FileServiceEncryptionStatusImpl.java deleted file mode 100644 index aaf7d1e448e9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/FileServiceEncryptionStatusImpl.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.storage.implementation; - -import com.azure.resourcemanager.storage.models.EncryptionService; -import com.azure.resourcemanager.storage.models.EncryptionServices; -import com.azure.resourcemanager.storage.models.StorageService; - -/** Implementation of StorageAccountEncryptionStatus for File service. */ -class FileServiceEncryptionStatusImpl extends StorageAccountEncryptionStatusImpl { - FileServiceEncryptionStatusImpl(EncryptionServices encryptionServices) { - super(encryptionServices); - } - - @Override - public StorageService storageService() { - return StorageService.FILE; - } - - @Override - protected EncryptionService encryptionService() { - if (super.encryptionServices == null) { - return null; - } else { - return super.encryptionServices.file(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/FileServicesClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/FileServicesClientImpl.java deleted file mode 100644 index cebf41ccc012..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/FileServicesClientImpl.java +++ /dev/null @@ -1,621 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.storage.fluent.FileServicesClient; -import com.azure.resourcemanager.storage.fluent.models.FileServiceItemsInner; -import com.azure.resourcemanager.storage.fluent.models.FileServicePropertiesInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in FileServicesClient. */ -public final class FileServicesClientImpl implements FileServicesClient { - private final ClientLogger logger = new ClientLogger(FileServicesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final FileServicesService service; - - /** The service client containing this operation class. */ - private final StorageManagementClientImpl client; - - /** - * Initializes an instance of FileServicesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - FileServicesClientImpl(StorageManagementClientImpl client) { - this.service = - RestProxy.create(FileServicesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for StorageManagementClientFileServices to be used by the proxy service - * to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "StorageManagementCli") - private interface FileServicesService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" - + "/storageAccounts/{accountName}/fileServices") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" - + "/storageAccounts/{accountName}/fileServices/{FileServicesName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> setServiceProperties( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("FileServicesName") String fileServicesName, - @BodyParam("application/json") FileServicePropertiesInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" - + "/storageAccounts/{accountName}/fileServices/{FileServicesName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getServiceProperties( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("FileServicesName") String fileServicesName, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * List all file services in storage accounts. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listWithResponseAsync(String resourceGroupName, String accountName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List all file services in storage accounts. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync( - String resourceGroupName, String accountName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * List all file services in storage accounts. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listAsync(String resourceGroupName, String accountName) { - return listWithResponseAsync(resourceGroupName, accountName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * List all file services in storage accounts. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public FileServiceItemsInner list(String resourceGroupName, String accountName) { - return listAsync(resourceGroupName, accountName).block(); - } - - /** - * List all file services in storage accounts. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse( - String resourceGroupName, String accountName, Context context) { - return listWithResponseAsync(resourceGroupName, accountName, context).block(); - } - - /** - * Sets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The properties of file services in storage accounts, including CORS (Cross-Origin Resource - * Sharing) rules. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of File services in storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> setServicePropertiesWithResponseAsync( - String resourceGroupName, String accountName, FileServicePropertiesInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String fileServicesName = "default"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .setServiceProperties( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - fileServicesName, - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Sets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The properties of file services in storage accounts, including CORS (Cross-Origin Resource - * Sharing) rules. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of File services in storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> setServicePropertiesWithResponseAsync( - String resourceGroupName, String accountName, FileServicePropertiesInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String fileServicesName = "default"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .setServiceProperties( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - fileServicesName, - parameters, - accept, - context); - } - - /** - * Sets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The properties of file services in storage accounts, including CORS (Cross-Origin Resource - * Sharing) rules. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of File services in storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono setServicePropertiesAsync( - String resourceGroupName, String accountName, FileServicePropertiesInner parameters) { - return setServicePropertiesWithResponseAsync(resourceGroupName, accountName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Sets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The properties of file services in storage accounts, including CORS (Cross-Origin Resource - * Sharing) rules. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of File services in storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public FileServicePropertiesInner setServiceProperties( - String resourceGroupName, String accountName, FileServicePropertiesInner parameters) { - return setServicePropertiesAsync(resourceGroupName, accountName, parameters).block(); - } - - /** - * Sets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The properties of file services in storage accounts, including CORS (Cross-Origin Resource - * Sharing) rules. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of File services in storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response setServicePropertiesWithResponse( - String resourceGroupName, String accountName, FileServicePropertiesInner parameters, Context context) { - return setServicePropertiesWithResponseAsync(resourceGroupName, accountName, parameters, context).block(); - } - - /** - * Gets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) - * rules. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getServicePropertiesWithResponseAsync( - String resourceGroupName, String accountName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String fileServicesName = "default"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getServiceProperties( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - fileServicesName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) - * rules. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getServicePropertiesWithResponseAsync( - String resourceGroupName, String accountName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String fileServicesName = "default"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getServiceProperties( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - fileServicesName, - accept, - context); - } - - /** - * Gets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) - * rules. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getServicePropertiesAsync(String resourceGroupName, String accountName) { - return getServicePropertiesWithResponseAsync(resourceGroupName, accountName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) - * rules. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public FileServicePropertiesInner getServiceProperties(String resourceGroupName, String accountName) { - return getServicePropertiesAsync(resourceGroupName, accountName).block(); - } - - /** - * Gets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) - * rules. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getServicePropertiesWithResponse( - String resourceGroupName, String accountName, Context context) { - return getServicePropertiesWithResponseAsync(resourceGroupName, accountName, context).block(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/FileSharesClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/FileSharesClientImpl.java deleted file mode 100644 index 6fac6c5d7cd2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/FileSharesClientImpl.java +++ /dev/null @@ -1,1505 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.storage.fluent.FileSharesClient; -import com.azure.resourcemanager.storage.fluent.models.FileShareInner; -import com.azure.resourcemanager.storage.fluent.models.FileShareItemInner; -import com.azure.resourcemanager.storage.models.DeletedShare; -import com.azure.resourcemanager.storage.models.FileShareItems; -import com.azure.resourcemanager.storage.models.GetShareExpand; -import com.azure.resourcemanager.storage.models.ListSharesExpand; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in FileSharesClient. */ -public final class FileSharesClientImpl implements FileSharesClient { - private final ClientLogger logger = new ClientLogger(FileSharesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final FileSharesService service; - - /** The service client containing this operation class. */ - private final StorageManagementClientImpl client; - - /** - * Initializes an instance of FileSharesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - FileSharesClientImpl(StorageManagementClientImpl client) { - this.service = - RestProxy.create(FileSharesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for StorageManagementClientFileShares to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "StorageManagementCli") - private interface FileSharesService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" - + "/storageAccounts/{accountName}/fileServices/default/shares") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("$maxpagesize") String maxpagesize, - @QueryParam("$filter") String filter, - @QueryParam("$expand") ListSharesExpand expand, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" - + "/storageAccounts/{accountName}/fileServices/default/shares/{shareName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> create( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("accountName") String accountName, - @PathParam("shareName") String shareName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") FileShareInner fileShare, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" - + "/storageAccounts/{accountName}/fileServices/default/shares/{shareName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("accountName") String accountName, - @PathParam("shareName") String shareName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") FileShareInner fileShare, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" - + "/storageAccounts/{accountName}/fileServices/default/shares/{shareName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("accountName") String accountName, - @PathParam("shareName") String shareName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("$expand") GetShareExpand expand, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" - + "/storageAccounts/{accountName}/fileServices/default/shares/{shareName}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("accountName") String accountName, - @PathParam("shareName") String shareName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" - + "/storageAccounts/{accountName}/fileServices/default/shares/{shareName}/restore") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> restore( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("accountName") String accountName, - @PathParam("shareName") String shareName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") DeletedShare deletedShare, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Lists all shares. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param maxpagesize Optional. Specified maximum number of shares that can be included in the list. - * @param filter Optional. When specified, only share names starting with the filter will be listed. - * @param expand Optional, used to expand the properties within share's properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response schema. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String accountName, String maxpagesize, String filter, ListSharesExpand expand) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - maxpagesize, - filter, - expand, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all shares. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param maxpagesize Optional. Specified maximum number of shares that can be included in the list. - * @param filter Optional. When specified, only share names starting with the filter will be listed. - * @param expand Optional, used to expand the properties within share's properties. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response schema. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, - String accountName, - String maxpagesize, - String filter, - ListSharesExpand expand, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - maxpagesize, - filter, - expand, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists all shares. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param maxpagesize Optional. Specified maximum number of shares that can be included in the list. - * @param filter Optional. When specified, only share names starting with the filter will be listed. - * @param expand Optional, used to expand the properties within share's properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response schema. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync( - String resourceGroupName, String accountName, String maxpagesize, String filter, ListSharesExpand expand) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, accountName, maxpagesize, filter, expand), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists all shares. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response schema. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String resourceGroupName, String accountName) { - final String maxpagesize = null; - final String filter = null; - final ListSharesExpand expand = null; - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, accountName, maxpagesize, filter, expand), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists all shares. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param maxpagesize Optional. Specified maximum number of shares that can be included in the list. - * @param filter Optional. When specified, only share names starting with the filter will be listed. - * @param expand Optional, used to expand the properties within share's properties. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response schema. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, - String accountName, - String maxpagesize, - String filter, - ListSharesExpand expand, - Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, accountName, maxpagesize, filter, expand, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all shares. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response schema. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String accountName) { - final String maxpagesize = null; - final String filter = null; - final ListSharesExpand expand = null; - return new PagedIterable<>(listAsync(resourceGroupName, accountName, maxpagesize, filter, expand)); - } - - /** - * Lists all shares. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param maxpagesize Optional. Specified maximum number of shares that can be included in the list. - * @param filter Optional. When specified, only share names starting with the filter will be listed. - * @param expand Optional, used to expand the properties within share's properties. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response schema. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, - String accountName, - String maxpagesize, - String filter, - ListSharesExpand expand, - Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, accountName, maxpagesize, filter, expand, context)); - } - - /** - * Creates a new share under the specified account as described by request body. The share resource includes - * metadata and properties for that share. It does not include a list of the files contained by the share. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param shareName The name of the file share within the specified storage account. File share names must be - * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) - * character must be immediately preceded and followed by a letter or number. - * @param fileShare Properties of the file share to create. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of the file share, including Id, resource name, resource type, Etag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createWithResponseAsync( - String resourceGroupName, String accountName, String shareName, FileShareInner fileShare) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (shareName == null) { - return Mono.error(new IllegalArgumentException("Parameter shareName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (fileShare == null) { - return Mono.error(new IllegalArgumentException("Parameter fileShare is required and cannot be null.")); - } else { - fileShare.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .create( - this.client.getEndpoint(), - resourceGroupName, - accountName, - shareName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - fileShare, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates a new share under the specified account as described by request body. The share resource includes - * metadata and properties for that share. It does not include a list of the files contained by the share. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param shareName The name of the file share within the specified storage account. File share names must be - * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) - * character must be immediately preceded and followed by a letter or number. - * @param fileShare Properties of the file share to create. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of the file share, including Id, resource name, resource type, Etag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync( - String resourceGroupName, String accountName, String shareName, FileShareInner fileShare, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (shareName == null) { - return Mono.error(new IllegalArgumentException("Parameter shareName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (fileShare == null) { - return Mono.error(new IllegalArgumentException("Parameter fileShare is required and cannot be null.")); - } else { - fileShare.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .create( - this.client.getEndpoint(), - resourceGroupName, - accountName, - shareName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - fileShare, - accept, - context); - } - - /** - * Creates a new share under the specified account as described by request body. The share resource includes - * metadata and properties for that share. It does not include a list of the files contained by the share. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param shareName The name of the file share within the specified storage account. File share names must be - * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) - * character must be immediately preceded and followed by a letter or number. - * @param fileShare Properties of the file share to create. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of the file share, including Id, resource name, resource type, Etag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createAsync( - String resourceGroupName, String accountName, String shareName, FileShareInner fileShare) { - return createWithResponseAsync(resourceGroupName, accountName, shareName, fileShare) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates a new share under the specified account as described by request body. The share resource includes - * metadata and properties for that share. It does not include a list of the files contained by the share. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param shareName The name of the file share within the specified storage account. File share names must be - * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) - * character must be immediately preceded and followed by a letter or number. - * @param fileShare Properties of the file share to create. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of the file share, including Id, resource name, resource type, Etag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public FileShareInner create( - String resourceGroupName, String accountName, String shareName, FileShareInner fileShare) { - return createAsync(resourceGroupName, accountName, shareName, fileShare).block(); - } - - /** - * Creates a new share under the specified account as described by request body. The share resource includes - * metadata and properties for that share. It does not include a list of the files contained by the share. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param shareName The name of the file share within the specified storage account. File share names must be - * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) - * character must be immediately preceded and followed by a letter or number. - * @param fileShare Properties of the file share to create. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of the file share, including Id, resource name, resource type, Etag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse( - String resourceGroupName, String accountName, String shareName, FileShareInner fileShare, Context context) { - return createWithResponseAsync(resourceGroupName, accountName, shareName, fileShare, context).block(); - } - - /** - * Updates share properties as specified in request body. Properties not mentioned in the request will not be - * changed. Update fails if the specified share does not already exist. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param shareName The name of the file share within the specified storage account. File share names must be - * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) - * character must be immediately preceded and followed by a letter or number. - * @param fileShare Properties to update for the file share. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of the file share, including Id, resource name, resource type, Etag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateWithResponseAsync( - String resourceGroupName, String accountName, String shareName, FileShareInner fileShare) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (shareName == null) { - return Mono.error(new IllegalArgumentException("Parameter shareName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (fileShare == null) { - return Mono.error(new IllegalArgumentException("Parameter fileShare is required and cannot be null.")); - } else { - fileShare.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - resourceGroupName, - accountName, - shareName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - fileShare, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates share properties as specified in request body. Properties not mentioned in the request will not be - * changed. Update fails if the specified share does not already exist. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param shareName The name of the file share within the specified storage account. File share names must be - * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) - * character must be immediately preceded and followed by a letter or number. - * @param fileShare Properties to update for the file share. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of the file share, including Id, resource name, resource type, Etag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, String accountName, String shareName, FileShareInner fileShare, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (shareName == null) { - return Mono.error(new IllegalArgumentException("Parameter shareName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (fileShare == null) { - return Mono.error(new IllegalArgumentException("Parameter fileShare is required and cannot be null.")); - } else { - fileShare.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - resourceGroupName, - accountName, - shareName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - fileShare, - accept, - context); - } - - /** - * Updates share properties as specified in request body. Properties not mentioned in the request will not be - * changed. Update fails if the specified share does not already exist. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param shareName The name of the file share within the specified storage account. File share names must be - * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) - * character must be immediately preceded and followed by a letter or number. - * @param fileShare Properties to update for the file share. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of the file share, including Id, resource name, resource type, Etag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync( - String resourceGroupName, String accountName, String shareName, FileShareInner fileShare) { - return updateWithResponseAsync(resourceGroupName, accountName, shareName, fileShare) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Updates share properties as specified in request body. Properties not mentioned in the request will not be - * changed. Update fails if the specified share does not already exist. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param shareName The name of the file share within the specified storage account. File share names must be - * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) - * character must be immediately preceded and followed by a letter or number. - * @param fileShare Properties to update for the file share. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of the file share, including Id, resource name, resource type, Etag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public FileShareInner update( - String resourceGroupName, String accountName, String shareName, FileShareInner fileShare) { - return updateAsync(resourceGroupName, accountName, shareName, fileShare).block(); - } - - /** - * Updates share properties as specified in request body. Properties not mentioned in the request will not be - * changed. Update fails if the specified share does not already exist. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param shareName The name of the file share within the specified storage account. File share names must be - * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) - * character must be immediately preceded and followed by a letter or number. - * @param fileShare Properties to update for the file share. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of the file share, including Id, resource name, resource type, Etag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, String accountName, String shareName, FileShareInner fileShare, Context context) { - return updateWithResponseAsync(resourceGroupName, accountName, shareName, fileShare, context).block(); - } - - /** - * Gets properties of a specified share. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param shareName The name of the file share within the specified storage account. File share names must be - * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) - * character must be immediately preceded and followed by a letter or number. - * @param expand Optional, used to expand the properties within share's properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of a specified share. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String resourceGroupName, String accountName, String shareName, GetShareExpand expand) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (shareName == null) { - return Mono.error(new IllegalArgumentException("Parameter shareName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - resourceGroupName, - accountName, - shareName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - expand, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets properties of a specified share. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param shareName The name of the file share within the specified storage account. File share names must be - * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) - * character must be immediately preceded and followed by a letter or number. - * @param expand Optional, used to expand the properties within share's properties. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of a specified share. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String accountName, String shareName, GetShareExpand expand, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (shareName == null) { - return Mono.error(new IllegalArgumentException("Parameter shareName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - resourceGroupName, - accountName, - shareName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - expand, - accept, - context); - } - - /** - * Gets properties of a specified share. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param shareName The name of the file share within the specified storage account. File share names must be - * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) - * character must be immediately preceded and followed by a letter or number. - * @param expand Optional, used to expand the properties within share's properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of a specified share. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync( - String resourceGroupName, String accountName, String shareName, GetShareExpand expand) { - return getWithResponseAsync(resourceGroupName, accountName, shareName, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets properties of a specified share. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param shareName The name of the file share within the specified storage account. File share names must be - * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) - * character must be immediately preceded and followed by a letter or number. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of a specified share. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync(String resourceGroupName, String accountName, String shareName) { - final GetShareExpand expand = null; - return getWithResponseAsync(resourceGroupName, accountName, shareName, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets properties of a specified share. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param shareName The name of the file share within the specified storage account. File share names must be - * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) - * character must be immediately preceded and followed by a letter or number. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of a specified share. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public FileShareInner get(String resourceGroupName, String accountName, String shareName) { - final GetShareExpand expand = null; - return getAsync(resourceGroupName, accountName, shareName, expand).block(); - } - - /** - * Gets properties of a specified share. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param shareName The name of the file share within the specified storage account. File share names must be - * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) - * character must be immediately preceded and followed by a letter or number. - * @param expand Optional, used to expand the properties within share's properties. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of a specified share. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String accountName, String shareName, GetShareExpand expand, Context context) { - return getWithResponseAsync(resourceGroupName, accountName, shareName, expand, context).block(); - } - - /** - * Deletes specified share under its account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param shareName The name of the file share within the specified storage account. File share names must be - * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) - * character must be immediately preceded and followed by a letter or number. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync( - String resourceGroupName, String accountName, String shareName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (shareName == null) { - return Mono.error(new IllegalArgumentException("Parameter shareName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - accountName, - shareName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes specified share under its account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param shareName The name of the file share within the specified storage account. File share names must be - * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) - * character must be immediately preceded and followed by a letter or number. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String accountName, String shareName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (shareName == null) { - return Mono.error(new IllegalArgumentException("Parameter shareName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - accountName, - shareName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Deletes specified share under its account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param shareName The name of the file share within the specified storage account. File share names must be - * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) - * character must be immediately preceded and followed by a letter or number. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String accountName, String shareName) { - return deleteWithResponseAsync(resourceGroupName, accountName, shareName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes specified share under its account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param shareName The name of the file share within the specified storage account. File share names must be - * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) - * character must be immediately preceded and followed by a letter or number. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String accountName, String shareName) { - deleteAsync(resourceGroupName, accountName, shareName).block(); - } - - /** - * Deletes specified share under its account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param shareName The name of the file share within the specified storage account. File share names must be - * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) - * character must be immediately preceded and followed by a letter or number. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse( - String resourceGroupName, String accountName, String shareName, Context context) { - return deleteWithResponseAsync(resourceGroupName, accountName, shareName, context).block(); - } - - /** - * Restore a file share within a valid retention days if share soft delete is enabled. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param shareName The name of the file share within the specified storage account. File share names must be - * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) - * character must be immediately preceded and followed by a letter or number. - * @param deletedShare The deleted share to be restored. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> restoreWithResponseAsync( - String resourceGroupName, String accountName, String shareName, DeletedShare deletedShare) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (shareName == null) { - return Mono.error(new IllegalArgumentException("Parameter shareName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (deletedShare == null) { - return Mono.error(new IllegalArgumentException("Parameter deletedShare is required and cannot be null.")); - } else { - deletedShare.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .restore( - this.client.getEndpoint(), - resourceGroupName, - accountName, - shareName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - deletedShare, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Restore a file share within a valid retention days if share soft delete is enabled. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param shareName The name of the file share within the specified storage account. File share names must be - * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) - * character must be immediately preceded and followed by a letter or number. - * @param deletedShare The deleted share to be restored. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> restoreWithResponseAsync( - String resourceGroupName, String accountName, String shareName, DeletedShare deletedShare, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (shareName == null) { - return Mono.error(new IllegalArgumentException("Parameter shareName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (deletedShare == null) { - return Mono.error(new IllegalArgumentException("Parameter deletedShare is required and cannot be null.")); - } else { - deletedShare.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .restore( - this.client.getEndpoint(), - resourceGroupName, - accountName, - shareName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - deletedShare, - accept, - context); - } - - /** - * Restore a file share within a valid retention days if share soft delete is enabled. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param shareName The name of the file share within the specified storage account. File share names must be - * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) - * character must be immediately preceded and followed by a letter or number. - * @param deletedShare The deleted share to be restored. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono restoreAsync( - String resourceGroupName, String accountName, String shareName, DeletedShare deletedShare) { - return restoreWithResponseAsync(resourceGroupName, accountName, shareName, deletedShare) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Restore a file share within a valid retention days if share soft delete is enabled. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param shareName The name of the file share within the specified storage account. File share names must be - * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) - * character must be immediately preceded and followed by a letter or number. - * @param deletedShare The deleted share to be restored. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void restore(String resourceGroupName, String accountName, String shareName, DeletedShare deletedShare) { - restoreAsync(resourceGroupName, accountName, shareName, deletedShare).block(); - } - - /** - * Restore a file share within a valid retention days if share soft delete is enabled. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param shareName The name of the file share within the specified storage account. File share names must be - * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) - * character must be immediately preceded and followed by a letter or number. - * @param deletedShare The deleted share to be restored. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response restoreWithResponse( - String resourceGroupName, String accountName, String shareName, DeletedShare deletedShare, Context context) { - return restoreWithResponseAsync(resourceGroupName, accountName, shareName, deletedShare, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response schema. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response schema. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/IdParsingUtils.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/IdParsingUtils.java deleted file mode 100644 index 9368effe99f4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/IdParsingUtils.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.storage.implementation; - -import java.util.Arrays; -import java.util.Iterator; - -class IdParsingUtils { - - /** - * Parses out the name of resource groups, storage accounts etc from the id string. - * - * @param id the id string. - * @param name the name of the value you would like to parse out from the id string - * @return the value you would like parsed out of the id string. - */ - public static String getValueFromIdByName(String id, String name) { - if (id == null) { - return null; - } - Iterable iterable = Arrays.asList(id.split("/")); - Iterator itr = iterable.iterator(); - while (itr.hasNext()) { - String part = itr.next(); - if (part != null && !part.trim().isEmpty()) { - if (part.equalsIgnoreCase(name)) { - if (itr.hasNext()) { - return itr.next(); - } else { - return null; - } - } - } - } - return null; - } - - /** - * Returns a value from an id string based on the given position. - * - * @param id the id string. - * @param pos the position of the value you would like to retrieve. - * @return the value from the id string based on the given position. - */ - public static String getValueFromIdByPosition(String id, int pos) { - if (id == null) { - return null; - } - Iterable iterable = Arrays.asList(id.split("/")); - Iterator itr = iterable.iterator(); - int index = 0; - while (itr.hasNext()) { - String part = itr.next(); - if (part != null && !part.trim().isEmpty()) { - if (index == pos) { - if (itr.hasNext()) { - return itr.next(); - } else { - return null; - } - } - } - index++; - } - return null; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/ImmutabilityPolicyImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/ImmutabilityPolicyImpl.java deleted file mode 100644 index 9c4116e6359e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/ImmutabilityPolicyImpl.java +++ /dev/null @@ -1,186 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.storage.implementation; - -import com.azure.resourcemanager.resources.fluentcore.model.implementation.CreatableUpdatableImpl; -import com.azure.resourcemanager.resources.fluentcore.utils.ETagState; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import com.azure.resourcemanager.storage.StorageManager; -import com.azure.resourcemanager.storage.fluent.BlobContainersClient; -import com.azure.resourcemanager.storage.models.ImmutabilityPolicy; -import com.azure.resourcemanager.storage.models.ImmutabilityPolicyState; -import com.azure.resourcemanager.storage.fluent.models.ImmutabilityPolicyInner; -import reactor.core.publisher.Mono; - -class ImmutabilityPolicyImpl - extends CreatableUpdatableImpl - implements ImmutabilityPolicy, ImmutabilityPolicy.Definition, ImmutabilityPolicy.Update { - private final StorageManager manager; - private String resourceGroupName; - private String accountName; - private String containerName; - private int cImmutabilityPeriodSinceCreationInDays; - private int uImmutabilityPeriodSinceCreationInDays; - private final ETagState eTagState = new ETagState(); - - ImmutabilityPolicyImpl(StorageManager manager) { - super("default", new ImmutabilityPolicyInner()); - this.manager = manager; - } - - ImmutabilityPolicyImpl(ImmutabilityPolicyInner inner, StorageManager manager) { - super(inner.name(), inner); - this.manager = manager; - // Set resource name - this.containerName = inner.name(); - // set resource ancestor and positional variables - this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); - this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "storageAccounts"); - this.containerName = IdParsingUtils.getValueFromIdByName(inner.id(), "containers"); - // - } - - @Override - public StorageManager manager() { - return this.manager; - } - - @Override - public Mono createResourceAsync() { - BlobContainersClient client = this.manager().serviceClient().getBlobContainers(); - return client - .createOrUpdateImmutabilityPolicyAsync( - this.resourceGroupName, - this.accountName, - this.containerName, - null, - new ImmutabilityPolicyInner() - .withImmutabilityPeriodSinceCreationInDays(this.cImmutabilityPeriodSinceCreationInDays)) - .map(innerToFluentMap(this)); - } - - @Override - public Mono updateResourceAsync() { - BlobContainersClient client = this.manager().serviceClient().getBlobContainers(); - return client - .createOrUpdateImmutabilityPolicyAsync( - this.resourceGroupName, - this.accountName, - this.containerName, - this.eTagState.ifMatchValueOnUpdate(this.innerModel().etag()), - new ImmutabilityPolicyInner() - .withImmutabilityPeriodSinceCreationInDays(this.uImmutabilityPeriodSinceCreationInDays)) - .map(innerToFluentMap(this)) - .map( - self -> { - eTagState.clear(); - return self; - }); - } - - @Override - protected Mono getInnerAsync() { - BlobContainersClient client = this.manager().serviceClient().getBlobContainers(); - return client.getImmutabilityPolicyAsync(this.resourceGroupName, this.accountName, this.containerName, null); - } - - @Override - public boolean isInCreateMode() { - return this.innerModel().id() == null; - } - - @Override - public String etag() { - return this.innerModel().etag(); - } - - @Override - public String id() { - return this.innerModel().id(); - } - - @Override - public int immutabilityPeriodSinceCreationInDays() { - return ResourceManagerUtils.toPrimitiveInt(this.innerModel().immutabilityPeriodSinceCreationInDays()); - } - - @Override - public String name() { - return this.innerModel().name(); - } - - @Override - public ImmutabilityPolicyState state() { - return this.innerModel().state(); - } - - @Override - public String type() { - return this.innerModel().type(); - } - - @Override - public void lock() { - this.lockAsync().block(); - } - - @Override - public Mono lockAsync() { - return manager().blobContainers().lockImmutabilityPolicyAsync(this.resourceGroupName, this.accountName, - this.containerName, this.etag()) - .map(p -> { - this.setInner(p.innerModel()); - return p; - }) - .then(); - } - - @Override - public void extend(int immutabilityPeriodSinceCreationInDays) { - this.extendAsync(immutabilityPeriodSinceCreationInDays).block(); - } - - @Override - public Mono extendAsync(int immutabilityPeriodSinceCreationInDays) { - return manager().blobContainers().extendImmutabilityPolicyAsync(this.resourceGroupName, this.accountName, - this.containerName, immutabilityPeriodSinceCreationInDays, this.innerModel().allowProtectedAppendWrites(), - this.etag()) - .map(p -> { - this.setInner(p.innerModel()); - return p; - }) - .then(); - } - - @Override - public ImmutabilityPolicyImpl withExistingContainer( - String resourceGroupName, String accountName, String containerName) { - this.resourceGroupName = resourceGroupName; - this.accountName = accountName; - this.containerName = containerName; - return this; - } - - @Override - public ImmutabilityPolicyImpl withETagCheck() { - this.eTagState.withImplicitETagCheckOnCreateOrUpdate(this.isInCreateMode()); - return this; - } - - @Override - public ImmutabilityPolicyImpl withETagCheck(String eTagValue) { - this.eTagState.withExplicitETagCheckOnUpdate(eTagValue); - return this; - } - - @Override - public ImmutabilityPolicyImpl withImmutabilityPeriodSinceCreationInDays(int immutabilityPeriodSinceCreationInDays) { - if (isInCreateMode()) { - this.cImmutabilityPeriodSinceCreationInDays = immutabilityPeriodSinceCreationInDays; - } else { - this.uImmutabilityPeriodSinceCreationInDays = immutabilityPeriodSinceCreationInDays; - } - return this; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/LegalHoldImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/LegalHoldImpl.java deleted file mode 100644 index 23d712bad2a4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/LegalHoldImpl.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.storage.implementation; - -import com.azure.resourcemanager.resources.fluentcore.model.implementation.WrapperImpl; -import com.azure.resourcemanager.storage.StorageManager; -import com.azure.resourcemanager.storage.models.LegalHold; -import com.azure.resourcemanager.storage.fluent.models.LegalHoldInner; -import java.util.List; - -class LegalHoldImpl extends WrapperImpl implements LegalHold { - private final StorageManager manager; - - LegalHoldImpl(LegalHoldInner inner, StorageManager manager) { - super(inner); - this.manager = manager; - } - - @Override - public StorageManager manager() { - return this.manager; - } - - @Override - public Boolean hasLegalHold() { - return this.innerModel().hasLegalHold(); - } - - @Override - public List tags() { - return this.innerModel().tags(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/ListContainerItemImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/ListContainerItemImpl.java deleted file mode 100644 index 65f66ad8dd39..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/ListContainerItemImpl.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// package com.azure.management.storage.implementation; -// -// import com.azure.management.storage.ImmutabilityPolicyProperties; -// import com.azure.management.storage.LeaseDuration; -// import com.azure.management.storage.LeaseState; -// import com.azure.management.storage.LeaseStatus; -// import com.azure.management.storage.LegalHoldProperties; -// import com.azure.management.storage.ListContainerItem; -// import com.azure.management.storage.PublicAccess; -// import com.microsoft.azure.management.resources.fluentcore.model.implementation.WrapperImpl; -// import org.joda.time.DateTime; -// -// import java.util.Map; -// -// public class ListContainerItemImpl extends WrapperImpl implements ListContainerItem { -// -// private final StorageManager manager; -// -// ListContainerItemImpl(ListContainerItemInner inner, StorageManager manager) { -// super(inner); -// this.manager = manager; -// } -// -// -// @Override -// public PublicAccess publicAccess() { -// return this.inner().publicAccess(); -// } -// -// @Override -// public DateTime lastModifiedTime() { -// return this.inner().lastModifiedTime(); -// } -// -// @Override -// public LeaseStatus leaseStatus() { -// return this.inner().leaseStatus(); -// } -// -// @Override -// public LeaseState leaseState() { -// return this.inner().leaseState(); -// } -// -// @Override -// public LeaseDuration leaseDuration() { -// return this.inner().leaseDuration(); -// } -// -// @Override -// public Map metadata() { -// return this.inner().metadata(); -// } -// -// @Override -// public ImmutabilityPolicyProperties immutabilityPolicy() { -// return this.inner().immutabilityPolicy(); -// } -// -// @Override -// public LegalHoldProperties legalHold() { -// return this.inner().legalHold(); -// } -// -// @Override -// public Boolean hasLegalHold() { -// return this.inner().hasLegalHold(); -// } -// -// @Override -// public Boolean hasImmutabilityPolicy() { -// return this.inner().hasImmutabilityPolicy(); -// } -// } diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/ManagementPoliciesClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/ManagementPoliciesClientImpl.java deleted file mode 100644 index b3d075fe0680..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/ManagementPoliciesClientImpl.java +++ /dev/null @@ -1,660 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.storage.fluent.ManagementPoliciesClient; -import com.azure.resourcemanager.storage.fluent.models.ManagementPolicyInner; -import com.azure.resourcemanager.storage.models.ManagementPolicyName; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ManagementPoliciesClient. */ -public final class ManagementPoliciesClientImpl implements ManagementPoliciesClient { - private final ClientLogger logger = new ClientLogger(ManagementPoliciesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final ManagementPoliciesService service; - - /** The service client containing this operation class. */ - private final StorageManagementClientImpl client; - - /** - * Initializes an instance of ManagementPoliciesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ManagementPoliciesClientImpl(StorageManagementClientImpl client) { - this.service = - RestProxy.create(ManagementPoliciesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for StorageManagementClientManagementPolicies to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "StorageManagementCli") - private interface ManagementPoliciesService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" - + "/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("managementPolicyName") ManagementPolicyName managementPolicyName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" - + "/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("managementPolicyName") ManagementPolicyName managementPolicyName, - @BodyParam("application/json") ManagementPolicyInner properties, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" - + "/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("managementPolicyName") ManagementPolicyName managementPolicyName, - Context context); - } - - /** - * Gets the managementpolicy associated with the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the managementpolicy associated with the specified storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String resourceGroupName, String accountName, ManagementPolicyName managementPolicyName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (managementPolicyName == null) { - return Mono - .error(new IllegalArgumentException("Parameter managementPolicyName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - managementPolicyName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the managementpolicy associated with the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the managementpolicy associated with the specified storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String accountName, ManagementPolicyName managementPolicyName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (managementPolicyName == null) { - return Mono - .error(new IllegalArgumentException("Parameter managementPolicyName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - managementPolicyName, - accept, - context); - } - - /** - * Gets the managementpolicy associated with the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the managementpolicy associated with the specified storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync( - String resourceGroupName, String accountName, ManagementPolicyName managementPolicyName) { - return getWithResponseAsync(resourceGroupName, accountName, managementPolicyName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the managementpolicy associated with the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the managementpolicy associated with the specified storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ManagementPolicyInner get( - String resourceGroupName, String accountName, ManagementPolicyName managementPolicyName) { - return getAsync(resourceGroupName, accountName, managementPolicyName).block(); - } - - /** - * Gets the managementpolicy associated with the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the managementpolicy associated with the specified storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String accountName, ManagementPolicyName managementPolicyName, Context context) { - return getWithResponseAsync(resourceGroupName, accountName, managementPolicyName, context).block(); - } - - /** - * Sets the managementpolicy to the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. - * @param properties The ManagementPolicy set to a storage account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Get Storage Account ManagementPolicies operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, - String accountName, - ManagementPolicyName managementPolicyName, - ManagementPolicyInner properties) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (managementPolicyName == null) { - return Mono - .error(new IllegalArgumentException("Parameter managementPolicyName is required and cannot be null.")); - } - if (properties == null) { - return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); - } else { - properties.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - managementPolicyName, - properties, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Sets the managementpolicy to the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. - * @param properties The ManagementPolicy set to a storage account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Get Storage Account ManagementPolicies operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, - String accountName, - ManagementPolicyName managementPolicyName, - ManagementPolicyInner properties, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (managementPolicyName == null) { - return Mono - .error(new IllegalArgumentException("Parameter managementPolicyName is required and cannot be null.")); - } - if (properties == null) { - return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); - } else { - properties.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - managementPolicyName, - properties, - accept, - context); - } - - /** - * Sets the managementpolicy to the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. - * @param properties The ManagementPolicy set to a storage account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Get Storage Account ManagementPolicies operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, - String accountName, - ManagementPolicyName managementPolicyName, - ManagementPolicyInner properties) { - return createOrUpdateWithResponseAsync(resourceGroupName, accountName, managementPolicyName, properties) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Sets the managementpolicy to the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. - * @param properties The ManagementPolicy set to a storage account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Get Storage Account ManagementPolicies operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ManagementPolicyInner createOrUpdate( - String resourceGroupName, - String accountName, - ManagementPolicyName managementPolicyName, - ManagementPolicyInner properties) { - return createOrUpdateAsync(resourceGroupName, accountName, managementPolicyName, properties).block(); - } - - /** - * Sets the managementpolicy to the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. - * @param properties The ManagementPolicy set to a storage account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Get Storage Account ManagementPolicies operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceGroupName, - String accountName, - ManagementPolicyName managementPolicyName, - ManagementPolicyInner properties, - Context context) { - return createOrUpdateWithResponseAsync( - resourceGroupName, accountName, managementPolicyName, properties, context) - .block(); - } - - /** - * Deletes the managementpolicy associated with the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync( - String resourceGroupName, String accountName, ManagementPolicyName managementPolicyName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (managementPolicyName == null) { - return Mono - .error(new IllegalArgumentException("Parameter managementPolicyName is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - managementPolicyName, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the managementpolicy associated with the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String accountName, ManagementPolicyName managementPolicyName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (managementPolicyName == null) { - return Mono - .error(new IllegalArgumentException("Parameter managementPolicyName is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - managementPolicyName, - context); - } - - /** - * Deletes the managementpolicy associated with the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync( - String resourceGroupName, String accountName, ManagementPolicyName managementPolicyName) { - return deleteWithResponseAsync(resourceGroupName, accountName, managementPolicyName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes the managementpolicy associated with the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String accountName, ManagementPolicyName managementPolicyName) { - deleteAsync(resourceGroupName, accountName, managementPolicyName).block(); - } - - /** - * Deletes the managementpolicy associated with the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse( - String resourceGroupName, String accountName, ManagementPolicyName managementPolicyName, Context context) { - return deleteWithResponseAsync(resourceGroupName, accountName, managementPolicyName, context).block(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/ManagementPoliciesImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/ManagementPoliciesImpl.java deleted file mode 100644 index 13d9a7a9c22a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/ManagementPoliciesImpl.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.storage.implementation; - -import com.azure.resourcemanager.resources.fluentcore.model.implementation.WrapperImpl; -import com.azure.resourcemanager.storage.StorageManager; -import com.azure.resourcemanager.storage.fluent.ManagementPoliciesClient; -import com.azure.resourcemanager.storage.models.ManagementPolicies; -import com.azure.resourcemanager.storage.models.ManagementPolicy; -import com.azure.resourcemanager.storage.fluent.models.ManagementPolicyInner; -import com.azure.resourcemanager.storage.models.ManagementPolicyName; -import reactor.core.publisher.Mono; - -public class ManagementPoliciesImpl extends WrapperImpl implements ManagementPolicies { - private final StorageManager manager; - - public ManagementPoliciesImpl(StorageManager manager) { - super(manager.serviceClient().getManagementPolicies()); - this.manager = manager; - } - - public StorageManager manager() { - return this.manager; - } - - @Override - public ManagementPolicyImpl define(String name) { - return wrapModel(name); - } - - private ManagementPolicyImpl wrapModel(ManagementPolicyInner inner) { - return new ManagementPolicyImpl(inner, manager()); - } - - private ManagementPolicyImpl wrapModel(String name) { - return new ManagementPolicyImpl(name, this.manager()); - } - - @Override - public Mono getAsync(String resourceGroupName, String accountName) { - return this.innerModel().getAsync(resourceGroupName, accountName, ManagementPolicyName.DEFAULT) - .map(inner -> wrapModel(inner)); - } - - @Override - public Mono deleteAsync(String resourceGroupName, String accountName) { - return this.innerModel().deleteAsync(resourceGroupName, accountName, ManagementPolicyName.DEFAULT); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/ManagementPolicyImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/ManagementPolicyImpl.java deleted file mode 100644 index 5671f3c56c0f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/ManagementPolicyImpl.java +++ /dev/null @@ -1,259 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.storage.implementation; - -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.resources.fluentcore.model.implementation.CreatableUpdatableImpl; -import com.azure.resourcemanager.storage.StorageManager; -import com.azure.resourcemanager.storage.fluent.ManagementPoliciesClient; -import com.azure.resourcemanager.storage.models.BlobTypes; -import com.azure.resourcemanager.storage.models.ManagementPolicy; -import com.azure.resourcemanager.storage.models.ManagementPolicyBaseBlob; -import com.azure.resourcemanager.storage.models.ManagementPolicyName; -import com.azure.resourcemanager.storage.models.ManagementPolicyRule; -import com.azure.resourcemanager.storage.models.ManagementPolicySchema; -import com.azure.resourcemanager.storage.models.ManagementPolicySnapShot; -import com.azure.resourcemanager.storage.models.PolicyRule; -import com.azure.resourcemanager.storage.fluent.models.ManagementPolicyInner; -import java.time.OffsetDateTime; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import reactor.core.publisher.Mono; - -class ManagementPolicyImpl extends CreatableUpdatableImpl - implements ManagementPolicy, ManagementPolicy.Definition, ManagementPolicy.Update { - private final ClientLogger logger = new ClientLogger(getClass()); - private final StorageManager manager; - private String resourceGroupName; - private String accountName; - private ManagementPolicySchema cpolicy; - private ManagementPolicySchema upolicy; - - ManagementPolicyImpl(String name, StorageManager manager) { - super(name, new ManagementPolicyInner()); - this.manager = manager; - // Set resource name - this.accountName = name; - // - this.cpolicy = new ManagementPolicySchema(); - this.upolicy = new ManagementPolicySchema(); - } - - ManagementPolicyImpl(ManagementPolicyInner inner, StorageManager manager) { - super(inner.name(), inner); - this.manager = manager; - // Set resource name - this.accountName = inner.name(); - // set resource ancestor and positional variables - this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); - this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "storageAccounts"); - // - this.cpolicy = new ManagementPolicySchema(); - this.upolicy = new ManagementPolicySchema(); - } - - @Override - public StorageManager manager() { - return this.manager; - } - - @Override - public Mono createResourceAsync() { - ManagementPoliciesClient client = this.manager().serviceClient().getManagementPolicies(); - return client - .createOrUpdateAsync(this.resourceGroupName, this.accountName, ManagementPolicyName.DEFAULT, - new ManagementPolicyInner().withPolicy(cpolicy)) - .map( - resource -> { - resetCreateUpdateParameters(); - return resource; - }) - .map(innerToFluentMap(this)); - } - - @Override - public Mono updateResourceAsync() { - ManagementPoliciesClient client = this.manager().serviceClient().getManagementPolicies(); - return client - .createOrUpdateAsync(this.resourceGroupName, this.accountName, ManagementPolicyName.DEFAULT, - new ManagementPolicyInner().withPolicy(upolicy)) - .map( - resource -> { - resetCreateUpdateParameters(); - return resource; - }) - .map(innerToFluentMap(this)); - } - - @Override - protected Mono getInnerAsync() { - ManagementPoliciesClient client = this.manager().serviceClient().getManagementPolicies(); - return client.getAsync(this.resourceGroupName, this.accountName, ManagementPolicyName.DEFAULT); - } - - @Override - public boolean isInCreateMode() { - return this.innerModel().id() == null; - } - - private void resetCreateUpdateParameters() { - this.cpolicy = new ManagementPolicySchema(); - this.upolicy = new ManagementPolicySchema(); - } - - @Override - public String id() { - return this.innerModel().id(); - } - - @Override - public OffsetDateTime lastModifiedTime() { - return this.innerModel().lastModifiedTime(); - } - - @Override - public String name() { - return this.innerModel().name(); - } - - @Override - public ManagementPolicySchema policy() { - return this.innerModel().policy(); - } - - @Override - public String type() { - return this.innerModel().type(); - } - - @Override - public List rules() { - List originalRules = this.policy().rules(); - List returnRules = new ArrayList<>(); - for (ManagementPolicyRule originalRule : originalRules) { - List originalBlobTypes = originalRule.definition().filters().blobTypes(); - List returnBlobTypes = new ArrayList<>(); - for (String originalBlobType : originalBlobTypes) { - returnBlobTypes.add(BlobTypes.fromString(originalBlobType)); - } - PolicyRule returnRule = - new PolicyRuleImpl(originalRule.name()) - .withLifecycleRuleType() - .withBlobTypesToFilterFor(returnBlobTypes); - - // building up prefixes to filter on - if (originalRule.definition().filters().prefixMatch() != null) { - ((PolicyRuleImpl) returnRule) - .withPrefixesToFilterFor(originalRule.definition().filters().prefixMatch()); - } - - // building up actions on base blob - ManagementPolicyBaseBlob originalBaseBlobActions = originalRule.definition().actions().baseBlob(); - if (originalBaseBlobActions != null) { - if (originalBaseBlobActions.tierToCool() != null) { - ((PolicyRuleImpl) returnRule) - .withTierToCoolActionOnBaseBlob( - originalBaseBlobActions.tierToCool().daysAfterModificationGreaterThan()); - } - if (originalBaseBlobActions.tierToArchive() != null) { - ((PolicyRuleImpl) returnRule) - .withTierToArchiveActionOnBaseBlob( - originalBaseBlobActions.tierToArchive().daysAfterModificationGreaterThan()); - } - if (originalBaseBlobActions.delete() != null) { - ((PolicyRuleImpl) returnRule) - .withDeleteActionOnBaseBlob( - originalBaseBlobActions.delete().daysAfterModificationGreaterThan()); - } - } - - // build up actions on snapshot - ManagementPolicySnapShot originalSnapshotActions = originalRule.definition().actions().snapshot(); - if (originalSnapshotActions != null) { - if (originalSnapshotActions.delete() != null) { - ((PolicyRuleImpl) returnRule) - .withDeleteActionOnSnapShot(originalSnapshotActions.delete().daysAfterCreationGreaterThan()); - } - } - returnRules.add(returnRule); - } - return Collections.unmodifiableList(returnRules); - } - - @Override - public ManagementPolicyImpl withExistingStorageAccount(String resourceGroupName, String accountName) { - this.resourceGroupName = resourceGroupName; - this.accountName = accountName; - return this; - } - - @Override - public ManagementPolicyImpl withPolicy(ManagementPolicySchema policy) { - if (isInCreateMode()) { - this.cpolicy = policy; - } else { - this.upolicy = policy; - } - return this; - } - - @Override - public PolicyRule.DefinitionStages.Blank defineRule(String name) { - return new PolicyRuleImpl(this, name); - } - - void defineRule(PolicyRuleImpl policyRuleImpl) { - if (isInCreateMode()) { - if (this.cpolicy.rules() == null) { - this.cpolicy.withRules(new ArrayList()); - } - List rules = this.cpolicy.rules(); - rules.add(policyRuleImpl.innerModel()); - this.cpolicy.withRules(rules); - } else { - if (this.upolicy.rules() == null) { - this.upolicy.withRules(new ArrayList()); - } - List rules = this.upolicy.rules(); - rules.add(policyRuleImpl.innerModel()); - this.upolicy.withRules(rules); - } - } - - @Override - public PolicyRule.Update updateRule(String name) { - ManagementPolicyRule ruleToUpdate = null; - for (ManagementPolicyRule rule : this.policy().rules()) { - if (rule.name().equals(name)) { - ruleToUpdate = rule; - } - } - if (ruleToUpdate == null) { - throw logger.logExceptionAsError(new UnsupportedOperationException( - "There is no rule that exists with the name " - + name - + ". Please define a rule with this name before updating.")); - } - return new PolicyRuleImpl(ruleToUpdate, this); - } - - @Override - public Update withoutRule(String name) { - ManagementPolicyRule ruleToDelete = null; - for (ManagementPolicyRule rule : this.policy().rules()) { - if (rule.name().equals(name)) { - ruleToDelete = rule; - } - } - if (ruleToDelete == null) { - throw logger.logExceptionAsError(new UnsupportedOperationException( - "There is no rule that exists with the name " + name + " so this rule can not be deleted.")); - } - List currentRules = this.upolicy.rules(); - currentRules.remove(ruleToDelete); - this.upolicy.withRules(currentRules); - return this; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/ObjectReplicationPoliciesOperationsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/ObjectReplicationPoliciesOperationsClientImpl.java deleted file mode 100644 index 94537ee35376..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/ObjectReplicationPoliciesOperationsClientImpl.java +++ /dev/null @@ -1,884 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.storage.fluent.ObjectReplicationPoliciesOperationsClient; -import com.azure.resourcemanager.storage.fluent.models.ObjectReplicationPolicyInner; -import com.azure.resourcemanager.storage.models.ObjectReplicationPolicies; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in ObjectReplicationPoliciesOperationsClient. - */ -public final class ObjectReplicationPoliciesOperationsClientImpl implements ObjectReplicationPoliciesOperationsClient { - private final ClientLogger logger = new ClientLogger(ObjectReplicationPoliciesOperationsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final ObjectReplicationPoliciesOperationsService service; - - /** The service client containing this operation class. */ - private final StorageManagementClientImpl client; - - /** - * Initializes an instance of ObjectReplicationPoliciesOperationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ObjectReplicationPoliciesOperationsClientImpl(StorageManagementClientImpl client) { - this.service = - RestProxy - .create( - ObjectReplicationPoliciesOperationsService.class, - client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for StorageManagementClientObjectReplicationPoliciesOperations to be used - * by the proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "StorageManagementCli") - private interface ObjectReplicationPoliciesOperationsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" - + "/storageAccounts/{accountName}/objectReplicationPolicies") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" - + "/storageAccounts/{accountName}/objectReplicationPolicies/{objectReplicationPolicyId}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("objectReplicationPolicyId") String objectReplicationPolicyId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" - + "/storageAccounts/{accountName}/objectReplicationPolicies/{objectReplicationPolicyId}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("objectReplicationPolicyId") String objectReplicationPolicyId, - @BodyParam("application/json") ObjectReplicationPolicyInner properties, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" - + "/storageAccounts/{accountName}/objectReplicationPolicies/{objectReplicationPolicyId}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("objectReplicationPolicyId") String objectReplicationPolicyId, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * List the object replication policies associated with the storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list storage account object replication policies. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String accountName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List the object replication policies associated with the storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list storage account object replication policies. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String accountName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); - } - - /** - * List the object replication policies associated with the storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list storage account object replication policies. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String resourceGroupName, String accountName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName)); - } - - /** - * List the object replication policies associated with the storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list storage account object replication policies. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String accountName, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName, context)); - } - - /** - * List the object replication policies associated with the storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list storage account object replication policies. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String accountName) { - return new PagedIterable<>(listAsync(resourceGroupName, accountName)); - } - - /** - * List the object replication policies associated with the storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list storage account object replication policies. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, String accountName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, accountName, context)); - } - - /** - * Get the object replication policy of the storage account by policy ID. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param objectReplicationPolicyId The ID of object replication policy or 'default' if the policy ID is unknown. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the object replication policy of the storage account by policy ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String resourceGroupName, String accountName, String objectReplicationPolicyId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (objectReplicationPolicyId == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter objectReplicationPolicyId is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - objectReplicationPolicyId, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the object replication policy of the storage account by policy ID. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param objectReplicationPolicyId The ID of object replication policy or 'default' if the policy ID is unknown. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the object replication policy of the storage account by policy ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String accountName, String objectReplicationPolicyId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (objectReplicationPolicyId == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter objectReplicationPolicyId is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - objectReplicationPolicyId, - accept, - context); - } - - /** - * Get the object replication policy of the storage account by policy ID. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param objectReplicationPolicyId The ID of object replication policy or 'default' if the policy ID is unknown. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the object replication policy of the storage account by policy ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync( - String resourceGroupName, String accountName, String objectReplicationPolicyId) { - return getWithResponseAsync(resourceGroupName, accountName, objectReplicationPolicyId) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get the object replication policy of the storage account by policy ID. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param objectReplicationPolicyId The ID of object replication policy or 'default' if the policy ID is unknown. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the object replication policy of the storage account by policy ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ObjectReplicationPolicyInner get( - String resourceGroupName, String accountName, String objectReplicationPolicyId) { - return getAsync(resourceGroupName, accountName, objectReplicationPolicyId).block(); - } - - /** - * Get the object replication policy of the storage account by policy ID. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param objectReplicationPolicyId The ID of object replication policy or 'default' if the policy ID is unknown. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the object replication policy of the storage account by policy ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String accountName, String objectReplicationPolicyId, Context context) { - return getWithResponseAsync(resourceGroupName, accountName, objectReplicationPolicyId, context).block(); - } - - /** - * Create or update the object replication policy of the storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param objectReplicationPolicyId The ID of object replication policy or 'default' if the policy ID is unknown. - * @param properties The object replication policy set to a storage account. A unique policy ID will be created if - * absent. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the replication policy between two storage accounts. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, - String accountName, - String objectReplicationPolicyId, - ObjectReplicationPolicyInner properties) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (objectReplicationPolicyId == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter objectReplicationPolicyId is required and cannot be null.")); - } - if (properties == null) { - return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); - } else { - properties.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - objectReplicationPolicyId, - properties, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create or update the object replication policy of the storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param objectReplicationPolicyId The ID of object replication policy or 'default' if the policy ID is unknown. - * @param properties The object replication policy set to a storage account. A unique policy ID will be created if - * absent. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the replication policy between two storage accounts. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, - String accountName, - String objectReplicationPolicyId, - ObjectReplicationPolicyInner properties, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (objectReplicationPolicyId == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter objectReplicationPolicyId is required and cannot be null.")); - } - if (properties == null) { - return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); - } else { - properties.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - objectReplicationPolicyId, - properties, - accept, - context); - } - - /** - * Create or update the object replication policy of the storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param objectReplicationPolicyId The ID of object replication policy or 'default' if the policy ID is unknown. - * @param properties The object replication policy set to a storage account. A unique policy ID will be created if - * absent. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the replication policy between two storage accounts. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, - String accountName, - String objectReplicationPolicyId, - ObjectReplicationPolicyInner properties) { - return createOrUpdateWithResponseAsync(resourceGroupName, accountName, objectReplicationPolicyId, properties) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Create or update the object replication policy of the storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param objectReplicationPolicyId The ID of object replication policy or 'default' if the policy ID is unknown. - * @param properties The object replication policy set to a storage account. A unique policy ID will be created if - * absent. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the replication policy between two storage accounts. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ObjectReplicationPolicyInner createOrUpdate( - String resourceGroupName, - String accountName, - String objectReplicationPolicyId, - ObjectReplicationPolicyInner properties) { - return createOrUpdateAsync(resourceGroupName, accountName, objectReplicationPolicyId, properties).block(); - } - - /** - * Create or update the object replication policy of the storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param objectReplicationPolicyId The ID of object replication policy or 'default' if the policy ID is unknown. - * @param properties The object replication policy set to a storage account. A unique policy ID will be created if - * absent. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the replication policy between two storage accounts. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceGroupName, - String accountName, - String objectReplicationPolicyId, - ObjectReplicationPolicyInner properties, - Context context) { - return createOrUpdateWithResponseAsync( - resourceGroupName, accountName, objectReplicationPolicyId, properties, context) - .block(); - } - - /** - * Deletes the object replication policy associated with the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param objectReplicationPolicyId The ID of object replication policy or 'default' if the policy ID is unknown. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync( - String resourceGroupName, String accountName, String objectReplicationPolicyId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (objectReplicationPolicyId == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter objectReplicationPolicyId is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - objectReplicationPolicyId, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the object replication policy associated with the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param objectReplicationPolicyId The ID of object replication policy or 'default' if the policy ID is unknown. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String accountName, String objectReplicationPolicyId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (objectReplicationPolicyId == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter objectReplicationPolicyId is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - objectReplicationPolicyId, - accept, - context); - } - - /** - * Deletes the object replication policy associated with the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param objectReplicationPolicyId The ID of object replication policy or 'default' if the policy ID is unknown. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String accountName, String objectReplicationPolicyId) { - return deleteWithResponseAsync(resourceGroupName, accountName, objectReplicationPolicyId) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes the object replication policy associated with the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param objectReplicationPolicyId The ID of object replication policy or 'default' if the policy ID is unknown. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String accountName, String objectReplicationPolicyId) { - deleteAsync(resourceGroupName, accountName, objectReplicationPolicyId).block(); - } - - /** - * Deletes the object replication policy associated with the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param objectReplicationPolicyId The ID of object replication policy or 'default' if the policy ID is unknown. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse( - String resourceGroupName, String accountName, String objectReplicationPolicyId, Context context) { - return deleteWithResponseAsync(resourceGroupName, accountName, objectReplicationPolicyId, context).block(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/OperationsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/OperationsClientImpl.java deleted file mode 100644 index df9a612d941f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/OperationsClientImpl.java +++ /dev/null @@ -1,176 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.storage.fluent.OperationsClient; -import com.azure.resourcemanager.storage.fluent.models.OperationInner; -import com.azure.resourcemanager.storage.models.OperationListResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in OperationsClient. */ -public final class OperationsClientImpl implements OperationsClient { - private final ClientLogger logger = new ClientLogger(OperationsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final OperationsService service; - - /** The service client containing this operation class. */ - private final StorageManagementClientImpl client; - - /** - * Initializes an instance of OperationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - OperationsClientImpl(StorageManagementClientImpl client) { - this.service = - RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for StorageManagementClientOperations to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "StorageManagementCli") - private interface OperationsService { - @Headers({"Content-Type: application/json"}) - @Get("/providers/Microsoft.Storage/operations") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Lists all of the available Storage Rest API operations. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Storage operations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all of the available Storage Rest API operations. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Storage operations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); - } - - /** - * Lists all of the available Storage Rest API operations. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Storage operations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync()); - } - - /** - * Lists all of the available Storage Rest API operations. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Storage operations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context)); - } - - /** - * Lists all of the available Storage Rest API operations. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Storage operations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Lists all of the available Storage Rest API operations. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Storage operations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/PolicyRuleImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/PolicyRuleImpl.java deleted file mode 100644 index 33f6d0688aca..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/PolicyRuleImpl.java +++ /dev/null @@ -1,309 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.storage.implementation; - -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.storage.models.BlobTypes; -import com.azure.resourcemanager.storage.models.DateAfterCreation; -import com.azure.resourcemanager.storage.models.DateAfterModification; -import com.azure.resourcemanager.storage.models.ManagementPolicy; -import com.azure.resourcemanager.storage.models.ManagementPolicyAction; -import com.azure.resourcemanager.storage.models.ManagementPolicyBaseBlob; -import com.azure.resourcemanager.storage.models.ManagementPolicyDefinition; -import com.azure.resourcemanager.storage.models.ManagementPolicyFilter; -import com.azure.resourcemanager.storage.models.ManagementPolicyRule; -import com.azure.resourcemanager.storage.models.ManagementPolicySnapShot; -import com.azure.resourcemanager.storage.models.PolicyRule; -import com.azure.resourcemanager.storage.models.RuleType; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -class PolicyRuleImpl implements PolicyRule, PolicyRule.Definition, PolicyRule.Update, HasInnerModel { - - private ManagementPolicyRule inner; - private ManagementPolicyImpl managementPolicyImpl; - - PolicyRuleImpl(ManagementPolicyImpl managementPolicyImpl, String name) { - this.inner = new ManagementPolicyRule(); - this.inner.withDefinition(new ManagementPolicyDefinition()); - this.inner.definition().withFilters(new ManagementPolicyFilter()); - this.inner.definition().withActions(new ManagementPolicyAction()); - this.managementPolicyImpl = managementPolicyImpl; - this.inner.withName(name); - } - - PolicyRuleImpl(String name) { - this.inner = new ManagementPolicyRule(); - this.inner.withDefinition(new ManagementPolicyDefinition()); - this.inner.definition().withFilters(new ManagementPolicyFilter()); - this.inner.definition().withActions(new ManagementPolicyAction()); - this.inner.withName(name); - } - - PolicyRuleImpl(ManagementPolicyRule managementPolicyRule, ManagementPolicyImpl managementPolicyImpl) { - this.inner = managementPolicyRule; - this.managementPolicyImpl = managementPolicyImpl; - } - - @Override - public String name() { - return this.inner.name(); - } - - @Override - public RuleType type() { - return this.inner.type(); - } - - @Override - public List blobTypesToFilterFor() { - List blobTypes = new ArrayList<>(); - for (String blobTypeString : this.inner.definition().filters().blobTypes()) { - blobTypes.add(BlobTypes.fromString(blobTypeString)); - } - return Collections.unmodifiableList(blobTypes); - } - - @Override - public List prefixesToFilterFor() { - return Collections.unmodifiableList(this.inner.definition().filters().prefixMatch()); - } - - @Override - public ManagementPolicyBaseBlob actionsOnBaseBlob() { - return this.inner.definition().actions().baseBlob(); - } - - @Override - public ManagementPolicySnapShot actionsOnSnapShot() { - return this.inner.definition().actions().snapshot(); - } - - @Override - public boolean tierToCoolActionOnBaseBlobEnabled() { - if (this.inner.definition().actions().baseBlob() == null) { - return false; - } - return this.inner.definition().actions().baseBlob().tierToCool() != null; - } - - @Override - public boolean tierToArchiveActionOnBaseBlobEnabled() { - if (this.inner.definition().actions().baseBlob() == null) { - return false; - } - return this.inner.definition().actions().baseBlob().tierToArchive() != null; - } - - @Override - public boolean deleteActionOnBaseBlobEnabled() { - if (this.inner.definition().actions().baseBlob() == null) { - return false; - } - return this.inner.definition().actions().baseBlob().delete() != null; - } - - @Override - public boolean deleteActionOnSnapShotEnabled() { - if (this.inner.definition().actions().snapshot() == null) { - return false; - } - return this.inner.definition().actions().snapshot().delete() != null; - } - - @Override - public Float daysAfterBaseBlobModificationUntilCooling() { - if (this.inner.definition().actions().baseBlob() == null - || this.inner.definition().actions().baseBlob().tierToCool() == null) { - return null; - } - return this.inner.definition().actions().baseBlob().tierToCool().daysAfterModificationGreaterThan(); - } - - @Override - public Float daysAfterBaseBlobModificationUntilArchiving() { - if (this.inner.definition().actions().baseBlob() == null - || this.inner.definition().actions().baseBlob().tierToArchive() == null) { - return null; - } - return this.inner.definition().actions().baseBlob().tierToArchive().daysAfterModificationGreaterThan(); - } - - @Override - public Float daysAfterBaseBlobModificationUntilDeleting() { - if (this.inner.definition().actions().baseBlob() == null - || this.inner.definition().actions().baseBlob().delete() == null) { - return null; - } - return this.inner.definition().actions().baseBlob().delete().daysAfterModificationGreaterThan(); - } - - @Override - public Float daysAfterSnapShotCreationUntilDeleting() { - if (this.inner.definition().actions().snapshot() == null - || this.inner.definition().actions().snapshot().delete() == null) { - return null; - } - return this.inner.definition().actions().snapshot().delete().daysAfterCreationGreaterThan(); - } - - @Override - public ManagementPolicyRule innerModel() { - return this.inner; - } - - @Override - public PolicyRuleImpl withLifecycleRuleType() { - this.inner.withType(RuleType.LIFECYCLE); - return this; - } - - @Override - public PolicyRuleImpl withBlobTypesToFilterFor(List blobTypes) { - List blobTypesString = new ArrayList<>(); - for (BlobTypes blobType : blobTypes) { - blobTypesString.add(blobType.toString()); - } - this.inner.definition().filters().withBlobTypes(blobTypesString); - return this; - } - - @Override - public PolicyRuleImpl withBlobTypeToFilterFor(BlobTypes blobType) { - List blobTypesToFilterFor = this.inner.definition().filters().blobTypes(); - if (blobTypesToFilterFor == null) { - blobTypesToFilterFor = new ArrayList<>(); - } - if (blobTypesToFilterFor.contains(blobType.toString())) { - return this; - } - blobTypesToFilterFor.add(blobType.toString()); - this.inner.definition().filters().withBlobTypes(blobTypesToFilterFor); - return this; - } - - @Override - public Update withBlobTypeToFilterForRemoved(BlobTypes blobType) { - List blobTypesToFilterFor = this.inner.definition().filters().blobTypes(); - blobTypesToFilterFor.remove(blobType.toString()); - this.inner.definition().filters().withBlobTypes(blobTypesToFilterFor); - return this; - } - - @Override - public PolicyRuleImpl withPrefixesToFilterFor(List prefixes) { - this.inner.definition().filters().withPrefixMatch(prefixes); - return this; - } - - @Override - public PolicyRuleImpl withPrefixToFilterFor(String prefix) { - List prefixesToFilterFor = this.inner.definition().filters().prefixMatch(); - if (prefixesToFilterFor == null) { - prefixesToFilterFor = new ArrayList<>(); - } - if (prefixesToFilterFor.contains(prefix)) { - return this; - } - prefixesToFilterFor.add(prefix); - this.inner.definition().filters().withPrefixMatch(prefixesToFilterFor); - return this; - } - - @Override - public Update withoutPrefixesToFilterFor() { - this.inner.definition().filters().withPrefixMatch(null); - return this; - } - - @Override - public PolicyRuleImpl withTierToCoolActionOnBaseBlob(float daysAfterBaseBlobModificationUntilCooling) { - ManagementPolicyBaseBlob currentBaseBlob = this.inner.definition().actions().baseBlob(); - if (currentBaseBlob == null) { - currentBaseBlob = new ManagementPolicyBaseBlob(); - } - currentBaseBlob - .withTierToCool( - new DateAfterModification() - .withDaysAfterModificationGreaterThan(daysAfterBaseBlobModificationUntilCooling)); - this.inner.definition().actions().withBaseBlob(currentBaseBlob); - return this; - } - - @Override - public PolicyRuleImpl withTierToArchiveActionOnBaseBlob(float daysAfterBaseBlobModificationUntilArchiving) { - ManagementPolicyBaseBlob currentBaseBlob = this.inner.definition().actions().baseBlob(); - if (currentBaseBlob == null) { - currentBaseBlob = new ManagementPolicyBaseBlob(); - } - currentBaseBlob - .withTierToArchive( - new DateAfterModification() - .withDaysAfterModificationGreaterThan(daysAfterBaseBlobModificationUntilArchiving)); - this.inner.definition().actions().withBaseBlob(currentBaseBlob); - return this; - } - - @Override - public PolicyRuleImpl withDeleteActionOnBaseBlob(float daysAfterBaseBlobModificationUntilDeleting) { - ManagementPolicyBaseBlob currentBaseBlob = this.inner.definition().actions().baseBlob(); - if (currentBaseBlob == null) { - currentBaseBlob = new ManagementPolicyBaseBlob(); - } - currentBaseBlob - .withDelete( - new DateAfterModification() - .withDaysAfterModificationGreaterThan(daysAfterBaseBlobModificationUntilDeleting)); - this.inner.definition().actions().withBaseBlob(currentBaseBlob); - return this; - } - - @Override - public PolicyRuleImpl withDeleteActionOnSnapShot(float daysAfterSnapShotCreationUntilDeleting) { - ManagementPolicySnapShot currentSnapShot = new ManagementPolicySnapShot(); - currentSnapShot - .withDelete( - new DateAfterCreation().withDaysAfterCreationGreaterThan(daysAfterSnapShotCreationUntilDeleting)); - this.inner.definition().actions().withSnapshot(currentSnapShot); - return this; - } - - @Override - public DefinitionStages.WithPolicyRuleAttachable withActionsOnBaseBlob(ManagementPolicyBaseBlob baseBlobActions) { - this.inner.definition().actions().withBaseBlob(baseBlobActions); - return this; - } - - @Override - public DefinitionStages.WithPolicyRuleAttachable withActionsOnSnapShot(ManagementPolicySnapShot snapShotActions) { - this.inner.definition().actions().withSnapshot(snapShotActions); - return this; - } - - @Override - public Update updateActionsOnBaseBlob(ManagementPolicyBaseBlob baseBlobActions) { - this.inner.definition().actions().withBaseBlob(baseBlobActions); - return this; - } - - @Override - public Update updateActionsOnSnapShot(ManagementPolicySnapShot snapShotActions) { - this.inner.definition().actions().withSnapshot(snapShotActions); - return this; - } - - @Override - public ManagementPolicyImpl attach() { - this.managementPolicyImpl.defineRule(this); - return this.managementPolicyImpl; - } - - @Override - public ManagementPolicy.Update parent() { - this.managementPolicyImpl.defineRule(this); - return this.managementPolicyImpl; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/PrivateEndpointConnectionsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/PrivateEndpointConnectionsClientImpl.java deleted file mode 100644 index 572aa01b958f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/PrivateEndpointConnectionsClientImpl.java +++ /dev/null @@ -1,889 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.storage.fluent.PrivateEndpointConnectionsClient; -import com.azure.resourcemanager.storage.fluent.models.PrivateEndpointConnectionInner; -import com.azure.resourcemanager.storage.models.PrivateEndpointConnectionListResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. */ -public final class PrivateEndpointConnectionsClientImpl implements PrivateEndpointConnectionsClient { - private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final PrivateEndpointConnectionsService service; - - /** The service client containing this operation class. */ - private final StorageManagementClientImpl client; - - /** - * Initializes an instance of PrivateEndpointConnectionsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - PrivateEndpointConnectionsClientImpl(StorageManagementClientImpl client) { - this.service = - RestProxy - .create( - PrivateEndpointConnectionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for StorageManagementClientPrivateEndpointConnections to be used by the - * proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "StorageManagementCli") - private interface PrivateEndpointConnectionsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" - + "/storageAccounts/{accountName}/privateEndpointConnections") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" - + "/storageAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" - + "/storageAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> put( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, - @BodyParam("application/json") PrivateEndpointConnectionInner properties, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" - + "/storageAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * List all the private endpoint connections associated with the storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connection associated with the specified storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String accountName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List all the private endpoint connections associated with the storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connection associated with the specified storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String accountName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); - } - - /** - * List all the private endpoint connections associated with the storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connection associated with the specified storage account. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String resourceGroupName, String accountName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName)); - } - - /** - * List all the private endpoint connections associated with the storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connection associated with the specified storage account. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String accountName, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName, context)); - } - - /** - * List all the private endpoint connections associated with the storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connection associated with the specified storage account. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String accountName) { - return new PagedIterable<>(listAsync(resourceGroupName, accountName)); - } - - /** - * List all the private endpoint connections associated with the storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connection associated with the specified storage account. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, String accountName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, accountName, context)); - } - - /** - * Gets the specified private endpoint connection associated with the storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private endpoint connection associated with the storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String resourceGroupName, String accountName, String privateEndpointConnectionName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - privateEndpointConnectionName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the specified private endpoint connection associated with the storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private endpoint connection associated with the storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String accountName, String privateEndpointConnectionName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - privateEndpointConnectionName, - accept, - context); - } - - /** - * Gets the specified private endpoint connection associated with the storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private endpoint connection associated with the storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync( - String resourceGroupName, String accountName, String privateEndpointConnectionName) { - return getWithResponseAsync(resourceGroupName, accountName, privateEndpointConnectionName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the specified private endpoint connection associated with the storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private endpoint connection associated with the storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateEndpointConnectionInner get( - String resourceGroupName, String accountName, String privateEndpointConnectionName) { - return getAsync(resourceGroupName, accountName, privateEndpointConnectionName).block(); - } - - /** - * Gets the specified private endpoint connection associated with the storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private endpoint connection associated with the storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String accountName, String privateEndpointConnectionName, Context context) { - return getWithResponseAsync(resourceGroupName, accountName, privateEndpointConnectionName, context).block(); - } - - /** - * Update the state of specified private endpoint connection associated with the storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. - * @param properties The private endpoint connection properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Private Endpoint Connection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> putWithResponseAsync( - String resourceGroupName, - String accountName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner properties) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); - } - if (properties == null) { - return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); - } else { - properties.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .put( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - privateEndpointConnectionName, - properties, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Update the state of specified private endpoint connection associated with the storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. - * @param properties The private endpoint connection properties. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Private Endpoint Connection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> putWithResponseAsync( - String resourceGroupName, - String accountName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner properties, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); - } - if (properties == null) { - return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); - } else { - properties.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .put( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - privateEndpointConnectionName, - properties, - accept, - context); - } - - /** - * Update the state of specified private endpoint connection associated with the storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. - * @param properties The private endpoint connection properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Private Endpoint Connection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono putAsync( - String resourceGroupName, - String accountName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner properties) { - return putWithResponseAsync(resourceGroupName, accountName, privateEndpointConnectionName, properties) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Update the state of specified private endpoint connection associated with the storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. - * @param properties The private endpoint connection properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Private Endpoint Connection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateEndpointConnectionInner put( - String resourceGroupName, - String accountName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner properties) { - return putAsync(resourceGroupName, accountName, privateEndpointConnectionName, properties).block(); - } - - /** - * Update the state of specified private endpoint connection associated with the storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. - * @param properties The private endpoint connection properties. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Private Endpoint Connection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response putWithResponse( - String resourceGroupName, - String accountName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner properties, - Context context) { - return putWithResponseAsync(resourceGroupName, accountName, privateEndpointConnectionName, properties, context) - .block(); - } - - /** - * Deletes the specified private endpoint connection associated with the storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync( - String resourceGroupName, String accountName, String privateEndpointConnectionName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - privateEndpointConnectionName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the specified private endpoint connection associated with the storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String accountName, String privateEndpointConnectionName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - privateEndpointConnectionName, - accept, - context); - } - - /** - * Deletes the specified private endpoint connection associated with the storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String accountName, String privateEndpointConnectionName) { - return deleteWithResponseAsync(resourceGroupName, accountName, privateEndpointConnectionName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes the specified private endpoint connection associated with the storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String accountName, String privateEndpointConnectionName) { - deleteAsync(resourceGroupName, accountName, privateEndpointConnectionName).block(); - } - - /** - * Deletes the specified private endpoint connection associated with the storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse( - String resourceGroupName, String accountName, String privateEndpointConnectionName, Context context) { - return deleteWithResponseAsync(resourceGroupName, accountName, privateEndpointConnectionName, context).block(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/PrivateLinkResourcesClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/PrivateLinkResourcesClientImpl.java deleted file mode 100644 index bc97d3e9d726..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/PrivateLinkResourcesClientImpl.java +++ /dev/null @@ -1,233 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.storage.fluent.PrivateLinkResourcesClient; -import com.azure.resourcemanager.storage.fluent.models.PrivateLinkResourceListResultInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. */ -public final class PrivateLinkResourcesClientImpl implements PrivateLinkResourcesClient { - private final ClientLogger logger = new ClientLogger(PrivateLinkResourcesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final PrivateLinkResourcesService service; - - /** The service client containing this operation class. */ - private final StorageManagementClientImpl client; - - /** - * Initializes an instance of PrivateLinkResourcesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - PrivateLinkResourcesClientImpl(StorageManagementClientImpl client) { - this.service = - RestProxy - .create(PrivateLinkResourcesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for StorageManagementClientPrivateLinkResources to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "StorageManagementCli") - private interface PrivateLinkResourcesService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" - + "/storageAccounts/{accountName}/privateLinkResources") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByStorageAccount( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets the private link resources that need to be created for a storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources that need to be created for a storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listByStorageAccountWithResponseAsync( - String resourceGroupName, String accountName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByStorageAccount( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the private link resources that need to be created for a storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources that need to be created for a storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByStorageAccountWithResponseAsync( - String resourceGroupName, String accountName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByStorageAccount( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets the private link resources that need to be created for a storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources that need to be created for a storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listByStorageAccountAsync( - String resourceGroupName, String accountName) { - return listByStorageAccountWithResponseAsync(resourceGroupName, accountName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the private link resources that need to be created for a storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources that need to be created for a storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateLinkResourceListResultInner listByStorageAccount(String resourceGroupName, String accountName) { - return listByStorageAccountAsync(resourceGroupName, accountName).block(); - } - - /** - * Gets the private link resources that need to be created for a storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources that need to be created for a storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listByStorageAccountWithResponse( - String resourceGroupName, String accountName, Context context) { - return listByStorageAccountWithResponseAsync(resourceGroupName, accountName, context).block(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/QueueServiceEncryptionStatusImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/QueueServiceEncryptionStatusImpl.java deleted file mode 100644 index f6ccc8240fdb..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/QueueServiceEncryptionStatusImpl.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.storage.implementation; - -import com.azure.resourcemanager.storage.models.EncryptionService; -import com.azure.resourcemanager.storage.models.EncryptionServices; -import com.azure.resourcemanager.storage.models.StorageService; - -/** Implementation of StorageAccountEncryptionStatus for Queue service. */ -class QueueServiceEncryptionStatusImpl extends StorageAccountEncryptionStatusImpl { - QueueServiceEncryptionStatusImpl(EncryptionServices encryptionServices) { - super(encryptionServices); - } - - @Override - public StorageService storageService() { - return StorageService.QUEUE; - } - - @Override - protected EncryptionService encryptionService() { - if (super.encryptionServices == null) { - return null; - } else { - return super.encryptionServices.queue(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/QueueServicesClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/QueueServicesClientImpl.java deleted file mode 100644 index b4bfb2b71082..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/QueueServicesClientImpl.java +++ /dev/null @@ -1,631 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.storage.fluent.QueueServicesClient; -import com.azure.resourcemanager.storage.fluent.models.ListQueueServicesInner; -import com.azure.resourcemanager.storage.fluent.models.QueueServicePropertiesInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in QueueServicesClient. */ -public final class QueueServicesClientImpl implements QueueServicesClient { - private final ClientLogger logger = new ClientLogger(QueueServicesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final QueueServicesService service; - - /** The service client containing this operation class. */ - private final StorageManagementClientImpl client; - - /** - * Initializes an instance of QueueServicesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - QueueServicesClientImpl(StorageManagementClientImpl client) { - this.service = - RestProxy.create(QueueServicesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for StorageManagementClientQueueServices to be used by the proxy service - * to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "StorageManagementCli") - private interface QueueServicesService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" - + "/storageAccounts/{accountName}/queueServices") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" - + "/storageAccounts/{accountName}/queueServices/{queueServiceName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> setServiceProperties( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("queueServiceName") String queueServiceName, - @BodyParam("application/json") QueueServicePropertiesInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" - + "/storageAccounts/{accountName}/queueServices/{queueServiceName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getServiceProperties( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("queueServiceName") String queueServiceName, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * List all queue services for the storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listWithResponseAsync(String resourceGroupName, String accountName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List all queue services for the storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync( - String resourceGroupName, String accountName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * List all queue services for the storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listAsync(String resourceGroupName, String accountName) { - return listWithResponseAsync(resourceGroupName, accountName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * List all queue services for the storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ListQueueServicesInner list(String resourceGroupName, String accountName) { - return listAsync(resourceGroupName, accountName).block(); - } - - /** - * List all queue services for the storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse( - String resourceGroupName, String accountName, Context context) { - return listWithResponseAsync(resourceGroupName, accountName, context).block(); - } - - /** - * Sets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The properties of a storage account’s Queue service, only properties for Storage Analytics and - * CORS (Cross-Origin Resource Sharing) rules can be specified. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a storage account’s Queue service. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> setServicePropertiesWithResponseAsync( - String resourceGroupName, String accountName, QueueServicePropertiesInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String queueServiceName = "default"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .setServiceProperties( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - queueServiceName, - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Sets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The properties of a storage account’s Queue service, only properties for Storage Analytics and - * CORS (Cross-Origin Resource Sharing) rules can be specified. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a storage account’s Queue service. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> setServicePropertiesWithResponseAsync( - String resourceGroupName, String accountName, QueueServicePropertiesInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String queueServiceName = "default"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .setServiceProperties( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - queueServiceName, - parameters, - accept, - context); - } - - /** - * Sets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The properties of a storage account’s Queue service, only properties for Storage Analytics and - * CORS (Cross-Origin Resource Sharing) rules can be specified. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a storage account’s Queue service. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono setServicePropertiesAsync( - String resourceGroupName, String accountName, QueueServicePropertiesInner parameters) { - return setServicePropertiesWithResponseAsync(resourceGroupName, accountName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Sets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The properties of a storage account’s Queue service, only properties for Storage Analytics and - * CORS (Cross-Origin Resource Sharing) rules can be specified. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a storage account’s Queue service. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public QueueServicePropertiesInner setServiceProperties( - String resourceGroupName, String accountName, QueueServicePropertiesInner parameters) { - return setServicePropertiesAsync(resourceGroupName, accountName, parameters).block(); - } - - /** - * Sets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The properties of a storage account’s Queue service, only properties for Storage Analytics and - * CORS (Cross-Origin Resource Sharing) rules can be specified. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a storage account’s Queue service. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response setServicePropertiesWithResponse( - String resourceGroupName, String accountName, QueueServicePropertiesInner parameters, Context context) { - return setServicePropertiesWithResponseAsync(resourceGroupName, accountName, parameters, context).block(); - } - - /** - * Gets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getServicePropertiesWithResponseAsync( - String resourceGroupName, String accountName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String queueServiceName = "default"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getServiceProperties( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - queueServiceName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getServicePropertiesWithResponseAsync( - String resourceGroupName, String accountName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String queueServiceName = "default"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getServiceProperties( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - queueServiceName, - accept, - context); - } - - /** - * Gets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getServicePropertiesAsync(String resourceGroupName, String accountName) { - return getServicePropertiesWithResponseAsync(resourceGroupName, accountName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public QueueServicePropertiesInner getServiceProperties(String resourceGroupName, String accountName) { - return getServicePropertiesAsync(resourceGroupName, accountName).block(); - } - - /** - * Gets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getServicePropertiesWithResponse( - String resourceGroupName, String accountName, Context context) { - return getServicePropertiesWithResponseAsync(resourceGroupName, accountName, context).block(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/QueuesClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/QueuesClientImpl.java deleted file mode 100644 index 0fa4696ea6f7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/QueuesClientImpl.java +++ /dev/null @@ -1,1223 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.storage.fluent.QueuesClient; -import com.azure.resourcemanager.storage.fluent.models.ListQueueInner; -import com.azure.resourcemanager.storage.fluent.models.StorageQueueInner; -import com.azure.resourcemanager.storage.models.ListQueueResource; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in QueuesClient. */ -public final class QueuesClientImpl implements QueuesClient { - private final ClientLogger logger = new ClientLogger(QueuesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final QueuesService service; - - /** The service client containing this operation class. */ - private final StorageManagementClientImpl client; - - /** - * Initializes an instance of QueuesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - QueuesClientImpl(StorageManagementClientImpl client) { - this.service = RestProxy.create(QueuesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for StorageManagementClientQueues to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "StorageManagementCli") - private interface QueuesService { - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" - + "/storageAccounts/{accountName}/queueServices/default/queues/{queueName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> create( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("queueName") String queueName, - @BodyParam("application/json") StorageQueueInner queue, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" - + "/storageAccounts/{accountName}/queueServices/default/queues/{queueName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("queueName") String queueName, - @BodyParam("application/json") StorageQueueInner queue, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" - + "/storageAccounts/{accountName}/queueServices/default/queues/{queueName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("queueName") String queueName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" - + "/storageAccounts/{accountName}/queueServices/default/queues/{queueName}") - @ExpectedResponses({204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("queueName") String queueName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" - + "/storageAccounts/{accountName}/queueServices/default/queues") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("$maxpagesize") String maxpagesize, - @QueryParam("$filter") String filter, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Creates a new queue with the specified queue name, under the specified account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The - * name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an - * alphanumeric character and it cannot have two consecutive dash(-) characters. - * @param queue Queue properties and metadata to be created with. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createWithResponseAsync( - String resourceGroupName, String accountName, String queueName, StorageQueueInner queue) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (queueName == null) { - return Mono.error(new IllegalArgumentException("Parameter queueName is required and cannot be null.")); - } - if (queue == null) { - return Mono.error(new IllegalArgumentException("Parameter queue is required and cannot be null.")); - } else { - queue.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .create( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - queueName, - queue, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates a new queue with the specified queue name, under the specified account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The - * name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an - * alphanumeric character and it cannot have two consecutive dash(-) characters. - * @param queue Queue properties and metadata to be created with. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync( - String resourceGroupName, String accountName, String queueName, StorageQueueInner queue, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (queueName == null) { - return Mono.error(new IllegalArgumentException("Parameter queueName is required and cannot be null.")); - } - if (queue == null) { - return Mono.error(new IllegalArgumentException("Parameter queue is required and cannot be null.")); - } else { - queue.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .create( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - queueName, - queue, - accept, - context); - } - - /** - * Creates a new queue with the specified queue name, under the specified account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The - * name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an - * alphanumeric character and it cannot have two consecutive dash(-) characters. - * @param queue Queue properties and metadata to be created with. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createAsync( - String resourceGroupName, String accountName, String queueName, StorageQueueInner queue) { - return createWithResponseAsync(resourceGroupName, accountName, queueName, queue) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates a new queue with the specified queue name, under the specified account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The - * name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an - * alphanumeric character and it cannot have two consecutive dash(-) characters. - * @param queue Queue properties and metadata to be created with. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public StorageQueueInner create( - String resourceGroupName, String accountName, String queueName, StorageQueueInner queue) { - return createAsync(resourceGroupName, accountName, queueName, queue).block(); - } - - /** - * Creates a new queue with the specified queue name, under the specified account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The - * name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an - * alphanumeric character and it cannot have two consecutive dash(-) characters. - * @param queue Queue properties and metadata to be created with. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse( - String resourceGroupName, String accountName, String queueName, StorageQueueInner queue, Context context) { - return createWithResponseAsync(resourceGroupName, accountName, queueName, queue, context).block(); - } - - /** - * Creates a new queue with the specified queue name, under the specified account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The - * name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an - * alphanumeric character and it cannot have two consecutive dash(-) characters. - * @param queue Queue properties and metadata to be created with. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateWithResponseAsync( - String resourceGroupName, String accountName, String queueName, StorageQueueInner queue) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (queueName == null) { - return Mono.error(new IllegalArgumentException("Parameter queueName is required and cannot be null.")); - } - if (queue == null) { - return Mono.error(new IllegalArgumentException("Parameter queue is required and cannot be null.")); - } else { - queue.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - queueName, - queue, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates a new queue with the specified queue name, under the specified account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The - * name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an - * alphanumeric character and it cannot have two consecutive dash(-) characters. - * @param queue Queue properties and metadata to be created with. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, String accountName, String queueName, StorageQueueInner queue, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (queueName == null) { - return Mono.error(new IllegalArgumentException("Parameter queueName is required and cannot be null.")); - } - if (queue == null) { - return Mono.error(new IllegalArgumentException("Parameter queue is required and cannot be null.")); - } else { - queue.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - queueName, - queue, - accept, - context); - } - - /** - * Creates a new queue with the specified queue name, under the specified account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The - * name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an - * alphanumeric character and it cannot have two consecutive dash(-) characters. - * @param queue Queue properties and metadata to be created with. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync( - String resourceGroupName, String accountName, String queueName, StorageQueueInner queue) { - return updateWithResponseAsync(resourceGroupName, accountName, queueName, queue) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates a new queue with the specified queue name, under the specified account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The - * name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an - * alphanumeric character and it cannot have two consecutive dash(-) characters. - * @param queue Queue properties and metadata to be created with. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public StorageQueueInner update( - String resourceGroupName, String accountName, String queueName, StorageQueueInner queue) { - return updateAsync(resourceGroupName, accountName, queueName, queue).block(); - } - - /** - * Creates a new queue with the specified queue name, under the specified account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The - * name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an - * alphanumeric character and it cannot have two consecutive dash(-) characters. - * @param queue Queue properties and metadata to be created with. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, String accountName, String queueName, StorageQueueInner queue, Context context) { - return updateWithResponseAsync(resourceGroupName, accountName, queueName, queue, context).block(); - } - - /** - * Gets the queue with the specified queue name, under the specified account if it exists. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The - * name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an - * alphanumeric character and it cannot have two consecutive dash(-) characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the queue with the specified queue name, under the specified account if it exists. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String resourceGroupName, String accountName, String queueName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (queueName == null) { - return Mono.error(new IllegalArgumentException("Parameter queueName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - queueName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the queue with the specified queue name, under the specified account if it exists. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The - * name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an - * alphanumeric character and it cannot have two consecutive dash(-) characters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the queue with the specified queue name, under the specified account if it exists. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String accountName, String queueName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (queueName == null) { - return Mono.error(new IllegalArgumentException("Parameter queueName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - queueName, - accept, - context); - } - - /** - * Gets the queue with the specified queue name, under the specified account if it exists. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The - * name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an - * alphanumeric character and it cannot have two consecutive dash(-) characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the queue with the specified queue name, under the specified account if it exists. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync(String resourceGroupName, String accountName, String queueName) { - return getWithResponseAsync(resourceGroupName, accountName, queueName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the queue with the specified queue name, under the specified account if it exists. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The - * name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an - * alphanumeric character and it cannot have two consecutive dash(-) characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the queue with the specified queue name, under the specified account if it exists. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public StorageQueueInner get(String resourceGroupName, String accountName, String queueName) { - return getAsync(resourceGroupName, accountName, queueName).block(); - } - - /** - * Gets the queue with the specified queue name, under the specified account if it exists. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The - * name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an - * alphanumeric character and it cannot have two consecutive dash(-) characters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the queue with the specified queue name, under the specified account if it exists. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String accountName, String queueName, Context context) { - return getWithResponseAsync(resourceGroupName, accountName, queueName, context).block(); - } - - /** - * Deletes the queue with the specified queue name, under the specified account if it exists. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The - * name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an - * alphanumeric character and it cannot have two consecutive dash(-) characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync( - String resourceGroupName, String accountName, String queueName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (queueName == null) { - return Mono.error(new IllegalArgumentException("Parameter queueName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - queueName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the queue with the specified queue name, under the specified account if it exists. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The - * name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an - * alphanumeric character and it cannot have two consecutive dash(-) characters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String accountName, String queueName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (queueName == null) { - return Mono.error(new IllegalArgumentException("Parameter queueName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - queueName, - accept, - context); - } - - /** - * Deletes the queue with the specified queue name, under the specified account if it exists. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The - * name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an - * alphanumeric character and it cannot have two consecutive dash(-) characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String accountName, String queueName) { - return deleteWithResponseAsync(resourceGroupName, accountName, queueName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes the queue with the specified queue name, under the specified account if it exists. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The - * name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an - * alphanumeric character and it cannot have two consecutive dash(-) characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String accountName, String queueName) { - deleteAsync(resourceGroupName, accountName, queueName).block(); - } - - /** - * Deletes the queue with the specified queue name, under the specified account if it exists. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The - * name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an - * alphanumeric character and it cannot have two consecutive dash(-) characters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse( - String resourceGroupName, String accountName, String queueName, Context context) { - return deleteWithResponseAsync(resourceGroupName, accountName, queueName, context).block(); - } - - /** - * Gets a list of all the queues under the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param maxpagesize Optional, a maximum number of queues that should be included in a list queue response. - * @param filter Optional, When specified, only the queues with a name starting with the given filter will be - * listed. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all the queues under the specified storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String accountName, String maxpagesize, String filter) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - maxpagesize, - filter, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a list of all the queues under the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param maxpagesize Optional, a maximum number of queues that should be included in a list queue response. - * @param filter Optional, When specified, only the queues with a name starting with the given filter will be - * listed. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all the queues under the specified storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String accountName, String maxpagesize, String filter, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - maxpagesize, - filter, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets a list of all the queues under the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param maxpagesize Optional, a maximum number of queues that should be included in a list queue response. - * @param filter Optional, When specified, only the queues with a name starting with the given filter will be - * listed. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all the queues under the specified storage account. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync( - String resourceGroupName, String accountName, String maxpagesize, String filter) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, accountName, maxpagesize, filter), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets a list of all the queues under the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all the queues under the specified storage account. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String resourceGroupName, String accountName) { - final String maxpagesize = null; - final String filter = null; - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, accountName, maxpagesize, filter), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets a list of all the queues under the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param maxpagesize Optional, a maximum number of queues that should be included in a list queue response. - * @param filter Optional, When specified, only the queues with a name starting with the given filter will be - * listed. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all the queues under the specified storage account. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String accountName, String maxpagesize, String filter, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, accountName, maxpagesize, filter, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets a list of all the queues under the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all the queues under the specified storage account. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String accountName) { - final String maxpagesize = null; - final String filter = null; - return new PagedIterable<>(listAsync(resourceGroupName, accountName, maxpagesize, filter)); - } - - /** - * Gets a list of all the queues under the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param maxpagesize Optional, a maximum number of queues that should be included in a list queue response. - * @param filter Optional, When specified, only the queues with a name starting with the given filter will be - * listed. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all the queues under the specified storage account. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, String accountName, String maxpagesize, String filter, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, accountName, maxpagesize, filter, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response schema. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response schema. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/SkusClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/SkusClientImpl.java deleted file mode 100644 index 66ba68ac397b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/SkusClientImpl.java +++ /dev/null @@ -1,201 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.storage.fluent.SkusClient; -import com.azure.resourcemanager.storage.fluent.models.SkuInformationInner; -import com.azure.resourcemanager.storage.models.StorageSkuListResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in SkusClient. */ -public final class SkusClientImpl implements SkusClient { - private final ClientLogger logger = new ClientLogger(SkusClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final SkusService service; - - /** The service client containing this operation class. */ - private final StorageManagementClientImpl client; - - /** - * Initializes an instance of SkusClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - SkusClientImpl(StorageManagementClientImpl client) { - this.service = RestProxy.create(SkusService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for StorageManagementClientSkus to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "StorageManagementCli") - private interface SkusService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Storage/skus") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Lists the available SKUs supported by Microsoft.Storage for given subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the List Storage SKUs operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists the available SKUs supported by Microsoft.Storage for given subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the List Storage SKUs operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); - } - - /** - * Lists the available SKUs supported by Microsoft.Storage for given subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the List Storage SKUs operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync()); - } - - /** - * Lists the available SKUs supported by Microsoft.Storage for given subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the List Storage SKUs operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context)); - } - - /** - * Lists the available SKUs supported by Microsoft.Storage for given subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the List Storage SKUs operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Lists the available SKUs supported by Microsoft.Storage for given subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the List Storage SKUs operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/StorageAccountEncryptionStatusImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/StorageAccountEncryptionStatusImpl.java deleted file mode 100644 index 2c85e9e26a98..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/StorageAccountEncryptionStatusImpl.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.storage.implementation; - -import com.azure.resourcemanager.storage.models.EncryptionService; -import com.azure.resourcemanager.storage.models.EncryptionServices; -import com.azure.resourcemanager.storage.models.KeyType; -import com.azure.resourcemanager.storage.models.StorageAccountEncryptionStatus; -import java.time.OffsetDateTime; - -/** Shared implementation of StorageAccountEncryptionStatus. */ -public abstract class StorageAccountEncryptionStatusImpl implements StorageAccountEncryptionStatus { - protected final EncryptionServices encryptionServices; - - protected StorageAccountEncryptionStatusImpl(EncryptionServices encryptionServices) { - this.encryptionServices = encryptionServices; - } - - @Override - public boolean isEnabled() { - EncryptionService encryptionService = this.encryptionService(); - if (encryptionService == null || encryptionService.enabled() == null) { - return true; - } else { - return encryptionService.enabled(); - } - } - - @Override - public OffsetDateTime lastEnabledTime() { - EncryptionService encryptionService = this.encryptionService(); - if (encryptionService == null) { - return null; - } else { - return encryptionService.lastEnabledTime(); - } - } - - @Override - public KeyType keyType() { - EncryptionService encryptionService = this.encryptionService(); - if (encryptionService == null) { - return null; - } else { - return encryptionService.keyType(); - } - } - - protected abstract EncryptionService encryptionService(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/StorageAccountImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/StorageAccountImpl.java deleted file mode 100644 index bb4ea6bc5f61..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/StorageAccountImpl.java +++ /dev/null @@ -1,822 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.storage.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.resources.fluentcore.arm.models.PrivateEndpoint; -import com.azure.resourcemanager.resources.fluentcore.arm.models.PrivateEndpointConnection; -import com.azure.resourcemanager.resources.fluentcore.arm.models.PrivateEndpointConnectionProvisioningState; -import com.azure.resourcemanager.resources.fluentcore.arm.models.PrivateLinkResource; -import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.GroupableResourceImpl; -import com.azure.resourcemanager.resources.fluentcore.utils.PagedConverter; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import com.azure.resourcemanager.storage.StorageManager; -import com.azure.resourcemanager.storage.fluent.StorageAccountsClient; -import com.azure.resourcemanager.storage.fluent.models.PrivateEndpointConnectionInner; -import com.azure.resourcemanager.storage.models.AccessTier; -import com.azure.resourcemanager.storage.models.AccountStatuses; -import com.azure.resourcemanager.storage.models.AzureFilesIdentityBasedAuthentication; -import com.azure.resourcemanager.storage.models.CustomDomain; -import com.azure.resourcemanager.storage.models.DirectoryServiceOptions; -import com.azure.resourcemanager.storage.models.Identity; -import com.azure.resourcemanager.storage.models.IdentityType; -import com.azure.resourcemanager.storage.models.Kind; -import com.azure.resourcemanager.storage.models.LargeFileSharesState; -import com.azure.resourcemanager.storage.models.MinimumTlsVersion; -import com.azure.resourcemanager.storage.models.PrivateEndpointServiceConnectionStatus; -import com.azure.resourcemanager.storage.models.PrivateLinkServiceConnectionState; -import com.azure.resourcemanager.storage.models.ProvisioningState; -import com.azure.resourcemanager.storage.models.PublicEndpoints; -import com.azure.resourcemanager.storage.models.Sku; -import com.azure.resourcemanager.storage.models.StorageAccount; -import com.azure.resourcemanager.storage.models.StorageAccountCreateParameters; -import com.azure.resourcemanager.storage.models.StorageAccountEncryptionKeySource; -import com.azure.resourcemanager.storage.models.StorageAccountEncryptionStatus; -import com.azure.resourcemanager.storage.models.StorageAccountKey; -import com.azure.resourcemanager.storage.models.StorageAccountRegenerateKeyParameters; -import com.azure.resourcemanager.storage.models.StorageAccountSkuType; -import com.azure.resourcemanager.storage.models.StorageAccountUpdateParameters; -import com.azure.resourcemanager.storage.models.StorageService; -import com.azure.resourcemanager.storage.fluent.models.StorageAccountInner; - -import java.time.OffsetDateTime; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -import reactor.core.publisher.Mono; - -/** Implementation for {@link StorageAccount}. */ -class StorageAccountImpl - extends GroupableResourceImpl - implements StorageAccount, StorageAccount.Definition, StorageAccount.Update { - - private final ClientLogger logger = new ClientLogger(getClass()); - private PublicEndpoints publicEndpoints; - private AccountStatuses accountStatuses; - private StorageAccountCreateParameters createParameters; - private StorageAccountUpdateParameters updateParameters; - private StorageNetworkRulesHelper networkRulesHelper; - private StorageEncryptionHelper encryptionHelper; - - StorageAccountImpl(String name, StorageAccountInner innerModel, final StorageManager storageManager) { - super(name, innerModel, storageManager); - this.createParameters = new StorageAccountCreateParameters(); - this.networkRulesHelper = new StorageNetworkRulesHelper(this.createParameters); - this.encryptionHelper = new StorageEncryptionHelper(this.createParameters); - } - - @Override - public AccountStatuses accountStatuses() { - if (accountStatuses == null) { - accountStatuses = new AccountStatuses(this.innerModel().statusOfPrimary(), this.innerModel().statusOfSecondary()); - } - return accountStatuses; - } - - @Override - public StorageAccountSkuType skuType() { - // We deprecated the sku() getter. When we remove it we wanted to rename this - // 'beta' getter skuType() to sku(). - // - return StorageAccountSkuType.fromSkuName(this.innerModel().sku().name()); - } - - @Override - public Kind kind() { - return innerModel().kind(); - } - - @Override - public OffsetDateTime creationTime() { - return this.innerModel().creationTime(); - } - - @Override - public CustomDomain customDomain() { - return this.innerModel().customDomain(); - } - - @Override - public OffsetDateTime lastGeoFailoverTime() { - return this.innerModel().lastGeoFailoverTime(); - } - - @Override - public ProvisioningState provisioningState() { - return this.innerModel().provisioningState(); - } - - @Override - public PublicEndpoints endPoints() { - if (publicEndpoints == null) { - publicEndpoints = new PublicEndpoints(this.innerModel().primaryEndpoints(), this.innerModel().secondaryEndpoints()); - } - return publicEndpoints; - } - - @Override - public StorageAccountEncryptionKeySource encryptionKeySource() { - return StorageEncryptionHelper.encryptionKeySource(this.innerModel()); - } - - @Override - public Map encryptionStatuses() { - return StorageEncryptionHelper.encryptionStatuses(this.innerModel()); - } - - @Override - public boolean infrastructureEncryptionEnabled() { - return this.encryptionHelper.infrastructureEncryptionEnabled(); - } - - @Override - public AccessTier accessTier() { - return innerModel().accessTier(); - } - - @Override - public String systemAssignedManagedServiceIdentityTenantId() { - if (this.innerModel().identity() == null) { - return null; - } else { - return this.innerModel().identity().tenantId(); - } - } - - @Override - public String systemAssignedManagedServiceIdentityPrincipalId() { - if (this.innerModel().identity() == null) { - return null; - } else { - return this.innerModel().identity().principalId(); - } - } - - @Override - public boolean isAccessAllowedFromAllNetworks() { - return StorageNetworkRulesHelper.isAccessAllowedFromAllNetworks(this.innerModel()); - } - - @Override - public List networkSubnetsWithAccess() { - return StorageNetworkRulesHelper.networkSubnetsWithAccess(this.innerModel()); - } - - @Override - public List ipAddressesWithAccess() { - return StorageNetworkRulesHelper.ipAddressesWithAccess(this.innerModel()); - } - - @Override - public List ipAddressRangesWithAccess() { - return StorageNetworkRulesHelper.ipAddressRangesWithAccess(this.innerModel()); - } - - @Override - public boolean canReadLogEntriesFromAnyNetwork() { - return StorageNetworkRulesHelper.canReadLogEntriesFromAnyNetwork(this.innerModel()); - } - - @Override - public boolean canReadMetricsFromAnyNetwork() { - return StorageNetworkRulesHelper.canReadMetricsFromAnyNetwork(this.innerModel()); - } - - @Override - public boolean canAccessFromAzureServices() { - return StorageNetworkRulesHelper.canAccessFromAzureServices(this.innerModel()); - } - - @Override - public boolean isAzureFilesAadIntegrationEnabled() { - return this.innerModel().azureFilesIdentityBasedAuthentication() != null - && this.innerModel().azureFilesIdentityBasedAuthentication().directoryServiceOptions() - == DirectoryServiceOptions.AADDS; - } - - @Override - public boolean isHnsEnabled() { - return ResourceManagerUtils.toPrimitiveBoolean(this.innerModel().isHnsEnabled()); - } - - @Override - public boolean isLargeFileSharesEnabled() { - return this.innerModel().largeFileSharesState() == LargeFileSharesState.ENABLED; - } - - @Override - public MinimumTlsVersion minimumTlsVersion() { - return this.innerModel().minimumTlsVersion(); - } - - @Override - public boolean isHttpsTrafficOnly() { - if (this.innerModel().enableHttpsTrafficOnly() == null) { - return true; - } - return this.innerModel().enableHttpsTrafficOnly(); - } - - @Override - public boolean isBlobPublicAccessAllowed() { - if (this.innerModel().allowBlobPublicAccess() == null) { - return true; - } - return this.innerModel().allowBlobPublicAccess(); - } - - @Override - public boolean isSharedKeyAccessAllowed() { - if (this.innerModel().allowSharedKeyAccess() == null) { - return true; - } - return this.innerModel().allowSharedKeyAccess(); - } - - @Override - public List getKeys() { - return this.getKeysAsync().block(); - } - - @Override - public Mono> getKeysAsync() { - return this - .manager() - .serviceClient() - .getStorageAccounts() - .listKeysAsync(this.resourceGroupName(), this.name()) - .map(storageAccountListKeysResultInner -> storageAccountListKeysResultInner.keys()); - } - - @Override - public List regenerateKey(String keyName) { - return this.regenerateKeyAsync(keyName).block(); - } - - @Override - public Mono> regenerateKeyAsync(String keyName) { - return this - .manager() - .serviceClient() - .getStorageAccounts() - .regenerateKeyAsync(this.resourceGroupName(), this.name(), - new StorageAccountRegenerateKeyParameters().withKeyName(keyName)) - .map(storageAccountListKeysResultInner -> storageAccountListKeysResultInner.keys()); - } - - @Override - public PagedIterable listPrivateLinkResources() { - return new PagedIterable<>(listPrivateLinkResourcesAsync()); - } - - @Override - public PagedFlux listPrivateLinkResourcesAsync() { - Mono>> retList = this.manager().serviceClient().getPrivateLinkResources() - .listByStorageAccountWithResponseAsync(this.resourceGroupName(), this.name()) - .map(response -> new SimpleResponse<>(response, response.getValue().value().stream() - .map(PrivateLinkResourceImpl::new) - .collect(Collectors.toList()))); - - return PagedConverter.convertListToPagedFlux(retList); - } - - @Override - public PagedIterable listPrivateEndpointConnections() { - return new PagedIterable<>(listPrivateEndpointConnectionsAsync()); - } - - @Override - public PagedFlux listPrivateEndpointConnectionsAsync() { - return PagedConverter.mapPage(this.manager().serviceClient().getPrivateEndpointConnections() - .listAsync(this.resourceGroupName(), this.name()), PrivateEndpointConnectionImpl::new); - } - - @Override - public void approvePrivateEndpointConnection(String privateEndpointConnectionName) { - approvePrivateEndpointConnectionAsync(privateEndpointConnectionName).block(); - } - - @Override - public Mono approvePrivateEndpointConnectionAsync(String privateEndpointConnectionName) { - return this.manager().serviceClient().getPrivateEndpointConnections() - .putWithResponseAsync(this.resourceGroupName(), this.name(), privateEndpointConnectionName, - new PrivateEndpointConnectionInner().withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState() - .withStatus( - PrivateEndpointServiceConnectionStatus.APPROVED))) - .then(); - } - - @Override - public void rejectPrivateEndpointConnection(String privateEndpointConnectionName) { - rejectPrivateEndpointConnectionAsync(privateEndpointConnectionName).block(); - } - - @Override - public Mono rejectPrivateEndpointConnectionAsync(String privateEndpointConnectionName) { - return this.manager().serviceClient().getPrivateEndpointConnections() - .putWithResponseAsync(this.resourceGroupName(), this.name(), privateEndpointConnectionName, - new PrivateEndpointConnectionInner().withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState() - .withStatus( - PrivateEndpointServiceConnectionStatus.REJECTED))) - .then(); - } - - @Override - public Mono refreshAsync() { - return super - .refreshAsync() - .map( - storageAccount -> { - StorageAccountImpl impl = (StorageAccountImpl) storageAccount; - impl.clearWrapperProperties(); - return impl; - }); - } - - @Override - protected Mono getInnerAsync() { - return this.manager().serviceClient().getStorageAccounts().getByResourceGroupAsync(this.resourceGroupName(), this.name()); - } - - @Override - public StorageAccountImpl withSku(StorageAccountSkuType sku) { - if (isInCreateMode()) { - createParameters.withSku(new Sku().withName(sku.name())); - } else { - updateParameters.withSku(new Sku().withName(sku.name())); - } - return this; - } - - @Override - public StorageAccountImpl withBlobStorageAccountKind() { - createParameters.withKind(Kind.BLOB_STORAGE); - return this; - } - - @Override - public StorageAccountImpl withGeneralPurposeAccountKind() { - createParameters.withKind(Kind.STORAGE); - return this; - } - - @Override - public StorageAccountImpl withGeneralPurposeAccountKindV2() { - createParameters.withKind(Kind.STORAGE_V2); - return this; - } - - @Override - public StorageAccountImpl withBlockBlobStorageAccountKind() { - createParameters.withKind(Kind.BLOCK_BLOB_STORAGE); - return this; - } - - @Override - public StorageAccountImpl withFileStorageAccountKind() { - createParameters.withKind(Kind.FILE_STORAGE); - return this; - } - - @Override - public StorageAccountImpl withInfrastructureEncryption() { - this.encryptionHelper.withInfrastructureEncryption(); - return this; - } - - @Override - public StorageAccountImpl withBlobEncryption() { - this.encryptionHelper.withBlobEncryption(); - return this; - } - - @Override - public StorageAccountImpl withFileEncryption() { - this.encryptionHelper.withFileEncryption(); - return this; - } - - @Override - public StorageAccountImpl withEncryptionKeyFromKeyVault(String keyVaultUri, String keyName, String keyVersion) { - this.encryptionHelper.withEncryptionKeyFromKeyVault(keyVaultUri, keyName, keyVersion); - return this; - } - - @Override - public StorageAccountImpl withoutBlobEncryption() { - this.encryptionHelper.withoutBlobEncryption(); - return this; - } - - @Override - public StorageAccountImpl withoutFileEncryption() { - this.encryptionHelper.withoutFileEncryption(); - return this; - } - - @Override - public StorageAccountImpl withTableAccountScopedEncryptionKey() { - this.encryptionHelper.withTableEncryption(); - return this; - } - - @Override - public StorageAccountImpl withQueueAccountScopedEncryptionKey() { - this.encryptionHelper.withQueueEncryption(); - return this; - } - - private void clearWrapperProperties() { - accountStatuses = null; - publicEndpoints = null; - } - - @Override - public StorageAccountImpl update() { - createParameters = null; - updateParameters = new StorageAccountUpdateParameters(); - this.networkRulesHelper = new StorageNetworkRulesHelper(this.updateParameters, this.innerModel()); - this.encryptionHelper = new StorageEncryptionHelper(this.updateParameters, this.innerModel()); - return super.update(); - } - - @Override - public StorageAccountImpl withCustomDomain(CustomDomain customDomain) { - if (isInCreateMode()) { - createParameters.withCustomDomain(customDomain); - } else { - updateParameters.withCustomDomain(customDomain); - } - return this; - } - - @Override - public StorageAccountImpl withCustomDomain(String name) { - return withCustomDomain(new CustomDomain().withName(name)); - } - - @Override - public StorageAccountImpl withCustomDomain(String name, boolean useSubDomain) { - return withCustomDomain(new CustomDomain().withName(name).withUseSubDomainName(useSubDomain)); - } - - @Override - public StorageAccountImpl withAccessTier(AccessTier accessTier) { - if (isInCreateMode()) { - createParameters.withAccessTier(accessTier); - } else { - if (this.innerModel().kind() != Kind.BLOB_STORAGE) { - throw logger.logExceptionAsError(new UnsupportedOperationException( - "Access tier can not be changed for general purpose storage accounts.")); - } - updateParameters.withAccessTier(accessTier); - } - return this; - } - - @Override - public StorageAccountImpl withSystemAssignedManagedServiceIdentity() { - if (this.innerModel().identity() == null) { - if (isInCreateMode()) { - createParameters.withIdentity(new Identity().withType(IdentityType.SYSTEM_ASSIGNED)); - } else { - updateParameters.withIdentity(new Identity().withType(IdentityType.SYSTEM_ASSIGNED)); - } - } - return this; - } - - @Override - public StorageAccountImpl withOnlyHttpsTraffic() { - if (isInCreateMode()) { - createParameters.withEnableHttpsTrafficOnly(true); - } else { - updateParameters.withEnableHttpsTrafficOnly(true); - } - return this; - } - - @Override - public StorageAccountImpl withHttpAndHttpsTraffic() { - if (isInCreateMode()) { - createParameters.withEnableHttpsTrafficOnly(false); - } else { - updateParameters.withEnableHttpsTrafficOnly(false); - } - return this; - } - - @Override - public StorageAccountImpl withMinimumTlsVersion(MinimumTlsVersion minimumTlsVersion) { - if (isInCreateMode()) { - createParameters.withMinimumTlsVersion(minimumTlsVersion); - } else { - updateParameters.withMinimumTlsVersion(minimumTlsVersion); - } - return this; - } - - @Override - public StorageAccountImpl enableBlobPublicAccess() { - if (isInCreateMode()) { - createParameters.withAllowBlobPublicAccess(true); - } else { - updateParameters.withAllowBlobPublicAccess(true); - } - return this; - } - - @Override - public StorageAccountImpl disableBlobPublicAccess() { - if (isInCreateMode()) { - createParameters.withAllowBlobPublicAccess(false); - } else { - updateParameters.withAllowBlobPublicAccess(false); - } - return this; - } - - @Override - public StorageAccountImpl enableSharedKeyAccess() { - if (isInCreateMode()) { - createParameters.withAllowSharedKeyAccess(true); - } else { - updateParameters.withAllowSharedKeyAccess(true); - } - return this; - } - - @Override - public StorageAccountImpl disableSharedKeyAccess() { - if (isInCreateMode()) { - createParameters.withAllowSharedKeyAccess(false); - } else { - updateParameters.withAllowSharedKeyAccess(false); - } - return this; - } - - @Override - public StorageAccountImpl withAccessFromAllNetworks() { - this.networkRulesHelper.withAccessFromAllNetworks(); - return this; - } - - @Override - public StorageAccountImpl withAccessFromSelectedNetworks() { - this.networkRulesHelper.withAccessFromSelectedNetworks(); - return this; - } - - @Override - public StorageAccountImpl withAccessFromNetworkSubnet(String subnetId) { - this.networkRulesHelper.withAccessFromNetworkSubnet(subnetId); - return this; - } - - @Override - public StorageAccountImpl withAccessFromIpAddress(String ipAddress) { - this.networkRulesHelper.withAccessFromIpAddress(ipAddress); - return this; - } - - @Override - public StorageAccountImpl withAccessFromIpAddressRange(String ipAddressCidr) { - this.networkRulesHelper.withAccessFromIpAddressRange(ipAddressCidr); - return this; - } - - @Override - public StorageAccountImpl withReadAccessToLogEntriesFromAnyNetwork() { - this.networkRulesHelper.withReadAccessToLoggingFromAnyNetwork(); - return this; - } - - @Override - public StorageAccountImpl withReadAccessToMetricsFromAnyNetwork() { - this.networkRulesHelper.withReadAccessToMetricsFromAnyNetwork(); - return this; - } - - @Override - public StorageAccountImpl withAccessFromAzureServices() { - this.networkRulesHelper.withAccessAllowedFromAzureServices(); - return this; - } - - @Override - public StorageAccountImpl withoutNetworkSubnetAccess(String subnetId) { - this.networkRulesHelper.withoutNetworkSubnetAccess(subnetId); - return this; - } - - @Override - public StorageAccountImpl withoutIpAddressAccess(String ipAddress) { - this.networkRulesHelper.withoutIpAddressAccess(ipAddress); - return this; - } - - @Override - public StorageAccountImpl withoutIpAddressRangeAccess(String ipAddressCidr) { - this.networkRulesHelper.withoutIpAddressRangeAccess(ipAddressCidr); - return this; - } - - @Override - public Update withoutReadAccessToLoggingFromAnyNetwork() { - this.networkRulesHelper.withoutReadAccessToLoggingFromAnyNetwork(); - return this; - } - - @Override - public Update withoutReadAccessToMetricsFromAnyNetwork() { - this.networkRulesHelper.withoutReadAccessToMetricsFromAnyNetwork(); - return this; - } - - @Override - public Update withoutAccessFromAzureServices() { - this.networkRulesHelper.withoutAccessFromAzureServices(); - return this; - } - - @Override - public Update upgradeToGeneralPurposeAccountKindV2() { - updateParameters.withKind(Kind.STORAGE_V2); - return this; - } - - // CreateUpdateTaskGroup.ResourceCreator implementation - @Override - public Mono createResourceAsync() { - this.networkRulesHelper.setDefaultActionIfRequired(); - createParameters.withLocation(this.regionName()); - createParameters.withTags(this.innerModel().tags()); - final StorageAccountsClient client = this.manager().serviceClient().getStorageAccounts(); - return this - .manager() - .serviceClient() - .getStorageAccounts() - .createAsync(this.resourceGroupName(), this.name(), createParameters) - .flatMap( - storageAccountInner -> - client - .getByResourceGroupAsync(resourceGroupName(), this.name()) - .map(innerToFluentMap(this)) - .doOnNext(storageAccount -> clearWrapperProperties())); - } - - @Override - public Mono updateResourceAsync() { - this.networkRulesHelper.setDefaultActionIfRequired(); - updateParameters.withTags(this.innerModel().tags()); - return this - .manager() - .serviceClient() - .getStorageAccounts() - .updateAsync(resourceGroupName(), this.name(), updateParameters) - .map(innerToFluentMap(this)) - .doOnNext(storageAccount -> clearWrapperProperties()); - } - - @Override - public StorageAccountImpl withAzureFilesAadIntegrationEnabled(boolean enabled) { - if (isInCreateMode()) { - if (enabled) { - this - .createParameters - .withAzureFilesIdentityBasedAuthentication( - new AzureFilesIdentityBasedAuthentication() - .withDirectoryServiceOptions(DirectoryServiceOptions.AADDS)); - } - } else { - if (this.createParameters.azureFilesIdentityBasedAuthentication() == null) { - this - .createParameters - .withAzureFilesIdentityBasedAuthentication(new AzureFilesIdentityBasedAuthentication()); - } - if (enabled) { - this - .updateParameters - .azureFilesIdentityBasedAuthentication() - .withDirectoryServiceOptions(DirectoryServiceOptions.AADDS); - } else { - this - .updateParameters - .azureFilesIdentityBasedAuthentication() - .withDirectoryServiceOptions(DirectoryServiceOptions.NONE); - } - } - return this; - } - - @Override - public StorageAccountImpl withLargeFileShares(boolean enabled) { - if (isInCreateMode()) { - if (enabled) { - this.createParameters.withLargeFileSharesState(LargeFileSharesState.ENABLED); - } else { - this.createParameters.withLargeFileSharesState(LargeFileSharesState.DISABLED); - } - } - return this; - } - - @Override - public StorageAccountImpl withHnsEnabled(boolean enabled) { - this.createParameters.withIsHnsEnabled(enabled); - return this; - } - - private static final class PrivateLinkResourceImpl implements PrivateLinkResource { - private final com.azure.resourcemanager.storage.models.PrivateLinkResource innerModel; - - private PrivateLinkResourceImpl(com.azure.resourcemanager.storage.models.PrivateLinkResource innerModel) { - this.innerModel = innerModel; - } - - @Override - public String groupId() { - return innerModel.groupId(); - } - - @Override - public List requiredMemberNames() { - return Collections.unmodifiableList(innerModel.requiredMembers()); - } - - @Override - public List requiredDnsZoneNames() { - return Collections.unmodifiableList(innerModel.requiredZoneNames()); - } - } - - private static final class PrivateEndpointConnectionImpl implements PrivateEndpointConnection { - private final PrivateEndpointConnectionInner innerModel; - - private final PrivateEndpoint privateEndpoint; - private final com.azure.resourcemanager.resources.fluentcore.arm.models.PrivateLinkServiceConnectionState - privateLinkServiceConnectionState; - private final PrivateEndpointConnectionProvisioningState provisioningState; - - private PrivateEndpointConnectionImpl(PrivateEndpointConnectionInner innerModel) { - this.innerModel = innerModel; - - this.privateEndpoint = innerModel.privateEndpoint() == null - ? null - : new PrivateEndpoint(innerModel.privateEndpoint().id()); - this.privateLinkServiceConnectionState = innerModel.privateLinkServiceConnectionState() == null - ? null - : new com.azure.resourcemanager.resources.fluentcore.arm.models.PrivateLinkServiceConnectionState( - innerModel.privateLinkServiceConnectionState().status() == null - ? null - : com.azure.resourcemanager.resources.fluentcore.arm.models.PrivateEndpointServiceConnectionStatus - .fromString(innerModel.privateLinkServiceConnectionState().status().toString()), - innerModel.privateLinkServiceConnectionState().description(), - innerModel.privateLinkServiceConnectionState().actionRequired()); - this.provisioningState = innerModel.provisioningState() == null - ? null - : PrivateEndpointConnectionProvisioningState.fromString(innerModel.provisioningState().toString()); - } - - @Override - public String id() { - return innerModel.id(); - } - - @Override - public String name() { - return innerModel.name(); - } - - @Override - public String type() { - return innerModel.type(); - } - - @Override - public PrivateEndpoint privateEndpoint() { - return privateEndpoint; - } - - @Override - public com.azure.resourcemanager.resources.fluentcore.arm.models.PrivateLinkServiceConnectionState - privateLinkServiceConnectionState() { - return privateLinkServiceConnectionState; - } - - @Override - public PrivateEndpointConnectionProvisioningState provisioningState() { - return provisioningState; - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/StorageAccountsClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/StorageAccountsClientImpl.java deleted file mode 100644 index 09bf8a982c4e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/StorageAccountsClientImpl.java +++ /dev/null @@ -1,3133 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import com.azure.resourcemanager.storage.fluent.StorageAccountsClient; -import com.azure.resourcemanager.storage.fluent.models.BlobRestoreStatusInner; -import com.azure.resourcemanager.storage.fluent.models.CheckNameAvailabilityResultInner; -import com.azure.resourcemanager.storage.fluent.models.ListAccountSasResponseInner; -import com.azure.resourcemanager.storage.fluent.models.ListServiceSasResponseInner; -import com.azure.resourcemanager.storage.fluent.models.StorageAccountInner; -import com.azure.resourcemanager.storage.fluent.models.StorageAccountListKeysResultInner; -import com.azure.resourcemanager.storage.models.AccountSasParameters; -import com.azure.resourcemanager.storage.models.BlobRestoreParameters; -import com.azure.resourcemanager.storage.models.ListKeyExpand; -import com.azure.resourcemanager.storage.models.ServiceSasParameters; -import com.azure.resourcemanager.storage.models.StorageAccountCheckNameAvailabilityParameters; -import com.azure.resourcemanager.storage.models.StorageAccountCreateParameters; -import com.azure.resourcemanager.storage.models.StorageAccountExpand; -import com.azure.resourcemanager.storage.models.StorageAccountListResult; -import com.azure.resourcemanager.storage.models.StorageAccountRegenerateKeyParameters; -import com.azure.resourcemanager.storage.models.StorageAccountUpdateParameters; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in StorageAccountsClient. */ -public final class StorageAccountsClientImpl - implements InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete, - StorageAccountsClient { - private final ClientLogger logger = new ClientLogger(StorageAccountsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final StorageAccountsService service; - - /** The service client containing this operation class. */ - private final StorageManagementClientImpl client; - - /** - * Initializes an instance of StorageAccountsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - StorageAccountsClientImpl(StorageManagementClientImpl client) { - this.service = - RestProxy.create(StorageAccountsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for StorageManagementClientStorageAccounts to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "StorageManagementCli") - private interface StorageAccountsService { - @Headers({"Content-Type: application/json"}) - @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> checkNameAvailability( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") StorageAccountCheckNameAvailabilityParameters accountName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" - + "/storageAccounts/{accountName}") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> create( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") StorageAccountCreateParameters parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" - + "/storageAccounts/{accountName}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" - + "/storageAccounts/{accountName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("$expand") StorageAccountExpand expand, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" - + "/storageAccounts/{accountName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") StorageAccountUpdateParameters parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" - + "/storageAccounts") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" - + "/storageAccounts/{accountName}/listKeys") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listKeys( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("$expand") ListKeyExpand expand, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" - + "/storageAccounts/{accountName}/regenerateKey") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> regenerateKey( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") StorageAccountRegenerateKeyParameters regenerateKey, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" - + "/storageAccounts/{accountName}/ListAccountSas") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAccountSas( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") AccountSasParameters parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" - + "/storageAccounts/{accountName}/ListServiceSas") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listServiceSas( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") ServiceSasParameters parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" - + "/storageAccounts/{accountName}/failover") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> failover( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" - + "/storageAccounts/{accountName}/restoreBlobRanges") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> restoreBlobRanges( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") BlobRestoreParameters parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" - + "/storageAccounts/{accountName}/revokeUserDelegationKeys") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> revokeUserDelegationKeys( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Checks that the storage account name is valid and is not already in use. - * - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the CheckNameAvailability operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> checkNameAvailabilityWithResponseAsync( - StorageAccountCheckNameAvailabilityParameters accountName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } else { - accountName.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .checkNameAvailability( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accountName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Checks that the storage account name is valid and is not already in use. - * - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the CheckNameAvailability operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> checkNameAvailabilityWithResponseAsync( - StorageAccountCheckNameAvailabilityParameters accountName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } else { - accountName.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .checkNameAvailability( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accountName, - accept, - context); - } - - /** - * Checks that the storage account name is valid and is not already in use. - * - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the CheckNameAvailability operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono checkNameAvailabilityAsync( - StorageAccountCheckNameAvailabilityParameters accountName) { - return checkNameAvailabilityWithResponseAsync(accountName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Checks that the storage account name is valid and is not already in use. - * - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the CheckNameAvailability operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CheckNameAvailabilityResultInner checkNameAvailability( - StorageAccountCheckNameAvailabilityParameters accountName) { - return checkNameAvailabilityAsync(accountName).block(); - } - - /** - * Checks that the storage account name is valid and is not already in use. - * - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the CheckNameAvailability operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response checkNameAvailabilityWithResponse( - StorageAccountCheckNameAvailabilityParameters accountName, Context context) { - return checkNameAvailabilityWithResponseAsync(accountName, context).block(); - } - - /** - * Asynchronously creates a new storage account with the specified parameters. If an account is already created and - * a subsequent create request is issued with different properties, the account properties will be updated. If an - * account is already created and a subsequent create or update request is issued with the exact same set of - * properties, the request will succeed. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The parameters to provide for the created account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createWithResponseAsync( - String resourceGroupName, String accountName, StorageAccountCreateParameters parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .create( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Asynchronously creates a new storage account with the specified parameters. If an account is already created and - * a subsequent create request is issued with different properties, the account properties will be updated. If an - * account is already created and a subsequent create or update request is issued with the exact same set of - * properties, the request will succeed. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The parameters to provide for the created account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createWithResponseAsync( - String resourceGroupName, String accountName, StorageAccountCreateParameters parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .create( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Asynchronously creates a new storage account with the specified parameters. If an account is already created and - * a subsequent create request is issued with different properties, the account properties will be updated. If an - * account is already created and a subsequent create or update request is issued with the exact same set of - * properties, the request will succeed. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The parameters to provide for the created account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, StorageAccountInner> beginCreateAsync( - String resourceGroupName, String accountName, StorageAccountCreateParameters parameters) { - Mono>> mono = createWithResponseAsync(resourceGroupName, accountName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - StorageAccountInner.class, - StorageAccountInner.class, - Context.NONE); - } - - /** - * Asynchronously creates a new storage account with the specified parameters. If an account is already created and - * a subsequent create request is issued with different properties, the account properties will be updated. If an - * account is already created and a subsequent create or update request is issued with the exact same set of - * properties, the request will succeed. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The parameters to provide for the created account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, StorageAccountInner> beginCreateAsync( - String resourceGroupName, String accountName, StorageAccountCreateParameters parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createWithResponseAsync(resourceGroupName, accountName, parameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), StorageAccountInner.class, StorageAccountInner.class, context); - } - - /** - * Asynchronously creates a new storage account with the specified parameters. If an account is already created and - * a subsequent create request is issued with different properties, the account properties will be updated. If an - * account is already created and a subsequent create or update request is issued with the exact same set of - * properties, the request will succeed. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The parameters to provide for the created account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, StorageAccountInner> beginCreate( - String resourceGroupName, String accountName, StorageAccountCreateParameters parameters) { - return beginCreateAsync(resourceGroupName, accountName, parameters).getSyncPoller(); - } - - /** - * Asynchronously creates a new storage account with the specified parameters. If an account is already created and - * a subsequent create request is issued with different properties, the account properties will be updated. If an - * account is already created and a subsequent create or update request is issued with the exact same set of - * properties, the request will succeed. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The parameters to provide for the created account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, StorageAccountInner> beginCreate( - String resourceGroupName, String accountName, StorageAccountCreateParameters parameters, Context context) { - return beginCreateAsync(resourceGroupName, accountName, parameters, context).getSyncPoller(); - } - - /** - * Asynchronously creates a new storage account with the specified parameters. If an account is already created and - * a subsequent create request is issued with different properties, the account properties will be updated. If an - * account is already created and a subsequent create or update request is issued with the exact same set of - * properties, the request will succeed. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The parameters to provide for the created account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createAsync( - String resourceGroupName, String accountName, StorageAccountCreateParameters parameters) { - return beginCreateAsync(resourceGroupName, accountName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Asynchronously creates a new storage account with the specified parameters. If an account is already created and - * a subsequent create request is issued with different properties, the account properties will be updated. If an - * account is already created and a subsequent create or update request is issued with the exact same set of - * properties, the request will succeed. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The parameters to provide for the created account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync( - String resourceGroupName, String accountName, StorageAccountCreateParameters parameters, Context context) { - return beginCreateAsync(resourceGroupName, accountName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Asynchronously creates a new storage account with the specified parameters. If an account is already created and - * a subsequent create request is issued with different properties, the account properties will be updated. If an - * account is already created and a subsequent create or update request is issued with the exact same set of - * properties, the request will succeed. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The parameters to provide for the created account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public StorageAccountInner create( - String resourceGroupName, String accountName, StorageAccountCreateParameters parameters) { - return createAsync(resourceGroupName, accountName, parameters).block(); - } - - /** - * Asynchronously creates a new storage account with the specified parameters. If an account is already created and - * a subsequent create request is issued with different properties, the account properties will be updated. If an - * account is already created and a subsequent create or update request is issued with the exact same set of - * properties, the request will succeed. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The parameters to provide for the created account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public StorageAccountInner create( - String resourceGroupName, String accountName, StorageAccountCreateParameters parameters, Context context) { - return createAsync(resourceGroupName, accountName, parameters, context).block(); - } - - /** - * Deletes a storage account in Microsoft Azure. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String resourceGroupName, String accountName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a storage account in Microsoft Azure. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String accountName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - context); - } - - /** - * Deletes a storage account in Microsoft Azure. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String accountName) { - return deleteWithResponseAsync(resourceGroupName, accountName).flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes a storage account in Microsoft Azure. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String accountName) { - deleteAsync(resourceGroupName, accountName).block(); - } - - /** - * Deletes a storage account in Microsoft Azure. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String accountName, Context context) { - return deleteWithResponseAsync(resourceGroupName, accountName, context).block(); - } - - /** - * Returns the properties for the specified storage account including but not limited to name, SKU name, location, - * and account status. The ListKeys operation should be used to retrieve storage keys. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param expand May be used to expand the properties within account's properties. By default, data is not included - * when fetching properties. Currently we only support geoReplicationStats and blobRestoreStatus. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String accountName, StorageAccountExpand expand) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - expand, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns the properties for the specified storage account including but not limited to name, SKU name, location, - * and account status. The ListKeys operation should be used to retrieve storage keys. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param expand May be used to expand the properties within account's properties. By default, data is not included - * when fetching properties. Currently we only support geoReplicationStats and blobRestoreStatus. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String accountName, StorageAccountExpand expand, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - expand, - accept, - context); - } - - /** - * Returns the properties for the specified storage account including but not limited to name, SKU name, location, - * and account status. The ListKeys operation should be used to retrieve storage keys. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param expand May be used to expand the properties within account's properties. By default, data is not included - * when fetching properties. Currently we only support geoReplicationStats and blobRestoreStatus. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync( - String resourceGroupName, String accountName, StorageAccountExpand expand) { - return getByResourceGroupWithResponseAsync(resourceGroupName, accountName, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Returns the properties for the specified storage account including but not limited to name, SKU name, location, - * and account status. The ListKeys operation should be used to retrieve storage keys. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync(String resourceGroupName, String accountName) { - final StorageAccountExpand expand = null; - return getByResourceGroupWithResponseAsync(resourceGroupName, accountName, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Returns the properties for the specified storage account including but not limited to name, SKU name, location, - * and account status. The ListKeys operation should be used to retrieve storage keys. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public StorageAccountInner getByResourceGroup(String resourceGroupName, String accountName) { - final StorageAccountExpand expand = null; - return getByResourceGroupAsync(resourceGroupName, accountName, expand).block(); - } - - /** - * Returns the properties for the specified storage account including but not limited to name, SKU name, location, - * and account status. The ListKeys operation should be used to retrieve storage keys. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param expand May be used to expand the properties within account's properties. By default, data is not included - * when fetching properties. Currently we only support geoReplicationStats and blobRestoreStatus. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String accountName, StorageAccountExpand expand, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, accountName, expand, context).block(); - } - - /** - * The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. It - * can also be used to map the account to a custom domain. Only one custom domain is supported per storage account; - * the replacement/change of custom domain is not supported. In order to replace an old custom domain, the old value - * must be cleared/unregistered before a new value can be set. The update of multiple properties is supported. This - * call does not change the storage keys for the account. If you want to change the storage account keys, use the - * regenerate keys operation. The location and name of the storage account cannot be changed after creation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The parameters to provide for the updated account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateWithResponseAsync( - String resourceGroupName, String accountName, StorageAccountUpdateParameters parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. It - * can also be used to map the account to a custom domain. Only one custom domain is supported per storage account; - * the replacement/change of custom domain is not supported. In order to replace an old custom domain, the old value - * must be cleared/unregistered before a new value can be set. The update of multiple properties is supported. This - * call does not change the storage keys for the account. If you want to change the storage account keys, use the - * regenerate keys operation. The location and name of the storage account cannot be changed after creation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The parameters to provide for the updated account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, String accountName, StorageAccountUpdateParameters parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. It - * can also be used to map the account to a custom domain. Only one custom domain is supported per storage account; - * the replacement/change of custom domain is not supported. In order to replace an old custom domain, the old value - * must be cleared/unregistered before a new value can be set. The update of multiple properties is supported. This - * call does not change the storage keys for the account. If you want to change the storage account keys, use the - * regenerate keys operation. The location and name of the storage account cannot be changed after creation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The parameters to provide for the updated account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync( - String resourceGroupName, String accountName, StorageAccountUpdateParameters parameters) { - return updateWithResponseAsync(resourceGroupName, accountName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. It - * can also be used to map the account to a custom domain. Only one custom domain is supported per storage account; - * the replacement/change of custom domain is not supported. In order to replace an old custom domain, the old value - * must be cleared/unregistered before a new value can be set. The update of multiple properties is supported. This - * call does not change the storage keys for the account. If you want to change the storage account keys, use the - * regenerate keys operation. The location and name of the storage account cannot be changed after creation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The parameters to provide for the updated account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public StorageAccountInner update( - String resourceGroupName, String accountName, StorageAccountUpdateParameters parameters) { - return updateAsync(resourceGroupName, accountName, parameters).block(); - } - - /** - * The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. It - * can also be used to map the account to a custom domain. Only one custom domain is supported per storage account; - * the replacement/change of custom domain is not supported. In order to replace an old custom domain, the old value - * must be cleared/unregistered before a new value can be set. The update of multiple properties is supported. This - * call does not change the storage keys for the account. If you want to change the storage account keys, use the - * regenerate keys operation. The location and name of the storage account cannot be changed after creation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The parameters to provide for the updated account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, String accountName, StorageAccountUpdateParameters parameters, Context context) { - return updateWithResponseAsync(resourceGroupName, accountName, parameters, context).block(); - } - - /** - * Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the - * ListKeys operation for this. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the List Storage Accounts operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the - * ListKeys operation for this. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the List Storage Accounts operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the - * ListKeys operation for this. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the List Storage Accounts operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the - * ListKeys operation for this. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the List Storage Accounts operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the - * ListKeys operation for this. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the List Storage Accounts operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the - * ListKeys operation for this. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the List Storage Accounts operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; - * use the ListKeys operation for this. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the List Storage Accounts operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; - * use the ListKeys operation for this. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the List Storage Accounts operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); - } - - /** - * Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; - * use the ListKeys operation for this. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the List Storage Accounts operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName)); - } - - /** - * Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; - * use the ListKeys operation for this. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the List Storage Accounts operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context)); - } - - /** - * Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; - * use the ListKeys operation for this. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the List Storage Accounts operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; - * use the ListKeys operation for this. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the List Storage Accounts operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param expand Specifies type of the key to be listed. Possible value is kerb. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the ListKeys operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listKeysWithResponseAsync( - String resourceGroupName, String accountName, ListKeyExpand expand) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listKeys( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - expand, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param expand Specifies type of the key to be listed. Possible value is kerb. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the ListKeys operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listKeysWithResponseAsync( - String resourceGroupName, String accountName, ListKeyExpand expand, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listKeys( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - expand, - accept, - context); - } - - /** - * Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param expand Specifies type of the key to be listed. Possible value is kerb. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the ListKeys operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listKeysAsync( - String resourceGroupName, String accountName, ListKeyExpand expand) { - return listKeysWithResponseAsync(resourceGroupName, accountName, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the ListKeys operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listKeysAsync(String resourceGroupName, String accountName) { - final ListKeyExpand expand = null; - return listKeysWithResponseAsync(resourceGroupName, accountName, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the ListKeys operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public StorageAccountListKeysResultInner listKeys(String resourceGroupName, String accountName) { - final ListKeyExpand expand = null; - return listKeysAsync(resourceGroupName, accountName, expand).block(); - } - - /** - * Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param expand Specifies type of the key to be listed. Possible value is kerb. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the ListKeys operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listKeysWithResponse( - String resourceGroupName, String accountName, ListKeyExpand expand, Context context) { - return listKeysWithResponseAsync(resourceGroupName, accountName, expand, context).block(); - } - - /** - * Regenerates one of the access keys or Kerberos keys for the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param regenerateKey Specifies name of the key which should be regenerated -- key1, key2, kerb1, kerb2. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the ListKeys operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> regenerateKeyWithResponseAsync( - String resourceGroupName, String accountName, StorageAccountRegenerateKeyParameters regenerateKey) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (regenerateKey == null) { - return Mono.error(new IllegalArgumentException("Parameter regenerateKey is required and cannot be null.")); - } else { - regenerateKey.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .regenerateKey( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - regenerateKey, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Regenerates one of the access keys or Kerberos keys for the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param regenerateKey Specifies name of the key which should be regenerated -- key1, key2, kerb1, kerb2. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the ListKeys operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> regenerateKeyWithResponseAsync( - String resourceGroupName, - String accountName, - StorageAccountRegenerateKeyParameters regenerateKey, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (regenerateKey == null) { - return Mono.error(new IllegalArgumentException("Parameter regenerateKey is required and cannot be null.")); - } else { - regenerateKey.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .regenerateKey( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - regenerateKey, - accept, - context); - } - - /** - * Regenerates one of the access keys or Kerberos keys for the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param regenerateKey Specifies name of the key which should be regenerated -- key1, key2, kerb1, kerb2. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the ListKeys operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono regenerateKeyAsync( - String resourceGroupName, String accountName, StorageAccountRegenerateKeyParameters regenerateKey) { - return regenerateKeyWithResponseAsync(resourceGroupName, accountName, regenerateKey) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Regenerates one of the access keys or Kerberos keys for the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param regenerateKey Specifies name of the key which should be regenerated -- key1, key2, kerb1, kerb2. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the ListKeys operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public StorageAccountListKeysResultInner regenerateKey( - String resourceGroupName, String accountName, StorageAccountRegenerateKeyParameters regenerateKey) { - return regenerateKeyAsync(resourceGroupName, accountName, regenerateKey).block(); - } - - /** - * Regenerates one of the access keys or Kerberos keys for the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param regenerateKey Specifies name of the key which should be regenerated -- key1, key2, kerb1, kerb2. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the ListKeys operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response regenerateKeyWithResponse( - String resourceGroupName, - String accountName, - StorageAccountRegenerateKeyParameters regenerateKey, - Context context) { - return regenerateKeyWithResponseAsync(resourceGroupName, accountName, regenerateKey, context).block(); - } - - /** - * List SAS credentials of a storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The parameters to provide to list SAS credentials for the storage account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List SAS credentials operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listAccountSasWithResponseAsync( - String resourceGroupName, String accountName, AccountSasParameters parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listAccountSas( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List SAS credentials of a storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The parameters to provide to list SAS credentials for the storage account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List SAS credentials operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAccountSasWithResponseAsync( - String resourceGroupName, String accountName, AccountSasParameters parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listAccountSas( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * List SAS credentials of a storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The parameters to provide to list SAS credentials for the storage account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List SAS credentials operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listAccountSasAsync( - String resourceGroupName, String accountName, AccountSasParameters parameters) { - return listAccountSasWithResponseAsync(resourceGroupName, accountName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * List SAS credentials of a storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The parameters to provide to list SAS credentials for the storage account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List SAS credentials operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ListAccountSasResponseInner listAccountSas( - String resourceGroupName, String accountName, AccountSasParameters parameters) { - return listAccountSasAsync(resourceGroupName, accountName, parameters).block(); - } - - /** - * List SAS credentials of a storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The parameters to provide to list SAS credentials for the storage account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List SAS credentials operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listAccountSasWithResponse( - String resourceGroupName, String accountName, AccountSasParameters parameters, Context context) { - return listAccountSasWithResponseAsync(resourceGroupName, accountName, parameters, context).block(); - } - - /** - * List service SAS credentials of a specific resource. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The parameters to provide to list service SAS credentials. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List service SAS credentials operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listServiceSasWithResponseAsync( - String resourceGroupName, String accountName, ServiceSasParameters parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listServiceSas( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List service SAS credentials of a specific resource. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The parameters to provide to list service SAS credentials. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List service SAS credentials operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listServiceSasWithResponseAsync( - String resourceGroupName, String accountName, ServiceSasParameters parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listServiceSas( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * List service SAS credentials of a specific resource. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The parameters to provide to list service SAS credentials. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List service SAS credentials operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listServiceSasAsync( - String resourceGroupName, String accountName, ServiceSasParameters parameters) { - return listServiceSasWithResponseAsync(resourceGroupName, accountName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * List service SAS credentials of a specific resource. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The parameters to provide to list service SAS credentials. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List service SAS credentials operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ListServiceSasResponseInner listServiceSas( - String resourceGroupName, String accountName, ServiceSasParameters parameters) { - return listServiceSasAsync(resourceGroupName, accountName, parameters).block(); - } - - /** - * List service SAS credentials of a specific resource. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The parameters to provide to list service SAS credentials. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List service SAS credentials operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listServiceSasWithResponse( - String resourceGroupName, String accountName, ServiceSasParameters parameters, Context context) { - return listServiceSasWithResponseAsync(resourceGroupName, accountName, parameters, context).block(); - } - - /** - * Failover request can be triggered for a storage account in case of availability issues. The failover occurs from - * the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become - * primary after failover. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> failoverWithResponseAsync(String resourceGroupName, String accountName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .failover( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Failover request can be triggered for a storage account in case of availability issues. The failover occurs from - * the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become - * primary after failover. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> failoverWithResponseAsync( - String resourceGroupName, String accountName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .failover( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - context); - } - - /** - * Failover request can be triggered for a storage account in case of availability issues. The failover occurs from - * the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become - * primary after failover. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginFailoverAsync(String resourceGroupName, String accountName) { - Mono>> mono = failoverWithResponseAsync(resourceGroupName, accountName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Failover request can be triggered for a storage account in case of availability issues. The failover occurs from - * the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become - * primary after failover. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginFailoverAsync( - String resourceGroupName, String accountName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = failoverWithResponseAsync(resourceGroupName, accountName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Failover request can be triggered for a storage account in case of availability issues. The failover occurs from - * the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become - * primary after failover. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginFailover(String resourceGroupName, String accountName) { - return beginFailoverAsync(resourceGroupName, accountName).getSyncPoller(); - } - - /** - * Failover request can be triggered for a storage account in case of availability issues. The failover occurs from - * the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become - * primary after failover. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginFailover( - String resourceGroupName, String accountName, Context context) { - return beginFailoverAsync(resourceGroupName, accountName, context).getSyncPoller(); - } - - /** - * Failover request can be triggered for a storage account in case of availability issues. The failover occurs from - * the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become - * primary after failover. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono failoverAsync(String resourceGroupName, String accountName) { - return beginFailoverAsync(resourceGroupName, accountName).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Failover request can be triggered for a storage account in case of availability issues. The failover occurs from - * the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become - * primary after failover. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono failoverAsync(String resourceGroupName, String accountName, Context context) { - return beginFailoverAsync(resourceGroupName, accountName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Failover request can be triggered for a storage account in case of availability issues. The failover occurs from - * the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become - * primary after failover. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void failover(String resourceGroupName, String accountName) { - failoverAsync(resourceGroupName, accountName).block(); - } - - /** - * Failover request can be triggered for a storage account in case of availability issues. The failover occurs from - * the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become - * primary after failover. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void failover(String resourceGroupName, String accountName, Context context) { - failoverAsync(resourceGroupName, accountName, context).block(); - } - - /** - * Restore blobs in the specified blob ranges. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The parameters to provide for restore blob ranges. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return blob restore status. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> restoreBlobRangesWithResponseAsync( - String resourceGroupName, String accountName, BlobRestoreParameters parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .restoreBlobRanges( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Restore blobs in the specified blob ranges. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The parameters to provide for restore blob ranges. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return blob restore status. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> restoreBlobRangesWithResponseAsync( - String resourceGroupName, String accountName, BlobRestoreParameters parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .restoreBlobRanges( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Restore blobs in the specified blob ranges. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The parameters to provide for restore blob ranges. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return blob restore status. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, BlobRestoreStatusInner> beginRestoreBlobRangesAsync( - String resourceGroupName, String accountName, BlobRestoreParameters parameters) { - Mono>> mono = - restoreBlobRangesWithResponseAsync(resourceGroupName, accountName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - BlobRestoreStatusInner.class, - BlobRestoreStatusInner.class, - Context.NONE); - } - - /** - * Restore blobs in the specified blob ranges. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The parameters to provide for restore blob ranges. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return blob restore status. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, BlobRestoreStatusInner> beginRestoreBlobRangesAsync( - String resourceGroupName, String accountName, BlobRestoreParameters parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - restoreBlobRangesWithResponseAsync(resourceGroupName, accountName, parameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - BlobRestoreStatusInner.class, - BlobRestoreStatusInner.class, - context); - } - - /** - * Restore blobs in the specified blob ranges. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The parameters to provide for restore blob ranges. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return blob restore status. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, BlobRestoreStatusInner> beginRestoreBlobRanges( - String resourceGroupName, String accountName, BlobRestoreParameters parameters) { - return beginRestoreBlobRangesAsync(resourceGroupName, accountName, parameters).getSyncPoller(); - } - - /** - * Restore blobs in the specified blob ranges. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The parameters to provide for restore blob ranges. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return blob restore status. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, BlobRestoreStatusInner> beginRestoreBlobRanges( - String resourceGroupName, String accountName, BlobRestoreParameters parameters, Context context) { - return beginRestoreBlobRangesAsync(resourceGroupName, accountName, parameters, context).getSyncPoller(); - } - - /** - * Restore blobs in the specified blob ranges. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The parameters to provide for restore blob ranges. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return blob restore status. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono restoreBlobRangesAsync( - String resourceGroupName, String accountName, BlobRestoreParameters parameters) { - return beginRestoreBlobRangesAsync(resourceGroupName, accountName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Restore blobs in the specified blob ranges. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The parameters to provide for restore blob ranges. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return blob restore status. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono restoreBlobRangesAsync( - String resourceGroupName, String accountName, BlobRestoreParameters parameters, Context context) { - return beginRestoreBlobRangesAsync(resourceGroupName, accountName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Restore blobs in the specified blob ranges. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The parameters to provide for restore blob ranges. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return blob restore status. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BlobRestoreStatusInner restoreBlobRanges( - String resourceGroupName, String accountName, BlobRestoreParameters parameters) { - return restoreBlobRangesAsync(resourceGroupName, accountName, parameters).block(); - } - - /** - * Restore blobs in the specified blob ranges. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The parameters to provide for restore blob ranges. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return blob restore status. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BlobRestoreStatusInner restoreBlobRanges( - String resourceGroupName, String accountName, BlobRestoreParameters parameters, Context context) { - return restoreBlobRangesAsync(resourceGroupName, accountName, parameters, context).block(); - } - - /** - * Revoke user delegation keys. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> revokeUserDelegationKeysWithResponseAsync( - String resourceGroupName, String accountName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .revokeUserDelegationKeys( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Revoke user delegation keys. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> revokeUserDelegationKeysWithResponseAsync( - String resourceGroupName, String accountName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service - .revokeUserDelegationKeys( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - context); - } - - /** - * Revoke user delegation keys. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono revokeUserDelegationKeysAsync(String resourceGroupName, String accountName) { - return revokeUserDelegationKeysWithResponseAsync(resourceGroupName, accountName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Revoke user delegation keys. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void revokeUserDelegationKeys(String resourceGroupName, String accountName) { - revokeUserDelegationKeysAsync(resourceGroupName, accountName).block(); - } - - /** - * Revoke user delegation keys. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response revokeUserDelegationKeysWithResponse( - String resourceGroupName, String accountName, Context context) { - return revokeUserDelegationKeysWithResponseAsync(resourceGroupName, accountName, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the List Storage Accounts operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the List Storage Accounts operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/StorageAccountsImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/StorageAccountsImpl.java deleted file mode 100644 index 9a6fe11819a2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/StorageAccountsImpl.java +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.storage.implementation; - -import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.TopLevelModifiableResourcesImpl; -import com.azure.resourcemanager.storage.StorageManager; -import com.azure.resourcemanager.storage.fluent.StorageAccountsClient; -import com.azure.resourcemanager.storage.fluent.models.ListServiceSasResponseInner; -import com.azure.resourcemanager.storage.models.CheckNameAvailabilityResult; -import com.azure.resourcemanager.storage.models.MinimumTlsVersion; -import com.azure.resourcemanager.storage.models.ServiceSasParameters; -import com.azure.resourcemanager.storage.models.StorageAccount; -import com.azure.resourcemanager.storage.models.StorageAccountCheckNameAvailabilityParameters; -import com.azure.resourcemanager.storage.models.StorageAccountSkuType; -import com.azure.resourcemanager.storage.models.StorageAccounts; -import com.azure.resourcemanager.storage.fluent.models.StorageAccountInner; -import reactor.core.publisher.Mono; - -/** The implementation of StorageAccounts and its parent interfaces. */ -public class StorageAccountsImpl - extends TopLevelModifiableResourcesImpl< - StorageAccount, StorageAccountImpl, StorageAccountInner, StorageAccountsClient, StorageManager> - implements StorageAccounts { - - public StorageAccountsImpl(final StorageManager storageManager) { - super(storageManager.serviceClient().getStorageAccounts(), storageManager); - } - - @Override - public CheckNameAvailabilityResult checkNameAvailability(String name) { - return this.checkNameAvailabilityAsync(name).block(); - } - - @Override - public Mono checkNameAvailabilityAsync(String name) { - return this - .inner() - .checkNameAvailabilityAsync(new StorageAccountCheckNameAvailabilityParameters().withName(name)) - .map(CheckNameAvailabilityResult::new); - } - - @Override - public StorageAccountImpl define(String name) { - return wrapModel(name) - .withSku(StorageAccountSkuType.STANDARD_RAGRS) - .withGeneralPurposeAccountKindV2() - .withOnlyHttpsTraffic() - .withMinimumTlsVersion(MinimumTlsVersion.TLS1_2) - .withBlobEncryption() - .withFileEncryption(); - } - - @Override - protected StorageAccountImpl wrapModel(String name) { - return new StorageAccountImpl(name, new StorageAccountInner(), this.manager()); - } - - @Override - protected StorageAccountImpl wrapModel(StorageAccountInner storageAccountInner) { - if (storageAccountInner == null) { - return null; - } - return new StorageAccountImpl(storageAccountInner.name(), storageAccountInner, this.manager()); - } - - @Override - public String createSasToken(String resourceGroupName, String accountName, ServiceSasParameters parameters) { - return createSasTokenAsync(resourceGroupName, accountName, parameters).block(); - } - - @Override - public Mono createSasTokenAsync( - String resourceGroupName, String accountName, ServiceSasParameters parameters) { - return this - .inner() - .listServiceSasAsync(resourceGroupName, accountName, parameters) - .map(ListServiceSasResponseInner::serviceSasToken); - } - - @Override - public void failover(String resourceGroupName, String accountName) { - failoverAsync(resourceGroupName, accountName).block(); - } - - @Override - public Mono failoverAsync(String resourceGroupName, String accountName) { - return this.inner().failoverAsync(resourceGroupName, accountName); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/StorageEncryptionHelper.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/StorageEncryptionHelper.java deleted file mode 100644 index 5d4374fec882..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/StorageEncryptionHelper.java +++ /dev/null @@ -1,312 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.storage.implementation; - -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import com.azure.resourcemanager.storage.models.Encryption; -import com.azure.resourcemanager.storage.models.EncryptionService; -import com.azure.resourcemanager.storage.models.EncryptionServices; -import com.azure.resourcemanager.storage.models.KeySource; -import com.azure.resourcemanager.storage.models.KeyType; -import com.azure.resourcemanager.storage.models.KeyVaultProperties; -import com.azure.resourcemanager.storage.models.StorageAccountCreateParameters; -import com.azure.resourcemanager.storage.models.StorageAccountEncryptionKeySource; -import com.azure.resourcemanager.storage.models.StorageAccountEncryptionStatus; -import com.azure.resourcemanager.storage.models.StorageAccountUpdateParameters; -import com.azure.resourcemanager.storage.models.StorageService; -import com.azure.resourcemanager.storage.fluent.models.StorageAccountInner; -import java.util.HashMap; -import java.util.Map; - -final class StorageEncryptionHelper { - private final boolean isInCreateMode; - private final StorageAccountInner inner; - private final StorageAccountCreateParameters createParameters; - private final StorageAccountUpdateParameters updateParameters; - - /** - * Creates StorageEncryptionHelper. - * - * @param createParameters the model representing payload for storage account create. - */ - StorageEncryptionHelper(StorageAccountCreateParameters createParameters) { - this.isInCreateMode = true; - this.createParameters = createParameters; - this.updateParameters = null; - this.inner = null; - } - - /** - * Creates StorageEncryptionHelper. - * - * @param updateParameters the model representing payload for storage account update - * @param inner the current state of storage account - */ - StorageEncryptionHelper(StorageAccountUpdateParameters updateParameters, final StorageAccountInner inner) { - this.isInCreateMode = false; - this.createParameters = null; - this.updateParameters = updateParameters; - this.inner = inner; - } - - /** - * Gets the encryption key source. - * - * @param inner the storage account - * @return the encryption key source type - */ - static StorageAccountEncryptionKeySource encryptionKeySource(StorageAccountInner inner) { - if (inner.encryption() == null || inner.encryption().keySource() == null) { - return null; - } - return StorageAccountEncryptionKeySource.fromString(inner.encryption().keySource().toString()); - } - - /** - * Gets the encryption status of various storage services. - * - * @param inner the storage account - * @return the map containing encryption statuses indexed by storage service name - */ - static Map encryptionStatuses(StorageAccountInner inner) { - HashMap statuses = new HashMap<>(); - EncryptionServices services = null; - if (inner.encryption() != null) { - services = inner.encryption().services(); - } - statuses.put(StorageService.BLOB, new BlobServiceEncryptionStatusImpl(services)); - statuses.put(StorageService.FILE, new FileServiceEncryptionStatusImpl(services)); - statuses.put(StorageService.TABLE, new TableServiceEncryptionStatusImpl(services)); - statuses.put(StorageService.QUEUE, new QueueServiceEncryptionStatusImpl(services)); - return statuses; - } - - boolean infrastructureEncryptionEnabled() { - return inner != null && inner.encryption() != null - && ResourceManagerUtils.toPrimitiveBoolean(inner.encryption().requireInfrastructureEncryption()); - } - - /** - * Specifies that storage blob encryption should be enabled. - * - * @return StorageEncryptionHelper - */ - StorageEncryptionHelper withBlobEncryption() { - Encryption encryption = getEncryptionConfig(true); - if (encryption.services() == null) { - encryption.withServices(new EncryptionServices()); - } - // Enable encryption for blob service - // - if (encryption.services().blob() == null) { - encryption.services().withBlob(new EncryptionService()); - } - encryption.services().blob().withEnabled(true); - if (encryption.keySource() == null) { - encryption.withKeySource(KeySource.MICROSOFT_STORAGE); - } - return this; - } - - /** - * Specifies that storage file encryption should be enabled. - * - * @return StorageEncryptionHelper - */ - StorageEncryptionHelper withFileEncryption() { - Encryption encryption = getEncryptionConfig(true); - if (encryption.services() == null) { - encryption.withServices(new EncryptionServices()); - } - // Enable encryption for file service - // - if (encryption.services().file() == null) { - encryption.services().withFile(new EncryptionService()); - } - encryption.services().file().withEnabled(true); - if (encryption.keySource() == null) { - encryption.withKeySource(KeySource.MICROSOFT_STORAGE); - } - return this; - } - - StorageEncryptionHelper withTableEncryption() { - Encryption encryption = getEncryptionConfig(true); - if (encryption.services() == null) { - encryption.withServices(new EncryptionServices()); - } - if (encryption.services().table() == null) { - encryption.services().withTable(new EncryptionService()); - } - encryption.services().table().withEnabled(true); - encryption.services().table().withKeyType(KeyType.ACCOUNT); - if (encryption.keySource() == null) { - encryption.withKeySource(KeySource.MICROSOFT_STORAGE); - } - return this; - } - - StorageEncryptionHelper withQueueEncryption() { - Encryption encryption = getEncryptionConfig(true); - if (encryption.services() == null) { - encryption.withServices(new EncryptionServices()); - } - if (encryption.services().queue() == null) { - encryption.services().withQueue(new EncryptionService()); - } - encryption.services().queue().withEnabled(true); - encryption.services().queue().withKeyType(KeyType.ACCOUNT); - if (encryption.keySource() == null) { - encryption.withKeySource(KeySource.MICROSOFT_STORAGE); - } - return this; - } - - StorageEncryptionHelper withInfrastructureEncryption() { - Encryption encryption = getEncryptionConfig(true); - encryption.withRequireInfrastructureEncryption(true); - return this; - } - - /** - * Specifies the key vault key to be used to encrypt the blobs and files. - * - * @return StorageEncryptionHelper - */ - StorageEncryptionHelper withEncryptionKeyFromKeyVault(String keyVaultUri, String keyName, String keyVersion) { - Encryption encryption = getEncryptionConfig(true); - encryption.withKeySource(KeySource.MICROSOFT_KEYVAULT); - encryption - .withKeyVaultProperties( - new KeyVaultProperties().withKeyVaultUri(keyVaultUri).withKeyName(keyName).withKeyVersion(keyVersion)); - return this; - } - - /** - * Specifies that blob encryption should be disabled for storage blob. - * - * @return StorageEncryptionHelper - */ - StorageEncryptionHelper withoutBlobEncryption() { - Encryption encryption = getEncryptionConfig(true); - if (encryption.services() == null) { - encryption.withServices(new EncryptionServices()); - } - // Disable encryption for blob service - // - if (encryption.services().blob() == null) { - encryption.services().withBlob(new EncryptionService()); - } - encryption.services().blob().withEnabled(false); - if (encryption.keySource() == null) { - encryption.withKeySource(KeySource.MICROSOFT_STORAGE); - } - return this; - } - - /** - * Specifies that encryption should be disabled for storage file. - * - * @return StorageEncryptionHelper - */ - StorageEncryptionHelper withoutFileEncryption() { - Encryption encryption = getEncryptionConfig(true); - if (encryption.services() == null) { - encryption.withServices(new EncryptionServices()); - } - // Disable encryption for blob service - // - if (encryption.services().file() == null) { - encryption.services().withFile(new EncryptionService()); - } - encryption.services().file().withEnabled(false); - if (encryption.keySource() == null) { - encryption.withKeySource(KeySource.MICROSOFT_STORAGE); - } - return this; - } - - /** - * Gets the encryption configuration. - * - * @param createIfNotExists flag indicating whether to create a encryption config if it does not exists already - * @return the encryption configuration - */ - private Encryption getEncryptionConfig(boolean createIfNotExists) { - if (isInCreateMode) { - if (this.createParameters.encryption() == null) { - if (createIfNotExists) { - this.createParameters.withEncryption(new Encryption()); - } else { - return null; - } - } - return this.createParameters.encryption(); - } else { - if (this.updateParameters.encryption() == null) { - if (this.inner.encryption() == null) { - if (createIfNotExists) { - this.updateParameters.withEncryption(new Encryption()); - } else { - return null; - } - } else { - // Create clone of current encrption - // - Encryption clonedEncryption = new Encryption(); - clonedEncryption.withKeySource(this.inner.encryption().keySource()); - if (this.inner.encryption().requireInfrastructureEncryption() != null) { - clonedEncryption.withRequireInfrastructureEncryption( - this.inner.encryption().requireInfrastructureEncryption()); - } - if (this.inner.encryption().keyVaultProperties() != null) { - clonedEncryption.withKeyVaultProperties(new KeyVaultProperties()); - clonedEncryption - .keyVaultProperties() - .withKeyName(this.inner.encryption().keyVaultProperties().keyName()) - .withKeyVaultUri(this.inner.encryption().keyVaultProperties().keyVaultUri()) - .withKeyVersion(this.inner.encryption().keyVaultProperties().keyVersion()); - } - if (this.inner.encryption().services() != null) { - clonedEncryption.withServices(new EncryptionServices()); - if (this.inner.encryption().services().blob() != null) { - clonedEncryption.services().withBlob(new EncryptionService()); - clonedEncryption - .services() - .blob() - .withEnabled(this.inner.encryption().services().blob().enabled()) - .withKeyType(this.inner.encryption().services().blob().keyType()); - } - if (this.inner.encryption().services().file() != null) { - clonedEncryption.services().withFile(new EncryptionService()); - clonedEncryption - .services() - .file() - .withEnabled(this.inner.encryption().services().file().enabled()) - .withKeyType(this.inner.encryption().services().file().keyType()); - } - if (this.inner.encryption().services().table() != null) { - clonedEncryption.services().withTable(new EncryptionService()); - clonedEncryption - .services() - .table() - .withEnabled(this.inner.encryption().services().table().enabled()) - .withKeyType(this.inner.encryption().services().table().keyType()); - } - if (this.inner.encryption().services().queue() != null) { - clonedEncryption.services().withQueue(new EncryptionService()); - clonedEncryption - .services() - .queue() - .withEnabled(this.inner.encryption().services().queue().enabled()) - .withKeyType(this.inner.encryption().services().queue().keyType()); - } - } - this.updateParameters.withEncryption(clonedEncryption); - } - } - return this.updateParameters.encryption(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/StorageManagementClientBuilder.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/StorageManagementClientBuilder.java deleted file mode 100644 index 376b12240540..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/StorageManagementClientBuilder.java +++ /dev/null @@ -1,146 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.implementation; - -import com.azure.core.annotation.ServiceClientBuilder; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.policy.CookiePolicy; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerAdapter; -import java.time.Duration; - -/** A builder for creating a new instance of the StorageManagementClientImpl type. */ -@ServiceClientBuilder(serviceClients = {StorageManagementClientImpl.class}) -public final class StorageManagementClientBuilder { - /* - * The ID of the target subscription. - */ - private String subscriptionId; - - /** - * Sets The ID of the target subscription. - * - * @param subscriptionId the subscriptionId value. - * @return the StorageManagementClientBuilder. - */ - public StorageManagementClientBuilder subscriptionId(String subscriptionId) { - this.subscriptionId = subscriptionId; - return this; - } - - /* - * server parameter - */ - private String endpoint; - - /** - * Sets server parameter. - * - * @param endpoint the endpoint value. - * @return the StorageManagementClientBuilder. - */ - public StorageManagementClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * The environment to connect to - */ - private AzureEnvironment environment; - - /** - * Sets The environment to connect to. - * - * @param environment the environment value. - * @return the StorageManagementClientBuilder. - */ - public StorageManagementClientBuilder environment(AzureEnvironment environment) { - this.environment = environment; - return this; - } - - /* - * The default poll interval for long-running operation - */ - private Duration defaultPollInterval; - - /** - * Sets The default poll interval for long-running operation. - * - * @param defaultPollInterval the defaultPollInterval value. - * @return the StorageManagementClientBuilder. - */ - public StorageManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = defaultPollInterval; - return this; - } - - /* - * The HTTP pipeline to send requests through - */ - private HttpPipeline pipeline; - - /** - * Sets The HTTP pipeline to send requests through. - * - * @param pipeline the pipeline value. - * @return the StorageManagementClientBuilder. - */ - public StorageManagementClientBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; - return this; - } - - /* - * The serializer to serialize an object into a string - */ - private SerializerAdapter serializerAdapter; - - /** - * Sets The serializer to serialize an object into a string. - * - * @param serializerAdapter the serializerAdapter value. - * @return the StorageManagementClientBuilder. - */ - public StorageManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { - this.serializerAdapter = serializerAdapter; - return this; - } - - /** - * Builds an instance of StorageManagementClientImpl with the provided parameters. - * - * @return an instance of StorageManagementClientImpl. - */ - public StorageManagementClientImpl buildClient() { - if (endpoint == null) { - this.endpoint = "https://management.azure.com"; - } - if (environment == null) { - this.environment = AzureEnvironment.AZURE; - } - if (defaultPollInterval == null) { - this.defaultPollInterval = Duration.ofSeconds(30); - } - if (pipeline == null) { - this.pipeline = - new HttpPipelineBuilder() - .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) - .build(); - } - if (serializerAdapter == null) { - this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); - } - StorageManagementClientImpl client = - new StorageManagementClientImpl( - pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); - return client; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/StorageManagementClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/StorageManagementClientImpl.java deleted file mode 100644 index 3a8da59ae138..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/StorageManagementClientImpl.java +++ /dev/null @@ -1,370 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.implementation; - -import com.azure.core.annotation.ServiceClient; -import com.azure.core.http.HttpPipeline; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.serializer.SerializerAdapter; -import com.azure.resourcemanager.resources.fluentcore.AzureServiceClient; -import com.azure.resourcemanager.storage.fluent.BlobContainersClient; -import com.azure.resourcemanager.storage.fluent.BlobInventoryPoliciesClient; -import com.azure.resourcemanager.storage.fluent.BlobServicesClient; -import com.azure.resourcemanager.storage.fluent.EncryptionScopesClient; -import com.azure.resourcemanager.storage.fluent.FileServicesClient; -import com.azure.resourcemanager.storage.fluent.FileSharesClient; -import com.azure.resourcemanager.storage.fluent.ManagementPoliciesClient; -import com.azure.resourcemanager.storage.fluent.ObjectReplicationPoliciesOperationsClient; -import com.azure.resourcemanager.storage.fluent.OperationsClient; -import com.azure.resourcemanager.storage.fluent.PrivateEndpointConnectionsClient; -import com.azure.resourcemanager.storage.fluent.PrivateLinkResourcesClient; -import com.azure.resourcemanager.storage.fluent.QueueServicesClient; -import com.azure.resourcemanager.storage.fluent.QueuesClient; -import com.azure.resourcemanager.storage.fluent.SkusClient; -import com.azure.resourcemanager.storage.fluent.StorageAccountsClient; -import com.azure.resourcemanager.storage.fluent.StorageManagementClient; -import com.azure.resourcemanager.storage.fluent.TableServicesClient; -import com.azure.resourcemanager.storage.fluent.TablesClient; -import com.azure.resourcemanager.storage.fluent.UsagesClient; -import java.time.Duration; - -/** Initializes a new instance of the StorageManagementClientImpl type. */ -@ServiceClient(builder = StorageManagementClientBuilder.class) -public final class StorageManagementClientImpl extends AzureServiceClient implements StorageManagementClient { - private final ClientLogger logger = new ClientLogger(StorageManagementClientImpl.class); - - /** The ID of the target subscription. */ - private final String subscriptionId; - - /** - * Gets The ID of the target subscription. - * - * @return the subscriptionId value. - */ - public String getSubscriptionId() { - return this.subscriptionId; - } - - /** server parameter. */ - private final String endpoint; - - /** - * Gets server parameter. - * - * @return the endpoint value. - */ - public String getEndpoint() { - return this.endpoint; - } - - /** Api Version. */ - private final String apiVersion; - - /** - * Gets Api Version. - * - * @return the apiVersion value. - */ - public String getApiVersion() { - return this.apiVersion; - } - - /** The HTTP pipeline to send requests through. */ - private final HttpPipeline httpPipeline; - - /** - * Gets The HTTP pipeline to send requests through. - * - * @return the httpPipeline value. - */ - public HttpPipeline getHttpPipeline() { - return this.httpPipeline; - } - - /** The serializer to serialize an object into a string. */ - private final SerializerAdapter serializerAdapter; - - /** - * Gets The serializer to serialize an object into a string. - * - * @return the serializerAdapter value. - */ - SerializerAdapter getSerializerAdapter() { - return this.serializerAdapter; - } - - /** The default poll interval for long-running operation. */ - private final Duration defaultPollInterval; - - /** - * Gets The default poll interval for long-running operation. - * - * @return the defaultPollInterval value. - */ - public Duration getDefaultPollInterval() { - return this.defaultPollInterval; - } - - /** The OperationsClient object to access its operations. */ - private final OperationsClient operations; - - /** - * Gets the OperationsClient object to access its operations. - * - * @return the OperationsClient object. - */ - public OperationsClient getOperations() { - return this.operations; - } - - /** The SkusClient object to access its operations. */ - private final SkusClient skus; - - /** - * Gets the SkusClient object to access its operations. - * - * @return the SkusClient object. - */ - public SkusClient getSkus() { - return this.skus; - } - - /** The StorageAccountsClient object to access its operations. */ - private final StorageAccountsClient storageAccounts; - - /** - * Gets the StorageAccountsClient object to access its operations. - * - * @return the StorageAccountsClient object. - */ - public StorageAccountsClient getStorageAccounts() { - return this.storageAccounts; - } - - /** The UsagesClient object to access its operations. */ - private final UsagesClient usages; - - /** - * Gets the UsagesClient object to access its operations. - * - * @return the UsagesClient object. - */ - public UsagesClient getUsages() { - return this.usages; - } - - /** The ManagementPoliciesClient object to access its operations. */ - private final ManagementPoliciesClient managementPolicies; - - /** - * Gets the ManagementPoliciesClient object to access its operations. - * - * @return the ManagementPoliciesClient object. - */ - public ManagementPoliciesClient getManagementPolicies() { - return this.managementPolicies; - } - - /** The BlobInventoryPoliciesClient object to access its operations. */ - private final BlobInventoryPoliciesClient blobInventoryPolicies; - - /** - * Gets the BlobInventoryPoliciesClient object to access its operations. - * - * @return the BlobInventoryPoliciesClient object. - */ - public BlobInventoryPoliciesClient getBlobInventoryPolicies() { - return this.blobInventoryPolicies; - } - - /** The PrivateEndpointConnectionsClient object to access its operations. */ - private final PrivateEndpointConnectionsClient privateEndpointConnections; - - /** - * Gets the PrivateEndpointConnectionsClient object to access its operations. - * - * @return the PrivateEndpointConnectionsClient object. - */ - public PrivateEndpointConnectionsClient getPrivateEndpointConnections() { - return this.privateEndpointConnections; - } - - /** The PrivateLinkResourcesClient object to access its operations. */ - private final PrivateLinkResourcesClient privateLinkResources; - - /** - * Gets the PrivateLinkResourcesClient object to access its operations. - * - * @return the PrivateLinkResourcesClient object. - */ - public PrivateLinkResourcesClient getPrivateLinkResources() { - return this.privateLinkResources; - } - - /** The ObjectReplicationPoliciesOperationsClient object to access its operations. */ - private final ObjectReplicationPoliciesOperationsClient objectReplicationPoliciesOperations; - - /** - * Gets the ObjectReplicationPoliciesOperationsClient object to access its operations. - * - * @return the ObjectReplicationPoliciesOperationsClient object. - */ - public ObjectReplicationPoliciesOperationsClient getObjectReplicationPoliciesOperations() { - return this.objectReplicationPoliciesOperations; - } - - /** The EncryptionScopesClient object to access its operations. */ - private final EncryptionScopesClient encryptionScopes; - - /** - * Gets the EncryptionScopesClient object to access its operations. - * - * @return the EncryptionScopesClient object. - */ - public EncryptionScopesClient getEncryptionScopes() { - return this.encryptionScopes; - } - - /** The BlobServicesClient object to access its operations. */ - private final BlobServicesClient blobServices; - - /** - * Gets the BlobServicesClient object to access its operations. - * - * @return the BlobServicesClient object. - */ - public BlobServicesClient getBlobServices() { - return this.blobServices; - } - - /** The BlobContainersClient object to access its operations. */ - private final BlobContainersClient blobContainers; - - /** - * Gets the BlobContainersClient object to access its operations. - * - * @return the BlobContainersClient object. - */ - public BlobContainersClient getBlobContainers() { - return this.blobContainers; - } - - /** The FileServicesClient object to access its operations. */ - private final FileServicesClient fileServices; - - /** - * Gets the FileServicesClient object to access its operations. - * - * @return the FileServicesClient object. - */ - public FileServicesClient getFileServices() { - return this.fileServices; - } - - /** The FileSharesClient object to access its operations. */ - private final FileSharesClient fileShares; - - /** - * Gets the FileSharesClient object to access its operations. - * - * @return the FileSharesClient object. - */ - public FileSharesClient getFileShares() { - return this.fileShares; - } - - /** The QueueServicesClient object to access its operations. */ - private final QueueServicesClient queueServices; - - /** - * Gets the QueueServicesClient object to access its operations. - * - * @return the QueueServicesClient object. - */ - public QueueServicesClient getQueueServices() { - return this.queueServices; - } - - /** The QueuesClient object to access its operations. */ - private final QueuesClient queues; - - /** - * Gets the QueuesClient object to access its operations. - * - * @return the QueuesClient object. - */ - public QueuesClient getQueues() { - return this.queues; - } - - /** The TableServicesClient object to access its operations. */ - private final TableServicesClient tableServices; - - /** - * Gets the TableServicesClient object to access its operations. - * - * @return the TableServicesClient object. - */ - public TableServicesClient getTableServices() { - return this.tableServices; - } - - /** The TablesClient object to access its operations. */ - private final TablesClient tables; - - /** - * Gets the TablesClient object to access its operations. - * - * @return the TablesClient object. - */ - public TablesClient getTables() { - return this.tables; - } - - /** - * Initializes an instance of StorageManagementClient client. - * - * @param httpPipeline The HTTP pipeline to send requests through. - * @param serializerAdapter The serializer to serialize an object into a string. - * @param defaultPollInterval The default poll interval for long-running operation. - * @param environment The Azure environment. - * @param subscriptionId The ID of the target subscription. - * @param endpoint server parameter. - */ - StorageManagementClientImpl( - HttpPipeline httpPipeline, - SerializerAdapter serializerAdapter, - Duration defaultPollInterval, - AzureEnvironment environment, - String subscriptionId, - String endpoint) { - super(httpPipeline, serializerAdapter, environment); - this.httpPipeline = httpPipeline; - this.serializerAdapter = serializerAdapter; - this.defaultPollInterval = defaultPollInterval; - this.subscriptionId = subscriptionId; - this.endpoint = endpoint; - this.apiVersion = "2019-06-01"; - this.operations = new OperationsClientImpl(this); - this.skus = new SkusClientImpl(this); - this.storageAccounts = new StorageAccountsClientImpl(this); - this.usages = new UsagesClientImpl(this); - this.managementPolicies = new ManagementPoliciesClientImpl(this); - this.blobInventoryPolicies = new BlobInventoryPoliciesClientImpl(this); - this.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(this); - this.privateLinkResources = new PrivateLinkResourcesClientImpl(this); - this.objectReplicationPoliciesOperations = new ObjectReplicationPoliciesOperationsClientImpl(this); - this.encryptionScopes = new EncryptionScopesClientImpl(this); - this.blobServices = new BlobServicesClientImpl(this); - this.blobContainers = new BlobContainersClientImpl(this); - this.fileServices = new FileServicesClientImpl(this); - this.fileShares = new FileSharesClientImpl(this); - this.queueServices = new QueueServicesClientImpl(this); - this.queues = new QueuesClientImpl(this); - this.tableServices = new TableServicesClientImpl(this); - this.tables = new TablesClientImpl(this); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/StorageNetworkRulesHelper.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/StorageNetworkRulesHelper.java deleted file mode 100644 index 0e59e30d3055..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/StorageNetworkRulesHelper.java +++ /dev/null @@ -1,602 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.storage.implementation; - -import com.azure.resourcemanager.storage.models.Action; -import com.azure.resourcemanager.storage.models.Bypass; -import com.azure.resourcemanager.storage.models.DefaultAction; -import com.azure.resourcemanager.storage.models.IpRule; -import com.azure.resourcemanager.storage.models.NetworkRuleSet; -import com.azure.resourcemanager.storage.models.StorageAccountCreateParameters; -import com.azure.resourcemanager.storage.models.StorageAccountUpdateParameters; -import com.azure.resourcemanager.storage.models.VirtualNetworkRule; -import com.azure.resourcemanager.storage.fluent.models.StorageAccountInner; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Locale; -import java.util.Set; -import java.util.TreeSet; - -/** Helper to operate on storage account NetworkRule set {@link StorageAccountInner#networkRuleSet()} property. */ -final class StorageNetworkRulesHelper { - private static final String BYPASS_NONE_STR = Bypass.NONE.toString().toLowerCase(Locale.ROOT); - private final boolean isInCreateMode; - private final StorageAccountInner inner; - private final StorageAccountCreateParameters createParameters; - private final StorageAccountUpdateParameters updateParameters; - - /** - * Creates StorageNetworkRulesHelper. - * - * @param createParameters the model representing payload for storage account create. - */ - StorageNetworkRulesHelper(StorageAccountCreateParameters createParameters) { - this.isInCreateMode = true; - this.createParameters = createParameters; - this.updateParameters = null; - this.inner = null; - } - - /** - * Creates StorageNetworkRulesHelper. - * - * @param updateParameters the model representing payload for storage account update - * @param inner the current state of storage account - */ - StorageNetworkRulesHelper(StorageAccountUpdateParameters updateParameters, final StorageAccountInner inner) { - this.isInCreateMode = false; - this.createParameters = null; - this.updateParameters = updateParameters; - this.inner = inner; - } - - /** - * Checks whether access to the given storage account is allowed from all networks. - * - * @param inner the storage account - * @return true if access allowed from all networks, false otherwise - */ - static boolean isAccessAllowedFromAllNetworks(final StorageAccountInner inner) { - if (inner.networkRuleSet() == null || inner.networkRuleSet().defaultAction() == null) { - return true; - } - return inner.networkRuleSet().defaultAction().equals(DefaultAction.ALLOW); - } - - /** - * The list of resource id of subnets having access to the given storage account. - * - * @param inner the storage account - * @return list of subnet resource ids - */ - static List networkSubnetsWithAccess(final StorageAccountInner inner) { - List subnetIds = new ArrayList<>(); - if (inner.networkRuleSet() != null && inner.networkRuleSet().virtualNetworkRules() != null) { - for (VirtualNetworkRule rule : inner.networkRuleSet().virtualNetworkRules()) { - if (rule != null && rule.virtualNetworkResourceId() != null) { - subnetIds.add(rule.virtualNetworkResourceId()); - } - } - } - return subnetIds; - } - - /** - * The list of ipv4 addresses having access to the given storage account. - * - * @param inner the storage account - * @return list of ip addresses - */ - static List ipAddressesWithAccess(final StorageAccountInner inner) { - List ipAddresses = new ArrayList<>(); - if (inner.networkRuleSet() != null && inner.networkRuleSet().ipRules() != null) { - for (IpRule rule : inner.networkRuleSet().ipRules()) { - if (rule != null && rule.ipAddressOrRange() != null && !rule.ipAddressOrRange().contains("/")) { - ipAddresses.add(rule.ipAddressOrRange()); - } - } - } - return ipAddresses; - } - - /** - * The list of CIDR formatted ip address ranges having access to the given storage account. - * - * @param inner the storage account - * @return list of ip address ranges in cidr format - */ - static List ipAddressRangesWithAccess(final StorageAccountInner inner) { - List ipAddressRanges = new ArrayList<>(); - if (inner.networkRuleSet() != null && inner.networkRuleSet().ipRules() != null) { - for (IpRule rule : inner.networkRuleSet().ipRules()) { - if (rule != null && rule.ipAddressOrRange() != null && rule.ipAddressOrRange().contains("/")) { - ipAddressRanges.add(rule.ipAddressOrRange()); - } - } - } - return ipAddressRanges; - } - - /** - * Checks storage log entries can be read from any network. - * - * @param inner the storage account - * @return true if storage log entries can be read from any network, false otherwise - */ - static boolean canReadLogEntriesFromAnyNetwork(final StorageAccountInner inner) { - if (inner.networkRuleSet() != null - && inner.networkRuleSet().defaultAction() != null - && inner.networkRuleSet().defaultAction().equals(DefaultAction.DENY)) { - Set bypassSet = parseBypass(inner.networkRuleSet().bypass()); - return bypassSet.contains(Bypass.LOGGING.toString().toLowerCase(Locale.ROOT)); - } - return true; - } - - /** - * Checks storage metrics can be read from any network. - * - * @param inner the storage account - * @return true if storage metrics can be read from any network, false otherwise - */ - static boolean canReadMetricsFromAnyNetwork(final StorageAccountInner inner) { - if (inner.networkRuleSet() != null - && inner.networkRuleSet().defaultAction() != null - && inner.networkRuleSet().defaultAction().equals(DefaultAction.DENY)) { - Set bypassSet = parseBypass(inner.networkRuleSet().bypass()); - return bypassSet.contains(Bypass.METRICS.toString().toLowerCase(Locale.ROOT)); - } - return true; - } - - /** - * Checks storage account can be accessed from applications running on azure. - * - * @param inner the storage account - * @return true if storage can be accessed from application running on azure, false otherwise - */ - static boolean canAccessFromAzureServices(final StorageAccountInner inner) { - if (inner.networkRuleSet() != null - && inner.networkRuleSet().defaultAction() != null - && inner.networkRuleSet().defaultAction().equals(DefaultAction.DENY)) { - Set bypassSet = parseBypass(inner.networkRuleSet().bypass()); - return bypassSet.contains(Bypass.AZURE_SERVICES.toString().toLowerCase(Locale.ROOT)); - } - return true; - } - - /** - * Specifies that access to the storage account should be allowed from all networks. - * - * @return StorageNetworkRulesHelper - */ - StorageNetworkRulesHelper withAccessFromAllNetworks() { - NetworkRuleSet networkRuleSet = this.getNetworkRuleSetConfig(true); - networkRuleSet.withDefaultAction(DefaultAction.ALLOW); - return this; - } - - /** - * Specifies that access to the storage account should be allowed only from selected networks. - * - * @return StorageNetworkRulesHelper - */ - StorageNetworkRulesHelper withAccessFromSelectedNetworks() { - NetworkRuleSet networkRuleSet = this.getNetworkRuleSetConfig(true); - networkRuleSet.withDefaultAction(DefaultAction.DENY); - return this; - } - - /** - * Specifies that access to the storage account from the given network subnet should be allowed. - * - * @param subnetId the network subnet resource id - * @return StorageNetworkRulesHelper - */ - StorageNetworkRulesHelper withAccessFromNetworkSubnet(String subnetId) { - NetworkRuleSet networkRuleSet = this.getNetworkRuleSetConfig(true); - if (networkRuleSet.virtualNetworkRules() == null) { - networkRuleSet.withVirtualNetworkRules(new ArrayList()); - } - boolean found = false; - for (VirtualNetworkRule rule : networkRuleSet.virtualNetworkRules()) { - if (rule.virtualNetworkResourceId().equalsIgnoreCase(subnetId)) { - found = true; - break; - } - } - if (!found) { - networkRuleSet - .virtualNetworkRules() - .add(new VirtualNetworkRule().withVirtualNetworkResourceId(subnetId).withAction(Action.ALLOW)); - } - return this; - } - - /** - * Specifies that access to the storage account from the given ip address should be allowed. - * - * @param ipAddress the ip address - * @return StorageNetworkRulesHelper - */ - StorageNetworkRulesHelper withAccessFromIpAddress(String ipAddress) { - return withAccessAllowedFromIpAddressOrRange(ipAddress); - } - - /** - * Specifies that access to the storage account from the given ip address range should be allowed. - * - * @param ipAddressCidr the ip address range in cidr format - * @return StorageNetworkRulesHelper - */ - StorageNetworkRulesHelper withAccessFromIpAddressRange(String ipAddressCidr) { - return withAccessAllowedFromIpAddressOrRange(ipAddressCidr); - } - - /** - * Specifies that read access to the storage account logging should be allowed from all networks. - * - * @return StorageNetworkRulesHelper - */ - StorageNetworkRulesHelper withReadAccessToLoggingFromAnyNetwork() { - addToBypassList(Bypass.LOGGING); - return this; - } - - /** - * Specifies that read access to the storage account metrics should be allowed from all networks. - * - * @return StorageNetworkRulesHelper - */ - StorageNetworkRulesHelper withReadAccessToMetricsFromAnyNetwork() { - addToBypassList(Bypass.METRICS); - return this; - } - - /** - * Specifies that access to the storage account from application running on Azure should be allowed. - * - * @return StorageNetworkRulesHelper - */ - StorageNetworkRulesHelper withAccessAllowedFromAzureServices() { - addToBypassList(Bypass.AZURE_SERVICES); - return this; - } - - /** - * Specifies that existing access to the storage account from the given subnet should be removed. - * - * @param subnetId the network subnet resource id - * @return StorageNetworkRulesHelper - */ - StorageNetworkRulesHelper withoutNetworkSubnetAccess(String subnetId) { - NetworkRuleSet networkRuleSet = this.getNetworkRuleSetConfig(false); - if (networkRuleSet == null - || networkRuleSet.virtualNetworkRules() == null - || networkRuleSet.virtualNetworkRules().size() == 0) { - return this; - } - int foundIndex = -1; - int i = 0; - for (VirtualNetworkRule rule : networkRuleSet.virtualNetworkRules()) { - if (rule.virtualNetworkResourceId().equalsIgnoreCase(subnetId)) { - foundIndex = i; - break; - } - i++; - } - if (foundIndex != -1) { - networkRuleSet.virtualNetworkRules().remove(foundIndex); - } - return this; - } - - /** - * Specifies that existing access to the storage account from the given ip address should be removed. - * - * @param ipAddress the ip address - * @return StorageNetworkRulesHelper - */ - StorageNetworkRulesHelper withoutIpAddressAccess(String ipAddress) { - return withoutIpAddressOrRangeAccess(ipAddress); - } - - /** - * Specifies that existing access to the storage account from the given ip address range should be removed. - * - * @param ipAddressCidr the ip address range in cidr format - * @return StorageNetworkRulesHelper - */ - StorageNetworkRulesHelper withoutIpAddressRangeAccess(String ipAddressCidr) { - return withoutIpAddressOrRangeAccess(ipAddressCidr); - } - - /** - * Specifies that previously added read access exception to the storage logging from any network should be removed. - * - * @return StorageNetworkRulesHelper - */ - StorageNetworkRulesHelper withoutReadAccessToLoggingFromAnyNetwork() { - removeFromBypassList(Bypass.LOGGING); - return this; - } - - /** - * Specifies that previously added read access exception to the storage metrics from any network should be removed. - * - * @return StorageNetworkRulesHelper - */ - StorageNetworkRulesHelper withoutReadAccessToMetricsFromAnyNetwork() { - removeFromBypassList(Bypass.METRICS); - return this; - } - - /** - * Specifies that previously added access exception to the storage account from application running on azure should - * be removed. - * - * @return StorageNetworkRulesHelper - */ - StorageNetworkRulesHelper withoutAccessFromAzureServices() { - removeFromBypassList(Bypass.AZURE_SERVICES); - return this; - } - - /** - * Add the given bypass to the list of bypass configured for the storage account. - * - * @param bypass access type to which default network access action is not applied. - */ - private void addToBypassList(Bypass bypass) { - NetworkRuleSet networkRuleSet = this.getNetworkRuleSetConfig(true); - final String bypassStr = bypass.toString().toLowerCase(Locale.ROOT); - Set bypassSet = parseBypass(networkRuleSet.bypass()); - if (bypassStr.equalsIgnoreCase(BYPASS_NONE_STR)) { - bypassSet.clear(); - bypassSet.add(BYPASS_NONE_STR); - } else { - if (bypassSet.contains(BYPASS_NONE_STR)) { - bypassSet.remove(BYPASS_NONE_STR); - } - bypassSet.add(bypassStr); - } - networkRuleSet.withBypass(Bypass.fromString(String.join(", ", bypassSet))); - } - - /** - * Removes the given bypass from the list of bypass configured for the storage account. - * - * @param bypass access type to which default network access action is not applied. - */ - private void removeFromBypassList(Bypass bypass) { - NetworkRuleSet networkRuleSet = this.getNetworkRuleSetConfig(false); - if (networkRuleSet == null) { - return; - } else { - Set bypassSet = parseBypass(networkRuleSet.bypass()); - String bypassStr = bypass.toString().toLowerCase(Locale.ROOT); - if (bypassSet.contains(bypassStr)) { - bypassSet.remove(bypassStr); - } - if (bypassSet.isEmpty() && !bypassStr.equalsIgnoreCase(BYPASS_NONE_STR)) { - bypassSet.add(BYPASS_NONE_STR); - } - networkRuleSet.withBypass(Bypass.fromString(String.join(", ", bypassSet))); - } - } - - /** - * The {@link NetworkRuleSet#defaultAction()} is a required property. - * - *

    During create mode, this method sets the default action to DENY if it is already not set by the user and user - * specifies at least one network rule or choose at least one exception. - * - *

    When in update mode, this method set action to DENY only if there is no existing network rules and exception - * hence this is the first time user is adding a network rule or exception and action is not explicitly set by user. - * If there is any existing rules or exception, we honor currently configured action. - */ - void setDefaultActionIfRequired() { - if (isInCreateMode) { - if (createParameters.networkRuleSet() != null) { - boolean hasAtLeastOneRule = false; - - if (createParameters.networkRuleSet().virtualNetworkRules() != null - && createParameters.networkRuleSet().virtualNetworkRules().size() > 0) { - hasAtLeastOneRule = true; - } else if (createParameters.networkRuleSet().ipRules() != null - && createParameters.networkRuleSet().ipRules().size() > 0) { - hasAtLeastOneRule = true; - } - boolean anyException = createParameters.networkRuleSet().bypass() != null; - if ((hasAtLeastOneRule || anyException) && createParameters.networkRuleSet().defaultAction() == null) { - // If user specified at least one network rule or selected any exception - // and didn't choose the default access action then "DENY" access from - // unknown networks. - // - createParameters.networkRuleSet().withDefaultAction(DefaultAction.DENY); - if (!anyException) { - // If user didn't select any by-pass explicitly then disable "all bypass" - // if this is not specified then by default service allows access from - // "azure-services". - // - createParameters.networkRuleSet().withBypass(Bypass.NONE); - } - } - } - } else { - NetworkRuleSet currentRuleSet = this.inner.networkRuleSet(); - - final boolean hasNoExistingException = currentRuleSet != null && currentRuleSet.bypass() == null; - boolean hasExistingRules = false; - - if (currentRuleSet != null) { - if (currentRuleSet.virtualNetworkRules() != null && currentRuleSet.virtualNetworkRules().size() > 0) { - hasExistingRules = true; - } else if (currentRuleSet.ipRules() != null && currentRuleSet.ipRules().size() > 0) { - hasExistingRules = true; - } - } - if (!hasExistingRules) { - if (updateParameters.networkRuleSet() != null) { - boolean anyRulesAddedFirstTime = false; - - if (updateParameters.networkRuleSet().virtualNetworkRules() != null - && updateParameters.networkRuleSet().virtualNetworkRules().size() > 0) { - anyRulesAddedFirstTime = true; - } else if (updateParameters.networkRuleSet().ipRules() != null - && updateParameters.networkRuleSet().ipRules().size() > 0) { - anyRulesAddedFirstTime = true; - } - final boolean anyExceptionAddedFirstTime = - !hasNoExistingException && updateParameters.networkRuleSet().bypass() != null; - if ((anyRulesAddedFirstTime || anyExceptionAddedFirstTime) - && updateParameters.networkRuleSet().defaultAction() == null) { - // If there was no existing rules & exceptions and if user specified at least one - // network rule or exception and didn't choose the default access action for - // unknown networks then DENY access from unknown networks. - // - updateParameters.networkRuleSet().withDefaultAction(DefaultAction.DENY); - if (!anyExceptionAddedFirstTime) { - // If user didn't select any by-pass explicitly then disable "all bypass" - // if this is not specified then by default service allows access from - // "azure-services". - // - createParameters.networkRuleSet().withBypass(Bypass.NONE); - } - } - } - } - } - } - - /** - * Specifies that access to the storage account should be allowed from the given ip address or ip address range. - * - * @param ipAddressOrRange the ip address or ip address range in cidr format - * @return StorageNetworkRulesHelper - */ - private StorageNetworkRulesHelper withAccessAllowedFromIpAddressOrRange(String ipAddressOrRange) { - NetworkRuleSet networkRuleSet = this.getNetworkRuleSetConfig(true); - if (networkRuleSet.ipRules() == null) { - networkRuleSet.withIpRules(new ArrayList()); - } - boolean found = false; - for (IpRule rule : networkRuleSet.ipRules()) { - if (rule.ipAddressOrRange().equalsIgnoreCase(ipAddressOrRange)) { - found = true; - break; - } - } - if (!found) { - networkRuleSet.ipRules().add(new IpRule().withIpAddressOrRange(ipAddressOrRange).withAction(Action.ALLOW)); - } - return this; - } - - /** - * Specifies that existing access to the storage account from the given ip address or ip address range should be - * removed. - * - * @param ipAddressOrRange the ip address or ip address range in cidr format - * @return StorageNetworkRulesHelper - */ - private StorageNetworkRulesHelper withoutIpAddressOrRangeAccess(String ipAddressOrRange) { - NetworkRuleSet networkRuleSet = this.getNetworkRuleSetConfig(false); - if (networkRuleSet == null || networkRuleSet.ipRules() == null || networkRuleSet.ipRules().size() == 0) { - return this; - } - int foundIndex = -1; - int i = 0; - for (IpRule rule : networkRuleSet.ipRules()) { - if (rule.ipAddressOrRange().equalsIgnoreCase(ipAddressOrRange)) { - foundIndex = i; - break; - } - i++; - } - if (foundIndex != -1) { - networkRuleSet.ipRules().remove(foundIndex); - } - return this; - } - - /** - * Gets the network rule set. - * - * @param createIfNotExists flag indicating whether to create a network rule set config if it does not exists - * already - * @return the network rule set - */ - private NetworkRuleSet getNetworkRuleSetConfig(boolean createIfNotExists) { - if (this.isInCreateMode) { - if (this.createParameters.networkRuleSet() == null) { - if (createIfNotExists) { - this.createParameters.withNetworkRuleSet(new NetworkRuleSet()); - } else { - return null; - } - } - return this.createParameters.networkRuleSet(); - } else { - if (this.updateParameters.networkRuleSet() == null) { - if (this.inner.networkRuleSet() == null) { - if (createIfNotExists) { - this.updateParameters.withNetworkRuleSet(new NetworkRuleSet()); - } else { - return null; - } - } else { - // Create clone of current ruleSet - // - NetworkRuleSet clonedNetworkRuleSet = new NetworkRuleSet(); - clonedNetworkRuleSet.withDefaultAction(this.inner.networkRuleSet().defaultAction()); - clonedNetworkRuleSet.withBypass(this.inner.networkRuleSet().bypass()); - if (this.inner.networkRuleSet().virtualNetworkRules() != null) { - clonedNetworkRuleSet.withVirtualNetworkRules(new ArrayList()); - for (VirtualNetworkRule rule : this.inner.networkRuleSet().virtualNetworkRules()) { - VirtualNetworkRule clonedRule = - new VirtualNetworkRule() - .withAction(rule.action()) - .withVirtualNetworkResourceId(rule.virtualNetworkResourceId()); - clonedNetworkRuleSet.virtualNetworkRules().add(clonedRule); - } - } - if (this.inner.networkRuleSet().ipRules() != null) { - clonedNetworkRuleSet.withIpRules(new ArrayList()); - for (IpRule rule : this.inner.networkRuleSet().ipRules()) { - IpRule clonedRule = - new IpRule().withAction(rule.action()).withIpAddressOrRange(rule.ipAddressOrRange()); - clonedNetworkRuleSet.ipRules().add(clonedRule); - } - } - this.updateParameters.withNetworkRuleSet(clonedNetworkRuleSet); - } - } - return this.updateParameters.networkRuleSet(); - } - } - - /** - * Parses the given comma separated traffic sources to bypass and convert them to list. - * - * @param bypass comma separated traffic sources to bypass. - * @return the bypass list - */ - private static Set parseBypass(Bypass bypass) { - if (bypass == null) { - return new TreeSet<>(); - } else { - Set bypassSet = new TreeSet<>(); - List bypassStrList = Arrays.asList(bypass.toString().split(",")); - for (String s : bypassStrList) { - s = s.trim().toLowerCase(Locale.ROOT); - if (!s.isEmpty() && !bypassSet.contains(s)) { - bypassSet.add(s); - } - } - return bypassSet; - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/StorageSkuImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/StorageSkuImpl.java deleted file mode 100644 index 8832b712ec36..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/StorageSkuImpl.java +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.storage.implementation; - -import com.azure.core.management.Region; -import com.azure.resourcemanager.storage.models.Kind; -import com.azure.resourcemanager.storage.models.Restriction; -import com.azure.resourcemanager.storage.models.SkuCapability; -import com.azure.resourcemanager.storage.models.SkuName; -import com.azure.resourcemanager.storage.models.SkuTier; -import com.azure.resourcemanager.storage.models.StorageAccountSkuType; -import com.azure.resourcemanager.storage.models.StorageResourceType; -import com.azure.resourcemanager.storage.models.StorageSku; -import com.azure.resourcemanager.storage.fluent.models.SkuInformationInner; -import java.util.ArrayList; -import java.util.List; - -/** The implementation for {@link StorageSku}. */ -class StorageSkuImpl implements StorageSku { - private final SkuInformationInner inner; - - StorageSkuImpl(SkuInformationInner skuInner) { - this.inner = skuInner; - } - - @Override - public SkuName name() { - return this.inner.name(); - } - - @Override - public SkuTier tier() { - return this.inner.tier(); - } - - @Override - public StorageResourceType resourceType() { - if (this.inner.resourceType() != null) { - return StorageResourceType.fromString(this.inner.resourceType()); - } else { - return null; - } - } - - @Override - public List regions() { - List regions = new ArrayList<>(); - if (this.inner.locations() != null) { - for (String location : this.inner.locations()) { - regions.add(Region.fromName(location)); - } - } - return regions; - } - - @Override - public List capabilities() { - if (this.inner.capabilities() != null) { - return this.inner.capabilities(); - } else { - return new ArrayList<>(); - } - } - - @Override - public List restrictions() { - if (this.inner.restrictions() != null) { - return this.inner.restrictions(); - } else { - return new ArrayList<>(); - } - } - - @Override - public Kind storageAccountKind() { - return this.inner.kind(); - } - - @Override - public StorageAccountSkuType storageAccountSku() { - if (this.resourceType() != null && this.resourceType().equals(StorageResourceType.STORAGE_ACCOUNTS)) { - return StorageAccountSkuType.fromSkuName(this.inner.name()); - } - return null; - } - - @Override - public SkuInformationInner innerModel() { - return this.inner; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/StorageSkusImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/StorageSkusImpl.java deleted file mode 100644 index 40fd7ef4331e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/StorageSkusImpl.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.storage.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.storage.StorageManager; -import com.azure.resourcemanager.storage.fluent.SkusClient; -import com.azure.resourcemanager.storage.models.StorageSku; -import com.azure.resourcemanager.storage.models.StorageSkus; -import com.azure.resourcemanager.resources.fluentcore.utils.PagedConverter; - -/** The implementation for {@link StorageSkus}. */ -public class StorageSkusImpl implements StorageSkus { - - private final StorageManager manager; - - public StorageSkusImpl(StorageManager storageManager) { - this.manager = storageManager; - } - - @Override - public StorageManager manager() { - return this.manager; - } - - @Override - public PagedIterable list() { - return PagedConverter.mapPage(this.inner().list(), StorageSkuImpl::new); - } - - @Override - public PagedFlux listAsync() { - return PagedConverter.mapPage(this.inner().listAsync(), StorageSkuImpl::new); - } - - public SkusClient inner() { - return manager.serviceClient().getSkus(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/TableServiceEncryptionStatusImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/TableServiceEncryptionStatusImpl.java deleted file mode 100644 index 44a84a7a6fca..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/TableServiceEncryptionStatusImpl.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.storage.implementation; - -import com.azure.resourcemanager.storage.models.EncryptionService; -import com.azure.resourcemanager.storage.models.EncryptionServices; -import com.azure.resourcemanager.storage.models.StorageService; - -/** Implementation of StorageAccountEncryptionStatus for Table service. */ -class TableServiceEncryptionStatusImpl extends StorageAccountEncryptionStatusImpl { - TableServiceEncryptionStatusImpl(EncryptionServices encryptionServices) { - super(encryptionServices); - } - - @Override - public StorageService storageService() { - return StorageService.TABLE; - } - - @Override - protected EncryptionService encryptionService() { - if (super.encryptionServices == null) { - return null; - } else { - return super.encryptionServices.table(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/TableServicesClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/TableServicesClientImpl.java deleted file mode 100644 index 96cf3890bdeb..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/TableServicesClientImpl.java +++ /dev/null @@ -1,631 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.storage.fluent.TableServicesClient; -import com.azure.resourcemanager.storage.fluent.models.ListTableServicesInner; -import com.azure.resourcemanager.storage.fluent.models.TableServicePropertiesInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in TableServicesClient. */ -public final class TableServicesClientImpl implements TableServicesClient { - private final ClientLogger logger = new ClientLogger(TableServicesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final TableServicesService service; - - /** The service client containing this operation class. */ - private final StorageManagementClientImpl client; - - /** - * Initializes an instance of TableServicesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - TableServicesClientImpl(StorageManagementClientImpl client) { - this.service = - RestProxy.create(TableServicesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for StorageManagementClientTableServices to be used by the proxy service - * to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "StorageManagementCli") - private interface TableServicesService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" - + "/storageAccounts/{accountName}/tableServices") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" - + "/storageAccounts/{accountName}/tableServices/{tableServiceName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> setServiceProperties( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("tableServiceName") String tableServiceName, - @BodyParam("application/json") TableServicePropertiesInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" - + "/storageAccounts/{accountName}/tableServices/{tableServiceName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getServiceProperties( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("tableServiceName") String tableServiceName, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * List all table services for the storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listWithResponseAsync(String resourceGroupName, String accountName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List all table services for the storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync( - String resourceGroupName, String accountName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * List all table services for the storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listAsync(String resourceGroupName, String accountName) { - return listWithResponseAsync(resourceGroupName, accountName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * List all table services for the storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ListTableServicesInner list(String resourceGroupName, String accountName) { - return listAsync(resourceGroupName, accountName).block(); - } - - /** - * List all table services for the storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse( - String resourceGroupName, String accountName, Context context) { - return listWithResponseAsync(resourceGroupName, accountName, context).block(); - } - - /** - * Sets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The properties of a storage account’s Table service, only properties for Storage Analytics and - * CORS (Cross-Origin Resource Sharing) rules can be specified. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a storage account’s Table service. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> setServicePropertiesWithResponseAsync( - String resourceGroupName, String accountName, TableServicePropertiesInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String tableServiceName = "default"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .setServiceProperties( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - tableServiceName, - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Sets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The properties of a storage account’s Table service, only properties for Storage Analytics and - * CORS (Cross-Origin Resource Sharing) rules can be specified. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a storage account’s Table service. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> setServicePropertiesWithResponseAsync( - String resourceGroupName, String accountName, TableServicePropertiesInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String tableServiceName = "default"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .setServiceProperties( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - tableServiceName, - parameters, - accept, - context); - } - - /** - * Sets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The properties of a storage account’s Table service, only properties for Storage Analytics and - * CORS (Cross-Origin Resource Sharing) rules can be specified. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a storage account’s Table service. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono setServicePropertiesAsync( - String resourceGroupName, String accountName, TableServicePropertiesInner parameters) { - return setServicePropertiesWithResponseAsync(resourceGroupName, accountName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Sets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The properties of a storage account’s Table service, only properties for Storage Analytics and - * CORS (Cross-Origin Resource Sharing) rules can be specified. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a storage account’s Table service. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public TableServicePropertiesInner setServiceProperties( - String resourceGroupName, String accountName, TableServicePropertiesInner parameters) { - return setServicePropertiesAsync(resourceGroupName, accountName, parameters).block(); - } - - /** - * Sets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param parameters The properties of a storage account’s Table service, only properties for Storage Analytics and - * CORS (Cross-Origin Resource Sharing) rules can be specified. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a storage account’s Table service. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response setServicePropertiesWithResponse( - String resourceGroupName, String accountName, TableServicePropertiesInner parameters, Context context) { - return setServicePropertiesWithResponseAsync(resourceGroupName, accountName, parameters, context).block(); - } - - /** - * Gets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a storage account’s Table service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getServicePropertiesWithResponseAsync( - String resourceGroupName, String accountName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String tableServiceName = "default"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getServiceProperties( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - tableServiceName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a storage account’s Table service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getServicePropertiesWithResponseAsync( - String resourceGroupName, String accountName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String tableServiceName = "default"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getServiceProperties( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - tableServiceName, - accept, - context); - } - - /** - * Gets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a storage account’s Table service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getServicePropertiesAsync(String resourceGroupName, String accountName) { - return getServicePropertiesWithResponseAsync(resourceGroupName, accountName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a storage account’s Table service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public TableServicePropertiesInner getServiceProperties(String resourceGroupName, String accountName) { - return getServicePropertiesAsync(resourceGroupName, accountName).block(); - } - - /** - * Gets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a storage account’s Table service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getServicePropertiesWithResponse( - String resourceGroupName, String accountName, Context context) { - return getServicePropertiesWithResponseAsync(resourceGroupName, accountName, context).block(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/TablesClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/TablesClientImpl.java deleted file mode 100644 index ac0afa85c9c1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/TablesClientImpl.java +++ /dev/null @@ -1,1112 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.implementation; - -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.storage.fluent.TablesClient; -import com.azure.resourcemanager.storage.fluent.models.TableInner; -import com.azure.resourcemanager.storage.models.ListTableResource; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in TablesClient. */ -public final class TablesClientImpl implements TablesClient { - private final ClientLogger logger = new ClientLogger(TablesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final TablesService service; - - /** The service client containing this operation class. */ - private final StorageManagementClientImpl client; - - /** - * Initializes an instance of TablesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - TablesClientImpl(StorageManagementClientImpl client) { - this.service = RestProxy.create(TablesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for StorageManagementClientTables to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "StorageManagementCli") - private interface TablesService { - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" - + "/storageAccounts/{accountName}/tableServices/default/tables/{tableName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> create( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("tableName") String tableName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" - + "/storageAccounts/{accountName}/tableServices/default/tables/{tableName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("tableName") String tableName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" - + "/storageAccounts/{accountName}/tableServices/default/tables/{tableName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("tableName") String tableName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" - + "/storageAccounts/{accountName}/tableServices/default/tables/{tableName}") - @ExpectedResponses({204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("tableName") String tableName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" - + "/storageAccounts/{accountName}/tableServices/default/tables") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Creates a new table with the specified table name, under the specified account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The - * name must comprise of only alphanumeric characters and it cannot begin with a numeric character. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of the table, including Id, resource name, resource type. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createWithResponseAsync( - String resourceGroupName, String accountName, String tableName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (tableName == null) { - return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .create( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - tableName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates a new table with the specified table name, under the specified account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The - * name must comprise of only alphanumeric characters and it cannot begin with a numeric character. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of the table, including Id, resource name, resource type. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync( - String resourceGroupName, String accountName, String tableName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (tableName == null) { - return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .create( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - tableName, - accept, - context); - } - - /** - * Creates a new table with the specified table name, under the specified account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The - * name must comprise of only alphanumeric characters and it cannot begin with a numeric character. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of the table, including Id, resource name, resource type. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createAsync(String resourceGroupName, String accountName, String tableName) { - return createWithResponseAsync(resourceGroupName, accountName, tableName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates a new table with the specified table name, under the specified account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The - * name must comprise of only alphanumeric characters and it cannot begin with a numeric character. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of the table, including Id, resource name, resource type. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public TableInner create(String resourceGroupName, String accountName, String tableName) { - return createAsync(resourceGroupName, accountName, tableName).block(); - } - - /** - * Creates a new table with the specified table name, under the specified account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The - * name must comprise of only alphanumeric characters and it cannot begin with a numeric character. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of the table, including Id, resource name, resource type. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse( - String resourceGroupName, String accountName, String tableName, Context context) { - return createWithResponseAsync(resourceGroupName, accountName, tableName, context).block(); - } - - /** - * Creates a new table with the specified table name, under the specified account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The - * name must comprise of only alphanumeric characters and it cannot begin with a numeric character. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of the table, including Id, resource name, resource type. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateWithResponseAsync( - String resourceGroupName, String accountName, String tableName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (tableName == null) { - return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - tableName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates a new table with the specified table name, under the specified account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The - * name must comprise of only alphanumeric characters and it cannot begin with a numeric character. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of the table, including Id, resource name, resource type. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, String accountName, String tableName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (tableName == null) { - return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - tableName, - accept, - context); - } - - /** - * Creates a new table with the specified table name, under the specified account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The - * name must comprise of only alphanumeric characters and it cannot begin with a numeric character. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of the table, including Id, resource name, resource type. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync(String resourceGroupName, String accountName, String tableName) { - return updateWithResponseAsync(resourceGroupName, accountName, tableName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates a new table with the specified table name, under the specified account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The - * name must comprise of only alphanumeric characters and it cannot begin with a numeric character. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of the table, including Id, resource name, resource type. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public TableInner update(String resourceGroupName, String accountName, String tableName) { - return updateAsync(resourceGroupName, accountName, tableName).block(); - } - - /** - * Creates a new table with the specified table name, under the specified account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The - * name must comprise of only alphanumeric characters and it cannot begin with a numeric character. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of the table, including Id, resource name, resource type. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, String accountName, String tableName, Context context) { - return updateWithResponseAsync(resourceGroupName, accountName, tableName, context).block(); - } - - /** - * Gets the table with the specified table name, under the specified account if it exists. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The - * name must comprise of only alphanumeric characters and it cannot begin with a numeric character. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the table with the specified table name, under the specified account if it exists. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String resourceGroupName, String accountName, String tableName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (tableName == null) { - return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - tableName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the table with the specified table name, under the specified account if it exists. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The - * name must comprise of only alphanumeric characters and it cannot begin with a numeric character. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the table with the specified table name, under the specified account if it exists. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String accountName, String tableName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (tableName == null) { - return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - tableName, - accept, - context); - } - - /** - * Gets the table with the specified table name, under the specified account if it exists. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The - * name must comprise of only alphanumeric characters and it cannot begin with a numeric character. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the table with the specified table name, under the specified account if it exists. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync(String resourceGroupName, String accountName, String tableName) { - return getWithResponseAsync(resourceGroupName, accountName, tableName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the table with the specified table name, under the specified account if it exists. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The - * name must comprise of only alphanumeric characters and it cannot begin with a numeric character. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the table with the specified table name, under the specified account if it exists. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public TableInner get(String resourceGroupName, String accountName, String tableName) { - return getAsync(resourceGroupName, accountName, tableName).block(); - } - - /** - * Gets the table with the specified table name, under the specified account if it exists. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The - * name must comprise of only alphanumeric characters and it cannot begin with a numeric character. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the table with the specified table name, under the specified account if it exists. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String accountName, String tableName, Context context) { - return getWithResponseAsync(resourceGroupName, accountName, tableName, context).block(); - } - - /** - * Deletes the table with the specified table name, under the specified account if it exists. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The - * name must comprise of only alphanumeric characters and it cannot begin with a numeric character. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync( - String resourceGroupName, String accountName, String tableName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (tableName == null) { - return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - tableName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the table with the specified table name, under the specified account if it exists. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The - * name must comprise of only alphanumeric characters and it cannot begin with a numeric character. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String accountName, String tableName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (tableName == null) { - return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - tableName, - accept, - context); - } - - /** - * Deletes the table with the specified table name, under the specified account if it exists. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The - * name must comprise of only alphanumeric characters and it cannot begin with a numeric character. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String accountName, String tableName) { - return deleteWithResponseAsync(resourceGroupName, accountName, tableName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes the table with the specified table name, under the specified account if it exists. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The - * name must comprise of only alphanumeric characters and it cannot begin with a numeric character. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String accountName, String tableName) { - deleteAsync(resourceGroupName, accountName, tableName).block(); - } - - /** - * Deletes the table with the specified table name, under the specified account if it exists. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The - * name must comprise of only alphanumeric characters and it cannot begin with a numeric character. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse( - String resourceGroupName, String accountName, String tableName, Context context) { - return deleteWithResponseAsync(resourceGroupName, accountName, tableName, context).block(); - } - - /** - * Gets a list of all the tables under the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all the tables under the specified storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String accountName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a list of all the tables under the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all the tables under the specified storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String accountName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - resourceGroupName, - accountName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets a list of all the tables under the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all the tables under the specified storage account. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String resourceGroupName, String accountName) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, accountName), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets a list of all the tables under the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all the tables under the specified storage account. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String accountName, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, accountName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets a list of all the tables under the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all the tables under the specified storage account. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String accountName) { - return new PagedIterable<>(listAsync(resourceGroupName, accountName)); - } - - /** - * Gets a list of all the tables under the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all the tables under the specified storage account. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String accountName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, accountName, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response schema. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response schema. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/UsagesClientImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/UsagesClientImpl.java deleted file mode 100644 index 2fdb4e0ef5a4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/UsagesClientImpl.java +++ /dev/null @@ -1,219 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.storage.fluent.UsagesClient; -import com.azure.resourcemanager.storage.fluent.models.UsageInner; -import com.azure.resourcemanager.storage.models.UsageListResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in UsagesClient. */ -public final class UsagesClientImpl implements UsagesClient { - private final ClientLogger logger = new ClientLogger(UsagesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final UsagesService service; - - /** The service client containing this operation class. */ - private final StorageManagementClientImpl client; - - /** - * Initializes an instance of UsagesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - UsagesClientImpl(StorageManagementClientImpl client) { - this.service = RestProxy.create(UsagesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for StorageManagementClientUsages to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "StorageManagementCli") - private interface UsagesService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Storage/locations/{location}/usages") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByLocation( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("location") String location, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets the current usage count and the limit for the resources of the location under the subscription. - * - * @param location The location of the Azure Storage resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the current usage count and the limit for the resources of the location under the subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByLocationSinglePageAsync(String location) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByLocation( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - location, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the current usage count and the limit for the resources of the location under the subscription. - * - * @param location The location of the Azure Storage resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the current usage count and the limit for the resources of the location under the subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByLocationSinglePageAsync(String location, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByLocation( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - location, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); - } - - /** - * Gets the current usage count and the limit for the resources of the location under the subscription. - * - * @param location The location of the Azure Storage resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the current usage count and the limit for the resources of the location under the subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByLocationAsync(String location) { - return new PagedFlux<>(() -> listByLocationSinglePageAsync(location)); - } - - /** - * Gets the current usage count and the limit for the resources of the location under the subscription. - * - * @param location The location of the Azure Storage resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the current usage count and the limit for the resources of the location under the subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByLocationAsync(String location, Context context) { - return new PagedFlux<>(() -> listByLocationSinglePageAsync(location, context)); - } - - /** - * Gets the current usage count and the limit for the resources of the location under the subscription. - * - * @param location The location of the Azure Storage resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the current usage count and the limit for the resources of the location under the subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByLocation(String location) { - return new PagedIterable<>(listByLocationAsync(location)); - } - - /** - * Gets the current usage count and the limit for the resources of the location under the subscription. - * - * @param location The location of the Azure Storage resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the current usage count and the limit for the resources of the location under the subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByLocation(String location, Context context) { - return new PagedIterable<>(listByLocationAsync(location, context)); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/UsagesImpl.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/UsagesImpl.java deleted file mode 100644 index a8bf816894f2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/UsagesImpl.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.storage.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.storage.StorageManager; -import com.azure.resourcemanager.storage.fluent.UsagesClient; -import com.azure.resourcemanager.storage.models.Usages; -import com.azure.resourcemanager.storage.fluent.models.UsageInner; - -/** The implementation of {@link Usages}. */ -public class UsagesImpl implements Usages { - - private final StorageManager manager; - - public UsagesImpl(StorageManager storageManager) { - this.manager = storageManager; - } - - @Override - public StorageManager manager() { - return this.manager; - } - - @Override - public PagedIterable list() { - return null; - } - - @Override - public PagedFlux listAsync() { - return null; - } - - public UsagesClient inner() { - return this.manager().serviceClient().getUsages(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/AccessTier.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/AccessTier.java deleted file mode 100644 index 0179ff2d9c7b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/AccessTier.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for AccessTier. */ -public enum AccessTier { - /** Enum value Hot. */ - HOT("Hot"), - - /** Enum value Cool. */ - COOL("Cool"); - - /** The actual serialized value for a AccessTier instance. */ - private final String value; - - AccessTier(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a AccessTier instance. - * - * @param value the serialized value to parse. - * @return the parsed AccessTier object, or null if unable to parse. - */ - @JsonCreator - public static AccessTier fromString(String value) { - AccessTier[] items = AccessTier.values(); - for (AccessTier item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/AccountSasParameters.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/AccountSasParameters.java deleted file mode 100644 index 46261670e699..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/AccountSasParameters.java +++ /dev/null @@ -1,270 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** The parameters to list SAS credentials of a storage account. */ -@Fluent -public final class AccountSasParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AccountSasParameters.class); - - /* - * The signed services accessible with the account SAS. Possible values - * include: Blob (b), Queue (q), Table (t), File (f). - */ - @JsonProperty(value = "signedServices", required = true) - private Services services; - - /* - * The signed resource types that are accessible with the account SAS. - * Service (s): Access to service-level APIs; Container (c): Access to - * container-level APIs; Object (o): Access to object-level APIs for blobs, - * queue messages, table entities, and files. - */ - @JsonProperty(value = "signedResourceTypes", required = true) - private SignedResourceTypes resourceTypes; - - /* - * The signed permissions for the account SAS. Possible values include: - * Read (r), Write (w), Delete (d), List (l), Add (a), Create (c), Update - * (u) and Process (p). - */ - @JsonProperty(value = "signedPermission", required = true) - private Permissions permissions; - - /* - * An IP address or a range of IP addresses from which to accept requests. - */ - @JsonProperty(value = "signedIp") - private String ipAddressOrRange; - - /* - * The protocol permitted for a request made with the account SAS. - */ - @JsonProperty(value = "signedProtocol") - private HttpProtocol protocols; - - /* - * The time at which the SAS becomes valid. - */ - @JsonProperty(value = "signedStart") - private OffsetDateTime sharedAccessStartTime; - - /* - * The time at which the shared access signature becomes invalid. - */ - @JsonProperty(value = "signedExpiry", required = true) - private OffsetDateTime sharedAccessExpiryTime; - - /* - * The key to sign the account SAS token with. - */ - @JsonProperty(value = "keyToSign") - private String keyToSign; - - /** - * Get the services property: The signed services accessible with the account SAS. Possible values include: Blob - * (b), Queue (q), Table (t), File (f). - * - * @return the services value. - */ - public Services services() { - return this.services; - } - - /** - * Set the services property: The signed services accessible with the account SAS. Possible values include: Blob - * (b), Queue (q), Table (t), File (f). - * - * @param services the services value to set. - * @return the AccountSasParameters object itself. - */ - public AccountSasParameters withServices(Services services) { - this.services = services; - return this; - } - - /** - * Get the resourceTypes property: The signed resource types that are accessible with the account SAS. Service (s): - * Access to service-level APIs; Container (c): Access to container-level APIs; Object (o): Access to object-level - * APIs for blobs, queue messages, table entities, and files. - * - * @return the resourceTypes value. - */ - public SignedResourceTypes resourceTypes() { - return this.resourceTypes; - } - - /** - * Set the resourceTypes property: The signed resource types that are accessible with the account SAS. Service (s): - * Access to service-level APIs; Container (c): Access to container-level APIs; Object (o): Access to object-level - * APIs for blobs, queue messages, table entities, and files. - * - * @param resourceTypes the resourceTypes value to set. - * @return the AccountSasParameters object itself. - */ - public AccountSasParameters withResourceTypes(SignedResourceTypes resourceTypes) { - this.resourceTypes = resourceTypes; - return this; - } - - /** - * Get the permissions property: The signed permissions for the account SAS. Possible values include: Read (r), - * Write (w), Delete (d), List (l), Add (a), Create (c), Update (u) and Process (p). - * - * @return the permissions value. - */ - public Permissions permissions() { - return this.permissions; - } - - /** - * Set the permissions property: The signed permissions for the account SAS. Possible values include: Read (r), - * Write (w), Delete (d), List (l), Add (a), Create (c), Update (u) and Process (p). - * - * @param permissions the permissions value to set. - * @return the AccountSasParameters object itself. - */ - public AccountSasParameters withPermissions(Permissions permissions) { - this.permissions = permissions; - return this; - } - - /** - * Get the ipAddressOrRange property: An IP address or a range of IP addresses from which to accept requests. - * - * @return the ipAddressOrRange value. - */ - public String ipAddressOrRange() { - return this.ipAddressOrRange; - } - - /** - * Set the ipAddressOrRange property: An IP address or a range of IP addresses from which to accept requests. - * - * @param ipAddressOrRange the ipAddressOrRange value to set. - * @return the AccountSasParameters object itself. - */ - public AccountSasParameters withIpAddressOrRange(String ipAddressOrRange) { - this.ipAddressOrRange = ipAddressOrRange; - return this; - } - - /** - * Get the protocols property: The protocol permitted for a request made with the account SAS. - * - * @return the protocols value. - */ - public HttpProtocol protocols() { - return this.protocols; - } - - /** - * Set the protocols property: The protocol permitted for a request made with the account SAS. - * - * @param protocols the protocols value to set. - * @return the AccountSasParameters object itself. - */ - public AccountSasParameters withProtocols(HttpProtocol protocols) { - this.protocols = protocols; - return this; - } - - /** - * Get the sharedAccessStartTime property: The time at which the SAS becomes valid. - * - * @return the sharedAccessStartTime value. - */ - public OffsetDateTime sharedAccessStartTime() { - return this.sharedAccessStartTime; - } - - /** - * Set the sharedAccessStartTime property: The time at which the SAS becomes valid. - * - * @param sharedAccessStartTime the sharedAccessStartTime value to set. - * @return the AccountSasParameters object itself. - */ - public AccountSasParameters withSharedAccessStartTime(OffsetDateTime sharedAccessStartTime) { - this.sharedAccessStartTime = sharedAccessStartTime; - return this; - } - - /** - * Get the sharedAccessExpiryTime property: The time at which the shared access signature becomes invalid. - * - * @return the sharedAccessExpiryTime value. - */ - public OffsetDateTime sharedAccessExpiryTime() { - return this.sharedAccessExpiryTime; - } - - /** - * Set the sharedAccessExpiryTime property: The time at which the shared access signature becomes invalid. - * - * @param sharedAccessExpiryTime the sharedAccessExpiryTime value to set. - * @return the AccountSasParameters object itself. - */ - public AccountSasParameters withSharedAccessExpiryTime(OffsetDateTime sharedAccessExpiryTime) { - this.sharedAccessExpiryTime = sharedAccessExpiryTime; - return this; - } - - /** - * Get the keyToSign property: The key to sign the account SAS token with. - * - * @return the keyToSign value. - */ - public String keyToSign() { - return this.keyToSign; - } - - /** - * Set the keyToSign property: The key to sign the account SAS token with. - * - * @param keyToSign the keyToSign value to set. - * @return the AccountSasParameters object itself. - */ - public AccountSasParameters withKeyToSign(String keyToSign) { - this.keyToSign = keyToSign; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (services() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property services in model AccountSasParameters")); - } - if (resourceTypes() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property resourceTypes in model AccountSasParameters")); - } - if (permissions() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property permissions in model AccountSasParameters")); - } - if (sharedAccessExpiryTime() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property sharedAccessExpiryTime in model AccountSasParameters")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/AccountStatus.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/AccountStatus.java deleted file mode 100644 index d7f32c702060..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/AccountStatus.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for AccountStatus. */ -public enum AccountStatus { - /** Enum value available. */ - AVAILABLE("available"), - - /** Enum value unavailable. */ - UNAVAILABLE("unavailable"); - - /** The actual serialized value for a AccountStatus instance. */ - private final String value; - - AccountStatus(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a AccountStatus instance. - * - * @param value the serialized value to parse. - * @return the parsed AccountStatus object, or null if unable to parse. - */ - @JsonCreator - public static AccountStatus fromString(String value) { - AccountStatus[] items = AccountStatus.values(); - for (AccountStatus item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/AccountStatuses.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/AccountStatuses.java deleted file mode 100644 index 5992bc27145f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/AccountStatuses.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.storage.models; - -/** An instance of this class stores the availability of a storage account. */ -public class AccountStatuses { - private final AccountStatus primary; - private final AccountStatus secondary; - - /** - * Creates an instance of AccountStatuses class. - * - * @param primary the status of the primary location - * @param secondary the status of the secondary location - */ - public AccountStatuses(AccountStatus primary, AccountStatus secondary) { - this.primary = primary; - this.secondary = secondary; - } - - /** - * @return the status indicating whether the primary location of the storage account is available or unavailable. - */ - public AccountStatus primary() { - return primary; - } - - /** - * @return the status indicating whether the secondary location of the storage account is available or unavailable. - * Only available if the accountType is StandardGRS or StandardRAGRS. - */ - public AccountStatus secondary() { - return secondary; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Action.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Action.java deleted file mode 100644 index 9d3a187880cd..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Action.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for Action. */ -public enum Action { - /** Enum value Allow. */ - ALLOW("Allow"); - - /** The actual serialized value for a Action instance. */ - private final String value; - - Action(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a Action instance. - * - * @param value the serialized value to parse. - * @return the parsed Action object, or null if unable to parse. - */ - @JsonCreator - public static Action fromString(String value) { - Action[] items = Action.values(); - for (Action item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ActiveDirectoryProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ActiveDirectoryProperties.java deleted file mode 100644 index b7bbee9ecf58..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ActiveDirectoryProperties.java +++ /dev/null @@ -1,217 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Settings properties for Active Directory (AD). */ -@Fluent -public final class ActiveDirectoryProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ActiveDirectoryProperties.class); - - /* - * Specifies the primary domain that the AD DNS server is authoritative - * for. - */ - @JsonProperty(value = "domainName", required = true) - private String domainName; - - /* - * Specifies the NetBIOS domain name. - */ - @JsonProperty(value = "netBiosDomainName", required = true) - private String netBiosDomainName; - - /* - * Specifies the Active Directory forest to get. - */ - @JsonProperty(value = "forestName", required = true) - private String forestName; - - /* - * Specifies the domain GUID. - */ - @JsonProperty(value = "domainGuid", required = true) - private String domainGuid; - - /* - * Specifies the security identifier (SID). - */ - @JsonProperty(value = "domainSid", required = true) - private String domainSid; - - /* - * Specifies the security identifier (SID) for Azure Storage. - */ - @JsonProperty(value = "azureStorageSid", required = true) - private String azureStorageSid; - - /** - * Get the domainName property: Specifies the primary domain that the AD DNS server is authoritative for. - * - * @return the domainName value. - */ - public String domainName() { - return this.domainName; - } - - /** - * Set the domainName property: Specifies the primary domain that the AD DNS server is authoritative for. - * - * @param domainName the domainName value to set. - * @return the ActiveDirectoryProperties object itself. - */ - public ActiveDirectoryProperties withDomainName(String domainName) { - this.domainName = domainName; - return this; - } - - /** - * Get the netBiosDomainName property: Specifies the NetBIOS domain name. - * - * @return the netBiosDomainName value. - */ - public String netBiosDomainName() { - return this.netBiosDomainName; - } - - /** - * Set the netBiosDomainName property: Specifies the NetBIOS domain name. - * - * @param netBiosDomainName the netBiosDomainName value to set. - * @return the ActiveDirectoryProperties object itself. - */ - public ActiveDirectoryProperties withNetBiosDomainName(String netBiosDomainName) { - this.netBiosDomainName = netBiosDomainName; - return this; - } - - /** - * Get the forestName property: Specifies the Active Directory forest to get. - * - * @return the forestName value. - */ - public String forestName() { - return this.forestName; - } - - /** - * Set the forestName property: Specifies the Active Directory forest to get. - * - * @param forestName the forestName value to set. - * @return the ActiveDirectoryProperties object itself. - */ - public ActiveDirectoryProperties withForestName(String forestName) { - this.forestName = forestName; - return this; - } - - /** - * Get the domainGuid property: Specifies the domain GUID. - * - * @return the domainGuid value. - */ - public String domainGuid() { - return this.domainGuid; - } - - /** - * Set the domainGuid property: Specifies the domain GUID. - * - * @param domainGuid the domainGuid value to set. - * @return the ActiveDirectoryProperties object itself. - */ - public ActiveDirectoryProperties withDomainGuid(String domainGuid) { - this.domainGuid = domainGuid; - return this; - } - - /** - * Get the domainSid property: Specifies the security identifier (SID). - * - * @return the domainSid value. - */ - public String domainSid() { - return this.domainSid; - } - - /** - * Set the domainSid property: Specifies the security identifier (SID). - * - * @param domainSid the domainSid value to set. - * @return the ActiveDirectoryProperties object itself. - */ - public ActiveDirectoryProperties withDomainSid(String domainSid) { - this.domainSid = domainSid; - return this; - } - - /** - * Get the azureStorageSid property: Specifies the security identifier (SID) for Azure Storage. - * - * @return the azureStorageSid value. - */ - public String azureStorageSid() { - return this.azureStorageSid; - } - - /** - * Set the azureStorageSid property: Specifies the security identifier (SID) for Azure Storage. - * - * @param azureStorageSid the azureStorageSid value to set. - * @return the ActiveDirectoryProperties object itself. - */ - public ActiveDirectoryProperties withAzureStorageSid(String azureStorageSid) { - this.azureStorageSid = azureStorageSid; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (domainName() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property domainName in model ActiveDirectoryProperties")); - } - if (netBiosDomainName() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property netBiosDomainName in model ActiveDirectoryProperties")); - } - if (forestName() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property forestName in model ActiveDirectoryProperties")); - } - if (domainGuid() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property domainGuid in model ActiveDirectoryProperties")); - } - if (domainSid() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property domainSid in model ActiveDirectoryProperties")); - } - if (azureStorageSid() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property azureStorageSid in model ActiveDirectoryProperties")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/AzureEntityResource.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/AzureEntityResource.java deleted file mode 100644 index e17ef607681a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/AzureEntityResource.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Entity Resource The resource model definition for an Azure Resource Manager resource with an etag. */ -@Immutable -public class AzureEntityResource extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureEntityResource.class); - - /* - * Resource Etag. - */ - @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) - private String etag; - - /** - * Get the etag property: Resource Etag. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/AzureFilesIdentityBasedAuthentication.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/AzureFilesIdentityBasedAuthentication.java deleted file mode 100644 index 62284aa85c3f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/AzureFilesIdentityBasedAuthentication.java +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Settings for Azure Files identity based authentication. */ -@Fluent -public final class AzureFilesIdentityBasedAuthentication { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureFilesIdentityBasedAuthentication.class); - - /* - * Indicates the directory service used. - */ - @JsonProperty(value = "directoryServiceOptions", required = true) - private DirectoryServiceOptions directoryServiceOptions; - - /* - * Required if choose AD. - */ - @JsonProperty(value = "activeDirectoryProperties") - private ActiveDirectoryProperties activeDirectoryProperties; - - /** - * Get the directoryServiceOptions property: Indicates the directory service used. - * - * @return the directoryServiceOptions value. - */ - public DirectoryServiceOptions directoryServiceOptions() { - return this.directoryServiceOptions; - } - - /** - * Set the directoryServiceOptions property: Indicates the directory service used. - * - * @param directoryServiceOptions the directoryServiceOptions value to set. - * @return the AzureFilesIdentityBasedAuthentication object itself. - */ - public AzureFilesIdentityBasedAuthentication withDirectoryServiceOptions( - DirectoryServiceOptions directoryServiceOptions) { - this.directoryServiceOptions = directoryServiceOptions; - return this; - } - - /** - * Get the activeDirectoryProperties property: Required if choose AD. - * - * @return the activeDirectoryProperties value. - */ - public ActiveDirectoryProperties activeDirectoryProperties() { - return this.activeDirectoryProperties; - } - - /** - * Set the activeDirectoryProperties property: Required if choose AD. - * - * @param activeDirectoryProperties the activeDirectoryProperties value to set. - * @return the AzureFilesIdentityBasedAuthentication object itself. - */ - public AzureFilesIdentityBasedAuthentication withActiveDirectoryProperties( - ActiveDirectoryProperties activeDirectoryProperties) { - this.activeDirectoryProperties = activeDirectoryProperties; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (directoryServiceOptions() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property directoryServiceOptions in model" - + " AzureFilesIdentityBasedAuthentication")); - } - if (activeDirectoryProperties() != null) { - activeDirectoryProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobContainer.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobContainer.java deleted file mode 100644 index 7c203d1ff768..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobContainer.java +++ /dev/null @@ -1,193 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.model.Appliable; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.model.Indexable; -import com.azure.resourcemanager.resources.fluentcore.model.Updatable; -import com.azure.resourcemanager.storage.StorageManager; -import com.azure.resourcemanager.storage.fluent.models.BlobContainerInner; -import java.time.OffsetDateTime; -import java.util.Map; - -/** Type representing BlobContainer. */ -@Fluent -public interface BlobContainer - extends HasInnerModel, Indexable, Updatable, HasManager { - /** @return the etag value. */ - String etag(); - - /** @return the hasImmutabilityPolicy value. */ - Boolean hasImmutabilityPolicy(); - - /** @return the hasLegalHold value. */ - Boolean hasLegalHold(); - - /** @return the id value. */ - String id(); - - /** @return the immutabilityPolicy value. */ - ImmutabilityPolicyProperties immutabilityPolicy(); - - /** @return the lastModifiedTime value. */ - OffsetDateTime lastModifiedTime(); - - /** @return the leaseDuration value. */ - LeaseDuration leaseDuration(); - - /** @return the leaseState value. */ - LeaseState leaseState(); - - /** @return the leaseStatus value. */ - LeaseStatus leaseStatus(); - - /** @return the legalHold value. */ - LegalHoldProperties legalHold(); - - /** @return the metadata value. */ - Map metadata(); - - /** @return the name value. */ - String name(); - - /** @return the publicAccess value. */ - PublicAccess publicAccess(); - - /** @return the type value. */ - String type(); - - /** The entirety of the BlobContainer definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithBlobService, - DefinitionStages.WithPublicAccess, - DefinitionStages.WithMetadata, - DefinitionStages.WithCreate { - } - - /** Grouping of BlobContainer definition stages. */ - interface DefinitionStages { - /** The first stage of a BlobContainer definition. */ - interface Blank extends WithBlobService { - } - - /** The stage of the blobcontainer definition allowing to specify BlobService. */ - interface WithBlobService { - /** - * Specifies resourceGroupName, accountName. - * - * @deprecated use {@link #withExistingStorageAccount(String, String)} - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive - * @param accountName The name of the storage account within the specified resource group. Storage account - * names must be between 3 and 24 characters in length and use numbers and lower-case letters only - * @return the next definition stage - */ - @Deprecated - WithPublicAccess withExistingBlobService(String resourceGroupName, String accountName); - - /** - * Specifies resourceGroupName, accountName. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive - * @param accountName The name of the storage account within the specified resource group. Storage account - * names must be between 3 and 24 characters in length and use numbers and lower-case letters only - * @return the next definition stage - */ - WithPublicAccess withExistingStorageAccount(String resourceGroupName, String accountName); - - /** - * Specifies resourceGroupName, accountName. - * - * @param storageAccount the storage account. - * @return the next definition stage - */ - WithPublicAccess withExistingStorageAccount(StorageAccount storageAccount); - } - - /** The stage of the blobcontainer definition allowing to specify PublicAccess. */ - interface WithPublicAccess { - /** - * Specifies publicAccess. - * - * @param publicAccess Specifies whether data in the container may be accessed publicly and the level of - * access. Possible values include: 'Container', 'Blob', 'None' - * @return the next definition stage - */ - WithCreate withPublicAccess(PublicAccess publicAccess); - } - - /** The stage of the blobcontainer definition allowing to specify Metadata. */ - interface WithMetadata { - /** - * Specifies metadata. - * - * @param metadata A name-value pair to associate with the container as metadata - * @return the next definition stage - */ - WithCreate withMetadata(Map metadata); - - /** - * Specifies a singluar instance of metadata. - * - * @param name A name to associate with the container as metadata - * @param value A value to associate with the container as metadata - * @return the next definition stage - */ - WithCreate withMetadata(String name, String value); - } - - /** - * The stage of the definition which contains all the minimum required inputs for the resource to be created - * (via {@link WithCreate#create()}), but also allows for any other optional settings to be specified. - */ - interface WithCreate extends WithMetadata, Creatable { - } - } - - /** The template for a BlobContainer update operation, containing all the settings that can be modified. */ - interface Update extends Appliable, UpdateStages.WithPublicAccess, UpdateStages.WithMetadata { - } - - /** Grouping of BlobContainer update stages. */ - interface UpdateStages { - /** The stage of the blobcontainer update allowing to specify PublicAccess. */ - interface WithPublicAccess { - /** - * Specifies publicAccess. - * - * @param publicAccess Specifies whether data in the container may be accessed publicly and the level of - * access. Possible values include: 'Container', 'Blob', 'None' - * @return the next update stage - */ - Update withPublicAccess(PublicAccess publicAccess); - } - - /** The stage of the blobcontainer update allowing to specify Metadata. */ - interface WithMetadata { - /** - * Specifies metadata. - * - * @param metadata A name-value pair to associate with the container as metadata - * @return the next update stage - */ - Update withMetadata(Map metadata); - - /** - * Specifies a singluar instance of metadata. - * - * @param name A name to associate with the container as metadata - * @param value A value to associate with the container as metadata - * @return the next definition stage - */ - Update withMetadata(String name, String value); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobContainers.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobContainers.java deleted file mode 100644 index c5ca1530c12a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobContainers.java +++ /dev/null @@ -1,542 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.storage.fluent.models.ListContainerItemInner; -import java.util.List; -import reactor.core.publisher.Mono; - -/** Type representing BlobContainers. */ -@Fluent -public interface BlobContainers { - /** - * Begins definition for a new Container resource. - * - * @param name resource name. - * @return the first stage of the new Container definition. - */ - BlobContainer.DefinitionStages.Blank defineContainer(String name); - - /** - * Begins definition for a new ImmutabilityPolicy resource. - * - * @deprecated use {@link #defineImmutabilityPolicy()} - * - * @param name resource name. - * @return the first stage of the new ImmutabilityPolicy definition. - */ - @Deprecated - ImmutabilityPolicy.DefinitionStages.Blank defineImmutabilityPolicy(String name); - - /** - * Begins definition for a new ImmutabilityPolicy resource. - * - * @return the first stage of the new ImmutabilityPolicy definition. - */ - ImmutabilityPolicy.DefinitionStages.Blank defineImmutabilityPolicy(); - - /** - * Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation - * token. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - PagedFlux listAsync(String resourceGroupName, String accountName); - - /** - * Gets properties of a specified container. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - Mono getAsync(String resourceGroupName, String accountName, String containerName); - - /** - * Deletes specified container under its account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - Mono deleteAsync(String resourceGroupName, String accountName, String containerName); - - /** - * Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold follows an append - * pattern and does not clear out the existing tags that are not specified in the request. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param tags Each tag should be 3 to 23 alphanumeric characters and is normalized to lower case at SRP. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - Mono setLegalHoldAsync( - String resourceGroupName, String accountName, String containerName, List tags); - - /** - * Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation. ClearLegalHold - * clears out only the specified tags in the request. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param tags Each tag should be 3 to 23 alphanumeric characters and is normalized to lower case at SRP. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - Mono clearLegalHoldAsync( - String resourceGroupName, String accountName, String containerName, List tags); - - /** - * Gets the existing immutability policy along with the corresponding ETag in response headers and body. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - Mono getImmutabilityPolicyAsync( - String resourceGroupName, String accountName, String containerName); - - /** - * Gets the existing immutability policy along with the corresponding ETag in response headers and body. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param eTagValue The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always - * be applied. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - Mono getImmutabilityPolicyAsync( - String resourceGroupName, String accountName, String containerName, String eTagValue); - - /** - * Aborts an unlocked immutability policy. The response of delete has immutabilityPeriodSinceCreationInDays set to - * 0. ETag in If-Match is required for this operation. Deleting a locked immutability policy is not allowed, only - * way is to delete the container after deleting all blobs inside the container. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - Mono deleteImmutabilityPolicyAsync( - String resourceGroupName, String accountName, String containerName); - - /** - * Aborts an unlocked immutability policy. The response of delete has immutabilityPeriodSinceCreationInDays set to - * 0. ETag in If-Match is required for this operation. Deleting a locked immutability policy is not allowed, only - * way is to delete the container after deleting all blobs inside the container. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param eTagValue The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always - * be applied. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - Mono deleteImmutabilityPolicyAsync( - String resourceGroupName, String accountName, String containerName, String eTagValue); - - /** - * Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is - * ExtendImmutabilityPolicy action. ETag in If-Match is required for this operation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - Mono lockImmutabilityPolicyAsync( - String resourceGroupName, String accountName, String containerName); - - /** - * Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is - * ExtendImmutabilityPolicy action. ETag in If-Match is required for this operation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param eTagValue The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always - * be applied. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - Mono lockImmutabilityPolicyAsync( - String resourceGroupName, String accountName, String containerName, String eTagValue); - - /** - * Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action allowed on a - * Locked policy will be this action. ETag in If-Match is required for this operation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param immutabilityPeriodSinceCreationInDays The immutability period for the blobs in the container since the - * policy creation, in days. - * @param allowProtectedAppendWrites This property can only be changed for unlocked time-based retention policies. - * When enabled, new blocks can be written to an append blob while maintaining immutability protection and - * compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property - * cannot be changed with ExtendImmutabilityPolicy API. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - Mono extendImmutabilityPolicyAsync( - String resourceGroupName, - String accountName, - String containerName, - int immutabilityPeriodSinceCreationInDays, - Boolean allowProtectedAppendWrites); - - /** - * Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action allowed on a - * Locked policy will be this action. ETag in If-Match is required for this operation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param immutabilityPeriodSinceCreationInDays The immutability period for the blobs in the container since the - * policy creation, in days. - * @param allowProtectedAppendWrites This property can only be changed for unlocked time-based retention policies. - * When enabled, new blocks can be written to an append blob while maintaining immutability protection and - * compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property - * cannot be changed with ExtendImmutabilityPolicy API. - * @param eTagValue The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always - * be applied. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - Mono extendImmutabilityPolicyAsync( - String resourceGroupName, - String accountName, - String containerName, - int immutabilityPeriodSinceCreationInDays, - Boolean allowProtectedAppendWrites, - String eTagValue); - - /** - * Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation - * token. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response schema. - */ - PagedIterable list(String resourceGroupName, String accountName); - - /** - * Gets properties of a specified container. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of a specified container. - */ - BlobContainer get(String resourceGroupName, String accountName, String containerName); - - /** - * Deletes specified container under its account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void delete(String resourceGroupName, String accountName, String containerName); - - /** - * Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold follows an append - * pattern and does not clear out the existing tags that are not specified in the request. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param tags Each tag should be 3 to 23 alphanumeric characters and is normalized to lower case at SRP. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the LegalHold property of a blob container. - */ - LegalHold setLegalHold( - String resourceGroupName, String accountName, String containerName, List tags); - - /** - * Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation. ClearLegalHold - * clears out only the specified tags in the request. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param tags Each tag should be 3 to 23 alphanumeric characters and is normalized to lower case at SRP. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the LegalHold property of a blob container. - */ - LegalHold clearLegalHold( - String resourceGroupName, String accountName, String containerName, List tags); - - /** - * Gets the existing immutability policy along with the corresponding ETag in response headers and body. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the existing immutability policy along with the corresponding ETag in response headers and body. - */ - ImmutabilityPolicy getImmutabilityPolicy(String resourceGroupName, String accountName, String containerName); - - /** - * Aborts an unlocked immutability policy. The response of delete has immutabilityPeriodSinceCreationInDays set to - * 0. ETag in If-Match is required for this operation. Deleting a locked immutability policy is not allowed, the - * only way is to delete the container after deleting all expired blobs inside the policy locked container. - * - * @deprecated use {@link #deleteImmutabilityPolicy(String, String, String, String)} - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @Deprecated - void deleteImmutabilityPolicy(String resourceGroupName, String accountName, String containerName); - - /** - * Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is - * ExtendImmutabilityPolicy action. ETag in If-Match is required for this operation. - * - * @deprecated use {@link #lockImmutabilityPolicy(String, String, String, String)} - * or {@link ImmutabilityPolicy#lock()} - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. - */ - @Deprecated - ImmutabilityPolicy lockImmutabilityPolicy( - String resourceGroupName, String accountName, String containerName); - - /** - * Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action allowed on a - * Locked policy will be this action. ETag in If-Match is required for this operation. - * - * @deprecated use {@link #extendImmutabilityPolicy(String, String, String, int, Boolean, String)} - * or {@link ImmutabilityPolicy#extend(int)}} - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param immutabilityPeriodSinceCreationInDays The immutability period for the blobs in the container since the - * policy creation, in days. - * @param allowProtectedAppendWrites This property can only be changed for unlocked time-based retention policies. - * When enabled, new blocks can be written to an append blob while maintaining immutability protection and - * compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property - * cannot be changed with ExtendImmutabilityPolicy API. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. - */ - @Deprecated - ImmutabilityPolicy extendImmutabilityPolicy( - String resourceGroupName, String accountName, String containerName, - int immutabilityPeriodSinceCreationInDays, Boolean allowProtectedAppendWrites); - - /** - * Aborts an unlocked immutability policy. The response of delete has immutabilityPeriodSinceCreationInDays set to - * 0. ETag in If-Match is required for this operation. Deleting a locked immutability policy is not allowed, the - * only way is to delete the container after deleting all expired blobs inside the policy locked container. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param eTagValue The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always - * be applied. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteImmutabilityPolicy(String resourceGroupName, String accountName, String containerName, - String eTagValue); - - /** - * Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is - * ExtendImmutabilityPolicy action. ETag in If-Match is required for this operation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param eTagValue The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always - * be applied. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. - */ - ImmutabilityPolicy lockImmutabilityPolicy( - String resourceGroupName, String accountName, String containerName, String eTagValue); - - /** - * Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action allowed on a - * Locked policy will be this action. ETag in If-Match is required for this operation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param containerName The name of the blob container within the specified storage account. Blob container names - * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every - * dash (-) character must be immediately preceded and followed by a letter or number. - * @param immutabilityPeriodSinceCreationInDays The immutability period for the blobs in the container since the - * policy creation, in days. - * @param allowProtectedAppendWrites This property can only be changed for unlocked time-based retention policies. - * When enabled, new blocks can be written to an append blob while maintaining immutability protection and - * compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property - * cannot be changed with ExtendImmutabilityPolicy API. - * @param eTagValue The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always - * be applied. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. - */ - ImmutabilityPolicy extendImmutabilityPolicy( - String resourceGroupName, String accountName, String containerName, - int immutabilityPeriodSinceCreationInDays, Boolean allowProtectedAppendWrites, - String eTagValue); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobContainersCreateOrUpdateImmutabilityPolicyHeaders.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobContainersCreateOrUpdateImmutabilityPolicyHeaders.java deleted file mode 100644 index 0cac820a0d55..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobContainersCreateOrUpdateImmutabilityPolicyHeaders.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The BlobContainersCreateOrUpdateImmutabilityPolicyHeaders model. */ -@Fluent -public final class BlobContainersCreateOrUpdateImmutabilityPolicyHeaders { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(BlobContainersCreateOrUpdateImmutabilityPolicyHeaders.class); - - /* - * The Etag property. - */ - @JsonProperty(value = "Etag") - private String etag; - - /** - * Get the etag property: The Etag property. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: The Etag property. - * - * @param etag the etag value to set. - * @return the BlobContainersCreateOrUpdateImmutabilityPolicyHeaders object itself. - */ - public BlobContainersCreateOrUpdateImmutabilityPolicyHeaders withEtag(String etag) { - this.etag = etag; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobContainersCreateOrUpdateImmutabilityPolicyResponse.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobContainersCreateOrUpdateImmutabilityPolicyResponse.java deleted file mode 100644 index 4a0e62e39e9c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobContainersCreateOrUpdateImmutabilityPolicyResponse.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.rest.ResponseBase; -import com.azure.resourcemanager.storage.fluent.models.ImmutabilityPolicyInner; - -/** Contains all response data for the createOrUpdateImmutabilityPolicy operation. */ -public final class BlobContainersCreateOrUpdateImmutabilityPolicyResponse - extends ResponseBase { - /** - * Creates an instance of BlobContainersCreateOrUpdateImmutabilityPolicyResponse. - * - * @param request the request which resulted in this BlobContainersCreateOrUpdateImmutabilityPolicyResponse. - * @param statusCode the status code of the HTTP response. - * @param rawHeaders the raw headers of the HTTP response. - * @param value the deserialized value of the HTTP response. - * @param headers the deserialized headers of the HTTP response. - */ - public BlobContainersCreateOrUpdateImmutabilityPolicyResponse( - HttpRequest request, - int statusCode, - HttpHeaders rawHeaders, - ImmutabilityPolicyInner value, - BlobContainersCreateOrUpdateImmutabilityPolicyHeaders headers) { - super(request, statusCode, rawHeaders, value, headers); - } - - /** @return the deserialized response body. */ - @Override - public ImmutabilityPolicyInner getValue() { - return super.getValue(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobContainersDeleteImmutabilityPolicyHeaders.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobContainersDeleteImmutabilityPolicyHeaders.java deleted file mode 100644 index 8701686fab29..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobContainersDeleteImmutabilityPolicyHeaders.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The BlobContainersDeleteImmutabilityPolicyHeaders model. */ -@Fluent -public final class BlobContainersDeleteImmutabilityPolicyHeaders { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(BlobContainersDeleteImmutabilityPolicyHeaders.class); - - /* - * The Etag property. - */ - @JsonProperty(value = "Etag") - private String etag; - - /** - * Get the etag property: The Etag property. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: The Etag property. - * - * @param etag the etag value to set. - * @return the BlobContainersDeleteImmutabilityPolicyHeaders object itself. - */ - public BlobContainersDeleteImmutabilityPolicyHeaders withEtag(String etag) { - this.etag = etag; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobContainersDeleteImmutabilityPolicyResponse.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobContainersDeleteImmutabilityPolicyResponse.java deleted file mode 100644 index 20062c9f401f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobContainersDeleteImmutabilityPolicyResponse.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.rest.ResponseBase; -import com.azure.resourcemanager.storage.fluent.models.ImmutabilityPolicyInner; - -/** Contains all response data for the deleteImmutabilityPolicy operation. */ -public final class BlobContainersDeleteImmutabilityPolicyResponse - extends ResponseBase { - /** - * Creates an instance of BlobContainersDeleteImmutabilityPolicyResponse. - * - * @param request the request which resulted in this BlobContainersDeleteImmutabilityPolicyResponse. - * @param statusCode the status code of the HTTP response. - * @param rawHeaders the raw headers of the HTTP response. - * @param value the deserialized value of the HTTP response. - * @param headers the deserialized headers of the HTTP response. - */ - public BlobContainersDeleteImmutabilityPolicyResponse( - HttpRequest request, - int statusCode, - HttpHeaders rawHeaders, - ImmutabilityPolicyInner value, - BlobContainersDeleteImmutabilityPolicyHeaders headers) { - super(request, statusCode, rawHeaders, value, headers); - } - - /** @return the deserialized response body. */ - @Override - public ImmutabilityPolicyInner getValue() { - return super.getValue(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobContainersExtendImmutabilityPolicyHeaders.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobContainersExtendImmutabilityPolicyHeaders.java deleted file mode 100644 index 71b295996092..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobContainersExtendImmutabilityPolicyHeaders.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The BlobContainersExtendImmutabilityPolicyHeaders model. */ -@Fluent -public final class BlobContainersExtendImmutabilityPolicyHeaders { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(BlobContainersExtendImmutabilityPolicyHeaders.class); - - /* - * The Etag property. - */ - @JsonProperty(value = "Etag") - private String etag; - - /** - * Get the etag property: The Etag property. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: The Etag property. - * - * @param etag the etag value to set. - * @return the BlobContainersExtendImmutabilityPolicyHeaders object itself. - */ - public BlobContainersExtendImmutabilityPolicyHeaders withEtag(String etag) { - this.etag = etag; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobContainersExtendImmutabilityPolicyResponse.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobContainersExtendImmutabilityPolicyResponse.java deleted file mode 100644 index 22980875a71c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobContainersExtendImmutabilityPolicyResponse.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.rest.ResponseBase; -import com.azure.resourcemanager.storage.fluent.models.ImmutabilityPolicyInner; - -/** Contains all response data for the extendImmutabilityPolicy operation. */ -public final class BlobContainersExtendImmutabilityPolicyResponse - extends ResponseBase { - /** - * Creates an instance of BlobContainersExtendImmutabilityPolicyResponse. - * - * @param request the request which resulted in this BlobContainersExtendImmutabilityPolicyResponse. - * @param statusCode the status code of the HTTP response. - * @param rawHeaders the raw headers of the HTTP response. - * @param value the deserialized value of the HTTP response. - * @param headers the deserialized headers of the HTTP response. - */ - public BlobContainersExtendImmutabilityPolicyResponse( - HttpRequest request, - int statusCode, - HttpHeaders rawHeaders, - ImmutabilityPolicyInner value, - BlobContainersExtendImmutabilityPolicyHeaders headers) { - super(request, statusCode, rawHeaders, value, headers); - } - - /** @return the deserialized response body. */ - @Override - public ImmutabilityPolicyInner getValue() { - return super.getValue(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobContainersGetImmutabilityPolicyHeaders.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobContainersGetImmutabilityPolicyHeaders.java deleted file mode 100644 index 7f0e5f3bb897..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobContainersGetImmutabilityPolicyHeaders.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The BlobContainersGetImmutabilityPolicyHeaders model. */ -@Fluent -public final class BlobContainersGetImmutabilityPolicyHeaders { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BlobContainersGetImmutabilityPolicyHeaders.class); - - /* - * The Etag property. - */ - @JsonProperty(value = "Etag") - private String etag; - - /** - * Get the etag property: The Etag property. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: The Etag property. - * - * @param etag the etag value to set. - * @return the BlobContainersGetImmutabilityPolicyHeaders object itself. - */ - public BlobContainersGetImmutabilityPolicyHeaders withEtag(String etag) { - this.etag = etag; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobContainersGetImmutabilityPolicyResponse.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobContainersGetImmutabilityPolicyResponse.java deleted file mode 100644 index 076720d3cf86..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobContainersGetImmutabilityPolicyResponse.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.rest.ResponseBase; -import com.azure.resourcemanager.storage.fluent.models.ImmutabilityPolicyInner; - -/** Contains all response data for the getImmutabilityPolicy operation. */ -public final class BlobContainersGetImmutabilityPolicyResponse - extends ResponseBase { - /** - * Creates an instance of BlobContainersGetImmutabilityPolicyResponse. - * - * @param request the request which resulted in this BlobContainersGetImmutabilityPolicyResponse. - * @param statusCode the status code of the HTTP response. - * @param rawHeaders the raw headers of the HTTP response. - * @param value the deserialized value of the HTTP response. - * @param headers the deserialized headers of the HTTP response. - */ - public BlobContainersGetImmutabilityPolicyResponse( - HttpRequest request, - int statusCode, - HttpHeaders rawHeaders, - ImmutabilityPolicyInner value, - BlobContainersGetImmutabilityPolicyHeaders headers) { - super(request, statusCode, rawHeaders, value, headers); - } - - /** @return the deserialized response body. */ - @Override - public ImmutabilityPolicyInner getValue() { - return super.getValue(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobContainersLockImmutabilityPolicyHeaders.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobContainersLockImmutabilityPolicyHeaders.java deleted file mode 100644 index 85be203ed0e8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobContainersLockImmutabilityPolicyHeaders.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The BlobContainersLockImmutabilityPolicyHeaders model. */ -@Fluent -public final class BlobContainersLockImmutabilityPolicyHeaders { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BlobContainersLockImmutabilityPolicyHeaders.class); - - /* - * The Etag property. - */ - @JsonProperty(value = "Etag") - private String etag; - - /** - * Get the etag property: The Etag property. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: The Etag property. - * - * @param etag the etag value to set. - * @return the BlobContainersLockImmutabilityPolicyHeaders object itself. - */ - public BlobContainersLockImmutabilityPolicyHeaders withEtag(String etag) { - this.etag = etag; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobContainersLockImmutabilityPolicyResponse.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobContainersLockImmutabilityPolicyResponse.java deleted file mode 100644 index 4882a9d19944..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobContainersLockImmutabilityPolicyResponse.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.rest.ResponseBase; -import com.azure.resourcemanager.storage.fluent.models.ImmutabilityPolicyInner; - -/** Contains all response data for the lockImmutabilityPolicy operation. */ -public final class BlobContainersLockImmutabilityPolicyResponse - extends ResponseBase { - /** - * Creates an instance of BlobContainersLockImmutabilityPolicyResponse. - * - * @param request the request which resulted in this BlobContainersLockImmutabilityPolicyResponse. - * @param statusCode the status code of the HTTP response. - * @param rawHeaders the raw headers of the HTTP response. - * @param value the deserialized value of the HTTP response. - * @param headers the deserialized headers of the HTTP response. - */ - public BlobContainersLockImmutabilityPolicyResponse( - HttpRequest request, - int statusCode, - HttpHeaders rawHeaders, - ImmutabilityPolicyInner value, - BlobContainersLockImmutabilityPolicyHeaders headers) { - super(request, statusCode, rawHeaders, value, headers); - } - - /** @return the deserialized response body. */ - @Override - public ImmutabilityPolicyInner getValue() { - return super.getValue(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobInventoryPolicyDefinition.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobInventoryPolicyDefinition.java deleted file mode 100644 index b398aa0b3b15..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobInventoryPolicyDefinition.java +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** An object that defines the blob inventory rule. Each definition consists of a set of filters. */ -@Fluent -public final class BlobInventoryPolicyDefinition { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BlobInventoryPolicyDefinition.class); - - /* - * An object that defines the filter set. - */ - @JsonProperty(value = "filters", required = true) - private BlobInventoryPolicyFilter filters; - - /** - * Get the filters property: An object that defines the filter set. - * - * @return the filters value. - */ - public BlobInventoryPolicyFilter filters() { - return this.filters; - } - - /** - * Set the filters property: An object that defines the filter set. - * - * @param filters the filters value to set. - * @return the BlobInventoryPolicyDefinition object itself. - */ - public BlobInventoryPolicyDefinition withFilters(BlobInventoryPolicyFilter filters) { - this.filters = filters; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (filters() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property filters in model BlobInventoryPolicyDefinition")); - } else { - filters().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobInventoryPolicyFilter.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobInventoryPolicyFilter.java deleted file mode 100644 index 80ed521eb225..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobInventoryPolicyFilter.java +++ /dev/null @@ -1,138 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** An object that defines the blob inventory rule filter conditions. */ -@Fluent -public final class BlobInventoryPolicyFilter { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BlobInventoryPolicyFilter.class); - - /* - * An array of strings for blob prefixes to be matched. - */ - @JsonProperty(value = "prefixMatch") - private List prefixMatch; - - /* - * An array of predefined enum values. Valid values include blockBlob, - * appendBlob, pageBlob. Hns accounts does not support pageBlobs. - */ - @JsonProperty(value = "blobTypes", required = true) - private List blobTypes; - - /* - * Includes blob versions in blob inventory when value set to true. - */ - @JsonProperty(value = "includeBlobVersions") - private Boolean includeBlobVersions; - - /* - * Includes blob snapshots in blob inventory when value set to true. - */ - @JsonProperty(value = "includeSnapshots") - private Boolean includeSnapshots; - - /** - * Get the prefixMatch property: An array of strings for blob prefixes to be matched. - * - * @return the prefixMatch value. - */ - public List prefixMatch() { - return this.prefixMatch; - } - - /** - * Set the prefixMatch property: An array of strings for blob prefixes to be matched. - * - * @param prefixMatch the prefixMatch value to set. - * @return the BlobInventoryPolicyFilter object itself. - */ - public BlobInventoryPolicyFilter withPrefixMatch(List prefixMatch) { - this.prefixMatch = prefixMatch; - return this; - } - - /** - * Get the blobTypes property: An array of predefined enum values. Valid values include blockBlob, appendBlob, - * pageBlob. Hns accounts does not support pageBlobs. - * - * @return the blobTypes value. - */ - public List blobTypes() { - return this.blobTypes; - } - - /** - * Set the blobTypes property: An array of predefined enum values. Valid values include blockBlob, appendBlob, - * pageBlob. Hns accounts does not support pageBlobs. - * - * @param blobTypes the blobTypes value to set. - * @return the BlobInventoryPolicyFilter object itself. - */ - public BlobInventoryPolicyFilter withBlobTypes(List blobTypes) { - this.blobTypes = blobTypes; - return this; - } - - /** - * Get the includeBlobVersions property: Includes blob versions in blob inventory when value set to true. - * - * @return the includeBlobVersions value. - */ - public Boolean includeBlobVersions() { - return this.includeBlobVersions; - } - - /** - * Set the includeBlobVersions property: Includes blob versions in blob inventory when value set to true. - * - * @param includeBlobVersions the includeBlobVersions value to set. - * @return the BlobInventoryPolicyFilter object itself. - */ - public BlobInventoryPolicyFilter withIncludeBlobVersions(Boolean includeBlobVersions) { - this.includeBlobVersions = includeBlobVersions; - return this; - } - - /** - * Get the includeSnapshots property: Includes blob snapshots in blob inventory when value set to true. - * - * @return the includeSnapshots value. - */ - public Boolean includeSnapshots() { - return this.includeSnapshots; - } - - /** - * Set the includeSnapshots property: Includes blob snapshots in blob inventory when value set to true. - * - * @param includeSnapshots the includeSnapshots value to set. - * @return the BlobInventoryPolicyFilter object itself. - */ - public BlobInventoryPolicyFilter withIncludeSnapshots(Boolean includeSnapshots) { - this.includeSnapshots = includeSnapshots; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (blobTypes() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property blobTypes in model BlobInventoryPolicyFilter")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobInventoryPolicyName.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobInventoryPolicyName.java deleted file mode 100644 index 26b708db28c4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobInventoryPolicyName.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for BlobInventoryPolicyName. */ -public final class BlobInventoryPolicyName extends ExpandableStringEnum { - /** Static value default for BlobInventoryPolicyName. */ - public static final BlobInventoryPolicyName DEFAULT = fromString("default"); - - /** - * Creates or finds a BlobInventoryPolicyName from its string representation. - * - * @param name a name to look for. - * @return the corresponding BlobInventoryPolicyName. - */ - @JsonCreator - public static BlobInventoryPolicyName fromString(String name) { - return fromString(name, BlobInventoryPolicyName.class); - } - - /** @return known BlobInventoryPolicyName values. */ - public static Collection values() { - return values(BlobInventoryPolicyName.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobInventoryPolicyRule.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobInventoryPolicyRule.java deleted file mode 100644 index a4e15f6c33e9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobInventoryPolicyRule.java +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** An object that wraps the blob inventory rule. Each rule is uniquely defined by name. */ -@Fluent -public final class BlobInventoryPolicyRule { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BlobInventoryPolicyRule.class); - - /* - * Rule is enabled when set to true. - */ - @JsonProperty(value = "enabled", required = true) - private boolean enabled; - - /* - * A rule name can contain any combination of alpha numeric characters. - * Rule name is case-sensitive. It must be unique within a policy. - */ - @JsonProperty(value = "name", required = true) - private String name; - - /* - * An object that defines the blob inventory policy rule. - */ - @JsonProperty(value = "definition", required = true) - private BlobInventoryPolicyDefinition definition; - - /** - * Get the enabled property: Rule is enabled when set to true. - * - * @return the enabled value. - */ - public boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Rule is enabled when set to true. - * - * @param enabled the enabled value to set. - * @return the BlobInventoryPolicyRule object itself. - */ - public BlobInventoryPolicyRule withEnabled(boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the name property: A rule name can contain any combination of alpha numeric characters. Rule name is - * case-sensitive. It must be unique within a policy. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: A rule name can contain any combination of alpha numeric characters. Rule name is - * case-sensitive. It must be unique within a policy. - * - * @param name the name value to set. - * @return the BlobInventoryPolicyRule object itself. - */ - public BlobInventoryPolicyRule withName(String name) { - this.name = name; - return this; - } - - /** - * Get the definition property: An object that defines the blob inventory policy rule. - * - * @return the definition value. - */ - public BlobInventoryPolicyDefinition definition() { - return this.definition; - } - - /** - * Set the definition property: An object that defines the blob inventory policy rule. - * - * @param definition the definition value to set. - * @return the BlobInventoryPolicyRule object itself. - */ - public BlobInventoryPolicyRule withDefinition(BlobInventoryPolicyDefinition definition) { - this.definition = definition; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property name in model BlobInventoryPolicyRule")); - } - if (definition() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property definition in model BlobInventoryPolicyRule")); - } else { - definition().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobInventoryPolicySchema.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobInventoryPolicySchema.java deleted file mode 100644 index 8fdbb8d21e9e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobInventoryPolicySchema.java +++ /dev/null @@ -1,149 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The storage account blob inventory policy rules. */ -@Fluent -public final class BlobInventoryPolicySchema { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BlobInventoryPolicySchema.class); - - /* - * Policy is enabled if set to true. - */ - @JsonProperty(value = "enabled", required = true) - private boolean enabled; - - /* - * Container name where blob inventory files are stored. Must be - * pre-created. - */ - @JsonProperty(value = "destination", required = true) - private String destination; - - /* - * The valid value is Inventory - */ - @JsonProperty(value = "type", required = true) - private InventoryRuleType type; - - /* - * The storage account blob inventory policy rules. The rule is applied - * when it is enabled. - */ - @JsonProperty(value = "rules", required = true) - private List rules; - - /** - * Get the enabled property: Policy is enabled if set to true. - * - * @return the enabled value. - */ - public boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Policy is enabled if set to true. - * - * @param enabled the enabled value to set. - * @return the BlobInventoryPolicySchema object itself. - */ - public BlobInventoryPolicySchema withEnabled(boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the destination property: Container name where blob inventory files are stored. Must be pre-created. - * - * @return the destination value. - */ - public String destination() { - return this.destination; - } - - /** - * Set the destination property: Container name where blob inventory files are stored. Must be pre-created. - * - * @param destination the destination value to set. - * @return the BlobInventoryPolicySchema object itself. - */ - public BlobInventoryPolicySchema withDestination(String destination) { - this.destination = destination; - return this; - } - - /** - * Get the type property: The valid value is Inventory. - * - * @return the type value. - */ - public InventoryRuleType type() { - return this.type; - } - - /** - * Set the type property: The valid value is Inventory. - * - * @param type the type value to set. - * @return the BlobInventoryPolicySchema object itself. - */ - public BlobInventoryPolicySchema withType(InventoryRuleType type) { - this.type = type; - return this; - } - - /** - * Get the rules property: The storage account blob inventory policy rules. The rule is applied when it is enabled. - * - * @return the rules value. - */ - public List rules() { - return this.rules; - } - - /** - * Set the rules property: The storage account blob inventory policy rules. The rule is applied when it is enabled. - * - * @param rules the rules value to set. - * @return the BlobInventoryPolicySchema object itself. - */ - public BlobInventoryPolicySchema withRules(List rules) { - this.rules = rules; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (destination() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property destination in model BlobInventoryPolicySchema")); - } - if (type() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property type in model BlobInventoryPolicySchema")); - } - if (rules() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property rules in model BlobInventoryPolicySchema")); - } else { - rules().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobRestoreParameters.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobRestoreParameters.java deleted file mode 100644 index a708d553a686..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobRestoreParameters.java +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; - -/** Blob restore parameters. */ -@Fluent -public final class BlobRestoreParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BlobRestoreParameters.class); - - /* - * Restore blob to the specified time. - */ - @JsonProperty(value = "timeToRestore", required = true) - private OffsetDateTime timeToRestore; - - /* - * Blob ranges to restore. - */ - @JsonProperty(value = "blobRanges", required = true) - private List blobRanges; - - /** - * Get the timeToRestore property: Restore blob to the specified time. - * - * @return the timeToRestore value. - */ - public OffsetDateTime timeToRestore() { - return this.timeToRestore; - } - - /** - * Set the timeToRestore property: Restore blob to the specified time. - * - * @param timeToRestore the timeToRestore value to set. - * @return the BlobRestoreParameters object itself. - */ - public BlobRestoreParameters withTimeToRestore(OffsetDateTime timeToRestore) { - this.timeToRestore = timeToRestore; - return this; - } - - /** - * Get the blobRanges property: Blob ranges to restore. - * - * @return the blobRanges value. - */ - public List blobRanges() { - return this.blobRanges; - } - - /** - * Set the blobRanges property: Blob ranges to restore. - * - * @param blobRanges the blobRanges value to set. - * @return the BlobRestoreParameters object itself. - */ - public BlobRestoreParameters withBlobRanges(List blobRanges) { - this.blobRanges = blobRanges; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (timeToRestore() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property timeToRestore in model BlobRestoreParameters")); - } - if (blobRanges() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property blobRanges in model BlobRestoreParameters")); - } else { - blobRanges().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobRestoreProgressStatus.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobRestoreProgressStatus.java deleted file mode 100644 index e7b3a5bdc9b8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobRestoreProgressStatus.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for BlobRestoreProgressStatus. */ -public final class BlobRestoreProgressStatus extends ExpandableStringEnum { - /** Static value InProgress for BlobRestoreProgressStatus. */ - public static final BlobRestoreProgressStatus IN_PROGRESS = fromString("InProgress"); - - /** Static value Complete for BlobRestoreProgressStatus. */ - public static final BlobRestoreProgressStatus COMPLETE = fromString("Complete"); - - /** Static value Failed for BlobRestoreProgressStatus. */ - public static final BlobRestoreProgressStatus FAILED = fromString("Failed"); - - /** - * Creates or finds a BlobRestoreProgressStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding BlobRestoreProgressStatus. - */ - @JsonCreator - public static BlobRestoreProgressStatus fromString(String name) { - return fromString(name, BlobRestoreProgressStatus.class); - } - - /** @return known BlobRestoreProgressStatus values. */ - public static Collection values() { - return values(BlobRestoreProgressStatus.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobRestoreRange.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobRestoreRange.java deleted file mode 100644 index 6106f7d47323..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobRestoreRange.java +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Blob range. */ -@Fluent -public final class BlobRestoreRange { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BlobRestoreRange.class); - - /* - * Blob start range. This is inclusive. Empty means account start. - */ - @JsonProperty(value = "startRange", required = true) - private String startRange; - - /* - * Blob end range. This is exclusive. Empty means account end. - */ - @JsonProperty(value = "endRange", required = true) - private String endRange; - - /** - * Get the startRange property: Blob start range. This is inclusive. Empty means account start. - * - * @return the startRange value. - */ - public String startRange() { - return this.startRange; - } - - /** - * Set the startRange property: Blob start range. This is inclusive. Empty means account start. - * - * @param startRange the startRange value to set. - * @return the BlobRestoreRange object itself. - */ - public BlobRestoreRange withStartRange(String startRange) { - this.startRange = startRange; - return this; - } - - /** - * Get the endRange property: Blob end range. This is exclusive. Empty means account end. - * - * @return the endRange value. - */ - public String endRange() { - return this.endRange; - } - - /** - * Set the endRange property: Blob end range. This is exclusive. Empty means account end. - * - * @param endRange the endRange value to set. - * @return the BlobRestoreRange object itself. - */ - public BlobRestoreRange withEndRange(String endRange) { - this.endRange = endRange; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (startRange() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property startRange in model BlobRestoreRange")); - } - if (endRange() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property endRange in model BlobRestoreRange")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobServiceItems.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobServiceItems.java deleted file mode 100644 index 3ca151a96e11..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobServiceItems.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.storage.fluent.models.BlobServicePropertiesInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The BlobServiceItems model. */ -@Immutable -public final class BlobServiceItems { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BlobServiceItems.class); - - /* - * List of blob services returned. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /** - * Get the value property: List of blob services returned. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobServiceProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobServiceProperties.java deleted file mode 100644 index c1f84c6a6bc3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobServiceProperties.java +++ /dev/null @@ -1,212 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.model.Appliable; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.model.Indexable; -import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; -import com.azure.resourcemanager.resources.fluentcore.model.Updatable; -import com.azure.resourcemanager.storage.StorageManager; -import com.azure.resourcemanager.storage.fluent.models.BlobServicePropertiesInner; -import java.util.List; - -/** Type representing BlobServiceProperties. */ -@Fluent -public interface BlobServiceProperties - extends HasInnerModel, - Indexable, - Refreshable, - Updatable, - HasManager { - /** @return the cors value. */ - CorsRules cors(); - - /** @return the defaultServiceVersion value. */ - String defaultServiceVersion(); - - /** @return the deleteRetentionPolicy value. */ - DeleteRetentionPolicy deleteRetentionPolicy(); - - /** @return the id value. */ - String id(); - - /** @return the name value. */ - String name(); - - /** @return the type value. */ - String type(); - - /** The entirety of the BlobServiceProperties definition. */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithStorageAccount, DefinitionStages.WithCreate { - } - - /** Grouping of BlobServiceProperties definition stages. */ - interface DefinitionStages { - /** The first stage of a BlobServiceProperties definition. */ - interface Blank extends WithStorageAccount { - } - - /** The stage of the blobserviceproperties definition allowing to specify StorageAccount. */ - interface WithStorageAccount { - /** - * Specifies resourceGroupName, accountName. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive - * @param accountName The name of the storage account within the specified resource group. Storage account - * names must be between 3 and 24 characters in length and use numbers and lower-case letters only - * @return the next definition stage - */ - WithCreate withExistingStorageAccount(String resourceGroupName, String accountName); - } - - /** The stage of the blobserviceproperties definition allowing to specify Cors. */ - interface WithCors { - /** - * Specifies all of the CORS rules. - * - * @param corsRules Specifies CORS rules for the Blob service. You can include up to five CorsRule elements - * in the request. If no CorsRule elements are included in the request body, all CORS rules will be - * deleted, and CORS will be disabled for the Blob service - * @return the next definition stage - */ - WithCreate withCORSRules(List corsRules); - - /** - * Specifies a single CORS rule. - * - * @param corsRule a single CORS rule - * @return the next definition stage - */ - WithCreate withCORSRule(CorsRule corsRule); - } - - /** The stage of the blobserviceproperties definition allowing to specify DefaultServiceVersion. */ - interface WithDefaultServiceVersion { - /** - * Specifies defaultServiceVersion. - * - * @param defaultServiceVersion DefaultServiceVersion indicates the default version to use for requests to - * the Blob service if an incoming request’s version is not specified. Possible values include version - * 2008-10-27 and all more recent versions - * @return the next definition stage - */ - WithCreate withDefaultServiceVersion(String defaultServiceVersion); - } - - /** The stage of the blobserviceproperties definition allowing to specify DeleteRetentionPolicy. */ - interface WithDeleteRetentionPolicy { - /** - * Specifies deleteRetentionPolicy. - * - * @param deleteRetentionPolicy The blob service properties for soft delete - * @return the next definition stage - */ - WithCreate withDeleteRetentionPolicy(DeleteRetentionPolicy deleteRetentionPolicy); - - /** - * Specifies that the delete retention policy is enabled for soft delete. - * - * @param numDaysEnabled number of days after soft delete that the blob service properties will actually be - * deleted - * @return the next definition stage - */ - WithCreate withDeleteRetentionPolicyEnabled(int numDaysEnabled); - - /** - * Specifies that the delete retention policy is disabled. - * - * @return the next definition stage - */ - WithCreate withDeleteRetentionPolicyDisabled(); - } - - /** - * The stage of the definition which contains all the minimum required inputs for the resource to be created - * (via {@link WithCreate#create()}), but also allows for any other optional settings to be specified. - */ - interface WithCreate - extends Creatable, - DefinitionStages.WithCors, - DefinitionStages.WithDefaultServiceVersion, - DefinitionStages.WithDeleteRetentionPolicy { - } - } - /** The template for a BlobServiceProperties update operation, containing all the settings that can be modified. */ - interface Update - extends Appliable, - UpdateStages.WithCors, - UpdateStages.WithDefaultServiceVersion, - UpdateStages.WithDeleteRetentionPolicy { - } - - /** Grouping of BlobServiceProperties update stages. */ - interface UpdateStages { - /** The stage of the blobserviceproperties update allowing to specify Cors. */ - interface WithCors { - /** - * Specifies all of the CORS rules. - * - * @param corsRules Specifies CORS rules for the Blob service. You can include up to five CorsRule elements - * in the request. If no CorsRule elements are included in the request body, all CORS rules will be - * deleted, and CORS will be disabled for the Blob service - * @return the next update stage - */ - Update withCORSRules(List corsRules); - - /** - * Specifies a single CORS rule. - * - * @param corsRule a single CORS rule - * @return the next update stage - */ - Update withCORSRule(CorsRule corsRule); - } - - /** The stage of the blobserviceproperties update allowing to specify DefaultServiceVersion. */ - interface WithDefaultServiceVersion { - /** - * Specifies defaultServiceVersion. - * - * @param defaultServiceVersion DefaultServiceVersion indicates the default version to use for requests to - * the Blob service if an incoming request’s version is not specified. Possible values include version - * 2008-10-27 and all more recent versions - * @return the next update stage - */ - Update withDefaultServiceVersion(String defaultServiceVersion); - } - - /** The stage of the blobserviceproperties update allowing to specify DeleteRetentionPolicy. */ - interface WithDeleteRetentionPolicy { - /** - * Specifies deleteRetentionPolicy. - * - * @param deleteRetentionPolicy The blob service properties for soft delete - * @return the next update stage - */ - Update withDeleteRetentionPolicy(DeleteRetentionPolicy deleteRetentionPolicy); - - /** - * Specifies that the delete retention policy is enabled for soft delete. - * - * @param numDaysEnabled number of days after soft delete that the blob service properties will actually be - * deleted - * @return the next update stage - */ - Update withDeleteRetentionPolicyEnabled(int numDaysEnabled); - - /** - * Specifies that the delete retention policy is disabled. - * - * @return the next update stage - */ - Update withDeleteRetentionPolicyDisabled(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobServices.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobServices.java deleted file mode 100644 index 6aea612dc91a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobServices.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsCreating; -import reactor.core.publisher.Mono; - -/** Type representing BlobServices. */ -@Fluent -public interface BlobServices - extends SupportsCreating { - /** - * Gets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - Mono getServicePropertiesAsync(String resourceGroupName, String accountName); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobTypes.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobTypes.java deleted file mode 100644 index 67fe5deedeac..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobTypes.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for GeoReplicationStatus. */ -public final class BlobTypes extends ExpandableStringEnum { - /** Static value blockBlob for BlobTypes. */ - public static final BlobTypes BLOCK_BLOB = fromString("blockBlob"); - - /** Static value snapshot for BlobTypes. */ - public static final BlobTypes SNAPSHOT = fromString("snapshot"); - - /** - * Creates or finds a BlobType from its string representation. - * - * @param name a name to look for - * @return the corresponding BlobType - */ - @JsonCreator - public static BlobTypes fromString(String name) { - return fromString(name, BlobTypes.class); - } - - /** @return known BlobType values */ - public static Collection values() { - return values(BlobTypes.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Bypass.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Bypass.java deleted file mode 100644 index 5e81d9629e74..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Bypass.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for Bypass. */ -public final class Bypass extends ExpandableStringEnum { - /** Static value None for Bypass. */ - public static final Bypass NONE = fromString("None"); - - /** Static value Logging for Bypass. */ - public static final Bypass LOGGING = fromString("Logging"); - - /** Static value Metrics for Bypass. */ - public static final Bypass METRICS = fromString("Metrics"); - - /** Static value AzureServices for Bypass. */ - public static final Bypass AZURE_SERVICES = fromString("AzureServices"); - - /** - * Creates or finds a Bypass from its string representation. - * - * @param name a name to look for. - * @return the corresponding Bypass. - */ - @JsonCreator - public static Bypass fromString(String name) { - return fromString(name, Bypass.class); - } - - /** @return known Bypass values. */ - public static Collection values() { - return values(Bypass.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ChangeFeed.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ChangeFeed.java deleted file mode 100644 index a607e5726dbb..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ChangeFeed.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The blob service properties for change feed events. */ -@Fluent -public final class ChangeFeed { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ChangeFeed.class); - - /* - * Indicates whether change feed event logging is enabled for the Blob - * service. - */ - @JsonProperty(value = "enabled") - private Boolean enabled; - - /* - * Indicates the duration of changeFeed retention in days. Minimum value is - * 1 day and maximum value is 146000 days (400 years). A null value - * indicates an infinite retention of the change feed. - */ - @JsonProperty(value = "retentionInDays") - private Integer retentionInDays; - - /** - * Get the enabled property: Indicates whether change feed event logging is enabled for the Blob service. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Indicates whether change feed event logging is enabled for the Blob service. - * - * @param enabled the enabled value to set. - * @return the ChangeFeed object itself. - */ - public ChangeFeed withEnabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the retentionInDays property: Indicates the duration of changeFeed retention in days. Minimum value is 1 day - * and maximum value is 146000 days (400 years). A null value indicates an infinite retention of the change feed. - * - * @return the retentionInDays value. - */ - public Integer retentionInDays() { - return this.retentionInDays; - } - - /** - * Set the retentionInDays property: Indicates the duration of changeFeed retention in days. Minimum value is 1 day - * and maximum value is 146000 days (400 years). A null value indicates an infinite retention of the change feed. - * - * @param retentionInDays the retentionInDays value to set. - * @return the ChangeFeed object itself. - */ - public ChangeFeed withRetentionInDays(Integer retentionInDays) { - this.retentionInDays = retentionInDays; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/CheckNameAvailabilityResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/CheckNameAvailabilityResult.java deleted file mode 100644 index 5c9a1dded4f6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/CheckNameAvailabilityResult.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.storage.models; - -import com.azure.resourcemanager.storage.fluent.models.CheckNameAvailabilityResultInner; - -/** The {@link StorageAccounts#checkNameAvailability} action result. */ -public class CheckNameAvailabilityResult { - private final CheckNameAvailabilityResultInner inner; - - /** - * Creates an instance of the check name availability result object. - * - * @param inner the inner object - */ - public CheckNameAvailabilityResult(CheckNameAvailabilityResultInner inner) { - this.inner = inner; - } - - /** - * @return a boolean value that indicates whether the name is available for you to use. If true, the name is - * available. If false, the name has already been taken or invalid and cannot be used. - */ - public boolean isAvailable() { - return inner.nameAvailable(); - } - - /** - * @return the reason that a storage account name could not be used. The Reason element is only returned if - * NameAvailable is false. Possible values include: 'AccountNameInvalid', 'AlreadyExists'. - */ - public Reason reason() { - return inner.reason(); - } - - /** @return an error message explaining the Reason value in more detail */ - public String message() { - return inner.message(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/CorsRule.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/CorsRule.java deleted file mode 100644 index 76bcad9e089b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/CorsRule.java +++ /dev/null @@ -1,190 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Specifies a CORS rule for the Blob service. */ -@Fluent -public final class CorsRule { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CorsRule.class); - - /* - * Required if CorsRule element is present. A list of origin domains that - * will be allowed via CORS, or "*" to allow all domains - */ - @JsonProperty(value = "allowedOrigins", required = true) - private List allowedOrigins; - - /* - * Required if CorsRule element is present. A list of HTTP methods that are - * allowed to be executed by the origin. - */ - @JsonProperty(value = "allowedMethods", required = true) - private List allowedMethods; - - /* - * Required if CorsRule element is present. The number of seconds that the - * client/browser should cache a preflight response. - */ - @JsonProperty(value = "maxAgeInSeconds", required = true) - private int maxAgeInSeconds; - - /* - * Required if CorsRule element is present. A list of response headers to - * expose to CORS clients. - */ - @JsonProperty(value = "exposedHeaders", required = true) - private List exposedHeaders; - - /* - * Required if CorsRule element is present. A list of headers allowed to be - * part of the cross-origin request. - */ - @JsonProperty(value = "allowedHeaders", required = true) - private List allowedHeaders; - - /** - * Get the allowedOrigins property: Required if CorsRule element is present. A list of origin domains that will be - * allowed via CORS, or "*" to allow all domains. - * - * @return the allowedOrigins value. - */ - public List allowedOrigins() { - return this.allowedOrigins; - } - - /** - * Set the allowedOrigins property: Required if CorsRule element is present. A list of origin domains that will be - * allowed via CORS, or "*" to allow all domains. - * - * @param allowedOrigins the allowedOrigins value to set. - * @return the CorsRule object itself. - */ - public CorsRule withAllowedOrigins(List allowedOrigins) { - this.allowedOrigins = allowedOrigins; - return this; - } - - /** - * Get the allowedMethods property: Required if CorsRule element is present. A list of HTTP methods that are allowed - * to be executed by the origin. - * - * @return the allowedMethods value. - */ - public List allowedMethods() { - return this.allowedMethods; - } - - /** - * Set the allowedMethods property: Required if CorsRule element is present. A list of HTTP methods that are allowed - * to be executed by the origin. - * - * @param allowedMethods the allowedMethods value to set. - * @return the CorsRule object itself. - */ - public CorsRule withAllowedMethods(List allowedMethods) { - this.allowedMethods = allowedMethods; - return this; - } - - /** - * Get the maxAgeInSeconds property: Required if CorsRule element is present. The number of seconds that the - * client/browser should cache a preflight response. - * - * @return the maxAgeInSeconds value. - */ - public int maxAgeInSeconds() { - return this.maxAgeInSeconds; - } - - /** - * Set the maxAgeInSeconds property: Required if CorsRule element is present. The number of seconds that the - * client/browser should cache a preflight response. - * - * @param maxAgeInSeconds the maxAgeInSeconds value to set. - * @return the CorsRule object itself. - */ - public CorsRule withMaxAgeInSeconds(int maxAgeInSeconds) { - this.maxAgeInSeconds = maxAgeInSeconds; - return this; - } - - /** - * Get the exposedHeaders property: Required if CorsRule element is present. A list of response headers to expose to - * CORS clients. - * - * @return the exposedHeaders value. - */ - public List exposedHeaders() { - return this.exposedHeaders; - } - - /** - * Set the exposedHeaders property: Required if CorsRule element is present. A list of response headers to expose to - * CORS clients. - * - * @param exposedHeaders the exposedHeaders value to set. - * @return the CorsRule object itself. - */ - public CorsRule withExposedHeaders(List exposedHeaders) { - this.exposedHeaders = exposedHeaders; - return this; - } - - /** - * Get the allowedHeaders property: Required if CorsRule element is present. A list of headers allowed to be part of - * the cross-origin request. - * - * @return the allowedHeaders value. - */ - public List allowedHeaders() { - return this.allowedHeaders; - } - - /** - * Set the allowedHeaders property: Required if CorsRule element is present. A list of headers allowed to be part of - * the cross-origin request. - * - * @param allowedHeaders the allowedHeaders value to set. - * @return the CorsRule object itself. - */ - public CorsRule withAllowedHeaders(List allowedHeaders) { - this.allowedHeaders = allowedHeaders; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (allowedOrigins() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property allowedOrigins in model CorsRule")); - } - if (allowedMethods() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property allowedMethods in model CorsRule")); - } - if (exposedHeaders() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property exposedHeaders in model CorsRule")); - } - if (allowedHeaders() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property allowedHeaders in model CorsRule")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/CorsRuleAllowedMethodsItem.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/CorsRuleAllowedMethodsItem.java deleted file mode 100644 index 0cf0588f0ae6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/CorsRuleAllowedMethodsItem.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for CorsRuleAllowedMethodsItem. */ -public final class CorsRuleAllowedMethodsItem extends ExpandableStringEnum { - /** Static value DELETE for CorsRuleAllowedMethodsItem. */ - public static final CorsRuleAllowedMethodsItem DELETE = fromString("DELETE"); - - /** Static value GET for CorsRuleAllowedMethodsItem. */ - public static final CorsRuleAllowedMethodsItem GET = fromString("GET"); - - /** Static value HEAD for CorsRuleAllowedMethodsItem. */ - public static final CorsRuleAllowedMethodsItem HEAD = fromString("HEAD"); - - /** Static value MERGE for CorsRuleAllowedMethodsItem. */ - public static final CorsRuleAllowedMethodsItem MERGE = fromString("MERGE"); - - /** Static value POST for CorsRuleAllowedMethodsItem. */ - public static final CorsRuleAllowedMethodsItem POST = fromString("POST"); - - /** Static value OPTIONS for CorsRuleAllowedMethodsItem. */ - public static final CorsRuleAllowedMethodsItem OPTIONS = fromString("OPTIONS"); - - /** Static value PUT for CorsRuleAllowedMethodsItem. */ - public static final CorsRuleAllowedMethodsItem PUT = fromString("PUT"); - - /** - * Creates or finds a CorsRuleAllowedMethodsItem from its string representation. - * - * @param name a name to look for. - * @return the corresponding CorsRuleAllowedMethodsItem. - */ - @JsonCreator - public static CorsRuleAllowedMethodsItem fromString(String name) { - return fromString(name, CorsRuleAllowedMethodsItem.class); - } - - /** @return known CorsRuleAllowedMethodsItem values. */ - public static Collection values() { - return values(CorsRuleAllowedMethodsItem.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/CorsRules.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/CorsRules.java deleted file mode 100644 index 99d81524deb3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/CorsRules.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Sets the CORS rules. You can include up to five CorsRule elements in the request. */ -@Fluent -public final class CorsRules { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CorsRules.class); - - /* - * The List of CORS rules. You can include up to five CorsRule elements in - * the request. - */ - @JsonProperty(value = "corsRules") - private List corsRules; - - /** - * Get the corsRules property: The List of CORS rules. You can include up to five CorsRule elements in the request. - * - * @return the corsRules value. - */ - public List corsRules() { - return this.corsRules; - } - - /** - * Set the corsRules property: The List of CORS rules. You can include up to five CorsRule elements in the request. - * - * @param corsRules the corsRules value to set. - * @return the CorsRules object itself. - */ - public CorsRules withCorsRules(List corsRules) { - this.corsRules = corsRules; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (corsRules() != null) { - corsRules().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/CustomDomain.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/CustomDomain.java deleted file mode 100644 index d8cca759354b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/CustomDomain.java +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The custom domain assigned to this storage account. This can be set via Update. */ -@Fluent -public final class CustomDomain { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomDomain.class); - - /* - * Gets or sets the custom domain name assigned to the storage account. - * Name is the CNAME source. - */ - @JsonProperty(value = "name", required = true) - private String name; - - /* - * Indicates whether indirect CName validation is enabled. Default value is - * false. This should only be set on updates. - */ - @JsonProperty(value = "useSubDomainName") - private Boolean useSubDomainName; - - /** - * Get the name property: Gets or sets the custom domain name assigned to the storage account. Name is the CNAME - * source. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Gets or sets the custom domain name assigned to the storage account. Name is the CNAME - * source. - * - * @param name the name value to set. - * @return the CustomDomain object itself. - */ - public CustomDomain withName(String name) { - this.name = name; - return this; - } - - /** - * Get the useSubDomainName property: Indicates whether indirect CName validation is enabled. Default value is - * false. This should only be set on updates. - * - * @return the useSubDomainName value. - */ - public Boolean useSubDomainName() { - return this.useSubDomainName; - } - - /** - * Set the useSubDomainName property: Indicates whether indirect CName validation is enabled. Default value is - * false. This should only be set on updates. - * - * @param useSubDomainName the useSubDomainName value to set. - * @return the CustomDomain object itself. - */ - public CustomDomain withUseSubDomainName(Boolean useSubDomainName) { - this.useSubDomainName = useSubDomainName; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property name in model CustomDomain")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/DateAfterCreation.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/DateAfterCreation.java deleted file mode 100644 index 2946e13ff411..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/DateAfterCreation.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Object to define the number of days after creation. */ -@Fluent -public final class DateAfterCreation { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DateAfterCreation.class); - - /* - * Value indicating the age in days after creation - */ - @JsonProperty(value = "daysAfterCreationGreaterThan", required = true) - private float daysAfterCreationGreaterThan; - - /** - * Get the daysAfterCreationGreaterThan property: Value indicating the age in days after creation. - * - * @return the daysAfterCreationGreaterThan value. - */ - public float daysAfterCreationGreaterThan() { - return this.daysAfterCreationGreaterThan; - } - - /** - * Set the daysAfterCreationGreaterThan property: Value indicating the age in days after creation. - * - * @param daysAfterCreationGreaterThan the daysAfterCreationGreaterThan value to set. - * @return the DateAfterCreation object itself. - */ - public DateAfterCreation withDaysAfterCreationGreaterThan(float daysAfterCreationGreaterThan) { - this.daysAfterCreationGreaterThan = daysAfterCreationGreaterThan; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/DateAfterModification.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/DateAfterModification.java deleted file mode 100644 index 391d86ba759c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/DateAfterModification.java +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Object to define the number of days after object last modification Or last access. Properties - * daysAfterModificationGreaterThan and daysAfterLastAccessTimeGreaterThan are mutually exclusive. - */ -@Fluent -public final class DateAfterModification { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DateAfterModification.class); - - /* - * Value indicating the age in days after last modification - */ - @JsonProperty(value = "daysAfterModificationGreaterThan") - private Float daysAfterModificationGreaterThan; - - /* - * Value indicating the age in days after last blob access. This property - * can only be used in conjunction with last access time tracking policy - */ - @JsonProperty(value = "daysAfterLastAccessTimeGreaterThan") - private Float daysAfterLastAccessTimeGreaterThan; - - /** - * Get the daysAfterModificationGreaterThan property: Value indicating the age in days after last modification. - * - * @return the daysAfterModificationGreaterThan value. - */ - public Float daysAfterModificationGreaterThan() { - return this.daysAfterModificationGreaterThan; - } - - /** - * Set the daysAfterModificationGreaterThan property: Value indicating the age in days after last modification. - * - * @param daysAfterModificationGreaterThan the daysAfterModificationGreaterThan value to set. - * @return the DateAfterModification object itself. - */ - public DateAfterModification withDaysAfterModificationGreaterThan(Float daysAfterModificationGreaterThan) { - this.daysAfterModificationGreaterThan = daysAfterModificationGreaterThan; - return this; - } - - /** - * Get the daysAfterLastAccessTimeGreaterThan property: Value indicating the age in days after last blob access. - * This property can only be used in conjunction with last access time tracking policy. - * - * @return the daysAfterLastAccessTimeGreaterThan value. - */ - public Float daysAfterLastAccessTimeGreaterThan() { - return this.daysAfterLastAccessTimeGreaterThan; - } - - /** - * Set the daysAfterLastAccessTimeGreaterThan property: Value indicating the age in days after last blob access. - * This property can only be used in conjunction with last access time tracking policy. - * - * @param daysAfterLastAccessTimeGreaterThan the daysAfterLastAccessTimeGreaterThan value to set. - * @return the DateAfterModification object itself. - */ - public DateAfterModification withDaysAfterLastAccessTimeGreaterThan(Float daysAfterLastAccessTimeGreaterThan) { - this.daysAfterLastAccessTimeGreaterThan = daysAfterLastAccessTimeGreaterThan; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/DefaultAction.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/DefaultAction.java deleted file mode 100644 index 5879f1e43357..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/DefaultAction.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for DefaultAction. */ -public enum DefaultAction { - /** Enum value Allow. */ - ALLOW("Allow"), - - /** Enum value Deny. */ - DENY("Deny"); - - /** The actual serialized value for a DefaultAction instance. */ - private final String value; - - DefaultAction(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a DefaultAction instance. - * - * @param value the serialized value to parse. - * @return the parsed DefaultAction object, or null if unable to parse. - */ - @JsonCreator - public static DefaultAction fromString(String value) { - DefaultAction[] items = DefaultAction.values(); - for (DefaultAction item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/DeleteRetentionPolicy.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/DeleteRetentionPolicy.java deleted file mode 100644 index f898fcd11f5c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/DeleteRetentionPolicy.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The service properties for soft delete. */ -@Fluent -public final class DeleteRetentionPolicy { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DeleteRetentionPolicy.class); - - /* - * Indicates whether DeleteRetentionPolicy is enabled. - */ - @JsonProperty(value = "enabled") - private Boolean enabled; - - /* - * Indicates the number of days that the deleted item should be retained. - * The minimum specified value can be 1 and the maximum value can be 365. - */ - @JsonProperty(value = "days") - private Integer days; - - /** - * Get the enabled property: Indicates whether DeleteRetentionPolicy is enabled. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Indicates whether DeleteRetentionPolicy is enabled. - * - * @param enabled the enabled value to set. - * @return the DeleteRetentionPolicy object itself. - */ - public DeleteRetentionPolicy withEnabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the days property: Indicates the number of days that the deleted item should be retained. The minimum - * specified value can be 1 and the maximum value can be 365. - * - * @return the days value. - */ - public Integer days() { - return this.days; - } - - /** - * Set the days property: Indicates the number of days that the deleted item should be retained. The minimum - * specified value can be 1 and the maximum value can be 365. - * - * @param days the days value to set. - * @return the DeleteRetentionPolicy object itself. - */ - public DeleteRetentionPolicy withDays(Integer days) { - this.days = days; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/DeletedShare.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/DeletedShare.java deleted file mode 100644 index 2bef468cc89c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/DeletedShare.java +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The deleted share to be restored. */ -@Fluent -public final class DeletedShare { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DeletedShare.class); - - /* - * Required. Identify the name of the deleted share that will be restored. - */ - @JsonProperty(value = "deletedShareName", required = true) - private String deletedShareName; - - /* - * Required. Identify the version of the deleted share that will be - * restored. - */ - @JsonProperty(value = "deletedShareVersion", required = true) - private String deletedShareVersion; - - /** - * Get the deletedShareName property: Required. Identify the name of the deleted share that will be restored. - * - * @return the deletedShareName value. - */ - public String deletedShareName() { - return this.deletedShareName; - } - - /** - * Set the deletedShareName property: Required. Identify the name of the deleted share that will be restored. - * - * @param deletedShareName the deletedShareName value to set. - * @return the DeletedShare object itself. - */ - public DeletedShare withDeletedShareName(String deletedShareName) { - this.deletedShareName = deletedShareName; - return this; - } - - /** - * Get the deletedShareVersion property: Required. Identify the version of the deleted share that will be restored. - * - * @return the deletedShareVersion value. - */ - public String deletedShareVersion() { - return this.deletedShareVersion; - } - - /** - * Set the deletedShareVersion property: Required. Identify the version of the deleted share that will be restored. - * - * @param deletedShareVersion the deletedShareVersion value to set. - * @return the DeletedShare object itself. - */ - public DeletedShare withDeletedShareVersion(String deletedShareVersion) { - this.deletedShareVersion = deletedShareVersion; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (deletedShareName() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property deletedShareName in model DeletedShare")); - } - if (deletedShareVersion() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property deletedShareVersion in model DeletedShare")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Dimension.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Dimension.java deleted file mode 100644 index cff8ebbf6b4f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Dimension.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Dimension of blobs, possibly be blob type or access tier. */ -@Fluent -public final class Dimension { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Dimension.class); - - /* - * Display name of dimension. - */ - @JsonProperty(value = "name") - private String name; - - /* - * Display name of dimension. - */ - @JsonProperty(value = "displayName") - private String displayName; - - /** - * Get the name property: Display name of dimension. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Display name of dimension. - * - * @param name the name value to set. - * @return the Dimension object itself. - */ - public Dimension withName(String name) { - this.name = name; - return this; - } - - /** - * Get the displayName property: Display name of dimension. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Set the displayName property: Display name of dimension. - * - * @param displayName the displayName value to set. - * @return the Dimension object itself. - */ - public Dimension withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/DirectoryServiceOptions.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/DirectoryServiceOptions.java deleted file mode 100644 index fdda751413f1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/DirectoryServiceOptions.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for DirectoryServiceOptions. */ -public final class DirectoryServiceOptions extends ExpandableStringEnum { - /** Static value None for DirectoryServiceOptions. */ - public static final DirectoryServiceOptions NONE = fromString("None"); - - /** Static value AADDS for DirectoryServiceOptions. */ - public static final DirectoryServiceOptions AADDS = fromString("AADDS"); - - /** Static value AD for DirectoryServiceOptions. */ - public static final DirectoryServiceOptions AD = fromString("AD"); - - /** - * Creates or finds a DirectoryServiceOptions from its string representation. - * - * @param name a name to look for. - * @return the corresponding DirectoryServiceOptions. - */ - @JsonCreator - public static DirectoryServiceOptions fromString(String name) { - return fromString(name, DirectoryServiceOptions.class); - } - - /** @return known DirectoryServiceOptions values. */ - public static Collection values() { - return values(DirectoryServiceOptions.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/EnabledProtocols.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/EnabledProtocols.java deleted file mode 100644 index fb788eebcddd..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/EnabledProtocols.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for EnabledProtocols. */ -public final class EnabledProtocols extends ExpandableStringEnum { - /** Static value SMB for EnabledProtocols. */ - public static final EnabledProtocols SMB = fromString("SMB"); - - /** Static value NFS for EnabledProtocols. */ - public static final EnabledProtocols NFS = fromString("NFS"); - - /** - * Creates or finds a EnabledProtocols from its string representation. - * - * @param name a name to look for. - * @return the corresponding EnabledProtocols. - */ - @JsonCreator - public static EnabledProtocols fromString(String name) { - return fromString(name, EnabledProtocols.class); - } - - /** @return known EnabledProtocols values. */ - public static Collection values() { - return values(EnabledProtocols.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Encryption.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Encryption.java deleted file mode 100644 index d502556ecda2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Encryption.java +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The encryption settings on the storage account. */ -@Fluent -public final class Encryption { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Encryption.class); - - /* - * List of services which support encryption. - */ - @JsonProperty(value = "services") - private EncryptionServices services; - - /* - * The encryption keySource (provider). Possible values (case-insensitive): - * Microsoft.Storage, Microsoft.Keyvault - */ - @JsonProperty(value = "keySource", required = true) - private KeySource keySource; - - /* - * A boolean indicating whether or not the service applies a secondary - * layer of encryption with platform managed keys for data at rest. - */ - @JsonProperty(value = "requireInfrastructureEncryption") - private Boolean requireInfrastructureEncryption; - - /* - * Properties provided by key vault. - */ - @JsonProperty(value = "keyvaultproperties") - private KeyVaultProperties keyVaultProperties; - - /** - * Get the services property: List of services which support encryption. - * - * @return the services value. - */ - public EncryptionServices services() { - return this.services; - } - - /** - * Set the services property: List of services which support encryption. - * - * @param services the services value to set. - * @return the Encryption object itself. - */ - public Encryption withServices(EncryptionServices services) { - this.services = services; - return this; - } - - /** - * Get the keySource property: The encryption keySource (provider). Possible values (case-insensitive): - * Microsoft.Storage, Microsoft.Keyvault. - * - * @return the keySource value. - */ - public KeySource keySource() { - return this.keySource; - } - - /** - * Set the keySource property: The encryption keySource (provider). Possible values (case-insensitive): - * Microsoft.Storage, Microsoft.Keyvault. - * - * @param keySource the keySource value to set. - * @return the Encryption object itself. - */ - public Encryption withKeySource(KeySource keySource) { - this.keySource = keySource; - return this; - } - - /** - * Get the requireInfrastructureEncryption property: A boolean indicating whether or not the service applies a - * secondary layer of encryption with platform managed keys for data at rest. - * - * @return the requireInfrastructureEncryption value. - */ - public Boolean requireInfrastructureEncryption() { - return this.requireInfrastructureEncryption; - } - - /** - * Set the requireInfrastructureEncryption property: A boolean indicating whether or not the service applies a - * secondary layer of encryption with platform managed keys for data at rest. - * - * @param requireInfrastructureEncryption the requireInfrastructureEncryption value to set. - * @return the Encryption object itself. - */ - public Encryption withRequireInfrastructureEncryption(Boolean requireInfrastructureEncryption) { - this.requireInfrastructureEncryption = requireInfrastructureEncryption; - return this; - } - - /** - * Get the keyVaultProperties property: Properties provided by key vault. - * - * @return the keyVaultProperties value. - */ - public KeyVaultProperties keyVaultProperties() { - return this.keyVaultProperties; - } - - /** - * Set the keyVaultProperties property: Properties provided by key vault. - * - * @param keyVaultProperties the keyVaultProperties value to set. - * @return the Encryption object itself. - */ - public Encryption withKeyVaultProperties(KeyVaultProperties keyVaultProperties) { - this.keyVaultProperties = keyVaultProperties; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (services() != null) { - services().validate(); - } - if (keySource() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property keySource in model Encryption")); - } - if (keyVaultProperties() != null) { - keyVaultProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/EncryptionScopeKeyVaultProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/EncryptionScopeKeyVaultProperties.java deleted file mode 100644 index e11c45c56f2e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/EncryptionScopeKeyVaultProperties.java +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * The key vault properties for the encryption scope. This is a required field if encryption scope 'source' attribute is - * set to 'Microsoft.KeyVault'. - */ -@Fluent -public final class EncryptionScopeKeyVaultProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(EncryptionScopeKeyVaultProperties.class); - - /* - * The object identifier for a key vault key object. When applied, the - * encryption scope will use the key referenced by the identifier to enable - * customer-managed key support on this encryption scope. - */ - @JsonProperty(value = "keyUri") - private String keyUri; - - /** - * Get the keyUri property: The object identifier for a key vault key object. When applied, the encryption scope - * will use the key referenced by the identifier to enable customer-managed key support on this encryption scope. - * - * @return the keyUri value. - */ - public String keyUri() { - return this.keyUri; - } - - /** - * Set the keyUri property: The object identifier for a key vault key object. When applied, the encryption scope - * will use the key referenced by the identifier to enable customer-managed key support on this encryption scope. - * - * @param keyUri the keyUri value to set. - * @return the EncryptionScopeKeyVaultProperties object itself. - */ - public EncryptionScopeKeyVaultProperties withKeyUri(String keyUri) { - this.keyUri = keyUri; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/EncryptionScopeListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/EncryptionScopeListResult.java deleted file mode 100644 index b1cba9aa46c8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/EncryptionScopeListResult.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.storage.fluent.models.EncryptionScopeInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** List of encryption scopes requested, and if paging is required, a URL to the next page of encryption scopes. */ -@Immutable -public final class EncryptionScopeListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(EncryptionScopeListResult.class); - - /* - * List of encryption scopes requested. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /* - * Request URL that can be used to query next page of encryption scopes. - * Returned when total number of requested encryption scopes exceeds the - * maximum page size. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: List of encryption scopes requested. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: Request URL that can be used to query next page of encryption scopes. Returned when - * total number of requested encryption scopes exceeds the maximum page size. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/EncryptionScopeSource.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/EncryptionScopeSource.java deleted file mode 100644 index 052bd3e308d0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/EncryptionScopeSource.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for EncryptionScopeSource. */ -public final class EncryptionScopeSource extends ExpandableStringEnum { - /** Static value Microsoft.Storage for EncryptionScopeSource. */ - public static final EncryptionScopeSource MICROSOFT_STORAGE = fromString("Microsoft.Storage"); - - /** Static value Microsoft.KeyVault for EncryptionScopeSource. */ - public static final EncryptionScopeSource MICROSOFT_KEY_VAULT = fromString("Microsoft.KeyVault"); - - /** - * Creates or finds a EncryptionScopeSource from its string representation. - * - * @param name a name to look for. - * @return the corresponding EncryptionScopeSource. - */ - @JsonCreator - public static EncryptionScopeSource fromString(String name) { - return fromString(name, EncryptionScopeSource.class); - } - - /** @return known EncryptionScopeSource values. */ - public static Collection values() { - return values(EncryptionScopeSource.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/EncryptionScopeState.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/EncryptionScopeState.java deleted file mode 100644 index a6a4cada93e4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/EncryptionScopeState.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for EncryptionScopeState. */ -public final class EncryptionScopeState extends ExpandableStringEnum { - /** Static value Enabled for EncryptionScopeState. */ - public static final EncryptionScopeState ENABLED = fromString("Enabled"); - - /** Static value Disabled for EncryptionScopeState. */ - public static final EncryptionScopeState DISABLED = fromString("Disabled"); - - /** - * Creates or finds a EncryptionScopeState from its string representation. - * - * @param name a name to look for. - * @return the corresponding EncryptionScopeState. - */ - @JsonCreator - public static EncryptionScopeState fromString(String name) { - return fromString(name, EncryptionScopeState.class); - } - - /** @return known EncryptionScopeState values. */ - public static Collection values() { - return values(EncryptionScopeState.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/EncryptionService.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/EncryptionService.java deleted file mode 100644 index 7a877e03c04f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/EncryptionService.java +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** A service that allows server-side encryption to be used. */ -@Fluent -public final class EncryptionService { - @JsonIgnore private final ClientLogger logger = new ClientLogger(EncryptionService.class); - - /* - * A boolean indicating whether or not the service encrypts the data as it - * is stored. - */ - @JsonProperty(value = "enabled") - private Boolean enabled; - - /* - * Gets a rough estimate of the date/time when the encryption was last - * enabled by the user. Only returned when encryption is enabled. There - * might be some unencrypted blobs which were written after this time, as - * it is just a rough estimate. - */ - @JsonProperty(value = "lastEnabledTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime lastEnabledTime; - - /* - * Encryption key type to be used for the encryption service. 'Account' key - * type implies that an account-scoped encryption key will be used. - * 'Service' key type implies that a default service key is used. - */ - @JsonProperty(value = "keyType") - private KeyType keyType; - - /** - * Get the enabled property: A boolean indicating whether or not the service encrypts the data as it is stored. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: A boolean indicating whether or not the service encrypts the data as it is stored. - * - * @param enabled the enabled value to set. - * @return the EncryptionService object itself. - */ - public EncryptionService withEnabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the lastEnabledTime property: Gets a rough estimate of the date/time when the encryption was last enabled by - * the user. Only returned when encryption is enabled. There might be some unencrypted blobs which were written - * after this time, as it is just a rough estimate. - * - * @return the lastEnabledTime value. - */ - public OffsetDateTime lastEnabledTime() { - return this.lastEnabledTime; - } - - /** - * Get the keyType property: Encryption key type to be used for the encryption service. 'Account' key type implies - * that an account-scoped encryption key will be used. 'Service' key type implies that a default service key is - * used. - * - * @return the keyType value. - */ - public KeyType keyType() { - return this.keyType; - } - - /** - * Set the keyType property: Encryption key type to be used for the encryption service. 'Account' key type implies - * that an account-scoped encryption key will be used. 'Service' key type implies that a default service key is - * used. - * - * @param keyType the keyType value to set. - * @return the EncryptionService object itself. - */ - public EncryptionService withKeyType(KeyType keyType) { - this.keyType = keyType; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/EncryptionServices.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/EncryptionServices.java deleted file mode 100644 index 15ec6858321d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/EncryptionServices.java +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** A list of services that support encryption. */ -@Fluent -public final class EncryptionServices { - @JsonIgnore private final ClientLogger logger = new ClientLogger(EncryptionServices.class); - - /* - * The encryption function of the blob storage service. - */ - @JsonProperty(value = "blob") - private EncryptionService blob; - - /* - * The encryption function of the file storage service. - */ - @JsonProperty(value = "file") - private EncryptionService file; - - /* - * The encryption function of the table storage service. - */ - @JsonProperty(value = "table") - private EncryptionService table; - - /* - * The encryption function of the queue storage service. - */ - @JsonProperty(value = "queue") - private EncryptionService queue; - - /** - * Get the blob property: The encryption function of the blob storage service. - * - * @return the blob value. - */ - public EncryptionService blob() { - return this.blob; - } - - /** - * Set the blob property: The encryption function of the blob storage service. - * - * @param blob the blob value to set. - * @return the EncryptionServices object itself. - */ - public EncryptionServices withBlob(EncryptionService blob) { - this.blob = blob; - return this; - } - - /** - * Get the file property: The encryption function of the file storage service. - * - * @return the file value. - */ - public EncryptionService file() { - return this.file; - } - - /** - * Set the file property: The encryption function of the file storage service. - * - * @param file the file value to set. - * @return the EncryptionServices object itself. - */ - public EncryptionServices withFile(EncryptionService file) { - this.file = file; - return this; - } - - /** - * Get the table property: The encryption function of the table storage service. - * - * @return the table value. - */ - public EncryptionService table() { - return this.table; - } - - /** - * Set the table property: The encryption function of the table storage service. - * - * @param table the table value to set. - * @return the EncryptionServices object itself. - */ - public EncryptionServices withTable(EncryptionService table) { - this.table = table; - return this; - } - - /** - * Get the queue property: The encryption function of the queue storage service. - * - * @return the queue value. - */ - public EncryptionService queue() { - return this.queue; - } - - /** - * Set the queue property: The encryption function of the queue storage service. - * - * @param queue the queue value to set. - * @return the EncryptionServices object itself. - */ - public EncryptionServices withQueue(EncryptionService queue) { - this.queue = queue; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (blob() != null) { - blob().validate(); - } - if (file() != null) { - file().validate(); - } - if (table() != null) { - table().validate(); - } - if (queue() != null) { - queue().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Endpoints.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Endpoints.java deleted file mode 100644 index 6ca72fec8056..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Endpoints.java +++ /dev/null @@ -1,172 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The URIs that are used to perform a retrieval of a public blob, queue, table, web or dfs object. */ -@Fluent -public final class Endpoints { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Endpoints.class); - - /* - * Gets the blob endpoint. - */ - @JsonProperty(value = "blob", access = JsonProperty.Access.WRITE_ONLY) - private String blob; - - /* - * Gets the queue endpoint. - */ - @JsonProperty(value = "queue", access = JsonProperty.Access.WRITE_ONLY) - private String queue; - - /* - * Gets the table endpoint. - */ - @JsonProperty(value = "table", access = JsonProperty.Access.WRITE_ONLY) - private String table; - - /* - * Gets the file endpoint. - */ - @JsonProperty(value = "file", access = JsonProperty.Access.WRITE_ONLY) - private String file; - - /* - * Gets the web endpoint. - */ - @JsonProperty(value = "web", access = JsonProperty.Access.WRITE_ONLY) - private String web; - - /* - * Gets the dfs endpoint. - */ - @JsonProperty(value = "dfs", access = JsonProperty.Access.WRITE_ONLY) - private String dfs; - - /* - * Gets the microsoft routing storage endpoints. - */ - @JsonProperty(value = "microsoftEndpoints") - private StorageAccountMicrosoftEndpoints microsoftEndpoints; - - /* - * Gets the internet routing storage endpoints - */ - @JsonProperty(value = "internetEndpoints") - private StorageAccountInternetEndpoints internetEndpoints; - - /** - * Get the blob property: Gets the blob endpoint. - * - * @return the blob value. - */ - public String blob() { - return this.blob; - } - - /** - * Get the queue property: Gets the queue endpoint. - * - * @return the queue value. - */ - public String queue() { - return this.queue; - } - - /** - * Get the table property: Gets the table endpoint. - * - * @return the table value. - */ - public String table() { - return this.table; - } - - /** - * Get the file property: Gets the file endpoint. - * - * @return the file value. - */ - public String file() { - return this.file; - } - - /** - * Get the web property: Gets the web endpoint. - * - * @return the web value. - */ - public String web() { - return this.web; - } - - /** - * Get the dfs property: Gets the dfs endpoint. - * - * @return the dfs value. - */ - public String dfs() { - return this.dfs; - } - - /** - * Get the microsoftEndpoints property: Gets the microsoft routing storage endpoints. - * - * @return the microsoftEndpoints value. - */ - public StorageAccountMicrosoftEndpoints microsoftEndpoints() { - return this.microsoftEndpoints; - } - - /** - * Set the microsoftEndpoints property: Gets the microsoft routing storage endpoints. - * - * @param microsoftEndpoints the microsoftEndpoints value to set. - * @return the Endpoints object itself. - */ - public Endpoints withMicrosoftEndpoints(StorageAccountMicrosoftEndpoints microsoftEndpoints) { - this.microsoftEndpoints = microsoftEndpoints; - return this; - } - - /** - * Get the internetEndpoints property: Gets the internet routing storage endpoints. - * - * @return the internetEndpoints value. - */ - public StorageAccountInternetEndpoints internetEndpoints() { - return this.internetEndpoints; - } - - /** - * Set the internetEndpoints property: Gets the internet routing storage endpoints. - * - * @param internetEndpoints the internetEndpoints value to set. - * @return the Endpoints object itself. - */ - public Endpoints withInternetEndpoints(StorageAccountInternetEndpoints internetEndpoints) { - this.internetEndpoints = internetEndpoints; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (microsoftEndpoints() != null) { - microsoftEndpoints().validate(); - } - if (internetEndpoints() != null) { - internetEndpoints().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/FileShareItems.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/FileShareItems.java deleted file mode 100644 index 17fda2cd7495..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/FileShareItems.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.storage.fluent.models.FileShareItemInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** - * Response schema. Contains list of shares returned, and if paging is requested or required, a URL to next page of - * shares. - */ -@Immutable -public final class FileShareItems { - @JsonIgnore private final ClientLogger logger = new ClientLogger(FileShareItems.class); - - /* - * List of file shares returned. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /* - * Request URL that can be used to query next page of shares. Returned when - * total number of requested shares exceed maximum page size. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: List of file shares returned. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: Request URL that can be used to query next page of shares. Returned when total number - * of requested shares exceed maximum page size. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/GeoReplicationStats.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/GeoReplicationStats.java deleted file mode 100644 index 37da291f147a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/GeoReplicationStats.java +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** - * Statistics related to replication for storage account's Blob, Table, Queue and File services. It is only available - * when geo-redundant replication is enabled for the storage account. - */ -@Immutable -public final class GeoReplicationStats { - @JsonIgnore private final ClientLogger logger = new ClientLogger(GeoReplicationStats.class); - - /* - * The status of the secondary location. Possible values are: - Live: - * Indicates that the secondary location is active and operational. - - * Bootstrap: Indicates initial synchronization from the primary location - * to the secondary location is in progress.This typically occurs when - * replication is first enabled. - Unavailable: Indicates that the - * secondary location is temporarily unavailable. - */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) - private GeoReplicationStatus status; - - /* - * All primary writes preceding this UTC date/time value are guaranteed to - * be available for read operations. Primary writes following this point in - * time may or may not be available for reads. Element may be default value - * if value of LastSyncTime is not available, this can happen if secondary - * is offline or we are in bootstrap. - */ - @JsonProperty(value = "lastSyncTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime lastSyncTime; - - /* - * A boolean flag which indicates whether or not account failover is - * supported for the account. - */ - @JsonProperty(value = "canFailover", access = JsonProperty.Access.WRITE_ONLY) - private Boolean canFailover; - - /** - * Get the status property: The status of the secondary location. Possible values are: - Live: Indicates that the - * secondary location is active and operational. - Bootstrap: Indicates initial synchronization from the primary - * location to the secondary location is in progress.This typically occurs when replication is first enabled. - - * Unavailable: Indicates that the secondary location is temporarily unavailable. - * - * @return the status value. - */ - public GeoReplicationStatus status() { - return this.status; - } - - /** - * Get the lastSyncTime property: All primary writes preceding this UTC date/time value are guaranteed to be - * available for read operations. Primary writes following this point in time may or may not be available for reads. - * Element may be default value if value of LastSyncTime is not available, this can happen if secondary is offline - * or we are in bootstrap. - * - * @return the lastSyncTime value. - */ - public OffsetDateTime lastSyncTime() { - return this.lastSyncTime; - } - - /** - * Get the canFailover property: A boolean flag which indicates whether or not account failover is supported for the - * account. - * - * @return the canFailover value. - */ - public Boolean canFailover() { - return this.canFailover; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/GeoReplicationStatus.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/GeoReplicationStatus.java deleted file mode 100644 index 582773a2ae4f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/GeoReplicationStatus.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for GeoReplicationStatus. */ -public final class GeoReplicationStatus extends ExpandableStringEnum { - /** Static value Live for GeoReplicationStatus. */ - public static final GeoReplicationStatus LIVE = fromString("Live"); - - /** Static value Bootstrap for GeoReplicationStatus. */ - public static final GeoReplicationStatus BOOTSTRAP = fromString("Bootstrap"); - - /** Static value Unavailable for GeoReplicationStatus. */ - public static final GeoReplicationStatus UNAVAILABLE = fromString("Unavailable"); - - /** - * Creates or finds a GeoReplicationStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding GeoReplicationStatus. - */ - @JsonCreator - public static GeoReplicationStatus fromString(String name) { - return fromString(name, GeoReplicationStatus.class); - } - - /** @return known GeoReplicationStatus values. */ - public static Collection values() { - return values(GeoReplicationStatus.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/GetShareExpand.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/GetShareExpand.java deleted file mode 100644 index 0a16bf939b06..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/GetShareExpand.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for GetShareExpand. */ -public enum GetShareExpand { - /** Enum value stats. */ - STATS("stats"); - - /** The actual serialized value for a GetShareExpand instance. */ - private final String value; - - GetShareExpand(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a GetShareExpand instance. - * - * @param value the serialized value to parse. - * @return the parsed GetShareExpand object, or null if unable to parse. - */ - @JsonCreator - public static GetShareExpand fromString(String value) { - GetShareExpand[] items = GetShareExpand.values(); - for (GetShareExpand item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/HttpProtocol.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/HttpProtocol.java deleted file mode 100644 index eed5a2c3dd9f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/HttpProtocol.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for HttpProtocol. */ -public enum HttpProtocol { - /** Enum value https,http. */ - HTTPS_HTTP("https,http"), - - /** Enum value https. */ - HTTPS("https"); - - /** The actual serialized value for a HttpProtocol instance. */ - private final String value; - - HttpProtocol(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a HttpProtocol instance. - * - * @param value the serialized value to parse. - * @return the parsed HttpProtocol object, or null if unable to parse. - */ - @JsonCreator - public static HttpProtocol fromString(String value) { - HttpProtocol[] items = HttpProtocol.values(); - for (HttpProtocol item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Identity.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Identity.java deleted file mode 100644 index b5965ff20747..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Identity.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Identity for the resource. */ -@Fluent -public class Identity { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Identity.class); - - /* - * The principal ID of resource identity. - */ - @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) - private String principalId; - - /* - * The tenant ID of resource. - */ - @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) - private String tenantId; - - /* - * The identity type. - */ - @JsonProperty(value = "type", required = true) - private IdentityType type; - - /** - * Get the principalId property: The principal ID of resource identity. - * - * @return the principalId value. - */ - public String principalId() { - return this.principalId; - } - - /** - * Get the tenantId property: The tenant ID of resource. - * - * @return the tenantId value. - */ - public String tenantId() { - return this.tenantId; - } - - /** - * Get the type property: The identity type. - * - * @return the type value. - */ - public IdentityType type() { - return this.type; - } - - /** - * Set the type property: The identity type. - * - * @param type the type value to set. - * @return the Identity object itself. - */ - public Identity withType(IdentityType type) { - this.type = type; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (type() == null) { - throw logger - .logExceptionAsError(new IllegalArgumentException("Missing required property type in model Identity")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/IdentityType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/IdentityType.java deleted file mode 100644 index 5eb9bfc84f43..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/IdentityType.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for IdentityType. */ -public final class IdentityType extends ExpandableStringEnum { - /** Static value SystemAssigned for IdentityType. */ - public static final IdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); - - /** - * Creates or finds a IdentityType from its string representation. - * - * @param name a name to look for. - * @return the corresponding IdentityType. - */ - @JsonCreator - public static IdentityType fromString(String name) { - return fromString(name, IdentityType.class); - } - - /** @return known IdentityType values. */ - public static Collection values() { - return values(IdentityType.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ImmutabilityPolicy.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ImmutabilityPolicy.java deleted file mode 100644 index 373dedcea4f0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ImmutabilityPolicy.java +++ /dev/null @@ -1,175 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.model.Appliable; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.model.Indexable; -import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; -import com.azure.resourcemanager.resources.fluentcore.model.Updatable; -import com.azure.resourcemanager.storage.StorageManager; -import com.azure.resourcemanager.storage.fluent.models.ImmutabilityPolicyInner; -import reactor.core.publisher.Mono; - -/** Type representing ImmutabilityPolicy. */ -@Fluent -public interface ImmutabilityPolicy - extends HasInnerModel, - Indexable, - Refreshable, - Updatable, - HasManager { - /** @return the etag value. */ - String etag(); - - /** @return the id value. */ - String id(); - - /** @return the immutabilityPeriodSinceCreationInDays value. */ - int immutabilityPeriodSinceCreationInDays(); - - /** @return the name value. */ - String name(); - - /** @return the state value. */ - ImmutabilityPolicyState state(); - - /** @return the type value. */ - String type(); - - /** - * Locks the immutability policy. - */ - void lock(); - - /** - * Locks the immutability policy. - * - * @return the completion - */ - Mono lockAsync(); - - /** - * Extends the immutability policy. - - * @param immutabilityPeriodSinceCreationInDays The immutability period for the blobs in the container since the - * policy creation, in days. - */ - void extend(int immutabilityPeriodSinceCreationInDays); - - /** - * Extends the immutability policy. - - * @param immutabilityPeriodSinceCreationInDays The immutability period for the blobs in the container since the - * policy creation, in days. - * @return the completion - */ - Mono extendAsync(int immutabilityPeriodSinceCreationInDays); - - /** The entirety of the ImmutabilityPolicy definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithContainer, - DefinitionStages.WithImmutabilityPeriodSinceCreationInDays, - DefinitionStages.WithCreate { - } - - /** Grouping of ImmutabilityPolicy definition stages. */ - interface DefinitionStages { - /** The first stage of a ImmutabilityPolicy definition. */ - interface Blank extends WithContainer { - } - - /** The stage of the immutabilitypolicy definition allowing to specify Container. */ - interface WithContainer { - /** - * Specifies resourceGroupName, accountName, containerName. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive - * @param accountName The name of the storage account within the specified resource group. Storage account - * names must be between 3 and 24 characters in length and use numbers and lower-case letters only - * @param containerName The name of the blob container within the specified storage account. Blob container - * names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) - * only. Every dash (-) character must be immediately preceded and followed by a letter or number - * @return the next definition stage - */ - WithImmutabilityPeriodSinceCreationInDays withExistingContainer( - String resourceGroupName, String accountName, String containerName); - } - - /** The stage of the immutabilitypolicy definition allowing to specify ImmutabilityPeriodSinceCreationInDays. */ - interface WithImmutabilityPeriodSinceCreationInDays { - /** - * Specifies immutabilityPeriodSinceCreationInDays. - * - * @param immutabilityPeriodSinceCreationInDays The immutability period for the blobs in the container since - * the policy creation, in days - * @return the next definition stage - */ - WithCreate withImmutabilityPeriodSinceCreationInDays(int immutabilityPeriodSinceCreationInDays); - } - - /** The stage of the immutabilitypolicy definition allowing to specify If-Match header. */ - interface WithETagCheck { - /** - * Specifies If-Match header. - * - * @return the next definition stage - */ - WithCreate withETagCheck(); - } - - /** - * The stage of the definition which contains all the minimum required inputs for the resource to be created - * (via {@link WithCreate#create()}), but also allows for any other optional settings to be specified. - */ - interface WithCreate extends WithETagCheck, Creatable { - } - } - /** The template for a ImmutabilityPolicy update operation, containing all the settings that can be modified. */ - interface Update - extends Appliable, - UpdateStages.WithETagCheck, - UpdateStages.WithImmutabilityPeriodSinceCreationInDays { - } - - /** Grouping of ImmutabilityPolicy update stages. */ - interface UpdateStages { - /** The stage of the immutabilitypolicy update allowing to specify If-Match header. */ - interface WithETagCheck { - /** - * Specifies If-Match header. - * - * @return the next update stage - */ - Update withETagCheck(); - - /** - * Specifies If-Match header. - * - * @param eTagValue The entity state (ETag) version of the immutability policy to update. A value of "*" can - * be used to apply the operation only if the immutability policy already exists. If omitted, this - * operation will always be applied - * @return the next update stage - */ - Update withETagCheck(String eTagValue); - } - - /** The stage of the immutabilitypolicy update allowing to specify ImmutabilityPeriodSinceCreationInDays. */ - interface WithImmutabilityPeriodSinceCreationInDays { - /** - * Specifies immutabilityPeriodSinceCreationInDays. - * - * @param immutabilityPeriodSinceCreationInDays The immutability period for the blobs in the container since - * the policy creation, in days - * @return the next update stage - */ - Update withImmutabilityPeriodSinceCreationInDays(int immutabilityPeriodSinceCreationInDays); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ImmutabilityPolicyProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ImmutabilityPolicyProperties.java deleted file mode 100644 index 1c507c28bbc6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ImmutabilityPolicyProperties.java +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.storage.fluent.models.ImmutabilityPolicyProperty; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The properties of an ImmutabilityPolicy of a blob container. */ -@Fluent -public final class ImmutabilityPolicyProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ImmutabilityPolicyProperties.class); - - /* - * The properties of an ImmutabilityPolicy of a blob container. - */ - @JsonProperty(value = "properties") - private ImmutabilityPolicyProperty innerProperties; - - /* - * ImmutabilityPolicy Etag. - */ - @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) - private String etag; - - /* - * The ImmutabilityPolicy update history of the blob container. - */ - @JsonProperty(value = "updateHistory", access = JsonProperty.Access.WRITE_ONLY) - private List updateHistory; - - /** - * Get the innerProperties property: The properties of an ImmutabilityPolicy of a blob container. - * - * @return the innerProperties value. - */ - private ImmutabilityPolicyProperty innerProperties() { - return this.innerProperties; - } - - /** - * Get the etag property: ImmutabilityPolicy Etag. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Get the updateHistory property: The ImmutabilityPolicy update history of the blob container. - * - * @return the updateHistory value. - */ - public List updateHistory() { - return this.updateHistory; - } - - /** - * Get the immutabilityPeriodSinceCreationInDays property: The immutability period for the blobs in the container - * since the policy creation, in days. - * - * @return the immutabilityPeriodSinceCreationInDays value. - */ - public Integer immutabilityPeriodSinceCreationInDays() { - return this.innerProperties() == null ? null : this.innerProperties().immutabilityPeriodSinceCreationInDays(); - } - - /** - * Set the immutabilityPeriodSinceCreationInDays property: The immutability period for the blobs in the container - * since the policy creation, in days. - * - * @param immutabilityPeriodSinceCreationInDays the immutabilityPeriodSinceCreationInDays value to set. - * @return the ImmutabilityPolicyProperties object itself. - */ - public ImmutabilityPolicyProperties withImmutabilityPeriodSinceCreationInDays( - Integer immutabilityPeriodSinceCreationInDays) { - if (this.innerProperties() == null) { - this.innerProperties = new ImmutabilityPolicyProperty(); - } - this.innerProperties().withImmutabilityPeriodSinceCreationInDays(immutabilityPeriodSinceCreationInDays); - return this; - } - - /** - * Get the state property: The ImmutabilityPolicy state of a blob container, possible values include: Locked and - * Unlocked. - * - * @return the state value. - */ - public ImmutabilityPolicyState state() { - return this.innerProperties() == null ? null : this.innerProperties().state(); - } - - /** - * Get the allowProtectedAppendWrites property: This property can only be changed for unlocked time-based retention - * policies. When enabled, new blocks can be written to an append blob while maintaining immutability protection and - * compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property - * cannot be changed with ExtendImmutabilityPolicy API. - * - * @return the allowProtectedAppendWrites value. - */ - public Boolean allowProtectedAppendWrites() { - return this.innerProperties() == null ? null : this.innerProperties().allowProtectedAppendWrites(); - } - - /** - * Set the allowProtectedAppendWrites property: This property can only be changed for unlocked time-based retention - * policies. When enabled, new blocks can be written to an append blob while maintaining immutability protection and - * compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property - * cannot be changed with ExtendImmutabilityPolicy API. - * - * @param allowProtectedAppendWrites the allowProtectedAppendWrites value to set. - * @return the ImmutabilityPolicyProperties object itself. - */ - public ImmutabilityPolicyProperties withAllowProtectedAppendWrites(Boolean allowProtectedAppendWrites) { - if (this.innerProperties() == null) { - this.innerProperties = new ImmutabilityPolicyProperty(); - } - this.innerProperties().withAllowProtectedAppendWrites(allowProtectedAppendWrites); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - if (updateHistory() != null) { - updateHistory().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ImmutabilityPolicyState.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ImmutabilityPolicyState.java deleted file mode 100644 index 63c41cc32f2f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ImmutabilityPolicyState.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ImmutabilityPolicyState. */ -public final class ImmutabilityPolicyState extends ExpandableStringEnum { - /** Static value Locked for ImmutabilityPolicyState. */ - public static final ImmutabilityPolicyState LOCKED = fromString("Locked"); - - /** Static value Unlocked for ImmutabilityPolicyState. */ - public static final ImmutabilityPolicyState UNLOCKED = fromString("Unlocked"); - - /** - * Creates or finds a ImmutabilityPolicyState from its string representation. - * - * @param name a name to look for. - * @return the corresponding ImmutabilityPolicyState. - */ - @JsonCreator - public static ImmutabilityPolicyState fromString(String name) { - return fromString(name, ImmutabilityPolicyState.class); - } - - /** @return known ImmutabilityPolicyState values. */ - public static Collection values() { - return values(ImmutabilityPolicyState.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ImmutabilityPolicyUpdateType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ImmutabilityPolicyUpdateType.java deleted file mode 100644 index 4abfd580d961..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ImmutabilityPolicyUpdateType.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ImmutabilityPolicyUpdateType. */ -public final class ImmutabilityPolicyUpdateType extends ExpandableStringEnum { - /** Static value put for ImmutabilityPolicyUpdateType. */ - public static final ImmutabilityPolicyUpdateType PUT = fromString("put"); - - /** Static value lock for ImmutabilityPolicyUpdateType. */ - public static final ImmutabilityPolicyUpdateType LOCK = fromString("lock"); - - /** Static value extend for ImmutabilityPolicyUpdateType. */ - public static final ImmutabilityPolicyUpdateType EXTEND = fromString("extend"); - - /** - * Creates or finds a ImmutabilityPolicyUpdateType from its string representation. - * - * @param name a name to look for. - * @return the corresponding ImmutabilityPolicyUpdateType. - */ - @JsonCreator - public static ImmutabilityPolicyUpdateType fromString(String name) { - return fromString(name, ImmutabilityPolicyUpdateType.class); - } - - /** @return known ImmutabilityPolicyUpdateType values. */ - public static Collection values() { - return values(ImmutabilityPolicyUpdateType.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/InventoryRuleType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/InventoryRuleType.java deleted file mode 100644 index 3ebb0d15fe50..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/InventoryRuleType.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for InventoryRuleType. */ -public final class InventoryRuleType extends ExpandableStringEnum { - /** Static value Inventory for InventoryRuleType. */ - public static final InventoryRuleType INVENTORY = fromString("Inventory"); - - /** - * Creates or finds a InventoryRuleType from its string representation. - * - * @param name a name to look for. - * @return the corresponding InventoryRuleType. - */ - @JsonCreator - public static InventoryRuleType fromString(String name) { - return fromString(name, InventoryRuleType.class); - } - - /** @return known InventoryRuleType values. */ - public static Collection values() { - return values(InventoryRuleType.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/IpRule.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/IpRule.java deleted file mode 100644 index 6c5614fca52d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/IpRule.java +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** IP rule with specific IP or IP range in CIDR format. */ -@Fluent -public final class IpRule { - @JsonIgnore private final ClientLogger logger = new ClientLogger(IpRule.class); - - /* - * Specifies the IP or IP range in CIDR format. Only IPV4 address is - * allowed. - */ - @JsonProperty(value = "value", required = true) - private String ipAddressOrRange; - - /* - * The action of IP ACL rule. - */ - @JsonProperty(value = "action") - private Action action; - - /** - * Get the ipAddressOrRange property: Specifies the IP or IP range in CIDR format. Only IPV4 address is allowed. - * - * @return the ipAddressOrRange value. - */ - public String ipAddressOrRange() { - return this.ipAddressOrRange; - } - - /** - * Set the ipAddressOrRange property: Specifies the IP or IP range in CIDR format. Only IPV4 address is allowed. - * - * @param ipAddressOrRange the ipAddressOrRange value to set. - * @return the IpRule object itself. - */ - public IpRule withIpAddressOrRange(String ipAddressOrRange) { - this.ipAddressOrRange = ipAddressOrRange; - return this; - } - - /** - * Get the action property: The action of IP ACL rule. - * - * @return the action value. - */ - public Action action() { - return this.action; - } - - /** - * Set the action property: The action of IP ACL rule. - * - * @param action the action value to set. - * @return the IpRule object itself. - */ - public IpRule withAction(Action action) { - this.action = action; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (ipAddressOrRange() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property ipAddressOrRange in model IpRule")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/KeyPermission.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/KeyPermission.java deleted file mode 100644 index 98263941d55f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/KeyPermission.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for KeyPermission. */ -public enum KeyPermission { - /** Enum value Read. */ - READ("Read"), - - /** Enum value Full. */ - FULL("Full"); - - /** The actual serialized value for a KeyPermission instance. */ - private final String value; - - KeyPermission(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a KeyPermission instance. - * - * @param value the serialized value to parse. - * @return the parsed KeyPermission object, or null if unable to parse. - */ - @JsonCreator - public static KeyPermission fromString(String value) { - KeyPermission[] items = KeyPermission.values(); - for (KeyPermission item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/KeySource.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/KeySource.java deleted file mode 100644 index d05d6ab60174..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/KeySource.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for KeySource. */ -public final class KeySource extends ExpandableStringEnum { - /** Static value Microsoft.Storage for KeySource. */ - public static final KeySource MICROSOFT_STORAGE = fromString("Microsoft.Storage"); - - /** Static value Microsoft.Keyvault for KeySource. */ - public static final KeySource MICROSOFT_KEYVAULT = fromString("Microsoft.Keyvault"); - - /** - * Creates or finds a KeySource from its string representation. - * - * @param name a name to look for. - * @return the corresponding KeySource. - */ - @JsonCreator - public static KeySource fromString(String name) { - return fromString(name, KeySource.class); - } - - /** @return known KeySource values. */ - public static Collection values() { - return values(KeySource.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/KeyType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/KeyType.java deleted file mode 100644 index d6910cfbb2a9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/KeyType.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for KeyType. */ -public final class KeyType extends ExpandableStringEnum { - /** Static value Service for KeyType. */ - public static final KeyType SERVICE = fromString("Service"); - - /** Static value Account for KeyType. */ - public static final KeyType ACCOUNT = fromString("Account"); - - /** - * Creates or finds a KeyType from its string representation. - * - * @param name a name to look for. - * @return the corresponding KeyType. - */ - @JsonCreator - public static KeyType fromString(String name) { - return fromString(name, KeyType.class); - } - - /** @return known KeyType values. */ - public static Collection values() { - return values(KeyType.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/KeyVaultProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/KeyVaultProperties.java deleted file mode 100644 index cdd1ad22675b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/KeyVaultProperties.java +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** Properties of key vault. */ -@Fluent -public final class KeyVaultProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(KeyVaultProperties.class); - - /* - * The name of KeyVault key. - */ - @JsonProperty(value = "keyname") - private String keyName; - - /* - * The version of KeyVault key. - */ - @JsonProperty(value = "keyversion") - private String keyVersion; - - /* - * The Uri of KeyVault. - */ - @JsonProperty(value = "keyvaulturi") - private String keyVaultUri; - - /* - * The object identifier of the current versioned Key Vault Key in use. - */ - @JsonProperty(value = "currentVersionedKeyIdentifier", access = JsonProperty.Access.WRITE_ONLY) - private String currentVersionedKeyIdentifier; - - /* - * Timestamp of last rotation of the Key Vault Key. - */ - @JsonProperty(value = "lastKeyRotationTimestamp", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime lastKeyRotationTimestamp; - - /** - * Get the keyName property: The name of KeyVault key. - * - * @return the keyName value. - */ - public String keyName() { - return this.keyName; - } - - /** - * Set the keyName property: The name of KeyVault key. - * - * @param keyName the keyName value to set. - * @return the KeyVaultProperties object itself. - */ - public KeyVaultProperties withKeyName(String keyName) { - this.keyName = keyName; - return this; - } - - /** - * Get the keyVersion property: The version of KeyVault key. - * - * @return the keyVersion value. - */ - public String keyVersion() { - return this.keyVersion; - } - - /** - * Set the keyVersion property: The version of KeyVault key. - * - * @param keyVersion the keyVersion value to set. - * @return the KeyVaultProperties object itself. - */ - public KeyVaultProperties withKeyVersion(String keyVersion) { - this.keyVersion = keyVersion; - return this; - } - - /** - * Get the keyVaultUri property: The Uri of KeyVault. - * - * @return the keyVaultUri value. - */ - public String keyVaultUri() { - return this.keyVaultUri; - } - - /** - * Set the keyVaultUri property: The Uri of KeyVault. - * - * @param keyVaultUri the keyVaultUri value to set. - * @return the KeyVaultProperties object itself. - */ - public KeyVaultProperties withKeyVaultUri(String keyVaultUri) { - this.keyVaultUri = keyVaultUri; - return this; - } - - /** - * Get the currentVersionedKeyIdentifier property: The object identifier of the current versioned Key Vault Key in - * use. - * - * @return the currentVersionedKeyIdentifier value. - */ - public String currentVersionedKeyIdentifier() { - return this.currentVersionedKeyIdentifier; - } - - /** - * Get the lastKeyRotationTimestamp property: Timestamp of last rotation of the Key Vault Key. - * - * @return the lastKeyRotationTimestamp value. - */ - public OffsetDateTime lastKeyRotationTimestamp() { - return this.lastKeyRotationTimestamp; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Kind.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Kind.java deleted file mode 100644 index c13f9e22a8cd..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Kind.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for Kind. */ -public final class Kind extends ExpandableStringEnum { - /** Static value Storage for Kind. */ - public static final Kind STORAGE = fromString("Storage"); - - /** Static value StorageV2 for Kind. */ - public static final Kind STORAGE_V2 = fromString("StorageV2"); - - /** Static value BlobStorage for Kind. */ - public static final Kind BLOB_STORAGE = fromString("BlobStorage"); - - /** Static value FileStorage for Kind. */ - public static final Kind FILE_STORAGE = fromString("FileStorage"); - - /** Static value BlockBlobStorage for Kind. */ - public static final Kind BLOCK_BLOB_STORAGE = fromString("BlockBlobStorage"); - - /** - * Creates or finds a Kind from its string representation. - * - * @param name a name to look for. - * @return the corresponding Kind. - */ - @JsonCreator - public static Kind fromString(String name) { - return fromString(name, Kind.class); - } - - /** @return known Kind values. */ - public static Collection values() { - return values(Kind.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/LargeFileSharesState.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/LargeFileSharesState.java deleted file mode 100644 index caf546491dd2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/LargeFileSharesState.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for LargeFileSharesState. */ -public final class LargeFileSharesState extends ExpandableStringEnum { - /** Static value Disabled for LargeFileSharesState. */ - public static final LargeFileSharesState DISABLED = fromString("Disabled"); - - /** Static value Enabled for LargeFileSharesState. */ - public static final LargeFileSharesState ENABLED = fromString("Enabled"); - - /** - * Creates or finds a LargeFileSharesState from its string representation. - * - * @param name a name to look for. - * @return the corresponding LargeFileSharesState. - */ - @JsonCreator - public static LargeFileSharesState fromString(String name) { - return fromString(name, LargeFileSharesState.class); - } - - /** @return known LargeFileSharesState values. */ - public static Collection values() { - return values(LargeFileSharesState.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/LastAccessTimeTrackingPolicy.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/LastAccessTimeTrackingPolicy.java deleted file mode 100644 index eb6d29e95368..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/LastAccessTimeTrackingPolicy.java +++ /dev/null @@ -1,139 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The blob service properties for Last access time based tracking policy. */ -@Fluent -public final class LastAccessTimeTrackingPolicy { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LastAccessTimeTrackingPolicy.class); - - /* - * When set to true last access time based tracking is enabled. - */ - @JsonProperty(value = "enable", required = true) - private boolean enable; - - /* - * Name of the policy. The valid value is AccessTimeTracking. This field is - * currently read only - */ - @JsonProperty(value = "name") - private Name name; - - /* - * The field specifies blob object tracking granularity in days, typically - * how often the blob object should be tracked.This field is currently read - * only with value as 1 - */ - @JsonProperty(value = "trackingGranularityInDays") - private Integer trackingGranularityInDays; - - /* - * An array of predefined supported blob types. Only blockBlob is the - * supported value. This field is currently read only - */ - @JsonProperty(value = "blobType") - private List blobType; - - /** - * Get the enable property: When set to true last access time based tracking is enabled. - * - * @return the enable value. - */ - public boolean enable() { - return this.enable; - } - - /** - * Set the enable property: When set to true last access time based tracking is enabled. - * - * @param enable the enable value to set. - * @return the LastAccessTimeTrackingPolicy object itself. - */ - public LastAccessTimeTrackingPolicy withEnable(boolean enable) { - this.enable = enable; - return this; - } - - /** - * Get the name property: Name of the policy. The valid value is AccessTimeTracking. This field is currently read - * only. - * - * @return the name value. - */ - public Name name() { - return this.name; - } - - /** - * Set the name property: Name of the policy. The valid value is AccessTimeTracking. This field is currently read - * only. - * - * @param name the name value to set. - * @return the LastAccessTimeTrackingPolicy object itself. - */ - public LastAccessTimeTrackingPolicy withName(Name name) { - this.name = name; - return this; - } - - /** - * Get the trackingGranularityInDays property: The field specifies blob object tracking granularity in days, - * typically how often the blob object should be tracked.This field is currently read only with value as 1. - * - * @return the trackingGranularityInDays value. - */ - public Integer trackingGranularityInDays() { - return this.trackingGranularityInDays; - } - - /** - * Set the trackingGranularityInDays property: The field specifies blob object tracking granularity in days, - * typically how often the blob object should be tracked.This field is currently read only with value as 1. - * - * @param trackingGranularityInDays the trackingGranularityInDays value to set. - * @return the LastAccessTimeTrackingPolicy object itself. - */ - public LastAccessTimeTrackingPolicy withTrackingGranularityInDays(Integer trackingGranularityInDays) { - this.trackingGranularityInDays = trackingGranularityInDays; - return this; - } - - /** - * Get the blobType property: An array of predefined supported blob types. Only blockBlob is the supported value. - * This field is currently read only. - * - * @return the blobType value. - */ - public List blobType() { - return this.blobType; - } - - /** - * Set the blobType property: An array of predefined supported blob types. Only blockBlob is the supported value. - * This field is currently read only. - * - * @param blobType the blobType value to set. - * @return the LastAccessTimeTrackingPolicy object itself. - */ - public LastAccessTimeTrackingPolicy withBlobType(List blobType) { - this.blobType = blobType; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/LeaseContainerRequest.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/LeaseContainerRequest.java deleted file mode 100644 index 2209f2918216..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/LeaseContainerRequest.java +++ /dev/null @@ -1,168 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Lease Container request schema. */ -@Fluent -public final class LeaseContainerRequest { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LeaseContainerRequest.class); - - /* - * Specifies the lease action. Can be one of the available actions. - */ - @JsonProperty(value = "action", required = true) - private LeaseContainerRequestAction action; - - /* - * Identifies the lease. Can be specified in any valid GUID string format. - */ - @JsonProperty(value = "leaseId") - private String leaseId; - - /* - * Optional. For a break action, proposed duration the lease should - * continue before it is broken, in seconds, between 0 and 60. - */ - @JsonProperty(value = "breakPeriod") - private Integer breakPeriod; - - /* - * Required for acquire. Specifies the duration of the lease, in seconds, - * or negative one (-1) for a lease that never expires. - */ - @JsonProperty(value = "leaseDuration") - private Integer leaseDuration; - - /* - * Optional for acquire, required for change. Proposed lease ID, in a GUID - * string format. - */ - @JsonProperty(value = "proposedLeaseId") - private String proposedLeaseId; - - /** - * Get the action property: Specifies the lease action. Can be one of the available actions. - * - * @return the action value. - */ - public LeaseContainerRequestAction action() { - return this.action; - } - - /** - * Set the action property: Specifies the lease action. Can be one of the available actions. - * - * @param action the action value to set. - * @return the LeaseContainerRequest object itself. - */ - public LeaseContainerRequest withAction(LeaseContainerRequestAction action) { - this.action = action; - return this; - } - - /** - * Get the leaseId property: Identifies the lease. Can be specified in any valid GUID string format. - * - * @return the leaseId value. - */ - public String leaseId() { - return this.leaseId; - } - - /** - * Set the leaseId property: Identifies the lease. Can be specified in any valid GUID string format. - * - * @param leaseId the leaseId value to set. - * @return the LeaseContainerRequest object itself. - */ - public LeaseContainerRequest withLeaseId(String leaseId) { - this.leaseId = leaseId; - return this; - } - - /** - * Get the breakPeriod property: Optional. For a break action, proposed duration the lease should continue before it - * is broken, in seconds, between 0 and 60. - * - * @return the breakPeriod value. - */ - public Integer breakPeriod() { - return this.breakPeriod; - } - - /** - * Set the breakPeriod property: Optional. For a break action, proposed duration the lease should continue before it - * is broken, in seconds, between 0 and 60. - * - * @param breakPeriod the breakPeriod value to set. - * @return the LeaseContainerRequest object itself. - */ - public LeaseContainerRequest withBreakPeriod(Integer breakPeriod) { - this.breakPeriod = breakPeriod; - return this; - } - - /** - * Get the leaseDuration property: Required for acquire. Specifies the duration of the lease, in seconds, or - * negative one (-1) for a lease that never expires. - * - * @return the leaseDuration value. - */ - public Integer leaseDuration() { - return this.leaseDuration; - } - - /** - * Set the leaseDuration property: Required for acquire. Specifies the duration of the lease, in seconds, or - * negative one (-1) for a lease that never expires. - * - * @param leaseDuration the leaseDuration value to set. - * @return the LeaseContainerRequest object itself. - */ - public LeaseContainerRequest withLeaseDuration(Integer leaseDuration) { - this.leaseDuration = leaseDuration; - return this; - } - - /** - * Get the proposedLeaseId property: Optional for acquire, required for change. Proposed lease ID, in a GUID string - * format. - * - * @return the proposedLeaseId value. - */ - public String proposedLeaseId() { - return this.proposedLeaseId; - } - - /** - * Set the proposedLeaseId property: Optional for acquire, required for change. Proposed lease ID, in a GUID string - * format. - * - * @param proposedLeaseId the proposedLeaseId value to set. - * @return the LeaseContainerRequest object itself. - */ - public LeaseContainerRequest withProposedLeaseId(String proposedLeaseId) { - this.proposedLeaseId = proposedLeaseId; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (action() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property action in model LeaseContainerRequest")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/LeaseContainerRequestAction.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/LeaseContainerRequestAction.java deleted file mode 100644 index 5b130cf1546f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/LeaseContainerRequestAction.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for LeaseContainerRequestAction. */ -public final class LeaseContainerRequestAction extends ExpandableStringEnum { - /** Static value Acquire for LeaseContainerRequestAction. */ - public static final LeaseContainerRequestAction ACQUIRE = fromString("Acquire"); - - /** Static value Renew for LeaseContainerRequestAction. */ - public static final LeaseContainerRequestAction RENEW = fromString("Renew"); - - /** Static value Change for LeaseContainerRequestAction. */ - public static final LeaseContainerRequestAction CHANGE = fromString("Change"); - - /** Static value Release for LeaseContainerRequestAction. */ - public static final LeaseContainerRequestAction RELEASE = fromString("Release"); - - /** Static value Break for LeaseContainerRequestAction. */ - public static final LeaseContainerRequestAction BREAK = fromString("Break"); - - /** - * Creates or finds a LeaseContainerRequestAction from its string representation. - * - * @param name a name to look for. - * @return the corresponding LeaseContainerRequestAction. - */ - @JsonCreator - public static LeaseContainerRequestAction fromString(String name) { - return fromString(name, LeaseContainerRequestAction.class); - } - - /** @return known LeaseContainerRequestAction values. */ - public static Collection values() { - return values(LeaseContainerRequestAction.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/LeaseDuration.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/LeaseDuration.java deleted file mode 100644 index f113cf4d8f1f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/LeaseDuration.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for LeaseDuration. */ -public final class LeaseDuration extends ExpandableStringEnum { - /** Static value Infinite for LeaseDuration. */ - public static final LeaseDuration INFINITE = fromString("Infinite"); - - /** Static value Fixed for LeaseDuration. */ - public static final LeaseDuration FIXED = fromString("Fixed"); - - /** - * Creates or finds a LeaseDuration from its string representation. - * - * @param name a name to look for. - * @return the corresponding LeaseDuration. - */ - @JsonCreator - public static LeaseDuration fromString(String name) { - return fromString(name, LeaseDuration.class); - } - - /** @return known LeaseDuration values. */ - public static Collection values() { - return values(LeaseDuration.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/LeaseState.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/LeaseState.java deleted file mode 100644 index 9e9217950b17..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/LeaseState.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for LeaseState. */ -public final class LeaseState extends ExpandableStringEnum { - /** Static value Available for LeaseState. */ - public static final LeaseState AVAILABLE = fromString("Available"); - - /** Static value Leased for LeaseState. */ - public static final LeaseState LEASED = fromString("Leased"); - - /** Static value Expired for LeaseState. */ - public static final LeaseState EXPIRED = fromString("Expired"); - - /** Static value Breaking for LeaseState. */ - public static final LeaseState BREAKING = fromString("Breaking"); - - /** Static value Broken for LeaseState. */ - public static final LeaseState BROKEN = fromString("Broken"); - - /** - * Creates or finds a LeaseState from its string representation. - * - * @param name a name to look for. - * @return the corresponding LeaseState. - */ - @JsonCreator - public static LeaseState fromString(String name) { - return fromString(name, LeaseState.class); - } - - /** @return known LeaseState values. */ - public static Collection values() { - return values(LeaseState.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/LeaseStatus.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/LeaseStatus.java deleted file mode 100644 index 75733c92a063..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/LeaseStatus.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for LeaseStatus. */ -public final class LeaseStatus extends ExpandableStringEnum { - /** Static value Locked for LeaseStatus. */ - public static final LeaseStatus LOCKED = fromString("Locked"); - - /** Static value Unlocked for LeaseStatus. */ - public static final LeaseStatus UNLOCKED = fromString("Unlocked"); - - /** - * Creates or finds a LeaseStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding LeaseStatus. - */ - @JsonCreator - public static LeaseStatus fromString(String name) { - return fromString(name, LeaseStatus.class); - } - - /** @return known LeaseStatus values. */ - public static Collection values() { - return values(LeaseStatus.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/LegalHold.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/LegalHold.java deleted file mode 100644 index a4de912a709c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/LegalHold.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.storage.StorageManager; -import com.azure.resourcemanager.storage.fluent.models.LegalHoldInner; -import java.util.List; - -/** Type representing LegalHold. */ -@Fluent -public interface LegalHold extends HasInnerModel, HasManager { - /** @return the hasLegalHold value. */ - Boolean hasLegalHold(); - - /** @return the tags value. */ - List tags(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/LegalHoldProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/LegalHoldProperties.java deleted file mode 100644 index 99838369dada..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/LegalHoldProperties.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The LegalHold property of a blob container. */ -@Fluent -public final class LegalHoldProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LegalHoldProperties.class); - - /* - * The hasLegalHold public property is set to true by SRP if there are at - * least one existing tag. The hasLegalHold public property is set to false - * by SRP if all existing legal hold tags are cleared out. There can be a - * maximum of 1000 blob containers with hasLegalHold=true for a given - * account. - */ - @JsonProperty(value = "hasLegalHold", access = JsonProperty.Access.WRITE_ONLY) - private Boolean hasLegalHold; - - /* - * The list of LegalHold tags of a blob container. - */ - @JsonProperty(value = "tags") - private List tags; - - /** - * Get the hasLegalHold property: The hasLegalHold public property is set to true by SRP if there are at least one - * existing tag. The hasLegalHold public property is set to false by SRP if all existing legal hold tags are cleared - * out. There can be a maximum of 1000 blob containers with hasLegalHold=true for a given account. - * - * @return the hasLegalHold value. - */ - public Boolean hasLegalHold() { - return this.hasLegalHold; - } - - /** - * Get the tags property: The list of LegalHold tags of a blob container. - * - * @return the tags value. - */ - public List tags() { - return this.tags; - } - - /** - * Set the tags property: The list of LegalHold tags of a blob container. - * - * @param tags the tags value to set. - * @return the LegalHoldProperties object itself. - */ - public LegalHoldProperties withTags(List tags) { - this.tags = tags; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (tags() != null) { - tags().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ListBlobInventoryPolicy.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ListBlobInventoryPolicy.java deleted file mode 100644 index 3614a10d14a4..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ListBlobInventoryPolicy.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.storage.fluent.models.BlobInventoryPolicyInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** List of blob inventory policies returned. */ -@Immutable -public final class ListBlobInventoryPolicy { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ListBlobInventoryPolicy.class); - - /* - * List of blob inventory policies. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /** - * Get the value property: List of blob inventory policies. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ListContainerItems.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ListContainerItems.java deleted file mode 100644 index 85171cfbb61a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ListContainerItems.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.storage.fluent.models.ListContainerItemInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** - * Response schema. Contains list of blobs returned, and if paging is requested or required, a URL to next page of - * containers. - */ -@Immutable -public final class ListContainerItems { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ListContainerItems.class); - - /* - * List of blobs containers returned. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /* - * Request URL that can be used to query next page of containers. Returned - * when total number of requested containers exceed maximum page size. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: List of blobs containers returned. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: Request URL that can be used to query next page of containers. Returned when total - * number of requested containers exceed maximum page size. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ListContainersInclude.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ListContainersInclude.java deleted file mode 100644 index c2af3fe2e921..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ListContainersInclude.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ListContainersInclude. */ -public final class ListContainersInclude extends ExpandableStringEnum { - /** Static value deleted for ListContainersInclude. */ - public static final ListContainersInclude DELETED = fromString("deleted"); - - /** - * Creates or finds a ListContainersInclude from its string representation. - * - * @param name a name to look for. - * @return the corresponding ListContainersInclude. - */ - @JsonCreator - public static ListContainersInclude fromString(String name) { - return fromString(name, ListContainersInclude.class); - } - - /** @return known ListContainersInclude values. */ - public static Collection values() { - return values(ListContainersInclude.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ListKeyExpand.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ListKeyExpand.java deleted file mode 100644 index 1ece59f9c115..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ListKeyExpand.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for ListKeyExpand. */ -public enum ListKeyExpand { - /** Enum value kerb. */ - KERB("kerb"); - - /** The actual serialized value for a ListKeyExpand instance. */ - private final String value; - - ListKeyExpand(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a ListKeyExpand instance. - * - * @param value the serialized value to parse. - * @return the parsed ListKeyExpand object, or null if unable to parse. - */ - @JsonCreator - public static ListKeyExpand fromString(String value) { - ListKeyExpand[] items = ListKeyExpand.values(); - for (ListKeyExpand item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ListQueueResource.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ListQueueResource.java deleted file mode 100644 index f3bd2ba0d074..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ListQueueResource.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.storage.fluent.models.ListQueueInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Response schema. Contains list of queues returned. */ -@Immutable -public final class ListQueueResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ListQueueResource.class); - - /* - * List of queues returned. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /* - * Request URL that can be used to list next page of queues - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: List of queues returned. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: Request URL that can be used to list next page of queues. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ListSharesExpand.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ListSharesExpand.java deleted file mode 100644 index 2896f8d677cf..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ListSharesExpand.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for ListSharesExpand. */ -public enum ListSharesExpand { - /** Enum value deleted. */ - DELETED("deleted"); - - /** The actual serialized value for a ListSharesExpand instance. */ - private final String value; - - ListSharesExpand(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a ListSharesExpand instance. - * - * @param value the serialized value to parse. - * @return the parsed ListSharesExpand object, or null if unable to parse. - */ - @JsonCreator - public static ListSharesExpand fromString(String value) { - ListSharesExpand[] items = ListSharesExpand.values(); - for (ListSharesExpand item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ListTableResource.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ListTableResource.java deleted file mode 100644 index 0cc50c8f1f73..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ListTableResource.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.storage.fluent.models.TableInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Response schema. Contains list of tables returned. */ -@Immutable -public final class ListTableResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ListTableResource.class); - - /* - * List of tables returned. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /* - * Request URL that can be used to query next page of tables - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: List of tables returned. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: Request URL that can be used to query next page of tables. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicies.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicies.java deleted file mode 100644 index 3629beec48d0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicies.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsCreating; -import reactor.core.publisher.Mono; - -/** Type representing ManagementPolicies. */ -@Fluent -public interface ManagementPolicies - extends SupportsCreating { - /** - * Gets the managementpolicy associated with the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - Mono getAsync(String resourceGroupName, String accountName); - - /** - * Deletes the managementpolicy associated with the specified storage account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names - * must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - Mono deleteAsync(String resourceGroupName, String accountName); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicy.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicy.java deleted file mode 100644 index 2d35f47c023c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicy.java +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.model.Appliable; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.model.Indexable; -import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; -import com.azure.resourcemanager.resources.fluentcore.model.Updatable; -import com.azure.resourcemanager.storage.StorageManager; -import com.azure.resourcemanager.storage.fluent.models.ManagementPolicyInner; -import java.time.OffsetDateTime; -import java.util.List; - -/** Type representing ManagementPolicy. */ -@Fluent -public interface ManagementPolicy - extends HasInnerModel, - Indexable, - Refreshable, - Updatable, - HasManager { - /** @return the id value. */ - String id(); - - /** @return the lastModifiedTime value. */ - OffsetDateTime lastModifiedTime(); - - /** @return the name value. */ - String name(); - - /** @return the policy value. */ - ManagementPolicySchema policy(); - - /** @return the type value. */ - String type(); - - /** @return the list of rules for this policy */ - List rules(); - - /** The entirety of the ManagementPolicy definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithStorageAccount, - DefinitionStages.WithRule, - DefinitionStages.WithCreate { - } - - /** Grouping of ManagementPolicy definition stages. */ - interface DefinitionStages { - /** The first stage of a ManagementPolicy definition. */ - interface Blank extends WithStorageAccount { - } - - /** The stage of the managementpolicy definition allowing to specify StorageAccount. */ - interface WithStorageAccount { - /** - * Specifies resourceGroupName, accountName. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive - * @param accountName The name of the storage account within the specified resource group. Storage account - * names must be between 3 and 24 characters in length and use numbers and lower-case letters only - * @return the next definition stage - */ - WithRule withExistingStorageAccount(String resourceGroupName, String accountName); - } - - /** The stage of the management policy definition allowing to specify a rule to add to the management policy. */ - interface WithRule { - /** - * The function that defines a rule to attach to this policy. - * - * @param name the name of the rule we are going to define - * @return the next definition stage - */ - PolicyRule.DefinitionStages.Blank defineRule(String name); - } - - /** - * The stage of the definition which contains all the minimum required inputs for the resource to be created - * (via {@link WithCreate#create()}), but also allows for any other optional settings to be specified. - */ - interface WithCreate extends Creatable, ManagementPolicy.DefinitionStages.WithRule { - } - } - /** The template for a ManagementPolicy update operation, containing all the settings that can be modified. */ - interface Update extends Appliable, UpdateStages.WithPolicy, UpdateStages.Rule { - } - - /** Grouping of ManagementPolicy update stages. */ - interface UpdateStages { - /** The stage of the management policy update allowing to specify Policy. */ - interface WithPolicy { - /** - * Specifies policy. - * - * @param policy The Storage Account ManagementPolicy, in JSON format. See more details in: - * https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts - * @return the next update stage - */ - Update withPolicy(ManagementPolicySchema policy); - } - - /** The stage of the management policy update allowing to update a rule. */ - interface Rule { - /** - * The function that updates a rule whose name is the inputted parameter name. - * - * @param name the name of the rule to be updated. - * @return the next stage of the management policy rule update. - */ - PolicyRule.Update updateRule(String name); - - /** - * The function that removes a rule whose name is the inputted parameter name. - * - * @param name the name of the rule to be removed. - * @return the next stage of the management policy update. - */ - Update withoutRule(String name); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicyAction.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicyAction.java deleted file mode 100644 index 128513ad75bc..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicyAction.java +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Actions are applied to the filtered blobs when the execution condition is met. */ -@Fluent -public final class ManagementPolicyAction { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagementPolicyAction.class); - - /* - * The management policy action for base blob - */ - @JsonProperty(value = "baseBlob") - private ManagementPolicyBaseBlob baseBlob; - - /* - * The management policy action for snapshot - */ - @JsonProperty(value = "snapshot") - private ManagementPolicySnapShot snapshot; - - /* - * The management policy action for version - */ - @JsonProperty(value = "version") - private ManagementPolicyVersion version; - - /** - * Get the baseBlob property: The management policy action for base blob. - * - * @return the baseBlob value. - */ - public ManagementPolicyBaseBlob baseBlob() { - return this.baseBlob; - } - - /** - * Set the baseBlob property: The management policy action for base blob. - * - * @param baseBlob the baseBlob value to set. - * @return the ManagementPolicyAction object itself. - */ - public ManagementPolicyAction withBaseBlob(ManagementPolicyBaseBlob baseBlob) { - this.baseBlob = baseBlob; - return this; - } - - /** - * Get the snapshot property: The management policy action for snapshot. - * - * @return the snapshot value. - */ - public ManagementPolicySnapShot snapshot() { - return this.snapshot; - } - - /** - * Set the snapshot property: The management policy action for snapshot. - * - * @param snapshot the snapshot value to set. - * @return the ManagementPolicyAction object itself. - */ - public ManagementPolicyAction withSnapshot(ManagementPolicySnapShot snapshot) { - this.snapshot = snapshot; - return this; - } - - /** - * Get the version property: The management policy action for version. - * - * @return the version value. - */ - public ManagementPolicyVersion version() { - return this.version; - } - - /** - * Set the version property: The management policy action for version. - * - * @param version the version value to set. - * @return the ManagementPolicyAction object itself. - */ - public ManagementPolicyAction withVersion(ManagementPolicyVersion version) { - this.version = version; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (baseBlob() != null) { - baseBlob().validate(); - } - if (snapshot() != null) { - snapshot().validate(); - } - if (version() != null) { - version().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicyBaseBlob.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicyBaseBlob.java deleted file mode 100644 index 19ee7580f2be..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicyBaseBlob.java +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Management policy action for base blob. */ -@Fluent -public final class ManagementPolicyBaseBlob { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagementPolicyBaseBlob.class); - - /* - * The function to tier blobs to cool storage. Support blobs currently at - * Hot tier - */ - @JsonProperty(value = "tierToCool") - private DateAfterModification tierToCool; - - /* - * The function to tier blobs to archive storage. Support blobs currently - * at Hot or Cool tier - */ - @JsonProperty(value = "tierToArchive") - private DateAfterModification tierToArchive; - - /* - * The function to delete the blob - */ - @JsonProperty(value = "delete") - private DateAfterModification delete; - - /* - * This property enables auto tiering of a blob from cool to hot on a blob - * access. This property requires - * tierToCool.daysAfterLastAccessTimeGreaterThan. - */ - @JsonProperty(value = "enableAutoTierToHotFromCool") - private Boolean enableAutoTierToHotFromCool; - - /** - * Get the tierToCool property: The function to tier blobs to cool storage. Support blobs currently at Hot tier. - * - * @return the tierToCool value. - */ - public DateAfterModification tierToCool() { - return this.tierToCool; - } - - /** - * Set the tierToCool property: The function to tier blobs to cool storage. Support blobs currently at Hot tier. - * - * @param tierToCool the tierToCool value to set. - * @return the ManagementPolicyBaseBlob object itself. - */ - public ManagementPolicyBaseBlob withTierToCool(DateAfterModification tierToCool) { - this.tierToCool = tierToCool; - return this; - } - - /** - * Get the tierToArchive property: The function to tier blobs to archive storage. Support blobs currently at Hot or - * Cool tier. - * - * @return the tierToArchive value. - */ - public DateAfterModification tierToArchive() { - return this.tierToArchive; - } - - /** - * Set the tierToArchive property: The function to tier blobs to archive storage. Support blobs currently at Hot or - * Cool tier. - * - * @param tierToArchive the tierToArchive value to set. - * @return the ManagementPolicyBaseBlob object itself. - */ - public ManagementPolicyBaseBlob withTierToArchive(DateAfterModification tierToArchive) { - this.tierToArchive = tierToArchive; - return this; - } - - /** - * Get the delete property: The function to delete the blob. - * - * @return the delete value. - */ - public DateAfterModification delete() { - return this.delete; - } - - /** - * Set the delete property: The function to delete the blob. - * - * @param delete the delete value to set. - * @return the ManagementPolicyBaseBlob object itself. - */ - public ManagementPolicyBaseBlob withDelete(DateAfterModification delete) { - this.delete = delete; - return this; - } - - /** - * Get the enableAutoTierToHotFromCool property: This property enables auto tiering of a blob from cool to hot on a - * blob access. This property requires tierToCool.daysAfterLastAccessTimeGreaterThan. - * - * @return the enableAutoTierToHotFromCool value. - */ - public Boolean enableAutoTierToHotFromCool() { - return this.enableAutoTierToHotFromCool; - } - - /** - * Set the enableAutoTierToHotFromCool property: This property enables auto tiering of a blob from cool to hot on a - * blob access. This property requires tierToCool.daysAfterLastAccessTimeGreaterThan. - * - * @param enableAutoTierToHotFromCool the enableAutoTierToHotFromCool value to set. - * @return the ManagementPolicyBaseBlob object itself. - */ - public ManagementPolicyBaseBlob withEnableAutoTierToHotFromCool(Boolean enableAutoTierToHotFromCool) { - this.enableAutoTierToHotFromCool = enableAutoTierToHotFromCool; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (tierToCool() != null) { - tierToCool().validate(); - } - if (tierToArchive() != null) { - tierToArchive().validate(); - } - if (delete() != null) { - delete().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicyDefinition.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicyDefinition.java deleted file mode 100644 index 0ecab265a50f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicyDefinition.java +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** An object that defines the Lifecycle rule. Each definition is made up with a filters set and an actions set. */ -@Fluent -public final class ManagementPolicyDefinition { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagementPolicyDefinition.class); - - /* - * An object that defines the action set. - */ - @JsonProperty(value = "actions", required = true) - private ManagementPolicyAction actions; - - /* - * An object that defines the filter set. - */ - @JsonProperty(value = "filters") - private ManagementPolicyFilter filters; - - /** - * Get the actions property: An object that defines the action set. - * - * @return the actions value. - */ - public ManagementPolicyAction actions() { - return this.actions; - } - - /** - * Set the actions property: An object that defines the action set. - * - * @param actions the actions value to set. - * @return the ManagementPolicyDefinition object itself. - */ - public ManagementPolicyDefinition withActions(ManagementPolicyAction actions) { - this.actions = actions; - return this; - } - - /** - * Get the filters property: An object that defines the filter set. - * - * @return the filters value. - */ - public ManagementPolicyFilter filters() { - return this.filters; - } - - /** - * Set the filters property: An object that defines the filter set. - * - * @param filters the filters value to set. - * @return the ManagementPolicyDefinition object itself. - */ - public ManagementPolicyDefinition withFilters(ManagementPolicyFilter filters) { - this.filters = filters; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (actions() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property actions in model ManagementPolicyDefinition")); - } else { - actions().validate(); - } - if (filters() != null) { - filters().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicyFilter.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicyFilter.java deleted file mode 100644 index 91ac989fa6ef..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicyFilter.java +++ /dev/null @@ -1,120 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** - * Filters limit rule actions to a subset of blobs within the storage account. If multiple filters are defined, a - * logical AND is performed on all filters. - */ -@Fluent -public final class ManagementPolicyFilter { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagementPolicyFilter.class); - - /* - * An array of strings for prefixes to be match. - */ - @JsonProperty(value = "prefixMatch") - private List prefixMatch; - - /* - * An array of predefined enum values. Currently blockBlob supports all - * tiering and delete actions. Only delete actions are supported for - * appendBlob. - */ - @JsonProperty(value = "blobTypes", required = true) - private List blobTypes; - - /* - * An array of blob index tag based filters, there can be at most 10 tag - * filters - */ - @JsonProperty(value = "blobIndexMatch") - private List blobIndexMatch; - - /** - * Get the prefixMatch property: An array of strings for prefixes to be match. - * - * @return the prefixMatch value. - */ - public List prefixMatch() { - return this.prefixMatch; - } - - /** - * Set the prefixMatch property: An array of strings for prefixes to be match. - * - * @param prefixMatch the prefixMatch value to set. - * @return the ManagementPolicyFilter object itself. - */ - public ManagementPolicyFilter withPrefixMatch(List prefixMatch) { - this.prefixMatch = prefixMatch; - return this; - } - - /** - * Get the blobTypes property: An array of predefined enum values. Currently blockBlob supports all tiering and - * delete actions. Only delete actions are supported for appendBlob. - * - * @return the blobTypes value. - */ - public List blobTypes() { - return this.blobTypes; - } - - /** - * Set the blobTypes property: An array of predefined enum values. Currently blockBlob supports all tiering and - * delete actions. Only delete actions are supported for appendBlob. - * - * @param blobTypes the blobTypes value to set. - * @return the ManagementPolicyFilter object itself. - */ - public ManagementPolicyFilter withBlobTypes(List blobTypes) { - this.blobTypes = blobTypes; - return this; - } - - /** - * Get the blobIndexMatch property: An array of blob index tag based filters, there can be at most 10 tag filters. - * - * @return the blobIndexMatch value. - */ - public List blobIndexMatch() { - return this.blobIndexMatch; - } - - /** - * Set the blobIndexMatch property: An array of blob index tag based filters, there can be at most 10 tag filters. - * - * @param blobIndexMatch the blobIndexMatch value to set. - * @return the ManagementPolicyFilter object itself. - */ - public ManagementPolicyFilter withBlobIndexMatch(List blobIndexMatch) { - this.blobIndexMatch = blobIndexMatch; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (blobTypes() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property blobTypes in model ManagementPolicyFilter")); - } - if (blobIndexMatch() != null) { - blobIndexMatch().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicyName.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicyName.java deleted file mode 100644 index bb8c037b53ff..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicyName.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ManagementPolicyName. */ -public final class ManagementPolicyName extends ExpandableStringEnum { - /** Static value default for ManagementPolicyName. */ - public static final ManagementPolicyName DEFAULT = fromString("default"); - - /** - * Creates or finds a ManagementPolicyName from its string representation. - * - * @param name a name to look for. - * @return the corresponding ManagementPolicyName. - */ - @JsonCreator - public static ManagementPolicyName fromString(String name) { - return fromString(name, ManagementPolicyName.class); - } - - /** @return known ManagementPolicyName values. */ - public static Collection values() { - return values(ManagementPolicyName.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicyRule.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicyRule.java deleted file mode 100644 index 7a8c269b9d93..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicyRule.java +++ /dev/null @@ -1,148 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** An object that wraps the Lifecycle rule. Each rule is uniquely defined by name. */ -@Fluent -public final class ManagementPolicyRule { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagementPolicyRule.class); - - /* - * Rule is enabled if set to true. - */ - @JsonProperty(value = "enabled") - private Boolean enabled; - - /* - * A rule name can contain any combination of alpha numeric characters. - * Rule name is case-sensitive. It must be unique within a policy. - */ - @JsonProperty(value = "name", required = true) - private String name; - - /* - * The valid value is Lifecycle - */ - @JsonProperty(value = "type", required = true) - private RuleType type; - - /* - * An object that defines the Lifecycle rule. - */ - @JsonProperty(value = "definition", required = true) - private ManagementPolicyDefinition definition; - - /** - * Get the enabled property: Rule is enabled if set to true. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Rule is enabled if set to true. - * - * @param enabled the enabled value to set. - * @return the ManagementPolicyRule object itself. - */ - public ManagementPolicyRule withEnabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the name property: A rule name can contain any combination of alpha numeric characters. Rule name is - * case-sensitive. It must be unique within a policy. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: A rule name can contain any combination of alpha numeric characters. Rule name is - * case-sensitive. It must be unique within a policy. - * - * @param name the name value to set. - * @return the ManagementPolicyRule object itself. - */ - public ManagementPolicyRule withName(String name) { - this.name = name; - return this; - } - - /** - * Get the type property: The valid value is Lifecycle. - * - * @return the type value. - */ - public RuleType type() { - return this.type; - } - - /** - * Set the type property: The valid value is Lifecycle. - * - * @param type the type value to set. - * @return the ManagementPolicyRule object itself. - */ - public ManagementPolicyRule withType(RuleType type) { - this.type = type; - return this; - } - - /** - * Get the definition property: An object that defines the Lifecycle rule. - * - * @return the definition value. - */ - public ManagementPolicyDefinition definition() { - return this.definition; - } - - /** - * Set the definition property: An object that defines the Lifecycle rule. - * - * @param definition the definition value to set. - * @return the ManagementPolicyRule object itself. - */ - public ManagementPolicyRule withDefinition(ManagementPolicyDefinition definition) { - this.definition = definition; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property name in model ManagementPolicyRule")); - } - if (type() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property type in model ManagementPolicyRule")); - } - if (definition() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property definition in model ManagementPolicyRule")); - } else { - definition().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicySchema.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicySchema.java deleted file mode 100644 index 452471c12c19..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicySchema.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** - * The Storage Account ManagementPolicies Rules. See more details in: - * https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. - */ -@Fluent -public final class ManagementPolicySchema { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagementPolicySchema.class); - - /* - * The Storage Account ManagementPolicies Rules. See more details in: - * https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. - */ - @JsonProperty(value = "rules", required = true) - private List rules; - - /** - * Get the rules property: The Storage Account ManagementPolicies Rules. See more details in: - * https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. - * - * @return the rules value. - */ - public List rules() { - return this.rules; - } - - /** - * Set the rules property: The Storage Account ManagementPolicies Rules. See more details in: - * https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. - * - * @param rules the rules value to set. - * @return the ManagementPolicySchema object itself. - */ - public ManagementPolicySchema withRules(List rules) { - this.rules = rules; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (rules() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property rules in model ManagementPolicySchema")); - } else { - rules().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicySnapShot.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicySnapShot.java deleted file mode 100644 index 00fa36793a44..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicySnapShot.java +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Management policy action for snapshot. */ -@Fluent -public final class ManagementPolicySnapShot { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagementPolicySnapShot.class); - - /* - * The function to tier blob snapshot to cool storage. Support blob - * snapshot currently at Hot tier - */ - @JsonProperty(value = "tierToCool") - private DateAfterCreation tierToCool; - - /* - * The function to tier blob snapshot to archive storage. Support blob - * snapshot currently at Hot or Cool tier - */ - @JsonProperty(value = "tierToArchive") - private DateAfterCreation tierToArchive; - - /* - * The function to delete the blob snapshot - */ - @JsonProperty(value = "delete") - private DateAfterCreation delete; - - /** - * Get the tierToCool property: The function to tier blob snapshot to cool storage. Support blob snapshot currently - * at Hot tier. - * - * @return the tierToCool value. - */ - public DateAfterCreation tierToCool() { - return this.tierToCool; - } - - /** - * Set the tierToCool property: The function to tier blob snapshot to cool storage. Support blob snapshot currently - * at Hot tier. - * - * @param tierToCool the tierToCool value to set. - * @return the ManagementPolicySnapShot object itself. - */ - public ManagementPolicySnapShot withTierToCool(DateAfterCreation tierToCool) { - this.tierToCool = tierToCool; - return this; - } - - /** - * Get the tierToArchive property: The function to tier blob snapshot to archive storage. Support blob snapshot - * currently at Hot or Cool tier. - * - * @return the tierToArchive value. - */ - public DateAfterCreation tierToArchive() { - return this.tierToArchive; - } - - /** - * Set the tierToArchive property: The function to tier blob snapshot to archive storage. Support blob snapshot - * currently at Hot or Cool tier. - * - * @param tierToArchive the tierToArchive value to set. - * @return the ManagementPolicySnapShot object itself. - */ - public ManagementPolicySnapShot withTierToArchive(DateAfterCreation tierToArchive) { - this.tierToArchive = tierToArchive; - return this; - } - - /** - * Get the delete property: The function to delete the blob snapshot. - * - * @return the delete value. - */ - public DateAfterCreation delete() { - return this.delete; - } - - /** - * Set the delete property: The function to delete the blob snapshot. - * - * @param delete the delete value to set. - * @return the ManagementPolicySnapShot object itself. - */ - public ManagementPolicySnapShot withDelete(DateAfterCreation delete) { - this.delete = delete; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (tierToCool() != null) { - tierToCool().validate(); - } - if (tierToArchive() != null) { - tierToArchive().validate(); - } - if (delete() != null) { - delete().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicyVersion.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicyVersion.java deleted file mode 100644 index fefb6d9f38d8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicyVersion.java +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Management policy action for blob version. */ -@Fluent -public final class ManagementPolicyVersion { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagementPolicyVersion.class); - - /* - * The function to tier blob version to cool storage. Support blob version - * currently at Hot tier - */ - @JsonProperty(value = "tierToCool") - private DateAfterCreation tierToCool; - - /* - * The function to tier blob version to archive storage. Support blob - * version currently at Hot or Cool tier - */ - @JsonProperty(value = "tierToArchive") - private DateAfterCreation tierToArchive; - - /* - * The function to delete the blob version - */ - @JsonProperty(value = "delete") - private DateAfterCreation delete; - - /** - * Get the tierToCool property: The function to tier blob version to cool storage. Support blob version currently at - * Hot tier. - * - * @return the tierToCool value. - */ - public DateAfterCreation tierToCool() { - return this.tierToCool; - } - - /** - * Set the tierToCool property: The function to tier blob version to cool storage. Support blob version currently at - * Hot tier. - * - * @param tierToCool the tierToCool value to set. - * @return the ManagementPolicyVersion object itself. - */ - public ManagementPolicyVersion withTierToCool(DateAfterCreation tierToCool) { - this.tierToCool = tierToCool; - return this; - } - - /** - * Get the tierToArchive property: The function to tier blob version to archive storage. Support blob version - * currently at Hot or Cool tier. - * - * @return the tierToArchive value. - */ - public DateAfterCreation tierToArchive() { - return this.tierToArchive; - } - - /** - * Set the tierToArchive property: The function to tier blob version to archive storage. Support blob version - * currently at Hot or Cool tier. - * - * @param tierToArchive the tierToArchive value to set. - * @return the ManagementPolicyVersion object itself. - */ - public ManagementPolicyVersion withTierToArchive(DateAfterCreation tierToArchive) { - this.tierToArchive = tierToArchive; - return this; - } - - /** - * Get the delete property: The function to delete the blob version. - * - * @return the delete value. - */ - public DateAfterCreation delete() { - return this.delete; - } - - /** - * Set the delete property: The function to delete the blob version. - * - * @param delete the delete value to set. - * @return the ManagementPolicyVersion object itself. - */ - public ManagementPolicyVersion withDelete(DateAfterCreation delete) { - this.delete = delete; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (tierToCool() != null) { - tierToCool().validate(); - } - if (tierToArchive() != null) { - tierToArchive().validate(); - } - if (delete() != null) { - delete().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/MetricSpecification.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/MetricSpecification.java deleted file mode 100644 index 5a963a5fa42e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/MetricSpecification.java +++ /dev/null @@ -1,262 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Metric specification of operation. */ -@Fluent -public final class MetricSpecification { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MetricSpecification.class); - - /* - * Name of metric specification. - */ - @JsonProperty(value = "name") - private String name; - - /* - * Display name of metric specification. - */ - @JsonProperty(value = "displayName") - private String displayName; - - /* - * Display description of metric specification. - */ - @JsonProperty(value = "displayDescription") - private String displayDescription; - - /* - * Unit could be Bytes or Count. - */ - @JsonProperty(value = "unit") - private String unit; - - /* - * Dimensions of blobs, including blob type and access tier. - */ - @JsonProperty(value = "dimensions") - private List dimensions; - - /* - * Aggregation type could be Average. - */ - @JsonProperty(value = "aggregationType") - private String aggregationType; - - /* - * The property to decide fill gap with zero or not. - */ - @JsonProperty(value = "fillGapWithZero") - private Boolean fillGapWithZero; - - /* - * The category this metric specification belong to, could be Capacity. - */ - @JsonProperty(value = "category") - private String category; - - /* - * Account Resource Id. - */ - @JsonProperty(value = "resourceIdDimensionNameOverride") - private String resourceIdDimensionNameOverride; - - /** - * Get the name property: Name of metric specification. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Name of metric specification. - * - * @param name the name value to set. - * @return the MetricSpecification object itself. - */ - public MetricSpecification withName(String name) { - this.name = name; - return this; - } - - /** - * Get the displayName property: Display name of metric specification. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Set the displayName property: Display name of metric specification. - * - * @param displayName the displayName value to set. - * @return the MetricSpecification object itself. - */ - public MetricSpecification withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - - /** - * Get the displayDescription property: Display description of metric specification. - * - * @return the displayDescription value. - */ - public String displayDescription() { - return this.displayDescription; - } - - /** - * Set the displayDescription property: Display description of metric specification. - * - * @param displayDescription the displayDescription value to set. - * @return the MetricSpecification object itself. - */ - public MetricSpecification withDisplayDescription(String displayDescription) { - this.displayDescription = displayDescription; - return this; - } - - /** - * Get the unit property: Unit could be Bytes or Count. - * - * @return the unit value. - */ - public String unit() { - return this.unit; - } - - /** - * Set the unit property: Unit could be Bytes or Count. - * - * @param unit the unit value to set. - * @return the MetricSpecification object itself. - */ - public MetricSpecification withUnit(String unit) { - this.unit = unit; - return this; - } - - /** - * Get the dimensions property: Dimensions of blobs, including blob type and access tier. - * - * @return the dimensions value. - */ - public List dimensions() { - return this.dimensions; - } - - /** - * Set the dimensions property: Dimensions of blobs, including blob type and access tier. - * - * @param dimensions the dimensions value to set. - * @return the MetricSpecification object itself. - */ - public MetricSpecification withDimensions(List dimensions) { - this.dimensions = dimensions; - return this; - } - - /** - * Get the aggregationType property: Aggregation type could be Average. - * - * @return the aggregationType value. - */ - public String aggregationType() { - return this.aggregationType; - } - - /** - * Set the aggregationType property: Aggregation type could be Average. - * - * @param aggregationType the aggregationType value to set. - * @return the MetricSpecification object itself. - */ - public MetricSpecification withAggregationType(String aggregationType) { - this.aggregationType = aggregationType; - return this; - } - - /** - * Get the fillGapWithZero property: The property to decide fill gap with zero or not. - * - * @return the fillGapWithZero value. - */ - public Boolean fillGapWithZero() { - return this.fillGapWithZero; - } - - /** - * Set the fillGapWithZero property: The property to decide fill gap with zero or not. - * - * @param fillGapWithZero the fillGapWithZero value to set. - * @return the MetricSpecification object itself. - */ - public MetricSpecification withFillGapWithZero(Boolean fillGapWithZero) { - this.fillGapWithZero = fillGapWithZero; - return this; - } - - /** - * Get the category property: The category this metric specification belong to, could be Capacity. - * - * @return the category value. - */ - public String category() { - return this.category; - } - - /** - * Set the category property: The category this metric specification belong to, could be Capacity. - * - * @param category the category value to set. - * @return the MetricSpecification object itself. - */ - public MetricSpecification withCategory(String category) { - this.category = category; - return this; - } - - /** - * Get the resourceIdDimensionNameOverride property: Account Resource Id. - * - * @return the resourceIdDimensionNameOverride value. - */ - public String resourceIdDimensionNameOverride() { - return this.resourceIdDimensionNameOverride; - } - - /** - * Set the resourceIdDimensionNameOverride property: Account Resource Id. - * - * @param resourceIdDimensionNameOverride the resourceIdDimensionNameOverride value to set. - * @return the MetricSpecification object itself. - */ - public MetricSpecification withResourceIdDimensionNameOverride(String resourceIdDimensionNameOverride) { - this.resourceIdDimensionNameOverride = resourceIdDimensionNameOverride; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (dimensions() != null) { - dimensions().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/MinimumTlsVersion.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/MinimumTlsVersion.java deleted file mode 100644 index 4b60198570d2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/MinimumTlsVersion.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for MinimumTlsVersion. */ -public final class MinimumTlsVersion extends ExpandableStringEnum { - /** Static value TLS1_0 for MinimumTlsVersion. */ - public static final MinimumTlsVersion TLS1_0 = fromString("TLS1_0"); - - /** Static value TLS1_1 for MinimumTlsVersion. */ - public static final MinimumTlsVersion TLS1_1 = fromString("TLS1_1"); - - /** Static value TLS1_2 for MinimumTlsVersion. */ - public static final MinimumTlsVersion TLS1_2 = fromString("TLS1_2"); - - /** - * Creates or finds a MinimumTlsVersion from its string representation. - * - * @param name a name to look for. - * @return the corresponding MinimumTlsVersion. - */ - @JsonCreator - public static MinimumTlsVersion fromString(String name) { - return fromString(name, MinimumTlsVersion.class); - } - - /** @return known MinimumTlsVersion values. */ - public static Collection values() { - return values(MinimumTlsVersion.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Name.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Name.java deleted file mode 100644 index 7aef17d21b6d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Name.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for Name. */ -public final class Name extends ExpandableStringEnum { - /** Static value AccessTimeTracking for Name. */ - public static final Name ACCESS_TIME_TRACKING = fromString("AccessTimeTracking"); - - /** - * Creates or finds a Name from its string representation. - * - * @param name a name to look for. - * @return the corresponding Name. - */ - @JsonCreator - public static Name fromString(String name) { - return fromString(name, Name.class); - } - - /** @return known Name values. */ - public static Collection values() { - return values(Name.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/NetworkRuleSet.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/NetworkRuleSet.java deleted file mode 100644 index ea14fb9cb351..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/NetworkRuleSet.java +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Network rule set. */ -@Fluent -public final class NetworkRuleSet { - @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkRuleSet.class); - - /* - * Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. - * Possible values are any combination of Logging|Metrics|AzureServices - * (For example, "Logging, Metrics"), or None to bypass none of those - * traffics. - */ - @JsonProperty(value = "bypass") - private Bypass bypass; - - /* - * Sets the virtual network rules - */ - @JsonProperty(value = "virtualNetworkRules") - private List virtualNetworkRules; - - /* - * Sets the IP ACL rules - */ - @JsonProperty(value = "ipRules") - private List ipRules; - - /* - * Specifies the default action of allow or deny when no other rules match. - */ - @JsonProperty(value = "defaultAction", required = true) - private DefaultAction defaultAction; - - /** - * Get the bypass property: Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Possible values - * are any combination of Logging|Metrics|AzureServices (For example, "Logging, Metrics"), or None to bypass none of - * those traffics. - * - * @return the bypass value. - */ - public Bypass bypass() { - return this.bypass; - } - - /** - * Set the bypass property: Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Possible values - * are any combination of Logging|Metrics|AzureServices (For example, "Logging, Metrics"), or None to bypass none of - * those traffics. - * - * @param bypass the bypass value to set. - * @return the NetworkRuleSet object itself. - */ - public NetworkRuleSet withBypass(Bypass bypass) { - this.bypass = bypass; - return this; - } - - /** - * Get the virtualNetworkRules property: Sets the virtual network rules. - * - * @return the virtualNetworkRules value. - */ - public List virtualNetworkRules() { - return this.virtualNetworkRules; - } - - /** - * Set the virtualNetworkRules property: Sets the virtual network rules. - * - * @param virtualNetworkRules the virtualNetworkRules value to set. - * @return the NetworkRuleSet object itself. - */ - public NetworkRuleSet withVirtualNetworkRules(List virtualNetworkRules) { - this.virtualNetworkRules = virtualNetworkRules; - return this; - } - - /** - * Get the ipRules property: Sets the IP ACL rules. - * - * @return the ipRules value. - */ - public List ipRules() { - return this.ipRules; - } - - /** - * Set the ipRules property: Sets the IP ACL rules. - * - * @param ipRules the ipRules value to set. - * @return the NetworkRuleSet object itself. - */ - public NetworkRuleSet withIpRules(List ipRules) { - this.ipRules = ipRules; - return this; - } - - /** - * Get the defaultAction property: Specifies the default action of allow or deny when no other rules match. - * - * @return the defaultAction value. - */ - public DefaultAction defaultAction() { - return this.defaultAction; - } - - /** - * Set the defaultAction property: Specifies the default action of allow or deny when no other rules match. - * - * @param defaultAction the defaultAction value to set. - * @return the NetworkRuleSet object itself. - */ - public NetworkRuleSet withDefaultAction(DefaultAction defaultAction) { - this.defaultAction = defaultAction; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (virtualNetworkRules() != null) { - virtualNetworkRules().forEach(e -> e.validate()); - } - if (ipRules() != null) { - ipRules().forEach(e -> e.validate()); - } - if (defaultAction() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property defaultAction in model NetworkRuleSet")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ObjectReplicationPolicies.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ObjectReplicationPolicies.java deleted file mode 100644 index 58d0f2c694f5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ObjectReplicationPolicies.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.storage.fluent.models.ObjectReplicationPolicyInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** List storage account object replication policies. */ -@Fluent -public final class ObjectReplicationPolicies { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ObjectReplicationPolicies.class); - - /* - * The replication policy between two storage accounts. - */ - @JsonProperty(value = "value") - private List value; - - /** - * Get the value property: The replication policy between two storage accounts. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The replication policy between two storage accounts. - * - * @param value the value value to set. - * @return the ObjectReplicationPolicies object itself. - */ - public ObjectReplicationPolicies withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ObjectReplicationPolicyFilter.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ObjectReplicationPolicyFilter.java deleted file mode 100644 index d3182374e275..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ObjectReplicationPolicyFilter.java +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** - * Filters limit replication to a subset of blobs within the storage account. A logical OR is performed on values in the - * filter. If multiple filters are defined, a logical AND is performed on all filters. - */ -@Fluent -public final class ObjectReplicationPolicyFilter { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ObjectReplicationPolicyFilter.class); - - /* - * Optional. Filters the results to replicate only blobs whose names begin - * with the specified prefix. - */ - @JsonProperty(value = "prefixMatch") - private List prefixMatch; - - /* - * Blobs created after the time will be replicated to the destination. It - * must be in datetime format 'yyyy-MM-ddTHH:mm:ssZ'. Example: - * 2020-02-19T16:05:00Z - */ - @JsonProperty(value = "minCreationTime") - private String minCreationTime; - - /** - * Get the prefixMatch property: Optional. Filters the results to replicate only blobs whose names begin with the - * specified prefix. - * - * @return the prefixMatch value. - */ - public List prefixMatch() { - return this.prefixMatch; - } - - /** - * Set the prefixMatch property: Optional. Filters the results to replicate only blobs whose names begin with the - * specified prefix. - * - * @param prefixMatch the prefixMatch value to set. - * @return the ObjectReplicationPolicyFilter object itself. - */ - public ObjectReplicationPolicyFilter withPrefixMatch(List prefixMatch) { - this.prefixMatch = prefixMatch; - return this; - } - - /** - * Get the minCreationTime property: Blobs created after the time will be replicated to the destination. It must be - * in datetime format 'yyyy-MM-ddTHH:mm:ssZ'. Example: 2020-02-19T16:05:00Z. - * - * @return the minCreationTime value. - */ - public String minCreationTime() { - return this.minCreationTime; - } - - /** - * Set the minCreationTime property: Blobs created after the time will be replicated to the destination. It must be - * in datetime format 'yyyy-MM-ddTHH:mm:ssZ'. Example: 2020-02-19T16:05:00Z. - * - * @param minCreationTime the minCreationTime value to set. - * @return the ObjectReplicationPolicyFilter object itself. - */ - public ObjectReplicationPolicyFilter withMinCreationTime(String minCreationTime) { - this.minCreationTime = minCreationTime; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ObjectReplicationPolicyRule.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ObjectReplicationPolicyRule.java deleted file mode 100644 index cc06107943d8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ObjectReplicationPolicyRule.java +++ /dev/null @@ -1,146 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The replication policy rule between two containers. */ -@Fluent -public final class ObjectReplicationPolicyRule { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ObjectReplicationPolicyRule.class); - - /* - * Rule Id is auto-generated for each new rule on destination account. It - * is required for put policy on source account. - */ - @JsonProperty(value = "ruleId") - private String ruleId; - - /* - * Required. Source container name. - */ - @JsonProperty(value = "sourceContainer", required = true) - private String sourceContainer; - - /* - * Required. Destination container name. - */ - @JsonProperty(value = "destinationContainer", required = true) - private String destinationContainer; - - /* - * Optional. An object that defines the filter set. - */ - @JsonProperty(value = "filters") - private ObjectReplicationPolicyFilter filters; - - /** - * Get the ruleId property: Rule Id is auto-generated for each new rule on destination account. It is required for - * put policy on source account. - * - * @return the ruleId value. - */ - public String ruleId() { - return this.ruleId; - } - - /** - * Set the ruleId property: Rule Id is auto-generated for each new rule on destination account. It is required for - * put policy on source account. - * - * @param ruleId the ruleId value to set. - * @return the ObjectReplicationPolicyRule object itself. - */ - public ObjectReplicationPolicyRule withRuleId(String ruleId) { - this.ruleId = ruleId; - return this; - } - - /** - * Get the sourceContainer property: Required. Source container name. - * - * @return the sourceContainer value. - */ - public String sourceContainer() { - return this.sourceContainer; - } - - /** - * Set the sourceContainer property: Required. Source container name. - * - * @param sourceContainer the sourceContainer value to set. - * @return the ObjectReplicationPolicyRule object itself. - */ - public ObjectReplicationPolicyRule withSourceContainer(String sourceContainer) { - this.sourceContainer = sourceContainer; - return this; - } - - /** - * Get the destinationContainer property: Required. Destination container name. - * - * @return the destinationContainer value. - */ - public String destinationContainer() { - return this.destinationContainer; - } - - /** - * Set the destinationContainer property: Required. Destination container name. - * - * @param destinationContainer the destinationContainer value to set. - * @return the ObjectReplicationPolicyRule object itself. - */ - public ObjectReplicationPolicyRule withDestinationContainer(String destinationContainer) { - this.destinationContainer = destinationContainer; - return this; - } - - /** - * Get the filters property: Optional. An object that defines the filter set. - * - * @return the filters value. - */ - public ObjectReplicationPolicyFilter filters() { - return this.filters; - } - - /** - * Set the filters property: Optional. An object that defines the filter set. - * - * @param filters the filters value to set. - * @return the ObjectReplicationPolicyRule object itself. - */ - public ObjectReplicationPolicyRule withFilters(ObjectReplicationPolicyFilter filters) { - this.filters = filters; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (sourceContainer() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property sourceContainer in model ObjectReplicationPolicyRule")); - } - if (destinationContainer() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property destinationContainer in model ObjectReplicationPolicyRule")); - } - if (filters() != null) { - filters().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/OperationDisplay.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/OperationDisplay.java deleted file mode 100644 index 11ccd17f0ce3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/OperationDisplay.java +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Display metadata associated with the operation. */ -@Fluent -public final class OperationDisplay { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationDisplay.class); - - /* - * Service provider: Microsoft Storage. - */ - @JsonProperty(value = "provider") - private String provider; - - /* - * Resource on which the operation is performed etc. - */ - @JsonProperty(value = "resource") - private String resource; - - /* - * Type of operation: get, read, delete, etc. - */ - @JsonProperty(value = "operation") - private String operation; - - /* - * Description of the operation. - */ - @JsonProperty(value = "description") - private String description; - - /** - * Get the provider property: Service provider: Microsoft Storage. - * - * @return the provider value. - */ - public String provider() { - return this.provider; - } - - /** - * Set the provider property: Service provider: Microsoft Storage. - * - * @param provider the provider value to set. - * @return the OperationDisplay object itself. - */ - public OperationDisplay withProvider(String provider) { - this.provider = provider; - return this; - } - - /** - * Get the resource property: Resource on which the operation is performed etc. - * - * @return the resource value. - */ - public String resource() { - return this.resource; - } - - /** - * Set the resource property: Resource on which the operation is performed etc. - * - * @param resource the resource value to set. - * @return the OperationDisplay object itself. - */ - public OperationDisplay withResource(String resource) { - this.resource = resource; - return this; - } - - /** - * Get the operation property: Type of operation: get, read, delete, etc. - * - * @return the operation value. - */ - public String operation() { - return this.operation; - } - - /** - * Set the operation property: Type of operation: get, read, delete, etc. - * - * @param operation the operation value to set. - * @return the OperationDisplay object itself. - */ - public OperationDisplay withOperation(String operation) { - this.operation = operation; - return this; - } - - /** - * Get the description property: Description of the operation. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: Description of the operation. - * - * @param description the description value to set. - * @return the OperationDisplay object itself. - */ - public OperationDisplay withDescription(String description) { - this.description = description; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/OperationListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/OperationListResult.java deleted file mode 100644 index 929db96bb916..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/OperationListResult.java +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.storage.fluent.models.OperationInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** - * Result of the request to list Storage operations. It contains a list of operations and a URL link to get the next set - * of results. - */ -@Fluent -public final class OperationListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationListResult.class); - - /* - * List of Storage operations supported by the Storage resource provider. - */ - @JsonProperty(value = "value") - private List value; - - /** - * Get the value property: List of Storage operations supported by the Storage resource provider. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: List of Storage operations supported by the Storage resource provider. - * - * @param value the value value to set. - * @return the OperationListResult object itself. - */ - public OperationListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Permissions.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Permissions.java deleted file mode 100644 index 3cf6fb86e2ce..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Permissions.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for Permissions. */ -public final class Permissions extends ExpandableStringEnum { - /** Static value r for Permissions. */ - public static final Permissions R = fromString("r"); - - /** Static value d for Permissions. */ - public static final Permissions D = fromString("d"); - - /** Static value w for Permissions. */ - public static final Permissions W = fromString("w"); - - /** Static value l for Permissions. */ - public static final Permissions L = fromString("l"); - - /** Static value a for Permissions. */ - public static final Permissions A = fromString("a"); - - /** Static value c for Permissions. */ - public static final Permissions C = fromString("c"); - - /** Static value u for Permissions. */ - public static final Permissions U = fromString("u"); - - /** Static value p for Permissions. */ - public static final Permissions P = fromString("p"); - - /** - * Creates or finds a Permissions from its string representation. - * - * @param name a name to look for. - * @return the corresponding Permissions. - */ - @JsonCreator - public static Permissions fromString(String name) { - return fromString(name, Permissions.class); - } - - /** @return known Permissions values. */ - public static Collection values() { - return values(Permissions.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/PolicyRule.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/PolicyRule.java deleted file mode 100644 index a72c5e3cd7b3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/PolicyRule.java +++ /dev/null @@ -1,336 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.model.Attachable; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.resources.fluentcore.model.Settable; -import java.util.List; - -/** An immutable client-side representation of a rule in an Azure Management Policy. */ -@Fluent -public interface PolicyRule extends HasInnerModel { - /** @return the name of the rule */ - String name(); - - /** @return the type of the rule */ - RuleType type(); - - /** @return an unmodifiable list of the blob types this rule will apply for */ - List blobTypesToFilterFor(); - - /** @return an unmodifiable list of the prefixes of the blob types this rule will apply for */ - List prefixesToFilterFor(); - - /** @return an object describing the actions to take on the filtered base blobs in this rule */ - ManagementPolicyBaseBlob actionsOnBaseBlob(); - - /** @return an object describing the actions to take on the filtered snapshot in this rule */ - ManagementPolicySnapShot actionsOnSnapShot(); - - /** @return whether there is a tier to cool action specified for the filtered base blobs in this rule */ - boolean tierToCoolActionOnBaseBlobEnabled(); - - /** @return whether there is a tier to archive action specified for the filtered base blobs in this rule */ - boolean tierToArchiveActionOnBaseBlobEnabled(); - - /** @return whether there is a delete action specified for the filtered base blobs in this rule */ - boolean deleteActionOnBaseBlobEnabled(); - - /** @return whether there is a delete action specified for the filtered snapshots in this rule */ - boolean deleteActionOnSnapShotEnabled(); - - /** - * @return the number of days after a filtered base blob is last modified when the tier to cool action is enacted - */ - Float daysAfterBaseBlobModificationUntilCooling(); - - /** - * @return the number of days after a filtered base blob is last modified when the tier to archive action is enacted - */ - Float daysAfterBaseBlobModificationUntilArchiving(); - - /** @return the number of days after a filtered base blob is last modified when the delete action is enacted */ - Float daysAfterBaseBlobModificationUntilDeleting(); - - /** @return the number of days after a filtered snapshot is created when the delete action is enacted */ - Float daysAfterSnapShotCreationUntilDeleting(); - - /** Container interface for all of the definitions related to a rule in a management policy. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithPolicyRuleType, - DefinitionStages.WithBlobTypesToFilterFor, - DefinitionStages.PrefixActionFork, - DefinitionStages.WithPrefixesToFilterFor, - DefinitionStages.WithRuleActions, - DefinitionStages.WithPolicyRuleAttachable { - } - - /** Container interface for all of the updates related to a rule in a management policy. */ - interface Update - extends UpdateStages.WithBlobTypesToFilterFor, - UpdateStages.WithPrefixesToFilterFor, - UpdateStages.WithActions, - Settable { - } - - /** Grouping of management policy rule definition stages. */ - interface DefinitionStages { - /** The first stage of a management policy rule definition. */ - interface Blank extends WithPolicyRuleType { - } - - /** The stage of the management policy rule definition allowing to specify the type of the rule. */ - interface WithPolicyRuleType { - /** - * The function that specifies Lifecycle as the type of the management policy rule. - * - * @return the next stage of the management policy rule definition. - */ - WithBlobTypesToFilterFor withLifecycleRuleType(); - } - - /** - * The stage of the management policy rule definition allowing to specify the blob types that the rule will - * apply to. - */ - interface WithBlobTypesToFilterFor { - /** - * The function that specifies the list of blob types that the rule will apply to. - * - * @param blobTypes a list of the types of blob the rule will apply to. - * @return the next stage of the management policy rule definition. - */ - PrefixActionFork withBlobTypesToFilterFor(List blobTypes); - - /** - * The function that specifies a blob type that the rule will apply to. - * - * @param blobType a blob type that the rule will apply to. - * @return the next stage of the management policy rule definition. - */ - PrefixActionFork withBlobTypeToFilterFor(BlobTypes blobType); - } - - /** - * The stage of the management policy rule definition allowing input an optional blob prefix to filter for - * before specifying the actions. - */ - interface PrefixActionFork extends WithPrefixesToFilterFor, WithRuleActions { - } - - /** - * The stage of the management policy rule definition allowing the specify the prefixes for the blobs that the - * rule will apply to. - */ - interface WithPrefixesToFilterFor { - /** - * The function that specifies the list of prefixes for the blobs that the rule will apply to. - * - * @param prefixes a list of the prefixes for the blobs that the rule will apply to. - * @return the next stage of the management policy rule definition. - */ - WithRuleActions withPrefixesToFilterFor(List prefixes); - - /** - * The function that specifies a prefix for the blobs that the rule will apply to. - * - * @param prefix a prefix for the blobs that the rule will apply to. - * @return the next stage of the management policy rule definition. - */ - WithRuleActions withPrefixToFilterFor(String prefix); - } - - /** - * The stage of the management policy rule definition allowing to specify the actions to perform on the selected - * blobs. - */ - interface WithRuleActions { - /** - * The function that specifies a tier to cool action on the selected base blobs. - * - * @param daysAfterBaseBlobModificationUntilCooling the number of days after a base blob is last modified - * until it is cooled. - * @return the next stage of the management policy rule definition. - */ - WithPolicyRuleAttachable withTierToCoolActionOnBaseBlob(float daysAfterBaseBlobModificationUntilCooling); - - /** - * The function that specifies a tier to archive action on the selected base blobs. - * - * @param daysAfterBaseBlobModificationUntilArchiving the number of days after a base blob is last modified - * until it is archived. - * @return the next stage of the management policy rule definition. - */ - WithPolicyRuleAttachable withTierToArchiveActionOnBaseBlob( - float daysAfterBaseBlobModificationUntilArchiving); - - /** - * The function that specifies a delete action on the selected base blobs. - * - * @param daysAfterBaseBlobModificationUntilDeleting the number of days after a base blob is last modified - * until it is deleted. - * @return the next stage of the management policy rule definition. - */ - WithPolicyRuleAttachable withDeleteActionOnBaseBlob(float daysAfterBaseBlobModificationUntilDeleting); - - /** - * The function that specifies a delete action on the selected snapshots. - * - * @param daysAfterSnapShotCreationUntilDeleting the number of days after a snapshot is created until it is - * deleted. - * @return the next stage of the management policy rule definition - */ - WithPolicyRuleAttachable withDeleteActionOnSnapShot(float daysAfterSnapShotCreationUntilDeleting); - - /** - * The function that specifies all of the actions to apply to selected base blobs. - * - * @param baseBlobActions an object including all of the actions to apply to selected base blobs. - * @return the next stage of the management policy rule definition. - */ - WithPolicyRuleAttachable withActionsOnBaseBlob(ManagementPolicyBaseBlob baseBlobActions); - - /** - * The function that specifies all of the actions to apply to selected snapshots. - * - * @param snapShotActions an object including all of the actions to apply to selected snapshots. - * @return the next stage of the management policy rule definition. - */ - WithPolicyRuleAttachable withActionsOnSnapShot(ManagementPolicySnapShot snapShotActions); - } - - /** - * The stage of the definition which contains all of the minimum required inputs for the resource to be - * attached, but also allows for any other optional settings to be specified. - */ - interface WithPolicyRuleAttachable - extends PolicyRule.DefinitionStages.WithRuleActions, - PolicyRule.DefinitionStages.WithPrefixesToFilterFor, - Attachable { - } - } - - /** Grouping of management policy rule update stages. */ - interface UpdateStages { - /** - * The stage of the management policy rule update allowing to specify the blob types that the rule will apply - * to. - */ - interface WithBlobTypesToFilterFor { - /** - * The function that specifies the list of blob types that the rule will apply to. - * - * @param blobTypes a list of the types of blob the rule will apply to. - * @return the next stage of the management policy rule update. - */ - Update withBlobTypesToFilterFor(List blobTypes); - - /** - * The function that specifies a blob type that the rule will apply to. - * - * @param blobType a blob type that the rule will apply to. - * @return the next stage of the management policy rule update. - */ - Update withBlobTypeToFilterFor(BlobTypes blobType); - - /** - * The function that specifies to remove a blob type that the rule will apply to. - * - * @param blobType the blob type that you wish the rule to no longer apply to. - * @return the next stage of the management policy rule update. - */ - Update withBlobTypeToFilterForRemoved(BlobTypes blobType); - } - - /** - * THe stage of the management policy rule update allowing to specify the prefixes for the blobs that the rule - * will apply to. - */ - interface WithPrefixesToFilterFor { - /** - * The function that specifies the list of prefixes for the blobs that the rule will apply to. - * - * @param prefixes a list of the prefixes for the blobs that the rule will apply to. - * @return the next stage of the management policy rule update. - */ - Update withPrefixesToFilterFor(List prefixes); - - /** - * The function that specifies a prefix for the blobs that the rule will apply to. - * - * @param prefix a prefix for the blobs that the rule will apply to. - * @return the next stage of the management policy rule update. - */ - Update withPrefixToFilterFor(String prefix); - - /** - * The function that clears all blob prefixes so the rule will apply to blobs regardless of prefixes. - * - * @return the next stage of the management policy rule update. - */ - Update withoutPrefixesToFilterFor(); - } - - /** - * The stage of the management policy rule update allowing to specify the actions to perform on the selected - * blobs. - */ - interface WithActions { - /** - * The function that specifies a tier to cool action on the selected base blobs. - * - * @param daysAfterBaseBlobModificationUntilCooling the number of days after a base blob is last modified - * until it is cooled. - * @return the next stage of the management policy rule update. - */ - Update withTierToCoolActionOnBaseBlob(float daysAfterBaseBlobModificationUntilCooling); - - /** - * The function that specifies a tier to archive action on the selected base blobs. - * - * @param daysAfterBaseBlobModificationUntilArchiving the number of days after a base blob is last modified - * until it is archived. - * @return the next stage of the management policy rule update. - */ - Update withTierToArchiveActionOnBaseBlob(float daysAfterBaseBlobModificationUntilArchiving); - - /** - * The function that specifies a delete action on the selected base blobs. - * - * @param daysAfterBaseBlobModificationUntilDeleting the number of days after a base blob is last modified - * until it is deleted. - * @return the next stage of the management policy rule update. - */ - Update withDeleteActionOnBaseBlob(float daysAfterBaseBlobModificationUntilDeleting); - - /** - * The function that specifies a delete action on the selected snapshots. - * - * @param daysAfterSnapShotCreationUntilDeleting the number of days after a snapshot is created until it is - * deleted. - * @return the next stage of the management policy rule update - */ - Update withDeleteActionOnSnapShot(float daysAfterSnapShotCreationUntilDeleting); - - /** - * The function that specifies all of the actions to apply to selected base blobs. - * - * @param baseBlobActions an object including all of the actions to apply to selected base blobs. - * @return the next stage of the management policy rule update. - */ - Update updateActionsOnBaseBlob(ManagementPolicyBaseBlob baseBlobActions); - - /** - * The function that specifies all of the actions to apply to selected snapshots. - * - * @param snapShotActions an object including all of the actions to apply to selected snapshots. - * @return the next stage of the management policy rule update. - */ - Update updateActionsOnSnapShot(ManagementPolicySnapShot snapShotActions); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/PrivateEndpoint.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/PrivateEndpoint.java deleted file mode 100644 index 21792026a558..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/PrivateEndpoint.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The Private Endpoint resource. */ -@Immutable -public final class PrivateEndpoint { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpoint.class); - - /* - * The ARM identifier for Private Endpoint - */ - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) - private String id; - - /** - * Get the id property: The ARM identifier for Private Endpoint. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/PrivateEndpointConnectionListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/PrivateEndpointConnectionListResult.java deleted file mode 100644 index 34b75fa1920f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/PrivateEndpointConnectionListResult.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.storage.fluent.models.PrivateEndpointConnectionInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** List of private endpoint connection associated with the specified storage account. */ -@Fluent -public final class PrivateEndpointConnectionListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionListResult.class); - - /* - * Array of private endpoint connections - */ - @JsonProperty(value = "value") - private List value; - - /** - * Get the value property: Array of private endpoint connections. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Array of private endpoint connections. - * - * @param value the value value to set. - * @return the PrivateEndpointConnectionListResult object itself. - */ - public PrivateEndpointConnectionListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/PrivateEndpointConnectionProvisioningState.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/PrivateEndpointConnectionProvisioningState.java deleted file mode 100644 index 4b591b3089be..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/PrivateEndpointConnectionProvisioningState.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for PrivateEndpointConnectionProvisioningState. */ -public final class PrivateEndpointConnectionProvisioningState - extends ExpandableStringEnum { - /** Static value Succeeded for PrivateEndpointConnectionProvisioningState. */ - public static final PrivateEndpointConnectionProvisioningState SUCCEEDED = fromString("Succeeded"); - - /** Static value Creating for PrivateEndpointConnectionProvisioningState. */ - public static final PrivateEndpointConnectionProvisioningState CREATING = fromString("Creating"); - - /** Static value Deleting for PrivateEndpointConnectionProvisioningState. */ - public static final PrivateEndpointConnectionProvisioningState DELETING = fromString("Deleting"); - - /** Static value Failed for PrivateEndpointConnectionProvisioningState. */ - public static final PrivateEndpointConnectionProvisioningState FAILED = fromString("Failed"); - - /** - * Creates or finds a PrivateEndpointConnectionProvisioningState from its string representation. - * - * @param name a name to look for. - * @return the corresponding PrivateEndpointConnectionProvisioningState. - */ - @JsonCreator - public static PrivateEndpointConnectionProvisioningState fromString(String name) { - return fromString(name, PrivateEndpointConnectionProvisioningState.class); - } - - /** @return known PrivateEndpointConnectionProvisioningState values. */ - public static Collection values() { - return values(PrivateEndpointConnectionProvisioningState.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/PrivateEndpointServiceConnectionStatus.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/PrivateEndpointServiceConnectionStatus.java deleted file mode 100644 index 778056dbbe58..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/PrivateEndpointServiceConnectionStatus.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for PrivateEndpointServiceConnectionStatus. */ -public final class PrivateEndpointServiceConnectionStatus - extends ExpandableStringEnum { - /** Static value Pending for PrivateEndpointServiceConnectionStatus. */ - public static final PrivateEndpointServiceConnectionStatus PENDING = fromString("Pending"); - - /** Static value Approved for PrivateEndpointServiceConnectionStatus. */ - public static final PrivateEndpointServiceConnectionStatus APPROVED = fromString("Approved"); - - /** Static value Rejected for PrivateEndpointServiceConnectionStatus. */ - public static final PrivateEndpointServiceConnectionStatus REJECTED = fromString("Rejected"); - - /** - * Creates or finds a PrivateEndpointServiceConnectionStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding PrivateEndpointServiceConnectionStatus. - */ - @JsonCreator - public static PrivateEndpointServiceConnectionStatus fromString(String name) { - return fromString(name, PrivateEndpointServiceConnectionStatus.class); - } - - /** @return known PrivateEndpointServiceConnectionStatus values. */ - public static Collection values() { - return values(PrivateEndpointServiceConnectionStatus.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/PrivateLinkResource.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/PrivateLinkResource.java deleted file mode 100644 index 67096d1eb032..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/PrivateLinkResource.java +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.storage.fluent.models.PrivateLinkResourceProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** A private link resource. */ -@Fluent -public final class PrivateLinkResource extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkResource.class); - - /* - * Resource properties. - */ - @JsonProperty(value = "properties") - private PrivateLinkResourceProperties innerProperties; - - /** - * Get the innerProperties property: Resource properties. - * - * @return the innerProperties value. - */ - private PrivateLinkResourceProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the groupId property: The private link resource group id. - * - * @return the groupId value. - */ - public String groupId() { - return this.innerProperties() == null ? null : this.innerProperties().groupId(); - } - - /** - * Get the requiredMembers property: The private link resource required member names. - * - * @return the requiredMembers value. - */ - public List requiredMembers() { - return this.innerProperties() == null ? null : this.innerProperties().requiredMembers(); - } - - /** - * Get the requiredZoneNames property: The private link resource Private link DNS zone name. - * - * @return the requiredZoneNames value. - */ - public List requiredZoneNames() { - return this.innerProperties() == null ? null : this.innerProperties().requiredZoneNames(); - } - - /** - * Set the requiredZoneNames property: The private link resource Private link DNS zone name. - * - * @param requiredZoneNames the requiredZoneNames value to set. - * @return the PrivateLinkResource object itself. - */ - public PrivateLinkResource withRequiredZoneNames(List requiredZoneNames) { - if (this.innerProperties() == null) { - this.innerProperties = new PrivateLinkResourceProperties(); - } - this.innerProperties().withRequiredZoneNames(requiredZoneNames); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/PrivateLinkServiceConnectionState.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/PrivateLinkServiceConnectionState.java deleted file mode 100644 index ce329e943cd8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/PrivateLinkServiceConnectionState.java +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** A collection of information about the state of the connection between service consumer and provider. */ -@Fluent -public final class PrivateLinkServiceConnectionState { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkServiceConnectionState.class); - - /* - * Indicates whether the connection has been Approved/Rejected/Removed by - * the owner of the service. - */ - @JsonProperty(value = "status") - private PrivateEndpointServiceConnectionStatus status; - - /* - * The reason for approval/rejection of the connection. - */ - @JsonProperty(value = "description") - private String description; - - /* - * A message indicating if changes on the service provider require any - * updates on the consumer. - */ - @JsonProperty(value = "actionRequired") - private String actionRequired; - - /** - * Get the status property: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the - * service. - * - * @return the status value. - */ - public PrivateEndpointServiceConnectionStatus status() { - return this.status; - } - - /** - * Set the status property: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the - * service. - * - * @param status the status value to set. - * @return the PrivateLinkServiceConnectionState object itself. - */ - public PrivateLinkServiceConnectionState withStatus(PrivateEndpointServiceConnectionStatus status) { - this.status = status; - return this; - } - - /** - * Get the description property: The reason for approval/rejection of the connection. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: The reason for approval/rejection of the connection. - * - * @param description the description value to set. - * @return the PrivateLinkServiceConnectionState object itself. - */ - public PrivateLinkServiceConnectionState withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the actionRequired property: A message indicating if changes on the service provider require any updates on - * the consumer. - * - * @return the actionRequired value. - */ - public String actionRequired() { - return this.actionRequired; - } - - /** - * Set the actionRequired property: A message indicating if changes on the service provider require any updates on - * the consumer. - * - * @param actionRequired the actionRequired value to set. - * @return the PrivateLinkServiceConnectionState object itself. - */ - public PrivateLinkServiceConnectionState withActionRequired(String actionRequired) { - this.actionRequired = actionRequired; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ProvisioningState.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ProvisioningState.java deleted file mode 100644 index 3c1470e41bd7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ProvisioningState.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for ProvisioningState. */ -public enum ProvisioningState { - /** Enum value Creating. */ - CREATING("Creating"), - - /** Enum value ResolvingDNS. */ - RESOLVING_DNS("ResolvingDNS"), - - /** Enum value Succeeded. */ - SUCCEEDED("Succeeded"); - - /** The actual serialized value for a ProvisioningState instance. */ - private final String value; - - ProvisioningState(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a ProvisioningState instance. - * - * @param value the serialized value to parse. - * @return the parsed ProvisioningState object, or null if unable to parse. - */ - @JsonCreator - public static ProvisioningState fromString(String value) { - ProvisioningState[] items = ProvisioningState.values(); - for (ProvisioningState item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/PublicAccess.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/PublicAccess.java deleted file mode 100644 index 6e648af573a9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/PublicAccess.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for PublicAccess. */ -public enum PublicAccess { - /** Enum value Container. */ - CONTAINER("Container"), - - /** Enum value Blob. */ - BLOB("Blob"), - - /** Enum value None. */ - NONE("None"); - - /** The actual serialized value for a PublicAccess instance. */ - private final String value; - - PublicAccess(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a PublicAccess instance. - * - * @param value the serialized value to parse. - * @return the parsed PublicAccess object, or null if unable to parse. - */ - @JsonCreator - public static PublicAccess fromString(String value) { - PublicAccess[] items = PublicAccess.values(); - for (PublicAccess item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/PublicEndpoints.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/PublicEndpoints.java deleted file mode 100644 index 5397e88a9d4f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/PublicEndpoints.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.storage.models; - -/** - * An instance of this class stores the The URIs associated with a storage account that are used to perform a retrieval - * of a public blob, queue or table object. - */ -public class PublicEndpoints { - private final Endpoints primary; - private final Endpoints secondary; - - /** - * Creates an instance of PublicEndpoints with two access endpoints. - * - * @param primary the primary endpoint - * @param secondary the secondary endpoint - */ - public PublicEndpoints(Endpoints primary, Endpoints secondary) { - this.primary = primary; - this.secondary = secondary; - } - - /** - * @return the URLs that are used to perform a retrieval of a public blob, queue or table object.Note that - * StandardZRS and PremiumLRS accounts only return the blob endpoint. - */ - public Endpoints primary() { - return primary; - } - - /** - * @return the URLs that are used to perform a retrieval of a public blob, queue or table object from the secondary - * location of the storage account. Only available if the accountType is StandardRAGRS. - */ - public Endpoints secondary() { - return secondary; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Reason.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Reason.java deleted file mode 100644 index 339a582f0816..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Reason.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for Reason. */ -public enum Reason { - /** Enum value AccountNameInvalid. */ - ACCOUNT_NAME_INVALID("AccountNameInvalid"), - - /** Enum value AlreadyExists. */ - ALREADY_EXISTS("AlreadyExists"); - - /** The actual serialized value for a Reason instance. */ - private final String value; - - Reason(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a Reason instance. - * - * @param value the serialized value to parse. - * @return the parsed Reason object, or null if unable to parse. - */ - @JsonCreator - public static Reason fromString(String value) { - Reason[] items = Reason.values(); - for (Reason item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ReasonCode.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ReasonCode.java deleted file mode 100644 index 48faba8a0f0e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ReasonCode.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ReasonCode. */ -public final class ReasonCode extends ExpandableStringEnum { - /** Static value QuotaId for ReasonCode. */ - public static final ReasonCode QUOTA_ID = fromString("QuotaId"); - - /** Static value NotAvailableForSubscription for ReasonCode. */ - public static final ReasonCode NOT_AVAILABLE_FOR_SUBSCRIPTION = fromString("NotAvailableForSubscription"); - - /** - * Creates or finds a ReasonCode from its string representation. - * - * @param name a name to look for. - * @return the corresponding ReasonCode. - */ - @JsonCreator - public static ReasonCode fromString(String name) { - return fromString(name, ReasonCode.class); - } - - /** @return known ReasonCode values. */ - public static Collection values() { - return values(ReasonCode.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/RestorePolicyProperties.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/RestorePolicyProperties.java deleted file mode 100644 index c2aab1b102b6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/RestorePolicyProperties.java +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** The blob service properties for blob restore policy. */ -@Fluent -public final class RestorePolicyProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RestorePolicyProperties.class); - - /* - * Blob restore is enabled if set to true. - */ - @JsonProperty(value = "enabled", required = true) - private boolean enabled; - - /* - * how long this blob can be restored. It should be great than zero and - * less than DeleteRetentionPolicy.days. - */ - @JsonProperty(value = "days") - private Integer days; - - /* - * Deprecated in favor of minRestoreTime property. - */ - @JsonProperty(value = "lastEnabledTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime lastEnabledTime; - - /* - * Returns the minimum date and time that the restore can be started. - */ - @JsonProperty(value = "minRestoreTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime minRestoreTime; - - /** - * Get the enabled property: Blob restore is enabled if set to true. - * - * @return the enabled value. - */ - public boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Blob restore is enabled if set to true. - * - * @param enabled the enabled value to set. - * @return the RestorePolicyProperties object itself. - */ - public RestorePolicyProperties withEnabled(boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the days property: how long this blob can be restored. It should be great than zero and less than - * DeleteRetentionPolicy.days. - * - * @return the days value. - */ - public Integer days() { - return this.days; - } - - /** - * Set the days property: how long this blob can be restored. It should be great than zero and less than - * DeleteRetentionPolicy.days. - * - * @param days the days value to set. - * @return the RestorePolicyProperties object itself. - */ - public RestorePolicyProperties withDays(Integer days) { - this.days = days; - return this; - } - - /** - * Get the lastEnabledTime property: Deprecated in favor of minRestoreTime property. - * - * @return the lastEnabledTime value. - */ - public OffsetDateTime lastEnabledTime() { - return this.lastEnabledTime; - } - - /** - * Get the minRestoreTime property: Returns the minimum date and time that the restore can be started. - * - * @return the minRestoreTime value. - */ - public OffsetDateTime minRestoreTime() { - return this.minRestoreTime; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Restriction.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Restriction.java deleted file mode 100644 index a96fa4f22ae1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Restriction.java +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The restriction because of which SKU cannot be used. */ -@Fluent -public final class Restriction { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Restriction.class); - - /* - * The type of restrictions. As of now only possible value for this is - * location. - */ - @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) - private String type; - - /* - * The value of restrictions. If the restriction type is set to location. - * This would be different locations where the SKU is restricted. - */ - @JsonProperty(value = "values", access = JsonProperty.Access.WRITE_ONLY) - private List values; - - /* - * The reason for the restriction. As of now this can be "QuotaId" or - * "NotAvailableForSubscription". Quota Id is set when the SKU has - * requiredQuotas parameter as the subscription does not belong to that - * quota. The "NotAvailableForSubscription" is related to capacity at DC. - */ - @JsonProperty(value = "reasonCode") - private ReasonCode reasonCode; - - /** - * Get the type property: The type of restrictions. As of now only possible value for this is location. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Get the values property: The value of restrictions. If the restriction type is set to location. This would be - * different locations where the SKU is restricted. - * - * @return the values value. - */ - public List values() { - return this.values; - } - - /** - * Get the reasonCode property: The reason for the restriction. As of now this can be "QuotaId" or - * "NotAvailableForSubscription". Quota Id is set when the SKU has requiredQuotas parameter as the subscription does - * not belong to that quota. The "NotAvailableForSubscription" is related to capacity at DC. - * - * @return the reasonCode value. - */ - public ReasonCode reasonCode() { - return this.reasonCode; - } - - /** - * Set the reasonCode property: The reason for the restriction. As of now this can be "QuotaId" or - * "NotAvailableForSubscription". Quota Id is set when the SKU has requiredQuotas parameter as the subscription does - * not belong to that quota. The "NotAvailableForSubscription" is related to capacity at DC. - * - * @param reasonCode the reasonCode value to set. - * @return the Restriction object itself. - */ - public Restriction withReasonCode(ReasonCode reasonCode) { - this.reasonCode = reasonCode; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/RootSquashType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/RootSquashType.java deleted file mode 100644 index 9c42897c3e07..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/RootSquashType.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for RootSquashType. */ -public final class RootSquashType extends ExpandableStringEnum { - /** Static value NoRootSquash for RootSquashType. */ - public static final RootSquashType NO_ROOT_SQUASH = fromString("NoRootSquash"); - - /** Static value RootSquash for RootSquashType. */ - public static final RootSquashType ROOT_SQUASH = fromString("RootSquash"); - - /** Static value AllSquash for RootSquashType. */ - public static final RootSquashType ALL_SQUASH = fromString("AllSquash"); - - /** - * Creates or finds a RootSquashType from its string representation. - * - * @param name a name to look for. - * @return the corresponding RootSquashType. - */ - @JsonCreator - public static RootSquashType fromString(String name) { - return fromString(name, RootSquashType.class); - } - - /** @return known RootSquashType values. */ - public static Collection values() { - return values(RootSquashType.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/RoutingChoice.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/RoutingChoice.java deleted file mode 100644 index 85f5780818e5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/RoutingChoice.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for RoutingChoice. */ -public final class RoutingChoice extends ExpandableStringEnum { - /** Static value MicrosoftRouting for RoutingChoice. */ - public static final RoutingChoice MICROSOFT_ROUTING = fromString("MicrosoftRouting"); - - /** Static value InternetRouting for RoutingChoice. */ - public static final RoutingChoice INTERNET_ROUTING = fromString("InternetRouting"); - - /** - * Creates or finds a RoutingChoice from its string representation. - * - * @param name a name to look for. - * @return the corresponding RoutingChoice. - */ - @JsonCreator - public static RoutingChoice fromString(String name) { - return fromString(name, RoutingChoice.class); - } - - /** @return known RoutingChoice values. */ - public static Collection values() { - return values(RoutingChoice.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/RoutingPreference.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/RoutingPreference.java deleted file mode 100644 index 592d1ee099ed..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/RoutingPreference.java +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Routing preference defines the type of network, either microsoft or internet routing to be used to deliver the user - * data, the default option is microsoft routing. - */ -@Fluent -public final class RoutingPreference { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RoutingPreference.class); - - /* - * Routing Choice defines the kind of network routing opted by the user. - */ - @JsonProperty(value = "routingChoice") - private RoutingChoice routingChoice; - - /* - * A boolean flag which indicates whether microsoft routing storage - * endpoints are to be published - */ - @JsonProperty(value = "publishMicrosoftEndpoints") - private Boolean publishMicrosoftEndpoints; - - /* - * A boolean flag which indicates whether internet routing storage - * endpoints are to be published - */ - @JsonProperty(value = "publishInternetEndpoints") - private Boolean publishInternetEndpoints; - - /** - * Get the routingChoice property: Routing Choice defines the kind of network routing opted by the user. - * - * @return the routingChoice value. - */ - public RoutingChoice routingChoice() { - return this.routingChoice; - } - - /** - * Set the routingChoice property: Routing Choice defines the kind of network routing opted by the user. - * - * @param routingChoice the routingChoice value to set. - * @return the RoutingPreference object itself. - */ - public RoutingPreference withRoutingChoice(RoutingChoice routingChoice) { - this.routingChoice = routingChoice; - return this; - } - - /** - * Get the publishMicrosoftEndpoints property: A boolean flag which indicates whether microsoft routing storage - * endpoints are to be published. - * - * @return the publishMicrosoftEndpoints value. - */ - public Boolean publishMicrosoftEndpoints() { - return this.publishMicrosoftEndpoints; - } - - /** - * Set the publishMicrosoftEndpoints property: A boolean flag which indicates whether microsoft routing storage - * endpoints are to be published. - * - * @param publishMicrosoftEndpoints the publishMicrosoftEndpoints value to set. - * @return the RoutingPreference object itself. - */ - public RoutingPreference withPublishMicrosoftEndpoints(Boolean publishMicrosoftEndpoints) { - this.publishMicrosoftEndpoints = publishMicrosoftEndpoints; - return this; - } - - /** - * Get the publishInternetEndpoints property: A boolean flag which indicates whether internet routing storage - * endpoints are to be published. - * - * @return the publishInternetEndpoints value. - */ - public Boolean publishInternetEndpoints() { - return this.publishInternetEndpoints; - } - - /** - * Set the publishInternetEndpoints property: A boolean flag which indicates whether internet routing storage - * endpoints are to be published. - * - * @param publishInternetEndpoints the publishInternetEndpoints value to set. - * @return the RoutingPreference object itself. - */ - public RoutingPreference withPublishInternetEndpoints(Boolean publishInternetEndpoints) { - this.publishInternetEndpoints = publishInternetEndpoints; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/RuleType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/RuleType.java deleted file mode 100644 index 18de5872c543..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/RuleType.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for RuleType. */ -public final class RuleType extends ExpandableStringEnum { - /** Static value Lifecycle for RuleType. */ - public static final RuleType LIFECYCLE = fromString("Lifecycle"); - - /** - * Creates or finds a RuleType from its string representation. - * - * @param name a name to look for. - * @return the corresponding RuleType. - */ - @JsonCreator - public static RuleType fromString(String name) { - return fromString(name, RuleType.class); - } - - /** @return known RuleType values. */ - public static Collection values() { - return values(RuleType.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ServiceSasParameters.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ServiceSasParameters.java deleted file mode 100644 index 814d9b24b033..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ServiceSasParameters.java +++ /dev/null @@ -1,509 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** The parameters to list service SAS credentials of a specific resource. */ -@Fluent -public final class ServiceSasParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceSasParameters.class); - - /* - * The canonical path to the signed resource. - */ - @JsonProperty(value = "canonicalizedResource", required = true) - private String canonicalizedResource; - - /* - * The signed services accessible with the service SAS. Possible values - * include: Blob (b), Container (c), File (f), Share (s). - */ - @JsonProperty(value = "signedResource") - private SignedResource resource; - - /* - * The signed permissions for the service SAS. Possible values include: - * Read (r), Write (w), Delete (d), List (l), Add (a), Create (c), Update - * (u) and Process (p). - */ - @JsonProperty(value = "signedPermission") - private Permissions permissions; - - /* - * An IP address or a range of IP addresses from which to accept requests. - */ - @JsonProperty(value = "signedIp") - private String ipAddressOrRange; - - /* - * The protocol permitted for a request made with the account SAS. - */ - @JsonProperty(value = "signedProtocol") - private HttpProtocol protocols; - - /* - * The time at which the SAS becomes valid. - */ - @JsonProperty(value = "signedStart") - private OffsetDateTime sharedAccessStartTime; - - /* - * The time at which the shared access signature becomes invalid. - */ - @JsonProperty(value = "signedExpiry") - private OffsetDateTime sharedAccessExpiryTime; - - /* - * A unique value up to 64 characters in length that correlates to an - * access policy specified for the container, queue, or table. - */ - @JsonProperty(value = "signedIdentifier") - private String identifier; - - /* - * The start of partition key. - */ - @JsonProperty(value = "startPk") - private String partitionKeyStart; - - /* - * The end of partition key. - */ - @JsonProperty(value = "endPk") - private String partitionKeyEnd; - - /* - * The start of row key. - */ - @JsonProperty(value = "startRk") - private String rowKeyStart; - - /* - * The end of row key. - */ - @JsonProperty(value = "endRk") - private String rowKeyEnd; - - /* - * The key to sign the account SAS token with. - */ - @JsonProperty(value = "keyToSign") - private String keyToSign; - - /* - * The response header override for cache control. - */ - @JsonProperty(value = "rscc") - private String cacheControl; - - /* - * The response header override for content disposition. - */ - @JsonProperty(value = "rscd") - private String contentDisposition; - - /* - * The response header override for content encoding. - */ - @JsonProperty(value = "rsce") - private String contentEncoding; - - /* - * The response header override for content language. - */ - @JsonProperty(value = "rscl") - private String contentLanguage; - - /* - * The response header override for content type. - */ - @JsonProperty(value = "rsct") - private String contentType; - - /** - * Get the canonicalizedResource property: The canonical path to the signed resource. - * - * @return the canonicalizedResource value. - */ - public String canonicalizedResource() { - return this.canonicalizedResource; - } - - /** - * Set the canonicalizedResource property: The canonical path to the signed resource. - * - * @param canonicalizedResource the canonicalizedResource value to set. - * @return the ServiceSasParameters object itself. - */ - public ServiceSasParameters withCanonicalizedResource(String canonicalizedResource) { - this.canonicalizedResource = canonicalizedResource; - return this; - } - - /** - * Get the resource property: The signed services accessible with the service SAS. Possible values include: Blob - * (b), Container (c), File (f), Share (s). - * - * @return the resource value. - */ - public SignedResource resource() { - return this.resource; - } - - /** - * Set the resource property: The signed services accessible with the service SAS. Possible values include: Blob - * (b), Container (c), File (f), Share (s). - * - * @param resource the resource value to set. - * @return the ServiceSasParameters object itself. - */ - public ServiceSasParameters withResource(SignedResource resource) { - this.resource = resource; - return this; - } - - /** - * Get the permissions property: The signed permissions for the service SAS. Possible values include: Read (r), - * Write (w), Delete (d), List (l), Add (a), Create (c), Update (u) and Process (p). - * - * @return the permissions value. - */ - public Permissions permissions() { - return this.permissions; - } - - /** - * Set the permissions property: The signed permissions for the service SAS. Possible values include: Read (r), - * Write (w), Delete (d), List (l), Add (a), Create (c), Update (u) and Process (p). - * - * @param permissions the permissions value to set. - * @return the ServiceSasParameters object itself. - */ - public ServiceSasParameters withPermissions(Permissions permissions) { - this.permissions = permissions; - return this; - } - - /** - * Get the ipAddressOrRange property: An IP address or a range of IP addresses from which to accept requests. - * - * @return the ipAddressOrRange value. - */ - public String ipAddressOrRange() { - return this.ipAddressOrRange; - } - - /** - * Set the ipAddressOrRange property: An IP address or a range of IP addresses from which to accept requests. - * - * @param ipAddressOrRange the ipAddressOrRange value to set. - * @return the ServiceSasParameters object itself. - */ - public ServiceSasParameters withIpAddressOrRange(String ipAddressOrRange) { - this.ipAddressOrRange = ipAddressOrRange; - return this; - } - - /** - * Get the protocols property: The protocol permitted for a request made with the account SAS. - * - * @return the protocols value. - */ - public HttpProtocol protocols() { - return this.protocols; - } - - /** - * Set the protocols property: The protocol permitted for a request made with the account SAS. - * - * @param protocols the protocols value to set. - * @return the ServiceSasParameters object itself. - */ - public ServiceSasParameters withProtocols(HttpProtocol protocols) { - this.protocols = protocols; - return this; - } - - /** - * Get the sharedAccessStartTime property: The time at which the SAS becomes valid. - * - * @return the sharedAccessStartTime value. - */ - public OffsetDateTime sharedAccessStartTime() { - return this.sharedAccessStartTime; - } - - /** - * Set the sharedAccessStartTime property: The time at which the SAS becomes valid. - * - * @param sharedAccessStartTime the sharedAccessStartTime value to set. - * @return the ServiceSasParameters object itself. - */ - public ServiceSasParameters withSharedAccessStartTime(OffsetDateTime sharedAccessStartTime) { - this.sharedAccessStartTime = sharedAccessStartTime; - return this; - } - - /** - * Get the sharedAccessExpiryTime property: The time at which the shared access signature becomes invalid. - * - * @return the sharedAccessExpiryTime value. - */ - public OffsetDateTime sharedAccessExpiryTime() { - return this.sharedAccessExpiryTime; - } - - /** - * Set the sharedAccessExpiryTime property: The time at which the shared access signature becomes invalid. - * - * @param sharedAccessExpiryTime the sharedAccessExpiryTime value to set. - * @return the ServiceSasParameters object itself. - */ - public ServiceSasParameters withSharedAccessExpiryTime(OffsetDateTime sharedAccessExpiryTime) { - this.sharedAccessExpiryTime = sharedAccessExpiryTime; - return this; - } - - /** - * Get the identifier property: A unique value up to 64 characters in length that correlates to an access policy - * specified for the container, queue, or table. - * - * @return the identifier value. - */ - public String identifier() { - return this.identifier; - } - - /** - * Set the identifier property: A unique value up to 64 characters in length that correlates to an access policy - * specified for the container, queue, or table. - * - * @param identifier the identifier value to set. - * @return the ServiceSasParameters object itself. - */ - public ServiceSasParameters withIdentifier(String identifier) { - this.identifier = identifier; - return this; - } - - /** - * Get the partitionKeyStart property: The start of partition key. - * - * @return the partitionKeyStart value. - */ - public String partitionKeyStart() { - return this.partitionKeyStart; - } - - /** - * Set the partitionKeyStart property: The start of partition key. - * - * @param partitionKeyStart the partitionKeyStart value to set. - * @return the ServiceSasParameters object itself. - */ - public ServiceSasParameters withPartitionKeyStart(String partitionKeyStart) { - this.partitionKeyStart = partitionKeyStart; - return this; - } - - /** - * Get the partitionKeyEnd property: The end of partition key. - * - * @return the partitionKeyEnd value. - */ - public String partitionKeyEnd() { - return this.partitionKeyEnd; - } - - /** - * Set the partitionKeyEnd property: The end of partition key. - * - * @param partitionKeyEnd the partitionKeyEnd value to set. - * @return the ServiceSasParameters object itself. - */ - public ServiceSasParameters withPartitionKeyEnd(String partitionKeyEnd) { - this.partitionKeyEnd = partitionKeyEnd; - return this; - } - - /** - * Get the rowKeyStart property: The start of row key. - * - * @return the rowKeyStart value. - */ - public String rowKeyStart() { - return this.rowKeyStart; - } - - /** - * Set the rowKeyStart property: The start of row key. - * - * @param rowKeyStart the rowKeyStart value to set. - * @return the ServiceSasParameters object itself. - */ - public ServiceSasParameters withRowKeyStart(String rowKeyStart) { - this.rowKeyStart = rowKeyStart; - return this; - } - - /** - * Get the rowKeyEnd property: The end of row key. - * - * @return the rowKeyEnd value. - */ - public String rowKeyEnd() { - return this.rowKeyEnd; - } - - /** - * Set the rowKeyEnd property: The end of row key. - * - * @param rowKeyEnd the rowKeyEnd value to set. - * @return the ServiceSasParameters object itself. - */ - public ServiceSasParameters withRowKeyEnd(String rowKeyEnd) { - this.rowKeyEnd = rowKeyEnd; - return this; - } - - /** - * Get the keyToSign property: The key to sign the account SAS token with. - * - * @return the keyToSign value. - */ - public String keyToSign() { - return this.keyToSign; - } - - /** - * Set the keyToSign property: The key to sign the account SAS token with. - * - * @param keyToSign the keyToSign value to set. - * @return the ServiceSasParameters object itself. - */ - public ServiceSasParameters withKeyToSign(String keyToSign) { - this.keyToSign = keyToSign; - return this; - } - - /** - * Get the cacheControl property: The response header override for cache control. - * - * @return the cacheControl value. - */ - public String cacheControl() { - return this.cacheControl; - } - - /** - * Set the cacheControl property: The response header override for cache control. - * - * @param cacheControl the cacheControl value to set. - * @return the ServiceSasParameters object itself. - */ - public ServiceSasParameters withCacheControl(String cacheControl) { - this.cacheControl = cacheControl; - return this; - } - - /** - * Get the contentDisposition property: The response header override for content disposition. - * - * @return the contentDisposition value. - */ - public String contentDisposition() { - return this.contentDisposition; - } - - /** - * Set the contentDisposition property: The response header override for content disposition. - * - * @param contentDisposition the contentDisposition value to set. - * @return the ServiceSasParameters object itself. - */ - public ServiceSasParameters withContentDisposition(String contentDisposition) { - this.contentDisposition = contentDisposition; - return this; - } - - /** - * Get the contentEncoding property: The response header override for content encoding. - * - * @return the contentEncoding value. - */ - public String contentEncoding() { - return this.contentEncoding; - } - - /** - * Set the contentEncoding property: The response header override for content encoding. - * - * @param contentEncoding the contentEncoding value to set. - * @return the ServiceSasParameters object itself. - */ - public ServiceSasParameters withContentEncoding(String contentEncoding) { - this.contentEncoding = contentEncoding; - return this; - } - - /** - * Get the contentLanguage property: The response header override for content language. - * - * @return the contentLanguage value. - */ - public String contentLanguage() { - return this.contentLanguage; - } - - /** - * Set the contentLanguage property: The response header override for content language. - * - * @param contentLanguage the contentLanguage value to set. - * @return the ServiceSasParameters object itself. - */ - public ServiceSasParameters withContentLanguage(String contentLanguage) { - this.contentLanguage = contentLanguage; - return this; - } - - /** - * Get the contentType property: The response header override for content type. - * - * @return the contentType value. - */ - public String contentType() { - return this.contentType; - } - - /** - * Set the contentType property: The response header override for content type. - * - * @param contentType the contentType value to set. - * @return the ServiceSasParameters object itself. - */ - public ServiceSasParameters withContentType(String contentType) { - this.contentType = contentType; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (canonicalizedResource() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property canonicalizedResource in model ServiceSasParameters")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ServiceSpecification.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ServiceSpecification.java deleted file mode 100644 index 48b7fc8fd76c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ServiceSpecification.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** One property of operation, include metric specifications. */ -@Fluent -public final class ServiceSpecification { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceSpecification.class); - - /* - * Metric specifications of operation. - */ - @JsonProperty(value = "metricSpecifications") - private List metricSpecifications; - - /** - * Get the metricSpecifications property: Metric specifications of operation. - * - * @return the metricSpecifications value. - */ - public List metricSpecifications() { - return this.metricSpecifications; - } - - /** - * Set the metricSpecifications property: Metric specifications of operation. - * - * @param metricSpecifications the metricSpecifications value to set. - * @return the ServiceSpecification object itself. - */ - public ServiceSpecification withMetricSpecifications(List metricSpecifications) { - this.metricSpecifications = metricSpecifications; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (metricSpecifications() != null) { - metricSpecifications().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Services.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Services.java deleted file mode 100644 index 0a3e1fefd210..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Services.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for Services. */ -public final class Services extends ExpandableStringEnum { - /** Static value b for Services. */ - public static final Services B = fromString("b"); - - /** Static value q for Services. */ - public static final Services Q = fromString("q"); - - /** Static value t for Services. */ - public static final Services T = fromString("t"); - - /** Static value f for Services. */ - public static final Services F = fromString("f"); - - /** - * Creates or finds a Services from its string representation. - * - * @param name a name to look for. - * @return the corresponding Services. - */ - @JsonCreator - public static Services fromString(String name) { - return fromString(name, Services.class); - } - - /** @return known Services values. */ - public static Collection values() { - return values(Services.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ShareAccessTier.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ShareAccessTier.java deleted file mode 100644 index d4fdc46d147c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ShareAccessTier.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ShareAccessTier. */ -public final class ShareAccessTier extends ExpandableStringEnum { - /** Static value TransactionOptimized for ShareAccessTier. */ - public static final ShareAccessTier TRANSACTION_OPTIMIZED = fromString("TransactionOptimized"); - - /** Static value Hot for ShareAccessTier. */ - public static final ShareAccessTier HOT = fromString("Hot"); - - /** Static value Cool for ShareAccessTier. */ - public static final ShareAccessTier COOL = fromString("Cool"); - - /** Static value Premium for ShareAccessTier. */ - public static final ShareAccessTier PREMIUM = fromString("Premium"); - - /** - * Creates or finds a ShareAccessTier from its string representation. - * - * @param name a name to look for. - * @return the corresponding ShareAccessTier. - */ - @JsonCreator - public static ShareAccessTier fromString(String name) { - return fromString(name, ShareAccessTier.class); - } - - /** @return known ShareAccessTier values. */ - public static Collection values() { - return values(ShareAccessTier.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/SignedResource.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/SignedResource.java deleted file mode 100644 index 593bec7f9ece..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/SignedResource.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for SignedResource. */ -public final class SignedResource extends ExpandableStringEnum { - /** Static value b for SignedResource. */ - public static final SignedResource B = fromString("b"); - - /** Static value c for SignedResource. */ - public static final SignedResource C = fromString("c"); - - /** Static value f for SignedResource. */ - public static final SignedResource F = fromString("f"); - - /** Static value s for SignedResource. */ - public static final SignedResource S = fromString("s"); - - /** - * Creates or finds a SignedResource from its string representation. - * - * @param name a name to look for. - * @return the corresponding SignedResource. - */ - @JsonCreator - public static SignedResource fromString(String name) { - return fromString(name, SignedResource.class); - } - - /** @return known SignedResource values. */ - public static Collection values() { - return values(SignedResource.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/SignedResourceTypes.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/SignedResourceTypes.java deleted file mode 100644 index cc4d3d42a6f2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/SignedResourceTypes.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for SignedResourceTypes. */ -public final class SignedResourceTypes extends ExpandableStringEnum { - /** Static value s for SignedResourceTypes. */ - public static final SignedResourceTypes S = fromString("s"); - - /** Static value c for SignedResourceTypes. */ - public static final SignedResourceTypes C = fromString("c"); - - /** Static value o for SignedResourceTypes. */ - public static final SignedResourceTypes O = fromString("o"); - - /** - * Creates or finds a SignedResourceTypes from its string representation. - * - * @param name a name to look for. - * @return the corresponding SignedResourceTypes. - */ - @JsonCreator - public static SignedResourceTypes fromString(String name) { - return fromString(name, SignedResourceTypes.class); - } - - /** @return known SignedResourceTypes values. */ - public static Collection values() { - return values(SignedResourceTypes.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Sku.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Sku.java deleted file mode 100644 index b9d202213ef0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Sku.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The SKU of the storage account. */ -@Fluent -public final class Sku { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Sku.class); - - /* - * The SKU name. Required for account creation; optional for update. Note - * that in older versions, SKU name was called accountType. - */ - @JsonProperty(value = "name", required = true) - private SkuName name; - - /* - * The SKU tier. This is based on the SKU name. - */ - @JsonProperty(value = "tier", access = JsonProperty.Access.WRITE_ONLY) - private SkuTier tier; - - /** - * Get the name property: The SKU name. Required for account creation; optional for update. Note that in older - * versions, SKU name was called accountType. - * - * @return the name value. - */ - public SkuName name() { - return this.name; - } - - /** - * Set the name property: The SKU name. Required for account creation; optional for update. Note that in older - * versions, SKU name was called accountType. - * - * @param name the name value to set. - * @return the Sku object itself. - */ - public Sku withName(SkuName name) { - this.name = name; - return this; - } - - /** - * Get the tier property: The SKU tier. This is based on the SKU name. - * - * @return the tier value. - */ - public SkuTier tier() { - return this.tier; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() == null) { - throw logger - .logExceptionAsError(new IllegalArgumentException("Missing required property name in model Sku")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/SkuCapability.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/SkuCapability.java deleted file mode 100644 index 525c5ee288dc..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/SkuCapability.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * The capability information in the specified SKU, including file encryption, network ACLs, change notification, etc. - */ -@Immutable -public final class SkuCapability { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SkuCapability.class); - - /* - * The name of capability, The capability information in the specified SKU, - * including file encryption, network ACLs, change notification, etc. - */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) - private String name; - - /* - * A string value to indicate states of given capability. Possibly 'true' - * or 'false'. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private String value; - - /** - * Get the name property: The name of capability, The capability information in the specified SKU, including file - * encryption, network ACLs, change notification, etc. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the value property: A string value to indicate states of given capability. Possibly 'true' or 'false'. - * - * @return the value value. - */ - public String value() { - return this.value; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/SkuName.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/SkuName.java deleted file mode 100644 index f170ce68a174..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/SkuName.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for SkuName. */ -public final class SkuName extends ExpandableStringEnum { - /** Static value Standard_LRS for SkuName. */ - public static final SkuName STANDARD_LRS = fromString("Standard_LRS"); - - /** Static value Standard_GRS for SkuName. */ - public static final SkuName STANDARD_GRS = fromString("Standard_GRS"); - - /** Static value Standard_RAGRS for SkuName. */ - public static final SkuName STANDARD_RAGRS = fromString("Standard_RAGRS"); - - /** Static value Standard_ZRS for SkuName. */ - public static final SkuName STANDARD_ZRS = fromString("Standard_ZRS"); - - /** Static value Premium_LRS for SkuName. */ - public static final SkuName PREMIUM_LRS = fromString("Premium_LRS"); - - /** Static value Premium_ZRS for SkuName. */ - public static final SkuName PREMIUM_ZRS = fromString("Premium_ZRS"); - - /** Static value Standard_GZRS for SkuName. */ - public static final SkuName STANDARD_GZRS = fromString("Standard_GZRS"); - - /** Static value Standard_RAGZRS for SkuName. */ - public static final SkuName STANDARD_RAGZRS = fromString("Standard_RAGZRS"); - - /** - * Creates or finds a SkuName from its string representation. - * - * @param name a name to look for. - * @return the corresponding SkuName. - */ - @JsonCreator - public static SkuName fromString(String name) { - return fromString(name, SkuName.class); - } - - /** @return known SkuName values. */ - public static Collection values() { - return values(SkuName.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/SkuTier.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/SkuTier.java deleted file mode 100644 index bcf16777d068..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/SkuTier.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for SkuTier. */ -public enum SkuTier { - /** Enum value Standard. */ - STANDARD("Standard"), - - /** Enum value Premium. */ - PREMIUM("Premium"); - - /** The actual serialized value for a SkuTier instance. */ - private final String value; - - SkuTier(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a SkuTier instance. - * - * @param value the serialized value to parse. - * @return the parsed SkuTier object, or null if unable to parse. - */ - @JsonCreator - public static SkuTier fromString(String value) { - SkuTier[] items = SkuTier.values(); - for (SkuTier item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/State.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/State.java deleted file mode 100644 index f4d9ce1e95bc..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/State.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for State. */ -public enum State { - /** Enum value provisioning. */ - PROVISIONING("provisioning"), - - /** Enum value deprovisioning. */ - DEPROVISIONING("deprovisioning"), - - /** Enum value succeeded. */ - SUCCEEDED("succeeded"), - - /** Enum value failed. */ - FAILED("failed"), - - /** Enum value networkSourceDeleted. */ - NETWORK_SOURCE_DELETED("networkSourceDeleted"); - - /** The actual serialized value for a State instance. */ - private final String value; - - State(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a State instance. - * - * @param value the serialized value to parse. - * @return the parsed State object, or null if unable to parse. - */ - @JsonCreator - public static State fromString(String value) { - State[] items = State.values(); - for (State item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccount.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccount.java deleted file mode 100644 index fcc95d096c4b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccount.java +++ /dev/null @@ -1,911 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.arm.models.GroupableResource; -import com.azure.resourcemanager.resources.fluentcore.arm.models.Resource; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListingPrivateEndpointConnection; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListingPrivateLinkResource; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsUpdatingPrivateEndpointConnection; -import com.azure.resourcemanager.resources.fluentcore.model.Appliable; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; -import com.azure.resourcemanager.resources.fluentcore.model.Updatable; -import com.azure.resourcemanager.storage.StorageManager; -import com.azure.resourcemanager.storage.fluent.models.StorageAccountInner; -import java.time.OffsetDateTime; -import java.util.List; -import java.util.Map; -import reactor.core.publisher.Mono; - -/** An immutable client-side representation of an Azure storage account. */ -@Fluent -public interface StorageAccount - extends GroupableResource, - Refreshable, - Updatable, - SupportsListingPrivateLinkResource, - SupportsListingPrivateEndpointConnection, - SupportsUpdatingPrivateEndpointConnection { - - /** - * @return the status indicating whether the primary and secondary location of the storage account is available or - * unavailable. Possible values include: 'Available', 'Unavailable' - */ - AccountStatuses accountStatuses(); - - /** @return the sku of this storage account. */ - StorageAccountSkuType skuType(); - - /** @return the kind of the storage account. Possible values are 'Storage', 'BlobStorage'. */ - Kind kind(); - - /** @return the creation date and time of the storage account in UTC */ - OffsetDateTime creationTime(); - - /** @return the user assigned custom domain assigned to this storage account */ - CustomDomain customDomain(); - - /** - * @return the timestamp of the most recent instance of a failover to the secondary location. Only the most recent - * timestamp is retained. This element is not returned if there has never been a failover instance. Only - * available if the accountType is StandardGRS or StandardRAGRS - */ - OffsetDateTime lastGeoFailoverTime(); - - /** - * @return the status of the storage account at the time the operation was called. Possible values include: - * 'Creating', 'ResolvingDNS', 'Succeeded' - */ - ProvisioningState provisioningState(); - - /** - * @return the URLs that are used to perform a retrieval of a public blob, queue or table object. Note that - * StandardZRS and PremiumLRS accounts only return the blob endpoint - */ - PublicEndpoints endPoints(); - - /** @return the source of the key used for encryption. */ - StorageAccountEncryptionKeySource encryptionKeySource(); - - /** @return the encryption statuses indexed by storage service type. */ - Map encryptionStatuses(); - - /** @return whether infrastructure encryption for Azure Storage data is enabled. */ - boolean infrastructureEncryptionEnabled(); - - /** - * @return access tier used for billing. Access tier cannot be changed more than once every 7 days (168 hours). - * Access tier cannot be set for StandardLRS, StandardGRS, StandardRAGRS, or PremiumLRS account types. Possible - * values include: 'Hot', 'Cool'. - */ - AccessTier accessTier(); - - /** @return the Managed Service Identity specific Active Directory tenant ID assigned to the storage account. */ - String systemAssignedManagedServiceIdentityTenantId(); - - /** - * @return the Managed Service Identity specific Active Directory service principal ID assigned to the storage - * account. - */ - String systemAssignedManagedServiceIdentityPrincipalId(); - - /** - * @return true if authenticated application from any network is allowed to access the storage account, false if - * only application from allowlisted network (subnet, ip address, ip address range) can access the storage - * account. - */ - boolean isAccessAllowedFromAllNetworks(); - - /** @return the list of resource id of virtual network subnet having access to the storage account. */ - List networkSubnetsWithAccess(); - - /** @return the list of ip addresses having access to the storage account. */ - List ipAddressesWithAccess(); - - /** @return the list of ip address ranges having access to the storage account. */ - List ipAddressRangesWithAccess(); - - /** - * Checks storage log entries can be read from any network. - * - * @return true if storage log entries can be read from any network, false otherwise - */ - boolean canReadLogEntriesFromAnyNetwork(); - - /** - * Checks storage metrics can be read from any network. - * - * @return true if storage metrics can be read from any network, false otherwise - */ - boolean canReadMetricsFromAnyNetwork(); - - /** - * Checks storage account can be accessed from applications running on azure. - * - * @return true if storage can be accessed from application running on azure, false otherwise - */ - boolean canAccessFromAzureServices(); - - /** - * Checks whether Aad Integration is enabled for files on this storage account. - * - * @return true if Aad integration is enabled, false otherwise - */ - boolean isAzureFilesAadIntegrationEnabled(); - - /** - * Checks whether Hns is enabled on this storage account. - * - * @return true if Hns is enabled, false otherwise - */ - boolean isHnsEnabled(); - - /** - * Checks whether large file shares enabled on this storage account. - * - * @return true if large file shares is enabled, false otherwise - */ - boolean isLargeFileSharesEnabled(); - - /** - * @return the minimum TLS version for HTTPS traffic. - */ - MinimumTlsVersion minimumTlsVersion(); - - /** - * Checks whether storage account only allow HTTPS traffic. - * - * @return true if only allow HTTPS traffic, false otherwise - */ - boolean isHttpsTrafficOnly(); - - /** - * Checks whether blob public access is allowed. - * - * @return true if blob public access is allowed, false otherwise - */ - boolean isBlobPublicAccessAllowed(); - - /** - * Checks whether shared key access is allowed. - * - * @return true if shared key access is allowed, false otherwise - */ - boolean isSharedKeyAccessAllowed(); - - /** - * Fetch the up-to-date access keys from Azure for this storage account. - * - * @return the access keys for this storage account - */ - List getKeys(); - - /** - * Fetch the up-to-date access keys from Azure for this storage account asynchronously. - * - * @return a representation of the deferred computation of this call, returning the access keys - */ - Mono> getKeysAsync(); - - /** - * Regenerates the access keys for this storage account. - * - * @param keyName if the key name - * @return the generated access keys for this storage account - */ - List regenerateKey(String keyName); - - /** - * Regenerates the access keys for this storage account asynchronously. - * - * @param keyName if the key name - * @return a representation of the deferred computation of this call, returning the regenerated access key - */ - Mono> regenerateKeyAsync(String keyName); - - /** Container interface for all the definitions that need to be implemented. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithGroup, - DefinitionStages.WithCreate, - DefinitionStages.WithCreateAndAccessTier { - } - - /** Grouping of all the storage account definition stages. */ - interface DefinitionStages { - /** The first stage of the storage account definition. */ - interface Blank extends GroupableResource.DefinitionWithRegion { - } - - /** The stage of a storage account definition allowing to specify the resource group. */ - interface WithGroup extends GroupableResource.DefinitionStages.WithGroup { - } - - /** The stage of a storage account definition allowing to specify sku. */ - interface WithSku { - /** - * Specifies the sku of the storage account. - * - * @param sku the sku - * @return the next stage of storage account definition - */ - WithCreate withSku(StorageAccountSkuType sku); - } - - /** The stage of a storage account definition allowing to specify account kind as blob storage. */ - interface WithBlobStorageAccountKind { - /** - * Specifies the storage account kind to be "BlobStorage". The access tier is defaulted to be "Hot". - * - * @return the next stage of storage account definition - */ - WithCreateAndAccessTier withBlobStorageAccountKind(); - } - - /** The stage of a storage account definition allowing to specify account kind as general purpose. */ - interface WithGeneralPurposeAccountKind { - /** - * Specifies the storage account kind to be "Storage", the kind for general purposes. - * - * @return the next stage of storage account definition - */ - WithCreate withGeneralPurposeAccountKind(); - - /** - * Specifies the storage account kind to be "StorageV2", the kind for general purposes. - * - * @return the next stage of storage account definition - */ - WithCreate withGeneralPurposeAccountKindV2(); - } - - /** The stage of a storage account definition allowing to specify account kind as block blob storage. */ - interface WithBlockBlobStorageAccountKind { - /** - * Specifies the storage account kind to be "BlockBlobStorage". - * - * @return The next stage of storage account definition. - */ - WithCreate withBlockBlobStorageAccountKind(); - } - - /** The stage of a storage account definition allowing to specify account kind as file storage. */ - interface WithFileStorageAccountKind { - /** - * Specifies the storage account kind to be "FileStorage". - * - * @return the next stage of storage account definition. - */ - WithCreate withFileStorageAccountKind(); - } - - /** The stage of a storage account definition allowing to specify encryption settings. */ - interface WithEncryption { - /** - * Enables the infrastructure encryption for double encryption of Azure Storage data. - * - * @return the next stage of storage account definition - */ - WithCreate withInfrastructureEncryption(); - - /** - * Specifies that encryption needs be enabled for blob service. - * - * @deprecated Azure Storage encryption cannot be disabled. - * @return the next stage of storage account definition - */ - @Deprecated - WithCreate withBlobEncryption(); - - /** - * Disables encryption for blob service. - * - * @deprecated Azure Storage encryption cannot be disabled. - * @return the next stage of storage account definition - */ - @Deprecated - WithCreate withoutBlobEncryption(); - - /** - * Specifies that encryption needs be enabled for file service. - * - * @deprecated Azure Storage encryption cannot be disabled. - * @return the next stage of storage account definition - */ - @Deprecated - WithCreate withFileEncryption(); - - /** - * Disables encryption for file service. - * - * @deprecated Azure Storage encryption cannot be disabled. - * @return he next stage of storage account definition - */ - @Deprecated - WithCreate withoutFileEncryption(); - - /** - * Specifies that table service uses an encryption key that is scoped to the account. - * Customer-managed key can then be enabled for table service. - * - * Refer to {@link Update#withEncryptionKeyFromKeyVault(String, String, String)} to enable customer-managed - * key. - * - * @return the next stage of storage account definition - */ - WithCreate withTableAccountScopedEncryptionKey(); - - /** - * Specifies that queue service uses an encryption key that is scoped to the account. - * Customer-managed key can then be enabled for queue service. - * - * Refer to {@link Update#withEncryptionKeyFromKeyVault(String, String, String)} to enable customer-managed - * key. - * - * @return the next stage of storage account definition - */ - WithCreate withQueueAccountScopedEncryptionKey(); - - /** - * Specifies the KeyVault key to be used as encryption key. - * - * This requires managed service identity on storage account - * and GET, WRAP_KEY, UNWRAP_KEY access policy on key vault for the managed service identity. - * - * @param keyVaultUri the uri to KeyVault - * @param keyName the KeyVault key name - * @param keyVersion the KeyVault key version - * @return the next stage of storage account definition - */ - WithCreate withEncryptionKeyFromKeyVault(String keyVaultUri, String keyName, String keyVersion); - } - - /** The stage of a storage account definition allowing to associate custom domain with the account. */ - interface WithCustomDomain { - /** - * Specifies the user domain assigned to the storage account. - * - * @param customDomain the user domain assigned to the storage account - * @return the next stage of storage account definition - */ - WithCreate withCustomDomain(CustomDomain customDomain); - - /** - * Specifies the user domain assigned to the storage account. - * - * @param name the custom domain name, which is the CNAME source - * @return the next stage of storage account definition - */ - WithCreate withCustomDomain(String name); - - /** - * Specifies the user domain assigned to the storage account. - * - * @param name the custom domain name, which is the CNAME source - * @param useSubDomain whether indirect CName validation is enabled - * @return the next stage of storage account definition - */ - WithCreate withCustomDomain(String name, boolean useSubDomain); - } - - /** The stage of a storage account definition allowing to enable implicit managed service identity (MSI). */ - interface WithManagedServiceIdentity { - /** - * Specifies that implicit managed service identity (MSI) needs to be enabled. - * - * @return the next stage of storage account definition - */ - WithCreate withSystemAssignedManagedServiceIdentity(); - } - - /** The stage of storage account definition allowing to restrict access protocol. */ - interface WithAccessTraffic { - /** - * Specifies that only https traffic should be allowed to storage account. - * - * @return the next stage of storage account definition - */ - WithCreate withOnlyHttpsTraffic(); - - /** - * Specifies that both http and https traffic should be allowed to storage account. - * - * @return the next stage of storage account definition - */ - WithCreate withHttpAndHttpsTraffic(); - - /** - * Specifies the minimum TLS version for HTTPS traffic. - * - * @param minimumTlsVersion the minimum TLS version - * @return the next stage of storage account definition - */ - WithCreate withMinimumTlsVersion(MinimumTlsVersion minimumTlsVersion); - } - - /** The stage of storage account definition allowing to configure blob access. */ - interface WithBlobAccess { - /** - * Disables blob public access. - * - * Disabling in storage account overrides the public access settings for individual containers. - * - * @return the next stage of storage account definition - */ - WithCreate disableBlobPublicAccess(); - - /** - * Disables shared key access. - * - * @return the next stage of storage account definition - */ - WithCreate disableSharedKeyAccess(); - } - - /** The stage of storage account definition allowing to configure network access settings. */ - interface WithNetworkAccess { - /** - * Specifies that by default access to storage account should be allowed from all networks. - * - * @return the next stage of storage account definition - */ - WithCreate withAccessFromAllNetworks(); - - /** - * Specifies that by default access to storage account should be denied from all networks except from those - * networks specified via {@link WithNetworkAccess#withAccessFromNetworkSubnet(String)} {@link - * WithNetworkAccess#withAccessFromIpAddress(String)} and {@link - * WithNetworkAccess#withAccessFromIpAddressRange(String)}. - * - * @return the next stage of storage account definition - */ - WithCreate withAccessFromSelectedNetworks(); - - /** - * Specifies that access to the storage account from the specific virtual network subnet should be allowed. - * - * @param subnetId the virtual network subnet id - * @return the next stage of storage account definition - */ - WithCreate withAccessFromNetworkSubnet(String subnetId); - - /** - * Specifies that access to the storage account from the specific ip address should be allowed. - * - * @param ipAddress the ip address - * @return the next stage of storage account definition - */ - WithCreate withAccessFromIpAddress(String ipAddress); - - /** - * Specifies that access to the storage account from the specific ip range should be allowed. - * - * @param ipAddressCidr the ip address range expressed in cidr format - * @return the next stage of storage account definition - */ - WithCreate withAccessFromIpAddressRange(String ipAddressCidr); - - /** - * Specifies that read access to the storage logging should be allowed from any network. - * - * @return the next stage of storage account definition - */ - WithCreate withReadAccessToLogEntriesFromAnyNetwork(); - - /** - * Specifies that read access to the storage metrics should be allowed from any network. - * - * @return the next stage of storage account definition - */ - WithCreate withReadAccessToMetricsFromAnyNetwork(); - - /** - * Specifies that access to the storage account should be allowed from applications running on Microsoft - * Azure services. - * - * @return the next stage of storage account definition - */ - WithCreate withAccessFromAzureServices(); - } - - /** - * The stage of storage account definition allowing to specify whether azure files aad integration will be - * enabled. - */ - interface WithAzureFilesAadIntegration { - /** - * Specifies whether Azure files aad integration will be enabled or not. - * - * @param enabled whether Azure files aad integration will be enabled or not - * @return the next stage of storage account definition - */ - WithCreate withAzureFilesAadIntegrationEnabled(boolean enabled); - } - - /** The stage of storage account definition allowing to specify whether large file shares will be enabled. */ - interface WithLargeFileShares { - /** - * Allow large file shares if sets to enabled. It cannot be disabled once it is enabled. - * - * @param enabled whether large file shares will be enabled or not - * @return the next stage of storage account definition - */ - WithCreate withLargeFileShares(boolean enabled); - } - - /** The stage of the storage account definition allowing to specify whether Hns is enabled. */ - interface WithHns { - /** - * Specifies whether Hns will be enabled or not. - * - * @param enabled whether Hns will be enabled or not - * @return the next stage of storage account definition - */ - WithCreate withHnsEnabled(boolean enabled); - } - - /** - * A storage account definition with sufficient inputs to create a new storage account in the cloud, but - * exposing additional optional inputs to specify. - */ - interface WithCreate - extends Creatable, - DefinitionStages.WithSku, - DefinitionStages.WithBlobStorageAccountKind, - DefinitionStages.WithGeneralPurposeAccountKind, - DefinitionStages.WithBlockBlobStorageAccountKind, - DefinitionStages.WithFileStorageAccountKind, - DefinitionStages.WithEncryption, - DefinitionStages.WithCustomDomain, - DefinitionStages.WithManagedServiceIdentity, - DefinitionStages.WithAccessTraffic, - DefinitionStages.WithNetworkAccess, - DefinitionStages.WithAzureFilesAadIntegration, - DefinitionStages.WithLargeFileShares, - DefinitionStages.WithHns, - DefinitionStages.WithBlobAccess, - Resource.DefinitionWithTags { - } - - /** The stage of storage account definition allowing to set access tier. */ - interface WithCreateAndAccessTier extends DefinitionStages.WithCreate { - /** - * Specifies the access tier used for billing. - * - *

    Access tier cannot be changed more than once every 7 days (168 hours). Access tier cannot be set for - * StandardLRS, StandardGRS, StandardRAGRS, or PremiumLRS account types. - * - * @param accessTier the access tier value - * @return the next stage of storage account definition - */ - DefinitionStages.WithCreate withAccessTier(AccessTier accessTier); - } - } - - /** Grouping of all the storage account update stages. */ - interface UpdateStages { - /** The stage of the storage account update allowing to change the sku. */ - interface WithSku { - /** - * Specifies the sku of the storage account. - * - * @param sku the sku - * @return the next stage of storage account update - */ - Update withSku(StorageAccountSkuType sku); - } - - /** The stage of the storage account update allowing to associate custom domain. */ - interface WithCustomDomain { - /** - * Specifies the user domain assigned to the storage account. - * - * @param customDomain the user domain assigned to the storage account - * @return the next stage of storage account update - */ - Update withCustomDomain(CustomDomain customDomain); - - /** - * Specifies the user domain assigned to the storage account. - * - * @param name the custom domain name, which is the CNAME source - * @return the next stage of storage account update - */ - Update withCustomDomain(String name); - - /** - * Specifies the user domain assigned to the storage account. - * - * @param name the custom domain name, which is the CNAME source - * @param useSubDomain whether indirect CName validation is enabled - * @return the next stage of storage account update - */ - Update withCustomDomain(String name, boolean useSubDomain); - } - - /** The stage of the storage account update allowing to configure encryption settings. */ - interface WithEncryption { - /** - * Enables encryption for blob service. - * - * @deprecated Azure Storage encryption cannot be disabled. - * @return the next stage of storage account update - */ - @Deprecated - Update withBlobEncryption(); - - /** - * Enables encryption for file service. - * - * @deprecated Azure Storage encryption cannot be disabled. - * @return he next stage of storage account update - */ - @Deprecated - Update withFileEncryption(); - - /** - * Disables encryption for blob service. - * - * @deprecated Azure Storage encryption cannot be disabled. - * @return the next stage of storage account update - */ - @Deprecated - Update withoutBlobEncryption(); - - /** - * Disables encryption for file service. - * - * @deprecated Azure Storage encryption cannot be disabled. - * @return he next stage of storage account update - */ - @Deprecated - Update withoutFileEncryption(); - - /** - * Specifies the KeyVault key to be used as key for encryption. - * - * This requires managed service identity on storage account - * (via {@link WithManagedServiceIdentity#withSystemAssignedManagedServiceIdentity()}), - * and GET, WRAP_KEY, UNWRAP_KEY access policy on key vault for the managed service identity. - * - * @param keyVaultUri the uri to KeyVault - * @param keyName the KeyVault key name - * @param keyVersion the KeyVault key version - * @return the next stage of storage account update - */ - Update withEncryptionKeyFromKeyVault(String keyVaultUri, String keyName, String keyVersion); - } - - /** A blob storage account update stage allowing access tier to be specified. */ - interface WithAccessTier { - /** - * Specifies the access tier used for billing. - * - *

    Access tier cannot be changed more than once every 7 days (168 hours). Access tier cannot be set for - * StandardLRS, StandardGRS, StandardRAGRS, or PremiumLRS account types. - * - * @param accessTier the access tier value - * @return the next stage of storage account update - */ - Update withAccessTier(AccessTier accessTier); - } - - /** The stage of the storage account update allowing to enable managed service identity (MSI). */ - interface WithManagedServiceIdentity { - /** - * Specifies that implicit managed service identity (MSI) needs to be enabled. - * - * @return the next stage of storage account update - */ - Update withSystemAssignedManagedServiceIdentity(); - } - - /** The stage of the storage account update allowing to specify the protocol to be used to access account. */ - interface WithAccessTraffic { - /** - * Specifies that only https traffic should be allowed to storage account. - * - * @return the next stage of storage account update - */ - Update withOnlyHttpsTraffic(); - - /** - * Specifies that both http and https traffic should be allowed to storage account. - * - * @return the next stage of storage account update - */ - Update withHttpAndHttpsTraffic(); - - /** - * Specifies the minimum TLS version for HTTPS traffic. - * - * @param minimumTlsVersion the minimum TLS version - * @return the next stage of storage account update - */ - Update withMinimumTlsVersion(MinimumTlsVersion minimumTlsVersion); - } - - /** The stage of storage account update allowing to configure blob access. */ - interface WithBlobAccess { - /** - * Allows blob public access, configured by individual containers. - * - * @return the next stage of storage account update - */ - Update enableBlobPublicAccess(); - - /** - * Disables blob public access. - * - * Disabling in storage account overrides the public access settings for individual containers. - * - * @return the next stage of storage account update - */ - Update disableBlobPublicAccess(); - - /** - * Allows shared key access. - * - * @return the next stage of storage account update - */ - Update enableSharedKeyAccess(); - - /** - * Disables shared key access. - * - * @return the next stage of storage account update - */ - Update disableSharedKeyAccess(); - } - - /** The stage of storage account update allowing to configure network access. */ - interface WithNetworkAccess { - /** - * Specifies that by default access to storage account should be allowed from all networks. - * - * @return the next stage of storage account update - */ - Update withAccessFromAllNetworks(); - - /** - * Specifies that by default access to storage account should be denied from all networks except from those - * networks specified via {@link WithNetworkAccess#withAccessFromNetworkSubnet(String)}, {@link - * WithNetworkAccess#withAccessFromIpAddress(String)} and {@link - * WithNetworkAccess#withAccessFromIpAddressRange(String)}. - * - * @return the next stage of storage account update - */ - Update withAccessFromSelectedNetworks(); - - /** - * Specifies that access to the storage account from a specific virtual network subnet should be allowed. - * - * @param subnetId the virtual network subnet id - * @return the next stage of storage account update - */ - Update withAccessFromNetworkSubnet(String subnetId); - - /** - * Specifies that access to the storage account from a specific ip address should be allowed. - * - * @param ipAddress the ip address - * @return the next stage of storage account update - */ - Update withAccessFromIpAddress(String ipAddress); - - /** - * Specifies that access to the storage account from a specific ip range should be allowed. - * - * @param ipAddressCidr the ip address range expressed in cidr format - * @return the next stage of storage account update - */ - Update withAccessFromIpAddressRange(String ipAddressCidr); - - /** - * Specifies that read access to the storage logging should be allowed from any network. - * - * @return the next stage of storage account definition - */ - Update withReadAccessToLogEntriesFromAnyNetwork(); - - /** - * Specifies that read access to the storage metrics should be allowed from any network. - * - * @return the next stage of storage account definition - */ - Update withReadAccessToMetricsFromAnyNetwork(); - - /** - * Specifies that access to the storage account should be allowed from applications running on Microsoft - * Azure services. - * - * @return the next stage of storage account definition - */ - Update withAccessFromAzureServices(); - - /** - * Specifies that previously allowed access from specific virtual network subnet should be removed. - * - * @param subnetId the virtual network subnet id - * @return the next stage of storage account update - */ - Update withoutNetworkSubnetAccess(String subnetId); - - /** - * Specifies that previously allowed access from specific ip address should be removed. - * - * @param ipAddress the ip address - * @return the next stage of storage account update - */ - Update withoutIpAddressAccess(String ipAddress); - - /** - * Specifies that previously allowed access from specific ip range should be removed. - * - * @param ipAddressCidr the ip address range expressed in cidr format - * @return the next stage of storage account update - */ - Update withoutIpAddressRangeAccess(String ipAddressCidr); - - /** - * Specifies that previously added read access exception to the storage logging from any network should be - * removed. - * - * @return the next stage of storage account update - */ - Update withoutReadAccessToLoggingFromAnyNetwork(); - - /** - * Specifies that previously added read access exception to the storage metrics from any network should be - * removed. - * - * @return the next stage of storage account update - */ - Update withoutReadAccessToMetricsFromAnyNetwork(); - - /** - * Specifies that previously added access exception to the storage account from application running on azure - * should be removed. - * - * @return the next stage of storage account update - */ - Update withoutAccessFromAzureServices(); - - /** - * Specifies whether Files AAD integration will be enabled or not. - * - * @param enabled whether Files AAD integration will be enabled or not - * @return the next stage of storage account update - */ - Update withAzureFilesAadIntegrationEnabled(boolean enabled); - } - - /** The stage of storage account update allowing to configure upgrading. */ - interface WithUpgrade { - /** - * Specifies that the storage account should be upgraded to V2 kind. - * - * @return the next stage of storage account update - */ - Update upgradeToGeneralPurposeAccountKindV2(); - } - } - - /** The template for a storage account update operation, containing all the settings that can be modified. */ - interface Update - extends Appliable, - UpdateStages.WithSku, - UpdateStages.WithCustomDomain, - UpdateStages.WithEncryption, - UpdateStages.WithAccessTier, - UpdateStages.WithManagedServiceIdentity, - UpdateStages.WithAccessTraffic, - UpdateStages.WithNetworkAccess, - UpdateStages.WithUpgrade, - UpdateStages.WithBlobAccess, - Resource.UpdateWithTags { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountCheckNameAvailabilityParameters.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountCheckNameAvailabilityParameters.java deleted file mode 100644 index b46740f23305..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountCheckNameAvailabilityParameters.java +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The parameters used to check the availability of the storage account name. */ -@Fluent -public final class StorageAccountCheckNameAvailabilityParameters { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(StorageAccountCheckNameAvailabilityParameters.class); - - /* - * The storage account name. - */ - @JsonProperty(value = "name", required = true) - private String name; - - /* - * The type of resource, Microsoft.Storage/storageAccounts - */ - @JsonProperty(value = "type", required = true) - private String type; - - /** Creates an instance of StorageAccountCheckNameAvailabilityParameters class. */ - public StorageAccountCheckNameAvailabilityParameters() { - type = "Microsoft.Storage/storageAccounts"; - } - - /** - * Get the name property: The storage account name. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The storage account name. - * - * @param name the name value to set. - * @return the StorageAccountCheckNameAvailabilityParameters object itself. - */ - public StorageAccountCheckNameAvailabilityParameters withName(String name) { - this.name = name; - return this; - } - - /** - * Get the type property: The type of resource, Microsoft.Storage/storageAccounts. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Set the type property: The type of resource, Microsoft.Storage/storageAccounts. - * - * @param type the type value to set. - * @return the StorageAccountCheckNameAvailabilityParameters object itself. - */ - public StorageAccountCheckNameAvailabilityParameters withType(String type) { - this.type = type; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property name in model StorageAccountCheckNameAvailabilityParameters")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountCreateParameters.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountCreateParameters.java deleted file mode 100644 index 08ec7a968567..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountCreateParameters.java +++ /dev/null @@ -1,520 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.storage.fluent.models.StorageAccountPropertiesCreateParameters; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** The parameters used when creating a storage account. */ -@Fluent -public final class StorageAccountCreateParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageAccountCreateParameters.class); - - /* - * Required. Gets or sets the SKU name. - */ - @JsonProperty(value = "sku", required = true) - private Sku sku; - - /* - * Required. Indicates the type of storage account. - */ - @JsonProperty(value = "kind", required = true) - private Kind kind; - - /* - * Required. Gets or sets the location of the resource. This will be one of - * the supported and registered Azure Geo Regions (e.g. West US, East US, - * Southeast Asia, etc.). The geo region of a resource cannot be changed - * once it is created, but if an identical geo region is specified on - * update, the request will succeed. - */ - @JsonProperty(value = "location", required = true) - private String location; - - /* - * Gets or sets a list of key value pairs that describe the resource. These - * tags can be used for viewing and grouping this resource (across resource - * groups). A maximum of 15 tags can be provided for a resource. Each tag - * must have a key with a length no greater than 128 characters and a value - * with a length no greater than 256 characters. - */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map tags; - - /* - * The identity of the resource. - */ - @JsonProperty(value = "identity") - private Identity identity; - - /* - * The parameters used to create the storage account. - */ - @JsonProperty(value = "properties") - private StorageAccountPropertiesCreateParameters innerProperties; - - /** - * Get the sku property: Required. Gets or sets the SKU name. - * - * @return the sku value. - */ - public Sku sku() { - return this.sku; - } - - /** - * Set the sku property: Required. Gets or sets the SKU name. - * - * @param sku the sku value to set. - * @return the StorageAccountCreateParameters object itself. - */ - public StorageAccountCreateParameters withSku(Sku sku) { - this.sku = sku; - return this; - } - - /** - * Get the kind property: Required. Indicates the type of storage account. - * - * @return the kind value. - */ - public Kind kind() { - return this.kind; - } - - /** - * Set the kind property: Required. Indicates the type of storage account. - * - * @param kind the kind value to set. - * @return the StorageAccountCreateParameters object itself. - */ - public StorageAccountCreateParameters withKind(Kind kind) { - this.kind = kind; - return this; - } - - /** - * Get the location property: Required. Gets or sets the location of the resource. This will be one of the supported - * and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a resource - * cannot be changed once it is created, but if an identical geo region is specified on update, the request will - * succeed. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Set the location property: Required. Gets or sets the location of the resource. This will be one of the supported - * and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a resource - * cannot be changed once it is created, but if an identical geo region is specified on update, the request will - * succeed. - * - * @param location the location value to set. - * @return the StorageAccountCreateParameters object itself. - */ - public StorageAccountCreateParameters withLocation(String location) { - this.location = location; - return this; - } - - /** - * Get the tags property: Gets or sets a list of key value pairs that describe the resource. These tags can be used - * for viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a - * resource. Each tag must have a key with a length no greater than 128 characters and a value with a length no - * greater than 256 characters. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Gets or sets a list of key value pairs that describe the resource. These tags can be used - * for viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a - * resource. Each tag must have a key with a length no greater than 128 characters and a value with a length no - * greater than 256 characters. - * - * @param tags the tags value to set. - * @return the StorageAccountCreateParameters object itself. - */ - public StorageAccountCreateParameters withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Get the identity property: The identity of the resource. - * - * @return the identity value. - */ - public Identity identity() { - return this.identity; - } - - /** - * Set the identity property: The identity of the resource. - * - * @param identity the identity value to set. - * @return the StorageAccountCreateParameters object itself. - */ - public StorageAccountCreateParameters withIdentity(Identity identity) { - this.identity = identity; - return this; - } - - /** - * Get the innerProperties property: The parameters used to create the storage account. - * - * @return the innerProperties value. - */ - private StorageAccountPropertiesCreateParameters innerProperties() { - return this.innerProperties; - } - - /** - * Get the customDomain property: User domain assigned to the storage account. Name is the CNAME source. Only one - * custom domain is supported per storage account at this time. To clear the existing custom domain, use an empty - * string for the custom domain name property. - * - * @return the customDomain value. - */ - public CustomDomain customDomain() { - return this.innerProperties() == null ? null : this.innerProperties().customDomain(); - } - - /** - * Set the customDomain property: User domain assigned to the storage account. Name is the CNAME source. Only one - * custom domain is supported per storage account at this time. To clear the existing custom domain, use an empty - * string for the custom domain name property. - * - * @param customDomain the customDomain value to set. - * @return the StorageAccountCreateParameters object itself. - */ - public StorageAccountCreateParameters withCustomDomain(CustomDomain customDomain) { - if (this.innerProperties() == null) { - this.innerProperties = new StorageAccountPropertiesCreateParameters(); - } - this.innerProperties().withCustomDomain(customDomain); - return this; - } - - /** - * Get the encryption property: Not applicable. Azure Storage encryption is enabled for all storage accounts and - * cannot be disabled. - * - * @return the encryption value. - */ - public Encryption encryption() { - return this.innerProperties() == null ? null : this.innerProperties().encryption(); - } - - /** - * Set the encryption property: Not applicable. Azure Storage encryption is enabled for all storage accounts and - * cannot be disabled. - * - * @param encryption the encryption value to set. - * @return the StorageAccountCreateParameters object itself. - */ - public StorageAccountCreateParameters withEncryption(Encryption encryption) { - if (this.innerProperties() == null) { - this.innerProperties = new StorageAccountPropertiesCreateParameters(); - } - this.innerProperties().withEncryption(encryption); - return this; - } - - /** - * Get the networkRuleSet property: Network rule set. - * - * @return the networkRuleSet value. - */ - public NetworkRuleSet networkRuleSet() { - return this.innerProperties() == null ? null : this.innerProperties().networkRuleSet(); - } - - /** - * Set the networkRuleSet property: Network rule set. - * - * @param networkRuleSet the networkRuleSet value to set. - * @return the StorageAccountCreateParameters object itself. - */ - public StorageAccountCreateParameters withNetworkRuleSet(NetworkRuleSet networkRuleSet) { - if (this.innerProperties() == null) { - this.innerProperties = new StorageAccountPropertiesCreateParameters(); - } - this.innerProperties().withNetworkRuleSet(networkRuleSet); - return this; - } - - /** - * Get the accessTier property: Required for storage accounts where kind = BlobStorage. The access tier used for - * billing. - * - * @return the accessTier value. - */ - public AccessTier accessTier() { - return this.innerProperties() == null ? null : this.innerProperties().accessTier(); - } - - /** - * Set the accessTier property: Required for storage accounts where kind = BlobStorage. The access tier used for - * billing. - * - * @param accessTier the accessTier value to set. - * @return the StorageAccountCreateParameters object itself. - */ - public StorageAccountCreateParameters withAccessTier(AccessTier accessTier) { - if (this.innerProperties() == null) { - this.innerProperties = new StorageAccountPropertiesCreateParameters(); - } - this.innerProperties().withAccessTier(accessTier); - return this; - } - - /** - * Get the azureFilesIdentityBasedAuthentication property: Provides the identity based authentication settings for - * Azure Files. - * - * @return the azureFilesIdentityBasedAuthentication value. - */ - public AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication() { - return this.innerProperties() == null ? null : this.innerProperties().azureFilesIdentityBasedAuthentication(); - } - - /** - * Set the azureFilesIdentityBasedAuthentication property: Provides the identity based authentication settings for - * Azure Files. - * - * @param azureFilesIdentityBasedAuthentication the azureFilesIdentityBasedAuthentication value to set. - * @return the StorageAccountCreateParameters object itself. - */ - public StorageAccountCreateParameters withAzureFilesIdentityBasedAuthentication( - AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication) { - if (this.innerProperties() == null) { - this.innerProperties = new StorageAccountPropertiesCreateParameters(); - } - this.innerProperties().withAzureFilesIdentityBasedAuthentication(azureFilesIdentityBasedAuthentication); - return this; - } - - /** - * Get the enableHttpsTrafficOnly property: Allows https traffic only to storage service if sets to true. The - * default value is true since API version 2019-04-01. - * - * @return the enableHttpsTrafficOnly value. - */ - public Boolean enableHttpsTrafficOnly() { - return this.innerProperties() == null ? null : this.innerProperties().enableHttpsTrafficOnly(); - } - - /** - * Set the enableHttpsTrafficOnly property: Allows https traffic only to storage service if sets to true. The - * default value is true since API version 2019-04-01. - * - * @param enableHttpsTrafficOnly the enableHttpsTrafficOnly value to set. - * @return the StorageAccountCreateParameters object itself. - */ - public StorageAccountCreateParameters withEnableHttpsTrafficOnly(Boolean enableHttpsTrafficOnly) { - if (this.innerProperties() == null) { - this.innerProperties = new StorageAccountPropertiesCreateParameters(); - } - this.innerProperties().withEnableHttpsTrafficOnly(enableHttpsTrafficOnly); - return this; - } - - /** - * Get the isHnsEnabled property: Account HierarchicalNamespace enabled if sets to true. - * - * @return the isHnsEnabled value. - */ - public Boolean isHnsEnabled() { - return this.innerProperties() == null ? null : this.innerProperties().isHnsEnabled(); - } - - /** - * Set the isHnsEnabled property: Account HierarchicalNamespace enabled if sets to true. - * - * @param isHnsEnabled the isHnsEnabled value to set. - * @return the StorageAccountCreateParameters object itself. - */ - public StorageAccountCreateParameters withIsHnsEnabled(Boolean isHnsEnabled) { - if (this.innerProperties() == null) { - this.innerProperties = new StorageAccountPropertiesCreateParameters(); - } - this.innerProperties().withIsHnsEnabled(isHnsEnabled); - return this; - } - - /** - * Get the largeFileSharesState property: Allow large file shares if sets to Enabled. It cannot be disabled once it - * is enabled. - * - * @return the largeFileSharesState value. - */ - public LargeFileSharesState largeFileSharesState() { - return this.innerProperties() == null ? null : this.innerProperties().largeFileSharesState(); - } - - /** - * Set the largeFileSharesState property: Allow large file shares if sets to Enabled. It cannot be disabled once it - * is enabled. - * - * @param largeFileSharesState the largeFileSharesState value to set. - * @return the StorageAccountCreateParameters object itself. - */ - public StorageAccountCreateParameters withLargeFileSharesState(LargeFileSharesState largeFileSharesState) { - if (this.innerProperties() == null) { - this.innerProperties = new StorageAccountPropertiesCreateParameters(); - } - this.innerProperties().withLargeFileSharesState(largeFileSharesState); - return this; - } - - /** - * Get the routingPreference property: Maintains information about the network routing choice opted by the user for - * data transfer. - * - * @return the routingPreference value. - */ - public RoutingPreference routingPreference() { - return this.innerProperties() == null ? null : this.innerProperties().routingPreference(); - } - - /** - * Set the routingPreference property: Maintains information about the network routing choice opted by the user for - * data transfer. - * - * @param routingPreference the routingPreference value to set. - * @return the StorageAccountCreateParameters object itself. - */ - public StorageAccountCreateParameters withRoutingPreference(RoutingPreference routingPreference) { - if (this.innerProperties() == null) { - this.innerProperties = new StorageAccountPropertiesCreateParameters(); - } - this.innerProperties().withRoutingPreference(routingPreference); - return this; - } - - /** - * Get the allowBlobPublicAccess property: Allow or disallow public access to all blobs or containers in the storage - * account. The default interpretation is true for this property. - * - * @return the allowBlobPublicAccess value. - */ - public Boolean allowBlobPublicAccess() { - return this.innerProperties() == null ? null : this.innerProperties().allowBlobPublicAccess(); - } - - /** - * Set the allowBlobPublicAccess property: Allow or disallow public access to all blobs or containers in the storage - * account. The default interpretation is true for this property. - * - * @param allowBlobPublicAccess the allowBlobPublicAccess value to set. - * @return the StorageAccountCreateParameters object itself. - */ - public StorageAccountCreateParameters withAllowBlobPublicAccess(Boolean allowBlobPublicAccess) { - if (this.innerProperties() == null) { - this.innerProperties = new StorageAccountPropertiesCreateParameters(); - } - this.innerProperties().withAllowBlobPublicAccess(allowBlobPublicAccess); - return this; - } - - /** - * Get the minimumTlsVersion property: Set the minimum TLS version to be permitted on requests to storage. The - * default interpretation is TLS 1.0 for this property. - * - * @return the minimumTlsVersion value. - */ - public MinimumTlsVersion minimumTlsVersion() { - return this.innerProperties() == null ? null : this.innerProperties().minimumTlsVersion(); - } - - /** - * Set the minimumTlsVersion property: Set the minimum TLS version to be permitted on requests to storage. The - * default interpretation is TLS 1.0 for this property. - * - * @param minimumTlsVersion the minimumTlsVersion value to set. - * @return the StorageAccountCreateParameters object itself. - */ - public StorageAccountCreateParameters withMinimumTlsVersion(MinimumTlsVersion minimumTlsVersion) { - if (this.innerProperties() == null) { - this.innerProperties = new StorageAccountPropertiesCreateParameters(); - } - this.innerProperties().withMinimumTlsVersion(minimumTlsVersion); - return this; - } - - /** - * Get the allowSharedKeyAccess property: Indicates whether the storage account permits requests to be authorized - * with the account access key via Shared Key. If false, then all requests, including shared access signatures, must - * be authorized with Azure Active Directory (Azure AD). The default value is null, which is equivalent to true. - * - * @return the allowSharedKeyAccess value. - */ - public Boolean allowSharedKeyAccess() { - return this.innerProperties() == null ? null : this.innerProperties().allowSharedKeyAccess(); - } - - /** - * Set the allowSharedKeyAccess property: Indicates whether the storage account permits requests to be authorized - * with the account access key via Shared Key. If false, then all requests, including shared access signatures, must - * be authorized with Azure Active Directory (Azure AD). The default value is null, which is equivalent to true. - * - * @param allowSharedKeyAccess the allowSharedKeyAccess value to set. - * @return the StorageAccountCreateParameters object itself. - */ - public StorageAccountCreateParameters withAllowSharedKeyAccess(Boolean allowSharedKeyAccess) { - if (this.innerProperties() == null) { - this.innerProperties = new StorageAccountPropertiesCreateParameters(); - } - this.innerProperties().withAllowSharedKeyAccess(allowSharedKeyAccess); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (sku() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property sku in model StorageAccountCreateParameters")); - } else { - sku().validate(); - } - if (kind() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property kind in model StorageAccountCreateParameters")); - } - if (location() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property location in model StorageAccountCreateParameters")); - } - if (identity() != null) { - identity().validate(); - } - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountEncryptionKeySource.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountEncryptionKeySource.java deleted file mode 100644 index 6d09202703ad..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountEncryptionKeySource.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** Azure storage account encryption key sources. */ -public class StorageAccountEncryptionKeySource extends ExpandableStringEnum { - /** Static value Microsoft.Storage for StorageAccountEncryptionKeySource. */ - public static final StorageAccountEncryptionKeySource MICROSOFT_STORAGE = fromString("Microsoft.Storage"); - /** Static value Microsoft.Keyvault for StorageAccountEncryptionKeySource. */ - public static final StorageAccountEncryptionKeySource MICROSOFT_KEYVAULT = fromString("Microsoft.Keyvault"); - - /** - * Creates or finds an encryption status based on its name. - * - * @param name a name to look for - * @return an StorageAccountEncryptionKeySource - */ - public static StorageAccountEncryptionKeySource fromString(String name) { - return fromString(name, StorageAccountEncryptionKeySource.class); - } - - /** @return known storage account encryption sources. */ - public static Collection values() { - return values(StorageAccountEncryptionKeySource.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountEncryptionStatus.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountEncryptionStatus.java deleted file mode 100644 index 211bdabef790..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountEncryptionStatus.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Fluent; -import java.time.OffsetDateTime; - -/** Type representing the encryption status of a storage service. */ -@Fluent -public interface StorageAccountEncryptionStatus { - /** @return the storage service type */ - StorageService storageService(); - - /** @return true if the encryption is enabled for the service false otherwise */ - boolean isEnabled(); - - /** - * @return rough estimate of the date/time when the encryption was last enabled, null if the encryption is disabled - */ - OffsetDateTime lastEnabledTime(); - - /** @return the type of the key used to encrypt the storage service */ - KeyType keyType(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountExpand.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountExpand.java deleted file mode 100644 index f40039b7923b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountExpand.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for StorageAccountExpand. */ -public enum StorageAccountExpand { - /** Enum value geoReplicationStats. */ - GEO_REPLICATION_STATS("geoReplicationStats"), - - /** Enum value blobRestoreStatus. */ - BLOB_RESTORE_STATUS("blobRestoreStatus"); - - /** The actual serialized value for a StorageAccountExpand instance. */ - private final String value; - - StorageAccountExpand(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a StorageAccountExpand instance. - * - * @param value the serialized value to parse. - * @return the parsed StorageAccountExpand object, or null if unable to parse. - */ - @JsonCreator - public static StorageAccountExpand fromString(String value) { - StorageAccountExpand[] items = StorageAccountExpand.values(); - for (StorageAccountExpand item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountInternetEndpoints.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountInternetEndpoints.java deleted file mode 100644 index 273ead5d334f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountInternetEndpoints.java +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * The URIs that are used to perform a retrieval of a public blob, file, web or dfs object via a internet routing - * endpoint. - */ -@Immutable -public final class StorageAccountInternetEndpoints { - @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageAccountInternetEndpoints.class); - - /* - * Gets the blob endpoint. - */ - @JsonProperty(value = "blob", access = JsonProperty.Access.WRITE_ONLY) - private String blob; - - /* - * Gets the file endpoint. - */ - @JsonProperty(value = "file", access = JsonProperty.Access.WRITE_ONLY) - private String file; - - /* - * Gets the web endpoint. - */ - @JsonProperty(value = "web", access = JsonProperty.Access.WRITE_ONLY) - private String web; - - /* - * Gets the dfs endpoint. - */ - @JsonProperty(value = "dfs", access = JsonProperty.Access.WRITE_ONLY) - private String dfs; - - /** - * Get the blob property: Gets the blob endpoint. - * - * @return the blob value. - */ - public String blob() { - return this.blob; - } - - /** - * Get the file property: Gets the file endpoint. - * - * @return the file value. - */ - public String file() { - return this.file; - } - - /** - * Get the web property: Gets the web endpoint. - * - * @return the web value. - */ - public String web() { - return this.web; - } - - /** - * Get the dfs property: Gets the dfs endpoint. - * - * @return the dfs value. - */ - public String dfs() { - return this.dfs; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountKey.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountKey.java deleted file mode 100644 index 729924e082a5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountKey.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** An access key for the storage account. */ -@Immutable -public final class StorageAccountKey { - @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageAccountKey.class); - - /* - * Name of the key. - */ - @JsonProperty(value = "keyName", access = JsonProperty.Access.WRITE_ONLY) - private String keyName; - - /* - * Base 64-encoded value of the key. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private String value; - - /* - * Permissions for the key -- read-only or full permissions. - */ - @JsonProperty(value = "permissions", access = JsonProperty.Access.WRITE_ONLY) - private KeyPermission permissions; - - /** - * Get the keyName property: Name of the key. - * - * @return the keyName value. - */ - public String keyName() { - return this.keyName; - } - - /** - * Get the value property: Base 64-encoded value of the key. - * - * @return the value value. - */ - public String value() { - return this.value; - } - - /** - * Get the permissions property: Permissions for the key -- read-only or full permissions. - * - * @return the permissions value. - */ - public KeyPermission permissions() { - return this.permissions; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountListResult.java deleted file mode 100644 index e74436f9e352..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountListResult.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.storage.fluent.models.StorageAccountInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The response from the List Storage Accounts operation. */ -@Immutable -public final class StorageAccountListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageAccountListResult.class); - - /* - * Gets the list of storage accounts and their properties. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /* - * Request URL that can be used to query next page of storage accounts. - * Returned when total number of requested storage accounts exceed maximum - * page size. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: Gets the list of storage accounts and their properties. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: Request URL that can be used to query next page of storage accounts. Returned when - * total number of requested storage accounts exceed maximum page size. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountMicrosoftEndpoints.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountMicrosoftEndpoints.java deleted file mode 100644 index fdfe6e7e0dd8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountMicrosoftEndpoints.java +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * The URIs that are used to perform a retrieval of a public blob, queue, table, web or dfs object via a microsoft - * routing endpoint. - */ -@Immutable -public final class StorageAccountMicrosoftEndpoints { - @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageAccountMicrosoftEndpoints.class); - - /* - * Gets the blob endpoint. - */ - @JsonProperty(value = "blob", access = JsonProperty.Access.WRITE_ONLY) - private String blob; - - /* - * Gets the queue endpoint. - */ - @JsonProperty(value = "queue", access = JsonProperty.Access.WRITE_ONLY) - private String queue; - - /* - * Gets the table endpoint. - */ - @JsonProperty(value = "table", access = JsonProperty.Access.WRITE_ONLY) - private String table; - - /* - * Gets the file endpoint. - */ - @JsonProperty(value = "file", access = JsonProperty.Access.WRITE_ONLY) - private String file; - - /* - * Gets the web endpoint. - */ - @JsonProperty(value = "web", access = JsonProperty.Access.WRITE_ONLY) - private String web; - - /* - * Gets the dfs endpoint. - */ - @JsonProperty(value = "dfs", access = JsonProperty.Access.WRITE_ONLY) - private String dfs; - - /** - * Get the blob property: Gets the blob endpoint. - * - * @return the blob value. - */ - public String blob() { - return this.blob; - } - - /** - * Get the queue property: Gets the queue endpoint. - * - * @return the queue value. - */ - public String queue() { - return this.queue; - } - - /** - * Get the table property: Gets the table endpoint. - * - * @return the table value. - */ - public String table() { - return this.table; - } - - /** - * Get the file property: Gets the file endpoint. - * - * @return the file value. - */ - public String file() { - return this.file; - } - - /** - * Get the web property: Gets the web endpoint. - * - * @return the web value. - */ - public String web() { - return this.web; - } - - /** - * Get the dfs property: Gets the dfs endpoint. - * - * @return the dfs value. - */ - public String dfs() { - return this.dfs; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountRegenerateKeyParameters.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountRegenerateKeyParameters.java deleted file mode 100644 index 9b65fcd7c713..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountRegenerateKeyParameters.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The parameters used to regenerate the storage account key. */ -@Fluent -public final class StorageAccountRegenerateKeyParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageAccountRegenerateKeyParameters.class); - - /* - * The name of storage keys that want to be regenerated, possible values - * are key1, key2, kerb1, kerb2. - */ - @JsonProperty(value = "keyName", required = true) - private String keyName; - - /** - * Get the keyName property: The name of storage keys that want to be regenerated, possible values are key1, key2, - * kerb1, kerb2. - * - * @return the keyName value. - */ - public String keyName() { - return this.keyName; - } - - /** - * Set the keyName property: The name of storage keys that want to be regenerated, possible values are key1, key2, - * kerb1, kerb2. - * - * @param keyName the keyName value to set. - * @return the StorageAccountRegenerateKeyParameters object itself. - */ - public StorageAccountRegenerateKeyParameters withKeyName(String keyName) { - this.keyName = keyName; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (keyName() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property keyName in model StorageAccountRegenerateKeyParameters")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountSkuType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountSkuType.java deleted file mode 100644 index 5ae4efa2806b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountSkuType.java +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.storage.models; - -/** Defines sku values for storage account resource. */ -public final class StorageAccountSkuType { - /** Static value STANDARD_LRS for StorageAccountSkuType. */ - public static final StorageAccountSkuType STANDARD_LRS = new StorageAccountSkuType(SkuName.STANDARD_LRS); - - /** Static value STANDARD_GRS for StorageAccountSkuType. */ - public static final StorageAccountSkuType STANDARD_GRS = new StorageAccountSkuType(SkuName.STANDARD_GRS); - - /** Static value STANDARD_RAGRS for StorageAccountSkuType. */ - public static final StorageAccountSkuType STANDARD_RAGRS = new StorageAccountSkuType(SkuName.STANDARD_RAGRS); - - /** Static value STANDARD_RAGRS for StorageAccountSkuType. */ - public static final StorageAccountSkuType STANDARD_ZRS = new StorageAccountSkuType(SkuName.STANDARD_ZRS); - - /** Static value PREMIUM_LRS for StorageAccountSkuType. */ - public static final StorageAccountSkuType PREMIUM_LRS = new StorageAccountSkuType(SkuName.PREMIUM_LRS); - - private final SkuName name; - - /** @return the storage account sku name */ - public SkuName name() { - return this.name; - } - - /** - * Creates StorageAccountSkuType from sku name. - * - * @param name the sku name - * @return StorageAccountSkuType corresponds to the given sku name - */ - public static StorageAccountSkuType fromSkuName(SkuName name) { - return new StorageAccountSkuType(name); - } - - /** - * Creates StorageAccountSkuType. - * - * @param name the sku name - */ - private StorageAccountSkuType(SkuName name) { - this.name = name; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountUpdateParameters.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountUpdateParameters.java deleted file mode 100644 index 63dff4a88382..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountUpdateParameters.java +++ /dev/null @@ -1,447 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.storage.fluent.models.StorageAccountPropertiesUpdateParameters; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** The parameters that can be provided when updating the storage account properties. */ -@Fluent -public final class StorageAccountUpdateParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageAccountUpdateParameters.class); - - /* - * Gets or sets the SKU name. Note that the SKU name cannot be updated to - * Standard_ZRS, Premium_LRS or Premium_ZRS, nor can accounts of those SKU - * names be updated to any other value. - */ - @JsonProperty(value = "sku") - private Sku sku; - - /* - * Gets or sets a list of key value pairs that describe the resource. These - * tags can be used in viewing and grouping this resource (across resource - * groups). A maximum of 15 tags can be provided for a resource. Each tag - * must have a key no greater in length than 128 characters and a value no - * greater in length than 256 characters. - */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map tags; - - /* - * The identity of the resource. - */ - @JsonProperty(value = "identity") - private Identity identity; - - /* - * The parameters used when updating a storage account. - */ - @JsonProperty(value = "properties") - private StorageAccountPropertiesUpdateParameters innerProperties; - - /* - * Optional. Indicates the type of storage account. Currently only - * StorageV2 value supported by server. - */ - @JsonProperty(value = "kind") - private Kind kind; - - /** - * Get the sku property: Gets or sets the SKU name. Note that the SKU name cannot be updated to Standard_ZRS, - * Premium_LRS or Premium_ZRS, nor can accounts of those SKU names be updated to any other value. - * - * @return the sku value. - */ - public Sku sku() { - return this.sku; - } - - /** - * Set the sku property: Gets or sets the SKU name. Note that the SKU name cannot be updated to Standard_ZRS, - * Premium_LRS or Premium_ZRS, nor can accounts of those SKU names be updated to any other value. - * - * @param sku the sku value to set. - * @return the StorageAccountUpdateParameters object itself. - */ - public StorageAccountUpdateParameters withSku(Sku sku) { - this.sku = sku; - return this; - } - - /** - * Get the tags property: Gets or sets a list of key value pairs that describe the resource. These tags can be used - * in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a - * resource. Each tag must have a key no greater in length than 128 characters and a value no greater in length than - * 256 characters. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Gets or sets a list of key value pairs that describe the resource. These tags can be used - * in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a - * resource. Each tag must have a key no greater in length than 128 characters and a value no greater in length than - * 256 characters. - * - * @param tags the tags value to set. - * @return the StorageAccountUpdateParameters object itself. - */ - public StorageAccountUpdateParameters withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Get the identity property: The identity of the resource. - * - * @return the identity value. - */ - public Identity identity() { - return this.identity; - } - - /** - * Set the identity property: The identity of the resource. - * - * @param identity the identity value to set. - * @return the StorageAccountUpdateParameters object itself. - */ - public StorageAccountUpdateParameters withIdentity(Identity identity) { - this.identity = identity; - return this; - } - - /** - * Get the innerProperties property: The parameters used when updating a storage account. - * - * @return the innerProperties value. - */ - private StorageAccountPropertiesUpdateParameters innerProperties() { - return this.innerProperties; - } - - /** - * Get the kind property: Optional. Indicates the type of storage account. Currently only StorageV2 value supported - * by server. - * - * @return the kind value. - */ - public Kind kind() { - return this.kind; - } - - /** - * Set the kind property: Optional. Indicates the type of storage account. Currently only StorageV2 value supported - * by server. - * - * @param kind the kind value to set. - * @return the StorageAccountUpdateParameters object itself. - */ - public StorageAccountUpdateParameters withKind(Kind kind) { - this.kind = kind; - return this; - } - - /** - * Get the customDomain property: Custom domain assigned to the storage account by the user. Name is the CNAME - * source. Only one custom domain is supported per storage account at this time. To clear the existing custom - * domain, use an empty string for the custom domain name property. - * - * @return the customDomain value. - */ - public CustomDomain customDomain() { - return this.innerProperties() == null ? null : this.innerProperties().customDomain(); - } - - /** - * Set the customDomain property: Custom domain assigned to the storage account by the user. Name is the CNAME - * source. Only one custom domain is supported per storage account at this time. To clear the existing custom - * domain, use an empty string for the custom domain name property. - * - * @param customDomain the customDomain value to set. - * @return the StorageAccountUpdateParameters object itself. - */ - public StorageAccountUpdateParameters withCustomDomain(CustomDomain customDomain) { - if (this.innerProperties() == null) { - this.innerProperties = new StorageAccountPropertiesUpdateParameters(); - } - this.innerProperties().withCustomDomain(customDomain); - return this; - } - - /** - * Get the encryption property: Provides the encryption settings on the account. The default setting is unencrypted. - * - * @return the encryption value. - */ - public Encryption encryption() { - return this.innerProperties() == null ? null : this.innerProperties().encryption(); - } - - /** - * Set the encryption property: Provides the encryption settings on the account. The default setting is unencrypted. - * - * @param encryption the encryption value to set. - * @return the StorageAccountUpdateParameters object itself. - */ - public StorageAccountUpdateParameters withEncryption(Encryption encryption) { - if (this.innerProperties() == null) { - this.innerProperties = new StorageAccountPropertiesUpdateParameters(); - } - this.innerProperties().withEncryption(encryption); - return this; - } - - /** - * Get the accessTier property: Required for storage accounts where kind = BlobStorage. The access tier used for - * billing. - * - * @return the accessTier value. - */ - public AccessTier accessTier() { - return this.innerProperties() == null ? null : this.innerProperties().accessTier(); - } - - /** - * Set the accessTier property: Required for storage accounts where kind = BlobStorage. The access tier used for - * billing. - * - * @param accessTier the accessTier value to set. - * @return the StorageAccountUpdateParameters object itself. - */ - public StorageAccountUpdateParameters withAccessTier(AccessTier accessTier) { - if (this.innerProperties() == null) { - this.innerProperties = new StorageAccountPropertiesUpdateParameters(); - } - this.innerProperties().withAccessTier(accessTier); - return this; - } - - /** - * Get the azureFilesIdentityBasedAuthentication property: Provides the identity based authentication settings for - * Azure Files. - * - * @return the azureFilesIdentityBasedAuthentication value. - */ - public AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication() { - return this.innerProperties() == null ? null : this.innerProperties().azureFilesIdentityBasedAuthentication(); - } - - /** - * Set the azureFilesIdentityBasedAuthentication property: Provides the identity based authentication settings for - * Azure Files. - * - * @param azureFilesIdentityBasedAuthentication the azureFilesIdentityBasedAuthentication value to set. - * @return the StorageAccountUpdateParameters object itself. - */ - public StorageAccountUpdateParameters withAzureFilesIdentityBasedAuthentication( - AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication) { - if (this.innerProperties() == null) { - this.innerProperties = new StorageAccountPropertiesUpdateParameters(); - } - this.innerProperties().withAzureFilesIdentityBasedAuthentication(azureFilesIdentityBasedAuthentication); - return this; - } - - /** - * Get the enableHttpsTrafficOnly property: Allows https traffic only to storage service if sets to true. - * - * @return the enableHttpsTrafficOnly value. - */ - public Boolean enableHttpsTrafficOnly() { - return this.innerProperties() == null ? null : this.innerProperties().enableHttpsTrafficOnly(); - } - - /** - * Set the enableHttpsTrafficOnly property: Allows https traffic only to storage service if sets to true. - * - * @param enableHttpsTrafficOnly the enableHttpsTrafficOnly value to set. - * @return the StorageAccountUpdateParameters object itself. - */ - public StorageAccountUpdateParameters withEnableHttpsTrafficOnly(Boolean enableHttpsTrafficOnly) { - if (this.innerProperties() == null) { - this.innerProperties = new StorageAccountPropertiesUpdateParameters(); - } - this.innerProperties().withEnableHttpsTrafficOnly(enableHttpsTrafficOnly); - return this; - } - - /** - * Get the networkRuleSet property: Network rule set. - * - * @return the networkRuleSet value. - */ - public NetworkRuleSet networkRuleSet() { - return this.innerProperties() == null ? null : this.innerProperties().networkRuleSet(); - } - - /** - * Set the networkRuleSet property: Network rule set. - * - * @param networkRuleSet the networkRuleSet value to set. - * @return the StorageAccountUpdateParameters object itself. - */ - public StorageAccountUpdateParameters withNetworkRuleSet(NetworkRuleSet networkRuleSet) { - if (this.innerProperties() == null) { - this.innerProperties = new StorageAccountPropertiesUpdateParameters(); - } - this.innerProperties().withNetworkRuleSet(networkRuleSet); - return this; - } - - /** - * Get the largeFileSharesState property: Allow large file shares if sets to Enabled. It cannot be disabled once it - * is enabled. - * - * @return the largeFileSharesState value. - */ - public LargeFileSharesState largeFileSharesState() { - return this.innerProperties() == null ? null : this.innerProperties().largeFileSharesState(); - } - - /** - * Set the largeFileSharesState property: Allow large file shares if sets to Enabled. It cannot be disabled once it - * is enabled. - * - * @param largeFileSharesState the largeFileSharesState value to set. - * @return the StorageAccountUpdateParameters object itself. - */ - public StorageAccountUpdateParameters withLargeFileSharesState(LargeFileSharesState largeFileSharesState) { - if (this.innerProperties() == null) { - this.innerProperties = new StorageAccountPropertiesUpdateParameters(); - } - this.innerProperties().withLargeFileSharesState(largeFileSharesState); - return this; - } - - /** - * Get the routingPreference property: Maintains information about the network routing choice opted by the user for - * data transfer. - * - * @return the routingPreference value. - */ - public RoutingPreference routingPreference() { - return this.innerProperties() == null ? null : this.innerProperties().routingPreference(); - } - - /** - * Set the routingPreference property: Maintains information about the network routing choice opted by the user for - * data transfer. - * - * @param routingPreference the routingPreference value to set. - * @return the StorageAccountUpdateParameters object itself. - */ - public StorageAccountUpdateParameters withRoutingPreference(RoutingPreference routingPreference) { - if (this.innerProperties() == null) { - this.innerProperties = new StorageAccountPropertiesUpdateParameters(); - } - this.innerProperties().withRoutingPreference(routingPreference); - return this; - } - - /** - * Get the allowBlobPublicAccess property: Allow or disallow public access to all blobs or containers in the storage - * account. The default interpretation is true for this property. - * - * @return the allowBlobPublicAccess value. - */ - public Boolean allowBlobPublicAccess() { - return this.innerProperties() == null ? null : this.innerProperties().allowBlobPublicAccess(); - } - - /** - * Set the allowBlobPublicAccess property: Allow or disallow public access to all blobs or containers in the storage - * account. The default interpretation is true for this property. - * - * @param allowBlobPublicAccess the allowBlobPublicAccess value to set. - * @return the StorageAccountUpdateParameters object itself. - */ - public StorageAccountUpdateParameters withAllowBlobPublicAccess(Boolean allowBlobPublicAccess) { - if (this.innerProperties() == null) { - this.innerProperties = new StorageAccountPropertiesUpdateParameters(); - } - this.innerProperties().withAllowBlobPublicAccess(allowBlobPublicAccess); - return this; - } - - /** - * Get the minimumTlsVersion property: Set the minimum TLS version to be permitted on requests to storage. The - * default interpretation is TLS 1.0 for this property. - * - * @return the minimumTlsVersion value. - */ - public MinimumTlsVersion minimumTlsVersion() { - return this.innerProperties() == null ? null : this.innerProperties().minimumTlsVersion(); - } - - /** - * Set the minimumTlsVersion property: Set the minimum TLS version to be permitted on requests to storage. The - * default interpretation is TLS 1.0 for this property. - * - * @param minimumTlsVersion the minimumTlsVersion value to set. - * @return the StorageAccountUpdateParameters object itself. - */ - public StorageAccountUpdateParameters withMinimumTlsVersion(MinimumTlsVersion minimumTlsVersion) { - if (this.innerProperties() == null) { - this.innerProperties = new StorageAccountPropertiesUpdateParameters(); - } - this.innerProperties().withMinimumTlsVersion(minimumTlsVersion); - return this; - } - - /** - * Get the allowSharedKeyAccess property: Indicates whether the storage account permits requests to be authorized - * with the account access key via Shared Key. If false, then all requests, including shared access signatures, must - * be authorized with Azure Active Directory (Azure AD). The default value is null, which is equivalent to true. - * - * @return the allowSharedKeyAccess value. - */ - public Boolean allowSharedKeyAccess() { - return this.innerProperties() == null ? null : this.innerProperties().allowSharedKeyAccess(); - } - - /** - * Set the allowSharedKeyAccess property: Indicates whether the storage account permits requests to be authorized - * with the account access key via Shared Key. If false, then all requests, including shared access signatures, must - * be authorized with Azure Active Directory (Azure AD). The default value is null, which is equivalent to true. - * - * @param allowSharedKeyAccess the allowSharedKeyAccess value to set. - * @return the StorageAccountUpdateParameters object itself. - */ - public StorageAccountUpdateParameters withAllowSharedKeyAccess(Boolean allowSharedKeyAccess) { - if (this.innerProperties() == null) { - this.innerProperties = new StorageAccountPropertiesUpdateParameters(); - } - this.innerProperties().withAllowSharedKeyAccess(allowSharedKeyAccess); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (sku() != null) { - sku().validate(); - } - if (identity() != null) { - identity().validate(); - } - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccounts.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccounts.java deleted file mode 100644 index f723d089017c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccounts.java +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsBatchDeletion; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsDeletingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsListingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsBatchCreation; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsCreating; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingById; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; -import com.azure.resourcemanager.storage.StorageManager; -import reactor.core.publisher.Mono; - -/** Entry point for storage accounts management API. */ -@Fluent -public interface StorageAccounts - extends SupportsListing, - SupportsCreating, - SupportsDeletingById, - SupportsListingByResourceGroup, - SupportsGettingByResourceGroup, - SupportsGettingById, - SupportsDeletingByResourceGroup, - SupportsBatchCreation, - SupportsBatchDeletion, - HasManager { - /** - * Checks that account name is valid and is not in use. - * - * @param name the account name to check - * @return whether the name is available and other info if not - */ - CheckNameAvailabilityResult checkNameAvailability(String name); - - /** - * Checks that account name is valid and is not in use asynchronously. - * - * @param name the account name to check - * @return a representation of the deferred computation of this call, returning whether the name is available and - * other info if not - */ - Mono checkNameAvailabilityAsync(String name); - - /** - * Creates an Sas token for the storage account. - * - * @param resourceGroupName the name of the account's resource group - * @param accountName the account name to check - * @param parameters the parameters to list service SAS credentials of a specific resource - * @return the created Sas token - */ - String createSasToken(String resourceGroupName, String accountName, ServiceSasParameters parameters); - - /** - * Creates an Sas token for the storage account asynchronously. - * - * @param resourceGroupName the name of the account's resource group - * @param accountName the account name to check - * @param parameters the parameters to list service SAS credentials of a specific resource - * @return an observable of the created Sas token - */ - Mono createSasTokenAsync(String resourceGroupName, String accountName, ServiceSasParameters parameters); - - /** - * Sets a failover request that can be triggered for a storage account in case of availability issues. - * - * @param resourceGroupName the resource group name of the storage account - * @param accountName the account name to check - */ - void failover(String resourceGroupName, String accountName); - - /** - * Sets a failover request asynchronously that can be triggered for a storage account in case of availability - * issues. - * - * @param resourceGroupName the resource group name of the storage account - * @param accountName the account name to check - * @return a completable - */ - Mono failoverAsync(String resourceGroupName, String accountName); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageResourceType.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageResourceType.java deleted file mode 100644 index 175b2ba9d345..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageResourceType.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** Storage resource types. */ -public class StorageResourceType extends ExpandableStringEnum { - /** Static value storageAccounts for StorageResourceType. */ - public static final StorageResourceType STORAGE_ACCOUNTS = fromString("storageAccounts"); - - /** - * Finds or creates storage resource type based on the specified string. - * - * @param str the storage resource type in string format - * @return an instance of StorageResourceType - */ - public static StorageResourceType fromString(String str) { - return fromString(str, StorageResourceType.class); - } - - /** @return known storage resource types */ - public static Collection values() { - return values(StorageResourceType.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageService.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageService.java deleted file mode 100644 index 11a0a7302a1e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageService.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** Azure storage service types. */ -public class StorageService extends ExpandableStringEnum { - /** Static value Blob for StorageService. */ - public static final StorageService BLOB = fromString("Blob"); - - /** Static value Table for StorageService. */ - public static final StorageService TABLE = fromString("Table"); - - /** Static value Queue for StorageService. */ - public static final StorageService QUEUE = fromString("Queue"); - - /** Static value File for StorageService. */ - public static final StorageService FILE = fromString("File"); - - /** - * Creates or finds a service service type based on its name. - * - * @param name a name to look for - * @return an StorageService - */ - public static StorageService fromString(String name) { - return fromString(name, StorageService.class); - } - - /** @return known storage service types. */ - public static Collection values() { - return values(StorageService.class); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageSku.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageSku.java deleted file mode 100644 index f0bf640883c8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageSku.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Region; -import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel; -import com.azure.resourcemanager.storage.fluent.models.SkuInformationInner; -import java.util.List; - -/** Type representing sku for an Azure storage resource. */ -@Fluent -public interface StorageSku extends HasInnerModel { - /** @return the sku name */ - SkuName name(); - /** @return the sku tier */ - SkuTier tier(); - /** @return the storage resource type that the sku describes */ - StorageResourceType resourceType(); - /** @return the regions that the sku is available */ - List regions(); - /** @return the capability information in the specified sku */ - List capabilities(); - /** @return restrictions because of which sku cannot be used */ - List restrictions(); - /** @return the storage account kind if the sku describes a storage account resource */ - Kind storageAccountKind(); - /** @return the storage account sku type if the sku describes a storage account resource */ - StorageAccountSkuType storageAccountSku(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageSkuListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageSkuListResult.java deleted file mode 100644 index 158a12f48725..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageSkuListResult.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.storage.fluent.models.SkuInformationInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The response from the List Storage SKUs operation. */ -@Immutable -public final class StorageSkuListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageSkuListResult.class); - - /* - * Get the list result of storage SKUs and their properties. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /** - * Get the value property: Get the list result of storage SKUs and their properties. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageSkus.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageSkus.java deleted file mode 100644 index 8a8e30def812..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageSkus.java +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.storage.models; - -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; -import com.azure.resourcemanager.storage.StorageManager; - -/** Entry point to storage service SKUs. */ -public interface StorageSkus extends SupportsListing, HasManager { -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageUsage.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageUsage.java deleted file mode 100644 index e31a737669d5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageUsage.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// package com.azure.management.storage; -// -// -// import com.azure.core.annotation.Fluent; -// -/// ** -// * An immutable client-side representation of an Azure storage resource usage info object. -// */ -// @Fluent -// public interface StorageUsage extends HasInner { -// /** -// * @return the unit of measurement. Possible values include: 'Count', -// * 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', 'BytesPerSecond'. -// */ -// UsageUnit unit(); -// -// /** -// * @return the current count of the allocated resources in the subscription -// */ -// int currentValue(); -// -// /** -// * @return the maximum count of the resources that can be allocated in the -// * subscription -// */ -// int limit(); -// -// /** -// * @return the name of the type of usage -// */ -// UsageName name(); -// -// } diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/TagFilter.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/TagFilter.java deleted file mode 100644 index 27289586643c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/TagFilter.java +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Blob index tag based filtering for blob objects. */ -@Fluent -public final class TagFilter { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TagFilter.class); - - /* - * This is the filter tag name, it can have 1 - 128 characters - */ - @JsonProperty(value = "name", required = true) - private String name; - - /* - * This is the comparison operator which is used for object comparison and - * filtering. Only == (equality operator) is currently supported - */ - @JsonProperty(value = "op", required = true) - private String op; - - /* - * This is the filter tag value field used for tag based filtering, it can - * have 0 - 256 characters - */ - @JsonProperty(value = "value", required = true) - private String value; - - /** - * Get the name property: This is the filter tag name, it can have 1 - 128 characters. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: This is the filter tag name, it can have 1 - 128 characters. - * - * @param name the name value to set. - * @return the TagFilter object itself. - */ - public TagFilter withName(String name) { - this.name = name; - return this; - } - - /** - * Get the op property: This is the comparison operator which is used for object comparison and filtering. Only == - * (equality operator) is currently supported. - * - * @return the op value. - */ - public String op() { - return this.op; - } - - /** - * Set the op property: This is the comparison operator which is used for object comparison and filtering. Only == - * (equality operator) is currently supported. - * - * @param op the op value to set. - * @return the TagFilter object itself. - */ - public TagFilter withOp(String op) { - this.op = op; - return this; - } - - /** - * Get the value property: This is the filter tag value field used for tag based filtering, it can have 0 - 256 - * characters. - * - * @return the value value. - */ - public String value() { - return this.value; - } - - /** - * Set the value property: This is the filter tag value field used for tag based filtering, it can have 0 - 256 - * characters. - * - * @param value the value value to set. - * @return the TagFilter object itself. - */ - public TagFilter withValue(String value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() == null) { - throw logger - .logExceptionAsError(new IllegalArgumentException("Missing required property name in model TagFilter")); - } - if (op() == null) { - throw logger - .logExceptionAsError(new IllegalArgumentException("Missing required property op in model TagFilter")); - } - if (value() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model TagFilter")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/TagProperty.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/TagProperty.java deleted file mode 100644 index 2c5472482de9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/TagProperty.java +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** A tag of the LegalHold of a blob container. */ -@Immutable -public final class TagProperty { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TagProperty.class); - - /* - * The tag value. - */ - @JsonProperty(value = "tag", access = JsonProperty.Access.WRITE_ONLY) - private String tag; - - /* - * Returns the date and time the tag was added. - */ - @JsonProperty(value = "timestamp", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime timestamp; - - /* - * Returns the Object ID of the user who added the tag. - */ - @JsonProperty(value = "objectIdentifier", access = JsonProperty.Access.WRITE_ONLY) - private String objectIdentifier; - - /* - * Returns the Tenant ID that issued the token for the user who added the - * tag. - */ - @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) - private String tenantId; - - /* - * Returns the User Principal Name of the user who added the tag. - */ - @JsonProperty(value = "upn", access = JsonProperty.Access.WRITE_ONLY) - private String upn; - - /** - * Get the tag property: The tag value. - * - * @return the tag value. - */ - public String tag() { - return this.tag; - } - - /** - * Get the timestamp property: Returns the date and time the tag was added. - * - * @return the timestamp value. - */ - public OffsetDateTime timestamp() { - return this.timestamp; - } - - /** - * Get the objectIdentifier property: Returns the Object ID of the user who added the tag. - * - * @return the objectIdentifier value. - */ - public String objectIdentifier() { - return this.objectIdentifier; - } - - /** - * Get the tenantId property: Returns the Tenant ID that issued the token for the user who added the tag. - * - * @return the tenantId value. - */ - public String tenantId() { - return this.tenantId; - } - - /** - * Get the upn property: Returns the User Principal Name of the user who added the tag. - * - * @return the upn value. - */ - public String upn() { - return this.upn; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/UpdateHistoryProperty.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/UpdateHistoryProperty.java deleted file mode 100644 index 00b1c8874600..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/UpdateHistoryProperty.java +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** An update history of the ImmutabilityPolicy of a blob container. */ -@Immutable -public final class UpdateHistoryProperty { - @JsonIgnore private final ClientLogger logger = new ClientLogger(UpdateHistoryProperty.class); - - /* - * The ImmutabilityPolicy update type of a blob container, possible values - * include: put, lock and extend. - */ - @JsonProperty(value = "update", access = JsonProperty.Access.WRITE_ONLY) - private ImmutabilityPolicyUpdateType update; - - /* - * The immutability period for the blobs in the container since the policy - * creation, in days. - */ - @JsonProperty(value = "immutabilityPeriodSinceCreationInDays", access = JsonProperty.Access.WRITE_ONLY) - private Integer immutabilityPeriodSinceCreationInDays; - - /* - * Returns the date and time the ImmutabilityPolicy was updated. - */ - @JsonProperty(value = "timestamp", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime timestamp; - - /* - * Returns the Object ID of the user who updated the ImmutabilityPolicy. - */ - @JsonProperty(value = "objectIdentifier", access = JsonProperty.Access.WRITE_ONLY) - private String objectIdentifier; - - /* - * Returns the Tenant ID that issued the token for the user who updated the - * ImmutabilityPolicy. - */ - @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) - private String tenantId; - - /* - * Returns the User Principal Name of the user who updated the - * ImmutabilityPolicy. - */ - @JsonProperty(value = "upn", access = JsonProperty.Access.WRITE_ONLY) - private String upn; - - /** - * Get the update property: The ImmutabilityPolicy update type of a blob container, possible values include: put, - * lock and extend. - * - * @return the update value. - */ - public ImmutabilityPolicyUpdateType update() { - return this.update; - } - - /** - * Get the immutabilityPeriodSinceCreationInDays property: The immutability period for the blobs in the container - * since the policy creation, in days. - * - * @return the immutabilityPeriodSinceCreationInDays value. - */ - public Integer immutabilityPeriodSinceCreationInDays() { - return this.immutabilityPeriodSinceCreationInDays; - } - - /** - * Get the timestamp property: Returns the date and time the ImmutabilityPolicy was updated. - * - * @return the timestamp value. - */ - public OffsetDateTime timestamp() { - return this.timestamp; - } - - /** - * Get the objectIdentifier property: Returns the Object ID of the user who updated the ImmutabilityPolicy. - * - * @return the objectIdentifier value. - */ - public String objectIdentifier() { - return this.objectIdentifier; - } - - /** - * Get the tenantId property: Returns the Tenant ID that issued the token for the user who updated the - * ImmutabilityPolicy. - * - * @return the tenantId value. - */ - public String tenantId() { - return this.tenantId; - } - - /** - * Get the upn property: Returns the User Principal Name of the user who updated the ImmutabilityPolicy. - * - * @return the upn value. - */ - public String upn() { - return this.upn; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/UsageListResult.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/UsageListResult.java deleted file mode 100644 index c95118c288de..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/UsageListResult.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.storage.fluent.models.UsageInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The response from the List Usages operation. */ -@Fluent -public final class UsageListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(UsageListResult.class); - - /* - * Gets or sets the list of Storage Resource Usages. - */ - @JsonProperty(value = "value") - private List value; - - /** - * Get the value property: Gets or sets the list of Storage Resource Usages. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Gets or sets the list of Storage Resource Usages. - * - * @param value the value value to set. - * @return the UsageListResult object itself. - */ - public UsageListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/UsageName.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/UsageName.java deleted file mode 100644 index e4e5b3796655..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/UsageName.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The usage names that can be used; currently limited to StorageAccount. */ -@Immutable -public final class UsageName { - @JsonIgnore private final ClientLogger logger = new ClientLogger(UsageName.class); - - /* - * Gets a string describing the resource name. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private String value; - - /* - * Gets a localized string describing the resource name. - */ - @JsonProperty(value = "localizedValue", access = JsonProperty.Access.WRITE_ONLY) - private String localizedValue; - - /** - * Get the value property: Gets a string describing the resource name. - * - * @return the value value. - */ - public String value() { - return this.value; - } - - /** - * Get the localizedValue property: Gets a localized string describing the resource name. - * - * @return the localizedValue value. - */ - public String localizedValue() { - return this.localizedValue; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/UsageUnit.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/UsageUnit.java deleted file mode 100644 index 046bbe00f5df..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/UsageUnit.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for UsageUnit. */ -public enum UsageUnit { - /** Enum value Count. */ - COUNT("Count"), - - /** Enum value Bytes. */ - BYTES("Bytes"), - - /** Enum value Seconds. */ - SECONDS("Seconds"), - - /** Enum value Percent. */ - PERCENT("Percent"), - - /** Enum value CountsPerSecond. */ - COUNTS_PER_SECOND("CountsPerSecond"), - - /** Enum value BytesPerSecond. */ - BYTES_PER_SECOND("BytesPerSecond"); - - /** The actual serialized value for a UsageUnit instance. */ - private final String value; - - UsageUnit(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a UsageUnit instance. - * - * @param value the serialized value to parse. - * @return the parsed UsageUnit object, or null if unable to parse. - */ - @JsonCreator - public static UsageUnit fromString(String value) { - UsageUnit[] items = UsageUnit.values(); - for (UsageUnit item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Usages.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Usages.java deleted file mode 100644 index a51aa026d84d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Usages.java +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; -import com.azure.resourcemanager.storage.StorageManager; -import com.azure.resourcemanager.storage.fluent.models.UsageInner; - -/** Entry point for storage resource usage management API. */ -@Fluent -public interface Usages extends SupportsListing, HasManager { -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/VirtualNetworkRule.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/VirtualNetworkRule.java deleted file mode 100644 index 2791fc52e5ad..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/VirtualNetworkRule.java +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storage.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Virtual Network rule. */ -@Fluent -public final class VirtualNetworkRule { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkRule.class); - - /* - * Resource ID of a subnet, for example: - * /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. - */ - @JsonProperty(value = "id", required = true) - private String virtualNetworkResourceId; - - /* - * The action of virtual network rule. - */ - @JsonProperty(value = "action") - private Action action; - - /* - * Gets the state of virtual network rule. - */ - @JsonProperty(value = "state") - private State state; - - /** - * Get the virtualNetworkResourceId property: Resource ID of a subnet, for example: - * /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. - * - * @return the virtualNetworkResourceId value. - */ - public String virtualNetworkResourceId() { - return this.virtualNetworkResourceId; - } - - /** - * Set the virtualNetworkResourceId property: Resource ID of a subnet, for example: - * /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. - * - * @param virtualNetworkResourceId the virtualNetworkResourceId value to set. - * @return the VirtualNetworkRule object itself. - */ - public VirtualNetworkRule withVirtualNetworkResourceId(String virtualNetworkResourceId) { - this.virtualNetworkResourceId = virtualNetworkResourceId; - return this; - } - - /** - * Get the action property: The action of virtual network rule. - * - * @return the action value. - */ - public Action action() { - return this.action; - } - - /** - * Set the action property: The action of virtual network rule. - * - * @param action the action value to set. - * @return the VirtualNetworkRule object itself. - */ - public VirtualNetworkRule withAction(Action action) { - this.action = action; - return this; - } - - /** - * Get the state property: Gets the state of virtual network rule. - * - * @return the state value. - */ - public State state() { - return this.state; - } - - /** - * Set the state property: Gets the state of virtual network rule. - * - * @param state the state value to set. - * @return the VirtualNetworkRule object itself. - */ - public VirtualNetworkRule withState(State state) { - this.state = state; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (virtualNetworkResourceId() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property virtualNetworkResourceId in model VirtualNetworkRule")); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/package-info.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/package-info.java deleted file mode 100644 index a1ade621fd6a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** Package containing the data models for StorageManagementClient. The Azure Storage Management API. */ -package com.azure.resourcemanager.storage.models; diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/package-info.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/package-info.java deleted file mode 100644 index ee1bd70af406..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** Package containing the classes for StorageManagementClient. The Azure Storage Management API. */ -package com.azure.resourcemanager.storage; diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/module-info.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/module-info.java deleted file mode 100644 index 1483af764f9f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/module-info.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -module com.azure.resourcemanager.storage { - requires transitive com.azure.resourcemanager.resources; - - // export public APIs of storage - exports com.azure.resourcemanager.storage; - exports com.azure.resourcemanager.storage.fluent; - exports com.azure.resourcemanager.storage.fluent.models; - exports com.azure.resourcemanager.storage.models; - - // open packages specifically for azure core and jackson - opens com.azure.resourcemanager.storage.fluent.models to - com.azure.core, - com.fasterxml.jackson.databind; - opens com.azure.resourcemanager.storage.models to - com.azure.core, - com.fasterxml.jackson.databind; -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/samples/java/com/azure/resourcemanager/storage/ReadmeSamples.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/samples/java/com/azure/resourcemanager/storage/ReadmeSamples.java deleted file mode 100644 index f30d65aded6d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/samples/java/com/azure/resourcemanager/storage/ReadmeSamples.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.storage; - -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpMethod; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.util.serializer.JacksonAdapter; -import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.identity.DefaultAzureCredentialBuilder; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.ArrayNode; - -import java.io.IOException; -import java.util.HashMap; - -public class ReadmeSamples { - - public void authenticate() { - // BEGIN: com.azure.resourcemanager.storage.authenticate - String armEndpoint = "https://management.."; - AzureProfile profile = new AzureProfile(getAzureEnvironmentFromArmEndpoint(armEndpoint)); - TokenCredential credential = new DefaultAzureCredentialBuilder() - .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) - .build(); - StorageManager manager = StorageManager - .authenticate(credential, profile); - // END: com.azure.resourcemanager.storage.authenticate - } - - // BEGIN: com.azure.resourcemanager.storage.getazureenvironment - private static AzureEnvironment getAzureEnvironmentFromArmEndpoint(String armEndpoint) { - // Create HTTP client and request - HttpClient httpClient = HttpClient.createDefault(); - - HttpRequest request = new HttpRequest(HttpMethod.GET, - String.format("%s/metadata/endpoints?api-version=2019-10-01", armEndpoint)) - .setHeader("accept", "application/json"); - - // Execute the request and read the response - HttpResponse response = httpClient.send(request).block(); - if (response.getStatusCode() != 200) { - throw new RuntimeException("Failed : HTTP error code : " + response.getStatusCode()); - } - String body = response.getBodyAsString().block(); - try { - ArrayNode metadataArray = JacksonAdapter.createDefaultSerializerAdapter() - .deserialize(body, ArrayNode.class, SerializerEncoding.JSON); - - if (metadataArray == null || metadataArray.isEmpty()) { - throw new RuntimeException("Failed to find metadata : " + body); - } - - JsonNode metadata = metadataArray.iterator().next(); - AzureEnvironment azureEnvironment = new AzureEnvironment(new HashMap() { - { - put("managementEndpointUrl", metadata.at("/authentication/audiences/0").asText()); - put("resourceManagerEndpointUrl", armEndpoint); - put("galleryEndpointUrl", metadata.at("/gallery").asText()); - put("activeDirectoryEndpointUrl", metadata.at("/authentication/loginEndpoint").asText()); - put("activeDirectoryResourceId", metadata.at("/authentication/audiences/0").asText()); - put("activeDirectoryGraphResourceId", metadata.at("/graph").asText()); - put("storageEndpointSuffix", "." + metadata.at("/suffixes/storage").asText()); - put("keyVaultDnsSuffix", "." + metadata.at("/suffixes/keyVaultDns").asText()); - } - }); - return azureEnvironment; - } catch (IOException ioe) { - ioe.printStackTrace(); - throw new RuntimeException(ioe); - } - } - // END: com.azure.resourcemanager.storage.getazureenvironment -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/test/java/com/azure/resourcemanager/storage/ImmutabilityPolicyTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/test/java/com/azure/resourcemanager/storage/ImmutabilityPolicyTests.java deleted file mode 100644 index 16c6dad84c61..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/test/java/com/azure/resourcemanager/storage/ImmutabilityPolicyTests.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.storage; - -import com.azure.core.http.HttpPipeline; -import com.azure.core.management.Region; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.storage.models.BlobContainer; -import com.azure.resourcemanager.storage.models.ImmutabilityPolicy; -import com.azure.resourcemanager.storage.models.ImmutabilityPolicyState; -import com.azure.resourcemanager.storage.models.PublicAccess; -import com.azure.resourcemanager.storage.models.StorageAccount; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public class ImmutabilityPolicyTests extends StorageManagementTest { - private String rgName = ""; - - @Override - protected void initializeClients(HttpPipeline httpPipeline, AzureProfile profile) { - rgName = generateRandomResourceName("javacsmrg", 15); - - super.initializeClients(httpPipeline, profile); - } - - @Override - protected void cleanUpResources() { - resourceManager.resourceGroups().beginDeleteByName(rgName); - } - - @Test - public void canCRUDImmutabilityPolicy() { - String saName = generateRandomResourceName("javacsmsa", 15); - - StorageAccount storageAccount = storageManager.storageAccounts().define(saName) - .withRegion(locationOrDefault(Region.US_EAST)) - .withNewResourceGroup(rgName) - .create(); - - BlobContainer container = storageManager.blobContainers().defineContainer("container") - .withExistingStorageAccount(storageAccount) - .withPublicAccess(PublicAccess.NONE) - .create(); - - // immutability policy - ImmutabilityPolicy policy = storageManager.blobContainers().defineImmutabilityPolicy() - .withExistingContainer(storageAccount.resourceGroupName(), storageAccount.name(), container.name()) - .withImmutabilityPeriodSinceCreationInDays(7) - .create(); - - Assertions.assertEquals(7, policy.immutabilityPeriodSinceCreationInDays()); - - // refresh - policy.refresh(); - Assertions.assertEquals(ImmutabilityPolicyState.UNLOCKED, policy.state()); - - policy = storageManager.blobContainers().getImmutabilityPolicy(storageAccount.resourceGroupName(), storageAccount.name(), container.name()); - - // update - policy.update() - .withImmutabilityPeriodSinceCreationInDays(14) - .apply(); - - Assertions.assertEquals(14, policy.immutabilityPeriodSinceCreationInDays()); - - // delete - storageManager.blobContainers().deleteImmutabilityPolicy(storageAccount.resourceGroupName(), storageAccount.name(), container.name(), policy.etag()); - - // new immutability policy - policy = storageManager.blobContainers().defineImmutabilityPolicy() - .withExistingContainer(storageAccount.resourceGroupName(), storageAccount.name(), container.name()) - .withImmutabilityPeriodSinceCreationInDays(7) - .create(); - - // lock, now the immutability policy cannot be deleted - policy.lock(); - - Assertions.assertEquals(ImmutabilityPolicyState.LOCKED, policy.state()); - - // extend - policy.extend(14); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/test/java/com/azure/resourcemanager/storage/StorageAccountNetworkRuleTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/test/java/com/azure/resourcemanager/storage/StorageAccountNetworkRuleTests.java deleted file mode 100644 index 4b0103cf1fa8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/test/java/com/azure/resourcemanager/storage/StorageAccountNetworkRuleTests.java +++ /dev/null @@ -1,187 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.storage; - -import com.azure.core.http.HttpPipeline; -import com.azure.resourcemanager.resources.models.ResourceGroup; -import com.azure.core.management.Region; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.storage.models.DefaultAction; -import com.azure.resourcemanager.storage.models.StorageAccount; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public class StorageAccountNetworkRuleTests extends StorageManagementTest { - private String rgName = ""; - - @Override - protected void initializeClients(HttpPipeline httpPipeline, AzureProfile profile) { - rgName = generateRandomResourceName("javacsmrg", 15); - - super.initializeClients(httpPipeline, profile); - } - - @Override - protected void cleanUpResources() { - resourceManager.resourceGroups().deleteByName(rgName); - } - - @Test - public void canConfigureNetworkRulesWithCreate() throws Exception { - String saName1 = generateRandomResourceName("javacsmsa", 15); - String saName2 = generateRandomResourceName("javacsmsa", 15); - String saName3 = generateRandomResourceName("javacsmsa", 15); - String saName4 = generateRandomResourceName("javacsmsa", 15); - - StorageAccount storageAccount1 = - storageManager - .storageAccounts() - .define(saName1) - .withRegion(locationOrDefault(Region.US_EAST)) - .withNewResourceGroup(rgName) - .create(); - - Assertions.assertNotNull(storageAccount1.networkSubnetsWithAccess()); - Assertions.assertEquals(0, storageAccount1.networkSubnetsWithAccess().size()); - - Assertions.assertNotNull(storageAccount1.ipAddressesWithAccess()); - Assertions.assertEquals(0, storageAccount1.ipAddressesWithAccess().size()); - - Assertions.assertNotNull(storageAccount1.ipAddressRangesWithAccess()); - Assertions.assertEquals(0, storageAccount1.ipAddressRangesWithAccess().size()); - - Assertions.assertTrue(storageAccount1.isAccessAllowedFromAllNetworks()); - Assertions.assertTrue(storageAccount1.canAccessFromAzureServices()); - Assertions.assertTrue(storageAccount1.canReadMetricsFromAnyNetwork()); - Assertions.assertTrue(storageAccount1.canReadMetricsFromAnyNetwork()); - - ResourceGroup resourceGroup = resourceManager.resourceGroups().getByName(storageAccount1.resourceGroupName()); - - StorageAccount storageAccount2 = - storageManager - .storageAccounts() - .define(saName2) - .withRegion(locationOrDefault(Region.US_EAST)) - .withExistingResourceGroup(resourceGroup) - .withAccessFromIpAddress("23.20.0.0") - .create(); - - Assertions.assertNotNull(storageAccount2.innerModel().networkRuleSet()); - Assertions.assertNotNull(storageAccount2.innerModel().networkRuleSet().defaultAction()); - Assertions.assertNotNull(storageAccount2.innerModel().networkRuleSet().defaultAction().equals(DefaultAction.DENY)); - - Assertions.assertNotNull(storageAccount2.networkSubnetsWithAccess()); - Assertions.assertEquals(0, storageAccount2.networkSubnetsWithAccess().size()); - - Assertions.assertNotNull(storageAccount2.ipAddressesWithAccess()); - Assertions.assertEquals(1, storageAccount2.ipAddressesWithAccess().size()); - - Assertions.assertNotNull(storageAccount2.ipAddressRangesWithAccess()); - Assertions.assertEquals(0, storageAccount2.ipAddressRangesWithAccess().size()); - - Assertions.assertFalse(storageAccount2.isAccessAllowedFromAllNetworks()); - Assertions.assertFalse(storageAccount2.canAccessFromAzureServices()); - Assertions.assertFalse(storageAccount2.canReadMetricsFromAnyNetwork()); - Assertions.assertFalse(storageAccount2.canReadMetricsFromAnyNetwork()); - - StorageAccount storageAccount3 = - storageManager - .storageAccounts() - .define(saName3) - .withRegion(locationOrDefault(Region.US_EAST)) - .withNewResourceGroup(rgName) - .withAccessFromAllNetworks() - .withAccessFromIpAddress("23.20.0.0") - .create(); - - Assertions.assertNotNull(storageAccount3.innerModel().networkRuleSet()); - Assertions.assertNotNull(storageAccount3.innerModel().networkRuleSet().defaultAction()); - Assertions.assertNotNull(storageAccount3.innerModel().networkRuleSet().defaultAction().equals(DefaultAction.ALLOW)); - - Assertions.assertNotNull(storageAccount3.networkSubnetsWithAccess()); - Assertions.assertEquals(0, storageAccount3.networkSubnetsWithAccess().size()); - - Assertions.assertNotNull(storageAccount3.ipAddressesWithAccess()); - Assertions.assertEquals(1, storageAccount3.ipAddressesWithAccess().size()); - - Assertions.assertNotNull(storageAccount3.ipAddressRangesWithAccess()); - Assertions.assertEquals(0, storageAccount3.ipAddressRangesWithAccess().size()); - - Assertions.assertTrue(storageAccount3.isAccessAllowedFromAllNetworks()); - Assertions.assertTrue(storageAccount3.canAccessFromAzureServices()); - Assertions.assertTrue(storageAccount3.canReadMetricsFromAnyNetwork()); - Assertions.assertTrue(storageAccount3.canReadLogEntriesFromAnyNetwork()); - - StorageAccount storageAccount4 = - storageManager - .storageAccounts() - .define(saName4) - .withRegion(locationOrDefault(Region.US_EAST)) - .withExistingResourceGroup(resourceGroup) - .withReadAccessToLogEntriesFromAnyNetwork() - .withReadAccessToMetricsFromAnyNetwork() - .create(); - - Assertions.assertNotNull(storageAccount4.innerModel().networkRuleSet()); - Assertions.assertNotNull(storageAccount4.innerModel().networkRuleSet().defaultAction()); - Assertions.assertNotNull(storageAccount4.innerModel().networkRuleSet().defaultAction().equals(DefaultAction.DENY)); - - Assertions.assertNotNull(storageAccount4.networkSubnetsWithAccess()); - Assertions.assertEquals(0, storageAccount4.networkSubnetsWithAccess().size()); - - Assertions.assertNotNull(storageAccount4.ipAddressesWithAccess()); - Assertions.assertEquals(0, storageAccount4.ipAddressesWithAccess().size()); - - Assertions.assertNotNull(storageAccount3.ipAddressRangesWithAccess()); - Assertions.assertEquals(0, storageAccount4.ipAddressRangesWithAccess().size()); - - Assertions.assertFalse(storageAccount4.isAccessAllowedFromAllNetworks()); - Assertions.assertFalse(storageAccount4.canAccessFromAzureServices()); - Assertions.assertTrue(storageAccount4.canReadMetricsFromAnyNetwork()); - Assertions.assertTrue(storageAccount4.canReadLogEntriesFromAnyNetwork()); - } - - @Test - public void canConfigureNetworkRulesWithUpdate() throws Exception { - String saName1 = generateRandomResourceName("javacsmsa", 15); - - StorageAccount storageAccount1 = - storageManager - .storageAccounts() - .define(saName1) - .withRegion(locationOrDefault(Region.US_EAST)) - .withNewResourceGroup(rgName) - .create(); - - Assertions.assertNotNull(storageAccount1.networkSubnetsWithAccess()); - Assertions.assertEquals(0, storageAccount1.networkSubnetsWithAccess().size()); - - Assertions.assertNotNull(storageAccount1.ipAddressesWithAccess()); - Assertions.assertEquals(0, storageAccount1.ipAddressesWithAccess().size()); - - Assertions.assertNotNull(storageAccount1.ipAddressRangesWithAccess()); - Assertions.assertEquals(0, storageAccount1.ipAddressRangesWithAccess().size()); - - Assertions.assertTrue(storageAccount1.isAccessAllowedFromAllNetworks()); - Assertions.assertTrue(storageAccount1.canAccessFromAzureServices()); - Assertions.assertTrue(storageAccount1.canReadMetricsFromAnyNetwork()); - Assertions.assertTrue(storageAccount1.canReadMetricsFromAnyNetwork()); - - storageAccount1.update().withAccessFromSelectedNetworks().withAccessFromIpAddressRange("23.20.0.0/20").apply(); - - Assertions.assertNotNull(storageAccount1.networkSubnetsWithAccess()); - Assertions.assertEquals(0, storageAccount1.networkSubnetsWithAccess().size()); - - Assertions.assertNotNull(storageAccount1.ipAddressesWithAccess()); - Assertions.assertEquals(0, storageAccount1.ipAddressesWithAccess().size()); - - Assertions.assertNotNull(storageAccount1.ipAddressRangesWithAccess()); - Assertions.assertEquals(1, storageAccount1.ipAddressRangesWithAccess().size()); - - Assertions.assertFalse(storageAccount1.isAccessAllowedFromAllNetworks()); - Assertions.assertTrue(storageAccount1.canAccessFromAzureServices()); - Assertions.assertFalse(storageAccount1.canReadMetricsFromAnyNetwork()); - Assertions.assertFalse(storageAccount1.canReadMetricsFromAnyNetwork()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/test/java/com/azure/resourcemanager/storage/StorageAccountOperationsTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/test/java/com/azure/resourcemanager/storage/StorageAccountOperationsTests.java deleted file mode 100644 index 3b54abf3cec8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/test/java/com/azure/resourcemanager/storage/StorageAccountOperationsTests.java +++ /dev/null @@ -1,184 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.storage; - -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.management.Region; -import com.azure.resourcemanager.storage.models.Kind; -import com.azure.resourcemanager.storage.models.MinimumTlsVersion; -import com.azure.resourcemanager.storage.models.SkuName; -import com.azure.resourcemanager.storage.models.StorageAccount; -import com.azure.resourcemanager.storage.models.StorageAccountEncryptionStatus; -import com.azure.resourcemanager.storage.models.StorageAccountKey; -import com.azure.resourcemanager.storage.models.StorageAccountSkuType; -import com.azure.resourcemanager.storage.models.StorageService; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -import java.util.List; -import java.util.Map; - -public class StorageAccountOperationsTests extends StorageManagementTest { - private String rgName = ""; - private String saName = ""; - - @Override - protected void initializeClients(HttpPipeline httpPipeline, AzureProfile profile) { - rgName = generateRandomResourceName("javacsmrg", 15); - saName = generateRandomResourceName("javacsmsa", 15); - - super.initializeClients(httpPipeline, profile); - } - - @Override - protected void cleanUpResources() { - resourceManager.resourceGroups().beginDeleteByName(rgName); - } - - @Test - public void canCRUDStorageAccount() throws Exception { - // Name available - // Skipping checking name availability for now because of 503 error 'The service is not yet ready to process any - // requests. Please retry in a few moments.' - // CheckNameAvailabilityResult result = storageManager.storageAccounts() - // .checkNameAvailability(SA_NAME); - // Assertions.assertEquals(true, result.isAvailable()); - // Create - Mono resourceStream = - storageManager - .storageAccounts() - .define(saName) - .withRegion(locationOrDefault(Region.ASIA_EAST)) - .withNewResourceGroup(rgName) - .withGeneralPurposeAccountKindV2() - .withTag("tag1", "value1") - .withHnsEnabled(true) - .withAzureFilesAadIntegrationEnabled(false) - .createAsync(); - StorageAccount storageAccount = resourceStream.block(); - Assertions.assertEquals(rgName, storageAccount.resourceGroupName()); - Assertions.assertEquals(SkuName.STANDARD_RAGRS, storageAccount.skuType().name()); - Assertions.assertTrue(storageAccount.isHnsEnabled()); - // Assertions.assertFalse(storageAccount.isAzureFilesAadIntegrationEnabled()); - // List - PagedIterable accounts = storageManager.storageAccounts().listByResourceGroup(rgName); - boolean found = false; - for (StorageAccount account : accounts) { - if (account.name().equals(saName)) { - found = true; - } - } - Assertions.assertTrue(found); - Assertions.assertEquals(1, storageAccount.tags().size()); - - // Get - storageAccount = storageManager.storageAccounts().getByResourceGroup(rgName, saName); - Assertions.assertNotNull(storageAccount); - - // Get Keys - List keys = storageAccount.getKeys(); - Assertions.assertTrue(keys.size() > 0); - - // Regen key - StorageAccountKey oldKey = keys.get(0); - List updatedKeys = storageAccount.regenerateKey(oldKey.keyName()); - Assertions.assertTrue(updatedKeys.size() > 0); - for (StorageAccountKey updatedKey : updatedKeys) { - if (updatedKey.keyName().equalsIgnoreCase(oldKey.keyName())) { - if (!isPlaybackMode()) { - Assertions.assertNotEquals(oldKey.value(), updatedKey.value()); - } - break; - } - } - - Map statuses = storageAccount.encryptionStatuses(); - Assertions.assertNotNull(statuses); - Assertions.assertTrue(statuses.size() > 0); - - Assertions.assertTrue(statuses.containsKey(StorageService.BLOB)); - StorageAccountEncryptionStatus blobServiceEncryptionStatus = statuses.get(StorageService.BLOB); - Assertions.assertNotNull(blobServiceEncryptionStatus); - Assertions.assertTrue(blobServiceEncryptionStatus.isEnabled()); // Service will enable this by default - - Assertions.assertTrue(statuses.containsKey(StorageService.FILE)); - StorageAccountEncryptionStatus fileServiceEncryptionStatus = statuses.get(StorageService.FILE); - Assertions.assertNotNull(fileServiceEncryptionStatus); - Assertions.assertTrue(fileServiceEncryptionStatus.isEnabled()); // Service will enable this by default - - // Update - storageAccount = storageAccount.update() - .withSku(StorageAccountSkuType.STANDARD_LRS).withTag("tag2", "value2").apply(); - Assertions.assertEquals(SkuName.STANDARD_LRS, storageAccount.skuType().name()); - Assertions.assertEquals(2, storageAccount.tags().size()); - } - - @Test - public void canEnableLargeFileSharesOnStorageAccount() throws Exception { - StorageAccount storageAccount = - storageManager - .storageAccounts() - .define(saName) - .withRegion(locationOrDefault(Region.US_EAST2)) - .withNewResourceGroup(rgName) - .withSku(StorageAccountSkuType.STANDARD_LRS) - .withLargeFileShares(true) - .create(); - - Assertions.assertTrue(storageAccount.isLargeFileSharesEnabled()); - } - - @Test - public void storageAccountDefault() { - String saName2 = generateRandomResourceName("javacsmsa", 15); - - // default - StorageAccount storageAccountDefault = storageManager.storageAccounts().define(saName) - .withRegion(locationOrDefault(Region.US_EAST)) - .withNewResourceGroup(rgName) - .create(); - - Assertions.assertEquals(Kind.STORAGE_V2, storageAccountDefault.kind()); - Assertions.assertEquals(SkuName.STANDARD_RAGRS, storageAccountDefault.skuType().name()); - Assertions.assertTrue(storageAccountDefault.isHttpsTrafficOnly()); - Assertions.assertEquals(MinimumTlsVersion.TLS1_2, storageAccountDefault.minimumTlsVersion()); - Assertions.assertTrue(storageAccountDefault.isBlobPublicAccessAllowed()); - Assertions.assertTrue(storageAccountDefault.isSharedKeyAccessAllowed()); - - // update to non-default - StorageAccount storageAccount = storageAccountDefault.update() - .withHttpAndHttpsTraffic() - .withMinimumTlsVersion(MinimumTlsVersion.TLS1_1) - .disableBlobPublicAccess() - .disableSharedKeyAccess() - .apply(); - - Assertions.assertFalse(storageAccount.isHttpsTrafficOnly()); - Assertions.assertEquals(MinimumTlsVersion.TLS1_1, storageAccount.minimumTlsVersion()); - Assertions.assertFalse(storageAccount.isBlobPublicAccessAllowed()); - Assertions.assertFalse(storageAccount.isSharedKeyAccessAllowed()); - - // new storage account configured as non-default - storageAccount = storageManager.storageAccounts().define(saName2) - .withRegion(locationOrDefault(Region.US_EAST)) - .withNewResourceGroup(rgName) - .withSku(StorageAccountSkuType.STANDARD_LRS) - .withGeneralPurposeAccountKind() - .withHttpAndHttpsTraffic() - .withMinimumTlsVersion(MinimumTlsVersion.TLS1_1) - .disableBlobPublicAccess() - .disableSharedKeyAccess() - .create(); - - Assertions.assertEquals(Kind.STORAGE, storageAccount.kind()); - Assertions.assertEquals(SkuName.STANDARD_LRS, storageAccount.skuType().name()); - Assertions.assertFalse(storageAccount.isHttpsTrafficOnly()); - Assertions.assertEquals(MinimumTlsVersion.TLS1_1, storageAccount.minimumTlsVersion()); - Assertions.assertFalse(storageAccount.isBlobPublicAccessAllowed()); - Assertions.assertFalse(storageAccount.isSharedKeyAccessAllowed()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/test/java/com/azure/resourcemanager/storage/StorageBlobContainersTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/test/java/com/azure/resourcemanager/storage/StorageBlobContainersTests.java deleted file mode 100644 index 89fa3e66ae6b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/test/java/com/azure/resourcemanager/storage/StorageBlobContainersTests.java +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.storage; - -import com.azure.core.http.HttpPipeline; -import com.azure.core.management.Region; -import java.util.HashMap; -import java.util.Map; - -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.storage.models.BlobContainer; -import com.azure.resourcemanager.storage.models.BlobContainers; -import com.azure.resourcemanager.storage.models.PublicAccess; -import com.azure.resourcemanager.storage.models.StorageAccount; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public class StorageBlobContainersTests extends StorageManagementTest { - private String rgName = ""; - - @Override - protected void initializeClients(HttpPipeline httpPipeline, AzureProfile profile) { - rgName = generateRandomResourceName("javacsmrg", 15); - - super.initializeClients(httpPipeline, profile); - } - - @Override - protected void cleanUpResources() { - resourceManager.resourceGroups().deleteByName(rgName); - } - - @Test - public void canCreateBlobContainer() { - String saName = generateRandomResourceName("javacmsa", 15); - Map metadataTest = new HashMap(); - metadataTest.put("a", "b"); - metadataTest.put("c", "d"); - - StorageAccount storageAccount = - storageManager - .storageAccounts() - .define(saName) - .withRegion(locationOrDefault(Region.US_EAST)) - .withNewResourceGroup(rgName) - .create(); - - BlobContainers blobContainers = this.storageManager.blobContainers(); - BlobContainer blobContainer = - blobContainers - .defineContainer("blob-test") - .withExistingStorageAccount(rgName, saName) - .withPublicAccess(PublicAccess.CONTAINER) - .withMetadata("a", "b") - .withMetadata("c", "d") - .create(); - - Assertions.assertEquals("blob-test", blobContainer.name()); - Assertions.assertEquals(PublicAccess.CONTAINER, blobContainer.publicAccess()); - Assertions.assertEquals(metadataTest, blobContainer.metadata()); - } - - @Test - public void canUpdateBlobContainer() { - String saName = generateRandomResourceName("javacmsa", 15); - - Map metadataInitial = new HashMap(); - metadataInitial.put("a", "b"); - - Map metadataTest = new HashMap(); - metadataTest.put("c", "d"); - metadataTest.put("e", "f"); - - StorageAccount storageAccount = - storageManager - .storageAccounts() - .define(saName) - .withRegion(locationOrDefault(Region.US_EAST)) - .withNewResourceGroup(rgName) - .create(); - - BlobContainers blobContainers = this.storageManager.blobContainers(); - BlobContainer blobContainer = - blobContainers - .defineContainer("blob-test") - .withExistingStorageAccount(rgName, saName) - .withPublicAccess(PublicAccess.CONTAINER) - .withMetadata(metadataInitial) - .create(); - - blobContainer - .update() - .withPublicAccess(PublicAccess.BLOB) - .withMetadata("c", "d") - .withMetadata("e", "f") - .apply(); - - Assertions.assertEquals("blob-test", blobContainer.name()); - Assertions.assertEquals(PublicAccess.BLOB, blobContainer.publicAccess()); - Assertions.assertEquals(metadataTest, blobContainer.metadata()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/test/java/com/azure/resourcemanager/storage/StorageBlobServicesTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/test/java/com/azure/resourcemanager/storage/StorageBlobServicesTests.java deleted file mode 100644 index 96cfe82b1c80..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/test/java/com/azure/resourcemanager/storage/StorageBlobServicesTests.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.storage; - -import com.azure.core.http.HttpPipeline; -import com.azure.core.management.Region; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.storage.models.BlobServiceProperties; -import com.azure.resourcemanager.storage.models.BlobServices; -import com.azure.resourcemanager.storage.models.StorageAccount; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public class StorageBlobServicesTests extends StorageManagementTest { - private String rgName = ""; - - @Override - protected void initializeClients(HttpPipeline httpPipeline, AzureProfile profile) { - rgName = generateRandomResourceName("javacsmrg", 15); - - super.initializeClients(httpPipeline, profile); - } - - @Override - protected void cleanUpResources() { - resourceManager.resourceGroups().deleteByName(rgName); - } - - @Test - public void canCreateBlobServices() { - String saName = generateRandomResourceName("javacsmsa", 15); - - StorageAccount storageAccount = - storageManager - .storageAccounts() - .define(saName) - .withRegion(locationOrDefault(Region.US_EAST)) - .withNewResourceGroup(rgName) - .create(); - - BlobServices blobServices = this.storageManager.blobServices(); - BlobServiceProperties blobService = - blobServices - .define("blobServicesTest") - .withExistingStorageAccount(storageAccount.resourceGroupName(), storageAccount.name()) - .withDeleteRetentionPolicyEnabled(5) - .create(); - - Assertions.assertTrue(blobService.deleteRetentionPolicy().enabled()); - Assertions.assertEquals(5, blobService.deleteRetentionPolicy().days().intValue()); - } - - @Test - public void canUpdateBlobServices() { - String saName = generateRandomResourceName("javacsmsa", 15); - - StorageAccount storageAccount = - storageManager - .storageAccounts() - .define(saName) - .withRegion(locationOrDefault(Region.US_EAST)) - .withNewResourceGroup(rgName) - .create(); - - BlobServices blobServices = this.storageManager.blobServices(); - BlobServiceProperties blobService = - blobServices - .define("blobServicesTest") - .withExistingStorageAccount(storageAccount.resourceGroupName(), storageAccount.name()) - .withDeleteRetentionPolicyEnabled(5) - .create(); - - blobService.update().withDeleteRetentionPolicyDisabled().apply(); - - Assertions.assertFalse(blobService.deleteRetentionPolicy().enabled()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/test/java/com/azure/resourcemanager/storage/StorageManagementPoliciesTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/test/java/com/azure/resourcemanager/storage/StorageManagementPoliciesTests.java deleted file mode 100644 index 17c245e21ae9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/test/java/com/azure/resourcemanager/storage/StorageManagementPoliciesTests.java +++ /dev/null @@ -1,258 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.storage; - -import com.azure.core.http.HttpPipeline; -import com.azure.core.management.Region; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.storage.models.AccessTier; -import com.azure.resourcemanager.storage.models.BlobTypes; -import com.azure.resourcemanager.storage.models.ManagementPolicies; -import com.azure.resourcemanager.storage.models.ManagementPolicy; -import com.azure.resourcemanager.storage.models.PolicyRule; -import com.azure.resourcemanager.storage.models.StorageAccount; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public class StorageManagementPoliciesTests extends StorageManagementTest { - private String rgName = ""; - - @Override - protected void initializeClients(HttpPipeline httpPipeline, AzureProfile profile) { - rgName = generateRandomResourceName("javacsmrg", 15); - - super.initializeClients(httpPipeline, profile); - } - - @Override - protected void cleanUpResources() { - resourceManager.resourceGroups().deleteByName(rgName); - } - - @Test - public void canCreateManagementPolicies() { - String saName = generateRandomResourceName("javacmsa", 15); - StorageAccount storageAccount = - storageManager - .storageAccounts() - .define(saName) - .withRegion(locationOrDefault(Region.US_WEST_CENTRAL)) - .withNewResourceGroup(rgName) - .withBlobStorageAccountKind() - .withAccessTier(AccessTier.COOL) - .create(); - - ManagementPolicies managementPolicies = this.storageManager.managementPolicies(); - ManagementPolicy managementPolicy = - managementPolicies - .define("management-test") - .withExistingStorageAccount(rgName, saName) - .defineRule("rule1") - .withLifecycleRuleType() - .withBlobTypeToFilterFor(BlobTypes.BLOCK_BLOB) - .withPrefixToFilterFor("container1/foo") - .withTierToCoolActionOnBaseBlob(30) - .withTierToArchiveActionOnBaseBlob(90) - .withDeleteActionOnBaseBlob(2555) - .withDeleteActionOnSnapShot(90) - .attach() - .create(); - - List blobTypesToFilterFor = new ArrayList<>(); - blobTypesToFilterFor.add("blockBlob"); - - List prefixesToFilterFor = new ArrayList<>(); - prefixesToFilterFor.add("container1/foo"); - - // Assertions.assertEquals("management-test", managementPolicy.policy().); - Assertions.assertEquals("rule1", managementPolicy.policy().rules().get(0).name()); - Assertions - .assertEquals( - blobTypesToFilterFor, managementPolicy.policy().rules().get(0).definition().filters().blobTypes()); - Assertions - .assertEquals( - prefixesToFilterFor, managementPolicy.policy().rules().get(0).definition().filters().prefixMatch()); - Assertions - .assertEquals( - 30, - managementPolicy - .policy() - .rules() - .get(0) - .definition() - .actions() - .baseBlob() - .tierToCool() - .daysAfterModificationGreaterThan(), - 0.001); - Assertions - .assertEquals( - 90, - managementPolicy - .policy() - .rules() - .get(0) - .definition() - .actions() - .baseBlob() - .tierToArchive() - .daysAfterModificationGreaterThan(), - 0.001); - Assertions - .assertEquals( - 2555, - managementPolicy - .policy() - .rules() - .get(0) - .definition() - .actions() - .baseBlob() - .delete() - .daysAfterModificationGreaterThan(), - 0.001); - Assertions - .assertEquals( - 90, - managementPolicy - .policy() - .rules() - .get(0) - .definition() - .actions() - .snapshot() - .delete() - .daysAfterCreationGreaterThan(), - 0.001); - } - - @Test - public void managementPolicyGetters() { - String saName = generateRandomResourceName("javacmsa", 15); - StorageAccount storageAccount = - storageManager - .storageAccounts() - .define(saName) - .withRegion(locationOrDefault(Region.US_WEST_CENTRAL)) - .withNewResourceGroup(rgName) - .withBlobStorageAccountKind() - .withAccessTier(AccessTier.COOL) - .create(); - - ManagementPolicies managementPolicies = this.storageManager.managementPolicies(); - ManagementPolicy managementPolicy = - managementPolicies - .define("management-test") - .withExistingStorageAccount(rgName, saName) - .defineRule("rule1") - .withLifecycleRuleType() - .withBlobTypeToFilterFor(BlobTypes.BLOCK_BLOB) - .withPrefixToFilterFor("container1/foo") - .withTierToCoolActionOnBaseBlob(30) - .withTierToArchiveActionOnBaseBlob(90) - .withDeleteActionOnBaseBlob(2555) - .withDeleteActionOnSnapShot(90) - .attach() - .create(); - - List blobTypesToFilterFor = new ArrayList<>(); - blobTypesToFilterFor.add(BlobTypes.BLOCK_BLOB); - - List prefixesToFilterFor = new ArrayList<>(); - prefixesToFilterFor.add("container1/foo"); - - List rules = managementPolicy.rules(); - Assertions.assertEquals("rule1", rules.get(0).name()); - Assertions - .assertArrayEquals( - Collections.unmodifiableList(blobTypesToFilterFor).toArray(), - rules.get(0).blobTypesToFilterFor().toArray()); - Assertions - .assertArrayEquals( - Collections.unmodifiableList(prefixesToFilterFor).toArray(), - rules.get(0).prefixesToFilterFor().toArray()); - Assertions.assertEquals(30, rules.get(0).daysAfterBaseBlobModificationUntilCooling().intValue()); - Assertions.assertTrue(rules.get(0).tierToCoolActionOnBaseBlobEnabled()); - Assertions.assertEquals(90, rules.get(0).daysAfterBaseBlobModificationUntilArchiving().intValue()); - Assertions.assertTrue(rules.get(0).tierToArchiveActionOnBaseBlobEnabled()); - Assertions.assertEquals(2555, rules.get(0).daysAfterBaseBlobModificationUntilDeleting().intValue()); - Assertions.assertTrue(rules.get(0).deleteActionOnBaseBlobEnabled()); - Assertions.assertEquals(90, rules.get(0).daysAfterSnapShotCreationUntilDeleting().intValue()); - Assertions.assertTrue(rules.get(0).deleteActionOnSnapShotEnabled()); - } - - @Test - public void canUpdateManagementPolicy() { - String saName = generateRandomResourceName("javacmsa", 15); - List blobTypesToFilterFor = new ArrayList<>(); - blobTypesToFilterFor.add(BlobTypes.BLOCK_BLOB); - - List prefixesToFilterFor = new ArrayList<>(); - prefixesToFilterFor.add("container1/foo"); - - StorageAccount storageAccount = - storageManager - .storageAccounts() - .define(saName) - .withRegion(locationOrDefault(Region.US_WEST_CENTRAL)) - .withNewResourceGroup(rgName) - .withBlobStorageAccountKind() - .withAccessTier(AccessTier.COOL) - .create(); - - ManagementPolicies managementPolicies = this.storageManager.managementPolicies(); - ManagementPolicy managementPolicy = - managementPolicies - .define("management-test") - .withExistingStorageAccount(rgName, saName) - .defineRule("rule1") - .withLifecycleRuleType() - .withBlobTypeToFilterFor(BlobTypes.BLOCK_BLOB) - .withPrefixToFilterFor("asdf") - .withDeleteActionOnSnapShot(100) - .attach() - .defineRule("rule2") - .withLifecycleRuleType() - .withBlobTypeToFilterFor(BlobTypes.BLOCK_BLOB) - .withDeleteActionOnBaseBlob(30) - .attach() - .create(); - - managementPolicy - .update() - .updateRule("rule1") - .withPrefixesToFilterFor(prefixesToFilterFor) - .withTierToCoolActionOnBaseBlob(30) - .withTierToArchiveActionOnBaseBlob(90) - .withDeleteActionOnBaseBlob(2555) - .withDeleteActionOnSnapShot(90) - .parent() - .withoutRule("rule2") - .apply(); - - List rules = managementPolicy.rules(); - Assertions.assertEquals(1, rules.size()); - Assertions.assertEquals("rule1", rules.get(0).name()); - Assertions - .assertArrayEquals( - Collections.unmodifiableList(blobTypesToFilterFor).toArray(), - rules.get(0).blobTypesToFilterFor().toArray()); - Assertions - .assertArrayEquals( - Collections.unmodifiableList(prefixesToFilterFor).toArray(), - rules.get(0).prefixesToFilterFor().toArray()); - Assertions.assertEquals(30, rules.get(0).daysAfterBaseBlobModificationUntilCooling().intValue()); - Assertions.assertTrue(rules.get(0).tierToCoolActionOnBaseBlobEnabled()); - Assertions.assertEquals(90, rules.get(0).daysAfterBaseBlobModificationUntilArchiving().intValue()); - Assertions.assertTrue(rules.get(0).tierToArchiveActionOnBaseBlobEnabled()); - Assertions.assertEquals(2555, rules.get(0).daysAfterBaseBlobModificationUntilDeleting().intValue()); - Assertions.assertTrue(rules.get(0).deleteActionOnBaseBlobEnabled()); - Assertions.assertEquals(90, rules.get(0).daysAfterSnapShotCreationUntilDeleting().intValue()); - Assertions.assertTrue(rules.get(0).deleteActionOnSnapShotEnabled()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/test/java/com/azure/resourcemanager/storage/StorageManagementTest.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/test/java/com/azure/resourcemanager/storage/StorageManagementTest.java deleted file mode 100644 index af4299e253c5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/test/java/com/azure/resourcemanager/storage/StorageManagementTest.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.storage; - -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.policy.HttpLogOptions; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.resources.ResourceManager; -import com.azure.resourcemanager.resources.fluentcore.utils.HttpPipelineProvider; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import com.azure.resourcemanager.test.ResourceManagerTestBase; -import com.azure.resourcemanager.test.utils.TestDelayProvider; - -import java.time.temporal.ChronoUnit; -import java.util.List; - -/** The base for storage manager tests. */ -public abstract class StorageManagementTest extends ResourceManagerTestBase { - protected ResourceManager resourceManager; - protected StorageManager storageManager; - - @Override - protected HttpPipeline buildHttpPipeline( - TokenCredential credential, - AzureProfile profile, - HttpLogOptions httpLogOptions, - List policies, - HttpClient httpClient) { - return HttpPipelineProvider.buildHttpPipeline( - credential, - profile, - null, - httpLogOptions, - null, - new RetryPolicy("Retry-After", ChronoUnit.SECONDS), - policies, - httpClient); - } - - @Override - protected void initializeClients(HttpPipeline httpPipeline, AzureProfile profile) { - ResourceManagerUtils.InternalRuntimeContext.setDelayProvider(new TestDelayProvider(!isPlaybackMode())); - storageManager = buildManager(StorageManager.class, httpPipeline, profile); - resourceManager = storageManager.resourceManager(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/test/java/com/azure/resourcemanager/storage/UsageOperationsTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/test/java/com/azure/resourcemanager/storage/UsageOperationsTests.java deleted file mode 100644 index 30788b2abec6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/test/java/com/azure/resourcemanager/storage/UsageOperationsTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.storage; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.test.utils.TestUtilities; -import com.azure.resourcemanager.storage.fluent.models.UsageInner; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public class UsageOperationsTests extends StorageManagementTest { - @Test - @Disabled("Service is no longer supporting listing") - public void canGetUsages() throws Exception { - PagedIterable usages = storageManager.usages().list(); - System.out.println(TestUtilities.getSize(usages)); - } - - @Override - protected void cleanUpResources() { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/test/resources/junit-platform.properties b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/test/resources/junit-platform.properties deleted file mode 100644 index 202d099b3ee8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/test/resources/junit-platform.properties +++ /dev/null @@ -1,4 +0,0 @@ -junit.jupiter.execution.parallel.enabled=true -junit.jupiter.execution.parallel.mode.default=concurrent -junit.jupiter.execution.parallel.config.strategy=fixed -junit.jupiter.execution.parallel.config.fixed.parallelism=32 diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-test/CHANGELOG.md b/sdk/resourcemanagerhybrid/azure-resourcemanager-test/CHANGELOG.md deleted file mode 100644 index 4813b1c8978a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-test/CHANGELOG.md +++ /dev/null @@ -1,8 +0,0 @@ -# Release History - -## 1.0.0-hybrid (2022-01-12) - -- Azure Resource Manager test library for Java (Hybrid) using API Profiles to allow building hybrid cloud solutions -that target both Azure and Azure Stack Hub. -- Supports api versions in the 2020-09-01-hybrid api profile -- Requires Azure Stack Update 2102+ diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-test/README.md b/sdk/resourcemanagerhybrid/azure-resourcemanager-test/README.md deleted file mode 100644 index 3655d757ecfd..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-test/README.md +++ /dev/null @@ -1,44 +0,0 @@ -# Azure Resource Manager Test shared library for Java (Hybrid) - -Azure Resource Manager test library for Java (Hybrid) using [API Profiles][api_profile] to allow building hybrid cloud solutions -that target both Azure and Azure Stack Hub. - -For documentation on how to use this package, please see [Azure Management Libraries for Java (Hybrid)][resourcemanagerhybrid_lib]. - -## Getting started - -### Prerequisites - -- Java Development Kit (JDK) with version 8 or above - -### Adding the package to your product - -```xml - - com.azure.resourcemanager - azure-resourcemanager-test - 1.0.0-hybrid - -``` - -## Key concepts - -## Examples - -## Troubleshooting - -## Next steps - -## Contributing - -For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). - -1. Fork it -1. Create your feature branch (`git checkout -b my-new-feature`) -1. Commit your changes (`git commit -am 'Add some feature'`) -1. Push to the branch (`git push origin my-new-feature`) -1. Create new Pull Request - - -[api_profile]: https://learn.microsoft.com/azure-stack/user/azure-stack-version-profiles -[resourcemanagerhybrid_lib]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanagerhybrid diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-test/pom.xml b/sdk/resourcemanagerhybrid/azure-resourcemanager-test/pom.xml deleted file mode 100644 index 872781b1a3e2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-test/pom.xml +++ /dev/null @@ -1,129 +0,0 @@ - - - 4.0.0 - - com.azure - azure-client-sdk-parent - 1.7.0 - ../../parents/azure-client-sdk-parent - - - com.azure.resourcemanager - azure-resourcemanager-test - 1.0.0-hybrid - jar - - Microsoft Azure Resource Manager Test Library (Hybrid) - This package contains test types for Azure Resource Manager Hybrid SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt - https://github.com/Azure/azure-sdk-for-java - - - - The MIT License (MIT) - http://opensource.org/licenses/MIT - repo - - - - - https://github.com/Azure/azure-sdk-for-java - scm:git:git@github.com:Azure/azure-sdk-for-java.git - HEAD - - - - - 0.10 - 0.10 - - - - - microsoft - Microsoft - - - - - - com.azure - azure-core-test - 1.27.0-beta.13 - - - com.azure - azure-core - 1.57.0 - - - com.azure - azure-core-management - 1.19.2 - - - com.azure - azure-identity - 1.18.1 - - - com.azure - azure-core-http-netty - 1.16.2 - - - com.azure - azure-core-serializer-json-jackson - 1.6.2 - - - - - - org.apache.maven.plugins - maven-jar-plugin - 3.4.2 - - - - true - true - - - - - - org.apache.maven.plugins - maven-enforcer-plugin - 3.6.1 - - - - - com.github.spotbugs:spotbugs-annotations:[4.8.3] - - - - - - - - org.jacoco - jacoco-maven-plugin - 0.8.13 - - - com/azure/resourcemanager/**/fluent/**/* - com/azure/resourcemanager/**/models/**/* - com/azure/resourcemanager/**/implementation/*ClientImpl* - com/azure/resourcemanager/**/implementation/*ClientBuilder* - - - - - - - diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-test/src/main/java/com/azure/resourcemanager/test/ResourceManagerTestBase.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-test/src/main/java/com/azure/resourcemanager/test/ResourceManagerTestBase.java deleted file mode 100644 index 68c9023c2d7e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-test/src/main/java/com/azure/resourcemanager/test/ResourceManagerTestBase.java +++ /dev/null @@ -1,539 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.test; - -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpMethod; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.ProxyOptions; -import com.azure.core.http.netty.NettyAsyncHttpClientBuilder; -import com.azure.core.http.policy.HttpLogDetailLevel; -import com.azure.core.http.policy.HttpLogOptions; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.Region; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.serializer.json.jackson.JacksonJsonSerializerProvider; -import com.azure.core.test.TestProxyTestBase; -import com.azure.core.test.TestMode; -import com.azure.core.test.utils.ResourceNamer; -import com.azure.core.util.Configuration; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.serializer.JsonSerializer; -import com.azure.core.util.serializer.TypeReference; -import com.azure.identity.DefaultAzureCredentialBuilder; -import com.azure.resourcemanager.test.policy.HttpDebugLoggingPolicy; -import com.azure.resourcemanager.test.policy.TextReplacementPolicy; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.ObjectNode; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.DataOutputStream; -import java.io.IOException; -import java.io.OutputStream; -import java.io.PrintStream; -import java.io.UnsupportedEncodingException; -import java.lang.reflect.AccessibleObject; -import java.lang.reflect.Constructor; -import java.lang.reflect.Field; -import java.lang.reflect.InvocationTargetException; -import java.net.InetSocketAddress; -import java.net.Proxy; -import java.net.ProxySelector; -import java.net.URI; -import java.net.URISyntaxException; -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; -import java.security.KeyPair; -import java.security.KeyPairGenerator; -import java.security.NoSuchAlgorithmException; -import java.security.PrivilegedAction; -import java.security.PublicKey; -import java.security.interfaces.RSAPublicKey; -import java.util.ArrayList; -import java.util.Base64; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** - * Test base for resource manager SDK. - *

    - * For LIVE/RECORD test, dev should - * 1. Sign-in Azure with CLI ("az login"). - * 2. AZURE_TENANT_ID environment variable is set. - * 3. AZURE_SUBSCRIPTION_ID environment variable is set. - */ -public abstract class ResourceManagerTestBase extends TestProxyTestBase { - private static final String ZERO_SUBSCRIPTION = "00000000-0000-0000-0000-000000000000"; - private static final String ZERO_TENANT = "00000000-0000-0000-0000-000000000000"; - private static final String PLAYBACK_URI_BASE = "http://localhost:"; - private static final String AZURE_TEST_LOG_LEVEL = "AZURE_TEST_LOG_LEVEL"; - private static final String AZURE_ARM_ENDPOINT = "AZURE_ARM_ENDPOINT"; - private static final String AZURE_LOCATION = "AZURE_LOCATION"; - private static final String AZURE_STACK_CLOUD = "AzureStackCloud"; - private static final String HTTPS_PROXY_HOST = "https.proxyHost"; - private static final String HTTPS_PROXY_PORT = "https.proxyPort"; - private static final String HTTP_PROXY_HOST = "http.proxyHost"; - private static final String HTTP_PROXY_PORT = "http.proxyPort"; - private static final String USE_SYSTEM_PROXY = "java.net.useSystemProxies"; - private static final String VALUE_TRUE = "true"; - private static final String PLAYBACK_URI = PLAYBACK_URI_BASE + "1234"; - private static final AzureProfile PLAYBACK_PROFILE = new AzureProfile( - ZERO_TENANT, - ZERO_SUBSCRIPTION, - new AzureEnvironment( - new HashMap() { - { - put("managementEndpointUrl", PLAYBACK_URI); - put("resourceManagerEndpointUrl", PLAYBACK_URI); - put("sqlManagementEndpointUrl", PLAYBACK_URI); - put("galleryEndpointUrl", PLAYBACK_URI); - put("activeDirectoryEndpointUrl", PLAYBACK_URI); - put("activeDirectoryResourceId", PLAYBACK_URI); - put("activeDirectoryGraphResourceId", PLAYBACK_URI); - }})); - private static final OutputStream EMPTY_OUTPUT_STREAM = new OutputStream() { - @Override - public void write(int b) { - } - }; - - private static final ClientLogger LOGGER = new ClientLogger(ResourceManagerTestBase.class); - private AzureProfile testProfile; - private boolean isSkipInPlayback; - - /** - * Generates a random resource name. - * - * @param prefix Prefix for the resource name. - * @param maxLen Maximum length of the resource name. - * @return A randomly generated resource name with a given prefix and maximum length. - */ - protected String generateRandomResourceName(String prefix, int maxLen) { - return testResourceNamer.randomName(prefix, maxLen); - } - - /** - * @return A randomly generated UUID. - */ - protected String generateRandomUuid() { - return testResourceNamer.randomUuid(); - } - - /** - * @return random password - */ - public static String password() { - // do not record - String password = new ResourceNamer("").randomName("Pa5$", 12); - LOGGER.info("Password: {}", password); - return password; - } - - private static String sshPublicKey; - - /** - * @return an SSH public key - */ - public static String sshPublicKey() { - if (sshPublicKey == null) { - try { - KeyPairGenerator keyGen = KeyPairGenerator.getInstance("RSA"); - keyGen.initialize(1024); - KeyPair pair = keyGen.generateKeyPair(); - PublicKey publicKey = pair.getPublic(); - - RSAPublicKey rsaPublicKey = (RSAPublicKey) publicKey; - ByteArrayOutputStream byteOs = new ByteArrayOutputStream(); - DataOutputStream dos = new DataOutputStream(byteOs); - dos.writeInt("ssh-rsa".getBytes(StandardCharsets.US_ASCII).length); - dos.write("ssh-rsa".getBytes(StandardCharsets.US_ASCII)); - dos.writeInt(rsaPublicKey.getPublicExponent().toByteArray().length); - dos.write(rsaPublicKey.getPublicExponent().toByteArray()); - dos.writeInt(rsaPublicKey.getModulus().toByteArray().length); - dos.write(rsaPublicKey.getModulus().toByteArray()); - String publicKeyEncoded = new String(Base64.getEncoder().encode(byteOs.toByteArray()), StandardCharsets.US_ASCII); - sshPublicKey = "ssh-rsa " + publicKeyEncoded; - } catch (NoSuchAlgorithmException | IOException e) { - throw LOGGER.logExceptionAsError(new IllegalStateException("failed to generate ssh key", e)); - } - } - return sshPublicKey; - } - - /** - * Return the configured Azure location from AZURE_LOCATION, or a default region. - * - * @param defaultLocation the default region to use - * @return the region as a string - */ - public static String locationOrDefault(String defaultLocation) { - String location = System.getenv(AZURE_LOCATION); - if (location == null) { - return defaultLocation; - } - return location; - } - - /** - * Return the configured Azure location from AZURE_LOCATION, or a default region. - * - * @param defaultLocation the default region to use - * @return the region - */ - public static Region locationOrDefault(Region defaultLocation) { - String location = System.getenv(AZURE_LOCATION); - if (location == null) { - return defaultLocation; - } - return Region.fromName(location); - } - - /** - * Loads a client ID from file. - * - * @return A client ID loaded from a file. - */ - protected String clientIdFromFile() { - String clientId = Configuration.getGlobalConfiguration().get(Configuration.PROPERTY_AZURE_CLIENT_ID); - return testResourceNamer.recordValueFromConfig(clientId); - } - - /** - * @return The test profile. - */ - protected AzureProfile profile() { - return testProfile; - } - - /** - * @return Whether the test mode is {@link TestMode#PLAYBACK}. - */ - protected boolean isPlaybackMode() { - return getTestMode() == TestMode.PLAYBACK; - } - - /** - * @return Whether the test should be skipped in playback. - */ - protected boolean skipInPlayback() { - if (isPlaybackMode()) { - isSkipInPlayback = true; - } - return isSkipInPlayback; - } - - @Override - protected void beforeTest() { - TokenCredential credential; - HttpPipeline httpPipeline; - Map textReplacementRules = new HashMap<>(); - String logLevel = Configuration.getGlobalConfiguration().get(AZURE_TEST_LOG_LEVEL); - HttpLogDetailLevel httpLogDetailLevel; - - try { - httpLogDetailLevel = HttpLogDetailLevel.valueOf(logLevel); - } catch (Exception e) { - if (isPlaybackMode()) { - httpLogDetailLevel = HttpLogDetailLevel.NONE; - LOGGER.error("Environment variable '{}' has not been set yet. Using 'NONE' for PLAYBACK.", new Object[]{AZURE_TEST_LOG_LEVEL}); - } else { - httpLogDetailLevel = HttpLogDetailLevel.BODY_AND_HEADERS; - LOGGER.error("Environment variable '{}' has not been set yet. Using 'BODY_AND_HEADERS' for RECORD/LIVE.", new Object[]{AZURE_TEST_LOG_LEVEL}); - } - } - - if (httpLogDetailLevel == HttpLogDetailLevel.NONE) { - try { - System.setOut(new PrintStream(EMPTY_OUTPUT_STREAM, false, Charset.defaultCharset().name())); - System.setErr(new PrintStream(EMPTY_OUTPUT_STREAM, false, Charset.defaultCharset().name())); - } catch (UnsupportedEncodingException e) { - } - } - - if (isPlaybackMode()) { - if (interceptorManager.getRecordedData() == null) { - skipInPlayback(); - return; - } - - testProfile = PLAYBACK_PROFILE; - List policies = new ArrayList<>(); - policies.add(new TextReplacementPolicy(interceptorManager.getRecordedData(), textReplacementRules)); - httpPipeline = buildHttpPipeline( - null, - testProfile, - new HttpLogOptions().setLogLevel(httpLogDetailLevel), - policies, - interceptorManager.getPlaybackClient()); - textReplacementRules.put(PLAYBACK_URI_BASE + "1234", PLAYBACK_URI); - addTextReplacementRules(textReplacementRules); - } else { - Configuration configuration = Configuration.getGlobalConfiguration(); - String cloud = configuration.get(Configuration.PROPERTY_AZURE_CLOUD); - AzureEnvironment environment; - - if (cloud == null || cloud.equalsIgnoreCase(AzureEnvironment.AZURE.toString())) { - environment = AzureEnvironment.AZURE; - } else if (cloud.equalsIgnoreCase(AZURE_STACK_CLOUD)) { - String armEndpoint = System.getenv(AZURE_ARM_ENDPOINT); - String location = System.getenv(AZURE_LOCATION); - if (armEndpoint == null || location == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("When running tests with AzureStackCloud in record mode AZURE_ARM_ENDPOINT and AZURE_LOCATION need to be set")); - } - - HashMap settings = getActiveDirectorySettings(armEndpoint); - HashMap endpoints = new HashMap(); - - endpoints.put("managementEndpointUrl", settings.get("audience")); - endpoints.put("resourceManagerEndpointUrl", armEndpoint); - endpoints.put("galleryEndpointUrl", settings.get("galleryEndpoint")); - endpoints.put("activeDirectoryEndpointUrl", settings.get("login_endpoint")); - endpoints.put("activeDirectoryResourceId", settings.get("audience")); - endpoints.put("activeDirectoryGraphResourceId", settings.get("graphEndpoint")); - endpoints.put("storageEndpointSuffix", armEndpoint.substring(armEndpoint.indexOf('.'))); - endpoints.put("keyVaultDnsSuffix", ".vault" + armEndpoint.substring(armEndpoint.indexOf('.'))); - - environment = new AzureEnvironment(endpoints); - } else { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Unsupported AZURE_CLOUD given: " + cloud)); - } - - String tenantId = Objects.requireNonNull( - configuration.get(Configuration.PROPERTY_AZURE_TENANT_ID), - "'AZURE_TENANT_ID' environment variable cannot be null."); - String subscriptionId = Objects.requireNonNull( - configuration.get(Configuration.PROPERTY_AZURE_SUBSCRIPTION_ID), - "'AZURE_SUBSCRIPTION_ID' environment variable cannot be null."); - credential = new DefaultAzureCredentialBuilder() - .authorityHost(AzureEnvironment.AZURE.getActiveDirectoryEndpoint()) - .build(); - testProfile = new AzureProfile(tenantId, subscriptionId, AzureEnvironment.AZURE); - - List policies = new ArrayList<>(); - if (!interceptorManager.isLiveMode() && !testContextManager.doNotRecordTest()) { - policies.add(new TextReplacementPolicy(interceptorManager.getRecordedData(), textReplacementRules)); - } - if (httpLogDetailLevel == HttpLogDetailLevel.BODY_AND_HEADERS) { - policies.add(new HttpDebugLoggingPolicy()); - httpLogDetailLevel = HttpLogDetailLevel.NONE; - } - httpPipeline = buildHttpPipeline( - credential, - testProfile, - new HttpLogOptions().setLogLevel(httpLogDetailLevel), - policies, - generateHttpClientWithProxy(null, null, environment)); - - textReplacementRules.put(testProfile.getSubscriptionId(), ZERO_SUBSCRIPTION); - textReplacementRules.put(testProfile.getTenantId(), ZERO_TENANT); - textReplacementRules.put(environment.getResourceManagerEndpoint(), PLAYBACK_URI + "/"); - textReplacementRules.put(environment.getGraphEndpoint(), PLAYBACK_URI + "/"); - addTextReplacementRules(textReplacementRules); - } - initializeClients(httpPipeline, testProfile); - } - - private HashMap getActiveDirectorySettings(String armEndpoint) { - HashMap adSettings = new HashMap(); - - String metadataUrl = String.format("%s/metadata/endpoints?api-version=1.0", armEndpoint); - HttpClient httpClient = new NettyAsyncHttpClientBuilder().build(); - HttpRequest httpRequest = new HttpRequest(HttpMethod.GET, metadataUrl); - httpRequest.setHeader("accept", "application/json"); - - HttpResponse response = httpClient.send(httpRequest).block(); - - if (response == null || response.getStatusCode() != 200) { - throw LOGGER.logExceptionAsError( - new RuntimeException("Failed to get ARM metadata, status code: " + (response != null ? response.getStatusCode() : "null"))); - } - - byte[] body = response.getBodyAsByteArray().block(); - - if (body == null) { - throw LOGGER.logExceptionAsError( - new RuntimeException("Failed to get ARM metadata, body is null")); - } - - JsonSerializer jsonSerializer = new JacksonJsonSerializerProvider().createInstance(); - ObjectNode responseJson = jsonSerializer.deserialize(new ByteArrayInputStream(body), TypeReference.createInstance(ObjectNode.class)); - - adSettings.put("galleryEndpoint", responseJson.get("galleryEndpoint").asText()); - JsonNode authentication = responseJson.get("authentication"); - adSettings.put("login_endpoint", authentication.get("loginEndpoint").asText()); - adSettings.put("audience", authentication.get("audiences").get(0).asText()); - adSettings.put("graphEndpoint", responseJson.get("graphEndpoint").asText()); - - return adSettings; - } - - /** - * Generates an {@link HttpClient} with a proxy. - * - * @param clientBuilder The HttpClient builder. - * @param proxyOptions The proxy. - * @param environment The Azure environment. - * @return An HttpClient with a proxy. - */ - protected HttpClient generateHttpClientWithProxy(NettyAsyncHttpClientBuilder clientBuilder, ProxyOptions proxyOptions, AzureEnvironment environment) { - if (clientBuilder == null) { - clientBuilder = new NettyAsyncHttpClientBuilder(); - } - if (proxyOptions != null) { - clientBuilder.proxy(proxyOptions); - } else { - try { - System.setProperty(USE_SYSTEM_PROXY, VALUE_TRUE); - List proxies = ProxySelector.getDefault().select(new URI(environment.getResourceManagerEndpoint())); - if (!proxies.isEmpty()) { - for (Proxy proxy : proxies) { - if (proxy.address() instanceof InetSocketAddress) { - String host = ((InetSocketAddress) proxy.address()).getHostName(); - int port = ((InetSocketAddress) proxy.address()).getPort(); - switch (proxy.type()) { - case HTTP: - return clientBuilder.proxy(new ProxyOptions(ProxyOptions.Type.HTTP, new InetSocketAddress(host, port))).build(); - case SOCKS: - return clientBuilder.proxy(new ProxyOptions(ProxyOptions.Type.SOCKS5, new InetSocketAddress(host, port))).build(); - default: - } - } - } - } - String host = null; - int port = 0; - if (System.getProperty(HTTPS_PROXY_HOST) != null && System.getProperty(HTTPS_PROXY_PORT) != null) { - host = System.getProperty(HTTPS_PROXY_HOST); - port = Integer.parseInt(System.getProperty(HTTPS_PROXY_PORT)); - } else if (System.getProperty(HTTP_PROXY_HOST) != null && System.getProperty(HTTP_PROXY_PORT) != null) { - host = System.getProperty(HTTP_PROXY_HOST); - port = Integer.parseInt(System.getProperty(HTTP_PROXY_PORT)); - } - if (host != null) { - clientBuilder.proxy(new ProxyOptions(ProxyOptions.Type.HTTP, new InetSocketAddress(host, port))); - } - } catch (URISyntaxException e) { } - } - return clientBuilder.build(); - } - - @Override - protected void afterTest() { - if (!isSkipInPlayback) { - cleanUpResources(); - } - } - - private void addTextReplacementRules(Map rules) { - for (Map.Entry entry : rules.entrySet()) { - interceptorManager.addTextReplacementRule(entry.getKey(), entry.getValue()); - } - } - - /** - * Sets sdk context when running the tests - * - * @param internalContext the internal runtime context - * @param objects the manager classes to change internal context - * @param the type of internal context - * @throws RuntimeException when field cannot be found or set. - */ - protected void setInternalContext(T internalContext, Object... objects) { - try { - for (Object obj : objects) { - for (final Field field : obj.getClass().getSuperclass().getDeclaredFields()) { - if (field.getName().equals("resourceManager")) { - setAccessible(field); - Field context = field.get(obj).getClass().getDeclaredField("internalContext"); - setAccessible(context); - context.set(field.get(obj), internalContext); - } - } - for (Field field : obj.getClass().getDeclaredFields()) { - if (field.getName().equals("internalContext")) { - setAccessible(field); - field.set(obj, internalContext); - } else if (field.getName().contains("Manager")) { - setAccessible(field); - setInternalContext(internalContext, field.get(obj)); - } - } - } - } catch (IllegalAccessException ex) { - throw LOGGER.logExceptionAsError(new RuntimeException(ex)); - } catch (NoSuchFieldException ex) { - throw LOGGER.logExceptionAsError(new RuntimeException(ex)); - } - } - - @SuppressWarnings("removal") - private void setAccessible(final AccessibleObject accessibleObject) { - java.security.AccessController.doPrivileged((PrivilegedAction) () -> { - accessibleObject.setAccessible(true); - return null; - }); - } - - /** - * Builds the manager with provided http pipeline and profile in general manner. - * - * @param manager the class of the manager - * @param httpPipeline the http pipeline - * @param profile the azure profile - * @param the type of the manager - * @return the manager instance - * @throws RuntimeException when field cannot be found or set. - */ - protected T buildManager(Class manager, HttpPipeline httpPipeline, AzureProfile profile) { - try { - Constructor constructor = manager.getDeclaredConstructor(httpPipeline.getClass(), profile.getClass()); - setAccessible(constructor); - return constructor.newInstance(httpPipeline, profile); - - } catch (NoSuchMethodException - | IllegalAccessException - | InstantiationException - | InvocationTargetException ex) { - throw LOGGER.logExceptionAsError(new RuntimeException(ex)); - } - } - - /** - * Builds an HttpPipeline. - * - * @param credential The credentials to use in the pipeline. - * @param profile The AzureProfile to use in the pipeline. - * @param httpLogOptions The HTTP logging options to use in the pipeline. - * @param policies Additional policies to use in the pipeline. - * @param httpClient The HttpClient to use in the pipeline. - * @return A new constructed HttpPipeline. - */ - protected abstract HttpPipeline buildHttpPipeline( - TokenCredential credential, - AzureProfile profile, - HttpLogOptions httpLogOptions, - List policies, - HttpClient httpClient); - - /** - * Initializes service clients used in testing. - * - * @param httpPipeline The HttpPipeline to use in the clients. - * @param profile The AzureProfile to use in the clients. - */ - protected abstract void initializeClients(HttpPipeline httpPipeline, AzureProfile profile); - - /** - * Cleans up resources. - */ - protected abstract void cleanUpResources(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-test/src/main/java/com/azure/resourcemanager/test/policy/HttpDebugLoggingPolicy.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-test/src/main/java/com/azure/resourcemanager/test/policy/HttpDebugLoggingPolicy.java deleted file mode 100644 index 8966f5f63ce0..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-test/src/main/java/com/azure/resourcemanager/test/policy/HttpDebugLoggingPolicy.java +++ /dev/null @@ -1,264 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.test.policy; - -import com.azure.core.http.ContentType; -import com.azure.core.http.HttpHeader; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpPipelineCallContext; -import com.azure.core.http.HttpPipelineNextPolicy; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.policy.HttpLoggingPolicy; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.util.CoreUtils; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.SerializationFeature; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import reactor.core.publisher.Mono; - -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.nio.ByteBuffer; -import java.nio.channels.Channels; -import java.nio.channels.WritableByteChannel; -import java.nio.charset.StandardCharsets; -import java.util.HashSet; -import java.util.Locale; -import java.util.Optional; -import java.util.Set; -import java.util.concurrent.TimeUnit; - -/** - * The pipeline policy that handles logging of HTTP requests and responses. - */ -public class HttpDebugLoggingPolicy implements HttpPipelinePolicy { - - private static final ObjectMapper PRETTY_PRINTER = new ObjectMapper().enable(SerializationFeature.INDENT_OUTPUT); - private static final String REDACTED_PLACEHOLDER = "REDACTED"; - private static final Set DISALLOWED_HEADER_NAMES = new HashSet<>(); - private static final boolean PRETTY_PRINT_BODY = true; - - /** - * Creates an HttpDebugLoggingPolicy with the given log configurations. - */ - public HttpDebugLoggingPolicy() { - DISALLOWED_HEADER_NAMES.add("authorization"); - } - - @Override - public Mono process(HttpPipelineCallContext context, HttpPipelineNextPolicy next) { - final Logger logger = LoggerFactory.getLogger((String) context.getData("caller-method").orElse("")); - final long startNs = System.nanoTime(); - - return logRequest(logger, context.getHttpRequest(), context.getData(HttpLoggingPolicy.RETRY_COUNT_CONTEXT)) - .then(next.process()) - .flatMap(response -> logResponse(logger, response, startNs)) - .doOnError(throwable -> logger.warn("<-- HTTP FAILED: ", throwable)); - } - - private Mono logRequest(final Logger logger, final HttpRequest request, - final Optional optionalRetryCount) { - if (!logger.isInfoEnabled()) { - return Mono.empty(); - } - - StringBuilder requestLogMessage = new StringBuilder(); - requestLogMessage.append("--> ") - .append(request.getHttpMethod()) - .append(" ") - .append(request.getUrl()) - .append(System.lineSeparator()); - - optionalRetryCount.ifPresent(o -> requestLogMessage.append("Try count: ") - .append(o) - .append(System.lineSeparator())); - - addHeadersToLogMessage(logger, request.getHeaders(), requestLogMessage); - - if (request.getBody() == null) { - requestLogMessage.append("(empty body)") - .append(System.lineSeparator()) - .append("--> END ") - .append(request.getHttpMethod()) - .append(System.lineSeparator()); - - return logAndReturn(logger, requestLogMessage, null); - } - - String contentType = request.getHeaders().getValue("Content-Type"); - long contentLength = getContentLength(logger, request.getHeaders()); - - if (shouldBodyBeLogged(contentType, contentLength)) { - ByteArrayOutputStream outputStream = new ByteArrayOutputStream((int) contentLength); - WritableByteChannel bodyContentChannel = Channels.newChannel(outputStream); - - // Add non-mutating operators to the data stream. - request.setBody( - request.getBody() - .flatMap(byteBuffer -> writeBufferToBodyStream(bodyContentChannel, byteBuffer)) - .doFinally(ignored -> { - requestLogMessage.append(contentLength) - .append("-byte body:") - .append(System.lineSeparator()) - .append(prettyPrintIfNeeded(logger, contentType, - convertStreamToString(outputStream, logger))) - .append(System.lineSeparator()) - .append("--> END ") - .append(request.getHttpMethod()) - .append(System.lineSeparator()); - - logger.info(requestLogMessage.toString()); - })); - - return Mono.empty(); - } else { - requestLogMessage.append(contentLength) - .append("-byte body: (content not logged)") - .append(System.lineSeparator()) - .append("--> END ") - .append(request.getHttpMethod()) - .append(System.lineSeparator()); - - return logAndReturn(logger, requestLogMessage, null); - } - } - - /* - * Logs thr HTTP response. - * - * @param logger Logger used to log the response. - * @param response HTTP response returned from Azure. - * @param startNs Nanosecond representation of when the request was sent. - * @return A Mono containing the HTTP response. - */ - private Mono logResponse(final Logger logger, final HttpResponse response, long startNs) { - if (!logger.isInfoEnabled()) { - return Mono.just(response); - } - - long tookMs = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - startNs); - - String contentLengthString = response.getHeaderValue("Content-Length"); - String bodySize = (CoreUtils.isNullOrEmpty(contentLengthString)) - ? "unknown-length body" - : contentLengthString + "-byte body"; - - StringBuilder responseLogMessage = new StringBuilder(); - responseLogMessage.append("<-- ") - .append(response.getStatusCode()) - .append(" ") - .append(response.getRequest().getUrl()) - .append(" (") - .append(tookMs) - .append(" ms, ") - .append(bodySize) - .append(")") - .append(System.lineSeparator()); - - addHeadersToLogMessage(logger, response.getHeaders(), responseLogMessage); - - String contentTypeHeader = response.getHeaderValue("Content-Type"); - long contentLength = getContentLength(logger, response.getHeaders()); - - if (shouldBodyBeLogged(contentTypeHeader, contentLength)) { - HttpResponse bufferedResponse = response.buffer(); - ByteArrayOutputStream outputStream = new ByteArrayOutputStream((int) contentLength); - WritableByteChannel bodyContentChannel = Channels.newChannel(outputStream); - return bufferedResponse.getBody() - .flatMap(byteBuffer -> writeBufferToBodyStream(bodyContentChannel, byteBuffer)) - .doFinally(ignored -> { - responseLogMessage.append("Response body:") - .append(System.lineSeparator()) - .append(prettyPrintIfNeeded(logger, contentTypeHeader, - convertStreamToString(outputStream, logger))) - .append(System.lineSeparator()) - .append("<-- END HTTP"); - - logger.info(responseLogMessage.toString()); - }).then(Mono.just(bufferedResponse)); - } else { - responseLogMessage.append("(body content not logged)") - .append(System.lineSeparator()) - .append("<-- END HTTP"); - - return logAndReturn(logger, responseLogMessage, response); - } - } - - private Mono logAndReturn(Logger logger, StringBuilder logMessageBuilder, T data) { - logger.info(logMessageBuilder.toString()); - return Mono.justOrEmpty(data); - } - - private void addHeadersToLogMessage(Logger logger, HttpHeaders headers, StringBuilder sb) { - for (HttpHeader header : headers) { - String headerName = header.getName(); - sb.append(headerName).append(":"); - if (!DISALLOWED_HEADER_NAMES.contains(headerName.toLowerCase(Locale.ROOT))) { - sb.append(header.getValue()); - } else { - sb.append(REDACTED_PLACEHOLDER); - } - sb.append(System.lineSeparator()); - } - } - - private String prettyPrintIfNeeded(Logger logger, String contentType, String body) { - String result = body; - if (PRETTY_PRINT_BODY && contentType != null - && (contentType.startsWith(ContentType.APPLICATION_JSON) || contentType.startsWith("text/json"))) { - try { - final Object deserialized = PRETTY_PRINTER.readTree(body); - result = PRETTY_PRINTER.writeValueAsString(deserialized); - } catch (Exception e) { - logger.warn("Failed to pretty print JSON: {}", e.getMessage()); - } - } - return result; - } - - private long getContentLength(Logger logger, HttpHeaders headers) { - long contentLength = 0; - - String contentLengthString = headers.getValue("Content-Length"); - if (CoreUtils.isNullOrEmpty(contentLengthString)) { - return contentLength; - } - - try { - contentLength = Long.parseLong(contentLengthString); - } catch (NumberFormatException | NullPointerException e) { - logger.warn("Could not parse the HTTP header content-length: '{}'.", - headers.getValue("content-length"), e); - } - - return contentLength; - } - - private boolean shouldBodyBeLogged(String contentTypeHeader, long contentLength) { - return !ContentType.APPLICATION_OCTET_STREAM.equalsIgnoreCase(contentTypeHeader) - && contentLength != 0; - } - - private static String convertStreamToString(ByteArrayOutputStream stream, Logger logger) { - try { - return stream.toString(StandardCharsets.UTF_8.name()); - } catch (UnsupportedEncodingException ex) { - logger.error(ex.toString()); - throw new RuntimeException(ex); - } - } - - private static Mono writeBufferToBodyStream(WritableByteChannel channel, ByteBuffer byteBuffer) { - try { - channel.write(byteBuffer.duplicate()); - return Mono.just(byteBuffer); - } catch (IOException ex) { - return Mono.error(ex); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-test/src/main/java/com/azure/resourcemanager/test/policy/TextReplacementPolicy.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-test/src/main/java/com/azure/resourcemanager/test/policy/TextReplacementPolicy.java deleted file mode 100644 index 828a4110aad6..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-test/src/main/java/com/azure/resourcemanager/test/policy/TextReplacementPolicy.java +++ /dev/null @@ -1,215 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.test.policy; - -import com.azure.core.http.ContentType; -import com.azure.core.http.HttpHeader; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpPipelineCallContext; -import com.azure.core.http.HttpPipelineNextPolicy; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.test.models.NetworkCallError; -import com.azure.core.test.models.NetworkCallRecord; -import com.azure.core.test.models.RecordedData; -import com.azure.core.test.models.RecordingRedactor; -import com.azure.core.util.UrlBuilder; -import com.azure.core.util.logging.ClientLogger; -import reactor.core.Exceptions; -import reactor.core.publisher.Mono; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.net.HttpURLConnection; -import java.nio.charset.StandardCharsets; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.zip.GZIPInputStream; - -/** - * TextReplacementPolicy to support session text replacement rules for tests. - */ -public class TextReplacementPolicy implements HttpPipelinePolicy { - private static final int DEFAULT_BUFFER_LENGTH = 1024; - private static final String CONTENT_TYPE = "Content-Type"; - private static final String CONTENT_ENCODING = "Content-Encoding"; - private static final String CONTENT_LENGTH = "Content-Length"; - private static final String X_MS_CLIENT_REQUEST_ID = "x-ms-client-request-id"; - private static final String X_MS_ENCRYPTION_KEY_SHA256 = "x-ms-encryption-key-sha256"; - private static final String X_MS_VERSION = "x-ms-version"; - private static final String USER_AGENT = "User-Agent"; - private static final String STATUS_CODE = "StatusCode"; - private static final String BODY = "Body"; - private static final String SIG = "sig"; - - private final ClientLogger logger = new ClientLogger(TextReplacementPolicy.class); - private final RecordedData recordedData; - private final Map textReplacementRules; - - /** - * Creates a policy that records network calls into {@code recordedData} with replacement rules. - * - * @param recordedData The record to persist network calls into. - * @param textReplacementRules The replacement rules - */ - public TextReplacementPolicy(RecordedData recordedData, Map textReplacementRules) { - //Objects.requireNonNull(recordedData, "'recordedData' cannot be null."); - Objects.requireNonNull(textReplacementRules, "'textReplacementRules' cannot be null."); - this.recordedData = recordedData; - this.textReplacementRules = textReplacementRules; - } - - @Override - public Mono process(HttpPipelineCallContext context, HttpPipelineNextPolicy next) { - final NetworkCallRecord networkCallRecord = new NetworkCallRecord(); - Map headers = new HashMap<>(); - - captureRequestHeaders(context.getHttpRequest().getHeaders(), headers, - X_MS_CLIENT_REQUEST_ID, - CONTENT_TYPE, - X_MS_VERSION, - USER_AGENT); - - networkCallRecord.setHeaders(headers); - networkCallRecord.setMethod(context.getHttpRequest().getHttpMethod().toString()); - - // Remove sensitive information such as SAS token signatures from the recording. - UrlBuilder urlBuilder = UrlBuilder.parse(context.getHttpRequest().getUrl()); - if (urlBuilder.getQuery().containsKey(SIG)) { - urlBuilder.setQueryParameter(SIG, "REDACTED"); - } - networkCallRecord.setUri(applyReplacementRule(urlBuilder.toString().replaceAll("\\?$", ""))); - - return next.process() - .doOnError(throwable -> { - networkCallRecord.setException(new NetworkCallError(throwable)); - recordedData.addNetworkCall(networkCallRecord); - throw logger.logExceptionAsWarning(Exceptions.propagate(throwable)); - }).flatMap(httpResponse -> { - final HttpResponse bufferedResponse = httpResponse.buffer(); - - return extractResponseData(bufferedResponse).map(responseData -> { - networkCallRecord.setResponse(responseData); - String body = responseData.get(BODY); - - // Remove pre-added header if this is a waiting or redirection - if (body != null && body.contains("InProgress") - || Integer.parseInt(responseData.get(STATUS_CODE)) == HttpURLConnection.HTTP_MOVED_TEMP) { - logger.info("Waiting for a response or redirection."); - } else { - recordedData.addNetworkCall(networkCallRecord); - } - - return bufferedResponse; - }); - }); - } - - private String applyReplacementRule(String text) { - for (Map.Entry rule : textReplacementRules.entrySet()) { - if (rule.getValue() != null) { - text = text.replaceAll(rule.getKey(), rule.getValue()); - } - } - return text; - } - - private void captureRequestHeaders(HttpHeaders requestHeaders, Map captureHeaders, - String... headerNames) { - for (String headerName : headerNames) { - if (requestHeaders.getValue(headerName) != null) { - captureHeaders.put(headerName, requestHeaders.getValue(headerName)); - } - } - } - - private Mono> extractResponseData(final HttpResponse response) { - final Map responseData = new HashMap<>(); - responseData.put(STATUS_CODE, Integer.toString(response.getStatusCode())); - - boolean addedRetryAfter = false; - for (HttpHeader header : response.getHeaders()) { - String headerValueToStore = header.getValue(); - - if (header.getName().equalsIgnoreCase("retry-after")) { - headerValueToStore = "0"; - addedRetryAfter = true; - } else if (header.getName().equalsIgnoreCase(X_MS_ENCRYPTION_KEY_SHA256)) { - // The encryption key is sensitive information so capture it with a hidden value. - headerValueToStore = "REDACTED"; - } - - responseData.put(header.getName(), applyReplacementRule(headerValueToStore)); - } - - if (!addedRetryAfter) { - responseData.put("retry-after", "0"); - } - - String contentType = response.getHeaderValue(CONTENT_TYPE); - if (contentType == null) { - return response.getBodyAsByteArray().switchIfEmpty(Mono.just(new byte[0])).map(bytes -> { - if (bytes.length == 0) { - return responseData; - } - - String content = new String(bytes, StandardCharsets.UTF_8); - responseData.put(CONTENT_LENGTH, Integer.toString(content.length())); - responseData.put(BODY, content); - return responseData; - }); - } else if (contentType.equalsIgnoreCase(ContentType.APPLICATION_OCTET_STREAM) - || "avro/binary".equalsIgnoreCase(contentType)) { - return response.getBodyAsByteArray().switchIfEmpty(Mono.just(new byte[0])).map(bytes -> { - if (bytes.length == 0) { - return responseData; - } - - responseData.put(BODY, Arrays.toString(bytes)); - return responseData; - }); - } else if (contentType.contains("json") || response.getHeaderValue(CONTENT_ENCODING) == null) { - return response.getBodyAsString(StandardCharsets.UTF_8).switchIfEmpty(Mono.just("")).map(content -> { - responseData.put(BODY, applyReplacementRule(new RecordingRedactor().redact(content))); - return responseData; - }); - } else { - return response.getBodyAsByteArray().switchIfEmpty(Mono.just(new byte[0])).map(bytes -> { - if (bytes.length == 0) { - return responseData; - } - - String content; - if ("gzip".equalsIgnoreCase(response.getHeaderValue(CONTENT_ENCODING))) { - try (GZIPInputStream gis = new GZIPInputStream(new ByteArrayInputStream(bytes)); - ByteArrayOutputStream output = new ByteArrayOutputStream()) { - byte[] buffer = new byte[DEFAULT_BUFFER_LENGTH]; - int position = 0; - int bytesRead = gis.read(buffer, position, buffer.length); - - while (bytesRead != -1) { - output.write(buffer, 0, bytesRead); - position += bytesRead; - bytesRead = gis.read(buffer, position, buffer.length); - } - - content = new String(output.toByteArray(), StandardCharsets.UTF_8); - } catch (IOException e) { - throw logger.logExceptionAsWarning(Exceptions.propagate(e)); - } - } else { - content = new String(bytes, StandardCharsets.UTF_8); - } - - responseData.remove(CONTENT_ENCODING); - responseData.put(CONTENT_LENGTH, Integer.toString(content.length())); - - responseData.put(BODY, content); - return responseData; - }); - } - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-test/src/main/java/com/azure/resourcemanager/test/utils/TestDelayProvider.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-test/src/main/java/com/azure/resourcemanager/test/utils/TestDelayProvider.java deleted file mode 100644 index a3e010c04b76..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-test/src/main/java/com/azure/resourcemanager/test/utils/TestDelayProvider.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.test.utils; - -import com.azure.core.management.provider.DelayProvider; - -import java.time.Duration; - -/** - * Class helps thread sleep in tests. - */ -public class TestDelayProvider implements DelayProvider { - - private final boolean isLiveMode; - - /** - * Constructor of TestDelayProvider - * - * @param isLiveMode the boolean flag for test mode - */ - public TestDelayProvider(boolean isLiveMode) { - this.isLiveMode = isLiveMode; - } - - @Override - public Duration getDelayDuration(Duration delay) { - return isLiveMode ? delay : Duration.ofMillis(1); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-test/src/main/java/com/azure/resourcemanager/test/utils/TestIdentifierProvider.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-test/src/main/java/com/azure/resourcemanager/test/utils/TestIdentifierProvider.java deleted file mode 100644 index 27af259a396d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-test/src/main/java/com/azure/resourcemanager/test/utils/TestIdentifierProvider.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.test.utils; - -import com.azure.core.management.provider.IdentifierProvider; -import com.azure.core.test.utils.TestResourceNamer; - -/** - * Class helps generate unique identifier. - */ -public class TestIdentifierProvider implements IdentifierProvider { - - private final TestResourceNamer testResourceNamer; - - /** - * Constructor of TestIdentifierProvider - * - * @param testResourceNamer the test resource namer - */ - public TestIdentifierProvider(TestResourceNamer testResourceNamer) { - this.testResourceNamer = testResourceNamer; - } - - @Override - public String getRandomName(String prefix, int maxLen) { - return testResourceNamer.randomName(prefix, maxLen); - } - - @Override - public String getRandomUuid() { - return testResourceNamer.randomUuid(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-test/src/main/java/com/azure/resourcemanager/test/utils/TestUtilities.java b/sdk/resourcemanagerhybrid/azure-resourcemanager-test/src/main/java/com/azure/resourcemanager/test/utils/TestUtilities.java deleted file mode 100644 index f16e5ed95be2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-test/src/main/java/com/azure/resourcemanager/test/utils/TestUtilities.java +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.test.utils; - -import com.azure.core.http.rest.PagedIterable; - -import java.util.Iterator; - -/** - * Common utility functions for the tests. - */ -public class TestUtilities { - /** - * Wrapper on the ResourceManagerUtils.InternalRuntimeContext.sleep, in case of record mode will not sleep, otherwise sleep. - * - * @param milliseconds time in milliseconds for which to sleep. - * @param isRecordMode the value indicates whether it is record mode. - */ - public static void sleep(int milliseconds, boolean isRecordMode) { - if (isRecordMode) { - try { - Thread.sleep(milliseconds); - } catch (InterruptedException e) { - e.printStackTrace(); - } - } - } - - /** - * Return the size of Iterable collection. - * - * @param iterable the Iterable collection. - * @param the type of the resource - * @return the size of the collection. - */ - public static int getSize(Iterable iterable) { - int res = 0; - Iterator iterator = iterable.iterator(); - while (iterator.hasNext()) { - iterator.next(); - ++res; - } - return res; - } - - /** - * Return whether the Iterable collection is empty. - * - * @param iterable the Iterable collection. - * @param the type of the resource - * @return if the collection is empty. - */ - public static boolean isEmpty(PagedIterable iterable) { - return !iterable.iterator().hasNext(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager/CHANGELOG.md b/sdk/resourcemanagerhybrid/azure-resourcemanager/CHANGELOG.md deleted file mode 100644 index 66687d04c6a7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager/CHANGELOG.md +++ /dev/null @@ -1,10 +0,0 @@ -# Release History - -## 1.0.0-hybrid (2022-01-12) - -- Supported `authenticate(HttpPipeline, AzureProfile)` in managers. - -- Azure Resource Manager client library for Java (Hybrid) using API Profiles to allow building hybrid cloud solutions -that target both Azure and Azure Stack Hub. -- Supports api versions in the 2020-09-01-hybrid api profile -- Requires Azure Stack Update 2102+ diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager/README.md b/sdk/resourcemanagerhybrid/azure-resourcemanager/README.md deleted file mode 100644 index d20b9b1f60f7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager/README.md +++ /dev/null @@ -1,136 +0,0 @@ -# Azure Resource Manager client library for Java (Hybrid) - -Azure Resource Manager client library for Java (Hybrid) using [API Profiles][api_profile] to allow building hybrid cloud solutions -that target both Azure and Azure Stack Hub. - -For documentation on how to use this package, please see [Azure Management Libraries for Java (Hybrid)][resourcemanagerhybrid_lib]. - -## Getting started - -### Prerequisites - -- [Java Development Kit (JDK)][jdk] with version 8 or above -- [Azure Subscription][azure_subscription] - -### Adding the package to your product - -```xml - - com.azure.resourcemanager - azure-resourcemanager - 1.0.0-hybrid - -``` - -### Include the recommended packages - -Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. - -[Azure Identity][azure_identity] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation. - -### Authentication - -By default, Azure Active Directory token authentication depends on correct configure of following environment variables. - -- `AZURE_CLIENT_ID` for Azure client ID. -- `AZURE_TENANT_ID` for Azure tenant ID. -- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. - -In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`. - -With above configuration, `azure` client can be authenticated by following code: - -```java com.azure.resourcemanager.authenticate -String armEndpoint = "https://management.."; -AzureProfile profile = new AzureProfile(getAzureEnvironmentFromArmEndpoint(armEndpoint)); -TokenCredential credential = new DefaultAzureCredentialBuilder() - .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) - .build(); -AzureResourceManager azure = AzureResourceManager - .authenticate(credential, profile) - .withDefaultSubscription(); -``` - -Change `armEndpoint` to point to the Azure Resource Manager endpoint of your Azure Stack Hub. The azure environment's -properties above can be populated with the following example: - -```java com.azure.resourcemanager.getazureenvironment -private static AzureEnvironment getAzureEnvironmentFromArmEndpoint(String armEndpoint) { - // Create HTTP client and request - HttpClient httpClient = HttpClient.createDefault(); - - HttpRequest request = new HttpRequest(HttpMethod.GET, - String.format("%s/metadata/endpoints?api-version=2019-10-01", armEndpoint)) - .setHeader("accept", "application/json"); - - // Execute the request and read the response - HttpResponse response = httpClient.send(request).block(); - if (response.getStatusCode() != 200) { - throw new RuntimeException("Failed : HTTP error code : " + response.getStatusCode()); - } - String body = response.getBodyAsString().block(); - try { - ArrayNode metadataArray = JacksonAdapter.createDefaultSerializerAdapter() - .deserialize(body, ArrayNode.class, SerializerEncoding.JSON); - - if (metadataArray == null || metadataArray.isEmpty()) { - throw new RuntimeException("Failed to find metadata : " + body); - } - - JsonNode metadata = metadataArray.iterator().next(); - AzureEnvironment azureEnvironment = new AzureEnvironment(new HashMap() { - { - put("managementEndpointUrl", metadata.at("/authentication/audiences/0").asText()); - put("resourceManagerEndpointUrl", armEndpoint); - put("galleryEndpointUrl", metadata.at("/gallery").asText()); - put("activeDirectoryEndpointUrl", metadata.at("/authentication/loginEndpoint").asText()); - put("activeDirectoryResourceId", metadata.at("/authentication/audiences/0").asText()); - put("activeDirectoryGraphResourceId", metadata.at("/graph").asText()); - put("storageEndpointSuffix", "." + metadata.at("/suffixes/storage").asText()); - put("keyVaultDnsSuffix", "." + metadata.at("/suffixes/keyVaultDns").asText()); - } - }); - return azureEnvironment; - } catch (IOException ioe) { - ioe.printStackTrace(); - throw new RuntimeException(ioe); - } -} -``` - -When targeting a hybrid solution to global Azure instead of your Azure Stack Hub, `AzureEnvironment.AZURE` can be used instead. - -See [Authentication][authenticate] for more options. - -## Key concepts - -See [API design][design] for general introduction on design and key concepts on Azure Management Libraries. - -## Examples - -See [Samples][sample] for code snippets and samples. - -## Troubleshooting - -## Next steps - -## Contributing - -For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). - -1. Fork it -1. Create your feature branch (`git checkout -b my-new-feature`) -1. Commit your changes (`git commit -am 'Add some feature'`) -1. Push to the branch (`git push origin my-new-feature`) -1. Create new Pull Request - - -[jdk]: https://learn.microsoft.com/java/azure/jdk/ -[azure_subscription]: https://azure.microsoft.com/free/ -[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity -[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty -[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md -[sample]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/SAMPLE.md -[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md -[api_profile]: https://learn.microsoft.com/azure-stack/user/azure-stack-version-profiles -[resourcemanagerhybrid_lib]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanagerhybrid diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager/pom.xml b/sdk/resourcemanagerhybrid/azure-resourcemanager/pom.xml deleted file mode 100644 index 7d0904591d73..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager/pom.xml +++ /dev/null @@ -1,236 +0,0 @@ - - - 4.0.0 - - - com.azure - azure-client-sdk-parent - 1.7.0 - ../../parents/azure-client-sdk-parent - - - com.azure.resourcemanager - azure-resourcemanager - 1.0.0-hybrid - jar - - Microsoft Azure SDK for Management (Hybrid) - This package contains Microsoft Azure SDK for Management (Hybrid). For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt - https://github.com/Azure/azure-sdk-for-java - - - - The MIT License (MIT) - http://opensource.org/licenses/MIT - repo - - - - - https://github.com/Azure/azure-sdk-for-java - scm:git:git@github.com:Azure/azure-sdk-for-java.git - HEAD - - - - - 0.10 - 0.10 - - - --add-opens com.azure.resourcemanager/com.azure.resourcemanager=ALL-UNNAMED - --add-opens com.azure.resourcemanager.appservice/com.azure.resourcemanager.appservice=ALL-UNNAMED - --add-opens com.azure.resourcemanager.authorization/com.azure.resourcemanager.authorization=ALL-UNNAMED - --add-opens com.azure.resourcemanager.compute/com.azure.resourcemanager.compute=ALL-UNNAMED - --add-opens com.azure.resourcemanager.containerinstance/com.azure.resourcemanager.containerinstance=ALL-UNNAMED - --add-opens com.azure.resourcemanager.containerregistry/com.azure.resourcemanager.containerregistry=ALL-UNNAMED - --add-opens com.azure.resourcemanager.eventhubs/com.azure.resourcemanager.eventhubs=ALL-UNNAMED - --add-opens com.azure.resourcemanager.keyvault/com.azure.resourcemanager.keyvault=ALL-UNNAMED - --add-opens com.azure.resourcemanager.msi/com.azure.resourcemanager.msi=ALL-UNNAMED - --add-opens com.azure.resourcemanager.resources/com.azure.resourcemanager.resources=ALL-UNNAMED - --add-opens com.azure.resourcemanager.resources/com.azure.resourcemanager.resources.fluentcore.arm=ALL-UNNAMED - --add-opens com.azure.resourcemanager.sql/com.azure.resourcemanager.sql=ALL-UNNAMED - --add-opens com.azure.core/com.azure.core.implementation.jackson=ALL-UNNAMED - - - - - - microsoft - Microsoft - - - - - - com.azure.resourcemanager - azure-resourcemanager-resources - 1.0.0-hybrid - - - com.azure.resourcemanager - azure-resourcemanager-storage - 1.0.0-hybrid - - - com.azure.resourcemanager - azure-resourcemanager-compute - 1.0.0-hybrid - - - com.azure.resourcemanager - azure-resourcemanager-network - 1.0.0-hybrid - - - com.azure.resourcemanager - azure-resourcemanager-keyvault - 1.0.0-hybrid - - - com.azure.resourcemanager - azure-resourcemanager-authorization - 1.0.0-hybrid - - - com.azure.resourcemanager - azure-resourcemanager-appservice - 1.0.0-hybrid - - - com.azure.resourcemanager - azure-resourcemanager-containerservice - 1.0.0-hybrid - - - com.azure.resourcemanager - azure-resourcemanager-monitor - 1.0.0-hybrid - - - com.azure.resourcemanager - azure-resourcemanager-containerregistry - 1.0.0-hybrid - - - com.azure.resourcemanager - azure-resourcemanager-dns - 1.0.0-hybrid - - - com.azure.resourcemanager - azure-resourcemanager-eventhubs - 1.0.0-hybrid - - - org.junit.jupiter - junit-jupiter-engine - 5.13.4 - test - - - org.slf4j - slf4j-simple - 1.7.36 - test - - - org.junit.jupiter - junit-jupiter-api - 5.13.4 - test - - - com.azure - azure-core-http-netty - 1.16.2 - test - - - com.azure - azure-core-http-okhttp - 1.13.2 - test - - - com.azure - azure-core-http-vertx - 1.1.2 - test - - - com.jcraft - jsch - 0.1.55 - test - - - - - azure-mgmt-sdk-test-jar - - - !maven.test.skip - - - - - com.azure.resourcemanager - azure-resourcemanager-test - 1.0.0-hybrid - test - - - - - - java12plus - - [12,) - - - - com.azure - azure-core-http-jdk-httpclient - 1.1.2 - test - - - - - - - - org.apache.maven.plugins - maven-jar-plugin - 3.4.2 - - - - true - true - - - - - - - org.jacoco - jacoco-maven-plugin - 0.8.13 - - - com/azure/resourcemanager/**/fluent/**/* - com/azure/resourcemanager/**/models/**/* - com/azure/resourcemanager/**/implementation/*ClientImpl* - com/azure/resourcemanager/**/implementation/*ClientBuilder* - - - - - - diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/main/java/com/azure/resourcemanager/AccessManagement.java b/sdk/resourcemanagerhybrid/azure-resourcemanager/src/main/java/com/azure/resourcemanager/AccessManagement.java deleted file mode 100644 index 1f45ec19feaa..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/main/java/com/azure/resourcemanager/AccessManagement.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager; - -import com.azure.resourcemanager.authorization.models.ActiveDirectoryApplications; -import com.azure.resourcemanager.authorization.models.ActiveDirectoryGroups; -import com.azure.resourcemanager.authorization.models.ActiveDirectoryUsers; -import com.azure.resourcemanager.authorization.models.RoleAssignments; -import com.azure.resourcemanager.authorization.models.RoleDefinitions; -import com.azure.resourcemanager.authorization.models.ServicePrincipals; - -/** Exposes methods related to managing access permissions in Azure. */ -public interface AccessManagement { - /** - * Entry point to AD user management APIs. - * - * @return ActiveDirectoryUsers interface providing access to tenant management - */ - ActiveDirectoryUsers activeDirectoryUsers(); - - /** - * Entry point to AD group management APIs. - * - * @return ActiveDirectoryGroups interface providing access to tenant management - */ - ActiveDirectoryGroups activeDirectoryGroups(); - - /** - * Entry point to AD service principal management APIs. - * - * @return ServicePrincipals interface providing access to tenant management - */ - ServicePrincipals servicePrincipals(); - - /** - * Entry point to AD application management APIs. - * - * @return Applications interface providing access to tenant management - */ - ActiveDirectoryApplications activeDirectoryApplications(); - - /** - * Entry point to role definition management APIs. - * - * @return RoleDefinitions interface providing access to tenant management - */ - RoleDefinitions roleDefinitions(); - - /** - * Entry point to role assignment management APIs. - * - * @return RoleAssignments interface providing access to tenant management - */ - RoleAssignments roleAssignments(); -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/main/java/com/azure/resourcemanager/AzureResourceManager.java b/sdk/resourcemanagerhybrid/azure-resourcemanager/src/main/java/com/azure/resourcemanager/AzureResourceManager.java deleted file mode 100644 index a86fdf85692c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/main/java/com/azure/resourcemanager/AzureResourceManager.java +++ /dev/null @@ -1,711 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager; - -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpPipeline; -import com.azure.core.management.AzureEnvironment; -import com.azure.resourcemanager.appservice.AppServiceManager; -import com.azure.resourcemanager.appservice.models.AppServiceCertificateOrders; -import com.azure.resourcemanager.appservice.models.AppServiceCertificates; -import com.azure.resourcemanager.appservice.models.AppServiceDomains; -import com.azure.resourcemanager.appservice.models.AppServicePlans; -import com.azure.resourcemanager.appservice.models.FunctionApps; -import com.azure.resourcemanager.appservice.models.WebApps; -import com.azure.resourcemanager.authorization.AuthorizationManager; -import com.azure.resourcemanager.authorization.models.ActiveDirectoryApplications; -import com.azure.resourcemanager.authorization.models.ActiveDirectoryGroups; -import com.azure.resourcemanager.authorization.models.ActiveDirectoryUsers; -import com.azure.resourcemanager.authorization.models.RoleAssignments; -import com.azure.resourcemanager.authorization.models.RoleDefinitions; -import com.azure.resourcemanager.authorization.models.ServicePrincipals; -import com.azure.resourcemanager.compute.ComputeManager; -import com.azure.resourcemanager.compute.models.AvailabilitySets; -import com.azure.resourcemanager.compute.models.ComputeSkus; -import com.azure.resourcemanager.compute.models.ComputeUsages; -import com.azure.resourcemanager.compute.models.Disks; -import com.azure.resourcemanager.compute.models.Galleries; -import com.azure.resourcemanager.compute.models.GalleryImageVersions; -import com.azure.resourcemanager.compute.models.GalleryImages; -import com.azure.resourcemanager.compute.models.Snapshots; -import com.azure.resourcemanager.compute.models.VirtualMachineCustomImages; -import com.azure.resourcemanager.compute.models.VirtualMachineImages; -import com.azure.resourcemanager.compute.models.VirtualMachineScaleSets; -import com.azure.resourcemanager.compute.models.VirtualMachines; -import com.azure.resourcemanager.containerregistry.ContainerRegistryManager; -import com.azure.resourcemanager.containerregistry.models.Registries; -import com.azure.resourcemanager.containerregistry.models.RegistryTaskRuns; -import com.azure.resourcemanager.containerregistry.models.RegistryTasks; -import com.azure.resourcemanager.containerservice.ContainerServiceManager; -import com.azure.resourcemanager.containerservice.models.KubernetesClusters; -import com.azure.resourcemanager.dns.DnsZoneManager; -import com.azure.resourcemanager.dns.models.DnsZones; -import com.azure.resourcemanager.eventhubs.EventHubsManager; -import com.azure.resourcemanager.eventhubs.models.EventHubDisasterRecoveryPairings; -import com.azure.resourcemanager.eventhubs.models.EventHubNamespaces; -import com.azure.resourcemanager.eventhubs.models.EventHubs; -import com.azure.resourcemanager.keyvault.KeyVaultManager; -import com.azure.resourcemanager.keyvault.models.Vaults; -import com.azure.resourcemanager.monitor.MonitorManager; -import com.azure.resourcemanager.monitor.models.ActionGroups; -import com.azure.resourcemanager.monitor.models.ActivityLogs; -import com.azure.resourcemanager.monitor.models.AlertRules; -import com.azure.resourcemanager.monitor.models.AutoscaleSettings; -import com.azure.resourcemanager.monitor.models.DiagnosticSettings; -import com.azure.resourcemanager.monitor.models.MetricDefinitions; -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.network.models.ApplicationGateways; -import com.azure.resourcemanager.network.models.ApplicationSecurityGroups; -import com.azure.resourcemanager.network.models.DdosProtectionPlans; -import com.azure.resourcemanager.network.models.ExpressRouteCircuits; -import com.azure.resourcemanager.network.models.ExpressRouteCrossConnections; -import com.azure.resourcemanager.network.models.LoadBalancers; -import com.azure.resourcemanager.network.models.LocalNetworkGateways; -import com.azure.resourcemanager.network.models.NetworkInterfaces; -import com.azure.resourcemanager.network.models.NetworkProfiles; -import com.azure.resourcemanager.network.models.NetworkSecurityGroups; -import com.azure.resourcemanager.network.models.NetworkUsages; -import com.azure.resourcemanager.network.models.NetworkWatchers; -import com.azure.resourcemanager.network.models.Networks; -import com.azure.resourcemanager.network.models.PublicIpAddresses; -import com.azure.resourcemanager.network.models.PublicIpPrefixes; -import com.azure.resourcemanager.network.models.RouteFilters; -import com.azure.resourcemanager.network.models.RouteTables; -import com.azure.resourcemanager.network.models.VirtualNetworkGateways; -import com.azure.resourcemanager.resources.ResourceManager; -import com.azure.resourcemanager.resources.fluentcore.arm.AzureConfigurable; -import com.azure.resourcemanager.resources.fluentcore.arm.implementation.AzureConfigurableImpl; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.resources.fluentcore.utils.HttpPipelineProvider; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import com.azure.resourcemanager.resources.models.Deployments; -import com.azure.resourcemanager.resources.models.Features; -import com.azure.resourcemanager.resources.models.GenericResources; -import com.azure.resourcemanager.resources.models.ManagementLocks; -import com.azure.resourcemanager.resources.models.PolicyAssignments; -import com.azure.resourcemanager.resources.models.PolicyDefinitions; -import com.azure.resourcemanager.resources.models.Providers; -import com.azure.resourcemanager.resources.models.ResourceGroups; -import com.azure.resourcemanager.resources.models.Subscription; -import com.azure.resourcemanager.resources.models.Subscriptions; -import com.azure.resourcemanager.resources.models.TagOperations; -import com.azure.resourcemanager.resources.models.Tenants; -import com.azure.resourcemanager.storage.StorageManager; -import com.azure.resourcemanager.storage.models.BlobContainers; -import com.azure.resourcemanager.storage.models.BlobServices; -import com.azure.resourcemanager.storage.models.ManagementPolicies; -import com.azure.resourcemanager.storage.models.StorageAccounts; -import com.azure.resourcemanager.storage.models.StorageSkus; -import com.azure.resourcemanager.storage.models.Usages; - -import java.util.Objects; - -/** The entry point for accessing resource management APIs in Azure. */ -public final class AzureResourceManager { - private final ResourceManager resourceManager; - private final StorageManager storageManager; - private final ComputeManager computeManager; - private final NetworkManager networkManager; - private final KeyVaultManager keyVaultManager; - private final DnsZoneManager dnsZoneManager; - private final AppServiceManager appServiceManager; - private final ContainerRegistryManager containerRegistryManager; - private final ContainerServiceManager containerServiceManager; - private final MonitorManager monitorManager; - private final EventHubsManager eventHubsManager; - private final Authenticated authenticated; - private final String subscriptionId; - private final String tenantId; - - /** - * Authenticate to Azure using an Azure credential object. - * - * @param credential the credential object - * @param profile the profile to use - * @return the authenticated Azure client - */ - public static Authenticated authenticate(TokenCredential credential, AzureProfile profile) { - Objects.requireNonNull(credential, "'credential' cannot be null."); - Objects.requireNonNull(profile, "'profile' cannot be null."); - return new AuthenticatedImpl(HttpPipelineProvider.buildHttpPipeline(credential, profile), profile); - } - - /** - * Authenticates API access using a RestClient instance. - * - * @param httpPipeline the HttpPipeline configured with Azure authentication credential - * @param profile the profile used in Active Directory - * @return authenticated Azure client - */ - public static Authenticated authenticate(HttpPipeline httpPipeline, AzureProfile profile) { - Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); - Objects.requireNonNull(profile, "'profile' cannot be null."); - return new AuthenticatedImpl(httpPipeline, profile); - } - - /** @return an interface allow configurations on the client. */ - public static Configurable configure() { - return new ConfigurableImpl(); - } - - /** The interface allowing configurations to be made on the client. */ - public interface Configurable extends AzureConfigurable { - /** - * Authenticates API access based on the provided credential. - * - * @param credential The credential to authenticate API access with - * @param profile the profile to use - * @return the authenticated Azure client - */ - Authenticated authenticate(TokenCredential credential, AzureProfile profile); - } - - /** The implementation for {@link Configurable}. */ - private static final class ConfigurableImpl extends AzureConfigurableImpl implements Configurable { - @Override - public Authenticated authenticate(TokenCredential credential, AzureProfile profile) { - return AzureResourceManager.authenticate(buildHttpPipeline(credential, profile), profile); - } - } - - /** - * Provides authenticated access to a subset of Azure APIs that do not require a specific subscription. - * - *

    To access the subscription-specific APIs, use {@link Authenticated#withSubscription(String)}, or - * withDefaultSubscription() if a default subscription has already been previously specified (for example, in a - * previously specified authentication file). - */ - public interface Authenticated extends AccessManagement { - /** @return the currently selected tenant ID this client is authenticated to work with */ - String tenantId(); - - /** - * Entry point to subscription management APIs. - * - * @return Subscriptions interface providing access to subscription management - */ - Subscriptions subscriptions(); - - /** - * Entry point to tenant management APIs. - * - * @return Tenants interface providing access to tenant management - */ - Tenants tenants(); - - /** - * Specifies a specific tenant for azure. - * - *

    Only Graph RBAC APIs require a tenant to be selected.

    - * - * @param tenantId the ID of the tenant - * @return the authenticated itself for chaining - */ - Authenticated withTenantId(String tenantId); - - /** - * Selects a specific subscription for the APIs to work with. - * - *

    Most Azure APIs require a specific subscription to be selected.

    - * - * @param subscriptionId the ID of the subscription - * @return an authenticated Azure client configured to work with the specified subscription - */ - AzureResourceManager withSubscription(String subscriptionId); - - /** - * Selects the default subscription as the subscription for the APIs to work with. - * - *

    The default subscription can be specified inside the Azure profile using {@link - * AzureProfile}. If no default subscription provided, we will try to set the only - * subscription if applicable returned by {@link Authenticated#subscriptions()}

    - * - * @throws IllegalStateException when no subscription or more than one subscription found in the tenant. - * @return an authenticated Azure client configured to work with the default subscription - */ - AzureResourceManager withDefaultSubscription(); - } - - /** The implementation for the Authenticated interface. */ - private static final class AuthenticatedImpl implements Authenticated { - private final HttpPipeline httpPipeline; - private final ResourceManager.Authenticated resourceManagerAuthenticated; - private AuthorizationManager authorizationManager; - private String tenantId; - private String subscriptionId; - private final AzureEnvironment environment; - - private AuthenticatedImpl(HttpPipeline httpPipeline, AzureProfile profile) { - this.resourceManagerAuthenticated = ResourceManager.authenticate(httpPipeline, profile); - this.authorizationManager = AuthorizationManager.authenticate(httpPipeline, profile); - this.httpPipeline = httpPipeline; - this.tenantId = profile.getTenantId(); - this.subscriptionId = profile.getSubscriptionId(); - this.environment = profile.getEnvironment(); - } - - @Override - public String tenantId() { - return this.tenantId; - } - - @Override - public Subscriptions subscriptions() { - return resourceManagerAuthenticated.subscriptions(); - } - - @Override - public Tenants tenants() { - return resourceManagerAuthenticated.tenants(); - } - - @Override - public ActiveDirectoryUsers activeDirectoryUsers() { - return authorizationManager.users(); - } - - @Override - public ActiveDirectoryGroups activeDirectoryGroups() { - return authorizationManager.groups(); - } - - @Override - public ServicePrincipals servicePrincipals() { - return authorizationManager.servicePrincipals(); - } - - @Override - public ActiveDirectoryApplications activeDirectoryApplications() { - return authorizationManager.applications(); - } - - @Override - public RoleDefinitions roleDefinitions() { - return authorizationManager.roleDefinitions(); - } - - @Override - public RoleAssignments roleAssignments() { - return authorizationManager.roleAssignments(); - } - - @Override - public Authenticated withTenantId(String tenantId) { - Objects.requireNonNull(tenantId); - this.tenantId = tenantId; - this.authorizationManager = AuthorizationManager.authenticate( - this.httpPipeline, new AzureProfile(tenantId, subscriptionId, environment)); - return this; - } - - @Override - public AzureResourceManager withSubscription(String subscriptionId) { - return new AzureResourceManager( - httpPipeline, new AzureProfile(tenantId, subscriptionId, environment), this); - } - - @Override - public AzureResourceManager withDefaultSubscription() { - if (subscriptionId == null) { - subscriptionId = ResourceManagerUtils.getDefaultSubscription(this.subscriptions().list()); - } - return new AzureResourceManager( - httpPipeline, new AzureProfile(tenantId, subscriptionId, environment), this); - } - } - - private AzureResourceManager(HttpPipeline httpPipeline, AzureProfile profile) { - this(httpPipeline, profile, AzureResourceManager.authenticate(httpPipeline, profile)); - } - - private AzureResourceManager(HttpPipeline httpPipeline, AzureProfile profile, Authenticated authenticated) { - this.resourceManager = ResourceManager.authenticate(httpPipeline, profile).withDefaultSubscription(); - this.storageManager = StorageManager.authenticate(httpPipeline, profile); - this.computeManager = ComputeManager.authenticate(httpPipeline, profile); - this.networkManager = NetworkManager.authenticate(httpPipeline, profile); - this.keyVaultManager = KeyVaultManager.authenticate(httpPipeline, profile); - this.dnsZoneManager = DnsZoneManager.authenticate(httpPipeline, profile); - this.appServiceManager = AppServiceManager.authenticate(httpPipeline, profile); - this.containerRegistryManager = ContainerRegistryManager.authenticate(httpPipeline, profile); - this.containerServiceManager = ContainerServiceManager.authenticate(httpPipeline, profile); - this.monitorManager = MonitorManager.authenticate(httpPipeline, profile); - this.eventHubsManager = EventHubsManager.authenticate(httpPipeline, profile); - this.authenticated = authenticated; - this.subscriptionId = profile.getSubscriptionId(); - this.tenantId = profile.getTenantId(); - } - - /** @return the currently selected subscription ID this client is authenticated to work with */ - public String subscriptionId() { - return this.subscriptionId; - } - - /** @return the currently selected tenant ID this client is authenticated to work with */ - public String tenantId() { - return this.tenantId; - } - - /** @return the currently selected subscription this client is authenticated to work with */ - public Subscription getCurrentSubscription() { - return this.subscriptions().getById(this.subscriptionId()); - } - - /** @return entry point to managing subscriptions */ - public Subscriptions subscriptions() { - return this.resourceManager.subscriptions(); - } - - /** @return entry point to managing tenants */ - public Tenants tenants() { - return this.resourceManager.tenants(); - } - - /** @return entry point to managing resource groups */ - public ResourceGroups resourceGroups() { - return this.resourceManager.resourceGroups(); - } - - /** @return entry point to managing deployments */ - public Deployments deployments() { - return this.resourceManager.deployments(); - } - - /** @return entry point to managing generic resources */ - public GenericResources genericResources() { - return resourceManager.genericResources(); - } - - /** @return entry point to managing features */ - public Features features() { - return resourceManager.features(); - } - - /** @return entry point to managing resource providers */ - public Providers providers() { - return resourceManager.providers(); - } - - /** @return entry point to managing policy definitions. */ - public PolicyDefinitions policyDefinitions() { - return resourceManager.policyDefinitions(); - } - - /** @return entry point to managing policy assignments. */ - public PolicyAssignments policyAssignments() { - return resourceManager.policyAssignments(); - } - - /** @return entry point to managing locks. */ - public ManagementLocks managementLocks() { - return resourceManager.managementLocks(); - } - - /** @return entry point to managing storage accounts */ - public StorageAccounts storageAccounts() { - return storageManager.storageAccounts(); - } - - /** @return entry point to managing storage account usages */ - public Usages storageUsages() { - return storageManager.usages(); - } - - /** @return entry point to managing storage service SKUs */ - public StorageSkus storageSkus() { - return storageManager.storageSkus(); - } - - /** @return entry point to managing availability sets */ - public AvailabilitySets availabilitySets() { - return computeManager.availabilitySets(); - } - - /** @return entry point to managing virtual networks */ - public Networks networks() { - return networkManager.networks(); - } - - /** @return entry point to managing route tables */ - public RouteTables routeTables() { - return networkManager.routeTables(); - } - - /** @return entry point to managing load balancers */ - public LoadBalancers loadBalancers() { - return networkManager.loadBalancers(); - } - - /** @return entry point to managing application gateways */ - public ApplicationGateways applicationGateways() { - return networkManager.applicationGateways(); - } - - /** @return entry point to managing network security groups */ - public NetworkSecurityGroups networkSecurityGroups() { - return networkManager.networkSecurityGroups(); - } - - /** @return entry point to managing network resource usages */ - public NetworkUsages networkUsages() { - return networkManager.usages(); - } - - /** @return entry point to managing network watchers */ - public NetworkWatchers networkWatchers() { - return networkManager.networkWatchers(); - } - - /** @return entry point to managing virtual network gateways */ - public VirtualNetworkGateways virtualNetworkGateways() { - return networkManager.virtualNetworkGateways(); - } - - /** @return entry point to managing local network gateways */ - public LocalNetworkGateways localNetworkGateways() { - return networkManager.localNetworkGateways(); - } - - /** @return entry point to managing express route circuits */ - public ExpressRouteCircuits expressRouteCircuits() { - return networkManager.expressRouteCircuits(); - } - - /** @return entry point to managing express route cross connections */ - public ExpressRouteCrossConnections expressRouteCrossConnections() { - return networkManager.expressRouteCrossConnections(); - } - - /** @return entry point to managing express route circuits */ - public ApplicationSecurityGroups applicationSecurityGroups() { - return networkManager.applicationSecurityGroups(); - } - - /** @return entry point to managing route filters */ - public RouteFilters routeFilters() { - return networkManager.routeFilters(); - } - - /** @return entry point to managing DDoS protection plans */ - public DdosProtectionPlans ddosProtectionPlans() { - return networkManager.ddosProtectionPlans(); - } - - /** @return entry point to managing virtual machines */ - public VirtualMachines virtualMachines() { - return computeManager.virtualMachines(); - } - - /** @return entry point to managing virtual machine scale sets. */ - public VirtualMachineScaleSets virtualMachineScaleSets() { - return computeManager.virtualMachineScaleSets(); - } - - /** @return entry point to managing virtual machine images */ - public VirtualMachineImages virtualMachineImages() { - return computeManager.virtualMachineImages(); - } - - /** @return entry point to managing virtual machine custom images */ - public VirtualMachineCustomImages virtualMachineCustomImages() { - return computeManager.virtualMachineCustomImages(); - } - - /** @return entry point to managing managed disks */ - public Disks disks() { - return computeManager.disks(); - } - - /** @return entry point to managing managed snapshots */ - public Snapshots snapshots() { - return computeManager.snapshots(); - } - - /** @return the compute service SKU management API entry point */ - public ComputeSkus computeSkus() { - return computeManager.computeSkus(); - } - - /** @return entry point to managing public IP addresses */ - public PublicIpAddresses publicIpAddresses() { - return this.networkManager.publicIpAddresses(); - } - - /** @return entry point to managing public IP prefixes */ - public PublicIpPrefixes publicIpPrefixes() { - return this.networkManager.publicIpPrefixes(); - } - - /** @return entry point to managing network interfaces */ - public NetworkInterfaces networkInterfaces() { - return this.networkManager.networkInterfaces(); - } - - /** @return entry point to managing compute resource usages */ - public ComputeUsages computeUsages() { - return computeManager.usages(); - } - - /** @return entry point to managing key vaults */ - public Vaults vaults() { - return this.keyVaultManager.vaults(); - } - - // /** - // * @return entry point to managing batch accounts. - // */ - // public BatchAccounts batchAccounts() { - // return batchManager.batchAccounts(); - // } - - /** @return entry point to managing DNS zones. */ - public DnsZones dnsZones() { - return dnsZoneManager.zones(); - } - - /** @return entry point to managing web apps. */ - public WebApps webApps() { - return appServiceManager.webApps(); - } - - /** @return entry point to managing function apps. */ - public FunctionApps functionApps() { - return appServiceManager.functionApps(); - } - - /** @return entry point to managing app service plans. */ - public AppServicePlans appServicePlans() { - return appServiceManager.appServicePlans(); - } - - /** @return entry point to managing domains. */ - public AppServiceDomains appServiceDomains() { - return appServiceManager.domains(); - } - - /** @return entry point to managing certificates. */ - public AppServiceCertificates appServiceCertificates() { - return appServiceManager.certificates(); - } - - /** @return entry point to managing certificates orders. */ - public AppServiceCertificateOrders appServiceCertificateOrders() { - return appServiceManager.certificateOrders(); - } - - /** @return entry point to managing Kubernetes clusters. */ - public KubernetesClusters kubernetesClusters() { - return containerServiceManager.kubernetesClusters(); - } - - /** @return entry point to managing Container Registries. */ - public Registries containerRegistries() { - return containerRegistryManager.containerRegistries(); - } - - /** @return entry point to managing Container Registry RegistryTasks. */ - public RegistryTasks containerRegistryTasks() { - return containerRegistryManager.containerRegistryTasks(); - } - - /** @return entry point to managing Container Registry RegistryTask Runs. */ - public RegistryTaskRuns containerRegistryTaskRuns() { - return containerRegistryManager.registryTaskRuns(); - } - - /** @return entry point to authentication and authorization management in Azure */ - public AccessManagement accessManagement() { - return this.authenticated; - } - - /** @return entry point to listing activity log events in Azure */ - public ActivityLogs activityLogs() { - return this.monitorManager.activityLogs(); - } - - /** @return entry point to listing metric definitions in Azure */ - public MetricDefinitions metricDefinitions() { - return this.monitorManager.metricDefinitions(); - } - - /** @return entry point to listing diagnostic settings in Azure */ - public DiagnosticSettings diagnosticSettings() { - return this.monitorManager.diagnosticSettings(); - } - - /** @return entry point to managing action groups in Azure */ - public ActionGroups actionGroups() { - return this.monitorManager.actionGroups(); - } - - /** @return entry point to managing alertRules in Azure */ - public AlertRules alertRules() { - return this.monitorManager.alertRules(); - } - - /** @return entry point to managing Autoscale Settings in Azure */ - public AutoscaleSettings autoscaleSettings() { - return this.monitorManager.autoscaleSettings(); - } - - /** - * @return entry point to managing event hub namespaces. - */ - public EventHubNamespaces eventHubNamespaces() { - return this.eventHubsManager.namespaces(); - } - - /** - * @return entry point to managing event hubs. - */ - public EventHubs eventHubs() { - return this.eventHubsManager.eventHubs(); - } - - /** - * @return entry point to managing event hub namespace geo disaster recovery. - */ - public EventHubDisasterRecoveryPairings eventHubDisasterRecoveryPairings() { - return this.eventHubsManager.eventHubDisasterRecoveryPairings(); - } - - /** @return entry point to manage compute galleries. */ - public Galleries galleries() { - return this.computeManager.galleries(); - } - - /** @return entry point to manage compute gallery images. */ - public GalleryImages galleryImages() { - return this.computeManager.galleryImages(); - } - - /** @return entry point to manage compute gallery image versions. */ - public GalleryImageVersions galleryImageVersions() { - return this.computeManager.galleryImageVersions(); - } - - /** @return the blob container management API entry point */ - public BlobContainers storageBlobContainers() { - return this.storageManager.blobContainers(); - } - - /** @return the blob service management API entry point */ - public BlobServices storageBlobServices() { - return this.storageManager.blobServices(); - } - - /** @return the blob service management API entry point */ - public ManagementPolicies storageManagementPolicies() { - return this.storageManager.managementPolicies(); - } - - /** @return entry point to tag management management */ - public TagOperations tagOperations() { - return this.resourceManager.tagOperations(); - } - - /** @return entry point to network profiles management */ - public NetworkProfiles networkProfiles() { - return this.networkManager.networkProfiles(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/main/java/com/azure/resourcemanager/package-info.java b/sdk/resourcemanagerhybrid/azure-resourcemanager/src/main/java/com/azure/resourcemanager/package-info.java deleted file mode 100644 index 7113b6996616..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/main/java/com/azure/resourcemanager/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. - -/** This package contains the Azure rollup client. */ -package com.azure.resourcemanager; diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/main/java/module-info.java b/sdk/resourcemanagerhybrid/azure-resourcemanager/src/main/java/module-info.java deleted file mode 100644 index 2e15468ebb81..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/main/java/module-info.java +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -module com.azure.resourcemanager { - requires transitive com.azure.resourcemanager.resources; - requires transitive com.azure.resourcemanager.appservice; - requires transitive com.azure.resourcemanager.compute; - requires transitive com.azure.resourcemanager.containerregistry; - requires transitive com.azure.resourcemanager.containerservice; - requires transitive com.azure.resourcemanager.eventhubs; - requires transitive com.azure.resourcemanager.monitor; - - exports com.azure.resourcemanager; -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/ReadmeSamples.java b/sdk/resourcemanagerhybrid/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/ReadmeSamples.java deleted file mode 100644 index d1f980c11f32..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/ReadmeSamples.java +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager; - -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpMethod; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.policy.HttpLogDetailLevel; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.util.serializer.JacksonAdapter; -import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.identity.DefaultAzureCredentialBuilder; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.ArrayNode; - -import java.io.IOException; -import java.util.HashMap; - -public class ReadmeSamples { - - public void authenticate() { - // BEGIN: com.azure.resourcemanager.authenticate - String armEndpoint = "https://management.."; - AzureProfile profile = new AzureProfile(getAzureEnvironmentFromArmEndpoint(armEndpoint)); - TokenCredential credential = new DefaultAzureCredentialBuilder() - .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) - .build(); - AzureResourceManager azure = AzureResourceManager - .authenticate(credential, profile) - .withDefaultSubscription(); - // END: com.azure.resourcemanager.authenticate - } - - public void configureWithLogging() { - String armEndpoint = "https://management.."; - AzureProfile profile = new AzureProfile(getAzureEnvironmentFromArmEndpoint(armEndpoint)); - TokenCredential credential = new DefaultAzureCredentialBuilder() - .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) - .build(); - // BEGIN: com.azure.resourcemanager.logging - AzureResourceManager azure = AzureResourceManager - .configure() - .withLogLevel(HttpLogDetailLevel.BASIC) - .authenticate(credential, profile) - .withDefaultSubscription(); - // END: com.azure.resourcemanager.logging - } - - // BEGIN: com.azure.resourcemanager.getazureenvironment - private static AzureEnvironment getAzureEnvironmentFromArmEndpoint(String armEndpoint) { - // Create HTTP client and request - HttpClient httpClient = HttpClient.createDefault(); - - HttpRequest request = new HttpRequest(HttpMethod.GET, - String.format("%s/metadata/endpoints?api-version=2019-10-01", armEndpoint)) - .setHeader("accept", "application/json"); - - // Execute the request and read the response - HttpResponse response = httpClient.send(request).block(); - if (response.getStatusCode() != 200) { - throw new RuntimeException("Failed : HTTP error code : " + response.getStatusCode()); - } - String body = response.getBodyAsString().block(); - try { - ArrayNode metadataArray = JacksonAdapter.createDefaultSerializerAdapter() - .deserialize(body, ArrayNode.class, SerializerEncoding.JSON); - - if (metadataArray == null || metadataArray.isEmpty()) { - throw new RuntimeException("Failed to find metadata : " + body); - } - - JsonNode metadata = metadataArray.iterator().next(); - AzureEnvironment azureEnvironment = new AzureEnvironment(new HashMap() { - { - put("managementEndpointUrl", metadata.at("/authentication/audiences/0").asText()); - put("resourceManagerEndpointUrl", armEndpoint); - put("galleryEndpointUrl", metadata.at("/gallery").asText()); - put("activeDirectoryEndpointUrl", metadata.at("/authentication/loginEndpoint").asText()); - put("activeDirectoryResourceId", metadata.at("/authentication/audiences/0").asText()); - put("activeDirectoryGraphResourceId", metadata.at("/graph").asText()); - put("storageEndpointSuffix", "." + metadata.at("/suffixes/storage").asText()); - put("keyVaultDnsSuffix", "." + metadata.at("/suffixes/keyVaultDns").asText()); - } - }); - return azureEnvironment; - } catch (IOException ioe) { - ioe.printStackTrace(); - throw new RuntimeException(ioe); - } - } - // END: com.azure.resourcemanager.getazureenvironment -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/ApplicationGatewayTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/ApplicationGatewayTests.java deleted file mode 100644 index e6479062c309..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/ApplicationGatewayTests.java +++ /dev/null @@ -1,408 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager; - -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.policy.HttpLogOptions; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.management.exception.ManagementException; -import com.azure.resourcemanager.compute.models.KnownLinuxVirtualMachineImage; -import com.azure.resourcemanager.compute.models.VirtualMachine; -import com.azure.resourcemanager.network.models.ApplicationGateway; -import com.azure.resourcemanager.network.models.ApplicationGatewayBackend; -import com.azure.resourcemanager.network.models.ApplicationGatewayBackendHealth; -import com.azure.resourcemanager.network.models.ApplicationGatewayBackendHttpConfigurationHealth; -import com.azure.resourcemanager.network.models.ApplicationGatewayBackendServerHealth; -import com.azure.resourcemanager.network.models.ApplicationGatewayOperationalState; -import com.azure.resourcemanager.network.models.ApplicationGatewayRequestRoutingRule; -import com.azure.resourcemanager.network.models.Network; -import com.azure.resourcemanager.network.models.NetworkInterface; -import com.azure.resourcemanager.network.models.NicIpConfiguration; -import com.azure.resourcemanager.resources.fluentcore.utils.HttpPipelineProvider; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import com.azure.resourcemanager.resources.models.ResourceGroup; -import com.azure.core.management.Region; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.CreatedResources; - -import java.time.temporal.ChronoUnit; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.test.ResourceManagerTestBase; -import com.azure.resourcemanager.test.utils.TestDelayProvider; -import com.azure.resourcemanager.test.utils.TestIdentifierProvider; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public class ApplicationGatewayTests extends ResourceManagerTestBase { - private AzureResourceManager azureResourceManager; - - @Override - protected HttpPipeline buildHttpPipeline( - TokenCredential credential, - AzureProfile profile, - HttpLogOptions httpLogOptions, - List policies, - HttpClient httpClient) { - return HttpPipelineProvider.buildHttpPipeline( - credential, - profile, - null, - httpLogOptions, - null, - new RetryPolicy("Retry-After", ChronoUnit.SECONDS), - policies, - httpClient); - } - - @Override - protected void initializeClients(HttpPipeline httpPipeline, AzureProfile profile) { - ResourceManagerUtils.InternalRuntimeContext.setDelayProvider(new TestDelayProvider(!isPlaybackMode())); - ResourceManagerUtils.InternalRuntimeContext internalContext = new ResourceManagerUtils.InternalRuntimeContext(); - internalContext.setIdentifierFunction(name -> new TestIdentifierProvider(testResourceNamer)); - azureResourceManager = buildManager(AzureResourceManager.class, httpPipeline, profile); - setInternalContext(internalContext, azureResourceManager); - } - - @Override - protected void cleanUpResources() { - } - - /** - * Tests a complex internal application gateway. - * - * @throws Exception - */ - @Test - @Disabled("TODO refactor to avoid pfx") - public void testAppGatewaysInternalComplex() throws Exception { - new TestApplicationGateway().new PrivateComplex(azureResourceManager.resourceGroups().manager().internalContext()) - .runTest(azureResourceManager.applicationGateways(), azureResourceManager.resourceGroups()); - } - - /** - * Tests application gateway with path-based routing rule. - * - * @throws Exception - */ - @Test - public void testAppGatewaysPublicUrlPathBased() throws Exception { - new TestApplicationGateway().new UrlPathBased(azureResourceManager.resourceGroups().manager().internalContext()) - .runTest(azureResourceManager.applicationGateways(), azureResourceManager.resourceGroups()); - } - - @Test - public void testAppGatewayBackendHealthCheck() throws Exception { - String testId = azureResourceManager.applicationGateways().manager().resourceManager().internalContext().randomResourceName("", 15); - String name = "ag" + testId; - Region region = locationOrDefault(Region.US_EAST); - String password = ResourceManagerTestBase.password(); - String vnetName = "net" + testId; - String rgName = "rg" + testId; - - try { - // Create a vnet - Network network = - azureResourceManager - .networks() - .define(vnetName) - .withRegion(region) - .withNewResourceGroup(rgName) - .withAddressSpace("10.0.0.0/28") - .withSubnet("subnet1", "10.0.0.0/29") - .withSubnet("subnet2", "10.0.0.8/29") - .create(); - - // Create VMs for the backend in the network to connect to - List> vmsDefinitions = new ArrayList<>(); - for (int i = 0; i < 2; i++) { - vmsDefinitions - .add( - azureResourceManager - .virtualMachines() - .define("vm" + i + testId) - .withRegion(region) - .withExistingResourceGroup(rgName) - .withExistingPrimaryNetwork(network) - .withSubnet("subnet2") - .withPrimaryPrivateIPAddressDynamic() - .withoutPrimaryPublicIPAddress() - .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) - .withRootUsername("tester") - .withRootPassword(password)); - } - - CreatedResources createdVms = azureResourceManager.virtualMachines().create(vmsDefinitions); - VirtualMachine[] vms = new VirtualMachine[createdVms.size()]; - for (int i = 0; i < vmsDefinitions.size(); i++) { - vms[i] = createdVms.get(vmsDefinitions.get(i).key()); - } - - String[] ipAddresses = new String[vms.length]; - for (int i = 0; i < vms.length; i++) { - ipAddresses[i] = vms[i].getPrimaryNetworkInterface().primaryPrivateIP(); - } - - // Create the app gateway in the other subnet of the same vnet and point the backend at the VMs - ApplicationGateway appGateway = - azureResourceManager - .applicationGateways() - .define(name) - .withRegion(region) - .withExistingResourceGroup(rgName) - .defineRequestRoutingRule("rule1") - .fromPrivateFrontend() - .fromFrontendHttpPort(80) - .toBackendHttpPort(8080) - .toBackendIPAddresses(ipAddresses) // Connect the VMs via IP addresses - .attach() - .defineRequestRoutingRule("rule2") - .fromPrivateFrontend() - .fromFrontendHttpPort(25) - .toBackendHttpPort(22) - .toBackend("nicBackend") - .attach() - .withExistingSubnet(network.subnets().get("subnet1")) // Backend for connecting the VMs via NICs - .create(); - - // Connect the 1st VM via NIC IP config - NetworkInterface nic = vms[0].getPrimaryNetworkInterface(); - Assertions.assertNotNull(nic); - ApplicationGatewayBackend appGatewayBackend = appGateway.backends().get("nicBackend"); - Assertions.assertNotNull(appGatewayBackend); - nic - .update() - .updateIPConfiguration(nic.primaryIPConfiguration().name()) - .withExistingApplicationGatewayBackend(appGateway, appGatewayBackend.name()) - .parent() - .apply(); - - // Get the health of the VMs - appGateway.refresh(); - Map backendHealths = appGateway.checkBackendHealth(); - - StringBuilder info = new StringBuilder(); - info.append("\nApplication gateway backend healths: ").append(backendHealths.size()); - for (ApplicationGatewayBackendHealth backendHealth : backendHealths.values()) { - info - .append("\n\tApplication gateway backend name: ") - .append(backendHealth.name()) - .append("\n\t\tHTTP configuration healths: ") - .append(backendHealth.httpConfigurationHealths().size()); - Assertions.assertNotNull(backendHealth.backend()); - for (ApplicationGatewayBackendHttpConfigurationHealth backendConfigHealth - : backendHealth.httpConfigurationHealths().values()) { - info - .append("\n\t\t\tHTTP configuration name: ") - .append(backendConfigHealth.name()) - .append("\n\t\t\tServers: ") - .append(backendConfigHealth.innerModel().servers().size()); - Assertions.assertNotNull(backendConfigHealth.backendHttpConfiguration()); - for (ApplicationGatewayBackendServerHealth serverHealth - : backendConfigHealth.serverHealths().values()) { - NicIpConfiguration ipConfig = serverHealth.getNetworkInterfaceIPConfiguration(); - if (ipConfig != null) { - info - .append("\n\t\t\t\tServer NIC ID: ") - .append(ipConfig.parent().id()) - .append("\n\t\t\t\tIP Config name: ") - .append(ipConfig.name()); - } else { - info.append("\n\t\t\t\tServer IP: " + serverHealth.ipAddress()); - } - info.append("\n\t\t\t\tHealth status: ").append(serverHealth.status()); - } - } - } - System.out.println(info.toString()); - - // Verify app gateway - Assertions.assertEquals(2, appGateway.backends().size()); - ApplicationGatewayRequestRoutingRule rule1 = appGateway.requestRoutingRules().get("rule1"); - Assertions.assertNotNull(rule1); - ApplicationGatewayBackend backend1 = rule1.backend(); - Assertions.assertNotNull(backend1); - ApplicationGatewayRequestRoutingRule rule2 = appGateway.requestRoutingRules().get("rule2"); - Assertions.assertNotNull(rule2); - ApplicationGatewayBackend backend2 = rule2.backend(); - Assertions.assertNotNull(backend2); - - Assertions.assertEquals(2, backendHealths.size()); - - // Verify first backend (IP address-based) - ApplicationGatewayBackendHealth backendHealth1 = backendHealths.get(backend1.name()); - Assertions.assertNotNull(backendHealth1); - Assertions.assertNotNull(backendHealth1.backend()); - for (int i = 0; i < ipAddresses.length; i++) { - Assertions.assertTrue(backend1.containsIPAddress(ipAddresses[i])); - } - - // Verify second backend (NIC based) - ApplicationGatewayBackendHealth backendHealth2 = backendHealths.get(backend2.name()); - Assertions.assertNotNull(backendHealth2); - Assertions.assertNotNull(backendHealth2.backend()); - Assertions.assertEquals(backend2.name(), backendHealth2.name()); - Assertions.assertEquals(1, backendHealth2.httpConfigurationHealths().size()); - ApplicationGatewayBackendHttpConfigurationHealth httpConfigHealth2 = - backendHealth2.httpConfigurationHealths().values().iterator().next(); - Assertions.assertNotNull(httpConfigHealth2.backendHttpConfiguration()); - Assertions.assertEquals(1, httpConfigHealth2.serverHealths().size()); - ApplicationGatewayBackendServerHealth serverHealth = - httpConfigHealth2.serverHealths().values().iterator().next(); - NicIpConfiguration ipConfig2 = serverHealth.getNetworkInterfaceIPConfiguration(); - Assertions.assertEquals(nic.primaryIPConfiguration().name(), ipConfig2.name()); - } catch (Exception e) { - throw e; - } finally { - if (azureResourceManager.resourceGroups().contain(rgName)) { - azureResourceManager.resourceGroups().beginDeleteByName(rgName); - } - } - } - - /** - * Tests a minimal internal application gateway - * - * @throws Exception - */ - @Test - @Disabled("TODO refactor to avoid pfx") - public void testAppGatewaysInternalMinimal() throws Exception { - new TestApplicationGateway().new PrivateMinimal(azureResourceManager.resourceGroups().manager().internalContext()) - .runTest(azureResourceManager.applicationGateways(), azureResourceManager.resourceGroups()); - } - - @Test - public void testAppGatewaysStartStop() throws Exception { - String rgName = azureResourceManager.resourceGroups().manager().internalContext().randomResourceName("rg", 13); - Region region = locationOrDefault(Region.US_EAST); - String name = azureResourceManager.resourceGroups().manager().internalContext().randomResourceName("ag", 15); - ApplicationGateway appGateway = - azureResourceManager - .applicationGateways() - .define(name) - .withRegion(region) - .withNewResourceGroup(rgName) - - // Request routing rules - .defineRequestRoutingRule("rule1") - .fromPrivateFrontend() - .fromFrontendHttpPort(80) - .toBackendHttpPort(8080) - .toBackendIPAddress("11.1.1.1") - .toBackendIPAddress("11.1.1.2") - .attach() - .create(); - - // Test stop/start - appGateway.stop(); - Assertions.assertEquals(ApplicationGatewayOperationalState.STOPPED, appGateway.operationalState()); - appGateway.start(); - Assertions.assertEquals(ApplicationGatewayOperationalState.RUNNING, appGateway.operationalState()); - - azureResourceManager.resourceGroups().beginDeleteByName(rgName); - } - - @Test - public void testApplicationGatewaysInParallel() throws Exception { - String rgName = azureResourceManager.applicationGateways().manager().resourceManager().internalContext().randomResourceName("rg", 13); - Region region = locationOrDefault(Region.US_EAST); - Creatable resourceGroup = azureResourceManager.resourceGroups().define(rgName).withRegion(region); - List> agCreatables = new ArrayList<>(); - - agCreatables - .add( - azureResourceManager - .applicationGateways() - .define(azureResourceManager.applicationGateways().manager().resourceManager().internalContext().randomResourceName("ag", 13)) - .withRegion(locationOrDefault(Region.US_EAST)) - .withNewResourceGroup(resourceGroup) - .defineRequestRoutingRule("rule1") - .fromPrivateFrontend() - .fromFrontendHttpPort(80) - .toBackendHttpPort(8080) - .toBackendIPAddress("10.0.0.1") - .toBackendIPAddress("10.0.0.2") - .attach()); - - agCreatables - .add( - azureResourceManager - .applicationGateways() - .define(azureResourceManager.applicationGateways().manager().resourceManager().internalContext().randomResourceName("ag", 13)) - .withRegion(locationOrDefault(Region.US_EAST)) - .withNewResourceGroup(resourceGroup) - .defineRequestRoutingRule("rule1") - .fromPrivateFrontend() - .fromFrontendHttpPort(80) - .toBackendHttpPort(8080) - .toBackendIPAddress("10.0.0.3") - .toBackendIPAddress("10.0.0.4") - .attach()); - - CreatedResources created = azureResourceManager.applicationGateways().create(agCreatables); - List ags = new ArrayList<>(); - List agIds = new ArrayList<>(); - for (Creatable creatable : agCreatables) { - ApplicationGateway ag = created.get(creatable.key()); - Assertions.assertNotNull(ag); - ags.add(ag); - agIds.add(ag.id()); - } - - azureResourceManager.applicationGateways().stop(agIds); - - for (ApplicationGateway ag : ags) { - Assertions.assertEquals(ApplicationGatewayOperationalState.STOPPED, ag.refresh().operationalState()); - } - - azureResourceManager.applicationGateways().start(agIds); - - for (ApplicationGateway ag : ags) { - Assertions.assertEquals(ApplicationGatewayOperationalState.RUNNING, ag.refresh().operationalState()); - } - - azureResourceManager.applicationGateways().deleteByIds(agIds); - for (String id : agIds) { - try { - ApplicationGateway ag = azureResourceManager.applicationGateways().getById(id); - Assertions.assertNull(ag); - } catch (ManagementException e) { - Assertions.assertEquals(404, e.getResponse().getStatusCode()); - } - } - - azureResourceManager.resourceGroups().beginDeleteByName(rgName); - } - - /** - * Tests a minimal Internet-facing application gateway. - * - * @throws Exception - */ - @Test - @Disabled("TODO refactor to avoid pfx") - public void testAppGatewaysInternetFacingMinimal() throws Exception { - new TestApplicationGateway().new PublicMinimal(azureResourceManager.resourceGroups().manager().internalContext()) - .runTest(azureResourceManager.applicationGateways(), azureResourceManager.resourceGroups()); - } - - /** - * Tests a complex Internet-facing application gateway. - * - * @throws Exception - */ - @Test - @Disabled("Refactor to avoid to use pfx") - public void testAppGatewaysInternetFacingComplex() throws Exception { - new TestApplicationGateway().new PublicComplex(azureResourceManager.resourceGroups().manager().internalContext()) - .runTest(azureResourceManager.applicationGateways(), azureResourceManager.resourceGroups()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/AzureResourceManagerTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/AzureResourceManagerTests.java deleted file mode 100644 index 74c5495b2b6a..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/AzureResourceManagerTests.java +++ /dev/null @@ -1,1113 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager; - -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.policy.HttpLogOptions; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.exception.ManagementException; -import com.azure.resourcemanager.compute.models.CachingTypes; -import com.azure.resourcemanager.compute.models.Disk; -import com.azure.resourcemanager.compute.models.KnownLinuxVirtualMachineImage; -import com.azure.resourcemanager.compute.models.PowerState; -import com.azure.resourcemanager.compute.models.VirtualMachine; -import com.azure.resourcemanager.compute.models.VirtualMachineImage; -import com.azure.resourcemanager.compute.models.VirtualMachineOffer; -import com.azure.resourcemanager.compute.models.VirtualMachinePublisher; -import com.azure.resourcemanager.compute.models.VirtualMachineSizeTypes; -import com.azure.resourcemanager.compute.models.VirtualMachineSku; -import com.azure.resourcemanager.network.models.Access; -import com.azure.resourcemanager.network.models.ConnectionMonitor; -import com.azure.resourcemanager.network.models.ConnectionMonitorQueryResult; -import com.azure.resourcemanager.network.models.ConnectivityCheck; -import com.azure.resourcemanager.network.models.Direction; -import com.azure.resourcemanager.network.models.FlowLogSettings; -import com.azure.resourcemanager.network.models.IpFlowProtocol; -import com.azure.resourcemanager.network.models.Network; -import com.azure.resourcemanager.network.models.NetworkSecurityGroup; -import com.azure.resourcemanager.network.models.NetworkWatcher; -import com.azure.resourcemanager.network.models.NextHop; -import com.azure.resourcemanager.network.models.NextHopType; -import com.azure.resourcemanager.network.models.PacketCapture; -import com.azure.resourcemanager.network.models.PcProtocol; -import com.azure.resourcemanager.network.models.PcStatus; -import com.azure.resourcemanager.network.models.SecurityGroupView; -import com.azure.resourcemanager.network.models.Subnet; -import com.azure.resourcemanager.network.models.Topology; -import com.azure.resourcemanager.network.models.VerificationIPFlow; -import com.azure.resourcemanager.resources.fluentcore.model.CreatedResources; -import com.azure.resourcemanager.resources.models.LockLevel; -import com.azure.resourcemanager.resources.models.ManagementLock; -import com.azure.resourcemanager.resources.models.ResourceGroup; -import com.azure.resourcemanager.storage.models.StorageAccountSkuType; -import com.azure.resourcemanager.test.utils.TestUtilities; -import com.azure.resourcemanager.resources.fluentcore.arm.CountryIsoCode; -import com.azure.core.management.Region; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.resources.fluentcore.utils.HttpPipelineProvider; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import com.azure.resourcemanager.resources.models.Deployment; -import com.azure.resourcemanager.resources.models.DeploymentMode; -import com.azure.resourcemanager.resources.models.GenericResource; -import com.azure.resourcemanager.resources.models.Location; -import com.azure.resourcemanager.resources.models.Subscription; -import com.azure.resourcemanager.storage.models.StorageAccount; -import java.io.IOException; -import java.time.Duration; -import java.time.temporal.ChronoUnit; -import java.util.Arrays; -import java.util.Collection; -import java.util.List; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.TimeUnit; - -import com.azure.resourcemanager.test.ResourceManagerTestBase; -import com.azure.resourcemanager.test.utils.TestDelayProvider; -import com.azure.resourcemanager.test.utils.TestIdentifierProvider; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Flux; -import reactor.core.scheduler.Schedulers; - -public class AzureResourceManagerTests extends ResourceManagerTestBase { - private AzureResourceManager azureResourceManager; - - @Override - protected HttpPipeline buildHttpPipeline( - TokenCredential credential, - AzureProfile profile, - HttpLogOptions httpLogOptions, - List policies, - HttpClient httpClient) { - return HttpPipelineProvider.buildHttpPipeline( - credential, - profile, - null, - httpLogOptions, - null, - new RetryPolicy("Retry-After", ChronoUnit.SECONDS), - policies, - httpClient); - } - - @Override - protected void initializeClients(HttpPipeline httpPipeline, AzureProfile profile) { - ResourceManagerUtils.InternalRuntimeContext.setDelayProvider(new TestDelayProvider(!isPlaybackMode())); - ResourceManagerUtils.InternalRuntimeContext internalContext = new ResourceManagerUtils.InternalRuntimeContext(); - internalContext.setIdentifierFunction(name -> new TestIdentifierProvider(testResourceNamer)); - azureResourceManager = AzureResourceManager.authenticate(httpPipeline, profile).withDefaultSubscription(); - setInternalContext(internalContext, azureResourceManager); - } - - @Override - protected void cleanUpResources() { - } - - /** - * Stress-tests the resilience of ExpandableEnum to multi-threaded access - * - * @throws Exception - */ - @Test - public void testExpandableEnum() throws Exception { - - // Define some threads that read from enum - Runnable reader1 = - new Runnable() { - @Override - public void run() { - Assertions.assertEquals(CountryIsoCode.AFGHANISTAN, CountryIsoCode.fromString("AF")); - Assertions.assertEquals(CountryIsoCode.ANTARCTICA, CountryIsoCode.fromString("AQ")); - Assertions.assertEquals(CountryIsoCode.ANDORRA, CountryIsoCode.fromString("AD")); - Assertions.assertEquals(CountryIsoCode.ARGENTINA, CountryIsoCode.fromString("AR")); - Assertions.assertEquals(CountryIsoCode.ALBANIA, CountryIsoCode.fromString("AL")); - Assertions.assertEquals(CountryIsoCode.ALGERIA, CountryIsoCode.fromString("DZ")); - Assertions.assertEquals(CountryIsoCode.AMERICAN_SAMOA, CountryIsoCode.fromString("AS")); - Assertions.assertEquals(CountryIsoCode.ANGOLA, CountryIsoCode.fromString("AO")); - Assertions.assertEquals(CountryIsoCode.ANGUILLA, CountryIsoCode.fromString("AI")); - Assertions.assertEquals(CountryIsoCode.ANTIGUA_AND_BARBUDA, CountryIsoCode.fromString("AG")); - Assertions.assertEquals(CountryIsoCode.ARMENIA, CountryIsoCode.fromString("AM")); - Assertions.assertEquals(CountryIsoCode.ARUBA, CountryIsoCode.fromString("AW")); - Assertions.assertEquals(CountryIsoCode.AUSTRALIA, CountryIsoCode.fromString("AU")); - Assertions.assertEquals(CountryIsoCode.AUSTRIA, CountryIsoCode.fromString("AT")); - Assertions.assertEquals(CountryIsoCode.AZERBAIJAN, CountryIsoCode.fromString("AZ")); - Assertions.assertEquals(PowerState.DEALLOCATED, PowerState.fromString("PowerState/deallocated")); - Assertions.assertEquals(PowerState.DEALLOCATING, PowerState.fromString("PowerState/deallocating")); - Assertions.assertEquals(PowerState.RUNNING, PowerState.fromString("PowerState/running")); - } - }; - - Runnable reader2 = - new Runnable() { - @Override - public void run() { - Assertions.assertEquals(CountryIsoCode.BAHAMAS, CountryIsoCode.fromString("BS")); - Assertions.assertEquals(CountryIsoCode.BAHRAIN, CountryIsoCode.fromString("BH")); - Assertions.assertEquals(CountryIsoCode.BANGLADESH, CountryIsoCode.fromString("BD")); - Assertions.assertEquals(CountryIsoCode.BARBADOS, CountryIsoCode.fromString("BB")); - Assertions.assertEquals(CountryIsoCode.BELARUS, CountryIsoCode.fromString("BY")); - Assertions.assertEquals(CountryIsoCode.BELGIUM, CountryIsoCode.fromString("BE")); - Assertions.assertEquals(PowerState.STARTING, PowerState.fromString("PowerState/starting")); - Assertions.assertEquals(PowerState.STOPPED, PowerState.fromString("PowerState/stopped")); - Assertions.assertEquals(PowerState.STOPPING, PowerState.fromString("PowerState/stopping")); - Assertions.assertEquals(PowerState.UNKNOWN, PowerState.fromString("PowerState/unknown")); - } - }; - - // Define some threads that write to enum - Runnable writer1 = - new Runnable() { - @Override - public void run() { - for (int i = 1; i <= 10; i++) { - CountryIsoCode.fromString("CountryIsoCode" + i); - PowerState.fromString("PowerState" + i); - } - } - }; - - Runnable writer2 = - new Runnable() { - @Override - public void run() { - for (int i = 1; i <= 20; i++) { - CountryIsoCode.fromString("CountryIsoCode" + i); - PowerState.fromString("PowerState" + i); - } - } - }; - - // Start the threads and repeat a few times - ExecutorService threadPool = Executors.newFixedThreadPool(4); - for (int repeat = 0; repeat < 10; repeat++) { - threadPool.submit(reader1); - threadPool.submit(reader2); - threadPool.submit(writer1); - threadPool.submit(writer2); - } - - // Give the test a fixed amount of time to finish - threadPool.awaitTermination(10, TimeUnit.SECONDS); - - // Verify country ISO codes - Collection countryIsoCodes = CountryIsoCode.values(); - System.out.println("\n## Country ISO codes: " + countryIsoCodes.size()); - for (CountryIsoCode value : countryIsoCodes) { - System.out.println(value.toString()); - } - Assertions.assertEquals(257, countryIsoCodes.size()); - - // Verify power states - Collection powerStates = PowerState.values(); - System.out.println("\n## Power states: " + powerStates.size()); - for (PowerState value : powerStates) { - System.out.println(value.toString()); - } - Assertions.assertEquals(27, powerStates.size()); - } - - private static final String TEMPLATE_URI = "https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/quickstarts/microsoft.network/vnet-two-subnets/azuredeploy.json"; - private static final String PARAMETERS_URI = "https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/quickstarts/microsoft.network/vnet-two-subnets/azuredeploy.parameters.json"; - private static final String CONTENT_VERSION = "1.0.0.0"; - - /** - * Tests ARM template deployments. - * - * @throws IOException - * @throws ManagementException - */ - @Test - @Disabled("Includes lots of information in subscription as it goes through all deployments") - public void testDeployments() throws Exception { - String testId = azureResourceManager.deployments().manager().resourceManager().internalContext().randomResourceName("", 8); - PagedIterable deployments = azureResourceManager.deployments().list(); - System.out.println("Deployments: " + TestUtilities.getSize(deployments)); - Deployment deployment = - azureResourceManager - .deployments() - .define("depl" + testId) - .withNewResourceGroup("rg" + testId, locationOrDefault(Region.US_WEST)) - .withTemplateLink(TEMPLATE_URI, CONTENT_VERSION) - .withParametersLink(PARAMETERS_URI, CONTENT_VERSION) - .withMode(DeploymentMode.COMPLETE) - .create(); - System.out.println("Created deployment: " + deployment.correlationId()); - - azureResourceManager.resourceGroups().beginDeleteByName("rg" + testId); - } - - /** - * Tests basic generic resources retrieval. - * - * @throws Exception - */ - @Test - public void testGenericResources() throws Exception { - // Create some resources - NetworkSecurityGroup nsg = - azureResourceManager - .networkSecurityGroups() - .define(azureResourceManager.networkSecurityGroups().manager().resourceManager().internalContext().randomResourceName("nsg", 13)) - .withRegion(locationOrDefault(Region.US_EAST)) - .withNewResourceGroup() - .create(); - azureResourceManager - .publicIpAddresses() - .define(azureResourceManager.networkSecurityGroups().manager().resourceManager().internalContext().randomResourceName("pip", 13)) - .withRegion(locationOrDefault(Region.US_EAST)) - .withExistingResourceGroup(nsg.resourceGroupName()) - .create(); - - PagedIterable resources = - azureResourceManager.genericResources().listByResourceGroup(nsg.resourceGroupName()); - Assertions.assertEquals(2, TestUtilities.getSize(resources)); - GenericResource firstResource = resources.iterator().next(); - - GenericResource resourceById = azureResourceManager.genericResources().getById(firstResource.id()); - GenericResource resourceByDetails = - azureResourceManager - .genericResources() - .get( - firstResource.resourceGroupName(), - firstResource.resourceProviderNamespace(), - firstResource.resourceType(), - firstResource.name()); - Assertions.assertTrue(resourceById.id().equalsIgnoreCase(resourceByDetails.id())); - azureResourceManager.resourceGroups().beginDeleteByName(nsg.resourceGroupName()); - } - - /** - * Tests management locks. - * NOTE: This requires the service principal to have an Owner role on the subscription - * - * @throws Exception - */ - @Test - public void testManagementLocks() throws Exception { - // Prepare a VM - final String password = ResourceManagerTestBase.password(); - final String rgName = generateRandomResourceName("rg", 15); - final String vmName = generateRandomResourceName("vm", 15); - final String storageName = generateRandomResourceName("st", 15); - final String diskName = generateRandomResourceName("dsk", 15); - final String netName = generateRandomResourceName("net", 15); - final Region region = locationOrDefault(Region.US_WEST); - - ResourceGroup resourceGroup = null; - ManagementLock lockGroup = null, - lockVM = null, - lockStorage = null, - lockDiskRO = null, - lockDiskDel = null, - lockSubnet = null; - try { - resourceGroup = azureResourceManager.resourceGroups().define(rgName) - .withRegion(region) - .create(); - Assertions.assertNotNull(resourceGroup); - - Creatable netDefinition = azureResourceManager.networks().define(netName) - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .withAddressSpace("10.0.0.0/28"); - - // Define a VM for testing VM locks - Creatable vmDefinition = azureResourceManager.virtualMachines().define(vmName) - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .withNewPrimaryNetwork(netDefinition) - .withPrimaryPrivateIPAddressDynamic() - .withoutPrimaryPublicIPAddress() - .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) - .withRootUsername("tester") - .withRootPassword(password) - .withSize(VirtualMachineSizeTypes.fromString("Standard_D2a_v4")); - - // Define a managed disk for testing locks on that - Creatable diskDefinition = azureResourceManager.disks().define(diskName) - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .withData() - .withSizeInGB(100); - - // Define a storage account for testing locks on that - Creatable storageDefinition = azureResourceManager.storageAccounts().define(storageName) - .withRegion(region) - .withExistingResourceGroup(resourceGroup); - - // Create resources in parallel to save time and money - Flux.merge( - storageDefinition.createAsync().subscribeOn(Schedulers.parallel()), - vmDefinition.createAsync().subscribeOn(Schedulers.parallel()), - diskDefinition.createAsync().subscribeOn(Schedulers.parallel())) - .blockLast(); - - VirtualMachine vm = (VirtualMachine) vmDefinition; - StorageAccount storage = (StorageAccount) storageDefinition; - Disk disk = (Disk) diskDefinition; - Network network = vm.getPrimaryNetworkInterface().primaryIPConfiguration().getNetwork(); - Subnet subnet = network.subnets().values().iterator().next(); - - // Lock subnet - Creatable lockSubnetDef = azureResourceManager.managementLocks().define("subnetLock") - .withLockedResource(subnet.innerModel().id()) - .withLevel(LockLevel.READ_ONLY); - - // Lock VM - Creatable lockVMDef = azureResourceManager.managementLocks().define("vmlock") - .withLockedResource(vm) - .withLevel(LockLevel.READ_ONLY) - .withNotes("vm readonly lock"); - - // Lock resource group - Creatable lockGroupDef = azureResourceManager.managementLocks().define("rglock") - .withLockedResource(resourceGroup.id()) - .withLevel(LockLevel.CAN_NOT_DELETE); - - // Lock storage - Creatable lockStorageDef = azureResourceManager.managementLocks().define("stLock") - .withLockedResource(storage) - .withLevel(LockLevel.CAN_NOT_DELETE); - - // Create locks in parallel - @SuppressWarnings("unchecked") - CreatedResources created = azureResourceManager.managementLocks().create( - lockVMDef, lockGroupDef, lockStorageDef, lockSubnetDef); - lockVM = created.get(lockVMDef.key()); - lockStorage = created.get(lockStorageDef.key()); - lockGroup = created.get(lockGroupDef.key()); - lockSubnet = created.get(lockSubnetDef.key()); - - // Lock disk synchronously - lockDiskRO = azureResourceManager.managementLocks().define("diskLockRO") - .withLockedResource(disk) - .withLevel(LockLevel.READ_ONLY) - .create(); - - lockDiskDel = azureResourceManager.managementLocks().define("diskLockDel") - .withLockedResource(disk) - .withLevel(LockLevel.CAN_NOT_DELETE) - .create(); - - // Verify VM lock - Assertions.assertEquals(2, TestUtilities.getSize( - azureResourceManager.managementLocks().listForResource(vm.id()))); - - Assertions.assertNotNull(lockVM); - lockVM = azureResourceManager.managementLocks().getById(lockVM.id()); - Assertions.assertNotNull(lockVM); - TestUtils.print(lockVM); - Assertions.assertEquals(LockLevel.READ_ONLY, lockVM.level()); - Assertions.assertTrue(vm.id().equalsIgnoreCase(lockVM.lockedResourceId())); - - // Verify resource group lock - Assertions.assertNotNull(lockGroup); - lockGroup = azureResourceManager.managementLocks().getByResourceGroup(resourceGroup.name(), "rglock"); - Assertions.assertNotNull(lockGroup); - TestUtils.print(lockVM); - Assertions.assertEquals(LockLevel.CAN_NOT_DELETE, lockGroup.level()); - Assertions.assertTrue(resourceGroup.id().equalsIgnoreCase(lockGroup.lockedResourceId())); - - // Verify storage account lock - Assertions.assertEquals(2, TestUtilities.getSize( - azureResourceManager.managementLocks().listForResource(storage.id()))); - - Assertions.assertNotNull(lockStorage); - lockStorage = azureResourceManager.managementLocks().getById(lockStorage.id()); - Assertions.assertNotNull(lockStorage); - TestUtils.print(lockStorage); - Assertions.assertEquals(LockLevel.CAN_NOT_DELETE, lockStorage.level()); - Assertions.assertTrue(storage.id().equalsIgnoreCase(lockStorage.lockedResourceId())); - - // Verify disk lock - Assertions.assertEquals(3, TestUtilities.getSize( - azureResourceManager.managementLocks().listForResource(disk.id()))); - - Assertions.assertNotNull(lockDiskRO); - lockDiskRO = azureResourceManager.managementLocks().getById(lockDiskRO.id()); - Assertions.assertNotNull(lockDiskRO); - TestUtils.print(lockDiskRO); - Assertions.assertEquals(LockLevel.READ_ONLY, lockDiskRO.level()); - Assertions.assertTrue(disk.id().equalsIgnoreCase(lockDiskRO.lockedResourceId())); - - Assertions.assertNotNull(lockDiskDel); - lockDiskDel = azureResourceManager.managementLocks().getById(lockDiskDel.id()); - Assertions.assertNotNull(lockDiskDel); - TestUtils.print(lockDiskDel); - Assertions.assertEquals(LockLevel.CAN_NOT_DELETE, lockDiskDel.level()); - Assertions.assertTrue(disk.id().equalsIgnoreCase(lockDiskDel.lockedResourceId())); - - // Verify subnet lock - Assertions.assertEquals(2, TestUtilities.getSize( - azureResourceManager.managementLocks().listForResource(network.id()))); - - lockSubnet = azureResourceManager.managementLocks().getById(lockSubnet.id()); - Assertions.assertNotNull(lockSubnet); - TestUtils.print(lockSubnet); - Assertions.assertEquals(LockLevel.READ_ONLY, lockSubnet.level()); - Assertions.assertTrue(subnet.innerModel().id().equalsIgnoreCase(lockSubnet.lockedResourceId())); - - // Verify lock collection - PagedIterable locksSubscription = azureResourceManager.managementLocks().list(); - PagedIterable locksGroup = azureResourceManager.managementLocks() - .listByResourceGroup(vm.resourceGroupName()); - Assertions.assertNotNull(locksSubscription); - Assertions.assertNotNull(locksGroup); - - int locksAllCount = TestUtilities.getSize(locksSubscription); - System.out.println("All locks: " + locksAllCount); - Assertions.assertTrue(6 <= locksAllCount); - - int locksGroupCount = TestUtilities.getSize(locksGroup); - System.out.println("Group locks: " + locksGroupCount); - Assertions.assertEquals(6, locksGroupCount); - } catch (Exception ex) { - ex.printStackTrace(System.out); - } finally { - if (resourceGroup != null) { - if (lockGroup != null) { - azureResourceManager.managementLocks().deleteById(lockGroup.id()); - } - if (lockVM != null) { - azureResourceManager.managementLocks().deleteById(lockVM.id()); - } - if (lockDiskRO != null) { - azureResourceManager.managementLocks().deleteById(lockDiskRO.id()); - } - if (lockDiskDel != null) { - azureResourceManager.managementLocks().deleteById(lockDiskDel.id()); - } - if (lockStorage != null) { - azureResourceManager.managementLocks().deleteById(lockStorage.id()); - } - if (lockSubnet != null) { - azureResourceManager.managementLocks().deleteById(lockSubnet.id()); - } - azureResourceManager.resourceGroups().beginDeleteByName(resourceGroup.name()); - } - } - } - - - /** - * Tests VM images. - * - * @throws IOException - * @throws ManagementException - */ - @Test - public void testVMImages() throws ManagementException, IOException { - PagedIterable publishers = - azureResourceManager.virtualMachineImages().publishers().listByRegion(locationOrDefault(Region.US_WEST)); - Assertions.assertTrue(TestUtilities.getSize(publishers) > 0); - for (VirtualMachinePublisher p : publishers.stream().limit(5).toArray(VirtualMachinePublisher[]::new)) { - System.out.println(String.format("Publisher name: %s, region: %s", p.name(), p.region())); - for (VirtualMachineOffer o : p.offers().list().stream().limit(5).toArray(VirtualMachineOffer[]::new)) { - System.out.println(String.format("\tOffer name: %s", o.name())); - for (VirtualMachineSku s : o.skus().list().stream().limit(5).toArray(VirtualMachineSku[]::new)) { - System.out.println(String.format("\t\tSku name: %s", s.name())); - } - } - } - // TODO: limit vm images by filter - PagedIterable images = azureResourceManager.virtualMachineImages().listByRegion(locationOrDefault(Region.US_WEST)); - Assertions.assertTrue(TestUtilities.getSize(images) > 0); - // Seems to help avoid connection refused error on subsequent mock test - ResourceManagerUtils.sleep(Duration.ofSeconds(2)); - } - - /** - * Tests the network security group implementation. - * - * @throws Exception - */ - @Test - @Disabled("Test fails due to missing SourceApplicationSecurityGroup on update") - public void testNetworkSecurityGroups() throws Exception { - new TestNSG().runTest(azureResourceManager.networkSecurityGroups(), azureResourceManager.resourceGroups()); - } - - /** - * Tests the inbound NAT rule support in load balancers. - * - * @throws Exception - */ - @Test - public void testLoadBalancersNatRules() throws Exception { - new TestLoadBalancer().new InternetWithNatRule(azureResourceManager.virtualMachines().manager()) - .runTest(azureResourceManager.loadBalancers(), azureResourceManager.resourceGroups()); - } - - /** - * Tests the inbound NAT pool support in load balancers. - * - * @throws Exception - */ - @Test - public void testLoadBalancersNatPools() throws Exception { - new TestLoadBalancer().new InternetWithNatPool(azureResourceManager.virtualMachines().manager()) - .runTest(azureResourceManager.loadBalancers(), azureResourceManager.resourceGroups()); - } - - /** - * Tests the minimum Internet-facing load balancer with a load balancing rule only - * - * @throws Exception - */ - @Test - public void testLoadBalancersInternetMinimum() throws Exception { - new TestLoadBalancer().new InternetMinimal(azureResourceManager.virtualMachines().manager()) - .runTest(azureResourceManager.loadBalancers(), azureResourceManager.resourceGroups()); - } - - /** - * Tests the minimum Internet-facing load balancer with a NAT rule only - * - * @throws Exception - */ - @Test - public void testLoadBalancersNatOnly() throws Exception { - new TestLoadBalancer().new InternetNatOnly(azureResourceManager.virtualMachines().manager()) - .runTest(azureResourceManager.loadBalancers(), azureResourceManager.resourceGroups()); - } - - /** - * Tests the minimum internal load balancer. - * - * @throws Exception - */ - @Test - public void testLoadBalancersInternalMinimum() throws Exception { - new TestLoadBalancer().new InternalMinimal(azureResourceManager.virtualMachines().manager()) - .runTest(azureResourceManager.loadBalancers(), azureResourceManager.resourceGroups()); - } - - /** - * Tests the internal load balancer with availability zone. - * - * @throws Exception - */ - @Test - @Disabled("Though valid scenario, NRP is failing") - public void testLoadBalancersInternalWithAvailabilityZone() throws Exception { - new TestLoadBalancer().new InternalWithZone(azureResourceManager.virtualMachines().manager()) - .runTest(azureResourceManager.loadBalancers(), azureResourceManager.resourceGroups()); - } - - @Test - public void testManagedDiskVMUpdate() throws Exception { - ResourceManagerUtils.InternalRuntimeContext context = azureResourceManager.disks().manager().resourceManager().internalContext(); - final String rgName = context.randomResourceName("rg", 13); - final String linuxVM2Name = context.randomResourceName("vm" + "-", 10); - final String linuxVM2Pip = context.randomResourceName("pip" + "-", 18); - VirtualMachine linuxVM2 = - azureResourceManager - .virtualMachines() - .define(linuxVM2Name) - .withRegion(locationOrDefault(Region.US_EAST)) - .withNewResourceGroup(rgName) - .withNewPrimaryNetwork("10.0.0.0/28") - .withPrimaryPrivateIPAddressDynamic() - .withNewPrimaryPublicIPAddress(linuxVM2Pip) - .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) - .withRootUsername("tester") - .withRootPassword(password()) - // Begin: Managed data disks - .withNewDataDisk(100) - .withNewDataDisk(100, 1, CachingTypes.READ_WRITE) - // End: Managed data disks - .withSize(VirtualMachineSizeTypes.fromString("Standard_D2a_v4")) - .create(); - - linuxVM2.deallocate(); - linuxVM2.update().withoutDataDisk(2).withNewDataDisk(200).apply(); - azureResourceManager.resourceGroups().beginDeleteByName(rgName); - } - - /** - * Tests the public IP address implementation. - * - * @throws Exception - */ - @Test - public void testPublicIPAddresses() throws Exception { - new TestPublicIPAddress().runTest(azureResourceManager.publicIpAddresses(), azureResourceManager.resourceGroups()); - } - - /** - * Tests the public IP address implementation. - * - * @throws Exception - */ - @Test - public void testPublicIPPrefixes() throws Exception { - new TestPublicIPPrefix().runTest(azureResourceManager.publicIpPrefixes(), azureResourceManager.resourceGroups()); - } - - /** - * Tests the availability set implementation. - * - * @throws Exception - */ - @Test - public void testAvailabilitySets() throws Exception { - new TestAvailabilitySet().runTest(azureResourceManager.availabilitySets(), azureResourceManager.resourceGroups()); - } - - /** - * Tests the virtual network implementation. - * - * @throws Exception - */ - @Test - public void testNetworks() throws Exception { - new TestNetwork().new WithSubnets().runTest(azureResourceManager.networks(), azureResourceManager.resourceGroups()); - } - - /** - * Tests virtual network peering - * - * @throws Exception - */ - @Test - public void testNetworkWithAccessFromServiceToSubnet() throws Exception { - new TestNetwork().new WithAccessFromServiceToSubnet().runTest(azureResourceManager.networks(), azureResourceManager.resourceGroups()); - } - - /** - * Tests virtual network peering - * - * @throws Exception - */ - @Test - public void testNetworkPeerings() throws Exception { - new TestNetwork().new WithPeering().runTest(azureResourceManager.networks(), azureResourceManager.resourceGroups()); - } - - /** - * Tests virtual network with DDoS protection plan - * - * @throws Exception - */ - @Test - public void testDdosAndVmProtection() throws Exception { - new TestNetwork().new WithDDosProtectionPlanAndVmProtection().runTest(azureResourceManager.networks(), azureResourceManager.resourceGroups()); - } - - /** - * Tests updateTags for virtual network. - * - * @throws Exception - */ - @Test - public void testNetworkUpdateTags() throws Exception { - new TestNetwork().new WithUpdateTags().runTest(azureResourceManager.networks(), azureResourceManager.resourceGroups()); - } - - /** - * Tests route tables. - * - * @throws Exception - */ - @Test - public void testRouteTables() throws Exception { - new TestRouteTables().new Minimal().runTest(azureResourceManager.routeTables(), azureResourceManager.resourceGroups()); - } - - /** Tests the regions enum. */ - @Test - public void testRegions() { - // Show built-in regions - System.out.println("Built-in regions list:"); - int regionsCount = Region.values().size(); - - for (Region region : Region.values()) { - System.out.println("Name: " + region.name() + ", Label: " + region.label()); - } - - // Look up built-in region - Region region = locationOrDefault(Region.fromName("westus")); - Assertions.assertTrue(region == locationOrDefault(Region.US_WEST)); - - // Add a region - Region region2 = Region.fromName("madeUpRegion"); - Assertions.assertNotNull(region2); - Assertions.assertTrue(region2.name().equalsIgnoreCase("madeUpRegion")); - Region region3 = Region.fromName("madeupregion"); - Assertions.assertEquals(region3, region2); - Assertions.assertEquals(Region.values().size(), regionsCount + 1); - } - - /** - * Tests the network interface implementation. - * - * @throws Exception - */ - @Test - public void testNetworkInterfaces() throws Exception { - new TestNetworkInterface().runTest(azureResourceManager.networkInterfaces(), azureResourceManager.resourceGroups()); - } - - /** - * Tests the network watcher implementation. - * - * @throws Exception - */ - @Test - public void testNetworkWatchers() throws Exception { - new TestNetworkWatcher().runTest(azureResourceManager.networkWatchers(), azureResourceManager.resourceGroups()); - } - - @Test - @Disabled("Not stable test cases") - public void testNetworkWatcherFunctions() throws Exception { - String nwrg = null; - String tnwrg = null; - try { - TestNetworkWatcher tnw = new TestNetworkWatcher(); - - NetworkWatcher nw = tnw.createResource(azureResourceManager.networkWatchers()); - - tnwrg = tnw.groupName(); - nwrg = nw.resourceGroupName(); - - // pre-create VMs to show topology on - VirtualMachine[] virtualMachines = - tnw - .ensureNetwork( - azureResourceManager.networkWatchers().manager().networks(), - azureResourceManager.virtualMachines(), - azureResourceManager.networkInterfaces()); - - ConnectionMonitor connectionMonitor = - nw - .connectionMonitors() - .define("NewConnectionMonitor") - .withSourceId(virtualMachines[0].id()) - .withDestinationId(virtualMachines[1].id()) - .withDestinationPort(80) - .withTag("tag1", "value1") - .withoutAutoStart() - .withMonitoringInterval(35) - .create(); - Assertions.assertEquals("value1", connectionMonitor.tags().get("tag1")); - Assertions.assertEquals(35, connectionMonitor.monitoringIntervalInSeconds()); - Assertions.assertEquals("NotStarted", connectionMonitor.monitoringStatus()); - Assertions.assertEquals("NewConnectionMonitor", connectionMonitor.name()); - - connectionMonitor.start(); - Assertions.assertEquals("Running", connectionMonitor.monitoringStatus()); - Topology topology = nw.topology().withTargetResourceGroup(virtualMachines[0].resourceGroupName()).execute(); - Assertions.assertEquals(11, topology.resources().size()); - Assertions - .assertTrue( - topology - .resources() - .containsKey(virtualMachines[0].getPrimaryNetworkInterface().networkSecurityGroupId())); - Assertions - .assertEquals( - 4, topology.resources().get(virtualMachines[0].primaryNetworkInterfaceId()).associations().size()); - - SecurityGroupView sgViewResult = nw.getSecurityGroupView(virtualMachines[0].id()); - Assertions.assertEquals(1, sgViewResult.networkInterfaces().size()); - Assertions - .assertEquals( - virtualMachines[0].primaryNetworkInterfaceId(), - sgViewResult.networkInterfaces().keySet().iterator().next()); - - FlowLogSettings flowLogSettings = - nw.getFlowLogSettings(virtualMachines[0].getPrimaryNetworkInterface().networkSecurityGroupId()); - StorageAccount storageAccount = tnw.ensureStorageAccount(azureResourceManager.storageAccounts()); - flowLogSettings - .update() - .withLogging() - .withStorageAccount(storageAccount.id()) - .withRetentionPolicyDays(5) - .withRetentionPolicyEnabled() - .apply(); - Assertions.assertEquals(true, flowLogSettings.enabled()); - Assertions.assertEquals(5, flowLogSettings.retentionDays()); - Assertions.assertEquals(storageAccount.id(), flowLogSettings.storageId()); - - NextHop nextHop = - nw - .nextHop() - .withTargetResourceId(virtualMachines[0].id()) - .withSourceIpAddress("10.0.0.4") - .withDestinationIpAddress("8.8.8.8") - .execute(); - Assertions.assertEquals("System Route", nextHop.routeTableId()); - Assertions.assertEquals(NextHopType.INTERNET, nextHop.nextHopType()); - Assertions.assertNull(nextHop.nextHopIpAddress()); - - VerificationIPFlow verificationIPFlow = - nw - .verifyIPFlow() - .withTargetResourceId(virtualMachines[0].id()) - .withDirection(Direction.OUTBOUND) - .withProtocol(IpFlowProtocol.TCP) - .withLocalIPAddress("10.0.0.4") - .withRemoteIPAddress("8.8.8.8") - .withLocalPort("443") - .withRemotePort("443") - .execute(); - Assertions.assertEquals(Access.ALLOW, verificationIPFlow.access()); - Assertions - .assertTrue( - "defaultSecurityRules/AllowInternetOutBound".equalsIgnoreCase(verificationIPFlow.ruleName())); - - // test packet capture - PagedIterable packetCaptures = nw.packetCaptures().list(); - Assertions.assertEquals(0, TestUtilities.getSize(packetCaptures)); - PacketCapture packetCapture = - nw - .packetCaptures() - .define("NewPacketCapture") - .withTarget(virtualMachines[0].id()) - .withStorageAccountId(storageAccount.id()) - .withTimeLimitInSeconds(1500) - .definePacketCaptureFilter() - .withProtocol(PcProtocol.TCP) - .withLocalIpAddresses(Arrays.asList("127.0.0.1", "127.0.0.5")) - .attach() - .create(); - packetCaptures = nw.packetCaptures().list(); - Assertions.assertEquals(1, TestUtilities.getSize(packetCaptures)); - Assertions.assertEquals("NewPacketCapture", packetCapture.name()); - Assertions.assertEquals(1500, packetCapture.timeLimitInSeconds()); - Assertions.assertEquals(PcProtocol.TCP, packetCapture.filters().get(0).protocol()); - Assertions.assertEquals("127.0.0.1;127.0.0.5", packetCapture.filters().get(0).localIpAddress()); - // Assertions.assertEquals("Running", - // packetCapture.getStatus().packetCaptureStatus().toString()); - packetCapture.stop(); - Assertions.assertEquals(PcStatus.STOPPED, packetCapture.getStatus().packetCaptureStatus()); - nw.packetCaptures().deleteByName(packetCapture.name()); - - ConnectivityCheck connectivityCheck = - nw - .checkConnectivity() - .toDestinationResourceId(virtualMachines[1].id()) - .toDestinationPort(80) - .fromSourceVirtualMachine(virtualMachines[0].id()) - .execute(); - // Assertions.assertEquals("Reachable", connectivityCheck.connectionStatus().toString()); // - // not sure why it is Unknown now - - ConnectionMonitorQueryResult queryResult = connectionMonitor.query(); - - azureResourceManager.virtualMachines().deleteById(virtualMachines[1].id()); - topology.execute(); - // Assertions.assertEquals(10, topology.resources().size()); // not sure why it is 18 now - } finally { - if (nwrg != null) { - azureResourceManager.resourceGroups().beginDeleteByName(nwrg); - } - if (tnwrg != null) { - azureResourceManager.resourceGroups().beginDeleteByName(tnwrg); - } - } - } - - /** - * Tests the local network gateway implementation. - * - * @throws Exception - */ - @Test - public void testLocalNetworkGateways() throws Exception { - new TestLocalNetworkGateway().runTest(azureResourceManager.localNetworkGateways(), azureResourceManager.resourceGroups()); - } - - /** - * Tests the express route circuit implementation. - * - * @throws Exception - */ - @Test - @Disabled("Failed to provision ExpressRoute circuit as the service provider does not have sufficient capacity at this location.") - public void testExpressRouteCircuits() throws Exception { - new TestExpressRouteCircuit().new Basic().runTest(azureResourceManager.expressRouteCircuits(), azureResourceManager.resourceGroups()); - } - - /** - * Tests the express route circuit peerings implementation. - * - * @throws Exception - */ - @Test - @Disabled("Failed to provision ExpressRoute circuit as the service provider does not have sufficient capacity at this location.") - public void testExpressRouteCircuitPeering() throws Exception { - new TestExpressRouteCircuit().new ExpressRouteCircuitPeering() - .runTest(azureResourceManager.expressRouteCircuits(), azureResourceManager.resourceGroups()); - } - - /** - * Tests virtual machines. - * - * @throws Exception - */ - @Test - @Disabled("osDiskSize is returned as 127 instead of 128 - known service bug") - public void testVirtualMachines() throws Exception { - // Future: This method needs to have a better specific name since we are going to include unit test for - // different vm scenarios. - new TestVirtualMachine().runTest(azureResourceManager.virtualMachines(), azureResourceManager.resourceGroups()); - } - - /** - * Tests the virtual machine data disk implementation. - * - * @throws Exception - */ - @Test - public void testVirtualMachineDataDisk() throws Exception { - new TestVirtualMachineDataDisk().runTest(azureResourceManager.virtualMachines(), azureResourceManager.resourceGroups()); - } - - /** - * Tests the virtual machine network interface implementation. - * - * @throws Exception - */ - @Test - public void testVirtualMachineNics() throws Exception { - new TestVirtualMachineNics(azureResourceManager.networks().manager()).runTest(azureResourceManager.virtualMachines(), azureResourceManager.resourceGroups()); - } - - /** - * Tests virtual machine support for SSH. - * - * @throws Exception - */ - @Test - public void testVirtualMachineSSh() throws Exception { - new TestVirtualMachineSsh(azureResourceManager.publicIpAddresses()).runTest(azureResourceManager.virtualMachines(), azureResourceManager.resourceGroups()); - } - - /** - * Tests virtual machine sizes. - * - * @throws Exception - */ - @Test - public void testVirtualMachineSizes() throws Exception { - new TestVirtualMachineSizes().runTest(azureResourceManager.virtualMachines(), azureResourceManager.resourceGroups()); - } - - @Test - public void testVirtualMachineCustomData() throws Exception { - new TestVirtualMachineCustomData(azureResourceManager.publicIpAddresses()) - .runTest(azureResourceManager.virtualMachines(), azureResourceManager.resourceGroups()); - } - - @Test - public void testVirtualMachineInAvailabilitySet() throws Exception { - new TestVirtualMachineInAvailabilitySet().runTest(azureResourceManager.virtualMachines(), azureResourceManager.resourceGroups()); - } - - @Test - public void testVirtualMachineSyncPoller() throws Exception { - new TestVirtualMachineSyncPoller(azureResourceManager.networks().manager()) - .runTest(azureResourceManager.virtualMachines(), azureResourceManager.resourceGroups()); - } - - /** - * Tests subscription listing. - * - * @throws Exception - */ - @Test - public void listSubscriptions() throws Exception { - Assertions.assertTrue(0 < TestUtilities.getSize(azureResourceManager.subscriptions().list())); - Subscription subscription = azureResourceManager.getCurrentSubscription(); - Assertions.assertNotNull(subscription); - Assertions.assertTrue(azureResourceManager.subscriptionId().equalsIgnoreCase(subscription.subscriptionId())); - } - - /** - * Tests location listing. - * - * @throws Exception - */ - @Test - public void listLocations() throws Exception { - Subscription subscription = azureResourceManager.getCurrentSubscription(); - Assertions.assertNotNull(subscription); - for (Location location : subscription.listLocations()) { - Region region = Region.fromName(location.name()); - Assertions.assertNotNull(region, "Could not find region " + location.name()); - Assertions.assertEquals(region, location.region()); - Assertions.assertEquals(region.name().toLowerCase(), location.name().toLowerCase()); - } - - Location location = subscription.getLocationByRegion(locationOrDefault(Region.US_WEST)); - Assertions.assertNotNull(location); - Assertions.assertTrue(locationOrDefault(Region.US_WEST).name().equalsIgnoreCase(location.name())); - } - - /** - * Tests resource group listing. - * - * @throws Exception - */ - @Test - public void listResourceGroups() throws Exception { - int groupCount = TestUtilities.getSize(azureResourceManager.resourceGroups().list()); - System.out.println(String.format("Group count: %s", groupCount)); - Assertions.assertTrue(0 < groupCount); - } - - /** - * Tests storage account listing. - * - * @throws Exception - */ - @Test - public void listStorageAccounts() throws Exception { - Assertions.assertTrue(0 < TestUtilities.getSize(azureResourceManager.storageAccounts().list())); - } - - @Test - public void createStorageAccount() throws Exception { - String storageAccountName = generateRandomResourceName("testsa", 12); - StorageAccount storageAccount = - azureResourceManager - .storageAccounts() - .define(storageAccountName) - .withRegion(locationOrDefault(Region.ASIA_EAST)) - .withNewResourceGroup() - .withSku(StorageAccountSkuType.PREMIUM_LRS) - .create(); - - Assertions.assertEquals(storageAccount.name(), storageAccountName); - - azureResourceManager.resourceGroups().beginDeleteByName(storageAccount.resourceGroupName()); - } - - @Test - public void testDnsZones() throws Exception { - new TestDns().runTest(azureResourceManager.dnsZones(), azureResourceManager.resourceGroups()); - } - - @Test - public void testResourceStreaming() throws Exception { - new TestResourceStreaming(azureResourceManager.storageAccounts()).runTest(azureResourceManager.virtualMachines(), azureResourceManager.resourceGroups()); - } - - @Test - public void testKubernetesCluster() throws Exception { - new TestKubernetesCluster().runTest(azureResourceManager.kubernetesClusters(), azureResourceManager.resourceGroups()); - } - - @Test - public void testContainerRegistry() throws Exception { - new TestContainerRegistry().runTest(azureResourceManager.containerRegistries(), azureResourceManager.resourceGroups()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/KubernetesCniTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/KubernetesCniTests.java deleted file mode 100644 index d870062f3841..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/KubernetesCniTests.java +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager; - -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.policy.HttpLogOptions; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.management.Region; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.authorization.models.BuiltInRole; -import com.azure.resourcemanager.containerservice.models.AgentPoolMode; -import com.azure.resourcemanager.containerservice.models.AgentPoolType; -import com.azure.resourcemanager.containerservice.models.ContainerServiceVMSizeTypes; -import com.azure.resourcemanager.containerservice.models.KubernetesCluster; -import com.azure.resourcemanager.containerservice.models.LoadBalancerSku; -import com.azure.resourcemanager.containerservice.models.NetworkPlugin; -import com.azure.resourcemanager.network.models.Network; -import com.azure.resourcemanager.resources.fluentcore.utils.HttpPipelineProvider; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import com.azure.resourcemanager.test.ResourceManagerTestBase; -import com.azure.resourcemanager.test.utils.TestDelayProvider; -import com.azure.resourcemanager.test.utils.TestIdentifierProvider; -import org.junit.jupiter.api.Test; - -import java.time.temporal.ChronoUnit; -import java.util.List; - -public class KubernetesCniTests extends ResourceManagerTestBase { - - private AzureResourceManager azureResourceManager; - private String rgName; - - private final Region region = locationOrDefault(Region.US_EAST); - - @Override - protected HttpPipeline buildHttpPipeline( - TokenCredential credential, - AzureProfile profile, - HttpLogOptions httpLogOptions, - List policies, - HttpClient httpClient) { - return HttpPipelineProvider.buildHttpPipeline( - credential, - profile, - null, - httpLogOptions, - null, - new RetryPolicy("Retry-After", ChronoUnit.SECONDS), - policies, - httpClient); - } - - @Override - protected void initializeClients(HttpPipeline httpPipeline, AzureProfile profile) { - ResourceManagerUtils.InternalRuntimeContext.setDelayProvider(new TestDelayProvider(!isPlaybackMode())); - ResourceManagerUtils.InternalRuntimeContext internalContext = new ResourceManagerUtils.InternalRuntimeContext(); - internalContext.setIdentifierFunction(name -> new TestIdentifierProvider(testResourceNamer)); - azureResourceManager = buildManager(AzureResourceManager.class, httpPipeline, profile); - setInternalContext(internalContext, azureResourceManager); - - rgName = generateRandomResourceName("rg", 8); - } - - @Override - protected void cleanUpResources() { - try { - azureResourceManager.resourceGroups().beginDeleteByName(rgName); - } catch (Exception e) { - } - } - - @Test - public void testKubernetesClusterCni() { - final String vnetName = rgName + "vnet"; - final String subnetName = "default"; - final String aksName = generateRandomResourceName("aks", 15); - final String dnsPrefix = generateRandomResourceName("dns", 10); - final String agentPoolName = generateRandomResourceName("ap0", 10); - final String roleAssignmentName = generateRandomUuid(); - - Network vnet = azureResourceManager.networks().define(vnetName) - .withRegion(region) - .withNewResourceGroup(rgName) - .withAddressSpace("10.0.0.0/8") - .withSubnet(subnetName, "10.240.0.0/16") - .create(); - - KubernetesCluster kubernetesCluster = azureResourceManager.kubernetesClusters().define(aksName) - .withRegion(region) - .withExistingResourceGroup(rgName) - .withDefaultVersion() - .withRootUsername("testaks") - .withSshKey(sshPublicKey()) - .withSystemAssignedManagedServiceIdentity() - .defineAgentPool(agentPoolName) - .withVirtualMachineSize(ContainerServiceVMSizeTypes.STANDARD_D2_V2) - .withAgentPoolVirtualMachineCount(3) - .withAgentPoolType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) - .withAgentPoolMode(AgentPoolMode.SYSTEM) - .withMaxPodsCount(30) - .withAvailabilityZones(1, 2, 3) - .withVirtualNetwork(vnet.id(), subnetName) - .attach() - .withDnsPrefix("mp1" + dnsPrefix) - .defineNetworkProfile() - .withNetworkPlugin(NetworkPlugin.AZURE) - .withServiceCidr("10.0.0.0/16") - .withDnsServiceIP("10.0.0.10") - .withDockerBridgeCidr("172.17.0.1/16") - .withLoadBalancerSku(LoadBalancerSku.STANDARD) - .attach() - .create(); - - azureResourceManager.accessManagement().roleAssignments().define(roleAssignmentName) - .forObjectId(kubernetesCluster.systemAssignedManagedServiceIdentityPrincipalId()) - .withBuiltInRole(BuiltInRole.NETWORK_CONTRIBUTOR) - .withScope(vnet.subnets().get(subnetName).id()) - .create(); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/ManagerLiveTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/ManagerLiveTests.java deleted file mode 100644 index 1b035a8eb9a3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/ManagerLiveTests.java +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager; - -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.policy.HttpLogOptions; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.annotation.DoNotRecord; -import com.azure.resourcemanager.appservice.AppServiceManager; -import com.azure.resourcemanager.authorization.AuthorizationManager; -import com.azure.resourcemanager.compute.ComputeManager; -import com.azure.resourcemanager.containerregistry.ContainerRegistryManager; -import com.azure.resourcemanager.containerservice.ContainerServiceManager; -import com.azure.resourcemanager.dns.DnsZoneManager; -import com.azure.resourcemanager.eventhubs.EventHubsManager; -import com.azure.resourcemanager.keyvault.KeyVaultManager; -import com.azure.resourcemanager.msi.MsiManager; -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.resources.ResourceManager; -import com.azure.resourcemanager.resources.fluentcore.utils.HttpPipelineProvider; -import com.azure.resourcemanager.storage.StorageManager; -import com.azure.resourcemanager.test.ResourceManagerTestBase; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -import java.time.temporal.ChronoUnit; -import java.util.List; - -public class ManagerLiveTests extends ResourceManagerTestBase { - - private HttpPipeline httpPipeline; - - @Override - protected HttpPipeline buildHttpPipeline( - TokenCredential credential, - AzureProfile profile, - HttpLogOptions httpLogOptions, - List policies, - HttpClient httpClient) { - return HttpPipelineProvider.buildHttpPipeline( - credential, - profile, - null, - httpLogOptions, - null, - new RetryPolicy("Retry-After", ChronoUnit.SECONDS), - policies, - httpClient); - } - - @Override - protected void initializeClients(HttpPipeline httpPipeline, AzureProfile profile) { - this.httpPipeline = httpPipeline; - } - - @Override - protected void cleanUpResources() { - - } - - @Test - @DoNotRecord(skipInPlayback = true) - public void testAuthentication() { - AppServiceManager.authenticate(httpPipeline, profile()).appServicePlans().list().stream().count(); - AuthorizationManager.authenticate(httpPipeline, profile()).roleDefinitions().listByScope("/subscriptions/" + profile().getSubscriptionId()).stream().count(); - ComputeManager.authenticate(httpPipeline, profile()).disks().list().stream().count(); - ContainerRegistryManager.authenticate(httpPipeline, profile()).containerRegistries().list().stream().count(); - ContainerServiceManager.authenticate(httpPipeline, profile()).kubernetesClusters().list().stream().count(); - DnsZoneManager.authenticate(httpPipeline, profile()).zones().list().stream().count(); - EventHubsManager.authenticate(httpPipeline, profile()).namespaces().list().stream().count(); - KeyVaultManager.authenticate(httpPipeline, profile()).vaults().listDeleted(); - //MonitorManager.authenticate(httpPipeline, profile()).metricDefinitions().listByResource(); - MsiManager.authenticate(httpPipeline, profile()).identities().list().stream().count(); - NetworkManager.authenticate(httpPipeline, profile()).networks().list().stream().count(); - ResourceManager.authenticate(httpPipeline, profile()).subscriptions().list().stream().count(); - ResourceManager.authenticate(httpPipeline, profile()).withDefaultSubscription().resourceGroups().list().stream().count(); - StorageManager.authenticate(httpPipeline, profile()).storageAccounts().list().stream().count(); - - Assertions.assertNotNull(AzureResourceManager.authenticate(httpPipeline, profile()).withDefaultSubscription() - .genericResources().manager().httpPipeline()); - } -} - diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestApplicationGateway.java b/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestApplicationGateway.java deleted file mode 100644 index 7670b479be9b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestApplicationGateway.java +++ /dev/null @@ -1,1660 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager; - -import com.azure.resourcemanager.network.models.ApplicationGateway; -import com.azure.resourcemanager.network.models.ApplicationGatewayAuthenticationCertificate; -import com.azure.resourcemanager.network.models.ApplicationGatewayBackend; -import com.azure.resourcemanager.network.models.ApplicationGatewayBackendAddress; -import com.azure.resourcemanager.network.models.ApplicationGatewayBackendHttpConfiguration; -import com.azure.resourcemanager.network.models.ApplicationGatewayFrontend; -import com.azure.resourcemanager.network.models.ApplicationGatewayIpConfiguration; -import com.azure.resourcemanager.network.models.ApplicationGatewayListener; -import com.azure.resourcemanager.network.models.ApplicationGatewayProbe; -import com.azure.resourcemanager.network.models.ApplicationGatewayProtocol; -import com.azure.resourcemanager.network.models.ApplicationGatewayRedirectConfiguration; -import com.azure.resourcemanager.network.models.ApplicationGatewayRedirectType; -import com.azure.resourcemanager.network.models.ApplicationGatewayRequestRoutingRule; -import com.azure.resourcemanager.network.models.ApplicationGatewaySkuName; -import com.azure.resourcemanager.network.models.ApplicationGatewaySslCertificate; -import com.azure.resourcemanager.network.models.ApplicationGatewaySslProtocol; -import com.azure.resourcemanager.network.models.ApplicationGatewayTier; -import com.azure.resourcemanager.network.models.ApplicationGatewayUrlPathMap; -import com.azure.resourcemanager.network.models.ApplicationGateways; -import com.azure.resourcemanager.network.models.Network; -import com.azure.resourcemanager.network.models.PublicIpAddress; -import com.azure.resourcemanager.network.models.PublicIpAddresses; -import com.azure.core.management.Region; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import com.azure.resourcemanager.test.ResourceManagerTestBase; -import org.junit.jupiter.api.Assertions; - -import java.io.File; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import java.util.Map; - -/** Test of application gateway management. */ -public class TestApplicationGateway { - String testId = ""; - static final Region REGION = ResourceManagerTestBase.locationOrDefault(Region.US_WEST); - String groupName = ""; - String appGatewayName = ""; - String[] pipNames = null; - static final String ID_TEMPLATE = - "/subscriptions/${subId}/resourceGroups/${rgName}/providers/Microsoft.Network/applicationGateways/${resourceName}"; - - String createResourceId(String subscriptionId) { - return ID_TEMPLATE - .replace("${subId}", subscriptionId) - .replace("${rgName}", groupName) - .replace("${resourceName}", appGatewayName); - } - - void initializeResourceNames(ResourceManagerUtils.InternalRuntimeContext internalContext) { - testId = internalContext.randomResourceName("", 8); - groupName = "rg" + testId; - appGatewayName = "ag" + testId; - pipNames = new String[] {"pipa" + testId, "pipb" + testId}; - } - - /** Minimalistic internal (private) app gateway test. */ - public class PrivateMinimal extends TestTemplate { - PrivateMinimal(ResourceManagerUtils.InternalRuntimeContext internalContext) { - initializeResourceNames(internalContext); - } - - @Override - public void print(ApplicationGateway resource) { - printAppGateway(resource); - } - - @Override - public ApplicationGateway createResource(final ApplicationGateways resources) throws Exception { - // Prepare a separate thread for resource creation - Thread creationThread = - new Thread( - new Runnable() { - @Override - public void run() { - // Create an application gateway - resources - .define(appGatewayName) - .withRegion(REGION) - .withNewResourceGroup(groupName) - - // Request routing rules - .defineRequestRoutingRule("rule1") - .fromPrivateFrontend() - .fromFrontendHttpPort(80) - .toBackendHttpPort(8080) - .toBackendIPAddress("11.1.1.1") - .toBackendIPAddress("11.1.1.2") - .attach() - .create(); - } - }); - - // Start the creation... - creationThread.start(); - - creationThread.join(); - - // Get the resource as created so far - String resourceId = createResourceId(resources.manager().subscriptionId()); - ApplicationGateway appGateway = resources.manager().applicationGateways().getById(resourceId); - Assertions.assertTrue(appGateway != null); - Assertions.assertTrue(ApplicationGatewayTier.STANDARD.equals(appGateway.tier())); - Assertions.assertTrue(ApplicationGatewaySkuName.STANDARD_SMALL.equals(appGateway.size())); - Assertions.assertTrue(appGateway.instanceCount() == 1); - - // Verify frontend ports - Assertions.assertTrue(appGateway.frontendPorts().size() == 1); - Assertions.assertTrue(appGateway.frontendPortNameFromNumber(80) != null); - - // Verify frontends - Assertions.assertTrue(appGateway.isPrivate()); - Assertions.assertTrue(!appGateway.isPublic()); - Assertions.assertTrue(appGateway.frontends().size() == 1); - - // Verify listeners - Assertions.assertTrue(appGateway.listeners().size() == 1); - Assertions.assertTrue(appGateway.listenerByPortNumber(80) != null); - - // Verify backends - Assertions.assertTrue(appGateway.backends().size() == 1); - - // Verify backend HTTP configs - Assertions.assertTrue(appGateway.backendHttpConfigurations().size() == 1); - - // Verify rules - Assertions.assertTrue(appGateway.requestRoutingRules().size() == 1); - ApplicationGatewayRequestRoutingRule rule = appGateway.requestRoutingRules().get("rule1"); - Assertions.assertTrue(rule != null); - Assertions.assertTrue(rule.frontendPort() == 80); - Assertions.assertTrue(ApplicationGatewayProtocol.HTTP.equals(rule.frontendProtocol())); - Assertions.assertTrue(rule.listener() != null); - Assertions.assertTrue(rule.listener().frontend() != null); - Assertions.assertTrue(!rule.listener().frontend().isPublic()); - Assertions.assertTrue(rule.listener().frontend().isPrivate()); - Assertions.assertTrue(rule.listener().subnetName() != null); - Assertions.assertTrue(rule.listener().networkId() != null); - Assertions.assertTrue(rule.backendAddresses().size() == 2); - Assertions.assertTrue(rule.backend() != null); - Assertions.assertTrue(rule.backend().containsIPAddress("11.1.1.1")); - Assertions.assertTrue(rule.backend().containsIPAddress("11.1.1.2")); - Assertions.assertTrue(rule.backendPort() == 8080); - - return appGateway; - } - - @Override - public ApplicationGateway updateResource(final ApplicationGateway resource) throws Exception { - resource - .update() - .withInstanceCount(2) - .withSize(ApplicationGatewaySkuName.STANDARD_MEDIUM) - .withFrontendPort(81, "port81") // Add a new port - .withoutBackendIPAddress("11.1.1.1") // Remove from all existing backends - .defineListener("listener2") - .withPrivateFrontend() - .withFrontendPort(81) - .withHttps() - .withSslCertificateFromPfxFile( - new File(getClass().getClassLoader().getResource("myTest.pfx").getFile())) - .withSslCertificatePassword("Abc123") - .attach() - .defineBackend("backend2") - .withIPAddress("11.1.1.3") - .attach() - .defineBackendHttpConfiguration("config2") - .withCookieBasedAffinity() - .withPort(8081) - .withRequestTimeout(33) - .attach() - .defineRequestRoutingRule("rule2") - .fromListener("listener2") - .toBackendHttpConfiguration("config2") - .toBackend("backend2") - .attach() - .withTag("tag1", "value1") - .withTag("tag2", "value2") - .apply(); - - resource.refresh(); - - Assertions.assertTrue(resource.tags().containsKey("tag1")); - Assertions.assertTrue(resource.tags().containsKey("tag2")); - Assertions.assertTrue(ApplicationGatewaySkuName.STANDARD_MEDIUM.equals(resource.size())); - Assertions.assertTrue(resource.instanceCount() == 2); - - // Verify frontend ports - Assertions.assertTrue(resource.frontendPorts().size() == 2); - Assertions.assertTrue(resource.frontendPorts().containsKey("port81")); - Assertions.assertTrue("port81".equalsIgnoreCase(resource.frontendPortNameFromNumber(81))); - - // Verify listeners - Assertions.assertTrue(resource.listeners().size() == 2); - ApplicationGatewayListener listener = resource.listeners().get("listener2"); - Assertions.assertTrue(listener != null); - Assertions.assertTrue(listener.frontend().isPrivate()); - Assertions.assertTrue(!listener.frontend().isPublic()); - Assertions.assertTrue("port81".equalsIgnoreCase(listener.frontendPortName())); - Assertions.assertTrue(ApplicationGatewayProtocol.HTTPS.equals(listener.protocol())); - Assertions.assertTrue(listener.sslCertificate() != null); - - // Verify backends - Assertions.assertTrue(resource.backends().size() == 2); - ApplicationGatewayBackend backend = resource.backends().get("backend2"); - Assertions.assertTrue(backend != null); - Assertions.assertTrue(backend.addresses().size() == 1); - Assertions.assertTrue(backend.containsIPAddress("11.1.1.3")); - - // Verify HTTP configs - Assertions.assertTrue(resource.backendHttpConfigurations().size() == 2); - ApplicationGatewayBackendHttpConfiguration config = resource.backendHttpConfigurations().get("config2"); - Assertions.assertTrue(config != null); - Assertions.assertTrue(config.cookieBasedAffinity()); - Assertions.assertTrue(config.port() == 8081); - Assertions.assertTrue(config.requestTimeout() == 33); - - // Verify request routing rules - Assertions.assertTrue(resource.requestRoutingRules().size() == 2); - ApplicationGatewayRequestRoutingRule rule = resource.requestRoutingRules().get("rule2"); - Assertions.assertTrue(rule != null); - Assertions.assertTrue(rule.listener() != null); - Assertions.assertTrue("listener2".equals(rule.listener().name())); - Assertions.assertTrue(rule.backendHttpConfiguration() != null); - Assertions.assertTrue("config2".equalsIgnoreCase(rule.backendHttpConfiguration().name())); - Assertions.assertTrue(rule.backend() != null); - Assertions.assertTrue("backend2".equalsIgnoreCase(rule.backend().name())); - - resource.updateTags().withTag("tag3", "value3").withoutTag("tag1").applyTags(); - Assertions.assertEquals("value3", resource.tags().get("tag3")); - Assertions.assertFalse(resource.tags().containsKey("tag1")); - return resource; - } - } - - /** Minimalistic internal (private) app gateway test. */ - public class UrlPathBased extends TestTemplate { - UrlPathBased(ResourceManagerUtils.InternalRuntimeContext internalContext) { - initializeResourceNames(internalContext); - } - - @Override - public void print(ApplicationGateway resource) { - printAppGateway(resource); - } - - @Override - public ApplicationGateway createResource(final ApplicationGateways resources) throws Exception { - // Prepare a separate thread for resource creation - Thread creationThread = - new Thread( - new Runnable() { - @Override - public void run() { - // Create an application gateway - resources - .define(appGatewayName) - .withRegion(REGION) - .withNewResourceGroup(groupName) - .definePathBasedRoutingRule("pathMap") - .fromListener("myListener") - .toBackendHttpConfiguration("config1") - .toBackend("backendPool") - .definePathRule("pathRule") - .toBackendHttpConfiguration("config1") - .toBackend("backendPool") - .withPath("/images/*") - .attach() - .attach() - .defineListener("myListener") - .withPublicFrontend() - .withFrontendPort(80) - .attach() - .defineBackend("backendPool") - .attach() - .defineBackendHttpConfiguration("config1") - .withCookieBasedAffinity() - .withPort(8081) - .withRequestTimeout(33) - .attach() - .create(); - } - }); - - // Start the creation... - creationThread.start(); - - // ...But bail out after 30 sec, as it is enough to test the results - creationThread.join(); - - // Get the resource as created so far - String resourceId = createResourceId(resources.manager().subscriptionId()); - ApplicationGateway appGateway = resources.manager().applicationGateways().getById(resourceId); - Assertions.assertNotNull(appGateway); - Assertions.assertEquals(ApplicationGatewayTier.STANDARD, appGateway.tier()); - Assertions.assertEquals(ApplicationGatewaySkuName.STANDARD_SMALL, appGateway.size()); - Assertions.assertEquals(1, appGateway.instanceCount()); - - // Verify frontend ports - Assertions.assertEquals(1, appGateway.frontendPorts().size()); - Assertions.assertNotNull(appGateway.frontendPortNameFromNumber(80)); - - // Verify frontends - Assertions.assertTrue(appGateway.isPublic()); - Assertions.assertEquals(1, appGateway.frontends().size()); - - // Verify listeners - Assertions.assertEquals(1, appGateway.listeners().size()); - Assertions.assertNotNull(appGateway.listenerByPortNumber(80)); - - // Verify backends - Assertions.assertEquals(1, appGateway.backends().size()); - - // Verify backend HTTP configs - Assertions.assertEquals(1, appGateway.backendHttpConfigurations().size()); - - // Verify rules - Assertions.assertEquals(1, appGateway.requestRoutingRules().size()); - ApplicationGatewayRequestRoutingRule rule = appGateway.requestRoutingRules().get("pathMap"); - Assertions.assertNotNull(rule); - Assertions.assertEquals(80, rule.frontendPort()); - Assertions.assertEquals(ApplicationGatewayProtocol.HTTP, rule.frontendProtocol()); - Assertions.assertNotNull(rule.listener()); - Assertions.assertNotNull(rule.listener().frontend()); - Assertions.assertTrue(rule.listener().frontend().isPublic()); - Assertions.assertTrue(!rule.listener().frontend().isPrivate()); - return appGateway; - } - - @Override - public ApplicationGateway updateResource(final ApplicationGateway resource) throws Exception { - resource - .update() - .withoutUrlPathMap("pathMap") - // Request routing rules - .definePathBasedRoutingRule("rule2") - .fromListener("myListener") - .toBackendHttpPort(8080) - .toBackendIPAddress("11.1.1.1") - .toBackendIPAddress("11.1.1.2") - .definePathRule("newRule") - .toBackendHttpConfiguration("config1") - .toBackend("backendPool") - .withPath("/pictures/*") - .attach() - .definePathRule("newRule2") - .toBackendHttpConfiguration("config1") - .toBackend("backendPool2") - .withPath("/video/*") - .attach() - .attach() - .defineBackend("backendPool2") - .attach() - .apply(); - resource.refresh(); - ApplicationGatewayRequestRoutingRule rule = resource.requestRoutingRules().get("rule2"); - Assertions.assertNotNull(rule); - Assertions.assertEquals(0, rule.backendAddresses().size()); - ApplicationGatewayUrlPathMap pathMap = resource.urlPathMaps().get("rule2"); - Assertions.assertNotNull(pathMap.defaultBackend()); - Assertions.assertEquals(2, pathMap.defaultBackend().addresses().size()); - Assertions.assertTrue(pathMap.defaultBackend().containsIPAddress("11.1.1.1")); - Assertions.assertTrue(pathMap.defaultBackend().containsIPAddress("11.1.1.2")); - Assertions.assertEquals(8080, pathMap.defaultBackendHttpConfiguration().port()); - Assertions.assertEquals(1, resource.urlPathMaps().size()); - Assertions.assertFalse(resource.requestRoutingRules().containsKey("pathMap")); - Assertions.assertTrue(resource.requestRoutingRules().containsKey("rule2")); - Assertions.assertEquals(2, pathMap.pathRules().size()); - Assertions.assertEquals("/pictures/*", pathMap.pathRules().get("newRule").paths().get(0)); - return resource; - } - } - - /** Complex internal (private) app gateway test. */ - public class PrivateComplex extends TestTemplate { - - /** - * Tests minimal internal app gateways. - * - * @throws Exception when something goes wrong - */ - public PrivateComplex(ResourceManagerUtils.InternalRuntimeContext internalContext) throws Exception { - initializeResourceNames(internalContext); - } - - @Override - public void print(ApplicationGateway resource) { - printAppGateway(resource); - } - - @Override - public ApplicationGateway createResource(final ApplicationGateways resources) throws Exception { - ensurePIPs(resources.manager().publicIpAddresses()); - - final Network vnet = - resources - .manager() - .networks() - .define("net" + testId) - .withRegion(REGION) - .withNewResourceGroup(groupName) - .withAddressSpace("10.0.0.0/28") - .withSubnet("subnet1", "10.0.0.0/29") - .withSubnet("subnet2", "10.0.0.8/29") - .create(); - - Thread.UncaughtExceptionHandler threadException = - new Thread.UncaughtExceptionHandler() { - public void uncaughtException(Thread th, Throwable ex) { - System.out.println("Uncaught exception: " + ex); - } - }; - - // Prepare for execution in a separate thread to shorten the test - Thread creationThread = - new Thread( - new Runnable() { - @Override - public void run() { - // Create an application gateway - try { - resources - .define(appGatewayName) - .withRegion(REGION) - .withExistingResourceGroup(groupName) - - // Request routing rules - .defineRequestRoutingRule("rule80") - .fromPrivateFrontend() - .fromFrontendHttpPort(80) - .toBackendHttpPort(8080) - .toBackendIPAddress("11.1.1.1") - .toBackendIPAddress("11.1.1.2") - .withCookieBasedAffinity() - .attach() - .defineRequestRoutingRule("rule443") - .fromPrivateFrontend() - .fromFrontendHttpsPort(443) - .withSslCertificateFromPfxFile( - new File(getClass().getClassLoader().getResource("myTest.pfx").getFile())) - .withSslCertificatePassword("Abc123") - .toBackendHttpConfiguration("config1") - .toBackend("backend1") - .attach() - .defineRequestRoutingRule("rule9000") - .fromListener("listener1") - .toBackendHttpConfiguration("config1") - .toBackend("backend1") - .attach() - .defineRequestRoutingRule("ruleRedirect") - .fromPrivateFrontend() - .fromFrontendHttpsPort(444) - .withSslCertificate("cert1") - .withRedirectConfiguration("redirect1") - .attach() - - // Additional/explicit backends - .defineBackend("backend1") - .withIPAddress("11.1.1.3") - .withIPAddress("11.1.1.4") - .attach() - .defineBackend("backend2") - .attach() - - // Additional/explicit frontend listeners - .defineListener("listener1") - .withPrivateFrontend() - .withFrontendPort(9000) - .withHttp() - .attach() - - // Additional/explicit certificates - .defineSslCertificate("cert1") - .withPfxFromFile( - new File(getClass().getClassLoader().getResource("myTest2.pfx").getFile())) - .withPfxPassword("Abc123") - .attach() - - // Authentication certificates - .defineAuthenticationCertificate("auth2") - .fromFile( - new File(getClass().getClassLoader().getResource("myTest2.cer").getFile())) - .attach() - - // Additional/explicit backend HTTP setting configs - .defineBackendHttpConfiguration("config1") - .withPort(8081) - .withRequestTimeout(45) - .withHttps() - .withAuthenticationCertificateFromFile( - new File(getClass().getClassLoader().getResource("myTest.cer").getFile())) - .attach() - .defineBackendHttpConfiguration("config2") - .withPort(8082) - .withHttps() - .withAuthenticationCertificate("auth2") - // Add the same cert, so only one should be added - .withAuthenticationCertificateFromFile( - new File(getClass().getClassLoader().getResource("myTest2.cer").getFile())) - .attach() - - // Redirect configurations - .defineRedirectConfiguration("redirect1") - .withType(ApplicationGatewayRedirectType.PERMANENT) - .withTargetListener("listener1") - .withPathIncluded() - .attach() - .defineRedirectConfiguration("redirect2") - .withType(ApplicationGatewayRedirectType.TEMPORARY) - .withTargetUrl("http://www.microsoft.com") - .withQueryStringIncluded() - .attach() - .withExistingSubnet(vnet, "subnet1") - .withSize(ApplicationGatewaySkuName.STANDARD_MEDIUM) - .withInstanceCount(2) - .create(); - } catch (IOException e) { - e.printStackTrace(); - } - } - }); - - // Start creating in a separate thread... - creationThread.setUncaughtExceptionHandler(threadException); - creationThread.start(); - - creationThread.join(); - - // Get the resource as created so far - String resourceId = createResourceId(resources.manager().subscriptionId()); - ApplicationGateway appGateway = resources.getById(resourceId); - Assertions.assertNotNull(appGateway); - Assertions.assertEquals(ApplicationGatewayTier.STANDARD, appGateway.tier()); - Assertions.assertEquals(ApplicationGatewaySkuName.STANDARD_MEDIUM, appGateway.size()); - Assertions.assertEquals(2, appGateway.instanceCount()); - Assertions.assertFalse(appGateway.isPublic()); - Assertions.assertTrue(appGateway.isPrivate()); - Assertions.assertEquals(1, appGateway.ipConfigurations().size()); - - // Verify redirect configurations - Assertions.assertEquals(2, appGateway.redirectConfigurations().size()); - ApplicationGatewayRedirectConfiguration redirect = appGateway.redirectConfigurations().get("redirect1"); - Assertions.assertNotNull(redirect); - Assertions.assertEquals(ApplicationGatewayRedirectType.PERMANENT, redirect.type()); - Assertions.assertNotNull(redirect.targetListener()); - Assertions.assertEquals("listener1", redirect.targetListener().name()); - Assertions.assertNull(redirect.targetUrl()); - Assertions.assertTrue(redirect.isPathIncluded()); - Assertions.assertFalse(redirect.isQueryStringIncluded()); - Assertions.assertEquals(1, redirect.requestRoutingRules().size()); - - redirect = appGateway.redirectConfigurations().get("redirect2"); - Assertions.assertNotNull(redirect); - Assertions.assertEquals(ApplicationGatewayRedirectType.TEMPORARY, redirect.type()); - Assertions.assertNull(redirect.targetListener()); - Assertions.assertNotNull(redirect.targetUrl()); - Assertions.assertEquals("http://www.microsoft.com", redirect.targetUrl()); - Assertions.assertTrue(redirect.isQueryStringIncluded()); - Assertions.assertFalse(redirect.isPathIncluded()); - - // Verify frontend ports - Assertions.assertEquals(4, appGateway.frontendPorts().size()); - Assertions.assertNotNull(appGateway.frontendPortNameFromNumber(80)); - Assertions.assertNotNull(appGateway.frontendPortNameFromNumber(443)); - Assertions.assertNotNull(appGateway.frontendPortNameFromNumber(9000)); - Assertions.assertNotNull(appGateway.frontendPortNameFromNumber(444)); - - // Verify frontends - Assertions.assertEquals(1, appGateway.frontends().size()); - Assertions.assertTrue(appGateway.publicFrontends().isEmpty()); - Assertions.assertEquals(1, appGateway.privateFrontends().size()); - ApplicationGatewayFrontend frontend = appGateway.privateFrontends().values().iterator().next(); - Assertions.assertFalse(frontend.isPublic()); - Assertions.assertTrue(frontend.isPrivate()); - - // Verify listeners - Assertions.assertEquals(4, appGateway.listeners().size()); - ApplicationGatewayListener listener = appGateway.listeners().get("listener1"); - Assertions.assertNotNull(listener); - Assertions.assertEquals(9000, listener.frontendPortNumber()); - Assertions.assertEquals(ApplicationGatewayProtocol.HTTP, listener.protocol()); - Assertions.assertNotNull(listener.frontend()); - Assertions.assertTrue(listener.frontend().isPrivate()); - Assertions.assertFalse(listener.frontend().isPublic()); - Assertions.assertNotNull(appGateway.listenerByPortNumber(80)); - Assertions.assertNotNull(appGateway.listenerByPortNumber(443)); - Assertions.assertNotNull(appGateway.listenerByPortNumber(444)); - - // Verify SSL certificates - Assertions.assertEquals(2, appGateway.sslCertificates().size()); - Assertions.assertTrue(appGateway.sslCertificates().containsKey("cert1")); - - // Verify backend HTTP settings configs - Assertions.assertEquals(3, appGateway.backendHttpConfigurations().size()); - ApplicationGatewayBackendHttpConfiguration config = appGateway.backendHttpConfigurations().get("config1"); - Assertions.assertNotNull(config); - Assertions.assertEquals(8081, config.port()); - Assertions.assertEquals(45, config.requestTimeout()); - Assertions.assertEquals(1, config.authenticationCertificates().size()); - - ApplicationGatewayBackendHttpConfiguration config2 = appGateway.backendHttpConfigurations().get("config2"); - Assertions.assertNotNull(config2); - - // Verify authentication certificates - Assertions.assertEquals(2, appGateway.authenticationCertificates().size()); - ApplicationGatewayAuthenticationCertificate authCert2 = - appGateway.authenticationCertificates().get("auth2"); - Assertions.assertNotNull(authCert2); - Assertions.assertNotNull(authCert2.data()); - - ApplicationGatewayAuthenticationCertificate authCert = - config.authenticationCertificates().values().iterator().next(); - Assertions.assertNotNull(authCert); - - Assertions.assertEquals(1, config2.authenticationCertificates().size()); - Assertions - .assertEquals(authCert2.name(), config2.authenticationCertificates().values().iterator().next().name()); - - // Verify backends - Assertions.assertEquals(3, appGateway.backends().size()); - ApplicationGatewayBackend backend = appGateway.backends().get("backend1"); - Assertions.assertNotNull(backend); - Assertions.assertEquals(2, backend.addresses().size()); - Assertions.assertTrue(backend.containsIPAddress("11.1.1.3")); - Assertions.assertTrue(backend.containsIPAddress("11.1.1.4")); - Assertions.assertTrue(appGateway.backends().containsKey("backend2")); - - // Verify request routing rules - Assertions.assertEquals(4, appGateway.requestRoutingRules().size()); - ApplicationGatewayRequestRoutingRule rule; - - rule = appGateway.requestRoutingRules().get("rule80"); - Assertions.assertNotNull(rule); - Assertions.assertTrue(vnet.id().equalsIgnoreCase(rule.listener().frontend().networkId())); - Assertions.assertEquals(80, rule.frontendPort()); - Assertions.assertEquals(8080, rule.backendPort()); - Assertions.assertTrue(rule.cookieBasedAffinity()); - Assertions.assertEquals(2, rule.backendAddresses().size()); - Assertions.assertTrue(rule.backend().containsIPAddress("11.1.1.1")); - Assertions.assertTrue(rule.backend().containsIPAddress("11.1.1.2")); - - rule = appGateway.requestRoutingRules().get("rule443"); - Assertions.assertNotNull(rule); - Assertions.assertTrue(vnet.id().equalsIgnoreCase(rule.listener().frontend().networkId())); - Assertions.assertEquals(443, rule.frontendPort()); - Assertions.assertEquals(ApplicationGatewayProtocol.HTTPS, rule.frontendProtocol()); - Assertions.assertNotNull(rule.sslCertificate()); - Assertions.assertNotNull(rule.backendHttpConfiguration()); - Assertions.assertTrue(rule.backendHttpConfiguration().name().equalsIgnoreCase("config1")); - Assertions.assertNotNull(rule.backend()); - Assertions.assertTrue(rule.backend().name().equalsIgnoreCase("backend1")); - - rule = appGateway.requestRoutingRules().get("rule9000"); - Assertions.assertNotNull(rule); - Assertions.assertNotNull(rule.listener()); - Assertions.assertTrue(rule.listener().name().equalsIgnoreCase("listener1")); - Assertions.assertNotNull(rule.listener().subnetName()); - Assertions.assertNotNull(rule.listener().networkId()); - Assertions.assertNotNull(rule.backendHttpConfiguration()); - Assertions.assertTrue(rule.backendHttpConfiguration().name().equalsIgnoreCase("config1")); - Assertions.assertNotNull(rule.backend()); - Assertions.assertTrue(rule.backend().name().equalsIgnoreCase("backend1")); - - rule = appGateway.requestRoutingRules().get("ruleRedirect"); - Assertions.assertNotNull(rule); - Assertions.assertNotNull(rule.redirectConfiguration()); - Assertions.assertEquals("redirect1", rule.redirectConfiguration().name()); - - return appGateway; - } - - @Override - public ApplicationGateway updateResource(final ApplicationGateway resource) throws Exception { - final int portCount = resource.frontendPorts().size(); - final int frontendCount = resource.frontends().size(); - final int listenerCount = resource.listeners().size(); - final int ruleCount = resource.requestRoutingRules().size(); - final int backendCount = resource.backends().size(); - final int configCount = resource.backendHttpConfigurations().size(); - final int sslCertCount = resource.sslCertificates().size(); - final int authCertCount = resource.authenticationCertificates().size(); - final ApplicationGatewayAuthenticationCertificate authCert1 = - resource - .backendHttpConfigurations() - .get("config1") - .authenticationCertificates() - .values() - .iterator() - .next(); - Assertions.assertNotNull(authCert1); - - PublicIpAddress pip = resource.manager().publicIpAddresses().getByResourceGroup(groupName, pipNames[0]); - ApplicationGatewayListener listener443 = resource.requestRoutingRules().get("rule443").listener(); - Assertions.assertNotNull(listener443); - ApplicationGatewayListener listenerRedirect = resource.requestRoutingRules().get("ruleRedirect").listener(); - Assertions.assertNotNull(listenerRedirect); - - resource - .update() - .withSize(ApplicationGatewaySkuName.STANDARD_SMALL) - .withInstanceCount(1) - .withoutFrontendPort(9000) - .withoutListener("listener1") - .withoutBackendIPAddress("11.1.1.4") - .withoutBackendHttpConfiguration("config2") - .withoutBackend("backend2") - .withoutRequestRoutingRule("rule9000") - .withoutSslCertificate("cert1") - .withoutAuthenticationCertificate(authCert1.name()) - .updateListener(listener443.name()) - .withHostname("foobar") - .parent() - .updateListener(listenerRedirect.name()) - .withHttp() - .parent() - .updateBackendHttpConfiguration("config1") - .withPort(8082) - .withCookieBasedAffinity() - .withRequestTimeout(20) - .withAuthenticationCertificate("auth2") - .parent() - .updateBackend("backend1") - .withoutIPAddress("11.1.1.3") - .withIPAddress("11.1.1.5") - .parent() - .updateRequestRoutingRule("rule80") - .toBackend("backend1") - .toBackendHttpConfiguration("config1") - .parent() - .updateRequestRoutingRule("rule443") - .withoutRedirectConfiguration() - .parent() - .updateRedirectConfiguration("redirect1") - .withTargetUrl("http://azure.com") - .withType(ApplicationGatewayRedirectType.FOUND) - .withQueryStringIncluded() - .withoutPathIncluded() - .parent() - .withoutRedirectConfiguration("redirect2") - .withExistingPublicIpAddress(pip) // Associate with a public IP as well - .withTag("tag1", "value1") - .withTag("tag2", "value2") - .apply(); - - resource.refresh(); - - // Get the resource created so far - Assertions.assertTrue(resource.tags().containsKey("tag1")); - Assertions.assertTrue(resource.tags().containsKey("tag2")); - Assertions.assertEquals(ApplicationGatewaySkuName.STANDARD_SMALL, resource.size()); - Assertions.assertEquals(1, resource.instanceCount()); - - // Verify redirect configurations - Assertions.assertEquals(1, resource.redirectConfigurations().size()); - ApplicationGatewayRedirectConfiguration redirect = resource.redirectConfigurations().get("redirect1"); - Assertions.assertNotNull(redirect); - Assertions.assertEquals(ApplicationGatewayRedirectType.FOUND, redirect.type()); - Assertions.assertNull(redirect.targetListener()); - Assertions.assertNotNull(redirect.targetUrl()); - Assertions.assertEquals("http://azure.com", redirect.targetUrl()); - - // Verify frontend ports - Assertions.assertEquals(portCount - 1, resource.frontendPorts().size()); - Assertions.assertNull(resource.frontendPortNameFromNumber(9000)); - - // Verify frontends - Assertions.assertEquals(frontendCount + 1, resource.frontends().size()); - Assertions.assertEquals(1, resource.publicFrontends().size()); - Assertions - .assertTrue( - resource - .publicFrontends() - .values() - .iterator() - .next() - .publicIpAddressId() - .equalsIgnoreCase(pip.id())); - Assertions.assertEquals(1, resource.privateFrontends().size()); - ApplicationGatewayFrontend frontend = resource.privateFrontends().values().iterator().next(); - Assertions.assertFalse(frontend.isPublic()); - Assertions.assertTrue(frontend.isPrivate()); - - // Verify listeners - Assertions.assertEquals(listenerCount - 1, resource.listeners().size()); - Assertions.assertFalse(resource.listeners().containsKey("listener1")); - - // Verify backends - Assertions.assertEquals(backendCount - 1, resource.backends().size()); - Assertions.assertFalse(resource.backends().containsKey("backend2")); - ApplicationGatewayBackend backend = resource.backends().get("backend1"); - Assertions.assertNotNull(backend); - Assertions.assertEquals(1, backend.addresses().size()); - Assertions.assertTrue(backend.containsIPAddress("11.1.1.5")); - Assertions.assertFalse(backend.containsIPAddress("11.1.1.3")); - Assertions.assertFalse(backend.containsIPAddress("11.1.1.4")); - - // Verify HTTP configs - Assertions.assertEquals(configCount - 1, resource.backendHttpConfigurations().size()); - Assertions.assertFalse(resource.backendHttpConfigurations().containsKey("config2")); - ApplicationGatewayBackendHttpConfiguration config = resource.backendHttpConfigurations().get("config1"); - Assertions.assertEquals(8082, config.port()); - Assertions.assertEquals(20, config.requestTimeout()); - Assertions.assertTrue(config.cookieBasedAffinity()); - Assertions.assertEquals(1, config.authenticationCertificates().size()); - Assertions.assertFalse(config.authenticationCertificates().containsKey(authCert1.name())); - Assertions.assertTrue(config.authenticationCertificates().containsKey("auth2")); - - // Verify rules - Assertions.assertEquals(ruleCount - 1, resource.requestRoutingRules().size()); - Assertions.assertFalse(resource.requestRoutingRules().containsKey("rule9000")); - - ApplicationGatewayRequestRoutingRule rule = resource.requestRoutingRules().get("rule80"); - Assertions.assertNotNull(rule); - Assertions.assertNotNull(rule.backend()); - Assertions.assertTrue("backend1".equalsIgnoreCase(rule.backend().name())); - Assertions.assertNotNull(rule.backendHttpConfiguration()); - Assertions.assertTrue("config1".equalsIgnoreCase(rule.backendHttpConfiguration().name())); - - rule = resource.requestRoutingRules().get("rule443"); - Assertions.assertNotNull(rule); - Assertions.assertNotNull(rule.listener()); - Assertions.assertTrue("foobar".equalsIgnoreCase(rule.listener().hostname())); - Assertions.assertNull(rule.redirectConfiguration()); - - // Verify SSL certificates - Assertions.assertEquals(sslCertCount - 1, resource.sslCertificates().size()); - Assertions.assertFalse(resource.sslCertificates().containsKey("cert1")); - - // Verify authentication certificates - Assertions.assertEquals(authCertCount - 1, resource.authenticationCertificates().size()); - Assertions.assertFalse(resource.authenticationCertificates().containsKey("auth1")); - - return resource; - } - } - - /** Complex Internet-facing (public) app gateway test. */ - public class PublicComplex extends TestTemplate { - /** - * Tests minimal internal app gateways. - * - * @throws Exception when something goes wrong with test PIP creation - */ - public PublicComplex(ResourceManagerUtils.InternalRuntimeContext internalContext) throws Exception { - initializeResourceNames(internalContext); - } - - @Override - public void print(ApplicationGateway resource) { - printAppGateway(resource); - } - - @Override - public ApplicationGateway createResource(final ApplicationGateways resources) throws Exception { - ensurePIPs(resources.manager().publicIpAddresses()); - Thread.UncaughtExceptionHandler threadException = - new Thread.UncaughtExceptionHandler() { - public void uncaughtException(Thread th, Throwable ex) { - System.out.println("Uncaught exception: " + ex); - } - }; - - final PublicIpAddress pip = - resources.manager().publicIpAddresses().getByResourceGroup(groupName, pipNames[0]); - - // Prepare for execution in a separate thread to shorten the test - Thread creationThread = - new Thread( - new Runnable() { - @Override - public void run() { - // Create an application gateway - try { - resources - .define(appGatewayName) - .withRegion(REGION) - .withExistingResourceGroup(groupName) - - // Request routing rules - .defineRequestRoutingRule("rule80") - .fromPublicFrontend() - .fromFrontendHttpPort(80) - .toBackendHttpPort(8080) - .toBackendFqdn("www.microsoft.com") - .toBackendFqdn("www.example.com") - .toBackendIPAddress("11.1.1.1") - .toBackendIPAddress("11.1.1.2") - .withCookieBasedAffinity() - .attach() - .defineRequestRoutingRule("rule443") - .fromPublicFrontend() - .fromFrontendHttpsPort(443) - .withSslCertificateFromPfxFile( - new File(getClass().getClassLoader().getResource("myTest.pfx").getFile())) - .withSslCertificatePassword("Abc123") - .toBackendHttpConfiguration("config1") - .toBackend("backend1") - .attach() - .defineRequestRoutingRule("rule9000") - .fromListener("listener1") - .toBackendHttpConfiguration("config1") - .toBackend("backend1") - .attach() - - // Additional/explicit frontend listeners - .defineListener("listener1") - .withPublicFrontend() - .withFrontendPort(9000) - .withHttps() - .withSslCertificateFromPfxFile( - new File(getClass().getClassLoader().getResource("myTest2.pfx").getFile())) - .withSslCertificatePassword("Abc123") - .withServerNameIndication() - .withHostname("www.fabricam.com") - .attach() - - // Additional/explicit backends - .defineBackend("backend1") - .withIPAddress("11.1.1.1") - .withIPAddress("11.1.1.2") - .attach() - .withExistingPublicIpAddress(pip) - .withSize(ApplicationGatewaySkuName.STANDARD_MEDIUM) - .withInstanceCount(2) - - // Probes - .defineProbe("probe1") - .withHost("microsoft.com") - .withPath("/") - .withHttp() - .withTimeoutInSeconds(10) - .withTimeBetweenProbesInSeconds(9) - .withRetriesBeforeUnhealthy(5) - .withHealthyHttpResponseStatusCodeRange(200, 249) - .attach() - .defineProbe("probe2") - .withHost("microsoft.com") - .withPath("/") - .withHttps() - .withTimeoutInSeconds(11) - .withHealthyHttpResponseStatusCodeRange(600, 610) - .withHealthyHttpResponseStatusCodeRange(650, 660) - .withHealthyHttpResponseBodyContents("I am too healthy for this test.") - .attach() - - // Additional/explicit backend HTTP setting configs - .defineBackendHttpConfiguration("config1") - .withPort(8081) - .withRequestTimeout(45) - .withProbe("probe1") - .withHostHeader("foo") - .withConnectionDrainingTimeoutInSeconds(100) - .withPath("path") - .withAffinityCookieName("cookie") - .attach() - .withDisabledSslProtocols( - ApplicationGatewaySslProtocol.TLSV1_0, ApplicationGatewaySslProtocol.TLSV1_1) - .withHttp2() - .create(); - } catch (IOException e) { - e.printStackTrace(); - } - } - }); - - // Start creating in a separate thread... - creationThread.setUncaughtExceptionHandler(threadException); - creationThread.start(); - - creationThread.join(); - - // Get the resource as created so far - String resourceId = createResourceId(resources.manager().subscriptionId()); - ApplicationGateway appGateway = resources.getById(resourceId); - Assertions.assertNotNull(appGateway); - Assertions.assertTrue(appGateway.isPublic()); - Assertions.assertTrue(!appGateway.isPrivate()); - Assertions.assertEquals(ApplicationGatewayTier.STANDARD, appGateway.tier()); - Assertions.assertEquals(ApplicationGatewaySkuName.STANDARD_MEDIUM, appGateway.size()); - Assertions.assertEquals(2, appGateway.instanceCount()); - Assertions.assertEquals(1, appGateway.ipConfigurations().size()); - Assertions.assertTrue(appGateway.isHttp2Enabled()); - - // Verify frontend ports - Assertions.assertEquals(3, appGateway.frontendPorts().size()); - Assertions.assertNotNull(appGateway.frontendPortNameFromNumber(80)); - Assertions.assertNotNull(appGateway.frontendPortNameFromNumber(443)); - Assertions.assertNotNull(appGateway.frontendPortNameFromNumber(9000)); - - // Verify frontends - Assertions.assertEquals(1, appGateway.frontends().size()); - Assertions.assertEquals(1, appGateway.publicFrontends().size()); - Assertions.assertEquals(0, appGateway.privateFrontends().size()); - ApplicationGatewayFrontend frontend = appGateway.publicFrontends().values().iterator().next(); - Assertions.assertTrue(frontend.isPublic()); - Assertions.assertTrue(!frontend.isPrivate()); - - // Verify listeners - Assertions.assertEquals(3, appGateway.listeners().size()); - ApplicationGatewayListener listener = appGateway.listeners().get("listener1"); - Assertions.assertNotNull(listener); - Assertions.assertEquals(9000, listener.frontendPortNumber()); - Assertions.assertTrue("www.fabricam.com".equalsIgnoreCase(listener.hostname())); - Assertions.assertTrue(listener.requiresServerNameIndication()); - Assertions.assertNotNull(listener.frontend()); - Assertions.assertFalse(listener.frontend().isPrivate()); - Assertions.assertTrue(listener.frontend().isPublic()); - Assertions.assertEquals(ApplicationGatewayProtocol.HTTPS, listener.protocol()); - Assertions.assertNotNull(appGateway.listenerByPortNumber(80)); - Assertions.assertNotNull(appGateway.listenerByPortNumber(443)); - - // Verify SSL certificates - Assertions.assertEquals(2, appGateway.sslCertificates().size()); - - // Verify backends - Assertions.assertEquals(2, appGateway.backends().size()); - ApplicationGatewayBackend backend = appGateway.backends().get("backend1"); - Assertions.assertNotNull(backend); - Assertions.assertEquals(2, backend.addresses().size()); - - // Verify request routing rules - Assertions.assertEquals(3, appGateway.requestRoutingRules().size()); - ApplicationGatewayRequestRoutingRule rule, rule80; - - rule80 = appGateway.requestRoutingRules().get("rule80"); - Assertions.assertNotNull(rule80); - Assertions.assertTrue(pip.id().equalsIgnoreCase(rule80.publicIpAddressId())); - Assertions.assertEquals(80, rule80.frontendPort()); - Assertions.assertEquals(8080, rule80.backendPort()); - Assertions.assertTrue(rule80.cookieBasedAffinity()); - Assertions.assertEquals(4, rule80.backendAddresses().size()); - Assertions.assertTrue(rule80.backend().containsIPAddress("11.1.1.2")); - Assertions.assertTrue(rule80.backend().containsIPAddress("11.1.1.1")); - Assertions.assertTrue(rule80.backend().containsFqdn("www.microsoft.com")); - Assertions.assertTrue(rule80.backend().containsFqdn("www.example.com")); - - rule = appGateway.requestRoutingRules().get("rule443"); - Assertions.assertNotNull(rule); - Assertions.assertTrue(pip.id().equalsIgnoreCase(rule.publicIpAddressId())); - Assertions.assertEquals(443, rule.frontendPort()); - Assertions.assertEquals(ApplicationGatewayProtocol.HTTPS, rule.frontendProtocol()); - Assertions.assertNotNull(rule.sslCertificate()); - Assertions.assertNotNull(rule.backendHttpConfiguration()); - Assertions.assertTrue(rule.backendHttpConfiguration().name().equalsIgnoreCase("config1")); - Assertions.assertNotNull(rule.backend()); - Assertions.assertTrue(rule.backend().name().equalsIgnoreCase("backend1")); - - rule = appGateway.requestRoutingRules().get("rule9000"); - Assertions.assertNotNull(rule); - Assertions.assertNotNull(rule.listener()); - Assertions.assertTrue(rule.listener().name().equalsIgnoreCase("listener1")); - Assertions.assertNotNull(rule.backendHttpConfiguration()); - Assertions.assertTrue(rule.backendHttpConfiguration().name().equalsIgnoreCase("config1")); - Assertions.assertNotNull(rule.backend()); - Assertions.assertTrue(rule.backend().name().equalsIgnoreCase("backend1")); - - // Verify backend HTTP settings configs - Assertions.assertEquals(2, appGateway.backendHttpConfigurations().size()); - ApplicationGatewayBackendHttpConfiguration config = appGateway.backendHttpConfigurations().get("config1"); - Assertions.assertNotNull(config); - Assertions.assertEquals(8081, config.port()); - Assertions.assertEquals(45, config.requestTimeout()); - Assertions.assertNotNull(config.probe()); - Assertions.assertEquals("probe1", config.probe().name()); - Assertions.assertFalse(config.isHostHeaderFromBackend()); - Assertions.assertEquals("foo", config.hostHeader()); - Assertions.assertEquals(100, config.connectionDrainingTimeoutInSeconds()); - Assertions.assertEquals("/path/", config.path()); - Assertions.assertEquals("cookie", config.affinityCookieName()); - - // Verify probes - Assertions.assertEquals(2, appGateway.probes().size()); - ApplicationGatewayProbe probe; - probe = appGateway.probes().get("probe1"); - Assertions.assertNotNull(probe); - Assertions.assertEquals("microsoft.com", probe.host().toLowerCase()); - Assertions.assertEquals(ApplicationGatewayProtocol.HTTP, probe.protocol()); - Assertions.assertEquals("/", probe.path()); - Assertions.assertEquals(5, probe.retriesBeforeUnhealthy()); - Assertions.assertEquals(9, probe.timeBetweenProbesInSeconds()); - Assertions.assertEquals(10, probe.timeoutInSeconds()); - Assertions.assertNotNull(probe.healthyHttpResponseStatusCodeRanges()); - Assertions.assertEquals(1, probe.healthyHttpResponseStatusCodeRanges().size()); - Assertions.assertTrue(probe.healthyHttpResponseStatusCodeRanges().contains("200-249")); - - probe = appGateway.probes().get("probe2"); - Assertions.assertNotNull(probe); - Assertions.assertEquals(ApplicationGatewayProtocol.HTTPS, probe.protocol()); - Assertions.assertEquals(2, probe.healthyHttpResponseStatusCodeRanges().size()); - Assertions.assertTrue(probe.healthyHttpResponseStatusCodeRanges().contains("600-610")); - Assertions.assertTrue(probe.healthyHttpResponseStatusCodeRanges().contains("650-660")); - Assertions.assertEquals("I am too healthy for this test.", probe.healthyHttpResponseBodyContents()); - - // Verify SSL policy - disabled protocols - Assertions.assertEquals(2, appGateway.disabledSslProtocols().size()); - Assertions.assertTrue(appGateway.disabledSslProtocols().contains(ApplicationGatewaySslProtocol.TLSV1_0)); - Assertions.assertTrue(appGateway.disabledSslProtocols().contains(ApplicationGatewaySslProtocol.TLSV1_1)); - Assertions.assertTrue(!appGateway.disabledSslProtocols().contains(ApplicationGatewaySslProtocol.TLSV1_2)); - - return appGateway; - } - - @Override - public ApplicationGateway updateResource(final ApplicationGateway resource) throws Exception { - final int rulesCount = resource.requestRoutingRules().size(); - ApplicationGatewayRequestRoutingRule rule80 = resource.requestRoutingRules().get("rule80"); - Assertions.assertNotNull(rule80); - ApplicationGatewayBackendHttpConfiguration backendConfig80 = rule80.backendHttpConfiguration(); - Assertions.assertNotNull(backendConfig80); - - resource - .update() - .withSize(ApplicationGatewaySkuName.STANDARD_SMALL) - .withInstanceCount(1) - .updateListener("listener1") - .withHostname("www.contoso.com") - .parent() - .updateRequestRoutingRule("rule443") - .fromListener("listener1") - .parent() - .updateBackendHttpConfiguration("config1") - .withoutHostHeader() - .withoutConnectionDraining() - .withAffinityCookieName(null) - .withPath(null) - .parent() - .updateBackendHttpConfiguration(backendConfig80.name()) - .withHostHeaderFromBackend() - .parent() - .withoutRequestRoutingRule("rule9000") - .withoutProbe("probe1") - .updateProbe("probe2") - .withoutHealthyHttpResponseStatusCodeRanges() - .withHealthyHttpResponseBodyContents(null) - .parent() - .withoutDisabledSslProtocols( - ApplicationGatewaySslProtocol.TLSV1_0, ApplicationGatewaySslProtocol.TLSV1_1) - .withoutHttp2() - .withTag("tag1", "value1") - .withTag("tag2", "value2") - .apply(); - - resource.refresh(); - - // Get the resource created so far - Assertions.assertTrue(resource.tags().containsKey("tag1")); - Assertions.assertTrue(resource.size().equals(ApplicationGatewaySkuName.STANDARD_SMALL)); - Assertions.assertTrue(resource.instanceCount() == 1); - Assertions.assertFalse(resource.isHttp2Enabled()); - - // Verify listeners - ApplicationGatewayListener listener = resource.listeners().get("listener1"); - Assertions.assertTrue("www.contoso.com".equalsIgnoreCase(listener.hostname())); - - // Verify request routing rules - Assertions.assertTrue(resource.requestRoutingRules().size() == rulesCount - 1); - Assertions.assertTrue(!resource.requestRoutingRules().containsKey("rule9000")); - ApplicationGatewayRequestRoutingRule rule = resource.requestRoutingRules().get("rule443"); - Assertions.assertTrue(rule != null); - Assertions.assertTrue("listener1".equalsIgnoreCase(rule.listener().name())); - - // Verify probes - Assertions.assertEquals(1, resource.probes().size()); - ApplicationGatewayProbe probe = resource.probes().get("probe2"); - Assertions.assertNotNull(probe); - Assertions.assertTrue(probe.healthyHttpResponseStatusCodeRanges().isEmpty()); - Assertions.assertNull(probe.healthyHttpResponseBodyContents()); - - // Verify backend configs - ApplicationGatewayBackendHttpConfiguration backendConfig = - resource.backendHttpConfigurations().get("config1"); - Assertions.assertNotNull(backendConfig); - Assertions.assertNull(backendConfig.probe()); - Assertions.assertFalse(backendConfig.isHostHeaderFromBackend()); - Assertions.assertNull(backendConfig.hostHeader()); - Assertions.assertEquals(0, backendConfig.connectionDrainingTimeoutInSeconds()); - Assertions.assertNull(backendConfig.affinityCookieName()); - Assertions.assertNull(backendConfig.path()); - - rule80 = resource.requestRoutingRules().get("rule80"); - Assertions.assertNotNull(rule80); - backendConfig80 = rule80.backendHttpConfiguration(); - Assertions.assertNotNull(backendConfig80); - Assertions.assertTrue(backendConfig80.isHostHeaderFromBackend()); - Assertions.assertNull(backendConfig80.hostHeader()); - - // Verify SSL policy - disabled protocols - Assertions.assertEquals(0, resource.disabledSslProtocols().size()); - return resource; - } - } - - /** Internet-facing LB test with NAT pool test. */ - public class PublicMinimal extends TestTemplate { - PublicMinimal(ResourceManagerUtils.InternalRuntimeContext internalContext) { - initializeResourceNames(internalContext); - } - - @Override - public void print(ApplicationGateway resource) { - printAppGateway(resource); - } - - @Override - public ApplicationGateway createResource(final ApplicationGateways resources) throws Exception { - // Prepare a separate thread for resource creation - Thread creationThread = - new Thread( - new Runnable() { - @Override - public void run() { - // Create an application gateway - try { - resources - .define(appGatewayName) - .withRegion(REGION) - .withNewResourceGroup(groupName) - - // Request routing rules - .defineRequestRoutingRule("rule1") - .fromPublicFrontend() - .fromFrontendHttpsPort(443) - .withSslCertificateFromPfxFile( - new File(getClass().getClassLoader().getResource("myTest.pfx").getFile())) - .withSslCertificatePassword("Abc123") - .toBackendHttpPort(8080) - .toBackendIPAddress("11.1.1.1") - .toBackendIPAddress("11.1.1.2") - .attach() - .create(); - } catch (IOException e) { - e.printStackTrace(); - } - } - }); - - // Start the creation... - creationThread.start(); - - creationThread.join(); - - // Get the resource as created so far - String resourceId = createResourceId(resources.manager().subscriptionId()); - ApplicationGateway appGateway = resources.manager().applicationGateways().getById(resourceId); - Assertions.assertTrue(appGateway != null); - Assertions.assertTrue(ApplicationGatewayTier.STANDARD.equals(appGateway.tier())); - Assertions.assertTrue(ApplicationGatewaySkuName.STANDARD_SMALL.equals(appGateway.size())); - Assertions.assertTrue(appGateway.instanceCount() == 1); - - // Verify frontend ports - Assertions.assertTrue(appGateway.frontendPorts().size() == 1); - Assertions.assertTrue(appGateway.frontendPortNameFromNumber(443) != null); - - // Verify frontends - Assertions.assertTrue(!appGateway.isPrivate()); - Assertions.assertTrue(appGateway.isPublic()); - Assertions.assertTrue(appGateway.frontends().size() == 1); - - // Verify listeners - Assertions.assertTrue(appGateway.listeners().size() == 1); - Assertions.assertTrue(appGateway.listenerByPortNumber(443) != null); - - // Verify backends - Assertions.assertTrue(appGateway.backends().size() == 1); - - // Verify backend HTTP configs - Assertions.assertTrue(appGateway.backendHttpConfigurations().size() == 1); - - // Verify rules - Assertions.assertTrue(appGateway.requestRoutingRules().size() == 1); - ApplicationGatewayRequestRoutingRule rule = appGateway.requestRoutingRules().get("rule1"); - Assertions.assertTrue(rule != null); - Assertions.assertTrue(rule.frontendPort() == 443); - Assertions.assertTrue(ApplicationGatewayProtocol.HTTPS.equals(rule.frontendProtocol())); - Assertions.assertTrue(rule.listener() != null); - Assertions.assertTrue(rule.listener().frontend() != null); - Assertions.assertTrue(rule.listener().frontend().isPublic()); - Assertions.assertTrue(!rule.listener().frontend().isPrivate()); - Assertions.assertTrue(rule.backendPort() == 8080); - Assertions.assertTrue(rule.sslCertificate() != null); - Assertions.assertTrue(rule.backendAddresses().size() == 2); - Assertions.assertTrue(rule.backend().containsIPAddress("11.1.1.1")); - Assertions.assertTrue(rule.backend().containsIPAddress("11.1.1.2")); - - // Verify certificates - Assertions.assertTrue(appGateway.sslCertificates().size() == 1); - - return appGateway; - } - - @Override - public ApplicationGateway updateResource(final ApplicationGateway resource) throws Exception { - resource - .update() - .withInstanceCount(2) - .withSize(ApplicationGatewaySkuName.STANDARD_MEDIUM) - .withoutBackendIPAddress("11.1.1.1") - .defineListener("listener2") - .withPublicFrontend() - .withFrontendPort(80) - .attach() - .defineBackend("backend2") - .withIPAddress("11.1.1.3") - .attach() - .defineBackendHttpConfiguration("config2") - .withCookieBasedAffinity() - .withPort(8081) - .withRequestTimeout(33) - .attach() - .defineRequestRoutingRule("rule2") - .fromListener("listener2") - .toBackendHttpConfiguration("config2") - .toBackend("backend2") - .attach() - .withTag("tag1", "value1") - .withTag("tag2", "value2") - .apply(); - - resource.refresh(); - - Assertions.assertTrue(resource.tags().containsKey("tag1")); - Assertions.assertTrue(resource.tags().containsKey("tag2")); - Assertions.assertTrue(ApplicationGatewaySkuName.STANDARD_MEDIUM.equals(resource.size())); - Assertions.assertTrue(resource.instanceCount() == 2); - - // Verify frontend ports - Assertions.assertTrue(resource.frontendPorts().size() == 2); - Assertions.assertTrue(resource.frontendPortNameFromNumber(80) != null); - - // Verify listeners - Assertions.assertTrue(resource.listeners().size() == 2); - ApplicationGatewayListener listener = resource.listeners().get("listener2"); - Assertions.assertTrue(listener != null); - Assertions.assertTrue(!listener.frontend().isPrivate()); - Assertions.assertTrue(listener.frontend().isPublic()); - Assertions.assertTrue(listener.frontendPortNumber() == 80); - Assertions.assertTrue(ApplicationGatewayProtocol.HTTP.equals(listener.protocol())); - Assertions.assertTrue(listener.sslCertificate() == null); - - // Verify backends - Assertions.assertTrue(resource.backends().size() == 2); - ApplicationGatewayBackend backend = resource.backends().get("backend2"); - Assertions.assertTrue(backend != null); - Assertions.assertTrue(backend.addresses().size() == 1); - Assertions.assertTrue(backend.containsIPAddress("11.1.1.3")); - - // Verify HTTP configs - Assertions.assertTrue(resource.backendHttpConfigurations().size() == 2); - ApplicationGatewayBackendHttpConfiguration config = resource.backendHttpConfigurations().get("config2"); - Assertions.assertTrue(config != null); - Assertions.assertTrue(config.cookieBasedAffinity()); - Assertions.assertTrue(config.port() == 8081); - Assertions.assertTrue(config.requestTimeout() == 33); - - // Verify request routing rules - Assertions.assertTrue(resource.requestRoutingRules().size() == 2); - ApplicationGatewayRequestRoutingRule rule = resource.requestRoutingRules().get("rule2"); - Assertions.assertTrue(rule != null); - Assertions.assertTrue(rule.listener() != null); - Assertions.assertTrue("listener2".equals(rule.listener().name())); - Assertions.assertTrue(rule.backendHttpConfiguration() != null); - Assertions.assertTrue("config2".equalsIgnoreCase(rule.backendHttpConfiguration().name())); - Assertions.assertTrue(rule.backend() != null); - Assertions.assertTrue("backend2".equalsIgnoreCase(rule.backend().name())); - - return resource; - } - } - - // Create VNet for the app gateway - private Map ensurePIPs(PublicIpAddresses pips) throws Exception { - List> creatablePips = new ArrayList<>(); - for (int i = 0; i < pipNames.length; i++) { - creatablePips.add(pips.define(pipNames[i]).withRegion(REGION).withNewResourceGroup(groupName)); - } - - return pips.create(creatablePips); - } - - // Print app gateway info - static void printAppGateway(ApplicationGateway resource) { - StringBuilder info = new StringBuilder(); - info - .append("Application gateway: ") - .append(resource.id()) - .append("Name: ") - .append(resource.name()) - .append("\n\tResource group: ") - .append(resource.resourceGroupName()) - .append("\n\tRegion: ") - .append(resource.region()) - .append("\n\tTags: ") - .append(resource.tags()) - .append("\n\tSKU: ") - .append(resource.sku().toString()) - .append("\n\tOperational state: ") - .append(resource.operationalState()) - .append("\n\tInternet-facing? ") - .append(resource.isPublic()) - .append("\n\tInternal? ") - .append(resource.isPrivate()) - .append("\n\tDefault private IP address: ") - .append(resource.privateIpAddress()) - .append("\n\tPrivate IP address allocation method: ") - .append(resource.privateIpAllocationMethod()) - .append("\n\tDisabled SSL protocols: ") - .append(resource.disabledSslProtocols().toString()); - - // Show IP configs - Map ipConfigs = resource.ipConfigurations(); - info.append("\n\tIP configurations: ").append(ipConfigs.size()); - for (ApplicationGatewayIpConfiguration ipConfig : ipConfigs.values()) { - info - .append("\n\t\tName: ") - .append(ipConfig.name()) - .append("\n\t\t\tNetwork id: ") - .append(ipConfig.networkId()) - .append("\n\t\t\tSubnet name: ") - .append(ipConfig.subnetName()); - } - - // Show frontends - Map frontends = resource.frontends(); - info.append("\n\tFrontends: ").append(frontends.size()); - for (ApplicationGatewayFrontend frontend : frontends.values()) { - info.append("\n\t\tName: ").append(frontend.name()).append("\n\t\t\tPublic? ").append(frontend.isPublic()); - - if (frontend.isPublic()) { - // Show public frontend info - info.append("\n\t\t\tPublic IP address ID: ").append(frontend.publicIpAddressId()); - } - - if (frontend.isPrivate()) { - // Show private frontend info - info - .append("\n\t\t\tPrivate IP address: ") - .append(frontend.privateIpAddress()) - .append("\n\t\t\tPrivate IP allocation method: ") - .append(frontend.privateIpAllocationMethod()) - .append("\n\t\t\tSubnet name: ") - .append(frontend.subnetName()) - .append("\n\t\t\tVirtual network ID: ") - .append(frontend.networkId()); - } - } - - // Show backends - Map backends = resource.backends(); - info.append("\n\tBackends: ").append(backends.size()); - for (ApplicationGatewayBackend backend : backends.values()) { - info - .append("\n\t\tName: ") - .append(backend.name()) - .append("\n\t\t\tAssociated NIC IP configuration IDs: ") - .append(backend.backendNicIPConfigurationNames().keySet()); - - // Show addresses - Collection addresses = backend.addresses(); - info.append("\n\t\t\tAddresses: ").append(addresses.size()); - for (ApplicationGatewayBackendAddress address : addresses) { - info - .append("\n\t\t\t\tFQDN: ") - .append(address.fqdn()) - .append("\n\t\t\t\tIP: ") - .append(address.ipAddress()); - } - } - - // Show backend HTTP configurations - Map httpConfigs = resource.backendHttpConfigurations(); - info.append("\n\tHTTP Configurations: ").append(httpConfigs.size()); - for (ApplicationGatewayBackendHttpConfiguration httpConfig : httpConfigs.values()) { - info - .append("\n\t\tName: ") - .append(httpConfig.name()) - .append("\n\t\t\tCookie based affinity: ") - .append(httpConfig.cookieBasedAffinity()) - .append("\n\t\t\tPort: ") - .append(httpConfig.port()) - .append("\n\t\t\tRequest timeout in seconds: ") - .append(httpConfig.requestTimeout()) - .append("\n\t\t\tProtocol: ") - .append(httpConfig.protocol()) - .append("\n\t\tHost header: ") - .append(httpConfig.hostHeader()) - .append("\n\t\tHost header comes from backend? ") - .append(httpConfig.isHostHeaderFromBackend()) - .append("\n\t\tConnection draining timeout in seconds: ") - .append(httpConfig.connectionDrainingTimeoutInSeconds()) - .append("\n\t\tAffinity cookie name: ") - .append(httpConfig.affinityCookieName()) - .append("\n\t\tPath: ") - .append(httpConfig.path()); - - if (httpConfig.probe() != null) { - info.append("\n\t\t\tProbe: " + httpConfig.probe().name()); - } - info.append("\n\t\tIs probe enabled? ").append(httpConfig.isProbeEnabled()); - } - - // Show SSL certificates - Map sslCerts = resource.sslCertificates(); - info.append("\n\tSSL certificates: ").append(sslCerts.size()); - for (ApplicationGatewaySslCertificate cert : sslCerts.values()) { - info.append("\n\t\tName: ").append(cert.name()).append("\n\t\t\tCert data: ").append(cert.publicData()); - } - - // Show HTTP listeners - Map listeners = resource.listeners(); - info.append("\n\tHTTP listeners: ").append(listeners.size()); - for (ApplicationGatewayListener listener : listeners.values()) { - info - .append("\n\t\tName: ") - .append(listener.name()) - .append("\n\t\t\tHost name: ") - .append(listener.hostname()) - .append("\n\t\t\tServer name indication required? ") - .append(listener.requiresServerNameIndication()) - .append("\n\t\t\tAssociated frontend name: ") - .append(listener.frontend().name()) - .append("\n\t\t\tFrontend port name: ") - .append(listener.frontendPortName()) - .append("\n\t\t\tFrontend port number: ") - .append(listener.frontendPortNumber()) - .append("\n\t\t\tProtocol: ") - .append(listener.protocol().toString()); - if (listener.sslCertificate() != null) { - info.append("\n\t\t\tAssociated SSL certificate: ").append(listener.sslCertificate().name()); - } - } - - // Show probes - Map probes = resource.probes(); - info.append("\n\tProbes: ").append(probes.size()); - for (ApplicationGatewayProbe probe : probes.values()) { - info - .append("\n\t\tName: ") - .append(probe.name()) - .append("\n\t\tProtocol:") - .append(probe.protocol().toString()) - .append("\n\t\tInterval in seconds: ") - .append(probe.timeBetweenProbesInSeconds()) - .append("\n\t\tRetries: ") - .append(probe.retriesBeforeUnhealthy()) - .append("\n\t\tTimeout: ") - .append(probe.timeoutInSeconds()) - .append("\n\t\tHost: ") - .append(probe.host()) - .append("\n\t\tHealthy HTTP response status code ranges: ") - .append(probe.healthyHttpResponseStatusCodeRanges()) - .append("\n\t\tHealthy HTTP response body contents: ") - .append(probe.healthyHttpResponseBodyContents()); - } - - // Show authentication certificates - Map certs = resource.authenticationCertificates(); - info.append("\n\tAuthentication certificates: ").append(certs.size()); - for (ApplicationGatewayAuthenticationCertificate cert : certs.values()) { - info.append("\n\t\tName: ").append(cert.name()).append("\n\t\tBase-64 encoded data: ").append(cert.data()); - } - - // Show redirect configurations - Map redirects = resource.redirectConfigurations(); - info.append("\n\tRedirect configurations: ").append(redirects.size()); - for (ApplicationGatewayRedirectConfiguration redirect : redirects.values()) { - info - .append("\n\t\tName: ") - .append(redirect.name()) - .append("\n\t\tTarget URL: ") - .append(redirect.type()) - .append("\n\t\tTarget URL: ") - .append(redirect.targetUrl()) - .append("\n\t\tTarget listener: ") - .append(redirect.targetListener() != null ? redirect.targetListener().name() : null) - .append("\n\t\tIs path included? ") - .append(redirect.isPathIncluded()) - .append("\n\t\tIs query string included? ") - .append(redirect.isQueryStringIncluded()) - .append("\n\t\tReferencing request routing rules: ") - .append(redirect.requestRoutingRules().values()); - } - - // Show request routing rules - Map rules = resource.requestRoutingRules(); - info.append("\n\tRequest routing rules: ").append(rules.size()); - for (ApplicationGatewayRequestRoutingRule rule : rules.values()) { - info - .append("\n\t\tName: ") - .append(rule.name()) - .append("\n\t\tType: ") - .append(rule.ruleType()) - .append("\n\t\tPublic IP address ID: ") - .append(rule.publicIpAddressId()) - .append("\n\t\tHost name: ") - .append(rule.hostname()) - .append("\n\t\tServer name indication required? ") - .append(rule.requiresServerNameIndication()) - .append("\n\t\tFrontend port: ") - .append(rule.frontendPort()) - .append("\n\t\tFrontend protocol: ") - .append(rule.frontendProtocol().toString()) - .append("\n\t\tBackend port: ") - .append(rule.backendPort()) - .append("\n\t\tCookie based affinity enabled? ") - .append(rule.cookieBasedAffinity()) - .append("\n\t\tRedirect configuration: ") - .append(rule.redirectConfiguration() != null ? rule.redirectConfiguration().name() : "(none)"); - - // Show backend addresses - Collection addresses = rule.backendAddresses(); - info.append("\n\t\t\tBackend addresses: ").append(addresses.size()); - for (ApplicationGatewayBackendAddress address : addresses) { - info.append("\n\t\t\t\t").append(address.fqdn()).append(" [").append(address.ipAddress()).append("]"); - } - - // Show SSL cert - info.append("\n\t\t\tSSL certificate name: "); - ApplicationGatewaySslCertificate cert = rule.sslCertificate(); - if (cert == null) { - info.append("(None)"); - } else { - info.append(cert.name()); - } - - // Show backend - info.append("\n\t\t\tAssociated backend address pool: "); - ApplicationGatewayBackend backend = rule.backend(); - if (backend == null) { - info.append("(None)"); - } else { - info.append(backend.name()); - } - - // Show backend HTTP settings config - info.append("\n\t\t\tAssociated backend HTTP settings configuration: "); - ApplicationGatewayBackendHttpConfiguration config = rule.backendHttpConfiguration(); - if (config == null) { - info.append("(None)"); - } else { - info.append(config.name()); - } - - // Show frontend listener - info.append("\n\t\t\tAssociated frontend listener: "); - ApplicationGatewayListener listener = rule.listener(); - if (listener == null) { - info.append("(None)"); - } else { - info.append(listener.name()); - } - } - System.out.println(info.toString()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestAvailabilitySet.java b/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestAvailabilitySet.java deleted file mode 100644 index 5784df504ee5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestAvailabilitySet.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.compute.models.AvailabilitySet; -import com.azure.resourcemanager.compute.models.AvailabilitySets; -import com.azure.resourcemanager.compute.models.VirtualMachineSize; -import com.azure.resourcemanager.test.ResourceManagerTestBase; -import com.azure.resourcemanager.test.utils.TestUtilities; -import com.azure.core.management.Region; -import org.junit.jupiter.api.Assertions; - -public class TestAvailabilitySet extends TestTemplate { - @Override - public AvailabilitySet createResource(AvailabilitySets availabilitySets) throws Exception { - final String newName = availabilitySets.manager().resourceManager().internalContext().randomResourceName("as", 10); - AvailabilitySet aset = - availabilitySets - .define(newName) - .withRegion(ResourceManagerTestBase.locationOrDefault(Region.US_EAST)) - .withNewResourceGroup() - .withFaultDomainCount(2) - .withUpdateDomainCount(4) - .withTag("tag1", "value1") - .create(); - PagedIterable vmSizes = aset.listVirtualMachineSizes(); - Assertions.assertTrue(TestUtilities.getSize(vmSizes) > 0); - for (VirtualMachineSize vmSize : vmSizes) { - Assertions.assertNotNull(vmSize.name()); - } - return aset; - } - - @Override - public AvailabilitySet updateResource(AvailabilitySet resource) throws Exception { - // Modify existing availability set - resource = resource.update().withTag("tag2", "value2").withTag("tag3", "value3").withoutTag("tag1").apply(); - Assertions.assertTrue(resource.tags().containsKey("tag2")); - Assertions.assertTrue(!resource.tags().containsKey("tag1")); - return resource; - } - - @Override - public void print(AvailabilitySet resource) { - System - .out - .println( - new StringBuilder() - .append("Availability Set: ") - .append(resource.id()) - .append("Name: ") - .append(resource.name()) - .append("\n\tResource group: ") - .append(resource.resourceGroupName()) - .append("\n\tRegion: ") - .append(resource.region()) - .append("\n\tTags: ") - .append(resource.tags()) - .append("\n\tFault domain count: ") - .append(resource.faultDomainCount()) - .append("\n\tUpdate domain count: ") - .append(resource.updateDomainCount()) - .toString()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestContainerRegistry.java b/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestContainerRegistry.java deleted file mode 100644 index e2fbcb7b8f93..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestContainerRegistry.java +++ /dev/null @@ -1,181 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.containerregistry.models.Registries; -import com.azure.resourcemanager.containerregistry.models.Registry; -import com.azure.resourcemanager.containerregistry.models.RegistryCredentials; -import com.azure.resourcemanager.containerregistry.models.Webhook; -import com.azure.resourcemanager.containerregistry.models.WebhookAction; -import com.azure.core.management.Region; -import com.azure.resourcemanager.test.ResourceManagerTestBase; -import org.junit.jupiter.api.Assertions; - -public class TestContainerRegistry extends TestTemplate { - - @Override - public Registry createResource(Registries registries) throws Exception { - final String testId = registries.manager().resourceManager().internalContext().randomResourceName("", 8); - final String newName = "acr" + testId; - final String rgName = "rgacr" + testId; - Registry registry = - registries - .define(newName + "1") - .withRegion(ResourceManagerTestBase.locationOrDefault(Region.US_EAST)) - .withNewResourceGroup(rgName) - .withStandardSku() - .withRegistryNameAsAdminUser() - .withTag("tag1", "value1") - .create(); - - Assertions.assertTrue(registry.adminUserEnabled()); - - RegistryCredentials registryCredentials = registry.getCredentials(); - Assertions.assertNotNull(registryCredentials); - if (TestUtils.isRecordMode()) { - Assertions.assertEquals(newName + "1", registryCredentials.username()); - } - Assertions.assertEquals(2, registryCredentials.accessKeys().size()); - Assertions.assertEquals(0, registry.webhooks().list().stream().count()); - - Registry registry2 = - registries - .define(newName + "2") - .withRegion(ResourceManagerTestBase.locationOrDefault(Region.US_EAST)) - .withNewResourceGroup(rgName) - .withBasicSku() - .withRegistryNameAsAdminUser() - .defineWebhook("webhookbing1") - .withTriggerWhen(WebhookAction.PUSH, WebhookAction.DELETE) - .withServiceUri("https://www.bing.com") - .withRepositoriesScope("") - .withTag("tag", "value") - .withCustomHeader("name", "value") - .attach() - .defineWebhook("webhookbing2") - .withTriggerWhen(WebhookAction.PUSH) - .withServiceUri("https://www.bing.com") - .enabled(false) - .withRepositoriesScope("") - .withTag("tag", "value") - .withCustomHeader("name", "value") - .attach() - .withTag("tag1", "value1") - .create(); - - Assertions.assertTrue(registry2.adminUserEnabled()); - - RegistryCredentials registryCredentials2 = registry2.getCredentials(); - Assertions.assertNotNull(registryCredentials2); - if (TestUtils.isRecordMode()) { - Assertions.assertEquals(newName + "2", registryCredentials2.username()); - } - Assertions.assertEquals(2, registryCredentials2.accessKeys().size()); - - PagedIterable webhooksList = registry2.webhooks().list(); - - Assertions.assertEquals(2, webhooksList.stream().count()); - Webhook webhook = registry2.webhooks().get("webhookbing1"); - Assertions.assertTrue(webhook.isEnabled()); - Assertions.assertTrue(webhook.tags().containsKey("tag")); - Assertions.assertEquals("https://www.bing.com", webhook.serviceUri()); - Assertions.assertTrue(webhook.isEnabled()); - Assertions.assertEquals(2, webhook.triggers().size()); - - webhook = registries.webhooks().get(rgName, registry2.name(), "webhookbing2"); - Assertions.assertFalse(webhook.isEnabled()); - Assertions.assertTrue(webhook.tags().containsKey("tag")); - Assertions.assertEquals("https://www.bing.com", webhook.serviceUri()); - Assertions.assertFalse(webhook.isEnabled()); - Assertions.assertEquals(1, webhook.triggers().size()); - Assertions.assertEquals(WebhookAction.PUSH, webhook.triggers().toArray()[0]); - - Registry registry3 = registries.getById(webhook.parentId()); - - return registry3; - } - - @Override - public Registry updateResource(Registry resource) throws Exception { - resource - .update() - .withoutWebhook("webhookbing1") - .defineWebhook("webhookms") - .withTriggerWhen(WebhookAction.PUSH, WebhookAction.DELETE) - .withServiceUri("https://www.microsoft.com") - .withRepositoriesScope("") - .enabled(true) - .attach() - .updateWebhook("webhookbing2") - .withServiceUri("https://www.bing.com/maps") - .withTriggerWhen(WebhookAction.DELETE) - .withCustomHeader("header", "value") - .withoutTag("tag") - .withTag("tag2", "value") - .parent() - .withStandardSku() - .withoutTag("tag1") - .withTag("tag2", "value") - .apply(); - - Assertions.assertTrue(resource.tags().containsKey("tag2")); - Assertions.assertFalse(resource.tags().containsKey("tag1")); - - Webhook webhook = resource.webhooks().get("webhookbing2"); - Assertions.assertFalse(webhook.tags().containsKey("tag")); - Assertions.assertTrue(webhook.tags().containsKey("tag2")); - Assertions.assertEquals("https://www.bing.com/maps", webhook.serviceUri()); - Assertions.assertFalse(webhook.isEnabled()); - Assertions.assertEquals(1, webhook.triggers().size()); - Assertions.assertEquals(WebhookAction.DELETE, webhook.triggers().toArray()[0]); - - webhook.refresh(); - webhook.enable(); - Assertions.assertTrue(webhook.isEnabled()); - - webhook - .update() - .withCustomHeader("header1", "value1") - .enabled(false) - .withServiceUri("https://www.msn.com") - .withRepositoriesScope("") - .withTriggerWhen(WebhookAction.PUSH) - .withoutTag("tag2") - .withTag("tag3", "value") - .apply(); - - Assertions.assertFalse(webhook.isEnabled()); - Assertions.assertTrue(webhook.tags().containsKey("tag3")); - Assertions.assertEquals("https://www.msn.com", webhook.serviceUri()); - Assertions.assertFalse(webhook.isEnabled()); - Assertions.assertEquals(1, webhook.triggers().size()); - Assertions.assertEquals(WebhookAction.PUSH, webhook.triggers().toArray()[0]); - - webhook.ping(); - Assertions.assertNotNull(webhook.listEvents()); - - resource.webhooks().delete("webhookbing2"); - - return resource; - } - - @Override - public void print(Registry resource) { - System - .out - .println( - new StringBuilder() - .append("Regsitry: ") - .append(resource.id()) - .append("Name: ") - .append(resource.name()) - .append("\n\tResource group: ") - .append(resource.resourceGroupName()) - .append("\n\tRegion: ") - .append(resource.region()) - .append("\n\tTags: ") - .append(resource.tags()) - .toString()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestDns.java b/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestDns.java deleted file mode 100644 index 53adab7e36b9..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestDns.java +++ /dev/null @@ -1,463 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.dns.models.ARecordSet; -import com.azure.resourcemanager.dns.models.AaaaRecordSet; -import com.azure.resourcemanager.dns.models.CnameRecordSet; -import com.azure.resourcemanager.dns.models.DnsRecordSet; -import com.azure.resourcemanager.dns.models.DnsZone; -import com.azure.resourcemanager.dns.models.DnsZones; -import com.azure.resourcemanager.dns.models.MxRecordSet; -import com.azure.resourcemanager.dns.models.MxRecord; -import com.azure.resourcemanager.dns.models.NsRecordSet; -import com.azure.resourcemanager.dns.models.PtrRecordSet; -import com.azure.resourcemanager.dns.models.RecordType; -import com.azure.resourcemanager.dns.models.SoaRecord; -import com.azure.resourcemanager.dns.models.SoaRecordSet; -import com.azure.resourcemanager.dns.models.SrvRecord; -import com.azure.resourcemanager.dns.models.SrvRecordSet; -import com.azure.resourcemanager.dns.models.TxtRecord; -import com.azure.resourcemanager.dns.models.TxtRecordSet; -import com.azure.core.management.Region; -import com.azure.resourcemanager.test.ResourceManagerTestBase; -import org.junit.jupiter.api.Assertions; - -import java.util.HashMap; - -import static com.azure.resourcemanager.dns.models.RecordType.AAAA; -import static com.azure.resourcemanager.dns.models.RecordType.MX; -import static com.azure.resourcemanager.dns.models.RecordType.NS; -import static com.azure.resourcemanager.dns.models.RecordType.PTR; -import static com.azure.resourcemanager.dns.models.RecordType.SOA; -import static com.azure.resourcemanager.dns.models.RecordType.SRV; -import static com.azure.resourcemanager.dns.models.RecordType.TXT; - -public class TestDns extends TestTemplate { - @Override - public DnsZone createResource(DnsZones dnsZones) throws Exception { - final Region region = ResourceManagerTestBase.locationOrDefault(Region.US_EAST); - final String testId = dnsZones.manager().resourceManager().internalContext().randomResourceName("", 8); - final String groupName = "rg" + testId; - final String topLevelDomain = "www.contoso" + testId + ".com"; - - DnsZone dnsZone = dnsZones.define(topLevelDomain) - .withNewResourceGroup(groupName, region) - .defineARecordSet("www") - .withIPv4Address("23.96.104.40") - .withIPv4Address("24.97.105.41") - .withTimeToLive(7200) // Overwrite default 3600 seconds - .attach() - .defineAaaaRecordSet("www") - .withIPv6Address("2001:0db8:85a3:0000:0000:8a2e:0370:7334") - .withIPv6Address("2002:0db9:85a4:0000:0000:8a2e:0371:7335") - .attach() - .defineMXRecordSet("email") - .withMailExchange("mail.contoso-mail-exchange1.com", 1) - .withMailExchange("mail.contoso-mail-exchange2.com", 2) - .withMetadata("mxa", "mxaa") - .withMetadata("mxb", "mxbb") - .attach() - .defineNSRecordSet("partners") - .withNameServer("ns1-05.azure-dns.com") - .withNameServer("ns2-05.azure-dns.net") - .withNameServer("ns3-05.azure-dns.org") - .withNameServer("ns4-05.azure-dns.info") - .attach() - .defineTxtRecordSet("@") - .withText("windows-apps-verification=2ZzjfideIJFLFje83") - .attach() - .defineTxtRecordSet("www") - .withText("some info about www.contoso.com") - .attach() - .defineSrvRecordSet("_sip._tcp") - .withRecord("bigbox.contoso-service.com", 5060, 10, 60) - .withRecord("smallbox1.contoso-service.com", 5060, 10, 20) - .withRecord("smallbox2.contoso-service.com", 5060, 10, 20) - .withRecord("backupbox.contoso-service.com", 5060, 10, 0) - .attach() - .definePtrRecordSet("40") - .withTargetDomainName("www.contoso.com") - .withTargetDomainName("mail.contoso.com") - .attach() - .definePtrRecordSet("41") - .withTargetDomainName("www.contoso.com") - .withTargetDomainName("mail.contoso.com") - .attach() - .withCNameRecordSet("documents", "doc.contoso.com") - .withCNameRecordSet("userguide", "doc.contoso.com") - .withTag("a", "aa") - .withTag("b", "bb") - .create(); - - // Check Dns zone properties - Assertions.assertTrue(dnsZone.name().startsWith(topLevelDomain)); - Assertions.assertTrue(dnsZone.nameServers().size() > 0); // Default '@' name servers - Assertions.assertTrue(dnsZone.tags().size() == 2); - - // Check SOA record - external child resource (created by default) - SoaRecordSet soaRecordSet = dnsZone.getSoaRecordSet(); - Assertions.assertTrue(soaRecordSet.name().startsWith("@")); - SoaRecord soaRecord = soaRecordSet.record(); - Assertions.assertNotNull(soaRecord); - - // Check explicitly created external child resources [A, AAAA, MX, NS, TXT, SRV, PTR, CNAME] - // - - // Check A records - PagedIterable aRecordSets = dnsZone.aRecordSets().list(); - Assertions.assertTrue(aRecordSets.stream().count() == 1); - Assertions.assertTrue(aRecordSets.iterator().next().timeToLive() == 7200); - - // Check AAAA records - PagedIterable aaaaRecordSets = dnsZone.aaaaRecordSets().list(); - Assertions.assertTrue(aaaaRecordSets.stream().count() == 1); - Assertions.assertTrue(aaaaRecordSets.iterator().next().name().startsWith("www")); - Assertions.assertTrue(aaaaRecordSets.iterator().next().ipv6Addresses().size() == 2); - - // Check MX records - PagedIterable mxRecordSets = dnsZone.mxRecordSets().list(); - Assertions.assertTrue(mxRecordSets.stream().count() == 1); - MxRecordSet mxRecordSet = mxRecordSets.iterator().next(); - Assertions.assertNotNull(mxRecordSet); - Assertions.assertTrue(mxRecordSet.name().startsWith("email")); - Assertions.assertTrue(mxRecordSet.metadata().size() == 2); - Assertions.assertTrue(mxRecordSet.records().size() == 2); - for (MxRecord mxRecord : mxRecordSet.records()) { - Assertions.assertTrue(mxRecord.exchange().startsWith("mail.contoso-mail-exchange1.com") - || mxRecord.exchange().startsWith("mail.contoso-mail-exchange2.com")); - Assertions.assertTrue(mxRecord.preference() == 1 - || mxRecord.preference() == 2); - } - - // Check NS records - PagedIterable nsRecordSets = dnsZone.nsRecordSets().list(); - Assertions.assertTrue(nsRecordSets.stream().count() == 2); // One created above with name 'partners' + the default '@' - - // Check TXT records - PagedIterable txtRecordSets = dnsZone.txtRecordSets().list(); - Assertions.assertTrue(txtRecordSets.stream().count() == 2); - - // Check SRV records - PagedIterable srvRecordSets = dnsZone.srvRecordSets().list(); - Assertions.assertTrue(srvRecordSets.stream().count() == 1); - - // Check PTR records - PagedIterable ptrRecordSets = dnsZone.ptrRecordSets().list(); - Assertions.assertTrue(ptrRecordSets.stream().count() == 2); - - // Check CNAME records - PagedIterable cnameRecordSets = dnsZone.cNameRecordSets().list(); - Assertions.assertTrue(cnameRecordSets.stream().count() == 2); - - // Check Generic record set listing - PagedIterable recordSets = dnsZone.listRecordSets(); - HashMap typeToCount = new HashMap(); - typeToCount.put(RecordType.A, 0); - typeToCount.put(AAAA, 0); - typeToCount.put(RecordType.CNAME, 0); - typeToCount.put(MX, 0); - typeToCount.put(NS, 0); - typeToCount.put(PTR, 0); - typeToCount.put(SOA, 0); - typeToCount.put(SRV, 0); - typeToCount.put(TXT, 0); - for (DnsRecordSet recordSet : recordSets) { - Assertions.assertNotNull(recordSet); - switch (recordSet.recordType()) { - case TXT: - TxtRecordSet txtRS = (TxtRecordSet) recordSet; - Assertions.assertNotNull(txtRS); - typeToCount.put(TXT, typeToCount.get(TXT) + 1); - break; - case SRV: - SrvRecordSet srvRS = (SrvRecordSet) recordSet; - Assertions.assertNotNull(srvRS); - typeToCount.put(SRV, typeToCount.get(SRV) + 1); - break; - case SOA: - SoaRecordSet soaRS = (SoaRecordSet) recordSet; - Assertions.assertNotNull(soaRS); - typeToCount.put(SOA, typeToCount.get(SOA) + 1); - break; - case PTR: - PtrRecordSet ptrRS = (PtrRecordSet) recordSet; - Assertions.assertNotNull(ptrRS); - typeToCount.put(PTR, typeToCount.get(PTR) + 1); - break; - case A: - ARecordSet aRS = (ARecordSet) recordSet; - Assertions.assertNotNull(aRS); - typeToCount.put(RecordType.A, typeToCount.get(RecordType.A) + 1); - break; - case AAAA: - AaaaRecordSet aaaaRS = (AaaaRecordSet) recordSet; - Assertions.assertNotNull(aaaaRS); - typeToCount.put(AAAA, typeToCount.get(AAAA) + 1); - break; - case CNAME: - CnameRecordSet cnameRS = (CnameRecordSet) recordSet; - Assertions.assertNotNull(cnameRS); - typeToCount.put(RecordType.CNAME, typeToCount.get(RecordType.CNAME) + 1); - break; - case MX: - MxRecordSet mxRS = (MxRecordSet) recordSet; - Assertions.assertNotNull(mxRS); - typeToCount.put(MX, typeToCount.get(MX) + 1); - break; - case NS: - NsRecordSet nsRS = (NsRecordSet) recordSet; - Assertions.assertNotNull(nsRS); - typeToCount.put(NS, typeToCount.get(NS) + 1); - break; - default: - Assertions.assertNotNull(recordSet); - } - } - Assertions.assertTrue(typeToCount.get(SOA) == 1); - Assertions.assertTrue(typeToCount.get(RecordType.A) == 1); - Assertions.assertTrue(typeToCount.get(AAAA) == 1); - Assertions.assertTrue(typeToCount.get(MX) == 1); - Assertions.assertTrue(typeToCount.get(NS) == 2); - Assertions.assertTrue(typeToCount.get(TXT) == 2); - Assertions.assertTrue(typeToCount.get(SRV) == 1); - Assertions.assertTrue(typeToCount.get(PTR) == 2); - Assertions.assertTrue(typeToCount.get(RecordType.CNAME) == 2); - return dnsZone; - } - - @Override - public DnsZone updateResource(DnsZone dnsZone) throws Exception { - dnsZone.update() - .withoutTxtRecordSet("www") - .withoutCNameRecordSet("userguide") - .withCNameRecordSet("help", "doc.contoso.com") - .updateNSRecordSet("partners") - .withoutNameServer("ns4-05.azure-dns.info") - .withNameServer("ns4-06.azure-dns.info") - .parent() - .updateARecordSet("www") - .withoutIPv4Address("23.96.104.40") - .withIPv4Address("23.96.104.42") - .parent() - .updateSrvRecordSet("_sip._tcp") - .withoutRecord("bigbox.contoso-service.com", 5060, 10, 60) - .withRecord("mainbox.contoso-service.com", 5060, 10, 60) - .parent() - .updateSoaRecord() - .withNegativeResponseCachingTimeToLiveInSeconds(600) - .withTimeToLive(7200) - .parent() - .defineMXRecordSet("email-internal") - .withMailExchange("mail.contoso-mail-exchange1.com", 1) - .withMailExchange("mail.contoso-mail-exchange2.com", 2) - .attach() - .apply(); - - // Check TXT records - PagedIterable txtRecordSets = dnsZone.txtRecordSets().list(); - Assertions.assertEquals(txtRecordSets.stream().count(), 1); - - // Check CNAME records - PagedIterable cnameRecordSets = dnsZone.cNameRecordSets().list(); - Assertions.assertEquals(cnameRecordSets.stream().count(), 2); - for (CnameRecordSet cnameRecordSet : cnameRecordSets) { - Assertions.assertTrue(cnameRecordSet.canonicalName().startsWith("doc.contoso.com")); - Assertions.assertTrue(cnameRecordSet.name().startsWith("documents") - || cnameRecordSet.name().startsWith("help")); - } - - // Check NS records - PagedIterable nsRecordSets = dnsZone.nsRecordSets().list(); - Assertions.assertTrue(nsRecordSets.stream().count() == 2); // One created above with name 'partners' + the default '@' - for (NsRecordSet nsRecordSet : nsRecordSets) { - Assertions.assertTrue(nsRecordSet.name().startsWith("partners") || nsRecordSet.name().startsWith("@")); - if (nsRecordSet.name().startsWith("partners")) { - Assertions.assertEquals(nsRecordSet.nameServers().size(), 4); - for (String nameServer : nsRecordSet.nameServers()) { - Assertions.assertFalse(nameServer.startsWith("ns4-05.azure-dns.info")); - } - } - } - - // Check A records - PagedIterable aRecordSets = dnsZone.aRecordSets().list(); - Assertions.assertEquals(aRecordSets.stream().count(), 1); - ARecordSet aRecordSet = aRecordSets.iterator().next(); - Assertions.assertEquals(aRecordSet.ipv4Addresses().size(), 2); - for (String ipV4Address : aRecordSet.ipv4Addresses()) { - Assertions.assertFalse(ipV4Address.startsWith("23.96.104.40")); - } - - // Check SRV records - PagedIterable srvRecordSets = dnsZone.srvRecordSets().list(); - Assertions.assertTrue(srvRecordSets.stream().count() == 1); - SrvRecordSet srvRecordSet = srvRecordSets.iterator().next(); - Assertions.assertTrue(srvRecordSet.records().size() == 4); - for (SrvRecord srvRecord : srvRecordSet.records()) { - Assertions.assertFalse(srvRecord.target().startsWith("bigbox.contoso-service.com")); - } - - // Check SOA Records - SoaRecordSet soaRecordSet = dnsZone.getSoaRecordSet(); - Assertions.assertTrue(soaRecordSet.name().startsWith("@")); - SoaRecord soaRecord = soaRecordSet.record(); - Assertions.assertNotNull(soaRecord); - Assertions.assertEquals(soaRecord.minimumTtl(), Long.valueOf(600)); - Assertions.assertTrue(soaRecordSet.timeToLive() == 7200); - - // Check MX records - PagedIterable mxRecordSets = dnsZone.mxRecordSets().list(); - Assertions.assertTrue(mxRecordSets.stream().count() == 2); - - dnsZone.update() - .updateMXRecordSet("email") - .withoutMailExchange("mail.contoso-mail-exchange2.com", 2) - .withoutMetadata("mxa") - .withMetadata("mxc", "mxcc") - .withMetadata("mxd", "mxdd") - .parent() - .withTag("d", "dd") - .apply(); - - Assertions.assertTrue(dnsZone.tags().size() == 3); - // Check "mail" MX record - MxRecordSet mxRecordSet = dnsZone.mxRecordSets().getByName("email"); - Assertions.assertTrue(mxRecordSet.records().size() == 1); - Assertions.assertTrue(mxRecordSet.metadata().size() == 3); - Assertions.assertTrue(mxRecordSet.records().get(0).exchange().startsWith("mail.contoso-mail-exchange1.com")); - - return dnsZone; - } - - @Override - public void print(DnsZone dnsZone) { - StringBuilder info = new StringBuilder(); - info.append("Dns Zone: ").append(dnsZone.id()) - .append("\n\tName (Top level domain): ").append(dnsZone.name()) - .append("\n\tResource group: ").append(dnsZone.resourceGroupName()) - .append("\n\tRegion: ").append(dnsZone.regionName()) - .append("\n\tTags: ").append(dnsZone.tags()) - .append("\n\tName servers:"); - for (String nameServer: dnsZone.nameServers()) { - info.append("\n\t\t").append(nameServer); - } - SoaRecordSet soaRecordSet = dnsZone.getSoaRecordSet(); - SoaRecord soaRecord = soaRecordSet.record(); - info.append("\n\tSOA Record:") - .append("\n\t\tHost:").append(soaRecord.host()) - .append("\n\t\tEmail:").append(soaRecord.email()) - .append("\n\t\tExpire time (seconds):").append(soaRecord.expireTime()) - .append("\n\t\tRefresh time (seconds):").append(soaRecord.refreshTime()) - .append("\n\t\tRetry time (seconds):").append(soaRecord.retryTime()) - .append("\n\t\tNegative response cache ttl (seconds):").append(soaRecord.minimumTtl()) - .append("\n\t\tTTL (seconds):").append(soaRecordSet.timeToLive()); - - PagedIterable aRecordSets = dnsZone.aRecordSets().list(); - info.append("\n\tA Record sets:"); - for (ARecordSet aRecordSet : aRecordSets) { - info.append("\n\t\tId: ").append(aRecordSet.id()) - .append("\n\t\tName: ").append(aRecordSet.name()) - .append("\n\t\tTTL (seconds): ").append(aRecordSet.timeToLive()) - .append("\n\t\tIP v4 addresses: "); - for (String ipAddress : aRecordSet.ipv4Addresses()) { - info.append("\n\t\t\t").append(ipAddress); - } - } - - PagedIterable aaaaRecordSets = dnsZone.aaaaRecordSets().list(); - info.append("\n\tAAAA Record sets:"); - for (AaaaRecordSet aaaaRecordSet : aaaaRecordSets) { - info.append("\n\t\tId: ").append(aaaaRecordSet.id()) - .append("\n\t\tName: ").append(aaaaRecordSet.name()) - .append("\n\t\tTTL (seconds): ").append(aaaaRecordSet.timeToLive()) - .append("\n\t\tIP v6 addresses: "); - for (String ipAddress : aaaaRecordSet.ipv6Addresses()) { - info.append("\n\t\t\t").append(ipAddress); - } - } - - PagedIterable cnameRecordSets = dnsZone.cNameRecordSets().list(); - info.append("\n\tCNAME Record sets:"); - for (CnameRecordSet cnameRecordSet : cnameRecordSets) { - info.append("\n\t\tId: ").append(cnameRecordSet.id()) - .append("\n\t\tName: ").append(cnameRecordSet.name()) - .append("\n\t\tTTL (seconds): ").append(cnameRecordSet.timeToLive()) - .append("\n\t\tCanonical name: ").append(cnameRecordSet.canonicalName()); - } - - PagedIterable mxRecordSets = dnsZone.mxRecordSets().list(); - info.append("\n\tMX Record sets:"); - for (MxRecordSet mxRecordSet : mxRecordSets) { - info.append("\n\t\tId: ").append(mxRecordSet.id()) - .append("\n\t\tName: ").append(mxRecordSet.name()) - .append("\n\t\tTTL (seconds): ").append(mxRecordSet.timeToLive()) - .append("\n\t\tRecords: "); - for (MxRecord mxRecord : mxRecordSet.records()) { - info.append("\n\t\t\tExchange server, Preference: ") - .append(mxRecord.exchange()) - .append(" ") - .append(mxRecord.preference()); - } - } - - PagedIterable nsRecordSets = dnsZone.nsRecordSets().list(); - info.append("\n\tNS Record sets:"); - for (NsRecordSet nsRecordSet : nsRecordSets) { - info.append("\n\t\tId: ").append(nsRecordSet.id()) - .append("\n\t\tName: ").append(nsRecordSet.name()) - .append("\n\t\tTTL (seconds): ").append(nsRecordSet.timeToLive()) - .append("\n\t\tName servers: "); - for (String nameServer : nsRecordSet.nameServers()) { - info.append("\n\t\t\t").append(nameServer); - } - } - - PagedIterable ptrRecordSets = dnsZone.ptrRecordSets().list(); - info.append("\n\tPTR Record sets:"); - for (PtrRecordSet ptrRecordSet : ptrRecordSets) { - info.append("\n\t\tId: ").append(ptrRecordSet.id()) - .append("\n\t\tName: ").append(ptrRecordSet.name()) - .append("\n\t\tTTL (seconds): ").append(ptrRecordSet.timeToLive()) - .append("\n\t\tTarget domain names: "); - for (String domainNames : ptrRecordSet.targetDomainNames()) { - info.append("\n\t\t\t").append(domainNames); - } - } - - PagedIterable srvRecordSets = dnsZone.srvRecordSets().list(); - info.append("\n\tSRV Record sets:"); - for (SrvRecordSet srvRecordSet : srvRecordSets) { - info.append("\n\t\tId: ").append(srvRecordSet.id()) - .append("\n\t\tName: ").append(srvRecordSet.name()) - .append("\n\t\tTTL (seconds): ").append(srvRecordSet.timeToLive()) - .append("\n\t\tRecords: "); - for (SrvRecord srvRecord : srvRecordSet.records()) { - info.append("\n\t\t\tTarget, Port, Priority, Weight: ") - .append(srvRecord.target()) - .append(", ") - .append(srvRecord.port()) - .append(", ") - .append(srvRecord.priority()) - .append(", ") - .append(srvRecord.weight()); - } - } - - PagedIterable txtRecordSets = dnsZone.txtRecordSets().list(); - info.append("\n\tTXT Record sets:"); - for (TxtRecordSet txtRecordSet : txtRecordSets) { - info.append("\n\t\tId: ").append(txtRecordSet.id()) - .append("\n\t\tName: ").append(txtRecordSet.name()) - .append("\n\t\tTTL (seconds): ").append(txtRecordSet.timeToLive()) - .append("\n\t\tRecords: "); - for (TxtRecord txtRecord : txtRecordSet.records()) { - if (txtRecord.value().size() > 0) { - info.append("\n\t\t\tValue: ").append(txtRecord.value().get(0)); - } - } - } - System.out.println(info.toString()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestExpressRouteCircuit.java b/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestExpressRouteCircuit.java deleted file mode 100644 index 97c5f855e94d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestExpressRouteCircuit.java +++ /dev/null @@ -1,149 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager; - -import com.azure.resourcemanager.network.models.ExpressRouteCircuit; -import com.azure.resourcemanager.network.models.ExpressRouteCircuitSkuType; -import com.azure.resourcemanager.network.models.ExpressRouteCircuits; -import com.azure.resourcemanager.network.models.ExpressRoutePeeringType; -import com.azure.core.management.Region; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import com.azure.resourcemanager.test.ResourceManagerTestBase; -import org.junit.jupiter.api.Assertions; - -/** Tests Express Route Circuit. */ -public class TestExpressRouteCircuit { - private String testId = ""; - private static final Region REGION = ResourceManagerTestBase.locationOrDefault(Region.ASIA_SOUTHEAST); - private String circuitName; - - private void initializeResourceNames(ResourceManagerUtils.InternalRuntimeContext internalContext) { - testId = internalContext.randomResourceName("", 8); - circuitName = "erc" + testId; - } - - /** Test Express Route Circuit Create and Update. */ - public class Basic extends TestTemplate { - @Override - public ExpressRouteCircuit createResource(ExpressRouteCircuits expressRouteCircuits) throws Exception { - initializeResourceNames(expressRouteCircuits.manager().resourceManager().internalContext()); - - // create Express Route Circuit - ExpressRouteCircuit erc = - expressRouteCircuits - .define(circuitName) - .withRegion(REGION) - .withNewResourceGroup() - .withServiceProvider("Microsoft ER Test") - .withPeeringLocation("Area51") - .withBandwidthInMbps(50) - .withSku(ExpressRouteCircuitSkuType.STANDARD_METEREDDATA) - .withTag("tag1", "value1") - .create(); - return erc; - } - - @Override - public ExpressRouteCircuit updateResource(ExpressRouteCircuit resource) throws Exception { - resource - .update() - .withTag("tag2", "value2") - .withoutTag("tag1") - .withBandwidthInMbps(200) - .withSku(ExpressRouteCircuitSkuType.PREMIUM_UNLIMITEDDATA) - .apply(); - resource.refresh(); - Assertions.assertTrue(resource.tags().containsKey("tag2")); - Assertions.assertTrue(!resource.tags().containsKey("tag1")); - Assertions.assertEquals(Integer.valueOf(200), resource.serviceProviderProperties().bandwidthInMbps()); - Assertions.assertEquals(ExpressRouteCircuitSkuType.PREMIUM_UNLIMITEDDATA, resource.sku()); - - // resource.updateTags() - // .withTag("tag3", "value3") - // .withoutTag("tag2") - // .applyTags(); - // Assertions.assertEquals("value3", resource.tags().get("tag3")); - // Assertions.assertFalse(resource.tags().containsKey("tag2")); - - return resource; - } - - @Override - public void print(ExpressRouteCircuit resource) { - printExpressRouteCircuit(resource); - } - } - - /** Test Virtual Network Gateway Create and Update. */ - public class ExpressRouteCircuitPeering extends TestTemplate { - @Override - public ExpressRouteCircuit createResource(ExpressRouteCircuits expressRouteCircuits) throws Exception { - initializeResourceNames(expressRouteCircuits.manager().resourceManager().internalContext()); - - // create Express Route Circuit - ExpressRouteCircuit erc = - expressRouteCircuits - .define(circuitName) - .withRegion(REGION) - .withNewResourceGroup() - .withServiceProvider("Microsoft ER Test") - .withPeeringLocation("Area51") - .withBandwidthInMbps(50) - .withSku(ExpressRouteCircuitSkuType.PREMIUM_METEREDDATA) - .withTag("tag1", "value1") - .create(); - erc - .peerings() - .defineMicrosoftPeering() - .withAdvertisedPublicPrefixes("123.1.0.0/24") - .withPrimaryPeerAddressPrefix("123.0.0.0/30") - .withSecondaryPeerAddressPrefix("123.0.0.4/30") - .withVlanId(200) - .withPeerAsn(100) - .create(); - Assertions.assertEquals(erc.peeringsMap().size(), 1); - return erc; - } - - @Override - public ExpressRouteCircuit updateResource(ExpressRouteCircuit resource) throws Exception { - Assertions - .assertTrue(resource.peeringsMap().containsKey(ExpressRoutePeeringType.MICROSOFT_PEERING.toString())); - com.azure.resourcemanager.network.models.ExpressRouteCircuitPeering peering = - resource - .peeringsMap() - .get(ExpressRoutePeeringType.MICROSOFT_PEERING.toString()) - .update() - .withVlanId(300) - .withPeerAsn(101) - .withSecondaryPeerAddressPrefix("123.0.0.8/30") - .apply(); - Assertions.assertEquals(300, peering.vlanId()); - Assertions.assertEquals(101, peering.peerAsn()); - Assertions.assertEquals("123.0.0.8/30", peering.secondaryPeerAddressPrefix()); - return resource; - } - - @Override - public void print(ExpressRouteCircuit resource) { - printExpressRouteCircuit(resource); - } - } - - private static void printExpressRouteCircuit(ExpressRouteCircuit resource) { - StringBuilder info = new StringBuilder(); - info - .append("Express Route Circuit: ") - .append(resource.id()) - .append("\n\tName: ") - .append(resource.name()) - .append("\n\tResource group: ") - .append(resource.resourceGroupName()) - .append("\n\tRegion: ") - .append(resource.regionName()) - .append("\n\tTags: ") - .append(resource.tags()); - System.out.println(info.toString()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestKubernetesCluster.java b/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestKubernetesCluster.java deleted file mode 100644 index ca80530fa4f3..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestKubernetesCluster.java +++ /dev/null @@ -1,159 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager; - -import com.azure.core.util.serializer.JacksonAdapter; -import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.resourcemanager.containerservice.models.AgentPoolMode; -import com.azure.resourcemanager.containerservice.models.ContainerServiceVMSizeTypes; -import com.azure.resourcemanager.containerservice.models.KubernetesCluster; -import com.azure.resourcemanager.containerservice.models.KubernetesClusters; -import com.azure.core.management.Region; -import com.azure.resourcemanager.test.ResourceManagerTestBase; -import org.junit.jupiter.api.Assertions; - -import java.io.File; -import java.io.FileInputStream; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Properties; - -public class TestKubernetesCluster extends TestTemplate { - @Override - public KubernetesCluster createResource(KubernetesClusters kubernetesClusters) throws Exception { - final String sshKeyData = ResourceManagerTestBase.sshPublicKey(); - - final String newName = "aks" + kubernetesClusters.manager().resourceManager().internalContext().randomResourceName("", 8); - final String dnsPrefix = "dns" + newName; - final String agentPoolName = "ap" + newName; - String clientId = "clientId"; - String secret = "secret"; - - // aks can use another azure auth rather than original client auth to access azure service. - // Thus, set it to AZURE_AUTH_LOCATION_2 when you want. - String envSecondaryServicePrincipal = System.getenv("AZURE_AUTH_LOCATION_2"); - if (envSecondaryServicePrincipal == null - || envSecondaryServicePrincipal.isEmpty() - || !(new File(envSecondaryServicePrincipal).exists())) { - envSecondaryServicePrincipal = System.getenv("AZURE_AUTH_LOCATION"); - } - - try { - HashMap credentialsMap = parseAuthFile(envSecondaryServicePrincipal); - clientId = credentialsMap.get("clientId"); - secret = credentialsMap.get("clientSecret"); - } catch (Exception e) { - } - - KubernetesCluster resource = - kubernetesClusters - .define(newName) - .withRegion(ResourceManagerTestBase.locationOrDefault(Region.US_EAST)) - .withNewResourceGroup() - .withDefaultVersion() - .withRootUsername("aksadmin") - .withSshKey(sshKeyData) - .withServicePrincipalClientId(clientId) - .withServicePrincipalSecret(secret) - .defineAgentPool(agentPoolName) - .withVirtualMachineSize(ContainerServiceVMSizeTypes.STANDARD_D2_V2) - .withAgentPoolVirtualMachineCount(1) - .withAgentPoolMode(AgentPoolMode.SYSTEM) - .attach() - .withDnsPrefix(dnsPrefix) - .withTag("tag1", "value1") - .create(); - Assertions.assertNotNull(resource.id(), "Container service not found."); - Assertions.assertEquals(ResourceManagerTestBase.locationOrDefault(Region.US_EAST), resource.region()); - Assertions.assertEquals("aksadmin", resource.linuxRootUsername()); - Assertions.assertEquals(1, resource.agentPools().size()); - Assertions.assertNotNull(resource.agentPools().get(agentPoolName)); - Assertions.assertEquals(1, resource.agentPools().get(agentPoolName).count()); - Assertions - .assertEquals( - ContainerServiceVMSizeTypes.STANDARD_D2_V2, resource.agentPools().get(agentPoolName).vmSize()); - Assertions.assertTrue(resource.tags().containsKey("tag1")); - - resource = kubernetesClusters.getByResourceGroup(resource.resourceGroupName(), newName); - - byte[] kubeConfigAdmin = resource.adminKubeConfigContent(); - Assertions.assertTrue(kubeConfigAdmin != null && kubeConfigAdmin.length > 0); - byte[] kubeConfigUser = resource.userKubeConfigContent(); - Assertions.assertTrue(kubeConfigUser != null && kubeConfigUser.length > 0); - - return resource; - } - - @Override - public KubernetesCluster updateResource(KubernetesCluster resource) throws Exception { - String agentPoolName = new ArrayList<>(resource.agentPools().keySet()).get(0); - // Modify existing container service - resource = - resource - .update() - .updateAgentPool(agentPoolName) - .withAgentPoolVirtualMachineCount(5) - .parent() - .withTag("tag2", "value2") - .withTag("tag3", "value3") - .withoutTag("tag1") - .apply(); - - Assertions.assertEquals(1, resource.agentPools().size()); - Assertions - .assertTrue(resource.agentPools().get(agentPoolName).count() == 5, "Agent pool count was not updated."); - Assertions.assertTrue(resource.tags().containsKey("tag2")); - Assertions.assertTrue(!resource.tags().containsKey("tag1")); - return resource; - } - - @Override - public void print(KubernetesCluster resource) { - System - .out - .println( - new StringBuilder() - .append("Container Service: ") - .append(resource.id()) - .append("Name: ") - .append(resource.name()) - .append("\n\tResource group: ") - .append(resource.resourceGroupName()) - .append("\n\tRegion: ") - .append(resource.region()) - .append("\n\tTags: ") - .append(resource.tags()) - .toString()); - } - - /** - * Parse azure auth to hashmap - * - * @param authFilename the azure auth location - * @return all fields in azure auth json - * @throws Exception exception - */ - private static HashMap parseAuthFile(String authFilename) throws Exception { - String content = new String(Files.readAllBytes(new File(authFilename).toPath()), StandardCharsets.UTF_8).trim(); - HashMap auth = new HashMap<>(); - if (isJsonBased(content)) { - auth = new JacksonAdapter().deserialize(content, auth.getClass(), SerializerEncoding.JSON); - } else { - Properties authSettings = new Properties(); - FileInputStream credentialsFileStream = new FileInputStream(new File(authFilename)); - authSettings.load(credentialsFileStream); - credentialsFileStream.close(); - - for (final String authName : authSettings.stringPropertyNames()) { - auth.put(authName, authSettings.getProperty(authName)); - } - } - return auth; - } - - private static boolean isJsonBased(String content) { - return content.startsWith("{"); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestLoadBalancer.java b/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestLoadBalancer.java deleted file mode 100644 index 0baa54e233f7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestLoadBalancer.java +++ /dev/null @@ -1,1310 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager; - -import com.azure.resourcemanager.compute.models.AvailabilitySet; -import com.azure.resourcemanager.compute.models.AvailabilitySetSkuTypes; -import com.azure.resourcemanager.compute.models.KnownLinuxVirtualMachineImage; -import com.azure.resourcemanager.compute.models.VirtualMachine; -import com.azure.resourcemanager.compute.models.VirtualMachineSizeTypes; -import com.azure.resourcemanager.compute.ComputeManager; -import com.azure.resourcemanager.network.models.IpAllocationMethod; -import com.azure.resourcemanager.network.models.LoadBalancer; -import com.azure.resourcemanager.network.models.LoadBalancerBackend; -import com.azure.resourcemanager.network.models.LoadBalancerFrontend; -import com.azure.resourcemanager.network.models.LoadBalancerHttpProbe; -import com.azure.resourcemanager.network.models.LoadBalancerInboundNatPool; -import com.azure.resourcemanager.network.models.LoadBalancerInboundNatRule; -import com.azure.resourcemanager.network.models.LoadBalancerPrivateFrontend; -import com.azure.resourcemanager.network.models.LoadBalancerProbe; -import com.azure.resourcemanager.network.models.LoadBalancerPublicFrontend; -import com.azure.resourcemanager.network.models.LoadBalancerSkuType; -import com.azure.resourcemanager.network.models.LoadBalancerTcpProbe; -import com.azure.resourcemanager.network.models.LoadBalancers; -import com.azure.resourcemanager.network.models.LoadBalancingRule; -import com.azure.resourcemanager.network.models.LoadDistribution; -import com.azure.resourcemanager.network.models.Network; -import com.azure.resourcemanager.network.models.NetworkInterface; -import com.azure.resourcemanager.network.models.Networks; -import com.azure.resourcemanager.network.models.PublicIpAddress; -import com.azure.resourcemanager.network.models.PublicIpAddresses; -import com.azure.resourcemanager.network.models.TransportProtocol; -import com.azure.resourcemanager.resources.fluentcore.arm.AvailabilityZoneId; -import com.azure.core.management.Region; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.CreatedResources; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import com.azure.resourcemanager.test.ResourceManagerTestBase; -import org.junit.jupiter.api.Assertions; - -/** Test of load balancer management. */ -public class TestLoadBalancer { - String testId = ""; - Region region = ResourceManagerTestBase.locationOrDefault(Region.US_WEST); - String groupName = ""; - String lbName = ""; - String[] pipNames = null; - - private void initializeResourceNames(ResourceManagerUtils.InternalRuntimeContext internalContext) { - testId = internalContext.randomResourceName("", 8); - groupName = "rg" + testId; - lbName = "lb" + testId; - pipNames = new String[] {"pipa" + testId, "pipb" + testId}; - } - - /** Internet-facing LB test with NAT pool test. */ - public class InternetWithNatPool extends TestTemplate { - private final ComputeManager computeManager; - - /** - * Test of a load balancer with a NAT pool. - * - * @param computeManager compute manager - */ - public InternetWithNatPool(ComputeManager computeManager) { - initializeResourceNames(computeManager.resourceManager().internalContext()); - this.computeManager = computeManager; - } - - @Override - public void print(LoadBalancer resource) { - printLB(resource); - } - - @Override - public LoadBalancer createResource(LoadBalancers resources) throws Exception { - VirtualMachine[] existingVMs = ensureVMs(resources.manager().networks(), this.computeManager, 2); - ensurePIPs(resources.manager().publicIpAddresses()); - PublicIpAddress pip0 = resources.manager().publicIpAddresses().getByResourceGroup(groupName, pipNames[0]); - - // Create a load balancer - LoadBalancer lb = - resources - .define(lbName) - .withRegion(region) - .withExistingResourceGroup(groupName) - - // Load balancing rules - .defineLoadBalancingRule("rule1") - .withProtocol(TransportProtocol.TCP) // Required - .fromExistingPublicIPAddress(pip0) - .fromFrontendPort(81) - .toBackend("backend1") - .toBackendPort(82) // Optionals - .withProbe("tcpProbe1") - .withIdleTimeoutInMinutes(10) - .withLoadDistribution(LoadDistribution.SOURCE_IP) - .attach() - - // Inbound NAT pools - .defineInboundNatPool("natpool1") - .withProtocol(TransportProtocol.TCP) - .fromExistingPublicIPAddress(pip0) - .fromFrontendPortRange(2000, 2001) - .toBackendPort(8080) - .attach() - - // Probes (Optional) - .defineTcpProbe("tcpProbe1") - .withPort(25) // Required - .withIntervalInSeconds(15) // Optionals - .withNumberOfProbes(5) - .attach() - .defineHttpProbe("httpProbe1") - .withRequestPath("/") // Required - .withIntervalInSeconds(13) // Optionals - .withNumberOfProbes(4) - .attach() - - // Backends - .defineBackend("backend1") - .withExistingVirtualMachines(existingVMs) - .attach() - .create(); - - // Verify frontends - Assertions.assertEquals(1, lb.frontends().size()); - Assertions.assertEquals(1, lb.publicFrontends().size()); - Assertions.assertEquals(0, lb.privateFrontends().size()); - LoadBalancerFrontend frontend = lb.frontends().values().iterator().next(); - Assertions.assertTrue(frontend.isPublic()); - LoadBalancerPublicFrontend publicFrontend = (LoadBalancerPublicFrontend) frontend; - Assertions.assertTrue(pip0.id().equalsIgnoreCase(publicFrontend.publicIpAddressId())); - - // Verify backends - Assertions.assertEquals(1, lb.backends().size()); - - // Verify probes - Assertions.assertEquals(1, lb.httpProbes().size()); - Assertions.assertTrue(lb.httpProbes().containsKey("httpProbe1")); - Assertions.assertEquals(1, lb.tcpProbes().size()); - Assertions.assertTrue(lb.tcpProbes().containsKey("tcpProbe1")); - - // Verify rules - Assertions.assertEquals(1, lb.loadBalancingRules().size()); - Assertions.assertTrue(lb.loadBalancingRules().containsKey("rule1")); - LoadBalancingRule rule = lb.loadBalancingRules().get("rule1"); - Assertions.assertNotNull(rule.backend()); - Assertions.assertTrue(rule.probe().name().equalsIgnoreCase("tcpProbe1")); - - // Verify inbound NAT pools - Assertions.assertTrue(lb.inboundNatPools().containsKey("natpool1")); - Assertions.assertEquals(1, lb.inboundNatPools().size()); - LoadBalancerInboundNatPool inboundNatPool = lb.inboundNatPools().get("natpool1"); - Assertions.assertEquals(2000, inboundNatPool.frontendPortRangeStart()); - Assertions.assertEquals(2001, inboundNatPool.frontendPortRangeEnd()); - Assertions.assertEquals(8080, inboundNatPool.backendPort()); - - return lb; - } - - @Override - public LoadBalancer updateResource(LoadBalancer resource) throws Exception { - resource = - resource - .update() - .withoutBackend("backend1") - .withoutLoadBalancingRule("rule1") - .withoutInboundNatPool("natpool1") - .withoutProbe("httpProbe1") - .withoutProbe("tcpProbe1") - .withTag("tag1", "value1") - .withTag("tag2", "value2") - .apply(); - - resource.refresh(); - Assertions.assertTrue(resource.tags().containsKey("tag1")); - - // Verify frontends - Assertions.assertEquals(1, resource.frontends().size()); - Assertions.assertEquals(1, resource.publicFrontends().size()); - Assertions.assertEquals(0, resource.privateFrontends().size()); - - // Verify probes - Assertions.assertFalse(resource.httpProbes().containsKey("httpProbe1")); - Assertions.assertFalse(resource.httpProbes().containsKey("tcpProbe1")); - Assertions.assertEquals(0, resource.httpProbes().size()); - Assertions.assertEquals(0, resource.tcpProbes().size()); - - // Verify backends - Assertions.assertEquals(0, resource.backends().size()); - - // Verify rules - Assertions.assertFalse(resource.loadBalancingRules().containsKey("rule1")); - Assertions.assertEquals(0, resource.loadBalancingRules().size()); - - // Verify NAT pools - Assertions.assertFalse(resource.inboundNatPools().containsKey("natpool1")); - - return resource; - } - } - - /** Internet-facing LB test with NAT rules. */ - public class InternetWithNatRule extends TestTemplate { - private final ComputeManager computeManager; - - /** - * Tests an Internet-facing load balancer with NAT rules. - * - * @param computeManager compute manager - */ - public InternetWithNatRule(ComputeManager computeManager) { - initializeResourceNames(computeManager.resourceManager().internalContext()); - this.computeManager = computeManager; - } - - @Override - public void print(LoadBalancer resource) { - printLB(resource); - } - - @Override - public LoadBalancer createResource(LoadBalancers resources) throws Exception { - VirtualMachine[] existingVMs = ensureVMs(resources.manager().networks(), this.computeManager, 2); - ensurePIPs(resources.manager().publicIpAddresses()); - PublicIpAddress pip = resources.manager().publicIpAddresses().getByResourceGroup(groupName, pipNames[0]); - NetworkInterface nic1 = existingVMs[0].getPrimaryNetworkInterface(); - NetworkInterface nic2 = existingVMs[1].getPrimaryNetworkInterface(); - - // Create a load balancer - LoadBalancer lb = - resources - .define(lbName) - .withRegion(region) - .withExistingResourceGroup(groupName) - - // Load balancing rules - .defineLoadBalancingRule("rule1") - .withProtocol(TransportProtocol.TCP) // Required - .fromExistingPublicIPAddress(pip) - .fromFrontendPort(81) - .toBackend("backend1") - .toBackendPort(82) // Optionals - .withProbe("tcpProbe1") - .withIdleTimeoutInMinutes(10) - .withLoadDistribution(LoadDistribution.SOURCE_IP) - .attach() - - // Inbound NAT rules - .defineInboundNatRule("natrule1") - .withProtocol(TransportProtocol.TCP) - .fromExistingPublicIPAddress(pip) // Implicitly uses the same frontend because the PIP is the same - .fromFrontendPort(88) - .attach() - - // Probes (Optional) - .defineTcpProbe("tcpProbe1") - .withPort(25) // Required - .withIntervalInSeconds(15) // Optionals - .withNumberOfProbes(5) - .attach() - .defineHttpProbe("httpProbe1") - .withRequestPath("/") // Required - .withIntervalInSeconds(13) // Optionals - .withNumberOfProbes(4) - .attach() - .create(); - - String backendName = lb.backends().values().iterator().next().name(); - String frontendName = lb.frontends().values().iterator().next().name(); - - // Connect NICs explicitly - nic1 - .update() - .withExistingLoadBalancerBackend(lb, backendName) - .withExistingLoadBalancerInboundNatRule(lb, "natrule1") - .apply(); - TestNetworkInterface.printNic(nic1); - Assertions - .assertTrue( - nic1 - .primaryIPConfiguration() - .listAssociatedLoadBalancerBackends() - .get(0) - .name() - .equalsIgnoreCase(backendName)); - Assertions - .assertTrue( - nic1 - .primaryIPConfiguration() - .listAssociatedLoadBalancerInboundNatRules() - .get(0) - .name() - .equalsIgnoreCase("natrule1")); - - nic2.update().withExistingLoadBalancerBackend(lb, backendName).apply(); - TestNetworkInterface.printNic(nic2); - Assertions - .assertTrue( - nic2 - .primaryIPConfiguration() - .listAssociatedLoadBalancerBackends() - .get(0) - .name() - .equalsIgnoreCase(backendName)); - - // Verify frontends - Assertions.assertEquals(1, lb.frontends().size()); - Assertions.assertEquals(1, lb.publicFrontends().size()); - Assertions.assertEquals(0, lb.privateFrontends().size()); - LoadBalancerFrontend frontend = lb.frontends().get(frontendName); - Assertions.assertNotNull(frontend); - Assertions.assertTrue(frontend.isPublic()); - LoadBalancerPublicFrontend publicFrontend = (LoadBalancerPublicFrontend) frontend; - Assertions.assertTrue(pip.id().equalsIgnoreCase(publicFrontend.publicIpAddressId())); - - pip.refresh(); - Assertions.assertTrue(pip.getAssignedLoadBalancerFrontend().name().equalsIgnoreCase(frontendName)); - TestPublicIPAddress.printPIP(pip.refresh()); - - // Verify backends - Assertions.assertTrue(lb.backends().containsKey(backendName)); - Assertions.assertEquals(1, lb.backends().size()); - - // Verify probes - Assertions.assertTrue(lb.httpProbes().containsKey("httpProbe1")); - Assertions.assertEquals(1, lb.httpProbes().size()); - Assertions.assertTrue(lb.tcpProbes().containsKey("tcpProbe1")); - Assertions.assertEquals(1, lb.tcpProbes().size()); - - // Verify rules - Assertions.assertEquals(1, lb.loadBalancingRules().size()); - Assertions.assertTrue(lb.loadBalancingRules().containsKey("rule1")); - LoadBalancingRule rule = lb.loadBalancingRules().get("rule1"); - Assertions.assertTrue(rule.backend().name().equalsIgnoreCase(backendName)); - Assertions.assertTrue(rule.frontend().name().equalsIgnoreCase(frontendName)); - Assertions.assertTrue(rule.probe().name().equalsIgnoreCase("tcpProbe1")); - - // Verify inbound NAT rules - Assertions.assertEquals(1, lb.inboundNatRules().size()); - Assertions.assertTrue(lb.inboundNatRules().containsKey("natrule1")); - LoadBalancerInboundNatRule inboundNatRule = lb.inboundNatRules().get("natrule1"); - Assertions.assertTrue(inboundNatRule.frontend().name().equalsIgnoreCase(frontendName)); - Assertions.assertEquals(88, inboundNatRule.frontendPort()); - Assertions.assertEquals(88, inboundNatRule.backendPort()); - - return lb; - } - - @Override - public LoadBalancer updateResource(LoadBalancer resource) throws Exception { - String backendName = resource.backends().values().iterator().next().name(); - String frontendName = resource.frontends().values().iterator().next().name(); - - List nics = new ArrayList<>(); - for (String nicId : resource.backends().get(backendName).backendNicIPConfigurationNames().keySet()) { - nics.add(resource.manager().networkInterfaces().getById(nicId)); - } - NetworkInterface nic1 = nics.get(0); - NetworkInterface nic2 = nics.get(1); - - // Remove the NIC associations - nic1.update().withoutLoadBalancerBackends().withoutLoadBalancerInboundNatRules().apply(); - Assertions.assertTrue(nic1.primaryIPConfiguration().listAssociatedLoadBalancerBackends().size() == 0); - - nic2.update().withoutLoadBalancerBackends().withoutLoadBalancerInboundNatRules().apply(); - Assertions.assertTrue(nic2.primaryIPConfiguration().listAssociatedLoadBalancerBackends().size() == 0); - - // Update the load balancer - ensurePIPs(resource.manager().publicIpAddresses()); - PublicIpAddress pip = resource.manager().publicIpAddresses().getByResourceGroup(groupName, pipNames[1]); - resource = - resource - .update() - .updatePublicFrontend(frontendName) - .withExistingPublicIpAddress(pip) - .parent() - .withoutLoadBalancingRule("rule1") - .withoutInboundNatRule("natrule1") - .withTag("tag1", "value1") - .withTag("tag2", "value2") - .apply(); - Assertions.assertTrue(resource.tags().containsKey("tag1")); - Assertions.assertEquals(0, resource.inboundNatRules().size()); - - // Verify frontends - LoadBalancerFrontend frontend = resource.frontends().get(frontendName); - Assertions.assertEquals(1, resource.publicFrontends().size()); - Assertions.assertEquals(0, resource.privateFrontends().size()); - Assertions.assertNotNull(frontend); - Assertions.assertTrue(frontend.isPublic()); - LoadBalancerPublicFrontend publicFrontend = (LoadBalancerPublicFrontend) frontend; - Assertions.assertTrue(pip.id().equalsIgnoreCase(publicFrontend.publicIpAddressId())); - - return resource; - } - } - - /** Internet-facing minimalistic LB test without LB rules, only a NAT rule. */ - public class InternetNatOnly extends TestTemplate { - private final ComputeManager computeManager; - - /** - * Tests an Internet-facing load balancer with a NAT rule only. - * - * @param computeManager compute manager - */ - public InternetNatOnly(ComputeManager computeManager) { - initializeResourceNames(computeManager.resourceManager().internalContext()); - this.computeManager = computeManager; - } - - @Override - public void print(LoadBalancer resource) { - printLB(resource); - } - - @Override - public LoadBalancer createResource(LoadBalancers resources) throws Exception { - VirtualMachine[] existingVMs = ensureVMs(resources.manager().networks(), computeManager, 2); - Creatable pipDef = - resources - .manager() - .publicIpAddresses() - .define(pipNames[0]) - .withRegion(region) - .withExistingResourceGroup(groupName) - .withLeafDomainLabel(pipNames[0]); - - // Create a load balancer - LoadBalancer lb = - resources - .define(lbName) - .withRegion(region) - .withExistingResourceGroup(groupName) - // Inbound NAT rule - .defineInboundNatRule("natrule1") - .withProtocol(TransportProtocol.TCP) - .fromNewPublicIPAddress(pipDef) - .fromFrontendPort(88) - .toBackendPort(80) - .attach() - // Backend - .defineBackend("backend1") - .withExistingVirtualMachines(existingVMs) - .attach() - .create(); - - // Verify frontends - Assertions.assertEquals(1, lb.frontends().size()); - Assertions.assertEquals(1, lb.publicFrontends().size()); - Assertions.assertEquals(0, lb.privateFrontends().size()); - LoadBalancerPublicFrontend frontend = lb.publicFrontends().values().iterator().next(); - Assertions.assertNotNull(frontend); - Assertions.assertNotNull(frontend.publicIpAddressId()); - - // Verify probes - Assertions.assertTrue(lb.tcpProbes().isEmpty()); - Assertions.assertTrue(lb.httpProbes().isEmpty()); - - // Verify LB rules - Assertions.assertEquals(0, lb.loadBalancingRules().size()); - - // Verify NAT rules - Assertions.assertEquals(1, lb.inboundNatRules().size()); - LoadBalancerInboundNatRule natRule = lb.inboundNatRules().get("natrule1"); - Assertions.assertNotNull(natRule); - Assertions.assertEquals(TransportProtocol.TCP, natRule.protocol()); - Assertions.assertNotNull(natRule.frontend()); - Assertions.assertTrue(natRule.frontend().isPublic()); - LoadBalancerPublicFrontend publicFrontend = (LoadBalancerPublicFrontend) natRule.frontend(); - PublicIpAddress pip = publicFrontend.getPublicIpAddress(); - Assertions.assertNotNull(pip); - Assertions.assertEquals(pip.name(), pipNames[0]); - Assertions.assertEquals(pip.leafDomainLabel(), pipNames[0]); - Assertions.assertEquals(88, natRule.frontendPort()); - - // Verify backends - Assertions.assertEquals(1, lb.backends().size()); - LoadBalancerBackend backend = lb.backends().values().iterator().next(); - Assertions.assertNotNull(backend); - Assertions.assertEquals(2, backend.backendNicIPConfigurationNames().size()); - for (VirtualMachine vm : existingVMs) { - Assertions - .assertTrue(backend.backendNicIPConfigurationNames().containsKey(vm.primaryNetworkInterfaceId())); - } - - return lb; - } - - @Override - public LoadBalancer updateResource(LoadBalancer resource) throws Exception { - LoadBalancerBackend backend = resource.backends().values().iterator().next(); - Assertions.assertNotNull(backend); - LoadBalancerInboundNatRule natRule = resource.inboundNatRules().values().iterator().next(); - Assertions.assertNotNull(natRule); - LoadBalancerPublicFrontend publicFrontend = (LoadBalancerPublicFrontend) natRule.frontend(); - PublicIpAddress pip = - resource - .manager() - .publicIpAddresses() - .define(pipNames[1]) - .withRegion(region) - .withExistingResourceGroup(groupName) - .withLeafDomainLabel(pipNames[1]) - .create(); - - resource = - resource - .update() - .updatePublicFrontend(publicFrontend.name()) - .withExistingPublicIpAddress(pip) - .parent() - .defineBackend("backend2") - .attach() - .withoutBackend(backend.name()) - .withoutInboundNatRule("natrule1") - .withTag("tag1", "value1") - .withTag("tag2", "value2") - .apply(); - Assertions.assertTrue(resource.tags().containsKey("tag1")); - - // Verify frontends - Assertions.assertEquals(1, resource.frontends().size()); - Assertions.assertEquals(1, resource.publicFrontends().size()); - Assertions.assertEquals(0, resource.privateFrontends().size()); - LoadBalancerFrontend frontend = resource.frontends().get(publicFrontend.name()); - Assertions.assertTrue(frontend.isPublic()); - publicFrontend = (LoadBalancerPublicFrontend) frontend; - Assertions.assertTrue(pip.id().equalsIgnoreCase(publicFrontend.publicIpAddressId())); - Assertions.assertEquals(0, publicFrontend.loadBalancingRules().size()); - - // Verify probes - Assertions.assertTrue(resource.tcpProbes().isEmpty()); - Assertions.assertTrue(resource.httpProbes().isEmpty()); - - // Verify backends - Assertions.assertTrue(resource.backends().containsKey("backend2")); - Assertions.assertTrue(!resource.backends().containsKey(backend.name())); - - // Verify NAT rules - Assertions.assertTrue(resource.inboundNatRules().isEmpty()); - - // Verify load balancing rules - Assertions.assertEquals(0, resource.loadBalancingRules().size()); - - return resource; - } - } - - /** Internet-facing minimalistic LB test. */ - public class InternetMinimal extends TestTemplate { - private final ComputeManager computeManager; - - /** - * Tests an Internet-facing load balancer with minimum inputs. - * - * @param computeManager compute manager - */ - public InternetMinimal(ComputeManager computeManager) { - initializeResourceNames(computeManager.resourceManager().internalContext()); - this.computeManager = computeManager; - } - - @Override - public void print(LoadBalancer resource) { - printLB(resource); - } - - @Override - public LoadBalancer createResource(LoadBalancers resources) throws Exception { - VirtualMachine[] existingVMs = ensureVMs(resources.manager().networks(), this.computeManager, 2); - String pipDnsLabel = resources.manager().resourceManager().internalContext().randomResourceName("pip", 20); - - // Create a load balancer - LoadBalancer lb = - resources - .define(lbName) - .withRegion(region) - .withExistingResourceGroup(groupName) - // LB rule - .defineLoadBalancingRule("lbrule1") - .withProtocol(TransportProtocol.TCP) - .fromNewPublicIPAddress(pipDnsLabel) - .fromFrontendPort(80) - .toExistingVirtualMachines(existingVMs) - .attach() - .create(); - - // Verify frontends - Assertions.assertEquals(1, lb.frontends().size()); - Assertions.assertEquals(1, lb.publicFrontends().size()); - Assertions.assertEquals(0, lb.privateFrontends().size()); - LoadBalancerFrontend frontend = lb.frontends().values().iterator().next(); - Assertions.assertEquals(1, frontend.loadBalancingRules().size()); - Assertions - .assertTrue( - "lbrule1".equalsIgnoreCase(frontend.loadBalancingRules().values().iterator().next().name())); - Assertions.assertTrue(frontend.isPublic()); - LoadBalancerPublicFrontend publicFrontend = (LoadBalancerPublicFrontend) frontend; - PublicIpAddress pip = publicFrontend.getPublicIpAddress(); - Assertions.assertNotNull(pip); - Assertions.assertTrue(pip.leafDomainLabel().equalsIgnoreCase(pipDnsLabel)); - - // Verify TCP probes - Assertions.assertEquals(0, lb.tcpProbes().size()); - - // Verify rules - Assertions.assertEquals(1, lb.loadBalancingRules().size()); - LoadBalancingRule lbrule = lb.loadBalancingRules().get("lbrule1"); - Assertions.assertNotNull(lbrule.frontend()); - Assertions.assertEquals(80, lbrule.backendPort()); - Assertions.assertEquals(80, lbrule.frontendPort()); - Assertions.assertNull(lbrule.probe()); - Assertions.assertEquals(TransportProtocol.TCP, lbrule.protocol()); - Assertions.assertNotNull(lbrule.backend()); - - // Verify backends - Assertions.assertEquals(1, lb.backends().size()); - LoadBalancerBackend backend = lb.backends().values().iterator().next(); - Assertions.assertNotNull(backend); - Assertions.assertEquals(2, backend.backendNicIPConfigurationNames().size()); - for (VirtualMachine vm : existingVMs) { - Assertions - .assertTrue(backend.backendNicIPConfigurationNames().containsKey(vm.primaryNetworkInterfaceId())); - } - - return lb; - } - - @Override - public LoadBalancer updateResource(LoadBalancer resource) throws Exception { - ensurePIPs(resource.manager().publicIpAddresses()); - PublicIpAddress pip = resource.manager().publicIpAddresses().getByResourceGroup(groupName, pipNames[0]); - Assertions.assertNotNull(pip); - LoadBalancerBackend backend = resource.backends().values().iterator().next(); - Assertions.assertNotNull(backend); - LoadBalancingRule lbRule = resource.loadBalancingRules().get("lbrule1"); - Assertions.assertNotNull(lbRule); - - resource = - resource - .update() - .updatePublicFrontend(lbRule.frontend().name()) - .withExistingPublicIpAddress(pip) - .parent() - .defineTcpProbe("tcpprobe") - .withPort(22) - .attach() - .defineHttpProbe("httpprobe") - .withRequestPath("/foo") - .withNumberOfProbes(3) - .withPort(443) - .attach() - .updateLoadBalancingRule("lbrule1") - .toBackendPort(8080) - .withIdleTimeoutInMinutes(11) - .withProbe("tcpprobe") - .parent() - .defineLoadBalancingRule("lbrule2") - .withProtocol(TransportProtocol.UDP) - .fromFrontend(lbRule.frontend().name()) - .fromFrontendPort(22) - .toBackend("backend2") - .withProbe("httpprobe") - .attach() - .withoutBackend(backend.name()) - .withTag("tag1", "value1") - .withTag("tag2", "value2") - .apply(); - Assertions.assertTrue(resource.tags().containsKey("tag1")); - - // Verify frontends - Assertions.assertEquals(1, resource.frontends().size()); - Assertions.assertEquals(1, resource.publicFrontends().size()); - Assertions.assertEquals(0, resource.privateFrontends().size()); - LoadBalancerFrontend frontend = lbRule.frontend(); - Assertions.assertTrue(frontend.isPublic()); - LoadBalancerPublicFrontend publicFrontend = (LoadBalancerPublicFrontend) frontend; - Assertions.assertTrue(pip.id().equalsIgnoreCase(publicFrontend.publicIpAddressId())); - Assertions.assertEquals(2, publicFrontend.loadBalancingRules().size()); - - // Verify probes - LoadBalancerTcpProbe tcpProbe = resource.tcpProbes().get("tcpprobe"); - Assertions.assertNotNull(tcpProbe); - Assertions.assertEquals(22, tcpProbe.port()); - Assertions.assertEquals(1, tcpProbe.loadBalancingRules().size()); - Assertions.assertTrue(tcpProbe.loadBalancingRules().containsKey("lbrule1")); - - LoadBalancerHttpProbe httpProbe = resource.httpProbes().get("httpprobe"); - Assertions.assertNotNull(httpProbe); - Assertions.assertEquals(3, httpProbe.numberOfProbes()); - Assertions.assertTrue("/foo".equalsIgnoreCase(httpProbe.requestPath())); - Assertions.assertTrue(httpProbe.loadBalancingRules().containsKey("lbrule2")); - - // Verify backends - Assertions.assertEquals(1, resource.backends().size()); - Assertions.assertTrue(resource.backends().containsKey("backend2")); - Assertions.assertTrue(!resource.backends().containsKey(backend.name())); - - // Verify load balancing rules - lbRule = resource.loadBalancingRules().get("lbrule1"); - Assertions.assertNotNull(lbRule); - Assertions.assertNull(lbRule.backend()); - Assertions.assertEquals(8080, lbRule.backendPort()); - Assertions.assertNotNull(lbRule.frontend()); - Assertions.assertEquals(11, lbRule.idleTimeoutInMinutes()); - Assertions.assertNotNull(lbRule.probe()); - Assertions.assertEquals(tcpProbe.name(), lbRule.probe().name()); - - lbRule = resource.loadBalancingRules().get("lbrule2"); - Assertions.assertNotNull(lbRule); - Assertions.assertEquals(22, lbRule.frontendPort()); - Assertions.assertNotNull(lbRule.frontend()); - Assertions.assertTrue("httpprobe".equalsIgnoreCase(lbRule.probe().name())); - Assertions.assertEquals(TransportProtocol.UDP, lbRule.protocol()); - Assertions.assertNotNull(lbRule.backend()); - Assertions.assertTrue("backend2".equalsIgnoreCase(lbRule.backend().name())); - - return resource; - } - } - - /** Internal minimalistic LB test. */ - public class InternalMinimal extends TestTemplate { - private final ComputeManager computeManager; - private Network network; - - /** - * Tests an internal load balancer with minimum inputs. - * - * @param computeManager compute manager - */ - public InternalMinimal(ComputeManager computeManager) { - initializeResourceNames(computeManager.resourceManager().internalContext()); - this.computeManager = computeManager; - } - - @Override - public void print(LoadBalancer resource) { - printLB(resource); - } - - @Override - public LoadBalancer createResource(LoadBalancers resources) throws Exception { - VirtualMachine[] existingVMs = ensureVMs(resources.manager().networks(), this.computeManager, 2); - - // Must use the same VNet as the VMs - this.network = existingVMs[0].getPrimaryNetworkInterface().primaryIPConfiguration().getNetwork(); - - // Create a load balancer - LoadBalancer lb = - resources - .define(lbName) - .withRegion(region) - .withExistingResourceGroup(groupName) - // LB rule - .defineLoadBalancingRule("lbrule1") - .withProtocol(TransportProtocol.TCP) - .fromExistingSubnet(network, "subnet1") - .fromFrontendPort(80) - .toExistingVirtualMachines(existingVMs) - .attach() - .create(); - - // Verify frontends - Assertions.assertEquals(1, lb.frontends().size()); - Assertions.assertEquals(1, lb.privateFrontends().size()); - Assertions.assertEquals(0, lb.publicFrontends().size()); - LoadBalancerFrontend frontend = lb.frontends().values().iterator().next(); - Assertions.assertEquals(1, frontend.loadBalancingRules().size()); - Assertions.assertFalse(frontend.isPublic()); - Assertions - .assertTrue( - "lbrule1".equalsIgnoreCase(frontend.loadBalancingRules().values().iterator().next().name())); - LoadBalancerPrivateFrontend privateFrontend = (LoadBalancerPrivateFrontend) frontend; - Assertions.assertTrue(network.id().equalsIgnoreCase(privateFrontend.networkId())); - Assertions.assertNotNull(privateFrontend.privateIpAddress()); - Assertions.assertTrue("subnet1".equalsIgnoreCase(privateFrontend.subnetName())); - Assertions.assertEquals(IpAllocationMethod.DYNAMIC, privateFrontend.privateIpAllocationMethod()); - - // Verify TCP probes - Assertions.assertEquals(0, lb.tcpProbes().size()); - - // Verify rules - Assertions.assertEquals(1, lb.loadBalancingRules().size()); - LoadBalancingRule lbrule = lb.loadBalancingRules().get("lbrule1"); - Assertions.assertNotNull(lbrule); - Assertions.assertNotNull(lbrule.frontend()); - Assertions.assertEquals(80, lbrule.backendPort()); - Assertions.assertEquals(80, lbrule.frontendPort()); - Assertions.assertNull(lbrule.probe()); - Assertions.assertEquals(TransportProtocol.TCP, lbrule.protocol()); - Assertions.assertNotNull(lbrule.backend()); - - // Verify backends - Assertions.assertEquals(1, lb.backends().size()); - LoadBalancerBackend backend = lb.backends().values().iterator().next(); - Assertions.assertNotNull(backend); - - Assertions.assertEquals(2, backend.backendNicIPConfigurationNames().size()); - for (VirtualMachine vm : existingVMs) { - Assertions - .assertTrue(backend.backendNicIPConfigurationNames().containsKey(vm.primaryNetworkInterfaceId())); - } - - return lb; - } - - @Override - public LoadBalancer updateResource(LoadBalancer resource) throws Exception { - LoadBalancerBackend backend = resource.backends().values().iterator().next(); - Assertions.assertNotNull(backend); - LoadBalancingRule lbRule = resource.loadBalancingRules().get("lbrule1"); - Assertions.assertNotNull(lbRule); - resource = - resource - .update() - .updatePrivateFrontend(lbRule.frontend().name()) - .withExistingSubnet(this.network, "subnet2") - .withPrivateIpAddressStatic("10.0.0.13") - .parent() - .defineTcpProbe("tcpprobe") - .withPort(22) - .attach() - .defineHttpProbe("httpprobe") - .withRequestPath("/foo") - .withNumberOfProbes(3) - .withPort(443) - .attach() - .updateLoadBalancingRule("lbrule1") - .toBackendPort(8080) - .withIdleTimeoutInMinutes(11) - .withProbe("tcpprobe") - .parent() - .defineLoadBalancingRule("lbrule2") - .withProtocol(TransportProtocol.UDP) - .fromFrontend(lbRule.frontend().name()) - .fromFrontendPort(22) - .toBackend("backend2") - .withProbe("httpprobe") - .attach() - .withoutBackend(backend.name()) - .withTag("tag1", "value1") - .withTag("tag2", "value2") - .apply(); - Assertions.assertTrue(resource.tags().containsKey("tag1")); - - // Verify frontends - Assertions.assertEquals(1, resource.frontends().size()); - Assertions.assertEquals(1, resource.privateFrontends().size()); - Assertions.assertEquals(0, resource.publicFrontends().size()); - LoadBalancerFrontend frontend = resource.frontends().get(lbRule.frontend().name()); - Assertions.assertNotNull(frontend); - Assertions.assertFalse(frontend.isPublic()); - LoadBalancerPrivateFrontend privateFrontend = (LoadBalancerPrivateFrontend) frontend; - Assertions.assertTrue("subnet2".equalsIgnoreCase(privateFrontend.subnetName())); - Assertions.assertEquals(IpAllocationMethod.STATIC, privateFrontend.privateIpAllocationMethod()); - Assertions.assertTrue("10.0.0.13".equalsIgnoreCase(privateFrontend.privateIpAddress())); - Assertions.assertEquals(2, privateFrontend.loadBalancingRules().size()); - - // Verify probes - Assertions.assertEquals(1, resource.tcpProbes().size()); - LoadBalancerTcpProbe tcpProbe = resource.tcpProbes().get("tcpprobe"); - Assertions.assertNotNull(tcpProbe); - Assertions.assertEquals(22, tcpProbe.port()); - Assertions.assertTrue(tcpProbe.loadBalancingRules().containsKey("lbrule1")); - - LoadBalancerHttpProbe httpProbe = resource.httpProbes().get("httpprobe"); - Assertions.assertNotNull(httpProbe); - Assertions.assertEquals(3, httpProbe.numberOfProbes()); - Assertions.assertTrue("/foo".equalsIgnoreCase(httpProbe.requestPath())); - Assertions.assertTrue(httpProbe.loadBalancingRules().containsKey("lbrule2")); - - // Verify backends - Assertions.assertEquals(1, resource.backends().size()); - Assertions.assertTrue(resource.backends().containsKey("backend2")); - Assertions.assertTrue(!resource.backends().containsKey(backend.name())); - - // Verify load balancing rules - lbRule = resource.loadBalancingRules().get("lbrule1"); - Assertions.assertNotNull(lbRule); - Assertions.assertNull(lbRule.backend()); - Assertions.assertEquals(8080, lbRule.backendPort()); - Assertions.assertNotNull(lbRule.frontend()); - Assertions.assertEquals(11, lbRule.idleTimeoutInMinutes()); - Assertions.assertNotNull(lbRule.probe()); - Assertions.assertEquals(tcpProbe.name(), lbRule.probe().name()); - - lbRule = resource.loadBalancingRules().get("lbrule2"); - Assertions.assertNotNull(lbRule); - Assertions.assertEquals(22, lbRule.frontendPort()); - Assertions.assertNotNull(lbRule.frontend()); - Assertions.assertTrue("httpprobe".equalsIgnoreCase(lbRule.probe().name())); - Assertions.assertEquals(TransportProtocol.UDP, lbRule.protocol()); - Assertions.assertNotNull(lbRule.backend()); - Assertions.assertTrue("backend2".equalsIgnoreCase(lbRule.backend().name())); - - return resource; - } - } - - /** Basic SKU load balancer with zoned private */ - public class InternalWithZone extends TestTemplate { - private final ComputeManager computeManager; - private Network network; - - /** - * Tests an internal load balancer with zoned front-end. - * - * @param computeManager compute manager - */ - public InternalWithZone(ComputeManager computeManager) { - region = ResourceManagerTestBase.locationOrDefault(Region.US_EAST2); - initializeResourceNames(computeManager.resourceManager().internalContext()); - this.computeManager = computeManager; - } - - @Override - public void print(LoadBalancer resource) { - printLB(resource); - } - - @Override - public LoadBalancer createResource(LoadBalancers resources) throws Exception { - // Basic SKU (default) LB requires the VMs to be in the same availability set - VirtualMachine[] existingVMs = ensureVMs(resources.manager().networks(), this.computeManager, 2); - - // Must use the same VNet as the VMs - this.network = existingVMs[0].getPrimaryNetworkInterface().primaryIPConfiguration().getNetwork(); - - // Create a load balancer - LoadBalancer lb = - resources - .define(lbName) - .withRegion(region) - .withExistingResourceGroup(groupName) - // LB rule - .defineLoadBalancingRule("lbrule1") - .withProtocol(TransportProtocol.TCP) - .fromFrontend("frontend-1") - .fromFrontendPort(80) - .toExistingVirtualMachines(existingVMs) - .attach() - // Private zoned front-end - .definePrivateFrontend("frontend-1") - .withExistingSubnet(network, "subnet1") - .withAvailabilityZone(AvailabilityZoneId.ZONE_1) - .attach() - .withSku(LoadBalancerSkuType.BASIC) - .create(); - - // Verify frontends - Assertions.assertEquals(1, lb.frontends().size()); - Assertions.assertEquals(1, lb.privateFrontends().size()); - Assertions.assertEquals(0, lb.publicFrontends().size()); - LoadBalancerFrontend frontend = lb.frontends().values().iterator().next(); - Assertions.assertEquals(1, frontend.loadBalancingRules().size()); - Assertions.assertFalse(frontend.isPublic()); - Assertions - .assertTrue( - "lbrule1".equalsIgnoreCase(frontend.loadBalancingRules().values().iterator().next().name())); - LoadBalancerPrivateFrontend privateFrontend = (LoadBalancerPrivateFrontend) frontend; - Assertions.assertTrue(network.id().equalsIgnoreCase(privateFrontend.networkId())); - Assertions.assertNotNull(privateFrontend.privateIpAddress()); - Assertions.assertTrue("subnet1".equalsIgnoreCase(privateFrontend.subnetName())); - Assertions.assertEquals(IpAllocationMethod.DYNAMIC, privateFrontend.privateIpAllocationMethod()); - // Verify frontend zone - Assertions.assertNotNull(privateFrontend.availabilityZones()); - Assertions.assertFalse(privateFrontend.availabilityZones().isEmpty()); - Assertions.assertTrue(privateFrontend.availabilityZones().contains(AvailabilityZoneId.ZONE_1)); - - // Verify TCP probes - Assertions.assertEquals(0, lb.tcpProbes().size()); - - // Verify rules - Assertions.assertEquals(1, lb.loadBalancingRules().size()); - LoadBalancingRule lbrule = lb.loadBalancingRules().get("lbrule1"); - Assertions.assertNotNull(lbrule); - Assertions.assertNotNull(lbrule.frontend()); - Assertions.assertEquals(80, lbrule.backendPort()); - Assertions.assertEquals(80, lbrule.frontendPort()); - Assertions.assertNull(lbrule.probe()); - Assertions.assertEquals(TransportProtocol.TCP, lbrule.protocol()); - Assertions.assertNotNull(lbrule.backend()); - - // Verify backends - Assertions.assertEquals(1, lb.backends().size()); - LoadBalancerBackend backend = lb.backends().values().iterator().next(); - Assertions.assertNotNull(backend); - - Assertions.assertEquals(2, backend.backendNicIPConfigurationNames().size()); - for (VirtualMachine vm : existingVMs) { - Assertions - .assertTrue(backend.backendNicIPConfigurationNames().containsKey(vm.primaryNetworkInterfaceId())); - } - - return lb; - } - - @Override - public LoadBalancer updateResource(LoadBalancer resource) throws Exception { - // Once zone associated with a private front-end, it cannot be removed, updated or new - // one cannot be added. - // - return resource; - } - } - - // Create VNet for the LB - private Map ensurePIPs(PublicIpAddresses pips) throws Exception { - List> creatablePips = new ArrayList<>(); - for (int i = 0; i < pipNames.length; i++) { - creatablePips - .add( - pips - .define(pipNames[i]) - .withRegion(region) - .withNewResourceGroup(groupName) - .withLeafDomainLabel(pipNames[i])); - } - - return pips.create(creatablePips); - } - - // Ensure VMs for the LB - private VirtualMachine[] ensureVMs(Networks networks, ComputeManager computeManager, int count) throws Exception { - // Create a network for the VMs - Network network = - networks - .define("net" + testId) - .withRegion(region) - .withNewResourceGroup(groupName) - .withAddressSpace("10.0.0.0/28") - .withSubnet("subnet1", "10.0.0.0/29") - .withSubnet("subnet2", "10.0.0.8/29") - .create(); - - Creatable availabilitySetDefinition = - computeManager - .availabilitySets() - .define("as" + testId) - .withRegion(region) - .withExistingResourceGroup(groupName) - .withSku(AvailabilitySetSkuTypes.ALIGNED); - - // Create the requested number of VM definitions - String userName = "testuser" + testId; - List> vmDefinitions = new ArrayList<>(); - for (int i = 0; i < count; i++) { - String vmName = computeManager.resourceManager().internalContext().randomResourceName("vm", 15); - - Creatable vm = - computeManager - .virtualMachines() - .define(vmName) - .withRegion(region) - .withExistingResourceGroup(groupName) - .withExistingPrimaryNetwork(network) - .withSubnet(network.subnets().values().iterator().next().name()) - .withPrimaryPrivateIPAddressDynamic() - .withoutPrimaryPublicIPAddress() - .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_18_04_LTS) - .withRootUsername(userName) - .withRootPassword(ResourceManagerTestBase.password()) - .withNewAvailabilitySet(availabilitySetDefinition) - .withSize(VirtualMachineSizeTypes.fromString("Standard_D2a_v4")); - - vmDefinitions.add(vm); - } - - CreatedResources createdVMs2 = computeManager.virtualMachines().create(vmDefinitions); - VirtualMachine[] array = new VirtualMachine[createdVMs2.size()]; - for (int index = 0; index < createdVMs2.size(); index++) { - array[index] = createdVMs2.get(vmDefinitions.get(index).key()); - } - return array; - } - - // Print LB info - static void printLB(LoadBalancer resource) { - StringBuilder info = new StringBuilder(); - info - .append("Load balancer: ") - .append(resource.id()) - .append("Name: ") - .append(resource.name()) - .append("\n\tResource group: ") - .append(resource.resourceGroupName()) - .append("\n\tRegion: ") - .append(resource.region()) - .append("\n\tTags: ") - .append(resource.tags()) - .append("\n\tBackends: ") - .append(resource.backends().keySet().toString()); - - // Show public IP addresses - info.append("\n\tPublic IP address IDs: ").append(resource.publicIpAddressIds().size()); - for (String pipId : resource.publicIpAddressIds()) { - info.append("\n\t\tPIP id: ").append(pipId); - } - - // Show TCP probes - info.append("\n\tTCP probes: ").append(resource.tcpProbes().size()); - for (LoadBalancerTcpProbe probe : resource.tcpProbes().values()) { - info - .append("\n\t\tProbe name: ") - .append(probe.name()) - .append("\n\t\t\tPort: ") - .append(probe.port()) - .append("\n\t\t\tInterval in seconds: ") - .append(probe.intervalInSeconds()) - .append("\n\t\t\tRetries before unhealthy: ") - .append(probe.numberOfProbes()); - - // Show associated load balancing rules - info.append("\n\t\t\tReferenced from load balancing rules: ").append(probe.loadBalancingRules().size()); - for (LoadBalancingRule rule : probe.loadBalancingRules().values()) { - info.append("\n\t\t\t\tName: ").append(rule.name()); - } - } - - // Show HTTP probes - info.append("\n\tHTTP probes: ").append(resource.httpProbes().size()); - for (LoadBalancerHttpProbe probe : resource.httpProbes().values()) { - info - .append("\n\t\tProbe name: ") - .append(probe.name()) - .append("\n\t\t\tPort: ") - .append(probe.port()) - .append("\n\t\t\tInterval in seconds: ") - .append(probe.intervalInSeconds()) - .append("\n\t\t\tRetries before unhealthy: ") - .append(probe.numberOfProbes()) - .append("\n\t\t\tHTTP request path: ") - .append(probe.requestPath()); - - // Show associated load balancing rules - info.append("\n\t\t\tReferenced from load balancing rules: ").append(probe.loadBalancingRules().size()); - for (LoadBalancingRule rule : probe.loadBalancingRules().values()) { - info.append("\n\t\t\t\tName: ").append(rule.name()); - } - } - - // Show load balancing rules - info.append("\n\tLoad balancing rules: ").append(resource.loadBalancingRules().size()); - for (LoadBalancingRule rule : resource.loadBalancingRules().values()) { - info - .append("\n\t\tLB rule name: ") - .append(rule.name()) - .append("\n\t\t\tProtocol: ") - .append(rule.protocol()) - .append("\n\t\t\tFloating IP enabled? ") - .append(rule.floatingIPEnabled()) - .append("\n\t\t\tIdle timeout in minutes: ") - .append(rule.idleTimeoutInMinutes()) - .append("\n\t\t\tLoad distribution method: ") - .append(rule.loadDistribution().toString()); - - LoadBalancerFrontend frontend = rule.frontend(); - info.append("\n\t\t\tFrontend: "); - if (frontend != null) { - info.append(frontend.name()); - } else { - info.append("(None)"); - } - - info.append("\n\t\t\tFrontend port: ").append(rule.frontendPort()); - - LoadBalancerBackend backend = rule.backend(); - info.append("\n\t\t\tBackend: "); - if (backend != null) { - info.append(backend.name()); - } else { - info.append("(None)"); - } - - info.append("\n\t\t\tBackend port: ").append(rule.backendPort()); - - LoadBalancerProbe probe = rule.probe(); - info.append("\n\t\t\tProbe: "); - if (probe == null) { - info.append("(None)"); - } else { - info.append(probe.name()).append(" [").append(probe.protocol().toString()).append("]"); - } - } - - // Show frontends - info.append("\n\tFrontends: ").append(resource.frontends().size()); - for (LoadBalancerFrontend frontend : resource.frontends().values()) { - info - .append("\n\t\tFrontend name: ") - .append(frontend.name()) - .append("\n\t\t\tInternet facing: ") - .append(frontend.isPublic()); - if (frontend.isPublic()) { - info - .append("\n\t\t\tPublic IP Address ID: ") - .append(((LoadBalancerPublicFrontend) frontend).publicIpAddressId()); - } else { - info - .append("\n\t\t\tVirtual network ID: ") - .append(((LoadBalancerPrivateFrontend) frontend).networkId()) - .append("\n\t\t\tSubnet name: ") - .append(((LoadBalancerPrivateFrontend) frontend).subnetName()) - .append("\n\t\t\tPrivate IP address: ") - .append(((LoadBalancerPrivateFrontend) frontend).privateIpAddress()) - .append("\n\t\t\tPrivate IP allocation method: ") - .append(((LoadBalancerPrivateFrontend) frontend).privateIpAllocationMethod()); - } - - // Inbound NAT pool references - info.append("\n\t\t\tReferenced inbound NAT pools: ").append(frontend.inboundNatPools().size()); - for (LoadBalancerInboundNatPool pool : frontend.inboundNatPools().values()) { - info.append("\n\t\t\t\tName: ").append(pool.name()); - } - - // Inbound NAT rule references - info.append("\n\t\t\tReferenced inbound NAT rules: ").append(frontend.inboundNatRules().size()); - for (LoadBalancerInboundNatRule rule : frontend.inboundNatRules().values()) { - info.append("\n\t\t\t\tName: ").append(rule.name()); - } - - // Load balancing rule references - info.append("\n\t\t\tReferenced load balancing rules: ").append(frontend.loadBalancingRules().size()); - for (LoadBalancingRule rule : frontend.loadBalancingRules().values()) { - info.append("\n\t\t\t\tName: ").append(rule.name()); - } - } - - // Show inbound NAT rules - info.append("\n\tInbound NAT rules: ").append(resource.inboundNatRules().size()); - for (LoadBalancerInboundNatRule natRule : resource.inboundNatRules().values()) { - info - .append("\n\t\tInbound NAT rule name: ") - .append(natRule.name()) - .append("\n\t\t\tProtocol: ") - .append(natRule.protocol().toString()) - .append("\n\t\t\tFrontend: ") - .append(natRule.frontend().name()) - .append("\n\t\t\tFrontend port: ") - .append(natRule.frontendPort()) - .append("\n\t\t\tBackend port: ") - .append(natRule.backendPort()) - .append("\n\t\t\tBackend NIC ID: ") - .append(natRule.backendNetworkInterfaceId()) - .append("\n\t\t\tBackend NIC IP config name: ") - .append(natRule.backendNicIpConfigurationName()) - .append("\n\t\t\tFloating IP? ") - .append(natRule.floatingIPEnabled()) - .append("\n\t\t\tIdle timeout in minutes: ") - .append(natRule.idleTimeoutInMinutes()); - } - - // Show inbound NAT pools - info.append("\n\tInbound NAT pools: ").append(resource.inboundNatPools().size()); - for (LoadBalancerInboundNatPool natPool : resource.inboundNatPools().values()) { - info - .append("\n\t\tInbound NAT pool name: ") - .append(natPool.name()) - .append("\n\t\t\tProtocol: ") - .append(natPool.protocol().toString()) - .append("\n\t\t\tFrontend: ") - .append(natPool.frontend().name()) - .append("\n\t\t\tFrontend port range: ") - .append(natPool.frontendPortRangeStart()) - .append("-") - .append(natPool.frontendPortRangeEnd()) - .append("\n\t\t\tBackend port: ") - .append(natPool.backendPort()); - } - - // Show backends - info.append("\n\tBackends: ").append(resource.backends().size()); - for (LoadBalancerBackend backend : resource.backends().values()) { - info.append("\n\t\tBackend name: ").append(backend.name()); - - // Show assigned backend NICs - info.append("\n\t\t\tReferenced NICs: ").append(backend.backendNicIPConfigurationNames().entrySet().size()); - for (Entry entry : backend.backendNicIPConfigurationNames().entrySet()) { - info - .append("\n\t\t\t\tNIC ID: ") - .append(entry.getKey()) - .append(" - IP Config: ") - .append(entry.getValue()); - } - - // Show assigned virtual machines - Set vmIds = backend.getVirtualMachineIds(); - info.append("\n\t\t\tReferenced virtual machine ids: ").append(vmIds.size()); - for (String vmId : vmIds) { - info.append("\n\t\t\t\tVM ID: ").append(vmId); - } - - // Show assigned load balancing rules - info - .append("\n\t\t\tReferenced load balancing rules: ") - .append(new ArrayList(backend.loadBalancingRules().keySet())); - } - - System.out.println(info.toString()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestLocalNetworkGateway.java b/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestLocalNetworkGateway.java deleted file mode 100644 index 2e2ef4b8a796..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestLocalNetworkGateway.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager; - -import com.azure.resourcemanager.network.models.LocalNetworkGateway; -import com.azure.resourcemanager.network.models.LocalNetworkGateways; -import com.azure.core.management.Region; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import com.azure.resourcemanager.test.ResourceManagerTestBase; -import org.junit.jupiter.api.Assertions; - -/** Tests Local Network Gateway. */ -public class TestLocalNetworkGateway extends TestTemplate { - private String testId = ""; - private static final Region REGION = ResourceManagerTestBase.locationOrDefault(Region.US_NORTH_CENTRAL); - private String groupName; - private String lngwName; - - private void initializeResourceNames(ResourceManagerUtils.InternalRuntimeContext internalContext) { - testId = internalContext.randomResourceName("", 8); - groupName = "rg" + testId; - lngwName = "lngw" + testId; - } - - @Override - public LocalNetworkGateway createResource(LocalNetworkGateways localNetworkGateways) throws Exception { - initializeResourceNames(localNetworkGateways.manager().resourceManager().internalContext()); - LocalNetworkGateway gateway = - localNetworkGateways - .define(lngwName) - .withRegion(REGION) - .withNewResourceGroup(groupName) - .withIPAddress("40.71.184.214") - .withAddressSpace("192.168.3.0/24") - .withAddressSpace("192.168.4.0/27") - .create(); - Assertions.assertEquals("40.71.184.214", gateway.ipAddress()); - Assertions.assertEquals(2, gateway.addressSpaces().size()); - Assertions.assertTrue(gateway.addressSpaces().contains("192.168.4.0/27")); - return gateway; - } - - @Override - public LocalNetworkGateway updateResource(LocalNetworkGateway gateway) throws Exception { - gateway - .update() - .withoutAddressSpace("192.168.3.0/24") - .withIPAddress("40.71.184.216") - .withTag("tag2", "value2") - .withoutTag("tag1") - .apply(); - Assertions.assertFalse(gateway.addressSpaces().contains("192.168.3.0/24")); - Assertions.assertEquals("40.71.184.216", gateway.ipAddress()); - Assertions.assertTrue(gateway.tags().containsKey("tag2")); - Assertions.assertTrue(!gateway.tags().containsKey("tag1")); - gateway.updateTags().withoutTag("tag2").withTag("tag3", "value3").applyTags(); - Assertions.assertFalse(gateway.tags().containsKey("tag2")); - Assertions.assertEquals("value3", gateway.tags().get("tag3")); - return gateway; - } - - @Override - public void print(LocalNetworkGateway gateway) { - StringBuilder info = new StringBuilder(); - info - .append("Local Network Gateway: ") - .append(gateway.id()) - .append("\n\tName: ") - .append(gateway.name()) - .append("\n\tResource group: ") - .append(gateway.resourceGroupName()) - .append("\n\tRegion: ") - .append(gateway.regionName()) - .append("\n\tIP address: ") - .append(gateway.ipAddress()); - if (!gateway.addressSpaces().isEmpty()) { - info.append("\n\tAddress spaces:"); - for (String addressSpace : gateway.addressSpaces()) { - info.append("\n\t\t" + addressSpace); - } - } - info.append("\n\tTags: ").append(gateway.tags()); - System.out.println(info.toString()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestNSG.java b/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestNSG.java deleted file mode 100644 index eb02248ca32b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestNSG.java +++ /dev/null @@ -1,214 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager; - -import com.azure.resourcemanager.network.models.ApplicationSecurityGroup; -import com.azure.resourcemanager.network.models.NetworkInterface; -import com.azure.resourcemanager.network.models.NetworkSecurityGroup; -import com.azure.resourcemanager.network.models.NetworkSecurityGroups; -import com.azure.resourcemanager.network.models.NetworkSecurityRule; -import com.azure.resourcemanager.network.models.SecurityRuleProtocol; -import com.azure.resourcemanager.network.models.Subnet; -import com.azure.core.management.Region; -import com.azure.resourcemanager.test.ResourceManagerTestBase; -import org.junit.jupiter.api.Assertions; -import reactor.core.publisher.Mono; - -import java.util.List; - -/** Test for network security group CRUD. */ -public class TestNSG extends TestTemplate { - @Override - public NetworkSecurityGroup createResource(NetworkSecurityGroups nsgs) throws Exception { - String postFix = nsgs.manager().resourceManager().internalContext().randomResourceName("", 8); - final String newName = "nsg" + postFix; - final String resourceGroupName = "rg" + postFix; - final String nicName = "nic" + postFix; - final String asgName = nsgs.manager().resourceManager().internalContext().randomResourceName("asg", 8); - final Region region = ResourceManagerTestBase.locationOrDefault(Region.US_WEST); - - ApplicationSecurityGroup asg = - nsgs - .manager() - .applicationSecurityGroups() - .define(asgName) - .withRegion(region) - .withNewResourceGroup(resourceGroupName) - .create(); - // Create - Mono resourceStream = - nsgs - .define(newName) - .withRegion(region) - .withExistingResourceGroup(resourceGroupName) - .defineRule("rule1") - .allowOutbound() - .fromAnyAddress() - .fromPort(80) - .toAnyAddress() - .toPort(80) - .withProtocol(SecurityRuleProtocol.TCP) - .attach() - .defineRule("rule2") - .allowInbound() - .withSourceApplicationSecurityGroup(asg.id()) - .fromAnyPort() - .toAnyAddress() - .toPortRange(22, 25) - .withAnyProtocol() - .withPriority(200) - .withDescription("foo!!") - .attach() - .createAsync(); - - resourceStream - .doOnSuccess((_ignore) -> System.out.print("completed")); - - NetworkSecurityGroup nsg = resourceStream.block(); - - NetworkInterface nic = - nsgs - .manager() - .networkInterfaces() - .define(nicName) - .withRegion(region) - .withExistingResourceGroup(resourceGroupName) - .withNewPrimaryNetwork("10.0.0.0/28") - .withPrimaryPrivateIPAddressDynamic() - .withExistingNetworkSecurityGroup(nsg) - .create(); - - nsg.refresh(); - - // Verify - Assertions.assertTrue(nsg.region().equals(region)); - Assertions.assertTrue(nsg.securityRules().size() == 2); - - // Confirm NIC association - Assertions.assertEquals(1, nsg.networkInterfaceIds().size()); - Assertions.assertTrue(nsg.networkInterfaceIds().contains(nic.id())); - - Assertions.assertEquals(1, nsg.securityRules().get("rule2").sourceApplicationSecurityGroupIds().size()); - Assertions - .assertEquals( - asg.id(), nsg.securityRules().get("rule2").sourceApplicationSecurityGroupIds().iterator().next()); - - return nsg; - } - - @Override - public NetworkSecurityGroup updateResource(NetworkSecurityGroup resource) throws Exception { - resource = - resource - .update() - .withoutRule("rule1") - .withTag("tag1", "value1") - .withTag("tag2", "value2") - .defineRule("rule3") - .allowInbound() - .fromAnyAddress() - .fromAnyPort() - .toAnyAddress() - .toAnyPort() - .withProtocol(SecurityRuleProtocol.UDP) - .attach() - .withoutRule("rule1") - .updateRule("rule2") - .denyInbound() - .fromAddresses("100.0.0.0/29", "100.1.0.0/29") - .fromPortRanges("88-90") - .withPriority(300) - .withDescription("bar!!!") - .parent() - .apply(); - Assertions.assertTrue(resource.tags().containsKey("tag1")); - Assertions.assertTrue(resource.securityRules().get("rule2").sourceApplicationSecurityGroupIds().isEmpty()); - Assertions.assertNull(resource.securityRules().get("rule2").sourceAddressPrefix()); - Assertions.assertEquals(2, resource.securityRules().get("rule2").sourceAddressPrefixes().size()); - Assertions.assertTrue(resource.securityRules().get("rule2").sourceAddressPrefixes().contains("100.1.0.0/29")); - Assertions.assertEquals(1, resource.securityRules().get("rule2").sourcePortRanges().size()); - Assertions.assertEquals("88-90", resource.securityRules().get("rule2").sourcePortRanges().get(0)); - - resource.updateTags().withTag("tag3", "value3").withoutTag("tag1").applyTags(); - Assertions.assertEquals("value3", resource.tags().get("tag3")); - Assertions.assertFalse(resource.tags().containsKey("tag1")); - return resource; - } - - private static StringBuilder printRule(NetworkSecurityRule rule, StringBuilder info) { - info - .append("\n\t\tRule: ") - .append(rule.name()) - .append("\n\t\t\tAccess: ") - .append(rule.access()) - .append("\n\t\t\tDirection: ") - .append(rule.direction()) - .append("\n\t\t\tFrom address: ") - .append(rule.sourceAddressPrefix()) - .append("\n\t\t\tFrom port range: ") - .append(rule.sourcePortRange()) - .append("\n\t\t\tTo address: ") - .append(rule.destinationAddressPrefix()) - .append("\n\t\t\tTo port: ") - .append(rule.destinationPortRange()) - .append("\n\t\t\tProtocol: ") - .append(rule.protocol()) - .append("\n\t\t\tPriority: ") - .append(rule.priority()) - .append("\n\t\t\tDescription: ") - .append(rule.description()); - return info; - } - - public static void printNSG(NetworkSecurityGroup resource) { - StringBuilder info = new StringBuilder(); - info - .append("NSG: ") - .append(resource.id()) - .append("Name: ") - .append(resource.name()) - .append("\n\tResource group: ") - .append(resource.resourceGroupName()) - .append("\n\tRegion: ") - .append(resource.region()) - .append("\n\tTags: ") - .append(resource.tags()); - - // Output security rules - info.append("\n\tCustom security rules:"); - for (NetworkSecurityRule rule : resource.securityRules().values()) { - info = printRule(rule, info); - } - - // Output default security rules - info.append("\n\tDefault security rules:"); - for (NetworkSecurityRule rule : resource.defaultSecurityRules().values()) { - info = printRule(rule, info); - } - - // Output associated NIC IDs - info.append("\n\tNICs: ").append(resource.networkInterfaceIds()); - - // Output associated subnets - info.append("\n\tAssociated subnets: "); - List subnets = resource.listAssociatedSubnets(); - if (subnets == null || subnets.size() == 0) { - info.append("(None)"); - } else { - for (Subnet subnet : subnets) { - info - .append("\n\t\tNetwork ID: ") - .append(subnet.parent().id()) - .append("\n\t\tSubnet name: ") - .append(subnet.name()); - } - } - - System.out.println(info.toString()); - } - - @Override - public void print(NetworkSecurityGroup resource) { - printNSG(resource); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestNetwork.java b/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestNetwork.java deleted file mode 100644 index 251bb663f2ed..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestNetwork.java +++ /dev/null @@ -1,518 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager; - -import com.azure.resourcemanager.network.models.Network; -import com.azure.resourcemanager.network.models.NetworkPeering; -import com.azure.resourcemanager.network.models.NetworkPeeringGatewayUse; -import com.azure.resourcemanager.network.models.NetworkSecurityGroup; -import com.azure.resourcemanager.network.models.Networks; -import com.azure.resourcemanager.network.models.RouteTable; -import com.azure.resourcemanager.network.models.ServiceEndpointType; -import com.azure.resourcemanager.network.models.Subnet; -import com.azure.resourcemanager.network.models.VirtualNetworkPeeringState; -import com.azure.resourcemanager.test.ResourceManagerTestBase; -import com.azure.resourcemanager.test.utils.TestUtilities; -import com.azure.core.management.Region; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.CreatedResources; -import java.util.Arrays; -import java.util.List; -import java.util.Map; -import java.util.Set; -import org.junit.jupiter.api.Assertions; - -/** Test of virtual network management. */ -public class TestNetwork { - /** Test of network with subnets. */ - public class WithSubnets extends TestTemplate { - @Override - public Network createResource(Networks networks) throws Exception { - - String postFix = networks.manager().resourceManager().internalContext().randomResourceName("", 8); - final String newName = "net" + postFix; - Region region = ResourceManagerTestBase.locationOrDefault(Region.US_WEST); - String groupName = "rg" + postFix; - - // Create an NSG - NetworkSecurityGroup nsg = - networks - .manager() - .networkSecurityGroups() - .define("nsg" + postFix) - .withRegion(region) - .withNewResourceGroup(groupName) - .create(); - - // Create a network - final Network network = - networks - .define(newName) - .withRegion(region) - .withNewResourceGroup(groupName) - .withAddressSpace("10.0.0.0/28") - .withAddressSpace("10.1.0.0/28") - .withSubnet("subnetA", "10.0.0.0/29") - .defineSubnet("subnetB") - .withAddressPrefix("10.0.0.8/29") - .withExistingNetworkSecurityGroup(nsg) - .attach() - .create(); - - // Verify address spaces - Assertions.assertEquals(2, network.addressSpaces().size()); - Assertions.assertTrue(network.addressSpaces().contains("10.1.0.0/28")); - - // Verify subnets - Assertions.assertEquals(2, network.subnets().size()); - Subnet subnet = network.subnets().get("subnetA"); - Assertions.assertEquals("10.0.0.0/29", subnet.addressPrefix()); - - subnet = network.subnets().get("subnetB"); - Assertions.assertEquals("10.0.0.8/29", subnet.addressPrefix()); - Assertions.assertTrue(nsg.id().equalsIgnoreCase(subnet.networkSecurityGroupId())); - - // Verify NSG - List subnets = nsg.refresh().listAssociatedSubnets(); - Assertions.assertEquals(1, subnets.size()); - subnet = subnets.get(0); - Assertions.assertTrue(subnet.name().equalsIgnoreCase("subnetB")); - Assertions.assertTrue(subnet.parent().name().equalsIgnoreCase(newName)); - Assertions.assertNotNull(subnet.networkSecurityGroupId()); - NetworkSecurityGroup nsg2 = subnet.getNetworkSecurityGroup(); - Assertions.assertNotNull(nsg2); - Assertions.assertTrue(nsg2.id().equalsIgnoreCase(nsg.id())); - - return network; - } - - @Override - public Network updateResource(Network resource) throws Exception { - NetworkSecurityGroup nsg = - resource - .manager() - .networkSecurityGroups() - .define(resource.manager().resourceManager().internalContext().randomResourceName("nsgB", 10)) - .withRegion(resource.region()) - .withExistingResourceGroup(resource.resourceGroupName()) - .create(); - - resource = - resource - .update() - .withTag("tag1", "value1") - .withTag("tag2", "value2") - .withAddressSpace("141.25.0.0/16") - .withoutAddressSpace("10.1.0.0/28") - .withSubnet("subnetC", "141.25.0.0/29") - .withoutSubnet("subnetA") - .updateSubnet("subnetB") - .withAddressPrefix("141.25.0.8/29") - .withoutNetworkSecurityGroup() - .parent() - .defineSubnet("subnetD") - .withAddressPrefix("141.25.0.16/29") - .withExistingNetworkSecurityGroup(nsg) - .attach() - .apply(); - Assertions.assertTrue(resource.tags().containsKey("tag1")); - - // Verify address spaces - Assertions.assertEquals(2, resource.addressSpaces().size()); - Assertions.assertFalse(resource.addressSpaces().contains("10.1.0.0/28")); - - // Verify subnets - Assertions.assertEquals(3, resource.subnets().size()); - Assertions.assertFalse(resource.subnets().containsKey("subnetA")); - - Subnet subnet = resource.subnets().get("subnetB"); - Assertions.assertNotNull(subnet); - Assertions.assertEquals("141.25.0.8/29", subnet.addressPrefix()); - Assertions.assertNull(subnet.networkSecurityGroupId()); - - subnet = resource.subnets().get("subnetC"); - Assertions.assertNotNull(subnet); - Assertions.assertEquals("141.25.0.0/29", subnet.addressPrefix()); - Assertions.assertNull(subnet.networkSecurityGroupId()); - - subnet = resource.subnets().get("subnetD"); - Assertions.assertNotNull(subnet); - Assertions.assertEquals("141.25.0.16/29", subnet.addressPrefix()); - Assertions.assertTrue(nsg.id().equalsIgnoreCase(subnet.networkSecurityGroupId())); - - return resource; - } - - @Override - public void print(Network resource) { - printNetwork(resource); - } - } - - /** Test of network with subnets configured to have access from azure service. */ - public class WithAccessFromServiceToSubnet extends TestTemplate { - - @Override - public Network createResource(Networks networks) throws Exception { - String postfix = networks.manager().resourceManager().internalContext().randomResourceName("", 8); - final String newName = "net" + postfix; - Region region = ResourceManagerTestBase.locationOrDefault(Region.US_WEST); - String groupName = "rg" + postfix; - - // Create a network - final Network network = - networks - .define(newName) - .withRegion(region) - .withNewResourceGroup(groupName) - .withAddressSpace("10.0.0.0/28") - .withSubnet("subnetA", "10.0.0.0/29") - .defineSubnet("subnetB") - .withAddressPrefix("10.0.0.8/29") - .withAccessFromService(ServiceEndpointType.MICROSOFT_STORAGE) - .attach() - .create(); - - // Verify address spaces - Assertions.assertEquals(1, network.addressSpaces().size()); - Assertions.assertTrue(network.addressSpaces().contains("10.0.0.0/28")); - - // Verify subnets - Assertions.assertEquals(2, network.subnets().size()); - Subnet subnet = network.subnets().get("subnetA"); - Assertions.assertEquals("10.0.0.0/29", subnet.addressPrefix()); - - subnet = network.subnets().get("subnetB"); - Assertions.assertEquals("10.0.0.8/29", subnet.addressPrefix()); - Assertions.assertNotNull(subnet.servicesWithAccess()); - Assertions.assertTrue(subnet.servicesWithAccess().containsKey(ServiceEndpointType.MICROSOFT_STORAGE)); - Assertions.assertTrue(subnet.servicesWithAccess().get(ServiceEndpointType.MICROSOFT_STORAGE).size() > 0); - return network; - } - - @Override - public Network updateResource(Network resource) throws Exception { - resource = - resource - .update() - .withTag("tag1", "value1") - .withTag("tag2", "value2") - .withAddressSpace("141.25.0.0/16") - .withoutAddressSpace("10.1.0.0/28") - .withSubnet("subnetC", "141.25.0.0/29") - .withoutSubnet("subnetA") - .updateSubnet("subnetB") - .withAddressPrefix("141.25.0.8/29") - .withoutAccessFromService(ServiceEndpointType.MICROSOFT_STORAGE) - .parent() - .defineSubnet("subnetD") - .withAddressPrefix("141.25.0.16/29") - .withAccessFromService(ServiceEndpointType.MICROSOFT_STORAGE) - .attach() - .apply(); - - Assertions.assertTrue(resource.tags().containsKey("tag1")); - - // Verify address spaces - Assertions.assertEquals(2, resource.addressSpaces().size()); - Assertions.assertFalse(resource.addressSpaces().contains("10.1.0.0/28")); - - // Verify subnets - Assertions.assertEquals(3, resource.subnets().size()); - Assertions.assertFalse(resource.subnets().containsKey("subnetA")); - - Subnet subnet = resource.subnets().get("subnetB"); - Assertions.assertNotNull(subnet); - Assertions.assertEquals("141.25.0.8/29", subnet.addressPrefix()); - Assertions.assertNotNull(subnet.servicesWithAccess()); - Assertions.assertTrue(subnet.servicesWithAccess().isEmpty()); - - subnet = resource.subnets().get("subnetC"); - Assertions.assertNotNull(subnet); - Assertions.assertEquals("141.25.0.0/29", subnet.addressPrefix()); - - subnet = resource.subnets().get("subnetD"); - Assertions.assertNotNull(subnet); - Assertions.assertEquals("141.25.0.16/29", subnet.addressPrefix()); - Assertions.assertNotNull(subnet.servicesWithAccess()); - Assertions.assertTrue(subnet.servicesWithAccess().containsKey(ServiceEndpointType.MICROSOFT_STORAGE)); - - return resource; - } - - @Override - public void print(Network resource) { - printNetwork(resource); - } - } - - /** Test of network peerings. */ - public class WithPeering extends TestTemplate { - @Override - public Network createResource(Networks networks) throws Exception { - Region region = ResourceManagerTestBase.locationOrDefault(Region.US_EAST); - String groupName = networks.manager().resourceManager().internalContext().randomResourceName("rg", 10); - - String networkName = networks.manager().resourceManager().internalContext().randomResourceName("net", 15); - String networkName2 = networks.manager().resourceManager().internalContext().randomResourceName("net", 15); - - Creatable remoteNetworkDefinition = - networks - .define(networkName2) - .withRegion(region) - .withNewResourceGroup(groupName) - .withAddressSpace("10.1.0.0/27") - .withSubnet("subnet3", "10.1.0.0/27"); - - Creatable localNetworkDefinition = - networks - .define(networkName) - .withRegion(region) - .withNewResourceGroup(groupName) - .withAddressSpace("10.0.0.0/27") - .withSubnet("subnet1", "10.0.0.0/28") - .withSubnet("subnet2", "10.0.0.16/28"); - - CreatedResources createdNetworks = - networks.create(Arrays.asList(remoteNetworkDefinition, localNetworkDefinition)); - Network localNetwork = createdNetworks.get(localNetworkDefinition.key()); - Network remoteNetwork = createdNetworks.get(remoteNetworkDefinition.key()); - Assertions.assertNotNull(localNetwork); - Assertions.assertNotNull(remoteNetwork); - - // Create peering - NetworkPeering localPeering = - localNetwork - .peerings() - .define("peer0") - .withRemoteNetwork(remoteNetwork) - - // Optionals - .withTrafficForwardingBetweenBothNetworks() - .withoutAccessFromEitherNetwork() - .withGatewayUseByRemoteNetworkAllowed() - .create(); - - // Verify local peering - Assertions.assertNotNull(localNetwork.peerings()); - Assertions.assertEquals(1, TestUtilities.getSize(localNetwork.peerings().list())); - Assertions.assertEquals(1, localPeering.remoteAddressSpaces().size()); - Assertions.assertEquals("10.1.0.0/27", localPeering.remoteAddressSpaces().get(0)); - localPeering = localNetwork.peerings().list().iterator().next(); - Assertions.assertNotNull(localPeering); - Assertions.assertTrue(localPeering.name().equalsIgnoreCase("peer0")); - Assertions.assertEquals(VirtualNetworkPeeringState.CONNECTED, localPeering.state()); - Assertions.assertTrue(localPeering.isTrafficForwardingFromRemoteNetworkAllowed()); - Assertions.assertFalse(localPeering.checkAccessBetweenNetworks()); - Assertions.assertEquals(NetworkPeeringGatewayUse.BY_REMOTE_NETWORK, localPeering.gatewayUse()); - - // Verify remote peering - Assertions.assertNotNull(remoteNetwork.peerings()); - Assertions.assertEquals(1, TestUtilities.getSize(remoteNetwork.peerings().list())); - NetworkPeering remotePeering = localPeering.getRemotePeering(); - Assertions.assertNotNull(remotePeering); - Assertions.assertTrue(remotePeering.remoteNetworkId().equalsIgnoreCase(localNetwork.id())); - Assertions.assertEquals(VirtualNetworkPeeringState.CONNECTED, remotePeering.state()); - Assertions.assertTrue(remotePeering.isTrafficForwardingFromRemoteNetworkAllowed()); - Assertions.assertFalse(remotePeering.checkAccessBetweenNetworks()); - Assertions.assertEquals(NetworkPeeringGatewayUse.NONE, remotePeering.gatewayUse()); - - return localNetwork; - } - - @Override - public Network updateResource(Network resource) throws Exception { - NetworkPeering localPeering = resource.peerings().list().iterator().next(); - - // Verify remote IP invisibility to local network before peering - Network remoteNetwork = localPeering.getRemoteNetwork(); - Assertions.assertNotNull(remoteNetwork); - Subnet remoteSubnet = remoteNetwork.subnets().get("subnet3"); - Assertions.assertNotNull(remoteSubnet); - Set remoteAvailableIPs = remoteSubnet.listAvailablePrivateIPAddresses(); - Assertions.assertNotNull(remoteAvailableIPs); - Assertions.assertFalse(remoteAvailableIPs.isEmpty()); - String remoteTestIP = remoteAvailableIPs.iterator().next(); - Assertions.assertFalse(resource.isPrivateIPAddressAvailable(remoteTestIP)); - - localPeering - .update() - .withoutTrafficForwardingFromEitherNetwork() - .withAccessBetweenBothNetworks() - .withoutAnyGatewayUse() - .apply(); - - // Verify local peering changes - Assertions.assertFalse(localPeering.isTrafficForwardingFromRemoteNetworkAllowed()); - Assertions.assertTrue(localPeering.checkAccessBetweenNetworks()); - Assertions.assertEquals(NetworkPeeringGatewayUse.NONE, localPeering.gatewayUse()); - - // Verify remote peering changes - NetworkPeering remotePeering = localPeering.getRemotePeering(); - Assertions.assertNotNull(remotePeering); - Assertions.assertFalse(remotePeering.isTrafficForwardingFromRemoteNetworkAllowed()); - Assertions.assertTrue(remotePeering.checkAccessBetweenNetworks()); - Assertions.assertEquals(NetworkPeeringGatewayUse.NONE, remotePeering.gatewayUse()); - - // Delete the peering - resource.peerings().deleteById(remotePeering.id()); - - // Verify deletion - Assertions.assertEquals(0, TestUtilities.getSize(resource.peerings().list())); - Assertions.assertEquals(0, TestUtilities.getSize(remoteNetwork.peerings().list())); - - return resource; - } - - @Override - public void print(Network resource) { - printNetwork(resource); - } - } - - /** Test of network with DDoS protection plan. */ - public class WithDDosProtectionPlanAndVmProtection extends TestTemplate { - @Override - public Network createResource(Networks networks) throws Exception { - Region region = ResourceManagerTestBase.locationOrDefault(Region.US_EAST2); - String groupName = networks.manager().resourceManager().internalContext().randomResourceName("rg", 10); - - String networkName = networks.manager().resourceManager().internalContext().randomResourceName("net", 15); - - Network network = - networks - .define(networkName) - .withRegion(region) - .withNewResourceGroup(groupName) - .withNewDdosProtectionPlan() - .create(); - Assertions.assertTrue(network.isDdosProtectionEnabled()); - Assertions.assertNotNull(network.ddosProtectionPlanId()); - - return network; - } - - @Override - public Network updateResource(Network network) throws Exception { - network.update().withoutDdosProtectionPlan().apply(); - Assertions.assertFalse(network.isDdosProtectionEnabled()); - Assertions.assertNull(network.ddosProtectionPlanId()); - return network; - } - - @Override - public void print(Network resource) { - printNetwork(resource); - } - } - - /** Test of network updateTags functionality. */ - public class WithUpdateTags extends TestTemplate { - @Override - public Network createResource(Networks networks) throws Exception { - Region region = ResourceManagerTestBase.locationOrDefault(Region.US_SOUTH_CENTRAL); - String groupName = networks.manager().resourceManager().internalContext().randomResourceName("rg", 10); - - String networkName = networks.manager().resourceManager().internalContext().randomResourceName("net", 15); - - Network network = - networks - .define(networkName) - .withRegion(region) - .withNewResourceGroup(groupName) - .withTag("tag1", "value1") - .create(); - Assertions.assertEquals("value1", network.tags().get("tag1")); - return network; - } - - @Override - public Network updateResource(Network network) throws Exception { - network.updateTags().withoutTag("tag1").withTag("tag2", "value2").applyTags(); - Assertions.assertFalse(network.tags().containsKey("tag1")); - Assertions.assertEquals("value2", network.tags().get("tag2")); - return network; - } - - @Override - public void print(Network resource) { - printNetwork(resource); - } - } - - /** - * Outputs info about a network. - * - * @param resource a network - */ - public static void printNetwork(Network resource) { - StringBuilder info = new StringBuilder(); - info - .append("Network: ") - .append(resource.id()) - .append("Name: ") - .append(resource.name()) - .append("\n\tResource group: ") - .append(resource.resourceGroupName()) - .append("\n\tRegion: ") - .append(resource.region()) - .append("\n\tTags: ") - .append(resource.tags()) - .append("\n\tAddress spaces: ") - .append(resource.addressSpaces()) - .append("\n\tDNS server IPs: ") - .append(resource.dnsServerIPs()); - - // Output subnets - for (Subnet subnet : resource.subnets().values()) { - info - .append("\n\tSubnet: ") - .append(subnet.name()) - .append("\n\t\tAddress prefix: ") - .append(subnet.addressPrefix()); - - // Show associated NSG - NetworkSecurityGroup nsg = subnet.getNetworkSecurityGroup(); - if (nsg != null) { - info.append("\n\tNetwork security group ID: ").append(nsg.id()); - } - - // Show associated route table - RouteTable routeTable = subnet.getRouteTable(); - if (routeTable != null) { - info.append("\n\tRoute table ID: ").append(routeTable.id()); - } - - // Output services with access - Map> services = subnet.servicesWithAccess(); - if (services.size() > 0) { - info.append("\n\tServices with access"); - for (Map.Entry> service : services.entrySet()) { - info - .append("\n\t\tService: ") - .append(service.getKey()) - .append(" Regions: " + service.getValue() + ""); - } - } - } - - // Output peerings - for (NetworkPeering peering : resource.peerings().list()) { - info - .append("\n\tPeering: ") - .append(peering.name()) - .append("\n\t\tRemote network ID: ") - .append(peering.remoteNetworkId()) - .append("\n\t\tPeering state: ") - .append(peering.state()) - .append("\n\t\tIs traffic forwarded from remote network allowed? ") - .append(peering.isTrafficForwardingFromRemoteNetworkAllowed()) - // TODO (weidxu) .append("\n\t\tIs access from remote network allowed? - // ").append(peering.isAccessBetweenNetworksAllowed()) - .append("\n\t\tGateway use: ") - .append(peering.gatewayUse()); - } - - System.out.println(info.toString()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestNetworkInterface.java b/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestNetworkInterface.java deleted file mode 100644 index e0cf8e8edc6b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestNetworkInterface.java +++ /dev/null @@ -1,211 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager; - -import com.azure.resourcemanager.network.models.LoadBalancerBackend; -import com.azure.resourcemanager.network.models.LoadBalancerInboundNatRule; -import com.azure.resourcemanager.network.models.Network; -import com.azure.resourcemanager.network.models.NetworkInterface; -import com.azure.resourcemanager.network.models.NetworkInterfaces; -import com.azure.resourcemanager.network.models.NicIpConfiguration; -import com.azure.resourcemanager.network.models.Subnet; -import com.azure.core.management.Region; -import java.util.Collection; -import java.util.List; - -import com.azure.resourcemanager.test.ResourceManagerTestBase; -import org.junit.jupiter.api.Assertions; - -public class TestNetworkInterface extends TestTemplate { - @Override - public NetworkInterface createResource(NetworkInterfaces networkInterfaces) throws Exception { - - String postfix = networkInterfaces.manager().resourceManager().internalContext().randomResourceName("", 8); - final String nicName = "nic" + postfix; - final String vnetName = "net" + postfix; - final String pipName = "pip" + postfix; - final Region region = ResourceManagerTestBase.locationOrDefault(Region.US_EAST); - - Network network = - networkInterfaces - .manager() - .networks() - .define(vnetName) - .withRegion(region) - .withNewResourceGroup() - .withAddressSpace("10.0.0.0/28") - .withSubnet("subnet1", "10.0.0.0/29") - .withSubnet("subnet2", "10.0.0.8/29") - .create(); - - NetworkInterface nic = - networkInterfaces - .define(nicName) - .withRegion(region) - .withExistingResourceGroup(network.resourceGroupName()) - .withExistingPrimaryNetwork(network) - .withSubnet("subnet1") - .withPrimaryPrivateIPAddressDynamic() - .withNewPrimaryPublicIPAddress(pipName) - .withIPForwarding() - .withAcceleratedNetworking() - .create(); - - // Verify NIC settings - Assertions.assertTrue(nic.isAcceleratedNetworkingEnabled()); - Assertions.assertTrue(nic.isIPForwardingEnabled()); - - // Verify IP configs - NicIpConfiguration ipConfig = nic.primaryIPConfiguration(); - Assertions.assertNotNull(ipConfig); - network = ipConfig.getNetwork(); - Assertions.assertNotNull(network); - Subnet subnet = network.subnets().get(ipConfig.subnetName()); - Assertions.assertNotNull(subnet); - Assertions.assertEquals(1, subnet.networkInterfaceIPConfigurationCount()); - Collection ipConfigs = subnet.listNetworkInterfaceIPConfigurations(); - Assertions.assertNotNull(ipConfigs); - Assertions.assertEquals(1, ipConfigs.size()); - NicIpConfiguration ipConfig2 = null; - for (NicIpConfiguration i : ipConfigs) { - if (i.name().equalsIgnoreCase(ipConfig.name())) { - ipConfig2 = i; - break; - } - } - Assertions.assertNotNull(ipConfig2); - Assertions.assertTrue(ipConfig.name().equalsIgnoreCase(ipConfig2.name())); - - return nic; - } - - @Override - public NetworkInterface updateResource(NetworkInterface resource) throws Exception { - resource = - resource - .update() - .withoutIPForwarding() - .withoutAcceleratedNetworking() - .withSubnet("subnet2") - .updateIPConfiguration("primary") // Updating the primary IP configuration - .withPrivateIpAddressDynamic() // Equivalent to ..update().withPrimaryPrivateIPAddressDynamic() - .withoutPublicIpAddress() // Equivalent to ..update().withoutPrimaryPublicIPAddress() - .parent() - .withTag("tag1", "value1") - .withTag("tag2", "value2") - .apply(); - - // Verifications - Assertions.assertFalse(resource.isAcceleratedNetworkingEnabled()); - Assertions.assertFalse(resource.isIPForwardingEnabled()); - NicIpConfiguration primaryIpConfig = resource.primaryIPConfiguration(); - Assertions.assertNotNull(primaryIpConfig); - Assertions.assertTrue(primaryIpConfig.isPrimary()); - Assertions.assertTrue("subnet2".equalsIgnoreCase(primaryIpConfig.subnetName())); - Assertions.assertNull(primaryIpConfig.publicIpAddressId()); - Assertions.assertTrue(resource.tags().containsKey("tag1")); - - Assertions.assertEquals(1, resource.ipConfigurations().size()); - - resource.updateTags().withoutTag("tag1").withTag("tag3", "value3").applyTags(); - Assertions.assertFalse(resource.tags().containsKey("tag1")); - Assertions.assertEquals("value3", resource.tags().get("tag3")); - return resource; - } - - public static void printNic(NetworkInterface resource) { - StringBuilder info = new StringBuilder(); - info - .append("NetworkInterface: ") - .append(resource.id()) - .append("Name: ") - .append(resource.name()) - .append("\n\tResource group: ") - .append(resource.resourceGroupName()) - .append("\n\tRegion: ") - .append(resource.region()) - .append("\n\tTags: ") - .append(resource.tags()) - .append("\n\tInternal DNS name label: ") - .append(resource.internalDnsNameLabel()) - .append("\n\tInternal FQDN: ") - .append(resource.internalFqdn()) - .append("\n\tInternal domain name suffix: ") - .append(resource.internalDomainNameSuffix()) - .append("\n\tVirtual machine ID: ") - .append(resource.virtualMachineId()) - .append("\n\tApplied DNS servers: ") - .append(resource.appliedDnsServers().toString()) - .append("\n\tDNS server IPs: "); - - // Output dns servers - for (String dnsServerIp : resource.dnsServers()) { - info.append("\n\t\t").append(dnsServerIp); - } - - info - .append("\n\tIP forwarding enabled? ") - .append(resource.isIPForwardingEnabled()) - .append("\n\tAccelerated networking enabled? ") - .append(resource.isAcceleratedNetworkingEnabled()) - .append("\n\tMAC Address:") - .append(resource.macAddress()) - .append("\n\tPrivate IP:") - .append(resource.primaryPrivateIP()) - .append("\n\tPrivate allocation method:") - .append(resource.primaryPrivateIpAllocationMethod()) - .append("\n\tPrimary virtual network ID: ") - .append(resource.primaryIPConfiguration().networkId()) - .append("\n\tPrimary subnet name: ") - .append(resource.primaryIPConfiguration().subnetName()) - .append("\n\tIP configurations: "); - - // Output IP configs - for (NicIpConfiguration ipConfig : resource.ipConfigurations().values()) { - info - .append("\n\t\tName: ") - .append(ipConfig.name()) - .append("\n\t\tPrivate IP: ") - .append(ipConfig.privateIpAddress()) - .append("\n\t\tPrivate IP allocation method: ") - .append(ipConfig.privateIpAllocationMethod().toString()) - .append("\n\t\tPrivate IP version: ") - .append(ipConfig.privateIpAddressVersion().toString()) - .append("\n\t\tPIP id: ") - .append(ipConfig.publicIpAddressId()) - .append("\n\t\tAssociated network ID: ") - .append(ipConfig.networkId()) - .append("\n\t\tAssociated subnet name: ") - .append(ipConfig.subnetName()); - - // Show associated load balancer backends - final List backends = ipConfig.listAssociatedLoadBalancerBackends(); - info.append("\n\t\tAssociated load balancer backends: ").append(backends.size()); - for (LoadBalancerBackend backend : backends) { - info - .append("\n\t\t\tLoad balancer ID: ") - .append(backend.parent().id()) - .append("\n\t\t\t\tBackend name: ") - .append(backend.name()); - } - - // Show associated load balancer inbound NAT rules - final List natRules = ipConfig.listAssociatedLoadBalancerInboundNatRules(); - info.append("\n\t\tAssociated load balancer inbound NAT rules: ").append(natRules.size()); - for (LoadBalancerInboundNatRule natRule : natRules) { - info - .append("\n\t\t\tLoad balancer ID: ") - .append(natRule.parent().id()) - .append("\n\t\t\tInbound NAT rule name: ") - .append(natRule.name()); - } - } - - System.out.println(info.toString()); - } - - @Override - public void print(NetworkInterface resource) { - printNic(resource); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestNetworkWatcher.java b/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestNetworkWatcher.java deleted file mode 100644 index 7766636a470d..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestNetworkWatcher.java +++ /dev/null @@ -1,190 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.compute.models.KnownLinuxVirtualMachineImage; -import com.azure.resourcemanager.compute.models.VirtualMachine; -import com.azure.resourcemanager.compute.models.VirtualMachineSizeTypes; -import com.azure.resourcemanager.compute.models.VirtualMachines; -import com.azure.resourcemanager.network.models.Network; -import com.azure.resourcemanager.network.models.NetworkInterface; -import com.azure.resourcemanager.network.models.NetworkInterfaces; -import com.azure.resourcemanager.network.models.NetworkSecurityGroup; -import com.azure.resourcemanager.network.models.NetworkWatcher; -import com.azure.resourcemanager.network.models.NetworkWatchers; -import com.azure.resourcemanager.network.models.Networks; -import com.azure.core.management.Region; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.fluentcore.model.CreatedResources; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import com.azure.resourcemanager.storage.models.StorageAccount; -import com.azure.resourcemanager.storage.models.StorageAccounts; -import java.util.ArrayList; -import java.util.List; - -import com.azure.resourcemanager.test.ResourceManagerTestBase; -import org.junit.jupiter.api.Assertions; - -/** Tests Network Watcher. */ -public class TestNetworkWatcher extends TestTemplate { - private String testId = ""; - private static final Region REGION = ResourceManagerTestBase.locationOrDefault(Region.EUROPE_NORTH); - private String groupName; - private String nwName; - - private void initializeResourceNames(ResourceManagerUtils.InternalRuntimeContext internalContext) { - testId = internalContext.randomResourceName("", 8); - groupName = "rg" + testId; - nwName = "nw" + testId; - } - - @Override - public NetworkWatcher createResource(NetworkWatchers networkWatchers) throws Exception { - // Network Watcher should be in the same region as monitored resources - initializeResourceNames(networkWatchers.manager().resourceManager().internalContext()); - - // make sure Network Watcher is disabled in current subscription and region as only one can exist - PagedIterable nwList = networkWatchers.list(); - for (NetworkWatcher nw : nwList) { - if (REGION.equals(nw.region())) { - networkWatchers.deleteById(nw.id()); - } - } - // create Network Watcher - NetworkWatcher nw = - networkWatchers.define(nwName).withRegion(REGION).withNewResourceGroup().withTag("tag1", "value1").create(); - return nw; - } - - @Override - public NetworkWatcher updateResource(NetworkWatcher resource) throws Exception { - resource.update().withTag("tag2", "value2").withoutTag("tag1").apply(); - resource.refresh(); - Assertions.assertTrue(resource.tags().containsKey("tag2")); - Assertions.assertFalse(resource.tags().containsKey("tag1")); - - resource.updateTags().withTag("tag3", "value3").withoutTag("tag2").applyTags(); - Assertions.assertTrue(resource.tags().containsKey("tag3")); - Assertions.assertFalse(resource.tags().containsKey("tag2")); - return resource; - } - - // Helper method to pre-create infrastructure to test Network Watcher - VirtualMachine[] ensureNetwork(Networks networks, VirtualMachines vms, NetworkInterfaces networkInterfaces) - throws Exception { - // Create an NSG - NetworkSecurityGroup nsg = - networks - .manager() - .networkSecurityGroups() - .define("nsg" + testId) - .withRegion(REGION) - .withNewResourceGroup(groupName) - .create(); - - // Create a network for the VMs - Network network = - networks - .define("net" + testId) - .withRegion(REGION) - .withExistingResourceGroup(groupName) - .withAddressSpace("10.0.0.0/28") - .defineSubnet("subnet1") - .withAddressPrefix("10.0.0.0/29") - .withExistingNetworkSecurityGroup(nsg) - .attach() - .withSubnet("subnet2", "10.0.0.8/29") - .create(); - - NetworkInterface nic = - networkInterfaces - .define("ni" + testId) - .withRegion(REGION) - .withExistingResourceGroup(groupName) - .withNewPrimaryNetwork("10.0.0.0/28") - .withPrimaryPrivateIPAddressDynamic() - .withNewPrimaryPublicIPAddress("pipdns" + testId) - .withIPForwarding() - .withExistingNetworkSecurityGroup(nsg) - .create(); - - // Create the requested number of VM definitions - String userName = "testuser" + testId; - List> vmDefinitions = new ArrayList<>(); - - Creatable vm1 = - vms - .define(networks.manager().resourceManager().internalContext().randomResourceName("vm", 15)) - .withRegion(REGION) - .withExistingResourceGroup(groupName) - .withExistingPrimaryNetworkInterface(nic) - .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_18_04_LTS) - .withRootUsername(userName) - .withRootPassword(ResourceManagerTestBase.password()) - .withSize(VirtualMachineSizeTypes.fromString("Standard_D2a_v4")) - .defineNewExtension("packetCapture") - .withPublisher("Microsoft.Azure.NetworkWatcher") - .withType("NetworkWatcherAgentLinux") - .withVersion("1.4") - .withMinorVersionAutoUpgrade() - .attach(); - - String vmName = networks.manager().resourceManager().internalContext().randomResourceName("vm", 15); - - Creatable vm2 = - vms - .define(vmName) - .withRegion(REGION) - .withExistingResourceGroup(groupName) - .withExistingPrimaryNetwork(network) - .withSubnet(network.subnets().values().iterator().next().name()) - .withPrimaryPrivateIPAddressDynamic() - .withoutPrimaryPublicIPAddress() - .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_18_04_LTS) - .withRootUsername(userName) - .withRootPassword(ResourceManagerTestBase.password()) - .withSize(VirtualMachineSizeTypes.fromString("Standard_D2a_v4")); - - vmDefinitions.add(vm1); - vmDefinitions.add(vm2); - vms.create(vmDefinitions); - CreatedResources createdVMs2 = vms.create(vmDefinitions); - VirtualMachine[] array = new VirtualMachine[createdVMs2.size()]; - for (int index = 0; index < createdVMs2.size(); index++) { - array[index] = createdVMs2.get(vmDefinitions.get(index).key()); - } - return array; - } - - // create a storage account - StorageAccount ensureStorageAccount(StorageAccounts storageAccounts) { - return storageAccounts - .define("sa" + testId) - .withRegion(REGION) - .withExistingResourceGroup(groupName) - .withGeneralPurposeAccountKindV2() - .create(); - } - - @Override - public void print(NetworkWatcher nw) { - StringBuilder info = new StringBuilder(); - info - .append("Network Watcher: ") - .append(nw.id()) - .append("\n\tName: ") - .append(nw.name()) - .append("\n\tResource group: ") - .append(nw.resourceGroupName()) - .append("\n\tRegion: ") - .append(nw.regionName()) - .append("\n\tTags: ") - .append(nw.tags()); - System.out.println(info.toString()); - } - - public String groupName() { - return groupName; - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestPublicIPAddress.java b/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestPublicIPAddress.java deleted file mode 100644 index 3e44d06924f5..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestPublicIPAddress.java +++ /dev/null @@ -1,120 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager; - -import com.azure.resourcemanager.network.models.LoadBalancer; -import com.azure.resourcemanager.network.models.LoadBalancerPublicFrontend; -import com.azure.resourcemanager.network.models.NetworkInterface; -import com.azure.resourcemanager.network.models.NicIpConfiguration; -import com.azure.resourcemanager.network.models.PublicIpAddress; -import com.azure.resourcemanager.network.models.PublicIpAddresses; -import com.azure.core.management.Region; -import com.azure.resourcemanager.test.ResourceManagerTestBase; -import org.junit.jupiter.api.Assertions; - -/** Tests public IPs. */ -public class TestPublicIPAddress extends TestTemplate { - @Override - public PublicIpAddress createResource(PublicIpAddresses pips) throws Exception { - final String newPipName = pips.manager().resourceManager().internalContext().randomResourceName("pip", 10); - - PublicIpAddress pip = - pips - .define(newPipName) - .withRegion(ResourceManagerTestBase.locationOrDefault(Region.US_WEST)) - .withNewResourceGroup() - .withDynamicIP() - .withLeafDomainLabel(newPipName) - .withIdleTimeoutInMinutes(10) - .create(); - return pip; - } - - @Override - public PublicIpAddress updateResource(PublicIpAddress resource) throws Exception { - final String updatedDnsName = resource.leafDomainLabel() + "xx"; - final int updatedIdleTimeout = 15; - resource = - resource - .update() - .withStaticIP() - .withLeafDomainLabel(updatedDnsName) - .withReverseFqdn(resource.leafDomainLabel() + "." + resource.region() + ".cloudapp.azure.com") - .withIdleTimeoutInMinutes(updatedIdleTimeout) - .withTag("tag1", "value1") - .withTag("tag2", "value2") - .apply(); - Assertions.assertTrue(resource.leafDomainLabel().equalsIgnoreCase(updatedDnsName)); - Assertions.assertTrue(resource.idleTimeoutInMinutes() == updatedIdleTimeout); - Assertions.assertEquals("value2", resource.tags().get("tag2")); - - resource.updateTags().withoutTag("tag1").withTag("tag3", "value3").applyTags(); - Assertions.assertFalse(resource.tags().containsKey("tag1")); - Assertions.assertEquals("value3", resource.tags().get("tag3")); - return resource; - } - - @Override - public void print(PublicIpAddress pip) { - TestPublicIPAddress.printPIP(pip); - } - - public static void printPIP(PublicIpAddress resource) { - StringBuilder info = - new StringBuilder() - .append("Public IP Address: ") - .append(resource.id()) - .append("\n\tName: ") - .append(resource.name()) - .append("\n\tResource group: ") - .append(resource.resourceGroupName()) - .append("\n\tRegion: ") - .append(resource.region()) - .append("\n\tTags: ") - .append(resource.tags()) - .append("\n\tIP Address: ") - .append(resource.ipAddress()) - .append("\n\tLeaf domain label: ") - .append(resource.leafDomainLabel()) - .append("\n\tFQDN: ") - .append(resource.fqdn()) - .append("\n\tReverse FQDN: ") - .append(resource.reverseFqdn()) - .append("\n\tIdle timeout (minutes): ") - .append(resource.idleTimeoutInMinutes()) - .append("\n\tIP allocation method: ") - .append(resource.ipAllocationMethod().toString()) - .append("\n\tIP version: ") - .append(resource.version().toString()); - - // Show the associated load balancer if any - info.append("\n\tLoad balancer association: "); - if (resource.hasAssignedLoadBalancer()) { - final LoadBalancerPublicFrontend frontend = resource.getAssignedLoadBalancerFrontend(); - final LoadBalancer lb = frontend.parent(); - info - .append("\n\t\tLoad balancer ID: ") - .append(lb.id()) - .append("\n\t\tFrontend name: ") - .append(frontend.name()); - } else { - info.append("(None)"); - } - - // Show the associated NIC if any - info.append("\n\tNetwork interface association: "); - if (resource.hasAssignedNetworkInterface()) { - final NicIpConfiguration nicIp = resource.getAssignedNetworkInterfaceIPConfiguration(); - final NetworkInterface nic = nicIp.parent(); - info - .append("\n\t\tNetwork interface ID: ") - .append(nic.id()) - .append("\n\t\tIP config name: ") - .append(nicIp.name()); - } else { - info.append("(None)"); - } - - System.out.println(info.toString()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestPublicIPPrefix.java b/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestPublicIPPrefix.java deleted file mode 100644 index 2d9f6d212559..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestPublicIPPrefix.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager; - -import com.azure.core.management.SubResource; -import com.azure.resourcemanager.network.models.IpVersion; -import com.azure.resourcemanager.network.models.PublicIpPrefix; -import com.azure.resourcemanager.network.models.PublicIpPrefixSku; -import com.azure.resourcemanager.network.models.PublicIpPrefixSkuName; -import com.azure.resourcemanager.network.models.PublicIpPrefixes; -import com.azure.core.management.Region; -import com.azure.resourcemanager.test.ResourceManagerTestBase; -import org.junit.jupiter.api.Assertions; - -/** Tests public Prefixes. */ -public class TestPublicIPPrefix extends TestTemplate { - @Override - public PublicIpPrefix createResource(PublicIpPrefixes pips) throws Exception { - final String newPipName = pips.manager().resourceManager().internalContext().randomResourceName("pip", 10); - - PublicIpPrefix pip = pips.define(newPipName) - .withRegion(ResourceManagerTestBase.locationOrDefault(Region.US_WEST)) - .withNewResourceGroup() - .withPrefixLength(30) - .withSku(new PublicIpPrefixSku().withName(PublicIpPrefixSkuName.STANDARD)) - .create(); - - Assertions.assertEquals(pip.prefixLength(), (Integer) 30); - Assertions.assertEquals(pip.sku().name().toString(), "Standard"); - Assertions.assertTrue(pip.publicIpAddressVersion() == IpVersion.IPV4); - return pip; - } - - @Override - public PublicIpPrefix updateResource(PublicIpPrefix resource) throws Exception { - resource = resource.update() - .withTag("tag1", "value1") - .withTag("tag2", "value2") - .apply(); - Assertions.assertEquals("value1", resource.tags().get("tag1")); - Assertions.assertEquals("value2", resource.tags().get("tag2")); - - return resource; - } - - @Override - public void print(PublicIpPrefix pip) { - TestPublicIPPrefix.printPIP(pip); - } - - public static void printPIP(PublicIpPrefix resource) { - StringBuilder info = new StringBuilder().append("Public IP Address: ").append(resource.id()) - .append("\n\tName: ").append(resource.name()) - .append("\n\tResource group: ").append(resource.resourceGroupName()) - .append("\n\tRegion: ").append(resource.region()) - .append("\n\tTags: ").append(resource.tags()) - .append("\n\tAvailability Zones: ").append(resource.availabilityZones()) - .append("\n\tLeaf domain label: ").append(resource.sku()) - .append("\n\tFQDN: ").append(resource.publicIpAddresses()) - .append("\n\tReverse FQDN: ").append(resource.publicIpAddressVersion()); - - // Show the associated load balancer if any - info.append("\n\tLoad balancer association: "); - if (resource.loadBalancerFrontendIpConfiguration() != null) { - final SubResource frontend = resource.loadBalancerFrontendIpConfiguration(); - info.append("\n\t\tLoad balancer ID: ").append(frontend.id()); - } else { - info.append("(None)"); - } - - System.out.println(info.toString()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestResourceStreaming.java b/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestResourceStreaming.java deleted file mode 100644 index 73a2268bd8f7..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestResourceStreaming.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager; - -import com.azure.resourcemanager.compute.ComputeManager; -import com.azure.resourcemanager.compute.models.KnownWindowsVirtualMachineImage; -import com.azure.resourcemanager.compute.models.VirtualMachine; -import com.azure.resourcemanager.compute.models.VirtualMachineSizeTypes; -import com.azure.resourcemanager.compute.models.VirtualMachines; -import com.azure.core.management.Region; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.resources.models.ResourceGroup; -import com.azure.resourcemanager.storage.models.StorageAccount; -import com.azure.resourcemanager.storage.models.StorageAccounts; -import com.azure.resourcemanager.test.ResourceManagerTestBase; -import org.junit.jupiter.api.Assertions; - -public class TestResourceStreaming extends TestTemplate { - private final StorageAccounts storageAccounts; - - public TestResourceStreaming(StorageAccounts storageAccounts) { - this.storageAccounts = storageAccounts; - } - - @Override - public VirtualMachine createResource(VirtualMachines virtualMachines) throws Exception { - final String vmName = virtualMachines.manager().resourceManager().internalContext().randomResourceName("vm", 10); - - System.out.println("In createResource \n\n\n"); - - Creatable rgCreatable = - virtualMachines - .manager() - .resourceManager() - .resourceGroups() - .define(virtualMachines.manager().resourceManager().internalContext().randomResourceName("rg" + vmName, 20)) - .withRegion(ResourceManagerTestBase.locationOrDefault(Region.US_EAST)); - - Creatable storageCreatable = - this - .storageAccounts - .define(virtualMachines.manager().resourceManager().internalContext().randomResourceName("stg", 20)) - .withRegion(ResourceManagerTestBase.locationOrDefault(Region.US_EAST)) - .withNewResourceGroup(rgCreatable); - - VirtualMachine virtualMachine = - virtualMachines - .define(vmName) - .withRegion(ResourceManagerTestBase.locationOrDefault(Region.US_EAST)) - .withNewResourceGroup(rgCreatable) - .withNewPrimaryNetwork("10.0.0.0/28") - .withPrimaryPrivateIPAddressDynamic() - .withNewPrimaryPublicIPAddress( - virtualMachines.manager().resourceManager().internalContext().randomResourceName("pip", 20)) - .withPopularWindowsImage(KnownWindowsVirtualMachineImage.WINDOWS_SERVER_2012_R2_DATACENTER) - .withAdminUsername("testuser") - .withAdminPassword("fakePasswordPlaceholder") - .withSize(VirtualMachineSizeTypes.fromString("Standard_D2a_v4")) - .withNewStorageAccount(storageCreatable) - .withNewAvailabilitySet(virtualMachines.manager().resourceManager().internalContext().randomResourceName("avset", 10)) - .createAsync() - .block(); - - ComputeManager manager = virtualMachines.manager(); - Assertions.assertEquals(1, manager.storageManager().storageAccounts().listByResourceGroup(rgCreatable.name()).stream().count()); - Assertions.assertEquals(1, manager.networkManager().publicIpAddresses().listByResourceGroup(rgCreatable.name()).stream().count()); - Assertions.assertEquals(1, manager.networkManager().networks().listByResourceGroup(rgCreatable.name()).stream().count()); - Assertions.assertEquals(1, manager.networkManager().networkInterfaces().listByResourceGroup(rgCreatable.name()).stream().count()); - Assertions.assertEquals(1, manager.availabilitySets().listByResourceGroup(rgCreatable.name()).stream().count()); - - return virtualMachine; - } - - @Override - public VirtualMachine updateResource(VirtualMachine virtualMachine) throws Exception { - return virtualMachine; - } - - @Override - public void print(VirtualMachine virtualMachine) { - TestUtils.print(virtualMachine); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestRouteTables.java b/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestRouteTables.java deleted file mode 100644 index 90418fd6475f..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestRouteTables.java +++ /dev/null @@ -1,195 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager; - -import com.azure.resourcemanager.network.models.Route; -import com.azure.resourcemanager.network.models.RouteNextHopType; -import com.azure.resourcemanager.network.models.RouteTable; -import com.azure.resourcemanager.network.models.RouteTables; -import com.azure.resourcemanager.network.models.Subnet; -import com.azure.core.management.Region; -import com.azure.resourcemanager.test.ResourceManagerTestBase; -import org.junit.jupiter.api.Assertions; - -import java.util.List; -import java.util.Map; - -/** Test of virtual network management. */ -public class TestRouteTables { - private String route1Name = "route1"; - private String route2Name = "route2"; - private String routeAddedName = "route3"; - private String virtualApplianceIp = "10.1.1.1"; - - /** Test of minimal route tables. */ - public class Minimal extends TestTemplate { - private String netName; - - @Override - public RouteTable createResource(RouteTables routeTables) throws Exception { - netName = routeTables.manager().resourceManager().internalContext().randomResourceName("net", 10); - final String newName = routeTables.manager().resourceManager().internalContext().randomResourceName("rt", 10); - - Region region = ResourceManagerTestBase.locationOrDefault(Region.US_WEST); - String groupName = routeTables.manager().resourceManager().internalContext().randomResourceName("rg", 10); - - final String route1AddressPrefix = "10.0.1.0/29"; - final String route2AddressPrefix = "10.0.0.0/29"; - final RouteNextHopType hopType = RouteNextHopType.VNET_LOCAL; - - // Create a route table - final RouteTable routeTable = - routeTables - .define(newName) - .withRegion(region) - .withNewResourceGroup(groupName) - .withRoute("10.0.3.0/29", RouteNextHopType.VNET_LOCAL) - .defineRoute(route1Name) - .withDestinationAddressPrefix(route1AddressPrefix) - .withNextHopToVirtualAppliance(virtualApplianceIp) - .attach() - .defineRoute(route2Name) - .withDestinationAddressPrefix(route2AddressPrefix) - .withNextHop(hopType) - .attach() - .withDisableBgpRoutePropagation() - .create(); - - Assertions.assertTrue(routeTable.routes().containsKey(route1Name)); - Route route1 = routeTable.routes().get(route1Name); - Assertions.assertTrue(route1.destinationAddressPrefix().equalsIgnoreCase(route1AddressPrefix)); - Assertions.assertTrue(route1.nextHopIpAddress().equalsIgnoreCase(virtualApplianceIp)); - Assertions.assertTrue(route1.nextHopType().equals(RouteNextHopType.VIRTUAL_APPLIANCE)); - - Assertions.assertTrue(routeTable.routes().containsKey(route2Name)); - Route route2 = routeTable.routes().get(route2Name); - Assertions.assertTrue(route2.destinationAddressPrefix().equalsIgnoreCase(route2AddressPrefix)); - Assertions.assertTrue(route2.nextHopIpAddress() == null); - Assertions.assertTrue(route2.nextHopType().equals(hopType)); - - Assertions.assertTrue(routeTable.isBgpRoutePropagationDisabled()); - - // Create a subnet that references the route table - routeTables - .manager() - .networks() - .define(netName) - .withRegion(region) - .withExistingResourceGroup(groupName) - .withAddressSpace("10.0.0.0/22") - .defineSubnet("subnet1") - .withAddressPrefix("10.0.0.0/22") - .withExistingRouteTable(routeTable) - .attach() - .create(); - - List subnets = routeTable.refresh().listAssociatedSubnets(); - Assertions.assertTrue(subnets.size() == 1); - Assertions.assertTrue(subnets.get(0).routeTableId().equalsIgnoreCase(routeTable.id())); - return routeTable; - } - - @Override - public RouteTable updateResource(RouteTable routeTable) throws Exception { - routeTable = - routeTable - .update() - .withTag("tag1", "value1") - .withTag("tag2", "value2") - .withoutRoute(route1Name) - .defineRoute(routeAddedName) - .withDestinationAddressPrefix("10.0.2.0/29") - .withNextHop(RouteNextHopType.NONE) - .attach() - .updateRoute(route2Name) - .withDestinationAddressPrefix("50.46.112.0/29") - .withNextHop(RouteNextHopType.INTERNET) - .parent() - .withRouteViaVirtualAppliance("10.0.5.0/29", virtualApplianceIp) - .withEnableBgpRoutePropagation() - .apply(); - - Assertions.assertTrue(routeTable.tags().containsKey("tag1")); - Assertions.assertTrue(routeTable.tags().containsKey("tag2")); - Assertions.assertTrue(!routeTable.routes().containsKey(route1Name)); - Assertions.assertTrue(routeTable.routes().containsKey(route2Name)); - Assertions.assertTrue(routeTable.routes().containsKey(routeAddedName)); - Assertions.assertFalse(routeTable.isBgpRoutePropagationDisabled()); - - routeTable - .manager() - .networks() - .getByResourceGroup(routeTable.resourceGroupName(), netName) - .update() - .updateSubnet("subnet1") - .withoutRouteTable() - .parent() - .apply(); - - List subnets = routeTable.refresh().listAssociatedSubnets(); - Assertions.assertTrue(subnets.size() == 0); - - routeTable.updateTags().withoutTag("tag1").withTag("tag3", "value3").applyTags(); - Assertions.assertFalse(routeTable.tags().containsKey("tag1")); - Assertions.assertEquals("value3", routeTable.tags().get("tag3")); - return routeTable; - } - - @Override - public void print(RouteTable resource) { - printRouteTable(resource); - } - } - - /** - * Outputs info about a route table - * - * @param resource a route table - */ - public static void printRouteTable(RouteTable resource) { - StringBuilder info = new StringBuilder(); - info - .append("Route table: ") - .append(resource.id()) - .append("\n\tName: ") - .append(resource.name()) - .append("\n\tResource group: ") - .append(resource.resourceGroupName()) - .append("\n\tRegion: ") - .append(resource.region()) - .append("\n\tTags: ") - .append(resource.tags()); - - // Output routes - Map routes = resource.routes(); - info.append("\n\tRoutes: ").append(routes.values().size()); - for (Route route : routes.values()) { - info - .append("\n\t\tName: ") - .append(route.name()) - .append("\n\t\t\tDestination address prefix: ") - .append(route.destinationAddressPrefix()) - .append("\n\t\t\tNext hop type: ") - .append(route.nextHopType().toString()) - .append("\n\t\t\tNext hop IP address: ") - .append(route.nextHopIpAddress()); - } - - // Output associated subnets - List subnets = resource.listAssociatedSubnets(); - info.append("\n\tAssociated subnets: ").append(subnets.size()); - for (Subnet subnet : subnets) { - info - .append("\n\t\tResource group: ") - .append(subnet.parent().resourceGroupName()) - .append("\n\t\tNetwork name: ") - .append(subnet.parent().name()) - .append("\n\t\tSubnet name: ") - .append(subnet.name()) - .append("\n\tSubnet's route table ID: ") - .append(subnet.routeTableId()); - } - info.append("\n\tDisable BGP route propagation: ").append(resource.isBgpRoutePropagationDisabled()); - System.out.println(info.toString()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestTemplate.java b/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestTemplate.java deleted file mode 100644 index f6e1d94cea08..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestTemplate.java +++ /dev/null @@ -1,214 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.exception.ManagementException; -import com.azure.resourcemanager.resources.fluentcore.arm.Manager; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById; -import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingByResourceGroup; -import com.azure.resourcemanager.resources.fluentcore.arm.models.GroupableResource; -import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingById; -import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; -import com.azure.resourcemanager.resources.models.ResourceGroups; -import com.azure.resourcemanager.test.utils.TestUtilities; -import org.junit.jupiter.api.Assertions; - -import java.io.IOException; - -/** - * Base class for CRUD test cases for top level Azure resource models. - * - * @param Top level resource type - * @param Type representing the collection of the top level resources - */ -public abstract class TestTemplate< - ResourceT extends GroupableResource, ?>, - CollectionT extends - SupportsListing & SupportsGettingByResourceGroup & SupportsDeletingById - & SupportsGettingById & HasManager> { - - private ResourceT resource; - private CollectionT collection; - private ResourceGroups resourceGroups; - - protected TestTemplate() { - } - - /** - * Resource creation logic. - * - * @param resources collection of resources - * @return created resource - * @throws Exception if anything goes wrong - */ - public abstract ResourceT createResource(CollectionT resources) throws Exception; - - /** - * Resource update logic. - * - * @param resource the resource to update - * @return the updated resource - * @throws Exception if anything goes wrong - */ - public abstract ResourceT updateResource(ResourceT resource) throws Exception; - - /** - * Tests the listing logic. - * - * @return number of resources in the list - * @throws ManagementException if anything goes wrong - * @throws IOException if anything goes wrong - */ - public int verifyListing() throws ManagementException, IOException { - PagedIterable resources = this.collection.list(); - for (ResourceT r : resources) { - System.out.println("resource id: " + r.id()); - } - return TestUtilities.getSize(resources); - } - - /** - * Tests the getting logic. - * - * @return the gotten resource - * @throws ManagementException if anything goes wrong - * @throws IOException if anything goes wrong - */ - public ResourceT verifyGetting() throws ManagementException, IOException { - ResourceT resourceByGroup = - this.collection.getByResourceGroup(this.resource.resourceGroupName(), this.resource.name()); - ResourceT resourceById = this.collection.getById(resourceByGroup.id()); - Assertions.assertTrue(resourceById.id().equalsIgnoreCase(resourceByGroup.id())); - return resourceById; - } - - /** - * Tests the deletion logic. - * - * @throws Exception if anything goes wrong - */ - public void verifyDeleting() throws Exception { - final String groupName = this.resource.resourceGroupName(); - this.collection.deleteById(this.resource.id()); - this.resourceGroups.beginDeleteByName(groupName); - } - - /** - * Prints information about the resource. - * - * @param resource resource to print - */ - public abstract void print(ResourceT resource); - - /** - * Runs the test. - * - * @param collection collection of resources to test - * @param resourceGroups the resource groups collection - * @throws Exception if anything goes wrong - */ - public void runTest(CollectionT collection, ResourceGroups resourceGroups) throws Exception { - this.collection = collection; - this.resourceGroups = resourceGroups; - - // Initial listing - verifyListing(); - - // Verify creation - this.resource = createResource(collection); - System.out.println("\n------------\nAfter creation:\n"); - print(this.resource); - - // Verify listing - verifyListing(); - - // Verify getting - this.resource = verifyGetting(); - Assertions.assertTrue(this.resource != null); - System.out.println("\n------------\nRetrieved resource:\n"); - print(this.resource); - - boolean failedUpdate = false; - String message = "Update Failed"; - // Verify update - try { - this.resource = updateResource(this.resource); - Assertions.assertTrue(this.resource != null); - System.out.println("\n------------\nUpdated resource:\n"); - message = "Print failed"; - print(this.resource); - } catch (Exception e) { - e.printStackTrace(); - failedUpdate = true; - } - - // Verify deletion - boolean failedDelete = false; - try { - message = "Delete failed"; - verifyDeleting(); - } catch (Exception e) { - e.printStackTrace(); - failedDelete = true; - } - Assertions.assertFalse(failedUpdate, message); - Assertions.assertFalse(failedDelete, message); - } - - /** - * Runs the test. - * - * @param collection collection of resources to test - * @param resourceGroups the resource groups collection - * @throws Exception if anything goes wrong - */ - public void runTest(CollectionT collection, ResourceGroups resourceGroups, String subscription) throws Exception { - this.collection = collection; - this.resourceGroups = resourceGroups; - - // Initial listing - verifyListing(); - - // Verify creation - this.resource = createResource(collection); - System.out.println("\n------------\nAfter creation:\n"); - print(this.resource); - - // Verify listing - verifyListing(); - - // Verify getting - this.resource = verifyGetting(); - Assertions.assertTrue(this.resource != null); - System.out.println("\n------------\nRetrieved resource:\n"); - print(this.resource); - - boolean failedUpdate = false; - String message = "Update Failed"; - // Verify update - try { - this.resource = updateResource(this.resource); - Assertions.assertTrue(this.resource != null); - System.out.println("\n------------\nUpdated resource:\n"); - message = "Print failed"; - print(this.resource); - } catch (Exception e) { - e.printStackTrace(); - failedUpdate = true; - } - - // Verify deletion - boolean failedDelete = false; - try { - message = "Delete failed"; - verifyDeleting(); - } catch (Exception e) { - e.printStackTrace(); - failedDelete = true; - } - Assertions.assertFalse(failedUpdate, message); - Assertions.assertFalse(failedDelete, message); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestUtils.java b/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestUtils.java deleted file mode 100644 index 85091cc9ec6b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestUtils.java +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager; - -import com.azure.core.util.Configuration; -import com.azure.resourcemanager.compute.models.DataDisk; -import com.azure.resourcemanager.compute.models.VirtualMachine; -import com.azure.resourcemanager.resources.models.ManagementLock; - -/** Test utilities. */ -public final class TestUtils { - private TestUtils() { - } - - /** - * @return whether it it RECORD mode - */ - public static boolean isRecordMode() { - String azureTestMode = Configuration.getGlobalConfiguration().get("AZURE_TEST_MODE"); - return "RECORD".equalsIgnoreCase(azureTestMode); - } - - public static void print(ManagementLock lock) { - StringBuffer info = new StringBuffer(); - info.append("\nLock ID: ").append(lock.id()) - .append("\nLocked resource ID: ").append(lock.lockedResourceId()) - .append("\nLevel: ").append(lock.level()); - System.out.println(info.toString()); - } - - /** - * Shows the virtual machine. - * - * @param resource virtual machine to show - */ - public static void print(VirtualMachine resource) { - StringBuilder storageProfile = new StringBuilder().append("\n\tStorageProfile: "); - if (resource.storageProfile().imageReference() != null) { - storageProfile.append("\n\t\tImageReference:"); - storageProfile.append("\n\t\t\tPublisher: ").append(resource.storageProfile().imageReference().publisher()); - storageProfile.append("\n\t\t\tOffer: ").append(resource.storageProfile().imageReference().offer()); - storageProfile.append("\n\t\t\tSKU: ").append(resource.storageProfile().imageReference().sku()); - storageProfile.append("\n\t\t\tVersion: ").append(resource.storageProfile().imageReference().version()); - } - - if (resource.storageProfile().osDisk() != null) { - storageProfile.append("\n\t\tOSDisk:"); - storageProfile.append("\n\t\t\tOSType: ").append(resource.storageProfile().osDisk().osType()); - storageProfile.append("\n\t\t\tName: ").append(resource.storageProfile().osDisk().name()); - storageProfile.append("\n\t\t\tCaching: ").append(resource.storageProfile().osDisk().caching()); - storageProfile.append("\n\t\t\tCreateOption: ").append(resource.storageProfile().osDisk().createOption()); - storageProfile.append("\n\t\t\tDiskSizeGB: ").append(resource.storageProfile().osDisk().diskSizeGB()); - if (resource.storageProfile().osDisk().image() != null) { - storageProfile.append("\n\t\t\tImage Uri: ").append(resource.storageProfile().osDisk().image().uri()); - } - if (resource.storageProfile().osDisk().vhd() != null) { - storageProfile.append("\n\t\t\tVhd Uri: ").append(resource.storageProfile().osDisk().vhd().uri()); - } - if (resource.storageProfile().osDisk().encryptionSettings() != null) { - storageProfile.append("\n\t\t\tEncryptionSettings: "); - storageProfile - .append("\n\t\t\t\tEnabled: ") - .append(resource.storageProfile().osDisk().encryptionSettings().enabled()); - storageProfile - .append("\n\t\t\t\tDiskEncryptionKey Uri: ") - .append(resource.storageProfile().osDisk().encryptionSettings().diskEncryptionKey().secretUrl()); - storageProfile - .append("\n\t\t\t\tKeyEncryptionKey Uri: ") - .append(resource.storageProfile().osDisk().encryptionSettings().keyEncryptionKey().keyUrl()); - } - } - - if (resource.storageProfile().dataDisks() != null) { - int i = 0; - for (DataDisk disk : resource.storageProfile().dataDisks()) { - storageProfile.append("\n\t\tDataDisk: #").append(i++); - storageProfile.append("\n\t\t\tName: ").append(disk.name()); - storageProfile.append("\n\t\t\tCaching: ").append(disk.caching()); - storageProfile.append("\n\t\t\tCreateOption: ").append(disk.createOption()); - storageProfile.append("\n\t\t\tDiskSizeGB: ").append(disk.diskSizeGB()); - storageProfile.append("\n\t\t\tLun: ").append(disk.lun()); - if (resource.isManagedDiskEnabled()) { - if (disk.managedDisk() != null) { - storageProfile.append("\n\t\t\tManaged Disk Id: ").append(disk.managedDisk().id()); - } - } else { - if (disk.vhd().uri() != null) { - storageProfile.append("\n\t\t\tVhd Uri: ").append(disk.vhd().uri()); - } - } - if (disk.image() != null) { - storageProfile.append("\n\t\t\tImage Uri: ").append(disk.image().uri()); - } - } - } - - StringBuilder osProfile = new StringBuilder().append("\n\tOSProfile: "); - osProfile.append("\n\t\tComputerName:").append(resource.osProfile().computerName()); - if (resource.osProfile().windowsConfiguration() != null) { - osProfile.append("\n\t\t\tWindowsConfiguration: "); - osProfile - .append("\n\t\t\t\tProvisionVMAgent: ") - .append(resource.osProfile().windowsConfiguration().provisionVMAgent()); - osProfile - .append("\n\t\t\t\tEnableAutomaticUpdates: ") - .append(resource.osProfile().windowsConfiguration().enableAutomaticUpdates()); - osProfile.append("\n\t\t\t\tTimeZone: ").append(resource.osProfile().windowsConfiguration().timeZone()); - } - - if (resource.osProfile().linuxConfiguration() != null) { - osProfile.append("\n\t\t\tLinuxConfiguration: "); - osProfile - .append("\n\t\t\t\tDisablePasswordAuthentication: ") - .append(resource.osProfile().linuxConfiguration().disablePasswordAuthentication()); - } - - StringBuilder networkProfile = new StringBuilder().append("\n\tNetworkProfile: "); - for (String networkInterfaceId : resource.networkInterfaceIds()) { - networkProfile.append("\n\t\tId:").append(networkInterfaceId); - } - - System - .out - .println( - new StringBuilder() - .append("Virtual Machine: ") - .append(resource.id()) - .append("Name: ") - .append(resource.name()) - .append("\n\tResource group: ") - .append(resource.resourceGroupName()) - .append("\n\tRegion: ") - .append(resource.region()) - .append("\n\tTags: ") - .append(resource.tags()) - .append("\n\tHardwareProfile: ") - .append("\n\t\tSize: ") - .append(resource.size()) - .append(storageProfile) - .append(osProfile) - .append(networkProfile) - .toString()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestVirtualMachine.java b/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestVirtualMachine.java deleted file mode 100644 index 09c0b4c82722..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestVirtualMachine.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager; - -import com.azure.resourcemanager.compute.models.Disk; -import com.azure.resourcemanager.compute.models.KnownWindowsVirtualMachineImage; -import com.azure.resourcemanager.compute.models.VirtualMachine; -import com.azure.resourcemanager.compute.models.VirtualMachineDataDisk; -import com.azure.resourcemanager.compute.models.VirtualMachineSizeTypes; -import com.azure.resourcemanager.compute.models.VirtualMachines; -import com.azure.core.management.Region; -import com.azure.resourcemanager.test.ResourceManagerTestBase; -import org.junit.jupiter.api.Assertions; -import reactor.core.publisher.Mono; - -public class TestVirtualMachine extends TestTemplate { - @Override - public VirtualMachine createResource(VirtualMachines virtualMachines) throws Exception { - final String vmName = virtualMachines.manager().resourceManager().internalContext().randomResourceName("vm", 10); - - final VirtualMachine[] vms = new VirtualMachine[1]; - - Mono resourceStream = - virtualMachines - .define(vmName) - .withRegion(ResourceManagerTestBase.locationOrDefault(Region.US_EAST)) - .withNewResourceGroup() - .withNewPrimaryNetwork("10.0.0.0/28") - .withPrimaryPrivateIPAddressDynamic() - .withoutPrimaryPublicIPAddress() - .withPopularWindowsImage(KnownWindowsVirtualMachineImage.WINDOWS_SERVER_2012_R2_DATACENTER) - .withAdminUsername("testuser") - .withAdminPassword(ResourceManagerTestBase.password()) - .withNewDataDisk(150) - .withSize(VirtualMachineSizeTypes.fromString("Standard_D2a_v4")) - .createAsync(); - - vms[0] = resourceStream.block(); - - Assertions.assertEquals(1, vms[0].dataDisks().size()); - VirtualMachineDataDisk dataDisk = vms[0].dataDisks().values().iterator().next(); - Assertions.assertEquals(150, dataDisk.size()); - Assertions.assertEquals(128, vms[0].osDiskSize()); - Disk osDisk = virtualMachines.manager().disks().getById(vms[0].osDiskId()); - Assertions.assertNotNull(osDisk); - Assertions.assertEquals(128, osDisk.sizeInGB()); - - return vms[0]; - } - - @Override - public VirtualMachine updateResource(VirtualMachine resource) throws Exception { - resource = resource.update().withSize(VirtualMachineSizeTypes.fromString("Standard_D2a_v4")).withNewDataDisk(100).apply(); - return resource; - } - - @Override - public void print(VirtualMachine virtualMachine) { - TestUtils.print(virtualMachine); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestVirtualMachineCustomData.java b/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestVirtualMachineCustomData.java deleted file mode 100644 index 52826949b47c..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestVirtualMachineCustomData.java +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager; - -import com.azure.resourcemanager.compute.models.KnownLinuxVirtualMachineImage; -import com.azure.resourcemanager.compute.models.VirtualMachine; -import com.azure.resourcemanager.compute.models.VirtualMachineSizeTypes; -import com.azure.resourcemanager.compute.models.VirtualMachines; -import com.azure.resourcemanager.network.models.PublicIpAddress; -import com.azure.resourcemanager.network.models.PublicIpAddresses; -import com.azure.core.management.Region; -import com.azure.resourcemanager.test.ResourceManagerTestBase; -import com.jcraft.jsch.ChannelExec; -import com.jcraft.jsch.JSch; -import com.jcraft.jsch.Session; -import java.io.BufferedReader; -import java.io.InputStreamReader; -import java.nio.file.Files; -import java.nio.file.Paths; -import java.util.Base64; -import org.junit.jupiter.api.Assertions; - -public class TestVirtualMachineCustomData extends TestTemplate { - final PublicIpAddresses pips; - - public TestVirtualMachineCustomData(PublicIpAddresses pips) { - this.pips = pips; - } - - @Override - public VirtualMachine createResource(VirtualMachines virtualMachines) throws Exception { - final String vmName = virtualMachines.manager().resourceManager().internalContext().randomResourceName("vm", 10); - final String publicIpDnsLabel = virtualMachines.manager().resourceManager().internalContext().randomResourceName("abc", 16); - final String password = ResourceManagerTestBase.password(); - - // Prepare the custom data - // - String cloudInitFilePath = getClass().getClassLoader().getResource("cloud-init").getPath(); - cloudInitFilePath = cloudInitFilePath.replaceFirst("^/(.:/)", "$1"); // In Windows remove leading slash - byte[] cloudInitAsBytes = Files.readAllBytes(Paths.get(cloudInitFilePath)); - byte[] cloudInitEncoded = Base64.getEncoder().encode(cloudInitAsBytes); - String cloudInitEncodedString = new String(cloudInitEncoded); - - PublicIpAddress pip = - pips - .define(publicIpDnsLabel) - .withRegion(ResourceManagerTestBase.locationOrDefault(Region.US_EAST)) - .withNewResourceGroup() - .withLeafDomainLabel(publicIpDnsLabel) - .create(); - - VirtualMachine vm = - virtualMachines - .define(vmName) - .withRegion(pip.regionName()) - .withExistingResourceGroup(pip.resourceGroupName()) - .withNewPrimaryNetwork("10.0.0.0/28") - .withPrimaryPrivateIPAddressDynamic() - .withExistingPrimaryPublicIPAddress(pip) - .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) - .withRootUsername("testuser") - .withRootPassword(password) - .withCustomData(cloudInitEncodedString) - .withSize(VirtualMachineSizeTypes.fromString("Standard_D2a_v4")) - .create(); - - pip.refresh(); - Assertions.assertTrue(pip.hasAssignedNetworkInterface()); - - if (TestUtils.isRecordMode()) { - JSch jsch = new JSch(); - Session session = null; - ChannelExec channel = null; - try { - java.util.Properties config = new java.util.Properties(); - config.put("StrictHostKeyChecking", "no"); - session = jsch.getSession("testuser", publicIpDnsLabel + "." + "eastus.cloudapp.azure.com", 22); - session.setPassword(password); - session.setConfig(config); - session.connect(); - - // Try running the package installed via init script - // - channel = (ChannelExec) session.openChannel("exec"); - BufferedReader in = new BufferedReader(new InputStreamReader(channel.getInputStream())); - channel.setCommand("pwgen;"); - channel.connect(); - - String msg; - while ((msg = in.readLine()) != null) { - Assertions.assertFalse(msg.startsWith("The program 'pwgen' is currently not installed")); - } - } catch (Exception e) { - Assertions.fail("SSH connection failed" + e.getMessage()); - } finally { - if (channel != null) { - channel.disconnect(); - } - - if (session != null) { - session.disconnect(); - } - } - } - return vm; - } - - @Override - public VirtualMachine updateResource(VirtualMachine virtualMachine) throws Exception { - return virtualMachine; - } - - @Override - public void print(VirtualMachine virtualMachine) { - TestUtils.print(virtualMachine); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestVirtualMachineDataDisk.java b/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestVirtualMachineDataDisk.java deleted file mode 100644 index 5f9ad254e2ad..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestVirtualMachineDataDisk.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager; - -import com.azure.resourcemanager.compute.models.CachingTypes; -import com.azure.resourcemanager.compute.models.KnownWindowsVirtualMachineImage; -import com.azure.resourcemanager.compute.models.VirtualMachine; -import com.azure.resourcemanager.compute.models.VirtualMachineSizeTypes; -import com.azure.resourcemanager.compute.models.VirtualMachineUnmanagedDataDisk; -import com.azure.resourcemanager.compute.models.VirtualMachines; -import com.azure.core.management.Region; -import com.azure.resourcemanager.test.ResourceManagerTestBase; -import org.junit.jupiter.api.Assertions; - -public class TestVirtualMachineDataDisk extends TestTemplate { - @Override - public VirtualMachine createResource(VirtualMachines virtualMachines) throws Exception { - final String vmName = virtualMachines.manager().resourceManager().internalContext().randomResourceName("vm", 10); - VirtualMachine virtualMachine = - virtualMachines - .define(vmName) - .withRegion(ResourceManagerTestBase.locationOrDefault(Region.US_EAST)) - .withNewResourceGroup() - .withNewPrimaryNetwork("10.0.0.0/28") - .withPrimaryPrivateIPAddressDynamic() - .withoutPrimaryPublicIPAddress() - .withPopularWindowsImage(KnownWindowsVirtualMachineImage.WINDOWS_SERVER_2012_R2_DATACENTER) - .withAdminUsername("testuser") - .withAdminPassword("fakePasswordPlaceholder") - .withUnmanagedDisks() - .withNewUnmanagedDataDisk(30) - .defineUnmanagedDataDisk("disk2") - .withNewVhd(20) - .withCaching(CachingTypes.READ_ONLY) - .attach() - .withSize(VirtualMachineSizeTypes.fromString("Standard_D2a_v4")) - .create(); - - // Assertions.assertTrue(virtualMachine.size().equals(VirtualMachineSizeTypes.fromString("Standard_D2a_v4"))); - Assertions.assertTrue(virtualMachine.unmanagedDataDisks().size() == 2); - VirtualMachineUnmanagedDataDisk disk2 = null; - for (VirtualMachineUnmanagedDataDisk dataDisk : virtualMachine.unmanagedDataDisks().values()) { - if (dataDisk.name().equalsIgnoreCase("disk2")) { - disk2 = dataDisk; - break; - } - } - Assertions.assertNotNull(disk2); - Assertions.assertTrue(disk2.cachingType() == CachingTypes.READ_ONLY); - Assertions.assertTrue(disk2.size() == 20); - return virtualMachine; - } - - @Override - public VirtualMachine updateResource(VirtualMachine virtualMachine) throws Exception { - virtualMachine = - virtualMachine - .update() - .withoutUnmanagedDataDisk("disk2") - .defineUnmanagedDataDisk("disk3") - .withNewVhd(10) - .withLun(2) - .attach() - .apply(); - Assertions.assertTrue(virtualMachine.unmanagedDataDisks().size() == 2); - VirtualMachineUnmanagedDataDisk disk3 = null; - for (VirtualMachineUnmanagedDataDisk dataDisk : virtualMachine.unmanagedDataDisks().values()) { - if (dataDisk.name().equalsIgnoreCase("disk3")) { - disk3 = dataDisk; - break; - } - } - Assertions.assertNotNull(disk3); - Assertions.assertTrue(disk3.cachingType() == CachingTypes.READ_WRITE); - Assertions.assertTrue(disk3.size() == 10); - return virtualMachine; - } - - @Override - public void print(VirtualMachine virtualMachine) { - TestUtils.print(virtualMachine); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestVirtualMachineInAvailabilitySet.java b/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestVirtualMachineInAvailabilitySet.java deleted file mode 100644 index 5e343da4996e..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestVirtualMachineInAvailabilitySet.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager; - -import com.azure.resourcemanager.compute.models.KnownLinuxVirtualMachineImage; -import com.azure.resourcemanager.compute.models.VirtualMachine; -import com.azure.resourcemanager.compute.models.VirtualMachineSizeTypes; -import com.azure.resourcemanager.compute.models.VirtualMachines; -import com.azure.core.management.Region; -import com.azure.resourcemanager.test.ResourceManagerTestBase; -import org.junit.jupiter.api.Assertions; - -public class TestVirtualMachineInAvailabilitySet extends TestTemplate { - @Override - public VirtualMachine createResource(VirtualMachines virtualMachines) throws Exception { - final String vmName = virtualMachines.manager().resourceManager().internalContext().randomResourceName("vm", 10); - final String newRgName = virtualMachines.manager().resourceManager().internalContext().randomResourceName("rgVmInAvail", 10); - final String newAvailSetName = virtualMachines.manager().resourceManager().internalContext().randomResourceName("avai", 10); - - VirtualMachine vm = - virtualMachines - .define(vmName) - .withRegion(ResourceManagerTestBase.locationOrDefault(Region.US_EAST)) - .withNewResourceGroup(newRgName) - .withNewPrimaryNetwork("10.0.0.0/28") - .withPrimaryPrivateIPAddressDynamic() - .withoutPrimaryPublicIPAddress() - .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) - .withRootUsername("testuser") - .withRootPassword(ResourceManagerTestBase.password()) - .withComputerName("myvm123") - .withSize(VirtualMachineSizeTypes.fromString("Standard_D2a_v4")) - .withNewAvailabilitySet(newAvailSetName) - .create(); - - Assertions.assertNotNull(vm.availabilitySetId()); - Assertions.assertNotNull(vm.computerName()); - Assertions.assertTrue(vm.computerName().equalsIgnoreCase("myvm123")); - return vm; - } - - @Override - public VirtualMachine updateResource(VirtualMachine virtualMachine) throws Exception { - return virtualMachine; - } - - @Override - public void print(VirtualMachine virtualMachine) { - TestUtils.print(virtualMachine); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestVirtualMachineNics.java b/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestVirtualMachineNics.java deleted file mode 100644 index d137c792382b..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestVirtualMachineNics.java +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager; - -import com.azure.resourcemanager.compute.models.KnownLinuxVirtualMachineImage; -import com.azure.resourcemanager.compute.models.VirtualMachine; -import com.azure.resourcemanager.compute.models.VirtualMachineSizeTypes; -import com.azure.resourcemanager.compute.models.VirtualMachines; -import com.azure.resourcemanager.network.models.Network; -import com.azure.resourcemanager.network.models.NetworkInterface; -import com.azure.resourcemanager.network.models.PublicIpAddress; -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.resources.models.ResourceGroup; -import com.azure.core.management.Region; -import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.resourcemanager.test.ResourceManagerTestBase; -import org.junit.jupiter.api.Assertions; - -public class TestVirtualMachineNics extends TestTemplate { - private final NetworkManager networkManager; - private String secondaryNicName; - - public TestVirtualMachineNics(NetworkManager networkManager) { - this.networkManager = networkManager; - } - - @Override - public VirtualMachine createResource(VirtualMachines virtualMachines) throws Exception { - // Prepare the resource group definition - final String rgName = virtualMachines.manager().resourceManager().internalContext().randomResourceName("rg", 10); - - Creatable resourceGroupCreatable = - virtualMachines.manager().resourceManager().resourceGroups().define(rgName).withRegion(ResourceManagerTestBase.locationOrDefault(Region.US_EAST)); - - // Prepare the virtual network definition [shared by primary and secondary network interfaces] - final String vnetName = virtualMachines.manager().resourceManager().internalContext().randomResourceName("vnet", 10); - - Creatable networkCreatable = - this - .networkManager - .networks() - .define(vnetName) - .withRegion(ResourceManagerTestBase.locationOrDefault(Region.US_EAST)) - .withNewResourceGroup(resourceGroupCreatable) - .withAddressSpace("10.0.0.0/28"); - - // Prepare the secondary network interface definition - secondaryNicName = virtualMachines.manager().resourceManager().internalContext().randomResourceName("nic", 10); - - Creatable secondaryNetworkInterfaceCreatable = - this - .networkManager - .networkInterfaces() - .define(secondaryNicName) - .withRegion(ResourceManagerTestBase.locationOrDefault(Region.US_EAST)) - .withNewResourceGroup(resourceGroupCreatable) - .withNewPrimaryNetwork(networkCreatable) - .withPrimaryPrivateIPAddressStatic("10.0.0.5"); - // .withNewPrimaryPublicIPAddress(); - // [Secondary NIC cannot have PublicIP - Only primary network interface can reference a public IP address] - - // Prepare the secondary network interface definition - final String secondaryNicName2 = virtualMachines.manager().resourceManager().internalContext().randomResourceName("nic2", 10); - - Creatable secondaryNetworkInterfaceCreatable2 = - this - .networkManager - .networkInterfaces() - .define(secondaryNicName2) - .withRegion(ResourceManagerTestBase.locationOrDefault(Region.US_EAST)) - .withNewResourceGroup(resourceGroupCreatable) - .withNewPrimaryNetwork(networkCreatable) - .withPrimaryPrivateIPAddressStatic("10.0.0.6"); - - // Create Virtual Machine - final String vmName = virtualMachines.manager().resourceManager().internalContext().randomResourceName("vm", 10); - - final String primaryPipName = "pip" + vmName; - VirtualMachine virtualMachine = - virtualMachines - .define(vmName) - .withRegion(ResourceManagerTestBase.locationOrDefault(Region.US_EAST)) - .withNewResourceGroup(resourceGroupCreatable) - .withNewPrimaryNetwork(networkCreatable) - .withPrimaryPrivateIPAddressStatic("10.0.0.4") - .withNewPrimaryPublicIPAddress(primaryPipName) - .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_18_04_LTS) - .withRootUsername("testuser") - .withRootPassword(ResourceManagerTestBase.password()) - .withSize(VirtualMachineSizeTypes.fromString("Standard_D8a_v4")) - .withNewSecondaryNetworkInterface(secondaryNetworkInterfaceCreatable) - .withNewSecondaryNetworkInterface(secondaryNetworkInterfaceCreatable2) - .create(); - - Assertions.assertTrue(virtualMachine.networkInterfaceIds().size() == 3); - NetworkInterface primaryNetworkInterface = virtualMachine.getPrimaryNetworkInterface(); - Assertions.assertEquals(primaryNetworkInterface.primaryPrivateIP(), "10.0.0.4"); - - PublicIpAddress primaryPublicIpAddress = primaryNetworkInterface.primaryIPConfiguration().getPublicIpAddress(); - Assertions.assertTrue(primaryPublicIpAddress.fqdn().startsWith(primaryPipName)); - return virtualMachine; - } - - @Override - public VirtualMachine updateResource(VirtualMachine virtualMachine) throws Exception { - virtualMachine.powerOff(); - virtualMachine.deallocate(); - virtualMachine = virtualMachine.update().withoutSecondaryNetworkInterface(secondaryNicName).apply(); - - Assertions.assertTrue(virtualMachine.networkInterfaceIds().size() == 2); - return virtualMachine; - } - - @Override - public void print(VirtualMachine virtualMachine) { - TestUtils.print(virtualMachine); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestVirtualMachineSizes.java b/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestVirtualMachineSizes.java deleted file mode 100644 index c8bb2e5c2369..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestVirtualMachineSizes.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.compute.models.KnownWindowsVirtualMachineImage; -import com.azure.resourcemanager.compute.models.VirtualMachine; -import com.azure.resourcemanager.compute.models.VirtualMachineSize; -import com.azure.resourcemanager.compute.models.VirtualMachines; -import com.azure.resourcemanager.test.ResourceManagerTestBase; -import com.azure.resourcemanager.test.utils.TestUtilities; -import com.azure.core.management.Region; -import org.junit.jupiter.api.Assertions; - -public class TestVirtualMachineSizes extends TestTemplate { - @Override - public VirtualMachine createResource(VirtualMachines virtualMachines) throws Exception { - PagedIterable availableSizes = virtualMachines.sizes().listByRegion(ResourceManagerTestBase.locationOrDefault(Region.US_EAST)); - Assertions.assertTrue(TestUtilities.getSize(availableSizes) > 0); - VirtualMachineSize availableSize = availableSizes.iterator().next(); - System.out.println("VM Sizes: " + availableSizes); - final String vmName = virtualMachines.manager().resourceManager().internalContext().randomResourceName("vm", 10); - VirtualMachine vm = - virtualMachines - .define(vmName) - .withRegion(ResourceManagerTestBase.locationOrDefault(Region.US_EAST)) - .withNewResourceGroup() - .withNewPrimaryNetwork("10.0.0.0/28") - .withPrimaryPrivateIPAddressDynamic() - .withoutPrimaryPublicIPAddress() - .withPopularWindowsImage(KnownWindowsVirtualMachineImage.WINDOWS_SERVER_2012_R2_DATACENTER) - .withAdminUsername("testuser") - .withAdminPassword("fakePasswordPlaceholder") - .withSize(availableSize.name()) // Use the first size - .create(); - - Assertions.assertTrue(vm.size().toString().equalsIgnoreCase(availableSize.name())); - return vm; - } - - @Override - public VirtualMachine updateResource(VirtualMachine virtualMachine) throws Exception { - PagedIterable resizableSizes = virtualMachine.availableSizes(); - Assertions.assertTrue(TestUtilities.getSize(resizableSizes) > 0); - VirtualMachineSize newSize = null; - for (VirtualMachineSize resizableSize : resizableSizes) { - if (!resizableSize.name().equalsIgnoreCase(virtualMachine.size().toString())) { - newSize = resizableSize; - break; - } - } - Assertions.assertNotNull(newSize); - virtualMachine = virtualMachine.update().withSize(newSize.name()).apply(); - - Assertions.assertTrue(virtualMachine.size().toString().equalsIgnoreCase(newSize.name())); - return virtualMachine; - } - - @Override - public void print(VirtualMachine virtualMachine) { - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestVirtualMachineSsh.java b/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestVirtualMachineSsh.java deleted file mode 100644 index 7c20f51c29f2..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestVirtualMachineSsh.java +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager; - -import com.azure.resourcemanager.compute.models.KnownLinuxVirtualMachineImage; -import com.azure.resourcemanager.compute.models.VirtualMachine; -import com.azure.resourcemanager.compute.models.VirtualMachineSizeTypes; -import com.azure.resourcemanager.compute.models.VirtualMachines; -import com.azure.resourcemanager.network.models.PublicIpAddress; -import com.azure.resourcemanager.network.models.PublicIpAddresses; -import com.azure.core.management.Region; -import com.azure.resourcemanager.test.ResourceManagerTestBase; -import com.jcraft.jsch.JSch; -import com.jcraft.jsch.Session; -import org.junit.jupiter.api.Assertions; - -public class TestVirtualMachineSsh extends TestTemplate { - final PublicIpAddresses pips; - - public TestVirtualMachineSsh(PublicIpAddresses pips) { - this.pips = pips; - } - - @Override - public VirtualMachine createResource(VirtualMachines virtualMachines) throws Exception { - final String vmName = virtualMachines.manager().resourceManager().internalContext().randomResourceName("vm", 10); - final String password = ResourceManagerTestBase.password(); - final String sshKey = - "ssh-rsa" - + " AAAAB3NzaC1yc2EAAAADAQABAAABAQCfSPC2K7LZcFKEO+/t3dzmQYtrJFZNxOsbVgOVKietqHyvmYGHEC0J2wPdAqQ/63g/hhAEFRoyehM+rbeDri4txB3YFfnOK58jqdkyXzupWqXzOrlKY4Wz9SKjjN765+dqUITjKRIaAip1Ri137szRg71WnrmdP3SphTRlCx1Bk2nXqWPsclbRDCiZeF8QOTi4JqbmJyK5+0UqhqYRduun8ylAwKKQJ1NJt85sYIHn9f1Rfr6Tq2zS0wZ7DHbZL+zB5rSlAr8QyUdg/GQD+cmSs6LvPJKL78d6hMGk84ARtFo4A79ovwX/Fj01znDQkU6nJildfkaolH2rWFG/qttD" - + " azjava@javalib.com"; - final String publicIpDnsLabel = vmName; - PublicIpAddress pip = - pips - .define(publicIpDnsLabel) - .withRegion(ResourceManagerTestBase.locationOrDefault(Region.US_EAST)) - .withNewResourceGroup() - .withLeafDomainLabel(publicIpDnsLabel) - .create(); - - VirtualMachine vm = - virtualMachines - .define(vmName) - .withRegion(pip.regionName()) - .withExistingResourceGroup(pip.resourceGroupName()) - .withNewPrimaryNetwork("10.0.0.0/28") - .withPrimaryPrivateIPAddressDynamic() - .withExistingPrimaryPublicIPAddress(pip) - .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_18_04_LTS) - .withRootUsername("testuser") - .withRootPassword(ResourceManagerTestBase.password()) - .withSsh(sshKey) - .withSize(VirtualMachineSizeTypes.fromString("Standard_D2a_v4")) - .create(); - - pip.refresh(); - Assertions.assertTrue(pip.hasAssignedNetworkInterface()); - - Assertions.assertNotNull(vm.innerModel().osProfile().linuxConfiguration().ssh()); - Assertions.assertTrue(vm.innerModel().osProfile().linuxConfiguration().ssh().publicKeys().size() > 0); - - JSch jsch = new JSch(); - Session session = null; - if (TestUtils.isRecordMode()) { - try { - java.util.Properties config = new java.util.Properties(); - config.put("StrictHostKeyChecking", "no"); - // jsch.addIdentity(sshFile, filePassword); - session = jsch.getSession("testuser", publicIpDnsLabel + "." + "eastus.cloudapp.azure.com", 22); - session.setPassword(password); - session.setConfig(config); - session.connect(); - } catch (Exception e) { - Assertions.fail("SSH connection failed: " + e.getMessage()); - } finally { - if (session != null) { - session.disconnect(); - } - } - } - return vm; - } - - @Override - public VirtualMachine updateResource(VirtualMachine virtualMachine) throws Exception { - // Updating Ssh public keys are not supported in Azure - // - return virtualMachine; - } - - @Override - public void print(VirtualMachine virtualMachine) { - TestUtils.print(virtualMachine); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestVirtualMachineSyncPoller.java b/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestVirtualMachineSyncPoller.java deleted file mode 100644 index 08191a102ea8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestVirtualMachineSyncPoller.java +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager; - -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.LongRunningOperationStatus; -import com.azure.core.util.polling.PollResponse; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.compute.models.Disk; -import com.azure.resourcemanager.compute.models.DiskSkuTypes; -import com.azure.resourcemanager.compute.models.KnownLinuxVirtualMachineImage; -import com.azure.resourcemanager.compute.models.VirtualMachine; -import com.azure.resourcemanager.compute.models.VirtualMachineSizeTypes; -import com.azure.resourcemanager.compute.models.VirtualMachines; -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.network.models.Network; -import com.azure.resourcemanager.network.models.NetworkInterface; -import com.azure.resourcemanager.network.models.PublicIpAddress; -import com.azure.core.management.Region; -import com.azure.resourcemanager.resources.fluentcore.model.Accepted; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import com.azure.resourcemanager.test.ResourceManagerTestBase; -import org.junit.jupiter.api.Assertions; - -import java.time.Duration; -import java.time.OffsetDateTime; - -public class TestVirtualMachineSyncPoller extends TestTemplate { - - private final NetworkManager networkManager; - - private final ClientLogger logger = new ClientLogger(TestVirtualMachineSyncPoller.class); - - public TestVirtualMachineSyncPoller(NetworkManager networkManager) { - this.networkManager = networkManager; - } - - @Override - public VirtualMachine createResource(VirtualMachines virtualMachines) throws Exception { - final String rgName = virtualMachines.manager().resourceManager().internalContext().randomResourceName("rg", 10); - final String vnetName = virtualMachines.manager().resourceManager().internalContext().randomResourceName("vnet", 10); - final String nicName = virtualMachines.manager().resourceManager().internalContext().randomResourceName("nic", 10); - final String subnetName = "default"; - final String diskName = virtualMachines.manager().resourceManager().internalContext().randomResourceName("disk", 10); - final String ipName = virtualMachines.manager().resourceManager().internalContext().randomResourceName("ip", 10); - final String vmName = virtualMachines.manager().resourceManager().internalContext().randomResourceName("vm", 10); - final Region region = ResourceManagerTestBase.locationOrDefault(Region.US_EAST); - - // network - Network network = - this.networkManager.networks() - .define(vnetName) - .withRegion(region) - .withNewResourceGroup(rgName) - .withAddressSpace("10.0.0.0/27") - .withSubnet(subnetName, "10.0.0.0/28") - .create(); - - // public ip address, poll till complete - logger.info("{} {}", OffsetDateTime.now(), "begin create public IP"); - Accepted publicIpAddressAccepted = - this.networkManager.publicIpAddresses() - .define(ipName) - .withRegion(region) - .withExistingResourceGroup(rgName) - .beginCreate(); - logger.info("{} {}", OffsetDateTime.now(), "polling public IP till complete"); - PollResponse publicIpAddressResponse = publicIpAddressAccepted.getSyncPoller().waitForCompletion(); - Assertions.assertEquals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, publicIpAddressResponse.getStatus()); - PublicIpAddress publicIpAddress = publicIpAddressAccepted.getFinalResult(); - logger.info("{} {}", OffsetDateTime.now(), "public IP created"); - - // nic and disk - logger.info("{} {}", OffsetDateTime.now(), "begin create nic"); - Accepted networkInterfaceAccepted = - this.networkManager.networkInterfaces() - .define(nicName) - .withRegion(region) - .withExistingResourceGroup(rgName) - .withExistingPrimaryNetwork(network) - .withSubnet(subnetName) - .withPrimaryPrivateIPAddressDynamic() - .withExistingPrimaryPublicIPAddress(publicIpAddress) - .beginCreate(); - - logger.info("{} {}", OffsetDateTime.now(), "begin create data disk"); - Accepted diskAccepted = - virtualMachines.manager().disks() - .define(diskName) - .withRegion(region) - .withExistingResourceGroup(rgName) - .withData() - .withSizeInGB(100) - .withSku(DiskSkuTypes.STANDARD_LRS) - .beginCreate(); - - // poll nic and disk - LongRunningOperationStatus networkInterfaceLroStatus = networkInterfaceAccepted.getActivationResponse().getStatus(); - LongRunningOperationStatus diskLroStatus = diskAccepted.getActivationResponse().getStatus(); - SyncPoller networkInterfaceSyncPoller = networkInterfaceAccepted.getSyncPoller(); - SyncPoller diskSyncPoller = diskAccepted.getSyncPoller(); - while (!networkInterfaceLroStatus.isComplete() || !diskLroStatus.isComplete()) { - ResourceManagerUtils.sleep(Duration.ofSeconds(1)); - - if (!networkInterfaceLroStatus.isComplete()) { - logger.info("{} {}", OffsetDateTime.now(), "poll network interface"); - networkInterfaceLroStatus = networkInterfaceSyncPoller.poll().getStatus(); - } - if (!diskLroStatus.isComplete()) { - logger.info("{} {}", OffsetDateTime.now(), "poll data disk"); - diskLroStatus = diskSyncPoller.poll().getStatus(); - } - } - Assertions.assertEquals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, networkInterfaceLroStatus); - Assertions.assertEquals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, diskLroStatus); - NetworkInterface networkInterface = networkInterfaceSyncPoller.getFinalResult(); - logger.info("{} {}", OffsetDateTime.now(), "network interface created"); - Disk disk = diskSyncPoller.getFinalResult(); - logger.info("{} {}", OffsetDateTime.now(), "data disk created"); - - // virtual machine, poll till complete - logger.info("{} {}", OffsetDateTime.now(), "begin create vm"); - Accepted virtualMachineAccepted = - virtualMachines - .define(vmName) - .withRegion(region) - .withExistingResourceGroup(rgName) - .withExistingPrimaryNetworkInterface(networkInterface) - .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_18_04_LTS) - .withRootUsername("testuser") - .withRootPassword(ResourceManagerTestBase.password()) - .withExistingDataDisk(disk) - .withSize(VirtualMachineSizeTypes.fromString("Standard_D2a_v4")) - .beginCreate(); - logger.info("{} {}", OffsetDateTime.now(), "polling virtual machine till complete"); - PollResponse virtualMachineResponse = virtualMachineAccepted.getSyncPoller().waitForCompletion(); - Assertions.assertEquals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, virtualMachineResponse.getStatus()); - logger.info("{} {}", OffsetDateTime.now(), "virtual machine created"); - - return virtualMachineAccepted.getFinalResult(); - } - - @Override - public VirtualMachine updateResource(VirtualMachine resource) throws Exception { - return resource; - } - - @Override - public void print(VirtualMachine resource) { - - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestVirtualNetworkGateway.java b/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestVirtualNetworkGateway.java deleted file mode 100644 index 3086c540f190..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestVirtualNetworkGateway.java +++ /dev/null @@ -1,363 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.resourcemanager.network.NetworkManager; -import com.azure.resourcemanager.network.models.LocalNetworkGateway; -import com.azure.resourcemanager.network.models.Network; -import com.azure.resourcemanager.network.models.Subnet; -import com.azure.resourcemanager.network.models.VirtualNetworkGateway; -import com.azure.resourcemanager.network.models.VirtualNetworkGatewayConnection; -import com.azure.resourcemanager.network.models.VirtualNetworkGatewaySkuName; -import com.azure.resourcemanager.network.models.VirtualNetworkGateways; -import com.azure.core.management.Region; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import com.azure.resourcemanager.test.ResourceManagerTestBase; -import com.azure.resourcemanager.test.utils.TestUtilities; -import org.junit.jupiter.api.Assertions; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -import java.io.File; -import java.time.Duration; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** Tests Virtual Network Gateway. */ -public class TestVirtualNetworkGateway { - private String testId = ""; - private Region region = ResourceManagerTestBase.locationOrDefault(Region.US_NORTH_CENTRAL); - private String groupName; - private String gatewayName1; - private String gatewayName2; - private String networkName; - private String connectionName = "myNewConnection"; - private String certificateName = "myTest3.cer"; - - private void initializeResourceNames(ResourceManagerUtils.InternalRuntimeContext internalContext) { - testId = internalContext.randomResourceName("", 8); - groupName = "rg" + testId; - gatewayName1 = "vngw" + testId; - gatewayName2 = "vngw2" + testId; - networkName = "nw" + testId; - } - - /** Test Virtual Network Gateway Create and Update. */ - public class Basic extends TestTemplate { - - public Basic(NetworkManager networkManager) { - initializeResourceNames(networkManager.resourceManager().internalContext()); - } - - @Override - public void print(VirtualNetworkGateway resource) { - printVirtualNetworkGateway(resource); - } - - @Override - public VirtualNetworkGateway createResource(VirtualNetworkGateways gateways) throws Exception { - VirtualNetworkGateway vngw = - gateways - .define(gatewayName1) - .withRegion(region) - .withNewResourceGroup(groupName) - .withNewNetwork("10.0.0.0/25", "10.0.0.0/27") - .withRouteBasedVpn() - .withSku(VirtualNetworkGatewaySkuName.VPN_GW1) - .withTag("tag1", "value1") - .create(); - return vngw; - } - - @Override - public VirtualNetworkGateway updateResource(VirtualNetworkGateway resource) throws Exception { - resource - .update() - .withSku(VirtualNetworkGatewaySkuName.VPN_GW2) - .withTag("tag2", "value2") - .withoutTag("tag1") - .apply(); - resource.refresh(); - Assertions.assertTrue(resource.tags().containsKey("tag2")); - Assertions.assertTrue(!resource.tags().containsKey("tag1")); - - Map tagsMap = new HashMap<>(); - tagsMap.put("tag3", "value3"); - tagsMap.put("tag4", "value4"); - resource.updateTags().withTags(tagsMap).applyTags(); - Assertions.assertEquals(2, resource.tags().size()); - Assertions.assertEquals("value4", resource.tags().get("tag4")); - return resource; - } - } - - /** Test Site-To-Site Virtual Network Gateway Connection. */ - public class SiteToSite extends TestTemplate { - public SiteToSite(NetworkManager networkManager) { - initializeResourceNames(networkManager.resourceManager().internalContext()); - } - - @Override - public void print(VirtualNetworkGateway resource) { - printVirtualNetworkGateway(resource); - } - - @Override - public VirtualNetworkGateway createResource(VirtualNetworkGateways gateways) throws Exception { - - // Create virtual network gateway - initializeResourceNames(gateways.manager().resourceManager().internalContext()); - VirtualNetworkGateway vngw = - gateways - .define(gatewayName1) - .withRegion(region) - .withNewResourceGroup() - .withNewNetwork("10.0.0.0/25", "10.0.0.0/27") - .withRouteBasedVpn() - .withSku(VirtualNetworkGatewaySkuName.VPN_GW1) - .withBgp(65010, "10.12.255.30") - .create(); - LocalNetworkGateway lngw = - gateways - .manager() - .localNetworkGateways() - .define("lngw" + testId) - .withRegion(vngw.region()) - .withExistingResourceGroup(vngw.resourceGroupName()) - .withIPAddress("40.71.184.214") - .withAddressSpace("192.168.3.0/24") - .withBgp(65050, "10.51.255.254") - .create(); - VirtualNetworkGatewayConnection connection = - vngw - .connections() - .define(connectionName) - .withSiteToSite() - .withLocalNetworkGateway(lngw) - .withSharedKey("MySecretKey") - .withTag("tag1", "value1") - .create(); - - Assertions.assertEquals(1, vngw.ipConfigurations().size()); - Subnet subnet = vngw.ipConfigurations().iterator().next().getSubnet(); - Assertions.assertEquals("10.0.0.0/27", subnet.addressPrefix()); - Assertions.assertTrue(vngw.isBgpEnabled()); - Assertions.assertEquals("10.12.255.30", vngw.bgpSettings().bgpPeeringAddress()); - - Assertions.assertEquals("40.71.184.214", lngw.ipAddress()); - Assertions.assertEquals(1, lngw.addressSpaces().size()); - Assertions.assertEquals("192.168.3.0/24", lngw.addressSpaces().iterator().next()); - Assertions.assertNotNull(lngw.bgpSettings()); - Assertions.assertEquals("10.51.255.254", lngw.bgpSettings().bgpPeeringAddress()); - - PagedIterable connections = vngw.listConnections(); - Assertions.assertEquals(1, TestUtilities.getSize(connections)); - VirtualNetworkGatewayConnection conn = connections.iterator().next(); - Assertions.assertEquals(vngw.id(), conn.virtualNetworkGateway1Id()); - Assertions.assertEquals(lngw.id(), conn.localNetworkGateway2Id()); - Assertions.assertEquals("value1", connection.tags().get("tag1")); - - return vngw; - } - - @Override - public VirtualNetworkGateway updateResource(VirtualNetworkGateway resource) throws Exception { - VirtualNetworkGatewayConnection connection = resource.connections().getByName(connectionName); - Assertions.assertFalse(connection.isBgpEnabled()); - connection.update().withBgp().apply(); - Assertions.assertTrue(connection.isBgpEnabled()); - - resource.connections().deleteByName(connectionName); - PagedIterable connections = resource.listConnections(); - Assertions.assertEquals(0, TestUtilities.getSize(connections)); - - resource.updateTags().withTag("tag3", "value3").withoutTag("tag1").applyTags(); - Assertions.assertEquals("value3", resource.tags().get("tag3")); - Assertions.assertFalse(resource.tags().containsKey("tag1")); - - return resource; - } - } - - /** Test VNet-to-VNet Virtual Network Gateway Connection. */ - public class VNetToVNet extends TestTemplate { - - public VNetToVNet(NetworkManager networkManager) { - initializeResourceNames(networkManager.resourceManager().internalContext()); - } - - @Override - public void print(VirtualNetworkGateway resource) { - printVirtualNetworkGateway(resource); - } - - @Override - public VirtualNetworkGateway createResource(final VirtualNetworkGateways gateways) throws Exception { - - // Create virtual network gateway - final List gws = new ArrayList<>(); - Mono vngwObservable = - gateways - .define(gatewayName1) - .withRegion(region) - .withNewResourceGroup(groupName) - .withNewNetwork(networkName, "10.11.0.0/16", "10.11.255.0/27") - .withRouteBasedVpn() - .withSku(VirtualNetworkGatewaySkuName.VPN_GW1) - .createAsync(); - - Mono vngw2Observable = - gateways - .define(gatewayName2) - .withRegion(region) - .withNewResourceGroup(groupName) - .withNewNetwork(networkName + "2", "10.41.0.0/16", "10.41.255.0/27") - .withRouteBasedVpn() - .withSku(VirtualNetworkGatewaySkuName.VPN_GW1) - .createAsync(); - - Flux vngw2ObservableSleep = Mono.delay(Duration.ofSeconds(10)).thenMany(vngw2Observable); - - Flux - .merge(vngwObservable, vngw2ObservableSleep) - .map( - obj -> { - if (obj instanceof VirtualNetworkGateway) { - gws.add((VirtualNetworkGateway) obj); - } - return obj; - }) - .blockLast(); - VirtualNetworkGateway vngw1 = gws.get(0); - VirtualNetworkGateway vngw2 = gws.get(1); - vngw1 - .connections() - .define(connectionName) - .withVNetToVNet() - .withSecondVirtualNetworkGateway(vngw2) - .withSharedKey("MySecretKey") - .create(); - vngw2 - .connections() - .define(connectionName + "2") - .withVNetToVNet() - .withSecondVirtualNetworkGateway(vngw1) - .withSharedKey("MySecretKey") - .create(); - PagedIterable connections = vngw1.listConnections(); - Assertions.assertEquals(1, TestUtilities.getSize(connections)); - VirtualNetworkGatewayConnection connection = connections.iterator().next(); - Assertions.assertEquals(vngw1.id(), connection.virtualNetworkGateway1Id()); - Assertions.assertEquals(vngw2.id(), connection.virtualNetworkGateway2Id()); - return vngw1; - } - - @Override - public VirtualNetworkGateway updateResource(VirtualNetworkGateway resource) throws Exception { - resource.connections().deleteByName(connectionName); - PagedIterable connections = resource.listConnections(); - Assertions.assertEquals(0, TestUtilities.getSize(connections)); - return resource; - } - } - - /** Test VNet-to-VNet Virtual Network Gateway Connection. */ - public class PointToSite extends TestTemplate { - - public PointToSite(NetworkManager networkManager) { - initializeResourceNames(networkManager.resourceManager().internalContext()); - } - - @Override - public void print(VirtualNetworkGateway resource) { - printVirtualNetworkGateway(resource); - } - - @Override - public VirtualNetworkGateway createResource(final VirtualNetworkGateways gateways) throws Exception { - - // Create virtual network gateway - initializeResourceNames(gateways.manager().resourceManager().internalContext()); - - Network network = - gateways - .manager() - .networks() - .define(networkName) - .withRegion(region) - .withNewResourceGroup(groupName) - .withAddressSpace("192.168.0.0/16") - .withAddressSpace("10.254.0.0/16") - .withSubnet("GatewaySubnet", "192.168.200.0/24") - .withSubnet("FrontEnd", "192.168.1.0/24") - .withSubnet("BackEnd", "10.254.1.0/24") - .create(); - VirtualNetworkGateway vngw1 = - gateways - .define(gatewayName1) - .withRegion(region) - .withExistingResourceGroup(groupName) - .withExistingNetwork(network) - .withRouteBasedVpn() - .withSku(VirtualNetworkGatewaySkuName.VPN_GW1) - .create(); - - vngw1 - .update() - .definePointToSiteConfiguration() - .withAddressPool("172.16.201.0/24") - .withAzureCertificateFromFile( - certificateName, new File(getClass().getClassLoader().getResource(certificateName).getFile())) - .attach() - .apply(); - - Assertions.assertNotNull(vngw1.vpnClientConfiguration()); - Assertions - .assertEquals( - "172.16.201.0/24", vngw1.vpnClientConfiguration().vpnClientAddressPool().addressPrefixes().get(0)); - Assertions.assertEquals(1, vngw1.vpnClientConfiguration().vpnClientRootCertificates().size()); - Assertions - .assertEquals( - certificateName, vngw1.vpnClientConfiguration().vpnClientRootCertificates().get(0).name()); - String profile = vngw1.generateVpnProfile(); - System.out.println(profile); - return vngw1; - } - - @Override - public VirtualNetworkGateway updateResource(VirtualNetworkGateway vngw1) throws Exception { - vngw1 - .update() - .updatePointToSiteConfiguration() - .withRevokedCertificate(certificateName, "bdf834528f0fff6eaae4c154e06b54322769276c") - .parent() - .apply(); - Assertions - .assertEquals( - certificateName, vngw1.vpnClientConfiguration().vpnClientRevokedCertificates().get(0).name()); - - vngw1.update().updatePointToSiteConfiguration().withoutAzureCertificate(certificateName).parent().apply(); - Assertions.assertEquals(0, vngw1.vpnClientConfiguration().vpnClientRootCertificates().size()); - return vngw1; - } - } - - static void printVirtualNetworkGateway(VirtualNetworkGateway gateway) { - StringBuilder info = new StringBuilder(); - info - .append("Virtual Network Gateway: ") - .append(gateway.id()) - .append("\n\tName: ") - .append(gateway.name()) - .append("\n\tResource group: ") - .append(gateway.resourceGroupName()) - .append("\n\tRegion: ") - .append(gateway.regionName()) - .append("\n\tTags: ") - .append(gateway.tags()); - System.out.println(info.toString()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/VirtualNetworkGatewayTests.java b/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/VirtualNetworkGatewayTests.java deleted file mode 100644 index 6df0e3dcefbb..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/java/com/azure/resourcemanager/VirtualNetworkGatewayTests.java +++ /dev/null @@ -1,194 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager; - -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.policy.HttpLogOptions; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.resourcemanager.network.models.NetworkWatcher; -import com.azure.resourcemanager.network.models.Troubleshooting; -import com.azure.resourcemanager.network.models.VirtualNetworkGateway; -import com.azure.resourcemanager.network.models.VirtualNetworkGatewayConnection; -import com.azure.resourcemanager.network.models.VirtualNetworkGatewaySkuName; -import com.azure.core.management.Region; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.resources.fluentcore.utils.HttpPipelineProvider; -import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; -import com.azure.resourcemanager.storage.models.StorageAccount; -import com.azure.resourcemanager.test.ResourceManagerTestBase; -import com.azure.resourcemanager.test.utils.TestDelayProvider; -import com.azure.resourcemanager.test.utils.TestIdentifierProvider; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -import java.time.Duration; -import java.time.temporal.ChronoUnit; -import java.util.List; - -public class VirtualNetworkGatewayTests extends ResourceManagerTestBase { - private AzureResourceManager azureResourceManager; - - @Override - protected HttpPipeline buildHttpPipeline( - TokenCredential credential, - AzureProfile profile, - HttpLogOptions httpLogOptions, - List policies, - HttpClient httpClient) { - return HttpPipelineProvider.buildHttpPipeline( - credential, - profile, - null, - httpLogOptions, - null, - new RetryPolicy("Retry-After", ChronoUnit.SECONDS), - policies, - httpClient); - } - - @Override - protected void initializeClients(HttpPipeline httpPipeline, AzureProfile profile) { - ResourceManagerUtils.InternalRuntimeContext.setDelayProvider(new TestDelayProvider(!isPlaybackMode())); - ResourceManagerUtils.InternalRuntimeContext internalContext = new ResourceManagerUtils.InternalRuntimeContext(); - internalContext.setIdentifierFunction(name -> new TestIdentifierProvider(testResourceNamer)); - azureResourceManager = buildManager(AzureResourceManager.class, httpPipeline, profile); - setInternalContext(internalContext, azureResourceManager); - } - - @Override - protected void cleanUpResources() { - } - - @Test - @Disabled("Service has bug that cause 'InternalServerError' - record this once service is fixed") - public void testNetworkWatcherTroubleshooting() throws Exception { - String gatewayName = generateRandomResourceName("vngw", 8); - String connectionName = generateRandomResourceName("vngwc", 8); - - TestNetworkWatcher tnw = new TestNetworkWatcher(); - NetworkWatcher nw = tnw.createResource(azureResourceManager.networkWatchers()); - Region region = nw.region(); - String resourceGroup = nw.resourceGroupName(); - - VirtualNetworkGateway vngw1 = - azureResourceManager - .virtualNetworkGateways() - .define(gatewayName) - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .withNewNetwork("10.11.0.0/16", "10.11.255.0/27") - .withRouteBasedVpn() - .withSku(VirtualNetworkGatewaySkuName.VPN_GW1) - .create(); - - VirtualNetworkGateway vngw2 = - azureResourceManager - .virtualNetworkGateways() - .define(gatewayName + "2") - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .withNewNetwork("10.41.0.0/16", "10.41.255.0/27") - .withRouteBasedVpn() - .withSku(VirtualNetworkGatewaySkuName.VPN_GW1) - .create(); - VirtualNetworkGatewayConnection connection1 = - vngw1 - .connections() - .define(connectionName) - .withVNetToVNet() - .withSecondVirtualNetworkGateway(vngw2) - .withSharedKey("MySecretKey") - .create(); - - // Create storage account to store troubleshooting information - StorageAccount storageAccount = - azureResourceManager - .storageAccounts() - .define("sa" + generateRandomResourceName("", 8)) - .withRegion(region) - .withExistingResourceGroup(resourceGroup) - .create(); - - // Troubleshoot connection - Troubleshooting troubleshooting = - nw - .troubleshoot() - .withTargetResourceId(connection1.id()) - .withStorageAccount(storageAccount.id()) - .withStoragePath(storageAccount.endPoints().primary().blob() + "results") - .execute(); - Assertions.assertEquals("UnHealthy", troubleshooting.code()); - - // Create corresponding connection on second gateway to make it work - vngw2 - .connections() - .define(connectionName + "2") - .withVNetToVNet() - .withSecondVirtualNetworkGateway(vngw1) - .withSharedKey("MySecretKey") - .create(); - ResourceManagerUtils.sleep(Duration.ofSeconds(250)); - troubleshooting = - nw - .troubleshoot() - .withTargetResourceId(connection1.id()) - .withStorageAccount(storageAccount.id()) - .withStoragePath(storageAccount.endPoints().primary().blob() + "results") - .execute(); - Assertions.assertEquals("Healthy", troubleshooting.code()); - - azureResourceManager.resourceGroups().deleteByName(resourceGroup); - } - - /** - * Tests the virtual network gateway implementation. - * - * @throws Exception - */ - @Test - public void testVirtualNetworkGateways() throws Exception { - new TestVirtualNetworkGateway().new Basic(azureResourceManager.virtualNetworkGateways().manager()) - .runTest(azureResourceManager.virtualNetworkGateways(), azureResourceManager.resourceGroups()); - } - - /** - * Tests the virtual network gateway and virtual network gateway connection implementations for Site-to-Site - * connection. - * - * @throws Exception - */ - @Test - public void testVirtualNetworkGatewaySiteToSite() throws Exception { - new TestVirtualNetworkGateway().new SiteToSite(azureResourceManager.virtualNetworkGateways().manager()) - .runTest(azureResourceManager.virtualNetworkGateways(), azureResourceManager.resourceGroups()); - } - - /** - * Tests the virtual network gateway and virtual network gateway connection implementations for VNet-to-VNet - * connection. - * - * @throws Exception - */ - @Test - public void testVirtualNetworkGatewayVNetToVNet() throws Exception { - new TestVirtualNetworkGateway().new VNetToVNet(azureResourceManager.virtualNetworkGateways().manager()) - .runTest(azureResourceManager.virtualNetworkGateways(), azureResourceManager.resourceGroups()); - } - - /** - * Tests the virtual network gateway Point-to-Site connection. - * - * @throws Exception - */ - @Test - @Disabled("Service error 'VpnClientRootCertificateDataInvalid' on 'myTest3.cer'") - public void testVirtualNetworkGatewayPointToSite() throws Exception { - new TestVirtualNetworkGateway().new PointToSite(azureResourceManager.virtualNetworkGateways().manager()) - .runTest(azureResourceManager.virtualNetworkGateways(), azureResourceManager.resourceGroups()); - } -} diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/resources/cloud-init b/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/resources/cloud-init deleted file mode 100644 index f620984b5a09..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/resources/cloud-init +++ /dev/null @@ -1,3 +0,0 @@ -#cloud-config -packages: - - pwgen \ No newline at end of file diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/resources/junit-platform.properties b/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/resources/junit-platform.properties deleted file mode 100644 index 202d099b3ee8..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/resources/junit-platform.properties +++ /dev/null @@ -1,4 +0,0 @@ -junit.jupiter.execution.parallel.enabled=true -junit.jupiter.execution.parallel.mode.default=concurrent -junit.jupiter.execution.parallel.config.strategy=fixed -junit.jupiter.execution.parallel.config.fixed.parallelism=32 diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/resources/myTest.cer b/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/resources/myTest.cer deleted file mode 100644 index a3c1b82255c8..000000000000 Binary files a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/resources/myTest.cer and /dev/null differ diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/resources/myTest2.cer b/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/resources/myTest2.cer deleted file mode 100644 index 01587fec655d..000000000000 Binary files a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/resources/myTest2.cer and /dev/null differ diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/resources/myTest3.cer b/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/resources/myTest3.cer deleted file mode 100644 index 445d70543de1..000000000000 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/resources/myTest3.cer +++ /dev/null @@ -1,18 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIC5zCCAc+gAwIBAgIQIdPU05rC0ZZPmYfzuGdI2TANBgkqhkiG9w0BAQsFADAW -MRQwEgYDVQQDDAtQMlNSb290Q2VydDAeFw0xOTA4MTQwMTQwMzVaFw0yMDA4MTQw -MjAwMzVaMBYxFDASBgNVBAMMC1AyU1Jvb3RDZXJ0MIIBIjANBgkqhkiG9w0BAQEF -AAOCAQ8AMIIBCgKCAQEAwDj3Y8k1GUVusuf20r6KMXkv3cw7Hta3WjVP5cg8bdqa -k52QkOr+vylZxdhXjmt3+7AtYj0tSzhwpKWKNmsumQY+vkKmwtUyWxnNkjw+U/ns -CJyeTq/Ho4/Lvqq+uofAOCYAhiYN8wenKJCEkrRGuCbiWe/JreUiLyFQB9GX2mEe -NLhu+0xmM6qLAGkmy2VrJMv1qsOMW/eGA2P6azbd5INj7BhNdD6ZgBVSkkBt15h8 -fp2ldjFPkFIe5CfBUt3kYSubo8yLoswX5kobdStRWyPTtExf+aAz19E6nRo8TYm1 -MA7YkTiEWkq7Q6H5ZRiG9fE7YbE8vHrQLOhUBDBnoQIDAQABozEwLzAOBgNVHQ8B -Af8EBAMCAgQwHQYDVR0OBBYEFHf4D9sCBGhgyuQTDf2Y6MECBNPtMA0GCSqGSIb3 -DQEBCwUAA4IBAQAy24orF87u3L4K00LsFtsIhr0YW7Eb6SPHKVEoKzDsiDF5eOh6 -/ERkdAeYir/laTYa3tbCXGgLx/opAEbSNhtoGK1x7KwGGV+y6Tquxnv+rTEat2rY -Dz8X0lQTlHY9EJWj4D7M9GdrOMZr83xeMwlqzhYSqmBH50otcR3e+rOAsGXL77hX -nVxAVg2LYtXniCjDxYiSUinnn9ViV6mZp5RieyMWF88Y/i+6mqDPAqmvH8d8x/JD -MKUPA8+ABD0cdx5kSjQxsY07k9zAEM3RTOaHHqqcENnyE25yOUHanRf7xT60+F4a -FDA9SSdljEFrx2abboa1Ngy3ilJDkkrBhcP/ ------END CERTIFICATE----- diff --git a/sdk/resourcemanagerhybrid/ci.yml b/sdk/resourcemanagerhybrid/ci.yml deleted file mode 100644 index d1eecf88132b..000000000000 --- a/sdk/resourcemanagerhybrid/ci.yml +++ /dev/null @@ -1,58 +0,0 @@ -# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. -trigger: none -pr: none - -# Safe name uses hybrid at end instead to remove conflict with -# com.azure.resourcemanager.hybridcompute. -extends: - template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml - parameters: - ServiceDirectory: resourcemanagerhybrid - Artifacts: - - name: azure-resourcemanager - groupId: com.azure.resourcemanager - safeName: azureresourcemanagerappservicehybrid - - name: azure-resourcemanager-appservice - groupId: com.azure.resourcemanager - safeName: azureresourcemanagerappservicehybrid - - name: azure-resourcemanager-authorization - groupId: com.azure.resourcemanager - safeName: azureresourcemanagerauthorizationhybrid - - name: azure-resourcemanager-compute - groupId: com.azure.resourcemanager - safeName: azureresourcemanagercomputehybrid - - name: azure-resourcemanager-containerregistry - groupId: com.azure.resourcemanager - safeName: azureresourcemanagercontainerregistryhybrid - - name: azure-resourcemanager-containerservice - groupId: com.azure.resourcemanager - safeName: azureresourcemanagercontainerservicehybrid - - name: azure-resourcemanager-dns - groupId: com.azure.resourcemanager - safeName: azureresourcemanagerdnshybrid - - name: azure-resourcemanager-eventhubs - groupId: com.azure.resourcemanager - safeName: azureresourcemanagereventhubshybrid - - name: azure-resourcemanager-keyvault - groupId: com.azure.resourcemanager - safeName: azureresourcemanagerkeyvaulthybrid - - name: azure-resourcemanager-monitor - groupId: com.azure.resourcemanager - safeName: azureresourcemanagermonitorhybrid - - name: azure-resourcemanager-network - groupId: com.azure.resourcemanager - safeName: azureresourcemanagernetworkhybrid - - name: azure-resourcemanager-resources - groupId: com.azure.resourcemanager - safeName: azureresourcemanagerresourceshybrid - - name: azure-resourcemanager-storage - groupId: com.azure.resourcemanager - safeName: azureresourcemanagerstoragehybrid - MatrixFilters: - - TestFromSource=^$|false - PreBuildSteps: - - task: PythonScript@0 - displayName: 'Set sdk/resourcemanagerhyrbid in root POM' - inputs: - scriptPath: 'sdk/resourcemanagerhybrid/update_root_pom.py' - workingDirectory: '$(System.DefaultWorkingDirectory)' diff --git a/sdk/resourcemanagerhybrid/pom.xml b/sdk/resourcemanagerhybrid/pom.xml deleted file mode 100644 index b5e8ab22ada9..000000000000 --- a/sdk/resourcemanagerhybrid/pom.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - 4.0.0 - com.azure - azure-resourcemanager-service - pom - 1.0.0-hybrid - - - - - com.azure.tools - codesnippet-maven-plugin - 1.0.0-beta.10 - - ${project.basedir}/azure-resourcemanager/src/samples/java - false - ${codesnippet.skip} - - - - update-codesnippets - - update-codesnippet - - - - verify-codesnippets - - verify-codesnippet - - - - - - - - - azure-resourcemanager - azure-resourcemanager-appservice - azure-resourcemanager-authorization - azure-resourcemanager-compute - azure-resourcemanager-containerregistry - azure-resourcemanager-containerservice - azure-resourcemanager-dns - azure-resourcemanager-eventhubs - azure-resourcemanager-keyvault - azure-resourcemanager-monitor - azure-resourcemanager-network - azure-resourcemanager-resources - azure-resourcemanager-storage - azure-resourcemanager-test - - diff --git a/sdk/resourcemanagerhybrid/update_root_pom.py b/sdk/resourcemanagerhybrid/update_root_pom.py deleted file mode 100644 index 13e86ab9b076..000000000000 --- a/sdk/resourcemanagerhybrid/update_root_pom.py +++ /dev/null @@ -1,7 +0,0 @@ -with open('pom.xml', 'r') as file: - filedata = file.read() - -filedata = filedata.replace('sdk/resourcemanager', 'sdk/resourcemanagerhybrid') - -with open('pom.xml', 'w') as file: - file.write(filedata)